diff --git a/src/com/sipai/activiti/Test.java b/src/com/sipai/activiti/Test.java deleted file mode 100644 index 26fcb867..00000000 --- a/src/com/sipai/activiti/Test.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.sipai.activiti; - -import com.sipai.tools.CommUtil; - -public class Test { - public static void main(String[] args) { - int a = 3; - int b = 3; - System.out.println(a % b); - } -} diff --git a/src/com/sipai/activiti/cmd/JumpActivityCmd.java b/src/com/sipai/activiti/cmd/JumpActivityCmd.java deleted file mode 100644 index 648fc6c7..00000000 --- a/src/com/sipai/activiti/cmd/JumpActivityCmd.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.activiti.cmd; - -/** - * @author: Henry Yan - */ - -import org.activiti.engine.impl.interceptor.Command; -import org.activiti.engine.impl.interceptor.CommandContext; -import org.activiti.engine.impl.persistence.entity.ExecutionEntity; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl; - -public class JumpActivityCmd implements Command { - private String activityId; - private String processInstanceId; - private String jumpOrigin; - - public JumpActivityCmd(String processInstanceId, String activityId) { - this(processInstanceId, activityId, "jump"); - } - - public JumpActivityCmd(String processInstanceId, String activityId, String jumpOrigin) { - this.activityId = activityId; - this.processInstanceId = processInstanceId; - this.jumpOrigin = jumpOrigin; - } - - public Object execute(CommandContext commandContext) { - - ExecutionEntity executionEntity = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId); - - executionEntity.destroyScope(jumpOrigin); - - ProcessDefinitionImpl processDefinition = executionEntity.getProcessDefinition(); - ActivityImpl activity = processDefinition.findActivity(activityId); - executionEntity.executeActivity(activity); - return executionEntity; - } -} diff --git a/src/com/sipai/activiti/form/UsersFormType.java b/src/com/sipai/activiti/form/UsersFormType.java deleted file mode 100644 index 2e69c167..00000000 --- a/src/com/sipai/activiti/form/UsersFormType.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.activiti.form; - -import org.activiti.engine.form.AbstractFormType; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; - -import java.util.Arrays; - -/** - * 用户表单字段类型 - * - * @author henryyan - */ -public class UsersFormType extends AbstractFormType { - - @Override - public String getName() { - return "users"; - } - - @Override - public Object convertFormValueToModelValue(String propertyValue) { - String[] split = StringUtils.split(propertyValue, ","); - return Arrays.asList(split); - } - - @Override - public String convertModelValueToFormValue(Object modelValue) { - return ObjectUtils.toString(modelValue); - } - -} diff --git a/src/com/sipai/activiti/util/DateConverter.java b/src/com/sipai/activiti/util/DateConverter.java deleted file mode 100644 index 6803f6da..00000000 --- a/src/com/sipai/activiti/util/DateConverter.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.activiti.util; - -import org.apache.commons.beanutils.Converter; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.log4j.Logger; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -public class DateConverter implements Converter { - - private static final Logger logger = Logger.getLogger(DateConverter.class); - - private static final String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; - - private static final String DATETIME_PATTERN_NO_SECOND = "yyyy-MM-dd HH:mm"; - - private static final String DATE_PATTERN = "yyyy-MM-dd"; - - private static final String MONTH_PATTERN = "yyyy-MM"; - - @SuppressWarnings("rawtypes") - public Object convert(Class type, Object value) { - Object result = null; - if (type == Date.class) { - try { - result = doConvertToDate(value); - } catch (ParseException e) { - e.printStackTrace(); - } - } else if (type == String.class) { - result = doConvertToString(value); - } - return result; - } - - /** - * Convert String to Date - * - * @param value - * @return - * @throws ParseException - */ - private Date doConvertToDate(Object value) throws ParseException { - Date result = null; - - if (value instanceof String) { - result = DateUtils.parseDate((String) value, new String[]{DATE_PATTERN, DATETIME_PATTERN, - DATETIME_PATTERN_NO_SECOND, MONTH_PATTERN}); - - // all patterns failed, try a milliseconds constructor - if (result == null && StringUtils.isNotEmpty((String) value)) { - - try { - result = new Date(new Long((String) value).longValue()); - } catch (Exception e) { - logger.error("Converting from milliseconds to Date fails!"); - e.printStackTrace(); - } - - } - - } else if (value instanceof Object[]) { - // let's try to convert the first element only - Object[] array = (Object[]) value; - - if (array.length >= 1) { - value = array[0]; - result = doConvertToDate(value); - } - - } else if (Date.class.isAssignableFrom(value.getClass())) { - result = (Date) value; - } - return result; - } - - /** - * Convert Date to String - * - * @param value - * @return - */ - private String doConvertToString(Object value) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATETIME_PATTERN); - String result = null; - if (value instanceof Date) { - result = simpleDateFormat.format(value); - } - return result; - } - -} diff --git a/src/com/sipai/activiti/util/LinkedProperties.java b/src/com/sipai/activiti/util/LinkedProperties.java deleted file mode 100644 index 63764006..00000000 --- a/src/com/sipai/activiti/util/LinkedProperties.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.activiti.util; - -import java.io.PrintStream; -import java.io.PrintWriter; -import java.util.*; - -/** - * 有序Properties - */ -public class LinkedProperties extends Properties { - private static final long serialVersionUID = 1L; - private Map linkMap = new LinkedHashMap(); - - public void clear() { - linkMap.clear(); - } - - public boolean contains(Object value) { - return linkMap.containsValue(value); - } - - public boolean containsKey(Object key) { - return linkMap.containsKey(key); - } - - public boolean containsValue(Object value) { - return linkMap.containsValue(value); - } - - public Enumeration elements() { - throw new RuntimeException("Method elements is not supported in LinkedProperties class"); - } - - public Set entrySet() { - return linkMap.entrySet(); - } - - public boolean equals(Object o) { - return linkMap.equals(o); - } - - public Object get(Object key) { - return linkMap.get(key); - } - - public String getProperty(String key) { - Object oval = get(key); //here the class Properties uses super.get() - if (oval == null) return null; - return (oval instanceof String) ? (String) oval : null; //behavior of standard properties - } - - public boolean isEmpty() { - return linkMap.isEmpty(); - } - - public Enumeration keys() { - Set keys = linkMap.keySet(); - return Collections.enumeration(keys); - } - - public Set keySet() { - return linkMap.keySet(); - } - - public void list(PrintStream out) { - this.list(new PrintWriter(out, true)); - } - - public void list(PrintWriter out) { - out.println("-- listing properties --"); - for (Map.Entry e : (Set) this.entrySet()) { - String key = (String) e.getKey(); - String val = (String) e.getValue(); - if (val.length() > 40) { - val = val.substring(0, 37) + "..."; - } - out.println(key + "=" + val); - } - } - - public Object put(Object key, Object value) { - return linkMap.put(key, value); - } - - public int size() { - return linkMap.size(); - } - - public Collection values() { - return linkMap.values(); - } - -} \ No newline at end of file diff --git a/src/com/sipai/activiti/util/Page.java b/src/com/sipai/activiti/util/Page.java deleted file mode 100644 index 1926059e..00000000 --- a/src/com/sipai/activiti/util/Page.java +++ /dev/null @@ -1,258 +0,0 @@ -package com.sipai.activiti.util; - -import com.google.common.collect.Lists; -import org.apache.commons.lang3.StringUtils; - -import java.util.List; - -/** - * @author HenryYan - */ -public class Page { - - // -- 公共变量 --// - public static final String ASC = "asc"; - public static final String DESC = "desc"; - - // -- 分页参数 --// - protected int pageNo = 1; - protected int pageSize = -1; - protected String orderBy = null; - protected String order = null; - protected boolean autoCount = true; - - // -- 返回结果 --// - protected List result = Lists.newArrayList(); - protected long totalCount = -1; - - // -- 构造函数 --// - public Page() { - } - - public Page(int pageSize) { - this.pageSize = pageSize; - } - - // -- 分页参数访问函数 --// - - /** - * 获得当前页的页号,序号从1开始,默认为1. - */ - public int getPageNo() { - return pageNo; - } - - /** - * 设置当前页的页号,序号从1开始,低于1时自动调整为1. - */ - public void setPageNo(final int pageNo) { - this.pageNo = pageNo; - - if (pageNo < 1) { - this.pageNo = 1; - } - } - - /** - * 返回Page对象自身的setPageNo函数,可用于连续设置。 - */ - public Page pageNo(final int thePageNo) { - setPageNo(thePageNo); - return this; - } - - /** - * 获得每页的记录数量, 默认为-1. - */ - public int getPageSize() { - return pageSize; - } - - /** - * 设置每页的记录数量. - */ - public void setPageSize(final int pageSize) { - this.pageSize = pageSize; - } - - /** - * 返回Page对象自身的setPageSize函数,可用于连续设置。 - */ - public Page pageSize(final int thePageSize) { - setPageSize(thePageSize); - return this; - } - - /** - * 根据pageNo和pageSize计算当前页第一条记录在总结果集中的位置,序号从1开始. - */ - public int getFirst() { - return ((pageNo - 1) * pageSize) + 1; - } - - /** - * 获得排序字段,无默认值. 多个排序字段时用','分隔. - */ - public String getOrderBy() { - return orderBy; - } - - /** - * 设置排序字段,多个排序字段时用','分隔. - */ - public void setOrderBy(final String orderBy) { - this.orderBy = orderBy; - } - - /** - * 返回Page对象自身的setOrderBy函数,可用于连续设置。 - */ - public Page orderBy(final String theOrderBy) { - setOrderBy(theOrderBy); - return this; - } - - /** - * 获得排序方向, 无默认值. - */ - public String getOrder() { - return order; - } - - /** - * 设置排序方式向. - * - * @param order 可选值为desc或asc,多个排序字段时用','分隔. - */ - public void setOrder(final String order) { - String lowcaseOrder = StringUtils.lowerCase(order); - - // 检查order字符串的合法值 - String[] orders = StringUtils.split(lowcaseOrder, ','); - for (String orderStr : orders) { - if (!StringUtils.equals(DESC, orderStr) && !StringUtils.equals(ASC, orderStr)) { - throw new IllegalArgumentException("排序方向" + orderStr + "不是合法值"); - } - } - - this.order = lowcaseOrder; - } - - /** - * 返回Page对象自身的setOrder函数,可用于连续设置。 - */ - public Page order(final String theOrder) { - setOrder(theOrder); - return this; - } - - /** - * 是否已设置排序字段,无默认值. - */ - public boolean isOrderBySetted() { - return (StringUtils.isNotBlank(orderBy) && StringUtils.isNotBlank(order)); - } - - /** - * 获得查询对象时是否先自动执行count查询获取总记录数, 默认为false. - */ - public boolean isAutoCount() { - return autoCount; - } - - /** - * 设置查询对象时是否自动先执行count查询获取总记录数. - */ - public void setAutoCount(final boolean autoCount) { - this.autoCount = autoCount; - } - - /** - * 返回Page对象自身的setAutoCount函数,可用于连续设置。 - */ - public Page autoCount(final boolean theAutoCount) { - setAutoCount(theAutoCount); - return this; - } - - // -- 访问查询结果函数 --// - - /** - * 获得页内的记录列表. - */ - public List getResult() { - return result; - } - - /** - * 设置页内的记录列表. - */ - public void setResult(final List result) { - this.result = result; - } - - /** - * 获得总记录数, 默认值为-1. - */ - public long getTotalCount() { - return totalCount; - } - - /** - * 设置总记录数. - */ - public void setTotalCount(final long totalCount) { - this.totalCount = totalCount; - } - - /** - * 根据pageSize与totalCount计算总页数, 默认值为-1. - */ - public long getTotalPages() { - if (totalCount < 0) { - return -1; - } - - long count = totalCount / pageSize; - if (totalCount % pageSize > 0) { - count++; - } - return count; - } - - /** - * 是否还有下一页. - */ - public boolean isHasNext() { - return (pageNo + 1 <= getTotalPages()); - } - - /** - * 取得下页的页号, 序号从1开始. 当前页为尾页时仍返回尾页序号. - */ - public int getNextPage() { - if (isHasNext()) { - return pageNo + 1; - } else { - return pageNo; - } - } - - /** - * 是否还有上一页. - */ - public boolean isHasPre() { - return (pageNo - 1 >= 1); - } - - /** - * 取得上页的页号, 序号从1开始. 当前页为首页时返回首页序号. - */ - public int getPrePage() { - if (isHasPre()) { - return pageNo - 1; - } else { - return pageNo; - } - } -} diff --git a/src/com/sipai/activiti/util/PageUtil.java b/src/com/sipai/activiti/util/PageUtil.java deleted file mode 100644 index 5444affe..00000000 --- a/src/com/sipai/activiti/util/PageUtil.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.activiti.util; - -import org.apache.commons.lang3.StringUtils; - -import javax.servlet.http.HttpServletRequest; - -/** - * 分页工具 - * - * @author henryyan - */ -public class PageUtil { - - public static int PAGE_SIZE = 50; - - public static int[] init(Page page, HttpServletRequest request) { - int pageNumber = Integer.parseInt(StringUtils.defaultIfBlank(request.getParameter("p"), "1")); - page.setPageNo(pageNumber); - int pageSize = Integer.parseInt(StringUtils.defaultIfBlank(request.getParameter("ps"), String.valueOf(PAGE_SIZE))); - page.setPageSize(pageSize); - int firstResult = page.getFirst() - 1; - int maxResults = page.getPageSize(); - return new int[]{firstResult, maxResults}; - } - -} diff --git a/src/com/sipai/activiti/util/ProcessDefinitionCache.java b/src/com/sipai/activiti/util/ProcessDefinitionCache.java deleted file mode 100644 index 33c262d5..00000000 --- a/src/com/sipai/activiti/util/ProcessDefinitionCache.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.activiti.util; - -import com.google.common.collect.Maps; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.ProcessDefinition; -import org.apache.commons.lang3.ObjectUtils; - -import java.util.List; -import java.util.Map; - -/** - * 流程定义缓存 - * - * @author henryyan - */ -public class ProcessDefinitionCache { - - private static Map map = Maps.newHashMap(); - - private static Map> activities = Maps.newHashMap(); - - private static Map singleActivity = Maps.newHashMap(); - - private static RepositoryService repositoryService; - - public static ProcessDefinition get(String processDefinitionId) { - ProcessDefinition processDefinition = map.get(processDefinitionId); - if (processDefinition == null) { - processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefinitionId); - if (processDefinition != null) { - put(processDefinitionId, processDefinition); - } - } - return processDefinition; - } - - public static void put(String processDefinitionId, ProcessDefinition processDefinition) { - map.put(processDefinitionId, processDefinition); - ProcessDefinitionEntity pde = (ProcessDefinitionEntity) processDefinition; - activities.put(processDefinitionId, pde.getActivities()); - for (ActivityImpl activityImpl : pde.getActivities()) { - singleActivity.put(processDefinitionId + "_" + activityImpl.getId(), activityImpl); - } - } - - public static ActivityImpl getActivity(String processDefinitionId, String activityId) { - ProcessDefinition processDefinition = get(processDefinitionId); - if (processDefinition != null) { - ActivityImpl activityImpl = singleActivity.get(processDefinitionId + "_" + activityId); - if (activityImpl != null) { - return activityImpl; - } - } - return null; - } - - public static String getActivityName(String processDefinitionId, String activityId) { - ActivityImpl activity = getActivity(processDefinitionId, activityId); - if (activity != null) { - return ObjectUtils.toString(activity.getProperty("name")); - } - return null; - } - - public static void setRepositoryService(RepositoryService repositoryService) { - ProcessDefinitionCache.repositoryService = repositoryService; - } - -} diff --git a/src/com/sipai/activiti/util/PropertyFileUtil.java b/src/com/sipai/activiti/util/PropertyFileUtil.java deleted file mode 100644 index f92ace15..00000000 --- a/src/com/sipai/activiti/util/PropertyFileUtil.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.sipai.activiti.util; - -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.core.io.DefaultResourceLoader; -import org.springframework.core.io.Resource; -import org.springframework.core.io.ResourceLoader; -import org.springframework.util.DefaultPropertiesPersister; -import org.springframework.util.PropertiesPersister; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.*; - -/** - * 系统属性工具类 - * - * @author HenryYan - */ -public class PropertyFileUtil { - - - private static final String DEFAULT_ENCODING = "UTF-8"; - private static Logger logger = LoggerFactory.getLogger(PropertyFileUtil.class); - private static Properties properties; - private static PropertiesPersister propertiesPersister = new DefaultPropertiesPersister(); - private static ResourceLoader resourceLoader = new DefaultResourceLoader(); - private static Properties activePropertyFiles = null; - private static String PROFILE_ID = StringUtils.EMPTY; - public static boolean INITIALIZED = false; // 是否已初始化 - - /** - * 初始化读取配置文件,读取的文件列表位于classpath下面的application-files.properties
- *

- * 多个配置文件会用最后面的覆盖相同属性值 - * - * @throws IOException 读取属性文件时 - */ - public static void init() throws IOException { - String fileNames = "application-files.properties"; - PROFILE_ID = StringUtils.EMPTY; - innerInit(fileNames); - activePropertyFiles(fileNames); - INITIALIZED = true; - } - - /** - * 初始化读取配置文件,读取的文件列表位于classpath下面的application-[type]-files.properties
- *

- * 多个配置文件会用最后面的覆盖相同属性值 - * - * @param profile 配置文件类型,application-[profile]-files.properties - * @throws IOException 读取属性文件时 - */ - public static void init(String profile) throws IOException { - if (StringUtils.isBlank(profile)) { - init(); - } else { - PROFILE_ID = profile; - String fileNames = "application-" + profile + "-files.properties"; - innerInit(fileNames); - } - INITIALIZED = true; - } - - /** - * 内部处理 - * - * @param fileName - * @throws IOException - */ - private static void innerInit(String fileName) throws IOException { - String[] propFiles = activePropertyFiles(fileName); - logger.debug("读取属性文件:{}", ArrayUtils.toString(propFiles)); - properties = loadProperties(propFiles); - Set keySet = properties.keySet(); - for (Object key : keySet) { - logger.debug("property: {}, value: {}", key, properties.getProperty(key.toString())); - } - } - - /** - * 获取读取的资源文件列表 - * - * @param fileName - * @return - * @throws IOException - */ - private static String[] activePropertyFiles(String fileName) throws IOException { - logger.info("读取" + fileName); - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - InputStream resourceAsStream = loader.getResourceAsStream(fileName); - // 默认的Properties实现使用HashMap算法,为了保持原有顺序使用有序Map - activePropertyFiles = new LinkedProperties(); - activePropertyFiles.load(resourceAsStream); - - Set fileKeySet = activePropertyFiles.keySet(); - String[] propFiles = new String[fileKeySet.size()]; - List fileList = new ArrayList(); - - fileList.addAll(activePropertyFiles.keySet()); - for (int i = 0; i < propFiles.length; i++) { - String fileKey = fileList.get(i).toString(); - propFiles[i] = activePropertyFiles.getProperty(fileKey); - } - return propFiles; - } - - /** - * 载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的载入. - * 文件路径使用Spring Resource格式, 文件编码使用UTF-8. - * - * @see org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - */ - public static Properties loadProperties(String... resourcesPaths) throws IOException { - Properties props = new Properties(); - - for (String location : resourcesPaths) { - - logger.debug("Loading properties file from:" + location); - - InputStream is = null; - try { - Resource resource = resourceLoader.getResource(location); - is = resource.getInputStream(); - propertiesPersister.load(props, new InputStreamReader(is, DEFAULT_ENCODING)); - } catch (IOException ex) { - logger.info("Could not load properties from classpath:" + location + ": " + ex.getMessage()); - } finally { - if (is != null) { - is.close(); - } - } - } - return props; - } - - /** - * 获取所有的key - * - * @return - */ - public static Set getKeys() { - return properties.stringPropertyNames(); - } - - /** - * 获取键值对Map - * - * @return - */ - public static Map getKeyValueMap() { - Set keys = getKeys(); - Map values = new HashMap(); - for (String key : keys) { - values.put(key, get(key)); - } - return values; - } - - /** - * 获取属性值 - * - * @param key 键 - * @return 值 - */ - public static String get(String key) { - String propertyValue = properties.getProperty(key); - logger.debug("获取属性:{},值:{}", key, propertyValue); - return propertyValue; - } - - /** - * 获取属性值 - * - * @param key 键 - * @param defaultValue 默认值 - * @return 值 - */ - public static String get(String key, String defaultValue) { - String propertyValue = properties.getProperty(key); - String value = StringUtils.defaultString(propertyValue, defaultValue); - logger.debug("获取属性:{},值:{}", key, value); - return value; - } - - /** - * 向内存添加属性 - * - * @param key 键 - * @param value 值 - */ - public static void add(String key, String value) { - properties.put(key, value); - logger.debug("通过方法添加属性到内存:{},值:{}", key, value); - } - - public static Properties getActivePropertyFiles() { - return activePropertyFiles; - } - - public static String getProfile() { - return PROFILE_ID; - } -} \ No newline at end of file diff --git a/src/com/sipai/activiti/util/PropertyType.java b/src/com/sipai/activiti/util/PropertyType.java deleted file mode 100644 index bd6d3c83..00000000 --- a/src/com/sipai/activiti/util/PropertyType.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.activiti.util; - -import java.util.ArrayList; -import java.util.Date; - -/** - * 属性数据类型 - * - * @author HenryYan - */ -public enum PropertyType { - S(String.class), I(Integer.class), L(Long.class), F(Float.class), N(Double.class), D(Date.class), SD(java.sql.Date.class), B( - Boolean.class); - - private Class clazz; - - private PropertyType(Class clazz) { - this.clazz = clazz; - } - - public Class getValue() { - return clazz; - } -} \ No newline at end of file diff --git a/src/com/sipai/activiti/util/UserUtil.java b/src/com/sipai/activiti/util/UserUtil.java deleted file mode 100644 index 7324e5ba..00000000 --- a/src/com/sipai/activiti/util/UserUtil.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.activiti.util; - -import org.activiti.engine.identity.User; - -import javax.servlet.http.HttpSession; - -/** - * 用户工具类 - * - * @author HenryYan - */ -public class UserUtil { - - public static final String USER = "user"; - - /** - * 设置用户到session - * - * @param session - * @param user - */ - public static void saveUserToSession(HttpSession session, User user) { - session.setAttribute(USER, user); - } - - /** - * 从Session获取当前用户信息 - * - * @param session - * @return - */ - public static User getUserFromSession(HttpSession session) { - Object attribute = session.getAttribute(USER); - return attribute == null ? null : (User) attribute; - } - -} diff --git a/src/com/sipai/activiti/util/Variable.java b/src/com/sipai/activiti/util/Variable.java deleted file mode 100644 index 26444698..00000000 --- a/src/com/sipai/activiti/util/Variable.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.activiti.util; - -import jodd.util.StringUtil; - -import org.apache.commons.beanutils.ConvertUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -public class Variable { - - private String keys; - private String values; - private String types; - - public String getKeys() { - return keys; - } - - public void setKeys(String keys) { - this.keys = keys; - } - - public String getValues() { - return values; - } - - public void setValues(String values) { - this.values = values; - } - - public String getTypes() { - return types; - } - - public void setTypes(String types) { - this.types = types; - } - - public Map getVariableMap() { - Map vars = new HashMap(); - - ConvertUtils.register(new DateConverter(), java.util.Date.class); - - if (StringUtil.isBlank(keys)) { - return vars; - } - - String[] arrayKey = keys.split(","); - String[] arrayValue = values.split(","); - String[] arrayType = types.split(","); - for (int i = 0; i < arrayKey.length; i++) { - if ("".equals(arrayKey[i]) || "".equals(arrayValue[i]) || "".equals(arrayType[i])) { - continue; - } - String key = arrayKey[i]; - String value = arrayValue[i]; - String type = arrayType[i]; - Object objectValue=null; - if(!type.equals("A")){ - Class targetType = Enum.valueOf(PropertyType.class, type).getValue(); - objectValue = ConvertUtils.convert(value, targetType); - }else{ - //如果变量为ArrayList需特别处理 - String[] list =value.split("-"); - objectValue=new ArrayList(); - for (String str : list) { - ((ArrayList)objectValue).add(str); - } - } - vars.put(key, objectValue); - } - return vars; - } - -} diff --git a/src/com/sipai/activiti/util/WorkflowUtils.java b/src/com/sipai/activiti/util/WorkflowUtils.java deleted file mode 100644 index 307fe757..00000000 --- a/src/com/sipai/activiti/util/WorkflowUtils.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.activiti.util; - -import org.activiti.engine.RepositoryService; -import org.activiti.engine.repository.ProcessDefinition; -import org.apache.commons.io.FileUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -/** - * @author HenryYan - */ -public class WorkflowUtils { - - private static Logger logger = LoggerFactory.getLogger(WorkflowUtils.class); - - /** - * 转换流程节点类型为中文说明 - * - * @param type 英文名称 - * @return 翻译后的中文名称 - */ - public static String parseToZhType(String type) { - Map types = new HashMap(); - types.put("userTask", "用户任务"); - types.put("serviceTask", "系统任务"); - types.put("startEvent", "开始节点"); - types.put("endEvent", "结束节点"); - types.put("exclusiveGateway", "条件判断节点(系统自动根据条件处理)"); - types.put("inclusiveGateway", "并行处理任务"); - types.put("callActivity", "子流程"); - return types.get(type) == null ? type : types.get(type); - } - - /** - * 导出图片文件到硬盘 - * - * @return 文件的全路径 - */ - public static String exportDiagramToFile(RepositoryService repositoryService, ProcessDefinition processDefinition, String exportDir) throws IOException { - String diagramResourceName = processDefinition.getDiagramResourceName(); - String key = processDefinition.getKey(); - int version = processDefinition.getVersion(); - String diagramPath = ""; - - InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), diagramResourceName); - byte[] b = new byte[resourceAsStream.available()]; - - @SuppressWarnings("unused") - int len = -1; - resourceAsStream.read(b, 0, b.length); - - // create file if not exist - String diagramDir = exportDir + "/" + key + "/" + version; - File diagramDirFile = new File(diagramDir); - if (!diagramDirFile.exists()) { - diagramDirFile.mkdirs(); - } - diagramPath = diagramDir + "/" + diagramResourceName; - File file = new File(diagramPath); - - // 文件存在退出 - if (file.exists()) { - // 文件大小相同时直接返回否则重新创建文件(可能损坏) - logger.debug("diagram exist, ignore... : {}", diagramPath); - return diagramPath; - } else { - file.createNewFile(); - } - - logger.debug("export diagram to : {}", diagramPath); - - // wirte bytes to file - FileUtils.writeByteArrayToFile(file, b); - return diagramPath; - } - -} diff --git a/src/com/sipai/config/RedissonConfig.java b/src/com/sipai/config/RedissonConfig.java deleted file mode 100644 index 3e4bc8f3..00000000 --- a/src/com/sipai/config/RedissonConfig.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.config; - -import org.redisson.Redisson; -import org.redisson.api.RedissonClient; -import org.redisson.client.codec.Codec; -import org.redisson.codec.JsonJacksonCodec; -import org.redisson.config.Config; -import org.redisson.config.SingleServerConfig; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * @Author : YYJ - * @CreateTime : 2021/9/14 - * @Description : - **/ -@Configuration -public class RedissonConfig { - private static String MODE_SINGLE = "single"; - private static String MODE_CLUSTER = "cluster"; - @Value("${redis.mode}") - public String mode; - @Value("${redis.host}") - public String host; - - @Value("${redis.port}") - public String port; - -// @Value("${redis.database}") -// public String database; - - @Value("${redis.password}") - public String password; - -让他 @Value("${cluster1.host.port:}") - public String cluster1; - @Value("${cluster2.host.port:}") - public String cluster2; - @Value("${cluster3.host.port:}") - public String cluster3; - @Value("${cluster4.host.port:}") - public String cluster4; - @Value("${cluster5.host.port:}") - public String cluster5; - @Value("${cluster6.host.port:}") - public String cluster6; - - @Bean - public RedissonClient redissonClient(){ - RedissonClient redisson = null; - Config conf = new Config(); - - if(MODE_SINGLE.equals(mode)) {//单机 - //单节点模式 - SingleServerConfig singleServerConfig = conf.useSingleServer(); - //设置连接地址:redis://127.0.0.1:6379 - singleServerConfig.setAddress("redis://" + host + ":" + port); - //设置连接密码 - singleServerConfig.setPassword(password); -// singleServerConfig.setDatabase(Integer.valueOf(database)); - }else if(MODE_CLUSTER.equals(mode)){//集群 - conf.useClusterServers() - .setScanInterval(2000); - if(cluster1!=null && !cluster1.isEmpty()){ - conf.useClusterServers().addNodeAddress("redis://" + cluster1); - } - if(cluster2!=null && !cluster2.isEmpty()){ - conf.useClusterServers().addNodeAddress("redis://" + cluster2); - } - if(cluster3!=null && !cluster3.isEmpty()){ - conf.useClusterServers().addNodeAddress("redis://" + cluster3); - } - if(cluster4!=null && !cluster4.isEmpty()){ - conf.useClusterServers().addNodeAddress("redis://" + cluster4); - } - if(cluster5!=null && !cluster5.isEmpty()){ - conf.useClusterServers().addNodeAddress("redis://" + cluster5); - } - if(cluster6!=null && !cluster6.isEmpty()){ - conf.useClusterServers().addNodeAddress("redis://" + cluster6); - } -// .setPassword(password); - } - - //使用json序列化方式 - Codec codec = new JsonJacksonCodec(); - conf.setCodec(codec); - redisson = Redisson.create(conf); - return redisson; - } -} diff --git a/src/com/sipai/controller/DBController.java b/src/com/sipai/controller/DBController.java deleted file mode 100644 index 2a312ba6..00000000 --- a/src/com/sipai/controller/DBController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.controller; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.Result; -import com.sipai.tools.CommUtil; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/data/db") -public class DBController { - - @RequestMapping(value = "/handle.do", method = RequestMethod.POST) -// @RequestMapping(value = "/handle.do") - public ModelAndView handle(HttpServletRequest request, Model model) { - String json = request.getParameter("json"); - System.out.println(CommUtil.nowDate() + "------" + json); - if (json != null && !json.trim().equals("")) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code", "100"); - jsonObject.put("message", ""); - model.addAttribute("result", jsonObject); - } else { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code", "400"); - jsonObject.put("message", "json为空,请重新请求"); - model.addAttribute("result", jsonObject); - } - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/Listener/ListenerMessageController.java b/src/com/sipai/controller/Listener/ListenerMessageController.java deleted file mode 100644 index 4977e8da..00000000 --- a/src/com/sipai/controller/Listener/ListenerMessageController.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.controller.Listener; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.workorder.OverhaulService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2021/11/21/16:59 - * @Description: - */ -@Controller -@RequestMapping("/listener/listenerMessage") -public class ListenerMessageController { - @Resource - private ListenerMessageService listenerMessageService; - @Resource - private EquipmentCardService equipmentCardService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by insdt desc"; - - String wherestr = " where 1=1 and Cmdtype='web' and Action = 'layer' and DateDiff(dd,insdt,getdate())=0"; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "' "; - } - List list = this.listenerMessageService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - - System.out.println(json); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getList4Equ.do") - public ModelAndView getList4Equ(HttpServletRequest request, Model model) { - String equipmentcardId = request.getParameter("equipmentcardId"); - String orderstr = " order by insdt desc"; - - String wherestr = " where 1=1 and Cmdtype='web' and Action = 'layer' and DateDiff(dd,insdt,getdate())=0"; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "' "; - } - String equipmentId = ""; - if(equipmentcardId!=null && !equipmentcardId.equals("")){ - EquipmentCard equipmentCard = equipmentCardService.selectByEquipmentCardId(equipmentcardId); - if(equipmentCard!=null){ - equipmentId = equipmentCard.getId(); - } - } - List list = this.listenerMessageService.selectListByWhere4Equ(wherestr + orderstr,equipmentId); - JSONArray json = JSONArray.fromObject(list); - - System.out.println(json); - model.addAttribute("result", json); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/accident/AccidentController.java b/src/com/sipai/controller/accident/AccidentController.java deleted file mode 100644 index 87986ea0..00000000 --- a/src/com/sipai/controller/accident/AccidentController.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.sipai.controller.accident; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.accident.Accident; -import com.sipai.entity.accident.AccidentType; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.accident.AccidentService; -import com.sipai.service.accident.AccidentTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/accident/accident") -public class AccidentController { - @Resource - private AccidentService accidentService; - @Resource - private AccidentTypeService accidentTypeService; - @Resource - private UnitService unitService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - return "/accident/accidentList"; - } - - @RequestMapping("/browseList.do") - public String browseList(HttpServletRequest request,Model model){ - return "/accident/accidentBrowse"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("unitId"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1"; - if(companyId!=null && !companyId.isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and unit_id in ("+companyids+") "; - } - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.accidentService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/accident/accidentAdd"; - } - - @RequestMapping("/showAccidentType4Select.do") - public String showAccidentType4Select(HttpServletRequest request,Model model){ - return "/accident/accidentType4select4Use"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Accident accident){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - accident.setId(CommUtil.getUUID()); - accident.setInsdt(CommUtil.nowDate()); - accident.setInsuser(userId); - int code = this.accidentService.save(accident); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Accident accident = this.accidentService.selectById(id); - model.addAttribute("accident", accident); - return "/accident/accidentEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Accident accident = this.accidentService.selectById(id); - model.addAttribute("accident", accident); - return "/accident/accidentView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Accident accident){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.accidentService.update(accident); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @ModelAttribute AccidentType accidentType){ - Result result = new Result(); - int code = this.accidentService.deleteById(accidentType.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.accidentService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/accident/AccidentTypeController.java b/src/com/sipai/controller/accident/AccidentTypeController.java deleted file mode 100644 index f04487b1..00000000 --- a/src/com/sipai/controller/accident/AccidentTypeController.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.controller.accident; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.accident.AccidentType; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.accident.AccidentTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/accident/accidentType") -public class AccidentTypeController { - @Resource - private AccidentTypeService accidentTypeService; - - @RequestMapping("/showAccidentTypeTree.do") - public String showAccidentTypeTree(HttpServletRequest request,Model model){ - return "/accident/accidentTypeTree"; - } - - @RequestMapping("/getAccidentTypeTree.do") - public ModelAndView getAccidentTypeTree(HttpServletRequest request,Model model) { - List list = this.accidentTypeService.selectListByWhere(" where 1=1 order by morder"); - String treeList = this.accidentTypeService.getTreeList(null, list); - model.addAttribute("result", treeList); - return new ModelAndView("result"); - } - - @RequestMapping("/getAccidentTypeTree4Use.do") - public ModelAndView getAccidentTypeTree4Use(HttpServletRequest request,Model model) { - List list = this.accidentTypeService.selectListByWhere(" where 1=1 and active ='启用' order by morder"); - String treeList = this.accidentTypeService.getTreeList(null, list); - model.addAttribute("result", treeList); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - AccidentType accidentType = this.accidentTypeService.selectById(pid); - model.addAttribute("pname",accidentType.getName()); - } - return "/accident/accidentTypeAdd"; - } - - @RequestMapping("/showAccidentType4Select.do") - public String showAccidentType4Select(HttpServletRequest request,Model model){ - return "/accident/accidentType4select"; - } - - @RequestMapping("/showAccidentType4Select4Use.do") - public String showAccidentType4Select4Use(HttpServletRequest request,Model model){ - return "/accident/accidentType4select4Use"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute AccidentType accidentType){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - accidentType.setId(CommUtil.getUUID()); - if (accidentType.getPid()==null || accidentType.getPid().isEmpty()) { - accidentType.setPid("-1"); - } - int code = this.accidentTypeService.save(accidentType); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - AccidentType accidentType = this.accidentTypeService.selectById(id); - AccidentType pAccidentType = this.accidentTypeService.selectById(accidentType.getPid()); - if(pAccidentType!=null){ - model.addAttribute("pname", pAccidentType.getName()); - } - model.addAttribute("accidentType", accidentType); - return "/accident/accidentTypeEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute AccidentType accidentType){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - if (accidentType.getPid()==null || accidentType.getPid().isEmpty()) { - accidentType.setPid("-1"); - } - - int code = this.accidentTypeService.update(accidentType); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @ModelAttribute AccidentType accidentType){ - List list = this.accidentTypeService.selectListByWhere(" where pid = '"+accidentType.getId()+"'"); - Result result = new Result(); - if(list!=null&&list.size()>0){ - result = Result.failed("请先删除子菜单"); - }else{ - int code = this.accidentTypeService.deleteById(accidentType.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/accident/ReasonableAdviceController.java b/src/com/sipai/controller/accident/ReasonableAdviceController.java deleted file mode 100644 index 91ffa53d..00000000 --- a/src/com/sipai/controller/accident/ReasonableAdviceController.java +++ /dev/null @@ -1,610 +0,0 @@ -package com.sipai.controller.accident; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.accident.ReasonableAdvice; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.accident.ReasonableAdviceService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/accident/reasonableAdvice") -public class ReasonableAdviceController { - @Resource - private ReasonableAdviceService reasonableAdviceService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - return "/accident/reasonableAdviceList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("unitId"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1"; - if(companyId!=null && !companyId.isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and unit_id in ("+companyids+") "; - } - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("takeFlag")!=null && !request.getParameter("takeFlag").isEmpty()){ - wherestr += " and take_flag = '"+request.getParameter("takeFlag")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.reasonableAdviceService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("userId", cu.getId()); - model.addAttribute("userName", cu.getCaption()); - return "/accident/reasonableAdviceAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ReasonableAdvice reasonableAdvice){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - reasonableAdvice.setId(CommUtil.getUUID()); - reasonableAdvice.setInsdt(CommUtil.nowDate()); - int code = this.reasonableAdviceService.save(reasonableAdvice); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(id); - model.addAttribute("reasonableAdvice", reasonableAdvice); - - String[] userleadid = reasonableAdvice.getUserLead().split(","); - String[] usershelpid = reasonableAdvice.getUsersHelp().split(","); - String solvername=""; - String solvername1=""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user!=null) { - solvername+=user.getCaption()+","; - } - } - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user!=null) { - solvername1+=user.getCaption()+","; - } - } - model.addAttribute("solvername", solvername); - model.addAttribute("solvername1", solvername1); - return "/accident/reasonableAdviceEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ReasonableAdvice reasonableAdvice){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.reasonableAdviceService.update(reasonableAdvice); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @ModelAttribute ReasonableAdvice reasonableAdvice){ - Result result = new Result(); - int code = this.reasonableAdviceService.deleteById(reasonableAdvice.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.reasonableAdviceService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(id); - model.addAttribute("reasonableAdvice", reasonableAdvice); - - String[] userleadid = reasonableAdvice.getUserLead().split(","); - String[] usershelpid = reasonableAdvice.getUsersHelp().split(","); - String solvername=""; - String solvername1=""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user!=null) { - solvername+=user.getCaption()+","; - } - } - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user!=null) { - solvername1+=user.getCaption()+","; - } - } - model.addAttribute("solvername", solvername); - model.addAttribute("solvername1", solvername1); - return "/accident/reasonableAdviceView"; - } - @RequestMapping("/showlisttake.do") - public String showlisttake(HttpServletRequest request,Model model){ - return "/accident/reasonableAdviceListtake"; - } - - @RequestMapping("/doedittake.do") - public String doedittake(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(id); - model.addAttribute("reasonableAdvice", reasonableAdvice); - - String[] userleadid = reasonableAdvice.getUserLead().split(","); - String[] usershelpid = reasonableAdvice.getUsersHelp().split(","); - String solvername=""; - String solvername1=""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user!=null) { - solvername+=user.getCaption()+","; - } - } - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user!=null) { - solvername1+=user.getCaption()+","; - } - } - model.addAttribute("solvername", solvername); - model.addAttribute("solvername1", solvername1); - return "/accident/reasonableAdviceEdittake"; - } - - @RequestMapping("/downloadExcel.do") - public String downloadExcel(HttpServletRequest request, HttpServletResponse response, Model model) { - String orderstr=" order by insdt desc"; - String companyId =request.getParameter("unitId"); - String wherestr=" where 1=1"; - if(companyId!=null && !companyId.isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and unit_id in ("+companyids+") "; - } - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("takeFlag")!=null && !request.getParameter("takeFlag").isEmpty()&&!"null".equals(request.getParameter("takeFlag"))){ - wherestr += " and take_flag = '"+request.getParameter("takeFlag")+"' "; - } - List list = this.reasonableAdviceService.selectListByWhere(wherestr+orderstr); - try { - this.reasonableAdviceService.downloadExcel(response,list); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - /** - * 更新,启动合理化建议审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute ReasonableAdvice reasonableAdvice){ - User cu= (User)request.getSession().getAttribute("cu"); - if(reasonableAdvice.getId()==null || reasonableAdvice.getId().isEmpty()){ - reasonableAdvice.setId(CommUtil.getUUID()); - this.reasonableAdviceService.save(reasonableAdvice); - } - reasonableAdvice.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.reasonableAdviceService.startProcess(reasonableAdvice); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+reasonableAdvice.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看合理化建议处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessReasonableAdviceView.do") - public String showProcessReasonableAdviceView(HttpServletRequest request,Model model){ - String reasonableAdviceId = request.getParameter("id"); - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(reasonableAdviceId); - request.setAttribute("business", reasonableAdvice); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(reasonableAdvice); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(reasonableAdvice.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_REASONABLE_ADVICE_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+reasonableAdviceId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_REASONABLE_ADVICE_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+reasonableAdviceId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = reasonableAdvice.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(reasonableAdvice.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "accident/reasonableAdviceExecuteViewInModal"; - }else{ - return "accident/reasonableAdviceExecuteView"; - } - } - /** - * 显示合理化建议审核 - * */ - @RequestMapping("/showAuditReasonableAdvice.do") - public String showAuditReasonableAdvice(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String reasonableAdviceId= pInstance.getBusinessKey(); - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(reasonableAdviceId); - model.addAttribute("reasonableAdvice", reasonableAdvice); - String[] userleadid = reasonableAdvice.getUserLead().split(","); - String[] usershelpid = reasonableAdvice.getUsersHelp().split(","); - String solvername=""; - String solvername1=""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user!=null) { - solvername+=user.getCaption()+","; - } - } - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user!=null) { - solvername1+=user.getCaption()+","; - } - } - model.addAttribute("solvername", solvername); - model.addAttribute("solvername1", solvername1); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - - return "accident/reasonableAdviceAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/AuditReasonableAdvice.do") - public String doAuditReasonableAdvice(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - String acceptanceResults = request.getParameter("acceptanceResults"); - String sampling = request.getParameter("sampling"); - String reasonableAdviceId = businessUnitAudit.getBusinessid(); - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(reasonableAdviceId); - int result = this.reasonableAdviceService.update(reasonableAdvice); - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.reasonableAdviceService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示合理化建议业务处理 - * */ - @RequestMapping("/showReasonableAdviceHandle.do") - public String showReasonableAdviceHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String reasonableAdviceId = pInstance.getBusinessKey(); - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(reasonableAdviceId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+reasonableAdviceId+"' order by insdt desc "); - if(list!=null && list.size()>0){ - model.addAttribute("businessUnitAudit", list.get(0)); - } - model.addAttribute("reasonableAdvice", reasonableAdvice); - return "accident/reasonableAdviceHandle"; - } - /** - * 流程流程,合理化建议业务处理提交 - * */ - @RequestMapping("/submitReasonableAdviceHandle.do") - public String dosubmitReasonableAdviceHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNumStr=request.getParameter("routeNum"); - String passstatusStr=request.getParameter("passstatus"); - - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - - try { - boolean passstatus = true; - if(passstatusStr!=null && !"".equals(passstatusStr)){ - passstatus = Boolean.getBoolean(passstatusStr); - } - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, passstatus, routeNumStr); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.reasonableAdviceService.updateStatus(businessUnitHandle.getBusinessid(),passstatus); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/accident/RoastController.java b/src/com/sipai/controller/accident/RoastController.java deleted file mode 100644 index ba523564..00000000 --- a/src/com/sipai/controller/accident/RoastController.java +++ /dev/null @@ -1,647 +0,0 @@ -package com.sipai.controller.accident; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.accident.Roast; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.accident.RoastService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/accident/roast") -public class RoastController { - @Resource - private RoastService roastService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/accident/roastListApp"; - } - - @RequestMapping("/showlistWeb.do") - public String showlistWeb(HttpServletRequest request, Model model) { - return "/accident/roastListWeb"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("unitId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and unit_id in (" + companyids + ") "; - } - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("takeFlag") != null && !request.getParameter("takeFlag").isEmpty()) { - wherestr += " and take_flag = '" + request.getParameter("takeFlag") + "' "; - } - PageHelper.startPage(page, rows); - List list = this.roastService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistApp.do") - public ModelAndView getlistApp(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("unitId"); - String orderstr = " order by insdt desc"; - String wherestr = " where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and unit_id in (" + companyids + ") "; - } - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("takeFlag") != null && !request.getParameter("takeFlag").isEmpty()) { - wherestr += " and take_flag = '" + request.getParameter("takeFlag") + "' "; - } - List list = this.roastService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - -// String result = "{\"total\":" + null + ",\"rows\":" + json + "}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("userId", cu.getId()); - model.addAttribute("userName", cu.getCaption()); - return "/accident/roastAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute Roast roast) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - roast.setId(CommUtil.getUUID()); - roast.setInsdt(CommUtil.nowDate()); - roast.setInsuser(userId); - int code = this.roastService.save(roast); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Roast roast = this.roastService.selectById(id); - model.addAttribute("roast", roast); - - String[] userleadid = roast.getUserLead().split(","); -// String[] usershelpid = roast.getUsersHelp().split(","); - String solvername = ""; - String solvername1 = ""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user != null) { - solvername += user.getCaption() + ","; - } - } - /*for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user != null) { - solvername1 += user.getCaption() + ","; - } - }*/ - model.addAttribute("solvername", solvername); -// model.addAttribute("solvername1", solvername1); - return "/accident/roastEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute Roast roast) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.roastService.update(roast); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @ModelAttribute Roast roast) { - Result result = new Result(); - int code = this.roastService.deleteById(roast.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.roastService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Roast roast = this.roastService.selectById(id); - model.addAttribute("roast", roast); - - String[] userleadid = roast.getUserLead().split(","); -// String[] usershelpid = roast.getUsersHelp().split(","); - String solvername = ""; - String solvername1 = ""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user != null) { - solvername += user.getCaption() + ","; - } - } - /*for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user != null) { - solvername1 += user.getCaption() + ","; - } - }*/ - model.addAttribute("solvername", solvername); -// model.addAttribute("solvername1", solvername1); - return "/accident/roastView"; - } - - @RequestMapping("/showlisttake.do") - public String showlisttake(HttpServletRequest request, Model model) { - return "/accident/roastListtake"; - } - - @RequestMapping("/doedittake.do") - public String doedittake(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Roast roast = this.roastService.selectById(id); - model.addAttribute("roast", roast); - - String[] userleadid = roast.getUserLead().split(","); - String[] usershelpid = roast.getUsersHelp().split(","); - String solvername = ""; - String solvername1 = ""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user != null) { - solvername += user.getCaption() + ","; - } - } - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user != null) { - solvername1 += user.getCaption() + ","; - } - } - model.addAttribute("solvername", solvername); - model.addAttribute("solvername1", solvername1); - return "/accident/roastEdittake"; - } - - @RequestMapping("/downloadExcel.do") - public String downloadExcel(HttpServletRequest request, HttpServletResponse response, Model model) { - String orderstr = " order by insdt desc"; - String companyId = request.getParameter("unitId"); - String wherestr = " where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and unit_id in (" + companyids + ") "; - } - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("takeFlag") != null && !request.getParameter("takeFlag").isEmpty() && !"null".equals(request.getParameter("takeFlag"))) { - wherestr += " and take_flag = '" + request.getParameter("takeFlag") + "' "; - } - List list = this.roastService.selectListByWhere(wherestr + orderstr); - try { - this.roastService.downloadExcel(response, list); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - /** - * 更新,启动合理化建议审核流程 - */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request, Model model, - @ModelAttribute Roast roast) { - User cu = (User) request.getSession().getAttribute("cu"); - if (roast.getId() == null || roast.getId().isEmpty()) { - roast.setId(CommUtil.getUUID()); - this.roastService.save(roast); - } - roast.setInsuser(cu.getId()); - roast.setInsdt(CommUtil.nowDate()); - int result = 0; - try { - result = this.roastService.startProcess(roast); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + roast.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看合理化建议处理流程详情 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessRoastView.do") - public String showProcessRoastView(HttpServletRequest request, Model model) { - String roastId = request.getParameter("id"); - Roast roast = this.roastService.selectById(roastId); - request.setAttribute("business", roast); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(roast); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(roast.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_ROAST_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + roastId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_ROAST_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + roastId + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = roast.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(roast.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "accident/roastExecuteViewInModal"; - } else { - return "accident/roastExecuteView"; - } - } - - /** - * 显示合理化建议审核 - */ - @RequestMapping("/showAuditRoast.do") - public String showAuditRoast(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String roastId = pInstance.getBusinessKey(); - Roast roast = this.roastService.selectById(roastId); - model.addAttribute("roast", roast); - String[] userleadid = roast.getUserLead().split(","); -// String[] usershelpid = roast.getUsersHelp().split(","); - String solvername = ""; - String solvername1 = ""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user != null) { - solvername += user.getCaption() + ","; - } - } - /*for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user != null) { - solvername1 += user.getCaption() + ","; - } - }*/ - model.addAttribute("solvername", solvername); -// model.addAttribute("solvername1", solvername1); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - - return "accident/roastAudit"; - } - - /** - * 流程流转 - */ - @RequestMapping("/AuditRoast.do") - public String doAuditRoast(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - String acceptanceResults = request.getParameter("acceptanceResults"); - String sampling = request.getParameter("sampling"); - String roastId = businessUnitAudit.getBusinessid(); - Roast roast = this.roastService.selectById(roastId); - int result = this.roastService.update(roast); - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.roastService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示合理化建议业务处理 - */ - @RequestMapping("/showRoastHandle.do") - public String showRoastHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String roastId = pInstance.getBusinessKey(); - Roast roast = this.roastService.selectById(roastId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + roastId + "' order by insdt desc "); - if (list != null && list.size() > 0) { - model.addAttribute("businessUnitAudit", list.get(0)); - } - model.addAttribute("roast", roast); - return "accident/roastHandle"; - } - - /** - * 流程流程,合理化建议业务处理提交 - */ - @RequestMapping("/submitRoastHandle.do") - public String dosubmitRoastHandle(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNumStr = request.getParameter("routeNum"); - String passstatusStr = request.getParameter("passstatus"); - - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - - try { - boolean passstatus = true; - if (passstatusStr != null && !"".equals(passstatusStr)) { - passstatus = Boolean.getBoolean(passstatusStr); - } - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, passstatus, routeNumStr); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - this.roastService.updateStatus(businessUnitHandle.getBusinessid(), passstatus); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/accident/TestKpiController.java b/src/com/sipai/controller/accident/TestKpiController.java deleted file mode 100644 index 88704d0c..00000000 --- a/src/com/sipai/controller/accident/TestKpiController.java +++ /dev/null @@ -1,504 +0,0 @@ -package com.sipai.controller.accident; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.List; - -/** - * 手动计算故障率使用 - */ -@Controller -@RequestMapping("/gzy/handle") -public class TestKpiController { - - @Resource - private EquipmentCardService equipmentCardService ; - @Resource - private CompanyService companyService ; - @Resource - private WorkorderDetailService workorderDetailService ; - @Resource - private AbnormityService abnormityService ; - @Resource - private MPointService mPointService ; - @Resource - private MPointHistoryService mPointHistoryService ; - - - //http://202.105.18.155:9101/FSHB_CC/gzy/handle/update.do?st=2023-09-01 - @RequestMapping("/update.do") - public String update(HttpServletRequest request, Model model, - @RequestParam(value = "st", required = true) String st) { - String sdt = st; - List list = companyService.selectListByWhere("where 1=1 and type = 'B'"); - for (Company company : list) { - String ids = "";//符合条件的设备ids - double num = 100;//任务完成率 - long time = 0;//故障时间 - - /** - * 通用设备 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list1 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '通用设备')"); - if (list1 != null && list1.size() > 0) { - for (int i = 0; i < list1.size(); i++) { - ids += "'" + list1.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("通用设备_任务合格率:" + num); -// System.out.println("通用设备_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_TYSBYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_TYSBYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_TYSBYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_TYSBYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 气动阀、液控阀 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list2 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '气动阀' or remark = '液控阀')"); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - ids += "'" + list2.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("气动阀、液控阀_任务合格率:" + num); -// System.out.println("气动阀、液控阀_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_LCQDFZBFYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_LCQDFZBFYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_LCQDFZBFYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_LCQDFZBFYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 滤阀 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list3 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '滤阀')"); - if (list3 != null && list3.size() > 0) { - for (int i = 0; i < list3.size(); i++) { - ids += "'" + list3.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("滤阀_任务合格率:" + num); -// System.out.println("滤阀_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_TJFYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_TJFYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_TJFYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_TJFYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 水质仪表 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list4 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '水质仪表')"); - if (list4 != null && list4.size() > 0) { - for (int i = 0; i < list4.size(); i++) { - ids += "'" + list4.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } -// System.out.println("水质仪表_任务合格率:" + num); - - save("FSCCSK_KPI_SZYBYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - save_his("FSCCSK_KPI_SZYBYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - } - - /** - * 一二泵机组 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list5 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '一二泵机组')"); - if (list5 != null && list5.size() > 0) { - for (int i = 0; i < list5.size(); i++) { - ids += "'" + list5.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("一二泵机组_任务合格率:" + num); -// System.out.println("一二泵机组_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_JBFJYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_JBFJYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_JBFJYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_JBFJYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 供配电柜、变压器 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list6 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '供配电柜、变压器')"); - if (list6 != null && list6.size() > 0) { - for (int i = 0; i < list6.size(); i++) { - ids += "'" + list6.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - List list1_f = workorderDetailService.selectSimpleListByWhere("where unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - List list1_all = workorderDetailService.selectSimpleListByWhere("where unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } -// System.out.println("供配电柜、变压器_任务合格率:" + num); - - save("FSCCSK_KPI_GPDGBYQYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - save_his("FSCCSK_KPI_GPDGBYQYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - } - - } - return "suc"; - } - - /** - * 更新总表 - */ - public void save(String mpId, double val, String unitId, String dt) { - try { - MPoint mPoint = mPointService.selectById(unitId, mpId); - mPoint.setParmvalue(new BigDecimal(val + "")); - mPoint.setMeasuredt(dt); - mPointService.update2(unitId, mPoint); - } catch (Exception e) { - - } - } - - /** - * 保存子表 - */ - public void save_his(String mpId, double val, String unitId, String dt) { - try { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(val + "")); - mPointHistory.setMeasuredt(dt); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - - List list = mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "[tb_mp_" + mpId + "]", "where MeasureDT = '" + dt + "'"); - if (list != null && list.size() > 0) { - mPointHistoryService.updateByWhere(unitId, "[tb_mp_" + mpId + "]", " ParmValue = '" + val + "' ", "where MeasureDT = '" + dt + "'"); - } else { - mPointHistoryService.save(unitId, mPointHistory); - } - - } catch (Exception e) { - - } - } - -} diff --git a/src/com/sipai/controller/achievement/AcceptanceModelController.java b/src/com/sipai/controller/achievement/AcceptanceModelController.java deleted file mode 100644 index 13c02de0..00000000 --- a/src/com/sipai/controller/achievement/AcceptanceModelController.java +++ /dev/null @@ -1,317 +0,0 @@ -package com.sipai.controller.achievement; - -import java.awt.Robot; -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.achievement.AcceptanceModelMPointService; -import com.sipai.service.achievement.AcceptanceModelService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/achievement/acceptanceModel") -public class AcceptanceModelController { - @Resource - private AcceptanceModelService acceptanceModelService; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; - @Resource - private CommonFileService commonFileService; - @Resource - private AcceptanceModelMPointService acceptanceModelMPointService; - - - @RequestMapping("/showAcceptanceModelManage.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "achievement/acceptanceModelManage"; - } - - @RequestMapping("/getAcceptanceModelJson.do") - public String getAcceptanceModelJson(HttpServletRequest request, Model model){ - String unitId = request.getParameter("unitId"); - List list = this.acceptanceModelService.selectListByWhere(" where 1=1 and unit_id='"+unitId+"' order by morder"); - String json = this.acceptanceModelService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showAcceptanceModel4Select.do") - public String showMenu4Select(HttpServletRequest request,Model model){ - return "achievement/acceptanceModel4Select"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="unitId") String unitId, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")&& !pid.equals("-1")){ - AcceptanceModel acceptanceModel = this.acceptanceModelService.selectById(pid); - model.addAttribute("pname",acceptanceModel.getName()); - } - if(unitId!=null && !unitId.equals("")&& !unitId.equals("-1")){ - Company company = this.companyService.selectByPrimaryKey(unitId); - model.addAttribute("_bizname",company.getName()); - } - model.addAttribute("id",CommUtil.getUUID()); - return "achievement/acceptanceModelAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="acceptanceModel") AcceptanceModel acceptanceModel){ - User cu= (User)request.getSession().getAttribute("cu"); -// acceptanceModel.setId(CommUtil.getUUID()); - acceptanceModel.setInsuser(cu.getId()); - acceptanceModel.setInsdt(CommUtil.nowDate()); - - int code = this.acceptanceModelService.save(acceptanceModel); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - AcceptanceModel acceptanceModel = this.acceptanceModelService.selectById(id); - String _auditMan=""; - String userids = acceptanceModel.getUserid(); - if(userids!=null && !("").equals(userids)){ - userids=userids.replace(",","','"); - List list = this.userService.selectListByWhere("where id in ('"+userids+"')"); - for (int i = 0; i < list.size(); i++) { - _auditMan+=list.get(i).getCaption(); - if(i!=(list.size()-1)){ - _auditMan+=","; - } - } - } - - String unitId = acceptanceModel.getUnitId(); - if(unitId!=null && !unitId.equals("")&& !unitId.equals("-1")){ - Company company = this.companyService.selectByPrimaryKey(unitId); - model.addAttribute("_bizname",company.getName()); - } - AcceptanceModel pModel = this.acceptanceModelService.selectById(acceptanceModel.getPid()); - if(pModel!=null){ - model.addAttribute("pname",pModel.getName() ); - } - model.addAttribute("acceptanceModel",acceptanceModel); - model.addAttribute("_auditMan",_auditMan ); - return "achievement/acceptanceModelEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModel") AcceptanceModel acceptanceModel){ - int code = this.acceptanceModelService.update(acceptanceModel); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.acceptanceModelService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 显示上传页面-bootstrap-fileinput - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - */ - @RequestMapping("/fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response,Model model,@RequestParam(value="masterId") String masterId, - @RequestParam(value="tbName") String tbName,@RequestParam(value="nameSpace") String nameSpace) { - model.addAttribute("tbName",tbName); - model.addAttribute("masterId",masterId); - model.addAttribute("nameSpace",nameSpace); - return "base/fileinputForAcceptanceModel"; - } - - /** - * 上传文件通用接口 - * - * @param request 请求体 - * @param dstFileName html上传组件中(input中name属性),上传文件体名称,通过此名称获取所有上传的文件map - * @param reportGroupId (特殊)上传报告所述报告组id - * */ - @RequestMapping("/inputFile.do") - public ModelAndView inputFile(HttpServletRequest request,HttpServletResponse response,Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - String filepath=filepathSever.replaceAll(contextPath, "UploadFile"+"/"+nameSpace+"/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date())+fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int)item.getSize()); - int res =commonFileService.insertByTable(tbName, commonFile); - - if (res==1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='"+commonFile.getId()+"'"); - if(commfiles!=null && commfiles.size()>0){ - String excelpath=commfiles.get(0).getAbspath(); - String filename=commfiles.get(0).getFilename(); - - //生成HTM文件 - //设置文件的文件夹 - String RealPath=request.getRealPath(""); - if(RealPath.substring(RealPath.length()-1, RealPath.length()).equals("\\")||RealPath.substring(RealPath.length()-1, RealPath.length()).equals("/")){ - RealPath=RealPath.substring(0, RealPath.length()-1); - } - String fileforder=RealPath+"_tohtm/"+nameSpace; -// System.out.println(fileforder); - try { - File file=new File(fileforder); - if(!file.exists()){ - file.mkdir(); - } - }catch (Exception e){ - e.printStackTrace(); - } - - //开始生成 - ComThread.InitSTA(); - ActiveXComponent xl = new ActiveXComponent("Excel.Application"); - xl.setProperty("DisplayAlerts", new Variant(false)); - Object workbooks = xl.getProperty("Workbooks").toDispatch(); - Object workbook = Dispatch.call((Dispatch) workbooks, "Open", - excelpath).toDispatch(); - Dispatch.invoke((Dispatch) workbook, "SaveAs", Dispatch.Method, - new Object[]{ - fileforder+"\\"+filename+".htm", - new Variant(44), - new Variant(""), - new Variant(""), - new Variant(false), - new Variant(false), - new Variant(1), - new Variant(2)}, new int[1]); - Dispatch.call((Dispatch) workbooks, "Close"); - xl.invoke("Quit", new Variant[] {}); - ComThread.Release(); - - } - - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result =JSONObject.fromObject(ret).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/achievement/AcceptanceModelCreateController.java b/src/com/sipai/controller/achievement/AcceptanceModelCreateController.java deleted file mode 100644 index 1a3e72e0..00000000 --- a/src/com/sipai/controller/achievement/AcceptanceModelCreateController.java +++ /dev/null @@ -1,1203 +0,0 @@ -package com.sipai.controller.achievement; - -import static org.apache.poi.ss.usermodel.CellType.*; -import static org.apache.poi.ss.usermodel.CellType.BOOLEAN; -import static org.apache.poi.ss.usermodel.CellType.FORMULA; -import static org.hamcrest.CoreMatchers.nullValue; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -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.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFCellStyle; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; -import org.apache.commons.lang3.StringUtils; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.achievement.AcceptanceModelData; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.achievement.AcceptanceModelOutput; -import com.sipai.entity.achievement.AcceptanceModelOutputData; -import com.sipai.entity.achievement.AcceptanceModelRecord; -import com.sipai.entity.achievement.AcceptanceModelText; -import com.sipai.entity.achievement.AcceptanceModelTextData; -import com.sipai.entity.achievement.ModelLibrary; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.report.RptCollectMode; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.achievement.AcceptanceModelDataService; -import com.sipai.service.achievement.AcceptanceModelMPointService; -import com.sipai.service.achievement.AcceptanceModelOutputDataService; -import com.sipai.service.achievement.AcceptanceModelOutputService; -import com.sipai.service.achievement.AcceptanceModelRecordService; -import com.sipai.service.achievement.AcceptanceModelService; -import com.sipai.service.achievement.AcceptanceModelTextDataService; -import com.sipai.service.achievement.AcceptanceModelTextService; -import com.sipai.service.achievement.ModelLibraryService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.report.RptCollectModeService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/achievement/acceptanceModelCreate") -public class AcceptanceModelCreateController { - @Resource - private AcceptanceModelService acceptanceModelService; - @Resource - private AcceptanceModelMPointService acceptanceModelMPointService; - @Resource - private AcceptanceModelRecordService acceptanceModelRecordService; - @Resource - private CommonFileService commonFileService; - @Resource - private RptCollectModeService rptCollectModeService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointService mPointService; - @Resource - private AcceptanceModelDataService acceptanceModelDataService; - @Resource - private AcceptanceModelTextService acceptanceModelTextService; - @Resource - private AcceptanceModelTextDataService acceptanceModelTextDataService; - @Resource - private AcceptanceModelOutputService acceptanceModelOutputService; - @Resource - private AcceptanceModelOutputDataService acceptanceModelOutputDataService; - @Resource - private ModelLibraryService modelLibraryService; - - @RequestMapping("/showManage.do") - public String showManage(HttpServletRequest request, Model model){ - return "achievement/acceptanceModelCreateManage"; - } - - @RequestMapping("/doCreateRecord.do") - public String doCreateView(HttpServletRequest request, Model model){ - return "achievement/acceptanceModelCreateRecord"; - } - - @RequestMapping("/getRecordlist.do") - public String getAcceptanceModelJson(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - String pid = request.getParameter("pid"); - - if(sort==null){ - sort = " sdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - PageHelper.startPage(page, rows); - - String whereString=" where 1=1 and pid='"+pid+"' "; - if(request.getParameter("search_name")!=null&&request.getParameter("search_name").length()>0){ - whereString+=" and name like '%"+request.getParameter("search_name")+"%' "; - } - - List list = this.acceptanceModelRecordService.selectListByWhere(whereString+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } - - @RequestMapping("/doRecordAdd.do") - public String doRecordAdd(HttpServletRequest request, Model model){ - model.addAttribute("id",CommUtil.getUUID()); - return "achievement/acceptanceModelCreateRecordAdd"; - } - - @RequestMapping("/deleteRecord.do") - public String deleteRecord(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - List commfiles = this.commonFileService.selectListByTableAWhere("TB_Achievement_AcceptanceModelRecord_file", "where masterid='"+id+"'"); - if(commfiles!=null && commfiles.size()>0){ - File file = new File(commfiles.get(0).getAbspath()); - if (file.exists()) { - file.delete();//删除文件 - } - this.commonFileService.deleteByTableAWhere("TB_Achievement_AcceptanceModelRecord_file", "where masterid='"+id+"'"); - } - - this.acceptanceModelDataService.deleteByWhere("where pid='"+id+"'"); - - int code = this.acceptanceModelRecordService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 保存数据到测量点和记录内 - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveOutput.do") - public ModelAndView saveOutput(HttpServletRequest request,HttpServletResponse response,Model model) throws IOException{ - User cu= (User)request.getSession().getAttribute("cu"); - String pid=request.getParameter("pid");//验收模型id - String unitId=request.getParameter("unitId"); - String tbName = "TB_Achievement_AcceptanceModelRecord_file"; - String sdt=request.getParameter("sdt"); - String nowTime=CommUtil.nowDate(); - - int result=0; - Result result1 = new Result(); - - List filelist = this.commonFileService.selectListByTableAWhere(tbName, " where masterid='"+pid+"' order by insdt desc"); - if(filelist!=null&&filelist.size()>0){ - // 设定Excel文件所在路径 - String excelFileName = filelist.get(0).getAbspath(); - // 读取Excel文件内容 - XSSFWorkbook workbook = null; - HSSFWorkbook workbook2 = null; - FileInputStream inputStream = null; - - //获取Excel后缀名 - String fileType = excelFileName.substring(excelFileName.lastIndexOf(".") + 1, excelFileName.length()); - // 获取Excel文件 - File excelFile = new File(excelFileName); - if (!excelFile.exists()) { - System.out.println("指定的Excel文件不存在!"); - result1 = Result.failed("指定的Excel文件不存在!"); - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - String endtype=".xlsx"; - // 获取Excel工作簿 - inputStream = new FileInputStream(excelFile); - if (fileType.equalsIgnoreCase("XLS")) { - workbook2 = new HSSFWorkbook(inputStream); - endtype=".xls"; - //重新找到所有的公式 - FormulaEvaluator evaluator = workbook2.getCreationHelper().createFormulaEvaluator(); - for (int i = 0; i < workbook2.getNumberOfSheets(); i++) { - Sheet sheet2 = workbook2.getSheetAt(i); - for (int j = 0; j < sheet2.getPhysicalNumberOfRows(); j++) { - Row row = sheet2.getRow(j); - if (row != null) { - for (int k = 0; k < row.getLastCellNum(); k++) { - if (row.getCell(k) != null && (row.getCell(k).getCellType() == FORMULA)) { - if (StringUtils.isNotBlank(row.getCell(k).getCellFormula())) { - try { - evaluator.evaluateFormulaCell(row.getCell(k)); - } catch (Exception e) { - System.out.println("重新找公式异常" + CommUtil.nowDate() + ":" + row.getCell(k)); - } - } - } - } - } - } - workbook2.getSheetAt(i).setForceFormulaRecalculation(Boolean.TRUE); - } - //重新计算所有的公式 - workbook2.setForceFormulaRecalculation(true); - - } else if (fileType.equalsIgnoreCase("XLSX")) { - workbook = new XSSFWorkbook(inputStream); - endtype=".xlsx"; - - //重新找到所有的公式 - FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); - for (int i = 0; i < workbook.getNumberOfSheets(); i++) { - Sheet sheet2 = workbook.getSheetAt(i); - for (int j = 0; j < sheet2.getPhysicalNumberOfRows(); j++) { - Row row = sheet2.getRow(j); - if (row != null) { - for (int k = 0; k < row.getLastCellNum(); k++) { - if (row.getCell(k) != null && (row.getCell(k).getCellType() == FORMULA)) { - if (StringUtils.isNotBlank(row.getCell(k).getCellFormula())) { - try { - evaluator.evaluateFormulaCell(row.getCell(k)); - } catch (Exception e) { - System.out.println("重新找公式异常" + CommUtil.nowDate() + ":" + row.getCell(k)); - } - } - } - } - } - } - workbook.getSheetAt(i).setForceFormulaRecalculation(Boolean.TRUE); - } - //重新计算所有的公式 - workbook.setForceFormulaRecalculation(true); - } - - List datalist = this.acceptanceModelOutputService.selectListByWhere(unitId, " where 1=1 and acceptance_model_id='"+request.getParameter("modelId")+"' order by morder"); - - for (AcceptanceModelOutput acceptanceModelOutput : datalist) { - String sheetname=acceptanceModelOutput.getSheetName(); - String evalue = ""; - - if(endtype.equals(".xls")){ - for (int s = 0; s < workbook2.getNumberOfSheets(); s++) {//获取每个Sheet表 - if(workbook2.getSheetName(s).equals(sheetname)){ - HSSFSheet sheet=workbook2.getSheetAt(s); - HSSFRow row = sheet.getRow(Integer.valueOf(acceptanceModelOutput.getPosY())); - HSSFCell cell = row.getCell(Integer.valueOf(acceptanceModelOutput.getPosX())); - evalue = getStringVal(cell); - } - } - }else if(endtype.equals(".xlsx")){ - for (int s = 0; s < workbook.getNumberOfSheets(); s++) {//获取每个Sheet表 - if(workbook.getSheetName(s).equals(sheetname)){ - XSSFSheet sheet=workbook.getSheetAt(s); - XSSFRow row = sheet.getRow(Integer.valueOf(acceptanceModelOutput.getPosY())); - XSSFCell cell = row.getCell(Integer.valueOf(acceptanceModelOutput.getPosX())); - evalue = getStringVal(cell); - } - } - } - if(evalue!=null){ - if(acceptanceModelOutput.getMpointId()!=null&&acceptanceModelOutput.getMpointId().length()>0){ - List mphlist = this.mPointHistoryService.selectListByTableAWhere(unitId,"tb_mp_"+acceptanceModelOutput.getMpointId(), " where datediff(day,measuredt,'"+sdt+"')=0 "); - if(mphlist!=null&&mphlist.size()>0){//主表更新方法里带有附表更新功能 - MPointHistory mPointHistory=mphlist.get(0); - mPointHistory.setParmvalue(new BigDecimal(evalue)); - mPointHistory.setMeasuredt(sdt+" 00:00:00.000"); - mPointHistory.setTbName("tb_mp_"+acceptanceModelOutput.getMpointId()); - this.mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - }else{ - MPointHistory mPointHistory=new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(evalue)); - mPointHistory.setMeasuredt(sdt); - mPointHistory.setTbName("tb_mp_"+acceptanceModelOutput.getMpointId()); - this.mPointHistoryService.save(unitId, mPointHistory); - } - //主表更新方法里带有附表更新功能 - List mplist=this.mPointService.selectListByWhere(unitId, " where id='"+acceptanceModelOutput.getMpointId()+"'" ); - mplist.get(0).setParmvalue(new BigDecimal(evalue)); - mplist.get(0).setMeasuredt(sdt); - this.mPointService.update2(unitId, mplist.get(0)); - } - } - //以下为生成输出记录 - Double dvalue=0.0; - if(evalue!=null){ - dvalue=Double.valueOf(evalue); - }else{ - dvalue=null; - } - - ModelLibrary modelLibrary = this.modelLibraryService.selectById(acceptanceModelOutput.getBaseId()); - String referenceType=modelLibrary.getReferenceType(); - Double dreference_low_value=0.0; - Double dreference_high_value=0.0; - Double dreference_value=0.0; - - if(modelLibrary.getReferenceLowValue()!=null&&!modelLibrary.getReferenceLowValue().equals("")){ - dreference_low_value=Double.valueOf(modelLibrary.getReferenceLowValue()); - } - if(modelLibrary.getReferenceHighValue()!=null&&!modelLibrary.getReferenceHighValue().equals("")){ - dreference_high_value=Double.valueOf(modelLibrary.getReferenceHighValue()); - } - if(modelLibrary.getReferenceValue()!=null&&!modelLibrary.getReferenceValue().equals("")){ - dreference_value=Double.valueOf(modelLibrary.getReferenceValue()); - } - - String status=""; - if(referenceType.equals("大于")){ - if(dvalue>=dreference_value){ - status=AcceptanceModelOutputData.Status_qualified; - }else{ - status=AcceptanceModelOutputData.Status_unqualified; - } - }else if(referenceType.equals("小于")){ - if(dvalue<=dreference_value){ - status=AcceptanceModelOutputData.Status_qualified; - }else{ - status=AcceptanceModelOutputData.Status_unqualified; - } - }else if(referenceType.equals("区间内")){ - if(dvalue<=dreference_high_value&&dvalue>=dreference_low_value){ - status=AcceptanceModelOutputData.Status_qualified; - }else{ - status=AcceptanceModelOutputData.Status_unqualified; - } - }else if(referenceType.equals("区间外")){ - if(dvalue>=dreference_high_value&&dvalue<=dreference_low_value){ - status=AcceptanceModelOutputData.Status_qualified; - }else{ - status=AcceptanceModelOutputData.Status_unqualified; - } - }else if(referenceType.equals("不为空")){ - if(evalue!=null){ - status=AcceptanceModelOutputData.Status_qualified; - }else{ - status=AcceptanceModelOutputData.Status_unqualified; - } - } - - List acodList = this.acceptanceModelOutputDataService.selectListByWhere(" where pid='"+request.getParameter("modelId")+"' and modeOutputld='"+acceptanceModelOutput.getId()+"' "); - if(acodList!=null&&acodList.size()>0){ - AcceptanceModelOutputData acceptanceModelOutputData=acodList.get(0); - acceptanceModelOutputData.setValue(dvalue); - acceptanceModelOutputData.setStatus(status); - this.acceptanceModelOutputDataService.update(acceptanceModelOutputData); - }else{ - AcceptanceModelOutputData acceptanceModelOutputData=new AcceptanceModelOutputData(); - acceptanceModelOutputData.setId(CommUtil.getUUID()); - acceptanceModelOutputData.setValue(dvalue); - acceptanceModelOutputData.setPid(request.getParameter("modelId")); - acceptanceModelOutputData.setModeoutputld(acceptanceModelOutput.getId()); - acceptanceModelOutputData.setStatus(status); - this.acceptanceModelOutputDataService.save(acceptanceModelOutputData); - } - - } - - - } - - return new ModelAndView("result"); - } - - /** - * 保存导入 - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(HttpServletRequest request,HttpServletResponse response,Model model) throws IOException{ - User cu= (User)request.getSession().getAttribute("cu"); - String pid=request.getParameter("pid");//验收模型id - String unitId=request.getParameter("unitId"); - String tbName = "TB_Achievement_AcceptanceModel_file"; - String sdt=request.getParameter("sdt")+" 23:59"; - String nowTime=CommUtil.nowDate(); -// String edt=request.getParameter("edt"); -// String sdt="2020-05-01 00:00"; -// String edt="2020-10-01 00:00"; - String showname=request.getParameter("showname"); - - List alist = this.acceptanceModelRecordService.selectListByWhere(" where name='"+showname+"' and pid='"+pid+"' "); - - int result=0; - Result result1 = new Result(); - - if(alist!=null&&alist.size()>0){ - result1 = Result.failed("名称不能重复!"); - }else{ - - try { - - List filelist = this.commonFileService.selectListByTableAWhere(tbName, " where masterid='"+pid+"' order by insdt desc"); - if(filelist!=null&&filelist.size()>0){ - // 设定Excel文件所在路径 - String excelFileName = filelist.get(0).getAbspath(); - // 读取Excel文件内容 - XSSFWorkbook workbook = null; - HSSFWorkbook workbook2 = null; - FileInputStream inputStream = null; - - //获取Excel后缀名 - String fileType = excelFileName.substring(excelFileName.lastIndexOf(".") + 1, excelFileName.length()); - // 获取Excel文件 - File excelFile = new File(excelFileName); - if (!excelFile.exists()) { - System.out.println("指定的Excel文件不存在!"); - result1 = Result.failed("指定的Excel文件不存在!"); - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - String endtype=".xlsx"; - // 获取Excel工作簿 - inputStream = new FileInputStream(excelFile); - if (fileType.equalsIgnoreCase("XLS")) { - workbook2 = new HSSFWorkbook(inputStream); - endtype=".xls"; - //重新找到所有的公式 - FormulaEvaluator evaluator = workbook2.getCreationHelper().createFormulaEvaluator(); - for (int i = 0; i < workbook2.getNumberOfSheets(); i++) { - Sheet sheet2 = workbook2.getSheetAt(i); - for (int j = 0; j < sheet2.getPhysicalNumberOfRows(); j++) { - Row row = sheet2.getRow(j); - if (row != null) { - for (int k = 0; k < row.getLastCellNum(); k++) { - if (row.getCell(k) != null && (row.getCell(k).getCellType() == FORMULA)) { - if (StringUtils.isNotBlank(row.getCell(k).getCellFormula())) { - try { - evaluator.evaluateFormulaCell(row.getCell(k)); - } catch (Exception e) { - System.out.println("重新找公式异常" + CommUtil.nowDate() + ":" + row.getCell(k)); - } - } - } - } - } - } - workbook2.getSheetAt(i).setForceFormulaRecalculation(Boolean.TRUE); - } - //重新计算所有的公式 - workbook2.setForceFormulaRecalculation(true); - } else if (fileType.equalsIgnoreCase("XLSX")) { - workbook = new XSSFWorkbook(inputStream); - endtype=".xlsx"; - //重新找到所有的公式 - FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); - for (int i = 0; i < workbook.getNumberOfSheets(); i++) { - Sheet sheet2 = workbook.getSheetAt(i); - for (int j = 0; j < sheet2.getPhysicalNumberOfRows(); j++) { - Row row = sheet2.getRow(j); - if (row != null) { - for (int k = 0; k < row.getLastCellNum(); k++) { - if (row.getCell(k) != null && (row.getCell(k).getCellType() == FORMULA)) { - if (StringUtils.isNotBlank(row.getCell(k).getCellFormula())) { - try { - evaluator.evaluateFormulaCell(row.getCell(k)); - } catch (Exception e) { - System.out.println("重新找公式异常" + CommUtil.nowDate() + ":" + row.getCell(k)); - } - } - } - } - } - } - workbook.getSheetAt(i).setForceFormulaRecalculation(Boolean.TRUE); - } - //重新计算所有的公式 - workbook.setForceFormulaRecalculation(true); - } - - // 生成一个样式,用在表格数据 - XSSFCellStyle listStyle = null; - if(endtype.equals(".xlsx")){ - listStyle=workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - } - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle2 = null; - if(endtype.equals(".xls")){ - listStyle2=workbook2.createCellStyle(); - // 设置这些样式 - listStyle2.setBorderBottom(BorderStyle.THIN); - listStyle2.setBorderLeft(BorderStyle.THIN); - listStyle2.setBorderRight(BorderStyle.THIN); - listStyle2.setBorderTop(BorderStyle.THIN); - listStyle2.setAlignment(HorizontalAlignment.CENTER); - } - -// HSSFWorkbook wb = new HSSFWorkbook(inputStream); - - String recordId=request.getParameter("id");//记录id - - - //添加文本记录的空数据,具体内容在相关数据界面修改 - List textDatalist = this.acceptanceModelTextService.selectListByWhere(" where 1=1 and acceptance_model_id='"+pid+"' order by morder"); - if(textDatalist!=null&&textDatalist.size()>0){ - for(int i=0;i datalist = this.acceptanceModelMPointService.selectListByWhere(unitId, " where 1=1 and acceptance_model_id='"+pid+"' order by morder"); - if(datalist!=null&&datalist.size()>0){ - for(int d=0;d mpVlist=new ArrayList<>(); - if(valueType.equals("first")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," top 1 * "); - }else if(valueType.equals("last")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," top 1 * "); - }else if(valueType.equals("diff")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," (max(ParmValue)-min(ParmValue)) as ParmValue "); - }else if(valueType.equals("avg")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," avg(ParmValue) as ParmValue "); - }else if(valueType.equals("min")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," min(ParmValue) as ParmValue "); - }else if(valueType.equals("max")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," max(ParmValue) as ParmValue "); - }else if(valueType.equals("sum")){ - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_"+mpid, whereString," sum(ParmValue) as ParmValue "); - } - - BigDecimal parmValue=null; - if(mpVlist!=null&&mpVlist.size()>0){ - if(mpVlist.get(0)!=null){ - parmValue=mpVlist.get(0).getParmvalue(); - - if(datalist.get(d).getUnitconversion()!=null&&!datalist.get(d).getUnitconversion().equals("")){ - String unitconversion=datalist.get(d).getUnitconversion(); - ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); - Object parmValueD=jse.eval(String.valueOf(parmValue)+unitconversion); - parmValue=new BigDecimal(((Number)parmValueD).doubleValue()); - } - } - } - - //添加临时记录表 - AcceptanceModelData acceptanceModelData=new AcceptanceModelData(); - acceptanceModelData.setId(CommUtil.getUUID()); - acceptanceModelData.setMpid(mpid); - if(parmValue!=null){ - acceptanceModelData.setValue(parmValue.doubleValue()); - } - acceptanceModelData.setPid(recordId); - acceptanceModelData.setModeMPld(datalist.get(d).getId()); - this.acceptanceModelDataService.save(acceptanceModelData); - - String sheetname=datalist.get(d).getSheetName(); - int szrow=Integer.valueOf(datalist.get(d).getPosY()); - int szcell=Integer.valueOf(datalist.get(d).getPosX()); - if(endtype.equals(".xls")){ - for (int s = 0; s < workbook2.getNumberOfSheets(); s++) {//获取每个Sheet表 - if(workbook2.getSheetName(s).equals(sheetname)){ - HSSFSheet sheet=workbook2.getSheetAt(s); - HSSFRow row = sheet.getRow(szrow); - if(row!=null){ - HSSFCell cell_d = row.getCell(szcell); - if(cell_d!=null){ - cell_d.setCellStyle(listStyle2); - if(parmValue!=null){ - cell_d.setCellValue(parmValue.doubleValue()); - }else{ -// cell_d.setCellValue("0"); - } - } - } - } - } - }else if(endtype.equals(".xlsx")){ - for (int s = 0; s < workbook.getNumberOfSheets(); s++) {//获取每个Sheet表 - if(workbook.getSheetName(s).equals(sheetname)){ - XSSFSheet sheet=workbook.getSheetAt(s); - XSSFRow row = sheet.getRow(szrow); - if(row!=null){ - XSSFCell cell_d = row.getCell(szcell); - if(cell_d!=null){ - cell_d.setCellStyle(listStyle); - if(parmValue!=null){ - cell_d.setCellValue(parmValue.doubleValue()); - }else{ -// cell_d.setCellValue("0"); - } - } - } - - } - } - } - - } - } - - //判断是否存在目录. 不存在则创建 - String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - String filepath=filepathSever.replaceAll(contextPath, "UploadFile"+"/AcceptanceModel/data/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - //输出Excel文件 - FileOutputStream output=new FileOutputStream(filepath+showname+endtype); - if(endtype.equals(".xls")){ - workbook2.write(output);//写入磁盘 - }else if(endtype.equals(".xlsx")){ - workbook.write(output);//写入磁盘 - } - output.close(); - - AcceptanceModelRecord aModelRecord=new AcceptanceModelRecord(); - aModelRecord.setId(recordId); - aModelRecord.setName(showname); - aModelRecord.setSdt(sdt); -// aModelRecord.setEdt(edt); - aModelRecord.setInsdt(CommUtil.nowDate()); - aModelRecord.setInsuser(cu.getId()); - aModelRecord.setPid(pid); - result=this.acceptanceModelRecordService.save(aModelRecord); - - //保存文件信息到表 - String reportAddr=""; -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); -// String saveFileName = dateFormat.format(new Date())+showname+endtype; - String saveFileName = showname+endtype; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(recordId); - commonFile.setFilename(showname+endtype); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int)excelFile.length()); - commonFileService.insertByTable("TB_Achievement_AcceptanceModelRecord_file", commonFile); - - // - //生成HTM文件 - // - //设置文件的文件夹 - String RealPath=request.getRealPath(""); - if(RealPath.substring(RealPath.length()-1, RealPath.length()).equals("\\")||RealPath.substring(RealPath.length()-1, RealPath.length()).equals("/")){ - RealPath=RealPath.substring(0, RealPath.length()-1); - } - String fileforder=RealPath+"_tohtm/"+"AcceptanceModel/data"; -// System.out.println(fileforder); - try { - File file=new File(fileforder); - if(!file.exists()){ - file.mkdir(); - } - }catch (Exception e){ - e.printStackTrace(); - } - - //开始生成 - ActiveXComponent xl = new ActiveXComponent("Excel.Application"); - xl.setProperty("DisplayAlerts", new Variant(false)); - Object workbooks = xl.getProperty("Workbooks").toDispatch(); - Object htmlworkbook = Dispatch.call((Dispatch) workbooks, "Open", - reportAddr).toDispatch(); - Dispatch.invoke((Dispatch) htmlworkbook, "SaveAs", Dispatch.Method, - new Object[]{ - fileforder+"\\"+showname+".htm", - new Variant(44), - new Variant(""), - new Variant(""), - new Variant(false), - new Variant(false), - new Variant(1), - new Variant(2)}, new int[1]); - Dispatch.call((Dispatch) workbooks, "Close"); - xl.invoke("Quit", new Variant[] {}); - ComThread.Release(); - - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("添加失败"); - } - - }else{ - result1 = Result.failed("未找到模型模板!"); - } - - } catch (Exception e) { - result1 = Result.failed("执行失败!"); - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - } - - model.addAttribute("result", CommUtil.toJson(result1)); - - return new ModelAndView("result"); - } - - @RequestMapping("/doDataRecordShow.do") - public String doDataRecordShow(HttpServletRequest request, Model model){ - return "achievement/acceptanceModelRptDataRecord"; - } - - @RequestMapping("/doDataRecordOpenShow.do") - public String doDataRecordOpenShow(HttpServletRequest request, Model model){ - return "achievement/acceptanceModelRptDataOpenRecord"; - } - - @RequestMapping("/getRptDataRecordlist.do") - public String getRptDataRecordlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - String pid = request.getParameter("pid"); - - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - PageHelper.startPage(page, rows); - - List list = this.acceptanceModelDataService.selectListByWhere(" where 1=1 and pid='"+pid+"'"+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } - - @RequestMapping("/getRptTextDataRecordJson.do") - public String getRptTextDataRecordJson(HttpServletRequest request, Model model){ - String pid = request.getParameter("pid"); - - List list = this.acceptanceModelTextDataService.selectListByWhere(" where 1=1 and pid='"+pid+"'"+" order by morder "); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return ("result"); - } - - @RequestMapping("/doChangeData.do") - public String doChangeData(HttpServletRequest request,Model model){ - String id=request.getParameter("id"); - String value=request.getParameter("value"); - - AcceptanceModelData aModelData=this.acceptanceModelDataService.selectById(id); - aModelData.setValue(Double.valueOf(value)); - int code = this.acceptanceModelDataService.update(aModelData); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("修改失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doChangeTextData.do") - public String doChangeTextData(HttpServletRequest request,Model model){ - String id=request.getParameter("id"); - String value=request.getParameter("value"); - - AcceptanceModelTextData aModelTextData=this.acceptanceModelTextDataService.selectById(id); - aModelTextData.setText(value); - int code = this.acceptanceModelTextDataService.update(aModelTextData); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("修改失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doOverwriteData.do") - public String doOverwriteData(HttpServletRequest request,Model model) throws IOException{ - String pid=request.getParameter("pid"); - String tbName = "TB_Achievement_AcceptanceModelRecord_file"; - - int result=0; - List filelist = this.commonFileService.selectListByTableAWhere(tbName, " where masterid='"+pid+"' order by insdt desc"); - if(filelist!=null&&filelist.size()>0){ - // 设定Excel文件所在路径 - String excelFileName = filelist.get(0).getAbspath(); - // 读取Excel文件内容 - XSSFWorkbook workbook = null; - HSSFWorkbook workbook2 = null; - FileInputStream inputStream = null; - - //获取Excel后缀名 - String fileType = excelFileName.substring(excelFileName.lastIndexOf(".") + 1, excelFileName.length()); - // 获取Excel文件 - File excelFile = new File(excelFileName); - if (!excelFile.exists()) { - System.out.println("指定的Excel文件不存在!"); - return null; - } - - String endtype=".xlsx"; - // 获取Excel工作簿 - inputStream = new FileInputStream(excelFile); - if (fileType.equalsIgnoreCase("XLS")) { - workbook2 = new HSSFWorkbook(inputStream); - endtype=".xls"; - } else if (fileType.equalsIgnoreCase("XLSX")) { - workbook = new XSSFWorkbook(inputStream); - endtype=".xlsx"; - } - - // 生成一个样式,用在表格数据 - XSSFCellStyle listStyle = null; - if(endtype.equals(".xlsx")){ - listStyle=workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - } - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle2 = null; - if(endtype.equals(".xls")){ - listStyle2=workbook2.createCellStyle(); - // 设置这些样式 - listStyle2.setBorderBottom(BorderStyle.THIN); - listStyle2.setBorderLeft(BorderStyle.THIN); - listStyle2.setBorderRight(BorderStyle.THIN); - listStyle2.setBorderTop(BorderStyle.THIN); - listStyle2.setAlignment(HorizontalAlignment.CENTER); - } - - List list = this.acceptanceModelDataService.selectListByWhere(" where 1=1 and pid='"+pid+"' "); - if(list!=null&&list.size()>0){ - for(int i=0;i tlist = this.acceptanceModelTextDataService.selectListByWhere(" where 1=1 and pid='"+pid+"' "); - if(tlist!=null&&tlist.size()>0){ - for(int i=0;i list = this.acceptanceModelMPointService.selectListByWhere(unitId, " where 1=1 and acceptance_model_id='"+acceptanceModelId+"' order by morder"); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "achievement/acceptanceModel_MPointAdd"; - } - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model) { - request.setAttribute("pid", request.getParameter("pid")); - request.setAttribute("mpid", request.getParameter("mpid")); - return "/achievement/MPoint4Select4Single"; - } - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelMPoint") AcceptanceModelMPoint acceptanceModelMPoint){ - User cu= (User)request.getSession().getAttribute("cu"); - acceptanceModelMPoint.setId(CommUtil.getUUID()); - acceptanceModelMPoint.setInsuser(cu.getId()); - acceptanceModelMPoint.setInsdt(CommUtil.nowDate()); - int code = this.acceptanceModelMPointService.save(acceptanceModelMPoint); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - String unitId = request.getParameter("unitId"); - AcceptanceModelMPoint acceptanceModelMPoint = this.acceptanceModelMPointService.selectById(unitId,id); - model.addAttribute("acceptanceModelMPoint", acceptanceModelMPoint); - return "achievement/acceptanceModel_MPointEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelMPoint") AcceptanceModelMPoint acceptanceModelMPoint){ - int code = this.acceptanceModelMPointService.update(acceptanceModelMPoint); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/showMPoint4Select.do") - public String showMPoint4Select(HttpServletRequest request,Model model){ - String mPointIds=request.getParameter("mPointIds"); - String unitId = request.getParameter("unitId"); - String whereStr= "where MPointID in ('"+mPointIds.replace(",", "','")+"') "; - List list = this.mPointService.selectListByWhere(unitId, whereStr); - model.addAttribute("mPoints",JSONArray.fromObject(list)); - return "achievement/MPoint4Select"; - } - - @RequestMapping("/doimport.do") - public String doimport(HttpServletRequest request,Model model, - @RequestParam(value = "acceptanceModelId") String acceptanceModelId, - @RequestParam(value = "mPointIds") String mPointIds){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId= cu.getId(); - String[] mpidArr = mPointIds.split(","); - this.acceptanceModelMPointService.deleteByWhere("where acceptance_model_id = '"+acceptanceModelId+"'"); - - int num = 0; - for (int i = 0; i < mpidArr.length; i++) { - AcceptanceModelMPoint acceptanceModelMPoint = new AcceptanceModelMPoint(); - acceptanceModelMPoint.setId(CommUtil.getUUID()); - acceptanceModelMPoint.setAcceptanceModelId(acceptanceModelId); - acceptanceModelMPoint.setMpointId(mpidArr[i]); - acceptanceModelMPoint.setInsuser(userId); - acceptanceModelMPoint.setInsdt(CommUtil.nowDate()); - acceptanceModelMPoint.setMorder(i); - - int code = this.acceptanceModelMPointService.save(acceptanceModelMPoint); - if(code==1){ - num++; - } - } - - Result result = new Result(); - if (num == mpidArr.length) { - result = Result.success(num); - } else { - result = Result.failed("导入失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.acceptanceModelMPointService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @RequestMapping("/getValueTypeJson.do") - public String getValueTypeJson(HttpServletRequest request,Model model){ - List list = this.rptCollectModeService.selectListByWhere - ("where 1=1 order by morder"); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.acceptanceModelOutputService.selectListByWhere(unitId, " where 1=1 and acceptance_model_id='"+acceptanceModelId+"' order by morder"); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "achievement/acceptanceModel_OutputAdd"; - } - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model) { - request.setAttribute("pid", request.getParameter("pid")); - request.setAttribute("mpid", request.getParameter("mpid")); - return "/achievement/MPoint4Select4Single"; - } - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelOutput") AcceptanceModelOutput acceptanceModelOutput){ - User cu= (User)request.getSession().getAttribute("cu"); - acceptanceModelOutput.setId(CommUtil.getUUID()); - acceptanceModelOutput.setInsuser(cu.getId()); - acceptanceModelOutput.setInsdt(CommUtil.nowDate()); - int code = this.acceptanceModelOutputService.save(acceptanceModelOutput); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/check.do") - public String check(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelOutput") AcceptanceModelOutput acceptanceModelOutput){ - User cu= (User)request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.acceptanceModelOutputService.selectListByWhere(unitId, "where acceptance_model_id='"+acceptanceModelOutput.getAcceptanceModelId()+"' and base_id = '"+acceptanceModelOutput.getBaseId()+"'"); - Result result; - if (list.size()>0) { - result = Result.failed("重复"); - } else { - result = Result.success(1); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - String unitId = request.getParameter("unitId"); - AcceptanceModelOutput acceptanceModelOutput = this.acceptanceModelOutputService.selectById(unitId,id); - model.addAttribute("acceptanceModelOutput", acceptanceModelOutput); - return "achievement/acceptanceModel_OutputEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelOutput") AcceptanceModelOutput acceptanceModelOutput){ - int code = this.acceptanceModelOutputService.update(acceptanceModelOutput); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/showOutput4Select.do") - public String showMPoint4Select(HttpServletRequest request,Model model){ - String baseIds=request.getParameter("mPointIds"); - String unitId = request.getParameter("unitId"); - baseIds=baseIds.replace(",","','"); - List list = this.modelLibraryService.selectListByWhere("where id in ('"+baseIds+"')"); - model.addAttribute("modelLibrarys",JSONArray.fromObject(list)); - return "achievement/modelLibrary4selects"; - } - - @RequestMapping("/doimport.do") - public String doimport(HttpServletRequest request,Model model, - @RequestParam(value = "acceptanceModelId") String acceptanceModelId, - @RequestParam(value = "baseIds") String baseIds){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId= cu.getId(); - String[] baseIdsArr = baseIds.split(","); - this.acceptanceModelOutputService.deleteByWhere("where acceptance_model_id = '"+acceptanceModelId+"'"); - - int num = 0; - for (int i = 0; i < baseIdsArr.length; i++) { - ModelLibrary modelLibrary = this.modelLibraryService.selectById(baseIdsArr[i]); - if(!"3".equals(modelLibrary.getType())){ - continue; - } - AcceptanceModelOutput acceptanceModelOutput = new AcceptanceModelOutput(); - acceptanceModelOutput.setId(CommUtil.getUUID()); - acceptanceModelOutput.setAcceptanceModelId(acceptanceModelId); - acceptanceModelOutput.setBaseId(baseIdsArr[i]); - - acceptanceModelOutput.setName(this.modelLibraryService.selectById(baseIdsArr[i]).getParamName()); - acceptanceModelOutput.setInsuser(userId); - acceptanceModelOutput.setInsdt(CommUtil.nowDate()); - acceptanceModelOutput.setMorder(i); - - int code = this.acceptanceModelOutputService.save(acceptanceModelOutput); - if(code==1){ - num++; - } - } - - Result result = new Result(); - if (num == baseIdsArr.length) { - result = Result.success(num); - } else { - result = Result.failed("导入失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.acceptanceModelOutputService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } -// -// -// @RequestMapping("/getValueTypeJson.do") -// public String getValueTypeJson(HttpServletRequest request,Model model){ -// List list = this.rptCollectModeService.selectListByWhere -// ("where 1=1 order by morder"); -// JSONArray json = new JSONArray(); -// if(list!=null && list.size()>0){ -// for(int i=0;i list = this.acceptanceModelOutputDataService.selectListByWhere(" where 1=1 and pid='"+acceptanceModelRecord.getPid()+"' order by td.id"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/achievement/AcceptanceModelTextController.java b/src/com/sipai/controller/achievement/AcceptanceModelTextController.java deleted file mode 100644 index cef0a9b6..00000000 --- a/src/com/sipai/controller/achievement/AcceptanceModelTextController.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sipai.controller.achievement; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.achievement.AcceptanceModelText; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.achievement.AcceptanceModelTextService; -import com.sipai.service.report.RptCollectModeService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/achievement/acceptanceModelText") -public class AcceptanceModelTextController { - @Resource - private AcceptanceModelTextService acceptanceModelTextService; - @Resource - private MPointService mPointService; - @Resource - private RptCollectModeService rptCollectModeService; - - @RequestMapping("/getlist.do") - public String getAcceptanceModelJson(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - String unitId = request.getParameter("unitId"); - String acceptanceModelId = request.getParameter("id"); - PageHelper.startPage(page, rows); - - List list = this.acceptanceModelTextService.selectListByWhere(" where 1=1 and acceptance_model_id='"+acceptanceModelId+"' order by morder"); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "achievement/acceptanceModel_TextAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelText") AcceptanceModelText acceptanceModelText){ - User cu= (User)request.getSession().getAttribute("cu"); - acceptanceModelText.setId(CommUtil.getUUID()); - acceptanceModelText.setInsuser(cu.getId()); - acceptanceModelText.setInsdt(CommUtil.nowDate()); - int code = this.acceptanceModelTextService.save(acceptanceModelText); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - AcceptanceModelText acceptanceModelText = this.acceptanceModelTextService.selectById(id); - model.addAttribute("acceptanceModelText", acceptanceModelText); - return "achievement/acceptanceModel_TextEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="acceptanceModelText") AcceptanceModelText acceptanceModelText){ - int code = this.acceptanceModelTextService.update(acceptanceModelText); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.acceptanceModelTextService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/achievement/ModelLibraryController.java b/src/com/sipai/controller/achievement/ModelLibraryController.java deleted file mode 100644 index 5a5e1080..00000000 --- a/src/com/sipai/controller/achievement/ModelLibraryController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.sipai.controller.achievement; - -import com.sipai.entity.achievement.ModelLibrary; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.user.User; -import com.sipai.service.achievement.ModelLibraryService; -import com.sipai.tools.CommUtil; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.util.List; - -@Controller -@RequestMapping("/achievement/modelLibrary") -public class ModelLibraryController { - @Resource - private ModelLibraryService modelLibraryService; - - @RequestMapping("/showTree.do") - public String showTree(HttpServletRequest request, Model model) { - return "/achievement/modelLibrary4Tree"; - } - - @RequestMapping("/showTree4Select.do") - public String showMenu4Select(HttpServletRequest request,Model model){ - return "/achievement/modelLibrary4select"; - } - @RequestMapping("/getTree.do") - public String getTree(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 "; - List list = this.modelLibraryService.selectListByWhere("where 1=1 order by morder"); - String json = modelLibraryService.getTree(null, list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("")) { - ModelLibrary entity = modelLibraryService.selectById(pid); - model.addAttribute("pname", entity.getParamName()); - } - model.addAttribute("id", CommUtil.getUUID()); - return "achievement/modelLibraryAdd"; - } - - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ModelLibrary entity = modelLibraryService.selectById(id); - if (entity != null) { - ModelLibrary entity2 = modelLibraryService.selectById(entity.getPid()); - if (entity2 != null) { - model.addAttribute("pname", entity2.getParamName()); - } - /*if (equipmentClass.getAssetClassId() != null) { - String AssetClass = ""; - String AssetClassname = ""; - List list = this.assetClassService.selectListByWhere("where class_id = '" + equipmentClass.getId() + "' "); - for (int i = 0; i < list.size(); i++) { - AssetClass += list.get(i).getId(); - AssetClassname += list.get(i).getAssetclassname(); - if (i < list.size() - 1) { - AssetClass += ","; - AssetClassname += ","; - } - } - equipmentClass.set_assetClassname(AssetClassname); - equipmentClass.setAssetClassId(AssetClass); - }*/ - model.addAttribute("entity", entity); - } - return "achievement/modelLibraryEdit"; - } - - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute("modelLibrary") ModelLibrary modelLibrary) { - User cu = (User) request.getSession().getAttribute("cu"); - modelLibrary.setInsuser(cu.getId()); - modelLibrary.setInsdt(CommUtil.nowDate()); - int res = this.modelLibraryService.save(modelLibrary); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/update.do") - public String update(HttpServletRequest request, Model model, - @ModelAttribute("modelLibrary") ModelLibrary modelLibrary) { - User cu = (User) request.getSession().getAttribute("cu"); - modelLibrary.setInsuser(cu.getId()); - modelLibrary.setInsdt(CommUtil.nowDate()); - int res = this.modelLibraryService.update(modelLibrary); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/delete.do") - public String delete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.modelLibraryService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/activiti/ActivitiController.java b/src/com/sipai/controller/activiti/ActivitiController.java deleted file mode 100644 index 37bd524e..00000000 --- a/src/com/sipai/controller/activiti/ActivitiController.java +++ /dev/null @@ -1,1900 +0,0 @@ -package com.sipai.controller.activiti; - - -import com.sipai.entity.equipment.*; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.service.equipment.*; -import com.sipai.service.maintenance.*; -import com.sipai.service.process.RoutineWorkService; -import com.sipai.service.process.WaterTestService; -import com.sipai.service.report.RptCreateService; - -import com.sipai.service.workorder.OverhaulService; -import com.sipai.service.workorder.WorkorderDetailService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.bpmn.converter.BpmnXMLConverter; -import org.activiti.bpmn.model.BpmnModel; -import org.activiti.editor.constants.ModelDataJsonConstants; -import org.activiti.editor.language.json.converter.BpmnJsonConverter; -import org.activiti.engine.IdentityService; -import org.activiti.engine.ManagementService; -import org.activiti.engine.ProcessEngineConfiguration; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl; -import org.activiti.engine.impl.context.Context; -import org.activiti.engine.impl.interceptor.Command; -import org.activiti.engine.impl.persistence.entity.ExecutionEntity; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.Deployment; -import org.activiti.engine.repository.NativeProcessDefinitionQuery; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.repository.ProcessDefinitionQuery; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.activiti.image.ProcessDiagramGenerator; -import org.activiti.spring.ProcessEngineFactoryBean; -import org.apache.commons.io.FilenameUtils; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.node.ObjectNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONException; -import com.github.pagehelper.PageInfo; -import com.sipai.activiti.cmd.JumpActivityCmd; -import com.sipai.activiti.util.Page; -import com.sipai.activiti.util.PageUtil; -import com.sipai.activiti.util.WorkflowUtils; -import com.sipai.entity.accident.ReasonableAdvice; -import com.sipai.entity.activiti.Leave; -import com.sipai.entity.activiti.ModelNodeJob; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.administration.IndexWork; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.administration.Temporary; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.RawMaterial; -import com.sipai.entity.sparepart.StockCheck; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Job; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.OverhaulItemProject; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.accident.ReasonableAdviceService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowTraceService; -import com.sipai.service.administration.IndexWorkService; -import com.sipai.service.administration.OrganizationService; -import com.sipai.service.administration.TemporaryService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.business.BusinessUnitService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.sparepart.InStockRecordService; -import com.sipai.service.sparepart.OutStockRecordService; -import com.sipai.service.sparepart.RawMaterialService; -import com.sipai.service.sparepart.StockCheckService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserJobService; -import com.sipai.service.workorder.OverhaulItemProjectService; -import com.sipai.service.process.ProcessAdjustmentService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.zip.ZipInputStream; - -/** - * 流程管理控制器 - * - * @author wxp - */ -@Controller -@RequestMapping(value = "/activiti/workflow") -public class ActivitiController { - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - protected WorkflowProcessDefinitionService workflowProcessDefinitionService; - - protected RepositoryService repositoryService; - - protected RuntimeService runtimeService; - - protected TaskService taskService; - - protected WorkflowTraceService traceService; - - @Resource - private UnitService unitService; - - @Resource - private JobService jobService; - @Resource - private UserJobService userjobService; - @Autowired - ManagementService managementService; - - protected static Map PROCESS_DEFINITION_CACHE = new HashMap(); - - @Autowired - ProcessEngineFactoryBean processEngine; - - @Autowired - ProcessEngineConfiguration processEngineConfiguration; - @Resource - private WorkflowService workflowService; - @Resource - private IdentityService identityService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private SubscribeService subscribeService; - @Resource - private ContractService contractService; - @Resource - private ProcessAdjustmentService processAdjustmentService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private StockCheckService stockCheckService; - @Resource - private EquipmentLoseApplyService equipmentLoseApplyService; - @Resource - private EquipmentScrapApplyService equipmentScrapApplyService; - @Resource - private EquipmentSaleApplyService equipmentSaleApplyService; - @Resource - private EquipmentTransfersApplyService equipmentTransfersApplyService; - @Resource - private EquipmentAcceptanceApplyService equipmentAcceptanceApplyService; - - @Resource - private EquipmentStopRecordService equipmentStopRecordService; - - @Resource - private EquipmentRepairPlanService equipmentRepairPlanService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - BusinessUnitService businessUnitService; - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private RepairService repairService; - @Resource - private OverhaulItemProjectService overhaulItemProjectService; - @Resource - private MaintainCarService maintainCarService; - @Resource - private RepairCarService repairCarService; - @Resource - private RoutineWorkService routineWorkService; - @Resource - private WaterTestService waterTestService; - @Resource - private RptCreateService rptCreateService; - @Resource - private OverhaulService overhaulService; - - @Resource - private IndexWorkService indexWorkService; - - @Resource - private OrganizationService organizationService; - @Resource - private TemporaryService temporaryService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private AbnormityService abnormityService; - @Resource - private RawMaterialService rawMaterialService; - @Resource - private ReasonableAdviceService reasonableAdviceService; - @Resource - private EquipmentCardService equipmentCardService; - - - - @RequestMapping("/showProcessList.do") - public String showProcessList(HttpServletRequest request,Model model) { - System.out.println("basic"); - return "/activiti/processList"; - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getProcessList.do") - public ModelAndView getProcessList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - int startNum=0; - if(rows==null || rows==0){ - rows = 50; - } - if(page!=null && page>0){ - startNum =(page-1)*rows; - } - System.out.println("companyId:"+request.getParameter("search_pid")); - //模糊查询---activiti自带模糊查询无法使用 - String sql = "select top (100) percent a.*,b.DEPLOY_TIME_ from ACT_RE_PROCDEF a left join ACT_RE_DEPLOYMENT b on a.DEPLOYMENT_ID_ = b.ID_ "; - String wherestr = " where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and a.NAME_ like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_pid")!=null && !request.getParameter("search_pid").isEmpty()){ - wherestr += " and a.KEY_ like '%"+request.getParameter("search_pid")+"%' "; - }else{ - if(!cu.getId().equals(CommString.ID_Admin)){ - List companies = unitService.getCompaniesByUserId(cu.getId()); - if(companies!=null && companies.size()>0){ - for(int i=0;i list = new ArrayList(); - - -// List processDefinitionList = processDefinitionQuery.listPage(startNum, rows); - NativeProcessDefinitionQuery nativeProcessDefinitionQuery= repositoryService.createNativeProcessDefinitionQuery().sql(sql); - List processDefinitionList = nativeProcessDefinitionQuery.listPage(startNum, rows); - long sum=processDefinitionList.size(); - for (ProcessDefinition processDefinition : processDefinitionList) { - /*if(!processDefinition.getName().toLowerCase().contains(search_name.toLowerCase()) || !processDefinition.getId().toLowerCase().contains(search_code.toLowerCase()) ){ - continue; - }*/ - String deploymentId = processDefinition.getDeploymentId(); - - //List deployment = repositoryService.createNativeDeploymentQuery().sql("select * from ACT_RE_DEPLOYMENT where ID_ = '"+deploymentId+"'").list(); - Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); - list.add(new Object[]{processDefinition,deployment}); - } - - Collections.sort(list,new Comparator(){ - public int compare(Object[] arg0, Object[] arg1) { - return ((Deployment)arg1[1]).getDeploymentTime().compareTo(((Deployment)arg0[1]).getDeploymentTime()); - } - }); - - - JSONArray json= listToJsonArray(list); -// getNextPDNode("process:3:97523","cnc","Y"); -// getNextPDNode("leave:2:72515","deptLeaderAudit","Y"); - String result="{\"total\":"+sum+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - - - -// page.setTotalCount(processDefinitionQuery.count()); -// page.setResult(objects); -// mav.addObject("page", page); -// -// return mav; - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getProcessDefinitionListForSelect.do") - public ModelAndView getProcessDefinitionListForSelect(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr_search_name=""; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr_search_name=request.getParameter("search_name"); - } - String wherestr_search_code="asdf"; - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr_search_code =request.getParameter("search_code"); - - } - try {//解决中文乱码问题 - wherestr_search_name=new String(wherestr_search_name.getBytes("ISO-8859-1"),"UTF-8"); - wherestr_search_code=new String(wherestr_search_code.getBytes("ISO-8859-1"),"UTF-8"); - } catch (UnsupportedEncodingException e) - { - e.printStackTrace(); - } -// Page page1 = new Page(PageUtil.PAGE_SIZE); -// int[] pageParams = PageUtil.init(page1, request); - Integer page =0; - Integer rows =0; - int startNum=0; - try { - page =Integer.parseInt(request.getParameter("page")); - rows =Integer.parseInt(request.getParameter("rows")); - - } catch (Exception e) { - // TODO: handle exception - } - if(rows==null || rows==0){ - rows = 50; - } - if(page!=null && page>0){ - startNum =(page-1)*rows; - } - - List list = new ArrayList(); - ProcessDefinitionQuery processDefinitionQuery =null; - if(!wherestr_search_name.isEmpty() && !wherestr_search_code.isEmpty()){ - processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionName(wherestr_search_name) - .processDefinitionId(wherestr_search_code).orderByDeploymentId().asc(); - }else if(!wherestr_search_code.isEmpty()){ - //processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(wherestr_search_code).orderByProcessDefinitionVersion().desc(); - List processDefinitionList = (ArrayList)repositoryService.createNativeProcessDefinitionQuery().sql("select * from ACT_RE_PROCDEF where key_ like '%"+wherestr_search_code+"%'").listPage(startNum, rows); - - }else if(!(wherestr_search_name.isEmpty())){ - processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionName(wherestr_search_name).orderByDeploymentId().asc(); - } else{ - processDefinitionQuery = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc(); - - } - long sum=processDefinitionQuery.count(); - List processDefinitionList = processDefinitionQuery.listPage(startNum, rows); - for (ProcessDefinition processDefinition : processDefinitionList) { -// if(!processDefinition.getName().toLowerCase().contains(search_name.toLowerCase()) || !processDefinition.getId().toLowerCase().contains(search_code.toLowerCase()) ){ -// continue; -// } - String deploymentId = processDefinition.getDeploymentId(); - Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); - list.add(new Object[]{processDefinition, deployment}); - } - - //页码 - PageInfo pi = new PageInfo(list); - JSONArray json= listToJsonArray(list); -// getNextPDNode("process:3:97523","cnc","Y"); -// getNextPDNode("leave:2:72515","deptLeaderAudit","Y"); - String result="{\"total\":"+sum+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - - - -// page.setTotalCount(processDefinitionQuery.count()); -// page.setResult(objects); -// mav.addObject("page", page); -// -// return mav; - } - /** - * 根据流程定义,获取流程所有工序 - * - *@param //order= desc表示逆序,其它都为顺序 - * @return - */ - @RequestMapping(value = "/getAllPDNode.do") - public ModelAndView getAllPDNode(HttpServletRequest request,Model model) { - String processDefinitionId=request.getParameter("processDefinitionId"); - String order =request.getParameter("order"); - //processDefinitionId="D121370952B:3:242518"; - List userTasks=workflowProcessDefinitionService.getAllPDTask(processDefinitionId,order); - JSONArray json =JSONArray.fromObject(userTasks); - String result="{\"total\":"+json.size()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - public List getLASTPDTask(String processDefinitionId){ - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefinitionId); - //根据流程定义获得所有的节点: - List activitiList = def.getActivities(); -// List outTransitions = activityImpl.getOutgoingTransitions(); - List usertasks=new ArrayList<>(); - for(ActivityImpl activityImpl:activitiList){ - //ActivityBehavior behavior=activityImpl.getActivityBehavior(); - if(activityImpl.getProperty("type").equals("userTask")){ - //System.out.println("任务:"+activityImpl.getProperty("name")); - usertasks.add(activityImpl); - } - } - List workTasks=ActivitiUtil.activitiImplToWorkTask(usertasks); - return workTasks; - } - /** - * 获取流程下一步的所有任务清单 - * @param request - * @param model - * @returnq - */ - @RequestMapping("/getRoutesForSelect.do") - public String getRoutesForSelect(HttpServletRequest request,Model model, - @RequestParam(value = "taskId") String taskId) { - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - List list=workflowProcessDefinitionService.getNextWorkTasks(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - String passFlag =request.getParameter("passFlag"); - - if (passFlag!=null && !passFlag.isEmpty()) { - boolean pFlag = Boolean.parseBoolean(passFlag); - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - WorkTask workTask =(WorkTask)iterator.next(); - if (pFlag!=workTask.isPassFlag()) { - iterator.remove(); - } - - } - } - request.setAttribute("result", JSONArray.fromObject(list)); - return "result"; - } - - /** - * 获取流程下一步的所有任务清单,select2选择 - * @param request - * @param model - * @returnq - */ - @RequestMapping("/getRoutesForSelect2.do") - public String getRoutesForSelect2(HttpServletRequest request,Model model, - @RequestParam(value = "taskId") String taskId) { - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - List list=workflowProcessDefinitionService.getNextWorkTasks(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - String passFlag =request.getParameter("passFlag"); - if (passFlag!=null && !passFlag.isEmpty()) { - boolean pFlag = Boolean.parseBoolean(passFlag); - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - WorkTask workTask =(WorkTask)iterator.next(); - if (pFlag!=workTask.isPassFlag()) { - iterator.remove(); - } - - } - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (WorkTask workTask : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", workTask.getRouteNum()); - jsonObject.put("text", workTask.getName()); - jsonObject.put("resourceId", workTask.getId()); - jsonObject.put("modelKEY", workTask.getPd_key()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - } - return "result"; - } - - @RequestMapping("/getProcessForSelect.do") - public String getProcessForSelect(HttpServletRequest request,Model model) { - if(request.getParameter("id")!=null && !request.getParameter("id").isEmpty()){ - request.setAttribute("id", request.getParameter("id")); - } - return "/activiti/processForSelect"; - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getProcessListForSelect.do") - public ModelAndView getProcessListForSelect(HttpServletRequest request,Model model) { - Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request); - - List list = new ArrayList(); - ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().active().orderByDeploymentId().desc(); - List processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); - for (ProcessDefinition processDefinition : processDefinitionList) { - String deploymentId = processDefinition.getDeploymentId(); -// Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); - list.add(processDefinition);//(new Object[]{processDefinition, deployment}); - } - PageInfo pi = new PageInfo(list); - - JSONArray json= listToJsonArray_ProcessDefinition(list); - - - model.addAttribute("result",json); - - return new ModelAndView("result"); - - - -// page.setTotalCount(processDefinitionQuery.count()); -// page.setResult(objects); -// mav.addObject("page", page); -// -// return mav; - } - - @RequestMapping("/taskList.do") - public String taskList(HttpServletRequest request,Model model){ - return "/activiti/taskList"; - } - @RequestMapping("/taskList4main.do") - public String taskList4main(HttpServletRequest request,Model model){ - return "/activiti/taskList4main"; - } - /** - * 获取生产总流程任务列表 - * - * @param //leave - */ - @RequestMapping(value = "getTaskListNew.do") - public ModelAndView getTaskListNew(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - User cu=(User)request.getSession().getAttribute("cu"); - String userId = cu.getId(); - Map map=null; - String modelKey = request.getParameter("modelKey"); - JSONObject results = workflowService.findTodoTasks(userId,null,map,page,rows,modelKey); - JSONArray json = results.getJSONArray("rows"); - json = jsonArraySort(json,"task",true); - //服务端分页 - String result="{\"total\":"+results.getString("total")+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - //客户端分页 - //String result=json.toString(); - //model.addAttribute("result",result); - - return new ModelAndView("result"); - } - /** - * 获取生产总流程任务列表 - * - * @param //leave - */ - @RequestMapping(value = "getTaskList.do") - public ModelAndView getTaskList(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - List list= null; - if(cu!=null){ - String userId = cu.getId(); - Map map=null; - - /* Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request);*/ - //筛选附件条件,用与variable筛选 - list=workflowService.findTodoTasks(userId,null,map); - for (TodoTask todoTask : list) { - try { - String businessKey = todoTask.getVariables().get("businessKey").toString(); - Maintenance maintenance=null; - if(todoTask.getType().contains(ProcessType.S_Maintenance.getId())){ - //系统默认主流程 - maintenance= this.maintenanceService.selectById(businessKey); - todoTask.setBusiness(maintenance); - }else if (todoTask.getType().contains(ProcessType.Administration_IndexWork.getId())) { - IndexWork indexWork = this.indexWorkService.selectById(businessKey); - if(indexWork!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(indexWork.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("指标控制工作"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.Administration_Organization.getId())) { - Organization organization = this.organizationService.selectById(businessKey); - if(organization!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(organization.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("组织工作"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.Administration_Reserve.getId())) { - Organization organization = this.organizationService.selectById(businessKey); - if(organization!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(organization.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("预案工作"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.Administration_Temporary.getId())) { - Temporary temporary = this.temporaryService.selectById(businessKey); - if(temporary!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(temporary.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("行政综合临时任务"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.B_Purchase.getId())) { - Subscribe subscribe = this.subscribeService.selectById(businessKey); - if(subscribe!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(subscribe.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资申购审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.B_Contract.getId())) { - Contract contract = this.contractService.selectById(businessKey); - if(contract!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(contract.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("采购合同审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if(todoTask.getType().contains(ProcessType.Process_Adjustment.getId())){ - ProcessAdjustment processAdjustment = this.processAdjustmentService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(processAdjustment.getUnitId()); - maintenance.setCompany(company); - //将问题详情内容复制到中间变量 - maintenance.setProblem(processAdjustment.getContents()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.B_Maintenance.getId())){ - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(businessKey); - if (null!=maintenanceDetail.getMaintenanceid() && !maintenanceDetail.getMaintenanceid().isEmpty()) { - maintenance= this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - }else{ - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenanceDetail.getCompanyid()); - maintenance.setCompany(company); - } - //将问题详情内容复制到中间变量 - maintenance.setProblem(maintenanceDetail.getProblemcontent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.I_Stock.getId())){ - InStockRecord inStockRecord = this.inStockRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(inStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资入库审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Raw_Material.getId())){ - RawMaterial rawMaterial = this.rawMaterialService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(rawMaterial.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("药剂检验"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Reasonable_Advice.getId())){ - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(reasonableAdvice.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("合理化建议审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintain_Car.getId())){ - MaintainCar maintainCar = this.maintainCarService.selectById(businessKey); - maintenance=new Maintenance(); - if(maintainCar!=null){ - Company company = unitService.getCompById(maintainCar.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("车辆维保审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Repair_Car.getId())){ - RepairCar repairCar = this.repairCarService.selectById(businessKey); - maintenance=new Maintenance(); - if(repairCar!=null){ - Company company = unitService.getCompById(repairCar.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("车辆维修审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.O_Stock.getId())){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(outStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资领用审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Scetion_Stock.getId())){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(outStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("处级物资领用审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Stock_Check.getId())){ - StockCheck stockCheck = this.stockCheckService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(stockCheck.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("库存盘点审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintain_Plan.getId())){ - //之前老的单条计划 - /*MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenancePlan.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem(maintenancePlan.getContent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance);*/ - - //主附表计划 - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(businessKey); - maintenance=new Maintenance(); - if(equipmentPlan!=null){ - if(equipmentPlan.getUnitId()!=null){ - Company company = unitService.getCompById(equipmentPlan.getUnitId()); - maintenance.setCompany(company); - } - if(equipmentPlan.getPlanContents()!=null){ -// equipmentPlan.get - maintenance.setProblem(equipmentPlan.getPlanContents()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - else if(todoTask.getType().contains(ProcessType.Repair_Plan.getId())){ - //之前老的单条计划 - /*EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenancePlan.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem(maintenancePlan.getContent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance);*/ - - //主附表计划 - System.out.println(businessKey); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(businessKey); - maintenance=new Maintenance(); - if(equipmentPlan!=null){ - if(equipmentPlan.getUnitId()!=null){ - Company company = unitService.getCompById(equipmentPlan.getUnitId()); - maintenance.setCompany(company); - } - if(equipmentPlan.getPlanContents()!=null){ - maintenance.setProblem(equipmentPlan.getPlanContents()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - else if(todoTask.getType().contains(ProcessType.Lose_Apply.getId())){ - EquipmentLoseApply loseApply = this.equipmentLoseApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(loseApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备丢失申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Sale_Apply.getId())){ - EquipmentSaleApply saleApply = this.equipmentSaleApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(saleApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备出售申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Scrap_Apply.getId())){ - EquipmentScrapApply scrapApply = this.equipmentScrapApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(scrapApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备报废申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Transfers_Apply.getId())){ - EquipmentTransfersApply transfersApply = this.equipmentTransfersApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(transfersApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备调拨申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Acceptance_Apply.getId())){ - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(eaa.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备验收申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.EquipmentStop_Apply.getId())){ - EquipmentStopRecord esr = equipmentStopRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备启用/停用申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintenance_Repair.getId())){ - Repair esr = repairService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("维修流程"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Programme_Write.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("方案编制"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Bidding_Price.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("招标比价"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Install_Debug.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - if (esr != null) { - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("安装调试"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Project_Check.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - if (esr != null) { - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("项目验收"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Routine_Work.getId())){ - RoutineWork routineWork = routineWorkService.selectById(businessKey); - maintenance=new Maintenance(); - if (routineWork != null) { - Company company = unitService.getCompById(routineWork.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("周期常规工单"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Water_Test.getId())){ - WaterTest waterTest = waterTestService.selectById(businessKey); - maintenance=new Maintenance(); - if (waterTest != null) { - Company company = unitService.getCompById(waterTest.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("水质化验工单"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if (todoTask.getType().contains(ProcessType.Overhaul.getId())){ - Overhaul overhaul = this.overhaulService.selectById(businessKey); - maintenance=new Maintenance(); - if (overhaul != null) { - Company company = unitService.getCompById(overhaul.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem(overhaul.getProjectDescribe()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - else if(todoTask.getType().contains(ProcessType.Report_Check.getId())){ - RptCreate rptCreate = rptCreateService.selectById(businessKey); - maintenance=new Maintenance(); - if (rptCreate != null) { - Company company = unitService.getCompById(rptCreate.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("报表审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Repair.getId())){ - WorkorderDetail entity = this.workorderDetailService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getUnitId()!=null){ - Company company = unitService.getCompById(entity.getUnitId()); - maintenance.setCompany(company); - } - if(entity.getFaultDescription()!=null){ - EquipmentCard equipmentCard = equipmentCardService.selectById(entity.getEquipmentId()); - String name = "(" + equipmentCard.getEquipmentname() + ") "; - maintenance.setProblem(name + entity.getFaultDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Abnormity_Run.getId())){ - //异常上报(运行) - Abnormity entity = this.abnormityService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getBizId()!=null){ - Company company = unitService.getCompById(entity.getBizId()); - maintenance.setCompany(company); - } - if(entity.getAbnormityDescription()!=null){ - maintenance.setProblem(entity.getAbnormityDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Abnormity_Equipment.getId())){ - //异常上报(设备) - Abnormity entity = this.abnormityService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getBizId()!=null){ - Company company = unitService.getCompById(entity.getBizId()); - maintenance.setCompany(company); - } - if(entity.getAbnormityDescription()!=null){ - maintenance.setProblem(entity.getAbnormityDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Abnormity_Facilities.getId())){ - //异常上报(设施) - Abnormity entity = this.abnormityService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getBizId()!=null){ - Company company = unitService.getCompById(entity.getBizId()); - maintenance.setCompany(company); - } - if(entity.getAbnormityDescription()!=null){ - maintenance.setProblem(entity.getAbnormityDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Maintain.getId())){ - //主附表计划 - WorkorderDetail entity = this.workorderDetailService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getUnitId()!=null){ - Company company = unitService.getCompById(entity.getUnitId()); - maintenance.setCompany(company); - } - if(entity.getSchemeResume()!=null){ - EquipmentCard equipmentCard = equipmentCardService.selectById(entity.getEquipmentId()); - String name = "(" + equipmentCard.getEquipmentname() + ") "; - maintenance.setProblem(name + entity.getSchemeResume()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else { - //通用 - String str = todoTask.getType(); - //截取-之后字符串 - String str1 = str.substring(0, str.indexOf("-")); - String unitId = str.substring(str1.length()+1, str.length()); - JSONObject obj =new JSONObject(); - Company company = unitService.getCompById(unitId); - obj.put("company", company); - //问题描述,默认为节点名称 - obj.put("problem", todoTask.getTask().getName()); - obj.put("status", todoTask.getTask().getDescription()); - todoTask.setBusiness(obj); - } - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - } - - } - JSONArray json= this.workflowService.todoTasklistToJsonArray(list); - json = jsonArraySort(json,"task",true); - String result=json.toString(); -// String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - /** - * 对json数组排序, - * @param jsonArr - * @param sortKey 排序关键字 - * @param is_desc is_desc-false升序列 is_desc-true降序 (排序字段为字符串) - * @return - */ - public JSONArray jsonArraySort(JSONArray jsonArr,final String sortKey,final boolean is_desc) { - //存放排序结果json数组 - JSONArray sortedJsonArray = new JSONArray(); - //用于排序的list - List jsonValues = new ArrayList(); - //将参数json数组每一项取出,放入list - for (int i = 0; i < jsonArr.size(); i++) { - jsonValues.add(JSONObject.fromObject(jsonArr.getJSONObject(i))); - } - //快速排序,重写compare方法,完成按指定字段比较,完成排序 - Collections.sort(jsonValues, new Comparator() { - //排序字段 - private final String KEY_NAME = sortKey; - //重写compare方法 - @Override - public int compare(JSONObject a, JSONObject b) { - String valA = new String(); - String valB = new String(); - try { - valA = a.getString(KEY_NAME); - valB = b.getString(KEY_NAME); - } catch (JSONException e) { - e.printStackTrace(); - } - //是升序还是降序 - if (is_desc){ - return -valA.compareTo(valB); - } else { - return -valB.compareTo(valA); - } - - } - }); - //将排序后结果放入结果jsonArray - for (int i = 0; i < jsonArr.size(); i++) { - sortedJsonArray.add(jsonValues.get(i)); - } - return sortedJsonArray; - } - - @RequestMapping("/donetaskList.do") - public String donetaskList(HttpServletRequest request,Model model){ - return "/activiti/donetaskList"; - } - /* - * 已办事项 - */ - @RequestMapping("/doneworklist.do") - public ModelAndView doneworklist(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - String userid = cu.getId(); - String modelKey = request.getParameter("modelKey"); - List ia = workflowService.queryDoneTasks(userid,modelKey); - JSONArray json = this.workflowService.doneTasklistToJsonArray(ia); - //String result="{\"total\":"+ia.size()+",\"rows\":"+json+"}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /* - * 已完成流程 - */ - @RequestMapping("/finishWorklist.do") - public ModelAndView finishWorklist(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - String userid = cu.getId(); - com.alibaba.fastjson.JSONArray json = workflowService.queryFinishTasks(userid); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - /** - * 获取生产总流程任务列表 - * - * @param //leave - */ - @RequestMapping(value = "getDoneTaskList.do") - public ModelAndView getDoneTaskList(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String userId = cu.getId(); -// int pages = 0; -// if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ -// pages = Integer.parseInt(request.getParameter("page")); -// }else { -// pages = 1; -// } -// int pagesize = 0; -// if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ -// pagesize = Integer.parseInt(request.getParameter("rows")); -// }else { -// pagesize = 8; -// } -// PageHelper.startPage(pages, pagesize); - - List list = this.businessUnitAuditService.selectListByWhere("where insuser='"+userId+"'"); -// PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - /** - * 获取生产总流程任务列表 - * - * @param //leave - */ - @RequestMapping(value = "getProduceTaskList.do") - public ModelAndView getProduceTaskList(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String userId = cu.getId(); - Map map=null; - /*if(request.getParameter("processInstanceId")!=null && !request.getParameter("processInstanceId").isEmpty()){ - if(map==null){ - map=new HashMap<>(); - } - map.put("processInstanceId", request.getParameter("processInstanceId")); - } - - if(request.getParameter("procedureno")!=null && !request.getParameter("procedureno").isEmpty()){ - if(map==null){ - map=new HashMap<>(); - } - map.put("key", "taskCode"); - map.put("value", request.getParameter("procedureno")); - }*/ - - Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request); - //筛选附件条件,用与variable筛选 - - List list=workflowService.findTodoTasks(userId,pageParams,map); - - JSONArray json= todoTasklistToJsonArray(list); - - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - @RequestMapping("/processInstaceList.do") - public String processInstaceList(HttpServletRequest request,Model model){ - return "/activiti/processInstanceList"; - } - /**获取所有实例类型*/ - @RequestMapping("/getProcessTypes4Combo.do") - public ModelAndView getProcessTypes4Combo(HttpServletRequest request,Model model) { - JSONArray jsonArray=new JSONArray(); - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item.getId()); - jsonObject.put("text", item.getName()); - jsonArray.add(jsonObject); - } - model.addAttribute("result",jsonArray.toString()); - return new ModelAndView("result"); - } - /** - * 获取所有生产流程 - * - * @param //leave - */ - @RequestMapping(value = "getAllProcessInstaces.do") - public ModelAndView getAllProcessInstaces(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { -// String processDefinitionKey = request.getParameter("key"); -// processDefinitionKey="System_Produce"; - User cu=(User)request.getSession().getAttribute("cu"); - Page page_activiti = new Page(); - int[] pageParams = {(page-1)*rows,rows};//PageUtil.init(page1, request); - workflowService.findRunningProcessInstaces(page_activiti,pageParams,null); - List list=page_activiti.getResult(); - - JSONArray json= workflowService.todoTasklistToJsonArray(list); - - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - private JSONArray todoTasklistToJsonArray(List list){ - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - JSONArray json= new JSONArray(); - if (list!=null) { - for(int i=0;i list = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).orderByProcessDefinitionVersion().desc().list(); - //删除部署的流程,级联删除流程实例 - repositoryService.deleteDeployment(deploymentId, true); - result=1; - } catch (Exception e) { - // TODO: handle exception - result =0; - e.printStackTrace(); - } - - model.addAttribute("result", result); - return "result"; - } - /**删除流程*/ - @RequestMapping(value = "/process/delProcessInstance") - public String delProcessInstance(HttpServletRequest request,Model model, - @RequestParam("id") String processInstanceId) { - int result =0; - try { - - runtimeService.deleteProcessInstance(processInstanceId,""); - result=1; - } catch (Exception e) { - // TODO: handle exception - result =0; - e.printStackTrace(); - } - - model.addAttribute("result", result); - return "result"; - } - /** - * 输出跟踪流程信息 - * - * @param //processInstanceId - * @return - * @throws Exception - */ - @RequestMapping(value = "process/trace") - @ResponseBody - public List> traceProcess(HttpServletRequest request,Model model){ - String processInstanceId = request.getParameter("pid"); - String taskId = request.getParameter("taskId"); - List> activityInfos= new ArrayList<>(); - try{ - activityInfos = traceService.traceProcess(processInstanceId,taskId); - }catch(Exception e){ - e.printStackTrace(); - } - return activityInfos; - } - /** - * 输出定义流程信息 - * - * @param //processInstanceId - * @return - * @throws Exception - */ - @RequestMapping(value = "processDefinition/trace") - public String traceProcessDefinition(HttpServletRequest request,Model model){ - String processDefinitionId = request.getParameter("pdid"); - List> activityInfos= new ArrayList<>(); - try{ - activityInfos = traceService.traceProcessByDefinitionId(processDefinitionId); - }catch(Exception e){ - e.printStackTrace(); - } - return "/activiti/processDefinitionTrace"; - } - - /** - * 读取带跟踪的图片 - */ - @RequestMapping(value = "process/trace/auto/{executionId}") - public void readResource(@PathVariable("executionId") String executionId, HttpServletResponse response) - throws Exception { - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(executionId).singleResult(); - BpmnModel bpmnModel = repositoryService.getBpmnModel(processInstance.getProcessDefinitionId()); - List activeActivityIds = runtimeService.getActiveActivityIds(executionId); - // 不使用spring请使用下面的两行代码 -// ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); -// Context.setProcessEngineConfiguration(defaultProcessEngine.getProcessEngineConfiguration()); - - // 使用spring注入引擎请使用下面的这行代码 - processEngineConfiguration = processEngine.getProcessEngineConfiguration(); - Context.setProcessEngineConfiguration((ProcessEngineConfigurationImpl) processEngineConfiguration); - - ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator(); - InputStream imageStream = diagramGenerator.generateDiagram(bpmnModel, "png", activeActivityIds); - - // 输出资源内容到相应对象 - byte[] b = new byte[1024]; - int len; - while ((len = imageStream.read(b, 0, 1024)) != -1) { - response.getOutputStream().write(b, 0, len); - } - } - - @RequestMapping(value = "/deploy") - public String deploy(@Value("#{APP_PROPERTIES['export.diagram.path']}") String exportDir, @RequestParam(value = "file", required = false) MultipartFile file) { - - String fileName = file.getOriginalFilename(); - - try { - InputStream fileInputStream = file.getInputStream(); - Deployment deployment = null; - - String extension = FilenameUtils.getExtension(fileName); - if (extension.equals("zip") || extension.equals("bar")) { - ZipInputStream zip = new ZipInputStream(fileInputStream); - deployment = repositoryService.createDeployment().addZipInputStream(zip).deploy(); - } else { - deployment = repositoryService.createDeployment().addInputStream(fileName, fileInputStream).deploy(); - } - - List list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list(); - - for (ProcessDefinition processDefinition : list) { - WorkflowUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir); - } - - } catch (Exception e) { - logger.error("error on deploy process, because of file input stream", e); - } - - return "redirect:/workflow/process-list"; - } - - @RequestMapping(value = "/process/convert-to-model/{processDefinitionId}") - public String convertToModel(@PathVariable("processDefinitionId") String processDefinitionId) - throws UnsupportedEncodingException, XMLStreamException { - ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() - .processDefinitionId(processDefinitionId).singleResult(); - InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), - processDefinition.getResourceName()); - XMLInputFactory xif = XMLInputFactory.newInstance(); - InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8"); - XMLStreamReader xtr = xif.createXMLStreamReader(in); - BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr); - - BpmnJsonConverter converter = new BpmnJsonConverter(); - com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bpmnModel); - org.activiti.engine.repository.Model modelData = repositoryService.newModel(); - modelData.setKey(processDefinition.getKey()); - modelData.setName(processDefinition.getResourceName()); - modelData.setCategory(processDefinition.getDeploymentId()); - - ObjectNode modelObjectNode = new ObjectMapper().createObjectNode(); - modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName()); - modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1); - modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription()); - modelData.setMetaInfo(modelObjectNode.toString()); - - repositoryService.saveModel(modelData); - - repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8")); - - return "redirect:/workflow/model/list"; - } - - /** - * 待办任务--Portlet - */ - /* @RequestMapping(value = "/task/todo/list") - @ResponseBody - public List> todoList(HttpSession session) throws Exception { - User user=(User)request.getSession().getAttribute("cu"); - List> result = new ArrayList>(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm"); - - // 已经签收的任务 - List todoList = taskService.createTaskQuery().taskAssignee(user.getId()).active().list(); - for (Task task : todoList) { - String processDefinitionId = task.getProcessDefinitionId(); - ProcessDefinition processDefinition = getProcessDefinition(processDefinitionId); - - Map singleTask = packageTaskInfo(sdf, task, processDefinition); - singleTask.put("status", "todo"); - result.add(singleTask); - } - - // 等待签收的任务 - List toClaimList = taskService.createTaskQuery().taskCandidateUser(user.getId()).active().list(); - for (Task task : toClaimList) { - String processDefinitionId = task.getProcessDefinitionId(); - ProcessDefinition processDefinition = getProcessDefinition(processDefinitionId); - - Map singleTask = packageTaskInfo(sdf, task, processDefinition); - singleTask.put("status", "claim"); - result.add(singleTask); - } - - return result; - }*/ - - private Map packageTaskInfo(SimpleDateFormat sdf, Task task, ProcessDefinition processDefinition) { - Map singleTask = new HashMap(); - singleTask.put("id", task.getId()); - singleTask.put("name", task.getName()); - singleTask.put("createTime", sdf.format(task.getCreateTime())); - singleTask.put("pdname", processDefinition.getName()); - singleTask.put("pdversion", processDefinition.getVersion()); - singleTask.put("pid", task.getProcessInstanceId()); - return singleTask; - } - - private ProcessDefinition getProcessDefinition(String processDefinitionId) { - ProcessDefinition processDefinition = PROCESS_DEFINITION_CACHE.get(processDefinitionId); - if (processDefinition == null) { - processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); - PROCESS_DEFINITION_CACHE.put(processDefinitionId, processDefinition); - } - return processDefinition; - } - - /** - * 挂起、激活流程定义 - */ - @RequestMapping(value = "processdefinition/update.do") - public String updateDefinitionState(HttpServletRequest request,Model model, - @RequestParam(value = "state") String state, - @RequestParam(value = "processDefinitionId") String processDefinitionId) { - int result =0; - if (state.equals("active")) { - repositoryService.activateProcessDefinitionById(processDefinitionId, true, null); - result=1; - } else if (state.equals("suspend")) { - repositoryService.suspendProcessDefinitionById(processDefinitionId, true, null); - result=1; - } - model.addAttribute("result", result); - return "result"; - } - /** - * 挂起、激活流程实例 - */ - @RequestMapping(value = "processinstance/update.do") - public String updateInstanceState(HttpServletRequest request,Model model, - @RequestParam(value = "state") String state, - @RequestParam(value = "processInstanceId") String processInstanceId) { - int result =0; - if (state.equals("active")) { - runtimeService.activateProcessInstanceById(processInstanceId); - result=1; - } else if (state.equals("suspend")) { - runtimeService.suspendProcessInstanceById(processInstanceId); - result=1; - } - model.addAttribute("result", result); - return "result"; - } - - - /** - * 签收任务 - */ - @RequestMapping(value = "task/claim.do") - public String claim(HttpServletRequest request,Model model, - @RequestParam(value="taskId") String taskId) { - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu.getId(); - int result=0; - try{ - identityService.setAuthenticatedUserId(userId); - taskService.claim(taskId, userId); - result=1; - }catch(Exception e){ - e.printStackTrace(); - } - - model.addAttribute("result", result); - return "result"; - } - /** - * 批量签收任务 - */ - @RequestMapping(value = "task/batchSignIn.do") - public String batchSignIn(HttpServletRequest request,Model model, - @RequestParam(value="taskIds") String taskIds) { - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu.getId(); - int result=0; - if(taskIds!=null && !taskIds.isEmpty()){ - String[] taskIdArray = taskIds.split(","); - identityService.setAuthenticatedUserId(userId); - String taskId = ""; - for(int i=0;i list = repositoryService.createNativeModelQuery().sql(sql).list(); - if(list!=null && list.size()>0){ - sqlStr = " and model_id ='"+list.get(0).getId()+"' "; - } - } - List mnjbList = this.jobService.selectModelNodeJobListByWhere(" where resource_id='"+resourceId+"'" +sqlStr); - List jobIds = new ArrayList(); - for (ModelNodeJob item:mnjbList){ - jobIds.add(item.getJobId()); - } - JSONArray json = new JSONArray(); - List jobList = new ArrayList(); - for (String item:jobIds){ - List jList = this.jobService.selectListByWhere(" where id='"+item+"'"); - if(jList!= null &&jList.size()>0){ - for(User u:jList.get(0).getUser()){ - JSONObject obj = new JSONObject(); - obj = obj.fromObject(u); - json.add(obj); - } - } - } - model.addAttribute("result", json); - return "result"; - } - - /** - * 获得流程节点关联职位 - * @param request - * @param model - * @param resourceId - * @return - */ - @RequestMapping(value = "getTargetJobs4Node.do") - public String getTargetJobs4Node(HttpServletRequest request,Model model, - @RequestParam(value = "resourceId") String resourceId, - @RequestParam(value = "modelKEY") String modelKEY) { - String sqlStr = ""; - if(modelKEY!=null && !modelKEY.equals("")){ - String sql = "select * from [ACT_RE_MODEL] where KEY_='"+modelKEY+"' "; - List list = repositoryService.createNativeModelQuery().sql(sql).list(); - if(list!=null && list.size()>0){ - sqlStr = " and model_id ='"+list.get(0).getId()+"' "; - } - } - List mnjbList = this.jobService.selectModelNodeJobListByWhere(" where resource_id='"+resourceId+"'" +sqlStr); - - JSONArray json = new JSONArray(); - json = JSONArray.fromObject(mnjbList); - model.addAttribute("result", json); - return "result"; - } - /** - * 导出图片文件到硬盘 - * - * @return - */ - @RequestMapping(value = "export/diagrams") - @ResponseBody - public List exportDiagrams(@Value("#{APP_PROPERTIES['export.diagram.path']}") String exportDir) throws IOException { - List files = new ArrayList(); - List list = repositoryService.createProcessDefinitionQuery().list(); - - for (ProcessDefinition processDefinition : list) { - files.add(WorkflowUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir)); - } - - return files; - } - - @RequestMapping(value = "activity/jump") - @ResponseBody - public boolean jump(@RequestParam("executionId") String executionId, - @RequestParam("activityId") String activityId) { - Command cmd = new JumpActivityCmd(executionId, activityId); - managementService.executeCommand(cmd); - return true; - } - - @RequestMapping(value = "bpmn/model/{processDefinitionId}") - @ResponseBody - public BpmnModel queryBpmnModel(@PathVariable("processDefinitionId") String processDefinitionId) { - BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); - return bpmnModel; - } - - @Autowired - public void setWorkflowProcessDefinitionService(WorkflowProcessDefinitionService workflowProcessDefinitionService) { - this.workflowProcessDefinitionService = workflowProcessDefinitionService; - } - - @Autowired - public void setRepositoryService(RepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - - @Autowired - public void setRuntimeService(RuntimeService runtimeService) { - this.runtimeService = runtimeService; - } - - @Autowired - public void setTraceService(WorkflowTraceService traceService) { - this.traceService = traceService; - } - - @Autowired - public void setTaskService(TaskService taskService) { - this.taskService = taskService; - } - -} diff --git a/src/com/sipai/controller/activiti/AutoActivitiController.java b/src/com/sipai/controller/activiti/AutoActivitiController.java deleted file mode 100644 index 3df4ba4c..00000000 --- a/src/com/sipai/controller/activiti/AutoActivitiController.java +++ /dev/null @@ -1,863 +0,0 @@ -package com.sipai.controller.activiti; - - - - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.zip.ZipInputStream; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.activiti.bpmn.BpmnAutoLayout; -import org.activiti.bpmn.converter.BpmnXMLConverter; -import org.activiti.bpmn.model.BpmnModel; -import org.activiti.bpmn.model.EndEvent; -import org.activiti.bpmn.model.ExclusiveGateway; -import org.activiti.bpmn.model.Process; -import org.activiti.bpmn.model.SequenceFlow; -import org.activiti.bpmn.model.StartEvent; -import org.activiti.bpmn.model.UserTask; -import org.activiti.editor.constants.ModelDataJsonConstants; -import org.activiti.editor.language.json.converter.BpmnJsonConverter; -import org.activiti.engine.ManagementService; -import org.activiti.engine.ProcessEngineConfiguration; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.Condition; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl; -import org.activiti.engine.impl.context.Context; -import org.activiti.engine.impl.interceptor.Command; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.PvmActivity; -import org.activiti.engine.impl.pvm.PvmTransition; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.Deployment; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.repository.ProcessDefinitionQuery; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.activiti.image.ProcessDiagramGenerator; -import org.activiti.spring.ProcessEngineFactoryBean; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang.StringUtils; -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.POIFSFileSystem; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.node.ObjectNode; -import org.junit.Assert; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.activiti.cmd.JumpActivityCmd; -import com.sipai.activiti.util.Page; -import com.sipai.activiti.util.PageUtil; -import com.sipai.activiti.util.WorkflowUtils; -import com.sipai.entity.activiti.TaskModel; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowTraceService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -/** - * 流程管理控制器 - * - * @author wxp - */ -@Controller -@RequestMapping(value = "/activiti/auto") -public class AutoActivitiController { - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - protected WorkflowProcessDefinitionService workflowProcessDefinitionService; - - protected RepositoryService repositoryService; - - protected RuntimeService runtimeService; - - protected TaskService taskService; - - protected WorkflowTraceService traceService; - - @Autowired - ManagementService managementService; - - protected static Map PROCESS_DEFINITION_CACHE = new HashMap(); - - @Autowired - ProcessEngineFactoryBean processEngine; - - @Autowired - ProcessEngineConfiguration processEngineConfiguration; - - @RequestMapping("/doimport.do") - public String doimport(HttpServletRequest request,Model model){ - return "/activiti/importAutoActiviti"; - } - @RequestMapping(value = "saveImportActiviti.do") - public ModelAndView saveImportActiviti(@RequestParam MultipartFile[] file, HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - User cu = (User)request.getSession().getAttribute("cu"); - //要存入的实际地址 - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName,"Temp"); - - List data= importByExcel(realPath,file,cu); - int result =autoImport(data); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - public int autoImport(List data) { - int result=0; - if(data==null || data.size()<3) - { - return result; - } - // 1. Build up the model from scratch - BpmnModel bModel = new BpmnModel(); - Process process=new Process(); - bModel.addProcess(process); - final String PROCESSID =data.get(0).getId(); - final String PROCESSNAME =data.get(0).getName(); - if(PROCESSID==null || PROCESSNAME==null){ - return result; - } - process.setId(PROCESSID); - process.setName(PROCESSNAME); - - for (int i = 1; i < data.size(); i++) { - TaskModel taskModel = data.get(i); - switch (taskModel.getType()) { - case "startEvent": - String taskId = taskModel.getId(); - String target_true = taskModel.getTarget_true(); - process.addFlowElement(createStartEvent()); //创建节点 - process.addFlowElement(createSequenceFlow(taskId, target_true, "", ""));//创建连线 - break; - case "endEvent": - process.addFlowElement(createEndEvent()); - break; - case "task": - taskId = taskModel.getId(); - String taskName = taskModel.getName(); - target_true = taskModel.getTarget_true(); - process.addFlowElement(createUserTask(taskId, taskName, "candidateGroup"+i)); - process.addFlowElement(createSequenceFlow(taskId, target_true, "", "")); - break; - case "gateway": - taskId = taskModel.getId(); - taskName = taskModel.getName(); - target_true = taskModel.getTarget_true(); - String target_false = taskModel.getTarget_false(); - process.addFlowElement(createExclusiveGateway(taskId)); - process.addFlowElement(createSequenceFlow(taskId, target_true, "通过", "${pass=='Y'}")); - process.addFlowElement(createSequenceFlow(taskId, target_false, "不通过", "${pass=='N'}")); - break; - default: - break; - } - } - - // 2. Generate graphical information - new BpmnAutoLayout(bModel).execute(); - - // 3. Deploy the process to the engine - Deployment deployment = repositoryService.createDeployment().addBpmnModel(PROCESSID+".bpmn", bModel).name(PROCESSID+"_deployment").deploy(); - - // 4. Start a process instance - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(PROCESSID); - - // 5. Check if task is available - List tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list(); - Assert.assertEquals(1, tasks.size()); - try{ - // 6. Save process diagram to a file - InputStream processDiagram = repositoryService.getProcessDiagram(processInstance.getProcessDefinitionId()); - FileUtils.copyInputStreamToFile(processDiagram, new File("/deployments/"+PROCESSID+".png")); - - // 7. Save resulting BPMN xml to a file - InputStream processBpmn = repositoryService.getResourceAsStream(deployment.getId(), PROCESSID+".bpmn"); - FileUtils.copyInputStreamToFile(processBpmn,new File("/deployments/"+PROCESSID+".bpmn")); - result=1; - }catch(Exception e){ - e.printStackTrace(); - } - System.out.println(".........end..."); - - return result; - } - public List importByExcel(String realPath, MultipartFile[] file,User operator) throws IOException { - List result = new ArrayList<>() ; - //上传文件的原名(即上传前的文件名字) - String originalFilename = null; - //服务器路径 - String serverPath = null; - for(MultipartFile myfile:file){ - if(myfile.isEmpty()){ - return null; - }else{ - originalFilename = myfile.getOriginalFilename(); - //兼容linux路径 - serverPath = realPath+System.getProperty("file.separator")+CommUtil.getUUID()+originalFilename; - FileUtil.saveFile(myfile.getInputStream(), serverPath); - System.out.println("-->>临时文件上传完成!"); - - FileInputStream is = new FileInputStream(serverPath); - try { - POIFSFileSystem fs = new POIFSFileSystem(is); - HSSFWorkbook wb = new HSSFWorkbook(fs); - HSSFSheet sheet = wb.getSheetAt(0); - // 得到总行数 - int rowNum = sheet.getPhysicalNumberOfRows(); - HSSFRow row = sheet.getRow(0); - //以导入时列名长度为需要导入数据的长度,超过部分程序将忽略 - int colNum = row.getPhysicalNumberOfCells(); - // 正文内容应该从第3行开始,第一行为表头的标题 - for (int i = 1; i < rowNum; i++) { - //Excel行数据 - row = sheet.getRow(i); - TaskModel taskModel=new TaskModel(); - taskModel.setId(row.getCell(0)==null?null:row.getCell(0).toString()); - taskModel.setName(row.getCell(1)==null?null:row.getCell(1).toString()); - taskModel.setTarget_true(row.getCell(2)==null?null:row.getCell(2).toString()); - taskModel.setTarget_false(row.getCell(3)==null?null:row.getCell(3).toString()); - taskModel.setType(row.getCell(4)==null?null:row.getCell(4).toString()); - - result.add(taskModel); - - } - //导入动作完成后,删除导入文件的临时文件 - FileUtil.deleteFile(serverPath); - System.out.println("<<--临时文件已删除!"); - //关闭流文件 - is.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - return result; - } - - - @RequestMapping("/showProcessList.do") - public String showProcessList(HttpServletRequest request,Model model) { - return "/activiti/processList"; - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getProcessList.do") - public ModelAndView getProcessList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr=""; - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request); - - List list = new ArrayList(); - ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc(); - List processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); - for (ProcessDefinition processDefinition : processDefinitionList) { - /*BpmnModel model_bpmn = repositoryService.getBpmnModel(processDefinition.getId()); - if(model != null) { - Collection flowElements = model_bpmn.getMainProcess().getFlowElements(); - for(FlowElement e : flowElements) { - if(e.getClass().toString().contains("userTask")) - System.out.println("flowelement id:" + e.getId() + " name:" + e.getName() + " class:" + e.getClass().toString()); - } - } */ - String deploymentId = processDefinition.getDeploymentId(); - Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); - list.add(new Object[]{processDefinition, deployment}); - } - PageInfo pi = new PageInfo(list); - - JSONArray json= listToJsonArray(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - - - -// page.setTotalCount(processDefinitionQuery.count()); -// page.setResult(objects); -// mav.addObject("page", page); -// -// return mav; - } - /** - * 根据流程定义,获取流程下一个任务 - * - * @return - */ - public void getNextPDNode(String processDefinitionId, String activitiId, boolean flag) { - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefinitionId); - //根据流程定义获得所有的节点: - List activitiList = def.getActivities(); -// List outTransitions = activityImpl.getOutgoingTransitions(); - - for(ActivityImpl activityImpl:activitiList){ - String id = activityImpl.getId(); - if(activitiId.equals(id)){ - System.out.println("当前执行的任务:"+activityImpl.getProperty("name")); - //ActivityBehavior behavior=activityImpl.getActivityBehavior(); - //获取从某个节点出来的所有子节点-网关 - List outTransitions_gw = activityImpl.getOutgoingTransitions(); - for(PvmTransition tr_gw:outTransitions_gw){ - //获取线路的终点节点-网关 - PvmActivity ac_gw = tr_gw.getDestination(); - List outTransitions = ac_gw.getOutgoingTransitions(); - for(PvmTransition tr:outTransitions){ - Condition condition=(Condition)tr.getProperty("condition"); -// condition. - PvmActivity ac = tr.getDestination(); - System.out.println("下一步任务任务:"+ac.getProperty("name")); - } - - } - break; - } - } - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getProcessListForSelect.do") - public ModelAndView getProcessListForSelect(HttpServletRequest request,Model model) { - Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request); - - List list = new ArrayList(); - ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().active().orderByDeploymentId().desc(); - List processDefinitionList = processDefinitionQuery.listPage(pageParams[0], pageParams[1]); - for (ProcessDefinition processDefinition : processDefinitionList) { - String deploymentId = processDefinition.getDeploymentId(); -// Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); - list.add(processDefinition);//(new Object[]{processDefinition, deployment}); - } - PageInfo pi = new PageInfo(list); - - JSONArray json= listToJsonArray_ProcessDefinition(list); - - - model.addAttribute("result",json); - - return new ModelAndView("result"); - - - -// page.setTotalCount(processDefinitionQuery.count()); -// page.setResult(objects); -// mav.addObject("page", page); -// -// return mav; - } - private JSONArray listToJsonArray( List list){ - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - JSONArray json= new JSONArray(); - if (list!=null) { - for(int i=0;i> traceProcess(@RequestParam("pid") String processInstanceId) throws Exception { - List> activityInfos = traceService.traceProcess(processInstanceId,null); - return activityInfos; - } - - /** - * 读取带跟踪的图片 - */ - @RequestMapping(value = "process/trace/auto/{executionId}") - public void readResource(@PathVariable("executionId") String executionId, HttpServletResponse response) - throws Exception { - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(executionId).singleResult(); - BpmnModel bpmnModel = repositoryService.getBpmnModel(processInstance.getProcessDefinitionId()); - List activeActivityIds = runtimeService.getActiveActivityIds(executionId); - // 不使用spring请使用下面的两行代码 -// ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); -// Context.setProcessEngineConfiguration(defaultProcessEngine.getProcessEngineConfiguration()); - - // 使用spring注入引擎请使用下面的这行代码 - processEngineConfiguration = processEngine.getProcessEngineConfiguration(); - Context.setProcessEngineConfiguration((ProcessEngineConfigurationImpl) processEngineConfiguration); - - ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator(); - InputStream imageStream = diagramGenerator.generateDiagram(bpmnModel, "png", activeActivityIds); - - // 输出资源内容到相应对象 - byte[] b = new byte[1024]; - int len; - while ((len = imageStream.read(b, 0, 1024)) != -1) { - response.getOutputStream().write(b, 0, len); - } - } - - @RequestMapping(value = "/deploy") - public String deploy(@Value("#{APP_PROPERTIES['export.diagram.path']}") String exportDir, @RequestParam(value = "file", required = false) MultipartFile file) { - - String fileName = file.getOriginalFilename(); - - try { - InputStream fileInputStream = file.getInputStream(); - Deployment deployment = null; - - String extension = FilenameUtils.getExtension(fileName); - if (extension.equals("zip") || extension.equals("bar")) { - ZipInputStream zip = new ZipInputStream(fileInputStream); - deployment = repositoryService.createDeployment().addZipInputStream(zip).deploy(); - } else { - deployment = repositoryService.createDeployment().addInputStream(fileName, fileInputStream).deploy(); - } - - List list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list(); - - for (ProcessDefinition processDefinition : list) { - WorkflowUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir); - } - - } catch (Exception e) { - logger.error("error on deploy process, because of file input stream", e); - } - - return "redirect:/workflow/process-list"; - } - - @RequestMapping(value = "/process/convert-to-model/{processDefinitionId}") - public String convertToModel(@PathVariable("processDefinitionId") String processDefinitionId) - throws UnsupportedEncodingException, XMLStreamException { - ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() - .processDefinitionId(processDefinitionId).singleResult(); - InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), - processDefinition.getResourceName()); - XMLInputFactory xif = XMLInputFactory.newInstance(); - InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8"); - XMLStreamReader xtr = xif.createXMLStreamReader(in); - BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr); - - BpmnJsonConverter converter = new BpmnJsonConverter(); - com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bpmnModel); - org.activiti.engine.repository.Model modelData = repositoryService.newModel(); - modelData.setKey(processDefinition.getKey()); - modelData.setName(processDefinition.getResourceName()); - modelData.setCategory(processDefinition.getDeploymentId()); - - ObjectNode modelObjectNode = new ObjectMapper().createObjectNode(); - modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName()); - modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1); - modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription()); - modelData.setMetaInfo(modelObjectNode.toString()); - - repositoryService.saveModel(modelData); - - repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8")); - - return "redirect:/workflow/model/list"; - } - - /** - * 待办任务--Portlet - */ - /* @RequestMapping(value = "/task/todo/list") - @ResponseBody - public List> todoList(HttpSession session) throws Exception { - User user=(User)request.getSession().getAttribute("cu"); - List> result = new ArrayList>(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm"); - - // 已经签收的任务 - List todoList = taskService.createTaskQuery().taskAssignee(user.getId()).active().list(); - for (Task task : todoList) { - String processDefinitionId = task.getProcessDefinitionId(); - ProcessDefinition processDefinition = getProcessDefinition(processDefinitionId); - - Map singleTask = packageTaskInfo(sdf, task, processDefinition); - singleTask.put("status", "todo"); - result.add(singleTask); - } - - // 等待签收的任务 - List toClaimList = taskService.createTaskQuery().taskCandidateUser(user.getId()).active().list(); - for (Task task : toClaimList) { - String processDefinitionId = task.getProcessDefinitionId(); - ProcessDefinition processDefinition = getProcessDefinition(processDefinitionId); - - Map singleTask = packageTaskInfo(sdf, task, processDefinition); - singleTask.put("status", "claim"); - result.add(singleTask); - } - - return result; - }*/ - - private Map packageTaskInfo(SimpleDateFormat sdf, Task task, ProcessDefinition processDefinition) { - Map singleTask = new HashMap(); - singleTask.put("id", task.getId()); - singleTask.put("name", task.getName()); - singleTask.put("createTime", sdf.format(task.getCreateTime())); - singleTask.put("pdname", processDefinition.getName()); - singleTask.put("pdversion", processDefinition.getVersion()); - singleTask.put("pid", task.getProcessInstanceId()); - return singleTask; - } - - private ProcessDefinition getProcessDefinition(String processDefinitionId) { - ProcessDefinition processDefinition = PROCESS_DEFINITION_CACHE.get(processDefinitionId); - if (processDefinition == null) { - processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); - PROCESS_DEFINITION_CACHE.put(processDefinitionId, processDefinition); - } - return processDefinition; - } - - /** - * 挂起、激活流程定义 - */ - @RequestMapping(value = "processdefinition/update.do") - public String updateDefinitionState(HttpServletRequest request,Model model, - @RequestParam(value = "state") String state, - @RequestParam(value = "processDefinitionId") String processDefinitionId) { - int result =0; - if (state.equals("active")) { - repositoryService.activateProcessDefinitionById(processDefinitionId, true, null); - result=1; - } else if (state.equals("suspend")) { - repositoryService.suspendProcessDefinitionById(processDefinitionId, true, null); - result=1; - } - model.addAttribute("result", result); - return "result"; - } - /** - * 挂起、激活流程实例 - */ - @RequestMapping(value = "processinstance/update.do") - public String updateInstanceState(HttpServletRequest request,Model model, - @RequestParam(value = "state") String state, - @RequestParam(value = "processInstanceId") String processInstanceId) { - int result =0; - if (state.equals("active")) { - runtimeService.activateProcessInstanceById(processInstanceId); - result=1; - } else if (state.equals("suspend")) { - runtimeService.suspendProcessInstanceById(processInstanceId); - result=1; - } - model.addAttribute("result", result); - return "result"; - } - /** - * 导出图片文件到硬盘 - * - * @return - */ - @RequestMapping(value = "export/diagrams") - @ResponseBody - public List exportDiagrams(@Value("#{APP_PROPERTIES['export.diagram.path']}") String exportDir) throws IOException { - List files = new ArrayList(); - List list = repositoryService.createProcessDefinitionQuery().list(); - - for (ProcessDefinition processDefinition : list) { - files.add(WorkflowUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir)); - } - - return files; - } - - @RequestMapping(value = "activity/jump") - @ResponseBody - public boolean jump(@RequestParam("executionId") String executionId, - @RequestParam("activityId") String activityId) { - Command cmd = new JumpActivityCmd(executionId, activityId); - managementService.executeCommand(cmd); - return true; - } - - @RequestMapping(value = "bpmn/model/{processDefinitionId}") - @ResponseBody - public BpmnModel queryBpmnModel(@PathVariable("processDefinitionId") String processDefinitionId) { - BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); - return bpmnModel; - } - /*任务节点*/ - protected static UserTask createUserTask(String id, String name, String candidateGroup) { - List candidateGroups=new ArrayList(); - candidateGroups.add(candidateGroup); - UserTask userTask = new UserTask(); - userTask.setName(name); - userTask.setId(id); - userTask.setCandidateGroups(candidateGroups); - return userTask; - } - - /*连线*/ - protected static SequenceFlow createSequenceFlow(String from, String to,String name,String conditionExpression) { - SequenceFlow flow = new SequenceFlow(); - flow.setSourceRef(from); - flow.setTargetRef(to); - flow.setName(name); - if(StringUtils.isNotEmpty(conditionExpression)){ - flow.setConditionExpression(conditionExpression); - } - return flow; - } - - /*排他网关*/ - protected static ExclusiveGateway createExclusiveGateway(String id) { - ExclusiveGateway exclusiveGateway = new ExclusiveGateway(); - exclusiveGateway.setId(id); - return exclusiveGateway; - } - - /*开始节点*/ - protected static StartEvent createStartEvent() { - StartEvent startEvent = new StartEvent(); - startEvent.setId("startEvent"); - return startEvent; - } - - /*结束节点*/ - protected static EndEvent createEndEvent() { - EndEvent endEvent = new EndEvent(); - endEvent.setId("endEvent"); - return endEvent; - } - @Autowired - public void setWorkflowProcessDefinitionService(WorkflowProcessDefinitionService workflowProcessDefinitionService) { - this.workflowProcessDefinitionService = workflowProcessDefinitionService; - } - - @Autowired - public void setRepositoryService(RepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - - @Autowired - public void setRuntimeService(RuntimeService runtimeService) { - this.runtimeService = runtimeService; - } - - @Autowired - public void setTraceService(WorkflowTraceService traceService) { - this.traceService = traceService; - } - - @Autowired - public void setTaskService(TaskService taskService) { - this.taskService = taskService; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/activiti/ModelController.java b/src/com/sipai/controller/activiti/ModelController.java deleted file mode 100644 index 736be1b3..00000000 --- a/src/com/sipai/controller/activiti/ModelController.java +++ /dev/null @@ -1,1051 +0,0 @@ -package com.sipai.controller.activiti; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ModelNodeJob; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TaskModel; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.ProcessModelService; -import com.sipai.service.business.BusinessUnitService; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.activiti.bpmn.converter.BpmnXMLConverter; -import org.activiti.bpmn.model.Process; -import org.activiti.bpmn.model.*; -import org.activiti.editor.constants.ModelDataJsonConstants; -import org.activiti.editor.language.json.converter.BpmnJsonConverter; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.task.Task; -import org.activiti.engine.task.TaskQuery; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.util.CellRangeAddress; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -/** - * 流程模型控制器 - * - * @author henryyan - */ -@Controller -@RequestMapping(value = "/activiti/workflow/model") -public class ModelController { - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - RepositoryService repositoryService; - @Autowired - RuntimeService runtimeService; - @Resource - private ProcessModelService processModelService; - @Resource - private BusinessUnitService businessUnitService; - @Resource - private UnitService unitService; - @Resource - private JobService jobService; - @Resource - protected TaskService taskService; - - @RequestMapping("/showModelList.do") - public String showModelList(HttpServletRequest request,Model model) { - return "/activiti/modelList"; - } - @RequestMapping("/showProcessTechnicsList.do") - public String showProcessTechnicsList(HttpServletRequest request,Model model) { - return "/activiti/processTechnicsList"; - } - /* - * 模型副本 - * */ - @RequestMapping(value = "copycreat.do") - public ModelAndView copycreat(HttpServletRequest request, - HttpServletResponse response,Model model - ) throws IOException { - int result =0; - User cu = (User)request.getSession().getAttribute("cu"); - String modelid = request.getParameter("id"); - org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelid); - ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); - byte[] bpmnBytes = null; - try { - - bpmnBytes=modelNode.toString().getBytes("utf-8"); - } catch (Exception e) { - } - - org.activiti.engine.repository.Model modelData_new = repositoryService.newModel(); - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode modelObjectNode = objectMapper.createObjectNode(); - modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME,modelData.getName()+"(副本)" ); - modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1); - modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, modelData.getName()+"(副本)"); - modelData_new.setMetaInfo(modelObjectNode.toString()); - modelData_new.setName(modelData.getName()+"(副本)"); - modelData_new.setKey(modelData.getKey()); - - repositoryService.saveModel(modelData_new); - repositoryService.addModelEditorSource(modelData_new.getId(),bpmnBytes ); - - result =1; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/doimportExcel.do") - public String doimportTechnics(HttpServletRequest request,Model model){ - return "/activiti/importExcel4Model"; - } - - - @RequestMapping(value = "saveImportModel.do") - public ModelAndView saveImportActiviti(@RequestParam MultipartFile[] file, HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - int result=0; - User cu = (User)request.getSession().getAttribute("cu"); - //要存入的实际地址 - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName,"Temp"); - //String technicsname=""; - List taskModels= new ArrayList<>();//(technicsname,ptList); - - String modelid =processModelService.autoImport(taskModels); - - List unmainProcedure =new ArrayList<>();//存储未匹配预设工序的工序名 - if(modelid!=null && !modelid.isEmpty()){ - try{ - SimpleDateFormat dateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss.SSS", Locale.SIMPLIFIED_CHINESE); - result=1; - }catch(Exception e){ - e.printStackTrace(); - repositoryService.deleteModel(modelid);//管控信息保存失败时,删除模型 - } - - } - String res_str=""; - for (String str : unmainProcedure) { - if(!res_str.isEmpty()){ - res_str+=","; - } - str=str.replace(" ", "").replace("\n", ""); - res_str+=str; - } - model.addAttribute("result","{\"res\":\""+result+"\",\"unmatch\":\""+res_str+"\"}"); - return new ModelAndView("result"); - } - -/* //导入文档最后一个sheet - public String importByExcel(String realPath, MultipartFile[] file,List ptList) throws IOException { - String technicsname=""; - //上传文件的原名(即上传前的文件名字) - String originalFilename = null; - //服务器路径 - String serverPath = null; - for(MultipartFile myfile:file){ - if(myfile.isEmpty()){ - return null; - }else{ - originalFilename = myfile.getOriginalFilename(); - //兼容linux路径 - serverPath = realPath+System.getProperty("file.separator")+CommUtil.getUUID()+originalFilename; - FileUtil.saveFile(myfile.getInputStream(), serverPath); - System.out.println("-->>临时文件上传完成!"); - - FileInputStream is = new FileInputStream(serverPath); - try { - POIFSFileSystem fs = new POIFSFileSystem(is); - HSSFWorkbook wb = new HSSFWorkbook(fs); - HSSFSheet sheet = wb.getSheetAt(wb.getNumberOfSheets()-1); //根据最后一个sheet获取工艺信息 - // 得到总行数 - int rowNum = sheet.getPhysicalNumberOfRows(); - HSSFRow row = sheet.getRow(0); - //以导入时列名长度为需要导入数据的长度,超过部分程序将忽略 - int colNum = row.getPhysicalNumberOfCells(); - // 正文内容应该从第3行开始,第一行为表头的标题 - boolean startflag=false; - - for (int i = 1; i < rowNum; i++) { - //Excel行数据 - row = sheet.getRow(i); - if(!startflag && row.getCell(0)!=null && row.getCell(0).toString().equals(CommString.Flag_Technics_Name)){ - technicsname =getTechnicsName(sheet,i); - } - if(!startflag && row.getCell(0)!=null && row.getCell(0).toString().equals("")){ - startflag=true; - continue; - } - - if(startflag){ - ProcessTechnics newtemp=getTechnicesFromCell(sheet,i); - ptList.add(newtemp); - } - - - } - //导入动作完成后,删除导入文件的临时文件 - FileUtil.deleteFile(serverPath); - System.out.println("<<--临时文件已删除!"); - //关闭流文件 - is.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - return technicsname; - } -*/ //根据导入excel获取工艺名称,即产品编号 - private String getTechnicsName(Sheet sheet ,int row_NO){ - String res=""; - Row row = sheet.getRow(row_NO); - for(int i=0;i getTaskModels(String technicsname,List processTechnics){ - //查询主工序。去重 - List pt4TaskModel =new ArrayList<>(); - ProcessTechnics pt_temp =new ProcessTechnics(); - for (ProcessTechnics old : processTechnics) { - String taskcode = old.getMainprocedurecode(); - if(!taskcode.isEmpty()&& !taskcode.equals(pt_temp.getMainprocedurecode())){ - pt4TaskModel.add(old); - } - pt_temp=old; - } - - List taskModels =new ArrayList<>(); - if(pt4TaskModel.size()>0){ - if(technicsname==null ||technicsname.isEmpty()){ - technicsname="process01"; - } - //添加流程信息和开始节点 - TaskModel processinfo =new TaskModel(); - processinfo.setId(technicsname); - processinfo.setName(technicsname+"工艺"); - taskModels.add(processinfo); - - TaskModel starttask =new TaskModel(); - starttask.setId("startEvent"); - starttask.setTarget_true(pt4TaskModel.get(0).getMainprocedurecode()); - starttask.setType(CommString.TaskType_Start); - taskModels.add(starttask); - - //添加用户任务节点 - int i=0; - for (i=0;i< pt4TaskModel.size()-1;i++) { - ProcessTechnics pt_item =pt4TaskModel.get(i); - String now_taskcode = pt_item.getMainprocedurecode(); - - String next_taskcode = pt4TaskModel.get(i+1).getMainprocedurecode(); - String taskname = pt_item.getMainprocedure(); - TaskModel taskModel=new TaskModel(); - - taskModel.setId(now_taskcode); - taskModel.setName(taskname); - taskModel.setTarget_true(next_taskcode); - //taskModel.setTarget_false(row.getCell(3)==null?null:row.getCell(3).toString()); - taskModel.setType(CommString.TaskType_UserTask); - taskModel.setDocumentation("1");//documentation用于存储良率 ,默认测试为1,(下面还有一处需要修改) - taskModels.add(taskModel); - } - //添加结束节点 - TaskModel taskModel=new TaskModel(); - taskModel.setId(pt4TaskModel.get(i).getMainprocedurecode()); - taskModel.setName(pt4TaskModel.get(i).getMainprocedure()); - taskModel.setTarget_true("endEvent"); - taskModel.setType(CommString.TaskType_UserTask); - taskModel.setDocumentation("1");//documentation用于存储良率 ,默认测试为1 - taskModels.add(taskModel); - - TaskModel endtask =new TaskModel(); - endtask.setId("endEvent"); - endtask.setType(CommString.TaskType_End); - taskModels.add(endtask); - } - return taskModels; - - }*/ - /*private ProcessTechnics getTechnicesFromCell(Sheet sheet ,int row_NO){ - Row row = sheet.getRow(row_NO); - ProcessTechnics processTechnics=new ProcessTechnics(); - processTechnics.setId(CommUtil.getUUID()); - - String mainprocedure=row.getCell(processTechnics.mainprocedure_no)==null?null:row.getCell(processTechnics.mainprocedure_no).toString(); - if(mainprocedure!=null && !mainprocedure.isEmpty()) - processTechnics.setMainprocedure(mainprocedure); - else if(mainprocedure!=null && mainprocedure.isEmpty()){ - mainprocedure=getMergedRegionValue(sheet, row_NO, processTechnics.mainprocedure_no); - processTechnics.setMainprocedure(mainprocedure); - } - //主工序code - processTechnics.setMainprocedurecode(getMainCodeFormProcedure(mainprocedure)); - - String subprocedure =row.getCell(processTechnics.subprocedure_no)==null?null:row.getCell(processTechnics.subprocedure_no).toString(); - if(subprocedure!=null && !subprocedure.isEmpty()) - processTechnics.setSubprocedure(subprocedure); - else if(subprocedure!=null && subprocedure.isEmpty()){ - subprocedure=getMergedRegionValue(sheet, row_NO, processTechnics.subprocedure_no); - processTechnics.setSubprocedure(subprocedure); - } - String contentno =row.getCell(processTechnics.contentno_no)==null?null:row.getCell(processTechnics.contentno_no).toString(); - if(contentno!=null && contentno.isEmpty()){ - contentno=(getMergedRegionValue(sheet, row_NO, processTechnics.contentno_no)); - } - contentno=contentno.toLowerCase().replace("o", "0");//防止编号不为数字 - processTechnics.setContentno(contentno); - - String Subject =row.getCell(processTechnics.subject_no)==null?null:row.getCell(processTechnics.subject_no).toString(); - if(Subject!=null && !Subject.isEmpty()) - processTechnics.setSubject(Subject); - else if(Subject!=null && Subject.isEmpty()) - processTechnics.setSubject(getMergedRegionValue(sheet, row_NO, processTechnics.subject_no)); - - String specifications =row.getCell(processTechnics.specifications_no)==null?null:row.getCell(processTechnics.specifications_no).toString(); - if(specifications!=null && !specifications.isEmpty()) - processTechnics.setSpecifications(specifications); - else if(specifications!=null && specifications.isEmpty()) - processTechnics.setSpecifications(getMergedRegionValue(sheet, row_NO, processTechnics.specifications_no)); - - String mode =row.getCell(processTechnics.mode_no)==null?null:row.getCell(processTechnics.mode_no).toString(); - if(mode!=null && !mode.isEmpty()) - processTechnics.setMode(mode); - else if(mode!=null && mode.isEmpty()) - processTechnics.setMode(getMergedRegionValue(sheet, row_NO, processTechnics.mode_no)); - - String tool =row.getCell(processTechnics.tool_no)==null?null:row.getCell(processTechnics.tool_no).toString(); - if(tool!=null && !tool.isEmpty()) - processTechnics.setTool(tool); - else if(tool!=null && tool.isEmpty()) - processTechnics.setTool(getMergedRegionValue(sheet, row_NO, processTechnics.tool_no)); - - String frequency =row.getCell(processTechnics.frequency_no)==null?null:row.getCell(processTechnics.frequency_no).toString(); - if(frequency!=null && !frequency.isEmpty()) - processTechnics.setFrequency(frequency); - else if(frequency!=null && frequency.isEmpty()) - processTechnics.setFrequency(getMergedRegionValue(sheet, row_NO, processTechnics.frequency_no)); - - String people =row.getCell(processTechnics.people_no)==null?null:row.getCell(processTechnics.people_no).toString(); - if(people!=null && !people.isEmpty()) - processTechnics.setPeople(people); - else if(people!=null && people.isEmpty()) - processTechnics.setPeople(getMergedRegionValue(sheet, row_NO, processTechnics.people_no)); - - String rejects =row.getCell(processTechnics.rejects_no)==null?null:row.getCell(processTechnics.rejects_no).toString(); - if(rejects!=null && !rejects.isEmpty()) - processTechnics.setRejects(rejects); - else if(rejects!=null && rejects.isEmpty()) - processTechnics.setRejects(getMergedRegionValue(sheet, row_NO, processTechnics.rejects_no)); - - String filename =row.getCell(processTechnics.filename_no)==null?null:row.getCell(processTechnics.filename_no).toString(); - if(filename!=null && !filename.isEmpty()) - processTechnics.setFilename(filename); - else if(filename!=null && filename.isEmpty()) - processTechnics.setFilename(getMergedRegionValue(sheet, row_NO, processTechnics.filename_no)); - - String fomname =row.getCell(processTechnics.fomname_no)==null?null:row.getCell(processTechnics.fomname_no).toString(); - if(fomname!=null && !fomname.isEmpty()) - processTechnics.setFormname(fomname); - else if(fomname!=null && fomname.isEmpty()) - processTechnics.setFormname(getMergedRegionValue(sheet, row_NO, processTechnics.fomname_no)); - - String remark =row.getCell(processTechnics.remark_no)==null?null:row.getCell(processTechnics.remark_no).toString(); - if(remark!=null && !remark.isEmpty()) - processTechnics.setRemark(remark); - else if(remark!=null && remark.isEmpty()) - processTechnics.setRemark(getMergedRegionValue(sheet, row_NO, processTechnics.remark_no)); - - - return processTechnics; - - }*/ - /* - * 获取主工序code - * */ - /** - * 获取合并单元格的值 - * @param sheet - * @param row - * @param column - * @return - */ - public String getMergedRegionValue(Sheet sheet ,int row , int column){ - int sheetMergeCount = sheet.getNumMergedRegions(); - - for(int i = 0 ; i < sheetMergeCount ; i++){ - CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if(row >= firstRow && row <= lastRow){ - - if(column >= firstColumn && column <= lastColumn){ - Row fRow = sheet.getRow(firstRow); - Cell fCell = fRow.getCell(firstColumn); - - return getCellValue(fCell) ; - } - } - } - - return null ; - } - /** - * 获取单元格的值 - * @param cell - * @return - */ - public String getCellValue(Cell cell){ - - if(cell == null) { - return ""; - } - - if(cell.getCellType() == CellType.STRING){ - - return cell.getStringCellValue(); - - }else if(cell.getCellType() == CellType.BOOLEAN){ - - return String.valueOf(cell.getBooleanCellValue()); - - }else if(cell.getCellType() == CellType.FORMULA){ - - return cell.getCellFormula() ; - - }else if(cell.getCellType() == CellType.NUMERIC){ - - return String.valueOf(cell.getNumericCellValue()); - - } - - return ""; - } - /* - * 将存在的值赋给目标变量 - * */ - public static void replace(Object source, Object dest) throws Exception { - // 获取属性 - BeanInfo sourceBean = Introspector.getBeanInfo(source.getClass(), java.lang.Object.class); - PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors(); - - BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(), java.lang.Object.class); - PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors(); - - try { - for (int i = 0; i < sourceProperty.length; i++) { - for (int j = 0; j < destProperty.length; j++) { - if (sourceProperty[i].getName().equals(destProperty[j].getName())) { - // 调用source的getter方法和dest的setter方法 - destProperty[j].getWriteMethod().invoke(dest, sourceProperty[i].getReadMethod().invoke(source)); - break; - } - } - } - } catch (Exception e) { - throw new Exception("属性复制失败:" + e.getMessage()); - } - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getModelList.do") - public ModelAndView getModelList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu= (User)request.getSession().getAttribute("cu"); - - int startNum=0; - if(rows==null || rows==0){ - rows = 50; - } - if(page!=null && page>0){ - startNum =(page-1)*rows; - } - String wherestr = " where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and NAME_ like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and KEY_ like '%"+request.getParameter("search_code")+"%' "; - }else{ - if(!cu.getId().equals(CommString.ID_Admin)){ - List companies = unitService.getCompaniesByUserId(cu.getId()); - if(companies!=null && companies.size()>0){ - for(int i=0;i list = repositoryService.createModelQuery().orderByCreateTime().desc().listPage(startNum, rows); - List list = repositoryService.createNativeModelQuery().sql(sql).list(); - /*Iterator it = list.iterator(); - if(!search_name.isEmpty()){ - it = list.iterator(); - while(it.hasNext()){ - org.activiti.engine.repository.Model x = it.next(); - if(!x.getName().toLowerCase().contains(search_name.toLowerCase())){ - it.remove(); - } - } - } - if(!search_code.isEmpty()){ - it = list.iterator(); - while(it.hasNext()){ - org.activiti.engine.repository.Model x = it.next(); - if(!x.getKey().toLowerCase().contains(search_code.toLowerCase())){ - it.remove(); - } - } - }*/ - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - - return new ModelAndView("result"); - - - -// page.setTotalCount(processDefinitionQuery.count()); -// page.setResult(objects); -// mav.addObject("page", page); -// -// return mav; - } - /** - * 流程定义列表 - * - * @return - */ - @RequestMapping(value = "/getModelAll.do") - public ModelAndView getModelAll(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String userId = cu.getId(); - String wherestr = " where 1=1 "; - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - wherestr += " and KEY_ like '%"+request.getParameter("bizid")+"%' "; - } - String sql = "select * from [ACT_RE_MODEL]"+wherestr; - List list = repositoryService.createNativeModelQuery().sql(sql).list(); - JSONArray json=JSONArray.fromObject(list); - JSONArray rows = new JSONArray(); - if(json!=null && json.size()>0){ - for(int i=0;i taskList = taskQuery.list(); - int taskNum = taskList.size(); - job.put("taskNum",taskNum); - rows.add(job); - } - } - String result="{\"total\":"+list.size()+",\"rows\":"+rows+"}"; - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - @RequestMapping("/addModel.do") - public String addModel(HttpServletRequest request,Model model) { - Company company = this.unitService.getCompById(request.getParameter("companyId")); - request.setAttribute("company", company); - return "/activiti/modelAdd"; - } - @RequestMapping("/editModel.do") - public String editModel(HttpServletRequest request,Model model) { - String modelId = request.getParameter("modelid"); - org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId); - model.addAttribute("model", modelData); - String metainfo = modelData.getMetaInfo(); - JSONObject modelObjectNode = JSONObject.fromObject(metainfo) ; - String description = modelObjectNode.getString(ModelDataJsonConstants.MODEL_DESCRIPTION); - String[] str =modelData.getKey().split("-"); - model.addAttribute("processTypeId", str[0]); - String companyId = str[1]; - Company company = this.unitService.getCompById(companyId); - request.setAttribute("company", company); - model.addAttribute("description", description); - if (str.length>2) { - String maintenanceType = str[2]; - model.addAttribute("maintenanceType", maintenanceType); - } - return "/activiti/modelEdit"; - } - /** - * 编辑流程图 - * @author wuping - * @return - */ - @RequestMapping("/editFlow.do") - public String editFlow(HttpServletRequest request,Model model) { - return "/activiti/modelFlowEdit"; - } - - /** - * 编辑流程节点添加业务 - * @author wuping - * @return - */ - @RequestMapping("/editNode.do") - public String editNode(HttpServletRequest request,Model model) { - //String prString= request.getParameter("processTypeId"); - String modelid = request.getParameter("modelid"); - int index=0; - String resourceId = request.getParameter("resourceId"); - String bizId = request.getParameter("bizId"); - Company company = this.unitService.getCompById(bizId); - request.setAttribute("company", company); - ObjectNode modelNode; - Object name = ""; - Object nodetype = ""; - Object businessid = ""; - try { - modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelid)); - for(int i=0;i0){ - for(int i=0;i list = this.jobService.selectModelNodeJobListByWhere(" where resource_id='"+resourceId+"' and model_id ='"+modelData.getId()+"' "); - String jobNames=""; - String jobIds = ""; - if(list != null && list.size()>0){ - for(int j=0;j JsonNode - JsonNode editorNode = mapper.readTree(modelobject.toString()); - //会签任务 - if (countersign) { - // 转换成BpmnModel - bpmnJsonConverter = new BpmnJsonConverter(); - bpmnModel = bpmnJsonConverter.convertToBpmnModel(editorNode); - // 获取物理形态的流程 - Process process = bpmnModel.getProcesses().get(0); - // 获取节点信息 - ArrayList flowElementList = new ArrayList<>(process.getFlowElements()); - FlowElement flowElement = flowElementList.get(Integer.parseInt(index)); - // 只有人工任务才可以设置会签节点 - UserTask userTask = (UserTask) flowElement; - // 获取多实例配置 - MultiInstanceLoopCharacteristics characteristics = new MultiInstanceLoopCharacteristics(); - // 设置集合变量 - characteristics.setInputDataItem(CommString.ACT_COUNTERSIGN_LIST); - //设置集合变量名称 - characteristics.setElementVariable(CommString.ACT_COUNTERSIGN_VAR); - // 设置为同时接收(false 表示不按顺序执行) - characteristics.setSequential(false); - // 设置条件(全部会签完转下步) - characteristics.setCompletionCondition("${nrOfCompletedInstances/nrOfInstances>=1}"); - - userTask.setLoopCharacteristics(characteristics); - //保存 - editorNode = new BpmnJsonConverter().convertToJson(bpmnModel); - } - repositoryService.addModelEditorSource(modelid, editorNode.toString().getBytes("utf-8")); - result = modelid; - - } catch (Exception e) { - logger.error("创建模型失败:", e); - } - model.addAttribute("result",result ); - return "result"; - } - - /** - * 根据Model部署流程 - */ - @RequestMapping(value = "deploy", method = RequestMethod.POST) - public String deploy(HttpServletRequest request,Model model, - @RequestParam(value ="modelId") String modelId) { - /*String result=processModelService.deploy(modelId); - model.addAttribute("result",result); - return "result";*/ - - - String result=""; - JsonNode modelNode; - JSONObject modelobject; - JSONArray childShapes; - try { - modelNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelId)); - modelobject = JSONObject.fromObject(new ObjectMapper().writeValueAsString(modelNode)); - if(modelobject.get("childShapes")!=null){ - childShapes= modelobject.getJSONArray("childShapes"); - for(int i=0;i0){ - properties.put("conditionsequenceflow", "${pass && route=="+num+"}"); - }else{ - properties.put("conditionsequenceflow", "${pass}"); - } - } - if(properties.get("name").toString().startsWith("不通过")){ - if(num>0){ - properties.put("conditionsequenceflow", "${!pass && route=="+num+"}"); - }else{ - properties.put("conditionsequenceflow", "${!pass}"); - } - } - } - } - }else{ - model.addAttribute("result","{\"res\":\"0\",\"restr\":\"部署失败,请编辑流程图!\"}" ); - return "result"; - } - - - ObjectMapper mapper = new ObjectMapper(); - //JSON ----> JsonNode - JsonNode editorNode = mapper.readTree(modelobject.toString()); - repositoryService.addModelEditorSource(modelId, editorNode.toString().getBytes("utf-8")); - result=processModelService.deploy(modelId); - model.addAttribute("result",result ); - return "result"; - } catch (Exception e) { - logger.error("创建模型失败:", e); - model.addAttribute("result","{\"res\":\"0\",\"restr\":\"部署失败!\"}" ); - return "result"; - } - - } - - /** - * 导出model的xml文件 - */ - @RequestMapping(value = "export/{modelId}") - public void export(@PathVariable("modelId") String modelId, HttpServletResponse response) { - try { - org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId); - BpmnJsonConverter jsonConverter = new BpmnJsonConverter(); - JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); - BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode); - BpmnXMLConverter xmlConverter = new BpmnXMLConverter(); - byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel); - - ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes); - IOUtils.copy(in, response.getOutputStream()); - String filename = bpmnModel.getMainProcess().getId() + ".bpmn20.xml"; - response.setHeader("Content-Disposition", "attachment; filename=" + filename); - response.flushBuffer(); - } catch (Exception e) { - logger.error("导出model的xml文件失败:modelId={}", modelId, e); - } - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - repositoryService.deleteModel(id); - model.addAttribute("result", 1); - return "result"; - } - - - -} diff --git a/src/com/sipai/controller/activiti/OEProcessController.java b/src/com/sipai/controller/activiti/OEProcessController.java deleted file mode 100644 index 632975a9..00000000 --- a/src/com/sipai/controller/activiti/OEProcessController.java +++ /dev/null @@ -1,353 +0,0 @@ -package com.sipai.controller.activiti; - -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.equipment.EquipmentAcceptanceApply; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.EquipmentSaleApply; -import com.sipai.entity.equipment.EquipmentScrapApply; -import com.sipai.entity.equipment.EquipmentStopRecord; -import com.sipai.entity.equipment.EquipmentTransfersApply; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.StockCheck; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserDetail; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.LoginService; -import com.sipai.service.equipment.EquipmentAcceptanceApplyService; -import com.sipai.service.equipment.EquipmentLoseApplyService; -import com.sipai.service.equipment.EquipmentSaleApplyService; -import com.sipai.service.equipment.EquipmentScrapApplyService; -import com.sipai.service.equipment.EquipmentStopRecordService; -import com.sipai.service.equipment.EquipmentTransfersApplyService; -import com.sipai.service.equipment.MaintenancePlanService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.sparepart.InStockRecordService; -import com.sipai.service.sparepart.OutStockRecordService; -import com.sipai.service.sparepart.StockCheckService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.service.process.ProcessAdjustmentService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/oeProcess") -public class OEProcessController { - - @Resource - private WorkflowService workflowService; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - - @Resource - private MaintenanceService maintenanceService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private SubscribeService subscribeService; - @Resource - private ContractService contractService; - @Resource - private ProcessAdjustmentService processAdjustmentService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private StockCheckService stockCheckService; - @Resource - private EquipmentLoseApplyService equipmentLoseApplyService; - @Resource - private EquipmentScrapApplyService equipmentScrapApplyService; - @Resource - private EquipmentSaleApplyService equipmentSaleApplyService; - @Resource - private EquipmentTransfersApplyService equipmentTransfersApplyService; - @Resource - private EquipmentAcceptanceApplyService equipmentAcceptanceApplyService; - - @Resource - private EquipmentStopRecordService equipmentStopRecordService; - @Resource - private LoginService loginService; - @Resource - private UserDetailService userDetailService; - - @RequestMapping("/nameLogin.do") - public ModelAndView nameLogin(HttpServletRequest request, - HttpServletResponse response,Model model) { - - String username=request.getParameter("username"); - if(null==username || "".equals(username)){ - return new ModelAndView("login"); - } - - List userList=userService.selectListByWhere(" where name='"+username+"'"); - if(userList.size() >0 && null!=userList){ - String userId = userList.get(0).getId(); - User cu = userList.get(0); - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - if(cu.getThemeclass()==null || cu.getThemeclass().isEmpty()){ - cu.setThemeclass(CommString.Default_Theme); - } - Company company =unitService.getCompanyByUserId(cu.getId()); - String unitId = ""; - if (company!=null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - }else{ - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if(companies!=null){ - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - //设置session - HttpSession newSession = request.getSession(true); - ((HttpServletRequest) request).getSession().setAttribute( - "cu", cu); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - request.setAttribute("unitId", unitId); - model.addAttribute("cu", cu); - return new ModelAndView("frameset"); - }else{ - return new ModelAndView("login"); - } - - } - - @RequestMapping("/taskList.do") - public String taskList(HttpServletRequest request,Model model){ - - String username=request.getParameter("username"); - String password=request.getParameter("password"); - - if(null==username || "".equals(username)){ - return "redirect:http://192.168.2.10:5001/SIPAIIS_WMS/"; - } - if(null==password || "".equals(password)){ - return "redirect:http://192.168.2.10:5001/SIPAIIS_WMS/"; - } - - List userList=userService.selectListByWhere(" where name='"+username+"' and password='"+password+"'"); - if(userList.size() >0 && null!=userList){ - String userId = userList.get(0).getId(); - model.addAttribute("userId", userId); - User cu = new User(); - cu = userList.get(0); - //设置cu其他信息 - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - //return "/activiti/taskList"; - return "/activiti/oeProcessTaskList"; - }else{ - return "redirect:http://192.168.2.10:5001/SIPAIIS_WMS/"; - - } - - } - - /** - * 获取生产总流程任务列表 - * - * @param - */ - @RequestMapping(value = "getTaskList.do") - public ModelAndView getTaskList(HttpServletRequest request,Model model) { - //User cu=(User)request.getSession().getAttribute("cu"); - //String userId = cu.getId(); - String userId=request.getParameter("userId"); - Map map=null; - - /* Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request);*/ - //筛选附件条件,用与variable筛选 - List list=workflowService.findTodoTasks(userId,null,map); - for (TodoTask todoTask : list) { - try { - String businessKey = todoTask.getVariables().get("businessKey").toString(); - Maintenance maintenance=null; - if(todoTask.getType().contains(ProcessType.S_Maintenance.getId())){ - //系统默认主流程 - maintenance= this.maintenanceService.selectById(businessKey); - todoTask.setBusiness(maintenance); - }else if (todoTask.getType().contains(ProcessType.B_Purchase.getId())) { - Subscribe subscribe = this.subscribeService.selectById(businessKey); - if(subscribe!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(subscribe.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资申购审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.B_Contract.getId())) { - Contract contract = this.contractService.selectById(businessKey); - if(contract!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(contract.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("采购合同审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if(todoTask.getType().contains(ProcessType.Process_Adjustment.getId())){ - ProcessAdjustment processAdjustment = this.processAdjustmentService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(processAdjustment.getUnitId()); - maintenance.setCompany(company); - //将问题详情内容复制到中间变量 - maintenance.setProblem(processAdjustment.getContents()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.B_Maintenance.getId())){ - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(businessKey); - if (null!=maintenanceDetail.getMaintenanceid() && !maintenanceDetail.getMaintenanceid().isEmpty()) { - maintenance= this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - }else{ - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenanceDetail.getCompanyid()); - maintenance.setCompany(company); - } - //将问题详情内容复制到中间变量 - maintenance.setProblem(maintenanceDetail.getProblemcontent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.I_Stock.getId())){ - InStockRecord inStockRecord = this.inStockRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(inStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资入库审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.O_Stock.getId())){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(outStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资领用审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Stock_Check.getId())){ - StockCheck stockCheck = this.stockCheckService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(stockCheck.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("库存盘点审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintain_Plan.getId())){ - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenancePlan.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem(maintenancePlan.getContent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Lose_Apply.getId())){ - EquipmentLoseApply loseApply = this.equipmentLoseApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(loseApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备丢失申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Sale_Apply.getId())){ - EquipmentSaleApply saleApply = this.equipmentSaleApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(saleApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备出售申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Scrap_Apply.getId())){ - EquipmentScrapApply scrapApply = this.equipmentScrapApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(scrapApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备报废申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Transfers_Apply.getId())){ - EquipmentTransfersApply transfersApply = this.equipmentTransfersApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(transfersApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备调拨申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Acceptance_Apply.getId())){ - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(eaa.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备验收申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.EquipmentStop_Apply.getId())){ - EquipmentStopRecord esr = equipmentStopRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备停用申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - } - JSONArray json= this.workflowService.todoTasklistToJsonArray(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/administration/IndexClassController.java b/src/com/sipai/controller/administration/IndexClassController.java deleted file mode 100644 index 4ec8cadc..00000000 --- a/src/com/sipai/controller/administration/IndexClassController.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.controller.administration; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.administration.IndexClass; -import com.sipai.entity.administration.IndexClass; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.administration.IndexClassService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/indexClass") -public class IndexClassController { - @Resource - private IndexClassService indexClassService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/indexClassList"; - } - - @RequestMapping("/getIndexClassJson.do") - public String getIndexClassJson(HttpServletRequest request,Model model){ - List list = this.indexClassService.selectListByWhere("where 1=1 order by morder"); - String json = this.indexClassService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.indexClassService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "administration/indexClass4select"; - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - IndexClass indexClass= this.indexClassService.selectById(pid); - model.addAttribute("pname",indexClass.getName()); - } - return "/administration/indexClassAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute IndexClass indexClass) { - User cu = (User) request.getSession().getAttribute("cu"); - indexClass.setId(CommUtil.getUUID()); - indexClass.setInsdt(CommUtil.nowDate()); - indexClass.setInsuser(cu.getId()); - int result = this.indexClassService.save(indexClass); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.indexClassService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.indexClassService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - IndexClass indexClass = this.indexClassService.selectById(id); - model.addAttribute("indexClass", indexClass); - return "/administration/indexClassEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute IndexClass indexClass) { - User cu = (User) request.getSession().getAttribute("cu"); - indexClass.setInsdt(CommUtil.nowDate()); - indexClass.setInsuser(cu.getId()); - int result = this.indexClassService.update(indexClass); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - IndexClass indexClass = this.indexClassService.selectById(id); - model.addAttribute("indexClass", indexClass); - return "/administration/indexClassView"; - } - /** - * 获取合同类型 - * */ - @RequestMapping("/getIndexClass4Select.do") - public String getIndexClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.indexClassService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (IndexClass indexClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", indexClass.getId()); - jsonObject.put("text", indexClass.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/administration/IndexController.java b/src/com/sipai/controller/administration/IndexController.java deleted file mode 100644 index 0edd74c3..00000000 --- a/src/com/sipai/controller/administration/IndexController.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.sipai.controller.administration; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.geom.Cubic; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.administration.Index; -import com.sipai.entity.administration.IndexCycle; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.administration.IndexCycleService; -import com.sipai.service.administration.IndexService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/index") -public class IndexController { - @Resource - private IndexService indexService; - - @Resource - private IndexCycleService indexCycleService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/indexList"; - } - @RequestMapping("/getIndexJson.do") - public String getIndexJson(HttpServletRequest request,Model model){ - List list = this.indexService.selectListByWhere("where 1=1 order by morder"); - String json = this.indexService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.indexService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - Index index= this.indexService.selectById(pid); - model.addAttribute("pname",index.getName()); - } - return "/administration/indexAdd"; - } - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute Index index) { - User cu = (User) request.getSession().getAttribute("cu"); - index.setId(CommUtil.getUUID()); - index.setInsdt(CommUtil.nowDate()); - index.setInsuser(cu.getId()); - int result = this.indexService.save(index); - if(result==1){ - //生成1-12月的附表数据 - BigDecimal money = new BigDecimal(0); - IndexCycle indexCycle=null; - for(int i=1;i<13;i++){ - indexCycle = new IndexCycle(); - indexCycle.setId(CommUtil.getUUID()); - indexCycle.setInsdt(CommUtil.nowDate()); - indexCycle.setInsuser(cu.getId()); - indexCycle.setPid(index.getId()); - indexCycle.setName(i+"月"); - indexCycle.setMorder(i); - indexCycle.setActive("启用"); - indexCycle.setMoney(money); - indexCycleService.save(indexCycle); - } - - } - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+index.getId()+"\"}"; - model.addAttribute("result",resultstr); - return new ModelAndView("result"); - } - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "administration/index4select"; - } - @RequestMapping("/delete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.indexService.deleteById(id); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.indexService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Index index = this.indexService.selectById(id); - model.addAttribute("index", index); - return "/administration/indexEdit"; - } - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute Index index) { - User cu = (User) request.getSession().getAttribute("cu"); - index.setInsdt(CommUtil.nowDate()); - index.setInsuser(cu.getId()); - int result = this.indexService.update(index); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Index index = this.indexService.selectById(id); - model.addAttribute("index", index); - return "/administration/indexView"; - } - - /** - * 明细修改后更新金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateIndexCycle.do") - public String doupdateIndexCycle(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String money = request.getParameter("money");//价格 - IndexCycle indexCycle = this.indexCycleService.selectById(id); - if(null != money && !money.equals("")){ - BigDecimal moneyBD = new BigDecimal(money); - indexCycle.setMoney(moneyBD); - } - int result = this.indexCycleService.update(indexCycle); - String resstr="{\"res\":\""+result+"\",\"id\":\""+indexCycle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/administration/IndexCycleController.java b/src/com/sipai/controller/administration/IndexCycleController.java deleted file mode 100644 index fd20eca1..00000000 --- a/src/com/sipai/controller/administration/IndexCycleController.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.sipai.controller.administration; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.administration.IndexCycle; -import com.sipai.entity.administration.IndexCycle; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.administration.IndexCycleService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/indexCycle") -public class IndexCycleController { - @Resource - private IndexCycleService indexCycleService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/indexCycleList"; - } - - @RequestMapping("/getIndexCycleJson.do") - public String getIndexCycleJson(HttpServletRequest request,Model model){ - - String wherestr=""; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '"+request.getParameter("pid")+"'"; - } - - List list = this.indexCycleService.selectListByWhere("where 1=1 "+wherestr+" order by morder"); - String json = this.indexCycleService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '"+request.getParameter("pid")+"'"; - } - - PageHelper.startPage(page, rows); - List list = this.indexCycleService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "administration/indexCycle4select"; - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - IndexCycle indexCycle= this.indexCycleService.selectById(pid); - model.addAttribute("pname",indexCycle.getName()); - } - return "/administration/indexCycleAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute IndexCycle indexCycle) { - User cu = (User) request.getSession().getAttribute("cu"); - indexCycle.setId(CommUtil.getUUID()); - indexCycle.setInsdt(CommUtil.nowDate()); - indexCycle.setInsuser(cu.getId()); - int result = this.indexCycleService.save(indexCycle); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.indexCycleService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.indexCycleService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - IndexCycle indexCycle = this.indexCycleService.selectById(id); - model.addAttribute("indexCycle", indexCycle); - return "/administration/indexCycleEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute IndexCycle indexCycle) { - User cu = (User) request.getSession().getAttribute("cu"); - indexCycle.setInsdt(CommUtil.nowDate()); - indexCycle.setInsuser(cu.getId()); - int result = this.indexCycleService.update(indexCycle); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - IndexCycle indexCycle = this.indexCycleService.selectById(id); - model.addAttribute("indexCycle", indexCycle); - return "/administration/indexCycleView"; - } - /** - * 获取合同类型 - * */ - @RequestMapping("/getIndexCycle4Select.do") - public String getIndexCycle4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String wherestr=""; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '"+request.getParameter("pid")+"'"; - } - JSONArray json=new JSONArray(); - List list = this.indexCycleService.selectListByWhere("where 1=1 "+wherestr+" order by morder"); - if(list!=null && list.size()>0){ - for (IndexCycle indexCycle : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", indexCycle.getId()); - jsonObject.put("text", indexCycle.getName()+"("+indexCycle.getMoney().setScale(2, BigDecimal.ROUND_HALF_UP )+")"); - jsonObject.put("money", indexCycle.getMoney().setScale(2, BigDecimal.ROUND_HALF_UP )); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/administration/IndexWorkController.java b/src/com/sipai/controller/administration/IndexWorkController.java deleted file mode 100644 index 48bd8fca..00000000 --- a/src/com/sipai/controller/administration/IndexWorkController.java +++ /dev/null @@ -1,429 +0,0 @@ -package com.sipai.controller.administration; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.administration.IndexWork; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.administration.IndexWorkService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/indexWork") -public class IndexWorkController { - @Resource - private IndexWorkService indexWorkService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/indexWorkList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.indexWorkService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-ZBKZ-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/administration/indexWorkAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute IndexWork indexWork) { - User cu = (User) request.getSession().getAttribute("cu"); - indexWork.setInsdt(CommUtil.nowDate()); - indexWork.setInsuser(cu.getId()); - int result = this.indexWorkService.save(indexWork); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+indexWork.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.indexWorkService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.indexWorkService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - IndexWork indexWork = this.indexWorkService.selectById(id); - model.addAttribute("indexWork", indexWork); - return "/administration/indexWorkEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute IndexWork indexWork) { - User cu = (User) request.getSession().getAttribute("cu"); - indexWork.setInsdt(CommUtil.nowDate()); - indexWork.setInsuser(cu.getId()); - int result = this.indexWorkService.update(indexWork); - String resstr="{\"res\":\""+result+"\",\"id\":\""+indexWork.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - IndexWork indexWork = this.indexWorkService.selectById(id); - model.addAttribute("indexWork", indexWork); - return "/administration/indexWorkView"; - } - /** - * 更新,启动指标审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute IndexWork indexWork){ - User cu= (User)request.getSession().getAttribute("cu"); - indexWork.setInsuser(cu.getId()); - indexWork.setInsdt(CommUtil.nowDate()); - indexWorkService.update(indexWork); - indexWork = indexWorkService.selectById(indexWork.getId()); - int result=0; - try { - result =this.indexWorkService.startProcess(indexWork); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+indexWork.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看指标处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessIndexWorkView.do") - public String showProcessIndexWorkView(HttpServletRequest request,Model model){ - String indexWorkId = request.getParameter("id"); - IndexWork indexWork = this.indexWorkService.selectById(indexWorkId); - request.setAttribute("business", indexWork); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(indexWork); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(indexWork.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_IndexWork_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+indexWorkId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_IndexWork_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+indexWorkId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = indexWork.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(indexWork.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "administration/indexWorkExecuteViewInModal"; - }else{ - return "administration/indexWorkExecuteView"; - } - } - /** - * 显示指标审核 - * */ - @RequestMapping("/showAuditIndexWork.do") - public String showAuditIndexWork(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String indexWorkId= pInstance.getBusinessKey(); - IndexWork indexWork = this.indexWorkService.selectById(indexWorkId); - model.addAttribute("indexWork", indexWork); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "administration/indexWorkAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/AuditIndexWork.do") - public String doAuditIndexWork(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.indexWorkService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示指标业务处理 - * */ - @RequestMapping("/showIndexWorkHandle.do") - public String showIndexWorkHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String indexWorkId = pInstance.getBusinessKey(); - IndexWork indexWork = this.indexWorkService.selectById(indexWorkId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+indexWorkId+"' order by insdt desc "); - if(list!=null && list.size()>0){ - model.addAttribute("businessUnitAudit", list.get(0)); - } - model.addAttribute("indexWork", indexWork); - return "administration/indexWorkHandle"; - } - /** - * 流程流程,指标业务处理提交 - * */ - @RequestMapping("/submitIndexWorkHandle.do") - public String dosubmitIndexWorkHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.indexWorkService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/administration/OrganizationClassController.java b/src/com/sipai/controller/administration/OrganizationClassController.java deleted file mode 100644 index e434475a..00000000 --- a/src/com/sipai/controller/administration/OrganizationClassController.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.controller.administration; - -import static org.hamcrest.CoreMatchers.nullValue; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.administration.OrganizationClass; -import com.sipai.entity.administration.OrganizationClass; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.administration.OrganizationClassService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/organizationClass") -public class OrganizationClassController { - @Resource - private OrganizationClassService organizationClassService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/organizationClassList"; - } - - @RequestMapping("/getOrganizationClassJson.do") - public String getOrganizationClassJson(HttpServletRequest request,Model model){ - List list = this.organizationClassService.selectListByWhere("where 1=1 order by morder"); - String json = this.organizationClassService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.organizationClassService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "administration/organizationClass4select"; - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - OrganizationClass organizationClass= this.organizationClassService.selectById(pid); - if(organizationClass!=null){ - model.addAttribute("pname",organizationClass.getName()); - }else{ - - } - } - return "/administration/organizationClassAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute OrganizationClass organizationClass) { - User cu = (User) request.getSession().getAttribute("cu"); - organizationClass.setId(CommUtil.getUUID()); - organizationClass.setInsdt(CommUtil.nowDate()); - organizationClass.setInsuser(cu.getId()); - int result = this.organizationClassService.save(organizationClass); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.organizationClassService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.organizationClassService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - OrganizationClass organizationClass = this.organizationClassService.selectById(id); - model.addAttribute("organizationClass", organizationClass); - return "/administration/organizationClassEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute OrganizationClass organizationClass) { - User cu = (User) request.getSession().getAttribute("cu"); - organizationClass.setInsdt(CommUtil.nowDate()); - organizationClass.setInsuser(cu.getId()); - int result = this.organizationClassService.update(organizationClass); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OrganizationClass organizationClass = this.organizationClassService.selectById(id); - model.addAttribute("organizationClass", organizationClass); - return "/administration/organizationClassView"; - } - /** - * 获取合同类型 - * */ - @RequestMapping("/getOrganizationClass4Select.do") - public String getOrganizationClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.organizationClassService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (OrganizationClass organizationClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", organizationClass.getId()); - jsonObject.put("text", organizationClass.getName()); - jsonObject.put("code", organizationClass.getCode()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/administration/OrganizationController.java b/src/com/sipai/controller/administration/OrganizationController.java deleted file mode 100644 index b3a3f67b..00000000 --- a/src/com/sipai/controller/administration/OrganizationController.java +++ /dev/null @@ -1,457 +0,0 @@ -package com.sipai.controller.administration; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.administration.OrganizationCommStr; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.administration.OrganizationService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/organization") -public class OrganizationController { - @Resource - private OrganizationService organizationService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/organizationList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("typeid")!= null && !request.getParameter("typeid").isEmpty()) { - wherestr += " and typeid = '"+request.getParameter("typeid")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.organizationService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-ZZYA-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/administration/organizationAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Organization organization) { - User cu = (User) request.getSession().getAttribute("cu"); - organization.setInsdt(CommUtil.nowDate()); - organization.setInsuser(cu.getId()); - int result = this.organizationService.save(organization); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+organization.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.organizationService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.organizationService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Organization organization = this.organizationService.selectById(id); - model.addAttribute("organization", organization); - return "/administration/organizationEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Organization organization) { - User cu = (User) request.getSession().getAttribute("cu"); - organization.setInsdt(CommUtil.nowDate()); - organization.setInsuser(cu.getId()); - int result = this.organizationService.update(organization); - String resstr="{\"res\":\""+result+"\",\"id\":\""+organization.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Organization organization = this.organizationService.selectById(id); - model.addAttribute("organization", organization); - return "/administration/organizationView"; - } - /** - * 更新,启动指标审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute Organization organization){ - User cu= (User)request.getSession().getAttribute("cu"); - organization.setInsuser(cu.getId()); - organization.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.organizationService.startProcess(organization); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+organization.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看指标处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessOrganizationView.do") - public String showProcessOrganizationView(HttpServletRequest request,Model model){ - String organizationId = request.getParameter("id"); - Organization organization = this.organizationService.selectById(organizationId); - request.setAttribute("business", organization); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(organization); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(organization.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - - String type=organization.getTypeid(); - if (OrganizationCommStr.Administration_Type_Organization.equals(type)) { - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_Organization_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+organizationId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Organization_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+organizationId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - }else if(OrganizationCommStr.Administration_Type_Reserve.equals(type)) { - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_Reserve_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+organizationId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Reserve_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+organizationId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - } - //展示最新任务是否签收 - String processId = organization.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(organization.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "administration/organizationExecuteViewInModal"; - }else{ - return "administration/organizationExecuteView"; - } - } - /** - * 显示指标审核 - * */ - @RequestMapping("/showAuditOrganization.do") - public String showAuditOrganization(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String organizationId= pInstance.getBusinessKey(); - Organization organization = this.organizationService.selectById(organizationId); - model.addAttribute("organization", organization); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "administration/organizationAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/AuditOrganization.do") - public String doAuditOrganization(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.organizationService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示指标业务处理 - * */ - @RequestMapping("/showOrganizationHandle.do") - public String showOrganizationHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String organizationId = pInstance.getBusinessKey(); - Organization organization = this.organizationService.selectById(organizationId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+organizationId+"' order by insdt desc "); - - if(list!=null && list.size()>0){ - model.addAttribute("businessUnitAudit", list.get(0)); - } - model.addAttribute("organization", organization); - return "administration/organizationHandle"; - } - /** - * 流程流程,指标业务处理提交 - * */ - @RequestMapping("/submitOrganizationHandle.do") - public String dosubmitOrganizationHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.organizationService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/administration/TemporaryController.java b/src/com/sipai/controller/administration/TemporaryController.java deleted file mode 100644 index e294d68f..00000000 --- a/src/com/sipai/controller/administration/TemporaryController.java +++ /dev/null @@ -1,429 +0,0 @@ -package com.sipai.controller.administration; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.administration.Temporary; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.administration.TemporaryService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/administration/temporary") -public class TemporaryController { - @Resource - private TemporaryService temporaryService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/administration/temporaryList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("search_code")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.temporaryService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-ZZYA-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/administration/temporaryAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Temporary temporary) { - User cu = (User) request.getSession().getAttribute("cu"); - temporary.setInsdt(CommUtil.nowDate()); - temporary.setInsuser(cu.getId()); - int result = this.temporaryService.save(temporary); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+temporary.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.temporaryService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.temporaryService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Temporary temporary = this.temporaryService.selectById(id); - model.addAttribute("temporary", temporary); - return "/administration/temporaryEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Temporary temporary) { - User cu = (User) request.getSession().getAttribute("cu"); - temporary.setInsdt(CommUtil.nowDate()); - temporary.setInsuser(cu.getId()); - int result = this.temporaryService.update(temporary); - String resstr="{\"res\":\""+result+"\",\"id\":\""+temporary.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Temporary temporary = this.temporaryService.selectById(id); - model.addAttribute("temporary", temporary); - return "/administration/temporaryView"; - } - /** - * 更新,启动指标审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute Temporary temporary){ - User cu= (User)request.getSession().getAttribute("cu"); - temporary.setInsuser(cu.getId()); - temporary.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.temporaryService.startProcess(temporary); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+temporary.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看指标处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessTemporaryView.do") - public String showProcessTemporaryView(HttpServletRequest request,Model model){ - String temporaryId = request.getParameter("id"); - Temporary temporary = this.temporaryService.selectById(temporaryId); - request.setAttribute("business", temporary); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(temporary); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(temporary.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_Temporary_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+temporaryId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Temporary_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+temporaryId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = temporary.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(temporary.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "administration/temporaryExecuteViewInModal"; - }else{ - return "administration/temporaryExecuteView"; - } - } - /** - * 显示指标审核 - * */ - @RequestMapping("/showAuditTemporary.do") - public String showAuditTemporary(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String temporaryId= pInstance.getBusinessKey(); - Temporary temporary = this.temporaryService.selectById(temporaryId); - model.addAttribute("temporary", temporary); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "administration/temporaryAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/AuditTemporary.do") - public String doAuditTemporary(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.temporaryService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示指标业务处理 - * */ - @RequestMapping("/showTemporaryHandle.do") - public String showTemporaryHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String temporaryId = pInstance.getBusinessKey(); - Temporary temporary = this.temporaryService.selectById(temporaryId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+temporaryId+"' order by insdt desc "); - - if(list!=null && list.size()>0){ - model.addAttribute("businessUnitAudit", list.get(0)); - } - model.addAttribute("temporary", temporary); - return "administration/temporaryHandle"; - } - /** - * 流程流程,指标业务处理提交 - * */ - @RequestMapping("/submitTemporaryHandle.do") - public String dosubmitTemporaryHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.temporaryService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/alarm/AlarmConditionController.java b/src/com/sipai/controller/alarm/AlarmConditionController.java deleted file mode 100644 index eb5cbe36..00000000 --- a/src/com/sipai/controller/alarm/AlarmConditionController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmCondition; -import com.sipai.service.alarm.AlarmConditionService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmCondition") -public class AlarmConditionController { - @Resource - private AlarmConditionService alarmConditionService; - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - if(request.getParameter("alarmtypeid") != null && - request.getParameter("alarmtypeid").trim().length()>0){ - wherestr += " and alarmtypeid = '"+request.getParameter("alarmtypeid")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.alarmConditionService.selectListByWhere - (wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/showAdd.do") - public String showAdd(HttpServletRequest request,Model model, - @RequestParam(value = "alarmtypeid") String alarmtypeid){ - model.addAttribute("alarmtypeid", alarmtypeid); - return "alarm/alarmConditionAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model){ - List list = this.alarmConditionService. - selectListByWhere("where mpointid = '"+request.getParameter("mpointid")+"' " - + "order by id"); - if(list != null && list.size()>0){ - model.addAttribute("result","已存在该测量点的报警!"); - }else{ - AlarmCondition alarmCondition = new AlarmCondition(); - alarmCondition.setId(CommUtil.getUUID()); - alarmCondition.setInsdt(CommUtil.nowDate()); - alarmCondition.setAlarmtypeid(request.getParameter("alarmtypeid")); - alarmCondition.setCompare(request.getParameter("compare")); - if(request.getParameter("lowerlimit")!=null && request.getParameter("lowerlimit").trim().length()>0){ - alarmCondition.setLowerlimit(Double.parseDouble(request.getParameter("lowerlimit"))); - } - if(request.getParameter("val")!=null && request.getParameter("val").trim().length()>0){ - alarmCondition.setVal(Double.parseDouble(request.getParameter("val"))); - } - if(request.getParameter("upperlimit")!=null && request.getParameter("upperlimit").trim().length()>0){ - alarmCondition.setUpperlimit(Double.parseDouble(request.getParameter("upperlimit"))); - } - alarmCondition.setMpointid(request.getParameter("mpointid")); - int result = this.alarmConditionService.save(alarmCondition); - model.addAttribute("result",result); - } - return "result"; - } - - @RequestMapping("/showEdit.do") - public String showEdit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - AlarmCondition alarmCondition = this.alarmConditionService.selectById(id); - model.addAttribute("alarmCondition", alarmCondition); - return "alarm/alarmConditionEdit"; - } - - @RequestMapping("/update.do") - public String update(HttpServletRequest request,Model model){ - AlarmCondition alarmCondition = this.alarmConditionService.selectById(request.getParameter("id")); - List list = this.alarmConditionService. - selectListByWhere("where mpointid = '"+request.getParameter("mpointid")+"' " - + "order by id"); - if(list != null && list.size()>0 && !request.getParameter("mpointid"). - equals(alarmCondition.getMpointid())){ - model.addAttribute("result","已存在该测量点的报警!"); - }else{ - AlarmCondition alarmCondition2 = new AlarmCondition(); - alarmCondition2.setId(CommUtil.getUUID()); - alarmCondition2.setInsdt(CommUtil.nowDate()); - alarmCondition2.setAlarmtypeid(request.getParameter("alarmtypeid")); - alarmCondition2.setCompare(request.getParameter("compare")); - if(request.getParameter("lowerlimit")!=null && request.getParameter("lowerlimit").trim().length()>0){ - alarmCondition2.setLowerlimit(Double.parseDouble(request.getParameter("lowerlimit"))); - } - if(request.getParameter("val")!=null && request.getParameter("val").trim().length()>0){ - alarmCondition2.setVal(Double.parseDouble(request.getParameter("val"))); - } - if(request.getParameter("upperlimit")!=null && request.getParameter("upperlimit").trim().length()>0){ - alarmCondition2.setUpperlimit(Double.parseDouble(request.getParameter("upperlimit"))); - } - alarmCondition2.setMpointid(request.getParameter("mpointid")); - int result = this.alarmConditionService.save(alarmCondition2); - this.alarmConditionService.deleteById(request.getParameter("id")); - model.addAttribute("result",result); - } - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - int result = this.alarmConditionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - - -} diff --git a/src/com/sipai/controller/alarm/AlarmInformationController.java b/src/com/sipai/controller/alarm/AlarmInformationController.java deleted file mode 100644 index aef7160e..00000000 --- a/src/com/sipai/controller/alarm/AlarmInformationController.java +++ /dev/null @@ -1,357 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.alarm.*; -import com.sipai.service.alarm.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmInformation") -public class AlarmInformationController { - @Resource - private AlarmInformationService alarmInformationService; - @Resource - private AlarmSubscribeService alarmSubscribeService; - @Resource - private AlarmLevelsService alarmLevelsService; - @Resource - private AlarmMoldService alarmMoldService; - @Resource - private AlarmPointService alarmPointService; - - @RequestMapping("/showist.do") - public String showAlarmInformationlist(HttpServletRequest request,Model model) { - return "/alarm/alarmInformationList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " code "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and unit_id='"+request.getParameter("unitId")+"' "; - - PageHelper.startPage(page, rows); - List list = this.alarmInformationService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request,Model model) { - List list = this.alarmInformationService.selectListByWhere(" where unit_id='"+request.getParameter("unitId")+"' order by code"); - JSONArray jsondata=new JSONArray(); - for(AlarmInformation aInformation:list){ - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",aInformation.getCode()); - jsonObject.put("text",aInformation.getName()); - jsondata.add(jsonObject); - } - String str = JSON.toJSONString(jsondata); - model.addAttribute("result",str); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonForConfigure.do") - public ModelAndView getJsonForConfigure(HttpServletRequest request,Model model) { - JSONArray jsondata=new JSONArray(); - List alarmMoldList = this.alarmInformationService.getDistinctMold(" where unit_id='"+request.getParameter("unitId")+"' "); - for(AlarmInformation alarmMold:alarmMoldList){ - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmMold.getMoldCode()); - jsonObject.put("text",AlarmMoldCodeEnum.getName(alarmMold.getMoldCode())); - jsonObject.put("type","mold"); - jsonObject.put("moldCode",alarmMold.getMoldCode()); - List levelList = this.alarmInformationService.selectListByWhere(" " + - "where unit_id='"+request.getParameter("unitId")+"' and mold_code='"+alarmMold.getMoldCode()+"' " + - "order by code"); - JSONArray djsondata=new JSONArray(); - for(AlarmInformation aInformation:levelList){ - JSONObject djsonObject=new JSONObject(); - djsonObject.put("id",aInformation.getLevelCode()); - djsonObject.put("text",AlarmLevelsCodeEnum.getName(aInformation.getLevelCode())); - djsonObject.put("type","level"); - djsonObject.put("hiddenId",aInformation.getId()); - djsonObject.put("moldCode",alarmMold.getMoldCode()); - djsondata.add(djsonObject); - } - jsonObject.put("nodes",djsondata); - jsondata.add(jsonObject); - } - - String str = JSON.toJSONString(jsondata); - model.addAttribute("result",str); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonForSysSubscribe.do") - public ModelAndView getJsonForSysSubscribe(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - - JSONArray jsondata=new JSONArray(); - List alarmMoldList = this.alarmInformationService.getDistinctMold(" where unit_id='"+request.getParameter("unitId")+"' and alarm_receivers like '%"+cu.getId()+"%' "); - for(AlarmInformation alarmMold:alarmMoldList){ - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmMold.getMoldCode()); - jsonObject.put("text",AlarmMoldCodeEnum.getName(alarmMold.getMoldCode())); - jsonObject.put("type","mold"); - jsonObject.put("moldCode",alarmMold.getMoldCode()); - - List levelList = this.alarmInformationService.selectListByWhere(" " + - "where unit_id='"+request.getParameter("unitId")+"' and mold_code='"+alarmMold.getMoldCode()+"' and alarm_receivers like '%"+cu.getId()+"%' " + - "order by code"); - JSONArray djsondata=new JSONArray(); - for(AlarmInformation aInformation:levelList){ - JSONObject djsonObject=new JSONObject(); - djsonObject.put("id",aInformation.getLevelCode()); - djsonObject.put("text",AlarmLevelsCodeEnum.getName(aInformation.getLevelCode())); - djsonObject.put("type","level"); - djsonObject.put("code",aInformation.getCode()); - djsondata.add(djsonObject); - } - jsonObject.put("nodes",djsondata); - jsondata.add(jsonObject); - } - - String str = JSON.toJSONString(jsondata); - model.addAttribute("result",str); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonForPersonalSubscribe.do") - public ModelAndView getJsonForPersonalSubscribe(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - - List moldList = this.alarmSubscribeService.selectMoldCountByWhere(" where s.unit_id='"+request.getParameter("unitId")+"' and userid='"+cu.getId()+"' "); - - JSONArray jsondata=new JSONArray(); - for(AlarmSubscribe mold:moldList){ - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",mold.getMoldCode()); - jsonObject.put("text",AlarmMoldCodeEnum.getName(mold.getMoldCode())); - jsonObject.put("type","mold"); - - List levelList = this.alarmSubscribeService.selectlevelCountByWhere(" where s.unit_id='"+request.getParameter("unitId")+"' and userid='"+cu.getId()+"' and mold_code='"+mold.getMoldCode()+"' "); - - JSONArray djsondata=new JSONArray(); - for(AlarmSubscribe level:levelList){ - JSONObject djsonObject=new JSONObject(); - djsonObject.put("id",level.getLevelCode()); - djsonObject.put("text",AlarmLevelsCodeEnum.getName(level.getLevelCode())); - djsonObject.put("type","level"); - djsonObject.put("moldCode",mold.getMoldCode()); - djsonObject.put("levelCode",level.getLevelCode()); - djsondata.add(djsonObject); - } - jsonObject.put("nodes",djsondata); - jsondata.add(jsonObject); - } - - String str = JSON.toJSONString(jsondata); - model.addAttribute("result",str); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - List alarmLevels = this.alarmLevelsService.selectListByWhere(" order by morder"); - JSONArray jsondata=new JSONArray(); - for (AlarmLevels alarmLevels2 : alarmLevels) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmLevels2.getCode()); - jsonObject.put("text",alarmLevels2.getName()); - jsondata.add(jsonObject); - } - List alarmMolds = this.alarmMoldService.selectListByWhere(" order by morder"); - JSONArray jsondata2=new JSONArray(); - for (AlarmMold alarmMolds2 : alarmMolds) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmMolds2.getCode()); - jsonObject.put("text",alarmMolds2.getName()); - jsondata2.add(jsonObject); - } - - model.addAttribute("alarmLevelsCodeEnum",jsondata.toString()); - model.addAttribute("alarmMoldCodeEnum",jsondata2.toString()); - model.addAttribute("AlarmInformationAlarmModeEnum",AlarmInformationAlarmModeEnum.getJsonString()); - return "alarm/alarmInformationAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - AlarmInformation alarmInformation = this.alarmInformationService.selectById(id); - model.addAttribute("alarmInformation", alarmInformation); - - List alarmLevels = this.alarmLevelsService.selectListByWhere(" order by morder"); - JSONArray jsondata=new JSONArray(); - for (AlarmLevels alarmLevels2 : alarmLevels) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmLevels2.getCode()); - jsonObject.put("text",alarmLevels2.getName()); - jsondata.add(jsonObject); - } - List alarmMolds = this.alarmMoldService.selectListByWhere(" order by morder"); - JSONArray jsondata2=new JSONArray(); - for (AlarmMold alarmMolds2 : alarmMolds) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmMolds2.getCode()); - jsonObject.put("text",alarmMolds2.getName()); - jsondata2.add(jsonObject); - } - model.addAttribute("alarmLevelsCodeEnum",jsondata.toString()); - model.addAttribute("alarmMoldCodeEnum",jsondata2.toString()); - model.addAttribute("AlarmInformationAlarmModeEnum",AlarmInformationAlarmModeEnum.getJsonString()); - return "alarm/alarmInformationEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute AlarmInformation alarmInformation){ - User cu=(User)request.getSession().getAttribute("cu"); - Result result = new Result(); - AlarmInformation AlarmInformationNum=this.alarmInformationService.selectCountByWhere(" where code='"+alarmInformation.getCode()+"' and unit_id='"+request.getParameter("unitId")+"' "); - if(AlarmInformationNum.getNum()>0){ - result = Result.failed("不能添加重复数据!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - String id = CommUtil.getUUID(); - alarmInformation.setId(id); - alarmInformation.setInsdt(CommUtil.nowDate()); - alarmInformation.setInsuser(cu.getId()); - alarmInformation.setUpdatetime(CommUtil.nowDate()); - alarmInformation.setUpdater(cu.getId()); - int code = this.alarmInformationService.save(alarmInformation); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dofirstsave.do") - public String dofirstsave(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - - String unitId=request.getParameter("unitId"); - this.alarmInformationService.deleteByWhere(" where unit_id='"+unitId+"' "); - this.alarmPointService.deleteByWhere(" where unit_id='"+unitId+"' "); - - List alarmLevels = this.alarmLevelsService.selectListByWhere(" order by morder"); - List alarmMolds = this.alarmMoldService.selectListByWhere(" order by morder"); - int code=0; - for (AlarmMold alarmMold : alarmMolds) { - for (AlarmLevels alarmLevelss : alarmLevels) { - AlarmInformation alarmInformation=new AlarmInformation(); - alarmInformation.setId(CommUtil.getUUID()); - alarmInformation.setInsdt(CommUtil.nowDate()); - alarmInformation.setInsuser(cu.getId()); - alarmInformation.setUpdatetime(CommUtil.nowDate()); - alarmInformation.setUpdater(cu.getId()); - alarmInformation.setName(alarmMold.getName()+"_"+alarmLevelss.getName()); - alarmInformation.setCode(alarmMold.getCode()+"_"+alarmLevelss.getCode()); - alarmInformation.setLevelCode(alarmLevelss.getCode()); - alarmInformation.setMoldCode(alarmMold.getCode()); - alarmInformation.setUnitId(unitId); - code = this.alarmInformationService.save(alarmInformation); - } - } - - Result result = new Result(); - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute AlarmInformation alarmInformation){ - User cu=(User)request.getSession().getAttribute("cu"); - String oldCode=request.getParameter("oldCode"); - Result result = new Result(); - AlarmInformation AlarmInformationNum=this.alarmInformationService.selectCountByWhere(" where code='"+alarmInformation.getCode()+"' and unit_id='"+request.getParameter("unitId")+"' "); - if(AlarmInformationNum.getNum()>0&&!oldCode.equals(alarmInformation.getCode())){ - result = Result.failed("不能添加重复数据!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - alarmInformation.setUpdatetime(CommUtil.nowDate()); - alarmInformation.setUpdater(cu.getId()); - int code = this.alarmInformationService.update(alarmInformation); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.alarmInformationService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.alarmInformationService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmLevelsConfigController.java b/src/com/sipai/controller/alarm/AlarmLevelsConfigController.java deleted file mode 100644 index 0e6e649a..00000000 --- a/src/com/sipai/controller/alarm/AlarmLevelsConfigController.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.controller.alarm; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmLevelsConfig; -import com.sipai.entity.base.Result; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmLevesConfigService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("alarm/config") -public class AlarmLevelsConfigController { - @Resource - private AlarmLevesConfigService alarmLevesConfigService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "alarm/alarmLevelsConfigList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - ArrayList resultList = new ArrayList<>(); - List list = this.alarmLevesConfigService.selectListByWhere(""); - for (int i = 0; i < list.size(); i++) { - list.get(i).setLimit(list.get(i).getLowerLimit() + " - " + list.get(i).getUpperLimit()); - resultList.add(list.get(i)); - } - JSONArray json= JSONArray.fromObject(resultList); - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/getConfigList.do") - public String getConfigList(HttpServletRequest request,Model model){ - String rvalue = request.getParameter("rvalue"); - List list = this.alarmLevesConfigService.selectListByWhere("where upper_limit >= " + rvalue + " and lower_limit <= " + rvalue); - JSONArray json= JSONArray.fromObject(list); - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doadd(HttpServletRequest request,Model model){ - return "alarm/alarmLevelsConfigAdd"; - } - - @RequestMapping("/doSave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute AlarmLevelsConfig alarmLevelsConfig){ - List alarmLevelsConfigs = alarmLevesConfigService.selectListByWhere("where level = '" + alarmLevelsConfig.getLevel() + "'"); - if (alarmLevelsConfigs.size() > 0) { - String resstr="{\"res\":\"0\",\"msg\":\"相同等级只可存在一条配置!\"}"; - model.addAttribute("result", resstr); - return "result"; - } - String id = CommUtil.getUUID(); - alarmLevelsConfig.setId(id); - switch(alarmLevelsConfig.getLevel()) { - case "A": - alarmLevelsConfig.setCode(1); - break; - case "B": - alarmLevelsConfig.setCode(2); - break; - case "C": - alarmLevelsConfig.setCode(3); - break; - case "D": - alarmLevelsConfig.setCode(4); - break; - } - int result = this.alarmLevesConfigService.save(alarmLevelsConfig); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doEdit.do") - public String doedit(HttpServletRequest request,Model model,@RequestParam(value = "id") String id){ - AlarmLevelsConfig alarmLevelsConfig = this.alarmLevesConfigService.selectById(id); - model.addAttribute("alarmLevelsConfig", alarmLevelsConfig); - return "alarm/alarmLevelsConfigEdit"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("alarmLevelsConfig") AlarmLevelsConfig alarmLevelsConfig){ - List alarmLevelsConfigs = alarmLevesConfigService.selectListByWhere("where level = '" + alarmLevelsConfig.getLevel() + "' and id != '" + alarmLevelsConfig.getId() + "'"); - if (alarmLevelsConfigs.size() > 0) { - String resstr="{\"res\":\"0\",\"msg\":\"相同等级只可存在一条配置!\"}"; - model.addAttribute("result", resstr); - return "result"; - } - switch(alarmLevelsConfig.getLevel()) { - case "A": - alarmLevelsConfig.setCode(1); - break; - case "B": - alarmLevelsConfig.setCode(2); - break; - case "C": - alarmLevelsConfig.setCode(3); - break; - case "D": - alarmLevelsConfig.setCode(4); - break; - } - int code = this.alarmLevesConfigService.update(alarmLevelsConfig); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.alarmLevesConfigService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.alarmLevesConfigService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmLevelsController.java b/src/com/sipai/controller/alarm/AlarmLevelsController.java deleted file mode 100644 index 0f78d3ed..00000000 --- a/src/com/sipai/controller/alarm/AlarmLevelsController.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.HashMap; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmLevels; -import com.sipai.entity.alarm.AlarmLevelsCodeEnum; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmLevelsService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmLevels") -public class AlarmLevelsController { - - @Resource - private AlarmLevelsService alarmLevelsService; - @Resource - private UnitService unitService; - - @RequestMapping("/showist.do") - public String showAlarmLevelslist(HttpServletRequest request,Model model) { - return "/alarm/alarmLevelsList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " code "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - - PageHelper.startPage(page, rows); - List list = this.alarmLevelsService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("alarmLevelsCodeEnum",AlarmLevelsCodeEnum.getJsonString()); - return "alarm/alarmLevelsAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - AlarmLevels alarmLevels = this.alarmLevelsService.selectById(id); - model.addAttribute("alarmLevels", alarmLevels); - model.addAttribute("alarmLevelsCodeEnum",AlarmLevelsCodeEnum.getJsonString()); - return "alarm/alarmLevelsEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute AlarmLevels alarmLevels){ - Result result = new Result(); - AlarmLevels AlarmLevelsNum=this.alarmLevelsService.selectCountByWhere(" where code='"+alarmLevels.getCode()+"' "); - if(AlarmLevelsNum.getNum()>0){ - result = Result.failed("不能添加重复数据!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - alarmLevels.setId(id); - alarmLevels.setName(AlarmLevelsCodeEnum.getName(request.getParameter("code"))); - int code = this.alarmLevelsService.save(alarmLevels); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dofirstsave.do") - public String donewsave(HttpServletRequest request,Model model){ - this.alarmLevelsService.deleteByWhere(""); - int code=0; - List list=AlarmLevelsCodeEnum.getList(); - for (AlarmLevels alarmLevels : list) { - String id = CommUtil.getUUID(); - alarmLevels.setId(id); - code += this.alarmLevelsService.save(alarmLevels); - } - - Result result = new Result(); - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute AlarmLevels alarmLevels){ - String oldCode=request.getParameter("oldCode"); - Result result = new Result(); - AlarmLevels AlarmLevelsNum=this.alarmLevelsService.selectCountByWhere(" where code='"+alarmLevels.getCode()+"' "); - if(AlarmLevelsNum.getNum()>0&&!oldCode.equals(alarmLevels.getCode())){ - result = Result.failed("不能添加重复数据!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - alarmLevels.setName(AlarmLevelsCodeEnum.getName(request.getParameter("code"))); - int code = this.alarmLevelsService.update(alarmLevels); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.alarmLevelsService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.alarmLevelsService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmMoldController.java b/src/com/sipai/controller/alarm/AlarmMoldController.java deleted file mode 100644 index e00e4a7b..00000000 --- a/src/com/sipai/controller/alarm/AlarmMoldController.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.HashMap; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmMold; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmMoldService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmMold") -public class AlarmMoldController { - @Resource - private AlarmMoldService alarmMoldService; - @Resource - private UnitService unitService; - - @RequestMapping("/showist.do") - public String showAlarmMoldlist(HttpServletRequest request,Model model) { - return "/alarm/alarmMoldList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " code "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - - PageHelper.startPage(page, rows); - List list = this.alarmMoldService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("alarmMoldCodeEnum",AlarmMoldCodeEnum.getJsonString()); - return "alarm/alarmMoldAdd"; - } - - @RequestMapping("/doadds.do") - public String doadds(HttpServletRequest request,Model model){ - return "alarm/alarmMoldAdds"; - } - - @RequestMapping("/getAlarmMoldCodeEnumJson.do") - public ModelAndView getAlarmMoldCodeEnumJson(HttpServletRequest request,Model model) { - - model.addAttribute("result",AlarmMoldCodeEnum.getJsonString()); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - AlarmMold alarmMold = this.alarmMoldService.selectById(id); - model.addAttribute("alarmMold", alarmMold); - model.addAttribute("alarmMoldCodeEnum",AlarmMoldCodeEnum.getJsonString()); - return "alarm/alarmMoldEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute AlarmMold alarmMold){ - Result result = new Result(); - AlarmMold AlarmMoldNum=this.alarmMoldService.selectCountByWhere(" where code='"+alarmMold.getCode()+"' "); - if(AlarmMoldNum.getNum()>0){ - result = Result.failed("不能添加重复数据!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - alarmMold.setId(id); - alarmMold.setName(AlarmMoldCodeEnum.getName(request.getParameter("code"))); - int code = this.alarmMoldService.save(alarmMold); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosaves.do") - public String dosaves(HttpServletRequest request,Model model, - @ModelAttribute AlarmMold alarmMold){ - Result result = new Result(); - int code = 0; - int sunCode = 0; - int failCode = 0; - - String[] ids=request.getParameter("ids").split(","); - String[] names=request.getParameter("names").split(","); - for (String id : ids) { - AlarmMold AlarmMoldNum=this.alarmMoldService.selectCountByWhere(" where code='"+id+"' "); - if(AlarmMoldNum.getNum()>0){ - failCode++; - }else{ - alarmMold.setId(CommUtil.getUUID()); - alarmMold.setCode(id); - alarmMold.setName(names[code]); - alarmMold.setMorder(code); - int scnum=this.alarmMoldService.save(alarmMold); - if (scnum >= Result.SUCCESS) { - sunCode++; - } else { - failCode++; - } - } - - code++; - } - - if (sunCode >= Result.SUCCESS) { - if(sunCode==code){ - result = Result.success(code); - }else{ - result = Result.failed("共需增加"+code+"条记录。其中"+sunCode+"条成功,"+failCode+"条失败"); - } - } else { - result = Result.failed("共需增加"+code+"条记录。其中"+sunCode+"条成功,"+failCode+"条失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute AlarmMold alarmMold){ - String oldCode=request.getParameter("oldCode"); - Result result = new Result(); - AlarmMold AlarmMoldNum=this.alarmMoldService.selectCountByWhere(" where code='"+alarmMold.getCode()+"' "); - if(AlarmMoldNum.getNum()>0&&!oldCode.equals(alarmMold.getCode())){ - result = Result.failed("不能添加重复数据!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - alarmMold.setName(AlarmMoldCodeEnum.getName(request.getParameter("code"))); - int code = this.alarmMoldService.update(alarmMold); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.alarmMoldService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.alarmMoldService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmPointController.java b/src/com/sipai/controller/alarm/AlarmPointController.java deleted file mode 100644 index de43d296..00000000 --- a/src/com/sipai/controller/alarm/AlarmPointController.java +++ /dev/null @@ -1,524 +0,0 @@ -package com.sipai.controller.alarm; - -import static org.hamcrest.CoreMatchers.nullValue; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.alarm.AlarmSubscribe; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.alarm.AlarmSubscribeService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmInformation; -import com.sipai.entity.alarm.AlarmPoint; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmPoint") -public class AlarmPointController { - @Resource - private AlarmPointService alarmPointService; - @Resource - private AlarmInformationService alarmInformationService; - @Resource - private MPointService mPointService; - @Resource - private AlarmSubscribeService alarmSubscribeService; - @Resource - private ProAlarmService proAlarmService; - @Resource - private ProcessSectionService processSectionService; - - @RequestMapping("/showist.do") - public String showAlarmPointlist(HttpServletRequest request, Model model) { - - return "/alarm/alarmPointList"; - } - - @RequestMapping("/showistForSubscribe.do") - public String showistForSubscribe(HttpServletRequest request, Model model) { - List alarmInformations = this.alarmInformationService.selectListByWhere(" where unit_id='" + request.getParameter("unitId") + "' order by code"); - JSONArray jsondata = new JSONArray(); - for (AlarmInformation alarmInformations2 : alarmInformations) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", alarmInformations2.getCode()); - jsonObject.put("text", alarmInformations2.getName()); - jsondata.add(jsonObject); - } - model.addAttribute("alarmInformationJson", jsondata.toString()); - return "/alarm/alarmPointListForSubscribe"; - } - - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " alarm_point "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (request.getParameter("unitId") != null && request.getParameter("unitId").length() > 0) { - wherestr += " and unit_id='" + request.getParameter("unitId") + "' "; - } - String searchName = request.getParameter("search_name"); - if (request.getParameter("informationCode") != null && request.getParameter("informationCode").length() > 0) { - wherestr += " and information_code='" + request.getParameter("informationCode") + "' "; - } - - PageHelper.startPage(page, rows); - List list = new ArrayList<>(); - try { - list = this.alarmPointService.selectListByWhere(wherestr + orderstr, searchName); - } catch (Exception e) { - e.printStackTrace(); - } - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistForSubscribePersonal.do") - public ModelAndView getlistForSubscribePersonal(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " mold_code "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where s.unit_id='" + request.getParameter("unitId") + "' and userid='" + cu.getId() + "' " + - " and i.mold_code='" + request.getParameter("moldCode") + "' and i.level_code='" + request.getParameter("levelCode") + "' "; - - PageHelper.startPage(page, rows); - List list = this.alarmSubscribeService.selectLeftOuterListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistForSubscribePersonalAdd.do") - public ModelAndView getlistForSubscribePersonalAdd(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " alarm_point "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and (alarm_receivers not like '%" + cu.getId() + "%' or alarm_receivers is null) "; - - if (request.getParameter("unitId") != null && request.getParameter("unitId").length() > 0) { - wherestr += " and p.unit_id='" + request.getParameter("unitId") + "' "; - } - String searchName = request.getParameter("search_name"); - if (request.getParameter("informationCode") != null && request.getParameter("informationCode").length() > 0) { - wherestr += " and information_code='" + request.getParameter("informationCode") + "' "; - } - if (request.getParameter("alarmMoldCode") != null && request.getParameter("alarmMoldCode").length() > 0) { - wherestr += " and information_code like '%" + request.getParameter("alarmMoldCode") + "%' "; - } - if (request.getParameter("alarmLevelsCode") != null && request.getParameter("alarmLevelsCode").length() > 0) { - wherestr += " and information_code like '%" + request.getParameter("alarmLevelsCode") + "%' "; - } - - List alarmSubscribeList = this.alarmSubscribeService.selectListByWhere(" where unit_id='" + request.getParameter("unitId") + "' and userid='" + cu.getId() + "' "); - String alarmPointIds = ""; - if (alarmSubscribeList != null && alarmSubscribeList.size() > 0) { - for (int i = 0; i < alarmSubscribeList.size(); i++) { - alarmPointIds += alarmSubscribeList.get(i).getAlarmPointId() + ","; - } - } - if (!alarmPointIds.equals("")) { - alarmPointIds = alarmPointIds.replace(",", "','"); - wherestr += " and p.id not in ('" + alarmPointIds + "') "; - } - - PageHelper.startPage(page, rows); - List list = this.alarmPointService.selectListJoinInformationByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistForSubscribeSys.do") - public ModelAndView getlistForSubscribeSys(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " alarm_point "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - - if (request.getParameter("unitId") != null && request.getParameter("unitId").length() > 0) { - wherestr += " and p.unit_id='" + request.getParameter("unitId") + "' "; - } - String searchName = request.getParameter("search_name"); - if (request.getParameter("informationCode") != null && request.getParameter("informationCode").length() > 0) { - wherestr += " and information_code='" + request.getParameter("informationCode") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.alarmPointService.selectListJoinInformationByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doMPointadd.do") - public String doMPointadd(HttpServletRequest request, Model model) { - List alarmInformations = this.alarmInformationService.selectListByWhere(" where unit_id='" + request.getParameter("unitId") + "' order by code"); - JSONArray jsondata = new JSONArray(); - for (AlarmInformation alarmInformations2 : alarmInformations) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", alarmInformations2.getCode()); - jsonObject.put("text", alarmInformations2.getName()); - jsondata.add(jsonObject); - } - model.addAttribute("alarmInformationJson", jsondata.toString()); - - return "alarm/alarmPointAddForMPoint"; - } - - @RequestMapping("/doMPointedit.do") - public String doMPointedit(HttpServletRequest request, Model model) throws IOException { - String id = request.getParameter("id"); - AlarmPoint alarmPoint = this.alarmPointService.selectById(id); - model.addAttribute("alarmPoint", alarmPoint); - - List alarmInformations = this.alarmInformationService.selectListByWhere(" where unit_id='" + request.getParameter("unitId") + "' order by code"); - JSONArray jsondata = new JSONArray(); - for (AlarmInformation alarmInformations2 : alarmInformations) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", alarmInformations2.getCode()); - jsonObject.put("text", alarmInformations2.getName()); - jsondata.add(jsonObject); - } - model.addAttribute("alarmInformationJson", jsondata.toString()); - String alarmConfigType = new CommUtil().getProperties("mqtt.properties", "alarmConfigType"); - model.addAttribute("alarmConfigType", alarmConfigType); - return "alarm/alarmPointEditForMPoint"; - } - - @RequestMapping("/addOwnPoint.do") - public String addOwnPoint(HttpServletRequest request, Model model) { - List alarmInformations = this.alarmInformationService.selectListByWhere(" where unit_id='" + request.getParameter("unitId") + "' order by code"); - JSONArray jsondata = new JSONArray(); - for (AlarmInformation alarmInformations2 : alarmInformations) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", alarmInformations2.getCode()); - jsonObject.put("text", alarmInformations2.getName()); - jsondata.add(jsonObject); - } - model.addAttribute("alarmInformationJson", jsondata.toString()); - return "alarm/alarmPointEditForOwnPoint"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute AlarmPoint alarmPoint) { - Result result = new Result(); - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - alarmPoint.setId(id); - int code = this.alarmPointService.save(alarmPoint); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doMPointSaves.do") - public String doMPointSaves(HttpServletRequest request, Model model) { - Result result = new Result(); - User cu = (User) request.getSession().getAttribute("cu"); - int code = 0; - - String unitId = request.getParameter("unitId"); - String[] idss = request.getParameter("ids").split(","); - String informationCode = request.getParameter("informationCode"); - for (String ids : idss) { - AlarmPoint alarmPoint = new AlarmPoint(); - alarmPoint.setId(CommUtil.getUUID()); - alarmPoint.setInsdt(CommUtil.nowDate()); - alarmPoint.setInsuser(cu.getId()); - alarmPoint.setUpdatetime(CommUtil.nowDate()); - alarmPoint.setUpdater(cu.getId()); - alarmPoint.setAlarmPoint(ids); - alarmPoint.setInformationCode(informationCode); - alarmPoint.setUnitId(unitId); - alarmPoint.setType(request.getParameter("type")); - code += this.alarmPointService.save(alarmPoint); - } - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute AlarmPoint alarmPoint) { - Result result = new Result(); - - int code = this.alarmPointService.update(alarmPoint); - if (alarmPoint.getInformationCode().contains(AlarmMoldCodeEnum.LimitValue_Pro.getKey())) { - MPoint mPoint = this.mPointService.selectById(alarmPoint.getUnitId(), alarmPoint.getAlarmPoint()); - if (request.getParameter("lalarmmin") != null && !request.getParameter("alarmmax").equals("")) { - mPoint.setAlarmmax(new BigDecimal(request.getParameter("alarmmax"))); - this.mPointService.update2(alarmPoint.getUnitId(), mPoint); - } else { - this.mPointService.updateAlarmmax(alarmPoint.getUnitId(), mPoint.getMpointcode()); -// mPoint.setAlarmmax(null); - } - if (request.getParameter("lalarmmin") != null && !request.getParameter("alarmmin").equals("")) { - mPoint.setAlarmmin(new BigDecimal(request.getParameter("alarmmin"))); - this.mPointService.update2(alarmPoint.getUnitId(), mPoint); - } else { - this.mPointService.updateAlarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode()); -// mPoint.setAlarmmin(null); - } - if (request.getParameter("lalarmmin") != null && !request.getParameter("halarmmax").equals("")) { - mPoint.setHalarmmax(new BigDecimal(request.getParameter("halarmmax"))); - this.mPointService.update2(alarmPoint.getUnitId(), mPoint); - } else { - this.mPointService.updateHalarmmax(alarmPoint.getUnitId(), mPoint.getMpointcode()); -// mPoint.setHalarmmax(null); - } - if (request.getParameter("lalarmmin") != null && !request.getParameter("lalarmmin").equals("")) { - mPoint.setLalarmmin(new BigDecimal(request.getParameter("lalarmmin"))); - this.mPointService.update2(alarmPoint.getUnitId(), mPoint); - } else { - this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode()); -// mPoint.setLalarmmin(null); - } -// this.mPointService.update2(alarmPoint.getUnitId(),mPoint); - } - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - this.alarmSubscribeService.deleteByWhere("where alarm_point_id in ('" + id + "')"); - int code = this.alarmPointService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - this.alarmSubscribeService.deleteByWhere("where alarm_point_id in ('" + ids + "')"); - int result = this.alarmPointService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/alarmRecover.do") - public ModelAndView alarmRecover(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); - String pointId = request.getParameter("pointId"); - String alarmTime = request.getParameter("alarmTime"); - String recoverValue = request.getParameter("recoverValue"); - - int code = this.alarmPointService.alarmRecover(bizid, pointId, alarmTime, recoverValue); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("操作失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - - return new ModelAndView("result"); - } - - - @RequestMapping("/insertAlarm.do") - public String insertAlarm(HttpServletRequest request, Model model) { - String alarmType = request.getParameter("alarmType"); - String pointId = request.getParameter("pointId"); - String pointName = request.getParameter("pointName"); - String unitId = request.getParameter("unitId"); - String levelType = request.getParameter("levelType"); - String describe = request.getParameter("describe"); - String nowValue = request.getParameter("nowValue"); - String prSectionCode = request.getParameter("prSectionCode"); - - String prSectionName = ""; - List prSection = this.processSectionService.selectListByWhere(" where code='" + prSectionCode + "' and unit_id='" + unitId + "' "); - if (prSection != null && prSection.size() > 0) { - prSectionName = prSection.get(0).getName(); - } - - int result = this.alarmPointService.insertAlarm(unitId, request, alarmType, pointId, pointName, CommUtil.nowDate(), levelType, describe, nowValue, prSectionCode, prSectionName); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/insertAlarmForApp.do") - public String insertAlarmForApp(HttpServletRequest request, Model model) { - String alarmType = request.getParameter("alarmType"); - String pointId = request.getParameter("pointId"); - String pointName = request.getParameter("pointName"); - String unitId = request.getParameter("unitId"); - String levelType = request.getParameter("levelType"); - String describe = request.getParameter("describe"); - String nowValue = request.getParameter("nowValue"); - String prSectionCode = request.getParameter("prSectionCode"); - - String prSectionName = ""; - List prSection = this.processSectionService.selectListByWhere(" where code='" + prSectionCode + "' and unit_id='" + unitId + "' "); - if (prSection != null && prSection.size() > 0) { - prSectionName = prSection.get(0).getName(); - } - - String nowTime = CommUtil.nowDate(); - int result = this.alarmPointService.insertAlarm(unitId, request, alarmType, pointId, pointName, nowTime, levelType, describe, nowValue, prSectionCode, prSectionName); - - JSONObject j = new JSONObject(); - j.put("result", result); - j.put("pointId", pointId); - j.put("nowTime", nowTime); - - model.addAttribute("result", j); - return "result"; - } - - @RequestMapping("/externalSysAlarm.do") - public String externalSysAlarm(HttpServletRequest request, Model model) { - String alarmType = request.getParameter("alarmType"); - String pointId = request.getParameter("pointId"); - String pointName = request.getParameter("pointName"); - String unitId = request.getParameter("unitId"); - String levelType = request.getParameter("levelType"); - String describe = request.getParameter("describe"); - String nowValue = request.getParameter("nowValue"); - String prSectionCode = request.getParameter("prSectionCode"); - - String prSectionName = ""; - if (prSectionCode != null && !prSectionCode.equals("")) { - List prSection = this.processSectionService.selectListByWhere(" where code='" + prSectionCode + "' and unit_id='" + unitId + "' "); - if (prSection != null && prSection.size() > 0) { - prSectionName = prSection.get(0).getName(); - } - } - - int result = this.alarmPointService.insertAlarm(unitId, null, alarmType, pointId, pointName, CommUtil.nowDate(), levelType, describe, nowValue, prSectionCode, prSectionName); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/externalSysAlarmRecover.do") - public ModelAndView externalSysAlarmRecover(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String pointId = request.getParameter("pointId"); - String recoverValue = request.getParameter("recoverValue"); - - int code = this.alarmPointService.alarmRecover2(unitId, pointId, recoverValue); - - model.addAttribute("result", code); - - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmPointRiskLevelController.java b/src/com/sipai/controller/alarm/AlarmPointRiskLevelController.java deleted file mode 100644 index fc15ebe5..00000000 --- a/src/com/sipai/controller/alarm/AlarmPointRiskLevelController.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.sipai.controller.alarm; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmLevelsConfig; -import com.sipai.entity.alarm.AlarmPointRiskLevel; -import com.sipai.entity.base.Result; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmLevesConfigService; -import com.sipai.service.alarm.AlarmPointRiskLevelService; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("alarm/alarmPointRiskLevel") -public class AlarmPointRiskLevelController { - @Resource - private AlarmPointRiskLevelService alarmPointRiskLevelService; - @Resource - private RiskLevelService riskLevelService; - -// @RequestMapping("/getList.do") -// public String getList(HttpServletRequest request, Model model) { -// String pid = request.getParameter("pid"); -// List list = this.alarmPointRiskLevelService.selectListByWhere("where alarmPoint_id = '" + pid + "' order by morder "); -// JSONArray json = JSONArray.fromObject(list); -// String result = "{\"rows\":" + json + "}"; -// model.addAttribute("result", result); -// return "result"; -// } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String pid = request.getParameter("pid"); - - String wherestr = "where alarmPoint_id = '" + pid + "' order by morder "; - - PageHelper.startPage(page, rows); - List list = this.alarmPointRiskLevelService.selectListByWhere(wherestr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - return "alarm/alarmPointRiskLevelAdd"; - } - - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - AlarmPointRiskLevel alarmPointRiskLevel = alarmPointRiskLevelService.selectById(id); - model.addAttribute("alarmPointRiskLevel", alarmPointRiskLevel); - return "alarm/alarmPointRiskLevelEdit"; - } - - @RequestMapping("/doSave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute AlarmPointRiskLevel alarmPointRiskLevel) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - alarmPointRiskLevel.setId(id); - alarmPointRiskLevel.setInsdt(CommUtil.nowDate()); - alarmPointRiskLevel.setInsuser(cu.getId()); - alarmPointRiskLevel.setMorder(0); - int result = this.alarmPointRiskLevelService.save(alarmPointRiskLevel); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute AlarmPointRiskLevel alarmPointRiskLevel) { - int code = this.alarmPointRiskLevelService.update(alarmPointRiskLevel); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.alarmPointRiskLevelService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelByPid.do") - public String dodelByPid(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - Result result = new Result(); - int code = this.alarmPointRiskLevelService.deleteByWhere(pid); - if (code > 0) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmRecordController.java b/src/com/sipai/controller/alarm/AlarmRecordController.java deleted file mode 100644 index 52d3ea0b..00000000 --- a/src/com/sipai/controller/alarm/AlarmRecordController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.controller.alarm; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmRecord; -import com.sipai.entity.alarm.AlarmSolution; -import com.sipai.entity.alarm.AlarmType; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmRecordService; -import com.sipai.service.alarm.AlarmSolutionService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmRecord") -public class AlarmRecordController { - @Resource - private AlarmRecordService alarmRecordService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private AlarmSolutionService alarmSolutionService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "alarm/alarmRecordList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = this.alarmRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - AlarmRecord alarmRecord = this.alarmRecordService.selectById(id); - model.addAttribute("alarmRecord", alarmRecord); - return "alarm/alarmRecordView"; - } - - /** - * 下发 - * @param request - * @param model - * @return - * @throws ParseException - */ - @RequestMapping("/issue.do") - public String issue(HttpServletRequest request,Model model) throws ParseException{ - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); - AlarmRecord alarmRecord = this.alarmRecordService.selectById(id); - AlarmType alarmType = alarmRecord.getAlarmType(); - String solutionid = request.getParameter("solutionid"); - solutionid = "('"+solutionid.replaceAll(",", "','")+"')"; - List list = this.alarmSolutionService.selectListByWhere - ("where id in "+solutionid +" order by id"); - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setBizId(unitId); - patrolRecord.setUnitId(unitId); - patrolRecord.setInsuser(((User)request.getSession().getAttribute("cu")).getId()); - //patrolRecord.setPatrolAreaId(patrolPlan.getPatrolAreaId()); - patrolRecord.setName("预警临时任务"); - String content = "预警描述:"+alarmType.getDescribe()+"."; - if(list != null && list.size()>0){ - for(int i=0;i0){ - wherestr += " and alarmtypeid = '"+request.getParameter("alarmtypeid")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.alarmSolutionService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/showAdd.do") - public String showAdd(HttpServletRequest request,Model model, - @RequestParam(value = "alarmtypeid") String alarmtypeid){ - model.addAttribute("alarmtypeid", alarmtypeid); - return "alarm/alarmSolutionAdd"; - } - - @RequestMapping("/getOrderJson.do") - public String getOrderJson(HttpServletRequest request,Model model){ - List list = OrderType.getList(); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = Arrays.asList(depts); - JSONArray json=new JSONArray(); - if(list != null && list.size()>0){ - for(String s:list){ - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", s); - jsonObject.put("text", ""); - json.add(jsonObject); - } - } - model.addAttribute("depts", json); - return "alarm/alarmSolutionEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("alarmSolution") AlarmSolution alarmSolution){ - int result = this.alarmSolutionService.update(alarmSolution); - model.addAttribute("result",result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmSubscribeController.java b/src/com/sipai/controller/alarm/AlarmSubscribeController.java deleted file mode 100644 index afe9e4e1..00000000 --- a/src/com/sipai/controller/alarm/AlarmSubscribeController.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.alarm.AlarmLevels; -import com.sipai.entity.alarm.AlarmMold; -import com.sipai.service.alarm.AlarmLevelsService; -import com.sipai.service.alarm.AlarmMoldService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmSubscribe; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmSubscribeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm/alarmSubscribe") -public class AlarmSubscribeController { - @Resource - private AlarmSubscribeService alarmSubscribeService; - @Resource - private AlarmLevelsService alarmLevelsService; - @Resource - private AlarmMoldService alarmMoldService; - - @RequestMapping("/showist.do") - public String showAlarmSubscribelist(HttpServletRequest request,Model model) { - return "/alarm/alarmSubscribeList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " code "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - - PageHelper.startPage(page, rows); - List list = this.alarmSubscribeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonForPersonalSubscribe.do") - public ModelAndView getJsonForPersonalSubscribe(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); -// JSONArray jsondata=new JSONArray(); -// List alarmMoldList = this.alarmInformationService.getDistinctMold(" where unit_id='"+request.getParameter("unitId")+"' and alarm_receivers like '%"+cu.getId()+"%' "); -// for(AlarmInformation alarmMold:alarmMoldList){ -// JSONObject jsonObject=new JSONObject(); -// jsonObject.put("id",alarmMold.getMoldCode()); -// jsonObject.put("text",AlarmMoldCodeEnum.getName(alarmMold.getMoldCode())); -// jsonObject.put("type","mold"); -// jsonObject.put("moldCode",alarmMold.getMoldCode()); -// -// List levelList = this.alarmInformationService.selectListByWhere(" " + -// "where unit_id='"+request.getParameter("unitId")+"' and mold_code='"+alarmMold.getMoldCode()+"' and alarm_receivers like '%"+cu.getId()+"%' " + -// "order by code"); -// JSONArray djsondata=new JSONArray(); -// for(AlarmInformation aInformation:levelList){ -// JSONObject djsonObject=new JSONObject(); -// djsonObject.put("id",aInformation.getLevelCode()); -// djsonObject.put("text",AlarmLevelsCodeEnum.getName(aInformation.getLevelCode())); -// djsonObject.put("type","level"); -// djsonObject.put("hiddenId",aInformation.getId()); -// djsonObject.put("moldCode",alarmMold.getMoldCode()); -// djsondata.add(djsonObject); -// } -// jsonObject.put("nodes",djsondata); -// jsondata.add(jsonObject); -// } -// -// String str = JSON.toJSONString(jsondata); -// model.addAttribute("result",str); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - List alarmLevels = this.alarmLevelsService.selectListByWhere(" order by morder"); - JSONArray jsondata=new JSONArray(); - for (AlarmLevels alarmLevels2 : alarmLevels) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmLevels2.getCode()); - jsonObject.put("text",alarmLevels2.getName()); - jsondata.add(jsonObject); - } - List alarmMolds = this.alarmMoldService.selectListByWhere(" order by morder"); - JSONArray jsondata2=new JSONArray(); - for (AlarmMold alarmMolds2 : alarmMolds) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmMolds2.getCode()); - jsonObject.put("text",alarmMolds2.getName()); - jsondata2.add(jsonObject); - } - - model.addAttribute("alarmLevelsCodeEnum",jsondata.toString()); - model.addAttribute("alarmMoldCodeEnum",jsondata2.toString()); - return "alarm/alarmSubscribeAdd"; - } - - @RequestMapping("/showSysPoint.do") - public String showSysPoint(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - AlarmSubscribe alarmSubscribe = this.alarmSubscribeService.selectById(id); - model.addAttribute("alarmSubscribe", alarmSubscribe); - return "alarm/alarmSysSubscribePointList"; - } - - @RequestMapping("/showPersonalPoint.do") - public String showPersonalPoint(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - AlarmSubscribe alarmSubscribe = this.alarmSubscribeService.selectById(id); - model.addAttribute("alarmSubscribe", alarmSubscribe); - return "alarm/alarmPersonalSubscribePointList"; - } - - @RequestMapping("/doPersonalSave.do") - public String doPersonalSave(HttpServletRequest request,Model model, - @ModelAttribute AlarmSubscribe alarmSubscribe){ - Result result = new Result(); - User cu= (User)request.getSession().getAttribute("cu"); - String[] ids=request.getParameter("ids").split(","); - int code = 0; - for (String alarmPointid: ids) { - String id = CommUtil.getUUID(); - alarmSubscribe.setId(id); - alarmSubscribe.setAlarmPointId(alarmPointid); - alarmSubscribe.setUnitId(request.getParameter("unitId")); - alarmSubscribe.setUserid(cu.getId()); - code += this.alarmSubscribeService.save(alarmSubscribe); - } - - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute AlarmSubscribe alarmSubscribe){ - String oldCode=request.getParameter("oldCode"); - Result result = new Result(); - int code = this.alarmSubscribeService.update(alarmSubscribe); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.alarmSubscribeService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.alarmSubscribeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/AlarmTypeController.java b/src/com/sipai/controller/alarm/AlarmTypeController.java deleted file mode 100644 index f8b453d5..00000000 --- a/src/com/sipai/controller/alarm/AlarmTypeController.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.sipai.entity.alarm.AlarmType; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.user.Menu; -import com.sipai.service.alarm.AlarmTypeService; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/alarm") -public class AlarmTypeController { - @Resource - private AlarmTypeService alarmTypeService; - @Resource - private MsgTypeService msgTypeService; - - @RequestMapping("/showAlarmTypeTree.do") - public String showAlarmTypeTree(HttpServletRequest request,Model model){ - return "alarm/alarmTypeTree"; - } - - @RequestMapping("/getAlarmTypesJson.do") - public String getAlarmTypesJson(HttpServletRequest request,Model model){ - List list = alarmTypeService.selectListByWhere - ("where 1=1 and unitid='"+request.getParameter("unitid") - +"' order by id"); - String json = alarmTypeService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showAlarmTypeAdd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - AlarmType alarmType= alarmTypeService.selectById(pid); - model.addAttribute("pname",alarmType.getType()); - } - return "alarm/alarmTypeAdd"; - } - - @RequestMapping("/showAlarmType4Select.do") - public String showAlarmType4Select(HttpServletRequest request,Model model){ - return "alarm/alarmType4Select"; - } - - @RequestMapping("/saveAlarm.do") - public String saveAlarm(HttpServletRequest request,Model model, - @ModelAttribute("alarmType") AlarmType alarmType){ - alarmType.setId(CommUtil.getUUID()); - alarmType.setUnitid(request.getParameter("unitId")); - if (alarmType.getPid()==null || alarmType.getPid().isEmpty()) { - alarmType.setPid("-1"); - } - int result = this.alarmTypeService.save(alarmType); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/showAlarmTypeEdit.do") - public String showAlarmTypeEdit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - AlarmType alarmType = alarmTypeService.selectById(id); - if(alarmTypeService.selectById(alarmType.getPid())!=null) - alarmType.set_pname(alarmTypeService.selectById(alarmType.getPid()).getType()); - model.addAttribute("alarmType",alarmType ); - if(alarmType.getOperaters() != null && alarmType.getOperaters().size()>0){ - String users = ""; - for(int i=0;i list = alarmTypeService.selectListByWhere("where pid = '" - +alarmType.getId()+"'"); - if(list != null && list.size()>0){ - msg = "请先删除子类型"; - }else{ - result = this.alarmTypeService.deleteById(alarmType.getId()); - if(result>0){ - - }else{ - msg="删除失败"; - } - } - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return "result"; - } -} diff --git a/src/com/sipai/controller/alarm/ProAlarmBaseTextController.java b/src/com/sipai/controller/alarm/ProAlarmBaseTextController.java deleted file mode 100644 index d1615db2..00000000 --- a/src/com/sipai/controller/alarm/ProAlarmBaseTextController.java +++ /dev/null @@ -1,333 +0,0 @@ -package com.sipai.controller.alarm; - -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.scada.ProAlarmBaseText; -import com.sipai.entity.user.User; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.service.scada.ProAlarmBaseTextService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/alarm/proAlarmBaseText") -public class ProAlarmBaseTextController { - @Resource - private ProAlarmBaseTextService proAlarmBaseTextService; - @Resource - private DecisionExpertBaseService decisionExpertBaseService; - @Resource - private ProAlarmService proAlarmService; - - @RequestMapping("/showList.do") - public String showProAlarmBaseTextEdit(HttpServletRequest request, Model model) { - - return "alarm/proAlarmBaseTextList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (!request.getParameter("sdt").equals("") && request.getParameter("sdt").length() > 0 && !request.getParameter("edt").equals("") && request.getParameter("edt").length() > 0) { - wherestr += " and insdt>='" + request.getParameter("sdt") + "' and insdt<='" + request.getParameter("edt") + "' "; - } - if (!request.getParameter("zdType").equals("") && request.getParameter("zdType").length() > 0) { - wherestr += " and decisionExpertBase_pid='" + request.getParameter("zdType") + "' "; - } - if (!request.getParameter("adoptSt").equals("") && request.getParameter("adoptSt").length() > 0) { - String adoptSt = request.getParameter("adoptSt"); - if (ProAlarmBaseText.AdoptSt_True.equals(adoptSt)) { - wherestr += " and adopt_st='" + adoptSt + "' "; - } else { - wherestr += " and adopt_st is null "; - } - } - - PageHelper.startPage(page, rows); - List list = this.proAlarmBaseTextService.selectListByWhere2(unitId, wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/downOrder.do") - public String downOrder(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); - - ProAlarmBaseText proAlarmBaseText = this.proAlarmBaseTextService.selectById(unitId, id); - proAlarmBaseText.setAdoptSt(ProAlarmBaseText.AdoptSt_True); - proAlarmBaseText.setAdopter(cu.getId()); - proAlarmBaseText.setAdoptionTime(CommUtil.nowDate()); - - int result = this.proAlarmBaseTextService.update(unitId, proAlarmBaseText); - - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/getStatisticalData.do") - public String getStatisticalData(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("statisticalDate"); - - List dlist = this.decisionExpertBaseService.selectListByWhere(" where unitId='" + unitId + "' and pid='-1' "); - - JSONArray jsonArray = new JSONArray(); - if (dlist != null && dlist.size() > 0) { - for (DecisionExpertBase decisionExpertBase : - dlist) { - JSONObject jsonObject = new JSONObject(); - String name = decisionExpertBase.getName(); - List pTrueNumList = this.proAlarmBaseTextService.selectCountByWhere(unitId, " where decisionExpertBase_pid='" + decisionExpertBase.getId() + "' and adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' and datediff(year,insdt,'" + date + "')=0 "); - List pFalseNumList = this.proAlarmBaseTextService.selectCountByWhere(unitId, " where decisionExpertBase_pid='" + decisionExpertBase.getId() + "' and (adopt_st='" + ProAlarmBaseText.AdoptSt_False + "' or adopt_st is null) and datediff(year,insdt,'" + date + "')=0 "); - - int trueNum = 0; - int falseNum = 0; - - if (pTrueNumList != null && pTrueNumList.size() > 0) { - trueNum = pTrueNumList.get(0).getNum(); - } - if (pFalseNumList != null && pFalseNumList.size() > 0) { - falseNum = pFalseNumList.get(0).getNum(); - } - - jsonObject.put("name", name); - jsonObject.put("trueNum", trueNum); - jsonObject.put("falseNum", falseNum); - jsonObject.put("totalNum", trueNum + falseNum); - - jsonArray.add(jsonObject); - } - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - //月数据 泰和模型用 - @RequestMapping("/getStatisticalDataForTH.do") - public String getStatisticalDataForTH(HttpServletRequest request, Model model) { - try { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("statisticalDate"); - String pid = request.getParameter("pid"); - -// String sdt = CommUtil.subplus(date, "-12", "month"); -// String edt = CommUtil.subplus(date, "1", "month"); - String sdt = date.substring(0, 4) + "-01-01"; - String edt = CommUtil.subplus(sdt, "1", "year"); - - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - //决策信息 - List pTrueNumList = this.proAlarmBaseTextService.selectCountByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' and datediff(month,insdt,'" + date + "')=0"); - List pFalseNumList = this.proAlarmBaseTextService.selectCountByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and (adopt_st='" + ProAlarmBaseText.AdoptSt_False + "' or adopt_st is null) and datediff(month,insdt,'" + date + "')=0"); - - List pTrueNumList2 = this.proAlarmBaseTextService.selectListByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and datediff(month,insdt,'" + date + "')=0 order by insdt desc"); - - int trueNum = 0; - int falseNum = 0; - - if (pTrueNumList != null && pTrueNumList.size() > 0) { - trueNum = pTrueNumList.get(0).getNum(); - } - - if (pTrueNumList2 != null && pTrueNumList2.size() > 0) { - jsonObject.put("firstTrueContent", pTrueNumList2.get(0).getDecisionexpertbasetext()); - jsonObject.put("firstTrueTime", pTrueNumList2.get(0).getInsdt().substring(0, 16)); - jsonObject.put("firstTrueSt", pTrueNumList2.get(0).getAdoptSt()); - } else { - jsonObject.put("firstTrueContent", "-"); - jsonObject.put("firstTrueTime", "-"); - jsonObject.put("firstTrueSt", "-"); - } - - if (pFalseNumList != null && pFalseNumList.size() > 0) { - falseNum = pFalseNumList.get(0).getNum(); - } - -// jsonObject.put("name", name); - jsonObject.put("trueNum", trueNum); - jsonObject.put("falseNum", falseNum); - jsonObject.put("totalNum", trueNum + falseNum); - - //报警信息 - List deList = this.decisionExpertBaseService.selectListByWhere(" where pid='" + pid + "' "); - String mpids = ""; - if (deList != null && deList.size() > 0) { - for (DecisionExpertBase decisionExpertBase : - deList) { - mpids += decisionExpertBase.getMpid() + ","; - } - } - mpids = mpids.replace(",", "','"); - - String curveSdt = CommUtil.subplus(date,"-11","month"); - String curveEdt = CommUtil.subplus(date,"1","month"); - - String[] yearM = new String[12]; - for (int i = 0; i < 12; i++) { - yearM[i] = CommUtil.subplus(curveSdt, String.valueOf(i), "month").substring(5, 7); - } - jsonObject.put("curve_xData", yearM); - - List trueNumList = this.proAlarmBaseTextService.selectNumFromDateByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' and (insdt>='" + curveSdt + "' and insdt<'" + curveEdt + "') ", "7"); - List totalNumList = this.proAlarmBaseTextService.selectNumFromDateByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and (adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' or adopt_st='" + ProAlarmBaseText.AdoptSt_False + "') and (insdt>='" + curveSdt + "' and insdt<'" + curveEdt + "') ", "7"); - - JSONArray trueNum_1_Json = new JSONArray(); - if (trueNumList != null && trueNumList.size() > 0) { - for (ProAlarmBaseText proAlarmBaseText : - trueNumList) { - String[] dataValue = new String[2]; - dataValue[0] = proAlarmBaseText.get_date().substring(5, 7); - dataValue[1] = proAlarmBaseText.getNum() + ""; - trueNum_1_Json.add(dataValue); - } - } - jsonObject.put("trueNum_his", trueNum_1_Json); - - JSONArray totalNum_1_Json = new JSONArray(); - if (totalNumList != null && totalNumList.size() > 0) { - for (ProAlarmBaseText proAlarmBaseText : - totalNumList) { - String[] dataValue = new String[2]; - dataValue[0] = proAlarmBaseText.get_date().substring(5, 7); - dataValue[1] = proAlarmBaseText.getNum() + ""; - totalNum_1_Json.add(dataValue); - } - } - jsonObject.put("totalNum_his", totalNum_1_Json); - - jsonArray.add(jsonObject); - - model.addAttribute("result", jsonArray); - } catch (Exception e) { - System.out.println(e); - } - - return "result"; - } - - @RequestMapping("/getStatisticalDataForTH2.do") - public String getStatisticalDataForTH2(HttpServletRequest request, Model model) { - try { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("statisticalDate"); - String pid = request.getParameter("pid"); - - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - //决策信息 - List pTrueNumList = this.proAlarmBaseTextService.selectCountByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' and datediff(month,insdt,'" + date + "')=0"); - List pFalseNumList = this.proAlarmBaseTextService.selectCountByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and (adopt_st='" + ProAlarmBaseText.AdoptSt_False + "' or adopt_st is null) and datediff(month,insdt,'" + date + "')=0"); - - List pTrueNumList2 = this.proAlarmBaseTextService.selectListByWhere(unitId, " where decisionExpertBase_pid='" + pid + "' and adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' and datediff(month,insdt,'" + date + "')=0 order by insdt desc"); - - int trueNum = 0; - int falseNum = 0; - - if (pTrueNumList != null && pTrueNumList.size() > 0) { - trueNum = pTrueNumList.get(0).getNum(); - } - - if (pTrueNumList2 != null && pTrueNumList2.size() > 0) { - jsonObject.put("firstTrueContent", pTrueNumList2.get(0).getDecisionexpertbasetext()); - jsonObject.put("firstTrueTime", pTrueNumList2.get(0).getInsdt().substring(0, 16)); - } else { - jsonObject.put("firstTrueContent", "-"); - jsonObject.put("firstTrueTime", "-"); - } - - if (pFalseNumList != null && pFalseNumList.size() > 0) { - falseNum = pFalseNumList.get(0).getNum(); - } - - jsonObject.put("trueNum", trueNum); - jsonObject.put("falseNum", falseNum); - jsonObject.put("totalNum", trueNum + falseNum); - - - jsonArray.add(jsonObject); - - model.addAttribute("result", jsonArray); - } catch (Exception e) { - System.out.println(e); - } - - return "result"; - } - - @RequestMapping("/getBarData.do") - public String getBarData(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("statisticalDate"); - - List pTrueNumList = this.proAlarmBaseTextService.selectNumFromDateByWhere(unitId, " where adopt_st='" + ProAlarmBaseText.AdoptSt_True + "' and datediff(year,insdt,'" + date + "')=0 ", "7"); - List pTotalNumList = this.proAlarmBaseTextService.selectNumFromDateByWhere(unitId, " where datediff(year,insdt,'" + date + "')=0 ", "7"); - - JSONArray trueMainJsonArray = new JSONArray(); - for (ProAlarmBaseText pTrueNum : - pTrueNumList) { - JSONArray trueJsonArray = new JSONArray(); - trueJsonArray.add(pTrueNum.get_date().substring(5, 7)); - trueJsonArray.add(pTrueNum.getNum()); - trueMainJsonArray.add(trueJsonArray); - } - - JSONArray totalMainJsonArray = new JSONArray(); - for (ProAlarmBaseText pTotalNum : - pTotalNumList) { - JSONArray totalJsonArray = new JSONArray(); - totalJsonArray.add(pTotalNum.get_date().substring(5, 7)); - totalJsonArray.add(pTotalNum.getNum()); - totalMainJsonArray.add(totalJsonArray); - } - - JSONArray mainJsonArray = new JSONArray(); - - mainJsonArray.add(trueMainJsonArray); - mainJsonArray.add(totalMainJsonArray); - - model.addAttribute("result", mainJsonArray); - return "result"; - } - -} diff --git a/src/com/sipai/controller/alarm/ProAlarmController.java b/src/com/sipai/controller/alarm/ProAlarmController.java deleted file mode 100644 index 399bcb29..00000000 --- a/src/com/sipai/controller/alarm/ProAlarmController.java +++ /dev/null @@ -1,569 +0,0 @@ -package com.sipai.controller.alarm; - - -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.alarm.*; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.XServer; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Unit; -import com.sipai.entity.work.CameraFile; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.alarm.AlarmSubscribeService; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.CameraFileService; -import com.sipai.tools.MinioProp; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.eclipse.paho.client.mqttv3.MqttClient; -import org.eclipse.paho.client.mqttv3.MqttException; -import org.eclipse.paho.client.mqttv3.MqttMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.msg.MsgService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.Mqtt; -import com.sipai.tools.MqttUtil; - -@Controller -@RequestMapping("/alarm/proAlarm") -public class ProAlarmController { - @Resource - private ProAlarmService proAlarmService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private CompanyService companyService; - @Resource - private MsgService msgService; - @Resource - private AlarmInformationService alarmInformationService; - @Resource - private UserService userService; - @Resource - private XServerService xServerService; - @Resource - private AlarmSubscribeService alarmSubscribeService; - @Resource - private AlarmPointService alarmPointService; - @Resource - private CameraFileService cameraFileService; - @Resource - private MPointService mPointService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("AlarmMoldCodeEnum", AlarmMoldCodeEnum.getJsonString2()); - model.addAttribute("AlarmLevelsCodeEnum", AlarmLevelsCodeEnum.getJsonString()); - model.addAttribute("userName", cu.getCaption()); -// proAlarmService.topAlarmNumC(request, "SK_FF_FT202_V_PV", ProAlarm.C_type_reduce); - return "/alarm/proAlarmList"; - } - - @RequestMapping("/doView.do") - public String doView(HttpServletRequest request, Model model) { - ProAlarm proAlarm = this.proAlarmService.selectById(request.getParameter("unitId"), request.getParameter("id")); - if (proAlarm != null) { - proAlarm.setAlarmTypeName(AlarmMoldCodeEnum.getName(proAlarm.getAlarmType())); - proAlarm.setAlarmLevelName(AlarmLevelsCodeEnum.getName(proAlarm.getAlarmLevel())); - User cuser = this.userService.getUserById(proAlarm.getConfirmerid()); - if (cuser != null) { - proAlarm.setConfirmerName(cuser.getCaption()); - } - - String diffTime = ""; - if (proAlarm.getAlarmTime() != null && proAlarm.getLastAlarmTime() != null) { - String alarmTime = proAlarm.getAlarmTime(); - diffTime = CommUtil.getDiffTimeEndMin(proAlarm.getLastAlarmTime(), alarmTime); - } - proAlarm.setDuration(diffTime); - - if (proAlarm.getAlarmTime() != null) { - proAlarm.setAlarmTime(proAlarm.getAlarmTime().substring(0, 16)); - } - if (proAlarm.getConfirmTime() != null) { - proAlarm.setConfirmTime(proAlarm.getConfirmTime().substring(0, 16)); - } - - MPoint mPoint = this.mPointService.selectById(request.getParameter("unitId"), proAlarm.getPointCode()); - if (mPoint != null) { - proAlarm.setmPoint(mPoint); - String describe = proAlarm.getDescribe(); - - String alarmLine = ""; - if (describe.indexOf("上限") > 0) { - alarmLine = CommUtil.formatMPointValue(mPoint.getAlarmmax(), mPoint.getNumtail(), mPoint.getRate()).toPlainString(); - } else if (describe.indexOf("上极限") > 0) { - alarmLine = CommUtil.formatMPointValue(mPoint.getHalarmmax(), mPoint.getNumtail(), mPoint.getRate()).toPlainString(); - } else if (describe.indexOf("下限") > 0) { - alarmLine = CommUtil.formatMPointValue(mPoint.getAlarmmin(), mPoint.getNumtail(), mPoint.getRate()).toPlainString(); - } else if (describe.indexOf("下极限") > 0) { - alarmLine = CommUtil.formatMPointValue(mPoint.getLalarmmin(), mPoint.getNumtail(), mPoint.getRate()).toPlainString(); - } - - proAlarm.setAlarmLine(alarmLine); - } - - - } - model.addAttribute("proAlarm", proAlarm); - return "/alarm/proAlarmView"; - } - - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String sort = " alarm_time "; - String order = " desc "; - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and alarm_time >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and alarm_time <= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("alarmlevel") != null && !request.getParameter("alarmlevel").isEmpty()) { - wherestr += " and alarm_level = '" + request.getParameter("alarmlevel") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (describe like '%" + request.getParameter("search_name") + "%' or point_name like '%" + request.getParameter("search_name") + "%' or point_code like '%" + request.getParameter("search_name") + "%') "; - } - if (request.getParameter("point_code") != null && !request.getParameter("point_code").isEmpty()) { - wherestr += " and point_code ='" + request.getParameter("point_code") + "' "; - } - if (request.getParameter("pSectionCode") != null && !request.getParameter("pSectionCode").isEmpty()) { - wherestr += " and process_section_code = '" + request.getParameter("pSectionCode") + "' "; - } - if (request.getParameter("alarmType") != null && !request.getParameter("alarmType").isEmpty()) { - wherestr += " and alarm_type = '" + request.getParameter("alarmType") + "' "; - } - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += " and status = '" + request.getParameter("status") + "' "; - } - - //获取当前人所属点 -// JSONObject jsonObject = new JSONObject(); -//// String points = ""; -// List slist = this.alarmSubscribeService.selectListByWhere(" where userid like '%" + cu.getId() + "%' "); -// for (AlarmSubscribe alarmSubscribe : -// slist) { -// String alarm_point_id = alarmSubscribe.getAlarmPointId(); -// AlarmPoint alarmPoint = this.alarmPointService.selectById(alarm_point_id); -// if (alarmPoint != null) { -// if (alarmPoint.getAlarmPoint() != null) { -// if (jsonObject.get(alarmPoint.getUnitId()) == null) { -// jsonObject.put(alarmPoint.getUnitId(), alarmPoint.getAlarmPoint()); -// } else { -// jsonObject.put(alarmPoint.getUnitId(), jsonObject.get(alarmPoint.getUnitId()) + "," + alarmPoint.getAlarmPoint()); -// } -//// points += alarmPoint.getAlarmPoint() + ","; -// } -// } -// } -// List ilist = this.alarmInformationService.selectListByWhere2(" where alarm_receivers like '%" + cu.getId() + "%' "); -// for (AlarmInformation alarmInformation : -// ilist) { -// String code = alarmInformation.getCode(); -// List plist = this.alarmPointService.selectListByWhere2(" where information_code='" + code + "' and unit_id='" + alarmInformation.getUnitId() + "' "); -// if (plist != null && plist.size() > 0) { -// for (AlarmPoint alarmPoint : -// plist) { -// if (alarmPoint.getAlarmPoint() != null) { -// if (jsonObject.get(alarmPoint.getUnitId()) == null) { -// jsonObject.put(alarmPoint.getUnitId(), alarmPoint.getAlarmPoint()); -// } else { -// jsonObject.put(alarmPoint.getUnitId(), jsonObject.get(alarmPoint.getUnitId()) + "," + alarmPoint.getAlarmPoint()); -// } -//// points += alarmPoint.getAlarmPoint() + ","; -// } -// } -// } -// } -// Iterator sIterator = jsonObject.keys(); - - JSONArray arr = new JSONArray(); - List allxServerList = this.xServerService.selectListByWhere(" where 1=1 "); - for (XServer xServer : - allxServerList) { -// if (jsonObject.get(xServer.getBizid()) != null) { -// String code_value = jsonObject.get(xServer.getBizid()).toString(); -// code_value = code_value + ",data_stop_alarm"; -// code_value = code_value.replace(",", "','"); -// List list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')" -// + orderstr); - List list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + orderstr); -// System.out.println(wherestr + " and point_code in ('" + code_value + "')"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - User cuser = this.userService.getUserById(list.get(i).getConfirmerid()); - if (cuser != null) { - list.get(i).setConfirmerName(cuser.getCaption()); - } - - JSONObject obj = new JSONObject(); - obj.put("id", list.get(i).getId()); - obj.put("pointCode", list.get(i).getPointCode()); - obj.put("pointName", list.get(i).getPointName()); - obj.put("alarmTime", list.get(i).getAlarmTime()); - obj.put("describe", list.get(i).getDescribe()); - obj.put("confirmerName", list.get(i).getConfirmerName()); - obj.put("confirmTime", list.get(i).getConfirmTime()); - obj.put("alarmTypeName", list.get(i).getAlarmTypeName()); - obj.put("status", list.get(i).getStatus()); - obj.put("bizId", list.get(i).getBizId()); - obj.put("alarmType", list.get(i).getAlarmType()); - obj.put("processSectionCode", list.get(i).getProcessSectionCode()); - obj.put("confirmContent", list.get(i).getConfirmContent()); - obj.put("alarmLevel", list.get(i).getAlarmLevel()); - - List cameraFilelist = this.cameraFileService.selectListByWhere(" where pointId='" + list.get(i).getId() + "' "); - if (cameraFilelist != null && cameraFilelist.size() > 0) { - obj.put("cameraFileSt", "true"); - String cameraIds = ""; - for (CameraFile cameraFile : - cameraFilelist) { - cameraIds += cameraFile.getMasterid() + ","; - } - obj.put("cameraIds", cameraIds); - } else { - obj.put("cameraFileSt", "false"); - } - - arr.add(obj); - } - } -// } - - } - model.addAttribute("result", arr); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarmJson.do") - public ModelAndView getAlarmJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - - String orderstr = " order by alarm_time desc"; - - String wherestr = "where 1=1 and (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "') "; - - List list = this.proAlarmService.selectListByWhere(companyId, wherestr + orderstr); - - JSONArray jsondata = new JSONArray(); - if (list != null && list.size() > 0) { - for (ProAlarm proAlarm : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("mpcode", proAlarm.getPointCode()); - jsonObject.put("mpname", proAlarm.getPointName()); - jsonObject.put("alarmTime", proAlarm.getAlarmTime()); - jsonObject.put("describe", proAlarm.getDescribe()); - if (proAlarm.getAlarmType().equals(AlarmMoldCodeEnum.LimitValue_Pro.getKey())) { - jsonObject.put("alarmTypeLv1", "超限报警"); - } else if (proAlarm.getAlarmType().equals(AlarmMoldCodeEnum.EquAbnormal_Pro.getKey())) { - jsonObject.put("alarmTypeLv1", "设备故障"); - } - if (proAlarm.getProcessSectionCode() != null && !proAlarm.getProcessSectionCode().equals("")) { - ProcessSection processSection = this.processSectionService.selectById(proAlarm.getProcessSectionCode()); - if (processSection != null) { - jsonObject.put("processSectionCode", processSection.getCode()); - } else { - jsonObject.put("processSectionCode", "-"); - } - } else { - jsonObject.put("processSectionCode", "-"); - } - - jsondata.add(jsonObject); - } - } - - model.addAttribute("result", jsondata); - return new ModelAndView("result"); - } - - @RequestMapping("/getUrgentButton.do") - public ModelAndView getUrgentButton(HttpServletRequest request, Model model) { - String status = request.getParameter("status");//0报警 2恢复 -// String alarmTime = request.getParameter("alarmTime");//报警时间 and恢复时间 - String alarmTime = CommUtil.nowDate(); -// String describe = request.getParameter("describe");//报警描述 - String pointName = request.getParameter("pointName");//报警名称 - String companyEname = request.getParameter("companyEname");//厂ename - - String describe = pointName + "于" + alarmTime.substring(0, 16) + "发生紧急报警。";//报警描述 - - List companyList = this.companyService.selectListByWhere(" where ename='" + companyEname + "' "); - if (companyList != null && companyList.size() > 0) { - String unitId = companyList.get(0).getId(); - - ProAlarm proAlarm = new ProAlarm(); - if (status.equals("0")) { - List alarmInformationList = this.alarmInformationService.selectListByWhere(" where mold_code='Urgent_Button' and unit_id='" + unitId + "' "); - if (alarmInformationList != null && alarmInformationList.size() > 0) { - String alarmReceivers = alarmInformationList.get(0).getAlarmReceivers(); - proAlarm.setId(CommUtil.getUUID()); - proAlarm.setInsdt(alarmTime); - proAlarm.setAlarmTime(alarmTime); - proAlarm.setStatus(ProAlarm.STATUS_ALARM); - proAlarm.setBizId(unitId); - proAlarm.setPointName(pointName); - proAlarm.setDescribe(describe); - proAlarm.setAlarmLevel(alarmInformationList.get(0).getLevelCode()); - proAlarm.setAlarmType("Urgent_Button"); - int inCode = this.proAlarmService.save(unitId, proAlarm); - if (inCode == 1) { - if (alarmReceivers != null && !alarmReceivers.equals("")) { - String result = this.msgService.sendNewsFromAlarm(AlarmInformationAlarmModeEnum.message.getKey(), "emp01", describe, "ALARM", alarmReceivers); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("title", "紧急报警"); - jsonObject.put("content", describe); - - String[] alarmReceiver = alarmReceivers.split(","); - for (String receiver : alarmReceiver) { - //发布mqtt - MqttUtil.publish(jsonObject, receiver); - } - } - model.addAttribute("result", "执行成功"); - } else { - model.addAttribute("result", "执行出错"); - } - } else { - model.addAttribute("result", "无配置项"); - } - - } else if (status.equals("2")) { - int inCode = this.proAlarmService.recoverAlarmByWhere(unitId, " where (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "') and point_name='" + pointName + "' ", alarmTime, "2"); - if (inCode == 1) { - model.addAttribute("result", "紧急报警恢复"); - } else { - model.addAttribute("result", "执行出错"); - } - } - - } else { - model.addAttribute("result", "无所属厂"); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/alarmConfirm.do") - public ModelAndView alarmConfirm(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String bizid = request.getParameter("bizid"); - String pointCode = request.getParameter("pointCode"); - String alarmTime = request.getParameter("alarmTime"); - String confirmContent = request.getParameter("confirmContent"); - - List list = this.proAlarmService.selectListByWhere(bizid, " where point_code='" + pointCode + "' and alarm_time='" + alarmTime + "' "); - - Result result = new Result(); - if (list != null && list.size() > 0) { - for (ProAlarm proAlarm : - list) { -// ProAlarm proAlarm = list.get(0); - proAlarm.setConfirmerid(cu.getId()); - proAlarm.setConfirmTime(CommUtil.nowDate()); - proAlarm.setStatus(ProAlarm.STATUS_ALARM_CONFIRM); - proAlarm.setConfirmContent(confirmContent); - - int code = this.proAlarmService.update(bizid, proAlarm); - - if (code == Result.SUCCESS) { - //报警数量-1 - this.proAlarmService.topAlarmNumC(request, proAlarm.getPointCode(), ProAlarm.C_type_reduce); - - result = Result.success(code); - } else { - result = Result.failed("操作失败"); - } - - } - - } - - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/getPersonalAlarmNum.do") - public ModelAndView getPersonalAlarmNum(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - JSONObject jsonObject = new JSONObject(); - String edt = CommUtil.nowDate().substring(0, 10) + " 23:59"; - String sdt = CommUtil.subplus(edt, "-30", "day").substring(0, 10) + " 00:00"; - -// String points = ""; - List slist = this.alarmSubscribeService.selectListByWhere(" where userid like '%" + userId + "%' "); - for (AlarmSubscribe alarmSubscribe : - slist) { - String alarm_point_id = alarmSubscribe.getAlarmPointId(); - AlarmPoint alarmPoint = this.alarmPointService.selectById(alarm_point_id); - if (alarmPoint != null) { - if (alarmPoint.getAlarmPoint() != null) { - if (jsonObject.get(alarmPoint.getUnitId()) == null) { - jsonObject.put(alarmPoint.getUnitId(), alarmPoint.getAlarmPoint()); - } else { - jsonObject.put(alarmPoint.getUnitId(), jsonObject.get(alarmPoint.getUnitId()) + "," + alarmPoint.getAlarmPoint()); - } -// points += alarmPoint.getAlarmPoint() + ","; - } - } - } - - List ilist = this.alarmInformationService.selectListByWhere2(" where alarm_receivers like '%" + userId + "%' "); - for (AlarmInformation alarmInformation : - ilist) { - String code = alarmInformation.getCode(); - List plist = this.alarmPointService.selectListByWhere2(" where information_code='" + code + "' and unit_id='" + alarmInformation.getUnitId() + "' "); - if (plist != null && plist.size() > 0) { - for (AlarmPoint alarmPoint : - plist) { - if (alarmPoint.getAlarmPoint() != null) { - if (jsonObject.get(alarmPoint.getUnitId()) == null) { - jsonObject.put(alarmPoint.getUnitId(), alarmPoint.getAlarmPoint()); - } else { - jsonObject.put(alarmPoint.getUnitId(), jsonObject.get(alarmPoint.getUnitId()) + "," + alarmPoint.getAlarmPoint()); - } -// points += alarmPoint.getAlarmPoint() + ","; - } - } - } - } - - int totalAlarmNum = 0; - - Iterator sIterator = jsonObject.keys(); - while (sIterator.hasNext()) { - String key = sIterator.next(); - String value = jsonObject.getString(key); - value = value + ",data_stop_alarm"; - value = value.replace(",", "','"); - - List proAlarmList = this.proAlarmService.selectCountByWhere(key, " where point_code in ('" + value + "') and status='" + ProAlarm.STATUS_ALARM + "' and alarm_time >= '" + sdt + "' and alarm_time <= '" + edt + "' "); - if (proAlarmList != null && proAlarmList.size() > 0) { - totalAlarmNum += proAlarmList.get(0).getNum(); - } - } - - model.addAttribute("result", totalAlarmNum); - return new ModelAndView("result"); - } - - - @RequestMapping("/getAlarmNum.do") - public ModelAndView getAlarmNum(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - String wherestr = "where 1=1 and (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "') and alarm_time >= '" + sdt + "' and alarm_time <= '" + edt + "' "; - - List proAlarmNum = this.proAlarmService.selectCountByWhere(unitId, wherestr); - - int totalAlarmNum = 0; - if (proAlarmNum != null && proAlarmNum.size() > 0) { - totalAlarmNum = proAlarmNum.get(0).getNum(); - } - - model.addAttribute("result", totalAlarmNum); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarmYearHis.do") - public ModelAndView getAlarmYearHis(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - String sdt = CommUtil.nowDate().substring(0, 4) + "-01-01 00:00"; - String edt = CommUtil.nowDate().substring(0, 4) + "-12-31 23:59"; - - String wherestr = "where 1=1 and (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "') and alarm_time >= '" + sdt + "' and alarm_time <= '" + edt + "' "; - - List proAlarmNum = this.proAlarmService.selectNumFromDateByWhere(unitId, wherestr, "7"); - - if (proAlarmNum != null && proAlarmNum.size() > 0) { - for (int i = 1; i < 13; i++) { - String month = String.valueOf(i); - if (month.length() == 1) { - month = "0" + month; - } - - Boolean in = false; - for (int j = 0; j < proAlarmNum.size(); j++) { - if (month.equals(proAlarmNum.get(j).get_date().substring(5, 7))) { - in = true; - } - } - - if(in){ - - }else{ - ProAlarm p = new ProAlarm(); - p.setNum(0); - p.set_date(CommUtil.nowDate().substring(0, 4)+"-"+month); - proAlarmNum.add(p); - } - - } - - } - - model.addAttribute("result", CommUtil.toJson(proAlarmNum)); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarmTopData.do") - public ModelAndView getAlarmTopData(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String topNum = request.getParameter("topNum"); - - String wherestr = "where 1=1 and (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "') and alarm_time >= '" + sdt + "' and alarm_time <= '" + edt + "' "; - - List proAlarmNum = this.proAlarmService.selectTopNumListByWhere(unitId, wherestr, "4"); - - - model.addAttribute("result", CommUtil.toJson(proAlarmNum)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/alarm/ProAlarmDataStopHisPointController.java b/src/com/sipai/controller/alarm/ProAlarmDataStopHisPointController.java deleted file mode 100644 index 5b0dbb5a..00000000 --- a/src/com/sipai/controller/alarm/ProAlarmDataStopHisPointController.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.controller.alarm; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.ProAlarmDataStopHisPoint; -import com.sipai.service.scada.ProAlarmDataStopHisPointService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping("/alarm/proAlarmDataStopHisPoint") -public class ProAlarmDataStopHisPointController { - @Resource - private ProAlarmDataStopHisPointService proAlarmDataStopHisPointService; - - @RequestMapping("/showList.do") - public String showProAlarmDataStopHisPointEdit(HttpServletRequest request,Model model){ - - return "alarm/proAlarmDataStopHisPointList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "alarmId") String alarmId, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " code "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and alarm_id='"+alarmId+"' "; - System.out.println(wherestr); - - PageHelper.startPage(page, rows); - List list = this.proAlarmDataStopHisPointService.selectListByWhere(unitId,wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/alarm/RiskPController.java b/src/com/sipai/controller/alarm/RiskPController.java deleted file mode 100644 index 20190313..00000000 --- a/src/com/sipai/controller/alarm/RiskPController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.controller.alarm; - -import com.sipai.entity.alarm.AlarmLevelsConfig; -import com.sipai.entity.alarm.RiskP; -import com.sipai.entity.base.Result; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmLevesConfigService; -import com.sipai.service.alarm.RiskPService; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("alarm/riskP") -public class RiskPController { - @Resource - private RiskPService riskPService; - @Resource - private RiskLevelService riskLevelService; - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model){ - String pid = request.getParameter("pid"); - List list = this.riskPService.selectListByWhere("where pid = '" + pid + "'"); - for (int i = 0; i < list.size(); i++) { - RiskLevel riskLevel = riskLevelService.selectById(list.get(i).getrId()); - list.get(i).setRiskLevel(riskLevel); - } - JSONArray json= JSONArray.fromObject(list); - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doSave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute RiskP riskP){ - String id = CommUtil.getUUID(); - int result = this.riskPService.save(riskP); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute RiskP riskP){ - int code = this.riskPService.update(riskP); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.riskPService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelByPid.do") - public String dodelByPid(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - Result result = new Result(); - int code = this.riskPService.deleteByWhere(pid); - if (code > 0) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/app/AppEquipmentDataController.java b/src/com/sipai/controller/app/AppEquipmentDataController.java deleted file mode 100644 index 397a34c2..00000000 --- a/src/com/sipai/controller/app/AppEquipmentDataController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.sipai.controller.app; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.app.AppDataConfigure; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.visual.CacheData; -import com.sipai.service.app.AppDataConfigureService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.visual.CacheDataService; -import com.sipai.webservice.server.work.getSSOldOPMDataServer; - -@Controller -@RequestMapping("/app/appEquipmentData") -public class AppEquipmentDataController { - @Resource - private CacheDataService cacheDataService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointService mPointService; - @Resource - private AppDataConfigureService appDataConfigureService; - - @RequestMapping("getdataForSS.do") - public String getdataForSS(HttpServletRequest request,Model model){ - String unitId=request.getParameter("bizid"); - String type=request.getParameter("type"); - - com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(); - List cList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+unitId+"' and ac.type='"+type+"' and ac.datatype='"+AppDataConfigure.type_newData+"' order by ac.morder "); - if(cList!=null&&cList.size()>0){ - for(int i=0;i hList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+unitId+"' and ac.type='"+type+"' and ac.datatype='"+AppDataConfigure.type_hisData+"' order by ac.morder "); - if(hList!=null&&hList.size()>0){ - for(int i=0;i mList=this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_"+mpid, " order by MeasureDT "); - - JSONArray mjsondata=new JSONArray(); - if(mList!=null&&mList.size()>0){ - for(int m=0;m list = this.appHomePageDataService.selectListByWhere(" where 1=1 "); - if(list!=null&&list.size()>0){ - object.put("todayyearwater", list.get(0).getTodayyearwater()); - object.put("onlinewater", list.get(0).getOnlinewater()); - object.put("waterquantity", list.get(0).getWaterquantity()); - object.put("waterrate", list.get(0).getWaterrate()); - object.put("mudvolume", list.get(0).getMudvolume()); - object.put("mudrate", list.get(0).getMudrate()); - object.put("totaleqnum", list.get(0).getTotaleqnum()); - object.put("usingeqnum", list.get(0).getUsingeqnum()); - object.put("aeq", list.get(0).getAeq()); - object.put("beq", list.get(0).getBeq()); - object.put("ceq", list.get(0).getCeq()); - object.put("eqrate", list.get(0).getEqrate()); - object.put("overhaulrate", list.get(0).getOverhaulrate()); - object.put("maintainrate", list.get(0).getMaintainrate()); - object.put("abnormalnum", list.get(0).getAbnormalnum()); - object.put("abnormaladdnum", list.get(0).getAbnormaladdnum()); - object.put("workingabnormalnum", list.get(0).getWorkingabnormalnum()); - object.put("eqabnormalnum", list.get(0).getEqabnormalnum()); - object.put("insdt", list.get(0).getInsdt()); - } - - model.addAttribute("result", object); - return "result"; - } - -// @RequestMapping("getdataForSS.do") -// public String getdataForSS(HttpServletRequest request,Model model){ -// String unitId=request.getParameter("bizid"); -// -// JSONArray jsondata=new JSONArray(); -// com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(); -// List cList=this.cacheDataService.selectListByWhere(" where unitId='"+unitId+"' and type='"+CacheData.Type_App_1+"' order by morder "); -// if(cList!=null&&cList.size()>0){ -// for(int i=0;i hList=this.cacheDataService.selectListByWhere(" where unitId='"+unitId+"' and type='"+CacheData.Type_App_2+"' order by morder "); -// if(hList!=null&&hList.size()>0){ -// for(int i=0;i mList=this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_"+mpid, " order by MeasureDT "); -// -// JSONArray mjsondata=new JSONArray(); -// if(mList!=null&&mList.size()>0){ -// for(int m=0;m cList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+unitId+"' and ac.type='"+type+"' and ac.datatype='"+AppDataConfigure.type_newData+"' order by ac.morder "); - if(cList!=null&&cList.size()>0){ - for(int i=0;i hList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+unitId+"' and ac.type='"+type+"' and ac.datatype='"+AppDataConfigure.type_hisData+"' order by ac.morder "); - if(hList!=null&&hList.size()>0){ - for(int i=0;i mList=this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_"+mpid, " where datediff(year,Measuredt,'"+CommUtil.nowDate()+"')=0 order by MeasureDT "); - - JSONArray mjsondata=new JSONArray(); - if(mList!=null&&mList.size()>0){ - for(int m=0;m0){ - for (int m = 0; m < cbizids.length; m++) { - com.alibaba.fastjson.JSONObject mainjsonObject=new com.alibaba.fastjson.JSONObject(); - JSONArray jsonarr=new JSONArray(); - - List cList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+cbizids[m]+"' and ac.type='"+type+"' and datediff(day,vc.insdt,'"+yestime+"')=0 and ac.datatype='"+AppDataConfigure.type_newData+"' order by ac.morder "); - if(cList!=null&&cList.size()>0){ - for(int i=0;i aList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+unitId+"' and ac.type='"+type+"' and ac.showName='"+name+"' and ac.datatype='"+AppDataConfigure.type_newData+"' order by ac.morder "); - if(aList!=null&&aList.size()>0){ - if(aList.get(0).getMpcode()!=null||!aList.get(0).getMpcode().equals("")){ - mpid=aList.get(0).getMpcode(); - } - } - - List mPoints = mPointService.selectListByWhere(unitId, "where (id='"+mpid+"' or MPointCode='"+mpid+"')"); - List list = mPointHistoryService - .selectListByTableAWhere(unitId, "[tb_mp_"+mpid+"]", " where datediff(month,MeasureDT,'"+date+"')=0 order by measuredt"); - - if(list!=null && list.size()>0){ - String mpname=mPoints.get(0).getParmname(); - String unit="-"; - if(mPoints.get(0).getUnit()!=null){ - unit=mPoints.get(0).getUnit(); - } - - String numTail="2"; - if(mPoints.get(0).getNumtail()!=null){ - numTail=mPoints.get(0).getNumtail(); - } - String changeDf="#0."; - for(int n=0;n list = this.appMenuitemService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - List list = this.appMenuitemService.selectListByWhere("where 1=1 " - + " order by morder"); - - String json = this.appMenuitemService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "app/appMenuitemAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value = "appMenuitem") AppMenuitem appMenuitem) throws ScriptException { - User cu = (User) request.getSession().getAttribute("cu"); - appMenuitem.setId(CommUtil.getUUID()); - int code = this.appMenuitemService.save(appMenuitem); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - AppMenuitem appMenuitem = this.appMenuitemService.selectById(id); - model.addAttribute("appMenuitem", appMenuitem); - - return "app/appMenuitemEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute(value = "appMenuitem") AppMenuitem appMenuitem) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = new Result(); - int code = this.appMenuitemService.update(appMenuitem); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.appMenuitemService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.appMenuitemService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showRoleMenu.do") - public String showRoleMenu(HttpServletRequest request, Model model, - @RequestParam(value = "roleid") String roleid) { -// List list = this.appRoleMenuService.getFinalMenuByRoleId(roleid); -// JSONArray json = JSONArray.fromObject(list); - List list = this.appRoleMenuService.selectListByWhere(" where roleID='" + roleid + "'"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("json", json); - List roles = roleService.getList("where id='" + roleid + "'"); - if (roles != null && roles.size() > 0) { - model.addAttribute("rolename", roles.get(0).getName()); - } - model.addAttribute("roleid", roleid); - return "app/appRoleMenuSelect"; - } - - @RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model, - @RequestParam String roleid) { - List list = this.appMenuitemService.selectListByWhere("where 1=1 and active='" + CommString.Active_True + "' order by morder"); - - String result = this.appMenuitemService.getTreeList(null, list); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/updateRoleMenu.do") - public String updateRoleMenu(HttpServletRequest request, Model model, - @RequestParam("menustr") String menustr, @RequestParam("roleid") String roleid) { - int result = this.appRoleMenuService.updateRoleMenu(roleid, menustr); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/sendToApp.do") - public String sendToApp(HttpServletRequest request, Model model, - @RequestParam("userId") String userId) { - String roleIds = ""; - List userRolelist = this.userRoleService.selectListByWhere(" where EmpID='" + userId + "' "); - if (userRolelist != null && userRolelist.size() > 0) { - for (UserRole userRole : - userRolelist) { - roleIds += userRole.getRoleid() + ","; - } - } - - String menuIds = ""; - if (!roleIds.equals("")) { - roleIds = roleIds.replace(",", "','"); - List appRoleMenulist = this.appRoleMenuService.selectDistinctMenuIDListByWhere(" where roleID in ('" + roleIds + "') "); - for (AppRoleMenu appRoleMenu : - appRoleMenulist) { - menuIds += appRoleMenu.getMenuid() + ","; - } - } - - List list = this.appMenuitemService.selectListByWhere("where 1=1 and active='" + CommString.Active_True + "' " - + " order by morder"); - if (list != null && list.size() > 0) { - for (AppMenuitem appMenuitem : - list) { - boolean status = menuIds.contains(appMenuitem.getId()); - if (status) { - appMenuitem.setStatus("true"); - } else { - appMenuitem.setStatus("false"); - } - } - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/app/AppProductMonitorController.java b/src/com/sipai/controller/app/AppProductMonitorController.java deleted file mode 100644 index 452a9bfc..00000000 --- a/src/com/sipai/controller/app/AppProductMonitorController.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.sipai.controller.app; - -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.scada.MPoint; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.app.AppProductMonitor; -import com.sipai.entity.app.AppProductMonitorMp; -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptDayValSet; -import com.sipai.entity.user.User; -import com.sipai.service.app.AppProductMonitorMpService; -import com.sipai.service.app.AppProductMonitorService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/app/appProductMonitor") -public class AppProductMonitorController { - @Resource - private AppProductMonitorService appProductMonitorService; - @Resource - private AppProductMonitorMpService appProductMonitorMpService; - - @RequestMapping("/showTree1.do") - public String showTree(HttpServletRequest request,Model model){ - return "/app/appProductMonitorTree"; - } - - @RequestMapping("/getTree.do") - public String getTree(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId){ - String orderstr=" order by morder asc"; - String wherestr=" where unit_id ='"+unitId+"'"; - List list = this.appProductMonitorService.selectListByWhere(wherestr+orderstr); - - JSONArray jsonArray = new JSONArray(); - for (AppProductMonitor appProductMonitor : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", appProductMonitor.getId()); - jsonObject.put("text", appProductMonitor.getName()); - jsonArray.add(jsonObject); - } - - Result success = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(success)); - return "result"; - } - - @RequestMapping("/getlist4APP.do") - public String getlist4APP(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId){ - String orderstr=" order by morder asc"; - String wherestr=" where unit_id ='"+unitId+"'"; - List list = this.appProductMonitorService.selectListByWhere(wherestr+orderstr); - - Result success = Result.success(list); - model.addAttribute("result", CommUtil.toJson(success)); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/app/appProductMonitorAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - AppProductMonitor appProductMonitor){ - User cu = (User) request.getSession().getAttribute("cu"); - appProductMonitor.setId(CommUtil.getUUID()); - appProductMonitor.setInsdt(CommUtil.nowDate()); - appProductMonitor.setInsuser(cu.getId()); - int code = this.appProductMonitorService.save(appProductMonitor); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - AppProductMonitor appProductMonitor = this.appProductMonitorService.selectById(id); - - model.addAttribute("appProductMonitor", appProductMonitor); - return "/app/appProductMonitorEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - AppProductMonitor appProductMonitor){ - int code = this.appProductMonitorService.update(appProductMonitor); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("修改失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.appProductMonitorService.deleteById(id); - this.appProductMonitorMpService.deleteByWhere("where pid = '" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getlistMp.do") - public String getlistMp(HttpServletRequest request,Model model, -// @RequestParam(value = "page") Integer page, -// @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "pid") String pid) { -// String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - String orderstr=" order by morder asc"; - String wherestr=" where pid = '"+pid+"'"; -// PageHelper.startPage(page, rows); - List list = this.appProductMonitorMpService.selectListByWhere(wherestr+orderstr); -// PageInfo pi = new PageInfo(list); - -// list = list.stream() -// .sorted(Comparator.comparing(AppProductMonitorMp::getMorder)) -// .collect(Collectors.toList()); - - JSONArray json=JSONArray.fromObject(list); -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - String result=""+json; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doimportMp.do") - public String doimportMp(HttpServletRequest request,Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "mpids") String mpids){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - String unitId = request.getParameter("unitId"); - this.appProductMonitorMpService.deleteByWhere("where pid = '"+pid+"'"); - - int num = 0; - String[] mpidArr = mpids.split(","); - if (mpids!=null&&!mpids.isEmpty()){ - for (int i = 0; i < mpidArr.length; i++) { - AppProductMonitorMp appProductMonitorMp = new AppProductMonitorMp(); - appProductMonitorMp.setId(CommUtil.getUUID()); - appProductMonitorMp.setPid(pid); - appProductMonitorMp.setMpid(mpidArr[i]); - appProductMonitorMp.setUnitId(unitId); - appProductMonitorMp.setInsuser(userId); - appProductMonitorMp.setInsdt(CommUtil.nowDate()); - appProductMonitorMp.setMorder(i); - int code = this.appProductMonitorMpService.save(appProductMonitorMp); - if(code==1){ - num++; - } - } - } - Result result = new Result(); -// if (num == mpidArr.length) { - result = Result.success(num); -// } -// else { -// result = Result.failed("导入失败"); -// } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeleteMp.do") - public String dodeleteMp(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.appProductMonitorMpService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/app/AppYesterdayMainDataController.java b/src/com/sipai/controller/app/AppYesterdayMainDataController.java deleted file mode 100644 index dd0db88f..00000000 --- a/src/com/sipai/controller/app/AppYesterdayMainDataController.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.controller.app; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.user.Unit; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.CacheDataService; -import com.sipai.tools.CommString; - -@Controller -@RequestMapping("/app/appYesterdayMainData") -public class AppYesterdayMainDataController { - @Resource - private UnitService unitService; - @Resource - private CacheDataService cacheDataService; - - @RequestMapping("getdata.do") - public String getdata(HttpServletRequest request,Model model){ - String type=request.getParameter("type"); - List ulist =this.unitService.selectListByWhere(" where (type in ('"+CommString.UNIT_TYPE_COMPANY+"','"+CommString.UNIT_TYPE_BIZ+"')) order by type desc,morder"); - String json = cacheDataService.getAPPYesterdayMainDataTreeList(null, ulist,type); - model.addAttribute("result", json); - return "result"; - } - -} diff --git a/src/com/sipai/controller/app/EquBIMController.java b/src/com/sipai/controller/app/EquBIMController.java deleted file mode 100644 index 1abd6ffc..00000000 --- a/src/com/sipai/controller/app/EquBIMController.java +++ /dev/null @@ -1,390 +0,0 @@ -package com.sipai.controller.app; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import com.alibaba.fastjson.JSONObject; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.lowagie.tools.concat_pdf; -import com.sipai.entity.command.EmergencyRecordsDetail; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.structure.StructureCardPicture; -import com.sipai.entity.structure.StructureCardPictureRoute; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.service.command.EmergencyRecordsDetailService; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.structure.StructureCardPictureRouteService; -import com.sipai.service.structure.StructureCardPictureService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping(value = "equBIM") -public class EquBIMController { - - @Resource - private StructureCardPictureService structureCardPictureService; - @Resource - private StructureCardPictureRouteService structureCardPictureRouteService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private EmergencyRecordsDetailService emergencyRecordsDetailService; - @Resource - private MPointService mPointService; - - /** - * 获取相应构筑物下的巡检路线,给同济 - * - * @param request - * @param model - * @return - */ - @RequestMapping("getStructureCardPictureRoute.do") - public String getPatrolPoints(HttpServletRequest request, Model model) { - //拿到构筑物id - String structureId = request.getParameter("structureId"); - //拿到type - String type = request.getParameter("type"); - Map InspectionDatas = new HashMap<>(); - //根据type=(line 或 area)查有多少个底图的list - //查这个构筑物下有多少底图 - if (structureId != null && !structureId.equals("") && !structureId.equals("*")) { - if (type != null && !type.equals("") && type.equals("line")) { - //查询巡检路线 - List structureCardPictures = this.structureCardPictureService.selectListByWhere("where 1=1 and structure_id = '" + structureId + "' and type = '" + type + "' order by morder"); - if (structureCardPictures != null && structureCardPictures.size() > 0) { - List> structureCardPictureslist = new ArrayList>(); - //循环底图 - for (int i = 0; i < structureCardPictures.size(); i++) { - Map structureCardPictureMap = new HashMap<>(); - structureCardPictureMap.put("InspectionName", "Inspection_" + structureId + "_" + structureCardPictures.get(i).getFloor()); - structureCardPictureMap.put("ImageWidth", 2048); - structureCardPictureMap.put("ImageHeight", 1080); - //查询该底图下有多少巡检点 - List structureCardPictureRoutes = this.structureCardPictureRouteService.selectListByWhere("where 1=1 and structure_card_picture_id = '" + structureCardPictures.get(i).getId() + "'"); - if (structureCardPictureRoutes != null && structureCardPictureRoutes.size() > 0) { - //存每个底图下的巡检点 - List> structureCardPictureRouteslist = new ArrayList>(); - List newstructureCardPictureRoutes = this.structureCardPictureRouteService.sort(structureCardPictureRoutes); - if (newstructureCardPictureRoutes != null && newstructureCardPictureRoutes.size() > 0) { - for (int j = 0; j < newstructureCardPictureRoutes.size(); j++) { - Map structureCardPictureRouteMap = new HashMap<>(); - structureCardPictureRouteMap.put("x", newstructureCardPictureRoutes.get(j).getPosx()); - structureCardPictureRouteMap.put("y", newstructureCardPictureRoutes.get(j).getPosy()); - structureCardPictureRouteMap.put("index", j); - structureCardPictureRouteslist.add(structureCardPictureRouteMap); - } - structureCardPictureMap.put("Points", structureCardPictureRouteslist); - } - } - structureCardPictureslist.add(structureCardPictureMap); - } - InspectionDatas.put("InspectionDatas", structureCardPictureslist); - model.addAttribute("result", JSONArray.fromObject(JSONArray.fromObject(structureCardPictureslist))); - } - } else if (type != null && !type.equals("") && type.equals("area")) { - List> structureCardPictureslist = new ArrayList>(); - //查询有多少楼层 - List structureCardPictures = this.structureCardPictureService.selectListGroupByFloor("where 1=1 and structure_id = '" + structureId + "' and type = '" + type + "' "); - - if (structureCardPictures != null && structureCardPictures.size() > 0) { - //循环楼层,再查出有多少每个楼层有多少个安全区域 - for (int m = 0; m < structureCardPictures.size(); m++) { - Map structureCardPictureMap = new HashMap<>(); - structureCardPictureMap.put("InspectionName", "Inspection_" + structureId + "_" + structureCardPictures.get(m).getFloor()); - structureCardPictureMap.put("ImageWidth", 2048); - structureCardPictureMap.put("ImageHeight", 1080); - List> structureCardPictureRouteslist = new ArrayList>(); - - List structureCardPicturesFloor = this.structureCardPictureService.selectListByWhere("where 1=1 and " - + " structure_id = '" + structureId + "' and type = '" + type + "' and floor = '" + structureCardPictures.get(m).getFloor() + "' order by morder"); - - if (structureCardPicturesFloor != null && structureCardPicturesFloor.size() > 0) { - //循环每个楼层 - for (int n = 0; n < structureCardPicturesFloor.size(); n++) { - - Map structureCardPictureRouteMap = new HashMap<>(); - //找到每个安全区域的两个点 - List structureCardPictureRoutes = this.structureCardPictureRouteService.selectListByWhere( - "where 1=1 and structure_card_picture_id = '" + structureCardPicturesFloor.get(n).getId() + "'"); - if (structureCardPictureRoutes != null && structureCardPictureRoutes.size() > 0) { - List newstructureCardPictureRoutes = this.structureCardPictureRouteService.sort(structureCardPictureRoutes); - if (newstructureCardPictureRoutes != null && newstructureCardPictureRoutes.size() >= 2) { - structureCardPictureRouteMap.put("point_Max", newstructureCardPictureRoutes.get(0).getPosx().toString() + "," + newstructureCardPictureRoutes.get(0).getPosy().toString()); - structureCardPictureRouteMap.put("point_Min", newstructureCardPictureRoutes.get(1).getPosx().toString() + "," + newstructureCardPictureRoutes.get(1).getPosy().toString()); - structureCardPictureRouteMap.put("areaType", structureCardPicturesFloor.get(n).getSafeLevel()); - structureCardPictureRouteMap.put("areaNote", structureCardPicturesFloor.get(n).getSafeContent()); - structureCardPictureRouteslist.add(structureCardPictureRouteMap); - } - } - } - } - structureCardPictureMap.put("Points", structureCardPictureRouteslist); - structureCardPictureslist.add(structureCardPictureMap); - } - model.addAttribute("result", JSONArray.fromObject(JSONArray.fromObject(structureCardPictureslist))); - } - } - - - } else { - if (type != null && !type.equals("") && type.equals("line")) { - //查询巡检路线 - List structureCardPictures = this.structureCardPictureService.selectListByWhere("where 1=1 and type = '" + type + "' order by morder"); - if (structureCardPictures != null && structureCardPictures.size() > 0) { - List> structureCardPictureslist = new ArrayList>(); - //循环底图 - for (int i = 0; i < structureCardPictures.size(); i++) { - Map structureCardPictureMap = new HashMap<>(); - structureCardPictureMap.put("InspectionName", "Inspection_" + structureCardPictures.get(i).getStructureId() + "_" + structureCardPictures.get(i).getFloor()); - structureCardPictureMap.put("ImageWidth", 2048); - structureCardPictureMap.put("ImageHeight", 1080); - //查询该底图下有多少巡检点 - List structureCardPictureRoutes = this.structureCardPictureRouteService.selectListByWhere("where 1=1 and structure_card_picture_id = '" + structureCardPictures.get(i).getId() + "'"); - if (structureCardPictureRoutes != null && structureCardPictureRoutes.size() > 0) { - //存每个底图下的巡检点 - List> structureCardPictureRouteslist = new ArrayList>(); - List newstructureCardPictureRoutes = this.structureCardPictureRouteService.sort(structureCardPictureRoutes); - if (newstructureCardPictureRoutes != null && newstructureCardPictureRoutes.size() > 0) { - for (int j = 0; j < newstructureCardPictureRoutes.size(); j++) { - Map structureCardPictureRouteMap = new HashMap<>(); - structureCardPictureRouteMap.put("x", newstructureCardPictureRoutes.get(j).getPosx()); - structureCardPictureRouteMap.put("y", newstructureCardPictureRoutes.get(j).getPosy()); - structureCardPictureRouteMap.put("index", j); - structureCardPictureRouteslist.add(structureCardPictureRouteMap); - } - structureCardPictureMap.put("Points", structureCardPictureRouteslist); - } - } - structureCardPictureslist.add(structureCardPictureMap); - } - InspectionDatas.put("InspectionDatas", structureCardPictureslist); - model.addAttribute("result", JSONArray.fromObject(JSONArray.fromObject(structureCardPictureslist))); - } - } else if (type != null && !type.equals("") && type.equals("area")) { - List> structureCardPictureslist = new ArrayList>(); - - List structureCardPictureAll = this.structureCardPictureService.selectListGroupByStructureId("where 1=1 and type = '" + type + "' "); - for (int a = 0; a < structureCardPictureAll.size(); a++) { - //查询有多少楼层 - List structureCardPictures = this.structureCardPictureService.selectListGroupByFloor("where 1=1 and structure_id = '" + structureCardPictureAll.get(a).getStructureId() + "' and type = '" + type + "' "); - - if (structureCardPictures != null && structureCardPictures.size() > 0) { - //循环楼层,再查出有多少每个楼层有多少个安全区域 - for (int m = 0; m < structureCardPictures.size(); m++) { - Map structureCardPictureMap = new HashMap<>(); - structureCardPictureMap.put("InspectionName", "Inspection_" + structureCardPictureAll.get(a).getStructureId() + "_" + structureCardPictures.get(m).getFloor()); - structureCardPictureMap.put("ImageWidth", 2048); - structureCardPictureMap.put("ImageHeight", 1080); - List> structureCardPictureRouteslist = new ArrayList>(); - - List structureCardPicturesFloor = this.structureCardPictureService.selectListByWhere("where 1=1 and " - + " structure_id = '" + structureCardPictureAll.get(a).getStructureId() + "' and type = '" + type + "' and floor = '" + structureCardPictures.get(m).getFloor() + "' order by morder"); - - if (structureCardPicturesFloor != null && structureCardPicturesFloor.size() > 0) { - //循环每个楼层 - for (int n = 0; n < structureCardPicturesFloor.size(); n++) { - - Map structureCardPictureRouteMap = new HashMap<>(); - //找到每个安全区域的两个点 - List structureCardPictureRoutes = this.structureCardPictureRouteService.selectListByWhere( - "where 1=1 and structure_card_picture_id = '" + structureCardPicturesFloor.get(n).getId() + "'"); - if (structureCardPictureRoutes != null && structureCardPictureRoutes.size() > 0) { - List newstructureCardPictureRoutes = this.structureCardPictureRouteService.sort(structureCardPictureRoutes); - if (newstructureCardPictureRoutes != null && newstructureCardPictureRoutes.size() >= 2) { - structureCardPictureRouteMap.put("point_Max", newstructureCardPictureRoutes.get(0).getPosx().toString() + "," + newstructureCardPictureRoutes.get(0).getPosy().toString()); - structureCardPictureRouteMap.put("point_Min", newstructureCardPictureRoutes.get(1).getPosx().toString() + "," + newstructureCardPictureRoutes.get(1).getPosy().toString()); - structureCardPictureRouteMap.put("areaType", structureCardPicturesFloor.get(n).getSafeLevel()); - structureCardPictureRouteMap.put("areaNote", structureCardPicturesFloor.get(n).getSafeContent()); - structureCardPictureRouteslist.add(structureCardPictureRouteMap); - } - } - } - } - structureCardPictureMap.put("Points", structureCardPictureRouteslist); - structureCardPictureslist.add(structureCardPictureMap); - } - - } - } - model.addAttribute("result", JSONArray.fromObject(JSONArray.fromObject(structureCardPictureslist))); - - } - - } -// model.addAttribute("result",JSONObject.toJSONString(InspectionDatas)); - return "result"; - } - - /** - * 查看设备 - */ - @RequestMapping("/doviewForTongji.do") - public String doviewForTongji(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - if (id != null && !id.equals("") && !id.equals("*")) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - model.addAttribute("equipmentCard", equipmentCard); - if (equipmentCard != null) { - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService - .selectByEquipmentId(equipmentCard.getId()); - model.addAttribute("equipmentCardProp", equipmentCardProp); - } - - // return "equipment/equipmentCardView"; - model.addAttribute("id", id); - } - - return "equipment/equipmentCardNewViewForTongji"; - } - - /** - * 获取应急预案步骤,For BIM - * - * @param request - * @param model - * @return - */ - @RequestMapping("getEmergencyRecordsDetailJson.do") - @ResponseBody - public Object getEmergencyRecordsDetailJson(HttpServletRequest request, Model model) { - - com.alibaba.fastjson.JSONObject resultObject = new com.alibaba.fastjson.JSONObject(); - String pid = request.getParameter("pid"); //EmergencyConfigure中的pid - if (pid != null && !"".equals(pid)) { - List emergencyRecordsDetails = this.emergencyRecordsDetailService - .selectListForJson("where b.pid = '" + pid + "' and a.status = '1' order by b.ord desc,a.rank desc"); - if (emergencyRecordsDetails != null && emergencyRecordsDetails.size() > 0) { - resultObject.put("name", emergencyRecordsDetails.get(0).getContents()); - if (emergencyRecordsDetails.get(0).get_ord().equals("4") && emergencyRecordsDetails.get(0).getRank().toString().equals("1")) { - resultObject.put("step", "1.0"); - } else { - resultObject.put("step", emergencyRecordsDetails.get(0).get_ord() + "." + emergencyRecordsDetails.get(0).getRank().toString()); - } - - } else { - List emergencyRecordsDetails2 = this.emergencyRecordsDetailService - .selectListForJson("where b.pid = '" + pid + "' and a.status = '2' order by b.ord desc,a.rank desc"); - if (emergencyRecordsDetails2 != null && emergencyRecordsDetails2.size() > 0) { - resultObject.put("name", emergencyRecordsDetails2.get(0).getContents()); - if (emergencyRecordsDetails2.get(0).get_ord().equals("4") && emergencyRecordsDetails2.get(0).getRank().toString().equals("1")) { - resultObject.put("step", "1.0"); - } else { - resultObject.put("step", emergencyRecordsDetails2.get(0).get_ord() + "." + emergencyRecordsDetails2.get(0).getRank().toString()); - } - } else { - resultObject.put("name", "未开始应急预案"); - resultObject.put("step", "1.0"); - } - - } - } - return resultObject; - } - - /** - * 获取天气 - * - * @param request - * @param model - * @return - */ - @RequestMapping("getWeather.do") - @ResponseBody - public Object getWeather(HttpServletRequest request, Model model) throws IOException { - String city = "上海"; - com.alibaba.fastjson.JSONObject resultObject = com.alibaba.fastjson.JSONObject.parseObject(CommUtil.getWeather(city)); - return resultObject; - } - - @RequestMapping("getEquipmentCard.do") - public String getEquipmentCard(HttpServletRequest request, Model model) { - String bizId = request.getParameter("bizId"); - String equId = request.getParameter("equId"); - EquipmentCard equipmentCard = this.equipmentCardService.selectSimpleByEquipmentCardId(equId); - JSONArray upstreamAndDownstreamIdListArr = new JSONArray(); - JSONArray controlIdListArr = new JSONArray(); - JSONArray powerIdListArr = new JSONArray(); - JSONArray mpointListArr = new JSONArray(); - String controlIds = equipmentCard.getControlId(); - if (controlIds != null && controlIds.length() > 0) { - String[] controlIdList = controlIds.split(","); - if (controlIdList != null && controlIdList.length > 0) { - for (int i = 0; i < controlIdList.length; i++) { - net.sf.json.JSONObject obj = new net.sf.json.JSONObject(); - EquipmentCard equipmentCard2 = this.equipmentCardService.selectSimpleListById(controlIdList[i]); - if (equipmentCard2 != null) { - obj.put("equipmentID", equipmentCard2.getEquipmentcardid()); - obj.put("equipmentName", equipmentCard2.getEquipmentname()); - } else { - obj.put("equipmentID", controlIdList[i]); - obj.put("equipmentName", "未查到对应设备"); - } - controlIdListArr.add(obj); - } - } - } - String powerIds = equipmentCard.getPowerId(); - if (powerIds != null && powerIds.length() > 0) { - String[] powerIdList = powerIds.split(","); - if (powerIdList != null && powerIdList.length > 0) { - for (int i = 0; i < powerIdList.length; i++) { - net.sf.json.JSONObject obj = new net.sf.json.JSONObject(); - EquipmentCard equipmentCard2 = this.equipmentCardService.selectSimpleListById(powerIdList[i]); - if (equipmentCard2 != null) { - obj.put("equipmentID", equipmentCard2.getEquipmentcardid()); - obj.put("equipmentName", equipmentCard2.getEquipmentname()); - } else { - obj.put("equipmentID", powerIdList[i]); - obj.put("equipmentName", "未查到对应设备"); - } - powerIdListArr.add(obj); - } - } - } - - /** - * 设备的测量点 - * - */ - List mpoints = this.mPointService.selectListByWhere(bizId, " where equipmentId='" + equId + "'"); - if (mpoints != null && mpoints.size() > 0) { - for (MPoint group : mpoints) { - net.sf.json.JSONObject obj = new net.sf.json.JSONObject(); - obj.put("MpointID", group.getMpointid()); - obj.put("ParmName", group.getParmname()); - mpointListArr.add(obj); - } - } - net.sf.json.JSONObject json = new net.sf.json.JSONObject(); - json = net.sf.json.JSONObject.fromObject(equipmentCard); - json.put("upstreamAndDownstreamIdList", upstreamAndDownstreamIdListArr); - json.put("controlIdList", controlIdListArr); - json.put("powerIdList", powerIdListArr); - json.put("mpoints", mpointListArr); - - //System.out.println(json); - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/app/LoginController.java b/src/com/sipai/controller/app/LoginController.java deleted file mode 100644 index 0bc37095..00000000 --- a/src/com/sipai/controller/app/LoginController.java +++ /dev/null @@ -1,365 +0,0 @@ -package com.sipai.controller.app; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.BasicComponents; -import com.sipai.entity.user.User; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.tools.VerifyCodeUtils; -import lombok.SneakyThrows; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.*; -import java.net.URLEncoder; -import java.util.List; - -@Controller -@RequestMapping(value = "app") -public class LoginController { - - @Resource - private LoginService loginService; - @Resource - private UserService userService; - @Resource - private UserDetailService userDetailService; - @Resource - private UnitService unitService; - - @RequestMapping(value = "login.do", method = RequestMethod.POST) - public ModelAndView login(HttpServletRequest request, - HttpServletResponse response) { - String j_username= request.getParameter("user"); - String j_password= request.getParameter("pwd"); - User cu = new User(); - if(j_username!=null && j_password!=null){ - cu= loginService.Login(j_username, j_password); - } - if (null != cu) { - //设置cu其他信息 - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - - HttpSession currentSession = request.getSession(false); - if (null != currentSession){ - currentSession.invalidate(); - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - request.setAttribute("result", "{\"result\":\"pass\",\"re1\":" + - JSONObject.toJSONString(cu) + "}"); - /*JSONObject jsob = JSONObject.fromObject(cu); - request.setAttribute("result", "{\"result\":\"pass\",\"re1\":" + - jsob.toString() + "}"); - jsob=null;*/ - } else { - request.setAttribute("result", "{\"result\":\"no\"}"); - } - return new ModelAndView("result"); - } - - @RequestMapping(value = "nameLogin.do") - public ModelAndView nameLogin(HttpServletRequest request, - HttpServletResponse response,Model model) { - request.setAttribute("username", request.getParameter("username")); - return new ModelAndView("namelogin"); - /*String j_username= request.getParameter("username"); - List userList=userService.selectListByWhere(" where name='"+j_username+"'"); - if(userList.size() >0 && null!=userList){ - User cu = userService.getUserById(userList.get(0).getId()); - String unitId = ""; - if (null != cu) { - //设置cu其他信息 - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - if(cu.getThemeclass()==null || cu.getThemeclass().isEmpty()){ - cu.setThemeclass(CommString.Default_Theme); - } - Company company =unitService.getCompanyByUserId(cu.getId()); - if (company!=null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - }else{ - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if(companies!=null){ - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - - - String result ="{\"status\":" + true +",\"res\":"+ JSONObject.toJSONString(cu) +"}"; - JSONObject jsonObject =JSONObject.parseObject(result); - request.setAttribute("result", jsonObject); - - JSONObject jsob = JSONObject.fromObject(cu); - request.setAttribute("result", "{\"result\":\"pass\",\"re1\":" + - jsob.toString() + "}"); - jsob=null; - - HttpSession session = request.getSession(false); - if (SessionManager.isOnline(session)){ - return new ModelAndView("frameset"); - }else{ - return new ModelAndView("login"); - } - } else { - return new ModelAndView("login"); - } - }else{ - return new ModelAndView("login"); - }*/ - } - - @RequestMapping(value = "loginscadato.do") - public ModelAndView loginscadato(HttpServletRequest request, - HttpServletResponse response,Model model) { - String j_username= request.getParameter("user"); - User cu = new User(); - if(j_username!=null && !j_username.equals("")){ - cu= loginService.NameLogin(j_username); - } - if (null != cu){ - ((HttpServletRequest) request).getSession().setAttribute("cu", cu); - model.addAttribute("cu", cu); - return new ModelAndView("main"); - } - String result = "对不起,您暂时没有权限进入该系统"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 仅获取app的名称,app调用的接口 - * @param request - * @param model - * @return - */ - @RequestMapping("/getApkName.do") - public String getApkName(HttpServletRequest request,Model model){ - String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - String webName = request.getServletContext().getContextPath().replace("/", ""); - String filepath=filepathSever.replaceAll(contextPath, webName+"_APK"); - System.out.println("app下载路径::"+filepath); - File file = new File(filepath); - File[] tempList = file.listFiles(); - String vesionInfo = ""; - if(tempList!=null){ - if(tempList.length>0) { - for (int i = 0; i < tempList.length; i++) { - if (tempList[i].getName().toLowerCase().contains("apk")) { - try { - vesionInfo = tempList[i].getName(); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - } - }else{ - System.out.println("app下载路径:文件夹为空"); - } - }else{ - System.out.println("app下载路径:没有找到文件夹"); - } - String result = "{\"ApkName\":\""+vesionInfo+"\"}"; - model.addAttribute("result", result); - return "result"; - } - /** - * 获取apkurl地址 - * @param mapping - * @param form - * @param request - * @param response - * @return ActionForward - */ - @RequestMapping(value = "doScanApk.do") - public ModelAndView doScanApk(HttpServletRequest request, - HttpServletResponse response, Model model){ - String type =request.getParameter("type"); - String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - - String webName = request.getServletContext().getContextPath().replace("/", ""); - - String filepath=filepathSever.replaceAll(contextPath, webName+"_APK/"+type); - File file=new File(filepath); - File[] tempList = file.listFiles(); - if(tempList==null || tempList.length==0){ - model.addAttribute("result",""); - return new ModelAndView("result"); - } - String fileName=""; - String veisioninfo=""; - int versionOne=0; - int versionTwo=0; - for (int i = 0; i < tempList.length; i++) { - if (tempList[i].getName().toLowerCase().contains("apk")) { - //版本号 - veisioninfo=tempList[i].getName().split("-")[1]; - String[] veision = veisioninfo.split("\\."); - //判断版本号 - if(versionOne < Integer.parseInt(veision[0])){ - versionOne = Integer.parseInt(veision[0]); - versionTwo = Integer.parseInt(veision[1]); - fileName = tempList[i].getName(); - }else{ - if(versionTwo < Integer.parseInt(veision[1])){ - versionTwo = Integer.parseInt(veision[1]); - fileName = tempList[i].getName(); - } - } - } - /*System.out.println(tempList[i].getName().toString()); - if (tempList[i].getName().toLowerCase().contains("apk")) { - try { - String code=tempList[i].getName().split("-")[1]; - String name=tempList[i].getName().split("-")[2]; - veisioninfo=tempList[i].getName(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }*/ - } - - String urlstr=request.getRequestURL().substring(0, request.getRequestURL().indexOf(contextPath))+webName+"_APK/"+type+"/"; - veisioninfo=urlstr+fileName; - String result = "{\"res\":\"" + veisioninfo + "\"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - - } - - - @RequestMapping("downLoadAPP.do") - public void downLoadAPP(HttpServletRequest request,HttpServletResponse response,String path){ - File file = new File(path); - if(file.exists()){ - File[] files=file.listFiles(); - if(files.length > 0 &&!files[0].isDirectory()){ - String fileName=files[0].getName(); - String abspath=files[0].getAbsolutePath(); - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setHeader("Content-disposition", "attachment; filename=" - + URLEncoder.encode(fileName, "UTF-8")); - bis = new BufferedInputStream(new FileInputStream(abspath)); - bos = new BufferedOutputStream(response.getOutputStream()); - byte[] buff = new byte[1024]; - int bytesRead; - while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { - bos.write(buff, 0, bytesRead); - } - bos.flush(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } finally { - try { - if(null!=bis){ - bis.close(); - } - if(null!=bos){ - bos.close(); - } - } catch (Exception e) { - e.printStackTrace(); - } - - //bis = null; - //bos = null; - } - //System.out.println(abspath+"路径================"); - //System.out.println(fileName+"文件================"); - } - - } - - } - /** - * 获取ya - * @param request - * @param response - * @return ActionForward - */ - @SneakyThrows - @RequestMapping(value = "doVerifyCode.do") - public void doVerifyCode(HttpServletRequest request, - HttpServletResponse response, Model model) throws Exception { - int verCodeStrengthNum=0; - int codenumber = 4; - //生成图片 - int w = 110, h = 34; - BasicComponentsService basicComponentsService = (BasicComponentsService) SpringContextUtil.getBean("basicComponentsService"); - List verCodeStrengthList = basicComponentsService.selectListByWhere("where active='1' and code like '%login-verCode-strength%' order by morder"); - if (verCodeStrengthList != null && verCodeStrengthList.size() > 0) { - BasicComponents verCodeStrength = verCodeStrengthList.get(0); - if(verCodeStrength!=null && verCodeStrength.getBasicConfigure()!=null && !verCodeStrength.getBasicConfigure().getType().isEmpty()){ - verCodeStrengthNum = Integer.parseInt(verCodeStrength.getBasicConfigure().getType()); - } - } - //生成随机字串 - String verifyCode = ""; - if(verCodeStrengthNum==0){ - codenumber=4; - w = 100; - h = 34; - verifyCode = VerifyCodeUtils.generateVerifyCode(codenumber); - }else{ - codenumber=6; - w = 110; - h = 34; - verifyCode = VerifyCodeUtils.generateVerifyAllCode(codenumber); - } - String res = null; - try { - res = CommUtil.encryptAES(verifyCode,"base64"); - } catch (Exception e) { - e.printStackTrace(); - } - //存入会话session - HttpSession session = request.getSession(true); - //删除以前的 - session.removeAttribute("verCode"); - session.setAttribute("verCode", verifyCode.toLowerCase()); - String result = "{\"res\":\"" + res + "\"}"; - model.addAttribute("result",result); - Object sessionverCode = session.getAttribute("verCode"); - System.out.println("sessionNewVerCode:"+sessionverCode.toString()); - - response.setContentType("text/html"); - request.setCharacterEncoding("UTF-8"); - response.setCharacterEncoding("utf-8"); - PrintWriter out = response.getWriter(); - out.write(result); - out.flush(); - out.close(); - } -} diff --git a/src/com/sipai/controller/app/MsgAppController.java b/src/com/sipai/controller/app/MsgAppController.java deleted file mode 100644 index a757ca0c..00000000 --- a/src/com/sipai/controller/app/MsgAppController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.app; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.user.User; -import com.sipai.service.base.LoginService; -import com.sipai.service.msg.MsgRecvService; -import com.sipai.service.msg.MsgRecvServiceImpl; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping(value = "msgapp") -public class MsgAppController { - - @Resource - private LoginService loginService; - @Resource - private MsgRecvServiceImpl msgrecvService; - @Resource - private MsgServiceImpl msgService; - @Resource - private MsgTypeService msgtypeService; - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model) { - String j_username= request.getParameter("username"); - String j_password= request.getParameter("pwd"); - User cu = new User(); - if(j_username!=null && j_password!=null){ - cu= loginService.Login(j_username, j_password); - } - if(cu==null){ - model.addAttribute("result",""); - return new ModelAndView("result"); - } - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("mrecv")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("mrecv")){ - sort = " V.status "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " T.name "; - }else{ - sort = " M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("M.insuser", "msg/getMsgrecv.do", cu); - wherestr+=" and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+cu.getId()+"' "; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - - - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgrecv(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result1="{\"pi\":[{\"pageNum\":\""+page.getPageNum()+"\",\"pageCount\":\""+page.getPages()+"\"}],\"re1\":"+json+"}"; - String result="{\"total\":"+page.getTotal()+",\"re1\":"+json+"}"; - model.addAttribute("result",result1); - return new ModelAndView("result"); - } - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request,Model model){ - String id= request.getParameter("id"); - String setandwhere=" set delflag='TRUE' where masterid='"+id+"'"; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - if (result==1) { //由于触发器的存在 ,有时候更新成功返回也为0 - request.setAttribute("result", "{\"result\":\"yes\"}"); - } else { - request.setAttribute("result", "{\"result\":\"no\"}"); - } - return new ModelAndView("result"); - } - @RequestMapping("/viewMsg.do") - public ModelAndView viewMsg(HttpServletRequest request,Model model){ - String j_userid= request.getParameter("userid"); - String msgId = request.getParameter("id"); - String orderstr=" order by M.insdt "; - String wherestr="where 1=1"; - wherestr+=" and M.id='"+msgId+"' and V.delflag!='TRUE' and V.unitid='"+j_userid+"' "; - List list = this.msgService.getMsgrecv(wherestr+orderstr); - int result=0; - if(request.getParameter("send")==null){ - String readstatus=list.get(0).getMrecv().get(0).getStatus(); - if(readstatus.equals("U")){ - //第一次浏览 - String setandwhere=" set status='R' ,readtime= '"+CommUtil.nowDate()+"' where id='"+list.get(0).getMrecv().get(0).getId()+"' "; - result=this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - /**为亿美短信方式保存消息和手机短信 - * @return result 发送成功,发送失败,无权限 - */ - @RequestMapping("/saveMsgYM.do") - public String saveMsgYM(HttpServletRequest request,Model model){ - String j_username= request.getParameter("username"); - String j_password= request.getParameter("pwd"); - User cu = new User(); - if(j_username!=null && j_password!=null){ - cu= loginService.Login(j_username, j_password); - } - if(cu==null){ - model.addAttribute("result","{\"res\":\"0\"}"); - return "result"; - } - String mtypeid=""; - String result=""; - String mtypename=request.getParameter("mtypename"); - mtypeid=this.msgtypeService.getMsgType(" where name='"+mtypename+"'").get(0).getId(); - //String msgtype=request.getParameter("mtype"); - String content=request.getParameter("content"); - String recvid=request.getParameter("recvid"); - String cuid=cu.getId(); - result=this.msgService.insertMsgSend(mtypeid,content,recvid,cuid,"0"); - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/app/ProAppController.java b/src/com/sipai/controller/app/ProAppController.java deleted file mode 100644 index 17b94c1c..00000000 --- a/src/com/sipai/controller/app/ProAppController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.controller.app; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.gson.Gson; -import com.sipai.entity.document.Data; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.service.base.LoginService; -import com.sipai.service.maintenance.MaintainerService; -import com.sipai.service.msg.MsgRecvService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupManageService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping(value = "proapp") -public class ProAppController { - - @Resource - private LoginService loginService; - @Resource - private MaintainerService maintainerService; - - /** - * 获取运维商运维厂区的负责人 - **/ - @RequestMapping("getMaintainerLeaders.do") - public String getMaintainerLeaders(HttpServletRequest request, Model model) { - String companyIds = request.getParameter("companyIds"); - String maintainerId = request.getParameter("maintainerId"); - List users = this.maintainerService.getMaintainerLeaders(companyIds, maintainerId); - model.addAttribute("result", JSONArray.fromObject(users)); - return "result"; - } - - /** - * 获取运维商运维厂区的联系人 - **/ - @RequestMapping("getCompanyContacters.do") - public String getCompanyContacters(HttpServletRequest request, Model model) { - String companyIds = request.getParameter("companyIds"); - String maintainerId = request.getParameter("maintainerId"); - List users = this.maintainerService.getCompanyContacters(companyIds, maintainerId); - model.addAttribute("result", JSONArray.fromObject(users)); - return "result"; - } - - /** - * 显示水厂统计图 - */ - /*@RequestMapping("/showBizStatisticalChart.do") - public String showBizStatisticalChart(HttpServletRequest request,Model model){ - - return "maintenance/statisticalchart/bizStatisticalChart"; - }*/ - - @RequestMapping("saveWorkerPosition.do") - public String saveWorkerPosition(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - String latitude = request.getParameter("latitude"); - String longitude = request.getParameter("longitude"); - - - - model.addAttribute("result", JSONArray.fromObject(null)); - return "result"; - } -} diff --git a/src/com/sipai/controller/base/Base64ImgReplacedElementFactory.java b/src/com/sipai/controller/base/Base64ImgReplacedElementFactory.java deleted file mode 100644 index 24788fd8..00000000 --- a/src/com/sipai/controller/base/Base64ImgReplacedElementFactory.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.controller.base; - -import java.io.IOException; - - -import org.w3c.dom.Element; -import org.xhtmlrenderer.extend.FSImage; -import org.xhtmlrenderer.extend.ReplacedElement; -import org.xhtmlrenderer.extend.ReplacedElementFactory; -import org.xhtmlrenderer.extend.UserAgentCallback; -import org.xhtmlrenderer.layout.LayoutContext; -import org.xhtmlrenderer.pdf.ITextFSImage; -import org.xhtmlrenderer.pdf.ITextImageElement; -import org.xhtmlrenderer.render.BlockBox; -import org.xhtmlrenderer.simple.extend.FormSubmissionListener; - - -import com.lowagie.text.BadElementException; -import com.lowagie.text.Image; -import com.lowagie.text.pdf.codec.Base64; -/** - * 图片base64支持,把图片转换为itext自己的图片对象 - * @author Administrator - * - */ -public class Base64ImgReplacedElementFactory implements ReplacedElementFactory { - - - /** -  * 实现createReplacedElement 替换html中的Img标签 -  *  -  * @param c 上下文 -  * @param box 盒子 -  * @param uac 回调 -  * @param cssWidth css宽 -  * @param cssHeight css高 -  * @return ReplacedElement -  */ - public ReplacedElement createReplacedElement(LayoutContext c, BlockBox box, UserAgentCallback uac, - int cssWidth, int cssHeight) { - Element e = box.getElement(); - if (e == null) { - return null; - } - String nodeName = e.getNodeName(); - // 找到img标签 - if (nodeName.equals("img")) { - String attribute = e.getAttribute("src"); - FSImage fsImage; - try { - // 生成itext图像 - fsImage = buildImage(attribute, uac); - } catch (BadElementException e1) { - fsImage = null; - } catch (IOException e1) { - fsImage = null; - } - if (fsImage != null) { - // 对图像进行缩放 - if (cssWidth != -1 || cssHeight != -1) { - fsImage.scale(cssWidth, cssHeight); - } - return new ITextImageElement(fsImage); - } - } - - - return null; - } - - - /** -  * 编解码base64并生成itext图像     -  */ - protected FSImage buildImage(String srcAttr, UserAgentCallback uac) throws IOException, - BadElementException { - FSImage fiImg=null; - if (srcAttr.toLowerCase().startsWith("data:image/")) { - String base64Code= srcAttr.substring(srcAttr.indexOf("base64,") + "base64,".length(), - srcAttr.length()); - // 解码 - byte[] decodedBytes = Base64.decode(base64Code); - - - fiImg= new ITextFSImage(Image.getInstance(decodedBytes)); - } else { - fiImg= uac.getImageResource(srcAttr).getImage(); - } - return fiImg; - } - - - public void reset() {} - - @Override - public void remove(Element arg0) {} - - @Override - public void setFormSubmissionListener(FormSubmissionListener arg0) {} - -} diff --git a/src/com/sipai/controller/base/BasicComponentsController.java b/src/com/sipai/controller/base/BasicComponentsController.java deleted file mode 100644 index 5d3b55ec..00000000 --- a/src/com/sipai/controller/base/BasicComponentsController.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.sipai.controller.base; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.BasicComponents; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/base/basicComponents") -public class BasicComponentsController { - @Resource - private BasicComponentsService basicComponentsService; - @Resource - private UnitService unitService; - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/base/basicComponentsManage"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by morder asc"; - - String wherestr=" where 1=1 "; - if (request.getParameter("type")!=null && !request.getParameter("type").toString().isEmpty()) { - wherestr+= " and type ='"+request.getParameter("type").toString()+"' "; - } - PageHelper.startPage(page, rows); - List list = this.basicComponentsService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - String basicComponentsTypeId= request.getParameter("id"); - request.setAttribute("basicComponentsTypeId", basicComponentsTypeId); - return "base/basicComponentsAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String groupId = request.getParameter("id"); - BasicComponents basicComponents = this.basicComponentsService.selectById(groupId); - model.addAttribute("basicComponents", basicComponents); - if(basicComponents.getPid()!=null && basicComponents.getPid().equals("")){ - BasicComponents parent = this.basicComponentsService.selectById(basicComponents.getPid()); - if(parent != null){ - model.addAttribute("pname",parent.getName()); - }else{ - model.addAttribute("pname",""); - } - }else{ - model.addAttribute("pname",""); - } - return "base/basicComponentsEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute BasicComponents basicComponents){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - basicComponents.setId(id); - basicComponents.setInsuser(cu.getId()); - basicComponents.setInsdt(CommUtil.nowDate()); - - int result =this.basicComponentsService.save(basicComponents); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute BasicComponents basicComponents){ - int result = this.basicComponentsService.update(basicComponents); - String resstr="{\"res\":\""+result+"\",\"id\":\""+basicComponents.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.basicComponentsService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.basicComponentsService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 获取树状结构 - */ - @RequestMapping("/getBasicComponentsForTree.do") - public String getBasicComponentsForTree(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - //获取非用户节点树(公司 水厂 部门) - List list = this.basicComponentsService.selectListByWhere("order by morder"); - String json = basicComponentsService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - /** - * 获取已配置内容 - */ - @RequestMapping("/getBasicComponentsForCode.do") - public String getBasicComponentsForCode(HttpServletRequest request,Model model){ - String code = request.getParameter("code"); - com.alibaba.fastjson.JSONArray jsonArray = this.basicComponentsService.selectListByWhereAll("where active='1' and code like '%"+code+"%' "); - if(jsonArray!=null && jsonArray.size()>0){ - model.addAttribute("result", jsonArray); - }else{ - model.addAttribute("result", null); - } - return "result"; - } -} diff --git a/src/com/sipai/controller/base/BasicConfigureController.java b/src/com/sipai/controller/base/BasicConfigureController.java deleted file mode 100644 index bd529bd1..00000000 --- a/src/com/sipai/controller/base/BasicConfigureController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.controller.base; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.BasicConfigure; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.BasicConfigureService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/base/basicConfigure") -public class BasicConfigureController { - @Resource - private BasicConfigureService basicConfigureService; - @Resource - private UnitService unitService; - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/base/basicConfigureManage"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String orderstr=" order by morder asc"; - - String wherestr=" where 1=1 "; - if (request.getParameter("pid")!=null && !request.getParameter("pid").toString().isEmpty()) { - wherestr+= " and pid ='"+request.getParameter("pid").toString()+"' "; - } - if (request.getParameter("type")!=null && !request.getParameter("type").toString().isEmpty()) { - wherestr+= " and type ='"+request.getParameter("type").toString()+"' "; - } - PageHelper.startPage(page, rows); - List list = this.basicConfigureService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId= request.getParameter("bizId"); - String basicConfigureTypeId= request.getParameter("id"); - Company company = this.unitService.getCompById(companyId); - request.setAttribute("company", company); - request.setAttribute("basicConfigureTypeId", basicConfigureTypeId); - //request.setAttribute("list",list); - return "base/basicConfigureAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String groupId = request.getParameter("id"); - BasicConfigure basicConfigure = this.basicConfigureService.selectById(groupId); - model.addAttribute("basicConfigure", basicConfigure); - return "base/basicConfigureEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute BasicConfigure basicConfigure){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - basicConfigure.setId(id); - basicConfigure.setInsuser(cu.getId()); - basicConfigure.setInsdt(CommUtil.nowDate()); - - int result =this.basicConfigureService.save(basicConfigure); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute BasicConfigure basicConfigure){ - int result = this.basicConfigureService.update(basicConfigure); - String resstr="{\"res\":\""+result+"\",\"id\":\""+basicConfigure.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.basicConfigureService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.basicConfigureService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/base/BasicHomePageController.java b/src/com/sipai/controller/base/BasicHomePageController.java deleted file mode 100644 index a9d0fbc5..00000000 --- a/src/com/sipai/controller/base/BasicHomePageController.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.sipai.controller.base; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.base.Result; -import com.sipai.entity.user.Unit; -import com.sipai.service.company.CompanyService; -import com.sipai.tools.CommString; -import net.sf.json.JSONArray; - -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.BasicHomePage; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.BasicHomePageService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/base/basicHomePage") -public class BasicHomePageController { - @Resource - private BasicHomePageService basicHomePageService; - @Resource - private UnitService unitService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/base/basicHomePageManage"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String orderstr = " order by morder asc"; - - String wherestr = " where 1=1 "; - if (request.getParameter("pid") != null && !request.getParameter("pid").toString().isEmpty()) { - wherestr += " and pid ='" + request.getParameter("pid").toString() + "' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").toString().isEmpty()) { - wherestr += " and type ='" + request.getParameter("type").toString() + "' "; - } - PageHelper.startPage(page, rows); - List list = this.basicHomePageService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonByUserId.do") - public ModelAndView getJsonByUserId(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - JSONObject jsonObject = new JSONObject(); - - String userId = cu.getId(); - String unitId = request.getParameter("unitId"); -// System.out.println("unitId==="+unitId); - //分四步 1个人当前厂是否配置 2个人全局是否配置 3系统当前厂是否配置 4系统全局是否配置 - List list = this.basicHomePageService.selectListByWhere(" where userid='" + userId + "' and unitId='" + unitId + "' and type='" + BasicHomePage.Type_Personal + "' and active='" + CommString.Active_True + "' "); - if (list.size() == 0) { - list = this.basicHomePageService.selectListByWhere(" where userid='" + userId + "' and unitId='all' and type='" + BasicHomePage.Type_Personal + "' and active='" + CommString.Active_True + "' "); - if (list.size() == 0) { - list = this.basicHomePageService.selectListByWhere(" where unitId='" + unitId + "' and type='" + BasicHomePage.Type_Sys + "' and active='" + CommString.Active_True + "' "); - if (list.size() == 0) { - list = this.basicHomePageService.selectListByWhere(" where unitId='all' and type='" + BasicHomePage.Type_Sys + "' and active='" + CommString.Active_True + "' "); - } - } - } - - jsonObject.put("data", list); - jsonObject.put("userId", userId); - - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - - return "base/basicHomePageAdd"; - } - - @RequestMapping("/roleManage.do") - public String roleManage(HttpServletRequest request, Model model) { - - return "base/basicHomePageRoleManage"; - } - - @RequestMapping("/roleEdit.do") - public String roleEdit(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.basicHomePageService.selectListByWhere(" where unitId='" + unitId + "' and userid='emp01' "); - - if (list != null && list.size() > 0) { - model.addAttribute("basicHomePage", list.get(0)); - return "base/basicHomePageRoleEdit"; - } else { - return "base/basicHomePageAdd"; - } - - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.basicHomePageService.selectListByWhere(" where unitId='" + unitId + "' and userid='" + cu.getId() + "' "); - - model.addAttribute("userId", cu.getId()); - if (list != null && list.size() > 0) { - model.addAttribute("basicHomePage", list.get(0)); - return "base/basicHomePageEdit"; - } else { - return "base/basicHomePageAdd"; - } - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute BasicHomePage basicHomePage) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - basicHomePage.setId(id); - basicHomePage.setUserid(cu.getId()); - if (cu.getId().equals("emp01")) { - basicHomePage.setType(BasicHomePage.Type_Sys); - } else { - basicHomePage.setType(BasicHomePage.Type_Personal); - } - - int result = this.basicHomePageService.save(basicHomePage); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute BasicHomePage basicHomePage) { - int result = this.basicHomePageService.update(basicHomePage); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + basicHomePage.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.basicHomePageService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.basicHomePageService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取树状结构 - */ - @RequestMapping("/getBasicHomePageForTree.do") - public String getBasicHomePageForTree(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getParentCompanyChildrenBizByUnitid(unitId); - String json = basicHomePageService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showNoRole.do") - public String showNoRole(HttpServletRequest request, Model model) { - - return "base/basicHomePageNoRole"; - } -} diff --git a/src/com/sipai/controller/base/CSVFileUtil.java b/src/com/sipai/controller/base/CSVFileUtil.java deleted file mode 100644 index dd9572f0..00000000 --- a/src/com/sipai/controller/base/CSVFileUtil.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.sipai.controller.base; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; - -public class CSVFileUtil { - // CSV文件编码 - public static final String ENCODE = "GBK"; - - private FileInputStream fis = null; - private InputStreamReader isw = null; - private BufferedReader br = null; - - - public CSVFileUtil(String filename) throws Exception { - fis = new FileInputStream(filename); - isw = new InputStreamReader(fis, ENCODE); - br = new BufferedReader(isw); - } - - // ==========以下是公开方法============================= - /** - * 从CSV文件流中读取一个CSV行。 - * - * @throws Exception - */ - public String readLine() throws Exception { - - StringBuffer readLine = new StringBuffer(); - boolean bReadNext = true; - - while (bReadNext) { - // - if (readLine.length() > 0) { - readLine.append("\r\n"); - } - // 一行 - String strReadLine = br.readLine(); - - // readLine is Null - if (strReadLine == null) { - return null; - } - readLine.append(strReadLine); - - // 如果双引号是奇数的时候继续读取。考虑有换行的是情况。 - if (countChar(readLine.toString(), '"', 0) % 2 == 1) { - bReadNext = true; - } else { - bReadNext = false; - } - } - return readLine.toString(); - } - - /** - *把CSV文件的一行转换成字符串数组。指定数组长度,不够长度的部分设置为null。 - */ - public static String[] fromCSVLine(String source, int size) { - ArrayList tmpArray = fromCSVLinetoArray(source); - if (size < tmpArray.size()) { - size = tmpArray.size(); - } - String[] rtnArray = new String[size]; - tmpArray.toArray(rtnArray); - return rtnArray; - } - - /** - * 把CSV文件的一行转换成字符串数组。不指定数组长度。 - */ - public static ArrayList fromCSVLinetoArray(String source) { - if (source == null || source.length() == 0) { - return new ArrayList(); - } - int currentPosition = 0; - int maxPosition = source.length(); - int nextComma = 0; - ArrayList rtnArray = new ArrayList(); - while (currentPosition < maxPosition) { - nextComma = nextComma(source, currentPosition); - rtnArray.add(nextToken(source, currentPosition, nextComma)); - currentPosition = nextComma + 1; - if (currentPosition == maxPosition) { - rtnArray.add(""); - } - } - return rtnArray; - } - - - /** - * 把字符串类型的数组转换成一个CSV行。(输出CSV文件的时候用) - */ - public static String toCSVLine(String[] strArray) { - if (strArray == null) { - return ""; - } - StringBuffer cvsLine = new StringBuffer(); - for (int idx = 0; idx < strArray.length; idx++) { - String item = addQuote(strArray[idx]); - cvsLine.append(item); - if (strArray.length - 1 != idx) { - cvsLine.append(','); - } - } - return cvsLine.toString(); - } - - /** - * 字符串类型的List转换成一个CSV行。(输出CSV文件的时候用) - */ - public static String toCSVLine(ArrayList strArrList) { - if (strArrList == null) { - return ""; - } - String[] strArray = new String[strArrList.size()]; - for (int idx = 0; idx < strArrList.size(); idx++) { - strArray[idx] = (String) strArrList.get(idx); - } - return toCSVLine(strArray); - } - - // ==========以下是内部使用的方法============================= - /** - *计算指定文字的个数。 - * - * @param str 文字列 - * @param c 文字 - * @param start 开始位置 - * @return 个数 - */ - private int countChar(String str, char c, int start) { - int i = 0; - int index = str.indexOf(c, start); - return index == -1 ? i : countChar(str, c, index + 1) + 1; - } - - /** - * 查询下一个逗号的位置。 - * - * @param source 文字列 - * @param st 检索开始位置 - * @return 下一个逗号的位置。 - */ - private static int nextComma(String source, int st) { - int maxPosition = source.length(); - boolean inquote = false; - while (st < maxPosition) { - char ch = source.charAt(st); - if (!inquote && ch == ',') { - break; - } else if ('"' == ch) { - inquote = !inquote; - } - st++; - } - return st; - } - - /** - * 取得下一个字符串 - */ - private static String nextToken(String source, int st, int nextComma) { - StringBuffer strb = new StringBuffer(); - int next = st; - while (next < nextComma) { - char ch = source.charAt(next++); - if (ch == '"') { - if ((st + 1 < next && next < nextComma) && (source.charAt(next) == '"')) { - strb.append(ch); - next++; - } - } else { - strb.append(ch); - } - } - return strb.toString(); - } - - /** - * 在字符串的外侧加双引号。如果该字符串的内部有双引号的话,把"转换成""。 - * - * @param item 字符串 - * @return 处理过的字符串 - */ - private static String addQuote(String item) { - if (item == null || item.length() == 0) { - return "\"\""; - } - StringBuffer sb = new StringBuffer(); - sb.append('"'); - for (int idx = 0; idx < item.length(); idx++) { - char ch = item.charAt(idx); - if ('"' == ch) { - sb.append("\"\""); - } else { - sb.append(ch); - } - } - sb.append('"'); - return sb.toString(); - } - /** - * 关闭流 - */ - public void close() { - if (fis != null) { - try { - fis.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } -} diff --git a/src/com/sipai/controller/base/FileUploadHelper.java b/src/com/sipai/controller/base/FileUploadHelper.java deleted file mode 100644 index 0c672ae2..00000000 --- a/src/com/sipai/controller/base/FileUploadHelper.java +++ /dev/null @@ -1,984 +0,0 @@ -package com.sipai.controller.base; - -import java.io.*; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.report.RptInfoSet; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.report.RptInfoSetService; -import com.sipai.tools.MinioProp; -import io.minio.MinioClient; -import io.minio.errors.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.axis.encoding.Base64; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import org.xmlpull.v1.XmlPullParserException; - -@Controller -@RequestMapping(value = "/base") -public class FileUploadHelper { - - private String BaseFolderName = "UploadFile"; - @Resource - CommonFileService commonFileService; - @Autowired - private MinioProp minioProp; - @Resource - private RptInfoSetService rptInfoSetService; - @Resource - private RptCreateService rptCreateService; - - /** - * 显示上传页面 - * - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - */ - @RequestMapping(value = "fileupload.do", method = RequestMethod.GET) - public String fileupload(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterid") String masterid, - @RequestParam(value = "mappernamespace") String mappernamespace) { - model.addAttribute("mappernamespace", mappernamespace); - model.addAttribute("masterid", masterid); - return "base/fileupload"; - } - - /** - * 上传文件 - * - * @param file - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "uploadfile.do") - public ModelAndView uploadFile(@RequestParam MultipartFile[] file, HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterid") String masterid, - @RequestParam(value = "mappernamespace") String mappernamespace) throws IOException { - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName, BaseFolderName); - - User user = (User) request.getSession().getAttribute("cu"); - String result = this.commonFileService.uploadFile(realPath, mappernamespace, masterid, user, file); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 下载文件 - * - * @param request - * @param response - * @param model - * @param id - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "downloadFile.do") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - if (commfiles != null && commfiles.size() > 0) { - FileUtil.downloadFile(response, commfiles.get(0).getFilename(), commfiles.get(0).getAbspath()); - } else { - } - return null; - } - - /** - * 下载文件 用于记录和文件唯一对应的情况 - * - * @param request - * @param response - * @param model - * @param id - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "downloadFileFromMasterid.do") - public ModelAndView downloadFileFromMasterid(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + id + "'"); - if (commfiles != null && commfiles.size() > 0) { - FileUtil.downloadFile(response, commfiles.get(0).getFilename(), commfiles.get(0).getAbspath()); - } else { - } - return null; - } - - /** - * 删除文件 - * - * @param request - * @param response - * @param model - * @param id - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "deletefile.do") - public ModelAndView deletefile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "id") String id, - @RequestParam(value = "mappernamespace") String mappernamespace) throws IOException { - CommonFile commfile = this.commonFileService.selectById(id, mappernamespace); - int res = this.commonFileService.deleteById(id, mappernamespace); - if (res > 0) { - FileUtil.deleteFile(commfile.getAbspath()); - model.addAttribute("result", "删除成功"); - } - return new ModelAndView("result"); - } - - /** - * 获取主ID下的文件列表 - * - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "getFileList.do") - public ModelAndView getFileList(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterid") String masterid, - @RequestParam(value = "mappernamespace") String mappernamespace) throws IOException { - List list = this.commonFileService.selectByMasterId(masterid, mappernamespace); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/doimportExcel.do") - public String doimportExcel(HttpServletRequest request, Model model) { - return "/base/importExcel"; - } - - @RequestMapping("/doPrint.do") - public String doPrint(HttpServletRequest request, Model model) { - return "/base/print"; - } - - /** - * 显示上传页面-bootstrap-fileinput - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileinput"; - } - - /** - * 显示上传页面-minio (文件) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinputMinio.do") - public String fileinputMinio(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileinputMinio"; - } - - /** - * 显示上传页面-minio (图片) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinputMinioPic.do") - public String fileinputMinioPic(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileinputMinioPic"; - } - - /** - * 显示上传页面-minio (模板上传页面) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinputMinio_Report.do") - public String fileinputMinio_Report(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileinputMinio_Report"; - } - - /** - * 显示上传页面-minio (报表生成上传页面) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinputMinio_Report_Creat.do") - public String fileinputMinio_Report_Creat(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileinputMinio_Report_Creat"; - } - - /** - * 上传文件通用接口 - * - * @param request 请求体 - * @param dstFileName html上传组件中(input中name属性),上传文件体名称,通过此名称获取所有上传的文件map - * @param reportGroupId (特殊)上传报告所述报告组id - */ - @RequestMapping(value = "inputFile.do") - public ModelAndView inputFile(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathSever.replaceAll(contextPath, BaseFolderName + "/" + nameSpace + "/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date()) + fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int) item.getSize()); - int res = commonFileService.insertByTable(tbName, commonFile); - - if (res == 1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "inputFilemore.do") - public ModelAndView inputFilemore(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - String typeId = request.getParameter("typeId"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathSever.replaceAll(contextPath, BaseFolderName + "/" + nameSpace + "/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date()) + fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID() + "-" + typeId); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int) item.getSize()); - int res = commonFileService.insertByTable(tbName, commonFile); - - if (res == 1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取文件json - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList.do") - public ModelAndView getInputFileList(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String masterId = request.getParameter("masterId"); - //masterId="56aa5f35dac644deb7b3938a79cf3fde"; - String tbName = request.getParameter("tbName"); - //String nameSpace = request.getParameter("nameSpace"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "'"); - /* String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - contextPath=request.getSession().getServletContext().getContextPath();*/ - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 获取文件json - minio中 - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList_minio.do") - public ModelAndView getInputFileList_minio(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidPortException, InvalidEndpointException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, InternalException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String bucketName = request.getParameter("bucketName"); - String type = request.getParameter("type");//文件类型,传需要的类型,不传则查所有 (image是图片、video是视频) - - String wherestr = "where masterid='" + masterId + "'"; - if (type != null && !type.trim().equals("")) { - wherestr += " and type like '%" + type + "%'"; - } - List list = this.commonFileService.selectListByTableAWhere(tbName, wherestr); - for (CommonFile commonFile : list) { - String path = commonFile.getAbspath(); - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - - //直接读取图片地址 存在外网无法使用 后面都换成下面的流文件 - String obj = minioClient2.presignedGetObject(bucketName, path, 3600 * 24 * 7); - commonFile.setAbspath(obj); - - //解析成流文件 后面都用这个 - byte[] buffer = commonFileService.getInputStreamBytes(bucketName, path); - String base = Base64.encode(buffer); - commonFile.setStreamFile(base); - } - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 获取文件json - minio中 (List格式) - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList_minio2.do") - public ModelAndView getInputFileList_minio2(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidPortException, InvalidEndpointException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, InternalException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String bucketName = request.getParameter("bucketName"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "'"); - for (CommonFile commonFile : list) { - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - String obj = minioClient2.presignedGetObject(bucketName, commonFile.getAbspath(), 3600 * 24 * 7); - commonFile.setAbspath(obj); - } - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + 1 + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取文件json - minio中 (为前台分页) - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList_minio3.do") - public ModelAndView getInputFileList_minio3(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidPortException, InvalidEndpointException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, InternalException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String bucketName = request.getParameter("bucketName"); - - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - String whereString = " where masterid='" + masterId + "' "; - - if (sdt != null && sdt.length() > 0 && edt != null && edt.length() > 0) { - whereString += " and insdt between '" + sdt + "' and '" + edt + "' "; - } - if (request.getParameter("pointId") != null && request.getParameter("pointId").length() > 0) { - whereString += " and pointId='" + request.getParameter("pointId") + "' "; - } - - List list = this.commonFileService.selectListByTableAWhere(tbName, whereString + " order by insdt desc"); -// for (CommonFile commonFile : list) { -// MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); -// String obj = minioClient2.presignedGetObject(bucketName, commonFile.getAbspath(), 3600 * 24 * 7); -// commonFile.setAbspath(obj); -// } - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping(value = "getInputFileList2.do") - public String getInputFileList2(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidKeyException, InvalidResponseException, InternalException, InvalidPortException, InvalidEndpointException, InvalidExpiresRangeException { - String bucketName = "maintenance"; - String objectName = "2021-09-07-10-06-5811111111.png"; - MinioClient minioClient2 = new MinioClient("http://127.0.0.1:9000", "sipai", "ZAQwsx@2008"); - String obj = minioClient2.presignedGetObject(bucketName, objectName, 3600 * 24 * 7); -// System.out.println(obj); - return obj; - } - - @RequestMapping(value = "getInputFileTableList.do") - public String getInputFileTableList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - //String nameSpace = request.getParameter("nameSpace"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "' order by insdt desc"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return ("result"); - } - - @RequestMapping(value = "deleteInputFile.do") - public String deleteInputFile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - int code = 0; - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - - if (commfiles != null && commfiles.size() > 0) { - File file = new File(commfiles.get(0).getAbspath()); - if (file.exists()) { - file.delete();//删除文件 - } - code = this.commonFileService.deleteByTableAWhere(tbName, "where id='" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - //用于记录和文件唯一对应的情况 - @RequestMapping(value = "deleteInputFileFromMasterid.do") - public String deleteInputFileFromMasterid(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - int code = 0; - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + id + "'"); - - if (commfiles != null && commfiles.size() > 0) { - File file = new File(commfiles.get(0).getAbspath()); - if (file.exists()) { - file.delete();//删除文件 - } - code = this.commonFileService.deleteByTableAWhere(tbName, "where masterid='" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 保存PDF临时文档,返回文档地址 - */ - @RequestMapping("/getPDFUrl.do") - public ModelAndView getPDFUrl(HttpServletRequest request, Model model) { - - String htmlStr = request.getParameter("htmlStr"); - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName, BaseFolderName); - realPath += "TempFiles\\"; - File dir = new File(realPath); - if (!dir.exists()) { - try { - dir.mkdir(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - dir = null; - String fileName = CommUtil.getUUID() + ".pdf"; - realPath += fileName; - PDFFileUtil.html2Pdf(realPath, htmlStr); - String result = "{\"res\":\"" + realPath.substring(realPath.indexOf(BaseFolderName), realPath.length()).replace("\\", "/") + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 流程审核上传资料页面 - * - * @return - */ - @RequestMapping(value = "fileInputForProcess.do") - public String fileInputForProcess(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileInputForProcess"; - } - - @RequestMapping(value = "fileInputForProcessmore.do") - public String fileInputForProcessmore(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace, @RequestParam(value = "typeId") String typeId) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - model.addAttribute("typeId", typeId); - return "base/fileInputForProcessMore"; - } - - @RequestMapping(value = "fileInputForProcessmore1.do") - public String fileInputForProcessmore1(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace, @RequestParam(value = "typeId") String typeId) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - model.addAttribute("typeId", typeId); - return "base/fileInputForProcessMore1"; - } - - /* - * 根据id获取单个文件 - */ - @RequestMapping(value = "getInputFile4Id.do") - public ModelAndView getInputFile4Id(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String id = request.getParameter("id"); - String tbName = request.getParameter("tbName"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - - /** - * minio 文件上传 (通用) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "updateFile.do") - public ModelAndView updateFile(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String nameSpace = request.getParameter("nameSpace"); - String tbName = request.getParameter("tbName"); - if (nameSpace != null && !nameSpace.isEmpty()) { - if (tbName == null || tbName.isEmpty()) { - tbName = FileNameSpaceEnum.getTbName(nameSpace); - } - } - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - try { - int res = commonFileService.updateFile(masterId, nameSpace, tbName, item); - - if (res == 1) { - ret.put("suc", true); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 以下方法为 minio 文件相关方法 (报表上传定制功能,其他模板最好不要使用) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "updateFile_creat.do") - public ModelAndView updateFile_creat(HttpServletRequest request, HttpServletResponse response, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String nameSpace = request.getParameter("nameSpace"); - // YYJ 20201229 - String tbName = request.getParameter("tbName"); - if (nameSpace != null && !nameSpace.isEmpty()) { - if (tbName == null || tbName.isEmpty()) { - tbName = FileNameSpaceEnum.getTbName(nameSpace); - } - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - try { - String uuid = CommUtil.getUUID(); - int res = commonFileService.updateFile_creat(masterId, nameSpace, tbName, item, uuid); - if (res == 1) { - - RptInfoSet rptInfoSet = rptInfoSetService.selectById(masterId); - if (rptInfoSet != null) { - String rptname = item.getOriginalFilename(); - - RptCreate rptCreate = new RptCreate(); - rptCreate.setId(uuid); - rptCreate.setInsdt(CommUtil.nowDate()); - rptCreate.setInsuser(cu.getId()); - rptCreate.setUpsdt(CommUtil.nowDate()); - rptCreate.setUpsuser(cu.getId()); - - rptname = rptname.replace(".xls", ""); - rptname = rptname.replace(".xlsx", ""); - - rptCreate.setRptname(rptname); - rptCreate.setRptdt(CommUtil.nowDate()); - rptCreate.setUnitId(rptInfoSet.getUnitId()); - rptCreate.setRptsetId(masterId); - rptCreateService.save2(rptCreate); - } - - ret.put("suc", true); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "getInputFileListById.do") - public ModelAndView getInputFileListById(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String id = request.getParameter("id"); - String masterId = request.getParameter("masterId"); - //masterId="56aa5f35dac644deb7b3938a79cf3fde"; - String tbName = request.getParameter("tbName"); - //String nameSpace = request.getParameter("nameSpace"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - /* String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - contextPath=request.getSession().getServletContext().getContextPath();*/ - if (list != null && list.size() > 0) { - String typeString = list.get(0).getType(); - if (typeString.contains("word") || typeString.contains("sheet") || - typeString.contains("excel") || typeString.contains("presentation") || - typeString.contains("powerpoint")) { - List masterlist = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + id + "'"); - if (masterlist != null && masterlist.size() > 0) { - if (masterlist.get(0).getSize() > 0) { - list = masterlist; - } - } - } - } else { - list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "'"); - if (list != null && list.size() > 0) { - String typeString = list.get(0).getType(); - if (typeString.contains("word") || typeString.contains("sheet") || - typeString.contains("excel") || typeString.contains("presentation") || - typeString.contains("powerpoint")) { - List masterlist = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + id + "'"); - if (masterlist != null && masterlist.size() > 0) { - if (masterlist.get(0).getSize() > 0) { - list = masterlist; - } - } - } - } - } - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping(value = "showFileOnlinePic.do") - public String showFileOnlinePic(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "id") String id, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("id", id); - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - model.addAttribute("sdt", request.getParameter("sdt")); - model.addAttribute("edt", request.getParameter("edt")); - return "base/fileOnlinePic"; - } - - /** - * 为获取图片相关,用于前台切换 - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getPicSwitchJson.do") - public ModelAndView getPicSwitchJson(HttpServletRequest request, - HttpServletResponse response, Model model) { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String id = request.getParameter("id"); - - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - String whereString = " where masterid='" + masterId + "' "; - - if (sdt != null && sdt.length() > 0 && edt != null && edt.length() > 0) { - whereString += " and insdt between '" + sdt + "' and '" + edt + "' "; - } - - int nowFilePosition = -1; - List list = this.commonFileService.selectListByTableAWhere(tbName, whereString + " order by insdt desc "); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - CommonFile commonFile = list.get(i); - if (commonFile.getId().equals(id)) { - nowFilePosition = i; - } - } - } - JSONArray json = JSONArray.fromObject(list); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("firstNum", nowFilePosition); - jsonObject.put("list", json); - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - - /** - * 为获取图片相关,用于前台切换 - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getNowPicFromSwitch.do") - public ModelAndView getNowPicFromSwitch(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidPortException, InvalidEndpointException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, InternalException { - String tbName = request.getParameter("tbName"); - String bucketName = request.getParameter("bucketName"); - String id = request.getParameter("id"); - - List list = this.commonFileService.selectListByTableAWhere(tbName, " where id='" + id + "' "); - if (list != null && list.size() > 0) { - CommonFile commonFile = list.get(0); - String path = commonFile.getAbspath(); - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - - //直接读取图片地址 存在外网无法使用 后面都换成下面的流文件 - String obj = minioClient2.presignedGetObject(bucketName, path, 3600 * 24 * 7); - commonFile.setAbspath(obj); - - //解析成流文件 后面都用这个 - byte[] buffer = commonFileService.getInputStreamBytes(bucketName, path); - String base = Base64.encode(buffer); - commonFile.setStreamFile(base); - - JSONArray json = JSONArray.fromObject(commonFile); -// System.out.println(json); - model.addAttribute("result", json); - } - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/base/FreemarkerConfiguration.java b/src/com/sipai/controller/base/FreemarkerConfiguration.java deleted file mode 100644 index c0174df9..00000000 --- a/src/com/sipai/controller/base/FreemarkerConfiguration.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.controller.base; - -import freemarker.template.Configuration; - -public class FreemarkerConfiguration { - private static Configuration config = null; - - /** - * Static initialization. - * - * Initialize the configuration of Freemarker. - */ - static{ - config = new Configuration(); - config.setClassForTemplateLoading(FreemarkerConfiguration.class, "template"); - } - - public static Configuration getConfiguation(){ - return config; - } - -} diff --git a/src/com/sipai/controller/base/HtmlGenerator.java b/src/com/sipai/controller/base/HtmlGenerator.java deleted file mode 100644 index 084ecc3e..00000000 --- a/src/com/sipai/controller/base/HtmlGenerator.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.sipai.controller.base; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.StringWriter; -import java.util.Map; - -import freemarker.template.Configuration; -import freemarker.template.Template; - -public class HtmlGenerator { - /** - * Generate html string. - * - * @param template the name of freemarker teamlate. - * @param variables the data of teamlate. - * @return htmlStr - * @throws Exception - */ - public static String generate(String templateFile, Map variables) throws Exception{ - File file = new File(templateFile); - if(!file.exists()) - throw new Exception("模板文件不存在:"+templateFile); - - String templateDir = file.getParentFile().getPath(); - String templateName =file.getName(); - Configuration config = FreemarkerConfiguration.getConfiguation(); - //用于解决前端报空指针问题--> - config.setClassicCompatible(true); - config.setDirectoryForTemplateLoading(new File(templateDir)); - Template tp = config.getTemplate(templateName); - StringWriter stringWriter = new StringWriter(); - BufferedWriter writer = new BufferedWriter(stringWriter); - tp.setEncoding("UTF-8"); - tp.process(variables, writer); - String htmlStr = stringWriter.toString(); - writer.flush(); - writer.close(); - return htmlStr; - } -} diff --git a/src/com/sipai/controller/base/LoginServlet.java b/src/com/sipai/controller/base/LoginServlet.java deleted file mode 100644 index 702d3f9a..00000000 --- a/src/com/sipai/controller/base/LoginServlet.java +++ /dev/null @@ -1,680 +0,0 @@ -package com.sipai.controller.base; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.BasicComponents; -import com.sipai.entity.base.BasicConfigure; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.*; -import com.sipai.security.MyUserDetailServiceImpl; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.*; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.JwtUtil; -import com.sipai.tools.SessionManager; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.AuthenticationServiceException; -import org.springframework.security.core.context.SecurityContextImpl; -import org.springframework.security.web.WebAttributes; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping(value = "Login") -@Api(value = "Login", tags = "登录") -public class LoginServlet { - - @Resource - private LoginService loginService; - - @Autowired - private UserService userService; - - @Resource - private MenuService menuService; - - @Resource - private UserDetailService userDetailService; - - @Resource - private MyUserDetailServiceImpl myUserDetailServiceImpl; - @Resource - private UnitService unitService; - @Resource - private ExtSystemService extSystemService; - @Resource - private BasicComponentsService basicComponentsService; - - @RequestMapping(value = "login.do", method = RequestMethod.GET) - public ModelAndView login(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - String password = null; - if(session.getAttribute("password")!=null){ - password = session.getAttribute("password").toString(); - } - if (SessionManager.isOnline(session)) { - /*User cu= (User)request.getSession().getAttribute("cu"); - List list = this.menuService.getFullPower(cu.getId()); - if(list!=null &&list.size()>0){ - for(int i=list.size()-1;i>=0;i--){ - Menu menu=list.get(i); - if((menu.getType() !=null && menu.getType().equals("func")) - || (menu.getActive() !=null && menu.getActive().equals("禁用"))){ - list.remove(i); - } - } - } - model.addAttribute("list",list);*/ - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - JSONObject basicPW = basicPassword(password,cu.getId()); - String code =basicPW.get("code").toString(); - if("1".equals(code)){ - //需要跳转 - //修改密码配置信息 - JSONArray jsonArray = basicComponentsService.selectListByWhereAll("where active='1' and code like '%password%' order by morder "); - if (jsonArray != null && jsonArray.size() > 0) { - model.addAttribute("jsonArray", jsonArray); - } - if(basicPW.get("titleStr")!=null && !basicPW.get("titleStr").toString().isEmpty()){ - model.addAttribute("titleStr", basicPW.get("titleStr").toString()); - } - return new ModelAndView("forcePasswordChange"); - } - if (cu.getName().equals("admin")) { - model.addAttribute("mqttId", cu.getName() + "_web_" + CommUtil.getUUID()); - } else { - model.addAttribute("mqttId", cu.getName() + "_web"); - } - - Unit unit = this.unitService.getUserBelongingCompany(cu.getId()); - if (unit != null) { - model.addAttribute("top_user_companyId", unit.getId()); - model.addAttribute("top_user_companyType", unit.getType()); - } - model.addAttribute("top_userId", cu.getId()); - - } - return new ModelAndView("frameset"); - } - try { - //默认使用login-title、login-bottomlogo作为登录页所需代码 - JSONArray jsonArray = basicComponentsService.selectListByWhereAll("where active='1' and code like '%login%' order by morder "); - if (jsonArray != null && jsonArray.size() > 0) { - model.addAttribute("jsonArray", jsonArray); - } - } catch (Exception e) { - e.printStackTrace(); - } - return new ModelAndView("login"); - } - @ApiOperation(value = "判断密码情况", notes = "判断密码情况", httpMethod = "GET") - @ResponseBody - @RequestMapping(value = "loginCheck.do", method = RequestMethod.GET) - public ModelAndView loginCheck(HttpServletRequest request,HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - String password = null; - if(session.getAttribute("password")!=null){ - password = session.getAttribute("password").toString(); - } - User cu = (User) request.getSession().getAttribute("cu"); - JSONObject basicPW = basicPassword(password,cu.getId()); - String code =basicPW.get("code").toString(); - int passwordMaxNum =18; - int passwordMinNum =10; - List passwordMax_list = basicComponentsService.selectListByWhere("where active='1' and code like '%password-max%' order by morder"); - if (passwordMax_list != null && passwordMax_list.size() > 0) { - BasicComponents passwordMax = passwordMax_list.get(0); - passwordMaxNum = Integer.parseInt(passwordMax.getBasicConfigure().getType()); - } - List passwordMin_list = basicComponentsService.selectListByWhere("where active='1' and code like '%password-min%' order by morder"); - if (passwordMin_list != null && passwordMin_list.size() > 0) { - BasicComponents passwordMin = passwordMin_list.get(0); - passwordMinNum = Integer.parseInt(passwordMin.getBasicConfigure().getType()); - } - String result = "{\"code\":" + code + ",\"passwordMax\":\"" + passwordMaxNum + "\",\"passwordMin\":\"" + passwordMinNum + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - protected JSONObject basicPassword(String password,String userId) { - JSONObject res = new JSONObject(); - String default_password = CommUtil.generatePassword(UserCommStr.default_password); - //验证当前账号密码是否为默认密码,强制修改 - if (default_password.equals(password)) { - res.put("code", 1); - return res; - //return new ModelAndView("forcePasswordChange"); - } - //验证是否判断密码为强密码 - List passwordType_list = basicComponentsService.selectListByWhere("where active='1' and code like '%password-type%' order by morder"); - if (passwordType_list != null && passwordType_list.size() > 0) { - BasicComponents passwordTypes = passwordType_list.get(0); - String passwordType = passwordTypes.getBasicConfigure().getType(); - int passwordMaxNum =18; - int passwordMinNum =10; - List passwordMax_list = basicComponentsService.selectListByWhere("where active='1' and code like '%password-max%' order by morder"); - if (passwordMax_list != null && passwordMax_list.size() > 0) { - BasicComponents passwordMax = passwordMax_list.get(0); - passwordMaxNum = Integer.parseInt(passwordMax.getBasicConfigure().getType()); - } - List passwordMin_list = basicComponentsService.selectListByWhere("where active='1' and code like '%password-min%' order by morder"); - if (passwordMin_list != null && passwordMin_list.size() > 0) { - BasicComponents passwordMin = passwordMin_list.get(0); - passwordMinNum = Integer.parseInt(passwordMin.getBasicConfigure().getType()); - } - //首先判断是否配置了需要强密码 - if("strong".equals(passwordType)){ - //再判断是否为强密码 - if(!CommUtil.isStrongPwd(password,passwordMinNum,passwordMaxNum)){ - //不是则修改密码 - res.put("code", 1); - return res; - //return new ModelAndView("forcePasswordChange"); - } - } - } - //验证是否判断密码超时 - List basicComponents_list = basicComponentsService.selectListByWhere("where active='1' and code like '%password-overtime%' order by morder"); - if (basicComponents_list != null && basicComponents_list.size() > 0) { - BasicComponents basicComponents = basicComponents_list.get(0); - if (basicComponents != null && basicComponents.getBasicConfigure() != null) { - BasicConfigure basicConfigure = basicComponents.getBasicConfigure(); - if (basicConfigure != null) { - String initial_time = ""; - int days = 30; - //type设置强制修改密码天数 - if (basicConfigure.getType() != null && !basicConfigure.getType().isEmpty()) { - //验证是否为数字 - if (CommUtil.isNumeric(basicConfigure.getType())) { - days = Integer.parseInt(basicConfigure.getType()); - } - } - UserDetail userDetail = userDetailService.selectByUserId(userId); - if (userDetail != null) { - if (userDetail.getLastlogintime() != null - && !userDetail.getLastlogintime().isEmpty()) { - //用户附属表中Lastlogintime为初始判断时间 - initial_time = userDetail.getLastlogintime(); - } else { - if (userDetail.getInsdt() != null - && !userDetail.getInsdt().isEmpty()) { - //用户附属表中Insdt为初始判断时间 - initial_time = userDetail.getInsdt(); - } - } - } else { - //insdt设置初始时间 - if (basicConfigure.getInsdt() != null && !basicConfigure.getInsdt().isEmpty()) { - initial_time = basicConfigure.getInsdt(); - } - } - if (initial_time != null && !initial_time.isEmpty()) { - String nowDate = CommUtil.nowDate(); - int difference = CommUtil.getDays(nowDate, initial_time); - //当前时间与设置时间的差值大于强制修改密码天数,则跳转强制修改 - if (difference > days) { - res.put("titleStr", "当前账号已超过" + days + "天未修改密码,为了安全起见,请修改密码。"); - res.put("code", 1); - return res; - //return new ModelAndView("forcePasswordChange"); - } - } - } - } - } - res.put("code", 0); - return res; - } - @RequestMapping(value = "main.do", method = RequestMethod.GET) - public ModelAndView main(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt.substring(0, 4) + ""); - - return new ModelAndView("main"); - } - - //上实 -// @RequestMapping(value = "main.do", method = RequestMethod.GET) -// public ModelAndView main(HttpServletRequest request, -// HttpServletResponse response,Model model) { -// HttpSession session = request.getSession(false); -// return new ModelAndView("/work/overviewProduceGroup"); -// } - @RequestMapping(value = "main3.do", method = RequestMethod.GET) - public ModelAndView main3(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("main3"); - } - - /** - * 重庆白羊摊首页 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "mainCQBYT.do", method = RequestMethod.GET) - public ModelAndView mainCQBYT(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("main_CQBYT"); - } - - /** - * 金山首页 金山排海层级 - * sj 2021-09-17 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "main_JS_Company.do", method = RequestMethod.GET) - public ModelAndView main_JS_Company(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("main_JS_Company"); - } - - /** - * 金山首页 分厂层级 - * sj 2021-09-17 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "main_JS_Factory.do", method = RequestMethod.GET) - public ModelAndView main_JS_Factory(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("main_JS_Factory"); - } - - /** - * 淄博首页 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "mainZB.do", method = RequestMethod.GET) - public ModelAndView mainZB(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("main_zibo"); - } - - /** - * 虹桥安全首页 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "mainHQAQ.do", method = RequestMethod.GET) - public ModelAndView mainHQAQ(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("main_HQAQ"); - } - /** - * 注册页面 - */ - @RequestMapping(value = "register.do", method = RequestMethod.GET) - public ModelAndView register(HttpServletRequest request, - HttpServletResponse response, Model model) { - String unitId = request.getParameter("unitId"); - Unit unit = unitService.getUnitById(unitId); - request.setAttribute("unit", unit); - return new ModelAndView("register"); - } - - /** - * 显示所有厂区汇总信息 - */ - @RequestMapping(value = "showStatisticalInfo.do") - public ModelAndView showStatisticalInfo(HttpServletRequest request, - HttpServletResponse response, Model model) { - ExtSystem extSystem = this.extSystemService.getActiveDataManage(null); - String url = ""; - if (extSystem != null) { - url = extSystem.getUrl(); - } - url += "/proapp.do?method=getStatisticalInfo"; - Map map = new HashMap(); - String resp = com.sipai.tools.HttpUtil.sendPost(url, map); - request.setAttribute("url", extSystem.getUrl()); - //JSONObject jsonObject = JSONObject.fromObject(resp); - try { - /*JSONObject re1=jsonObject.getJSONObject("re1"); - String result="{\"total\":"+re1.get("total")+",\"rows\":"+re1.getJSONArray("rows")+"}";*/ -// System.out.println(result); - model.addAttribute("resp", resp); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("statisticalInfo"); - } - - @RequestMapping(value = "doPass.do", method = RequestMethod.GET, produces = "text/html;charset=UTF-8") - public @ResponseBody - JSONObject doPass(HttpServletRequest request, Model model) { - SecurityContextImpl securityContextImpl = (SecurityContextImpl) request - .getSession().getAttribute("SPRING_SECURITY_CONTEXT"); - String result = ""; - String unitId = ""; - if (securityContextImpl != null) { - //设置cu其他信息 - String userName = securityContextImpl.getAuthentication().getName(); - User cu = userService.getUserById(userName); - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - if (cu.getThemeclass() == null || cu.getThemeclass().isEmpty()) { - cu.setThemeclass(CommString.Default_Theme); - } - Company company = unitService.getCompanyByUserId(cu.getId()); - if (company != null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - } else { - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if (companies != null) { - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - String token = JwtUtil.sign(cu.getName(), cu.getId()); - result ="{\"status\":" + true +",\"res\":"+ JSONObject.toJSONString(cu) + - ",\"Access_Token\":\""+ token +"\"}"; - } - JSONObject jsonObject = JSONObject.parseObject(result); - return jsonObject; - } - - @RequestMapping(value = "doFail.do") - public @ResponseBody - JSONObject doFail(HttpServletRequest request, Model model) { - AuthenticationServiceException respp = (AuthenticationServiceException) request.getSession().getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION); - String messange = respp.getMessage(); - String result = "{\"status\":" + false + ",\"res\":\"" + messange + "\"}"; - return JSONObject.parseObject(result); - } - - @RequestMapping(value = "logout.do", method = RequestMethod.POST) - public ModelAndView logout(HttpServletRequest request, - HttpServletResponse response) throws UnsupportedEncodingException { - HttpSession session = request.getSession(false); - if (null != session) { - session.invalidate(); - } - return null; - } - - - @RequestMapping(value = "validate.do") - public ModelAndView validate(HttpServletRequest request, - HttpServletResponse response, - @RequestParam(value = "j_username", required = false) String j_username, - @RequestParam(value = "j_password", required = false) String j_password) { - User cu = new User(); - if (j_username != null && j_password != null) { - cu = loginService.Login(j_username, j_password); - } else { - cu = null; - } - Map map = new HashMap(); - if (null != cu) { - - //设置cu其他信息 - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - - HttpSession currentSession = request.getSession(false); - if (null != currentSession) { - currentSession.invalidate(); - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - if (CommUtil.checkFrontEnd(request)) { -// JSONObject cuId = JSONObject.fromObject(cu.getId()); - map.put("result", "{\"res\":" + true + ",\"cuId\":\"" + cu.getId() + "\"}"); - return new ModelAndView("result", map); - } - map.put("result", true); - - } else { - map.put("result", false); - } - - return new ModelAndView("result", map); - } - - private boolean checkPassword(String psw) { - boolean result = false; - String regex = "^[a-zA-Z0-9]+$"; - if (null != psw) { - result = psw.matches(regex); - } - return result; - } - - /*@RequestMapping(value = "resetPwd.do", method = RequestMethod.POST) - public ModelAndView resetPwd(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "loadNewPassword") String loadNewPassword) { - User cu = (User)request.getSession().getAttribute("cu"); - String loadOldPassword=cu.getPassword(); - - String result = ""; - if (checkPassword(loadOldPassword) && checkPassword(loadNewPassword)) { - if (loadOldPassword.equals(loadNewPassword)) { - result= "请不要与原密码相同"; - } else { - if (userService.resetpassword(cu,loadNewPassword)==1) { - result = "成功"; - } else { - result = "用户不存在或原密码错误,请重新输入"; - } - } - } else { - result= "请输入正确信息,密码只可以是字母或者数字"; - } -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - @RequestMapping("/mainPageImg.do") - public String mainPageImg(HttpServletRequest request, Model model) { - return "/fwk/mainPageImg"; - } - - @ResponseBody - @RequestMapping("/doLogin4Name.do") - public JSONObject doLogin4Name(HttpServletRequest request, Model model) { - String userName = request.getParameter("userName"); - String result = ""; - String unitId = ""; - JSONObject jsonObject = null; - //设置cu其他信息 - User cu = userService.getUserByLoginName(userName); - if (cu != null) { - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - if (cu.getThemeclass() == null || cu.getThemeclass().isEmpty()) { - cu.setThemeclass(CommString.Default_Theme); - } - Company company = unitService.getCompanyByUserId(cu.getId()); - if (company != null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - } else { - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if (companies != null) { - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - -// result ="{\"status\":" + true +",\"res\":"+ JSONObject.toJSONString(cu) +"}"; - result = "{\"status\":" + true + "}"; - jsonObject = JSONObject.parseObject(result); - } else { - result = "{\"status\":" + false + "}"; - jsonObject = JSONObject.parseObject(result); - } - return jsonObject; - } - - @ResponseBody - @RequestMapping("/doLogin4NameIn.do") - public ModelAndView doLogin4NameIn(HttpServletRequest request, Model model) { - String userName = request.getParameter("userName"); - String result = ""; - String unitId = ""; - JSONObject jsonObject = null; - //设置cu其他信息 -// User cu = userService.getUserByLoginName(userName); - User cu = new User(); - cu = loginService.NameLogin(userName); - if (cu != null) { - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - if (cu.getThemeclass() == null || cu.getThemeclass().isEmpty()) { - cu.setThemeclass(CommString.Default_Theme); - } - Company company = unitService.getCompanyByUserId(cu.getId()); - if (company != null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - } else { - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if (companies != null) { - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - - if (cu.getName().equals("admin")) { - model.addAttribute("mqttId", cu.getName() + "_web_" + CommUtil.getUUID()); - } else { - model.addAttribute("mqttId", cu.getName() + "_web"); - } - - Unit unit = this.unitService.getUserBelongingCompany(cu.getId()); - if (unit != null) { - model.addAttribute("top_user_companyId", unit.getId()); - model.addAttribute("top_user_companyType", unit.getType()); - } - model.addAttribute("top_userId", cu.getId()); - - return new ModelAndView("frameset"); - } else { - result = "{\"status\":" + false + "}"; - jsonObject = JSONObject.parseObject(result); - } - return null; - } - - public static final String USERNAME = "j_username"; - public static final String PASSWORD = "j_password"; - @RequestMapping(value = "getToken.do", method = RequestMethod.POST) - public void getToken(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - - String username = obtainUsername(request); - String password = obtainPassword(request); - //验证用户账号与密码是否对应 - username = username.trim(); - User user =loginService.NameLogin(username); - Result result = null; - if(user == null || !user.getPassword().equals(password)) { - result = Result.failed("用户名或者密码错误!"); - }else{ - String token = JwtUtil.sign(user.getName(), user.getId()); - String res ="{\"Access_Token\":\""+ token +"\"}"; - result = Result.success(res,"获取成功!"); - } - - String jsonStr = JSON.toJSONString(result); - response.setCharacterEncoding("UTF-8");// 设置将字符以"UTF-8"编码输出到 - response.getWriter().println(jsonStr); - response.getWriter().flush(); - } - protected String obtainUsername(HttpServletRequest request) { - Object obj = request.getParameter(USERNAME); - return null == obj ? "" : obj.toString(); - } - protected String obtainPassword(HttpServletRequest request) { - Object obj = request.getParameter(PASSWORD); - return null == obj ? "" : obj.toString(); - } - /** - * 通用建设中界面 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "building.do", method = RequestMethod.GET) - public ModelAndView building(HttpServletRequest request, - HttpServletResponse response, Model model) { - HttpSession session = request.getSession(false); - return new ModelAndView("building"); - } -} diff --git a/src/com/sipai/controller/base/MainConfigController.java b/src/com/sipai/controller/base/MainConfigController.java deleted file mode 100644 index d489a09e..00000000 --- a/src/com/sipai/controller/base/MainConfigController.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.controller.base; - -import com.sipai.entity.base.MainConfig; -import com.sipai.service.base.MainConfigService; -import com.sipai.tools.CommString; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/base/mainConfig") -public class MainConfigController { - @Resource - private MainConfigService mainConfigService; - - /** - * 获取首页配置的点位信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - String result = ""; - try { - String orderstr = " order by morder asc"; - String wherestr = " where 1=1"; - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - List list = mainConfigService.selectListByWhere(wherestr + orderstr); - - JSONArray json1 = JSONArray.fromObject(list); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"mpcode\":" + json1 + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/base/MainPageController.java b/src/com/sipai/controller/base/MainPageController.java deleted file mode 100644 index 928b1d34..00000000 --- a/src/com/sipai/controller/base/MainPageController.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.sipai.controller.base; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.MainPage; -import com.sipai.entity.base.MainPageType; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.MainPageService; -import com.sipai.service.base.MainPageTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/base/mainPage") -public class MainPageController { - @Resource - private MainPageService mainPageService; - @Resource - private MainPageTypeService mainPageTypeService; - @Resource - private UnitService unitService; - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/base/mainPageManage"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String orderstr=" order by morder asc"; - - String wherestr=" where 1=1 "; - if (request.getParameter("bizId")!=null && !request.getParameter("bizId").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizId").toString()+"' "; - } - if (request.getParameter("type")!=null && !request.getParameter("type").toString().isEmpty()) { - wherestr+= " and type ='"+request.getParameter("type").toString()+"' "; - } - PageHelper.startPage(page, rows); - List list = this.mainPageService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getAllList.do") - public ModelAndView getAllList(HttpServletRequest request,Model model) { - String orderstr=" order by type , show_way ,morder asc"; - String wherestr=" where 1=1 "; - if (request.getParameter("bizId")!=null && !request.getParameter("bizId").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizId").toString()+"' "; - } - if (request.getParameter("type")!=null && !request.getParameter("type").toString().isEmpty()) { - wherestr+= " and type ='"+request.getParameter("type").toString()+"' "; - } - if (request.getParameter("showWay")!=null && !request.getParameter("showWay").toString().isEmpty()) { - wherestr+= " and show_way in ('"+request.getParameter("showWay").toString().replace(",", "','")+"') "; - } - List list = this.mainPageService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); -// System.out.println(result); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - /* - String orderstr=" order by morder asc"; - String wherestr=" where 1=1 "; - if (request.getParameter("bizId")!=null && !request.getParameter("bizId").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizId").toString()+"' "; - } - List list = this.mainPageTypeService.selectListByWhere(wherestr+orderstr); - */ - String companyId= request.getParameter("bizId"); - String mainPageTypeId= request.getParameter("id"); - Company company = this.unitService.getCompById(companyId); - request.setAttribute("company", company); - request.setAttribute("mainPageTypeId", mainPageTypeId); - //request.setAttribute("list",list); - return "base/mainPageAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String groupId = request.getParameter("id"); - MainPage mainPage = this.mainPageService.selectById(groupId); - Company company = this.unitService.getCompById(mainPage.getBizId()); - request.setAttribute("company", company); - model.addAttribute("mainPage", mainPage); - return "base/mainPageEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute MainPage mainPage){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - mainPage.setId(id); - mainPage.setInsuser(cu.getId()); - mainPage.setInsdt(CommUtil.nowDate()); - - int result =this.mainPageService.save(mainPage); - /*if(result>0){ - groupMemberService.saveMembers(group.getId(), request.getParameter("leaderid"), "leader"); - groupMemberService.saveMembers(group.getId(), request.getParameter("memberid"), "member"); - groupMemberService.saveMembers(group.getId(), request.getParameter("chiefid"), "chief"); - }*/ - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute MainPage mainPage){ - int result = this.mainPageService.update(mainPage); - /*if(result>0){ - groupMemberService.deleteByGroupId(group.getId()); - groupMemberService.saveMembers(group.getId(), request.getParameter("leaderid"), "leader"); - groupMemberService.saveMembers(group.getId(), request.getParameter("memberid"), "member"); - groupMemberService.saveMembers(group.getId(), request.getParameter("chiefid"), "chief"); - }*/ - String resstr="{\"res\":\""+result+"\",\"id\":\""+mainPage.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.mainPageService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.mainPageService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /*** - * APP接口。获取主页分类配置信息 - * @param request - * @param model - * @return - */ - @RequestMapping("/getList4APPBySort.do") - public ModelAndView getList4APPBySort(HttpServletRequest request,Model model) { -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String result = ""; - try{ - String orderstr=" order by type , show_way ,morder asc"; - - String wherestr=" where 1=1"; - if (request.getParameter("bizid")!=null && !request.getParameter("bizid").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizid").toString()+"' "; - } - List list1 = this.mainPageService.selectListByWhere4App(wherestr+orderstr); - - JSONArray json1=JSONArray.fromObject(list1); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json1+"}"; - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/base/MainPageTypeController.java b/src/com/sipai/controller/base/MainPageTypeController.java deleted file mode 100644 index 84615c6d..00000000 --- a/src/com/sipai/controller/base/MainPageTypeController.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.sipai.controller.base; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.MainPage; -import com.sipai.entity.base.MainPageType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.base.LoginService; -import com.sipai.service.base.MainPageService; -import com.sipai.service.base.MainPageTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/base/mainPageType") -public class MainPageTypeController { - @Resource - private MainPageTypeService mainPageTypeService; - @Resource - private MainPageService mainPageService; - @Resource - private UnitService unitService; - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/base/mainPageTypeList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String orderstr=" order by morder asc"; - - String wherestr=" where 1=1 "; - /* - if (request.getParameter("mainPageTypeId")!=null && !request.getParameter("mainPageTypeId").toString().isEmpty()) { - wherestr+= " and id ='"+request.getParameter("mainPageTypeId").toString()+"' "; - } - */ - if (request.getParameter("bizId")!=null && !request.getParameter("bizId").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizId").toString()+"' "; - } - PageHelper.startPage(page, rows); - List list = this.mainPageTypeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getAllList.do") - public ModelAndView getAllList(HttpServletRequest request,Model model) { - String orderstr=" order by morder asc"; - String wherestr=" where 1=1 "; - if (request.getParameter("bizId")!=null && !request.getParameter("bizId").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizId").toString()+"' "; - } - if (request.getParameter("type")!=null && !request.getParameter("type").toString().isEmpty()) { - wherestr+= " and type ='"+request.getParameter("type").toString()+"' "; - } - List list = this.mainPageTypeService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); -// System.out.println(result); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId= request.getParameter("bizId"); - Company company = this.unitService.getCompById(companyId); - request.setAttribute("company", company); - return "base/mainPageTypeAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String groupId = request.getParameter("id"); - MainPageType mainPageType = this.mainPageTypeService.selectById(groupId); - Company company = this.unitService.getCompById(mainPageType.getBizId()); - request.setAttribute("company", company); - model.addAttribute("mainPageType", mainPageType); - return "base/mainPageTypeEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute MainPageType mainPageType){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - mainPageType.setId(id); - mainPageType.setInsuser(cu.getId()); - mainPageType.setInsdt(CommUtil.nowDate()); - - int result =this.mainPageTypeService.save(mainPageType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute MainPageType mainPageType){ - int result = this.mainPageTypeService.update(mainPageType); - /*if(result>0){ - groupMemberService.deleteByGroupId(group.getId()); - groupMemberService.saveMembers(group.getId(), request.getParameter("leaderid"), "leader"); - groupMemberService.saveMembers(group.getId(), request.getParameter("memberid"), "member"); - groupMemberService.saveMembers(group.getId(), request.getParameter("chiefid"), "chief"); - }*/ - String resstr="{\"res\":\""+result+"\",\"id\":\""+mainPageType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="mainPageTypeId") String mainPageTypeId){ - int result = this.mainPageTypeService.deleteById(mainPageTypeId); - String whereStr="where type ="+"'"+mainPageTypeId+"'"; - int resultNum=mainPageService.deleteByWhere(whereStr); - model.addAttribute("result", result); - model.addAttribute("resultNum", resultNum); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.mainPageTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getType4Select.do") - public String getPatrolArea4Select(HttpServletRequest request,Model model){ - String orderstr=" order by morder asc"; - - String wherestr=" where 1=1 "; - if (request.getParameter("mainPageTypeId")!=null && !request.getParameter("mainPageTypeId").toString().isEmpty()) { - wherestr+= " and id ='"+request.getParameter("mainPageTypeId").toString()+"' "; - } - if (request.getParameter("bizId")!=null && !request.getParameter("bizId").toString().isEmpty()) { - wherestr+= " and biz_id ='"+request.getParameter("bizId").toString()+"' "; - } - - List list = this.mainPageTypeService.selectListByWhere(wherestr+orderstr); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.mainPageTypeUserService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getAllList.do") - public ModelAndView getAllList(HttpServletRequest request,Model model) { - String orderstr=" order by morder asc"; - User cu= (User)request.getSession().getAttribute("cu"); - String wherestr=" where 1=1 and insuser ='"+cu.getId()+"'"; - List list = this.mainPageTypeUserService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); -// System.out.println(result); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId= request.getParameter("bizId"); - Company company = this.unitService.getCompById(companyId); - request.setAttribute("company", company); - return "base/mainPageTypeUserAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String groupId = request.getParameter("id"); - MainPageTypeUser mainPageTypeUser = this.mainPageTypeUserService.selectById(groupId); - model.addAttribute("mainPageTypeUser", mainPageTypeUser); - return "base/mainPageTypeUserEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute MainPageTypeUser mainPageTypeUser){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - mainPageTypeUser.setId(id); - mainPageTypeUser.setInsuser(cu.getId()); - mainPageTypeUser.setInsdt(CommUtil.nowDate()); - - int result =this.mainPageTypeUserService.save(mainPageTypeUser); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute MainPageTypeUser mainPageTypeUser){ - int result = this.mainPageTypeUserService.update(mainPageTypeUser); - /*if(result>0){ - groupMemberService.deleteByGroupId(group.getId()); - groupMemberService.saveMembers(group.getId(), request.getParameter("leaderid"), "leader"); - groupMemberService.saveMembers(group.getId(), request.getParameter("memberid"), "member"); - groupMemberService.saveMembers(group.getId(), request.getParameter("chiefid"), "chief"); - }*/ - String resstr="{\"res\":\""+result+"\",\"id\":\""+mainPageTypeUser.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/saveAndUpdate.do") - public String dosaveAndUpdate(HttpServletRequest request,Model model){ - String mainPageTypeIds=request.getParameter("mainPageTypeIds"); - - User cu= (User)request.getSession().getAttribute("cu"); - - int result =this.mainPageTypeUserService.saveAndUpdate(cu.getId(),mainPageTypeIds); - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.mainPageTypeUserService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.mainPageTypeUserService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/clearRecord.do") - public String clearRecord(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - int result = this.mainPageTypeUserService.deleteByWhere("where insuser = '"+cu.getId()+"'"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/base/MinioController.java b/src/com/sipai/controller/base/MinioController.java deleted file mode 100644 index 872f4eb7..00000000 --- a/src/com/sipai/controller/base/MinioController.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.controller.base; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.service.base.CommonFileService; -import com.sipai.tools.MinioUtils; -import io.swagger.annotations.*; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 用于传文件到minio 通用 - * sj 2022-09-08 - */ -@Controller -@RequestMapping("/minio") -@Api(value = "/minio", tags = "文件管理") -public class MinioController { - @Autowired - private MinioUtils minioUtils; - @Autowired - CommonFileService commonFileService; - - @GetMapping("init") - public String init() { - return "file"; - } - - /** - * 文件上传 (单个视频) - */ - @ApiOperation(value = "文件上传 (单个视频)", notes = "文件上传 (单个视频)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "file", value = "MultipartFile源文件", dataType = "MultipartFile", paramType = "query", required = true), - @ApiImplicitParam(name = "masterId", value = "表单id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "nameSpace", value = "桶名称", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "tbName", value = "数据库表", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/uploadVideo.do", method = RequestMethod.POST) - @ResponseBody - public String upload(HttpServletRequest request, - @RequestParam(name = "file", required = false) MultipartFile file, - @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "nameSpace") String nameSpace, - @RequestParam(value = "tbName") String tbName) { - System.out.println("uploadVideo"); - JSONObject res = null; - try { - res = minioUtils.uploadFile(file, masterId, nameSpace, tbName); - } catch (Exception e) { - e.printStackTrace(); - res.put("code", 0); - res.put("msg", "上传失败"); - } - return res.toJSONString(); - } - - /** - * minio 文件上传 (通用) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "updateFile.do") - public ModelAndView updateFile(HttpServletRequest request, HttpServletResponse response, Model model) { - System.out.println("updateFile"); - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String nameSpace = request.getParameter("nameSpace"); - String tbName = request.getParameter("tbName"); - if (nameSpace != null && !nameSpace.isEmpty()) { - if (tbName == null || tbName.isEmpty()) { - tbName = FileNameSpaceEnum.getTbName(nameSpace); - } - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - try { - int res = commonFileService.updateFile(masterId, nameSpace, tbName, item); - - if (res == 1) { - ret.put("suc", true); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = net.sf.json.JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/base/PDFFileUtil.java b/src/com/sipai/controller/base/PDFFileUtil.java deleted file mode 100644 index afcaaa8c..00000000 --- a/src/com/sipai/controller/base/PDFFileUtil.java +++ /dev/null @@ -1,396 +0,0 @@ -package com.sipai.controller.base; - -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.HashMap; - -import com.itextpdf.text.BaseColor; -import com.itextpdf.text.Document; -import com.itextpdf.text.DocumentException; -import com.itextpdf.text.Element; -import com.itextpdf.text.Font; -import com.itextpdf.text.FontProvider; -import com.itextpdf.text.PageSize; -import com.itextpdf.text.Paragraph; -import com.itextpdf.text.Phrase; -import com.itextpdf.text.Rectangle; -import com.itextpdf.text.pdf.BaseFont; -import com.itextpdf.text.pdf.PdfPCell; -import com.itextpdf.text.pdf.PdfPTable; -import com.itextpdf.text.pdf.PdfWriter; -import com.itextpdf.tool.xml.XMLWorkerHelper; -import com.sipai.tools.CommUtil; - -import java.io.ByteArrayInputStream; -import java.net.MalformedURLException; -import java.nio.charset.Charset; - -import javax.servlet.http.HttpServletRequest; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; -import org.xhtmlrenderer.pdf.ITextFontResolver; -import org.xhtmlrenderer.pdf.ITextRenderer; - - -public class PDFFileUtil { - Document document = null;// 建立一个Document对象 - /* private static Font headFont ; - private static Font keyFont ; - private static Font nbspFont; - private static Font textfont_H ; - private static Font textfont_B ; - private static Font textfont_13; - private static Font textfont_12; - private static Font textfont_11; - private static Font textfont_10; - private static Font textfont_9; - private static Font textfont_8; - private static Font textfont_7; - private static Font textfont_6; - int maxWidth = 520;*/ - - - public void createPDF(String outputPath, String xmlStr) { - try { - Document document = new Document(); - document.setPageSize(PageSize.A4);// 设置页面大小 - PdfWriter mPdfWriter = PdfWriter. getInstance(document, new FileOutputStream(outputPath)); - document.open(); - ByteArrayInputStream bin = new ByteArrayInputStream(xmlStr.getBytes()); - XMLWorkerHelper.getInstance().parseXHtml(mPdfWriter, document, bin, Charset.forName("UTF-8"), new ChinaFontProvide()); - /*BaseFont baseFont = BaseFont.createFont("C:/Windows/Fonts/SIMYOU.TTF",BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED); - - Font font = new Font(baseFont); - document.add(new Paragraph("解决中文问题了!",font)); */ - document.close(); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (DocumentException e) { - e.printStackTrace(); - }catch (Exception e) { - e.printStackTrace(); - } - /*Document document = new Document(); - try { - - // 建立一个Document对象 - BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); - Font keyfont = new Font(bfChinese, 11, Font.BOLD);// 设置字体大小 - Font textfont = new Font(bfChinese, 9, Font.NORMAL);// 设置字体大小 - document.setPageSize(PageSize.A4);// 设置页面大小 - PdfWriter.getInstance(document, new FileOutputStream(outputPath)); - document.open(); - PdfPTable table = createTable(new float[]{1f, 4f, 2f, 2f, 2.5f, 2.5f, 2f}); - table.addCell(createCell("编号", keyfont, Element.ALIGN_CENTER)); - table.addCell(createCell("文件名", keyfont, Element.ALIGN_CENTER)); - table.addCell(createCell("广告类型", keyfont, Element.ALIGN_CENTER)); - table.addCell(createCell("频道包", keyfont, Element.ALIGN_CENTER)); - table.addCell(createCell("开始日期", keyfont, Element.ALIGN_CENTER)); - table.addCell(createCell("结束日期", keyfont, Element.ALIGN_CENTER)); - table.addCell(createCell("缩略图", keyfont, Element.ALIGN_CENTER)); - //设置单元格 - document.add(table); - document.close(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - }*/ - } - public synchronized static boolean html2Pdf(String outputPath, String xmlStr) { - - OutputStream os = null; - try { - //xmlStr = HtmlGenerator.generate("D:/Workspaces/SSMBootstrap/resources/freemaker/template/maintenanceViewTemplate.ftl", new HashMap()); - os = new FileOutputStream(outputPath); - - ITextRenderer renderer = new ITextRenderer(); -// DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); -// org.w3c.dom.Document doc = builder.parse(new ByteArrayInputStream(xmlStr.getBytes("utf-8"))); -// renderer.setDocument(doc,null); - renderer.setDocumentFromString(xmlStr); - // 解决中文支持问题 - ITextFontResolver fontResolver = renderer.getFontResolver(); - try { - fontResolver.addFont("C:/Windows/fonts/simsun.ttc", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // 解决图片的相对路径问题 - /*String basePath="D:/Tomcat 7.0/webapps/UploadFile"; - renderer.getSharedContext().setBaseURL("file:/" + basePath + "/MaintenanceBill"); - renderer.getSharedContext().setReplacedElementFactory(new Base64ImgReplacedElementFactory()); - renderer.getSharedContext().getTextRenderer().setSmoothingThreshold(0);*/ - renderer.layout(); - try { - renderer.createPDF(os); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return false; - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } finally { - try { - /*ByteArrayOutputStream baos=new ByteArrayOutputStream(); - baos=(ByteArrayOutputStream) os; - Hibernate.createBlob(); - ByteArrayInputStream swapStream = new ByteArrayInputStream(baos.toByteArray());*/ - if (os!=null) { - os.flush(); - os.close(); - } - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - return true; - } - - - /** - * - * 提供中文 - * - */ - public class ChinaFontProvide implements FontProvider{ - - - @Override - public Font getFont(String arg0, String arg1, boolean arg2, float arg3, - int arg4, BaseColor arg5) { - BaseFont bfChinese =null; - try { -// bfChinese=BaseFont.createFont("STSong-Light", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); - bfChinese=BaseFont.createFont("C:/Windows/Fonts/SIMYOU.TTF,1",BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED); - } catch (Exception e) { - e.printStackTrace(); - } - Font FontChinese = new Font(bfChinese); - return FontChinese; - } - - - @Override - public boolean isRegistered(String arg0) { - return false; - } - } - - @RequestMapping("/exportMaintenanceDetailPDF.do") - public ModelAndView exportMaintenanceDetailPDF(HttpServletRequest request,Model model){ - - String htmlStr = request.getParameter("htmlStr"); - PDFFileUtil pdfFileUtil= new PDFFileUtil(); - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName,"UploadFile"); - String fileName =CommUtil.getUUID()+".pdf"; - realPath+="MaintenanceBill\\"+fileName; - pdfFileUtil.html2Pdf(realPath, htmlStr); - - String result="{\"res\":\""+realPath.substring(realPath.indexOf("UploadFile"),realPath.length()).replace("\\", "/")+"\"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /* static{ - BaseFont bfChinese_H; - try { - *//** - * 新建一个字体,iText的方法 STSongStd-Light 是字体,在iTextAsian.jar 中以property为后缀 - * UniGB-UCS2-H 是编码,在iTextAsian.jar 中以cmap为后缀 H 代表文字版式是 横版, 相应的 V 代表竖版 - *//* - bfChinese_H = BaseFont.createFont("STSong-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED); - - - headFont = new Font(bfChinese_H, 14, Font.NORMAL); - keyFont = new Font(bfChinese_H, 26, Font.BOLD); - nbspFont = new Font(bfChinese_H, 13, Font.NORMAL); - textfont_H = new Font(bfChinese_H, 10, Font.NORMAL); - textfont_B = new Font(bfChinese_H, 12, Font.NORMAL); - textfont_13 = new Font(bfChinese_H, 13, Font.NORMAL); - textfont_12 = new Font(bfChinese_H, 12, Font.NORMAL); - textfont_11 = new Font(bfChinese_H, 11, Font.NORMAL); - textfont_10 = new Font(bfChinese_H, 10, Font.NORMAL); - textfont_9 = new Font(bfChinese_H, 9, Font.NORMAL); - textfont_8 = new Font(bfChinese_H, 8, Font.NORMAL); - textfont_7 = new Font(bfChinese_H, 7, Font.NORMAL); - textfont_6 = new Font(bfChinese_H, 6, Font.NORMAL); - - - } catch (Exception e) { - e.printStackTrace(); - } - }*/ - - - /** - * 设置页面属性 - * @param file - */ - public void setPageProperties(File file) { - - - //自定义纸张 - Rectangle rectPageSize = new Rectangle(350, 620); - - - // 定义A4页面大小 - //Rectangle rectPageSize = new Rectangle(PageSize.A4); - rectPageSize = rectPageSize.rotate();// 加上这句可以实现页面的横置 - document = new Document(rectPageSize,10, 150, 10, 40); - - - try { - PdfWriter.getInstance(document,new FileOutputStream(file)); - document.open(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * 建表格(以列的数量建) - * @param colNumber - * @return - */ - public PdfPTable createTable(int colNumber){ - PdfPTable table = new PdfPTable(colNumber); - try{ - //table.setTotalWidth(maxWidth); - //table.setLockedWidth(true); - table.setHorizontalAlignment(Element.ALIGN_CENTER); - table.getDefaultCell().setBorder(1); - table.setSpacingBefore(10); - table.setWidthPercentage(100); - }catch(Exception e){ - e.printStackTrace(); - } - return table; - } - - - /** - * 建表格(以列的宽度比建) - * @param widths - * @return - */ - public PdfPTable createTable(float[] widths){ - PdfPTable table = new PdfPTable(widths); - try{ - //table.setTotalWidth(maxWidth); - //table.setLockedWidth(true); - table.setHorizontalAlignment(Element.ALIGN_CENTER); - table.getDefaultCell().setBorder(1); - table.setSpacingBefore(10); - table.setWidthPercentage(100); - }catch(Exception e){ - e.printStackTrace(); - } - return table; - } - - - - - /** - * 表格中单元格 - * @param value - * @param font - * @param align - * @return - */ - public PdfPCell createCell(String value,Font font,int align){ - PdfPCell cell = new PdfPCell(); - cell.setVerticalAlignment(Element.ALIGN_MIDDLE); - cell.setHorizontalAlignment(align); - cell.setPhrase(new Phrase(value,font)); - - return cell; - } - - - /** - * 表格中单元格 - * @param value - * @param font - * @param align - * @param colspan - * @param rowspan - * @return - */ - public PdfPCell createCell(String value,Font font,int align_v,int align_h,int colspan,int rowspan){ - PdfPCell cell = new PdfPCell(); - cell.setVerticalAlignment(align_v); - cell.setHorizontalAlignment(align_h); - cell.setColspan(colspan); - cell.setRowspan(rowspan); - cell.setPhrase(new Phrase(value,font)); - return cell; - } - /** - * 创建无边框表格 - * @param value - * @param font - * @param align - * @param colspan - * @param rowspan - * @return - */ - public PdfPCell createCellNotBorder(String value,Font font,int align_v,int align_h,int colspan,int rowspan){ - PdfPCell cell = new PdfPCell(); - cell.setVerticalAlignment(align_v); - cell.setHorizontalAlignment(align_h); - cell.setColspan(colspan); - cell.setRowspan(rowspan); - cell.setPhrase(new Phrase(value,font)); - cell.setBorderWidth(0f); - return cell; - } - - - /** - * 建短语 - * @param value - * @param font - * @return - */ - public Phrase createPhrase(String value,Font font){ - Phrase phrase = new Phrase(); - phrase.add(value); - phrase.setFont(font); - return phrase; - } - - - /** - * 建段落 - * @param value - * @param font - * @param align - * @return - */ - public Paragraph createParagraph(String value,Font font,int align){ - Paragraph paragraph = new Paragraph(); - paragraph.add(new Phrase(value,font)); - paragraph.setAlignment(align); - return paragraph; - } -} diff --git a/src/com/sipai/controller/base/PoiUtils.java b/src/com/sipai/controller/base/PoiUtils.java deleted file mode 100644 index bdd42b9c..00000000 --- a/src/com/sipai/controller/base/PoiUtils.java +++ /dev/null @@ -1,448 +0,0 @@ -package com.sipai.controller.base; - -import com.google.common.base.Strings; -import org.apache.poi.xwpf.usermodel.*; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; -import org.springframework.stereotype.Component; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.math.BigInteger; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PoiUtils { - - private Map> orderMap = new HashMap>(); - - /*把*/ - public static void copy(Object obj, Object dest) { - // 获取属性 - BeanInfo sourceBean = null; - try { - sourceBean = Introspector.getBeanInfo(obj.getClass(), Object.class); - } catch (IntrospectionException e) { - e.printStackTrace(); - } - PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors(); - - BeanInfo destBean = null; - try { - destBean = Introspector.getBeanInfo(dest.getClass(), Object.class); - } catch (IntrospectionException e) { - e.printStackTrace(); - } - PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors(); - try { - for (int i = 0; i < sourceProperty.length; i++) { - Object value = sourceProperty[i].getReadMethod().invoke(obj); - if (value != null) { - - for (int j = 0; j < destProperty.length; j++) { - if (sourceProperty[i].getName().equals(destProperty[j].getName()) && sourceProperty[i].getPropertyType() == destProperty[j].getPropertyType()) { - // 调用source的getter方法和dest的setter方法 - destProperty[j].getWriteMethod().invoke(dest, value); - break; - } - } - } else { - continue; - } - } - } catch (Exception e) { - try { - throw new Exception("属性复制失败:" + e.getMessage()); - } catch (Exception e1) { - e1.printStackTrace(); - } - } - } - - /** - * 设置一级标题内容及样式 - * - * @param paragraph - * @param text - */ - public void setLevelTitle1(XWPFDocument document, XWPFParagraph paragraph, String text) { - /**1.将段落原有文本(原有所有的Run)全部删除*/ - deleteRun(paragraph); - /**3.插入新的Run即将新的文本插入段落*/ - XWPFRun createRun = paragraph.insertNewRun(0); - createRun.setText(text); - XWPFRun separtor = paragraph.insertNewRun(1); - /**两段之间添加换行*/ - separtor.setText("\r"); - createRun.setFontSize(16); - createRun.setFontFamily("黑体"); - paragraph.setIndentationFirstLine(600); - paragraph.setSpacingAfter(20); - paragraph.setSpacingBefore(20); - addCustomHeadingStyle(document, "标题1", 1); - paragraph.setStyle("标题1"); - } - - /** - * 设置二级标题内容及样式 - * - * @param paragraph - * @param text - */ - public void setLevelTitle2(XWPFDocument document, XWPFParagraph paragraph, String text) { - deleteRun(paragraph); - /**3.插入新的Run即将新的文本插入段落*/ - XWPFRun createRun = paragraph.insertNewRun(0); - createRun.setText(text); - XWPFRun separtor = paragraph.insertNewRun(1); - /**两段之间添加换行*/ - separtor.setText("\r"); - createRun.setFontSize(16); - createRun.setBold(true); - createRun.setFontFamily("楷体_GB2312"); - paragraph.setIndentationFirstLine(600); - paragraph.setSpacingAfter(10); - paragraph.setSpacingBefore(10); - addCustomHeadingStyle(document, "标题2", 2); - paragraph.setStyle("标题2"); - } - - /** - * 设置正文文本内容及样式 - * - * @param paragraph - * @param text - */ - public void setTextPro(XWPFParagraph paragraph, String text) { - deleteRun(paragraph); - /**3.插入新的Run即将新的文本插入段落*/ - XWPFRun createRun = paragraph.insertNewRun(0); - createRun.setText(text); - XWPFRun separtor = paragraph.insertNewRun(1); - /**两段之间添加换行*/ - separtor.addBreak(); - createRun.addTab(); - createRun.setFontFamily("仿宋_GB2312"); - createRun.setFontSize(16); - - paragraph.setFirstLineIndent(20); - paragraph.setAlignment(ParagraphAlignment.BOTH); - paragraph.setIndentationFirstLine(600); - paragraph.setSpacingAfter(10); - paragraph.setSpacingBefore(10); - } - - /** - * 向段落添加文本 - * - * @param paragraph - * @param text - */ - public void addTextPro(XWPFParagraph paragraph, String text) { - /**3.插入新的Run即将新的文本插入段落*/ - XWPFRun createRun = paragraph.createRun(); - createRun.setText(text); - XWPFRun separtor = paragraph.createRun(); - /**两段之间添加换行*/ - separtor.addBreak(); - createRun.addTab(); - createRun.setFontFamily("仿宋_GB2312"); - createRun.setFontSize(16); - paragraph.setFirstLineIndent(20); - paragraph.setAlignment(ParagraphAlignment.BOTH); - paragraph.setIndentationFirstLine(600); - paragraph.setSpacingAfter(10); - paragraph.setSpacingBefore(10); - - paragraph.addRun(createRun); - paragraph.addRun(separtor); - } - - /** - * 设置表格标题内容及样式 - * - * @param paragraph - * @param text - */ - public void setTableOrChartTitle(XWPFParagraph paragraph, String text) { - /**1.将段落原有文本(原有所有的Run)全部删除*/ - deleteRun(paragraph); - XWPFRun createRun = paragraph.insertNewRun(0); - createRun.setText(text); - XWPFRun separtor = paragraph.insertNewRun(1); - /**两段之间添加换行*/ - separtor.setText("\r"); - createRun.setFontFamily("楷体"); - createRun.setFontSize(16); - createRun.setBold(true); - paragraph.setSpacingAfter(10); - paragraph.setSpacingBefore(10); - paragraph.setAlignment(ParagraphAlignment.CENTER); - } - - public void deleteRun(XWPFParagraph paragraph) { - /*1.将段落原有文本(原有所有的Run)全部删除*/ - List runs = paragraph.getRuns(); - int runSize = runs.size(); - /*Paragrap中每删除一个run,其所有的run对象就会动态变化,即不能同时遍历和删除*/ - int haveRemoved = 0; - for (int runIndex = 0; runIndex < runSize; runIndex++) { - paragraph.removeRun(runIndex - haveRemoved); - haveRemoved++; - } - } - - /** - * 合并行 - * - * @param table - * @param col 需要合并的列 - * @param fromRow 开始行 - * @param toRow 结束行 - */ - public static void mergeCellVertically(XWPFTable table, int col, int fromRow, int toRow) { - for (int rowIndex = fromRow; rowIndex <= toRow; rowIndex++) { - CTVMerge vmerge = CTVMerge.Factory.newInstance(); - if (rowIndex == fromRow) { - vmerge.setVal(STMerge.RESTART); - } else { - vmerge.setVal(STMerge.CONTINUE); - } - XWPFTableCell cell = table.getRow(rowIndex).getCell(col); - CTTcPr tcPr = cell.getCTTc().getTcPr(); - if (tcPr != null) { - tcPr.setVMerge(vmerge); - } else { - tcPr = CTTcPr.Factory.newInstance(); - tcPr.setVMerge(vmerge); - cell.getCTTc().setTcPr(tcPr); - } - } - } - - /** - * 设置表格内容居中 - * - * @param table - */ - public void setTableCenter(XWPFTable table) { - List rows = table.getRows(); - for (XWPFTableRow row : rows) { - row.setHeight(400); - List cells = row.getTableCells(); - for (XWPFTableCell cell : cells) { - CTTc cttc = cell.getCTTc(); - CTTcPr ctPr = cttc.addNewTcPr(); - ctPr.addNewVAlign().setVal(STVerticalJc.CENTER); - cttc.getPList().get(0).addNewPPr().addNewJc().setVal(STJc.CENTER); - } - } - } - - public void init(XWPFDocument document) { - //获取段落 - List paras = document.getParagraphs(); - - for (int i = 0; i < paras.size(); i++) { - XWPFParagraph para = paras.get(i); -// System.out.println(para.getCTP());//得到xml格式 -// System.out.println(para.getStyleID());//段落级别 -// System.out.println(para.getParagraphText());//段落内容 - - String titleLvl = getTitleLvl(document, para);//获取段落级别 - if ("a5".equals(titleLvl) || "HTML".equals(titleLvl) || "".equals(titleLvl) || null == titleLvl) { - titleLvl = "8"; - } - - if (null != titleLvl && !"".equals(titleLvl) && !"8".equals(titleLvl)) { - String t = titleLvl; - String orderCode = getOrderCode(titleLvl);//获取编号 - String text = para.getParagraphText(); - text = orderCode + " " + text; - List runs = para.getRuns(); - int runSize = runs.size(); - /**Paragrap中每删除一个run,其所有的run对象就会动态变化,即不能同时遍历和删除*/ - int haveRemoved = 0; - for (int runIndex = 0; runIndex < runSize; runIndex++) { - para.removeRun(runIndex - haveRemoved); - haveRemoved++; - } - if ("1".equals(titleLvl)) { - setLevelTitle1(document, para, text); - } - if ("2".equals(titleLvl)) { - setLevelTitle2(document, para, text); - } - } - } - } - - /** - * Word中的大纲级别,可以通过getPPr().getOutlineLvl()直接提取,但需要注意,Word中段落级别,通过如下三种方式定义: - * 1、直接对段落进行定义; - * 2、对段落的样式进行定义; - * 3、对段落样式的基础样式进行定义。 - * 因此,在通过“getPPr().getOutlineLvl()”提取时,需要依次在如上三处读取。 - * - * @param doc - * @param para - * @return - */ - public String getTitleLvl(XWPFDocument doc, XWPFParagraph para) { - String titleLvl = ""; - - //判断该段落是否设置了大纲级别 - CTP ctp = para.getCTP(); - if (ctp != null) { - CTPPr pPr = ctp.getPPr(); - if (pPr != null) { - if (pPr.getOutlineLvl() != null) { - return String.valueOf(pPr.getOutlineLvl().getVal()); - } - } - } - - - //判断该段落的样式是否设置了大纲级别 - if (para.getStyle() != null) { - if (doc.getStyles().getStyle(para.getStyle()).getCTStyle().getPPr().getOutlineLvl() != null) { - return String.valueOf(doc.getStyles().getStyle(para.getStyle()).getCTStyle().getPPr().getOutlineLvl().getVal()); - } - - - //判断该段落的样式的基础样式是否设置了大纲级别 - if (doc.getStyles().getStyle(doc.getStyles().getStyle(para.getStyle()).getCTStyle().getBasedOn().getVal()) - .getCTStyle().getPPr().getOutlineLvl() != null) { - String styleName = doc.getStyles().getStyle(para.getStyle()).getCTStyle().getBasedOn().getVal(); - return String.valueOf(doc.getStyles().getStyle(styleName).getCTStyle().getPPr().getOutlineLvl().getVal()); - } - } - if (para.getStyleID() != null) { - return para.getStyleID(); - } - return titleLvl; - } - - /** - * 增加自定义标题样式。这里用的是stackoverflow的源码 - * - * @param docxDocument 目标文档 - * @param strStyleId 样式名称 - * @param headingLevel 样式级别 - */ - public static void addCustomHeadingStyle(XWPFDocument docxDocument, String strStyleId, int headingLevel) { - - CTStyle ctStyle = CTStyle.Factory.newInstance(); - ctStyle.setStyleId(strStyleId); - - CTString styleName = CTString.Factory.newInstance(); - styleName.setVal(strStyleId); - ctStyle.setName(styleName); - - CTDecimalNumber indentNumber = CTDecimalNumber.Factory.newInstance(); - indentNumber.setVal(BigInteger.valueOf(headingLevel)); - - // lower number > style is more prominent in the formats bar - ctStyle.setUiPriority(indentNumber); - - CTOnOff onoffnull = CTOnOff.Factory.newInstance(); - ctStyle.setUnhideWhenUsed(onoffnull); - - // style shows up in the formats bar - ctStyle.setQFormat(onoffnull); - - // style defines a heading of the given level - CTPPr ppr = CTPPr.Factory.newInstance(); - ppr.setOutlineLvl(indentNumber); - ctStyle.setPPr(ppr); - - XWPFStyle style = new XWPFStyle(ctStyle); - - // is a null op if already defined - XWPFStyles styles = docxDocument.createStyles(); - - style.setType(STStyleType.PARAGRAPH); - styles.addStyle(style); - - } - - /** - * 获取标题编号 - * - * @param titleLvl - * @return - */ - public String getOrderCode(String titleLvl) { - String order = ""; - - if ("0".equals(titleLvl) || Integer.parseInt(titleLvl) == 8) {//文档标题||正文 - return ""; - } else if (Integer.parseInt(titleLvl) > 0 && Integer.parseInt(titleLvl) < 8) {//段落标题 - - //设置最高级别标题 - Map maxTitleMap = orderMap.get("maxTitleLvlMap"); - if (null == maxTitleMap) {//没有,表示第一次进来 - //最高级别标题赋值 - maxTitleMap = new HashMap(); - maxTitleMap.put("lvl", titleLvl); - orderMap.put("maxTitleLvlMap", maxTitleMap); - } else { - String maxTitleLvl = maxTitleMap.get("lvl") + "";//最上层标题级别(0,1,2,3) - if (Integer.parseInt(titleLvl) < Integer.parseInt(maxTitleLvl)) {//当前标题级别更高 - maxTitleMap.put("lvl", titleLvl);//设置最高级别标题 - orderMap.put("maxTitleLvlMap", maxTitleMap); - } - } - - //查父节点标题 - int parentTitleLvl = Integer.parseInt(titleLvl) - 1;//父节点标题级别 - Map cMap = orderMap.get(titleLvl);//当前节点信息 - Map pMap = orderMap.get(parentTitleLvl + "");//父节点信息 - - if (0 == parentTitleLvl) {//父节点为文档标题,表明当前节点为1级标题 - int count = 0; - //最上层标题,没有父节点信息 - if (null == cMap) {//没有当前节点信息 - cMap = new HashMap(); - } else { - count = Integer.parseInt(String.valueOf(cMap.get("cCount")));//当前序个数 - } - count++; - order = count + ""; - cMap.put("cOrder", order);//当前序 - cMap.put("cCount", count);//当前序个数 - orderMap.put(titleLvl, cMap); - - } else {//父节点为非文档标题 - int count = 0; - //如果没有相邻的父节点信息,当前标题级别自动升级 - if (null == pMap) { - return getOrderCode(String.valueOf(parentTitleLvl)); - } else { - String pOrder = String.valueOf(pMap.get("cOrder"));//父节点序 - if (null == cMap) {//没有当前节点信息 - cMap = new HashMap(); - } else { - count = Integer.parseInt(String.valueOf(cMap.get("cCount")));//当前序个数 - } - count++; - order = pOrder + "." + count;//当前序编号 - cMap.put("cOrder", order);//当前序 - cMap.put("cCount", count);//当前序个数 - orderMap.put(titleLvl, cMap); - } - } - - //字节点标题计数清零 - int childTitleLvl = Integer.parseInt(titleLvl) + 1;//子节点标题级别 - Map cdMap = orderMap.get(childTitleLvl + "");// - if (null != cdMap) { - cdMap.put("cCount", 0);//子节点序个数 - orderMap.get(childTitleLvl + "").put("cCount", 0); - } - } - return order; - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/bim/BIMCameraController.java b/src/com/sipai/controller/bim/BIMCameraController.java deleted file mode 100644 index 3770fb42..00000000 --- a/src/com/sipai/controller/bim/BIMCameraController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.controller.bim; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.bim.BIMCamera; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.user.User; -import com.sipai.service.bim.BIMCameraService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/bim/BIMCamera") -public class BIMCameraController { - @Resource - private BIMCameraService bimCameraService; - - @RequestMapping("/cameraView.do") - public String cameraView(HttpServletRequest request,Model model){ - String devicepass=request.getParameter("devicepass"); - - String wherestr = "where 1=1 and device_pass='"+devicepass+"' "; - - List list = this.bimCameraService.selectListByWhere(wherestr); - - if(list!=null&&list.size()>0){ - model.addAttribute("devicepass", list.get(0).getInterfaces()); - } - - return "bim/openVLCCamera"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 and device_pass='"+request.getParameter("devicepass")+"' "; - - List list = this.bimCameraService.selectListByWhere(wherestr); - - JSONArray json = JSONArray.fromObject(list.get(0)); - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getListCamera.do") - public ModelAndView getListCamera(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - - List list = this.bimCameraService.selectListByWhere(wherestr); - - JSONArray json = JSONArray.fromObject(list); - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/bim/BIMCurrencyController.java b/src/com/sipai/controller/bim/BIMCurrencyController.java deleted file mode 100644 index da636e5a..00000000 --- a/src/com/sipai/controller/bim/BIMCurrencyController.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.controller.bim; - -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.app.AppDataConfigure; -import com.sipai.entity.bim.BIMCurrency; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.bim.BIMCurrencyService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - - - -@Controller -@RequestMapping("/bim/bIMCurrency") -public class BIMCurrencyController { - @Resource - private MPointService mPointService; - @Resource - private BIMCurrencyService bIMCurrencyService; - - @RequestMapping("getdata.do") - public String getdata(HttpServletRequest request,Model model){ - String unitId=request.getParameter("bizid"); - - JSONArray jsonArray=new JSONArray(); - - List bList=this.bIMCurrencyService.selectListByWhere(" where 1=1 "); - if(bList!=null&&bList.size()>0){ - for (int i = 0; i < bList.size(); i++) { - JSONObject jsonObject=new JSONObject(); - - String mpid=bList.get(i).getMpointCode(); - MPoint mPoint=this.mPointService.selectById(unitId, mpid); - - if(mPoint!=null){ - BigDecimal vale=mPoint.getParmvalue(); - String unit=mPoint.getUnit(); - String numtail=mPoint.getNumtail(); - double endValue=0; - if(vale!=null){ - endValue=CommUtil.round(vale.doubleValue(),Integer.valueOf(numtail)); - } - - String locationId=bList.get(i).getLocationId(); - - jsonObject.put("name",bList.get(i).getTagName()); - jsonObject.put("value", endValue); - jsonObject.put("unit", unit); - jsonObject.put("locationId", locationId); - jsonObject.put("tagId", bList.get(i).getTagId()); - jsonArray.add(jsonObject); - } - - } - } - - model.addAttribute("result", jsonArray); - return "result"; - } - -} diff --git a/src/com/sipai/controller/bim/BimFrameController.java b/src/com/sipai/controller/bim/BimFrameController.java deleted file mode 100644 index 51e25a69..00000000 --- a/src/com/sipai/controller/bim/BimFrameController.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.controller.bim; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.service.equipment.EquipmentCardService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - - -@Controller -@RequestMapping("/bim/bimFrame") -public class BimFrameController { - @Resource - private MPointService mPointService; - @Resource - private EquipmentCardService equipmentCardService; - - /** - * 水厂概览 提供给彭工 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewOfWaterPlants.do") - public String overviewOfWaterPlants(HttpServletRequest request, Model model) { - - return "bim/overviewOfWaterPlants"; - } - - - /** - * 水厂概览 提供给彭工 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/eqView.do") - public String eqView(HttpServletRequest request, Model model) { - String eqCode = request.getParameter("eqCode"); - List equipmentCardList = this.equipmentCardService.selectListByWhere(" where equipmentCardID='"+eqCode+"' "); - if (equipmentCardList != null && equipmentCardList.size() > 0) { - model.addAttribute("equipmentCard", equipmentCardList.get(0)); - } - return "bim/eqView"; - } - - /** - * 人员定位 提供给彭工 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/personnelPositioning.do") - public String personnelPositioning(HttpServletRequest request, Model model) { - return "bim/personnelPositioning"; - } - -} diff --git a/src/com/sipai/controller/bim/BimPageController.java b/src/com/sipai/controller/bim/BimPageController.java deleted file mode 100644 index 0b3dcf86..00000000 --- a/src/com/sipai/controller/bim/BimPageController.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.controller.bim; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.bim.BimRouteData; -import com.sipai.entity.bim.BimRouteEqData; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.bim.BimRouteDataService; -import com.sipai.service.bim.BimRouteEqDataService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import java.util.List; - - -@Controller -@RequestMapping("/bim/page") -public class BimPageController { - @Resource - private BimRouteDataService bimRouteDataService; - @Resource - private ProAlarmService proAlarmService; - @Resource - private BimRouteEqDataService bimRouteEqDataService; - - @RequestMapping("/inspectionPage.do") - public String inspectionPage(HttpServletRequest request, Model model) { - - return "bim/inspectionPage"; - } - - @RequestMapping("/routeData.do") - public String routeData(HttpServletRequest request, Model model) { - - return "bim/routeData"; - } - - @RequestMapping("/getRouteData.do") - public ModelAndView getRouteData(HttpServletRequest request, Model model) { - String code = request.getParameter("code"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - - List bimRouteDataList = this.bimRouteDataService.selectListByWhere("where code='" + code + "' and unitId='" + unitId + "' and type='"+type+"' "); - - model.addAttribute("result", JSONArray.fromObject(bimRouteDataList)); - return new ModelAndView("result"); - } - - @RequestMapping("/getRouteEqData.do") - public ModelAndView getRouteEqData(HttpServletRequest request, Model model) { - String code = request.getParameter("code"); - String unitId = request.getParameter("unitId"); - - List bimRouteEqDataList = this.bimRouteEqDataService.selectListByWhere("where code='" + code + "' and unitId='" + unitId + "'"); - - model.addAttribute("result", JSONArray.fromObject(bimRouteEqDataList)); - return new ModelAndView("result"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/bim/CDBIMController.java b/src/com/sipai/controller/bim/CDBIMController.java deleted file mode 100644 index c6640145..00000000 --- a/src/com/sipai/controller/bim/CDBIMController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.controller.bim; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.bim.BIMCDHomePageTree; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.user.User; -import com.sipai.service.bim.BIMCDHomePageTreeService; -import com.sipai.service.work.GroupManageService; - -import net.sf.json.JSONArray; - -@Controller -@RequestMapping("/bim/CDBIM") -public class CDBIMController { - @Resource - private BIMCDHomePageTreeService bIMCDHomePageTreeService; - - @RequestMapping("/homePage.do") - public String homePage(HttpServletRequest request,Model model){ - - - - return "bim/CDBIMhomePage"; - } - - /** - * 获得个人方案树形结构 - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree.do") - public String getTree(HttpServletRequest request,Model model){ - String id=request.getParameter("id"); - String name=request.getParameter("name"); - - String searchIds=""; - - String whereString=""; - if(id.equals("-1")){ - - }else{ - searchIds=this.bIMCDHomePageTreeService.getTreeidsBySearch(name,request.getParameter("type")); - searchIds = searchIds.replace(",","','"); - whereString+=" and id in ('"+searchIds+"') "; - } - - List list = this.bIMCDHomePageTreeService.selectListByWhere("where 1=1 and type='"+request.getParameter("type")+"' " - + whereString - + "order by morder"); - - String json = this.bIMCDHomePageTreeService.getTreeList(null, list); - - model.addAttribute("result", json); - return "result"; - } - -} diff --git a/src/com/sipai/controller/bim/YsAlarmRecordController.java b/src/com/sipai/controller/bim/YsAlarmRecordController.java deleted file mode 100644 index d0e3f0c5..00000000 --- a/src/com/sipai/controller/bim/YsAlarmRecordController.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sipai.controller.bim; - - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.bim.YsAlarmRecord; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.bim.YsAlarmRecordService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/bim/ysAlarmRecord") -public class YsAlarmRecordController { - @Resource - private YsAlarmRecordService ysAlarmRecordService; - - //维修list - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - return "bim/ysAlarmRecordList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String date = request.getParameter("date");//日期 - String selectType = request.getParameter("selectType"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - - if (date != null && !date.equals("")) { - String[] str = date.split("~"); - wherestr += " and insdt between'" + str[0] + "'and'" + str[1] + "'"; - } - if (selectType != null && !selectType.equals("")) { - if (selectType.equals("0")) {//数据变化 - wherestr += " and record_type = 'job' "; - } - if (selectType.equals("1")) {//原水kafka反馈 - wherestr += " and record_type = 'kafka' "; - } - } - - PageHelper.startPage(page, rows); - List list = this.ysAlarmRecordService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/bot/BotController.java b/src/com/sipai/controller/bot/BotController.java deleted file mode 100644 index f9fd144c..00000000 --- a/src/com/sipai/controller/bot/BotController.java +++ /dev/null @@ -1,337 +0,0 @@ -package com.sipai.controller.bot; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.geom.Cubic; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.bot.Bot; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.bot.Botservice; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/bot/bot") -public class BotController { - @Resource - private Botservice botservice; - @Resource - private UnitService unitService; - @Resource - private CommonFileService commonFileService; - @Resource - private CompanyService companyService; - - - @RequestMapping("/botmanage.do") - public String botmanage(HttpServletRequest request, Model model) { - return "bot/botManage"; - } - - @RequestMapping("/showBotEdit.do") - public String showBotEdit(HttpServletRequest request, Model model, - @RequestParam String bizid) { - Bot bot = new Bot(); - List botList = this.botservice.selectListByWhere("where bizid='" + bizid + "'"); - if (botList != null && botList.size() > 0) { - bot.setId(botList.get(0).getId()); - bot.setBizid(bizid); - bot.setDesignScale(botList.get(0).getDesignScale()); - bot.setEmission(botList.get(0).getEmission()); - bot.setInfluentIndex(botList.get(0).getInfluentIndex()); - bot.setEffluentIndex(botList.get(0).getEffluentIndex()); - bot.setProcess(botList.get(0).getProcess()); - bot.setPrice(botList.get(0).getPrice()); - bot.setCalculation(botList.get(0).getCalculation()); - bot.setSigndate(botList.get(0).getSigndate()); - bot.setFranchisePeriod(botList.get(0).getFranchisePeriod()); - } else { - bot.setId(CommUtil.getUUID()); - bot.setBizid(bizid); - } - model.addAttribute("bot", bot); - - return "bot/botEdit"; - } - - - @RequestMapping("/updateBot.do") - public ModelAndView updateBot(HttpServletRequest request, Model model, - @ModelAttribute Bot bot) { - User cu = (User) request.getSession().getAttribute("cu"); - - //判断是否有该记录 - List botList = this.botservice.selectListByWhere("where id='" + bot.getId() + "'"); - int result = 0; - if (botList != null && botList.size() > 0) { - //更新 - bot.setUpsuser(cu.getId()); - bot.setUpsdt(CommUtil.nowDate()); - result = this.botservice.update(bot); - } else { - //新增 - bot.setInsuser(cu.getId()); - bot.setInsdt(CommUtil.nowDate()); - result = this.botservice.save(bot); - } - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + bot.getId() + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/botList.do") - public String botList(HttpServletRequest request, Model model) { - - return "bot/showBotList"; - } - - @RequestMapping("/botListForApp.do") - public String botListForApp(HttpServletRequest request, Model model) { - - return "bot/showBotListForApp"; - } - - @RequestMapping("/getbotList.do") - public String getbotList(HttpServletRequest request, Model model) { - String bizidx = request.getParameter("bizid"); - String wherestr = "where 1=1 "; - if (bizidx != null && !bizidx.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(bizidx); - String userids = ""; - for (Unit unit : units) { - userids += "'" + unit.getId() + "',"; - } - if (userids != "") { - userids = userids.substring(0, userids.length() - 1); - wherestr += "and bizid in (" + userids + ") "; - } - } - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and process like '%" + request.getParameter("search_name") + "%'"; - - } - - List botList = this.botservice.selectListByWhere(wherestr); - List botJsonList = new ArrayList(); - List initialPointJsonListnew1 = new ArrayList(); - if (botList != null && botList.size() > 0) { - for (int i = 0; i < botList.size(); i++) { - JSONObject botJsonObject = JSONObject.fromObject(botList.get(i)); - - Company company = unitService.getCompById(botList.get(i).getBizid()); - //查文件 - List botfiles = this.commonFileService.selectListByTableAWhere("tb_bot_file", "where masterid='" + botList.get(i).getId() + "'"); - if (botfiles != null && botfiles.size() > 0) { - botJsonObject.put("filetype", "yes"); - botJsonObject.put("fileid", botfiles.get(0).getId()); - - } else { - botJsonObject.put("filetype", "no"); - botJsonObject.put("fileid", ""); - } - if (company != null) { - botJsonObject.put("bizidpid", company.getPid()); - botJsonObject.put("bizname", company.getName()); - } - - botJsonList.add(botJsonObject); - } - - - //按类分 - HashSet hashSet = new HashSet<>(); - for (JSONObject item : botJsonList) { - hashSet.add((String) item.get("bizidpid")); - } - - Iterator iterator = hashSet.iterator(); - while (iterator.hasNext()) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("bizidpid", iterator.next()); - jsonObject2.put("color", getRandColorCode()); - initialPointJsonListnew1.add(jsonObject2); - } - - - for (JSONObject jsonObject2 : initialPointJsonListnew1) { - List codeslist = new ArrayList(); - for (JSONObject item : botJsonList) { - if (jsonObject2.get("bizidpid").equals(item.get("bizidpid"))) { - codeslist.add(item); - } - } - jsonObject2.put("codes", codeslist); - } -// System.out.println("---:"+initialPointJsonListnew1); - request.setAttribute("botlist", initialPointJsonListnew1); - } - - request.setAttribute("result", initialPointJsonListnew1); - return "result"; - } - - @RequestMapping("/doBotEdit.do") - public String doBotEdit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Bot bot = this.botservice.selectById(id); - Company company = unitService.getCompById(bot.getBizid()); - request.setAttribute("bizname", company.getName()); - model.addAttribute("bot", bot); - return "bot/doBotEdit"; - } - - @RequestMapping("/doBotUpdate.do") - public String doBotUpdate(HttpServletRequest request, Model model, - @ModelAttribute("bot") Bot bot) { - User cu = (User) request.getSession().getAttribute("cu"); - bot.setUpsuser(cu.getId()); - bot.setUpsdt(CommUtil.nowDate()); - int res = this.botservice.update(bot); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/getBotdata.do") - public String getBotdata(HttpServletRequest request, Model model, - @RequestParam String unitId) { - JSONObject botObject = new JSONObject(); - - if (unitId != null && !unitId.equals("")) { - Company company = this.companyService.selectByPrimaryKey(unitId); - if (company != null) { - botObject.put("bizname", company.getName()); - } - } - - List botList = this.botservice.selectListByWhere("where bizid='" + unitId + "'"); - if (botList != null && botList.size() > 0) { - botObject.put("designScale", botList.get(0).getDesignScale()); - botObject.put("emission", botList.get(0).getEmission()); - botObject.put("influentIndex", botList.get(0).getInfluentIndex()); - botObject.put("effluentIndex", botList.get(0).getEffluentIndex()); - botObject.put("proess", botList.get(0).getProcess()); - botObject.put("price", botList.get(0).getPrice()); - botObject.put("calculation", botList.get(0).getCalculation()); - botObject.put("signdate", botList.get(0).getSigndate()); - botObject.put("franchisePeriod", botList.get(0).getFranchisePeriod()); - } - request.setAttribute("result", botObject); - - return "result"; - } - - /** - *   - *      * 获取十bai六进制的颜du色zhi代码dao.例如  "#6E36B4" , For HTML ,  - *      * @return String  - *       - */ - public static String getRandColorCode() { - String r, g, b; - Random random = new Random(); - r = Integer.toHexString(random.nextInt(256)).toUpperCase(); - g = Integer.toHexString(random.nextInt(256)).toUpperCase(); - b = Integer.toHexString(random.nextInt(256)).toUpperCase(); - - r = r.length() == 1 ? "0" + r : r; - g = g.length() == 1 ? "0" + g : g; - b = b.length() == 1 ? "0" + b : b; - return r + g + b; - } - - @RequestMapping("/getBotdataForApp.do") - public String getBotdataForApp(HttpServletRequest request, Model model, - @RequestParam String unitId) { - List botList = this.botservice.selectListByWhere("where bizid='" + unitId + "'"); - - JSONObject jsonObject = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - if (botList != null && botList.size() > 0) { - jsonObject.put("code", 1); - jsonObject.put("msg", ""); - for (Bot bot : botList) { - JSONObject jsonObjectD = new JSONObject(); - jsonObjectD.put("id", bot.getId()); - jsonObjectD.put("LGTD", bot.getLgtd()); - if (bot.getType() != null && !bot.getType().equals("")) { - jsonObjectD.put("type", bot.getType()); - } else { - jsonObjectD.put("type", ""); - } - - Company company = companyService.selectByPrimaryKey(bot.getBizid()); - if (company != null) { - jsonObjectD.put("SHORT_NAME", company.getName()); - jsonObjectD.put("ADDRESS", company.getAddress()); - jsonObjectD.put("sname", company.getSname()); - } else { - jsonObjectD.put("SHORT_NAME", ""); - jsonObjectD.put("ADDRESS", bot.getAddress()); - jsonObjectD.put("sname", ""); - } - - jsonObjectD.put("emission", bot.getEmission()); - jsonObjectD.put("LINE_MAP_URL", bot.getLineMapUrl()); - jsonObjectD.put("lgtd", bot.getLgtd()); - jsonObjectD.put("CAPFACT", ""); - jsonObjectD.put("defaultLoad", bot.getDefaultLoad()); - - if (bot.getClickState() != null && !bot.getClickState().equals("")) { - jsonObjectD.put("CLICK_STATE", bot.getClickState()); - } else { - jsonObjectD.put("CLICK_STATE", "false"); - } - - jsonObjectD.put("OUTQ", ""); - jsonObjectD.put("lttd", bot.getLttd()); - jsonObjectD.put("INQ", ""); - jsonObjectD.put("LTTD", bot.getLttd()); - if (bot.getProcess() != null && !bot.getProcess().equals("")) { - jsonObjectD.put("process", bot.getProcess()); - } else { - jsonObjectD.put("process", ""); - } - - jsonObjectD.put("POINT_MAP_URL", bot.getPointMapUrl()); - - jsonObjectD.put("bizid", bot.getBizid()); - jsonObjectD.put("TM", ""); - jsonArray.add(jsonObjectD); - } - - } else { - jsonObject.put("code", 0); - jsonObject.put("msg", ""); - } - jsonObject.put("result", jsonArray); - - request.setAttribute("result", jsonObject); - return "result"; - } -} diff --git a/src/com/sipai/controller/business/BusinessUnitController.java b/src/com/sipai/controller/business/BusinessUnitController.java deleted file mode 100644 index d1e26cf1..00000000 --- a/src/com/sipai/controller/business/BusinessUnitController.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.controller.business; - -import java.io.UnsupportedEncodingException; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.base.LoginService; -import com.sipai.service.business.BusinessUnitService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/business/businessunit") -public class BusinessUnitController { - @Resource - private BusinessUnitService businessUnitService; - - @RequestMapping("/selectById.do") - public ModelAndView selectById(HttpServletRequest request,Model model) { - String businessUnitId = request.getParameter("id"); - BusinessUnit businessUnit = this.businessUnitService.selectById(businessUnitId); - model.addAttribute("result",com.alibaba.fastjson.JSONObject.toJSONString(businessUnit)); - return new ModelAndView("result"); - } - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/business/businessUnitList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "business/businessUnit/showlist.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.businessUnitService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "business/businessUnitAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String businessUnitId = request.getParameter("id"); - BusinessUnit businessUnit = this.businessUnitService.selectById(businessUnitId); - model.addAttribute("businessUnit", businessUnit); - return "business/businessUnitEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnit businessUnit){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - businessUnit.setId(id); - businessUnit.setInsuser(cu.getId()); - businessUnit.setInsdt(CommUtil.nowDate()); - - int result = this.businessUnitService.save(businessUnit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnit businessUnit){ - int result = this.businessUnitService.update(businessUnit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.businessUnitService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.businessUnitService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model) { - return "/business/businessUnitListForSelect"; - } - - @RequestMapping("/getList4Select.do") - public String getList4Select(HttpServletRequest request,Model model) { - JSONArray json=new JSONArray(); - String processTypeId = request.getParameter("processTypeId"); - String wherestr ="where active = '"+CommString.Active_True+"' and process_type_id ='"+processTypeId+"' order by insdt asc"; - List list= businessUnitService.selectListByWhere(wherestr); - if(list!=null && list.size()>0){ - for (BusinessUnit businessUnit : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", businessUnit.getId()); - jsonObject.put("text", businessUnit.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/cmd/CmdController.java b/src/com/sipai/controller/cmd/CmdController.java deleted file mode 100644 index cdbbc9af..00000000 --- a/src/com/sipai/controller/cmd/CmdController.java +++ /dev/null @@ -1,448 +0,0 @@ -package com.sipai.controller.cmd; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.alarm.AlarmLevelsCodeEnum; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.base.BasicConfigure; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.work.Camera; -import com.sipai.quartz.job.*; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.base.BasicConfigureService; -import com.sipai.service.cmd.CmdService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MessageEnum; -import com.sipai.tools.WebSocketCmdUtil; -import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; -import io.swagger.annotations.*; -import org.redisson.api.RBatch; -import org.redisson.api.RMap; -import org.redisson.api.RMapCache; -import org.redisson.api.RedissonClient; -import org.springframework.security.access.method.P; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * 一些控制的方法 包含智能供配电请求过来的 - */ -@Controller -@RequestMapping("/cmd/cmdController") -@Api(value = "/cmd/cmdController", tags = "跟BIM交互接口") -public class CmdController { - @Resource - private CmdService cmdService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private ProAlarmService proAlarmService; - @Resource - private AlarmPointService alarmPointService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentCardCameraService equipmentCardCameraService; - @Resource - private ListenerMessageService listenerMessageSerice; - @Resource - private RedissonClient redissonClient; - @Resource - private BasicConfigureService basicConfigureService; - @Resource - private MPointService mPointService; - - /** - * 设备定位(从设备台账列表点击定位 给BIM发送指令) - */ - @RequestMapping("/locationEquipment.do") - public String locationEquipment(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - String result = "1"; - cmdService.locationEquipment(id); - - //发送弹出摄像头指令 - List cameras = equipmentCardCameraService.selectListByWhere("where eqId = '" + id + "'"); - if (cameras != null && cameras.size() > 0) { - String cameraids = ""; - for (int i = 0; i < cameras.size(); i++) { - cameraids += cameras.get(i).getCameraid() + ","; - } - //弹出摄像头指令 - cmdService.locationCameraOpenMore(cameraids); - } - - //删除设备附属信息 - model.addAttribute("result", result); - return "result"; - } - - /** - * 三维联动(从报警服务请求过来的测量点Id,然后去查对应的设备和设备下关联的摄像头,推送ws给三维) - */ - @RequestMapping("/linkBIM4Alarm.do") - public String linkBIM4Alarm(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - String result = "1"; - - MPoint mPoint = mPointService.selectById(id); - if (mPoint != null && mPoint.getEquipmentid() != null && !mPoint.getEquipmentid().equals("")) { - //定位设备 - cmdService.locationEquipment(mPoint.getEquipmentid()); - - //关闭之前的摄像头 - cmdService.locationCameraClose(""); - - //发送弹出摄像头指令 - List cameras = equipmentCardCameraService.selectListByWhere("where eqId = '" + mPoint.getEquipmentid() + "'"); - if (cameras != null && cameras.size() > 0) { - String cameraids = ""; - for (int i = 0; i < cameras.size(); i++) { - cameraids += cameras.get(i).getCameraid() + ","; - } - cmdService.locationCameraOpenMore2(cameraids); - } else { -// cmdService.locationCameraClose(""); - } - } - - //删除设备附属信息 - model.addAttribute("result", result); - return "result"; - } - - /** - * 设备定位(从设备台账列表点击 给BIM发送指令) - */ - @RequestMapping("/locationUser.do") - public String locationUser(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - String result = "1"; - cmdService.locationUser(id); - //删除设备附属信息 - model.addAttribute("result", result); - return "result"; - } - - /** - * 接收第三方请求数据(万利达) 对BIM发送指令 ----------- 设备报警 - */ - @RequestMapping("/locationWLD.do") - public String locationWLD(HttpServletRequest request, Model model, @RequestParam(value = "equipmentCardId") String equipmentCardId, @RequestParam(value = "event") String event) { - String itemName = request.getParameter("itemName"); - String startTime = request.getParameter("startTime"); - System.out.println("测试测试测试:" + equipmentCardId + "-------" + event + "-------" + itemName + "--------" + startTime); - EquipmentCard equipmentCard = equipmentCardService.selectByEquipmentCardId(equipmentCardId); - if (equipmentCard != null) { - //查询摄像头关联信息 - String cameraids = ""; - List cameras = equipmentCardCameraService.selectListByWhere("where eqId = '" + equipmentCard.getId() + "'"); - if (cameras != null && cameras.size() > 0) { - for (int i = 0; i < cameras.size(); i++) { - cameraids += cameras.get(i).getCameraid() + ","; - } - } - - //新报警 - String alarmType = AlarmMoldCodeEnum.Type_ZNPD.getKey(); - String pointCode = equipmentCard.getEquipmentcardid(); - String pointName = equipmentCard.getEquipmentname(); - String alarmTime = startTime; - String bizId = equipmentCard.getBizid(); - String alarmLevel = AlarmLevelsCodeEnum.level1.getKey(); - String describe = "智能供配电设备报警:" + itemName; - String nowValue = "1"; - String recoverValue = "0"; - String processSectionCode = ""; - String processSectionName = ""; - - String sql = "where point_code = '" + equipmentCardId + "' and alarm_type = '" + AlarmMoldCodeEnum.Type_ZNPD + "' and biz_id = '" + equipmentCard.getBizid() + "' and status ='" + ProAlarm.STATUS_ALARM + "' and alarm_level = '" + AlarmLevelsCodeEnum.level1 + "' order by insdt desc"; - List list = proAlarmService.selectListByWhere(equipmentCard.getBizid(), sql); - if (list != null && list.size() > 0) { - System.out.println("已存在:" + equipmentCardId); - //已存在报警 - if (event != null && event.equals("RECOVERY")) { - try { - //1.关闭摄像头指令 - cmdService.locationCameraClose(cameraids); - } catch (Exception e) { - System.out.println("异常1------------"); - } - - //2.报警恢复 - int result = this.alarmPointService.alarmRecover(bizId, pointCode, alarmTime, recoverValue); - if (result == 1) { - System.out.println("新增智能供配电报警恢复"); - } - } - } else { - System.out.println("新报警:" + equipmentCardId); - if (equipmentCard.getProcesssectionid() != null && !equipmentCard.getProcesssectionid().equals("")) { - ProcessSection processSection = processSectionService.selectById(equipmentCard.getProcesssectionid()); - if (processSection != null) { - processSectionCode = processSection.getCode(); - processSectionName = processSection.getName(); - } - } - if (event != null && event.equals("NEW")) { - try { - //1.发送设备定位指令 - cmdService.locationEquipment(equipmentCard.getId()); - //2.弹出摄像头指令 - cmdService.locationCameraOpenMore(cameraids); - } catch (Exception e) { - System.out.println("异常2------------"); - } - - //3.新增报警 - System.out.println("保存报警:" + equipmentCardId); - int result = this.alarmPointService.insertAlarm(bizId, null, alarmType, pointCode, pointName, alarmTime, alarmLevel, describe, nowValue, processSectionCode, processSectionName); - if (result == 1) { - System.out.println("新增智能供配电报警成功"); - } else { - System.out.println("新增智能供配电报警失败"); - } - } - } - } - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * 接收第三方请求数据(万利达) 对BIM发送指令 ----------- 开合闸 - */ - @RequestMapping("/locationWLD2.do") - public String locationWLD2(HttpServletRequest request, Model model, @RequestParam(value = "equipmentCardId") String equipmentCardId, @RequestParam(value = "st") String st, @RequestParam(value = "startTime") String startTime) { -// System.out.println(equipmentCardId + "-------" + st + "-------" + CommUtil.nowDate()); - EquipmentCard equipmentCard = equipmentCardService.selectByEquipmentCardId(equipmentCardId); - if (equipmentCard != null) { - //发送设备定位指令 - cmdService.locationEquipment(equipmentCard.getId()); - - //发送弹出摄像头指令 - List cameras = equipmentCardCameraService.selectListByWhere("where eqid = '" + equipmentCard.getId() + "'"); - if (cameras != null && cameras.size() > 0) { - /*JSONObject cameraJson = JSONObject.parseObject(MessageEnum.THE_OPENCAM.toString()); - Camera camera01 = cameraService.selectById(cameras.get(0).getCameraid()); - if ("dahua".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/cam/realmonitor?channel=" + camera01.getChannel() + "&subtype=0"; - cameraJson.put("objId", came); - cameraJson.put("action", "play[开合闸]"); - } else if ("hikvision".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/h264/ch" + camera01.getChannel() + "/main/av_stream"; - cameraJson.put("objId", came); - cameraJson.put("action", "play[开合闸]"); - } - //调用指令给BIM发消息(摄像头) - WebSocketCmdUtil.send(cameraJson); - int camera2 = saveMessage(cameraJson.get("cmdType").toString(), "标识开合闸1_" + cameraJson.get("objId").toString(), cameraJson.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - }*/ - String cameraids = ""; - for (int i = 0; i < cameras.size(); i++) { - cameraids += cameras.get(i).getCameraid() + ","; - } - //弹出摄像头指令 - cmdService.locationCameraOpenMore(cameraids); - } - } - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 从mqtt客户端接收指令 通过wms发给BIM (其他系统也可以) - * - * @param request - * @param model - * @param measurepointId - * @return - */ - @RequestMapping("/handleOtherSystem.do") - public String handleOtherSystem(HttpServletRequest request, Model model, @RequestParam(value = "measurepointId") String measurepointId, @RequestParam(value = "dataType") String dataType, @RequestParam(value = "value") String value, @RequestParam(value = "listenerName") String listenerName) { - cmdService.handleOtherSystem(measurepointId, dataType, value, listenerName); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 从沙口上位机接收语音 通过wms发给BIM - * - * @param request - * @param model - * @param value - * @return - */ - @ApiOperation(value = "上位机接收语音 通过wms发给BIM", notes = "上位机接收语音 通过wms发给BIM", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "value", value = "语音内容字符串", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/handle4Speech.do", method = RequestMethod.POST) - @ResponseBody - public String handle4Speech(HttpServletRequest request, Model model, @RequestParam(value = "value") String value) { - System.out.println("收到普通语音(" + CommUtil.nowDate() + "):" + value); - //发送语音 - cmdService.handle4Speech(value); - - //调用语音及后续处理 - cmdService.handle4Model(value); - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 接收报警推送来的内容+专家建议 通过wms 发给BIM 前端会请求好几次到接口,通过redis过滤只推送一条到BIM - * - * @param request - * @param model - * @param value - * @return - */ - @ApiOperation(value = "上位机接收语音 通过wms发给BIM", notes = "上位机接收语音 通过wms发给BIM", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "value", value = "语音内容字符串", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/handle4SpeechAlarm.do", method = RequestMethod.POST) - @ResponseBody - public String handle4SpeechAlarm(HttpServletRequest request, Model model, - @RequestParam(value = "value") String value, - @RequestParam(value = "mpId") String mpId) { - System.out.println("收到报警语音(" + CommUtil.nowDate() + "):" + mpId + value); - - RBatch batch = redissonClient.createBatch(); - RMapCache map_redis = redissonClient.getMapCache("alarm_handle_repeat"); - - if (map_redis.get(mpId) != null) { - if (map_redis.get(mpId).equals("1")) { - //重复 - } else { - batch.getMapCache("alarm_handle_repeat").fastPutAsync(mpId, "1", 10, TimeUnit.SECONDS); - batch.execute(); - //发送语音 - cmdService.handle4Speech(value); - } - - } else { - batch.getMapCache("alarm_handle_repeat").fastPutAsync(mpId, "1", 10, TimeUnit.SECONDS); - batch.execute(); - //发送语音 - cmdService.handle4Speech(value); - } - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 存收发记录 - * - * @param cmdtype - * @param objid - * @param action - * @return - */ - private int saveMessage(String cmdtype, String objid, String action) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setId(CommUtil.getUUID()); - listenerMessage.setCmdtype(cmdtype); - listenerMessage.setObjid(objid); - listenerMessage.setAction(action); - listenerMessage.setInsdt(CommUtil.nowDate()); - int save = listenerMessageSerice.save(listenerMessage); - return save; - } - - @RequestMapping("/model_jy.do") - public String model_jy(HttpServletRequest request, Model model) { - ScheduleJob scheduleJob = null; - ModelJob_FSSK_JY1 mojob = new ModelJob_FSSK_JY1(); - mojob.dataSave(scheduleJob); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/model_bz1.do") - public String model_bz1(HttpServletRequest request, Model model) { - ScheduleJob scheduleJob = null; - ModelJob_FSSK_BZNH_1 mojob = new ModelJob_FSSK_BZNH_1(); - mojob.dataSave(scheduleJob); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/model_bz2.do") - public String model_bz2(HttpServletRequest request, Model model) { - ScheduleJob scheduleJob = null; - ModelJob_FSSK_BZNH_2 mojob = new ModelJob_FSSK_BZNH_2(); - mojob.dataSave(scheduleJob); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取报警弹窗的任务头像路径 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getAlarmImg.do") - public String getAlarmImg(HttpServletRequest request, Model model) { - BasicConfigure basicConfigure = basicConfigureService.selectById("alarm-layer-img"); - if (basicConfigure != null && basicConfigure.getAbspath() != null && !basicConfigure.getAbspath().equals("")) { - model.addAttribute("result", basicConfigure.getAbspath()); - } else { - model.addAttribute("result", ""); - } - return "result"; - } - - // String sdt = CommUtil.subplus(patrolPlan.getPlanIssuanceDate(), patrolPlan.getAdvanceDay() * (-1) + "", "day"); - @RequestMapping("/test.do") - public String test(HttpServletRequest request, Model model) { - String sdt = "2027-03-01"; - int edt = 45; - String s = CommUtil.subplus(sdt, edt * (-1) + "", "day"); - System.out.println(s); - return "result"; - } -} diff --git a/src/com/sipai/controller/command/EmergencyConfigureController.java b/src/com/sipai/controller/command/EmergencyConfigureController.java deleted file mode 100644 index f6c73cf9..00000000 --- a/src/com/sipai/controller/command/EmergencyConfigureController.java +++ /dev/null @@ -1,2998 +0,0 @@ -package com.sipai.controller.command; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.command.*; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.command.*; -import com.sipai.service.company.CompanyService; -import com.sipai.service.msg.MsgService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.tools.WangEditor; -import com.sipai.websocket.MsgWebSocket2; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.io.IOException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/command/emergencyConfigure") -public class EmergencyConfigureController { - - @Resource - private EmergencyConfigureService emergencyConfigureService; - @Resource - private EmergencyConfigureInfoService emergencyConfigureInfoService; - @Resource - private EmergencyRecordsService emergencyRecordsService; - @Resource - private EmergencyRecordsDetailService emergencyRecordsDetailService; - @Resource - private EmergencyConfigureWorkOrderService emergencyConfigureWorkOrderService; - @Resource - private EmergencyRecordsWorkOrderService emergencyRecordsWorkOrderService; - @Resource - private EmergencyConfigurefileService emergencyConfigurefileService; - @Resource - private CameraService cameraService; - @Resource - private CompanyService companyService; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private MsgService msgService; - @Resource - private MsgTypeService msgtypeService; - - @RequestMapping("/showMenuTree_new.do") - public String showMenuTree_new(HttpServletRequest request, Model model) { - return "command/menuManage"; - } - - @RequestMapping("/showMenuTree_NS.do") - public String showMenuTree_NS(HttpServletRequest request, Model model) { - return "command/menuManage_NS"; - } - - /*** - * 异常事件演练 - * @param request - * @param model - * @return - */ - @RequestMapping("/showMenuTreeDrill.do") - public String showMenuTreeDrill(HttpServletRequest request, Model model) { - return "command/drillManage"; - } - - @RequestMapping("/showMenu4Select_new.do") - public String showMenu4Select(HttpServletRequest request, Model model) { - return "command/menu4select"; - } - - @RequestMapping("/saveMenu_new.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("menu") EmergencyConfigure emergencyConfigure) { - emergencyConfigure.setId(CommUtil.getUUID()); - if (emergencyConfigure.getPid() == null || emergencyConfigure.getPid().isEmpty()) { - emergencyConfigure.setPid("-1"); - } - int result = this.emergencyConfigureService.saveMenu(emergencyConfigure); - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 北控版本 - * - * @param request - * @param model - * @param id - * @param unitId - * @return - */ - @RequestMapping("/showMenuEdit_new.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - if (emergencyConfigureService.getMenuById(emergencyConfigure.getPid()) != null) - emergencyConfigure.setPname(emergencyConfigureService.getMenuById(emergencyConfigure.getPid()).getName()); - model.addAttribute("emergencyConfigure", emergencyConfigure); - model.addAttribute("bizid", unitId); - return "command/emergencyConfigureEdit"; - } - - /** - * 北控版本 - * - * @param request - * @param model - * @param id - * @param unitId - * @return - */ - @RequestMapping("/showMenuEdit_NS.do") - public String showMenuEdit_NS(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - if (emergencyConfigureService.getMenuById(emergencyConfigure.getPid()) != null) - emergencyConfigure.setPname(emergencyConfigureService.getMenuById(emergencyConfigure.getPid()).getName()); - model.addAttribute("menu", emergencyConfigure); - - /* - * 判断该id是在树的第几层级 - */ - int tags = -1; - String ids = ""; - if (id != null && !id.equals("")) { - if (emergencyConfigure.getPid().equals("-1")) { - tags = 1; - } else { - List list = this.emergencyConfigureService.selectListByWhere(" where pid = '-1'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - ids += "'" + list.get(i).getId() + "',"; - } - if (ids.indexOf(emergencyConfigure.getPid()) != -1) { //二级菜单 - tags = 2; - } else { - tags = 3; - } - } - } - } - model.addAttribute("tags", tags); - model.addAttribute("bizid", unitId); - return "command/emergencyConfigureEdit4NS"; - } - - /*** - * 异常事件演练的展示页面 - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/showMenuEditDrill.do") - public String doeditdrill(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - if (emergencyConfigureService.getMenuById(emergencyConfigure.getPid()) != null) - emergencyConfigure.setPname(emergencyConfigureService.getMenuById(emergencyConfigure.getPid()).getName()); - model.addAttribute("menu", emergencyConfigure); - - /* - * 判断该id是在树的第几层级 - */ - int tags = -1; - String ids = ""; - if (id != null && !id.equals("")) { - if (emergencyConfigure.getPid().equals("-1")) { - tags = 1; - } else { - List list = this.emergencyConfigureService.selectListByWhere(" where pid = '-1'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - ids += "'" + list.get(i).getId() + "',"; - } - if (ids.indexOf(emergencyConfigure.getPid()) != -1) { //二级菜单 - tags = 2; - } else { - tags = 3; - } - } - } - } - model.addAttribute("tags", tags); - return "command/drillmenuEdit"; - } - - /** - * 预案列表 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/getFuncJsonYN.do") - public String getFuncJsonYN(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List list = this.emergencyConfigureService.selectListByWhere("where pid='" + id + "' order by ord asc"); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getFuncJson2.do") - public String getFuncJson(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List list = this.emergencyConfigureService.selectListByWhere("where pid='" + id + "'"); - //System.out.println("id:::"+id); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - - return "result"; - } - - @RequestMapping("/showMenuAdd_new.do") - public String showMenuAdd_new(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "unitId") String unitId) { - if (pid != null && !pid.equals("")) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(pid); - model.addAttribute("pname", emergencyConfigure.getName()); - } - - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(pid); - /* - * 判断该id是在树的第几层级 - */ - int tags = -1; - String ids = ""; - if (pid != null && !pid.equals("")) { - if (emergencyConfigure.getPid().equals("-1")) { - tags = 1; - } else { - List list = this.emergencyConfigureService.selectListByWhere(" where pid = '-1'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - ids += "'" + list.get(i).getId() + "',"; - } - if (ids.indexOf(emergencyConfigure.getPid()) != -1) { //二级菜单 - tags = 2; - } else { - tags = 3; - } - } - } - } - model.addAttribute("tags", tags); - model.addAttribute("bizid", unitId); - return "command/menuAdd"; - } - - /** - * 增加目录 - * - * @param request - * @param model - * @param pid - * @param unitId - * @return - */ - @RequestMapping("/doaddSimple.do") - public String doaddSimple(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "unitId") String unitId) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(pid); - model.addAttribute("pname", emergencyConfigure.getName()); - } - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("bizid", unitId); - return "command/menuAddSimple"; - } - - @RequestMapping("/updateMenu_new.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("menu") EmergencyConfigure emergencyConfigure) { - emergencyConfigure.setFirstpersonid(request.getParameter("firstpersonid")); - int result = this.emergencyConfigureService.updateMenu(emergencyConfigure); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - /** - * 北控版本 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/getEdit.do") - public ModelAndView getEdit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - if (emergencyConfigureService.getMenuById(emergencyConfigure.getPid()) != null) { - emergencyConfigure.setPname(emergencyConfigureService.getMenuById(emergencyConfigure.getPid()).getName()); - } - JSONObject jsonObject = JSONObject.fromObject(emergencyConfigure); - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - @RequestMapping("/updateMenuLf.do") - public ModelAndView updateMenuLf(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "graphData") String graphData) { - EmergencyConfigure emergencyConfigure =this.emergencyConfigureService.getMenuById(id); - emergencyConfigure.setNodes(graphData); - int result = this.emergencyConfigureService.updateMenu(emergencyConfigure); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteMenu_new.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @ModelAttribute("menu") EmergencyConfigure emergencyConfigure) { - String msg = ""; - int result = 0; - List mlist = this.emergencyConfigureService.selectListByWhere(" where pid = '" + emergencyConfigure.getId() + "'"); - //判断是否有子菜单,有的话不能删除 - if (mlist != null && mlist.size() > 0) { - msg = "请先删除子菜单"; - } else { - result = this.emergencyConfigureService.deleteMenuById(emergencyConfigure.getId()); - if (result > 0) { - //删除菜单下的按钮 - this.emergencyConfigureService.deleteByPid(emergencyConfigure.getId()); - - } else { - msg = "删除失败"; - } - } - - model.addAttribute("result", "{\"res\":\"" + result + "\",\"msg\":\"" + msg + "\"}"); - - return new ModelAndView("result"); - } - - @RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { - //List list = this.emergencyConfigureService.selectListByWhere("where type='menu' order by morder"); - String unitId = request.getParameter("unitId"); - List list = this.emergencyConfigureService.selectListByWhere("where st='启用' and bizid = '" + unitId + "' order by ord"); - /*List tree = new ArrayList(); - for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - node.setIconCls(resource.getImage()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("action", resource.getAction()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - String json = emergencyConfigureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doprocess.do") - public String doprocess(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "category") String category) { - - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - model.addAttribute("titleName", emergencyConfigure.getName()); - - String ip; - String port; - ip = request.getServerName(); - port = String.valueOf(request.getServerPort()); - model.addAttribute("ip", ip); - model.addAttribute("port", port); - - /* - * 二级菜单 - */ - if (category != null && category.equals("2")) { - List mlist2 = this.emergencyConfigureService.selectListByWhere(" where grade='2' and pid = '" + emergencyConfigure.getId() + "'"); - List mlist3 = this.emergencyConfigureService.selectListByWhere(" where grade='3' and pid = '" + emergencyConfigure.getId() + "'"); - - JSONArray jsonArray2 = new JSONArray();//二级预案 - JSONArray jsonArray3 = new JSONArray();//三级预案 - int y2 = 100; - int y3 = 100; - if (mlist2 != null && mlist2.size() > 0) { - for (int i = 0; i < mlist2.size(); i++) { - JSONObject jsonObject = new JSONObject(); - if (mlist2.get(i).getId() != null) { - jsonObject.put("id", mlist2.get(i).getId().toString()); - } - if (mlist2.get(i).getName() != null) { - int clength = mlist2.get(i).getName().toString().length(); - if (clength > 10) { - jsonObject.put("name", mlist2.get(i).getName().toString().substring(0, 10)); - jsonObject.put("ename", mlist2.get(i).getName().toString().substring(10, clength)); - } else { - jsonObject.put("name", mlist2.get(i).getName().toString()); - } - - } - y2 = y2 + 100; - jsonObject.put("person_y", y2); - y2 = y2 + 100; - jsonObject.put("status_y", y2); - jsonArray2.add(jsonObject); - } - } - if (mlist3 != null && mlist3.size() > 0) { - for (int i = 0; i < mlist3.size(); i++) { - JSONObject jsonObject = new JSONObject(); - if (mlist3.get(i).getId() != null) { - jsonObject.put("id", mlist3.get(i).getId().toString()); - } - if (mlist3.get(i).getName() != null) { - int clength = mlist3.get(i).getName().toString().length(); - if (clength > 10) { - jsonObject.put("name", mlist3.get(i).getName().toString().substring(0, 10)); - jsonObject.put("ename", mlist3.get(i).getName().toString().substring(10, clength)); - } else { - jsonObject.put("name", mlist3.get(i).getName().toString()); - } - - } - y3 = y3 + 100; - jsonObject.put("person_y", y3); - y3 = y3 + 100; - jsonObject.put("status_y", y3); - jsonArray3.add(jsonObject); - } - } - int x = 500; - if (mlist2.size() > mlist3.size()) { - if (mlist2.size() <= 2) { - request.setAttribute("x2", x - 400); - request.setAttribute("x3", x + 400); - } else { - request.setAttribute("x2", x - 400); - request.setAttribute("x3", x + 400); - } - } else { - if (mlist3.size() <= 2) { - request.setAttribute("x2", x - 400); - request.setAttribute("x3", x + 400); - } else { - request.setAttribute("x2", x - 400); - request.setAttribute("x3", x + 400); - } - } - request.setAttribute("x", x); - - if (y2 > y3) { - model.addAttribute("end_y", y2 + 100); - model.addAttribute("center_y", y2 / 2 + 100); - } else { - model.addAttribute("end_y", y3 + 100); - model.addAttribute("center_y", y3 / 2 + 100); - } - model.addAttribute("jsonArray2", jsonArray2);//矩形框json - model.addAttribute("jsonArray3", jsonArray3);//矩形框json - //System.out.println("jsonArray2:::"+jsonArray2); - //System.out.println("jsonArray3:::"+jsonArray3); - - return "command/processEmergencyConfigure2"; - } - /* - * 三级菜单 - */ - if (category != null && category.equals("3")) { - JSONArray jsonArray = new JSONArray(); - //查询有多少层级 - List mlist = this.emergencyConfigureInfoService.selectrankListByWhere(" where pid = '" + emergencyConfigure.getId() + "' group by rank order by rank"); - //System.out.println(" where pid = '"+emergencyConfigure.getId()+"' group by rank order by rank"); - int y = 100; - if (mlist != null && mlist.size() > 0) { - //循环层级 - for (int i = 0; i < mlist.size(); i++) { - y += 100; - int x = 500; - if (i == 0) { - List mlist2 = this.emergencyConfigureInfoService.selectListByWhere("where pid = '" + emergencyConfigure.getId() + "' and rank = '" + mlist.get(i).getRank() + "' order by itemnumber"); - if (mlist2 != null && mlist2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("contents", mlist2.get(i).getContents()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - jsonArray.add(jsonObject); - } - } else { - //要改掉sql - List mlist2 = this.emergencyConfigureInfoService.selectcontentsstartListByWhere("where m.pid='" + emergencyConfigure.getId() + "' and d.pid='" + emergencyConfigure.getId() + "' and m.rank='" + mlist.get(i).getRank() + "' order by m.itemnumber"); - //System.out.println("where m.pid='"+emergencyConfigure.getId()+"' and d.pid='"+emergencyConfigure.getId()+"' and m.rank='"+mlist.get(i).getRank()+"' order by m.itemnumber"); - if (mlist2 != null && mlist2.size() > 0) { - //循环相同层级中的节点数 - for (int j = 0; j < mlist2.size(); j++) { - JSONObject jsonObject = new JSONObject(); - //该层级只有一个节点 - if (mlist2.size() == 1) { - jsonObject.put("contents", mlist2.get(j).getContents()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (mlist2.get(j).getContentsstart() != null && !mlist2.get(j).getContentsstart().equals("")) { - jsonObject.put("startLine", mlist2.get(j).getContentsstart().toString()); - jsonObject.put("endLine", mlist2.get(j).getContents().toString()); - } - } else { - //该节点为复数 - if (mlist2.size() % 2 == 0) { - if (j % 2 == 0) { - x = x - (j + 1) * 100; - jsonObject.put("contents", mlist2.get(j).getContents().toString()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (mlist2.get(j).getContentsstart() != null && !mlist2.get(j).getContentsstart().equals("")) { - jsonObject.put("startLine", mlist2.get(j).getContentsstart().toString()); - jsonObject.put("endLine", mlist2.get(j).getContents().toString()); - } - } else { - x = x + (j + 1) * 100; - jsonObject.put("contents", mlist2.get(j).getContents().toString()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (mlist2.get(j).getContentsstart() != null && !mlist2.get(j).getContentsstart().equals("")) { - jsonObject.put("startLine", mlist2.get(j).getContentsstart().toString()); - jsonObject.put("endLine", mlist2.get(j).getContents().toString()); - } - } - //该节点为单数 - } else { - //中间的节点 - if (j == 0) { - jsonObject.put("contents", mlist2.get(j).getContents().toString()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (mlist2.get(j).getContentsstart() != null && !mlist2.get(j).getContentsstart().equals("")) { - jsonObject.put("startLine", mlist2.get(j).getContentsstart().toString()); - jsonObject.put("endLine", mlist2.get(j).getContents().toString()); - } - //两边节点 - } else { - if (j % 2 == 0) { - x = x - (j) * 100; - jsonObject.put("contents", mlist2.get(j).getContents().toString()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (mlist2.get(j).getContentsstart() != null && !mlist2.get(j).getContentsstart().equals("")) { - jsonObject.put("startLine", mlist2.get(j).getContentsstart().toString()); - jsonObject.put("endLine", mlist2.get(j).getContents().toString()); - } - } else { - x = x + (j) * 100; - jsonObject.put("contents", mlist2.get(j).getContents().toString()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (mlist2.get(j).getContentsstart() != null && !mlist2.get(j).getContentsstart().equals("")) { - jsonObject.put("startLine", mlist2.get(j).getContentsstart().toString()); - jsonObject.put("endLine", mlist2.get(j).getContents().toString()); - } - } - } - } - } - jsonArray.add(jsonObject); - } - } - - } - } - -// String startIds = ""; -// List mlist2 = this.emergencyConfigureInfoService.selectstartconditionListByWhere(" where startupcondition is not null and startupcondition !='' and pid = '"+emergencyConfigure.getId()+"' group by startupcondition order by startupcondition"); -// if (mlist2!=null && mlist2.size()>0) { -// for (int j = 0; j < mlist2.size(); j++) { -// startIds +=mlist2.get(j).getStartupcondition()+","; -// } -// } -// int yb = 0; -// if(mlist2.size()!=0 && mlist2.size()>5){ -// yb = 20; -// }else { -// yb = 50; -// } -// -// JSONObject jsonObject=new JSONObject(); -// y=y+yb+10; -// jsonObject.put("contents", mlist.get(0).getContents().toString()); -// jsonObject.put("contents_x", 200); -// jsonObject.put("contents_y", y); -// y=y+yb; -// jsonObject.put("status_y", y);//是否完成Y轴 -// jsonArray.add(jsonObject); -// -// String[] ids = startIds.split(",");//ids=[编号1,编号4]之类的 -// if(ids!=null){ -// //分组后 查询各组的条数 -// for (int i = 0; i < ids.length; i++) { -// JSONObject jsonObject2=new JSONObject(); -// List mlist3 = this.emergencyConfigureInfoService.selectListByWhere(" where startupcondition is not null and pid = '"+emergencyConfigure.getId()+"' and startupCondition='"+ids[i]+"' order by startupcondition"); -// if(mlist3!=null && mlist3.size()>0){ -// if(mlist3.size()==1){ -// //X轴为中心轴 -// y=y+yb; -// jsonObject2.put("contents", mlist3.get(0).getContents().toString()); -// jsonObject2.put("contents_x", 200); -// jsonObject2.put("contents_y", y); -// y=y+yb; -// jsonObject2.put("status_y", y);//是否完成Y轴 -// jsonArray.add(jsonObject2); -// }else{ -// if(mlist3.size()%2==0){//为复数时 -// int x = 200; -// -// for (int j = 0; j < mlist3.size(); j++) { -// if(j%2==0){ -// x = x+(j+1)*yb*2; -// //System.out.println(x); -// jsonObject2.put("contents", mlist3.get(j).getContents().toString()); -// jsonObject2.put("contents_x", x); -// jsonObject2.put("contents_y", y+yb); -// jsonObject2.put("status_y", y+yb*2);//是否完成Y轴 -// }else { -// x = x-(j+1)*yb*2; -// //System.out.println(x); -// jsonObject2.put("contents", mlist3.get(j).getContents().toString()); -// jsonObject2.put("contents_x", x); -// jsonObject2.put("contents_y", y+yb); -// jsonObject2.put("status_y", y+yb*2);//是否完成Y轴 -// } -// jsonArray.add(jsonObject2); -// } -// y=y+yb*2; -// -// }else{//为单数时 -// int x = 200; -// for (int j = 0; j < mlist3.size(); j++) { -// if(j==0){ -// x = x; -// //System.out.println(x); -// if(j==0){ -// y=y+yb; -// } -// jsonObject2.put("contents", mlist3.get(j).getContents().toString()); -// jsonObject2.put("contents_x", x); -// jsonObject2.put("contents_y", y); -// jsonObject2.put("status_y", y+yb);//是否完成Y轴 -// }else { -// if(j%2==0){ -// x = x+(j)*yb; -// //System.out.println(x); -// if(j==0){ -// y=y+yb; -// } -// jsonObject2.put("contents", mlist3.get(j).getContents().toString()); -// jsonObject2.put("contents_x", x); -// jsonObject2.put("contents_y", y); -// if(j==mlist3.size()-1){ -// y=y+yb; -// } -// //jsonObject2.put("status_y", y);//是否完成Y轴 -// }else { -// x = x-(j)*yb; -// //System.out.println(x); -// if(j==0){ -// y=y+yb; -// } -// jsonObject2.put("contents", mlist3.get(j).getContents().toString()); -// jsonObject2.put("contents_x", x); -// jsonObject2.put("contents_y", y); -// if(j==0){ -// y=y+yb; -// } -// //jsonObject2.put("status_y", y);//是否完成Y轴 -// } -// } -// jsonArray.add(jsonObject2); -// -// } -// } -// } -// } -// } -// } -// request.setAttribute("end_y", y+yb); -// request.setAttribute("jsonArray", jsonArray);//矩形框json - } - - request.setAttribute("end_y", y + 100); - request.setAttribute("jsonArray", jsonArray);//矩形框json - //System.out.println(jsonArray); - return "command/processEmergencyConfigure"; - } - - return null; - } - - /*** - * 异常事件演练 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/dodrill.do") - public String dodrill(HttpServletRequest request, Model model - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String firstId = request.getParameter("firstId");//一级菜单Id - String secondId = request.getParameter("secondId");//二级菜单Id - String bizid = request.getParameter("bizid");//厂id - - List emergencyRecordsList = this.emergencyRecordsService.selectListByWhere("where type='1' and status!='10' and thirdmenu='" + id + "'"); - if (emergencyRecordsList != null && emergencyRecordsList.size() > 0) { -// return new ModelAndView("redirect:/dodrillview?id="+emergencyRecordsList.get(0).getId()); - return "redirect:dodrillview.do?id=" + emergencyRecordsList.get(0).getId() + "&bizid=" + bizid; - } else { - - //获得自身属性 - String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " - + "from tb_Repair_EmergencyConfigure m " - + "left outer join tb_user u on u.id=m.firstPerson " - + "where m.id='" + id + "' "; - // List emergencyConfigure = this.emergencyConfigureService.selectusernameByWhere("where m.id='"+id+"' "); - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - - Company company = this.unitService.getCompById(emergencyConfigure.getBizid()); - String emergencyRecordId = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - - EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - - if (emergencyConfigure != null) { - request.setAttribute("titleName", emergencyConfigure.getName()); - request.setAttribute("meno", emergencyConfigure.getMemo()); - request.setAttribute("_firstPerson", emergencyConfigure.get_firstPerson()); - request.setAttribute("id", emergencyRecordId); - - /* - * 先对演练记录的主表插入数据 - */ - EmergencyRecords emergencyRecords = new EmergencyRecords(); - emergencyRecords.setId(emergencyRecordId); - emergencyRecords.setInsuser(cu.getId()); - emergencyRecords.setInsdt(CommUtil.nowDate()); - emergencyRecords.setBizid(emergencyConfigure.getBizid()); - emergencyRecords.setStarter(cu.getId());//演练/启动人 - emergencyRecords.setStarttime(CommUtil.nowDate());//启动时间 - emergencyRecords.setStatus("5"); - emergencyRecords.setGrade(emergencyConfigure.getGrade()); - emergencyRecords.setFirstmenu(firstId); - emergencyRecords.setSecondmenu(secondId); - emergencyRecords.setThirdmenu(emergencyConfigure.getId()); - emergencyRecords.setType(1);//0为实际预案 1为预案演练 - emergencyRecords.setName(emergencyConfigure.getName()); - emergencyRecords.setFirstperson(emergencyConfigure.getFirstpersonid()); - this.emergencyRecordsService.save(emergencyRecords); - - /* - * 插入附表记录---从配置的附表插入到记录的附表 - */ - //dosaveDetail - List list = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + emergencyConfigure.getId() + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - String nodeid = CommUtil.getUUID(); - emergencyRecordsDetail.setId(nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(emergencyRecordId); - emergencyRecordsDetail.setStatus("0"); - emergencyRecordsDetail.setOrd(list.get(i).getOrd()); - emergencyRecordsDetail.setRank(list.get(i).getRank()); - emergencyRecordsDetail.setPersonliableid(list.get(i).getPersonliableid()); - emergencyRecordsDetail.setPersonliablename(list.get(i).getPersonliablename()); - emergencyRecordsDetail.setVisualization(list.get(i).getVisualization()); - emergencyRecordsDetail.setContents(list.get(i).getContents()); - emergencyRecordsDetail.setContentdetail(list.get(i).getContentsdetail()); - emergencyRecordsDetail.setItemnumber(list.get(i).getItemnumber()); - emergencyRecordsDetail.setStartupcondition(list.get(i).getStartupcondition()); - emergencyRecordsDetail.setCorresponding(list.get(i).getCorresponding()); - emergencyRecordsDetail.setIssuer(list.get(i).getIssuer()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); - //添加节点下面的工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + list.get(i).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - for (int j = 0; j < listorder.size(); j++) { - - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(j).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(j).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(j).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(nodeid);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(id);//主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - } - return "redirect:dodrillview.do?id=" + emergencyRecordId + "&bizid=" + bizid; - } - } - - /*** - * 异常事件演练 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/dodrill4NS.do") - public String dodrill4NS(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String firstId = request.getParameter("firstId");//一级菜单Id - String secondId = request.getParameter("secondId");//二级菜单Id - String bizid = request.getParameter("bizid");//厂id - - //暂时先删除emergencyRecords和emergencyRecordsDetail - List emergencyRecordsDeleteList = this.emergencyRecordsService.selectListByWhere("where 1=1"); - if (emergencyRecordsDeleteList != null) { - for (int er = 0; er < emergencyRecordsDeleteList.size(); er++) { - //delete - //this.emergencyRecordsService.deleteMenuById(emergencyRecordsDeleteList.get(er).getId()); - } - } - - List emergencyRecordsDetailDeleteList = this.emergencyRecordsDetailService.selectListByWhere("where 1=1"); - if (emergencyRecordsDetailDeleteList != null) { - //delete - //2021-07-15 sj 之前迫不得已删除 目前去掉 - //this.emergencyRecordsDetailService.deleteByWhere("where 1=1"); - } - //end - - //每个用于都会有自己的应急预案演练,只要未完成,下次进去都会进上次演练页面; 结束后会产生演练记录,下次可再次进行新的预案演练 - String sql = "where type='1' and thirdmenu='" + id + "' and status!='" + EmergencyRecords.Status_Finish + "' and insuser='" + cu.getId() + "'"; - List emergencyRecordsList = this.emergencyRecordsService.selectListByWhere(sql); - //判断是否存在进行中的应急预案 - if (emergencyRecordsList != null && emergencyRecordsList.size() > 0) { - List detailList = emergencyConfigureService.selectListByWhere("where pid = '" + secondId + "' order by ord asc"); - if (detailList != null && detailList.size() > 0) { - return "redirect:dodrillview4NS.do?id=" + emergencyRecordsList.get(0).getId() + "&bizid=" + bizid + "&detailId=" + detailList.get(0).getId(); - } - } else { - String detailId = ""; - //获得自身属性 -// String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " -// + "from tb_Repair_EmergencyConfigure m " -// + "left outer join tb_user u on u.id=m.firstPerson " -// + "where m.id='" + id + "' "; - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - Company company = this.unitService.getCompById(emergencyConfigure.getBizid()); - String emergencyRecordId = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - - EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - - if (emergencyConfigure != null) { - request.setAttribute("titleName", emergencyConfigure.getName()); - request.setAttribute("meno", emergencyConfigure.getMemo()); - request.setAttribute("_firstPerson", emergencyConfigure.get_firstPerson()); - request.setAttribute("id", emergencyRecordId); - - /* - * 先对演练记录的主表插入数据 - */ - EmergencyRecords emergencyRecords = new EmergencyRecords(); - emergencyRecords.setId(emergencyRecordId); - emergencyRecords.setInsuser(cu.getId()); - emergencyRecords.setInsdt(CommUtil.nowDate()); - emergencyRecords.setBizid(emergencyConfigure.getBizid()); - emergencyRecords.setStarter(cu.getId());//演练/启动人 - emergencyRecords.setStarttime(CommUtil.nowDate());//启动时间 - emergencyRecords.setStatus("5"); - emergencyRecords.setGrade(emergencyConfigure.getGrade()); - emergencyRecords.setFirstmenu(firstId); - emergencyRecords.setSecondmenu(secondId); - emergencyRecords.setThirdmenu(emergencyConfigure.getId()); - emergencyRecords.setType(1);//0为实际预案 1为预案演练 - emergencyRecords.setName(emergencyConfigure.getName()); - emergencyRecords.setFirstperson(emergencyConfigure.getFirstpersonid()); - this.emergencyRecordsService.save(emergencyRecords); - - /* - * 插入附表记录---从配置的附表插入到记录的附表 - */ -// List list = this.emergencyConfigureInfoService -// .selectListByWhere("where pid='" + emergencyConfigure.getId() + "'"); - List list = this.emergencyConfigureService - .selectListByWhere("where pid='" + emergencyConfigure.getId() + "' order by ord asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - - if (i == 0) { - detailId = list.get(i).getId(); - } - - List list2 = this.emergencyConfigureInfoService.selectListByWhere("where pid='" + list.get(i).getId() + "'"); - if (list2 != null && list2.size() > 0) { - for (int j = 0; j < list2.size(); j++) { - String nodeid = CommUtil.getUUID(); - emergencyRecordsDetail.setId(nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(emergencyRecordId); - emergencyRecordsDetail.setStatus("0"); - emergencyRecordsDetail.setOrd(list2.get(j).getOrd()); - emergencyRecordsDetail.setRank(list2.get(j).getRank()); - emergencyRecordsDetail.setPlanTime(list2.get(j).getPlanTime()); -// emergencyRecordsDetail.set -// emergencyRecordsDetail.setRank(list.get(i).getRank()); -// emergencyRecordsDetail.setPersonliableid(list.get(i).getPersonliableid()); -// emergencyRecordsDetail.setPersonliablename(list.get(i).getPersonliablename()); - emergencyRecordsDetail.setPersonliableid(list2.get(j).getId()); - emergencyRecordsDetail.setContents(list2.get(j).getContents()); - emergencyRecordsDetail.setContentdetail(list2.get(j).getContents()); -// emergencyRecordsDetail.setItemnumber(list.get(i).getItemnumber()); -// emergencyRecordsDetail.setStartupcondition(list.get(i).getStartupcondition()); -// emergencyRecordsDetail.setCorresponding(list.get(i).getCorresponding()); -// emergencyRecordsDetail.setIssuer(list.get(i).getIssuer()); - emergencyRecordsDetail.setEcdetailid(list2.get(j).getPid()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); - //添加节点下面的工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + list.get(i).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - for (int k = 0; k < listorder.size(); k++) { - - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(k).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(k).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(k).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(k).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(k).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(nodeid);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(id);//主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - } - } - } - return "redirect:dodrillview4NS.do?id=" + emergencyRecordId + "&bizid=" + bizid + "&detailId=" + detailId; - } - return id; - } - - /*** - * 异常事件提交 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/dohandle.do") - public String dohandle(HttpServletRequest request, Model model - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - List emergencyRecordsList = this.emergencyRecordsService.selectListByWhere("where id='" + id + "'"); - if (emergencyRecordsList != null && emergencyRecordsList.size() > 0 && !emergencyRecordsList.get(0).getStatus().equals("0")) { - return "redirect:dodrillview.do?id=" + emergencyRecordsList.get(0).getId() + "&bizid=" + bizid; - } else { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecordsList.get(0).getThirdmenu()); - String emergencyRecordId = CommUtil.getUUID(); - - emergencyRecordsList.get(0).setStatus("5"); - emergencyRecordsList.get(0).setStarttime(CommUtil.nowDate()); - this.emergencyRecordsService.updateMenu(emergencyRecordsList.get(0)); - - EmergencyRecords emergencyRecords = new EmergencyRecords(); - EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - - if (emergencyConfigure != null) { - request.setAttribute("titleName", emergencyConfigure.getName()); - request.setAttribute("meno", emergencyConfigure.getMemo()); - request.setAttribute("_firstPerson", emergencyConfigure.get_firstPerson()); - request.setAttribute("id", emergencyRecordId); - /* - * 插入附表记录---从配置的附表插入到记录的附表 - */ - //dosaveDetail - List list = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + emergencyConfigure.getId() + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - String nodeid = CommUtil.getUUID(); - emergencyRecordsDetail.setId(nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(id); - emergencyRecordsDetail.setStatus("0"); - emergencyRecordsDetail.setOrd(list.get(i).getOrd()); - emergencyRecordsDetail.setRank(list.get(i).getRank()); - emergencyRecordsDetail.setPersonliableid(list.get(i).getPersonliableid()); - emergencyRecordsDetail.setPersonliablename(list.get(i).getPersonliablename()); - emergencyRecordsDetail.setVisualization(list.get(i).getVisualization()); - emergencyRecordsDetail.setContents(list.get(i).getContents()); - emergencyRecordsDetail.setContentdetail(list.get(i).getContentsdetail()); - emergencyRecordsDetail.setItemnumber(list.get(i).getItemnumber()); - emergencyRecordsDetail.setStartupcondition(list.get(i).getStartupcondition()); - emergencyRecordsDetail.setCorresponding(list.get(i).getCorresponding()); - emergencyRecordsDetail.setIssuer(list.get(i).getIssuer()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); - //System.out.println("+++++"); - //添加节点下面的工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + list.get(i).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - for (int j = 0; j < listorder.size(); j++) { - - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(j).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(j).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(j).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(nodeid);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(id);//主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - //System.out.println("----------"); - } - } - } - } - } - return "redirect:dodrillview.do?id=" + id + "&bizid=" + bizid; - } - } - - /*** - * 异常事件演练启动后的记录 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/dodrillview.do") - public String dodrillview(HttpServletRequest request, Model model - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - //String firstId=request.getParameter("firstId");//一级菜单Id - //String secondId=request.getParameter("secondId");//二级菜单Id - //获得自身属性 -// String emsql = "select m.*,u.caption as _starter " -// + "from TB_Repair_EmergencyRecords m " -// + "left outer join tb_user u on u.id=m.starter " -// + "where m.id='" + id + "' "; - //EmergencyRecords emergencyRecords= emergencyRecordsService.getMenuById(id); - List emergencyRecords = emergencyRecordsService.selectrecordslistByWhere("where m.id='" + id + "'"); - - //List emergencyConfigure = this.emergencyConfigureService.selectusernameByWhere("where m.id='"+id+"' "); - if (emergencyRecords != null) { - request.setAttribute("titleName", emergencyRecords.get(0).getName()); -// request.setAttribute("_firstPerson", emergencyRecords.get(0).get_starter()); -// request.setAttribute("_starter", emergencyRecords.get(0).get_firstPerson() + "(总负责人)"); - - - request.setAttribute("_starter", emergencyRecords.get(0).get_starter()); - - if (emergencyRecords.get(0).getFirstperson() != null) { - User user = userService.getUserById(emergencyRecords.get(0).getFirstperson()); - if (user != null) { - request.setAttribute("_firstPerson", user.getCaption() + "(总负责人)"); - } - } - - //获得自身属性 - String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " - + "from tb_Repair_EmergencyConfigure m " - + "left outer join tb_user u on u.id=m.firstPerson " - + "where m.id='" + emergencyRecords.get(0).getThirdmenu() + "' "; - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecords.get(0).getThirdmenu()); - if (emergencyConfigure != null) { - request.setAttribute("firstPerson", emergencyConfigure.getFirstperson());//总负责人 - //如果字数太多则截取部分文字,鼠标悬浮显示全部。 - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() >= 82) { - request.setAttribute("memo", emergencyConfigure.getMemo().substring(0, 80) + "...");//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() < 80) { - request.setAttribute("memo", emergencyConfigure.getMemo());//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() >= 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition().substring(0, 80) + "...");//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() < 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition());//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - - } - //获取每个配置图片的路径 - List rs = this.emergencyConfigurefileService.selectListByWhere("where masterid='" + emergencyRecords.get(0).getThirdmenu() + "video' order by insdt desc"); - // List rs = emergencyConfigureDAO.loadSql("select top 1 abspath " - // + "from tb_Repair_EmergencyConfigure_file where masterid='"+emergencyRecords.getThirdmenu()+"video' order by insdt desc"); - if (rs != null && rs.size() > 0) { - request.setAttribute("abspath", rs.get(0).getAbspath());//图片路径 - } - } - JSONArray jsonArray = new JSONArray(); - //查询有多少层级 - List rs = this.emergencyRecordsDetailService - .selectrankListByWhere("where pid='" + id + "' group by rank order by rank "); - int y = 0; - if (rs != null && rs.size() > 0) { - //循环层级 - for (int i = 0; i < rs.size(); i++) { - y += 50; - int x = 0; - - if (i == 0) { - List rs2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + rs.get(i).getRank() + "' order by itemNumber"); - if (rs2 != null && rs2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", rs2.get(0).getId()); - jsonObject.put("contents", rs2.get(0).getContents()); - jsonObject.put("status", rs2.get(0).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - jsonArray.add(jsonObject); - } - } else { - List rs2 = this.emergencyRecordsDetailService - .selectcontentListByWhere("where m.pid='" + id + "' and d.pid='" + id + "' and m.rank='" + rs.get(i).getRank() + "' order by m.itemNumber"); - if (rs2 != null && rs2.size() > 0) { - //循环相同层级中的节点数 - for (int j = 0; j < rs2.size(); j++) { - JSONObject jsonObject = new JSONObject(); - //该层级只有一个节点 - if (rs2.size() == 1) { - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - //该节点为复数 - if (rs2.size() % 2 == 0) { - if (j % 2 == 0) { - x = x - (j + 1) * 50; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - x = x + (j + 1) * 50; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } - //该节点为单数 - } else { - //中间的节点 - if (j == 0) { - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - //两边节点 - } else { - if (j % 2 == 0) { - x = x - (j) * 160; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - x = x + (j) * 160; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } - } - } - } - jsonArray.add(jsonObject); - } - } - } - } - } - request.setAttribute("end_y", y + 50); - request.setAttribute("jsonArray", jsonArray);//矩形框json - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='3'"); - - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已关闭的ids - - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - request.setAttribute("ids0", ids0);//未演练的ids - request.setAttribute("ids1", ids1);//正在演练的ids - request.setAttribute("ids2", ids2);//已演练的ids - request.setAttribute("ids3", ids3);//已关闭的ids - - return "command/processEmergencyConfigureDrill"; - } - - @RequestMapping("/dodrillview4NS.do") - public String dodrillview4NS(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String detailId = request.getParameter("detailId"); - //获得自身属性 - String emsql = "select m.*,u.caption as _starter " - + "from TB_Repair_EmergencyRecords m " - + "left outer join tb_user u on u.id=m.starter " - + "where m.id='" + id + "' "; - List emergencyRecords = emergencyRecordsService.selectrecordslistByWhere("where m.id='" + id + "'"); - if (emergencyRecords != null) { - } - request.setAttribute("detailId", detailId); - return "command/processEmergencyConfigureDrill4NS"; - } - - @RequestMapping("/getEchart.do") - public String getEchart(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id");//记录主表Id - String detailId = request.getParameter("detailId");//tb_Repair_EmergencyConfigure id (分项id) - //获得自身属性 - String emsql = "select m.*,u.caption as _starter " - + "from TB_Repair_EmergencyRecords m " - + "left outer join tb_user u on u.id=m.starter " - + "where m.id='" + id + "' "; - List emergencyRecords = emergencyRecordsService.selectrecordslistByWhere("where m.id='" + id + "'"); - if (emergencyRecords != null) { - request.setAttribute("titleName", emergencyRecords.get(0).getName()); -// request.setAttribute("_firstPerson", emergencyRecords.get(0).get_starter()); -// request.setAttribute("_starter", emergencyRecords.get(0).get_firstPerson() + "(总负责人)"); - //获得自身属性 - String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " - + "from tb_Repair_EmergencyConfigure m " - + "left outer join tb_user u on u.id=m.firstPerson " - + "where m.id='" + emergencyRecords.get(0).getThirdmenu() + "' "; - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecords.get(0).getThirdmenu()); - if (emergencyConfigure != null) { - request.setAttribute("firstPerson", emergencyConfigure.getFirstperson());//总负责人 - //如果字数太多则截取部分文字,鼠标悬浮显示全部。 - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() >= 82) { - request.setAttribute("memo", emergencyConfigure.getMemo().substring(0, 80) + "...");//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() < 80) { - request.setAttribute("memo", emergencyConfigure.getMemo());//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() >= 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition().substring(0, 80) + "...");//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() < 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition());//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - - } - //获取每个配置图片的路径 - //List rs = this.emergencyConfigurefileService.selectListByWhere("where masterid='" + emergencyRecords.get(0).getThirdmenu() + "video' order by insdt desc"); - // List rs = emergencyConfigureDAO.loadSql("select top 1 abspath " - // + "from tb_Repair_EmergencyConfigure_file where masterid='"+emergencyRecords.getThirdmenu()+"video' order by insdt desc"); -// if (rs != null && rs.size() > 0) { -// request.setAttribute("abspath", rs.get(0).getAbspath());//图片路径 -// } - } - JSONArray jsonArray = new JSONArray(); - //查询有多少层级 - List rs = this.emergencyRecordsDetailService - .selectrankListByWhere("where ecDetailId='" + detailId + "' group by rank order by rank "); - int y = 0; - if (rs != null && rs.size() > 0) { - //循环层级 - for (int i = 0; i < rs.size(); i++) { - y += 50; - int x = 0; - - if (i == 0) { -// List rs2 = this.emergencyRecordsDetailService -// .selectListByWhere("where pid='" + id + "' and rank='" + rs.get(i).getRank() + "' order by itemNumber"); - List rs2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + (i + 1) + "' and ecDetailId='" + detailId + "' order by ord"); - if (rs2 != null && rs2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", rs2.get(0).getId()); - jsonObject.put("contents", rs2.get(0).getContents()); - jsonObject.put("status", rs2.get(0).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - jsonArray.add(jsonObject); - } - } else { - List rs2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + (i + 1) + "' and ecDetailId='" + detailId + "' order by itemNumber"); - if (rs2 != null && rs2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", rs2.get(0).getId()); - jsonObject.put("contents", rs2.get(0).getContents()); - jsonObject.put("status", rs2.get(0).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - List rs3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + (i) + "' and ecDetailId='" + detailId + "' order by itemNumber"); - if (rs3 != null && rs3.size() > 0) { - jsonObject.put("startLine", rs3.get(0).getId().toString()); - jsonObject.put("endLine", rs2.get(0).getId().toString()); - } - jsonArray.add(jsonObject); - } - /* List rs2 = this.emergencyRecordsDetailService - .selectcontentListByWhere("where m.pid='" + id + "' and m.rank='" + (i + 1) + "' and m.ecDetailId='" + detailId + "' order by m.itemNumber"); - if (rs2 != null && rs2.size() > 0) { - //循环相同层级中的节点数 - for (int j = 0; j < rs2.size(); j++) { - JSONObject jsonObject = new JSONObject(); - //该层级只有一个节点 - if (rs2.size() == 1) { - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - //该节点为复数 - if (rs2.size() % 2 == 0) { - if (j % 2 == 0) { - x = x - (j + 1) * 50; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - x = x + (j + 1) * 50; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } - //该节点为单数 - } else { - //中间的节点 - if (j == 0) { - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - //两边节点 - } else { - if (j % 2 == 0) { - x = x - (j) * 160; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - x = x + (j) * 160; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } - } - } - } - jsonArray.add(jsonObject); - } - }*/ - } - } - } - request.setAttribute("end_y", y + 50); - request.setAttribute("jsonArray", jsonArray);//矩形框json - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='3'"); - - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已关闭的ids - - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - request.setAttribute("ids0", ids0);//未演练的ids - request.setAttribute("ids1", ids1);//正在演练的ids - request.setAttribute("ids2", ids2);//已演练的ids - request.setAttribute("ids3", ids3);//已关闭的ids - - String result = "{\"ids0\":\"" + ids0 + "\",\"ids1\":\"" + ids1 + "\",\"ids2\":\"" + ids2 + "\",\"ids3\":\"" + ids3 + "\",\"end_y\":\"" + (y + 50) + "\",\"jsonArray\":" + jsonArray + "}"; - //System.out.println(result); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getEchart4NS.do") - public String getEchart4NS(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id");//记录主表Id - String detailId = request.getParameter("detailId");//tb_Repair_EmergencyConfigure id (分项id) - //获得自身属性 -// String emsql = "select m.*,u.caption as _starter " -// + "from TB_Repair_EmergencyRecords m " -// + "left outer join tb_user u on u.id=m.starter " -// + "where m.id='" + id + "' "; - List emergencyRecords = emergencyRecordsService.selectrecordslistByWhere("where m.id='" + id + "'"); - if (emergencyRecords != null) { - request.setAttribute("titleName", emergencyRecords.get(0).getName()); - //获得自身属性 -// String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " -// + "from tb_Repair_EmergencyConfigure m " -// + "left outer join tb_user u on u.id=m.firstPerson " -// + "where m.id='" + emergencyRecords.get(0).getThirdmenu() + "' "; - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecords.get(0).getThirdmenu()); - if (emergencyConfigure != null) { - request.setAttribute("firstPerson", emergencyConfigure.getFirstperson());//总负责人 - //如果字数太多则截取部分文字,鼠标悬浮显示全部。 - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() >= 82) { - request.setAttribute("memo", emergencyConfigure.getMemo().substring(0, 80) + "...");//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() < 80) { - request.setAttribute("memo", emergencyConfigure.getMemo());//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() >= 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition().substring(0, 80) + "...");//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() < 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition());//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - } - } - JSONArray jsonArray = new JSONArray(); - //查询有多少层级 - List rs = this.emergencyRecordsDetailService - .selectrankListByWhere("where ecDetailId='" + detailId + "' group by rank order by rank "); - int y = 0; - if (rs != null && rs.size() > 0) { - //循环层级 - for (int i = 0; i < rs.size(); i++) { - y += 50; - int x = 0; - if (i == 0) { - List rs2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + (i + 1) + "' and ecDetailId='" + detailId + "' order by ord"); - if (rs2 != null && rs2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", rs2.get(0).getId()); - jsonObject.put("contents", rs2.get(0).getContents()); - jsonObject.put("status", rs2.get(0).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - jsonArray.add(jsonObject); - } - } else { - List rs2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + (i + 1) + "' and ecDetailId='" + detailId + "' order by itemNumber"); - if (rs2 != null && rs2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", rs2.get(0).getId()); - jsonObject.put("contents", rs2.get(0).getContents()); - jsonObject.put("status", rs2.get(0).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - List rs3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + (i) + "' and ecDetailId='" + detailId + "' order by itemNumber"); - if (rs3 != null && rs3.size() > 0) { - jsonObject.put("startLine", rs3.get(0).getId().toString()); - jsonObject.put("endLine", rs2.get(0).getId().toString()); - } - jsonArray.add(jsonObject); - } - } - } - } - request.setAttribute("end_y", y + 50); - request.setAttribute("jsonArray", jsonArray);//矩形框json - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='3'"); - - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已关闭的ids - - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - request.setAttribute("ids0", ids0);//未演练的ids - request.setAttribute("ids1", ids1);//正在演练的ids - request.setAttribute("ids2", ids2);//已演练的ids - request.setAttribute("ids3", ids3);//已关闭的ids - - String result = "{\"ids0\":\"" + ids0 + "\",\"ids1\":\"" + ids1 + "\",\"ids2\":\"" + ids2 + "\",\"ids3\":\"" + ids3 + "\",\"end_y\":\"" + (y + 50) + "\",\"jsonArray\":" + jsonArray + "}"; - //System.out.println(result); - model.addAttribute("result", result); - return "result"; - } - - /** - * 用于通用项目预案的编辑页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dodrillEdit.do") - public String dodrillEdit(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String memo = ""; - EmergencyConfigureInfo emergencyConfigureInfo = emergencyConfigureInfoService.getMenuById(id); - if (emergencyConfigureInfo != null && emergencyConfigureInfo.getMemo() != null && !emergencyConfigureInfo.getMemo().equals("")) { - memo = emergencyConfigureInfo.getMemo().replaceAll("\\n", ""); - } - request.setAttribute("memo", memo);//已关闭的ids - return "command/processEmergencyConfigureEdit"; - } - - /** - * 用于南市预案的编辑页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dodrillEdit4NS.do") - public String dodrillEdit4NS(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String memo = ""; - EmergencyConfigureInfo emergencyConfigureInfo = emergencyConfigureInfoService.getMenuById(id); - if (emergencyConfigureInfo != null && emergencyConfigureInfo.getMemo() != null && !emergencyConfigureInfo.getMemo().equals("")) { - memo = emergencyConfigureInfo.getMemo().replaceAll("\\n", ""); - } - request.setAttribute("memo", memo);//已关闭的ids - return "command/processEmergencyConfigureEdit4NS"; - } - -///*** -// * 异常事件演练 -// * @param request -// * @param model -// * @param id -// * @return -// */ -//@RequestMapping("/dodrill.do") -//public String dodrill(HttpServletRequest request,Model model, -//@RequestParam(value="id") String id -//){ -// -//EmergencyConfigure emergencyConfigure= emergencyConfigureService.getMenuById(id); -//model.addAttribute("titlename",emergencyConfigure.getName()); -//model.addAttribute("meno",emergencyConfigure.getMemo()); -//model.addAttribute("_firstPerson",emergencyConfigure.getFirstperson()); -// -//JSONArray jsonArray=new JSONArray(); -////查询有多少层级 -//List rs = this.emergencyConfigureInfoService.selectrankListByWhere(" where pid = '"+emergencyConfigure.getId()+"' group by rank order by rank"); -// -//int y = 100; -//if(rs!=null && rs.size()>0){ -// //循环层级 -// for (int i = 0; i < rs.size(); i++) { -// y +=50; -// int x = 500; -// -// if(i==0){ -// List rs2 = this.emergencyConfigureInfoService.selectListByWhere("where pid = '"+emergencyConfigure.getId()+"' and rank = '"+rs.get(i).getRank()+"' order by itemnumber"); -// if(rs2!=null && rs2.size()>0){ -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("id", rs2.get(0).getId()); -// jsonObject.put("contents", rs2.get(0).getContents()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// jsonArray.add(jsonObject); -// } -// }else{ -// List rs2 = this.emergencyConfigureInfoService.selectcontentsstartListByWhere("where m.pid='"+emergencyConfigure.getId()+"' and d.pid='"+emergencyConfigure.getId()+"' and m.rank='"+rs.get(i).getRank()+"' order by m.itemnumber"); -// if(rs2!=null && rs2.size()>0){ -// //循环相同层级中的节点数 -// for (int j = 0; j < rs2.size(); j++) { -// JSONObject jsonObject = new JSONObject(); -// //该层级只有一个节点 -// if(rs2.size() == 1){ -// jsonObject.put("id", rs2.get(j).getId()); -// jsonObject.put("contents", rs2.get(j).getContents()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// if(rs2.get(j).getContentsstart()!=null && !rs2.get(j).getContentsstart().equals("")){ -// jsonObject.put("startLine", rs2.get(j).getStartid().toString()); -// jsonObject.put("endLine", rs2.get(j).getId().toString()); -// } -// }else { -// //该节点为复数 -// if(rs2.size()%2==0){ -// if(j%2==0){ -// x = x-(j+1)*50; -// jsonObject.put("id", rs2.get(j).getId()); -// jsonObject.put("contents", rs2.get(j).getContents().toString()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// if(rs2.get(j).getStartid()!=null && !rs2.get(j).getStartid().equals("")){ -// jsonObject.put("startLine", rs2.get(j).getStartid().toString()); -// jsonObject.put("endLine", rs2.get(j).getId().toString()); -// } -// }else { -// x = x+(j+1)*50; -// jsonObject.put("id", rs2.get(j).getId()); -// jsonObject.put("contents", rs2.get(j).getContents().toString()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// if(rs2.get(j).getStartid()!=null && !rs2.get(j).getStartid().equals("")){ -// jsonObject.put("startLine", rs2.get(j).getStartid().toString()); -// jsonObject.put("endLine", rs2.get(j).getId().toString()); -// } -// } -// //该节点为单数 -// }else{ -// //中间的节点 -// if(j==0){ -// jsonObject.put("id", rs2.get(j).getId()); -// jsonObject.put("contents", rs2.get(j).getContents().toString()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// if(rs2.get(j).getStartid()!=null && !rs2.get(j).getStartid().equals("")){ -// jsonObject.put("startLine", rs2.get(j).getStartid().toString()); -// jsonObject.put("endLine", rs2.get(j).getId().toString()); -// } -// //两边节点 -// }else { -// if(j%2==0){ -// x = x-(j)*160; -// jsonObject.put("id", rs2.get(j).getId()); -// jsonObject.put("contents", rs2.get(j).getContents().toString()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// if(rs2.get(j).getStartid()!=null && !rs2.get(j).getStartid().equals("")){ -// jsonObject.put("startLine", rs2.get(j).getStartid().toString()); -// jsonObject.put("endLine", rs2.get(j).getId().toString()); -// } -// }else { -// x = x+(j)*160; -// jsonObject.put("id", rs2.get(j).getId()); -// jsonObject.put("contents", rs2.get(j).getContents().toString()); -// jsonObject.put("contents_x", x); -// jsonObject.put("contents_y", y); -// if(rs2.get(j).getStartid()!=null && !rs2.get(j).getStartid().equals("")){ -// jsonObject.put("startLine", rs2.get(j).getStartid().toString()); -// jsonObject.put("endLine", rs2.get(j).getId().toString()); -// } -// } -// } -// } -// } -// jsonArray.add(jsonObject); -// } -// } -// } -// } -//} -//request.setAttribute("end_y", y+50); -//request.setAttribute("jsonArray", jsonArray);//矩形框json -//System.out.println(jsonArray); -//return "command/processEmergencyConfigureDrill"; -//} - - - /*** - * 演练中点击上一步 下一步 获取演练数据 - * @param request - * @param model - * @param - * @return - */ - - @RequestMapping("/getDrillDataAjax.do") - public String getDrillDataAjax(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String rank = request.getParameter("rank"); - String detailid = request.getParameter("detailid"); - String startupcondition = request.getParameter("startupcondition"); - String itemnumber = request.getParameter("itemnumber"); - String type = request.getParameter("type"); - JSONArray jsonArray = new JSONArray(); - String wherestr = " where 1=1 and pid='" + id + "' "; - - EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - - if (itemnumber != null && !itemnumber.equals("")) { - wherestr += " and startupcondition='" + itemnumber + "' "; - } - /* - * 下面根据rank和type来判断是上一步还是下一步操作,type=b把rank-1,type=n把rank+1 - */ - if (rank != null && !rank.trim().equals("")) { - String rankStr = ""; - int rankInt = Integer.parseInt(rank); - if (type != null && !type.trim().equals("")) { - if (type.equals("b")) {//上一步 - List emergencyRecordsDetail1 = this.emergencyRecordsDetailService.selectListByWhere("where itemNumber='" + startupcondition + "' and pid='" + id + "'"); - if (emergencyRecordsDetail1 != null && emergencyRecordsDetail1.size() > 0) { - wherestr += " and id='" + emergencyRecordsDetail1.get(0).getId() + "' "; - } - } - if (type.equals("n")) {//下一步 - rankStr = rankInt + 1 + ""; - wherestr += " and rank='" + rankStr + "' "; - } - request.setAttribute("rank", rankStr); - } else { - wherestr += " and rank='1' "; - request.setAttribute("rank", 1); - } - } else {//值为空看第一层级 - wherestr += " and rank='1' "; - request.setAttribute("rank", 1); - - } - /* - * - */ - - //获得自身属性 - List list = this.emergencyRecordsDetailService.selectListByWhere(wherestr + " order by itemNumber asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("content", list.get(i).getContents()); - jsonObject.put("contentsdetail", list.get(i).getContentdetail()); - jsonObject.put("personliablename", list.get(i).getPersonliablename()); - jsonObject.put("startupcondition", list.get(i).getStartupcondition());//启动条件 - jsonObject.put("itemnumber", list.get(i).getItemnumber()); - jsonObject.put("rank", list.get(i).getRank()); - jsonObject.put("id", list.get(i).getId()); - jsonArray.add(jsonObject); - } - } - request.setAttribute("result", jsonArray); - //System.out.println(jsonArray); - return "result"; - } - - /** - * 演练中点击下一步 获取演练数据 - * - * @param - * @param - * @param request - * @param - * @return - * @throws IOException - */ - @RequestMapping("/getDrillDataAjaxnext.do") - public String getDrillDataAjaxnext(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String rank = request.getParameter("rank"); - String detailid = request.getParameter("detailid"); - String type = request.getParameter("type"); - JSONArray jsonArray = new JSONArray(); - String wherestr = " where 1=1 and id='" + detailid + "' "; - -// EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - - //获得自身属性 - List list = this.emergencyRecordsDetailService.selectListByWhere(wherestr + " order by itemNumber asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("content", list.get(i).getContents()); - jsonObject.put("contentsdetail", list.get(i).getContentdetail()); - jsonObject.put("personliablename", list.get(i).getPersonliablename()); - jsonObject.put("startupcondition", list.get(i).getStartupcondition()); - jsonObject.put("itemnumber", list.get(i).getItemnumber()); - jsonObject.put("rank", list.get(i).getRank()); - jsonObject.put("id", list.get(i).getId()); - jsonArray.add(jsonObject); - } - } - request.setAttribute("result", jsonArray); - //System.out.println(jsonArray); - //System.out.println(detailid); - //System.out.println(wherestr); - return "result"; - } - - /** - * 演练中点击流程图刷新右边列表 - * - * @param - * @param - * @param request - * @param - * @return - * @throws IOException - */ - @RequestMapping("/getDrillDataAjaxForTable.do") - public String getDrillDataAjaxForTable(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - JSONArray jsonArrayObj = new JSONArray(); - - List list = this.emergencyRecordsDetailService.selectListByWhere("where id='" + id + "'"); -// List liststatus = this.emergencyRecordsDetailService.selectListByWhere("where status='1' and id='"+id+"'"); - if (list != null && list.size() > 0) { - //将别的执行中的点变为 2 已演练 -// if(liststatus!=null && liststatus.size()>0){ -// List emergencyRecordsDetail = this.emergencyRecordsDetailService -// .selectListByWhere("where pid='"+list.get(0).getPid()+"' and status='1'"); -// if(emergencyRecordsDetail!=null && emergencyRecordsDetail.size() > 0 ){ -// emergencyRecordsDetail.get(0).setStatus("2"); -// this.emergencyRecordsDetailService.update(emergencyRecordsDetail.get(0)); -// } - -// } - - //将该点变为1 执行中 -// EmergencyRecordsDetail emergencyRecordsDetail1 = this.emergencyRecordsDetailService -// .selectListByWhere("where id='"+id+"'").get(0); -// emergencyRecordsDetail1.setStatus("1"); -// this.emergencyRecordsDetailService.update(emergencyRecordsDetail1); - - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='3'"); - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已取消的ids - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("content", list.get(i).getContents()); - jsonObject.put("status", list.get(i).getStatus()); - jsonObject.put("contentDetail", list.get(i).getContentdetail()); - jsonObject.put("personLiablename", list.get(i).getPersonliablename()); - jsonObject.put("visualization", list.get(i).getVisualization()); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("memo", list.get(i).getMemo()); - jsonObject.put("ids0", ids0); - jsonObject.put("ids1", ids1); - jsonObject.put("ids2", ids2); - jsonObject.put("ids3", ids3); - jsonArrayObj.add(jsonObject); - } - } - request.setAttribute("result", jsonArrayObj); - //System.out.println(jsonArrayObj); - return "result"; -// model.addAttribute("result",jsonArray); -// return new ModelAndView("result"); - - } - - /** - * 演练 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getlistYL.do") - public ModelAndView getlistYL(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by id"; - String wherestr = "where 1=1 and type = '" + EmergencyConfigure.Type_Setting + "' and st='启用' "; - String type = unitService.doCheckBizOrNot(cu.getId()); - String unitId = request.getParameter("unitId"); - if (unitId != null && !unitId.equals("")) { - wherestr += " and bizid = '" + unitId + "'"; - } - String name = request.getParameter("search_name"); - if (name != null && !name.equals("")) { - wherestr += " and name like '%" + name + "%'"; - } - - String ids = ""; - List list = this.emergencyConfigureService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - ids += "'" + list.get(i).getId() + "',"; - } - } - if (ids != null && !ids.trim().equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - - wherestr += " and id in (" + ids + ")"; - - PageHelper.startPage(page, rows); - List list2 = this.emergencyConfigureService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list2); - JSONArray json = JSONArray.fromObject(list2); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /* - * 应急预案演练列表 -- 南市应急 - */ - @RequestMapping("/showlistDrill4NS.do") - public String showlistDrill4NS(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - /* - * 下面根据是否有区域id,更具不同用户筛选。 - */ - String bizid = request.getParameter("bizid"); - String bizname = ""; - if (bizid != null && !bizid.equals("")) { - Company company = this.companyService.selectByPrimaryKey(bizid); - bizname = company.getSname(); - } - - String cid = cu.getId(); - String wherestr = ""; - String typeId = request.getParameter("typeId"); - if (typeId != null && !typeId.equals("")) { - wherestr += " and id='" + typeId + "' "; - } else { - - } - - //获取所有的1级菜单 - List list = this.emergencyConfigureService.selectListByWhere("where pid='-1' and bizid='" + bizid + "' " + wherestr); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - int z = 1;//用于总数循环 - for (int i = 0; i < list.size(); i++) { - List list2 = this.emergencyConfigureService - .selectListByWhere("where pid='" + list.get(i).getId() + "' "); - if (list2 != null && list2.size() > 0) { - for (int j = 0; j < list2.size(); j++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list2.get(j).getId()); - jsonObject.put("name", list2.get(j).getName());//name - jsonObject.put("secondId", list2.get(j).getId());//二级菜单name - jsonObject.put("secondname", list2.get(j).getName());//二级菜单name - jsonObject.put("firstId", list.get(i).getId());//一级菜单Id - jsonObject.put("firstname", list.get(i).getName());//一级菜单name - jsonObject.put("bizid", bizid);//公司id - jsonObject.put("bizname", bizname);//公司名 - jsonObject.put("grade", list2.get(j).getGrade());//等级 - jsonObject.put("_firstPerson", list2.get(j).getFirstperson());//总负责人caption - jsonObject.put("memo", list2.get(j).getMemo());//等级 - jsonObject.put("startingCondition", list2.get(j).getStartingcondition());//启动条件 - - List rs = this.emergencyConfigurefileService.selectListByWhere("where masterid='" + list2.get(j).getId() + "video' and masterid like '%video%'"); - if (rs != null && rs.size() > 0) { - jsonObject.put("abspath", rs.get(0).getAbspath()); - } else { - jsonObject.put("abspath", 1); - } - - //判断奇数偶数 显示 红色和蓝色 - if ((z & 1) == 1) { - jsonObject.put("numberType", 0);//奇数 - } else { - jsonObject.put("numberType", 1);//偶数 - } - jsonArray.add(jsonObject); - z++;//没循环一行 +1 - } - } - list2 = null; - } - } - request.setAttribute("jsonArray", jsonArray); - list = null; - return "command/emergencyConfigurelistDrillNS"; - } - - /* - * 应急预案操作 - */ - @RequestMapping("/doHandle.do") - public String doHandle(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id");//三级菜单的大id - String recordsId = request.getParameter("recordsId");//三级菜单的大id - String st = request.getParameter("st");//1:启动 2:提交 3:关闭 e:结束整个流程 - JSONArray jsonArrayObj = new JSONArray(); - String recordsStr = ""; - if(recordsId!=null && !recordsId.isEmpty() ){ - recordsStr = "and pid='"+recordsId+"'"; - } - List list = this.emergencyRecordsDetailService.selectListByWhere("where (id='" + id + "' or ecDetailId='" + id + "') "+recordsStr ); - if (list != null && list.size() > 0) { - EmergencyRecords emergencyRecords = this.emergencyRecordsService.getMenuById(list.get(0).getPid()); - String emergencyRecords_name = ""; - String emergencyConfigureId = ""; - if (emergencyRecords != null) { - emergencyRecords_name = emergencyRecords.getName(); - emergencyConfigureId = emergencyRecords.getThirdmenu(); - } - String msgContent = ""; - String sendUserId = cu.getId(); - String receiveUserIds = ""; - MsgType msgType = this.msgtypeService.getMsgTypeById(EmergencyRecordsDetail.Msg_Type); - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - if (st != null && st.equals("1")) {//启动 - list.get(0).setStatus("1"); - list.get(0).setStarter(cu.getId()); - list.get(0).setStartdt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0)); - if (msgType != null) { - receiveUserIds = list.get(0).getPersonliableid(); - msgContent = "应急预案“" + emergencyRecords_name + "”中事项“" + list.get(0).getContents() + "”已提交至您,请及时处理。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - msgType = null; - List listInfo = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + emergencyConfigureId + "' " - + "and personLiableid='" + list.get(0).getPersonliableid() + "' and contents ='" + list.get(0).getContents() + "' " - + "and contentsdetail='" + list.get(0).getContentdetail() + "' and itemnumber='" + list.get(0).getItemnumber() + "' " - + "and startupcondition='" + list.get(0).getStartupcondition() + "' and corresponding='" + list.get(0).getCorresponding() + "' "); - if (listInfo != null && listInfo.size() > 0) { - //添加节点下面的预设工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + listInfo.get(0).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - for (int k = 0; k < listorder.size(); k++) { - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(k).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(k).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(k).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(k).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(k).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(id);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(list.get(0).getPid());//主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - if (st != null && st.equals("2")) {//提交 - list.get(0).setStatus("2"); - list.get(0).setSubmitter(cu.getId()); - list.get(0).setSubmitdt(CommUtil.nowDate()); - int res = this.emergencyRecordsDetailService.update(list.get(0)); - if (res == 1) { - if (msgType != null) { - receiveUserIds = list.get(0).getPersonliableid(); - msgContent = "应急预案“" + emergencyRecords_name + "”中事项“" + list.get(0).getContents() + "”已提交至您,请及时处理。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - } - List elist = this.emergencyRecordsDetailService.selectListByWhere("where pid='" + list.get(0).getPid() + "' and startupCondition='" + list.get(0).getItemnumber() + "' "); - if (elist != null && elist.size() > 0) { - for (int i = 0; i < elist.size(); i++) { - //有的流程是同时执行的,所以只有当后面节点的流程没有开始则触发启动,否则后面流程完成了会再次启动中。 - if (elist.get(i).getStatus() != null && elist.get(i).getStatus().equals("0")) { - /*list.get(0).setStatus("1"); - list.get(0).setStarter(cu.getId()); - list.get(0).setStartdt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0));*/ - elist.get(i).setStatus("1"); - elist.get(i).setStarter(cu.getId()); - elist.get(i).setStartdt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(elist.get(i)); - if (msgType != null) { - receiveUserIds = list.get(0).getPersonliableid(); - msgContent = "应急预案“" + emergencyRecords_name + "”中事项“" + list.get(0).getContents() + "”已提交至您,请及时处理。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - } - } - } - } - msgService = null; - msgType = null; - } - } - if (st != null && st.equals("3")) {//关闭 - list.get(0).setStatus("3"); - list.get(0).setCloser(cu.getId()); - list.get(0).setClosedt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0)); - } - if (st != null && st.equals("s")) {//启动整个流程 -// List emergencyRecords = this.emergencyRecordsService.selectListByWhere("where thirdmemu='"+id+"'"); - List list1 = this.emergencyRecordsService.selectListByWhere("where id='" + emergencyRecords.getId() + "'"); - if (emergencyRecords != null) { - list1.get(0).setStatus("5"); - list1.get(0).setStarter(cu.getId()); - list1.get(0).setStarttime(CommUtil.nowDate()); - int res = this.emergencyRecordsService.updateMenu(list1.get(0)); - - if (res == 1) { - list.get(0).setStatus("1"); - list.get(0).setStarter(cu.getId()); - list.get(0).setStartdt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0)); - - if (msgType != null) { - receiveUserIds = list.get(0).getPersonliableid(); - msgContent = "应急预案“" + emergencyRecords_name + "”中事项“" + list.get(0).getContents() + "”已提交至您,请及时处理。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - List listInfo = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + emergencyConfigureId + "' " - + "and personLiableid='" + list.get(0).getPersonliableid() + "' and contents ='" + list.get(0).getContents() + "' " - + "and contentsdetail='" + list.get(0).getContentdetail() + "' and itemnumber='" + list.get(0).getItemnumber() + "' " - + "and startupcondition='" + list.get(0).getStartupcondition() + "' and corresponding='" + list.get(0).getCorresponding() + "' "); - if (listInfo != null && listInfo.size() > 0) { - //添加节点下面的预设工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + listInfo.get(0).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - for (int k = 0; k < listorder.size(); k++) { - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(k).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(k).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(k).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(k).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(k).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(id);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(list.get(0).getPid());//主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - } - } - if (st != null && st.equals("e")) {//结束整个流程 - List list1 = this.emergencyRecordsService.selectListByWhere("where id='" + emergencyRecords.getId() + "'"); - if (emergencyRecords != null) { - list1.get(0).setStatus("10"); - list1.get(0).setEnder(cu.getId()); - list1.get(0).setEndtime(CommUtil.nowDate()); - int res = this.emergencyRecordsService.updateMenu(list1.get(0)); - System.out.println(res); - } - } - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='3'"); - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已取消的ids - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - EmergencyRecordsDetail emergencyRecordsDetail = emergencyRecordsDetailService.getMenuById(list.get(0).getId()); - if (emergencyRecordsDetail != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("content", emergencyRecordsDetail.getContents()); - jsonObject.put("status", emergencyRecordsDetail.getStatus()); - jsonObject.put("contentDetail", emergencyRecordsDetail.getContentdetail()); - jsonObject.put("personLiablename", emergencyRecordsDetail.getPersonliablename()); - jsonObject.put("id", emergencyRecordsDetail.getId()); - jsonObject.put("memo", emergencyRecordsDetail.getMemo()); - jsonObject.put("ids0", ids0); - jsonObject.put("ids1", ids1); - jsonObject.put("ids2", ids2); - jsonObject.put("ids3", ids3); - jsonArrayObj.add(jsonObject); - } - } - request.setAttribute("result", jsonArrayObj); - return "result"; - - } - - /* - * 应急预案操作 - */ - @RequestMapping("/doHandle4NS.do") - public String doHandle4NS(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id");//三级菜单的大id - String st = request.getParameter("st");//1:启动 2:提交 3:关闭 e:结束整个流程 - - String nextId = "";//下一节点id - String nextSt = "";//流程是否还有下一步骤 - String nextButtonId = "";//下一节点id - - JSONArray jsonArrayObj = new JSONArray(); - List list = this.emergencyRecordsDetailService.selectListByWhere("where id='" + id + "'"); - if (list != null && list.size() > 0) { - if (st != null && st.equals(EmergencyRecordsDetail.Status_Start)) {//启动 - list.get(0).setStatus(EmergencyRecordsDetail.Status_Start); - list.get(0).setStarter(cu.getId()); - list.get(0).setStartdt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0)); - } - if (st != null && st.equals(EmergencyRecordsDetail.Status_Finish)) {//提交 - list.get(0).setStatus(EmergencyRecordsDetail.Status_Finish); - list.get(0).setSubmitter(cu.getId()); - list.get(0).setSubmitdt(CommUtil.nowDate()); - int res = this.emergencyRecordsDetailService.update(list.get(0)); - if (res == 1) { - int ord = list.get(0).getOrd() + 1;//当前节点的ord+1 为下一节点 - - String sql = "where pid='" + list.get(0).getPid() + "' and ecDetailId = '" + list.get(0).getEcdetailid() + "' and ord = '" + ord + "'"; - //查询下一条节点 - EmergencyRecordsDetail entitydetail = emergencyRecordsDetailService.selectByWhere(sql); - if (entitydetail != null && entitydetail.getStatus().equals(EmergencyRecords.Status_NoStart)) { - entitydetail.setStatus(EmergencyRecordsDetail.Status_Start); - entitydetail.setStarter(cu.getId()); - entitydetail.setStartdt(CommUtil.nowDate()); - int res2 = this.emergencyRecordsDetailService.update(entitydetail); - if (res2 == 1) { - nextId = entitydetail.getId(); - nextButtonId = entitydetail.getEcdetailid(); - } - nextSt = "yes"; - } else { - //nextSt = "no"; - String recordId = list.get(0).getPid();//记录id - String secondId = "";//2层级id - EmergencyRecords emergencyRecords = emergencyRecordsService.getMenuById(recordId); - if (emergencyRecords != null) { - secondId = emergencyRecords.getSecondmenu(); - - //5按钮 - 当前按钮 - EmergencyConfigure emergencyConfigure = emergencyConfigureService.selectByWhere("where id = '" + list.get(0).getEcdetailid() + "'"); - if (emergencyConfigure != null) { - int butOrd = emergencyConfigure.getOrd() + 1; - //5按钮 - 下一个按钮 - EmergencyConfigure emergencyConfigureNext = emergencyConfigureService.selectByWhere("where pid = '" + secondId + "' and ord = '" + butOrd + "'"); - if (emergencyConfigureNext != null) { - //5按钮下一个按钮的第一个节点 - EmergencyRecordsDetail emergencyRecordsDetail3 = emergencyRecordsDetailService.selectByWhere("where ecDetailId = '" + emergencyConfigureNext.getId() + "' and pid = '" + recordId + "' and ord = '0'"); - if (emergencyRecordsDetail3 != null) { - emergencyRecordsDetail3.setStatus(EmergencyRecordsDetail.Status_Start); - emergencyRecordsDetail3.setStarter(cu.getId()); - emergencyRecordsDetail3.setStartdt(CommUtil.nowDate()); - int res3 = this.emergencyRecordsDetailService.update(emergencyRecordsDetail3); - if (res3 == 1) { - nextId = emergencyRecordsDetail3.getId(); - nextButtonId = emergencyRecordsDetail3.getEcdetailid(); - } - nextSt = "yes"; - } else { - nextSt = "no"; - } - } else { - nextSt = "no"; - } - } - } - } - } - } - if (st != null && st.equals(EmergencyRecordsDetail.Status_Close)) {//关闭 - list.get(0).setStatus(EmergencyRecordsDetail.Status_Close); - list.get(0).setCloser(cu.getId()); - list.get(0).setClosedt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0)); - } - if (st != null && st.equals("s")) {//启动整个流程 - EmergencyRecords emergencyRecords = emergencyRecordsService.getMenuById(list.get(0).getPid()); - List list1 = this.emergencyRecordsService.selectListByWhere("where id='" + emergencyRecords.getId() + "'"); - if (emergencyRecords != null) { - list1.get(0).setStatus("5"); - list1.get(0).setEnder(cu.getId()); - list1.get(0).setEndtime(CommUtil.nowDate()); - int res = this.emergencyRecordsService.updateMenu(list1.get(0)); - - if (res == 0) { - list.get(0).setStatus("1"); - list.get(0).setStarter(cu.getId()); - list.get(0).setStartdt(CommUtil.nowDate()); - this.emergencyRecordsDetailService.update(list.get(0)); - - } - } - } - if (st != null && st.equals("e")) {//结束整个流程 - EmergencyRecords emergencyRecords = emergencyRecordsService.getMenuById(list.get(0).getPid()); - System.out.println("结束应急预案=======" + emergencyRecords.getId()); - List list1 = this.emergencyRecordsService.selectListByWhere("where id='" + emergencyRecords.getId() + "'"); - if (emergencyRecords != null) { - list1.get(0).setStatus("10"); - list1.get(0).setEnder(cu.getId()); - list1.get(0).setEndtime(CommUtil.nowDate()); - this.emergencyRecordsService.updateMenu(list1.get(0)); - } - - //推送三维 结束应急预案 - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONObject resultObject = new com.alibaba.fastjson.JSONObject(); - resultObject.put("step", "1.0"); - resultObject.put("name", "结束应急预案"); - resultObject.put("id", emergencyRecords.getSecondmenu()); - jsonArray.add(resultObject); - - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("data", jsonArray); - jsonObject1.put("dataType", CommString.WebsocketBIMTypeEmergency); - - System.out.println("三维预案联动e(" + CommUtil.nowDate() + ") === " + jsonObject1); - if (jsonObject1 != null) { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessageData(jsonObject1.toString(), null); - } - - } - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + list.get(0).getPid() + "' and status='3'"); - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已取消的ids - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - EmergencyRecordsDetail emergencyRecordsDetail = emergencyRecordsDetailService.getMenuById(list.get(0).getId()); - if (emergencyRecordsDetail != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("content", emergencyRecordsDetail.getContents()); - jsonObject.put("status", emergencyRecordsDetail.getStatus()); - jsonObject.put("contentDetail", emergencyRecordsDetail.getContentdetail()); - jsonObject.put("personLiablename", emergencyRecordsDetail.getPersonliablename()); - jsonObject.put("id", emergencyRecordsDetail.getId()); - jsonObject.put("nextId", nextId); - jsonObject.put("nextButtonId", nextButtonId); - jsonObject.put("ids0", ids0); - jsonObject.put("ids1", ids1); - jsonObject.put("ids2", ids2); - jsonObject.put("ids3", ids3); - jsonArrayObj.add(jsonObject); - } - - /** - * 发送weboskcet给三维系统 - */ - if (st != null && !st.equals("e")) { - if (emergencyRecordsDetail != null) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONObject resultObject = new com.alibaba.fastjson.JSONObject(); - //查询5个大类 - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecordsDetail.getEcdetailid()); - System.out.println("5个大类的id===" + emergencyRecordsDetail.getEcdetailid()); - if (emergencyConfigure != null) { - System.out.println("pid===" + emergencyConfigure.getPid()); - List emergencyRecordsDetails = this.emergencyRecordsDetailService - .selectListForJson("where b.pid = '" + emergencyConfigure.getPid() + "' and a.pid='" + emergencyRecordsDetail.getPid() + "' and a.status = '1' and a.id = '" + ids1 + "' order by b.ord desc,a.rank desc"); - if (emergencyRecordsDetails != null && emergencyRecordsDetails.size() > 0) { - resultObject.put("name", emergencyRecordsDetails.get(0).getContents()); -// if (emergencyRecordsDetails.get(0).get_ord().equals("5") && emergencyRecordsDetails.get(0).getRank().toString().equals("1")) { -// resultObject.put("step", "1.0"); -// } else { - resultObject.put("step", emergencyRecordsDetails.get(0).get_ord() + "." + emergencyRecordsDetails.get(0).getRank().toString()); -// } - - jsonArray.add(resultObject); - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("data", jsonArray); - jsonObject1.put("dataType", CommString.WebsocketBIMTypeEmergency); - resultObject.put("id", emergencyConfigure.getPid()); - System.out.println("三维预案联动(" + CommUtil.nowDate() + ") === " + jsonObject1); - if (jsonObject1 != null) { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessageData(jsonObject1.toString(), null); - } - } else { - //全部已完成 -// resultObject.put("step", "1.0"); -// resultObject.put("name", "结束应急预案"); - - /*List emergencyRecordsDetails2_all = this.emergencyRecordsDetailService - .selectListForJson("where b.pid = '" + emergencyConfigure.getPid() + "' and a.pid='" + emergencyRecordsDetail.getPid() + "' order by b.ord desc,a.rank desc"); - List emergencyRecordsDetails2 = this.emergencyRecordsDetailService - .selectListForJson("where b.pid = '" + emergencyConfigure.getPid() + "' and a.pid='" + emergencyRecordsDetail.getPid() + "' and a.status = '2' order by b.ord desc,a.rank desc"); - if (emergencyRecordsDetails2_all != null && emergencyRecordsDetails2_all.size() > 0) { - if (emergencyRecordsDetails2 != null && emergencyRecordsDetails2.size() > 0) { - if (emergencyRecordsDetails2_all.size() == emergencyRecordsDetails2.size()) { - //全部已完成 - resultObject.put("step", "1.0"); - resultObject.put("name", "结束应急预案"); - } else { - //未完成 - resultObject.put("name", emergencyRecordsDetails2.get(0).getContents()); - resultObject.put("step", emergencyRecordsDetails2.get(0).get_ord() + "." + emergencyRecordsDetails2.get(0).getRank().toString()); - } - -// if (emergencyRecordsDetails2.get(0).get_ord().equals("5") && emergencyRecordsDetails2.get(0).getRank().toString().equals("1")) { -// resultObject.put("step", "1.0"); -// } else { -// resultObject.put("step", emergencyRecordsDetails2.get(0).get_ord() + "." + emergencyRecordsDetails2.get(0).getRank().toString()); -// } - } else { - resultObject.put("name", "未开始应急预案"); - resultObject.put("step", "1.0"); - } - }*/ - } - - } - - - } - } - - } - request.setAttribute("result", jsonArrayObj); - return "result"; - - } - - /* - * 启动或者结束应急预案 - */ - @RequestMapping("/doStartOrEnd.do") - public String doStartOrEnd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id");//流程中第一个节点的id,取到其pid的主表,然后结束附表 - String st = request.getParameter("st");//s为点击启动按钮 e为点击结束按钮 - - JSONArray jsonArrayObj = new JSONArray(); - - List list = this.emergencyRecordsDetailService.selectListByWhere("where id='" + id + "'"); - - if (list != null && list.size() > 0) { - List list1 = this.emergencyRecordsService.selectListByWhere("where id='" + list.get(0).getPid() + "'"); - list1.get(0).setStatus("10"); - this.emergencyRecordsService.updateMenu(list1.get(0)); - - } - request.setAttribute("result", jsonArrayObj); - return "result"; - - } - - /* - * 根据id获取状态 - */ - @RequestMapping("/getStatusForId.do") - public String getStatusForId(HttpServletRequest request, Model model) { - String id = request.getParameter("id");//三级菜单的大id - List list = this.emergencyRecordsDetailService.selectListByWhere("where id='" + id + "'"); - if (list != null && list.size() > 0) { - request.setAttribute("result", list.get(0).getStatus()); - } - return "result"; - - } - - //播放视频 - @RequestMapping("/showvideo.do") - public String showvideo(HttpServletRequest request, Model model) { - String videopath = request.getParameter("videopath"); - request.setAttribute("videopath", videopath); - return "command/emergencyShowVideo"; - - } - - /** - * 保存富文本图片 - * - * @param file - * @param request - * @return - */ - @RequestMapping("/uploadImage.do") - @ResponseBody - public Map receiveImage(@RequestParam("upload") MultipartFile file, HttpServletRequest request) { - return emergencyConfigureService.ckEditorUploadImage(file, request); - } - - private static final String CK_IMAGE_PATH = File.separator + "uploadImage"; - - @RequestMapping("/upload4WangEditor.do") - @ResponseBody - public WangEditor upload4WangEditor(@RequestParam("myFile") MultipartFile multipartFile, HttpServletRequest request) { - try { - // 获取项目路径 -// String realPath = request.getSession().getServletContext() -// .getRealPath(""); -// InputStream inputStream = multipartFile.getInputStream(); -// -// String contextPath = request.getServletContext().getContextPath(); - - String originalName = multipartFile.getOriginalFilename(); - // generate file name - String localFileName = System.currentTimeMillis() + "-" + originalName; - // get project path - String projectRealPath = request.getSession().getServletContext().getRealPath(""); - // get the real path to store received images - String realPath = projectRealPath + CK_IMAGE_PATH; - File imageDir = new File(realPath); - if (!imageDir.exists()) { - imageDir.mkdirs(); - } - - String localFilePath = realPath + File.separator + localFileName; - try { - multipartFile.transferTo(new File(localFilePath)); - } catch (IllegalStateException e) { - e.printStackTrace(); - // log here - } catch (IOException e) { - e.printStackTrace(); - // log here - } - String imageContextPath = request.getContextPath() + "/uploadImage" + "/" + localFileName; - String[] strs = {imageContextPath}; - WangEditor we = new WangEditor(strs); - return we; - } catch (Exception e) { - System.out.println("上传图片失败!"); - } - return null; - } - - /** - * 循环获取顶部的 5个按钮 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getButtons.do") - public String getButtons(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - JSONArray jsonarray = new JSONArray(); - EmergencyRecords emergencyRecords = emergencyRecordsService.getMenuById(id); - if (emergencyRecords != null) { - List list = this.emergencyConfigureService.selectListByWhere("where pid='" + emergencyRecords.getSecondmenu() + "' order by ord asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getName()); - jsonarray.add(jsonObject); - } - } - } - request.setAttribute("result", jsonarray); - return "result"; - - } - - /** - * 获取富文本内容 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCkeditorContent.do") - public String getCkeditorContent(HttpServletRequest request, Model model) { - String nodeid = request.getParameter("nodeid"); - String bizId = request.getParameter("bizId"); - JSONArray jsonarray = new JSONArray(); - EmergencyRecordsDetail emergencyRecordsDetail = emergencyRecordsDetailService.getMenuById(nodeid); - if (emergencyRecordsDetail != null) { - EmergencyConfigureInfo emergencyConfigureInfo = emergencyConfigureInfoService.getMenuById(emergencyRecordsDetail.getEcdetailid()); - - if (StringUtils.isNotBlank(bizId) && "021NS".equals(bizId)) { - emergencyConfigureInfo = emergencyConfigureInfoService.getMenuById(emergencyRecordsDetail.getPersonliableid()); - } - if (emergencyConfigureInfo != null) { - request.setAttribute("result", emergencyConfigureInfo.getMemo()); - } - } else { - request.setAttribute("result", ""); - } - return "result"; - } - - /** - * 获取table数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTableData.do") - public String getTableData(HttpServletRequest request, Model model) throws ParseException { - String nodeid = request.getParameter("nodeid"); - JSONArray jsonarray = new JSONArray(); - EmergencyRecordsDetail emergencyRecordsDetail = emergencyRecordsDetailService.getMenuById(nodeid); - JSONObject jsonObject = new JSONObject(); - if (emergencyRecordsDetail != null) { - if (emergencyRecordsDetail.getStartdt() != null) { - jsonObject.put("sdt", emergencyRecordsDetail.getStartdt().substring(0, 19)); - } else { - jsonObject.put("sdt", "未开始"); - } - if (emergencyRecordsDetail.getSubmitdt() != null) { - jsonObject.put("edt", emergencyRecordsDetail.getSubmitdt().substring(0, 19)); - } else { - jsonObject.put("edt", "未完成"); - } - //预计用时 - jsonObject.put("planTime", emergencyRecordsDetail.getPlanTime()); - //实际用时 - if (emergencyRecordsDetail.getStartdt() != null && emergencyRecordsDetail.getSubmitdt() != null) { - SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");//如2016-08-10 20:40 - String fromDate = simpleFormat.format(CommUtil.StringToDate(emergencyRecordsDetail.getStartdt().substring(0, 19))); - String toDate = simpleFormat.format(CommUtil.StringToDate(emergencyRecordsDetail.getSubmitdt().substring(0, 19))); - long from = simpleFormat.parse(fromDate).getTime(); - long to = simpleFormat.parse(toDate).getTime(); - int minutes = (int) ((to - from) / (1000 * 60)); - jsonObject.put("actualTime", minutes); - } else { - jsonObject.put("actualTime", "-"); - } - if (emergencyRecordsDetail.getSubmitter() != null) { - User user = userService.getUserById(emergencyRecordsDetail.getSubmitter()); - if (user != null) { - jsonObject.put("userName", user.getCaption()); - } else { - jsonObject.put("userName", ""); - } - } else { - jsonObject.put("userName", ""); - } - } - request.setAttribute("result", jsonObject); - return "result"; - } - - /* - * 应急预案演练列表 - * sj 2021-10-22 - */ - @RequestMapping("/showlistDrill.do") - public String showlistDrill(HttpServletRequest request, Model model) { - return "command/emergencyConfigurelistDrill"; - } - - /* - * 增加步骤 - * njp 2022-08-03 - */ - @RequestMapping("/stepAdd.do") - public ModelAndView stepAdd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "unitId") String unitId) { - if (pid != null && !pid.equals("")) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(pid); - model.addAttribute("pname", emergencyConfigure.getName()); - List listInfo = this.emergencyConfigureInfoService.selectListByWhere("where pid='" + pid + "' order by ord"); - if (listInfo != null && listInfo.size() > 0) { - int result = 2; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - model.addAttribute("bizid", unitId); - return new ModelAndView("command/stepAdd"); - } - - /* - * 增加默认步骤 - * njp 2022-08-03 - */ - @RequestMapping("/stepDefault.do") - public ModelAndView stepDefault(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (pid != null && !pid.equals("")) { - List listInfo = this.emergencyConfigureInfoService.selectListByWhere("where pid='" + pid + "' order by ord"); - if (listInfo != null && listInfo.size() > 0) { - result = 2; - } else { - String[] STEP_DEFAULT = EmergencyConfigure.STEP_DEFAULT; - int ord = 1; - for (String name : STEP_DEFAULT) { - EmergencyConfigure emergencyConfigure = new EmergencyConfigure(); - emergencyConfigure.setId(CommUtil.getUUID()); - emergencyConfigure.setInsdt(CommUtil.nowDate()); - emergencyConfigure.setInsuser(cu.getId()); - emergencyConfigure.setBizid(unitId); - emergencyConfigure.setPid(pid); - emergencyConfigure.setName(name); - emergencyConfigure.setSt("启用"); - emergencyConfigure.setOrd(ord); - emergencyConfigure.setType(EmergencyConfigure.Type_Step); - result = this.emergencyConfigureService.saveMenu(emergencyConfigure); - ord++; - } - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} - - - diff --git a/src/com/sipai/controller/command/EmergencyConfigureDetailController.java b/src/com/sipai/controller/command/EmergencyConfigureDetailController.java deleted file mode 100644 index b268729c..00000000 --- a/src/com/sipai/controller/command/EmergencyConfigureDetailController.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sipai.controller.command; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.sipai.entity.command.EmergencyConfigureDetail; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.service.command.EmergencyConfigureDetailService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/command/emergencyConfigureDetail") -public class EmergencyConfigureDetailController { - - @Resource - private EmergencyConfigureDetailService emergencyConfigureDetailService; - - @RequestMapping("/getFuncJson.do") - public String getFuncJson(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - List list = this.emergencyConfigureDetailService.selectListByWhere("where pid='"+id+"'"); - JSONArray json = JSONArray.fromObject(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 北控版本 - * @param request - * @param model - * @param pid - * @param unitId - * @return - */ - @RequestMapping("/showFuncAdd.do") - public String doFuncAdd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="unitId") String unitId){ - if(pid!=null && !pid.equals("")){ - //System.out.println("pid:::"+pid); - model.addAttribute("pid",pid); - /*model.addAttribute("_pname",emergencyConfigureInfo.getName());*/ - } - model.addAttribute("bizid",unitId); - return "command/menuFuncAdd_detail"; - } - - @RequestMapping("/saveFunc.do") - public String dosaveFunc(HttpServletRequest request,Model model, - @ModelAttribute("emergencyConfigureDetail") EmergencyConfigureDetail emergencyConfigureDetail){ - emergencyConfigureDetail.setId(CommUtil.getUUID()); - - int result = this.emergencyConfigureDetailService.saveMenu(emergencyConfigureDetail); - model.addAttribute("result", "{\"res\":\""+result+"\",\"id\":\""+emergencyConfigureDetail.getId()+"\"}"); - //System.out.println("new_result::"+"{\"res\":\""+result+"\",\"id\":\""+emergencyConfigureInfo.getId()+"\"}"); - return "result"; - } - - @RequestMapping("/showFuncEdit.do") - public String doFuncEdit(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="id") String id, - @RequestParam(value="unitId") String unitId){ - EmergencyConfigureDetail emergencyConfigureDetail= emergencyConfigureDetailService.getMenuById(id); - model.addAttribute("emergencyConfigureDetail",emergencyConfigureDetail ); - if(pid!=null && !pid.equals("")){ - model.addAttribute("pid",pid); - } - model.addAttribute("bizid",unitId); - return "command/menuFuncEdit_detail"; - } - - @RequestMapping("/updateFunc.do") - public String doupdateFunc(HttpServletRequest request,Model model, - @ModelAttribute EmergencyConfigureDetail emergencyConfigureDetail){ - int result = this.emergencyConfigureDetailService.updateMenu(emergencyConfigureDetail); - model.addAttribute("result", "{\"res\":\""+result+"\",\"id\":\""+emergencyConfigureDetail.getId()+"\"}"); - return "result"; - } - - @RequestMapping("/deleteMenu.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - String msg = ""; - int result = 0; - //System.out.println("del_id:::"+id); - List mlist = this.emergencyConfigureDetailService.selectListByWhere(" where id = '"+id+"'"); - if(mlist!=null && mlist.size()>0){ - result = this.emergencyConfigureDetailService.deleteMenuById(id); - }else{ - msg="删除失败"; - } - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return "result"; - } - - -} diff --git a/src/com/sipai/controller/command/EmergencyConfigureInfoController.java b/src/com/sipai/controller/command/EmergencyConfigureInfoController.java deleted file mode 100644 index 51bae5e6..00000000 --- a/src/com/sipai/controller/command/EmergencyConfigureInfoController.java +++ /dev/null @@ -1,331 +0,0 @@ -package com.sipai.controller.command; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.entity.command.EmergencyConfigureWorkOrder; -import com.sipai.entity.user.User; -import com.sipai.service.command.EmergencyConfigureInfoService; -import com.sipai.service.command.EmergencyConfigureService; -import com.sipai.service.command.EmergencyConfigureWorkOrderService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.util.List; - - -@Controller -@RequestMapping("/command/emergencyConfigure") -public class EmergencyConfigureInfoController { - @Resource - private EmergencyConfigureInfoService emergencyConfigureInfoService; - @Resource - private EmergencyConfigureService emergencyConfigureService; - @Resource - private EmergencyConfigureWorkOrderService emergencyConfigureWorkOrderService; - - @RequestMapping("/getFuncJson.do") - public String getFuncJson(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order){ - PageHelper.startPage(page, rows); - List list = this.emergencyConfigureInfoService.selectcountByWhere("where m.pid='"+id+"' order by m.ord"); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - if(list.size()==0){ - List list1 = this.emergencyConfigureInfoService.selectListByWhere("where pid='"+id+"' order by ord"); - jsonArray = JSONArray.fromObject(list1); - } - List list2 = this.emergencyConfigureWorkOrderService.selectListByWhere("where nodeid='"+id+"'"); - - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+",\"size\":"+list2.size()+"}"; - model.addAttribute("result", result); - return "result"; -// String result="{\"total\":"+list.size()+",\"rows\":"+json+",\"size\":"+list2.size()+"}"; -// model.addAttribute("result", result); -// -// return "result"; - } - @RequestMapping("/getInfoJson.do") - public ModelAndView getInfoJson(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - List list1 = this.emergencyConfigureInfoService.selectListByWhere("where pid='"+id+"' order by ord"); - JSONArray jsonArray = JSONArray.fromObject(list1); - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - /** - * 北控版本 - * @param request - * @param model - * @param pid - * @param unitId - * @return - */ - @RequestMapping("/showFuncAdd.do") - public ModelAndView doFuncAdd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="unitId") String unitId){ - if(pid!=null && !pid.equals("")){ - //检查是否有步骤 - List list = emergencyConfigureService.selectListByWhere("where pid='"+pid+"' and type = '"+EmergencyConfigure.Type_Step+"' "); - if(list!=null && list.size()>0){ - int result = 2; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - //System.out.println("pid:::"+pid); - /*model.addAttribute("_pname",emergencyConfigureInfo.getName());*/ - } - model.addAttribute("id",request.getParameter("id")); - model.addAttribute("pid",pid); - model.addAttribute("bizid",unitId); - return new ModelAndView("command/menuFuncAdd"); - } - /** - * 流程图版本 - * @param request - * @param model - * @param emergencyConfigureId - * @param unitId - * @return - */ - @RequestMapping("/showLogicFlowAdd.do") - public ModelAndView showLogicFlowAdd(HttpServletRequest request,Model model, - @RequestParam(value="emergencyConfigureId") String emergencyConfigureId, - @RequestParam(value="unitId") String unitId){ - model.addAttribute("emergencyConfigureId",emergencyConfigureId); - model.addAttribute("bizid",unitId); - return new ModelAndView("command/emergencyConfigureLogicFlowAdd"); - } - /** - * 南市版本 - * @param request - * @param model - * @param pid - * @param unitId - * @return - */ - @RequestMapping("/showFuncAdd4NS.do") - public String showFuncAdd4NS(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="unitId") String unitId){ - if(pid!=null && !pid.equals("")){ - model.addAttribute("pid",pid); - } - model.addAttribute("bizid",unitId); - return "command/menuFuncAdd4NS"; - } - - @RequestMapping("/showFuncEdit.do") - public String doFuncEdit(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="id") String id, - @RequestParam(value="unitId") String unitId){ - EmergencyConfigureInfo emergencyConfigureInfo= emergencyConfigureInfoService.getMenuById(id); - model.addAttribute("emergencyConfigureInfo",emergencyConfigureInfo ); - if(pid!=null && !pid.equals("")){ - model.addAttribute("pid",pid); - } - model.addAttribute("bizid",unitId); - //return "command/menuFuncEdit"; - return "command/emergencyConfigureInfoEdit"; - } - - @RequestMapping("/showFuncEdit4NS.do") - public String doFuncEdit4NS(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="id") String id, - @RequestParam(value="unitId") String unitId){ - EmergencyConfigureInfo emergencyConfigureInfo= emergencyConfigureInfoService.getMenuById(id); - model.addAttribute("emergencyConfigureInfo",emergencyConfigureInfo ); - if(pid!=null && !pid.equals("")){ - model.addAttribute("pid",pid); - } - model.addAttribute("bizid",unitId); - return "command/emergencyConfigureInfoEdit4NS"; - } - - @RequestMapping("/editMemoFun.do") - public String editMemoFun(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid, - @RequestParam(value="id") String id, - @RequestParam(value="unitId") String unitId){ - EmergencyConfigureInfo emergencyConfigureInfo= emergencyConfigureInfoService.getMenuById(id); - model.addAttribute("emergencyConfigureInfo",emergencyConfigureInfo ); - if(pid!=null && !pid.equals("")){ - model.addAttribute("pid",pid); - } - model.addAttribute("bizid",unitId); - //return "command/menuFuncEdit"; - return "command/emergencyConfigureInfoEdit4Memo"; - } - - @RequestMapping("/saveFunc.do") - public String dosaveFunc(HttpServletRequest request,Model model, - @ModelAttribute("emergencyConfigureInfo") EmergencyConfigureInfo emergencyConfigureInfo){ - if(emergencyConfigureInfo.getId()==null || emergencyConfigureInfo.getId().isEmpty()){ - emergencyConfigureInfo.setId(CommUtil.getUUID()); - } - int result = this.emergencyConfigureInfoService.saveMenu(emergencyConfigureInfo); - model.addAttribute("result", "{\"res\":\""+result+"\",\"id\":\""+emergencyConfigureInfo.getId()+"\"}"); - return "result"; - } - - @RequestMapping("/updateFunc.do") - public String doupdateFunc(HttpServletRequest request,Model model, - @ModelAttribute EmergencyConfigureInfo emergencyConfigureInfo){ - int result = this.emergencyConfigureInfoService.updateMenu(emergencyConfigureInfo); - model.addAttribute("result", "{\"res\":\""+result+"\",\"id\":\""+emergencyConfigureInfo.getId()+"\"}"); - return "result"; - } - - @RequestMapping("/deleteMenu.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - String msg = ""; - int result = 0; - //System.out.println("del_id:::"+id); - List mlist = this.emergencyConfigureInfoService.selectListByWhere(" where id = '"+id+"'"); - if(mlist!=null && mlist.size()>0){ - result = this.emergencyConfigureInfoService.deleteMenuById(id); - }else{ - msg="删除失败"; - } - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return "result"; - } - - @RequestMapping("/doprocess3.do") - public String doprocess3(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="category") String category){ - - - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id); - model.addAttribute("titleName",emergencyConfigure.getName()); - - /* - * 三级菜单 - */ - if(category!=null && category.equals("3")){ - List mlist = this.emergencyConfigureInfoService.selectListByWhere(" where pid = '"+emergencyConfigure.getId()+"'"); - JSONArray jsonArray=new JSONArray();//矩形框json - int y=0; - if (mlist!=null && mlist.size()>0) { - for (int i = 0; i < mlist.size(); i++) { - JSONObject jsonObject=new JSONObject(); - if(mlist.get(i).getRoles()!=null){ - jsonObject.put("roleName", mlist.get(i).getRoles().toString()); - } - if(mlist.get(i).getPersonliablename() !=null){ - jsonObject.put("person", mlist.get(i).getPersonliablename().toString()); - } - y=y+100; - jsonObject.put("person_y", y);//责任人Y轴 - if(mlist.get(i).getContents() != null){//处理事项 - int clength = mlist.get(i).getContents().toString().length(); - if(clength>10){ - jsonObject.put("content", mlist.get(i).getContents().toString().substring(0, 10)); - }else{ - jsonObject.put("content", mlist.get(i).getContents().toString()); - } - } - if(mlist.get(i).getContentsdetail() != null){//操作内容 - int clength=mlist.get(i).getContentsdetail().toString().length(); - if(clength>10){ - jsonObject.put("contentDetailTitle", mlist.get(i).getContentsdetail().toString().substring(0, 10)); - }else { - jsonObject.put("contentDetailTitle", mlist.get(i).getContentsdetail().toString()); - } - jsonObject.put("contentDetail", mlist.get(i).getContentsdetail().toString());//详细内容 - } - y=y+100; - jsonObject.put("status_y", y);//是否完成Y轴 - jsonArray.add(jsonObject); - } - - } - request.setAttribute("end_y", y+100); - request.setAttribute("jsonArray", jsonArray);//矩形框json - //System.out.println("jsonArray:::"+jsonArray); - - return "command/processEmergencyConfigure"; - - } - return null; - } - - - @RequestMapping("/dosortnew.do") - public String dosortnew(HttpServletRequest request,Model model){ - //接收json数据 - BufferedReader streamReader = null; - StringBuilder responseStrBuilder = new StringBuilder(); - String inputStr; - try { - streamReader = new BufferedReader( new - InputStreamReader(request.getInputStream(), "UTF-8")); - while ((inputStr = streamReader.readLine()) != null) - responseStrBuilder.append(inputStr); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - System.out.println(e.toString()); - e.printStackTrace(); - throw new RuntimeException(e); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - System.out.println(e.toString()); - throw new RuntimeException(e); - } - //转化成json对象 - com.alibaba.fastjson.JSONObject json=com.alibaba.fastjson.JSONObject.parseObject(responseStrBuilder.toString()); - String jsondata = json.getString("jsondata"); -// System.out.println("jsondata:::"+jsondata); - String ds = jsondata; - JSONArray jsonArray=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i ia = this.emergencyRecordsWorkOrderService -// .selectcompanynameByWhere(" where 1=1 and workreceiveuserid='"+cu.getId()+"' " + scope + " order by m.insdt desc"); - List ia = this.emergencyConfigureWorkOrderService - .selectworkorderrecordslistByWhere("where 1=1 and m.nodeid='"+id+"' order by insdt desc"); - //System.out.println("scpoe::"+scope); - JSONArray json = JSONArray.fromObject(ia); - String result="{\"total\":"+ia.size()+",\"rows\":"+json+"}"; - //System.out.println("result::"+result); - - model.addAttribute("result", result); - - return new ModelAndView("result"); - //return "result"; - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - request.setAttribute("id", id); - if(id!=null && !id.equals("")){ - //System.out.println("pid:::"+pid); - model.addAttribute("id",id); - /*model.addAttribute("_pname",emergencyConfigureInfo.getName());*/ - } - return "command/emergencyConfigureWorkOrderAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model - ){ - EmergencyConfigureWorkOrder emergencyConfigureWorkOrder = new EmergencyConfigureWorkOrder(); - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String workreceiveuser = request.getParameter("workreceiveuser"); - String workcontent = request.getParameter("workcontent"); -// String bizid = request.getParameter("bizid"); - String bizid = request.getParameter("bizid"); - - emergencyConfigureWorkOrder.setId(CommUtil.getUUID()); - emergencyConfigureWorkOrder.setBizid(bizid); - emergencyConfigureWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyConfigureWorkOrder.setInsuser(cu.getId()); - emergencyConfigureWorkOrder.setWorksenduser(cu.getId()); - emergencyConfigureWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyConfigureWorkOrder.setStatus(0); - emergencyConfigureWorkOrder.setNodeid(id); - emergencyConfigureWorkOrder.setWorkreceiveuser(workreceiveuser); - emergencyConfigureWorkOrder.setWorkcontent(workcontent); - int result = this.emergencyConfigureWorkOrderService.save(emergencyConfigureWorkOrder); -// model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\"\"}"); - model.addAttribute("result",result); - return "result"; - } - -// @RequestMapping("/doedit.do") -// public String doedit(HttpServletRequest request,Model model){ -// String id = request.getParameter("id"); -// System.out.println(id); -// List emergencyConfigureWorkOrder= emergencyConfigureWorkOrderService -// .selectworkorderrecordslistByWhere("where m.id='"+id+"'"); -// request.setAttribute("_workreceiveuser", emergencyConfigureWorkOrder.get(0).get_workreceiveuser()); -// request.setAttribute("workcontent", emergencyConfigureWorkOrder.get(0).getWorkcontent()); -// -// return "command/emergencyConfigureWorkOrderEdit"; -// } - - @RequestMapping("/doworkedit.do") - public String doworkedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - request.setAttribute("id", id); - //System.out.println(id); - List emergencyConfigureWorkOrder= this.emergencyConfigureWorkOrderService - .selectworkorderrecordslistByWhere("where m.id='"+id+"'"); -// request.setAttribute("_workreceiveuser", emergencyConfigureWorkOrder.get(0).get_workreceiveuser()); -// request.setAttribute("workcontent", emergencyConfigureWorkOrder.get(0).getWorkcontent()); - model.addAttribute("emergencyConfigureWorkOrder",emergencyConfigureWorkOrder.get(0)); - return "command/emergencyConfigureWorkOrderEdit"; - } - - @RequestMapping("/doworkdelete.do") - public String doworkdelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - String msg = ""; - int result = 0; - //System.out.println("del_id:::"+id); - List mlist = this.emergencyConfigureWorkOrderService.selectListByWhere(" where id = '"+id+"'"); - if(mlist!=null && mlist.size()>0){ - result = this.emergencyConfigureWorkOrderService.delete(id); - }else{ - msg="删除失败"; - } - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return "result"; - } - - @RequestMapping("/doworkupdate.do") - public String doworkupdate(HttpServletRequest request,Model model, - @ModelAttribute EmergencyConfigureWorkOrder emergencyConfigureWorkOrder){ - int result = this.emergencyConfigureWorkOrderService.update(emergencyConfigureWorkOrder); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/command/EmergencyPlanController.java b/src/com/sipai/controller/command/EmergencyPlanController.java deleted file mode 100644 index 5d406e96..00000000 --- a/src/com/sipai/controller/command/EmergencyPlanController.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.sipai.controller.command; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyPlan; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.command.EmergencyConfigureService; -import com.sipai.service.command.EmergencyPlanService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2021/10/23/10:31 - * @Description: - */ -@Controller -@RequestMapping("/command/emergencyPlan") -public class EmergencyPlanController { - @Resource - private EmergencyPlanService emergencyPlanService; - @Resource - private UnitService unitService; - @Resource - private EmergencyConfigureService emergencyConfigureService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "command/emergencyPlanList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String pSectionId = request.getParameter("pSectionId"); - String ids = request.getParameter("ids"); - if (sort == null) { - sort = " plan_date "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and biz_id in (" + companyids + ") "; - } - } - if (pSectionId != null && !pSectionId.isEmpty()) { - wherestr += " and process_section_id = '" + pSectionId + "' "; - } - if (ids != null && !ids.isEmpty()) { - ids = ids.replace(",", "','"); - wherestr += " and id in ('" + ids + "')"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - String wherestrConfigure = " where name like '%" + request.getParameter("search_name") + "%' order by id"; - List emergencyConfigures = emergencyConfigureService.selectListByWhere(wherestrConfigure); - String emergencyConfigureIDS = ""; - if(emergencyConfigures!=null && emergencyConfigures.size()>0){ - for(EmergencyConfigure emergencyConfigure : emergencyConfigures){ - emergencyConfigureIDS += emergencyConfigure.getId()+","; - } - emergencyConfigureIDS = emergencyConfigureIDS.replace(",", "','"); - } - wherestr += " and emergency_configure_id in ('" + emergencyConfigureIDS + "') "; - } - if (request.getParameter("statusSelect") != null && !request.getParameter("statusSelect").isEmpty()) { - wherestr += " and status = '" + request.getParameter("statusSelect") + "'"; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and plan_date >= '" + request.getParameter("sdt") + "'"; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and plan_date <= '" + request.getParameter("edt") + "'"; - } - PageHelper.startPage(page, rows); - List list = this.emergencyPlanService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 新增选择 应急配置页面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "command/emergencyPlanAdd"; - } - - - /** - * 保存 - * - * @param request - * @param model - * @param emergencyPlan - * @return - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("emergencyPlan") EmergencyPlan emergencyPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.emergencyPlanService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 查看信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EmergencyConfigure emergencyConfigure = this.emergencyConfigureService.getMenuById(id); - model.addAttribute("emergencyConfigure", emergencyConfigure); - return "command/emergencyConfigureView4Plan"; - } - - /** - * 新增选择 应急配置页面 - */ - @RequestMapping("/showConfigure.do") - public String showConfigure(HttpServletRequest request, Model model) { - return "command/emergencyConfigureList4Plan"; - } - - /** - * 保存应急 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/doChoice.do") - public String doChoice(HttpServletRequest request, Model model, - @RequestParam(value = "checkedIds") String checkedIds, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - - int res = emergencyPlanService.doChoice(checkedIds, unitId, cu); - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * 下发 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/dodown.do") - public String dodown(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - User cu = (User) request.getSession().getAttribute("cu"); - //计划内 - int res = emergencyPlanService.dodown(ids, cu, EmergencyRecords.Inside); - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /*@RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EmergencyConfigure emergencyConfigure = this.emergencyConfigureService.getMenuById(id); - model.addAttribute("emergencyConfigure", emergencyConfigure); - return "command/emergencyPlanEdit"; - }*/ - -} diff --git a/src/com/sipai/controller/command/EmergencyRecordsController.java b/src/com/sipai/controller/command/EmergencyRecordsController.java deleted file mode 100644 index 3107d760..00000000 --- a/src/com/sipai/controller/command/EmergencyRecordsController.java +++ /dev/null @@ -1,865 +0,0 @@ -package com.sipai.controller.command; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.command.EmergencyRecordsDetail; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.command.*; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/command/emergencyRecords") -public class EmergencyRecordsController { - - @Resource - private EmergencyRecordsService emergencyRecordsService; - @Resource - private EmergencyConfigureService emergencyConfigureService; - @Resource - private EmergencyConfigurefileService emergencyConfigurefileService; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private EmergencyRecordsDetailService emergencyRecordsDetailService; - @Resource - private EmergencyPlanService emergencyPlanService; - - /* - * 应急预案演练(过程) - */ - @RequestMapping("/showlistDrill.do") - public String showlistDrill(HttpServletRequest request, Model model) { - return "command/emergencyRecordslistDrill"; - } - - /* - * 应急预案演练(浏览) - */ - @RequestMapping("/showlistView.do") - public String showlistView(HttpServletRequest request, Model model) { - return "command/emergencyRecordslistView"; - } - - /* - * 获取应急预案演练(记录) - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by starttime desc"; - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); - String status = request.getParameter("status"); - - if (unitId != null && !unitId.equals("")) { - wherestr += " and bizid = '" + unitId + "'"; - } - if (status != null && !status.equals("")) { - wherestr += " and status = '" + status + "'"; - } - String statusPlan = request.getParameter("statusPlan"); - if (statusPlan != null && !statusPlan.equals("")) { - wherestr += " and status_plan = '" + statusPlan + "'"; - } - String search_name = request.getParameter("search_name"); - if (search_name != null && !search_name.equals("")) { - wherestr += " and name like '%" + search_name + "%'"; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and starttime >= '" + request.getParameter("sdt") + "'"; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and starttime <= '" + request.getParameter("edt") + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.emergencyRecordsService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 新增异常事件启动 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - model.addAttribute("nowdate", CommUtil.nowDate()); - return "/command/emergencyRecordsadd"; - } - - @RequestMapping("/dostartsave.do") - public String dostartsave(HttpServletRequest request, Model model - ) { - EmergencyRecords emergencyRecords = new EmergencyRecords(); - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - List emergencyConfigure = this.emergencyConfigureService.selectListByWhere("where id='" + id + "'"); - if (emergencyConfigure.size() != 0) { - String bizid = emergencyConfigure.get(0).getBizid(); - Company company = this.unitService.getCompById(bizid); - String emergencyRecordsid = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - emergencyRecords.setId(emergencyRecordsid); - emergencyRecords.setInsdt(CommUtil.nowDate()); - emergencyRecords.setInsuser(cu.getId()); - emergencyRecords.setBizid(bizid); - emergencyRecords.setStatus("0"); - emergencyRecords.setGrade(emergencyConfigure.get(0).getGrade()); - emergencyRecords.setStarter(cu.getId());//启动人 - - List emergencyConfigure2 = this.emergencyConfigureService.selectListByWhere("where id='" + emergencyConfigure.get(0).getPid() + "'"); - if (emergencyConfigure2.size() != 0) { - emergencyRecords.setFirstmenu(emergencyConfigure2.get(0).getPid()); - } else { - emergencyRecords.setFirstmenu(null); - } - emergencyRecords.setSecondmenu(emergencyConfigure.get(0).getPid()); - emergencyRecords.setThirdmenu(emergencyConfigure.get(0).getId()); - emergencyRecords.setFirstperson(emergencyConfigure.get(0).getFirstpersonid()); - emergencyRecords.setType(0); - emergencyRecords.setName(emergencyConfigure.get(0).getName()); - } - - - int result = this.emergencyRecordsService.save(emergencyRecords); -// model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\"\"}"); - model.addAttribute("result", result); - return "result"; - } - - /* - * 应急预案演练记录列表数据查询 - */ - @RequestMapping("/showlistedit.do") - public ModelAndView showlistedit(HttpServletRequest request, Model model) { - String scope = ""; - String bizid = request.getParameter("bizid"); - //获取查询时间 - if (request.getParameter("sdt") != null - && request.getParameter("sdt").trim().length() > 0) { - scope += " and m.starttime>='" - + request.getParameter("sdt").substring(0, 10) - + " 00:00:00" + "' "; - } - if (request.getParameter("edt") != null - && request.getParameter("edt").trim().length() > 0) { - scope += " and m.starttime<='" - + request.getParameter("edt").substring(0, 10) - + " 23:59:59" + "' "; - } - List ia = this.emergencyRecordsService - .selectrecordslistByWhere(" where 1=1 and (m.status='0' or m.status='5' or m.status='10') and m.type='0' and m.bizid='" + bizid + "' " + scope + " order by m.insdt desc"); - System.out.println("scpoe::" + scope); - JSONArray json = JSONArray.fromObject(ia); - String result = "{\"total\":" + ia.size() + ",\"rows\":" + json + "}"; - System.out.println("result::" + result); - - model.addAttribute("result", result); - - return new ModelAndView("result"); - //return "result"; - - } - - - @RequestMapping("/getRecords.do") - public ModelAndView getRecords(HttpServletRequest request, Model model) { - - String result = ""; - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 厂区异常事件启动tab清单 - */ - @RequestMapping("/showSubListByStatus.do") - public String showSubListByStatus(HttpServletRequest request, Model model) { - String st = request.getParameter("st"); - String bizid = request.getParameter("bizid"); - String result = ""; - switch (st) { - case "0"://预案启动 - result = "/command/maintenanceSubList_Start"; - break; - case "1"://预案执行 - result = "/command/maintenanceSubList_Execute"; - break; - case "2"://预案结束 - result = "/command/maintenanceSubList_Finish"; - break; - /*case "3"://维护中 - result="/maintenance/maintenanceSubList_Handle"; - break; - case "4"://已完成 - result="/maintenance/maintenanceSubList_Finish"; - break;*/ - default: - break; - } - System.out.println("bizid::" + bizid); - System.out.println("st::" + st); - request.setAttribute("bizid", bizid); - request.setAttribute("staut", st); - return result; - } - - /** - * 添加发起问题 - */ - @RequestMapping("/addProblem.do") - public String addProblem(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "command/unusualLaunchAdd"; - } - - /** - * 保存发起任务 - */ - @RequestMapping("/saveLaunch.do") - public String saveLaunch(HttpServletRequest request, Model model, - @ModelAttribute("emergencyRecords") EmergencyRecords emergencyRecords) { - User cu = (User) request.getSession().getAttribute("cu"); - emergencyRecords.setInsuser(cu.getId()); - emergencyRecords.setInsdt(CommUtil.nowDate()); - emergencyRecords.setStatus("未启动"); - System.out.println("bizid:::" + emergencyRecords.getBizid()); - //emergencyRecords.setType(emergencyRecords.TYPE_MAINTENANCE); - int result = this.emergencyRecordsService.save(emergencyRecords); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + emergencyRecords.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新任务 - */ - @RequestMapping("/showFuncEdit.do") - public String doFuncEdit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EmergencyRecords emergencyRecords = emergencyRecordsService.getMenuById(id); - model.addAttribute("emergencyRecords", emergencyRecords); - - return "command/menuFuncEdit_records"; - } - - @RequestMapping("/updateFunc.do") - public String doupdateFunc(HttpServletRequest request, Model model, - @ModelAttribute EmergencyRecords emergencyRecords, - @RequestParam(value = "id") String id) { - System.out.println("idid::" + emergencyRecords.getId()); - System.out.println("ididid::" + id); - int result = this.emergencyRecordsService.updateMenu(emergencyRecords); - - model.addAttribute("result", "{\"res\":\"" + result + "\",\"id\":\"" + emergencyRecords.getId() + "\"}"); - return "result"; - } - - /** - * 删除任务 - */ - @RequestMapping("/deleteMenu.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int result = 0; - System.out.println("del_id:::" + id); - List mlist = this.emergencyRecordsService.selectListByWhere(" where id = '" + id + "'"); - if (mlist != null && mlist.size() > 0) { - result = this.emergencyRecordsService.deleteMenuById(id); - } else { - msg = "删除失败"; - } - model.addAttribute("result", "{\"res\":\"" + result + "\",\"msg\":\"" + msg + "\"}"); - - return "result"; - } - - /** - * start页面显示 - */ - @RequestMapping("/getSubListByStatus.do") - public ModelAndView getSubListByStatus(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String companyid = request.getParameter("search_code"); - String status = request.getParameter("status"); - - switch (status) { - case "0"://启动 - wherestr += "and status='未启动' and bizid='" + companyid + "'"; - break; - case "1"://执行 - wherestr = CommUtil.getwherestr("companyid", "", cu); - wherestr += " and status in ('" + Maintenance.Status_Submit_Problem + "' ,'" + Maintenance.Status_Confirm_Maintainer + "','" + Maintenance.Status_Submit_Maintainer + - "','" + Maintenance.Status_CancelTOMaintainer + "')"; - break; - case "2"://结束 - wherestr = CommUtil.getwherestr("maintainerId", null, cu); - wherestr += " and status in ('" + Maintenance.Status_Submit_Problem + "' )"; - break; - case "3"://维护商维护中 - wherestr = CommUtil.getwherestr("maintainerId", null, cu); - wherestr += " and status in ('" + Maintenance.Status_Confirm_Maintainer + "','" + Maintenance.Status_Submit_Maintainer + "','" + Maintenance.Status_CancelTOMaintainer + "','" + Maintenance.Status_Supplementing + "' )"; - break; - - default: - break; - } - List list = this.emergencyRecordsService.selectListByWhere(wherestr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - System.out.println("total:::" + pi.getTotal()); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - /* - * 应急预案演练记录列表数据查询 - */ - @RequestMapping("/showlistDrilledit.do") - public ModelAndView showlistDrilledit(HttpServletRequest request, Model model) { - String scope = ""; - String bizid = request.getParameter("bizid"); - //获取查询时间 - if (request.getParameter("sdt") != null - && request.getParameter("sdt").trim().length() > 0) { - scope += " and m.starttime>='" - + request.getParameter("sdt").substring(0, 10) - + " 00:00:00" + "' "; - } - if (request.getParameter("edt") != null - && request.getParameter("edt").trim().length() > 0) { - scope += " and m.starttime<='" - + request.getParameter("edt").substring(0, 10) - + " 23:59:59" + "' "; - } - List ia = this.emergencyRecordsService - .selectrecordslistByWhere(" where 1=1 and (m.status='0' or m.status='5') and m.type='1' and m.bizid='" + bizid + "' " + scope + " order by m.insdt desc"); - System.out.println("scpoe::" + scope); - JSONArray json = JSONArray.fromObject(ia); - String result = "{\"total\":" + ia.size() + ",\"rows\":" + json + "}"; - System.out.println("result::" + result); - - model.addAttribute("result", result); - - return new ModelAndView("result"); - //return "result"; - - } - - /** - * 删除任务 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idslist = ids.split(","); - int result = 0; - for (int i = 0; i < idslist.length; i++) { - - EmergencyRecords emergencyRecords = this.emergencyRecordsService.getMenuById(idslist[i]); - if (emergencyRecords != null) { - emergencyRecords.setType(2); - result = this.emergencyRecordsService.updateMenu(emergencyRecords); - } - } - model.addAttribute("result", result); - return "result"; - } - - /*** - * 获取应急预案演练详细数据(记录) - * @param request - * @param model - * @param id 演练id或者报警点 - * @return - */ - @RequestMapping("/dodrillview.do") - public String dodrillview(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - List emergencyRecords = emergencyRecordsService.selectrecordslistByWhere("where m.id='" + id + "' or m.mpointcodes='" + id + "' "); - if (emergencyRecords != null) { - id = emergencyRecords.get(0).getId(); - request.setAttribute("emergencyRecords", emergencyRecords.get(0));//演练 - request.setAttribute("titleName", emergencyRecords.get(0).getName()); - request.setAttribute("_starter", emergencyRecords.get(0).get_starter()); - if (emergencyRecords.get(0).getFirstperson() != null) { - User user = userService.getUserById(emergencyRecords.get(0).getFirstperson()); - if (user != null) { - request.setAttribute("_firstPerson", user.getCaption() + "(总负责人)"); - } - } - - //获得自身属性 - String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " - + "from tb_Repair_EmergencyConfigure m " - + "left outer join tb_user u on u.id=m.firstPerson " - + "where m.id='" + emergencyRecords.get(0).getThirdmenu() + "' "; - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecords.get(0).getThirdmenu()); - if (emergencyConfigure != null) { - request.setAttribute("emergencyConfigure", emergencyConfigure);//配置 - request.setAttribute("emergencyConfigureID", emergencyConfigure.getId());//ID - request.setAttribute("firstPerson", emergencyConfigure.getFirstperson());//总负责人 - /*//如果字数太多则截取部分文字,鼠标悬浮显示全部。 - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() >= 82) { - request.setAttribute("memo", emergencyConfigure.getMemo().substring(0, 80) + "...");//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() < 80) { - }*/ - request.setAttribute("memo", emergencyConfigure.getMemo());//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() >= 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition().substring(0, 80) + "...");//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() < 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition());//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - - } - //获取每个配置图片的路径 -// List rs = this.emergencyConfigurefileService.selectListByWhere("where masterid='" + emergencyRecords.get(0).getThirdmenu() + "video' order by insdt desc"); -// if (rs != null && rs.size() > 0) { -// request.setAttribute("abspath", rs.get(0).getAbspath());//图片路径 -// } - //查询步骤 - List steplist = emergencyRecordsDetailService.selectListByWhere( - "where pid='"+id+"' and id like '%"+"-"+EmergencyConfigure.Type_Step+"%' order by ord "); - JSONArray stepArray = new JSONArray(); - if(steplist!=null && steplist.size()>0){ - stepArray = JSONArray.fromObject(steplist); - } - request.setAttribute("stepArray", stepArray);//步骤 - - JSONObject object = selectDetail(id); - JSONArray jsonArray = (JSONArray) object.get("jsonArray"); - int end_y = (int) object.get("end_y"); - request.setAttribute("end_y", end_y); - request.setAttribute("jsonArray", jsonArray);//矩形框json - - String ids0 = object.getString("ids0");//未演练的ids - String ids1 = object.getString("ids1");//执行中的ids - String ids2 = object.getString("ids2");//已演练的ids - String ids3 = object.getString("ids3");//已关闭的ids - - request.setAttribute("ids0", ids0);//未演练的ids - request.setAttribute("ids1", ids1);//正在演练的ids - request.setAttribute("ids2", ids2);//已演练的ids - request.setAttribute("ids3", ids3);//已关闭的ids - } - - return "command/processEmergencyConfigureDrill"; - } - /*** - * 获取应急预案演练详细数据(记录) -LogicFlow流程图 - * @param request - * @param model - * @param id 演练id或者报警点 - * @return - */ - @RequestMapping("/dodrillviewLF.do") - public String dodrillviewLF(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - List emergencyRecords = emergencyRecordsService.selectrecordslistByWhere("where m.id='" + id + "' or m.mpointcodes='" + id + "' "); - if (emergencyRecords != null) { - id = emergencyRecords.get(0).getId(); - request.setAttribute("emergencyRecords", emergencyRecords.get(0));//演练 - request.setAttribute("titleName", emergencyRecords.get(0).getName()); - request.setAttribute("_starter", emergencyRecords.get(0).get_starter()); - if (emergencyRecords.get(0).getFirstperson() != null) { - User user = userService.getUserById(emergencyRecords.get(0).getFirstperson()); - if (user != null) { - request.setAttribute("_firstPerson", user.getCaption() + "(总负责人)"); - } - } - - //获得自身属性 - String emergencyConfigureSql = "select m.*,u.caption as _firstPerson " - + "from tb_Repair_EmergencyConfigure m " - + "left outer join tb_user u on u.id=m.firstPerson " - + "where m.id='" + emergencyRecords.get(0).getThirdmenu() + "' "; - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyRecords.get(0).getThirdmenu()); - if (emergencyConfigure != null) { - request.setAttribute("emergencyConfigure", emergencyConfigure);//配置 - request.setAttribute("emergencyConfigureID", emergencyConfigure.getId());//ID - request.setAttribute("firstPerson", emergencyConfigure.getFirstperson());//总负责人 - /*//如果字数太多则截取部分文字,鼠标悬浮显示全部。 - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() >= 82) { - request.setAttribute("memo", emergencyConfigure.getMemo().substring(0, 80) + "...");//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - } - if (emergencyConfigure.getMemo() != null && emergencyConfigure.getMemo().length() < 80) { - }*/ - request.setAttribute("memo", emergencyConfigure.getMemo());//总体介绍_可能被截取 - request.setAttribute("memo_title", emergencyConfigure.getMemo());//总体介绍_全部内容 - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() >= 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition().substring(0, 80) + "...");//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - if (emergencyConfigure.getStartingcondition() != null && emergencyConfigure.getStartingcondition().length() < 82) { - request.setAttribute("startingCondition", emergencyConfigure.getStartingcondition());//启动条件_可能被截取 - request.setAttribute("startingCondition_title", emergencyConfigure.getStartingcondition());//启动条件_标题显示的全部内容 - } - - } - //获取每个配置图片的路径 -// List rs = this.emergencyConfigurefileService.selectListByWhere("where masterid='" + emergencyRecords.get(0).getThirdmenu() + "video' order by insdt desc"); -// if (rs != null && rs.size() > 0) { -// request.setAttribute("abspath", rs.get(0).getAbspath());//图片路径 -// } - //查询步骤 - List steplist = emergencyRecordsDetailService.selectListByWhere( - "where pid='"+id+"' and id like '%"+"-"+EmergencyConfigure.Type_Step+"%' order by ord "); - JSONArray stepArray = new JSONArray(); - if(steplist!=null && steplist.size()>0){ - stepArray = JSONArray.fromObject(steplist); - } - request.setAttribute("stepArray", stepArray);//步骤 - - JSONObject object = selectDetail(id); - JSONArray jsonArray = (JSONArray) object.get("jsonArray"); - int end_y = (int) object.get("end_y"); - request.setAttribute("end_y", end_y); - request.setAttribute("jsonArray", jsonArray);//矩形框json - - String ids0 = object.getString("ids0");//未演练的ids - String ids1 = object.getString("ids1");//执行中的ids - String ids2 = object.getString("ids2");//已演练的ids - String ids3 = object.getString("ids3");//已关闭的ids - - request.setAttribute("ids0", ids0);//未演练的ids - request.setAttribute("ids1", ids1);//正在演练的ids - request.setAttribute("ids2", ids2);//已演练的ids - request.setAttribute("ids3", ids3);//已关闭的ids - } - - return "command/processEmergencyConfigureDrillLF"; - } - - public JSONObject selectDetail(String id){ - JSONArray jsonArray = new JSONArray(); - //查询有多少层级 - List rs = this.emergencyRecordsDetailService - .selectrankListByWhere("where pid='" + id + "' group by rank order by rank "); - int y = 0; - if (rs != null && rs.size() > 0) { - //循环层级 - for (int i = 0; i < rs.size(); i++) { - y += 100; - int x = 0; - if(rs.get(i)!=null && rs.get(i).getRank()!=null){ - if (i == 0) { - List rs2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and rank='" + rs.get(i).getRank() + "' order by ord"); - if (rs2 != null && rs2.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", rs2.get(0).getId()); - jsonObject.put("contents", rs2.get(0).getContents()); - jsonObject.put("status", rs2.get(0).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - jsonArray.add(jsonObject); - } - } else { - List rs2 = this.emergencyRecordsDetailService - .selectcontentListByWhere("where m.pid='" + id + "' and d.pid='" + id + "' and m.rank='" + rs.get(i).getRank() + "' order by m.ord"); - if (rs2 != null && rs2.size() > 0) { - //循环相同层级中的节点数 - for (int j = 0; j < rs2.size(); j++) { - JSONObject jsonObject = new JSONObject(); - //该层级只有一个节点 - if (rs2.size() == 1) { - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - //该节点为复数 - if (rs2.size() % 2 == 0) { - if (j % 2 == 0) { - x = x - (j + 1) * 50; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - x = x + (j + 1) * 50; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } - //该节点为单数 - } else { - //中间的节点 - if (j == 0) { - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - //两边节点 - } else { - if (j % 2 == 0) { - x = x - (j) * 160; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } else { - x = x + (j) * 160; - jsonObject.put("id", rs2.get(j).getId()); - jsonObject.put("contents", rs2.get(j).getContents().toString()); - jsonObject.put("status", rs2.get(j).getStatus()); - jsonObject.put("contents_x", x); - jsonObject.put("contents_y", y); - if (rs2.get(j).getStartId() != null && !rs2.get(j).getStartId().equals("")) { - jsonObject.put("startLine", rs2.get(j).getStartId().toString()); - jsonObject.put("endLine", rs2.get(j).getId().toString()); - } - } - } - } - } - jsonArray.add(jsonObject); - } - } - } - } - } - } - - List lists0 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='0'"); - List lists1 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='1'"); - List lists2 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='2'"); - List lists3 = this.emergencyRecordsDetailService - .selectListByWhere("where pid='" + id + "' and status='3'"); - - String ids0 = "";//未演练的ids - String ids1 = "";//执行中的ids - String ids2 = "";//已演练的ids - String ids3 = "";//已关闭的ids - - if (lists0 != null && lists0.size() > 0) { - for (int i = 0; i < lists0.size(); i++) { - ids0 += lists0.get(i).getId(); - } - } - if (lists1 != null && lists1.size() > 0) { - for (int i = 0; i < lists1.size(); i++) { - ids1 += lists1.get(i).getId(); - } - } - if (lists2 != null && lists2.size() > 0) { - for (int i = 0; i < lists2.size(); i++) { - ids2 += lists2.get(i).getId(); - } - } - if (lists3 != null && lists3.size() > 0) { - for (int i = 0; i < lists3.size(); i++) { - ids3 += lists3.get(i).getId(); - } - } - JSONObject object = new JSONObject(); - object.put("jsonArray", jsonArray); - object.put("end_y", y+100); - object.put("ids0", ids0); - object.put("ids1", ids1); - object.put("ids2", ids2); - object.put("ids3", ids3); - return object; - } - - /** - * 查询节点 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/selectDetails.do") - public ModelAndView selectDetails(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - JSONObject object = selectDetail(id); - Result result = Result.success(object); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - /** - * 添加计划外演练 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/doChoice.do") - public ModelAndView doChoice(HttpServletRequest request, Model model, - @RequestParam(value = "checkedIds") String checkedIds, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - - //int res = this.emergencyRecordsService.doChoice(checkedIds, unitId, cu); - //计划内和计划外目前只有状态的区别,合并到同一个方法里,增加参数变化 - //计划外 - int res = this.emergencyPlanService.dodown(checkedIds, cu, EmergencyRecords.Outside); - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - /** - * 报警触发应急预案 - * @param mpid 报警点位 - * @return 返回触发数量,0为失败,大于0为成功触发数量 - */ - @RequestMapping("/doAlarmDown.do") - public ModelAndView doAlarmDown(HttpServletRequest request, Model model, - @RequestParam(value = "mpid") String mpid) { - User cu = (User) request.getSession().getAttribute("cu"); - //计划外 - int res = this.emergencyPlanService.alarmDown(mpid, cu); - model.addAttribute("result", res); - return new ModelAndView("result"); - } - - /** - * 获取预案演练数据 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/getEdit.do") - public ModelAndView getEdit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EmergencyRecords emergencyRecords = emergencyRecordsService.getMenuById(id); - JSONObject jsonObject = JSONObject.fromObject(emergencyRecords); - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - /** - * 获取预案演练-操作内容数据 - * - * @param request - * @param model - * @param nodeId - * @param recordsId - * @return - */ - @RequestMapping("/getDetailEdit.do") - public ModelAndView getDetailEdit(HttpServletRequest request, Model model, - @RequestParam(value = "nodeId") String nodeId, - @RequestParam(value = "recordsId") String recordsId) { - List list = this.emergencyRecordsDetailService.selectListByWhere("where ecDetailId='"+nodeId+"' and pid ='"+recordsId+"' order by insdt desc"); - if(list!=null && list.size()>0){ - JSONObject jsonObject = JSONObject.fromObject(list.get(0)); - model.addAttribute("result", jsonObject); - } - return new ModelAndView("result"); - } - - @RequestMapping("/updateMenuLf.do") - public ModelAndView updateMenuLf(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "graphData") String graphData) { - EmergencyRecords emergencyRecords =this.emergencyRecordsService.getMenuById(id); - emergencyRecords.setNodes(graphData); - int result = this.emergencyRecordsService.updateMenu(emergencyRecords); - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/command/EmergencyRecordsWorkOrderController.java b/src/com/sipai/controller/command/EmergencyRecordsWorkOrderController.java deleted file mode 100644 index d3c6e97a..00000000 --- a/src/com/sipai/controller/command/EmergencyRecordsWorkOrderController.java +++ /dev/null @@ -1,539 +0,0 @@ -package com.sipai.controller.command; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.command.EmergencyRecordsDetail; -import com.sipai.entity.command.EmergencyRecordsWorkOrder; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.User; -import com.sipai.service.command.EmergencyRecordsWorkOrderService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MqttUtil; -import com.sipai.tools.SpringContextUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -@Controller -@RequestMapping("/command/emergencyRecordsWorkOrder") -public class EmergencyRecordsWorkOrderController { - @Resource - private EmergencyRecordsWorkOrderService emergencyRecordsWorkOrderService; - @Resource - private MsgTypeService msgtypeService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/command/emergencyRecordsWorkOrderList"; - } - - /* - * 应急预案演练记录列表数据查询 - */ - @RequestMapping("/getListData.do") - public ModelAndView getListData(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String scope = ""; - //获取查询时间 - if (request.getParameter("sdt") != null - && request.getParameter("sdt").trim().length() > 0) { - scope += " and m.worksenddt>='" - + request.getParameter("sdt").substring(0, 10) - + " 00:00:00" + "' "; - } - if (request.getParameter("edt") != null - && request.getParameter("edt").trim().length() > 0) { - scope += " and m.worksenddt<='" - + request.getParameter("edt").substring(0, 10) - + " 23:59:59" + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - scope += " and workcontent like '%" + request.getParameter("search_name") + "%' "; - } - String unitId = request.getParameter("unitId"); - String userId = request.getParameter("userId"); - String type = request.getParameter("type");//type不为空的话 则为app传过来的 - - if (unitId != null && !unitId.equals("")) { -// scope += " and bizid = '" + unitId + "' "; - } - - if (userId != null && !userId.equals("") && !userId.equals("admin")) { - scope += " and (worksenduser = '" + userId + "' or workreceiveuser = '" + userId + "') "; - }else{ - scope += " and (worksenduser = '" + cu.getId() + "' or workreceiveuser = '" + cu.getId() + "') "; - } - - if (type != null && !type.equals("")) { - scope += " and (status = '" + EmergencyRecordsWorkOrder.Status_NoReceive + "' or status = '" + EmergencyRecordsWorkOrder.Status_Receive + "') "; - } - - List ia = this.emergencyRecordsWorkOrderService - .selectcompanynameByWhere(" where 1=1 " + scope + " order by m.insdt desc"); - JSONArray json = JSONArray.fromObject(ia); - String result = "{\"total\":" + ia.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String nodeid = request.getParameter("nodeid"); - String recordid = request.getParameter("recordid"); - - String orderstr = " order by m.insdt desc "; - - String wherestr = "where 1=1 "; - if (nodeid != null && !nodeid.isEmpty()) { - wherestr += " and nodeid like '%" + nodeid + "%' "; - } - if (recordid != null && !recordid.isEmpty()) { - wherestr += " and recordid = '" + recordid + "' "; - } - PageHelper.startPage(page, rows); - List list = this.emergencyRecordsWorkOrderService.selectlistlayerByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/donew.do") - public String donew(HttpServletRequest request, Model model) { - return "/command/emergencyRecordsWorkOrderNew"; - } - - @RequestMapping("/donew2.do") - public ModelAndView donew2(HttpServletRequest request, Model model) { - String workOrderId = request.getParameter("workOrderId"); - List list = this.emergencyRecordsWorkOrderService.selectlistlayerByWhere("where m.id='" + workOrderId + "' order by id"); - if (list != null && list.size() > 0) { - model.addAttribute("emergencyRecordsWorkOrder", list.get(0)); - } - return new ModelAndView("/command/emergencyRecordsWorkOrderNew2"); - } - - /*下发任务*/ - @RequestMapping("/dosend.do") - public ModelAndView dosend(HttpServletRequest request, Model model) { - User user = (User) request.getSession().getAttribute("cu"); - String workOrderId = request.getParameter("workOrderId"); - List list = this.emergencyRecordsWorkOrderService.selectlistlayerByWhere("where m.id='" + workOrderId + "' order by id"); - int res = 0; - if (list != null && list.size() > 0) { - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = list.get(0); - emergencyRecordsWorkOrder.setStatus(Integer.parseInt(PatrolRecord.Status_Issue)); - res = this.emergencyRecordsWorkOrderService.update(emergencyRecordsWorkOrder); - if (res == 1) { - String msgContent = ""; - String sendUserId = user.getId(); - String receiveUserIds = emergencyRecordsWorkOrder.getWorkreceiveuserid(); - MsgType msgType = this.msgtypeService.getMsgTypeById(EmergencyRecordsDetail.Msg_Type); - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - if (msgType != null) { - msgContent = "应急预案工单已下发至您,请及时处理。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - } - } - model.addAttribute("result", res); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("emergencyRecordsWorkOrder") EmergencyRecordsWorkOrder emergencyRecordsWorkOrder) { - User user = (User) request.getSession().getAttribute("cu"); - - JSONArray jsonArray = new JSONArray(); - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(user.getId()); - emergencyRecordsWorkOrder.setWorksenduser(user.getId()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setStatus(3); - emergencyRecordsWorkOrder.setNodeid(request.getParameter("nodeid")); - emergencyRecordsWorkOrder.setRecordid(request.getParameter("recordid")); - emergencyRecordsWorkOrder.setWorkreceiveuserid(request.getParameter("workreceiveuserid")); - int res = this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - System.out.println("res" + res); - if (res == 1) { - List list = this.emergencyRecordsWorkOrderService - .selectusernameByWhere("where m.nodeid='" + emergencyRecordsWorkOrder.getNodeid() + "' order by m.insdt asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - if (list.get(i).getId() != null && !list.get(i).getId().equals("")) { - jsonObject.put("id", list.get(i).getId()); - } else { - jsonObject.put("id", ""); - } - if (list.get(i).get_worksenduser() != null && !list.get(i).get_worksenduser().equals("")) { - jsonObject.put("worksenduser", list.get(i).get_worksenduser()); - } else { - jsonObject.put("worksenduser", ""); - } - if (list.get(i).get_workreceiveuser() != null && !list.get(i).get_workreceiveuser().equals("")) { - jsonObject.put("workreceiveuser", list.get(i).get_workreceiveuser()); - } else { - jsonObject.put("workreceiveuser", ""); - } - if (list.get(i).getWorkcontent() != null && !list.get(i).getWorkcontent().equals("")) { - jsonObject.put("workcontent", list.get(i).getWorkcontent()); - } else { - jsonObject.put("workcontent", ""); - } - if (list.get(i).getWorksenddt() != null && !list.get(i).getWorksenddt().equals("")) { - jsonObject.put("worksenddt", list.get(i).getWorksenddt()); - } else { - jsonObject.put("worksenddt", ""); - } - if (list.get(i).getWorkreceivedt() != null && !list.get(i).getWorkreceivedt().equals("")) { - jsonObject.put("workreceivedt", list.get(i).getWorkreceivedt()); - } else { - jsonObject.put("workreceivedt", ""); - } - if (list.get(i).getStatus() == 0) { - jsonObject.put("status", "未下发"); - } - if (list.get(i).getStatus() == 3) { - jsonObject.put("status", "待接单"); - } - if (list.get(i).getStatus() == 5) { - jsonObject.put("status", "已接单"); - } - if (list.get(i).getStatus() == 10) { - jsonObject.put("status", "已完成"); - } - - jsonArray.add(jsonObject); - } - } -// request.setAttribute("result", jsonArray); - model.addAttribute("res", res); -// request.setAttribute("res", res); - model.addAttribute("result", "{\"res\":\"" + res + "\",\"results\":\"" + jsonArray + "\"}"); - System.out.println("{\"res\":\"" + res + "\",\"result\":\"" + jsonArray + "\"}"); - return "result"; - - } else { - request.setAttribute("result", "0"); - return "result"; - } - } - - @RequestMapping("/dosave2.do") - public String dosave2(HttpServletRequest request, Model model, - @ModelAttribute("emergencyRecordsWorkOrder") EmergencyRecordsWorkOrder emergencyRecordsWorkOrder) { - User user = (User) request.getSession().getAttribute("cu"); - String status = request.getParameter("status"); - if (status == null || "".equals(status)) { - status = "0"; - } - int res = 0; - String workreceiveuser = request.getParameter("workreceiveuserid"); - if (emergencyRecordsWorkOrder.getId() != null && !"".equals(emergencyRecordsWorkOrder.getId())) { - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(user.getId()); - emergencyRecordsWorkOrder.setWorksenduser(user.getId()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - res = this.emergencyRecordsWorkOrderService.update(emergencyRecordsWorkOrder); - } else { - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(user.getId()); - emergencyRecordsWorkOrder.setWorksenduser(user.getId()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setStatus(Integer.parseInt(status)); - emergencyRecordsWorkOrder.setNodeid(request.getParameter("nodeid")); - emergencyRecordsWorkOrder.setRecordid(request.getParameter("recordid")); - emergencyRecordsWorkOrder.setWorkreceiveuserid(request.getParameter("workreceiveuserid")); - String patrolRecordId = CommUtil.getUUID(); - emergencyRecordsWorkOrder.setPatrolRecordId(patrolRecordId); - res = this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - if (res == 1 && PatrolRecord.Status_Issue.equals(status)) { - String msgContent = ""; - String sendUserId = user.getId(); - String receiveUserIds = workreceiveuser; - MsgType msgType = this.msgtypeService.getMsgTypeById(EmergencyRecordsDetail.Msg_Type); - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - if (msgType != null) { - msgContent = "收到一条应急预案工单,请及时处理。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("title", "维修单"); - jsonObject.put("content", "收到一条应急预案工单,请及时处理。"); - /*Mqtt mqtt = new Mqtt(); - if (mqtt.getStatus() != null && mqtt.getStatus().equals("0")) { - MqttUtil.publish(jsonObject, receiveUserIds); - }*/ - MqttUtil.publish(jsonObject, receiveUserIds); - } - request.setAttribute("result", res); - return "result"; - } - - /* - * 异步查询table记录 - */ - @RequestMapping("/selectTable.do") - public String selectTable(HttpServletRequest request, Model model) { - User user = (User) request.getSession().getAttribute("cu"); - - JSONArray jsonArray = new JSONArray(); - String nodeid = request.getParameter("nodeid"); - List list = this.emergencyRecordsWorkOrderService - .selectusernameByWhere("where m.nodeid='" + nodeid + "' order by m.insdt asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - if (list.get(i).getId() != null && !list.get(i).getId().equals("")) { - jsonObject.put("id", list.get(i).getId()); - } else { - jsonObject.put("id", ""); - } - if (list.get(i).get_worksenduser() != null && !list.get(i).get_worksenduser().equals("")) { - jsonObject.put("worksenduser", list.get(i).get_worksenduser()); - } else { - jsonObject.put("worksenduser", ""); - } - if (list.get(i).get_workreceiveuser() != null && !list.get(i).get_workreceiveuser().equals("")) { - jsonObject.put("workreceiveuser", list.get(i).get_workreceiveuser()); - } else { - jsonObject.put("workreceiveuser", ""); - } - if (list.get(i).getWorkcontent() != null && !list.get(i).getWorkcontent().equals("")) { - jsonObject.put("workcontent", list.get(i).getWorkcontent()); - } else { - jsonObject.put("workcontent", ""); - } - if (list.get(i).getWorksenddt() != null && !list.get(i).getWorksenddt().equals("")) { - jsonObject.put("worksenddt", list.get(i).getWorksenddt()); - } else { - jsonObject.put("worksenddt", ""); - } - if (list.get(i).getWorkreceivedt() != null && !list.get(i).getWorkreceivedt().equals("")) { - jsonObject.put("workreceivedt", list.get(i).getWorkreceivedt()); - } else { - jsonObject.put("workreceivedt", ""); - } - if (list.get(i).getStatus() == 0) { - jsonObject.put("status", "未下发"); - jsonObject.put("xfstatus", "下发");//xfstatus用来判断是否显示下发 只有为0的时候显示下发 - } - if (list.get(i).getStatus() == 3) { - jsonObject.put("status", "待接单"); - jsonObject.put("xfstatus", ""); - } - if (list.get(i).getStatus() == 5) { - jsonObject.put("status", "已接单"); - jsonObject.put("xfstatus", ""); - } - if (list.get(i).getStatus() == 10) { - jsonObject.put("status", "已完成"); - jsonObject.put("xfstatus", ""); - } - - jsonArray.add(jsonObject); - } - } - request.setAttribute("result", jsonArray); - return "result"; - - } - - /* - * - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - User user = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - List eRecordsWorkOrder = this.emergencyRecordsWorkOrderService - .selectcompanynameByWhere("where m.id='" + id + "'"); - if (eRecordsWorkOrder != null) { - request.setAttribute("eRecordsWorkOrder", eRecordsWorkOrder.get(0)); - return "/command/emergencyRecordsWorkOrderEdit"; - } else { - request.setAttribute("msg", "数据已删除"); - return "redirect:showlist"; - } - - } - - /* - * 弹窗显示摄像头页面 - */ - @RequestMapping("/cameraListLayer.do") - public String cameraListLayer(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); -// CameraDAO cd= new CameraDAO(); -// Result rs = null; -// String serverIp = request.getServerName(); -// if(serverIp!=null && !serverIp.equals("")){ -// if(serverIp.substring(0, 2).equals("10")){ -// rs = cd.loadSql("select id,name,channel from TB_PRO_Camera where network='厂内' and bizid='"+ bizid +"' order by channel asc"); -// }else { -// rs = cd.loadSql("select id,name,channel from TB_PRO_Camera where network='厂外' and bizid='"+ bizid +"' order by channel asc"); -// } -// } -// cd = null; -// if(rs!=null && rs.getRowCount()>0){ -// request.setAttribute("list", rs.getRows()); -// rs = null; -// return "/command/emergencyRecordsCameraListlayer"; -// }else { -// request.setAttribute("msg", "数据已删除"); -// return showlist(mapping, form, request, response); -// } - return "/command/emergencyRecordsCameraListlayer"; - } - - /* - * 完成工单 - */ - @RequestMapping("/dofinish.do") - public String dofinish(HttpServletRequest request, Model model, - @ModelAttribute("eRecordsWorkOrder") EmergencyRecordsWorkOrder ec) { - User user = (User) request.getSession().getAttribute("cu"); - ec.setWorkfinishdt(CommUtil.nowDate()); - ec.setStatus(10); - int result = this.emergencyRecordsWorkOrderService.update(ec); - if (result == 1) { - List eRecordsWorkOrder = this.emergencyRecordsWorkOrderService - .selectcompanynameByWhere("where m.id='" + ec.getId() + "'"); - if (eRecordsWorkOrder != null && eRecordsWorkOrder.size() > 0) { - String msgContent = ""; - String sendUserId = user.getId(); - String receiveUserIds = eRecordsWorkOrder.get(0).getWorksenduser(); - MsgType msgType = this.msgtypeService.getMsgTypeById(EmergencyRecordsDetail.Msg_Type); - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - if (msgType != null) { - msgContent = "应急预案工单已完成,请注意查看。"; - msgService.insertMsgSend(msgType.getId(), msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - } - } -// if(res==0){ -// request.setAttribute("msg", "更新成功"); -// return "redirect:showlist"; -// -// }else{ -// request.setAttribute("msg", "更新失败:"+res); -// request.setAttribute("ec", ec); -// return "redirect:doedit"; -// } - request.setAttribute("result", result); - return "result"; - - } - - /* - * list界面 - */ - @RequestMapping("/dolistlayer.do") - public String dolistlayer(HttpServletRequest request, Model model) { - User user = (User) request.getSession().getAttribute("cu"); - String recordid = request.getParameter("recordid");//应急预案主表的id - List rs = this.emergencyRecordsWorkOrderService - .selectlistlayerByWhere("where m.recordid='" + recordid + "' order by rank asc"); - if (rs != null) { - request.setAttribute("list", rs); - return "/command/emergencyRecordsWorkOrderListlayer"; - } else { - request.setAttribute("msg", "数据已删除"); - return "redirect:showlist"; - } - } - - /* - * 签收 - */ - @RequestMapping("/dosignfor.do") - public String dosignfor(HttpServletRequest request, Model model, - @ModelAttribute("eRecordsWorkOrder") EmergencyRecordsWorkOrder ec) { - User user = (User) request.getSession().getAttribute("cu"); - ec.setWorkreceivedt(CommUtil.nowDate());//接单时间 - ec.setStatus(5); - int result = this.emergencyRecordsWorkOrderService.update(ec); -// if(res==0){ -// request.setAttribute("msg", "更新成功"); -// return "redirect:showlist"; -// }else{ -// request.setAttribute("msg", "更新失败:"+res); -// request.setAttribute("ec", ec); -// return "redirect:doedit"; -// } - request.setAttribute("result", result); - return "result"; - - } - - /* - * 查看界面 - */ - @RequestMapping("/doviewlayer.do") - public String doviewlayer(HttpServletRequest request, Model model) { - User user = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - List eRecordsWorkOrder = this.emergencyRecordsWorkOrderService - .selectcompanynameByWhere("where m.id='" + id + "'"); - if (eRecordsWorkOrder != null) { - request.setAttribute("eRecordsWorkOrder", eRecordsWorkOrder.get(0)); -// System.out.println(eRecordsWorkOrder.get(0)); - return "/command/emergencyRecordsWorkOrderViewlayer"; - } else { - request.setAttribute("msg", "数据已删除"); - return "redirect:showlist"; - } - - } - - /* - * 下发工单 - */ - @RequestMapping("/downWork.do") - public String downWork(HttpServletRequest request, Model model) { - User user = (User) request.getSession().getAttribute("cu"); - EmergencyRecordsWorkOrder ec = new EmergencyRecordsWorkOrder(); - ec.setWorkfinishdt(CommUtil.nowDate()); - ec.setStatus(3); - int res = this.emergencyRecordsWorkOrderService.save(ec); - if (res == 0) { - System.out.println("下发成功"); - request.setAttribute("result", "0"); - return "result"; - - } else { - System.out.println("下发失败"); - request.setAttribute("result", "1"); - return "result"; - } - - } - -} diff --git a/src/com/sipai/controller/cqbyt/CqbytSampleValueController.java b/src/com/sipai/controller/cqbyt/CqbytSampleValueController.java deleted file mode 100644 index c2b414a0..00000000 --- a/src/com/sipai/controller/cqbyt/CqbytSampleValueController.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.sipai.controller.cqbyt; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Random; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.cqbyt.CqbytSampleValue; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.cqbyt.CqbytSampleValueService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/cqbyt/cqbytSampleValue") -public class CqbytSampleValueController { - @Resource - private CqbytSampleValueService cqbytSampleValueService; - @Resource - private UnitService unitService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - ArrayList itemUnit = new ArrayList<>(); - itemUnit.add("张玥"); - itemUnit.add("庞力"); - itemUnit.add("彭先乙"); - itemUnit.add("罗小红"); - itemUnit.add("陈文静"); - ArrayList itemName = new ArrayList<>(); - itemName.add("江南水厂出厂水"); - itemName.add("江南水厂原水"); - ArrayList checkStandardCode = new ArrayList<>(); - checkStandardCode.add("浅褐色、泥腥味、微浑、样品完好"); - checkStandardCode.add("无色、无味、透明、样品完好"); - checkStandardCode.add("无色、无味、微浑、样品完好"); - checkStandardCode.add("无色、无味、透明"); - Random random = new Random(); - - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.DAY_OF_YEAR, -1); - Date date = cal.getTime(); - DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowDate = format.format(date).substring(0,10); - List list = this.cqbytSampleValueService.selectListByWhere(" where sampleCode = '"+nowDate+"' "); - if (list.size()<4) { - CqbytSampleValue cqbytSampleValue = new CqbytSampleValue(); - cqbytSampleValue.setSamplecode(nowDate); - String user = itemUnit.get(random.nextInt(5)); - String user1 = itemUnit.get(random.nextInt(5)); - for (int i = 0; i < 4; i++) { - int a = random.nextInt(999)+1; - cqbytSampleValue.setId(CommUtil.getUUID()); - cqbytSampleValue.setItemcode("SR22401005"+a); - if (i%2==0) { - cqbytSampleValue.setItemname("江南水厂出厂水"); - cqbytSampleValue.setItemunit(user); - }else { - cqbytSampleValue.setItemname("江南水厂原水"); - cqbytSampleValue.setItemunit(user1); - } - cqbytSampleValue.setCheckstandardcode(checkStandardCode.get(i)); - - this.cqbytSampleValueService.save(cqbytSampleValue); - } - } - - return "/cqbytSampleValue/cqbytSampleValueBrowse"; - } - - @RequestMapping("/browseList.do") - public String browseList(HttpServletRequest request,Model model){ - return "/cqbytSampleValue/cqbytSampleValueBrowse"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("unitId"); - sort = " sampleCode "; - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1"; -// if(companyId!=null && !companyId.isEmpty()){ -// //获取公司下所有子节点 -// List units = unitService.getUnitChildrenById(companyId); -// String companyids=""; -// for(Unit unit : units){ -// companyids += "'"+unit.getId()+"',"; -// } -// if(companyids!=""){ -// companyids = companyids.substring(0, companyids.length()-1); -// wherestr += " and unit_id in ("+companyids+") "; -// } -// } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and itemName like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.cqbytSampleValueService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/cqbytSampleValue/cqbytSampleValueAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute CqbytSampleValue cqbytSampleValue){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - cqbytSampleValue.setId(CommUtil.getUUID()); - int code = this.cqbytSampleValueService.save(cqbytSampleValue); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - CqbytSampleValue cqbytSampleValue = this.cqbytSampleValueService.selectById(id); - model.addAttribute("cqbytSampleValue", cqbytSampleValue); - return "/cqbytSampleValue/cqbytSampleValueEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - CqbytSampleValue cqbytSampleValue = this.cqbytSampleValueService.selectById(id); - model.addAttribute("cqbytSampleValue", cqbytSampleValue); - return "/cqbytSampleValue/cqbytSampleValueView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute CqbytSampleValue cqbytSampleValue){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.cqbytSampleValueService.update(cqbytSampleValue); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @ModelAttribute CqbytSampleValue cqbytSampleValue){ - Result result = new Result(); - int code = this.cqbytSampleValueService.deleteById(cqbytSampleValue.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.cqbytSampleValueService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/cqbyt/CqbytVISITOUTINDATAController.java b/src/com/sipai/controller/cqbyt/CqbytVISITOUTINDATAController.java deleted file mode 100644 index d4d3d36a..00000000 --- a/src/com/sipai/controller/cqbyt/CqbytVISITOUTINDATAController.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.sipai.controller.cqbyt; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.cqbyt.CqbytVISITOUTINDATA; -import com.sipai.entity.user.User; -import com.sipai.service.cqbyt.CqbytVISITOUTINDATAService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/cqbyt/cqbytVISITOUTINDATA") -public class CqbytVISITOUTINDATAController { - @Resource - private CqbytVISITOUTINDATAService cqbytVISITOUTINDATAService; - @Resource - private UnitService unitService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - return "/cqbytSampleValue/cqbytVISITOUTINDATABrowse"; - } - - @RequestMapping("/browseList.do") - public String browseList(HttpServletRequest request,Model model){ - return "/cqbytSampleValue/cqbytVISITOUTINDATABrowse"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("unitId"); - sort = " CREATETIME "; - order = " desc "; - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1"; -// if(companyId!=null && !companyId.isEmpty()){ -// //获取公司下所有子节点 -// List units = unitService.getUnitChildrenById(companyId); -// String companyids=""; -// for(Unit unit : units){ -// companyids += "'"+unit.getId()+"',"; -// } -// if(companyids!=""){ -// companyids = companyids.substring(0, companyids.length()-1); -// wherestr += " and unit_id in ("+companyids+") "; -// } -// } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' or cardid like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.cqbytVISITOUTINDATAService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/cqbytVISITOUTINDATA/cqbytVISITOUTINDATAAdd"; - } - -// @RequestMapping("/dosave.do") -// public String dosave(HttpServletRequest request,Model model, -// @ModelAttribute CqbytVISITOUTINDATA cqbytVISITOUTINDATA){ -// User cu = (User) request.getSession().getAttribute("cu"); -// String userId = cu.getId(); -// cqbytVISITOUTINDATA.setId(CommUtil.getUUID()); -// int code = this.cqbytVISITOUTINDATAService.save(cqbytVISITOUTINDATA); -// -// Result result = new Result(); -// if (code == Result.SUCCESS) { -// result = Result.success(code); -// } else { -// result = Result.failed("新增失败"); -// } -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ -// CqbytVISITOUTINDATA cqbytVISITOUTINDATA = this.cqbytVISITOUTINDATAService.selectById(id); - model.addAttribute("jpg", id); - return "/cqbytSampleValue/cqbytVISITOUTINDATAEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - CqbytVISITOUTINDATA cqbytVISITOUTINDATA = this.cqbytVISITOUTINDATAService.selectById(id); - model.addAttribute("cqbytVISITOUTINDATA", cqbytVISITOUTINDATA); - return "/cqbytSampleValue/cqbytVISITOUTINDATAView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute CqbytVISITOUTINDATA cqbytVISITOUTINDATA){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.cqbytVISITOUTINDATAService.update(cqbytVISITOUTINDATA); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -// @RequestMapping("/dodelete.do") -// public String dodelete(HttpServletRequest request,Model model, -// @ModelAttribute CqbytVISITOUTINDATA cqbytVISITOUTINDATA){ -// Result result = new Result(); -// int code = this.cqbytVISITOUTINDATAService.deleteById(cqbytVISITOUTINDATA.getId()); -// -// if (code == Result.SUCCESS) { -// result = Result.success(code); -// } else { -// result = Result.failed("删除失败"); -// } -// -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.cqbytVISITOUTINDATAService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/cqbyt/TestReportController.java b/src/com/sipai/controller/cqbyt/TestReportController.java deleted file mode 100644 index 252ba3e6..00000000 --- a/src/com/sipai/controller/cqbyt/TestReportController.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.controller.cqbyt; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.dao.cqbyt.TestReportDao; -import com.sipai.entity.cqbyt.TestReport; -import com.sipai.entity.user.User; -import com.sipai.service.cqbyt.TestReportService; -import net.sf.json.JSONArray; -import java.util.List; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping({"/cqbyt/testReport"}) -public class TestReportController { - @Resource - private TestReportService testReportService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - return "/cqbytSampleValue/testReportList"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - sort = " sampleDate "; - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 and name != 'SIPAIIS' "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and (name like '%"+request.getParameter("search_name")+"%' " - + "or code like '%"+request.getParameter("search_name")+"%' " - + "or classifyName like '%"+request.getParameter("search_name")+"%' " - + "or evaluateStandardName like '%"+request.getParameter("search_name")+"%' " - + "or sampleInstitutionName like '%"+request.getParameter("search_name")+"%' " - + "or beCheckedUnitName like '%"+request.getParameter("search_name")+"%' " - + "or waterPointName like '%"+request.getParameter("search_name")+"%' )"; - } - //采样时间筛选 - if (request.getParameter("sdt")!= null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and sampleDate >= '"+request.getParameter("sdt")+"' "; - } - if (request.getParameter("edt")!= null && !request.getParameter("edt").isEmpty()) { - wherestr += " and sampleDate <= '"+request.getParameter("edt")+"' "; - } - //采样点 - - if (request.getParameter("waterpointname")!= null && !request.getParameter("waterpointname").isEmpty()) { - wherestr += " and [waterPointName] like '%"+request.getParameter("waterpointname")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.testReportService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - TestReport testReport = this.testReportService.selectById(id); - model.addAttribute("testReport", testReport); - return "/cqbytSampleValue/testReportView"; - } -} diff --git a/src/com/sipai/controller/cqbyt/YtsjController.java b/src/com/sipai/controller/cqbyt/YtsjController.java deleted file mode 100644 index 8068b82f..00000000 --- a/src/com/sipai/controller/cqbyt/YtsjController.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.controller.cqbyt; - -import com.sipai.dao.cqbyt.YtsjDao; -import com.sipai.entity.cqbyt.Ytsj; -import com.sipai.service.cqbyt.YtsjService; -import com.sipai.service.user.UnitService; -import java.util.ArrayList; -import java.util.List; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -@Controller -@RequestMapping({"/cqbyt/ytsj"}) -public class YtsjController { - @Resource - private YtsjService ytsjService; - @Resource - private YtsjDao ytsjDao; - @Resource - private UnitService unitService; - - public YtsjController() { - } - - @RequestMapping({"/showpoint.do"}) - public String doedit(HttpServletRequest request, Model model, @RequestParam("name") String name) { - Ytsj ytsj2 = new Ytsj(); - ytsj2.setWhere(" where name = '" + name + "' GROUP BY outputname"); - List selectListByWhere1 = this.ytsjDao.selectListByWhere1(ytsj2); - int a = 0; - ArrayList arrayList = new ArrayList(); - - for(int i = 0; i < selectListByWhere1.size(); ++i) { - if (selectListByWhere1.get(i) != null) { - String outputname = ((Ytsj)selectListByWhere1.get(i)).getOutputname(); - List ytsj = this.ytsjService.selectListByWhere("where name = '" + name + "' and outputname = '" + outputname + "' ORDER BY tstamp DESC,factorname,valuetype "); - model.addAttribute("outputname" + a, outputname); - System.out.println(outputname); - arrayList.add(outputname); - model.addAttribute("list" + a, ytsj); - System.out.println(ytsj.size()); - ++a; - } - } - - --a; - model.addAttribute("stringlist", arrayList); - model.addAttribute("a", a); - return "/cqbytSampleValue/showYtsj"; - } -} diff --git a/src/com/sipai/controller/data/BaiDuAipSpeechController.java b/src/com/sipai/controller/data/BaiDuAipSpeechController.java deleted file mode 100644 index 096d27d2..00000000 --- a/src/com/sipai/controller/data/BaiDuAipSpeechController.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.controller.data; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.work.Camera; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.*; -import com.sipai.websocket.MsgWebSocket2; -import net.sf.json.JSON; -import net.sf.json.JSONArray; -import sun.misc.BASE64Decoder; - -import org.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.baidu.aip.speech.AipSpeech; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.ExtSystem; -import com.sipai.service.user.ExtSystemService; - - -@Controller -@RequestMapping("/data/baiDuAipSpeech") -public class BaiDuAipSpeechController { - @Resource - private ExtSystemService extSystemService; - @Resource - private ListenerMessageService listenerMessageService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private CameraService cameraService; - @Resource - private EquipmentCardCameraService equipmentCardCameraService; - - //设置APPID/AK/SK -// public static final String APP_ID = "25115875"; -// public static final String API_KEY = "8Fo1s21IRg4OZ8mY9DhPPRvV"; -// public static final String SECRET_KEY = "o8lADvb2p0hMNuXQ0ziWdKFzy6HoMeG8"; - - public static final String APP_ID = "25457453"; - public static final String API_KEY = "Rn1u6q9q6dQsnD68nEfOd1wt"; - public static final String SECRET_KEY = "k9fGmNmDlHe8ZjfY2hqaVbjSPFusdoHd"; - - public String getData(String fileUrl, String fileName) { - // 初始化一个AipSpeech - AipSpeech client = new AipSpeech(APP_ID, API_KEY, SECRET_KEY); - - // 可选:设置网络连接参数 -// client.setConnectionTimeoutInMillis(5000); -// client.setSocketTimeoutInMillis(60000); - - // 可选:设置代理服务器地址, http和socket二选一,或者均不设置 - client.setHttpProxy("178.16.1.111", 80); // 设置http代理 -// client.setSocketProxy("proxy_host", proxy_port); // 设置socket代理 - - // 可选:设置log4j日志输出格式,若不设置,则使用默认配置 - // 也可以直接通过jvm启动参数设置此环境变量 -// System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties"); - - // 调用接口 -// System.out.println("baiDuAipSpeech:" + fileUrl + fileName); - System.out.println("百度请求前:" + CommUtil.nowDate()); - JSONObject res = client.asr(fileUrl + fileName, "pcm", 16000, null); - System.out.println("百度请求后:" + CommUtil.nowDate()); - System.out.println("baiDuAipSpeech:" + res.toString(2)); - return res.toString(2); - } - - @RequestMapping("/show.do") - public String showMenu4Select(HttpServletRequest request, Model model) { - return "data/baiDuAipSpeechShow"; - } - - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model) { - System.out.println("in:" + CommUtil.nowDate()); - String type = request.getParameter("type"); - String upfile_b64 = request.getParameter("upfile_b64"); - - BASE64Decoder decoder = new BASE64Decoder(); - try { - //Base64解码 - byte[] b = decoder.decodeBuffer(upfile_b64); - for (int i = 0; i < b.length; ++i) { - if (b[i] < 0) {//调整异常数据 - b[i] += 256; - } - } - String imgFilePath = "D:\\audio\\recorder.mp3"; - File fileUploadPath = new File("D:\\audio"); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - OutputStream out = new FileOutputStream(imgFilePath); - out.write(b); - out.flush(); - out.close(); - - AudioUtils utils = AudioUtils.getInstance(); - utils.convertMP32Pcm("D:\\audio\\recorder.mp3", "D:\\audio\\recorder.pcm"); - - String text = getData("D:\\audio\\", "recorder.pcm"); - model.addAttribute("result", text); - } catch (Exception e) { - model.addAttribute("result", "fail"); - } - System.out.println("out:" + CommUtil.nowDate()); - return "result"; - } - - @RequestMapping("/realTimeSave.do") - public String realTimeSave(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - String upfile_b64 = request.getParameter("upfile_b64"); - - BASE64Decoder decoder = new BASE64Decoder(); - try { - //Base64解码 - byte[] b = decoder.decodeBuffer(upfile_b64); - for (int i = 0; i < b.length; ++i) { - if (b[i] < 0) {//调整异常数据 - b[i] += 256; - } - } - String imgFilePath = "D:\\audio\\recorder.mp3"; - File fileUploadPath = new File("D:\\audio"); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - OutputStream out = new FileOutputStream(imgFilePath); - out.write(b); - out.flush(); - out.close(); - - AudioUtils utils = AudioUtils.getInstance(); - utils.convertMP32Pcm("D:\\audio\\recorder.mp3", "D:\\audio\\recorder.pcm"); - - String text = ""; - model.addAttribute("result", text); - } catch (Exception e) { - model.addAttribute("result", "fail"); - } - - return "result"; - } - - //给bim传语音 - @RequestMapping("/sendBim.do") - public ModelAndView sendBim(HttpServletRequest request, Model model) { - String text = request.getParameter("text");//文本内容 - - HashMap map = new HashMap<>(); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - List list = extSystemService.selectListByWhere("where name = '语音控制'"); - if (list != null && list.size() > 0) { - jsonObject.put("text", text); - jsonObject.put("time", System.currentTimeMillis()); - map.put("data", jsonObject.toString()); - System.out.println(jsonObject.toString()); - HttpUtil.sendPost(list.get(0).getUrl() + "?", map); - } - - model.addAttribute("result", Result.success(map)); - return new ModelAndView("result"); - } - - //给bim传语音 - @RequestMapping("/sendBimByWebsocket.do") - public ModelAndView sendBimByWebsocket(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - String code = request.getParameter("code"); - if (type.equals("findobj")) { - com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(MessageEnum.THE_FINDOBJ.toString()); - jsonObject.put("objId", code); - // 发送socket消息 - jsonObject.put("time", System.currentTimeMillis()); - sendSocketMessage(jsonObject); - // 存message表 - int i = saveMessage(jsonObject.get("cmdType").toString(), jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - try { - Thread.sleep(500); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - //定位设备时,同时要打开摄像头 - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentCardID = '" + code + "'"); - if (equipmentCardList != null && equipmentCardList.size() > 0) { -// String eqid = equipmentCardList.get(0).getId(); -// List cameras = cameraService.selectListByWhere("where configid = '" + eqid + "'"); - List cameraEq = this.equipmentCardCameraService.selectListByWhere("where eqid = '" + equipmentCardList.get(0).getId() + "'"); - if (cameraEq != null && cameraEq.size() > 0) { - com.alibaba.fastjson.JSONObject cameraJson = com.alibaba.fastjson.JSONObject.parseObject(MessageEnum.THE_OPENCAM.toString()); - Camera camera01 = this.cameraService.selectById(cameraEq.get(0).getCameraid()); - System.out.println("视频id:" + camera01.getId()); - if ("dahua".equals(camera01.getType())) { - //rtsp://admin:zhwld88888@192.168.7.69:554/cam/realmonitor?channel=1&subtype=0 这是大华的视频流格式 - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/cam/realmonitor?channel=" + camera01.getChannel() + "&subtype=0"; - System.out.println("视频rtsp:" + came); - cameraJson.put("objId", came); - } else if ("hikvision".equals(camera01.getType())) { - // rtsp://admin:admin12345@132.120.136.228/h264/ch1/sub/av_stream 海康的 - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/h264/ch" + camera01.getChannel() + "/sub/av_stream"; - System.out.println("视频rtsp:" + came); - cameraJson.put("objId", came); - } - // 发送socket消息 - cameraJson.put("time", System.currentTimeMillis()); - sendSocketMessage(cameraJson); - // 存message表 - int camera2 = saveMessage(cameraJson.get("cmdType").toString(), cameraJson.get("objId").toString(), cameraJson.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - } - model.addAttribute("result", jsonObject); - } else if (type.equals("router")) { - com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(MessageEnum.THE_ROUTER.toString()); - jsonObject.put("objId", code); - // 发送socket消息 - jsonObject.put("time", System.currentTimeMillis()); - sendSocketMessage(jsonObject); - // 存message表 - int i = saveMessage(jsonObject.get("cmdType").toString(), jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - model.addAttribute("result", jsonObject); - } else if (type.equals("opencam")) { - com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(MessageEnum.THE_OPENCAM.toString()); - jsonObject.put("objId", code); - // 发送socket消息 - jsonObject.put("time", System.currentTimeMillis()); - sendSocketMessage(jsonObject); - // 存message表 - int i = saveMessage(jsonObject.get("cmdType").toString(), jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - model.addAttribute("result", jsonObject); - } else if (type.equals("webpage")) { - com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(MessageEnum.THE_WebPage.toString()); - jsonObject.put("objId", code); - // 发送socket消息 - jsonObject.put("time", System.currentTimeMillis()); - sendSocketMessage(jsonObject); - // 存message表 - int i = saveMessage(jsonObject.get("cmdType").toString(), jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - model.addAttribute("result", jsonObject); - } - return new ModelAndView("result"); - } - - /** - * 发送socket - * - * @param jsonObject - */ - public void sendSocketMessage(com.alibaba.fastjson.JSONObject jsonObject) { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessage(jsonObject.toString(), null); - } - - /** - * 存收发记录 - * - * @param cmdtype - * @param objid - * @param action - * @return - */ - private int saveMessage(String cmdtype, String objid, String action) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setId(CommUtil.getUUID()); - listenerMessage.setCmdtype(cmdtype); - listenerMessage.setObjid(objid); - listenerMessage.setAction(action); - listenerMessage.setInsdt(CommUtil.nowDate()); - int save = this.listenerMessageService.save(listenerMessage); - return save; - } -} diff --git a/src/com/sipai/controller/data/DataCleaningConditionController.java b/src/com/sipai/controller/data/DataCleaningConditionController.java deleted file mode 100644 index c14d4771..00000000 --- a/src/com/sipai/controller/data/DataCleaningConditionController.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.controller.data; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.DataCleaningCondition; -import com.sipai.entity.user.User; -import com.sipai.service.data.DataCleaningConditionService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/data/dataCleaningCondition") -public class DataCleaningConditionController { - @Resource - private DataCleaningConditionService dataCleaningConditionService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/data/dataCleaningConditionList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='"+pid+"' "; - - PageHelper.startPage(page, rows); - List list = this.dataCleaningConditionService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/data/dataCleaningConditionAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningCondition dataCleaningCondition) { - dataCleaningCondition.setId(CommUtil.getUUID()); - int code = this.dataCleaningConditionService.save(dataCleaningCondition); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataCleaningCondition dataCleaningCondition = this.dataCleaningConditionService.selectById(id); - model.addAttribute("dataCleaningCondition", dataCleaningCondition); - return "/data/dataCleaningConditionEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningCondition dataCleaningCondition) { - int code = this.dataCleaningConditionService.update(dataCleaningCondition); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningCondition dataCleaningCondition) { - Result result = new Result(); - int code = this.dataCleaningConditionService.deleteById(dataCleaningCondition.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.dataCleaningConditionService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/data/DataCleaningConfigureController.java b/src/com/sipai/controller/data/DataCleaningConfigureController.java deleted file mode 100644 index 2cbd4f55..00000000 --- a/src/com/sipai/controller/data/DataCleaningConfigureController.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.controller.data; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.DataCleaningConfigure; -import com.sipai.entity.user.User; -import com.sipai.service.data.DataCleaningConfigureService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/data/dataCleaningConfigure") -public class DataCleaningConfigureController { - @Resource - private DataCleaningConfigureService dataCleaningConfigureService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/data/dataCleaningConfigureList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " name "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1"; - - PageHelper.startPage(page, rows); - List list = this.dataCleaningConfigureService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/data/dataCleaningConfigureAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningConfigure dataCleaningConfigure) { - dataCleaningConfigure.setId(CommUtil.getUUID()); - int code = this.dataCleaningConfigureService.save(dataCleaningConfigure); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - List list = this.dataCleaningConfigureService.selectListByWhere(" where 1=1"); - if (list != null && list.size() > 0) { - DataCleaningConfigure dataCleaningConfigure = list.get(0); - model.addAttribute("dataCleaningConfigure", dataCleaningConfigure); - return "/data/dataCleaningConfigureEdit"; - } else { - return "/data/dataCleaningConfigureAdd"; - } - - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningConfigure dataCleaningConfigure) { - int code = this.dataCleaningConfigureService.update(dataCleaningConfigure); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningConfigure dataCleaningConfigure) { - Result result = new Result(); - int code = this.dataCleaningConfigureService.deleteById(dataCleaningConfigure.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.dataCleaningConfigureService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/data/DataCleaningHistoryController.java b/src/com/sipai/controller/data/DataCleaningHistoryController.java deleted file mode 100644 index d24b6514..00000000 --- a/src/com/sipai/controller/data/DataCleaningHistoryController.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.controller.data; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.DataCleaningHistory; -import com.sipai.entity.user.User; -import com.sipai.service.data.DataCleaningHistoryService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/data/dataCleaningHistory") -public class DataCleaningHistoryController { - @Resource - private DataCleaningHistoryService dataCleaningHistoryService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/data/dataCleaningHistoryList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " cleaningDt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String unitId = request.getParameter("unitId"); - - String cleaningSdt= request.getParameter("cleaningSdt"); - String cleaningEdt= request.getParameter("cleaningEdt"); - - String wherestr = " where 1=1 and unitId='"+unitId+"' and (cleaningDt between '"+cleaningSdt+" 00:00' and '"+cleaningEdt+" 23:59' ) "; - - PageHelper.startPage(page, rows); - List list = this.dataCleaningHistoryService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/data/dataCleaningHistoryAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningHistory dataCleaningHistory) { - dataCleaningHistory.setId(CommUtil.getUUID()); - int code = this.dataCleaningHistoryService.save(dataCleaningHistory); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataCleaningHistory dataCleaningHistory = this.dataCleaningHistoryService.selectById(id); - model.addAttribute("dataCleaningHistory", dataCleaningHistory); - return "/data/dataCleaningHistoryEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningHistory dataCleaningHistory) { - int code = this.dataCleaningHistoryService.update(dataCleaningHistory); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningHistory dataCleaningHistory) { - Result result = new Result(); - int code = this.dataCleaningHistoryService.deleteById(dataCleaningHistory.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.dataCleaningHistoryService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/data/DataCleaningPointController.java b/src/com/sipai/controller/data/DataCleaningPointController.java deleted file mode 100644 index fd6db725..00000000 --- a/src/com/sipai/controller/data/DataCleaningPointController.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.sipai.controller.data; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.data.DataCleaningConfigure; -import com.sipai.service.data.DataCleaningConfigureService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.DataCleaningPoint; -import com.sipai.entity.user.User; -import com.sipai.service.data.DataCleaningPointService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/data/dataCleaningPoint") -public class DataCleaningPointController { - @Resource - private DataCleaningPointService dataCleaningPointService; - @Resource - private DataCleaningConfigureService dataCleaningConfigureService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/data/dataCleaningPointList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null) { - sort = " point "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and unitId='" + unitId + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataCleaningPointService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/data/dataCleaningPointAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningPoint dataCleaningPoint) { - dataCleaningPoint.setId(CommUtil.getUUID()); - int code = this.dataCleaningPointService.save(dataCleaningPoint); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosaves.do") - public String dosaves(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String mpids = request.getParameter("mpids"); - String unitId = request.getParameter("unitId"); - - String[] mpidss = mpids.split(","); - - int code = 0; - if (mpidss.length > 0) { - for (String mpid : - mpidss) { - DataCleaningPoint dataCleaningPoint = new DataCleaningPoint(); - - dataCleaningPoint.setId(CommUtil.getUUID()); - dataCleaningPoint.setPoint(mpid); - dataCleaningPoint.setUnitid(unitId); - dataCleaningPoint.setInsuser(cu.getId()); - dataCleaningPoint.setInsdt(CommUtil.nowDate()); - - List configureList = this.dataCleaningConfigureService.selectListByWhere(" where 1=1"); - if (configureList != null && configureList.size() > 0) { - String timeRange = configureList.get(0).getTimerange(); - String replaceType = configureList.get(0).getReplacetype(); - dataCleaningPoint.setTimerange(timeRange); - dataCleaningPoint.setReplacetype(replaceType); - } - - code += this.dataCleaningPointService.save(dataCleaningPoint); - } - } - - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataCleaningPoint dataCleaningPoint = this.dataCleaningPointService.selectById(id); - model.addAttribute("dataCleaningPoint", dataCleaningPoint); - return "/data/dataCleaningPointEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningPoint dataCleaningPoint) { - User cu = (User) request.getSession().getAttribute("cu"); - dataCleaningPoint.setInsuser(cu.getId()); - dataCleaningPoint.setInsdt(CommUtil.nowDate()); - int code = this.dataCleaningPointService.update(dataCleaningPoint); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @ModelAttribute DataCleaningPoint dataCleaningPoint) { - Result result = new Result(); - int code = this.dataCleaningPointService.deleteById(dataCleaningPoint.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.dataCleaningPointService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/data/DataCurveController.java b/src/com/sipai/controller/data/DataCurveController.java deleted file mode 100644 index ba1e34e2..00000000 --- a/src/com/sipai/controller/data/DataCurveController.java +++ /dev/null @@ -1,1770 +0,0 @@ -package com.sipai.controller.data; - -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.log; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.data.CurveRemarkFile; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.data.CurveRemarkFileService; -import net.sf.json.JSON; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.lowagie.tools.split_pdf; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.CurveRemark; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.scada.MPointProgramme; -import com.sipai.entity.scada.MPointProgrammeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserDetail; -import com.sipai.service.data.CurveMpointService; -import com.sipai.service.data.CurveRemarkService; -import com.sipai.service.data.DataCurveService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointProgrammeDetailService; -import com.sipai.service.scada.MPointProgrammeService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/data") -public class DataCurveController { - @Resource - private MPointService mPointService; - @Resource - private CommonFileService commonFileService; - - - private class CurveOption { - String label; - String val; - - public String getLabel() { - return this.label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getVal() { - return this.val; - } - - public void setVal(String val) { - this.val = val; - } - } - - @Resource - private DataCurveService dataCurveService; - @Resource - private CurveMpointService curveMpointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointProgrammeService mPointProgrammeService; - @Resource - private MPointProgrammeDetailService mPointProgrammeDetailService; - @Resource - private CurveRemarkService curveRemarkService; - @Resource - private UserService userService; - @Resource - private UserDetailService userDetailService; - @Resource - private UnitService unitService; - @Resource - private CurveRemarkFileService curveRemarkFileService; - - @RequestMapping("/showCurveTree.do") - public String showCurveTree(HttpServletRequest request, Model model) { - return "data/curveManage"; - } - - @RequestMapping("/showOnlyLine.do") - public String showOnlyLine(HttpServletRequest request, Model model) { - return "data/curveOnlyLine"; - } - - @RequestMapping("/showOnlyLineForBIM.do") - public String showOnlyLineForBIM(HttpServletRequest request, Model model) { - return "data/curveOnlyLineForBIM"; - } - - @RequestMapping("/showCurveTreeView.do") - public String showCurveTreeView(HttpServletRequest request, Model model) { - String j_username = request.getParameter("username"); - if (j_username != null && j_username.length() > 0) { - User cu = userService.getUserByLoginName(j_username); - if (cu != null) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - } - - return "data/curveManageView"; - } - - @RequestMapping("/showCurveEdit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId) { - DataCurve dataCurve = dataCurveService.selectById(id); - if (dataCurveService.selectById(dataCurve.getPid()) != null) { - dataCurve.setPname(dataCurveService.selectById(dataCurve.getPid()).getName()); - } - model.addAttribute("curve", dataCurve); - return "data/curveEdit"; - } - - @RequestMapping("/showCurveEdit2.do") - public String doedit2(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId) { - DataCurve dataCurve = dataCurveService.selectById(id); - model.addAttribute("curve", dataCurve); - return "data/curveEdit2"; - } - - @RequestMapping("/showCurveView.do") - public String showCurveView(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { -// String firstIn = request.getParameter("firstIn"); -// if (firstIn != null && firstIn.length() > 0) { -// if (firstIn.equals("true")) { -// return "data/curveView"; -// } -// } - String programmeId = request.getParameter("programmeId");//方案id - String mpid = request.getParameter("mpid"); - String oldmpids = request.getParameter("oldmpids");//之前历史选择的测量点/方案组 - - String mpids = ""; - - String dataCurveMpids = ""; - if (programmeId != null && programmeId.length() > 0) {//根据方案获取测量点 - DataCurve dataCurve = this.dataCurveService.selectById(programmeId); - if (dataCurve != null) { - List curveMpointList = this.curveMpointService.selectListByWhere("where data_curve_id='" + dataCurve.getId() + "' order by morder "); - for (CurveMpoint curveMpoint : - curveMpointList) { - dataCurveMpids += curveMpoint.getMpointId() + ":" + curveMpoint.getUnitId() + ","; - } - model.addAttribute("curveShowType", dataCurve.getCurvetype()); - model.addAttribute("curveType", dataCurve.getAxistype()); - model.addAttribute("mpids", mpids); - } - -// boolean istrue = true; -// if (oldmpids != null && oldmpids.length() > 0) { -// String[] oldmpidss = oldmpids.split(","); -// if (oldmpidss != null && oldmpidss.length > 0) { -// for (int i = 0; i < oldmpidss.length; i++) { -// String[] detailoldmpidss = oldmpidss[i].split(":"); -// if (detailoldmpidss[0].equals(programmeId)) { -// istrue = false; -// break; -// } -// } -// } -// } -// -// if (istrue) { -// if (oldmpids != null && oldmpids.length() > 0) { -// mpids = oldmpids + programmeId + ":" + unitId + ","; -// } else { -// mpids = programmeId + ":" + unitId + ","; -// } -// } else { -// mpids = oldmpids; -// } - } - -// String oldselectMpid = ""; -// if (oldmpids != null && oldmpids.length() > 0) { -// String[] oldmpidss = oldmpids.split(","); -// if (oldmpidss != null && oldmpidss.length > 0) { -// for (int i = 0; i < oldmpidss.length; i++) { -// String[] detailoldmpidss = oldmpidss[i].split(":"); -// String wherestr = "where 1=1 and data_curve_id='" + detailoldmpidss[0] + "' "; -// List list = this.curveMpointService.selectListWithNameByWhere(wherestr + " order by morder"); -// if (list != null && list.size() > 0) { -// for (int j = 0; j < list.size(); j++) { -// oldselectMpid += list.get(j).getMpointId() + ","; -//// mpids+=list.get(j).getMpointId()+":"+list.get(j).getUnitId()+","; -// } -// } -// } -// } -// } - -// if (oldselectMpid.contains(mpid)) { -// mpids = oldmpids; -// } else { - if (!dataCurveMpids.equals("")) { - String[] dataCurveMpidss = dataCurveMpids.split(","); - for (String dm : - dataCurveMpidss) { - if (oldmpids.contains(dm)) { - } else { - mpids = mpids + dm + ","; - } - } - if (oldmpids != null && oldmpids.length() > 0) { - mpids = oldmpids + mpids; - } else { - - } - } else { - if (oldmpids != null && oldmpids.length() > 0) { - if (oldmpids.contains(mpid + ":" + unitId)) { - mpids = oldmpids; - } else { - mpids = oldmpids + mpid + ":" + unitId + ","; - } - } else { - mpids = mpid + ":" + unitId + ","; - } - } - - -// } - - model.addAttribute("mpids", mpids); - - - return "data/curveView"; - } - - @RequestMapping("/showCurveViewForVue.do") - public String showCurveViewForVue(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - String programmeId = request.getParameter("programmeId"); - String mpids = ""; - if (programmeId != null && programmeId.length() > 0) {//根据方案获取测量点 - String wherestr = "where 1=1 and data_curve_id='" + programmeId + "' "; - List list = this.curveMpointService.selectListWithNameByWhere(wherestr + " order by morder"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - mpids += list.get(i).getMpointId() + ":" + list.get(i).getUnitId() + ","; - } - } - - } else { - mpids = request.getParameter("mpid") + ":" + unitId + ","; - } - JSONArray json = JSONArray.fromObject(mpids); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showCurveAdd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "unitId") String unitId) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - DataCurve dataCurve = dataCurveService.selectById(pid); - model.addAttribute("pname", dataCurve.getName()); - } - return "data/curveAdd"; - } - - @RequestMapping("/addMPoint.do") - public String addMPoint(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("")) { - DataCurve dataCurve = dataCurveService.selectById(pid); - model.addAttribute("pname", dataCurve.getName()); - } - return "data/dataCurve_MPointAdd"; - } - - @RequestMapping("/editMPoint.do") - public String editMPoint(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "unitId") String unitId) { - CurveMpoint curveMpoint = curveMpointService.selectWithNameById(unitId, id); - if (pid != null && !pid.equals("")) { - DataCurve dataCurve = dataCurveService.selectById(pid); - model.addAttribute("pname", dataCurve.getName()); - } - if (curveMpoint != null && curveMpoint.getmPoint() != null) { - model.addAttribute("mpoint", curveMpoint.getmPoint()); - } - model.addAttribute("curveMpoint", curveMpoint); - - return "data/dataCurve_MPointEdit"; - } - - @RequestMapping("/editMPoint2.do") - public String editMPoint2(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId) { - CurveMpoint curveMpoint = curveMpointService.selectWithNameById(unitId, id); - if (curveMpoint != null && curveMpoint.getmPoint() != null) { - model.addAttribute("mpoint", curveMpoint.getmPoint()); - } - model.addAttribute("curveMpoint", curveMpoint); - - return "data/dataCurve_MPointEdit2"; - } - - /** - * 获得方案树形结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCurvesJson.do") - public String getCurvesJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.dataCurveService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " and (type!='" + DataCurve.Type_user + "') " - + " order by morder"); - - String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获得方案树形结构 app - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCurvesJsonForApp.do") - public String getCurvesJsonForApp(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String wherestr = " where 1=1 and unit_id='" + unitId + "' and (type='" + DataCurve.Type_sys + "') "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - List list = this.dataCurveService.selectListByWhere(wherestr + " order by morder"); - JSONArray json = JSONArray.fromObject(list); -// String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获得方案树形结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCurvesJson2.do") - public String getCurvesJson2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.dataCurveService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " and (type!='" + DataCurve.Type_user + "') " - + " order by morder"); - - String json = dataCurveService.getTreeList2(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获得曲线方案树形结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCurveProgrammeJson.do") - public String getCurveProgrammeJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String search_name = request.getParameter("search_name"); - - List> list_sys_result = new ArrayList>(); - List syslist = this.dataCurveService.selectListByWhere("where 1=1 and name like '%"+search_name+"%' and unit_id='" + unitId + "' " - + " and (type!='" + DataCurve.Type_user + "') " - + " order by morder"); - Map sysPmap = new HashMap(); - sysPmap.put("id", "-1"); - sysPmap.put("index", 0); - sysPmap.put("text", "系统方案"); - sysPmap.put("type", "-2"); - sysPmap.put("icon", "fa fa-laptop"); - sysPmap.put("color", "#39cccc"); - sysPmap.put("sys_all_index", 0); - list_sys_result.add(sysPmap); - - List> list_sys_result2 = this.dataCurveService.getTreeListResult(list_sys_result, syslist,search_name,0); - - int user_all_index=Integer.valueOf(list_sys_result2.get(0).get("sys_all_index").toString()); - List> list_person_result = new ArrayList>(); - List userlist = this.dataCurveService.selectListByWhere("where 1=1 and name like '%"+search_name+"%' and unit_id='" + unitId + "' " - + " and (type='" + DataCurve.Type_user + "' and insuser='" + cu.getId() + "') " - + " order by morder"); - Map personPmap = new HashMap(); - personPmap.put("id", "-1"); - personPmap.put("index", user_all_index+1); - personPmap.put("text", "个人方案"); - personPmap.put("type", "-2"); - personPmap.put("icon", "fa fa-user"); - personPmap.put("color", "#39cccc"); - list_person_result.add(personPmap); - List> list_person_result2 = this.dataCurveService.getTreeListResult(list_person_result, userlist,search_name,user_all_index+1); - - List> list_result = new ArrayList>(); - list_result.addAll(list_sys_result2); - list_result.addAll(list_person_result2); -// String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", JSONArray.fromObject(list_result).toString()); - return "result"; - } - - @RequestMapping("/getCurveProgrammeMpList.do") - public ModelAndView getCurveProgrammeMpList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - User cu = (User) request.getSession().getAttribute("cu"); - - String sort = " morder "; - String order = " desc "; - - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and data_curve_id='"+request.getParameter("pid")+"' "; - - PageHelper.startPage(page, rows); - List list = this.curveMpointService.selectListByWhere(wherestr + orderstr); - - for (CurveMpoint curveMpoint: - list) { - MPoint mPoint = this.mPointService.selectById(curveMpoint.getMpointId()); - if(mPoint!=null){ - curveMpoint.setmPoint(mPoint); - } - } - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获得系统方案树形结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSysCurvesJson.do") - public String getSysCurvesJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.dataCurveService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " and (type!='" + DataCurve.Type_user + "') " - + " order by morder"); - - String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获得个人方案树形结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPersonCurvesJson.do") - public String getPersonCurvesJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.dataCurveService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " and ((type='" + DataCurve.Type_user + "' and insuser='" + cu.getId() + "')) " - + " order by morder"); - - List> list_result = new ArrayList>(); - - for (DataCurve k : list) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - map.put("icon", DataCurve.DATA_CURVE_GROUP_ICON); - //map.put("color", "#357ca5"); - } else if (k.getType().equals(DataCurve.Type_curve)) { - map.put("icon", DataCurve.DATA_CURVE_ICON); - map.put("color", "#39cccc"); - } else if (k.getType().equals(DataCurve.Type_curve_mpoint)) { - map.put("icon", DataCurve.DATA_CURVE_MPOINT_ICON); - map.put("color", "#39cccc"); - } - - if (k.getType().equals(DataCurve.Type_sys) || k.getType().equals(DataCurve.Type_user)) { - List curveMpoints = this.curveMpointService.selectListWithNameByWhere("where data_curve_id='" + k.getId() + "' order by morder "); - List> childlist2 = new ArrayList>(); - if (curveMpoints != null && curveMpoints.size() > 0) { - for (int i = 0; i < curveMpoints.size(); i++) { - Map m2 = new HashMap(); - m2.put("id", curveMpoints.get(i).getId().toString()); - m2.put("text", curveMpoints.get(i).getmPoint().getParmname().toString()); - m2.put("type", DataCurve.Type_mp); - m2.put("icon", ""); - m2.put("tags", ""); - m2.put("mpid", curveMpoints.get(i).getMpointId()); - childlist2.add(m2); - } - if (childlist2.size() > 0) { - map.put("nodes", childlist2); - } - } - } - list_result.add(map); - } - -// String json = dataCurveService.getTreeList(null, list); - JSONArray json = JSONArray.fromObject(list_result); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获得方案树形结构 展示 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCurvesJsonForView.do") - public String getCurvesJsonForView(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = this.dataCurveService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " and ((type='" + DataCurve.Type_user + "' and insuser='" + cu.getId() + "' and active='" + DataCurve.Active_true + "') or (type!='" + DataCurve.Type_user + "')) " - + " order by morder"); - - String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - - /** - * 保存方案树 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveCurve.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("curve") DataCurve dataCurve) { - User cu = (User) request.getSession().getAttribute("cu"); - dataCurve.setId(CommUtil.getUUID()); - dataCurve.setInsdt(CommUtil.nowDate()); - dataCurve.setInsuser(cu.getId()); - if (dataCurve.getPid() == null || dataCurve.getPid().isEmpty()) { - dataCurve.setPid("-1"); - } - int result = this.dataCurveService.save(dataCurve); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); -// model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/changeToSysCurve.do") - public String changeToSysCurve(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - DataCurve dataCurve = this.dataCurveService.selectById(id); - dataCurve.setType(DataCurve.Type_sys); - int result = this.dataCurveService.update(dataCurve); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return "result"; - } - - /** - * 修改方案树 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateCurve.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("curve") DataCurve dataCurve) { - int result = this.dataCurveService.update(dataCurve); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - return new ModelAndView("result"); - } - - /** - * 删除方案树 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteCurve.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @ModelAttribute("menu") DataCurve dataCurve) { - String msg = ""; - int result = 0; - List mlist = this.dataCurveService.selectListByWhere(" where pid = '" + dataCurve.getId() + "' "); - //判断是否有子菜单,有的话不能删除 - if (mlist != null && mlist.size() > 0) { - msg = "请先删除子菜单"; - } else { - result = this.dataCurveService.deleteById(dataCurve.getId()); - if (result > 0) { - //删除菜单下的按钮 - this.dataCurveService.deleteByPid(dataCurve.getId()); - - //删除菜单对应的测量点 - List funclist = this.curveMpointService.selectListByWhere(" where data_curve_id = '" + dataCurve.getId() + "' "); - String ids = ""; - for (int i = 0; i < funclist.size(); i++) { - ids += funclist.get(i).getId() + ","; - } - ids = ids.replace(",", "','"); - this.curveMpointService.deleteByWhere("where id in('" + ids + "')"); - } else { - msg = "删除失败"; - } - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - -// model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return new ModelAndView("result"); - } - - /** - * 删除方案树 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteCurve2.do") - public ModelAndView dodel2(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String msg = ""; - int result = 0; - List mlist = this.dataCurveService.selectListByWhere(" where pid = '" + id + "' "); - //判断是否有子菜单,有的话不能删除 - if (mlist != null && mlist.size() > 0) { - msg = "请先删除子菜单"; - } else { - result = this.dataCurveService.deleteById(id); - if (result > 0) { - //删除菜单下的按钮 - this.dataCurveService.deleteByPid(id); - - //删除菜单对应的测量点 - List funclist = this.curveMpointService.selectListByWhere(" where data_curve_id = '" + id + "' "); - String ids = ""; - for (int i = 0; i < funclist.size(); i++) { - ids += funclist.get(i).getId() + ","; - } - ids = ids.replace(",", "','"); - this.curveMpointService.deleteByWhere("where id in('" + ids + "')"); - } else { - msg = "删除失败"; - } - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - -// model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return new ModelAndView("result"); - } - - -// /** -// * 新增方案测量点 -// * @param request -// * @param model -// * @return -// */ -// @RequestMapping("/addMPoint.do") -// public ModelAndView addMPoint(HttpServletRequest request,Model model, -// @RequestParam(value="pid") String pid){ -// -// if(pid!=null && !pid.equals("")){ -// DataCurve dataCurve= dataCurveService.selectById(pid); -//// model.addAttribute("pname",dataCurve.getName()); -// model.addAttribute("result","{\"res\":"+ JSONObject.fromObject(dataCurve) + -// "}"); -// } -// return new ModelAndView("result"); -// } -// -// /** -// * 修改方案测量点 -// * @param request -// * @param model -// * @return -// */ -// @RequestMapping("/editMPoint.do") -// public ModelAndView editMPoint(HttpServletRequest request,Model model, -// @RequestParam(value="id") String id, -// @RequestParam(value="pid") String pid, -// @RequestParam(value="unitId") String unitId){ -// CurveMpoint curveMpoint= curveMpointService.selectWithNameById(unitId,id); -// if(pid!=null && !pid.equals("")){ -// DataCurve dataCurve= dataCurveService.selectById(pid); -// model.addAttribute("pname",dataCurve.getName()); -// model.addAttribute("result","{\"res\":"+ JSONObject.fromObject(dataCurve) + -// "}"); -// } -// if(curveMpoint!=null && curveMpoint.getmPoint()!=null){ -// model.addAttribute("mpoint",curveMpoint.getmPoint()); -// } -// model.addAttribute("curveMpoint",curveMpoint ); -// -// return new ModelAndView("result"); -// } - - /** - * 保存方案测量点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveMPoint.do") - public ModelAndView saveMPoint(HttpServletRequest request, Model model, - @ModelAttribute("curve") CurveMpoint curveMpoint) { - User cu = (User) request.getSession().getAttribute("cu"); - curveMpoint.setId(CommUtil.getUUID()); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setInsuser(cu.getId()); - int result = 0; - List curveMpoints = this.curveMpointService.selectListByWhere("where mpoint_id='" + curveMpoint.getMpointId() + "' and data_curve_id='" + curveMpoint.getDataCurveId() + "' "); - if (curveMpoints != null && curveMpoints.size() > 0) { - result = Result.REPEATED; - } else { - result = this.curveMpointService.save(curveMpoint); - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else if (result == Result.REPEATED) { - result1 = Result.failed("测量点重复添加"); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - //model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 保存方案测量点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveMPoints.do") - public ModelAndView saveMPoints(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String mpointid = request.getParameter("mpointids"); - int result = 0; - if (mpointid != null && mpointid.length() > 0) { - String[] mpointids = mpointid.split(","); - for (int i = 0; i < mpointids.length; i++) { - CurveMpoint curveMpoint = new CurveMpoint(); - - curveMpoint.setId(CommUtil.getUUID()); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setInsuser(cu.getId()); - curveMpoint.setUnitId(request.getParameter("companyId")); - curveMpoint.setMorder(0); - curveMpoint.setMpointId(mpointids[i]); - curveMpoint.setDataCurveId(request.getParameter("pid")); - result = this.curveMpointService.save(curveMpoint); - } - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else if (result == Result.REPEATED) { - result1 = Result.failed("测量点重复添加"); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - //model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 修改方案测量点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateMPoint.do") - public ModelAndView updateMPoint(HttpServletRequest request, Model model, - @ModelAttribute("curve") CurveMpoint curveMpoint) { - User cu = (User) request.getSession().getAttribute("cu"); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setInsuser(cu.getId()); - int result = 0; - result = this.curveMpointService.update(curveMpoint); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); -// model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+curveMpoint.getId()+"\"}"); - //model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 删除方案测量点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteMPoint.do") - public String deleteMPoint(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.curveMpointService.deleteById(id); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); -// model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+id+"\"}"); - return "result"; - } - - @RequestMapping("/deleteMPoints.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.curveMpointService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取方案测量点列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPointList.do") - public ModelAndView getMPointList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; -// DataCurve dataCurve= dataCurveService.selectById(id); -// if(dataCurve!=null){ - String wherestr = "where 1=1 and data_curve_id='" + id + "' "; - - PageHelper.startPage(page, rows); - List list = this.curveMpointService.selectListWithNameByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); -// } - return new ModelAndView("result"); - } - - /** - * 获取方案测量点列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPointJson.do") - public ModelAndView getMPointJson(HttpServletRequest request, Model model) { - HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - - List alllist = new ArrayList(); - String checkedIds[] = request.getParameter("checkedIds").split(",");//分割测量点 - if (checkedIds != null && checkedIds.length > 0) { - for (int i = 0; i < checkedIds.length; i++) { - String mpandbiz[] = checkedIds[i].split(":");//分割出厂 - String mpid = mpandbiz[0]; - String unitId = mpandbiz[1]; - - List programmeroglist = this.dataCurveService.selectListByWhere(" where id='" + mpid + "' "); - if (programmeroglist != null && programmeroglist.size() > 0) { - List programmerogDlist = this.curveMpointService.selectListWithNameByWhere(" where 1=1 and data_curve_id='" + mpid + "' " + " order by morder"); - if (programmerogDlist != null && programmerogDlist.size() > 0) { - for (int m = 0; m < programmerogDlist.size(); m++) { - if (programmerogDlist.get(m).getFunc() != null) {//为附表为曲线方案组使用 - String curveMpids = programmerogDlist.get(m).getMpointId(); - curveMpids = curveMpids.replace(",", ";"); - String[] curveMpidss = curveMpids.split(";"); - List list = this.mPointService.selectListByWhere(programmerogDlist.get(m).getUnitId(), " where (id='" + curveMpidss[0] + "' or MPointCode='" + curveMpidss[0] + "') "); - String unit = ""; - String numTail = ""; - if (list != null && list.size() > 0) { - unit = list.get(0).getUnit(); - numTail = list.get(0).getNumtail(); - } - - MPoint mPoint = new MPoint(); - mPoint.setMpointcode(curveMpids); - mPoint.setParmname(programmerogDlist.get(m).getDisname()); - mPoint.setUnit(unit); - Company company = this.unitService.getCompById(unit); - mPoint.setBizname(company.getSname()); - mPoint.setNumtail(numTail); - mPoint.setBizid(programmerogDlist.get(m).getUnitId()); - mPoint.setExp(programmerogDlist.get(m).getFunc()); - - alllist.add(mPoint); - } else { - List list = this.mPointService.selectListByWhere(programmerogDlist.get(m).getUnitId(), " where (id='" + programmerogDlist.get(m).getMpointId() + "' or MPointCode='" + programmerogDlist.get(m).getMpointId() + "') "); - if (list != null && list.size() > 0) { - list.get(0).setBizid(programmerogDlist.get(m).getUnitId()); - Company company = this.unitService.getCompById(programmerogDlist.get(m).getUnitId()); - list.get(0).setBizname(company.getSname()); - list.get(0).setExp("-"); - if (list.get(0).getForcemin() == null) { - list.get(0).setForcemin(new BigDecimal("-9999")); - } - if (list.get(0).getForcemax() == null) { - list.get(0).setForcemax(new BigDecimal("-9999")); - } - } - alllist.addAll(list); - } - - } - } - } else { - List list = this.mPointService.selectListByWhere(unitId, " where (id='" + mpid + "' or MPointCode='" + mpid + "') order by parmname "); - if (list != null && list.size() > 0) { - list.get(0).setBizid(unitId); - Company company = this.unitService.getCompById(unitId); - list.get(0).setBizname(company.getSname()); - list.get(0).setExp("-"); - if (list.get(0).getForcemin() == null) { - list.get(0).setForcemin(new BigDecimal("-9999")); - } - if (list.get(0).getForcemax() == null) { - list.get(0).setForcemax(new BigDecimal("-9999")); - } - } - alllist.addAll(list); - } - } - - } - JSONArray json = JSONArray.fromObject(alllist); - - model.addAttribute("result", json); -// System.out.println(json); - return new ModelAndView("result"); - } - - @RequestMapping("/addSYSCurve.do") - public String showlistForSelect(HttpServletRequest request, Model model) { - - return "/data/curveSysList"; - } - - /** - * 读取生产库曲线方案 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPointProgrammeList.do") - public ModelAndView getMPointProgrammeList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "unitId") String unitId) { - HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - - //读取已有的系统曲线 - List clist = this.dataCurveService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' and type='" + DataCurve.Type_sys + "' order by morder"); - String havenIds = "("; - if (clist != null && clist.size() > 0) { - for (int i = 0; i < clist.size(); i++) { - havenIds = havenIds + "'" + clist.get(i).getId() + "',"; - } - havenIds = havenIds.substring(0, havenIds.length() - 1) + ")"; - } else { - havenIds = "('')"; - } - - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 and (id not in " + havenIds + ") and active='" + DataCurve.Active_ProgrammeTrue + "' "; - - PageHelper.startPage(page, rows); - List list = this.mPointProgrammeService.selectListByWhere(unitId, wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导入生产库方案 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importMPointProgramme.do") - public ModelAndView importMPointProgramme(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "ids") String ids) { - User cu = (User) request.getSession().getAttribute("cu"); - - String[] idarr = ids.split(","); - - String cids = "("; - if (idarr != null && idarr.length > 0) { - for (int i = 0; i < idarr.length; i++) { - cids = cids + "'" + idarr[i] + "',"; - } - cids = cids.substring(0, cids.length() - 1) + ")"; - } else { - cids = "('')"; - } - - int res = 0; - - //插入主表 - List mplist = this.mPointProgrammeService.selectListByWhere(unitId, " where id in " + cids + " "); - if (mplist != null && mplist.size() > 0) { - for (int i = 0; i < mplist.size(); i++) { - DataCurve dataCurve = new DataCurve(); - dataCurve.setId(mplist.get(i).getId()); - dataCurve.setPid(pid); - dataCurve.setName(mplist.get(i).getName()); - dataCurve.setType(DataCurve.Type_sys); - dataCurve.setActive(DataCurve.Active_true); - dataCurve.setInsdt(CommUtil.nowDate()); - dataCurve.setUnitId(unitId); - - res = this.dataCurveService.save(dataCurve); - - //插入附表 - List mpdlist = this.mPointProgrammeDetailService.selectListByWhere(unitId, " where faid='" + mplist.get(i).getId() + "' "); - if (mpdlist != null && mpdlist.size() > 0) { - for (int j = 0; j < mpdlist.size(); j++) { - CurveMpoint curveMpoint = new CurveMpoint(); - curveMpoint.setId(mpdlist.get(j).getId()); - curveMpoint.setDataCurveId(mplist.get(i).getId()); - curveMpoint.setMpointId(mpdlist.get(j).getMps()); - curveMpoint.setDisname(mpdlist.get(j).getDisname()); - curveMpoint.setFunc(mpdlist.get(j).getFunc()); - curveMpoint.setMorder(Integer.valueOf(mpdlist.get(j).getAxesorder())); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setUnitId(unitId); - - res = this.curveMpointService.save(curveMpoint); - } - } - - } - } - - Result result1 = new Result(); - if (res == Result.SUCCESS) { - result1 = Result.success(res); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", res); - return new ModelAndView("result"); - } - - /** - * 拐点备注保存 - * - * @throws IOException - */ - @RequestMapping("/saveCurveRemark.do") - public ModelAndView saveCurveRemark(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String content = request.getParameter("content"); - String mpids = request.getParameter("mpids"); - - int result = 0; - if (mpids != null && mpids.length() > 0) { - String[] mpidss = mpids.split(","); - for (int i = 0; i < mpidss.length; i++) { - CurveRemark curveRemark = new CurveRemark(); - curveRemark.setId(CommUtil.getUUID()); - curveRemark.setInsdt(CommUtil.nowDate()); - curveRemark.setInsuser(cu.getId()); - curveRemark.setSdt(sdt); - curveRemark.setEdt(edt); -// curveRemark.setSdt(CommUtil.getDateTimeByMillisecond(sdt)); -// curveRemark.setEdt(CommUtil.getDateTimeByMillisecond(edt)); - curveRemark.setContent(content); - curveRemark.setMpointId(mpidss[i]); - - result = this.curveRemarkService.save(curveRemark); - } - } - - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); -// model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 拐点备注删除 - * - * @throws IOException - */ - @RequestMapping("/deleteCurveRemark.do") - public ModelAndView deleteCurveRemark(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpids = request.getParameter("mpids"); - - int result = 0; - if (mpids != null && mpids.length() > 0) { - String[] mpidss = mpids.split(","); - for (int i = 0; i < mpidss.length; i++) { - result = this.curveRemarkService.deleteByWhere(" where (charindex('" + mpidss[i] + "',mpoint_id)>0) and insuser='" + cu.getId() + "' " - + " and (sdt<='" + sdt + "' and edt>='" + edt + "') "); - } - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteCurveRemark2.do") - public ModelAndView deleteCurveRemark2(HttpServletRequest request, Model model) { - int result = this.curveRemarkService.deleteById(request.getParameter("id")); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导出excel表 - * - * @throws IOException - */ - @RequestMapping(value = "/downloadExcel.do") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) throws IOException { - - //准备插入excel的数据 - com.alibaba.fastjson.JSONArray jsonarr = new com.alibaba.fastjson.JSONArray(); - System.out.println("曲线数据导出==="); -// System.out.println(ids); -// System.out.println(sdt); -// System.out.println(edt); - try { - String[] idArr = ids.split(","); - if (idArr != null) { - for (int i = 0; i < idArr.length; i++) { - - String[] mpidAndUnit = idArr[i].split(":"); - if (mpidAndUnit != null) { - List programmeroglist = this.dataCurveService.selectListByWhere(" where id='" + mpidAndUnit[0] + "' "); - if (programmeroglist != null && programmeroglist.size() > 0) { - List programmerogDlist = this.curveMpointService.selectListWithNameByWhere(" where 1=1 and data_curve_id='" + mpidAndUnit[0] + "' " + " order by morder"); - if (programmerogDlist != null && programmerogDlist.size() > 0) { - for (int m = 0; m < programmerogDlist.size(); m++) { - JSONObject jsonObject_result = new JSONObject(); - List mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='" + programmerogDlist.get(m).getMpointId() + "' or MPointCode='" + programmerogDlist.get(m).getMpointId() + "')"); - List list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' order by measuredt"); -// JSONArray json = JSONArray.fromObject(list); - String jString = com.alibaba.fastjson.JSONArray.toJSONString(list); - - jsonObject_result.put("measurepointname", mplistList.get(0).getParmname()); - jsonObject_result.put("parmList", jString); - jsonarr.add(jsonObject_result); - } - } - } else { - JSONObject jsonObject_result = new JSONObject(); - List mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='" + mpidAndUnit[0] + "' or MPointCode='" + mpidAndUnit[0] + "')"); - List list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' order by measuredt"); - String jString = com.alibaba.fastjson.JSONArray.toJSONString(list); -// com.alibaba.fastjson.JSONArray json = com.alibaba.fastjson.JSONArray.toJSONString(list); - - jsonObject_result.put("measurepointname", mplistList.get(0).getParmname()); - jsonObject_result.put("parmList", jString); - jsonarr.add(jsonObject_result); - } - - } - - - } - } - -// System.out.println(jsonarr); - //导出文件到指定目录,兼容Linux - this.dataCurveService.downloadExcel(response, jsonarr); - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return null; - } - - @RequestMapping("/showlistForSelects.do") - public String showlistForSelects(HttpServletRequest request, Model model) { - return "/data/mPointListForCurveSelects"; - } - - @RequestMapping("/curveFullView.do") - public String curveFullView(HttpServletRequest request, Model model) { - System.out.println(request.getParameter("option")); - return "/data/curveFullView"; - } - - @RequestMapping("/getCurveDeleteName.do") - public ModelAndView getCurveDeleteName(HttpServletRequest request, Model model) { - String mpid = request.getParameter("mpid"); - String[] mpids = mpid.split(":"); - - List mplistList = mPointService.selectListByWhere(mpids[1], "where (id='" + mpids[0] + "' or MPointCode='" + mpids[0] + "')"); - if (mplistList != null && mplistList.size() > 0) { - String mpname = mplistList.get(0).getParmname(); - - JSONArray json = new JSONArray(); - json.add(mpname); - model.addAttribute("result", json); - } else { - List list = this.dataCurveService.selectListByWhere("where 1=1 and id='" + mpids[0] + "' "); - String fnname = list.get(0).getName(); - - JSONArray json = new JSONArray(); - json.add(fnname); - model.addAttribute("result", json); - } - - - return new ModelAndView("result"); - } - - /** - * 曲线绘制画面方案保存 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doCurveProgrammeSave.do") - public ModelAndView doCurveProgrammeSave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String mpointid = request.getParameter("mpids"); - String programmename = request.getParameter("programmename"); - String unitId = request.getParameter("unitId"); - int result = 0; - - if (mpointid != null && mpointid.length() > 0) { - - DataCurve dataCurve = new DataCurve(); - String mainid = CommUtil.getUUID(); - dataCurve.setId(mainid); - dataCurve.setInsdt(CommUtil.nowDate()); - dataCurve.setInsuser(cu.getId()); - dataCurve.setName(programmename); - dataCurve.setPid("-1"); - dataCurve.setActive(DataCurve.Active_true); - dataCurve.setType(DataCurve.Type_user); - dataCurve.setUnitId(unitId); - dataCurve.setCurvetype("0");//折线图 - dataCurve.setAxistype("1");//单Y轴 - - this.dataCurveService.save(dataCurve); - - String[] mpointids = mpointid.split(","); - for (int i = 0; i < mpointids.length; i++) { - - String[] pdata = mpointids[i].split(":"); - - List plist = this.curveMpointService.selectListWithNameByWhere(" where 1=1 and data_curve_id='" + pdata[0] + "' " + " order by morder"); - if (plist != null && plist.size() > 0) { - for (int p = 0; p < plist.size(); p++) { - CurveMpoint curveMpoint = new CurveMpoint(); - - curveMpoint.setId(CommUtil.getUUID()); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setInsuser(cu.getId()); - curveMpoint.setUnitId(pdata[1]); - curveMpoint.setMorder(0); - curveMpoint.setMpointId(plist.get(p).getMpointId()); - curveMpoint.setDataCurveId(mainid); - result = this.curveMpointService.save(curveMpoint); - } - } else { - CurveMpoint curveMpoint = new CurveMpoint(); - - curveMpoint.setId(CommUtil.getUUID()); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setInsuser(cu.getId()); - curveMpoint.setUnitId(pdata[1]); - curveMpoint.setMorder(0); - curveMpoint.setMpointId(pdata[0]); - curveMpoint.setDataCurveId(mainid); - result = this.curveMpointService.save(curveMpoint); - } - - } - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else if (result == Result.REPEATED) { - result1 = Result.failed("重复添加"); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - //model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showAppCurve.do") - public String showAppCurve(HttpServletRequest request, Model model) { - return "data/appCurveView"; - } - - @RequestMapping("/getDetailData.do") - public String getDetailData(HttpServletRequest request, Model model) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpcode = request.getParameter("mpcode"); - com.alibaba.fastjson.JSONArray mainjsondata = new com.alibaba.fastjson.JSONArray(); - if (mpcode != null && !mpcode.isEmpty()) { - String[] mpcodes = mpcode.split(","); - if (mpcodes != null && mpcodes.length > 0) { - for (int i = 0; i < mpcodes.length; i++) { - mpcode = mpcodes[i]; - if (mpcode != null && !mpcode.isEmpty()) { - MPoint mPoint = mPointService.selectById(mpcode); - String numtail = "2"; - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - if (mPoint != null) { - numtail = mPoint.getNumtail(); - List mphlist = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), "[tb_mp_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' order by MeasureDT "); - com.alibaba.fastjson.JSONArray jsondata = new com.alibaba.fastjson.JSONArray(); - if (mphlist != null && mphlist.size() > 0) { - for (int d = 0; d < mphlist.size(); d++) { - String[] dataValue = new String[2]; - dataValue[0] = mphlist.get(d).getMeasuredt().substring(0, 16); - - BigDecimal vale = mphlist.get(d).getParmvalue(); - double endValue = CommUtil.round(vale.doubleValue(), Double.valueOf(numtail).intValue()); - dataValue[1] = String.valueOf(endValue); - jsondata.add(dataValue); - } - } - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("unit", mPoint.getUnit()); - jsonObject.put("data", jsondata); - } - - mainjsondata.add(jsonObject); - } - } - } - } - model.addAttribute("result", mainjsondata); - return "result"; - } - - /** - * 散点图 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getScatterData.do") - public String getScatterData(HttpServletRequest request, Model model) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpcode = request.getParameter("mpcode"); - com.alibaba.fastjson.JSONArray mainjsondata = new com.alibaba.fastjson.JSONArray(); - if (mpcode != null && !mpcode.isEmpty()) { - String[] mpcodes = mpcode.split(","); - if (mpcodes != null && mpcodes.length > 0) { - for (int i = 0; i < mpcodes.length; i++) { - mpcode = mpcodes[i]; - if (mpcode != null && !mpcode.isEmpty()) { - String[] mpidAndUnit = mpcode.split(":"); - MPoint mPoint = mPointService.selectById(mpidAndUnit[0]); -// String numtail = mPoint.getNumtail(); - List mphlist = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), "[tb_mp_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' order by MeasureDT "); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONArray jsondata = new com.alibaba.fastjson.JSONArray(); - if (mphlist != null && mphlist.size() > 0) { - for (int d = 0; d < mphlist.size(); d++) { - String[] dataValue = new String[2]; - dataValue[0] = mphlist.get(d).getMeasuredt().substring(11, 16); - - BigDecimal vale = mphlist.get(d).getParmvalue(); -// double endValue = CommUtil.round(vale.doubleValue(), Double.valueOf(numtail).intValue()); - dataValue[1] = String.valueOf(vale); - jsondata.add(dataValue); - } - } - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("data", jsondata); - mainjsondata.add(jsonObject); - } - } - } - } - model.addAttribute("result", mainjsondata); - return "result"; - } - - @RequestMapping("/getDetailDataForEXAndDV.do") - public String getDetailDataForEXAndDV(HttpServletRequest request, Model model) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String timerange = request.getParameter("timerange"); - String xsubstring = request.getParameter("xsubstring"); - - if (!timerange.equals("hour")) { - sdt = sdt.substring(0, 10) + " 00:00"; - if (edt != null && edt.length() > 0) { - edt = edt.substring(0, 10) + " 23:59"; - } else { - edt = sdt.substring(0, 10) + " 23:59"; - } - } - - int sub0 = 0; - int sub1 = 0; - String[] xsubstrings = null; - if (xsubstring != null) { - if (!xsubstring.equals("all")) { - xsubstrings = xsubstring.split(","); - } - } - if (xsubstrings != null && xsubstrings.length > 0) { - if (xsubstrings.length == 1) { - sub1 = Integer.valueOf(xsubstrings[0]); - } else { - sub0 = Integer.valueOf(xsubstrings[0]); - sub1 = Integer.valueOf(xsubstrings[1]); - } - } else { - sub1 = -1; - } - - String mpcode = request.getParameter("mpcode"); - MPoint mPoint = mPointService.selectById(mpcode); - String numtail = "2"; - if (mPoint != null) { - numtail = mPoint.getNumtail(); - } - - - com.alibaba.fastjson.JSONArray mainjsondata = new com.alibaba.fastjson.JSONArray(); - - List mphlist = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), "[tb_mp_" + mpcode + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' order by MeasureDT "); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONArray jsondata = new com.alibaba.fastjson.JSONArray(); - if (mphlist != null && mphlist.size() > 0) { - for (int d = 0; d < mphlist.size(); d++) { - String[] dataValue = new String[2]; - if (sub1 == -1) { - dataValue[0] = mphlist.get(d).getMeasuredt(); - } else { - dataValue[0] = mphlist.get(d).getMeasuredt().substring(sub0, sub1); - } - - - BigDecimal vale = mphlist.get(d).getParmvalue(); - double endValue = CommUtil.round(vale.doubleValue(), Double.valueOf(numtail).intValue()); - dataValue[1] = String.valueOf(endValue); - jsondata.add(dataValue); - } - } - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("data", jsondata); - mainjsondata.add(jsonObject); - - model.addAttribute("result", mainjsondata); - - return "result"; - } - - @RequestMapping("/showMenu4Select.do") - public String showMenu4Select(HttpServletRequest request, Model model) { - return "data/curveMenu4select"; - } - - @RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { - List list = this.dataCurveService.selectListByWhere("where type='" + DataCurve.Type_group + "' and unit_id='" + request.getParameter("unitId") + "' and id!='" + request.getParameter("ownId") + "' order by morder"); - String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/docurveMpointsort.do") - public String docurveMpointsort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String[] ids = request.getParameter("ids").split(","); - int result = 0; - for (int i = 0; i < ids.length; i++) { - CurveMpoint curveMpoint = new CurveMpoint(); - curveMpoint.setId(ids[i]); - curveMpoint.setMorder(i); - result = this.curveMpointService.update(curveMpoint); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/remarkView.do") - public String remarkView(HttpServletRequest request, Model model) { - return "data/curveRemarkView"; - } - - @RequestMapping("/getHisRemarkTab.do") - public ModelAndView getHisRemarkTab(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - List list = this.curveRemarkService.selectListByWhere(" where sdt>='" + request.getParameter("sdt") + "' and edt<='" + request.getParameter("edt") + "' " + - " and mpoint_id='" + request.getParameter("mpid") + "' " + - "order by sdt asc"); - -// String result = "{\"rows\":" + CommUtil.toJson(list) + "}"; -// System.out.println(result); - model.addAttribute("result", CommUtil.toJson(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/curveRemarkFileUp.do") - public String curveRemarkFileUp(HttpServletRequest request, Model model) { - model.addAttribute("masterId", request.getParameter("masterId")); - model.addAttribute("tbName", request.getParameter("tbName")); - model.addAttribute("nameSpace", request.getParameter("nameSpace")); - return "data/curveRemarkFileUp"; - } - - @RequestMapping("/curveRemarkFileView.do") - public String curveRemarkFileView(HttpServletRequest request, Model model) { - model.addAttribute("masterId", request.getParameter("masterId")); - model.addAttribute("tbName", request.getParameter("tbName")); - model.addAttribute("nameSpace", request.getParameter("nameSpace")); - return "data/curveRemarkFileView"; - } - - @RequestMapping("/downloadCurveFile4minio.do") - public void downloadCurveFile4minio(HttpServletResponse response, HttpServletRequest request, - @RequestParam(value = "id") String id) throws IOException { - try { - String path = ""; - String name = ""; - CurveRemarkFile curveRemarkFile = this.curveRemarkFileService.selectById(id); - if (curveRemarkFile != null) { - path = curveRemarkFile.getAbspath(); - name = curveRemarkFile.getFilename(); - } - byte[] bytes = commonFileService.getInputStreamBytes("curve", path); - InputStream object = new ByteArrayInputStream(bytes); - byte buf[] = new byte[1024]; - int length = 0; - - String fileName = new String(name.getBytes(), "ISO-8859-1");//压缩包中文名称,不然乱码 - response.reset(); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - response.setContentType("application/octet-stream"); - response.setCharacterEncoding("UTF-8"); - OutputStream outputStream = response.getOutputStream(); - // 输出文件 - while ((length = object.read(buf)) > 0) { - outputStream.write(buf, 0, length); - } - // 关闭输出流 - outputStream.close(); - } catch (Exception ex) { - response.setHeader("Content-type", "text/html;charset=UTF-8"); - String data = "文件下载失败"; - OutputStream ps = response.getOutputStream(); - ps.write(data.getBytes("UTF-8")); - } - - } - -} diff --git a/src/com/sipai/controller/data/EnergyAnalysisController.java b/src/com/sipai/controller/data/EnergyAnalysisController.java deleted file mode 100644 index 4b2c7ff8..00000000 --- a/src/com/sipai/controller/data/EnergyAnalysisController.java +++ /dev/null @@ -1,391 +0,0 @@ -package com.sipai.controller.data; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSON; -import net.sf.json.JSONArray; - -import org.activiti.engine.impl.util.json.JSONObject; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Tree; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.entity.work.ScadaPic_MPoint_Expression; -import com.sipai.service.data.CurveMpointService; -import com.sipai.service.data.DataCurveService; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.RoleService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/data/energyAnalysis") -public class EnergyAnalysisController { - @Resource - private DataCurveService dataCurveService; - @Resource - private CurveMpointService curveMpointService; - @RequestMapping("/showCurveTree.do") - public String showCurveTree(HttpServletRequest request,Model model){ - return "data/curveManage"; - } - @RequestMapping("/showCurveTreeView.do") - public String showCurveTreeView(HttpServletRequest request,Model model){ - return "data/curveManageView"; - } - @RequestMapping("/getCurvesJson.do") - public String getCurvesJson(HttpServletRequest request,Model model){ - List list = this.dataCurveService.selectListByWhere("where 1=1 order by morder"); - - /*List tree = new ArrayList(); - for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - node.setIconCls(resource.getImage()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("action", resource.getAction()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - String json = dataCurveService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showCurveEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="companyId") String companyId){ - DataCurve dataCurve= dataCurveService.selectById(id); - if(dataCurveService.selectById(dataCurve.getPid())!=null){ - dataCurve.setPname(dataCurveService.selectById(dataCurve.getPid()).getName()); - } - model.addAttribute("curve",dataCurve ); - return "data/curveEdit"; - } - @RequestMapping("/showCurveView.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="companyId") String companyId){ - DataCurve dataCurve= dataCurveService.selectById(id); - if(dataCurveService.selectById(dataCurve.getPid())!=null){ - dataCurve.setPname(dataCurveService.selectById(dataCurve.getPid()).getName()); - } - model.addAttribute("curve",dataCurve ); - - return "data/curveView"; - } - /** - * 按年显示曲线图表 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showViewInYear.do") - public String showViewInYear(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - /*DataCurve dataCurve= dataCurveService.selectById(id); - if(dataCurveService.selectById(dataCurve.getPid())!=null){ - dataCurve.setPname(dataCurveService.selectById(dataCurve.getPid()).getName()); - } - model.addAttribute("curve",dataCurve );*/ - - return "data/curveManageViewInYear"; - } - /** - * 按天显示曲线图表 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showViewInDay.do") - public String showViewInDay(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - return "data/curveManageViewInDay"; - } - /** - * 按月显示曲线图表 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showViewInMonth.do") - public String showViewInMonth(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - /*DataCurve dataCurve= dataCurveService.selectById(id); - if(dataCurveService.selectById(dataCurve.getPid())!=null){ - dataCurve.setPname(dataCurveService.selectById(dataCurve.getPid()).getName()); - } - model.addAttribute("curve",dataCurve );*/ - - return "data/curveManageViewInMonth"; - } - /** - * 显示水耗分析图 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showWaterAnalysis.do") - public String showWaterAnalysis(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - key = key.replace(",", ","); - /*DataCurve dataCurve= dataCurveService.selectById(id); - if(dataCurveService.selectById(dataCurve.getPid())!=null){ - dataCurve.setPname(dataCurveService.selectById(dataCurve.getPid()).getName()); - } - model.addAttribute("curve",dataCurve );*/ - request.setAttribute("key", key); - return "data/curveManageView_WaterAnalysis"; - } - @RequestMapping("/showCurveAdd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - DataCurve dataCurve= dataCurveService.selectById(pid); - model.addAttribute("pname",dataCurve.getName()); - } - return "data/curveAdd"; - } - @RequestMapping("/saveCurve.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("curve") DataCurve dataCurve){ - User cu= (User)request.getSession().getAttribute("cu"); - dataCurve.setId(CommUtil.getUUID()); - dataCurve.setInsdt(CommUtil.nowDate()); - dataCurve.setInsuser(cu.getId()); - if (dataCurve.getPid()==null || dataCurve.getPid().isEmpty()) { - dataCurve.setPid("-1"); - } - int result = this.dataCurveService.save(dataCurve); - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/updateCurve.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("curve") DataCurve dataCurve){ - int result = this.dataCurveService.update(dataCurve); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - @RequestMapping("/deleteCurve.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @ModelAttribute("menu") DataCurve dataCurve){ - String msg = ""; - int result = 0; - List mlist = this.dataCurveService.selectListByWhere(" where pid = '"+dataCurve.getId()+"' "); - //判断是否有子菜单,有的话不能删除 - if(mlist!=null && mlist.size()>0){ - msg="请先删除子菜单"; - }else{ - result = this.dataCurveService.deleteById(dataCurve.getId()); - if(result>0){ - //删除菜单下的按钮 - this.dataCurveService.deleteByPid(dataCurve.getId()); - - //删除菜单对应的测量点 - List funclist = this.curveMpointService.selectListByWhere(" where data_curve_id = '"+dataCurve.getId()+"' "); - String ids=""; - for(int i=0;i curveMpoints=this.curveMpointService.selectListByWhere("where mpoint_id='"+curveMpoint.getMpointId()+"' and data_curve_id='"+curveMpoint.getDataCurveId()+"' "); - if(curveMpoints!=null && curveMpoints.size()>0){ - result="测量点重复添加"; - }else{ - int res= this.curveMpointService.save(curveMpoint); - result =String.valueOf(res); - } - - model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+curveMpoint.getId()+"\"}"); - //model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/updateMPoint.do") - public ModelAndView updateMPoint(HttpServletRequest request,Model model, - @ModelAttribute("curve") CurveMpoint curveMpoint){ - User cu= (User)request.getSession().getAttribute("cu"); - curveMpoint.setInsdt(CommUtil.nowDate()); - curveMpoint.setInsuser(cu.getId()); - String result =""; - int res= this.curveMpointService.update(curveMpoint); - result =String.valueOf(res); - - model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+curveMpoint.getId()+"\"}"); - //model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/deleteMPoint.do") - public String deleteMPoint(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.curveMpointService.deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+id+"\"}"); - return "result"; - } - @RequestMapping("/getMPointJson.do") - public ModelAndView getMPointJson(HttpServletRequest request,Model model) { - String id =request.getParameter("id"); - String companyId =request.getParameter("companyId"); - if (id==null || id.isEmpty()) { - String key =request.getParameter("key"); - List list=this.dataCurveService.selectListByWhere("where bizid='"+companyId+"' and remark ='"+key+"'");//"where companyid='"+companyId+"' and remark ='"+key+"'" - id=list.get(0).getId(); - } - - String orderstr=" order by morder"; - String wherestr="where 1=1 and data_curve_id='"+id+"' "; - - - List list = this.curveMpointService.selectListWithNameByWhere(companyId,wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getMPointJsons.do") - public ModelAndView getMPointJsons(HttpServletRequest request,Model model) { - String companyId =request.getParameter("companyId"); - String key =request.getParameter("key"); - List list=this.dataCurveService.selectListByWhere("where bizid='"+companyId+"'and remark in ('"+key.replace(",", "','")+"') order by CHARINDEX(','+ remark +',',',"+key+",') asc");//"where companyid='"+companyId+"' and remark ='"+key+"'" - JSONArray result = new JSONArray(); - for (DataCurve dataCurve : list) { - String orderstr=" order by morder"; - String wherestr="where 1=1 and data_curve_id='"+dataCurve.getId()+"' "; - List curveMpoints = this.curveMpointService.selectListWithNameByWhere(companyId,wherestr+orderstr); - JSONArray json=JSONArray.fromObject(curveMpoints); - result.add(json); - } - - - System.out.println(result); - model.addAttribute("result",result.toString()); - return new ModelAndView("result"); - } - - /** - * 加矾平衡分析 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showViewMedicine.do") - public String showViewMedicine(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - return "data/curveManageViewMedicine"; - } - - /** - * 加氯平衡分析 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showViewCl.do") - public String showViewCl(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - return "data/curveManageViewCl"; - } - - /** - * 其他平衡分析 - * @param request - * @param model - * @param id - * @param companyId - * @return - */ - @RequestMapping("/showViewOther.do") - public String showViewOther(HttpServletRequest request,Model model, - @RequestParam(value="key") String key){ - return "data/curveManageViewOther"; - } - -} diff --git a/src/com/sipai/controller/data/HQFrameDataController.java b/src/com/sipai/controller/data/HQFrameDataController.java deleted file mode 100644 index 7e350cda..00000000 --- a/src/com/sipai/controller/data/HQFrameDataController.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.controller.data; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.tools.CommUtil; -import org.springframework.ui.Model; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; - -@Controller -@RequestMapping("/data/hQFrameData") -public class HQFrameDataController { - -// @Resource -// private UnitService unitService; - - @RequestMapping("/pagingDownData.do") - public String fyDownData(HttpServletRequest request, Model model) { - try { - model.addAttribute("mqttStatus", new CommUtil().getProperties("mqtt.properties", "mqtt.status")); - model.addAttribute("mqttHostWeb", new CommUtil().getProperties("mqtt.properties", "mqtt.host_ws")); - } catch (IOException e) { - e.printStackTrace(); - } - return "/data/pagingDownData_HQ"; - } - - -} diff --git a/src/com/sipai/controller/data/HealthDiagnosisController.java b/src/com/sipai/controller/data/HealthDiagnosisController.java deleted file mode 100644 index e234d764..00000000 --- a/src/com/sipai/controller/data/HealthDiagnosisController.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.controller.data; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.tools.CommUtil; -import org.springframework.ui.Model; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; - -@Controller -@RequestMapping("/data/healthDiagnosis") -public class HealthDiagnosisController { - -// @Resource -// private UnitService unitService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - model.addAttribute("type", request.getParameter("type")); - return "/data/healthDiagnosisList"; - } - - @RequestMapping("/isNet.do") - public String isNet(HttpServletRequest request, Model model) { - String nowUrl = request.getParameter("nowUrl"); - JSONObject jsonObject = new JSONObject(); - try { - if (new CommUtil().getProperties("healthDiagnosis.properties", "projectUrl").equals(nowUrl)) { - jsonObject.put("url", new CommUtil().getProperties("healthDiagnosis.properties", "url")); - } else if (new CommUtil().getProperties("healthDiagnosis.properties", "projectUrl2").equals(nowUrl)) { - jsonObject.put("url", new CommUtil().getProperties("healthDiagnosis.properties", "url2")); - } else if (new CommUtil().getProperties("healthDiagnosis.properties", "outprojectUrl").equals(nowUrl)) { - jsonObject.put("url", new CommUtil().getProperties("healthDiagnosis.properties", "neturl")); - } else if (new CommUtil().getProperties("healthDiagnosis.properties", "outprojectUrl2").equals(nowUrl)) { - jsonObject.put("url", new CommUtil().getProperties("healthDiagnosis.properties", "neturl2")); - } - } catch (IOException e) { - e.printStackTrace(); - } - - model.addAttribute("result", jsonObject); - return "result"; - } - -} diff --git a/src/com/sipai/controller/data/XServerController.java b/src/com/sipai/controller/data/XServerController.java deleted file mode 100644 index 6dce2813..00000000 --- a/src/com/sipai/controller/data/XServerController.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.controller.data; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.XServer; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.data.XServerService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/xServer/xServer") -public class XServerController { - @Resource - private XServerService xServerService; - @Resource - private UnitService unitService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - return "/data/xServerList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("unitId"); - if(sort==null){ - sort = " name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1"; - if(companyId!=null && !companyId.isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizid in ("+companyids+") "; - } - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("serverType")!=null && !request.getParameter("serverType").isEmpty()){ - wherestr += " and typeid = '"+request.getParameter("serverType")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.xServerService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/data/xServerAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute XServer xServer){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - xServer.setId(CommUtil.getUUID()); - int code = this.xServerService.save(xServer); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - XServer xServer = this.xServerService.selectById(id); - model.addAttribute("xServer", xServer); - return "/data/xServerEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute XServer xServer){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.xServerService.update(xServer); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @ModelAttribute XServer xServer){ - Result result = new Result(); - int code = this.xServerService.deleteById(xServer.getId()); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.xServerService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/digitalProcess/DigitalTechnologistController.java b/src/com/sipai/controller/digitalProcess/DigitalTechnologistController.java deleted file mode 100644 index a01f19a0..00000000 --- a/src/com/sipai/controller/digitalProcess/DigitalTechnologistController.java +++ /dev/null @@ -1,1108 +0,0 @@ -package com.sipai.controller.digitalProcess; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.digitalProcess.DispatchSheetEntry; -import com.sipai.entity.scada.*; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.VisualCacheData; -import com.sipai.service.digitalProcess.DispatchSheetEntryService; -import com.sipai.service.scada.*; -import com.sipai.service.visual.GetValueService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.visual.VisualCacheDataService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MqttUtil; -import io.swagger.annotations.Api; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.List; -import java.util.Properties; - -/** - * 数字工艺员 - * - * @author SIPAIIS-NJP - */ -@Controller -@RequestMapping("/digitalProcess/digitalTechnologist") -@Api(value = "/digitalProcess/digitalTechnologist", tags = "数字工艺员") -public class DigitalTechnologistController { - @Resource - private JspElementService jspElementService; - @Resource - private GetValueService getValueService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private VisualCacheDataService visualCacheDataService; - @Resource - private MPointService mPointService; - @Resource - private MPointFormulaService mPointFormulaService; - @Resource - private DispatchSheetEntryService dispatchSheetEntryService; - @Resource - private RedissonClient redissonClient; - @Resource - private ProAlarmService proAlarmService; - @Resource - private ProAlarmBaseTextService proAlarmBaseTextService; - - /** - * 工艺参数 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/processParametersList.do") - public String processParametersList(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/processParametersList"; - } - - /** - * PAC加药 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/PACDosingList.do") - public String PACDosingList(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/PACDosingList"; - } - - /** - * 内回流系统 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/internalRefluxSYSList.do") - public String internalRefluxSYSList(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/internalRefluxSYSList"; - } - - /** - * 水量预测 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/waterVolumePrediction.do") - public String waterVolumePrediction(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/waterVolumePrediction"; - } - - /** - * 调度单信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dispatchSheetEntryShowList.do") - public String dispatchSheetEntryList(HttpServletRequest request, Model model) { - //当前时间 - String nowDate = CommUtil.nowDate(); - model.addAttribute("nowDate", nowDate); - String unitId = request.getParameter("unitId"); - model.addAttribute("unitId", unitId); - return "/digitalProcess/dispatchSheetEntryList"; - } - - @RequestMapping("/getDispatchSheetEntryList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (request.getParameter("dispatchclass") != null && !request.getParameter("dispatchclass").isEmpty()) { - wherestr += " and dispatchclass = '" + request.getParameter("dispatchclass") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and remark like '%" + request.getParameter("search_name") + "%'"; - } - String edt = request.getParameter("edt"); - String sdt = request.getParameter("sdt"); - if (null != sdt && !"".equals(sdt)) { - wherestr += " and recorddt >= '" + sdt + "' "; - } - if (null != edt && !"".equals(edt)) { - wherestr += " and recorddt <= '" + edt + "' "; - } - PageHelper.startPage(page, rows); - List list = this.dispatchSheetEntryService.selectListByWhere(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - net.sf.json.JSONArray jsonArray = net.sf.json.JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getOutputData.do") - public ModelAndView getOutputData(HttpServletRequest request, Model model) { - String jsp_id = request.getParameter("jsp_id"); - String bizId = request.getParameter("bizId"); - String time = request.getParameter("time"); - String jspElementwhere = "where pid like '%" + jsp_id + "%' "; - String value = "0"; - List list = this.jspElementService.selectListByWhere(jspElementwhere + " order by morder"); - if (list != null && list.size() > 0) { - JspElement jspElement = list.get(0); - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - String cacheDataWhere = " where id like '%" + jsp_id + "%' and dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "'"; - List vclist = this.visualCacheDataService.selectListByWhere(cacheDataWhere + " order by morder desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String mpointid_redis = null; - String dataTypeC = "-"; - if (vclist != null && vclist.size() > 0) { - vCacheData = vclist.get(0); - String[] mpointids = vCacheData.getMpcode().split(","); - mpointid = mpointids[0]; - mpointid_redis = mpointids[1]; - if (vclist.get(0).getDatatype() != null) { - dataTypeC = vclist.get(0).getDatatype(); - } - } - - if (vCacheData != null) { - if (mpointid != null && !mpointid.equals("")) { - MPoint mPoint = this.mPointService.selectById(bizId, mpointid); - String edt = time.substring(0, 10) + " 23:59:59"; - String sdt = time.substring(0, 10) + " 00:00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "' order by measuredt desc"; - List mPointHistory = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, "1", "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - value = parmValue.toString(); - } else { - RMap map_redis = redissonClient.getMap(dataTypeC); - value = map_redis.get(mpointid_redis); - } - } - } - } - String result = "{\"res\":" + value + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/dispatchSheetEntryAdd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/digitalProcess/dispatchSheetEntryAdd"; - } - - @RequestMapping("/dispatchSheetEntrySave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DispatchSheetEntry dispatchSheetEntry) { - User cu = (User) request.getSession().getAttribute("cu"); - dispatchSheetEntry.setId(CommUtil.getUUID()); - dispatchSheetEntry.setInsdt(CommUtil.nowDate()); - dispatchSheetEntry.setInsuser(cu.getId()); - int result = this.dispatchSheetEntryService.save(dispatchSheetEntry); - String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + dispatchSheetEntry.getId() + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - - @RequestMapping("/dispatchSheetEntryDelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.dispatchSheetEntryService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dispatchSheetEntryDeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.dispatchSheetEntryService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dispatchSheetEntryEdit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DispatchSheetEntry dispatchSheetEntry = this.dispatchSheetEntryService.selectById(id); - model.addAttribute("dispatchSheetEntry", dispatchSheetEntry); - return "/digitalProcess/dispatchSheetEntryEdit"; - } - - @RequestMapping("/dispatchSheetEntryUpdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute DispatchSheetEntry dispatchSheetEntry) { - User cu = (User) request.getSession().getAttribute("cu"); - dispatchSheetEntry.setInsdt(CommUtil.nowDate()); - dispatchSheetEntry.setInsuser(cu.getId()); - int result = this.dispatchSheetEntryService.update(dispatchSheetEntry); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + dispatchSheetEntry.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getExitremark.do") - public String getExitremark(HttpServletRequest request, Model model) throws IOException { - //读取配置文件 - Properties properties = new CommUtil().getProperties("dispatch.properties"); - String system = properties.getProperty("system"); - String children = properties.getProperty("children"); - String[] systems = system.split(","); - String[] childrens = children.split(","); - JSONArray exitremark = new JSONArray(); - for (String item : systems) { - JSONObject obj = new JSONObject(); - obj.put("id", item); - obj.put("text", item); - JSONArray exitremark_children = new JSONArray(); - for (String item_children : childrens) { - JSONObject obj_children = new JSONObject(); - obj_children.put("id", item + item_children); - obj_children.put("text", item + item_children); - exitremark_children.add(obj_children); - } - obj.put("children", exitremark_children); - exitremark.add(obj); - } - model.addAttribute("result", exitremark.toJSONString()); - return "result"; - } - - /** - * 调度单信息录入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dispatchSheetEntry.do") - public String dispatchSheetEntry(HttpServletRequest request, Model model) { - //当前时间 - String nowDate = CommUtil.nowDate(); - model.addAttribute("nowDate", nowDate); - String unitId = request.getParameter("unitId"); - model.addAttribute("unitId", unitId); - - return "/digitalProcess/dispatchSheetEntry"; - } - - /** - * 调度单信息录入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dispatchSheetEntryInputSave.do") - public String dispatchSheetEntrySave(HttpServletRequest request, Model model) { - String insdt = request.getParameter("insdt"); - //调度内容 - String adjustment = request.getParameter("adjustment"); - //处理量 - String handle = request.getParameter("handle"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - String reason = request.getParameter("reason"); - String unitId = request.getParameter("unitId"); - String parmValue = null; - if ("reduce".equals(adjustment)) { - adjustment = "减少"; - parmValue = "-" + handle; - } - if ("increase".equals(adjustment)) { - adjustment = "增加"; - parmValue = handle; - } - String dispatchListContent = "泰和厂因" + reason + ",预计" + startDate + "开始," + endDate + "结束," + adjustment + "处理量" + handle + "万m³。请中控人员知悉。"; - if (startDate.length() < 10) { - startDate = startDate + " 08:00:00"; - } - // 调度单信息 - List jspList = this.jspElementService.selectListByWhere("where pid ='waterVolumePrediction' and element_code='dispatchSheetEntry' order by morder"); - int res = 0; - if (jspList != null && jspList.size() > 0) { - List cdList = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspList.get(0).getValueUrl() + "' and unitId='" + unitId + "' order by morder desc "); - if (cdList != null && cdList.size() > 0) { - String mpid = cdList.get(0).getMpcode(); - if (mpid != null && !"".equals(mpid)) { - //先清空 - res = this.mPointHistoryService.deleteByTableAWhere(unitId, "[TB_MP_" + mpid + "]", ""); - int daysnum = CommUtil.getDays(endDate, startDate); - //按照时间插入新数据 - MPointHistory mPointHistory = null; - String measuredt = ""; - for (int i = 0; i < daysnum; i++) { - mPointHistory = new MPointHistory(); - measuredt = CommUtil.subplus(startDate, "" + (i * 24) + "", "hour"); - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - mPointHistory.setMeasuredt(measuredt); - BigDecimal value = new BigDecimal(parmValue); - mPointHistory.setParmvalue(value); - mPointHistory.setMemo(reason); - res = this.mPointHistoryService.save(unitId, mPointHistory); - mPointHistory = null; - } - } - } - } - String result = "{\"res\":" + res + ",\"dispatchListNum\":1,\"dispatchListTime\":\"" + insdt + "\",\"dispatchListContent\":\"" + dispatchListContent + "\"}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 今日调度单信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dispatchSheetEntryToday.do") - public String dispatchSheetEntryToday(HttpServletRequest request, Model model) { - String nowdt = CommUtil.nowDate(); - String insdt = request.getParameter("insdt"); - //调度内容 - String adjustment = request.getParameter("adjustment"); - //处理量 - String handle = request.getParameter("handle"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - String reason = request.getParameter("reason"); - String unitId = request.getParameter("unitId"); - // 调度单信息 - List jspList = this.jspElementService.selectListByWhere("where pid ='waterVolumePrediction' and element_code='dispatchSheetEntry' order by morder"); - int res = 0; - if (jspList != null && jspList.size() > 0) { - List cdList = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspList.get(0).getValueUrl() + "' and unitId='" + unitId + "' order by morder desc "); - if (cdList != null && cdList.size() > 0) { - String mpid = cdList.get(0).getMpcode(); - if (mpid != null && !"".equals(mpid)) { - //先查询当天时间是否有 - List mph = this.mPointHistoryService.selectListByTableAWhere(unitId, "[TB_MP_" + mpid + "]", - "where MeasureDT>='" + startDate + "' and MeasureDT<='" + endDate + "' order by [MeasureDT] desc"); - - String measuredt = ""; - if (mph != null && mph.size() > 0) { - res = mph.size(); - for (int i = 0; i < mph.size(); i++) { - MPointHistory mPointHistory = mph.get(i); - if (i == 0) { - endDate = mPointHistory.getMeasuredt().substring(0, 10); - } - if (i == (mph.size() - 1)) { - startDate = mPointHistory.getMeasuredt().substring(0, 10); - } - reason = mPointHistory.getMemo(); - BigDecimal Parmvalue = mPointHistory.getParmvalue(); - int z = Parmvalue.compareTo(BigDecimal.ZERO); - if (z == -1) { - adjustment = "减少"; - //System.out.println("bi是负数"); - } else { - adjustment = "增加"; - } - //绝对值 - handle = Parmvalue.abs().toString(); - } - } - } - } - } - if (startDate != null && endDate != null && endDate.equals(startDate)) { - endDate = CommUtil.subplus(startDate, "24", "hour"); - } - String dispatchListContent = "泰和厂因" + reason + ",预计" + startDate + "开始," + endDate + "结束," + adjustment + "处理量" + handle + "万m³。请中控人员知悉。"; - String result = "{\"res\":" + res + ",\"dispatchListNum\":1,\"dispatchListTime\":\"" + nowdt.substring(0, 10) + "\",\"dispatchListContent\":\"" + dispatchListContent + "\"}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 进水提升泵 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/intakeLiftPump.do") - public String intakeLiftPump(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/intakeLiftPump"; - } - - /** - * 运行优化调度 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/optimalDispatch.do") - public String optimalDispatch(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/optimalDispatch"; - } - - /** - * 能效总览 - */ - @RequestMapping("/energyEfficiencyOverview.do") - public ModelAndView energyEfficiencyOverview(HttpServletRequest request, Model model) { - return new ModelAndView("digitalProcess/energyEfficiencyOverview"); - } - - /** - * 泰和-生反池曝气系统 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/aerationSystemOfReactionTank.do") - public String aerationSystemOfReactionTank(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/aerationSystemOfReactionTank"; - } - - /** - * 泰和-碳源投加 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/carbonSourceDosing.do") - public String carbonSourceDosing(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/carbonSourceDosing"; - } - - /** - * 泰和-KPI - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/energyEfficiencyTH.do") - public String energyEfficiencyTH(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", "JS2_XGS_GS2_LVLD"); - jsonObject.put("parmvalue", "23"); - jsonArray.add(jsonObject); - MqttUtil.publish(jsonArray, "dataVisualData_all"); - - return "/digitalProcess/energyEfficiencyTH"; - } - - @RequestMapping("/energyEfficiencyTHForModelCurve.do") - public String energyEfficiencyTHForModelCurve(HttpServletRequest request, Model model) { - - return "/digitalProcess/energyEfficiencyTHForModelCurve"; - } - - /** - * 泰和-剩余污泥 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/excessSludgeTH.do") - public String excessSludge(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - - return "/digitalProcess/excessSludgeTH"; - } - - /** - * 泰和-优化决策 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/betterPolicy.do") - public String betterPolicy(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - - return "/digitalProcess/betterPolicy"; - } - - /** - * 泰和-外回流 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/externalReflux.do") - public String externalReflux(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - - return "/digitalProcess/externalReflux"; - } - - /** - * 泰和-反硝化滤池 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/denitrificationFilter.do") - public String denitrificationFilter(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - - return "/digitalProcess/denitrificationFilter"; - } - - /** - * 宝钢-水质监测 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/waterIntakeManagement.do") - public String waterIntakeManagement(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/waterIntakeManagement"; - } - - /** - * 宝钢-取水管理 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/waterQualityMonitoring.do") - public String waterQualityMonitoring(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/waterQualityMonitoring"; - } - - /** - * 宝钢首页 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/homePageBG.do") - public String homePageBG(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return "/digitalProcess/homePageBG"; - } - - /** - * 宝钢首页_详细曲线 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/homePageBGDetailLine.do") - public String homePageBGDetailLine(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/homePageBGDetailLine"; - } - - @RequestMapping("/getJspData.do") - public String getJspData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String time = request.getParameter("time"); - String dataType = request.getParameter("modelType"); - JSONArray jsonArray = this.jspElementService.getTValue2(unitId, time, jspId, dataType); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/getTHJspDataByCode.do") - public String getTHJspDataByCode(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String time = request.getParameter("time"); - String dataType = request.getParameter("modelType"); - String elementCode = request.getParameter("elementCode"); - JSONArray jsonArray = this.jspElementService.getTValue2ByCode(unitId, time, jspId, dataType, elementCode); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - //获取石洞口数据 - @RequestMapping("/getSDKJspData.do") - public String getSDKJspData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String time = request.getParameter("time"); - String dataType = request.getParameter("modelType"); - JSONArray jsonArray = this.jspElementService.getSDKValue(unitId, time, jspId, dataType); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - //获取合肥长岗数据 - @RequestMapping("/getHFCGJspData.do") - public String getHFCGJspData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String time = request.getParameter("time"); - String dataType = request.getParameter("modelType"); - JSONArray jsonArray = this.jspElementService.getHFCGValue(unitId, time, jspId, dataType); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - //获取石洞口数据 - @RequestMapping("/getJspSDKDataByJspCode.do") - public String getJspSDKDataByJspCode(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String time = request.getParameter("time"); - String dataType = request.getParameter("modelType"); - String elementCode = request.getParameter("elementCode"); - JSONArray jsonArray = this.jspElementService.getSDKValueByJspCode(unitId, time, jspId, dataType, elementCode); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - //获取通用数据 - @RequestMapping("/getDataByJspCode_TY.do") - public String getDataByJspCode_TY(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String dataType = request.getParameter("dataType"); - JSONArray jsonArray = this.jspElementService.getDataByJspCode_TY(unitId, sdt, edt, jspId, dataType); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - //根据测量点主表公式配置获取优化决策结构 - @RequestMapping("/getMpFormulaData.do") - public String getMpFormulaData(HttpServletRequest request, Model model) { - String mpcode = request.getParameter("mpcode"); - String unitId = request.getParameter("unitId"); - - JSONArray jsonArray1 = new JSONArray(); - - MPoint mPoint = this.mPointService.selectById(unitId, mpcode); - if (mPoint != null) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("text", mPoint.getParmname()); - jsonObject1.put("value", mPoint.getParmvalue()); - List mfList = this.mPointFormulaService.selectListByWhere(unitId, " where pmpid='" + mpcode + "' order by starthour "); - if (mfList != null && mfList.size() > 0) { - JSONArray jsonArray2 = new JSONArray(); - for (MPointFormula mPointFormula : - mfList) { - MPoint mPoint2 = this.mPointService.selectById(unitId, mPointFormula.getMpid()); - JSONObject jsonObject2 = new JSONObject(); -// jsonObject2.put("text", mPointFormula.getFormulaname()); - jsonObject2.put("text", mPoint2.getDisname()); - jsonObject2.put("value", mPoint2.getParmvalue()); - jsonObject2.put("rate", mPoint2.getRate()); - jsonObject2.put("spanrange", mPoint2.getSpanrange()); - jsonArray2.add(jsonObject2); - - List mfList2 = this.mPointFormulaService.selectListByWhere(unitId, " where pmpid='" + mPointFormula.getMpid() + "' order by starthour "); - if (mfList2 != null && mfList2.size() > 0) { - JSONArray jsonArray3 = new JSONArray(); - for (MPointFormula mPointFormula2 : - mfList2) { - MPoint mPoint3 = this.mPointService.selectById(unitId, mPointFormula2.getMpid()); - JSONObject jsonObject3 = new JSONObject(); -// jsonObject3.put("text", mPointFormula2.getFormulaname()); - jsonObject3.put("text", mPoint3.getDisname()); - jsonObject3.put("value", mPoint3.getParmvalue()); - jsonObject3.put("mpcode", mPoint3.getId()); - jsonObject3.put("spanrange", mPoint3.getSpanrange()); - MPoint mPoint4 = this.mPointService.selectById(unitId, mPointFormula2.getMpid() + "_score"); - if (mPoint4 != null) { - jsonObject3.put("score", mPoint4.getParmvalue()); - } else { - jsonObject3.put("score", "0"); - } - jsonArray3.add(jsonObject3); - } - jsonObject2.put("child", jsonArray3); - } - } - jsonObject1.put("child", jsonArray2); - } - - jsonArray1.add(jsonObject1); - } - - model.addAttribute("result", jsonArray1); - return "result"; - } - - //获取宝钢数据 - @RequestMapping("/getBGJspData.do") - public String getBGJspData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String dataType = request.getParameter("modelType"); - JSONArray jsonArray = this.jspElementService.getTValueBG(unitId, sdt, edt, jspId, dataType); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/getJspDataByJspCode.do") - public String getJspDataByCode(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "jspId") String jspId) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String dataType = request.getParameter("modelType"); - String elementCode = request.getParameter("elementCode"); - JSONArray jsonArray = this.jspElementService.getValueByJspCode(unitId, sdt, edt, jspId, dataType, elementCode); - -// System.out.println(jsonArray); - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/getBGJspDataDetailLine.do") - public String getBGJspDataDetailLine(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpcodes") String mpcodes) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - - String[] mpcodess = mpcodes.split(","); - - JSONArray jsonArray = new JSONArray(0); - for (String mpcode : - mpcodess) { - List mPointHistory = null; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + mpcode, wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { -// String[] dataValue = new String[2]; - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue.add(measuredt); - dataValue.add(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jsonArray.add(jsondata); - } - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 石洞口工艺运行评价 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/processOperationEvaluation_SDK.do") - public String processOperationEvaluation_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/processOperationEvaluation_SDK"; - } - - /** - * 石洞口能耗分析 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/energyAnalysis_SDK.do") - public String energyAnalysis_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/energyAnalysis_SDK"; - } - - /** - * 石洞口一次风机系统效率 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/primaryFan_SysE_SDK.do") - public String primaryFan_SysE_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/primaryFan_SysE_SDK"; - } - - /** - * 石洞口一次风机系统效率曲线 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/primaryFan_SysE_Curve_SDK.do") - public String primaryFan_SysE_Curve_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/primaryFan_SysE_Curve_SDK"; - } - - /** - * 石洞口 数据巡视 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/dataPatrol_SDK.do") - public String dataPatrol_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/dataPatrol_SDK"; - } - - /** - * 石洞口锅炉给水泵系统效率 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/boiler_feedwater_pump_SDK.do") - public String boiler_feedwater_pump_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/boiler_feedwater_pump_SDK"; - } - - /** - * 石洞口锅炉给水泵系统效率曲线 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/boiler_feedwater_pump_Curve_SDK.do") - public String boiler_feedwater_pump_Curve_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/boiler_feedwater_pump_Curve_SDK"; - } - - /** - * 石洞口 污泥螺杆泵 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/sludge_screw_pump_SDK.do") - public String sludge_screw_pump_SDK(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/sludge_screw_pump_SDK"; - } - - @RequestMapping("/GYYXBG_TH.do") - public String GYYXBG_TH(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/GYYXBG_TH"; - } - - @RequestMapping("/getGYYXBG_TH_Data.do") - public String getGYYXBG_TH_Data(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - String sdt = request.getParameter("sdt"); - String mainScoreMpid = request.getParameter("mainScoreMpid"); - - String jsonObject1 = this.visualCacheDataService.getGYYXBG_TH_Data(unitId, sdt, mainScoreMpid); - - model.addAttribute("result", jsonObject1); - return "result"; - } - - @RequestMapping(value = "/doGYYXBG_Out.do") - public ModelAndView doGYYXBG_Out(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "mainScoreMpid") String mainScoreMpid) throws IOException { - - try { - String jsonObject1 = this.visualCacheDataService.getGYYXBG_TH_Data(unitId, sdt, mainScoreMpid); - - this.visualCacheDataService.doGYYXBG_Out(response, JSONObject.parseObject(jsonObject1), sdt); - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return null; - } - - /** - * 提升系统预测_长岗 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/improveSystemPrediction_CG.do") - public String improveSystemPrediction_CG(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/improveSystemPrediction_CG"; - } - - /** - * 投加预测_长岗 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/investmentPrediction_CG.do") - public String investmentPrediction_CG(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/investmentPrediction_CG"; - } - - /** - * 碳源投加预测_长岗 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/carbonSourceAdditionPrediction_CG.do") - public String carbonSourceAdditionPrediction_CG(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/carbonSourceAdditionPrediction_CG"; - } - - /** - * 智能脱水控制_长岗 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/intelligentDehydrationControl_CG.do") - public String intelligentDehydrationControl_CG(HttpServletRequest request, Model model) throws IOException { - - return "/digitalProcess/intelligentDehydrationControl_CG"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/document/DataController.java b/src/com/sipai/controller/document/DataController.java deleted file mode 100644 index 93de78e8..00000000 --- a/src/com/sipai/controller/document/DataController.java +++ /dev/null @@ -1,1004 +0,0 @@ -package com.sipai.controller.document; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.document.Data; -import com.sipai.entity.document.Document; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCommStr; -import com.sipai.entity.equipment.EquipmentFile; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.document.DataService; -import com.sipai.service.document.DocumentService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentFileService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/document") -public class DataController { - private String BaseFolderName="UploadFile"; - @Resource - private DataService dataService; - @Resource - private CommonFileService commonFileService; - @Resource - private EquipmentFileService equipmentFileService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UnitService unitService; - @Resource - private DocumentService documentService; - - //技术档案资料 - @RequestMapping("/showDataTree.do") - public String showUnitTree(HttpServletRequest request, Model model) { - return "document/dataTree"; - } - //设备管理制度资料 - @RequestMapping("/showManageDataTree.do") - public String showManageDataTree(HttpServletRequest request, Model model) { - return "document/manageDataTree"; - } - //应急预案资料 - @RequestMapping("/showContingencyPlanTree.do") - public String showContingencyPlanTree(HttpServletRequest request, Model model) { - return "document/contingencyPlanTree"; - } - - @RequestMapping("/getDataJson.do") - public String getDataJson(HttpServletRequest request, Model model) { - String doctype = request.getParameter("doctype"); - String wherestr = "where doctype = '"+doctype+"'"; - if(request.getParameter("docname")!=null && !request.getParameter("docname").isEmpty()){ - wherestr += " and docname like '%"+request.getParameter("docname")+"%'"; - } - if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - wherestr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - String orderStr = " order by docname "; - List list = this.dataService.selectListByWhere(wherestr+orderStr); - List datas = new ArrayList<>(list); - if(request.getParameter("docname")!=null && !request.getParameter("docname").isEmpty()){ - //查询搜索时加载上级节点 - for (Data item:list) { - List dataList = this.dataService.getDatas(item.getPid()); - datas.addAll(dataList); - } - //去除datas中id重复的元素 - Set set = new TreeSet<>(new Comparator() { - public int compare(Data o1, Data o2) { - //字符串,则按照asicc码升序排列 - return o1.getId().compareTo(o2.getId()); - } - }); - set.addAll(datas); - datas = new ArrayList<>(set); - } - String id = request.getParameter("id"); - List> list_result = null; - if(id!=null && !id.isEmpty()){ - list_result = new ArrayList>(); - Data k = this.dataService.selectById(id); - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getDocname()); - map.put("pid", k.getPid()); - list_result.add(map); - } - String json = dataService.getTreeList(list_result, datas); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doaddData.do") - public String doaddData(HttpServletRequest request, Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - Data data= dataService.selectById(pid); - model.addAttribute("pname",data.getDocname()); - } - return "document/dataAdd"; - } - /* - * 编辑节点 - */ - @RequestMapping("/doeditData.do") - public String doeditData(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Data data = this.dataService.selectById(id); - model.addAttribute("data",data ); - return "document/dataEdit"; - } - - /* - * 编辑节点中的资料 - */ - @RequestMapping("/editDataFile.do") - public String doeditDataFile(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - Data data = new Data(); - String nodeIds = ""; - if (null != id && !id.isEmpty()) { - data = this.dataService.selectById(id); - nodeIds = this.dataService.getNodeIds(id); - nodeIds += id; - } - model.addAttribute("nodeIds",nodeIds ); - model.addAttribute("data",data ); - return "document/dataFileEdit"; - } - /** - * 全局搜索资料界面 - * @param request - * @param model - * @return - */ - @RequestMapping("/showSearchFile.do") - public String showSearchFile(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Listdatas = this.dataService.selectListByWhere("where biz_id = '"+companyId+"'"); - String nodeIds = ""; - if (null != datas && datas.size()>0 ) { - for (Data data :datas) { - if (nodeIds != "") { - nodeIds +=","; - } - nodeIds+= data.getId(); - } - } - model.addAttribute("nodeIds",nodeIds); - return "document/fileListForSearch"; - } - - @RequestMapping("/showDocumentList4Select.do") - public String showDocumentList4Select(HttpServletRequest request,Model model){ - return "document/documentList4Select"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("data") Data data){ - User cu= (User)request.getSession().getAttribute("cu"); - data.setId(CommUtil.getUUID()); - data.setInsdt(CommUtil.nowDate()); - data.setInsuser(cu.getId()); - int result = this.dataService.save(data); - String resstr="{\"res\":\""+result+"\",\"id\":\""+data.getId()+"\",\"name\":\""+data.getDocname()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("data") Data data){ - int result = this.dataService.update(data); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.dataService .deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - /** - * 显示上传页面-bootstrap-fileinput 通用 - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - */ - @RequestMapping(value = "fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response,Model model,@RequestParam(value="masterId") String masterId, - @RequestParam(value="tbName") String tbName,@RequestParam(value="nameSpace") String nameSpace) { - model.addAttribute("tbName",tbName); - model.addAttribute("masterId",masterId); - model.addAttribute("nameSpace",nameSpace); - return "document/fileAdd"; - } - - /** - * 显示上传页面-bootstrap-fileinput 用于资料模块 定制 可绑定设备 - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - */ - @RequestMapping(value = "fileinput4data.do") - public String fileinput4data(HttpServletRequest request, - HttpServletResponse response,Model model,@RequestParam(value="masterId") String masterId, - @RequestParam(value="tbName") String tbName,@RequestParam(value="nameSpace") String nameSpace) { - model.addAttribute("tbName",tbName); - model.addAttribute("masterId",masterId); - model.addAttribute("nameSpace",nameSpace); - return "document/fileAdd4data"; - } - - /** - * 显示编辑页面 - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileEditEqu.do") - public String fileEditEqu(HttpServletRequest request, - HttpServletResponse response,Model model) { - String id = request.getParameter("id"); - String tbName = request.getParameter("tbName"); - String wherestr = "where a.id='"+id+"' "; - List list = this.commonFileService.selectListByTableAWhereForEquip(tbName, wherestr+" order by a.insdt"); - if(list!=null && list.size()>0){ - model.addAttribute("CommonFile",list.get(0)); - } - return "document/fileedit4equ"; - } - - /** - * 显示编辑页面 - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileupdate4equ.do") - public ModelAndView fileupdate4equ(HttpServletRequest request, - HttpServletResponse response,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String equipmentIds = request.getParameter("equipmentIds"); - int res=0; - if (!equipmentIds.isEmpty()) { - this.equipmentFileService.deleteByWhere("where file_id='"+id+"' "); - String[] equipmentIdArr = equipmentIds.split(","); - for (int i = 0; i < equipmentIdArr.length; i++) { - EquipmentFile equipmentFile = new EquipmentFile(); - equipmentFile.setId(CommUtil.getUUID()); - equipmentFile.setInsdt(CommUtil.nowDate()); - equipmentFile.setInsuser(cu.getId()); - equipmentFile.setEquipmentId(equipmentIdArr[i]); - equipmentFile.setFileId(id); - this.equipmentFileService.save(equipmentFile); - } - res=1; - } - model.addAttribute("result",res); - return new ModelAndView("result"); - } - @RequestMapping(value = "getInputFileList.do") - public ModelAndView getInputFileList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) throws IOException { - User cu=(User)request.getSession().getAttribute("cu"); - String tbName = request.getParameter("tbName"); - PageHelper.startPage(page, rows); - String wherestr = "where 1=1"; - String fileName = request.getParameter("fileName"); - if(fileName!=null && !fileName.isEmpty()){ - String equipmentIds = ""; - String fileIds = ""; - List equipmentCardList = this.equipmentCardService.selectListByWhereEasy( - "where equipmentName like '"+fileName+"' or equipmentCardID like '"+fileName+"' order by equipmentCardID"); - if(equipmentCardList!=null && equipmentCardList.size()>0){ - for(EquipmentCard equipmentCard : equipmentCardList){ - equipmentIds += equipmentCard.getId()+"','"; - } - } - fileIds = this.equipmentFileService.getFileIds(equipmentIds); - fileIds = fileIds.replace(",","','"); - wherestr += " and (id in ('"+fileIds+"') or filename like '%"+fileName+"%') "; - } - if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){ - String masterId = request.getParameter("masterId"); - masterId = masterId.replace(",","','"); - wherestr += " and masterid in ('"+masterId+"')"; - }else if(request.getParameter("equipmentId") == null){ - wherestr += " and masterid in ('')"; - } - if(request.getParameter("equipmentId")!=null && !request.getParameter("equipmentId").isEmpty()){ - String fileIds = this.equipmentFileService.getFileIds(request.getParameter("equipmentId")); - fileIds = fileIds.replace(",","','"); - wherestr += " and id in ('"+fileIds+"')"; - } - List list = this.commonFileService.selectListByTableAWhere(tbName, wherestr+" order by insdt desc "); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping(value = "getInputFileList2.do") - public ModelAndView getInputFileList2(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) throws IOException { - User cu=(User)request.getSession().getAttribute("cu"); - String tbName = request.getParameter("tbName"); - PageHelper.startPage(page, rows); - String wherestr = "where 1=1"; - if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){ - String masterId = request.getParameter("masterId"); - masterId = masterId.replace(",","','"); - wherestr += " and masterid in ('"+masterId+"')"; - }else if(request.getParameter("equipmentId") == null){ - wherestr += " and masterid in ('')"; - } - String fileName = request.getParameter("fileName"); - if(fileName!=null && !fileName.isEmpty()){ - String equipmentIds = ""; - String fileIds = ""; - List equipmentCardList = this.equipmentCardService.selectListByWhereEasy( - "where equipmentName like '"+fileName+"' or equipmentCardID like '"+fileName+"' order by equipmentCardID"); - if(equipmentCardList!=null && equipmentCardList.size()>0){ - for(EquipmentCard equipmentCard : equipmentCardList){ - equipmentIds += equipmentCard.getId()+"','"; - } - } - fileIds = this.equipmentFileService.getFileIds(equipmentIds); - List documentList = documentService.selectListByWhere("where w_name like '%"+fileName+"%' "); - if(documentList!=null && documentList.size()>0){ - for (Document document : documentList) { - fileIds += document.getMasterId()+","; - } - } - fileIds = fileIds.replace(",","','"); - wherestr += " and (id in ('"+fileIds+"') or filename like '%"+fileName+"%') "; - } - - List list = this.commonFileService.selectListByTableAWhere2(tbName, wherestr+" order by insdt desc "); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "getInputFileListForSelect.do") - public ModelAndView getInputFileListForSelect(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) throws IOException { - User cu=(User)request.getSession().getAttribute("cu"); - String tbName = request.getParameter("tbName"); - String wherestr = "where 1=1"; - if(request.getParameter("fileName")!=null && !request.getParameter("fileName").isEmpty()){ -// wherestr += " and filename like '%"+request.getParameter("fileName")+"%'"; - wherestr += " and (c.equipmentName like '%"+request.getParameter("fileName")+"%' or c.equipmentCardID like '%"+request.getParameter("fileName")+"%' or a.filename like '%"+request.getParameter("fileName")+"%') "; - } - if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){ - String masterId = request.getParameter("masterId"); - String nodeIds = ""; - if (null != masterId && !masterId.isEmpty()) { - nodeIds = this.dataService.getNodeIds(masterId); - nodeIds += masterId; - } - nodeIds = nodeIds.replace(",","','"); - wherestr += " and a.masterid in ('"+nodeIds+"')"; - }else if(request.getParameter("equipmentId") == null){ - wherestr += " and a.masterid in ('')"; - } - if(request.getParameter("equipmentId")!=null && !request.getParameter("equipmentId").isEmpty()){ - String fileIds = this.equipmentFileService.getFileIds(request.getParameter("equipmentId")); - fileIds = fileIds.replace(",","','"); - wherestr += " and a.id in ('"+fileIds+"')"; - } - PageHelper.startPage(page, rows); - List list = this.commonFileService.selectListByTableAWhereForEquip(tbName, wherestr+" order by a.insdt"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 上传文件通用接口 ,文件上传绑定设备 - * */ - @RequestMapping(value = "inputFile.do") - public ModelAndView inputFile(HttpServletRequest request,HttpServletResponse response,Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - String equipmentIds = request.getParameter("equipmentIds"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - String filepath=filepathSever.replaceAll(contextPath, BaseFolderName+"/"+nameSpace+"/"); - File fileUploadPath = new File(filepath.replace("/", File.separator)); - if (!fileUploadPath.exists()) { - fileUploadPath.mkdirs(); - } - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - for (CommonFile commonFile : commonFileService.selectListByTableAWhere(tbName, "where masterid = '" + masterId + "'")) { - equipmentFileService.deleteByWhere("where file_id = '" + commonFile.getId() + "'"); - String[] equipmentIdArr = equipmentIds.split(","); - for (int e = 0; e < equipmentIdArr.length; e++) { - EquipmentFile equipmentFile = new EquipmentFile(); - equipmentFile.setId(CommUtil.getUUID()); - equipmentFile.setInsdt(CommUtil.nowDate()); - equipmentFile.setInsuser(cu.getId()); - equipmentFile.setEquipmentId(equipmentIdArr[e]); - equipmentFile.setFileId(commonFile.getId()); - this.equipmentFileService.save(equipmentFile); - } - } - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date())+fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - - String fileId = CommUtil.getUUID(); - commonFile.setId(fileId); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int)item.getSize()); - int res =commonFileService.insertByTable(tbName, commonFile); - - /*String dId = CommUtil.getUUID(); - Document document = new Document(); - document.setId(dId); - document.setwName(request.getParameter("wName")); - document.setwContent(request.getParameter("wContent")); - document.setMasterId(fileId); - document.setInsertUserId(cu.getId()); - document.setInsertTime(CommUtil.nowDate()); - documentService.save(document);*/ - - System.out.println("commonFileres=============="+res); - if (res==1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - //上传成功后关联设备 - if (StringUtils.isNotBlank(equipmentIds)) { -// if (!equipmentIds.isEmpty()) { - String[] equipmentIdArr = equipmentIds.split(","); - for (int i = 0; i < equipmentIdArr.length; i++) { - EquipmentFile equipmentFile = new EquipmentFile(); - equipmentFile.setId(CommUtil.getUUID()); - equipmentFile.setInsdt(CommUtil.nowDate()); - equipmentFile.setInsuser(cu.getId()); - equipmentFile.setEquipmentId(equipmentIdArr[i]); - equipmentFile.setFileId(commonFile.getId()); - this.equipmentFileService.save(equipmentFile); - } - } - //判断是否是office类型 - /*if(fileType.contains("word") || fileType.contains("sheet") || fileType.contains("excel") || fileType.contains("presentation") || fileType.contains("powerpoint")){ - String savePDFFileName = dateFormat.format(new Date())+ ".pdf"; - String reportAddrPDF = fileUploadPath + "/" + savePDFFileName; - reportAddrPDF = reportAddrPDF.replace("/", File.separator).replace("\\", File.separator); - - if(fileType.contains("word")){ - try { - FileUtil.toPdf(reportAddr,reportAddrPDF,"word"); - } catch (Exception e) { - // TODO: handle exception - ret.put("pdf", false); - } - - }else if (fileType.contains("sheet") || fileType.contains("excel")) { - try { - FileUtil.toPdf(reportAddr,reportAddrPDF,"excel"); - } catch (Exception e) { - // TODO: handle exception - ret.put("pdf", false); - } - - }else if (fileType.contains("presentation") || fileType.contains("powerpoint")) { - try { - FileUtil.toPdf(reportAddr,reportAddrPDF,"ppt"); - } catch (Exception e) { - // TODO: handle exception - ret.put("pdf", false); - } - - } - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFilePDF = new CommonFile(); - commonFilePDF.setId(CommUtil.getUUID()); - commonFilePDF.setMasterid(fileId); - commonFilePDF.setFilename(savePDFFileName); - commonFilePDF.setType("application/pdf"); - commonFilePDF.setAbspath(reportAddrPDF); - commonFilePDF.setInsdt(CommUtil.nowDate()); - commonFilePDF.setInsuser(cu.getId()); - BufferedInputStream bis = new BufferedInputStream(new FileInputStream(reportAddrPDF)); - int size = bis.available(); - commonFilePDF.setSize(size); - if(size>0){ - commonFileService.insertByTable(tbName, commonFilePDF); - } - bis.close(); - }*/ - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result =JSONObject.fromObject(ret).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodeleteFile.do") - public ModelAndView dodeleteFile(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="tbName") String tbName) throws IOException{ - int res=0; - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='"+id+"'"); - if(commfiles!=null && commfiles.size()>0){ - res = this.commonFileService.deleteByTableAWhere(tbName, "where id='"+id+"'"); - } - if(res>0){ - FileUtil.deleteFile(commfiles.get(0).getAbspath()); - ret.put("suc", true); - }else{ - ret.put("suc", false); - } - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showWorkOrderAdd.do") - public String doWorkOrderadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid", required = false) String pid) { - model.addAttribute("pname", this.dataService.getNameById(pid)); - model.addAttribute("level", this.dataService.getLevelById(pid)); - model.addAttribute("fileid", CommUtil.getUUID()); - model.addAttribute("id", CommUtil.getUUID()); - return "document/workorderAdd"; - } - - @RequestMapping("/showWorkOrderEdit.do") - public String doWorkOrderEdit(HttpServletRequest request, Model model, - @RequestParam String id) { - Data data = dataService.selectById(id); - model.addAttribute("data", data); - model.addAttribute("pname", this.dataService.getNameById(data.getPid())); - return "document/workorderEdit"; - } - - @RequestMapping("/saveWorkOrder.do") - public ModelAndView doWorkOrderSave(HttpServletRequest request, - Model model, @ModelAttribute Data t) { - // t.setId(CommUtil.getUUID()); - if(!this.dataService.checkNotOccupied(t.getId(),t.getNumber(),t.getDoctype())){ - model.addAttribute("result", "{\"res\":\"工作指令编号重复\"}"); - return new ModelAndView("result"); - } - User cu = (User) request.getSession().getAttribute("cu"); - t.setInsuser(cu.getId()); - t.setInsdt(CommUtil.nowDate()); - int result = this.dataService.save(t); - model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+t.getId()+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/updateWorkOrder.do") - public ModelAndView doWorkOrderUpdate(HttpServletRequest request, - Model model, @ModelAttribute Data t) { - User cu = (User) request.getSession().getAttribute("cu"); - if(!this.dataService.checkNotOccupied(t.getId(),t.getNumber(),t.getDoctype())){ - model.addAttribute("result", "{\"res\":\"工作指令编号重复\"}"); - return new ModelAndView("result"); - } - t.setUpdateuser(cu.getId()); - t.setUpdatedt(CommUtil.nowDate()); - int result = this.dataService.update(t); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteWorkOrder.do") - public ModelAndView doWorkOrderDelete(HttpServletRequest request, - Model model, @RequestParam(value = "id") String id) - throws IOException { - String mappernamespace = "document.DocFileMapper"; - int result = this.dataService.deleteById(id); - List commfile = this.commonFileService.selectByMasterId(id, - mappernamespace); - int res = this.commonFileService.deleteByMasterId(id, mappernamespace); - if (res > 0) { - for (int i = 0; i < commfile.size(); i++) { - FileUtil.deleteFile(commfile.get(i).getAbspath()); - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/showDrawingAdd.do") - public String doDrawingadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid", required = false) String pid) { - model.addAttribute("pname", this.dataService.getNameById(pid)); - model.addAttribute("level", this.dataService.getLevelById(pid)); - model.addAttribute("fileid", CommUtil.getUUID()); - model.addAttribute("id", CommUtil.getUUID()); - return "document/drawingAdd"; - } - - @RequestMapping("/showDrawingEdit.do") - public String doDrawingEdit(HttpServletRequest request, Model model, - @RequestParam String id) { - Data data = dataService.selectById(id); - model.addAttribute("data", data); - model.addAttribute("pname", this.dataService.getNameById(data.getPid())); - return "document/drawingEdit"; - } - - @RequestMapping("/saveDrawing.do") - public ModelAndView doDrawingSave(HttpServletRequest request, Model model, - @ModelAttribute Data t) { - // t.setId(CommUtil.getUUID()); - if(!this.dataService.checkNotOccupied(t.getId(),t.getNumber(),t.getDoctype())){ - model.addAttribute("result", "{\"res\":\"图纸编号重复\"}"); - return new ModelAndView("result"); - } - User cu = (User) request.getSession().getAttribute("cu"); - t.setInsuser(cu.getId()); - t.setInsdt(CommUtil.nowDate()); - int result = this.dataService.save(t); - model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+t.getId()+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/updateDrawing.do") - public ModelAndView doDrawingUpdate(HttpServletRequest request, - Model model, @ModelAttribute Data t) { - User cu = (User) request.getSession().getAttribute("cu"); - if(!this.dataService.checkNotOccupied(t.getId(),t.getNumber(),t.getDoctype())){ - model.addAttribute("result", "{\"res\":\"图纸编号重复\"}"); - return new ModelAndView("result"); - } - t.setUpdateuser(cu.getId()); - t.setUpdatedt(CommUtil.nowDate()); - int result = this.dataService.update(t); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteDrawing.do") - public ModelAndView doDrawingDelete(HttpServletRequest request, - Model model, @RequestParam(value = "id") String id) - throws IOException { - String mappernamespace = "document.DocFileMapper"; - int result = this.dataService.deleteById(id); - List commfile = this.commonFileService.selectByMasterId(id, - mappernamespace); - int res = this.commonFileService.deleteByMasterId(id, mappernamespace); - if (res > 0) { - for (int i = 0; i < commfile.size(); i++) { - FileUtil.deleteFile(commfile.get(i).getAbspath()); - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/selectDrawing.do") - public String selectDrawing(HttpServletRequest request,Model model) { - return "/document/drawingForSelect"; - } - - @RequestMapping("/selectBook.do") - public String selectBook(HttpServletRequest request,Model model) { - return "/document/bookForSelect"; - } - - @RequestMapping("/getDatasForSelect.do") - public ModelAndView getDatasForSelect(HttpServletRequest request,Model model) { - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "and docname like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += "and number like '%"+request.getParameter("search_code")+"%' "; - } - if(request.getParameter("doctype")!=null && !request.getParameter("doctype").isEmpty()){ - wherestr += "and doctype = '"+request.getParameter("doctype")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.dataService.selectListByWhere(wherestr+orderstr); - - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/showBookAdd.do") - public String doBookadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid", required = false) String pid) { - model.addAttribute("pname", this.dataService.getNameById(pid)); - model.addAttribute("level", this.dataService.getLevelById(pid)); - model.addAttribute("fileid", CommUtil.getUUID()); - model.addAttribute("id", CommUtil.getUUID()); - return "document/bookAdd"; - } - - @RequestMapping("/showBookEdit.do") - public String doBookEdit(HttpServletRequest request, Model model, - @RequestParam String id) { - Data data = dataService.selectById(id); - model.addAttribute("data", data); - model.addAttribute("pname", this.dataService.getNameById(data.getPid())); - return "document/bookEdit"; - } - - @RequestMapping("/showBookView.do") - public String doBookView(HttpServletRequest request, Model model, - @RequestParam String id) { - Data data = dataService.selectById(id); - model.addAttribute("data", data); - model.addAttribute("pname", this.dataService.getNameById(data.getPid())); - return "document/bookView"; - } - - @RequestMapping("/saveBook.do") - public ModelAndView doBookSave(HttpServletRequest request, Model model, - @ModelAttribute Data t) { - // t.setId(CommUtil.getUUID()); - if(!this.dataService.checkNotOccupied(t.getId(),t.getNumber(),t.getDoctype())){ - model.addAttribute("result", "{\"res\":\"作业指导书编号重复\"}"); - return new ModelAndView("result"); - } - User cu = (User) request.getSession().getAttribute("cu"); - t.setInsuser(cu.getId()); - t.setInsdt(CommUtil.nowDate()); - int result = this.dataService.save(t); - model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+t.getId()+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/updateBook.do") - public ModelAndView doBookUpdate(HttpServletRequest request, Model model, - @ModelAttribute Data t) { - if(!this.dataService.checkNotOccupied(t.getId(),t.getNumber(),t.getDoctype())){ - model.addAttribute("result", "{\"res\":\"作业指导书编号重复\"}"); - return new ModelAndView("result"); - } - User cu = (User) request.getSession().getAttribute("cu"); - t.setUpdateuser(cu.getId()); - t.setUpdatedt(CommUtil.nowDate()); - int result = this.dataService.update(t); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteBook.do") - public ModelAndView doBookDelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) throws IOException { - String mappernamespace = "document.DocFileMapper"; - int result = this.dataService.deleteById(id); - List commfile = this.commonFileService.selectByMasterId(id, - mappernamespace); - int res = this.commonFileService.deleteByMasterId(id, mappernamespace); - if (res > 0) { - for (int i = 0; i < commfile.size(); i++) { - FileUtil.deleteFile(commfile.get(i).getAbspath()); - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doimport.do") - public ModelAndView doimport(@RequestParam MultipartFile[] file, - HttpServletRequest request, HttpServletResponse response, - Model model) throws IOException { - // 要存入的实际地址 - String realPath = request.getSession().getServletContext() - .getRealPath("/"); - String pjName = request.getContextPath().substring(1, - request.getContextPath().length()); - realPath = realPath.replace(pjName, "Temp"); - String result = ""; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - /** - * 设备上传资料界面 - * @param request - * @param response - * @param model - * @param mappernamespace - * @return - */ - @RequestMapping(value = "equipmentFileInput.do") - public String equipmentFileInput(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="tbName") String tbName, - @RequestParam(value="nameSpace") String nameSpace, - @RequestParam(value="equipmentId") String equipmentId, - @RequestParam(value="companyId") String companyId) { - User cu= (User)request.getSession().getAttribute("cu"); - Company company = this.unitService.getCompById(companyId); - //设备上传资料时生成节点 - String masterId = company.getEname()+"_"+EquipmentCommStr.Equipment_FileNode; - Data data = this.dataService.selectById(masterId); - if (null == data) { - data = new Data(); - data.setId(masterId); - data.setInsdt(CommUtil.nowDate()); - data.setInsuser(cu.getId()); - data.setPid("-1"); - data.setSt(CommString.Active_True); - data.setBizId(companyId); - this.dataService.save(data); - } - model.addAttribute("tbName",tbName); - model.addAttribute("nameSpace",nameSpace); - model.addAttribute("masterId",masterId); - model.addAttribute("equipmentId",equipmentId); - return "document/equipmentFileAdd"; - } - - /** - * 技术档案资料(浏览) - 可通用 - * @param request - * @param model - * @return - */ - @RequestMapping("/showDataTreeView.do") - public String showDataTreeView(HttpServletRequest request, Model model) { - return "document/dataTreeView"; - } - - /* - * 浏览节点中的资料 - 可通用 - */ - @RequestMapping("/viewDataFile.do") - public String doviewDataFile(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - Data data = new Data(); - String nodeIds = ""; - if (null != id && !id.isEmpty()) { - data = this.dataService.selectById(id); - nodeIds = this.dataService.getNodeIds(id); - nodeIds += id; - } - model.addAttribute("nodeIds",nodeIds ); - model.addAttribute("data",data ); - return "document/dataFileView"; - } - - /** - * 获取左侧类型树 --- 应急预案定制 - * @param request - * @param model - * @return - */ - @RequestMapping("/getDataJsonView4YJ.do") - public String getDataJsonView4YJ(HttpServletRequest request, Model model) { - String doctype = request.getParameter("doctype"); - String wherestr = "where doctype = '"+doctype+"' and docname like '%安全%'"; - if(request.getParameter("docname")!=null && !request.getParameter("docname").isEmpty()){ - wherestr += " and docname like '%"+request.getParameter("docname")+"%'"; - } - if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - wherestr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - List list = this.dataService.selectListByWhere(wherestr); - List datas = new ArrayList<>(list); - if(request.getParameter("docname")!=null && !request.getParameter("docname").isEmpty()){ - //查询搜索时加载上级节点 - for (Data item:list) { - List dataList = this.dataService.getDatas(item.getPid()); - datas.addAll(dataList); - } - //去除datas中id重复的元素 - Set set = new TreeSet<>(new Comparator() { - public int compare(Data o1, Data o2) { - //字符串,则按照asicc码升序排列 - return o1.getId().compareTo(o2.getId()); - } - }); - set.addAll(datas); - datas = new ArrayList<>(set); - } - String json = dataService.getTreeList(null, datas); - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/document/DocFileRelationController.java b/src/com/sipai/controller/document/DocFileRelationController.java deleted file mode 100644 index be9bd09c..00000000 --- a/src/com/sipai/controller/document/DocFileRelationController.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.controller.document; - - -import java.io.File; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.achievement.AcceptanceModelRecord; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.document.Data; -import com.sipai.entity.document.DocFileRelation; -import com.sipai.entity.user.User; -import com.sipai.service.document.DocFileRelationService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/document/docFileRelation") -public class DocFileRelationController { - @Resource - private DocFileRelationService docFileRelationService; - - @RequestMapping("/show4select.do") - public String show4select(HttpServletRequest request, Model model) { - return "document/showDocFileRelationSelect"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - String masterid = request.getParameter("masterid"); - - if(sort==null){ - sort = " id "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - PageHelper.startPage(page, rows); - - String whereString=" where 1=1 and masterid='"+masterid+"' "; - if(request.getParameter("search_name")!=null&&request.getParameter("search_name").length()>0){ - whereString+=" and name like '%"+request.getParameter("search_name")+"%' "; - } - - List list = this.docFileRelationService.selectListByWhere(whereString+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return ("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String[] dataIds=request.getParameter("datas").split(","); - String type=request.getParameter("type"); - String masterid=request.getParameter("masterid"); - int code = 0; - if(dataIds!=null&&dataIds.length>0){ - for (String docId : dataIds) { - DocFileRelation dFileRelation=new DocFileRelation(); - dFileRelation.setId(CommUtil.getUUID()); - dFileRelation.setMasterid(masterid); - dFileRelation.setType(type); - dFileRelation.setDocId(docId); - code += this.docFileRelationService.save(dFileRelation); - } - } - - Result result = new Result(); - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - - return new ModelAndView("result"); - } - - @RequestMapping("/delete.do") - public String delete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.docFileRelationService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/document/DocumentController.java b/src/com/sipai/controller/document/DocumentController.java deleted file mode 100644 index e43ea43f..00000000 --- a/src/com/sipai/controller/document/DocumentController.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.sipai.controller.document; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.document.Document; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.document.DocumentService; -import com.sipai.service.equipment.EquipmentFileService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/documentData") -public class DocumentController { - - @Resource - DocumentService documentService; - @Resource - private CommonFileService commonFileService; - @Resource - private EquipmentFileService equipmentFileService; - - @RequestMapping("/doaddData.do") - public String doaddData(HttpServletRequest request, Model model){ - model.addAttribute("masterId", request.getParameter("masterId")); - model.addAttribute("tbName", request.getParameter("tbName")); - model.addAttribute("nameSpace", request.getParameter("nameSpace")); - model.addAttribute("companyId", request.getParameter("companyId")); - String documentId = CommUtil.getUUID(); - model.addAttribute("documentId", documentId); - return "document/documentAdd"; - } - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute Document document){ - User cu = (User) request.getSession().getAttribute("cu"); - document.setInsertUserId(cu.getId()); - document.setInsertTime(CommUtil.nowDate()); - int result = documentService.save(document); - - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+document.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/doeditData.do") - public String doeditData(HttpServletRequest request, Model model){ - Document document = documentService.selectById(request.getParameter("id")); - List commfiles = this.commonFileService.selectListByTableAWhere(request.getParameter("tbName"), "where masterid='"+request.getParameter("id")+"'"); - model.addAttribute("document", document); - if(commfiles!=null && commfiles.size()>0){ - model.addAttribute("CommonFile", commfiles.get(0)); - } - return "document/documentEdit"; - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model){ - Document document = documentService.selectById(request.getParameter("id")); - model.addAttribute("document", document); - List commfiles = this.commonFileService.selectListByTableAWhere(request.getParameter("tbName"), "where masterid='"+request.getParameter("id")+"'"); - if(commfiles!=null && commfiles.size()>0){ - model.addAttribute("CommonFile", commfiles.get(0)); - } - return "document/documentView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute Document document){ - int result = documentService.update(document); - String resstr="{\"res\":\""+result+"\",\"id\":\""+document.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodeleteFile.do") - public ModelAndView dodeleteFile(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="tbName") String tbName) throws IOException{ - - int res= documentService.deleteById(id); - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+id+"'"); - if(commfiles!=null && commfiles.size()>0){ - this.commonFileService.deleteByTableAWhere(tbName, "where masterid='"+id+"'"); - } - if(res>0){ - FileUtil.deleteFile(commfiles.get(0).getAbspath()); - ret.put("suc", true); - equipmentFileService.deleteByWhere("where file_id = '" + id + "'"); - }else{ - ret.put("suc", false); - } - model.addAttribute("result",res); - return new ModelAndView("result"); - } - @RequestMapping("/viewText.do") - public String viewText(HttpServletRequest request, Model model){ - String masterId = request.getParameter("masterId"); - if (StringUtils.isNotBlank(masterId)) { - List documentList = documentService.selectListByWhere( - "where master_id = '" + masterId + "'"); - if (documentList.size() > 0) { - model.addAttribute("result", documentList.get(0).getwContent()); - } - } - return "result"; - } - @RequestMapping(value = "getList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) - throws IOException { - User cu=(User)request.getSession().getAttribute("cu"); - String tbName = request.getParameter("tbName"); - PageHelper.startPage(page, rows); - String wherestr = "where 1=1"; - if(request.getParameter("masterId")!=null && !request.getParameter("masterId").isEmpty()){ - String masterId = request.getParameter("masterId"); - masterId = masterId.replace(",","','"); - wherestr += " and td.master_id in ('"+masterId+"') "; - } - String fileName = request.getParameter("fileName"); - if(fileName!=null && !fileName.isEmpty()){ - wherestr += " and td.w_name like '%"+fileName+"%' "; - } - List documentList = new ArrayList<>(); - try { - documentList = documentService.selectListFileByWhere( - wherestr); - } catch (Exception e) { - e.printStackTrace(); - } - PageInfo pi = new PageInfo(documentList); - JSONArray json=JSONArray.fromObject(documentList); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/efficiency/ConstituteConfigureController.java b/src/com/sipai/controller/efficiency/ConstituteConfigureController.java deleted file mode 100644 index 4b59441b..00000000 --- a/src/com/sipai/controller/efficiency/ConstituteConfigureController.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.efficiency.ConstituteConfigureScheme; -import com.sipai.service.efficiency.ConstituteConfigureSchemeService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.efficiency.ConstituteConfigure; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.ConstituteConfigureService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/constituteConfigure") -public class ConstituteConfigureController { - @Resource - private ConstituteConfigureService constituteConfigureService; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; - @Resource - private CommonFileService commonFileService; - @Resource - private ConstituteConfigureSchemeService constituteConfigureSchemeService; - - @RequestMapping("/showManage.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model) { - return "efficiency/constituteConfigureManage"; - } - - @RequestMapping("/showTree4Select.do") - public String showMenu4Select(HttpServletRequest request, Model model) { - return "efficiency/constituteConfigureTree4Select"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List slist = this.constituteConfigureSchemeService.selectListByWhere(" where 1=1 and unitId='" + unitId + "' order by morder"); - - JSONArray jsonArray = new JSONArray(); - for (ConstituteConfigureScheme constituteConfigureScheme : - slist) { - List list = this.constituteConfigureService.selectListByWhere(" where 1=1 and scheme_id='" + constituteConfigureScheme.getId() + "' order by morder"); - JSONArray j = new JSONArray(); - j = this.constituteConfigureService.getTreeList(null, list); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", constituteConfigureScheme.getId()); - jsonObject.put("text", constituteConfigureScheme.getName()); - jsonObject.put("type", "0"); - jsonObject.put("nodes", j); - jsonArray.add(jsonObject); - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and unitId='" + request.getParameter("unitId") + "' "; - - PageHelper.startPage(page, rows); - List list = this.constituteConfigureService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - ConstituteConfigure constituteConfigure = this.constituteConfigureService.selectById(pid); - model.addAttribute("pname", constituteConfigure.getName()); - } else if (pid.equals("-1")) { - model.addAttribute("pname", "根目录"); - } - return "efficiency/constituteConfigureAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value = "constituteConfigure") ConstituteConfigure constituteConfigure) { - constituteConfigure.setId(CommUtil.getUUID()); - - int code = this.constituteConfigureService.save(constituteConfigure); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ConstituteConfigure constituteConfigure = this.constituteConfigureService.selectById(id); - model.addAttribute("constituteConfigure", constituteConfigure); - ConstituteConfigure configure = this.constituteConfigureService.selectById(constituteConfigure.getPid()); - if (configure != null) { - model.addAttribute("pname", configure.getName()); - } else if (constituteConfigure.getPid().equals("-1")) { - model.addAttribute("pname", "根目录"); - } - return "efficiency/constituteConfigureEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute(value = "constituteConfigure") ConstituteConfigure constituteConfigure) { - int code = this.constituteConfigureService.update(constituteConfigure); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int code = this.constituteConfigureService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.constituteConfigureService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/efficiency/ConstituteConfigureDetailController.java b/src/com/sipai/controller/efficiency/ConstituteConfigureDetailController.java deleted file mode 100644 index d0542982..00000000 --- a/src/com/sipai/controller/efficiency/ConstituteConfigureDetailController.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.efficiency.ConstituteConfigureDetail; -import com.sipai.entity.efficiency.ConstituteConfigureDetail; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.ConstituteConfigureDetailService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/constituteConfigureDetail") -public class ConstituteConfigureDetailController { - @Resource - private ConstituteConfigureDetailService constituteConfigureDetailService; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; - @Resource - private CommonFileService commonFileService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and pid='"+request.getParameter("pid")+"' "; - -// PageHelper.startPage(page, rows); - List list = this.constituteConfigureDetailService.selectListByWhere(wherestr+orderstr); -// PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="constituteConfigureDetail") ConstituteConfigureDetail constituteConfigureDetail){ - User cu= (User)request.getSession().getAttribute("cu"); - constituteConfigureDetail.setId(CommUtil.getUUID()); - - int code = this.constituteConfigureDetailService.save(constituteConfigureDetail); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosaves.do") - public String dosaves(HttpServletRequest request, Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String datas=request.getParameter("datas"); - String pid=request.getParameter("pid"); - String unitId=request.getParameter("unitId"); - - String[] mpids=datas.split(","); - int sucCode=0; - for(int i=0;i list = this.constituteConfigureSchemeService.selectListByWhere(" where 1=1 and unitId='" + unitId + "' order by morder"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (ConstituteConfigureScheme constituteConfigureScheme : - list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("text", constituteConfigureScheme.getName()); - jsonObject.put("id", constituteConfigureScheme.getId()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - ConstituteConfigureScheme constituteConfigureScheme = this.constituteConfigureSchemeService.selectById(pid); - model.addAttribute("pname", constituteConfigureScheme.getName()); - } else if (pid.equals("-1")) { - model.addAttribute("pname", "根目录"); - } - return "efficiency/constituteConfigureSchemeAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value = "constituteConfigureScheme") ConstituteConfigureScheme constituteConfigureScheme) { - User cu = (User) request.getSession().getAttribute("cu"); - constituteConfigureScheme.setId(CommUtil.getUUID()); - - int code = this.constituteConfigureSchemeService.save(constituteConfigureScheme); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ConstituteConfigureScheme constituteConfigureScheme = this.constituteConfigureSchemeService.selectById(id); - model.addAttribute("constituteConfigureScheme", constituteConfigureScheme); -// ConstituteConfigureScheme configure = this.constituteConfigureSchemeService.selectById(constituteConfigureScheme.getPid()); -// if (configure != null) { -// model.addAttribute("pname", configure.getName()); -// } else if (constituteConfigureScheme.getPid().equals("-1")) { -// model.addAttribute("pname", "根目录"); -// } - return "efficiency/constituteConfigureSchemeEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute(value = "constituteConfigureScheme") ConstituteConfigureScheme constituteConfigureScheme) { - int code = this.constituteConfigureSchemeService.update(constituteConfigureScheme); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int code = this.constituteConfigureSchemeService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.constituteConfigureSchemeService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/efficiency/ConstituteController.java b/src/com/sipai/controller/efficiency/ConstituteController.java deleted file mode 100644 index d97b6061..00000000 --- a/src/com/sipai/controller/efficiency/ConstituteController.java +++ /dev/null @@ -1,328 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.jws.soap.SOAPBinding.Use; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.efficiency.ConstituteConfigure; -import com.sipai.entity.efficiency.ConstituteConfigureDetail; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.ConstituteConfigureDetailService; -import com.sipai.service.efficiency.ConstituteConfigureService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/constitute") -public class ConstituteController { - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ConstituteConfigureService constituteConfigureService; - @Resource - private ConstituteConfigureDetailService constituteConfigureDetailService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "efficiency/constituteView"; - } - - @RequestMapping("/getCompanyEnergy.do") - public String getCompanyEnergy(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String unitId=request.getParameter("unitId"); - String sdt=request.getParameter("sdt"); - String edt=request.getParameter("edt"); - String sid = request.getParameter("sid"); - String lastsdt=CommUtil.subplus(sdt, "-1", "year").substring(0,10)+sdt.substring(10, 16); - String lastedt=CommUtil.subplus(edt, "-1", "year").substring(0,10)+edt.substring(10, 16); - - List mainCFlist = this.constituteConfigureService.selectListByWhere(" where 1=1 and scheme_id='"+sid+"' and pid='-1' order by morder"); - if(mainCFlist!=null&&mainCFlist.size()>0){ - JSONArray jsondata0=new JSONArray(); - for(int i=0;i mainCFlist2 = this.constituteConfigureService.selectListByWhere(" where 1=1 and pid='"+mainCFlist.get(i).getId()+"' order by morder"); - if(mainCFlist2!=null&&mainCFlist2.size()>0){ - for(int j=0;j detailCFlist = this.constituteConfigureDetailService.selectListByWhere(" where 1=1 and pid='"+mainCFlist2.get(j).getId()+"' order by morder "); - double totalPv2=0; - double lasttotalPv2=0; - if(detailCFlist!=null&&detailCFlist.size()>0){ - for(int m=0;m mainCFlist = this.constituteConfigureService.selectListByWhere(" where 1=1 and scheme_id ='"+sid+"' and pid='-1' order by morder"); - if(mainCFlist!=null&&mainCFlist.size()>0){ - JSONArray mainjsondata=new JSONArray(); - for(int i=0;i mainCFlist2 = this.constituteConfigureService.selectListByWhere(" where 1=1 and pid='"+mainCFlist.get(num).getId()+"' order by morder"); - if(mainCFlist2!=null&&mainCFlist2.size()>0){ - - for(int j=0;j detailCFlist = this.constituteConfigureDetailService.selectListByWhere(" where 1=1 and pid='"+mainCFlist2.get(j).getId()+"' order by morder "); - if(detailCFlist!=null&&detailCFlist.size()>0){ - String type=""; - if(detailCFlist.get(0).getType()!=null&&!detailCFlist.get(0).getType().equals("")){ - type=detailCFlist.get(0).getType(); - } - if(detailCFlist!=null&&detailCFlist.size()>0){ - for(int m=0;m mphlist = mPointHistoryService.selectAggregateList(unitId, fromString , " group by MeasureDT order by MeasureDT "," sum(ParmValue) as ParmValue,MeasureDT "); - if(mphlist!=null&&mphlist.size()>0){ - for(int n=0;n detailCFlist = this.constituteConfigureDetailService.selectListByWhere(" where 1=1 and pid='"+id+"' order by morder "); - if(detailCFlist!=null&&detailCFlist.size()>0){ - for(int m=0;m mphlist = mPointHistoryService.selectListByTableAWhere(request.getParameter("unitId"), "[tb_mp_"+detailCFlist.get(m).getMpid()+type+"]", " where MeasureDT between '"+sdt+"' and '"+edt+"' order by MeasureDT "); - com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(); - JSONArray jsondata=new JSONArray(); - if(mphlist!=null&&mphlist.size()>0){ - for(int d=0;d detailCFlist = this.constituteConfigureDetailService.selectListByWhere(" where 1=1 and pid='"+id+"' order by morder "); - if(detailCFlist!=null&&detailCFlist.size()>0){ - for(int m=0;m0){ - List mHistory2 = mPointHistoryService.selectAggregateList(unitId, "[tb_mp_"+dsmpid+"]", " where MeasureDT between '"+sdt+"' and '"+edt+"' "," avg(ParmValue) as ParmValue "); - List lastyearmHistory2 = mPointHistoryService.selectAggregateList(unitId, "[tb_mp_"+dsmpid+"]", " where MeasureDT between '"+lastsdt+"' and '"+lastedt+"' "," avg(ParmValue) as ParmValue "); - if(mHistory2!=null&&mHistory2.size()>0){ - if(mHistory2.get(0)!=null){ - jsonObject3.put("dsValue", mHistory2.get(0).getParmvalue()); - }else{ - jsonObject3.put("dsValue", 0); - } - }else{ - jsonObject3.put("dsValue", 0); - } - if(lastyearmHistory2!=null&&lastyearmHistory2.size()>0){ - if(lastyearmHistory2.get(0)!=null){ - jsonObject3.put("dslastValue", lastyearmHistory2.get(0).getParmvalue()); - }else{ - jsonObject3.put("dslastValue", 0); - } - }else{ - jsonObject3.put("dslastValue", 0); - } - } - - //效率值 - if(xlmpid!=null&&xlmpid.length()>0){ - List mHistory2 = mPointHistoryService.selectAggregateList(unitId, "[tb_mp_"+xlmpid+"]", " where MeasureDT between '"+sdt+"' and '"+edt+"' "," avg(ParmValue) as ParmValue "); - List lastyearmHistory2 = mPointHistoryService.selectAggregateList(unitId, "[tb_mp_"+xlmpid+"]", " where MeasureDT between '"+lastsdt+"' and '"+lastedt+"' "," avg(ParmValue) as ParmValue "); - if(mHistory2!=null&&mHistory2.size()>0){ - if(mHistory2.get(0)!=null){ - jsonObject3.put("xlValue", mHistory2.get(0).getParmvalue()); - }else{ - jsonObject3.put("xlValue", 0); - } - }else{ - jsonObject3.put("xlValue", 0); - } - if(lastyearmHistory2!=null&&lastyearmHistory2.size()>0){ - if(lastyearmHistory2.get(0)!=null){ - jsonObject3.put("xllastValue", lastyearmHistory2.get(0).getParmvalue()); - }else{ - jsonObject3.put("xllastValue", 0); - } - }else{ - jsonObject3.put("xllastValue", 0); - } - } - - mainjsondata.add(jsonObject3); - } - } - model.addAttribute("result", mainjsondata); - return "result"; - } - -} diff --git a/src/com/sipai/controller/efficiency/EfficiencyOverviewConfigureAssemblyController.java b/src/com/sipai/controller/efficiency/EfficiencyOverviewConfigureAssemblyController.java deleted file mode 100644 index 0421c982..00000000 --- a/src/com/sipai/controller/efficiency/EfficiencyOverviewConfigureAssemblyController.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigureAssembly; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.EfficiencyOverviewConfigureAssemblyService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/efficiencyOverviewConfigureAssembly") -public class EfficiencyOverviewConfigureAssemblyController { - @Resource - private EfficiencyOverviewConfigureAssemblyService efficiencyOverviewConfigureAssemblyService; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/showManage.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "efficiency/efficiencyOverviewConfigureAssemblyManage"; - } - - @RequestMapping("/showTree4Select.do") - public String showMenu4Select(HttpServletRequest request,Model model){ - return "efficiency/efficiencyOverviewConfigureAssemblyTree4Select"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model){ - String unitId = request.getParameter("unitId"); - List list = this.efficiencyOverviewConfigureAssemblyService.selectListByWhere(" where 1=1 and unitId='"+unitId+"' order by morder"); - String json = this.efficiencyOverviewConfigureAssemblyService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and unitId='"+request.getParameter("unitId")+"' "; - - PageHelper.startPage(page, rows); - List list = this.efficiencyOverviewConfigureAssemblyService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")&& !pid.equals("-1")){ - EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly = this.efficiencyOverviewConfigureAssemblyService.selectById(pid); - model.addAttribute("pname",efficiencyOverviewConfigureAssembly.getName()); - }else if(pid.equals("-1")){ - model.addAttribute("pname","根目录"); - } - return "efficiency/efficiencyOverviewConfigureAssemblyAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="efficiencyOverviewConfigureAssembly") EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly){ - User cu= (User)request.getSession().getAttribute("cu"); - efficiencyOverviewConfigureAssembly.setId(CommUtil.getUUID()); - - int code = this.efficiencyOverviewConfigureAssemblyService.save(efficiencyOverviewConfigureAssembly); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly = this.efficiencyOverviewConfigureAssemblyService.selectById(id); - model.addAttribute("efficiencyOverviewConfigureAssembly",efficiencyOverviewConfigureAssembly); - EfficiencyOverviewConfigureAssembly configure = this.efficiencyOverviewConfigureAssemblyService.selectById(efficiencyOverviewConfigureAssembly.getPid()); - if(configure!=null){ - model.addAttribute("pname",configure.getName() ); - }else if(efficiencyOverviewConfigureAssembly.getPid().equals("-1")){ - model.addAttribute("pname","根目录"); - } - return "efficiency/efficiencyOverviewConfigureAssemblyEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="efficiencyOverviewConfigureAssembly") EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly){ - int code = this.efficiencyOverviewConfigureAssemblyService.update(efficiencyOverviewConfigureAssembly); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.efficiencyOverviewConfigureAssemblyService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.efficiencyOverviewConfigureAssemblyService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/efficiency/EfficiencyOverviewConfigureController.java b/src/com/sipai/controller/efficiency/EfficiencyOverviewConfigureController.java deleted file mode 100644 index a25e046c..00000000 --- a/src/com/sipai/controller/efficiency/EfficiencyOverviewConfigureController.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigure; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.EfficiencyOverviewConfigureService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/efficiencyOverviewConfigure") -public class EfficiencyOverviewConfigureController { - @Resource - private EfficiencyOverviewConfigureService efficiencyOverviewConfigureService; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/showList.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "efficiency/efficiencyOverviewConfigureList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and unitId='"+request.getParameter("unitId")+"' "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.efficiencyOverviewConfigureService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by morder"; - - String wherestr="where 1=1 and unitId='"+request.getParameter("unitId")+"' "; - //区分能效总览和能效热力图 - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += " and type = '"+request.getParameter("type")+"' "; - } - List list = this.efficiencyOverviewConfigureService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("id", CommUtil.getUUID()); - return "efficiency/efficiencyOverviewConfigureAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="efficiencyOverviewConfigure") EfficiencyOverviewConfigure efficiencyOverviewConfigure){ - User cu= (User)request.getSession().getAttribute("cu"); -// efficiencyOverviewConfigure.setId(CommUtil.getUUID()); - efficiencyOverviewConfigure.setInsuser(cu.getId()); - efficiencyOverviewConfigure.setInsdt(CommUtil.nowDate()); - - int code = this.efficiencyOverviewConfigureService.save(efficiencyOverviewConfigure); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - EfficiencyOverviewConfigure efficiencyOverviewConfigure = this.efficiencyOverviewConfigureService.selectById(id); - model.addAttribute("efficiencyOverviewConfigure",efficiencyOverviewConfigure); - - return "efficiency/efficiencyOverviewConfigureEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="efficiencyOverviewConfigure") EfficiencyOverviewConfigure efficiencyOverviewConfigure){ - int code = this.efficiencyOverviewConfigureService.update(efficiencyOverviewConfigure); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.efficiencyOverviewConfigureService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.efficiencyOverviewConfigureService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/efficiency/EfficiencyOverviewController.java b/src/com/sipai/controller/efficiency/EfficiencyOverviewController.java deleted file mode 100644 index 363f15fd..00000000 --- a/src/com/sipai/controller/efficiency/EfficiencyOverviewController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.io.File; -import java.io.IOException; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigure; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.EfficiencyOverviewConfigureService; -import com.sipai.service.efficiency.EfficiencyOverviewMpConfigureService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/efficiencyOverview") -public class EfficiencyOverviewController { - @Resource - private EfficiencyOverviewConfigureService efficiencyOverviewConfigureService; - @Resource - private EfficiencyOverviewMpConfigureService efficiencyOverviewMpConfigureService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @RequestMapping("/showView.do") - public String showView(HttpServletRequest request, Model model){ - return "efficiency/efficiencyOverview"; - } - - @RequestMapping("/showDetailView.do") - public String showDetailView(HttpServletRequest request, Model model){ - EfficiencyOverviewMpConfigure efficiencyOverviewMpConfigure = this.efficiencyOverviewMpConfigureService.selectById(request.getParameter("id")); - model.addAttribute("efficiencyOverviewMpConfigure",efficiencyOverviewMpConfigure); - return "efficiency/efficiencyOverDetailview"; - } - - @RequestMapping("/getHisMpointJson.do") - public ModelAndView getMpointJsonFormpids(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpid") String mpid, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt){ - User cu=(User)request.getSession().getAttribute("cu"); - try{ - - String bizId = unitId; - - JSONArray mainjsondata=new JSONArray(); - com.alibaba.fastjson.JSONObject jsonObject2=new com.alibaba.fastjson.JSONObject(); - - List mplistList = mPointService.selectListByWhere(bizId, "where (id='"+mpid+"' or MPointCode='"+mpid+"')"); - - if(mplistList!=null&&mplistList.size()>0){ - List list = mPointHistoryService - .selectListByTableAWhere(unitId, "[tb_mp_"+mplistList.get(0).getMpointcode()+"]", " where (MeasureDT>='"+sdt+"' and MeasureDT<='"+edt+"') order by measuredt"); - - if(list!=null && list.size()>0){ - String mpname=mplistList.get(0).getParmname(); - String numTail="2"; - if(mplistList.get(0).getNumtail()!=null){ - numTail=mplistList.get(0).getNumtail(); - } - String changeDf="#0."; - for(int n=0;n list = this.efficiencyOverviewMpConfigureService.selectListByWhere(request.getParameter("unitId"),wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request,Model model) { - String orderstr=" order by mpname "; - - String wherestr="where 1=1 and picId='"+request.getParameter("picId")+"' "; - - List list = this.efficiencyOverviewMpConfigureService.selectListByWhere(request.getParameter("unitId"),wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - model.addAttribute("result",json); - return new ModelAndView("result"); - } - @RequestMapping("/doAssemblySave.do") - public String doAssemblySave(HttpServletRequest request, Model model ){ - String picId=request.getParameter("picId"); - String assemblyId=request.getParameter("assembly"); - - double width = 100.0; - double height = 50.0; - double x = 10.0; - double y = 10.0; - String lnglats = ""; - int sucCode=1; - String textcolor = "#FFFFFF"; - int txtsize = 12; - String bkcolor = "#000000"; - //获取组件信息 - EfficiencyOverviewConfigureAssembly assembly = efficiencyOverviewConfigureAssemblyService.selectById(assemblyId); - if(assembly!=null){ - if(assembly.getWidth()!=null){ - width = assembly.getWidth(); - } - if(assembly.getHeight()!=null){ - height = assembly.getHeight(); - } - if(assembly.getX()!=null){ - x = assembly.getX(); - } - if(assembly.getY()!=null){ - y = assembly.getY(); - } - if(assembly.getTextcolor()!=null){ - textcolor=assembly.getTextcolor(); - } - if(assembly.getTxtsize()!=null){ - txtsize=assembly.getTxtsize().intValue(); - } - if(assembly.getBkcolor()!=null){ - bkcolor=assembly.getBkcolor(); - } - if(assembly.getType()!=null && assembly.getType().equals("heat")){ - //初始区域坐标组 - lnglats += "["+x+","+y+"],["+(x+100)+","+y+"],["+(x+100)+","+(y+100)+"],["+x+","+(y+100)+"]"; - } - } - EfficiencyOverviewMpConfigure eMpConfigure=new EfficiencyOverviewMpConfigure(); - eMpConfigure.setId(CommUtil.getUUID()); - eMpConfigure.setPicid(picId); - eMpConfigure.setX(x); - eMpConfigure.setY(y); - eMpConfigure.setWidth(width); - eMpConfigure.setHeight(height); - eMpConfigure.setTxtsize(txtsize); - eMpConfigure.setTextcolor(textcolor); - eMpConfigure.setBkcolor(bkcolor); - eMpConfigure.setAssembly(assemblyId); - eMpConfigure.setLnglats(lnglats); - - int code = this.efficiencyOverviewMpConfigureService.save(eMpConfigure); - if (code == Result.SUCCESS) { - sucCode++; - } else { - - } - - model.addAttribute("result", CommUtil.toJson(sucCode)); - return "result"; - } - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model ){ - String datas=request.getParameter("datas"); - String picId=request.getParameter("picId"); - String unitId=request.getParameter("unitId"); - - String[] mpids=datas.split(","); - int sucCode=0; - for(int i=0;i list = this.efficiencyStatisticsService.selectListByWhere(" where 1=1 and unit_id='"+unitId+"' order by morder"); - String json = this.efficiencyStatisticsService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="unitId") String unitId, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")&& !pid.equals("-1")){ - EfficiencyStatistics efficiencyStatistics = this.efficiencyStatisticsService.selectById(pid); - model.addAttribute("pname",efficiencyStatistics.getName()); - } - -// model.addAttribute("id",CommUtil.getUUID()); - return "efficiency/efficiencyStatisticsAdd"; - } - - @RequestMapping("/showEfficiencyStatistics4Select.do") - public String showEfficiencyStatistics4Select(HttpServletRequest request,Model model){ - return "efficiency/efficiencyStatistics4Select"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="efficiencyStatistics") EfficiencyStatistics efficiencyStatistics){ - User cu= (User)request.getSession().getAttribute("cu"); - efficiencyStatistics.setId(CommUtil.getUUID()); - efficiencyStatistics.setInsuser(cu.getId()); - efficiencyStatistics.setInsdt(CommUtil.nowDate()); - - int code = this.efficiencyStatisticsService.save(efficiencyStatistics); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - EfficiencyStatistics efficiencyStatistics = this.efficiencyStatisticsService.selectById(id); - - EfficiencyStatistics pEfficiencyStatistics = this.efficiencyStatisticsService.selectById(efficiencyStatistics.getPid()); - if(pEfficiencyStatistics!=null){ - model.addAttribute("pname",pEfficiencyStatistics.getName()); - } - model.addAttribute("efficiencyStatistics",efficiencyStatistics); - return "efficiency/efficiencyStatisticsEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="efficiencyStatistics") EfficiencyStatistics efficiencyStatistics){ - int code = this.efficiencyStatisticsService.update(efficiencyStatistics); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.efficiencyStatisticsService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/showMPoint4Select.do") - public String showMPoint4Select(HttpServletRequest request,Model model) { - request.setAttribute("pid", request.getParameter("pid")); - request.setAttribute("mpid", request.getParameter("mpid")); - return "/work/MPoint4Select4Single"; - } - - @RequestMapping("/viewEfficiencyStatistics1.do") - public String viewEfficiencyStatistics(HttpServletRequest request,Model model) { - return "/efficiency/efficiencyStatisticsView"; - } - @RequestMapping("/getEfficiencyStatistics1.do") - public String getEfficiencyStatistics1(HttpServletRequest request,Model model) { - String unitId = request.getParameter("unitId"); - String year = request.getParameter("year"); - request.setAttribute("year", year); - List list = this.efficiencyStatisticsService.getSum1(unitId, "year", ""+year+"-01-01"); - request.setAttribute("list", list); - - for (int i = 1; i <= 9; i++) { - List listMonth = this.efficiencyStatisticsService.getSum1(unitId, "month", ""+year+"-0"+i+"-01"); - request.setAttribute("list"+i, listMonth); - } - for (int i = 10; i <= 12; i++) { - List listMonth = this.efficiencyStatisticsService.getSum1(unitId, "month", ""+year+"-"+i+"-01"); - request.setAttribute("list"+i, listMonth); - } - - return "/efficiency/efficiencyStatisticsTable1"; - } - @RequestMapping("/getEfficiencyStatistics2.do") - public String getEfficiencyStatistics2(HttpServletRequest request,Model model) { - String unitId = request.getParameter("unitId"); - String year = request.getParameter("year"); - request.setAttribute("year", year); - - HashMap> stringListHashMap = new HashMap<>(); - List list = this.efficiencyStatisticsService.getSum(unitId, "year", ""+year+"-01-01"); - request.setAttribute("list", list); - - for (int i = 1; i <= 9; i++) { - List listMonth = this.efficiencyStatisticsService.getSum(unitId, "month", ""+year+"-0"+i+"-01"); - request.setAttribute("list"+i, listMonth); - stringListHashMap.put("list"+i, listMonth); - } - for (int i = 10; i <= 12; i++) { - List listMonth = this.efficiencyStatisticsService.getSum(unitId, "month", ""+year+"-"+i+"-01"); - request.setAttribute("list"+i, listMonth); - stringListHashMap.put("list"+i, listMonth); - } - efficiencyStatisticsService.cleanMap(); - System.out.println(stringListHashMap); - return "/efficiency/efficiencyStatisticsTable2"; - } - - @RequestMapping("/exportExcel.do") - public ModelAndView exportExcel(HttpServletRequest request, HttpServletResponse response, Model model) { - String unitId = request.getParameter("unitId"); - String year = request.getParameter("year"); - request.setAttribute("year", year); - try { - efficiencyStatisticsService.exportExcel(response, unitId, year); - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } - - @RequestMapping("/getEfficiencyStatisticsDetail.do") - public String getEfficiencyStatisticsDetail(HttpServletRequest request,Model model) { - String id = request.getParameter("id"); - EfficiencyStatistics efficiencyStatistics = this.efficiencyStatisticsService.selectById(id); - - String unitId = request.getParameter("unitId"); - String year = request.getParameter("year"); - request.setAttribute("year", year); - request.setAttribute("name", efficiencyStatistics.getName()); - - List list = this.efficiencyStatisticsService.getDetail(id, unitId, "year", ""+year+"-01-01"); - request.setAttribute("list", list); - - for (int i = 1; i <= 9; i++) { - List listMonth = this.efficiencyStatisticsService.getDetail(id, unitId, "month", ""+year+"-0"+i+"-01"); - request.setAttribute("list"+i, listMonth); - } - for (int i = 10; i <= 12; i++) { - List listMonth = this.efficiencyStatisticsService.getDetail(id, unitId, "month", ""+year+"-"+i+"-01"); - request.setAttribute("list"+i, listMonth); - } - - return "/efficiency/efficiencyStatisticsTableDetail"; - } -} diff --git a/src/com/sipai/controller/efficiency/WaterSpreadDataController.java b/src/com/sipai/controller/efficiency/WaterSpreadDataController.java deleted file mode 100644 index 09905a8a..00000000 --- a/src/com/sipai/controller/efficiency/WaterSpreadDataController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.sipai.controller.efficiency; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.efficiency.WaterSpreadDataConfigure; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.PlanInteraction; -import com.sipai.service.efficiency.WaterSpreadDataConfigureService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/efficiency/waterSpreadData") -public class WaterSpreadDataController { - @Resource - private WaterSpreadDataConfigureService waterSpreadDataConfigureService; - @Resource - private MPointHistoryService mPointHistoryService; - - @RequestMapping("/showView.do") - public String showView(HttpServletRequest request, Model model){ - return "efficiency/waterSpreadDataView"; - } - - @RequestMapping("/getMpidDataType.do") - public String getMpidDataType(HttpServletRequest request, Model model, - @ModelAttribute PlanInteraction planInteraction) { - List list = this.waterSpreadDataConfigureService.selectListByWhere(" where unit_id='"+request.getParameter("unitId")+"' order by morder"); - JSONArray jsonArray = new JSONArray(); - for(int i=0;i mphlist = this.mPointHistoryService.selectAggregateList(bizid,"tb_mp_"+mpid, - " where MeasureDT between '"+sdt+"' and '"+edt+"' order by MeasureDT ", - " ParmValue,SUBSTRING(CONVERT(varchar(100), MeasureDT, 120),12,2) as MeasureDT "); - - JSONArray jsondata=new JSONArray(); - if(mphlist!=null&&mphlist.size()>0){ - for(int m=0;m clazz = (Class) Class.forName("com.sipai.entity.enums." + enumName); - //获取所有枚举实例 - Enum[] enumConstants = clazz.getEnumConstants(); - // 获取枚举中所有数据 - Method getAllEnableType4JSON = clazz.getMethod("getAllEnableType4JSON"); - jsonArray = JSONArray.parseArray(getAllEnableType4JSON.invoke(enumConstants).toString()); - System.out.println(jsonArray); - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", jsonArray); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/AccountOverviewController.java b/src/com/sipai/controller/equipment/AccountOverviewController.java deleted file mode 100644 index 100cefa8..00000000 --- a/src/com/sipai/controller/equipment/AccountOverviewController.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/TZOverview") -public class AccountOverviewController { -// @Resource -// private AssetClassService assetClassService; - - /** - * 打开设备台账总览 - */ - @RequestMapping("/showView.do") - public String showView(HttpServletRequest request,Model model) { - return "/equipment/accountOverview"; - } - -} diff --git a/src/com/sipai/controller/equipment/AssetClassController.java b/src/com/sipai/controller/equipment/AssetClassController.java deleted file mode 100644 index a3a0e110..00000000 --- a/src/com/sipai/controller/equipment/AssetClassController.java +++ /dev/null @@ -1,443 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/assetClass") -public class AssetClassController { - @Resource - private AssetClassService assetClassService; - @Resource - private EquipmentClassService equipmentClassService; - - /** - * 打开资产类型页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/assetClassList"; - } - - /** - * 资产类型树形页面 sj 2020-09-17 - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request, Model model) { - return "/equipment/assetClass4Tree"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - String equipmentBelongId = request.getParameter("equipmentBelongId"); - String equipmentBelongCode = request.getParameter("equipmentBelongCode"); - String wherestr = "where 1=1 "; - if (null != equipmentBelongId && !"".equals(equipmentBelongId)) { - List listbyebi = this.assetClassService.selectListByWhere("where equipment_belong_id='" + equipmentBelongId + "'"); - if (listbyebi != null && listbyebi.size() > 0) { - //递归查询 - //获取公司下所有子节点 - List assetClasss = assetClassService.getUnitChildrenById(listbyebi.get(0).getId()); - String ids = ""; - for (AssetClass assetClass : assetClasss) { - ids += "'" + assetClass.getId() + "',"; - } - if (ids != "") { - ids = ids.substring(0, ids.length() - 1); - wherestr += " and id in (" + ids + ") "; - } else { - wherestr += " and id='" + listbyebi.get(0).getId() + "'"; - } - } - - } else { - - } - if (null != equipmentBelongCode && !"".equals(equipmentBelongCode)) { - wherestr += " and belong_code = '" + equipmentBelongCode + "'"; - } - String orderString = " order by assetClassNumber"; - List list = this.assetClassService.selectListByWhere(wherestr + orderString); - - String json = assetClassService.getTreeListtest(null, list); - - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取资产类型的list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and assetClassName like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.assetClassService.selectListByWhere(wherestr + orderstr); - for (AssetClass assetClass : list) { - if (assetClass.getClassId() != null) { - assetClass.setEquipmentClass(this.equipmentClassService.selectById(assetClass.getClassId())); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/subscribeList4select.do") - public String subscribeList4select(HttpServletRequest request, Model model) { - String asset_class_id = request.getParameter("assetClassId"); - if (asset_class_id != null && !asset_class_id.isEmpty()) { - String[] id_Array = asset_class_id.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("purchaseId", jsonArray); - - request.setAttribute("assetClassId", request.getParameter("assetClassId")); - - } - request.setAttribute("pid", request.getParameter("pid")); - // System.out.println(request.getParameter("pid")); - return "/sparepart/assetClassList4select"; - } - - @RequestMapping("/getListtoAss.do") - public ModelAndView getListtoAss(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (assetClassName like '%" + request.getParameter("search_name") + "%' or assetClassName in (SELECT assetClassName FROM TB_AssetClass where pid in (SELECT id FROM TB_AssetClass where assetClassName like '%" + request.getParameter("search_name") + "%')) )"; - } - wherestr += "and ( class_id is null or class_id = '" + request.getParameter("pid") + "' )and active != '0' or class_id = '' "; - PageHelper.startPage(page, rows); - List list = this.assetClassService.selectListByWhere(wherestr + orderstr); - for (AssetClass assetClass : list) { - List assetClassList = assetClassService.selectListByWhere("where id = '" + assetClass.getPid() + "' "); - if (assetClassList != null && assetClassList.size() > 0) { - assetClass.set_pidname(assetClassList.get(0).getAssetclassname()); -// assetClass.set_pidname(this.assetClassService.selectListByWhere("where id = '" + assetClass.getPid() + "' ").get(0).getAssetclassname()); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 打开新增资产类型界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "equipment/assetClassAdd"; - } - - /** - * 删除一条资产类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.assetClassService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条资产类型数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.assetClassService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存新增的资产类型数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("assetClass") AssetClass assetClass) { - User cu = (User) request.getSession().getAttribute("cu"); - assetClass.setId(CommUtil.getUUID()); - assetClass.setInsuser(cu.getId()); - assetClass.setInsdt(CommUtil.nowDate()); - if (assetClass.getPid() == null || assetClass.getPid().equals("")) { - assetClass.setPid("-1"); - } - int result = this.assetClassService.save(assetClass); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + assetClass.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看资产类型信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - AssetClass assetClass = this.assetClassService.selectById(id); - model.addAttribute("assetClass", assetClass); - return "equipment/assetClassView"; - } - - /** - * 打开编辑资产类型界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - AssetClass assetClass = this.assetClassService.selectById(id); - if (assetClass.getClassId() != null) { - assetClass.setEquipmentClass(this.equipmentClassService.selectById(assetClass.getClassId())); - } - model.addAttribute("assetClass", assetClass); - return "equipment/assetClassEdit"; - } - - /** - * 更新资产类型数据 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("assetClass") AssetClass assetClass) { - User cu = (User) request.getSession().getAttribute("cu"); - assetClass.setInsuser(cu.getId()); - assetClass.setInsdt(CommUtil.nowDate()); - if (assetClass.getEquipmentBelongId() == null) { - assetClass.setEquipmentBelongId(""); - } - int result = this.assetClassService.update(assetClass); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + assetClass.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 检查资产编号是否存在 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request, Model model) { - String number = request.getParameter("assetclassnumber"); - String id = request.getParameter("id"); - if (this.assetClassService.checkNotOccupied(id, number)) { - model.addAttribute("result", "{\"valid\":" + false + "}"); - return "result"; - } else { - model.addAttribute("result", "{\"valid\":" + true + "}"); - return "result"; - } - } - - /** - * 选择资产类型 - */ - @RequestMapping("/getAssetClassForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request, Model model) { - List list = this.assetClassService.selectListByWhere("where active= '1'"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (AssetClass assetClass : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", assetClass.getId()); - jsonObject.put("text", assetClass.getAssetclassname()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - /** - * 用于设备台账 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/selectAssetTypeForType.do") - public String selectAssetTypeForType(HttpServletRequest request, Model model) { - //return "equipment/equipmentClass4select"; - request.setAttribute("equipmentBelongId", request.getParameter("equipmentBelongId")); - request.setAttribute("equipmentBelongCode", request.getParameter("equipmentBelongCode")); - return "equipment/selectAssetTypeForType"; - } - - /** - * 用于设施台账 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/selectAsset.do") - public String selectAsset(HttpServletRequest request, Model model) { - //return "equipment/equipmentClass4select"; - //request.setAttribute("equipmentBelongId",request.getParameter("equipmentBelongId")); - return "equipment/selectAsset"; - } - - /* - * 下拉筛选 - */ - @RequestMapping("/getAssetClass4Select.do") - public String getAssetClass4Select(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - String classId = request.getParameter("classId"); - String wherestr = ""; - if (request.getParameter("classId") != null && !request.getParameter("classId").isEmpty()) { - wherestr += " and id = '" + request.getParameter("classId") + "' "; - } - //List processSections = this.processSectionService.selectListByWhere("where pid = '"+companyId+"'"); - List assetClasss = this.assetClassService.selectListByWhere("where 1=1 " + wherestr + " order by assetclassnumber"); - JSONArray json = new JSONArray(); - if (assetClasss != null && assetClasss.size() > 0) { - for (int i = 0; i < assetClasss.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", assetClasss.get(i).getId()); - jsonObject.put("text", assetClasss.get(i).getAssetclassname()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 资产类型树json - */ - @RequestMapping("/getAssetClassJson.do") - public String getAssetClassJson(HttpServletRequest request, Model model) { - - List list = this.assetClassService.selectListByWhere("where 1=1 order by assetClassNumber"); - String blongId = request.getParameter("equipmentBelongId"); - //String blongId = "48748512a8d44c0f80d78463c87ee04d"; - if (blongId != null && !blongId.isEmpty()) { - List blonglist = this.assetClassService.selectListByWhere("where 1=1 and equipment_belong_id like '%" + blongId + "%' order by pid"); - List childMenu = new ArrayList<>(); - for (AssetClass assetClass : blonglist) { - if (AssetClassindexOf(childMenu, assetClass) == -1) { - childMenu.add(assetClass); - childMenu = treeMenuList(list, childMenu, assetClass.getId()); - childMenu = treeMenuList2(list, childMenu, assetClass.getPid()); - - } - } - String json = assetClassService.getTreeList(null, childMenu); - model.addAttribute("result", json); - return "result"; - } - String json = assetClassService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - public static List treeMenuList(List menuList, List childMenu, String id) { - for (AssetClass mu : menuList) { - //遍历出父id等于参数的id,add进子节点集合 - if (mu.getPid() == id || id.equals((mu.getPid()))) { - //递归遍历下一级 - treeMenuList(menuList, childMenu, mu.getId()); - if (AssetClassindexOf(childMenu, mu) == -1) { - childMenu.add(mu); - } - } - } - return childMenu; - } - - public static List treeMenuList2(List menuList, List childMenu, String pid) { - for (AssetClass mu : menuList) { - //遍历出父id等于参数的id,add进子节点集合 - if (mu.getId() == pid || pid.equals(mu.getId())) { - //递归遍历下一级 - treeMenuList2(menuList, childMenu, mu.getPid()); - if (AssetClassindexOf(childMenu, mu) == -1) { - childMenu.add(mu); - } - } - } - return childMenu; - } - - public static int AssetClassindexOf(List assetClasslist, AssetClass assetClass) { - if (assetClass != null && assetClasslist.size() > 0) { - - for (int i = 0; i < assetClasslist.size(); i++) - if (assetClass.getId().equals(assetClasslist.get(i).getId())) - return i; - } - return -1; - } - - -} diff --git a/src/com/sipai/controller/equipment/EquipmentAcceptanceApplyController.java b/src/com/sipai/controller/equipment/EquipmentAcceptanceApplyController.java deleted file mode 100644 index ab07a695..00000000 --- a/src/com/sipai/controller/equipment/EquipmentAcceptanceApplyController.java +++ /dev/null @@ -1,822 +0,0 @@ -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.dao.equipment.EquipmentAcceptanceApplyDao; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentAcceptanceApply; -import com.sipai.entity.equipment.EquipmentAcceptanceApplyDetail; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.GoodsAcceptanceApplyDetail; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentAcceptanceApplyDetailService; -import com.sipai.service.equipment.EquipmentAcceptanceApplyService; -import com.sipai.service.sparepart.GoodsAcceptanceApplyDetailService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.InStockRecordDetailService; -import com.sipai.service.sparepart.InStockRecordService; -import com.sipai.service.sparepart.PurchaseRecordDetailService; -import com.sipai.service.sparepart.PurchaseRecordService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; - -@Controller -@RequestMapping("/equipment/equipmentAcceptanceApply") -public class EquipmentAcceptanceApplyController { - @Resource - private EquipmentAcceptanceApplyService equipmentAcceptanceApplyService; - @Resource - private EquipmentAcceptanceApplyDetailService equipmentAcceptanceApplyDetailService; - @Resource - private GoodsAcceptanceApplyDetailService goodsAcceptanceApplyDetailService; - @Resource - private GoodsService goodsService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private UnitService unitService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/equipmentAcceptanceApplyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - - if (request.getParameter("searchName")!= null && !request.getParameter("searchName").isEmpty()) { - wherestr += " and apply_people_name = '"+request.getParameter("searchName")+"'"; - } - - if (request.getParameter("sdt")!= null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and apply_time >= "+"'"+request.getParameter("sdt")+"'"; - } - - if (request.getParameter("edt")!= null && !request.getParameter("edt").isEmpty()) { - wherestr += " and apply_time <= "+"'"+request.getParameter("edt")+"'"; - } - - PageHelper.startPage(page, rows); - List eaaList=equipmentAcceptanceApplyService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(eaaList); - JSONArray jsonArray = JSONArray.fromObject(eaaList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String acceptanceApplyNumber = company.getEname()+"-SBYS-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("acceptanceApplyNumber",acceptanceApplyNumber); - model.addAttribute("company",company); - model.addAttribute("cu",cu); - model.addAttribute("id", CommUtil.getUUID()); - return "/equipment/equipmentAcceptanceApplyAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAcceptanceApply eaa) { - User cu = (User) request.getSession().getAttribute("cu"); - if("".equals(eaa.getId()) || null==eaa.getId() || eaa.getId().isEmpty()){ - eaa.setId(CommUtil.getUUID()); - } - - eaa.setInsdt(CommUtil.nowDate()); - eaa.setInsuser(cu.getId()); - int result = equipmentAcceptanceApplyService.save(eaa); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+eaa.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String tableName) throws IOException { - int result=0; - EquipmentAcceptanceApply eaa=equipmentAcceptanceApplyService.selectById(id); - equipmentAcceptanceApplyService.deleteById(id); - equipmentAcceptanceApplyDetailService.deleteByWhere("where acceptance_apply_number="+"'"+eaa.getAcceptanceApplyNumber()+"'"); - goodsAcceptanceApplyDetailService.deleteByWhere("where acceptance_apply_number="+"'"+eaa.getAcceptanceApplyNumber()+"'"); - - //查询设备事故记录附件信息(TB_Process_UploadFile) - List commFileList=commonFileService.selectListByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - for(CommonFile commFile:commFileList){ - //删除服务器上的附件 - FileUtil.deleteFile(commFile.getAbspath()); - } - //删除数据库中设备事故记录对应附件信息 - commonFileService.deleteByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - result++; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String tableName) throws IOException{ - int result =0; - String[] idStr=ids.split(","); - for(String id:idStr){ - EquipmentAcceptanceApply eaa=equipmentAcceptanceApplyService.selectById(id); - equipmentAcceptanceApplyService.deleteById(id); - equipmentAcceptanceApplyDetailService.deleteByWhere("where acceptance_apply_number="+"'"+eaa.getAcceptanceApplyNumber()+"'"); - goodsAcceptanceApplyDetailService.deleteByWhere("where acceptance_apply_number="+"'"+eaa.getAcceptanceApplyNumber()+"'"); - - //查询设备事故记录附件信息(TB_Process_UploadFile) - List commFileList=commonFileService.selectListByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - for(CommonFile commFile:commFileList){ - //删除服务器上的附件 - FileUtil.deleteFile(commFile.getAbspath()); - } - //删除数据库中设备事故记录对应附件信息 - commonFileService.deleteByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - result++; - } - - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String companyId) { - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(id); - model.addAttribute("eaa", eaa); - return "/equipment/equipmentAcceptanceApplyEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAcceptanceApply eaa) { - User cu = (User) request.getSession().getAttribute("cu"); - eaa.setInsdt(CommUtil.nowDate()); - eaa.setInsuser(cu.getId()); - int result = equipmentAcceptanceApplyService.update(eaa); - String resstr="{\"res\":\""+result+"\",\"id\":\""+eaa.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - EquipmentAcceptanceApply eaa=equipmentAcceptanceApplyService.selectById(id); - model.addAttribute("eaa", eaa); - return "/equipment/equipmentAcceptanceApplyView"; - } - /** - * 获取验收设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentAcceptanceApplyDetailList.do") - public ModelAndView getInStockDetailList(HttpServletRequest request,Model model, - String acceptanceApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if(null!=acceptanceApplyNumber && !"".equals(acceptanceApplyNumber)){ - wherestr += " and acceptance_apply_number = '"+acceptanceApplyNumber+"'"; - } - PageHelper.startPage(page, rows); - List eaadList = this.equipmentAcceptanceApplyDetailService.selectListByWhere(wherestr+orderstr); - if(null!=eaadList && !eaadList.isEmpty() && eaadList.size()>0){ - for(EquipmentAcceptanceApplyDetail eaa:eaadList){ - PurchaseRecordDetail prd=purchaseRecordDetailService.selectById(eaa.getAcceptancePurchaseRecordDetailId()); - Goods goods=goodsService.selectById(prd.getGoodsId()); - eaa.setGoods(goods); - eaa.setPurchaseRecordDetail(prd); - } - } - - PageInfo pInfo = new PageInfo(eaadList); - JSONArray jsonArray = JSONArray.fromObject(eaadList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增设备验收明细,选择采购记录明细界面 - */ - @RequestMapping("/selectPurchaseRecordDetails.do") - public String doselectPurchaseRecordDetails (HttpServletRequest request,Model model,String companyId) { - List list = purchaseRecordService.selectListByWhere("where status = "+"'"+SparePartCommString.STATUS_COMEIN+"'"+" and biz_id ="+"'"+companyId+"'" ); - String purchaseRecordIds = ""; - if (list != null && list.size() > 0) { - for (PurchaseRecord item : list) { - if (purchaseRecordIds != "") { - purchaseRecordIds+= ","; - } - purchaseRecordIds+= item.getId(); - } - } - - String pdDetailIds = request.getParameter("PRDetailIds"); - if(pdDetailIds!=null && !pdDetailIds.isEmpty()){ - String[] id_Array= pdDetailIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - - request.setAttribute("PRDetailIds", jsonArray); - } - model.addAttribute("purchaseRecordIds",purchaseRecordIds); - return "/equipment/purchaseDetail4Selects"; - } - - /** - *获取采购记录的明细列表 - */ - - @RequestMapping("/getPurchaseRecordDetailList.do") - public ModelAndView getPurchaseRecordDetailList(HttpServletRequest request,Model model, - String goodsName, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - //User cu = (User) request.getSession().getAttribute("cu"); - //String type = request.getParameter("type"); - //String pid = request.getParameter("pid"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("search_code")+"'"; - } - - if (request.getParameter("pids")!= null && !request.getParameter("pids").isEmpty()) { - String pids = request.getParameter("pids"); - pids = pids.replace(",","','"); - wherestr += " and record_id in ('"+pids+"')"; - } - - - PageHelper.startPage(page, rows); - List list = this.purchaseRecordDetailService.selectListByWhere(wherestr+orderstr); - if(list.size()>0 && !list.isEmpty() && null !=list ){ - for(int i=0;i pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 采购记录明细选择采购计划明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/savePurchaseRecordDetails.do") - public String dosavePurchaseRecordDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String PRDetailIds = request.getParameter("PRDetailIds"); - String acceptanceApplyNumber = request.getParameter("acceptanceApplyNumber"); - String[] idArrary = PRDetailIds.split(","); - int result = 0; - boolean flag = false; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - List eaadList=equipmentAcceptanceApplyDetailService.selectListByWhere("where acceptance_apply_number="+"'"+acceptanceApplyNumber+"'"+"and acceptance_purchase_record_detail_id="+"'"+str+"'"); - if(null ==eaadList || eaadList.isEmpty()){ - EquipmentAcceptanceApplyDetail eaad=new EquipmentAcceptanceApplyDetail(); - eaad.setId(CommUtil.getUUID()); - eaad.setInsdt(CommUtil.nowDate()); - eaad.setInsuser(cu.getId()); - eaad.setAcceptancePurchaseRecordDetailId(str); - eaad.setAcceptanceApplyNumber(acceptanceApplyNumber); - result=equipmentAcceptanceApplyDetailService.save(eaad); - flag=true; - } - - } - } - String resultstr = "{\"res\":\""+flag+"\",\"result\":\""+result+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除设备验收明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentAcceptanceApplyDetail.do") - public String dodeletesdeletesEquipmentAcceptanceApplyDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result=equipmentAcceptanceApplyDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - //---------------------------------------------------------------------------------------------------- - /** - * 获取物品明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getGoodsAcceptanceApplyDetailList.do") - public ModelAndView getGoodsAcceptanceApplyDetailList(HttpServletRequest request,Model model, - String acceptanceApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= acceptanceApplyNumber && !"".equals(acceptanceApplyNumber)) - sb.append("and acceptance_apply_number ="+"'"+acceptanceApplyNumber+"'"); - - PageHelper.startPage(page, rows); - List gaadList=goodsAcceptanceApplyDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=gaadList && !gaadList.isEmpty()){ - for(GoodsAcceptanceApplyDetail gaad:gaadList){ - Goods goods=goodsService.selectById(gaad.getGoodsId()); - gaad.setGoods(goods); - } - } - - PageInfo pInfo = new PageInfo(gaadList); - JSONArray jsonArray = JSONArray.fromObject(gaadList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增物品明细,选择物品界面 - */ - @RequestMapping("/selectGoodsDetails.do") - public String doselectGoodsDetails (HttpServletRequest request,Model model) { - String goodsIds = request.getParameter("goodsIds"); - if(goodsIds!=null && !goodsIds.isEmpty()){ - String[] id_Array= goodsIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("goodsIds", jsonArray); - } - - return "/sparepart/goodsDetail4select"; - } - - - /** - * 设备验收申请单选择物品后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveGoodsAcceptanceApplyDetails.do") - public String dosaveGoodsAcceptanceApplyDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String goodsIds = request.getParameter("goodsIds"); - String acceptanceApplyNumber = request.getParameter("acceptanceApplyNumber"); - String[] idArrary = goodsIds.split(","); - - boolean flag = false; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - - List gaadList = goodsAcceptanceApplyDetailService.selectListByWhere("where acceptance_apply_number ='"+acceptanceApplyNumber+"' and goods_id ='"+str+"'"); - if ( null== gaadList || gaadList.isEmpty()) { - GoodsAcceptanceApplyDetail gaad=new GoodsAcceptanceApplyDetail(); - //Goods goods=goodsService.selectById(str); - gaad.setId(CommUtil.getUUID()); - gaad.setInsdt(CommUtil.nowDate()); - gaad.setInsuser(cu.getId()); - gaad.setGoodsId(str); - gaad.setAcceptanceApplyNumber(acceptanceApplyNumber); - int resultNum=goodsAcceptanceApplyDetailService.save(gaad); - if(resultNum>0){ - flag=true; - } - } - } - } - - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - - /** - * 删除设备验收物品明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentAcceptanceApplyGoodsDetail.do") - public String deletesEquipmentAcceptanceApplyGoodsDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result=goodsAcceptanceApplyDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - //---------------------------------------------------------------------------------------------------- - - /** - * 更新,启动入库审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAcceptanceApply eaa){ - User cu= (User)request.getSession().getAttribute("cu"); - eaa.setInsuser(cu.getId()); - eaa.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =equipmentAcceptanceApplyService.startProcess(eaa); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+eaa.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看设备验收处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessEquipmentAcceptanceApplyView.do") - public String showProcessEquipmentAcceptanceApplyView(HttpServletRequest request,Model model){ - String eaaId = request.getParameter("id"); - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(eaaId); - request.setAttribute("business", eaa); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(eaa); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(eaa.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_IN_STOCK_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+eaaId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_IN_STOCK_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+eaaId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = eaa.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(eaa.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - return "equipment/equipmentAcceptanceApplyExecuteView"; - } - /** - * 显示验收申请审核 - * */ - @RequestMapping("/showAuditEquipmentAcceptanceApply.do") - public String showAuditEquipmentAcceptanceApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String eaaId= pInstance.getBusinessKey(); - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(eaaId); - model.addAttribute("eaa", eaa); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/equipmentAcceptanceApplyAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/auditEquipmentAcceptanceApply.do") - public String doauditEquipmentAcceptanceApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =equipmentAcceptanceApplyService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示验收申请业务调整处理 - * */ - @RequestMapping("/showAcceptanceApplyAdjust.do")//EquipmentAcceptanceApply - public String showAcceptanceApplyAdjust(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String eaaId = pInstance.getBusinessKey(); - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(eaaId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+eaaId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("eaa", eaa); - //String companyId = request.getParameter("companyId"); - //Company company = this.unitService.getCompById(companyId); - //model.addAttribute("company",company); - return "equipment/equipmentAcceptanceApplyAdjust"; - - } - /** - * 设备验收申请调整后,再次提交审核 - * */ - @RequestMapping("/submitAcceptanceApplyAdjust.do")// - public String dosubmitAcceptanceApplyAdjust(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - equipmentAcceptanceApplyService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentAccidentController.java b/src/com/sipai/controller/equipment/EquipmentAccidentController.java deleted file mode 100644 index b2b4f82c..00000000 --- a/src/com/sipai/controller/equipment/EquipmentAccidentController.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.base.FileUploadHelper; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.equipment.EquipmentAccident; -import com.sipai.entity.equipment.EquipmentAccidentDetail; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.EquipmentLoseApplyDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.equipment.EquipmentAccidentDetailService; -import com.sipai.service.equipment.EquipmentAccidentService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; - -@Controller -@RequestMapping("equipment/equipmentAccident") -public class EquipmentAccidentController { - @Resource - private EquipmentAccidentService equipmentAccidentService; - @Resource - private EquipmentAccidentDetailService equipmentAccidentDetailService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UnitService unitService; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "equipment/equipmentAccidentList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - String sdt, String edt, String search_name,String companyId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sb = new StringBuilder("where 1=1"); - - if(null!=sdt && !"".equals(sdt)) - sb.append(" and accident_time >="+"'"+sdt+"'"); - if(null!=edt &&!"".equals(edt)) - sb.append(" and accident_time <="+"'"+edt+"'"); - if(null!=search_name && !"".equals(search_name)) - sb.append(" and worker_name like "+"'"+"%"+search_name+"%"+"'"); - - if(null!=companyId && !"".equals(companyId)) - sb.append(" and biz_id = "+"'"+companyId+"'"); - sb.append(" order by insdt desc"); - PageHelper.startPage(page, rows); - List eaList = equipmentAccidentService.selectListByWhere(sb.toString()); - JSONArray jsonArray = JSONArray.fromObject(eaList); - PageInfo pInfo = new PageInfo(eaList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu= (User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String accidentNumber = companyId+"-SBSG-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("company", company); - model.addAttribute("cu", cu); - model.addAttribute("accidentNumber", accidentNumber); - return "equipment/equipmentAccidentAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAccident ea - ){ - User cu= (User)request.getSession().getAttribute("cu"); - ea.setInsuser(cu.getId()); - ea.setInsdt(CommUtil.nowDate()); - if("".equals(ea.getId()) || null==ea.getId() || ea.getId().isEmpty()){ - ea.setId(CommUtil.getUUID()); - } - int result =equipmentAccidentService.save(ea); - String resstr="{\"res\":\""+result+"\",\"id\":\""+ea.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - EquipmentAccident ea=equipmentAccidentService.selectById(id); - model.addAttribute("ea", ea); - return "/equipment/equipmentAccidentView"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String companyId) { - EquipmentAccident ea=equipmentAccidentService.selectById(id); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - model.addAttribute("ea", ea); - model.addAttribute("id",id); - return "/equipment/equipmentAccidentEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAccident ea) { - User cu = (User) request.getSession().getAttribute("cu"); - ea.setInsuser(cu.getId()); - int result=equipmentAccidentService.update(ea); - String resstr="{\"res\":\""+result+"\",\"id\":\""+ea.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String tableName) throws IOException { - - EquipmentAccident ea=equipmentAccidentService.selectById(id); - equipmentAccidentDetailService.deleteByWhere("where accident_number="+"'"+ea.getAccidentNumber()+"'"); - //查询设备事故记录附件信息(TB_Process_UploadFile) - List commFileList=commonFileService.selectListByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - for(CommonFile commFile:commFileList){ - //删除服务器上的附件 - FileUtil.deleteFile(commFile.getAbspath()); - } - //删除数据库中设备事故记录对应附件信息 - commonFileService.deleteByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - int result =equipmentAccidentService.deleteById(id); - - model.addAttribute("result",result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String tableName) throws IOException{ - int result=0; - String idArr[]=ids.split(","); - for(String id:idArr){ - EquipmentAccident ea=equipmentAccidentService.selectById(id); - equipmentAccidentDetailService.deleteByWhere("where accident_number="+"'"+ea.getAccidentNumber()+"'"); - //查询设备事故记录附件信息(TB_Process_UploadFile) - List commFileList=commonFileService.selectListByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - for(CommonFile commFile:commFileList){ - //删除服务器上的附件 - FileUtil.deleteFile(commFile.getAbspath()); - } - //删除数据库中设备事故记录对应附件信息 - commonFileService.deleteByTableAWhere(tableName, "where masterid="+"'"+id+"'"); - result =equipmentAccidentService.deleteById(id); - result++; - } - - model.addAttribute("result",result); - return "result"; - } - - /** - * 获取事故设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentAccidentDetailList.do") - public ModelAndView getEquipmentAccidentDetailList(HttpServletRequest request,Model model, - String accidentNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= accidentNumber && !"".equals(accidentNumber)) - sb.append("and accident_number ="+"'"+accidentNumber+"'"); - - PageHelper.startPage(page, rows); - List eadList=equipmentAccidentDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=eadList && !eadList.isEmpty()){ - for(EquipmentAccidentDetail elad:eadList){ - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - elad.setEquipmentCard(ec); - } - } - PageInfo pInfo = new PageInfo(eadList); - JSONArray jsonArray = JSONArray.fromObject(eadList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增事故设备明细,选择设备台账明细界面 - */ - @RequestMapping("/selectEquipmentCardDetails.do") - public String doselectEquipmentCardDetails (HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - if(equipmentCardIds!=null && !equipmentCardIds.isEmpty()){ - String[] id_Array= equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - return "/equipment/equipmentCard4Selects"; - } - - /** - * 事故设备选择设备台账后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentAccidentDetails.do") - public String dosaveEquipmentAccidentDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String accidentNumber = request.getParameter("accidentNumber"); - String[] idArrary = equipmentCardIds.split(","); - - //BigDecimal totalMoney=new BigDecimal("0"); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - - List eladList = equipmentAccidentDetailService.selectListByWhere("where accident_number ='"+accidentNumber+"' and equipment_card_id ='"+str+"'"); - if (eladList == null || eladList.size() == 0) { - EquipmentCard ec=equipmentCardService.selectById(str); - EquipmentAccidentDetail ead = new EquipmentAccidentDetail(); - ead.setId(CommUtil.getUUID()); - ead.setInsdt(CommUtil.nowDate()); - ead.setInsuser(cu.getId()); - ead.setEquipmentCardId(ec.getId()); - ead.setAccidentNumber(accidentNumber); - - result = this.equipmentAccidentDetailService.save(ead); - if (result != 1) { - flag = false; - } - } - } - } - - /* - List eadList=equipmentAccidentDetailService.selectListByWhere("where accident_number ="+"'"+accidentNumber+"'"); - if(!eadList.isEmpty() && eadList.size()>0 && null!=eadList){ - for(EquipmentAccidentDetail elad:eadList){ - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - } - */ - //String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - /** - * 删除事故设备明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentAccidentDetail.do") - public String dodeletesEquipmentAccidentDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money){ - - //BigDecimal totalMoney=new BigDecimal(money); - boolean flag=false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - EquipmentAccidentDetail ead=equipmentAccidentDetailService.selectById(id); - //EquipmentCard ec=equipmentCardService.selectById(ead.getEquipmentCardId()); - //BigDecimal tempTotalMoney=new BigDecimal(0); - //tempTotalMoney=ec.getResidualvalue(); - //if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - //totalMoney=totalMoney.subtract(tempTotalMoney); - equipmentAccidentDetailService.deleteById(id); - flag=true; - } - //String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentBelongController.java b/src/com/sipai/controller/equipment/EquipmentBelongController.java deleted file mode 100644 index 3cd532d1..00000000 --- a/src/com/sipai/controller/equipment/EquipmentBelongController.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentClassProp; -import com.sipai.entity.equipment.EquipmentCode; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentBelongService; -import com.sipai.service.equipment.EquipmentClassPropService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentCodeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentBelong") -public class EquipmentBelongController { - - @Resource - private EquipmentBelongService equipmentBelongService ; - - @ResponseBody - @RequestMapping("/saveEquipmentBelong.do") - public Map saveEquipmentBelong(HttpServletRequest request,Model model,EquipmentBelong equipmentBelong) { - User cu=(User)request.getSession().getAttribute("cu"); - equipmentBelong.setId(CommUtil.getUUID()); - equipmentBelong.setInsdt(CommUtil.nowDate()); - equipmentBelong.setInsuser(cu.getId()); - - Map message = new HashMap<>(); - int result=equipmentBelongService.save(equipmentBelong); - - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - } - - @ResponseBody - @RequestMapping("/findEquipmentBelong.do") - public Map findEquipmentBelong(HttpServletRequest request,Model model,EquipmentBelong equipmentBelong) { - - String sql = " where 1=1 and belong_name='"+equipmentBelong.getBelongName()+"'"+" and belong_code='"+equipmentBelong.getBelongCode()+"'"; - List equipmentBelongList = equipmentBelongService.selectListByWhere(sql); - - Map message = new HashMap<>(); - if(null!=equipmentBelongList && equipmentBelongList.size()>0 && !equipmentBelongList.isEmpty()){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - - return message; - } - - /** - * 打开设备归属界面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - - return "/equipment/equipmentBelongList"; - } - /** - * 获取设备归属list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by belong_code asc"; - - String wherestr="where 1=1"; - - String searchName=request.getParameter("searchName"); - if(null!=searchName && !"".equals(searchName)){ - wherestr+=" and belong_name like '%"+searchName+"%'"; - } - - - PageHelper.startPage(page, rows); - List list = equipmentBelongService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 打开新增设备归属界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - - return "equipment/equipmentBelongAdd"; - } - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentBelongService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentBelongService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - - - - /** - * 查看设备归属信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentBelong equipmentBelong = equipmentBelongService.selectById(id); - model.addAttribute("equipmentBelong", equipmentBelong); - //return "equipment/equipmentCodeView"; - return "equipment/equipmentBelongView"; - } - /** - * 打开编辑设备归属信息界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentBelong equipmentBelong = equipmentBelongService.selectById(id); - model.addAttribute("equipmentBelong", equipmentBelong); - return "equipment/equipmentBelongEdit"; - } - /** - * 更新设备归属信息 - */ - @ResponseBody - @RequestMapping("/updateEquipmentBelong.do") - public Map doupdate(HttpServletRequest request,Model model,EquipmentBelong equipmentBelong){ - - EquipmentBelong equBelong = equipmentBelong; - Map message = new HashMap<>(); - int result=equipmentBelongService.update(equBelong); - - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - - } - - //2020-07-08 start - @RequestMapping("/showEquipmentBelongForSelect.do") - public String showEquipmentBelongForSelect(HttpServletRequest request,Model model) { - String equipmentBelongId = request.getParameter("equipmentBelongId"); - model.addAttribute("equipmentBelongId", equipmentBelongId); - return "/equipment/equipmentBelongListForSelect"; - } - //2020-07-08 end - - - //2020-07-13 start - /** - * 选择设备类型 - */ - @RequestMapping("/getEquipmentBelongForSelect.do") - public String getEquipmentBelongForSelect(HttpServletRequest request,Model model){ - List list = equipmentBelongService.selectListByWhere("where 1 = 1 order by belong_code asc"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (EquipmentBelong equipmentBelong : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", equipmentBelong.getId()); - jsonObject.put("text", equipmentBelong.getBelongName()+"-("+equipmentBelong.getBelongCode()+")"); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - //2020-07-13 end - - //2020-07-08 start - @RequestMapping("/selectEquipmentBelong.do") - public String selectEquipmentBelong(HttpServletRequest request,Model model) { - String equipmentBelongId = request.getParameter("equipmentBelongId"); - model.addAttribute("equipmentBelongId", equipmentBelongId); - return "/equipment/selectEquipmentBelong"; - } - - /* - * 下拉筛选 - */ - @RequestMapping("/getEquipmentBelong4Select.do") - public String getEquipmentBelong4Select(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - //List processSections = this.processSectionService.selectListByWhere("where pid = '"+companyId+"'"); - List equipmentBelongs = this.equipmentBelongService.selectListByWhere("where 1=1 order by belong_code"); - JSONArray json = new JSONArray(); - if(equipmentBelongs!=null && equipmentBelongs.size()>0){ - for(int i=0;i list = this.equipmentCardCameraService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getCameraEqList.do") - public ModelAndView getCameraEqList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and cameraId='"+request.getParameter("cameraId")+"' "; - - PageHelper.startPage(page, rows); - List list = this.equipmentCardCameraService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "equipment/equipmentCardCameraAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentCardCameraService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentCardCameraService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model) { - String datas = request.getParameter("datas"); - String eqid = request.getParameter("eqid"); - - String[] cids = datas.split(","); - int code = 0; - if (cids != null && cids.length > 0) { - for (String cid : cids) { - EquipmentCardCamera equipmentCardCamera = new EquipmentCardCamera(); - - equipmentCardCamera.setId(CommUtil.getUUID()); - equipmentCardCamera.setEqid(eqid); - equipmentCardCamera.setCameraid(cid); - - code += this.equipmentCardCameraService.save(equipmentCardCamera); - } - } - model.addAttribute("result", code); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCardCamera equipmentCardCamera = this.equipmentCardCameraService.selectById(id); - model.addAttribute("equipmentCardCamera", equipmentCardCamera); - return "equipment/equipmentCardCameraView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCardCamera equipmentCardCamera = this.equipmentCardCameraService.selectById(id); - model.addAttribute("equipmentCardCamera", equipmentCardCamera); - return "equipment/equipmentCardCameraEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("equipmentCardCamera") EquipmentCardCamera equipmentCardCamera) { - User cu = (User) request.getSession().getAttribute("cu"); - - int result = this.equipmentCardCameraService.update(equipmentCardCamera); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentCardCamera.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/selectListForCamera.do") - public String selectList(HttpServletRequest request, Model model) { - return "/equipment/equipmentCamera4Select"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - EquipmentCardCamera equipmentCardCamera = new EquipmentCardCamera(); - jsonOne = json.getJSONObject(i); - equipmentCardCamera.setId((String) jsonOne.get("id")); - equipmentCardCamera.setMorder(i); - result = this.equipmentCardCameraService.update(equipmentCardCamera); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentCardController.java b/src/com/sipai/controller/equipment/EquipmentCardController.java deleted file mode 100644 index 9b31bffe..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCardController.java +++ /dev/null @@ -1,6284 +0,0 @@ -package com.sipai.controller.equipment; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.document.Data; -import com.sipai.entity.equipment.*; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.*; -import com.sipai.entity.valueEngineering.EquipmentModel; -import com.sipai.entity.work.MeasurePoint_DATA; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.command.EmergencyRecordsService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.document.DataService; -import com.sipai.service.equipment.*; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.EquipmentPlanEquService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.user.*; -import com.sipai.service.valueEngineering.EquipmentModelService; -import com.sipai.service.work.MeasurePoint_DATAService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.ArchivesLog; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.webservice.client.equipment.EquipmentClient; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.avalon.framework.service.ServiceException; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.util.SocketUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Field; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/equipment") -@Api(value = "/equipment", tags = "设备台账") -public class EquipmentCardController { - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentLevelService equipmentLevelService; - @Resource - private EquipmentPlanEquService equipmentPlanEquService; - @Resource - private GeographyAreaService geographyareaService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private ProcessSectionTypeService processSectionTypeService; - @Resource - private AssetClassService assetClassService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private MPointService mPointService; - @Resource - private ExtSystemService extSystemService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private EquipmentModelService equipmentModelService; - @Resource - private DataService dataService; - @Resource - private EquipmentFileService equipmentFileService; - @Resource - private MeasurePoint_DATAService measurePoint_DATAService; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private EquipmentFittingsService equipmentFittingsService; - @Resource - private EquipmentCodeRuleService equipmentCodeRuleService; - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - @Resource - private CompanyService companyService; - @Resource - private UserService userService; - @Resource - private ContractService contractService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private EmergencyRecordsService emergencyRecordsService; - @Resource - private AbnormityService abnormityService; - @Resource - private EquipmentScrapApplyDetailService equipmentScrapApplyDetailService; - @Resource - private EquipmentScrapApplyService equipmentScrapApplyService; - - - //------------------------------------------------2020-08-15end------------------------------------------------------------------ - @RequestMapping("/getEquipmentCardByCondition.do") - public ModelAndView getEquipmentCardByCondition(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - - String curDateStart = request.getParameter("curDateStart"); - if (curDateStart != null && !"".equals(curDateStart)) { - wherestr += "and insdt >='" + curDateStart + "'"; - } - - String curDateEnd = request.getParameter("curDateEnd"); - if (curDateEnd != null && !"".equals(curDateEnd)) { - wherestr += "and insdt <='" + curDateEnd + "'"; - } - - String flag = request.getParameter("flag"); - - if ("-1".equals(flag)) { - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - //System.out.println("wherestr+orderstr"+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - - String id = request.getParameter("id"); - String pid = request.getParameter("pid"); - String equipmentCardType = request.getParameter("equipmentCardType"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - - String processSectionId = request.getParameter("processSection");//工艺段 - String equipmentCardClass = request.getParameter("search_pid1");//设备类型 - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - String name = request.getParameter("search_name"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - if (!"".equals(equipmentCardType) && equipmentCardType != null) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - // if(!"".equals(assetClass) &&assetClass!=null){ - // wherestr += " and assetClassId = '"+assetClass+"' "; - // } - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentCardID like '%" + name + "%' or equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and equipmentName like '%" + likeSea + "%'"; - } - - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.getGuaranteeTime() * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - - EquipmentCardTree ect = new EquipmentCardTree(); - ect.setId(pid); - - //20210301 关联合同筛选 - String contractid = request.getParameter("contract"); - if (null != contractid && !"".equals(contractid)) { - List contractList = this.equipmentCardPropService.selectListByWhere("where contract_id like '%" + contractid + "%'"); - StringBuilder contractIdAllStr = new StringBuilder(); - StringBuilder contractIdInAllStr = new StringBuilder("and id in ("); - if (contractList != null && contractList.size() > 0) { - for (EquipmentCardProp contract : contractList) { - contractIdAllStr.append("'" + contract.getEquipmentId() + "'" + ','); - } - String contractIdStr = contractIdAllStr.substring(0, contractIdAllStr.length() - 1); - contractIdInAllStr.append(contractIdStr + ")"); - wherestr += contractIdInAllStr.toString(); - } else { - contractIdInAllStr.append("'')"); - wherestr += contractIdInAllStr.toString(); - } - } - if ("C".equals(flag)) { - if (!"".equals(id) && null != id) { - //递归查询 - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(id); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } else { - wherestr += " and bizId='" + id + "'"; - } - - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - //System.out.println("wherestr+orderstr================================="+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - //flag in "B","P","E","S" - Map condition = new HashMap(); - condition = companyService.selectEquCardTreeConditionByPId(pid, condition); - - StringBuilder conditionSb = new StringBuilder(); - for (Map.Entry entry : condition.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - String str = " and " + key + "='" + value + "'"; - conditionSb.append(str); - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + (conditionSb.toString()) + orderstr); - - //System.out.println("wherestr+(conditionSb.toString())+orderstr========================="+wherestr+(conditionSb.toString())+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - } - //------------------------------------------------2020-08-15end------------------------------------------------------------------ - - /** - * 过保查询 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getEquipmentCardByConditionForOverdue.do") - public ModelAndView getEquipmentCardByConditionForOverdue(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - - String flag = request.getParameter("flag"); - - if ("-1".equals(flag)) { - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - //System.out.println("wherestr+orderstr"+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - - String id = request.getParameter("id"); - String pid = request.getParameter("pid"); - String equipmentCardType = request.getParameter("equipmentCardType"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - - String processSectionId = request.getParameter("processSection");//工艺段 - String equipmentCardClass = request.getParameter("search_pid1");//设备类型 - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - String name = request.getParameter("search_name"); - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - if (!"".equals(equipmentCardType) && equipmentCardType != null) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - if (!"".equals(assetClass) && assetClass != null) { - wherestr += " and assetClassId = '" + assetClass + "' "; - } - - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and equipmentName like '%" + likeSea + "%'"; - } - - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - EquipmentCardTree ect = new EquipmentCardTree(); - ect.setId(pid); - - //20210301 关联合同筛选 - String contractid = request.getParameter("contract"); - if (null != contractid && !"".equals(contractid)) { - List contractList = this.equipmentCardPropService.selectListByWhere("where contract_id like '%" + contractid + "%'"); - StringBuilder contractIdAllStr = new StringBuilder(); - StringBuilder contractIdInAllStr = new StringBuilder("and id in ("); - if (contractList != null && contractList.size() > 0) { - for (EquipmentCardProp contract : contractList) { - contractIdAllStr.append("'" + contract.getEquipmentId() + "'" + ','); - } - String contractIdStr = contractIdAllStr.substring(0, contractIdAllStr.length() - 1); - contractIdInAllStr.append(contractIdStr + ")"); - wherestr += contractIdInAllStr.toString(); - } else { - contractIdInAllStr.append("'')"); - wherestr += contractIdInAllStr.toString(); - } - } - if ("C".equals(flag)) { - if (!"".equals(id) && null != id) { - //递归查询 - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(id); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } else { - wherestr += " and bizId='" + id + "'"; - } - - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - //System.out.println("wherestr+orderstr================================="+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - //flag in "B","P","E","S" - Map condition = new HashMap(); - condition = companyService.selectEquCardTreeConditionByPId(pid, condition); - - StringBuilder conditionSb = new StringBuilder(); - for (Map.Entry entry : condition.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - String str = " and " + key + "='" + value + "'"; - conditionSb.append(str); - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + (conditionSb.toString()) + orderstr); - - //System.out.println("wherestr+(conditionSb.toString())+orderstr========================="+wherestr+(conditionSb.toString())+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - } - - //------------------------------------------------2020-08-14end------------------------------------------------------------------ - - //------------------------------------------------2020-08-15end------------------------------------------------------------------ - @RequestMapping("/getEquipmentCardByConditionForScrap.do") - public ModelAndView getEquipmentCardByConditionForScrap(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - if (sort == null) { - sort = " b.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and a.type='2' "; - - String flag = request.getParameter("flag"); - - if ("-1".equals(flag)) { - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListForScrap(wherestr); - - //System.out.println("wherestr+orderstr"+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - - String id = request.getParameter("id"); - String pid = request.getParameter("pid"); - String equipmentCardType = request.getParameter("equipmentCardType"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - - String processSectionId = request.getParameter("processSection");//工艺段 - String equipmentCardClass = request.getParameter("search_pid1");//设备类型 - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - String name = request.getParameter("search_name"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - if (!"".equals(equipmentCardType) && equipmentCardType != null) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and b.equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and b.equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and b.equipmentLevelId = '" + equipmentLevel + "' "; - } - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and b.equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and b.equipmentStatus = '" + equipmentStatus + "' "; - } - if (!"".equals(assetClass) && assetClass != null) { - wherestr += " and b.assetClassId = '" + assetClass + "' "; - } - - if (!"".equals(name) && name != null) { - wherestr += " and (b.equipmentName like '%" + name + "%' or b.equipmentModelName like '%" + name + "%' or b.equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and b.ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and b.equipmentName like '%" + likeSea + "%'"; - } - - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (b.equipmentCardID is not null and b.equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and b.equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (b.equipmentCardID is null or b.equipmentCardID = '' or b.equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.getGuaranteeTime() * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - - EquipmentCardTree ect = new EquipmentCardTree(); - ect.setId(pid); - - //20210301 关联合同筛选 - String contractid = request.getParameter("contract"); - if (null != contractid && !"".equals(contractid)) { - List contractList = this.equipmentCardPropService.selectListByWhere("where contract_id like '%" + contractid + "%'"); - StringBuilder contractIdAllStr = new StringBuilder(); - StringBuilder contractIdInAllStr = new StringBuilder("and id in ("); - if (contractList != null && contractList.size() > 0) { - for (EquipmentCardProp contract : contractList) { - contractIdAllStr.append("'" + contract.getEquipmentId() + "'" + ','); - } - String contractIdStr = contractIdAllStr.substring(0, contractIdAllStr.length() - 1); - contractIdInAllStr.append(contractIdStr + ")"); - wherestr += contractIdInAllStr.toString(); - } else { - contractIdInAllStr.append("'')"); - wherestr += contractIdInAllStr.toString(); - } - } - if ("C".equals(flag)) { - if (!"".equals(id) && null != id) { - //递归查询 - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(id); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and b.bizId in (" + companyids + ") "; - } else { - wherestr += " and b.bizId='" + id + "'"; - } - - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListForScrap(wherestr); - - //去掉维修次数大于等于2的记录 - if (list != null && list.size() > 0) { - for (int b = list.size() - 1; b >= 0; b--) { - if (list.get(b).get_equfixnum() < 2) { - list.remove(b); - } - } - } - - - //System.out.println("wherestr+orderstr================================="+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - //flag in "B","P","E","S" - Map condition = new HashMap(); - condition = companyService.selectEquCardTreeConditionByPId(pid, condition); - - StringBuilder conditionSb = new StringBuilder(); - for (Map.Entry entry : condition.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - String str = " and " + key + "='" + value + "'"; - conditionSb.append(str); - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListForScrap(wherestr + (conditionSb.toString())); - //去掉维修次数大于等于2的记录 - if (list != null && list.size() > 0) { - for (int b = list.size() - 1; b >= 0; b--) { - if (list.get(b).get_equfixnum() < 2) { - list.remove(b); - } - } - } - //System.out.println("wherestr+(conditionSb.toString())+orderstr========================="+wherestr+(conditionSb.toString())+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - } - //------------------------------------------------2020-10-20end------------------------------------------------------------------ - - @ResponseBody - @RequestMapping("/initEquipmentCardTree.do") - public com.alibaba.fastjson.JSONArray initEquipmentCardTree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - EquipmentCardTree equCardTree = new EquipmentCardTree(); - User cu = (User) request.getSession().getAttribute("cu"); - String pid = cu.getPid(); - if (unitId != null && !unitId.equals("")) { - pid = unitId; - } - Company company = companyService.selectByPrimaryKey(pid); - - com.alibaba.fastjson.JSONArray resultJsonArr = new com.alibaba.fastjson.JSONArray(); - if (null != company) { - com.alibaba.fastjson.JSONArray jsonArr = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONObject jsonObj = new com.alibaba.fastjson.JSONObject(); - String id = company.getId(); - String name = company.getSname(); - jsonObj.put("id", id); - jsonObj.put("name", name); - jsonObj.put("pid", company.getPid()); - jsonObj.put("flag", "C"); - equCardTree.setPid(id); - List equipmentCardTreeList = companyService.selectEquipmentCardTree(equCardTree); - if (null != equipmentCardTreeList && equipmentCardTreeList.size() > 0) { - for (EquipmentCardTree ect : equipmentCardTreeList) { - com.alibaba.fastjson.JSONObject jsonObjVar = new com.alibaba.fastjson.JSONObject(); - String idVar = ect.getUid(); - String nameVar = ect.getName(); - String pidVar = ect.getPid(); - String flagVar = ect.getFlag(); - jsonObjVar.put("id", idVar); - jsonObjVar.put("name", nameVar); - jsonObjVar.put("pid", pidVar); - jsonObjVar.put("flag", flagVar); - jsonArr.add(jsonObjVar); - } - jsonObj.put("children", jsonArr); - } - - resultJsonArr.add(jsonObj); - } else { - Dept dept = unitService.getDeptById(pid); - String tempPid = dept.getPid(); - Company companyVar = companyService.selectByPrimaryKey(tempPid); - com.alibaba.fastjson.JSONArray jsonArr = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONObject jsonObj = new com.alibaba.fastjson.JSONObject(); - String id = dept.getId(); - //String name = dept.getName(); - jsonObj.put("id", id); - jsonObj.put("name", companyVar.getSname()); - jsonObj.put("pid", dept.getPid()); - jsonObj.put("flag", "C"); - equCardTree.setPid(dept.getPid()); - List equipmentCardTreeList = companyService.selectEquipmentCardTree(equCardTree); - if (null != equipmentCardTreeList && equipmentCardTreeList.size() > 0) { - for (EquipmentCardTree ect : equipmentCardTreeList) { - com.alibaba.fastjson.JSONObject jsonObjVar = new com.alibaba.fastjson.JSONObject(); - String idVar = ect.getUid(); - String nameVar = ect.getName(); - String pidVar = ect.getPid(); - String flagVar = ect.getFlag(); - jsonObjVar.put("id", idVar); - jsonObjVar.put("name", nameVar); - jsonObjVar.put("pid", pidVar); - jsonObjVar.put("flag", flagVar); - jsonArr.add(jsonObjVar); - } - jsonObj.put("children", jsonArr); - } - - resultJsonArr.add(jsonObj); - } - - //System.out.println("resultJsonArr==================================="+resultJsonArr.toJSONString()); - return resultJsonArr; - } - - @RequestMapping("/showEquipmentPumpCard.do") - public String showPumplist(HttpServletRequest request, Model model) { - //return "/equipment/equipmentCardList"; - return "/equipment/equipmentCardPumpList"; - } - - @RequestMapping("/getEquipmentPumpCardByCondition.do") - public ModelAndView getEquipmentPumpCardByCondition(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - -// if(sort==null){ -// sort = " insdt "; -// } -// if(order==null){ -// order = " desc "; -// } -// String orderstr=" order by "+sort+" "+order; -// -// String wherestr="where 1=1"; -// -// String flag=request.getParameter("flag"); -// String id=request.getParameter("id"); -// String pid=request.getParameter("pid"); -// String equipmentCardType=request.getParameter("equipmentCardType"); -// String ratedPower=request.getParameter("ratedPower"); -// String likeSea=request.getParameter("likeSea"); -// -// String processSectionId = request.getParameter("processSection");//工艺段 -// String equipmentCardClass = request.getParameter("search_pid1");//设备类型 -// String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 -// String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 -// String assetClass = request.getParameter("search_pid2"); //资产类型 -// -// String isequipcode=request.getParameter("isequipcode"); //设备编码 -// -// String name = request.getParameter("search_name"); -// -// //是否是过保查询 -// String isoverdue = request.getParameter("isoverdue"); -// -// //设备归属--常排项目用 -// String equipmentBelong = request.getParameter("equipmentBelong"); -// -// if(!"".equals(equipmentCardType) &&equipmentCardType!=null){ -// wherestr += " and equipment_card_type = '"+request.getParameter("equipmentCardType")+"' "; -// } -// if(!"".equals(processSectionId) &&processSectionId!=null){ -// wherestr += " and processSectionId = '"+processSectionId+"' "; -// } -// if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null && !"-999".equals(equipmentCardClass)){ -// //遍历 -// //递归查询 -// //获取所有子节点 -// List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); -// String companyids=""; -// for(EquipmentClass unit : units){ -// companyids += "'"+unit.getId()+"',"; -// } -// if(companyids!=""){ -// companyids = companyids.substring(0, companyids.length()-1); -// wherestr += " and equipmentClassID in ("+companyids+") "; -// }else{ -// wherestr +=" and equipmentClassID='"+equipmentCardClass+"'"; -// } -// -// -// // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; -// } -// -// if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ -// wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; -// } -// //设备归属--常排项目 -// if(!"".equals(equipmentBelong) &&equipmentBelong!=null){ -// wherestr += " and equipment_belong_id = '"+equipmentBelong+"' "; -// } -// -// if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ -// wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; -// } -// // if(!"".equals(assetClass) &&assetClass!=null){ -// // wherestr += " and assetClassId = '"+assetClass+"' "; -// // } -// if(!"".equals(assetClass) &&assetClass!=null && !"-999".equals(assetClass)){ -// //遍历 -// //递归查询 -// //获取所有子节点 -// List units = assetClassService.getUnitChildrenById(assetClass); -// String companyids=""; -// for(AssetClass unit : units){ -// companyids += "'"+unit.getId()+"',"; -// } -// if(companyids!=""){ -// companyids = companyids.substring(0, companyids.length()-1); -// wherestr += " and asset_type in ("+companyids+") "; -// }else{ -// wherestr +=" and asset_type='"+assetClass+"'"; -// } -// } -// -// if(!"".equals(name) &&name!=null){ -// wherestr += " and (equipmentCardID like '%"+name+"%' or equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%') "; -// } -// -// if(!"".equals(ratedPower) && null!=ratedPower){ -// wherestr+=" and ratedPower='"+ratedPower+"'"; -// } -// if(!"".equals(likeSea) && null!=likeSea){ -// wherestr += " and equipmentName like '%"+likeSea+"%'"; -// } -// -// if(!"".equals(isequipcode) && null!=isequipcode){ -// switch (isequipcode) { -// case "0": -// wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; -// break; -// case "1": -// wherestr += " and equipmentCardID like '%null%' "; -// break; -// case "2": -// wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; -// break; -// -// default: -// break; -// } -// -// } -// -// if(isoverdue!=null && !"".equals(isoverdue) && isoverdue.equals("1")){ -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); -// Date nowdate = null; -// -// try { -// nowdate = sdf.parse(CommUtil.nowDate()); -// } catch (Exception e) { -// // TODO Auto-generated catch block -// -// } -// -// Calendar cl = Calendar.getInstance(); -// cl.setTime(nowdate); -// -// EquipmentCard equipmentCard = new EquipmentCard(); -// cl.add(Calendar.MONTH, -(equipmentCard.getGuaranteeTime()*12-3)); -// nowdate = cl.getTime(); -// //sdf.format(date); -// -// wherestr += " and install_date < '"+sdf.format(nowdate)+"' "; -// } -// -// -// -// -// // String mincadoString = id.substring(0,3); -// // String maxcadoString = id.substring(3); -// if("C".equals(flag)) -// { -// StringBuilder elIdAllStr = new StringBuilder(); -// //wherestr += " and convert(int,b.code) between '"+mincadoString+"' and '"+maxcadoString+"' "; -// List processSections = this.processSectionService.selectListByWhere(" where process_section_type_id ='"+id+"' "); -// for (ProcessSection processSection : processSections) { -// elIdAllStr.append("'"+processSection.getId()+"'"+','); -// } -// -// wherestr += " and processSectionId in ("+ elIdAllStr.substring(0, elIdAllStr.length()-1)+") "; -// }else if ("SE".equals(flag)) { -// StringBuilder elIdAllStr = new StringBuilder(); -// //wherestr += " and convert(int,b.code) between '"+mincadoString+"' and '"+maxcadoString+"' "; -// List processSections = this.processSectionService.selectListByWhere(" where process_section_type_id ='"+pid+"' "); -// for (ProcessSection processSection : processSections) { -// elIdAllStr.append("'"+processSection.getId()+"'"+','); -// } -// -// //wherestr += " and processSectionId in ("+ elIdAllStr.substring(0, elIdAllStr.length()-1)+") "; -// wherestr += " and processSectionId = '"+id+"' "; -// } -// id = "7b19e5c1efe94009b6ba777f096f4caa"; -// -// //递归查询 -// //获取公司下所有子节点 -// List units = unitService.getUnitChildrenById(id); -// String companyids=""; -// for(Unit unit : units){ -// companyids += "'"+unit.getId()+"',"; -// } -// if(companyids!=""){ -// companyids = companyids.substring(0, companyids.length()-1); -// wherestr += " and bizId in ("+companyids+") "; -// }else{ -// wherestr +=" and bizId='"+id+"' "; -// } -// -// -// PageHelper.startPage(page, rows); -// List list = this.equipmentCardService.selectPompListByWhere(wherestr+orderstr); -// -// //System.out.println("wherestr+orderstr================================="+wherestr+orderstr); -// -// PageInfo pi = new PageInfo(list); -// -// JSONArray json=JSONArray.fromObject(list); -// -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// model.addAttribute("result",result); -// return new ModelAndView("result"); - - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - - String flag = request.getParameter("flag"); - - if ("-1".equals(flag)) { - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - //System.out.println("wherestr+orderstr"+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - - String id = request.getParameter("id"); - String pid = request.getParameter("pid"); - String equipmentCardType = request.getParameter("equipmentCardType"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - - String processSectionId = request.getParameter("processSection");//工艺段 - String equipmentCardClass = request.getParameter("search_pid1");//设备类型 - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - String name = request.getParameter("search_name"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - if (!"".equals(equipmentCardType) && equipmentCardType != null) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - // if(!"".equals(assetClass) &&assetClass!=null){ - // wherestr += " and assetClassId = '"+assetClass+"' "; - // } - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentCardID like '%" + name + "%' or equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and equipmentName like '%" + likeSea + "%'"; - } - - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.getGuaranteeTime() * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - - EquipmentCardTree ect = new EquipmentCardTree(); - ect.setId(pid); - - if ("C".equals(flag)) { - if (!"".equals(id) && null != id) { - //递归查询 - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(id); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } else { - wherestr += " and bizId='" + id + "'"; - } - - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - //System.out.println("wherestr+orderstr================================="+wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - // else if("T".equals(flag)){ -// Map condition = new HashMap(); -// condition=companyService.selectpumpCardTreeConditionByPId(pid,condition); -// -// StringBuilder conditionSb = new StringBuilder(); -// -// //String key=entry.getKey(); -// String value=condition.get("processSectionType"); -// //String str = " and "+key+"='"+value+"'"; -// String str =" and processSectionId in ("+ value+") and bizId='7b19e5c1efe94009b6ba777f096f4caa' "; -// conditionSb.append(str); -// -// -// PageHelper.startPage(page, rows); -// List list = this.equipmentCardService.selectListByWhere(wherestr+(conditionSb.toString())+orderstr); -// -// //System.out.println("wherestr+(conditionSb.toString())+orderstr========================="+wherestr+(conditionSb.toString())+orderstr); -// -// PageInfo pi = new PageInfo(list); -// JSONArray json=JSONArray.fromObject(list); -// -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// model.addAttribute("result",result); -// return new ModelAndView("result"); -// } - else { - //flag in "B","P","E","S" - Map condition = new HashMap(); - condition = companyService.selectpumpCardTreeConditionByPId(pid, condition); - - StringBuilder conditionSb = new StringBuilder(); - for (Map.Entry entry : condition.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - String str = " and " + key + value; - conditionSb.append(str); - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + (conditionSb.toString()) + orderstr); - - //System.out.println("wherestr+(conditionSb.toString())+orderstr========================="+wherestr+(conditionSb.toString())+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - } - - @ResponseBody - @RequestMapping("/initEquipmentPumpCardTree.do") - public com.alibaba.fastjson.JSONArray initEquipmentPumpCardTree(HttpServletRequest request, Model model) { - -// EquipmentCardTree equCardTree = new EquipmentCardTree(); -// User cu=(User)request.getSession().getAttribute("cu"); -// -// Company company=companyService.selectByPrimaryKey("7b19e5c1efe94009b6ba777f096f4caa"); -// -// com.alibaba.fastjson.JSONArray jsonArr = new com.alibaba.fastjson.JSONArray(); -// if(null!=company){ -// com.alibaba.fastjson.JSONObject jsonObj = new com.alibaba.fastjson.JSONObject(); -// String id = company.getId(); -// String name = company.getSname(); -// jsonObj.put("id", id); -// jsonObj.put("name", name); -// jsonObj.put("pid", company.getPid()); -// //jsonObj.put("flag", "C"); -// equCardTree.setPid(id); -// //List processSectionTypes = this. processSectionTypeService.selectListByWhere("where biz_id ='"+id+"' "); -// -// //com.alibaba.fastjson.JSONArray jsonArr2 = new com.alibaba.fastjson.JSONArray(); -// -// -//// for (ProcessSectionType processSectionType : processSectionTypes) { -//// com.alibaba.fastjson.JSONObject jsonObj3 = new com.alibaba.fastjson.JSONObject(); -// //jsonArr.add(setJsonObj(processSectionType.getId(),processSectionType.getName(),id,"C")); -//// jsonArr2.add(setJsonObj(processSectionType.getId(),processSectionType.getName(),id,"C")); -// -//// List processSections = this.processSectionService.selectListGroupBy("where b.bizId = '"+id+"' group by a.id,a.name,a.morder order by a.name asc"); -//// for (ProcessSection processSection : processSections) { -//// //jsonArr.add(setJsonObj(processSection.getId(),processSection.getName(),processSectionType.getId(),"SE")); -//// com.alibaba.fastjson.JSONObject jsonObj2 = new com.alibaba.fastjson.JSONObject(); -//// jsonObj2.put("children", setJsonObj(processSection.getId(),processSection.getName(),processSectionType.getId(),"SE")); -//// jsonArr2.add(jsonObj2); -//// } -//// resultJsonArr.add(jsonArr2); -// //} -// // jsonArr.add(setJsonObj("101200","污水泵站",id,"C")); -// // jsonArr.add(setJsonObj("201230","立交泵站",id,"C")); -// // jsonArr.add(setJsonObj("231430","截流泵站",id,"C")); -// // jsonArr.add(setJsonObj("431450","补水泵站",id,"C")); -// // jsonArr.add(setJsonObj("451500","其他(移交、停用)泵站",id,"C")); -//// jsonObj.put("children", jsonArr2); -//// resultJsonArr.add(jsonObj); -// -// com.alibaba.fastjson.JSONArray jsonArr2 = new com.alibaba.fastjson.JSONArray(); -// List processSectionTypes = this. processSectionTypeService.selectListByWhere("where biz_id ='"+id+"' "); -// for (ProcessSectionType processSectionType : processSectionTypes) { -// com.alibaba.fastjson.JSONObject jsonObj2 = new com.alibaba.fastjson.JSONObject(); -// jsonObj2.put("id", processSectionType.getId()); -// jsonObj2.put("name", processSectionType.getName()); -// jsonObj2.put("pid", processSectionType.getBizId()); -// jsonObj2.put("flag", "C"); -// -// com.alibaba.fastjson.JSONArray jsonArr3 = new com.alibaba.fastjson.JSONArray(); -// List processSections = this.processSectionService.selectListGroupBy("where b.bizId = '"+id+"' and a.process_section_type_id ='"+processSectionType.getId()+"' group by a.id,a.name,a.morder order by a.name asc"); -// for (ProcessSection processSection : processSections) { -// com.alibaba.fastjson.JSONObject jsonObj3 = new com.alibaba.fastjson.JSONObject(); -// jsonObj3.put("id", processSection.getId()); -// jsonObj3.put("name", processSection.getName()); -// jsonObj3.put("pid", processSection.getProcessSectionTypeId()); -// jsonObj3.put("flag", "SE"); -// jsonArr3.add(jsonObj3); -// } -// jsonObj2.put("children", jsonArr3); -// jsonArr2.add(jsonObj2); -// } -// jsonObj.put("children", jsonArr2); -// jsonArr.add(jsonObj); -// } -// -// //System.out.println("resultJsonArr==================================="+resultJsonArr.toJSONString()); -// return jsonArr; - String unitId = request.getParameter("unitId"); - EquipmentCardTree equCardTree = new EquipmentCardTree(); - User cu = (User) request.getSession().getAttribute("cu"); - String pid = cu.getPid(); - if (unitId != null && !unitId.equals("")) { - pid = unitId; - } - Company company = companyService.selectByPrimaryKey(pid); - - com.alibaba.fastjson.JSONArray resultJsonArr = new com.alibaba.fastjson.JSONArray(); - if (null != company) { - com.alibaba.fastjson.JSONArray jsonArr = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONObject jsonObj = new com.alibaba.fastjson.JSONObject(); - String id = company.getId(); - String name = company.getSname(); - jsonObj.put("id", id); - jsonObj.put("name", name); - jsonObj.put("pid", company.getPid()); - jsonObj.put("flag", "C"); - equCardTree.setPid(id); - List equipmentCardTreeList = companyService.selectPumpCardTree(equCardTree); - if (null != equipmentCardTreeList && equipmentCardTreeList.size() > 0) { - for (EquipmentCardTree ect : equipmentCardTreeList) { - com.alibaba.fastjson.JSONObject jsonObjVar = new com.alibaba.fastjson.JSONObject(); - String idVar = ect.getUid(); - String nameVar = ect.getName(); - String pidVar = ect.getPid(); - String flagVar = ect.getFlag(); - jsonObjVar.put("id", idVar); - jsonObjVar.put("name", nameVar); - jsonObjVar.put("pid", pidVar); - jsonObjVar.put("flag", flagVar); - jsonArr.add(jsonObjVar); - } - jsonObj.put("children", jsonArr); - } - - resultJsonArr.add(jsonObj); - } else { - Dept dept = unitService.getDeptById(pid); - String tempPid = dept.getPid(); - Company companyVar = companyService.selectByPrimaryKey(tempPid); - com.alibaba.fastjson.JSONArray jsonArr = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONObject jsonObj = new com.alibaba.fastjson.JSONObject(); - String id = dept.getId(); - //String name = dept.getName(); - jsonObj.put("id", id); - jsonObj.put("name", companyVar.getSname()); - jsonObj.put("pid", dept.getPid()); - jsonObj.put("flag", "C"); - equCardTree.setPid(dept.getPid()); - List equipmentCardTreeList = companyService.selectPumpCardTree(equCardTree); - if (null != equipmentCardTreeList && equipmentCardTreeList.size() > 0) { - for (EquipmentCardTree ect : equipmentCardTreeList) { - com.alibaba.fastjson.JSONObject jsonObjVar = new com.alibaba.fastjson.JSONObject(); - String idVar = ect.getUid(); - String nameVar = ect.getName(); - String pidVar = ect.getPid(); - String flagVar = ect.getFlag(); - jsonObjVar.put("id", idVar); - jsonObjVar.put("name", nameVar); - jsonObjVar.put("pid", pidVar); - jsonObjVar.put("flag", flagVar); - jsonArr.add(jsonObjVar); - } - jsonObj.put("children", jsonArr); - } - - resultJsonArr.add(jsonObj); - } - - //System.out.println("resultJsonArr==================================="+resultJsonArr.toJSONString()); - return resultJsonArr; - } - - public com.alibaba.fastjson.JSONObject setJsonObj(String id, String name, String pid, String flag) { - com.alibaba.fastjson.JSONObject jsonObjVar = new com.alibaba.fastjson.JSONObject(); - jsonObjVar.put("id", id); - jsonObjVar.put("name", name); - jsonObjVar.put("pid", pid); - jsonObjVar.put("flag", flag); - - return jsonObjVar; - - } - //------------------------------------------------2020-08-15 end------------------------------------------------------------------ - - //------------------------------------------------2020-08-14start------------------------------------------------------------------ - @ResponseBody - @RequestMapping("/getEquipmentCardNodes.do") - public com.alibaba.fastjson.JSONArray getEquipmentCardNodes(HttpServletRequest request, Model model) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - EquipmentCardTree equipmentCardTree = new EquipmentCardTree(); - String pid = request.getParameter("pid"); - if (!"".equals(pid) && null != pid) { - equipmentCardTree.setPid(pid); - List equipmentCardTreeList = companyService.selectEquipmentCardTree(equipmentCardTree); - for (EquipmentCardTree ect : equipmentCardTreeList) { - JSONObject jsonObj = new JSONObject(); - String id = ect.getUid(); - String name = ect.getName(); - String flag = ect.getFlag(); - jsonObj.put("id", id); - jsonObj.put("name", name); - jsonObj.put("pid", pid); - jsonObj.put("flag", flag); - - jsonArray.add(jsonObj); - } - - return jsonArray; - } else { - return null; - } - - } - - @ResponseBody - @RequestMapping("/getpumpCardNodes.do") - public com.alibaba.fastjson.JSONArray getpumpCardNodes(HttpServletRequest request, Model model) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - EquipmentCardTree equipmentCardTree = new EquipmentCardTree(); - String pid = request.getParameter("pid"); - if (!"".equals(pid) && null != pid) { - equipmentCardTree.setPid(pid); - List equipmentCardTreeList = companyService.selectPumpCardTree(equipmentCardTree); - for (EquipmentCardTree ect : equipmentCardTreeList) { - JSONObject jsonObj = new JSONObject(); - String id = ect.getUid(); - String name = ect.getName(); - String flag = ect.getFlag(); - jsonObj.put("id", id); - jsonObj.put("name", name); - jsonObj.put("pid", pid); - jsonObj.put("flag", flag); - - jsonArray.add(jsonObj); - } - - return jsonArray; - } else { - return null; - } - - } - - //------------------------------------------------2020-08-14end------------------------------------------------------------------ - @ResponseBody - @RequestMapping("/equipmentCardJsonTree.do") - public com.alibaba.fastjson.JSONArray equipmentCardJsonTree(HttpServletRequest request, Model model) { - - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = cu.getPid(); - Company company = companyService.selectByPrimaryKey(companyId); - List comapnyInfoList = new ArrayList<>(); - comapnyInfoList.add(company); - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - jsonArray = companyService.getTreeJsonByCompany(comapnyInfoList, jsonArray); - //System.out.println("==============jsonArray================="+jsonArray.toString()); - - return jsonArray; - } - - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String existenceIds = request.getParameter("existenceIds");//已存在ids 已选择的不在列表中存在 - if (sort == null) { - sort = " equipmentcardid "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - - //app暂时无法更新 先修改平台 仅提供给app使用 - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - } - - - if (request.getParameter("ifFixedAssetsSelect") != null && !request.getParameter("ifFixedAssetsSelect").isEmpty()) { - if ("1".equals(request.getParameter("ifFixedAssetsSelect"))) { - wherestr += " and if_fixed_assets = '1' "; - } else { - wherestr += " and if_fixed_assets != '1' "; - } - } - - if (request.getParameter("equEntryTypeSelect") != null && !request.getParameter("equEntryTypeSelect").isEmpty()) { - if ("1".equals(request.getParameter("equEntryTypeSelect"))) { - wherestr += " and equ_entry_type = '1' "; - } else { - wherestr += " and equ_entry_type != '1' "; - } - } - - String curDateStart = request.getParameter("curDateStart"); - if (curDateStart != null && !"".equals(curDateStart)) { - wherestr += "and insdt >='" + curDateStart + "'"; - } - - String curDateEnd = request.getParameter("curDateEnd"); - if (curDateEnd != null && !"".equals(curDateEnd)) { - wherestr += "and insdt <='" + curDateEnd + "'"; - } - if (request.getParameter("equipmentstatusPage") != null && !request.getParameter("equipmentstatusPage").isEmpty()) { - wherestr += " and equipmentStatus = '" + request.getParameter("equipmentstatusPage") + "' "; - } - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - if (processSectionId != null && !"".equals(processSectionId)) { - List list = processSectionService.selectListByWhere("where code = '" + processSectionId + "' and unit_id = '\"+request.getParameter(\"unitId\")+\"'"); - if (list != null && list.size() > 0) { - wherestr += " and processSectionId = '" + list.get(0).getId() + "' "; - } - } - - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentCardID like '%" + name + "%' or equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(equipmentNames) && equipmentNames != null) { - wherestr += " and (equipmentName like '%" + equipmentNames + "%' or equipmentCardID like '%" + equipmentNames + "%' or assetNumber like '%" + equipmentNames + "%' or factory_number like '%" + equipmentNames + "%') "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - // if(!"".equals(assetClass) &&assetClass!=null){ - // wherestr += " and assetClassId = '"+assetClass+"' "; - // } - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - - //2020-07-13 start - if (request.getParameter("equipmentBelongId") != null && !request.getParameter("equipmentBelongId").isEmpty()) { - wherestr += " and equipment_belong_id = '" + request.getParameter("equipmentBelongId") + "' "; - } - - if (request.getParameter("equipmentCardType") != null && !request.getParameter("equipmentCardType").isEmpty()) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - - //2020-10-12 设备编码筛选 - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",", "','"); - wherestr += "and id in ('" + checkedIds + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("pid") + "' "; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and responsibleDepartment like '%" + request.getParameter("search_dept") + "%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification = request.getParameter("specification"); - //设备型号 - String equipmentmodel = request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel = request.getParameter("equipmentlevel"); - - if (!"".equals(specification) && null != specification) { - - wherestr += " and specification like '%" + specification + "%'"; - } - - if (!"".equals(equipmentmodel) && null != equipmentmodel) { - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr = new StringBuilder("and equipmentmodel in ("); - List emList = equipmentTypeNumberService.selectListByWhere("where name like '%" + equipmentmodel + "%'"); - for (EquipmentTypeNumber em : emList) { - emIdAllStr.append("'" + em.getId() + "'" + ','); - } - String emIdStr = emIdAllStr.substring(0, emIdAllStr.length() - 1); - emIdInAllStr.append(emIdStr + ")"); - wherestr += emIdInAllStr.toString(); - } - - if (!"".equals(equipmentlevel) && null != equipmentlevel) { - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr = new StringBuilder("and equipmentLevelId in ("); - List elList = equipmentLevelService.selectListByWhere("where levelName like '%" + equipmentlevel + "%'"); - for (EquipmentLevel el : elList) { - elIdAllStr.append("'" + el.getId() + "'" + ','); - } - String elIdStr = elIdAllStr.substring(0, elIdAllStr.length() - 1); - elIdInAllStr.append(elIdStr + ")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId = request.getParameter("equipmentBigClassId"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - if (!"".equals(equipmentBigClassId) && null != equipmentBigClassId) { - wherestr += " and equipment_big_class_id='" + equipmentBigClassId + "'"; - } - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and equipmentName like '%" + likeSea + "%'"; - } - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and id = '" + request.getParameter("equipmentId") + "' "; - } - if (existenceIds != null && !existenceIds.trim().equals("")) { - wherestr += " and id not in (" + existenceIds + ")"; - } - - //一些地方请求传参不一样 有pSectionId和processSectionId - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - List list = processSectionService.selectListByWhere("where code = '" + request.getParameter("pSectionId") + "' and unit_id = '" + request.getParameter("unitId") + "'"); - if (list != null && list.size() > 0) { - wherestr += " and processSectionId = '" + list.get(0).getId() + "' "; - } - } - - //一些地方请求传参不一样 有pSectionId和processSectionId - if (request.getParameter("processSectionId") != null && !request.getParameter("processSectionId").isEmpty()) { - List list = processSectionService.selectListByWhere("where id = '" + request.getParameter("processSectionId") + "' and unit_id = '" + request.getParameter("companyId") + "'"); - if (list != null && list.size() > 0) { - wherestr += " and processSectionId = '" + list.get(0).getId() + "' "; - } - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getListForScrap.do") - public ModelAndView getListForScrap(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " b.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and a.type='2' "; - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and b.bizId in (" + companyids + ") "; - } - } - - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and b.processsectionid = '" + request.getParameter("pSectionId") + "' "; - } - - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and b.equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - } - - - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and b.processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and b.equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and b.equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if (!"".equals(name) && name != null) { - wherestr += " and (b.equipmentName like '%" + name + "%' or b.equipmentModelName like '%" + name + "%' or b.equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(equipmentNames) && equipmentNames != null) { - wherestr += " and (b.equipmentName like '%" + equipmentNames + "%' or b.equipmentCardID like '%" + equipmentNames + "%' or b.assetNumber like '%" + equipmentNames + "%') "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and b.equipmentLevelId = '" + equipmentLevel + "' "; - } - - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and b.equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and b.equipmentStatus = '" + equipmentStatus + "' "; - } - if (!"".equals(assetClass) && assetClass != null) { - wherestr += " and b.assetClassId = '" + assetClass + "' "; - } - - //2020-07-13 start - if (request.getParameter("equipmentBelongId") != null && !request.getParameter("equipmentBelongId").isEmpty()) { - wherestr += " and b.equipment_belong_id = '" + request.getParameter("equipmentBelongId") + "' "; - } - - if (request.getParameter("equipmentCardType") != null && !request.getParameter("equipmentCardType").isEmpty()) { - wherestr += " and b.equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - - //2020-10-12 设备编码筛选 - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (b.equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and b.equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (b.equipmentCardID is null or b.equipmentCardID = '' or b.equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",", "','"); - wherestr += "and b.id in ('" + checkedIds + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and b.pid = '" + request.getParameter("pid") + "' "; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and b.responsibleDepartment like '%" + request.getParameter("search_dept") + "%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification = request.getParameter("specification"); - //设备型号 - String equipmentmodel = request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel = request.getParameter("equipmentlevel"); - - if (!"".equals(specification) && null != specification) { - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr = new StringBuilder("and b.specification in ("); - List esList = equipmentSpecificationService.selectListByWhere("where name like '%" + specification + "%'"); - - for (EquipmentSpecification es : esList) { - esIdAllStr.append("'" + es.getId() + "'" + ','); - } - - String esIdStr = esIdAllStr.substring(0, esIdAllStr.length() - 1); - esIdInAllStr.append(esIdStr + ")"); - wherestr += esIdInAllStr.toString(); - } - - if (!"".equals(equipmentmodel) && null != equipmentmodel) { - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr = new StringBuilder("and b.equipmentmodel in ("); - List emList = equipmentTypeNumberService.selectListByWhere("where name like '%" + equipmentmodel + "%'"); - for (EquipmentTypeNumber em : emList) { - emIdAllStr.append("'" + em.getId() + "'" + ','); - } - String emIdStr = emIdAllStr.substring(0, emIdAllStr.length() - 1); - emIdInAllStr.append(emIdStr + ")"); - wherestr += emIdInAllStr.toString(); - } - - if (!"".equals(equipmentlevel) && null != equipmentlevel) { - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr = new StringBuilder("and b.equipmentLevelId in ("); - List elList = equipmentLevelService.selectListByWhere("where levelName like '%" + equipmentlevel + "%'"); - for (EquipmentLevel el : elList) { - elIdAllStr.append("'" + el.getId() + "'" + ','); - } - String elIdStr = elIdAllStr.substring(0, elIdAllStr.length() - 1); - elIdInAllStr.append(elIdStr + ")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId = request.getParameter("equipmentBigClassId"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - if (!"".equals(equipmentBigClassId) && null != equipmentBigClassId) { - wherestr += " and b.equipment_big_class_id='" + equipmentBigClassId + "'"; - } - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and b.ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and b.equipmentName like '%" + likeSea + "%'"; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListForScrap(wherestr); - //去掉维修次数大于等于2的记录 - if (list != null && list.size() > 0) { - for (int b = list.size() - 1; b >= 0; b--) { - if (list.get(b).get_equfixnum() < 2) { - list.remove(b); - } - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getEquipmentMpoint4APP.do") - public String getEquipmentMpoint4APP(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - EquipmentCard equipmentCard1 = this.equipmentCardService.selectById(equipmentId); - List mPoint4APP = this.mPointService.selectListByWhere4APP(equipmentCard1.getBizid(), " where equipmentId = '" + equipmentCard1.getId() + "'"); - - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setmPoint4APP(mPoint4APP); - - JSONObject json = JSONObject.fromObject(equipmentCard); - - // String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 导入设备信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importEquipmentCard.do") - public String doimport(HttpServletRequest request, Model model) { - return "equipment/equipmentCardImport"; - } - - /** - * 导入设备信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/openExcelTemplate.do") - public String openExcelTemplate(HttpServletRequest request, Model model) { - return "equipment/openExcelTemplate"; - } - - - @RequestMapping(value = "downloadEquipmentExcel.do") - @ArchivesLog(operteContent = "导出设备信息") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String wherestr = " where 1=1 "; - String unitId = request.getParameter("unitId"); - String search_name = request.getParameter("search_name"); - String processSectionId = request.getParameter("processSectionId"); - String equipmentClassId = request.getParameter("equipmentClassId"); - String equipmentLevel = request.getParameter("equipmentLevel"); - String equipmentClassCode = request.getParameter("equipmentClassCode");//类似竹一的计量表 该页面仅显示一种设备类型的 - String ids = request.getParameter("ids");//页面勾选的设备id - - if (unitId != null && !unitId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - - //设备等级(ABC) - if (equipmentLevel != null && !equipmentLevel.isEmpty()) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //工艺段搜索 - if (processSectionId != null && !processSectionId.trim().equals("") && !processSectionId.equals("undefined")) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - //模糊搜索 - if (search_name != null && !"".equals(search_name.trim())) { - wherestr += " and (equipmentCardID like '%" + search_name + "%' or equipmentName like '%" + search_name + "%' or equipmentModelName like '%" + search_name + "%' or equipmentmanufacturer like '%" + search_name + "%') "; - } - - if (equipmentClassId != null && !equipmentClassId.trim().equals("") && !equipmentClassId.equals("undefined")) { -// wherestr += " and equipment_big_class_id = '" + equipmentClassId + "' "; - - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentClassId); - if(equipmentClass!=null && equipmentClass.getPid().equals("-1")){ - wherestr += " and equipment_big_class_id = '" + equipmentClassId + "' "; - }else{ - wherestr += " and equipmentClassID = '" + equipmentClassId + "' "; - } - } - - if (equipmentClassCode != null && !equipmentClassCode.equals("") && !equipmentClassCode.equals("undefined")) { - List list_class = equipmentClassService.selectListByWhere(" where equipment_class_code = '" + equipmentClassCode + "' and pid = '-1' "); - if (list_class != null && list_class.size() > 0) { - wherestr += " and equipment_big_class_id = '" + list_class.get(0).getId() + "' "; - } else { - wherestr += " and equipment_big_class_id = '-99' ";//如果找不到 则不显示数据 - } - } - -// System.out.println(wherestr); - - List equipmentCards = this.equipmentCardService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.equipmentCardService.downloadEquipmentExcel(response, equipmentCards); - return null; - } - - @RequestMapping(value = "downloadPlaceEquipmentRunTimeExcel.do") - @ArchivesLog(operteContent = "导出设备信息") - public ModelAndView downloadPlaceEquipmentRunTimeExcel(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String wherestr = "where 1=1"; - String equipmentIds = request.getParameter("equipmentIds"); - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - if (!"".equals(processSectionId) && processSectionId != null && !processSectionId.equals("null")) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (request.getParameter("typeStatus") != null && !request.getParameter("typeStatus").isEmpty()) { - String typeStatus = request.getParameter("typeStatus"); - if ("1".equals(typeStatus)) { - wherestr += " and assetNumber is NOT NULL "; - } - if ("2".equals(typeStatus)) { - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - - - // wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%' or assetNumber like '%" + name + "%') "; - } - - if (!"".equals(equipmentNames) && equipmentNames != null) { - wherestr += " and (equipmentName like '%" + equipmentNames + "%' or equipmentCardID like '%" + equipmentNames + "%' or assetNumber like '%" + equipmentNames + "%') "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null && !equipmentLevel.equals("null")) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - if (!"".equals(equipmentStatus) && equipmentStatus != null && !equipmentStatus.equals("null")) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - if (null != equipmentIds && !"".equals(equipmentIds)) { - equipmentIds = equipmentIds.replace(",", "','"); - wherestr += " and id in ('" + equipmentIds + "')"; - } - if (request.getParameter("search_name2") != null && !request.getParameter("search_name2").isEmpty()) { - - wherestr += " and year(GETDATE())-YEAR(open_date)+1 >= '" + request.getParameter("search_name2") + "' "; - } - if (request.getParameter("search_name3") != null && !request.getParameter("search_name3").isEmpty()) { - wherestr += " and year(GETDATE())-YEAR(open_date)+1 <= '" + request.getParameter("search_name3") + "' "; - } - String equipmentBelongId = request.getParameter("equipmentBelongId"); - if (equipmentBelongId != null && !"".equals(equipmentBelongId)) { - wherestr += " and equipment_belong_id = '" + equipmentBelongId + "' "; - } - if (request.getParameter("ifLife") != null && !request.getParameter("ifLife").isEmpty()) { - wherestr += " and year(GETDATE())-YEAR(open_date) > useAge "; - } - //wherestr +=" and year(GETDATE())-YEAR(open_date) > useAge "; - List equipmentCards = this.equipmentCardService.selectListByWhere(wherestr); - //System.out.println("equipmentCards Assetnumber:"+equipmentCards.get(0).getAssetnumber()); - //导出文件到指定目录,兼容Linux - this.equipmentCardService.downloadEquipmentExcel(response, equipmentCards); - return null; - } - - /** - * 导出设备excel表 的 模板 - * - * @throws IOException - */ - @RequestMapping(value = "downloadEquipmentExcelTemplate.do") - @ArchivesLog(operteContent = "导出设备信息模板") - public ModelAndView downloadFileTemplate(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String wherestr = " where bizId='99999999'"; - int excelCount = Integer.valueOf(request.getParameter("excelCount")); - List equipmentCards = this.equipmentCardService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.equipmentCardService.downloadEquipmentExcelTemplate(response, excelCount); - return null; - } - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - String companyId = request.getParameter("companyId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? equipmentCardService.readXls(excelFile.getInputStream(), companyId, cu.getId()) : this.equipmentCardService.readXlsx(excelFile.getInputStream(), companyId, cu.getId()); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getEquipmentName.do") - public ModelAndView getlistname(HttpServletRequest request, Model model) { - String wherestr = " where 1=1 "; - String orderstr = " order by insdt asc "; - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getEquipmentId.do") - public ModelAndView getlistid(HttpServletRequest request, Model model) { - - //String name=request.getParameter("equipmentName"); - String name = null; - try { - name = new String(request.getParameter("equipmentName").getBytes("ISO8859-1"), "UTF-8"); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - //System.out.println(name.toString()); - String wherestr = " where equipmentName='" + name + "'"; - String orderstr = " order by insdt asc "; - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 删除一个设备数据 - */ - @RequestMapping("/dodelete.do") - @ArchivesLog(operteContent = "删除设备数据") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List abnormities = abnormityService.selectListByWhere("where equipment_ids like '%" + id + "%'"); - List workorderDetails = workorderDetailService.selectListByWhere("where equipment_id = '" + id + "'"); - if (!CollectionUtils.isEmpty(abnormities) || !CollectionUtils.isEmpty(workorderDetails)) { - Result result = Result.failed("删除失败——该设备存在异常工单或维修保养工单"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(this.equipmentCardService.deleteById(id)); - //删除设备附属信息 - equipmentCardPropService.deleteByWhere("where equipment_id = '" + id + "'"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除多个设备数据 - */ - @RequestMapping("/dodeletes.do") - @ArchivesLog(operteContent = "批量删除设备数据") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] split = ids.split(","); - String errorMsg = "设备编号 ("; - String msg = ""; - for (String id : split) { - List abnormities = abnormityService.selectListByWhere("where equipment_ids like '%" + id + "%'"); - List workorderDetails = workorderDetailService.selectListByWhere("where equipment_id = '" + id + "'"); - if (!CollectionUtils.isEmpty(abnormities) || !CollectionUtils.isEmpty(workorderDetails)) { - EquipmentCard equipmentCard = equipmentCardService.selectById(id); - msg += equipmentCard.getEquipmentcardid() + ","; - ids = ids.replace(id + ",", ""); - } - } - ids = ids.replace(",", "','"); - Result result = Result.success(this.equipmentCardService.deleteByWhere("where id in ('" + ids + "')")); - //删除设备附属信息 - equipmentCardPropService.deleteByWhere("where equipment_id in ('" + ids + "')"); - if (StringUtils.isNotBlank(msg)) { - errorMsg += msg; - errorMsg += ") 删除失败——设备存在异常工单或维修保养工单"; - Result errorResult = Result.failed(errorMsg); - model.addAttribute("result", CommUtil.toJson(errorResult)); - return "result"; - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * 生成多个设备编码 - */ - @RequestMapping("/docreatcodes.do") - public String docreatcodes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - // ids=ids.replace(",","','"); - String[] idslist = ids.split(","); - // - long start, end; - start = System.currentTimeMillis(); - - - int result = 0; - for (int i = 0; i < idslist.length; i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(idslist[i]); - if (equipmentCard.getEquipmentClass() != null && !equipmentCard.getEquipmentClass().equals("") && (equipmentCard.getEquipmentcardid() == null || equipmentCard.getEquipmentcardid().equals(""))) { - String resultEquipmentClassCode = ""; - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentCard.getEquipmentClass().getId()); - if (null != equipmentClass && !"".equals(equipmentClass)) { - String resultEquipmentClassCodeStr = equipmentClassService.selectBelongAllParentId(equipmentClass, equipmentClass.getEquipmentClassCode()); - - String[] resultEquipmentClassCodeArr = resultEquipmentClassCodeStr.split(","); - for (int j = resultEquipmentClassCodeArr.length - 1; j >= 0; j--) { - resultEquipmentClassCode += resultEquipmentClassCodeArr[j]; - } - } - equipmentCard.setEquipmentClassCode(resultEquipmentClassCode); - Map autoMap = autoGenerateEquipmentCodeByCodeRule(request, model, equipmentCard); - String equipmentcode = autoMap.get("equipmentCode").toString(); - Integer waternumshort = 1; - if (autoMap.get("waterNumShort").toString() != null && !autoMap.get("waterNumShort").toString().equals("")) { - waternumshort = Integer.valueOf(autoMap.get("waterNumShort").toString()); - } - equipmentCard.setEquipmentcardid(equipmentcode); - equipmentCard.setWaterNumShort(waternumshort); - result = this.equipmentCardService.update(equipmentCard); - } - } - end = System.currentTimeMillis(); -// System.out.println("start time:" + start + "; end time:" + end + "; Run Time:" + (end - start) + "(ms)"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存设备 - */ - @RequestMapping("/dosave.do") - @ArchivesLog(operteContent = "新增设备数据") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("equipmentCard") EquipmentCard equipmentCard) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentCard.setInsuser(cu.getId()); - equipmentCard.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardService.save(equipmentCard); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentCard.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存设备附属信息 - */ - @RequestMapping("/dosaveEquipmentProp.do") - @ArchivesLog(operteContent = "新增设备附属数据") - public String dosaveEquipmentProp(HttpServletRequest request, Model model, - @ModelAttribute("equipmentCardProp") EquipmentCardProp equipmentCardProp) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentCardProp.setId(CommUtil.getUUID()); - equipmentCardProp.setInsuser(cu.getId()); - equipmentCardProp.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardPropService.save(equipmentCardProp); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentCardProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 检查厂内编号是否存在 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request, Model model) { - String number = request.getParameter("equipmentcardid"); - String id = request.getParameter("id"); - if (this.equipmentCardService.checkNotOccupied(id, number)) { - model.addAttribute("result", "{\"valid\":" + false + "}"); - return "result"; - } else { - model.addAttribute("result", "{\"valid\":" + true + "}"); - return "result"; - } - } - - /** - * 查看设备 - * sj 2021-07-27 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectByEquipmentCard4View(id); - model.addAttribute("equipmentCard", equipmentCard); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectByEquipmentId(equipmentCard.getId()); - model.addAttribute("equipmentCardProp", equipmentCardProp); - return "equipment/equipmentCardView"; - } - - /** - * 查看附属设备详情 - */ - @RequestMapping("/attachedEquipmentView.do") - public String doattachedEquipmentView(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - model.addAttribute("equipmentCard", equipmentCard); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectByEquipmentId(equipmentCard.getId()); - model.addAttribute("equipmentCardProp", equipmentCardProp); - return "equipment/attachedEquipmentView"; - } - - @RequestMapping("/getEquipmentcardById.do") - public String getEquipmentcardById(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - - PageHelper.startPage(1, 5); - List list = this.equipmentCardService.selectListByWhere("where id ='" + id + "' order by id"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新设备 - */ - @RequestMapping("/doupdate.do") - @ArchivesLog(operteContent = "更新设备数据") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("equipmentCard") EquipmentCard equipmentCard) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentCard.setInsuser(cu.getId()); - equipmentCard.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardService.update(equipmentCard); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentCard.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新设备附属信息 - */ - @RequestMapping("/doupdateEquipmentProp.do") - @ArchivesLog(operteContent = "更新设备附属数据") - public String doupdateEquipmentProp(HttpServletRequest request, Model model, - @ModelAttribute("equipmentCard") EquipmentCardProp equipmentCardProp) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.equipmentCardPropService.update(equipmentCardProp); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentCardProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 同步设备的GIS坐标 - * - * @param request - * @param model - * @param companyId - * @return - * @throws javax.xml.rpc.ServiceException - * @throws ServiceException - * @throws IOException - */ - @RequestMapping("/synGISCoordinate.do") - public String synGISCoordinate(HttpServletRequest request, Model model, - @RequestParam(value = "companyId") String companyId) throws ServiceException, javax.xml.rpc.ServiceException, IOException { - int result = 0; - List list = this.equipmentCardService.selectListByWhereForGIS("where bizId = '" + companyId + "'"); - String URL = ""; - String extstr = "where status='true' and type ='" + ExtSystem.Type_GIS + "'"; - List extSystems = this.extSystemService.selectListByWhere(extstr); - if (extSystems != null && extSystems.size() > 0) { - URL = extSystems.get(0).getUrl(); - } - String equipmentNumbers = ""; - for (EquipmentCard equipmentCard : list) { - if (equipmentNumbers != "") { - equipmentNumbers += ","; - } - equipmentNumbers += equipmentCard.getEquipmentcardid(); - } - String connectIdStr = "{\"connectIdStr\":\"" + equipmentNumbers + "\"}"; - String equipmentGIS = new EquipmentClient().getGISCoordinate(connectIdStr, URL); - JSONObject jsonObject = JSONObject.fromObject(equipmentGIS); - JSONArray dataArray = JSONArray.fromObject(jsonObject.getString("data")); - for (int i = 0; i < dataArray.size(); i++) { - JSONObject dataObj = dataArray.getJSONObject(i); - String xCoord = dataObj.getString("locationx"); - String yCoord = dataObj.getString("locationy"); - String equipmentCardId = dataObj.getString("connectid"); - EquipmentCard equipmentCard = this.equipmentCardService.getEquipmentByEquipmentCardId(equipmentCardId); - if (null != equipmentCard) { - equipmentCard.setxCoord(xCoord); - equipmentCard.setyCoord(yCoord); - //保存设备的GIS坐标 - result += this.equipmentCardService.update(equipmentCard); - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/showEquipmentCardForSelect.do") - public String showEquipmentCardForSelect(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - String companyId = request.getParameter("companyId"); - //用于触发判断是否单一设备的函数 - String isone = request.getParameter("isone"); - model.addAttribute("equipmentId", equipmentId); - model.addAttribute("companyId", companyId); - model.addAttribute("isone", isone); - return "/equipment/equipmentCardListForSelect"; - } - - //年度计划使用 - @RequestMapping("/showEquipmentCardForSelect2.do") - public String showEquipmentCardForSelect2(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - String companyId = request.getParameter("companyId"); - //用于触发判断是否单一设备的函数 - String isone = request.getParameter("isone"); - model.addAttribute("equipmentId", equipmentId); - model.addAttribute("companyId", companyId); - model.addAttribute("isone", isone); - return "/equipment/equipmentCardListForSelect2"; - } - - @RequestMapping("/showEquipmentForSelect.do") - public String showEquipmentForSelect(HttpServletRequest request, Model model) { - return "/equipment/equipmentListForSelect"; - } - - /** - * 设备选择测量点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showMPointForEquipmentSelects.do") - public String showMPointForEquipmentSelects(HttpServletRequest request, Model model) { - String mPointIds = request.getParameter("mPointIds"); - if (mPointIds != null && !mPointIds.isEmpty()) { - String[] id_Array = mPointIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("mpoints", jsonArray); - } - return "/work/mPointListForEquipmentSelects"; - } - - /** - * 将设备id存到选择的测量点中 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateEquipmentAndMPointRelation.do") - public String doupdateEquipmentAndMPointRelation(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentId") String equipmentId, - @RequestParam(value = "companyId") String companyId, - @RequestParam(value = "mPointIds") String mPointIds) { - int result = 0; - if (mPointIds != null && !mPointIds.isEmpty()) { - String[] id_Array = mPointIds.split(","); - for (String mPointId : id_Array) { - MPoint mPoint = this.mPointService.selectById(companyId, mPointId); - if (null != mPoint) { - mPoint.setEquipmentid(equipmentId); - result += this.mPointService.update(companyId, mPoint); - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 将设备绑定的测量点删除,即解除设备和测量点的绑定关系 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deletesEquipmentAndMPointRelation.do") - public String dodeletesEquipmentAndMPointRelation(HttpServletRequest request, Model model, - @RequestParam(value = "companyId") String companyId, - @RequestParam(value = "mPointIds") String mPointIds) { - int result = 0; - if (mPointIds != null && !mPointIds.isEmpty()) { - String[] id_Array = mPointIds.split(","); - for (String mPointId : id_Array) { - MPoint mPoint = this.mPointService.selectById(companyId, mPointId); - if (null != mPoint) { - mPoint.setEquipmentid(""); - result += this.mPointService.update(companyId, mPoint); - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 设备选择资料页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showFileForEquipmentSelects.do") - public String showFileForEquipmentSelects(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - String fileIds = request.getParameter("fileIds"); - if (fileIds != null && !fileIds.isEmpty()) { - String[] id_Array = fileIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("fileIds", jsonArray); - } - List datas = this.dataService.selectListByWhere("where biz_id = '" + companyId + "'"); - String dataIds = ""; - if (null != datas && datas.size() > 0) { - for (Data data : datas) { - if (dataIds != "") { - dataIds += ","; - } - dataIds += data.getId(); - } - } - model.addAttribute("dataIds", dataIds); - return "/document/fileForEquipmentSelects"; - } - - /** - * 将选择的资料与设备保存到关联表中 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentFile.do") - public String dosaveEquipmentFile(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentId") String equipmentId, - @RequestParam(value = "fileIds") String fileIds) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (null != fileIds && !fileIds.isEmpty() && null != equipmentId && !equipmentId.isEmpty()) { - String[] id_Array = fileIds.split(","); - for (String fileId : id_Array) { - String whereStr = "where equipment_id = '" + equipmentId + "' and file_id = '" + fileId + "'"; - List equipmentFiles = this.equipmentFileService.selectListByWhere(whereStr); - if (null != equipmentFiles && equipmentFiles.size() > 0) { - result++; - } else { - EquipmentFile equipmentFile = new EquipmentFile(); - equipmentFile.setId(CommUtil.getUUID()); - equipmentFile.setInsdt(CommUtil.nowDate()); - equipmentFile.setInsuser(cu.getId()); - equipmentFile.setEquipmentId(equipmentId); - equipmentFile.setFileId(fileId); - result += this.equipmentFileService.save(equipmentFile); - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除设备与资料的关联 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deletesEquipmentFile.do") - public String dodeletesEquipmentFile(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentId") String equipmentId, - @RequestParam(value = "fileIds") String fileIds) { - int result = 0; - fileIds = fileIds.replace(",", "','"); - result = this.equipmentFileService.deleteByWhere("where file_id in ('" + fileIds + "') and equipment_id = '" + equipmentId + "'"); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 设备配置 ,可多选 - */ - @RequestMapping("/showEquipmentCardForSelects.do") - public String showEquipmentCardForSelects(HttpServletRequest request, Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - return "/equipment/equipmentCardListForSelects"; - } - - /** - * 主设备选择附属设备 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showEquipmentForAttachedSelects.do") - public String showEquipmentForAttachedSelects(HttpServletRequest request, Model model) { - String equipmentIds = request.getParameter("attachedIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - return "/equipment/equipmentCardListForAttachedSelects"; - } - - /** - * 主设备与附属设备关联保存 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveAttachedEquipment.do") - public String saveAttachedEquipment(HttpServletRequest request, Model model, - @RequestParam(value = "attachedIds") String attachedIds, - @RequestParam(value = "equipmentId") String equipmentId) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (null != attachedIds && !attachedIds.isEmpty() && null != equipmentId && !equipmentId.isEmpty()) { - String[] id_Array = attachedIds.split(","); - for (String attachedId : id_Array) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(attachedId); - if (null != equipmentCard) { - equipmentCard.setPid(equipmentId); - result += this.equipmentCardService.update(equipmentCard); - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 解除主设备与附属设备关联保存 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deletesAttachedEquipment.do") - public String deletesAttachedEquipment(HttpServletRequest request, Model model, - @RequestParam(value = "attachedIds") String attachedIds) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (null != attachedIds && !attachedIds.isEmpty()) { - String[] id_Array = attachedIds.split(","); - for (String attachedId : id_Array) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(attachedId); - if (null != equipmentCard) { - equipmentCard.setPid(""); - result += this.equipmentCardService.update(equipmentCard); - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 巡检计划设备选择,返回方式采用调用上一界面的方法 - * (按工艺段--巡检点--设备) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showEquipmentCardForPatrolPlanSelects.do") - public String showEquipmentCardForPatrolPlanSelects(HttpServletRequest request, Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - request.setAttribute("equipmentIds", request.getParameter("equipmentIds")); - return "/equipment/equipmentCardListForPatrolPlanSelects"; - } - - /** - * 设备关联巡检点回传设备方法 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/patroPointEquipmentCardForSelect.do") - public String patroPointEquipmentCardForSelect(HttpServletRequest request, Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String bizId = request.getParameter("bizId"); - String processSectionId = request.getParameter("processSectionId"); - String whereStr = "where id in ('" + equipmentCardIds.replace(",", "','") + "')";// and bizId = '"+bizId+"' - List list = this.equipmentCardService.selectSimpleListByWhere(whereStr); - model.addAttribute("equipmentCards", JSONArray.fromObject(list)); - model.addAttribute("processSectionId", processSectionId); - return "timeefficiency/patroPointEquipmentCardListForSelect"; - } - - /** - * 设备关联业务通用方法(该界面获取设备ids) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentCardIdsForSelect.do") - public String getEquipmentCardIdsForSelect(HttpServletRequest request, Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String bizId = request.getParameter("bizId"); - String processSectionId = request.getParameter("processSectionId"); - String whereStr = "where id in ('" + equipmentCardIds.replace(",", "','") + "')";// and bizId = '"+bizId+"' - List list = this.equipmentCardService.selectSimpleListByWhere(whereStr); - model.addAttribute("equipmentCards", JSONArray.fromObject(list)); - model.addAttribute("processSectionId", processSectionId); - return "equipment/equipmentCardListForSelectShow"; - } - - /*补录中设备配置 ,可多选,无厂区id不显示数据*/ - @RequestMapping("/showEquipmentCardForSupplementSelects.do") - public String showEquipmentCardForSupplementSelects(HttpServletRequest request, Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - return "/equipment/equipmentCardListForSupplementSelects"; - } - - /** - * 异常上报中选择设备 ,可多选,无厂区id和工艺段id不显示数据 - */ - @RequestMapping("/showEquipmentCardForAbnormitySelects.do") - public String showEquipmentCardForAbnormitySelects(HttpServletRequest request, Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - return "/equipment/equipmentCardListForAbnormitySelects"; - } - - /*工单设备分配和调度*/ - @RequestMapping("/showEquipCardForDistrictWork.do") - public String showEquipCardForDistrictWork(HttpServletRequest request, Model model) { - return "/equipment/equipCardListForDistrictWork"; - } - - /*编辑设备预约*/ - @RequestMapping("/doeditEquipCardForDistrictWork.do") - public String doeditEquipCardForDistrictWork(HttpServletRequest request, Model model) { - return "/equipment/equipCardListForDistrictWork"; - } - - /*工单设备分配和调度*/ - @RequestMapping("/showEquipCardsArrangement.do") - public String showEquipCardsArrangement(HttpServletRequest request, Model model) { - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String date = format.format(new Date()); - request.setAttribute("dt", date); - return "/equipment/equipCardsArrangement"; - } - - @RequestMapping("/getEquipmentCard2.do") - public ModelAndView getequipmentcard2(HttpServletRequest request, Model model) { - - String orderstr = " order by E.insdt asc"; - User cu = (User) request.getSession().getAttribute("cu"); - - String wherestr = " where 1=1 "; - - if (request.getParameter("search_local") != null && !request.getParameter("search_local").isEmpty()) { - wherestr += "and areaid like '%" + request.getParameter("search_local") + "%' "; - } - List list = this.equipmentCardService.getEquipmentCard(wherestr + orderstr); - List list1 = this.equipmentCardService.getEquipStatusByList(list); - - JSONArray json = JSONArray.fromObject(list1); - //String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 设备统计分析图表 - */ - @RequestMapping("/showEquipmentStatisticalChart.do") - public String showEquipmentStatisticalChart(HttpServletRequest request, Model model) { - return "/equipment/equipmentStatisticalChart"; - } - - /** - * 查询设备的数量和在用数量 - */ - /* @RequestMapping("/getEquipmentNumber.do") - public String getEquipmentNumber(HttpServletRequest request,Model model) { - String wherestr = "where 1=1"; - if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - wherestr += " and bizId = '"+request.getParameter("companyId")+"' "; - } - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processsectionid = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("equipmentLevel")!=null && !request.getParameter("equipmentLevel").isEmpty()){ - wherestr += " and equipmentLevelId = '"+request.getParameter("equipmentLevel")+"' "; - } - if(request.getParameter("equipmentClass")!=null && !request.getParameter("equipmentClass").isEmpty()){ - wherestr += " and equipmentClassId = '"+request.getParameter("equipmentClass")+"' "; - } - List equipmentCards = this.equipmentCardService.selectListByWhere4Count(wherestr); - List useEquipmentCards = this.equipmentCardService.selectListByWhere4Count(wherestr+"and equipmentStatus = '"+CommString.Active_True+"'"); - String result="{\"equipmentNumber\":"+equipmentCards.size()+",\"useEquipmentNumber\":"+useEquipmentCards.size()+"}"; - model.addAttribute("result",result); - return "result"; - }*/ - - /** - * 查询设备的数量和在用数量 - */ - @RequestMapping("/getEquipmentNumber.do") - public String getEquipmentNumber(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - String companyId = ""; - StringBuilder sql = new StringBuilder(wherestr); - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and bizId = '" + request.getParameter("companyId") + "' "; - companyId = request.getParameter("companyId"); - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and processsectionid = '" + request.getParameter("pSectionId") + "' "; - sql.append(" and processsectionid = '" + request.getParameter("pSectionId") + "' "); - } - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - sql.append(" and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "); - } - if (request.getParameter("equipmentClass") != null && !request.getParameter("equipmentClass").isEmpty()) { - wherestr += " and equipmentClassId = '" + request.getParameter("equipmentClass") + "' "; - sql.append(" and equipmentClassId = '" + request.getParameter("equipmentClass") + "' "); - } - - /* int equipmentNumber=0; - int useEquipmentNumber=0; - Company company=unitService.getCompById(companyId); - List companyList= companyEquipmentCardCountService.findAllCompanyByCompanyId(company); - List companyListVar=companyList; - CompanyEquipmentCardCountService. allcompanyList=new ArrayList<>(); - for(Company companyVar:companyListVar){ - List equipmentCards = this.equipmentCardService.selectListByWhere4Count(sql.toString()+" and bizId='"+companyVar.getId()+"'"); - List useEquipmentCards = this.equipmentCardService.selectListByWhere4Count(sql.toString()+" and bizId='"+companyVar.getId()+"'"+"and equipmentStatus = '"+CommString.Active_True+"'"); - equipmentNumber+=equipmentCards.size(); - useEquipmentNumber+=useEquipmentCards.size(); - } - - String result="{\"equipmentNumber\":"+equipmentNumber+",\"useEquipmentNumber\":"+useEquipmentNumber+"}"; - model.addAttribute("result",result);*/ - String companyIds = ""; - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - companyIds += " and bizId in (" + companyids + ") "; - } - List equipmentCards = this.equipmentCardService.selectListByWhere4Count(sql.toString() + companyIds); - List useEquipmentCards = this.equipmentCardService.selectListForStatus(sql.toString() + companyIds + "and b.name = '" + CommString.EQUIPMENTCARD_STATUS_ON + "'"); - //获取设备总价值 - List equipmentValue = this.equipmentCardService.getEquipmentValue(sql.toString() + companyIds); - String equipmentValueAll = ""; - if (equipmentValue != null && equipmentValue.size() > 0) { -// System.out.println(equipmentValue.get(0)); - if (equipmentValue.get(0) != null) { - equipmentValueAll = equipmentValue.get(0).get_equipmentValueAll().toString(); - } else { - equipmentValueAll = "0"; - } - - } else { - equipmentValueAll = "0"; - } - String result = "{\"equipmentNumber\":" + equipmentCards.size() + ",\"useEquipmentNumber\":" + useEquipmentCards.size() + ",\"EquipmentWorth\":" + equipmentValueAll + "}"; - model.addAttribute("result", result); - return "result"; - } - - //List allcompanyList=new ArrayList<>(); - //------------------------------------------------------------------------------------------------------- - //查询传入companyId的所有子厂区 - /*public List findAllCompanyByCompanyId(Company company){ - List companyList=unitService.getCompaniesByWhere("where pid='"+company.getId()+"'"); - if(companyList.isEmpty() || companyList.size()==0){ - allcompanyList.add(company); - }else{ - for(Company companyVar:companyList){ - findAllCompanyByCompanyId(companyVar); - } - } - return allcompanyList; - }*/ - //------------------------------------------------------------------------------------------------------- - - /** - * 查询设备的故障类型数据 - */ - @RequestMapping("/getEquipmentFaultsNumber.do") - public String getEquipmentFaultsNumber(HttpServletRequest request, Model model) { - ArrayList list = new ArrayList<>(); - ArrayList faultNumberlist = new ArrayList<>(); - ArrayList faultNamelist = new ArrayList<>(); - - String type = request.getParameter("type"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Calendar cal = Calendar.getInstance(); - - String wherestr = "where 1=1 "; - String companyId = ""; - StringBuilder sqlWhere = new StringBuilder(wherestr); - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and companyid = '" + request.getParameter("companyId") + "'"; - companyId = request.getParameter("companyId"); - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and process_section_id = '" + request.getParameter("pSectionId") + "' "; - sqlWhere.append(" and process_section_id = '" + request.getParameter("pSectionId") + "' "); - } - if (("week").equals(type)) { - // 获得当前日期是一个星期的第几天 - int dayWeek = cal.get(Calendar.DAY_OF_WEEK); - if (1 == dayWeek) { - cal.add(Calendar.DAY_OF_MONTH, -1); - } - // 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一 - cal.setFirstDayOfWeek(Calendar.MONDAY); - - // 获得当前日期是一个星期的第几天 - int day = cal.get(Calendar.DAY_OF_WEEK); - // 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值 - cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day); - sdt = sdf.format(cal.getTime()); - edt = sdf.format(Calendar.getInstance().getTime()); - /* cal.get(Calendar.MONDAY); - //本周周一的日期 - Date mondayDate =cal.getTime(); - sdt = sdf.format(mondayDate); - //本周周日的日期 - cal.add(Calendar.DATE, 6); - Date sundayDate =cal.getTime(); - edt = sdf.format(sundayDate);*/ - - } - if (("month").equals(type)) { - cal.set(Calendar.DATE, 1); - //本月的第一天 - Date firstDay = cal.getTime(); - sdt = sdf.format(firstDay); - //本月的最后一天 - cal.add(Calendar.MONTH, 1); - cal.add(Calendar.DATE, -1); - Date lastDay = cal.getTime(); - edt = sdf.format(lastDay); - } - if (("year").equals(type)) { - Date date = new Date(); - String nowYear = sdf.format(date).substring(0, 4); - sdt = nowYear + "-01-01"; - edt = nowYear + "-12-31"; - } - - if (sdt != null && !sdt.isEmpty()) { - wherestr += " and insdt >='" + sdt + "' "; - sqlWhere.append(" and insdt >='" + sdt + "' "); - //System.out.println("sdt=================="+sdt); - } - if (edt != null && !edt.isEmpty()) { - wherestr += " and insdt <='" + edt + "' "; - sqlWhere.append(" and insdt <='" + edt + "' "); - //System.out.println("edt=================="+edt); - } - - - String companyIds = ""; - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - companyIds += " and companyid in (" + companyids + ") "; - } - - //System.out.println("sqlWhere========================="+sqlWhere.toString()); - - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere(sqlWhere.toString() + companyIds); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (null != maintenanceDetail.getProblemtypeid() && !maintenanceDetail.getProblemtypeid().isEmpty()) { - String[] problemType = maintenanceDetail.getProblemtypeid().split(","); - for (int i = 0; i < problemType.length; i++) { - list.add(problemType[i]); - } - } - } - - /* if(!"".equals(companyId) && null!=companyId){ - Company company = unitService.getCompById(companyId); - List companyList = companyEquipmentCardCountService - .findAllCompanyByCompanyId(company); - List companyListVar = companyList; - CompanyEquipmentCardCountService.allcompanyList = new ArrayList<>(); - - for(Company companyVar:companyListVar){ - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere(sqlWhere.toString()+" and companyid ='"+companyVar.getId()+"'"); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (null != maintenanceDetail.getProblemtypeid() && !maintenanceDetail.getProblemtypeid().isEmpty()) { - String[] problemType = maintenanceDetail.getProblemtypeid().split(","); - for (int i = 0; i < problemType.length; i++) { - list.add(problemType[i]); - } - } - } - } - - }else{ - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere(wherestr); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (null != maintenanceDetail.getProblemtypeid() && !maintenanceDetail.getProblemtypeid().isEmpty()) { - String[] problemType = maintenanceDetail.getProblemtypeid().split(","); - for (int i = 0; i < problemType.length; i++) { - list.add(problemType[i]); - } - } - } - }*/ - - - String[] falultId = list.toArray(new String[list.size()]); - - Map faultMap = new HashMap(); - for (String fault : falultId) { - if (faultMap.containsKey(fault)) { - int val = (Integer.parseInt(faultMap.get(fault)) + 1); - faultMap.put(fault, val + ""); - } else { - faultMap.put(fault, "1"); - } - } - for (java.util.Map.Entry fa : faultMap.entrySet()) { - faultNamelist.add(fa.getKey()); - faultNumberlist.add(fa.getValue()); - } - for (int i = 0; i < faultNamelist.size(); i++) { - LibraryFaultBloc libraryFaultBloc = this.libraryFaultBlocService.selectById(faultNamelist.get(i)); - faultNamelist.set(i, libraryFaultBloc.getFaultName()); - } - String result = "{\"faultNumber\":" + JSONArray.fromObject(faultNumberlist) + ",\"faultName\":" + JSONArray.fromObject(faultNamelist) + "}"; - //System.out.println(result); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getEquipmentEfficiency.do") - public String getEquipmentEfficiency(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - String tablename = ""; - String orderstr = "order by MeasureDT desc"; - String topNum = ""; - ArrayList xAisArray = new ArrayList(); - ArrayList valueArray = new ArrayList(); - if (request.getParameter("bizId") != null && !request.getParameter("bizId").isEmpty()) { - if (request.getParameter("efficiencyType") != null && !request.getParameter("efficiencyType").isEmpty()) { - tablename = request.getParameter("efficiencyType"); - } else { - tablename = EquipmentCommStr.EquipmentEfficiency_1H; - } - - if (request.getParameter("topNum") != null && !request.getParameter("topNum").isEmpty()) { - topNum = " top " + request.getParameter("topNum"); - } else { - topNum = " top 12 "; - } - List list = mPointHistoryService.selectTopNumListByTableAWhere(request.getParameter("bizId"), topNum, tablename, wherestr + orderstr); - - for (int i = list.size() - 1; i >= 0; i--) { - if (tablename.equals(EquipmentCommStr.EquipmentEfficiency_1H) || tablename.equals(EquipmentCommStr.EquipmentEfficiency_8H)) { - xAisArray.add(list.get(i).getMeasuredt().substring(11, 13)); - valueArray.add(list.get(i).getParmvalue()); - }//else if (tablename.equals(EquipmentCommStr.EquipmentEfficiency_1M)) - } - - //x轴对象与柱状图颜色 - - } - String result = "{\"xAis\":" + JSONArray.fromObject(xAisArray) + ",\"value\":" + JSONArray.fromObject(valueArray) + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 根据厂区id,获取所有设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList4APP.do") - public ModelAndView getList4APP(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by insdt desc"; - String wherestr = "where 1=1"; - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and processsectionid = '" + request.getParameter("pSectionId") + "' "; - } - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - } - if (request.getParameter("equipmentClass") != null && !request.getParameter("equipmentClass").isEmpty()) { - wherestr += " and equipmentClassId = '" + request.getParameter("equipmentClass") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - //wherestr += " and ( equipmentName like '%"+request.getParameter("search_name")+"%' "; - wherestr += " and ( equipmentName like '%" + request.getParameter("search_name") + "%' "; - wherestr += " or areaID like '%" + request.getParameter("search_name") + "%'"; - wherestr += " or equipmentCardID like '%" + request.getParameter("search_name") + "%')"; - - } - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and equipmentCardID like '%" + request.getParameter("search_code") + "%' "; - - } - if (request.getParameter("equipmentCardClass") != null && !request.getParameter("equipmentCardClass").isEmpty()) { - wherestr += " and equipmentClassID = '" + request.getParameter("equipmentCardClass") + "' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",", "','"); - wherestr += "and id in ('" + checkedIds + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("pid") + "' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 查询设备的利用率 - */ - @RequestMapping("/getEquipmentUseRate.do") - public String getEquipmentUseRate(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and bizId = '" + request.getParameter("companyId") + "' "; - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and processsectionid = '" + request.getParameter("pSectionId") + "' "; - } - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - } - if (request.getParameter("equipmentClass") != null && !request.getParameter("equipmentClass").isEmpty()) { - wherestr += " and equipmentClassId = '" + request.getParameter("equipmentClass") + "' "; - } - List equipmentCards = this.equipmentCardService.selectListByWhere4Count(wherestr); - List useEquipmentCards = this.equipmentCardService.selectListByWhere4Count(wherestr + "and equipmentStatus = '" + CommString.Active_True + "'"); - double equipmentUtilization = (useEquipmentCards.size()) / (equipmentCards.size()); - //System.out.println(equipmentUtilization); - model.addAttribute("result", String.valueOf(equipmentUtilization)); - return "result"; - } - - /** - * 查询本月消缺数量 - */ - @RequestMapping("/getFinishDefectNumber.do") - public String getFinishDefectNumber(HttpServletRequest request, Model model) { - SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - Date nowDate = calendar.getTime(); - GregorianCalendar gcLast = (GregorianCalendar) Calendar.getInstance(); - gcLast.setTime(nowDate); - //本月开始时间 - gcLast.set(Calendar.DAY_OF_MONTH, 1); - String sdt = sFormat.format(gcLast.getTime()); - //本月结束时间 - calendar.set(Calendar.DATE, calendar.getActualMaximum(calendar.DATE)); - String edt = sFormat.format(calendar.getTime()); - String wherestr = "where type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "' and status = '" + MaintenanceDetail.Status_Finish + "'"; - wherestr += "and insdt > '" + sdt + "' and insdt < '" + edt + "'"; - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere(wherestr); - //System.out.println(maintenanceDetails.size()); - model.addAttribute("result", String.valueOf(maintenanceDetails.size())); - return "result"; - } - - /** - * 设备运行总台时 - */ - @RequestMapping("/getEquipmentRunTime.do") - public String getEquipmentRunTime(HttpServletRequest request, Model model) { - BigDecimal totalRunTime = new BigDecimal(0); - SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - Date nowDate = calendar.getTime(); - GregorianCalendar gcLast = (GregorianCalendar) Calendar.getInstance(); - gcLast.setTime(nowDate); - //本月开始时间 - gcLast.set(Calendar.DAY_OF_MONTH, 1); - String sdt = sFormat.format(gcLast.getTime()); - //本月结束时间 - calendar.set(Calendar.DATE, calendar.getActualMaximum(calendar.DATE)); - String edt = sFormat.format(calendar.getTime()); - List equipmentCards = this.equipmentCardService.selectListByWhere4Count("where 1=1"); - if (equipmentCards != null && equipmentCards.size() > 0) { - for (EquipmentCard item : equipmentCards) { - List mPoints = this.mPointService.selectListByWhere("0531NK", "where equipmentId = '" + item.getId() + "' and MPointCode like '%RT_A%' "); - if (mPoints != null && mPoints.size() > 0) { - List mplist = mPointHistoryService - .selectListByTableAWhere("0531NK", "TB_MP_" + mPoints.get(0).getMpointcode() - , " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT desc"); - if (mplist != null && mplist.size() > 0) { - BigDecimal dayRunTime = mplist.get(0).getParmvalue().subtract(mplist.get(mplist.size() - 1).getParmvalue()); - totalRunTime = totalRunTime.add(dayRunTime); - } - } - } - } -// System.out.println(totalRunTime); - model.addAttribute("result", String.valueOf(totalRunTime)); - return "result"; - } - - /** - * 设备停机率 - */ - @RequestMapping("/getEquipmentStopRate.do") - public String getEquipmentStopRate(HttpServletRequest request, Model model) { - //设备当月运行总台时 - BigDecimal totalRunTime = new BigDecimal(0); - - double stopFNumber = 0; - SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - Date nowDate = calendar.getTime(); - GregorianCalendar gcLast = (GregorianCalendar) Calendar.getInstance(); - gcLast.setTime(nowDate); - //本月开始时间 - gcLast.set(Calendar.DAY_OF_MONTH, 1); - String sdt = sFormat.format(gcLast.getTime()); - //本月结束时间 - calendar.set(Calendar.DATE, calendar.getActualMaximum(calendar.DATE)); - String edt = sFormat.format(calendar.getTime()); - List equipmentCards = this.equipmentCardService.selectListByWhere4Count("where 1=1"); - if (equipmentCards != null && equipmentCards.size() > 0) { - for (EquipmentCard item : equipmentCards) { - List mPoints = this.mPointService.selectListByWhere("0531NK", "where equipmentId = '" + item.getId() + "' and MPointCode like '%RT_A%' "); - if (mPoints != null && mPoints.size() > 0) { - List mplist = mPointHistoryService - .selectListByTableAWhere("0531NK", "TB_MP_" + mPoints.get(0).getMpointcode() - , " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT desc"); - if (mplist != null && mplist.size() > 0) { - BigDecimal dayRunTime = mplist.get(0).getParmvalue().subtract(mplist.get(mplist.size() - 1).getParmvalue()); - totalRunTime = totalRunTime.add(dayRunTime); - } - } - //故障停机时间 - List mPointRun = this.mPointService.selectListByWhere("0531NK", "where equipmentId = '" + item.getId() + "' and MPointCode like '%RUN%' "); - List mPointF = this.mPointService.selectListByWhere("0531NK", "where equipmentId = '" + item.getId() + "' and MPointCode like '%F%' "); - if (mPointRun != null && mPointRun.size() > 0 && mPointF != null && mPointF.size() > 0) { - List mplistRun = mPointHistoryService - .selectListByTableAWhere("0531NK", "TB_MP_" + mPointRun.get(0).getMpointcode() - , " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT desc"); - List mplistF = mPointHistoryService - .selectListByTableAWhere("0531NK", "TB_MP_" + mPointF.get(0).getMpointcode() - , " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT desc"); - double stopNumber = 0; - for (MPointHistory mPointHistory : mplistRun) { - if (mPointHistory.getParmvalue().intValue() == 0) { - stopNumber++; - } - } - double FNumber = 0; - for (MPointHistory mPointHistory : mplistF) { - if (mPointHistory.getParmvalue().intValue() == 1) { - FNumber++; - } - } - if (stopNumber >= FNumber) { - stopFNumber = stopFNumber + FNumber; - } else { - stopFNumber = stopFNumber + stopNumber; - } - - } - } - } - double stopTime = (stopFNumber * 5) / 60; - double mayRunTime = stopTime + totalRunTime.doubleValue(); - double stopRate = (stopTime / mayRunTime); - BigDecimal bigDecimal = new BigDecimal(stopRate); - stopRate = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); -// System.out.println(stopRate); - model.addAttribute("result", String.valueOf(stopRate)); - return "result"; - } - - /** - * 设备经济寿命模型 - */ - @RequestMapping("/showEquipmentAge.do") - public String showEquipmentAge(HttpServletRequest request, Model model) { - return "equipment/equipmentAgeList"; - } - - @RequestMapping("/getEquipmentAgeList.do") - public ModelAndView getEquipmentAgeList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " dateadd(year,physical_life,E.install_date), dateadd(year, technical_life, E.install_date),dateadd(year,economic_life,E.install_date)"; - } else if (sort.equals("physicalLifeTime")) { - sort = " dateadd(year,physical_life,E.install_date)"; - } else if (sort.equals("technicalLifeTime")) { - sort = " dateadd(year, technical_life, E.install_date)"; - } else if (sort.equals("economicLifeTime")) { - sort = " dateadd(year,economic_life,E.install_date)"; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and E.bizId in (" + companyids + ") "; - } - } - if (request.getParameter("equipmentClass") != null && !request.getParameter("equipmentClass").isEmpty()) { - wherestr += " and equipmentClassId = '" + request.getParameter("equipmentClass") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (equipmentName like '%" + request.getParameter("search_name") + "%' or equipmentCardID like '%" - + request.getParameter("search_name") + "%')"; - } - if (request.getParameter("alarmLevel") != null && !request.getParameter("alarmLevel").isEmpty()) { - if (request.getParameter("alarmLevel").toString().equals(EquipmentCommStr.EquipmentLife_All)) {//预警+报警 - List list = this.equipmentModelService.selectListByWhere("where status = '" + CommString.Active_True + "'"); - String value = list.get(0).getParam1();//获取预警范围值 - wherestr += " and ((physical_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) < " + value - + " or (technical_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) < " + value - + " or (economic_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) < " + value + ")"; - } else if (request.getParameter("alarmLevel").toString().equals(EquipmentCommStr.EquipmentLife_Alarm)) {//报警 - wherestr += " and ((physical_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) < 0 " - + " or (technical_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) < 0 " - + " or (economic_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) < 0 )"; - } else if (request.getParameter("alarmLevel").toString().equals(EquipmentCommStr.EquipmentLife_Warning)) {//预警 - List list = this.equipmentModelService.selectListByWhere("where status = '" + CommString.Active_True + "'"); - String value = list.get(0).getParam1();//获取预警范围值 - wherestr += " and ((physical_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) between 0 and " + value - + " or (technical_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) between 0 and " + value - + " or (economic_life - datediff(year, E。install_date,CONVERT(varchar,GETDATE(),120))) between 0 and " + value + ")"; - } - } - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and E.bizId in (" + companyids + ") "; - } - } - - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and processsectionid = '" + request.getParameter("pSectionId") + "' "; - } - - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - } - - - String processSectionId = request.getParameter("processSectionId"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - } - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentCardID like '%" + name + "%' or equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(equipmentNames) && equipmentNames != null) { - wherestr += " and (equipmentName like '%" + equipmentNames + "%' or equipmentCardID like '%" + equipmentNames + "%' or assetNumber like '%" + equipmentNames + "%') "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - - //2020-07-13 start - if (request.getParameter("equipmentBelongId") != null && !request.getParameter("equipmentBelongId").isEmpty()) { - wherestr += " and equipment_belong_id = '" + request.getParameter("equipmentBelongId") + "' "; - } - - if (request.getParameter("equipmentCardType") != null && !request.getParameter("equipmentCardType").isEmpty()) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - - //2020-10-12 设备编码筛选 - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",", "','"); - wherestr += "and id in ('" + checkedIds + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("pid") + "' "; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and responsibleDepartment like '%" + request.getParameter("search_dept") + "%'"; - } - //20200319 start========================================================================== - //设备规格 - String specification = request.getParameter("specification"); - //设备型号 - String equipmentmodel = request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel = request.getParameter("equipmentlevel"); - - if (!"".equals(specification) && null != specification) { - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr = new StringBuilder("and specification in ("); - List esList = equipmentSpecificationService.selectListByWhere("where name like '%" + specification + "%'"); - - for (EquipmentSpecification es : esList) { - esIdAllStr.append("'" + es.getId() + "'" + ','); - } - - String esIdStr = esIdAllStr.substring(0, esIdAllStr.length() - 1); - esIdInAllStr.append(esIdStr + ")"); - wherestr += esIdInAllStr.toString(); - } - - if (!"".equals(equipmentmodel) && null != equipmentmodel) { - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr = new StringBuilder("and equipmentmodel in ("); - List emList = equipmentTypeNumberService.selectListByWhere("where name like '%" + equipmentmodel + "%'"); - for (EquipmentTypeNumber em : emList) { - emIdAllStr.append("'" + em.getId() + "'" + ','); - } - String emIdStr = emIdAllStr.substring(0, emIdAllStr.length() - 1); - emIdInAllStr.append(emIdStr + ")"); - wherestr += emIdInAllStr.toString(); - } - - if (!"".equals(equipmentlevel) && null != equipmentlevel) { - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr = new StringBuilder("and equipmentLevelId in ("); - List elList = equipmentLevelService.selectListByWhere("where levelName like '%" + equipmentlevel + "%'"); - for (EquipmentLevel el : elList) { - elIdAllStr.append("'" + el.getId() + "'" + ','); - } - String elIdStr = elIdAllStr.substring(0, elIdAllStr.length() - 1); - elIdInAllStr.append(elIdStr + ")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId = request.getParameter("equipmentBigClassId"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - if (!"".equals(equipmentBigClassId) && null != equipmentBigClassId) { - wherestr += " and equipment_big_class_id='" + equipmentBigClassId + "'"; - } - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and equipmentName like '%" + likeSea + "%'"; - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardPropService.selectAgeListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 通过设备id获取手动与自动测量点信息和设备信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPointByEquipment4APP.do") - public ModelAndView getMenualMPointByEquipment4APP(HttpServletRequest request, Model model) { - String result = ""; - String bizid = request.getParameter("bizid").toString(); - try { - if (request.getParameter("id") != null && !request.getParameter("id").isEmpty()) { - //获取设备详情 - EquipmentCard equipmentCard = this.equipmentCardService.selectById(bizid, request.getParameter("id")); - String wherestrM = " where [equipmentId] = '" + request.getParameter("id").toString() + "' and biztype = '" + MPoint.Flag_BizType_Hand + "'"; - List mPointListM = this.mPointService.selectListByWhere4APP(bizid, wherestrM); - String wherestrA = " where [equipmentId] = '" + request.getParameter("id").toString() + "' and biztype <> '" + MPoint.Flag_BizType_Hand + "'"; - List mPointListA = this.mPointService.selectListByWhere4APP(bizid, wherestrA); - JSONArray jsonEqu = JSONArray.fromObject(equipmentCard); - JSONArray jsonMPointM = JSONArray.fromObject(mPointListM); - JSONArray jsonMPointA = JSONArray.fromObject(mPointListA); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + jsonEqu + ",\"content2\":" + jsonMPointM + ",\"content3\":" + jsonMPointA + "}"; - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - e.printStackTrace(); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新设备状态并通过测量点ID更新手动测量点数据以及历史值 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateMenualMPointByJSON.do") - public ModelAndView updateMenualMPointById(HttpServletRequest request, Model model) { - String result = ""; - String bizid = request.getParameter("bizid").toString(); - try { - //先更新设备状态 - if (request.getParameter("equid") != null && !request.getParameter("equid").isEmpty()) { - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setId(request.getParameter("equid").toString()); - equipmentCard.setEquipmentstatus(request.getParameter("status")); - int res = this.equipmentCardService.update(equipmentCard); - if (res != 0) { - if (request.getParameter("mPointJSON") != null && !request.getParameter("mPointJSON").isEmpty()) { - JSONArray json = JSONArray.fromObject(request.getParameter("mPointJSON")); - result = this.mPointService.saveMenualMPoint(json, bizid); - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - e.printStackTrace(); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 编辑显示百度地图 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/equipmentCardMapEdit.do") - public String showEquipmentCardMap(HttpServletRequest request, Model model, String lng, String lat, String equipmentName, String companyName) { - model.addAttribute("equipmentName", equipmentName); - model.addAttribute("lng", lng); - model.addAttribute("lat", lat); - model.addAttribute("companyName", companyName); - return "/equipment/equipmentCardMapEdit"; - } - - @RequestMapping("/modifyEquipmentCardPostionInfo.do") - public ModelAndView modifyEquipmentCardPostionInfo(HttpServletRequest request, Model model, - String lng, String lat, String id) { - - EquipmentCard ec = new EquipmentCard(); - ec.setId(id); - ec.setLng(lng); - ec.setLat(lat); - int resultNum = equipmentCardService.update(ec); - boolean mark = false; - if (resultNum >= 1) { - mark = true; - } - String result = "{\"result\":\"" + mark + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 查看显示百度地图 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/equipmentCardMapView.do") - public String equipmentCardMapView(HttpServletRequest request, Model model, String lng, String lat, String equipmentName, String companyName) { - model.addAttribute("equipmentName", equipmentName); - model.addAttribute("lng", lng); - model.addAttribute("lat", lat); - model.addAttribute("companyName", companyName); - return "/equipment/equipmentCardMapView"; - } - - //2020-07-09 start - @ResponseBody - @RequestMapping("/findEquipmentCardByEquipmentCodeRule.do") - public Map showEquipmentBelongForSelect(HttpServletRequest request, Model model) { - //EquipmentCard equipmentCard=null; - Map result = new HashMap<>(); - String equipmentCodeRule = request.getParameter("equipmentCodeRule"); - List equipmentCardList = equipmentCardService.selectListByWhere(" where equipment_code_id='" + equipmentCodeRule + "'" + "order by water_num_short desc"); - if (equipmentCardList.size() > 0 && null != equipmentCardList && !equipmentCardList.isEmpty()) { - Integer waterNumShort = equipmentCardList.get(0).getWaterNumShort(); - result.put("result", waterNumShort + 1); - } else { - result.put("result", ""); - } - return result; - } - - @ResponseBody - @RequestMapping("/findEquipmentCardIdByEquipmentCardId.do") - public Map findEquipmentCardIdByEquipmentCardId(HttpServletRequest request, Model model) { - //EquipmentCard equipmentCard=null; - Map result = new HashMap<>(); - String equipmentCardId = request.getParameter("equipmentCardId"); - List equipmentCardList = equipmentCardService.selectListByWhere(" where equipmentCardID='" + equipmentCardId + "'"); - if (equipmentCardList.size() > 0 && null != equipmentCardList && !equipmentCardList.isEmpty()) { - result.put("result", true); - } else { - result.put("result", false); - } - return result; - } - - //2020-07-09 end - - //2020-07-12 start - @ResponseBody - @RequestMapping("/autoGenerateEquipmentCodeByCodeRule.do") - public Map autoGenerateEquipmentCodeByCodeRule(HttpServletRequest request, Model model, EquipmentCard equipmentCard) { - // System.out.println(CommUtil.nowDate()); - Map equipmentCodeRes = new HashMap<>(); - StringBuilder zeroSb = new StringBuilder(""); - StringBuilder equipmentCodeSb = new StringBuilder(""); - Integer maxWaterNumShort = 1; - //int codeFieldIsNum=0; - - //List orderByEquipmentCardList=equipmentCardService.selectListByWhere(" where 1=1 order by water_num_short desc"); - DynamicCodeCondition dynamicCodeCondition = new DynamicCodeCondition(); - List equipmentCodeRuleList = equipmentCodeRuleService.selectListByWhere(" where 1=1 and type='0' order by morder asc"); - if (equipmentCodeRuleList.size() > 0 && null != equipmentCodeRuleList && !equipmentCodeRuleList.isEmpty()) { - for (int i = 0; i < equipmentCodeRuleList.size(); i++) { - - String codeField = equipmentCodeRuleList.get(i).getCodeField(); - - try { - if (codeField.matches("[0-9]+")) { - List EquipmentCardList = equipmentCardService.selectTop1ListByWhere(" where equipmentCardID like '" + equipmentCodeSb.toString() + "%' order by water_num_short desc"); - - zeroSb = new StringBuilder(); - int waterNumLength = equipmentCodeRuleList.get(i).getCodeNum(); - - if (null != EquipmentCardList && EquipmentCardList.size() > 0 && !EquipmentCardList.isEmpty()) { - - Integer currMaxWaterNum = 0; - - if (equipmentCard.getEquipmentcardid() != null && !equipmentCard.getEquipmentcardid().equals("")) { - //equipmentcardid 不等于null说明是编辑时修改 - if (!equipmentCard.getEquipmentcardid().contains(equipmentCodeSb)) { - currMaxWaterNum = EquipmentCardList.get(0).getWaterNumShort() + 1; // 目前是根据最大的流水号去加1 - } else { - //如果是手残误点,前边都一样,流水号不变 - currMaxWaterNum = equipmentCard.getWaterNumShort(); - } - } else { - if (EquipmentCardList.get(0).getWaterNumShort() != null) { - //System.out.println("-------:"+equipmentCardList.get(0)); - currMaxWaterNum = EquipmentCardList.get(0).getWaterNumShort() + 1; // 目前是根据最大的流水号去加1 - } else { - currMaxWaterNum = 1; - - } - } - - - String currMaxWaterNumStr = String.valueOf(currMaxWaterNum); - if (waterNumLength > currMaxWaterNumStr.length()) { - int subNum = waterNumLength - currMaxWaterNumStr.length(); - for (int j = 0; j < subNum; j++) { - zeroSb.append("0"); - } - equipmentCodeSb.append(zeroSb.append(currMaxWaterNum)); - } else if (waterNumLength == currMaxWaterNumStr.length()) { - equipmentCodeSb.append(currMaxWaterNum); - } - maxWaterNumShort = currMaxWaterNum; - - } else { - if (waterNumLength > 0) { - for (int j = 1; j < waterNumLength; j++) { - zeroSb.append("0"); - } - zeroSb.append("1"); - } else if (waterNumLength == 0) { - zeroSb.append("0"); - } - equipmentCodeSb.append(zeroSb); - } - - } else if (codeField.matches("[^a-zA-Z0-9]+")) { - equipmentCodeSb.append(codeField); - } else { - - if ("equipmentClassCode".equals(codeField)) { - Field field = equipmentCard.getClass().getDeclaredField(codeField); - field.setAccessible(true); - String equClasssCodeValue = (String) field.get(equipmentCard); - equipmentCodeSb.append(equClasssCodeValue); - } else { - Field field = equipmentCard.getClass().getDeclaredField(codeField); - field.setAccessible(true); - String ecFieldValue = (String) field.get(equipmentCard); - if (null != ecFieldValue && !"".equals(ecFieldValue)) { - String tableName = equipmentCodeRuleList.get(i).getTableName(); - dynamicCodeCondition.setId(ecFieldValue); - dynamicCodeCondition.setTableColumn(equipmentCodeRuleList.get(i).getTableColumn()); - dynamicCodeCondition.setTableName(tableName); - String dynCodeFieidValue = equipmentCodeRuleService.dynameicSelectCodeByDynInfo(dynamicCodeCondition); - equipmentCodeSb.append(dynCodeFieidValue); - } - } - - } - - } catch (Exception e) { - e.printStackTrace(); - } - - } - equipmentCodeRes.put("equipmentCode", equipmentCodeSb.toString()); - - } else { - equipmentCodeRes.put("equipmentCode", CommUtil.getUUID()); - } - equipmentCodeRes.put("waterNumShort", maxWaterNumShort); - return equipmentCodeRes; - } - //2020-07-12 end - - - //2020-07-13 start - - /** - * 选择台账类型 - */ - @RequestMapping("/getEquipmentCardTypeForSelect.do") - public String getEquipmentCardTypeForSelect(HttpServletRequest request, Model model) { - JSONArray jsonArray = new JSONArray(); - for (String equipmentCardType : EquipmentCard.equipmentCardTypeArr) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCardType); - jsonObject.put("text", equipmentCardType); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - //2020-07-13 end - - /** - * 周期单位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentCardCycleUnitForSelect.do") - public String getEquipmentCardCycleUnitForSelect(HttpServletRequest request, Model model) { - JSONArray jsonArray = new JSONArray(); - for (String equipmentCardType : EquipmentCard.equipmentCardCycleUnitArr) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCardType); - jsonObject.put("text", equipmentCardType); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - /** - * 获取设备树形结构 工艺段-巡检点-设备 sj 2020-06-28 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipment4Tree.do") - public ModelAndView getEquipment4Tree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - List list = this.equipmentCardService.getEquipment4Tree(unitId, type); - JSONArray json = JSONArray.fromObject(list); - com.sipai.entity.base.Result result = com.sipai.entity.base.Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取设备列表 sj 2020-07-18 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentList.do") - public ModelAndView getEquipmentList(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String search_code = request.getParameter("search_code"); - String whereStr = " where 1=1 and bizId = '" + unitId + "'"; - - if (search_code != null && !search_code.trim().equals("")) { - whereStr += " and (equipmentCardID like '%" + search_code + "%' or equipmentName like '%" + search_code + "%')"; - } - - List list = this.equipmentCardService.selectListByWhere(whereStr); - JSONArray json = JSONArray.fromObject(list); - com.sipai.entity.base.Result result = com.sipai.entity.base.Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 根据设备id返回设备详情 - */ - @RequestMapping("/doview4Id.do") - public ModelAndView doview4Id(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - JSONArray json = JSONArray.fromObject(equipmentCard); - com.sipai.entity.base.Result result = com.sipai.entity.base.Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/getEquipmentFittingsList.do") - public ModelAndView getEquipmentFittingsList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - - if (sort == null || sort.equals("id")) { - sort = " goods_id "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and equipment_id = '" + request.getParameter("equipmentId") + "' "; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("pid") + "' "; - } else { - wherestr += " and type = '" + EquipmentFittings.Type_Z + "' "; - } - - // PageHelper.startPage(page, rows); - List list = this.equipmentFittingsService.selectListByWhere(wherestr + orderstr); - - // PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/importEquipmentFittings.do") - public ModelAndView importEquipmentFittings(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentId") String equipmentId, - @RequestParam(value = "goodsIds") String goodsIds) { - User cu = (User) request.getSession().getAttribute("cu"); - // String wherestr="where 1=1 "; - // wherestr+=" and equipment_id ='"+equipmentId+"' "; - // this.equipmentFittingsService.deleteByWhere(wherestr); - if (goodsIds == null || goodsIds.equals("")) { - String resstr = "{\"res\":\"" + 1 + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - String[] split = goodsIds.split(","); - String pid = request.getParameter("pid");//有pid则表示添加的是代替备件 - if (pid != null && !pid.isEmpty()) { - for (String string : split) { - EquipmentFittings equipmentFittings = new EquipmentFittings(); - equipmentFittings.setId(CommUtil.getUUID()); - equipmentFittings.setEquipmentId(equipmentId); - equipmentFittings.setGoodsId(string); - equipmentFittings.setInsdt(CommUtil.nowDate()); - equipmentFittings.setInsuser(cu.getId()); - equipmentFittings.setPid(pid); - equipmentFittings.setType(equipmentFittings.Type_T); - int code = this.equipmentFittingsService.save(equipmentFittings); - if (code != 1) { - String resstr = "{\"res\":\"" + code + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - } - } else { - for (String string : split) { - EquipmentFittings equipmentFittings = new EquipmentFittings(); - equipmentFittings.setId(CommUtil.getUUID()); - equipmentFittings.setEquipmentId(equipmentId); - equipmentFittings.setGoodsId(string); - equipmentFittings.setInsdt(CommUtil.nowDate()); - equipmentFittings.setInsuser(cu.getId()); - equipmentFittings.setPid("-1"); - equipmentFittings.setType(equipmentFittings.Type_Z); - int code = this.equipmentFittingsService.save(equipmentFittings); - if (code != 1) { - String resstr = "{\"res\":\"" + code + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - } - } - String resstr = "{\"res\":\"" + 1 + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteEquipmentFittings.do") - public ModelAndView deleteEquipmentFittings(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - - List list = this.equipmentFittingsService.selectListByWhere(" where (id='" + id + "' or pid='" + id + "') "); - Result result1 = new Result(); - if (list != null && list.size() > 0) { - if (list.size() == 1) {//无替代备件 - int result = this.equipmentFittingsService.deleteByWhere(" where id='" + id + "' "); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - } else { - result1 = Result.failed("信息被占用"); - } - } else { - result1 = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result1)); - - return new ModelAndView("result"); - } - - /** - * 根据设备类别获取下面关联的设备 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getdata4Equ.do") - public String getdata4Equ(HttpServletRequest request, Model model) { - String id = request.getParameter("id");//设备类别Id - String pid = request.getParameter("pid");//设备类别上一级id - String type = request.getParameter("type");//设备类别类型 如是部位则没有对应型号 需要查上一级 - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1 and bizId = '" + unitId + "'"; - if (type != null && type.equals(CommString.EquipmentClass_Parts)) { - whereStr += " and equipmentClassID = '" + pid + "'"; - } else { - whereStr += " and equipmentClassID = '" + id + "'"; - } - - List list = this.equipmentCardService.selectListTreeByWhere(whereStr + "order by equipmentCardID"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (EquipmentCard equipmentCard : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCard.getId()); - jsonObject.put("text", equipmentCard.getEquipmentname()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - //单选设备 - @RequestMapping("/getOneEquSelect.do") - public String getOneEquSelect(HttpServletRequest request, Model model) { - return "equipment/equipmentForOneEquSelect"; - } - - //用于设备编码筛选下拉框 - @RequestMapping("/getListForSelect.do") - public String getListForSelect(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("id", "0"); - jsonObject1.put("text", "正常"); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", "1"); - jsonObject2.put("text", "异常"); - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("id", "2"); - jsonObject3.put("text", "缺失"); - json.add(jsonObject1); - json.add(jsonObject2); - json.add(jsonObject3); - model.addAttribute("result", json); - return "result"; - } - - /** - * 过保查询界面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showOverdueList.do") - public String showOverdueList(HttpServletRequest request, Model model) { - //return "/equipment/equipmentCardList"; - return "/equipment/equipmentCardNewListForOverdue"; - } - - /** - * 报废查询界面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showScrapList.do") - public String showScrapList(HttpServletRequest request, Model model) { - //return "/equipment/equipmentCardList"; -// return "/equipment/equipmentCardNewListForScrap"; - return "/equipment/equipmentCardNewListForScrap"; - } - - /** - * 校对功能 - */ - @RequestMapping("/docheck.do") - public String docheck(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - // ids=ids.replace(",","','"); - String[] idslist = ids.split(","); - int result = 0; - for (int i = 0; i < idslist.length; i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(idslist[i]); - equipmentCard.setCurrentmanageflag("1"); - result = this.equipmentCardService.update(equipmentCard); - } - - model.addAttribute("result", result); - return "result"; - } - - /** - * 二维码查询界面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/outQRCode.do") - public String outQRCode(HttpServletRequest request, Model model) { - //return "/equipment/equipmentCardList"; - return "/equipment/equipmentCardNewListForoutQRCode"; - } - - /** - * 查看设备 - */ - @RequestMapping("/doviewBox.do") - public String doviewBox(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - model.addAttribute("equipmentCard", equipmentCard); - return "equipment/equipmentCardViewBox"; - } - - @RequestMapping("/pumpAnalysisExternal.do") - public String pumpAnalysisExternal(HttpServletRequest request, Model model) { - - String username = request.getParameter("username"); - String password = request.getParameter("password"); - - if (null == username || "".equals(username)) { - return "redirect:http://192.168.2.10:5001/SIPAIIS_WMS/"; - } - if (null == password || "".equals(password)) { - return "redirect:http://192.168.2.10:5001/SIPAIIS_WMS/"; - } - - List userList = userService.selectListByWhere(" where name='" + username + "' and password='" + password + "'"); - if (userList.size() > 0 && null != userList) { - String userId = userList.get(0).getId(); - model.addAttribute("userId", userId); - User cu = new User(); - cu = userList.get(0); - //设置cu其他信息 - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - model.addAttribute("unitId", cu.getPid()); - //return "/activiti/taskList"; - return "/equipment/pumpAnalysis"; - } else { - return "redirect:http://192.168.2.10:5001/SIPAIIS_WMS/"; - - } - - } - - /** - * 泵类分析模型 - */ - @RequestMapping("/pumpAnalysis.do") - public String pumpAnalysis(HttpServletRequest request, Model model) { - return "equipment/pumpAnalysis"; - } - - /** - * 风机分析模型 - */ - @RequestMapping("/fanAnalysis.do") - public String fanAnalysis(HttpServletRequest request, Model model) { - return "equipment/fanAnalysis"; - } - - /** - * 变压器安全风险评估 - */ - @RequestMapping("/transformerSecurity.do") - public String transformerSecurity(HttpServletRequest request, Model model) { - return "equipment/transformerSecurity"; - } - - /** - * 泵类分析模型-单耗-类型和制造厂家 - */ - @RequestMapping("/pumpAnalysisModel.do") - public String pumpAnalysisModel(HttpServletRequest request, Model model) { - return "equipment/pumpAnalysisModel"; - } - - /** - * 泵类分析模型-单耗-类型和制造厂家 - */ - @RequestMapping("/pumpAnalysisModelData.do") - public ModelAndView pumpAnalysisModelData(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String wherestr = "where ec.equipmentmanufacturer is not null and ecp.specification is not null " - + "and ec.equipmentmanufacturer !='' and ecp.specification !='' "; - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and ec.bizId in (" + companyids + ") "; - } - } - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - String isequipcode = request.getParameter("isequipcode"); //设备编码 - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - } - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentCardID like '%" + name + "%' or equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(equipmentNames) && equipmentNames != null) { - wherestr += " and (equipmentName like '%" + equipmentNames + "%' or equipmentCardID like '%" + equipmentNames + "%' or assetNumber like '%" + equipmentNames + "%' or factory_number like '%" + equipmentNames + "%') "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - //设备规格 - String specification = request.getParameter("specification"); - - if (!"".equals(specification) && null != specification) { - wherestr += " and specification like '%" + specification + "%'"; - } - //2020-07-13 start - if (request.getParameter("equipmentBelongId") != null && !request.getParameter("equipmentBelongId").isEmpty()) { - wherestr += " and equipment_belong_id = '" + request.getParameter("equipmentBelongId") + "' "; - } - if (request.getParameter("equipmentCardType") != null && !request.getParameter("equipmentCardType").isEmpty()) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - //2020-10-12 设备编码筛选 - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - default: - break; - } - } - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - } - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - String unitId = request.getParameter("unitId"); - List list = this.equipmentCardService.selectListByWhereForModelData(unitId, wherestr); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistForSystem.do") - public ModelAndView getlistForSystem(HttpServletRequest request, Model model) { - // 20190321 YYJ 4个参数改为非必需 - User cu = (User) request.getSession().getAttribute("cu"); -// int pages = 0; -// if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ -// pages = Integer.parseInt(request.getParameter("page")); -// }else { -// pages = 1; -// } -// int pagesize = 0; -// if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ -// pagesize = Integer.parseInt(request.getParameter("rows")); -// }else { -// pagesize = 20; -// } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - -// String wherestr="where 1=1 and pid = '"+request.getParameter("search_code")+"' "; - - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); - String processSectionId = request.getParameter("processSectionId"); -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// wherestr += " and (name like '%"+request.getParameter("search_name")+"%' or code like '%"+request.getParameter("search_name")+"%' )"; -// } - //递归查询 - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } else { - wherestr += " and bizId='" + unitId + "'"; - } - - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - -// PageHelper.startPage(pages, pagesize); - List list = this.equipmentCardService.selectListByWhereForSystem(unitId, wherestr + orderstr); - -// PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - -// @RequestMapping("/saveEquipmentToES.do") -// public String saveEquipmentToES(HttpServletRequest request,Model model){ -// List equipmentCards = this.equipmentCardService.selectListByWhereEasy("where 1=1"); -// int count = 0; -// for(int i = 0;i < equipmentCards.size(); i++){ -// -// //创建一个对象 -// EquipmentcardES equipmentcardES = new EquipmentcardES(); -// -// String equipmentName = ""; -// if(equipmentCards.get(i).getAreaid()!=null && !equipmentCards.get(i).getAreaid().equals("null")){ -// equipmentName = equipmentCards.get(i).getEquipmentname()+equipmentCards.get(i).getAreaid(); -// }else{ -// equipmentName = equipmentCards.get(i).getEquipmentname(); -// } -// equipmentcardES.setId(equipmentCards.get(i).getId()); -// equipmentcardES.setEquipmentcardName(equipmentName); -// equipmentcardES.setEquipmentcardId(equipmentCards.get(i).getEquipmentcardid()); -// //把文档写入索引库 -// equipmentcardESRepository.save(equipmentcardES); -// count++; -// } -// -// String result = "添加了"+String.valueOf(count)+"个"; -// request.setAttribute("result", count); -// return "result"; -// } -// -// @RequestMapping("/matchMpointAndEquipmentByES.do") -// public String matchMpointAndEquipmentByES(HttpServletRequest request,Model model){ -// List measurePointESs = this.measurePointESService.selectListByWhere("021NS","where 1=1"); -// Pageable pageable = PageRequest.of(0, 1789); -// ScoreSortBuilder scoreSortBuilder = new ScoreSortBuilder(); -// int count = 0; -// for(int i = 0;i < measurePointESs.size(); i++){ -//// List list = equipmentcardESRepository.findByEquipmentcardName(QueryParser.escape(measurePointESs.get(i).getParmname()), pageable); -// NativeSearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(QueryBuilders.queryStringQuery(QueryParser.escape(measurePointESs.get(i).getParmname()))) -// // 设置分页条件 -// .withPageable(PageRequest.of(0, 15)) -// .withSort(scoreSortBuilder.order(SortOrder.DESC)) -// .build(); -// List list = template.queryForList(searchQuery, EquipmentcardES.class); -// if(list !=null && list.size()>0){ -// //命中了设备,取第一个,更新到tmp表中 -// MeasurePointES measurePointES = measurePointESs.get(i); -// measurePointES.setEquipid(list.get(0).getId()); -// System.out.println(String.valueOf(count)+": 测量点: "+measurePointES.getParmname()+",命中了设备: "+list.get(0).getEquipmentcardName()+" 。equipid:"+list.get(0).getId()); -// this.measurePointESService.update("021NS",measurePointES); -// }else{ -// System.out.println(String.valueOf(count)+": 测量点: "+measurePointESs.get(i).getParmname()+", 没有命中设备: 。equipid:"); -// -// } -// count++; -// } -// -// String result = "添加了"+String.valueOf(count)+"个"; -// request.setAttribute("result", count); -// return "result"; -// } - - /** - * 批量设置功能 - */ - @RequestMapping("/doBatch.do") - public String doBatch(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "equipmentBelong") String equipmentBelong) { - String[] idslist = ids.split(","); - int result = 0; - for (int i = 0; i < idslist.length; i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(idslist[i]); - equipmentCard.setEquipmentBelongId(equipmentBelong); - result = this.equipmentCardService.update(equipmentCard); - } - - model.addAttribute("result", result); - return "result"; - } - - /** - * 设备总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/equipmentOverview.do") - public String equipmentOverview(HttpServletRequest request, Model model) { - return "/equipment/equipmentOverview"; - } - - /** - * 设备总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/equipmentOverviewV2.do") - public String equipmentOverviewV2(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Product); - request.setAttribute("nowdate", CommUtil.nowDate()); - return "/equipment/equipmentOverviewV2"; - } - - /** - * 获取设备列表--总览中 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getlist4Overview.do") - public ModelAndView getlist4Overview(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - - String proId = request.getParameter("proId"); - String levelId = request.getParameter("levelId"); - String classId = request.getParameter("classId"); - - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); - - //递归查询 - //获取公司下所有子节点 - /*List units = unitService.getUnitChildrenById(unitId); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - }else{ - wherestr +=" and bizId='"+unitId+"'"; - }*/ - - //工艺段筛选 - if (proId != null && !proId.equals("")) { - wherestr += "and processSectionId = '" + proId + "' "; - } - //设备等级筛选 - if (levelId != null && !levelId.equals("")) { - List equipmentLevels = equipmentLevelService.selectListByWhere("where equipment_level_code = '" + levelId + "'"); - if (equipmentLevels != null && equipmentLevels.size() > 0) { - wherestr += "and equipmentLevelId = '" + equipmentLevels.get(0).getId() + "' "; - } - } - //设备类型筛选 - if (classId != null && !classId.equals("")) { - wherestr += " and equipment_big_class_id = '" + classId + "' "; - } - - if (unitId != null && !unitId.trim().equals("")) { - wherestr += " and bizId = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhereEasy(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备数量 - * - * @param request - * @param model - * @param unitId 厂id - * @param type 获取类型 如 全部或使用中的 - * @return - */ - @RequestMapping("/selectEquipmentNum.do") - public String selectEquipmentNum(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "type") String type, - @RequestParam(value = "proId") String proId, - @RequestParam(value = "levelId") String levelId, - @RequestParam(value = "classId") String classId) { - int result = 0; - String wherestr = "where 1=1 "; - System.out.println(type); - if (proId != null && !proId.equals("")) { - wherestr += "and processSectionId = '" + proId + "' "; - } - if (levelId != null && !levelId.equals("")) { - List equipmentLevels = equipmentLevelService.selectListByWhere("where equipment_level_code = '" + levelId + "'"); - if (equipmentLevels != null && equipmentLevels.size() > 0) { - wherestr += "and equipmentLevelId = '" + equipmentLevels.get(0).getId() + "' "; - } - } - if (classId != null && !classId.equals("")) { - wherestr += " and equipment_big_class_id = '" + classId + "' "; - } - - if (unitId != null && !unitId.equals("")) { - wherestr += "and bizId = '" + unitId + "' "; - } - if (type != null && !type.equals("")) { - if (type.equals("all")) {//所有设备 - wherestr += ""; - } - if (type.equals("use2")) {//在用设备 - String statusId = ""; - List list = equipmentStatusManagementService.selectListByWhere("where name = '在用'"); - if (list != null && list.size() > 0) { - statusId = list.get(0).getId(); - } else { - statusId = "-99"; - } - wherestr += "and equipmentStatus = '" + statusId + "' "; - } - } - List list = equipmentCardService.selectSimpleListByWhere(wherestr); - if (list != null && list.size() > 0) { - result = list.size(); - } else { - result = 0; - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 从测量点获得数据 - * - * @param request - * @param data_number 数据id - * @param bizId 厂id - * @param page_nub 页面id - * @return - */ - @RequestMapping("/findDATA1.do") - public String findDATA1(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "data_number") String data_number, - @RequestParam(value = "page_nub") String page_nub) { - BigDecimal parmvalue = new BigDecimal(0); - String wherestr = "where 1=1"; - if (bizId != null && !bizId.isEmpty()) { - wherestr += " and biz_id = '" + bizId + "' "; - } - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and data_number = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and page_nub = '" + page_nub + "' "; - } - List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - for (MeasurePoint_DATA measurePoint_DATA : measurePoint_DATAs) { - List mPoints = this.mPointService.selectListByWhere(bizId, "where 1=1 and MPointCode = '" + measurePoint_DATA.getMpointcode() + "' "); - if (mPoints.size() != 0) { - for (MPoint mPoint : mPoints) { - parmvalue = parmvalue.add(mPoint.getParmvalue()); - } - } - } - - - model.addAttribute("result", subNumberText(parmvalue.toString())); - return "result"; - } - - public String subNumberText(String result) { - - if (result == null) { - return ""; - } - if (result.contains(".")) {// 是小数 - while (true) { - if (result.charAt(result.length() - 1) == '0') - result = result.substring(0, result.length() - 1); - else { - if (result.endsWith(".")) { - result = result.substring(0, result.length() - 1); - } - break; - } - - } - - } - return result; - } - - /** - * 设备台账 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showEquipmentCard.do") - public String showEquipmentCard(HttpServletRequest request, Model model) { - return "equipment/equipmentCardTree"; - } - - /** - * 设备台账 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "equipment/equipmentCardList"; - } - - /** - * 设备报废台账 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListForScrap.do") - public String showListForScrap(HttpServletRequest request, Model model) { - return "equipment/equipmentCardScrapList"; - } - - /** - * 设备台账 (根据设备类型进行筛选) - * sj 2023-06-21 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showViewList4Type.do") - public String showViewList4Type(HttpServletRequest request, Model model) { - request.setAttribute("equipmentClassCode", request.getParameter("code")); - return "equipment/equipmentCardViewList4Type"; - } - - /** - * 新增设备 - * SJ 2021-07-27 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String id = CommUtil.getUUID(); - model.addAttribute("id", id); - String unitId = request.getParameter("unitId"); - Company company = this.unitService.getCompById(unitId); - model.addAttribute("company", company); - return "equipment/equipmentCardAdd"; - } - - /** - * 编辑设备 - * SJ 2021-07-27 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectByEquipmentCard(id); - model.addAttribute("equipmentCard", equipmentCard); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectByEquipmentId(equipmentCard.getId()); - model.addAttribute("equipmentCardProp", equipmentCardProp); - return "equipment/equipmentCardEdit"; - } - - /** - * 设备台账右侧list (2021-08-09 sj 设备维修工单也使用) - * - * @param request - * @param model - * @return - */ - /*@RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - model.addAttribute("pid", request.getParameter("id")); - model.addAttribute("type", request.getParameter("type")); - return "equipment/equipmentCardList"; - }*/ - @RequestMapping("/getList4EquipmentCard.do") - public ModelAndView getList4EquipmentCard(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1"; - - String unitId = request.getParameter("unitId"); - if (unitId != null && !unitId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - - // 设备等级(ABC) - String equipmentLevel = request.getParameter("equipmentLevel"); - // 设备归属--常排项目 - String equipmentBelong = request.getParameter("equipmentBelong"); - // 设备归属--常排项目 - String equipmentstatus = request.getParameter("equipmentstatus"); - //工艺段id - String processSectionId = request.getParameter("processSectionId"); - //设备大类id - String equipmentClassId = request.getParameter("equipmentClassId"); - //设备pid - String equipmentClassPid = request.getParameter("equipmentClassPid"); - //设备状态 - String equipmentStatus = request.getParameter("equipmentStatus"); - //模糊搜索 - String search_name = request.getParameter("search_name"); - //设备id搜索(主要用于app选择设备时候 用nfc选择) - String equipmentId = request.getParameter("equipmentId"); - // 报废搜索 - String isScrap = request.getParameter("isScrap"); - // - String ids = request.getParameter("ids"); - - //近期需要保养的设备 (只有保养计划模块选择设备时候才会传) - String timeSelect = request.getParameter("timeSelect"); - - // 报废条件 - if (StringUtils.isNotBlank(isScrap)) { - // 折旧年限 大于等于 - wherestr += " and (datediff(year, in_stock_time, '" + CommUtil.nowDate() + "') >= depreciation_life "; - // 使用年限 - wherestr += " or datediff(year, in_stock_time, '" + CommUtil.nowDate() + "') >= service_life "; - wherestr += " or equip_worth <= 0) "; - List equipmentStatusManagements = equipmentStatusManagementService.selectListByWhere("where name = '报废'"); - if (equipmentStatusManagements != null && equipmentStatusManagements.size() > 0) { - wherestr += " and equipmentStatus != '" + equipmentStatusManagements.get(0).getId() + "'"; - } - } - //设备等级(ABC) - if (equipmentLevel != null && !equipmentLevel.isEmpty()) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - // 设备状态 - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - //工艺段搜索 - if (processSectionId != null && !processSectionId.trim().equals("")) { - List list = processSectionService.selectListByWhere("where 1=1 and unit_id = '" + unitId + "' and code = '" + processSectionId + "'"); - if (list != null && list.size() > 0) { - wherestr += " and processSectionId = '" + list.get(0).getId() + "' "; - } else { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - } - //模糊搜索 - if (search_name != null && !"".equals(search_name.trim())) { - wherestr += " and (equipmentCardID like '%" + search_name + "%' or equipmentName like '%" + search_name + "%' or equipmentModelName like '%" + search_name + "%' or equipmentmanufacturer like '%" + search_name + "%' or assetNumber like '%" + search_name + "%') "; - } - //设备大类搜索 - if (equipmentClassId != null && !equipmentClassId.trim().equals("")) { - if (equipmentClassPid != null && equipmentClassPid.equals("-1")) { - wherestr += " and equipment_big_class_id = '" + equipmentClassId + "' "; - } else { - wherestr += " and equipmentClassID = '" + equipmentClassId + "' "; - } - } - //设备id搜索(主要用于app选择设备时候 用nfc选择) - if (equipmentId != null && !equipmentId.trim().equals("")) { - wherestr += " and id = '" + equipmentId + "' "; - } - - - //通过/equipment/showList4Type.do页面进来的 只查对应的设备大类数据 (目前竹一的 计量表在用) - String equipmentClassCode = request.getParameter("equipmentClassCode"); - if (equipmentClassCode != null) { - List list_class = equipmentClassService.selectListByWhere(" where equipment_class_code = '" + equipmentClassCode + "' and pid = '-1' "); - if (list_class != null && list_class.size() > 0) { - wherestr += " and equipment_big_class_id = '" + list_class.get(0).getId() + "' "; - } else { - wherestr += " and equipment_big_class_id = '-99' ";//如果找不到 则不显示数据 - } - } - - //可视化 设备点组件 - String classNames = request.getParameter("classNames"); - if (classNames != null) { - String nameWhere = "("; - String[] classNamess = classNames.split(","); - for (int i = 0; i < classNamess.length; i++) { - String className = classNamess[i]; - if (i == classNamess.length - 1) { - nameWhere += "name like '%" + className + "%')"; - } else { - nameWhere += "name like '%" + className + "%' or "; - } - } - List list_class = equipmentClassService.selectListByWhere(" where " + nameWhere + " and pid = '-1' "); - if (list_class != null && list_class.size() > 0) { - String classIds = ""; - for (int i = 0; i < list_class.size(); i++) { - classIds += list_class.get(i).getId() + ","; - } - classIds = classIds.replace(",", "','"); - wherestr += " and equipment_big_class_id in ('" + classIds + "') "; - } else { - wherestr += " and equipment_big_class_id = '-99' ";//如果找不到 则不显示数据 - } - } - - if (StringUtils.isNotBlank(ids)) { - ids = ids.replace(",", "','"); - wherestr += " and id not in ('" + ids + "') "; - } - - //筛选近期需要保养的设备 - if (timeSelect != null && !timeSelect.trim().equals("") && !timeSelect.equals("0")) { - String main_ids = ""; - List list = this.equipmentCardService.selectListByWhereForMaintenance(" and DATEDIFF(MONTH,GETDATE(),DATEADD(MONTH, d.cycle,d.last_time))<=" + timeSelect); - for (EquipmentCard equipmentCard : list) { - main_ids += "'" + equipmentCard.getId() + "',"; - } - main_ids = main_ids.substring(0, main_ids.length() - 1); - wherestr += " and id in (" + main_ids + ")"; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByEquipmentCard(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 设备报废申请 - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getList4EquipmentCardScrap.do") - public ModelAndView getList4EquipmentCardScrap(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1"; - - String unitId = request.getParameter("unitId"); - if (unitId != null && !unitId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - - // 设备等级(ABC) - String equipmentLevel = request.getParameter("equipmentLevel"); - // 设备归属--常排项目 - String equipmentBelong = request.getParameter("equipmentBelong"); - // 设备归属--常排项目 - String equipmentstatus = request.getParameter("equipmentstatus"); - //工艺段id - String processSectionId = request.getParameter("processSectionId"); - //设备大类id - String equipmentClassId = request.getParameter("equipmentClassId"); - //设备pid - String equipmentClassPid = request.getParameter("equipmentClassPid"); - //设备状态 - String equipmentStatus = request.getParameter("equipmentStatus"); - //模糊搜索 - String search_name = request.getParameter("search_name"); - //设备id搜索(主要用于app选择设备时候 用nfc选择) - String equipmentId = request.getParameter("equipmentId"); - // 报废搜索 - String isScrap = request.getParameter("isScrap"); - // - String ids = request.getParameter("ids"); - - // 报废条件 - if (StringUtils.isNotBlank(isScrap)) { - // 折旧年限 大于等于 - wherestr += " and (datediff(year, in_stock_time, '" + CommUtil.nowDate() + "') >= depreciation_life "; - // 使用年限 - wherestr += " or datediff(year, in_stock_time, '" + CommUtil.nowDate() + "') >= service_life "; - wherestr += " or equip_worth <= 0) "; - List equipmentStatusManagements = equipmentStatusManagementService.selectListByWhere("where name = '报废'"); - if (equipmentStatusManagements != null && equipmentStatusManagements.size() > 0) { - wherestr += " and equipmentStatus != '" + equipmentStatusManagements.get(0).getId() + "'"; - } - } - //设备等级(ABC) - if (equipmentLevel != null && !equipmentLevel.isEmpty()) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - // 设备状态 - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - //工艺段搜索 - if (processSectionId != null && !processSectionId.trim().equals("")) { - List list = processSectionService.selectListByWhere("where 1=1 and unit_id = '" + unitId + "' and code = '" + processSectionId + "'"); - if (list != null && list.size() > 0) { - wherestr += " and processSectionId = '" + list.get(0).getId() + "' "; - } else { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - } - //模糊搜索 - if (search_name != null && !"".equals(search_name.trim())) { - wherestr += " and (equipmentCardID like '%" + search_name + "%' or equipmentName like '%" + search_name + "%' or equipmentModelName like '%" + search_name + "%' or equipmentmanufacturer like '%" + search_name + "%' or assetNumber like '%" + search_name + "%') "; - } - //设备大类搜索 - if (equipmentClassId != null && !equipmentClassId.trim().equals("")) { - if (equipmentClassPid != null && equipmentClassPid.equals("-1")) { - wherestr += " and equipment_big_class_id = '" + equipmentClassId + "' "; - } else { - wherestr += " and equipmentClassID = '" + equipmentClassId + "' "; - } - } - //设备id搜索(主要用于app选择设备时候 用nfc选择) - if (equipmentId != null && !equipmentId.trim().equals("")) { - wherestr += " and id = '" + equipmentId + "' "; - } - - - //通过/equipment/showList4Type.do页面进来的 只查对应的设备大类数据 (目前竹一的 计量表在用) - String equipmentClassCode = request.getParameter("equipmentClassCode"); - if (equipmentClassCode != null) { - List list_class = equipmentClassService.selectListByWhere(" where equipment_class_code = '" + equipmentClassCode + "' and pid = '-1' "); - if (list_class != null && list_class.size() > 0) { - wherestr += " and equipment_big_class_id = '" + list_class.get(0).getId() + "' "; - } else { - wherestr += " and equipment_big_class_id = '-99' ";//如果找不到 则不显示数据 - } - } - - //可视化 设备点组件 - String classNames = request.getParameter("classNames"); - if (classNames != null) { - String nameWhere = "("; - String[] classNamess = classNames.split(","); - for (int i = 0; i < classNamess.length; i++) { - String className = classNamess[i]; - if (i == classNamess.length - 1) { - nameWhere += "name like '%" + className + "%')"; - } else { - nameWhere += "name like '%" + className + "%' or "; - } - } - List list_class = equipmentClassService.selectListByWhere(" where " + nameWhere + " and pid = '-1' "); - if (list_class != null && list_class.size() > 0) { - String classIds = ""; - for (int i = 0; i < list_class.size(); i++) { - classIds += list_class.get(i).getId() + ","; - } - classIds = classIds.replace(",", "','"); - wherestr += " and equipment_big_class_id in ('" + classIds + "') "; - } else { - wherestr += " and equipment_big_class_id = '-99' ";//如果找不到 则不显示数据 - } - } - - if (StringUtils.isNotBlank(ids)) { - ids = ids.replace(",", "','"); - wherestr += " and id not in ('" + ids + "') "; - } - PageHelper.startPage(page, rows); -// System.out.println(wherestr); - List list = this.equipmentCardService.selectListByEquipmentCard(wherestr + orderstr); - // 遍筛选选状态 - for (int i = 0; i < list.size(); i++) { - List equipmentScrapApplyDetails = equipmentScrapApplyDetailService.selectListByWhereAndApplyStatus("where esad.equipment_card_id = '" + list.get(i).getId() + "' and esa.status != '3' and esa.status !='0'"); - if (equipmentScrapApplyDetails != null && equipmentScrapApplyDetails.size() > 0) { - list.remove(list.get(i)); - i--; - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 设备台账获取工艺段列表 目前为一级层级 树形 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getProcessSection4EquipmentCardTree.do") - public String getProcessSection4EquipmentCardTree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getParentCompanyChildrenBizByUnitid(unitId); - String json = equipmentCardService.getTreeList4ProcessSection(null, list); - Result result = Result.success(json); -// System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 设备台账获取设备类型列表 目前为一级层级 树形 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentClass4EquipmentCardTree.do") - public String getEquipmentClass4EquipmentCardTree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getParentCompanyChildrenBizByUnitid(unitId); - String json = equipmentCardService.getTreeList4EquipmentClass(null, list); -// String str = json.replaceAll("\\\\", ""); - Result result = Result.success(json); -// System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * 查看设备(json) 可用于BIM和app - * sj 2021-11-22 - */ - @RequestMapping("/doviewJson.do") - public String doviewJson(HttpServletRequest request, Model model) { - String equipmentCardId = request.getParameter("equipmentCardId"); - EquipmentCard equipmentCard = this.equipmentCardService.selectByEquipmentCardId(equipmentCardId); - model.addAttribute("result", CommUtil.toJson(equipmentCard)); - return "result"; - } - - /** - * 设备卡片 独立web页面 用于嵌入BIM等 - * sj 2021-12-01 - */ - @RequestMapping("/doview4Web.do") - public String doview4Web(HttpServletRequest request, Model model) { - String equipmentCardId = request.getParameter("equipmentCardId"); - //根据编号查询 - EquipmentCard equipmentCard = this.equipmentCardService.getEquipmentByEquipmentCardId(equipmentCardId); - if (equipmentCard != null) { - //根据id查询 - EquipmentCard equipmentCard2 = this.equipmentCardService.selectByEquipmentCard4View(equipmentCard.getId()); - model.addAttribute("equipmentCard", equipmentCard2); - } - return "equipment/equipmentCardViewWeb"; - } - - /** - * 设备卡片 独立web页面 用于嵌入BIM等 (方式1) - * 树的形式 - * sj 2021-12-01 - */ - @RequestMapping("/doTreeView4Web.do") - public String doTreeView4Web(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - model.addAttribute("unitId", unitId); - return "equipment/equipmentCardTreeViewWeb"; - } - - /** - * doTreeView4Web 右边的列表 - * sj 2021-12-01 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Web.do") - public String showList4Web(HttpServletRequest request, Model model) { - return "equipment/equipmentCardList4Web"; - } - - /** - * 设备卡片 独立web页面 用于嵌入BIM等 (方式2) - * 列表的形式 - * sj 2021-12-01 - */ - @RequestMapping("/doTreeView4Web2.do") - public String doTreeView4Web2(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - model.addAttribute("unitId", unitId); - return "equipment/equipmentCardTreeViewWeb2"; - } - - /** - * 设备完好率 (可查所有和重要设备的) ------ 根据故障设备数计算 - * sj 2022-02-21 - * - * @param model - * @param unitId 厂id 会递归至最下面层级 - * @param levelType 需要获取所有 还是重要设备 (所有设备:type=0 ; 重要设备:type=1) - * @return - */ - @RequestMapping("/getIntactRate.do") - public String getIntactRate(Model model, - String unitId, - String levelType) { - double rate = equipmentCardService.getIntactRate(unitId, levelType); - model.addAttribute("result", CommUtil.toJson(Result.success(rate))); - return "result"; - } - - /** - * 设备完好率 (可查所有和重要设备的) ------ 根据故障时间计算 - * sj 2022-02-21 - * - * @param model - * @param unitId 厂id 会递归至最下面层级 - * @param levelType 需要获取所有 还是重要设备 (所有设备:type=0 ; 重要设备:type=1) - * @param sdt 查询的月份 格式:2022-04 - * @return - */ - @RequestMapping("/getIntactRate4Time.do") - public String getIntactRate4Time(Model model, - String unitId, - String levelType, - String sdt) { - double rate = equipmentCardService.getIntactRate4Time(unitId, levelType, sdt); - model.addAttribute("result", CommUtil.toJson(Result.success(rate))); - return "result"; - } - - /** - * 工单完成率 (可根据type查维修和保养) - * sj 2022-02-21 - * - * @param model - * @param unitId 厂id 会递归至最下面层级 - * @param type 维修还是保养 (维修:repair 保养:maintain) - * @return - */ - @RequestMapping("/getWorkOrderCompletionRate.do") - public String getWorkOrderCompletionRate(Model model, - String unitId, - String type) { - double rate = equipmentCardService.getWorkOrderCompletionRate(unitId, type); - model.addAttribute("result", CommUtil.toJson(Result.success(rate))); - return "result"; - } - - /** - * 巡检完成率 (可根据type查运行或设备巡检) - * sj 2022-02-21 - * - * @param model - * @param unitId 厂id 会递归至最下面层级 - * @param type 运行或设备巡检 (运行巡检:P 设备巡检:E) - * @return - */ - @RequestMapping("/getPatrolRecordCompletionRate.do") - public String getPatrolRecordCompletionRate(Model model, - String unitId, - String type) { - double rate = equipmentCardService.getPatrolRecordCompletionRate(unitId, type); - model.addAttribute("result", CommUtil.toJson(Result.success(rate))); - return "result"; - } - - /** - * 获取指定设备类型的 维修次数 如传sdt或edt可查询时间范围内的 不传则只查当月的 - * sj 2022-02-23 - * - * @param model - * @param unitId 厂id - * @param className 通用设备、电气设备、仪器设备、专业设备 等名称和设备类型要对应起来 - * @return - */ - @RequestMapping("/getRepairCount4Class.do") - public String getRepairCount4Class(Model model, - String unitId, - String className) { - com.alibaba.fastjson.JSONArray jsonArray = equipmentCardService.getRepairCount4Class(unitId, className); - model.addAttribute("result", CommUtil.toJson(Result.success(jsonArray))); - return "result"; - } - - /** - * 获取维修工单数 - * - * @param model - * @param unitId - * @param status 获取完成数:0 只获取总数:1 - * @return - */ - @RequestMapping("/getRepairCount.do") - public String getRepairCount(Model model, - String unitId, - String status, - String sdt, - String edt) { - int rateStr = equipmentCardService.getRepairCount(unitId, status, sdt, edt, WorkorderDetail.REPAIR); - model.addAttribute("result", CommUtil.toJson(Result.success(rateStr))); - return "result"; - } - - /** - * 获取巡检任务数 - * sj 2022-02-28 - * - * @param model - * @param unitId 厂id - * @param type 运行巡检:P 设备巡检:E - * @param status 只获取完成数:0 只获取总数:1 - * @param sdt 开始时间 - * @param edt 结束时间 - * @return - */ - @RequestMapping("/getPatrolRecordCount.do") - public String getPatrolRecordCount(Model model, - String unitId, - String type, - String status, - String sdt, - String edt) { - int rateStr = equipmentCardService.getPatrolRecordCount(unitId, type, status, sdt, edt); - model.addAttribute("result", CommUtil.toJson(Result.success(rateStr))); - return "result"; - } - - /** - * 获取异常数 - * sj 2022-02-28 - * - * @param model - * @param unitId - * @param type - * @param sdt - * @param edt - * @return - */ - @RequestMapping("/getAbnormityCount.do") - public String getAbnormityCount(Model model, - String unitId, - String type, - String sdt, - String edt) { - int ratedouble = equipmentCardService.getAbnormityCount(unitId, type, sdt, edt); - model.addAttribute("result", CommUtil.toJson(Result.success(ratedouble))); - return "result"; - } - - - /** - * 设备选择列表 -- 支持单台设备的保存并将id和name复制到页面,支持多台设备选择将id传到后台 - */ - @RequestMapping("/selectEquipmentCard4Choice.do") - public String selectEquipmentCard4Choice(HttpServletRequest request, Model model) { - String equPlanId = request.getParameter("equPlanId"); - if (StringUtils.isNotBlank(equPlanId)) { - List equipmentPlanEqus = equipmentPlanEquService.selectListByWhereSP("where pid = '" + equPlanId + "'"); - String ids = ""; - for (int i = 0; i < equipmentPlanEqus.size(); i++) { - if (i == equipmentPlanEqus.size() - 1) { - ids += equipmentPlanEqus.get(i).getEquipmentId(); - } else { - ids += equipmentPlanEqus.get(i).getEquipmentId() + ","; - } - } - model.addAttribute("ids", ids); - } else { - String equipmentIds = request.getParameter("equipmentIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("goodsIds", jsonArray); - } - } - - //通过保养模块过来的,需要筛选近期需要保养的功能 - if(request.getParameter("choiceType")!=null && !request.getParameter("choiceType").equals("")){ - request.setAttribute("choiceType", 1); - } - - return "equipment/equipmentCardList4Choice"; - } - - - @ApiOperation(value = "设备总览 - 关键指标(左上角接口)", notes = "设备总览 - 关键指标(左上角接口)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "date", value = "时间 如 2022-04-01", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "equipmentClassId", value = "设备类型Id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "processSectionId", value = "工艺段Id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/getEquipmentOverview_Target.do", method = RequestMethod.POST) - public String getEquipmentOverview_Target(Model model, - String unitId, - String date, - String equipmentClassId, - String processSectionId) { - String json = equipmentCardService.getEquipmentOverview_Target(unitId, date, equipmentClassId, processSectionId); - model.addAttribute("result", CommUtil.toJson(Result.success(json))); - return "result"; - } - - @ApiOperation(value = "设备总览 - 任务完成情况(左边中间接口)", notes = "设备总览 - 任务完成情况(左边中间接口)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "date", value = "时间 如 2022-04-01", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "equipmentClassId", value = "设备类型Id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "processSectionId", value = "工艺段Id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/getEquipmentOverview_Completion.do", method = RequestMethod.POST) - public String getEquipmentOverview_Completion(Model model, - String unitId, - String date, - String equipmentClassId, - String processSectionId) { - String json = equipmentCardService.getEquipmentOverview_Completion(unitId, date, equipmentClassId, processSectionId); - model.addAttribute("result", CommUtil.toJson(Result.success(json))); - return "result"; - } - - @ApiOperation(value = "设备总览 - 各任务数统计 (左下角接口)", notes = "设备总览 - 各任务数统计 (左下角接口)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "date", value = "时间 如 2022-04-01", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "equipmentClassId", value = "设备类型Id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "processSectionId", value = "工艺段Id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "type", value = "工单类型(0设备巡检、1维修工单、2保养工单)", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getEquipmentOverview_Statistics.do", method = RequestMethod.POST) - public String getEquipmentOverview_Statistics(Model model, - String unitId, - String date, - String equipmentClassId, - String processSectionId, - String type) { - String json = equipmentCardService.getEquipmentOverview_Statistics(unitId, date, equipmentClassId, processSectionId, type); - model.addAttribute("result", CommUtil.toJson(Result.success(json))); - return "result"; - } - - @ApiOperation(value = "设备总览 - 工作计划 (右上角接口)", notes = "设备总览 - 工作计划 (右上角接口)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "date", value = "时间 如 2022-04-01", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "equipmentClassId", value = "设备类型Id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "processSectionId", value = "工艺段Id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/getEquipmentOverview_WorkPlan.do", method = RequestMethod.POST) - public String getEquipmentOverview_WorkPlan(Model model, - String unitId, - String date, - String equipmentClassId, - String processSectionId) { - String json = equipmentCardService.getEquipmentOverview_WorkPlan(unitId, date, equipmentClassId, processSectionId); - model.addAttribute("result", CommUtil.toJson(Result.success(json))); - return "result"; - } - - @ApiOperation(value = "设备总览 - 工作列表 (右下角接口)", notes = "设备总览 - 工作列表 (右下角接口)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "date", value = "时间 如 2022-04-01", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "equipmentClassId", value = "设备类型Id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "processSectionId", value = "工艺段Id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/getEquipmentOverview_WorkList.do", method = RequestMethod.GET) - public String getEquipmentOverview_WorkList(Model model, - String unitId, - String date, - String equipmentClassId, - String processSectionId, - String type) { - String json = equipmentCardService.getEquipmentOverview_WorkList(unitId, date, equipmentClassId, processSectionId, type); - model.addAttribute("result", CommUtil.toJson(Result.success(json))); - return "result"; - } - - /** - * 保存设备台账关联测量点 - * 2022-05-13 sj - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateMPoints.do") - @ArchivesLog(operteContent = "更新设备关联测量点") - public String updateMPoints(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentId = request.getParameter("equipmentId"); - String mPointIds = request.getParameter("mPointIds"); - String bizId = request.getParameter("bizId"); - int result = 0; - String[] idArrary = mPointIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - MPoint mPoint = mPointService.selectById(bizId, str); - mPoint.setEquipmentid(equipmentId); - result += mPointService.update2(bizId, mPoint); - } - } - String resstr = "{\"res\":" + result + "}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除设备台账关联测量点 总编equipmentid字段置空 - * 2022-05-13 sj - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteMPoints.do") - @ArchivesLog(operteContent = "删除设备关联测量点") - public String deleteMPoints(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "bizId") String bizId) { - int result = 0; - if (ids != null && !ids.trim().equals("")) { - String[] idArrary = ids.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - MPoint mPoint = mPointService.selectById(bizId, str); - mPoint.setEquipmentid(""); - result += mPointService.update2(bizId, mPoint); - } - } - } - - model.addAttribute("result", result); - return "result"; - } - - @ApiOperation(value = "手动补维修次数接口", notes = "手动补维修次数接口", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "dt", value = "时间 如 2022-04-01", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/doSaveRepairCount.do", method = RequestMethod.POST) - @ResponseBody - public String doSaveRepairCount(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dt") String dt) { - //月度维修次数 - double rate4 = equipmentCardService.getRepairCount4Class3(unitId, "机械类", dt); - save_his(unitId + "_JXSBWSCS_MONTH", rate4, unitId, dt); - - //月度维修次数 - double rate5 = equipmentCardService.getRepairCount4Class3(unitId, "电气类", dt); - save_his(unitId + "_DQSBWSCS_MONTH", rate5, unitId, dt); - - double rate6 = equipmentCardService.getRepairCount4Class3(unitId, "化验类", dt); - this.save_his(unitId + "_HYSBWSCS_MONTH", rate6, unitId, dt); - - //月度维修次数 - double rate7 = equipmentCardService.getRepairCount4Class3(unitId, "自动化类", dt); - save_his(unitId + "_ZDHSBWSCS_MONTH", rate7, unitId, dt); - - //月度维修次数 - double rate14 = equipmentCardService.getRepairCount4Class3(unitId, "计算机类", dt); - save_his(unitId + "_JSJSBWSCS_MONTH", rate14, unitId, dt); - - //月度维修次数 - double rate15 = equipmentCardService.getRepairCount4Class3(unitId, "其他", dt); - save_his(unitId + "_QTSBWSCS_MONTH", rate15, unitId, dt); - - model.addAttribute("result", "suc"); - return "result"; - } - - /** - * 保存子表 - */ - public void save_his(String mpId, double val, String unitId, String dt) { - try { - List list = mPointHistoryService.selectListByTableAWhere(unitId, "[tb_mp_" + mpId + "]", "where DateDiff(mm,MeasureDT,'" + dt + "')=0"); - if (list != null && list.size() > 0) { - mPointHistoryService.deleteByTableAWhere(unitId, "[tb_mp_" + mpId + "]", "where DateDiff(mm,MeasureDT,'" + dt + "')=0"); - } - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(val + "")); - mPointHistory.setMeasuredt(dt); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(unitId, mPointHistory); - } catch (Exception e) { - - } - } - - /** - * 获取应急预案数 - * sj 2022-02-28 - * - * @param model - * @param unitId - * @param type - * @param - * @param - * @return - */ - @RequestMapping("/getEmergencyRecordCount.do") - public String getEmergencyRecordCount(Model model, String unitId, String type, String date) { - String sql = "where 1=1"; - if (type != null) { - if (type.equals("0")) {//计划数 - sql += ""; - } - if (type.equals("1")) {//完成数 - sql += " and status = '" + EmergencyRecords.Status_Finish + "'"; - } - } - if (unitId != null) { - sql += " and bizid = '" + unitId + "'"; - } - if (date != null) { - - } else { - sql += " and DATEDIFF(year,starttime,getdate())=0 "; - } - List list = emergencyRecordsService.selectListByWhere(sql); - model.addAttribute("result", CommUtil.toJson(Result.success(list.size()))); - return "result"; - } - - - @ApiOperation(value = "根据设备状态获取对应的设备数量", notes = "根据设备状态获取对应的设备数量", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "statusName", value = "如:在用、闲置、库存、待报废(需要跟平台配置的名称对应上)", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getEquipmentNum4Status.do", method = RequestMethod.GET) - public String getEquipmentNum4Status(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "statusName") String statusName) { - int equipmentNum = 0;//符合条件设备数 - List list_status = equipmentStatusManagementService.selectListByWhere("where name = '" + statusName + "'"); - if (list_status != null && list_status.size() > 0) { - List list_equipment = equipmentCardService.selectSimpleListByWhere("where bizId = '" + unitId + "' and equipmentStatus = '" + list_status.get(0).getId() + "'"); - if (list_equipment != null && list_equipment.size() > 0) { - equipmentNum = list_equipment.size(); - } - } - model.addAttribute("result", CommUtil.toJson(Result.success(equipmentNum))); - return "result"; - } - - @ApiOperation(value = "获取单台设备详情", notes = "获取单台设备详情(仅台账本身字段,未联合查询其他表)sj 20230403", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "设备台账Id", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getEquipmentSimple.do", method = RequestMethod.GET) - public ModelAndView getEquipmentSimple(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(id); - if (equipmentCard != null) { - JSONObject json = JSONObject.fromObject(equipmentCard); - model.addAttribute("result", json); - } else { - model.addAttribute("result", null); - } - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentCardLinksController.java b/src/com/sipai/controller/equipment/EquipmentCardLinksController.java deleted file mode 100644 index 23f5602b..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCardLinksController.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardLinks; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardLinksService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentCardLinks") -public class EquipmentCardLinksController { - @Resource - private EquipmentCardLinksService equipmentCardLinksService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - /** - * 打开配置页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/equipmentCardLinksList"; - } - /** - * 打开配置页面 - */ - @RequestMapping("/showList_equ.do") - public String showList_equ(HttpServletRequest request, Model model) { - return "/equipment/equipmentCardLinksListEqu"; - } - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model/*, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order*/) { - User cu=(User)request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and link_name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.equipmentCardLinksService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增链接 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentCardLinksAdd"; - } - - /** - * 保存链接 - */ - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardLinks") EquipmentCardLinks equipmentCardLinks){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardLinks.setId(CommUtil.getUUID()); - equipmentCardLinks.setInsuser(cu.getId()); - equipmentCardLinks.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardLinksService.save(equipmentCardLinks); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardLinks.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 编辑链接表 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCardLinks equipmentCardLinks = this.equipmentCardLinksService.selectById(id); - model.addAttribute("equipmentCardLinks", equipmentCardLinks); - return "equipment/equipmentCardLinksEdit"; - } - /** - * 编辑链接表 - */ - @RequestMapping("/doedit4Equ.do") - public String doedit4Equ(HttpServletRequest request,Model model){ - String id = request.getParameter("id");//设备id - List equipmentCardLinks = this.equipmentCardLinksService.selectListByWhere("where equipment_id='"+id+"' and active = '1' order by insdt desc"); - if(equipmentCardLinks!=null && equipmentCardLinks.size()>0){ - model.addAttribute("equipmentCardLinks", equipmentCardLinks.get(0)); - } - model.addAttribute("equipmentId", id); - return "equipment/equipmentCardLinksEdit"; - } - - /** - * 更新链接表 - */ - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardLinks") EquipmentCardLinks equipmentCardLinks){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardLinks.setInsuser(cu.getId()); - equipmentCardLinks.setInsdt(CommUtil.nowDate()); - int result =0; - if(equipmentCardLinks.getId()!=null && !equipmentCardLinks.getId().isEmpty()){ - result = this.equipmentCardLinksService.update(equipmentCardLinks); - }else{ - equipmentCardLinks.setId(CommUtil.getUUID()); - result = this.equipmentCardLinksService.save(equipmentCardLinks); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardLinks.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 删除多个数据 - */ - @RequestMapping("/dodeletes.do") - public ModelAndView dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentCardLinksService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新还是新增链接表 - */ - @RequestMapping("/doupdateOrsave.do") - public ModelAndView doupdateOrsave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardLinks") EquipmentCardLinks equipmentCardLinks){ - int result = 0; - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardLinks.setInsuser(cu.getId()); - equipmentCardLinks.setInsdt(CommUtil.nowDate()); - if(equipmentCardLinks.getId()!=null && !("").equals(equipmentCardLinks.getId())){ - //更新 - result = this.equipmentCardLinksService.update(equipmentCardLinks); - }else{ - //新增 - equipmentCardLinks.setId(CommUtil.getUUID()); - result = this.equipmentCardLinksService.save(equipmentCardLinks); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardLinks.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 获取数据 - */ - @RequestMapping("/getdata4equipmentCard.do") - public ModelAndView getdata4equipmentCard(HttpServletRequest request,Model model){ - String equipmentCardId = request.getParameter("equipmentCardId"); - String whereStr = "where active ='"+CommString.Active_True+"' and equipment_id='"+equipmentCardId+"' order by morder"; - List list = this.equipmentCardLinksService.selectListByWhere(whereStr,equipmentCardId, request); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 设备台账_链接配置右侧list - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getList4EquipmentCard.do") - public ModelAndView getList4EquipmentCard(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1"; - - String unitId = request.getParameter("unitId"); - if (unitId != null && !unitId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and bizId in (" + companyids + ") "; - } - } - - //设备等级(ABC) - String equipmentLevel = request.getParameter("equipmentLevel"); - //工艺段id - String processSectionId = request.getParameter("processSectionId"); - //设备大类id - String equipmentClassId = request.getParameter("equipmentClassId"); - //设备状态 - String equipmentStatus = request.getParameter("equipmentstatus"); - //模糊搜索 - String search_name = request.getParameter("search_name"); - //设备id搜索(主要用于app选择设备时候 用nfc选择) - String equipmentId = request.getParameter("equipmentId"); - - //设备等级(ABC) - if (equipmentLevel != null && !equipmentLevel.isEmpty()) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - //工艺段搜索 - if (processSectionId != null && !processSectionId.trim().equals("")) { - List list = processSectionService.selectListByWhere("where 1=1 and unit_id = '" + unitId + "' and code = '" + processSectionId + "'"); - if (list != null && list.size() > 0) { - wherestr += " and processSectionId = '" + list.get(0).getId() + "' "; - } else { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - } - //模糊搜索 - if (search_name != null && !"".equals(search_name.trim())) { - wherestr += " and (equipmentCardID like '%" + search_name + "%' or equipmentName like '%" + search_name + "%' or equipmentModelName like '%" + search_name + "%' or equipmentmanufacturer like '%" + search_name + "%') "; - } - //设备大类搜索 - if (equipmentClassId != null && !equipmentClassId.trim().equals("")) { - wherestr += " and equipment_big_class_id = '" + equipmentClassId + "' "; - } - //设备id搜索(主要用于app选择设备时候 用nfc选择) - if (equipmentId != null && !equipmentId.trim().equals("")) { - wherestr += " and id = '" + equipmentId + "' "; - } - - //配置状态 - String linksStatus = request.getParameter("linksStatus"); - if (linksStatus != null && !linksStatus.trim().equals("")) { - if(EquipmentCardLinks.Status_ON.equals(linksStatus)){ - wherestr += " and id in ( select equipment_id from TB_EM_EquipmentCard_Links where equipment_id is not null)"; - }else{ - wherestr += " and id not in ( select equipment_id from TB_EM_EquipmentCard_Links where equipment_id is not null)"; - } - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardLinksService.selectListByEquipmentCard(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentCardLinksParameterController.java b/src/com/sipai/controller/equipment/EquipmentCardLinksParameterController.java deleted file mode 100644 index 1e9cc322..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCardLinksParameterController.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCardLinksParameter; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardLinksParameterService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentCardLinksParameter") -public class EquipmentCardLinksParameterController { - @Resource - private EquipmentCardLinksParameterService equipmentCardLinksParameterService; - /** - * 打开配置页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/equipmentCardLinksParameterList"; - } - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model/*, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order*/) { - User cu=(User)request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and link_name like '%"+request.getParameter("search_name")+"%' "; - } - /*if(request.getParameter("linkId")!=null && !request.getParameter("linkId").isEmpty()){ - wherestr += " and link_id like '%"+request.getParameter("linkId")+"%' "; - }*/ - wherestr += " and link_id = '"+request.getParameter("linkId")+"' "; - PageHelper.startPage(pages, pagesize); - List list = this.equipmentCardLinksParameterService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增链接 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentCardLinksParameterAdd"; - } - - /** - * 保存链接 - */ - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardLinksParameter") EquipmentCardLinksParameter equipmentCardLinksParameter){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardLinksParameter.setId(CommUtil.getUUID()); - equipmentCardLinksParameter.setInsuser(cu.getId()); - equipmentCardLinksParameter.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardLinksParameterService.save(equipmentCardLinksParameter); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardLinksParameter.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 编辑链接表 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCardLinksParameter equipmentCardLinksParameter = this.equipmentCardLinksParameterService.selectById(id); - model.addAttribute("equipmentCardLinksParameter", equipmentCardLinksParameter); - return "equipment/equipmentCardLinksParameterEdit"; - } - /** - * 更新链接表 - */ - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardLinksParameter") EquipmentCardLinksParameter equipmentCardLinksParameter){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardLinksParameter.setInsuser(cu.getId()); - equipmentCardLinksParameter.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardLinksParameterService.update(equipmentCardLinksParameter); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardLinksParameter.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 删除多个数据 - */ - @RequestMapping("/dodeletes.do") - public ModelAndView dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentCardLinksParameterService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新还是新增链接表 - */ - @RequestMapping("/doupdateOrsave.do") - public ModelAndView doupdateOrsave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardLinksParameter") EquipmentCardLinksParameter equipmentCardLinksParameter){ - int result = 0; - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardLinksParameter.setInsuser(cu.getId()); - equipmentCardLinksParameter.setInsdt(CommUtil.nowDate()); - if(equipmentCardLinksParameter.getId()!=null && !("").equals(equipmentCardLinksParameter.getId())){ - //更新 - result = this.equipmentCardLinksParameterService.update(equipmentCardLinksParameter); - }else{ - //新增 - equipmentCardLinksParameter.setId(CommUtil.getUUID()); - result = this.equipmentCardLinksParameterService.save(equipmentCardLinksParameter); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardLinksParameter.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentCardPropController.java b/src/com/sipai/controller/equipment/EquipmentCardPropController.java deleted file mode 100644 index 17130f98..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCardPropController.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.sipai.controller.equipment; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentCardProp") -public class EquipmentCardPropController { - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private UnitService unitService; - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model/*, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order*/) { - User cu=(User)request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; -// String wherestr="where bizId = '"+request.getParameter("companyId")+"'"; - if(request.getParameter("equipmentId")!=null && !request.getParameter("equipmentId").isEmpty()){ - wherestr += " and equipment_id = '"+request.getParameter("equipmentId")+"' "; - } - /*if(request.getParameter("lineId")!=null && !request.getParameter("lineId").isEmpty()){ - wherestr += " and L.line_id like '%"+request.getParameter("lineId")+"%' "; - }*/ - PageHelper.startPage(pages, pagesize); - List list = this.equipmentCardPropService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增设备附属 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - String equipmentCardId = request.getParameter("equipmentCardId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - model.addAttribute("equipmentCardId",equipmentCardId); - return "equipment/equipmentCardPropAdd"; - } - - /** - * 保存设备附属 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardProp") EquipmentCardProp equipmentCardProp){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardProp.setId(CommUtil.getUUID()); - equipmentCardProp.setInsuser(cu.getId()); - equipmentCardProp.setInsdt(CommUtil.nowDate()); - if(equipmentCardProp.getEnergyMoney()==null){ - equipmentCardProp.setEnergyMoney(new BigDecimal(0)); - } - if(equipmentCardProp.getMaintainIncrement()==null){ - equipmentCardProp.setMaintainIncrement(new BigDecimal(1)); - } - int result = this.equipmentCardPropService.save(equipmentCardProp); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardProp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 编辑设备附属表 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectById(id); - model.addAttribute("equipmentCardProp", equipmentCardProp); - return "equipment/equipmentCardPropEdit"; - } - /** - * 更新设备附属表 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardProp") EquipmentCardProp equipmentCardProp){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardProp.setInsuser(cu.getId()); - equipmentCardProp.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardPropService.update(equipmentCardProp); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardProp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除多个设备数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentCardPropService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新还是新增设备附属表 - */ - @RequestMapping("/doupdateOrsave.do") - public String doupdateOrsave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentCardProp") EquipmentCardProp equipmentCardProp){ - int result = 0; - User cu= (User)request.getSession().getAttribute("cu"); - equipmentCardProp.setInsuser(cu.getId()); - equipmentCardProp.setInsdt(CommUtil.nowDate()); - if(equipmentCardProp.getId()!=null && !("").equals(equipmentCardProp.getId())){ - //更新 - result = this.equipmentCardPropService.update(equipmentCardProp); - }else{ - //新增 - equipmentCardProp.setId(CommUtil.getUUID()); - if(equipmentCardProp.getEnergyMoney()==null){ - equipmentCardProp.setEnergyMoney(new BigDecimal(0)); - } - if(equipmentCardProp.getMaintainIncrement()==null){ - equipmentCardProp.setMaintainIncrement(new BigDecimal(1)); - } - result = this.equipmentCardPropService.save(equipmentCardProp); - } - - - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCardProp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentCardPumpController.java b/src/com/sipai/controller/equipment/EquipmentCardPumpController.java deleted file mode 100644 index 26199ed1..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCardPumpController.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.sipai.controller.equipment; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.visual.JspElement; -import com.sipai.service.scada.MPointService; -import com.sipai.service.visual.GetValueService; -import com.sipai.service.visual.JspElementService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.List; - -@Controller -@RequestMapping("/equipment/pump") -public class EquipmentCardPumpController { - - @Resource - private JspElementService jspElementService; - @Resource - private GetValueService getValueService; - @Resource - private MPointService mPointService; - /** - * 泵组水量预测和泵组优化调度 - */ - @RequestMapping("/management.do") - public String pumpAnalysisModel(HttpServletRequest request,Model model) { - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - request.setAttribute("unitId", request.getParameter("unitId")); - } - String nowDate = CommUtil.nowDate().substring(0, 10); - model.addAttribute("nowDate", nowDate); - return "equipment/pumpManagement"; - } - /** - * 泵组水量预测获取数据 - */ - @RequestMapping("/getWaterForecastData.do") - public ModelAndView getWaterForecastData(HttpServletRequest request,Model model) { - String bizid=""; - String jsp_id=""; - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - bizid=request.getParameter("bizid"); - } - String time=""; - if(request.getParameter("time")!=null && !request.getParameter("time").isEmpty()){ - time=request.getParameter("time"); - } - if(request.getParameter("jsp_id")!=null && !request.getParameter("jsp_id").isEmpty()){ - jsp_id=request.getParameter("jsp_id"); - } - - JSONArray jsonArray = new JSONArray(); - jsonArray = getValue4Group(bizid,time,jsp_id); - int res=0; - if(jsonArray!=null && jsonArray.size()>0){ - res=1; - } - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - String result = "{\"res\":"+res+",\"rows\":"+jsonArray+",\"children\":"+jsonArray_children+",\"nowDate\":\""+CommUtil.nowDate()+"\"}"; - request.setAttribute("result", result); - return new ModelAndView("result"); - } - public JSONArray getValue4Group(String bizid,String time,String jsp_id){ - List list = this.jspElementService.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i0){ - res=1; - } - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - String result = "{\"res\":"+res+",\"rows\":"+jsonArray+",\"children\":"+jsonArray_children+"}"; - request.setAttribute("result", result); - return new ModelAndView("result"); - } - /** - * 泵组水量预测和泵组优化调度(佛山) - */ - @RequestMapping("/managementFS.do") - public String managementFS(HttpServletRequest request,Model model) { - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - request.setAttribute("unitId", request.getParameter("unitId")); - } - String nowDate = CommUtil.nowDate().substring(0, 10); - model.addAttribute("nowDate", nowDate); - return "equipment/pumpManagementFS"; - } - /** - * 泵组水量预测和泵组优化调度(佛山沙口一泵组) - */ - @RequestMapping("/pumpOneManagementSK.do") - public String pumpOneManagementSK(HttpServletRequest request,Model model) { - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - request.setAttribute("unitId", request.getParameter("unitId")); - } - String nowDate = CommUtil.nowDate().substring(0, 10); - model.addAttribute("nowDate", nowDate); - return "equipment/pumpOneManagementSK"; - } - /** - * 滤池反冲洗模型 - */ - @RequestMapping("/filterModel.do") - public String filterModel(HttpServletRequest request,Model model) { - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - request.setAttribute("unitId", request.getParameter("unitId")); - } - String nowDate = CommUtil.nowDate().substring(0, 10); - model.addAttribute("nowDate", nowDate); - return "equipment/filterModel"; - } - /** - * 加药量获取数据 - */ - @RequestMapping("/doRowEditPost.do") - public ModelAndView doRowEditPost(HttpServletRequest request,Model model) { - String bizId = ""; - String mpointid = ""; - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - bizId=request.getParameter("bizid"); - } - String value = "0"; - if(request.getParameter("value")!=null && !request.getParameter("value").isEmpty()){ - value=request.getParameter("value"); - } - if(request.getParameter("mpointid")!=null && !request.getParameter("mpointid").isEmpty()){ - mpointid=request.getParameter("mpointid"); - } - MPoint mPoint = new MPoint(); - mPoint = this.mPointService.selectById(bizId, mpointid); - int res = 0; - if(mPoint!=null){ - String nowTime = CommUtil.nowDate(); - mPoint.setParmvalue(new BigDecimal(value)); - mPoint.setMeasuredt(nowTime); - //res = this.mPointService.update(bizId, mPoint); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setInsdt(nowTime); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setParmvalue(new BigDecimal(value)); - res=mPointService.updateValue(bizId,mPoint,mPointHistory); - } - String result = "{\"result\":"+res+"}"; - request.setAttribute("result", result); - return new ModelAndView("result"); - } - /** - * 泵组水量预测和泵组优化调度(重庆白洋滩一泵组) - */ - @RequestMapping("/pumpOneManagementCQ.do") - public ModelAndView pumpOneManagementCQ(HttpServletRequest request,Model model) { - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - request.setAttribute("unitId", request.getParameter("unitId")); - } - String nowDate = CommUtil.nowDate().substring(0, 10); - model.addAttribute("nowDate", nowDate); - return new ModelAndView("equipment/pumpOneManagementCQ"); - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentCardRemarkController.java b/src/com/sipai/controller/equipment/EquipmentCardRemarkController.java deleted file mode 100644 index 296137ab..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCardRemarkController.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.sipai.controller.equipment; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.equipment.EquipmentCardRemark; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentRemarkService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -@Controller -@RequestMapping("/equipment/equipmentCardRemark") -public class EquipmentCardRemarkController { - @Resource - private EquipmentCardCameraService equipmentCardCameraService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentRemarkService equipmentRemarkService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/equipmentCardCameraList"; - } - - @RequestMapping("/showListForEqView.do") - public String showListForEqView(HttpServletRequest request, Model model) { - return "/equipment/equipmentCardCameraListForEqView"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by morder "; - - String wherestr = "where 1=1 and eqid='" + request.getParameter("eqid") + "' "; -// if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and levelname like '%" + request.getParameter("search_name") + "%' "; -// } - PageHelper.startPage(page, rows); - List list = this.equipmentCardCameraService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getRemarkList.do") - public ModelAndView getCameraEqList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and card_id='"+request.getParameter("equId")+"' "; - - PageHelper.startPage(page, rows); - List list = this.equipmentRemarkService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "equipment/equipmentCardReamrkAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - int result = this.equipmentRemarkService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentRemarkService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model) { - String eqid = request.getParameter("eqid"); - String name = request.getParameter("name"); - String content = request.getParameter("content"); - User cu = (User) request.getSession().getAttribute("cu"); - EquipmentCardRemark equipmentCardRemark = new EquipmentCardRemark(); - String uuid = CommUtil.getUUID(); - equipmentCardRemark.setId(uuid); - equipmentCardRemark.setName(name); - equipmentCardRemark.setContent(content); - equipmentCardRemark.setInsUser(cu.getId()); - equipmentCardRemark.setCardId(eqid); - equipmentCardRemark.setInsdt(CommUtil.nowDate()); - int save = equipmentRemarkService.save(equipmentCardRemark); - String result = "{\"total\":" + save + ",\"id\":\"" + uuid + "\"}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - model.addAttribute("id", id); - return "equipment/equipmentCardReamrkView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentCardRemark equipmentCardRemark = this.equipmentRemarkService.selectById(id); - model.addAttribute("equipmentCardRemark", equipmentCardRemark); - return "equipment/equipmentCardReamrkEdit"; - } - - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String name = request.getParameter("name"); - String content = request.getParameter("content"); - EquipmentCardRemark equipmentCardRemark = new EquipmentCardRemark(); - equipmentCardRemark.setId(id); - equipmentCardRemark.setName(name); - equipmentCardRemark.setContent(content); - int update = this.equipmentRemarkService.update(equipmentCardRemark); - String result = "{\"total\":" + update + ",\"id\":\"" + id + "\"}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/selectListForCamera.do") - public String selectList(HttpServletRequest request, Model model) { - return "/equipment/equipmentCamera4Select"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - EquipmentCardCamera equipmentCardCamera = new EquipmentCardCamera(); - jsonOne = json.getJSONObject(i); - equipmentCardCamera.setId((String) jsonOne.get("id")); - equipmentCardCamera.setMorder(i); - result = this.equipmentCardCameraService.update(equipmentCardCamera); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentClassController.java b/src/com/sipai/controller/equipment/EquipmentClassController.java deleted file mode 100644 index e4ee7cec..00000000 --- a/src/com/sipai/controller/equipment/EquipmentClassController.java +++ /dev/null @@ -1,1211 +0,0 @@ - -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.user.ProcessSection; -import com.sipai.tools.LibraryTool; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentClassProp; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassPropService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentClass") -public class EquipmentClassController { - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentClassPropService equipmentClassPropService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UnitService unitService; - @Resource - private AssetClassService assetClassService; - @Resource - private LibraryTool libraryTool; - - //2020-07-06 start - @RequestMapping("/equipmentClassShowList.do") - public String equipmentClassShowList(HttpServletRequest request, Model model) { - //return "maintenance/faultlibraryManage"; - return "equipment/equipmentClassManage"; - } - - @RequestMapping("/getEquipmentClassJson.do") - public String getFaultLibrariesJsontest(HttpServletRequest request, Model model) { - List list = equipmentClassService.selectListByWhere("where 1=1 order by morder"); - String json = equipmentClassService.getTreeListtest(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doAddEquipmentClass.do") - public String doAddEquipmentClass(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - //FaultLibrary faultLibrary= faultLibraryService.selectById(pid); - model.addAttribute("pname", equipmentClass.getName()); - } - //return "maintenance/faultlibraryAdd"; - return "equipment/equipmentClassNewAdd"; - } - //2020-07-06 end - - //2020-07-07 start - - /** - * 保存设备类型数据 - */ - @RequestMapping("/saveEquipmentClass.do") - public String saveEquipmentClass(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentClass.setId(CommUtil.getUUID()); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate()); - int result = this.equipmentClassService.save(equipmentClass); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClass.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/modifyEquipmentClass.do") - public String modifyEquipmentClass(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass) { - /* User cu= (User)request.getSession().getAttribute("cu"); - equipmentClass.setId(CommUtil.getUUID()); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate());*/ - int result = this.equipmentClassService.update(equipmentClass); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClass.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存设备类型附属表数据 - */ - @RequestMapping("/modifyEquipmentClassProp.do") - public String modifyEquipmentClassProp(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClassProp") EquipmentClassProp equipmentClassProp) { - /* User cu= (User)request.getSession().getAttribute("cu"); - equipmentClassProp.setId(CommUtil.getUUID()); - equipmentClassProp.setInsuser(cu.getId()); - equipmentClassProp.setInsdt(CommUtil.nowDate());*/ - int result = this.equipmentClassPropService.update(equipmentClassProp); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClassProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request, Model model) { - return "equipment/equipmentClass4select"; - } - - //2020-07-08 start - @RequestMapping("/selectEquipmentClass.do") - public String selectEquipmentClass(HttpServletRequest request, Model model) { - //return "equipment/equipmentClass4select"; - return "equipment/selectEquipmentClass"; - } - - @RequestMapping("/selectEquipmentClassForType.do") - public String selectEquipmentClassForType(HttpServletRequest request, Model model) { - //return "equipment/equipmentClass4select"; - return "equipment/selectEquipmentClassForType"; - } - - @ResponseBody - @RequestMapping("/getEquipmentClassParent.do") - public Map getEquipmentClassParent(HttpServletRequest request, Model model) { - //return "equipment/equipmentClass4select"; - String equipmentClassId = request.getParameter("equipmentClassId"); - Map equipmentClassCodeMap = new HashMap<>(); - String resultEquipmentClassCode = ""; - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentClassId); - if (null != equipmentClass && !"".equals(equipmentClass)) { - String resultEquipmentClassCodeStr = equipmentClassService.selectBelongAllParentId(equipmentClass, equipmentClass.getEquipmentClassCode()); - - String[] resultEquipmentClassCodeArr = resultEquipmentClassCodeStr.split(","); - for (int i = resultEquipmentClassCodeArr.length - 1; i >= 0; i--) { - resultEquipmentClassCode += resultEquipmentClassCodeArr[i]; - } - } - equipmentClassCodeMap.put("data", resultEquipmentClassCode); - return equipmentClassCodeMap; - } - - //2020-07-08 end - - @RequestMapping("/editEquipmentClass.do") - public String editEquipmentClass(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentClass equipmentClass = equipmentClassService.selectById(id); - List equipmentClassProp = equipmentClassPropService.selectListByWhere(" where equipment_class_id = '" + id + "'"); - if (equipmentClassProp != null && equipmentClassProp.size() > 0) { - model.addAttribute("equipmentClassProp", equipmentClassProp.get(0)); - } - model.addAttribute("equipmentClass", equipmentClass); - return "equipment/equipmentClassNewEdit"; - //FaultLibrary faultLibrary = this.faultLibraryService.selectById(id); - //model.addAttribute("faultLibrary",faultLibrary ); - //return "maintenance/faultlibraryEdit"; - } - - @RequestMapping("/delEquipmentClassAndProp.do") - public String delEquipmentClassAndProp(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = equipmentClassService.deleteAllById(id); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - //2020-07-07 end - - - /** - * 打开设备类型界面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/equipmentClassList"; - } - - /** - * 获取设备类型list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentClassService.selectListByWhere(wherestr + orderstr); - //获取设备类型附属表:经济寿命设定 - for (int i = 0; i < list.size(); i++) { - List equipmentClassProp = this.equipmentClassPropService - .selectListByWhere(" where equipment_class_id = '" + list.get(i).getId() + "'"); - if (equipmentClassProp != null && equipmentClassProp.size() != 0) { - list.get(i).setEquipmentClassProp(equipmentClassProp.get(0)); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 打开新增设备类型界面 原先珠海 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "equipment/equipmentClassAdd_old"; - } - - /** - * 新增界面-----sj 2020-07-09 - * - * @param request - * @param model - * @param pid - * @return - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("")) { - EquipmentClass entity = equipmentClassService.selectById(pid); - model.addAttribute("pname", entity.getName()); - } - model.addAttribute("id", CommUtil.getUUID()); - return "equipment/equipmentClassAdd"; - } - - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.equipmentClassService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除一条设备类型拓展数据 - */ - @RequestMapping("/doDeleteProp.do") - public String doDeleteProp(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentClassPropService.deleteByWhere(" where equipment_class_id = '" + id + "'"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentClassService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/doDeletesProp.do") - public String doDeletesProp(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentClassPropService.deleteByWhere("where equipment_class_id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存设备类型数据 珠海保存 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentClass.setId(CommUtil.getUUID()); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate()); - - int result = this.equipmentClassService.save(equipmentClass); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClass.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 设备类别保存 sj 2020-07-09 - * - * @param request - * @param model - * @param equipmentClass - * @return - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass) { - User cu = (User) request.getSession().getAttribute("cu"); - //equipmentClass.setId(CommUtil.getUUID()); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate()); - int res = this.equipmentClassService.save(equipmentClass); - //更改资产的设备类别 - if (equipmentClass.getAssetClassId() != null) { - String assclassId = equipmentClass.getAssetClassId().replace(",", "','"); - List list = this.assetClassService.selectListByWhere("where id in ('" + assclassId + "')"); - for (AssetClass assetClass : list) { - assetClass.setClassId(equipmentClass.getId()); - this.assetClassService.update(assetClass); - } - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 保存设备类型附属表数据 - */ - @RequestMapping("/doSaveProp.do") - public String doSaveProp(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClassProp") EquipmentClassProp equipmentClassProp) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentClassProp.setId(CommUtil.getUUID()); - equipmentClassProp.setInsuser(cu.getId()); - equipmentClassProp.setInsdt(CommUtil.nowDate()); - int result = this.equipmentClassPropService.save(equipmentClassProp); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClassProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 检查设备类型的名称是否重复 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request, Model model) { - String name = request.getParameter("name"); - String id = request.getParameter("id"); - if (this.equipmentClassService.checkNotOccupied(id, name)) { - model.addAttribute("result", "{\"valid\":" + false + "}"); - return "result"; - } else { - model.addAttribute("result", "{\"valid\":" + true + "}"); - return "result"; - } - } - - /** - * 查看设备类型信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentClass equipmentClass = this.equipmentClassService.selectById(id); - model.addAttribute("equipmentClass", equipmentClass); - return "equipment/equipmentClassView"; - } - - /** - * 打开编辑设备类型信息界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentClass equipmentClass = this.equipmentClassService.selectById(id); - List equipmentClassProp = this.equipmentClassPropService.selectListByWhere(" where equipment_class_id = '" + id + "'"); - model.addAttribute("equipmentClass", equipmentClass); - if (equipmentClassProp != null && equipmentClassProp.size() != 0) { - model.addAttribute("equipmentClassProp", equipmentClassProp.get(0)); - } - return "equipment/equipmentClassEdit_old"; - } - - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentClass equipmentClass = equipmentClassService.selectById(id); - if (equipmentClass != null) { - EquipmentClass equipmentClass2 = equipmentClassService.selectById(equipmentClass.getPid()); - if (equipmentClass2 != null) { - equipmentClass.set_pname(equipmentClass2.getName()); - } - if (equipmentClass.getAssetClassId() != null) { - String AssetClass = ""; - String AssetClassname = ""; - List list = this.assetClassService.selectListByWhere("where class_id = '" + equipmentClass.getId() + "' "); - for (int i = 0; i < list.size(); i++) { - AssetClass += list.get(i).getId(); - AssetClassname += list.get(i).getAssetclassname(); - if (i < list.size() - 1) { - AssetClass += ","; - AssetClassname += ","; - } - } - equipmentClass.set_assetClassname(AssetClassname); - equipmentClass.setAssetClassId(AssetClass); - } - model.addAttribute("equipmentClass", equipmentClass); - } - return "equipment/equipmentClassEdit"; - } - - /** - * 更新设备类型信息 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate()); - int result = this.equipmentClassService.update(equipmentClass); - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClass.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新设备类型信息 - */ - @RequestMapping("/update.do") - public String update(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate()); - String code = ""; - int markInt = 0; - Map resultMap = new HashMap<>(); - resultMap = equipmentClassService.getCodeFull4Tree(resultMap, equipmentClass.getEquipmentClassCode(), equipmentClass.getPid(), markInt); - - //倒序输出设备编码 - ListIterator> li = new ArrayList>(resultMap.entrySet()).listIterator(resultMap.size()); - while (li.hasPrevious()) { - Map.Entry entry = li.previous(); - //拼接设备全编码 - code += entry.getValue(); - //System.out.println(entry.getKey()+":"+entry.getValue()); - } - - equipmentClass.setEquipmentClassCodeFull(code); - //更改资产的设备类别 - if (equipmentClass.getAssetClassId() != null) { - String assclassId = equipmentClass.getAssetClassId().replace(",", "','"); - List list1 = this.assetClassService.selectListByWhere("where class_id = '" + equipmentClass.getId() + "'"); - for (AssetClass assetClass : list1) { - assetClass.setClassId(""); - this.assetClassService.update(assetClass); - } - List list = this.assetClassService.selectListByWhere("where id in ('" + assclassId + "')"); - for (AssetClass assetClass : list) { - assetClass.setClassId(equipmentClass.getId()); - this.assetClassService.update(assetClass); - } - } - int res = this.equipmentClassService.update(equipmentClass); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 更新设备类型信息 - */ - @RequestMapping("/doUpdateProp.do") - public String doUpdateProp(HttpServletRequest request, Model model, - @ModelAttribute("equipmentClassProp") EquipmentClassProp equipmentClassProp) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentClassProp.setInsuser(cu.getId()); - equipmentClassProp.setInsdt(CommUtil.nowDate()); - int result = 0; - if (equipmentClassProp.getId() != "") { - result = this.equipmentClassPropService.update(equipmentClassProp); - } else { - equipmentClassProp.setId(CommUtil.getUUID()); - result = this.equipmentClassPropService.save(equipmentClassProp); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentClassProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 选择设备类型 - */ - @RequestMapping("/getEquipmentClassForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request, Model model) { - - String wherestr = ""; - String classID = request.getParameter("class_id"); - if (classID != null && classID != "" && !classID.isEmpty()) { - classID = classID.replace(",", "','"); - wherestr += " and id in ('" + classID + "') "; - } - String classPid = request.getParameter("class_pid"); - if (classPid != null && classPid != "" && !classPid.isEmpty()) { - classPid = classPid.replace(",", "','"); - wherestr += " and pid in ('" + classPid + "') "; - } - List list = this.equipmentClassService.selectListByWhere("where (active= '1' or active= '启用') " + wherestr + " order by morder"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (EquipmentClass equipmentClass : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentClass.getId()); - jsonObject.put("text", equipmentClass.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - @RequestMapping("/getEquipmentClassname.do") - public String getequipmentclassname(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - - /** - * 设备分类配置界面 sj 2020-07-08 - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request, Model model) { - return "/equipment/equipmentClass4Tree"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 "; - List list = this.equipmentClassService.selectListByWhere(wherestr + " order by morder"); - String json = equipmentClassService.getTreeListtest(null, list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getIndexList.do") - public ModelAndView getIndexList(HttpServletRequest request, Model model) { - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 6; - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and pid = '-1' "; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or code like '%" + request.getParameter("search_name") + "%' )"; - } - PageHelper.startPage(pages, pagesize); - List list = this.equipmentClassService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); -// System.out.println(json); - String result = "{\"total\":" + pi.getTotal() + ",\"result\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备分类树 只获取到设备不获取部位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTreeJson4Equ.do") - public String getTreeJson4Equ(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 and type is not null and type!='" + CommString.EquipmentClass_Parts + "' order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String json = equipmentClassService.getTreeListtest(null, list); - Result result = Result.success(json); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 查询是否为最末节点 mww 2020-09-07 - */ - @RequestMapping("/getSon.do") - public String getSon(HttpServletRequest request, Model model) { - - String wherestr = "where 1=1 and pid ='" + request.getParameter("pid") + "'"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - - if (list.size() == 0) { - model.addAttribute("result", "{\"ki\":" + true + "}"); - } else { - model.addAttribute("result", "{\"ki\":" + false + "}"); - } - - return "result"; - - - } - - /** - * 维修库中的搜索改变的树形结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTreeJson4Where.do") - public String getTreeJson4Where(HttpServletRequest request, Model model) { - String classIds = request.getParameter("ids"); - - //创建TreeSet - //TreeSet list = new TreeSet(); - //反向递归找到子节点的所有父节点及根节点 - TreeSet list2 = equipmentClassService.selectListByIds(classIds); - - String ids = ""; - Iterator itSet = list2.iterator();//也可以遍历输出 - while (itSet.hasNext()) { - ids += "'" + itSet.next() + "',"; - } - if (!ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - - String whereStr = ""; - if (classIds != null && !classIds.equals("")) { - whereStr += "where id in (" + ids + ")"; - } else { - whereStr += ""; - } - - List list3 = this.equipmentClassService.selectListByWhere(whereStr); - - String json = equipmentClassService.getTreeListtest(null, list3); - Result result = Result.success(json); - // System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 根据设备台帐查询该厂区用到的工艺段 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTreeJson4EquipmentCard.do") - public String getTreeJson4EquipmentCard(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String wherestr = "where 1=1"; - String ids = ""; - - List list = equipmentCardService.getEquipmentClassIdGroup(unitId); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - if (list.get(i) != null) { - ids += "'" + list.get(i).getEquipmentBigClassId() + "',"; - } - } - ids = ids.substring(0, ids.length() - 1); - wherestr += " and id in (" + ids + ")"; - } else { - wherestr += " and 1!=1 "; - } - - - String wherestr2 = "where 1=1"; - String classIds = ""; - //根据设备台帐group by的设备分类id 递归查询所有的ids - List list2 = this.equipmentClassService.selectListByWhere(wherestr); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, list2.get(i).getId()); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - classIds += "'" + iter.next() + "',"; - } - } - classIds = classIds.substring(0, classIds.length() - 1); - wherestr2 += " and id in (" + classIds + ")"; - } else { - wherestr2 += " and 1!=1 "; - } - - List list3 = this.equipmentClassService.selectListByWhere(wherestr2 + "order by equipment_class_code"); - String json = equipmentClassService.getTreeListtest(null, list3); - - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 设备大类--设备小类--设备 (只查已有的设备对应的设备类别,其余无) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree4EquipmentCard.do") - public String getTree4EquipmentCard(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - HashSet smallset = new HashSet(); - - //获取所有设备台账对应的设备小类去重后id - List list = equipmentCardService.getEquipmentClassIdGroupByBizId(unitId); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - smallset.add(list.get(i).getEquipmentclassid()); - } - } - - //所有根节点id - HashSet rootIds = new HashSet(); - for (Iterator iter = smallset.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getRootId(set, sid); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - String rid = iterroot.next(); - rootIds.add(rid); - } - } - - if ("y".equals(libraryTool.getRepairPart())) { - //获取完根节点后再获取设备部位 避免重复获取根节点 - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List listClass = equipmentClassService.selectListByWhere("where pid = '" + list.get(i).getEquipmentclassid() + "'"); - if (listClass != null && listClass.size() > 0) { - for (int j = 0; j < listClass.size(); j++) { - smallset.add(listClass.get(j).getId()); - } - } - } - } - } - - String bigId = ""; - if (rootIds != null && rootIds.size() > 0) { - for (Iterator iter = rootIds.iterator(); iter.hasNext(); ) { - String id = iter.next(); - bigId += "'" + id + "',"; - } - bigId = bigId.substring(0, bigId.length() - 1); - } - - //所有存在的节点 - List listchild = null; - //查询所有子节点 - - String allId = ""; - String smallId = ""; - - if (bigId != null && !bigId.equals("")) { - //查询所有的根节点 - JSONArray rootArray = new JSONArray(); - List listroot = this.equipmentClassService.selectListByWhere(" where id in (" + bigId + ")"); - if (listroot != null && listroot.size() > 0) { - for (int i = 0; i < listroot.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", listroot.get(i).getId()); - jsonObject.put("text", listroot.get(i).getEquipmentClassCode() + "" + listroot.get(i).getName()); - jsonObject.put("pid", listroot.get(i).getPid()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - - - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, listroot.get(i).getId()); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - if (smallset.contains(sid) == true) { - smallId += "'" + sid + "',"; - } - } - - rootArray.add(jsonObject); - } - allId = smallId + bigId; - - if (allId != null && !allId.equals("")) { - listchild = this.equipmentClassService.selectListByWhere(" where id in (" + allId + ") order by equipment_class_code asc"); - } - } - } - - String json = equipmentClassService.getTreeListtest(null, listchild); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 设备大类--设备小类--设备 (只查已有的设备对应的设备类别,其余无)//去掉部位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree4EquipmentCardWithoutParts.do") - public String getTree4EquipmentCardWithoutParts(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - HashSet smallset = new HashSet(); - - //获取所有设备台账对应的设备小类去重后id - List list = equipmentCardService.getEquipmentClassIdGroupByBizId(unitId); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - smallset.add(list.get(i).getEquipmentclassid()); - } - } - - //所有根节点id - HashSet rootIds = new HashSet(); - for (Iterator iter = smallset.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getRootId(set, sid); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - String rid = iterroot.next(); - rootIds.add(rid); - } - } - - //获取完根节点后再获取设备部位 避免重复获取根节点 - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List listClass = equipmentClassService.selectListByWhere("where pid = '" + list.get(i).getEquipmentclassid() + "'"); - if (listClass != null && listClass.size() > 0) { - for (int j = 0; j < listClass.size(); j++) { - smallset.add(listClass.get(j).getId()); - } - } - } - } - - String bigId = ""; - if (rootIds != null && rootIds.size() > 0) { - for (Iterator iter = rootIds.iterator(); iter.hasNext(); ) { - String id = iter.next(); - bigId += "'" + id + "',"; - } - bigId = bigId.substring(0, bigId.length() - 1); - } - - //所有存在的节点 - List listchild = null; - //查询所有子节点 - - String allId = ""; - String smallId = ""; - - //查询所有的根节点 - JSONArray rootArray = new JSONArray(); - List listroot = this.equipmentClassService.selectListByWhere(" where id in (" + bigId + ")"); - if (listroot != null && listroot.size() > 0) { - for (int i = 0; i < listroot.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", listroot.get(i).getId()); - jsonObject.put("text", listroot.get(i).getEquipmentClassCode() + "" + listroot.get(i).getName()); - jsonObject.put("pid", listroot.get(i).getPid()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - - - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, listroot.get(i).getId()); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - if (smallset.contains(sid) == true) { - smallId += "'" + sid + "',"; - } - } - - rootArray.add(jsonObject); - } - allId = smallId + bigId; - listchild = this.equipmentClassService.selectListByWhere(" where id in (" + allId + ") and type!='" + CommString.EquipmentClass_Parts + "' order by equipment_class_code asc"); - } - - String json = equipmentClassService.getTreeListtest(null, listchild); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 设备大类--设备小类--型号--部位(如有部位) - * @param request - * @param model - * @return - */ -// @RequestMapping("/getTree4Model.do") -// public String getTree4Model(HttpServletRequest request,Model model){ -// String unitId = request.getParameter("unitId"); - - /*HashSet smallset = new HashSet(); - //获取所有设备台账对应的设备小类去重后id - List list = equipmentCardService.getEquipmentClassIdGroupByBizId(unitId); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - smallset.add(list.get(i).getEquipmentclassid()); - } - } - - //所有根节点id - HashSet rootIds = new HashSet(); - for(Iterator iter = smallset.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getRootId(set, sid); - for(Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - String rid = iterroot.next(); - rootIds.add(rid); - } - } - - String bigId = ""; - if(rootIds!=null && rootIds.size()>0){ - for(Iterator iter = rootIds.iterator(); iter.hasNext(); ) { - String id = iter.next(); - bigId += "'" + id + "',"; - } - bigId = bigId.substring(0,bigId.length() - 1); - } - - //所有存在的节点 - List listchild = null; - //查询所有子节点 - - String allId = ""; - String smallId = ""; - - //查询所有的根节点 - JSONArray rootArray = new JSONArray(); - List listroot = this.equipmentClassService.selectListByWhere(" where id in ("+bigId+")"); - if(listroot!=null && listroot.size()>0){ - for (int i = 0; i < listroot.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", listroot.get(i).getId()); - jsonObject.put("text", listroot.get(i).getEquipmentClassCode()+""+listroot.get(i).getName()); - jsonObject.put("pid", listroot.get(i).getPid()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - - - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, listroot.get(i).getId()); - for(Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - if(smallset.contains(sid) == true){ - smallId += "'" + sid + "',"; - } - } - - rootArray.add(jsonObject); - } - allId = smallId + bigId; - listchild = this.equipmentClassService.selectListByWhere(" where id in ("+allId+")"); - }*/ - - //所有存在的节点 -// List listchild = null; -// listchild = this.equipmentClassService.selectListByWhere(" where 1=1 and active = '启用' order by morder"); -// //System.out.println("where 1=1 and active = '"+CommString.Active_True+"'"); -// String json = equipmentClassService.getTreeListtest4Model(null, listchild, unitId); -// Result result = Result.success(json); -// model.addAttribute("result",CommUtil.toJson(result)); -// return "result"; -// } - - /** - * 设备大类--设备小类--型号--部位(如有部位) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree4Model.do") - public String getTree4Model(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - //所有存在的节点 - List listchild = null; - listchild = this.equipmentClassService.selectListByWhere(" where 1=1 and active = '启用' order by morder"); - //System.out.println("where 1=1 and active = '"+CommString.Active_True+"'"); - String json = equipmentClassService.getTreeListtest4Model(null, listchild, unitId); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * 导入设备类型树 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importEquipmentClass.do") - public String doimport(HttpServletRequest request, Model model) { - return "equipment/equipmentClassImport"; - } - - /** - * 保存设备类型树 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = (MultipartFile) multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - -// String wherestr ="where 1=1 order by morder"; -// List list = this.equipmentClassService.selectListByWhere(wherestr); -// String jsonstr = equipmentClassService.getTreeListtest(null, list); - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? equipmentClassService.readXls(excelFile.getInputStream(), cu.getId(), unitId) : this.equipmentClassService.readXlsx(excelFile.getInputStream(), cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 大修库导出 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.equipmentClassService.doExportEquipmentClass(response, unitId); - return null; - } - - /** - * 设备类型树json - */ - @RequestMapping("/getEquipmentClassJsonForTree.do") - public String getEquipmentClassJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String wherestr = "where 1=1 "; - //递归查询 - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and unit_id in (" + companyids + ") "; - } else { - wherestr += " and unit_id='" + unitId + "'"; - } - String classID = request.getParameter("classID"); - if (classID != null && classID != "" && !classID.isEmpty()) { - wherestr += " and (id='" + classID + "' or pid='" + classID + "' ) order by morder"; - } else { - wherestr += " or unit_id = '-999' order by morder"; - } - List list = this.equipmentClassService.selectListByWhere(wherestr); - if (list.size() <= 0) { - wherestr = ""; - if (classID != null && classID != "" && !classID.isEmpty()) { - wherestr += " and (id='" + classID + "' or pid='" + classID + "' )"; - } - list = this.equipmentClassService.selectListByWhere("where 1=1 " + wherestr + " order by morder"); - } - String json = equipmentClassService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取设备类型 仅根目录层级 - * sj 2021-12-01 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentClassJson4Root.do") - public String getEquipmentClassJson4Root(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 and pid = '-1' and (active= '1' or active= '启用') order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (EquipmentClass equipmentClass : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentClass.getId()); - jsonObject.put("text", equipmentClass.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentCodeController.java b/src/com/sipai/controller/equipment/EquipmentCodeController.java deleted file mode 100644 index cf357f3d..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCodeController.java +++ /dev/null @@ -1,351 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentClassProp; -import com.sipai.entity.equipment.EquipmentCode; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentClassPropService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentCodeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentCode") -public class EquipmentCodeController { - @Resource - private EquipmentCodeService equipmentCodeService; - - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentClassPropService equipmentClassPropService; - - @ResponseBody - @RequestMapping("/saveEquipmentCode.do") - public Map saveEquipmentCode(HttpServletRequest request,Model model) { - EquipmentCode equipmentCode = new EquipmentCode(); - User cu=(User)request.getSession().getAttribute("cu"); - String codeRule=request.getParameter("codeRule"); - String waterNumLen=request.getParameter("waterNumLen"); - String active=request.getParameter("active"); - - equipmentCode.setId(CommUtil.getUUID()); - equipmentCode.setInsdt(CommUtil.nowDate()); - equipmentCode.setInsuser(cu.getId()); - equipmentCode.setCodeRule(codeRule); - equipmentCode.setWaterNumLen(Integer.parseInt(waterNumLen)); - equipmentCode.setActive(Integer.parseInt(active)); - Map message = new HashMap<>(); - int result=equipmentCodeService.save(equipmentCode); - - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - } - - @ResponseBody - @RequestMapping("/findEquipmentCodeByCode.do") - public Map findEquipmentCodeByCode(HttpServletRequest request,Model model) { - //User cu=(User)request.getSession().getAttribute("cu"); - - String codeRule=request.getParameter("codeRule"); - String waterNumLen=request.getParameter("waterNumLen"); - - StringBuilder sqlSb = new StringBuilder("where 1=1"); - - if(!"".equals(codeRule) && null!=codeRule){ - sqlSb.append(" and code_rule='"+codeRule+"'"); - } - - if(!"".equals(waterNumLen) && null!=waterNumLen){ - sqlSb.append(" and water_num_len='"+waterNumLen+"'"); - } - - String sql = sqlSb.toString(); - - List equipmentCodeList = equipmentCodeService.selectListByWhere(sql); - - - Map message = new HashMap<>(); - if(null!=equipmentCodeList && equipmentCodeList.size()>0 && !equipmentCodeList.isEmpty()){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - - return message; - } - - /** - * 打开设备编码界面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - //return "/equipment/equipmentClassList"; - return "/equipment/equipmentCodeList"; - } - /** - * 获取设备编码规则list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - PageHelper.startPage(page, rows); - List list = this.equipmentCodeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 打开新增设备编码界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - //return "equipment/equipmentClassAdd"; - return "equipment/equipmentCodeAdd"; - } - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentCodeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentCodeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/doDeletesProp.do") - public String doDeletesProp(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentClassPropService.deleteByWhere("where equipment_class_id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存设备类型数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentClass") EquipmentClass equipmentClass){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentClass.setId(CommUtil.getUUID()); - equipmentClass.setInsuser(cu.getId()); - equipmentClass.setInsdt(CommUtil.nowDate()); - int result = this.equipmentClassService.save(equipmentClass); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentClass.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存设备类型附属表数据 - */ - @RequestMapping("/doSaveProp.do") - public String doSaveProp(HttpServletRequest request,Model model, - @ModelAttribute("equipmentClassProp") EquipmentClassProp equipmentClassProp){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentClassProp.setId(CommUtil.getUUID()); - equipmentClassProp.setInsuser(cu.getId()); - equipmentClassProp.setInsdt(CommUtil.nowDate()); - int result = this.equipmentClassPropService.save(equipmentClassProp); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentClassProp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 检查设备类型的名称是否重复 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request,Model model) { - String name =request.getParameter("name"); - String id =request.getParameter("id"); - if(this.equipmentClassService.checkNotOccupied(id, name)){ - model.addAttribute("result","{\"valid\":"+false+"}"); - return "result"; - }else { - model.addAttribute("result","{\"valid\":"+true+"}"); - return "result"; - } - } - /** - * 查看设备编码信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCode equipmentCode = equipmentCodeService.selectById(id); - model.addAttribute("id", equipmentCode.getId()); - model.addAttribute("codeRule", equipmentCode.getCodeRule()); - model.addAttribute("waterNumLen", equipmentCode.getWaterNumLen()); - model.addAttribute("active", equipmentCode.getActive()); - //return "equipment/equipmentClassView"; - return "equipment/equipmentCodeView"; - } - /** - * 打开编辑设备编码信息界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCode equipmentCode = equipmentCodeService.selectById(id); - model.addAttribute("id", equipmentCode.getId()); - model.addAttribute("codeRule", equipmentCode.getCodeRule()); - model.addAttribute("waterNumLen", equipmentCode.getWaterNumLen()); - model.addAttribute("active", equipmentCode.getActive()); - //return "equipment/equipmentClassEdit"; - return "equipment/equipmentCodeEdit"; - } - /** - * 更新设备编码信息 - */ - @ResponseBody - @RequestMapping("/updateEquipmentCode.do") - public Map doupdate(HttpServletRequest request,Model model){ - - EquipmentCode equipmentCode = new EquipmentCode(); - User cu=(User)request.getSession().getAttribute("cu"); - String active=request.getParameter("active"); - String codeRule=request.getParameter("codeRule"); - String waterNumLen=request.getParameter("waterNumLen"); - String id=request.getParameter("id"); - - equipmentCode.setId(id); - equipmentCode.setInsdt(CommUtil.nowDate()); - equipmentCode.setInsuser(cu.getId()); - equipmentCode.setCodeRule(codeRule); - equipmentCode.setWaterNumLen(Integer.parseInt(waterNumLen)); - equipmentCode.setActive(Integer.parseInt(active)); - Map message = new HashMap<>(); - int result=equipmentCodeService.update(equipmentCode); - - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - - } - /** - * 更新设备类型信息 - */ - @RequestMapping("/doUpdateProp.do") - public String doUpdateProp(HttpServletRequest request,Model model, - @ModelAttribute("equipmentClassProp") EquipmentClassProp equipmentClassProp){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentClassProp.setInsuser(cu.getId()); - equipmentClassProp.setInsdt(CommUtil.nowDate()); - int result = 0; - if(equipmentClassProp.getId()!=""){ - result = this.equipmentClassPropService.update(equipmentClassProp); - }else{ - equipmentClassProp.setId(CommUtil.getUUID()); - result = this.equipmentClassPropService.save(equipmentClassProp); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentClassProp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 选择设备类型 - */ - @RequestMapping("/getEquipmentClassForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request,Model model){ - List list = this.equipmentClassService.selectListByWhere("where active= '1'"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (EquipmentClass equipmentClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", equipmentClass.getId()); - jsonObject.put("text", equipmentClass.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - @RequestMapping("/getEquipmentClassname.do") - public String getequipmentclassname(HttpServletRequest request,Model model) { - String wherestr ="where 1=1"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return "result"; - } - - //2020-07-08 start - @RequestMapping("/selectEquipmentCodeRule.do") - public String showEquipmentBelongForSelect(HttpServletRequest request,Model model) { - /* String equipmentId = request.getParameter("equipmentId"); - String companyId = request.getParameter("companyId"); - model.addAttribute("equipmentId", equipmentId); - model.addAttribute("companyId", companyId); - return "/equipment/equipmentCardListForSelect";*/ - String equipmentCodeId = request.getParameter("equipmentCodeId"); - model.addAttribute("equipmentCodeId", equipmentCodeId); - //return "/equipment/equipmentBelongListForSelect"; - return "/equipment/equipmentCodeListForSelect"; - } - //2020-07-08 end - - -} - diff --git a/src/com/sipai/controller/equipment/EquipmentCodeLibraryController.java b/src/com/sipai/controller/equipment/EquipmentCodeLibraryController.java deleted file mode 100644 index b527dfaa..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCodeLibraryController.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCodeLibrary; -import com.sipai.entity.equipment.EquipmentCodeRule; -import com.sipai.service.equipment.EquipmentCodeLibraryService; - -@Controller -@RequestMapping("/equipment/equipmentCodeLibrary") -public class EquipmentCodeLibraryController { - - @Resource - private EquipmentCodeLibraryService equipmentCodeLibraryService; - - //2020-07-11 start - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - - PageHelper.startPage(page, rows); - List list=equipmentCodeLibraryService.selectListByWhere("where 1=1 and active=1 order by id"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - - } - - - - @RequestMapping("/selectEquipmentCodeName.do") - public String selectEquipmentCodeName(HttpServletRequest request,Model model) { - String id = request.getParameter("id"); - model.addAttribute("id", id); - //return "/equipment/selectEquipmentLevel"; - return "/equipment/selectEquipmentCodeName"; - } - //2020-07-11 end -} diff --git a/src/com/sipai/controller/equipment/EquipmentCodeRuleController.java b/src/com/sipai/controller/equipment/EquipmentCodeRuleController.java deleted file mode 100644 index f550daf3..00000000 --- a/src/com/sipai/controller/equipment/EquipmentCodeRuleController.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.controller.equipment; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCode; -import com.sipai.entity.equipment.EquipmentCodeRule; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCodeRuleService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentCodeRule") -public class EquipmentCodeRuleController { - - @Resource - private EquipmentCodeRuleService equipmentCodeRuleService; - - - @RequestMapping("/showEquipmentCodeRule.do") - public String saveEquipmentCode(HttpServletRequest request,Model model) { - return "/equipment/equipmentCodeRuleList"; - } - - @RequestMapping("/getListEquipmentCodeRule.do") - public ModelAndView getListEquipmentCodeRule(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - - PageHelper.startPage(page, rows); - List list = this.equipmentCodeRuleService.selectListByWhere(" where 1=1 order by morder asc"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/addEquipmentCodeRule.do") - public String insertEquipmentCodeRule(HttpServletRequest request,Model model){ - return "equipment/equipmentCodeRuleAdd"; - } - - @ResponseBody - @RequestMapping("/isExistEquipmentCodeRule.do") - public Map isExistEquipmentCodeRule(HttpServletRequest request,Model model,EquipmentCodeRule equipmentCodeRule){ - Map message= new HashMap(); - List ecrList=equipmentCodeRuleService.selectListByWhere("where alias_name ='"+equipmentCodeRule.getAliasName()+"'"); - if(ecrList.size()>0 && null!=ecrList && !ecrList.isEmpty()){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - - } - - @ResponseBody - @RequestMapping("/saveEquipmentCodeRule.do") - public Map saveEquipmentCodeRule(HttpServletRequest request,Model model,EquipmentCodeRule equipmentCodeRule){ - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - User cu=(User)request.getSession().getAttribute("cu"); - equipmentCodeRule.setId(CommUtil.getUUID()); - equipmentCodeRule.setInsdt(sdf.format(new Date())); - equipmentCodeRule.setInsuser(cu.getId()); - - Map message= new HashMap(); - - int result=equipmentCodeRuleService.save(equipmentCodeRule); - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - - } - - //2020-07-12 start - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = equipmentCodeRuleService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = equipmentCodeRuleService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 查看设备编码信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCodeRule equipmentCodeRule = equipmentCodeRuleService.selectById(id); - model.addAttribute("equipmentCodeRule", equipmentCodeRule); - return "equipment/equipmentCodeRuleView"; - } - - /** - * 编辑设备编码信息 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCodeRule equipmentCodeRule = equipmentCodeRuleService.selectById(id); - model.addAttribute("equipmentCodeRule", equipmentCodeRule); - return "equipment/equipmentCodeRuleEdit"; - } - - @ResponseBody - @RequestMapping("/updateEquipmentCodeRule.do") - public Map updateEquipmentCodeRule(HttpServletRequest request,Model model,EquipmentCodeRule equipmentCodeRule){ - //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //User cu=(User)request.getSession().getAttribute("cu"); - //equipmentCodeRule.setId(CommUtil.getUUID()); - //equipmentCodeRule.setInsdt(sdf.format(new Date())); - //equipmentCodeule.setInsuser(cu.getId()); - - Map message= new HashMap(); - - int result=equipmentCodeRuleService.update(equipmentCodeRule); - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - - } - //2020-07-12 end - -} diff --git a/src/com/sipai/controller/equipment/EquipmentDialinController.java b/src/com/sipai/controller/equipment/EquipmentDialinController.java deleted file mode 100644 index 59d9b80a..00000000 --- a/src/com/sipai/controller/equipment/EquipmentDialinController.java +++ /dev/null @@ -1,413 +0,0 @@ -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentDialin; -import com.sipai.entity.equipment.EquipmentLoseApplyDetail; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentDialinService; -import com.sipai.service.sparepart.WarehouseService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentDialin") -public class EquipmentDialinController { - - @Resource - private WarehouseService warehouseService; - @Resource - private EquipmentDialinService equipmentDialinService; - - @Resource - private EquipmentCardService equipmentCardService; - - @Resource - UserService userService; - - @Resource - private UnitService unitService; - - @Resource - CommonFileService commonFileService; - - @RequestMapping("/showList.do") - public String showEquipmentDialinPage(){ - //return "/equipment/maintenancePlanList"; - return "/equipment/equipmentDialinList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - - if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and dialin_com_id in ("+companyids+") "; - } - } - - String startTime=request.getParameter("sdt"); - String endTime=request.getParameter("edt"); - String name=request.getParameter("searchName"); - - if(!"".equals(startTime) && null!=startTime){ - wherestr += " and apply_time >= '"+startTime+"'"; - } - - if(!"".equals(endTime) && null!=endTime){ - wherestr += " and apply_time <= '"+endTime+"'"; - } - - if(!"".equals(name) && null!=name){ - StringBuilder idSb = new StringBuilder(); - String sql = " where caption like '%"+name+"%'"; - List users=userService.selectListByWhere(sql); - if(users.size() >0 && null!=users){ - for(User user : users){ - idSb.append("'"+user.getId()+"'"+","); - } - - } - - if(idSb.length() >0 && null!=idSb){ - String ids=idSb.substring(0, idSb.length() -1); - String idsCondition = " and (dialin_id in ("+ids+")"+" or accept_id in ("+ids+")"+")"; - wherestr += idsCondition; - - } - } - - - PageHelper.startPage(page, rows); - List list = equipmentDialinService.getEquipmentDialinDetail(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - model.addAttribute("cu",cu); - //return "equipment/maintenancePlanAdd"; - return "equipment/equipmentDialinAdd"; - } - - @RequestMapping("/getCompanyAllInfoPage.do") - public String getCompanyAllPage(HttpServletRequest request,Model model){ - return "equipment/getCompanyAllInfoPage"; - } - - /** - * 获取所有公司列表 - * */ - @ResponseBody - @RequestMapping("/getUnits4Select.do") - public JSONArray getUnits4Select(HttpServletRequest request,Model model){ - JSONArray json=new JSONArray(); - List companies=this.unitService.getCompaniesByWhere("where 1=1"); - if(companies!=null && companies.size()>0){ - for (Company company : companies) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - jsonObject.put("ename", company.getEname()); - json.add(jsonObject); - } - - } - - return json; - } - - @RequestMapping("/findUser.do") - public String findUserByCompanyId(HttpServletRequest request,Model model,String userIdsStr){ - if(!"".equals(userIdsStr) && null!=userIdsStr){ - String userIdsSubStr=userIdsStr.substring(0,userIdsStr.length()-1); - model.addAttribute("users", userIdsSubStr); - } - - //return "user/findUser"; - return "equipment/findUser"; - } - - @ResponseBody - @RequestMapping("/findUserByIds.do") - public List findUserByIds(HttpServletRequest request,Model model,String userIdsStr){ - List result = new ArrayList(); - if(!"".equals(userIdsStr) && null!=userIdsStr){ - - String userIdsSubStr=userIdsStr.substring(0,userIdsStr.length()-1); - String[] ids=userIdsSubStr.split(","); - for(String id:ids){ - Map users = new HashMap(); - User user=userService.getUserById(id); - users.put("id", id); - users.put("name", user.getName()); - result.add(users); - } - - - } - - return result; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentDialin equipmentDialin){ - User cu= (User)request.getSession().getAttribute("cu"); - - equipmentDialin.setInsuser(cu.getId()); - equipmentDialin.setInsdt(CommUtil.nowDate()); - - int result =equipmentDialinService.save(equipmentDialin); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentDialin.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - * 单条数据删除方法 - */ - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - EquipmentDialin equipmentDialin =equipmentDialinService.selectById(id); - String masterId = equipmentDialin.getId(); - if(null!=masterId && !"".equals(masterId)){ - commonFileService.deleteByTableAWhere("TB_Process_UploadFile"," where masterid='"+masterId+"'"); - } - int result = equipmentDialinService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - List equipmentDialinList=equipmentDialinService.selectListByWhere("where id in ('"+ids+"')"); - for(EquipmentDialin ed:equipmentDialinList){ - String masterId = ed.getId(); - if(null!=masterId && !"".equals(masterId)){ - commonFileService.deleteByTableAWhere("TB_Process_UploadFile"," where masterid='"+masterId+"'"); - } - } - int result = equipmentDialinService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - EquipmentDialin equipmentDialin = equipmentDialinService.selectById(Id); - if(null!=equipmentDialin.getWarehouseId() && !"".equals(equipmentDialin.getWarehouseId())){ - Warehouse warehouse=warehouseService.selectById(equipmentDialin.getWarehouseId()); - model.addAttribute("warehouse", warehouse); - } - - String companyId= equipmentDialin.getDialinComId(); - String acceptId= equipmentDialin.getAcceptId(); - String dialinId= equipmentDialin.getDialinId(); - Company company=unitService.getCompById(companyId); - User acceptUser=userService.getUserById(acceptId); - User dialinUser=userService.getUserById(dialinId); - model.addAttribute("equipmentDialin", equipmentDialin); - model.addAttribute("company", company); - model.addAttribute("acceptUser", acceptUser); - model.addAttribute("dialinUser", dialinUser); - //return "equipment/maintenancePlanView"; - return "equipment/equipmentDialinView"; - } - - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - EquipmentDialin equipmentDialin = equipmentDialinService.selectById(Id); - String companyId= equipmentDialin.getDialinComId(); - String acceptId= equipmentDialin.getAcceptId(); - String dialinId= equipmentDialin.getDialinId(); - Company company=unitService.getCompById(companyId); - User acceptUser=userService.getUserById(acceptId); - User dialinUser=userService.getUserById(dialinId); - model.addAttribute("equipmentDialin", equipmentDialin); - model.addAttribute("company", company); - model.addAttribute("acceptUser", acceptUser); - model.addAttribute("dialinUser", dialinUser); - //return "equipment/maintenancePlanEdit"; - return "equipment/equipmentDialinEdit"; - } - - @RequestMapping("/doUpdate.do") - public String doUpdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentDialin equipmentDialin){ - int result =equipmentDialinService.update(equipmentDialin); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentDialin.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 导入设备信息 - * @param request - * @param model - * @return - */ - @RequestMapping("/importEquipmentCard.do") - public String doimport(HttpServletRequest request,Model model){ - //return "equipment/equipmentCardImport"; - return "equipment/equipmentDialinImport"; - } - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String companyId = request.getParameter("companyId"); - String equDialinNum = request.getParameter("equDialinNum"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? equipmentDialinService.readXls(excelFile.getInputStream(),companyId,cu.getId(),equDialinNum) : this.equipmentDialinService.readXlsx(excelFile.getInputStream(),companyId,cu.getId(),equDialinNum); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =net.sf.json.JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getEquDialinList.do") - public ModelAndView getEquDialinList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - - - String equDialinNum=request.getParameter("equDialinNum"); - if(null!=equDialinNum && !"".equals(equDialinNum)){ - wherestr +=" and equipment_dialin_num='"+equDialinNum+"'"; - } - - - PageHelper.startPage(page, rows); - List list = equipmentCardService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/deletesEquDialin.do") - public String deletesEquDialin(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - - boolean flag =false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - equipmentCardService.deleteById(id); - flag=true; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentFittingsController.java b/src/com/sipai/controller/equipment/EquipmentFittingsController.java deleted file mode 100644 index 6c0ac213..00000000 --- a/src/com/sipai/controller/equipment/EquipmentFittingsController.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.Iterator; -import java.util.List; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentFittings; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentFittingsService; -import com.sipai.service.equipment.FacilitiesClassService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentFittings") -public class EquipmentFittingsController { - @Resource - private EquipmentFittingsService equipmentFittingsService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private FacilitiesClassService facilitiesClassService; - - @RequestMapping("/showManage.do") - public String showManage(HttpServletRequest request,Model model) { - return "/equipment/equipmentFittingsManage"; - } - - @RequestMapping("/showManage4Facility.do") - public String showManage4Facility(HttpServletRequest request,Model model) { - return "/equipment/equipmentFittingsManage4Facility"; - } - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/equipment/equipmentFittingsList"; - } - - @RequestMapping("/showList4Facility.do") - public String showList4Facility(HttpServletRequest request,Model model) { - return "/equipment/equipmentFittingsList4Facility"; - } - - @RequestMapping("/getList.do") - public ModelAndView getEquipmentFittingsList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - - if(sort==null || sort.equals("id")){ - sort = " f.goods_id "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("classId")!=null && !request.getParameter("classId").isEmpty()){ - TreeSet set = new TreeSet(); - TreeSet treeSet=equipmentClassService.getAllChildId(set, request.getParameter("classId")); - String classIds=""; - if(treeSet!=null&&treeSet.size()>0){ - for(Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - classIds += "'"+iter.next()+"',"; - } - } - classIds = classIds.substring(0,classIds.length() - 1); - wherestr += " and e.equipmentClassID in ("+classIds+") "; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and f.pid = '"+request.getParameter("pid")+"' "; - }else{ - wherestr += " and f.type = '"+EquipmentFittings.Type_Z+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and (e.equipmentCardID like '%"+request.getParameter("search_name")+"%' or e.equipmentName like '%"+request.getParameter("search_name")+"%') "; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentFittingsService.selectListWithEQByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getList4Facility.do") - public ModelAndView getList4Facility(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - - if(sort==null || sort.equals("id")){ - sort = " f.goods_id "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("classId")!=null && !request.getParameter("classId").isEmpty()){ - TreeSet set = new TreeSet(); - TreeSet treeSet=facilitiesClassService.getAllChildId(set, request.getParameter("classId")); - String classIds=""; - if(treeSet!=null&&treeSet.size()>0){ - for(Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - classIds += "'"+iter.next()+"',"; - } - } - classIds = classIds.substring(0,classIds.length() - 1); - wherestr += " and e.facilities_class_id in ("+classIds+") "; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and f.pid = '"+request.getParameter("pid")+"' "; - }else{ - wherestr += " and f.type = '"+EquipmentFittings.Type_Z+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and (e.code like '%"+request.getParameter("search_name")+"%' or e.name like '%"+request.getParameter("search_name")+"%') "; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentFittingsService.selectListWithFaByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd4Facility.do") - public String doadd4Facility(HttpServletRequest request,Model model) { - return "/equipment/equipmentFittingsAddSelect4Facility"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model) { - return "/equipment/equipmentFittingsAddSelect"; - } - - @RequestMapping("/doSave.do") - public String doSave(HttpServletRequest request,Model model, - @RequestParam("eqid") String eqid, - @RequestParam("goodsId") String goodsId){ - User cu= (User)request.getSession().getAttribute("cu"); - - String[] goodsIds=goodsId.split(","); - - int res=0; - - if(goodsIds!=null&&goodsIds.length>0){ - for(int i=0;i list = this.equipmentIncreaseValueService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 打开新增设备价值增加界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String equipmentId = request.getParameter("equipmentId"); - model.addAttribute("equipmentId",equipmentId); - return "equipment/equipmentIncreaseValueAdd"; - } - /** - * 删除一条设备价值增加数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentIncreaseValueService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /** - * 删除多条设备价值增加数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentIncreaseValueService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存设备价值增加数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentIncreaseValue") EquipmentIncreaseValue equipmentIncreaseValue){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentIncreaseValue.setId(CommUtil.getUUID()); - equipmentIncreaseValue.setInsuser(cu.getId()); - if(equipmentIncreaseValue.getInsdt() == null){ - equipmentIncreaseValue.setInsdt(CommUtil.nowDate()); - } - int result = this.equipmentIncreaseValueService.save(equipmentIncreaseValue); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentIncreaseValue.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看设备价值增加信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentIncreaseValue equipmentIncreaseValue = this.equipmentIncreaseValueService.selectById(id); - model.addAttribute("equipmentIncreaseValue", equipmentIncreaseValue); - return "equipment/equipmentIncreaseValueView"; - } - /** - * 打开编辑设备价值增加信息界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentIncreaseValue equipmentIncreaseValue = this.equipmentIncreaseValueService.selectById(id); - model.addAttribute("equipmentIncreaseValue", equipmentIncreaseValue); - return "equipment/equipmentIncreaseValueEdit"; - } - /** - * 更新设备价值增加信息 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentIncreaseValue") EquipmentIncreaseValue equipmentIncreaseValue){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentIncreaseValue.setInsuser(cu.getId()); - equipmentIncreaseValue.setInsdt(CommUtil.nowDate()); - int result = this.equipmentIncreaseValueService.update(equipmentIncreaseValue); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentIncreaseValue.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentLevelController.java b/src/com/sipai/controller/equipment/EquipmentLevelController.java deleted file mode 100644 index babe5751..00000000 --- a/src/com/sipai/controller/equipment/EquipmentLevelController.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentLevelService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentLevel") -public class EquipmentLevelController { - @Resource - private EquipmentLevelService equipmentLevelService; - - /** - * 打开设备等级页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/equipmentLevelList"; - } - - /** - * 获取设备等级的list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by equipment_level_code "; - - String wherestr = "where 1=1"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and levelname like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentLevelService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 打开新增设备等级界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "equipment/equipmentLevelAdd"; - } - - /** - * 删除一条设备等级数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentLevelService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条设备等级数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentLevelService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存新增的设备等级数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("equipmentLevel") EquipmentLevel equipmentLevel) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentLevel.setId(CommUtil.getUUID()); - equipmentLevel.setInsuser(cu.getId()); - equipmentLevel.setInsdt(CommUtil.nowDate()); - int result = this.equipmentLevelService.save(equipmentLevel); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentLevel.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看设备等级信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(id); - model.addAttribute("equipmentLevel", equipmentLevel); - return "equipment/equipmentLevelView"; - } - - /** - * 打开编辑设备等级界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(id); - model.addAttribute("equipmentLevel", equipmentLevel); - return "equipment/equipmentLevelEdit"; - } - - /** - * 更新设备等级数据 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("equipmentLevel") EquipmentLevel equipmentLevel) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentLevel.setInsuser(cu.getId()); - equipmentLevel.setInsdt(CommUtil.nowDate()); - int result = this.equipmentLevelService.update(equipmentLevel); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentLevel.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 选择设备级别 - */ - @RequestMapping("/getEquipmentLevelForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request, Model model) { - List list = this.equipmentLevelService.selectListByWhere("where active = '" + CommString.Active_True + "' order by levelName"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (EquipmentLevel equipmentLevel : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentLevel.getId()); - jsonObject.put("text", equipmentLevel.getLevelname()); - jsonObject.put("code", equipmentLevel.getEquipmentLevelCode()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - //2020-07-08 start - @RequestMapping("/selectEquipmentLevel.do") - public String selectEquipmentLevel(HttpServletRequest request, Model model) { - /* String equipmentId = request.getParameter("equipmentId"); - String companyId = request.getParameter("companyId"); - model.addAttribute("equipmentId", equipmentId); - model.addAttribute("companyId", companyId); - return "/equipment/equipmentCardListForSelect";*/ - String equipmentlevelId = request.getParameter("equipmentlevelid"); - model.addAttribute("equipmentlevelId", equipmentlevelId); - //return "/equipment/equipmentBelongListForSelect"; - return "/equipment/selectEquipmentLevel"; - } - //2020-07-08 end - - /* - * 下拉筛选 - */ - @RequestMapping("/getEquipmentLevel4Select.do") - public String getEquipmentLevel4Select(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - //List processSections = this.processSectionService.selectListByWhere("where pid = '"+companyId+"'"); - List equipmentLevels = this.equipmentLevelService.selectListByWhere("where 1=1 order by equipment_level_code"); - JSONArray json = new JSONArray(); - if (equipmentLevels != null && equipmentLevels.size() > 0) { - for (int i = 0; i < equipmentLevels.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentLevels.get(i).getId()); - jsonObject.put("text", equipmentLevels.get(i).getLevelname() + "-(" + equipmentLevels.get(i).getEquipmentLevelCode() + ")"); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentLoseApplyController.java b/src/com/sipai/controller/equipment/EquipmentLoseApplyController.java deleted file mode 100644 index 4e7e4925..00000000 --- a/src/com/sipai/controller/equipment/EquipmentLoseApplyController.java +++ /dev/null @@ -1,619 +0,0 @@ -package com.sipai.controller.equipment; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.EquipmentLoseApplyDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentLoseApplyDetailService; -import com.sipai.service.equipment.EquipmentLoseApplyService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/EquipmentLoseApply") -public class EquipmentLoseApplyController { - @Resource - private EquipmentLoseApplyService equipmentLoseApplyService; - @Resource - private UnitService unitService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentLoseApplyDetailService equipmentLoseApplyDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "equipment/equipmentLoseApplyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - String sdt, String edt, String search_name,String companyId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sb = new StringBuilder("where 1=1"); - - if(null!=sdt && !"".equals(sdt)) - sb.append(" and apply_time >="+"'"+sdt+"'"); - if(null!=edt &&!"".equals(edt)) - sb.append(" and apply_time <="+"'"+edt+"'"); - if(null!=search_name && !"".equals(search_name)) - sb.append(" and apply_people_name like "+"'"+"%"+search_name+"%"+"'"); - - if(null!=companyId && !"".equals(companyId)) - sb.append(" and biz_id = "+"'"+companyId+"'"); - //EquipmentLoseApply ela = new EquipmentLoseApply(); - //ela.setWhere(sb.append(" order by insdt desc").toString()); - sb.append(" order by insdt desc"); - PageHelper.startPage(page, rows); - List elaList = equipmentLoseApplyService.selectListByWhere(sb.toString()); - JSONArray jsonArray = JSONArray.fromObject(elaList); - PageInfo pInfo = new PageInfo(elaList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu= (User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String loseApplyNumber = company.getEname()+"-SBDS-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("company", company); - model.addAttribute("cu", cu); - model.addAttribute("loseApplyNumber", loseApplyNumber); - return "equipment/equipmentLoseApplyAdd"; - } - - @RequestMapping("/getEquipmentName4Select.do") - public String getEquipmentName4Select(HttpServletRequest request, Model model,String companyId) { - List ec =equipmentCardService.selectListByWhere(companyId,"where bizId="+"'"+companyId+"'"); - JSONArray json = new JSONArray(); - if (ec != null && ec.size() > 0) { - for (EquipmentCard eqcard : ec) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", eqcard.getId()); - jsonObject.put("text", eqcard.getEquipmentname()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentLoseApply ela - ){ - User cu= (User)request.getSession().getAttribute("cu"); - ela.setInsuser(cu.getId()); - ela.setInsdt(CommUtil.nowDate()); - if("".equals(ela.getId()) || null==ela.getId() || ela.getId().isEmpty()){ - ela.setId(CommUtil.getUUID()); - } - int result =equipmentLoseApplyService.save(ela); - String resstr="{\"res\":\""+result+"\",\"id\":\""+ela.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - EquipmentLoseApply ela=equipmentLoseApplyService.selectById(id); - equipmentLoseApplyDetailService.deleteByWhere("where lose_apply_number="+"'"+ela.getLoseApplyNumber()+"'"); - int result =equipmentLoseApplyService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - int result=0; - String idArr[]=ids.split(","); - for(String id:idArr){ - EquipmentLoseApply ela=equipmentLoseApplyService.selectById(id); - equipmentLoseApplyDetailService.deleteByWhere("where lose_apply_number="+"'"+ela.getLoseApplyNumber()+"'"); - result = equipmentLoseApplyService.deleteById(id); - result++; - } - - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String companyId) { - EquipmentLoseApply ela=equipmentLoseApplyService.selectById(id); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - //ela.setTotalMoney(new BigDecimal(new DecimalFormat("#,00").format(ela.getTotalMoney()))); - model.addAttribute("ela", ela); - model.addAttribute("id",id); - return "/equipment/equipmentLoseApplyEdit"; - - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentLoseApply ela) { - User cu = (User) request.getSession().getAttribute("cu"); - //esa.setInsdt(CommUtil.nowDate()); - ela.setInsuser(cu.getId()); - int result=equipmentLoseApplyService.update(ela); - String resstr="{\"res\":\""+result+"\",\"id\":\""+ela.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - //以下是新增代码 - /** - * 获取丢失设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentLoseApplyDetailList.do") - public ModelAndView getEquipmentLoseApplyDetailList(HttpServletRequest request,Model model, - String loseApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= loseApplyNumber && !"".equals(loseApplyNumber)) - sb.append("and lose_apply_number ="+"'"+loseApplyNumber+"'"); - - PageHelper.startPage(page, rows); - List eladList=equipmentLoseApplyDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=eladList && !eladList.isEmpty()){ - for(EquipmentLoseApplyDetail elad:eladList){ - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - elad.setEquipmentCard(ec); - } - } - PageInfo pInfo = new PageInfo(eladList); - JSONArray jsonArray = JSONArray.fromObject(eladList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - /** - * 新增丢失明细,选择设备台账明细界面 - */ - @RequestMapping("/selectEquipmentCardDetails.do") - public String doselectEquipmentCardDetails (HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - if(equipmentCardIds!=null && !equipmentCardIds.isEmpty()){ - String[] id_Array= equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - return "/equipment/equipmentCard4Selects"; - } - - /** - * 设备丢失申请单选择设备台账后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentLoseApplyDetails.do") - public String dosaveEquipmentLoseApplyDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String loseApplyNumber = request.getParameter("loseApplyNumber"); - String[] idArrary = equipmentCardIds.split(","); - - BigDecimal totalMoney=new BigDecimal("0"); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - - List eladList = equipmentLoseApplyDetailService.selectListByWhere("where lose_apply_number ='"+loseApplyNumber+"' and equipment_card_id ='"+str+"'"); - if (eladList == null || eladList.size() == 0) { - EquipmentCard ec=equipmentCardService.selectById(str); - EquipmentLoseApplyDetail elad = new EquipmentLoseApplyDetail(); - elad.setId(CommUtil.getUUID()); - elad.setInsdt(CommUtil.nowDate()); - elad.setInsuser(cu.getId()); - elad.setEquipmentCardId(ec.getId()); - elad.setLoseApplyNumber(loseApplyNumber); - - result = this.equipmentLoseApplyDetailService.save(elad); - if (result != 1) { - flag = false; - } - } - } - } - - List eladList=equipmentLoseApplyDetailService.selectListByWhere("where lose_apply_number ="+"'"+loseApplyNumber+"'"); - if(!eladList.isEmpty() && eladList.size()>0 && null!=eladList){ - for(EquipmentLoseApplyDetail elad:eladList){ - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - } - - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - /** - * 删除丢失设备明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentLoseApplyDetail.do") - public String dodeletesEquipmentLoseApplyDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money){ - - BigDecimal totalMoney=new BigDecimal(money); - boolean flag=false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - - EquipmentLoseApplyDetail elad=equipmentLoseApplyDetailService.selectById(id); - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal(0); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.subtract(tempTotalMoney); - equipmentLoseApplyDetailService.deleteById(id); - flag=true; - } - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - EquipmentLoseApply ela=equipmentLoseApplyService.selectById(id); - //ela.setTotalMoney((new BigDecimal(new DecimalFormat("#.00").format(ela.getTotalMoney())))); - model.addAttribute("ela", ela); - return "/equipment/equipmentLoseApplyView"; - } - /** - * 更新,启动丢失申请审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute EquipmentLoseApply equipmentLoseApply){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentLoseApply.setInsuser(cu.getId()); - equipmentLoseApply.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.equipmentLoseApplyService.startProcess(equipmentLoseApply); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentLoseApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看丢失申请审核处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessLoseApplyView.do") - public String showProcessLoseApplyView(HttpServletRequest request,Model model){ - String loseApplyId = request.getParameter("id"); - EquipmentLoseApply equipmentLoseApply = this.equipmentLoseApplyService.selectById(loseApplyId); - request.setAttribute("business", equipmentLoseApply); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentLoseApply); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(equipmentLoseApply.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_LOSE_APPLY_ADJUST: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+loseApplyId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_LOSE_APPLY_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+loseApplyId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = equipmentLoseApply.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(equipmentLoseApply.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - return "equipment/equipmentLoseApplyExecuteView"; - } - /** - * 显示丢失申请审核 - * */ - @RequestMapping("/showAuditLoseApply.do") - public String showAuditLoseApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String loseApplyId= pInstance.getBusinessKey(); - EquipmentLoseApply loseApply = this.equipmentLoseApplyService.selectById(loseApplyId); - model.addAttribute("loseApply", loseApply); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/equipmentLoseApplyAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/auditLoseApply.do") - public String doAuditLoseApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.equipmentLoseApplyService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示丢失申请业务调整处理 - * */ - @RequestMapping("/showLoseApplyAdjust.do") - public String showLoseApplyAdjust(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String loseApplyId = pInstance.getBusinessKey(); - EquipmentLoseApply loseApply = this.equipmentLoseApplyService.selectById(loseApplyId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+loseApplyId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("loseApply", loseApply); - return "equipment/equipmentLoseApplyAdjust"; - } - /** - * 设备丢失申请调整后,再次提交审核 - * */ - @RequestMapping("/submitLoseApplyAdjust.do") - public String doSubmitLoseApplyAdjust(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.equipmentLoseApplyService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentMaintainController.java b/src/com/sipai/controller/equipment/EquipmentMaintainController.java deleted file mode 100644 index 9d48abe6..00000000 --- a/src/com/sipai/controller/equipment/EquipmentMaintainController.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.sipai.controller.equipment; - - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentMaintain; -import com.sipai.entity.equipment.GeographyArea; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentMaintainService; -import com.sipai.service.equipment.GeographyAreaService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/equipment/equipmentMaintain") -public class EquipmentMaintainController { - @Resource - private EquipmentCardService equipmentcardService; - @Resource - private EquipmentClassService equipmentclassService; - @Resource - private GeographyAreaService geographyareaService; - @Resource - private EquipmentMaintainService equipmentmaintainService; - @Resource - private UserService userService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private UnitService unitService; - - /** - * 设备保养 - * */ - @RequestMapping("/showEquipmentMaintainList.do") - public String showEquipmentMaintainList(HttpServletRequest request,Model model) { - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); - return "/equipment/equipmentMaintainList"; - } - @RequestMapping("/showEquipmentRepairList.do") - public String showEquipmentRepairList(HttpServletRequest request,Model model) { - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - return "/equipment/equipmentRepairList"; - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentMaintainAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - - EquipmentMaintain equipmentmaintain = this.equipmentmaintainService.selectById(Id); - - EquipmentCard equipmentCard = this.equipmentcardService.selectById(equipmentmaintain.getEquipmentcardid()); - equipmentmaintain.setEquipmentcode(equipmentCard.getEquipmentcardid()); - equipmentmaintain.setEquipmentmodel(equipmentCard.getEquipmentmodel()); - equipmentmaintain.setEquipmentname(equipmentCard.getEquipmentname()); - - EquipmentClass equipmentClass = this.equipmentclassService.selectById(equipmentCard.getEquipmentclassid()); - equipmentmaintain.setEquipmentclassid(equipmentClass.getName()); - - GeographyArea geographyArea = this.geographyareaService.selectById(equipmentCard.getAreaid()); - equipmentmaintain.setAreaid(geographyArea.getName()); - - User user = this.userService.getUserById(equipmentmaintain.getMaintenanceman()); - equipmentmaintain.setMancaption(user.getCaption()); - - model.addAttribute("equipmentmaintain", equipmentmaintain); - return "equipment/equipmentMaintainEdit"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - - String Id = request.getParameter("id"); - EquipmentMaintain equipmentmaintain = this.equipmentmaintainService.selectById(Id); - - equipmentmaintain.getEquipmentcardid(); - EquipmentCard equipmentCard = this.equipmentcardService.selectById(equipmentmaintain.getEquipmentcardid()); - equipmentmaintain.setEquipmentcardid(equipmentCard.getEquipmentcardid()); - equipmentmaintain.setCurrentmanageflag(equipmentCard.getCurrentmanageflag()); - equipmentmaintain.setEquipmentmodel(equipmentCard.getEquipmentmodel()); - equipmentmaintain.setEquipmentname(equipmentCard.getEquipmentname()); - - EquipmentClass equipmentClass = this.equipmentclassService.selectById(equipmentCard.getEquipmentclassid()); - equipmentmaintain.setEquipmentclassid(equipmentClass.getName()); - - GeographyArea geographyArea = this.geographyareaService.selectById(equipmentCard.getAreaid()); - equipmentmaintain.setAreaid(geographyArea.getName()); - - JSONArray json=JSONArray.fromObject(equipmentmaintain); - equipmentmaintain.getMaintenanceman(); - User user = this.userService.getUserById(equipmentmaintain.getMaintenanceman()); - equipmentmaintain.setMaintenanceman(user.getCaption()); - model.addAttribute("equipmentMaintain", equipmentmaintain); - - return "equipment/equipmentMaintainView"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentMaintain equipmentmaintain, - @RequestParam(value = "eid", required=false) String eid, - @RequestParam(value = "mid", required=false) String mid){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - equipmentmaintain.setId(id); - equipmentmaintain.setInsdt(CommUtil.nowDate()); - equipmentmaintain.setInsuser(cu.getId()); - equipmentmaintain.setEquipmentcardid(eid); - equipmentmaintain.setMaintenanceman(mid); - int result = this.equipmentmaintainService.save(equipmentmaintain); - - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentMaintain equipmentmaintain){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - equipmentmaintain.setInsuser(cu.getId()); - equipmentmaintain.setInsdt(CommUtil.nowDate()); - int result = this.equipmentmaintainService.update(equipmentmaintain); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentmaintain.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/showListForSelect.do") - public String showListForSelect(HttpServletRequest request,Model model) { - return "/equipment/equipmentMaintainListForSelect"; - } - @RequestMapping("/showMaintenancemanForSelect.do") - public String showMaintenancemanForSelect(HttpServletRequest request,Model model) { - return "/equipment/maintenancemanForSelect"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentmaintainService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentmaintainService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getMaintain.do") - public ModelAndView getMaintain(HttpServletRequest request,Model model) { - - - //String wherestr = "where a.goods_id ='"+id+"' "; - String wherestr = " where a.type ='1' "; - - List list1 = this.maintenanceDetailService.selectTotalBizNumberByWhere(wherestr); - ArrayList wscll= new ArrayList<>(); - for (MaintenanceDetail equipmentMaintaindDetail : list1) { - ArrayList list= new ArrayList<>(); - list.add(equipmentMaintaindDetail.getMaintainplanid()); - if(equipmentMaintaindDetail.getPlanMoney()!=null){ - list.add(equipmentMaintaindDetail.getPlanMoney().toString().substring(0,equipmentMaintaindDetail.getPlanMoney().toString().length()-2)); - }else{ - list.add("0"); - } - wscll.add(list); - } - JSONArray jsonArray = JSONArray.fromObject(wscll); - - String wherestr2 = " where a.type ='2' "; - - List list2 = this.maintenanceDetailService.selectTotalBizNumberByWhere(wherestr2); - ArrayList wscll2= new ArrayList<>(); - for (MaintenanceDetail equipmentMaintaindDetail : list2) { - ArrayList list= new ArrayList<>(); - list.add(equipmentMaintaindDetail.getMaintainplanid()); - if(equipmentMaintaindDetail.getPlanMoney()!=null){ - - list.add(equipmentMaintaindDetail.getPlanMoney().toString().substring(0,equipmentMaintaindDetail.getPlanMoney().toString().length()-2)); - }else{ - list.add("0"); - } - wscll2.add(list); - } - JSONArray jsonArray2 = JSONArray.fromObject(wscll2); - - - String result = "{\"contract\":"+jsonArray+","+"\"contract2\":"+jsonArray2+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentParamSetController.java b/src/com/sipai/controller/equipment/EquipmentParamSetController.java deleted file mode 100644 index 67f6390b..00000000 --- a/src/com/sipai/controller/equipment/EquipmentParamSetController.java +++ /dev/null @@ -1,646 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentParamSetVO; -import com.sipai.entity.equipment.EquipmentParamset; -import com.sipai.entity.equipment.EquipmentParamsetDetail; -import com.sipai.entity.equipment.EquipmentParamsetStatusEvaluation; -import com.sipai.entity.equipment.EquipmentParamsetValue; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentParamsetDetailService; -import com.sipai.service.equipment.EquipmentParamsetService; -import com.sipai.service.equipment.EquipmentParamsetStatusEvaluationService; -import com.sipai.service.equipment.EquipmentParamsetValueService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.LibraryRepairBlocService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 设定设备运行参数标准(集团级) - * - */ -@Controller -@RequestMapping("/equipment/equipmentParamSet") -public class EquipmentParamSetController { - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentParamsetService equipmentParamsetService; - @Resource - private EquipmentParamsetDetailService equipmentParamsetDetailService; - @Resource - private EquipmentParamsetValueService equipmentParamsetValueService; - @Resource - private EquipmentParamsetStatusEvaluationService equipmentParamsetStatusEvaluationService; - @Resource - private CompanyService companyService; - - - //2020-07-31 start====================================================================== - @RequestMapping("/selectEquipmentParam.do") - public String selectEquipmentParam(HttpServletRequest request,Model model){ - //return "equipment/selectEquipmentClass"; - return "equipment/selectEquipmentParam"; - } - - @ResponseBody - @RequestMapping("/getEquipmentParamTreeJson.do") - public com.alibaba.fastjson.JSONArray getEquipmentParamTreeJson(HttpServletRequest request,Model model){ - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - List equParamSetList=equipmentParamsetService.selectListByWhere(" where 1=1 and pid = '-1'"); - jsonArray=equipmentParamsetService.getEquipmentParamSetTreeJson(equParamSetList, jsonArray); - return jsonArray; - } - - @ResponseBody - @RequestMapping("/isExistParamName.do") - public Map isExistParamName(HttpServletRequest request,Model model){ - Map message= new HashMap<>(); - String info=request.getParameter("info"); - List equParDetail=equipmentParamsetDetailService.selectListByWhere(" where name = '"+info+"'"); - if(null!=equParDetail && equParDetail.size() > 0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - } - - //2020-07-31 end======================================================================== - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - List list = this.libraryFaultBlocService.selectListByWhere("where 1=1"); - model.addAttribute("menulist",list); - return "maintenance/faultlibraryManage"; - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "maintenance/faultlibrary4select"; - } - // @RequestMapping("/doadd.do") - // public String doadd(HttpServletRequest request,Model model, - // @RequestParam(value="pid") String pid){ - // if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - // FaultLibrary faultLibrary= libraryFaultBlocService.selectById(pid); - // model.addAttribute("pname",faultLibrary.getName()); - // } - // return "maintenance/faultlibraryAdd"; - // } - - - @RequestMapping("/getFaultLibrariesJson.do") - public String getFaultLibrariesJson(HttpServletRequest request,Model model){ - List list = this.libraryFaultBlocService.selectListByWhere("where 1=1 order by morder"); - String json = libraryFaultBlocService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showActiveList4Select.do") - public String showActiveList4Select(HttpServletRequest request,Model model){ - return "maintenance/faultlibraryActive4select"; - } - @RequestMapping("/getFaultLibrariesJsonActive.do") - public String getMenusJsonActive(HttpServletRequest request,Model model){ - List list = this.libraryFaultBlocService.selectListByWhere("where active='"+CommString.Active_True+"' order by morder"); - /*for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - }*/ - String json = libraryFaultBlocService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - /** - * 获取故障库类型,使用pid为-1的故障库内容表示 - * */ - @RequestMapping("/getFaultTypesActive.do") - public String getFaultTypesActive(HttpServletRequest request,Model model){ - List list = this.libraryFaultBlocService.selectListByWhere("where active='"+CommString.Active_True+"' and pid='-1' order by morder"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (LibraryFaultBloc faultLibrary : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", faultLibrary.getId()); - jsonObject.put("text", faultLibrary.getFaultName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - /** - * 选择故障类型,可多选 - * */ - @RequestMapping("/showFaultTypeForSelects.do") - public String showFaultTypeForSelects(HttpServletRequest request,Model model) { - String problemTypeIds = request.getParameter("problemTypeIds"); - if(problemTypeIds!=null && !problemTypeIds.isEmpty()){ - String[] id_Array= problemTypeIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - model.addAttribute("json",jsonArray); - } - return "/maintenance/faultTypeForSelects"; - } - /** - * 获取权限树 - * @return - */ - @RequestMapping("/getFaultTypeTree.do") - public String getMenusJsonWithFunc(HttpServletRequest request,Model model){ - List list = this.libraryFaultBlocService.selectListByWhere("where active='"+CommString.Active_True+"' order by morder"); - String result = this.libraryFaultBlocService.getTreeList(null, list); - model.addAttribute("result", result); - return "result"; - } - - /** - * 设备故障库配置界面 树形 sj 2020-07-14 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request,Model model){ - //return "/maintenance/faultlibrary4Tree"; - return "/equipment/equipmentParamSetTree"; - } - //(厂级) - @RequestMapping("/showList4TreeFactory.do") - public String showList4TreeFactory(HttpServletRequest request,Model model){ - //return "/maintenance/faultlibrary4Tree"; - return "/equipment/equipmentParamSetValueTree"; - } - - /** - * 设备故障库浏览界面 树形 sj 2020-07-14 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeView.do") - public String showList4TreeView(HttpServletRequest request,Model model){ - return "/maintenance/faultlibrary4TreeView"; - } - - - @RequestMapping("/showFaultList.do") - public String showFaultList(HttpServletRequest request,Model model){ - //return "maintenance/faultlibraryList"; - return "equipment/equipmentParamSetList"; - } - - @RequestMapping("/showValueList.do") - public String showValueList(HttpServletRequest request,Model model){ - //return "maintenance/faultlibraryList"; - return "equipment/equipmentParamSetValueList"; - } - @RequestMapping("/showValueList4Eq.do") - public String showValueList4Eq(HttpServletRequest request,Model model){ - EquipmentCard equipmentCard = this.equipmentCardService.selectById(request.getParameter("equipmentId")); - model.addAttribute("equipmentCard",equipmentCard); - return "equipment/equipmentParamSetValueList4Eq"; - } - /** - * 获取设备故障库数据 sj 2020-07-14 - * @param request - * @param model - * @return - */ -/* @RequestMapping("/getFaultListJson.do") - public ModelAndView getFaultListJson(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String classId = request.getParameter("classId"); - PageHelper.startPage(page, rows); - List list = this.libraryFaultBlocService.selectListByWhere("where 1=1 and pid = '"+classId+"' order by insdt desc"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - //------------------------------------------------------------------------------------ - @RequestMapping("/getEquipmentParamSetDetailJson.do") - public ModelAndView getEquipmentParamSetDetailJson(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String classId = request.getParameter("classId"); - String unitId = request.getParameter("unitId"); - PageHelper.startPage(page, rows); - List list = this.equipmentParamsetDetailService.selectListByWhere("where library_bizid = '"+unitId+"' and equipment_class_id = '"+classId+"' order by insdt desc"); - -// List equParamVO=equipmentParamsetService.selectEquipmentParamSetDetail(classId); - //List list = this.libraryFaultBlocService.selectListByWhere("where 1=1 and pid = '"+classId+"' order by insdt desc"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getEquipmentParamSetValueJson.do") - public ModelAndView getEquipmentParamSetValueJson(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String unitId = request.getParameter("unitId"); - String classId = request.getParameter("classId"); - String EquipmentId = request.getParameter("equipmentId"); - Company company = this.companyService.selectByPrimaryKey(unitId); - - PageHelper.startPage(page, rows); - List equipmentParamsetDetails = this.equipmentParamsetDetailService.selectListByWhere4Eq( - EquipmentId,"where equipment_class_id = '"+classId+"' and library_bizid ='"+company.getLibraryBizid()+"' order by insdt desc"); - -// List equParamVO=equipmentParamsetService.selectEquipmentParamSetDetail(classId); - PageInfo pi = new PageInfo(equipmentParamsetDetails); - JSONArray json=JSONArray.fromObject(equipmentParamsetDetails); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } -/* @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname",equipmentClass.getName()); - model.addAttribute("pid",pid); - } - return "maintenance/faultlibraryAdd"; - }*/ - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname",equipmentClass.getName()); - model.addAttribute("pid",pid); - } - //return "maintenance/faultlibraryAdd"; - return "equipment/equipmentParamSetDetailAdd"; - } - - @ResponseBody - @RequestMapping("/dosave.do") - public Map dosave(HttpServletRequest request,Model model, - @ModelAttribute("EquipmentParamsetDetail") EquipmentParamsetDetail equipmentParamsetDetail){ - Map message = new HashMap(); - User cu= (User)request.getSession().getAttribute("cu"); - equipmentParamsetDetail.setId(CommUtil.getUUID()); - equipmentParamsetDetail.setInsuser(cu.getId()); - equipmentParamsetDetail.setInsdt(CommUtil.nowDate()); - int result=equipmentParamsetDetailService.save(equipmentParamsetDetail); - if(result>0){ - message.put("message", result); - }else{ - message.put("message", 0); - } - return message; - } -/* @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("faultLibrary") FaultLibrary faultLibrary){ - User cu= (User)request.getSession().getAttribute("cu"); - faultLibrary.setId(CommUtil.getUUID()); - faultLibrary.setInsdt(CommUtil.nowDate()); - faultLibrary.setInsuser(cu.getId()); - faultLibrary.setActive("1"); - int res = this.libraryFaultBlocService.save(faultLibrary); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - }*/ - -/* @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - FaultLibrary faultLibrary = this.libraryFaultBlocService.selectById(id); - if(faultLibrary!=null){ - model.addAttribute("faultLibrary",faultLibrary ); - EquipmentClass equipmentClass = equipmentClassService.selectById(faultLibrary.getPid()); - if(equipmentClass!=null){ - model.addAttribute("pname",equipmentClass.getName()); - } - } - return "maintenance/faultlibraryEdit"; - }*/ - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - EquipmentParamsetDetail equParamDetailSet=equipmentParamsetDetailService.selectById(id); - if(null!=equParamDetailSet.getEquipmentClassId()){ - if(null!=equParamDetailSet.getEquipmentClassId() && !"".equals(equParamDetailSet.getEquipmentClassId())){ - String equipmentClassId = equParamDetailSet.getEquipmentClassId(); - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentClassId); - if(null!=equipmentClass){ - model.addAttribute("equipmentClass",equipmentClass); - } - } - if(null!=equParamDetailSet.getParamId() && !"".equals(equParamDetailSet.getParamId())){ - String equipmentParamSetId = equParamDetailSet.getParamId(); - EquipmentParamset equipmentParamset = equipmentParamsetService.selectById(equipmentParamSetId); - if(null!=equipmentParamset){ - model.addAttribute("equipmentParamset",equipmentParamset); - } - } - model.addAttribute("equParamDetailSet",equParamDetailSet); - }else{ - return null; - } - return "equipment/equipmentParamSetDetailEdit"; - } - @RequestMapping("/doValueEdit1.do") - public String doValueEdit1(HttpServletRequest request,Model model, - @RequestParam(value="id") String id,@RequestParam(value="equipmentId") String equipmentId){ - - EquipmentParamsetDetail equipmentParamsetDetail=equipmentParamsetDetailService.selectById(id); - equipmentParamsetDetail.setEquipmentParamset(this.equipmentParamsetService.selectById(equipmentParamsetDetail.getParamId())); - List valueList = this.equipmentParamsetValueService.selectListByWhere("where detail_id = '"+id+"' and equipment_id = '"+equipmentId+"'"); - if(valueList!=null&&valueList.size()==1){ - equipmentParamsetDetail.setEquipmentParamsetValue(valueList.get(0)); - } - model.addAttribute("equipmentParamsetDetail",equipmentParamsetDetail); - return "equipment/equipmentParamSetValueAdd"; - } - @ResponseBody - @RequestMapping("/doValueSave.do") - public Map doValueSave(HttpServletRequest request,Model model, - @ModelAttribute(value="EquipmentParamsetValue") EquipmentParamsetValue equipmentParamsetValue){ - - String equipmentId = request.getParameter("equipmentId"); - String equipmentClassId = request.getParameter("equipmentClassId"); - - Map message = new HashMap(); - if(equipmentParamsetValue.getId()==null||equipmentParamsetValue.getId().equals("")){ - equipmentParamsetValue.setId(CommUtil.getUUID()); - int result=this.equipmentParamsetValueService.save(equipmentParamsetValue); - if(result>0){ - message.put("message", result); - }else{ - message.put("message", 0); - } - return message; - }else { - int result=this.equipmentParamsetValueService.update(equipmentParamsetValue); - if(result>0){ - message.put("message", result); - }else{ - message.put("message", 0); - } - return message; - } - - } - @RequestMapping("/doValueEdit.do") - public String doValueEdit(HttpServletRequest request,Model model, - @RequestParam(value="equipmentId") String equipmentId){ - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentId); - if(equipmentCard.getEquipmentclassid()!=null&&!equipmentCard.getEquipmentclassid().isEmpty()){ - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - List equipmentParamsetDetails = this.equipmentParamsetDetailService.selectListByWhere(" where equipment_class_id = '"+equipmentClass.getId()+"'"); - List equipmentParamsetValues = this.equipmentParamsetValueService.selectListByWhere(" where equipment_id = '"+equipmentId+"'"); - model.addAttribute("equipmentParamsetDetails",equipmentParamsetDetails); - model.addAttribute("equipmentParamsetValues",equipmentParamsetValues); - } - return "equipment/equipmentParamSetValueEdit"; - } - @RequestMapping("/doValueUpdate.do") - public String doValueUpdate(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - EquipmentParamsetDetail equParamDetailSet=equipmentParamsetDetailService.selectById(id); - if(null!=equParamDetailSet.getEquipmentClassId()){ - if(null!=equParamDetailSet.getEquipmentClassId() && !"".equals(equParamDetailSet.getEquipmentClassId())){ - String equipmentClassId = equParamDetailSet.getEquipmentClassId(); - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentClassId); - if(null!=equipmentClass){ - model.addAttribute("equipmentClass",equipmentClass); - } - } - if(null!=equParamDetailSet.getParamId() && !"".equals(equParamDetailSet.getParamId())){ - String equipmentParamSetId = equParamDetailSet.getParamId(); - EquipmentParamset equipmentParamset = equipmentParamsetService.selectById(equipmentParamSetId); - if(null!=equipmentParamset){ - model.addAttribute("equipmentParamset",equipmentParamset); - } - } - model.addAttribute("equParamDetailSet",equParamDetailSet); - }else{ - return null; - } - return "equipment/equipmentParamSetValueEdit"; - } -/* @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("faultLibrary") FaultLibrary faultLibrary){ - int res = this.libraryFaultBlocService.update(faultLibrary); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - }*/ - - @RequestMapping("/doUpdate.do") - @ResponseBody - public Map doUpdate(HttpServletRequest request,Model model, - @ModelAttribute("EquipmentParamsetDetail") EquipmentParamsetDetail equipmentParamsetDetail){ - Map message = new HashMap<>(); - int result = equipmentParamsetDetailService.update(equipmentParamsetDetail); - if(result > 0 ){ - message.put("message", 1); - }else { - message.put("message", 0); - } - return message; - } - -/* @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.libraryFaultBlocService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - //System.out.println(CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - //System.out.println(CommUtil.toJson(result)); - } - return new ModelAndView("result"); - }*/ - - @RequestMapping("/dodelete.do") - @ResponseBody - public Map dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Map message = new HashMap<>(); - int result=equipmentParamsetDetailService.deleteById(id); - if(result >0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - - return message; - } - - /** - * 根据搜索的条件查询对应的设备部位id - * @param request - * @param model - * @return - */ - @RequestMapping("/getClassIds4Search.do") - public String getClassIds4Search(HttpServletRequest request,Model model){ - String quotaTypes = request.getParameter("quotaTypes");//定额类型 低中高 - String repairPartyTypes = request.getParameter("repairPartyTypes");//维修方式 自修或委外 - String repairTypes = request.getParameter("repairTypes");//维修类型 小修、中修等 - String search_name = request.getParameter("search_name");//搜索内容 - - String faultWhereStr = " where 1=1 "; - String repairWhereStr = " where 1=1 "; - - if(search_name!=null && !search_name.trim().equals("")){ - repairWhereStr += " and (repair_number like '%"+search_name+"%' or name like '%"+search_name+"%')"; - } - -// if(quotaTypes!=null){ -// whereStr += " and quota_type = '"+quotaTypes+"' "; -// } -// if(quotaTypes!=null){ -// -// } -// if(quotaTypes!=null){ -// -// } - - String faultIds = ""; - List rlist = this.libraryRepairBlocService.selectListByWhere(repairWhereStr+" order by morder"); - if(rlist!=null){ - for (int i = 0; i < rlist.size(); i++) { - faultIds += "'"+rlist.get(i).getPid()+"',"; - } - if(faultIds!=null && !faultIds.equals("")){ - faultIds = faultIds.substring(0,faultIds.length() - 1); - } - } - - if(search_name!=null && !search_name.trim().equals("")){ - if(faultIds!=null && !faultIds.equals("")){//有符合的维修库 - faultWhereStr += " and ((fault_number like '%"+search_name+"%' or name like '%"+search_name+"%') or id in ("+faultIds+"))"; - }else {//没有符合的维修库 - faultWhereStr += " and (fault_number like '%"+search_name+"%' or name like '%"+search_name+"%')"; - } - } - - //System.out.println(faultWhereStr); - HashSet hashSet = new HashSet(); - List list = this.libraryFaultBlocService.selectListByWhere(faultWhereStr+" order by morder"); - - if(search_name!=null && !search_name.equals("")){ - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - hashSet.add(list.get(i).getPid()); - } - } - } - - Result result = Result.success(hashSet); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - /** - * 选择台账类型 - */ - @RequestMapping("/getEquipmentParamsetStatusEvaluationForSelect.do") - public String getEquipmentParamsetStatusEvaluationForSelect(HttpServletRequest request,Model model){ - JSONArray jsonArray=new JSONArray(); - List list = this.equipmentParamsetStatusEvaluationService.selectListByWhere("where 1=1"); - if(list!=null&&list.size()>0){ - for (EquipmentParamsetStatusEvaluation item : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", item.getId()); - jsonObject.put("text", item.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} - diff --git a/src/com/sipai/controller/equipment/EquipmentRepairPlanController.java b/src/com/sipai/controller/equipment/EquipmentRepairPlanController.java deleted file mode 100644 index 2f92e712..00000000 --- a/src/com/sipai/controller/equipment/EquipmentRepairPlanController.java +++ /dev/null @@ -1,556 +0,0 @@ -package com.sipai.controller.equipment; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentRepairPlan; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.LoginService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentRepairPlanService; -import com.sipai.service.equipment.MaintenancePlanService; -import com.sipai.service.maintenance.MaintainerService; -import com.sipai.service.maintenance.MaintainerTypeService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/equipment/equipmentRepairPlan") -public class EquipmentRepairPlanController { - @Resource - private EquipmentRepairPlanService equipmentRepairPlanService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private UnitService unitService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private WorkflowService workflowService; - @Resource - private UserService userService; - - - /* - * 打开维修计划页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/equipment/equipmentRepairPlanList"; - } - /* - * 打开检修计划页面 - */ - @RequestMapping("/showOverHaulList.do") - public String showOverHaulList(HttpServletRequest request,Model model) { - return "/equipment/overHaulPlanList"; - } - /* - * 获取检修/维修计划列表 - * 根据计划的类型planType筛选 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - if(request.getParameter("planType")!=null && !request.getParameter("planType").isEmpty()){ - wherestr += " and plan_type = '"+request.getParameter("planType")+"' "; - } - if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and biz_id in ("+companyids+") "; - } - } - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and process_section_id = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and content like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentRepairPlanService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /* - * 打开新增维护保养计划界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String detailNumber = company.getEname()+"-WXJH-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("detailNumber", detailNumber); - model.addAttribute("company",company); - return "equipment/equipmentRepairPlanAdd"; - } - /* - * 打开新增检修计划界面 - */ - @RequestMapping("/doaddOverHaul.do") - public String doaddOverHaul(HttpServletRequest request,Model model){ - return "equipment/overHaulPlanAdd"; - } - /* - * 打开编辑维护保养计划界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(Id); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/equipmentRepairPlanEdit"; - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(Id); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/equipmentRepairPlanView"; - } - /* - * 打开编辑检修计划界面 - */ - @RequestMapping("/doeditOverHaul.do") - public String doeditOverHaul(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(Id); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/overHaulPlanEdit"; - } - /* - * 检修/维护保养计划保存方法 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentRepairPlan maintenancePlan){ - User cu= (User)request.getSession().getAttribute("cu"); - maintenancePlan.setInsuser(cu.getId()); - maintenancePlan.setInsdt(CommUtil.nowDate()); - //下发的日期为空是月保养计划,要设置为null,否则数据库里会保存1900-01-01 - if (maintenancePlan.getInitialDate() == "") { - maintenancePlan.setInitialDate(null); - } - int result =this.equipmentRepairPlanService.save(maintenancePlan); - String resstr="{\"res\":\""+result+"\",\"id\":\""+maintenancePlan.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /* - * 检修/维护保养计划更新的方法 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentRepairPlan maintenancePlan){ - User cu= (User)request.getSession().getAttribute("cu"); - maintenancePlan.setInsuser(cu.getId()); - //下发的日期为空是月保养计划,要设置为null,否则数据库里会保存1900-01-01 - if (maintenancePlan.getInitialDate() == "") { - maintenancePlan.setInitialDate(null); - } - int result = this.equipmentRepairPlanService.update(maintenancePlan); - String resstr="{\"res\":\""+result+"\",\"id\":\""+maintenancePlan.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 更新,启动保养计划审核流程 - * */ - @RequestMapping("/startPlanAudit.do") - public String startPlanAudit(HttpServletRequest request,Model model, - @ModelAttribute EquipmentRepairPlan maintenancePlan){ - User cu= (User)request.getSession().getAttribute("cu"); - maintenancePlan.setInsuser(cu.getId()); - maintenancePlan.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.equipmentRepairPlanService.startPlanAudit(maintenancePlan); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+maintenancePlan.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示保养计划审核 - * */ - @RequestMapping("/showAuditMaintainPlan.do") - public String showAuditMaintainPlan(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String maintenancePlanId= pInstance.getBusinessKey(); - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(maintenancePlanId); - model.addAttribute("maintenancePlan", maintenancePlan); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/equipmentRepairPlanAudit"; - } - /** - * 流程流转-保养计划审核 - * */ - @RequestMapping("/doAuditMaintain.do") - public String doAuditMaintain(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.equipmentRepairPlanService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 保养计划退回时,回到保养计划调整界面 - * */ - @RequestMapping("/showMaintainPlanHandle.do") - public String showMaintainPlanHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String maintenancePlanId = pInstance.getBusinessKey(); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+maintenancePlanId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(maintenancePlanId); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/maintenancePlanHandle"; - } - /** - * 流程流程,退回的保养计划,编辑后再次提交审核 - * */ - @Transactional - @RequestMapping("/submitAuditAgain.do") - public String dosubmitAuditAgain(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.equipmentRepairPlanService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看保养计划审核流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessMaintainPlanView.do") - public String showProcessMaintainPlanView(HttpServletRequest request,Model model){ - String maintenancePlanId = request.getParameter("id"); - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(maintenancePlanId); - request.setAttribute("business", maintenancePlan); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenancePlan); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(maintenancePlan.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_Maintain_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+maintenancePlanId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Maintain_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+maintenancePlanId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = maintenancePlan.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(maintenancePlan.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - return "equipment/equipmentRepairPlanExecuteView"; - } - /* - * 单条数据删除方法 - */ - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentRepairPlanService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /* - * 多条数据删除方法 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentRepairPlanService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 发布保养计划 - */ - @RequestMapping("/doIssueMaintain.do") - public String doIssue(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - List maintenancePlans = this.equipmentRepairPlanService.selectListByWhere("where id in ('"+ids+"')"); - int result=0; - for (EquipmentRepairPlan maintenancePlan : maintenancePlans) { - result=this.equipmentRepairPlanService.issueMaintainPlan(maintenancePlan); - //有一条计划下发失败则停止下发 - if (result!=1) { - break; - } - } - model.addAttribute("result", result); - return "result"; - } - /** - * 检查计划编号是否存在 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request,Model model) { - String planNumber =request.getParameter("planNumber"); - String id =request.getParameter("id"); - if(this.equipmentRepairPlanService.checkNotOccupied(id, planNumber)){ - model.addAttribute("result","{\"valid\":"+false+"}"); - return "result"; - }else { - model.addAttribute("result","{\"valid\":"+true+"}"); - return "result"; - } - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentSaleApplyController.java b/src/com/sipai/controller/equipment/EquipmentSaleApplyController.java deleted file mode 100644 index d0b19503..00000000 --- a/src/com/sipai/controller/equipment/EquipmentSaleApplyController.java +++ /dev/null @@ -1,629 +0,0 @@ -package com.sipai.controller.equipment; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.mail.Session; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentSaleApply; -import com.sipai.entity.equipment.EquipmentSaleApplyDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentSaleApplyDetailService; -import com.sipai.service.equipment.EquipmentSaleApplyService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/EquipmentSaleApply") -public class EquipmentSaleApplyController { - @Resource - private EquipmentSaleApplyService equipmentSaleApplyService; - @Resource - private UnitService unitService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentSaleApplyDetailService equipmentSaleApplyDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "equipment/equipmentSaleApplyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - String sdt, String edt, String search_name,String companyId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sb = new StringBuilder("where 1=1"); - - if(null!=sdt && !"".equals(sdt)) - sb.append(" and apply_time >="+"'"+sdt+"'"); - if(null!=edt &&!"".equals(edt)) - sb.append(" and apply_time <="+"'"+edt+"'"); - if(null!=search_name && !"".equals(search_name)) - sb.append(" and equipment_name like "+"'"+"%"+search_name+"%"+"'"); - if(null!=companyId && !"".equals(companyId)) - sb.append(" and biz_id = "+"'"+companyId+"'"); - - EquipmentSaleApply esa = new EquipmentSaleApply(); - esa.setWhere(sb.append("order by insdt desc").toString()); - PageHelper.startPage(page, rows); - List esaList = equipmentSaleApplyService.selectListByWhere(sb.toString()); - JSONArray jsonArray = JSONArray.fromObject(esaList); - PageInfo pInfo = new PageInfo(esaList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu= (User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String saleApplyNumber = company.getEname()+"-SBCS-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("company", company); - model.addAttribute("cu", cu); - model.addAttribute("saleApplyNumber", saleApplyNumber); - return "equipment/equipmentSaleApplyAdd"; - } - - @RequestMapping("/getEquipmentName4Select.do") - public String getEquipmentName4Select(HttpServletRequest request, Model model,String companyId) { - List ec =equipmentCardService.selectListByWhere(companyId,"where bizId="+"'"+companyId+"'"); - JSONArray json = new JSONArray(); - if (ec != null && ec.size() > 0) { - for (EquipmentCard eqcard : ec) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", eqcard.getId()); - jsonObject.put("text", eqcard.getEquipmentname()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentSaleApply esa - ){ - User cu= (User)request.getSession().getAttribute("cu"); - esa.setInsuser(cu.getId()); - esa.setInsdt(CommUtil.nowDate()); - if("".equals(esa.getId()) || null==esa.getId() || esa.getId().isEmpty()){ - esa.setId(CommUtil.getUUID()); - } - esa.setApplyTime(CommUtil.nowDate()); - //设备资产编号,查询设备型号,设备名称(TB_EM_Equipment_TypeNumber,TB_EM_Equipment_TypeNumber) - //EquipmentSaleApply esaVar=equipmentSaleApplyService.selectEquipmentOtherInfoById(esa.getEquipmentId()); - //esa.setAssetsCode(esaVar.getAssetsCode()); - //esa.setEquipmentModel(esaVar.getEquipmentModel()); - //esa.setEquipmentModelName(esaVar.getEquipmentModelName()); - int result =equipmentSaleApplyService.save(esa); - String resstr="{\"res\":\""+result+"\",\"id\":\""+esa.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - EquipmentSaleApply esa=equipmentSaleApplyService.selectById(id); - equipmentSaleApplyDetailService.deleteByWhere("where sale_apply_number="+"'"+esa.getSaleApplyNumber()+"'"); - int result =equipmentSaleApplyService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - int result=0; - String idArr[]=ids.split(","); - for(String id:idArr){ - EquipmentSaleApply esa=equipmentSaleApplyService.selectById(id); - equipmentSaleApplyDetailService.deleteByWhere("where sale_apply_number="+"'"+esa.getSaleApplyNumber()+"'"); - result = equipmentSaleApplyService.deleteById(id); - result++; - } - - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String companyId) { - EquipmentSaleApply esa=equipmentSaleApplyService.selectById(id); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - model.addAttribute("esa", esa); - model.addAttribute("id",id); - return "/equipment/equipmentSaleApplyEdit"; - - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentSaleApply esa) { - User cu = (User) request.getSession().getAttribute("cu"); - //esa.setInsdt(CommUtil.nowDate()); - esa.setInsuser(cu.getId()); - //esa.setApplyTime(CommUtil.nowDate()); - //设备资产编号,查询设备型号,设备名称(TB_EM_Equipment_TypeNumber,TB_EM_Equipment_TypeNumber) - //EquipmentSaleApply esaVar=equipmentSaleApplyService.selectEquipmentOtherInfoById(esa.getEquipmentId()); - //esa.setAssetsCode(esaVar.getAssetsCode()); - //esa.setEquipmentModel(esaVar.getEquipmentModel()); - //esa.setEquipmentModelName(esaVar.getEquipmentModelName()); - int result=equipmentSaleApplyService.update(esa); - String resstr="{\"res\":\""+result+"\",\"id\":\""+esa.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - //以下是新增内容 - /** - * 获取出售设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentSaleApplyDetailList.do") - public ModelAndView getEquipmentSaleApplyDetailList(HttpServletRequest request,Model model, - String saleApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= saleApplyNumber && !"".equals(saleApplyNumber)) - sb.append("and sale_apply_number ="+"'"+saleApplyNumber+"'"); - - PageHelper.startPage(page, rows); - List esadList=equipmentSaleApplyDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=esadList && !esadList.isEmpty()){ - for(EquipmentSaleApplyDetail esad:esadList){ - EquipmentCard ec=equipmentCardService.selectById(esad.getEquipmentCardId()); - esad.setEquipmentCard(ec); - } - } - PageInfo pInfo = new PageInfo(esadList); - JSONArray jsonArray = JSONArray.fromObject(esadList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - - /** - * 新增出售明细,选择设备台账明细界面 - */ - @RequestMapping("/selectEquipmentCardDetails.do") - public String doselectEquipmentCardDetails (HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - if(equipmentCardIds!=null && !equipmentCardIds.isEmpty()){ - String[] id_Array= equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - return "/equipment/equipmentCard4Selects"; - } - - /** - * 设备出售申请单选择设备台账后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentSaleApplyDetails.do") - public String dosaveEquipmentSaleApplyDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String saleApplyNumber = request.getParameter("saleApplyNumber"); - String[] idArrary = equipmentCardIds.split(","); - BigDecimal totalMoney=new BigDecimal("0"); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - - List esadList = equipmentSaleApplyDetailService.selectListByWhere("where sale_apply_number ='"+saleApplyNumber+"' and equipment_card_id ='"+str+"'"); - if (esadList == null || esadList.size() == 0) { - EquipmentCard ec=equipmentCardService.selectById(str); - EquipmentSaleApplyDetail esad = new EquipmentSaleApplyDetail(); - esad.setId(CommUtil.getUUID()); - esad.setInsdt(CommUtil.nowDate()); - esad.setInsuser(cu.getId()); - esad.setEquipmentCardId(ec.getId()); - esad.setSaleApplyNumber(saleApplyNumber); - //BigDecimal temptotalMoney=new BigDecimal("0"); - //temptotalMoney=ec.getResidualvalue(); - //totalMoney=totalMoney.add(temptotalMoney); - result = this.equipmentSaleApplyDetailService.save(esad); - if (result != 1) { - flag = false; - } - } - } - } - List esadList=equipmentSaleApplyDetailService.selectListByWhere("where sale_apply_number ="+"'"+saleApplyNumber+"'"); - if(!esadList.isEmpty() && esadList.size()>0 && null!=esadList){ - for(EquipmentSaleApplyDetail elad:esadList){ - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - } - - - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - /** - * 删除出售设备明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentSaleApplyDetail.do") - public String dodeletesEquipmentSaleApplyDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money){ - - BigDecimal totalMoney=new BigDecimal(money); - boolean flag=false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - - EquipmentSaleApplyDetail elad=equipmentSaleApplyDetailService.selectById(id); - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal(0); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.subtract(tempTotalMoney); - equipmentSaleApplyDetailService.deleteById(id); - flag=true; - } - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - EquipmentSaleApply esa=equipmentSaleApplyService.selectById(id); - //esa.setTotalMoney((new BigDecimal(new DecimalFormat("#.00").format(esa.getTotalMoney())))); - model.addAttribute("esa", esa); - return "/equipment/equipmentSaleApplyView"; - } - /** - * 更新,启动设备出售申请审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute EquipmentSaleApply equipmentSaleApply){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentSaleApply.setInsuser(cu.getId()); - equipmentSaleApply.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.equipmentSaleApplyService.startProcess(equipmentSaleApply); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentSaleApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看出售申请审核处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessSaleApplyView.do") - public String showProcessSaleApplyView(HttpServletRequest request,Model model){ - String saleApplyId = request.getParameter("id"); - EquipmentSaleApply equipmentSaleApply = this.equipmentSaleApplyService.selectById(saleApplyId); - request.setAttribute("business", equipmentSaleApply); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentSaleApply); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(equipmentSaleApply.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet<>(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_SALE_APPLY_ADJUST: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+saleApplyId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_SALE_APPLY_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+saleApplyId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = equipmentSaleApply.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(equipmentSaleApply.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - return "equipment/equipmentSaleApplyExecuteView"; - } - /** - * 显示出售申请审核 - * */ - @RequestMapping("/showAuditSaleApply.do") - public String showAuditSaleApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String saleApplyId= pInstance.getBusinessKey(); - EquipmentSaleApply saleApply = this.equipmentSaleApplyService.selectById(saleApplyId); - model.addAttribute("saleApply", saleApply); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/equipmentSaleApplyAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/auditSaleApply.do") - public String doAuditLoseApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.equipmentSaleApplyService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示出售申请业务调整处理 - * */ - @RequestMapping("/showSaleApplyAdjust.do") - public String showSaleApplyAdjust(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String saleApplyId = pInstance.getBusinessKey(); - EquipmentSaleApply saleApply = this.equipmentSaleApplyService.selectById(saleApplyId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+saleApplyId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("saleApply", saleApply); - return "equipment/equipmentSaleApplyAdjust"; - } - /** - * 设备出售申请调整后,再次提交审核 - * */ - @RequestMapping("/submitSaleApplyAdjust.do") - public String doSubmitSaleApplyAdjust(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.equipmentSaleApplyService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentScrapApplyCollectController.java b/src/com/sipai/controller/equipment/EquipmentScrapApplyCollectController.java deleted file mode 100644 index c4a7d836..00000000 --- a/src/com/sipai/controller/equipment/EquipmentScrapApplyCollectController.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.collections.map.HashedMap; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentScrapApplyCollect; -import com.sipai.entity.sparepart.Goods; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentScrapApplyService; -import com.sipai.service.sparepart.GoodsService; - -@Controller -@RequestMapping("/equipment/equipmentScrapApplyCollect") -public class EquipmentScrapApplyCollectController { - - @Resource - private EquipmentScrapApplyService equipmentScrapApplyService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private GoodsService goodsService; - - - @RequestMapping("/showList.do") - public String showList (){ - return "/equipment/equipmentScrapApplyCollectList"; - } - - @RequestMapping("/getList.do") - @ResponseBody - public Map getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - Map resultMap = new HashedMap(); - if(sort==null){ - sort = " t.insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - String sdt=request.getParameter("sdt"); - String edt=request.getParameter("edt"); - if(null!=sdt && !"".equals(sdt)){ - wherestr =wherestr+ " and t.apply_time >='"+sdt+"'"; - } - - if(null!=edt && !"".equals(edt)){ - wherestr =wherestr+ " and t.apply_time <='"+edt+"'"; - } - - String searchName=request.getParameter("search_name"); - if(null!=searchName && !"".equals(searchName)){ - String likeCondition = "'%"+searchName+"%'"; - String likeSql= - " and (tec.equipmentCardID like "+ likeCondition + - " or tec.equipmentName like "+likeCondition+ - " or t.scrap_apply_number like"+likeCondition+ - " or tc.sname like "+likeCondition + - " or td.name like"+likeCondition+ - " or tu.caption like"+likeCondition+")"; - - wherestr +=likeSql; - } - - String companyId=request.getParameter("companyId"); - if(null!=companyId && !"".equals(companyId)){ - wherestr =wherestr+ " and t.biz_id ='"+companyId+"'"; - } - - String where = wherestr+orderstr; - PageHelper.startPage(page, rows); - List list = equipmentScrapApplyService.findEquScrapCollect(where); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - resultMap.put("total", pi.getTotal()); - resultMap.put("rows", json); - return resultMap; -/* String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result");*/ - } - - /** - * 新增申购明细时,选择报废物品信息界面,goodsIds显示已选择的物品--历史订单 - */ - @RequestMapping("/selectGoodsForScrap.do") - public String selectGoodsForScrap (HttpServletRequest request,Model model) { - String goodsIds = request.getParameter("goodsIds"); - if(goodsIds!=null && !goodsIds.isEmpty()){ - String[] id_Array= goodsIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("goodsIds", jsonArray); - } - return "/equipment/goods4Scrap"; - } - - /** - * 新增申购明细时,选择报废物品信息界面, - * 根据已选择的设备id获取设备数据中的设备类型和规格型号,同时去物品中匹配,返回匹配合适的物品id - */ - @RequestMapping("/goodsForSelectByEqu.do") - public ModelAndView goodsForSelectByEqu (HttpServletRequest request,Model model) { - String equids = request.getParameter("equids"); - if(equids!=null && !equids.isEmpty()){ - String[] id_Array= equids.split(","); - String goodsIds = ""; - String equipmentmodelname = ""; - String equipmentclassname = ""; - for (String equid : id_Array) { - if(!equid.isEmpty()){ - //获取设备类型和规格型号 - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equid); - if(equipmentCard!=null){ - equipmentmodelname = equipmentCard.getEquipmentmodelname(); - if(equipmentCard.getEquipmentClass()!=null){ - equipmentclassname = equipmentCard.getEquipmentClass().getName(); - }else{ - equipmentclassname = equipmentCard.getEquipmentname(); - } - if(!equipmentmodelname.equals("") && !equipmentclassname.equals("")){ - List goodslist = this.goodsService.selectListByWhere("where name like '%"+equipmentclassname+"%' " - + "and model like '%"+equipmentmodelname+"%' "); - if(goodslist!=null && goodslist.size()>0){ - for(Goods goods:goodslist){ - if(goodsIds!=null && !goodsIds.equals("")){ - goodsIds+=","; - } - goodsIds +=goods.getId(); - } - } - } - } - } - } - model.addAttribute("result",goodsIds); - } - return new ModelAndView("result"); - } - - /** - * 导出 - */ - @RequestMapping(value = "/doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value="unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.equipmentScrapApplyService.doExport(unitId, request, response); - return null; - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentScrapApplyController.java b/src/com/sipai/controller/equipment/EquipmentScrapApplyController.java deleted file mode 100644 index 13d8cda2..00000000 --- a/src/com/sipai/controller/equipment/EquipmentScrapApplyController.java +++ /dev/null @@ -1,902 +0,0 @@ -package com.sipai.controller.equipment; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.company.CompanyService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentScrapApply; -import com.sipai.entity.equipment.EquipmentScrapApplyDetail; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentScrapApplyDetailService; -import com.sipai.service.equipment.EquipmentScrapApplyService; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/EquipmentScrapApply") -public class EquipmentScrapApplyController { - @Resource - private EquipmentScrapApplyService equipmentScrapApplyService; - @Resource - private EquipmentScrapApplyDetailService equipmentScrapApplyDetailService; - @Resource - private UnitService unitService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private CompanyService companyService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "equipment/equipmentScrapApplyList"; - } - - @RequestMapping("/printList.do") - public String printList(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - model.addAttribute("id", id); - return "equipment/EquipmentScrapPrint"; - } - - @RequestMapping("/getprintList.do") - public ModelAndView getprintList(HttpServletRequest request, Model model) { - - String id = request.getParameter("id"); - EquipmentScrapApply esa = equipmentScrapApplyService.selectById(id); - List esadList = equipmentScrapApplyDetailService.selectListByWhere("where scrap_apply_number ='" + esa.getScrapApplyNumber() + "' "); - if (null != esadList && !esadList.isEmpty()) { - for (EquipmentScrapApplyDetail esad : esadList) { - EquipmentCard ec = equipmentCardService.selectById(esad.getEquipmentCardId()); - String modelId = ec.getEquipmentmodel(); - EquipmentTypeNumber equType = equipmentTypeNumberService.selectById(modelId); - ec.setEquipmentmodelname(equType.getName()); - if (ec.getUsedate() != null && ec.getUsedate().length() > 10) { - ec.setUsedate(ec.getUsedate().substring(0, 10)); - String year = ec.getUsedate().substring(0, 4); - String month = ec.getUsedate().substring(4, 6); - String day = ec.getUsedate().substring(6); - String useDateStr = year + "-" + month + "-" + day; - esad.set_tousedate(useMonthCount(useDateStr)); - } - if (ec.getProductiondate() != null && ec.getProductiondate().length() > 10) { - ec.setProductiondate(ec.getProductiondate().substring(0, 10)); - } - esad.setEquipmentCard(ec); - esad.set_unit(this.unitService.getUnitById(userService.getUserById(esa.getInsuser()).getPid()).getName()); - } - } - esa.setEquipmentScrapApplyDetail(esadList); - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + id + "' order by insdt desc"); - int endkey; - esa.set_applyTime("填报日期:    " + esa.getApplyTime().substring(0, 4) + "年" + esa.getApplyTime().substring(5, 7) + "月" + esa.getApplyTime().substring(8, 10) + "日"); - if (list_audit.get(0).getTaskdefinitionkey().equals(list_audit.get(1).getTaskdefinitionkey())) { - endkey = 8; - - esa.set_user0("报废原因:" + esa.getScrapInstr()); - esa.set_auditopinion0("经办人:" + esa.getApplyPeopleName() + "  填报日期:" + esa.getApplyTime().substring(0, 4) + "年" + esa.getApplyTime().substring(5, 7) + "月" + esa.getApplyTime().substring(8, 10) + "日"); - - esa.set_user1("申请部门意见:(盖章):" + list_audit.get(7).getAuditopinion()); - esa.set_auditopinion1("负责人:" + this.userService.getUserById(list_audit.get(7).getInsuser()).getCaption()); - - esa.set_user2("申请部门分管领导意见:" + list_audit.get(1).getAuditopinion()); - esa.set_auditopinion2("申请部门分管领导:" + this.userService.getUserById(list_audit.get(1).getInsuser()).getCaption()); - - esa.set_user3("审核意见:" + list_audit.get(5).getAuditopinion()); - esa.set_auditopinion3("审核人:" + this.userService.getUserById(list_audit.get(5).getInsuser()).getCaption()); - - esa.set_user4("运行管理科意见:(盖章)" + list_audit.get(2).getAuditopinion()); - esa.set_auditopinion4("负责人:" + this.userService.getUserById(list_audit.get(2).getInsuser()).getCaption()); - - esa.set_user5("财务科意见:(盖章)" + list_audit.get(3).getAuditopinion()); - esa.set_auditopinion5("负责人:" + this.userService.getUserById(list_audit.get(3).getInsuser()).getCaption()); - - esa.set_user6("主管领导:" + this.userService.getUserById(list_audit.get(0).getInsuser()).getCaption()); - - } else { - endkey = 7; - esa.set_user0("报废原因:" + esa.getScrapInstr()); - esa.set_auditopinion0("经办人:" + esa.getApplyPeopleName() + "  填报日期:" + esa.getApplyTime().substring(0, 4) + "年" + esa.getApplyTime().substring(5, 7) + "月" + esa.getApplyTime().substring(8, 10) + "日"); - - esa.set_user1("申请部门意见:(盖章):" + list_audit.get(6).getAuditopinion()); - esa.set_auditopinion1("负责人:" + this.userService.getUserById(list_audit.get(6).getInsuser()).getCaption()); - - esa.set_user2("申请部门分管领导意见:" + list_audit.get(0).getAuditopinion()); - esa.set_auditopinion2("申请部门分管领导:" + this.userService.getUserById(list_audit.get(0).getInsuser()).getCaption()); - - esa.set_user3("审核意见:" + list_audit.get(4).getAuditopinion()); - esa.set_auditopinion3("审核人:" + this.userService.getUserById(list_audit.get(4).getInsuser()).getCaption()); - - esa.set_user4("运行管理科意见:(盖章)" + list_audit.get(1).getAuditopinion()); - esa.set_auditopinion4("负责人:" + this.userService.getUserById(list_audit.get(1).getInsuser()).getCaption()); - - esa.set_user5("财务科意见:(盖章)" + list_audit.get(2).getAuditopinion()); - esa.set_auditopinion5("负责人:" + this.userService.getUserById(list_audit.get(2).getInsuser()).getCaption()); - - esa.set_user6("主管领导:"); - } - - JSONObject fromObject = JSONObject.fromObject(esa); - String resstr = "{\"res\":\"" + fromObject + "\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); - - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - String sdt, String edt, String search_name, String companyId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sb = new StringBuilder("where 1=1"); - - if (null != sdt && !"".equals(sdt)) - sb.append(" and apply_time >=" + "'" + sdt + "'"); - if (null != edt && !"".equals(edt)) - sb.append(" and apply_time <=" + "'" + edt + "'"); - if (null != search_name && !"".equals(search_name)) - sb.append(" and apply_people_name like " + "'" + "%" + search_name + "%" + "'"); - if (null != companyId && !"".equals(companyId)) - sb.append(" and biz_id =" + "'" + companyId + "'"); - EquipmentScrapApply esa = new EquipmentScrapApply(); - esa.setWhere(sb.append("order by insdt desc").toString()); - PageHelper.startPage(page, rows); - List etaList = equipmentScrapApplyService.selectListByWhere(sb.toString()); - JSONArray jsonArray = JSONArray.fromObject(etaList); - PageInfo pInfo = new PageInfo(etaList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String scrapApplyNumber = company.getEname() + "-SBBF-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - model.addAttribute("scrapApplyNumber", scrapApplyNumber); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("company", company); - model.addAttribute("cu", cu); - return "equipment/equipmentScrapApplyAdd"; - } - - @RequestMapping("/getEquipmentName4Select.do") - public String getEquipmentName4Select(HttpServletRequest request, Model model, String companyId) { - List ec = equipmentCardService.selectListByWhere(companyId, "where bizId=" + "'" + companyId + "'"); - JSONArray json = new JSONArray(); - if (ec != null && ec.size() > 0) { - for (EquipmentCard eqcard : ec) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", eqcard.getId()); - jsonObject.put("text", eqcard.getEquipmentname()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute EquipmentScrapApply esa - ) { - User cu = (User) request.getSession().getAttribute("cu"); - esa.setInsuser(cu.getId()); - esa.setInsdt(CommUtil.nowDate()); - if ("".equals(esa.getId()) || null == esa.getId() || esa.getId().isEmpty()) { - esa.setId(CommUtil.getUUID()); - } - //esa.setApplyTime(CommUtil.nowDate()); - //设备资产编号,查询设备型号,设备名称(TB_EM_Equipment_TypeNumber,TB_EM_Equipment_TypeNumber) - //EquipmentScrapApply esaVar=equipmentScrapApplyService.selectEquipmentOtherInfoById(esa.getEquipmentId()); - //esa.setAssetsCode(esaVar.getAssetsCode()); - //esa.setEquipmentModel(esaVar.getEquipmentModel()); - //esa.setEquipmentModelName(esaVar.getEquipmentModelName()); - int result = equipmentScrapApplyService.save(esa); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + esa.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/doEquipmentCardSrcapSave.do") - public String doEquipmentCardSrcapSave(HttpServletRequest request, Model model) { - EquipmentScrapApply esa = new EquipmentScrapApply(); - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - // 设备ids - String eqIds = request.getParameter("ids"); - Company company = companyService.selectByPrimaryKey(companyId); - esa.setId(CommUtil.getUUID()); - esa.setInsuser(cu.getId()); - esa.setInsdt(CommUtil.nowDate()); - // 状态 未提交 - esa.setStatus("0"); - // 申请日期 - esa.setApplyTime(CommUtil.nowDate()); - // 报废申请编号 - String scrapApplyNumber = company.getEname() + "-SBBF-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - esa.setScrapApplyNumber(scrapApplyNumber); - // 申请人 - esa.setApplyPeopleId(cu.getId()); - // 申请人姓名 - esa.setApplyPeopleName(cu.getCaption()); - // 厂id - esa.setBizId(company.getId()); - // 报废原因 - esa.setScrapInstr("报废提醒!"); - // 遍历设备并新增 - if (StringUtils.isNotBlank(eqIds)) { - BigDecimal totalMoney = new BigDecimal("0"); - eqIds = eqIds.replace(",", "','"); - List equipmentCards = equipmentCardService.selectListByWhere("where id in ('" + eqIds + "')"); - for (EquipmentCard equipmentCard : equipmentCards) { - if (equipmentCard.getEquipWorth() != null) { - totalMoney.add(equipmentCard.getEquipWorth()); - } - // 创建detail对象并新增 - EquipmentScrapApplyDetail esad = new EquipmentScrapApplyDetail(); - esad.setId(CommUtil.getUUID()); - esad.setInsdt(CommUtil.nowDate()); - esad.setInsuser(cu.getId()); - esad.setEquipmentCardId(equipmentCard.getId()); - esad.setScrapApplyNumber(scrapApplyNumber); - this.equipmentScrapApplyDetailService.save(esad); - } - esa.setTotalMoney(totalMoney); - } - int result = equipmentScrapApplyService.save(esa); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + esa.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentScrapApply esa = equipmentScrapApplyService.selectById(id); - equipmentScrapApplyDetailService.deleteByWhere("where scrap_apply_number=" + "'" + esa.getScrapApplyNumber() + "'"); - int result = equipmentScrapApplyService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/deleteByNumber.do") - public String deleteByNumber(HttpServletRequest request, Model model, - @RequestParam(value = "scrapApplyNumber") String scrapApplyNumber) { - int result = equipmentScrapApplyDetailService.deleteByWhere("where scrap_apply_number=" + "'" + scrapApplyNumber + "'"); - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - int result = 0; - String idArr[] = ids.split(","); - for (String id : idArr) { - EquipmentScrapApply esa = equipmentScrapApplyService.selectById(id); - equipmentScrapApplyDetailService.deleteByWhere("where scrap_apply_number=" + "'" + esa.getScrapApplyNumber() + "'"); - result = equipmentScrapApplyService.deleteById(id); - result++; - } - - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, String companyId) { - - EquipmentScrapApply esa = equipmentScrapApplyService.selectById(id); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - model.addAttribute("esa", esa); - model.addAttribute("id", id); - return "/equipment/equipmentScrapApplyEdit"; - - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute EquipmentScrapApply esa) { - User cu = (User) request.getSession().getAttribute("cu"); - //esa.setInsdt(CommUtil.nowDate()); - esa.setInsuser(cu.getId()); - esa.setApplyTime(CommUtil.nowDate()); - //设备资产编号,查询设备型号,设备名称(TB_EM_Equipment_TypeNumber,TB_EM_Equipment_TypeNumber) - // EquipmentScrapApply esaVar=equipmentScrapApplyService.selectEquipmentOtherInfoById(esa.getEquipmentId()); - // esa.setAssetsCode(esaVar.getAssetsCode()); - // esa.setEquipmentModel(esaVar.getEquipmentModel()); - // esa.setEquipmentModelName(esaVar.getEquipmentModelName()); - int result = equipmentScrapApplyService.update(esa); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + esa.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - //以下是新增内容 - - /** - * 获取报废设备明细 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentScrapApplyDetailList.do") - public ModelAndView getEquipmentScrapApplyDetailList(HttpServletRequest request, Model model, - String scrapApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb = new StringBuilder("where 1=1 "); - if (null != scrapApplyNumber && !"".equals(scrapApplyNumber)) - sb.append("and scrap_apply_number =" + "'" + scrapApplyNumber + "'"); - - PageHelper.startPage(page, rows); - List esadList = equipmentScrapApplyDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if (null != esadList && !esadList.isEmpty()) { - for (EquipmentScrapApplyDetail esad : esadList) { - EquipmentCard ec = equipmentCardService.selectById(esad.getEquipmentCardId()); - esad.setEquipmentCard(ec); - } - } - PageInfo pInfo = new PageInfo(esadList); - JSONArray jsonArray = JSONArray.fromObject(esadList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 新增报废明细,选择设备台账明细界面 - */ - @RequestMapping("/selectEquipmentCardDetails.do") - public String doselectEquipmentCardDetails(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - if (equipmentCardIds != null && !equipmentCardIds.isEmpty()) { - String[] id_Array = equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - return "/equipment/equipmentCard4Selects"; - } - - - /** - * 设备报废申请单选择设备台账后保存 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentScrapApplyDetails.do") - public String dosaveEquipmentScrapApplyDetails(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String scrapApplyNumber = request.getParameter("scrapApplyNumber"); - String[] idArrary = equipmentCardIds.split(","); - BigDecimal totalMoney = new BigDecimal("0"); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - - List esadList = equipmentScrapApplyDetailService.selectListByWhere("where scrap_apply_number ='" + scrapApplyNumber + "' and equipment_card_id ='" + str + "'"); - if (esadList == null || esadList.size() == 0) { - EquipmentCard ec = equipmentCardService.selectById(str); - EquipmentScrapApplyDetail esad = new EquipmentScrapApplyDetail(); - esad.setId(CommUtil.getUUID()); - esad.setInsdt(CommUtil.nowDate()); - esad.setInsuser(cu.getId()); - esad.setEquipmentCardId(ec.getId()); - esad.setScrapApplyNumber(scrapApplyNumber); - result = this.equipmentScrapApplyDetailService.save(esad); - if (result != 1) { - flag = false; - } - } - } - } - List esadList = equipmentScrapApplyDetailService.selectListByWhere("where scrap_apply_number =" + "'" + scrapApplyNumber + "'"); - if (!esadList.isEmpty() && esadList.size() > 0 && null != esadList) { - for (EquipmentScrapApplyDetail esad : esadList) { - EquipmentCard ec = equipmentCardService.selectById(esad.getEquipmentCardId()); - BigDecimal tempTotalMoney = new BigDecimal("0"); - tempTotalMoney = ec.getResidualvalue(); - if (null != tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney = totalMoney.add(tempTotalMoney); - } - } - String resultstr = "{\"res\":\"" + flag + "\",\"totalMoney\":\"" + totalMoney + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - - /** - * 删除报废设备明细 - * - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentScrapApplyDetail.do") - public String dodeletesEquipmentScrapApplyDetail(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, String money) { - BigDecimal totalMoney = new BigDecimal(money); - boolean flag = false; - String[] idsArr = ids.split(","); - for (String id : idsArr) { - - EquipmentScrapApplyDetail esad = equipmentScrapApplyDetailService.selectById(id); - EquipmentCard ec = equipmentCardService.selectById(esad.getEquipmentCardId()); - BigDecimal tempTotalMoney = new BigDecimal(0); - tempTotalMoney = ec.getResidualvalue(); - if (null != tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney = totalMoney.subtract(tempTotalMoney); - equipmentScrapApplyDetailService.deleteById(id); - flag = true; - } - String resultstr = "{\"res\":\"" + flag + "\",\"totalMoney\":\"" + totalMoney + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentScrapApply esa = equipmentScrapApplyService.selectById(id); - //esa.setTotalMoney((new BigDecimal(new DecimalFormat("#.00").format(esa.getTotalMoney())))); - model.addAttribute("esa", esa); - return "/equipment/equipmentScrapApplyView"; - } - - /** - * 更新,启动设备报废申请审核流程 - */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request, Model model, - @ModelAttribute EquipmentScrapApply equipmentScrapApply) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentScrapApply.setInsuser(cu.getId()); - equipmentScrapApply.setInsdt(CommUtil.nowDate()); - int result = 0; - try { - result = this.equipmentScrapApplyService.startProcess(equipmentScrapApply); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentScrapApply.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看报废申请审核处理流程详情 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessScrapApplyView.do") - public String showProcessScrapApplyView(HttpServletRequest request, Model model) { - String scrapApplyId = request.getParameter("id"); - EquipmentScrapApply equipmentScrapApply = this.equipmentScrapApplyService.selectById(scrapApplyId); - request.setAttribute("business", equipmentScrapApply); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentScrapApply); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(equipmentScrapApply.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_SCRAP_APPLY_ADJUST: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + scrapApplyId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_SCRAP_APPLY_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + scrapApplyId + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = equipmentScrapApply.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(equipmentScrapApply.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "equipment/equipmentScrapApplyExecuteViewInModal"; - } else { - return "equipment/equipmentScrapApplyExecuteView"; - } - } - - /** - * 显示报废申请审核 - */ - @RequestMapping("/showAuditScrapApply.do") - public String showAuditScrapApply(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String scrapApplyId = pInstance.getBusinessKey(); - EquipmentScrapApply scrapApply = this.equipmentScrapApplyService.selectById(scrapApplyId); - model.addAttribute("scrapApply", scrapApply); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/equipmentScrapApplyAudit"; - } - - /** - * 流程流转 - */ - @RequestMapping("/auditScrapApply.do") - public String doAuditScrapApply(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.equipmentScrapApplyService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示报废申请业务调整处理 - */ - @RequestMapping("/showScrapApplyAdjust.do") - public String showScrapApplyAdjust(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); -// ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() -// .processInstanceId(processInstanceId) -// .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); -// String outStockRecordId = pInstance.getBusinessKey(); - -// List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); -// if(businessUnitHandles!= null && businessUnitHandles.size()>0){ -// businessUnitHandle = businessUnitHandles.get(0); -// //若任务退回后,需更新新的任务id -// businessUnitHandle.setTaskid(taskId); -// }else{ -// businessUnitHandle.setId(CommUtil.getUUID()); -// businessUnitHandle.setProcessid(processInstanceId); -// businessUnitHandle.setTaskid(taskId); -// businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); -// businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); -// businessUnitHandle.setUnitid(unitId); -// } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String scrapApplyId = pInstance.getBusinessKey(); - EquipmentScrapApply scrapApply = this.equipmentScrapApplyService.selectById(scrapApplyId); -// List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+scrapApplyId+"' order by insdt desc "); -// model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("businessUnitAudit", businessUnitAudit); - model.addAttribute("scrapApply", scrapApply); - return "equipment/equipmentScrapApplyAdjust"; - } - - /** - * 设备报废申请调整后,再次提交审核 - */ - @RequestMapping("/submitScrapApplyAdjust.do") - public String doSubmitScrapApplyAdjust(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - this.equipmentScrapApplyService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 检查当前选中设备中是否已存在报废明细表中 - */ - @RequestMapping("/doCheckAcrap.do") - public String doCheckAcra(HttpServletRequest request, Model model) { - // 设备ids - String ids = request.getParameter("ids"); - String[] split = ids.split(","); - String resultStr = ""; - - // 报废申请单id - String scrapId = request.getParameter("scrapId"); - - for(String id : split) { - List equipmentScrapApplyDetails = equipmentScrapApplyDetailService.selectListByWhere("where equipment_card_id = '" + id + "'"); - List applies = new ArrayList<>(); - for (EquipmentScrapApplyDetail item : equipmentScrapApplyDetails) { - String wherestr = "where scrap_apply_number = '" + item.getScrapApplyNumber() + "' " + - " and status != '" + SparePartCommString.STATUS_SCRAP_FAIL + "'"; - if (StringUtils.isNotBlank(scrapId)) { - wherestr += " and id != '" + scrapId + "'"; - } - List equipmentScrapApplies = equipmentScrapApplyService.selectListByWhere(wherestr); - applies.addAll(equipmentScrapApplies); - } - if (equipmentScrapApplyDetails != null && equipmentScrapApplyDetails.size() > 0 && applies.size() > 0) { - EquipmentCard equipmentCard = equipmentCardService.selectById(equipmentScrapApplyDetails.get(0).getEquipmentCardId()); - resultStr += equipmentCard.getEquipmentcardid() + " "; - } - } - String result = "{\"res\":\"" + 0 + "\"}"; - if (StringUtils.isNotBlank(resultStr)) { - resultStr += " 当前设备编号已存在申请单;"; - result = "{\"res\":\"" + 1 + "\",\"data\":\"" + resultStr + "\"}"; - } - model.addAttribute("result", result); - return "result"; - } - - - /** - * @param useDate - * @return - */ - public String useMonthCount(String useDate) { - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date()); - int currYear = cal.get(Calendar.YEAR); - int currMonth = (cal.get(Calendar.MONTH) + 1); - String yearStr = useDate.substring(0, 4); - String monthStr = useDate.substring(5, 7); - int yearInt = Integer.parseInt(yearStr); - int monthInt = Integer.parseInt(monthStr); - String result = (currYear - yearInt) + "年" + (currMonth - monthInt) + "月"; - return result; - } - - @RequestMapping("/getScrapDt.do") - public String getScrapDt(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - String orderstr = " order by esa.apply_time desc"; - String wherestr = "where 1=1 and esa.apply_time is not null "; - //仅查已完成的 - wherestr += " and esa.status = '2' "; - - if (equipmentId != null && !equipmentId.isEmpty()) { - wherestr += " and esad.equipment_card_id = '" + equipmentId + "' "; - } -// System.out.println(wherestr + orderstr); - List list = equipmentScrapApplyDetailService.selectListByWhereAndApplyStatus(wherestr + orderstr); - String result = ""; - if (list != null && list.size() > 0) { - if (list.get(0).get_tousedate() != null && !list.get(0).get_tousedate().equals("")) { - result = list.get(0).get_tousedate().substring(0, 10); - } - } else { - result = "无"; - } - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentSpecificationController.java b/src/com/sipai/controller/equipment/EquipmentSpecificationController.java deleted file mode 100644 index 124eb725..00000000 --- a/src/com/sipai/controller/equipment/EquipmentSpecificationController.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentSpecificationService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentSpecification") -public class EquipmentSpecificationController { - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/equipment/equipmentSpecificationList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentSpecificationService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentSpecificationAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentSpecificationService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentSpecificationService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentSpecification") EquipmentSpecification equipmentSpecification){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentSpecification.setId(CommUtil.getUUID()); - equipmentSpecification.setInsuser(cu.getId()); - equipmentSpecification.setInsdt(CommUtil.nowDate()); - int result = this.equipmentSpecificationService.save(equipmentSpecification); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentSpecification.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(id); - model.addAttribute("equipmentSpecification", equipmentSpecification); - return "equipment/equipmentSpecificationView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(id); - model.addAttribute("equipmentSpecification", equipmentSpecification); - return "equipment/equipmentSpecificationEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentSpecification") EquipmentSpecification equipmentSpecification){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentSpecification.setInsuser(cu.getId()); - equipmentSpecification.setInsdt(CommUtil.nowDate()); - int result = this.equipmentSpecificationService.update(equipmentSpecification); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentSpecification.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 选择设备规格(select2下拉选择) - */ - @RequestMapping("/getEquipmentSpecificationForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request,Model model){ - List list = this.equipmentSpecificationService.selectListByWhere("where active= '"+CommString.Active_True+"'"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (EquipmentSpecification equipmentSpecification : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", equipmentSpecification.getId()); - jsonObject.put("text", equipmentSpecification.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentStatusManagementController.java b/src/com/sipai/controller/equipment/EquipmentStatusManagementController.java deleted file mode 100644 index 49b6efc1..00000000 --- a/src/com/sipai/controller/equipment/EquipmentStatusManagementController.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentStatusManagementService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentStatusManagement") -public class EquipmentStatusManagementController { - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/equipment/equipmentStatusManagementList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentStatusManagementService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentStatusManagementAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentStatusManagementService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentStatusManagementService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentStatusManagement") EquipmentStatusManagement equipmentStatusManagement){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentStatusManagement.setId(CommUtil.getUUID()); - equipmentStatusManagement.setInsuser(cu.getId()); - equipmentStatusManagement.setInsdt(CommUtil.nowDate()); - int result = this.equipmentStatusManagementService.save(equipmentStatusManagement); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentStatusManagement.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(id); - model.addAttribute("equipmentStatusManagement", equipmentStatusManagement); - return "equipment/equipmentStatusManagementEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentStatusManagement") EquipmentStatusManagement equipmentStatusManagement){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentStatusManagement.setInsuser(cu.getId()); - equipmentStatusManagement.setInsdt(CommUtil.nowDate()); - int result = this.equipmentStatusManagementService.update(equipmentStatusManagement); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentStatusManagement.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getListForEquipment.do") - public ModelAndView getListForEquipment(HttpServletRequest request,Model model) { - String orderstr=" order by morder "; - - String wherestr=" where 1=1 and active='"+CommString.Active_True+"' "; - - List list = this.equipmentStatusManagementService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - - //2020-07-08 start - @RequestMapping("/selectEquipmentStatus.do") - public String selectEquipmentStatus(HttpServletRequest request,Model model) { - String equipmentstatus = request.getParameter("equipmentstatus"); - model.addAttribute("equipmentstatus", equipmentstatus); - return "/equipment/selectEquipmentStatus"; - } - - /* - * 下拉筛选 - */ - @RequestMapping("/getEquipmentstatus4Select.do") - public String getEquipmentstatus4Select(HttpServletRequest request,Model model){ - List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where 1=1 and active = '"+CommString.Flag_Active+"' order by morder"); - JSONArray json = new JSONArray(); - if(equipmentStatusManagements!=null && equipmentStatusManagements.size()>0){ - for(int i=0;i esrdMap = new HashMap<>(); - - - List esrdList=equipmentStopRecordDetailService.selectListByWhere(whereSb.append(orderStr).toString()); - - if(esrdList.size() >0 && null!=esrdList){ - StringBuilder whereTempSb = new StringBuilder("where 1=1"); - for(EquipmentStopRecordDetail esrd:esrdList){ - String ecId =esrd.getEquipmentCardId(); - esrdMap.put(ecId,esrd); - - } - - StringBuilder stopApplyNumberSb = new StringBuilder(); - for(Map.Entry entry :esrdMap.entrySet()){ - stopApplyNumberSb.append("'"+entry.getValue().getStopApplyNumber()+"'"+","); - - } - - - String stopApplyNumber = stopApplyNumberSb.substring(0,stopApplyNumberSb.length()-1); - - String conditionStr = " and stop_apply_number in ("+stopApplyNumber+") "; - - String beginTime = request.getParameter("beginTimeStore"); - String endTime = request.getParameter("endTimeStore"); - if(beginTime!=null && !beginTime.isEmpty() && !beginTime.equals("") && endTime!=null && !endTime.isEmpty() && !endTime.equals("")){ - if(beginTime.equals(endTime)){ - conditionStr += " and datediff(dd, insdt,'"+beginTime+"')=0 "; - }else{ - conditionStr += " and insdt>'"+beginTime+"' and insdt<'"+endTime+"' "; - } - } - String sql = whereTempSb.append(conditionStr).append(orderStr).toString(); - - - PageHelper.startPage(page, rows); - List esrList = equipmentStopRecordService.selectListByWhere(sql); - JSONArray jsonArray = JSONArray.fromObject(esrList); - PageInfo pInfo = new PageInfo(esrList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - }else{ - model.addAttribute("result", ""); - return new ModelAndView("result"); - } - - } - ////////////////////////////////////////////////////////////////////////////////////////////////////// - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - String sdt, String edt, String search_name,String companyId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sb = new StringBuilder("where 1=1"); - if(!"".equals(companyId) && null!=companyId){ - sb.append(" and a.biz_id ='"+companyId+"'"); - } - String equipmentCardClass = request.getParameter("search_pid1");//设备类型 - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null){ - //遍历 - //递归查询 - //获取所有子节点 - List units = this.equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids=""; - for(EquipmentClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - sb.append(" and c.equipmentClassID in ("+companyids+") "); - }else{ - sb.append(" and c.equipmentClassID='"+equipmentCardClass+"'"); - } - } - - sb.append(" order by a.insdt desc"); - PageHelper.startPage(page, rows); -// List esrList = equipmentStopRecordService.selectListByWhere(sb.toString()); - List esrList = equipmentStopRecordService.selectListByEquipClass(sb.toString()); - JSONArray jsonArray = JSONArray.fromObject(esrList); - PageInfo pInfo = new PageInfo(esrList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/addEquipmentStopRecordApply.do") - public String addEquipmentStopRecordApply(HttpServletRequest request, Model model) { - User cu= (User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String stopApplyNumber = company.getEname()+"-SBTY-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("company", company); - model.addAttribute("cu", cu); - model.addAttribute("stopApplyNumber", stopApplyNumber); - return "equipment/equipmentStopRecordApplyAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentStopRecord esr - ){ - User cu= (User)request.getSession().getAttribute("cu"); - esr.setInsuser(cu.getId()); - esr.setInsdt(CommUtil.nowDate()); - esr.setApplyTime(CommUtil.nowDate()); - if("".equals(esr.getId()) || null==esr.getId() || esr.getId().isEmpty()){ - esr.setId(CommUtil.getUUID()); - } - int result =equipmentStopRecordService.save(esr); - String resstr="{\"res\":\""+result+"\",\"id\":\""+esr.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取停用设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentStopApplyDetailList.do") - public ModelAndView getEquipmentStopApplyDetailList(HttpServletRequest request,Model model, - String stopApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= stopApplyNumber && !"".equals(stopApplyNumber)) - sb.append("and stop_apply_number ="+"'"+stopApplyNumber+"'"); - - PageHelper.startPage(page, rows); - List esrList=equipmentStopRecordDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=esrList && !esrList.isEmpty()){ - for(EquipmentStopRecordDetail esr:esrList){ - EquipmentCard ec=equipmentCardService.selectById(esr.getEquipmentCardId()); - esr.setEquipmentCard(ec); - } - } - PageInfo pInfo = new PageInfo(esrList); - JSONArray jsonArray = JSONArray.fromObject(esrList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增设备停用明细,选择设备台账明细界面 - */ - @RequestMapping("/selectEquipmentCardDetails.do") - public String doselectEquipmentCardDetails (HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - if(equipmentCardIds!=null && !equipmentCardIds.isEmpty()){ - String[] id_Array= equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - //return "/equipment/equipmentCard4Selects"; - return "/equipment/selectEquipmentCards"; - } - - - - /** - * 设备停用申请单选择设备台账后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentStopApplyDetails.do") - public String dosaveEquipmentLoseApplyDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String stopApplyNumber = request.getParameter("stopApplyNumber"); - String[] idArrary = equipmentCardIds.split(","); - - //BigDecimal totalMoney=new BigDecimal("0"); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - - List esrList = equipmentStopRecordDetailService.selectListByWhere("where stop_apply_number ='"+stopApplyNumber+"' and equipment_card_id ='"+str+"'"); - if (esrList == null || esrList.size() == 0) { - EquipmentCard ec=equipmentCardService.selectById(str); - EquipmentStopRecordDetail esr = new EquipmentStopRecordDetail(); - esr.setId(CommUtil.getUUID()); - esr.setInsdt(CommUtil.nowDate()); - esr.setInsuser(cu.getId()); - esr.setEquipmentCardId(ec.getId()); - esr.setStopApplyNumber(stopApplyNumber); - - result = this.equipmentStopRecordDetailService.save(esr); - if (result != 1) { - flag = false; - } - } - } - } - -/* List eladList=equipmentLoseApplyDetailService.selectListByWhere("where lose_apply_number ="+"'"+loseApplyNumber+"'"); - if(!eladList.isEmpty() && eladList.size()>0 && null!=eladList){ - for(EquipmentLoseApplyDetail elad:eladList){ - EquipmentCard ec=equipmentCardService.selectById(elad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - }*/ - - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - - /** - * 删除停用设备明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentStopApplyDetail.do") - public String deletesEquipmentStopApplyDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money){ - - //BigDecimal totalMoney=new BigDecimal(money); - boolean flag=false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - - //EquipmentStopRecordDetail esrd=equipmentStopRecordDetailService.selectById(id); - //EquipmentCard ec=equipmentCardService.selectById(esrd.getEquipmentCardId()); - //BigDecimal tempTotalMoney=new BigDecimal(0); - //tempTotalMoney=ec.getResidualvalue(); - //if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - // totalMoney=totalMoney.subtract(tempTotalMoney); - equipmentStopRecordDetailService.deleteById(id); - flag=true; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - EquipmentStopRecord esr=equipmentStopRecordService.selectById(id); - equipmentStopRecordDetailService.deleteByWhere("where stop_apply_number="+"'"+esr.getStopApplyNumber()+"'"); - int result =equipmentStopRecordService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - int result=0; - String idArr[]=ids.split(","); - for(String id:idArr){ - EquipmentStopRecord esr=equipmentStopRecordService.selectById(id); - equipmentStopRecordDetailService.deleteByWhere("where stop_apply_number="+"'"+esr.getStopApplyNumber()+"'"); - result = equipmentStopRecordService.deleteById(id); - result++; - } - - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - EquipmentStopRecord esr=equipmentStopRecordService.selectById(id); - //ela.setTotalMoney((new BigDecimal(new DecimalFormat("#.00").format(ela.getTotalMoney())))); - model.addAttribute("esr", esr); - Company company = this.unitService.getCompById(esr.getBizId()); - model.addAttribute("company",company); - //return "/equipment/equipmentLoseApplyView"; - return "/equipment/equipmentStopRecordView"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id ) { - EquipmentStopRecord esr=equipmentStopRecordService.selectById(id); - Company company = this.unitService.getCompById(esr.getBizId()); - model.addAttribute("company",company); - model.addAttribute("esr", esr); - model.addAttribute("id",id); - //return "/equipment/equipmentLoseApplyEdit"; - - return "/equipment/equipmentStopRecordEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentStopRecord esr) { - //User cu = (User) request.getSession().getAttribute("cu"); - //esa.setInsdt(CommUtil.nowDate()); - // ela.setInsuser(cu.getId()); - int result=equipmentStopRecordService.update(esr); - String resstr="{\"res\":\""+result+"\",\"id\":\""+esr.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新,启动设备停用申请审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute EquipmentStopRecord equipmentStopRecord){ - - String nowDate = CommUtil.nowDate(); - User cu= (User)request.getSession().getAttribute("cu"); - - if(null==equipmentStopRecord.getId() || "".equals(equipmentStopRecord.getId())){ - equipmentStopRecord.setId(CommUtil.getUUID()); - } - - if(null==equipmentStopRecord.getInsuser() || "".equals(equipmentStopRecord.getInsuser())){ - equipmentStopRecord.setInsuser(cu.getId()); - } - - if(null==equipmentStopRecord.getInsdt() || "".equals(equipmentStopRecord.getInsdt())){ - equipmentStopRecord.setInsdt(nowDate); - } - - if(null==equipmentStopRecord.getApplyTime() || "".equals(equipmentStopRecord.getApplyTime())){ - equipmentStopRecord.setApplyTime(nowDate); - } - - int result=0; - try { - result =this.equipmentStopRecordService.startProcess(equipmentStopRecord); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentStopRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示设备停用申请审核 - * */ - @RequestMapping("/showAuditEquipmentStopApply.do") - public String showAuditEquipmentStopApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task =this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String equipmentStopApplyId= pInstance.getBusinessKey(); - EquipmentStopRecord esr = this.equipmentStopRecordService.selectById(equipmentStopApplyId); - model.addAttribute("esr", esr); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - //return "equipment/equipmentLoseApplyAudit"; - - return "equipment/equipmentStopRecordApplyAudit"; - } - - /** - * 流程流转 - * */ - @RequestMapping("/auditEquipmentStopApply.do") - public String doAuditLoseApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.equipmentStopRecordService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示设备停用申请业务调整处理 - * */ - @RequestMapping("/showEquipmentStopApplyAdjust.do") - public String showLoseApplyAdjust(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String equipmentStopApplyId = pInstance.getBusinessKey(); - EquipmentStopRecord esr = this.equipmentStopRecordService.selectById(equipmentStopApplyId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+equipmentStopApplyId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("esr", esr); - //return "equipment/equipmentLoseApplyAdjust"; - - return "equipment/equipmentStopRecordApplyAdjust"; - } - - /** - * 设备停用申请调整后,再次提交审核 - * */ - @RequestMapping("/submitEquipmentStopApplyAdjust.do") - public String doSubmitLoseApplyAdjust(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - - this.equipmentStopRecordService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看设备停用申请审核处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessEquipmentStopApplyView.do") - public String showProcessLoseApplyView(HttpServletRequest request,Model model){ - String equipmentStopApplyId = request.getParameter("id"); - //EquipmentLoseApply equipmentLoseApply = this.equipmentLoseApplyService.selectById(loseApplyId); - EquipmentStopRecord equipmentStopRecord = this.equipmentStopRecordService.selectById(equipmentStopApplyId); - request.setAttribute("business", equipmentStopRecord); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentStopRecord); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(equipmentStopRecord.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_EQUIPMENT_STOP_APPLY_ADJUST: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+equipmentStopApplyId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_EQUIPMENT_STOP_APPLY_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+equipmentStopApplyId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = equipmentStopRecord.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(equipmentStopRecord.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - //return "equipment/equipmentLoseApplyExecuteView"; - //return "equipment/equipmentStopRecordApplyExecuteView"; - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "equipment/equipmentStopRecordApplyExecuteViewInModal"; - }else{ - return "equipment/equipmentStopRecordApplyExecuteView"; - } - } - - @RequestMapping("/dealWith.do") - public String dealWith(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - EquipmentStopRecord esr=equipmentStopRecordService.selectById(id); - esr.setStartTime(sdf.format(new Date())); - int result =equipmentStopRecordService.update(esr); - model.addAttribute("result",result); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/EquipmentTransfersApplyCollectController.java b/src/com/sipai/controller/equipment/EquipmentTransfersApplyCollectController.java deleted file mode 100644 index 6cbebc97..00000000 --- a/src/com/sipai/controller/equipment/EquipmentTransfersApplyCollectController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.apache.commons.collections.map.HashedMap; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentTransfersApplyCollect; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentTransfersApplyService; - -@Controller -@RequestMapping("/equipment/equipmentTransfersApplyCollect") -public class EquipmentTransfersApplyCollectController { - - @Resource - private EquipmentTransfersApplyService equipmentTransfersApplyService; - - @RequestMapping("/showList.do") - public String showList (){ - return "/equipment/equipmentTransfersApplyCollectList"; - } - -/* @RequestMapping("/getList.do") - @ResponseBody - public String getList (){ - - return "/equipment/equipmentTransfersApplyCollectList"; - }*/ - - @RequestMapping("/getList.do") - @ResponseBody - public Map getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - Map resultMap = new HashedMap(); - if(sort==null){ - sort = " t.insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - String sdt=request.getParameter("sdt"); - String edt=request.getParameter("edt"); - if(null!=sdt && !"".equals(sdt)){ - wherestr =wherestr+ " and t.apply_time >='"+sdt+"'"; - } - - if(null!=edt && !"".equals(edt)){ - wherestr =wherestr+ " and t.apply_time <='"+edt+"'"; - } - - String searchName=request.getParameter("search_name"); - if(null!=searchName && !"".equals(searchName)){ - String likeCondition = "'%"+searchName+"%'"; - String likeSql= - " and (tc.equipmentName like "+ likeCondition + - " or tg.name like "+likeCondition+ - " or t.transfers_apply_number like"+likeCondition+ - " or tm.sname like "+likeCondition + - " or tcm.sname like"+likeCondition+ - " or tc.equipmentCardID like"+likeCondition+ - " or td.name like"+likeCondition+")"; - - wherestr +=likeSql; - } - - String companyId=request.getParameter("companyId"); - if(null!=companyId && !"".equals(companyId)){ - wherestr =wherestr+ " and t.biz_id ='"+companyId+"'"; - } - - String where = wherestr+orderstr; - PageHelper.startPage(page, rows); - List list = equipmentTransfersApplyService.findEquTraApplyCollect(where); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - resultMap.put("total", pi.getTotal()); - resultMap.put("rows", json); - return resultMap; -/* String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result");*/ - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentTransfersApplyController.java b/src/com/sipai/controller/equipment/EquipmentTransfersApplyController.java deleted file mode 100644 index a914b7b7..00000000 --- a/src/com/sipai/controller/equipment/EquipmentTransfersApplyController.java +++ /dev/null @@ -1,951 +0,0 @@ -package com.sipai.controller.equipment; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentScrapApply; -import com.sipai.entity.equipment.EquipmentScrapApplyDetail; -import com.sipai.entity.equipment.EquipmentTransfersApply; -import com.sipai.entity.equipment.EquipmentTransfersApplyDetail; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.OutStockRecordDetail; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.StockTransfersApplyDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentTransfersApplyDetailService; -import com.sipai.service.equipment.EquipmentTransfersApplyService; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.sparepart.StockTransfersApplyDetailService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/EquipmentTransfersApply") -public class EquipmentTransfersApplyController { - @Resource - private EquipmentTransfersApplyService equipmentTransfersApplyService; - @Resource - private EquipmentTransfersApplyDetailService equipmentTransfersApplyDetailService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UnitService unitService; - @Resource - private GoodsService goodsService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private StockTransfersApplyDetailService stockTransfersApplyDetailService; - @Resource - private StockService stockService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "equipment/equipmentTransfersApplyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - String sdt, String edt, String search_name,String companyId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sb = new StringBuilder("where 1=1"); - - if(null!=sdt && !"".equals(sdt)) - sb.append(" and apply_time >="+"'"+sdt+"'"); - if(null!=edt &&!"".equals(edt)) - sb.append(" and apply_time <="+"'"+edt+"'"); - if(null!=search_name && !"".equals(search_name)) - sb.append(" and apply_people_name like "+"'"+"%"+search_name+"%"+"'"); - if(null!=companyId && !"".equals(companyId)) - sb.append(" and biz_id ="+"'"+companyId+"'"); - - EquipmentTransfersApply eta = new EquipmentTransfersApply(); - eta.setWhere(sb.append("order by insdt desc").toString()); - PageHelper.startPage(page, rows); - List etaList = equipmentTransfersApplyService.selectListByWhere(sb.toString()); - JSONArray jsonArray = JSONArray.fromObject(etaList); - PageInfo pInfo = new PageInfo( - etaList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu= (User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String transfersApplyNumber = company.getEname()+"-SBDB-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("transfersApplyNumber", transfersApplyNumber); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("company", company); - model.addAttribute("cu", cu); - return "equipment/equipmentTransfersApplyAdd"; - } - @RequestMapping("/printList.do") - public String printList(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - model.addAttribute("id", id); - return "equipment/EquipmentTransfersPrint"; - } - @RequestMapping("/getprintList.do") - public ModelAndView getprintList(HttpServletRequest request, Model model) { - - String id = request.getParameter("id"); - EquipmentTransfersApply esa=equipmentTransfersApplyService.selectById(id); - List esadList=equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ='"+esa.getTransfersApplyNumber()+"' "); - if(null!=esadList && !esadList.isEmpty()){ - for(EquipmentTransfersApplyDetail esad:esadList){ - EquipmentCard ec=equipmentCardService.selectById(esad.getEquipmentCardId()); - String modelId=ec.getEquipmentmodel(); - EquipmentTypeNumber equType=equipmentTypeNumberService.selectById(modelId); - ec.setEquipmentmodelname(equType.getName()); - esad.setEquipmentCard(ec); - } - } - esa.setEquipmentTransfersApplyDetails(esadList); - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+id+"' order by insdt desc"); - - esa.set_data4("调出部门负责人:"+ this. userService.getUserById(list_audit.get(2).getInsuser()).getCaption()+"

"+list_audit.get(2).getInsdt().substring(0,4)+"年"+list_audit.get(2).getInsdt().substring(5,7)+"月"+list_audit.get(2).getInsdt().substring(8,10)+"日"); - esa.set_data5("调入部门负责人:"+this. userService.getUserById(list_audit.get(3).getInsuser()).getCaption()+"

"+list_audit.get(3).getInsdt().substring(0,4)+"年"+list_audit.get(3).getInsdt().substring(5,7)+"月"+list_audit.get(3).getInsdt().substring(8,10)+"日"); - - esa.set_data6(list_audit.get(1).getAuditopinion()); - esa.set_data7("经办人:

     年     月    日"); - esa.set_data8(" 部门负责人:"+this. userService.getUserById(list_audit.get(1).getInsuser()).getCaption()+"

"+list_audit.get(1).getInsdt().substring(0,4)+"年"+list_audit.get(1).getInsdt().substring(5,7)+"月"+list_audit.get(1).getInsdt().substring(8,10)+"日"); - - - esa.set_data9(list_audit.get(0).getAuditopinion()); - esa.set_data10("签名:"+this. userService.getUserById(list_audit.get(0).getInsuser()).getCaption()+" "+list_audit.get(0).getInsdt().substring(0,4)+"年"+list_audit.get(0).getInsdt().substring(5,7)+"月"+list_audit.get(0).getInsdt().substring(8,10)+"日"); - - JSONObject fromObject = JSONObject.fromObject(esa); - String resstr="{\"res\":\""+fromObject+"\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); - - } - @RequestMapping("/getSparePartGoods4Select.do") - public String getDeptByBizId4Select(HttpServletRequest request, Model model) { - List goodsList = goodsService - .selectListByWhere("order by insdt desc"); - JSONArray json = new JSONArray(); - if (goodsList != null && goodsList.size() > 0) { - for (Goods good : goodsList) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", good.getId()); - jsonObject.put("text", good.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentTransfersApply eta - ){ - User cu= (User)request.getSession().getAttribute("cu"); - eta.setInsuser(cu.getId()); - eta.setInsdt(CommUtil.nowDate()); - if("".equals(eta.getId()) || null==eta.getId() || eta.getId().isEmpty()){ - eta.setId(CommUtil.getUUID()); - } - eta.setApplyTime(CommUtil.nowDate()); - //Goods goods=goodsService.selectById(eta.getEquipmentId()); - //eta.setEquipmentModel(goods.getModel()); ; - int result =equipmentTransfersApplyService.save(eta); - String resstr="{\"res\":\""+result+"\",\"id\":\""+eta.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - EquipmentTransfersApply eta=equipmentTransfersApplyService.selectById(id); - equipmentTransfersApplyDetailService.deleteByWhere("where transfers_apply_number="+"'"+eta.getTransfersApplyNumber()+"'"); - stockTransfersApplyDetailService.deleteByWhere("where transfers_apply_number="+"'"+eta.getTransfersApplyNumber()+"'"); - int result =equipmentTransfersApplyService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - int result=0; - String idArr[]=ids.split(","); - for(String id:idArr){ - EquipmentTransfersApply eta=equipmentTransfersApplyService.selectById(id); - equipmentTransfersApplyDetailService.deleteByWhere("where transfers_apply_number="+"'"+eta.getTransfersApplyNumber()+"'"); - stockTransfersApplyDetailService.deleteByWhere("where transfers_apply_number="+"'"+eta.getTransfersApplyNumber()+"'"); - result = equipmentTransfersApplyService.deleteById(id); - result++; - } - - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String companyId) { - - EquipmentTransfersApply eta=equipmentTransfersApplyService.selectById(id); - //Company company = this.unitService.getCompById(companyId); - //model.addAttribute("company",company); - model.addAttribute("eta", eta); - model.addAttribute("id",id); - return "/equipment/equipmentTransfersApplyEdit"; - - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentTransfersApply eta) { - User cu = (User) request.getSession().getAttribute("cu"); - eta.setInsdt(CommUtil.nowDate()); - eta.setInsuser(cu.getId()); - eta.setApplyTime(CommUtil.nowDate()); - int result=equipmentTransfersApplyService.update(eta); - String resstr="{\"res\":\""+result+"\",\"id\":\""+eta.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - //以下是新增内容 - /** - * 获取调拨设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentTransfersApplyDetailList.do") - public ModelAndView getEquipmentTransfersApplyDetailList(HttpServletRequest request,Model model, - String transfersApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= transfersApplyNumber && !"".equals(transfersApplyNumber)) - sb.append("and transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - - PageHelper.startPage(page, rows); - List etadList=equipmentTransfersApplyDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=etadList && !etadList.isEmpty()){ - for(EquipmentTransfersApplyDetail etad:etadList){ - EquipmentCard ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - etad.setEquipmentCard(ec); - } - } - PageInfo pInfo = new PageInfo(etadList); - JSONArray jsonArray = JSONArray.fromObject(etadList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - /** - * 新增调拨明细,选择设备台账明细界面 - */ - @RequestMapping("/selectEquipmentCardDetails.do") - public String doselectEquipmentCardDetails (HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - if(equipmentCardIds!=null && !equipmentCardIds.isEmpty()){ - String[] id_Array= equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - return "/equipment/equipmentCard4Selects"; - } - - - /** - * 设备调拨申请单选择设备台账后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentTransfersApplyDetails.do") - public String dosaveEquipmentTransfersApplyDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String transfersApplyNumber = request.getParameter("transfersApplyNumber"); - BigDecimal totalMoney=new BigDecimal("0"); - String[] idArrary = equipmentCardIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - List etadList = equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ='"+transfersApplyNumber+"' and equipment_card_id ='"+str+"'"); - if (etadList == null || etadList.size() == 0) { - EquipmentCard ec=equipmentCardService.selectById(str); - EquipmentTransfersApplyDetail etad = new EquipmentTransfersApplyDetail(); - etad.setId(CommUtil.getUUID()); - etad.setInsdt(CommUtil.nowDate()); - etad.setInsuser(cu.getId()); - etad.setEquipmentCardId(ec.getId()); - etad.setTransfersApplyNumber(transfersApplyNumber); - result = this.equipmentTransfersApplyDetailService.save(etad); - if (result != 1) { - flag = false; - } - } - } - } - List etadList=equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!etadList.isEmpty() && etadList.size()>0 && null!=etadList){ - for(EquipmentTransfersApplyDetail etad:etadList){ - EquipmentCard ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - } - - List stadList=stockTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!stadList.isEmpty() && stadList.size()>0 && null!=stadList){ - for(StockTransfersApplyDetail stad:stadList){ - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=stad.getTotalMoney();//ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - } - - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - - model.addAttribute("result",resultstr); - return "result"; - } - - /** - * 删除调拨设备明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipmentTransfersApplyDetail.do") - public String dodeletesEquipmentTransfersApplyDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money,String transfersApplyNumber){ - BigDecimal totalMoney=new BigDecimal(money); - boolean flag=false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - EquipmentTransfersApplyDetail etad=equipmentTransfersApplyDetailService.selectById(id); - EquipmentCard ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal(0); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.subtract(tempTotalMoney); - equipmentTransfersApplyDetailService.deleteById(id); - flag=true; - } - /* - List stadList=stockTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!stadList.isEmpty() && stadList.size()>0 && null!=stadList){ - for(StockTransfersApplyDetail stad:stadList){ - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=stad.getTotalMoney();//ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.subtract(tempTotalMoney); - } - } - */ - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id,String companyId){ - //Company company = this.unitService.getCompById(companyId); - EquipmentTransfersApply eta=equipmentTransfersApplyService.selectById(id); - model.addAttribute("eta", eta); - //model.addAttribute("company", company); - return "/equipment/equipmentTransfersApplyView"; - } - /** - * 更新,启动设备调拨申请审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute EquipmentTransfersApply equipmentTransfersApply){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentTransfersApply.setInsuser(cu.getId()); - equipmentTransfersApply.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.equipmentTransfersApplyService.startProcess(equipmentTransfersApply); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentTransfersApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看调拨申请审核处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessTransfersApplyView.do") - public String showProcessTransfersApplyView(HttpServletRequest request,Model model){ - String transfersApplyId = request.getParameter("id"); - EquipmentTransfersApply equipmentTransfersApply = this.equipmentTransfersApplyService.selectById(transfersApplyId); - request.setAttribute("business", equipmentTransfersApply); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentTransfersApply); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(equipmentTransfersApply.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_TRANSFERS_APPLY_ADJUST: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+transfersApplyId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_TRANSFERS_APPLY_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+transfersApplyId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = equipmentTransfersApply.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(equipmentTransfersApply.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "equipment/equipmentTransfersApplyExecuteViewInModal"; - }else{ - return "equipment/equipmentTransfersApplyExecuteView"; - } - } - /** - * 显示调拨申请审核 - * */ - @RequestMapping("/showAuditTransfersApply.do") - public String showAuditTransfersApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String transfersApplyId= pInstance.getBusinessKey(); - EquipmentTransfersApply transfersApply = this.equipmentTransfersApplyService.selectById(transfersApplyId); - model.addAttribute("transfersApply", transfersApply); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - -// if(request.getParameter("inModal")!=null){ -// //判断显示在流程处理模态框右侧 -// return "equipment/equipmentScrapApplyExecuteViewInModal"; -// }else{ -// return "equipment/equipmentScrapApplyExecuteView"; -// } - return "equipment/equipmentTransfersApplyAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/auditTransfersApply.do") - public String doAuditScrapApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.equipmentTransfersApplyService.doAudit(businessUnitAudit,cu); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示调拨申请业务调整处理 - * */ - @RequestMapping("/showTransfersApplyAdjust.do") - public String showTransfersApplyAdjust(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String transfersApplyId = pInstance.getBusinessKey(); - EquipmentTransfersApply transfersApply = this.equipmentTransfersApplyService.selectById(transfersApplyId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+transfersApplyId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("transfersApply", transfersApply); - return "equipment/equipmentTransfersApplyAdjust"; - } - /** - * 设备调拨申请调整后,再次提交审核 - * */ - @RequestMapping("/submitTransfersApplyAdjust.do") - public String doSubmitTransfersApplyAdjust(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.equipmentTransfersApplyService.updateStatus(businessUnitHandle.getBusinessid(),cu); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取库存设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getStockApplyDetailList.do") - public ModelAndView getStockApplyDetailList(HttpServletRequest request,Model model, - String transfersApplyNumber, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= transfersApplyNumber && !"".equals(transfersApplyNumber)) - sb.append("and transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - - PageHelper.startPage(page, rows); - List stadList=stockTransfersApplyDetailService.selectListByWhere(sb.append(" order by insdt desc").toString()); - if(null!=stadList && !stadList.isEmpty()){ - for(StockTransfersApplyDetail stad:stadList){ - Stock stock=stockService.selectById(stad.getStockId()); - stad.setStock(stock); - } - } - - PageInfo pInfo = new PageInfo(stadList); - JSONArray jsonArray = JSONArray.fromObject(stadList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 新增库存物品明细,选择库存界面 - */ - @RequestMapping("/selectStockDetails.do") - public String doselectStockDetails (HttpServletRequest request,Model model) { - String stockIds = request.getParameter("stockIds"); - if(stockIds!=null && !stockIds.isEmpty()){ - String[] id_Array= stockIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("stockIds", jsonArray); - } - return "/equipment/stock4Selects"; - - } - - /** - * 设备调拨申请单选择库存物品后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveStockTransfersApplyDetails.do") - public String dosaveStockTransfersApplyDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String stockIds = request.getParameter("stockIds"); - String transfersApplyNumber = request.getParameter("transfersApplyNumber"); - BigDecimal totalMoney=new BigDecimal("0"); - String[] idArrary = stockIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - - List stadList = stockTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ='"+transfersApplyNumber+"' and stock_id ='"+str+"'"); - if (stadList == null || stadList.size() == 0) { - Stock stock=stockService.selectById(str); - StockTransfersApplyDetail etad = new StockTransfersApplyDetail(); - etad.setId(CommUtil.getUUID()); - etad.setInsdt(CommUtil.nowDate()); - //etad.setNumber(new BigDecimal("1")); - etad.setInsuser(cu.getId()); - etad.setStockId(stock.getId()); - etad.setTransfersApplyNumber(transfersApplyNumber); - try { - etad.setPrice(stock.getTotalMoney().divide(stock.getNowNumber(),2, RoundingMode.HALF_UP)); - } catch (ArithmeticException e) { - etad.setPrice(new BigDecimal(0)); - } - - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=etad.getTotalMoney(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - result = this.stockTransfersApplyDetailService.save(etad); - if (result != 1) { - flag = false; - } - } - } - } - - - List etadList=equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!etadList.isEmpty() && etadList.size()>0 && null!=etadList){ - for(EquipmentTransfersApplyDetail etad:etadList){ - EquipmentCard ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.add(tempTotalMoney); - } - } - - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - /** - * 删除库存设备明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesStockTransfersApplyDetail.do") - public String dodeletesStockTransfersApplyDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money,String transfersApplyNumber){ - BigDecimal totalMoney=new BigDecimal(money); - boolean flag=false; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - StockTransfersApplyDetail stad=stockTransfersApplyDetailService.selectById(id); - BigDecimal tempTotalMoney=new BigDecimal(0); - tempTotalMoney=stad.getTotalMoney(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.subtract(tempTotalMoney); - stockTransfersApplyDetailService.deleteById(id); - - flag=true; - } - - /* - List etadList=equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!etadList.isEmpty() && etadList.size()>0 && null!=etadList){ - for(EquipmentTransfersApplyDetail etad:etadList){ - EquipmentCard ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - totalMoney=totalMoney.subtract(tempTotalMoney); - } - } - */ - String resultstr = "{\"res\":\""+flag+"\",\"totalMoney\":\""+totalMoney+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - - /** - * 调拨库存明细修改数量后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateStockTransfersApplyDetail.do") - public String doupdateStockTransfersApplyDetail(HttpServletRequest request,Model model) { - String id = request.getParameter("id"); - String number = request.getParameter("number"); - String transfersApplyNumber = request.getParameter("transfersApplyNumber"); - String message=""; - int result=0; - try { - StockTransfersApplyDetail stad = stockTransfersApplyDetailService.selectById(id); - if (stad.getStockId() != null && !stad.getStockId().isEmpty()) { - Stock stock = stockService.selectById(stad.getStockId()); - //可用数量 - BigDecimal usableNumber = stock.getNowNumber(); - if (null != number && !number.isEmpty()) { - BigDecimal numberBigDecimal = new BigDecimal(number); - if (usableNumber.compareTo(numberBigDecimal) == -1) {//可用数量小于使用数量 - message= "库存数量不足,仅有"+usableNumber.setScale(2, BigDecimal.ROUND_HALF_UP).toString()+stock.getGoods().getUnit()+"可用,请重新输入"; - String resstr = "{\"res\":\""+result+"\",\"message\":\""+message+"\"}"; - model.addAttribute("result", resstr); - return "result"; - }else{ - stad.setNumber(numberBigDecimal); - } - } - - } - - BigDecimal totalMoney = stad.getTotalMoney(); - totalMoney=stad.getPrice().multiply(stad.getNumber()); - stad.setTotalMoney(totalMoney); - result = stockTransfersApplyDetailService.update(stad); - - BigDecimal sumTotalMoney=new BigDecimal("0"); - List etadList=equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!etadList.isEmpty() && etadList.size()>0 && null!=etadList){ - for(EquipmentTransfersApplyDetail etad:etadList){ - EquipmentCard ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - sumTotalMoney=sumTotalMoney.add(tempTotalMoney); - } - } - - List stadList=stockTransfersApplyDetailService.selectListByWhere("where transfers_apply_number ="+"'"+transfersApplyNumber+"'"); - if(!stadList.isEmpty() && stadList.size()>0 && null!=stadList){ - for(StockTransfersApplyDetail stadVar:stadList){ - BigDecimal tempTotalMoney=new BigDecimal("0"); - tempTotalMoney=stadVar.getTotalMoney();//ec.getResidualvalue(); - if(null!=tempTotalMoney && !"".equals(tempTotalMoney)) - sumTotalMoney=sumTotalMoney.add(tempTotalMoney); - } - } - String resstr = "{\"res\":\""+result+"\",\"message\":\""+message+"\",\"totalMoney\":\""+sumTotalMoney+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentTypeNumberController.java b/src/com/sipai/controller/equipment/EquipmentTypeNumberController.java deleted file mode 100644 index cabd8235..00000000 --- a/src/com/sipai/controller/equipment/EquipmentTypeNumberController.java +++ /dev/null @@ -1,286 +0,0 @@ -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentTypeNumber") -public class EquipmentTypeNumberController { - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/equipment/equipmentTypeNumberList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String pid = request.getParameter("classId");//设备类别id - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by name"; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(pid!=null && !pid.equals("")){ - wherestr += " and pid = '"+pid+"'"; - } - PageHelper.startPage(page, rows); - List list = this.equipmentTypeNumberService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentTypeNumberAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentTypeNumberService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentTypeNumberService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentTypeNumber") EquipmentTypeNumber equipmentTypeNumber){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentTypeNumber.setId(CommUtil.getUUID()); - equipmentTypeNumber.setInsuser(cu.getId()); - equipmentTypeNumber.setInsdt(CommUtil.nowDate()); - int result = this.equipmentTypeNumberService.save(equipmentTypeNumber); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentTypeNumber.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(id); - model.addAttribute("equipmentTypeNumber", equipmentTypeNumber); - return "equipment/equipmentTypeNumberView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(id); - model.addAttribute("equipmentTypeNumber", equipmentTypeNumber); - return "equipment/equipmentTypeNumberEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentTypeNumber") EquipmentTypeNumber equipmentTypeNumber){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentTypeNumber.setInsuser(cu.getId()); - equipmentTypeNumber.setInsdt(CommUtil.nowDate()); - int result = this.equipmentTypeNumberService.update(equipmentTypeNumber); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentTypeNumber.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 选择设备型号(select2下拉选择) - */ - @RequestMapping("/getEquipmentTypeNumberForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request,Model model){ - - String wherestr="where active= '"+CommString.Active_True+"'"; - if(request.getParameter("equipmentclassid")!=null && !request.getParameter("equipmentclassid").isEmpty()){ - wherestr += " and pid like '%"+request.getParameter("equipmentclassid")+"%' "; - } - List list = this.equipmentTypeNumberService.selectListByWhere(wherestr); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (EquipmentTypeNumber equipmentTypeNumber : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", equipmentTypeNumber.getId()); - jsonObject.put("text", equipmentTypeNumber.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - //2020-07-08 start - @RequestMapping("/selectEquipmentModel.do") - public String selectEquipmentModel(HttpServletRequest request,Model model) { - /* String equipmentId = request.getParameter("equipmentId"); - String companyId = request.getParameter("companyId"); - model.addAttribute("equipmentId", equipmentId); - model.addAttribute("companyId", companyId); - return "/equipment/equipmentCardListForSelect";*/ - String equipmentmodel = request.getParameter("equipmentmodel"); - model.addAttribute("equipmentmodel", equipmentmodel); - - String equipmentclassId = request.getParameter("equipmentclassid"); - model.addAttribute("equipmentclassId",equipmentclassId); - //return "/equipment/equipmentBelongListForSelect"; - return "/equipment/selectEquipmentModel"; - } - - /** - * 设备型号关联设备类型 配置界面 树形 sj 2020-09-01 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request,Model model){ - return "/equipment/equipmentTypeNumber4Tree"; - } - /** - * 根据设备类别获取下面配置的型号 - * @param request - * @param model - * @return - */ - @RequestMapping("/getdata4EquClass.do") - public String getdata4EquClass(HttpServletRequest request,Model model){ - String id = request.getParameter("id");//设备类别Id - String pid = request.getParameter("pid");//设备类别上一级id - String type = request.getParameter("type");//设备类别类型 如是部位则没有对应型号 需要查上一级 - - String whereStr = "where active= '"+CommString.Active_True+"' "; - if(type!=null && type.equals(CommString.EquipmentClass_Parts)){ - whereStr +=" and pid = '"+ pid +"'"; - }else { - whereStr +=" and pid = '"+ id +"'"; - } - - List list = this.equipmentTypeNumberService.selectListByWhere(whereStr + "order by morder"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (EquipmentTypeNumber equipmentTypeNumber : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", equipmentTypeNumber.getId()); - jsonObject.put("text", equipmentTypeNumber.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - /** - * 导出 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.equipmentTypeNumberService.doExport(response,unitId); - return null; - } - /** - * 导入页面 - * @param request - * @param model - * @return - */ - @RequestMapping("/doImport.do") - public String doimport(HttpServletRequest request,Model model){ - return "equipment/equipmentTypeNumberImport"; - } - /** - * 保存导入数据 - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? equipmentTypeNumberService.readXls(excelFile.getInputStream(),cu.getId(),unitId) : this.equipmentTypeNumberService.readXlsx(excelFile.getInputStream(),cu.getId(),unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/equipment/EquipmentUseAgeController.java b/src/com/sipai/controller/equipment/EquipmentUseAgeController.java deleted file mode 100644 index 48feae25..00000000 --- a/src/com/sipai/controller/equipment/EquipmentUseAgeController.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentUseAge; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentSpecificationService; -import com.sipai.service.equipment.EquipmentUseAgeService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/equipmentUseAge") -public class EquipmentUseAgeController { - @Resource - private EquipmentUseAgeService equipmentUseAgeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/equipment/equipmentUseAgeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentUseAgeService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/equipmentUseAgeAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentUseAgeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentUseAgeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentUseAge") EquipmentUseAge equipmentUseAge){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentUseAge.setId(CommUtil.getUUID()); - equipmentUseAge.setInsuser(cu.getId()); - equipmentUseAge.setInsdt(CommUtil.nowDate()); - int result = this.equipmentUseAgeService.save(equipmentUseAge); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentUseAge.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentUseAge equipmentUseAge = this.equipmentUseAgeService.selectById(id); - model.addAttribute("equipmentUseAge", equipmentUseAge); - return "equipment/equipmentUseAgeView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentUseAge equipmentUseAge = this.equipmentUseAgeService.selectById(id); - model.addAttribute("equipmentUseAge", equipmentUseAge); - return "equipment/equipmentUseAgeEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentUseAge") EquipmentUseAge equipmentUseAge){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentUseAge.setInsuser(cu.getId()); - equipmentUseAge.setInsdt(CommUtil.nowDate()); - int result = this.equipmentUseAgeService.update(equipmentUseAge); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentUseAge.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 选择已用年限(select2下拉选择) - */ - @RequestMapping("/getEquipmentUseAgeForSelect.do") - public String getEquipmentClassForSelect(HttpServletRequest request,Model model){ - List list = this.equipmentUseAgeService.selectListByWhere("where 1=1"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (EquipmentUseAge equipmentUseAge : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", equipmentUseAge.getId()); - jsonObject.put("text", equipmentUseAge.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/FacilitiesCardController.java b/src/com/sipai/controller/equipment/FacilitiesCardController.java deleted file mode 100644 index 612ecc0f..00000000 --- a/src/com/sipai/controller/equipment/FacilitiesCardController.java +++ /dev/null @@ -1,411 +0,0 @@ -package com.sipai.controller.equipment; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.FacilitiesCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.FacilitiesCardService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/facilitiesCard") -public class FacilitiesCardController { - @Resource - private FacilitiesCardService facilitiesCardService; - @Resource - private UnitService unitService; - @Resource - private AssetClassService assetClassService; - @Resource - private CompanyService companyService; - - /** - * 设施页面 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeFacilities.do") - public String showList4Tree(HttpServletRequest request,Model model) { - return "/equipment/facilitiesCard4TreeFacilities"; - } - /** - * 管道页面 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreePipeline.do") - public String showList4TreePipeline(HttpServletRequest request,Model model) { - return "/equipment/facilitiesCard4TreePipeline"; - } - - /** - * 获取左侧树形数据 设施、管道通用 - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - List listinsql = this.unitService.getParentCompanyChildrenBiz(cu); - String json = unitService.getTreeList(null, listinsql); - Result result = Result.success(json); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取table数据 设施、管道通用 - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String unitId = request.getParameter("unitId"); - String search_name = request.getParameter("search_name"); - String type = request.getParameter("type");//区分设施和管道 - - String wherestr = "where 1=1 "; - - if(unitId!=null && !unitId.isEmpty()){ - //获取unitId下所有子节点 - List units = this.unitService.getUnitChildrenById(unitId); - String unitIds=""; - for(Unit unit : units){ - unitIds += "'"+unit.getId()+"',"; - } - if(unitIds!=""){ - unitIds = unitIds.substring(0, unitIds.length()-1); - wherestr += " and unitId in ("+unitIds+") "; - } - } - if(search_name!=null && !search_name.equals("")){ - wherestr += "and (code like '%"+search_name+"%' or name like '%"+search_name+"%') "; - } - if(type!=null && !type.equals("")){ - wherestr += "and type = '"+type+"' "; - } - PageHelper.startPage(page, rows); - List list = this.facilitiesCardService.selectListByWhere(wherestr + "order by code asc"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 设施列表 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Facilities.do") - public String showList4Facilities(HttpServletRequest request,Model model) { - return "/equipment/facilitiesCardList4Facilities"; - } - - /** - * 管道列表 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Pipeline.do") - public String showList4Pipeline(HttpServletRequest request,Model model) { - return "/equipment/facilitiesCardList4Pipeline"; - } - - /** - * 新增界面--设施 - * @param request - * @param model - * @param unitId - * @return - */ - @RequestMapping("/doadd4Facilities.do") - public String doadd4Facilities(HttpServletRequest request,Model model, - @RequestParam(value="unitId") String unitId){ - model.addAttribute("id",CommUtil.getUUID()); - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null){ - model.addAttribute("companyName",company.getSname()); - } - return "equipment/facilitiesCardAdd4Facilities"; - } - - /** - * 新增界面--管道 - * @param request - * @param model - * @param unitId - * @return - */ - @RequestMapping("/doadd4Pipeline.do") - public String doadd4Pipeline(HttpServletRequest request,Model model, - @RequestParam(value="unitId") String unitId){ - model.addAttribute("id",CommUtil.getUUID()); - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null){ - model.addAttribute("companyName",company.getSname()); - } - return "equipment/facilitiesCardAdd4Pipeline"; - } - - /** - * 修改界面--设施 - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/doedit4Facilities.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - FacilitiesCard facilitiesCard= facilitiesCardService.selectById(id); - if(facilitiesCard!=null){ - model.addAttribute("facilitiesCard",facilitiesCard); - //资产类别 - AssetClass assetClass = assetClassService.selectById(facilitiesCard.getAssetClassId()); - if(assetClass!=null){ - model.addAttribute("assetClassName",assetClass.getAssetclassname()); - } - Company company = companyService.selectByPrimaryKey(facilitiesCard.getUnitId()); - if(company!=null){ - model.addAttribute("companyName",company.getSname()); - } - } - return "equipment/facilitiesCardEdit4Facilities"; - } - - /** - * 修改界面--管道 - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/doedit4Pipeline.do") - public String doedit4Pipeline(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - FacilitiesCard facilitiesCard= facilitiesCardService.selectById(id); - if(facilitiesCard!=null){ - model.addAttribute("facilitiesCard",facilitiesCard); - //资产类别 - AssetClass assetClass = assetClassService.selectById(facilitiesCard.getAssetClassId()); - if(assetClass!=null){ - model.addAttribute("assetClassName",assetClass.getAssetclassname()); - } - Company company = companyService.selectByPrimaryKey(facilitiesCard.getUnitId()); - if(company!=null){ - model.addAttribute("companyName",company.getSname()); - } - } - return "equipment/facilitiesCardEdit4Pipeline"; - } - - /** - * 设备类别保存 sj 2020-07-09 - * @param request - * @param model - * @param facilitiesCard - * @return - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("facilitiesCard") FacilitiesCard facilitiesCard){ - User cu= (User)request.getSession().getAttribute("cu"); - facilitiesCard.setInsuser(cu.getId()); - facilitiesCard.setInsdt(CommUtil.nowDate()); - int res = this.facilitiesCardService.save(facilitiesCard); - - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("facilitiesCard") FacilitiesCard facilitiesCard){ - User cu= (User)request.getSession().getAttribute("cu"); - facilitiesCard.setInsuser(cu.getId()); - facilitiesCard.setInsdt(CommUtil.nowDate()); - int res = this.facilitiesCardService.update(facilitiesCard); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.facilitiesCardService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.facilitiesCardService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 导出设施台帐 - */ - @RequestMapping(value = "doExport4Facilities.do") - public ModelAndView doExport4Facilities(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.facilitiesCardService.doExport4Facilities(response,unitId); - return null; - } - - /** - * 导出管道台帐 - */ - @RequestMapping(value = "doExport4Pipeline.do") - public ModelAndView doExport4Pipeline(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.facilitiesCardService.doExport4Pipeline(response,unitId); - return null; - } - - @RequestMapping("/doImport4Facilities.do") - public String doImport4Facilities(HttpServletRequest request,Model model){ - return "equipment/facilitiesCardImport4Facilities"; - } - - @RequestMapping("/doImport4Pipeline.do") - public String doImport4Pipeline(HttpServletRequest request,Model model){ - return "equipment/facilitiesCardImport4Pipeline"; - } - - @RequestMapping("/saveExcelData4Facilities.do") - public ModelAndView dosaveExcelData4Facilities(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? facilitiesCardService.readXls4Facilities(excelFile.getInputStream(),cu.getId(),unitId) : this.facilitiesCardService.readXlsx4Facilities(excelFile.getInputStream(),cu.getId(),unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/saveExcelData4Pipeline.do") - public ModelAndView dosaveExcelData4Pipeline(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? facilitiesCardService.readXls4Pipeline(excelFile.getInputStream(),cu.getId(),unitId) : this.facilitiesCardService.readXlsx4Pipeline(excelFile.getInputStream(),cu.getId(),unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - //单选设施 - @RequestMapping("/getOneFacilitySelect.do") - public String getOneFacilitySelect(HttpServletRequest request, Model model) { - return "equipment/facilityForOneEquSelect"; - } - -} diff --git a/src/com/sipai/controller/equipment/FacilitiesClassController.java b/src/com/sipai/controller/equipment/FacilitiesClassController.java deleted file mode 100644 index 306a6780..00000000 --- a/src/com/sipai/controller/equipment/FacilitiesClassController.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.equipment.FacilitiesClass; -import com.sipai.entity.equipment.FacilitiesClass; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.FacilitiesClassService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/facilitiesClass") -public class FacilitiesClassController { - @Resource - private FacilitiesClassService facilitiesClassService; - - /** - * 设备分类配置界面 sj 2020-07-08 - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request,Model model) { - return "/equipment/facilitiesClass4Tree"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request,Model model){ - String wherestr ="where 1=1 order by morder"; - List list = this.facilitiesClassService.selectListByWhere(wherestr); - String json = facilitiesClassService.getTreeListtest(null, list); - Result result = Result.success(json); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 新增界面-----sj 2020-07-09 - * @param request - * @param model - * @param pid - * @return - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - FacilitiesClass entity= facilitiesClassService.selectById(pid); - model.addAttribute("pname",entity.getName()); - } - model.addAttribute("id",CommUtil.getUUID()); - return "equipment/facilitiesClassAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - FacilitiesClass facilitiesClass= facilitiesClassService.selectById(id); - if(facilitiesClass!=null){ - FacilitiesClass facilitiesClass2= facilitiesClassService.selectById(facilitiesClass.getPid()); - if(facilitiesClass2!=null){ - facilitiesClass.set_pname(facilitiesClass2.getName()); - }else { - facilitiesClass.set_pname("无"); - } - model.addAttribute("facilitiesClass",facilitiesClass); - } - return "equipment/facilitiesClassEdit"; - } - - /** - * 设备类别保存 sj 2020-07-09 - * @param request - * @param model - * @param facilitiesClass - * @return - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("facilitiesClass") FacilitiesClass facilitiesClass){ - User cu= (User)request.getSession().getAttribute("cu"); - //facilitiesClass.setId(CommUtil.getUUID()); - facilitiesClass.setInsuser(cu.getId()); - facilitiesClass.setInsdt(CommUtil.nowDate()); - int res = this.facilitiesClassService.save(facilitiesClass); - - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("facilitiesClass") FacilitiesClass facilitiesClass){ - User cu= (User)request.getSession().getAttribute("cu"); - facilitiesClass.setInsuser(cu.getId()); - facilitiesClass.setInsdt(CommUtil.nowDate()); - int res = this.facilitiesClassService.update(facilitiesClass); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.facilitiesClassService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /* - * 下拉筛选 - */ - @RequestMapping("/getJson4Select.do") - public String getJson4Select(HttpServletRequest request,Model model){ - String wherestr ="where 1=1 and pid!='-1' order by code"; - List list = this.facilitiesClassService.selectListByWhere(wherestr); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.facilitiesClassService.selectListByWhere(wherestr); -// String json = facilitiesClassService.getTreeListtest(null, list); - model.addAttribute("result",json); - return "result"; - } - -} diff --git a/src/com/sipai/controller/equipment/FinanceController.java b/src/com/sipai/controller/equipment/FinanceController.java deleted file mode 100644 index ba98d0a9..00000000 --- a/src/com/sipai/controller/equipment/FinanceController.java +++ /dev/null @@ -1,2284 +0,0 @@ -package com.sipai.controller.equipment; -import java.io.IOException; -import java.lang.reflect.Field; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - - - - - -import org.activiti.engine.impl.transformer.IntegerToString; -import org.activiti.engine.impl.transformer.StringToInteger; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -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.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.DateUtil; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSON; -//import com.alibaba.fastjson.JSONArray; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentCode; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.finance.FinanceEquipmentDeptInfo; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.Sewage; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.OverviewProduceBlot; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentBelongService; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentLevelService; -import com.sipai.service.equipment.EquipmentSpecificationService; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.service.equipment.HomePageService; -import com.sipai.service.finance.FinanceEquipmentDeptInfoService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sun.org.apache.bcel.internal.generic.NEW; - -import static org.apache.poi.ss.usermodel.CellType.*; - - -@Controller -@RequestMapping("/finance/placeClass") -public class FinanceController { - - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private CompanyService companyService; - @Resource - private FinanceEquipmentDeptInfoService financeEquipmentDeptInfoService; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - - @Resource - private EquipmentLevelService equipmentLevelService; - - @Resource - private EquipmentBelongService equipmentBelongService; - @Resource - private EquipmentCardPropService propService; - @Resource - private UnitService unitService; - @Resource - private AssetClassService assetClassService; - @Resource - private UserService userService; - @Resource - private HomePageService homePageService; - @RequestMapping("/showEquipmentCompanyCard.do") - public String showlistcompany(HttpServletRequest request,Model model) { - //return "/equipment/equipmentCardList"; - //return "/equipment/equipmentCardNewList"; - List eb=equipmentBelongService.selectListByWhere(" where belong_name='公司'"); - if(eb.size() >0 && null!=eb){ - String equipmentBelongId = eb.get(0).getId(); - model.addAttribute("equipmentBelongId",equipmentBelongId); - } - return "/equipment/placeClassEequipmentCompanyCardList"; - } - @RequestMapping("/EequipmentRunTimeCardList.do") - public String EequipmentRunTimeCardList(HttpServletRequest request,Model model) { - //return "/equipment/equipmentCardList"; - //return "/equipment/equipmentCardNewList"; - return "/equipment/EequipmentRunTimeCardList"; - } - @RequestMapping("/EequipmentRunLifeCardList.do") - public String EequipmentRunLifeCardList(HttpServletRequest request,Model model) { - return "/equipment/EequipmentRunLifeCardList"; - } - @RequestMapping("/showEequipmentRemindCard.do") - public String showEequipmentRemindCard(HttpServletRequest request,Model model) { - //return "/equipment/equipmentCardList"; - //return "/equipment/equipmentCardNewList"; - return "/equipment/EequipmentRemindCardList"; - } - @RequestMapping("/showEquipmentCard.do") - public String showlist(HttpServletRequest request,Model model) { - //return "/equipment/equipmentCardList"; - //return "/equipment/equipmentCardNewList"; - List eb=equipmentBelongService.selectListByWhere(" where belong_name='处'"); - if(eb.size() >0 && null!=eb){ - String equipmentBelongId = eb.get(0).getId(); - model.addAttribute("equipmentBelongId",equipmentBelongId); - } - return "/equipment/placeClassEequipmentCardList"; - } - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - /*if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processsectionid = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - } - if(request.getParameter("equipmentLevel")!=null && !request.getParameter("equipmentLevel").isEmpty()){ - wherestr += " and equipmentLevelId = '"+request.getParameter("equipmentLevel")+"' "; - } - if(request.getParameter("equipmentClass")!=null && !request.getParameter("equipmentClass").isEmpty()){ - wherestr += " and equipmentClassId = '"+request.getParameter("equipmentClass")+"' "; - } - - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - - if(request.getParameter("equipmentCardType")!=null && !request.getParameter("equipmentCardType").isEmpty()){ - wherestr += " and equipment_card_type = '"+request.getParameter("equipmentCardType")+"' "; - } - - - //2020-07-13 end - - if(request.getParameter("equipmentName")!=null && !request.getParameter("equipmentName").isEmpty()){ - wherestr += " and (equipmentName like '%"+request.getParameter("equipmentName")+"%'" - + " or id like '%"+request.getParameter("equipmentName")+"%'" - + " or equipmentCardID like '%"+request.getParameter("equipmentName")+"%')"; - } - if(request.getParameter("equipmentCardClass")!=null && !request.getParameter("equipmentCardClass").isEmpty()){ - wherestr += " and equipmentClassID = '"+request.getParameter("equipmentCardClass")+"' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("search_dept")!=null && !request.getParameter("search_dept").isEmpty()){ - wherestr += " and responsibleDepartment like '%"+request.getParameter("search_dept")+"%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification=request.getParameter("specification"); - //设备型号 - String equipmentmodel=request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel=request.getParameter("equipmentlevel"); - - if(!"".equals(specification) && null!=specification){ - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr=new StringBuilder("and specification in ("); - List esList=equipmentSpecificationService.selectListByWhere("where name like '%"+specification+"%'"); - - for(EquipmentSpecification es:esList){ - esIdAllStr.append("'"+es.getId()+"'"+','); - } - - String esIdStr=esIdAllStr.substring(0, esIdAllStr.length()-1); - esIdInAllStr.append(esIdStr+")"); - wherestr += esIdInAllStr.toString(); - } - - if(!"".equals(equipmentmodel) && null!=equipmentmodel){ - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr=new StringBuilder("and equipmentmodel in ("); - List emList=equipmentTypeNumberService.selectListByWhere("where name like '%"+equipmentmodel+"%'"); - for(EquipmentTypeNumber em:emList){ - emIdAllStr.append("'"+em.getId()+"'"+','); - } - String emIdStr=emIdAllStr.substring(0, emIdAllStr.length()-1); - emIdInAllStr.append(emIdStr+")"); - wherestr += emIdInAllStr.toString(); - } - - if(!"".equals(equipmentlevel) && null!=equipmentlevel){ - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr=new StringBuilder("and equipmentLevelId in ("); - List elList=equipmentLevelService.selectListByWhere("where levelName like '%"+equipmentlevel+"%'"); - for(EquipmentLevel el:elList){ - elIdAllStr.append("'"+el.getId()+"'"+','); - } - String elIdStr=elIdAllStr.substring(0, elIdAllStr.length()-1); - elIdInAllStr.append(elIdStr+")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId=request.getParameter("equipmentBigClassId"); - String ratedPower=request.getParameter("ratedPower"); - String likeSea=request.getParameter("likeSea"); - if(!"".equals(equipmentBigClassId) && null!=equipmentBigClassId){ - wherestr+=" and equipment_big_class_id='"+equipmentBigClassId+"'"; - } - if(!"".equals(ratedPower) && null!=ratedPower){ - wherestr+=" and ratedPower='"+ratedPower+"'"; - } - if(!"".equals(likeSea) && null!=likeSea){ - wherestr += " and equipmentName like '%"+likeSea+"%'"; - }*/ - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processsectionid = '"+request.getParameter("pSectionId")+"' "; - } - - if(request.getParameter("equipmentLevel")!=null && !request.getParameter("equipmentLevel").isEmpty()){ - wherestr += " and equipmentLevelId = '"+request.getParameter("equipmentLevel")+"' "; - } - if(request.getParameter("typeStatus")!=null && !request.getParameter("typeStatus").isEmpty()){ - String typeStatus = request.getParameter("typeStatus"); - if("1".equals(typeStatus)){ - wherestr += " and assetNumber is NOT NULL "; - } - if("2".equals(typeStatus)){ - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - if(!"".equals(processSectionId) &&processSectionId!=null){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null){ - wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%' or assetNumber like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } - if(!"".equals(assetClass) &&assetClass!=null){ - wherestr += " and assetClassId = '"+assetClass+"' "; - } - - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - - if(request.getParameter("equipmentCardType")!=null && !request.getParameter("equipmentCardType").isEmpty()){ - wherestr += " and equipment_card_type = '"+request.getParameter("equipmentCardType")+"' "; - } - - - //2020-07-13 end -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ -// wherestr += " and equipmentName like '%"+request.getParameter("search_name")+"%'"; -// }else { -// List processSections = this.processSectionService.selectListByWhere("where name like '%"+request.getParameter("search_name")+"%'"); -// String processIds = ""; -// if (processSections!=null&&processSections.size()>0) { -// for (int i = 0; i < processSections.size(); i++) { -// processIds+="'"+processSections.get(i).getId()+"'"; -// if (i!=(processSections.size()-1)) { -// processIds+=","; -// } -// } -// }else { -// processIds="''"; -// } -// wherestr += " and (equipmentName like '%"+request.getParameter("search_name")+"%'" -// + " or processSectionId in ("+processIds+"))"; -// } -// } -// -// if(request.getParameter("equipmentName")!=null && !request.getParameter("equipmentName").isEmpty()){ -// wherestr += " and (equipmentName like '%"+request.getParameter("equipmentName")+"%'" -// + " or id like '%"+request.getParameter("equipmentName")+"%'" -// + " or equipmentCardID like '%"+request.getParameter("equipmentName")+"%')"; -// } -// if(request.getParameter("equipmentCardClass")!=null && !request.getParameter("equipmentCardClass").isEmpty()){ -// wherestr += " and equipmentClassID = '"+request.getParameter("equipmentCardClass")+"' "; -// } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("search_dept")!=null && !request.getParameter("search_dept").isEmpty()){ - wherestr += " and responsibleDepartment like '%"+request.getParameter("search_dept")+"%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification=request.getParameter("specification"); - //设备型号 - String equipmentmodel=request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel=request.getParameter("equipmentlevel"); - - if(!"".equals(specification) && null!=specification){ - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr=new StringBuilder("and specification in ("); - List esList=equipmentSpecificationService.selectListByWhere("where name like '%"+specification+"%'"); - - for(EquipmentSpecification es:esList){ - esIdAllStr.append("'"+es.getId()+"'"+','); - } - - String esIdStr=esIdAllStr.substring(0, esIdAllStr.length()-1); - esIdInAllStr.append(esIdStr+")"); - wherestr += esIdInAllStr.toString(); - } - - if(!"".equals(equipmentmodel) && null!=equipmentmodel){ - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr=new StringBuilder("and equipmentmodel in ("); - List emList=equipmentTypeNumberService.selectListByWhere("where name like '%"+equipmentmodel+"%'"); - for(EquipmentTypeNumber em:emList){ - emIdAllStr.append("'"+em.getId()+"'"+','); - } - String emIdStr=emIdAllStr.substring(0, emIdAllStr.length()-1); - emIdInAllStr.append(emIdStr+")"); - wherestr += emIdInAllStr.toString(); - } - - if(!"".equals(equipmentlevel) && null!=equipmentlevel){ - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr=new StringBuilder("and equipmentLevelId in ("); - List elList=equipmentLevelService.selectListByWhere("where levelName like '%"+equipmentlevel+"%'"); - for(EquipmentLevel el:elList){ - elIdAllStr.append("'"+el.getId()+"'"+','); - } - String elIdStr=elIdAllStr.substring(0, elIdAllStr.length()-1); - elIdInAllStr.append(elIdStr+")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId=request.getParameter("equipmentBigClassId"); - String ratedPower=request.getParameter("ratedPower"); - String likeSea=request.getParameter("likeSea"); - if(!"".equals(equipmentBigClassId) && null!=equipmentBigClassId){ - wherestr+=" and equipment_big_class_id='"+equipmentBigClassId+"'"; - } - if(!"".equals(ratedPower) && null!=ratedPower){ - wherestr+=" and ratedPower='"+ratedPower+"'"; - } - if(!"".equals(likeSea) && null!=likeSea){ - wherestr += " and equipmentName like '%"+likeSea+"%'"; - } - - //System.out.println(wherestr); - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getRemindList.do") - public ModelAndView getRemindList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processsectionid = '"+request.getParameter("pSectionId")+"' "; - } - - if(request.getParameter("equipmentLevel")!=null && !request.getParameter("equipmentLevel").isEmpty()){ - wherestr += " and equipmentLevelId = '"+request.getParameter("equipmentLevel")+"' "; - } - if(request.getParameter("typeStatus")!=null && !request.getParameter("typeStatus").isEmpty()){ - String typeStatus = request.getParameter("typeStatus"); - if("1".equals(typeStatus)){ - wherestr += " and assetNumber is NOT NULL "; - } - if("2".equals(typeStatus)){ - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - if(!"".equals(processSectionId) &&processSectionId!=null){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null){ - wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%' or assetNumber like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } - if(!"".equals(assetClass) &&assetClass!=null){ - wherestr += " and assetClassId = '"+assetClass+"' "; - } - - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - - if(request.getParameter("equipmentCardType")!=null && !request.getParameter("equipmentCardType").isEmpty()){ - wherestr += " and equipment_card_type = '"+request.getParameter("equipmentCardType")+"' "; - } - - - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("search_dept")!=null && !request.getParameter("search_dept").isEmpty()){ - wherestr += " and responsibleDepartment like '%"+request.getParameter("search_dept")+"%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification=request.getParameter("specification"); - //设备型号 - String equipmentmodel=request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel=request.getParameter("equipmentlevel"); - - if(!"".equals(specification) && null!=specification){ - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr=new StringBuilder("and specification in ("); - List esList=equipmentSpecificationService.selectListByWhere("where name like '%"+specification+"%'"); - - for(EquipmentSpecification es:esList){ - esIdAllStr.append("'"+es.getId()+"'"+','); - } - - String esIdStr=esIdAllStr.substring(0, esIdAllStr.length()-1); - esIdInAllStr.append(esIdStr+")"); - wherestr += esIdInAllStr.toString(); - } - - if(!"".equals(equipmentmodel) && null!=equipmentmodel){ - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr=new StringBuilder("and equipmentmodel in ("); - List emList=equipmentTypeNumberService.selectListByWhere("where name like '%"+equipmentmodel+"%'"); - for(EquipmentTypeNumber em:emList){ - emIdAllStr.append("'"+em.getId()+"'"+','); - } - String emIdStr=emIdAllStr.substring(0, emIdAllStr.length()-1); - emIdInAllStr.append(emIdStr+")"); - wherestr += emIdInAllStr.toString(); - } - - if(!"".equals(equipmentlevel) && null!=equipmentlevel){ - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr=new StringBuilder("and equipmentLevelId in ("); - List elList=equipmentLevelService.selectListByWhere("where levelName like '%"+equipmentlevel+"%'"); - for(EquipmentLevel el:elList){ - elIdAllStr.append("'"+el.getId()+"'"+','); - } - String elIdStr=elIdAllStr.substring(0, elIdAllStr.length()-1); - elIdInAllStr.append(elIdStr+")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId=request.getParameter("equipmentBigClassId"); - String ratedPower=request.getParameter("ratedPower"); - String likeSea=request.getParameter("likeSea"); - if(!"".equals(equipmentBigClassId) && null!=equipmentBigClassId){ - wherestr+=" and equipment_big_class_id='"+equipmentBigClassId+"'"; - } - if(!"".equals(ratedPower) && null!=ratedPower){ - wherestr+=" and ratedPower='"+ratedPower+"'"; - } - if(!"".equals(likeSea) && null!=likeSea){ - wherestr += " and equipmentName like '%"+likeSea+"%'"; - } - - wherestr += " and equipment_set_time is NOT NULL "; - - - //System.out.println(wherestr); - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectRemindListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getEquNub.do") - public ModelAndView getEquNub(HttpServletRequest request,Model model){ - String wherestr = "where 1=1"; - String equipmentIds = request.getParameter("equipmentIds"); - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - if(!"".equals(processSectionId) &&processSectionId!=null){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(request.getParameter("typeStatus")!=null && !request.getParameter("typeStatus").isEmpty()){ - String typeStatus = request.getParameter("typeStatus"); - if("1".equals(typeStatus)){ - wherestr += " and assetNumber is NOT NULL "; - } - if("2".equals(typeStatus)){ - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null && !"-999".equals(equipmentCardClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids=""; - for(EquipmentClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and equipmentClassID in ("+companyids+") "; - }else{ - wherestr +=" and equipmentClassID='"+equipmentCardClass+"'"; - } - - -// wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%' or assetNumber like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } - if(!"".equals(assetClass) &&assetClass!=null && !"-999".equals(assetClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids=""; - for(AssetClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and asset_type in ("+companyids+") "; - }else{ - wherestr +=" and asset_type='"+assetClass+"'"; - } - } - if(null!= equipmentIds && !"".equals(equipmentIds)){ - equipmentIds = equipmentIds.replace(",","','"); - wherestr +=" and id in ('"+equipmentIds+"')"; - } - if(request.getParameter("search_name2")!=null && !request.getParameter("search_name2").isEmpty()){ - - wherestr += " and year(GETDATE())-YEAR(open_date)+1 >= '"+request.getParameter("search_name2")+"' "; - } - if(request.getParameter("search_name3")!=null && !request.getParameter("search_name3").isEmpty()){ - wherestr += " and year(GETDATE())-YEAR(open_date)+1 <= '"+request.getParameter("search_name3")+"' "; - } - String equipmentBelongId= request.getParameter("equipmentBelongId"); - if(equipmentBelongId!=null && !"".equals(equipmentBelongId)){ - wherestr += " and equipment_belong_id = '"+equipmentBelongId+"' "; - } - OverviewProduceBlot homePage = new OverviewProduceBlot(); - String bizId = request.getParameter("biz_id"); - List companies = this.unitService.getCompaniesByWhere(" where pid ='"+bizId+"' or id ='"+bizId+"' order by id "); - ArrayList wscll= new ArrayList<>(); - StringBuilder abizIdString = new StringBuilder(); - for (Company company : companies) { - ArrayList list= new ArrayList<>(); - list.add(company.getSname()); - String equipmentTotal = this.homePageService.selectEquipmentTotal(wherestr + " and bizId = '"+ company.getId()+"' ").getAssetnumber(); - list.add(equipmentTotal); - wscll.add(list); - abizIdString .append("'"+company.getId()+"'"+','); - } - - homePage.setData(wscll); - - ArrayList wscll2= new ArrayList<>(); - List equipmentCards = this.homePageService.selectEquipmentRunTimeTotal(wherestr+" and bizId in ("+abizIdString.substring(0, abizIdString.length()-1)+") and open_date IS NOT NULL group by YEAR(open_date) order by open_date"); - for (EquipmentCard equipmentCard : equipmentCards) { - ArrayList list= new ArrayList<>(); - list.add(equipmentCard.getOpenDate()+"年"); - list.add(equipmentCard.getAssetnumber()); - wscll2.add(list); - } - homePage.setData1(wscll2); - JSONObject fromObject = JSONObject.fromObject(homePage); - String resstr="{\"res\":\""+fromObject+"\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); -} - - @RequestMapping("/upReminddate.do") - public String doRemindupdate(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "cleartime") String cleartime) { - double d; - d=Double.parseDouble(cleartime); - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setId(id); - equipmentCard.setEquipmentClearTime(d); - int result = this.equipmentCardService.update(equipmentCard); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCard.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 导出设备excel表 - * @throws IOException - */ - @RequestMapping(value = "downloadPlaceEquipmentExcel.do") - public ModelAndView downloadPlaceEquipmentExcel(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String wherestr = "where 1=1"; - String equipmentIds = request.getParameter("equipmentIds"); - if(null!= equipmentIds && !"".equals(equipmentIds)){ - equipmentIds = equipmentIds.replace(",","','"); - wherestr +=" and id in ('"+equipmentIds+"')"; - } - String equipmentBelongId= request.getParameter("equipmentBelongId"); - if(equipmentBelongId!=null && !"".equals(equipmentBelongId)){ - wherestr += " and equipment_belong_id = '"+equipmentBelongId+"' "; - } - List equipmentCards = this.equipmentCardService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.equipmentCardService.downloadPlaceEquipmentExcel(response, equipmentCards,equipmentBelongId); - return null; - } - @RequestMapping(value = "downloadPlaceEquipmentCompanyExcel.do") - public ModelAndView downloadPlaceEquipmentCompanyExcel(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String wherestr = "where 1=1"; - String equipmentIds = request.getParameter("equipmentIds"); - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - if(!"".equals(processSectionId) &&processSectionId!=null&&!processSectionId.equals("null")){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null){ - wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%' or assetNumber like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null&&!equipmentLevel.equals("null")){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - if(!"".equals(equipmentStatus) &&equipmentStatus!=null&&!equipmentStatus.equals("null")){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } - if(!"".equals(assetClass) &&assetClass!=null){ - wherestr += " and assetClassId = '"+assetClass+"' "; - } - if(null!= equipmentIds && !"".equals(equipmentIds)){ - equipmentIds = equipmentIds.replace(",","','"); - wherestr +=" and id in ('"+equipmentIds+"')"; - } - String equipmentBelongId= request.getParameter("equipmentBelongId"); - if(equipmentBelongId!=null && !"".equals(equipmentBelongId)){ - wherestr += " and equipment_belong_id = '"+equipmentBelongId+"' "; - } - List equipmentCards = this.equipmentCardService.selectListByWhere(wherestr); - //System.out.println("equipmentCards Assetnumber:"+equipmentCards.get(0).getAssetnumber()); - //导出文件到指定目录,兼容Linux - this.equipmentCardService.downloadPlaceEquipmentCompanyExcel(response, equipmentCards,equipmentBelongId); - return null; - } - /** - * 导入设备信息 - * @param request - * @param model - * @return - */ - @RequestMapping("/importEquipmentCard.do") - public String doimport(HttpServletRequest request,Model model){ - return "equipment/placeClassEquipmentCardImport"; - } - @RequestMapping("/importComPanyEquipmentCard.do") - public String doComPanyimport(HttpServletRequest request,Model model){ - return "equipment/placeClassComPanyEquipmentCardImport"; - } - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * @param request - * @param model - * @return - */ @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String equipmentBelongId = request.getParameter("equipmentBelongId"); - - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? equipmentCardService.uploadPlaceEquipmentExcelXls(excelFile.getInputStream(),equipmentBelongId) : this.equipmentCardService.uploadPlaceEquipmentExcelXlsx(excelFile.getInputStream(),equipmentBelongId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); -} - @RequestMapping("/checkExcelData.do") - public ModelAndView checkExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String equipmentBelongId = request.getParameter("equipmentBelongId"); - - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? equipmentCardService.uploadPlaceEquipmentExcelXls(excelFile.getInputStream(),equipmentBelongId) : this.equipmentCardService.uploadPlaceEquipmentExcelXlsx(excelFile.getInputStream(),equipmentBelongId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/saveComPanyExcelData.do") - public ModelAndView saveComPanyExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String equipmentBelongId = request.getParameter("equipmentBelongId"); - - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? equipmentCardService.uploadPlaceConpanyEquipmentExcelXls(excelFile.getInputStream(),equipmentBelongId) : this.equipmentCardService.uploadPlaceCompanyEquipmentExcelXlsx(excelFile.getInputStream(),equipmentBelongId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/checkComPanyExcelData.do") - public ModelAndView checkComPanyExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String equipmentBelongId = request.getParameter("equipmentBelongId"); - - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) ){ - HSSFWorkbook workbook = new HSSFWorkbook(excelFile.getInputStream()); - //int insertNum = 0; - int updateNum = 0; - List equCard1s = new ArrayList<>(); - List equCard1s2 = new ArrayList<>(); - List equCard3s = new ArrayList<>(); - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - System.out.println(numSheet); - System.out.println(workbook.getNumberOfSheets()); - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(0); - - System.out.println(""); - if (sheet == null || rowTitle.getLastCellNum() < 32) { - - continue; - } - - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - int key =1; - //int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - //int maxCellNum = row.getLastCellNum();//最后一列 - //EquipmentCard equipmentCard = new EquipmentCard(); - // EquipmentCardProp cardProp = new EquipmentCardProp(); - String assetNumber =""; - //卡片编号 - HSSFCell assNumCell = row.getCell(0); - if(null!=assNumCell && !"".equals(assNumCell)){ - assetNumber= getStringVal(assNumCell); - } - //设备ID() - HSSFCell equIdCell = row.getCell(41); - String equId =""; - if(null!=equIdCell && !"".equals(equIdCell)){ - equId= getStringVal(equIdCell); - } - List eList =new ArrayList<>(); - - if(null!=equId && !"".equals(equId)){ - if("cardid".equals(equId.substring(0,6))){ - eList=this.equipmentCardService.selectListByWhere("where equipment_out_ids = '"+equId+"' "); - }else{ - eList=this.equipmentCardService.selectListByWhere("where id = '"+equId+"' "); - } - }else if(null!=assetNumber && !"".equals(assetNumber)){ - eList = this.equipmentCardService.selectListByWhere(" where assetNumber='"+assetNumber+"'"); - }else{ - break; - } - HSSFCell cell_7 = row.getCell(12); - String equipmentValue=getStringVal(cell_7); - HSSFCell cell_34s = row.getCell(37); - int cardNub1= (int) Double.parseDouble(getStringVal(cell_34s)); - JSONArray jsonArray=new JSONArray(); - EquipmentCard equipmentCard3 = new EquipmentCard(); - if(eList.size()>cardNub1){ - cardNub1 = eList.size(); - equipmentCard3.setEquipmentcardid(eList.get(0).getEquipmentcardid()); - equipmentCard3.setEquipmentname(eList.get(0).getEquipmentname()); - equipmentCard3.set_purchaseValue1(eList.get(0).getEquipmentvalue());//系统原值 - equipmentCard3.set_useEquipmentAge(eList.size());//系统数量 - equipmentCard3.set_equipmentnumber1(getStringVal(cell_34s));//账面数量 - equipmentCard3.setEquipmentvalue(EquipmentCardService.strTOBigDecimal(equipmentValue));//账面原值 - equipmentCard3.setId(eList.get(0).getId()); - equCard3s.add(equipmentCard3); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for(EquipmentCard equCard1 : eList){ - EquipmentCard equipmentCard = equCard1; - EquipmentCard equCard =new EquipmentCard(); - equCard.setEquipmentcardid(equCard1.getEquipmentcardid()); - equCard.setEquipmentname(equCard1.getEquipmentname()); - HSSFCell cell_6 = row.getCell(16); - - if(null!=cell_6 && !"".equals(cell_6)){ - String assetName=getStringVal(cell_6); - equCard.set_assetclassname(assetName); - } - //EquipmentCard equCard=this.selectById(idVar); - EquipmentCardProp equProp1=propService.selectByEquipmentId(equCard1.getEquipmentcardid()); - EquipmentCardProp equProp = new EquipmentCardProp(); - if(equProp1!=null){ - equProp.setId(equProp1.getId()); - } - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber=getStringVal(cell_0); - if(null!=assetnumber && !"".equals(assetnumber)){ - equCard.setAssetnumber(assetnumber); - if(!assetnumber.equals(equCard1.getAssetnumber())){ - key =0; - } - } - - //类别代码 - /* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - HSSFCell cell_5 = row.getCell(2); - String assetClassId=getStringVal(cell_5); - if(null!=assetClassId && !"".equals(assetClassId)){ - equCard.setAssetclassid(assetClassId); - if(!assetClassId.equals(equCard1.getAssetclassid())){ - key =0; - } - } - - - //原值 - // HSSFCell cell_7 = row.getCell(12); - - - // String equipmentValue=getStringVal(cell_7); - if(null!=equipmentValue && !"".equals(equipmentValue)){ - - equCard.setEquipmentvalue(EquipmentCardService.strTOBigDecimal(equipmentValue).divide(cardNub,2, BigDecimal.ROUND_HALF_UP)); - if(!equCard.getEquipmentvalue().equals(equCard1.getEquipmentvalue())){ - key =0; - } - } - - //计量单位(?) - HSSFCell cell_8 = row.getCell(35); - - if(null!=cell_8 && !"".equals(cell_8)){ - String unit=getStringVal(cell_8); - equCard.setUnit(unit); - if(!unit.equals(equCard1.getUnit())){ - key =0; - } - } - - //开始使用日期 - String useDate=equCard1.getUsedate(); - HSSFCell cell_9 = row.getCell(9); - if(null==cell_9 || "".equals(cell_9)){ - - - String cellUseDate = getStringVal(cell_9); - - if(null!=cellUseDate && !"".equals(cellUseDate)){ - equCard.setUsedate(cellUseDate); - if(!cellUseDate.equals(equCard1.getUsedate())){ - key =0; - } - } - - } - - //使用部门代码 - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - //使用部门代码 - HSSFCell cell_10 = row.getCell(3); - String cellCode = getStringVal(cell_10); - String code=equCard1.getCode(); - if(null==code || "".equals(code)){ - if(null!=cellCode && !"".equals(cellCode)){ - equCard.setCode(cellCode); - if(!cellCode.equals(equCard1.getCode())){ - key =0; - } - } - - }else{ - equCard.setCode(code); - } - - //型号 - EquipmentTypeNumber equipmentTypeNumber=equCard1.getEquipmentTypeNumber(); - if(null==equipmentTypeNumber){ - - HSSFCell cell_24 = row.getCell(13); - - if(null!=cell_24 && !"".equals(cell_24) ){ - String cellSpecName = getStringVal(cell_24); - List equipmentTypeNumberList=equipmentTypeNumberService.selectListByWhere(" where name ='"+cellSpecName+"'"); - - if(equipmentTypeNumberList.size() == 0 || null==equipmentTypeNumberList){ - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - //equipmentTypeNumberService.save(equType); - equCard.setEquType(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId=equCard1.getAreaid(); - if(null==areaId||"".equals(areaId)){ - - HSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - if(!areaid.equals(equCard1.getAreaid())){ - key =0; - } - }else{ - equCard.setAreaid(areaId); - } - //增加方式 - HSSFCell cell_4 = row.getCell(4); - - if(null!=cell_4 && !"".equals(cell_4) ){ - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - if(!addway.equals(equCard1.getAddWay())){ - key =0; - } - } - //净残值 - HSSFCell cell_32 = row.getCell(23); - - - String netSalvageValue = getStringVal(cell_32); - if(null!=netSalvageValue && !"".equals(netSalvageValue) ){ - equProp.setNetSalvageValue(EquipmentCardService.strTOBigDecimal(netSalvageValue).divide(cardNub,2, BigDecimal.ROUND_HALF_UP)); - if(equCard1.getEquipmentCardProp().getNetSalvageValue()==null||equCard1.getEquipmentCardProp().getNetSalvageValue().compareTo(equProp.getNetSalvageValue())!=0){ - key =0; - } - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - HSSFCell cell_34 = row.getCell(22); - - if(null!=cell_34 && !"".equals(cell_34) ){ - String residualValueRate = getStringVal(cell_34); - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - if(equCard1.getEquipmentCardProp().getResidualValueRate()==null||equCard1.getEquipmentCardProp().getResidualValueRate()!=equProp.getResidualValueRate()){ - key =0; - } - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(15); - - - String totalDepreciation = getStringVal(cell_37); - if(null!=totalDepreciation && !"".equals(totalDepreciation) ){ - equProp.setTotalDepreciation(EquipmentCardService.strTOBigDecimal(totalDepreciation).divide(cardNub,2, BigDecimal.ROUND_HALF_UP)); - if(equCard1.getEquipmentCardProp().getTotalDepreciation()==null||equCard1.getEquipmentCardProp().getTotalDepreciation().compareTo(equProp.getTotalDepreciation())!=0){ - key =0; - } - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - HSSFCell cell_38 = row.getCell(6); - String physicalLife = getStringVal(cell_38); - if(null!=physicalLife && !"".equals(physicalLife) ){ - if(physicalLife.contains("年")){ - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - }else{ - equCard.setServiceLife(Double.parseDouble(physicalLife)/12); - equCard.setUseage(Double.parseDouble(physicalLife)/12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife)/12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife)/12); - } - } - - equProp.setEquipmentId(equCard1.getEquipmentcardid()); -// if(null== equProp.getId() || "".equals(equProp.getId())){ -// equProp.setId(CommUtil.getUUID()); -// //propService.save(equProp); -// } - //采购日期 - HSSFCell cell_33 = row.getCell(33); - if(null!=cell_33 && !"".equals(cell_33) ){ - String buytime = getStringVal(cell_33); - equCard.setBuyTime(buytime); - if(!buytime.equals(equCard1.getBuyTime())){ - key =0; - } - } - //原始凭证号 - HSSFCell cell_35 = row.getCell(35); - if(null!=cell_35 && !"".equals(cell_35) ){ - String bookkeep_voucher = getStringVal(cell_35); - equProp.setBookkeepVoucher(bookkeep_voucher); - if(!bookkeep_voucher.equals(equCard1.getEquipmentCardProp().getBookkeepVoucher())){ - key =0; - } - } - //制造厂商 - HSSFCell cell_36 = row.getCell(36); - if(null!=cell_36 && !"".equals(cell_36) ){ - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - if(!equipmentManufacturer.equals(equCard1.getEquipmentmanufacturer())){ - key =0; - } - } - //更新设备附表 - - equCard.setEquipmentCardProp(equProp); - - equCard.setId(equCard1.getId()); - equCard1s2.add(equCard); - equCard1.setEquipmentCardProp(equProp1); - equCard.setEquipmentCard(equipmentCard); -// propService.update(equProp); -// this.update(equCard); - if(key ==0){ - equCard1s.add(equCard1); - equCard1s.add(equCard); - } - updateNum++; - //break; - - - } - - - }//row - } - JSONArray jsonArray1 = JSONArray.fromObject(equCard1s2); - // model.addAttribute("jsonList", jsonArray1); - PageInfo pi = new PageInfo(equCard1s); - JSONArray json=JSONArray.fromObject(equCard1s); - JSONArray json2=JSONArray.fromObject(equCard3s); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+",\"jsonList\":"+jsonArray1+",\"jsonList2\":"+json2+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - - - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/updateEquipmentCard.do") - public String doupdate(HttpServletRequest request,Model model - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String JSONequipmentCards = request.getParameter("jsonList"); - List EquipmentCards =JSON.parseArray(JSONequipmentCards,EquipmentCard.class); - int result = 0; - if(EquipmentCards!=null && EquipmentCards.size()>0){ - for (EquipmentCard equipmentCard : EquipmentCards) { - - equipmentCard.setInsdt(CommUtil.nowDate()); - equipmentCard.setInsuser(cu.getId()); - - String assetClassId=equipmentCard.getAssetclassid(); - if(null!=assetClassId && !"".equals(assetClassId)){ - AssetClass assetClass=assetClassService.selectById(assetClassId); - String assetnumber = equipmentCard.getAssetnumber(); - if(null==assetClass){ - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - if(null!=assetnumber && !"".equals(assetnumber)){ - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - - String assetName=equipmentCard.get_assetclassname(); - if(null!=assetName && !"".equals(assetName)){ - - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - }else{ - if(null!=assetnumber && !"".equals(assetnumber)){ - assetClass.setAssetclassnumber(assetnumber); - } - - - - assetClassService.update(assetClass); - } - } - - - //使用部门代码 - - String cellCode = equipmentCard.getCode(); - - //使用部门代码名称 - String companyName=""; - String cellDeptName= ""; - Company company=companyService.selectByPrimaryKey(cellCode); - if(null!=company){ - companyName = company.getSname(); - cellDeptName =companyName; - }else{ - cellDeptName =companyName; - } - - - - String sqlStr = ""; - if(null!=cellCode && !"".equals(cellCode)){ - sqlStr="where code='"+cellCode+"'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if(null!=sqlStr && !"".equals(sqlStr)){ - List financeEquDept=financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if(financeEquDept.size() > 0 && null!=financeEquDept){ - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if(!"".equals(cellDeptName) && null!=cellDeptName){ - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - }else{ - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if(!"".equals(cellDeptName) && null!=cellDeptName){ - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - if(equipmentCard.getEquType()!=null){ - equipmentTypeNumberService.save(equipmentCard.getEquType()); - } - try { - equipmentCard = setNullValue(equipmentCard); - equipmentCard.setEquipmentCardProp(setNullValue(equipmentCard.getEquipmentCardProp())); - } catch (IllegalArgumentException | IllegalAccessException - | SecurityException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - if(null== equipmentCard.getEquipmentCardProp().getId() || "".equals(equipmentCard.getEquipmentCardProp().getId())){ - - equipmentCard.getEquipmentCardProp().setId(CommUtil.getUUID()); - - propService.save(equipmentCard.getEquipmentCardProp()); - }else{ - propService.update(equipmentCard.getEquipmentCardProp()); - } - - result = this.equipmentCardService.update(equipmentCard); - } - - } - String msg = ""; - if(result==1){ - msg="成功更新"+EquipmentCards.size()+"条数据"; - }else{ - msg="更新失败"; - } - - String resstr="{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getListTime.do") - public ModelAndView getListTime(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("typeStatus")!=null && !request.getParameter("typeStatus").isEmpty()){ - String typeStatus = request.getParameter("typeStatus"); - if("1".equals(typeStatus)){ - wherestr += " and assetNumber is NOT NULL "; - } - if("2".equals(typeStatus)){ - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processsectionid = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("search_name2")!=null && !request.getParameter("search_name2").isEmpty()){ - - wherestr += " and year(GETDATE())-YEAR(open_date)+1 >= '"+request.getParameter("search_name2")+"' "; - } - if(request.getParameter("search_name3")!=null && !request.getParameter("search_name3").isEmpty()){ - wherestr += " and year(GETDATE())-YEAR(open_date)+1 <= '"+request.getParameter("search_name3")+"' "; - } - if(request.getParameter("equipmentLevel")!=null && !request.getParameter("equipmentLevel").isEmpty()){ - wherestr += " and equipmentLevelId = '"+request.getParameter("equipmentLevel")+"' "; - } - - - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - if(!"".equals(processSectionId) &&processSectionId!=null){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null && !"-999".equals(equipmentCardClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids=""; - for(EquipmentClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and equipmentClassID in ("+companyids+") "; - }else{ - wherestr +=" and equipmentClassID='"+equipmentCardClass+"'"; - } - - -// wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentCardID like '%"+name+"%' or equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - - //设备归属--常排项目 - if(!"".equals(equipmentBelong) &&equipmentBelong!=null){ - wherestr += " and equipment_belong_id = '"+equipmentBelong+"' "; - } - - if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } -// if(!"".equals(assetClass) &&assetClass!=null){ -// wherestr += " and assetClassId = '"+assetClass+"' "; -// } - if(!"".equals(assetClass) &&assetClass!=null && !"-999".equals(assetClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids=""; - for(AssetClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and asset_type in ("+companyids+") "; - }else{ - wherestr +=" and asset_type='"+assetClass+"'"; - } - } - - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - - if(request.getParameter("equipmentCardType")!=null && !request.getParameter("equipmentCardType").isEmpty()){ - wherestr += " and equipment_card_type = '"+request.getParameter("equipmentCardType")+"' "; - } - - //2020-10-12 设备编码筛选 - if(!"".equals(isequipcode) && null!=isequipcode){ - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if(isoverdue!=null && !"".equals(isoverdue) && isoverdue.equals("1")){ - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime*12-3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '"+sdf.format(nowdate)+"' "; - } - - - //2020-07-13 end -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ -// wherestr += " and equipmentName like '%"+request.getParameter("search_name")+"%'"; -// }else { -// List processSections = this.processSectionService.selectListByWhere("where name like '%"+request.getParameter("search_name")+"%'"); -// String processIds = ""; -// if (processSections!=null&&processSections.size()>0) { -// for (int i = 0; i < processSections.size(); i++) { -// processIds+="'"+processSections.get(i).getId()+"'"; -// if (i!=(processSections.size()-1)) { -// processIds+=","; -// } -// } -// }else { -// processIds="''"; -// } -// wherestr += " and (equipmentName like '%"+request.getParameter("search_name")+"%'" -// + " or processSectionId in ("+processIds+"))"; -// } -// } -// -// if(request.getParameter("equipmentName")!=null && !request.getParameter("equipmentName").isEmpty()){ -// wherestr += " and (equipmentName like '%"+request.getParameter("equipmentName")+"%'" -// + " or id like '%"+request.getParameter("equipmentName")+"%'" -// + " or equipmentCardID like '%"+request.getParameter("equipmentName")+"%')"; -// } -// if(request.getParameter("equipmentCardClass")!=null && !request.getParameter("equipmentCardClass").isEmpty()){ -// wherestr += " and equipmentClassID = '"+request.getParameter("equipmentCardClass")+"' "; -// } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("search_dept")!=null && !request.getParameter("search_dept").isEmpty()){ - wherestr += " and responsibleDepartment like '%"+request.getParameter("search_dept")+"%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification=request.getParameter("specification"); - //设备型号 - String equipmentmodel=request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel=request.getParameter("equipmentlevel"); - - if(!"".equals(specification) && null!=specification){ - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr=new StringBuilder("and specification in ("); - List esList=equipmentSpecificationService.selectListByWhere("where name like '%"+specification+"%'"); - - for(EquipmentSpecification es:esList){ - esIdAllStr.append("'"+es.getId()+"'"+','); - } - - String esIdStr=esIdAllStr.substring(0, esIdAllStr.length()-1); - esIdInAllStr.append(esIdStr+")"); - wherestr += esIdInAllStr.toString(); - } - - if(!"".equals(equipmentmodel) && null!=equipmentmodel){ - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr=new StringBuilder("and equipmentmodel in ("); - List emList=equipmentTypeNumberService.selectListByWhere("where name like '%"+equipmentmodel+"%'"); - for(EquipmentTypeNumber em:emList){ - emIdAllStr.append("'"+em.getId()+"'"+','); - } - String emIdStr=emIdAllStr.substring(0, emIdAllStr.length()-1); - emIdInAllStr.append(emIdStr+")"); - wherestr += emIdInAllStr.toString(); - } - - if(!"".equals(equipmentlevel) && null!=equipmentlevel){ - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr=new StringBuilder("and equipmentLevelId in ("); - List elList=equipmentLevelService.selectListByWhere("where levelName like '%"+equipmentlevel+"%'"); - for(EquipmentLevel el:elList){ - elIdAllStr.append("'"+el.getId()+"'"+','); - } - String elIdStr=elIdAllStr.substring(0, elIdAllStr.length()-1); - elIdInAllStr.append(elIdStr+")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId=request.getParameter("equipmentBigClassId"); - String ratedPower=request.getParameter("ratedPower"); - String likeSea=request.getParameter("likeSea"); - if(!"".equals(equipmentBigClassId) && null!=equipmentBigClassId){ - wherestr+=" and equipment_big_class_id='"+equipmentBigClassId+"'"; - } - if(!"".equals(ratedPower) && null!=ratedPower){ - wherestr+=" and ratedPower='"+ratedPower+"'"; - } - if(!"".equals(likeSea) && null!=likeSea){ - wherestr += " and equipmentName like '%"+likeSea+"%'"; - } - //System.out.println(wherestr); - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getListRunLife.do") - public ModelAndView getListRunLife(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("typeStatus")!=null && !request.getParameter("typeStatus").isEmpty()){ - String typeStatus = request.getParameter("typeStatus"); - if("1".equals(typeStatus)){ - wherestr += " and assetNumber is NOT NULL "; - } - if("2".equals(typeStatus)){ - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processsectionid = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("search_name2")!=null && !request.getParameter("search_name2").isEmpty()){ - - wherestr += " and year(GETDATE())-YEAR(open_date)+1 >= '"+request.getParameter("search_name2")+"' "; - } - if(request.getParameter("search_name3")!=null && !request.getParameter("search_name3").isEmpty()){ - wherestr += " and year(GETDATE())-YEAR(open_date)+1 <= '"+request.getParameter("search_name3")+"' "; - } - if(request.getParameter("equipmentLevel")!=null && !request.getParameter("equipmentLevel").isEmpty()){ - wherestr += " and equipmentLevelId = '"+request.getParameter("equipmentLevel")+"' "; - } - - - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - if(!"".equals(processSectionId) &&processSectionId!=null){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null && !"-999".equals(equipmentCardClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids=""; - for(EquipmentClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and equipmentClassID in ("+companyids+") "; - }else{ - wherestr +=" and equipmentClassID='"+equipmentCardClass+"'"; - } - - -// wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentCardID like '%"+name+"%' or equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - - //设备归属--常排项目 - if(!"".equals(equipmentBelong) &&equipmentBelong!=null){ - wherestr += " and equipment_belong_id = '"+equipmentBelong+"' "; - } - - if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } -// if(!"".equals(assetClass) &&assetClass!=null){ -// wherestr += " and assetClassId = '"+assetClass+"' "; -// } - if(!"".equals(assetClass) &&assetClass!=null && !"-999".equals(assetClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids=""; - for(AssetClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and asset_type in ("+companyids+") "; - }else{ - wherestr +=" and asset_type='"+assetClass+"'"; - } - } - - //2020-07-13 start - if(request.getParameter("equipmentBelongId")!=null && !request.getParameter("equipmentBelongId").isEmpty()){ - wherestr += " and equipment_belong_id = '"+request.getParameter("equipmentBelongId")+"' "; - } - - if(request.getParameter("equipmentCardType")!=null && !request.getParameter("equipmentCardType").isEmpty()){ - wherestr += " and equipment_card_type = '"+request.getParameter("equipmentCardType")+"' "; - } - - //2020-10-12 设备编码筛选 - if(!"".equals(isequipcode) && null!=isequipcode){ - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if(isoverdue!=null && !"".equals(isoverdue) && isoverdue.equals("1")){ - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime*12-3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '"+sdf.format(nowdate)+"' "; - } - - - //2020-07-13 end -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ -// wherestr += " and equipmentName like '%"+request.getParameter("search_name")+"%'"; -// }else { -// List processSections = this.processSectionService.selectListByWhere("where name like '%"+request.getParameter("search_name")+"%'"); -// String processIds = ""; -// if (processSections!=null&&processSections.size()>0) { -// for (int i = 0; i < processSections.size(); i++) { -// processIds+="'"+processSections.get(i).getId()+"'"; -// if (i!=(processSections.size()-1)) { -// processIds+=","; -// } -// } -// }else { -// processIds="''"; -// } -// wherestr += " and (equipmentName like '%"+request.getParameter("search_name")+"%'" -// + " or processSectionId in ("+processIds+"))"; -// } -// } -// -// if(request.getParameter("equipmentName")!=null && !request.getParameter("equipmentName").isEmpty()){ -// wherestr += " and (equipmentName like '%"+request.getParameter("equipmentName")+"%'" -// + " or id like '%"+request.getParameter("equipmentName")+"%'" -// + " or equipmentCardID like '%"+request.getParameter("equipmentName")+"%')"; -// } -// if(request.getParameter("equipmentCardClass")!=null && !request.getParameter("equipmentCardClass").isEmpty()){ -// wherestr += " and equipmentClassID = '"+request.getParameter("equipmentCardClass")+"' "; -// } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("search_dept")!=null && !request.getParameter("search_dept").isEmpty()){ - wherestr += " and responsibleDepartment like '%"+request.getParameter("search_dept")+"%'"; - } - - //20200319 start========================================================================== - //设备规格 - String specification=request.getParameter("specification"); - //设备型号 - String equipmentmodel=request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel=request.getParameter("equipmentlevel"); - - if(!"".equals(specification) && null!=specification){ - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr=new StringBuilder("and specification in ("); - List esList=equipmentSpecificationService.selectListByWhere("where name like '%"+specification+"%'"); - - for(EquipmentSpecification es:esList){ - esIdAllStr.append("'"+es.getId()+"'"+','); - } - - String esIdStr=esIdAllStr.substring(0, esIdAllStr.length()-1); - esIdInAllStr.append(esIdStr+")"); - wherestr += esIdInAllStr.toString(); - } - - if(!"".equals(equipmentmodel) && null!=equipmentmodel){ - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr=new StringBuilder("and equipmentmodel in ("); - List emList=equipmentTypeNumberService.selectListByWhere("where name like '%"+equipmentmodel+"%'"); - for(EquipmentTypeNumber em:emList){ - emIdAllStr.append("'"+em.getId()+"'"+','); - } - String emIdStr=emIdAllStr.substring(0, emIdAllStr.length()-1); - emIdInAllStr.append(emIdStr+")"); - wherestr += emIdInAllStr.toString(); - } - - if(!"".equals(equipmentlevel) && null!=equipmentlevel){ - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr=new StringBuilder("and equipmentLevelId in ("); - List elList=equipmentLevelService.selectListByWhere("where levelName like '%"+equipmentlevel+"%'"); - for(EquipmentLevel el:elList){ - elIdAllStr.append("'"+el.getId()+"'"+','); - } - String elIdStr=elIdAllStr.substring(0, elIdAllStr.length()-1); - elIdInAllStr.append(elIdStr+")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId=request.getParameter("equipmentBigClassId"); - String ratedPower=request.getParameter("ratedPower"); - String likeSea=request.getParameter("likeSea"); - if(!"".equals(equipmentBigClassId) && null!=equipmentBigClassId){ - wherestr+=" and equipment_big_class_id='"+equipmentBigClassId+"'"; - } - if(!"".equals(ratedPower) && null!=ratedPower){ - wherestr+=" and ratedPower='"+ratedPower+"'"; - } - if(!"".equals(likeSea) && null!=likeSea){ - wherestr += " and equipmentName like '%"+likeSea+"%'"; - } - wherestr +=" and year(GETDATE())-YEAR(open_date) > useAge "; - //System.out.println(wherestr); - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr+orderstr); - for (EquipmentCard equipmentCard : list) { - if(equipmentCard.getOpenDate()!=null){ - Calendar date = Calendar.getInstance(); - int _useEquipmentAge = date.get(Calendar.YEAR)- Integer.valueOf(equipmentCard.getOpenDate().substring(0,4))+1; - equipmentCard.set_useEquipmentAge(_useEquipmentAge); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListRunEqu.do") - public ModelAndView getListRunEqu(HttpServletRequest request,Model model){ - String wherestr = "where 1=1"; - String equipmentIds = request.getParameter("equipmentIds"); - String processSectionId = request.getParameter("processSection"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - wherestr +=" and year(GETDATE())-YEAR(open_date) > useAge "; - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - if(!"".equals(processSectionId) &&processSectionId!=null){ - wherestr += " and processSectionId = '"+processSectionId+"' "; - } - if(request.getParameter("typeStatus")!=null && !request.getParameter("typeStatus").isEmpty()){ - String typeStatus = request.getParameter("typeStatus"); - if("1".equals(typeStatus)){ - wherestr += " and assetNumber is NOT NULL "; - } - if("2".equals(typeStatus)){ - wherestr += " and (assetNumber is NULL or assetNumber='') "; - } - } - if(!"".equals(equipmentCardClass) &&equipmentCardClass!=null && !"-999".equals(equipmentCardClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids=""; - for(EquipmentClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and equipmentClassID in ("+companyids+") "; - }else{ - wherestr +=" and equipmentClassID='"+equipmentCardClass+"'"; - } - - -// wherestr += " and equipmentClassID = '"+equipmentCardClass+"' "; - } - if(!"".equals(name) &&name!=null){ - wherestr += " and (equipmentName like '%"+name+"%' or equipmentModelName like '%"+name+"%' or equipmentmanufacturer like '%"+name+"%' or assetNumber like '%"+name+"%') "; - } - - if(!"".equals(equipmentNames) &&equipmentNames!=null){ - wherestr += " and (equipmentName like '%"+equipmentNames+"%' or equipmentCardID like '%"+equipmentNames+"%' or assetNumber like '%"+equipmentNames+"%') "; - } - - if(!"".equals(equipmentLevel) &&equipmentLevel!=null){ - wherestr += " and equipmentLevelId = '"+equipmentLevel+"' "; - } - if(!"".equals(equipmentStatus) &&equipmentStatus!=null){ - wherestr += " and equipmentStatus = '"+equipmentStatus+"' "; - } - if(!"".equals(assetClass) &&assetClass!=null && !"-999".equals(assetClass)){ - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids=""; - for(AssetClass unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and asset_type in ("+companyids+") "; - }else{ - wherestr +=" and asset_type='"+assetClass+"'"; - } - } - if(null!= equipmentIds && !"".equals(equipmentIds)){ - equipmentIds = equipmentIds.replace(",","','"); - wherestr +=" and id in ('"+equipmentIds+"')"; - } - if(request.getParameter("search_name2")!=null && !request.getParameter("search_name2").isEmpty()){ - - wherestr += " and year(GETDATE())-YEAR(open_date)+1 >= '"+request.getParameter("search_name2")+"' "; - } - if(request.getParameter("search_name3")!=null && !request.getParameter("search_name3").isEmpty()){ - wherestr += " and year(GETDATE())-YEAR(open_date)+1 <= '"+request.getParameter("search_name3")+"' "; - } - String equipmentBelongId= request.getParameter("equipmentBelongId"); - if(equipmentBelongId!=null && !"".equals(equipmentBelongId)){ - wherestr += " and equipment_belong_id = '"+equipmentBelongId+"' "; - } - OverviewProduceBlot homePage = new OverviewProduceBlot(); - String bizId = request.getParameter("biz_id"); - List companies = this.unitService.getCompaniesByWhere(" where pid ='"+bizId+"' or id ='"+bizId+"' "); - ArrayList wscll= new ArrayList<>(); - StringBuilder abizIdString = new StringBuilder(); - for (Company company : companies) { - ArrayList list= new ArrayList<>(); - list.add(company.getSname()); - String equipmentTotal = this.homePageService.selectEquipmentTotal(wherestr + " and bizId = '"+ company.getId()+"' ").getAssetnumber(); - list.add(equipmentTotal); - wscll.add(list); - abizIdString .append("'"+company.getId()+"'"+','); - } - - homePage.setData(wscll); - - ArrayList wscll2= new ArrayList<>(); - List equipmentCards = this.homePageService.selectEquipmentRunTimeTotal(wherestr+" and bizId in ("+abizIdString.substring(0, abizIdString.length()-1)+") and open_date IS NOT NULL group by YEAR(open_date) order by open_date"); - for (EquipmentCard equipmentCard : equipmentCards) { - ArrayList list= new ArrayList<>(); - list.add(equipmentCard.getOpenDate()+"年"); - list.add(equipmentCard.getAssetnumber()); - wscll2.add(list); - } - homePage.setData1(wscll2); - ArrayList wscll3= new ArrayList<>(); - List equipmentCardClasses = this.equipmentClassService.selectListByWhere("where pid = '-1' "); - for (EquipmentClass equipmentClass : equipmentCardClasses) { - List tClasses = this.equipmentClassService.getUnitChildrenById(equipmentClass.getId()); - int tol =0; - for (EquipmentClass equipmentClass2 : tClasses) { - EquipmentCard equipmentCards1 = this.homePageService.selectEquipmentTotal(wherestr+" and bizId in ("+abizIdString.substring(0, abizIdString.length()-1)+") and equipmentClassID ='"+equipmentClass2.getId()+"' "); - tol = tol +Integer.parseInt(equipmentCards1.getAssetnumber()); - } - - - ArrayList list= new ArrayList<>(); - list.add(equipmentClass.getName()); - list.add(Integer.toString(tol)); - wscll3.add(list); - - } - - homePage.setData2(wscll3); - JSONObject fromObject = JSONObject.fromObject(homePage); - String resstr="{\"res\":\""+fromObject+"\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); -} - /** - * xls文件数据转换 - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - }else{ - return null; - } - } - public static T setNullValue(T source) throws IllegalArgumentException, IllegalAccessException, SecurityException { - Field[] fields = source.getClass().getDeclaredFields(); - for (Field field : fields) { - if (field.getGenericType().toString().equals( - "class java.lang.String")) { - field.setAccessible(true); - Object obj = field.get(source); - if (obj != null && obj.equals("")) { - field.set(source, null); - } else if (obj != null) { - String str = obj.toString(); - str = StringEscapeUtils.escapeSql(str);//StringEscapeUtils是commons-lang中的通用类 - field.set(source, str.replace("\\", "\\" + "\\").replace("(", "\\(").replace(")", "\\)") - .replace("%", "\\%").replace("*", "\\*").replace("[", "\\[").replace("]", "\\]") - .replace("|", "\\|").replace(".", "\\.").replace("$", "\\$").replace("+", "\\+").trim() - ); - } - } - } - return source; - } -} diff --git a/src/com/sipai/controller/equipment/GeographyAreaController.java b/src/com/sipai/controller/equipment/GeographyAreaController.java deleted file mode 100644 index 71c41e7a..00000000 --- a/src/com/sipai/controller/equipment/GeographyAreaController.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.controller.equipment; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.GeographyArea; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.GeographyAreaService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment") -public class GeographyAreaController { - @Resource - private GeographyAreaService geographyareaService; - @RequestMapping("/showGeographyArea.do") - public String showlist(HttpServletRequest request,Model model) { - return "/equipment/geographyAreaList"; - } - @RequestMapping("/getGeographyArea.do") - public ModelAndView getgeographyarea(HttpServletRequest request,Model model) { - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " name "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - User cu= (User)request.getSession().getAttribute("cu"); - String wherestr=CommUtil.getwherestr("insuser", "equipment/showGeographyArea.do", cu); - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.geographyareaService.selectListByWhere(wherestr+orderstr); - - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getGeographyArea4Combo.do") - public ModelAndView getGeographyArea4Combo(HttpServletRequest request,Model model) { - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " name "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr =" where 1=1 "; - List list = this.geographyareaService.selectListByWhere(wherestr+orderstr); - - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - //String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",json); - return new ModelAndView("result"); - } - @RequestMapping("/addGeographyArea.do") - public String doadd(HttpServletRequest request,Model model){ - return "equipment/geographyAreaAdd"; - } - @RequestMapping("/deleteGeographyArea.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.geographyareaService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/deleteGeographyAreas.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.geographyareaService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/saveGeographyArea.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("geographyarea") GeographyArea geographyarea){ - User cu= (User)request.getSession().getAttribute("cu"); - if(!this.geographyareaService.checkNotOccupied(geographyarea.getId(), geographyarea.getName())){ - model.addAttribute("result", "{\"res\":\"位置名称重复\"}"); - return "result"; - } - String geographyareaId = CommUtil.getUUID(); - geographyarea.setId(geographyareaId); - geographyarea.setInsuser(cu.getId()); - geographyarea.setInsdt(CommUtil.nowDate()); - int result = this.geographyareaService.save(geographyarea); - String resstr="{\"res\":\""+result+"\",\"id\":\""+geographyareaId+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/viewGeographyArea.do") - public String doview(HttpServletRequest request,Model model){ - String geographyareaId = request.getParameter("id"); - GeographyArea geographyarea = this.geographyareaService.selectById(geographyareaId); - model.addAttribute("geographyarea", geographyarea); - return "equipment/geographyAreaView"; - } - @RequestMapping("/editGeographyArea.do") - public String doedit(HttpServletRequest request,Model model){ - String geographyareaId = request.getParameter("id"); - GeographyArea geographyarea = this.geographyareaService.selectById(geographyareaId); - model.addAttribute("geographyarea", geographyarea); - return "equipment/geographyAreaEdit"; - } - @RequestMapping("/updateGeographyArea.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("geographyarea") GeographyArea geographyarea){ - User cu= (User)request.getSession().getAttribute("cu"); - if(!this.geographyareaService.checkNotOccupied(geographyarea.getId(), geographyarea.getName())){ - model.addAttribute("result", "{\"res\":\"位置名称重复\"}"); - return "result"; - } - geographyarea.setInsuser(cu.getId()); - geographyarea.setInsdt(CommUtil.nowDate()); - int result = this.geographyareaService.update(geographyarea); - String resstr="{\"res\":\""+result+"\",\"id\":\""+geographyarea.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/getGeographyAreaname.do") - public String getGeographyAreaname(HttpServletRequest request,Model model) { - String wherestr ="where 1=1"; - List list = this.geographyareaService.selectListByWhere(wherestr); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return "result"; - } -} diff --git a/src/com/sipai/controller/equipment/MaintenancePlanController.java b/src/com/sipai/controller/equipment/MaintenancePlanController.java deleted file mode 100644 index 6482152f..00000000 --- a/src/com/sipai/controller/equipment/MaintenancePlanController.java +++ /dev/null @@ -1,617 +0,0 @@ -package com.sipai.controller.equipment; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.maintenance.*; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.*; -import com.sipai.service.user.JobService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.user.Company; - -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.LoginService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.MaintenancePlanService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/equipment/maintenancePlan") -public class MaintenancePlanController { - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private UnitService unitService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private WorkflowService workflowService; - @Resource - private UserService userService; - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private CompanyService companyService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private JobService jobService; - - - /* - * 打开维护保养计划页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/equipment/maintenancePlanList"; - } - - /* - * 打开检修计划页面 - */ - @RequestMapping("/showOverHaulList.do") - public String showOverHaulList(HttpServletRequest request, Model model) { - return "/equipment/overHaulPlanList"; - } - - /* - * 获取检修/维修计划列表 - * 根据计划的类型planType筛选 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1"; - if (request.getParameter("planType") != null && !request.getParameter("planType").isEmpty()) { - wherestr += " and plan_type = '" + request.getParameter("planType") + "' "; - } - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and biz_id in (" + companyids + ") "; - } - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and process_section_id = '" + request.getParameter("pSectionId") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and content like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintenancePlanService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /* - * 打开新增维护保养计划界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String detailNumber = company.getEname() + "-BYJH-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("detailNumber", detailNumber); - model.addAttribute("company", company); - return "equipment/maintenancePlanAdd"; - } - - /* - * 打开新增检修计划界面 - */ - @RequestMapping("/doaddOverHaul.do") - public String doaddOverHaul(HttpServletRequest request, Model model) { - return "equipment/overHaulPlanAdd"; - } - - /* - * 打开编辑维护保养计划界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(Id); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/maintenancePlanEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(Id); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/maintenancePlanView"; - } - - /* - * 打开编辑检修计划界面 - */ - @RequestMapping("/doeditOverHaul.do") - public String doeditOverHaul(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(Id); - model.addAttribute("maintenancePlan", maintenancePlan); - return "equipment/overHaulPlanEdit"; - } - - /* - * 检修/维护保养计划保存方法 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute MaintenancePlan maintenancePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenancePlan.setInsuser(cu.getId()); - maintenancePlan.setInsdt(CommUtil.nowDate()); - //下发的日期为空是月保养计划,要设置为null,否则数据库里会保存1900-01-01 - if (maintenancePlan.getInitialDate() == "") { - maintenancePlan.setInitialDate(null); - } - int result = this.maintenancePlanService.save(maintenancePlan); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenancePlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - * 检修/维护保养计划更新的方法 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute MaintenancePlan maintenancePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenancePlan.setInsuser(cu.getId()); - //下发的日期为空是月保养计划,要设置为null,否则数据库里会保存1900-01-01 - if (maintenancePlan.getInitialDate() == "") { - maintenancePlan.setInitialDate(null); - } - int result = this.maintenancePlanService.update(maintenancePlan); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenancePlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新,启动保养计划审核流程 - */ - @RequestMapping("/startPlanAudit.do") - public String startPlanAudit(HttpServletRequest request, Model model, - @ModelAttribute MaintenancePlan maintenancePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenancePlan.setInsuser(cu.getId()); - maintenancePlan.setInsdt(CommUtil.nowDate()); - int result = 0; - try { - result = this.maintenancePlanService.startPlanAudit(maintenancePlan); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenancePlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示保养计划审核 - */ - @RequestMapping("/showAuditMaintainPlan.do") - public String showAuditMaintainPlan(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String maintenancePlanId = pInstance.getBusinessKey(); - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId); - model.addAttribute("maintenancePlan", maintenancePlan); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/maintenancePlanAudit"; - } - - /** - * 流程流转-保养计划审核 - */ - @RequestMapping("/doAuditMaintain.do") - public String doAuditMaintain(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.maintenancePlanService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保养计划退回时,回到保养计划调整界面 - */ - @RequestMapping("/showMaintainPlanHandle.do") - public String showMaintainPlanHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String maintenancePlanId = pInstance.getBusinessKey(); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + maintenancePlanId + "' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId); - model.addAttribute("maintenancePlan", maintenancePlan); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(maintenancePlanId); - model.addAttribute("equipmentPlan", equipmentPlan); - - if (equipmentPlan != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - if (company != null) { - model.addAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(equipmentPlan.getAuditId()); - if (user != null) { - model.addAttribute("userName", user.getCaption()); - } - EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig()); - if (equipmentPlanType_big != null) { - model.addAttribute("planTypeBigName", equipmentPlanType_big.getName()); - } - EquipmentPlanType equipmentPlanType_small = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - if (equipmentPlanType_small != null) { - model.addAttribute("planTypeSmallName", equipmentPlanType_small.getName()); - } - - String type = request.getParameter("type"); - //获取第一个节点的 岗位 - String jobIds = ""; - if (type != null) { - if (type.equals(EquipmentPlanType.Code_Type_Wx)) { - jobIds = jobService.getJobs4Activiti(equipmentPlan.getUnitId(), ProcessType.Repair_Plan.getId()); - } - if (type.equals(EquipmentPlanType.Code_Type_By)) { - jobIds = jobService.getJobs4Activiti(equipmentPlan.getUnitId(), ProcessType.Maintain_Plan.getId()); - } - if (type.equals(EquipmentPlanType.Code_Type_Dx)) { - jobIds = jobService.getJobs4Activiti(equipmentPlan.getUnitId(), ProcessType.Overhaul_PLAN.getId()); - } - } - model.addAttribute("jobIds", jobIds); - } - return "equipment/maintenancePlanHandle"; - } - - /** - * 流程流程,退回的保养计划,编辑后再次提交审核 - */ - @Transactional - @RequestMapping("/submitAuditAgain.do") - public String dosubmitAuditAgain(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - this.maintenancePlanService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看保养计划审核流程详情 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessMaintainPlanView.do") - public String showProcessMaintainPlanView(HttpServletRequest request, Model model) { - String maintenancePlanId = request.getParameter("id"); - MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId); - request.setAttribute("business", maintenancePlan); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenancePlan); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(maintenancePlan.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_Maintain_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenancePlanId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Maintain_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + maintenancePlanId + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = maintenancePlan.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(maintenancePlan.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - return "equipment/maintenancePlanExecuteView"; - } - - /* - * 单条数据删除方法 - */ - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.maintenancePlanService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.maintenancePlanService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 发布保养计划 - */ - @RequestMapping("/doIssueMaintain.do") - public String doIssue(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - List maintenancePlans = this.maintenancePlanService.selectListByWhere("where id in ('" + ids + "')"); - int result = 0; - for (MaintenancePlan maintenancePlan : maintenancePlans) { - result = this.maintenancePlanService.issueMaintainPlan(maintenancePlan); - //有一条计划下发失败则停止下发 - if (result != 1) { - break; - } - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 检查计划编号是否存在 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request, Model model) { - String planNumber = request.getParameter("planNumber"); - String id = request.getParameter("id"); - if (this.maintenancePlanService.checkNotOccupied(id, planNumber)) { - model.addAttribute("result", "{\"valid\":" + false + "}"); - return "result"; - } else { - model.addAttribute("result", "{\"valid\":" + true + "}"); - return "result"; - } - } -} diff --git a/src/com/sipai/controller/equipment/PSMSController.java b/src/com/sipai/controller/equipment/PSMSController.java deleted file mode 100644 index 554ce707..00000000 --- a/src/com/sipai/controller/equipment/PSMSController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.controller.equipment; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.servlet.http.HttpServletRequest; - -/** - * 嵌入PSMS网页 - */ -@Controller -@RequestMapping("/equipment") -public class PSMSController { - - @RequestMapping("/viewPSMS.do") - public String viewPSMS(HttpServletRequest request, Model model) { - return "/equipment/equipmentviewPSMS"; - } - -} diff --git a/src/com/sipai/controller/equipment/SpecialEquipmentController.java b/src/com/sipai/controller/equipment/SpecialEquipmentController.java deleted file mode 100644 index 9d099ac9..00000000 --- a/src/com/sipai/controller/equipment/SpecialEquipmentController.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.sipai.controller.equipment; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentStopRecord; -import com.sipai.entity.equipment.SpecialEquipment; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.SpecialEquipmentService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/equipment/specialEquipment") -public class SpecialEquipmentController { - - @Resource - private SpecialEquipmentService specialEquipmentService; - - @Resource - private UnitService unitService; - - @Resource - private EquipmentCardService equipmentCardService; - - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "equipment/specialEquipmentList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sbSql = new StringBuilder("where 1=1"); - - Set companyIdSet = new HashSet<>(); - String companyId = request.getParameter("companyId"); - if (!"".equals(companyId) && null != companyId) { - companyIdSet = unitService.findAllCompanyIdByCompanyId(companyIdSet, companyId); - } - - String bizIdStr = ""; - StringBuilder bizIdSb = new StringBuilder(); - if (companyIdSet.size() > 0 && null != companyIdSet && !"".equals(companyIdSet)) { - for (String companyIdVar : companyIdSet) { - bizIdSb.append("'" + companyIdVar + "'" + ","); - } - bizIdStr = bizIdSb.substring(0, bizIdSb.length() - 1); - } - - if (null != bizIdStr && !"".equals(bizIdStr)) { - sbSql.append(" and biz_id in (" + bizIdStr.toString() + ")"); - } - - String equipmentName = request.getParameter("search_name"); - String equipmentIdStr = ""; - StringBuilder equipmentIdSb = new StringBuilder(); - if (null != equipmentName && !"".equals(equipmentName)) { - String sqlStr = " where equipmentName like '%" + equipmentName + "%'"; - List eqList = equipmentCardService.selectListByWhere(sqlStr); - if (eqList.size() > 0 && null != eqList && !eqList.isEmpty()) { - for (EquipmentCard eq : eqList) { - equipmentIdSb.append("'" + eq.getId() + "'" + ","); - } - equipmentIdStr = equipmentIdSb.substring(0, equipmentIdSb.length() - 1); - } - - } - - - if (null != equipmentIdStr && !"".equals(equipmentIdStr)) { - sbSql.append(" and equipment_card_id in (" + equipmentIdStr.toString() + ")"); - } - - String equipmentCardId = request.getParameter("equipmentCardId"); - if (!"".equals(equipmentCardId) && null != equipmentCardId) { - sbSql.append(" and equipment_card_id in ('" + equipmentCardId + "')"); - } - - String status = request.getParameter("status"); - if (!"".equals(status) && null != status) { - sbSql.append(" and status='" + status + "'"); - } - - - sbSql.append(" order by insdt desc"); - PageHelper.startPage(page, rows); - //System.out.println("------------sbSql.toString()------------"+sbSql.toString()); - List seList = specialEquipmentService.unitSearchSpecialEquipment(sbSql.toString()); - JSONArray jsonArray = JSONArray.fromObject(seList); - PageInfo pInfo = new PageInfo(seList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/getList4EquipmentId.do") - public ModelAndView getList4EquipmentId(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - StringBuilder sbSql = new StringBuilder("where 1=1"); - - String equipmentId = request.getParameter("equipmentId"); - if (equipmentId != null && !equipmentId.equals("")) { - sbSql.append(" and equipment_card_id in ('" + equipmentId + "') "); - } else { - sbSql.append(" and id = 'false' "); - } - - sbSql.append(" order by insdt desc"); - PageHelper.startPage(page, rows); - List seList = specialEquipmentService.unitSearchSpecialEquipment(sbSql.toString()); - JSONArray jsonArray = JSONArray.fromObject(seList); - PageInfo pInfo = new PageInfo(seList); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" - + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - @RequestMapping("/addSpecialEquipment.do") - public String addEquipmentStopRecordApply(HttpServletRequest request, Model model) { - - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - model.addAttribute("company", company); - return "equipment/specialEquipmentAdd"; - } - - @RequestMapping("/showEquipmentCardForSelect.do") - public String showEquipmentCardForSelect(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - model.addAttribute("equipmentId", equipmentId); - return "/equipment/specialEquipmentForSelect"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute SpecialEquipment se - ) { - User cu = (User) request.getSession().getAttribute("cu"); - se.setInsuser(cu.getId()); - se.setInsdt(CommUtil.nowDate()); - - if ("".equals(se.getId()) || null == se.getId() || se.getId().isEmpty()) { - se.setId(CommUtil.getUUID()); - } - int result = specialEquipmentService.save(se); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + se.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - - int result = specialEquipmentService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - int result = 0; - String idArr[] = ids.split(","); - for (String id : idArr) { - - result = specialEquipmentService.deleteById(id); - result++; - } - - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - SpecialEquipment specialEquipment = specialEquipmentService.selectById(id); - EquipmentCard equipmentCard = equipmentCardService.selectById(specialEquipment.getEquipmentCardId()); - specialEquipment.setEquipmentCard(equipmentCard); - Company company = unitService.getCompById(specialEquipment.getBizId()); - model.addAttribute("company", company); - model.addAttribute("specialEquipment", specialEquipment); - return "/equipment/specialEquipmentEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute SpecialEquipment specialEquipment) { - int result = specialEquipmentService.update(specialEquipment); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + specialEquipment.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - SpecialEquipment specialEquipment = specialEquipmentService.selectById(id); - EquipmentCard equipmentCard = equipmentCardService.selectById(specialEquipment.getEquipmentCardId()); - specialEquipment.setEquipmentCard(equipmentCard); - Company company = unitService.getCompById(specialEquipment.getBizId()); - model.addAttribute("company", company); - model.addAttribute("specialEquipment", specialEquipment); - return "/equipment/specialEquipmentView"; - } - - //2020-07-13 start - - /** - * 选择设备台账检定状态 - */ - @RequestMapping("/getEquipmentCardCheckForSelect.do") - public String getEquipmentCardTypeForSelect(HttpServletRequest request, Model model) { - JSONArray jsonArray = new JSONArray(); - for (String equipmentCheckType : SpecialEquipment.equipmentCardCheckStatusArr) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCheckType); - jsonObject.put("text", equipmentCheckType); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - //2020-07-13 end - - @RequestMapping("/dealWith.do") - public String dealWith(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SpecialEquipment speq = specialEquipmentService.selectById(id); - speq.setActFinishTime(sdf.format(new Date())); - speq.setStatus(SpecialEquipment.NORMAL); - speq.setDealDesc(SpecialEquipment.ALREADY_DEAL); - int result = specialEquipmentService.update(speq); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationCriterionController.java b/src/com/sipai/controller/evaluation/EvaluationCriterionController.java deleted file mode 100644 index 137ecce6..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationCriterionController.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JsonConfig; -import net.sf.json.processors.DefaultValueProcessor; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.service.evaluation.EvaluationCriterionService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/criterion") -public class EvaluationCriterionController { - @Resource - private EvaluationCriterionService evaluationCriterionService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/criterionList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - if(request.getParameter("Ids") != null && request.getParameter("Ids").trim().length() >0){ - String ids = request.getParameter("Ids").replaceAll(",", "','"); - ids = "'" + ids + "'" ; - wherestr += " and id in (" + ids + ") order by criterionName "; - } - PageHelper.startPage(page, rows); - List list = evaluationCriterionService. - selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JsonConfig jsonConfig = new JsonConfig(); - jsonConfig.registerDefaultValueProcessor(Double.class, new DefaultValueProcessor() { - @Override - public Object getDefaultValue(Class arg0) { - return null; - } - }); - JSONArray json=JSONArray.fromObject(list,jsonConfig); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/getListForJson.do") - public String getList(HttpServletRequest request,Model model){ - String wherestr="where 1=1"; - if(request.getParameter("Ids") != null && request.getParameter("Ids").trim().length() >0){ - String ids = request.getParameter("Ids").replaceAll(",", "','"); - ids = "'" + ids + "'" ; - wherestr += " and id in (" + ids + ") order by criterion_name "; - } - List list = evaluationCriterionService. - selectListByWhere(wherestr); - JSONArray json=JSONArray.fromObject(list); - String result=json.toString(); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request, Model model){ - return "evaluation/criterionAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute EvaluationCriterion evaluationCriterion){ - evaluationCriterion.setId(CommUtil.getUUID()); - evaluationCriterion.setInsdt(CommUtil.nowDate()); - int res = evaluationCriterionService.save(evaluationCriterion); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationCriterionService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - - @RequestMapping("/doEdit.do") - public String doEdit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - EvaluationCriterion evaluationCriterion = evaluationCriterionService.selectById(id); - model.addAttribute("evaluationCriterion", evaluationCriterion); - return "evaluation/criterionEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute EvaluationCriterion evaluationCriterion) throws InterruptedException{ - String id = evaluationCriterion.getId(); - evaluationCriterionService.deleteById(id); - Thread.sleep(300); - int res = evaluationCriterionService.save(evaluationCriterion); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/selectCriterion.do") - public String selectCriterion(HttpServletRequest request, Model model){ - String ids = request.getParameter("ids"); - if(ids != null){ - ids = ids.replaceAll(",", "','"); - ids = "'" + ids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ids + ") order by criterion_name"); - model.addAttribute("evaluationCriterions", JSONArray.fromObject(list).toString()); - } - String pid = request.getParameter("pid"); - if(pid != null){ - model.addAttribute("pid", pid); - } - String pname = request.getParameter("pname"); - if(pname != null){ - model.addAttribute("pname", pname); - } - return "evaluation/selectCriterion"; - } - - @RequestMapping("/showCriterion.do") - public String showCriterion(HttpServletRequest request, Model model){ - String type = request.getParameter("type"); - if("1".equals(type)){ - model.addAttribute("typeCriterion", "国家"); - }else if("2".equals(type)){ - model.addAttribute("typeCriterion", "地方"); - }else if("3".equals(type)){ - model.addAttribute("typeCriterion", "内控"); - } - model.addAttribute("type", type); - return "evaluation/showCriterion"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationIndexController.java b/src/com/sipai/controller/evaluation/EvaluationIndexController.java deleted file mode 100644 index f9134986..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationIndexController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndex; -import com.sipai.service.evaluation.EvaluationIndexService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/Index") -public class EvaluationIndexController { - @Resource - private EvaluationIndexService evaluationIndexService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/indexList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = evaluationIndexService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request,Model model){ - return "evaluation/indexAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EvaluationIndex evaluationIndex){ - evaluationIndex.setId(CommUtil.getUUID()); - evaluationIndex.setInsdt(CommUtil.nowDate()); - evaluationIndex.setType("day"); - int res = evaluationIndexService.save(evaluationIndex); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam("id") String id){ - EvaluationIndex evaluationIndex = evaluationIndexService.selectById(id); - List list = evaluationIndex.getEvaluationCriterions(); - if(list != null && list.size() > 0){ - String evs = ""; - for(EvaluationCriterion evaluationCriterion : list){ - evs += (evaluationCriterion.getCriterionName()+","); - } - evs = evs.substring(0, evs.length()-1); - model.addAttribute("evs", evs.replaceAll("\\r|\\n", "")); - } - model.addAttribute("evaluationIndex", evaluationIndex); - return "evaluation/indexEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EvaluationIndex evaluationIndex) throws InterruptedException{ - String id = evaluationIndex.getId(); - evaluationIndexService.deleteById(id); - Thread.sleep(300); - evaluationIndex.setType("day"); - int res = evaluationIndexService.save(evaluationIndex); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationIndexService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationIndexDayController.java b/src/com/sipai/controller/evaluation/EvaluationIndexDayController.java deleted file mode 100644 index 8aa25f2b..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationIndexDayController.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; -import net.sf.json.processors.DefaultValueProcessor; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndex; -import com.sipai.entity.evaluation.EvaluationIndexDay; -import com.sipai.service.evaluation.EvaluationIndexDayService; -import com.sipai.service.evaluation.EvaluationIndexService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/indexDay") -public class EvaluationIndexDayController { - @Resource - private EvaluationIndexDayService evaluationIndexDayService; - @Resource - private EvaluationIndexService evaluationIndexService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/indexDayList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = evaluationIndexDayService. - selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request,Model model){ - List list = evaluationIndexService.selectListByWhere - ("where type = 'day' order by insdt desc"); - if(list != null && list.size() > 0){ - EvaluationIndex evaluationIndex = list.get(0); - List evaluationCriterions = - evaluationIndex.getEvaluationCriterions(); - model.addAttribute("evaluationCriterions", evaluationCriterions); - JsonConfig jsonConfig = new JsonConfig(); - jsonConfig.registerDefaultValueProcessor(Double.class, new DefaultValueProcessor() { - @Override - public Object getDefaultValue(Class arg0) { - return null; - } - }); - model.addAttribute("evs", JSONArray.fromObject(evaluationCriterions,jsonConfig).toString()); - } - model.addAttribute("nowDate", CommUtil.nowDate()); - return "evaluation/indexDayAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model){ - String params = request.getParameter("params"); - String[] arr = params.split("&"); - EvaluationIndexDay evaluationIndexDay = new EvaluationIndexDay(); - evaluationIndexDay.setId(CommUtil.getUUID()); - evaluationIndexDay.setInsdt(CommUtil.nowDate()); - JSONObject jsonObject = new JSONObject(); - if(arr.length > 0){ - for(int i = 0; i < arr.length; i++){ - String key = arr[i].split("=")[0]; - String value = arr[i].split("=")[1]; - if("id".equals(key)){ - evaluationIndexDayService.deleteById(value); - }else if("wqiDayNation".equals(key)){ - evaluationIndexDay.setWqiDayNation(Double.parseDouble(value)); - }else if("wqiDayArea".equals(key)){ - evaluationIndexDay.setWqiDayArea(Double.parseDouble(value)); - }else if("wqiDayCompany".equals(key)){ - evaluationIndexDay.setWqiDayCompany(Double.parseDouble(value)); - }else if("date".equals(key)){ - evaluationIndexDay.setDate(value); - }else{ - if(key.contains("key_")){ - key = key.replace("key_", ""); - jsonObject.put(key, value); - } - } - } - evaluationIndexDay.setCriterionValue(jsonObject.toString()); - } - int res = evaluationIndexDayService.save(evaluationIndexDay); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam("id") String id){ - EvaluationIndexDay evaluationIndexDay = evaluationIndexDayService.selectById(id); - model.addAttribute("date", evaluationIndexDay.getDate().substring(0, 10)); - List list = evaluationIndexService.selectListByWhere - ("where type = 'day' order by insdt desc"); - if(list != null && list.size() > 0){ - EvaluationIndex evaluationIndex = list.get(0); - List evaluationCriterions = - evaluationIndex.getEvaluationCriterions(); - model.addAttribute("evaluationCriterions", evaluationCriterions); - model.addAttribute("evs", JSONArray.fromObject(evaluationCriterions).toString()); - } - String criterionValue = evaluationIndexDay.getCriterionValue(); - model.addAttribute("criterionValue", criterionValue); - model.addAttribute("id", evaluationIndexDay.getId()); - return "evaluation/indexDayView"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationIndexDayService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationIndexMController.java b/src/com/sipai/controller/evaluation/EvaluationIndexMController.java deleted file mode 100644 index fe339264..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationIndexMController.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndex; -import com.sipai.entity.evaluation.EvaluationIndexM; -import com.sipai.service.evaluation.EvaluationIndexMService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/IndexM") -public class EvaluationIndexMController { - - @Resource - private EvaluationIndexMService evaluationIndexMService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/indexMList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = evaluationIndexMService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request,Model model){ - return "evaluation/indexMAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EvaluationIndexM evaluationIndexM){ - evaluationIndexM.setId(CommUtil.getUUID()); - evaluationIndexM.setInsdt(CommUtil.nowDate()); - evaluationIndexM.setType("month"); - int res = evaluationIndexMService.save(evaluationIndexM); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam("id") String id){ - EvaluationIndexM evaluationIndexM = evaluationIndexMService.selectById(id); - List evaluationCriterionBacteriologys = - evaluationIndexM.getEvaluationCriterionBacteriologys(); - if(evaluationCriterionBacteriologys != null && evaluationCriterionBacteriologys.size() > 0){ - String ebs = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionBacteriologys){ - ebs += (evaluationCriterion.getCriterionName()+","); - } - ebs = ebs.substring(0, ebs.length()-1); - model.addAttribute("ebs", ebs.replaceAll("\\r|\\n", "")); - } - List evaluationCriterionDisinfectants = - evaluationIndexM.getEvaluationCriterionDisinfectants(); - if(evaluationCriterionDisinfectants != null && evaluationCriterionDisinfectants.size() > 0){ - String eds = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionDisinfectants){ - eds += (evaluationCriterion.getCriterionName()+","); - } - eds = eds.substring(0, eds.length()-1); - model.addAttribute("eds", eds.replaceAll("\\r|\\n", "")); - } - List evaluationCriterionSensoryorgans = - evaluationIndexM.getEvaluationCriterionSensoryorgans(); - if(evaluationCriterionSensoryorgans != null && evaluationCriterionSensoryorgans.size() > 0){ - String ess = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionSensoryorgans){ - ess += (evaluationCriterion.getCriterionName()+","); - } - ess = ess.substring(0, ess.length()-1); - model.addAttribute("ess", ess.replaceAll("\\r|\\n", "")); - } - List evaluationCriterionToxicologys = - evaluationIndexM.getEvaluationCriterionToxicologys(); - if(evaluationCriterionToxicologys != null && evaluationCriterionToxicologys.size() > 0){ - String ets = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionToxicologys){ - ets += (evaluationCriterion.getCriterionName()+","); - } - ets = ets.substring(0, ets.length()-1); - model.addAttribute("ets", ets.replaceAll("\\r|\\n", "")); - } - model.addAttribute("evaluationIndexM", evaluationIndexM); - return "evaluation/indexMEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EvaluationIndexM evaluationIndexM) throws InterruptedException{ - String id = evaluationIndexM.getId(); - evaluationIndexMService.deleteById(id); - Thread.sleep(300); - evaluationIndexM.setType("month"); - int res = evaluationIndexMService.save(evaluationIndexM); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationIndexMService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationIndexMonthController.java b/src/com/sipai/controller/evaluation/EvaluationIndexMonthController.java deleted file mode 100644 index a90540eb..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationIndexMonthController.java +++ /dev/null @@ -1,248 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndex; -import com.sipai.entity.evaluation.EvaluationIndexDay; -import com.sipai.entity.evaluation.EvaluationIndexM; -import com.sipai.entity.evaluation.EvaluationIndexMonth; -import com.sipai.service.evaluation.EvaluationIndexMService; -import com.sipai.service.evaluation.EvaluationIndexMonthService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/indexMonth") -public class EvaluationIndexMonthController { - @Resource - private EvaluationIndexMonthService evaluationIndexMonthService; - @Resource - private EvaluationIndexMService evaluationIndexMService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/indexMonthList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = evaluationIndexMonthService. - selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request,Model model){ - List list = evaluationIndexMService.selectListByWhere - ("where type = 'month' order by insdt desc"); - if(list != null && list.size() > 0){ - EvaluationIndexM evaluationIndexM = list.get(0); - List evaluationCriterionBacteriologys = - evaluationIndexM.getEvaluationCriterionBacteriologys(); - model.addAttribute("evaluationCriterionBacteriologys", evaluationCriterionBacteriologys); - model.addAttribute("ecb", JSONArray.fromObject(evaluationCriterionBacteriologys).toString()); - List evaluationCriterionDisinfectants = - evaluationIndexM.getEvaluationCriterionDisinfectants(); - model.addAttribute("evaluationCriterionDisinfectants", evaluationCriterionDisinfectants); - model.addAttribute("ecd", JSONArray.fromObject(evaluationCriterionDisinfectants).toString()); - List evaluationCriterionSensoryorgans = - evaluationIndexM.getEvaluationCriterionSensoryorgans(); - model.addAttribute("evaluationCriterionSensoryorgans", evaluationCriterionSensoryorgans); - model.addAttribute("ecs", JSONArray.fromObject(evaluationCriterionSensoryorgans).toString()); - List evaluationCriterionToxicologys = - evaluationIndexM.getEvaluationCriterionToxicologys(); - model.addAttribute("evaluationCriterionToxicologys", evaluationCriterionToxicologys); - model.addAttribute("ect", JSONArray.fromObject(evaluationCriterionToxicologys).toString()); - } - model.addAttribute("nowDate", CommUtil.nowDate()); - return "evaluation/indexMonthAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model){ - EvaluationIndexMonth evaluationIndexMonth = new EvaluationIndexMonth(); - evaluationIndexMonth.setId(CommUtil.getUUID()); - evaluationIndexMonth.setInsdt(CommUtil.nowDate()); - String ecb_params = request.getParameter("paramecb"); - String[] arr_ecb = ecb_params.split("&"); - JSONObject jsonObject_ecb = new JSONObject(); - if(arr_ecb.length > 0){ - for(int i = 0; i < arr_ecb.length; i++){ - String key = arr_ecb[i].split("=")[0]; - String value = arr_ecb[i].split("=")[1]; - if("id".equals(key)){ - evaluationIndexMonthService.deleteById(value); - }else if("wqiBacteriologyMonthNation".equals(key)){ - evaluationIndexMonth.setWqiBacteriologyMonthNation(Double.parseDouble(value)); - }else if("wqiBacteriologyMonthArea".equals(key)){ - evaluationIndexMonth.setWqiBacteriologyMonthArea(Double.parseDouble(value)); - }else if("wqiBacteriologyMonthCompany".equals(key)){ - evaluationIndexMonth.setWqiBacteriologyMonthCompany(Double.parseDouble(value)); - }else if("date".equals(key)){ - evaluationIndexMonth.setDate(value+"-01"); - }else{ - if(key.contains("ecb_key_")){ - key = key.replace("ecb_key_", ""); - jsonObject_ecb.put(key, value); - } - } - } - evaluationIndexMonth.setCriterionBacteriologyValue(jsonObject_ecb.toString()); - } - String ecd_params = request.getParameter("paramecd"); - String[] arr_ecd = ecd_params.split("&"); - JSONObject jsonObject_ecd = new JSONObject(); - if(arr_ecd.length > 0){ - for(int i = 0; i < arr_ecd.length; i++){ - String key = arr_ecd[i].split("=")[0]; - String value = arr_ecd[i].split("=")[1]; - if("wqiDisinfectantMonthNation".equals(key)){ - evaluationIndexMonth.setWqiDisinfectantMonthNation(Double.parseDouble(value)); - }else if("wqiDisinfectantMonthArea".equals(key)){ - evaluationIndexMonth.setWqiDisinfectantMonthArea(Double.parseDouble(value)); - }else if("wqiDisinfectantMonthCompany".equals(key)){ - evaluationIndexMonth.setWqiDisinfectantMonthCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ecd_key_")){ - key = key.replace("ecd_key_", ""); - jsonObject_ecd.put(key, value); - } - } - } - evaluationIndexMonth.setCriterionDisinfectantValue(jsonObject_ecd.toString()); - } - String ecs_params = request.getParameter("paramecs"); - String[] arr_ecs = ecs_params.split("&"); - JSONObject jsonObject_ecs = new JSONObject(); - if(arr_ecs.length > 0){ - for(int i = 0; i < arr_ecs.length; i++){ - String key = arr_ecs[i].split("=")[0]; - String value = arr_ecs[i].split("=")[1]; - if("wqiSensoryorganMonthNation".equals(key)){ - evaluationIndexMonth.setWqiSensoryorganMonthNation(Double.parseDouble(value)); - }else if("wqiSensoryorganMonthArea".equals(key)){ - evaluationIndexMonth.setWqiSensoryorganMonthArea(Double.parseDouble(value)); - }else if("wqiSensoryorganMonthCompany".equals(key)){ - evaluationIndexMonth.setWqiSensoryorganMonthCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ecs_key_")){ - key = key.replace("ecs_key_", ""); - jsonObject_ecs.put(key, value); - } - } - } - evaluationIndexMonth.setCriterionSensoryorganValue(jsonObject_ecs.toString()); - } - String ect_params = request.getParameter("paramect"); - String[] arr_ect = ect_params.split("&"); - JSONObject jsonObject_ect = new JSONObject(); - if(arr_ect.length > 0){ - for(int i = 0; i < arr_ect.length; i++){ - String key = arr_ect[i].split("=")[0]; - String value = arr_ect[i].split("=")[1]; - if("wqiToxicologyMonthNation".equals(key)){ - evaluationIndexMonth.setWqiToxicologyMonthNation(Double.parseDouble(value)); - }else if("wqiToxicologyMonthArea".equals(key)){ - evaluationIndexMonth.setWqiToxicologyMonthArea(Double.parseDouble(value)); - }else if("wqiToxicologyMonthCompany".equals(key)){ - evaluationIndexMonth.setWqiToxicologyMonthCompany(Double.parseDouble(value)); - }else if("wqiMonthNation".equals(key)){ - evaluationIndexMonth.setWqiMonthNation(Double.parseDouble(value)); - }else if("wqiMonthArea".equals(key)){ - evaluationIndexMonth.setWqiMonthArea(Double.parseDouble(value)); - }else if("wqiMonthCompany".equals(key)){ - evaluationIndexMonth.setWqiMonthCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ect_key_")){ - key = key.replace("ect_key_", ""); - jsonObject_ect.put(key, value); - } - } - } - evaluationIndexMonth.setCriterionToxicologyValue(jsonObject_ect.toString()); - } - int res = evaluationIndexMonthService.save(evaluationIndexMonth); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam("id") String id){ - EvaluationIndexMonth evaluationIndexMonth = evaluationIndexMonthService.selectById(id); - model.addAttribute("date", evaluationIndexMonth.getDate().substring(0, 7)); - List list = evaluationIndexMService.selectListByWhere - ("where type = 'month' order by insdt desc"); - if(list != null && list.size() > 0){ - EvaluationIndexM evaluationIndexM = list.get(0); - List evaluationCriterionBacteriologys = - evaluationIndexM.getEvaluationCriterionBacteriologys(); - model.addAttribute("evaluationCriterionBacteriologys", evaluationCriterionBacteriologys); - model.addAttribute("ecb", JSONArray.fromObject(evaluationCriterionBacteriologys).toString()); - List evaluationCriterionDisinfectants = - evaluationIndexM.getEvaluationCriterionDisinfectants(); - model.addAttribute("evaluationCriterionDisinfectants", evaluationCriterionDisinfectants); - model.addAttribute("ecd", JSONArray.fromObject(evaluationCriterionDisinfectants).toString()); - List evaluationCriterionSensoryorgans = - evaluationIndexM.getEvaluationCriterionSensoryorgans(); - model.addAttribute("evaluationCriterionSensoryorgans", evaluationCriterionSensoryorgans); - model.addAttribute("ecs", JSONArray.fromObject(evaluationCriterionSensoryorgans).toString()); - List evaluationCriterionToxicologys = - evaluationIndexM.getEvaluationCriterionToxicologys(); - model.addAttribute("evaluationCriterionToxicologys", evaluationCriterionToxicologys); - model.addAttribute("ect", JSONArray.fromObject(evaluationCriterionToxicologys).toString()); - } - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - model.addAttribute("criterionBacteriologyValue", criterionBacteriologyValue); - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - model.addAttribute("criterionDisinfectantValue", criterionDisinfectantValue); - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - model.addAttribute("criterionSensoryorganValue", criterionSensoryorganValue); - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - model.addAttribute("criterionToxicologyValue", criterionToxicologyValue); - model.addAttribute("id", id); - return "evaluation/indexMonthView"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationIndexMonthService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationIndexYController.java b/src/com/sipai/controller/evaluation/EvaluationIndexYController.java deleted file mode 100644 index 18d6c710..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationIndexYController.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndexY; -import com.sipai.service.evaluation.EvaluationIndexYService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/IndexY") -public class EvaluationIndexYController { - - @Resource - private EvaluationIndexYService evaluationIndexYService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/indexYList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = evaluationIndexYService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request,Model model){ - return "evaluation/indexYAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EvaluationIndexY evaluationIndexY){ - evaluationIndexY.setId(CommUtil.getUUID()); - evaluationIndexY.setInsdt(CommUtil.nowDate()); - evaluationIndexY.setType("year"); - int res = evaluationIndexYService.save(evaluationIndexY); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam("id") String id){ - EvaluationIndexY evaluationIndexY = evaluationIndexYService.selectById(id); - List evaluationCriterionBacteriologys = - evaluationIndexY.getEvaluationCriterionBacteriologys(); - if(evaluationCriterionBacteriologys != null && evaluationCriterionBacteriologys.size() > 0){ - String ebs = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionBacteriologys){ - ebs += (evaluationCriterion.getCriterionName()+","); - } - ebs = ebs.substring(0, ebs.length()-1); - model.addAttribute("ebs", ebs.replaceAll("\\r|\\n", "")); - } - List evaluationCriterionDisinfectants = - evaluationIndexY.getEvaluationCriterionDisinfectants(); - if(evaluationCriterionDisinfectants != null && evaluationCriterionDisinfectants.size() > 0){ - String eds = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionDisinfectants){ - eds += (evaluationCriterion.getCriterionName()+","); - } - eds = eds.substring(0, eds.length()-1); - model.addAttribute("eds", eds.replaceAll("\\r|\\n", "")); - } - List evaluationCriterionSensoryorgans = - evaluationIndexY.getEvaluationCriterionSensoryorgans(); - if(evaluationCriterionSensoryorgans != null && evaluationCriterionSensoryorgans.size() > 0){ - String ess = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionSensoryorgans){ - ess += (evaluationCriterion.getCriterionName()+","); - } - ess = ess.substring(0, ess.length()-1); - model.addAttribute("ess", ess.replaceAll("\\r|\\n", "")); - } - List evaluationCriterionToxicologys = - evaluationIndexY.getEvaluationCriterionToxicologys(); - if(evaluationCriterionToxicologys != null && evaluationCriterionToxicologys.size() > 0){ - String ets = ""; - for(EvaluationCriterion evaluationCriterion : evaluationCriterionToxicologys){ - ets += (evaluationCriterion.getCriterionName()+","); - } - ets = ets.substring(0, ets.length()-1); - model.addAttribute("ets", ets.replaceAll("\\r|\\n", "")); - } - List evaluationcriterionOrganics = - evaluationIndexY.getEvaluationcriterionOrganics(); - if(evaluationcriterionOrganics != null && evaluationcriterionOrganics.size() > 0){ - String eos = ""; - for(EvaluationCriterion evaluationCriterion : evaluationcriterionOrganics){ - eos += (evaluationCriterion.getCriterionName()+","); - } - eos = eos.substring(0, eos.length()-1); - model.addAttribute("eos", eos.replaceAll("\\r|\\n", "")); - } - List evaluationcriterionSmells = - evaluationIndexY.getEvaluationcriterionSmells(); - if(evaluationcriterionSmells != null && evaluationcriterionSmells.size() > 0){ - String ems = ""; - for(EvaluationCriterion evaluationCriterion : evaluationcriterionSmells){ - ems += (evaluationCriterion.getCriterionName()+","); - } - ems = ems.substring(0, ems.length()-1); - model.addAttribute("ems", ems.replaceAll("\\r|\\n", "")); - } - List evaluationcriterionDbpss = - evaluationIndexY.getEvaluationcriterionDbpss(); - if(evaluationcriterionDbpss != null && evaluationcriterionDbpss.size() > 0){ - String eps = ""; - for(EvaluationCriterion evaluationCriterion : evaluationcriterionDbpss){ - eps += (evaluationCriterion.getCriterionName()+","); - } - eps = eps.substring(0, eps.length()-1); - model.addAttribute("eps", eps.replaceAll("\\r|\\n", "")); - } - model.addAttribute("evaluationIndexY", evaluationIndexY); - return "evaluation/indexYEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EvaluationIndexY evaluationIndexY) throws InterruptedException{ - String id = evaluationIndexY.getId(); - evaluationIndexYService.deleteById(id); - Thread.sleep(300); - evaluationIndexY.setType("year"); - int res = evaluationIndexYService.save(evaluationIndexY); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationIndexYService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationIndexYearController.java b/src/com/sipai/controller/evaluation/EvaluationIndexYearController.java deleted file mode 100644 index a2dcb120..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationIndexYearController.java +++ /dev/null @@ -1,355 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndexYear; -import com.sipai.entity.evaluation.EvaluationIndexY; -import com.sipai.service.evaluation.EvaluationIndexYService; -import com.sipai.service.evaluation.EvaluationIndexYearService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/evaluation/indexYear") -public class EvaluationIndexYearController { - @Resource - private EvaluationIndexYearService evaluationIndexYearService; - @Resource - private EvaluationIndexYService evaluationIndexYService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "evaluation/indexYearList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1"; - PageHelper.startPage(page, rows); - List list = evaluationIndexYearService. - selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doAdd(HttpServletRequest request,Model model){ - List list = evaluationIndexYService.selectListByWhere - ("where type = 'year' order by insdt desc"); - if(list != null && list.size() > 0){ - EvaluationIndexY evaluationIndexY = list.get(0); - List evaluationCriterionBacteriologys = - evaluationIndexY.getEvaluationCriterionBacteriologys(); - model.addAttribute("evaluationCriterionBacteriologys", evaluationCriterionBacteriologys); - model.addAttribute("ecb", JSONArray.fromObject(evaluationCriterionBacteriologys).toString()); - List evaluationCriterionDisinfectants = - evaluationIndexY.getEvaluationCriterionDisinfectants(); - model.addAttribute("evaluationCriterionDisinfectants", evaluationCriterionDisinfectants); - model.addAttribute("ecd", JSONArray.fromObject(evaluationCriterionDisinfectants).toString()); - List evaluationCriterionSensoryorgans = - evaluationIndexY.getEvaluationCriterionSensoryorgans(); - model.addAttribute("evaluationCriterionSensoryorgans", evaluationCriterionSensoryorgans); - model.addAttribute("ecs", JSONArray.fromObject(evaluationCriterionSensoryorgans).toString()); - List evaluationCriterionToxicologys = - evaluationIndexY.getEvaluationCriterionToxicologys(); - model.addAttribute("evaluationCriterionToxicologys", evaluationCriterionToxicologys); - model.addAttribute("ect", JSONArray.fromObject(evaluationCriterionToxicologys).toString()); - List evaluationcriterionOrganics = - evaluationIndexY.getEvaluationcriterionOrganics(); - model.addAttribute("evaluationcriterionOrganics", evaluationcriterionOrganics); - model.addAttribute("eco", JSONArray.fromObject(evaluationcriterionOrganics).toString()); - List evaluationcriterionSmells = - evaluationIndexY.getEvaluationcriterionSmells(); - model.addAttribute("evaluationcriterionSmells", evaluationcriterionSmells); - model.addAttribute("ecsl", JSONArray.fromObject(evaluationcriterionSmells).toString()); - List evaluationcriterionDbpss = - evaluationIndexY.getEvaluationcriterionDbpss(); - model.addAttribute("evaluationcriterionDbpss", evaluationcriterionDbpss); - model.addAttribute("ecp", JSONArray.fromObject(evaluationcriterionDbpss).toString()); - } - model.addAttribute("nowDate", CommUtil.nowDate()); - return "evaluation/indexYearAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model){ - EvaluationIndexYear evaluationIndexYear = new EvaluationIndexYear(); - evaluationIndexYear.setId(CommUtil.getUUID()); - evaluationIndexYear.setInsdt(CommUtil.nowDate()); - String ecb_params = request.getParameter("paramecb"); - String[] arr_ecb = ecb_params.split("&"); - JSONObject jsonObject_ecb = new JSONObject(); - if(arr_ecb.length > 0){ - for(int i = 0; i < arr_ecb.length; i++){ - String key = arr_ecb[i].split("=")[0]; - String value = arr_ecb[i].split("=")[1]; - if("id".equals(key)){ - evaluationIndexYearService.deleteById(value); - }else if("wqiBacteriologyYearNation".equals(key)){ - evaluationIndexYear.setWqiBacteriologyYearNation(Double.parseDouble(value)); - }else if("wqiBacteriologyYearArea".equals(key)){ - evaluationIndexYear.setWqiBacteriologyYearArea(Double.parseDouble(value)); - }else if("wqiBacteriologyYearCompany".equals(key)){ - evaluationIndexYear.setWqiBacteriologyYearCompany(Double.parseDouble(value)); - }else if("date".equals(key)){ - evaluationIndexYear.setDate(value+"-01-01"); - }else{ - if(key.contains("ecb_key_")){ - key = key.replace("ecb_key_", ""); - jsonObject_ecb.put(key, value); - } - } - } - evaluationIndexYear.setCriterionBacteriologyValue(jsonObject_ecb.toString()); - } - String ecd_params = request.getParameter("paramecd"); - String[] arr_ecd = ecd_params.split("&"); - JSONObject jsonObject_ecd = new JSONObject(); - if(arr_ecd.length > 0){ - for(int i = 0; i < arr_ecd.length; i++){ - String key = arr_ecd[i].split("=")[0]; - String value = arr_ecd[i].split("=")[1]; - if("wqiDisinfectantYearNation".equals(key)){ - evaluationIndexYear.setWqiDisinfectantYearNation(Double.parseDouble(value)); - }else if("wqiDisinfectantYearArea".equals(key)){ - evaluationIndexYear.setWqiDisinfectantYearArea(Double.parseDouble(value)); - }else if("wqiDisinfectantYearCompany".equals(key)){ - evaluationIndexYear.setWqiDisinfectantYearCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ecd_key_")){ - key = key.replace("ecd_key_", ""); - jsonObject_ecd.put(key, value); - } - } - } - evaluationIndexYear.setCriterionDisinfectantValue(jsonObject_ecd.toString()); - } - String ecs_params = request.getParameter("paramecs"); - String[] arr_ecs = ecs_params.split("&"); - JSONObject jsonObject_ecs = new JSONObject(); - if(arr_ecs.length > 0){ - for(int i = 0; i < arr_ecs.length; i++){ - String key = arr_ecs[i].split("=")[0]; - String value = arr_ecs[i].split("=")[1]; - if("wqiSensoryorganYearNation".equals(key)){ - evaluationIndexYear.setWqiSensoryorganYearNation(Double.parseDouble(value)); - }else if("wqiSensoryorganYearArea".equals(key)){ - evaluationIndexYear.setWqiSensoryorganYearArea(Double.parseDouble(value)); - }else if("wqiSensoryorganYearCompany".equals(key)){ - evaluationIndexYear.setWqiSensoryorganYearCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ecs_key_")){ - key = key.replace("ecs_key_", ""); - jsonObject_ecs.put(key, value); - } - } - } - evaluationIndexYear.setCriterionSensoryorganValue(jsonObject_ecs.toString()); - } - String ect_params = request.getParameter("paramect"); - String[] arr_ect = ect_params.split("&"); - JSONObject jsonObject_ect = new JSONObject(); - if(arr_ect.length > 0){ - for(int i = 0; i < arr_ect.length; i++){ - String key = arr_ect[i].split("=")[0]; - String value = arr_ect[i].split("=")[1]; - if("wqiToxicologyYearNation".equals(key)){ - evaluationIndexYear.setWqiToxicologyYearNation(Double.parseDouble(value)); - }else if("wqiToxicologyYearArea".equals(key)){ - evaluationIndexYear.setWqiToxicologyYearArea(Double.parseDouble(value)); - }else if("wqiToxicologyYearCompany".equals(key)){ - evaluationIndexYear.setWqiToxicologyYearCompany(Double.parseDouble(value)); - }else if("wqiBasicYearNation".equals(key)){ - evaluationIndexYear.setWqiBasicYearNation(Double.parseDouble(value)); - }else if("wqiBasicYearArea".equals(key)){ - evaluationIndexYear.setWqiBasicYearArea(Double.parseDouble(value)); - }else if("wqiBasicYearCompany".equals(key)){ - evaluationIndexYear.setWqiBasicYearCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ect_key_")){ - key = key.replace("ect_key_", ""); - jsonObject_ect.put(key, value); - } - } - } - evaluationIndexYear.setCriterionToxicologyValue(jsonObject_ect.toString()); - } - String eco_params = request.getParameter("parameco"); - String[] arr_eco = eco_params.split("&"); - JSONObject jsonObject_eco = new JSONObject(); - if(arr_eco.length > 0){ - for(int i = 0; i < arr_eco.length; i++){ - String key = arr_eco[i].split("=")[0]; - String value = arr_eco[i].split("=")[1]; - if("wqiOrganicYearNation".equals(key)){ - evaluationIndexYear.setWqiOrganicYearNation(Double.parseDouble(value)); - }else if("wqiOrganicYearArea".equals(key)){ - evaluationIndexYear.setWqiOrganicYearArea(Double.parseDouble(value)); - }else if("wqiOrganicYearCompany".equals(key)){ - evaluationIndexYear.setWqiOrganicYearCompany(Double.parseDouble(value)); - }else{ - if(key.contains("eco_key_")){ - key = key.replace("eco_key_", ""); - jsonObject_eco.put(key, value); - } - } - } - evaluationIndexYear.setCriterionOrganicValue(jsonObject_eco.toString()); - } - String ecsl_params = request.getParameter("paramecsl"); - String[] arr_ecsl = ecsl_params.split("&"); - JSONObject jsonObject_ecsl = new JSONObject(); - if(arr_ecsl.length > 0){ - for(int i = 0; i < arr_ecsl.length; i++){ - String key = arr_ecsl[i].split("=")[0]; - String value = arr_ecsl[i].split("=")[1]; - if("wqiSmellYearNation".equals(key)){ - evaluationIndexYear.setWqiSmellYearNation(Double.parseDouble(value)); - }else if("wqiSmellYearArea".equals(key)){ - evaluationIndexYear.setWqiSmellYearArea(Double.parseDouble(value)); - }else if("wqiSmellYearCompany".equals(key)){ - evaluationIndexYear.setWqiSmellYearCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ecsl_key_")){ - key = key.replace("ecsl_key_", ""); - jsonObject_ecsl.put(key, value); - } - } - } - evaluationIndexYear.setCriterionSmellValue(jsonObject_ecsl.toString()); - } - - String ecp_params = request.getParameter("paramecp"); - String[] arr_ecp = ecp_params.split("&"); - JSONObject jsonObject_ecp = new JSONObject(); - if(arr_ecp.length > 0){ - for(int i = 0; i < arr_ecp.length; i++){ - String key = arr_ecp[i].split("=")[0]; - String value = arr_ecp[i].split("=")[1]; - if("wqiDbpsYearNation".equals(key)){ - evaluationIndexYear.setWqiDbpsYearNation(Double.parseDouble(value)); - }else if("wqiDbpsYearArea".equals(key)){ - evaluationIndexYear.setWqiDbpsYearArea(Double.parseDouble(value)); - }else if("wqiDbpsYearCompany".equals(key)){ - evaluationIndexYear.setWqiDbpsYearCompany(Double.parseDouble(value)); - }else if("wqiFeaturesYearNation".equals(key)){ - evaluationIndexYear.setWqiFeaturesYearNation(Double.parseDouble(value)); - }else if("wqiFeaturesYearArea".equals(key)){ - evaluationIndexYear.setWqiFeaturesYearArea(Double.parseDouble(value)); - }else if("wqiFeaturesYearCompany".equals(key)){ - evaluationIndexYear.setWqiFeaturesYearCompany(Double.parseDouble(value)); - }else if("wqiYearNation".equals(key)){ - evaluationIndexYear.setWqiYearNation(Double.parseDouble(value)); - }else if("wqiYearArea".equals(key)){ - evaluationIndexYear.setWqiYearArea(Double.parseDouble(value)); - }else if("wqiYearCompany".equals(key)){ - evaluationIndexYear.setWqiYearCompany(Double.parseDouble(value)); - }else{ - if(key.contains("ecp_key_")){ - key = key.replace("ecp_key_", ""); - jsonObject_ecp.put(key, value); - } - } - } - evaluationIndexYear.setCriterionDbpsValue(jsonObject_ecp.toString()); - } - int res = evaluationIndexYearService.save(evaluationIndexYear); - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam("id") String id){ - EvaluationIndexYear evaluationIndexYear = evaluationIndexYearService.selectById(id); - model.addAttribute("date", evaluationIndexYear.getDate().substring(0, 4)); - List list = evaluationIndexYService.selectListByWhere - ("where type = 'Year' order by insdt desc"); - if(list != null && list.size() > 0){ - EvaluationIndexY evaluationIndexY = list.get(0); - List evaluationCriterionBacteriologys = - evaluationIndexY.getEvaluationCriterionBacteriologys(); - model.addAttribute("evaluationCriterionBacteriologys", evaluationCriterionBacteriologys); - model.addAttribute("ecb", JSONArray.fromObject(evaluationCriterionBacteriologys).toString()); - List evaluationCriterionDisinfectants = - evaluationIndexY.getEvaluationCriterionDisinfectants(); - model.addAttribute("evaluationCriterionDisinfectants", evaluationCriterionDisinfectants); - model.addAttribute("ecd", JSONArray.fromObject(evaluationCriterionDisinfectants).toString()); - List evaluationCriterionSensoryorgans = - evaluationIndexY.getEvaluationCriterionSensoryorgans(); - model.addAttribute("evaluationCriterionSensoryorgans", evaluationCriterionSensoryorgans); - model.addAttribute("ecs", JSONArray.fromObject(evaluationCriterionSensoryorgans).toString()); - List evaluationCriterionToxicologys = - evaluationIndexY.getEvaluationCriterionToxicologys(); - model.addAttribute("evaluationCriterionToxicologys", evaluationCriterionToxicologys); - model.addAttribute("ect", JSONArray.fromObject(evaluationCriterionToxicologys).toString()); - List evaluationcriterionOrganics = - evaluationIndexY.getEvaluationcriterionOrganics(); - model.addAttribute("evaluationcriterionOrganics", evaluationcriterionOrganics); - model.addAttribute("eco", JSONArray.fromObject(evaluationcriterionOrganics).toString()); - List evaluationcriterionSmells = - evaluationIndexY.getEvaluationcriterionSmells(); - model.addAttribute("evaluationcriterionSmells", evaluationcriterionSmells); - model.addAttribute("ecsl", JSONArray.fromObject(evaluationcriterionSmells).toString()); - List evaluationcriterionDbpss = - evaluationIndexY.getEvaluationcriterionDbpss(); - model.addAttribute("evaluationcriterionDbpss", evaluationcriterionDbpss); - model.addAttribute("ecp", JSONArray.fromObject(evaluationcriterionDbpss).toString()); - } - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - model.addAttribute("criterionBacteriologyValue", criterionBacteriologyValue); - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - model.addAttribute("criterionDisinfectantValue", criterionDisinfectantValue); - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - model.addAttribute("criterionSensoryorganValue", criterionSensoryorganValue); - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - model.addAttribute("criterionToxicologyValue", criterionToxicologyValue); - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - model.addAttribute("criterionOrganicValue", criterionOrganicValue); - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - model.addAttribute("criterionSmellValue", criterionSmellValue); - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - model.addAttribute("criterionDbpsValue", criterionDbpsValue); - model.addAttribute("id", id); - return "evaluation/indexYearView"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - this.evaluationIndexYearService.deleteById(idArray[i]); - } - model.addAttribute("result", 1); - return "result"; - } - -} diff --git a/src/com/sipai/controller/evaluation/EvaluationShowController.java b/src/com/sipai/controller/evaluation/EvaluationShowController.java deleted file mode 100644 index b924fc94..00000000 --- a/src/com/sipai/controller/evaluation/EvaluationShowController.java +++ /dev/null @@ -1,6603 +0,0 @@ -package com.sipai.controller.evaluation; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndexDay; -import com.sipai.entity.evaluation.EvaluationIndexMonth; -import com.sipai.entity.evaluation.EvaluationIndexYear; -import com.sipai.service.evaluation.EvaluationCriterionService; -import com.sipai.service.evaluation.EvaluationIndexDayService; -import com.sipai.service.evaluation.EvaluationIndexMonthService; -import com.sipai.service.evaluation.EvaluationIndexYearService; - -@Controller -@RequestMapping("/evaluation/show") -public class EvaluationShowController { - @Resource - private EvaluationIndexDayService evaluationIndexDayService; - @Resource - private EvaluationIndexMonthService evaluationIndexMonthService; - @Resource - private EvaluationIndexYearService evaluationIndexYearService; - @Resource - private EvaluationCriterionService evaluationCriterionService; - - @RequestMapping("/interfaceDisplay.do") - public String interfaceDisplay(HttpServletRequest request,Model model){ - JSONObject jsonObject = new JSONObject(); - PageHelper.startPage(1, 1); - List days = evaluationIndexDayService. - selectListByWhere(" order by date desc"); - List months = evaluationIndexMonthService. - selectListByWhere(" order by date desc"); - List years = evaluationIndexYearService. - selectListByWhere(" order by date desc"); - PageInfo pid = new PageInfo(days); - PageInfo pim = new PageInfo(months); - PageInfo piy = new PageInfo(years); - if(days != null && days.size() > 0){ - jsonObject.put("gb_day", days.get(0).getWqiDayNation()); - jsonObject.put("db_day", days.get(0).getWqiDayArea()); - jsonObject.put("nk_day", days.get(0).getWqiDayCompany()); - }else{ - jsonObject.put("gb_day", 0); - jsonObject.put("db_day", 0); - jsonObject.put("nk_day", 0); - } - if(months != null && months.size() > 0){ - jsonObject.put("gb_month", months.get(0).getWqiMonthNation()); - jsonObject.put("db_month", months.get(0).getWqiMonthArea()); - jsonObject.put("nk_month", months.get(0).getWqiMonthCompany()); - }else{ - jsonObject.put("gb_month", 0); - jsonObject.put("db_month", 0); - jsonObject.put("nk_month", 0); - } - if(years != null && years.size() > 0){ - jsonObject.put("gb_year", years.get(0).getWqiYearNation()); - jsonObject.put("db_year", years.get(0).getWqiYearArea()); - jsonObject.put("nk_year", years.get(0).getWqiYearCompany()); - }else{ - jsonObject.put("gb_year", 0); - jsonObject.put("db_year", 0); - jsonObject.put("nk_year", 0); - } - model.addAttribute("jsonData", jsonObject.toString()); - return "evaluation/interfaceDisplay"; - } - - @SuppressWarnings("rawtypes") - @RequestMapping("/showline.do") - public String showline(HttpServletRequest request,Model model){ - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar c = Calendar.getInstance(); - c.setTime(new Date()); - String type = request.getParameter("type"); - List title = new ArrayList(); - List val = new ArrayList(); - ArrayList> values2 = new ArrayList<>(); - List titles = new ArrayList<>(); - String name = ""; - JSONArray jsonArray = new JSONArray(); - List values = new ArrayList<>(); - String date = ""; - if("gb_day".equals(type)){ - c.add(Calendar.MONTH, -1); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexDayService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 10); - for(EvaluationIndexDay day : days){ - title.add(day.getDate().substring(0, 10)); - val.add(day.getWqiDayNation()); - } - EvaluationIndexDay evaluationIndexDay = days.get(days.size()-1); - String criterionValue = evaluationIndexDay.getCriterionValue(); - JSONObject criterion = JSONObject.fromObject(criterionValue); - Iterator iterator = criterion.keys(); - while(iterator.hasNext()){ - String key = (String)iterator.next(); - double v = criterion.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double gb_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - gb_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - gb_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - gb_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - gb_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - gb_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - gb_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - gb_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - gb_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - gb_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - gb_fzs = (0.85-v) / 0.85 + 1; - }else{ - gb_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - gb_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - gb_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - gb_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - gb_fzs = (0.8-v) / 0.8 + 1; - }else{ - gb_fzs = (v - 2) / 2 + 1; - } - } - }else{ - gb_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(gb_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(gb_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "国家标准日评指数"; - } - if("db_day".equals(type)){ - c.add(Calendar.MONTH, -1); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexDayService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 10); - for(EvaluationIndexDay day : days){ - title.add(day.getDate().substring(0, 10)); - val.add(day.getWqiDayArea()); - } - EvaluationIndexDay evaluationIndexDay = days.get(days.size()-1); - String criterionValue = evaluationIndexDay.getCriterionValue(); - JSONObject criterion = JSONObject.fromObject(criterionValue); - Iterator iterator = criterion.keys(); - while(iterator.hasNext()){ - String key = (String)iterator.next(); - double v = criterion.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double db_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - db_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - db_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - db_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - db_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - db_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - db_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - } - } - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - db_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - db_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - db_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - db_fzs = (0.85-v) / 0.85 + 1; - }else{ - db_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - db_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - db_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - db_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - db_fzs = (0.8-v) / 0.8 + 1; - }else{ - db_fzs = (v - 2) / 2 + 1; - } - } - }else{ - db_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(db_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(db_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "地方标准日评指数"; - } - if("nk_day".equals(type)){ - c.add(Calendar.MONTH, -1); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexDayService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 10); - for(EvaluationIndexDay day : days){ - title.add(day.getDate().substring(0, 10)); - val.add(day.getWqiDayCompany()); - } - EvaluationIndexDay evaluationIndexDay = days.get(days.size()-1); - String criterionValue = evaluationIndexDay.getCriterionValue(); - JSONObject criterion = JSONObject.fromObject(criterionValue); - Iterator iterator = criterion.keys(); - while(iterator.hasNext()){ - String key = (String)iterator.next(); - double v = criterion.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "内控标准日评指数"; - } - if("gb_month".equals(type)){ - c.add(Calendar.MONTH, -12); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexMonthService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 7); - for(EvaluationIndexMonth day : days){ - title.add(day.getDate().substring(0, 7)); - val.add(day.getWqiMonthNation()); - } - EvaluationIndexMonth evaluationIndexMonth = days.get(days.size()-1); - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "国家标准月评指数"; - } - if("db_month".equals(type)){ - c.add(Calendar.MONTH, -12); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexMonthService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 7); - for(EvaluationIndexMonth day : days){ - title.add(day.getDate().substring(0, 7)); - val.add(day.getWqiMonthArea()); - } - EvaluationIndexMonth evaluationIndexMonth = days.get(days.size()-1); - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "地方标准月评指数"; - } - if("nk_month".equals(type)){ - c.add(Calendar.MONTH, -12); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexMonthService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 7); - for(EvaluationIndexMonth day : days){ - title.add(day.getDate().substring(0, 7)); - val.add(day.getWqiMonthCompany()); - } - EvaluationIndexMonth evaluationIndexMonth = days.get(days.size()-1); - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "内控标准月评指数"; - } - if("gb_year".equals(type)){ - c.add(Calendar.YEAR, -10); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexYearService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 4); - for(EvaluationIndexYear day : days){ - title.add(day.getDate().substring(0, 4)); - val.add(day.getWqiYearNation()); - } - EvaluationIndexYear evaluationIndexYear = days.get(days.size()-1); - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - JSONObject criterionOrganic = JSONObject.fromObject(criterionOrganicValue); - Iterator criterionOrganicIterator = criterionOrganic.keys(); - while(criterionOrganicIterator.hasNext()){ - String key = (String)criterionOrganicIterator.next(); - double v = criterionOrganic.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - JSONObject criterionSmell = JSONObject.fromObject(criterionSmellValue); - Iterator criterionSmellIterator = criterionSmell.keys(); - while(criterionSmellIterator.hasNext()){ - String key = (String)criterionSmellIterator.next(); - double v = criterionSmell.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - JSONObject criterionDbps = JSONObject.fromObject(criterionDbpsValue); - Iterator criterionDbpsIterator = criterionDbps.keys(); - while(criterionDbpsIterator.hasNext()){ - String key = (String)criterionDbpsIterator.next(); - double v = criterionDbps.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "国家标准年评指数"; - } - if("db_year".equals(type)){ - c.add(Calendar.YEAR, -10); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexYearService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 4); - for(EvaluationIndexYear day : days){ - title.add(day.getDate().substring(0, 4)); - val.add(day.getWqiYearArea()); - } - EvaluationIndexYear evaluationIndexYear = days.get(days.size()-1); - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - JSONObject criterionOrganic = JSONObject.fromObject(criterionOrganicValue); - Iterator criterionOrganicIterator = criterionOrganic.keys(); - while(criterionOrganicIterator.hasNext()){ - String key = (String)criterionOrganicIterator.next(); - double v = criterionOrganic.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - JSONObject criterionSmell = JSONObject.fromObject(criterionSmellValue); - Iterator criterionSmellIterator = criterionSmell.keys(); - while(criterionSmellIterator.hasNext()){ - String key = (String)criterionSmellIterator.next(); - double v = criterionSmell.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - JSONObject criterionDbps = JSONObject.fromObject(criterionDbpsValue); - Iterator criterionDbpsIterator = criterionDbps.keys(); - while(criterionDbpsIterator.hasNext()){ - String key = (String)criterionDbpsIterator.next(); - double v = criterionDbps.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "地方标准年评指数"; - } - if("nk_year".equals(type)){ - c.add(Calendar.YEAR, -10); - Date m = c.getTime(); - String monbefore = format.format(m); - List days = evaluationIndexYearService. - selectListByWhere("where date > '"+monbefore+"' order by date"); - - if(days != null && days.size() > 0){ - date = days.get(days.size()-1).getDate().substring(0, 4); - for(EvaluationIndexYear day : days){ - title.add(day.getDate().substring(0, 4)); - val.add(day.getWqiYearCompany()); - } - EvaluationIndexYear evaluationIndexYear = days.get(days.size()-1); - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - JSONObject criterionOrganic = JSONObject.fromObject(criterionOrganicValue); - Iterator criterionOrganicIterator = criterionOrganic.keys(); - while(criterionOrganicIterator.hasNext()){ - String key = (String)criterionOrganicIterator.next(); - double v = criterionOrganic.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - JSONObject criterionSmell = JSONObject.fromObject(criterionSmellValue); - Iterator criterionSmellIterator = criterionSmell.keys(); - while(criterionSmellIterator.hasNext()){ - String key = (String)criterionSmellIterator.next(); - double v = criterionSmell.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - JSONObject criterionDbps = JSONObject.fromObject(criterionDbpsValue); - Iterator criterionDbpsIterator = criterionDbps.keys(); - while(criterionDbpsIterator.hasNext()){ - String key = (String)criterionDbpsIterator.next(); - double v = criterionDbps.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - model.addAttribute("values", vjson.toString()); - } - name = "内控标准年评指数"; - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("title", title); - jsonObject.put("val", val); - jsonObject.put("name", name); - model.addAttribute("jsonDate", jsonObject.toString()); - //model.addAttribute("title", title); - //model.addAttribute("val", val); - model.addAttribute("type", type); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("nv", values2); - model.addAttribute("newvaluelist", jsonObject2.toString()); - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("nt", titles); - model.addAttribute("newtitlelist", jsonObject3.toString()); - model.addAttribute("date", date); - return "evaluation/showline"; - } - - @RequestMapping("/getRadar.do") - public String getRadar(HttpServletRequest request,Model model){ - String type = request.getParameter("type"); - String date = request.getParameter("date"); - - JSONArray jsonArray = new JSONArray(); - List values = new ArrayList<>(); - ArrayList> values2 = new ArrayList<>(); - List titles = new ArrayList<>(); - if("gb_day".equals(type)){ - List days = evaluationIndexDayService. - selectListByWhere("where date = '"+date+" 00:00:00' order by date"); - if(days != null && days.size() > 0){ - EvaluationIndexDay evaluationIndexDay = days.get(0); - String criterionValue = evaluationIndexDay.getCriterionValue(); - JSONObject criterion = JSONObject.fromObject(criterionValue); - Iterator iterator = criterion.keys(); - while(iterator.hasNext()){ - String key = (String)iterator.next(); - double v = criterion.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double gb_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - gb_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - gb_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - gb_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - gb_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - gb_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - gb_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - gb_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - gb_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - gb_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - gb_fzs = (0.85-v) / 0.85 + 1; - }else{ - gb_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - gb_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - gb_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - gb_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - gb_fzs = (0.8-v) / 0.8 + 1; - }else{ - gb_fzs = (v - 2) / 2 + 1; - } - } - }else{ - gb_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(gb_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(gb_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - //name = "国家标准日评指数"; - } - if("db_day".equals(type)){ - List days = evaluationIndexDayService. - selectListByWhere("where date = '"+date+" 00:00:00' order by date"); - if(days != null && days.size() > 0){ - EvaluationIndexDay evaluationIndexDay = days.get(0); - String criterionValue = evaluationIndexDay.getCriterionValue(); - JSONObject criterion = JSONObject.fromObject(criterionValue); - Iterator iterator = criterion.keys(); - while(iterator.hasNext()){ - String key = (String)iterator.next(); - double v = criterion.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double db_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - db_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - db_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - db_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - db_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - db_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - db_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - db_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - db_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - db_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - db_fzs = (0.85-v) / 0.85 + 1; - }else{ - db_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - db_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - db_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - db_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - db_fzs = (0.8-v) / 0.8 + 1; - }else{ - db_fzs = (v - 2) / 2 + 1; - } - } - }else{ - db_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(db_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(db_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - //name = "地方标准日评指数"; - } - if("nk_day".equals(type)){ - List days = evaluationIndexDayService. - selectListByWhere("where date = '"+date+" 00:00:00' order by date"); - if(days != null && days.size() > 0){ - EvaluationIndexDay evaluationIndexDay = days.get(0); - String criterionValue = evaluationIndexDay.getCriterionValue(); - JSONObject criterion = JSONObject.fromObject(criterionValue); - Iterator iterator = criterion.keys(); - while(iterator.hasNext()){ - String key = (String)iterator.next(); - double v = criterion.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexDay.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - if("gb_month".equals(type)){ - List days = evaluationIndexMonthService. - selectListByWhere("where date = '"+date+"-01 00:00:00' order by date"); - if(days != null && days.size() > 0){ - EvaluationIndexMonth evaluationIndexMonth = days.get(0); - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - if("db_month".equals(type)){ - List days = evaluationIndexMonthService. - selectListByWhere("where date = '"+date+"-01 00:00:00' order by date"); - - if(days != null && days.size() > 0){ - EvaluationIndexMonth evaluationIndexMonth = days.get(0); - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - if("nk_month".equals(type)){ - List days = evaluationIndexMonthService. - selectListByWhere("where date = '"+date+"-01 00:00:00' order by date"); - if(days != null && days.size() > 0){ - EvaluationIndexMonth evaluationIndexMonth = days.get(0); - String criterionBacteriologyValue = evaluationIndexMonth.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionDisinfectantValue = evaluationIndexMonth.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - } - String criterionSensoryorganValue = evaluationIndexMonth.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionToxicologyValue = evaluationIndexMonth.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexMonth.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - if("gb_year".equals(type)){ - List days = evaluationIndexYearService. - selectListByWhere("where date = '"+date+"-01-01' order by date"); - if(days != null && days.size() > 0){ - EvaluationIndexYear evaluationIndexYear = days.get(0); - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v < evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - JSONObject criterionOrganic = JSONObject.fromObject(criterionOrganicValue); - Iterator criterionOrganicIterator = criterionOrganic.keys(); - while(criterionOrganicIterator.hasNext()){ - String key = (String)criterionOrganicIterator.next(); - double v = criterionOrganic.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - JSONObject criterionSmell = JSONObject.fromObject(criterionSmellValue); - Iterator criterionSmellIterator = criterionSmell.keys(); - while(criterionSmellIterator.hasNext()){ - String key = (String)criterionSmellIterator.next(); - double v = criterionSmell.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - JSONObject criterionDbps = JSONObject.fromObject(criterionDbpsValue); - Iterator criterionDbpsIterator = criterionDbps.keys(); - while(criterionDbpsIterator.hasNext()){ - String key = (String)criterionDbpsIterator.next(); - double v = criterionDbps.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getNationCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getNationCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getNationCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getNationCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getNationCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getNationCriterionMin() - & v < evaluationCriterion.getNationCriterionMax())?0 - :(v < evaluationCriterion.getNationCriterionMin() ? - ((evaluationCriterion.getNationCriterionMin()-v)/evaluationCriterion.getNationCriterionMin()+1) - :((v-evaluationCriterion.getNationCriterionMax())/evaluationCriterion.getNationCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - if("db_year".equals(type)){ - List days = evaluationIndexYearService. - selectListByWhere("where date = '"+date+"-01-01 00:00:00' order by date"); - - if(days != null && days.size() > 0){ - EvaluationIndexYear evaluationIndexYear = days.get(0); - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - JSONObject criterionOrganic = JSONObject.fromObject(criterionOrganicValue); - Iterator criterionOrganicIterator = criterionOrganic.keys(); - while(criterionOrganicIterator.hasNext()){ - String key = (String)criterionOrganicIterator.next(); - double v = criterionOrganic.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - JSONObject criterionSmell = JSONObject.fromObject(criterionSmellValue); - Iterator criterionSmellIterator = criterionSmell.keys(); - while(criterionSmellIterator.hasNext()){ - String key = (String)criterionSmellIterator.next(); - double v = criterionSmell.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - JSONObject criterionDbps = JSONObject.fromObject(criterionDbpsValue); - Iterator criterionDbpsIterator = criterionDbps.keys(); - while(criterionDbpsIterator.hasNext()){ - String key = (String)criterionDbpsIterator.next(); - double v = criterionDbps.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getAreaCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getAreaCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getAreaCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getAreaCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getAreaCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getAreaCriterionMin() - & v < evaluationCriterion.getAreaCriterionMax())?0 - :(v < evaluationCriterion.getAreaCriterionMin() ? - ((evaluationCriterion.getAreaCriterionMin()-v)/evaluationCriterion.getAreaCriterionMin()+1) - :((v-evaluationCriterion.getAreaCriterionMax())/evaluationCriterion.getAreaCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - if("nk_year".equals(type)){ - List days = evaluationIndexYearService. - selectListByWhere("where date = '"+date+"-01-01 00:00:00' order by date"); - - if(days != null && days.size() > 0){ - EvaluationIndexYear evaluationIndexYear = days.get(0); - String criterionBacteriologyValue = evaluationIndexYear.getCriterionBacteriologyValue(); - JSONObject criterionBacteriology = JSONObject.fromObject(criterionBacteriologyValue); - Iterator criterionBacteriologyIterator = criterionBacteriology.keys(); - while(criterionBacteriologyIterator.hasNext()){ - String key = (String)criterionBacteriologyIterator.next(); - double v = criterionBacteriology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionDisinfectantValue = evaluationIndexYear.getCriterionDisinfectantValue(); - JSONObject criterionDisinfectant = JSONObject.fromObject(criterionDisinfectantValue); - Iterator criterionDisinfectantIterator = criterionDisinfectant.keys(); - while(criterionDisinfectantIterator.hasNext()){ - String key = (String)criterionDisinfectantIterator.next(); - double v = criterionDisinfectant.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionSensoryorganValue = evaluationIndexYear.getCriterionSensoryorganValue(); - JSONObject criterionSensoryorgan = JSONObject.fromObject(criterionSensoryorganValue); - Iterator criterionSensoryorganIterator = criterionSensoryorgan.keys(); - while(criterionSensoryorganIterator.hasNext()){ - String key = (String)criterionSensoryorganIterator.next(); - double v = criterionSensoryorgan.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionToxicologyValue = evaluationIndexYear.getCriterionToxicologyValue(); - JSONObject criterionToxicology = JSONObject.fromObject(criterionToxicologyValue); - Iterator criterionToxicologyIterator = criterionToxicology.keys(); - while(criterionToxicologyIterator.hasNext()){ - String key = (String)criterionToxicologyIterator.next(); - double v = criterionToxicology.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionOrganicValue = evaluationIndexYear.getCriterionOrganicValue(); - JSONObject criterionOrganic = JSONObject.fromObject(criterionOrganicValue); - Iterator criterionOrganicIterator = criterionOrganic.keys(); - while(criterionOrganicIterator.hasNext()){ - String key = (String)criterionOrganicIterator.next(); - double v = criterionOrganic.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionSmellValue = evaluationIndexYear.getCriterionSmellValue(); - JSONObject criterionSmell = JSONObject.fromObject(criterionSmellValue); - Iterator criterionSmellIterator = criterionSmell.keys(); - while(criterionSmellIterator.hasNext()){ - String key = (String)criterionSmellIterator.next(); - double v = criterionSmell.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v <= evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - String criterionDbpsValue = evaluationIndexYear.getCriterionDbpsValue(); - JSONObject criterionDbps = JSONObject.fromObject(criterionDbpsValue); - Iterator criterionDbpsIterator = criterionDbps.keys(); - while(criterionDbpsIterator.hasNext()){ - String key = (String)criterionDbpsIterator.next(); - double v = criterionDbps.getDouble(key); - EvaluationCriterion evaluationCriterion = evaluationCriterionService - .selectById(key); - if(evaluationCriterion != null){ - double nk_fzs = 0; - if("1".equals(evaluationCriterion.getCondition()) || - "2".equals(evaluationCriterion.getCondition())){ - if(evaluationCriterion.getCriterionName().equals("总大肠菌群") || - evaluationCriterion.getCriterionName().equals("耐热大肠菌群") || - evaluationCriterion.getCriterionName().equals("大肠埃希氏菌")){ - nk_fzs = v > 0 ? (1 + 0.5*(v-1)) : 0.1; - }else if(evaluationCriterion.getCriterionName().equals("肉眼可见物")){ - nk_fzs = v > 0 ? 1.5 : 0.1; - }else{ - if(evaluationCriterion.getCompanyCriterionValue()<=0){ - nk_fzs= v>0?v:0; - }else{ - if(evaluationCriterion.getIsSeries()){ - nk_fzs = v; - }else{ - if(evaluationCriterion.getDetectionLimit() != null){ - nk_fzs = v < evaluationCriterion.getDetectionLimit()? - 0.1 : ( v / evaluationCriterion.getCompanyCriterionValue() < 0.1 ? - 0.1 : v / evaluationCriterion.getCompanyCriterionValue()); - }else{ - nk_fzs = (v / evaluationCriterion.getCompanyCriterionValue()) - < 0.1 ? 0.1 : (v / evaluationCriterion.getCompanyCriterionValue()); - } - } - - } - } - - }else{ - if(evaluationCriterion.getCriterionName().equals("总氯")){ - if(Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) > 4 && - Double.parseDouble(evaluationIndexYear.getDate().substring(5, 7)) < 10){ - if(v > 0.85 && v < 1.25){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.85){ - nk_fzs = (0.85-v) / (0.85-0.6); - }else if(v >= 1.25 && v <= 2){ - nk_fzs = (v-1.25) / (2-1.25); - }else if(v < 0.6){ - nk_fzs = (0.85-v) / 0.85 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - }else{ - if(v > 0.8 && v < 1.2){ - nk_fzs = 0; - }else if(v >= 0.6 && v <= 0.8){ - nk_fzs = (0.8-v) / (0.8-0.6); - }else if(v >= 1.2 && v <= 2){ - nk_fzs = (v-1.2) / (2-1.2); - }else if(v < 0.6){ - nk_fzs = (0.8-v) / 0.8 + 1; - }else{ - nk_fzs = (v - 2) / 2 + 1; - } - } - }else{ - nk_fzs = (v > evaluationCriterion.getCompanyCriterionMin() - & v < evaluationCriterion.getCompanyCriterionMax())?0 - :(v < evaluationCriterion.getCompanyCriterionMin() ? - ((evaluationCriterion.getCompanyCriterionMin()-v)/evaluationCriterion.getCompanyCriterionMin()+1) - :((v-evaluationCriterion.getCompanyCriterionMax())/evaluationCriterion.getCompanyCriterionMax()+1)); - } - - } - JSONObject jObject = new JSONObject(); - jObject.put("text", evaluationCriterion.getCriterionName()); - jObject.put("max", 1); - jsonArray.add(jObject); - values.add(nk_fzs); - List list = new ArrayList<>(); - list.add((double) 0); - list.add(nk_fzs); - values2.add(list); - titles.add(evaluationCriterion.getCriterionName()); - } - - } - //model.addAttribute("title_radar", jsonArray.toString()); - JSONObject vjson = new JSONObject(); - vjson.put("vj", values); - //model.addAttribute("values", vjson.toString()); - } - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("title_radar", jsonArray); - JSONObject jsonforRadarNew = new JSONObject(); - jsonforRadarNew.put("nv", values2); - JSONObject jsonforRadarNewTitle = new JSONObject(); - jsonforRadarNewTitle.put("nt", titles); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("vj", values); - jsonObject.put("vj", jsonObject2); - jsonObject.put("nv", jsonforRadarNew); - jsonObject.put("nt", jsonforRadarNewTitle); - model.addAttribute("result", jsonObject.toString()); - return "result"; - } - - @RequestMapping("/showRadar.do") - public String showRadar(HttpServletRequest request,Model model){ - String nv = request.getParameter("nv"); - String nt = request.getParameter("nt"); - String date = request.getParameter("date"); - model.addAttribute("nv", nv); - model.addAttribute("nt", nt); - model.addAttribute("date", date); - return "evaluation/showRadar"; - } -} diff --git a/src/com/sipai/controller/exam/DaytestRecordController.java b/src/com/sipai/controller/exam/DaytestRecordController.java deleted file mode 100644 index ef04eca4..00000000 --- a/src/com/sipai/controller/exam/DaytestRecordController.java +++ /dev/null @@ -1,555 +0,0 @@ -package com.sipai.controller.exam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.exam.DaytestPaper; -import com.sipai.entity.exam.DaytestQuesOption; -import com.sipai.entity.exam.DaytestRecord; -import com.sipai.entity.question.QuesOption; -import com.sipai.entity.question.QuesTitle; -import com.sipai.entity.question.QuestType; -import com.sipai.entity.question.Subjecttype; -import com.sipai.entity.user.User; -import com.sipai.service.exam.DaytestPaperService; -import com.sipai.service.exam.DaytestQuesOptionService; -import com.sipai.service.exam.DaytestRecordService; -import com.sipai.service.question.QuesOptionService; -import com.sipai.service.question.QuesTitleService; -import com.sipai.service.question.QuestTypeService; -import com.sipai.service.question.SubjecttypeService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -@Controller -@RequestMapping("/exam/daytestrecord") -public class DaytestRecordController { - @Resource - private DaytestRecordService daytestRecordService; - @Resource - private DaytestPaperService daytestPaperService; - @Resource - private DaytestQuesOptionService daytestQuesOptionService; - @Resource - private QuestTypeService questTypeService; - @Resource - private QuesTitleService quesTitleService; - @Resource - private QuesOptionService quesOptionService; - @Resource - private SubjecttypeService subjecttypeService; - - - @RequestMapping("/questionnaire.do") - public String questionnaire(HttpServletRequest request,Model model){ - return "exam/questionnaire"; - } - - @RequestMapping("/dodaytest.do") - public String dodaytest(HttpServletRequest request,Model model){ - return "exam/dodaytest"; - } - - - @RequestMapping("/showTableList.do") - public String showTableList(HttpServletRequest request,Model model){ - return "exam/daytestRecordTableList"; - } - - @RequestMapping(value = "getdaytestTableList.do") - public ModelAndView getdaytestTableList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr = " where 1=1 and examuserid = '"+cu.getId()+"' and type !='课程练习'"; - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - - String orderstr=" order by examstarttime desc"; - - PageHelper.startPage(page, rows); - List list = this.daytestRecordService.selectListByWhere(wherestr+orderstr); - - List newjson = new ArrayList(); - if(list!=null && list.size()>0){ - for(int i=0;i paperlistall = this.daytestPaperService.selectListByWhere("where daytestrecordid='"+list.get(i).getId()+"'"); - List paperlistright = this.daytestPaperService.selectListByWhere("where daytestrecordid='"+list.get(i).getId()+"' and status='正确'"); - - if(paperlistall!=null && paperlistall.size()>0){ - jsonobject.put("allcount", paperlistall.size()); - }else{ - jsonobject.put("allcount", 0); - } - if(paperlistright!=null && paperlistright.size()>0){ - jsonobject.put("rightcount", paperlistright.size()); - }else{ - jsonobject.put("rightcount", 0); - } - - newjson.add(jsonobject); - } - } - - - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(newjson); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - //每日一练抽题 - @RequestMapping("/publishdaytest.do") - public String publishdaytest(HttpServletRequest request,Model model, - @ModelAttribute("daytestRecord") DaytestRecord daytestRecord){ - User cu=(User)request.getSession().getAttribute("cu"); - String daytestRecordid = CommUtil.getUUID(); - String nowDate = CommUtil.nowDate(); - - daytestRecord.setId(daytestRecordid); - daytestRecord.setInsdt(nowDate); - daytestRecord.setInsuser(cu.getId()); - daytestRecord.setExamuserid(cu.getId()); - daytestRecord.setExamstarttime(nowDate); - String type = request.getParameter("type"); - if(type!=null && !"".equals(type)){ - - }else{ - type ="普通模式"; - } - daytestRecord.setType(type); - String subjecttypeids = request.getParameter("subjecttypeids"); - if(subjecttypeids!=null && !"".equals(subjecttypeids)){ - - }else{ - List subjecttypeList = this.subjecttypeService.selectListByWhere("where st='启用' order by ord "); - if (subjecttypeList!=null && subjecttypeList.size()>0){ - subjecttypeids = subjecttypeList.get(0).getId(); - } - } - daytestRecord.setSubjecttypeids(subjecttypeids); - int res = this.daytestRecordService.save(daytestRecord); - - String result = ""; - - try { - this.daytestRecordService.daytestnormal(daytestRecordid,cu.getId(),nowDate); - } catch (Exception e) { - e.printStackTrace(); - result = "{\"res\":"+0+",\"daytestRecordid\":\""+daytestRecordid+"\"}"; - model.addAttribute("result", result); - return "result"; - } - result = "{\"res\":"+1+",\"daytestRecordid\":\""+daytestRecordid+"\"}"; - model.addAttribute("result", result); - return "result"; - } - //生成调查问卷页面 - @RequestMapping("/questionnairepaper.do") - public String questionnairepaper(HttpServletRequest request,Model model){ - String daytestrecordid = request.getParameter("daytestrecordid"); - int quesnum = 1; - List daytestpaperlist = this.daytestPaperService.selectListByWhere(" where daytestrecordid = '"+daytestrecordid+"' order by ord"); - - - if(daytestpaperlist != null && daytestpaperlist.size()>0){ - - //查题型 - List questtypelist = this.questTypeService.selectListByWhere("where id='"+daytestpaperlist.get(0).getQuestypeid()+"'"); - request.setAttribute("questypename", questtypelist.get(0).getName()); - - //查题目+序号+解析 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+daytestpaperlist.get(0).getQuestitleid()+"'"); - request.setAttribute("questitle", questitlelist.get(0).getQuesdescript()); - request.setAttribute("quesnum", daytestpaperlist.get(0).getOrd()); - request.setAttribute("analysis", questitlelist.get(0).getAnalysis()); - - - //查正确答案 - List Testquesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+daytestpaperlist.get(0).getQuestitleid()+"' and optionvalue='T' order by ord"); - String rightanswer = ""; - if(Testquesoptionlist!=null && Testquesoptionlist.size()>0){ - for(int v=0;v daytestquesoptionlist = this.daytestQuesOptionService.selectListByWhere("where daytestpaperid='"+daytestpaperlist.get(0).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(daytestquesoptionlist != null && daytestquesoptionlist.size()>0){ - - for (int i = 0; i < daytestquesoptionlist.size(); i++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+daytestquesoptionlist.get(i).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionx", options.get(0).getOptionnumber()); - optionlist.add(jsonoption); - } - } - } - request.setAttribute("quesoptionlist", optionlist); - request.setAttribute("quesallcount", daytestpaperlist.size()); - } - - request.setAttribute("quesnum", quesnum); - request.setAttribute("daytestrecordid", daytestrecordid); - request.setAttribute("quesid", daytestpaperlist.get(0).getId()); - return "exam/questionnairepaper"; - } - //生成每日一练页面 - @RequestMapping("/daytestpaper.do") - public String doExam(HttpServletRequest request,Model model){ - String daytestrecordid = request.getParameter("daytestrecordid"); - int quesnum = 1; - List daytestpaperlist = this.daytestPaperService.selectListByWhere(" where daytestrecordid = '"+daytestrecordid+"' order by ord"); - - - if(daytestpaperlist != null && daytestpaperlist.size()>0){ - - //查题型 - List questtypelist = this.questTypeService.selectListByWhere("where id='"+daytestpaperlist.get(0).getQuestypeid()+"'"); - request.setAttribute("questypename", questtypelist.get(0).getName()); - - //查题目+序号+解析 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+daytestpaperlist.get(0).getQuestitleid()+"'"); - request.setAttribute("questitle", questitlelist.get(0).getQuesdescript()); - request.setAttribute("quesnum", daytestpaperlist.get(0).getOrd()); - request.setAttribute("analysis", questitlelist.get(0).getAnalysis()); - - - //查正确答案 - List Testquesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+daytestpaperlist.get(0).getQuestitleid()+"' and optionvalue='T' order by ord"); - String rightanswer = ""; - if(Testquesoptionlist!=null && Testquesoptionlist.size()>0){ - for(int v=0;v daytestquesoptionlist = this.daytestQuesOptionService.selectListByWhere("where daytestpaperid='"+daytestpaperlist.get(0).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(daytestquesoptionlist != null && daytestquesoptionlist.size()>0){ - - for (int i = 0; i < daytestquesoptionlist.size(); i++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+daytestquesoptionlist.get(i).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionx", options.get(0).getOptionnumber()); - optionlist.add(jsonoption); - } - } - } - request.setAttribute("quesoptionlist", optionlist); - request.setAttribute("quesallcount", daytestpaperlist.size()); - } - - request.setAttribute("quesnum", quesnum); - request.setAttribute("daytestrecordid", daytestrecordid); - request.setAttribute("quesid", daytestpaperlist.get(0).getId()); - return "exam/daytestpaper"; - } - - - //保存用户答案并判断对错 - @RequestMapping("/dosaveanswer.do") - public String dosaveanswer(HttpServletRequest request,Model model){ - String quesid = request.getParameter("quesid"); - String useranswer = request.getParameter("useranswer"); - String questype = request.getParameter("questype"); - - String st = ""; - List daytestpaperlist = this.daytestPaperService.selectListByWhere("where id='"+quesid+"'"); - //根据题型判断对错 - if(questype.equals("填空题")){ - //先去查询正确答案的id,按顺序拼起来 - //先判断下中文逗号 - useranswer = useranswer.replace(",",","); - if(daytestpaperlist!=null && daytestpaperlist.size() >0){ - List quesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+daytestpaperlist.get(0).getQuestitleid()+"' order by ord asc"); - if(quesoptionlist!=null && quesoptionlist.size()>0){ - String rightanswer = ""; - for(int i = 0;i0){ - if(daytestpaperlist.get(0).getAnswervalue().equals(useranswer)){ - st = "正确"; - }else{ - st = "错误"; - } - } - }else if(questype.equals("多选题")){ - if(daytestpaperlist!=null && daytestpaperlist.size() >0){ - String[] useranswerlist = useranswer.split(","); - String[] answervaluelist = daytestpaperlist.get(0).getAnswervalue().split(","); - if (Arrays.equals(useranswerlist, answervaluelist)) { - st = "正确"; - }else{ - st = "错误"; - } - } - - } - - //更新testpaper表 - DaytestPaper daytestPaper = this.daytestPaperService.selectById(quesid); - String Upsuser = ""; - User cu=(User)request.getSession().getAttribute("cu"); - if(cu!=null ){ - Upsuser =cu.getId(); - }else{ - Upsuser = request.getParameter("visitorsID"); - } - daytestPaper.setUpsuser(Upsuser); - daytestPaper.setUpsdt(CommUtil.nowDate()); - daytestPaper.setUseranswer(useranswer); - daytestPaper.setStatus(st); - int result = this.daytestPaperService.update(daytestPaper); - - return "result"; - } - - @RequestMapping("/dodaytesthtml.do") - public String dodaytesthtml(HttpServletRequest request,Model model){ - String result=""; - String daytestrecordid = request.getParameter("daytestrecordid"); - String quesnum = request.getParameter("quesnum"); - - - String switchtype = request.getParameter("switchtype");//切换类型 上一个:prev/下一个:next - String wherestr = ""; - String orderstr = ""; - if(switchtype!=null && !switchtype.equals("")){ - if(switchtype.equals("prev")){ - wherestr +=" and ord<"+quesnum+" "; - orderstr +=" order by ord desc"; - } - if(switchtype.equals("next")){ - wherestr +=" and ord>"+quesnum+" "; - orderstr +=" order by ord asc"; - } - } - List daytestpaperlist = this.daytestPaperService.selectListByWhere(" where daytestrecordid = '"+daytestrecordid+"' "+wherestr+orderstr); - if(daytestpaperlist != null && daytestpaperlist.size()>0){ - //查题目 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+daytestpaperlist.get(0).getQuestitleid()+"'"); - - //查正确答案 - List Testquesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+daytestpaperlist.get(0).getQuestitleid()+"' and optionvalue='T' order by ord"); - String rightanswer = ""; - if(Testquesoptionlist!=null && Testquesoptionlist.size()>0){ - for(int v=0;v daytestquesoptionlist = this.daytestQuesOptionService.selectListByWhere("where daytestpaperid='"+daytestpaperlist.get(0).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(daytestquesoptionlist != null && daytestquesoptionlist.size()>0){ - - for (int i = 0; i < daytestquesoptionlist.size(); i++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+daytestquesoptionlist.get(i).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionx", options.get(0).getOptionnumber()); - optionlist.add(jsonoption); - } - } - } - // 查题型 - List questtypelist = this.questTypeService.selectListByWhere("where id='"+questitlelist.get(0).getQuesttypeid()+"'"); - JSONArray json = JSONArray.fromObject(optionlist); - result = "{\"quesnum\":"+daytestpaperlist.get(0).getOrd()+",\"quesid\":\""+daytestpaperlist.get(0).getId()+"\",\"questype\":\""+questtypelist.get(0).getName()+ - "\",\"useranswer\":\""+daytestpaperlist.get(0).getUseranswer()+"\",\"quesdescript\":\""+questitlelist.get(0).getQuesdescript()+ - "\",\"analysis\":\""+questitlelist.get(0).getAnalysis()+"\",\"rightanswer\":\""+rightanswer+"\",\"rows\":"+json+"}"; -// System.out.println(result); - if(questitlelist != null && questitlelist.size()>0){ - request.setAttribute("questitlelist", questitlelist.get(0)); - - }else{ - request.setAttribute("questitlelist", null); - - } - request.setAttribute("quesoptionlist", optionlist); - request.setAttribute("questitlenum", daytestpaperlist.size()); - model.addAttribute("result", result); - }else{ - if(switchtype.equals("prev")){ - request.setAttribute("result",1); - }else{ - request.setAttribute("result",2); - } - - } - request.setAttribute("quesnum", quesnum); - request.setAttribute("daytestrecordid", daytestrecordid); - -// return "exam/exampaperhtml"; - - return "result"; - } - - //生成每日一练题目解析 - @RequestMapping("/openanalysis.do") - public String openanalysis(HttpServletRequest request,Model model){ - String daytestrecordid = request.getParameter("daytestrecordid"); - int numcount = 0; - int rightnum = 0; - int errornum = 0; - //按顺序查出所有题目 - List daytestpaperlist = this.daytestPaperService.selectListByWhere(" where daytestrecordid = '"+daytestrecordid+"' order by ord"); - //循环出所有题 - List titlelist = new ArrayList(); - if(daytestpaperlist != null && daytestpaperlist.size()>0){ - for(int i=0;i questtypelist = this.questTypeService.selectListByWhere("where id='"+daytestpaperlist.get(i).getQuestypeid()+"'"); - if(questtypelist!=null && questtypelist.size()>0){ - titlejson.put("questypename", questtypelist.get(0).getName()); - }else{ - titlejson.put("questypename", ""); - } - //查题目+序号+解析+考生回答+正确情况+正确答案 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+daytestpaperlist.get(i).getQuestitleid()+"'"); - titlejson.put("quesnum", daytestpaperlist.get(i).getOrd()); - titlejson.put("status", daytestpaperlist.get(i).getStatus()); - if(questitlelist!=null && questitlelist.size()>0){ - titlejson.put("questitle", questitlelist.get(0).getQuesdescript()); - titlejson.put("analysis", questitlelist.get(0).getAnalysis()); - }else{ - titlejson.put("questitle", ""); - titlejson.put("analysis", ""); - } - - if(questtypelist.get(0).getName().equals("填空题")){ - titlejson.put("useranswer", daytestpaperlist.get(i).getUseranswer()); - }else if(questtypelist.get(0).getName().equals("判断题") || questtypelist.get(0).getName().equals("单选题")){ - if(daytestpaperlist.get(i).getUseranswer()!=null && !daytestpaperlist.get(i).getUseranswer().equals("")){ - List options = this.quesOptionService.selectListByWhere("where id='"+daytestpaperlist.get(i).getUseranswer()+"'"); - if(options!=null && options.size()>0){ - titlejson.put("useranswer", options.get(0).getOptioncontent()); - }else{ - titlejson.put("useranswer", ""); - } - }else{ - titlejson.put("useranswer", ""); - } - }else if(questtypelist.get(0).getName().equals("多选题")){ - if(daytestpaperlist.get(i).getUseranswer()!=null && !daytestpaperlist.get(i).getUseranswer().equals("")){ - String[] useranswerlist = daytestpaperlist.get(i).getUseranswer().split(","); - for(int ul=0;ul options = this.quesOptionService.selectListByWhere("where id='"+useranswerlist[ul]+"'"); - if(options!=null && options.size()>0){ - titlejson.put("useranswer", options.get(0).getOptioncontent()); - } - } - }else{ - titlejson.put("useranswer", ""); - } - - } - //查正确答案 - List Testquesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+daytestpaperlist.get(i).getQuestitleid()+"' and optionvalue='T' order by ord"); - String rightanswer = ""; - if(Testquesoptionlist!=null && Testquesoptionlist.size()>0){ - for(int v=0;v daytestquesoptionlist = this.daytestQuesOptionService.selectListByWhere("where daytestpaperid='"+daytestpaperlist.get(i).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(daytestquesoptionlist != null && daytestquesoptionlist.size()>0){ - - for (int j = 0; j < daytestquesoptionlist.size(); j++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+daytestquesoptionlist.get(j).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionvalue", options.get(0).getOptionvalue()); - optionlist.add(jsonoption); - } - - } - - }//选项结束 - titlejson.put("optionlist", optionlist); - - titlelist.add(titlejson); - - } - numcount=daytestpaperlist.size(); - } - //查一共有多少题,做对几道,做错几道 - - List rightlist = this.daytestPaperService.selectListByWhere(" where daytestrecordid = '"+daytestrecordid+"' and status='正确' order by ord"); - if(rightlist!=null && rightlist.size()>0){ - rightnum = rightlist.size(); - } - List errorlist = this.daytestPaperService.selectListByWhere(" where daytestrecordid = '"+daytestrecordid+"' and status='错误' order by ord"); - if(errorlist!=null && errorlist.size()>0){ - errornum = errorlist.size(); - } - - //返回全部数据 - request.setAttribute("numcount", numcount); - request.setAttribute("rightnum", rightnum); - request.setAttribute("errornum", errornum); - request.setAttribute("titlelist", titlelist); -// System.out.println(titlelist); - - return "exam/openanalysis"; - } - -} diff --git a/src/com/sipai/controller/exam/ExamPlanController.java b/src/com/sipai/controller/exam/ExamPlanController.java deleted file mode 100644 index 6e09f8b2..00000000 --- a/src/com/sipai/controller/exam/ExamPlanController.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.sipai.controller.exam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.exam.ExamPlan; -import com.sipai.entity.exam.ExamTitleRange; -import com.sipai.entity.user.User; -import com.sipai.service.exam.ExamPlanService; -import com.sipai.service.exam.ExamRecordService; -import com.sipai.service.exam.ExamTitleRangeService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/exam/examplan") -public class ExamPlanController { - @Resource - private ExamPlanService examPlanService; - @Resource - private ExamRecordService examRecordService; - @Resource - private UserService userService; - @Resource - private ExamTitleRangeService examTitleRangeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "exam/examPlanList"; - } - - @RequestMapping(value = "getExamPlanList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String wherestr = " where 1=1 "; - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - - String orderstr=" order by "+sort+" "+order; - - PageHelper.startPage(page, rows); - List list = this.examPlanService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showExamPlanAdd.do") - public String doadd(HttpServletRequest request,Model model){ - return "exam/examPlanAdd"; - } - - @RequestMapping("/saveExamPlan.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("examPlan") ExamPlan examPlan){ - User cu=(User)request.getSession().getAttribute("cu"); - examPlan.setId(CommUtil.getUUID()); - examPlan.setInsdt(CommUtil.nowDate()); - examPlan.setInsuser(cu.getId()); - if(examPlan.getExamtype().equals("正式考试")){ - examPlan.setFrequency("一次"); - } - examPlan.setStatus("未发布"); - int res = this.examPlanService.save(examPlan); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showExamPlanEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - ExamPlan examPlan = this.examPlanService.selectById(id); - String _auditMan=""; - String examuserids = examPlan.getExamuserids(); - examuserids=examuserids.replace(",","','"); - List list = this.userService.selectListByWhere("where id in ('"+examuserids+"')"); - for (int i = 0; i < list.size(); i++) { - _auditMan+=list.get(i).getCaption(); - if(i!=(list.size()-1)){ - _auditMan+=","; - } - } - model.addAttribute("examPlan",examPlan ); - model.addAttribute("_auditMan",_auditMan ); - return "exam/examPlanEdit"; - } - - @RequestMapping("/updateExamPlan.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("examPlan") ExamPlan examPlan){ - User cu=(User)request.getSession().getAttribute("cu"); - examPlan.setUpsdt(CommUtil.nowDate()); - examPlan.setUpsuser(cu.getId()); - examPlan.setInsuser(cu.getId()); - if(examPlan.getExamtype().equals("正式考试")){ - examPlan.setFrequency("一次"); - } - int res = this.examPlanService.update(examPlan); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteExamPlan.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.examPlanService.deleteById(id); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteExamPlans.do") - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.examPlanService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",code); - return new ModelAndView("result"); - } - - @RequestMapping("/publishExamPlan.do") - public ModelAndView publishExamPlan(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - User cu=(User)request.getSession().getAttribute("cu"); - String nowDate = CommUtil.nowDate(); - - try { -// Thread.sleep(3000); - this.examPlanService.publishExamPlan(id,cu.getId(),nowDate); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("result",0); - return new ModelAndView("result"); - } - model.addAttribute("result",1); - return new ModelAndView("result"); - } - - @RequestMapping("/checkpublishstate.do") - public String checkpublishstate(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String result=""; - ExamPlan examPlan = this.examPlanService.selectById(id); - String examuserids = examPlan.getExamuserids(); - if(examuserids==null || examuserids.equals("")){ - result = "1"; - } - List list = this.examTitleRangeService.selectListByWhere("where pid ='"+examPlan.getId()+"'"); - if(list==null || list.size()==0){ - result = "0"; - }else{ - for(int i=0;i list = this.examRecordService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/showTableListall.do") - public String showTableListall(HttpServletRequest request,Model model){ - String startdate = request.getParameter("startdate"); - String examtype = request.getParameter("examtype"); - - request.setAttribute("startdate", startdate); - request.setAttribute("examtype", examtype); - - return "exam/examRecordTableListall"; - } - - @RequestMapping(value = "getTableExamPlanListall.do") - public ModelAndView getTableExamPlanListall(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String startdate = request.getParameter("startdate"); - String examtype = request.getParameter("examtype"); - String examtypeString = ""; - if(examtype.equals("moni")){ - examtypeString = "模拟考试"; - }else if(examtype.equals("zhengshi")){ - examtypeString = "正式考试"; - } - String wherestr = " where 1=1 and datediff(dd, a.startdate,'"+startdate+"')=0 and b.examtype='"+examtypeString+"'"; - if(sort==null){ - sort = " startdate "; - } - if(order==null){ - order = " desc "; - } - - String beginTime = request.getParameter("beginTimeStore"); - String endTime = request.getParameter("endTimeStore"); - if(beginTime!=null && !beginTime.isEmpty() && !beginTime.equals("") && endTime!=null && !endTime.isEmpty() && !endTime.equals("")){ - if(beginTime.equals(endTime)){ - wherestr = " where 1=1 and datediff(dd, a.startdate,'"+beginTime+"')=0 and b.examtype='"+examtypeString+"'"; - }else{ - wherestr = " where 1=1 and a.startdate>'"+beginTime+"' and a.startdate<'"+endTime+"' and b.examtype='"+examtypeString+"' "; - } - } - - //CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - List ulist = this.userService.selectListByWhere("where caption like '%"+request.getParameter("search_name")+"%' "); - if(ulist!=null && ulist.size()>0){ - String userids = ""; - for(int i=0;i unitlist=unitService.getUnitChildrenById(request.getParameter("search_pid")); -// String pidstr=""; -// for(int i=0;i unitlist=unitService.getChildrenUsersById(request.getParameter("search_pid")); - String userIds=""; - for (User user : unitlist) { - if(!userIds.isEmpty()){ - userIds+="','"; - } - userIds+=user.getId(); - } - if(!userIds.isEmpty()){ - wherestr += " and a.examuserid in ('"+userIds+"') "; - }else{ - wherestr += " and a.examuserid in ('') "; - } - - }else{ - Company company=unitService.getCompanyByUserId(cu.getId()); - String companyId="-1"; - if (company!=null) { - companyId=company.getId(); - } - List users=unitService.getChildrenUsersById(companyId); - String userIds=""; - for (User user : users) { - if(!userIds.isEmpty()){ - userIds+="','"; - } - userIds+=user.getId(); - } - if(!userIds.isEmpty()){ - wherestr += " and a.examuserid in ('"+userIds+"') "; - }else{ - wherestr += " and a.examuserid in ('') "; - } - } - - - String orderstr=" order by a."+sort+" "+order+""; - - PageHelper.startPage(page, rows); - List list = this.examRecordService.selectsearch(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 根据日期获取当天的考试安排 - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "getExamRecordJson.do") - public ModelAndView getExamRecordJson(HttpServletRequest request, - HttpServletResponse response,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String dateStr = request.getParameter("dateStr");//日期 - String type = request.getParameter("type");//类型 - //查询个人指定日期的考试 - String wherestr = " where 1=1 and examuserid = '"+cu.getId()+"'"; - String orderstr=" order by startdate "; - - if(type!=null && type.equals("day")){ - wherestr +=" and DateDiff(dd,startdate,'"+dateStr+"')=0 "; - } - if(type!=null && type.equals("month")){ - wherestr +=" and DateDiff(mm,startdate,'"+dateStr+"')=0 "; - } - - List list = this.examRecordService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - - @RequestMapping("/doexam.do") - public String doExam(HttpServletRequest request,Model model){ - String examrecordid = request.getParameter("examrecordid"); - int quesnum = 1; - List paperlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' order by ord"); - - - List examrecordlist = this.examRecordService.selectListByWhere(" where id = '"+examrecordid+"'"); - - SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String startdate = examrecordlist.get(0).getStartdate(); - String enddate = examrecordlist.get(0).getEnddate(); - Date today = new Date(); - String mark = ""; - String marktime=""; - boolean eflag; - boolean lflag; - try { - Date stDate = sdf.parse(startdate); - Date edDate = sdf.parse(enddate); - eflag = stDate.getTime() > today.getTime(); - lflag = edDate.getTime() < today.getTime(); - if(eflag){ - mark = "early"; - } - if(lflag){ - mark = "late"; - } - } catch (Exception e) { - // TODO: handle exception - } - - if(mark.equals("early")){ - marktime = "{\"mark\":\""+mark+"\",\"time\":\""+startdate.substring(0, 16)+"\"}"; - model.addAttribute("result", marktime); - return "result"; - }else if(mark.equals("late")){ - marktime = "{\"mark\":\""+mark+"\",\"time\":\""+enddate.substring(0, 16)+"\"}"; - model.addAttribute("result", marktime); - return "result"; - }else{ - //查询考生信息 - List userlist= this.userService.selectListByWhere("where id='"+examrecordlist.get(0).getExamuserid()+"'"); - //查询考试信息 - List examplanlist= this.examPlanService.selectListByWhere("where id='"+examrecordlist.get(0).getExamplanid()+"'"); - - request.setAttribute("examtime", examplanlist.get(0).getExamminutes()); - request.setAttribute("examusernumber", examrecordlist.get(0).getExamusernumber()); - request.setAttribute("examusername", userlist.get(0).getCaption()); - request.setAttribute("examtype", examplanlist.get(0).getExamtype()); - request.setAttribute("examname", examplanlist.get(0).getExamname()); - if(paperlist != null && paperlist.size()>0){ - //查询题目选项卡 -// String quesids = ""; -// for(int k = 0;k examtitlerangelist= this.examTitleRangeService.selectListByWhere("where pid='"+examrecordlist.get(0).getExamplanid()+"' order by ord"); - //按顺序查题型 -// List questtypes = this.questTypeService.selectListByWhere("where 1=1 order by ord"); - List selectcard = new ArrayList(); - for(int etr = 0;etr selecttitle = new ArrayList(); - List questtypelist = this.questTypeService.selectListByWhere("where id='"+examtitlerangelist.get(etr).getQuesttypeid()+"'"); - for(int sq = 0;sq< examtitlerangelist.get(etr).getTitlenum();sq++){ - JSONObject selectquestitle = new JSONObject(); - List tplist = this.testPaperService.selectListByWhere("where examrecordid='"+examrecordid+"' and questtypeid='"+examtitlerangelist.get(etr).getQuesttypeid()+"' order by ord"); - selectquestitle.put("questitlenum", sq+1); - selectquestitle.put("questitleid",tplist.get(sq).getId()); - selecttitle.add(selectquestitle); - } - selectquestype.put("ord", etr+1); - selectquestype.put("questypename", questtypelist.get(0).getName()); - selectquestype.put("questypenum", examtitlerangelist.get(etr).getTitlenum()); - selectquestype.put("selecttitlelist", selecttitle); - selectcard.add(selectquestype); - } - - request.setAttribute("selectcard", selectcard); - //查题目 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+paperlist.get(0).getQuestitleid()+"'"); - //查题型 - List questtypelist1 = this.questTypeService.selectListByWhere("where id='"+paperlist.get(0).getQuesttypeid()+"'"); - request.setAttribute("questypename", questtypelist1.get(0).getName()); - //查分值 - List examTitleRanges = this.examTitleRangeService.selectListByWhere("where pid='"+examrecordlist.get(0).getExamplanid()+"' and questtypeid='"+paperlist.get(0).getQuesttypeid()+"'"); - request.setAttribute("singlyscore", examTitleRanges.get(0).getSinglyscore()); - //查选项 - List testquesoptionlist = this.testQuesOptionService.selectListByWhere("where testpaperid='"+paperlist.get(0).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(testquesoptionlist != null && testquesoptionlist.size()>0){ - - for (int i = 0; i < testquesoptionlist.size(); i++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+testquesoptionlist.get(i).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionx", options.get(0).getOptionnumber()); - optionlist.add(jsonoption); - } - } - } - - if(questitlelist != null && questitlelist.size()>0){ - request.setAttribute("questitlelist", questitlelist.get(0)); - - }else{ - request.setAttribute("questitlelist", null); - - } - List questtypelist = this.questTypeService.selectListByWhere("where id='"+questitlelist.get(0).getQuesttypeid()+"'"); - request.setAttribute("quesoptionlist", optionlist); - request.setAttribute("questitlenum", paperlist.size()); - request.setAttribute("questype", questtypelist.get(0).getName()); - } - //更新examrecord表 - ExamRecord examRecord = this.examRecordService.selectById(examrecordid); - - examRecord.setExamdate(CommUtil.nowDate()); - examRecord.setExamstarttime(CommUtil.nowDate()); - this.examRecordService.update(examRecord); - - request.setAttribute("quesnum", quesnum); - request.setAttribute("examrecordid", examrecordid); - request.setAttribute("quesid", paperlist.get(0).getId()); - return "exam/exampaper"; - } - - } - - @RequestMapping("/doexamhtml.do") - public String doExamhtml(HttpServletRequest request,Model model){ - String result=""; - String examrecordid = request.getParameter("examrecordid"); - String quesnum = request.getParameter("quesnum"); - - List examrecordlist = this.examRecordService.selectListByWhere(" where id = '"+examrecordid+"'"); - - String switchtype = request.getParameter("switchtype");//切换类型 上一个:prev/下一个:next - String wherestr = ""; - String orderstr = ""; - if(switchtype!=null && !switchtype.equals("")){ - if(switchtype.equals("prev")){ - wherestr +=" and ord<"+quesnum+" "; - orderstr +=" order by ord desc"; - } - if(switchtype.equals("next")){ - wherestr +=" and ord>"+quesnum+" "; - orderstr +=" order by ord asc"; - } - } - List paperlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' "+wherestr+orderstr); - if(paperlist != null && paperlist.size()>0){ - //查题目 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+paperlist.get(0).getQuestitleid()+"'"); - //查分值 - List examTitleRanges = this.examTitleRangeService.selectListByWhere("where pid='"+examrecordlist.get(0).getExamplanid()+"' and questtypeid='"+paperlist.get(0).getQuesttypeid()+"'"); - - //查选项 - List testquesoptionlist = this.testQuesOptionService.selectListByWhere("where testpaperid='"+paperlist.get(0).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(testquesoptionlist != null && testquesoptionlist.size()>0){ - - for (int i = 0; i < testquesoptionlist.size(); i++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+testquesoptionlist.get(i).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionx", options.get(0).getOptionnumber()); - optionlist.add(jsonoption); - } - } - } - // 查题型 - List questtypelist = this.questTypeService.selectListByWhere("where id='"+questitlelist.get(0).getQuesttypeid()+"'"); - JSONArray json = JSONArray.fromObject(optionlist); - result = "{\"quesnum\":"+paperlist.get(0).getOrd()+",\"quesid\":\""+paperlist.get(0).getId()+"\",\"questype\":\""+questtypelist.get(0).getName()+ - "\",\"useranswer\":\""+paperlist.get(0).getUseranswer()+"\",\"quesdescript\":\""+questitlelist.get(0).getQuesdescript()+"\",\"singlyscore\":\""+examTitleRanges.get(0).getSinglyscore()+ - "\",\"rows\":"+json+"}"; -// System.out.println(result); - if(questitlelist != null && questitlelist.size()>0){ - request.setAttribute("questitlelist", questitlelist.get(0)); - - }else{ - request.setAttribute("questitlelist", null); - - } - request.setAttribute("quesoptionlist", optionlist); - request.setAttribute("questitlenum", paperlist.size()); - model.addAttribute("result", result); - }else{ - if(switchtype.equals("prev")){ - request.setAttribute("result",1); - }else{ - request.setAttribute("result",2); - } - - } - request.setAttribute("quesnum", quesnum); - request.setAttribute("examrecordid", examrecordid); - -// return "exam/exampaperhtml"; - - return "result"; - } - - @RequestMapping("/dojumpques.do") - public String dojumpques(HttpServletRequest request,Model model){ - String result=""; - String examrecordid = request.getParameter("examrecordid"); - List examrecordlist = this.examRecordService.selectListByWhere(" where id = '"+examrecordid+"'"); - - String quesid = request.getParameter("questitleid"); - List paperlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' and id='"+quesid+"'"); - List questtypelist = this.questTypeService.selectListByWhere("where id='"+paperlist.get(0).getQuesttypeid()+"'"); - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+paperlist.get(0).getQuestitleid()+"'"); - //查分值 - List examTitleRanges = this.examTitleRangeService.selectListByWhere("where pid='"+examrecordlist.get(0).getExamplanid()+"' and questtypeid='"+paperlist.get(0).getQuesttypeid()+"'"); - //查选项 - List testquesoptionlist = this.testQuesOptionService.selectListByWhere("where testpaperid='"+paperlist.get(0).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(testquesoptionlist != null && testquesoptionlist.size()>0){ - - for (int i = 0; i < testquesoptionlist.size(); i++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+testquesoptionlist.get(i).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionx", options.get(0).getOptionnumber()); - optionlist.add(jsonoption); - } - } - } - JSONArray json = JSONArray.fromObject(optionlist); - result = "{\"quesnum\":"+paperlist.get(0).getOrd()+",\"quesid\":\""+paperlist.get(0).getId()+"\",\"questype\":\""+questtypelist.get(0).getName()+ - "\",\"useranswer\":\""+paperlist.get(0).getUseranswer()+"\",\"quesdescript\":\""+questitlelist.get(0).getQuesdescript()+"\",\"singlyscore\":\""+examTitleRanges.get(0).getSinglyscore()+ - "\",\"rows\":"+json+"}"; -// return "exam/exampaperhtml"; - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/dosaveanswer.do") - public String dosaveanswer(HttpServletRequest request,Model model){ - String quesid = request.getParameter("quesid"); - String useranswer = request.getParameter("useranswer"); - String questype = request.getParameter("questype"); - - String st = ""; - List testpaperlist = this.testPaperService.selectListByWhere("where id='"+quesid+"'"); - //根据题型判断对错 - if(questype.equals("填空题")){ - //先去查询正确答案的id,按顺序拼起来 - //先判断下中文逗号 - useranswer = useranswer.replace(",",","); - if(testpaperlist!=null && testpaperlist.size() >0){ - List quesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+testpaperlist.get(0).getQuestitleid()+"' order by ord asc"); - if(quesoptionlist!=null && quesoptionlist.size()>0){ - String rightanswer = ""; - for(int i = 0;i0){ - if(testpaperlist.get(0).getAnswervalue().equals(useranswer)){ - st = "正确"; - }else{ - st = "错误"; - } - } - }else if(questype.equals("多选题")){ - if(testpaperlist!=null && testpaperlist.size() >0){ - String[] useranswerlist = useranswer.split(","); - String[] answervaluelist = testpaperlist.get(0).getAnswervalue().split(","); - if (Arrays.equals(useranswerlist, answervaluelist)) { - st = "正确"; - }else{ - st = "错误"; - } - } - - } - - //更新testpaper表 - TestPaper testPaper = this.testPaperService.selectById(quesid); - User cu=(User)request.getSession().getAttribute("cu"); - testPaper.setUpsuser(cu.getId()); - testPaper.setUpsdt(CommUtil.nowDate()); - testPaper.setUseranswer(useranswer); - testPaper.setStatus(st); - int result = this.testPaperService.update(testPaper); - - return "result"; - } - - @RequestMapping("/dosendpaper.do") - public String dosendpaper(HttpServletRequest request,Model model){ - - String examrecordid = request.getParameter("examrecordid"); - - int result = this.examRecordService.calculateScore(examrecordid); - - request.setAttribute("result", result); - return "result"; - } - - @RequestMapping("/domarkques.do") - public String domarkques(HttpServletRequest request,Model model){ - - String testpaperid = request.getParameter("testpaperid"); - TestPaper testPaper = this.testPaperService.selectById(testpaperid); - testPaper.setMark("marked"); - int result = this.testPaperService.update(testPaper); - - request.setAttribute("result", testPaper.getId()); - return "result"; - } - - //生成每日一练题目解析 - @RequestMapping("/openanalysis.do") - public String openanalysis(HttpServletRequest request,Model model){ - String examrecordid = request.getParameter("examrecordid"); - int numcount = 0; - int rightnum = 0; - int errornum = 0; - //先找到examplanid - ExamRecord examrecord = this.examRecordService.selectById(examrecordid); - //按顺序先查每种题有多少道 - List examtitlerangelist= this.examTitleRangeService.selectListByWhere("where pid='"+examrecord.getExamplanid()+"' order by ord"); - //按顺序查出所有题目 - List Testpaperlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' order by ord"); - - //根据题型类型,循环出所有题 [ {"ord":1,"questtypename":"判断题","questypenum":2,"titlelist":[{"questitlenum":1,"questitle":"太阳从东方升起"}]}] - - List analysislist = new ArrayList(); - for(int etr = 0;etr titlelist = new ArrayList(); - List questtypelist = this.questTypeService.selectListByWhere("where id='"+examtitlerangelist.get(etr).getQuesttypeid()+"'"); - for(int sq = 0;sq< examtitlerangelist.get(etr).getTitlenum();sq++){ - JSONObject titlejson = new JSONObject(); - List tplist = this.testPaperService.selectListByWhere("where examrecordid='"+examrecordid+"' and questtypeid='"+examtitlerangelist.get(etr).getQuesttypeid()+"' order by ord"); - - //查题目+序号+解析+考生回答+正确情况 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+tplist.get(sq).getQuestitleid()+"'"); - titlejson.put("quesnum", tplist.get(sq).getOrd()); - titlejson.put("status", tplist.get(sq).getStatus()); - if(questitlelist!=null && questitlelist.size()>0){ - titlejson.put("questitle", questitlelist.get(0).getQuesdescript()); - titlejson.put("analysis", questitlelist.get(0).getAnalysis()); - }else{ - titlejson.put("questitle", ""); - titlejson.put("analysis", ""); - } - - if(questtypelist.get(0).getName().equals("填空题")){ - titlejson.put("useranswer", tplist.get(sq).getUseranswer()); - }else if(questtypelist.get(0).getName().equals("判断题") || questtypelist.get(0).getName().equals("单选题")){ - if(tplist.get(sq).getUseranswer()!=null && !tplist.get(sq).getUseranswer().equals("")){ - List options = this.quesOptionService.selectListByWhere("where id='"+tplist.get(sq).getUseranswer()+"'"); - if(options!=null && options.size()>0){ - titlejson.put("useranswer", options.get(0).getOptioncontent()); - }else{ - titlejson.put("useranswer", ""); - } - }else{ - titlejson.put("useranswer", ""); - } - }else if(questtypelist.get(0).getName().equals("多选题")){ - if(tplist.get(sq).getUseranswer()!=null && !tplist.get(sq).getUseranswer().equals("")){ - String[] useranswerlist = tplist.get(sq).getUseranswer().split(","); - for(int ul=0;ul options = this.quesOptionService.selectListByWhere("where id='"+useranswerlist[ul]+"'"); - if(options!=null && options.size()>0){ - titlejson.put("useranswer", options.get(0).getOptioncontent()); - } - } - }else{ - titlejson.put("useranswer", ""); - } - - } - - //查正确答案 - List Testquesoptionlist = this.quesOptionService.selectListByWhere("where questitleid='"+tplist.get(sq).getQuestitleid()+"' and optionvalue='T' order by ord"); - String rightanswer = ""; - if(Testquesoptionlist!=null && Testquesoptionlist.size()>0){ - for(int v=0;v testquesoptionlist = this.testQuesOptionService.selectListByWhere("where testpaperid='"+tplist.get(sq).getId()+"' order by ord"); - List optionlist = new ArrayList(); - if(testquesoptionlist != null && testquesoptionlist.size()>0){ - - for (int j = 0; j < testquesoptionlist.size(); j++) { - JSONObject jsonoption = new JSONObject(); - List options = this.quesOptionService.selectListByWhere("where id='"+testquesoptionlist.get(j).getQuesoptionid()+"'"); - if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(0).getId()); - jsonoption.put("optioncontent", options.get(0).getOptioncontent()); - jsonoption.put("optionvalue", options.get(0).getOptionvalue()); - optionlist.add(jsonoption); - } - - } - - }//选项结束 - titlejson.put("optionlist", optionlist); - - titlelist.add(titlejson); - - -// selecttitle.add(selectquestitle); - } - analysistype.put("ord", etr+1); - analysistype.put("questypename", questtypelist.get(0).getName()); - analysistype.put("questypenum", examtitlerangelist.get(etr).getTitlenum()); - analysistype.put("titlelist", titlelist); - analysislist.add(analysistype); - - } - - - - //查一共有多少题,做对几道,做错几道 - List numcountlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' order by ord"); - if(numcountlist!=null && numcountlist.size()>0){ - numcount = numcountlist.size(); - } - List rightlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' and status='正确' order by ord"); - if(rightlist!=null && rightlist.size()>0){ - rightnum = rightlist.size(); - } - List errorlist = this.testPaperService.selectListByWhere(" where examrecordid = '"+examrecordid+"' and status='错误' order by ord"); - if(errorlist!=null && errorlist.size()>0){ - errornum = errorlist.size(); - } - - //返回全部数据 - request.setAttribute("numcount", numcount); - request.setAttribute("rightnum", rightnum); - request.setAttribute("errornum", errornum); - request.setAttribute("analysislist", analysislist); - System.out.println(analysislist); - - return "exam/openexamanalysis"; - } - - //获取当前用户的当天所有模拟考试 - @RequestMapping(value = "getUserVisualexam.do") - public String getUserVisualexam(HttpServletRequest request, - HttpServletResponse response,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr = " where DateDiff(dd,a.startdate,getdate())=0 and b.examtype = '模拟考试' and a.examuserid='"+cu.getId()+"'"; - - String orderstr=" order by a.startdate desc"; - - - List list = this.examRecordService.selectTestListByWhere(wherestr+orderstr); - - - model.addAttribute("result",list.size()); - return "exam/openVisualexam"; - } - - @RequestMapping(value = "getUserVisualexamList.do") - public ModelAndView getUserVisualexamList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr = " where DateDiff(dd,a.startdate,getdate())=0 and b.examtype = '模拟考试' and a.examuserid='"+cu.getId()+"'"; - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - - String orderstr=" order by a.startdate desc"; - - PageHelper.startPage(page, rows); - List list = this.examRecordService.selectTestListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - //获取模拟考试数据 - @RequestMapping("/getAllList.do") - public String getAllList(HttpServletRequest request,Model model){ - - List monilist = this.examRecordService.selectmonicount("where b.examtype='模拟考试'"); - List zhengshilist = this.examRecordService.selectmonicount("where b.examtype='正式考试'"); - - JSONObject jsonObject = new JSONObject(); - if(monilist!=null && monilist.size()>0){ - List monijsonlist = new ArrayList(); - for(int i=0;i0){ - List zhengshijsonlist = new ArrayList(); - for(int i=0;i examRecords = this.examRecordService.selectsearch("where a.startdate >= '"+zhengshilist.get(i).getStartdate().substring(0, 10)+" 00:00:00' and a.startdate <='"+zhengshilist.get(i).getStartdate().substring(0, 10)+" 23:59:59' and b.examtype='模拟考试'"); - if(examRecords!=null && examRecords.size()>0){ - zhengshiobject.put("mark", "1"); - }else{ - zhengshiobject.put("mark", "0"); - } - - zhengshiobject.put("allcount", zhengshilist.get(i).get_allcount()); - zhengshiobject.put("notcount", zhengshilist.get(i).get_notcount()); - zhengshiobject.put("passcount", zhengshilist.get(i).get_passcount()); - int allcount = Integer.valueOf(zhengshilist.get(i).get_allcount()); - int passcount = Integer.valueOf(zhengshilist.get(i).get_passcount()); - // 创建一个数值格式化对象 - NumberFormat numberFormat = NumberFormat.getInstance(); - // 设置精确到小数点后2位 - numberFormat.setMaximumFractionDigits(0); - if(passcount!=0){ - String passrate = numberFormat.format((float) passcount / (float) allcount * 100); - zhengshiobject.put("passrate", passrate); - }else{ - String passrate = "0"; - zhengshiobject.put("passrate", passrate); - } - - zhengshijsonlist.add(zhengshiobject); - } - jsonObject.put("zhengshilist", zhengshijsonlist); - - } - - - - request.setAttribute("result", jsonObject); - return "result"; - } - -} diff --git a/src/com/sipai/controller/exam/ExamTitleRangeController.java b/src/com/sipai/controller/exam/ExamTitleRangeController.java deleted file mode 100644 index b535ba92..00000000 --- a/src/com/sipai/controller/exam/ExamTitleRangeController.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.sipai.controller.exam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.exam.ExamTitleRange; -import com.sipai.entity.question.QuestType; -import com.sipai.entity.user.User; -import com.sipai.service.exam.ExamTitleRangeService; -import com.sipai.service.question.QuesTitleService; -import com.sipai.service.question.QuestTypeService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/exam/examTitleRange") -public class ExamTitleRangeController { - @Resource - private ExamTitleRangeService examTitleRangeService; - @Resource - private QuestTypeService questTypeService; - @Resource - private QuesTitleService quesTitleService; - - @RequestMapping(value = "getExamTitleRangeList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "examPlanId", required=false) String examPlanId, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - String wherestr = " where 1=1 "; - if(examPlanId!=null&&!examPlanId.isEmpty()){ - wherestr+=" and pid = '"+examPlanId+"' "; - }else { - wherestr+=" and pid = '-1' "; - } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } -// String orderstr=" order by "+sort+" "+order; - String orderstr="order by ord asc"; - PageHelper.startPage(page, rows); - List list = this.examTitleRangeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showExamTitleRangeAdd.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("questitleid", request.getParameter("questitleid")); - return "exam/examTitleRangeAdd"; - } - - @RequestMapping("/saveExamTitleRange.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("examTitleRange") ExamTitleRange examTitleRange){ -// System.out.println("123+"+request.getParameter("id")); - -// quesOption.setStatus(request.getParameter("optionstatus")); -// quesOption.setOrd(Integer.parseInt(request.getParameter("optionord"))); -// - User cu=(User)request.getSession().getAttribute("cu"); - examTitleRange.setInsdt(CommUtil.nowDate()); - examTitleRange.setInsuser(cu.getId()); - - String questtypeids = request.getParameter("questtypeids"); - String[] questtypeidsArray=questtypeids.split(","); - int res = 0; - for (int i = 0; i < questtypeidsArray.length; i++) { - QuestType questType = this.questTypeService.selectById(questtypeidsArray[i]); - examTitleRange.setOrd(questType.getOrd()); - examTitleRange.setQuesttypeid(questtypeidsArray[i]); - examTitleRange.setId(CommUtil.getUUID()); - res = this.examTitleRangeService.save(examTitleRange); - } - - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showExamTitleRangeEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - ExamTitleRange examTitleRange = this.examTitleRangeService.selectById(id); - String subjecttypeids = examTitleRange.getSubjecttypeids(); - subjecttypeids=subjecttypeids.replace(",","','"); - String ranktypeids = examTitleRange.getRanktypeids(); - ranktypeids=ranktypeids.replace(",","','"); - String questtypeid = examTitleRange.getQuesttypeid(); - - int num = this.quesTitleService.selectNumByWhere(" where subjecttypeid in ('"+subjecttypeids+"') and ranktypeid in ('"+ranktypeids+"') and questtypeid = '"+questtypeid+"' "); - model.addAttribute("num",num ); - - model.addAttribute("examTitleRange",examTitleRange ); - return "exam/examTitleRangeEdit"; - } - - @RequestMapping("/updateExamTitleRange.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("quesOption") ExamTitleRange examTitleRange){ - - User cu=(User)request.getSession().getAttribute("cu"); - examTitleRange.setUpsdt(CommUtil.nowDate()); - examTitleRange.setUpsuser(cu.getId()); - - int res = this.examTitleRangeService.update(examTitleRange); - model.addAttribute("result",res); - - return new ModelAndView("result"); - } - - @RequestMapping("/deleteExamTitleRange.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.examTitleRangeService.deleteById(id); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteExamTitleRanges.do") - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.examTitleRangeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",code); - return new ModelAndView("result"); - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.fangZhenBalanceService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取窗口配置信息", notes = "获取窗口配置信息", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/getData_FangZhenBrowser.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getData_FangZhenBrowser(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenBrowserService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取设备配置表", notes = "获取设备配置表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/getData_FangZhenEquipment.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getData_FangZhenEquipment(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenEquipmentService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取页眉点位配置", notes = "获取页眉点位配置", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/getData_FangZhenHeadUI.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getData_FangZhenHeadUI(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenHeadUIService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取鼠标移动上出现字", notes = "获取鼠标移动上出现字", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/getData_FangZhenPipe.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getData_FangZhenPipe(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenPipeService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取工位配置表", notes = "获取工位配置表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/getData_FangZhenStation.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getData_FangZhenStation(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenStationService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取水池运行信号数据", notes = "获取水池运行信号数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/getData_FangZhenWater.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getData_FangZhenWater(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenWaterService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取水池运行信号数据", notes = "获取水池运行信号数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @ResponseBody - @RequestMapping(value = "/getData_FangZhenXeoma.do", method = RequestMethod.GET) - public ModelAndView getData_FangZhenXeoma(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.fangZhenXeomaService.selectListByWhere(""); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - - @ApiOperation(value = "保存窗口配置信息", notes = "保存窗口配置信息", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "browsername", value = "browsername", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "x", value = "X轴", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "y", value = "Y轴", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "width", value = "宽", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "height", value = "高", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "url", value = "链接地址", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "stationid", value = "stationid", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "scenemodeindex", value = "scenemodeindex", dataType = "Integer", paramType = "query", required = false) - }) - @RequestMapping(value = "/save_FangZhenBrowser.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView save_FangZhenBrowser(HttpServletRequest request, Model model, - @RequestParam(value = "browsername", required = true) String browsername, - @RequestParam(value = "x", required = false) Double x, - @RequestParam(value = "y", required = false) Double y, - @RequestParam(value = "width", required = false) Double width, - @RequestParam(value = "height", required = false) Double height, - @RequestParam(value = "url", required = false) String url, - @RequestParam(value = "stationid", required = false) String stationid, - @RequestParam(value = "scenemodeindex", required = false) Integer scenemodeindex) { - User cu = (User) request.getSession().getAttribute("cu"); - FangZhenBrowser fangZhenBrowser = new FangZhenBrowser(); - fangZhenBrowser.setBrowsername(browsername); - fangZhenBrowser.setX(x); - fangZhenBrowser.setY(y); - fangZhenBrowser.setWidth(width); - fangZhenBrowser.setHeight(height); - fangZhenBrowser.setUrl(url); - fangZhenBrowser.setStationid(stationid); - fangZhenBrowser.setScenemodeindex(scenemodeindex); - - int res = 0; - Result result = null; - FangZhenBrowser fangZhenBrowser2 = fangZhenBrowserService.selectById(browsername); - if (fangZhenBrowser2 != null) { - result = Result.failed("browsername已存在"); - } else { - res = this.fangZhenBrowserService.save(fangZhenBrowser); - result = Result.success(res); - } - if (res == 1) { - result = Result.success(res); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "修改窗口配置信息", notes = "修改窗口配置信息", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "browsername", value = "browsername", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "x", value = "X轴", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "y", value = "Y轴", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "width", value = "宽", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "height", value = "高", dataType = "Double", paramType = "query", required = false), - @ApiImplicitParam(name = "url", value = "链接地址", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "stationid", value = "stationid", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "scenemodeindex", value = "scenemodeindex", dataType = "Integer", paramType = "query", required = false) - }) - @RequestMapping(value = "/update_FangZhenBrowser.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView update_FangZhenBrowser(HttpServletRequest request, Model model, - @RequestParam(value = "browsername", required = true) String browsername, - @RequestParam(value = "x", required = false) Double x, - @RequestParam(value = "y", required = false) Double y, - @RequestParam(value = "width", required = false) Double width, - @RequestParam(value = "height", required = false) Double height, - @RequestParam(value = "url", required = false) String url, - @RequestParam(value = "stationid", required = false) String stationid, - @RequestParam(value = "scenemodeindex", required = false) Integer scenemodeindex) { - User cu = (User) request.getSession().getAttribute("cu"); - FangZhenBrowser fangZhenBrowser = new FangZhenBrowser(); - fangZhenBrowser.setBrowsername(browsername); - fangZhenBrowser.setX(x); - fangZhenBrowser.setY(y); - fangZhenBrowser.setWidth(width); - fangZhenBrowser.setHeight(height); - fangZhenBrowser.setUrl(url); - fangZhenBrowser.setStationid(stationid); - fangZhenBrowser.setScenemodeindex(scenemodeindex); - int res = 0; - Result result = null; - try { - res = this.fangZhenBrowserService.update(fangZhenBrowser); - result = Result.success(res); - } catch (Exception e) { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "删除窗口配置信息", notes = "删除修改窗口配置信息", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "browsername", value = "browsername", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/delete_FangZhenBrowser.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView delete_FangZhenBrowser(HttpServletRequest request, Model model, - @RequestParam(value = "browsername", required = true) String browsername) { - User cu = (User) request.getSession().getAttribute("cu"); - int res = this.fangZhenBrowserService.deleteById(browsername); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - - @ApiOperation(value = "设备定位_websocket (测试)", notes = "设备定位_websocket (测试)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "equipmentCardID", value = "设备编号", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/websocket_Equipment_Test.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView websocket_Equipment_Test(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentCardID", required = true) String equipmentCardID) { - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_FINDOBJ.toString()); - WebSocketCmdUtil.send(jsonObject.get("cmdType").toString(), equipmentCardID, jsonObject.get("action").toString(), System.currentTimeMillis()); - model.addAttribute("result", "suc"); - return new ModelAndView("result"); - } - - @ApiOperation(value = "弹出摄像头_websocket (测试)", notes = "弹出摄像头_websocket (测试)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/websocket_Camera_Test.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView websocket_Camera_Test(HttpServletRequest request, Model model) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - String came = "rtsp://" + "admin" + ":" + "fssk12345678" + "@" + "178.16.1.32:554" + "/h264/ch" + "7" + "/main/av_stream"; - JSONObject jsonObject = new JSONObject(); - jsonObject.put("camurl", came); - jsonArray.add(jsonObject); - - JSONObject json = new JSONObject(); - json.put("cmdType", "opencams"); - json.put("objId", jsonArray); - json.put("action", "play"); - json.put("time", System.currentTimeMillis()); - WebSocketCmdUtil.send2(json); - - model.addAttribute("result", "suc"); - return new ModelAndView("result"); - } - - @ApiOperation(value = "语音_websocket (测试)", notes = "语音_websocket (测试)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "value", value = "语音内容", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/websocket_Speech_Test.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView websocket_Speech_Test(HttpServletRequest request, Model model, - @RequestParam(value = "value") String value) { - /** - * 处理语音 - */ - JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", value); - //推送语音播放 - WebSocketCmdUtil.send(readJson); - - model.addAttribute("result", "suc"); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/finance/financeEquipmentDeptInfoController.java b/src/com/sipai/controller/finance/financeEquipmentDeptInfoController.java deleted file mode 100644 index 9eb00a95..00000000 --- a/src/com/sipai/controller/finance/financeEquipmentDeptInfoController.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.sipai.controller.finance; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.entity.finance.FinanceEquipmentDeptInfo; -import com.sipai.entity.user.User; -import com.sipai.service.finance.FinanceEquipmentDeptInfoService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/finance/financeEquipmentDeptInfo") -public class financeEquipmentDeptInfoController { - - @Resource - private FinanceEquipmentDeptInfoService financeEquipmentDeptInfoService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/finance/financeEquipmentDeptInfoList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - String searchName=request.getParameter("searchName"); - if(null!=searchName && !"".equals(searchName)){ - wherestr+=" and name like '%"+searchName+"%'"; - } - - - PageHelper.startPage(page, rows); - List list = financeEquipmentDeptInfoService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - - return "/finance/financeEquipmentDeptInfoAdd"; - } - - @ResponseBody - @RequestMapping("/saveFinanceEquDeptInfo.do") - public Map saveFinanceEquDeptInfo(HttpServletRequest request,Model model,FinanceEquipmentDeptInfo financeEquipmentDeptInfo) { - User cu=(User)request.getSession().getAttribute("cu"); - financeEquipmentDeptInfo.setId(CommUtil.getUUID()); - financeEquipmentDeptInfo.setInsdt(CommUtil.nowDate()); - financeEquipmentDeptInfo.setInsuser(cu.getId()); - - Map message = new HashMap<>(); - int result=financeEquipmentDeptInfoService.save(financeEquipmentDeptInfo); - - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - } - - @ResponseBody - @RequestMapping("/findFinanceEquDeptInfo.do") - public Map findFinanceEquDeptInfo(HttpServletRequest request,Model model,FinanceEquipmentDeptInfo financeEquipmentDeptInfo) { - - String sql = " where 1=1 and code='"+financeEquipmentDeptInfo.getCode()+"'"+" and name='"+financeEquipmentDeptInfo.getName()+"'"; - List findFinanceEquDeptInfoList = financeEquipmentDeptInfoService.selectListByWhere(sql); - - Map message = new HashMap<>(); - if(null!=findFinanceEquDeptInfoList && findFinanceEquDeptInfoList.size()>0 ){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - - return message; - } - - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.financeEquipmentDeptInfoService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.financeEquipmentDeptInfoService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - - - - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - FinanceEquipmentDeptInfo financeEquipmentDeptInfo = financeEquipmentDeptInfoService.selectById(id); - model.addAttribute("financeEquipmentDeptInfo", financeEquipmentDeptInfo); - return "/finance/financeEquipmentDeptInfoView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - FinanceEquipmentDeptInfo financeEquipmentDeptInfo = financeEquipmentDeptInfoService.selectById(id); - model.addAttribute("financeEquipmentDeptInfo", financeEquipmentDeptInfo); - return "finance/financeEquipmentDeptInfoEdit"; - } - - @ResponseBody - @RequestMapping("/updateFinanceEquDeptInfo.do") - public Map doupdate(HttpServletRequest request,Model model,FinanceEquipmentDeptInfo financeEquipmentDeptInfo){ - - Map message = new HashMap<>(); - int result=financeEquipmentDeptInfoService.update(financeEquipmentDeptInfo); - - if(result>0){ - message.put("message", 1); - }else{ - message.put("message", 0); - } - return message; - - } -} diff --git a/src/com/sipai/controller/fwk/MenunumberController.java b/src/com/sipai/controller/fwk/MenunumberController.java deleted file mode 100644 index 1f19ef31..00000000 --- a/src/com/sipai/controller/fwk/MenunumberController.java +++ /dev/null @@ -1,273 +0,0 @@ -package com.sipai.controller.fwk; - -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.fwk.Menunumber; -import com.sipai.entity.user.User; -import com.sipai.service.fwk.MenunumberService; -import com.sipai.tools.CommUtil; - -import static java.util.stream.Collectors.toList; - -@Controller -@RequestMapping("/fwk/Menunumber") -public class MenunumberController { - - @Resource - private MenunumberService menunumberService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "fwk/menunumberList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " pid ";//morder - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - - String curDateStart = request.getParameter("curDateStart"); - StringBuilder whereSb = new StringBuilder(""); - String search_name = request.getParameter("search_name"); - if (curDateStart != null && !"".equals(curDateStart)) { - whereSb.append("and a.onclickdatetime >='" + curDateStart + "'"); - } - String curDateEnd = request.getParameter("curDateEnd"); - if (curDateEnd != null && !"".equals(curDateEnd)) { - whereSb.append("and a.onclickdatetime <='" + curDateEnd + "'"); - } - String whereSql = whereSb.toString(); - List list = this.menunumberService.selectCountListByWhere(whereSql); - for (int i = 0; i < list.size(); i++) { - Menunumber Menunumber = list.get(i); - this.menunumberService.set_menuitemname(""); - this.menunumberService.toMenu(Menunumber.getMenuitemid()); - String _name = this.menunumberService.get_menuitemname(); - String _newname = ""; - if (_name.split(">>") != null && _name.split(">>").length >= 1) { - for (int ii = _name.split(">>").length - 1; ii >= 0; ii--) { - if (ii == 0) { - _newname += _name.split(">>")[ii]; - } else { - _newname += _name.split(">>")[ii] + ">>"; - } - } - } - Menunumber.set_name(_newname); - } - - //去除不在筛选范围内的 - if (search_name != null && !search_name.equals("")) { - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - if (!iterator.next().get_name().contains(search_name)) { - iterator.remove(); - } - } - } - - try { - JSONObject results = new JSONObject(); - int total = list.size(); - results.put("total", total); - - //排序 - if (order != null && !order.isEmpty()) { - if (order.equals("asc")) {//正序 - if (sort.equals("_number")) { - list = list.stream().sorted(Comparator.comparingInt(Menunumber::get_number)).collect(toList()); - } - } - if (order.equals("desc")) {//倒序 - if (sort.equals("_number")) { - list = list.stream().sorted(Comparator.comparingInt(Menunumber::get_number).reversed()).collect(toList()); - } - } - } else { - list = list.stream().sorted(Comparator.comparingInt(Menunumber::get_number).reversed()).collect(toList()); - } - - //分页 - List tasks = list.stream().skip((pages - 1) * pagesize).limit(pagesize).collect(toList()); - results.put("rows", tasks); - JSONArray json = results.getJSONArray("rows"); - - /*//排序 - boolean is_desc = true; - if (order != null && !order.isEmpty()) { - if (order.equals("asc")) { - is_desc = false;//正序 - } - if (order.equals("desc")) { - is_desc = true;//倒序 - } - }*/ - - //根据指定字段排序 -// json = CommUtil.jsonArraySort(json, sort, is_desc); - //服务端分页 - String result = "{\"total\":" + results.getString("total") + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - } catch (Exception e) { - e.printStackTrace(); - } - -// JSONArray json = JSONArray.fromObject(list); -// String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; -// model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - - return "fwk/menunumberAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model) { - Menunumber menunumber = new Menunumber(); - String menuitemid = request.getParameter("menuitemid"); - //把前边的tabId_截取掉 - menuitemid = menuitemid.substring(6, menuitemid.length()); - User cu = (User) request.getSession().getAttribute("cu"); - menunumber.setId(CommUtil.getUUID()); - menunumber.setMenuitemid(menuitemid); - menunumber.setOnclickdatetime(CommUtil.nowDate()); - int result = 0; - if (cu != null) { - menunumber.setUserid(cu.getId()); - result = this.menunumberService.save(menunumber); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Menunumber menunumber = this.menunumberService.selectById(id); - model.addAttribute("menunumber", menunumber); - return "fwk/menunumberEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute Menunumber menunumber) { - User cu = (User) request.getSession().getAttribute("cu"); - - int result = this.menunumberService.update(menunumber); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + menunumber.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.menunumberService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request, Model model) { - List list = this.menunumberService.selectListByWhere - ("where 1=1 "); - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); -// jsonObject.put("text", list.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 统计部门点击次数 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String menuitemid = request.getParameter("menuitemid"); - String curDateStart = request.getParameter("curDateStart"); - String curDateEnd = request.getParameter("curDateEnd"); - model.addAttribute("menuitemid", menuitemid); - model.addAttribute("curDateStart", curDateStart); - model.addAttribute("curDateEnd", curDateEnd); - return "fwk/menunumberView"; - } - - - @RequestMapping("/getListDetail.do") - public ModelAndView getListDetail(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String menuitemId = request.getParameter("menuitemid"); - StringBuilder whereSb = new StringBuilder("where a.id is not null and a.menuitemid= '" + menuitemId + "' "); - String curDateStart = request.getParameter("curDateStart"); - if (curDateStart != null && !"".equals(curDateStart)) { - whereSb.append("and a.onclickdatetime >='" + curDateStart + "'"); - } - String curDateEnd = request.getParameter("curDateEnd"); - if (curDateEnd != null && !"".equals(curDateEnd)) { - whereSb.append("and a.onclickdatetime <='" + curDateEnd + "'"); - } - String whereSql = whereSb.toString(); - List list = this.menunumberService.selectCountListByWhereDetail(whereSql); - - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/fwk/UserToMenuController.java b/src/com/sipai/controller/fwk/UserToMenuController.java deleted file mode 100644 index f4293629..00000000 --- a/src/com/sipai/controller/fwk/UserToMenuController.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.sipai.controller.fwk; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -@RequestMapping("/fwk/UserToMenu") -public class UserToMenuController { - -} diff --git a/src/com/sipai/controller/hqconfig/EnterRecordController.java b/src/com/sipai/controller/hqconfig/EnterRecordController.java deleted file mode 100644 index 9a015743..00000000 --- a/src/com/sipai/controller/hqconfig/EnterRecordController.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.controller.hqconfig; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.hqconfig.EnterRecord; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserOutsiders; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.hqconfig.EnterRecordService; -import com.sipai.service.user.UserOutsidersService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("hqconfig/enterRecord") -public class EnterRecordController { - @Resource - private EnterRecordService enterRecordService; - @Resource - private UserService userService; - @Resource - UserOutsidersService userOutsidersService; - @Resource - private AreaManageService areaManageService; - - @RequestMapping("/getTopNList.do") - public String getTopNList(HttpServletRequest request, Model model) { - String fid = request.getParameter("fid"); - String top_n = request.getParameter("top_n"); - Map map = new HashMap(); - map.put("top_n", top_n); - map.put("where", "where fid = '" + fid + "' and (areaid is null or areaid = '') order by state desc"); - List list = enterRecordService.selectTopNlistByWhere(map); - JSONArray jsonArray = JSONArray.fromObject(list); - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/hqconfig/enterRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " e.inTime "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += " and e.status = '" + request.getParameter("status") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (e.areaid ='" + request.getParameter("search_name") + "' or a.pid = '" + request.getParameter("search_name") + "')"; - } - if (request.getParameter("hasArea") != null && !request.getParameter("hasArea").isEmpty()) { - wherestr += " and e.areaid is not null "; - } - if (request.getParameter("name") != null && !request.getParameter("name").isEmpty()) { - wherestr += " and u.caption like '%" + request.getParameter("name") + "%'"; - } - String insdt = request.getParameter("reservationtimeD"); - if (insdt != null && !insdt.equals("")) { - String[] str = insdt.split("~"); - wherestr += " and e.inTime between'" + str[0] + "'and'" + str[1] + "'"; - } - PageHelper.startPage(page, rows); - List list = this.enterRecordService.selectListByWhere(wherestr + orderstr); - for (EnterRecord enterRecord : list) { - User enter= this.userService.getUserById(enterRecord.getEnterid()); - if(enter==null){ - enter = new User(); - UserOutsiders userOutsiders = userOutsidersService.selectById(enterRecord.getEnterid()); - if(userOutsiders!=null){ - enter.setId(enterRecord.getEnterid()); - enter.setCaption(userOutsiders.getName()); - } - } - enterRecord.setEnter(enter); - if (enterRecord.getAreaid() != null && !"".equals(enterRecord.getAreaid())) { - AreaManage areaManage = this.areaManageService.selectById(enterRecord.getAreaid()); - enterRecord.setArea(areaManage); - enterRecord.setAreaText(areaManage.getName()); - //一级区域二级区域区分 - if (!"-1".equals(enterRecord.getArea().getPid())) { - AreaManage area = enterRecord.getArea(); - AreaManage areaManage1 = areaManageService.selectById(area.getPid()); - enterRecord.setAreaT(area); - enterRecord.setArea(areaManage1); - enterRecord.setAreaText(areaManage1.getName() + "——" + area.getName()); - } - } - if (StringUtils.isNotBlank(enterRecord.getIntime())) { - enterRecord.setIntime(enterRecord.getIntime().substring(0,19)); - } - if (StringUtils.isNotBlank(enterRecord.getOuttime())) { - enterRecord.setOuttime(enterRecord.getOuttime().substring(0,19)); - } - if (enterRecord.getDuration() != null) { - enterRecord.setDurationText(CommUtil.secondToDate(enterRecord.getDuration())); - } -// enterRecord.set_state(enterRecord.getState()?"进入":"离开"); - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.enterRecordService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.enterRecordService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/hqconfig/HQAlarmRecordController.java b/src/com/sipai/controller/hqconfig/HQAlarmRecordController.java deleted file mode 100644 index fdb44b1c..00000000 --- a/src/com/sipai/controller/hqconfig/HQAlarmRecordController.java +++ /dev/null @@ -1,798 +0,0 @@ -package com.sipai.controller.hqconfig; - -import java.io.IOException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.service.alarm.AlarmRecordService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.work.AlarmTypesService; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.hsqldb.lib.HashSet; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.hqconfig.HQAlarmRecordService; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.service.process.DataVisualFrameService; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.CommUtil; -import com.sipai.websocket.AlarmWebSocket; -import com.sun.org.apache.bcel.internal.generic.NEW; - -@Controller -@RequestMapping("hqconfig/hqAlarmRecord") -public class HQAlarmRecordController { - @Resource - private HQAlarmRecordService hqAlarmRecordService; - @Resource - private AreaManageService areaManageService; - @Resource - private RiskLevelService riskLevelService; - @Resource - private DataVisualFrameService dataVisualFrameService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private AlarmTypesService alarmTypesService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "hqconfig/hqAlarmRecordList"; - } - - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - - String dt1 = request.getParameter("dt1"); - String dt2 = request.getParameter("dt2"); - - if (dt1 != null && !dt1.equals("")) { - String[] dt = dt1.split("~"); - wherestr += " and '" + dt[0] + "' <= insdt and insdt <= '" + dt[1] + "'"; - } - - if (dt2 != null && !dt2.equals("")) { - String[] dt = dt2.split("~"); - wherestr += " and '" + dt[0] + "' <= eliminatedt and eliminatedt <= '" + dt[1] + "'"; - } - -// System.out.println(wherestr); - - /*String startdt = request.getParameter("startdt"); - if (startdt != null && startdt.trim().length() > 0) { - wherestr += "and insdt >= '" + startdt + " 00:00' "; - } - String enddt = request.getParameter("enddt"); - if (enddt != null && enddt.trim().length() > 0) { - wherestr += "and insdt <= '" + enddt + " 23:59' "; - } - String startdt2 = request.getParameter("startdt2"); - if (startdt2 != null && startdt2.trim().length() > 0) { - wherestr += "and confirmdt >= '" + startdt2 + " 00:00' "; - } - String enddt2 = request.getParameter("enddt2"); - if (enddt2 != null && enddt2.trim().length() > 0) { - wherestr += "and confirmdt <= '" + enddt2 + " 23:59' "; - } - - if ("all".equals(request.getParameter("risklevelForSelect"))) { - PageHelper.startPage(page, rows); - }*/ - - - /*String dataVisualFramename = request.getParameter("dataVisualFramename"); - String fid = ""; - if (request.getParameter("dataVisualFramename") != null && !request.getParameter("dataVisualFramename").isEmpty()) { - List oneAreaList = this.areaManageService.selectListByWhere( - String.format("where name = '%s' order by insdt", dataVisualFramename)); - for (AreaManage areaManage : oneAreaList) { - fid = areaManage.getFid(); - } - } - - if (fid != null && !"".equals(fid.trim())) { - List areaManages = this.areaManageService. - selectListByWhere("where fid = '" + fid + "' order by name"); - if (areaManages != null && areaManages.size() > 0) { - String aids = "('"; - for (AreaManage areaManage : areaManages) { - aids += areaManage.getId() + "','"; - } - aids += "')"; - wherestr += " and areaid in " + aids; - } - }*/ - - //报警状态筛选 - if (request.getParameter("riskStatusForSelect") != null && !request.getParameter("riskStatusForSelect").isEmpty()) { - if ("all".equals(request.getParameter("riskStatusForSelect"))) { - - } else { - wherestr += "and state = '" + request.getParameter("riskStatusForSelect") + "'"; - } - } - - //报警等级筛选 - if (request.getParameter("risklevelForSelect") != null && !request.getParameter("risklevelForSelect").isEmpty()) { - if ("all".equals(request.getParameter("risklevelForSelect"))) { - - } else { - wherestr += "and riskLevel = '" + request.getParameter("risklevelForSelect") + "'"; - } - } - -// if ("all".equals(request.getParameter("risklevelForSelect"))) { -// PageHelper.startPage(page, rows); -// } - - //根据区域id筛选 - String search_areaId = request.getParameter("search_areaId"); - if (search_areaId != null && !search_areaId.equals("")) { - List list_all = this.areaManageService.selectSimpleListByWhere("where pid = '" + search_areaId + "'"); - String ids = "'" + search_areaId + "',"; - for (AreaManage areaManage : list_all) { - ids += "'" + areaManage.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - wherestr += " and areaid in (" + ids + ") "; - } - - //根据报警类型id筛选 - String search_typeId = request.getParameter("search_typeId"); - if (search_typeId != null && !search_typeId.equals("")) { - List list_all = this.alarmTypesService.selectSimpleListByWhere("where pid = '" + search_typeId + "'"); - String ids = "'" + search_typeId + "',"; - for (AlarmTypes alarmTypes : list_all) { - ids += "'" + alarmTypes.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - wherestr += " and alarmTypeid in (" + ids + ") "; - } - - //模糊搜索报警内容 - String searchContent = request.getParameter("searchContent"); - if (searchContent != null && !searchContent.equals("")) { - wherestr += " and name like '%" + searchContent + "%' "; - } - - PageHelper.startPage(page, rows); - List list = this.hqAlarmRecordService.selectListByWhere(wherestr + orderstr); - - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - HQAlarmRecord hqAlarmRecordInner = list.get(i); - - List areaManageList_id = this.areaManageService.selectListByWhere("where 1=1 and id = '" + hqAlarmRecordInner.getAreaid() + "'"); - String areaName = ""; - if (areaManageList_id != null && areaManageList_id.size() > 0) { - areaName = areaManageList_id.get(0).getName(); - List areaManageList_pid = this.areaManageService.selectListByWhere("where 1=1 and id = '" + areaManageList_id.get(0).getPid() + "'"); - if (areaManageList_pid != null && areaManageList_pid.size() > 0) { - areaName = areaManageList_pid.get(0).getName() + "——" + areaManageList_id.get(0).getName(); - } - } - hqAlarmRecordInner.setAreaName(areaName); - - if (StringUtils.isNotBlank(list.get(i).getAlarmtypeid()) && "3".equals(alarmTypesService.selectById(list.get(i).getAlarmtypeid()).getPid())) { - hqAlarmRecordInner.setAlarmtypeid("3"); - } - - /*if (request.getParameter("risklevelForSelect") != null && !request.getParameter("risklevelForSelect").isEmpty()) { - if ("all".equals(request.getParameter("risklevelForSelect"))) { - wherestr = "where 1=1 and id = '" + hqAlarmRecordInner.getAlarmtypeid() + "'"; - } else { - wherestr = "where 1=1 and id = '" + hqAlarmRecordInner.getAlarmtypeid() + "' and riskLevel = '" + request.getParameter("risklevelForSelect") + "'"; - } - }*/ - - - /*List riskLevelList = this.riskLevelService.selectListByWhere(wherestr); - if (riskLevelList != null && riskLevelList.size() > 0) { - hqAlarmRecordInner.setRiskLevel(riskLevelList.get(0).getRisklevel()); - }*/ - } - } - - /* String hqrid = "('"; - if (request.getParameter("risklevelForSelect") != null && !request.getParameter("risklevelForSelect").isEmpty()) { - List list2 = new LinkedList<>(); - - if ("all".equals(request.getParameter("risklevelForSelect"))) { - - } else { - for (HQAlarmRecord hqAlarmRecord : list) { - if (hqAlarmRecord.getRiskLevel() != null && hqAlarmRecord.getRiskLevel().equals(request.getParameter("risklevelForSelect"))) { - list2.add(hqAlarmRecord); - hqrid += hqAlarmRecord.getId(); - hqrid += "','"; - } - } - - hqrid += "')"; - wherestr = String.format("where id in %s", hqrid); - PageHelper.startPage(page, rows); - list = this.hqAlarmRecordService.selectListByWhere(wherestr + orderstr); - - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - HQAlarmRecord hqAlarmRecordInner = list.get(i); - - List areaManageList = this.areaManageService.selectListByWhere("where 1=1 and id = '" + hqAlarmRecordInner.getAreaid() + "'"); - if (areaManageList != null && areaManageList.size() > 0) { - hqAlarmRecordInner.setAreaName(areaManageList.get(0).getName()); - } - - if (request.getParameter("risklevelForSelect") != null && !request.getParameter("risklevelForSelect").isEmpty()) { - if ("all".equals(request.getParameter("risklevelForSelect"))) { - wherestr = "where 1=1 and id = '" + hqAlarmRecordInner.getAlarmtypeid() + "'"; - } else { - wherestr = "where 1=1 and id = '" + hqAlarmRecordInner.getAlarmtypeid() + "' and riskLevel = '" + request.getParameter("risklevelForSelect") + "'"; - } - } - - List riskLevelList = this.riskLevelService.selectListByWhere(wherestr); - if (riskLevelList != null && riskLevelList.size() > 0) { - hqAlarmRecordInner.setRiskLevel(riskLevelList.get(0).getRisklevel()); - } - } - } - } - - }*/ - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getListForMainPage.do") - public String getListForMainPage(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " a.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - if (request.getParameter("risklevelForSelect") != null && !"".equals(request.getParameter("risklevelForSelect").trim())) { - if ("all".equals(request.getParameter("risklevelForSelect"))) { - } else { - wherestr += " and r.riskLevel = '" + request.getParameter("risklevelForSelect") + "' "; - } - } - if (request.getParameter("riskStatusForSelect") != null && !"".equals(request.getParameter("riskStatusForSelect").trim())) { - wherestr += " and a.state = '" + request.getParameter("riskStatusForSelect") + "' "; - } - PageHelper.startPage(page, rows); - List list = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json.toString() + "}"; - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/doEdit.do") - public String doedit(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - HQAlarmRecord hqAlarmRecord = this.hqAlarmRecordService.selectById(id); - List areaManageList = this.areaManageService.selectListByWhere("where 1=1 and id = '" + hqAlarmRecord.getAreaid() + "'"); - if (areaManageList != null && areaManageList.size() > 0) { - hqAlarmRecord.setAreaName(areaManageList.get(0).getName()); - } - -// List riskLevelList = this.riskLevelService.selectListByWhere("where 1=1 and id = '" + hqAlarmRecord.getAlarmtypeid() + "'"); -// if (riskLevelList != null && riskLevelList.size() > 0) { -// hqAlarmRecord.setRiskLevel(riskLevelList.get(0).getRisklevel()); -// } - model.addAttribute("hqAlarmRecord", hqAlarmRecord); - return "hqconfig/hqAlarmRecordEdit"; - -// User cu = (User) request.getSession().getAttribute("cu"); -// String userId = cu.getId(); -// -// Result result = new Result(); -// HQAlarmRecord hqAlarmRecord = this.hqAlarmRecordService.selectById(id); -// if(hqAlarmRecord.getEliminatedt() == null){ -// hqAlarmRecord.setEliminatedt(CommUtil.nowDate()); -// } -// hqAlarmRecord.setConfirmdt(CommUtil.nowDate()); -// hqAlarmRecord.setConfirmerid(userId); -// hqAlarmRecord.setState("3"); -// -// int code = this.hqAlarmRecordService.update(hqAlarmRecord); -// if (code == Result.SUCCESS) { -// result = Result.success(code); -// } else { -// result = Result.failed("删除失败"); -// } -// -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; - - } - - @RequestMapping("/doEditConfirm.do") - public String doEditConfirm(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "content") String content) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - Result result = new Result(); - HQAlarmRecord hqAlarmRecord = this.hqAlarmRecordService.selectById(id); - if (hqAlarmRecord.getEliminatedt() == null) { - hqAlarmRecord.setEliminatedt(CommUtil.nowDate()); - } - hqAlarmRecord.setConfirmdt(CommUtil.nowDate()); - hqAlarmRecord.setConfirmerid(userId); - hqAlarmRecord.setState("3"); - hqAlarmRecord.setRemark(content); - - int code = this.hqAlarmRecordService.update(hqAlarmRecord); - if (code == Result.SUCCESS) { - result = Result.success(code); - /*JSONObject alarmjsonObject = new JSONObject(); - alarmjsonObject.put("type", "alarm"); - alarmjsonObject.put("alarmid", hqAlarmRecord.getId()); - alarmjsonObject.put("area", hqAlarmRecord.getAreaName()); - alarmjsonObject.put("areaid", hqAlarmRecord.getAreaid()); - alarmjsonObject.put("level", "E"); - AreaManage areaManage = areaManageService.selectById(hqAlarmRecord.getAreaid()); - DataVisualFrame dataVisualFrame = dataVisualFrameService.selectById(areaManage.getFid()); - alarmjsonObject.put("dataframe", dataVisualFrame.getName()); - alarmjsonObject.put("dataframeid", dataVisualFrame.getId()); - for(AlarmWebSocket websocket : AlarmWebSocket.webSockets){ - websocket.sendMessage(alarmjsonObject.toString()); - }*/ - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("hqAlarmRecord") HQAlarmRecord hqAlarmRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - String userName = cu.getName(); - if ("2".equals(hqAlarmRecord.getState())) { - hqAlarmRecord.setEliminatedt(CommUtil.nowDate()); - } else if ("3".equals(hqAlarmRecord.getState())) { - hqAlarmRecord.setConfirmdt(CommUtil.nowDate()); - hqAlarmRecord.setConfirmerid(userId); - } - - int code = this.hqAlarmRecordService.update(hqAlarmRecord); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.hqAlarmRecordService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.hqAlarmRecordService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getAlarmCountJson.do") - public String getAlarmCountJson(HttpServletRequest request, Model model) { - String fid = request.getParameter("fid"); - String where = "where state = 1 "; - if (fid != null && !"".equals(fid.trim())) { - List areaManages = this.areaManageService. - selectListByWhere("where fid = '" + fid + "' order by name"); - if (areaManages != null && areaManages.size() > 0) { - String aids = "('"; - for (AreaManage areaManage : areaManages) { - aids += areaManage.getId() + "','"; - } - aids += "')"; - where += " and a.areaid in " + aids; - } - } - String order = " order by insdt desc"; - List count = this.hqAlarmRecordService.selectListByWhere(where + order); - List count_A = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and riskLevel = 'A'" + order); - List count_B = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and riskLevel = 'B'" + order); - List count_C = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and riskLevel = 'C'" + order); - List count_D = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and riskLevel = 'D'" + order); - JSONObject alarmJson = new JSONObject(); - alarmJson.put("count", count == null ? 0 : count.size()); - alarmJson.put("count_A", count_A == null ? 0 : count_A.size()); - alarmJson.put("count_B", count_B == null ? 0 : count_B.size()); - alarmJson.put("count_C", count_C == null ? 0 : count_C.size()); - alarmJson.put("count_D", count_D == null ? 0 : count_D.size()); - model.addAttribute("result", alarmJson.toString()); - return "result"; - } - - @RequestMapping("/getRiskLevelNumsByArea.do") - public String getRiskLevelNumsByArea(HttpServletRequest request, Model model) { -// String fid = request.getParameter("fid"); - String dataVisualFramename = request.getParameter("dataVisualFramename"); - List oneAreaList = this.areaManageService.selectListByWhere( - String.format("where name = '%s' ", dataVisualFramename)); - String areaid = ""; - String fid = ""; - for (AreaManage areaManage : oneAreaList) { - areaid = areaManage.getId(); - fid = areaManage.getFid(); - } - String where = "where 1 = 1 "; - - if (fid != null && !"".equals(fid.trim())) { - List areaManages = this.areaManageService. - selectListByWhere("where fid = '" + fid + "' order by name"); - if (areaManages != null && areaManages.size() > 0) { - String aids = "('"; - for (AreaManage areaManage : areaManages) { - aids += areaManage.getId() + "','"; - } - aids += "')"; - where += " and a.areaid in " + aids; - } - } - - String order = " order by insdt desc"; -// List count = this.hqAlarmRecordService.selectListByWhere(where + order); - List count_A = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and a.state = '1' and riskLevel = 'A'" + order); - List count_B = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and a.state = '1' and riskLevel = 'B'" + order); - List count_C = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and a.state = '1' and riskLevel = 'C'" + order); - List count_D = this.hqAlarmRecordService.selectAlarmAndRiskLevelByWhere - (where + " and a.state = '1' and riskLevel = 'D'" + order); - JSONObject alarmJson = new JSONObject(); - alarmJson.put("count_A", count_A == null ? 0 : count_A.size()); - alarmJson.put("count_B", count_B == null ? 0 : count_B.size()); - alarmJson.put("count_C", count_C == null ? 0 : count_C.size()); - alarmJson.put("count_D", count_D == null ? 0 : count_D.size()); - model.addAttribute("result", alarmJson.toString()); - return "result"; - } - - @RequestMapping("/getAlarmJson.do") - public String getAlarmJson(HttpServletRequest request, Model model) { - //泰和接口参数 - String remark = request.getParameter("remark"); - String whereSrt = ""; - if (remark != null && !"".equals(remark)) { - whereSrt = " and remark like '%TH%'"; - } - List areaManages = this.areaManageService.selectListByWhere( - "where pid <> '0' " + whereSrt + " order by pid"); - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < areaManages.size(); i++) { - JSONObject jsonObject = new JSONObject(); - List hqAlarmRecords = this.hqAlarmRecordService. - selectAlarmAndRiskLevelByWhere("where state = '1' and a.areaid = '" - + areaManages.get(i).getId() + "' order by insdt desc"); - jsonObject.put("areaid", areaManages.get(i).getId()); - if (hqAlarmRecords != null && hqAlarmRecords.size() > 0) { - String[] alarmids = new String[hqAlarmRecords.size()]; - String[] levels = new String[hqAlarmRecords.size()]; - for (int j = 0; j < hqAlarmRecords.size(); j++) { - alarmids[j] = hqAlarmRecords.get(j).getId(); - if (hqAlarmRecords.get(j).getRiskLevel_entity() != null) { - levels[j] = hqAlarmRecords.get(j).getRiskLevel_entity().getRisklevel(); - } - } - jsonObject.put("alarmids", alarmids); - jsonObject.put("levels", levels); - } else { - jsonObject.put("alarmids", new String[0]); - jsonObject.put("levels", new String[0]); - } - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - @RequestMapping("/showAlarms.do") - public String showAlarms(HttpServletRequest request, Model model) { - String level = request.getParameter("level"); - model.addAttribute("level", request.getParameter("level")); - return "hqconfig/showAlarms"; - } - - - /** - * 接收app的 不合格报警 和 超时报警的恢复 - * - * @param request - * @param model - * @param id - * @param type - * @param name - * @param unitId - * @param pointId - * @param pointName - * @return - */ - @RequestMapping("/saveAlarm4app.do") - public String saveAlarm4app(HttpServletRequest request, Model model, - @RequestParam(value = "patrolId") String patrolId, - @RequestParam(value = "type") String type,//0:超时 1:不合格 - @RequestParam(value = "name", required = false) String name,//中文名 - @RequestParam(value = "unitId", required = false) String unitId,//厂id - @RequestParam(value = "pointId", required = false) String pointId, - @RequestParam(value = "pointName", required = false) String pointName) {//任务点名称 - - int res = 0; - //超时 - if (type != null && type.equals("0")) { - List list = hqAlarmRecordService.selectListByWhere("where targetid = '" + patrolId + "'"); - if (list != null && list.size() > 0) { - HQAlarmRecord alarmRecord = list.get(0); - - /*//区域点:0 - if (list.get(0).getPointCode().equals("0")) { - alarmRecord.setAlarmtypeid("17"); - } - //安全用具:1 - if (list.get(0).getPointCode().equals("1")) { - alarmRecord.setAlarmtypeid("11"); - } - //消防器具:2 - if (list.get(0).getPointCode().equals("2")) { - alarmRecord.setAlarmtypeid("13");//只能写死id 无法查询 - }*/ - - alarmRecord.setState("2"); - this.hqAlarmRecordService.update(alarmRecord); - } - } - - //不合格 - if (type != null && type.equals("1")) { - HQAlarmRecord alarmRecord = new HQAlarmRecord(); - alarmRecord.setId(CommUtil.getUUID()); - alarmRecord.setInsdt(CommUtil.nowDate()); - - List list = patrolPointService.selectListByWhere("where id = '" + pointId + "'"); - if (list != null && list.size() > 0) { - alarmRecord.setAreaid(list.get(0).getAreaId()); - - //区域点:0 - if (list.get(0).getPointCode().equals("0")) { - alarmRecord.setAlarmtypeid("17"); - } - //安全用具:1 - if (list.get(0).getPointCode().equals("1")) { - alarmRecord.setAlarmtypeid("11"); - } - //消防器具:2 - if (list.get(0).getPointCode().equals("2")) { - alarmRecord.setAlarmtypeid("13");//只能写死id 无法查询 - } - - } else { - alarmRecord.setAreaid(""); - } - -// alarmRecord.setAlarmtypeid("18");//只能写死id 无法查询 - alarmRecord.setRiskLevel("D"); - alarmRecord.setUnitId(unitId); - alarmRecord.setTargetid(pointId); - alarmRecord.setState("1"); - alarmRecord.setName("[任务不合格报警]" + name); - - List list_alarm = hqAlarmRecordService.selectListByWhere("where targetid = '" + pointId + "' and alarmTypeid = '" + alarmRecord.getAlarmtypeid() + "' and state = '1' "); - if (list_alarm != null && list_alarm.size() > 0) { - //已存在 - } else { - this.hqAlarmRecordService.save(alarmRecord); - } - - } - - model.addAttribute("result", CommUtil.toJson(res)); - return "result"; - } - - @ApiOperation(value = "风险诊断分析", notes = "风险诊断分析", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - - }) - @RequestMapping(value = "/showOverview.do", method = RequestMethod.GET) - public String showOverview(HttpServletRequest request, Model model) { - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt); - return "/hqconfig/hqAlarmRecordOverview"; - } - - @ApiOperation(value = "巡检总览---各类任务数折线图数据", notes = "巡检总览---各类任务数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getAlarmRecordLevelType.do", method = RequestMethod.GET) - public String getAlarmRecordLevelType(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONObject jsonObject = hqAlarmRecordService.getAnalysisDataLevel(unitId, dateType, patrolDate); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 巡检总览---各类任务数折线图数据 - * - * @param request - * @param model - * @param unitId - * @param dateType - * @param patrolDate - * @return - */ - @ApiOperation(value = "巡检总览---各类任务数折线图数据", notes = "巡检总览---各类任务数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getAlarmRecordPie.do", method = RequestMethod.GET) - public String getAlarmRecordPie(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONObject jsonObject = hqAlarmRecordService.getAnalysisDataLevelPie(unitId, dateType, patrolDate); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "巡检总览---区域风险数折线图数据", notes = "巡检总览---区域风险数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getAlarmRecordAreaType.do", method = RequestMethod.GET) - public String getAlarmRecordAreaType(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONArray jsonArray = hqAlarmRecordService.getAnalysisDataArea(unitId, dateType, patrolDate); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "巡检总览---区域风险数折线图数据", notes = "巡检总览---区域风险数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getAlarmRecordAreaTypePie.do", method = RequestMethod.GET) - public String getAlarmRecordAreaTypePie(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - com.alibaba.fastjson.JSONArray jsonArray = hqAlarmRecordService.getAnalysisDataAreaPie(unitId, dateType, patrolDate); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 安全评分-实时 - */ - @RequestMapping("/getSecureScore.do") - public String getSecureScore(HttpServletRequest request, Model model) { - int score = hqAlarmRecordService.secureScoreSS(); - JSONObject alarmJson = new JSONObject(); - alarmJson.put("data", score); - model.addAttribute("result", alarmJson.toString()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/hqconfig/PositionsCasualController.java b/src/com/sipai/controller/hqconfig/PositionsCasualController.java deleted file mode 100644 index d1958dc4..00000000 --- a/src/com/sipai/controller/hqconfig/PositionsCasualController.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.controller.hqconfig; - -import com.sipai.service.hqconfig.PositionsCasualService; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.annotation.Resource; - -@Controller -@RequestMapping("hqconfig/positionsCasual") -public class PositionsCasualController { - @Resource - private PositionsCasualService positionsCasualService; - -} diff --git a/src/com/sipai/controller/hqconfig/RiskGradeController.java b/src/com/sipai/controller/hqconfig/RiskGradeController.java deleted file mode 100644 index eea01823..00000000 --- a/src/com/sipai/controller/hqconfig/RiskGradeController.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.controller.hqconfig; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -@RequestMapping("hqconfig/riskGrade") -public class RiskGradeController { -// @RequestMapping("/showList.do") -// public String showList(HttpServletRequest request,Model model){ -// return "hqconfig/riskGradeList"; -// } -} diff --git a/src/com/sipai/controller/hqconfig/RiskLevelController.java b/src/com/sipai/controller/hqconfig/RiskLevelController.java deleted file mode 100644 index a1c680d4..00000000 --- a/src/com/sipai/controller/hqconfig/RiskLevelController.java +++ /dev/null @@ -1,257 +0,0 @@ -package com.sipai.controller.hqconfig; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.service.work.AlarmTypesService; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("hqconfig/riskGrade") -public class RiskLevelController { - @Resource - private RiskLevelService riskLevelService; - @Resource - private AreaManageService areaManageService; - @Resource - private AlarmTypesService alarmTypesService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "hqconfig/riskGradeList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - if (request.getParameter("risklevelForSelect") != null && !request.getParameter("risklevelForSelect").isEmpty()) { - if ("all".equals(request.getParameter("risklevelForSelect"))) { - } else { - wherestr += "and riskLevel = '" + request.getParameter("risklevelForSelect") + "'"; - } - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and securityContent like '%" + request.getParameter("search_name") + "%'"; - } - if (request.getParameter("safetyinspectionnameSelect") != null && !request.getParameter("safetyinspectionnameSelect").isEmpty()) { - List list = alarmTypesService.selectListByWhere("where pid = '" + request.getParameter("safetyinspectionnameSelect") + "'"); - if(list!=null && list.size()>0){ - String typeId = ""; - for(AlarmTypes alarmTypes: list){ - typeId += alarmTypes.getId()+","; - } - typeId = typeId.substring(0,typeId.length()-1); - typeId = typeId.replace(",","','"); - wherestr += "and safetyinspection in ('" + typeId + "')"; - } - wherestr += "and securityContent like '%" + request.getParameter("search_name") + "%'"; - } - PageHelper.startPage(page, rows); - List list = this.riskLevelService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doadd(HttpServletRequest request, Model model) { - List list = areaManageService.selectListByWhere("where 1=1"); - request.setAttribute("list", list); - return "hqconfig/riskLevelAdd"; - } - - @RequestMapping("/doSave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute RiskLevel riskLevel) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - riskLevel.setId(id); - riskLevel.setInsuser(cu.getId()); - riskLevel.setInsdt(CommUtil.nowDate()); -// String deptIds = request.getParameter("place"); - -// if(deptIds != null || !deptIds.isEmpty()){ -// String[] ids = deptIds.split(","); -// String areaName = ""; -// for (int i = 0; i < ids.length; i++) { -// String place = areaManageService.selectById(ids[i]).getName(); -// areaName += place + ","; -// } -// areaName = areaName.substring(0,areaName.length()-1); -// riskLevel.setPlace(areaName); -// } - int result = this.riskLevelService.save(riskLevel); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doEdit.do") - public String doedit(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - RiskLevel riskLevel = this.riskLevelService.selectById(id); -// String[] areaName = riskLevel.getPlace().split(","); -// Map map = new HashMap<>(); -// JSONArray allJson = new JSONArray(); -// for(int i=0;i list = areaManageService.selectListByWhere("where 1 = 1 and name = '" + areaName[i].trim() + "'"); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("id",list.get(0).getId()); -// allJson.add(jsonObject); -// } -// JSONArray rolesjson = JSONArray.fromObject(allJson); -// model.addAttribute("place",allJson); - model.addAttribute("riskLevel", riskLevel); - return "hqconfig/riskLevelEdit"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("riskLevel") RiskLevel riskLevel) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); -// String deptIds = request.getParameter("place"); -// -// if(deptIds != null || !deptIds.isEmpty()){ -// String[] ids = deptIds.split(","); -// String areaName = ""; -// for (int i = 0; i < ids.length; i++) { -// String place = areaManageService.selectById(ids[i]).getName(); -// areaName += place + ","; -// } -// areaName = areaName.substring(0,areaName.length()-1); -// riskLevel.setPlace(areaName); -// } - int code = this.riskLevelService.update(riskLevel); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.riskLevelService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.riskLevelService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getAreaManage.do") - public String getProcessType4Tree(HttpServletRequest request, Model model) { - - List list = areaManageService.selectListByWhere("where 1 = 1"); - - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("text", list.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/getArea4point.do") - public String getArea4point(HttpServletRequest request, Model model) { - - String whereStr = "where pid = '-1'"; - List list = areaManageService.selectListByWhere(whereStr); - - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getName()); - jsonObject.put("text", list.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request, Model model) { - List list = this.riskLevelService.selectListByWhere("order by securitycontent"); - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("text", list.get(i).getSecuritycontent()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/hqconfig/WorkModelController.java b/src/com/sipai/controller/hqconfig/WorkModelController.java deleted file mode 100644 index b14446d7..00000000 --- a/src/com/sipai/controller/hqconfig/WorkModelController.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.sipai.controller.hqconfig; - -import java.util.List; -import java.util.Objects; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.hqconfig.WorkModel; -import com.sipai.entity.user.User; -import com.sipai.service.hqconfig.WorkModelService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("hqconfig/workModel") -public class WorkModelController { - - @Resource - private WorkModelService workModelService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "hqconfig/workModelList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr = "where 1=1 "; - PageHelper.startPage(page, rows); - List list = this.workModelService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - System.out.println(result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doadd(HttpServletRequest request,Model model){ - return "hqconfig/workModelAdd"; - } - - @RequestMapping("/doSave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute WorkModel workModel){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - workModel.setId(id); - workModel.setInsuser(cu.getId()); - workModel.setInsdt(CommUtil.nowDate()); - int result = this.workModelService.save(workModel); - - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doEdit.do") - public String doedit(HttpServletRequest request,Model model,@RequestParam(value = "id") String id){ - WorkModel workModel = this.workModelService.selectById(id); - model.addAttribute("workModel", workModel); - return "hqconfig/workModelEdit"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("workModel") WorkModel workModel){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - if (workModel.getRiskLevelId() == null) { - workModel.setRiskLevelId(""); - } - int code = this.workModelService.update(workModel); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.workModelService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.workModelService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request,Model model){ - List list = this.workModelService.selectListByWhere - ("where 1=1 and status = 1 order by name"); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i company = unitService.getCompanyByUserIdAndType(cu.getId(),"");//获取用户公司下的所有部门、公司 - //List company = unitService.getCompaniesByUserId(cu.getId());//获取用户公司下的所有公司 - //Unit unit = unitService.getUnitById(cu.getPid());//获取用户的部门/公司 - String order=""; - order = "publishtime1 desc,modifydt desc "; - String orderstr=" order by "+" "+order; - String wherestr = "where ("+CommUtil.getwherestr("b.recvid", "", cu).substring(6);//只取where后面部分 - wherestr += " or a.typeid='"+this.InfoType_System+"')"; - wherestr +=" and '"+CommUtil.nowDate()+"'> publishtime1"; - wherestr += " and '"+CommUtil.nowDate().substring(0, 10)+"'<= publishtime2"; - List list = this.infoService.selectListWithRecvByWhere(wherestr+orderstr); - if(list !=null && list.size()>0){ - for(int i=0;i10){ - request.setAttribute("list", list.subList(0, 9)); - }else{ - request.setAttribute("list", list); - } - }else{ - //主要检测结果 若没有记录,则不显示公告栏 - return "result"; - } - //model.addAttribute("list",list); - return "info/infoForMain"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "info/showlist.do", cu); - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and title like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and typeid like '%"+request.getParameter("search_code")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.infoService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by insdt desc"; - - String wherestr=CommUtil.getwherestr("insuser", "scope=all", cu); - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and title like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and typeid like '%"+request.getParameter("search_code")+"%' "; - } - - List list = this.infoService.selectListTopByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/getViewList.do") - public ModelAndView getViewList(HttpServletRequest request,Model model, - String sdt,String edt, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - //List company = unitService.getCompanyByUserIdAndType(cu.getId(),"");//获取用户公司下的所有部门、公司 - //List company = unitService.getCompaniesByUserId(cu.getId());//获取用户公司下的所有公司 - //Unit unit = unitService.getUnitById(cu.getPid());//获取用户的部门/公司 - - if(sort==null){ - sort = " publishtime1 "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr = "where ("+CommUtil.getwherestr("b.recvid", "", cu).substring(6);//只取where后面部分 - wherestr += " or a.typeid='"+this.InfoType_System+"')"; - //wherestr +=" and '"+CommUtil.nowDate()+"'> publishtime1"; - //wherestr += " and '"+CommUtil.nowDate().substring(0, 10)+"'<= publishtime2"; - wherestr +=" and publishtime1 between "+"'"+sdt+"'"+" and "+"'"+edt+"'"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and title like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and typeid like '%"+request.getParameter("search_code")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.infoService.selectListWithRecvByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - request.setAttribute("id", CommUtil.getUUID()); - model.addAttribute("nowdate", CommUtil.nowDate()); - model.addAttribute("userName", cu.getCaption()); - return "info/infoAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - Info info = this.infoService.selectById(id); - if(info.getPublishtime2().indexOf("2900-01-01")!=-1){ - info.setPublishtime2(""); - } - model.addAttribute("info", info); - - List infoRecv = this.infoRecvService.selectListByWhere(" where masterid='"+info.getId()+"'"); - model.addAttribute("unit", this.unitService.getInfoRecvName(infoRecv)); - - return "info/infoEdit"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String userId = request.getParameter("id"); - Info info = this.infoService.selectById(userId); - model.addAttribute("info", info); - model.addAttribute("user", userService.getUserById(info.getInsuser())); - return "info/infoView"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Info info){ - User cu= (User)request.getSession().getAttribute("cu"); - - String id = CommUtil.getUUID(); - if (info.getId()==null) { - info.setId(id); - } - info.setInsuser(cu.getId()); - info.setInsdt(CommUtil.nowDate()); - info.setModifydt(info.getInsdt()); - if(info.getPublishtime2().equals("")|| info.getPublishtime2()==null){ - info.setPublishtime2("2900-01-01 00:00:00"); - } - int result = this.infoService.save(info); - - String[] recvidarr = null; - String recvids = info.getRecvid(); - if(recvids!=null){ - recvidarr= recvids.split(","); - } - if(result == 1){ - if(recvidarr!=null &&recvidarr.length>0){ - for(int i=0;i0){ - for(int i=0;i list = this.logInfoService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String resultStr="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - - model.addAttribute("result",resultStr); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/kpi/KpiActivitiController.java b/src/com/sipai/controller/kpi/KpiActivitiController.java deleted file mode 100644 index 8fd2a2bb..00000000 --- a/src/com/sipai/controller/kpi/KpiActivitiController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.controller.kpi; - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.kpi.KpiTaskListVO; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.kpi.*; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/kpi/KpiTask") -public class KpiActivitiController { - - @Resource - private KpiResultIndicatorService kpiResultIndicatorService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private KpiResultIndicatorWeightService kpiResultIndicatorWeightService; - - @Resource - private KpiResultService kpiResultService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiWorkflowService kpiWorkflowService; - @Resource - private WorkflowService workflowService; - - /** - * 绩效考核代办页面 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showList.do") - public String showListForMark(HttpServletRequest request, Model model - - ) throws Exception { - model.addAttribute(ProcessType.KPI_MAKE_PLAN.getId(), ProcessType.KPI_MAKE_PLAN.getId()); - model.addAttribute(ProcessType.KPI_MARK.getId(), ProcessType.KPI_MARK.getId()); - return "kpi/kpiTaskList"; - } - - /** - * 获绩效考核代办列表 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "processDefinitionKey") String processDefinitionKey) { - //任务负责人 - User cu = (User) request.getSession().getAttribute("cu"); - - List list = kpiWorkflowService.getTodoList(processDefinitionKey, cu,page, rows); - int count= kpiWorkflowService.getTodoListRowCount(processDefinitionKey, cu); - String json =JSON.toJSONString(list); - String result = "{\"total\":" + count + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取待办条数 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @RequestMapping("/getTodoListRowCount.do") - @ResponseBody - public Result getTodoListRowCount(HttpServletRequest request, Model model, - @RequestParam(value = "processDefinitionKey") String processDefinitionKey) { - //任务负责人 - User cu = (User) request.getSession().getAttribute("cu"); - return Result.success(kpiWorkflowService.getTodoListRowCount(processDefinitionKey, cu)); - } -} diff --git a/src/com/sipai/controller/kpi/KpiApplyBizController.java b/src/com/sipai/controller/kpi/KpiApplyBizController.java deleted file mode 100644 index d8fb9f7d..00000000 --- a/src/com/sipai/controller/kpi/KpiApplyBizController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.controller.kpi; - -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.kpi.KpiActivitiRequest; -import com.sipai.entity.kpi.KpiApplyBizBo; -import com.sipai.entity.kpi.KpiPlanStaffBo; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.kpi.*; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.JobServiceImpl; -import com.sipai.service.user.UserService; -import com.sipai.tools.DateUtil; -import org.activiti.engine.impl.task.TaskDefinition; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; - -/** - * 计划编制:编制计划 - * - * @Author: lichen - * @Date: 2021/10/11 - **/ -@Controller -@RequestMapping("/kpi/KpiApplyBiz") -public class KpiApplyBizController { - @Resource - private MsgServiceImpl msgService; - - @Resource - private UserService userService; - @Resource - private KpiWorkflowService kpiWorkflowService; - @Resource - private KpiPlanDetailService kpiPlanDetailService; - - @Resource - private KpiPlanStaffService kpiPlanStaffService; - - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - @Resource - private KpiApplyBizService kpiApplyBizService; - @Resource - private JobServiceImpl jobService; - - @Resource - private KpiDimensionService kpiDimensionService; - - /** - * 页面迁移:提交审核 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/applyPage.do") - public String applyPage(HttpServletRequest request, Model model, - @RequestParam String applyBizId) { - - model.addAttribute("applyBizId", applyBizId); - return "kpi/makePlanApply"; - } - - - /** - * 提交申请 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/apply.do") - @ResponseBody - public Result apply(HttpServletRequest request, KpiActivitiRequest applyRequest) { - - User cu = (User) request.getSession().getAttribute("cu"); - - return kpiApplyBizService.startProcess(applyRequest, cu); - } - - - /** - * 页面迁移:审核计划页面 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showMakePlanAudit.do") - public String showMakePlanAudit(HttpServletRequest request, - String applyBizId, - String taskId, - Model model) throws Exception { - KpiApplyBizBo kpiApplyBiz = kpiApplyBizService.selectBoById(applyBizId); - TaskDefinition taskDefinition = kpiWorkflowService.getNextTaskInfo(taskId); - if (taskDefinition == null) { - model.addAttribute("hasNextAuditor", "0"); - } else { - model.addAttribute("hasNextAuditor", "1"); - } - model.addAttribute("kpiApplyBiz", kpiApplyBiz); - model.addAttribute("taskId", taskId); - return "kpi/makePlanAudit"; - } - - /** - * 提交审核 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/audit.do") - @ResponseBody - public Result audit(HttpServletRequest request, KpiActivitiRequest applyRequest) throws Exception { - - User cu = (User) request.getSession().getAttribute("cu"); - return kpiApplyBizService.audit(applyRequest, cu); - } - - /** - * 下发 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/send.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result send(HttpServletRequest request, String id) throws Exception { - - User cu = (User) request.getSession().getAttribute("cu"); - String now = DateUtil.toStr(null, new Date()); - KpiPlanStaffBo kpiPlanStaff = kpiPlanStaffService.selectById(id); - kpiPlanStaff.setStatus(KpiApplyStatusEnum.PlanAccessed.getId()); - kpiPlanStaff.setUpdateTime(now); - kpiPlanStaffService.update(kpiPlanStaff); - - // 给审核对象发送消息 - msgService.insertMsgSend(KpiConstant.MSG_TYPE_KPI, - cu.getCaption() + "于" + now + ",下发了【" + kpiPlanStaff.getKpiPeriodInstance().getPeriodName() + "】考核计划。", - kpiPlanStaff.getObjUserId(), - cu.getId(), "U"); - - return Result.success(); - } - - -} diff --git a/src/com/sipai/controller/kpi/KpiDimensionController.java b/src/com/sipai/controller/kpi/KpiDimensionController.java deleted file mode 100644 index 74cb143d..00000000 --- a/src/com/sipai/controller/kpi/KpiDimensionController.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.DimensionTypeEnum; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.enums.PositionTypeEnum; -import com.sipai.entity.kpi.KpiDimension; -import com.sipai.service.kpi.*; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -/** - * 考核维度管理 - * - * @Author: lichen - * @Date: 2021/10/8 - **/ -@Controller -@RequestMapping("/kpi/KpiDimension") - -public class KpiDimensionController { - - @Resource - private KpiDimensionService kpiDimensionService; - - @Resource - private KpiPlanService kpiPlanService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiPlanDetailService kpiPlanDetailService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - - /** - * 页面迁移:考核维度列表页面 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - model.addAttribute("enableTypeList", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - return "kpi/dimensionList"; - } - - - /** - * 获取考核维度列表 - * - * @return 考核维度对象列表 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "periodType", required = false) String periodType, - @RequestParam(value = "jobType", required = false) String jobType, - @RequestParam(value = "status", required = false) String status - ) { - - String orderstr = " order by period_type asc , job_type asc, morder asc, id asc "; - String wherestr = " where is_deleted = 0 "; - // 启用状态 - if (StringUtils.isNotBlank(status)) { - wherestr += " and status = " + status; - } - if (StringUtils.isNotBlank(periodType)) { - wherestr += " and period_type = " + periodType; - } - if (StringUtils.isNotBlank(jobType)) { - wherestr += " and job_type = " + jobType; - } - - PageHelper.startPage(page, rows); - List list = kpiDimensionService.selectListByWhere(wherestr + orderstr); - for (KpiDimension item : list) { - item.setPeriodTypeName(PeriodTypeEnum.getNameByid(item.getPeriodType())); - item.setJobTypeName(PositionTypeEnum.getNameByid(item.getJobType())); - item.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - } - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 根据主键获取考核维度对象 - * - * @param kpiDimension 考核维度对象 - * @return 考核维度对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/getOne.do") - @ResponseBody - public KpiDimension getOne(KpiDimension kpiDimension) { - return kpiDimensionService.selectById(kpiDimension.getId()); - } - - /** - * 页面迁移:新增页面 - * - * @return 考核维度对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - model.addAttribute("enableTypeList", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - return "kpi/dimensionAdd"; - } - - /** - * 页面迁移:更新页面 - * - * @return 考核维度对象periodTypeList - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, String id) { - model.addAttribute("enableTypeList", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - model.addAttribute("kpiDimension", kpiDimensionService.selectById(id)); - return "kpi/dimensionEdit"; - } - - /** - * 新增 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request, Model model, KpiDimension kpiDimension) { - - - String dateStr = DateUtil.toStr(null, new Date()); - // 能够进行增删改的只有普通类型,其他类型在代码逻辑有特殊处理 - - kpiDimension.setDimensionType(DimensionTypeEnum.Normal.getId()); - kpiDimension.setCreateTime(dateStr); - kpiDimension.setUpdateTime(dateStr); - kpiDimension.setIsDeleted(false); - int result; - if (!kpiDimensionService.uniqueCheck(kpiDimension)) { - result=9; - } else { - result = kpiDimensionService.save(kpiDimension); - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, KpiDimension kpiDimension) { - kpiDimension.setUpdateTime(DateUtil.toStr(null, new Date())); - - int result; - if (!kpiDimensionService.uniqueCheck(kpiDimension)) { - result=9; - } else { - result = kpiDimensionService.update(kpiDimension); - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - KpiDimension kpiDimension = kpiDimensionService.selectById(id); - kpiDimension.setIsDeleted(true); - int result = kpiDimensionService.update(kpiDimension); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 批量删除 - * - * @author maxinhui - * @date 2021/11/26 - **/ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idss = ids.split(","); - for (String id : idss) { - KpiDimension kpiDimension = kpiDimensionService.selectById(id); - kpiDimension.setIsDeleted(true); - kpiDimensionService.update(kpiDimension); - } - model.addAttribute("result", 1); - return "result"; - } - - - /** - * 获取考核维度json 弃用 - * - * @author lichen - * @date 2021/10/15 10:55 - **/ -// @RequestMapping("/getDemensionForJson.do") -// @ResponseBody -// public String getDemensionForJson() { -// // -// return kpiDimensionService.selectForJson(""); -// } - - /** - * 考核维度启用状态更新 - * - * @author lichen - * @date 2021/11/25 10:55 - **/ - @RequestMapping("/changeStatus.do") - @ResponseBody - public Result statusOnOff(KpiDimension kpiDimension) { - kpiDimensionService.update(kpiDimension); - return Result.success(); - } - - /** - * 根据职位类型查询考核周期 - * - * @author lichen - * @date 2021/11/25 10:55 - **/ -/* - @RequestMapping("/getPeriodTypeListByJobType.do") - @ResponseBody - public String getPeriodTypeListByJobType(String jobType) { - - return kpiDimensionService.getPeriodTypeListByJobType(jobType); - } -*/ - @RequestMapping("/getPeriodTypeListByJobType.do") - - public ModelAndView getPeriodTypeListByJobType(String jobType, Model model) { - String result = ""; - result = kpiDimensionService.getPeriodTypeListByJobType(jobType); - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/kpi/KpiIndicatorLibController.java b/src/com/sipai/controller/kpi/KpiIndicatorLibController.java deleted file mode 100644 index c57b3990..00000000 --- a/src/com/sipai/controller/kpi/KpiIndicatorLibController.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.enums.PositionTypeEnum; -import com.sipai.entity.kpi.KpiIndicatorLib; -import com.sipai.service.kpi.KpiIndicatorLibService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -/** - * 考核库配置 - * - * @author maxinhui - * @date 2021/10/13 - */ -@Controller -@RequestMapping("/kpi/KpiIndicatorLib") -public class KpiIndicatorLibController { - @Resource - private KpiIndicatorLibService kpiIndicatorLibService; - - - /** - * 考核周期类型 - * - * @author maxinhui - * @date 2021/10/13 - **/ - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - - return "kpi/IndicatorLibList"; - } - - - /** - * 树形结构 - * - * @author maxinhui - * @date 2021/10/14 - **/ - - @RequestMapping("/showTree.do") -// @ResponseBody - public String showTree(HttpServletRequest request, Model model ,String jobType,String periodType) throws Exception { - - List> list = kpiIndicatorLibService.getTree(jobType,periodType); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; -// return json; - - } - - - /** - * table取值 - * - * @author maxinhui - * @date 2021/10/14 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "dimensionId", required = true) String dimensionId, - @RequestParam(value = "jobId", required = true) String jobId, - @RequestParam(value = "periodType", required = true) String periodType) { - - - String wherestr = " where b.is_deleted = 0 and a.is_deleted = 0 and a.dimension_id = '" + dimensionId + "' and a.job_id = '" + jobId + "' and a.period_type = '" + periodType + "' "; - - PageHelper.startPage(page, rows); - - List list = kpiIndicatorLibService.selectListByWhere(wherestr); - if(list.size()==0){ - KpiIndicatorLib lib = new KpiIndicatorLib(); - lib.setId(UUID.randomUUID().toString()); - lib.setDimensionId(dimensionId); - lib.setJobId(jobId); - lib.setPeriodType(Integer.parseInt(periodType)); - kpiIndicatorLibService.save(lib); - } - - for (KpiIndicatorLib item : list) { - //考核周期类型名称转换 - item.setPeriodTypeName(PeriodTypeEnum.getNameByid(item.getPeriodType())); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * @author maxinhui - * @date 2021/10/14 - **/ - - @RequestMapping("/getOne.do") - @ResponseBody - public KpiIndicatorLib getOne(KpiIndicatorLib kpiIndicatorLib) { - return kpiIndicatorLibService.selectById(kpiIndicatorLib.getId()); - } - - - @RequestMapping("/getIndicator.do") - public String getIndicator(HttpServletRequest request, Model model, - @RequestParam(value = "dimensionId", required = true) String dimensionId, - @RequestParam(value = "jobId", required = true) String jobId, - @RequestParam(value = "periodType", required = true) String periodType) { - String wherestr = " where is_deleted = 0 and dimension_id = '" + dimensionId + "' and job_id = '" + jobId + "' and period_type = '" + periodType + "' "; - - KpiIndicatorLib lib = this.kpiIndicatorLibService.selectInfo(wherestr); - model.addAttribute("result", JSONObject.fromObject(lib)); - return "result"; - } - - /** - * 权重 - * - * @author maxinhui - * @date 2021/10/16 - **/ - @RequestMapping("/Weight.do") - public String doweight(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - KpiIndicatorLib kpiIndicatorLib = kpiIndicatorLibService.selectById(id); - if (kpiIndicatorLib == null) { - kpiIndicatorLib = KpiIndicatorLib.defaultKpiIndicatorLib(); - kpiIndicatorLib.setDimensionId(request.getParameter("dimensionId")); - kpiIndicatorLib.setJobId(request.getParameter("jobId")); - kpiIndicatorLib.setPeriodType(Integer.parseInt(request.getParameter("periodType"))); - } - model.addAttribute("KpiIndicatorLib", kpiIndicatorLib); - return "kpi/IndicatorLibWeight"; - } - - - /** - * 新增 - * - * @author maxinhui - * @date 2021/10/18 - **/ - - public ModelAndView dosave(HttpServletRequest request, Model model, KpiIndicatorLib kpiIndicatorLib) { - String datestr = DateUtil.toStr(null, new Date()); - kpiIndicatorLib.setId(UUID.randomUUID().toString()); - kpiIndicatorLib.setCreateTime(datestr); - kpiIndicatorLib.setUpdateTime(datestr); - kpiIndicatorLib.setIsDeleted(false); - int result = kpiIndicatorLibService.save(kpiIndicatorLib); -// String resstr="{\"res\":\""+result+"\"}"; - String resstr = "{\"res\":\"" + result + "\",\"data\":\"" + kpiIndicatorLib.getId() + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - - } - - /** - * 更新 - * - * @author maxinhui - * @date 2021/10/14 - **/ - - public ModelAndView doupdate(HttpServletRequest request, Model model, KpiIndicatorLib kpiIndicatorLib) { - kpiIndicatorLib.setUpdateTime(DateUtil.toStr(null, new Date())); - int result = kpiIndicatorLibService.update(kpiIndicatorLib); - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - - @RequestMapping("/addOrUpdate.do") - @ResponseBody - public ModelAndView addOrUpdate(HttpServletRequest request, Model model, KpiIndicatorLib kpiIndicatorLib) { - if (kpiIndicatorLib.getId().equals("")) { - return this.dosave(request, model, kpiIndicatorLib); - } else { - return this.doupdate(request, model, kpiIndicatorLib); - } - } - - /** - * 删除 - * - * @author maxinhui - * @date 2021/10/14 - **/ - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - int result = kpiIndicatorLibService.deleteById(id); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - - - -} diff --git a/src/com/sipai/controller/kpi/KpiIndicatorLibDetailController.java b/src/com/sipai/controller/kpi/KpiIndicatorLibDetailController.java deleted file mode 100644 index b047bee0..00000000 --- a/src/com/sipai/controller/kpi/KpiIndicatorLibDetailController.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.sipai.controller.kpi; - -import com.sipai.entity.kpi.KpiIndicatorLib; -import com.sipai.entity.kpi.KpiIndicatorLibDetail; -import com.sipai.service.kpi.KpiIndicatorLibDetailService; -import com.sipai.service.kpi.KpiIndicatorLibService; -import com.sipai.tools.DateUtil; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.Date; -import java.util.UUID; - -/** - * @author maxinhui - * @date 2021/10/15 上午 9:08 - */ -@Controller -@RequestMapping("/kpi/KpiIndicatorLibDetail") -public class KpiIndicatorLibDetailController { - @Resource - private KpiIndicatorLibDetailService kpiIndicatorLibDetailService; - - @Resource - private KpiIndicatorLibService kpiIndicatorLibService; - - /** - * 新增页面跳转 - * - * @author maxinhui - * @date 2021/10/15 - **/ - @RequestMapping("/IndicatorLibAdd.do") - public String add(HttpServletRequest request, Model model) { - String indicatorId = request.getParameter("indicatorId"); - model.addAttribute("indicatorId", indicatorId); - return "kpi/IndicatorLibAdd"; - } - - - /** - * 新增入库 - * - * @author maxinhui - * @date 2021/10/15 - **/ - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "indicatorId", required = true) String indicatorId, - @RequestParam(value = "indicatorName", required = true) String indicatorName, - @RequestParam(value = "contentA", required = true) String contentA, - @RequestParam(value = "contentB", required = true) String contentB, - @RequestParam(value = "contentC", required = true) String contentC, - @RequestParam(value = "contentD", required = true) String contentD, - @RequestParam(value = "morder", required = true) String morder, - @RequestParam(value = "indicatorDetail", required = true) String indicatorDetail, - @RequestParam(value = "indicatorWeight", required = false) BigDecimal indicatorWeight - - ) { - - KpiIndicatorLib kpiIndicatorLib = kpiIndicatorLibService.selectById(indicatorId); - - KpiIndicatorLibDetail kpiIndicatorLibDetail =new KpiIndicatorLibDetail(); - - String datestr = DateUtil.toStr(null, new Date()); - kpiIndicatorLibDetail.setId(UUID.randomUUID().toString()); - kpiIndicatorLibDetail.setDimensionId(kpiIndicatorLib.getDimensionId()); - kpiIndicatorLibDetail.setIndicatorId(indicatorId); - kpiIndicatorLibDetail.setIndicatorName(indicatorName); - kpiIndicatorLibDetail.setContentA(contentA); - kpiIndicatorLibDetail.setContentB(contentB); - kpiIndicatorLibDetail.setContentC(contentC); - kpiIndicatorLibDetail.setContentD(contentD); - kpiIndicatorLibDetail.setIndicatorDetail(indicatorDetail); - kpiIndicatorLibDetail.setCreateTime(datestr); - kpiIndicatorLibDetail.setMorder(morder); - kpiIndicatorLibDetail.setUpdateTime(datestr); - kpiIndicatorLibDetail.setIsDeleted(false); - kpiIndicatorLibDetail.setIndicatorWeight(indicatorWeight); - int result = kpiIndicatorLibDetailService.save(kpiIndicatorLibDetail); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 删除 - * - * @author maxinhui - * @date 2021/10/14 - **/ - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - int result = kpiIndicatorLibDetailService.deleteById(id); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 编辑 - * - * @author maxinhui - * @date 2021/10/16 - **/ - @RequestMapping("/IndicatorLibEdit.do") - public String doedit(HttpServletRequest request, Model model, String id) { -// String indicatorId = request.getParameter("indicatorId"); -// model.addAttribute("PeriodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - KpiIndicatorLibDetail kpiIndicatorLibDetail = kpiIndicatorLibDetailService.selectById(id); - model.addAttribute("KpiIndicatorLibDetail", kpiIndicatorLibDetail); - return "kpi/IndicatorLibEdit"; - } - - - /** - * 更新 - * - * @author maxinhui - * @date 2021/10/16 - **/ - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, KpiIndicatorLibDetail kpiIndicatorLibDetail) { - kpiIndicatorLibDetail.setUpdateTime(DateUtil.toStr(null, new Date())); - int result = kpiIndicatorLibDetailService.update(kpiIndicatorLibDetail); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 删除多个 - * - * @author maxinhui - * @date 2021/11/26 - * - **/ - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids=ids.replace(",","','"); - int result = kpiIndicatorLibDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/kpi/KpiPeriodInstanceController.java b/src/com/sipai/controller/kpi/KpiPeriodInstanceController.java deleted file mode 100644 index d1302193..00000000 --- a/src/com/sipai/controller/kpi/KpiPeriodInstanceController.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.*; -import com.sipai.entity.kpi.KpiApplyBiz; -import com.sipai.entity.kpi.KpiPeriodInstance; -import com.sipai.entity.kpi.KpiPeriodInstanceVo; -import com.sipai.entity.kpi.KpiPlanStaff; -import com.sipai.entity.user.User; -import com.sipai.service.kpi.*; -import com.sipai.service.user.UserService; -import com.sipai.tools.DateUtil; -import com.sipai.tools.KpiUtils; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -/** - * 计划编制:编制计划 - * - * @Author: lichen - * @Date: 2021/10/11 - **/ -@Controller -@RequestMapping("/kpi/KpiPeriodInstance") -public class KpiPeriodInstanceController { - - @Resource - private KpiApplyBizService kpiApplyBizService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiResultService kpiResultService; - @Resource - private KpiResultIndicatorService kpiResultIndicatorService; - @Resource - private KpiResultIndicatorWeightService kpiResultIndicatorWeightService; - @Resource - private UserService userService; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - - /** - * 页面迁移:编制计划 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - model.addAttribute("enableTypeList", EnableTypeEnum.getAllEnableType4JSON()); - return "kpi/periodInstanceList"; - } - - /** - * 获取编制计划列表 - * - * @return 考核维度对象列表 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - - PageHelper.startPage(page, rows); - User cu = (User) request.getSession().getAttribute("cu"); - List list = kpiPeriodInstanceService.selectPageList(cu.getId()); - - for (KpiPeriodInstanceVo item : list) { - // 绩效类型名称转换 - item.setPositionTypeName(PositionTypeEnum.getNameByid(item.getJobType()) + "考核"); - //考核周期类型名称转换 - item.setPeriodTypeName(PeriodTypeEnum.getNameByid(item.getPeriodType())); - // 考核周期完整名称拼接 - item.setPeriodName(KpiUtils.getPeriodName(item.getPeriodYear(), item.getPeriodType(), item.getPeriodNo())); - - item.setStatusName(KpiApplyStatusEnum.getNameByid(item.getStatus())); - - - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面迁移:新增页面 - * - * @return 考核维度对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - model.addAttribute("periodNoQuarterList", PeriodNoQuarterEnum.getAllEnableType4JSON()); - model.addAttribute("periodNoHalfList", PeriodNoHalfEnum.getAllEnableType4JSON()); - model.addAttribute("periodNoYearList", PeriodNoYearEnum.getAllEnableType4JSON()); - return "kpi/periodInstanceAdd"; - } - - /** - * 新增 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, KpiPeriodInstance kpiPeriodInstance) { - - String dateStr = DateUtil.toStr(null, new Date()); - kpiPeriodInstance.setId(UUID.randomUUID().toString()); - kpiPeriodInstance.setCreateTime(dateStr); - kpiPeriodInstance.setUpdateTime(dateStr); - kpiPeriodInstance.setIsDeleted(false); - - User cu = (User) request.getSession().getAttribute("cu"); - kpiPeriodInstance.setCreateUserId(cu.getId()); - - // 判断有无重复计划 - if (kpiPeriodInstanceService.selectOneWithOutId(kpiPeriodInstance) != null) { - return Result.failed("已经存在该考核计划!"); - } - - kpiPeriodInstanceService.save(kpiPeriodInstance); - return Result.success(); - } - - /** - * 删除 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/delete.do") - @Transactional(rollbackFor = Exception.class) - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - int result = kpiPeriodInstanceService.deleteById(id); - List kpiApplyBizs = kpiApplyBizService.selectListByWhere(" where period_instance_id='" + id + "' order by id desc"); - kpiApplyBizService.deleteByWhere(" where period_instance_id='" + id + "'"); - for (KpiApplyBiz biz : kpiApplyBizs) { - List kpiPlanStaffs = kpiPlanStaffService.selectListByWhere(" where apply_biz_id='" + biz.getId() + "' order by id desc"); - for (KpiPlanStaff staff : kpiPlanStaffs) { - kpiResultService.deleteByWhere(" where plan_staff_id='" + staff.getId() + "'"); - } - kpiPlanStaffService.deleteByWhere(" where apply_biz_id='" + biz.getId() + "'"); - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除多个 - * - * @author maxinhui - * @date 2021/11/26 - **/ - - @RequestMapping("/deletes.do") - @Transactional(rollbackFor = Exception.class) - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - List instanceList = kpiPeriodInstanceService.selectListByWhere(" where id in ('" + ids + "') order by id desc"); - int result = kpiPeriodInstanceService.deleteByWhere(" where id in ('" + ids + "')"); - for (KpiPeriodInstance instance : instanceList) { - List kpiApplyBizs = kpiApplyBizService.selectListByWhere(" where period_instance_id='" + instance.getId() + "' order by id desc"); - kpiApplyBizService.deleteByWhere(" where period_instance_id='" + instance.getId() + "'"); - for (KpiApplyBiz biz : kpiApplyBizs) { - List kpiPlanStaffs = kpiPlanStaffService.selectListByWhere(" where apply_biz_id='" + biz.getId() + "' order by id desc"); - for (KpiPlanStaff staff : kpiPlanStaffs) { - kpiResultService.deleteByWhere(" where plan_staff_id='" + staff.getId() + "'"); - } - kpiPlanStaffService.deleteByWhere(" where apply_biz_id='" + biz.getId() + "'"); - } - } - - model.addAttribute("result", result); - return "result"; - } - - - /** - * 周期下拉列表 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/periodNoList.do") - public ModelAndView dodel(int periodType, Model model) { - String result = ""; - if (periodType == PeriodTypeEnum.Quarter.getId()) { - result = PeriodNoQuarterEnum.getAllEnableType4JSON(); - } - if (periodType == PeriodTypeEnum.Half.getId()) { - result = PeriodNoHalfEnum.getAllEnableType4JSON(); - } - if (periodType == PeriodTypeEnum.Year.getId()) { - result = PeriodNoYearEnum.getAllEnableType4JSON(); - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/kpi/KpiPlanController.java b/src/com/sipai/controller/kpi/KpiPlanController.java deleted file mode 100644 index 266c95a6..00000000 --- a/src/com/sipai/controller/kpi/KpiPlanController.java +++ /dev/null @@ -1,532 +0,0 @@ -package com.sipai.controller.kpi; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelReader; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.context.AnalysisContext; -import com.alibaba.excel.metadata.CellExtra; -import com.alibaba.excel.metadata.data.ReadCellData; -import com.alibaba.excel.read.listener.PageReadListener; -import com.alibaba.excel.read.listener.ReadListener; -import com.alibaba.excel.read.metadata.ReadSheet; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.enums.PositionTypeEnum; -import com.sipai.entity.kpi.KpiDimension; -import com.sipai.entity.kpi.KpiIndicatorLib; -import com.sipai.entity.kpi.KpiPlan; -import com.sipai.entity.kpi.KpiPlanDetail; -import com.sipai.entity.user.Job; -import com.sipai.entity.user.User; -import com.sipai.service.kpi.*; -import com.sipai.service.user.JobServiceImpl; -import com.sipai.service.user.UserService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** - * 考核维度管理 - * - * @Author: lihongye - * @Date: 2021/10/11 - **/ -@Controller -@RequestMapping("/kpi/kpiPlan") -public class KpiPlanController { - @Resource - private JobServiceImpl jobService; - @Resource - private KpiPlanService kpiPlanService; - @Resource - private KpiIndicatorLibService kpiIndicatorLibService; - @Resource - private UserService userService; - @Resource - private KpiPlanDetailService kpiPlanDetailService; - @Resource - private KpiDimensionService kpiDimensionService; - /** - * 页面迁移:获取绩效方案列表页面 - * - * @author lihongye - * @date 2021/10/11 17:23 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - model.addAttribute("positionTypeList", PositionTypeEnum.getAllEnableType4JSON()); - return "kpi/kpiPlanList"; - } - - /** - * 数据交互:获取绩效方案列表 - * - * @author lihongye - * @date 2021/10/11 22:23 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "periodTypeName", required = false) String periodTypeList, - @RequestParam(value = "positionType", required = false) String positonTypeList) { - - User cu = (User) request.getSession().getAttribute("cu"); - //21.11.01 新增根据创建者id查询 - String id = cu.getId(); - - String orderstr = " order by update_time desc "; - String wherestr = " where is_deleted = 0 "; - if (StringUtils.isNotBlank(periodTypeList)) { - wherestr += " and period_type = " + periodTypeList; - } - if (StringUtils.isNotBlank(positonTypeList)) { - wherestr += " and j.level_type = " + positonTypeList; - } - wherestr += "and p.create_user_id ='" + id + "'"; - PageHelper.startPage(page, rows); - List list = kpiPlanService.selectListByWhere(wherestr + orderstr); - - for (KpiPlan kpiPlan : list) { - // 编辑列表需要的字段 - - User userInfo = userService.getUserById(kpiPlan.getObjUserId()); - if (userInfo != null && !userInfo.equals("")) { - // 部门名称 - kpiPlan.setDeptName(userInfo.get_pname()); - // 工号 - kpiPlan.setCardId(userInfo.getUserCardId()); - } - if (kpiPlan.getPeriodType() != null) { - // 设置周期类型 - kpiPlan.setPeriodTypeName(PeriodTypeEnum.getNameByid(kpiPlan.getPeriodType())); - } - - if (kpiPlan.getLevelType() != null) { - // 设置岗位类型 - kpiPlan.setPositionType(PositionTypeEnum.getNameByid(kpiPlan.getLevelType())); - } - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面迁移:新增页面 - * - * @author lihongye - * @date 2021/10/12 13:23 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - model.addAttribute("positionTypeList", PositionTypeEnum.getAllEnableType4JSON()); - return "kpi/kpiPlanAdd"; - } - - /** - * 新增绩效方案 - * - * @author lihongye - * @date 2021.10.12 14.01 - **/ - @RequestMapping("/save.do") - @Transactional - public ModelAndView dosave(HttpServletRequest request, Model model, KpiPlan kpiPlan, - @RequestParam(value = "id", required = false) String id, - @RequestParam(value = "jobId", required = false) String jobId, - @RequestParam(value = "periodType", required = false) String periodType, - String check) { - KpiPlanDetail kpiPlanDetail = new KpiPlanDetail(); - String dateStr = DateUtil.toStr(null, new Date()); - User cu = (User) request.getSession().getAttribute("cu"); - //先判断是否有此考核方案,如有,即中断 - if ("1".equals(check)) { - String orderStr = " order by update_time desc "; - String whereStr = " where obj_user_id='" + kpiPlan.getObjUserId() + "' AND job_id='" + jobId + "' AND period_type= '" + periodType + "'"; - List kpiPlans = kpiPlanService.selectListByWhere(whereStr + orderStr); - if (kpiPlans != null && kpiPlans.size() > 0) { - for (int i = 0; i < kpiPlans.size(); i++) { - if (kpiPlans.get(i).getCreateUserId().equals(cu.getId())) { - String result = "{\"code\":-1,\"msg\":\"您已经为该考核对象创建过相同绩效方案,请找到原绩效方案进行修改。\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - String ids = ""; - for (KpiPlan plan : kpiPlans) { - ids += plan.getCreateUserId() + ","; - } - String userNames = userService.getUserNamesByUserIds(ids.substring(0, ids.length() - 1)); - String result = "{\"code\":2,\"creater\":\"" + userNames + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - // 能够进行增删改的只有普通类型,其他类型在代码逻辑有特殊处理 - kpiPlan.setId(UUID.randomUUID().toString()); - String wherestr = " where b.is_deleted = 0 and a.is_deleted = 0 " - + " and a.job_id = '" + jobId - + "' and a.period_type = '" + periodType + "'"; - kpiPlan.setCreateUserId(cu.getId()); - kpiPlan.setCreateTime(dateStr); - kpiPlan.setUpdateUserId(cu.getId()); - kpiPlan.setUpdateTime(dateStr); - kpiPlan.setIsDeleted(false); - List kpiIndicatorLibs = kpiIndicatorLibService.selectListByWhere(wherestr); - for (KpiIndicatorLib kpiIndicatorLib : kpiIndicatorLibs) { - kpiPlanDetail.setId(UUID.randomUUID().toString()); - kpiPlanDetail.setPlanId(kpiPlan.getId()); - kpiPlanDetail.setCreateTime(dateStr); - kpiPlanDetail.setUpdateTime(dateStr); - kpiPlanDetail.setIsDeleted(false); - //维度名称id - kpiPlanDetail.setDimensionId(kpiIndicatorLib.getDimensionId()); - kpiPlanDetail.setContentA(kpiIndicatorLib.getContentA()); - kpiPlanDetail.setContentB(kpiIndicatorLib.getContentB()); - kpiPlanDetail.setContentC(kpiIndicatorLib.getContentC()); - kpiPlanDetail.setContentD(kpiIndicatorLib.getContentD()); - kpiPlanDetail.setMorder(kpiIndicatorLib.getMorder()); - kpiPlanDetail.setIndicatorName(kpiIndicatorLib.getIndicatorName()); - kpiPlanDetail.setIndicatorDetail(kpiIndicatorLib.getIndicatorDetail()); - kpiPlanDetail.setIndicatorWeight(kpiIndicatorLib.getIndicatorWeight()); - kpiPlanDetailService.save(kpiPlanDetail); - } - String result = "{\"code\":" + kpiPlanService.save(kpiPlan) + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面迁移:复制新增页面 - * - * @author lihongye - * @date 2021/10/12 13:23 - **/ - @RequestMapping("/kpiCopyAdd.do") - public String copyAdd(HttpServletRequest request, Model model, String id) { - - KpiPlan kpiPlan = kpiPlanService.selectById(id); - - model.addAttribute("kpiPlan", kpiPlan); - return "kpi/kpiCopyAdd"; - } - - /** - * 复制新增 - * - * @author lihongye - * @date 2021.10.12 14.01 - **/ - @RequestMapping("/copySave.do") - public ModelAndView copySave(HttpServletRequest request, Model model, - KpiPlan kpiPlan, KpiPlanDetail kpiPlanDetail, - @RequestParam(value = "id", required = false) String id, - @RequestParam(value = "objUserId", required = false) String objUserId) { - //假设:传过来的数据为复制对象方案id,选择对象id。 - //查询考核方案 - String ids = id.substring(0, 36); - KpiPlan kpiPlan1 = kpiPlanService.selectById(id); - - //先判断是否有此考核方案,如有,即删除 -// String orderStr = " order by update_time desc "; -// String periodTypeStr = " order by update_time desc "; - -// String whereStr = " where obj_user_id='" + kpiPlan.getObjUserId() + "' AND job_id='" + kpiPlan.getJobId() + "' AND period_type= '" + kpiPlan1.getPeriodType() + "'"; -// List kpiPlans = kpiPlanService.selectListByWhere(whereStr + orderStr); -// if (kpiPlans != null && kpiPlans.size() > 0) { -// kpiPlanService.deleteById(ids); -// } - - - //根据考核方案id查询考核内容 - String orderstr = " order by update_time desc "; - String wherestr = " where b.plan_id='" + ids + "'"; - List list = kpiPlanDetailService.selectListByWhere(wherestr + orderstr); - - //设置新的考核方案id - kpiPlan1.setId(UUID.randomUUID().toString()); - //设置新的考核对象id - kpiPlan1.setObjUserId(objUserId); - - for (KpiPlanDetail planDetail : list) { - - String dateStr = DateUtil.toStr(null, new Date()); - //设置新的考核内容plan_id - planDetail.setPlanId(kpiPlan1.getId()); - planDetail.setId(UUID.randomUUID().toString()); - planDetail.setCreateTime(dateStr); - planDetail.setUpdateTime(dateStr); - planDetail.setIsDeleted(false); - //存储 - kpiPlanDetailService.save(planDetail); - } - - String dateStr = DateUtil.toStr(null, new Date()); - User cu = (User) request.getSession().getAttribute("cu"); - kpiPlan1.setCreateUserId(cu.getId()); - kpiPlan1.setCreateTime(dateStr); - kpiPlan1.setUpdateUserId(cu.getId()); - kpiPlan1.setUpdateTime(dateStr); - //设置岗位 - kpiPlan1.setJobId(kpiPlan.getJobId()); - kpiPlan1.setIsDeleted(false); - - int result = kpiPlanService.save(kpiPlan1); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除 - * - * @author lihongye - * @date 2021.10.13 9.21 - **/ - @Transactional - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - - int result = kpiPlanService.deleteById(id); - String whereStr = "where plan_id ='" + id + "'"; - List kpiPlanDetails = kpiPlanDetailService.selectListByWhere(whereStr); - for (KpiPlanDetail kpiPlanDetail : kpiPlanDetails) { - kpiPlanDetailService.deleteById(kpiPlanDetail.getId()); - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 删除多个 - * - * @author maxinhui - * @date 2021/11/26 - **/ - - @Transactional - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = kpiPlanService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 新增:岗位选择页面 - * - * @author lihongye - * @date 2021.10.19 15.06 - **/ - @RequestMapping("/positionSelect.do") - public String userForOneSelect(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - model.addAttribute("userId", userId); - return "user/positionSelect"; - } - - /** - * 新增:岗位选择 - * - * @author lihongye - * @date 2021.10.19 15.06 - **/ - - @RequestMapping("/position.do") - public ModelAndView position(HttpServletRequest request, Model model, KpiPlan kpiPlan) { - - User userInfo = userService.getUserById(kpiPlan.getObjUserId()); - List result = new ArrayList(); - int i = 0; - if (userInfo != null && !userInfo.equals("")) { - // 部门名称 - i++; - result.set(i, userInfo.get_pname()); - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * excel导出 - * - * @author maxinhui - * @date 2021/11/26 - **/ - @RequestMapping("/export.do") - public void export(HttpServletRequest request, HttpServletResponse response, - @RequestParam(value = "periodTypeName", required = false) String periodTypeList, - @RequestParam(value = "positionType", required = false) String positonTypeList) throws IOException { - // 摘自列表查询接口 start - User cu = (User) request.getSession().getAttribute("cu"); - String id = cu.getId(); - String orderstr = " order by update_time desc "; - String wherestr = " where is_deleted = 0 "; - if (StringUtils.isNotBlank(periodTypeList) && !"null".equals(periodTypeList)) { - wherestr += " and period_type = " + periodTypeList; - } - if (StringUtils.isNotBlank(positonTypeList) && !"null".equals(positonTypeList)) { - wherestr += " and j.level_type = " + positonTypeList; - } - wherestr += "and p.create_user_id ='" + id + "'"; - - List list = kpiPlanService.selectListByWhere(wherestr + orderstr); - // 摘自列表查询接口 end - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("绩效方案", "UTF-8") + ".xlsx"); - - - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), KpiPlanDetail.class).build()) { - - for (KpiPlan kpiPlan : list) { - User objUser = userService.getUserById(kpiPlan.getObjUserId()); - Job job = jobService.selectById(kpiPlan.getJobId()); - String sheetName = objUser.getUserCardId() + "_" + objUser.getCaption() + "_" + job.getName() + "_" + PeriodTypeEnum.getNameByid(kpiPlan.getPeriodType()); - WriteSheet writeSheet = EasyExcel.writerSheet(sheetName).build(); - - // 摘自列表查询接口 start - orderstr = " order by b.dimension_id ,b.morder asc"; - wherestr = " where b.plan_id='" + kpiPlan.getId() + "'AND a.status = 1"; - List detailList = kpiPlanDetailService.selectListByWhere(wherestr + orderstr); - // 摘自列表查询接口 end - - excelWriter.write(detailList, writeSheet); - } - excelWriter.finish(); - } - - } - - /** - * excel导入页面 - * - * @author maxinhui - * @date 2021/11/26 - **/ - @RequestMapping("/importExcelShow.do") - public String importExcelShow() { - return "kpi/kpiPlanListImport"; - } - - /** - * excel导入 - * - * @author maxinhui - * @date 2021/11/26 - **/ - @RequestMapping("/importExcel.do") - @Transactional(rollbackFor = Exception.class) - public Result importExcel(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - User cu = (User) request.getSession().getAttribute("cu"); - StringBuilder errMsg = new StringBuilder(); - - String unitId = request.getParameter("unitId"); - - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - - ExcelReader excelReader = EasyExcel.read(excelFile.getInputStream()).build(); - excelReader.readAll(); - excelReader.finish(); - List sheets = excelReader.excelExecutor().sheetList(); - excelReader.finish(); - for (ReadSheet sheet : sheets) { - String[] sheetInfo = sheet.getSheetName().split("_"); - if (sheetInfo.length != 4) { - errMsg.append("sheet名称不符合“员工号_员工姓名_岗位名称_周期类型”的格式!\n"); - break; - } - String userCardId = sheetInfo[0]; - String userName = sheetInfo[1]; - String jobName = sheetInfo[2]; - String periodTypeName = sheetInfo[3]; - Job job = jobService.selectByName(jobName); - if (job == null) { - errMsg.append("用户" + userName + "的岗位" + jobName + "不存在!\n"); - } - User objUser = userService.getUserByUserCardId(userCardId); - if (objUser == null) { - errMsg.append("用户" + userName + "的工号" + userCardId + "不正确!\n"); - } - int periodType = PeriodTypeEnum.getIdByName(periodTypeName); - String jobId = job.getId(); - - KpiPlan kpiPlan = kpiPlanService.selectByObjUserIdAndPeriodTypeId(objUser.getId(), jobId, periodType,cu.getId()); - if (kpiPlan == null) { - kpiPlan = new KpiPlan(); - - kpiPlan.setId(UUID.randomUUID().toString()); - kpiPlan.setObjUserId(objUser.getId()); - kpiPlan.setJobId(jobId); - kpiPlan.setPeriodType(periodType); - kpiPlan.setCreateUserId(cu.getId()); - kpiPlan.setCreateTime(DateUtil.toStr(null, new Date())); - kpiPlan.setUpdateTime(kpiPlan.getCreateTime()); - kpiPlan.setUpdateUserId(cu.getId()); - kpiPlan.setIsDeleted(false); - kpiPlan.setUnitId(unitId); - kpiPlanService.save(kpiPlan); - } - kpiPlanDetailService.deleteByPlanId(kpiPlan.getId()); - - KpiPlan finalKpiPlan = kpiPlan; - - KpiPlan finalKpiPlan1 = kpiPlan; - EasyExcel.read(excelFile.getInputStream(), KpiPlanDetail.class, new PageReadListener(dataList -> { - for (KpiPlanDetail kpiPlanDetail : dataList) { - String dimensionId= kpiDimensionService.getDimensionId(kpiPlanDetail.getDimensionName(), job.getLevelType(), finalKpiPlan1.getPeriodType()); - if(dimensionId==null){ - errMsg.append("用户" + userName + "的职位" + job.getName() + "在"+periodTypeName+"考核中不存在考核维度“"+kpiPlanDetail.getDimensionName()+"”!\n"); - continue; - } - kpiPlanDetail.setId(UUID.randomUUID().toString()); - kpiPlanDetail.setDimensionId(dimensionId); - kpiPlanDetail.setPlanId(finalKpiPlan.getId()); - kpiPlanDetail.setIsDeleted(false); - kpiPlanDetail.setCreateTime(DateUtil.toStr(null,new Date())); - kpiPlanDetail.setUpdateTime(kpiPlanDetail.getCreateTime()); - kpiPlanDetailService.save(kpiPlanDetail); - } - })).sheet(sheet.getSheetName()).doRead(); - } - - if (!errMsg.toString().isEmpty()) { - return Result.failed(errMsg.toString()); - } else { - return Result.success(null,"导入成功!"); - } - } -} diff --git a/src/com/sipai/controller/kpi/KpiPlanDetailController.java b/src/com/sipai/controller/kpi/KpiPlanDetailController.java deleted file mode 100644 index c1b7c0dd..00000000 --- a/src/com/sipai/controller/kpi/KpiPlanDetailController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.kpi.KpiPlanDetail; -import com.sipai.entity.user.Job; -import com.sipai.service.kpi.KpiDimensionService; -import com.sipai.service.kpi.KpiIndicatorLibService; -import com.sipai.service.kpi.KpiPlanDetailService; -import com.sipai.service.user.JobService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -/** - * @author lihongye - */ -@Controller -@RequestMapping("/kpi/kpiPlanDetail") -public class KpiPlanDetailController { - - @Resource - private KpiPlanDetailService kpiPlanDetailService; - @Resource - private KpiDimensionService kpiDimensionService; - @Resource - private KpiIndicatorLibService kpiIndicatorLibService; - @Resource - private JobService jobService; - - /** - * 页面迁移:考核内容页面 - * - * @author lihongye - * @date 2021/10/13 17:23 - **/ - @RequestMapping("/showDetailList.do") - public String showDetailList(HttpServletRequest request, Model model, - @RequestParam(value = "id", required = false) String id, String jobId) { - model.addAttribute("id", id); - Job job = jobService.selectById(jobId); - model.addAttribute("jobType", job.getLevelType()); - return "kpi/showDetailList"; - } - - /** - * 数据交互:根据方案id查询考核内容 - * - * @author lihongye - * @date 2021/10/11 22:23 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "id", required = false) String id, - @RequestParam(value = "order", required = false) String order) { - - String orderstr = " order by b.dimension_id ,b.morder asc"; - String wherestr = " where b.plan_id='" + id + "'AND a.status = 1"; - - PageHelper.startPage(page, rows); - List list = kpiPlanDetailService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面迁移:考核内容方案详情新增页面 - * - * @author lihongye - * @date 2021/10/13 13:23 - **/ - @RequestMapping("/showDetailAdd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "id", required = false) String id, String jobType) { - model.addAttribute("id", id); - model.addAttribute("dimensionList", kpiDimensionService.selectForJson(jobType)); - return "kpi/showDetailAdd"; - } - - /** - * 考核内容方案详情新增 - * - * @author lihongye - * @date 2021.10.13 14.01 - **/ - @RequestMapping("/detailSave.do") - public ModelAndView detailSave(HttpServletRequest request, Model model, KpiPlanDetail kpiPlanDetail, - @RequestParam(value = "id", required = false) String id, - @RequestParam(value = "jobId", required = false) String jobId, - @RequestParam(value = "periodType", required = false) String periodType) { - String dateStr = DateUtil.toStr(null, new Date()); - //创建新的绩效方案id; - kpiPlanDetail.setPlanId(id); - kpiPlanDetail.setId(UUID.randomUUID().toString()); - - kpiPlanDetail.setCreateTime(dateStr); - kpiPlanDetail.setUpdateTime(dateStr); - kpiPlanDetail.setIsDeleted(false); - - int result = kpiPlanDetailService.save(kpiPlanDetail); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面迁移:考核内容方案详情更新页面 - * - * @author lihongye - * @date 2021/10/13 13:23 - **/ - @RequestMapping("/showDetailEdit.do") - public String detailEdit(HttpServletRequest request, Model model, String id) { - model.addAttribute("kpiPlanDetail", kpiPlanDetailService.selectById(id)); - return "kpi/showDetailEdit"; - } - - /** - * 更新 - * - * @author lihongye - * @date 2021/10/13 11:21 - **/ - @RequestMapping("/detailUpdate.do") - public ModelAndView detailUpdate(HttpServletRequest request, Model model, KpiPlanDetail kpiPlanDetail) { - kpiPlanDetail.setUpdateTime(DateUtil.toStr(null, new Date())); - int result = kpiPlanDetailService.update(kpiPlanDetail); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 绩效方案详情删除 - * - * @author lihongye - * @date 2021.10.14 11:15 - **/ - @RequestMapping("/detailDelete.do") - public ModelAndView detailDelete(HttpServletRequest request, Model model, String id) { - int result = kpiPlanDetailService.deleteById(id); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 批量删除 - * - * @author maxinhui - * @date 2021/11/26 - **/ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = kpiPlanDetailService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/kpi/KpiPlanStaffController.java b/src/com/sipai/controller/kpi/KpiPlanStaffController.java deleted file mode 100644 index d18f54ca..00000000 --- a/src/com/sipai/controller/kpi/KpiPlanStaffController.java +++ /dev/null @@ -1,442 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.enums.PositionTypeEnum; -import com.sipai.entity.kpi.*; -import com.sipai.entity.user.User; -import com.sipai.service.kpi.*; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.JobServiceImpl; -import com.sipai.service.user.UserService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; -import java.util.stream.Collectors; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/8 - **/ -@Controller -@RequestMapping("/kpi/KpiPlanStaff") -public class KpiPlanStaffController { - - @Resource - private KpiPlanStaffService kpiPlanStaffService; - - @Resource - private MsgServiceImpl msgService; - - @Resource - private UserService userService; - @Resource - private KpiPlanService kpiPlanService; - @Resource - private KpiPlanDetailService kpiPlanDetailService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - @Resource - private KpiApplyBizService kpiApplyBizService; - @Resource - private JobServiceImpl jobService; - - /** - * 页面迁移:考核对象列表页面 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model, - @RequestParam(value = "periodInstanceId", required = false) String periodInstanceId, - @RequestParam(value = "applyBizId", required = false) String applyBizId) { - User cu = (User) request.getSession().getAttribute("cu"); - - if (applyBizId == null || "".equals(applyBizId)) { - //初次进入创建子计划 - model.addAttribute("initFlg", 1); - KpiApplyBiz kpiApplyBiz = new KpiApplyBiz(); - kpiApplyBiz.setId(UUID.randomUUID().toString()); - kpiApplyBiz.setPeriodInstanceId(periodInstanceId); - kpiApplyBiz.setStatus(KpiApplyStatusEnum.PlanMaking.getId()); - kpiApplyBiz.setCreateTime(DateUtil.toStr(null, new Date())); - kpiApplyBiz.setUpdateTime(kpiApplyBiz.getCreateTime()); - kpiApplyBiz.setCreateUserId(cu.getId()); - kpiApplyBiz.setIsDeleted(false); - kpiApplyBiz.setUnitId(cu.getPid()); - kpiApplyBizService.save(kpiApplyBiz); - applyBizId = kpiApplyBiz.getId(); - model.addAttribute("applyBiz", kpiApplyBiz); - } else { - List kpiPlanStaffs = kpiPlanStaffService.selectListByWhere("where apply_biz_id = '" + applyBizId + "' and create_user_id ='" + cu.getId() + "' order by id "); - if (kpiPlanStaffs == null || kpiPlanStaffs.size() == 0) { - model.addAttribute("initFlg", 1); - } else { - - model.addAttribute("initFlg", 0); - } - model.addAttribute("applyBiz", kpiApplyBizService.selectById(applyBizId)); - } - - model.addAttribute("periodInstanceId", periodInstanceId); - - model.addAttribute("applyBizId", applyBizId); - return "kpi/planStaffList"; - } - - - /** - * 获取考核对象列表 - * - * @return 考核维度对象列表 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "applyBizId") String applyBizId, - @RequestParam(value = "periodInstanceId") String periodInstanceId) { - - User cu = (User) request.getSession().getAttribute("cu"); - if (applyBizId == null) { - applyBizId = "@"; - } - - String orderStr = " order by update_time desc "; - String whereStr = ""; - List list = new ArrayList<>(); - // 判断用户是绩效负责人 - KpiPeriodInstance instance = kpiPeriodInstanceService.selectById(periodInstanceId); - if (instance != null && instance.getCreateUserId().equals(cu.getId())) { - //查出所有能看的子计划id - whereStr = " where period_instance_id='" + periodInstanceId + "' and status not in (" + KpiApplyStatusEnum.PlanMaking.getId() + "," + KpiApplyStatusEnum.PlanReject.getId() + ")"; - List kpiApplyBizs = kpiApplyBizService.selectListByWhere(whereStr + orderStr); - // 加上自己作为直接上级创建的 - List ids = kpiApplyBizs.stream().map(KpiApplyBiz::getId).collect(Collectors.toList()); - ids.add(applyBizId); - if (ids.size() > 0) { - String conditionInStr = String.join("','", ids); - whereStr = " where apply_biz_id in ('" + conditionInStr + "')"; - //排序:自己编制的人员在前。 - orderStr = " order by case when apply_biz_id='" + applyBizId + "' then 1 else 0 end desc "; - PageHelper.startPage(page, rows); - list = kpiPlanStaffService.selectListByWhere(whereStr + orderStr); - } - } - // 非绩效负责人要考虑直接上级和隔及上级的情况 - else { - //是隔及上级的 - whereStr = " where auditors like '%" + cu.getId() + "%'" + - " and status not in (" + KpiApplyStatusEnum.PlanMaking.getId() + "," + KpiApplyStatusEnum.PlanReject.getId() + ")" + - " and period_instance_id ='"+ periodInstanceId+"' "; - List kpiApplyBizs = kpiApplyBizService.selectListByWhere(whereStr + orderStr); - - // 加上自己作为直接上级创建的 - List ids = kpiApplyBizs.stream().map(KpiApplyBiz::getId).collect(Collectors.toList()); - ids.add(applyBizId); - if (ids.size() > 0) { - String conditionInStr = String.join("','", ids); - whereStr = " where apply_biz_id in ('" + conditionInStr + "')"; - //排序:自己编制的人员在前。 - orderStr = " order by case when apply_biz_id='" + applyBizId + "' then 1 else 0 end desc "; - list = kpiPlanStaffService.selectListByWhere(whereStr + orderStr); - } else { - //是直接上级 - whereStr = " where create_user_id='" + cu.getId() + "' AND apply_biz_id= '" + applyBizId + "'"; - PageHelper.startPage(page, rows); - list = kpiPlanStaffService.selectListByWhere(whereStr + orderStr); - } - } - - - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (KpiPlanStaff item : list) { - KpiPlanStaffVo vo = new KpiPlanStaffVo(); - BeanUtils.copyProperties(item, vo); - - User userInfo = userService.getUserById(item.getObjUserId()); - if (userInfo != null) { - // 部门名称 - vo.setDeptName(userInfo.get_pname()); - // 考核对象姓名 - vo.setObjUserName(userInfo.getCaption()); - // 工号 - vo.setCardId(userInfo.getUserCardId()); - vo.setJobName(jobService.selectById(vo.getJobId()).getName()); - vo.setCreateUserName(userService.getUserById(item.getCreateUserId()).getCaption()); - } - // 状态说明 - vo.setStatusName(KpiApplyStatusEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(voList); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取考核对象列表 不分页,给tree用 - * - * @return 考核维度对象列表 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @RequestMapping("/getListNonPage.do") - @ResponseBody - public Result getListNonPage(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "applyBizId") String applyBizId) { - - String orderStr = " order by update_time desc "; - String whereStr = " where apply_biz_id= '" + applyBizId + "'"; - List list = kpiPlanStaffService.selectListByWhere(whereStr + orderStr); - - KpiApplyBiz kpiApplyBiz = kpiApplyBizService.selectById(applyBizId); - KpiPeriodInstance kpiPeriodInstances = kpiPeriodInstanceService.selectById(kpiApplyBiz.getPeriodInstanceId()); - - List voList = new ArrayList<>(); - // 编辑列表需要的字段 - for (KpiPlanStaff item : list) { - KpiPlanStaffVo vo = new KpiPlanStaffVo(); - BeanUtils.copyProperties(item, vo); - - User userInfo = userService.getUserById(item.getObjUserId()); - if (userInfo != null) { - // 部门名称 - vo.setDeptName(userInfo.get_pname()); - // 考核对象姓名 - vo.setObjUserName(userInfo.getCaption()); - // 工号 - vo.setCardId(userInfo.getUserCardId()); - vo.setJobName(jobService.selectById(vo.getJobId()).getName()); - vo.setPeriodName(kpiPeriodInstances.getPeriodName()); - } - // 状态说明 - vo.setStatusName(KpiApplyStatusEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - return Result.success(voList); - } - - /** - * 页面迁移:新增页面 - * - * @return 考核维度对象 - * @author lichen3763738 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam String periodInstanceId, - @RequestParam String applyBizId) { - model.addAttribute("applyBizId", applyBizId); - model.addAttribute("periodInstanceId", periodInstanceId); - return "kpi/planStaffAdd"; - } - - - /** - * 页面迁移:新增页面 - * - * @return 考核维度对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/adds.do") - public String doadds(HttpServletRequest request, Model model, - @RequestParam String periodInstanceId, - @RequestParam String applyBizId) { - User cu = (User) request.getSession().getAttribute("cu"); - KpiPeriodInstance kpiPeriodInstance = kpiPeriodInstanceService.selectById(periodInstanceId); - - List planlist = kpiPlanService.selectCopySource(kpiPeriodInstance.getPeriodType(), kpiPeriodInstance.getJobType(), cu.getId()); - - - KpiPlanStaff kpiPlanStaff; - KpiPlanStaffDetail kpiPlanStaffDetail; - for (KpiPlan plan : planlist) { - // 保存考核对象 - kpiPlanStaff = new KpiPlanStaff(); - kpiPlanStaff.setId(UUID.randomUUID().toString()); - kpiPlanStaff.setPeriodInstanceId(kpiPeriodInstance.getId()); - kpiPlanStaff.setObjUserId(plan.getObjUserId()); - kpiPlanStaff.setJobId(plan.getJobId()); - kpiPlanStaff.setStatus(KpiApplyStatusEnum.PlanMaking.getId()); - kpiPlanStaff.setCreateUserId(cu.getId()); - kpiPlanStaff.setCreateTime(DateUtil.toStr(null, new Date())); - kpiPlanStaff.setUpdateTime(kpiPlanStaff.getCreateTime()); - kpiPlanStaff.setIsDeleted(false); - kpiPlanStaff.setUnitId(plan.getUnitId()); - kpiPlanStaff.setApplyBizId(applyBizId); - kpiPlanStaffService.save(kpiPlanStaff); - // 保存考核内容 - String where = " where plan_id='" + plan.getId() + "'"; - List kpiPlanDetailList = kpiPlanDetailService.selectListByWhere(where); - for (KpiPlanDetail planDetail : kpiPlanDetailList) { - kpiPlanStaffDetail = new KpiPlanStaffDetail(); - kpiPlanStaffDetail.setId(UUID.randomUUID().toString()); - kpiPlanStaffDetail.setPlanStaffId(kpiPlanStaff.getId()); - kpiPlanStaffDetail.setDimensionId(planDetail.getDimensionId()); - kpiPlanStaffDetail.setIndicatorName(planDetail.getIndicatorName()); - kpiPlanStaffDetail.setContentA(planDetail.getContentA()); - kpiPlanStaffDetail.setContentB(planDetail.getContentB()); - kpiPlanStaffDetail.setContentC(planDetail.getContentC()); - kpiPlanStaffDetail.setContentD(planDetail.getContentD()); - kpiPlanStaffDetail.setIndicatorDetail(planDetail.getIndicatorDetail()); - kpiPlanStaffDetail.setIndicatorWeight(planDetail.getIndicatorWeight()); - kpiPlanStaffDetail.setCreateTime(kpiPeriodInstance.getCreateTime()); - kpiPlanStaffDetail.setUpdateTime(kpiPeriodInstance.getUpdateTime()); - kpiPlanStaffDetail.setIsDeleted(false); - kpiPlanStaffDetailService.save(kpiPlanStaffDetail); - } - } - - - model.addAttribute("initFlg", 0); - model.addAttribute("applyBiz", kpiApplyBizService.selectById(applyBizId)); - model.addAttribute("applyBizId", applyBizId); - model.addAttribute("periodInstanceId", periodInstanceId); - return "kpi/planStaffList"; - } - - - /** - * 新增 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/save.do") - @Transactional - public ModelAndView dosave(HttpServletRequest request, Model model, KpiPlanStaff kpiPlanStaff, - String check) { - User cu = (User) request.getSession().getAttribute("cu"); - - //职位类型验证 - int jobLevelType = jobService.selectById(kpiPlanStaff.getJobId()).getLevelType(); - int jobLevelTypePlan = kpiPeriodInstanceService.selectById(kpiPlanStaff.getPeriodInstanceId()).getJobType(); - if (jobLevelType != jobLevelTypePlan) { - String msg = "所添加的职位类型是" + PositionTypeEnum.getNameByid(jobLevelType) + ",与计划的职位类型" + - PositionTypeEnum.getNameByid(jobLevelTypePlan) + "不匹配!"; - String result = "{\"code\":0,\"msg\":\"" + msg + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - // 重复验证 - if ("1".equals(check)) { - String orderStr = " order by update_time desc "; - String whereStr = " where obj_user_id='" + kpiPlanStaff.getObjUserId() + "' AND job_id='" + kpiPlanStaff.getJobId() + "' " + - "AND period_instance_id= '" + kpiPlanStaff.getPeriodInstanceId() + "' " + - "AND apply_biz_id= '" + kpiPlanStaff.getApplyBizId() + "' "; - List kpiPlanStaffs = kpiPlanStaffService.selectListByWhere(whereStr + orderStr); - if (kpiPlanStaffs != null && kpiPlanStaffs.size() > 0) { - for (int i = 0; i < kpiPlanStaffs.size(); i++) { - if (kpiPlanStaffs.get(i).getCreateUserId().equals(cu.getId())) { - String result = "{\"code\":-1,\"msg\":\"您已经为该考核对象创建过相同考核计划,请找到原考核计划进行修改。\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - String ids = ""; - for (KpiPlanStaff plan : kpiPlanStaffs) { - ids += plan.getCreateUserId() + ","; - } - String userNames = userService.getUserNamesByUserIds(ids.substring(0, ids.length() - 1)); - String result = "{\"code\":2,\"creater\":\"" + userNames + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - } - - - String dateStr = DateUtil.toStr(null, new Date()); - - kpiPlanStaff.setCreateTime(dateStr); - kpiPlanStaff.setUpdateTime(dateStr); - kpiPlanStaff.setIsDeleted(false); - // 状态设置为制订中 - kpiPlanStaff.setStatus(KpiApplyStatusEnum.PlanMaking.getId()); - - - kpiPlanStaff.setCreateUserId(cu.getId()); - - kpiPlanStaffService.save(kpiPlanStaff); - - - String result = "{\"code\":1}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @Transactional - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - - int result = kpiPlanStaffService.deleteById(id); - - //删除关联考核内容 - List kpiPlanStaffDetails = kpiPlanStaffDetailService.selectListByPlanStaffId(id); - if (kpiPlanStaffDetails != null) { - for (KpiPlanStaffDetail kpiPlanStaffDetail : kpiPlanStaffDetails) { - kpiPlanStaffDetailService.deleteById(kpiPlanStaffDetail.getId()); - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @Transactional - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = kpiPlanStaffService.deleteByWhere("where id in ('" + ids + "')"); - if (result > 0) { - kpiPlanStaffDetailService.deleteByWhere("where plan_staff_id in ('" + ids + "')"); - } else { - result = 0; - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/kpi/KpiPlanStaffDetailController.java b/src/com/sipai/controller/kpi/KpiPlanStaffDetailController.java deleted file mode 100644 index d9ac1d8e..00000000 --- a/src/com/sipai/controller/kpi/KpiPlanStaffDetailController.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.kpi.KpiPlanStaff; -import com.sipai.entity.kpi.KpiPlanStaffBo; -import com.sipai.entity.kpi.KpiPlanStaffDetail; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.kpi.KpiDimensionService; -import com.sipai.service.kpi.KpiPlanStaffDetailService; -import com.sipai.service.kpi.KpiPlanStaffService; -import com.sipai.service.kpi.KpiResultIndicatorWeightService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.activiti.engine.impl.task.TaskDefinition; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -/** - * 计划编制:考核内容 - * - * @Author: lichen - * @Date: 2021/10/8 - **/ -@Controller -@RequestMapping("/kpi/KpiPlanStaffDetail") -public class KpiPlanStaffDetailController { - @Resource - private KpiResultIndicatorWeightService kpiResultIndicatorWeightService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiDimensionService kpiDimensionService; - @Resource - private KpiWorkflowService kpiWorkflowService; - - /** - * 页面迁移:考核内容列表页面 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model, - @RequestParam String planStaffId, - @RequestParam String applyBizId, - @RequestParam(required = false) String taskId, - @RequestParam(required = false) String backToKpiTaskList, - @RequestParam(required = false, defaultValue = "0") String status, - String jobType - ) throws Exception { - - KpiPlanStaffBo kpiPlanStaff = kpiPlanStaffService.selectById(planStaffId); - model.addAttribute("kpiPlanStaff", kpiPlanStaff); - model.addAttribute("applyBizId", applyBizId); - model.addAttribute("periodInstanceId", kpiPlanStaff.getPeriodInstanceId()); - model.addAttribute("planStaffId", planStaffId); - model.addAttribute("jobType", jobType); - - // 控制是否是审批页面的展示 - if (taskId != null) { - TaskDefinition taskDefinition = kpiWorkflowService.getNextTaskInfo(taskId); - if (taskDefinition == null) { - model.addAttribute("hasNextAuditor", "0"); - } else { - model.addAttribute("hasNextAuditor", "1"); - } - model.addAttribute("taskId", taskId); - } else { - model.addAttribute("taskId", ""); - } - - if (backToKpiTaskList != null) { - model.addAttribute("backToKpiTaskList", "1"); - } else { - model.addAttribute("backToKpiTaskList", "0"); - } - model.addAttribute("pageStatus", status); - // 判断是否返回 - return "kpi/planStaffDetailList"; - } - - /** - * 获取考核内容列表 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "planStaffId") String planStaffId) { - String wherestr = " where is_deleted = 0 "; - wherestr += " and plan_staff_id = '" + planStaffId + "' "; - String orderstr = " order by dimension_id asc, update_time desc "; - PageHelper.startPage(page, rows); - List list = kpiPlanStaffDetailService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面迁移:新增页面 - * - * @return 考核内容对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam String planStaffId, String jobType) { - model.addAttribute("dimensionList", kpiDimensionService.selectForJson(jobType)); - model.addAttribute("planStaffId", planStaffId); - return "kpi/planStaffDetailAdd"; - } - - /** - * 页面迁移:更新页面 - * - * @return 考核内容对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, String id, String jobType) { - model.addAttribute("dimensionList", kpiDimensionService.selectForJson(jobType)); - model.addAttribute("planStaffDetail", kpiPlanStaffDetailService.selectById(id)); - return "kpi/planStaffDetailEdit"; - } - - /** - * 新增 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request, Model model, KpiPlanStaffDetail kpiPlanStaffDetail) { - - String dateStr = DateUtil.toStr(null, new Date()); - - kpiPlanStaffDetail.setId(UUID.randomUUID().toString()); - kpiPlanStaffDetail.setCreateTime(dateStr); - kpiPlanStaffDetail.setUpdateTime(dateStr); - kpiPlanStaffDetail.setIsDeleted(false); - - int result = kpiPlanStaffDetailService.save(kpiPlanStaffDetail); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, KpiPlanStaffDetail kpiPlanStaffDetail) { - kpiPlanStaffDetail.setUpdateTime(DateUtil.toStr(null, new Date())); - int result = kpiPlanStaffDetailService.update(kpiPlanStaffDetail); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除 - * - * @author lichen - * @date 2021/10/8 10:55 - **/ - @RequestMapping("/delete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, String id) { - int result = kpiPlanStaffDetailService.deleteById(id); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 查询当前总权重 - * - * @author lichen - * @date 2021/10/15 10:55 - **/ - @RequestMapping("/getTotalWeight.do") - @ResponseBody - public BigDecimal getTotalWeight(@RequestParam(value = "planStaffId") String planStaffId) { - return kpiPlanStaffDetailService.getTotalWeight(planStaffId); - } - - -} diff --git a/src/com/sipai/controller/kpi/KpiResultController.java b/src/com/sipai/controller/kpi/KpiResultController.java deleted file mode 100644 index 1cd9f6ad..00000000 --- a/src/com/sipai/controller/kpi/KpiResultController.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.sipai.controller.kpi; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.alibaba.excel.write.metadata.fill.FillConfig; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.enums.PositionTypeEnum; -import com.sipai.entity.kpi.*; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.kpi.*; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UnitServiceImpl; -import com.sipai.service.user.UserJobService; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 计划实施:打分结果 - * - * @Author: lichen - * @Date: 2021/10/8 - **/ -@Controller -@RequestMapping("/kpi/KpiResult") -public class KpiResultController { - - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private KpiResultIndicatorService kpiResultIndicatorService; - @Resource - private UserJobService userJobService; - @Resource - private KpiResultIndicatorWeightService kpiResultIndicatorWeightService; - @Resource - private UnitServiceImpl unitService; - @Resource - private JobService jobService; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - @Resource - private KpiResultService kpiResultService; - - @Resource - private KpiApplyBizService kpiApplyBizService; - - @Resource - private UserService userService; - - - /** - * 页面迁移:查询考核记录页面 - * - * @author lihongye - * @date 2021/10/21 9:23 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("loginUserid", cu.getId()); - model.addAttribute("periodType", PeriodTypeEnum.getAllEnableType4JSON()); - model.addAttribute("jobType", PositionTypeEnum.getAllEnableType4JSON()); - return "kpi/resultList"; - } - - /** - * 获取考核记录列表 - * - * @return 考核记录对象列表 - * @author lihongye - * @date 2021/10/21 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getAllList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - KpiResultQuery query) { - User cu = (User) request.getSession().getAttribute("cu"); - query.setLoginUserId(cu.getId()); - if (StringUtils.isNotEmpty(query.getDeptId())) { - List unitChildrenById = unitService.getUnitChildrenById(query.getDeptId()); - List deptIds = unitChildrenById.stream().map(Unit::getId).collect(Collectors.toList()); - deptIds.add(query.getDeptId()); - query.setChildrenDeptIdIn("'" + StringUtils.join(deptIds, "','") + "'"); - } else { - query.setChildrenDeptIdIn("'@#'"); - } - List resultVos = kpiResultService.selectResultList(query); - for (KpiPlanStaffResultAllVo item : resultVos) { - if (item.getPeriodType() == null || item.getJobLevelType() == null || item.getStatus() == null) { -// System.err.println(item.getId()); - } else { - item.setPeriodTypeName(PeriodTypeEnum.getNameByid(item.getPeriodType())); - item.setJobLevelTypeName(PositionTypeEnum.getNameByid(item.getJobLevelType())); - item.setStatusName(KpiApplyStatusEnum.getNameByid(item.getStatus())); - } - } - - PageInfo pi = new PageInfo<>(); - JSONArray json = JSONArray.fromObject(resultVos); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面迁移:统计报表(按部门统计) - * - * @return - * @author wangfaxiang - * @date 2021/10/25 11:37 - **/ - @RequestMapping("/statistics.do") - public String statistics(HttpServletRequest request, Model model) { - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - model.addAttribute("jobTypeList", PositionTypeEnum.getAllEnableType4JSON()); - model.addAttribute("periodTypeList", PeriodTypeEnum.getAllEnableType4JSON()); - return "/kpi/resultStatistics"; - } - - /** - * 统计报表(按部门统计) - * - * @return - * @author wangfaxiang - * @date 2021/10/25 11:37 - **/ - @RequestMapping("/getResultStatistics.do") - public ModelAndView getResultStatistics(HttpServletRequest request, Model model, KpiResultStatisticsListRequest requestBean) { - // 部门信息 - String result = ""; - if (requestBean.getDeptId() == null) { - result = "{\"code\":\"-1\",\"msg\":\"param error\",\"data\":null}"; - } else { - Unit unit = unitService.getUnitById(requestBean.getDeptId()); - List listInfo = kpiResultService.selectListByPeriod(requestBean, unit); - KpiResultStatisticsInfo detailInfo = kpiResultService.selectStatisticsInfo(requestBean, listInfo, unit); - result = "{\"code\":\"0\",\"msg\":\"\",\"data\":{\"detailInfo\":" + JSONObject.fromObject(detailInfo) + ",\"listInfo\":" + JSONArray.fromObject(listInfo) + ",\"requestCondition\":" + JSONObject.fromObject(requestBean) + "}}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getResultStatisticsExcel.do") - public void getResultStatisticsExcel(HttpServletRequest request, - HttpServletResponse response, Model model, KpiResultStatisticsListRequest requestBean) throws IOException { - // 部门信息 - String result = ""; - if (requestBean.getDeptId() == null) { - result = "{\"code\":\"-1\",\"msg\":\"param error\",\"data\":null}"; - } else { - Unit unit = unitService.getUnitById(requestBean.getDeptId()); - List listInfo = kpiResultService.selectListByPeriod(requestBean, unit); - KpiResultStatisticsInfo detailInfo = kpiResultService.selectStatisticsInfo(requestBean, listInfo, unit); - - //文件的实际地址 - String filepath = request.getSession().getServletContext().getRealPath("/"); - String filename = "按照部门统计评分结果.xls"; - //兼容Linux路径 - filepath = filepath + "Template" + System.getProperty("file.separator") + "kpi" + System.getProperty("file.separator") + filename; - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - String fileName = detailInfo.getDeptName() + "_" + PositionTypeEnum.getNameByid(requestBean.getJobType()) + "_" + detailInfo.getPeriodName() + ".xls"; - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode(fileName)); - - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(filepath).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet().build(); - FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); - excelWriter.fill(detailInfo, writeSheet); - excelWriter.fill(listInfo, fillConfig, writeSheet); - excelWriter.finish(); - } - } - - } - - - /** - * 页面迁移:个人考核结果的数据统计 - * - * @return - * @author lichen - * @date 2021/10/25 11:37 - **/ - @RequestMapping("/resultDetail.do") - public String statistics(HttpServletRequest request, Model model, String planStaffId) { - - // 要返给页面的两个对象 - List list = new ArrayList<>(); - List listNeiBuKeHu = new ArrayList<>(); - KpiResultDetailInfo info = new KpiResultDetailInfo(); - - // 考核内容主键 - KpiPlanStaffBo kpiPlanStaff = kpiPlanStaffService.selectById(planStaffId); - - info.setObjUserName(kpiPlanStaff.getUser().getCaption()); - info.setCardId(kpiPlanStaff.getUser().getUserCardId()); - info.setJobName(kpiPlanStaff.getJob().getName()); - info.setDeptName(kpiPlanStaff.getUser().get_pname()); - info.setPeriodName(kpiPlanStaff.getKpiPeriodInstance().getPeriodName()); - info.setPlanStaffStatus(kpiPlanStaff.getStatus()); - info.setPeriodType(kpiPlanStaff.getKpiPeriodInstance().getPeriodType()); - // 需要从工作流获取 - info.setPlanMakeInfo(kpiResultService.getPlanMakeInfo(kpiPlanStaff, ProcessType.KPI_MAKE_PLAN.getId())); - // 需要从工作流获取 - info.setMarkInfo(kpiResultService.getPlanMakeInfo(kpiPlanStaff, ProcessType.KPI_MARK.getId())); - // 总得分和单列指标得分 - KpiResult kpiResult = kpiResultService.selectByKpiPlanStaffId(kpiPlanStaff.getId()); - info.setDimensionPoint(kpiResult.getDimensionPoint()); - - info.setResultPoint(kpiResult.getResultPoint()); - info.setResultLevel(kpiResult.getResultLevel()); - - info.setSingleIndicatorName(kpiResult.getSingleIndicatorName()); - info.setSingleIndicatorPoint(kpiResult.getSingleIndicatorPoint()); - - // 考核指标列表 - List kpiPlanStaffDetailList = kpiPlanStaffDetailService.selectListByPlanStaffId(planStaffId); - for (KpiPlanStaffDetail item : kpiPlanStaffDetailList) { - // 获取权重信息 - KpiResultIndicatorWeight indicatorWeight = kpiResultIndicatorWeightService.selectByPlanStaffDetailId(item.getId()); - KpiResultDetailListBean bean = new KpiResultDetailListBean(); - // 完成情况 - bean.setCompletionStatus(indicatorWeight.getCompletionStatus()); - bean.setIndicatorWeightPoint(indicatorWeight.getWeightPoint()); - bean.setDimensionName(item.getDimensionName()); - bean.setIndicatorName(item.getIndicatorName()); - bean.setIndicatorWeight(item.getIndicatorWeight()); - // 获取得分信息 - List kpiResultIndicatorList = kpiResultIndicatorService.selectListByPlanStaffDetailId(item.getId()); - List resultPoint = new ArrayList<>(); - List processPoint = new ArrayList<>(); - for (KpiResultIndicator item2 : kpiResultIndicatorList) { - resultPoint.add(item2.getResultPoint()); - processPoint.add(item2.getProcessPoint()); - } - // 结果得分集合 - bean.setResultPointList(resultPoint); - // 过程得分集合 - bean.setProcessPointList(processPoint); - // 结果过程合计得分 - bean.setIndicatorWeightPoint(indicatorWeight.getWeightPoint()); - // 单独摘出内部客户维度 - if (KpiConstant.SPECIAL_DIMENSION.equals(bean.getDimensionName())) { - listNeiBuKeHu.add(bean); - } else { - list.add(bean); - } - } - // 获取层级以及各个层级的权重 - if (PositionTypeEnum.MiddleManager.getId() == kpiPlanStaff.getJob().getLevelType()) { - info.setMarkLevelWeight(KpiConstant.MARK_LEVEL_3_WEIGHT); - } else { - info.setMarkLevelWeight(KpiConstant.MARK_LEVEL_2_WEIGHT); - } - - model.addAttribute("id", planStaffId); - - if (PeriodTypeEnum.Year.getId() == kpiPlanStaff.getKpiPeriodInstance().getPeriodType()) { - // 如果是年度考核 - // 年度内绩效考核评价成绩 - info.setAvgPoint(kpiResultService.resultAvgPointByYear(kpiPlanStaff.getObjUserId(), kpiPlanStaff.getKpiPeriodInstance().getPeriodYear())); - model.addAttribute("listNeiBu", JSONArray.fromObject(listNeiBuKeHu)); - model.addAttribute("list", JSONArray.fromObject(list)); - model.addAttribute("info", JSONObject.fromObject(info)); - model.addAttribute("status", info.getPlanStaffStatus()); - return "kpi/resultInfoYear"; - } else { - // 如果是非年度考核 - info.setResultProcessWeight(KpiConstant.RESULT_PROCESS_WEIGHT); - model.addAttribute("listNeiBu", JSONArray.fromObject(listNeiBuKeHu)); - model.addAttribute("list", JSONArray.fromObject(list)); - model.addAttribute("info", JSONObject.fromObject(info)); - model.addAttribute("status", info.getPlanStaffStatus()); - return "kpi/resultInfoNotYear"; - } - - } - - /** - * 确认后更改考核状态 - * - * @author lihongye - * @date 2021/10/30 10:37 - */ - @RequestMapping("/updateStatus.do") - public ModelAndView updateStatus(HttpServletRequest request, Model model, String planStaffId, Integer status) { - - - User cu = (User) request.getSession().getAttribute("cu"); - - - KpiPlanStaff kpiPlanStaff = kpiPlanStaffService.selectById(planStaffId); - - - if (cu.getId().equals(kpiPlanStaff.getObjUserId())) { - kpiPlanStaff.setStatus(status); - int result = kpiPlanStaffService.update(kpiPlanStaff); - model.addAttribute("result", result); - return new ModelAndView("result"); - } else { - model.addAttribute("result", "-9"); - return new ModelAndView("result"); - } - - - } -} - - diff --git a/src/com/sipai/controller/kpi/KpiResultIndicatorController.java b/src/com/sipai/controller/kpi/KpiResultIndicatorController.java deleted file mode 100644 index 83fc5265..00000000 --- a/src/com/sipai/controller/kpi/KpiResultIndicatorController.java +++ /dev/null @@ -1,316 +0,0 @@ -package com.sipai.controller.kpi; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.kpi.*; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.kpi.*; -import net.sf.json.JSONArray; -import org.activiti.engine.impl.task.TaskDefinition; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.math.BigDecimal; -import java.util.List; - -@Controller -@RequestMapping("/kpi/KpiResultIndicator") -public class KpiResultIndicatorController { - @Resource - private KpiApplyBizService kpiApplyBizService; - @Resource - private KpiResultIndicatorService kpiResultIndicatorService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private KpiResultIndicatorWeightService kpiResultIndicatorWeightService; - @Resource - private WorkflowService workflowService; - @Resource - private KpiResultService kpiResultService; - @Resource - private KpiPeriodInstanceService periodInstanceService; - @Resource - private KpiWorkflowService kpiWorkflowService; - - /** - * 页面迁移:打分页面 - * - * @author lichen - * @date 2021/10/8 15:23 - **/ - @RequestMapping("/showListForMark.do") - public String showListForMark(HttpServletRequest request, Model model, - @RequestParam String applyBizId, - @RequestParam(required = false) String periodInstanceId, - @RequestParam(required = false) String taskId - ) throws Exception { - KpiApplyBiz kpiApplyBiz = kpiApplyBizService.selectById(applyBizId); - if (periodInstanceId == null) { - - periodInstanceId = kpiApplyBiz.getPeriodInstanceId(); - } - - model.addAttribute("periodInstanceId", periodInstanceId); - model.addAttribute("applyBizId", applyBizId); - model.addAttribute("kpiApplyBiz", kpiApplyBiz); - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("loginUserId", cu.getId()); - - - // 控制是否是审批页面的展示 - if (taskId != null) { - TaskDefinition taskDefinition = kpiWorkflowService.getNextTaskInfo(taskId); - if (taskDefinition == null) { - // 这个人是绩效考核负责人 - model.addAttribute("hasNextAuditor", "0"); - model.addAttribute("taskId", taskId); - return "kpi/planStaffDetailListMarkFinal"; - - } else { - model.addAttribute("hasNextAuditor", "1"); - } - model.addAttribute("taskId", taskId); - - - } else { - model.addAttribute("taskId", ""); - } - - - return "kpi/planStaffDetailListMark"; - } - - /** - * 获取打分页面考核内容列表 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "planStaffId") String planStaffId) { - - User cu = (User) request.getSession().getAttribute("cu"); - KpiMarkListQuery query = - KpiMarkListQuery.builder() - .autidUserId(cu.getId()) - .planStaffId(planStaffId).build(); - - PageHelper.startPage(page, rows); - List list = kpiPlanStaffDetailService.selectListByWhereWihtCompletionStatus(query); - - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取打分页面考核内容列表 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @RequestMapping("/getListFinal.do") - public ModelAndView getListFianl(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "planStaffId") String planStaffId) { - - User cu = (User) request.getSession().getAttribute("cu"); - - - KpiMarkListQuery query = - KpiMarkListQuery.builder() - .autidUserId(cu.getId()) - .planStaffId(planStaffId).build(); - - List kpiMarUserLists = kpiResultIndicatorService.auditList(query); - - query = - KpiMarkListQuery.builder() - .autidUserId(cu.getId()) - .planStaffId(planStaffId) - .autidUserId1(kpiMarUserLists.get(0).getAuditorId()) - .autidUserId2(kpiMarUserLists.size() > 1 ? kpiMarUserLists.get(1).getAuditorId() : null) - .autidUserId3(kpiMarUserLists.size() > 2 ? kpiMarUserLists.get(2).getAuditorId() : null) - .build(); - - PageHelper.startPage(page, rows); - List list = kpiPlanStaffDetailService.selectListByWhereWihtCompletionStatusFinal(query); - - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 打分结果保存和更新 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(KpiResultIndicator kpiResultIndicator, HttpServletRequest request, HttpServletResponse response) { - - KpiResultIndicatorWeight kpiResultIndicatorWeight = new KpiResultIndicatorWeight(); - kpiResultIndicatorWeight.setPlanStaffDetailId(kpiResultIndicator.getPlanStaffDetailId()); - kpiResultIndicatorWeight.setCompletionStatus(kpiResultIndicator.getCompletionStatus()); - kpiResultIndicatorWeight.setWeightPoint(BigDecimal.ZERO); - - - if (kpiResultIndicator.getResultPoint() != null) { - if (kpiResultIndicator.getResultPoint().intValue() > 100 || kpiResultIndicator.getResultPoint().intValue() < 0) { - response.setStatus(400); - return Result.failed(""); - } - } - if (kpiResultIndicator.getProcessPoint() != null) { - if (kpiResultIndicator.getProcessPoint().intValue() > 100 || kpiResultIndicator.getProcessPoint().intValue() < 0) { - response.setStatus(400); - return Result.failed(""); - } - } - - - User cu = (User) request.getSession().getAttribute("cu"); - kpiResultIndicator.setAuditorId(cu.getId()); - KpiResultIndicator kpiResultIndicatorFromDb = kpiResultIndicatorService.selectByPlanStaffDetailIdAndAuditorId - (kpiResultIndicator.getPlanStaffDetailId(), cu.getId()); - if (kpiResultIndicatorFromDb == null) { - kpiResultIndicatorService.save(kpiResultIndicator); - - } else { - kpiResultIndicator.setId(kpiResultIndicatorFromDb.getId()); - kpiResultIndicatorService.update(kpiResultIndicator); - - } - - KpiResultIndicatorWeight kpiResultIndicatorWeight1 = kpiResultIndicatorWeightService.selectByPlanStaffDetailId(kpiResultIndicator.getPlanStaffDetailId()); - if (kpiResultIndicatorWeight.getCompletionStatus() == null) { - return Result.success(); - } - - if (kpiResultIndicatorWeight1 == null) { - //通过kpiResultIndicator.getPlanStaffDetailId() 的id来查询对应完成情况 - //如果完成情况描述也是空的,这一步就进行完成情况的保存 - kpiResultIndicatorWeightService.save(kpiResultIndicatorWeight); - } else { - //如果完成情况描述不是空的,然后进行更新 - String whereStr = "where plan_staff_detail_id = '" + kpiResultIndicator.getPlanStaffDetailId() + "'"; - kpiResultIndicatorWeight.setWhere(whereStr); - kpiResultIndicatorWeightService.update(kpiResultIndicatorWeight); - } - - return Result.success(); - } - - /** - * 打分 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/markSubmit.do") - @ResponseBody - public Result markSubmit(HttpServletRequest request, - KpiActivitiRequest applyRequest) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - applyRequest.setLoginUserId(cu.getId()); - - // 判断打分合理性,驳回时不用检查 - if (!"0".equals(applyRequest.getPass())) { - try { - //1.获取task - if (StringUtils.isNotBlank(applyRequest.getTaskId())) { - Task curenntTask = workflowService.getTaskService().createTaskQuery().taskId(applyRequest.getTaskId()).singleResult(); - TaskDefinition taskDefinition = kpiWorkflowService.getNextTaskInfo(curenntTask.getId()); - if (taskDefinition != null) { - kpiResultIndicatorService.checkMarkPoint(applyRequest); - } - } else { - kpiResultIndicatorService.checkMarkPoint(applyRequest); - } - - } catch (RuntimeException ex) { - return Result.failed(ex.getMessage()); - } - } - if (StringUtils.isBlank(applyRequest.getTaskId())) { - // 启动打分流程 - return kpiResultService.startProcess(applyRequest, cu); - } else { - // 完成任务节点 - return kpiResultService.audit(applyRequest, cu); - } - } - - /** - * 保存单列指标 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/saveSingleIndicator.do") - @ResponseBody - public Result saveSingleIndicator(KpiActivitiRequest applyRequest) { - return kpiResultService.saveSingleIndicator(applyRequest); - } - - /** - * 查询单列指标 - * - * @author lichen - * @date 2021/10/16 10:55 - **/ - @RequestMapping("/getSingleIndicator.do") - @ResponseBody - public Result getSingleIndicator(KpiActivitiRequest applyRequest) { - KpiResult kpiResultFromDB = kpiResultService.selectByKpiPlanStaffId(applyRequest.getPlanStaffId()); - return Result.success(kpiResultFromDB); - } - - /** - * 获取历史打分情况 - * - * @author JY - * @date 2022/08/11 - **/ - @RequestMapping("/showHisScore.do") - public String showHisScore(HttpServletRequest request, Model model, - String planStaffId) { - model.addAttribute("planStaffId", planStaffId); - return "/kpi/planStaffDetailListHisMark"; - } -} diff --git a/src/com/sipai/controller/local/LocalController.java b/src/com/sipai/controller/local/LocalController.java deleted file mode 100644 index 137a8581..00000000 --- a/src/com/sipai/controller/local/LocalController.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.sipai.controller.local; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.alarm.AlarmLevelsCodeEnum; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MessageEnum; -import com.sipai.tools.WebSocketCmdUtil; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.List; - -@Controller -@RequestMapping("/local/localController") -public class LocalController { - @Resource - private MPointService mPointService; - @Resource - private CompanyService companyService; - @Resource - private ProAlarmService proAlarmService; - @Resource - private AlarmPointService alarmPointService; - @Resource - private UserService userService; - - /** - * 接收人员定位 更新数据 - */ - /*@RequestMapping("/updateMpoint.do") - public String updateMpoint(HttpServletRequest request, Model model) { - String areaname = request.getParameter("areaname"); - String num = request.getParameter("num"); - String unitId = request.getParameter("unitId"); - - if (areaname != null) { - if (areaname != null && areaname.equals("新一泵电房1")) { - this.fun1(unitId); - } else if (areaname != null && areaname.equals("新一泵电房2")) { - this.fun1(unitId); - } else if (areaname != null && areaname.equals("新一泵电房3")) { - this.fun1(unitId); - } else if (areaname != null && areaname.equals("旧一泵电房1")) { - this.fun2(unitId); - } else if (areaname != null && areaname.equals("旧一泵电房2")) { - this.fun2(unitId); - } else { - //不处理 - } - - List list = mPointService.selectListByWhere(unitId, "where ParmName = '" + areaname + "在线数'"); - if (list != null && list.size() > 0) { - MPoint mPoint = list.get(0); - mPoint.setParmvalue(new BigDecimal(num)); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setSourceType(mPoint.getSourceType()); - mPointService.update(unitId, mPoint); - } - } - model.addAttribute("result", "1"); - return "result"; - }*/ - - /** - * 接收人员定位 更新数据 - */ - @RequestMapping("/updateMpoint4Code.do") - public String updateMpoint4Code(HttpServletRequest request, Model model) { - String mpcode = request.getParameter("mpcode"); - String num = request.getParameter("num"); - String unitId = request.getParameter("unitId"); - List list = mPointService.selectListByWhere(unitId, "where id = '" + mpcode + "'"); - if (list != null && list.size() > 0) { - MPoint mPoint = list.get(0); - mPoint.setParmvalue(new BigDecimal(num)); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setSourceType(mPoint.getSourceType()); - mPointService.update(unitId, mPoint); - } - model.addAttribute("result", "1"); - return "result"; - } - - /** - * 接收人员定位 电子围栏报警 - */ - @RequestMapping("/onRichAlarm.do") - public String onRichAlarm(HttpServletRequest request, Model model) { - String relatedTagId = request.getParameter("relatedTagId");//标签编号 - String alarmTime = request.getParameter("alarmTime");//报警时间 - String alarmDesc = request.getParameter("alarmDesc");//报警描述 - alarmTime = CommUtil.getDateTimeByMillisecond(alarmTime); - - List companys = companyService.selectListByWhere("where type = '" + CommString.UNIT_TYPE_BIZ + "' and active = '1' "); - if (companys != null) { - String bizid = companys.get(0).getId(); - String sql = "where point_code = '" + relatedTagId + "' and alarm_type = '" + AlarmMoldCodeEnum.Type_Location_Fence + "' " + - "and biz_id = '" + bizid + "' and status ='" + ProAlarm.STATUS_ALARM + "' and alarm_level = '" + AlarmLevelsCodeEnum.level1 + "' " + - "and alarm_time>=dateadd(minute,-10,GETDATE())" + - "order by insdt desc"; - List list = proAlarmService.selectListByWhere(bizid, sql); - if (list != null && list.size() > 0) { -// System.out.println("存在电子围栏报警------" + relatedTagId + "------" + CommUtil.nowDate()); - } else { - String sql2 = "where point_code = '" + relatedTagId + "' and alarm_type = '" + AlarmMoldCodeEnum.Type_Location_Fence + "' " + - "and biz_id = '" + bizid + "' and status ='" + ProAlarm.STATUS_ALARM + "' and alarm_level = '" + AlarmLevelsCodeEnum.level1 + "' "; - List list2 = proAlarmService.selectListByWhere(bizid, sql2); - for (ProAlarm proAlarm : list2) { - //2.报警恢复 - int result = this.alarmPointService.alarmRecover(bizid, relatedTagId, proAlarm.getAlarmTime(), "0"); - if (result == 1) { -// System.out.println("电子围栏报警恢复" + relatedTagId + "------" + CommUtil.nowDate()); - } - } - -// System.out.println("新的电子围栏报警------" + relatedTagId + "------" + CommUtil.nowDate()); - - //将标签名查出对应人名 - String pointName = relatedTagId + "标签"; - List userList = userService.getUserByCardId(relatedTagId); - if (userList != null && userList.size() > 0) { - pointName = relatedTagId + "(" + userList.get(0).getCaption() + ")标签"; - } - - int result2 = this.alarmPointService.insertAlarm(bizid, null, AlarmMoldCodeEnum.Type_Location_Fence.getKey(), relatedTagId, pointName, alarmTime, AlarmLevelsCodeEnum.level1.getKey(), alarmDesc, "1", "", ""); - if (result2 == 1) { -// System.out.println("新增电子围栏报警成功------" + relatedTagId + "------" + CommUtil.nowDate()); - - try { - System.out.println("开始推送三维电子围栏报警===" + CommUtil.nowDate() + "===" + alarmDesc); - //推送 读 - JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", alarmDesc); - WebSocketCmdUtil.send(readJson); - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - try { - Thread.sleep(1); - } catch (Exception e) { - - } - - //推送 弹 - JSONObject readJson2 = JSONObject.parseObject(MessageEnum.THE_ALERT.toString()); - readJson2.put("action", alarmDesc); - WebSocketCmdUtil.send(readJson2); - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - try { - Thread.sleep(1); - } catch (Exception e) { - - } - - //人员定位 - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_FINDPP.toString()); - WebSocketCmdUtil.send(jsonObject.get("cmdType").toString(), relatedTagId, jsonObject.get("action").toString(), System.currentTimeMillis()); - } catch (Exception e) { -// e.printStackTrace(); - } - - } else { -// System.out.println("新增电子围栏报警失败------" + relatedTagId + "------" + CommUtil.nowDate()); - } - } - } - model.addAttribute("result", "1"); - return "result"; - } - - /*public void fun1(String unitId) { - int num_all = 0; - MPoint mPoint1 = mPointService.selectById("area_online_num_xybdf_1"); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - num_all += Integer.parseInt(mPoint1.getParmvalue().toString()); - } - MPoint mPoint2 = mPointService.selectById("area_online_num_xybdf_2"); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - num_all += Integer.parseInt(mPoint2.getParmvalue().toString()); - } - MPoint mPoint3 = mPointService.selectById("area_online_num_xybdf_3"); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - num_all += Integer.parseInt(mPoint3.getParmvalue().toString()); - } - MPoint mPoint4 = mPointService.selectById("area_online_num_xybdf_all"); - if (mPoint4 != null) { - mPoint4.setParmvalue(new BigDecimal(num_all)); - mPoint4.setMeasuredt(CommUtil.nowDate()); - mPoint4.setSourceType(mPoint4.getSourceType()); - mPointService.update(unitId, mPoint4); - } - }*/ - - /*public void fun2(String unitId) { - int num_all = 0; - MPoint mPoint1 = mPointService.selectById("area_online_num_jybdf_1"); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - num_all += Integer.parseInt(mPoint1.getParmvalue().toString()); - } - MPoint mPoint2 = mPointService.selectById("area_online_num_jybdf_2"); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - num_all += Integer.parseInt(mPoint2.getParmvalue().toString()); - } - MPoint mPoint4 = mPointService.selectById("area_online_num_jybdf_all"); - if (mPoint4 != null) { - mPoint4.setParmvalue(new BigDecimal(num_all)); - mPoint4.setMeasuredt(CommUtil.nowDate()); - mPoint4.setSourceType(mPoint4.getSourceType()); - mPointService.update(unitId, mPoint4); - } - }*/ - - -} diff --git a/src/com/sipai/controller/maintenance/AbnormityController.java b/src/com/sipai/controller/maintenance/AbnormityController.java deleted file mode 100644 index 2911cf6b..00000000 --- a/src/com/sipai/controller/maintenance/AbnormityController.java +++ /dev/null @@ -1,1637 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.*; - -import io.swagger.annotations.*; -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.EquipmentPlanService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.KPIPointProfessorService; - -@Controller -@RequestMapping("/maintenance/abnormity") -@Api(value = "/maintenance/abnormity", tags = "异常上报") -public class AbnormityController { - @Resource - private AbnormityService abnormityService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private WorkflowService workflowService; - @Resource - private MsgServiceImpl msgServiceImpl; - @Resource - private KPIPointProfessorService kpiPointProfessorService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private UserService userService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private WorkorderDetailService workorderDetailService; - - /** - * 打开异常页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "maintenance/abnormityList"; - } - - @RequestMapping("/showList_new.do") - public String showList_new(HttpServletRequest request, Model model) { - if (request.getParameter("userName") != null) { - if (request.getParameter("userName") != null) { - User cu = userService.getUserByLoginName(request.getParameter("userName")); - if (cu != null) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - } - } - User cu1 = (User) request.getSession().getAttribute("cu"); - if (cu1 != null) { - request.setAttribute("userId", cu1.getId()); - } - return "maintenance/abnormityList_new"; - } - - /** - * 获取list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page") Integer page, @RequestParam(value = "rows") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String pSectionId = request.getParameter("pSectionId"); - String ids = request.getParameter("ids"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and biz_id in (" + companyids + ") "; - } - } - if (pSectionId != null && !pSectionId.isEmpty()) { - wherestr += " and process_section_id = '" + pSectionId + "' "; - } - if (ids != null && !ids.isEmpty()) { - ids = ids.replace(",", "','"); - wherestr += " and id in ('" + ids + "')"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("statusSelect") != null && !request.getParameter("statusSelect").isEmpty()) { - wherestr += " and status = '" + request.getParameter("statusSelect") + "'"; - } - PageHelper.startPage(page, rows); - List list = this.abnormityService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取list数据 - */ - @RequestMapping("/getList_new.do") - public ModelAndView getList_new(HttpServletRequest request, Model model, @RequestParam(value = "page") Integer page, @RequestParam(value = "rows") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("unitId"); - String pSectionId = request.getParameter("pSectionId"); - String insdt = request.getParameter("insdt"); - String type = request.getParameter("type"); - String ids = request.getParameter("ids"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and biz_id in (" + companyids + ") "; - } - } - if (pSectionId != null && !pSectionId.isEmpty()) { - wherestr += " and process_section_id = '" + pSectionId + "' "; - } - if (ids != null && !ids.isEmpty()) { - ids = ids.replace(",", "','"); - wherestr += " and id in ('" + ids + "')"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and abnormity_description like '%" + request.getParameter("search_name") + "%' "; - } - if (insdt != null && !insdt.equals("")) { - String[] str = insdt.split("~"); - wherestr += " and insdt between'" + str[0] + "'and'" + str[1] + "'"; - } - if (type != null && !type.equals("") && !type.equals("all")) { - wherestr += " and type = '" + type + "'"; - } - - String statusSelect = request.getParameter("statusSelect"); - if (statusSelect != null && !statusSelect.isEmpty()) { - /*if (statusSelect.equals(Abnormity.Status_Finish)) { - wherestr += " and status = '" + statusSelect + "'"; - } else { - wherestr += " and status = '" + Abnormity.Status_Start + "'"; - }*/ - wherestr += " and status = '" + statusSelect + "'"; - } else { -// wherestr += " and status = '" + Abnormity.Status_Start + "'"; - } - - String insuserSelect = request.getParameter("insuserSelect"); - if (insuserSelect != null && !insuserSelect.isEmpty()) { - if (insuserSelect.equals("oneself")) { - wherestr += " and insuser = '" + cu.getId() + "'"; - } else { - wherestr += ""; - } - } - - PageHelper.startPage(page, rows); - List list = this.abnormityService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取list数据 - */ - @RequestMapping("/getList_pnew.do") - public ModelAndView getList_pnew(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("unitId"); - String patrolRecordId = request.getParameter("patrolRecordId"); - String insdt = request.getParameter("insdt"); - - String wherestr = "where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and biz_id in (" + companyids + ") "; - } - } - if (patrolRecordId != null && !patrolRecordId.isEmpty()) { - wherestr += " and patrol_record_id = '" + patrolRecordId + "' "; - } - if (insdt != null && !insdt.equals("")) { - wherestr += "and DateDiff(dd,insdt,'" + insdt + "')=0"; - } - - List list = this.abnormityService.selectListByWhere(wherestr); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 设备管理日历中查看异常列表页面 - */ - @RequestMapping("/showAbnormalListForView.do") - public String showAbnormalList(HttpServletRequest request, Model model) { - String ids = request.getParameter("ids"); - model.addAttribute("ids", ids); - return "maintenance/abnormityListView"; - } - - /** - * 打开异常上报界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - model.addAttribute("company", company); - model.addAttribute("id", CommUtil.getUUID()); - return "maintenance/abnormityAdd"; - } - - /** - * 打开异常上报界面 - * sj 2021-09-03 - */ - @RequestMapping("/doadd_new.do") - public String doadd_new(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - model.addAttribute("company", company); - model.addAttribute("id", CommUtil.getUUID()); - if (cu != null) { - model.addAttribute("userId", cu.getId()); - model.addAttribute("userName", cu.getCaption()); - } - return "maintenance/abnormityAdd_new"; - } - - /** - * 删除一条数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - int result = this.abnormityService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.abnormityService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存新增数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, @ModelAttribute("abnormity") Abnormity abnormity) { - User cu = (User) request.getSession().getAttribute("cu"); - abnormity.setInsuser(cu.getId()); - abnormity.setInsdt(CommUtil.nowDate()); -// int result = this.abnormityService.save(abnormity); - if (abnormity != null && abnormity.getId() == null) { - abnormity.setId(CommUtil.getUUID()); - } - this.abnormityService.save(abnormity); - //异常上报插入专家消息,录屏测试用 - msgServiceImpl.insertMsgSend("PROFESSOR", "(异常上报)" + CommUtil.nowDate().substring(0, 16) + " 发生" + abnormity.getAbnormityDescription(), cu.getId(), cu.getId(), "U"); - //插入记录 -// KPIPointProfessor kpiPointProfessor = new KPIPointProfessor(); -// kpiPointProfessor.setId(CommUtil.getUUID()); -// kpiPointProfessor.setInsdt(CommUtil.nowDate()); -// kpiPointProfessor.setBizId(abnormity.getBizId()); -// kpiPointProfessor.setProcessSectionId(abnormity.getProcessSectionId()); -// kpiPointProfessor.setFlag("1"); -// kpiPointProfessor.setText(abnormity.getAbnormityDescription()); -// this.kpiPointProfessorService.save(kpiPointProfessor); -// String resstr="{\"res\":\""+result+"\",\"id\":\""+abnormity.getId()+"\"}"; -// model.addAttribute("result", resstr); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 查看信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Abnormity abnormity = this.abnormityService.selectById(id); - model.addAttribute("abnormity", abnormity); - return "maintenance/abnormityView"; - } - - /** - * 查看信息 - */ - @RequestMapping("/doview_new.do") - public String doview_new(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String ycCount = request.getParameter("ycCount"); - Abnormity abnormity = this.abnormityService.selectById(id); - model.addAttribute("abnormity", abnormity); - model.addAttribute("ycCount", ycCount); - return "maintenance/abnormityView_new"; - } - - /** - * 打开编辑界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Abnormity abnormity = this.abnormityService.selectById(id); - model.addAttribute("abnormity", abnormity); - return "maintenance/abnormityEdit"; - } - - /** - * 更新数据 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, @ModelAttribute("abnormity") Abnormity abnormity) { - User cu = (User) request.getSession().getAttribute("cu"); - abnormity.setInsuser(cu.getId()); - abnormity.setInsdt(CommUtil.nowDate()); - int result = this.abnormityService.update(abnormity); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + abnormity.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 打开异常生成缺陷界面 - */ - @RequestMapping("/showAbnormityCreateDefect.do") - public String showAbnormityCreateDefect(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { - model.addAttribute("ids", ids); - String[] idNumber = ids.split(","); - model.addAttribute("idNumber", idNumber.length); - ids = ids.replace(",", "','"); - List abnormities = this.abnormityService.selectListByWhere("where id in ('" + ids + "')"); - String equipmentIds = ""; - String equipmentNames = ""; - for (Abnormity abnormity : abnormities) { - if (abnormity.getEquipmentIds() != null && !abnormity.getEquipmentIds().isEmpty()) { - if (equipmentIds != "") { - equipmentIds += ","; - } - equipmentIds += abnormity.getEquipmentIds(); - } - } - equipmentIds = this.abnormityService.deleteRepeatElement(equipmentIds); - model.addAttribute("equipmentIds", equipmentIds); - model.addAttribute("companyId", abnormities.get(0).getBizId()); - model.addAttribute("processSectionId", abnormities.get(0).getProcessSectionId()); - equipmentIds = equipmentIds.replace(",", "','"); - List equipmentCards = this.equipmentCardService.selectListByWhere("where id in ('" + equipmentIds + "')"); - if (equipmentCards != null && equipmentCards.size() > 0) { - for (EquipmentCard equipmentCard : equipmentCards) { - if (equipmentNames != "") { - equipmentNames += ","; - } - equipmentNames += equipmentCard.getEquipmentname(); - } - } - model.addAttribute("equipmentNames", equipmentNames); - return "maintenance/abnormityCreateDefect"; - } - - /** - * 异常生成缺陷 - */ - @RequestMapping("/doCreateDefectByAbnormal.do") - public String doCreateDefectByAbnormal(HttpServletRequest request, Model model, @ModelAttribute("maintenanceDetail") MaintenanceDetail maintenanceDetail, @RequestParam(value = "ids") String ids) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenanceDetail.setId(CommUtil.getUUID()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setInsuser(cu.getId()); - //计划完成日期为空时,要设置为null,否则数据库里会保存1900-01-01 - if (maintenanceDetail.getPlannedenddt() == "") { - maintenanceDetail.setPlannedenddt(null); - } - int result = 0; - result = this.abnormityService.createDefect(ids, maintenanceDetail); - model.addAttribute("result", result); - return "result"; - } - - /** - * 异常统计,用于柱状图显示 - * - * @throws ParseException - */ - @RequestMapping("/getPatrolAbnormal.do") - public String getPatrolAbnormal(HttpServletRequest request, Model model) throws ParseException { - String type = request.getParameter("type"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - ArrayList numberList = new ArrayList<>(); - ArrayList nameList = new ArrayList<>(); - Calendar cal = Calendar.getInstance(); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String wherestr = "where 1=1 "; - String companyId = ""; - StringBuilder sqlWhere = new StringBuilder(wherestr); - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and biz_id = '" + request.getParameter("companyId") + "'"; - companyId = request.getParameter("companyId"); - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and process_section_id = '" + request.getParameter("pSectionId") + "' "; - sqlWhere.append(" and process_section_id = '" + request.getParameter("pSectionId") + "' "); - } - -/* List companyListVar=new ArrayList<>(); - if(!"".equals(companyId) && null!=companyId){ - Company company = unitService.getCompById(companyId); - List companyList = companyEquipmentCardCountService - .findAllCompanyByCompanyId(company); - companyListVar = companyList; - CompanyEquipmentCardCountService.allcompanyList = new ArrayList<>(); - }*/ - - - String companyIds = ""; - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - companyIds += " and biz_id in (" + companyids + ") "; - } - - //按自定义时间范围统计 - if (type == null || type == "") { - if (sdt != null && !sdt.isEmpty() && edt != null && !edt.isEmpty()) { - //开始日期 - Date sdtDate = sdf.parse(sdt); - cal.setTime(sdtDate); - cal.add(Calendar.DATE, -1); - //结束日期 - Date edtDate = sdf.parse(edt); - //相差天数 - int days = (int) ((edtDate.getTime() - sdtDate.getTime()) / (1000 * 3600 * 24)); - for (int i = 0; i <= days; i++) { - cal.add(Calendar.DATE, 1); - Date calDate = cal.getTime(); - String abnormalDate = sdf.format(calDate); - - - List list = this.abnormityService.selectListByWhere(sqlWhere.toString() + companyIds + " and convert(varchar(10),insdt,20) = '" + abnormalDate + "'"); - nameList.add(abnormalDate.substring(5, 10).replace("-", ".")); - numberList.add(list.size()); - - - } - } - } - //本周异常统计 - if (("week").equals(type)) { - //上周日的日期 - cal.set(Calendar.DAY_OF_WEEK, 1); - for (int i = 0; i < 7; i++) { - cal.add(Calendar.DATE, 1); - Date week = cal.getTime(); - String weekDate = sdf.format(week); - List list = this.abnormityService.selectListByWhere(sqlWhere.toString() + companyIds + " and convert(varchar(10),insdt,20) = '" + weekDate + "'"); - switch (i) { - case 0: - nameList.add("周一"); - numberList.add(list.size()); - break; - case 1: - nameList.add("周二"); - numberList.add(list.size()); - break; - case 2: - nameList.add("周三"); - numberList.add(list.size()); - break; - case 3: - nameList.add("周四"); - numberList.add(list.size()); - break; - case 4: - nameList.add("周五"); - numberList.add(list.size()); - break; - case 5: - nameList.add("周六"); - numberList.add(list.size()); - break; - case 6: - nameList.add("周日"); - numberList.add(list.size()); - break; - default: - break; - } - } - - } - //本月异常统计 - if (("month").equals(type)) { - // 获取前月的第一天 - cal.set(Calendar.DAY_OF_MONTH, 0); - //计算本月有多少天 - Calendar a = Calendar.getInstance(); - a.set(Calendar.DATE, 1);//把日期设置为当月第一天 - a.roll(Calendar.DATE, -1);//日期回滚一天,也就是最后一天 - int maxDate = a.get(Calendar.DATE); - for (int i = 0; i < maxDate; i++) { - cal.add(Calendar.DATE, 1); - Date month = cal.getTime(); - String monthDate = sdf.format(month); - List list = this.abnormityService.selectListByWhere(sqlWhere.toString() + companyIds + " and convert(varchar(10),insdt,20) = '" + monthDate + "'"); - nameList.add(monthDate.substring(5, 10).replace("-", ".")); - numberList.add(list.size()); - } - - } - //本年异常统计 - if (("year").equals(type)) { - Date date = new Date(); - for (int i = 1; i < 13; i++) { - String nowYear = sdf.format(date).substring(0, 4); - String monthName = ""; - if (String.valueOf(i).length() == 1) { - nowYear += "-0" + i; - monthName = nowYear.substring(6, 7) + "月"; - } else { - nowYear += "-" + i; - monthName = nowYear.substring(5, 7) + "月"; - } - - List list = this.abnormityService.selectListByWhere(sqlWhere.toString() + companyIds + " and CONVERT(varchar(7),insdt,120) = '" + nowYear + "'"); - nameList.add(monthName); - numberList.add(list.size()); - - } - } - String result = "{\"number\":" + JSONArray.fromObject(numberList) + ",\"name\":" + JSONArray.fromObject(nameList) + "}"; - //System.out.println(result); - model.addAttribute("result", result); - return "result"; - } - - /** - * APP调用接口,生成id - */ - @RequestMapping("/createID4APP.do") - public String createID4APP(HttpServletRequest request, Model model) { - String id = CommUtil.getUUID(); - model.addAttribute("result", id); - return "result"; - } - - /** - * APP调用接口,获取异常和各状态的缺陷记录 - */ - @RequestMapping("/getMaintainceList4APP.do") - public ModelAndView getMaintainceList4APP(HttpServletRequest request, Model model) { - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " a.insdt "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " desc "; - } - String result = ""; - String orderstr = " order by " + sort + " " + order; - try { - String userid = ""; - if (request.getParameter("userid") != null && !request.getParameter("userid").isEmpty()) { - userid = request.getParameter("userid").toString(); - } - - //day 时间区域判断 - String nowDate = CommUtil.nowDate(); - String startDate = ""; - if (request.getParameter("day") != null && !request.getParameter("day").isEmpty()) { - startDate = CommUtil.differenceDate(-(Integer.valueOf(request.getParameter("day").toString()) - 1));//减一天 - } else { - startDate = CommUtil.nowDate(); - } - - //三者总数量分别统计 - String bizid = ""; - if (request.getParameter("bizid") != null && !request.getParameter("bizid").toString().isEmpty()) { - bizid = request.getParameter("bizid").toString(); - } - int[] count = this.maintenanceDetailService.getCount(startDate, bizid, userid);//count[0]异常总数 count[1]缺陷处理中总数 count[2]缺陷已完成总数 - - //type 类型判断 - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - if (request.getParameter("type").toString().equals(MaintenanceDetail.Status_Wait)) { - System.out.println("222222222222222"); - //异常 - String wherestr = "WHERE (a.abnormity_description LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.equipmentName LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.factory_number LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.equipmentCardID LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.id = '" + request.getParameter("search_name") + "'" + " or tb_process_section.name LIKE '%" + request.getParameter("search_name") + "%'" + " or tb_user.caption LIKE '%" + request.getParameter("search_name") + "%')" + " and a.insdt between '" + startDate + "' and '" + nowDate + "' and a.status = '" + MaintenanceDetail.Status_Wait + "'"; - wherestr += " and a.biz_id ='" + bizid + "' "; - List abnormityList = this.abnormityService.selectListByWhere20200831(wherestr + orderstr); - String ids = ""; - if (abnormityList != null && abnormityList.size() > 0) { - for (int i = 0; i < abnormityList.size(); i++) { - ids += ("'" + abnormityList.get(i).getId() + "'"); - if (i != (abnormityList.size() - 1)) { - ids += ","; - } - } - } else { - ids = "''"; - } - PageHelper.startPage(pages, pagesize); - List abnormityList1 = this.abnormityService.selectListByWhere(" where id in (" + ids + ")" + " order by insdt desc"); - JSONArray jsonAbnormity = JSONArray.fromObject(abnormityList1); - PageInfo pi = new PageInfo(jsonAbnormity); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + jsonAbnormity + ",\"undo\":" + count[0] + ",\"doing\":" + count[1] + ",\"done\":" + count[2] + "}"; - } else if (request.getParameter("type").toString().equals(MaintenanceDetail.Status_Start)) { - System.out.println("00000000000000"); - //缺陷处理中 筛选人 -// String wherestr = " where insdt between '"+ startDate +"' and '" +nowDate+ "' and status not in ('"+MaintenanceDetail.Status_Finish+"','"+MaintenanceDetail.Status_Wait+"') and solver like '%"+userid+"%'"; - String wherestr = " WHERE (a.problemcontent LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.equipmentName LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.factory_number LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.equipmentCardID LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.id = '" + request.getParameter("search_name") + "'" + " or tb_process_section.name LIKE '%" + request.getParameter("search_name") + "%'" + " or tb_user.caption LIKE '%" + request.getParameter("search_name") + "%')" + " and a.insdt between '" + startDate + "' and '" + nowDate + "' and a.status not in ('" + MaintenanceDetail.Status_Finish + "','" + MaintenanceDetail.Status_Wait + "') and a.solver like '%" + userid + "%'"; - - wherestr += " and a.companyId ='" + bizid + "' "; - PageHelper.startPage(pages, pagesize); - List startList = this.maintenanceDetailService.selectListByWhere20200831(wherestr + orderstr); - //任务流程 - for (int i = 0; i < startList.size(); i++) { - TodoTask task = this.workflowService.getTodoTask(startList.get(i)); - List list = new ArrayList(); - list.add(task); - JSONArray jsonArray = this.workflowService.todoTasklistToJsonArray(list); - startList.get(i).setTodoTask(jsonArray); - } - JSONArray jsonMStart = JSONArray.fromObject(startList); - PageInfo pi = new PageInfo(jsonMStart); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + jsonMStart + ",\"undo\":" + count[0] + ",\"doing\":" + count[1] + ",\"done\":" + count[2] + "}"; - } else if (request.getParameter("type").toString().equals(MaintenanceDetail.Status_Finish)) { - System.out.println("1111111111111111"); - //缺陷已完成 筛选人 - //String wherestr = " where insdt between '"+ startDate +"' and '" +nowDate+ "' and status = '"+MaintenanceDetail.Status_Finish+"' and solver like '%"+userid+"%'"; - //20200421 修改 - String wherestr = " WHERE (a.problemcontent LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.equipmentName LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.factory_number LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.equipmentCardID LIKE '%" + request.getParameter("search_name") + "%'" + " or TB_EM_EquipmentCard.id = '" + request.getParameter("search_name") + "'" + " or tb_process_section.name LIKE '%" + request.getParameter("search_name") + "%'" + " or tb_user.caption LIKE '%" + request.getParameter("search_name") + "%')" + " and a.insdt between '" + startDate + "' and '" + nowDate + "' and a.status = '" + MaintenanceDetail.Status_Finish + "'"; - - if (request.getParameter("bizid") != null && !request.getParameter("bizid").toString().isEmpty()) { - wherestr += " and a.companyId ='" + request.getParameter("bizid").toString() + "' "; - } else { - wherestr = " where 1=0"; - } - PageHelper.startPage(pages, pagesize); - List finishList = this.maintenanceDetailService.selectListByWhere20200831(wherestr + orderstr); - JSONArray jsonMFinish = JSONArray.fromObject(finishList); - PageInfo pi = new PageInfo(jsonMFinish); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + jsonMFinish + ",\"undo\":" + count[0] + ",\"doing\":" + count[1] + ",\"done\":" + count[2] + "}"; - } else { - //其他 - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\": ,\"undo\":" + count[0] + ",\"doing\":" + count[1] + ",\"done\":" + count[2] + "}"; - } - } - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 根据指定日期获取异常上报 --巡检总览 sj 2020-04-26 - * - * @param unitId 部门Id - * @param dateType 时间类型 year month day - * @param reportDate 指定日期 - * @param - * @return - */ - @RequestMapping("/getAbnormityNum.do") - public String getAbnormityNum(HttpServletRequest request, Model model, @RequestParam(value = "unitId") String unitId, @RequestParam(value = "dateType") String dateType, @RequestParam(value = "reportDate") String reportDate) { - String pSectionId = request.getParameter("pSectionId");//工艺段 - String wherestr = ""; - JSONArray jsonArray = abnormityService.selectListByNum(wherestr, unitId, dateType, reportDate, pSectionId); - Result result = Result.success(jsonArray); -// System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 巡检总览中点击右上角的异常曲线 获取对应的异常列表 sj 2020-05-29 - * - * @param unitId 部门Id - * @param dateType 时间类型 year month day - * @param reportDate 指定日期 - * @param type 类型 P运行异常 E设备异常 - * @return - */ - @RequestMapping("/getAbnormityNumByDate.do") - public String getAbnormityNumByDate(HttpServletRequest request, Model model, @RequestParam(value = "unitId") String unitId, @RequestParam(value = "dateType") String dateType, @RequestParam(value = "reportDate") String reportDate, @RequestParam(value = "type") String type) { - String wherestr = ""; - List list = abnormityService.selectListByNumByDate(wherestr, unitId, dateType, reportDate, type); - Result result = Result.success(list); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取本厂已上报的列表 手持端 sj 2020-05-12 - * - * @param unitId 部门id - * @return - */ - @RequestMapping("/getAbnormityList4App.do") - public String getAbnormityList4App(HttpServletRequest request, Model model, @RequestParam(value = "unitId") String unitId) { - Result result = null; - String wherestr = " where unit_id = '" + unitId + "' "; - String orderstr = " order by insdt desc"; - List list = this.abnormityService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 设备总览中获取指定月异常上报数 - * - * @param request - * @param model - * @param unitId - * @return - */ - @RequestMapping("/getAbnormity4Month.do") - public String getAbnormity4Month(HttpServletRequest request, Model model, @RequestParam(value = "unitId") String unitId) { - String nowtime = CommUtil.nowDate(); - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(nowtime.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(nowtime.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - List datalist = new ArrayList(); - List datalist1 = new ArrayList(); - List datalist2 = new ArrayList(); - for (int i = 0; i < maxDateM; i++) { - EquipmentPlan equipmentPlan = this.equipmentPlanService.countListByWhere(" where plan_date = '" + nowtime.substring(0, 7) + "-" + (i + 1) + "' and plan_type_big = '" + EquipmentPlanType.Code_Type_Wx + "' "); - EquipmentPlan equipmentPlan2 = this.equipmentPlanService.countListByWhere(" where plan_date = '" + nowtime.substring(0, 7) + "-" + (i + 1) + "' and plan_type_big = '" + EquipmentPlanType.Code_Type_By + "' "); - - datalist.add(String.valueOf(i + 1)); - - datalist1.add(equipmentPlan.getPlanNumber()); - - datalist2.add(equipmentPlan2.getPlanNumber()); - - } - - nowtime = nowtime.substring(5, 7) + "月"; - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("nowtime", nowtime); - jsonObject.put("value", datalist); - jsonObject.put("value1", datalist1); - jsonObject.put("value2", datalist2); - model.addAttribute("result", jsonObject); - return "result"; - } - - /** - * 设备总览中获取指定月异常上报数 - * - * @param request - * @param model - * @param unitId - * @return - */ - @RequestMapping("/getAbnormity4Month2.do") - public String getAbnormity4Month2(HttpServletRequest request, Model model, @RequestParam(value = "unitId") String unitId) { - String nowtime = CommUtil.nowDate(); - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(nowtime.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(nowtime.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - List datalist = new ArrayList(); - List datalist1 = new ArrayList(); - List datalist2 = new ArrayList(); - for (int i = 0; i < maxDateM; i++) { - Abnormity abnormity = this.abnormityService.countListByWhere(" where insdt BETWEEN '" + nowtime.substring(0, 7) + "-" + (i + 1) + "' AND dateadd(second,-1,dateadd(day,1,'" + nowtime.substring(0, 7) + "-" + (i + 1) + "')) and type = '" + Abnormity.Type_Run + "' "); - Abnormity abnormity2 = this.abnormityService.countListByWhere(" where insdt BETWEEN '" + nowtime.substring(0, 7) + "-" + (i + 1) + "' AND dateadd(second,-1,dateadd(day,1,'" + nowtime.substring(0, 7) + "-" + (i + 1) + "')) and type = '" + Abnormity.Type_Equipment + "' "); - - datalist.add(String.valueOf(i + 1)); - - datalist1.add(abnormity.getSumitMan()); - - datalist2.add(abnormity2.getSumitMan()); - - } - - nowtime = nowtime.substring(5, 7) + "月"; - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("nowtime", nowtime); - jsonObject.put("value", datalist); - jsonObject.put("value1", datalist1); - jsonObject.put("value2", datalist2); - model.addAttribute("result", jsonObject); - return "result"; - } - - /** - * 保存异常上报,启动流程 - */ - @RequestMapping("/start.do") - public String start(HttpServletRequest request, Model model, @ModelAttribute Abnormity abnormity) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - try { - abnormity.setInsuser(cu.getId()); - abnormity.setInsdt(CommUtil.nowDate()); - abnormity.setStatus(WorkorderDetail.Status_Start); - result = this.abnormityService.start(abnormity); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + abnormity.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 异常上报处理页面 - * 2021-08-04 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showHandle.do") - public String showHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String entityId = pInstance.getBusinessKey(); - Abnormity entity = this.abnormityService.selectById(entityId); - model.addAttribute("entity", entity); - return "maintenance/abnormityHandle"; - } - - /** - * 异常上报处理页面 - * 2021-08-04 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showHandleIssue.do") - public String showHandleIssue(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - - //查询该项目是否需要抢单 - Work work = (Work) SpringContextUtil.getBean("work"); - model.addAttribute("compete", work.getCompete()); - - String entityId = pInstance.getBusinessKey(); - Abnormity entity = this.abnormityService.selectById(entityId); - model.addAttribute("entity", entity); - return "maintenance/abnormityHandleIssue"; - } - - /** - * 显示流程 流转信息 (维修) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - Abnormity entity = this.abnormityService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_RUN: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; -// case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN: -// List list2 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); -// for (BusinessUnitHandle businessUnitHandle : list2) { -// businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); -// businessUnitRecords.add(businessUnitRecord); -// } -// break; - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment: - List list3 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list3) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; -// case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment: -// List list4 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); -// for (BusinessUnitHandle businessUnitHandle : list4) { -// businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); -// businessUnitRecords.add(businessUnitRecord); -// } -// break; - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities: - List list5 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list5) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; -// case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities: -// List list6 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); -// for (BusinessUnitHandle businessUnitHandle : list6) { -// businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); -// businessUnitRecords.add(businessUnitRecord); -// } -// break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "maintenance/abnormity_processView"; - } else { - return "maintenance/abnormity_processView_alone"; - } - } - - /** - * 流程流转 (正常流程) - * - * @param request - * @param model - * @param businessUnitHandle - * @return - */ - @RequestMapping("/doHandleProcess.do") - public String doHandleProcess(HttpServletRequest request, Model model, @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - String planDate = request.getParameter("planDate"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - abnormityService.updateStatus(businessUnitHandle.getBusinessid(), cu, businessUnitHandle.getTargetusers(), planDate); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 (抢单) - * - * @param request - * @param model - * @param businessUnitHandle - * @return - */ - @RequestMapping("/doHandleProcessCompete.do") - public String doHandleProcessCompete(HttpServletRequest request, Model model, @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - String planDate = request.getParameter("planDate"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - //生成工单 - abnormityService.updateStatusCompete(businessUnitHandle.getBusinessid(), cu, businessUnitHandle.getTargetusers(), planDate); - //推送mqtt - workorderDetailService.sendMqtt(businessUnitHandle); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 上位机嵌入平台 异常待处理页面 - * - * @param request - * @param model - * @param type run(运行) equipment(设备) facilities(设施) - * @param unitName 厂名 (暂时没用到,先让上位机传,后面可能会用) - * @param userName 人名 (暂时没用到,先让上位机传,后面可能会用) - * @return - */ - @RequestMapping("/showList4ZK.do") - public String showList4ZK(HttpServletRequest request, Model model, @RequestParam(value = "type") String type, @RequestParam(value = "unitName") String unitName, @RequestParam(value = "userName") String userName) { - if (request.getParameter("userName") != null) { - if (request.getParameter("userName") != null) { - User cu = userService.getUserByLoginName(request.getParameter("userName")); - if (cu != null) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - } - } - model.addAttribute("type", type); - model.addAttribute("unitName", unitName); - model.addAttribute("userName", userName); - return "maintenance/abnormityHandleList4ZK"; - } - - /** - * 获取异常处理的数据(就是获取待办数据) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getList4ZK.do") - public ModelAndView getList4ZK(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); -// String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - - String userId = cu.getId(); - Map map = null; - List list = workflowService.findTodoTasks(userId, null, map); - - List list2 = new ArrayList(); - - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - //对象id - String id = list.get(i).getVariables().get("businessKey").toString(); - - if (type != null && type.equals(Abnormity.Type_Run)) { - if (list.get(i).getType().contains(ProcessType.Workorder_Abnormity_Run.getId())) { - Abnormity abnormity = abnormityService.selectById(id); - if (abnormity != null) { - list2.add(list.get(i));//只添加运行异常 - } - } - } - if (type != null && type.equals(Abnormity.Type_Equipment)) { - if (list.get(i).getType().contains(ProcessType.Workorder_Abnormity_Equipment.getId())) { - Abnormity abnormity = abnormityService.selectById(id); - if (abnormity != null) { - list2.add(list.get(i));//只添加设备异常 - } - } - } - if (type != null && type.equals(Abnormity.Type_Facilities)) { - if (list.get(i).getType().contains(ProcessType.Workorder_Abnormity_Facilities.getId())) { - Abnormity abnormity = abnormityService.selectById(id); - if (abnormity != null) { - list2.add(list.get(i));//只添加设施异常 - } - } - } - - } - } - - for (TodoTask todoTask : list2) { - //对象id - String id = todoTask.getVariables().get("businessKey").toString(); - Maintenance maintenance = null; - if (todoTask.getType().contains(ProcessType.Workorder_Abnormity_Run.getId())) { - Abnormity abnormity = abnormityService.selectById(id); - maintenance = new Maintenance(); - if (abnormity != null) { - Company company = unitService.getCompById(abnormity.getBizId()); - maintenance.setCompany(company); - } - maintenance.setProblem("异常上报"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - if (todoTask.getType().contains(ProcessType.Workorder_Abnormity_Equipment.getId())) { - Abnormity abnormity = abnormityService.selectById(id); - maintenance = new Maintenance(); - if (abnormity != null) { - Company company = unitService.getCompById(abnormity.getBizId()); - maintenance.setCompany(company); - } - maintenance.setProblem("异常上报"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - if (todoTask.getType().contains(ProcessType.Workorder_Abnormity_Facilities.getId())) { - Abnormity abnormity = abnormityService.selectById(id); - maintenance = new Maintenance(); - if (abnormity != null) { - Company company = unitService.getCompById(abnormity.getBizId()); - maintenance.setCompany(company); - } - maintenance.setProblem("异常上报"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - } - - JSONArray json = this.workflowService.todoTasklistToJsonArray(list2); - json = jsonArraySort(json, "task", true); - String result = json.toString(); - model.addAttribute("result", result); - System.out.println(result); - return new ModelAndView("result"); - } - - public JSONArray jsonArraySort(JSONArray jsonArr, final String sortKey, final boolean is_desc) { - //存放排序结果json数组 - JSONArray sortedJsonArray = new JSONArray(); - //用于排序的list - List jsonValues = new ArrayList(); - //将参数json数组每一项取出,放入list - for (int i = 0; i < jsonArr.size(); i++) { - jsonValues.add(net.sf.json.JSONObject.fromObject(jsonArr.getJSONObject(i))); - } - //快速排序,重写compare方法,完成按指定字段比较,完成排序 - Collections.sort(jsonValues, new Comparator() { - //排序字段 - private final String KEY_NAME = sortKey; - - //重写compare方法 - @Override - public int compare(net.sf.json.JSONObject a, net.sf.json.JSONObject b) { - String valA = new String(); - String valB = new String(); - try { - valA = a.getString(KEY_NAME); - valB = b.getString(KEY_NAME); - } catch (JSONException e) { - e.printStackTrace(); - } - //是升序还是降序 - if (is_desc) { - return -valA.compareTo(valB); - } else { - return -valB.compareTo(valA); - } - - } - }); - //将排序后结果放入结果jsonArray - for (int i = 0; i < jsonArr.size(); i++) { - sortedJsonArray.add(jsonValues.get(i)); - } - return sortedJsonArray; - } - - /** - * 更新数据 - */ - @RequestMapping("/doHandleProcessCancel1.do") - public String doHandleProcessCancel1(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - Abnormity abnormity = abnormityService.selectById(id); - abnormity.setInsuser(cu.getId()); - abnormity.setInsdt(CommUtil.nowDate()); - abnormity.setStatus(Abnormity.Status_Clear); - int result = this.abnormityService.update(abnormity); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + abnormity.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 (正常流程) - * - * @param request - * @param model - * @param businessUnitHandle - * @return - */ - @RequestMapping("/doHandleProcessCancel2.do") - public String doHandleProcessCancel2(HttpServletRequest request, Model model, @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } -// abnormityService.updateStatus(businessUnitHandle.getBusinessid(), cu, businessUnitHandle.getTargetusers()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getWorkId4Type.do") - public String getWorkId4Type(HttpServletRequest request, Model model, @RequestParam(value = "id") String id, @RequestParam(value = "type") String type) { - User cu = (User) request.getSession().getAttribute("cu"); - String workOrderId = ""; - if (type != null) { - if (type.equals(Abnormity.Type_Run)) { - List list = maintenanceDetailService.selectListByWhere("where abnormity_id = '" + id + "'"); - if (list != null && list.size() > 0) { - workOrderId = list.get(0).getId(); - } - } - if (type.equals(Abnormity.Type_Equipment)) { - List list = workorderDetailService.selectListByWhere("where abnormity_id = '" + id + "'"); - if (list != null && list.size() > 0) { - workOrderId = list.get(0).getId(); - } - } - } - String resstr = "{\"id\":\"" + workOrderId + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 导出 - */ - @RequestMapping(value = "/doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.abnormityService.doExport(unitId, request, response); - return null; - } - - - /** - * 之前更新沙口异常没有关联 - * - * @param request - * @param model - * @return - */ - /*@RequestMapping("/deleteTest.do") - public String deleteTest(HttpServletRequest request, Model model) { - - List list3 = workorderDetailService.selectSimpleListByWhere("where insdt>='2022-10-01' and abnormity_id is null"); - int del_d = 0; - if (list3 != null && list3.size() > 0) { - for (int i = 0; i < list3.size(); i++) { - List list2 = abnormityService.selectSimpleListByWhere("where abnormity_description = '" + list3.get(i).getFaultDescription() + "' and equipment_ids = '" + list3.get(i).getEquipmentId() + "' and insdt >='2022-10-01'"); - if (list2 != null && list2.size() > 0) { - WorkorderDetail workorderDetail = list3.get(i); - workorderDetail.setAbnormityId(list2.get(0).getId()); - workorderDetailService.update(workorderDetail); - System.out.println(workorderDetail.getJobNumber() + "已成功修改"); - } else { - - } - } - } - - List list = abnormityService.selectSimpleListByWhere("where insdt<='2022-11-15' and status!='finish' and status!='clear' and type = 'equipment'"); - int del = 0; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List list2 = workorderDetailService.selectSimpleListByWhere("where abnormity_id = '" + list.get(i).getId() + "'"); - if (list2 != null && list2.size() > 0) { - - } else { - del += 1; - System.out.println("异常id=" + list.get(i).getId() + "未关联" + del); - abnormityService.deleteById(list.get(i).getId()); - } - } - } - - - return ""; - }*/ - @ApiOperation(value = "手动调整更新异常状态", notes = "手动调整更新异常状态(异常上报增加了 待处理 的状态 所以需要手动更新一下状态)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - - }) - @RequestMapping(value = "/testUpdateStatus.do") - public String testUpdateStatus(HttpServletRequest request, Model model) { - try { - List list1 = abnormityService.selectSimpleListByWhere("where type = 'run' and status = 'start'"); - if (list1 != null && list1.size() > 0) { - for (int i = 0; i < list1.size(); i++) { - //实施单未完成的 - List list = maintenanceDetailService.selectSimpleListByWhere("where abnormity_id = '" + list1.get(i).getId() + "' and status!='" + MaintenanceDetail.Status_Finish + "'"); - if (list != null && list.size() > 0) { - Abnormity abnormity = list1.get(i); - abnormity.setStatus(Abnormity.Status_Processing); - abnormityService.update(abnormity); - } - //实施单已完成的 - List list2 = maintenanceDetailService.selectSimpleListByWhere("where abnormity_id = '" + list1.get(i).getId() + "' and status='" + MaintenanceDetail.Status_Finish + "'"); - if (list2 != null && list2.size() > 0) { - Abnormity abnormity = list1.get(i); - abnormity.setStatus(Abnormity.Status_Finish); - abnormityService.update(abnormity); - } - } - } - List list2 = abnormityService.selectSimpleListByWhere("where type = 'equipment' and status = 'start'"); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - //实施单未完成的 - List list = workorderDetailService.selectSimpleListByWhere("where abnormity_id = '" + list2.get(i).getId() + "' and status!= '" + WorkorderDetail.Status_Finish + "' and status!= '" + WorkorderDetail.Status_Cancel + "'"); - if (list != null && list.size() > 0) { - Abnormity abnormity = list2.get(i); - abnormity.setStatus(Abnormity.Status_Processing); - abnormityService.update(abnormity); - } - //实施单已完成的 - List list3 = workorderDetailService.selectSimpleListByWhere("where abnormity_id = '" + list2.get(i).getId() + "' and status in( '" + WorkorderDetail.Status_Finish + "','" + WorkorderDetail.Status_Cancel + "')"); - if (list3 != null && list3.size() > 0) { - Abnormity abnormity = list2.get(i); - abnormity.setStatus(Abnormity.Status_Finish); - abnormityService.update(abnormity); - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", "成功更新数据!" + CommUtil.nowDate()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/maintenance/AnticorrosiveLibraryController.java b/src/com/sipai/controller/maintenance/AnticorrosiveLibraryController.java deleted file mode 100644 index 92bbf9c8..00000000 --- a/src/com/sipai/controller/maintenance/AnticorrosiveLibraryController.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.AnticorrosiveLibraryService; -import com.sipai.tools.CommUtil; - -/** - * 防腐库 - * @author SJ - * - */ -@Controller -@RequestMapping("/maintenance/anticorrosiveLibrary") -public class AnticorrosiveLibraryController { - - @Resource - private AnticorrosiveLibraryService anticorrosiveLibraryService; - - @RequestMapping("/showlist.do") - public String showCollection(HttpServletRequest request,Model model) { - return "/maintenance/anticorrosiveLibraryList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model,HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - wherestr+=" and unit_id='"+request.getParameter("unitId")+"'"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and project_name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.anticorrosiveLibraryService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String res="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - - Result result = Result.success(res); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String id = CommUtil.getUUID(); - request.setAttribute("id", id); - return "maintenance/anticorrosiveLibraryAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - AnticorrosiveLibrary anticorrosiveLibrary = this.anticorrosiveLibraryService.selectById(id); - if(anticorrosiveLibrary!=null){ - model.addAttribute("anticorrosiveLibrary",anticorrosiveLibrary); - } - return "maintenance/anticorrosiveLibraryEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("anticorrosiveLibrary") AnticorrosiveLibrary anticorrosiveLibrary){ - User cu= (User)request.getSession().getAttribute("cu"); - //anticorrosiveLibrary.setId(CommUtil.getUUID()); - anticorrosiveLibrary.setInsdt(CommUtil.nowDate()); - anticorrosiveLibrary.setInsuser(cu.getId()); - int res = this.anticorrosiveLibraryService.save(anticorrosiveLibrary); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("anticorrosiveLibrary") AnticorrosiveLibrary anticorrosiveLibrary){ - int res = this.anticorrosiveLibraryService.update(anticorrosiveLibrary); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.anticorrosiveLibraryService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.anticorrosiveLibraryService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/maintenance/AnticorrosiveLibraryEquipmentController.java b/src/com/sipai/controller/maintenance/AnticorrosiveLibraryEquipmentController.java deleted file mode 100644 index e0159a27..00000000 --- a/src/com/sipai/controller/maintenance/AnticorrosiveLibraryEquipmentController.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.AnticorrosiveLibraryEquipment; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.AnticorrosiveLibraryEquipmentService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/anticorrosiveLibraryEquipment") -public class AnticorrosiveLibraryEquipmentController { - @Resource - private AnticorrosiveLibraryEquipmentService anticorrosiveLibraryEquipmentService; - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model,HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - wherestr+=" and pid='"+request.getParameter("anticorrosiveLibraryId")+"'"; - //wherestr+=" and unit_id='"+request.getParameter("unitId")+"'"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and project_name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.anticorrosiveLibraryEquipmentService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String res="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - - Result result = Result.success(res); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/updateEquipmentCards.do") - public String updateEquipmentCards(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String anticorrosiveLibraryId= request.getParameter("anticorrosiveLibraryId"); - String equipmentCardIds= request.getParameter("equipmentCardIds"); - this.anticorrosiveLibraryEquipmentService.deleteByWhere("where pid ='"+anticorrosiveLibraryId+"'"); - int result =0; - String[] idArrary=equipmentCardIds.split(","); - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - AnticorrosiveLibraryEquipment anticorrosiveLibraryEquipment = new AnticorrosiveLibraryEquipment(); - anticorrosiveLibraryEquipment.setId(CommUtil.getUUID()); - anticorrosiveLibraryEquipment.setPid(anticorrosiveLibraryId); - anticorrosiveLibraryEquipment.setEquid(str); - result += this.anticorrosiveLibraryEquipmentService.save(anticorrosiveLibraryEquipment); - } - } - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.anticorrosiveLibraryEquipmentService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.anticorrosiveLibraryEquipmentService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/AnticorrosiveLibraryMaterialController.java b/src/com/sipai/controller/maintenance/AnticorrosiveLibraryMaterialController.java deleted file mode 100644 index 87725f22..00000000 --- a/src/com/sipai/controller/maintenance/AnticorrosiveLibraryMaterialController.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; -import com.sipai.entity.maintenance.AnticorrosiveLibraryEquipment; -import com.sipai.entity.maintenance.AnticorrosiveLibraryMaterial; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.AnticorrosiveLibraryMaterialService; -import com.sipai.service.maintenance.AnticorrosiveLibraryService; -import com.sipai.tools.CommUtil; - -/** - * 防腐库 下关联的材料 - * @author SJ - * - */ -@Controller -@RequestMapping("/maintenance/anticorrosiveLibraryMaterial") -public class AnticorrosiveLibraryMaterialController { - - @Resource - private AnticorrosiveLibraryMaterialService anticorrosiveLibraryMaterialService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/maintenance/anticorrosiveLibraryMaterialList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model,HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - wherestr+=" and pid='"+request.getParameter("anticorrosiveLibraryId")+"'"; - //wherestr+=" and unit_id='"+request.getParameter("unitId")+"'"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and project_name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.anticorrosiveLibraryMaterialService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String res="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - - Result result = Result.success(res); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/updateMaterials.do") - public String updateMaterials(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String anticorrosiveLibraryId= request.getParameter("anticorrosiveLibraryId"); - String materialIds= request.getParameter("materialIds"); - //this.anticorrosiveLibraryMaterialService.deleteByWhere("where pid ='"+anticorrosiveLibraryId+"'"); - int result =0; - String[] idArrary=materialIds.split(","); - - String ids = "";//将选择的ids拼接 最后用于删除非ids中的其他数据 - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - String sql = " where pid = '"+anticorrosiveLibraryId+"' and material_id='"+str+"' "; - List list = anticorrosiveLibraryMaterialService.selectListByWhere(sql); - if(list!=null && list.size()>0){ - - }else { - AnticorrosiveLibraryMaterial anticorrosiveLibraryMaterial = new AnticorrosiveLibraryMaterial(); - anticorrosiveLibraryMaterial.setId(CommUtil.getUUID()); - anticorrosiveLibraryMaterial.setPid(anticorrosiveLibraryId); - anticorrosiveLibraryMaterial.setMaterialId(str); - result += this.anticorrosiveLibraryMaterialService.save(anticorrosiveLibraryMaterial); - } - ids += "'"+str+"',"; - } - } - - if(ids!=null && !ids.equals("")){ - ids = ids.substring(0,ids.length() - 1); - //删除非ids中的其他数据 - this.anticorrosiveLibraryMaterialService.deleteByWhere("where pid ='"+anticorrosiveLibraryId+"' " - + "and material_id not in ("+ids+")"); - } - - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.anticorrosiveLibraryMaterialService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.anticorrosiveLibraryMaterialService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/AnticorrosiveMaterialController.java b/src/com/sipai/controller/maintenance/AnticorrosiveMaterialController.java deleted file mode 100644 index aa2c0140..00000000 --- a/src/com/sipai/controller/maintenance/AnticorrosiveMaterialController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; -import com.sipai.entity.maintenance.AnticorrosiveLibraryEquipment; -import com.sipai.entity.maintenance.AnticorrosiveMaterial; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.AnticorrosiveMaterialService; -import com.sipai.tools.CommUtil; - -/** - * 防腐库 材料库 - * @author SJ - * - */ -@Controller -@RequestMapping("/maintenance/anticorrosiveMaterial") -public class AnticorrosiveMaterialController { - @Resource - private AnticorrosiveMaterialService anticorrosiveMaterialService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/maintenance/anticorrosiveMaterialList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model,HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - //wherestr+=" and unit_id='"+request.getParameter("unitId")+"'"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - PageHelper.startPage(page, rows); - List list = this.anticorrosiveMaterialService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String res="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - - Result result = Result.success(res); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String id = CommUtil.getUUID(); - request.setAttribute("id", id); - return "maintenance/anticorrosiveMaterialAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - AnticorrosiveMaterial anticorrosiveMaterial = this.anticorrosiveMaterialService.selectById(id); - if(anticorrosiveMaterial!=null){ - model.addAttribute("anticorrosiveMaterial",anticorrosiveMaterial); - } - return "maintenance/anticorrosiveMaterialEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("anticorrosiveMaterial") AnticorrosiveMaterial anticorrosiveMaterial){ - User cu= (User)request.getSession().getAttribute("cu"); - int res = this.anticorrosiveMaterialService.save(anticorrosiveMaterial); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("anticorrosiveMaterial") AnticorrosiveMaterial anticorrosiveMaterial){ - int res = this.anticorrosiveMaterialService.update(anticorrosiveMaterial); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 防腐材料关联业务通用方法(该界面获取设备ids) - * @param request - * @param model - * @return - */ - @RequestMapping("/getAnticorrosiveMaterialIdsForSelect.do") - public String getAnticorrosiveMaterialIdsForSelect(HttpServletRequest request,Model model){ - String materialIds=request.getParameter("materialIds"); - String whereStr= "where id in ('"+materialIds.replace(",", "','")+"')";// and bizId = '"+bizId+"' - List list = this.anticorrosiveMaterialService.selectListByWhere(whereStr); - model.addAttribute("anticorrosiveMaterials",JSONArray.fromObject(list)); - return "maintenance/anticorrosiveMaterialForSelect"; - } - - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.anticorrosiveMaterialService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.anticorrosiveMaterialService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/EquipmentPlanController.java b/src/com/sipai/controller/maintenance/EquipmentPlanController.java deleted file mode 100644 index 3df5b74c..00000000 --- a/src/com/sipai/controller/maintenance/EquipmentPlanController.java +++ /dev/null @@ -1,611 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.timeefficiency.PatrolPlanDept; -import com.sipai.quartz.job.NewMonthWork; -import com.sipai.service.user.JobService; -import com.sipai.service.workorder.WorkorderDetailService; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; - -import net.sf.json.JSONObject; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.EquipmentPlanService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/equipmentPlan") -@Api(value = "/maintenance/equipmentPlan", tags = "设备计划") -public class EquipmentPlanController { - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private UserService userService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private WorkflowService workflowService; - @Resource - private JobService jobService; - - /** - * 月度计划页面 -- 维修 - */ - @RequestMapping("/showListWx.do") - public String showList(HttpServletRequest request, Model model) { - return "maintenance/equipmentPlanListWx"; - } - - /** - * 月度计划页面 -- 维保 - */ - @RequestMapping("/showListBy.do") - public String showList1(HttpServletRequest request, Model model) { - return "maintenance/equipmentPlanListBy"; - } - - /** - * 获取设备计划list数据 - */ - @ApiOperation(value = "获取设备计划list数据", notes = "获取设备计划list数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "page", value = "页数", dataType = "Integer", paramType = "query", required = true), - @ApiImplicitParam(name = "rows", value = "每页显示数", dataType = "Integer", paramType = "query", required = true), - @ApiImplicitParam(name = "sort", value = "排序字段", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "order", value = "排序类型", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "companyId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "status_val", value = "状态筛选 (全部:空、未开始:noStart、开始流程:start、完成:finish、已下发:issued)", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "维修:wx 保养:by 大修:dx", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "search_name", value = "计划内容", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "date", value = "筛选日期 2023-02-17+17%3A00+~+2023-02-20+17%3A00", dataType = "String", paramType = "query", required = false) - - }) - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String search_name = request.getParameter("search_name"); - String planTypeId = request.getParameter("planTypeId"); - String status_val = request.getParameter("status_val"); - String status_equ = request.getParameter("status_equ"); - //日期 - String date = request.getParameter("date"); - String type = request.getParameter("type"); - - String ids = request.getParameter("ids"); - sort = " tep.insdt "; - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1"; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and tep.unit_id in (" + companyids + ") "; - } - } - if (ids != null && !ids.isEmpty()) { - ids = ids.replace(",", "','"); - wherestr += " and tep.id in ('" + ids + "')"; - } - if (search_name != null && !search_name.isEmpty()) { - wherestr += " and tep.plan_contents like '%" + search_name + "%' "; - } - if (planTypeId != null && !planTypeId.isEmpty()) { - wherestr += " and tep.plan_type_small = '" + planTypeId + "' "; - } - if (status_val != null && !status_val.isEmpty()) { - wherestr += " and tep.status = '" + status_val + "' "; - } - if (type != null && !type.isEmpty()) { - wherestr += " and tep.plan_type_big = '" + type + "' "; - } - if (date != null && !date.equals("")) { - String[] str = date.split("~"); - wherestr += " and tep.plan_date between'" + str[0] + "'and'" + str[1] + "'"; - } - if (StringUtils.isNotBlank(status_equ)) { - wherestr += " and (tee.equipmentCardID like '%" + status_equ + "%' or tee.equipmentName like '%" + status_equ + "%') "; - } - PageHelper.startPage(page, rows); -// System.out.println(wherestr); - List list = this.equipmentPlanService.selectListByWhereWithEquEqu(wherestr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 新增 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String detailNumber = company.getEname() + "-JH-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - model.addAttribute("id", CommUtil.getUUID()); - model.addAttribute("detailNumber", detailNumber); - model.addAttribute("company", company); - - String type = request.getParameter("type"); - //获取第一个节点的 岗位 - String jobIds = ""; - if (type != null) { - if (type.equals(EquipmentPlanType.Code_Type_Wx)) { - jobIds = jobService.getJobs4Activiti(companyId, ProcessType.Repair_Plan.getId()); - } - if (type.equals(EquipmentPlanType.Code_Type_By)) { - jobIds = jobService.getJobs4Activiti(companyId, ProcessType.Maintain_Plan.getId()); - } - if (type.equals(EquipmentPlanType.Code_Type_Dx)) { - jobIds = jobService.getJobs4Activiti(companyId, ProcessType.Overhaul_PLAN.getId()); - } - } - model.addAttribute("jobIds", jobIds); - return "maintenance/equipmentPlanAdd"; - } - - /** - * 删除一条数据 - */ - @ApiOperation(value = "删除一条数据", notes = "删除一条数据", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentPlanService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条数据 - */ - @ApiOperation(value = "删除多条数据", notes = "删除多条数据", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ids", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentPlanService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存新增数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("equipmentPlan") EquipmentPlan equipmentPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentPlan.setInsuser(cu.getId()); - equipmentPlan.setInsdt(CommUtil.nowDate()); - equipmentPlan.setPlanDate(equipmentPlan.getPlanDate() + "-01"); - int res = this.equipmentPlanService.save(equipmentPlan); - String resstr = "{\"res\":\"" + res + "\",\"id\":\"" + equipmentPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(id); - model.addAttribute("equipmentPlan", equipmentPlan); - if (equipmentPlan != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - if (company != null) { - model.addAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(equipmentPlan.getAuditId()); - if (user != null) { - model.addAttribute("userName", user.getCaption()); - } - EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig()); - if (equipmentPlanType_big != null) { - model.addAttribute("planTypeBigName", equipmentPlanType_big.getName()); - } - EquipmentPlanType equipmentPlanType_small = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - if (equipmentPlanType_small != null) { - model.addAttribute("planTypeSmallName", equipmentPlanType_small.getName()); - } - } - return "maintenance/equipmentPlanView"; - } - - /** - * 打开编辑界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(id); - model.addAttribute("equipmentPlan", equipmentPlan); - if (equipmentPlan != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - if (company != null) { - model.addAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(equipmentPlan.getAuditId()); - if (user != null) { - model.addAttribute("userName", user.getCaption()); - } - EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig()); - if (equipmentPlanType_big != null) { - model.addAttribute("planTypeBigName", equipmentPlanType_big.getName()); - } - EquipmentPlanType equipmentPlanType_small = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - if (equipmentPlanType_small != null) { - model.addAttribute("planTypeSmallName", equipmentPlanType_small.getName()); - } - - String type = request.getParameter("type"); - //获取第一个节点的 岗位 - String jobIds = ""; - if (type != null) { - if (type.equals(EquipmentPlanType.Code_Type_Wx)) { - jobIds = jobService.getJobs4Activiti(equipmentPlan.getUnitId(), ProcessType.Repair_Plan.getId()); - } - if (type.equals(EquipmentPlanType.Code_Type_By)) { - jobIds = jobService.getJobs4Activiti(equipmentPlan.getUnitId(), ProcessType.Maintain_Plan.getId()); - } - if (type.equals(EquipmentPlanType.Code_Type_Dx)) { - jobIds = jobService.getJobs4Activiti(equipmentPlan.getUnitId(), ProcessType.Overhaul_PLAN.getId()); - } - } - model.addAttribute("jobIds", jobIds); - - - JSONArray json = new JSONArray(); - if(equipmentPlan.getGroupDetailId()!=null){ - String[] did = equipmentPlan.getGroupDetailId().split(","); - for (String sid : did) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", sid); - jsonObject.put("text", ""); - json.add(jsonObject); - } - } - model.addAttribute("dept", json); - } - - - - return "maintenance/equipmentPlanEdit"; - } - - /** - * 更新数据 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("equipmentPlan") EquipmentPlan equipmentPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentPlan.setInsuser(cu.getId()); - equipmentPlan.setInsdt(CommUtil.nowDate()); - equipmentPlan.setPlanDate(equipmentPlan.getPlanDate() + "-01"); - int result = this.equipmentPlanService.update(equipmentPlan); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新,启动保养计划审核流程 - */ - @RequestMapping("/startPlanAudit.do") - public String startPlanAudit(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlan equipmentPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentPlan.setInsuser(cu.getId()); - equipmentPlan.setInsdt(CommUtil.nowDate()); - equipmentPlan.setPlanDate(equipmentPlan.getPlanDate() + "-01"); - equipmentPlan.setStatus(EquipmentPlan.Status_Start); - int result = 0; - try { - result = this.equipmentPlanService.startPlanAudit(equipmentPlan); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示计划审核 - */ - @RequestMapping("/showAuditPlan.do") - public String showAuditMaintainPlan(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String maintenancePlanId = pInstance.getBusinessKey(); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(maintenancePlanId); - model.addAttribute("equipmentPlan", equipmentPlan); - if (equipmentPlan != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - if (company != null) { - model.addAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(equipmentPlan.getAuditId()); - if (user != null) { - model.addAttribute("userName", user.getCaption()); - } - EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig()); - if (equipmentPlanType_big != null) { - model.addAttribute("planTypeBigName", equipmentPlanType_big.getName()); - } - EquipmentPlanType equipmentPlanType_small = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - if (equipmentPlanType_small != null) { - model.addAttribute("planTypeSmallName", equipmentPlanType_small.getName()); - } - } - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "maintenance/equipmentPlanAudit"; - } - - /** - * 流程流转-计划审核 - */ - @RequestMapping("/doAudit.do") - public String doAuditMaintain(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.equipmentPlanService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看计划审核流程详情 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(id); - request.setAttribute("business", equipmentPlan); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentPlan); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(equipmentPlan.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_Repair_HANDLE: - List list_handle = businessUnitHandleService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitHandle businessUnitHandle : list_handle) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Repair_AUDIT://维修审核 - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Maintain_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_Maintain_AUDIT://保养审核 - List list_audit2 = businessUnitAuditService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = equipmentPlan.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(equipmentPlan.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "maintenance/equipmentPlanExecuteView"; - } else { - return "maintenance/equipmentPlanExecuteView_alone"; - } - } - - /** - * 导出 - */ - @RequestMapping(value = "/doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "id") String id) throws IOException { - //导出文件到指定目录,兼容Linux - this.equipmentPlanService.doExport(id, request, response); - return null; - } - - @ApiOperation(value = "手动生成保养月度计划", notes = "手动生成保养月度计划", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - - }) - @RequestMapping("/doHandPlan.do") - public String doHandPlan(HttpServletRequest request, Model model) { - try{ - NewMonthWork newMonthWork = new NewMonthWork(); - newMonthWork.addNewMonthWork(null); - model.addAttribute("result", "suc"); - }catch (Exception e){ - model.addAttribute("result", "fail"); - } - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/EquipmentPlanEquController.java b/src/com/sipai/controller/maintenance/EquipmentPlanEquController.java deleted file mode 100644 index 6eedabd6..00000000 --- a/src/com/sipai/controller/maintenance/EquipmentPlanEquController.java +++ /dev/null @@ -1,285 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.lowagie.text.pdf.PRIndirectReference; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.EquipmentPlanMainYear; -import com.sipai.service.maintenance.EquipmentPlanMainYearService; -import com.sipai.service.maintenance.EquipmentPlanService; -import net.sf.json.JSONArray; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentRepairPlan; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanEqu; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.EquipmentPlanEquService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/equipmentPlanEqu") -public class EquipmentPlanEquController { - @Resource - private EquipmentPlanEquService equipmentPlanEquService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private EquipmentPlanMainYearService equipmentPlanMainYearService; - - /** - * 设备计划下发页面 - */ - @RequestMapping("/showListIssue.do") - public String showListIssue(HttpServletRequest request, Model model) { - model.addAttribute("type", request.getParameter("type")); - return "maintenance/equipmentPlanEquListIssue"; - } - - /** - * 获取list数据 -- 待下发页面的 - */ - @RequestMapping("/getListIssue.do") - public ModelAndView getListIssue(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String search_name = request.getParameter("search_name"); - String status_val = request.getParameter("status_val");//状态筛选 - String search_equ = request.getParameter("search_equ");//设备ID 或 设备名称 筛选 - String date = request.getParameter("date"); - String type = request.getParameter("type"); - String equipmentPlanType = request.getParameter("equipmentPlanType"); - - sort = " tepe.plan_date "; - - if (order == null) { - order = " desc "; - } - String orderstr = " order by tepe.plan_date desc"; - - String wherestr = "where 1=1 "; - - if (search_name != null && !search_name.trim().equals("")) { - wherestr += " and tepe.contents like '%" + search_name + "%' "; - } - - if (status_val != null && !status_val.trim().equals("")) { - wherestr += " and tepe.status = '" + status_val + "' "; - } else { - wherestr += " and tepe.status = '" + EquipmentPlan.Status_Finish + "'"; - } - - if (date != null && !date.equals("")) { - String[] str = date.split("~"); - wherestr += " and tepe.plan_date between'" + str[0] + "'and'" + str[1] + "'"; - } - - - if (StringUtils.isNotBlank(search_equ)) { - wherestr += " and (tee.equipmentCardID like '%" + search_equ + "%' or tee.equipmentName like '%" + search_equ + "%')"; - } - - if (StringUtils.isNotBlank(type)) { - wherestr += " and tep.plan_type_big = '" + type + "'"; - } - - if (StringUtils.isNotBlank(equipmentPlanType)) { - wherestr += " and tep.plan_type_small = '" + equipmentPlanType + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentPlanEquService.selectListByWhereWithEqu(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取list数据 -- 计划中的 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by equipment_id"; - - String wherestr = "where 1=1 and pid = '" + pid + "'"; - - PageHelper.startPage(page, rows); - List list = this.equipmentPlanEquService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/updateEquipmentCards.do") - public String updateEquipmentCards(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String equIds = ""; - //this.equipmentPlanEquService.deleteByWhere("where pid ='"+pid+"'"); - int result = 0; - String[] idArrary = equipmentCardIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - String sql = "where pid = '" + pid + "' and equipment_id = '" + str + "'"; - EquipmentPlanEqu entity = equipmentPlanEquService.selectByWhere(sql); - if (entity != null) { - //修改 - } else { - //新增 - EquipmentPlanEqu equipmentPlanEqu = new EquipmentPlanEqu(); - equipmentPlanEqu.setId(CommUtil.getUUID()); - equipmentPlanEqu.setPid(pid); - equipmentPlanEqu.setEquipmentId(str); - equipmentPlanEqu.setStatus(MaintenanceCommString.PLAN_START); - - - //获取主表中的保养计划 - EquipmentPlan equipmentPlan = equipmentPlanService.selectById(pid); - if (equipmentPlan != null) { - List list_year = equipmentPlanMainYearService.selectListByWhere("where DateDiff(mm,particular_year,'" + equipmentPlan.getPlanDate().substring(0, 4) + "')=0 and unit_id = '" + equipmentPlan.getUnitId() + "' and equipment_id = '" + str + "'"); - if (list_year != null && list_year.size() > 0) { - //如果存在年度计划从年度计划获取内容 - equipmentPlanEqu.setContents(list_year.get(0).getContents()); - } else { - //当年度计划没有 从月度计划获取 计划内容 - equipmentPlanEqu.setContents(equipmentPlan.getPlanContents()); - } - } - - result += this.equipmentPlanEquService.save(equipmentPlanEqu); - } - - equIds += "'" + str + "',"; - } - } - - /*if (equIds != null && !equIds.equals("")) { - equIds = equIds.substring(0, equIds.length() - 1); - this.equipmentPlanEquService.deleteByWhere("where pid ='" + pid + "' and equipment_id not in (" + equIds + ")"); - }*/ - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentPlanEqu equipmentPlanEqu = this.equipmentPlanEquService.selectById(id); - model.addAttribute("equipmentPlanEqu", equipmentPlanEqu); - if (equipmentPlanEqu != null) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentPlanEqu.getEquipmentId()); - if (equipmentCard != null) { - model.addAttribute("equipmentcardid", equipmentCard.getEquipmentcardid()); - model.addAttribute("equipmentname", equipmentCard.getEquipmentname()); - } - } - return "maintenance/equipmentPlanEquEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("equipmentPlanEqu") EquipmentPlanEqu equipmentPlanEqu) { - int result = this.equipmentPlanEquService.update(equipmentPlanEqu); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlanEqu.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - EquipmentPlanEqu equipmentPlanEqu = this.equipmentPlanEquService.selectById(id); - model.addAttribute("equipmentPlanEqu", equipmentPlanEqu); - if (equipmentPlanEqu != null) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentPlanEqu.getEquipmentId()); - if (equipmentCard != null) { - model.addAttribute("equipmentcardid", equipmentCard.getEquipmentcardid()); - model.addAttribute("equipmentname", equipmentCard.getEquipmentname()); - } - } - return "maintenance/equipmentPlanEquView"; - } - - /** - * 删除一条数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentPlanEquService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentPlanEquService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doIssue.do") - public String doIssue(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "userIds") String userIds) { - int result = 0; - String res = ""; - try { - result = this.equipmentPlanEquService.issue(ids, userIds); - res = "{\"res\":\"" + Result.SUCCESS + "\",\"num\":\"" + result + "\"}"; - } catch (Exception e) { - res = "{\"res\":\"" + Result.FAILED + "\",\"num\":\"" + 0 + "\"}"; - System.out.println(e); - } - model.addAttribute("result", res); - return "result"; - } - -} diff --git a/src/com/sipai/controller/maintenance/EquipmentPlanMainYearController.java b/src/com/sipai/controller/maintenance/EquipmentPlanMainYearController.java deleted file mode 100644 index 2f12b82d..00000000 --- a/src/com/sipai/controller/maintenance/EquipmentPlanMainYearController.java +++ /dev/null @@ -1,548 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Unit; -import com.sipai.service.equipment.EquipmentCardService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -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.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFCellStyle; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.EquipmentPlanMainYear; -import com.sipai.entity.maintenance.EquipmentPlanMainYearDetail; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.EquipmentPlanMainYearDetailService; -import com.sipai.service.maintenance.EquipmentPlanMainYearService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/equipmentPlanMainYear") -public class EquipmentPlanMainYearController { - @Resource - private EquipmentPlanMainYearService equipmentPlanMainYearService; - @Resource - private EquipmentPlanMainYearDetailService equipmentPlanMainYearDetailService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private EquipmentCardService equipmentCardService; - - /** - * 年度计划列表 - 维保 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBy.do") - public String showListBy(HttpServletRequest request, Model model) { - request.setAttribute("planType", EquipmentPlanType.Code_Type_By); - request.setAttribute("nowyear", CommUtil.nowDate().substring(0, 4)); - return "/maintenance/equipmentPlanMainYearListBy"; - } - - /** - * 年度计划列表 - 维修 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListWx.do") - public String showListWx(HttpServletRequest request, Model model) { - request.setAttribute("planType", EquipmentPlanType.Code_Type_Wx); - return "/maintenance/equipmentPlanMainYearListWx"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String planType = request.getParameter("planType"); - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentPlanType = request.getParameter("equipmentPlanType"); - String search_equ = request.getParameter("search_equ"); - sort = " tepmy.insdt "; - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - //计划内容 - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and tepmy.contents like '%" + request.getParameter("search_name") + "%'"; - } - if (request.getParameter("search_year") != null && !request.getParameter("search_year").isEmpty()) { - wherestr += " and tepmy.particular_year like '%" + request.getParameter("search_year") + "%'"; - } - if (equipmentPlanType != null && !equipmentPlanType.trim().equals("")) { - wherestr += " and tepmy.type = '" + equipmentPlanType + "'"; - } - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and tepmy.unit_id = '" + request.getParameter("unitId") + "' "; - } - //根据计划类型筛选(因为之前只有保养年度计划,存在字段为null的,所以保养sql条件多个Null) - if (planType != null && !planType.equals("")) { - if (planType.equals(EquipmentPlanType.Code_Type_Wx)) { - wherestr += " and tepmy.plan_type = '" + planType + "' "; - } - if (planType.equals(EquipmentPlanType.Code_Type_By)) { - wherestr += " and (tepmy.plan_type = '" + planType + "' or tepmy.plan_type is null) "; - } - } - //设备 - if (StringUtils.isNotBlank(search_equ)) { - wherestr += " and (tee.equipmentCardID like '%" + search_equ + "%' or tee.equipmentName like '%" + search_equ + "%')"; - } - PageHelper.startPage(page, rows); - List list = this.equipmentPlanMainYearService.selectListByWhereWithEqu(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getDetailList.do") - public ModelAndView getDetailList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " id "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by cast(month as int) asc"; - String wherestr = " where 1=1 "; - - if (request.getParameter("planid") != null && !request.getParameter("planid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("planid") + "'"; - } - PageHelper.startPage(page, rows); - List list = this.equipmentPlanMainYearDetailService.selectListByWhere(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/detailadd.do") - public String dodetailadd(HttpServletRequest request, Model model) { - model.addAttribute("planid", request.getParameter("planid")); - return "/maintenance/equipmentPlanMainYeaDetailrAdd"; - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - model.addAttribute("unitId", request.getParameter("unitId")); - return "/maintenance/equipmentPlanMainYearAdd"; - } - - @RequestMapping("/dodetailsave.do") - public String dodetailsave(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlanMainYearDetail equipmentPlanMainYearDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - int startMonth = Integer.parseInt(equipmentPlanMainYearDetail.getMonth()); - int result = 0; - LinkedHashMap months = new LinkedHashMap<>(); - if (StringUtils.isNotBlank(equipmentPlanMainYearDetail.getMainType())) { - String mainType = equipmentPlanMainYearDetail.getMainType(); - List monthList = new ArrayList(); - List equipmentPlanMainYearDetails = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + equipmentPlanMainYearDetail.getPid() + "'"); - for (int x = 0; x < equipmentPlanMainYearDetails.size(); x++) { - // 存map的键为month 值为这个对象 - months.put(equipmentPlanMainYearDetails.get(x).getMonth(), equipmentPlanMainYearDetails.get(x)); - } - if ("月".equals(mainType)) { - for (int i = 0; i <= 12 - startMonth; i++) { - monthList.add(i + startMonth); - } - } else if ("季".equals(mainType)) { - for (int i = 0; i <= 12 - startMonth; i += 3) { - monthList.add(i + startMonth); - } - } else if ("半年".equals(mainType)) { - for (int i = 0; i <= 12 - startMonth; i += 6) { - monthList.add(i + startMonth); - } - } else if ("年".equals(mainType)) { - monthList.add(startMonth); - } - Integer[] monthss = monthList.toArray(new Integer[monthList.size()]); - for (int x : monthss) { - if (months.get(x + "") != null) { - months.get(x + "").setMainType(mainType); - result = equipmentPlanMainYearDetailService.update(months.get(x + "")); - } else { - equipmentPlanMainYearDetail.setId(CommUtil.getUUID()); - equipmentPlanMainYearDetail.setMonth(x + ""); - result += this.equipmentPlanMainYearDetailService.save(equipmentPlanMainYearDetail); - } - } - } - String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlanMainYearDetail.getId() + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlanMainYear equipmentPlanMainYear) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentPlanMainYear.setId(CommUtil.getUUID()); - equipmentPlanMainYear.setInsdt(CommUtil.nowDate()); - equipmentPlanMainYear.setInsuser(cu.getId()); - String unitId = request.getParameter("unitId"); - if (StringUtils.isNotBlank(unitId)) { - equipmentPlanMainYear.setUnitId(unitId); - } - int result = this.equipmentPlanMainYearService.save(equipmentPlanMainYear); - String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlanMainYear.getId() + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - - @RequestMapping("/detaildelete.do") - public String dodetaildelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentPlanMainYearDetailService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/detaildeletes.do") - public String dodetaildeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentPlanMainYearDetailService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.equipmentPlanMainYearService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.equipmentPlanMainYearService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentPlanMainYear equipmentPlanMainYear = this.equipmentPlanMainYearService.selectById(id); - model.addAttribute("equipmentPlanMainYear", equipmentPlanMainYear); - return "/maintenance/equipmentPlanMainYearEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlanMainYear equipmentPlanMainYear) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentPlanMainYear.setInsdt(CommUtil.nowDate()); - equipmentPlanMainYear.setInsuser(cu.getId()); - int result = this.equipmentPlanMainYearService.update(equipmentPlanMainYear); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlanMainYear.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentPlanMainYear equipmentPlanMainYear = this.equipmentPlanMainYearService.selectById(id); - model.addAttribute("equipmentPlanMainYear", equipmentPlanMainYear); - return "/maintenance/equipmentPlanMainYearView"; - } - - @RequestMapping("/gettype.do") - public String getEquipmentPlanMainYearClass4Select(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", "潜在"); - jsonObject.put("text", "潜在"); - json.add(jsonObject); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("id", "登记"); - jsonObject1.put("text", "登记"); - json.add(jsonObject1); - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String companyId = request.getParameter("companyId"); - String plan_type = request.getParameter("plan_type"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? equipmentPlanMainYearService.readXls(excelFile.getInputStream(), companyId, cu.getId(), plan_type) : this.equipmentPlanMainYearService.readXlsx(excelFile.getInputStream(), companyId, cu.getId(), plan_type); - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - System.out.println(statusMap); - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - System.out.println(result); - return new ModelAndView("result"); - } - - /** - * 导出excel - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "exportExcel.do") - public ModelAndView exportExcel(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String wherestr = " where 1=1 "; - String unitId = request.getParameter("unitId"); - String search_name = request.getParameter("search_name"); - String search_year = request.getParameter("search_year"); - String equipmentClassId = request.getParameter("equipmentClassId"); - String equipmentLevel = request.getParameter("equipmentLevel"); - String plan_type = request.getParameter("plan_type");//区分维修或保养等 - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "'"; - } - if (plan_type != null && !plan_type.equals("")) { - if (plan_type.equals(EquipmentPlanType.Code_Type_By)) { - //有些项目之前还没plan_type这个字段 null默认为保养 - wherestr += " and (plan_type = '" + plan_type + "' or plan_type is null)"; - } else { - wherestr += " and plan_type = '" + plan_type + "'"; - } - } - if (search_year != null && !search_year.trim().equals("")) { - wherestr += " and DATEDIFF(yyyy,particular_year,'" + search_year + "')=0"; - } - List list = this.equipmentPlanMainYearService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.equipmentPlanMainYearService.downloadExcel(response, list, plan_type); - return null; - } - - /** - * 导出excel - * - * @param request - * @param response - * @return - * @throws Exception - */ - /*@RequestMapping("/exportExcel.do") - public void exportExcel(HttpServletRequest request, HttpServletResponse response) throws Exception { - String wherestr = " where 1=1 "; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%'"; - } - if (request.getParameter("search_year") != null && !request.getParameter("search_year").isEmpty()) { - wherestr += " and particular_year like '%" + request.getParameter("search_year") + "%'"; - } - String equipmentPlanType = request.getParameter("equipmentPlanType"); - if (equipmentPlanType != null && !equipmentPlanType.trim().equals("") && !"null".equals(equipmentPlanType)) { - wherestr += " and type = '" + equipmentPlanType + "'"; - } - List list = this.equipmentPlanMainYearService.selectListByWhere(wherestr); - String dirPath = "d:\\模板\\"; - String fileName = "年度计划.xlsx"; - String title = "年度计划表"; - FileInputStream inStream = new FileInputStream(new File(dirPath + fileName)); - //读取excel模板 - XSSFWorkbook workbook = new XSSFWorkbook(inStream); - //获取样式对象 - - XSSFCellStyle cellStyle = workbook.createCellStyle(); - - //设置样式对象,这里仅设置了边框属性 - - cellStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN); //下边框 - - cellStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);//左边框 - - cellStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);//上边框 - - cellStyle.setBorderRight(XSSFCellStyle.BORDER_THIN);//右边框 - - //读取了模板内所有sheet内容 - XSSFSheet sheet = workbook.getSheetAt(0); - XSSFCell cell = null; - XSSFRow row = sheet.createRow(0); - //在相应的单元格进行赋值 - int nub = 0; - for (int i = 5; i <= list.size() + 4; i++) { - - int columnIndex = 0; - row = sheet.createRow(i); - row.createCell(columnIndex).setCellStyle(cellStyle); - row.createCell(columnIndex++).setCellValue(i - 4); - - if (null != list.get(nub).getEquipmentCard()) { - - String equipmentcardid = list.get(nub).getEquipmentCard().getEquipmentcardid(); - row.createCell(columnIndex++).setCellValue(equipmentcardid); - } else { - - row.createCell(columnIndex++).setCellValue(""); - } - - String equipmentname = list.get(nub).getEquipmentCard().getEquipmentname(); - if (null != equipmentname) { - - row.createCell(columnIndex++).setCellValue(equipmentname); - } else { - - row.createCell(columnIndex++).setCellValue(""); - } - - String contents = list.get(nub).getContents(); - if (null != contents) { - - row.createCell(columnIndex++).setCellValue(contents); - } else { - - row.createCell(columnIndex++).setCellValue(""); - } - - - String planMoney = list.get(nub).getPlanMoney().toString(); - if (null != planMoney) { - - row.createCell(columnIndex++).setCellValue(planMoney); - } else { - - row.createCell(columnIndex++).setCellValue(""); - } - - - String type = list.get(nub).getType(); - if (null != type) { - EquipmentPlanType EquipmentPlanType = this.equipmentPlanTypeService.selectById(type); - row.createCell(columnIndex++).setCellValue(EquipmentPlanType.getName()); - } else { - - row.createCell(columnIndex++).setCellValue(""); - } - - List detaillist = this.equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(nub).getId() + "' "); - - for (EquipmentPlanMainYearDetail equipmentPlanMainYearDetail : detaillist) { - int a = Integer.parseInt(equipmentPlanMainYearDetail.getMonth()); - - row.createCell(a + 3).setCellValue(equipmentPlanMainYearDetail.getMainType()); - - } - nub++; - } - - - try { - //response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - - } finally { - workbook.close(); - } - }*/ - - /** - * 导入设备信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importEquipmentCard.do") - public String doimport(HttpServletRequest request, Model model) { - - return "maintenance/equipmentPlanMainYearImport"; - } -} diff --git a/src/com/sipai/controller/maintenance/EquipmentPlanTypeController.java b/src/com/sipai/controller/maintenance/EquipmentPlanTypeController.java deleted file mode 100644 index 3a495773..00000000 --- a/src/com/sipai/controller/maintenance/EquipmentPlanTypeController.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.tools.ant.taskdefs.condition.And; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/equipmentPlanType") -public class EquipmentPlanTypeController { - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - - /** - * 打开异常页面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "maintenance/equipmentPlanTypeList"; - } - /** - * 获取list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and pid = '-1'"; - - PageHelper.startPage(page, rows); - List list = this.equipmentPlanTypeService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 获取list数据 - */ - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request,Model model) { - String orderstr=" order by morder"; - String wherestr="where 1=1 and pid = '-1'"; - List list = this.equipmentPlanTypeService.selectListByWhere(wherestr+orderstr); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.equipmentPlanTypeService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("id", CommUtil.getUUID()); - return "maintenance/equipmentPlanTypeAdd"; - } - - @RequestMapping("/doaddDetail.do") - public String doaddDetail(HttpServletRequest request,Model model){ - model.addAttribute("id", CommUtil.getUUID()); - return "maintenance/equipmentPlanTypeAddDetail"; - } - - /** - * 删除一条数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentPlanTypeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentPlanTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存新增数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentPlanType") EquipmentPlanType equipmentPlanType){ - User cu= (User)request.getSession().getAttribute("cu"); - int res = this.equipmentPlanTypeService.save(equipmentPlanType); - String resstr="{\"res\":\""+res+"\",\"id\":\""+equipmentPlanType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentPlanType equipmentPlanType = this.equipmentPlanTypeService.selectById(id); - model.addAttribute("equipmentPlanType", equipmentPlanType); - return "maintenance/equipmentPlanTypeView"; - } - /** - * 打开编辑界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentPlanType equipmentPlanType = this.equipmentPlanTypeService.selectById(id); - model.addAttribute("equipmentPlanType", equipmentPlanType); - return "maintenance/equipmentPlanTypeEdit"; - } - - /** - * 打开编辑界面 - */ - @RequestMapping("/doeditDetail.do") - public String doeditDetail(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentPlanType equipmentPlanType = this.equipmentPlanTypeService.selectById(id); - model.addAttribute("equipmentPlanType", equipmentPlanType); - return "maintenance/equipmentPlanTypeEditDetail"; - } - - /** - * 更新数据 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentPlanType") EquipmentPlanType equipmentPlanType){ - User cu= (User)request.getSession().getAttribute("cu"); - int result = this.equipmentPlanTypeService.update(equipmentPlanType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentPlanType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 根据pid获取类型下拉数据 - * @param request - * @param model - * @return - */ - @RequestMapping("/getSelectList.do") - public String getSelectList(HttpServletRequest request,Model model){ - String pid = request.getParameter("pid"); - String wherestr = "where 1=1 "; - - if(pid!=null && !pid.equals("")){ - wherestr += " and pid = '"+pid+"'"; - }else { - wherestr += " and pid = '-1'"; - } - - List list = this.equipmentPlanTypeService.selectListByWhere(wherestr+"order by morder asc"); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.equipmentPlanTypeService.selectListByWhere(wherestr+"order by morder asc"); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.faultLibraryService.selectListByWhere("where 1=1"); - model.addAttribute("menulist",list); - return "maintenance/faultlibraryManage"; - } - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "maintenance/faultlibrary4select"; - } - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - FaultLibrary faultLibrary= faultLibraryService.selectById(pid); - model.addAttribute("pname",faultLibrary.getName()); - } - return "maintenance/faultlibraryAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - FaultLibrary faultLibrary = this.faultLibraryService.selectById(id); - model.addAttribute("faultLibrary",faultLibrary ); - return "maintenance/faultlibraryEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("faultLibrary") FaultLibrary faultLibrary){ - User cu= (User)request.getSession().getAttribute("cu"); - faultLibrary.setId(CommUtil.getUUID()); - faultLibrary.setInsdt(CommUtil.nowDate()); - faultLibrary.setInsuser(cu.getId()); - int result = this.faultLibraryService.save(faultLibrary); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("faultLibrary") FaultLibrary faultLibrary){ - int result = this.faultLibraryService.update(faultLibrary); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.faultLibraryService.deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/getFaultLibrariesJson.do") - public String getFaultLibrariesJson(HttpServletRequest request,Model model){ - List list = this.faultLibraryService.selectListByWhere("where 1=1 order by morder"); - String json = faultLibraryService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showActiveList4Select.do") - public String showActiveList4Select(HttpServletRequest request,Model model){ - return "maintenance/faultlibraryActive4select"; - } - @RequestMapping("/getFaultLibrariesJsonActive.do") - public String getMenusJsonActive(HttpServletRequest request,Model model){ - List list = this.faultLibraryService.selectListByWhere("where active='"+CommString.Active_True+"' order by morder"); - /*for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - }*/ - String json = faultLibraryService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - /** - * 获取故障库类型,使用pid为-1的故障库内容表示 - * */ - @RequestMapping("/getFaultTypesActive.do") - public String getFaultTypesActive(HttpServletRequest request,Model model){ - List list = this.faultLibraryService.selectListByWhere("where active='"+CommString.Active_True+"' and pid='-1' order by morder"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (FaultLibrary faultLibrary : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", faultLibrary.getId()); - jsonObject.put("text", faultLibrary.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - /** - * 选择故障类型,可多选 - * */ - @RequestMapping("/showFaultTypeForSelects.do") - public String showFaultTypeForSelects(HttpServletRequest request,Model model) { - String problemTypeIds = request.getParameter("problemTypeIds"); - if(problemTypeIds!=null && !problemTypeIds.isEmpty()){ - String[] id_Array= problemTypeIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - model.addAttribute("json",jsonArray); - } - return "/maintenance/faultTypeForSelects"; - } - /** - * 获取权限树 - * @return - */ - @RequestMapping("/getFaultTypeTree.do") - public String getMenusJsonWithFunc(HttpServletRequest request,Model model){ - List list = this.faultLibraryService.selectListByWhere("where active='"+CommString.Active_True+"' order by morder"); - String result = this.faultLibraryService.getTreeList(null, list); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/LibraryAddResetProjectController.java b/src/com/sipai/controller/maintenance/LibraryAddResetProjectController.java deleted file mode 100644 index cb759eb8..00000000 --- a/src/com/sipai/controller/maintenance/LibraryAddResetProjectController.java +++ /dev/null @@ -1,481 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryAddResetProject; -import com.sipai.entity.maintenance.LibraryAddResetProjectBiz; -import com.sipai.entity.maintenance.LibraryAddResetProjectBloc; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryAddResetProjectBizService; -import com.sipai.service.maintenance.LibraryAddResetProjectBlocService; -import com.sipai.service.maintenance.LibraryAddResetProjectService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/libraryAddResetProject") -public class LibraryAddResetProjectController { - @Resource - private LibraryAddResetProjectService libraryAddResetProjectService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private LibraryAddResetProjectBlocService libraryAddResetProjectBlocService; - @Resource - private LibraryAddResetProjectBizService libraryAddResetProjectBizService; - - /** - * 设备大修库配置界面 树形 sj 2020-07-29 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeBloc.do") - public String showList4TreeBloc(HttpServletRequest request, Model model) { - return "/maintenance/libraryAddResetProjectBloc4Tree"; - } - - /** - * 设备大修库配置界面 树形 sj 2020-07-29 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeBiz.do") - public String showList4TreeBiz(HttpServletRequest request, Model model) { - return "/maintenance/libraryAddResetProjectBiz4Tree"; - } - - /** - * 列表 sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBloc.do") - public String showListBloc(HttpServletRequest request, Model model) { - return "maintenance/libraryAddResetProjectListBloc"; - } - - /** - * 列表 sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBiz.do") - public String showListBiz(HttpServletRequest request, Model model) { - return "maintenance/libraryAddResetProjectListBiz"; - } - - /** - * 获取设备故障库数据 sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBloc.do") - public ModelAndView getListJsonBloc(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String classId = request.getParameter("classId");//设备类别或部位等Id - String modelId = request.getParameter("modelId");//型号id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and pid = '" + classId + "' "; - - //如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryAddResetProjectService.selectList4Model(whereStr + " order by code asc", modelId, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备故障库数据 sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBiz.do") - public ModelAndView getListJsonBiz(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String classId = request.getParameter("classId");//设备类别或部位等Id - String modelId = request.getParameter("modelId");//型号id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and pid = '" + classId + "' "; - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr = " and id = '无' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryAddResetProjectService.selectList4Equ(whereStr + " order by code asc", modelId, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname", equipmentClass.getName()); - model.addAttribute("pid", pid); - } - return "maintenance/libraryAddResetProjectAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryAddResetProject") LibraryAddResetProject libraryAddResetProject) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryAddResetProject.setId(CommUtil.getUUID()); - libraryAddResetProject.setInsdt(CommUtil.nowDate()); - libraryAddResetProject.setInsuser(cu.getId()); - int res = this.libraryAddResetProjectService.save(libraryAddResetProject); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dosave4Bloc.do") - public ModelAndView dosave4Bloc(HttpServletRequest request, Model model, - @ModelAttribute("libraryAddResetProject") LibraryAddResetProject libraryAddResetProject) { - User cu = (User) request.getSession().getAttribute("cu"); - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId"); - - libraryAddResetProject.setId(CommUtil.getUUID()); - libraryAddResetProject.setInsdt(CommUtil.nowDate()); - libraryAddResetProject.setInsuser(cu.getId()); - int res = this.libraryAddResetProjectService.save4Model(libraryAddResetProject, modelId, unitId); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryAddResetProject libraryAddResetProject = this.libraryAddResetProjectService.selectById(id); - if (libraryAddResetProject != null) { - model.addAttribute("libraryAddResetProject", libraryAddResetProject); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryAddResetProject.getPid()); - if (equipmentClass != null) { - model.addAttribute("pname", equipmentClass.getName()); - } - List list = libraryAddResetProjectBlocService.selectListByWhere("where project_id='" + libraryAddResetProject.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (list != null && list.size() > 0) { - libraryAddResetProject.setLibraryAddResetProjectBloc(list.get(0)); - } - } - return "maintenance/libraryAddResetProjectEdit"; - } - - @RequestMapping("/doeditBiz.do") - public String doeditBiz(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryAddResetProject libraryAddResetProject = this.libraryAddResetProjectService.selectById(id); - if (libraryAddResetProject != null) { - model.addAttribute("libraryAddResetProject", libraryAddResetProject); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryAddResetProject.getPid()); - if (equipmentClass != null) { - model.addAttribute("pname", equipmentClass.getName()); - } - List list = libraryAddResetProjectBizService.selectListByWhere("where project_id='" + libraryAddResetProject.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (list != null && list.size() > 0) { - libraryAddResetProject.setLibraryAddResetProjectBiz(list.get(0)); - } - } - return "maintenance/libraryAddResetProjectEditBiz"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryAddResetProject") LibraryAddResetProject libraryAddResetProject) { - int res = this.libraryAddResetProjectService.update(libraryAddResetProject); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate4Bloc.do") - public ModelAndView doupdate4Bloc(HttpServletRequest request, Model model, - @ModelAttribute("libraryAddResetProject") LibraryAddResetProject libraryAddResetProject) { - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId"); - int res = this.libraryAddResetProjectService.update4Model(libraryAddResetProject, modelId, unitId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate4Biz.do") - public ModelAndView doupdate4Biz(HttpServletRequest request, Model model, - @ModelAttribute("libraryAddResetProject") LibraryAddResetProject libraryAddResetProject) { - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId"); - int res = this.libraryAddResetProjectService.update4Equ(libraryAddResetProject, modelId, unitId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.libraryAddResetProjectService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * EXCEL导入 -- 集团 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doImport.do") - public String doImport(HttpServletRequest request, Model model) { - return "maintenance/libraryAddResetImport"; - } - - /** - * EXCEL导入 -- 单厂 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doImport4Biz.do") - public String doImport4Biz(HttpServletRequest request, Model model) { - return "maintenance/libraryAddResetImport4Biz"; - } - - /** - * EXCEL导出 -- 集团 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - String wherestr = " where pid = '-1' order by morder asc "; - - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.libraryAddResetProjectService.doExport(response, equipmentClasses, unitId); - return null; - } - - /** - * EXCEL导出 -- 单厂 - */ - @RequestMapping(value = "doExport4Biz.do") - public ModelAndView doExport4Biz(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //获取单厂设备台帐中存在的设备大类 - String bigClassId = equipmentClassService.getTreeIdS4HaveBigId(unitId); - //获取单厂设备台帐中存在的设备小类 - String smallClassId = equipmentClassService.getTreeIdS4HaveSmallId(unitId); - - String wherestr = " where pid = '-1' and id in (" + bigClassId + ") order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.libraryAddResetProjectService.doExport4Biz(response, equipmentClasses, unitId, smallClassId); - return null; - } - - /** - * 保存导入设备 -- 集团 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - String wherestr = "where 1=1 and type!='" + CommString.EquipmentClass_Parts + "' order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? libraryAddResetProjectService.readXls(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryAddResetProjectService.readXlsx(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存导入设备 -- 集团 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData4Biz.do") - public ModelAndView dosaveExcelData4Biz(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - String wherestr = "where 1=1 and type!='" + CommString.EquipmentClass_Parts + "' order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? libraryAddResetProjectService.readXls4Biz(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryAddResetProjectService.readXlsx4Biz(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/maintenance/LibraryBaseController.java b/src/com/sipai/controller/maintenance/LibraryBaseController.java deleted file mode 100644 index 1bac5f2a..00000000 --- a/src/com/sipai/controller/maintenance/LibraryBaseController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.controller.maintenance; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryBase; -import com.sipai.service.maintenance.LibraryBaseService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@CrossOrigin(origins = "*",maxAge = 3600) -@RequestMapping("/bease") -public class LibraryBaseController { - - @Resource - private LibraryBaseService libraryBaseService; - - @RequestMapping("/getBeaseList.do") - public ModelAndView getBeaseList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - - PageHelper.startPage(page, rows); - try { - List libraryBases = libraryBaseService.selectListByWhere("where 1 = 1 order by updt desc"); - PageInfo pi = new PageInfo(libraryBases); - JSONArray libraryBaseJson = JSONArray.fromObject(libraryBases); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + libraryBaseJson + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - }catch (Exception e) { - e.printStackTrace(); - } - String x = "失败了"; - return new ModelAndView("x"); - } - - @RequestMapping("/deleteBease.do") - public ModelAndView deleteBease(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - try { - int res = this.libraryBaseService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - }catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - @RequestMapping("/updateBease.do") - public ModelAndView updateBease(HttpServletRequest request, Model model, - @ModelAttribute("llibraryBase") LibraryBase libraryBase) { - try { - int res = this.libraryBaseService.update(libraryBase); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - @RequestMapping("/addBease.do") - public ModelAndView addBease(HttpServletRequest request, Model model, - @ModelAttribute("llibraryBase") LibraryBase libraryBase) { - try { - int res = this.libraryBaseService.save(libraryBase); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - }catch (Exception e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/src/com/sipai/controller/maintenance/LibraryFaultBlocController.java b/src/com/sipai/controller/maintenance/LibraryFaultBlocController.java deleted file mode 100644 index 9d0be2b7..00000000 --- a/src/com/sipai/controller/maintenance/LibraryFaultBlocController.java +++ /dev/null @@ -1,743 +0,0 @@ -package com.sipai.controller.maintenance; - - -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.service.workorder.WorkorderDetailService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.LibraryRepairBlocService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 故障库(标准库) - * - * @author SJ - */ -@Controller -@RequestMapping("/maintenance/libraryFaultBloc") -public class LibraryFaultBlocController { - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private CompanyService companyService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private WorkorderDetailService workorderDetailService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - List list = this.libraryFaultBlocService.selectListByWhere("where 1=1"); - model.addAttribute("menulist", list); - return "maintenance/faultlibraryManage"; - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request, Model model) { - return "maintenance/faultlibrary4select"; - } - // @RequestMapping("/doadd.do") - // public String doadd(HttpServletRequest request,Model model, - // @RequestParam(value="pid") String pid){ - // if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - // LibraryFaultBloc libraryFaultBloc= libraryFaultBlocService.selectById(pid); - // model.addAttribute("pname",libraryFaultBloc.getName()); - // } - // return "maintenance/faultlibraryAdd"; - // } - - - @RequestMapping("/getFaultLibrariesJson.do") - public String getFaultLibrariesJson(HttpServletRequest request, Model model) { - List list = this.libraryFaultBlocService.selectListByWhere("where 1=1 order by morder"); - String json = libraryFaultBlocService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showActiveList4Select.do") - public String showActiveList4Select(HttpServletRequest request, Model model) { - return "maintenance/faultlibraryActive4select"; - } - - @RequestMapping("/getFaultLibrariesJsonActive.do") - public String getMenusJsonActive(HttpServletRequest request, Model model) { - List list = this.libraryFaultBlocService.selectListByWhere("where active='" + CommString.Active_True + "' order by morder"); - /*for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - }*/ - String json = libraryFaultBlocService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取故障库类型,使用pid为-1的故障库内容表示 - */ - @RequestMapping("/getFaultTypesActive.do") - public String getFaultTypesActive(HttpServletRequest request, Model model) { - List list = this.libraryFaultBlocService.selectListByWhere("where active='" + CommString.Active_True + "' and pid='-1' order by morder"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (LibraryFaultBloc libraryFaultBloc : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", libraryFaultBloc.getId()); - jsonObject.put("text", libraryFaultBloc.getFaultName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - /** - * 选择故障类型,可多选 - */ - @RequestMapping("/showFaultTypeForSelects.do") - public String showFaultTypeForSelects(HttpServletRequest request, Model model) { - String problemTypeIds = request.getParameter("problemTypeIds"); - if (problemTypeIds != null && !problemTypeIds.isEmpty()) { - String[] id_Array = problemTypeIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - model.addAttribute("json", jsonArray); - } - return "/maintenance/faultTypeForSelects"; - } - - /** - * 获取权限树 - * - * @return - */ - @RequestMapping("/getFaultTypeTree.do") - public String getMenusJsonWithFunc(HttpServletRequest request, Model model) { - List list = this.libraryFaultBlocService.selectListByWhere("where active='" + CommString.Active_True + "' order by morder"); - String result = this.libraryFaultBlocService.getTreeList(null, list); - model.addAttribute("result", result); - return "result"; - } - - /** - * 设备故障库配置界面 树形 (集团层) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeBloc.do") - public String showList4TreeBloc(HttpServletRequest request, Model model) { - return "/maintenance/libraryFaultBloc4Tree"; - } - - /** - * 设备故障库配置界面 树形 (水厂级) sj 2020-09-07 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeBiz.do") - public String showList4TreeBiz(HttpServletRequest request, Model model) { - return "/maintenance/libraryFaultBiz4Tree"; - } - - /** - * 设备故障库浏览界面 树形 sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeView.do") - public String showList4TreeView(HttpServletRequest request, Model model) { - return "/maintenance/libraryFaultBloc4TreeView"; - } - - /** - * 故障库列表 (集团级) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBloc.do") - public String showFaultList(HttpServletRequest request, Model model) { - return "maintenance/libraryFaultBlocList"; - } - - /** - * 故障库列表 (水厂级) sj 2020-09-08 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBiz.do") - public String showListBiz(HttpServletRequest request, Model model) { - return "maintenance/libraryFaultBizList"; - } - - /** - * 获取设备故障库数据 (集团级) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBloc.do") - public ModelAndView getFaultListJson(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String classId = request.getParameter("classId"); - String modelId = request.getParameter("modelId");//型号id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and pid = '" + classId + "' "; - - /*//如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr += " and unit_id = '" + unitId + "' "; - }*/ - - whereStr += " and unit_id = '-1' "; - - PageHelper.startPage(page, rows); - List list = this.libraryFaultBlocService.selectListByWhere(whereStr + " order by morder"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备故障库数据 (水厂级) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBiz.do") - public ModelAndView getListJsonBiz(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String classId = request.getParameter("classId"); - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and pid = '" + classId + "' "; - - /*Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr = " and id = '无' "; - }*/ - - whereStr += " and unit_id = '" + unitId + "'"; - - PageHelper.startPage(page, rows); - List list = this.libraryFaultBlocService.selectListByWhere(whereStr + " order by morder"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname", equipmentClass.getName()); - model.addAttribute("pid", pid); - } - return "maintenance/libraryFaultBlocAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryFaultBloc") LibraryFaultBloc libraryFaultBloc) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryFaultBloc.setId(CommUtil.getUUID()); - libraryFaultBloc.setInsdt(CommUtil.nowDate()); - libraryFaultBloc.setInsuser(cu.getId()); - libraryFaultBloc.setActive("1"); - int res = this.libraryFaultBlocService.save(libraryFaultBloc); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryFaultBloc libraryFaultBloc = this.libraryFaultBlocService.selectById(id); - if (libraryFaultBloc != null) { - model.addAttribute("libraryFaultBloc", libraryFaultBloc); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryFaultBloc.getPid()); - if (equipmentClass != null) { - model.addAttribute("pname", equipmentClass.getName()); - } - } - return "maintenance/libraryFaultBlocEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryFaultBloc") LibraryFaultBloc libraryFaultBloc) { - int res = this.libraryFaultBlocService.update(libraryFaultBloc); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.libraryFaultBlocService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.libraryFaultBlocService.deleteByWhere("where id in ('" + ids + "')", ids); - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 根据搜索的条件查询对应的设备部位id - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getClassIds4Search.do") - public String getClassIds4Search(HttpServletRequest request, Model model) { - String quotaTypes = request.getParameter("quotaTypes");//定额类型 低中高 - String repairPartyTypes = request.getParameter("repairPartyTypes");//维修方式 自修或委外 - String repairTypes = request.getParameter("repairTypes");//维修类型 小修、中修等 - String search_name = request.getParameter("search_name");//搜索内容 - - String faultWhereStr = " where 1=1 "; - String repairWhereStr = " where 1=1 "; - - if (search_name != null && !search_name.trim().equals("")) { - repairWhereStr += " and (repair_number like '%" + search_name + "%' or name like '%" + search_name + "%')"; - } - - // if(quotaTypes!=null){ - // whereStr += " and quota_type = '"+quotaTypes+"' "; - // } - // if(quotaTypes!=null){ - // - // } - // if(quotaTypes!=null){ - // - // } - - String faultIds = ""; - List rlist = this.libraryRepairBlocService.selectListByWhere(repairWhereStr + " order by morder"); - if (rlist != null) { - for (int i = 0; i < rlist.size(); i++) { - faultIds += "'" + rlist.get(i).getPid() + "',"; - } - if (faultIds != null && !faultIds.equals("")) { - faultIds = faultIds.substring(0, faultIds.length() - 1); - } - } - - if (search_name != null && !search_name.trim().equals("")) { - if (faultIds != null && !faultIds.equals("")) {//有符合的维修库 - faultWhereStr += " and ((fault_number like '%" + search_name + "%' or name like '%" + search_name + "%') or id in (" + faultIds + "))"; - } else {//没有符合的维修库 - faultWhereStr += " and (fault_number like '%" + search_name + "%' or name like '%" + search_name + "%')"; - } - } - - //System.out.println(faultWhereStr); - HashSet hashSet = new HashSet(); - List list = this.libraryFaultBlocService.selectListByWhere(faultWhereStr + " order by morder"); - - if (search_name != null && !search_name.equals("")) { - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - hashSet.add(list.get(i).getPid()); - } - } - } - - Result result = Result.success(hashSet); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 导入设备信息---集团层 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importLibraryFaultBloc.do") - public String doimport4Bloc(HttpServletRequest request, Model model) { - return "maintenance/libraryFaultBlocImport"; - } - - /** - * 导入设备信息---水厂 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importLibraryFaultBiz.do") - public String doimport4Biz(HttpServletRequest request, Model model) { - return "maintenance/libraryFaultBizImport"; - } - - /** - * 导入设备excel表 - * - * @throws IOException - */ - @RequestMapping(value = "doImport.do") - public ModelAndView doImport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - // ListequipmentCards = this.equipmentCardService.selectListByWhere(wherestr); - // //导出文件到指定目录,兼容Linux - //this.libraryFaultBlocService.downloadEquipmentExcel(response, equipmentCards); - return null; - } - - /** - * 保存导入设备 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - String wherestr = "where 1=1 order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? libraryFaultBlocService.readXls(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryFaultBlocService.readXlsx(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存导入设备 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData4Biz.do") - public ModelAndView dosaveExcelData4Biz(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - String wherestr = "where 1=1 order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { -// String res = ("xls".equals(type)) ? libraryFaultBlocService.readXls4Biz(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryFaultBlocService.readXlsx4Biz(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - String res = ("xls".equals(type)) ? libraryFaultBlocService.readXls(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryFaultBlocService.readXlsx(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导出 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - String wherestr = " where pid = '-1' order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.libraryFaultBlocService.doExportLibraryFaultBloc(response, equipmentClasses, unitId); - return null; - } - - /*@RequestMapping("/doExportRep.do") - public ModelAndView doExportRep(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "type") String type) throws IOException { - String whereStr = "where id in (" + ids.substring(0, ids.length() - 1) + ")"; - try { - List workorderDetails = workorderDetailService.selectListByWhere(whereStr); - this.libraryFaultBlocService.doExportLibraryRepair(response,workorderDetails, type); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - }*/ - - @RequestMapping("/showFaultLibrary4Equpment.do") - public String showFaultLibrary4Equpment(HttpServletRequest request, Model model) { - return "maintenance/selectLibraryFault4Equpment"; - } - - @RequestMapping("/getList4Equpment.do") - public ModelAndView getList4Equpment(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String equipmentId = request.getParameter("equipmentId"); - String unitId = request.getParameter("unitId"); - String classId = "";//设备小类 - String classIds = "";//向下递归的所有类id - String whereStr = "where 1=1"; - - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentId); - if (equipmentCard != null) { - classId = equipmentCard.getEquipmentclassid(); - } - - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, classId); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - classIds += "'" + iter.next() + "',"; - } - if (classIds != null && !classIds.equals("")) { - classIds = classIds.substring(0, classIds.length() - 1); - whereStr += " and pid in (" + classIds + ") "; - } - - /* Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr = " and id = '无' "; - }*/ - - whereStr += " and unit_id = '-1'"; - - PageHelper.startPage(page, rows); - List list = this.libraryFaultBlocService.selectListByWhere(whereStr + " order by morder"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 导出 - */ - @RequestMapping(value = "doExport4Biz.do") - public ModelAndView doExport4Biz(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //获取单厂设备台帐中存在的设备大类 - String bigClassId = equipmentClassService.getTreeIdS4HaveBigId(unitId); - //获取单厂设备台帐中存在的设备小类 - String smallClassId = equipmentClassService.getTreeIdS4HaveSmallId(unitId); - - String wherestr = " where pid = '-1' and id in (" + bigClassId + ") order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux -// unitId = "-1"; - this.libraryFaultBlocService.doExportLibraryFaultBiz(response, equipmentClasses, unitId, smallClassId); - return null; - } - - /** - * 故障库浏览 sj 2021-08-23 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryFaultBloc libraryFaultBloc = this.libraryFaultBlocService.selectById(id); - if (libraryFaultBloc != null) { - model.addAttribute("libraryFaultBloc", libraryFaultBloc); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryFaultBloc.getPid()); - if (equipmentClass != null) { - model.addAttribute("pname", equipmentClass.getName()); - } - } - return "maintenance/libraryFaultBlocView"; - } - - @RequestMapping("/doInit.do") - public String doInit(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - if (StringUtils.isNotBlank(unitId)) { - if (unitId.equals("-1")) { - String json = "{\"msg\":\"请传入正确参数!\",\"code\":\"0\"}"; - model.addAttribute("result", json); - } else { - libraryFaultBlocService.doInit(unitId); - String json = "{\"msg\":\"初始化完毕!\",\"code\":\"1\"}"; - model.addAttribute("result", json); - } - } else { - String json = "{\"msg\":\"请传入正确参数!\",\"code\":\"0\"}"; - model.addAttribute("result", json); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/maintenance/LibraryMaintainCarController.java b/src/com/sipai/controller/maintenance/LibraryMaintainCarController.java deleted file mode 100644 index e1a65553..00000000 --- a/src/com/sipai/controller/maintenance/LibraryMaintainCarController.java +++ /dev/null @@ -1,322 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryMaintainCar; -import com.sipai.entity.maintenance.LibraryMaintainCarDetail; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.LibraryMaintainCarDetailService; -import com.sipai.service.maintenance.LibraryMaintainCarService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/libraryMaintainCar") -public class LibraryMaintainCarController { - @Resource - private LibraryMaintainCarService libraryMaintainCarService; - @Resource - private LibraryMaintainCarDetailService libraryMaintainCarDetailService; - @Resource - private UnitService UnitService; - @Resource - private UserService userService; - - @RequestMapping("/showLibraryMaintainCarList.do") - public String showLibraryMaintainCarList(HttpServletRequest request,Model model){ - return "/maintenance/libraryMaintainCarList"; - } - - @RequestMapping("/getlist.do") - public String getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "unitId") String unitId) { -// String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; -// if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { -// wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; -// } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - wherestr+=" and unit_id = '"+unitId+"'"; - PageHelper.startPage(page, rows); - List list = this.libraryMaintainCarService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("unitId",request.getAttribute("unitId")); - return "/maintenance/libraryMaintainCarAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute LibraryMaintainCar libraryMaintainCar){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - libraryMaintainCar.setId(CommUtil.getUUID()); - libraryMaintainCar.setInsuser(userId); - libraryMaintainCar.setInsdt(CommUtil.nowDate()); - int code = this.libraryMaintainCarService.save(libraryMaintainCar); - for (int i = 1; i <= 20; i++) { - LibraryMaintainCarDetail libraryMaintainCarDetail = new LibraryMaintainCarDetail(); - libraryMaintainCarDetail.setId(CommUtil.getUUID()); - libraryMaintainCarDetail.setMaintainCarId(libraryMaintainCar.getId()); - libraryMaintainCarDetail.setNum10thousandKm(i/2.0); - libraryMaintainCarDetail.setInsdt(libraryMaintainCar.getInsdt()); - libraryMaintainCarDetail.setInsuser(libraryMaintainCar.getInsuser()); - this.libraryMaintainCarDetailService.save(libraryMaintainCarDetail); - } - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - LibraryMaintainCar libraryMaintainCar = this.libraryMaintainCarService.selectById(id); - - model.addAttribute("libraryMaintainCar", libraryMaintainCar); - return "/maintenance/libraryMaintainCarEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - LibraryMaintainCar libraryMaintainCar = this.libraryMaintainCarService.selectById(id); - List list = this.libraryMaintainCarDetailService.selectListByWhere(" where maintain_car_id='"+id+"' order by num_10thousand_km"); -// for (int i = 1; i <= 20; i++) { -// model.addAttribute("detail"+i, list.get(i-1)); -// } - model.addAttribute("list", list); - model.addAttribute("libraryMaintainCar", libraryMaintainCar); - return "/maintenance/libraryMaintainCarDetailEdit"; - } - - @RequestMapping("/dosavedetail.do") - public String dosavedetail(HttpServletRequest request,Model model, - @ModelAttribute LibraryMaintainCarDetail libraryMaintainCarDetail){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - libraryMaintainCarDetail.setUpsuser(userId); - libraryMaintainCarDetail.setUpsdt(CommUtil.nowDate()); - int code = this.libraryMaintainCarDetailService.update(libraryMaintainCarDetail); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosaveall.do") - public String dosaveall(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - String ids = request.getParameter("ids"); - String moneys = request.getParameter("moneys"); - String workingHourss = request.getParameter("workingHourss"); - String[] idsArr = ids.split(","); - String[] moneysArr = moneys.split(","); - String[] workingHourssArr = workingHourss.split(","); - String userId = cu.getId(); - String nowDate = CommUtil.nowDate(); - for (int i = 0; i < 20; i++) { - LibraryMaintainCarDetail libraryMaintainCarDetail = new LibraryMaintainCarDetail(); - libraryMaintainCarDetail.setId(idsArr[i]); - libraryMaintainCarDetail.setUpsuser(userId); - libraryMaintainCarDetail.setUpsdt(nowDate); - libraryMaintainCarDetail.setMoney(moneysArr[i].equals("null")?new BigDecimal(0):new BigDecimal(moneysArr[i])); - libraryMaintainCarDetail.setWorkingHours(workingHourssArr[i].equals("null")?0.0:Double.parseDouble(workingHourssArr[i])); - int code = this.libraryMaintainCarDetailService.update(libraryMaintainCarDetail);Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dorefreshdetail.do") - public String dorefreshdetail(HttpServletRequest request,Model model, - @ModelAttribute LibraryMaintainCarDetail libraryMaintainCarDetail){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - libraryMaintainCarDetail.setMoney(new BigDecimal(0)); - libraryMaintainCarDetail.setWorkingHours(0.0); - libraryMaintainCarDetail.setUpsuser(userId); - libraryMaintainCarDetail.setUpsdt(CommUtil.nowDate()); - int code = this.libraryMaintainCarDetailService.update(libraryMaintainCarDetail); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute LibraryMaintainCar libraryMaintainCar){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - libraryMaintainCar.setUpsuser(userId); - libraryMaintainCar.setUpsdt(CommUtil.nowDate()); - int code = this.libraryMaintainCarService.update(libraryMaintainCar); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.libraryMaintainCarService.deleteById(id); - this.libraryMaintainCarDetailService.deleteByWhere("where maintain_car_id = '" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - int count = ids.split(",").length; - ids=ids.replace(",","','"); - int code = this.libraryMaintainCarService.deleteByWhere("where id in ('"+ids+"')"); - this.libraryMaintainCarDetailService.deleteByWhere("where maintain_car_id in ('"+ids+"')"); - Result result = new Result(); - if (code == count) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/showLibraryMaintainCar4Select.do") - public String showLibraryMaintainCar4Select(HttpServletRequest request,Model model) { - String maintainCarId = request.getParameter("maintainCarId"); - if(maintainCarId!=null && !maintainCarId.isEmpty()){ - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", maintainCarId); - jsonArray.add(jsonObject); - request.setAttribute("maintainCars", jsonArray); - } - return "/maintenance/libraryMaintainCar4Select"; - } - @RequestMapping("/showLibraryMaintainCarDetail4Select.do") - public String showLibraryMaintainCarDetail4Select(HttpServletRequest request,Model model) { - String maintainCarDetailId = request.getParameter("maintainCarDetailId"); - if(maintainCarDetailId!=null && !maintainCarDetailId.isEmpty()){ - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", maintainCarDetailId); - jsonArray.add(jsonObject); - request.setAttribute("maintainCarDetails", jsonArray); - } - return "/maintenance/libraryMaintainCarDetail4Select"; - } - - @RequestMapping("/getDetaillist.do") - public String getDetaillist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "id") String id) { -// String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - - if (sort==null || sort.equals("id")) { - sort = " num_10thousand_km "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; -// if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { -// wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; -// } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - wherestr+=" and maintain_car_id = '"+id+"'"; - PageHelper.startPage(page, rows); - List list = this.libraryMaintainCarDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/LibraryMaintenanceCommonContentController.java b/src/com/sipai/controller/maintenance/LibraryMaintenanceCommonContentController.java deleted file mode 100644 index b854a13d..00000000 --- a/src/com/sipai/controller/maintenance/LibraryMaintenanceCommonContentController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryMaintenanceCommon; -import com.sipai.entity.maintenance.LibraryMaintenanceCommonContent; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.LibraryMaintenanceCommonContentService; -import com.sipai.service.maintenance.LibraryMaintenanceCommonService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/libraryMaintenanceCommonContent") -public class LibraryMaintenanceCommonContentController { - @Resource - private LibraryMaintenanceCommonContentService libraryMaintenanceCommonContentService; - @Resource - private LibraryMaintenanceCommonService libraryMaintenanceCommonService; - - /** - * 获取数据 sj 2020-09-29 - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJson.do") - public ModelAndView getListJson(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String projectId = request.getParameter("projectId");//主表id - String classId = request.getParameter("classId");//设备类别中 部位的id - String unitId = request.getParameter("unitId");// - String type = request.getParameter("type"); - - String faultstr = "where 1=1 and pid = '"+classId+"' and type = '"+type+"'"; - faultstr += " and unit_id = '"+unitId+"' "; - - String whereStr = "where 1=1 "; - //查单条故障库对应的维修库 - if(projectId!=null && !projectId.equals("")){ - whereStr +=" and common_id = '"+projectId+"' "; - //查该设备类别对应的所有维修库 - }else { - String ids = ""; - List list = this.libraryMaintenanceCommonService.selectListByWhere(faultstr+" order by morder"); - for (LibraryMaintenanceCommon libraryMaintenanceCommon : list) { - ids += "'"+libraryMaintenanceCommon.getId()+"',"; - } - if(ids!=null && !ids.equals("")){ - ids = ids.substring(0,ids.length() - 1); - whereStr +=" and common_id in ("+ids+") "; - }else { - whereStr +=" and id='-1' ";//没有则不显示内容 - } - } - PageHelper.startPage(page, rows); - List list = this.libraryMaintenanceCommonContentService.selectListByWhere(whereStr + " order by code"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="projectId") String projectId){ - if(projectId!= null && !projectId.equals("") && !projectId.equals("-1")){ - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById(projectId); - model.addAttribute("pid",projectId); - if(libraryMaintenanceCommon!=null){ - model.addAttribute("pname",libraryMaintenanceCommon.getName()); - }else{ - model.addAttribute("pname",""); - } - } - return "maintenance/libraryMaintenanceCommonContentAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("libraryMaintenanceCommonContent") LibraryMaintenanceCommonContent libraryMaintenanceCommonContent){ - User cu= (User)request.getSession().getAttribute("cu"); - - libraryMaintenanceCommonContent.setId(CommUtil.getUUID()); - - int res = this.libraryMaintenanceCommonContentService.save(libraryMaintenanceCommonContent); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - LibraryMaintenanceCommonContent libraryMaintenanceCommonContent = this.libraryMaintenanceCommonContentService.selectById(id); - if(libraryMaintenanceCommonContent!=null){ - model.addAttribute("libraryMaintenanceCommonContent",libraryMaintenanceCommonContent ); - //查询主表名称 - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById(libraryMaintenanceCommonContent.getCommonId()); - if(libraryMaintenanceCommon!=null){ - model.addAttribute("pname",libraryMaintenanceCommon.getName()); - } - } - return "maintenance/libraryMaintenanceCommonContentEdit"; - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("libraryMaintenanceCommonContent") LibraryMaintenanceCommonContent libraryMaintenanceCommonContent){ - int res = this.libraryMaintenanceCommonContentService.update(libraryMaintenanceCommonContent); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.libraryMaintenanceCommonContentService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.libraryMaintenanceCommonContentService.deleteByWhere("where id in ('"+ids+"')"); - if(res >= 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/LibraryMaintenanceCommonController.java b/src/com/sipai/controller/maintenance/LibraryMaintenanceCommonController.java deleted file mode 100644 index ed184736..00000000 --- a/src/com/sipai/controller/maintenance/LibraryMaintenanceCommonController.java +++ /dev/null @@ -1,310 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryMaintenanceCommon; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryMaintenanceCommonService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/libraryMaintenanceCommon") -public class LibraryMaintenanceCommonController { - @Resource - private LibraryMaintenanceCommonService libraryMaintenanceCommonService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentCardService equipmentCardService; - - /** - * 设备润滑库配置界面 树形 sj 2020-09-28 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request,Model model){ - return "/maintenance/libraryMaintenanceCommon4Tree"; - } - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "/maintenance/libraryMaintenanceCommonList"; - } - - @RequestMapping("/getListJson.do") - public ModelAndView getListJson(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String classId = request.getParameter("classId");//设备类别或部位等Id - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - - String wherestr = "where 1=1"; - wherestr += " and pid = '"+classId+"' and unit_id = '"+unitId+"' and type = '"+type+"' order by morder"; - - PageHelper.startPage(page, rows); - List list = this.libraryMaintenanceCommonService.selectListByWhere(wherestr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname",equipmentClass.getName()); - model.addAttribute("pid",pid); - } - return "maintenance/libraryMaintenanceCommonAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("libraryMaintenanceCommon") LibraryMaintenanceCommon libraryMaintenanceCommon){ - User cu= (User)request.getSession().getAttribute("cu"); - libraryMaintenanceCommon.setId(CommUtil.getUUID()); - libraryMaintenanceCommon.setInsdt(CommUtil.nowDate()); - libraryMaintenanceCommon.setInsuser(cu.getId()); - int res = this.libraryMaintenanceCommonService.save(libraryMaintenanceCommon); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - LibraryMaintenanceCommon libraryMaintenanceCommon = this.libraryMaintenanceCommonService.selectById(id); - if(libraryMaintenanceCommon!=null){ - model.addAttribute("libraryMaintenanceCommon",libraryMaintenanceCommon ); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryMaintenanceCommon.getPid()); - if(equipmentClass!=null){ - model.addAttribute("pname",equipmentClass.getName()); - } - } - return "maintenance/libraryMaintenanceCommonEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("libraryMaintenanceCommon") LibraryMaintenanceCommon libraryMaintenanceCommon){ - int res = this.libraryMaintenanceCommonService.update(libraryMaintenanceCommon); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.libraryMaintenanceCommonService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("删除失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.libraryMaintenanceCommonService.deleteByWhere("where id in ('"+ids+"')"); - if(res >= 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 导入设备信息 - * @param request - * @param model - * @return - */ - @RequestMapping("/doImport.do") - public String doImport(HttpServletRequest request,Model model){ - return "maintenance/libraryMaintenanceCommonImport"; - } - - /** - * 保存导入设备 - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - String mainType = request.getParameter("mainType"); - - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - - String wherestr ="where 1=1 order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? libraryMaintenanceCommonService.readXls(excelFile.getInputStream(),jsonstr,cu.getId(),unitId,mainType) : this.libraryMaintenanceCommonService.readXlsx(excelFile.getInputStream(),jsonstr,cu.getId(),unitId,mainType); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 导出 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="unitId") String unitId, - @RequestParam(value="type") String type) throws IOException { - //获取单厂设备台帐中存在的设备大类 - String bigClassId = equipmentClassService.getTreeIdS4HaveBigId(unitId); - //获取单厂设备台帐中存在的设备小类 - String smallClassId = equipmentClassService.getTreeIdS4HaveSmallId(unitId); - - String wherestr = " where pid = '-1' and id in ("+bigClassId+") order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.libraryMaintenanceCommonService.doExport(response, equipmentClasses, unitId ,smallClassId,type); - return null; - } - - /** - * 保养工单调用 保养库 - * @param request - * @param model - * @return - */ - @RequestMapping("/library4Select.do") - public String library4Select(HttpServletRequest request,Model model){ - String libraryIds = request.getParameter("libraryIds"); - String whereStr= "where id in ('"+libraryIds.replace(",", "','")+"')";// and bizId = '"+bizId+"' - List list = this.libraryMaintenanceCommonService.selectListByWhere(whereStr); - model.addAttribute("librarys",JSONArray.fromObject(list)); - return "maintenance/libraryMaintenanceCommonForSelect"; - } - - @RequestMapping("/getList4Select.do") - public ModelAndView getList4Select(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String equipmentId = request.getParameter("equipmentId"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - - String wherestr = "where 1=1 "; - wherestr += " and unit_id = '"+unitId+"' and type = '"+type+"' "; - - String smallId = ""; - if(equipmentId!=null && !equipmentId.equals("")){ - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentId); - if(equipmentCard!=null){ - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, equipmentCard.getEquipmentclassid()); - for(Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - smallId += "'" + sid + "',"; - } - //查询对应的所有库 - if(smallId!=null && !smallId.equals("")){ - smallId = smallId.substring(0, smallId.length()-1); - wherestr += " and pid in ("+smallId+")"; - } - } - } - wherestr += " order by pid"; - - PageHelper.startPage(page, rows); - List list = this.libraryMaintenanceCommonService.selectListByWhere4part(wherestr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/maintenance/LibraryMaintenanceLubricationController.java b/src/com/sipai/controller/maintenance/LibraryMaintenanceLubricationController.java deleted file mode 100644 index 75dfef0e..00000000 --- a/src/com/sipai/controller/maintenance/LibraryMaintenanceLubricationController.java +++ /dev/null @@ -1,306 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryMaintenanceCommon; -import com.sipai.entity.maintenance.LibraryMaintenanceLubrication; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryMaintenanceLubricationService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 设备润滑库 - * @author SJ - * - */ -@Controller -@RequestMapping("/maintenance/libraryMaintenanceLubrication") -public class LibraryMaintenanceLubricationController { - @Resource - private LibraryMaintenanceLubricationService libraryMaintenanceLubricationService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private UserService userService; - @Resource - private EquipmentCardService equipmentCardService; - - /** - * 设备润滑库配置界面 树形 sj 2020-09-28 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request,Model model){ - return "/maintenance/libraryMaintenanceLubrication4Tree"; - } - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "/maintenance/libraryMaintenanceLubricationList"; - } - - @RequestMapping("/getListJson.do") - public ModelAndView getListJson(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String classId = request.getParameter("classId");//设备类别或部位等Id - String unitId = request.getParameter("unitId"); - - String wherestr = "where 1=1"; - wherestr += " and pid = '"+classId+"' and unit_id = '"+unitId+"' order by code"; - - PageHelper.startPage(page, rows); - List list = this.libraryMaintenanceLubricationService.selectListByWhere(wherestr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname",equipmentClass.getName()); - model.addAttribute("pid",pid); - } - return "maintenance/libraryMaintenanceLubricationAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("libraryMaintenanceLubrication") LibraryMaintenanceLubrication libraryMaintenanceLubrication){ - User cu= (User)request.getSession().getAttribute("cu"); - libraryMaintenanceLubrication.setId(CommUtil.getUUID()); - libraryMaintenanceLubrication.setInsdt(CommUtil.nowDate()); - libraryMaintenanceLubrication.setInsuser(cu.getId()); - int res = this.libraryMaintenanceLubricationService.save(libraryMaintenanceLubrication); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - LibraryMaintenanceLubrication libraryMaintenanceLubrication = this.libraryMaintenanceLubricationService.selectById(id); - if(libraryMaintenanceLubrication!=null){ - model.addAttribute("libraryMaintenanceLubrication",libraryMaintenanceLubrication ); - if(libraryMaintenanceLubrication.getLubricationuid()!=null && !libraryMaintenanceLubrication.getLubricationuid().equals("")){ - User user = userService.getUserById(libraryMaintenanceLubrication.getLubricationuid()); - if(user!=null){ - model.addAttribute("_lubricationuid",user.getCaption()); - } - } - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryMaintenanceLubrication.getPid()); - if(equipmentClass!=null){ - model.addAttribute("pname",equipmentClass.getName()); - } - } - return "maintenance/libraryMaintenanceLubricationEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("libraryMaintenanceLubrication") LibraryMaintenanceLubrication libraryMaintenanceLubrication){ - int res = this.libraryMaintenanceLubricationService.update(libraryMaintenanceLubrication); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.libraryMaintenanceLubricationService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("删除失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.libraryMaintenanceLubricationService.deleteByWhere("where id in ('"+ids+"')"); - if(res >= 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doImport.do") - public String doImport(HttpServletRequest request,Model model){ - return "maintenance/libraryMaintenanceLubricationImport"; - } - - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - - //获取单厂设备台帐中存在的设备小类 然后递归大类 获取所有类别id - String allId = equipmentClassService.getTreeIdS4Have(unitId); - List list = this.equipmentClassService.selectListByWhere(" where id in ("+allId+") order by equipment_class_code asc"); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? libraryMaintenanceLubricationService.readXls(excelFile.getInputStream(),jsonstr,cu.getId(),unitId) : this.libraryMaintenanceLubricationService.readXlsx(excelFile.getInputStream(),jsonstr,cu.getId(),unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 导出 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="unitId") String unitId) throws IOException { - - //获取单厂设备台帐中存在的设备大类 - String bigClassId = equipmentClassService.getTreeIdS4HaveBigId(unitId); - //获取单厂设备台帐中存在的设备小类 - String smallClassId = equipmentClassService.getTreeIdS4HaveSmallId(unitId); - - String wherestr = " where pid = '-1' and id in ("+bigClassId+") order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.libraryMaintenanceLubricationService.doExport(response, equipmentClasses, unitId, smallClassId); - return null; - } - - /** - * 保养工单调用 润滑库 - * @param request - * @param model - * @return - */ - @RequestMapping("/library4Select.do") - public String library4Select(HttpServletRequest request,Model model){ - String libraryIds = request.getParameter("libraryIds"); - String whereStr= "where id in ('"+libraryIds.replace(",", "','")+"')";// and bizId = '"+bizId+"' - List list = this.libraryMaintenanceLubricationService.selectListByWhere(whereStr); - model.addAttribute("librarys",JSONArray.fromObject(list)); - return "maintenance/libraryMaintenanceLubricationForSelect"; - } - - @RequestMapping("/getList4Select.do") - public ModelAndView getList4Select(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String equipmentId = request.getParameter("equipmentId"); - String unitId = request.getParameter("unitId"); - - String wherestr = "where 1=1 "; - wherestr += " and unit_id = '"+unitId+"' "; - - String smallId = ""; - if(equipmentId!=null && !equipmentId.equals("")){ - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentId); - if(equipmentCard!=null){ - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, equipmentCard.getEquipmentclassid()); - for(Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - smallId += "'" + sid + "',"; - } - //查询对应的所有库 - if(smallId!=null && !smallId.equals("")){ - smallId = smallId.substring(0, smallId.length()-1); - wherestr += " and pid in ("+smallId+")"; - } - } - } - wherestr += " order by morder"; - - PageHelper.startPage(page, rows); - List list = this.libraryMaintenanceLubricationService.selectListByWhere4part(wherestr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/maintenance/LibraryMaterialQuotaController.java b/src/com/sipai/controller/maintenance/LibraryMaterialQuotaController.java deleted file mode 100644 index c70d9f1d..00000000 --- a/src/com/sipai/controller/maintenance/LibraryMaterialQuotaController.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.LibraryMaterialQuota; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.LibraryMaterialQuotaService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/libraryMaterialQuota") -public class LibraryMaterialQuotaController { - @Resource - private LibraryMaterialQuotaService libraryMaterialQuotaService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "/maintenance/libraryMaterialQuotaList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String pid = request.getParameter("pid");//内容id - PageHelper.startPage(page, rows); - - String whereStr = "where 1=1"; - whereStr += " and pid = '"+pid+"' "; - - List list = this.libraryMaterialQuotaService.selectListByWhere(whereStr + " order by id"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/importMaterial.do") - public ModelAndView importEquipmentFittings(HttpServletRequest request,Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "goodsIds") String goodsIds, - @RequestParam(value = "modelId") String modelId) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr="where 1=1 "; - wherestr+=" and pid ='"+pid+"' "; - this.libraryMaterialQuotaService.deleteByWhere(wherestr); - if (goodsIds==null||goodsIds.equals("")) { - String resstr="{\"res\":\""+1+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - String[] split = goodsIds.split(","); - for (String string : split) { - LibraryMaterialQuota libraryMaterialQuota = new LibraryMaterialQuota(); - libraryMaterialQuota.setId(CommUtil.getUUID()); - libraryMaterialQuota.setPid(pid); - libraryMaterialQuota.setMaterialId(string); - int code = this.libraryMaterialQuotaService.save(libraryMaterialQuota); - if(code!=1){ - String resstr="{\"res\":\""+code+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - } - String resstr="{\"res\":\""+1+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteMaterial.do") - public ModelAndView deleteMaterial(HttpServletRequest request,Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "goodsIds") String goodsIds, - @RequestParam(value = "modelId") String modelId) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr="where 1=1 "; - wherestr+=" and pid ='"+pid+"' and material_id = '"+goodsIds+"'"; - int code = this.libraryMaterialQuotaService.deleteByWhere(wherestr); - String resstr="{\"res\":\""+code+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/maintenance/LibraryOverhaulContentBlocController.java b/src/com/sipai/controller/maintenance/LibraryOverhaulContentBlocController.java deleted file mode 100644 index 5c1f269a..00000000 --- a/src/com/sipai/controller/maintenance/LibraryOverhaulContentBlocController.java +++ /dev/null @@ -1,391 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.LibraryOverhaulContentEquBizService; -import com.sipai.service.maintenance.LibraryOverhaulContentModelBlocService; -import com.sipai.service.maintenance.LibraryOverhaulProjectBlocService; -import com.sipai.service.maintenance.LibraryOverhaulContentBlocService; -import com.sipai.tools.CommUtil; - -/** - * 设备大修库(集团层标准库) 内容附表 - * @author SJ - * - */ -@Controller -@RequestMapping("/maintenance/libraryOverhaulContentBloc") -public class LibraryOverhaulContentBlocController { - @Resource - private LibraryOverhaulContentBlocService libraryOverhaulContentBlocService; - @Resource - private LibraryOverhaulProjectBlocService libraryOverhaulProjectBlocService; - @Resource - private LibraryOverhaulContentModelBlocService libraryOverhaulContentModelBlocService; - @Resource - private LibraryOverhaulContentEquBizService libraryOverhaulContentEquBizService; - @Resource - private CompanyService companyService; - - @RequestMapping("/getListJsonBloc.do") - public ModelAndView getListJsonBloc(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String projectId = request.getParameter("projectId");//主表id - String classId = request.getParameter("classId");//设备类别中 部位的id - String modelId = request.getParameter("modelId");//设备型号的id - String unitId = request.getParameter("unitId");// - - String whereStr = "where 1=1 "; - - String projectstr = "where 1=1 and pid = '"+classId+"'"; - //如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null && company.getLibraryBizid()!=null && !company.getLibraryBizid().equals("")){ - projectstr += " and unit_id = '"+company.getLibraryBizid()+"'"; - }else { - projectstr += " and unit_id = '"+unitId+"' "; - } - - //查单条故障库对应的维修库 - if(projectId!=null && !projectId.equals("")){ - whereStr +=" and pid = '"+projectId+"' "; - //查该设备类别对应的所有维修库 - }else { - String ids = ""; - - List list = this.libraryOverhaulProjectBlocService.selectListByWhere(projectstr + " order by morder"); - for (LibraryOverhaulProjectBloc libraryOverhaulProjectBloc : list) { - ids += "'"+libraryOverhaulProjectBloc.getId()+"',"; - } - - if(ids!=null && !ids.equals("")){ - ids = ids.substring(0,ids.length() - 1); - whereStr +=" and pid in ("+ids+") "; - }else { - whereStr +=" and id='-1' ";//没有则不显示内容 - } - } - - PageHelper.startPage(page, rows); - List list = this.libraryOverhaulContentBlocService.selectList4Model(whereStr + "order by content_number",modelId,unitId); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListJsonBiz.do") - public ModelAndView getListJsonBiz(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String projectId = request.getParameter("projectId");//主表id - String classId = request.getParameter("classId");//设备类别中 部位的id - String modelId = request.getParameter("modelId");//设备型号的id - String unitId = request.getParameter("unitId");//设备型号的id - - String whereStr = "where 1=1 "; - String whereProject = "where 1=1 and pid = '"+classId+"'"; - - String unitStr = ""; - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null){ - unitStr = company.getLibraryBizid(); - }else { - unitStr = "无"; - } - - //查单条故障库对应的维修库 - if(projectId!=null && !projectId.equals("")){ - whereStr +=" and pid = '"+projectId+"' "; - //查该设备类别对应的所有维修库 - }else { - String ids = ""; - - List list = this.libraryOverhaulProjectBlocService.selectListByWhere(whereProject + " and unit_id = '"+unitStr+"' order by morder"); - for (LibraryOverhaulProjectBloc libraryOverhaulProjectBloc : list) { - ids += "'"+libraryOverhaulProjectBloc.getId()+"',"; - } - - if(ids!=null && !ids.equals("")){ - ids = ids.substring(0,ids.length() - 1); - whereStr +=" and pid in ("+ids+") "; - }else { - whereStr +=" and id='-1' ";//没有则不显示内容 - } - } - - PageHelper.startPage(page, rows); - List list = this.libraryOverhaulContentBlocService.selectList4Equ(whereStr + "order by content_number",modelId,unitId); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="projectId") String projectId){ - if(projectId!= null && !projectId.equals("") && !projectId.equals("-1")){ - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = libraryOverhaulProjectBlocService.selectById(projectId); - model.addAttribute("pname",libraryOverhaulProjectBloc.getProjectName()); - model.addAttribute("pid",projectId); - } - return "maintenance/libraryOverhaulContentBlocAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("libraryOverhaulContentBloc") LibraryOverhaulContentBloc libraryOverhaulContentBloc){ - String modelId = request.getParameter("modelId");//设备型号id - libraryOverhaulContentBloc.setId(CommUtil.getUUID()); - int res = this.libraryOverhaulContentBlocService.save(libraryOverhaulContentBloc); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryOverhaulContentBloc libraryOverhaulContentBloc = this.libraryOverhaulContentBlocService.selectById(id); - if(libraryOverhaulContentBloc!=null){ - model.addAttribute("libraryOverhaulContentBloc",libraryOverhaulContentBloc ); - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = libraryOverhaulProjectBlocService.selectById(libraryOverhaulContentBloc.getPid()); - if(libraryOverhaulProjectBloc!=null){ - model.addAttribute("pname",libraryOverhaulProjectBloc.getProjectName()); - } - List listModel = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id='"+libraryOverhaulContentBloc.getId()+"' and model_id='"+modelId+"' and unit_id = '"+unitId+"'"); - if(listModel!=null && listModel.size()>0){ - libraryOverhaulContentBloc.setLibraryOverhaulContentModelBloc(listModel.get(0)); - } - } - return "maintenance/libraryOverhaulContentBlocEdit"; - } - - @RequestMapping("/doedit4Biz.do") - public String doedit4Biz(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryOverhaulContentBloc libraryOverhaulContentBloc = this.libraryOverhaulContentBlocService.selectById(id); - if(libraryOverhaulContentBloc!=null){ - model.addAttribute("libraryOverhaulContentBloc",libraryOverhaulContentBloc ); - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = libraryOverhaulProjectBlocService.selectById(libraryOverhaulContentBloc.getPid()); - if(libraryOverhaulProjectBloc!=null){ - model.addAttribute("pname",libraryOverhaulProjectBloc.getProjectName()); - } - List listEqu = libraryOverhaulContentEquBizService.selectListByWhere("where content_id='"+libraryOverhaulContentBloc.getId()+"' and equipment_id='"+modelId+"' and unit_id = '"+unitId+"'"); - if(listEqu!=null && listEqu.size()>0){ - libraryOverhaulContentBloc.setLibraryOverhaulContentEquBiz(listEqu.get(0)); - } - - String unitStr = ""; - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null){ - unitStr = company.getLibraryBizid(); - }else { - unitStr = "无"; - } - List listModel = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id='"+libraryOverhaulContentBloc.getId()+"' and model_id='-1' and unit_id = '"+unitStr+"'"); - if(listModel!=null && listModel.size()>0){ - libraryOverhaulContentBloc.setLibraryOverhaulContentModelBloc(listModel.get(0)); - } - - } - return "maintenance/libraryOverhaulContentBizEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("libraryOverhaulContentBloc") LibraryOverhaulContentBloc libraryOverhaulContentBloc){ - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId"); - int res = this.libraryOverhaulContentBlocService.update4Model(libraryOverhaulContentBloc,modelId,unitId); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate4Biz.do") - public ModelAndView doupdate4Biz(HttpServletRequest request,Model model, - @ModelAttribute("libraryOverhaulContentBloc") LibraryOverhaulContentBloc libraryOverhaulContentBloc){ - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId");//unitId - int res = this.libraryOverhaulContentBlocService.update4Equ(libraryOverhaulContentBloc,modelId,unitId); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.libraryOverhaulContentBlocService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 根据该项目配置的设备库定额等级 获取新增界面的数据 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getQuotaJson4Add.do") - public ModelAndView getQuotaJson4Add(HttpServletRequest request,Model model) { - JSONArray jsonArray = new JSONArray(); - - String whereStr = " where type='1' ";//查维修配置的定额等级 - List list = this.libraryQuotaLevelService.selectListByWhere(whereStr + "order by morder"); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getName()); - jsonArray.add(jsonObject); - } - } - - model.addAttribute("result",jsonArray); - return new ModelAndView("result"); - }*/ - - /** - * 根据该项目配置的设备库定额等级 获取修改界面的数据 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getQuotaJson4Edit.do") - public ModelAndView getQuotaJson4Edit(HttpServletRequest request,Model model) { - JSONArray jsonArray = new JSONArray(); - String id = request.getParameter("id"); - String whereStr = " where type='1' ";//查维修配置的定额等级 - List list = this.libraryQuotaLevelService.selectListByWhere(whereStr + "order by morder"); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getName()); - - List list2 = libraryOverhaulContentBlocQuotaService.selectListByWhere(" where d.pid='"+id+"' and d.level_id='"+list.get(i).getId()+"'"); - if(list2!=null && list2.size()>0){ - jsonObject.put("quotaId", list2.get(0).getId()); - jsonObject.put("insideRepairTime", list2.get(0).getInsideRepairTime()); - jsonObject.put("materialCost", list2.get(0).getMaterialCost()); - jsonObject.put("outsideRepairCost", list2.get(0).getOutsideRepairCost()); - jsonObject.put("totalCost", list2.get(0).getTotalCost()); - } - - jsonArray.add(jsonObject); - } - } - - model.addAttribute("result",jsonArray); - return new ModelAndView("result"); - }*/ - - //根据pid和levelId获取对应的定额数值 - /*@RequestMapping("/getQuotaData.do") - public ModelAndView getQuotaData(HttpServletRequest request,Model model) { - JSONArray jsonArray = new JSONArray(); - String pid = request.getParameter("pid"); - String levelId = request.getParameter("levelId"); - - String whereStr = " where d.pid='"+pid+"' and level_id='"+levelId+"' "; - List list = libraryOverhaulContentBlocQuotaService.selectListByWhere(whereStr); - if(list!=null && list.size()>0){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(0).getId()); - jsonObject.put("insideRepairTime", list.get(0).getInsideRepairTime()); - jsonObject.put("outsideRepairCost", list.get(0).getOutsideRepairCost()); - jsonObject.put("materialCost", list.get(0).getMaterialCost()); - jsonArray.add(jsonObject); - } - model.addAttribute("result",jsonArray); - return new ModelAndView("result"); - }*/ - - @RequestMapping("/showListBizQuota.do") - public String showListBizQuota(HttpServletRequest request,Model model){ - return "/maintenance/libraryOverhaulContentBizQuotaList"; - } - - @RequestMapping("/getListBizQuota.do") - public ModelAndView getListBizQuota(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String pid = request.getParameter("pid");//项目id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and content_id = '"+pid+"' "; - -// List companys = companyService.selectListByWhere("where library_bizid = '"+unitId+"'"); -// for (Company company : companys) { -// -// } - - PageHelper.startPage(page, rows); - List list = this.libraryOverhaulContentEquBizService.selectListByWhere(whereStr + " order by unit_id"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/maintenance/LibraryOverhaulProjectBlocController.java b/src/com/sipai/controller/maintenance/LibraryOverhaulProjectBlocController.java deleted file mode 100644 index 4e68105e..00000000 --- a/src/com/sipai/controller/maintenance/LibraryOverhaulProjectBlocController.java +++ /dev/null @@ -1,538 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectEquBiz; -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryOverhaulProjectBlocService; -import com.sipai.service.maintenance.LibraryOverhaulProjectEquBizService; -import com.sipai.service.maintenance.LibraryOverhaulProjectModelBlocService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 设备大修库-项目(集团层标准库) - * - * @author SJ - */ -@Controller -@RequestMapping("/maintenance/libraryOverhaulProjectBloc") -public class LibraryOverhaulProjectBlocController { - - @Resource - private LibraryOverhaulProjectBlocService libraryOverhaulProjectBlocService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private LibraryOverhaulProjectModelBlocService libraryOverhaulProjectModelBlocService; - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private LibraryOverhaulProjectEquBizService libraryOverhaulProjectEquBizService; - - /** - * 设备大修库配置界面 树形 ( 集团层级) sj 2020-07-29 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeBloc.do") - public String showList4TreeBloc(HttpServletRequest request, Model model) { - return "/maintenance/libraryOverhaulProjectBloc4Tree"; - } - - /** - * 设备大修库配置界面 树形 ( 水厂层级) sj 2020-09-05 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4TreeBiz.do") - public String showList4TreeBiz(HttpServletRequest request, Model model) { - return "/maintenance/libraryOverhaulProjectBiz4Tree"; - } - - /** - * 大修库列表 ( 集团层级) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBloc.do") - public String showListBloc(HttpServletRequest request, Model model) { - return "maintenance/libraryOverhaulProjectBlocList"; - } - - /** - * 大修库列表 ( 水厂层级) sj 2020-09-05 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBiz.do") - public String showListBiz(HttpServletRequest request, Model model) { - return "maintenance/libraryOverhaulProjectBizList"; - } - - /** - * 获取大修项目(集团层) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBloc.do") - public ModelAndView getFaultListJson(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String classId = request.getParameter("classId");//设备类别或部位等Id - String modelId = request.getParameter("modelId");//型号id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and pid = '" + classId + "' "; - - //如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryOverhaulProjectBlocService.selectList4Model(whereStr + " order by project_number", modelId, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取大修项目(集团层) sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBiz.do") - public ModelAndView getListJsonBiz(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String classId = request.getParameter("classId");//设备类别或部位等Id - String modelId = request.getParameter("modelId");//型号id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and pid = '" + classId + "' "; - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr = " and id = '无' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryOverhaulProjectBlocService.selectList4Equ(whereStr + " order by project_number", modelId, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname", equipmentClass.getName()); - model.addAttribute("pid", pid); - } - return "maintenance/libraryOverhaulProjectBlocAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryOverhaulProjectBloc") LibraryOverhaulProjectBloc libraryOverhaulProjectBloc) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryOverhaulProjectBloc.setId(CommUtil.getUUID()); - libraryOverhaulProjectBloc.setInsdt(CommUtil.nowDate()); - libraryOverhaulProjectBloc.setInsuser(cu.getId()); - libraryOverhaulProjectBloc.setActive("1"); - int res = this.libraryOverhaulProjectBlocService.save(libraryOverhaulProjectBloc); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = this.libraryOverhaulProjectBlocService.selectById(id); - if (libraryOverhaulProjectBloc != null) { - model.addAttribute("libraryOverhaulProjectBloc", libraryOverhaulProjectBloc); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryOverhaulProjectBloc.getPid()); - if (equipmentClass != null) { - model.addAttribute("pname", equipmentClass.getName()); - } - List listModel = libraryOverhaulProjectModelBlocService.selectListByWhere("where project_id='" + libraryOverhaulProjectBloc.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listModel != null && listModel.size() > 0) { - libraryOverhaulProjectBloc.setLibraryOverhaulProjectModelBloc(listModel.get(0)); - } - } - return "maintenance/libraryOverhaulProjectBlocEdit"; - } - - @RequestMapping("/doedit4Biz.do") - public String doedit4Biz(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = this.libraryOverhaulProjectBlocService.selectById(id); - if (libraryOverhaulProjectBloc != null) { - model.addAttribute("libraryOverhaulProjectBloc", libraryOverhaulProjectBloc); - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryOverhaulProjectBloc.getPid()); - if (equipmentClass != null) { - model.addAttribute("pname", equipmentClass.getName()); - } - List listEqu = libraryOverhaulProjectEquBizService.selectListByWhere("where project_id='" + libraryOverhaulProjectBloc.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryOverhaulProjectBloc.setLibraryOverhaulProjectEquBiz(listEqu.get(0)); - } - - String unitStr = ""; - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - unitStr = company.getLibraryBizid(); - } else { - unitStr = "无"; - } - List listModel = libraryOverhaulProjectModelBlocService.selectListByWhere("where project_id='" + libraryOverhaulProjectBloc.getId() + "' and model_id='-1' and unit_id='" + unitStr + "'"); - if (listModel != null && listModel.size() > 0) { - libraryOverhaulProjectBloc.setLibraryOverhaulProjectModelBloc(listModel.get(0)); - } - } - return "maintenance/libraryOverhaulProjectBizEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryOverhaulProjectBloc") LibraryOverhaulProjectBloc libraryOverhaulProjectBloc) { - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId"); - int res = this.libraryOverhaulProjectBlocService.update4Model(libraryOverhaulProjectBloc, modelId, unitId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate4Biz.do") - public ModelAndView doupdate4Biz(HttpServletRequest request, Model model, - @ModelAttribute("libraryOverhaulProjectBloc") LibraryOverhaulProjectBloc libraryOverhaulProjectBloc) { - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId"); - int res = this.libraryOverhaulProjectBlocService.update4Equ(libraryOverhaulProjectBloc, modelId, unitId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.libraryOverhaulProjectBlocService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 导入设备信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doImport.do") - public String doImport(HttpServletRequest request, Model model) { - return "maintenance/libraryOverhaulBlocImport"; - } - - /** - * 导入设备信息--单厂 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doImport4Biz.do") - public String doImport4Biz(HttpServletRequest request, Model model) { - return "maintenance/libraryOverhaulBizImport"; - } - - /** - * 保存导入设备--集团 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - String wherestr = "where 1=1 and type!='" + CommString.EquipmentClass_Parts + "' order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? libraryOverhaulProjectBlocService.readXls(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryOverhaulProjectBlocService.readXlsx(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存导入设备--单厂 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/saveExcelData4Biz.do") - public ModelAndView dosaveExcelData4Biz(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - String wherestr = "where 1=1 and type!='" + CommString.EquipmentClass_Parts + "' order by morder"; - List list = this.equipmentClassService.selectListByWhere(wherestr); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? libraryOverhaulProjectBlocService.readXls4Biz(excelFile.getInputStream(), jsonstr, cu.getId(), unitId) : this.libraryOverhaulProjectBlocService.readXlsx4Biz(excelFile.getInputStream(), jsonstr, cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 大修库导出 - */ - @RequestMapping(value = "doExport4Bloc.do") - public ModelAndView doExport4Bloc(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - String wherestr = " where pid = '-1' order by morder asc "; - - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.libraryOverhaulProjectBlocService.doExportLibraryOverhaulBloc(response, equipmentClasses, unitId); - return null; - } - - /** - * 大修库导出 - */ - @RequestMapping(value = "doExport4Biz.do") - public ModelAndView doExport4Biz(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //获取单厂设备台帐中存在的设备大类 - String bigClassId = equipmentClassService.getTreeIdS4HaveBigId(unitId); - //获取单厂设备台帐中存在的设备小类 - String smallClassId = equipmentClassService.getTreeIdS4HaveSmallId(unitId); - - String wherestr = " where pid = '-1' and id in (" + bigClassId + ") order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - - //导出文件到指定目录,兼容Linux - this.libraryOverhaulProjectBlocService.doExportLibraryOverhaulBiz(response, equipmentClasses, unitId, smallClassId); - return null; - } - - /** - * 业务区查看分厂项目定额 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showListBizQuota.do") - public String showListBizQuota(HttpServletRequest request, Model model) { - return "/maintenance/libraryOverhaulProjectBizQuotaList"; - } - - /** - * 业务区查看分厂项目定额 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListBizQuota.do") - public ModelAndView getListBizQuota(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid");//项目id - String unitId = request.getParameter("unitId"); - - String whereStr = "where 1=1"; - whereStr += " and project_id = '" + pid + "' "; - -// List companys = companyService.selectListByWhere("where library_bizid = '"+unitId+"'"); -// for (Company company : companys) { -// -// } - - PageHelper.startPage(page, rows); - List list = this.libraryOverhaulProjectEquBizService.selectListByWhere(whereStr + " order by unit_id"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 选择分厂定额 来更新业务区定额 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/doChoiceProjectQuota.do") - public ModelAndView doChoiceProjectQuota(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String modelId = request.getParameter("modelId");//设备型号id - String equipmentId = request.getParameter("equipmentId");//设备型号id - String unitId = request.getParameter("unitId"); - int res = this.libraryOverhaulProjectBlocService.updateProjectQuota(id, modelId, unitId, equipmentId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/maintenance/LibraryRepairBlocContraller.java b/src/com/sipai/controller/maintenance/LibraryRepairBlocContraller.java deleted file mode 100644 index 717790ed..00000000 --- a/src/com/sipai/controller/maintenance/LibraryRepairBlocContraller.java +++ /dev/null @@ -1,495 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.Iterator; -import java.util.List; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.maintenance.LibraryRepairEquBiz; -import com.sipai.entity.maintenance.LibraryRepairModelBloc; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.LibraryRepairBlocService; -import com.sipai.service.maintenance.LibraryRepairEquBizService; -import com.sipai.service.maintenance.LibraryRepairModelBlocService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/libraryRepairBloc") -public class LibraryRepairBlocContraller { - - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private LibraryRepairModelBlocService libraryRepairModelBlocService; - @Resource - private LibraryRepairEquBizService libraryRepairEquBizService; - @Resource - private CompanyService companyService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentCardService equipmentCardService; - - /** - * 获取设备故障库数据 sj 2020-07-14 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBloc.do") - public ModelAndView getListJsonBloc(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String faultId = request.getParameter("faultId");//故障库id - String classId = request.getParameter("classId");//设备类别中 部位的id - String modelId = request.getParameter("modelId");//设备型号的id - String unitId = request.getParameter("unitId");// - - String faultstr = "where 1=1 and pid = '" + classId + "'"; - //如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - faultstr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - faultstr += " and unit_id = '" + unitId + "' "; - } - - - String whereStr = "where 1=1 "; - //查单条故障库对应的维修库 - if (faultId != null && !faultId.equals("")) { - whereStr += " and pid = '" + faultId + "' "; - //查该设备类别对应的所有维修库 - } else { - String ids = ""; - List list = this.libraryFaultBlocService.selectListByWhere(faultstr + " order by morder"); - //where 1=1 and m.pid = '"+classId+"' and d.id is not null order by m.project_number,l.morder - for (LibraryFaultBloc libraryFaultBloc : list) { - ids += "'" + libraryFaultBloc.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - whereStr += " and pid in (" + ids + ") "; - } else { - whereStr += " and id='-1' ";//没有则不显示内容 - } - } - PageHelper.startPage(page, rows); - List list = this.libraryRepairBlocService.selectList4Model(whereStr + " order by repair_number,morder", modelId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备故障库数据 sj 2020-09-06 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBiz.do") - public ModelAndView getListJsonBiz(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String faultId = request.getParameter("faultId");//故障库id - String classId = request.getParameter("classId");//设备类别中 部位的id - String modelId = request.getParameter("modelId");//设备型号的id - String unitId = request.getParameter("unitId");//设备型号的id - - String whereStr = "where 1=1 "; - - String unitStr = ""; - /*Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - unitStr = company.getLibraryBizid(); - } else { - unitStr = "无"; - }*/ - - unitStr = "-1"; - - //查单条故障库对应的维修库 - if (faultId != null && !faultId.equals("")) { - whereStr += " and pid = '" + faultId + "' "; - //查该设备类别对应的所有维修库 - } else { - String ids = ""; - List list = this.libraryFaultBlocService.selectListByWhere("where 1=1 and pid = '" + classId + "' and unit_id = '" + unitId + "' order by morder"); - for (LibraryFaultBloc libraryFaultBloc : list) { - ids += "'" + libraryFaultBloc.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - whereStr += " and pid in (" + ids + ") "; - } else { - whereStr += " and id='-1' ";//没有则不显示内容 - } - } - PageHelper.startPage(page, rows); - List list = this.libraryRepairBlocService.selectList4Equ(whereStr + " order by repair_number,morder", modelId, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "faultId") String faultId) { - if (faultId != null && !faultId.equals("") && !faultId.equals("-1")) { - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocService.selectById(faultId); - model.addAttribute("pname", libraryFaultBloc.getFaultName()); - model.addAttribute("pid", faultId); - } - return "maintenance/libraryRepairBlocAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryRepairBloc") LibraryRepairBloc libraryRepairBloc) { - User cu = (User) request.getSession().getAttribute("cu"); - //String jsonStr = request.getParameter("jsonStr");//附表的json - - libraryRepairBloc.setId(CommUtil.getUUID()); - libraryRepairBloc.setInsdt(CommUtil.nowDate()); - libraryRepairBloc.setInsuser(cu.getId()); - libraryRepairBloc.setActive("1"); - //int res = this.libraryRepairBlocService.save(libraryRepairBloc,jsonStr); - int res = this.libraryRepairBlocService.save(libraryRepairBloc); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit4Bloc.do") - public String doedit4Bloc(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryRepairBloc libraryRepairBloc = this.libraryRepairBlocService.selectById(id); - if (libraryRepairBloc != null) { - model.addAttribute("libraryRepairBloc", libraryRepairBloc); - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocService.selectById(libraryRepairBloc.getPid()); - if (libraryFaultBloc != null) { - model.addAttribute("pname", libraryFaultBloc.getFaultName()); - } - /*String sql = "where content_id='" + libraryRepairBloc.getId() + "' and model_id='" + modelId + "' "; - List listModel = libraryRepairModelBlocService.selectListByWhere(sql); - if (listModel != null && listModel.size() > 0) { - libraryRepairBloc.setLibraryRepairModelBloc(listModel.get(0)); - }*/ - } - return "maintenance/libraryRepairBlocEdit"; - } - - @RequestMapping("/doedit4Biz.do") - public String doedit4Biz(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String modelId = request.getParameter("modelId"); - String unitId = request.getParameter("unitId"); - LibraryRepairBloc libraryRepairBloc = this.libraryRepairBlocService.selectById(id); - if (libraryRepairBloc != null) { - model.addAttribute("libraryRepairBloc", libraryRepairBloc); - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocService.selectById(libraryRepairBloc.getPid()); - if (libraryFaultBloc != null) { - model.addAttribute("pname", libraryFaultBloc.getFaultName()); - } - //查询分厂定额 - List listEqu = libraryRepairEquBizService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and equipment_id='" + modelId + "' and unit_id = '" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryRepairBloc.setLibraryRepairEquBiz(listEqu.get(0)); - } - - //查询业务区定额 - String unitStr = ""; - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - unitStr = company.getLibraryBizid(); - } else { - unitStr = "无"; - } - //List listModel = libraryRepairModelBlocService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and model_id='-1' and unit_id = '" + unitStr + "'"); - List listModel = libraryRepairModelBlocService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and model_id='-1' "); - if (listModel != null && listModel.size() > 0) { - libraryRepairBloc.setLibraryRepairModelBloc(listModel.get(0)); - } - - } - return "maintenance/libraryRepairBizEdit"; - } - - @RequestMapping("/doupdateBloc.do") - public ModelAndView doupdateBloc(HttpServletRequest request, Model model, - @ModelAttribute("libraryRepairBloc") LibraryRepairBloc libraryRepairBloc) { - String modelId = request.getParameter("modelId");//设备型号id - int res = this.libraryRepairBlocService.update5Model(libraryRepairBloc); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdateBiz.do") - public ModelAndView doupdateBiz(HttpServletRequest request, Model model, - @ModelAttribute("libraryRepairBloc") LibraryRepairBloc libraryRepairBloc) { - String modelId = request.getParameter("modelId");//设备型号id - String unitId = request.getParameter("unitId");//unitId - int res = this.libraryRepairBlocService.update4Equ(libraryRepairBloc, modelId, unitId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.libraryRepairBlocService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.libraryRepairBlocService.deleteByWhere("where id in ('" + ids + "')"); - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 根据该项目配置的设备库定额等级 获取新增界面的数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getQuotaJson4Add.do") - public ModelAndView getQuotaJson4Add(HttpServletRequest request, Model model) { - /*JSONArray jsonArray = new JSONArray(); - - String whereStr = " where type='0' ";//查维修配置的定额等级 - List list = this.libraryQuotaLevelService.selectListByWhere(whereStr + "order by morder"); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result",jsonArray);*/ - return new ModelAndView("result"); - } - - /** - * 根据该项目配置的设备库定额等级 获取修改界面的数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getQuotaJson4Edit.do") - public ModelAndView getQuotaJson4Edit(HttpServletRequest request, Model model) { - /*JSONArray jsonArray = new JSONArray(); - String id = request.getParameter("id"); - String whereStr = " where type='0' ";//查维修配置的定额等级 - List list = this.libraryQuotaLevelService.selectListByWhere(whereStr + "order by morder"); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getName()); - - List list2 = libraryRepairBlocQuotaService.selectListByWhere(" where d.pid='"+id+"' and d.level_id='"+list.get(i).getId()+"'"); - if(list2!=null && list2.size()>0){ - jsonObject.put("entityId", list2.get(0).getId()); - jsonObject.put("insideRepairTime", list2.get(0).getInsideRepairTime()); - jsonObject.put("outsideRepairCost", list2.get(0).getOutsideRepairCost()); - jsonObject.put("materialCost", list2.get(0).getMaterialCost()); - jsonObject.put("totalCost", list2.get(0).getTotalCost()); - } - jsonArray.add(jsonObject); - } - } - model.addAttribute("result",jsonArray);*/ - return new ModelAndView("result"); - } - - //根据pid和levelId获取对应的定额数值 - @RequestMapping("/getQuotaData.do") - public ModelAndView getQuotaData(HttpServletRequest request, Model model) { - JSONArray jsonArray = new JSONArray(); - String pid = request.getParameter("pid"); - String levelId = request.getParameter("levelId"); - - String whereStr = " where d.pid='" + pid + "' and level_id='" + levelId + "' "; - /*List list = libraryRepairBlocQuotaService.selectListByWhere(whereStr); - if(list!=null && list.size()>0){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(0).getId()); - jsonObject.put("insideRepairTime", list.get(0).getInsideRepairTime()); - jsonObject.put("outsideRepairCost", list.get(0).getOutsideRepairCost()); - jsonObject.put("materialCost", list.get(0).getMaterialCost()); - jsonArray.add(jsonObject); - }*/ - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - /** - * 维修工单调用 维修库 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/library4Select.do") - public String library4Select(HttpServletRequest request, Model model) { - String libraryIds = request.getParameter("libraryIds"); - String whereStr = "where id in ('" + libraryIds.replace(",", "','") + "')";// and bizId = '"+bizId+"' - List list = this.libraryRepairBlocService.selectListByWhere(whereStr); - model.addAttribute("librarys", JSONArray.fromObject(list)); - return "maintenance/libraryRepairForSelect"; - } - - /** - * 获取弹窗内容 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getList4Select.do") - public ModelAndView getList4Select(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String equipmentId = request.getParameter("equipmentId"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - - String wherestr = "where 1=1 "; - - String unitstr = " "; - //如果配置了所属标准库则认为是水厂 否则认为是业务区 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - unitstr = company.getLibraryBizid(); - } else { - unitstr = unitId; - } - wherestr += " and unit_id = '" + unitstr + "' "; - - String smallId = "";//部位id - String repairIds = "";//维修库id - if (equipmentId != null && !equipmentId.equals("")) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentId); - if (equipmentCard != null) { - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getAllChildId(set, equipmentCard.getEquipmentclassid()); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - smallId += "'" + sid + "',"; - } - //查询对应的所有库 - if (smallId != null && !smallId.equals("")) { - smallId = smallId.substring(0, smallId.length() - 1); - wherestr += " and pid in (" + smallId + ")"; - } - } - } - List listFault = this.libraryFaultBlocService.selectListByWhere(wherestr); - for (LibraryFaultBloc libraryFaultBloc : listFault) { - List listRepair = this.libraryRepairBlocService.selectListByWhere("where pid = '" + libraryFaultBloc.getId() + "'"); - for (LibraryRepairBloc libraryRepairBloc : listRepair) { - repairIds += "'" + libraryRepairBloc.getId() + "',"; - } - } - - String repairStr = "where 1=1 "; - if (repairIds != null && !repairIds.equals("")) { - repairIds = repairIds.substring(0, repairIds.length() - 1); - repairStr += "and id in (" + repairIds + ") "; - } else { - repairStr += "and id ='-1' "; - } - repairStr += "order by pid "; - PageHelper.startPage(page, rows); - List list = this.libraryRepairBlocService.selectList4FaultAndBiz(repairStr, unitId, equipmentId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/maintenance/LibraryRepairEquBizController.java b/src/com/sipai/controller/maintenance/LibraryRepairEquBizController.java deleted file mode 100644 index 3f76c588..00000000 --- a/src/com/sipai/controller/maintenance/LibraryRepairEquBizController.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.LibraryRepairEquBiz; -import com.sipai.service.maintenance.LibraryRepairEquBizService; - -@Controller -@RequestMapping("/maintenance/libraryRepairEquBiz") -public class LibraryRepairEquBizController { - @Resource - private LibraryRepairEquBizService libraryRepairEquBizService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/maintenance/libraryRepairEquBizList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String contentId = request.getParameter("contentId");//内容id - PageHelper.startPage(page, rows); - - String whereStr = "where 1=1"; - whereStr += " and content_id = '" + contentId + "' "; - - List list = this.libraryRepairEquBizService.selectListByWhere(whereStr + " order by id"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 复制设备定额工时费用到其他工时 - * - * @param request - * @param model - * @param id 故障库的Id - * @param modelId 在业务区是型号id 在厂里是设备id - * @param unitId 部门id - * @return - */ - @RequestMapping("/docopy4Equ.do") - public ModelAndView docopy4Equ(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "modelId") String modelId, - @RequestParam(value = "unitId") String unitId) { - int res = this.libraryRepairEquBizService.copy4Equ(id, modelId, unitId); - if (res > 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/maintenance/MaintainCarController.java b/src/com/sipai/controller/maintenance/MaintainCarController.java deleted file mode 100644 index 028604b1..00000000 --- a/src/com/sipai/controller/maintenance/MaintainCarController.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.LibraryMaintainCar; -import com.sipai.entity.maintenance.LibraryMaintainCarDetail; -import com.sipai.entity.maintenance.MaintainCar; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.maintenance.LibraryMaintainCarDetailService; -import com.sipai.service.maintenance.LibraryMaintainCarService; -import com.sipai.service.maintenance.MaintainCarService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/maintainCar") -public class MaintainCarController { - @Resource - private MaintainCarService maintainCarService; - @Resource - private LibraryMaintainCarService libraryMaintainCarService; - @Resource - private LibraryMaintainCarDetailService libraryMaintainCarDetailService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - - @RequestMapping("/showMaintainCarList.do") - public String showMaintainCarList(HttpServletRequest request,Model model){ - return "/maintenance/maintainCarList"; - } - - @RequestMapping("/getlist.do") - public String getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "unitId") String unitId) { -// String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; -// if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { -// wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; -// } -// if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; -// } - wherestr+=" and unit_id = '"+unitId+"'"; - PageHelper.startPage(page, rows); - List list = this.maintainCarService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String unitId= request.getParameter("unitId"); - model.addAttribute("unitId",unitId); - Company company = this.unitService.getCompById(unitId); - String detailNumber = "CLWB-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - request.setAttribute("detailNumber", detailNumber); - return "/maintenance/maintainCarAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute MaintainCar maintainCar){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - maintainCar.setId(CommUtil.getUUID()); - maintainCar.setInsuser(userId); - maintainCar.setInsdt(CommUtil.nowDate()); - maintainCar.setStatus("待审核"); - int code = this.maintainCarService.save(maintainCar); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(maintainCar); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -// @RequestMapping("/doedit.do") -// public String doedit(HttpServletRequest request,Model model, -// @RequestParam(value = "id") String id){ -// MaintainCar maintainCar = this.maintainCarService.selectById(id); -// -// model.addAttribute("maintainCar", maintainCar); -// return "/maintenance/maintainCarEdit"; -// } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - MaintainCar maintainCar = this.maintainCarService.selectById(id); - - model.addAttribute("maintainCar", maintainCar); - return "/maintenance/maintainCarView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute MaintainCar maintainCar){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - maintainCar.setUpsuser(userId); - maintainCar.setUpsdt(CommUtil.nowDate()); - int code = this.maintainCarService.update(maintainCar); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.maintainCarService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - int count = ids.split(",").length; - ids=ids.replace(",","','"); - int code = this.maintainCarService.deleteByWhere("where id in ('"+ids+"')"); - Result result = new Result(); - if (code == count) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - MaintainCar maintainCar = this.maintainCarService.selectById(id); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - try { - result =this.maintainCarService.startProcess(maintainCar); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+maintainCar.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/showAudit.do") - public String showAuditInStock(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String id= pInstance.getBusinessKey(); - MaintainCar maintainCar = this.maintainCarService.selectById(id); - model.addAttribute("maintainCar", maintainCar); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "/maintenance/maintainCarAudit"; - } - - @RequestMapping("/AuditMaintainCar.do") - public String doAuditInStockRecord(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.maintainCarService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/maintenance/MaintainController.java b/src/com/sipai/controller/maintenance/MaintainController.java deleted file mode 100644 index c4f3f7c1..00000000 --- a/src/com/sipai/controller/maintenance/MaintainController.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.maintenance.Maintain; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.EquipmentPlanService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.maintenance.MaintainService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/maintain") -public class MaintainController { - @Resource - private MaintainService maintainService; - @Resource - private UnitService unitService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request,Model model) { - return "/maintenance/maintainList"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "maintenance/getList.do", cu); - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and companyid='"+request.getParameter("search_code")+"'"; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and problem like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - wherestr += " and unit_id = '"+request.getParameter("unitId")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.maintainService.selectListByWhere(wherestr+orderstr); - //问题发起中补录单问题描述显示 - for (int i = 0; i < list.size(); i++) { - //Maintain maintain = list.get(i); - //String maintenanceProblem = ""; - /*if (maintain.getType().equals(Maintenance.TYPE_SUPPLEMENT)) { - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='"+maintenance.getId()+"' order by insdt asc"); - for (int j = 0; j < maintenanceDetails.size(); j++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - ListbusinessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='"+maintenanceDetails.get(j).getId()+"'"); - for (int k = 0; k < businessUnitHandleDetails.size(); k++) { - if (maintenanceProblem!="") { - maintenanceProblem+=";"+" "; - } - maintenanceProblem+=k+1+"、"+businessUnitHandleDetails.get(k).getProblem(); - } - } - } - maintenance.setProblem(maintenanceProblem); - }*/ - } - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String unitId= request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if(company!=null){ - String jobNumber = company.getEname()+"-BY-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("companyName", company.getSname()); - } - request.setAttribute("id", CommUtil.getUUID()); - return "maintenance/maintainAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Maintain maintain = this.maintainService.selectById(id); - model.addAttribute("maintain",maintain); - - //查询该是什么保养类型 前端调用不同类型的库 - if(maintain!=null){ - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(maintain.getMaintainType()); - if(equipmentPlanType!=null){ - model.addAttribute("equipmentType",equipmentPlanType.getType()); - } - } - - return "maintenance/maintainEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Maintain maintain = this.maintainService.selectById(id); - model.addAttribute("maintain",maintain ); - return "maintenance/maintainView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("maintain") Maintain maintain){ - User cu= (User)request.getSession().getAttribute("cu"); -// maintain.setId(CommUtil.getUUID()); - maintain.setInsdt(CommUtil.nowDate()); - maintain.setInsuser(cu.getId()); - int result = this.maintainService.save(maintain); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("maintain") Maintain maintain){ - int result = this.maintainService.update(maintain); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.maintainService.deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/deletes.do") - public ModelAndView deletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String msg = ""; - int result = this.maintainService.deleteByWhere("where id in('"+ids.replace(",", "','")+"')"); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/maintenance/MaintainPlanController.java b/src/com/sipai/controller/maintenance/MaintainPlanController.java deleted file mode 100644 index 370c0a0b..00000000 --- a/src/com/sipai/controller/maintenance/MaintainPlanController.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSON; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Tree; -import com.sipai.entity.maintenance.MaintainPlan; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.RoleMenu; -import com.sipai.entity.user.User; -import com.sipai.service.maintenance.MaintainPlanService; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.RoleService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/maintenance/maintainPlan") -public class MaintainPlanController { - @Resource - private MaintainPlanService maintainPlanService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "maintenance/maintainPlanList"; - } - /** - * 获取维护商信息列表 - **/ - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and maintaincontent like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and companyid = '"+request.getParameter("search_code")+"' "; - } - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += " and type = '"+request.getParameter("type")+"' "; - } - if(request.getParameter("maintainerId")!=null && !request.getParameter("maintainerId").isEmpty()){ - wherestr += " and maintainerId = '"+request.getParameter("maintainerId")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.maintainPlanService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "maintenance/maintainPlanAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - MaintainPlan maintainPlan = this.maintainPlanService.selectById(id); - model.addAttribute("maintainPlan",maintainPlan ); - return "maintenance/maintainPlanEdit"; - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - MaintainPlan maintainPlan = this.maintainPlanService.selectById(id); - model.addAttribute("maintainPlan",maintainPlan ); - return "maintenance/maintainPlanView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("maintainPlan") MaintainPlan maintainPlan){ - User cu= (User)request.getSession().getAttribute("cu"); - maintainPlan.setId(CommUtil.getUUID()); - maintainPlan.setInsdt(CommUtil.nowDate()); - maintainPlan.setInsuser(cu.getId()); - int result = this.maintainPlanService.save(maintainPlan); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("maintainPlan") MaintainPlan maintainPlan){ - int result = this.maintainPlanService.update(maintainPlan); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.maintainPlanService.deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - @RequestMapping("/deletes.do") - public ModelAndView deletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String msg = ""; - int result = this.maintainPlanService.deleteByWhere("where id in('"+ids.replace(",", "','")+"')"); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/showMaintainPlan4Select.do") - public String showMaintainPlan4Select(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - Company company =unitService.getCompanyByUserId(cu.getId()); - request.setAttribute("maintainerId", company.getId()); - return "maintenance/maintainPlan4Select"; - } - @RequestMapping("/getMaintainPlanTypes.do") - public ModelAndView getMaintainPlanTypes(HttpServletRequest request,Model model) { - JSONArray jsonArray=new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id",MaintainPlan.PlanType_Year); - jsonObject.put("text", MaintainPlan.getPlanTypeName(MaintainPlan.PlanType_Year)); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("id",MaintainPlan.PlanType_Quarter); - jsonObject.put("text", MaintainPlan.getPlanTypeName(MaintainPlan.PlanType_Quarter)); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("id",MaintainPlan.PlanType_Month); - jsonObject.put("text", MaintainPlan.getPlanTypeName(MaintainPlan.PlanType_Month)); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("id",MaintainPlan.PlanType_Week); - jsonObject.put("text", MaintainPlan.getPlanTypeName(MaintainPlan.PlanType_Week)); - jsonArray.add(jsonObject); - model.addAttribute("result",jsonArray.toString()); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/maintenance/MaintainerController.java b/src/com/sipai/controller/maintenance/MaintainerController.java deleted file mode 100644 index 4651dd76..00000000 --- a/src/com/sipai/controller/maintenance/MaintainerController.java +++ /dev/null @@ -1,527 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.maintenance.MaintainerSelectType; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserRole; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.LoginService; -import com.sipai.service.maintenance.MaintainerSelectTypeService; -import com.sipai.service.maintenance.MaintainerService; -import com.sipai.service.maintenance.MaintainerTypeService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/maintenance/maintainer") -public class MaintainerController { - @Resource - private MaintainerService maintainerService; - @Resource - private WorkflowService workflowService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private MaintainerTypeService maintainerTypeService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private MaintainerSelectTypeService maintainerSelectTypeService; - @Resource - private ExtSystemService extSystemService; - /** - * 打开list页面 - **/ - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String userType=unitService.doCheckBizOrNot(cu.getId()); - model.addAttribute("userType",userType); - return "/maintenance/maintainerList"; - } - /** - * 获取维护商信息列表 - **/ - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - String status = request.getParameter("status"); - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - String userType=unitService.doCheckBizOrNot(cu.getId()); - if(CommString.UserType_Maintainer.equals(userType)){ - wherestr=CommUtil.getwherestr("id","",cu); - } - /*if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - }*/ - /*if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += "and id='"+request.getParameter("search_code")+"'"; - }*/ - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and full_name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintainerService.selectListByWhere(wherestr+orderstr); - for (int i = 0; i < list.size(); i++) { - String id = list.get(i).getId(); - String types = ""; - ListmaintainerTypes = this.maintainerSelectTypeService.getMaintainerTypes("where maintainerid = '"+id+"'"); - for (int j = 0; j < maintainerTypes.size(); j++) { - if(types!=""){ - types+=","; - } - types+= maintainerTypes.get(j).getName(); - } - list.get(i).setType(types); - } - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 打开新增维护商界面 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - try { - String ssString=CommUtil.generatePassword(URLEncoder.encode("123456", "utf-8")); - System.out.println(ssString); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return "maintenance/maintainerAdd"; - } - /** - * 打开编辑维护商信息界面 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - Maintainer maintainer = this.maintainerService.selectById(Id); - model.addAttribute("maintainer", maintainer); - ListmaintainerTypes = this.maintainerSelectTypeService.getMaintainerTypes("where maintainerid = '"+Id+"'"); - String result=JSONArray.fromObject(maintainerTypes).toString(); - model.addAttribute("maintainerTypes",result); - model.addAttribute("result", JSONObject.fromObject(maintainer)); - return "maintenance/maintainerEdit"; - } - /** - * 打开可维护厂区配置的编辑界面 - **/ - @RequestMapping("/editCompany.do") - public String editCompany(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId");//厂区id - String maintainerId = request.getParameter("maintainerId");//运维商id - String maintainercompanyid = request.getParameter("maintainercompanyid");//运维商关联厂区的id - MaintainerCompany maintainerCompany = this.maintainerService.selectMaintainerCompanyById(maintainercompanyid); - String contactername=""; - String leadername=""; - if (maintainerCompany != null) { - String contacter = maintainerCompany.getFactorycontacter(); - if (contacter!=null && !contacter.equals("")) { - String[] contacterArr=contacter.split(","); - for (int i = 0; i < contacterArr.length; i++) { - User user = this.userService.getUserById(contacterArr[i]); - if (contactername!="") { - contactername+=","; - } - contactername+=user.getCaption(); - } - } - String leader = maintainerCompany.getMaintainerleader(); - if (leader!=null && !leader.equals("")) { - String[] leaderArr=leader.split(","); - for (int i = 0; i < leaderArr.length; i++) { - User user = this.userService.getUserById(leaderArr[i]); - if (leadername!="") { - leadername+=","; - } - leadername+=user.getCaption(); - } - } - } - model.addAttribute("contactername", contactername); - model.addAttribute("leadername", leadername); - model.addAttribute("maintainerId", maintainerId); - model.addAttribute("companyId", companyId); - model.addAttribute("maintainerCompany", maintainerCompany); - return "maintenance/maintainerCompanyEdit"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - Maintainer maintainer = this.maintainerService.selectById(Id); - model.addAttribute("maintainer", maintainer); - ListmaintainerTypes = this.maintainerSelectTypeService.getMaintainerTypes("where maintainerid = '"+Id+"'"); - String result=""; - if (maintainerTypes!=null && maintainerTypes.size()>0) { - for (int i = 0; i < maintainerTypes.size(); i++) { - if (result!="") { - result+=","; - } - result+=maintainerTypes.get(i).getName(); - } - } - model.addAttribute("maintainerTypes",result); - model.addAttribute("result", JSONObject.fromObject(maintainer)); - return "maintenance/maintainerView"; - } - /** - * 维护商信息保存方法 - **/ - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Maintainer maintainer){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - maintainer.setId(id); - maintainer.setInsuser(cu.getId()); - maintainer.setInsdt(CommUtil.nowDate()); - maintainer.setPid("-1"); - maintainer.setSyncflag(CommString.Sync_Insert); - int result =this.maintainerService.save(maintainer); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 维护商选择类型的保存方法 - **/ - @RequestMapping("/saveMaintainerType.do") - public String dosaveMaintainerType(HttpServletRequest request,Model model, - @RequestParam(value = "typestr") String typestr, - @RequestParam(value = "maintainerid") String maintainerid){ - User cu = (User)request.getSession().getAttribute("cu"); - int result = 0; - String[] typeArr = typestr.split(","); - if (typestr != null && typestr != "" && typeArr.length > 0) { - for (int i = 0; i < typeArr.length; i++) { - MaintainerSelectType maintainerSelectType = new MaintainerSelectType(); - maintainerSelectType.setId(CommUtil.getUUID()); - maintainerSelectType.setInsdt(CommUtil.nowDate()); - maintainerSelectType.setInsuser(cu.getId()); - maintainerSelectType.setMaintainerid(maintainerid); - maintainerSelectType.setMaintainerTypeid(typeArr[i]); - - result+= this.maintainerSelectTypeService.save(maintainerSelectType); - } - } - model.addAttribute("result", result); - return "result"; - } - /** - * 维护商信息更新的方法 - **/ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Maintainer maintainer){ - maintainer.setSyncflag(CommString.Sync_Edit); - int result = this.maintainerService.update(maintainer); - String resstr="{\"res\":\""+result+"\",\"id\":\""+maintainer.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 维护商选择类型更新方法,先删除,再保存 - **/ - @RequestMapping("/updateMaintainerType.do") - public String doupdateMaintainerType(HttpServletRequest request,Model model, - @RequestParam(value = "typestr") String typestr, - @RequestParam(value = "maintainerid") String maintainerid){ - this.maintainerSelectTypeService.deleteByWhere("where maintainerid = '"+maintainerid+"'"); - User cu = (User)request.getSession().getAttribute("cu"); - int result= 0; - String[] typeArr = typestr.split(","); - if (typestr != null && typestr !="" && typeArr.length > 0) { - for (int i = 0; i < typeArr.length; i++) { - MaintainerSelectType maintainerSelectType = new MaintainerSelectType(); - maintainerSelectType.setId(CommUtil.getUUID()); - maintainerSelectType.setInsdt(CommUtil.nowDate()); - maintainerSelectType.setInsuser(cu.getId()); - maintainerSelectType.setMaintainerid(maintainerid); - maintainerSelectType.setMaintainerTypeid(typeArr[i]); - - result+= this.maintainerSelectTypeService.save(maintainerSelectType); - } - } - model.addAttribute("result", result); - return "result"; - } - /** - * 单条数据删除方法 - **/ - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.maintainerService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /** - * 多条数据删除方法 - **/ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.maintainerService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/geList4Select.do") - public String geList4Select(HttpServletRequest request,Model model){ - String type = request.getParameter("type"); - - List maintainers=this.maintainerService.selectListByWhere("where type='"+type+"'"); - JSONArray json=new JSONArray(); - if(maintainers!=null && maintainers.size()>0){ - int i=0; - for (Maintainer maintainer : maintainers) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", maintainer.getId()); - jsonObject.put("text", maintainer.getFullName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - /** - * 根据配置运维商可维护的厂区,筛选出厂区对应的运维商 - * */ - @RequestMapping("/getManageList4Select.do") - public String getManageList4Select(HttpServletRequest request,Model model){ - String type = request.getParameter("type"); - String unitId = request.getParameter("unitId"); - String ids=""; - List maintainers_own=this.maintainerService.getCompanyMaintainer(unitId); - List maintainers_type=this.maintainerSelectTypeService.getMaintainers("where maintainer_typeid='"+type+"'"); - - for (Maintainer maintainer_own : maintainers_own) { - for (Maintainer maintainer_type : maintainers_type) { - if(maintainer_own.getId().equals(maintainer_type.getId())){ - if(!ids.isEmpty()){ - ids+="','"; - } - ids+=maintainer_own.getId(); - } - - } - - } - List maintainers=this.maintainerService.selectListByWhere("where id in ('"+ids+"')"); - JSONArray json=new JSONArray(); - if(maintainers!=null && maintainers.size()>0){ - for (Maintainer maintainer : maintainers) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", maintainer.getId()); - jsonObject.put("text", maintainer.getFullName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - /** - * - * 补录中的选择运维商,根据当前用户的id,以及公司类型选择 - **/ - @RequestMapping("/geMaintainerListForSelect.do") - public String geMaintainerListForSelect(HttpServletRequest request,Model model){ - User cu = (User)request.getSession().getAttribute("cu"); - List companies=this.unitService.getCompanyByUserIdAndType(cu.getId(),CommString.UNIT_TYPE_Maintainer); - JSONArray json=new JSONArray(); - if(companies!=null && companies.size()>0){ - int i=0; - for (Company company : companies) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * - * 根据运维商id,获取问题处理人员 - **/ - @RequestMapping("getUserByMaintainerIdForSelect.do") - public String getUserByMaintainerIdForSelect(HttpServletRequest request,Model model){ - String MaintainerId = request.getParameter("pid"); - List users = this.unitService.getChildrenUsersById(MaintainerId); - JSONArray json = new JSONArray(); - if (users!=null && users.size()>0) { - for (User user : users ) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id",user.getId()); - jsonObject.put("text", user.getCaption()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - /** - * 运维商配置可维护厂区界面 - * @return - */ - @RequestMapping("/showMaintainerCompany.do") - public String showMaintainerCompany(HttpServletRequest request,Model model, - @RequestParam(value="maintainerId") String maintainerId){ - List list = this.maintainerService.getMaintainerCompany(maintainerId); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("json",json); - model.addAttribute("maintainerId",maintainerId); - return "maintenance/maintainerCompany"; - } - /** - * 保存运维商运维的厂区,在列表中多选批量保存 - */ - @RequestMapping("/saveMaintainerCompany.do") - public String updateRoleUser(HttpServletRequest request,Model model, - @RequestParam("maintainerId") String maintainerId, - @RequestParam("companyIds") String companyIds){ - int result = this.maintainerService.saveMaintainerCompany(maintainerId, companyIds); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存运维商运维的厂区,保存单条数据 - */ - @RequestMapping("/insertMaintainerCompany.do") - public String insertMaintainerCompany(HttpServletRequest request,Model model, - @ModelAttribute MaintainerCompany maintainerCompany){ - maintainerCompany.setId(CommUtil.getUUID()); - maintainerCompany.setInsdt(CommUtil.nowDate()); - int result = this.maintainerService.insertMaintainerCompany(maintainerCompany); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/syncMaintainers.do") - public String syncMaintainers(HttpServletRequest request,Model model, - @RequestParam String ids){ - ids=ids.replace(",", "','"); - String wherestr = "where id in ('"+ids+"') and isnull(syncflag,'') !='"+CommString.Sync_Finish+"'" ; - List users = this.unitService.selectListByWhere(wherestr); - String result = JSONArray.fromObject(users).toString(); - String resp = "0"; - // Properties prop = null; - String url = null; - try { - ExtSystem extSystem= this.extSystemService.getActiveDataManage(null); - if(extSystem!=null){ - url=extSystem.getUrl(); - } - url+="/proapp.do?method=syncMaintainersInfo"; - Map map= new HashMap(); - map.put("param", result); - resp = com.sipai.tools.HttpUtil.sendPost(url, map); - JSONArray jsonArray = JSONArray.fromObject(resp); - for (int i=0; i list = this.maintainerTypeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /* - * 打开新增维护商类别界面 - */ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "maintenance/maintainerTypeAdd"; - } - /* - * 打开编辑维护商类别界面 - */ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - MaintainerType maintainerType = this.maintainerTypeService.selectById(Id); - model.addAttribute("maintainerType", maintainerType); - model.addAttribute("result", JSONObject.fromObject(maintainerType)); - return "maintenance/maintainerTypeEdit"; - } - /* - * 维护商类别保存方法 - */ - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute MaintainerType maintainerType){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - maintainerType.setId(id); - maintainerType.setInsuser(cu.getId()); - maintainerType.setInsdt(CommUtil.nowDate()); - - int result =this.maintainerTypeService.save(maintainerType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /* - * 维护商类别更新的方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute MaintainerType maintainerType){ - int result = this.maintainerTypeService.update(maintainerType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+maintainerType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /* - * 单条数据删除方法 - */ - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.maintainerTypeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.maintainerTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/geList4Select.do") - public String geList4Select(HttpServletRequest request,Model model){ - List maintainerTypes=this.maintainerTypeService.selectListByWhere(""); - JSONArray json=new JSONArray(); - if(maintainerTypes!=null && maintainerTypes.size()>0){ - int i=0; - for (MaintainerType maintainerType : maintainerTypes) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", maintainerType.getId()); - jsonObject.put("text", maintainerType.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/maintenance/MaintenanceController.java b/src/com/sipai/controller/maintenance/MaintenanceController.java deleted file mode 100644 index 73787917..00000000 --- a/src/com/sipai/controller/maintenance/MaintenanceController.java +++ /dev/null @@ -1,5642 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.io.IOException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitHandleDetail; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.CompanyMaintenanceResult; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.maintenance.MaintenanceRecord; -import com.sipai.entity.maintenance.StaffMaintenanceResult; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.MaintainerService; -import com.sipai.service.maintenance.MaintainerTypeService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceRecordService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.workorder.WorkorderAchievementService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; - - -@Controller -@RequestMapping("/maintenance") -public class MaintenanceController { - @Resource - private MaintenanceService maintenanceService; - @Resource - private CommonFileService commonFileService; - @Resource - private MaintainerService maintainerService; - @Resource - private MaintainerTypeService maintainerTypeService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowService workflowService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private MaintenanceRecordService maintenanceRecordService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private RuntimeService runtimeService; - @Resource - private AbnormityService abnormityService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private TaskService taskService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private SubscribeService subscribeService; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private WorkorderAchievementService workorderAchievementService; - - /** - * 问题发起列表 - */ - @RequestMapping("/showLaunchList.do") - public String showLaunchlist(HttpServletRequest request, Model model) { - return "/maintenance/maintenanceLaunchList"; - } - - @RequestMapping("/getLaunchList.do") - public ModelAndView getLaunchList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = CommUtil.getwherestr("insuser", "maintenance/getLaunchList.do", cu); - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and companyid='" + request.getParameter("search_code") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and problem like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintenanceService.selectListByWhere(wherestr + orderstr); - //问题发起中补录单问题描述显示 - for (int i = 0; i < list.size(); i++) { - Maintenance maintenance = list.get(i); - String maintenanceProblem = ""; - if (maintenance.getType().equals(Maintenance.TYPE_SUPPLEMENT)) { - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + maintenance.getId() + "' order by insdt asc"); - for (int j = 0; j < maintenanceDetails.size(); j++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + maintenanceDetails.get(j).getId() + "'"); - for (int k = 0; k < businessUnitHandleDetails.size(); k++) { - if (maintenanceProblem != "") { - maintenanceProblem += ";" + " "; - } - maintenanceProblem += k + 1 + "、" + businessUnitHandleDetails.get(k).getProblem(); - } - } - } - maintenance.setProblem(maintenanceProblem); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取问题发起数量 - */ - @RequestMapping("/getLaunchListAmount.do") - public ModelAndView getLaunchListAmount(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String wherestr = CommUtil.getwherestr("insuser", "maintenance/getLaunchList.do", cu); - List list = this.maintenanceService.selectListByWhere(wherestr); - String result = "{\"amount\":" + list.size() + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 添加发起问题 - */ - @RequestMapping("/addProblem.do") - public String addProblem(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "maintenance/maintenanceLaunchAdd"; - } - - @RequestMapping("/editProblem.do") - public String editProblem(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - //model.addAttribute("result", JSONObject.fromObject(maintenance)); - return "maintenance/maintenanceLaunchEdit"; - } - - /** - * 保存发起任务 - */ - @RequestMapping("/saveLaunch.do") - public String saveLaunch(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenance.setInsuser(cu.getId()); - maintenance.setInsdt(CommUtil.nowDate()); - maintenance.setType(Maintenance.TYPE_MAINTENANCE); - int result = this.maintenanceService.save(maintenance); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenance.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存补录维护单 - */ - @RequestMapping("/saveSupplement.do") - public String saveSupplement(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenance.setInsuser(cu.getId()); - maintenance.setInsdt(CommUtil.nowDate()); - maintenance.setType(Maintenance.TYPE_SUPPLEMENT); - int result = this.maintenanceService.save(maintenance); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenance.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 补录编辑 - */ - @RequestMapping("/supplementEdit.do") - public String supplementEdit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - Maintainer maintainer = this.maintainerService.selectById(maintenance.getMaintainerid()); - model.addAttribute("maintainer", maintainer); - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + Id + "' order by insdt asc"); - for (int i = 0; i < maintenanceDetails.size(); i++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + maintenanceDetails.get(i).getId() + "'"); - if (businessUnitHandleDetails != null && businessUnitHandleDetails.size() > 0) { - for (int j = 0; j < businessUnitHandleDetails.size(); j++) { - User user = this.userService.getUserById(businessUnitHandleDetails.get(j).getInsuser()); - businessUnitHandleDetails.get(j).setInsuser(user.getCaption()); - } - } - JSONArray json = JSONArray.fromObject(businessUnitHandleDetails); - model.addAttribute("businessUnitHandleDetails", json); - } - } - //model.addAttribute("maintenanceDetails", maintenanceDetails); - List maintenanceRecords = this.maintenanceRecordService.selectListByWhere("where maintenanceid='" + Id + "' order by insdt asc"); - model.addAttribute("maintenanceRecords", maintenanceRecords); - return "maintenance/maintenanceEdit"; - } - - /** - * 编辑中更新补录维护单 - **/ - @RequestMapping("/updateSupplement.do") - public String doupdateSupplement(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenance.setInsuser(cu.getId()); - maintenance.setInsdt(CommUtil.nowDate()); - maintenance.setType(Maintenance.TYPE_SUPPLEMENT); - int result = this.maintenanceService.updateData(maintenance); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenance.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 列表中直接提交补录维护单 - */ - @RequestMapping("/submitSupplementInList.do") - public String dosubmitSupplementInList(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Maintenance maintenance = this.maintenanceService.selectById(id); - maintenance.setStatus(Maintenance.Status_Finish); - int result = this.maintenanceService.updateData(maintenance); - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + id + "' order by insdt asc"); - for (int i = 0; i < maintenanceDetails.size(); i++) { - MaintenanceDetail maintenanceDetail = maintenanceDetails.get(i); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Finish); - this.maintenanceDetailService.update(maintenanceDetail); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除补录中的维护单 - */ - @RequestMapping("/supplementDelete.do") - public String dosupplementDelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + id + "' order by insdt asc"); - for (int i = 0; i < maintenanceDetails.size(); i++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + maintenanceDetails.get(i).getId() + "'"); - for (int j = 0; j < businessUnitHandleDetails.size(); j++) { - this.businessUnitHandleDetailService.deleteById(businessUnitHandleDetails.get(j).getId()); - } - } - this.maintenanceDetailService.deleteById(maintenanceDetails.get(i).getId()); - } - int result = this.maintenanceService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 编辑页面中删除补录中的问题描述等 - */ - @RequestMapping("/supplementProblemDelete.do") - public String dosupplementProblemDelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.businessUnitHandleDetailService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 问题,解决结果,解决人更新 - **/ - @RequestMapping("/updateProblem.do") - public String doupdateProblem(HttpServletRequest request, Model model, - @RequestParam(value = "maintenanceid") String maintenanceid, - @RequestParam(value = "problems") String problems, - @RequestParam(value = "results") String results, - //@RequestParam(value="resolvers") String resolvers, - @RequestParam(value = "detailSupplements") String detailSupplements, - @RequestParam(value = "processSectionIds") String processSectionIds, - @RequestParam(value = "equipmentIds") String equipmentIds, - @RequestParam(value = "faultLibraryIds") String faultLibraryIds, - @RequestParam(value = "solvetimes") String solvetimes, - @RequestParam(value = "companyid") String companyid, - @RequestParam(value = "maintainerid") String maintainerid) { - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + maintenanceid + "' order by insdt asc"); - for (int i = 0; i < maintenanceDetails.size(); i++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + maintenanceDetails.get(i).getId() + "'"); - for (int j = 0; j < businessUnitHandleDetails.size(); j++) { - this.businessUnitHandleDetailService.deleteById(businessUnitHandleDetails.get(j).getId()); - } - } - this.maintenanceDetailService.deleteById(maintenanceDetails.get(i).getId()); - } - User cu = (User) request.getSession().getAttribute("cu"); - //问题描述 - String[] problemcontentArr = problems.split(","); - //解决结果 - String[] solveresultArr = results.split(","); - //补充内容 - String[] detailSupplementsArr = detailSupplements.split(","); - //工艺段 - String[] processSectionIdsArr = processSectionIds.split(","); - //关联的设备 - String[] equipmentIdsArr = equipmentIds.split("\\."); - //故障类型 - String[] faultLibraryIdsArr = faultLibraryIds.split(","); - //String[] resolverArr= resolvers.split(","); - //解决时间 - String[] solvetimeArr = solvetimes.split(","); - Maintenance maintenance = this.maintenanceService.selectById(maintenanceid); - //保存一条MaintenanceDetail - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - String maintenanceDetailId = CommUtil.getUUID(); - maintenanceDetail.setId(maintenanceDetailId); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setMaintenanceid(maintenanceid); - maintenanceDetail.setCompanyid(companyid); - maintenanceDetail.setInsuser(cu.getId()); - if (maintenance.getStatus().equals(Maintenance.Status_Finish)) { - maintenanceDetail.setStatus(MaintenanceDetail.Status_Finish); - } else { - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - } - maintenanceDetail.setMaintainerid(maintainerid); - maintenanceDetail.setType(Maintenance.TYPE_SUPPLEMENT); - //maintenanceDetail.setProblemcontent(problemcontentArr[i]); - maintenanceDetail.setSolver(cu.getId()); - int result = this.maintenanceDetailService.save(maintenanceDetail); - - //保存多条BusinessUnitHandleDetail - for (int i = 0; i < problemcontentArr.length; i++) { - BusinessUnitHandleDetail businessUnitHandleDetail = new BusinessUnitHandleDetail(); - businessUnitHandleDetail.setId(CommUtil.getUUID()); - businessUnitHandleDetail.setInsdt(CommUtil.nowDate()); - businessUnitHandleDetail.setInsuser(cu.getId()); - businessUnitHandleDetail.setMaintenancedetailid(maintenanceDetailId); - businessUnitHandleDetail.setProblem(problemcontentArr[i]); - if (solveresultArr != null && solveresultArr.length > i) { - businessUnitHandleDetail.setHandledetail(solveresultArr[i]); - } - if (detailSupplementsArr != null && detailSupplementsArr.length > i) { - businessUnitHandleDetail.setDetailsupplement(detailSupplementsArr[i]); - } - if (solvetimeArr != null && solvetimeArr.length > i) { - businessUnitHandleDetail.setHandledt(solvetimeArr[i]); - } - if (processSectionIdsArr != null && processSectionIdsArr.length > i) { - businessUnitHandleDetail.setProcesssectionid(processSectionIdsArr[i]); - } - if (equipmentIdsArr != null && equipmentIdsArr.length > i) { - businessUnitHandleDetail.setEquipmentids(equipmentIdsArr[i]); - } - if (faultLibraryIdsArr != null && faultLibraryIdsArr.length > i) { - businessUnitHandleDetail.setFaultlibraryid(faultLibraryIdsArr[i]); - } - result += this.businessUnitHandleDetailService.save(businessUnitHandleDetail); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 运维主流程查看 - */ - @RequestMapping("/showMaintenanceView.do") - public String showMaintenanceView(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - if (maintenance.getEquipmentIds() != null && !maintenance.getEquipmentIds().isEmpty()) { - Map map = new HashMap(); - map.put("ids", maintenance.getEquipmentIds()); - map.put("bizid", maintenance.getCompanyid()); - String resp = equipmentCardService.getEquipments(map); - JSONObject jsonObject = JSONObject.fromObject(resp); - try { - JSONObject re1 = jsonObject.getJSONObject("re1"); - JSONArray jsonArray = re1.getJSONArray("rows"); - String equipmentName = ""; - for (int i = 0; i < jsonArray.size(); i++) { - if (!equipmentName.isEmpty()) { - equipmentName += ","; - } - equipmentName += jsonArray.getJSONObject(i).getString("equipmentName"); - } - model.addAttribute("equipmentName", equipmentName); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - } - - MaintainerType maintainerType = this.maintainerTypeService.selectById(maintenance.getMaintainertypeid()); - model.addAttribute("maintainerType", maintainerType); - Maintainer maintainer = this.maintainerService.selectById(maintenance.getMaintainerid()); - model.addAttribute("maintainer", maintainer); - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + Id + "' order by insdt asc"); - for (int i = 0; i < maintenanceDetails.size(); i++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - User user = this.userService.getUserById(maintenanceDetails.get(i).getSolver()); - maintenanceDetails.get(i).setSolver(user.getCaption()); - } - } - model.addAttribute("maintenanceDetails", maintenanceDetails); - List maintenanceRecords = this.maintenanceRecordService.selectListByWhere("where maintenanceid='" + Id + "' order by insdt asc"); - model.addAttribute("maintenanceRecords", maintenanceRecords); - return "maintenance/maintenanceView"; - } - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/maintenance/maintenanceList"; - } - - /** - * 补录查看 - */ - @RequestMapping("/showMaintenanceSupplementView.do") - public String showMaintenanceSupplementView(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - Maintainer maintainer = this.maintainerService.selectById(maintenance.getMaintainerid()); - model.addAttribute("maintainer", maintainer); - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + Id + "' order by insdt asc"); - for (int i = 0; i < maintenanceDetails.size(); i++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + maintenanceDetails.get(i).getId() + "'"); - if (businessUnitHandleDetails != null && businessUnitHandleDetails.size() > 0) { - for (int j = 0; j < businessUnitHandleDetails.size(); j++) { - User user = this.userService.getUserById(businessUnitHandleDetails.get(j).getInsuser()); - businessUnitHandleDetails.get(j).setInsuser(user.getCaption()); - } - } - model.addAttribute("businessUnitHandleDetails", businessUnitHandleDetails); - } - } - //model.addAttribute("maintenanceDetails", maintenanceDetails); - List maintenanceRecords = this.maintenanceRecordService.selectListByWhere("where maintenanceid='" + Id + "' order by insdt asc"); - model.addAttribute("maintenanceRecords", maintenanceRecords); - return "maintenance/maintenanceSupplementView"; - } - - /** - * 厂区负责任务tab清单 - */ - @RequestMapping("/showSubListByStatus.do") - public String showSubListByStatus(HttpServletRequest request, Model model) { - String status = request.getParameter("status"); - String result = ""; - switch (status) { - case "0"://待发布 - result = "/maintenance/maintenanceSubList_Submit"; - break; - case "1"://待确认 - result = "/maintenance/maintenanceSubList_Confirm"; - break; - case "2"://维护商确认 - result = "/maintenance/maintenanceSubList_Confirm_maintainer"; - break; - case "3"://维护中 - result = "/maintenance/maintenanceSubList_Handle"; - break; - case "4"://已完成 - result = "/maintenance/maintenanceSubList_Finish"; - break; - default: - break; - } - return result; - } - - @RequestMapping("/getSubListByStatus.do") - public ModelAndView getSubListByStatus(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - String status = request.getParameter("status"); - switch (status) { - case "0"://待发布 - wherestr = CommUtil.getwherestr("companyid", "", cu); - wherestr += " and status in ('" + Maintenance.Status_Cancel_Problem + "','" + Maintenance.Status_Launch + "','" + Maintenance.Status_Cancel_Maintainer + "')"; - break; - case "1"://待确认 - wherestr = CommUtil.getwherestr("companyid", "", cu); - wherestr += " and status in ('" + Maintenance.Status_Submit_Problem + "' ,'" + Maintenance.Status_Confirm_Maintainer + "','" + Maintenance.Status_Submit_Maintainer + - "','" + Maintenance.Status_CancelTOMaintainer + "')"; - break; - case "2"://维护商待确认 - wherestr = CommUtil.getwherestr("maintainerId", null, cu); - wherestr += " and status in ('" + Maintenance.Status_Submit_Problem + "' )"; - break; - case "3"://维护商维护中 - wherestr = CommUtil.getwherestr("maintainerId", null, cu); - wherestr += " and status in ('" + Maintenance.Status_Confirm_Maintainer + "','" + Maintenance.Status_Submit_Maintainer + "','" + Maintenance.Status_CancelTOMaintainer + "','" + Maintenance.Status_Supplementing + "' )"; - break; - case "4"://已完成 - String userType = this.unitService.doCheckBizOrNot(cu.getId()); - String column = "companyid"; - if (CommString.UserType_Maintainer.equals(userType)) { - column = "maintainerId"; - } - wherestr = CommUtil.getwherestr(column, null, cu); - wherestr += " and status in ('" + Maintenance.Status_Finish + "' )"; - break; - default: - break; - } - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and companyid='" + request.getParameter("search_code") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and problem like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintenanceService.selectListByWhere(wherestr + orderstr); - //补录问题显示 - if (status.equals("4") || status.equals("3")) { - for (int i = 0; i < list.size(); i++) { - Maintenance maintenance = list.get(i); - String maintenanceProblem = ""; - if (maintenance.getType().equals(Maintenance.TYPE_SUPPLEMENT)) { - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where maintenanceid='" + maintenance.getId() + "' order by insdt asc"); - for (int j = 0; j < maintenanceDetails.size(); j++) { - if (maintenanceDetails != null && maintenanceDetails.size() > 0) { - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + maintenanceDetails.get(j).getId() + "'"); - for (int k = 0; k < businessUnitHandleDetails.size(); k++) { - if (maintenanceProblem != "") { - maintenanceProblem += ";" + " "; - } - maintenanceProblem += k + 1 + "、" + businessUnitHandleDetails.get(k).getProblem(); - } - } - } - maintenance.setProblem(maintenanceProblem); - } - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getMaintenanceListByEquipmentId.do") - public ModelAndView getMaintenanceListByEquipmentId(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " m.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - String userType = this.unitService.doCheckBizOrNot(cu.getId()); - String column = "companyid"; - if (CommString.UserType_Maintainer.equals(userType)) { - column = "maintainerId"; - } - wherestr = CommUtil.getwherestr(column, null, cu); - String equipmentId = request.getParameter("equipmentId"); - wherestr += " and e.equipmentId='" + equipmentId + "' "; - wherestr += " and m.status in ('" + Maintenance.Status_Finish + "' )"; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and m.problem like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintenanceService.selectListWithEquByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 问题发布操作界面 - */ - @RequestMapping("/submitProblem.do") - public String submitProblem(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - //model.addAttribute("result", JSONObject.fromObject(maintenance)); - return "maintenance/maintenanceSubmitProblem"; - } - - /** - * 运维商确认界面 - */ - @RequestMapping("/handleMaintenance.do") - public String handleMaintenance(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - //model.addAttribute("result", JSONObject.fromObject(maintenance)); - return "maintenance/maintenanceHandleProblem"; - } - - /** - * 运维商完成操作界面 - */ - @RequestMapping("/handleMaintenanceFinish.do") - public String handleMaintenanceFinish(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - /*if(maintenance.getEquipmentIds()!=null && !maintenance.getEquipmentIds().isEmpty()){ - Map map= new HashMap(); - map.put("ids", maintenance.getEquipmentIds()); - map.put("bizid", maintenance.getCompanyid()); - String resp = equipmentCardService.getEquipments(map); - JSONObject jsonObject = JSONObject.fromObject(resp); - try { - JSONObject re1=jsonObject.getJSONObject("re1"); - JSONArray jsonArray =re1.getJSONArray("rows"); - String equipmentName=""; - for (int i=0;i< jsonArray.size();i++) { - if(!equipmentName.isEmpty()){ - equipmentName+=","; - } - equipmentName+=jsonArray.getJSONObject(i).getString("equipmentName"); - } - model.addAttribute("equipmentName",equipmentName); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - }*/ - model.addAttribute("maintenance", maintenance); - return "maintenance/maintenanceHandleFinish"; - } - - /** - * 运维商完成操作界面 - */ - @RequestMapping("/confirmFinish.do") - public String confirmFinish(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - return "maintenance/maintenanceConfirmFinish"; - } - - /** - * 获取问题未完成数量 - */ - @RequestMapping("/getUnfinishAmount.do") - public ModelAndView getUnfinishAmount(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String userType = this.unitService.doCheckBizOrNot(cu.getId()); - String column = "companyid"; - if (CommString.UserType_Maintainer.equals(userType)) { - column = "maintainerId"; - } - String wherestr = CommUtil.getwherestr(column, null, cu); - wherestr += " and status not in ('" + Maintenance.Status_Edit + "','" + Maintenance.Status_Cancel_Maintainer + "','" + Maintenance.Status_Finish + "','" + Maintenance.Status_Launch + "')"; - List list = this.maintenanceService.selectListByWhere(wherestr); - String result = "{\"amount\":" + list.size() + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取维护详细未完成数量 - */ - @RequestMapping("/getUnfinishDetailAmount.do") - public ModelAndView getUnfinishDetailAmount(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - Map map = null; - - /*Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request);*/ - //筛选附件条件,用与variable筛选 - - List list = workflowService.findTodoTasks(userId, null, map); - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - TodoTask todoTask = iterator.next(); - if (!todoTask.getProcessDefinition().getKey().contains(ProcessType.B_Maintenance.getId())) { - iterator.remove(); - } - } - - String result = "{\"amount\":" + list.size() + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and companyid='" + request.getParameter("search_code") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and problem like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintenanceService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "maintenance/maintenanceAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - model.addAttribute("result", JSONObject.fromObject(maintenance)); - return "maintenance/maintenanceEdit"; - } - - /** - * 维护单保存 - **/ - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - if (maintenance.getId() == null) { - maintenance.setId(id); - } - maintenance.setInsuser(cu.getId()); - maintenance.setInsdt(CommUtil.nowDate()); - - int result = this.maintenanceService.save(maintenance); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 评价补录维护单 - */ - @RequestMapping("/showJudgeMaintenceSupplement.do") - public String showJudgeMaintenceSupplement(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Maintenance maintenance = this.maintenanceService.selectById(Id); - model.addAttribute("maintenance", maintenance); - return "maintenance/judgeMaintenanceSupplement"; - } - - /** - * 显示保养详情清单 - */ - @RequestMapping("/showMaintainDetailList.do") - public String showMaintainDetailList(HttpServletRequest request, Model model) { - return "maintenance/maintainDetailList"; - } - - /** - * 评价保养详情 - */ - @RequestMapping("/showJudgeMaintainDetail.do") - public String showJudgeMaintainDetail(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(Id); - model.addAttribute("maintenanceDetail", maintenanceDetail); - return "maintenance/judgeMaintainDetail"; - } - - /** - * 驳回更新 - */ - @RequestMapping("/updateStatus.do") - public String updateStatus(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - Maintenance maintenance = this.maintenanceService.selectById(id); - String status = request.getParameter("status"); - String cancelreason = request.getParameter("cancelreason"); - int result = 0; - if (status != null && !status.isEmpty()) { - maintenance.setStatus(status); - //记录问题驳回人的id - if (status.equals(Maintenance.Status_Cancel_Problem)) { - maintenance.setApplicantid(cu.getId()); - } - //记录问题驳回人的id - if (status.equals(Maintenance.Status_Cancel_Maintainer)) { - maintenance.setManagerid(cu.getId()); - } - - if (cancelreason != null && !cancelreason.isEmpty()) { - maintenance.setCancelreason(cancelreason); - } - - result = this.maintenanceService.update(maintenance); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenance.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 只更新数据,不执行流程 - */ - @RequestMapping("/updateData.do") - public String updateData(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.maintenanceService.updateData(maintenance); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenance.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - int result = 0; - User cu = (User) request.getSession().getAttribute("cu"); - if (maintenance.getStatus() != null && !maintenance.getStatus().isEmpty()) { - switch (maintenance.getStatus()) { - case Maintenance.Status_Submit_Problem: - maintenance.setApplicantid(cu.getId()); - maintenance.setConfirmdt(CommUtil.nowDate()); - maintenance.setCancelreason("");//问题发布时,清空驳回原因 - maintenance.setSubmitproblemdt(CommUtil.nowDate()); - break; - case Maintenance.Status_Confirm_Maintainer: - maintenance.setCancelreason(""); - maintenance.setManagerid(cu.getId()); - maintenance.setMaintainerconfirmdt(CommUtil.nowDate()); - break; - case Maintenance.Status_Submit_Maintainer: - List maintenanceDetails = maintenanceDetailService.selectListByWhere("where maintenanceid='" + maintenance.getId() + "'"); - //若下发任务有未完成,则不能提交 - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (!MaintenanceDetail.Status_Finish.equals(maintenanceDetail.getStatus())) { - String resstr = "{\"res\":\"检测到有下发的任务未完成,请完成任务后重试!\"}"; - model.addAttribute("result", resstr); - return "result"; - } - } - if (maintenance.getResult() == null || maintenance.getResult().isEmpty()) { - maintenance.setResult("已完成"); - } - maintenance.setMaintainerfinishidt(CommUtil.nowDate()); - maintenance.setCancelreason("");//问题发布时,清空驳回原因 - break; - case Maintenance.Status_Finish: - maintenance.setEnddt(CommUtil.nowDate()); - if (maintenance.getJudgemaintainer() == null || maintenance.getJudgemaintainer() == 0) { - maintenance.setJudgemaintainer(5); - } - if (maintenance.getJudgemaintainerstaff() == null || maintenance.getJudgemaintainerstaff() == 0) { - maintenance.setJudgemaintainerstaff(5); - } - if (maintenance.getJudgeresult() == null || maintenance.getJudgeresult() == 0) { - maintenance.setJudgeresult(5); - } - break; - default: - break; - } - result = this.maintenanceService.update(maintenance); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenance.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 检测是否需要作废任务单,若更换运维商需要作废当前任务单 - */ - @RequestMapping("/doCheckCancel.do") - public String doCheckCancel(HttpServletRequest request, Model model, - @ModelAttribute Maintenance maintenance) { - User cu = (User) request.getSession().getAttribute("cu"); - Maintenance maintenance_old = this.maintenanceService.selectById(maintenance.getId()); - boolean result = true; - if (maintenance.getMaintainerid() != null && maintenance_old.getMaintainerid() != null && !maintenance.getMaintainerid().equals(maintenance_old.getMaintainerid())) { - result = false; - } - String resstr = "{\"res\":" + result + "}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/reSendMessage.do") - public String reSendMessage(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Maintenance maintenance = this.maintenanceService.selectById(id); - Map ret = this.maintenanceService.sendMessage(maintenance, "请尽快确认维护信息!"); - String resstr = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 问题,解决结果,解决人保存 - **/ - @RequestMapping("/saveProblem.do") - public String saveProblem(HttpServletRequest request, Model model, - @RequestParam(value = "maintenanceid") String maintenanceid, - @RequestParam(value = "problems") String problems, - @RequestParam(value = "results") String results, - //@RequestParam(value="resolvers") String resolvers, - @RequestParam(value = "detailSupplements") String detailSupplements, - @RequestParam(value = "processSectionIds") String processSectionIds, - @RequestParam(value = "equipmentIds") String equipmentIds, - @RequestParam(value = "faultLibraryIds") String faultLibraryIds, - @RequestParam(value = "solvetimes") String solvetimes, - @RequestParam(value = "companyid") String companyid, - @RequestParam(value = "maintainerid") String maintainerid) { - User cu = (User) request.getSession().getAttribute("cu"); - //问题描述 - String[] problemcontentArr = problems.split(","); - //解决结果 - String[] solveresultArr = results.split(","); - //补充内容 - String[] detailSupplementsArr = detailSupplements.split(","); - //工艺段 - String[] processSectionIdsArr = processSectionIds.split(","); - //关联的设备 - String[] equipmentIdsArr = equipmentIds.split("\\."); - //故障类型 - String[] faultLibraryIdsArr = faultLibraryIds.split(","); - //String[] resolverArr= resolvers.split(","); - //解决时间 - String[] solvetimeArr = solvetimes.split(","); - Maintenance maintenance = this.maintenanceService.selectById(maintenanceid); - //保存一条MaintenanceDetail - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - String maintenanceDetailId = CommUtil.getUUID(); - maintenanceDetail.setId(maintenanceDetailId); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setMaintenanceid(maintenanceid); - maintenanceDetail.setCompanyid(companyid); - maintenanceDetail.setInsuser(cu.getId()); - if (maintenance.getStatus().equals(Maintenance.Status_Finish)) { - maintenanceDetail.setStatus(MaintenanceDetail.Status_Finish); - } else { - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - } - maintenanceDetail.setMaintainerid(maintainerid); - maintenanceDetail.setType(Maintenance.TYPE_SUPPLEMENT); - //maintenanceDetail.setProblemcontent(problemcontentArr[i]); - maintenanceDetail.setSolver(cu.getId()); - int result = this.maintenanceDetailService.save(maintenanceDetail); - - //保存多条BusinessUnitHandleDetail - for (int i = 0; i < problemcontentArr.length; i++) { - BusinessUnitHandleDetail businessUnitHandleDetail = new BusinessUnitHandleDetail(); - businessUnitHandleDetail.setId(CommUtil.getUUID()); - businessUnitHandleDetail.setInsdt(CommUtil.nowDate()); - businessUnitHandleDetail.setInsuser(cu.getId()); - businessUnitHandleDetail.setMaintenancedetailid(maintenanceDetailId); - businessUnitHandleDetail.setProblem(problemcontentArr[i]); - if (solveresultArr != null && solveresultArr.length > i) { - businessUnitHandleDetail.setHandledetail(solveresultArr[i]); - } - if (detailSupplementsArr != null && detailSupplementsArr.length > i) { - businessUnitHandleDetail.setDetailsupplement(detailSupplementsArr[i]); - } - if (solvetimeArr != null && solvetimeArr.length > i) { - businessUnitHandleDetail.setHandledt(solvetimeArr[i]); - } - if (processSectionIdsArr != null && processSectionIdsArr.length > i) { - businessUnitHandleDetail.setProcesssectionid(processSectionIdsArr[i]); - } - if (equipmentIdsArr != null && equipmentIdsArr.length > i) { - businessUnitHandleDetail.setEquipmentids(equipmentIdsArr[i]); - } - if (faultLibraryIdsArr != null && faultLibraryIdsArr.length > i) { - businessUnitHandleDetail.setFaultlibraryid(faultLibraryIdsArr[i]); - } - result += this.businessUnitHandleDetailService.save(businessUnitHandleDetail); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.maintenanceService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.maintenanceService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request, Model model) { - return "/work/groupListForSelect"; - } - - @RequestMapping("/showlistForSelectByGroup.do") - public String showlistForSelectByGroup(HttpServletRequest request, Model model) { - return "/work/groupListForSelectByGroup"; - } - - @RequestMapping("/edit4scheduling.do") - public String edit4scheduling(HttpServletRequest request, Model model) { - String groupid = request.getParameter("id"); - String userids = request.getParameter("userids"); - String workstationids = request.getParameter("workstationids"); - model.addAttribute("groupid", groupid); - model.addAttribute("userids", userids); - model.addAttribute("workstationids", workstationids); - return "/work/groupMemberListForScheduling"; - } - - @RequestMapping("/getMaintenanceMethod4Select.do") - public ModelAndView getMaintenanceMethod4Select(HttpServletRequest request, Model model) { - JSONArray jsonArray = new JSONArray(); - String[] methods = CommString.MaintenanceMethod; - for (String str : methods) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", str); - jsonObject.put("text", str); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return new ModelAndView("result"); - } - - - /** - * 获取某公司所有流程任务列表 - * - * @param leave - */ - @RequestMapping(value = "getCompanyAllTaskList.do") - public ModelAndView getCompanyAllTaskList(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String userType = request.getParameter("userType"); - //当userType为运维商时,以运维商id为查询条件,否则以水厂id为查询条件 - String keyWord = "companyId"; - if (CommString.UserType_Maintainer.equals(userType)) { - keyWord = "maintainerId"; - } - List list = new ArrayList<>(); - //客户运维单统计,剔除补录单 - String wherestr_m = "where " + keyWord + "='" + companyId + "' and insdt >'" + sdt + "' and insdt<='" + edt + - "' and status not in ('" + Maintenance.Status_Cancel + "','" + Maintenance.Status_Finish + "','" + Maintenance.Status_Edit + "') and type <> '" + Maintenance.TYPE_SUPPLEMENT + "'"; - //公司运维单统计,剔除补录单 - String wherestr = "where 1=1 and insdt >'" + sdt + "' and insdt<='" + edt + "' and status <>'" + MaintenanceDetail.Status_Finish + "' and " + keyWord + "='" + companyId + "' and type <> '" + Maintenance.TYPE_SUPPLEMENT + "'"; - - //运维商查询运维水厂的运维任务时需要提供bizid - String bizId = request.getParameter("bizId"); - if (bizId != null && !bizId.equals("")) { - wherestr_m += " and companyid='" + bizId + "' "; - wherestr += " and companyid='" + bizId + "' "; - } - //查询客户运维单 - List maintenances = maintenanceService.selectListByWhere(wherestr_m); - for (Maintenance maintenance : maintenances) { - TodoTask todoTask = this.workflowService.getTodoTask(maintenance); - if (todoTask != null) { - list.add(todoTask); - } - } - //查询公司运维单,运维商任务和保养统计 - List maintenanceDetails = maintenanceDetailService.selectListByWhere(wherestr); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - TodoTask todoTask = this.workflowService.getTodoTask(maintenanceDetail); - if (todoTask != null) { - list.add(todoTask); - } - } - JSONArray json = this.workflowService.todoTasklistToJsonArray(list); - - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - // System.out.println(result); - model.addAttribute("result", result); - - return new ModelAndView("result"); - } - - @RequestMapping(value = "getTaskListAmount.do") - public ModelAndView getTaskListAmount(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - String userId = cu.getId(); - Map map = null; - - /*Page page1 = new Page(PageUtil.PAGE_SIZE); - int[] pageParams = PageUtil.init(page1, request);*/ - //筛选附件条件,用与variable筛选 - - List list = workflowService.findTodoTasks(userId, null, map); - - String result = "{\"total\":" + list.size() + "}"; - // System.out.println(result); - model.addAttribute("result", result); - } else { - String result = "{\"total\":" + 0 + "}"; - model.addAttribute("result", result); - } - return new ModelAndView("result"); - } - - /** - * 缺陷记录 - */ - @RequestMapping("/showMaintenanceDetailList.do") - public String showMaintenanceDetailList(HttpServletRequest request, Model model) { - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - return "/maintenance/maintenanceDetailList"; - } - - /** - * 设备管理日历中查看缺陷列表界面 - */ - @RequestMapping("/showDefectListForView.do") - public String showDefectListForView(HttpServletRequest request, Model model) { - String ids = request.getParameter("ids"); - model.addAttribute("ids", ids); - return "/maintenance/defectListView"; - } - - /** - * 设备管理日历中查看缺陷列表界面根据ids查询 - */ - @RequestMapping("/getDefectList.do") - public ModelAndView getDefectList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String ids = request.getParameter("ids"); - ids = ids.replace(",", "','"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where id in ('" + ids + "')"; - PageHelper.startPage(page, rows); - List list = this.maintenanceDetailService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 问题详情列表 - */ - @RequestMapping("/showMaintenanceDetailList4SubList.do") - public String showMaintenanceDetailList4SubList(HttpServletRequest request, Model model) { - return "/maintenance/maintenanceDetailList4SubList"; - } - - /** - * 设备查询维护单 - */ - @RequestMapping("/showMaintenanceList4Equipment.do") - public String showMaintenanceList4Equipment(HttpServletRequest request, Model model) { - return "/maintenance/maintenanceList4Equipment"; - } - - @RequestMapping("/getMaintenanceDetailList.do") - public ModelAndView getMaintenanceDetailList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " d.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String type = unitService.doCheckBizOrNot(cu.getId()); - if (CommString.UserType_Maintainer.equals(type)) { - wherestr = CommUtil.getwherestr("d.maintainerId", "", cu); - } - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and d.companyid in (" + companyids + ") "; - } - } - - String date1 = request.getParameter("date"); - // 2021.11.30 date - if (request.getParameter("date") != null && !request.getParameter("date").isEmpty()) { - String date = request.getParameter("date").trim(); - wherestr += "and d.insdt >= '" + date.substring(0, date.indexOf('~') - 1) + "' and d.insdt <= '" + date.substring(date.indexOf('~') + 1) + "'"; // >= '2020-06-03 11:00' and insdt <= '2020-06-03 11:10' - } - - - String beginTime = request.getParameter("beginTimeStore"); - String endTime = request.getParameter("endTimeStore"); - if (beginTime != null && !beginTime.isEmpty() && !beginTime.equals("") && endTime != null && !endTime.isEmpty() && !endTime.equals("")) { - if (beginTime.equals(endTime)) { - wherestr += " and datediff(dd, d.insdt,'" + beginTime + "')=0 "; - } else { - wherestr += " and d.insdt>'" + beginTime + "' and d.insdt<'" + endTime + "' "; - } - } - - //System.out.println("wherestr==============="+wherestr); - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and d.problemcontent like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("search_pid") != null && !request.getParameter("search_pid").isEmpty()) { - wherestr += " and d.maintenanceid = '" + request.getParameter("search_pid") + "' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and d.type = '" + request.getParameter("type") + "' "; - } - if (request.getParameter("processSectionId") != null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and d.process_section_id = '" + request.getParameter("processSectionId") + "' "; - } - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and d.equipment_id like '%" + request.getParameter("equipmentId") + "%' "; - } - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += " and d.status = '" + request.getParameter("status") + "' "; - } else { - wherestr += " and d.status != '" + MaintenanceDetail.Status_Finish + "' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and d.insdt >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and d.insdt <= '" + request.getParameter("edt") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.maintenanceDetailService.selectListWithMaintenanceByWhere(wherestr + orderstr); - //列表中的补录问题显示 - /*if(list != null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(list.get(i).getEquipmentId()); - if (equipmentCard != null) { - list.get(i).setEquipmentId(equipmentCard.getEquipmentname()); - } - - FaultLibrary faultLibrary = this.libraryFaultBlocService.selectByFaultId(list.get(i).getProblemtypeid()); - if (faultLibrary != null) { - list.get(i).setProblemtypeid(faultLibrary.getName()); - } - - User user = this.userService.getUserById(list.get(i).getInsuser()); - if (user != null) { - list.get(i).setInsuser(user.getCaption()); - } - - String maintenanceProblem = ""; - if (list.get(i).getType().equals(Maintenance.TYPE_SUPPLEMENT)) { - ListbusinessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='"+list.get(i).getId()+"'"); - if (businessUnitHandleDetails != null && businessUnitHandleDetails.size()>0) { - for (int j = 0; j < businessUnitHandleDetails.size(); j++) { - if (maintenanceProblem!="") { - maintenanceProblem+=";"+" "; - } - maintenanceProblem+=j+1+"、"+businessUnitHandleDetails.get(j).getProblem(); - } - } - list.get(i).setProblemcontent(maintenanceProblem); - } - } - }*/ - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getMaintenanceDetailList4APP.do") - public ModelAndView getMaintenanceDetailList4APP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - - String wherestr = "where 1=1 "; - - /*String beginTime = request.getParameter("beginTimeStore"); - String endTime = request.getParameter("endTimeStore"); - if (beginTime != null && !beginTime.isEmpty() && !beginTime.equals("") && endTime != null && !endTime.isEmpty() && !endTime.equals("")) { - if (beginTime.equals(endTime)) { - wherestr += " and datediff(dd, a.insdt,'" + beginTime + "')=0 "; - } else { - wherestr += " and a.insdt>'" + beginTime + "' and a.insdt<'" + endTime + "' "; - } - }*/ - - //System.out.println("wherestr==============="+wherestr); - /*if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and a.problemcontent like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("search_pid") != null && !request.getParameter("search_pid").isEmpty()) { - wherestr += " and a.maintenanceid = '" + request.getParameter("search_pid") + "' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and a.type = '" + request.getParameter("type") + "' "; - } - if (request.getParameter("processSectionId") != null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and a.process_section_id = '" + request.getParameter("processSectionId") + "' "; - } - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and a.equipment_id like '%" + request.getParameter("equipmentId") + "%' "; - } - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += " and a.status = '" + request.getParameter("status") + "' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and a.insdt >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and a.insdt <= '" + request.getParameter("edt") + "' "; - }*/ - String status = request.getParameter("statusSelectAPP"); - if (status != null && status.equals("1")) {//已完成 - wherestr += " and companyId = '" + unitId + "' and status in ('" + MaintenanceDetail.Status_Finish + "') "; - } else {//处理中 - wherestr += " and companyId = '" + unitId + "' and status!='" + MaintenanceDetail.Status_Finish + "' "; - } - List list = this.maintenanceDetailService.selectSimpleListByWhere(wherestr); - JSONArray json = JSONArray.fromObject(list); -// System.out.println(json); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/showMaintenanceDetailView.do") - public String showMaintenanceDetailView(HttpServletRequest request, Model model) { - String maintenanceDetailId = request.getParameter("id"); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(maintenanceDetailId); - request.setAttribute("maintenanceDetail", maintenanceDetail); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecords.add(businessUnitRecord); - if (maintenanceDetail.getProcessdefid() == null || "".equals(maintenanceDetail.getProcessdefid())) { - businessUnitRecords.get(0).setTaskName("维修任务补录"); - businessUnitRecords.get(0).setRecord("维修任务补录,维修内容为:" + maintenanceDetail.getProblemcontent() + "。"); - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - return "maintenance/maintenanceDetailView"; - } - List workTasks = workflowProcessDefinitionService.getAllPDTask(maintenanceDetail.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = maintenanceDetail.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - /*Maintenance maintenance = this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - model.addAttribute("maintenance", maintenance); - MaintainerType maintainerType = this.maintainerTypeService.selectById(maintenance.getMaintainertypeid()); - model.addAttribute("maintainerType", maintainerType); - Maintainer maintainer = this.maintainerService.selectById(maintenance.getMaintainerid()); - model.addAttribute("maintainer", maintainer);*/ - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(maintenanceDetail.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "maintenance/maintenanceDetailViewInModal"; - } else { - return "maintenance/maintenanceDetailView"; - } - } - - @RequestMapping("/showMaintenanceDetailView4APP.do") - public String showMaintenanceDetailView4APP(HttpServletRequest request, Model model) { - String maintenanceDetailId = request.getParameter("id"); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(maintenanceDetailId); - request.setAttribute("maintenanceDetail", maintenanceDetail); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(maintenanceDetail.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = maintenanceDetail.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - /*Maintenance maintenance = this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - model.addAttribute("maintenance", maintenance); - MaintainerType maintainerType = this.maintainerTypeService.selectById(maintenance.getMaintainertypeid()); - model.addAttribute("maintainerType", maintainerType); - Maintainer maintainer = this.maintainerService.selectById(maintenance.getMaintainerid()); - model.addAttribute("maintainer", maintainer);*/ - //检测流程实例是否结束,结束则历史记录最后节点变化 -// long num =runtimeService.createProcessInstanceQuery().processInstanceId(maintenanceDetail.getProcessid()).count(); -// if(num>0){ -// model.addAttribute("finishFlag", false); -// }else{ -// model.addAttribute("finishFlag", true); -// } -// -// if(request.getParameter("inModal")!=null){ -// //判断显示在流程处理模态框右侧 -// return "maintenance/maintenanceDetailViewInModal"; -// }else{ -// return "maintenance/maintenanceDetailView"; -// } - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 查看保养记录单,根据任务节点id,筛选出维修班,设备办,外包的工作记录 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/viewMaintain.do") - public String doviewMaintain(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(id); - model.addAttribute("mDetail", maintenanceDetail); - List handleDetails = this.businessUnitHandleDetailService.selectListByWhere( - "where maintenanceDetailId = '" + maintenanceDetail.getId() + "' order by insdt asc"); - BusinessUnitHandleDetail equipmentTeam = new BusinessUnitHandleDetail(); - BusinessUnitHandleDetail equipmentOffice = new BusinessUnitHandleDetail(); - BusinessUnitHandleDetail outsource = new BusinessUnitHandleDetail(); - //根据任务节点的id,查询维修班、设备办、外包的处理内容 - for (BusinessUnitHandleDetail handleDetail : handleDetails) { - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(maintenanceDetail.getProcessdefid(), handleDetail.getTaskdefinitionkey()); - String unitId = (String) activityImpl.getProperties().get("documentation"); - switch (unitId) { - case BusinessUnit.UNIT_TEAM_HANDLE://维修班处理 - equipmentTeam = handleDetail; - break; - case BusinessUnit.UNIT_OFFICE_HANDLE://设备办处理 - equipmentOffice = handleDetail; - break; - case BusinessUnit.UNIT_OUTSOURCING_HANDLE://外包处理 - outsource = handleDetail; - break; - default: - break; - } - } - //维修班保养工作记录 - model.addAttribute("equipmentTeam", equipmentTeam); - //设备办保养记录 - model.addAttribute("equipmentOffice", equipmentOffice); - //外包保养工作记录 - model.addAttribute("outsource", outsource); - //**********消耗品 -// List list = this.workorderConsumeService.selectListByWhere("" -// + "where maintenance_detail_id = '"+id+"' " -// + "order by insdt desc"); -// model.addAttribute("workorderConsume", list); -// model.addAttribute("workorderConsumeSize", list.size()); - //**********消耗品 - //根据type的不同,返回维修单和保养单 - if (MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(maintenanceDetail.getType())) { - return "equipment/equipmentMaintainView"; - } else if (MaintenanceCommString.MAINTENANCE_TYPE_REPAIR.equals(maintenanceDetail.getType())) { - return "maintenance/repairDetailView"; - } else { - return "maintenance/defectRecordView"; - } - - } - - @RequestMapping("/getMaintenancePDFTempletHTML.do") - public ModelAndView getMaintenancePDFTempletHTML(HttpServletRequest request, Model model) { - - String maintenanceId = request.getParameter("maintenanceId"); - Maintenance maintenance = maintenanceService.selectById(maintenanceId); - if (maintenance.getMaintenancemethod() == null) { - maintenance.setMaintenancemethod("上门维护"); - } - //补全公司信息 - maintenance.setCompany(unitService.fixCompanyInfo(maintenance.getCompany())); - request.setAttribute("maintenance", maintenance); - List maintenanceDetails = maintenanceDetailService.selectListByWhere("where maintenanceId='" + maintenance.getId() + "'"); - String maintenanceDetailIds = ""; - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (!maintenanceDetailIds.isEmpty()) { - maintenanceDetailIds += ","; - } - maintenanceDetailIds += maintenanceDetail.getId(); - } - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid in ('" + maintenanceDetailIds.replace(",", "','") + "')"); - request.setAttribute("businessUnitHandleDetails", businessUnitHandleDetails); - Set handleUserNames = new HashSet<>(); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handleUserNames.add(businessUnitHandleDetail.getInsuserName()); - } - request.setAttribute("handleUserNames", handleUserNames); - List contacters = this.maintainerService.getCompanyContacters(maintenance.getCompanyid(), maintenance.getMaintainerid()); - request.setAttribute("contacters", contacters); - request.setAttribute("nowDate", CommUtil.nowDate().substring(0, 10)); - - Maintainer maintainer = maintainerService.selectById(maintenance.getMaintainerid()); - request.setAttribute("maintainer", maintainer); - return new ModelAndView("maintenance/maintenancePDFTemplet"); - } - - /** - * 显示只具有操作信息想运维详情 - * 用户客户查看运维具体详情 - */ - @RequestMapping("/showMaintenanceDetailViewOnlyHandleRecords.do") - public String showMaintenanceDetailViewOnlyHandleRecords(HttpServletRequest request, Model model) { - String maintenanceDetailId = request.getParameter("id"); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(maintenanceDetailId); - - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - //客户看不需要显示问题图片 - businessUnitRecord.setFiles(null); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(maintenanceDetail.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = maintenanceDetail.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null || !BusinessUnit.UNIT_HANDLE.equals(task.getDescription())) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - - model.addAttribute("businessUnitRecords", JSONArray.fromObject(businessUnitRecords)); - Maintenance maintenance = this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - model.addAttribute("maintenance", maintenance); - MaintainerType maintainerType = this.maintainerTypeService.selectById(maintenance.getMaintainertypeid()); - model.addAttribute("maintainerType", maintainerType); - Maintainer maintainer = this.maintainerService.selectById(maintenance.getMaintainerid()); - model.addAttribute("maintainer", maintainer); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(maintenanceDetail.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - return "maintenance/maintenanceDetailViewOnlyHandleRecords"; - } - - /** - * 运维详情中补录查看 - **/ - @RequestMapping("/showSupplementMaintenanceDetailView.do") - public String showSupplementMaintenanceDetailView(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(Id); - - Maintenance maintenance = this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - Maintainer maintainer = this.maintainerService.selectById(maintenanceDetail.getMaintainerid()); - List businessUnitHandleDetails = this.businessUnitHandleDetailService.selectListByWhere("where maintenanceDetailId='" + Id + "'"); - if (businessUnitHandleDetails != null && businessUnitHandleDetails.size() > 0) { - for (int i = 0; i < businessUnitHandleDetails.size(); i++) { - User user = this.userService.getUserById(businessUnitHandleDetails.get(i).getInsuser()); - businessUnitHandleDetails.get(i).setInsuser(user.getCaption()); - } - } - model.addAttribute("businessUnitHandleDetails", businessUnitHandleDetails); - model.addAttribute("maintenance", maintenance); - model.addAttribute("maintainer", maintainer); - model.addAttribute("maintenanceDetail", maintenanceDetail); - return "maintenance/supplementMaintenanceDetailView"; - } - - /** - * 添加发起问题-维护 - */ - @RequestMapping("/addDetail.do") - public String addDetail(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - /*List companies = unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_Maintainer); - request.setAttribute("maintainerId", companies.get(0).getId());*/ - - /*String maintenanceId = request.getParameter("maintenanceId"); - if (maintenanceId!=null && !maintenanceId.isEmpty()) { - Maintenance maintenance=maintenanceService.selectById(maintenanceId); - String problem= maintenance.getProblem(); - request.setAttribute("problem", problem); - request.setAttribute("companyId", maintenance.getCompanyid()); - request.setAttribute("maintenanceId", maintenanceId); - User contact = userService.getUserById(maintenance.getApplicantid()); - request.setAttribute("contact", contact); - }*/ - String bizId = request.getParameter("bizId"); - Company company = unitService.getCompById(bizId); - String detailNumber = company.getEname() + "-SBWX-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("detailNumber", detailNumber); - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "maintenance/maintenanceDetailAdd"; - } - - @RequestMapping("/addDetailOrd.do") - public String addDetailOrd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizId = request.getParameter("bizId"); - Company company = unitService.getCompById(bizId); - String detailNumber = company.getEname() + "-SBWX-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("detailNumber", detailNumber); - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "maintenance/maintenanceDetailOrdAdd"; - } - - /** - * 保存发起任务 - */ - @RequestMapping("/saveDetail.do") - public String saveDetail(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceDetail maintenanceDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenanceDetail.setInsuser(cu.getId()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Finish); - maintenanceDetail.setSolver(cu.getId()); - maintenanceDetail.setSubmittime(CommUtil.nowDate()); -// maintenanceDetail.setActualFinishDate(CommUtil.nowDate()); - int result = maintenanceDetailService.save(maintenanceDetail); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/saveDetailord.do") - public String saveDetailord(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceDetail maintenanceDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenanceDetail.setInsuser(cu.getId()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - - maintenanceDetail.setStatus(MaintenanceDetail.Status_Finish); - int result = 0; - try { - result = this.maintenanceDetailService.save(maintenanceDetail); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存发起任务,启动流程 - */ - @RequestMapping("/startDetail.do") - public String startDetail(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceDetail maintenanceDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenanceDetail.setInsuser(cu.getId()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - /*Date nowTime = new Date(); - SimpleDateFormat sdformat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - String dateStr = sdformat.format(nowTime); - maintenanceDetail.setDetailNumber(maintenanceDetail.getType()+"_"+dateStr);*/ - int result = 0; - try { - result = this.maintenanceDetailService.start(maintenanceDetail); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新维护详情数据 - */ - @RequestMapping("/updateDetail.do") - public String updateDetail(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceDetail maintenanceDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - MaintenanceDetail detail = this.maintenanceDetailService.selectById(maintenanceDetail.getId()); - //计划完成日期为空时,要设置为null,否则数据库里会保存1900-01-01 - if (null != detail && null != maintenanceDetail.getPlannedenddt() && maintenanceDetail.getPlannedenddt().isEmpty()) { - maintenanceDetail.setPlannedenddt(null); - } - - if (null != detail && detail.getActualMoney() == null) { -// maintenanceDetail.setActualMoney(new BigDecimal(0)); - } - - int result = 0; - try { -// maintenanceDetail.setSolver(cu.getId()); - result = this.maintenanceDetailService.update(maintenanceDetail); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 添加发起问题-保养 - */ - @RequestMapping("/addMaintainDetail.do") - public String addMaintainDetail(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - String detailNumber = company.getEname() + "-LSBY-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("detailNumber", detailNumber); - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "equipment/equipmentMaintainAdd"; - } - - /** - * 保存发起任务-保养 - */ - @RequestMapping("/saveMaintainDetail.do") - public String saveMaintainDetail(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceDetail maintenanceDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - maintenanceDetail.setInsuser(cu.getId()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setType(Maintenance.TYPE_MAINTAIN); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - int result = 0; - try { - result = this.maintenanceDetailService.save(maintenanceDetail); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deleteDetails.do") - public String deleteDetails(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.maintenanceDetailService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 设备查询维护详情 - */ - @RequestMapping("/showHandleDetailList4Equipment.do") - public String showHandleDetailList4Equipment(HttpServletRequest request, Model model) { - return "/maintenance/businessUnit_HandleDetailList4Equipment"; - } - - @RequestMapping("/getHandleDetailListByEquipmentId.do") - public ModelAndView getHandleDetailListByEquipmentId(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentId = request.getParameter("equipmentId"); - String yearNum = request.getParameter("yearNum"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and problem like '%" + request.getParameter("search_name") + "%' "; - } - wherestr += " and equipmentids like ('%" + equipmentId + "%')"; - wherestr += " and handledt like ('%" + yearNum + "%')"; - PageHelper.startPage(page, rows); - List list = businessUnitHandleDetailService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取某一用户的处理详情 - */ - @RequestMapping("/getHandleDetailList4User.do") - public ModelAndView getHandleDetailList4User(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and insdt > '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and insdt < '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("userId") != null && !request.getParameter("userId").isEmpty()) { - wherestr += " and insuser ='" + request.getParameter("userId") + "' "; - } - - PageHelper.startPage(page, rows); - List list = businessUnitHandleDetailService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 检修记录界面 - */ - @RequestMapping("/showOverHaulRecordList.do") - public String showOverHaulRecordList(HttpServletRequest request, Model model) { - return "/maintenance/overHaulRecordList"; - } - - @RequestMapping("/getOverHaulRecordList.do") - public ModelAndView getOverHaulRecordList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String pSectionId = request.getParameter("pSectionId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where type = '" + MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL + "'"; - if (companyId != null && !companyId.isEmpty()) { - wherestr += " and companyId = '" + companyId + "' "; - } - if (pSectionId != null && !pSectionId.isEmpty()) { - wherestr += " and process_section_id = '" + pSectionId + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.maintenanceDetailService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /* - * 打开新增检修记录界面 - */ - @RequestMapping("/doaddOverHaulRecord.do") - public String doaddOverHaulRecord(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "maintenance/overHaulRecordAdd"; - } - - /** - * 获取故障类型统计结果,用于饼图展示 - */ - @RequestMapping("/getFaultTypeByEquipmentId.do") - public String getFaultTypeByEquipmentId(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentId = request.getParameter("equipmentId"); - String yearNum = request.getParameter("yearNum"); - String wherestr = "where 1=1 "; - String orderstr = " order by insdt"; - wherestr += " and equipmentids like ('%" + equipmentId + "%')"; - wherestr += " and handledt like ('%" + yearNum + "%')"; - List list = businessUnitHandleDetailService.selectListByWhere(wherestr + orderstr); - //其他类异常 - long num_others = 0; - JSONArray jsonArray = new JSONArray(); - List faultLibraries = this.libraryFaultBlocService.selectListByWhere("where active='" + CommString.Active_True + "' and pid='-1' order by morder"); - for (LibraryFaultBloc faultLibrary : faultLibraries) { - JSONObject jsonObject = new JSONObject(); - int num = 0; - for (BusinessUnitHandleDetail businessUnitHandleDetail : list) { - if (businessUnitHandleDetail.getFaultlibraryid() != null && businessUnitHandleDetail.getFaultlibraryid() != "") { - if (businessUnitHandleDetail.getFaultlibraryid().equals(faultLibrary.getId())) { - jsonObject.put("name", faultLibrary.getFaultName()); - num++; - jsonObject.put("value", num); - } - } else { - num_others++; - } - - } - jsonArray.add(jsonObject); - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", "其他类异常"); - jsonObject.put("value", num_others / 2); - jsonArray.add(jsonObject); - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 获取每月故障统计结果,用于柱状图展示 - */ - @RequestMapping("/getFaultNumberByEquipmentId.do") - public String getFaultNumberByEquipmentId(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - String equipmentId = request.getParameter("equipmentId"); - String yearNum = request.getParameter("yearNum"); - String wherestr = "where 1=1 "; - String orderstr = " order by insdt"; - wherestr += " and equipmentids like ('%" + equipmentId + "%')"; - wherestr += " and handledt like ('%" + yearNum + "%')"; - List list = businessUnitHandleDetailService.selectListByWhere(wherestr + orderstr); - //定义每月的次数 - long january = 0, february = 0, march = 0, april = 0, may = 0, june = 0, july = 0, august = 0, september = 0, october = 0, november = 0, december = 0; - //用于统计每月发生故障在哪几天 - String januaryStr = "", februaryStr = "", marchStr = "", aprilStr = "", mayStr = "", juneStr = "", julyStr = "", augustStr = "", septemberStr = "", octoberStr = "", novemberStr = "", decemberStr = ""; - for (BusinessUnitHandleDetail businessUnitHandleDetail : list) { - if (businessUnitHandleDetail.getHandledt() == null) { - continue; - } - //故障出现的月份 - int num_month = Integer.parseInt(businessUnitHandleDetail.getHandledt().substring(5, 7)); - switch (num_month) { - case 1: - january++; - if (januaryStr != "") { - januaryStr += ","; - } - januaryStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 2: - february++; - if (februaryStr != "") { - februaryStr += ","; - } - februaryStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 3: - march++; - if (marchStr != "") { - marchStr += ","; - } - marchStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 4: - april++; - if (aprilStr != "") { - aprilStr += ","; - } - aprilStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 5: - may++; - if (mayStr != "") { - mayStr += ","; - } - mayStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 6: - june++; - if (juneStr != "") { - juneStr += ","; - } - juneStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 7: - july++; - if (julyStr != "") { - julyStr += ","; - } - julyStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 8: - august++; - if (augustStr != "") { - augustStr += ","; - } - augustStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 9: - september++; - if (septemberStr != "") { - septemberStr += ","; - } - septemberStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 10: - october++; - if (octoberStr != "") { - octoberStr += ","; - } - octoberStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 11: - november++; - if (novemberStr != "") { - novemberStr += ","; - } - novemberStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - case 12: - december++; - if (decemberStr != "") { - decemberStr += ","; - } - decemberStr += "
" + businessUnitHandleDetail.getHandledt().substring(0, 10); - break; - default: - break; - } - } - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", "1月"); - jsonObject.put("value", january); - jsonObject.put("timestr", januaryStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "2月"); - jsonObject.put("value", february); - jsonObject.put("timestr", februaryStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "3月"); - jsonObject.put("value", march); - jsonObject.put("timestr", marchStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "4月"); - jsonObject.put("value", april); - jsonObject.put("timestr", aprilStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "5月"); - jsonObject.put("value", may); - jsonObject.put("timestr", mayStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "6月"); - jsonObject.put("value", june); - jsonObject.put("timestr", juneStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "7月"); - jsonObject.put("value", july); - jsonObject.put("timestr", julyStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "8月"); - jsonObject.put("value", august); - jsonObject.put("timestr", augustStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "9月"); - jsonObject.put("value", september); - jsonObject.put("timestr", septemberStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "10月"); - jsonObject.put("value", october); - jsonObject.put("timestr", octoberStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "11月"); - jsonObject.put("value", november); - jsonObject.put("timestr", novemberStr); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "12月"); - jsonObject.put("value", december); - jsonObject.put("timestr", decemberStr); - jsonArray.add(jsonObject); - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 显示任务处理 - */ - @RequestMapping("/showHandleDetail.do") - public String showHandleDetail(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - //List commentString =workflowService.findTaskComments(taskId, processInstanceId); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - - } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(businessUnitHandle.getBusinessid()); - if (maintenanceDetail.getCompanyid() != null && !maintenanceDetail.getCompanyid().isEmpty()) { - model.addAttribute("companyId", maintenanceDetail.getCompanyid()); - } else { - Maintenance maintenance = maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - model.addAttribute("companyId", maintenance.getCompanyid()); - } - List businessUnitHandleDetails = businessUnitHandleDetailService. - selectListByWhere("where maintenancedetailid='" + maintenanceDetail.getId() + "' and taskDefinitionkey='" + businessUnitHandle.getTaskdefinitionkey() + "' order by insdt asc"); - model.addAttribute("businessUnitHandleDetails", JSONArray.fromObject(businessUnitHandleDetails)); - model.addAttribute("maintenanceDetail", maintenanceDetail); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "maintenance/businessUnit_Handle"; - } - - /** - * 显示保养,维修调整界面 - */ - @RequestMapping("/showMaintainAdjust.do") - public String showMaintainAdjust(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(pInstance.getBusinessKey()); - model.addAttribute("maintenanceDetail", maintenanceDetail); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - //根据类型判断,返回保养调整界面和维修调整界面 - if (MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(maintenanceDetail.getType())) { - return "equipment/equipmentMaintainHandle"; - } else { - return "maintenance/maintenanceDetailHandle"; - } - - } - - /** - * 流程流转-保养,维修任务调整后提交审核 - * - * @param request - * @param model - * @param businessUnitHandle - * @return - */ - @RequestMapping("/doHandleAdjust.do") - public String doHandleAdjust(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - - - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(businessUnitHandle.getBusinessid()); - if (maintenanceDetail != null) { - //将多个执行人 update成提交人 - maintenanceDetail.setSolver(cu.getId()); - maintenanceDetailService.update(maintenanceDetail); - } - - maintenanceDetailService.updateStatus(businessUnitHandle.getBusinessid()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示验收意见 - */ - @RequestMapping("/showReceiveOpinion.do") - public String showReceiveOpinion(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(pInstance.getBusinessKey()); - model.addAttribute("maintenanceDetail", maintenanceDetail); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "maintenance/maintenanceDetailReceive"; - } - - - /** - * 显示维护详情下的所有任务处理 - */ - @RequestMapping("/showHandleDetailView.do") - public String showHandleDetailView(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - BusinessUnitHandle businessUnitHandle = this.businessUnitHandleService.selectById(id); - - List businessUnitHandleDetails = businessUnitHandleDetailService. - selectListByWhere("where maintenancedetailid='" + businessUnitHandle.getBusinessid() + "' and taskDefinitionkey='" + businessUnitHandle.getTaskdefinitionkey() + "' order by insdt asc"); - //维修处理详情显示维修费用 - String mDetailId = businessUnitHandleDetails.get(0).getMaintenancedetailid(); - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - if (null != mDetailId && !mDetailId.isEmpty()) { - maintenanceDetail = this.maintenanceDetailService.selectById(mDetailId); - } - model.addAttribute("maintenanceDetail", maintenanceDetail); - model.addAttribute("businessUnitHandleDetails", JSONArray.fromObject(businessUnitHandleDetails)); - return "maintenance/businessUnit_HandleDetailView"; - } - - /** - * 显示任务处理 - */ - @RequestMapping("/showHandleDetailViewById.do") - public String showHandleDetailViewByid(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - - List businessUnitHandleDetails = new ArrayList<>(); - businessUnitHandleDetails.add(businessUnitHandleDetailService.selectById(id)); - - - model.addAttribute("businessUnitHandleDetails", JSONArray.fromObject(businessUnitHandleDetails)); - return "maintenance/businessUnit_HandleDetailView"; - } - - /** - * 保存发起任务 - */ - @RequestMapping("/saveHandleDetail.do") - public String saveHandleDetail(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - User cu = (User) request.getSession().getAttribute("cu"); - String handleDetails = request.getParameter("details"); - JSONArray jsonArray = JSONArray.fromObject(handleDetails); - businessUnitHandle.setStatus(BusinessUnitHandle.Status_HANDLE); - List businessUnitHandleDetails = (List) JSONArray.toList(jsonArray, new BusinessUnitHandleDetail(), new JsonConfig()); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - if (result == 1) { - String maintenanceDetailId = businessUnitHandle.getBusinessid(); - String taskDefinitionKey = businessUnitHandle.getTaskdefinitionkey(); - int res = 0; - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - if (businessUnitHandleDetail.getId() != null && !businessUnitHandleDetail.getId().isEmpty()) { - res += businessUnitHandleDetailService.update(businessUnitHandleDetail); - } else { - businessUnitHandleDetail.setId(CommUtil.getUUID()); - businessUnitHandleDetail.setInsuser(cu.getId()); - businessUnitHandleDetail.setInsdt(CommUtil.nowDate()); - businessUnitHandleDetail.setMaintenancedetailid(maintenanceDetailId); - businessUnitHandleDetail.setTaskdefinitionkey(taskDefinitionKey); - res += businessUnitHandleDetailService.save(businessUnitHandleDetail); - } - } - if (res != businessUnitHandleDetails.size()) { - result = 2; - } - } - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除处理内容 - */ - @RequestMapping("/deleteHandleDetail.do") - public String deleteHandleDetail(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - int result = businessUnitHandleDetailService.deleteById(id); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 - */ - @RequestMapping("/doHandleDetail.do") - public String doHandleDetail(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitHandle.setStatus(BusinessUnitHandle.Status_FINISH); - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - String handleDetails = request.getParameter("details"); - JSONArray jsonArray = JSONArray.fromObject(handleDetails); - List businessUnitHandleDetails = (List) JSONArray.toList(jsonArray, new BusinessUnitHandleDetail(), new JsonConfig()); - String maintenanceDetailId = businessUnitHandle.getBusinessid(); - String taskDefinitionKey = businessUnitHandle.getTaskdefinitionkey(); - int res = 0; - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - if (businessUnitHandleDetail.getId() != null && !businessUnitHandleDetail.getId().isEmpty()) { - res += businessUnitHandleDetailService.update(businessUnitHandleDetail); - } else { - businessUnitHandleDetail.setId(CommUtil.getUUID()); - businessUnitHandleDetail.setInsuser(cu.getId()); - businessUnitHandleDetail.setInsdt(CommUtil.nowDate()); - businessUnitHandleDetail.setMaintenancedetailid(maintenanceDetailId); - businessUnitHandleDetail.setTaskdefinitionkey(taskDefinitionKey); - res += businessUnitHandleDetailService.save(businessUnitHandleDetail); - } - } - if (res != businessUnitHandleDetails.size()) { - result = 2; - } - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - maintenanceDetailService.updateStatus(businessUnitHandle.getBusinessid()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示任务审核 - */ - @RequestMapping("/showAuditDetail.do") - public String showAuditDetail(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String maintenanceDetailId = pInstance.getBusinessKey(); - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(maintenanceDetailId); - model.addAttribute("maintenanceDetail", maintenanceDetail); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecords.add(businessUnitRecord); - List workTasks = workflowProcessDefinitionService.getAllPDTask(pInstance.getProcessDefinitionId(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + pInstance.getBusinessKey() + "' "); - for (BusinessUnitAudit businessUnitAudit_item : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit_item); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - //拼接服务器地址加端口号,显示图片 - String localIp = "http://" + request.getLocalAddr() + ":" + request.getServerPort(); - model.addAttribute("localIp", localIp); - model.addAttribute("businessUnitRecords", businessUnitRecords); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "maintenance/maintenanceDetailAudit"; - } - - /** - * 流程流转 - */ - @RequestMapping("/doAuditDetail.do") - public String doAuditDetail(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - try { - result = this.maintenanceDetailService.doAudit(businessUnitAudit); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取运维统计结果,用于饼图展示 - */ - @RequestMapping("/getMaintenanceDetailResult4Pie.do") - public String getMaintenanceDetailResult4Pie(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - String wherestr = "where 1=1 "; - //管理多个水厂的负责人查看统计结果需要提供bizId - String bizId = request.getParameter("bizId"); - //厂区负责人查看运维商的运维情况和运维商查看水厂的运维情况时提供maintainerid - String maintainerid = request.getParameter("maintainerid"); - if (bizId != null && !bizId.isEmpty()) { - wherestr = " where companyid='" + bizId + "' "; - } else { - String type = unitService.doCheckBizOrNot(cu.getId()); - if (CommString.UserType_Maintainer.equals(type)) { - wherestr = CommUtil.getwherestr("maintainerId", "", cu); - } else { - wherestr = CommUtil.getwherestr("companyId", "", cu); - } - } - if (maintainerid != null && !maintainerid.isEmpty()) { - wherestr += "and maintainerId='" + maintainerid + "' "; - } - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - if (sdt != null && !sdt.isEmpty() && edt != null && !edt.isEmpty()) { - wherestr += " and insdt >'" + sdt + "' and insdt<'" + edt + "'"; - } else { - wherestr += " and insdt >'" + CommUtil.nowDate().substring(0, 4) + "-01-01' "; - } - //运维详情状态 - String status = request.getParameter("status"); - String wherestr_m = ""; - //根据运维详情状态查询运维单 - if (MaintenanceDetail.Status_Finish.equals(status)) { - wherestr_m = wherestr + " and status ='" + Maintenance.Status_Finish + "'"; - } else if (MaintenanceDetail.Status_Start.equals(status)) { - wherestr_m = wherestr + " and status not in ('" + Maintenance.Status_Cancel + "','" + Maintenance.Status_Edit + "','" + Maintenance.Status_Finish + "')"; - } else { - wherestr_m = wherestr; - } - List maintenances = maintenanceService.selectListByWhere(wherestr_m); - - if (status != null && !status.isEmpty()) { - //MaintenanceDetail表示任务执行中的状态中, start状态只代表任务开始,还包括自定义状态,自定义状态未在entity中定义 - if (status.equals(MaintenanceDetail.Status_Start)) { - wherestr += " and status <> '" + MaintenanceDetail.Status_Finish + "'"; - } else { - wherestr += " and status='" + status + "'"; - } - - } - wherestr += " and type <>'" + Maintenance.TYPE_SUPPLEMENT + "' and (maintenanceId is null or maintenanceId='')"; - List maintenanceDetails = maintenanceDetailService.selectListByWhere(wherestr); - //客户发起 - long num_maintenance = 0; - //运维商主动下发任务 - long num_maintenance_ = 0; - //保养 - long num_maintain = 0; - //补录 - long num_supplement = 0; - for (Maintenance maintenance : maintenances) { - switch (maintenance.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_maintenance++; - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement++; - break; - - default: - break; - } - } - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (maintenanceDetail.getType() == null) { - continue; - } - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - /*if(maintenanceDetail.getMaintenanceid()!=null && !maintenanceDetail.getMaintenanceid().isEmpty()){ - num_maintenance++; - }else{ - num_maintenance_++; - }*/ - num_maintenance_++; - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain++; - break; - - default: - break; - } - } - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", "发单"); - jsonObject.put("value", num_maintenance); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "任务"); - jsonObject.put("value", num_maintenance_); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "保养"); - jsonObject.put("value", num_maintain); - jsonArray.add(jsonObject); - if (status == null || status.equals(MaintenanceDetail.Status_Finish)) { - jsonObject = new JSONObject(); - jsonObject.put("name", "补录"); - jsonObject.put("value", num_supplement); - jsonArray.add(jsonObject); - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 显示运维商员工运维结果 - */ - @RequestMapping("/showStaffMaintenanceResultList.do") - public String showStaffMaintenanceResultList(HttpServletRequest request, Model model) { - - return "maintenance/staffMaintenanceResultList"; - } - - /** - * 获取运维员工结果 - */ - @RequestMapping("/getStaffMaintenanceResultList.do") - public String getStaffMaintenanceResultList(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - String wherestr = "where insuser in ('" + userIds + "')"; - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - wherestr += " and insdt >'" + sdt + "' and insdt<='" + edt + "' "; - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere(wherestr); - List staffMaintenanceResults = new ArrayList<>(); - for (User user : users) { - StaffMaintenanceResult staffMaintenanceResult = new StaffMaintenanceResult(); - staffMaintenanceResult.setUserId(user.getId()); - //用户评分 - long judge = 0; - //客户发起 - long num_maintenance = 0; - //运维商直接发单 - long num_task = 0; - //保养 - long num_maintain = 0; - //补录 - long num_supplement = 0; - Iterator iterator = businessUnitHandleDetails.iterator(); - while (iterator.hasNext()) { - BusinessUnitHandleDetail businessUnitHandleDetail = iterator.next(); - //若是循环用户的处理详情,则处理相应数据 - if (user.getId().equals(businessUnitHandleDetail.getInsuser())) { - MaintenanceDetail maintenanceDetail = businessUnitHandleDetail.getMaintenanceDetail(); - - if (maintenanceDetail == null || maintenanceDetail.getType() == null) { - continue; - } - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - if (maintenanceDetail.getMaintenanceid() != null && !maintenanceDetail.getMaintenanceid().isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - if (maintenance != null && maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance++; - judge += maintenance.getJudgemaintainerstaff(); - } - } else { - num_task++; - } - - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain++; - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement++; - break; - - default: - break; - } - iterator.remove(); - } - - } - staffMaintenanceResult.setMaintenanceNum(num_maintenance); - staffMaintenanceResult.setMaintainNum(num_maintain); - staffMaintenanceResult.setSupplementNum(num_supplement); - staffMaintenanceResult.setTaskNum(num_task); - staffMaintenanceResult.setTotalNum(num_maintenance + num_maintain + num_supplement + num_task); - float judgeResult = 0; - if (num_maintenance > 0) { - judgeResult = judge / num_maintenance; - judgeResult = (float) (Math.round(judgeResult * 100)) / 100; - } - staffMaintenanceResult.setJudgeStaff(judgeResult); - staffMaintenanceResults.add(staffMaintenanceResult); - } - Collections.sort(staffMaintenanceResults, new Comparator() { - public int compare(StaffMaintenanceResult o1, StaffMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - model.addAttribute("result", JSONArray.fromObject(staffMaintenanceResults)); - return "result"; - } - - /** - * 显示运维商员工详细运维结果 - */ - @RequestMapping("/showStaffMaintenanceResultView.do") - public String showStaffMaintenanceResultView(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - User user = userService.getUserWithDetailById(userId); - request.setAttribute("user", user); - return "maintenance/staffMaintenanceResultView"; - } - - /** - * 获取运维员工详细结果 - */ - @RequestMapping("/getStaffMaintenanceResultView.do") - public String getStaffMaintenanceResultView(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - String userId = request.getParameter("userId"); - String wherestr = "where insuser ='" + userId + "'"; - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - wherestr += " and insdt >'" + sdt + "' and insdt<='" + edt + "' "; - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere(wherestr); - Iterator iterator = businessUnitHandleDetails.iterator(); - List companyIds = new ArrayList<>(); - while (iterator.hasNext()) { - BusinessUnitHandleDetail businessUnitHandleDetail = iterator.next(); - if (businessUnitHandleDetail.getMaintenanceDetail() != null) { - companyIds.add(businessUnitHandleDetail.getMaintenanceDetail().getCompanyid()); - } else { - //若MaintenanceDetail被删除 ,其BusinessUnitHandleDetail可能未被删除 - iterator.remove(); - } - } - Set set = new HashSet(companyIds); - companyIds.clear(); - companyIds.addAll(set); - companyIds.removeAll(Collections.singleton(null)); - List companyMaintenanceResults = new ArrayList<>(); - for (String companyId : companyIds) { - CompanyMaintenanceResult companyMaintenanceResult = new CompanyMaintenanceResult(); - companyMaintenanceResult.setCompanyId(companyId); - ; - //用户评分 - long judge = 0; - //客户发起 - long num_maintenance = 0; - //运维商直接发单 - long num_task = 0; - //保养 - long num_maintain = 0; - //补录 - long num_supplement = 0; - iterator = businessUnitHandleDetails.iterator(); - while (iterator.hasNext()) { - BusinessUnitHandleDetail businessUnitHandleDetail = iterator.next(); - //若是循环用户的处理详情,则处理相应数据 - if (companyId != null && companyId.equals(businessUnitHandleDetail.getMaintenanceDetail().getCompanyid())) { - MaintenanceDetail maintenanceDetail = businessUnitHandleDetail.getMaintenanceDetail(); - - if (maintenanceDetail.getType() == null) { - continue; - } - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - if (maintenanceDetail.getMaintenanceid() != null && !maintenanceDetail.getMaintenanceid().isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - if (maintenance != null && maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance++; - judge += maintenance.getJudgemaintainerstaff(); - } - } else { - num_task++; - } - - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain++; - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement++; - break; - - default: - break; - } - iterator.remove(); - } - - } - companyMaintenanceResult.setMaintenanceNum(num_maintenance); - companyMaintenanceResult.setMaintainNum(num_maintain); - companyMaintenanceResult.setSupplementNum(num_supplement); - companyMaintenanceResult.setTaskNum(num_task); - companyMaintenanceResult.setTotalNum(num_maintenance + num_maintain + num_supplement + num_task); - float judgeResult = 0; - if (num_maintenance > 0) { - judgeResult = judge / num_maintenance; - judgeResult = (float) (Math.round(judgeResult * 100)) / 100; - } - companyMaintenanceResult.setJudgeStaff(judgeResult); - companyMaintenanceResults.add(companyMaintenanceResult); - } - Collections.sort(companyMaintenanceResults, new Comparator() { - public int compare(CompanyMaintenanceResult o1, CompanyMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - model.addAttribute("result", JSONArray.fromObject(companyMaintenanceResults)); - return "result"; - } - - /** - * 显示运维商员工详细运维结果 - */ - @RequestMapping("/showMaintainerMaintenanceResultChart.do") - public String showBizMaintenanceResultChart(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyid = "-1"; - if (company != null) { - companyid = company.getId(); - } - request.setAttribute("companyid", companyid); - return "maintenance/statisticalchart/maintainerMaintenanceResultChart"; - } - - /** - * 获取运维员工详细结果 - */ - @RequestMapping("/getBizMaintenanceResultChart.do") - public String getBizMaintenanceResultChart(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyid = "-1"; - if (company != null) { - companyid = company.getId(); - } - List users = unitService.getChildrenUsersById(companyid); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - String wherestr = "where insuser in ('" + userIds + "')"; - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - wherestr += " and insdt >'" + sdt + "' and insdt<='" + edt + "' "; - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere(wherestr); - List companyIds = new ArrayList<>(); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - companyIds.add(businessUnitHandleDetail.getMaintenanceDetail().getCompanyid()); - } - Set set = new HashSet(companyIds); - companyIds.clear(); - companyIds.addAll(set); - companyIds.removeAll(Collections.singleton(null)); - List companyMaintenanceResults = new ArrayList<>(); - for (String companyId : companyIds) { - CompanyMaintenanceResult companyMaintenanceResult = new CompanyMaintenanceResult(); - companyMaintenanceResult.setCompanyId(companyId); - ; - //用户评分 - //long judge=0; - //客户发起 - long num_maintenance = 0; - long num_maintenance_all = 0; - //运维商直接发单 - long num_task = 0; - long num_task_all = 0; - //保养 - long num_maintain = 0; - long num_maintain_all = 0; - //补录 - long num_supplement = 0; - long num_supplement_all = 0; - Iterator iterator = businessUnitHandleDetails.iterator(); - while (iterator.hasNext()) { - BusinessUnitHandleDetail businessUnitHandleDetail = iterator.next(); - //若是循环用户的处理详情,则处理相应数据 - /*if(companyId!=null && companyId.equals(businessUnitHandleDetail.getMaintenanceDetail().getCompanyid())&&MaintenanceDetail.Status_Start.equals(businessUnitHandleDetail.getMaintenanceDetail().getStatus())){ - MaintenanceDetail maintenanceDetail =businessUnitHandleDetail.getMaintenanceDetail(); - - if (maintenanceDetail.getType()==null) { - continue; - } - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - if(maintenanceDetail.getMaintenanceid()!=null && !maintenanceDetail.getMaintenanceid().isEmpty()){ - num_maintenance++; - - }else{ - num_task++; - } - - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain++; - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement++; - break; - - default: - break; - } - //iterator.remove(); - }*/ - if (companyId != null && companyId.equals(businessUnitHandleDetail.getMaintenanceDetail().getCompanyid())) { - MaintenanceDetail maintenanceDetail = businessUnitHandleDetail.getMaintenanceDetail(); - - if (maintenanceDetail.getType() == null) { - continue; - } - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - if (maintenanceDetail.getMaintenanceid() != null && !maintenanceDetail.getMaintenanceid().isEmpty()) { - /*Maintenance maintenance =maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - if (maintenance!=null && maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance_all++; - //judge+=maintenance.getJudgemaintainerstaff(); - }*/ - num_maintenance_all++; - if (MaintenanceDetail.Status_Start.equals(businessUnitHandleDetail.getMaintenanceDetail().getStatus())) { - num_maintenance++; - } - - } else { - num_task_all++; - if (MaintenanceDetail.Status_Start.equals(businessUnitHandleDetail.getMaintenanceDetail().getStatus())) { - num_task++; - } - } - - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain_all++; - if (MaintenanceDetail.Status_Start.equals(businessUnitHandleDetail.getMaintenanceDetail().getStatus())) { - num_maintain++; - } - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement_all++; - if (MaintenanceDetail.Status_Start.equals(businessUnitHandleDetail.getMaintenanceDetail().getStatus())) { - num_supplement++; - } - break; - - default: - break; - } - iterator.remove(); - } - // iterator.remove(); - - } - companyMaintenanceResult.setMaintenanceNum(num_maintenance); - companyMaintenanceResult.setMaintainNum(num_maintain); - companyMaintenanceResult.setSupplementNum(num_supplement); - companyMaintenanceResult.setTaskNum(num_task); - companyMaintenanceResult.setTotalNum(num_maintenance_all + num_maintain_all + num_supplement_all + num_task_all); - - companyMaintenanceResult.setMaintenanceNumAll(num_maintenance_all); - companyMaintenanceResult.setMaintainNumAll(num_maintain_all); - companyMaintenanceResult.setSupplementNumAll(num_supplement_all); - companyMaintenanceResult.setTaskNumAll(num_task_all); - - - //float judgeResult=0; - /*if (num_maintenance>0) { - judgeResult=judge/num_maintenance; - judgeResult=(float)(Math.round(judgeResult*100))/100; - } - companyMaintenanceResult.setJudgeStaff(judgeResult);*/ - companyMaintenanceResults.add(companyMaintenanceResult); - } - Collections.sort(companyMaintenanceResults, new Comparator() { - public int compare(CompanyMaintenanceResult o1, CompanyMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - model.addAttribute("result", JSONArray.fromObject(companyMaintenanceResults)); - return "result"; - } - - @RequestMapping("/getMaintainerMaintenanceResultChart.do") - public String getMaintainerMaintenanceResultChart(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - //运维商分厂查看运维情况时,直接传入厂区id - String bizId = request.getParameter("bizId"); - Company company = unitService.getCompanyByUserId(cu.getId()); - String maintainerId = "-1"; - if (company != null) { - maintainerId = company.getId(); - } - String wherestr = "where 1=1"; - List companyIds = new ArrayList<>(); - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - wherestr += " and insdt >'" + sdt + "' and insdt<='" + edt + "' and maintainerId='" + maintainerId + "'"; - List maintenances = maintenanceService.selectListByWhere(wherestr); - //获取非运维单下的任务详情,包括负责人下单和保养 - List maintenanceDetails = maintenanceDetailService.selectListByWhere(wherestr + " and (maintenanceId is null or maintenanceId='')"); - //厂区id不为空时,只统计此厂区的数据,为空时统计运维商所有厂区的数据 - if (bizId != null && !bizId.equals("")) { - companyIds.add(bizId); - } else { - for (Maintenance maintenance : maintenances) { - companyIds.add(maintenance.getCompanyid()); - } - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - companyIds.add(maintenanceDetail.getCompanyid()); - } - } - Set set = new HashSet(companyIds); - companyIds.clear(); - companyIds.addAll(set); - companyIds.removeAll(Collections.singleton(null)); - - List companyMaintenanceResults = new ArrayList<>(); - for (String companyId : companyIds) { - CompanyMaintenanceResult companyMaintenanceResult = new CompanyMaintenanceResult(); - companyMaintenanceResult.setCompanyId(companyId); - ; - //用户评分 - //long judge=0; - //客户发起 - long num_maintenance = 0; - long num_maintenance_all = 0; - //运维商直接发单 - long num_task = 0; - long num_task_all = 0; - //保养 - long num_maintain = 0; - long num_maintain_all = 0; - //补录 - long num_supplement = 0; - long num_supplement_all = 0; - Iterator iterator_m = maintenances.iterator(); - while (iterator_m.hasNext()) { - Maintenance maintenance = iterator_m.next(); - if (companyId.equals(maintenance.getCompanyid())) { - switch (maintenance.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_maintenance_all++; - if (!Maintenance.Status_Cancel.equals(maintenance.getStatus()) && !Maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance++; - } - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement_all++; - break; - - default: - break; - } - iterator_m.remove(); - } - - } - Iterator iterator = maintenanceDetails.iterator(); - while (iterator.hasNext()) { - MaintenanceDetail maintenanceDetail = iterator.next(); - if (companyId.equals(maintenanceDetail.getCompanyid())) { - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_task_all++; - if (MaintenanceDetail.Status_Start.equals(maintenanceDetail.getStatus())) { - num_task++; - } - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain_all++; - if (MaintenanceDetail.Status_Start.equals(maintenanceDetail.getStatus())) { - num_maintain++; - } - break; - default: - break; - } - iterator.remove(); - } - - } - companyMaintenanceResult.setMaintenanceNum(num_maintenance); - companyMaintenanceResult.setMaintainNum(num_maintain); - companyMaintenanceResult.setSupplementNum(num_supplement); - companyMaintenanceResult.setTaskNum(num_task); - - companyMaintenanceResult.setTotalNum(num_maintenance_all + num_maintain_all + num_supplement_all + num_task_all); - - companyMaintenanceResult.setMaintenanceNumAll(num_maintenance_all); - companyMaintenanceResult.setMaintainNumAll(num_maintain_all); - companyMaintenanceResult.setSupplementNumAll(num_supplement_all); - companyMaintenanceResult.setTaskNumAll(num_task_all); - - - //float judgeResult=0; - /*if (num_maintenance>0) { - judgeResult=judge/num_maintenance; - judgeResult=(float)(Math.round(judgeResult*100))/100; - } - companyMaintenanceResult.setJudgeStaff(judgeResult);*/ - companyMaintenanceResults.add(companyMaintenanceResult); - } - Collections.sort(companyMaintenanceResults, new Comparator() { - public int compare(CompanyMaintenanceResult o1, CompanyMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - model.addAttribute("result", JSONArray.fromObject(companyMaintenanceResults)); - return "result"; - } - - /** - * 获取所有运维记录,用于项目展示 - */ - @RequestMapping("/getAllMaintenanceResultChart.do") - public String getAllMaintenanceResultChart(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - List companyIds = new ArrayList<>(); - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String bizIds = request.getParameter("bizIds"); - if (sdt != null && !sdt.isEmpty()) { - wherestr += " and insdt >'" + sdt + "'"; - } - if (edt != null && !edt.isEmpty()) { - wherestr += " and insdt <'" + edt + "'"; - } - List maintenances = maintenanceService.selectListByWhere(wherestr); - //获取非运维单下的任务详情,包括负责人下单和保养 - List maintenanceDetails = maintenanceDetailService.selectListByWhere(wherestr + " and (maintenanceId is null or maintenanceId='')"); - if (bizIds != null && !bizIds.isEmpty()) { - //已经限定厂区id - String[] bizIdArray = bizIds.split(","); - for (String item : bizIdArray) { - if (!item.trim().isEmpty()) { - companyIds.add(item); - } - } - } else { - //未限定厂区 - for (Maintenance maintenance : maintenances) { - companyIds.add(maintenance.getCompanyid()); - } - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - companyIds.add(maintenanceDetail.getCompanyid()); - } - Set set = new HashSet(companyIds); - companyIds.clear(); - companyIds.addAll(set); - companyIds.removeAll(Collections.singleton(null)); - } - - - List companyMaintenanceResults = new ArrayList<>(); - for (String companyId : companyIds) { - CompanyMaintenanceResult companyMaintenanceResult = new CompanyMaintenanceResult(); - companyMaintenanceResult.setCompanyId(companyId); - ; - //用户评分 - //long judge=0; - //客户发起 - long num_maintenance = 0; - long num_maintenance_all = 0; - //运维商直接发单 - long num_task = 0; - long num_task_all = 0; - //保养 - long num_maintain = 0; - long num_maintain_all = 0; - //补录 - long num_supplement = 0; - long num_supplement_all = 0; - Iterator iterator_m = maintenances.iterator(); - while (iterator_m.hasNext()) { - Maintenance maintenance = iterator_m.next(); - if (companyId.equals(maintenance.getCompanyid())) { - switch (maintenance.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_maintenance_all++; - if (!Maintenance.Status_Cancel.equals(maintenance.getStatus()) && !Maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance++; - } - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement_all++; - break; - - default: - break; - } - iterator_m.remove(); - } - - } - Iterator iterator = maintenanceDetails.iterator(); - while (iterator.hasNext()) { - MaintenanceDetail maintenanceDetail = iterator.next(); - if (companyId.equals(maintenanceDetail.getCompanyid())) { - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_task_all++; - if (MaintenanceDetail.Status_Start.equals(maintenanceDetail.getStatus())) { - num_task++; - } - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain_all++; - if (MaintenanceDetail.Status_Start.equals(maintenanceDetail.getStatus())) { - num_maintain++; - } - break; - default: - break; - } - iterator.remove(); - } - - } - companyMaintenanceResult.setMaintenanceNum(num_maintenance); - companyMaintenanceResult.setMaintainNum(num_maintain); - companyMaintenanceResult.setSupplementNum(num_supplement); - companyMaintenanceResult.setTaskNum(num_task); - - companyMaintenanceResult.setTotalNum(num_maintenance_all + num_maintain_all + num_supplement_all + num_task_all); - - companyMaintenanceResult.setMaintenanceNumAll(num_maintenance_all); - companyMaintenanceResult.setMaintainNumAll(num_maintain_all); - companyMaintenanceResult.setSupplementNumAll(num_supplement_all); - companyMaintenanceResult.setTaskNumAll(num_task_all); - - - //float judgeResult=0; - /*if (num_maintenance>0) { - judgeResult=judge/num_maintenance; - judgeResult=(float)(Math.round(judgeResult*100))/100; - } - companyMaintenanceResult.setJudgeStaff(judgeResult);*/ - companyMaintenanceResults.add(companyMaintenanceResult); - } - Collections.sort(companyMaintenanceResults, new Comparator() { - public int compare(CompanyMaintenanceResult o1, CompanyMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - model.addAttribute("result", JSONArray.fromObject(companyMaintenanceResults)); - return "result"; - } - - /** - * 显示运维商按厂区统计运维情况 - */ - @RequestMapping("/showMaintainerMaintenanceResultChartByBiz.do") - public String showMaintainerMaintenanceResultChartByBiz(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyid = "-1"; - if (company != null) { - companyid = company.getId(); - } - request.setAttribute("companyid", companyid); - return "maintenance/statisticalchart/maintainerMaintenanceResultChartByBiz"; - } - - /** - * 显示水厂统计图 - */ - @RequestMapping("/showBizStatisticalChart.do") - public String showBizStatisticalChart(HttpServletRequest request, Model model) { - - return "maintenance/statisticalchart/bizStatisticalChart"; - } - - /** - * 获取水厂任务完成情况结果,用于饼图展示 - */ - @RequestMapping("/getBizTaskCompleteSituation4Pie.do") - public String getBizTaskCompleteSituation4Pie(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - //待发布问题数量 - long num_launch = 0; - //在处理 - long num_handle = 0; - //已完成 - long num_finish = 0; - - String bizId = request.getParameter("bizId"); - String bizIds = request.getParameter("bizIds"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String maintainerid = request.getParameter("maintainerid"); - //客户运维单统计 - String wherestr_m = "where 1=1"; - if (sdt != null && !sdt.isEmpty()) { - wherestr_m += " and insdt >'" + sdt + "' "; - } - if (edt != null && !edt.isEmpty()) { - wherestr_m += " and insdt <'" + edt + "' "; - } - if (bizId != null && !bizId.isEmpty()) { - wherestr_m += "and companyId='" + bizId + "' "; - } - if (bizIds != null && !bizIds.isEmpty()) { - wherestr_m += "and companyId in ('" + bizIds.replace(",", "','") + "') "; - } - if (maintainerid != null && !maintainerid.isEmpty()) { - wherestr_m += "and maintainerId='" + maintainerid + "' "; - } - List maintenances = maintenanceService.selectListByWhere(wherestr_m); - for (Maintenance maintenance : maintenances) { - switch (maintenance.getStatus()) { - case Maintenance.Status_Launch: - num_launch++; - break; - case Maintenance.Status_Finish: - num_finish++; - break; - case Maintenance.Status_Cancel: - case Maintenance.Status_Edit: - break; - default: - num_handle++; - break; - } - } - //运维商任务和保养统计 - - //补录在客户运维单中已存在,客户发单也已存在 - String wherestr = wherestr_m + " and type <>'" + Maintenance.TYPE_SUPPLEMENT + "' and (maintenanceId is null or maintenanceId='')"; - List maintenanceDetails = maintenanceDetailService.selectListByWhere(wherestr); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (MaintenanceDetail.Status_Finish.equals(maintenanceDetail.getStatus())) { - num_finish++; - } else { - num_handle++; - } - } - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", "待发布"); - jsonObject.put("value", num_launch); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "在处理"); - jsonObject.put("value", num_handle); - jsonArray.add(jsonObject); - jsonObject = new JSONObject(); - jsonObject.put("name", "已完成"); - jsonObject.put("value", num_finish); - jsonArray.add(jsonObject); - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 显示用户运维排行榜 - */ - @RequestMapping("/showUserRankingList.do") - public String showUserRankingList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - String wherestr = "where insuser in ('" + userIds + "')"; - //当年下发并完成的 - Calendar calendar = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String sdt = sdf.format(calendar.getTime()).substring(0, 8) + "01"; - calendar.add(Calendar.MONTH, 1); - String edt = sdf.format(calendar.getTime()).substring(0, 8) + "01"; - ; - wherestr += " and insdt >'" + sdt + "' and insdt<='" + edt + "' "; - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere(wherestr); - List staffMaintenanceResults = new ArrayList<>(); - for (User user : users) { - StaffMaintenanceResult staffMaintenanceResult = new StaffMaintenanceResult(); - staffMaintenanceResult.setUserId(user.getId()); - //用户评分 - long judge = 0; - //客户发起 - long num_maintenance = 0; - //运维商直接发单 - long num_task = 0; - //保养 - long num_maintain = 0; - //补录 - long num_supplement = 0; - Iterator iterator = businessUnitHandleDetails.iterator(); - while (iterator.hasNext()) { - BusinessUnitHandleDetail businessUnitHandleDetail = iterator.next(); - //若是循环用户的处理详情,则处理相应数据 - if (user.getId().equals(businessUnitHandleDetail.getInsuser())) { - MaintenanceDetail maintenanceDetail = businessUnitHandleDetail.getMaintenanceDetail(); - - if (maintenanceDetail == null || maintenanceDetail.getType() == null) { - continue; - } - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - if (maintenanceDetail.getMaintenanceid() != null && !maintenanceDetail.getMaintenanceid().isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - if (maintenance != null && maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance++; - judge += maintenance.getJudgemaintainerstaff(); - } - } else { - num_task++; - } - - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain++; - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement++; - break; - - default: - break; - } - iterator.remove(); - } - - } - staffMaintenanceResult.setMaintenanceNum(num_maintenance); - staffMaintenanceResult.setMaintainNum(num_maintain); - staffMaintenanceResult.setSupplementNum(num_supplement); - staffMaintenanceResult.setTaskNum(num_task); - staffMaintenanceResult.setTotalNum(num_maintenance + num_maintain + num_supplement + num_task); - float judgeResult = 0; - if (num_maintenance > 0) { - judgeResult = judge / num_maintenance; - judgeResult = (float) (Math.round(judgeResult * 100)) / 100; - } - staffMaintenanceResult.setJudgeStaff(judgeResult); - staffMaintenanceResults.add(staffMaintenanceResult); - } - Collections.sort(staffMaintenanceResults, new Comparator() { - public int compare(StaffMaintenanceResult o1, StaffMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - model.addAttribute("result", JSONArray.fromObject(staffMaintenanceResults)); - return "maintenance/statisticalchart/userRankingList"; - } - - /** - * 运维商获取运维的客户清单 - */ - @RequestMapping("/getManageCompaniesWithResult.do") - public ModelAndView getManageCompaniesWithResult(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - Company company = unitService.getCompanyByUserId(cu.getId()); - List companines = this.maintainerService.getMaintainerCompany(company.getId()); - - String wherestr = "where 1=1 and maintainerId='" + company.getId() + "'"; - //当年下发并完成的 - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - if (sdt != null && !sdt.isEmpty()) { - wherestr += " and insdt >'" + sdt + "'"; - } - if (edt != null && !edt.isEmpty()) { - wherestr += " and insdt <'" + edt + "'"; - } - List maintenances = maintenanceService.selectListByWhere(wherestr); - //获取非运维单下的任务详情,包括负责人下单和保养 - List maintenanceDetails = maintenanceDetailService.selectListByWhere(wherestr + " and (maintenanceId is null or maintenanceId='')"); - - List companyMaintenanceResults = new ArrayList<>(); - for (Company item : companines) { - CompanyMaintenanceResult companyMaintenanceResult = new CompanyMaintenanceResult(); - companyMaintenanceResult.setCompanyId(item.getId()); - ; - //用户评分 - //long judge=0; - //客户发起 - long num_maintenance = 0; - long num_maintenance_all = 0; - //运维商直接发单 - long num_task = 0; - long num_task_all = 0; - //保养 - long num_maintain = 0; - long num_maintain_all = 0; - //补录 - long num_supplement = 0; - long num_supplement_all = 0; - Iterator iterator_m = maintenances.iterator(); - while (iterator_m.hasNext()) { - Maintenance maintenance = iterator_m.next(); - if (item.getId().equals(maintenance.getCompanyid())) { - switch (maintenance.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_maintenance_all++; - if (!Maintenance.Status_Cancel.equals(maintenance.getStatus()) && !Maintenance.Status_Finish.equals(maintenance.getStatus())) { - num_maintenance++; - } - break; - case Maintenance.TYPE_SUPPLEMENT: - num_supplement_all++; - break; - - default: - break; - } - iterator_m.remove(); - } - - } - Iterator iterator = maintenanceDetails.iterator(); - while (iterator.hasNext()) { - MaintenanceDetail maintenanceDetail = iterator.next(); - if (item.getId().equals(maintenanceDetail.getCompanyid())) { - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - num_task_all++; - if (MaintenanceDetail.Status_Start.equals(maintenanceDetail.getStatus())) { - num_task++; - } - break; - case Maintenance.TYPE_MAINTAIN: - num_maintain_all++; - if (MaintenanceDetail.Status_Start.equals(maintenanceDetail.getStatus())) { - num_maintain++; - } - break; - default: - break; - } - iterator.remove(); - } - - } - companyMaintenanceResult.setMaintenanceNum(num_maintenance); - companyMaintenanceResult.setMaintainNum(num_maintain); - companyMaintenanceResult.setSupplementNum(num_supplement); - companyMaintenanceResult.setTaskNum(num_task); - - companyMaintenanceResult.setTotalNum(num_maintenance_all + num_maintain_all + num_supplement_all + num_task_all); - - companyMaintenanceResult.setMaintenanceNumAll(num_maintenance_all); - companyMaintenanceResult.setMaintainNumAll(num_maintain_all); - companyMaintenanceResult.setSupplementNumAll(num_supplement_all); - companyMaintenanceResult.setTaskNumAll(num_task_all); - - - //float judgeResult=0; - /*if (num_maintenance>0) { - judgeResult=judge/num_maintenance; - judgeResult=(float)(Math.round(judgeResult*100))/100; - } - companyMaintenanceResult.setJudgeStaff(judgeResult);*/ - companyMaintenanceResults.add(companyMaintenanceResult); - } - Collections.sort(companyMaintenanceResults, new Comparator() { - public int compare(CompanyMaintenanceResult o1, CompanyMaintenanceResult o2) { - try { - if (o1.getTotalNum() < o2.getTotalNum()) { - return 1; - } else if (o1.getTotalNum() > o2.getTotalNum()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray json = JSONArray.fromObject(companyMaintenanceResults); - String result = "{\"total\":" + companyMaintenanceResults.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 查询消缺数量 - */ - @RequestMapping("/getDefectNumber.do") - public String getDefectNumber(HttpServletRequest request, Model model) { - - String wherestr = "where d.type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "' and d.status = '" + MaintenanceDetail.Status_Finish + "'"; - - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and d.companyid = '" + request.getParameter("companyId") + "'"; - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and d.process_section_id = '" + request.getParameter("pSectionId") + "' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and d.insdt >'" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and d.insdt <'" + request.getParameter("edt") + "' "; - } - List list = this.maintenanceDetailService.selectListWithMaintenanceByWhere(wherestr + "order by insdt desc"); - String result = "{\"defectNumber\":" + list.size() + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 维修,养护统计,根据maintenanceType区分类型,用于柱状图显示 - * - * @throws ParseException - */ - @RequestMapping("/getMaintenanceNumber.do") - public String getMaintenanceNumber(HttpServletRequest request, Model model) throws ParseException { - //周月年的类型 - String type = request.getParameter("type"); - //维修、养护的类型 - String maintenanceType = request.getParameter("maintenanceType"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - ArrayList numberList = new ArrayList<>(); - ArrayList nameList = new ArrayList<>(); - Calendar cal = Calendar.getInstance(); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String wherestr = "where type = '" + maintenanceType + "'"; - StringBuilder sqlWhere = new StringBuilder(wherestr); - String companyId = ""; - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and companyId = '" + request.getParameter("companyId") + "'"; - companyId = request.getParameter("companyId"); - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and process_section_id = '" + request.getParameter("pSectionId") + "' "; - sqlWhere.append(" and process_section_id = '" + request.getParameter("pSectionId") + "' "); - } - - /* List companyListVar=new ArrayList<>(); - if(!"".equals(companyId) && null!=companyId){ - Company company = unitService.getCompById(companyId); - List companyList = companyEquipmentCardCountService - .findAllCompanyByCompanyId(company); - companyListVar = companyList; - CompanyEquipmentCardCountService.allcompanyList = new ArrayList<>(); - }*/ - - String companyIds = ""; - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - companyIds += " and companyId in (" + companyids + ") "; - } - - //按自定义时间范围统计 - if (type == null || type == "") { - if (sdt != null && !sdt.isEmpty() && edt != null && !edt.isEmpty()) { - //开始日期 - Date sdtDate = sdf.parse(sdt); - cal.setTime(sdtDate); - cal.add(Calendar.DATE, -1); - //结束日期 - Date edtDate = sdf.parse(edt); - //相差天数 - int days = (int) ((edtDate.getTime() - sdtDate.getTime()) / (1000 * 3600 * 24)); - for (int i = 0; i <= days; i++) { - cal.add(Calendar.DATE, 1); - Date calDate = cal.getTime(); - String dateStr = sdf.format(calDate); - - - List list = this.maintenanceDetailService.selectListByWhere(sqlWhere.toString() - + companyIds - + " and convert(varchar(10),insdt,20) = '" + dateStr + "'"); - nameList.add(dateStr.substring(5, 10).replace("-", ".")); - numberList.add(list.size()); - - - } - } - } - //本周异常统计 - if (("week").equals(type)) { - //上周日的日期 - cal.set(Calendar.DAY_OF_WEEK, 1); - for (int i = 0; i < 7; i++) { - cal.add(Calendar.DATE, 1); - Date week = cal.getTime(); - String weekDate = sdf.format(week); - - List list = this.maintenanceDetailService.selectListByWhere(sqlWhere.toString() - + companyIds - + " and convert(varchar(10),insdt,20) = '" + weekDate + "'"); - switch (i) { - case 0: - nameList.add("周一"); - numberList.add(list.size()); - break; - case 1: - nameList.add("周二"); - numberList.add(list.size()); - break; - case 2: - nameList.add("周三"); - numberList.add(list.size()); - break; - case 3: - nameList.add("周四"); - numberList.add(list.size()); - break; - case 4: - nameList.add("周五"); - numberList.add(list.size()); - break; - case 5: - nameList.add("周六"); - numberList.add(list.size()); - break; - case 6: - nameList.add("周日"); - numberList.add(list.size()); - break; - default: - break; - } - - - } - - } - //本月异常统计 - if (("month").equals(type)) { - // 获取前月的第一天 - cal.set(Calendar.DAY_OF_MONTH, 0); - //计算本月有多少天 - Calendar a = Calendar.getInstance(); - a.set(Calendar.DATE, 1);//把日期设置为当月第一天 - a.roll(Calendar.DATE, -1);//日期回滚一天,也就是最后一天 - int maxDate = a.get(Calendar.DATE); - for (int i = 0; i < maxDate; i++) { - cal.add(Calendar.DATE, 1); - Date month = cal.getTime(); - String monthDate = sdf.format(month); - - - List list = this.maintenanceDetailService.selectListByWhere(sqlWhere - + companyIds - + " and convert(varchar(10),insdt,20) = '" + monthDate + "'"); - nameList.add(monthDate.substring(5, 10).replace("-", ".")); - numberList.add(list.size()); - - - } - - } - //本年异常统计 - if (("year").equals(type)) { - Date date = new Date(); - for (int i = 1; i < 13; i++) { - String nowYear = sdf.format(date).substring(0, 4); - String monthName = ""; - if (String.valueOf(i).length() == 1) { - nowYear += "-0" + i; - monthName = nowYear.substring(6, 7) + "月"; - } else { - nowYear += "-" + i; - monthName = nowYear.substring(5, 7) + "月"; - } - - - List list = this.maintenanceDetailService.selectListByWhere(sqlWhere - + companyIds - + " and CONVERT(varchar(7),insdt,120) = '" + nowYear + "'"); - nameList.add(monthName); - numberList.add(list.size()); - - - } - } - String result = "{\"number\":" + JSONArray.fromObject(numberList) + ",\"name\":" + JSONArray.fromObject(nameList) + "}"; - //System.out.println(result); - model.addAttribute("result", result); - return "result"; - } - - /** - * 设备管理日历统计设备缺陷和异常的数量和日期 - */ - @RequestMapping("/getAllList.do") - public ModelAndView getAllList(HttpServletRequest request, Model model) { - ArrayList maintenanceList = new ArrayList<>(); - Map dateMap = new HashMap(); - - ArrayList abnormalList = new ArrayList<>(); - Map abnormalDateMap = new HashMap(); - String companyId = request.getParameter("companyId"); - String orderstr = " order by insdt desc"; - //公共查询条件 - String commWhere = " where 1=1"; - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - commWhere += " and insdt >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - commWhere += " and insdt <= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - commWhere += " and process_section_id = '" + request.getParameter("pSectionId") + "' "; - } - - - //缺陷查询条件 - String detailWhere = "and type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "' "; - - StringBuilder sqlDetailWhere = new StringBuilder(detailWhere); - /* - if(companyId!=null && !companyId.isEmpty()){ - detailWhere += " and companyId = '"+companyId+"' "; - }*/ - - - String companyIds = ""; - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - String abnormalbizIds = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - companyIds += " and companyId in (" + companyids + ") "; - abnormalbizIds += " and biz_id in (" + companyids + ") "; - } - - /* List companyListVar=new ArrayList<>(); - if(!"".equals(companyId) && null!=companyId){ - Company company = unitService.getCompById(companyId); - List companyList = companyEquipmentCardCountService - .findAllCompanyByCompanyId(company); - companyListVar = companyList; - CompanyEquipmentCardCountService.allcompanyList = new ArrayList<>(); - }*/ - - // List maintenanceDetails=null; - //for(Company companyVar :companyListVar){ - //缺陷统计 - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere(commWhere - + sqlDetailWhere.toString() - + companyIds - + orderstr); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (dateMap.containsKey(maintenanceDetail.getInsdt().substring(0, 10))) { - int val = ((dateMap.get(maintenanceDetail.getInsdt().substring(0, 10))) + 1); - dateMap.put(maintenanceDetail.getInsdt().substring(0, 10), val); - } else { - dateMap.put(maintenanceDetail.getInsdt().substring(0, 10), 1); - } - } - //} - - - for (java.util.Map.Entry fa : dateMap.entrySet()) { - Map maintenanceMap = new HashMap(); - maintenanceMap.put("sdt", fa.getKey()); - maintenanceMap.put("number", String.valueOf(fa.getValue())); - String maintenanceIds = ""; - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if (fa.getKey().equals(maintenanceDetail.getInsdt().substring(0, 10))) { - if (maintenanceIds != "") { - maintenanceIds += ","; - } - maintenanceIds += maintenanceDetail.getId(); - } - } - maintenanceMap.put("ids", maintenanceIds); - maintenanceList.add(maintenanceMap); - } - - //异常查询条件 - /*String abnormalWhere = " "; - if(companyId!=null && !companyId.isEmpty()){ - abnormalWhere += " and biz_id = '"+companyId+"' "; - }*/ - - - List abnormities = null; - //for(Company companyVar :companyListVar){ - //异常统计 - abnormities = this.abnormityService.selectListByWhere(commWhere + abnormalbizIds + orderstr); - for (Abnormity abnormity : abnormities) { - if (abnormalDateMap.containsKey(abnormity.getInsdt().substring(0, 10))) { - int val = ((abnormalDateMap.get(abnormity.getInsdt().substring(0, 10))) + 1); - abnormalDateMap.put(abnormity.getInsdt().substring(0, 10), val); - } else { - abnormalDateMap.put(abnormity.getInsdt().substring(0, 10), 1); - } - } - //} - - for (java.util.Map.Entry fa : abnormalDateMap.entrySet()) { - Map abnormalMap = new HashMap(); - abnormalMap.put("sdt", fa.getKey()); - abnormalMap.put("number", String.valueOf(fa.getValue())); - String abnormalIds = ""; - for (Abnormity abnormity : abnormities) { - if (fa.getKey().equals(abnormity.getInsdt().substring(0, 10))) { - if (abnormalIds != "") { - abnormalIds += ","; - } - abnormalIds += abnormity.getId(); - } - } - abnormalMap.put("ids", abnormalIds); - abnormalList.add(abnormalMap); - } - - String result = "{\"maintenanceList\":" + JSONArray.fromObject(maintenanceList) + ",\"abnormalList\":" + JSONArray.fromObject(abnormalList) + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * APP调用接口,获取异常和各状态的缺陷记录 - */ - @RequestMapping("/getMaintainceList4APP.do") - public ModelAndView getMaintainceList4APP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " a.insdt "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " desc "; - } - String result = ""; - String orderstr = " order by " + sort + " " + order; - try { - String wherestr = "where 1=1 "; - String type = unitService.doCheckBizOrNot(cu.getId()); - if (CommString.UserType_Maintainer.equals(type)) { - wherestr = CommUtil.getwherestr("a.maintainerId", "", cu); - } - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and a.companyid in (" + companyids + ") "; - } - - } - - - String beginTime = request.getParameter("beginTimeStore"); - String endTime = request.getParameter("endTimeStore"); - if (beginTime != null && !beginTime.isEmpty() && !beginTime.equals("") && endTime != null && !endTime.isEmpty() && !endTime.equals("")) { - if (beginTime.equals(endTime)) { - wherestr += " and datediff(dd, a.insdt,'" + beginTime + "')=0 "; - } else { - wherestr += " and a.insdt>'" + beginTime + "' and a.insdt<'" + endTime + "' "; - } - } - - //System.out.println("wherestr==============="+wherestr); - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and a.problemcontent like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("search_pid") != null && !request.getParameter("search_pid").isEmpty()) { - wherestr += " and a.maintenanceid = '" + request.getParameter("search_pid") + "' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and a.type = '" + request.getParameter("type") + "' "; - } - if (request.getParameter("processSectionId") != null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and a.process_section_id = '" + request.getParameter("processSectionId") + "' "; - } - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and a.equipment_id like '%" + request.getParameter("equipmentId") + "%' "; - } - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += " and a.status = '" + request.getParameter("status") + "' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and a.insdt >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and a.insdt <= '" + request.getParameter("edt") + "' "; - } - - PageHelper.startPage(pages, pagesize); - List finishList = this.maintenanceDetailService.selectListByWhere20200831(wherestr + orderstr); - JSONArray jsonMFinish = JSONArray.fromObject(finishList); - PageInfo pi = new PageInfo(jsonMFinish); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + jsonMFinish + "}"; - - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * APP调用接口显示任务处理 - */ - @RequestMapping("/showHandleDetail4APP.do") - public ModelAndView showHandleDetail4APP(HttpServletRequest request, Model model) { - String result = ""; - try { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - } - JSONArray json1 = JSONArray.fromObject(businessUnitHandle); - - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json1 + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * APP调用接口,用缺陷id返回异常图片的masterId - */ - @RequestMapping("/getMastId4APP.do") - public ModelAndView getMastId4APP(HttpServletRequest request, Model model) { - String result = ""; - try { - List list = new ArrayList(); - List abnormities = this.planRecordAbnormityService - .selectListByRepairId(request.getParameter("maintenanceDetailId")); - if (abnormities != null && abnormities.size() > 0) { - //异常找图片 - for (Abnormity abnormity : abnormities) { - list.addAll(this.commonFileService - .selectListByTableAWhere(request.getParameter("tbName"), "where masterid='" + abnormity.getId() + "'")); - } - } else { - //缺陷找图片 - list = this.commonFileService - .selectListByTableAWhere(request.getParameter("tbName"), "where masterid='" + request.getParameter("maintenanceDetailId") + "'"); - } - JSONArray json = JSONArray.fromObject(list); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * APP调用接口,通过缺陷id返回执行提交内容 - */ - @RequestMapping("/getHandleContent4APP.do") - public ModelAndView getHandleContent4APP(HttpServletRequest request, Model model) { - String result = ""; - try { - //内容 - String id = request.getParameter("id");//缺陷或工艺调整id - //MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(id); - List list = businessUnitHandleService.selectListByWhere("where businessid='" + id + "' order by insdt desc"); - if (null != list && !list.isEmpty() && list.size() > 0) { - //待处理目前手持端只考虑最新handle - List businessUnitHandleDetails = businessUnitHandleDetailService - .selectListByWhere("where maintenancedetailid='" + list.get(0).getBusinessid() + "' and taskDefinitionkey='" + list.get(0).getTaskdefinitionkey() + "' order by insdt asc"); - JSONArray json = JSONArray.fromObject(businessUnitHandleDetails); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + ",\"businessUnitHandleId\":\"" + list.get(0).getId() + "\"}"; - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - - } catch (Exception e) { - e.printStackTrace(); - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 缺陷工单列表 - */ - @RequestMapping("/showDefectList.do") - public String showDefectList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - return "/maintenance/defectRecordList"; - } - - /** - * 缺陷工单列表 -- 用于嵌入app - */ - @RequestMapping("/showDefectListApp.do") - public String showDefectListApp(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - request.setAttribute("unitId", request.getParameter("unitId")); - return "/maintenance/defectRecordListApp"; - } - - /** - * 缺陷记录列表 - */ - @RequestMapping("/showDefectEndList.do") - public String showDefectEndList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - return "/maintenance/defectEndRecordList"; - } - - /** - * 新增缺陷 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/addDefect.do") - public String doaddDefect(HttpServletRequest request, Model model) { - String bizId = request.getParameter("bizId"); - Company company = unitService.getCompById(bizId); - String detailNumber = company.getEname() + "-QXJL-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("detailNumber", detailNumber); - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_DEFECT); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "maintenance/defectRecordAdd"; - } - - /** - * 新增缺陷 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/addEndDefect.do") - public String doaddEndDefect(HttpServletRequest request, Model model) { - String bizId = request.getParameter("bizId"); - Company company = unitService.getCompById(bizId); - String detailNumber = company.getEname() + "-QXJL-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("detailNumber", detailNumber); - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_DEFECT); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "maintenance/defectEndRecordAdd"; - } - - /** - * 显示缺陷任务审核 - */ - @RequestMapping("/showDefectAudit.do") - public String showDefectAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String maintenanceDetailId = pInstance.getBusinessKey(); - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(maintenanceDetailId); - model.addAttribute("maintenanceDetail", maintenanceDetail); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecords.add(businessUnitRecord); - List workTasks = workflowProcessDefinitionService.getAllPDTask(pInstance.getProcessDefinitionId(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + pInstance.getBusinessKey() + "' "); - for (BusinessUnitAudit businessUnitAudit_item : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit_item); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - //拼接服务器地址加端口号,显示图片 - String localIp = "http://" + request.getLocalAddr() + ":" + request.getServerPort(); - model.addAttribute("localIp", localIp); - model.addAttribute("businessUnitRecords", businessUnitRecords); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "maintenance/defectRecordAudit"; - } - - /** - * 显示保养,维修调整界面 - */ - @RequestMapping("/showDefectAdjust.do") - public String showDefectAdjust(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(pInstance.getBusinessKey()); - model.addAttribute("maintenanceDetail", maintenanceDetail); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - model.addAttribute("nowTime", CommUtil.nowDate().substring(0, 19)); - //根据类型判断,返回保养调整界面和维修调整界面 - if (MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(maintenanceDetail.getType())) { - return "equipment/equipmentMaintainHandle"; - } else { - return "maintenance/defectRecordHandle"; - } - - } - - @RequestMapping("/showDefectAdjust4APP.do") - public String showDefectAdjust4APP(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("taskName", task.getName()); -// model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if (userIds != null && !userIds.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')"); - String targetUsersName = ""; - for (User user : users) { - if (!targetUsersName.isEmpty()) { - targetUsersName += ","; - } - targetUsersName += user.getCaption(); - } - jsonObject.put("targetUsersName", targetUsersName); -// model.addAttribute("targetUsersName", targetUsersName); - } - JSONObject jsonObject1 = JSONObject.fromObject(businessUnitHandle); -// model.addAttribute("businessUnitHandle", businessUnitHandle); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(pInstance.getBusinessKey()); - JSONObject jsonObject2 = JSONObject.fromObject(maintenanceDetail); - model.addAttribute("maintenanceDetail", maintenanceDetail); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - jsonObject.put("showTargetUsersFlag", true); -// model.addAttribute("showTargetUsersFlag", true); - } else { - jsonObject.put("showTargetUsersFlag", false); -// model.addAttribute("showTargetUsersFlag", false); - } - JSONArray jsonArray = new JSONArray(); - jsonArray.add(jsonObject); - jsonArray.add(jsonObject1); - jsonArray.add(jsonObject2); - request.setAttribute("result", jsonArray); - return "result"; - - } - - /** - * 显示任务审核 - */ - @RequestMapping("/showEquipmentMaintainAudit.do") - public String showEquipmentMaintainAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String maintenanceDetailId = pInstance.getBusinessKey(); - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(maintenanceDetailId); - model.addAttribute("maintenanceDetail", maintenanceDetail); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecords.add(businessUnitRecord); - List workTasks = workflowProcessDefinitionService.getAllPDTask(pInstance.getProcessDefinitionId(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='" + maintenanceDetailId + "' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + pInstance.getBusinessKey() + "' "); - for (BusinessUnitAudit businessUnitAudit_item : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit_item); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - //拼接服务器地址加端口号,显示图片 - String localIp = "http://" + request.getLocalAddr() + ":" + request.getServerPort(); - model.addAttribute("localIp", localIp); - model.addAttribute("businessUnitRecords", businessUnitRecords); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "equipment/equipmentMaintainAudit"; - } - - /** - * 导出excel表(单个详情) - * - * @throws IOException - */ - @RequestMapping(value = "downloadListExcel.do") - public void downloadListExcel(HttpServletRequest request, - HttpServletResponse response, Model model, String ids) throws IOException { - List mdList = null; - if (null == ids || "".equals(ids)) { - mdList = this.maintenanceDetailService.selectListByWhere("where 1=1 "); - } else { - String[] id = ids.split(","); - String detailIdS = ""; - for (String s : id) { - detailIdS += "'" + s + "',"; - } - detailIdS = detailIdS.substring(0, detailIdS.length() - 1); - mdList = this.maintenanceDetailService.selectListByWhere("where id in" + "(" + detailIdS + ")"); - } - //导出文件到指定目录,兼容Linux - this.maintenanceDetailService.downloadListExcel(response, mdList); - //return null; - } - - /** - * 导出excel表(单个详情) - * - * @throws IOException - */ - @RequestMapping(value = "downloadExcel.do") - public void downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model, String ids) throws IOException { - List mdList = null; - if (null == ids || "".equals(ids)) { - mdList = this.maintenanceDetailService.selectListByWhere("where 1=1 "); - } else { - ids = ids.substring(0, ids.length() - 1); - mdList = this.maintenanceDetailService.selectListByWhere("where id in" + "(" + ids + ")"); - } - //导出文件到指定目录,兼容Linux - this.maintenanceDetailService.downloadExcel(response, mdList); - //return null; - } - - - /** - * 维修统计 - */ - @RequestMapping("/repairStatistics.do") - public String repairStatistics(HttpServletRequest request, Model model) { - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt.substring(0, 4) + ""); - return "/maintenance/repairStatistics"; - } - - /** - * 获取设备故障趋势图数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRepairData.do") - public ModelAndView getRepairData(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); - String dateType = request.getParameter("dateType");//0为查询月 1为年 - String selectDate = request.getParameter("selectDate");//查询的日期 - String type = request.getParameter("type");//type - - //页面右上角饼图数据 - JSONArray jsonArray = new JSONArray(); - if (dateType != null && !dateType.equals("")) { - if (dateType.equals("0")) {//查询月 - if (selectDate != null) { - int year = Integer.parseInt(selectDate.substring(0, 4).toString()); - int month = Integer.parseInt(selectDate.substring(5, 7).toString()); - int maxDaysByDate = CommUtil.getDaysByYearMonth(year, month); - for (int i = 0; i < maxDaysByDate; i++) { - JSONObject jsonObject = new JSONObject(); - String wherestr = " where 1=1 and companyId='" + bizid + "' and type='" + type + "' "; - String time = selectDate + "-" + (i + 1); - wherestr += " and datediff(dd,insdt,'" + time + "')=0 "; - List list = maintenanceDetailService.selectListByWhere(wherestr); - if (list != null && list.size() > 0) { - jsonObject.put("count", list.size()); - } else { - jsonObject.put("count", 0); - } - jsonArray.add(jsonObject); - list = null; - } - } - } - if (dateType.equals("1")) {//查询年 - if (selectDate != null) { - for (int i = 0; i < 12; i++) { - JSONObject jsonObject = new JSONObject(); - String wherestr = " where 1=1 and companyId='" + bizid + "' and type='" + type + "' "; - String time = selectDate + "-" + (i + 1) + "-01"; - wherestr += " and datediff(month,insdt,'" + time + "')=0 "; - List list = maintenanceDetailService.selectListByWhere(wherestr); - if (list != null && list.size() > 0) { - jsonObject.put("count", list.size()); - } else { - jsonObject.put("count", 0); - } - jsonArray.add(jsonObject); - list = null; - } - } - } - } - request.setAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - /** - * 获取设备风险图数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRepairRatio.do") - public ModelAndView getRepairRatio(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); - String dateType = request.getParameter("dateType");//0为查询月 1为年 - String selectDate = request.getParameter("selectDate");//查询的日期 - - String wherestr = " where 1=1 and m.type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "'"; - if (bizid != null && !bizid.equals("")) { - wherestr += " and m.companyId = '" + bizid + "' "; - } - if (dateType != null && !dateType.equals("")) { - if (dateType.equals("0")) {//查询月 - wherestr += " and DateDiff(mm,m.insdt,'" + selectDate + "-01')=0"; - } - if (dateType.equals("1")) {//查询年 - wherestr += " and DateDiff(yy,m.insdt,'" + selectDate + "-01-01')=0"; - } - } - JSONArray jsonArray = maintenanceDetailService.getRepairCount4Class(wherestr); - request.setAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - - /** - * 获取工单列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getWorkList.do") - public ModelAndView getWorkList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("bizid"); - String dateType = request.getParameter("dateType"); - String selectDate = request.getParameter("selectDate"); - if (sort == null || sort.equals("id")) { - sort = " d.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String type = unitService.doCheckBizOrNot(cu.getId()); - if (CommString.UserType_Maintainer.equals(type)) { - wherestr = CommUtil.getwherestr("d.maintainerId", "", cu); - } - //养护检修页面传的是 search_code 递归至所有节点 - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and d.companyid in (" + companyids + ") "; - } - } - - if (request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()) { - wherestr += " and d.companyid = '" + request.getParameter("bizid") + "' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and d.type = '" + request.getParameter("type") + "' "; - } - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and d.equipment_id like '%" + request.getParameter("equipmentId") + "%' "; - } - if (dateType != null && !dateType.equals("")) { - if (dateType.equals("0")) {//查询月 - wherestr += " and DateDiff(mm,d.insdt,'" + selectDate + "-01')=0"; - } - if (dateType.equals("1")) {//查询年 - wherestr += " and DateDiff(yy,d.insdt,'" + selectDate + "-01-01')=0"; - } - } - - PageHelper.startPage(page, rows); - List list = this.maintenanceDetailService.selectListWithMaintenanceByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备风险排名列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRankList.do") - public ModelAndView getRankList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("bizid"); - String dateType = request.getParameter("dateType"); - String selectDate = request.getParameter("selectDate"); - String className = request.getParameter("className"); - - String wherestr = "where 1=1 and m.type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "'"; - if (bizid != null && !bizid.equals("")) { - wherestr += " and m.companyId = '" + bizid + "' "; - } - if (dateType != null && !dateType.equals("")) { - if (dateType.equals("0")) {//查询月 - wherestr += " and DateDiff(mm,m.insdt,'" + selectDate + "-01')=0"; - } - if (dateType.equals("1")) {//查询年 - wherestr += " and DateDiff(yy,m.insdt,'" + selectDate + "-01-01')=0"; - } - } - /*if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and d.companyid in ("+companyids+") "; - } - }*/ - - //为右上角饼图点击触发刷新下面的列表 - if (className != null && !className.equals("")) { - EquipmentClass equipmentClass = equipmentClassService.selectByWhere("where name = '" + className + "' and pid = '-1'"); - if (equipmentClass != null) { - wherestr += " and t.id = '" + equipmentClass.getId() + "' "; - } - } - - PageHelper.startPage(page, rows); - List list = this.maintenanceDetailService.getRepairCount4Equipment(wherestr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 根据设备id获取指定条件的维修列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Equipment.do") - public String showList4Equipment(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - return "maintenance/maintenanceDetailList4Equipment"; - - } - - /** - * 根据设备id获取指定条件的维修列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getList4Equipment.do") - public ModelAndView getList4Equipment(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "equipmentId") String equipmentId, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "selectDate") String selectDate) { - - String orderstr = " order by insdt desc"; - String wherestr = "where 1=1 and type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "'"; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and companyId = '" + unitId + "' "; - } - if (dateType != null && !dateType.equals("")) { - if (dateType.equals("0")) {//查询月 - wherestr += " and DateDiff(mm,insdt,'" + selectDate + "-01')=0"; - } - if (dateType.equals("1")) {//查询年 - wherestr += " and DateDiff(yy,insdt,'" + selectDate + "-01-01')=0"; - } - } - if (equipmentId != null && !equipmentId.equals("")) { - wherestr += " and equipment_id = '" + equipmentId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.maintenanceDetailService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 养护维修分析 - */ - @RequestMapping("/maintenanceAndRepairAnalysis.do") - public String maintenanceAndRepairAnalysis(HttpServletRequest request, Model model) { - request.setAttribute("type", MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt.substring(0, 4) + ""); - return "/maintenance/maintenanceAndRepairAnalysis"; - } - - /** - * 获取任务完成率 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMaintenanceFinishRate.do") - public ModelAndView getMaintenanceFinishRate(HttpServletRequest request, Model model) { - String dateType = request.getParameter("dateType");//0为查询月 1为年 - String selectDate = request.getParameter("selectDate");//查询的日期 - String wherestr = " where 1=1 "; - if (request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("bizid")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and d.companyid in (" + companyids + ") "; - } - } - - if (dateType != null && !dateType.equals("")) { - if (dateType.equals("0")) {//查询月 - wherestr += " and DateDiff(mm,d.insdt,'" + selectDate + "-01')=0"; - } - if (dateType.equals("1")) {//查询年 - wherestr += " and DateDiff(yy,d.insdt,'" + selectDate + "-01-01')=0"; - } - } - - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and d.type = '" + request.getParameter("type") + "' "; - } - String wherestr1 = wherestr + " and d.status = '1' "; - String wherestr2 = wherestr + " and d.status != '1' "; - List list1 = this.maintenanceDetailService.selectListWithMaintenanceByWhere(wherestr1); - List list2 = this.maintenanceDetailService.selectListWithMaintenanceByWhere(wherestr2); - - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("name", "未完成任务"); - jsonObject1.put("value", list2.size()); - jsonArray.add(jsonObject1); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("name", "已完成任务"); - jsonObject2.put("value", list1.size()); - jsonArray.add(jsonObject2); - - request.setAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - /** - * 获取人员与工时 - * - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getWorkersAndWorkHours.do") - public ModelAndView getWorkersAndWorkHours(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String dateType = request.getParameter("dateType");//0为查询月 1为年 - String selectDate = request.getParameter("selectDate");//查询的日期 - String wherestr = " where 1=1 "; - - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("bizid")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and pid in ("+companyids+") "; - } - } - - wherestr+=" order by id asc"; - PageHelper.startPage(page, rows); - List list = this.userService.selectListByWhere(wherestr); - for (User user : list) { - //user.set_workhours("12"); - } - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - //人员巡检完成情况统计界面 - @RequestMapping("/showFinishData.do") - public String showFinishData(HttpServletRequest request, Model model) { - return "maintenance/maintenanceViewFinishData"; - } - - //获取人员巡检完成情况统计数据 - @RequestMapping("/getFinishData.do") - public ModelAndView getFinishData(HttpServletRequest request, Model model) { - String dateType = request.getParameter("dateType");//0 1 - String selectDate = request.getParameter("selectDate"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type");//区分保养和维修 - - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - - String wheres = "where 1=1 "; - String wherestr = "where 1=1 "; - if (unitId != null && !unitId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(unitId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wheres += "and pid in (" + companyids + ") "; - wherestr += "and companyId in (" + companyids + ")"; - } - } - - if (type != null && !type.equals("")) { - wherestr += "and type = '" + type + "'"; - } - - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - List users = userService.selectListByWhere(wheres); - if (users != null && users.size() > 0) { - for (int i = 0; i < users.size(); i++) { - JSONObject jsonObject = new JSONObject(); - //人名 - jsonObject.put("userName", users.get(i).getCaption()); - - //查询指定参数的工单数 - if (type != null && !type.equals("")) { - String whereuser = wherestr + " and DateDiff(" + dateTypeStr + ",insdt,'" + selectDate + "')=0 and solver = '" + users.get(i).getId() + "' and status = '" + MaintenanceDetail.Status_Finish + "' "; - List list = maintenanceDetailService.selectListByWhere(whereuser); - int workinghours = 0; - int finishNum = 0; - if (list != null && list.size() > 0) { - for (int j = 0; j < list.size(); j++) { - workinghours += list.get(j).getWorkinghours(); - } - finishNum = list.size(); - } - jsonObject.put("workinghours", workinghours); - jsonObject.put("finishNum", finishNum); - jsonObject.put("allNum", "-"); - } - - - if (type == null || type.equals("")) { - int allnum = 0; - //维修数 - String whereuser = wherestr + " and DateDiff(" + dateTypeStr + ",insdt,'" + selectDate + "')=0 and solver = '" + users.get(i).getId() + "' and status = '" + MaintenanceDetail.Status_Finish + "' " - + " and type = '" + MaintenanceCommString.MAINTENANCE_TYPE_REPAIR + "'"; - List listrepair = maintenanceDetailService.selectListByWhere(whereuser); - if (listrepair != null && listrepair.size() > 0) { - jsonObject.put("repairNum", listrepair.size()); - allnum += listrepair.size(); - } else { - jsonObject.put("repairNum", 0); - } - //保养数 - whereuser = wherestr + " and DateDiff(" + dateTypeStr + ",insdt,'" + selectDate + "')=0 and solver = '" + users.get(i).getId() + "' and status = '" + MaintenanceDetail.Status_Finish + "' " - + " and type = '" + MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN + "'"; - List listmain = maintenanceDetailService.selectListByWhere(whereuser); - if (listmain != null && listmain.size() > 0) { - jsonObject.put("mainNum", listmain.size()); - allnum += listmain.size(); - } else { - jsonObject.put("mainNum", 0); - } - jsonObject.put("finishNum", allnum); - } - jsonArray.add(jsonObject); - } - } - - //按工单完成数排序 - List list = com.alibaba.fastjson.JSONArray.parseArray(jsonArray.toJSONString(), JSONObject.class); - Collections.sort(list, new Comparator() { - @Override - public int compare(JSONObject o1, JSONObject o2) { - int a = o1.getInt("finishNum"); - int b = o2.getInt("finishNum"); - if (a < b) { - return 1; - } else if (a == b) { - return 0; - } else - return -1; - } - }); - com.alibaba.fastjson.JSONArray jsonArray2 = com.alibaba.fastjson.JSONArray.parseArray(list.toString()); - - int total = 0; - if (users != null && users.size() > 0) { - total = users.size(); - } - String result = "{\"total\":" + total + ",\"rows\":" + jsonArray2 + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/doview_defect.do") - public String doview_defect(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String qxCount = request.getParameter("qxCount"); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(id); - model.addAttribute("maintenanceDetail", maintenanceDetail); - model.addAttribute("qxCount", qxCount); - return "maintenance/defectRecordView"; - } -} diff --git a/src/com/sipai/controller/maintenance/MaintenanceEquipmentConfigController.java b/src/com/sipai/controller/maintenance/MaintenanceEquipmentConfigController.java deleted file mode 100644 index d09dcbfa..00000000 --- a/src/com/sipai/controller/maintenance/MaintenanceEquipmentConfigController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.controller.maintenance; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.MaintenanceEquipmentConfig; -import com.sipai.service.maintenance.MaintenanceEquipmentConfigService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/maintenance/maintenanceEquipmentConfig") -public class MaintenanceEquipmentConfigController { - @Resource - private MaintenanceEquipmentConfigService maintenanceEquipmentConfigService; - - @RequestMapping("/showlist.do") - public String showCollection(HttpServletRequest request, Model model) { - return "/maintenance/maintenanceEquipmentConfigList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { -// if(sort==null){ -// sort = " insdt "; -// } -// if(order==null){ -// order = " desc "; -// } - String orderstr=" order by cycle "; - - String wherestr = " where 1=1 "; - - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and equipment_id = '" + request.getParameter("equipmentId") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.maintenanceEquipmentConfigService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String id = CommUtil.getUUID(); - model.addAttribute("id", id); - return "maintenance/maintenanceEquipmentConfigAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - int result = this.maintenanceEquipmentConfigService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.maintenanceEquipmentConfigService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceEquipmentConfig maintenanceEquipmentConfig) { - int result = maintenanceEquipmentConfigService.save(maintenanceEquipmentConfig); - String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceEquipmentConfig.getId() + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - model.addAttribute("id", id); - return "maintenance/maintenanceEquipmentConfigView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - MaintenanceEquipmentConfig maintenanceEquipmentConfig = this.maintenanceEquipmentConfigService.selectById(id); - model.addAttribute("maintenanceEquipmentConfig", maintenanceEquipmentConfig); - return "maintenance/maintenanceEquipmentConfigEdit"; - } - - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute MaintenanceEquipmentConfig maintenanceEquipmentConfig) { - int result = this.maintenanceEquipmentConfigService.update(maintenanceEquipmentConfig); - String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + maintenanceEquipmentConfig.getId() + "\"}"; - model.addAttribute("result", resultstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/maintenance/RepairCarController.java b/src/com/sipai/controller/maintenance/RepairCarController.java deleted file mode 100644 index 3a024b69..00000000 --- a/src/com/sipai/controller/maintenance/RepairCarController.java +++ /dev/null @@ -1,249 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.RepairCar; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.maintenance.LibraryMaintainCarService; -import com.sipai.service.maintenance.RepairCarService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/repairCar") -public class RepairCarController { - @Resource - private RepairCarService repairCarService; - @Resource - private LibraryMaintainCarService libraryMaintainCarService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - - @RequestMapping("/showRepairCarList.do") - public String showRepairCarList(HttpServletRequest request,Model model){ - return "/maintenance/repairCarList"; - } - - @RequestMapping("/getlist.do") - public String getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "unitId") String unitId) { -// String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; -// if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { -// wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; -// } -// if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; -// } - wherestr+=" and unit_id = '"+unitId+"'"; - PageHelper.startPage(page, rows); - List list = this.repairCarService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String unitId= request.getParameter("unitId"); - model.addAttribute("unitId",unitId); - Company company = this.unitService.getCompById(unitId); - String detailNumber = "CLWX-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - request.setAttribute("detailNumber", detailNumber); - return "/maintenance/repairCarAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute RepairCar repairCar){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - repairCar.setId(CommUtil.getUUID()); - repairCar.setInsuser(userId); - repairCar.setInsdt(CommUtil.nowDate()); - repairCar.setStatus("待审核"); - int code = this.repairCarService.save(repairCar); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(repairCar); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -// @RequestMapping("/doedit.do") -// public String doedit(HttpServletRequest request,Model model, -// @RequestParam(value = "id") String id){ -// MaintainCar maintainCar = this.maintainCarService.selectById(id); -// -// model.addAttribute("maintainCar", maintainCar); -// return "/maintenance/maintainCarEdit"; -// } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - RepairCar repairCar = this.repairCarService.selectById(id); - - model.addAttribute("repairCar", repairCar); - return "/maintenance/repairCarView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute RepairCar repairCar){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - repairCar.setUpsuser(userId); - repairCar.setUpsdt(CommUtil.nowDate()); - int code = this.repairCarService.update(repairCar); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.repairCarService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - int count = ids.split(",").length; - ids=ids.replace(",","','"); - int code = this.repairCarService.deleteByWhere("where id in ('"+ids+"')"); - Result result = new Result(); - if (code == count) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - RepairCar repairCar = this.repairCarService.selectById(id); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - try { - result =this.repairCarService.startProcess(repairCar); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+repairCar.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/showAudit.do") - public String showAuditInStock(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String id= pInstance.getBusinessKey(); - RepairCar repairCar = this.repairCarService.selectById(id); - model.addAttribute("repairCar", repairCar); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "/maintenance/repairCarAudit"; - } - - @RequestMapping("/AuditRepairCar.do") - public String doAuditInStockRecord(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.repairCarService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} - diff --git a/src/com/sipai/controller/maintenance/RepairController.java b/src/com/sipai/controller/maintenance/RepairController.java deleted file mode 100644 index b00b7b45..00000000 --- a/src/com/sipai/controller/maintenance/RepairController.java +++ /dev/null @@ -1,430 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.user.Company; -import com.sipai.service.user.UnitService; -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricActivityInstance; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitInquiry; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentRepairPlan; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.maintenance.Repair; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.maintenance.RepairService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/repair") -public class RepairController { - @Resource - private RepairService repairService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private UnitService unitService; - - @RequestMapping("/showlist.do") - public String showCollection(HttpServletRequest request,Model model) { - return "/maintenance/repairList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model,HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - wherestr+=" and unit_id='"+request.getParameter("unitId")+"'"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and project_name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.repairService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String unitId= request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if(company!=null){ - String jobNumber = company.getEname()+"-WX-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("companyName", company.getSname()); - } - request.setAttribute("id", CommUtil.getUUID()); - return "maintenance/repairAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Repair repair = this.repairService.selectById(id); - if(repair!=null){ - model.addAttribute("repair",repair); - } - return "maintenance/repairEdit"; - } - - @RequestMapping("/doeView.do") - public String doeView(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Repair repair = this.repairService.selectById(id); - if(repair!=null){ - model.addAttribute("repair",repair); - } - return "maintenance/repairView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("repair") Repair repair){ - User cu= (User)request.getSession().getAttribute("cu"); - repair.setInsdt(CommUtil.nowDate()); - repair.setInsuser(cu.getId()); - int res = this.repairService.save(repair); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("repair") Repair repair){ - int res = this.repairService.update(repair); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.repairService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.repairService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 发起流程 - */ - @RequestMapping("/createProcessFun.do") - public String createProcessFun(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code=0; - User cu= (User)request.getSession().getAttribute("cu"); - Repair repair=this.repairService.selectById(id); - Map variables = new HashMap(); - if(!repair.getReceiveUserIds().isEmpty()){ - variables.put("userIds", repair.getReceiveUserIds()); - }else{ - //无处理人员则不发起 - code=MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Maintenance_Repair.getId()+"-"+repair.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - code=MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(repair.getId(), repair.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - repair.setProcessid(processInstance.getId()); - repair.setProcessdefid(processDefinitions.get(0).getId()); - repair.setProcessStatus(Repair.Status_Start); - this.repairService.update(repair); - code=1; - }else{ - code=0; - throw new RuntimeException(); - } - //发送消息 -// BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(repair); -// businessUnitRecord.sendMessage(repair.getReceiveUserIds(),""); - - model.addAttribute("result", code); - return "result"; - } - - - /** - * 执行审核流程 - */ - @RequestMapping("/doNextAuditProcess.do") - public String doNextAuditProcess(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.repairService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 执行业务流程 - * */ - @RequestMapping("/doNextHandleProcess.do") - public String doNextHandleProcess(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.repairService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - //维修执行界面 - @RequestMapping("/implementProcess1.do") - public String implementProcess1(HttpServletRequest request,Model model) { -// List list = this.repairService.selectListByWhere(" where processId='"+request.getParameter("processInstanceId")+"' "); -// if(list!=null&&list.size()>0){ -// model.addAttribute("repair",list.get(0)); -// } - - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task nowtask = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", nowtask.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(nowtask.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String jobId= pInstance.getBusinessKey(); - Repair repair = this.repairService.selectById(jobId); - model.addAttribute("repair", repair); - -// List businessUnitRecords = new ArrayList<>(); -// BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(repair,request.getParameter("auditopinion")); -// businessUnitRecords.add(businessUnitRecord); -// -// List workTasks=workflowProcessDefinitionService.getAllPDTask(repair.getProcessdefid(), "desc"); -// List keys=new ArrayList<>(); -// for (WorkTask workTask : workTasks) { -// keys.add(workTask.getTaskKey()); -// } -// Set set = new HashSet(); -// set.addAll(keys); -// keys=new ArrayList<>(); -// keys.addAll(set); -// for (String item : keys) { -// switch (item) { -// case BusinessUnit.UNIT_DEPT_APPLY: -// List list_apply = businessUnitDeptApplyService.selectListByWhere("where subscribe_id='"+subscribeId+"' "); -// for (BusinessUnitDeptApply businessUnitDeptApply : list_apply) { -// businessUnitRecord = new BusinessUnitRecord(businessUnitDeptApply); -// businessUnitRecords.add(businessUnitRecord); -// } -// break; -// case BusinessUnit.UNIT_INQUIRY: -// List list_inquiry = businessUnitInquiryService.selectListByWhere("where subscribe_id='"+subscribeId+"' "); -// for (BusinessUnitInquiry businessUnitInquiry : list_inquiry) { -// businessUnitRecord = new BusinessUnitRecord(businessUnitInquiry); -// businessUnitRecords.add(businessUnitRecord); -// } -// break; -// case BusinessUnit.UNIT_SUBSCRIBE_AUDIT: -// List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+subscribeId+"' "); -// for (BusinessUnitAudit businessUnitAudit : list_audit) { -// businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); -// businessUnitRecords.add(businessUnitRecord); -// } -// break; -// default: -// break; -// } -// } -// //展示最新任务是否签收 -// String processId=repair.getProcessid(); -// List list=this.workflowService.getHistoryService() // 历史相关Service -// .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 -// .processInstanceId(processId) // 用流程实例id查询 -// .list(); -// for (HistoricTaskInstance task : list) { -// if (task.getAssignee()==null || task.getClaimTime()==null) { -// continue; -// } -// businessUnitRecord = new BusinessUnitRecord(task); -// businessUnitRecords.add(businessUnitRecord); -// } -// Collections.sort(businessUnitRecords, new Comparator() { -// public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { -// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); -// try{ -// Date dt1 = df.parse(o1.getInsdt()); -// Date dt2 = df.parse(o2.getInsdt()); -// if (dt1.getTime() > dt2.getTime()) { -// return 1; -// } else if (dt1.getTime() < dt2.getTime()) { -// return -1; -// } else { -// return 0; -// } -// }catch(Exception e){ -// e.printStackTrace(); -// return 0; -// } -// -// } -// }); -// -// JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); -// model.addAttribute("businessUnitRecords",jsonArray); - -// 获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 -// List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); -// if (activityImpls.size()>0) { -// model.addAttribute("showTargetUsersFlag", true); -// }else{ -// model.addAttribute("showTargetUsersFlag", false); -// } - - return "/maintenance/repairProcessView1"; - } - - @RequestMapping("/implementProcess2.do") - public String implementProcess2(HttpServletRequest request,Model model) { - return "/maintenance/repairProcessView2"; - } - - @RequestMapping("/implementProcess3.do") - public String implementProcess3(HttpServletRequest request,Model model) { - return "/maintenance/repairProcessView3"; - } - - -} diff --git a/src/com/sipai/controller/maintenance/WorkorderLibraryMaintainController.java b/src/com/sipai/controller/maintenance/WorkorderLibraryMaintainController.java deleted file mode 100644 index 0ae7cee0..00000000 --- a/src/com/sipai/controller/maintenance/WorkorderLibraryMaintainController.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.sipai.controller.maintenance; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.WorkorderLibraryMaintain; -import com.sipai.service.maintenance.WorkorderLibraryMaintainService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/maintenance/workorderLibraryMaintain") -public class WorkorderLibraryMaintainController { - @Resource - private WorkorderLibraryMaintainService workorderLibraryMaintainService; - - /** - * 获取list数据 - */ - @RequestMapping("/getListMaintain.do") - public ModelAndView getListMaintain(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1"; - if (pid != null && !pid.isEmpty()) { - wherestr += " and pid = '" + pid + "'"; - } - PageHelper.startPage(page, rows); - List list = this.workorderLibraryMaintainService.selectListByWhereTy(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取list数据 - */ - @RequestMapping("/getListLubrication.do") - public ModelAndView getListLubrication(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1"; - if (pid != null && !pid.isEmpty()) { - wherestr += " and pid = '" + pid + "'"; - } - PageHelper.startPage(page, rows); - List list = this.workorderLibraryMaintainService.selectListByWhereRh(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取list数据 - */ - @RequestMapping("/getListRepair.do") - public ModelAndView getListRepair(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid"); - String unitId = request.getParameter("unitId"); - String equipmentId = request.getParameter("equipmentId"); - - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1"; - if (pid != null && !pid.isEmpty()) { - wherestr += " and pid = '" + pid + "'"; - } - PageHelper.startPage(page, rows); - List list = this.workorderLibraryMaintainService.selectListByWhereWx(wherestr + orderstr,unitId,equipmentId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.workorderLibraryMaintainService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.workorderLibraryMaintainService.deleteByWhere("where id in ('" + ids + "')"); - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/updateLibraryMaintains.do") - public String updateLibraryMaintains(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String libraryIds = request.getParameter("libraryIds"); - String type = request.getParameter("type"); - String unitId = request.getParameter("unitId"); - String equipmentId = request.getParameter("equipmentId"); - - int res = workorderLibraryMaintainService.saveLibrary(id, libraryIds, type, unitId, equipmentId); - - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doeditTy.do") - public String doeditTy(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WorkorderLibraryMaintain workorderLibraryMaintain = this.workorderLibraryMaintainService.selectByIdTy(id); - model.addAttribute("workorderLibraryMaintain", workorderLibraryMaintain); - return "maintenance/workorderLibraryMaintainEditTy"; - } - - @RequestMapping("/doeditRh.do") - public String doeditRh(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WorkorderLibraryMaintain workorderLibraryMaintain = this.workorderLibraryMaintainService.selectByIdRh(id); - model.addAttribute("workorderLibraryMaintain", workorderLibraryMaintain); - return "maintenance/workorderLibraryMaintainEditRh"; - } - - @RequestMapping("/doeditFf.do") - public String doeditFf(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WorkorderLibraryMaintain workorderLibraryMaintain = this.workorderLibraryMaintainService.selectByIdRh(id); - model.addAttribute("workorderLibraryMaintain", workorderLibraryMaintain); - return "maintenance/workorderLibraryMaintainEditFf"; - } - - @RequestMapping("/doeditRepair.do") - public String doeditRepair(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "equipmentId") String equipmentId) { - WorkorderLibraryMaintain workorderLibraryMaintain = this.workorderLibraryMaintainService.selectByIdWx(id,unitId,equipmentId); - model.addAttribute("workorderLibraryMaintain", workorderLibraryMaintain); - return "maintenance/workorderLibraryRepairEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("workorderLibraryMaintain") WorkorderLibraryMaintain workorderLibraryMaintain) { - int result = this.workorderLibraryMaintainService.update(workorderLibraryMaintain); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/model/ModelDataController.java b/src/com/sipai/controller/model/ModelDataController.java deleted file mode 100644 index 4f865d9d..00000000 --- a/src/com/sipai/controller/model/ModelDataController.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.controller.model; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.model.ModelSetValue; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.model.ModelSetValueService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.redisson.api.RBatch; -import org.redisson.api.RMapCache; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Random; -import java.util.concurrent.TimeUnit; - -@Controller -@RequestMapping("/modelData") -public class ModelDataController { - @Resource - private ModelSetValueService modelSetValueService; - @Resource - private RedissonClient redissonClient; - - /** - * 模型首页 (南州) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/homePage.do") - public String homePage(HttpServletRequest request, Model model) { - request.setAttribute("cid", CommUtil.getUUID().substring(0, 6)); - return "/model/homePage"; - } - - /** - * 仿真评估参数设置页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showParam.do") - public String showParam(HttpServletRequest request, Model model) { - return "/model/showParam"; - } - - /** - * 计算页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCompute.do") - public String showCompute(HttpServletRequest request, Model model) { - return "/model/showCompute"; - } - - /** - * 获取 潮汐液位和压力表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSetData.do") - public ModelAndView getSetData(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String orderstr = " order by dt asc"; - String wherestr = "where 1=1 "; - wherestr += " and dt>DATEADD(HOUR,-12,GETDATE()) and dt list = this.modelSetValueService.selectListByWhereTide(wherestr + orderstr, "24"); - - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < 24; i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dt", list.get(i).getDt().substring(0, 16)); - jsonObject.put("val", list.get(i).getVal()); - jsonArray.add(jsonObject); - } - - orderstr = " order by dt desc"; - List list2 = this.modelSetValueService.selectListByWherePressure(orderstr, "24"); - for (ModelSetValue modelSetValue : list2) { - - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = jsonArray.getJSONObject(i); - if (jsonObject.get("dt").toString().substring(10, 13).equals(modelSetValue.getDt().substring(10, 13))) { - jsonObject.put("maxVal", modelSetValue.getMaxVal()); - jsonObject.put("minVal", modelSetValue.getMinVal()); - jsonObject.put("controlVal", modelSetValue.getControlVal()); - break; - } - } - } - - PageHelper.startPage(page, rows); - List list_adll = jsonArray; - PageInfo pi = new PageInfo<>(list_adll); - JSONArray json = JSONArray.fromObject(list_adll); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新redis - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRedis.do") - public String updateRedis(HttpServletRequest request, Model model, - @RequestParam(value = "cid", required = true) String cid, - @RequestParam(value = "jsonArray", required = true) com.alibaba.fastjson.JSONArray jsonArray) { - RBatch batch = redissonClient.createBatch(); - - try { - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - String[] str = jsonArray.get(i).toString().split("="); - if (str != null && str.length == 2 && str[1] != null && !str[1].equals("")) { - batch.getMapCache(CommString.REDIS_KEY_TYPE_ModelCidData + cid).fastPutAsync(str[0], str[1], 60, TimeUnit.MINUTES); - } - } - } - batch.execute(); - model.addAttribute("result", CommUtil.toJson("suc")); - return "result"; - } catch (Exception e) { - model.addAttribute("result", CommUtil.toJson("fail")); - return "result"; - } -// return "result"; - } - - /** - * 获取模型的数据 - * - * @param request - * @param model - * @param model_uuid 等于模型项目的cid - * @param mpcode 点位code - * @return - */ - @RequestMapping("/getModelTargetData.do") - public String getModelTargetData(HttpServletRequest request, Model model, - @RequestParam(value = "model_uuid", required = true) String model_uuid, - @RequestParam(value = "mpcode", required = true) String mpcode) { - Random rand = new Random(); - int randomNumber = rand.nextInt(20); - Result result = Result.success(randomNumber+""); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/mqtt/MqttController.java b/src/com/sipai/controller/mqtt/MqttController.java deleted file mode 100644 index edf8e457..00000000 --- a/src/com/sipai/controller/mqtt/MqttController.java +++ /dev/null @@ -1,511 +0,0 @@ -package com.sipai.controller.mqtt; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.JSONObject; -import com.lowagie.text.pdf.PRIndirectReference; -import com.sipai.entity.alarm.AlarmLevelsCodeEnum; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.XimenziDescriptionEnum; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.sparepart.HazardousChemicals; -import com.sipai.entity.structure.StructureCardPicture; -import com.sipai.entity.user.User; -import com.sipai.quartz.job.BIMDataJob; -import com.sipai.quartz.job.BIMDataJob_Equ; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.bim.RobotService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.sparepart.HazardousChemicalsService; -import com.sipai.service.structure.StructureCardPictureService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.HttpUtil; -import com.sipai.websocket.MsgWebSocket2; -import io.swagger.annotations.*; -import okhttp3.OkHttpClient; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.junit.internal.runners.statements.Fail; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.*; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/mqtt") -@Api(value = "/mqtt", tags = "mqtt交互接口") -public class MqttController { - @Resource - private RedissonClient redissonClient; - @Resource - private UserService userService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private MPointService mPointService; - @Resource - private AlarmPointService alarmPointService; - @Resource - private RobotService robotService; - @Resource - private HazardousChemicalsService hazardousChemicalsService; - @Resource - private StructureCardPictureService structureCardPictureService; - - - @ApiOperation(value = "添加动态主题(平台、APP使用)", notes = "添加数据实时推送的动态主题(平台、APP使用)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "topic", value = "生成的动态主题", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "mpointIds", value = "测量点(支持多个中间用英文逗号隔开)", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/addTopic.do", method = RequestMethod.POST) - public String addTopic(HttpServletRequest request, Model model, - @RequestParam(value = "topic") String topic, - @RequestParam(value = "mpointIds") String mpointIds) { - RMap map_redis = redissonClient.getMap(CommString.REDISMqttTopicMpoint); - if (mpointIds != null && !mpointIds.trim().equals("")) { - String[] ids = mpointIds.split(","); - if (ids != null && ids.length > 0) { - List list = new ArrayList<>(); - for (int i = 0; i < ids.length; i++) { - list.add(ids[i]); - } - map_redis.fastPutAsync(topic, list); - } - } - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @ApiOperation(value = "添加动态主题(三维使用)", notes = "添加数据实时推送的动态主题(三维使用)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "topic", value = "生成的动态主题", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "mpointIds", value = "测量点(支持多个中间用英文逗号隔开)", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/addBIMTopic.do", method = RequestMethod.POST) - public String addBIMTopic(HttpServletRequest request, Model model, - @RequestParam(value = "topic") String topic, - @RequestParam(value = "mpointIds") String mpointIds) { - RMap map_redis = redissonClient.getMap(CommString.REDISWebsocketBIMMpoint); - if (mpointIds != null && !mpointIds.trim().equals("")) { - String[] ids = mpointIds.split(","); - if (ids != null && ids.length > 0) { - List list = new ArrayList<>(); - for (int i = 0; i < ids.length; i++) { - list.add(ids[i]); - } - map_redis.fastPutAsync(topic, list); - } - } - - //订阅后立即推送一次数据给三维 - try { - BIMDataJob bimDataJob = new BIMDataJob(); - bimDataJob.fun1(null); - } catch (Exception e) { - e.printStackTrace(); - } - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @ApiOperation(value = "添加单个设备动态主题(三维使用)", notes = "添加单个设备动态主题(三维使用)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "equipmentCardId", value = "设备编号", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/addBIMEquTopic.do", method = RequestMethod.POST) - public String addBIMEquTopic(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentCardId") String equipmentCardId) { - RMap map_redis = redissonClient.getMap(CommString.REDISWebsocketBIMEquMpoint); - map_redis.fastPutAsync("BIM", equipmentCardId); - - //订阅后立即推送一次数据给三维 - try { - BIMDataJob_Equ bimDataJob = new BIMDataJob_Equ(); - bimDataJob.fun1(null); - } catch (Exception e) { - e.printStackTrace(); - } - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @ApiOperation(value = "查看动态主题", notes = "查看动态主题", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/getTopic.do", method = RequestMethod.GET) - public String getTopic(HttpServletRequest request, Model model) { - RMap map_list = redissonClient.getMap(CommString.REDISMqttTopicMpoint); - if (map_list != null && map_list.size() > 0) { - Map all = map_list.getAll(map_list.keySet()); - Result result = Result.success(all); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - - @ApiOperation(value = "接收危化品报警数据", notes = "接收危化品报警数据", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "json", value = "type(报警-alarm,试剂库存-inventoryInfo,试剂入库记录-inventoryInApply,试剂出库记录-inventoryOutApply,废弃物库存-wasteInfo,废弃物入库记录-wasteInRecords,废弃物出库记录-wasteOutRecords)", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/recordAlarm.do", method = RequestMethod.POST) - public String recordAlarm(HttpServletRequest request, Model model, -// @RequestParam(value = "json") String json) { - @RequestBody JSONObject json) { - System.out.println("危化品_start======================================================" + CommUtil.nowDate()); - System.out.println(json); -// JSONObject jsonObject = JSON.parseObject(json); - - //存危化品记录表 - HazardousChemicals hazardousChemicals = new HazardousChemicals(); - hazardousChemicals.setPushid(json.get("pushId").toString()); - hazardousChemicals.setClientid(json.get("clientId").toString()); - hazardousChemicals.setType(json.get("type").toString()); - hazardousChemicals.setOperation(json.get("operation").toString()); - hazardousChemicals.setRecords(json.get("records").toString()); - hazardousChemicalsService.save(hazardousChemicals); - - System.out.println("危化品_end======================================================" + CommUtil.nowDate()); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @ApiOperation(value = "接收西门子报警数据", notes = "接收西门子报警数据", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "json", value = "", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/recordAlarm_xmz.do", method = RequestMethod.POST) - public String recordAlarm_xmz(HttpServletRequest request, Model model, -// @RequestParam(value = "json") String json) { - @RequestBody JSONObject json) throws UnsupportedEncodingException { - System.out.println("西门子_start======================================================" + CommUtil.nowDate()); - System.out.println(json); - - String id = CommUtil.getUUID(); - String status = "2"; - String bizId = "021NS"; - String unitId = "021NS"; - String equipmentIds = json.get("deviceName") + ""; - String abnormityDescription = json.get("description") + ""; - - //获取token - JSONObject json_t = new JSONObject(); - json_t.put("j_username", "lDfQNmyN4yMmPpZtoYILwQ=="); - json_t.put("j_password", "g675BcAUpKhOapLSlJf8nA=="); - json_t.put("verCode", "64368180"); - json_t.put("deviceId", ""); - String res = HttpUtil.sendPost("http://10.197.50.127:8899/SIPAIIS_Base/j_spring_security_check", json_t.toString()); - JSONObject token_json = JSON.parseObject(res); - if (token_json.get("Access_Token") != null && !token_json.get("Access_Token").equals("")) { - - if (XimenziDescriptionEnum.getName(abnormityDescription) != null) { - abnormityDescription = URLEncoder.encode(XimenziDescriptionEnum.getName(abnormityDescription), "utf-8"); - } - /*System.out.println("请求制水接口:maintenance/abnormity/dosave"); - String url = "http://10.197.50.126:3002/SIPAIIS_DataCenter/maintenance/abnormity/dosave.do?id=" + id - + "&status=" + status - + "&bizId=" + bizId - + "&unitId=" + unitId - + "&equipmentIds=" + equipmentIds - + "&abnormityDescription=" + abnormityDescription; - - //西门子有的时候 异常描述 是空 过滤掉 - if (abnormityDescription != null && !abnormityDescription.equals("")) { - HttpUtil.sendPostToken(url, token_json.get("Access_Token").toString()); - }*/ - System.out.println("请求制水接口 已注释"); - } else { - System.out.println("token为空" + CommUtil.nowDate()); - } - -// int result2 = this.alarmPointService.insertAlarm("021NS", null, AlarmMoldCodeEnum.Type_Location_Fence.getKey(), relatedTagId, pointName, alarmTime, AlarmLevelsCodeEnum.level1.getKey(), alarmDesc, "1", "", ""); -// if (result2 == 1) {}cheng - - System.out.println("西门子_end======================================================" + CommUtil.nowDate()); - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @ApiOperation(value = "查询所有人员在线", notes = "查询所有人员在线", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/getUserList.do", method = RequestMethod.GET) - public String getUserList(HttpServletRequest request, Model model) { - List list = userService.selectListByWhere2("where cardid is not null and cardid!=''"); - Result result = Result.success(list); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @ApiOperation(value = "根据设备编号获取测量点信息", notes = "根据设备编号获取改设备下的所有测量点信息", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "equipmentCardId", value = "设备编号", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/getMpointData4Equipment.do", method = RequestMethod.GET) - public String getMpointData4Equipment(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentCardId") String equipmentCardId) { - EquipmentCard equipmentCard = equipmentCardService.selectByEquipmentCardId(equipmentCardId); - JSONObject jsonObject = new JSONObject(); - if (equipmentCard != null) { - //查询设备下所有的测量点 - List list = mPointService.selectListByWhere(equipmentCard.getBizid(), " where equipmentId = '" + equipmentCard.getId() + "'"); - JSONArray jsonArray = new JSONArray(); - for (MPoint mPoint : list) { - JSONObject json_mp = new JSONObject(); - json_mp.put("mpointId", mPoint.getMpointid()); - json_mp.put("mpointCode", mPoint.getMpointcode()); - json_mp.put("mpointName", mPoint.getParmname()); - json_mp.put("paramValue", mPoint.getParmvalue()); - json_mp.put("measureDt", mPoint.getMeasuredt()); - if (mPoint.getUnit() != null && !mPoint.getUnit().equals("")) { - json_mp.put("unit", mPoint.getUnit()); - } else { - json_mp.put("unit", ""); - } - jsonArray.add(json_mp); - } - jsonObject.put("id", equipmentCard.getId()); - jsonObject.put("equipmentName", equipmentCard.getEquipmentname()); - jsonObject.put("equipmentCardId", equipmentCard.getEquipmentcardid()); - jsonObject.put("data", jsonArray); - } else { - model.addAttribute("result", Result.failed("无该设备")); - return "result"; - } - model.addAttribute("result", jsonObject); - return "result"; - } - - - @ApiOperation(value = "给三维推送切换设备的指令", notes = "平台请求接口 给三维推送切换设备的指令", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "equipmentCardId", value = "设备编号", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/changeEquipment.do") - public String changeEquipment(HttpServletRequest request, Model model, - @RequestParam(value = "equipmentCardId") String equipmentCardId) { - JSONObject json = new JSONObject(); - json.put("dataType", CommString.WebsocketBIMTypeChangeEqu); - json.put("equipmentId", equipmentCardId); - try { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessageData(json.toString(), null); - } catch (Exception e) { - e.printStackTrace(); - } - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "获取当前库位信息", notes = "获取当前库位信息(请求厂家接口 直接返回给三维平台)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "json", value = "", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/getWhLocaMessList.do", method = RequestMethod.POST) - public String getWhLocaMessList(HttpServletRequest request, Model model) { - System.out.println("获取当前库位信息======================================================" + CommUtil.nowDate()); - try { - String res = HttpUtil.sendPost_s("http://192.168.18.65:8082/board/getWhLocaMessList",2000); - model.addAttribute("result", res); - } catch (Exception e) { - model.addAttribute("result", ""); - } - return "result"; - } - - @ApiOperation(value = "获取一次机器人最新的数据", notes = "获取一次机器人最新的数据", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/getRobotData.do", method = RequestMethod.POST) - public String getRobotData(HttpServletRequest request, Model model) { - System.out.println("获取一次机器人最新的数据=========================" + CommUtil.nowDate()); - try { - String res = ""; - JSONObject jsonObject = robotService.getRobot4Http(); -// Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(jsonObject)); - } catch (Exception e) { - model.addAttribute("result", ""); - } - return "result"; - } - - /** - * 获取所有构筑物的 安全等级 - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "获取所有构筑物的安全等级", notes = "获取所有构筑物的安全等级", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/getStructureSafeLevel.do", method = RequestMethod.GET) - public ModelAndView getStructureSafeLevel(HttpServletRequest request, Model model) { - List list = this.structureCardPictureService.selectListByWhere(" where 1=1 and type = 'area' "); - Map map = new HashMap<>(); - for (StructureCardPicture structureCardPicture : list) { - map.put(structureCardPicture.getStructureId(), structureCardPicture.getSafeLevel()); - } -// System.out.println(map); - if (list != null && list.size() > 0) { - try { - String sdt = CommUtil.nowDate().substring(0, 10); - String edt = CommUtil.nowDate().substring(0, 10); - sdt = URLEncoder.encode(sdt, "UTF-8"); - edt = URLEncoder.encode(edt, "UTF-8"); - String url = "http://10.197.50.127:8899/SIPAIIS_Equipment/maintenancePlanRecord/getListWithOP.do?page=1&rows=20&content=&startTime=" + sdt + "&endTime=" + edt + "&status=&maintenanceWay=&equipmentClassId=&sort=start_time&order=desc&unitId=021NS&ng="; - String str = HttpUtil.sendPost(url); - JSONObject jsonObject = JSON.parseObject(str); - JSONObject jsonObject_result = JSON.parseObject(jsonObject.get("result").toString()); - com.alibaba.fastjson.JSONArray jsonArray_list = JSON.parseArray(jsonObject_result.get("list").toString()); - if (jsonArray_list != null && jsonArray_list.size() > 0) { - for (int i = 0; i < jsonArray_list.size(); i++) { - JSONObject json = jsonArray_list.getJSONObject(i); - if (json.get("needMaterial") != null && json.get("needMaterial").toString().contains("YXKJ")) { - String[] id = json.get("equipmentIds").toString().split(","); - if (id != null) { - for (int j = 0; j < id.length; j++) { - String equipmentId = id[j]; - List list_equipment = equipmentCardService.selectSimpleListByWhere("where in_code = '" + equipmentId + "'"); - if (list_equipment != null && list_equipment.size() > 0) {//制水和南市 设备编号能对应上 - String structureId = list_equipment.get(0).getStructureId();//构筑物Id - if (structureId != null) { - if (map.get(structureId) != null) { - //不能提高到A级 所以只有C和D提升一级 - if (map.get(structureId).equals("C")) { - System.out.println(structureId + "===从C提升为B"); - map.put(structureId, "B"); - } else { - System.out.println(structureId + "===未提升"); - } - if (map.get(structureId).equals("D")) { - System.out.println(structureId + "===从D提升为C"); - map.put(structureId, "C"); - } else { - System.out.println(structureId + "===未提升"); - } - } - } - } - } - } - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - for (Map.Entry entry : map.entrySet()) { - JSONObject jsonObject = new JSONObject(); - try { - // 添加键值对数据到JSONObject对象中 -// jsonObject.put(entry.getKey(), entry.getValue()); - jsonObject.put("id", entry.getKey()); - jsonObject.put("level", entry.getValue()); - } catch (JSONException e) { - e.printStackTrace(); - } - // 将JSONObject对象添加到JSONArray对象中 - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - - /** - * 手动将制水的设备编号 update 到南市的设备台账表中的 inCode 字段 - * - * @param request - * @param model - * @return - * @throws FileNotFoundException - */ - @ApiOperation(value = "同步制水和南市的设备编号", notes = "手动将制水的设备编号 update 到南市的设备台账表中的 inCode 字段 (只有当excel文件有更新时,才需要手动执行)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - }) - @RequestMapping(value = "/updateEquipmentCardId.do") - public ModelAndView updateEquipmentCardId(HttpServletRequest request, Model model) throws FileNotFoundException { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - try { - //创建工作簿 - XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream("D:\\sipaiis-config\\equipment.xlsx")); - //读取第一个工作表(这里的下标与list一样的,从0开始取,之后的也是如此) - XSSFSheet sheet = xssfWorkbook.getSheetAt(0); - int maxRow = sheet.getLastRowNum(); - System.out.println("最大行数:" + maxRow); - for (int i = 0; i <= maxRow; i++) { - //获取行的数据 - XSSFRow row = sheet.getRow(i); - //获取该行第一个单元格的数据 - XSSFCell cell0 = row.getCell(0); - XSSFCell cell1 = row.getCell(1); - String zhishuiCode = cell0 + ""; - String nanshiCode = cell1 + ""; - if (!zhishuiCode.equals("") && !nanshiCode.equals("")) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleByEquipmentCardId(nanshiCode); - if (equipmentCard != null) { - System.out.println(i + "行===制水===" + zhishuiCode + "===南市===" + nanshiCode + "===" + equipmentCard.getEquipmentname()); - equipmentCard.setInCode(zhishuiCode); - equipmentCardService.update(equipmentCard); - } - } - } - } catch (IOException e) { - e.printStackTrace(); - } - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/mqtt/RecordDataController.java b/src/com/sipai/controller/mqtt/RecordDataController.java deleted file mode 100644 index 485885f7..00000000 --- a/src/com/sipai/controller/mqtt/RecordDataController.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.controller.mqtt; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.Result; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.*; -import org.redisson.api.RBatch; -import org.redisson.api.RMapCache; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -@Controller -@RequestMapping("/recordData") -@Api(value = "/recordData", tags = "接收数据") -public class RecordDataController { - @Resource - private RedissonClient redissonClient; - @Resource - private MPointService mPointService; - - - @ApiOperation(value = "接收电力公司红外读取数据", notes = "接收电力公司红外读取数据", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "json", value = "", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value = "/electricData.do", method = RequestMethod.POST) - public String electricData(HttpServletRequest request, Model model, - @RequestBody JSONObject json) { - String redisBase = "electricData"; - -// RMapCache map_redis = redissonClient.getMapCache("electricData"); -// json.put("sipai_dt",CommUtil.nowDate()); -// map_redis.put("data",json); - - RMapCache map_redis = redissonClient.getMapCache(redisBase); - if (map_redis != null && map_redis.size() > 0) { - if(map_redis.get("data")!=null){ -// System.out.println("存在 === "+map_redis.get("data")); - }else{ - System.out.println("不存在1 === " + json); - RBatch batch = redissonClient.createBatch(); - batch.getMapCache(redisBase).fastPutAsync("data", json, 60, TimeUnit.MINUTES); - batch.execute(); - } - }else{ - System.out.println("不存在2 === " + json); - RBatch batch = redissonClient.createBatch(); - batch.getMapCache(redisBase).fastPutAsync("data", json, 60, TimeUnit.MINUTES); - batch.execute(); - } - - - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/msg/Client.java b/src/com/sipai/controller/msg/Client.java deleted file mode 100644 index 03ab2560..00000000 --- a/src/com/sipai/controller/msg/Client.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.sipai.controller.msg; - -import java.rmi.RemoteException; -import java.util.Arrays; -import java.util.List; - -import com.sipai.emsg.Mo; -import com.sipai.emsg.SDKServiceBindingStub; -import com.sipai.emsg.SDKServiceLocator; -import com.sipai.emsg.StatusReport; - -public class Client { -private String softwareSerialNo; -private String key; - public Client(String sn,String key){ - this.softwareSerialNo=sn; - this.key=key; - init(); - } - - SDKServiceBindingStub binding; - - - public void init(){ - try { - binding = (SDKServiceBindingStub) - new SDKServiceLocator().getSDKService(); - } - catch (javax.xml.rpc.ServiceException jre) { - if(jre.getLinkedCause()!=null) - jre.getLinkedCause().printStackTrace(); - } - } - - public int chargeUp( String cardNo,String cardPass) - throws RemoteException { - int value=-1; - value=binding.chargeUp(softwareSerialNo, key, cardNo, cardPass); - return value; - } - - public double getBalance() throws RemoteException { - double value=0.0; - value=binding.getBalance(softwareSerialNo, key); - return value; - } - - public double getEachFee( ) throws RemoteException { - double value=0.0; - value=binding.getEachFee(softwareSerialNo, key); - return value; - } - public List getMO( ) throws RemoteException { - Mo[] mo=binding.getMO(softwareSerialNo, key); - - if(null == mo){ - return null; - }else{ - List molist=Arrays.asList(mo); - return molist; - } - } - - - public List getReport( ) - throws RemoteException { - StatusReport[] sr=binding.getReport(softwareSerialNo, key); - if(null!=sr){ - return Arrays.asList(sr); - }else{ - return null; - } - } - - - public int logout( ) throws RemoteException { - int value=-1; - value=binding.logout(softwareSerialNo, key); - return value; - } - - public int registDetailInfo( - String eName, String linkMan, String phoneNum, String mobile, - String email, String fax, String address, String postcode -) throws RemoteException { - int value=-1; - value=binding.registDetailInfo(softwareSerialNo, key, eName, linkMan, phoneNum, mobile, email, fax, address, postcode); - return value; - } - - public int registEx(String password) - throws RemoteException { - int value=-1; - value=binding.registEx(softwareSerialNo, key, password); - return value; - } - - public int sendSMS( String[] mobiles, String smsContent, String addSerial,int smsPriority) - throws RemoteException { - int value=-1; - value=binding.sendSMS(softwareSerialNo, key,"", mobiles, smsContent, addSerial, "gbk", smsPriority,0); - return value; - } - - public int sendScheduledSMSEx(String[] mobiles, String smsContent,String sendTime,String srcCharset) - throws RemoteException { - int value=-1; - value=binding.sendSMS(softwareSerialNo, key, sendTime, mobiles, smsContent, "", srcCharset, 3,0); - return value; - } - public int sendSMSEx(String[] mobiles, String smsContent, String addSerial,String srcCharset, int smsPriority,long smsID) - throws RemoteException { - int value=-1; - value=binding.sendSMS(softwareSerialNo, key,"", mobiles, smsContent,addSerial, srcCharset, smsPriority,smsID); - return value; - } - - public String sendVoice(String[] mobiles, String smsContent, String addSerial,String srcCharset, int smsPriority,long smsID) - throws RemoteException { - String value=null; - value=binding.sendVoice(softwareSerialNo, key,"", mobiles, smsContent,addSerial, srcCharset, smsPriority,smsID); - return value; - } - - public int serialPwdUpd( String serialPwd, String serialPwdNew) - throws RemoteException { - int value=-1; - value=binding.serialPwdUpd(softwareSerialNo, key, serialPwd, serialPwdNew); - return value; - } -} diff --git a/src/com/sipai/controller/msg/FrequentContactsController.java b/src/com/sipai/controller/msg/FrequentContactsController.java deleted file mode 100644 index f2146c3e..00000000 --- a/src/com/sipai/controller/msg/FrequentContactsController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.controller.msg; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.msg.FrequentContacts; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.msg.FrequentContactsService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.Api; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/msg/frequentContacts") -@Api(value = "/msg/frequentContacts", tags = "常用联系人") -public class FrequentContactsController { - @Resource - private FrequentContactsService frequentContactsService; - - /** - * 编辑任务(生产巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "msg/frequentContactsList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " sdt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - - PageHelper.startPage(page, rows); - List list = this.frequentContactsService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListJson.do") - public ModelAndView getListJson(HttpServletRequest request, Model model, HttpServletResponse response) { - String orderstr = " "; - String wherestr = " where 1=1 "; - List list = this.frequentContactsService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); -// System.out.println(json); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @RequestParam(value = "unitId", required = true) String unitId, - @RequestParam(value = "ids", required = true) String ids) { -// User cu = (User) request.getSession().getAttribute("cu"); - int num = 0; - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - if (id != null && id.length > 0) { - for (int i = 0; i < id.length; i++) { - FrequentContacts entity = new FrequentContacts(); - entity.setId(CommUtil.getUUID()); - entity.setUnitId(unitId); - entity.setUserId(id[i]); - - List list = frequentContactsService.selectListByWhere("where user_id = '" + id[i] + "' and unit_id = '" + unitId + "'"); - if (list != null && list.size() > 0) { - //已存在 - } else { - num += frequentContactsService.save(entity); - } - - } - } - } - String resstr = "{\"res\":\"" + num + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 单个删除 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.frequentContactsService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 批量删除 - * - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.frequentContactsService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/msg/MsgController.java b/src/com/sipai/controller/msg/MsgController.java deleted file mode 100644 index a17c1818..00000000 --- a/src/com/sipai/controller/msg/MsgController.java +++ /dev/null @@ -1,1580 +0,0 @@ -package com.sipai.controller.msg; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommString; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.msg.EmppSendUser; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.msg.MsgRecv; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.user.User; -import com.sipai.service.msg.EmppAdminService; -import com.sipai.service.msg.EmppSendService; -import com.sipai.service.msg.EmppSendUserService; -import com.sipai.service.msg.MsgRecvServiceImpl; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import com.sipai.websocket.MsgWebSocket; - - -@Controller -@RequestMapping("/msg") -public class MsgController { - @Resource - private MsgServiceImpl msgService; - @Resource - private MsgRecvServiceImpl msgrecvService; - @Resource - private UserService userService; - @Resource - private MsgTypeService msgtypeService; - @Resource - private ProAlarmService proAlarmService; - @Resource - private EmppSendUserService emppsenduserService; - @Resource - private RedissonClient redissonClient; - - public static String title = "【运维平台】"; - - @RequestMapping("/showMsgrecv.do") - public String showlistrecv(HttpServletRequest request, Model model) { - return "/msg/msgListrecv4mobile"; - } - - @RequestMapping("/showMsgrecv4main.do") - public String showlistrecv4main(HttpServletRequest request, Model model) { - return "/msg/msgListrecv4main"; - } - - @RequestMapping("/showMsgsend.do") - public String showlistsend(HttpServletRequest request, Model model) { - return "/msg/msgListsend"; - } - - @RequestMapping("/showMsgsenddeleted.do") - public String showlistsenddeleted(HttpServletRequest request, Model model) { - return "/msg/msgListsenddeleted"; - } - - @RequestMapping("/showMsgrecvdeleted.do") - public String showlistrecvdeleted(HttpServletRequest request, Model model) { - return "/msg/msgListrecvdeleted"; - } - - @RequestMapping("/showMsgrollbacked.do") - public String showlistrollbacked(HttpServletRequest request, Model model) { - return "/msg/msgListrollbacked"; - } - - @RequestMapping("/getListForSelect.do") - public String getListForSelect(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("id", "U"); - jsonObject1.put("text", "未读"); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", "R"); - jsonObject2.put("text", "已读"); - json.add(jsonObject1); - json.add(jsonObject2); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getMsgrecv.do") - public ModelAndView getMsgrecv(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty() - && !request.getParameter("sort").equals("mrecv") && !request.getParameter("sort").equals("susername") - && !request.getParameter("sort").equals("typename")) { - sort = request.getParameter("sort"); - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("mrecv")) { - sort = " V.redflag desc,V.status "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("susername")) { - sort = " V.redflag desc,U.caption "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("typename")) { - sort = " V.redflag desc,T.name "; - } else { - sort = " V.redflag desc,M.insdt "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - wherestr += " and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' "; - if (request.getParameter("search_susername") != null && !request.getParameter("search_susername").isEmpty()) { - wherestr += "and U.caption like '%" + request.getParameter("search_susername") + "%' "; - } - if (request.getParameter("search_content") != null && !request.getParameter("search_content").isEmpty()) { - wherestr += "and M.content like '%" + request.getParameter("search_content") + "%' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += "and M.sdt>= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += "and M.sdt<= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += "and V.status= '" + request.getParameter("status") + "' "; - } - if (request.getParameter("redFlag") != null && !request.getParameter("redFlag").isEmpty()) { - if (request.getParameter("redFlag").equals("0")) { - wherestr += "and V.status= 'U' "; - } else if (request.getParameter("redFlag").equals("1")) { - wherestr += "and V.status= 'R' "; - } - } - if (request.getParameter("newsType") != null && !request.getParameter("newsType").isEmpty()) { - wherestr += "and T.pid= '" + request.getParameter("newsType") + "' "; - } - - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgrecv(wherestr + orderstr); - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getMsgrecv4APP.do") - public ModelAndView getMsgrecv4APP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty() - && !request.getParameter("sort").equals("mrecv") && !request.getParameter("sort").equals("susername") - && !request.getParameter("sort").equals("typename")) { - sort = request.getParameter("sort"); - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("mrecv")) { - sort = " V.redflag desc,V.status "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("susername")) { - sort = " V.redflag desc,U.caption "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("typename")) { - sort = " V.redflag desc,T.name "; - } else { - sort = " V.redflag desc,M.insdt "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - wherestr += " and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' "; - if (request.getParameter("search_susername") != null && !request.getParameter("search_susername").isEmpty()) { - wherestr += "and U.caption like '%" + request.getParameter("search_susername") + "%' "; - } - if (request.getParameter("search_content") != null && !request.getParameter("search_content").isEmpty()) { - wherestr += "and M.content like '%" + request.getParameter("search_content") + "%' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += "and M.sdt>= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += "and M.sdt<= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("status") != null && !request.getParameter("status").isEmpty()) { - wherestr += "and V.status= '" + request.getParameter("status") + "' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgrecv(wherestr + orderstr); - PageInfo page = new PageInfo(list); - model.addAttribute("list", list); - model.addAttribute("page", page); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /*@RequestMapping("/getMsgrecv.do") - public ModelAndView getMsgrecv(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("mrecv")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("mrecv")){ - sort = " V.redflag desc,V.status "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " V.redflag desc,U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " V.redflag desc,T.name "; - }else{ - sort = " V.redflag desc,M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - wherestr+=" and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+cu.getId()+"' "; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - if(request.getParameter("status")!=null && !request.getParameter("status").isEmpty()){ - wherestr += "and V.status= '"+request.getParameter("status")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgrecv(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getMsgrecv4APP.do") - public ModelAndView getMsgrecv4APP(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("mrecv")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("mrecv")){ - sort = " V.redflag desc,V.status "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " V.redflag desc,U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " V.redflag desc,T.name "; - }else{ - sort = " V.redflag desc,M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - wherestr+=" and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+cu.getId()+"' "; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - if(request.getParameter("status")!=null && !request.getParameter("status").isEmpty()){ - wherestr += "and V.status= '"+request.getParameter("status")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgrecv(wherestr+orderstr); - PageInfo page = new PageInfo(list); - model.addAttribute("list",list); - model.addAttribute("page",page); -JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getMsgsend.do") - public ModelAndView getMsgsend(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("issms")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("issms")){ - sort = " M.issms "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " T.name "; - }else{ - sort = " M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("M.insuser", "msg/getMsgsend.do", cu); - wherestr+=" and M.suserid='"+cu.getId()+"' and M.delflag!='TRUE' and M.sendview='1' "; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgsendlist(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getMsgsenddeleted.do") - public ModelAndView getMsgsenddeleted(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("issms")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("issms")){ - sort = " M.issms "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " T.name "; - }else{ - sort = " M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("M.insuser", "msg/getMsgsend.do", cu); - wherestr+=" and M.suserid='"+cu.getId()+"' and M.delflag!='TRUE' and M.sendview='0' "; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgsendlist(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getMsgrecvdeleted.do") - public ModelAndView getMsgrecvdeleted(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("mrecv")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("mrecv")){ - sort = " V.redflag desc,V.status "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " V.redflag desc,U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " V.redflag desc,T.name "; - }else{ - sort = " V.redflag desc,M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("M.insuser", "msg/getMsgrecv.do", cu); - wherestr+=" and M.issms!='sms' and M.delflag!='TRUE' and V.delflag='TRUE' and V.unitid='"+cu.getId()+"' "; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgrecv(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getMsgrollbacked.do") - public ModelAndView getMsgrollbacked(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty() - &&!request.getParameter("sort").equals("issms")&&!request.getParameter("sort").equals("susername") - &&!request.getParameter("sort").equals("typename")){ - sort = request.getParameter("sort"); - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("issms")){ - sort = " M.issms "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("susername")){ - sort = " U.caption "; - }else if(request.getParameter("sort")!=null&&request.getParameter("sort").equals("typename")){ - sort = " T.name "; - }else{ - sort = " M.insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("M.insuser", "msg/getMsgsend.do", cu); - wherestr+=" and M.suserid='"+cu.getId()+"' and M.delflag='TRUE' and M.sendview='1'"; - if(request.getParameter("search_susername")!=null && !request.getParameter("search_susername").isEmpty()){ - wherestr += "and U.caption like '%"+request.getParameter("search_susername")+"%' "; - } - if(request.getParameter("search_content")!=null && !request.getParameter("search_content").isEmpty()){ - wherestr += "and M.content like '%"+request.getParameter("search_content")+"%' "; - } - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += "and M.sdt>= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += "and M.sdt<= '"+request.getParameter("edt")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgsendlist(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/addMsg.do") - public String doadd(HttpServletRequest request,Model model){ - return "msg/msgAdd"; - } - @RequestMapping("/fakedeleteMsg.do") - public String fakedelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String setandwhere=" set sendview='0' where id='"+id+"'"; - int result = this.msgService.updateMsgBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/fakedeleteMsgs.do") - public String fakedeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - String setandwhere=" set sendview='0' where id in ('"+ids+"')"; - int result = this.msgService.updateMsgBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/fakedeleteMsgRecv.do") - public String fakedeleterecv(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String setandwhere=" set delflag='TRUE' where id='"+id+"' "; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/fakedeleteMsgRecvs.do") - public String fakedeletesrecvs(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - String setandwhere=" set delflag='TRUE' where id in ('"+ids+"') "; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - /*消息撤回,在别人还没看到情况下,撤回消息:delflag=true消息看不到 - * */ - @RequestMapping("/rollbackMsg.do") - public String rollbackmsg(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = 0; - List list = this.msgrecvService.selectListByWhere(" where masterid='" + id + "' and status='R' "); - if (list.isEmpty() || list.size() == 0) { - String setandwhere = " set delflag='TRUE' where id='" + id + "'"; - result = this.msgService.updateMsgBySetAndWhere(setandwhere); - } - model.addAttribute("result", result); - return "result"; - } - - /*服务器消息彻底删除,一般不允许 - * */ - @RequestMapping("/deleteMsg.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.msgService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deleteMsgs.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.msgService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /*接受者的消息删除 - * */ - @RequestMapping("/deleteMsgRecv.do") - public String dodelrecv(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { -// String setandwhere=" set delflag='TRUE' where masterid='"+id+"' "; - String setandwhere = " set delflag='TRUE' where id='" + id + "' "; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deleteMsgRecvs.do") - public String dodelrecvs(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - String setandwhere = " set delflag='TRUE' where masterid in ('" + ids + "') "; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - - /*发送者的消息删除,sendview=-1 - * */ - @RequestMapping("/deleteMsgsend.do") - public String deleteMsgsend(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String setandwhere = " set sendview='-1' where id='" + id + "'"; - int result = this.msgService.updateMsgBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deleteMsgsends.do") - public String deleteMsgsends(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - String setandwhere = " set sendview='-1' where id in ('" + ids + "')"; - int result = this.msgService.updateMsgBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/setRedflag.do") - public String setRedflag(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - String setandwhere = " set redflag='1' where masterid='" + id + "' and unitid='" + cu.getId() + "' and redflag='0'"; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/resetRedflag.do") - public String resetRedflag(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - String setandwhere = " set redflag='0' where masterid='" + id + "' and unitid='" + cu.getId() + "' and redflag='1'"; - int result = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - model.addAttribute("result", result); - return "result"; - } - - /** - * 为亿美短信方式保存消息和手机短信 - * - * @return result 发送成功,发送失败,无权限 - */ - @RequestMapping("/saveMsgYM.do") - public String dosaveym(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String mtypeid = ""; - String result = ""; - if (request.getParameter("mtype").equals("personal")) { - mtypeid = this.msgtypeService.getMsgType(" where name='个人信息'").get(0).getId(); - } else { - mtypeid = request.getParameter("mtype"); - } - String sendway = request.getParameter("sendway"); - String content = request.getParameter("content"); - String recvid = request.getParameter("recvid"); - String redflag = request.getParameter("redflag"); - String cuid = cu.getId(); - result = this.msgService.insertMsgSend(mtypeid, content, recvid, cuid, redflag); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 为亿美短信方式 仅保存短信和发送短信 /saveMsgYM.do调用的地方较多 怕影响 - * - * @return result 发送成功,发送失败,无权限 - */ - @RequestMapping("/saveMsgYMMobile.do") - public String dosaveymMobile(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String mtypeid = ""; - String result = ""; - mtypeid = this.msgtypeService.getMsgType(" where name='管理员消息'").get(0).getId(); - String sendway = request.getParameter("sendway"); - String content = request.getParameter("content"); - String recvid = request.getParameter("recvid"); - String redflag = request.getParameter("redflag"); - String unitId = request.getParameter("unitId"); - String cuid = cu.getId(); -// result = this.msgService.insertMsgSendMobileZY1C(mtypeid, content, recvid, cuid, redflag, sendway); - if (unitId != null && unitId.equals("021ZY1C")) { - //转为竹一定制 所有短信只能发给周章华 - result = this.msgService.insertMsgSendMobileZY1C(mtypeid, content, recvid, cuid, redflag, sendway); - } else { - result = this.msgService.insertMsgSendMobile(mtypeid, content, recvid, cuid, redflag, sendway); - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/addMsg.do") - public String doadd(HttpServletRequest request, Model model) { - return "msg/msgAdd"; - } - - @RequestMapping("/addMobileMsg.do") - public String addMobileMsg(HttpServletRequest request, Model model) { - return "msg/msgMobileAdd"; - } - - @RequestMapping("/getMsgsend.do") - public ModelAndView getMsgsend(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty() - && !request.getParameter("sort").equals("issms") && !request.getParameter("sort").equals("susername") - && !request.getParameter("sort").equals("typename")) { - sort = request.getParameter("sort"); - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("issms")) { - sort = " M.issms "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("susername")) { - sort = " U.caption "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("typename")) { - sort = " T.name "; - } else { - sort = " M.insdt "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = CommUtil.getwherestr("M.insuser", "msg/getMsgsend.do", cu); - wherestr += " and M.suserid='" + cu.getId() + "' and M.delflag!='TRUE' and M.sendview='1' "; - if (request.getParameter("search_susername") != null && !request.getParameter("search_susername").isEmpty()) { - wherestr += "and U.caption like '%" + request.getParameter("search_susername") + "%' "; - } - if (request.getParameter("search_content") != null && !request.getParameter("search_content").isEmpty()) { - wherestr += "and M.content like '%" + request.getParameter("search_content") + "%' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += "and M.sdt>= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += "and M.sdt<= '" + request.getParameter("edt") + "' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgService.getMsgsendlist(wherestr + orderstr); - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取短信发送的List - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMobileMsgSend.do") - public ModelAndView getMobileMsgSend(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty() - && !request.getParameter("sort").equals("issms") && !request.getParameter("sort").equals("susername") - && !request.getParameter("sort").equals("typename")) { - sort = request.getParameter("sort"); - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("issms")) { - sort = " M.issms "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("susername")) { - sort = " U.caption "; - } else if (request.getParameter("sort") != null && request.getParameter("sort").equals("typename")) { - sort = " T.name "; - } else { - sort = " M.insdt "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; -// String wherestr = CommUtil.getwherestr("M.insuser", "msg/getMsgsend.do", cu); -// wherestr += " and M.suserid='" + cu.getId() + "' and M.delflag!='TRUE' and M.sendview='1' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and (U.caption like '%" + request.getParameter("search_susername") + "%' or M.content like '%" + request.getParameter("search_content") + "%') "; - } -// if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { -// wherestr += "and M.content like '%" + request.getParameter("search_content") + "%' "; -// } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += "and M.sdt>= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += "and M.sdt<= '" + request.getParameter("edt") + "' "; - } - - //只获取短信的数据 - wherestr += "and M.issms = 'sms' "; - - PageHelper.startPage(pages, pagesize); -// System.out.println(wherestr); - List list = this.msgService.getMsgsendlistMobile(wherestr + orderstr); - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 为亿美短信方式保存消息和手机短信 - * - * @return result 发送成功,发送失败,无权限 - */ - @RequestMapping("/sendNewsFromAlarm.do") - public String sendNewsFromAlarm(HttpServletRequest request, Model model) { - String sendType = request.getParameter("sendType"); - String sender = request.getParameter("sender"); - String content = request.getParameter("content"); - String msgtypeid = request.getParameter("msgtypeid"); - String receivers = request.getParameter("receivers"); - String mpid = request.getParameter("mpid"); - - this.proAlarmService.topAlarmNumC(request, mpid, ProAlarm.C_type_add); - - String resstr = this.msgService.sendNewsFromAlarm(sendType, sender, content, msgtypeid, receivers); - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 为empp短信方式保存消息和手机短信 - * - * @return result 发送成功,发送失败,无权限 - */ /* - @RequestMapping("/saveMsgEMPP.do") - public String dosaveempp(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - String mtypeid=""; - int result=0; - if(request.getParameter("mtype").equals("personal")){ - mtypeid=this.msgtypeService.getMsgType(" where name='个人信息'").get(0).getId(); - }else if(request.getParameter("mtype").equals("public")){ - mtypeid=this.msgtypeService.getMsgType(" where name='公告提醒'").get(0).getId(); - }else{ - mtypeid=request.getParameter("mtype"); - } - String content=request.getParameter("content"); - String recvid=request.getParameter("recvid"); - String cuid=cu.getId(); - result=this.msgService.insertMsgSendEmpp(mtypeid,content,recvid,cuid); - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - }*/ - /*@RequestMapping("/viewMsgRecv.do") - public String doviewrecv(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - String msgId = request.getParameter("id"); - String orderstr=" order by M.insdt "; - String wherestr="where 1=1"; -// wherestr+=" and M.id='"+msgId+"' and V.unitid='"+cu.getId()+"' "; - wherestr+=" and M.id='"+msgId+"' and V.unitid='"+cu.getId()+"' "; - List list = this.msgService.getMsgrecv(wherestr+orderstr); - if(request.getParameter("send")==null){ - String readstatus=list.get(0).getMrecv().get(0).getStatus(); - if(readstatus.equals("U")){ - //第一次浏览 - String setandwhere=" set status='R' ,readtime= '"+CommUtil.nowDate()+"' where id='"+list.get(0).getMrecv().get(0).getId()+"' "; - int res=this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - if(res==1){ - //websocket发动推松到前台 - for(Map item: MsgWebSocket.webSocketSet){ - if(item.get("key").equals(cu.getId())){ - try { - ((MsgWebSocket)item.get("ws")).sendMessage(""); - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - } - } - } - User suser=this.userService.getUserById(list.get(0).getSuserid()); - model.addAttribute("msg", list.get(0)); - model.addAttribute("recv", cu.getCaption()); - model.addAttribute("suser", suser.getCaption()); - if(request.getParameter("ng") != null ){ - String result = "{\"recv\":\"" + cu.getCaption() + "\",\"suser\":\"" + suser.getCaption() + "\"}"; - model.addAttribute("result", result); - return "result"; - } - return "msg/msgViewRecv"; - }*/ - @RequestMapping("/viewMsgRecv.do") - public String doviewrecv(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String msgrecvId = request.getParameter("id"); - String wherestrrecv = "where 1=1"; - wherestrrecv += " and masterid='" + msgrecvId + "'"; - List recvlist = this.msgrecvService.selectListByWhere(wherestrrecv); - if (recvlist != null && recvlist.size() > 0) { - String msgId = recvlist.get(0).getMasterid(); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1"; -// wherestr+=" and M.id='"+msgId+"' and V.unitid='"+cu.getId()+"' "; - wherestr += " and M.id='" + msgId + "' and V.unitid='" + cu.getId() + "' "; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - if (request.getParameter("send") == null) { - String readstatus = list.get(0).getMrecv().get(0).getStatus(); - if (readstatus.equals("U")) { - //第一次浏览 - String setandwhere = " set status='R' ,readtime= '" + CommUtil.nowDate() + "' where id='" + list.get(0).getMrecv().get(0).getId() + "' "; - int res = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - /*if(res==1){ - //websocket发动推松到前台 - for(Map item: MsgWebSocket.webSocketSet){ - if(item.get("key").equals(cu.getId())){ - try { - ((MsgWebSocket)item.get("ws")).sendMessage(""); - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - }*/ - } - } - User suser = this.userService.getUserById(list.get(0).getSuserid()); - model.addAttribute("msg", list.get(0)); - model.addAttribute("mrecv", list.get(0).getMrecv().get(0)); - model.addAttribute("recv", cu.getCaption()); - model.addAttribute("suser", suser.getCaption()); - if (request.getParameter("ng") != null) { - String result = "{\"recv\":\"" + cu.getCaption() + "\",\"suser\":\"" + suser.getCaption() + "\"}"; - model.addAttribute("result", result); - return "result"; - } - } - - return "msg/msgViewRecv"; - } - - @RequestMapping("/updateMsgRecvStatus.do") - public String updateMsgRecvStatus(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1"; - String ids = request.getParameter("ids"); - if (ids != "" && ids != null) { - ids = ids.replace(",", "','"); - wherestr += " and M.id in ('" + ids + "') and V.unitid='" + cu.getId() + "' "; - } else { - wherestr += " and V.unitid='" + cu.getId() + "' "; - } - List list = this.msgService.getMsgrecv(wherestr + orderstr); - boolean ress = false; - for (Msg msg : list) { - String readstatus = msg.getMrecv().get(0).getStatus(); - if (readstatus.equals("U")) { - //第一次浏览 - String setandwhere = " set status='R' ,readtime= '" + CommUtil.nowDate() + "' where id='" + msg.getMrecv().get(0).getId() + "' "; - int res = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - if (res == 1) { - ress = true; - } - } - } - if (ress) { - //websocket发动推送到前台 - for (Map item : MsgWebSocket.webSocketSet) { - if (item.get("key").equals(cu.getId())) { - try { - ((MsgWebSocket) item.get("ws")).sendMessage(CommUtil.nowDate()); - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - } - String result = "{\"res\":" + ress + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/viewMsgSend.do") - public String doviewsend(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String msgId = request.getParameter("id"); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1"; - wherestr += " and M.id='" + msgId + "' and M.suserid='" + cu.getId() + "' "; - List list = this.msgService.getMsgsend(wherestr + orderstr); - User suser = this.userService.getUserById(list.get(0).getSuserid()); - model.addAttribute("msg", list.get(0)); - model.addAttribute("recv", cu.getCaption()); - model.addAttribute("suser", suser.getCaption()); - return "msg/msgViewSend"; - } - - @RequestMapping("/viewMsgFast.do") - public ModelAndView doviewfast(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String msgId = request.getParameter("id"); - String morder = request.getParameter("morder"); - String sdt = request.getParameter("sdt"); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1 "; - wherestr += "and M.issms!='sms' and M.id<>'" + msgId + "' and M.delflag!='TRUE'"; - if (request.getParameter("send") != null && request.getParameter("send").equals("true")) { - //发消息-查看消息 - wherestr += " and M.suserid='" + cu.getId() + "'"; - } else { - //收消息-查看消息 - wherestr += " and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' "; - } - if (morder.equals("pre")) { - orderstr += " desc "; - wherestr += " and M.sdt<='" + sdt + "' "; - } else if (morder.equals("next")) { - orderstr += " asc "; - wherestr += " and M.sdt>='" + sdt + "' "; - } - List list = this.msgService.getMsgrecvTop1(wherestr + orderstr); - String result = null; - if (list.size() != 0) { - if (request.getParameter("send") != null && request.getParameter("send").equals("false")) { - String readstatus = list.get(0).getMrecv().get(0).getStatus(); - if (readstatus.equals("U")) { - //收消息-第一次浏览 - String setandwhere = " set status='R' ,readtime= '" + CommUtil.nowDate() + "' where id='" + list.get(0).getMrecv().get(0).getId() + "' "; - this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - } - } - User suser = this.userService.getUserById(list.get(0).getSuserid()); - JSONArray json = JSONArray.fromObject(list.get(0)); - result = "{\"recv\":\"" + cu.getCaption() + "\",\"suser\":\"" + suser.getCaption() + "\",\"rows\":" + json + "}"; - } else { - if (morder.equals("next")) { - result = "{\"rows\":\"\",\"res\":\"已是最后一条消息\"}"; - } else { - result = "{\"rows\":\"\",\"res\":\"已是第一条消息\"}"; - } - - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/viewMsgStatus.do") - public String doviewstatus(HttpServletRequest request, Model model) { - String msgId = request.getParameter("id"); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1"; - wherestr += " and M.id='" + msgId + "' "; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - String checker = "";//已浏览者 - String notchecker = "";//未浏览者 - if (list.size() > 0) { - List msgrecvlist = list.get(0).getMrecv(); - for (int i = 0; i < msgrecvlist.size(); i++) { - String readstatus = msgrecvlist.get(i).getStatus(); - String accepterid = msgrecvlist.get(i).getUnitid(); - String readtime = CommUtil.formatDate("yyyy-MM-dd hh:mm:ss", msgrecvlist.get(i).getReadtime()); - User accepter = this.userService.getUserById(accepterid); - if (readstatus.equals("U")) { - notchecker += accepter.getCaption() + ","; - } else { - checker += accepter.getCaption() + "[" + readtime + "],"; - } - } - } - if (notchecker.length() > 1) { - notchecker = notchecker.substring(0, notchecker.length() - 1); - } - if (checker.length() > 1) { - checker = checker.substring(0, checker.length() - 1); - } - model.addAttribute("checker", checker); - model.addAttribute("notchecker", notchecker); - - return "msg/msgViewstatus"; - } - - @RequestMapping("/getUnreadMsgNum.do") - public String getunreadmsgnum(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String orderstr = " order by M.insdt desc"; - String wherestr = " where 1=1"; - wherestr += " and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' and V.status='U'"; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - model.addAttribute("result", list.size()); - return "result"; - } - - @RequestMapping("/getUnreadMsgs.do") - public String getUnreadMsgs(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by M.insdt desc"; - String wherestr = " where 1=1"; - wherestr += " and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' and V.status='U'"; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + jsonArray.toString() + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 给主页显示当天的需滚动消息 - */ - @RequestMapping("/getUnreadMsgs4main.do") - public String getUnreadMsgs4main(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - calendar.add(Calendar.DATE, -1); - String nowDate = simpleDateFormat.format(calendar.getTime()); - String orderstr = " order by M.insdt desc"; - String wherestr = " where 1=1"; - wherestr += " and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' and V.status='U' "; -// wherestr+=" and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+cu.getId()+"' and V.status='U' and m.insdt>='"+nowDate+"' "; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + jsonArray.toString() + "}"; - model.addAttribute("result", result); - return "result"; - } - - @SuppressWarnings("null") - @RequestMapping("/viewSms.do") - public String doviewsms(HttpServletRequest request, Model model) { - String msgId = request.getParameter("id"); - String recvid = ""; - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1"; - wherestr += " and M.id='" + msgId + "' "; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - List listesu = this.emppsenduserService.selectListByWhere(" where emppsendid='" + msgId + "'"); - List listuserrecv = new ArrayList(); - for (int i = 0; i < listesu.size(); i++) { - User recvuser = this.userService.getUserById(listesu.get(i).getRecuserid()); - listuserrecv.add(recvuser);//短信名单 - recvid += recvuser.getId() + ",";//短信名单 - } - User suser = this.userService.getUserById(list.get(0).getSuserid()); - List viewlist = new ArrayList(); - viewlist.add(list.get(0)); - String parentid = msgId; - String insdttmp = list.get(0).getInsdt(); - String wherestrtmp = " where 1=1 and M.pid='" + parentid + "' and M.insdt>'" + insdttmp + "' and M.issms='sms'"; - do { - List listtmp = this.msgService.getMsgrecv(wherestrtmp + orderstr); - if (listtmp.isEmpty()) { - break; - } - for (int i = 0; i < listtmp.size(); i++) { - viewlist.add(listtmp.get(i)); - parentid = listtmp.get(i).getId(); - insdttmp = listtmp.get(i).getInsdt(); - } - wherestrtmp = " where 1=1 and M.pid='" + parentid + "' and M.insdt>'" + insdttmp + "' and M.issms='sms'"; - } while (true); - model.addAttribute("msg", list.get(0)); - model.addAttribute("viewlist", viewlist); - model.addAttribute("listuserrecv", listuserrecv); - model.addAttribute("recvid", recvid); - model.addAttribute("suser", suser); - return "msg/smsView"; - } - - @RequestMapping("/sendnewSms.do") - public String sendnewym(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String smsid = CommUtil.getUUID(); - int result = 0; - //发送短信 - //获得手机短信发送名单 - String[] recvids = request.getParameter("recvid").split(","); - List userlist = new ArrayList(); - String[] mobilearr = new String[recvids.length]; - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - } - } - int i1 = 9999; - try { - i1 = new Client("6SDK-EMY-6688-KJTSR", "zaqwsx").registEx("234147"); - i1 = new Client("6SDK-EMY-6688-KJTSR", "zaqwsx").sendSMS(mobilearr, - title + request.getParameter("content"), "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - JSONArray json = null; - //发送成功 - if (i1 == 0) { - Msg sms = new Msg(); - sms.setContent(request.getParameter("content")); - sms.setId(smsid); - sms.setSdt(CommUtil.nowDate()); - sms.setInsdt(CommUtil.nowDate()); - sms.setInsuser(cu.getId()); - sms.setDelflag("FALSE"); - sms.setTypeid(request.getParameter("typeid")); - sms.setSuserid(cu.getId()); - sms.setIssms("sms"); - sms.setPid(request.getParameter("parentid")); - result = this.msgService.saveMsg(sms); - json = JSONArray.fromObject(sms); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cu.getId()); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cu.getId()); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cu.getId()); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - } - String resstr = "{\"res\":\"" + result + "\",\"parentid\":\"" + smsid + "\",\"rows\":" + json + ",\"susername\":\"" + cu.getCaption() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/replymsg.do") - public String doreplymsg(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String msgId = request.getParameter("id"); - String recvid = ""; - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1"; - wherestr += " and M.id='" + msgId + "' "; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - recvid = list.get(0).getSuserid(); - User suser = this.userService.getUserById(recvid); - //该msg之后列表 - List viewlist = new ArrayList(); - viewlist.add(list.get(0)); - String parentid = msgId; - String insdttmp = list.get(0).getInsdt(); - String wherestrtmp = " where 1=1 and M.pid='" + parentid + "' and M.insdt>'" + insdttmp + "' and M.issms='msg'"; - do { - List listtmp = this.msgService.getMsgrecv(wherestrtmp + orderstr); - if (listtmp.isEmpty()) { - break; - } - for (int i = 0; i < listtmp.size(); i++) { - viewlist.add(listtmp.get(i)); - parentid = listtmp.get(i).getId(); - insdttmp = listtmp.get(i).getInsdt(); - } - wherestrtmp = " where 1=1 and M.pid='" + parentid + "' and M.insdt>'" + insdttmp + "' and M.issms='msg'"; - } while (true); - //该msg之前列表 - List viewlistpre = new ArrayList(); - String preparentid = list.get(0).getPid(); - String preinsdttmp = list.get(0).getInsdt(); - String prewherestrtmp = " where 1=1 and M.id='" + preparentid + "' and M.insdt<'" + preinsdttmp + "' and M.issms='msg'"; - String preorderstr = " order by M.insdt desc"; - do { - List listtmp2 = this.msgService.getMsgrecv(prewherestrtmp + preorderstr); - if (listtmp2.isEmpty()) { - break; - } - for (int i = 0; i < listtmp2.size(); i++) { - viewlistpre.add(listtmp2.get(i)); - preparentid = listtmp2.get(i).getPid(); - preinsdttmp = listtmp2.get(i).getInsdt(); - } - prewherestrtmp = " where 1=1 and M.id='" + preparentid + "' and M.insdt<'" + preinsdttmp + "' and M.issms='msg'"; - } while (true); - if (!viewlistpre.isEmpty()) { - Collections.reverse(viewlistpre); - } - viewlistpre.addAll(viewlist); - model.addAttribute("msg", list.get(0)); - model.addAttribute("viewlist", viewlistpre); - //model.addAttribute("listuserrecv", listuserrecv); - model.addAttribute("recvid", recvid); - model.addAttribute("suser", suser);//联系人 - model.addAttribute("cu", cu);//用户本人 - return "msg/msgViewReply"; - } - - @RequestMapping("/replynewMsg.do") - public String replynewmsg(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String mtypeid = ""; - int result = 0; - mtypeid = this.msgtypeService.getMsgType(" where name='个人信息'").get(0).getId(); - String content = request.getParameter("content"); - String recvid = request.getParameter("recvid"); - String cuid = cu.getId(); - - MsgType mtype = new MsgType(); - mtype = this.msgtypeService.getMsgType(" where T.id='" + mtypeid + "'").get(0); - mtypeid = mtype.getId(); - - Msg msg = new Msg(); - msg.setContent(content); - msg.setId(CommUtil.getUUID()); - msg.setSdt(CommUtil.nowDate()); - msg.setInsdt(CommUtil.nowDate()); - msg.setInsuser(cuid); - - msg.setDelflag("FALSE"); - msg.setTypeid(mtypeid); - msg.setSuserid(cuid); - msg.setIssms("msg"); - msg.setPid(request.getParameter("parentid")); - result = this.msgService.saveMsg(msg); - this.msgrecvService.saveRecv(recvid, msg.getId(), "0"); - JSONArray json = JSONArray.fromObject(msg); - String resstr = "{\"res\":\"" + result + "\",\"parentid\":\"" + msg.getId() + "\",\"rows\":" + json + ",\"susername\":\"" + cu.getCaption() + "\"}"; - ; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getMsgRecvNum.do") - public String getMsgRecvNum(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String newsType = request.getParameter("newsType"); - - String wherestr = "where 1=1"; - wherestr += " and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' and T.pid= '" + newsType + "' "; - - List listU = this.msgService.getMsgrecvNum(wherestr + " and V.status= 'U' "); - List listR = this.msgService.getMsgrecvNum(wherestr + " and V.status= 'R' "); - - int unews = listU.get(0).getNewsNum(); - int rnews = listR.get(0).getNewsNum(); - int totalnews = unews + rnews; - Map ret = new HashMap(); - ret.put("unews", unews); - ret.put("rnews", rnews); - ret.put("totalnews", totalnews); - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/updateAllMsgRecvStatus.do") - public String updateAllMsgRecvStatus(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1 and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' and V.status= 'U' and T.pid= '" + request.getParameter("tablename") + "'"; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - boolean ress = false; - String ids = ""; - for (Msg msg : list) { - ids += msg.getMrecv().get(0).getId() + ","; - } - ids = ids.replace(",", "','"); - String setandwhere = " set status='R' ,readtime= '" + CommUtil.nowDate() + "' where id in ('" + ids + "') "; - int res = this.msgrecvService.updateMsgRecvBySetAndWhere(setandwhere); - if (res == 1) { - ress = true; - } - String result = "{\"res\":" + ress + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deleteAllMsgRecv.do") - public String deleteAllMsgRecv(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by M.insdt "; - String wherestr = "where 1=1 and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='" + cu.getId() + "' and T.pid= '" + request.getParameter("tablename") + "'"; - List list = this.msgService.getMsgrecv(wherestr + orderstr); - boolean ress = false; - String ids = ""; - for (Msg msg : list) { - ids += msg.getMrecv().get(0).getId() + ","; - } - ids = ids.replace(",", "','"); - - String deletewhere = " where id in ('" + ids + "') "; - int res = this.msgrecvService.deleteByWhere(deletewhere); - if (res == 1) { - ress = true; - } - String result = "{\"res\":" + ress + "}"; - model.addAttribute("result", result); - return "result"; - } -//end - - /** - * 短信发送列表 - * sj 2023-08-23 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showMsgList.do") - public String showMsgList(HttpServletRequest request, Model model) { - return "/msg/msgMobileList"; - } - - - @RequestMapping("/sendMsgTel.do") - public String sendMsgTel(HttpServletRequest request, Model model) { - String tel = request.getParameter("tel"); - //初始化 redis - RMap map_redis = redissonClient.getMap("zy1c_msg_tel"); - map_redis.put("tel", tel); - model.addAttribute("result", "当前号码为:"+map_redis.get("tel")); - return "result"; - } - -} diff --git a/src/com/sipai/controller/msg/MsgPushServlet.java b/src/com/sipai/controller/msg/MsgPushServlet.java deleted file mode 100644 index e3d9ae13..00000000 --- a/src/com/sipai/controller/msg/MsgPushServlet.java +++ /dev/null @@ -1,353 +0,0 @@ -package com.sipai.controller.msg; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.msg.Msg; - - -@SuppressWarnings("serial") -public class MsgPushServlet extends HttpServlet { - - static protected Hashtable connections = new Hashtable(); - static String context; - static protected MessageSender messageSender = null; - - @Override - public void init() throws ServletException { - context = getServletContext().getContextPath(); - messageSender = new MessageSender(); - Thread messageSenderThread = new Thread(messageSender, "MessageSender[" - + getServletContext().getContextPath() + "]"); - messageSenderThread.setDaemon(true); - messageSenderThread.start(); - } - - @Override - public void destroy() { - connections.clear(); - messageSender.stop(); - messageSender = null; - } - - - -// public void event(CometEvent event) throws IOException, ServletException { -// HttpServletRequest request = event.getHttpServletRequest(); -// HttpServletResponse response = event.getHttpServletResponse(); -// -// if ("POST".equals(request.getMethod()) -// && request.getParameter("action") != null -// && request.getParameter("action").equalsIgnoreCase("proxy")) { -// request.setCharacterEncoding("UTF-8"); -// Msg msg = new Msg(); -// msg.setContent(request.getParameter("content")); -// com.sipai.user.User user = (com.sipai.user.User)request.getSession(true).getAttribute("cu"); -// msg.set_susername(user.getCaption()); -// msg.setSuserid(user.getId()); -// messageSender.send(request.getParameter("userid"), msg); -// event.close(); -// return; -// } -// -// if (event.getEventType() == CometEvent.EventType.BEGIN) { -// event.setTimeout(60 * 1000 * 60 * 24); -// log("Begin for session: " + request.getSession(true).getId()); -// -// response.setContentType("text/html;charset=UTF-8"); -// PrintWriter writer = response.getWriter(); -// writer -// .println("<%@ page contentType=\"text/html;charset=UTF-8\" pageEncoding=\"UTF-8\" language=\"java\"%>"); -// writer.println(""); -// writer.println(""); -// writer.println(" "); -// writer.println(""); -// writer.println(""); -// writer -// .println(""); -// writer -// .println(""); -// writer.println(""); -// writer.println(""); -// -// writer.flush(); -// -// synchronized (connections) { -// -// if (request.getSession().getAttribute("cu") != null) { -// String sessionid = request.getSession(true).getId(); -// String userid = ((com.sipai.user.User) request.getSession() -// .getAttribute("cu")).getId(); -// if (connections.get(sessionid + "," + userid) != null) { -// connections.remove(sessionid + "," + userid); -// connections.put(sessionid + "," + userid, response); -// System.out.println("connections new add " + sessionid + "," -// + userid); -// }else{ -// connections.put(sessionid + "," + userid, response); -// System.out.println("connections add " + sessionid + "," -// + userid); -// } -// pendingMessage(userid);// 建立新连接时才pending -// -// userid = null; -// sessionid = null; -// } -// } -// -// -// } else if (event.getEventType() == CometEvent.EventType.ERROR) { -// } else if (event.getEventType() == CometEvent.EventType.END) { -// PrintWriter writer = response.getWriter(); -// writer.println(""); -// event.close(); -// } else if (event.getEventType() == CometEvent.EventType.READ) { -// } -// } - - public class MessageSender implements Runnable { - protected boolean running = true; - protected Hashtable> messages = new Hashtable>(); - - public MessageSender() { - } - - public void stop() { - running = false; - } - - - /**给指定的用户发送消息,-1时为所有在线的用户,对于系统发出的消息默认像系统用户发送一次 - * @param user - * @param msg - */ - public void send(String user, Msg msg) { - synchronized (messages) { - if (user.equalsIgnoreCase("-1")) { - synchronized (connections) { - Iterator csi = connections.keySet().iterator(); - while (csi.hasNext()) { - String cid = csi.next().split(",")[1]; - if (messages.get(cid) == null) { - messages.put(cid, - new ArrayList()); - } - - messages.get(cid).add(msg); - cid = null; - } - csi = null; - } - } else { - if (messages.get(user) == null) { - messages.put(user, new ArrayList()); - } - messages.get(user).add(msg); - } - /*if(msg.getSuserid().equalsIgnoreCase("SYSTEM")){ - if (messages.get("SYSTEM") == null) { - messages.put("SYSTEM", new ArrayList()); - } - messages.get("SYSTEM").add(msg); - }*/ - messages.notify(); - } - } - - /**直接根据msg对象的内容进行消息的发送,根据msg.get_recvid()确定发送的对象,对于系统发出的消息默认像系统用户发送一次 - * @param msg - */ - public void send(Msg msg,ArrayList recvid) { - synchronized (messages) { - ArrayList userlist = recvid; - if(userlist!=null){ - for(int i=0;i0){ - if (messages.get(userlist.get(i).trim()) == null) { - messages.put(userlist.get(i).trim(), new ArrayList()); - } - msg.setContent("1"); - msg.setSuserid("-1"); - messages.get(userlist.get(i).trim()).add(msg); - } - } - messages.notify(); - } - } - } - - public void run() { - while (running) { - if (messages.size() == 0) { - try { - synchronized (messages) { - messages.wait(); - } - } catch (InterruptedException e) { - // Ignore - } - } - synchronized (connections) { - try{ - synchronized (messages) { - //System.out.println(messages.size()); - Iterator si = messages.keySet().iterator(); - while (si.hasNext()) { - String userid = si.next(); - StringBuffer pendingMessages = new StringBuffer(); - if(messages.get(userid).size()==0){ - continue; - } - for (int i = 0; i < messages.get(userid).size(); i++) { - //System.out.println(messages.get(userid)+""); - /*if("blank".equals(messages.get(userid).get(i).getUrl())){ - pendingMessages.delete(0, pendingMessages.length()); - }else{*/ - pendingMessages.append(""); - if(messages.get(userid).get(i).getUrl()!=null && messages.get(userid).get(i).getUrl().trim().length()>0){ - - pendingMessages.append(""); - pendingMessages.append(""); - pendingMessages.append(""); - if(messages.get(userid).get(i).getUrl()!=null && messages.get(userid).get(i).getUrl().trim().length()>0){ - pendingMessages.append(""); - pendingMessages.append("
"); - - }else{ - pendingMessages.append("
"); - } - pendingMessages.append(messages.get(userid).get(i).getSdt()); - pendingMessages.append("
"); - //pendingMessages.append(messages.get(userid).get(i).get_susername()); - pendingMessages.append("
"); - pendingMessages.append(messages.get(userid).get(i).getContent()); - }else{ - pendingMessages.append(""); - pendingMessages.append(messages.get(userid).get(i).getContent()); - } - pendingMessages.append("

"); - pendingMessages.append(""); - - //2010-02-23原来使用每个消息的弹出方式,目前需要修改为系统提示您有几条短消息 -// if(messages.get(userid).get(i).getAlerturl()!=null && messages.get(userid).get(i).getAlerturl().trim().length()>0){ -// pendingMessages.append(""); -// }else{ -// pendingMessages.append(""); -// } - //2010-02-23原来使用每个消息的弹出方式,目前需要修改为系统提示您有几条短消息 - pendingMessages.append(""); - - - - //} - - } - messages.clear(); - if(pendingMessages.length()==0){ - continue; - } - Iterator csi = connections.keySet() - .iterator(); - while (csi.hasNext()) { - String cid = csi.next(); - if (cid.split(",")[1].equalsIgnoreCase(userid)) { - try { - PrintWriter writer = connections.get( - cid).getWriter(); - writer.println(pendingMessages.toString()); - writer.println("
"); - writer.flush(); - } catch (IOException e) { - //log("IOExeption sending message", e); - } - } - cid = null; - } - csi = null; - userid = null; - pendingMessages.delete(0, pendingMessages.length()); - pendingMessages=null; - - //messages.remove(userid); - } - } - }catch(Throwable e){ - e.printStackTrace(); - } - } - } - } - } - - /**按照userid的指定发送消息,忽略消息中的recvid数组,userid为-1时想所有在线用户发送 - * @param userid - * @param msg - */ - public static String sendMessage(String userid, Msg msg) { - - if(messageSender!=null){ - messageSender.send(userid,msg); - return "sent"; - }else{ - return "false"; - } - } - - /**按照msgrecvid数组中指定的用户发送消息 - * @param msg - */ - public static String sendMessage(Msg msg,ArrayList recvid) { - if(messageSender!=null){ - messageSender.send(msg,recvid); - return "sent"; - }else{ - return "false"; - } - } - - /**读取用所有未读的信息 - * @param userid - */ -/* public void pendingMessage(String userid) { -// ArrayList ma = new ArrayList();// 为得到消息的信息 - MsgDAO md = new MsgDAO(); -// ma = md.getUserUnreadMsg(userid); -// md = null; -// if (ma != null) { -// for (int i = 0; i < ma.size(); i++) { -// if(messageSender!=null){ -// messageSender.send(userid, ma.get(i)); -// } -// } -// } -// ma = null; - int count = md.getUserUnreadMsgCount(userid); - if(count>0){ - Msg msg= new Msg(); - msg.setContent(String.valueOf(count)); - messageSender.send(userid, msg); - } - }*/ - -} diff --git a/src/com/sipai/controller/msg/MsgTypeController.java b/src/com/sipai/controller/msg/MsgTypeController.java deleted file mode 100644 index 0a9a042a..00000000 --- a/src/com/sipai/controller/msg/MsgTypeController.java +++ /dev/null @@ -1,494 +0,0 @@ -package com.sipai.controller.msg; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.annotation.JsonFormat.Value; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.msg.MsgAlarmlevel; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.msg.Msguser; -import com.sipai.entity.msg.Smsuser; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.msg.MsgAlarmlevelService; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.service.user.RoleService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/msg") -public class MsgTypeController { - @Resource - private MsgTypeService msgtypeService; - @Resource - private UserService userService; - @Resource - private RoleService roleService; - @Resource - private MsgAlarmlevelService msgAlarmlevelService; - @RequestMapping("/showMsgType.do") - public String showlisttype(HttpServletRequest request,Model model) { - return "/msg/msgTypeList"; - } - @RequestMapping("/getMsgType.do") - public ModelAndView getmsgtype(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - //String orderstr=" order by T."+sort+" "+order; - String orderstr=" order by "+sort+" "+order; - String wherestr=CommUtil.getwherestr("insuser", "msg/getMsgType.do", cu); - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgtypeService.selectListByWhere(wherestr+orderstr); - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 查询消息报警级别 - */ - @RequestMapping("/getMsgAlarmlevel.do") - public ModelAndView getMsgAlarmlevel(HttpServletRequest request,Model model, - @RequestParam(value="msgid") String msgid) { - List list = this.msgAlarmlevelService.selectListByWhere("where state ='"+msgid+"'"); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/addMsgType.do") - public String doadd(HttpServletRequest request,Model model){ - return "msg/msgTypeAdd"; - } - /** - * 添加消息报警级别 - */ - @RequestMapping("/addMsgAlarmlevel.do") - public String doaddalarmlevel(HttpServletRequest request,Model model){ - return "msg/msgAlarmlevelAdd"; - - } - @RequestMapping("/alarmlevelForSelect.do") - public String alarmlevelForSelect(HttpServletRequest request,Model model) { - return "/msg/alarmlevelForSelect"; - } - /** - * 保存消息报警级别 - */ - @RequestMapping("/saveAlarmlevel.do") - public String saveAlarmlevel(HttpServletRequest request,Model model, - @ModelAttribute MsgAlarmlevel msgAlarmlevel ){ - User cu = (User)request.getSession().getAttribute("cu"); - String msguserids=request.getParameter("msguserids"); - String smsuserids=request.getParameter("smsuserids"); - String id = CommUtil.getUUID(); - msgAlarmlevel.setId(id); - msgAlarmlevel.setInsdt(CommUtil.nowDate()); - msgAlarmlevel.setInsuser(cu.getId()); - msgAlarmlevel.setMsgsend("");//禁用 - msgAlarmlevel.setSmssend("");//禁用 - int result = this.msgAlarmlevelService.saveMsgAlarmLevel(msgAlarmlevel,msguserids,smsuserids); - String resstr= "{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result",resstr); - return "result"; - } - - @RequestMapping("/deleteMsgAlarmlevel.do") - public String deletemsgalarmlevel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.msgAlarmlevelService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletesMsgAlarmlevel.do") - public String deletesmsgalarmlevel(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.msgAlarmlevelService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 编辑消息报警级别 - */ - @RequestMapping("/editAlarmlevel.do") - public String editAlarmlevel(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - MsgAlarmlevel msgAlarmlevel = this.msgAlarmlevelService.selectById(id); - model.addAttribute("msgAlarmlevel", msgAlarmlevel); - int i=0; - List msgusers=msgAlarmlevel.getMsgusers(); - //console.log(JSON.parse(msgusers)) - String msguserids=""; - String msgusernames=""; - for(i=0;i smsusers=msgAlarmlevel.getSmsusers(); - String smsuserids=""; - String smsusernames=""; - for(i=0;i msgusers=msgAlarmlevel.getMsgusers(); - //console.log(JSON.parse(msgusers)) - String msguserids=""; - String msgusernames=""; - for(i=0;i smsusers=msgAlarmlevel.getSmsusers(); - String smsuserids=""; - String smsusernames=""; - for(i=0;i list = this.msgtypeService.getMsgType(wherestr+orderstr); - MsgType msgType=list.get(0); - String msgrolename = ""; - String msgroleids = ""; - - String msgusername = ""; - String msguserids = ""; - String msguseridname=""; - - String smsusername = ""; - String smsuserids = ""; - String smsuseridname=""; - for(int i=0;i list = this.msgtypeService.getMsgType(wherestr+orderstr); - MsgType msgType=list.get(0); - String msgrolename = ""; - String msgroleids = ""; - String msgusername = ""; - String msguserids = ""; - String smsusername = ""; - String smsuserids = ""; - for(int i=0;i list = this.msgAlarmlevelService.selectListByWhere("where 1=1"); - int result=0; - if(checkres){ - msgtype.setInsdt(new Date()); - msgtype.setInsuser(cu.getId()); - msgtype.setStatus("启用"); - - for (int i = 0; i < list.size(); i++) { - MsgAlarmlevel msgAlarmlevel = list.get(i); - if (msgAlarmlevel.getState().equals("null")) { - msgAlarmlevel.setState(msgtype.getId()); - int rest= this.msgAlarmlevelService.update(msgAlarmlevel); - } - } - result = this.msgtypeService.saveMsgType(msgtype); - /*this.msgtypeService.saveMsgRole(request.getParameter("msgroleids"),msgtype.getId()); - this.msgtypeService.saveMsguser(request.getParameter("msguserids"),msgtype.getId()); - this.msgtypeService.saveSmsuser(request.getParameter("smsuserids"),msgtype.getId());*/ - }else{ - //id重复,已被占用 - result=2; - } - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateMsgType.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("msgtype") MsgType msgtype){ - User cu = (User) request.getSession().getAttribute("cu"); - msgtype.setInsuser(cu.getId()); - msgtype.setStatus("启用"); - /*msgtype.setSendway(request.getParameter("sendway")); - msgtype.setRemark(request.getParameter("remark"));*/ - int result = this.msgtypeService.updateMsgTypeById(msgtype); - /*this.msgtypeService.saveMsgRole(request.getParameter("msgroleids"),msgtype.getId()); - this.msgtypeService.saveMsguser(request.getParameter("msguserids"),msgtype.getId()); - this.msgtypeService.saveSmsuser(request.getParameter("smsuserids"),msgtype.getId());*/ - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/msgTypeForSelect.do") - public String msgtypeforselect(HttpServletRequest request,Model model){ - return "msg/msgTypeForSelect"; - } - - @RequestMapping("/getMsgTypeForSelect.do") - public ModelAndView getmsgtypeforselect(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by T.insdt "+order; - - String wherestr = CommUtil.getwherestr("T.insuser", "msg/getMsgType.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("getMsgType")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "and T.name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.msgtypeService.getMsgType(wherestr+orderstr); - List listcopy=new ArrayList(); - listcopy.addAll(list); - //发送权限判断 - for(MsgType mtype:list){ - if(!mtype.getMsguser().isEmpty() && mtype.getSendway()!=null && !mtype.getSendway().equals("sms")){ - int flagmu=0; - for(int j=0;j page = new PageInfo(listcopy); - JSONArray json=JSONArray.fromObject(listcopy); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/process/DataPatrolController.java b/src/com/sipai/controller/process/DataPatrolController.java deleted file mode 100644 index 8fa2bcc5..00000000 --- a/src/com/sipai/controller/process/DataPatrolController.java +++ /dev/null @@ -1,383 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataPatrol; -import com.sipai.entity.process.DataPatrolResultData; -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataPatrolResultDataService; -import com.sipai.service.process.DataPatrolService; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("/process/dataPatrol") -public class DataPatrolController { - @Resource - private DataPatrolService dataPatrolService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private DataPatrolResultDataService dataPatrolResultDataService; - @Resource - private DecisionExpertBaseService decisionExpertBaseService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/dataPatrolList"; - } - - @RequestMapping("/showView.do") - public String showView(HttpServletRequest request, Model model) { - return "/process/dataPatrolView"; - } - - @RequestMapping("/showNewView.do") - public String showNewView(HttpServletRequest request, Model model) { - return "/process/dataPatrolNewView"; - } - - @RequestMapping("/showAdd.do") - public String showAdd(HttpServletRequest request, Model model) { - model.addAttribute("pid", request.getParameter("pid")); - return "/process/dataPatrolAdd"; - } - - @RequestMapping("/showEdit.do") - public String showEdit(HttpServletRequest request, Model model) { - DataPatrol dataPatrol = dataPatrolService.selectById(request.getParameter("id")); - model.addAttribute("dataPatrol", dataPatrol); - return "/process/dataPatrolEdit"; - } - - @RequestMapping("/getTreeJson.do") - public ModelAndView getTreeJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List list = this.dataPatrolService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " order by morder"); - - String tree = ""; - - try { - tree = this.dataPatrolService.getTreeList(null, list); - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", tree); - return new ModelAndView("result"); - } - - @RequestMapping("/getTreeJson1.do") - public ModelAndView getTreeJson1(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List list = this.dataPatrolService.selectListByWhere("where 1=1 and unit_id='" + unitId + "' " - + " order by morder"); - - String tree = ""; - - try { - tree = this.dataPatrolService.getTreeList1(null, list); - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", tree); - return new ModelAndView("result"); - } - - - @RequestMapping(value = "/getTreeList.do", method = RequestMethod.POST) - public ModelAndView getTreeList(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 "; - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "' "; - } - - List list = new ArrayList<>(); - - try { - list = dataPatrolService.selectListByWhere(wherestr); - } catch (Exception e) { - e.printStackTrace(); - } - JSONArray result = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - for (DataPatrol dataPatrol : list) { - jsonObject.put("id", dataPatrol.getId()); - jsonObject.put("text", dataPatrol.getName()); - result.add(jsonObject); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/showCurve.do") - public String showCurve(HttpServletRequest request, Model model) { - return "/process/dataPatrolCurve"; - } - - @RequestMapping("/getDetailData.do") - public String getDetailData(HttpServletRequest request, Model model) { - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpcode = request.getParameter("mpcode"); - String unitId = request.getParameter("unitId"); - com.alibaba.fastjson.JSONArray mainjsondata = new com.alibaba.fastjson.JSONArray(); - if (mpcode != null && !mpcode.isEmpty()) { - String[] mpcodes = mpcode.split(","); - if (mpcodes != null && mpcodes.length > 0) { - for (int i = 0; i < mpcodes.length; i++) { - mpcode = mpcodes[i]; - if (mpcode != null && !mpcode.isEmpty()) { - MPoint mPoint = mPointService.selectById(unitId, mpcode); - String numtail = mPoint.getNumtail(); - List mphlist = mPointHistoryService.selectListByTableAWhere(unitId, "[tb_mp_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' order by MeasureDT "); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONArray jsondata = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray jsondata2 = new com.alibaba.fastjson.JSONArray(); - if (mphlist != null && mphlist.size() > 0) { - for (int d = 0; d < mphlist.size(); d++) { - String[] dataValue = new String[2]; - dataValue[0] = mphlist.get(d).getMeasuredt().substring(0, 16); - - BigDecimal vale = mphlist.get(d).getParmvalue(); - double endValue = CommUtil.round(vale.doubleValue(), Double.valueOf(numtail).intValue()); - dataValue[1] = String.valueOf(endValue); - jsondata.add(dataValue); - - double[] dataValue2 = new double[1]; - dataValue2[0] = endValue; - jsondata2.add(dataValue2); - } - } - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("data", jsondata); - jsonObject.put("data2", jsondata2); - mainjsondata.add(jsonObject); - } - } - } - } - model.addAttribute("result", mainjsondata); - return "result"; - } - - @RequestMapping("/doSave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("dataPatrol") DataPatrol dataPatrol) { - User cu = (User) request.getSession().getAttribute("cu"); - dataPatrol.setId(CommUtil.getUUID()); - if (dataPatrol.getPid() == null || dataPatrol.getPid().isEmpty()) { - dataPatrol.setPid("-1"); - } - int result = this.dataPatrolService.save(dataPatrol); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); -// model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/doUpdate.do") - public ModelAndView doUpdate(HttpServletRequest request, Model model, - @ModelAttribute("dataPatrol") DataPatrol dataPatrol) { - int result = this.dataPatrolService.update(dataPatrol); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - @RequestMapping("/doDel.do") - public ModelAndView doDel(HttpServletRequest request, Model model, - @ModelAttribute("dataPatrol") DataPatrol dataPatrol) { - Result result1 = new Result(); - List dataPatrols = dataPatrolService.selectListByWhere("where pid = '" + dataPatrol.getId() + "'"); - if (dataPatrols.size() > 0) { - result1 = Result.failed("请先删除子节点!"); - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - int delete = dataPatrolService.deleteById(dataPatrol.getId()); - - if (delete == Result.SUCCESS) { - result1 = Result.success(delete); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - @RequestMapping("/getResultDataNewTime.do") - public ModelAndView getResultDataNewTime(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - String time = "-"; - List list = this.dataPatrolResultDataService.selectListByWhere(" where unit_id='" + unitId + "' and lastDataSt='1' order by sdt desc "); - if (list != null && list.size() > 0) { - time = list.get(0).getSdt(); - } - - model.addAttribute("result", time.substring(0, 16)); - return new ModelAndView("result"); - } - - @RequestMapping("/getDataPatrolSt.do") - public ModelAndView getDataPatrolSt(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String mpCodes = request.getParameter("mpCodes"); - - String json = this.dataPatrolService.getDataPatrolSt(mpCodes, unitId); - -// System.out.println(json); - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getViewMonthData.do") - public ModelAndView getViewMonthData(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String inDate = request.getParameter("inDate"); - List list = this.dataPatrolResultDataService.selectAnyByWhere(" where unit_id='" + unitId + "' and datediff(month,sdt,'" + inDate + "')=0 " + - " group by result", "count(*) as num,result"); - String json = CommUtil.toJson(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getViewYearData.do") - public ModelAndView getViewYearData(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String inDate = request.getParameter("inDate"); - String sdt = CommUtil.subplus(inDate,"-11","month").substring(0,7)+"-01"; - List list = this.dataPatrolResultDataService.selectAnyByWhere(" where unit_id='" + unitId + "' and (sdt>='"+sdt+"' and sdt<='"+inDate+"') " + - "group by convert(varchar(7),sdt,120),result " + - "order by sdt asc", "count(*) as num,result,convert(varchar(7),sdt,120) as sdt"); - - JSONArray jsonArray = new JSONArray(); -// String[] yearM = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}; - String[] yearM = new String[12]; - for (int i = 0; i < 12; i++) { - yearM[i]= CommUtil.subplus(sdt, String.valueOf(i), "month").substring(5,7); - } - - JSONArray result1 = new JSONArray(); - JSONArray result2 = new JSONArray(); - JSONArray result3 = new JSONArray(); - JSONArray result5 = new JSONArray(); - for (int i = 0; i < yearM.length; i++) { - String m = yearM[i]; - int result1Num = 0; - int result2Num = 0; - int result3Num = 0; - int result5Num = 0; - if (list != null && list.size() > 0) { - for (int j = 0; j < list.size(); j++) { - DataPatrolResultData dataPatrolResultData = list.get(j); - if (dataPatrolResultData.getSdt().substring(5, 7).equals(m)) { - if (dataPatrolResultData.getResult().equals("1")) { - result1Num += dataPatrolResultData.getNum(); - } else if (dataPatrolResultData.getResult().equals("2")) { - result2Num += dataPatrolResultData.getNum(); - } else if (dataPatrolResultData.getResult().equals("3")) { - result3Num += dataPatrolResultData.getNum(); - } else if (dataPatrolResultData.getResult().equals("4")) { - result3Num += dataPatrolResultData.getNum(); - } else if (dataPatrolResultData.getResult().equals("5")) { - result5Num += dataPatrolResultData.getNum(); - } - } - } - } - result1.add(result1Num); - result2.add(result2Num); - result3.add(result3Num); - result5.add(result5Num); - } - - jsonArray.add(result1); - jsonArray.add(result2); - jsonArray.add(result3); - jsonArray.add(result5); - jsonArray.add(yearM); - -// String json = CommUtil.toJson(list); - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - - @RequestMapping("/getYHJC_data.do") - public ModelAndView getYHJC_data(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - List decisionExpertBaseList = this.decisionExpertBaseService.selectListByWhere(" where unitId='" + unitId + "' and pid='-1' order by morder"); - for (DecisionExpertBase decisionExpertBase : - decisionExpertBaseList) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - - String name = decisionExpertBase.getName(); - int num = 0; - - List dataPatrolList = this.dataPatrolService.selectListByWhere(" where unit_id='" + unitId + "' and name='" + name + "' "); - if (dataPatrolList != null && dataPatrolList.size() > 0) { - List dataPatroMpcodelList = this.dataPatrolService.selectListByWhere(" where unit_id='" + unitId + "' and pid='" + dataPatrolList.get(0).getId() + "' "); - String inMpids = ""; - for (DataPatrol dataPatrolMpids : - dataPatroMpcodelList) { - inMpids += dataPatrolMpids.getMpid() + ","; - } - inMpids = inMpids.replace(",", "','"); - - List dataPatrolResultDataList = this.dataPatrolResultDataService.selectListByWhere(" where lastDataSt='1' and mpcode in('" + inMpids + "') and (result='" + DataPatrolResultData.Result_3 + "' or result='" + DataPatrolResultData.Result_4 + "') "); - - num = dataPatrolResultDataList.size(); - } - - jsonObject.put("name", name); - jsonObject.put("num", num); - jsonArray.add(jsonObject); - } - - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualBarChartController.java b/src/com/sipai/controller/process/DataVisualBarChartController.java deleted file mode 100644 index 75abab99..00000000 --- a/src/com/sipai/controller/process/DataVisualBarChartController.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualBarChart; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualBarChartSeries; -import com.sipai.entity.process.DataVisualBarChartYAxis; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualBarChartSeriesService; -import com.sipai.service.process.DataVisualBarChartService; -import com.sipai.service.process.DataVisualBarChartYAxisService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualBarChart") -public class DataVisualBarChartController { - @Resource - private DataVisualBarChartService dataVisualBarChartService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private DataVisualBarChartSeriesService dataVisualBarChartSeriesService; - @Resource - private DataVisualBarChartYAxisService dataVisualBarChartYAxisService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualBarChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/getChartJson.do") - public ModelAndView getChartJson(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - JSONArray json = new JSONArray(); - - List dataVisualBarChartlist = this.dataVisualBarChartService.selectListByWhere("where 1=1 and pid='" + contentId + "' "); - String lineChartId = ""; - if (dataVisualBarChartlist != null && dataVisualBarChartlist.size() > 0) { - DataVisualBarChart dataVisualBarChart = dataVisualBarChartlist.get(0); - lineChartId = dataVisualBarChart.getId(); - json.add(dataVisualBarChart); - } - - List dataVisualBarChartSerieslist = this.dataVisualBarChartSeriesService.selectListByWhere("where 1=1 and pid='" + lineChartId + "' order by morder "); - if (dataVisualBarChartSerieslist != null && dataVisualBarChartSerieslist.size() > 0) { - json.add(dataVisualBarChartSerieslist); - } - - List dataVisualBarChartYAxislist = this.dataVisualBarChartYAxisService.selectListByWhere("where 1=1 and pid='" + lineChartId + "' order by morder "); - if (dataVisualBarChartYAxislist != null && dataVisualBarChartYAxislist.size() > 0) { - json.add(dataVisualBarChartYAxislist); - } - - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List dataVisualLinelist = this.dataVisualBarChartService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (dataVisualLinelist != null && dataVisualLinelist.size() > 0) { - model.addAttribute("dataVisualBarChart", dataVisualLinelist.get(0)); - - List dataVisualBarChartSerieslist = this.dataVisualBarChartSeriesService.selectListByWhere("where pid='" + dataVisualLinelist.get(0).getId() + "' "); - if (dataVisualBarChartSerieslist != null && dataVisualBarChartSerieslist.size() > 0) { - model.addAttribute("dataVisualBarChartSeries", dataVisualBarChartSerieslist.get(0)); - } - - List dataVisualBarChartYAxislist = this.dataVisualBarChartYAxisService.selectListByWhere("where pid='" + dataVisualLinelist.get(0).getId() + "' "); - if (dataVisualBarChartYAxislist != null && dataVisualBarChartYAxislist.size() > 0) { - model.addAttribute("dataVisualBarChartYAxis", dataVisualBarChartYAxislist.get(0)); - } - } - - - return "/process/dataVisualBarChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualBarChart dataVisualBarChart = new DataVisualBarChart(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("350"); - dataVisualContent.setHeight("220"); - dataVisualContent.setType(DataVisualContent.Type_BarChart); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - String lineChartId = CommUtil.getUUID(); - dataVisualBarChart.setId(lineChartId); - dataVisualBarChart.setPid(cntentId); - dataVisualBarChart.setColors("#2ec7c9,#b6a2de,#5ab1ef,#ffb980,#d87a80,#8d98b3,#e5cf0d,#97b552"); - dataVisualBarChart.setBackground("transparent"); - dataVisualBarChart.setTitleColor("#000000"); - dataVisualBarChart.setTitleFontSize("16px"); - dataVisualBarChart.setTitleFontWeight("400"); - dataVisualBarChart.setTitlePosition("left"); - dataVisualBarChart.setLegendPosition("right"); - dataVisualBarChart.setXaxistype("category"); - dataVisualBarChart.setXaxislineshow("true"); - dataVisualBarChart.setXaxisaxistickshow("true"); - dataVisualBarChart.setXaxissplitlineshow("true"); - dataVisualBarChart.setDatazoomst("false"); - dataVisualBarChart.setXaxisaxislabelshow("true"); - this.dataVisualBarChartService.save(dataVisualBarChart); - - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualBarChart") DataVisualBarChart dataVisualBarChart) { - int res = this.dataVisualBarChartService.update(dataVisualBarChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualBarChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualBarChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualBarChartSeriesController.java b/src/com/sipai/controller/process/DataVisualBarChartSeriesController.java deleted file mode 100644 index 167844c8..00000000 --- a/src/com/sipai/controller/process/DataVisualBarChartSeriesController.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualBarChartSeries; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualBarChartSeriesService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualBarChartSeries") -public class DataVisualBarChartSeriesController { - @Resource - private DataVisualBarChartSeriesService dataVisualBarChartSeriesService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualBarChartSeriesService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualBarChartSeriesService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualBarChartSeries dataVisualBarChartSeries = this.dataVisualBarChartSeriesService.selectById(id); - model.addAttribute("dataVisualBarChartSeries", dataVisualBarChartSeries); - return "/process/dataVisualBarChartSeriesEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualBarChartSeries dataVisualBarChartSeries = new DataVisualBarChartSeries(); - - dataVisualBarChartSeries.setId(CommUtil.getUUID()); - dataVisualBarChartSeries.setPid(pid); - dataVisualBarChartSeries.setName("数据1"); - dataVisualBarChartSeries.setType("bar"); - dataVisualBarChartSeries.setMorder(0); - dataVisualBarChartSeries.setYaxisindex(0); - dataVisualBarChartSeries.setAvgshow("false"); - dataVisualBarChartSeries.setMaxshow("false"); - dataVisualBarChartSeries.setMinshow("false"); - dataVisualBarChartSeries.setIshistorydata("true"); - dataVisualBarChartSeries.setTimerange(DataVisualBarChartSeries.TimeRange_day); - dataVisualBarChartSeries.setLabelposition("false"); - dataVisualBarChartSeries.setSelectst("true"); - - int res = this.dataVisualBarChartSeriesService.save(dataVisualBarChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualBarChartSeries") DataVisualBarChartSeries dataVisualBarChartSeries) { - int res = this.dataVisualBarChartSeriesService.update(dataVisualBarChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.dataVisualBarChartSeriesService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualBarChartSeriesService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualBarChartSeries dataVisualBarChartSeries = new DataVisualBarChartSeries(); - jsonOne = json.getJSONObject(i); - dataVisualBarChartSeries.setId((String) jsonOne.get("id")); - dataVisualBarChartSeries.setMorder(i); - result = this.dataVisualBarChartSeriesService.update(dataVisualBarChartSeries); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualBarChartYAxisController.java b/src/com/sipai/controller/process/DataVisualBarChartYAxisController.java deleted file mode 100644 index 6e12ea64..00000000 --- a/src/com/sipai/controller/process/DataVisualBarChartYAxisController.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualBarChartYAxis; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualBarChartYAxisService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualBarChartYAxis") -public class DataVisualBarChartYAxisController { - @Resource - private DataVisualBarChartYAxisService dataVisualBarChartYAxisService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualBarChartYAxisService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualBarChartYAxisService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualBarChartYAxis dataVisualBarChartYAxis = this.dataVisualBarChartYAxisService.selectById(id); - model.addAttribute("dataVisualBarChartYAxis", dataVisualBarChartYAxis); - return "/process/dataVisualBarChartYAxisEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualBarChartYAxis dataVisualBarChartYAxis = new DataVisualBarChartYAxis(); - - dataVisualBarChartYAxis.setId(CommUtil.getUUID()); - dataVisualBarChartYAxis.setPid(pid); - dataVisualBarChartYAxis.setMorder(0); - dataVisualBarChartYAxis.setName("轴1"); - dataVisualBarChartYAxis.setLineshow("false"); - dataVisualBarChartYAxis.setAxistickshow("false"); - dataVisualBarChartYAxis.setScale("false"); - dataVisualBarChartYAxis.setSplitlineshow("false"); - dataVisualBarChartYAxis.setPosition("left"); - dataVisualBarChartYAxis.setAxislabelshow("true"); - - int res = this.dataVisualBarChartYAxisService.save(dataVisualBarChartYAxis); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualBarChartYAxis") DataVisualBarChartYAxis dataVisualBarChartYAxis) { - int res = this.dataVisualBarChartYAxisService.update(dataVisualBarChartYAxis); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualBarChartYAxisService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualBarChartYAxisService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualBarChartYAxis dataVisualBarChartYAxis = new DataVisualBarChartYAxis(); - jsonOne = json.getJSONObject(i); - dataVisualBarChartYAxis.setId((String) jsonOne.get("id")); - dataVisualBarChartYAxis.setMorder(i); - result = this.dataVisualBarChartYAxisService.update(dataVisualBarChartYAxis); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualCameraAlarmController.java b/src/com/sipai/controller/process/DataVisualCameraAlarmController.java deleted file mode 100644 index 4ee59791..00000000 --- a/src/com/sipai/controller/process/DataVisualCameraAlarmController.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualCameraAlarm; -import com.sipai.service.process.DataVisualCameraAlarmService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualCameraAlarm") -public class DataVisualCameraAlarmController { - @Resource - private DataVisualCameraAlarmService dataVisualCameraAlarmService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualCameraAlarmService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualCameraAlarmService.selectListByWhere("where 1=1 and pid='" + pid + "' order by morder "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualCameraAlarm dataVisualCameraAlarm = this.dataVisualCameraAlarmService.selectById(id); - model.addAttribute("dataVisualCameraAlarm", dataVisualCameraAlarm); - return "/process/dataVisualCameraAlarmEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualCameraAlarm dataVisualCameraAlarm = new DataVisualCameraAlarm(); - - dataVisualCameraAlarm.setId(CommUtil.getUUID()); - dataVisualCameraAlarm.setPid(pid); - dataVisualCameraAlarm.setMorder(0); - dataVisualCameraAlarm.setJsmethod("="); - dataVisualCameraAlarm.setJsvalue(0.0); - - int res = this.dataVisualCameraAlarmService.save(dataVisualCameraAlarm); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualCameraAlarm") DataVisualCameraAlarm dataVisualCameraAlarm) { - int res = this.dataVisualCameraAlarmService.update(dataVisualCameraAlarm); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualCameraAlarmService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualCameraAlarmService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualCameraAlarm dataVisualCameraAlarm = new DataVisualCameraAlarm(); - jsonOne = json.getJSONObject(i); - dataVisualCameraAlarm.setId((String) jsonOne.get("id")); - dataVisualCameraAlarm.setMorder(i); - result = this.dataVisualCameraAlarmService.update(dataVisualCameraAlarm); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doHQCameraAlarmSave.do") - public ModelAndView doHQSvgAlarmSave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - - int res = 0; - - DataVisualCameraAlarm dataVisualCameraAlarm1 = new DataVisualCameraAlarm(); - dataVisualCameraAlarm1.setId(CommUtil.getUUID()); - dataVisualCameraAlarm1.setPid(pid); - dataVisualCameraAlarm1.setMorder(0); - dataVisualCameraAlarm1.setJsmethod("="); - dataVisualCameraAlarm1.setJsvalue(0.0); - dataVisualCameraAlarm1.setColor(""); - res += this.dataVisualCameraAlarmService.save(dataVisualCameraAlarm1); - - DataVisualCameraAlarm dataVisualCameraAlarm2 = new DataVisualCameraAlarm(); - dataVisualCameraAlarm2.setId(CommUtil.getUUID()); - dataVisualCameraAlarm2.setPid(pid); - dataVisualCameraAlarm2.setMorder(1); - dataVisualCameraAlarm2.setJsmethod("="); - dataVisualCameraAlarm2.setJsvalue(1.0); - dataVisualCameraAlarm2.setColor("#ffcc00"); - res += this.dataVisualCameraAlarmService.save(dataVisualCameraAlarm2); - - DataVisualCameraAlarm dataVisualCameraAlarm3 = new DataVisualCameraAlarm(); - dataVisualCameraAlarm3.setId(CommUtil.getUUID()); - dataVisualCameraAlarm3.setPid(pid); - dataVisualCameraAlarm3.setMorder(2); - dataVisualCameraAlarm3.setJsmethod("="); - dataVisualCameraAlarm3.setJsvalue(2.0); - dataVisualCameraAlarm3.setColor("#ff0000"); - res += this.dataVisualCameraAlarmService.save(dataVisualCameraAlarm3); - - - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualCameraController.java b/src/com/sipai/controller/process/DataVisualCameraController.java deleted file mode 100644 index ba5bdd06..00000000 --- a/src/com/sipai/controller/process/DataVisualCameraController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualCamera; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualText; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualCameraService; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualCamera") -public class DataVisualCameraController { - @Resource - private DataVisualCameraService dataVisualCameraService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/selectListForVisual.do") - public String selectList(HttpServletRequest request,Model model) { - return "/process/dataVisualCamera4Select"; - } - /* - * 单选摄像头 - * */ - @RequestMapping("/radioListForVisual.do") - public String radioListForVisual(HttpServletRequest request,Model model) { - return "/process/dataVisualCamera4Radio"; - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid=request.getParameter("pid"); - List list = this.dataVisualCameraService.selectListByWhere("where 1=1 and pid='"+pid+"' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String frameId=request.getParameter("frameId"); - String datas=request.getParameter("datas"); - - String[] cids=datas.split(","); - if(cids!=null&&cids.length>0){ - for (String cid : cids) { - DataVisualContent dataVisualContent=new DataVisualContent(); - DataVisualCamera dataVisualCamera=new DataVisualCamera(); - - String contentId=CommUtil.getUUID(); - dataVisualContent.setId(contentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx("200"); - dataVisualContent.setPosty("20"); - dataVisualContent.setType(DataVisualContent.Type_Camera); - dataVisualContent.setWidth("35"); - dataVisualContent.setHeight("35"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setIstab("false"); - this.dataVisualContentService.save(dataVisualContent); - - dataVisualCamera.setId(CommUtil.getUUID()); - dataVisualCamera.setPid(contentId); - dataVisualCamera.setCameraid(cid); - dataVisualCamera.setColor("#1296db"); - - this.dataVisualCameraService.save(dataVisualCamera); - } - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualCamera") DataVisualCamera dataVisualCamera) { - int res = this.dataVisualCameraService.update(dataVisualCamera); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/process/DataVisualCombineAssemblyController.java b/src/com/sipai/controller/process/DataVisualCombineAssemblyController.java deleted file mode 100644 index ca5c219f..00000000 --- a/src/com/sipai/controller/process/DataVisualCombineAssemblyController.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("/process/combineAssembly") -public class DataVisualCombineAssemblyController { - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @RequestMapping("/workOrderSituation.do") - public String workOrderSituation(HttpServletRequest request, Model model) { - return "/process/combineAssembly/workOrderSituation"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualContentController.java b/src/com/sipai/controller/process/DataVisualContentController.java deleted file mode 100644 index e2df1aa1..00000000 --- a/src/com/sipai/controller/process/DataVisualContentController.java +++ /dev/null @@ -1,1445 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.*; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import com.sipai.entity.work.WeatherNew; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.process.*; -import com.sipai.service.scada.MPointService; -import com.sipai.service.work.WeatherNewService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import static org.hamcrest.CoreMatchers.nullValue; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualContent") -public class DataVisualContentController { - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private DataVisualFrameService dataVisualFrameService; - @Resource - private DataVisualMPointService dataVisualMPointService; - @Resource - private DataVisualTextService dataVisualTextService; - @Resource - private DataVisualCameraService dataVisualCameraService; - @Resource - private DataVisualFormService dataVisualFormService; - @Resource - private DataVisualLineChartService dataVisualLineChartService; - @Resource - private DataVisualLineChartSeriesService dataVisualLineChartSeriesService; - @Resource - private DataVisualLineChartYAxisService dataVisualLineChartYAxisService; - @Resource - private DataVisualBarChartService dataVisualBarChartService; - @Resource - private DataVisualBarChartSeriesService dataVisualBarChartSeriesService; - @Resource - private DataVisualBarChartYAxisService dataVisualBarChartYAxisService; - @Resource - private DataVisualPercentChartService dataVisualPercentChartService; - @Resource - private DataVisualRadarChartService dataVisualRadarChartService; - @Resource - private DataVisualRadarChartSeriesService dataVisualRadarChartSeriesService; - @Resource - private DataVisualRadarChartAxisService dataVisualRadarChartAxisService; - @Resource - private DataVisualPieChartService dataVisualPieChartService; - @Resource - private DataVisualPieChartSeriesService dataVisualPieChartSeriesService; - @Resource - private DataVisualGaugeChartService dataVisualGaugeChartService; - @Resource - private DataVisualDateService dataVisualDateService; - @Resource - private DataVisualDateSelectService dataVisualDateSelectService; - @Resource - private DataVisualTabService dataVisualTabService; - @Resource - private DataVisualMpViewService dataVisualMpViewService; - @Resource - private DataVisualProgressBarChartService dataVisualProgressBarChartService; - @Resource - private DataVisualSuspensionFrameService dataVisualSuspensionFrameService; - @Resource - private DataVisualPolarCoordinatesService dataVisualPolarCoordinatesService; - @Resource - private DataVisualPolarCoordinatesSeriesService dataVisualPolarCoordinatesSeriesService; - @Resource - private DataVisualWeatherService dataVisualWeatherService; - @Resource - private CommonFileService commonFileService; - @Resource - private DataVisualFrameContainerService dataVisualFrameContainerService; - @Resource - private MPointService mPointService; - @Resource - private WeatherNewService weatherNewService; - @Resource - private DataVisualSwitchService dataVisualSwitchService; - @Resource - private DataVisualFormSqlPointService dataVisualFormSqlPointService; - @Resource - private DataVisualFormShowStyleService dataVisualFormShowStyleService; - @Resource - private DataVisualPersonnelPositioningService dataVisualPersonnelPositioningService; - @Resource - private DataVisualSvgService dataVisualSvgService; - @Resource - private DataVisualTaskPointsService dataVisualTaskPointsService; - @Resource - private DataVisualEqPointsService dataVisualEqPointsService; - @Resource - private DataVisualSelectService dataVisualSelectService; - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + pid + "' order by type,roundTimeContent "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/getAllJson.do") - public ModelAndView getAllJson(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String zjdata = request.getParameter("zjdata"); - - - List FList = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='" + frameId + "' and type='" + DataVisualFrameContainer.Type_column + "' "); - - JSONArray jsonArray = new JSONArray(); - if (FList != null && FList.size() > 0) { - for (DataVisualFrameContainer fc : - FList) { - List clist = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + fc.getId() + "' and type='" + zjdata + "' order by type,roundTimeContent "); - if (clist != null && clist.size() > 0) { - JSONObject jsonObject = new JSONObject(); - - String contentIds_Mpview = ""; - JSONObject jsonObject_jh_Mpview = new JSONObject(); - for (int i = 0; i < clist.size(); i++) { - DataVisualContent content = clist.get(i); - if (i == 0 && content.getType().equals(DataVisualContent.Type_DateSelect) && sdt.equals("") && edt.equals("")) { - sdt = "2000-01-01"; - edt = CommUtil.nowDate(); - } - - if (zjdata.equals(DataVisualContent.Type_MpView)) { - contentIds_Mpview += content.getId() + ","; - jsonObject_jh_Mpview.put("AA" + content.getId(), content); - } else { - getAllContentJSONObject(jsonObject, content, fc.getId(), sdt, edt, null, content.getType(), null); - jsonArray.add(jsonObject); - } - } - - if (zjdata.equals(DataVisualContent.Type_MpView)) { - jsonObject_jh_Mpview.put("contentIds", contentIds_Mpview); - getAllContentJSONObject(null, null, fc.getId(), sdt, edt, jsonObject_jh_Mpview, zjdata, jsonArray); - -// jsonArray.add(jsonObject); - } - - } - } - } - - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - @RequestMapping("/getFrameId_ZJ_Type.do") - public ModelAndView getFrameId_ZJ_Type(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - String zjids = ""; - - List list = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='" + frameId + "' and type='" + DataVisualFrameContainer.Type_column + "' "); - - if (list != null && list.size() > 0) { - for (DataVisualFrameContainer fc : - list) { - List clist = this.dataVisualContentService.selectDistinctTypeListByWhere("where 1=1 and pid='" + fc.getId() + "' order by type "); - if (clist != null && clist.size() > 0) { - for (DataVisualContent dataVisualContent : clist) { - zjids += dataVisualContent.getType() + ","; - } - } - - } - } - - model.addAttribute("result", zjids); - return new ModelAndView("result"); - } - - @RequestMapping("/getOneJson.do") - public ModelAndView getOneJson(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(id); - - model.addAttribute("result", JSONArray.fromObject(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualContent") DataVisualContent dataVisualContent) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.dataVisualContentService.save(dataVisualContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/updateLayout.do") - public ModelAndView updateLayout(HttpServletRequest request, Model model) { - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(request.getParameter("id")); - if (dataVisualContent != null) { - if (!request.getParameter("postx").equals("auto")) { - dataVisualContent.setPostx(request.getParameter("postx").replace("px", "")); - } - if (!request.getParameter("posty").equals("auto")) { - dataVisualContent.setPosty(request.getParameter("posty").replace("px", "")); - } - - int result = this.dataVisualContentService.update(dataVisualContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/updateReSize.do") - public ModelAndView updateReSize(HttpServletRequest request, Model model) { - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(request.getParameter("id")); - if (dataVisualContent != null) { - dataVisualContent.setWidth(request.getParameter("width").replace("px", "")); - dataVisualContent.setHeight(request.getParameter("height").replace("px", "")); - int result = this.dataVisualContentService.update(dataVisualContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualContent") DataVisualContent dataVisualContent) { - if (dataVisualContent.getIsfull() != null) { - if (dataVisualContent.getIsfull().equals(DataVisualContent.Isfull_True)) { -// dataVisualContent.setWidth("100"); -// dataVisualContent.setHeight("100"); -// dataVisualContent.setPostx("0"); -// dataVisualContent.setPosty("0"); - dataVisualContent.setIsfixed("true"); - } - } - int res = this.dataVisualContentService.update(dataVisualContent); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { -// System.out.println(id); - int res = this.dataVisualContentService.deleteById(id); - if (res == 1) { - String type = request.getParameter("type"); - String did = request.getParameter("did"); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - dataVisualContentService.deleteContentById(id, type, did); - } else { - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doAllContentDel.do") - public String doAllContentDel(HttpServletRequest request, Model model, - @RequestParam(value = "frameId") String frameId) { - this.dataVisualFrameService.deleteAllContentFromFrameId(frameId);//删除元素 - model.addAttribute("result", "suc"); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualContentService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/showMplistForSelect.do") - public String showMplistForSelect(HttpServletRequest request, Model model) { - - return "/process/dataVisualContentMPoint4Select"; - } - - - @RequestMapping("/editDI.do") - public String editDI(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("id")); - - List dMPoints = this.dataVisualMPointService.selectListByWhere("where pid='" + dContent.getId() + "' "); - - model.addAttribute("dataVisualContent", dContent); - model.addAttribute("dataVisualMPoint", dMPoints.get(0)); - - return "/process/dataVisualContentEditForDI"; - } - - @RequestMapping("/editAI.do") - public String editAI(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("id")); - - List dMPoints = this.dataVisualMPointService.selectListByWhere("where pid='" + dContent.getId() + "' "); - - model.addAttribute("dataVisualContent", dContent); - model.addAttribute("dataVisualMPoint", dMPoints.get(0)); - - return "/process/dataVisualContentEditForAI"; - } - - @RequestMapping("/editText.do") - public String editText(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("id")); - - List dTexts = this.dataVisualTextService.selectListByWhere("where pid='" + dContent.getId() + "' "); - - model.addAttribute("dataVisualContent", dContent); - model.addAttribute("dataVisualText", dTexts.get(0)); - - return "/process/dataVisualContentEditForText"; - } - - @RequestMapping("/editCamera.do") - public String editCamera(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("id")); - - List dataVisualCamera = this.dataVisualCameraService.selectListByWhere("where pid='" + dContent.getId() + "' "); - - model.addAttribute("dataVisualContent", dContent); - model.addAttribute("dataVisualCamera", dataVisualCamera.get(0)); - - return "/process/dataVisualContentEditForCamera"; - } - - @RequestMapping("/editPicture.do") - public String editPicture(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - - model.addAttribute("dataVisualContent", dContent); - - return "/process/dataVisualContentEditForPicture"; - } - - @RequestMapping("/doSavePicture.do") - public ModelAndView doSavePicture(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("50"); - dataVisualContent.setHeight("50"); - dataVisualContent.setType(DataVisualContent.Type_Picture); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setBackground("transparent"); - dataVisualContent.setIsvoiceknow("false"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/editIframe.do") - public String editIframe(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - - model.addAttribute("dataVisualContent", dContent); - - return "/process/dataVisualContentEditForIframe"; - } - - @RequestMapping("/doSaveIframe.do") - public ModelAndView doSaveIframe(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualLineChart dataVisualLineChart = new DataVisualLineChart(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("250"); - dataVisualContent.setHeight("250"); - dataVisualContent.setType(DataVisualContent.Type_Iframe); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setBackground("transparent"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/editLine.do") - public String editLine(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - - model.addAttribute("dataVisualContent", dContent); - - return "/process/dataVisualContentEditForLine"; - } - - @RequestMapping("/doSaveLine.do") - public ModelAndView doSaveLine(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualLineChart dataVisualLineChart = new DataVisualLineChart(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("150"); - dataVisualContent.setHeight("5"); - dataVisualContent.setType(DataVisualContent.Type_Line); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setBackground("#333"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/editSelectJump.do") - public String editSelectJump(HttpServletRequest request, Model model) { - - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - - model.addAttribute("dataVisualContent", dContent); - - return "/process/dataVisualContentEditForSelectJump"; - } - - @RequestMapping("/doSelectJumpSave.do") - public ModelAndView doSelectJumpSave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("200"); - dataVisualContent.setHeight("60"); - dataVisualContent.setType(DataVisualContent.Type_SelectJump); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/getIdsForTab.do") - public ModelAndView getIdsForTabDel(HttpServletRequest request, Model model) { - String tabId = request.getParameter("pid"); - - String contentIds = getContentIdsForTab(tabId); - - model.addAttribute("result", contentIds); - return new ModelAndView("result"); - } - - String fromTabContentIds = ""; - - @RequestMapping("/getIdsForAllTabContent.do") - public ModelAndView getIdsForAllTabContent(HttpServletRequest request, Model model) { - String tabId = request.getParameter("pid"); - - fromTabContentIds = ""; - String contentIds = getContentIdsForAllTab(tabId); - - model.addAttribute("result", contentIds); - return new ModelAndView("result"); - } - - public String getContentIdsForTab(String tabId) { - String ids = ""; - List list = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + tabId + "' order by type"); - if (list != null && list.size() > 0) { - for (DataVisualContent dataVisualContent : list) { - if (dataVisualContent.getType().equals(DataVisualContent.Type_Tab)) { - List tablist = this.dataVisualTabService.selectListByWhere("where pid='" + dataVisualContent.getId() + "' and firstck='true' order by morder "); - if (tablist != null && tablist.size() > 0) { - ids += getContentIdsForTab(tablist.get(0).getId()); - } - } - ids += dataVisualContent.getId() + ","; - } - } - - return ids; - } - - public String getContentIdsForAllTab(String tabId) { - List list = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + tabId + "' order by type"); - if (list != null && list.size() > 0) { - for (DataVisualContent dataVisualContent : list) { - if (dataVisualContent.getType().equals(DataVisualContent.Type_Tab)) { - List dlist = this.dataVisualTabService.selectListByWhere(" where pid='" + dataVisualContent.getId() + "' order by morder"); - for (DataVisualTab dataVisualTab : - dlist) { - getContentIdsForAllTab(dataVisualTab.getId()); - } - } - fromTabContentIds += dataVisualContent.getId() + ","; - } - } - - return fromTabContentIds; - } - - @RequestMapping("/getTabAllJson.do") - public ModelAndView getTabAllJson(HttpServletRequest request, Model model) { - String assemblyId = request.getParameter("tabId"); - String cid = this.dataVisualContentService.getContentId(assemblyId); - -// List FList = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='" + frameId + "' and type='" + DataVisualFrameContainer.Type_column + "' "); - String ckTabId = request.getParameter("ckTabId"); - JSONArray jsonArray = new JSONArray(); -// if (FList != null && FList.size() > 0) { -// for (DataVisualFrameContainer fc : -// FList) { - List clist = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + ckTabId + "' order by type,roundTimeContent "); - - String sdt = ""; - String edt = ""; - if (request.getParameter("sdt") != null && request.getParameter("sdt").length() > 0) { - sdt = request.getParameter("sdt"); - } - if (request.getParameter("edt") != null && request.getParameter("edt").length() > 0) { - edt = request.getParameter("edt"); - } - - if (clist != null && clist.size() > 0) { - for (int i = 0; i < clist.size(); i++) { - DataVisualContent content = clist.get(i); - if (i == 0 && content.getType().equals(DataVisualContent.Type_DateSelect) && sdt.equals("") && edt.equals("")) { - sdt = "2000-01-01"; - edt = CommUtil.nowDate(); - } - JSONObject jsonObject = new JSONObject(); - getAllContentJSONObject(jsonObject, content, cid, sdt, edt, null, content.getType(), null); - - jsonArray.add(jsonObject); - } - } -// } -// } - - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - public JSONObject getAllContentJSONObject(JSONObject jsonObject, DataVisualContent content, String fcid, String sdt, String edt, JSONObject jsonObject_jh, String zjdata, JSONArray jsonArray) { - - String contentId = ""; - String type = zjdata; - - if (!zjdata.equals(DataVisualContent.Type_MpView)) { - jsonObject.put("cid", fcid); - jsonObject.put("type", type); - jsonObject.put("content", content); - contentId = content.getId(); - } -// System.out.println(type); - if (type.equals(DataVisualContent.Type_SignalPoint)) { - List dlist = this.dataVisualMPointService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - for (DataVisualMPoint dataVisualMPoint : - dlist) { - String mpid = dataVisualMPoint.getMpid(); - MPoint mPoint = this.mPointService.selectById(mpid); - if (mPoint != null) { - if (mPoint.getEquipmentid() != null) { - String eqid = mPoint.getEquipmentid(); - dataVisualMPoint.setEqid(eqid); - } - } - } - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_DataPoint)) { - List dlist = this.dataVisualMPointService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_Text)) { - List dlist = this.dataVisualTextService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - if (dlist.get(0).getMpid() != null && dlist.get(0).getMpid().length() > 0) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dlist.get(0).getMpid(), dlist.get(0).getValuemethod(), sdt, edt); - if (mPoint != null) { - dlist.get(0).setmPoint(mPoint); - dlist.get(0).setTextcontent(String.valueOf(mPoint.getParmvalue())); - } - } - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_LineChart)) { - List dlist = this.dataVisualLineChartService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - List dataVisualLineChartSerieslist = this.dataVisualLineChartSeriesService.selectListByWhere("where 1=1 and pid='" + dlist.get(0).getId() + "' order by morder "); - if (dataVisualLineChartSerieslist != null && dataVisualLineChartSerieslist.size() > 0) { - jsonObject.put("showSeriesData", dataVisualLineChartSerieslist); - } - - List dataVisualLineChartYAxislist = this.dataVisualLineChartYAxisService.selectListByWhere("where 1=1 and pid='" + dlist.get(0).getId() + "' order by morder "); - if (dataVisualLineChartYAxislist != null && dataVisualLineChartYAxislist.size() > 0) { - jsonObject.put("showYAxisData", dataVisualLineChartYAxislist); - } - } - } else if (type.equals(DataVisualContent.Type_BarChart)) { - List dlist = this.dataVisualBarChartService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - List dataVisualBarChartSerieslist = this.dataVisualBarChartSeriesService.selectListByWhere("where 1=1 and pid='" + dlist.get(0).getId() + "' order by morder "); - if (dataVisualBarChartSerieslist != null && dataVisualBarChartSerieslist.size() > 0) { - jsonObject.put("showSeriesData", dataVisualBarChartSerieslist); - } - - List dataVisualBarChartYAxislist = this.dataVisualBarChartYAxisService.selectListByWhere("where 1=1 and pid='" + dlist.get(0).getId() + "' order by morder "); - if (dataVisualBarChartYAxislist != null && dataVisualBarChartYAxislist.size() > 0) { - jsonObject.put("showYAxisData", dataVisualBarChartYAxislist); - } - } - } else if (type.equals(DataVisualContent.Type_Camera)) { - List dlist = this.dataVisualCameraService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_Picture)) { - List dlist = this.commonFileService.selectListByTableAWhere("tb_pro_dataVisual_picture_file", "where masterid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist); - }else { - jsonObject.put("showData", null); - } - } else if (type.equals(DataVisualContent.Type_Date)) { - List dlist = this.dataVisualDateService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_DateSelect)) { - List dlist = this.dataVisualDateSelectService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_Weather)) { - List dlist = this.dataVisualWeatherService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - List wlist = this.weatherNewService.selectTop1ListByWhere("where datediff(day,time,'" + CommUtil.nowDate() + "')=0 order by time desc"); - jsonObject.put("showWeatherData", wlist); - } - } else if (type.equals(DataVisualContent.Type_SuspensionFrame)) { - List dlist = this.dataVisualSuspensionFrameService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_PolarCoordinates)) { - List dlist = this.dataVisualPolarCoordinatesService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - - List dataVisualPolarCoordinatesSerieslist = this.dataVisualPolarCoordinatesSeriesService.selectListByWhere("where 1=1 and pid='" + dlist.get(0).getId() + "' order by morder "); - if (dataVisualPolarCoordinatesSerieslist != null && dataVisualPolarCoordinatesSerieslist.size() > 0) { - for (DataVisualPolarCoordinatesSeries dataVisualPolarCoordinatesSeries : - dataVisualPolarCoordinatesSerieslist) { - if (dataVisualPolarCoordinatesSeries.getMpid() != null && dataVisualPolarCoordinatesSeries.getMpid().length() > 0) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualPolarCoordinatesSeries.getMpid(), dataVisualPolarCoordinatesSeries.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualPolarCoordinatesSeries.setFixedvalue(String.valueOf(mPoint.getParmvalue())); - } - } - } - } - jsonObject.put("showSeriesData", dataVisualPolarCoordinatesSerieslist); - - } - } else if (type.equals(DataVisualContent.Type_ProgressBar)) { - List dlist = this.dataVisualProgressBarChartService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - for (DataVisualProgressBarChart dataVisualProgressBarChart : - dlist) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualProgressBarChart.getMpid(), dataVisualProgressBarChart.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualProgressBarChart.setText(String.valueOf(mPoint.getParmvalue())); - } - } - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_MpView)) { -// jsonObject_jh - String contentIds = jsonObject_jh.get("contentIds").toString(); - contentIds = contentIds.replace(",", "','"); - - List dlist = this.dataVisualMpViewService.selectListByWhere(" where pid in ('" + contentIds + "') order by pid,morder "); - if (dlist != null && dlist.size() > 0) { - String oldPid = ""; - - List ddlist = new ArrayList(); - for (int i = 0; i < dlist.size(); i++) { - JSONObject jsonObject1 = new JSONObject(); - - - DataVisualMpView dataVisualMpView = dlist.get(i); - - if (i == 0) { - oldPid = dataVisualMpView.getPid(); - - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualMpView.getMpid(), dataVisualMpView.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - - ddlist.add(dataVisualMpView); - } else { - String nowPid = dataVisualMpView.getPid(); - - if (!nowPid.equals(oldPid) && dlist.size()==i+1) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2 = (JSONObject) jsonObject_jh.get("AA" + oldPid); - DataVisualContent dataVisualContent = new DataVisualContent(); - dataVisualContent.setId(jsonObject2.get("id").toString()); - dataVisualContent.setStyle(jsonObject2.get("style").toString()); - dataVisualContent.setWidth(jsonObject2.get("width").toString()); - dataVisualContent.setHeight(jsonObject2.get("height").toString()); - dataVisualContent.setPostx(jsonObject2.get("postx").toString()); - dataVisualContent.setPosty(jsonObject2.get("posty").toString()); - dataVisualContent.setzIndex(jsonObject2.get("zIndex").toString()); - - - jsonObject1.put("showData", ddlist); - ddlist.clear(); - - jsonObject1.put("cid", fcid); - jsonObject1.put("type", type); - jsonObject1.put("content", dataVisualContent); - jsonArray.add(jsonObject1); - //上一个 - - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualMpView.getMpid(), dataVisualMpView.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - - oldPid = nowPid; - ddlist.add(dataVisualMpView); - - JSONObject jsonObject3 = new JSONObject(); - jsonObject2 = (JSONObject) jsonObject_jh.get("AA" + oldPid); - DataVisualContent dataVisualContent2 = new DataVisualContent(); - dataVisualContent2.setId(jsonObject2.get("id").toString()); - dataVisualContent2.setStyle(jsonObject2.get("style").toString()); - dataVisualContent2.setWidth(jsonObject2.get("width").toString()); - dataVisualContent2.setHeight(jsonObject2.get("height").toString()); - dataVisualContent2.setPostx(jsonObject2.get("postx").toString()); - dataVisualContent2.setPosty(jsonObject2.get("posty").toString()); - dataVisualContent2.setzIndex(jsonObject2.get("zIndex").toString()); - - MPoint mPoint2 = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualMpView.getMpid(), dataVisualMpView.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - - jsonObject1.put("showData", ddlist); - ddlist.clear(); - - jsonObject1.put("cid", fcid); - jsonObject1.put("type", type); - jsonObject1.put("content", dataVisualContent2); - jsonArray.add(jsonObject1); - - }else if (nowPid.equals(oldPid) && dlist.size()==i+1 ) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2 = (JSONObject) jsonObject_jh.get("AA" + oldPid); - DataVisualContent dataVisualContent = new DataVisualContent(); - dataVisualContent.setId(jsonObject2.get("id").toString()); - dataVisualContent.setStyle(jsonObject2.get("style").toString()); - dataVisualContent.setWidth(jsonObject2.get("width").toString()); - dataVisualContent.setHeight(jsonObject2.get("height").toString()); - dataVisualContent.setPostx(jsonObject2.get("postx").toString()); - dataVisualContent.setPosty(jsonObject2.get("posty").toString()); - dataVisualContent.setzIndex(jsonObject2.get("zIndex").toString()); - - - jsonObject1.put("showData", ddlist); - ddlist.clear(); - - jsonObject1.put("cid", fcid); - jsonObject1.put("type", type); - jsonObject1.put("content", dataVisualContent); - jsonArray.add(jsonObject1); - - }else if (!nowPid.equals(oldPid)) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2 = (JSONObject) jsonObject_jh.get("AA" + oldPid); - DataVisualContent dataVisualContent = new DataVisualContent(); - dataVisualContent.setId(jsonObject2.get("id").toString()); - dataVisualContent.setStyle(jsonObject2.get("style").toString()); - dataVisualContent.setWidth(jsonObject2.get("width").toString()); - dataVisualContent.setHeight(jsonObject2.get("height").toString()); - dataVisualContent.setPostx(jsonObject2.get("postx").toString()); - dataVisualContent.setPosty(jsonObject2.get("posty").toString()); - dataVisualContent.setzIndex(jsonObject2.get("zIndex").toString()); - - - jsonObject1.put("showData", ddlist); - ddlist.clear(); - - jsonObject1.put("cid", fcid); - jsonObject1.put("type", type); - jsonObject1.put("content", dataVisualContent); - jsonArray.add(jsonObject1); - - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualMpView.getMpid(), dataVisualMpView.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - - oldPid = nowPid; - ddlist.add(dataVisualMpView); - }else { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualMpView.getMpid(), dataVisualMpView.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - ddlist.add(dataVisualMpView); - } - } - - if (dlist.size() == 1) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2 = (JSONObject) jsonObject_jh.get("AA" + oldPid); - DataVisualContent dataVisualContent = new DataVisualContent(); - dataVisualContent.setId(jsonObject2.get("id").toString()); - dataVisualContent.setStyle(jsonObject2.get("style").toString()); - dataVisualContent.setWidth(jsonObject2.get("width").toString()); - dataVisualContent.setHeight(jsonObject2.get("height").toString()); - dataVisualContent.setPostx(jsonObject2.get("postx").toString()); - dataVisualContent.setPosty(jsonObject2.get("posty").toString()); - dataVisualContent.setzIndex(jsonObject2.get("zIndex").toString()); - - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualMpView.getMpid(), dataVisualMpView.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - - ddlist.add(dataVisualMpView); - jsonObject1.put("showData", ddlist); - ddlist.clear(); - - jsonObject1.put("cid", fcid); - jsonObject1.put("type", type); - jsonObject1.put("content", dataVisualContent); - jsonArray.add(jsonObject1); - } - - - } - -// jsonObject.put("showData", ddlist); -// jsonObject.put("showData", dlist); - } - } else if (type.equals(DataVisualContent.Type_Tab)) { - List dlist = this.dataVisualTabService.selectListByWhere(" where pid='" + contentId + "' order by morder"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist); - List clist = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + dlist.get(0).getId() + "' order by type,roundTimeContent "); - JSONArray jsonArrayTab = new JSONArray(); - if (clist != null && clist.size() > 0) { - for (DataVisualContent dataVisualContent : - clist) { - JSONObject jsonObjectTab = new JSONObject(); - getAllContentJSONObject(jsonObjectTab, dataVisualContent, dlist.get(0).getId(), sdt, edt, null, dataVisualContent.getType(), null); - jsonArrayTab.add(jsonObjectTab); - } - } - jsonObject.put("showTabData", jsonArrayTab); - } - } else if (type.equals(DataVisualContent.Type_GaugeChart)) { - List dlist = this.dataVisualGaugeChartService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - DataVisualGaugeChart dataVisualGaugeChart = dlist.get(0); - if (dataVisualGaugeChart.getMpid() != null && dataVisualGaugeChart.getMpid().length() > 0) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualGaugeChart.getMpid(), dataVisualGaugeChart.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualGaugeChart.setFixedvalue(String.valueOf(mPoint.getParmvalue())); - } - } - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_RadarChart)) { - List dlist = this.dataVisualRadarChartService.selectListByWhere(" where pid='" + contentId + "'"); - String mainId = ""; - if (dlist != null && dlist.size() > 0) { - DataVisualRadarChart dataVisualRadarChart = dlist.get(0); - mainId = dataVisualRadarChart.getId(); - jsonObject.put("showData", dataVisualRadarChart); - } - List ddlist = this.dataVisualRadarChartSeriesService.selectListByWhere("where 1=1 and pid='" + mainId + "' order by morder "); - if (ddlist != null && ddlist.size() > 0) { - for (DataVisualRadarChartSeries dataVisualRadarChartSeries : - ddlist) { - if (dataVisualRadarChartSeries.getMpid() != null && dataVisualRadarChartSeries.getMpid().length() > 0) { - String[] mpids = dataVisualRadarChartSeries.getMpid().split(","); - String outValue = ""; - for (String mpid : - mpids) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(mpid, dataVisualRadarChartSeries.getValuemethod(), sdt, edt); - if (mPoint != null) { - outValue += mPoint.getParmvalue() + ","; - } - } - dataVisualRadarChartSeries.setFixedvalue(outValue); - } - } - } - jsonObject.put("showSeriesData", ddlist); - List ddlist2 = this.dataVisualRadarChartAxisService.selectListByWhere("where 1=1 and pid='" + mainId + "' order by morder "); - jsonObject.put("showAxisData", ddlist2); - } else if (type.equals(DataVisualContent.Type_PercentChart)) { - List dlist = this.dataVisualPercentChartService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - DataVisualPercentChart dataVisualPercentChart = dlist.get(0); - if (dataVisualPercentChart.getMpid() != null && dataVisualPercentChart.getMpid().length() > 0) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualPercentChart.getMpid(), dataVisualPercentChart.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualPercentChart.setShowData(String.valueOf(mPoint.getParmvalue())); - } - } - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_PieChart)) { - List dataVisualPieChartlist = this.dataVisualPieChartService.selectListByWhere("where 1=1 and pid='" + contentId + "' "); - String mainId = ""; - if (dataVisualPieChartlist != null && dataVisualPieChartlist.size() > 0) { - DataVisualPieChart dataVisualPieChart = dataVisualPieChartlist.get(0); - mainId = dataVisualPieChart.getId(); - jsonObject.put("showData", dataVisualPieChart); - } - List dataVisualPieChartSerieslist = this.dataVisualPieChartSeriesService.selectListByWhere("where 1=1 and pid='" + mainId + "' order by morder "); - if (dataVisualPieChartSerieslist != null && dataVisualPieChartSerieslist.size() > 0) { - for (DataVisualPieChartSeries dataVisualPieChartSeries : - dataVisualPieChartSerieslist) { - if (dataVisualPieChartSeries.getMpid() != null && dataVisualPieChartSeries.getMpid().length() > 0) { - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(dataVisualPieChartSeries.getMpid(), dataVisualPieChartSeries.getValuemethod(), sdt, edt); - if (mPoint != null) { - dataVisualPieChartSeries.setFixedvalue(String.valueOf(mPoint.getParmvalue())); - } - } - } - } - jsonObject.put("showSeriesData", dataVisualPieChartSerieslist); - } else if (type.equals(DataVisualContent.Type_Switch)) { - List dlist = this.dataVisualSwitchService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_PersonnelPositioning)) { - List dlist = this.dataVisualPersonnelPositioningService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_Svg)) { - List dlist = this.dataVisualSvgService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_TaskPoints)) { - List dlist = this.dataVisualTaskPointsService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_EqPoints)) { - List dlist = this.dataVisualEqPointsService.selectListByWhere(" where pid='" + contentId + "'"); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist.get(0)); - } - } else if (type.equals(DataVisualContent.Type_SelectJump)) { - List dlist = this.dataVisualSelectService.selectListByWhere(" where pid='" + contentId + "' order by morder "); - if (dlist != null && dlist.size() > 0) { - jsonObject.put("showData", dlist); - } - } else if (type.equals(DataVisualContent.Type_Form)) { - JSONArray jsondataForm = new JSONArray(); - List gfrList = this.dataVisualFormService.selectListByWhere(" where pid='" + content.getId() + "' and type='" + DataVisualForm.Type_row + "' order by insertRow"); -// for (DataVisualForm gfr : -// gfrList) { - for (int m = 0; m < gfrList.size(); m++) { - DataVisualForm gfr = gfrList.get(m); - JSONObject jsonObjectM = new JSONObject(); - List gfcList = this.dataVisualFormService.selectListByWhere(" where pid='" + gfr.getId() + "' and type='" + DataVisualForm.Type_column + "' order by insertColumn"); - JSONArray jsondataD = new JSONArray(); -// for (DataVisualForm gfc : -// gfcList) { - for (int n = 0; n < gfcList.size(); n++) { - DataVisualForm gfc = gfcList.get(n); - JSONObject jsonObjectD = new JSONObject(); - - //判断sql - if (gfc.getSqlst() != null) { -// com.alibaba.fastjson.JSONObject formSqlPointMainObject = new com.alibaba.fastjson.JSONObject(); - - String sqlSt = gfc.getSqlst(); - if (sqlSt.equals("true")) { - String sqlContent = gfc.getSqlcontent(); - sqlContent = sqlContent.replaceAll("\\$\\{s}", "select"); - sqlContent = sqlContent.replaceAll("\\$\\{f}", "from"); - sqlContent = sqlContent.replaceAll("\\$\\{o}", "order"); - sqlContent = sqlContent.replaceAll("\\$\\{w}", "where"); - sqlContent = sqlContent.replaceAll("\\$\\{an}", "and"); - sqlContent = sqlContent.replaceAll("\\$\\{cot}", "count"); - - sqlContent = sqlContent.replaceAll("\\$\\{var}", "varchar"); - sqlContent = sqlContent.replaceAll("\\$\\{describe}", "description"); - sqlContent = sqlContent.replaceAll("\\$\\{algorithm}", "algorithmid"); - sqlContent = sqlContent.replaceAll("\\$\\{单引号}", "单引号"); - -// System.out.println("sqlContent:" + sqlContent); - - String fContentId = gfr.getPid(); - List> spData = dataVisualFormService.getSpData(sqlContent); -// System.out.println(spData); - - List formSqlPointlist = this.dataVisualFormSqlPointService.selectListByWhere(" where pid='" + gfc.getId() + "' order by morder "); - - com.alibaba.fastjson.JSONArray formSqlPointMainjsonArray = new com.alibaba.fastjson.JSONArray(); - if (spData != null && spData.size() > 0 && formSqlPointlist != null && formSqlPointlist.size() > 0) { - for (int i = 0; i < spData.size(); i++) { -// com.alibaba.fastjson.JSONArray formSqlPointjsonArray = new com.alibaba.fastjson.JSONArray(); - for (int j = 0; j < formSqlPointlist.size(); j++) { - String cname = formSqlPointlist.get(j).getName(); - if (spData.get(i).get(cname) != null) { - com.alibaba.fastjson.JSONObject formSqlPointDObject = new com.alibaba.fastjson.JSONObject(); - formSqlPointDObject.put("value", spData.get(i).get(cname).toString()); - - List ckRFList = this.dataVisualFormService.selectListByWhere(" where pid='" + fContentId + "' " + - " and insertRow='" + (m + i + 1) + "' " + - "order by insertRow "); - - if (ckRFList != null && ckRFList.size() > 0) { - List ckFList = this.dataVisualFormService.selectListByWhere(" where pid='" + ckRFList.get(0).getId() + "' " + - " and insertColumn='" + (n + j + 1) + "' " + - "order by insertColumn "); - - String ckFid = ""; - if (ckFList != null && ckFList.size() > 0) { - ckFid = ckFList.get(0).getId(); - } - formSqlPointDObject.put("id", ckFid); - } - -// List ckFList = this.dataVisualFormService.selectListByWhere(" where frameId='"+gfc.getFrameid()+"' and type='" + DataVisualForm.Type_column + "' " + -// " and insertRow='"+(m+i+1)+"' and insertColumn='"+(n+j+1)+"' " + -// "order by insertRow,insertColumn "); -// String ckFid = ""; -// if(ckFList!=null&&ckFList.size()>0){ -// ckFid = ckFList.get(0).getId(); -// } -// formSqlPointDObject.put("id", ckFid); - - - formSqlPointMainjsonArray.add(formSqlPointDObject); - } - } -// formSqlPointMainjsonArray.add(formSqlPointjsonArray); - } -// System.out.println("formSqlPointMainjsonArray:" + formSqlPointMainjsonArray); - } - -// formSqlPointMainObject.put("data", formSqlPointMainjsonArray); -// formSqlPointMainObject.put("rnum", formSqlPointMainjsonArray.size()); -// formSqlPointMainObject.put("cnum", formSqlPointlist.size()); -// formSqlPointMainObject.put("beginRnum", m); -// formSqlPointMainObject.put("beginCnum", n); - - jsonObjectD.put("formSql", formSqlPointMainjsonArray); - } - - } - - //单元格样式 - if (gfc.getRowst() != null) { - String rowst = gfc.getRowst(); - if (rowst.equals("true")) { -// com.alibaba.fastjson.JSONArray formShowStylejsonArray = new com.alibaba.fastjson.JSONArray(); - List dataVisualFormShowStylelist = this.dataVisualFormShowStyleService.selectListByWhere(" where pid='" + gfc.getId() + "' order by morder "); - if (dataVisualFormShowStylelist != null && dataVisualFormShowStylelist.size() > 0) { - jsonObjectD.put("showStyle", dataVisualFormShowStylelist); - } - } - } - - jsonObjectD.put("id", gfc.getId()); - jsonObjectD.put("insertColumn", gfc.getInsertcolumn()); - jsonObjectD.put("type", DataVisualForm.Type_column); - jsonObjectD.put("column", gfc.getInsertcolumn()); - jsonObjectD.put("rows", gfc.getRows()); - jsonObjectD.put("columns", gfc.getColumns()); - jsonObjectD.put("width", gfc.getWidth()); - jsonObjectD.put("height", gfc.getHeight()); - jsonObjectD.put("background", gfc.getBackground()); - - if (gfc.getStyle() != null) { - jsonObjectD.put("style", gfc.getStyle()); - } else { - jsonObjectD.put("style", ""); - } - - jsonObjectD.put("mpid", gfc.getMpid()); -// jsonObjectD.put("textcontent", gfc.getTextcontent()); - jsonObjectD.put("unitst", gfc.getUnitst()); - jsonObjectD.put("valuemethod", gfc.getValuemethod()); - jsonObjectD.put("rate", gfc.getRate()); - - if (gfc.getMpid() != null && !gfc.getMpid().equals("")) { - String timeframe = "none"; - if (gfc.getTimeframe() != null && gfc.getTimeframe().length() > 0) { - timeframe = gfc.getTimeframe(); - } - - String lsdt = sdt; - String ledt = edt; - if (!timeframe.equals("none")) { - String nowTime = CommUtil.nowDate(); - lsdt = ""; - ledt = nowTime; - if (timeframe.equals("hour")) { - lsdt = CommUtil.subplus(nowTime, "-1", "hour"); - } else if (timeframe.equals("nowday")) { - lsdt = nowTime.substring(0, 10) + " 00:00:00"; - } else if (timeframe.equals("yesterday")) { - lsdt = CommUtil.subplus(nowTime, "-1", "day").substring(0, 10) + " 00:00:00"; - ledt = CommUtil.subplus(nowTime, "-1", "day").substring(0, 10) + " 23:59:59"; - } else if (timeframe.equals("week")) { - lsdt = CommUtil.subplus(nowTime, "-7", "day"); - } else if (timeframe.equals("month")) { -// lsdt = CommUtil.subplus(nowTime, "-1", "month"); - lsdt = nowTime.substring(0, 7) + "-01"; - } else if (timeframe.equals("year")) { -// lsdt = CommUtil.subplus(nowTime, "-1", "year"); - lsdt = nowTime.substring(0, 4) + "-01-01"; - } else if (timeframe.equals("3year")) { - lsdt = CommUtil.subplus(nowTime, "-3", "year"); - } else if (timeframe.equals("yoy")) { - if (!sdt.equals("") && !edt.equals("")) { - lsdt = sdt; - if (!edt.equals("")) { - ledt = edt; - } else { - ledt = sdt; - } - } - ledt = CommUtil.subplus(ledt, "-1", "year").substring(0, 7) + "-01 00:00"; - int maxMonth = CommUtil.getDaysByYearMonth(Integer.valueOf(ledt.substring(0, 4)), Integer.valueOf(ledt.substring(5, 7))); - String smaxMonth = ""; - if (maxMonth < 10) { - smaxMonth = "0" + maxMonth; - } else { - smaxMonth = String.valueOf(maxMonth); - } - lsdt = ledt.substring(0, 7) + "-" + smaxMonth + " 23:59"; - } else if (timeframe.equals("mom")) { - if (!sdt.equals("") && !edt.equals("")) { - lsdt = sdt; - if (!edt.equals("")) { - ledt = edt; - } else { - ledt = sdt; - } - } - ledt = CommUtil.subplus(ledt, "-1", "month").substring(0, 7) + "-01 00:00"; - int maxMonth = CommUtil.getDaysByYearMonth(Integer.valueOf(ledt.substring(0, 4)), Integer.valueOf(ledt.substring(5, 7))); - String smaxMonth = ""; - if (maxMonth < 10) { - smaxMonth = "0" + maxMonth; - } else { - smaxMonth = String.valueOf(maxMonth); - } - lsdt = ledt.substring(0, 7) + "-" + smaxMonth + " 23:59"; - } - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(gfc.getMpid(), gfc.getValuemethod(), lsdt, ledt); - String mpTextcontent = ""; - if (mPoint != null) { - mpTextcontent = String.valueOf(mPoint.getParmvalue()); - } - jsonObjectD.put("textcontent", mpTextcontent); - } else { - if (gfc.getTimest() != null && gfc.getTimest().length() > 0) { - if (gfc.getTimest().equals("true")) { - MPoint mPoint = this.mPointService.selectById(gfc.getMpid()); - String mpTextcontent = ""; - if (mPoint != null) { - mpTextcontent = String.valueOf(mPoint.getMeasuredt()); - } - jsonObjectD.put("textcontent", mpTextcontent); - } else { -// MPoint mPoint = this.mPointService.selectById(gfc.getMpid()); - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(gfc.getMpid(), gfc.getValuemethod(), lsdt, ledt); -// BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); -// mPoint.setParmvalue(parmValue); - String mpTextcontent = ""; - if (mPoint != null) { - mpTextcontent = String.valueOf(mPoint.getParmvalue()); - } - jsonObjectD.put("textcontent", mpTextcontent); - } - } else { -// MPoint mPoint = this.mPointService.selectById(gfc.getMpid()); - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(gfc.getMpid(), gfc.getValuemethod(), lsdt, ledt); -// BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); -// mPoint.setParmvalue(parmValue); - String mpTextcontent = ""; - if (mPoint != null) { - mpTextcontent = String.valueOf(mPoint.getParmvalue()); - } - jsonObjectD.put("textcontent", mpTextcontent); - } - - } - } else { - jsonObjectD.put("textcontent", gfc.getTextcontent()); - } - - - if (gfc.getFontsize() != null) { - jsonObjectD.put("fontsize", gfc.getFontsize()); - } else { - jsonObjectD.put("fontsize", ""); - } - if (gfc.getFontcolor() != null) { - jsonObjectD.put("fontcolor", gfc.getFontcolor()); - } else { - jsonObjectD.put("fontcolor", ""); - } - if (gfc.getTextalign() != null) { - jsonObjectD.put("textalign", gfc.getTextalign()); - } else { - jsonObjectD.put("textalign", ""); - } - if (gfc.getVerticalalign() != null) { - jsonObjectD.put("verticalalign", gfc.getVerticalalign()); - } else { - jsonObjectD.put("verticalalign", ""); - } - if (gfc.getFontweight() != null) { - jsonObjectD.put("fontweight", gfc.getFontweight()); - } else { - jsonObjectD.put("fontweight", ""); - } - if (gfc.getBorder() != null) { - jsonObjectD.put("border", gfc.getBorder()); - } else { - jsonObjectD.put("border", ""); - } - if (gfc.getPadding() != null) { - jsonObjectD.put("padding", gfc.getPadding()); - } else { - jsonObjectD.put("padding", ""); - } - if (gfc.getBorderradius() != null) { - jsonObjectD.put("borderradius", gfc.getBorderradius()); - } else { - jsonObjectD.put("borderradius", ""); - } - if (gfc.getUrldata() != null) { - jsonObjectD.put("urldata", gfc.getUrldata()); - } else { - jsonObjectD.put("urldata", ""); - } - if (gfc.getNumtail() != null) { - jsonObjectD.put("numtail", gfc.getNumtail()); - } else { - jsonObjectD.put("numtail", ""); - } - if (gfc.getTimeframe() != null) { - jsonObjectD.put("timeframe", gfc.getTimeframe()); - } else { - jsonObjectD.put("timeframe", ""); - } - if (gfc.getTimest() != null) { - jsonObjectD.put("timest", gfc.getTimest()); - } else { - jsonObjectD.put("timest", ""); - } - if (gfc.getTimestnum() != null) { - jsonObjectD.put("timestnum", gfc.getTimestnum()); - } else { - jsonObjectD.put("timestnum", ""); - } - - jsondataD.add(jsonObjectD); - } - jsonObjectM.put("id", gfr.getId()); - jsonObjectM.put("insertRow", gfr.getInsertrow()); - jsonObjectM.put("type", DataVisualForm.Type_row); - jsonObjectM.put("rows", gfr.getInsertrow()); - jsonObjectM.put("nodes", jsondataD); - jsondataForm.add(jsonObjectM); - } - - jsonObject.put("showData", jsondataForm); - } - - return jsonObject; - } - - - @RequestMapping("/doIframeCopy.do") - public ModelAndView doIframeCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - - String newContentId = CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - this.dataVisualContentService.save(dataVisualContent); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualDateController.java b/src/com/sipai/controller/process/DataVisualDateController.java deleted file mode 100644 index af6bc467..00000000 --- a/src/com/sipai/controller/process/DataVisualDateController.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualDate; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualDateService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualDate") -public class DataVisualDateController { - @Resource - private DataVisualDateService dataVisualDateService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualDateService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if(list!=null&&list.size()>0){ - DataVisualDate dataVisualDate = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualDate)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if(dContent!=null){ - List list = this.dataVisualDateService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if(list!=null&&list.size()>0){ - model.addAttribute("dataVisualDate", list.get(0)); - } - } - - return "/process/dataVisualDateEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("220"); - dataVisualContent.setHeight("60"); - dataVisualContent.setType(DataVisualContent.Type_Date); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("60"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualDate dataVisualDate = new DataVisualDate(); - dataVisualDate.setId(CommUtil.getUUID()); - dataVisualDate.setPid(cntentId); - dataVisualDate.setBackground("transparent"); - dataVisualDate.setTypes("year-month-day 24hour:min:sec week"); - - this.dataVisualDateService.save(dataVisualDate); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualDate") DataVisualDate dataVisualDate) { - int res = this.dataVisualDateService.update(dataVisualDate); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualDateService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualDateService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualDateSelectController.java b/src/com/sipai/controller/process/DataVisualDateSelectController.java deleted file mode 100644 index 94e33c80..00000000 --- a/src/com/sipai/controller/process/DataVisualDateSelectController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualDateSelect; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualDateSelectService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualDateSelect") -public class DataVisualDateSelectController { - @Resource - private DataVisualDateSelectService dataVisualDateSelectService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualDateSelectService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if(list!=null&&list.size()>0){ - DataVisualDateSelect dataVisualDateSelect = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualDateSelect)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if(dContent!=null){ - List list = this.dataVisualDateSelectService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if(list!=null&&list.size()>0){ - model.addAttribute("dataVisualDateSelect", list.get(0)); - } - } - - return "/process/dataVisualDateSelectEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("210"); - dataVisualContent.setHeight("30"); - dataVisualContent.setType(DataVisualContent.Type_DateSelect); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - dataVisualContent.setStyle("border:1px solid #d2d6de;"); - this.dataVisualContentService.save(dataVisualContent); - - DataVisualDateSelect dataVisualDateSelect = new DataVisualDateSelect(); - dataVisualDateSelect.setId(CommUtil.getUUID()); - dataVisualDateSelect.setPid(cntentId); - dataVisualDateSelect.setBackground("transparent"); - dataVisualDateSelect.setType("3"); - - this.dataVisualDateSelectService.save(dataVisualDateSelect); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualDateSelect") DataVisualDateSelect dataVisualDateSelect) { - int res = this.dataVisualDateSelectService.update(dataVisualDateSelect); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualDateSelectService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualDateSelectService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualEqPointsController.java b/src/com/sipai/controller/process/DataVisualEqPointsController.java deleted file mode 100644 index 86472db9..00000000 --- a/src/com/sipai/controller/process/DataVisualEqPointsController.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualEqPoints; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualEqPointsService; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualEqPoints") -public class DataVisualEqPointsController { - @Resource - private DataVisualEqPointsService dataVisualEqPointsService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/selectListForVisual.do") - public String selectList(HttpServletRequest request,Model model) { - return "/process/dataVisualEqPoints4Select"; - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid=request.getParameter("pid"); - List list = this.dataVisualEqPointsService.selectListByWhere("where 1=1 and pid='"+pid+"' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List list = this.dataVisualEqPointsService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualEqPoints", list.get(0)); - } - - return "/process/dataVisualEqPointsEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String frameId=request.getParameter("frameId"); - String datas=request.getParameter("datas"); - - String[] cids=datas.split(","); - if(cids!=null&&cids.length>0){ - for (String cid : cids) { - DataVisualContent dataVisualContent=new DataVisualContent(); - DataVisualEqPoints dataVisualEqPoints=new DataVisualEqPoints(); - - String contentId=CommUtil.getUUID(); - dataVisualContent.setId(contentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx("200"); - dataVisualContent.setPosty("20"); - dataVisualContent.setType(DataVisualContent.Type_EqPoints); - dataVisualContent.setWidth("120"); - dataVisualContent.setHeight("36"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setIstab("false"); - this.dataVisualContentService.save(dataVisualContent); - - dataVisualEqPoints.setId(CommUtil.getUUID()); - dataVisualEqPoints.setPid(contentId); - dataVisualEqPoints.setEqid(cid); - - this.dataVisualEqPointsService.save(dataVisualEqPoints); - } - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualEqPoints") DataVisualEqPoints dataVisualEqPoints) { - int res = this.dataVisualEqPointsService.update(dataVisualEqPoints); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/process/DataVisualFormController.java b/src/com/sipai/controller/process/DataVisualFormController.java deleted file mode 100644 index 5c3e560b..00000000 --- a/src/com/sipai/controller/process/DataVisualFormController.java +++ /dev/null @@ -1,605 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualForm; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualFormService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualForm") -public class DataVisualFormController { - @Resource - private DataVisualFormService dataVisualFormService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private MPointService mPointService; - - @RequestMapping("/showContainer.do") - public String showContainer(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - - model.addAttribute("dataVisualContent", dataVisualContent); - - int insertrow = 0; - int insertcolumn = 0; - List rlist = this.dataVisualFormService.selectListByWhere(" where pid='" + contentId + "' "); - if (rlist != null && rlist.size() > 0) { - for (DataVisualForm r : rlist) { - List clist = this.dataVisualFormService.selectListByWhere(" where pid='" + r.getId() + "' "); - if (insertcolumn < clist.size()) { - insertcolumn = clist.size(); - } - } - - } - insertrow = rlist.size(); - - model.addAttribute("insertrow", insertrow); - model.addAttribute("insertcolumn", insertcolumn); - - return "/process/dataVisualFormContainer"; - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualForm dataVisualForm = this.dataVisualFormService.selectById(request.getParameter("id")); - - model.addAttribute("dataVisualForm", dataVisualForm); - return "/process/dataVisualFormContainerEdit"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String orderstr = ""; - - String type = request.getParameter("type"); - if (type.equals(DataVisualForm.Type_row)) { - orderstr = " order by insertRow"; - } else if (type.equals(DataVisualForm.Type_column)) { - orderstr = " order by insertcolumn"; - } - - String wherestr = " where 1=1 and pid='" + request.getParameter("frameId") + "' and type='" + type + "' "; - List list = this.dataVisualFormService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String frameId = request.getParameter("pid"); - - JSONArray jsondata = new JSONArray(); - - List gfrList = this.dataVisualFormService.selectListByWhere(" where pid='" + frameId + "' and type='" + DataVisualForm.Type_row + "' order by insertRow"); - for (DataVisualForm gfr : - gfrList) { - JSONObject jsonObjectM = new JSONObject(); - List gfcList = this.dataVisualFormService.selectListByWhere(" where pid='" + gfr.getId() + "' and type='" + DataVisualForm.Type_column + "' order by insertColumn"); - JSONArray jsondataD = new JSONArray(); - for (DataVisualForm gfc : - gfcList) { - JSONObject jsonObjectD = new JSONObject(); - - jsonObjectD.put("id", gfc.getId()); - jsonObjectD.put("insertColumn", gfc.getInsertcolumn()); - jsonObjectD.put("type", DataVisualForm.Type_column); - jsonObjectD.put("column", gfc.getInsertcolumn()); - jsonObjectD.put("rows", gfc.getRows()); - jsonObjectD.put("columns", gfc.getColumns()); - jsonObjectD.put("width", gfc.getWidth()); - jsonObjectD.put("height", gfc.getHeight()); - jsonObjectD.put("background", gfc.getBackground()); - if (gfc.getStyle() != null) { - jsonObjectD.put("style", gfc.getStyle()); - } else { - jsonObjectD.put("style", ""); - } - jsonObjectD.put("formSql", gfc.getSqlst()); - - jsonObjectD.put("mpid", gfc.getMpid()); - jsonObjectD.put("textcontent", gfc.getTextcontent()); - jsonObjectD.put("unitst", gfc.getUnitst()); - jsonObjectD.put("valuemethod", gfc.getValuemethod()); - jsonObjectD.put("rate", gfc.getRate()); -// //先判定测量点 -// if (gfc.getMpid() != null && !gfc.getMpid().equals("")) { -//// MPoint mPoint = this.mPointService.selectById(unitId,gfc.getMpid()); -//// MPoint mPoint = this.mPointService.selectById(gfc.getMpid()); -//// String mpTextcontent = ""; -//// if (mPoint != null) { -//// mpTextcontent = String.valueOf(mPoint.getParmvalue()); -//// } -// jsonObjectD.put("textcontent", gfc.getMpid()); -// } else { -// if (gfc.getTextcontent() != null) { -// jsonObjectD.put("textcontent", gfc.getTextcontent()); -// } else { -// jsonObjectD.put("textcontent", ""); -// } -// } - - if (gfc.getFontsize() != null) { - jsonObjectD.put("fontsize", gfc.getFontsize()); - } else { - jsonObjectD.put("fontsize", ""); - } - if (gfc.getFontcolor() != null) { - jsonObjectD.put("fontcolor", gfc.getFontcolor()); - } else { - jsonObjectD.put("fontcolor", ""); - } - if (gfc.getTextalign() != null) { - jsonObjectD.put("textalign", gfc.getTextalign()); - } else { - jsonObjectD.put("textalign", ""); - } - if (gfc.getVerticalalign() != null) { - jsonObjectD.put("verticalalign", gfc.getVerticalalign()); - } else { - jsonObjectD.put("verticalalign", ""); - } - if (gfc.getFontweight() != null) { - jsonObjectD.put("fontweight", gfc.getFontweight()); - } else { - jsonObjectD.put("fontweight", ""); - } - if (gfc.getBorder() != null) { - jsonObjectD.put("border", gfc.getBorder()); - } else { - jsonObjectD.put("border", ""); - } - if (gfc.getPadding() != null) { - jsonObjectD.put("padding", gfc.getPadding()); - } else { - jsonObjectD.put("padding", ""); - } - if (gfc.getBorderradius() != null) { - jsonObjectD.put("borderradius", gfc.getBorderradius()); - } else { - jsonObjectD.put("borderradius", ""); - } - if (gfc.getUrldata() != null) { - jsonObjectD.put("urldata", gfc.getUrldata()); - } else { - jsonObjectD.put("urldata", ""); - } - if (gfc.getNumtail() != null) { - jsonObjectD.put("numtail", gfc.getNumtail()); - } else { - jsonObjectD.put("numtail", ""); - } - if (gfc.getTimeframe() != null) { - jsonObjectD.put("timeframe", gfc.getTimeframe()); - } else { - jsonObjectD.put("timeframe", ""); - } - if (gfc.getTimest() != null) { - jsonObjectD.put("timest", gfc.getTimest()); - } else { - jsonObjectD.put("timest", ""); - } - if (gfc.getTimestnum() != null) { - jsonObjectD.put("timestnum", gfc.getTimestnum()); - } else { - jsonObjectD.put("timestnum", ""); - } - - jsondataD.add(jsonObjectD); - } - jsonObjectM.put("id", gfr.getId()); - jsonObjectM.put("insertRow", gfr.getInsertrow()); - jsonObjectM.put("type", DataVisualForm.Type_row); - jsonObjectM.put("rows", gfr.getInsertrow()); - jsonObjectM.put("nodes", jsondataD); - jsondata.add(jsonObjectM); - } - - model.addAttribute("result", jsondata); - return new ModelAndView("result"); - } - - @RequestMapping("/doRCsave.do") - public ModelAndView doRCsave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - int insertrow = Integer.valueOf(request.getParameter("insertrow")); - int insertcolumn = Integer.valueOf(request.getParameter("insertcolumn")); - String frameId = request.getParameter("frameId"); - - List rlist = this.dataVisualFormService.selectListByWhere(" where pid='" + frameId + "' "); - for (DataVisualForm r : rlist) { - this.dataVisualFormService.deleteByWhere(" where pid='" + r.getId() + "' "); - } - this.dataVisualFormService.deleteByWhere(" where pid='" + frameId + "' "); - - for (int i = 1; i < insertrow + 1; i++) { - DataVisualForm row = new DataVisualForm(); - String rowId = CommUtil.getUUID(); - row.setId(rowId); - row.setPid(frameId); - row.setInsertrow(i); - row.setType(DataVisualForm.Type_row); - row.setFrameid(frameId); - dataVisualFormService.save(row); - for (int j = 1; j < insertcolumn + 1; j++) { - DataVisualForm cloum = new DataVisualForm(); - cloum.setId(CommUtil.getUUID()); - cloum.setPid(rowId); - cloum.setInsertrow(i); - cloum.setInsertcolumn(j); - cloum.setRows(1); - cloum.setColumns(1); - cloum.setWidth(String.valueOf(CommUtil.round(100 / insertcolumn, 2))); - cloum.setHeight(String.valueOf(CommUtil.round(100 / insertrow, 2))); - cloum.setType(DataVisualForm.Type_column); - cloum.setFrameid(frameId); - cloum.setBorder("border:1px solid #B0B0B0;"); - cloum.setValuemethod("nowTime"); - cloum.setTimeframe("none"); - cloum.setTimest("false"); - dataVisualFormService.save(cloum); - } - } - - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - int insertrow = Integer.valueOf(request.getParameter("insertrow")); - int insertcolumn = Integer.valueOf(request.getParameter("insertcolumn")); - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("150"); - dataVisualContent.setHeight("150"); - dataVisualContent.setType(DataVisualContent.Type_Form); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - - this.dataVisualContentService.save(dataVisualContent); - - List rlist = this.dataVisualFormService.selectListByWhere(" where pid='" + cntentId + "' "); - for (DataVisualForm r : rlist) { - this.dataVisualFormService.deleteByWhere(" where pid='" + r.getId() + "' "); - } - this.dataVisualFormService.deleteByWhere(" where pid='" + frameId + "' "); - - for (int i = 1; i < insertrow + 1; i++) { - DataVisualForm row = new DataVisualForm(); - String rowId = CommUtil.getUUID(); - row.setId(rowId); - row.setPid(cntentId); - row.setInsertrow(i); - row.setType(DataVisualForm.Type_row); - row.setFrameid(cntentId); - dataVisualFormService.save(row); - for (int j = 1; j < insertcolumn + 1; j++) { - DataVisualForm cloum = new DataVisualForm(); - cloum.setId(CommUtil.getUUID()); - cloum.setPid(rowId); - cloum.setInsertrow(i); - cloum.setInsertcolumn(j); - cloum.setRows(1); - cloum.setColumns(1); - cloum.setWidth(String.valueOf(CommUtil.round(100 / insertcolumn, 2))); - cloum.setHeight(String.valueOf(CommUtil.round(100 / insertrow, 2))); - cloum.setBorder("border:1px solid #B0B0B0;"); - cloum.setTextalign("center"); - cloum.setType(DataVisualForm.Type_column); - cloum.setFrameid(cntentId); - cloum.setValuemethod("nowTime"); - dataVisualFormService.save(cloum); - } - } - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doTextCopy.do") - public ModelAndView doTextCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - - String newContentId = CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - this.dataVisualContentService.save(dataVisualContent); - - List rlist = this.dataVisualFormService.selectListByWhere(" where pid='" + contentId + "' "); - for (DataVisualForm rdataVisualForm : - rlist) { - String oldRId = rdataVisualForm.getId(); - String newRId = CommUtil.getUUID(); - rdataVisualForm.setId(newRId); - rdataVisualForm.setPid(newContentId); - this.dataVisualFormService.save(rdataVisualForm); - - List clist = this.dataVisualFormService.selectListByWhere(" where pid='" + oldRId + "' "); - for (DataVisualForm cdataVisualForm : - clist) { - cdataVisualForm.setId(CommUtil.getUUID()); - cdataVisualForm.setPid(newRId); - this.dataVisualFormService.save(cdataVisualForm); - } - } - - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualForm") DataVisualForm dataVisualForm) { - int res = this.dataVisualFormService.update(dataVisualForm); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doTdupdate.do") - public ModelAndView doTdupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualForm") DataVisualForm dataVisualForm) { - - this.dataVisualFormService.update(dataVisualForm); - - String frameId = request.getParameter("frameId"); - double oldwidth = Double.valueOf(request.getParameter("oldwidth")); - double oldheight = Double.valueOf(request.getParameter("oldheight")); - - double width = Double.valueOf(dataVisualForm.getWidth()); - double height = Double.valueOf(dataVisualForm.getHeight()); - - if (width != oldwidth) { - int nowInsertColumn = dataVisualForm.getInsertcolumn(); - int nowColumns = dataVisualForm.getColumns(); - - //判断是不是最后一列 - - //同列td - List laddlist = this.dataVisualFormService.selectListByWhere(" where frameId='" + frameId + "' and insertColumn=" + nowInsertColumn + " and columns=" + nowColumns + " and type='" + DataVisualForm.Type_column + "' "); - for (DataVisualForm ld : laddlist) { - ld.setWidth(String.valueOf(width)); - this.dataVisualFormService.update(ld); - } - //下一列td - List lsubtractlist = this.dataVisualFormService.selectListByWhere(" where frameId='" + frameId + "' and insertColumn=" + (nowInsertColumn + nowColumns) + " and type='" + DataVisualForm.Type_column + "' "); - for (DataVisualForm ld : lsubtractlist) { - double lsubtractWidth = Double.valueOf(ld.getWidth()); - if (width > oldwidth) { - lsubtractWidth = lsubtractWidth - (width - oldwidth); - } else { - lsubtractWidth = lsubtractWidth + (oldwidth - width); - } - ld.setWidth(String.valueOf(lsubtractWidth)); - this.dataVisualFormService.update(ld); - } - - } - if (height != oldheight) { - int nowInsertRow = dataVisualForm.getInsertrow(); - int nowRows = dataVisualForm.getRows(); - - //判断是不是最后一行 - - //同行td - List laddlist = this.dataVisualFormService.selectListByWhere(" where frameId='" + frameId + "' and insertRow=" + nowInsertRow + " and rows=" + nowRows + " and type='" + DataVisualForm.Type_column + "' "); - for (DataVisualForm ld : laddlist) { - ld.setHeight(String.valueOf(height)); - this.dataVisualFormService.update(ld); - } - //下一行td - List lsubtractlist = this.dataVisualFormService.selectListByWhere(" where frameId='" + frameId + "' and insertRow=" + (nowInsertRow + nowRows) + " and type='" + DataVisualForm.Type_column + "' "); - for (DataVisualForm ld : lsubtractlist) { - double lsubtractHeight = Double.valueOf(ld.getHeight()); - if (height > oldheight) { - lsubtractHeight = lsubtractHeight - (height - oldheight); - } else { - lsubtractHeight = lsubtractHeight + (oldheight - height); - } - ld.setHeight(String.valueOf(lsubtractHeight)); - this.dataVisualFormService.update(ld); - } - - } - - -// int res = this.dataVisualFormService.update(dataVisualForm); -// if (res == 1) { -// Result result = Result.success(res); -// model.addAttribute("result", CommUtil.toJson(result)); -// } else { -// Result result = Result.failed("保存失败"); -// model.addAttribute("result", CommUtil.toJson(result)); -// } - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualFormService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualFormService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doContainerMerge.do") - public ModelAndView doContainerMerge(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - String firstRow = request.getParameter("firstRow"); - String firstColumn = request.getParameter("firstColumn"); - String lastRow = request.getParameter("lastRow"); - String lastColumn = request.getParameter("lastColumn"); - - String delIds = ""; -// String delPids=""; - int mergeRow = Integer.valueOf(lastRow) - Integer.valueOf(firstRow); - int mergeColumn = Integer.valueOf(lastColumn) - Integer.valueOf(firstColumn); - - List rlist = this.dataVisualFormService.selectListByWhere(" where pid='" + frameId + "' and insertRow>=" + firstRow + " and insertRow<=" + lastRow + " and type='" + DataVisualForm.Type_row + "' order by insertRow "); - if (rlist != null && rlist.size() > 0) { - DataVisualForm g = new DataVisualForm(); - double addWidth = 0; - double addHeight = 0; - for (int i = 0; i < rlist.size(); i++) { - DataVisualForm r = rlist.get(i); - List clist = this.dataVisualFormService.selectListByWhere(" where pid='" + r.getId() + "' and insertColumn>=" + firstColumn + " and insertColumn<=" + lastColumn + " and type='" + DataVisualForm.Type_column + "' order by insertColumn "); - if (clist != null && clist.size() > 0) { - for (int j = 0; j < clist.size(); j++) { - if (i == 0 && j == 0) { - g = clist.get(j); - g.setRows(mergeRow + 1); - g.setColumns(mergeColumn + 1); - addWidth += Double.valueOf(g.getWidth()); - addHeight += Double.valueOf(g.getHeight()); - } else { - if (i == 0) { - addWidth += Double.valueOf(clist.get(j).getWidth()); - } - if (j == 0) { - addHeight += Double.valueOf(clist.get(j).getHeight()); - } - - delIds += clist.get(j).getId() + ","; -// delPids+=clist.get(j).getPid()+","; - } - } - - - } - } - - g.setWidth(String.valueOf(addWidth)); - g.setHeight(String.valueOf(addHeight)); - this.dataVisualFormService.update(g); - addWidth = 0; - addHeight = 0; - } - - delIds = delIds.replace(",", "','"); - this.dataVisualFormService.deleteByWhere("where id in('" + delIds + "')"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(frameId); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doBorderChange.do") - public ModelAndView doBorderChange(HttpServletRequest request, Model model) { - String borderSt = request.getParameter("borderSt"); - String frameId = request.getParameter("frameId"); - String firstRow = request.getParameter("firstRow"); - String firstColumn = request.getParameter("firstColumn"); - String lastRow = request.getParameter("lastRow"); - String lastColumn = request.getParameter("lastColumn"); - - - List rlist = this.dataVisualFormService.selectListByWhere(" where pid='" + frameId + "' and insertRow>=" + firstRow + " and insertRow<=" + lastRow + " and type='" + DataVisualForm.Type_row + "' order by insertRow "); - if (rlist != null && rlist.size() > 0) { - for (int i = 0; i < rlist.size(); i++) { - DataVisualForm r = rlist.get(i); - List clist = this.dataVisualFormService.selectListByWhere(" where pid='" + r.getId() + "' and insertColumn>=" + firstColumn + " and insertColumn<=" + lastColumn + " and type='" + DataVisualForm.Type_column + "' order by insertColumn "); - if (clist != null && clist.size() > 0) { - for (int j = 0; j < clist.size(); j++) { - DataVisualForm dataVisualForm = clist.get(j); - - if (borderSt.equals("add")) { - dataVisualForm.setBorder("border:1px solid #B0B0B0;"); - } else if (borderSt.equals("del")) { - dataVisualForm.setBorder(""); - } - - this.dataVisualFormService.update(dataVisualForm); - - } - } - } - - } - - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(frameId); - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualFormShowStyleController.java b/src/com/sipai/controller/process/DataVisualFormShowStyleController.java deleted file mode 100644 index b2e9bf8c..00000000 --- a/src/com/sipai/controller/process/DataVisualFormShowStyleController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualFormShowStyle; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualFormShowStyleService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; - -@Controller -@RequestMapping("/process/dataVisualFormShowStyle") -public class DataVisualFormShowStyleController { - @Resource - private DataVisualFormShowStyleService dataVisualFormShowStyleService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/dataVisualFormShowStyleList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 and pid='"+request.getParameter("pid")+"' "; - - - PageHelper.startPage(page, rows); - List list = this.dataVisualFormShowStyleService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "process/dataVisualFormShowStyleAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualFormShowStyle dataVisualFormShowStyle = this.dataVisualFormShowStyleService.selectById(id); - model.addAttribute("dataVisualFormShowStyle", dataVisualFormShowStyle); - return "process/dataVisualFormShowStyleEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("meterCheck") DataVisualFormShowStyle dataVisualFormShowStyle) { - - dataVisualFormShowStyle.setId(CommUtil.getUUID()); - - int res = this.dataVisualFormShowStyleService.save(dataVisualFormShowStyle); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualFormShowStyle") DataVisualFormShowStyle dataVisualFormShowStyle) { - int res = this.dataVisualFormShowStyleService.update(dataVisualFormShowStyle); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualFormShowStyleService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualFormShowStyleService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualFormShowStyle dataVisualFormShowStyle = new DataVisualFormShowStyle(); - jsonOne = json.getJSONObject(i); - dataVisualFormShowStyle.setId((String) jsonOne.get("id")); - dataVisualFormShowStyle.setMorder(i); - result = this.dataVisualFormShowStyleService.update(dataVisualFormShowStyle); - } - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/process/DataVisualFormSqlPointController.java b/src/com/sipai/controller/process/DataVisualFormSqlPointController.java deleted file mode 100644 index 6530204e..00000000 --- a/src/com/sipai/controller/process/DataVisualFormSqlPointController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualFormSqlPoint; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualFormSqlPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; - -@Controller -@RequestMapping("/process/dataVisualFormSqlPoint") -public class DataVisualFormSqlPointController { - @Resource - private DataVisualFormSqlPointService dataVisualFormSqlPointService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/dataVisualFormSqlPointList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 and pid='"+request.getParameter("pid")+"' "; - - - PageHelper.startPage(page, rows); - List list = this.dataVisualFormSqlPointService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - - DataVisualFormSqlPoint dataVisualFormSqlPoint = new DataVisualFormSqlPoint(); - dataVisualFormSqlPoint.setId(CommUtil.getUUID()); - dataVisualFormSqlPoint.setPid(pid); - dataVisualFormSqlPoint.setMorder(0); - - int res = this.dataVisualFormSqlPointService.save(dataVisualFormSqlPoint); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualFormSqlPoint") DataVisualFormSqlPoint dataVisualFormSqlPoint) { - int result = this.dataVisualFormSqlPointService.update(dataVisualFormSqlPoint); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/updateName.do") - public ModelAndView updateName(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String name = request.getParameter("name"); - - DataVisualFormSqlPoint dataVisualFormSqlPoint = this.dataVisualFormSqlPointService.selectById(id); - dataVisualFormSqlPoint.setName(name); - - int res = this.dataVisualFormSqlPointService.update(dataVisualFormSqlPoint); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualFormSqlPointService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualFormSqlPointService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualFormSqlPoint dataVisualFormSqlPoint = new DataVisualFormSqlPoint(); - jsonOne = json.getJSONObject(i); - dataVisualFormSqlPoint.setId((String) jsonOne.get("id")); - dataVisualFormSqlPoint.setMorder(i); - result = this.dataVisualFormSqlPointService.update(dataVisualFormSqlPoint); - } - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/process/DataVisualFrameContainerController.java b/src/com/sipai/controller/process/DataVisualFrameContainerController.java deleted file mode 100644 index 82fd0228..00000000 --- a/src/com/sipai/controller/process/DataVisualFrameContainerController.java +++ /dev/null @@ -1,368 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualFrameContainer; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualFrameContainerService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import sun.misc.Perf.GetPerfAction; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualFrameContainer") -public class DataVisualFrameContainerController { - @Resource - private DataVisualFrameContainerService dataVisualFrameContainerService; - - @RequestMapping("/showContainer.do") - public String showContainer(HttpServletRequest request,Model model) { - String frameId=request.getParameter("frameId"); - int insertrow=0;int insertcolumn=0; - - List rlist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='"+frameId+"' "); - if(rlist!=null&&rlist.size()>0){ - for (DataVisualFrameContainer r : rlist) { - List clist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='"+r.getId()+"' "); - if(insertcolumn list = this.dataVisualFrameContainerService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request,Model model) { - String frameId = request.getParameter("frameId"); - - JSONArray jsondata = new JSONArray(); - - List gfrList = this.dataVisualFrameContainerService.selectListByWhere(" where pid='" + frameId + "' and type='" + DataVisualFrameContainer.Type_row + "' order by insertRow"); - for (DataVisualFrameContainer gfr : - gfrList) { - JSONObject jsonObjectM = new JSONObject(); - List gfcList = this.dataVisualFrameContainerService.selectListByWhere(" where pid='" + gfr.getId() + "' and type='" + DataVisualFrameContainer.Type_column + "' order by insertColumn"); - JSONArray jsondataD = new JSONArray(); - for (DataVisualFrameContainer gfc : - gfcList) { - JSONObject jsonObjectD = new JSONObject(); - - jsonObjectD.put("id", gfc.getId()); - jsonObjectD.put("insertColumn", gfc.getInsertcolumn()); - jsonObjectD.put("type", DataVisualFrameContainer.Type_column); - jsonObjectD.put("column", gfc.getInsertcolumn()); - jsonObjectD.put("rows", gfc.getRows()); - jsonObjectD.put("columns", gfc.getColumns()); - jsonObjectD.put("width", gfc.getWidth()); - jsonObjectD.put("height", gfc.getHeight()); - jsonObjectD.put("background", gfc.getBackground()); - - jsondataD.add(jsonObjectD); - } - jsonObjectM.put("id", gfr.getId()); - jsonObjectM.put("insertRow", gfr.getInsertrow()); - jsonObjectM.put("type", DataVisualFrameContainer.Type_row); - jsonObjectM.put("rows", gfr.getInsertrow()); - jsonObjectM.put("width", gfr.getWidth()); - jsonObjectM.put("height", gfr.getHeight()); - jsonObjectM.put("nodes", jsondataD); - jsondata.add(jsonObjectM); - } - - model.addAttribute("result", jsondata); - return new ModelAndView("result"); - } - - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - int insertrow=Integer.valueOf(request.getParameter("insertrow")); - int insertcolumn=Integer.valueOf(request.getParameter("insertcolumn")); - String frameId=request.getParameter("frameId"); - - List rlist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='"+frameId+"' "); - for (DataVisualFrameContainer r : rlist) { - this.dataVisualFrameContainerService.deleteByWhere(" where pid='"+r.getId()+"' "); - } - this.dataVisualFrameContainerService.deleteByWhere(" where pid='"+frameId+"' "); - - for (int i = 1; i < insertrow+1; i++) { - DataVisualFrameContainer row = new DataVisualFrameContainer(); - String rowId=CommUtil.getUUID(); - row.setId(rowId); - row.setPid(frameId); - row.setInsertrow(i); - row.setType(DataVisualFrameContainer.Type_row); - row.setFrameid(frameId); - dataVisualFrameContainerService.save(row); - for (int j = 1; j < insertcolumn+1; j++) { - DataVisualFrameContainer cloum = new DataVisualFrameContainer(); - cloum.setId(CommUtil.getUUID()); - cloum.setPid(rowId); - cloum.setInsertrow(i); - cloum.setInsertcolumn(j); - cloum.setRows(1); - cloum.setColumns(1); - cloum.setWidth(String.valueOf(CommUtil.round(100/insertcolumn, 2))); - cloum.setHeight(String.valueOf(CommUtil.round(100/insertrow, 2))); - cloum.setType(DataVisualFrameContainer.Type_column); - cloum.setFrameid(frameId); - dataVisualFrameContainerService.save(cloum); - } - } - - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualFrameContainer") DataVisualFrameContainer dataVisualFrameContainer) { - int res = this.dataVisualFrameContainerService.update(dataVisualFrameContainer); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doTdupdate.do") - public ModelAndView doTdupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualFrameContainer") DataVisualFrameContainer dataVisualFrameContainer) { - - this.dataVisualFrameContainerService.update(dataVisualFrameContainer); - - String frameId=request.getParameter("frameId"); - double oldwidth=Double.valueOf(request.getParameter("oldwidth")); - double oldheight=Double.valueOf(request.getParameter("oldheight")); - - double width=Double.valueOf(dataVisualFrameContainer.getWidth()); - double height=Double.valueOf(dataVisualFrameContainer.getHeight()); - - if(width!=oldwidth){ - int nowInsertColumn=dataVisualFrameContainer.getInsertcolumn(); - int nowColumns=dataVisualFrameContainer.getColumns(); - - //判断是不是最后一列 - - //同列td - List laddlist = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='"+frameId+"' and insertColumn="+nowInsertColumn+" and columns="+nowColumns+" and type='"+DataVisualFrameContainer.Type_column+"' "); - for (DataVisualFrameContainer ld : laddlist) { - ld.setWidth(String.valueOf(width)); - this.dataVisualFrameContainerService.update(ld); - } - //下一列td - List lsubtractlist = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='"+frameId+"' and insertColumn="+(nowInsertColumn+nowColumns)+" and type='"+DataVisualFrameContainer.Type_column+"' "); - for (DataVisualFrameContainer ld : lsubtractlist) { - double lsubtractWidth=Double.valueOf(ld.getWidth()); - if(width>oldwidth){ - lsubtractWidth=lsubtractWidth-(width-oldwidth); - }else{ - lsubtractWidth=lsubtractWidth+(oldwidth-width); - } - ld.setWidth(String.valueOf(lsubtractWidth)); - this.dataVisualFrameContainerService.update(ld); - } - - } - if(height!=oldheight){ - int nowInsertRow=dataVisualFrameContainer.getInsertrow(); - int nowRows=dataVisualFrameContainer.getRows(); - - //判断是不是最后一行 - - //同行td - List laddlist = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='"+frameId+"' and insertRow="+nowInsertRow+" and rows="+nowRows+" and type='"+DataVisualFrameContainer.Type_column+"' "); - for (DataVisualFrameContainer ld : laddlist) { - ld.setHeight(String.valueOf(height)); - this.dataVisualFrameContainerService.update(ld); - } - //下一行td - List lsubtractlist = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='"+frameId+"' and insertRow="+(nowInsertRow+nowRows)+" and type='"+DataVisualFrameContainer.Type_column+"' "); - for (DataVisualFrameContainer ld : lsubtractlist) { - double lsubtractHeight=Double.valueOf(ld.getHeight()); - if(height>oldheight){ - lsubtractHeight=lsubtractHeight-(height-oldheight); - }else{ - lsubtractHeight=lsubtractHeight+(oldheight-height); - } - ld.setHeight(String.valueOf(lsubtractHeight)); - this.dataVisualFrameContainerService.update(ld); - } - - } - - -// int res = this.dataVisualFrameContainerService.update(dataVisualFrameContainer); -// if (res == 1) { -// Result result = Result.success(res); -// model.addAttribute("result", CommUtil.toJson(result)); -// } else { -// Result result = Result.failed("保存失败"); -// model.addAttribute("result", CommUtil.toJson(result)); -// } - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualFrameContainerService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualFrameContainerService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doContainerMerge.do") - public ModelAndView doContainerMerge(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - String firstRow = request.getParameter("firstRow"); - String firstColumn = request.getParameter("firstColumn"); - String lastRow = request.getParameter("lastRow"); - String lastColumn = request.getParameter("lastColumn"); - - String delIds=""; -// String delPids=""; - int mergeRow = Integer.valueOf(lastRow)-Integer.valueOf(firstRow); - int mergeColumn = Integer.valueOf(lastColumn)-Integer.valueOf(firstColumn); - - List rlist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='"+frameId+"' and insertRow>="+firstRow+" and insertRow<="+lastRow+" and type='"+DataVisualFrameContainer.Type_row+"' order by insertRow "); - if(rlist!=null&&rlist.size()>0){ - DataVisualFrameContainer g = new DataVisualFrameContainer(); - double addWidth=0; - double addHeight=0; - for (int i = 0; i < rlist.size(); i++) { - DataVisualFrameContainer r = rlist.get(i); - List clist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='"+r.getId()+"' and insertColumn>="+firstColumn+" and insertColumn<="+lastColumn+" and type='"+DataVisualFrameContainer.Type_column+"' order by insertColumn "); - if(clist!=null&&clist.size()>0){ - for (int j = 0; j < clist.size(); j++) { - if(i==0&&j==0){ - g = clist.get(j); - g.setRows(mergeRow+1); - g.setColumns(mergeColumn+1); - addWidth+=Double.valueOf(g.getWidth()); - addHeight+=Double.valueOf(g.getHeight()); - }else{ - if(i==0){ - addWidth+=Double.valueOf(clist.get(j).getWidth()); - } - if(j==0){ - addHeight+=Double.valueOf(clist.get(j).getHeight()); - } - - delIds+=clist.get(j).getId()+","; -// delPids+=clist.get(j).getPid()+","; - } - } - - - } - } - - g.setWidth(String.valueOf(addWidth)); - g.setHeight(String.valueOf(addHeight)); - this.dataVisualFrameContainerService.update(g); - addWidth=0; - addHeight=0; - } -// System.out.println(delIds); -// String[] delIdss = delIds.split(","); -// String[] delPidss = delPids.split(","); -// if(delPidss!=null&&delPidss.length>0){ -// for (int i = 0; i < delPidss.length; i++) { -// System.out.println(delPidss[i]); -// DataVisualFrameContainer d = this.dataVisualFrameContainerService.selectById(delIdss[i]); -// List changeList = this.dataVisualFrameContainerService.selectListByWhere(" where pid='"+delPidss[i]+"' and insertColumn>"+d.getInsertcolumn()+" order by insertColumn "); -// for (DataVisualFrameContainer dataVisualFrameContainer : changeList) { -// dataVisualFrameContainer.setInsertcolumn(dataVisualFrameContainer.getInsertcolumn()-1); -// this.dataVisualFrameContainerService.update(dataVisualFrameContainer); -// } -// } -// } -// System.out.println(delIds); - delIds = delIds.replace(",", "','"); - this.dataVisualFrameContainerService.deleteByWhere("where id in('" + delIds + "')"); - - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualFrameController.java b/src/com/sipai/controller/process/DataVisualFrameController.java deleted file mode 100644 index 579a6b9e..00000000 --- a/src/com/sipai/controller/process/DataVisualFrameController.java +++ /dev/null @@ -1,542 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.DataVisualFrameContainer; -import com.sipai.entity.process.LibraryProcessManageDetail; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.quartz.job.DataVisualTopic_Job; -import com.sipai.service.company.CompanyService; -import com.sipai.service.process.DataVisualCameraService; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualFrameContainerService; -import com.sipai.service.process.DataVisualFrameService; -import com.sipai.service.process.DataVisualMPointService; -import com.sipai.service.process.DataVisualTextService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.redisson.api.RMapCache; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualFrame") -public class DataVisualFrameController { - @Resource - private DataVisualFrameService dataVisualFrameService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private DataVisualMPointService dataVisualMPointService; - @Resource - private DataVisualTextService dataVisualTextService; - @Resource - private DataVisualCameraService dataVisualCameraService; - @Resource - private DataVisualFrameContainerService dataVisualFrameContainerService; - @Resource - private CompanyService companyService; - @Resource - private UnitService unitService; - @Resource - private RedissonClient redissonClient; - - @RequestMapping("/configureList.do") - public String showlist(HttpServletRequest request, Model model) { - String menuType = request.getParameter("menuType"); - model.addAttribute("result", menuType); - return "/process/dataVisualConfigureList"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request, Model model) { - List list = this.dataVisualFrameService.selectListByWhere(" order by name"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("text", list.get(i).getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - @RequestMapping("/frameConfigure.do") - public String frameConfigure(HttpServletRequest request, Model model) { - String menuType = request.getParameter("menuType"); - model.addAttribute("result", menuType); - return "/process/dataVisualFrameConfigure"; - } - - @RequestMapping("/viewList.do") - public String viewList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - try { - model.addAttribute("mqttStatus", new CommUtil().getProperties("mqtt.properties", "mqtt.status")); - model.addAttribute("mqttHostWeb", new CommUtil().getProperties("mqtt.properties", "mqtt.host_ws")); - } catch (IOException e) { - e.printStackTrace(); - } - model.addAttribute("userId", cu.getId()); - - return "/process/dataVisualViewList"; - } - - @RequestMapping("/largeScreenView.do") - public String largeScreenView(HttpServletRequest request, Model model) { -// User cu = (User) request.getSession().getAttribute("cu"); - - try { - model.addAttribute("mqttStatus", new CommUtil().getProperties("mqtt.properties", "mqtt.status")); - model.addAttribute("mqttHostWeb", new CommUtil().getProperties("mqtt.properties", "mqtt.host_ws")); - } catch (IOException e) { - e.printStackTrace(); - } -// model.addAttribute("userId", cu.getId()); - return "/process/dataVisualLargeScreenView"; - } - - @RequestMapping("/largeScreenForAppControl.do") - public String largeScreenForAppControl(HttpServletRequest request, Model model) { - return "/process/dataVisualLargeScreenForAppControl"; - } - - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model) { - if (request.getParameter("userId") != null && request.getParameter("userId").length() > 0) { - model.addAttribute("userId", request.getParameter("userId")); - } else { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("userId", cu.getId()); - } - - try { - model.addAttribute("mqttStatus", new CommUtil().getProperties("mqtt.properties", "mqtt.status")); - model.addAttribute("mqttHostWeb", new CommUtil().getProperties("mqtt.properties", "mqtt.host_ws")); - } catch (IOException e) { - e.printStackTrace(); - } - - return "/process/dataVisualView"; - } - - @RequestMapping("/getFrameTreeForConfigure.do") - public ModelAndView getFrameTreeForConfigure(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String menuType = request.getParameter("menuType"); - List list = this.dataVisualFrameService.selectListByWhere("where 1=1 and unitId='" + unitId + "' and menuType='" + menuType + "' " - + " order by morder"); - - String tree = this.dataVisualFrameService.getTreeList(null, list); - model.addAttribute("result", tree); - return new ModelAndView("result"); - } - - @RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String menuType = request.getParameter("menuType"); - List list = this.dataVisualFrameService.selectListByWhere("where 1=1 and unitId='" + unitId + "' and menuType='" + menuType + "' and id!='" + request.getParameter("ownId") + "' " - + " order by morder"); - - String tree = this.dataVisualFrameService.getTreeList(null, list); - model.addAttribute("result", tree); - return "result"; - } - - @RequestMapping("/getFrameTree.do") - public ModelAndView getFrameTree(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String menuType = request.getParameter("menuType"); - - Company company = this.companyService.selectByPrimaryKey(unitId); - if (company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitId + "," + unitIds; - String[] unitIdss = unitIds.split(","); - - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < unitIdss.length; i++) { - JSONObject jsonObject = new JSONObject(); - Company companyD = this.companyService.selectByPrimaryKey(unitIdss[i]); - - String whereString = " where 1=1 and unitId='" + companyD.getId() + "' and active='" + DataVisualFrame.Active_1 + "' " + - " and (rolePeople is null or rolePeople='' or rolePeople like '%" + cu.getId() + "%')"; - - if (menuType != null && menuType.length() > 0) { - whereString += " and menuType='" + menuType + "'"; - } - - List list = this.dataVisualFrameService.selectListByWhere(whereString - + " order by morder"); - if (list != null && list.size() > 0) { - String tree = this.dataVisualFrameService.getTreeList(null, list); - jsonObject.put("id", companyD.getId()); - jsonObject.put("text", companyD.getName()); - jsonObject.put("type", DataVisualFrame.Type_structure); - jsonObject.put("icon", "fa fa-th-large"); - jsonObject.put("nodes", tree); -// System.out.println(jsonObject); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray); - } else { - String whereString = " where 1=1 and unitId='" + unitId + "' and active='" + DataVisualFrame.Active_1 + "' "; - if (menuType != null && menuType.length() > 0) { - whereString += " and menuType='" + menuType + "'"; - } - List list = this.dataVisualFrameService.selectListByWhere(whereString - + " order by morder"); - String tree = this.dataVisualFrameService.getTreeList(null, list); - model.addAttribute("result", tree); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/getConfigureList.do") - public ModelAndView getRootList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - String unitId = request.getParameter("unitId"); - String menuType = request.getParameter("menuType"); - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 and pid='" + pid + "' and unitId='" + unitId + "' and menuType='" + menuType + "' and active='" + DataVisualFrame.Active_1 + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualFrameService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getFrame.do") - public ModelAndView getFrame(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(id); - - model.addAttribute("result", JSONObject.fromObject(dataVisualFrame)); - return new ModelAndView("result"); - } - - @RequestMapping("/frameAdd.do") - public String frameAdd(HttpServletRequest request, Model model) { - return "/process/dataVisualFrameAdd"; - } - - @RequestMapping("/frameEdit.do") - public String frameEdit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(id); - if (!dataVisualFrame.getPid().equals("-1")) { - DataVisualFrame pdataVisualFrame = this.dataVisualFrameService.selectById(dataVisualFrame.getPid()); - dataVisualFrame.setPname(pdataVisualFrame.getName()); - } else { - dataVisualFrame.setPname("-1"); - } - model.addAttribute("dataVisualFrame", dataVisualFrame); - return "/process/dataVisualFrameEdit"; - } - - @RequestMapping("/doFrameSave.do") - public ModelAndView doFrameSave(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualFrame") DataVisualFrame dataVisualFrame) { - - List flist = this.dataVisualFrameService.selectListByWhere(" where pid='" + dataVisualFrame.getPid() + "'"); - int totalnum = flist.size() + 1; - int nowMorder = dataVisualFrame.getMorder(); - if (nowMorder < 1) { - Result result = Result.failed("排序字段必须大于0!"); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - if (nowMorder > totalnum) { - Result result = Result.failed("排序不能大于当前节点总数!目前为:" + totalnum + ""); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - //调整排序 - this.dataVisualFrameService.morderUpBywhere(" where pid='" + dataVisualFrame.getPid() + "' and morder>=" + nowMorder + " "); - - User cu = (User) request.getSession().getAttribute("cu"); - dataVisualFrame.setId(CommUtil.getUUID()); - dataVisualFrame.setInsdt(CommUtil.nowDate()); - dataVisualFrame.setInsuser(cu.getId()); - int res = this.dataVisualFrameService.save(dataVisualFrame); - if (res == 1) { - if (dataVisualFrame.getType().equals(DataVisualFrame.Type_frame)) { - //新增容器 - DataVisualFrameContainer row = new DataVisualFrameContainer(); - String rowId = CommUtil.getUUID(); - row.setId(rowId); - row.setPid(dataVisualFrame.getId()); - row.setInsertrow(1); - row.setType(DataVisualFrameContainer.Type_row); - row.setFrameid(dataVisualFrame.getId()); - this.dataVisualFrameContainerService.save(row); - - DataVisualFrameContainer cloum = new DataVisualFrameContainer(); - cloum.setId(CommUtil.getUUID()); - cloum.setPid(rowId); - cloum.setInsertrow(1); - cloum.setInsertcolumn(1); - cloum.setRows(1); - cloum.setColumns(1); - cloum.setWidth(String.valueOf(CommUtil.round(100 / 1, 2))); - cloum.setHeight(String.valueOf(CommUtil.round(100 / 1, 2))); - cloum.setType(DataVisualFrameContainer.Type_column); - cloum.setFrameid(dataVisualFrame.getId()); - this.dataVisualFrameContainerService.save(cloum); - } - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doFrameUpdate.do") - public ModelAndView doFrameUpdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualFrame") DataVisualFrame dataVisualFrame) { - int oldmorder = Integer.valueOf(request.getParameter("oldmorder")); - int nowMorder = dataVisualFrame.getMorder(); - if (oldmorder != nowMorder) { - List flist = this.dataVisualFrameService.selectListByWhere(" where pid='" + dataVisualFrame.getPid() + "'"); - int totalnum = flist.size(); - - if (nowMorder < 1) { - Result result = Result.failed("排序字段必须大于0!"); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - if (nowMorder > totalnum) { - Result result = Result.failed("排序不能大于当前节点总数!目前为:" + totalnum + ""); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - //调整排序 - if (nowMorder > oldmorder) { - this.dataVisualFrameService.morderDownBywhere(" where pid='" + dataVisualFrame.getPid() + "' and morder>" + oldmorder + " and morder<=" + nowMorder + " "); - } else if (nowMorder < oldmorder) { - this.dataVisualFrameService.morderUpBywhere(" where pid='" + dataVisualFrame.getPid() + "' and morder<" + oldmorder + " and morder>=" + nowMorder + " "); - } - - } - - String oldpid = request.getParameter("oldpid"); - if (!oldpid.equals(dataVisualFrame.getPid())) {//发生所属菜单变化 - //原菜单顺序下记录-1 - this.dataVisualFrameService.morderDownBywhere(" where pid='" + oldpid + "' and morder>" + oldmorder + " "); - //记录在新菜单内顺序强制为1,其余记录+1 - dataVisualFrame.setMorder(1); - this.dataVisualFrameService.morderUpBywhere(" where pid='" + dataVisualFrame.getPid() + "' "); - } - - int res = this.dataVisualFrameService.update(dataVisualFrame); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doFrameDelete.do") - public String doFrameDelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List flist = this.dataVisualFrameService.selectListByWhere(" where pid='" + id + "'"); - if (flist.size() > 0) { - Result result = Result.failed("请先删除子节点!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - //调整排序 - DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(id); - this.dataVisualFrameService.morderDownBywhere(" where pid='" + dataVisualFrame.getPid() + "' and morder>" + dataVisualFrame.getMorder() + " "); - - int res = this.dataVisualFrameService.deleteById(id); - if (res == 1) { - //删除画面内容 -// List clist = this.dataVisualContentService.selectListByWhere(" where pid='" + id + "'"); -// for (DataVisualContent dataVisualContent : clist) { -// if (dataVisualContent.getType().equals(DataVisualContent.Type_DataPoint) || dataVisualContent.getType().equals(DataVisualContent.Type_SignalPoint)) { -// this.dataVisualMPointService.deleteByWhere(" where pid='" + dataVisualContent.getId() + "' "); -// } else if (dataVisualContent.getType().equals(DataVisualContent.Type_Text)) { -// this.dataVisualTextService.deleteByWhere(" where pid='" + dataVisualContent.getId() + "' "); -// } else if (dataVisualContent.getType().equals(DataVisualContent.Type_Camera)) { -// this.dataVisualCameraService.deleteByWhere(" where pid='" + dataVisualContent.getId() + "' "); -// } -// } -// -// this.dataVisualContentService.deleteByWhere(" where pid='" + id + "'"); - - if (dataVisualFrame.getType().equals(DataVisualFrame.Type_frame)) { - this.dataVisualFrameService.deleteAllContentFromFrameId(id);//删除元素 - //删除容器 - List rlist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='" + dataVisualFrame.getId() + "' "); - for (DataVisualFrameContainer r : rlist) { - this.dataVisualFrameContainerService.deleteByWhere(" where pid='" + r.getId() + "' "); - } - this.dataVisualFrameContainerService.deleteByWhere(" where pid='" + dataVisualFrame.getId() + "' "); - } - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doFrameMorderChange.do") - public String doFrameMorderUp(HttpServletRequest request, Model model) { - DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(request.getParameter("id")); - - List flist = this.dataVisualFrameService.selectListByWhere(" where pid='" + dataVisualFrame.getPid() + "'"); - int totalnum = flist.size(); - - int oldmorder = dataVisualFrame.getMorder(); - String type = request.getParameter("type"); - if (type.equals("down")) { - dataVisualFrame.setMorder(dataVisualFrame.getMorder() - 1); - } else if (type.equals("up")) { - dataVisualFrame.setMorder(dataVisualFrame.getMorder() + 1); - } - - int nowMorder = dataVisualFrame.getMorder(); - if (nowMorder <= 0 || nowMorder > totalnum) { - model.addAttribute("result", "无法继续移动!"); - return "result"; - } - //调整排序 - if (nowMorder > oldmorder) { - this.dataVisualFrameService.morderDownBywhere(" where pid='" + dataVisualFrame.getPid() + "' and morder>" + oldmorder + " and morder<=" + nowMorder + " "); - } else if (nowMorder < oldmorder) { - this.dataVisualFrameService.morderUpBywhere(" where pid='" + dataVisualFrame.getPid() + "' and morder<" + oldmorder + " and morder>=" + nowMorder + " "); - } - - this.dataVisualFrameService.update(dataVisualFrame); - model.addAttribute("result", "suc"); - return "result"; - } - - @RequestMapping("/showMenu4Select.do") - public String showMenu4Select(HttpServletRequest request, Model model) { - return "/process/dataVisualFrameMenu4select"; - } - - @RequestMapping("/showMenu4SelectForCopy.do") - public String showMenu4SelectForCopy(HttpServletRequest request, Model model) { - return "/process/dataVisualFrameMenu4selectForCopy"; - } - - @RequestMapping("/copyFrame.do") - public String copyFrame(HttpServletRequest request, Model model) { - String ckid = request.getParameter("ckid");//拷贝的画面 - String id = request.getParameter("id");//需要被拷贝的画面 - - this.dataVisualFrameService.copyFrame(ckid, id); - - model.addAttribute("result", "suc"); - return "result"; - } - - @RequestMapping("/fixedFrame.do") - public String fixedFrame(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String st = request.getParameter("st"); -// DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(id); - - String frameContainerId = ""; - List rlist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='" + id + "' "); - if (rlist != null && rlist.size() > 0) { - for (DataVisualFrameContainer r : rlist) { - List clist = this.dataVisualFrameContainerService.selectListByWhere(" where pid='" + r.getId() + "' "); - for (DataVisualFrameContainer c : clist) { - frameContainerId += c.getId() + ","; - } - } - } - - frameContainerId = frameContainerId.replace(",", "','"); - - int res = this.dataVisualContentService.updateFixedByWhere("where pid in('" + frameContainerId + "')", st); - - model.addAttribute("result", res); - return "result"; - } - - - @RequestMapping("/getFrameContentToMqtt.do") - public String getFrameContentToMqtt(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String menuType = request.getParameter("menuType"); - - RMapCache map_redis = redissonClient.getMapCache(CommString.REDIS_KEY_TYPE_VisualTipic); - String res = this.dataVisualFrameService.getFrameContentToMqtt(menuType,id); - com.alibaba.fastjson.JSONArray jsonArray = com.alibaba.fastjson.JSONArray.parseArray(res); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - com.alibaba.fastjson.JSONObject jsonObject = (com.alibaba.fastjson.JSONObject) jsonArray.get(i); - com.alibaba.fastjson.JSONArray jsonArray_data = (com.alibaba.fastjson.JSONArray) jsonObject.get("data"); - map_redis.put(jsonObject.get("frameId").toString(), jsonArray_data); - } - } - -// String json = this.dataVisualFrameService.getFrameContentToMqtt("largeScreen"); -// System.out.println(json); - model.addAttribute("result", "1"); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualGaugeChartController.java b/src/com/sipai/controller/process/DataVisualGaugeChartController.java deleted file mode 100644 index c58e159b..00000000 --- a/src/com/sipai/controller/process/DataVisualGaugeChartController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualGaugeChart; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualGaugeChartService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualGaugeChart") -public class DataVisualGaugeChartController { - @Resource - private DataVisualGaugeChartService dataVisualGaugeChartService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualGaugeChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if (list != null && list.size() > 0) { - DataVisualGaugeChart dataVisualGaugeChart = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualGaugeChart)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if (dContent != null) { - List list = this.dataVisualGaugeChartService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualGaugeChart", list.get(0)); - } - } - - return "/process/dataVisualGaugeChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("260"); - dataVisualContent.setHeight("220"); - dataVisualContent.setStyle("border-radius: 6px;"); - dataVisualContent.setType(DataVisualContent.Type_GaugeChart); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualGaugeChart dataVisualGaugeChart = new DataVisualGaugeChart(); - dataVisualGaugeChart.setId(CommUtil.getUUID()); - dataVisualGaugeChart.setPid(cntentId); - dataVisualGaugeChart.setBackground("transparent"); - dataVisualGaugeChart.setRadius("100%"); - dataVisualGaugeChart.setStartangle("225"); - dataVisualGaugeChart.setEndangle("-45"); - dataVisualGaugeChart.setMax("100"); - dataVisualGaugeChart.setMin("0"); - dataVisualGaugeChart.setRadius("100%"); - dataVisualGaugeChart.setDatast("true"); - dataVisualGaugeChart.setDataXPosition("0"); - dataVisualGaugeChart.setDataYPosition("40%"); - dataVisualGaugeChart.setTitleXPosition("0"); - dataVisualGaugeChart.setTitleYPosition("20%"); - dataVisualGaugeChart.setPointerst("true"); - dataVisualGaugeChart.setPointerColor("#2ec7c9"); - dataVisualGaugeChart.setPointerLength("60%"); - dataVisualGaugeChart.setPointerWidth("6"); - dataVisualGaugeChart.setSplitlinest("true"); - dataVisualGaugeChart.setSplitlineDistance("10"); - dataVisualGaugeChart.setSplitlineLength("10"); - dataVisualGaugeChart.setSplitlineWidth("3"); - dataVisualGaugeChart.setSplitlineColor("#63677A"); - dataVisualGaugeChart.setAxislinest("true"); - dataVisualGaugeChart.setAxislineWidth("10"); - dataVisualGaugeChart.setAxislineColor("#2ec7c9,#E6EBF8"); - dataVisualGaugeChart.setAxistickst("true"); - dataVisualGaugeChart.setAxistickColor("#63677a"); - dataVisualGaugeChart.setAxistickDistance("10"); - dataVisualGaugeChart.setAxistickLength("6"); - dataVisualGaugeChart.setAxistickWidth("10"); - dataVisualGaugeChart.setAxistickSplitnumber("5"); - dataVisualGaugeChart.setAxislabelst("true"); - dataVisualGaugeChart.setAxislabelColor("#000000"); - dataVisualGaugeChart.setAxislabelDistance("15"); - dataVisualGaugeChart.setValuemethod("nowTime"); - - this.dataVisualGaugeChartService.save(dataVisualGaugeChart); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualGaugeChart") DataVisualGaugeChart dataVisualGaugeChart) { - int res = this.dataVisualGaugeChartService.update(dataVisualGaugeChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualGaugeChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualGaugeChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualLineChartController.java b/src/com/sipai/controller/process/DataVisualLineChartController.java deleted file mode 100644 index 9912d76c..00000000 --- a/src/com/sipai/controller/process/DataVisualLineChartController.java +++ /dev/null @@ -1,237 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualLineChart; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualLineChartSeries; -import com.sipai.entity.process.DataVisualLineChartYAxis; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualLineChartSeriesService; -import com.sipai.service.process.DataVisualLineChartService; -import com.sipai.service.process.DataVisualLineChartYAxisService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualLineChart") -public class DataVisualLineChartController { - @Resource - private DataVisualLineChartService dataVisualLineChartService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private DataVisualLineChartSeriesService dataVisualLineChartSeriesService; - @Resource - private DataVisualLineChartYAxisService dataVisualLineChartYAxisService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualLineChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/getChartJson.do") - public ModelAndView getChartJson(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - JSONArray json = new JSONArray(); - - List dataVisualLineChartlist = this.dataVisualLineChartService.selectListByWhere("where 1=1 and pid='" + contentId + "' "); - String lineChartId = ""; - if (dataVisualLineChartlist != null && dataVisualLineChartlist.size() > 0) { - DataVisualLineChart dataVisualLineChart = dataVisualLineChartlist.get(0); - lineChartId = dataVisualLineChart.getId(); - json.add(dataVisualLineChart); - } - - List dataVisualLineChartSerieslist = this.dataVisualLineChartSeriesService.selectListByWhere("where 1=1 and pid='" + lineChartId + "' order by morder "); - if (dataVisualLineChartSerieslist != null && dataVisualLineChartSerieslist.size() > 0) { - json.add(dataVisualLineChartSerieslist); - } - - List dataVisualLineChartYAxislist = this.dataVisualLineChartYAxisService.selectListByWhere("where 1=1 and pid='" + lineChartId + "' order by morder "); - if (dataVisualLineChartYAxislist != null && dataVisualLineChartYAxislist.size() > 0) { - json.add(dataVisualLineChartYAxislist); - } - - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List dataVisualLinelist = this.dataVisualLineChartService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (dataVisualLinelist != null && dataVisualLinelist.size() > 0) { - model.addAttribute("dataVisualLineChart", dataVisualLinelist.get(0)); - - List dataVisualLineChartSerieslist = this.dataVisualLineChartSeriesService.selectListByWhere("where pid='" + dataVisualLinelist.get(0).getId() + "' "); - if (dataVisualLineChartSerieslist != null && dataVisualLineChartSerieslist.size() > 0) { - model.addAttribute("dataVisualLineChartSeries", dataVisualLineChartSerieslist.get(0)); - } - - List dataVisualLineChartYAxislist = this.dataVisualLineChartYAxisService.selectListByWhere("where pid='" + dataVisualLinelist.get(0).getId() + "' "); - if (dataVisualLineChartYAxislist != null && dataVisualLineChartYAxislist.size() > 0) { - model.addAttribute("dataVisualLineChartYAxis", dataVisualLineChartYAxislist.get(0)); - } - } - - - return "/process/dataVisualLineChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualLineChart dataVisualLineChart = new DataVisualLineChart(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("350"); - dataVisualContent.setHeight("220"); - dataVisualContent.setType(DataVisualContent.Type_LineChart); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - String lineChartId = CommUtil.getUUID(); - dataVisualLineChart.setId(lineChartId); - dataVisualLineChart.setPid(cntentId); - dataVisualLineChart.setColors("#2ec7c9,#b6a2de,#5ab1ef,#ffb980,#d87a80,#8d98b3,#e5cf0d,#97b552"); - dataVisualLineChart.setBackground("transparent"); - dataVisualLineChart.setTitleColor("#000000"); - dataVisualLineChart.setTitleFontSize("16px"); - dataVisualLineChart.setTitleFontWeight("400"); - dataVisualLineChart.setTitlePosition("left"); - dataVisualLineChart.setLegendPosition("right"); - dataVisualLineChart.setXaxistype("category"); - dataVisualLineChart.setXaxislineshow("true"); - dataVisualLineChart.setXaxisaxistickshow("true"); - dataVisualLineChart.setXaxissplitlineshow("true"); - dataVisualLineChart.setDatazoomst("false"); - dataVisualLineChart.setXaxisaxislabelshow("true"); - this.dataVisualLineChartService.save(dataVisualLineChart); - - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualLineChart") DataVisualLineChart dataVisualLineChart) { - int res = this.dataVisualLineChartService.update(dataVisualLineChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualLineChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualLineChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doCopy.do") - public ModelAndView doTextCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - DataVisualLineChart dataVisualLineChart = this.dataVisualLineChartService.selectById(id); - - String newContentId = CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - String mainId = CommUtil.getUUID(); - dataVisualLineChart.setId(mainId); - dataVisualLineChart.setPid(newContentId); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualLineChartService.save(dataVisualLineChart); - - List dataVisualLineChartSerieslist = this.dataVisualLineChartSeriesService.selectListByWhere("where pid='" + id + "' "); - if (dataVisualLineChartSerieslist != null && dataVisualLineChartSerieslist.size() > 0) { - for (DataVisualLineChartSeries dataVisualLineChartSeries : - dataVisualLineChartSerieslist) { - dataVisualLineChartSeries.setId(CommUtil.getUUID()); - dataVisualLineChartSeries.setPid(mainId); - this.dataVisualLineChartSeriesService.save(dataVisualLineChartSeries); - } - } - - List dataVisualLineChartYAxislist = this.dataVisualLineChartYAxisService.selectListByWhere("where pid='" + id + "' "); - if (dataVisualLineChartYAxislist != null && dataVisualLineChartYAxislist.size() > 0) { - for (DataVisualLineChartYAxis dataVisualLineChartYAxis : - dataVisualLineChartYAxislist) { - dataVisualLineChartYAxis.setId(CommUtil.getUUID()); - dataVisualLineChartYAxis.setPid(mainId); - this.dataVisualLineChartYAxisService.save(dataVisualLineChartYAxis); - } - } - - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualLineChartSeriesController.java b/src/com/sipai/controller/process/DataVisualLineChartSeriesController.java deleted file mode 100644 index f29b7078..00000000 --- a/src/com/sipai/controller/process/DataVisualLineChartSeriesController.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualLineChartSeries; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualLineChartSeriesService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualLineChartSeries") -public class DataVisualLineChartSeriesController { - @Resource - private DataVisualLineChartSeriesService dataVisualLineChartSeriesService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualLineChartSeriesService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualLineChartSeriesService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualLineChartSeries dataVisualLineChartSeries = this.dataVisualLineChartSeriesService.selectById(id); - model.addAttribute("dataVisualLineChartSeries", dataVisualLineChartSeries); - return "/process/dataVisualLineChartSeriesEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualLineChartSeries dataVisualLineChartSeries = new DataVisualLineChartSeries(); - - dataVisualLineChartSeries.setId(CommUtil.getUUID()); - dataVisualLineChartSeries.setPid(pid); - dataVisualLineChartSeries.setName("数据1"); - dataVisualLineChartSeries.setMorder(0); - dataVisualLineChartSeries.setYaxisindex(0); - dataVisualLineChartSeries.setAvgshow("false"); - dataVisualLineChartSeries.setMaxshow("false"); - dataVisualLineChartSeries.setMinshow("false"); - dataVisualLineChartSeries.setSymbolst("false"); - dataVisualLineChartSeries.setAreastyle("false"); - dataVisualLineChartSeries.setIshistorydata("true"); - dataVisualLineChartSeries.setSelectst("true"); - dataVisualLineChartSeries.setTimerange(DataVisualLineChartSeries.TimeRange_day); - - int res = this.dataVisualLineChartSeriesService.save(dataVisualLineChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualLineChartSeries") DataVisualLineChartSeries dataVisualLineChartSeries) { - int res = this.dataVisualLineChartSeriesService.update(dataVisualLineChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.dataVisualLineChartSeriesService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualLineChartSeriesService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualLineChartSeries dataVisualLineChartSeries = new DataVisualLineChartSeries(); - jsonOne = json.getJSONObject(i); - dataVisualLineChartSeries.setId((String) jsonOne.get("id")); - dataVisualLineChartSeries.setMorder(i); - result = this.dataVisualLineChartSeriesService.update(dataVisualLineChartSeries); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualLineChartYAxisController.java b/src/com/sipai/controller/process/DataVisualLineChartYAxisController.java deleted file mode 100644 index 4fb73df0..00000000 --- a/src/com/sipai/controller/process/DataVisualLineChartYAxisController.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualLineChartYAxis; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualLineChartYAxisService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualLineChartYAxis") -public class DataVisualLineChartYAxisController { - @Resource - private DataVisualLineChartYAxisService dataVisualLineChartYAxisService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualLineChartYAxisService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualLineChartYAxisService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualLineChartYAxis dataVisualLineChartYAxis = this.dataVisualLineChartYAxisService.selectById(id); - model.addAttribute("dataVisualLineChartYAxis", dataVisualLineChartYAxis); - return "/process/dataVisualLineChartYAxisEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualLineChartYAxis dataVisualLineChartYAxis = new DataVisualLineChartYAxis(); - - dataVisualLineChartYAxis.setId(CommUtil.getUUID()); - dataVisualLineChartYAxis.setPid(pid); - dataVisualLineChartYAxis.setMorder(0); - dataVisualLineChartYAxis.setName("轴1"); - dataVisualLineChartYAxis.setLineshow("false"); - dataVisualLineChartYAxis.setAxistickshow("false"); - dataVisualLineChartYAxis.setScale("false"); - dataVisualLineChartYAxis.setSplitlineshow("false"); - dataVisualLineChartYAxis.setPosition("left"); - dataVisualLineChartYAxis.setAxislabelshow("true"); - - int res = this.dataVisualLineChartYAxisService.save(dataVisualLineChartYAxis); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualLineChartYAxis") DataVisualLineChartYAxis dataVisualLineChartYAxis) { - int res = this.dataVisualLineChartYAxisService.update(dataVisualLineChartYAxis); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualLineChartYAxisService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualLineChartYAxisService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualLineChartYAxis dataVisualLineChartYAxis = new DataVisualLineChartYAxis(); - jsonOne = json.getJSONObject(i); - dataVisualLineChartYAxis.setId((String) jsonOne.get("id")); - dataVisualLineChartYAxis.setMorder(i); - result = this.dataVisualLineChartYAxisService.update(dataVisualLineChartYAxis); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualMPointController.java b/src/com/sipai/controller/process/DataVisualMPointController.java deleted file mode 100644 index 187096d7..00000000 --- a/src/com/sipai/controller/process/DataVisualMPointController.java +++ /dev/null @@ -1,224 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualMPoint; -import com.sipai.entity.process.DataVisualMPointWarehouse; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualMPointService; -import com.sipai.service.process.DataVisualMPointWarehouseService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualMPoint") -public class DataVisualMPointController { - @Resource - private DataVisualMPointService dataVisualMPointService; - @Resource - private DataVisualMPointWarehouseService dataVisualMPointWarehouseService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualMPointService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - if (list != null && list.size() > 0) { - for (DataVisualMPoint dataVisualMPoint : - list) { - String mpid = dataVisualMPoint.getMpid(); - MPoint mPoint = this.mPointService.selectById(mpid); - if (mPoint != null) { - String eqid = mPoint.getEquipmentid(); - dataVisualMPoint.setEqid(eqid); - } - } - } - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - String datas = request.getParameter("datas"); - String unitId = request.getParameter("unitId"); - - String[] mpids = datas.split(","); - - if (mpids != null && mpids.length > 0) { - for (int i = 0; i < mpids.length; i++) { - String mpid = mpids[i]; - MPoint mPoint = this.mPointService.selectById(mpid); - - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualMPoint dataVisualMPoint = new DataVisualMPoint(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx("200"); - dataVisualContent.setPosty("5"); - dataVisualContent.setRefreshtime("5"); - dataVisualContent.setzIndex("90"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - - dataVisualMPoint.setId(CommUtil.getUUID()); - dataVisualMPoint.setPid(cntentId); - dataVisualMPoint.setMpid(mpid); - dataVisualMPoint.setName(mPoint.getParmname()); - dataVisualMPoint.setUnitid(mPoint.getUnit()); - - - if (mPoint.getSignaltype().equals("AI")) { - dataVisualContent.setType(DataVisualContent.Type_DataPoint); - //默认读取库中第一条记录 - List wlist = this.dataVisualMPointWarehouseService.selectListByWhere("where 1=1 and type='" + DataVisualContent.Type_DataPoint + "' " - + " order by morder "); - if (wlist != null && wlist.size() > 0) { - DataVisualMPointWarehouse dWarehouse = wlist.get(0); - dataVisualContent.setWidth(dWarehouse.getWidth()); - dataVisualContent.setHeight(dWarehouse.getHeight()); - dataVisualContent.setStyle(dWarehouse.getStyle()); - - dataVisualMPoint.setFontsize(dWarehouse.getFontsize()); - dataVisualMPoint.setFontcolor(dWarehouse.getFontcolor()); - dataVisualMPoint.setFontweight(dWarehouse.getFontweight()); - dataVisualMPoint.setBackground(dWarehouse.getBackground()); - } else { - dataVisualContent.setWidth("120"); - dataVisualContent.setHeight("60"); - dataVisualContent.setStyle("border: 1px solid #E8EBEC;border-radius: 6px;"); - - dataVisualMPoint.setFontsize(14); - dataVisualMPoint.setFontcolor("#FFFFFF"); - dataVisualMPoint.setFontweight(400); - dataVisualMPoint.setBackground("#000000"); - } - - } else if (mPoint.getSignaltype().equals("DI")) { - dataVisualContent.setType(DataVisualContent.Type_SignalPoint); - - //默认读取库中第一条记录 - List wlist = this.dataVisualMPointWarehouseService.selectListByWhere("where 1=1 and type='" + DataVisualContent.Type_SignalPoint + "' " - + " order by morder "); - if (wlist != null && wlist.size() > 0) { - DataVisualMPointWarehouse dWarehouse = wlist.get(0); - - dataVisualMPoint.setFontsize(dWarehouse.getFontsize()); - dataVisualMPoint.setFontcolor(dWarehouse.getFontcolor()); - } else { - dataVisualMPoint.setFontsize(16); - dataVisualMPoint.setFontcolor("#FFFFFF"); - } -// dataVisualContent.setWidth("100"); -// dataVisualContent.setHeight("16"); -// dataVisualMPoint.setFontsize(14); - - } - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualMPointService.save(dataVisualMPoint); - } - } - - -// int result = this.dataVisualMPointService.save(dataVisualMPoint); -// model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualMPoint") DataVisualMPoint dataVisualMPoint) { - int res = this.dataVisualMPointService.update(dataVisualMPoint); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualMPointService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualMPointService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doMpDICopy.do") - public ModelAndView doMpDICopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - DataVisualMPoint dataVisualMPoint = this.dataVisualMPointService.selectById(id); - - String newContentId = CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx(String.valueOf(Float.valueOf(dataVisualContent.getPostx().replaceAll("px",""))+50)); - dataVisualContent.setPosty(dataVisualContent.getPosty()); - - dataVisualMPoint.setId(CommUtil.getUUID()); - dataVisualMPoint.setPid(newContentId); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualMPointService.save(dataVisualMPoint); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualMpViewController.java b/src/com/sipai/controller/process/DataVisualMpViewController.java deleted file mode 100644 index 5dc150e4..00000000 --- a/src/com/sipai/controller/process/DataVisualMpViewController.java +++ /dev/null @@ -1,305 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.document.FileIn; -import com.sipai.entity.process.DataVisualMpView; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualMpViewService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.axis.encoding.Base64; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualMpView") -public class DataVisualMpViewController { - @Resource - private DataVisualMpViewService dataVisualMpViewService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualMpViewService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualMpViewService.selectListByWhere("where pid='" + pid + "' order by morder "); - model.addAttribute("result", JSONArray.fromObject(list)); - - return new ModelAndView("result"); - } - - @RequestMapping("/getContainer.do") - public ModelAndView getContainer(HttpServletRequest request, Model model) { - String tabId = request.getParameter("tabId"); - DataVisualMpView dataVisualMpView = this.dataVisualMpViewService.selectById(tabId); - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(dataVisualMpView.getPid()); - - model.addAttribute("result", JSONArray.fromObject(dataVisualContent)); - - return new ModelAndView("result"); - } - - @RequestMapping("/showContainer.do") - public String showContainer(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - model.addAttribute("dataVisualContent", dataVisualContent); - - return "/process/dataVisualMpViewContainer"; - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - DataVisualMpView dataVisualMpView = this.dataVisualMpViewService.selectById(id); - model.addAttribute("dataVisualMpView", dataVisualMpView); - - return "/process/dataVisualMpViewContainerEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("80"); - dataVisualContent.setHeight("80"); - dataVisualContent.setType(DataVisualContent.Type_MpView); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualMpView dataVisualMpView = new DataVisualMpView(); - dataVisualMpView.setId(CommUtil.getUUID()); - dataVisualMpView.setPid(cntentId); - dataVisualMpView.setMorder(0); - dataVisualMpView.setValuemethod("nowTime"); - dataVisualMpView.setOutValueType("0"); - this.dataVisualMpViewService.save(dataVisualMpView); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doMpViewCopy.do") - public ModelAndView doMpViewCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - List list = this.dataVisualMpViewService.selectListByWhere(" where pid='" + contentId + "' "); - - String newContentId = CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - if(dataVisualContent.getPostx().indexOf("%")>0){ - dataVisualContent.setPostx(String.valueOf(Float.valueOf(dataVisualContent.getPostx().replaceAll("%", "")) + 1)+"%"); - }else{ - dataVisualContent.setPostx(String.valueOf(Float.valueOf(dataVisualContent.getPostx().replaceAll("px", "")) + 50)); - } - - dataVisualContent.setPosty(dataVisualContent.getPosty()); - - if (list != null && list.size() > 0) { - for (DataVisualMpView dataVisualMpView : list) { - String oldId = dataVisualMpView.getId(); - - dataVisualMpView.setId(CommUtil.getUUID()); - dataVisualMpView.setPid(newContentId); - this.dataVisualMpViewService.save(dataVisualMpView); - - //复制图片 - List commonFilelist = this.commonFileService.selectListByTableAWhere3("tb_pro_dataVisual_mpView_file"," where masterid='"+oldId+"' "); - if (commonFilelist != null && commonFilelist.size() > 0) { - for (int i = 0; i < commonFilelist.size(); i++) { - CommonFile commonFile = commonFilelist.get(i); - String bucketName = "datavisual"; - String path = commonFile.getAbspath(); - //解析成流文件 后面都用这个 - byte[] buffer = this.commonFileService.getInputStreamBytes(bucketName, path); - - InputStream is = new ByteArrayInputStream(buffer); - - FileIn item = new FileIn(); - try { - item.setInputStream(is); - } catch (IOException e) { - e.printStackTrace(); - } - item.setContentType(commonFile.getType()); - item.setOriginalFilename(commonFile.getFilename()); - - commonFileService.updateFileForFileIn(dataVisualMpView.getId(), bucketName, "tb_pro_dataVisual_mpView_file", item); - } - - } - - } - } - - this.dataVisualContentService.save(dataVisualContent); - - // String bucketName = "datavisual"; -// String path = "2023-12-13-17-23-311701741686478.jpg"; -// //解析成流文件 后面都用这个 -// byte[] buffer = this.commonFileService.getInputStreamBytes(bucketName, path); -// -// InputStream is = new ByteArrayInputStream(buffer); -// -// FileIn item = new FileIn(); -// try { -// item.setInputStream(is); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// item.setContentType("image/jpeg"); -// item.setOriginalFilename("1701741686478.jpg"); -// -// commonFileService.updateFileForFileIn("2d6835b4847941acb2ea47e12dba74cb", bucketName, "tb_pro_dataVisual_mpView_file", item); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doDetailSave.do") - public ModelAndView doDetailSave(HttpServletRequest request, Model model) { - String cntentId = request.getParameter("cntentId"); - - DataVisualMpView dataVisualMpView = new DataVisualMpView(); - dataVisualMpView.setId(CommUtil.getUUID()); - dataVisualMpView.setPid(cntentId); - dataVisualMpView.setMorder(0); - dataVisualMpView.setValuemethod("nowTime"); - dataVisualMpView.setOutValueType("0"); - int res = this.dataVisualMpViewService.save(dataVisualMpView); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualMpView") DataVisualMpView dataVisualMpView) { - int res = this.dataVisualMpViewService.update(dataVisualMpView); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualMpViewService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualMpViewService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualMpView dataVisualMpView = new DataVisualMpView(); - jsonOne = json.getJSONObject(i); - dataVisualMpView.setId((String) jsonOne.get("id")); - dataVisualMpView.setMorder(i); - result = this.dataVisualMpViewService.update(dataVisualMpView); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualPercentChartController.java b/src/com/sipai/controller/process/DataVisualPercentChartController.java deleted file mode 100644 index 96878077..00000000 --- a/src/com/sipai/controller/process/DataVisualPercentChartController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualPercentChart; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualPercentChartService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualPercentChart") -public class DataVisualPercentChartController { - @Resource - private DataVisualPercentChartService dataVisualPercentChartService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualPercentChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if(list!=null&&list.size()>0){ - DataVisualPercentChart dataVisualPercentChart = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualPercentChart)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if(dContent!=null){ - List list = this.dataVisualPercentChartService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if(list!=null&&list.size()>0){ - model.addAttribute("dataVisualPercentChart", list.get(0)); - } - } - - return "/process/dataVisualPercentChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("260"); - dataVisualContent.setHeight("220"); - dataVisualContent.setType(DataVisualContent.Type_PercentChart); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualPercentChart dataVisualPercentChart = new DataVisualPercentChart(); - dataVisualPercentChart.setId(CommUtil.getUUID()); - dataVisualPercentChart.setPid(cntentId); - dataVisualPercentChart.setBackground("transparent"); - dataVisualPercentChart.setClockwise("true"); - dataVisualPercentChart.setRadius("100%"); - dataVisualPercentChart.setTitleLeftPosition("45%"); - dataVisualPercentChart.setTitleTopPosition("50%"); - dataVisualPercentChart.setScoreringwidth("12"); - dataVisualPercentChart.setScoreringcolor("#2ec7c9"); - dataVisualPercentChart.setBgringwidth("18"); - dataVisualPercentChart.setBgringcolor("#eeeeee"); - dataVisualPercentChart.setBgringposition("22"); - dataVisualPercentChart.setAngleaxismax("100"); - dataVisualPercentChart.setStartangle("90"); - dataVisualPercentChart.setValuemethod("nowTime"); - - this.dataVisualPercentChartService.save(dataVisualPercentChart); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualPercentChart") DataVisualPercentChart dataVisualPercentChart) { - int res = this.dataVisualPercentChartService.update(dataVisualPercentChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualPercentChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualPercentChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doCopy.do") - public ModelAndView doTextCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - DataVisualPercentChart dataVisualPercentChart = this.dataVisualPercentChartService.selectById(id); - - String newContentId = CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - String mainId = CommUtil.getUUID(); - dataVisualPercentChart.setId(mainId); - dataVisualPercentChart.setPid(newContentId); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualPercentChartService.save(dataVisualPercentChart); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualPersonnelPositioningController.java b/src/com/sipai/controller/process/DataVisualPersonnelPositioningController.java deleted file mode 100644 index 5e2ddc38..00000000 --- a/src/com/sipai/controller/process/DataVisualPersonnelPositioningController.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualPersonnelPositioning; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualText; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualPersonnelPositioningService; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualPersonnelPositioning") -public class DataVisualPersonnelPositioningController { - @Resource - private DataVisualPersonnelPositioningService dataVisualPersonnelPositioningService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualPersonnelPositioningService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("id")); - model.addAttribute("dataVisualContent", dContent); - - List list = this.dataVisualPersonnelPositioningService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualPersonnelPositioning", list.get(0)); - } - - return "/process/dataVisualPersonnelPositioningEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualPersonnelPositioning dataVisualPersonnelPositioning = new DataVisualPersonnelPositioning(); - - String contentId = CommUtil.getUUID(); - dataVisualContent.setId(contentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setType(DataVisualContent.Type_PersonnelPositioning); - dataVisualContent.setWidth("32"); - dataVisualContent.setHeight("32"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setIstab("false"); - this.dataVisualContentService.save(dataVisualContent); - - dataVisualPersonnelPositioning.setId(CommUtil.getUUID()); - dataVisualPersonnelPositioning.setPid(contentId); - dataVisualPersonnelPositioning.setColor("#1296db"); - dataVisualPersonnelPositioning.setShiftingLeft(0.0); - dataVisualPersonnelPositioning.setShiftingTop(0.0); - dataVisualPersonnelPositioning.setFontcolor("#000000"); - dataVisualPersonnelPositioning.setFontsize("14"); - - this.dataVisualPersonnelPositioningService.save(dataVisualPersonnelPositioning); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualPersonnelPositioning") DataVisualPersonnelPositioning dataVisualPersonnelPositioning) { - int res = this.dataVisualPersonnelPositioningService.update(dataVisualPersonnelPositioning); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/process/DataVisualPieChartController.java b/src/com/sipai/controller/process/DataVisualPieChartController.java deleted file mode 100644 index 03897a8d..00000000 --- a/src/com/sipai/controller/process/DataVisualPieChartController.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualPieChart; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualPieChartSeries; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualPieChartSeriesService; -import com.sipai.service.process.DataVisualPieChartService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualPieChart") -public class DataVisualPieChartController { - @Resource - private DataVisualPieChartService dataVisualPieChartService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private DataVisualPieChartSeriesService dataVisualPieChartSeriesService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualPieChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/getChartJson.do") - public ModelAndView getChartJson(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - JSONArray json = new JSONArray(); - - List dataVisualPieChartlist = this.dataVisualPieChartService.selectListByWhere("where 1=1 and pid='" + contentId + "' "); - String lineChartId = ""; - if (dataVisualPieChartlist != null && dataVisualPieChartlist.size() > 0) { - DataVisualPieChart dataVisualPieChart = dataVisualPieChartlist.get(0); - lineChartId = dataVisualPieChart.getId(); - json.add(dataVisualPieChart); - } - - List dataVisualPieChartSerieslist = this.dataVisualPieChartSeriesService.selectListByWhere("where 1=1 and pid='" + lineChartId + "' order by morder "); - if (dataVisualPieChartSerieslist != null && dataVisualPieChartSerieslist.size() > 0) { - json.add(dataVisualPieChartSerieslist); - } - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List dataVisualLinelist = this.dataVisualPieChartService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (dataVisualLinelist != null && dataVisualLinelist.size() > 0) { - model.addAttribute("dataVisualPieChart", dataVisualLinelist.get(0)); - - List dataVisualPieChartSerieslist = this.dataVisualPieChartSeriesService.selectListByWhere("where pid='" + dataVisualLinelist.get(0).getId() + "' "); - if (dataVisualPieChartSerieslist != null && dataVisualPieChartSerieslist.size() > 0) { - model.addAttribute("dataVisualPieChartSeries", dataVisualPieChartSerieslist.get(0)); - } - } - - return "/process/dataVisualPieChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualPieChart dataVisualPieChart = new DataVisualPieChart(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("350"); - dataVisualContent.setHeight("220"); - dataVisualContent.setType(DataVisualContent.Type_PieChart); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - String lineChartId = CommUtil.getUUID(); - dataVisualPieChart.setId(lineChartId); - dataVisualPieChart.setPid(cntentId); - dataVisualPieChart.setColors("#2ec7c9,#b6a2de,#5ab1ef,#ffb980,#d87a80,#8d98b3,#e5cf0d,#97b552"); - dataVisualPieChart.setBackground("transparent"); - dataVisualPieChart.setTitleColor("#000000"); - dataVisualPieChart.setTitleFontSize("16px"); - dataVisualPieChart.setTitleFontWeight("400"); - dataVisualPieChart.setTitlePositionX("center"); - dataVisualPieChart.setTitlePositionY("5%"); - dataVisualPieChart.setLegendPosition("right"); - dataVisualPieChart.setRadius("60%"); - dataVisualPieChart.setLableShow("true"); - dataVisualPieChart.setLablePosition("outside"); - - this.dataVisualPieChartService.save(dataVisualPieChart); - - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualPieChart") DataVisualPieChart dataVisualPieChart) { - int res = this.dataVisualPieChartService.update(dataVisualPieChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualPieChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualPieChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualPieChartSeriesController.java b/src/com/sipai/controller/process/DataVisualPieChartSeriesController.java deleted file mode 100644 index dcc76d40..00000000 --- a/src/com/sipai/controller/process/DataVisualPieChartSeriesController.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualPieChartSeries; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualPieChartSeriesService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualPieChartSeries") -public class DataVisualPieChartSeriesController { - @Resource - private DataVisualPieChartSeriesService dataVisualPieChartSeriesService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualPieChartSeriesService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualPieChartSeriesService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualPieChartSeries dataVisualPieChartSeries = this.dataVisualPieChartSeriesService.selectById(id); - model.addAttribute("dataVisualPieChartSeries", dataVisualPieChartSeries); - return "/process/dataVisualPieChartSeriesEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualPieChartSeries dataVisualPieChartSeries = new DataVisualPieChartSeries(); - - dataVisualPieChartSeries.setId(CommUtil.getUUID()); - dataVisualPieChartSeries.setPid(pid); - dataVisualPieChartSeries.setName("数据1"); - dataVisualPieChartSeries.setMorder(0); - dataVisualPieChartSeries.setValuemethod("nowTime"); - - int res = this.dataVisualPieChartSeriesService.save(dataVisualPieChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualPieChartSeries") DataVisualPieChartSeries dataVisualPieChartSeries) { - int res = this.dataVisualPieChartSeriesService.update(dataVisualPieChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.dataVisualPieChartSeriesService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualPieChartSeriesService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualPieChartSeries dataVisualPieChartSeries = new DataVisualPieChartSeries(); - jsonOne = json.getJSONObject(i); - dataVisualPieChartSeries.setId((String) jsonOne.get("id")); - dataVisualPieChartSeries.setMorder(i); - result = this.dataVisualPieChartSeriesService.update(dataVisualPieChartSeries); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualPolarCoordinatesController.java b/src/com/sipai/controller/process/DataVisualPolarCoordinatesController.java deleted file mode 100644 index 60238fff..00000000 --- a/src/com/sipai/controller/process/DataVisualPolarCoordinatesController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualPolarCoordinates; -import com.sipai.entity.process.DataVisualPolarCoordinatesSeries; -import com.sipai.entity.process.DataVisualText; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.DataVisualPieChart; -import com.sipai.entity.process.DataVisualPieChartSeries; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualPolarCoordinatesSeriesService; -import com.sipai.service.process.DataVisualPolarCoordinatesService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualPolarCoordinates") -public class DataVisualPolarCoordinatesController { - @Resource - private DataVisualPolarCoordinatesService dataVisualPolarCoordinatesService; - @Resource - private DataVisualPolarCoordinatesSeriesService dataVisualPolarCoordinatesSeriesService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualPolarCoordinatesService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if(list!=null&&list.size()>0){ - DataVisualPolarCoordinates dataVisualPolarCoordinates = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualPolarCoordinates)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/getChartJson.do") - public ModelAndView getChartJson(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - JSONArray json = new JSONArray(); - - List list = this.dataVisualPolarCoordinatesService.selectListByWhere("where 1=1 and pid='" + contentId + "' "); - String pid = ""; - if (list != null && list.size() > 0) { - DataVisualPolarCoordinates dataVisualPolarCoordinates = list.get(0); - pid = dataVisualPolarCoordinates.getId(); - json.add(dataVisualPolarCoordinates); - } - - List sList = this.dataVisualPolarCoordinatesSeriesService.selectListByWhere("where 1=1 and pid='" + pid + "' order by morder "); - if (sList != null && sList.size() > 0) { - json.add(sList); - } - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if(dContent!=null){ - List list = this.dataVisualPolarCoordinatesService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if(list!=null&&list.size()>0){ - model.addAttribute("dataVisualPolarCoordinates", list.get(0)); - } - } - - return "/process/dataVisualPolarCoordinatesEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("300"); - dataVisualContent.setHeight("300"); - dataVisualContent.setType(DataVisualContent.Type_PolarCoordinates); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualPolarCoordinates dataVisualPolarCoordinates = new DataVisualPolarCoordinates(); - dataVisualPolarCoordinates.setId(CommUtil.getUUID()); - dataVisualPolarCoordinates.setPid(cntentId); - dataVisualPolarCoordinates.setBackground("transparent"); - dataVisualPolarCoordinates.setLegendPosition("false"); - dataVisualPolarCoordinates.setBackgroundst("false"); - dataVisualPolarCoordinates.setRadius("80%"); - dataVisualPolarCoordinates.setRoundcapst("true"); - dataVisualPolarCoordinates.setBarwidth("20"); - dataVisualPolarCoordinates.setColors("#2ec7c9,#b6a2de,#5ab1ef,#ffb980,#d87a80,#8d98b3,#e5cf0d,#97b552"); - - this.dataVisualPolarCoordinatesService.save(dataVisualPolarCoordinates); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualPolarCoordinates") DataVisualPolarCoordinates dataVisualPolarCoordinates) { - int res = this.dataVisualPolarCoordinatesService.update(dataVisualPolarCoordinates); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualPolarCoordinatesService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualPolarCoordinatesService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualPolarCoordinatesSeriesController.java b/src/com/sipai/controller/process/DataVisualPolarCoordinatesSeriesController.java deleted file mode 100644 index e040df15..00000000 --- a/src/com/sipai/controller/process/DataVisualPolarCoordinatesSeriesController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualPolarCoordinatesSeries; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualPolarCoordinatesSeriesService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualPolarCoordinatesSeries") -public class DataVisualPolarCoordinatesSeriesController { - @Resource - private DataVisualPolarCoordinatesSeriesService dataVisualPolarCoordinatesSeriesService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualPolarCoordinatesSeriesService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualPolarCoordinatesSeriesService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualPolarCoordinatesSeries dataVisualPolarCoordinatesSeries = this.dataVisualPolarCoordinatesSeriesService.selectById(id); - model.addAttribute("dataVisualPolarCoordinatesSeries", dataVisualPolarCoordinatesSeries); - return "/process/dataVisualPolarCoordinatesSeriesEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualPolarCoordinatesSeries dataVisualPolarCoordinatesSeries = new DataVisualPolarCoordinatesSeries(); - - dataVisualPolarCoordinatesSeries.setId(CommUtil.getUUID()); - dataVisualPolarCoordinatesSeries.setPid(pid); - dataVisualPolarCoordinatesSeries.setMorder(0); - dataVisualPolarCoordinatesSeries.setName("数据1"); - dataVisualPolarCoordinatesSeries.setValuemethod("nowTime"); - - int res = this.dataVisualPolarCoordinatesSeriesService.save(dataVisualPolarCoordinatesSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualPolarCoordinatesSeries") DataVisualPolarCoordinatesSeries dataVisualPolarCoordinatesSeries) { - int res = this.dataVisualPolarCoordinatesSeriesService.update(dataVisualPolarCoordinatesSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualPolarCoordinatesSeriesService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualPolarCoordinatesSeriesService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.dataVisualProgressBarChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if(list!=null&&list.size()>0){ - DataVisualProgressBarChart dataVisualProgressBarChart = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualProgressBarChart)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if(dContent!=null){ - List list = this.dataVisualProgressBarChartService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if(list!=null&&list.size()>0){ - model.addAttribute("dataVisualProgressBarChart", list.get(0)); - } - } - - return "/process/dataVisualProgressBarChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("400"); - dataVisualContent.setHeight("50"); - dataVisualContent.setType(DataVisualContent.Type_ProgressBar); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualProgressBarChart dataVisualProgressBarChart = new DataVisualProgressBarChart(); - dataVisualProgressBarChart.setId(CommUtil.getUUID()); - dataVisualProgressBarChart.setPid(cntentId); - dataVisualProgressBarChart.setBackground("transparent"); - dataVisualProgressBarChart.setTextPosition("false"); - dataVisualProgressBarChart.setDatacolors("#69F6F9"); - dataVisualProgressBarChart.setDatabarwidth("40"); - dataVisualProgressBarChart.setDataradius("20"); - dataVisualProgressBarChart.setBktext("100"); - dataVisualProgressBarChart.setBkcolors("#e0e0e0"); - dataVisualProgressBarChart.setBkbarwidth("40"); - dataVisualProgressBarChart.setBkradius("20"); - dataVisualProgressBarChart.setValuemethod("nowTime"); - - this.dataVisualProgressBarChartService.save(dataVisualProgressBarChart); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualProgressBarChart") DataVisualProgressBarChart dataVisualProgressBarChart) { - int res = this.dataVisualProgressBarChartService.update(dataVisualProgressBarChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualProgressBarChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualProgressBarChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doCopy.do") - public ModelAndView doCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - DataVisualProgressBarChart dataVisualProgressBarChart = this.dataVisualProgressBarChartService.selectById(id); - - String newContentId=CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - dataVisualProgressBarChart.setId(CommUtil.getUUID()); - dataVisualProgressBarChart.setPid(newContentId); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualProgressBarChartService.save(dataVisualProgressBarChart); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualRadarChartAxisController.java b/src/com/sipai/controller/process/DataVisualRadarChartAxisController.java deleted file mode 100644 index bfb3e0c1..00000000 --- a/src/com/sipai/controller/process/DataVisualRadarChartAxisController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualRadarChartAxis; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualRadarChartAxisService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualRadarChartAxis") -public class DataVisualRadarChartAxisController { - @Resource - private DataVisualRadarChartAxisService dataVisualRadarChartAxisService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by "+sort+" "+order; - - String wherestr = " where 1=1 and pid='"+request.getParameter("pid")+"' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualRadarChartAxisService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid=request.getParameter("pid"); - List list = this.dataVisualRadarChartAxisService.selectListByWhere("where 1=1 and pid='"+pid+"' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - DataVisualRadarChartAxis dataVisualRadarChartAxis = this.dataVisualRadarChartAxisService.selectById(id); - model.addAttribute("dataVisualRadarChartAxis", dataVisualRadarChartAxis); - return "/process/dataVisualRadarChartAxisEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model ) { - String pid=request.getParameter("pid"); - DataVisualRadarChartAxis dataVisualRadarChartAxis=new DataVisualRadarChartAxis(); - - dataVisualRadarChartAxis.setId(CommUtil.getUUID()); - dataVisualRadarChartAxis.setPid(pid); - dataVisualRadarChartAxis.setName("数据1"); - dataVisualRadarChartAxis.setMorder(0); - - int res = this.dataVisualRadarChartAxisService.save(dataVisualRadarChartAxis); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualRadarChartAxis") DataVisualRadarChartAxis dataVisualRadarChartAxis) { - int res = this.dataVisualRadarChartAxisService.update(dataVisualRadarChartAxis); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.dataVisualRadarChartAxisService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualRadarChartAxisService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.dataVisualRadarChartService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if (list != null && list.size() > 0) { - DataVisualRadarChart dataVisualRadarChart = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualRadarChart)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/getChartJson.do") - public ModelAndView getChartJson(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - - JSONArray json = new JSONArray(); - - List dataVisualRadarChartlist = this.dataVisualRadarChartService.selectListByWhere("where pid='" + contentId + "' "); - String chartId = ""; - if (dataVisualRadarChartlist != null && dataVisualRadarChartlist.size() > 0) { - DataVisualRadarChart dataVisualRadarChart = dataVisualRadarChartlist.get(0); - chartId = dataVisualRadarChart.getId(); - json.add(dataVisualRadarChart); - } - - List dataVisualRadarChartSerieslist = this.dataVisualRadarChartSeriesService.selectListByWhere("where pid='" + chartId + "' order by morder "); - if (dataVisualRadarChartSerieslist != null && dataVisualRadarChartSerieslist.size() > 0) { - json.add(dataVisualRadarChartSerieslist); - } - - List dataVisualRadarChartAxislist = this.dataVisualRadarChartAxisService.selectListByWhere("where pid='" + chartId + "' order by morder "); - if (dataVisualRadarChartAxislist != null && dataVisualRadarChartAxislist.size() > 0) { - json.add(dataVisualRadarChartAxislist); - } - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if (dContent != null) { - List list = this.dataVisualRadarChartService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualRadarChart", list.get(0)); - - List dataVisualRadarChartSerieslist = this.dataVisualRadarChartSeriesService.selectListByWhere("where pid='" + list.get(0).getId() + "' "); - if (dataVisualRadarChartSerieslist != null && dataVisualRadarChartSerieslist.size() > 0) { - model.addAttribute("dataVisualRadarChartSeries", dataVisualRadarChartSerieslist.get(0)); - } - - List dataVisualRadarChartAxislist = this.dataVisualRadarChartAxisService.selectListByWhere("where pid='" + list.get(0).getId() + "' "); - if (dataVisualRadarChartAxislist != null && dataVisualRadarChartAxislist.size() > 0) { - model.addAttribute("dataVisualRadarChartAxis", dataVisualRadarChartAxislist.get(0)); - } - - } - } - - return "/process/dataVisualRadarChartEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("260"); - dataVisualContent.setHeight("220"); - dataVisualContent.setType(DataVisualContent.Type_RadarChart); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualRadarChart dataVisualRadarChart = new DataVisualRadarChart(); - dataVisualRadarChart.setId(CommUtil.getUUID()); - dataVisualRadarChart.setPid(cntentId); - dataVisualRadarChart.setColors("#2ec7c9,#b6a2de,#5ab1ef,#ffb980,#d87a80,#8d98b3,#e5cf0d,#97b552"); - dataVisualRadarChart.setTitlePosition("left"); - dataVisualRadarChart.setLegendPosition("right"); - dataVisualRadarChart.setBackground("transparent"); - dataVisualRadarChart.setRadius(100); - dataVisualRadarChart.setSplitnumber(5); - dataVisualRadarChart.setShape("polygon"); - dataVisualRadarChart.setAxisnameformatter("{value}"); - dataVisualRadarChart.setAxisnamecolor("#333"); - - this.dataVisualRadarChartService.save(dataVisualRadarChart); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualRadarChart") DataVisualRadarChart dataVisualRadarChart) { - int res = this.dataVisualRadarChartService.update(dataVisualRadarChart); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualRadarChartService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualRadarChartService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualRadarChartSeriesController.java b/src/com/sipai/controller/process/DataVisualRadarChartSeriesController.java deleted file mode 100644 index d203a8ba..00000000 --- a/src/com/sipai/controller/process/DataVisualRadarChartSeriesController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualRadarChartSeries; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualRadarChartSeriesService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualRadarChartSeries") -public class DataVisualRadarChartSeriesController { - @Resource - private DataVisualRadarChartSeriesService dataVisualRadarChartSeriesService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualRadarChartSeriesService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualRadarChartSeriesService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualRadarChartSeries dataVisualRadarChartSeries = this.dataVisualRadarChartSeriesService.selectById(id); - model.addAttribute("dataVisualRadarChartSeries", dataVisualRadarChartSeries); - return "/process/dataVisualRadarChartSeriesEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualRadarChartSeries dataVisualRadarChartSeries = new DataVisualRadarChartSeries(); - - dataVisualRadarChartSeries.setId(CommUtil.getUUID()); - dataVisualRadarChartSeries.setPid(pid); - dataVisualRadarChartSeries.setMorder(0); - dataVisualRadarChartSeries.setName("数据1"); - dataVisualRadarChartSeries.setValuemethod("nowTime"); - - int res = this.dataVisualRadarChartSeriesService.save(dataVisualRadarChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualRadarChartSeries") DataVisualRadarChartSeries dataVisualRadarChartSeries) { - int res = this.dataVisualRadarChartSeriesService.update(dataVisualRadarChartSeries); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualRadarChartSeriesService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualRadarChartSeriesService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.dataVisualSelectService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSelectService.selectListByWhere("where 1=1 and pid='" + pid + "' order by morder"); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - DataVisualSelect dataVisualSelect = this.dataVisualSelectService.selectById(id); - model.addAttribute("dataVisualSelect", dataVisualSelect); - - return "/process/dataVisualSelectEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model) { - DataVisualSelect dataVisualSelect = new DataVisualSelect(); - - dataVisualSelect.setId(CommUtil.getUUID()); - dataVisualSelect.setPid(request.getParameter("pid")); - dataVisualSelect.setTextcontent("下拉1"); - dataVisualSelect.setMorder(0); - - int code=this.dataVisualSelectService.save(dataVisualSelect); - - if (code == 1) { - Result result = Result.success(code); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSelect") DataVisualSelect dataVisualSelect) { - int res = this.dataVisualSelectService.update(dataVisualSelect); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualSelectService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualSelectService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualSelect dataVisualSelect = new DataVisualSelect(); - jsonOne = json.getJSONObject(i); - dataVisualSelect.setId((String) jsonOne.get("id")); - dataVisualSelect.setMorder(i); - result = this.dataVisualSelectService.update(dataVisualSelect); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doSelectAllDSave.do") - public ModelAndView doSelectAllDSave(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSelect") DataVisualSelect dataVisualSelect) { - int res = this.dataVisualSelectService.update(dataVisualSelect); - if (res == 1) { - List list = this.dataVisualSelectService.selectListByWhere("where pid='"+dataVisualSelect.getPid()+"' and id!='"+dataVisualSelect.getId()+"' "); - for (DataVisualSelect upDataVisualSelect : list) { - String id=upDataVisualSelect.getId(); - String text=upDataVisualSelect.getTextcontent(); - String url=upDataVisualSelect.getUrlstring(); - int morder=upDataVisualSelect.getMorder(); - - upDataVisualSelect=dataVisualSelect; - upDataVisualSelect.setId(id); - upDataVisualSelect.setTextcontent(text); - upDataVisualSelect.setUrlstring(url); - upDataVisualSelect.setMorder(morder); - - this.dataVisualSelectService.update(upDataVisualSelect); - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualSuspensionFrameController.java b/src/com/sipai/controller/process/DataVisualSuspensionFrameController.java deleted file mode 100644 index 69269620..00000000 --- a/src/com/sipai/controller/process/DataVisualSuspensionFrameController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualSuspensionFrame; -import com.sipai.entity.process.DataVisualTab; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.DataVisualGaugeChart; -import com.sipai.entity.process.DataVisualRadarChart; -import com.sipai.entity.process.DataVisualRadarChartAxis; -import com.sipai.entity.process.DataVisualRadarChartSeries; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualSuspensionFrameService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualSuspensionFrame") -public class DataVisualSuspensionFrameController { - @Resource - private DataVisualSuspensionFrameService dataVisualSuspensionFrameService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSuspensionFrameService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/getById.do") - public ModelAndView getById(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - DataVisualSuspensionFrame dataVisualSuspensionFrame = this.dataVisualSuspensionFrameService.selectById(id); - model.addAttribute("result", JSONArray.fromObject(dataVisualSuspensionFrame)); - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - if (dContent != null) { - List list = this.dataVisualSuspensionFrameService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualSuspensionFrame", list.get(0)); - } - } - return "/process/dataVisualSuspensionFrameEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualSuspensionFrame dataVisualSuspensionFrame = new DataVisualSuspensionFrame(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("95"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - - dataVisualSuspensionFrame.setId(CommUtil.getUUID()); - dataVisualSuspensionFrame.setPid(cntentId); - - dataVisualContent.setType(DataVisualContent.Type_SuspensionFrame); - dataVisualContent.setWidth("400"); - dataVisualContent.setHeight("200"); - - dataVisualSuspensionFrame.setFontsize(14); - dataVisualSuspensionFrame.setFontcolor("#000000"); - dataVisualSuspensionFrame.setFontweight(400); - dataVisualSuspensionFrame.setBackground("transparent"); - dataVisualSuspensionFrame.setTextalign("left"); - dataVisualSuspensionFrame.setDisplay("block"); -// dataVisualSuspensionFrame.setTextheight("80"); - dataVisualSuspensionFrame.setValuemethod("nowTime"); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualSuspensionFrameService.save(dataVisualSuspensionFrame); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSuspensionFrame") DataVisualSuspensionFrame dataVisualSuspensionFrame) { - int res = this.dataVisualSuspensionFrameService.update(dataVisualSuspensionFrame); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualSuspensionFrameService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualSuspensionFrameService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualSvgAlarmController.java b/src/com/sipai/controller/process/DataVisualSvgAlarmController.java deleted file mode 100644 index 12d32bad..00000000 --- a/src/com/sipai/controller/process/DataVisualSvgAlarmController.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualSvgAlarm; -import com.sipai.service.process.DataVisualSvgAlarmService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualSvgAlarm") -public class DataVisualSvgAlarmController { - @Resource - private DataVisualSvgAlarmService dataVisualSvgAlarmService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualSvgAlarmService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSvgAlarmService.selectListByWhere("where 1=1 and pid='" + pid + "' order by morder "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - DataVisualSvgAlarm dataVisualSvgAlarm = this.dataVisualSvgAlarmService.selectById(id); - model.addAttribute("dataVisualSvgAlarm", dataVisualSvgAlarm); - return "/process/dataVisualSvgAlarmEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - DataVisualSvgAlarm dataVisualSvgAlarm = new DataVisualSvgAlarm(); - - dataVisualSvgAlarm.setId(CommUtil.getUUID()); - dataVisualSvgAlarm.setPid(pid); - dataVisualSvgAlarm.setMorder(0); - dataVisualSvgAlarm.setJsmethod("="); - dataVisualSvgAlarm.setJsvalue("0"); - - int res = this.dataVisualSvgAlarmService.save(dataVisualSvgAlarm); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doHQSvgAlarmSave.do") - public ModelAndView doHQSvgAlarmSave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - - int res = 0; - - DataVisualSvgAlarm dataVisualSvgAlarm1 = new DataVisualSvgAlarm(); - dataVisualSvgAlarm1.setId(CommUtil.getUUID()); - dataVisualSvgAlarm1.setPid(pid); - dataVisualSvgAlarm1.setMorder(0); - dataVisualSvgAlarm1.setJsmethod("="); - dataVisualSvgAlarm1.setJsvalue("A"); - dataVisualSvgAlarm1.setFill("rgba(255,0,0,0.2)"); - res += this.dataVisualSvgAlarmService.save(dataVisualSvgAlarm1); - - DataVisualSvgAlarm dataVisualSvgAlarm2 = new DataVisualSvgAlarm(); - dataVisualSvgAlarm2.setId(CommUtil.getUUID()); - dataVisualSvgAlarm2.setPid(pid); - dataVisualSvgAlarm2.setMorder(1); - dataVisualSvgAlarm2.setJsmethod("="); - dataVisualSvgAlarm2.setJsvalue("B"); - dataVisualSvgAlarm2.setFill("rgba(255,192,0,0.2)"); - res += this.dataVisualSvgAlarmService.save(dataVisualSvgAlarm2); - - DataVisualSvgAlarm dataVisualSvgAlarm3 = new DataVisualSvgAlarm(); - dataVisualSvgAlarm3.setId(CommUtil.getUUID()); - dataVisualSvgAlarm3.setPid(pid); - dataVisualSvgAlarm3.setMorder(2); - dataVisualSvgAlarm3.setJsmethod("="); - dataVisualSvgAlarm3.setJsvalue("C"); - dataVisualSvgAlarm3.setFill("rgba(255,255,0,0.2)"); - res += this.dataVisualSvgAlarmService.save(dataVisualSvgAlarm3); - - DataVisualSvgAlarm dataVisualSvgAlarm4 = new DataVisualSvgAlarm(); - dataVisualSvgAlarm4.setId(CommUtil.getUUID()); - dataVisualSvgAlarm4.setPid(pid); - dataVisualSvgAlarm4.setMorder(3); - dataVisualSvgAlarm4.setJsmethod("="); - dataVisualSvgAlarm4.setJsvalue("D"); - dataVisualSvgAlarm4.setFill("rgba(0,176,240,0.2)"); - res += this.dataVisualSvgAlarmService.save(dataVisualSvgAlarm4); - - DataVisualSvgAlarm dataVisualSvgAlarm5 = new DataVisualSvgAlarm(); - dataVisualSvgAlarm5.setId(CommUtil.getUUID()); - dataVisualSvgAlarm5.setPid(pid); - dataVisualSvgAlarm5.setMorder(4); - dataVisualSvgAlarm5.setJsmethod("="); - dataVisualSvgAlarm5.setJsvalue("0"); - dataVisualSvgAlarm5.setFill("transparent"); - res += this.dataVisualSvgAlarmService.save(dataVisualSvgAlarm5); - - - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSvgAlarm") DataVisualSvgAlarm dataVisualSvgAlarm) { - int res = this.dataVisualSvgAlarmService.update(dataVisualSvgAlarm); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualSvgAlarmService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualSvgAlarmService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualSvgAlarm dataVisualSvgAlarm = new DataVisualSvgAlarm(); - jsonOne = json.getJSONObject(i); - dataVisualSvgAlarm.setId((String) jsonOne.get("id")); - dataVisualSvgAlarm.setMorder(i); - result = this.dataVisualSvgAlarmService.update(dataVisualSvgAlarm); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualSvgController.java b/src/com/sipai/controller/process/DataVisualSvgController.java deleted file mode 100644 index 07c86460..00000000 --- a/src/com/sipai/controller/process/DataVisualSvgController.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualSvg; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualSvgService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualSvg") -public class DataVisualSvgController { - @Resource - private DataVisualSvgService dataVisualSvgService; - @Resource - private DataVisualContentService dataVisualContentService; - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSvgService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List list = this.dataVisualSvgService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualSvg", list.get(0)); - } - - return "/process/dataVisualSvgEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); -// System.out.println(request.getParameter("savePoints")); - String[] savePoints = request.getParameter("savePoints").split("\\|"); - if (savePoints.length > 0) { - float maxX = 0; - float maxY = 0; - float minX = 0; - float minY = 0; -// float firstX = 0; -// float firstY = 0; - float divX = 0; - float divY = 0; - - for (int i = 0; i < savePoints.length; i++) { -// System.out.println(savePoints[i]); - String[] savePointDetail = savePoints[i].split(","); - float nowX = Float.valueOf(savePointDetail[0]); - float nowY = Float.valueOf(savePointDetail[1]); - if (i == 0) { - divX = nowX; - divY = nowY; - minX = nowX; - minY = nowY; - } - if (maxX < nowX) { - maxX = nowX; - } - if (maxY < nowY) { - maxY = nowY; - } - if (minX > nowX) { - minX = nowX; - } - if (minY > nowY) { - minY = nowY; - } - if (divX > nowX) { - divX = nowX; - } - if (divY > nowY) { - divY = nowY; - } - } - float divWidth = maxX - minX; - float divHeight = maxY - minY; - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(String.valueOf(divX)); - dataVisualContent.setPosty(String.valueOf(divY)); - dataVisualContent.setWidth(String.valueOf(divWidth)); - dataVisualContent.setHeight(String.valueOf(divHeight)); - dataVisualContent.setType(DataVisualContent.Type_Svg); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualSvg dataVisualSvg = new DataVisualSvg(); - - dataVisualSvg.setId(CommUtil.getUUID()); - dataVisualSvg.setPid(cntentId); - dataVisualSvg.setPoints(request.getParameter("savePoints")); - dataVisualSvg.setType(DataVisualSvg.Type_Polyline); - dataVisualSvg.setStrokeWidth(1.0); - dataVisualSvg.setStroke("#00FF33"); - dataVisualSvg.setDashedlinetype("false"); - dataVisualSvg.setDashedline1(10.0); - dataVisualSvg.setDashedline2(5.0); - - this.dataVisualSvgService.save(dataVisualSvg); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - } - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSvg") DataVisualSvg dataVisualSvg) { - int res = this.dataVisualSvgService.update(dataVisualSvg); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualSvgService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualSvgService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualSwitchController.java b/src/com/sipai/controller/process/DataVisualSwitchController.java deleted file mode 100644 index 12b81a59..00000000 --- a/src/com/sipai/controller/process/DataVisualSwitchController.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualSwitch; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualSwitchService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualSwitch") -public class DataVisualSwitchController { - @Resource - private DataVisualSwitchService dataVisualSwitchService; - @Resource - private DataVisualContentService dataVisualContentService; - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSwitchService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List list = this.dataVisualSwitchService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualSwitch", list.get(0)); - } - - return "/process/dataVisualSwitchEdit"; - } - - @RequestMapping("/urlOpen.do") - public String urlOpen(HttpServletRequest request, Model model) { - return "/process/dataVisualSwitchUrlOpen"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("140"); - dataVisualContent.setHeight("40"); - dataVisualContent.setType(DataVisualContent.Type_Switch); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if (request.getParameter("isTabSt") != null && request.getParameter("isTabSt").equals("true")) { - dataVisualContent.setIstab("true"); - } else { - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualSwitch dataVisualSwitch = new DataVisualSwitch(); - - dataVisualSwitch.setId(CommUtil.getUUID()); - dataVisualSwitch.setPid(cntentId); - dataVisualSwitch.setOpenst("false"); - - this.dataVisualSwitchService.save(dataVisualSwitch); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSwitch") DataVisualSwitch dataVisualSwitch) { - int res = this.dataVisualSwitchService.update(dataVisualSwitch); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualSwitchService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualSwitchService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doSwitchCopy.do") - public ModelAndView doSwitchCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - DataVisualSwitch dataVisualSwitch = this.dataVisualSwitchService.selectById(id); - - String newContentId=CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - dataVisualSwitch.setId(CommUtil.getUUID()); - dataVisualSwitch.setPid(newContentId); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualSwitchService.save(dataVisualSwitch); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/process/DataVisualSwitchPointController.java b/src/com/sipai/controller/process/DataVisualSwitchPointController.java deleted file mode 100644 index a11bb4b5..00000000 --- a/src/com/sipai/controller/process/DataVisualSwitchPointController.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualSwitchPoint; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualSwitchPointService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualSwitchPoint") -public class DataVisualSwitchPointController { - @Resource - private DataVisualSwitchPointService dataVisualSwitchPointService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSwitchPointService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if (list != null && list.size() > 0) { - DataVisualSwitchPoint dataVisualSwitchPoint = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualSwitchPoint)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/getPoints.do") - public ModelAndView getPoints(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualSwitchPointService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - String points = ""; - if (list != null && list.size() > 0) { - for (DataVisualSwitchPoint dataVisualSwitchPoint : - list) { - points += dataVisualSwitchPoint.getContentid() + ","; - } - } - model.addAttribute("result", points); - return new ModelAndView("result"); - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " id "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualSwitchPointService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/edit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if (dContent != null) { - List list = this.dataVisualSwitchPointService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualSwitchPoint", list.get(0)); - } - } - - return "/process/dataVisualSwitchPointEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - - DataVisualSwitchPoint dataVisualSwitchPoint = new DataVisualSwitchPoint(); - dataVisualSwitchPoint.setId(CommUtil.getUUID()); - dataVisualSwitchPoint.setPid(pid); - - int res = this.dataVisualSwitchPointService.save(dataVisualSwitchPoint); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualSwitchPoint") DataVisualSwitchPoint dataVisualSwitchPoint) { - int res = this.dataVisualSwitchPointService.update(dataVisualSwitchPoint); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdateForContentId.do") - public ModelAndView doupdateForContentId(HttpServletRequest request, Model model) { - DataVisualSwitchPoint dataVisualSwitchPoint = this.dataVisualSwitchPointService.selectById(request.getParameter("id")); - dataVisualSwitchPoint.setContentid(request.getParameter("contentId")); - int res = this.dataVisualSwitchPointService.update(dataVisualSwitchPoint); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualSwitchPointService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualSwitchPointService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualTabController.java b/src/com/sipai/controller/process/DataVisualTabController.java deleted file mode 100644 index 78cffd88..00000000 --- a/src/com/sipai/controller/process/DataVisualTabController.java +++ /dev/null @@ -1,284 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualTab; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.DataVisualLineChartSeries; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualTabService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualTab") -public class DataVisualTabController { - @Resource - private DataVisualTabService dataVisualTabService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - - PageHelper.startPage(page, rows); - List list = this.dataVisualTabService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualTabService.selectListByWhere("where pid='" + pid + "' order by morder "); - model.addAttribute("result", JSONArray.fromObject(list)); - - return new ModelAndView("result"); - } - - - @RequestMapping("/getContainer.do") - public ModelAndView getContainer(HttpServletRequest request, Model model) { - String tabId = request.getParameter("tabId"); - DataVisualTab dataVisualTab = this.dataVisualTabService.selectById(tabId); - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(dataVisualTab.getPid()); - if(dataVisualContent.getIstab()!=null&&dataVisualContent.getIstab().equals("true")){ - DataVisualContent dContent = getContainerFors(dataVisualContent); - dataVisualContent.setContainerId(dContent.getPid()); - }else{ - dataVisualContent.setContainerId(dataVisualContent.getPid()); - } - model.addAttribute("result", JSONArray.fromObject(dataVisualContent)); - return new ModelAndView("result"); - } - - //为了套娃 - public DataVisualContent getContainerFors(DataVisualContent lastdataVisualContent) { - DataVisualTab dataVisualTab = this.dataVisualTabService.selectById(lastdataVisualContent.getPid()); - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(dataVisualTab.getPid()); - if(dataVisualContent.getIstab()!=null&&dataVisualContent.getIstab().equals("true")){ - getContainerFors(dataVisualContent); - }else{ - return dataVisualContent; - } - return dataVisualContent; - } - - @RequestMapping("/showContainer.do") - public String showContainer(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - model.addAttribute("dataVisualContent", dataVisualContent); - - return "/process/dataVisualTabContainer"; - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - DataVisualTab dataVisualTab = this.dataVisualTabService.selectById(id); - model.addAttribute("dataVisualTab", dataVisualTab); - - return "/process/dataVisualTabContainerEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("400"); - dataVisualContent.setHeight("60"); - dataVisualContent.setType(DataVisualContent.Type_Tab); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setTabtype(DataVisualTab.TabType_Sheet); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualTab dataVisualTab = new DataVisualTab(); - dataVisualTab.setId(CommUtil.getUUID()); - dataVisualTab.setPid(cntentId); - dataVisualTab.setWidth("120"); - dataVisualTab.setHeight("60"); - dataVisualTab.setMorder(0); - dataVisualTab.setFirstck("true"); - this.dataVisualTabService.save(dataVisualTab); - - dataVisualTab.setId(CommUtil.getUUID()); - dataVisualTab.setMorder(1); - dataVisualTab.setFirstck("false"); - this.dataVisualTabService.save(dataVisualTab); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doTabSave.do") - public ModelAndView doTabSave(HttpServletRequest request, Model model) { - String cntentId = request.getParameter("cntentId"); - - DataVisualTab dataVisualTab = new DataVisualTab(); - dataVisualTab.setId(CommUtil.getUUID()); - dataVisualTab.setPid(cntentId); - dataVisualTab.setText("Tab1"); - dataVisualTab.setWidth("120"); - dataVisualTab.setHeight("60"); - dataVisualTab.setMorder(0); - dataVisualTab.setFirstck("true"); - int res=this.dataVisualTabService.save(dataVisualTab); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualTab") DataVisualTab dataVisualTab) { - int res = this.dataVisualTabService.update(dataVisualTab); - if (res == 1) { - if(dataVisualTab.getFirstck().equals("true")){ - this.dataVisualTabService.updateByWhere(" set firstck='false' where pid='"+dataVisualTab.getPid()+"' and id!='"+dataVisualTab.getId()+"' "); - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doTabAllUpdate.do") - public ModelAndView doTabAllUpdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualTab") DataVisualTab dataVisualTab) { - int res = this.dataVisualTabService.update(dataVisualTab); - if (res == 1) { - if(dataVisualTab.getFirstck().equals("true")){ - this.dataVisualTabService.updateByWhere(" set firstck='false' where pid='"+dataVisualTab.getPid()+"' and id!='"+dataVisualTab.getId()+"' "); - } - List list = this.dataVisualTabService.selectListByWhere("where pid='"+dataVisualTab.getPid()+"' and id!='"+dataVisualTab.getId()+"' "); - for (DataVisualTab upDataVisualTab : list) { - String id=upDataVisualTab.getId(); - String firstck=upDataVisualTab.getFirstck(); - String text=upDataVisualTab.getText(); - int morder=upDataVisualTab.getMorder(); - - upDataVisualTab=dataVisualTab; - upDataVisualTab.setId(id); - upDataVisualTab.setFirstck(firstck); - upDataVisualTab.setText(text); - upDataVisualTab.setMorder(morder); - - this.dataVisualTabService.update(upDataVisualTab); - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualTabService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualTabService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - DataVisualTab dataVisualTab = new DataVisualTab(); - jsonOne = json.getJSONObject(i); - dataVisualTab.setId((String) jsonOne.get("id")); - dataVisualTab.setMorder(i); - result = this.dataVisualTabService.update(dataVisualTab); - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualTaskPointsController.java b/src/com/sipai/controller/process/DataVisualTaskPointsController.java deleted file mode 100644 index 07f38077..00000000 --- a/src/com/sipai/controller/process/DataVisualTaskPointsController.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualTaskPoints; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualTaskPointsService; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualTaskPoints") -public class DataVisualTaskPointsController { - @Resource - private DataVisualTaskPointsService dataVisualTaskPointsService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/selectListForVisual.do") - public String selectList(HttpServletRequest request,Model model) { - return "/process/dataVisualTaskPoints4Select"; - } - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid=request.getParameter("pid"); - List list = this.dataVisualTaskPointsService.selectListByWhere("where 1=1 and pid='"+pid+"' "); - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - List list = this.dataVisualTaskPointsService.selectListByWhere("where pid='" + dContent.getId() + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("dataVisualTaskPoints", list.get(0)); - } - - return "/process/dataVisualTaskPointsEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String frameId=request.getParameter("frameId"); - String datas=request.getParameter("datas"); - - String[] cids=datas.split(","); - if(cids!=null&&cids.length>0){ - for (String cid : cids) { - DataVisualContent dataVisualContent=new DataVisualContent(); - DataVisualTaskPoints dataVisualTaskPoints=new DataVisualTaskPoints(); - - String contentId=CommUtil.getUUID(); - dataVisualContent.setId(contentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx("200"); - dataVisualContent.setPosty("20"); - dataVisualContent.setType(DataVisualContent.Type_TaskPoints); - dataVisualContent.setWidth("120"); - dataVisualContent.setHeight("36"); - dataVisualContent.setzIndex("90"); - dataVisualContent.setIstab("false"); - this.dataVisualContentService.save(dataVisualContent); - - dataVisualTaskPoints.setId(CommUtil.getUUID()); - dataVisualTaskPoints.setPid(contentId); - dataVisualTaskPoints.setTaskid(cid); - - this.dataVisualTaskPointsService.save(dataVisualTaskPoints); - } - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualTaskPoints") DataVisualTaskPoints dataVisualTaskPoints) { - int res = this.dataVisualTaskPointsService.update(dataVisualTaskPoints); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/process/DataVisualTextController.java b/src/com/sipai/controller/process/DataVisualTextController.java deleted file mode 100644 index 84838532..00000000 --- a/src/com/sipai/controller/process/DataVisualTextController.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualText; -import com.sipai.entity.process.DataVisualTextWarehouse; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualTextService; -import com.sipai.service.process.DataVisualTextWarehouseService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualText") -public class DataVisualTextController { - @Resource - private DataVisualTextService dataVisualTextService; - @Resource - private DataVisualTextWarehouseService dataVisualTextWarehouseService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualTextService.selectListByWhere("where 1=1 and pid='" + pid + "' "); -// if (list != null && list.size() > 0) { -// for (DataVisualText dataVisualText : -// list) { -// //先判定测量点 -// if (dataVisualText.getMpid() != null && !dataVisualText.getMpid().equals("")) { -//// MPoint mPoint = this.mPointService.selectById(unitId,gfc.getMpid()); -// MPoint mPoint = this.mPointService.selectById(dataVisualText.getMpid()); -// String mpTextcontent = ""; -// if (mPoint != null) { -// mpTextcontent = String.valueOf(mPoint.getParmvalue()); -// if (dataVisualText.getUnitst() != null && dataVisualText.getUnitst().equals("true")) { -// mpTextcontent += mPoint.getUnit(); -// } -// } -// dataVisualText.setTextcontent(mpTextcontent); -// } else { -// } -// } -// } - - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - DataVisualContent dataVisualContent = new DataVisualContent(); - DataVisualText dataVisualText = new DataVisualText(); - - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - - dataVisualText.setId(CommUtil.getUUID()); - dataVisualText.setPid(cntentId); - - dataVisualContent.setType(DataVisualContent.Type_Text); - //默认读取库中第一条记录 -// List wlist = this.dataVisualTextWarehouseService.selectListByWhere("where 1=1 " -// + " order by morder "); -// if(wlist!=null&&wlist.size()>0){ -// DataVisualTextWarehouse dWarehouse=wlist.get(0); -// dataVisualContent.setWidth(dWarehouse.getWidth()); -// dataVisualContent.setHeight(dWarehouse.getHeight()); -// dataVisualContent.setStyle(dWarehouse.getStyle()); -// -// dataVisualText.setFontsize(dWarehouse.getFontsize()); -// dataVisualText.setFontcolor(dWarehouse.getFontcolor()); -// dataVisualText.setFontweight(dWarehouse.getFontweight()); -// dataVisualText.setBackground(dWarehouse.getBackground()); -// dataVisualText.setTextalign("center"); -// dataVisualText.setTextheight(dWarehouse.getHeight()); -// }else{ - dataVisualContent.setWidth("240"); - dataVisualContent.setHeight("80"); - - dataVisualText.setFontsize(14); - dataVisualText.setFontcolor("#000000"); - dataVisualText.setFontweight(400); - dataVisualText.setBackground("transparent"); - dataVisualText.setTextalign("center"); - dataVisualText.setTextheight("80"); - dataVisualText.setValuemethod("nowTime"); -// } - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualTextService.save(dataVisualText); - -// int result = this.dataVisualTextService.save(dataVisualText); - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doTextCopy.do") - public ModelAndView doTextCopy(HttpServletRequest request, Model model) { - String contentId = request.getParameter("contentId"); - String id = request.getParameter("id"); - - DataVisualContent dataVisualContent = this.dataVisualContentService.selectById(contentId); - DataVisualText dataVisualText = this.dataVisualTextService.selectById(id); - - String newContentId=CommUtil.getUUID(); - dataVisualContent.setId(newContentId); - dataVisualContent.setPostx("100"); - dataVisualContent.setPosty("100"); - - dataVisualText.setId(CommUtil.getUUID()); - dataVisualText.setPid(newContentId); - - this.dataVisualContentService.save(dataVisualContent); - this.dataVisualTextService.save(dataVisualText); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualText") DataVisualText dataVisualText) { - int res = this.dataVisualTextService.update(dataVisualText); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualTextService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualTextService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DataVisualWeatherController.java b/src/com/sipai/controller/process/DataVisualWeatherController.java deleted file mode 100644 index 2a55e12a..00000000 --- a/src/com/sipai/controller/process/DataVisualWeatherController.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DataVisualWeather; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DataVisualWeatherService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/dataVisualWeather") -public class DataVisualWeatherController { - @Resource - private DataVisualWeatherService dataVisualWeatherService; - @Resource - private DataVisualContentService dataVisualContentService; - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - List list = this.dataVisualWeatherService.selectListByWhere("where 1=1 and pid='" + pid + "' "); - if(list!=null&&list.size()>0){ - DataVisualWeather dataVisualWeather = list.get(0); - model.addAttribute("result", JSONArray.fromObject(dataVisualWeather)); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/containerEdit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DataVisualContent dContent = this.dataVisualContentService.selectById(request.getParameter("contentId")); - model.addAttribute("dataVisualContent", dContent); - - if(dContent!=null){ - List list = this.dataVisualWeatherService.selectListByWhere("where 1=1 and pid='" + dContent.getId() + "' "); - if(list!=null&&list.size()>0){ - model.addAttribute("dataVisualWeather", list.get(0)); - } - } - - return "/process/dataVisualWeatherEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model) { - String frameId = request.getParameter("frameId"); - - DataVisualContent dataVisualContent = new DataVisualContent(); - String cntentId = CommUtil.getUUID(); - dataVisualContent.setId(cntentId); - dataVisualContent.setPid(frameId); - dataVisualContent.setPostx(request.getParameter("x")); - dataVisualContent.setPosty(request.getParameter("y")); - dataVisualContent.setWidth("120"); - dataVisualContent.setHeight("60"); - dataVisualContent.setType(DataVisualContent.Type_Weather); - dataVisualContent.setIsfull(DataVisualContent.Isfull_False); - dataVisualContent.setRefreshtime("0"); - dataVisualContent.setzIndex("90"); - if(request.getParameter("isTabSt")!=null&&request.getParameter("isTabSt").equals("true")){ - dataVisualContent.setIstab("true"); - }else{ - dataVisualContent.setIstab("false"); - } - this.dataVisualContentService.save(dataVisualContent); - - DataVisualWeather dataVisualWeather = new DataVisualWeather(); - dataVisualWeather.setId(CommUtil.getUUID()); - dataVisualWeather.setPid(cntentId); - dataVisualWeather.setBackground("transparent"); - dataVisualWeather.setType(DataVisualWeather.Type_Weather); - - this.dataVisualWeatherService.save(dataVisualWeather); - - model.addAttribute("result", CommUtil.toJson(dataVisualContent)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("dataVisualWeather") DataVisualWeather dataVisualWeather) { - int res = this.dataVisualWeatherService.update(dataVisualWeather); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.dataVisualWeatherService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.dataVisualWeatherService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DecisionExpertBaseController.java b/src/com/sipai/controller/process/DecisionExpertBaseController.java deleted file mode 100644 index 465ff8a2..00000000 --- a/src/com/sipai/controller/process/DecisionExpertBaseController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.service.process.DecisionExpertBaseTextService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/decisionExpertBase") -public class DecisionExpertBaseController { - @Resource - private DecisionExpertBaseService decisionExpertBaseService; - @Resource - private DecisionExpertBaseTextService decisionExpertBaseTextService; - - @RequestMapping("/treeList.do") - public String treeList(HttpServletRequest request, Model model) { - return "/process/decisionExpertBaseTreeList"; - } - - @RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { -// try { -// String unitId = request.getParameter("unitId"); -// List list = this.decisionExpertBaseService.selectListByWhere("w12here 1=1 and unitId='" + unitId + "' and id!='" + request.getParameter("ownId") + "' " -// + " order by morder"); -// -// String tree = this.decisionExpertBaseService.getTreeList(null, list); -// model.addAttribute("result", tree); -// } catch (Exception e) { -// System.out.println(e); -// } - - String unitId = request.getParameter("unitId"); - List list = this.decisionExpertBaseService.selectListByWhere("where 1=1 and unitId='" + unitId + "' and id!='" + request.getParameter("ownId") + "' " - + " order by morder"); - - String tree = this.decisionExpertBaseService.getTreeList(null, list); - model.addAttribute("result", tree); - - return "result"; - } - - @RequestMapping("/get4SelectPidJson.do") - public String get4SelectPidJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List list = this.decisionExpertBaseService.selectListByWhere("where 1=1 and unitId='" + unitId + "' and pid='-1' " - + " order by morder"); - - String tree = this.decisionExpertBaseService.getTreeList(null, list); - model.addAttribute("result", tree); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/process/decisionExpertBaseAdd"; - } - - @RequestMapping("/doedit.do") - public String containerEdit(HttpServletRequest request, Model model) { - DecisionExpertBase decisionExpertBase = this.decisionExpertBaseService.selectById(request.getParameter("id")); - model.addAttribute("decisionExpertBase", decisionExpertBase); - - return "/process/decisionExpertBaseEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DecisionExpertBase decisionExpertBase) { -// User cu = (User) request.getSession().getAttribute("cu"); - decisionExpertBase.setId(CommUtil.getUUID()); - int code = this.decisionExpertBaseService.save(decisionExpertBase); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("decisionExpertBase") DecisionExpertBase decisionExpertBase) { - int res = this.decisionExpertBaseService.update(decisionExpertBase); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - this.decisionExpertBaseTextService.deleteByWhere(" where pid='" + id + "' "); - int res = this.decisionExpertBaseService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.decisionExpertBaseService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/DecisionExpertBaseTextController.java b/src/com/sipai/controller/process/DecisionExpertBaseTextController.java deleted file mode 100644 index cb6298cb..00000000 --- a/src/com/sipai/controller/process/DecisionExpertBaseTextController.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.controller.process; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.process.DecisionExpertBaseText; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.process.DataVisualContentService; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.service.process.DecisionExpertBaseTextService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("/process/decisionExpertBaseText") -public class DecisionExpertBaseTextController { - @Resource - private DecisionExpertBaseTextService decisionExpertBaseTextService; - @Resource - private DecisionExpertBaseService decisionExpertBaseService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - - DecisionExpertBase DecisionExpertBase = this.decisionExpertBaseService.selectById(pid); - String mpid = DecisionExpertBase.getMpid(); - MPoint mPoint = this.mPointService.selectById(mpid); - - JSONArray jsonArray = new JSONArray(); - JSONObject j1 = new JSONObject(); - JSONObject j2 = new JSONObject(); - JSONObject j3 = new JSONObject(); - JSONObject j4 = new JSONObject(); - - if (mPoint != null) { - j1.put("type", DecisionExpertBaseText.Type_alarmmax); - j2.put("type", DecisionExpertBaseText.Type_alarmmin); - j3.put("type", DecisionExpertBaseText.Type_halarmmax); - j4.put("type", DecisionExpertBaseText.Type_lalarmmin); - - List tlist1 = this.decisionExpertBaseTextService.selectListByWhere("where 1=1 and pid='" + pid + "' and type='" + DecisionExpertBaseText.Type_alarmmax + "' " - + " order by type"); - if (tlist1 != null && tlist1.size() > 0) { - j1.put("text", tlist1.get(0).getText()); - } else { - j1.put("text", ""); - } - List tlist2 = this.decisionExpertBaseTextService.selectListByWhere("where 1=1 and pid='" + pid + "' and type='" + DecisionExpertBaseText.Type_alarmmin + "' " - + " order by type"); - if (tlist2 != null && tlist2.size() > 0) { - j2.put("text", tlist2.get(0).getText()); - } else { - j2.put("text", ""); - } - List tlist3 = this.decisionExpertBaseTextService.selectListByWhere("where 1=1 and pid='" + pid + "' and type='" + DecisionExpertBaseText.Type_halarmmax + "' " - + " order by type"); - if (tlist3 != null && tlist3.size() > 0) { - j3.put("text", tlist3.get(0).getText()); - } else { - j3.put("text", ""); - } - List tlist4 = this.decisionExpertBaseTextService.selectListByWhere("where 1=1 and pid='" + pid + "' and type='" + DecisionExpertBaseText.Type_lalarmmin + "' " - + " order by type"); - if (tlist4 != null && tlist4.size() > 0) { - j4.put("text", tlist4.get(0).getText()); - } else { - j4.put("text", ""); - } - - if (mPoint.getAlarmmax() != null) { - j1.put("value", mPoint.getAlarmmax()); - } else { - j1.put("value", ""); - } - - if (mPoint.getAlarmmin() != null) { - j2.put("value", mPoint.getAlarmmin()); - } else { - j2.put("value", ""); - } - - if (mPoint.getHalarmmax() != null) { - j3.put("value", mPoint.getHalarmmax()); - } else { - j3.put("value", ""); - } - - if (mPoint.getLalarmmin() != null) { - j4.put("value", mPoint.getLalarmmin()); - } else { - j4.put("value", ""); - } - } - - jsonArray.add(j1); - jsonArray.add(j2); - jsonArray.add(j3); - jsonArray.add(j4); - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/getJsonTextAll.do") - public String getJsonTextAll(HttpServletRequest request, Model model) { - String wherestr = " where 1 = 1 "; - String pid = request.getParameter("pid"); - // 测点条件 - String search_code = request.getParameter("search_code"); - // 决策条件 - String search_name = request.getParameter("search_name"); - if (StringUtils.isNotBlank(pid)) { -// List decisionExpertBases = this.decisionExpertBaseService.selectListByWhere("where 1=1 "); -// if(!",".equals(pid.charAt(pid.length() - 1))){ -// pid = pid+","; -// } -// String pids = this.decisionExpertBaseTextService.getChildren(pid); - List childrenById = this.decisionExpertBaseTextService.getChildrenById(pid); -// if(pids!=null && !pids.isEmpty()){ -// pids = pids.substring(0, pids.length()-1); -// } -// pids = pids.replace(",","','"); -// wherestr += " and id in ('"+pids+"') "; - - String ids = ""; - for (DecisionExpertBase decisionExpertBase : childrenById) { - ids += "'" + decisionExpertBase.getId() + "',"; - } - if (ids != "") { - ids = ids.substring(0, ids.length() - 1); - wherestr += " and id in (" + ids + ") "; - } - } - - if (StringUtils.isNotBlank(search_code)) { - wherestr += " and name like '%" + search_code +"%'"; - } - - // 返回结果集 - JSONArray jsonArray = new JSONArray(); - // 根据条件查出所有的数据 - List decisionExpertBases = decisionExpertBaseService.selectListByWhere(wherestr); - for (DecisionExpertBase decisionExpertBase : decisionExpertBases) { - String mpid = decisionExpertBase.getMpid(); - try { - if (!DecisionExpertBase.Type_content.equals(decisionExpertBase.getType()) || StringUtils.isBlank(mpid)) { - continue; - } - MPoint mPoint = this.mPointService.selectById(mpid); - - if (mPoint != null) { - List types = new ArrayList<>(); - types.add(DecisionExpertBaseText.Type_alarmmax); - types.add(DecisionExpertBaseText.Type_alarmmin); - types.add(DecisionExpertBaseText.Type_halarmmax); - types.add(DecisionExpertBaseText.Type_lalarmmin); - - // 根据目前只存在四种限制则循环四次创建一条数据 - for (int i = 0; i < types.size(); i++) { - //新建一层数据 - JSONObject j = new JSONObject(); - // 名称 - j.put("name", decisionExpertBase.getName()); - // 点位名称 - j.put("mpointcode", mPoint.getMpointcode()); - // 主要作用 - j.put("mainrole", decisionExpertBase.getMainrole()); - // 类型 - j.put("type", types.get(i)); - String whereTextStr = "where 1=1 and pid='" + decisionExpertBase.getId() + "' and type='" + types.get(i) + "' " - + " and text != '' "; - // 决策内容 - if (StringUtils.isNotBlank(search_name)) { - whereTextStr += " and text like '%" +search_name + "%'"; - } - List tlist = this.decisionExpertBaseTextService.selectListByWhere(whereTextStr); - if (tlist != null && tlist.size() > 0) { - j.put("text", tlist.get(0).getText()); - } else { - // 如果为空跳出当前循环 - continue; - } - - if (mPoint.getAlarmmax() != null && types.get(i).equals(DecisionExpertBaseText.Type_alarmmax)) { - j.put("value", mPoint.getAlarmmax()); - } - else if (mPoint.getAlarmmin() != null && types.get(i).equals(DecisionExpertBaseText.Type_alarmmin)) { - j.put("value", mPoint.getAlarmmin()); - } - else if (mPoint.getHalarmmax() != null && types.get(i).equals(DecisionExpertBaseText.Type_halarmmax)) { - j.put("value", mPoint.getHalarmmax()); - } - else if (mPoint.getLalarmmin() != null && types.get(i).equals(DecisionExpertBaseText.Type_lalarmmin)) { - j.put("value", mPoint.getLalarmmin()); - } else { - j.put("value", ""); - } - - jsonArray.add(j); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/process/decisionExpertBaseTextAdd"; - } - - @RequestMapping("/doedit.do") - public String containerEdit(HttpServletRequest request, Model model) { - List tlist = this.decisionExpertBaseTextService.selectListByWhere("where 1=1 and pid='" + request.getParameter("pid") + "' and type='" + request.getParameter("type") + "' " - + " order by type"); - - DecisionExpertBaseText decisionExpertBaseText = new DecisionExpertBaseText(); - if (tlist != null && tlist.size() > 0) { - decisionExpertBaseText = tlist.get(0); - - } - - model.addAttribute("decisionExpertBaseText", decisionExpertBaseText); - return "/process/decisionExpertBaseTextEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute DecisionExpertBaseText decisionExpertBaseText) { -// User cu = (User) request.getSession().getAttribute("cu"); - decisionExpertBaseText.setId(CommUtil.getUUID()); - int code = this.decisionExpertBaseTextService.save(decisionExpertBaseText); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("decisionExpertBaseText") DecisionExpertBaseText decisionExpertBaseText) { - int res = this.decisionExpertBaseTextService.update(decisionExpertBaseText); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.decisionExpertBaseTextService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.decisionExpertBaseTextService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/EquipmentAdjustmentController.java b/src/com/sipai/controller/process/EquipmentAdjustmentController.java deleted file mode 100644 index a43609fa..00000000 --- a/src/com/sipai/controller/process/EquipmentAdjustmentController.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.sipai.controller.process; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.process.EquipmentAdjustment; -import com.sipai.entity.user.Company; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.process.EquipmentAdjustmentService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/process/equipmentAdjustment") -public class EquipmentAdjustmentController { - @Resource - private EquipmentAdjustmentService equipmentAdjustmentService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - if (request.getParameter("userName") != null) { - User cu = userService.getUserByLoginName(request.getParameter("userName")); - if (cu != null) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - } - return "/process/equipmentAdjustmentList"; - } - - @RequestMapping("/showlistFeedback.do") - public String showlistFeedback(HttpServletRequest request, Model model) { - return "/process/equipmentAdjustmentListFeedback"; - } - - @RequestMapping("/showlistView.do") - public String showlistView(HttpServletRequest request, Model model) { - return "/process/equipmentAdjustmentListView"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id= '" + request.getParameter("unitId") + "' "; - } - String type = request.getParameter("type"); - if (type != null && !type.isEmpty()) { - switch (type) { - case "0": - wherestr += " and (status is null or status= '" + EquipmentAdjustment.Status_NotStart + "') "; - break; - case "1": - wherestr += " and status = '" + EquipmentAdjustment.Status_Start + "'"; - break; - case "2": - wherestr += " and status = '" + EquipmentAdjustment.Status_Finish + "'"; - break; - default: - } - } - PageHelper.startPage(page, rows); - List list = this.equipmentAdjustmentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(cu.getId()); - if (user != null) { - request.setAttribute("userId", user.getId()); - request.setAttribute("userName", user.getCaption()); - } - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "/process/equipmentAdjustmentAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute EquipmentAdjustment equipmentAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - equipmentAdjustment.setId(CommUtil.getUUID()); - equipmentAdjustment.setInsdt(CommUtil.nowDate()); - equipmentAdjustment.setApplyTime(equipmentAdjustment.getInsdt()); - equipmentAdjustment.setInsuser(userId); - equipmentAdjustment.setApplyUser(userId); - int code = this.equipmentAdjustmentService.save(equipmentAdjustment); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentAdjustment equipmentAdjustment = this.equipmentAdjustmentService.selectById(id); - model.addAttribute("equipmentAdjustment", equipmentAdjustment); - return "/process/equipmentAdjustmentEdit"; - } - - @RequestMapping("/feedback.do") - public String feedback(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentAdjustment equipmentAdjustment = this.equipmentAdjustmentService.selectById(id); - model.addAttribute("equipmentAdjustment", equipmentAdjustment); - return "/process/equipmentAdjustmentFeedback"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - EquipmentAdjustment equipmentAdjustment = this.equipmentAdjustmentService.selectById(id); - model.addAttribute("equipmentAdjustment", equipmentAdjustment); - return "/process/equipmentAdjustmentView"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute EquipmentAdjustment equipmentAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.equipmentAdjustmentService.update(equipmentAdjustment); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 提交 暂时没加流程 - * - * @param request - * @param model - * @param equipmentAdjustment - * @return - */ - @RequestMapping("/dosubmit.do") - public String dosubmit(HttpServletRequest request, Model model, - @ModelAttribute EquipmentAdjustment equipmentAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - equipmentAdjustment.setStatus(EquipmentAdjustment.Status_Start); - int code = this.equipmentAdjustmentService.update(equipmentAdjustment); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 反馈 暂时没加流程 - * - * @param request - * @param model - * @param equipmentAdjustment - * @return - */ - @RequestMapping("/dofeedback.do") - public String dofeedback(HttpServletRequest request, Model model, - @ModelAttribute EquipmentAdjustment equipmentAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - Result result = new Result(); - if (cu != null) { - String userId = cu.getId(); - equipmentAdjustment.setStatus(EquipmentAdjustment.Status_Finish); - equipmentAdjustment.setFeedbackUser(userId); - equipmentAdjustment.setFeedbackTime(CommUtil.nowDate()); - int code = this.equipmentAdjustmentService.update(equipmentAdjustment); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - } else { - result = Result.failed("请重新登录"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.equipmentAdjustmentService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.equipmentAdjustmentService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/process/EquipmentAdjustmentDetailController.java b/src/com/sipai/controller/process/EquipmentAdjustmentDetailController.java deleted file mode 100644 index bbfc4d0e..00000000 --- a/src/com/sipai/controller/process/EquipmentAdjustmentDetailController.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.sipai.controller.process; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.EquipmentAdjustmentDetail; -import com.sipai.entity.user.User; -import com.sipai.service.process.EquipmentAdjustmentDetailService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/process/equipmentAdjustmentDetail") -public class EquipmentAdjustmentDetailController { - @Resource - private EquipmentAdjustmentDetailService equipmentAdjustmentDetailService; - -// @RequestMapping("/showlist.do") -// public String showlist(HttpServletRequest request,Model model) { -// return "/process/equipmentAdjustmentDetailList"; -// } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 "; - - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid= '"+request.getParameter("pid")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.equipmentAdjustmentDetailService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/process/equipmentAdjustmentDetailAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAdjustmentDetail equipmentAdjustmentDetail){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - equipmentAdjustmentDetail.setId(CommUtil.getUUID()); - equipmentAdjustmentDetail.setInsdt(CommUtil.nowDate()); - equipmentAdjustmentDetail.setInsuser(userId); - int code = this.equipmentAdjustmentDetailService.save(equipmentAdjustmentDetail); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - EquipmentAdjustmentDetail equipmentAdjustmentDetail = this.equipmentAdjustmentDetailService.selectById(id); - model.addAttribute("equipmentAdjustmentDetail", equipmentAdjustmentDetail); - return "/process/equipmentAdjustmentDetailEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentAdjustmentDetail equipmentAdjustmentDetail){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.equipmentAdjustmentDetailService.update(equipmentAdjustmentDetail); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.equipmentAdjustmentDetailService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.equipmentAdjustmentDetailService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/process/LibraryProcessAbnormalController.java b/src/com/sipai/controller/process/LibraryProcessAbnormalController.java deleted file mode 100644 index 13f9abce..00000000 --- a/src/com/sipai/controller/process/LibraryProcessAbnormalController.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessAbnormal; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessAbnormalService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/libraryProcessAbnormal") -public class LibraryProcessAbnormalController { - @Resource - private LibraryProcessAbnormalService libraryProcessAbnormalService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/libraryProcessAbnormalList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String classId = request.getParameter("classId"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - String wherestr = "where 1=1 "; - if (classId != null && !classId.trim().equals("")) { - wherestr += " and pid = '" + classId + "' "; - } - if (unitId != null && !unitId.trim().equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryProcessAbnormalService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryProcessAbnormalAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessAbnormal libraryProcessAbnormal = this.libraryProcessAbnormalService.selectById(id); - model.addAttribute("libraryProcessAbnormal", libraryProcessAbnormal); - return "process/libraryProcessAbnormalEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessAbnormal libraryProcessAbnormal = this.libraryProcessAbnormalService.selectById(id); - model.addAttribute("libraryProcessAbnormal", libraryProcessAbnormal); - return "process/libraryProcessAbnormalView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessAbnormal") LibraryProcessAbnormal libraryProcessAbnormal) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.libraryProcessAbnormalService.save(libraryProcessAbnormal); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessAbnormal") LibraryProcessAbnormal libraryProcessAbnormal) { - int result = this.libraryProcessAbnormalService.update(libraryProcessAbnormal); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryProcessAbnormalService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryProcessAbnormalService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 获取下拉异常数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSelectList4Abnormal.do") - public String getSelectList4Abnormal(HttpServletRequest request, Model model) { - String typeId = request.getParameter("typeId"); - String unitId = request.getParameter("unitId"); - String wherestr = "where 1=1"; - - if (typeId != null && !typeId.equals("")) { - wherestr += " and pid = '" + typeId + "'"; - } - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "'"; - } - - List list = this.libraryProcessAbnormalService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - for (LibraryProcessAbnormal libraryProcessAbnormal : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", libraryProcessAbnormal.getAbnormalName()); - jsonObject.put("text", libraryProcessAbnormal.getAbnormalName()); - jsonObject.put("abnormalCode", libraryProcessAbnormal.getAbnormalCode()); - jsonObject.put("abnormalName", libraryProcessAbnormal.getAbnormalName()); - jsonObject.put("abnormalAnalysis", libraryProcessAbnormal.getAbnormalAnalysis()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 赋值异常其他字段 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSelectList4Id.do") - public String getSelectList4Id(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String wherestr = "where 1=1"; - - if (id != null && !id.equals("")) { - wherestr += " and abnormal_name = '" + id + "'"; - } else { - wherestr += " and 1=2 "; - } - - List list = this.libraryProcessAbnormalService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - for (LibraryProcessAbnormal libraryProcessAbnormal : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", libraryProcessAbnormal.getAbnormalName()); - jsonObject.put("text", libraryProcessAbnormal.getAbnormalName()); - jsonObject.put("abnormalCode", libraryProcessAbnormal.getAbnormalCode()); - jsonObject.put("abnormalName", libraryProcessAbnormal.getAbnormalName()); - jsonObject.put("abnormalAnalysis", libraryProcessAbnormal.getAbnormalAnalysis()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray); - return "result"; - } -} diff --git a/src/com/sipai/controller/process/LibraryProcessAdjustmentController.java b/src/com/sipai/controller/process/LibraryProcessAdjustmentController.java deleted file mode 100644 index 3ddab735..00000000 --- a/src/com/sipai/controller/process/LibraryProcessAdjustmentController.java +++ /dev/null @@ -1,437 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.process.LibraryProcessAbnormal; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.ProcessAdjustmentType; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessAbnormalService; -import com.sipai.service.process.LibraryProcessAdjustmentService; -import com.sipai.service.process.ProcessAdjustmentTypeService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/process/libraryProcessAdjustment") -public class LibraryProcessAdjustmentController { - @Resource - private LibraryProcessAdjustmentService libraryProcessAdjustmentService; - @Resource - private ProcessAdjustmentTypeService processAdjustmentTypeService; - @Resource - private LibraryProcessAbnormalService libraryProcessAbnormalService; - - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request, Model model) { - return "/process/libraryProcessAdjustment4Tree"; - } - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/libraryProcessAdjustmentList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - String classId = request.getParameter("classId"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - String wherestr = "where 1=1 "; - if (pid != null && !pid.trim().equals("")) { - wherestr += " and pid = '" + pid + "' "; - } else { - List list = libraryProcessAbnormalService.selectListByWhere("where pid = '" + classId + "'"); - String ids = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - ids += "'" + list.get(i).getId() + "',"; - } - } - if (ids != null && !ids.trim().equals("")) { - ids = ids.substring(0, ids.length() - 1); - wherestr += " and pid in (" + ids + ")"; - } else { - wherestr += " and pid = '-99' "; - } - } - if (unitId != null && !unitId.trim().equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryProcessAdjustmentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryProcessAdjustmentAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessAdjustment libraryProcessAdjustment = this.libraryProcessAdjustmentService.selectById(id); - model.addAttribute("libraryProcessAdjustment", libraryProcessAdjustment); - return "process/libraryProcessAdjustmentEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessAdjustment libraryProcessAdjustment = this.libraryProcessAdjustmentService.selectById(id); - model.addAttribute("libraryProcessAdjustment", libraryProcessAdjustment); - return "process/libraryProcessAdjustmentView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessAdjustment") LibraryProcessAdjustment libraryProcessAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.libraryProcessAdjustmentService.save(libraryProcessAdjustment); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessAdjustment") LibraryProcessAdjustment libraryProcessAdjustment) { - int result = this.libraryProcessAdjustmentService.update(libraryProcessAdjustment); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryProcessAdjustmentService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryProcessAdjustmentService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/library4Select.do") - public String library4Select(HttpServletRequest request, Model model) { - String libraryIds = request.getParameter("libraryIds"); - String whereStr = "where id in ('" + libraryIds.replace(",", "','") + "')";// and bizId = '"+bizId+"' - List list = this.libraryProcessAdjustmentService.selectListByWhere(whereStr); - model.addAttribute("librarys", JSONArray.fromObject(list)); - return "process/libraryProcessAdjustment4Select"; - } - - @RequestMapping("/getList4Select.do") - public ModelAndView getList4Select(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("classId"); - String unitId = request.getParameter("unitId"); - String abnormalName = request.getParameter("abnormalName"); - - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by pid asc"; - String wherestr = "where 1=1 "; - if (pid != null && !pid.trim().equals("")) { - wherestr += " and pid = '" + pid + "' "; - } - if (unitId != null && !unitId.trim().equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } -// if (abnormalName != null && !abnormalName.trim().equals("")) { -// wherestr += " and abnormal_name = '" + abnormalName + "' "; -// } - - String ids = ""; - List list1 = libraryProcessAbnormalService.selectListByWhere(wherestr); - if (list1 != null && list1.size() > 0) { - for (int i = 0; i < list1.size(); i++) { - ids += "'" + list1.get(i).getId() + "',"; - } - } - if (ids != null && !ids.trim().equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - - List list = this.libraryProcessAdjustmentService.selectListByWhere("where pid in (" + ids + ")" + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导出excel表 的 模板 - * - * @throws IOException - */ - @RequestMapping("/downloadExcelTemplate.do") - public ModelAndView downloadExcelTemplate(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String fileName = "运行工单工艺调整库模板.xls"; - String title = "运行工单工艺调整库"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 -// HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - - List clist = this.processAdjustmentTypeService.selectListByWhere(" where 1=1 order by morder "); - if (clist != null && clist.size() > 0) { - for (ProcessAdjustmentType processAdjustmentType : clist) { - String typeName = processAdjustmentType.getName(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(typeName); - - String excelTitleStr = "序号,异常编号,异常名称,异常现象分析,工艺调整代码,工艺调整名称,接单额定工时,工艺调整措施,工艺调整监控指标,工艺调整验收标准"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 700); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - // 设置表格每列的宽度 - if (i == 0) { - sheet.setColumnWidth(i, 3000); - } else { - sheet.setColumnWidth(i, 6000); - } - - } - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("运行工单工艺调整库-" + typeName); - } - } - - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - return null; - } - - /** - * 导入excel后处理,保存数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = libraryProcessAdjustmentService.readXls(excelFile.getInputStream(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导出excel表 的 模板 - * - * @throws IOException - */ - @RequestMapping("/outExcelFun.do") - public ModelAndView outExcelFun(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String unitId = request.getParameter("unitId"); - - this.libraryProcessAdjustmentService.outExcelTemplate(response, unitId); - return null; - } - - /** - * 导入选择界面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelFun.do") - public String importSelect(HttpServletRequest request, Model model) { - return "/process/libraryProcessAdjustmentImportSelect"; - } -} diff --git a/src/com/sipai/controller/process/LibraryProcessManageController.java b/src/com/sipai/controller/process/LibraryProcessManageController.java deleted file mode 100644 index 6159e562..00000000 --- a/src/com/sipai/controller/process/LibraryProcessManageController.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessManage; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessManageService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/libraryProcessManage") -public class LibraryProcessManageController { - @Resource - private LibraryProcessManageService libraryProcessManageService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "process/libraryProcessManageList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null) { - sort = " code "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryProcessManageService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryProcessManageAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessManage libraryProcessManage = this.libraryProcessManageService.selectById(id); - model.addAttribute("libraryProcessManage", libraryProcessManage); - return "process/libraryProcessManageEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManage") LibraryProcessManage libraryProcessManage) { - User cu = (User) request.getSession().getAttribute("cu"); -// libraryProcessManage.setInsdt(CommUtil.nowDate()); -// libraryProcessManage.setInsuser(cu.getId()); - int result = this.libraryProcessManageService.save(libraryProcessManage); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManage") LibraryProcessManage libraryProcessManage) { - int result = this.libraryProcessManageService.update(libraryProcessManage); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryProcessManageService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("淇濆瓨澶辫触"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryProcessManageService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("淇濆瓨澶辫触"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/LibraryProcessManageDetailController.java b/src/com/sipai/controller/process/LibraryProcessManageDetailController.java deleted file mode 100644 index a25d7de0..00000000 --- a/src/com/sipai/controller/process/LibraryProcessManageDetailController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessManageDetail; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessManageDetailService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/libraryProcessManageDetail") -public class LibraryProcessManageDetailController { - @Resource - private LibraryProcessManageDetailService libraryProcessManageDetailService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "process/libraryProcessManageDetailList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 "; - - if (pid != null && !pid.equals("")) { - wherestr += " and pid = '" + pid + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryProcessManageDetailService.selectListByWhere(wherestr + orderstr, unitId); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("uuId2", CommUtil.getUUID()); - return "process/libraryProcessManageDetailAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "unitId") String unitId) { - LibraryProcessManageDetail libraryProcessManageDetail = this.libraryProcessManageDetailService.selectById(id, unitId); - model.addAttribute("libraryProcessManageDetail", libraryProcessManageDetail); - return "process/libraryProcessManageDetailEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageDetail") LibraryProcessManageDetail libraryProcessManageDetail) { - User cu = (User) request.getSession().getAttribute("cu"); -// libraryProcessManageDetail.setInsdt(CommUtil.nowDate()); -// libraryProcessManageDetail.setInsuser(cu.getId()); - int result = this.libraryProcessManageDetailService.save(libraryProcessManageDetail); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageDetail") LibraryProcessManageDetail libraryProcessManageDetail) { - int result = this.libraryProcessManageDetailService.update(libraryProcessManageDetail); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryProcessManageDetailService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryProcessManageDetailService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } -} diff --git a/src/com/sipai/controller/process/LibraryProcessManageTypeController.java b/src/com/sipai/controller/process/LibraryProcessManageTypeController.java deleted file mode 100644 index 2421bd7b..00000000 --- a/src/com/sipai/controller/process/LibraryProcessManageTypeController.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.sipai.controller.process; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.LibraryProcessManageType; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessManageTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/process/libraryProcessManageType") -public class LibraryProcessManageTypeController { - @Resource - private LibraryProcessManageTypeService libraryProcessManageTypeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/process/libraryProcessManageTypeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - //wherestr += " and unit_id = '"+unitId+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryProcessManageTypeService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryProcessManageTypeAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessManageType libraryProcessManageType = this.libraryProcessManageTypeService.selectById(id); - model.addAttribute("libraryProcessManageType", libraryProcessManageType); - return "process/libraryProcessManageTypeEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageType") LibraryProcessManageType libraryProcessManageType) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryProcessManageType.setInsdt(CommUtil.nowDate()); - libraryProcessManageType.setInsuser(cu.getId()); - int result = this.libraryProcessManageTypeService.save(libraryProcessManageType); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageType") LibraryProcessManageType libraryProcessManageType) { - int result = this.libraryProcessManageTypeService.update(libraryProcessManageType); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryProcessManageTypeService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryProcessManageTypeService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 order by morder asc"; - List list = this.libraryProcessManageTypeService.selectListByWhere(wherestr); - String json = libraryProcessManageTypeService.getTreeListtest(list); - Result result = Result.success(json); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getSelectList.do") - public String getSelectList(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 order by morder asc"; - List list = this.libraryProcessManageTypeService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - for (LibraryProcessManageType libraryProcessManageType : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", libraryProcessManageType.getId()); - jsonObject.put("text", libraryProcessManageType.getName()); - jsonObject.put("code", libraryProcessManageType.getCode()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray); - return "result"; - } - - /** - * 赋值异常其他字段 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSelectList4Id.do") - public String getSelectList4Id(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String wherestr = "where 1=1"; - - if (id != null && !id.equals("")) { - wherestr += " and id = '" + id + "'"; - } - - List list = this.libraryProcessManageTypeService.selectListByWhere(wherestr); JSONArray jsonArray = new JSONArray(); - for (LibraryProcessManageType libraryProcessManageType : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", libraryProcessManageType.getId()); - jsonObject.put("text", libraryProcessManageType.getName()); - jsonObject.put("code", libraryProcessManageType.getCode()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray); - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/LibraryProcessManageWorkOrderController.java b/src/com/sipai/controller/process/LibraryProcessManageWorkOrderController.java deleted file mode 100644 index 3dbe9252..00000000 --- a/src/com/sipai/controller/process/LibraryProcessManageWorkOrderController.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.sipai.controller.process; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessManageWorkOrder; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessManageWorkOrderService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/process/libraryProcessManageWorkOrder") -public class LibraryProcessManageWorkOrderController { - @Resource - private LibraryProcessManageWorkOrderService libraryProcessManageWorkOrderService; - - @RequestMapping("/showListForExec.do") - public String showListForExec(HttpServletRequest request, Model model) { - return "/process/libraryProcessManageWorkOrderListForExec"; - } - - @RequestMapping("/showListForReview.do") - public String showListForReview(HttpServletRequest request, Model model) { - return "/process/libraryProcessManageWorkOrderListForReview"; - } - - @RequestMapping("/showListForRecord.do") - public String showListForRecord(HttpServletRequest request, Model model) { - return "/process/libraryProcessManageWorkOrderListForRecord"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - - String wherestr = "where 1=1 and (insuser='"+cu.getId()+"' or issueder='"+cu.getId()+"')"; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '"+unitId+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryProcessManageWorkOrderService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryProcessManageWorkOrderAdd"; - } - - @RequestMapping("/doExec.do") - public String doExec(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessManageWorkOrder libraryProcessManageWorkOrder = this.libraryProcessManageWorkOrderService.selectById(id); - model.addAttribute("libraryProcessManageWorkOrder", libraryProcessManageWorkOrder); - return "process/libraryProcessManageWorkOrderExec"; - } - - @RequestMapping("/doReview.do") - public String doReview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessManageWorkOrder libraryProcessManageWorkOrder = this.libraryProcessManageWorkOrderService.selectById(id); - model.addAttribute("libraryProcessManageWorkOrder", libraryProcessManageWorkOrder); - return "process/libraryProcessManageWorkOrderReview"; - } - - @RequestMapping("/doView.do") - public String doView(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryProcessManageWorkOrder libraryProcessManageWorkOrder = this.libraryProcessManageWorkOrderService.selectById(id); - model.addAttribute("libraryProcessManageWorkOrder", libraryProcessManageWorkOrder); - return "process/libraryProcessManageWorkOrderView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageWorkOrder") LibraryProcessManageWorkOrder libraryProcessManageWorkOrder) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryProcessManageWorkOrder.setInsdt(CommUtil.nowDate()); - libraryProcessManageWorkOrder.setInsuser(cu.getId()); - int result = this.libraryProcessManageWorkOrderService.save(libraryProcessManageWorkOrder); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageWorkOrder") LibraryProcessManageWorkOrder libraryProcessManageWorkOrder) { - int result = this.libraryProcessManageWorkOrderService.update(libraryProcessManageWorkOrder); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - LibraryProcessManageWorkOrder libraryProcessManageWorkOrder = this.libraryProcessManageWorkOrderService.selectById(id); - if(!libraryProcessManageWorkOrder.getStatus().equals(LibraryProcessManageWorkOrder.Status_0)){ - Result result = Result.failed("无法删除已提交记录!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - int res = this.libraryProcessManageWorkOrderService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryProcessManageWorkOrderService.deleteByWhere("where id in('" + ids + "') and status='"+LibraryProcessManageWorkOrder.Status_0+"' "); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/downWorkOrder.do") - public String downWorkOrder(HttpServletRequest request, Model model) { - - return "process/libraryProcessManageWorkOrderDown"; - } - - @RequestMapping("/doIssued.do") - public String doIssued(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - String[] idlist=ids.split(","); - - for (String wid : idlist) { - LibraryProcessManageWorkOrder lWorkOrder = new LibraryProcessManageWorkOrder(); - lWorkOrder.setId(CommUtil.getUUID()); - lWorkOrder.setWarehouseId(wid); - lWorkOrder.setInsuser(cu.getId()); - lWorkOrder.setInsdt(CommUtil.nowDate()); - lWorkOrder.setStatus(LibraryProcessManageWorkOrder.Status_0); - lWorkOrder.setUnitId(unitId); - lWorkOrder.setIssueder(request.getParameter("downPeopleId")); - int res = this.libraryProcessManageWorkOrderService.save(lWorkOrder); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("插入失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - - } - - return "result"; - } - - @RequestMapping("/doSubmit.do") - public String doSubmit(HttpServletRequest request, Model model, - @ModelAttribute("libraryProcessManageWorkOrder") LibraryProcessManageWorkOrder lWorkOrder) { - User cu = (User) request.getSession().getAttribute("cu"); - - lWorkOrder.setReviewer(lWorkOrder.getInsuser()); - lWorkOrder.setReviewtime(CommUtil.nowDate()); - lWorkOrder.setStatus(LibraryProcessManageWorkOrder.Status_1); - int res = this.libraryProcessManageWorkOrderService.update(lWorkOrder); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("提交失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/LibraryRoutineWorkController.java b/src/com/sipai/controller/process/LibraryRoutineWorkController.java deleted file mode 100644 index 83e07b87..00000000 --- a/src/com/sipai/controller/process/LibraryRoutineWorkController.java +++ /dev/null @@ -1,383 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.administration.OrganizationClass; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryRoutineWork; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.service.administration.OrganizationClassService; -import com.sipai.service.process.LibraryRoutineWorkService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.DVConstraint; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFDataValidation; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/process/libraryRoutineWork") -public class LibraryRoutineWorkController { - @Resource - private LibraryRoutineWorkService libraryRoutineWorkService; - @Resource - private OrganizationClassService organizationClassService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/libraryRoutineWorkList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String typestr = request.getParameter("typestr"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by work_code asc"; - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - if (typestr != null && !typestr.equals("")) { - wherestr += " and type = '" + typestr + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryRoutineWorkService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryRoutineWorkAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryRoutineWork libraryRoutineWork = this.libraryRoutineWorkService.selectById(id); - model.addAttribute("libraryRoutineWork", libraryRoutineWork); - return "process/libraryRoutineWorkEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryRoutineWork libraryRoutineWork = this.libraryRoutineWorkService.selectById(id); - model.addAttribute("libraryRoutineWork", libraryRoutineWork); - return "process/libraryRoutineWorkView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryRoutineWork") LibraryRoutineWork libraryRoutineWork) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryRoutineWork.setInsdt(CommUtil.nowDate()); - libraryRoutineWork.setInsuser(cu.getId()); - int result = this.libraryRoutineWorkService.save(libraryRoutineWork); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryRoutineWork") LibraryRoutineWork libraryRoutineWork) { - int result = this.libraryRoutineWorkService.update(libraryRoutineWork); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryRoutineWorkService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryRoutineWorkService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - //单选设备 - @RequestMapping("/showlist4Choice.do") - public String showlist4Choice(HttpServletRequest request, Model model) { - return "/process/libraryRoutineWorkList4Choice"; - } - - /** - * 导入选择界面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelFun.do") - public String importSelect(HttpServletRequest request, Model model) { - return "/process/libraryRoutineWorkImportSelect"; - } - - /** - * 导出excel表 的 模板 - * - * @throws IOException - */ - @RequestMapping("/downloadExcelTemplate.do") - public ModelAndView downloadExcelTemplate(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String fileName = "常规工单常规库模板.xls"; - String title = "常规工单常规库"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,工作类型,工作编号,工作名称,工作内容,评价标准及文件,定额工时,定额费用,需要人数,需要技能等级,是否可抢单(是、否)"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 700); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - // 设置表格每列的宽度 - if (i == 0) { - sheet.setColumnWidth(i, 3000); - } else { - sheet.setColumnWidth(i, 6000); - } - - } - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("常规工单常规库"); - - List olist = this.organizationClassService.selectListByWhere("where type='"+OrganizationClass.Type_1+"' order by code"); - if(olist!=null&&olist.size()>0){ - //设置下拉控制的范围 - @SuppressWarnings("deprecation") - CellRangeAddressList regions = new CellRangeAddressList(2, 9999, 1,1); - // 生成下拉框内容 - String[] strings = new String[olist.size()]; - for(int s=0;s statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - String datatype = request.getParameter("type"); - //根据excel类型取数据 - if ("xls".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = libraryRoutineWorkService.readXls(excelFile.getInputStream(), unitId, datatype); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导出excel表 的 模板 - * - * @throws IOException - */ - @RequestMapping("/outExcelFun.do") - public ModelAndView outExcelFun(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String unitId = request.getParameter("unitId"); - String datatype = request.getParameter("type"); - - this.libraryRoutineWorkService.outExcelTemplate(response, unitId, datatype); - return null; - } - - @RequestMapping("/job4Select.do") - public String job4Select(HttpServletRequest request, Model model) { - - return "/process/libraryRoutineWorkJob4Select"; - } -} diff --git a/src/com/sipai/controller/process/LibraryWaterTestController.java b/src/com/sipai/controller/process/LibraryWaterTestController.java deleted file mode 100644 index 99f56c20..00000000 --- a/src/com/sipai/controller/process/LibraryWaterTestController.java +++ /dev/null @@ -1,346 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryWaterTest; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryWaterTestService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/process/libraryWaterTest") -public class LibraryWaterTestController { - @Resource - private LibraryWaterTestService libraryWaterTestService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/libraryWaterTestList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if(unitId!=null && !unitId.equals("")){ - wherestr += " and unit_id = '"+unitId+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.libraryWaterTestService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/libraryWaterTestAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryWaterTest libraryWaterTest = this.libraryWaterTestService.selectById(id); - model.addAttribute("libraryWaterTest", libraryWaterTest); - return "process/libraryWaterTestEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - LibraryWaterTest libraryWaterTest = this.libraryWaterTestService.selectById(id); - model.addAttribute("libraryWaterTest", libraryWaterTest); - return "process/libraryWaterTestView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("libraryWaterTest") LibraryWaterTest libraryWaterTest) { - User cu = (User) request.getSession().getAttribute("cu"); - libraryWaterTest.setInsdt(CommUtil.nowDate()); - libraryWaterTest.setInsuser(cu.getId()); - libraryWaterTest.setCode(""); -// libraryWaterTest.setName(""); - int result = this.libraryWaterTestService.save(libraryWaterTest); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("libraryWaterTest") LibraryWaterTest libraryWaterTest) { - libraryWaterTest.setCode(""); -// libraryWaterTest.setName(""); - int result = this.libraryWaterTestService.update(libraryWaterTest); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.libraryWaterTestService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.libraryWaterTestService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/showList4Choice.do") - public String showList4Choice(HttpServletRequest request, Model model) { - return "/process/libraryWaterTestList4Choice"; - } - - /** - * 导入选择界面 - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelFun.do") - public String importSelect(HttpServletRequest request,Model model){ - return "/process/libraryWaterTestImportSelect"; - } - - /** - * 导出excel表 的 模板 - * @throws IOException - */ - @RequestMapping("/downloadExcelTemplate.do") - public ModelAndView downloadExcelTemplate(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String fileName = "运行工单水质化验库模板.xls"; - String title = "运行工单水质化验库"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,化验指标名称,额定工时(小时),额定费用(元),化验方法,安全注意事项"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 700); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - // 设置表格每列的宽度 - if(i==0){ - sheet.setColumnWidth(i, 3000); - }else{ - sheet.setColumnWidth(i, 6000); - } - - } - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("运行工单水质化验库"); - - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - return null; - } - - /** - * 导入excel后处理,保存数据 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = libraryWaterTestService.readXls(excelFile.getInputStream(),unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 导出excel表 的 模板 - * @throws IOException - */ - @RequestMapping("/outExcelFun.do") - public ModelAndView outExcelFun(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String unitId=request.getParameter("unitId"); - - this.libraryWaterTestService.outExcelTemplate(response,unitId); - return null; - } -} diff --git a/src/com/sipai/controller/process/MeterCheckController.java b/src/com/sipai/controller/process/MeterCheckController.java deleted file mode 100644 index d61a723c..00000000 --- a/src/com/sipai/controller/process/MeterCheckController.java +++ /dev/null @@ -1,385 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.alarm.AlarmLevelsCodeEnum; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.MeterCheck; -import com.sipai.entity.process.MeterCheckLibrary; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.user.User; -import com.sipai.service.process.MeterCheckLibraryService; -import com.sipai.service.process.MeterCheckService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.List; - -@Controller -@RequestMapping("/process/meterCheck") -public class MeterCheckController { - @Resource - private MeterCheckService meterCheckService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MeterCheckLibraryService meterCheckLibraryService; - @Resource - private ProAlarmService proAlarmService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "process/meterCheckList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null) { - sort = " code "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and m.unit_id = '" + unitId + "' "; - } - if (request.getParameter("searchName") != null && request.getParameter("searchName").length() > 0) { - wherestr += " and ml.name like '%" + request.getParameter("searchName") + "%' "; - } - if (request.getParameter("sdt") != null && request.getParameter("sdt").length() > 0 && request.getParameter("edt") != null && request.getParameter("edt").length() > 0) { - wherestr += " and m.input_time between '" + request.getParameter("sdt").substring(0, 10) + " 00:00' and '" + request.getParameter("edt").substring(0, 10) + " 23:59' "; - } - - PageHelper.startPage(page, rows); - List list = this.meterCheckService.selectListLeftLibraryByWhere(wherestr + orderstr); - System.out.println(wherestr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/meterCheckAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - MeterCheck meterCheck = this.meterCheckService.selectById(id); - model.addAttribute("meterCheck", meterCheck); - return "process/meterCheckEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("meterCheck") MeterCheck meterCheck) { - User cu = (User) request.getSession().getAttribute("cu"); - meterCheck.setInputUser(cu.getId()); - - MeterCheckLibrary meterCheckLibrary = this.meterCheckLibraryService.selectById(meterCheck.getLibraryId()); - if (meterCheckLibrary != null) { - List mPointHistory = this.mPointHistoryService.selectAggregateList(meterCheck.getUnitId(), "tb_mp_" + meterCheckLibrary.getMpid(), " where MeasureDT<='" + meterCheck.getInputTime() + "' order by MeasureDT desc ", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() > 0) { - double mpValue = mPointHistory.get(0).getParmvalue().doubleValue(); - meterCheck.setMpValue(mpValue); - } - - MPoint mPoint = this.mPointService.selectById(meterCheckLibrary.getMpidRg()); - mPoint.setParmvalue(new BigDecimal(meterCheck.getInputValue())); - mPoint.setMeasuredt(meterCheck.getInputTime().substring(0, 16)); - this.mPointService.update2(mPoint.getBizid(), mPoint); - - List mPointHistory2 = this.mPointHistoryService.selectAggregateList(meterCheck.getUnitId(), "tb_mp_" + meterCheckLibrary.getMpidRg(), " where datediff(day,MeasureDT,'" + meterCheck.getInputTime().substring(0, 16) + "')=0 ", " top 1 * "); - MPointHistory mh = new MPointHistory(); - mh.setParmvalue(new BigDecimal(meterCheck.getInputValue())); - mh.setMeasuredt(meterCheck.getInputTime()); - mh.setTbName("tb_mp_" + meterCheckLibrary.getMpidRg()); - if (mPointHistory2 != null && mPointHistory2.size() > 0) { - this.mPointHistoryService.deleteByTableAWhere(mPoint.getBizid(), "tb_mp_" + meterCheckLibrary.getMpidRg(), " where datediff(day,MeasureDT,'" + meterCheck.getInputTime().substring(0, 16) + "')=0 "); - } - this.mPointHistoryService.save(mPoint.getBizid(), mh); - - String targetvalueType = MeterCheckLibrary.Targetvalue_Type_Percent; - if (meterCheckLibrary.getTargetvaluetype() != null && meterCheckLibrary.getTargetvaluetype().length() > 0) { - targetvalueType = meterCheckLibrary.getTargetvaluetype(); - } - String targetvalue1 = ""; - String targetvalue2 = ""; - if (meterCheckLibrary.getTargetvalue() != null && meterCheckLibrary.getTargetvalue().length() > 0) { - targetvalue1 = meterCheckLibrary.getTargetvalue(); - } - if (meterCheckLibrary.getTargetvalue2() != null && meterCheckLibrary.getTargetvalue2().length() > 0) { - targetvalue2 = meterCheckLibrary.getTargetvalue2(); - } - - if (targetvalueType.equals(MeterCheckLibrary.Targetvalue_Type_Percent)) { - if (!targetvalue1.equals("") && !targetvalue2.equals("")) { - double outValue = (meterCheck.getMpValue() - meterCheck.getInputValue()) / meterCheck.getMpValue() * 100; - if (Double.valueOf(targetvalue1) < outValue || Double.valueOf(targetvalue2) > outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } else if (!targetvalue1.equals("") && targetvalue2.equals("")) { - double outValue = (meterCheck.getMpValue() - meterCheck.getInputValue()) / meterCheck.getMpValue() * 100; - if (Double.valueOf(targetvalue1) < outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } - } else if (targetvalueType.equals(MeterCheckLibrary.Targetvalue_Type_Value)) { - if (!targetvalue1.equals("") && !targetvalue2.equals("")) { - double outValue = meterCheck.getMpValue() - meterCheck.getInputValue(); - if (Double.valueOf(targetvalue1) < outValue || Double.valueOf(targetvalue2) > outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } else if (!targetvalue1.equals("") && targetvalue2.equals("")) { - double outValue = meterCheck.getMpValue() - meterCheck.getInputValue(); - if (Double.valueOf(targetvalue1) < outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } - } - } - int result = this.meterCheckService.save(meterCheck); - - - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doAppSave.do") - public ModelAndView doAppSave(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - String bizid = request.getParameter("bizid"); - String json = request.getParameter("json"); - String nowtime = ""; - if (request.getParameter("nowtime") != null && request.getParameter("nowtime").length() > 0) { - nowtime = request.getParameter("nowtime"); - } else { - nowtime = CommUtil.nowDate(); - } - - org.json.JSONObject jsonObject = new org.json.JSONObject(json); - org.json.JSONArray jsonArray = new org.json.JSONArray(jsonObject.opt("re1").toString()); - - int result = 0; - for (int i = 0; i < jsonArray.length(); i++) { - String mpid = jsonArray.getJSONObject(i).optString("mp_id");//填报内容列表id - String values = jsonArray.getJSONObject(i).optString("parmvalue"); - - MeterCheck meterCheck = new MeterCheck(); - meterCheck.setId(CommUtil.getUUID()); - meterCheck.setInputUser(cu.getId()); - meterCheck.setInputTime(nowtime); - meterCheck.setUnitId(bizid); - meterCheck.setXjId(patrolRecordId); - - List meterCheckLibraryList = this.meterCheckLibraryService.selectListByWhere(" where mpid_rg='" + mpid + "' and unit_id='" + bizid + "' order by morder "); - if (meterCheckLibraryList != null && meterCheckLibraryList.size() > 0) { - MeterCheckLibrary meterCheckLibrary = meterCheckLibraryList.get(0); - meterCheck.setLibraryId(meterCheckLibrary.getId()); - meterCheck.setInputValue(Double.valueOf(values)); - -// MPoint mPoint = this.mPointService.selectById(meterCheckLibrary.getMpid()); -// if(mPoint!=null){ -// double mpValue = mPoint.getParmvalue().doubleValue(); -// meterCheck.setMpValue(mpValue); -// } - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(bizid, "tb_mp_" + meterCheckLibrary.getMpid(), " where MeasureDT<='" + meterCheck.getInputTime() + "' order by MeasureDT desc", " top 1 * "); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - double mpValue = mPointHistoryList.get(0).getParmvalue().doubleValue(); - meterCheck.setMpValue(mpValue); - } - - String targetvalueType = MeterCheckLibrary.Targetvalue_Type_Percent; - if (meterCheckLibrary.getTargetvaluetype() != null && meterCheckLibrary.getTargetvaluetype().length() > 0) { - targetvalueType = meterCheckLibrary.getTargetvaluetype(); - } - String targetvalue1 = ""; - String targetvalue2 = ""; - if (meterCheckLibrary.getTargetvalue() != null && meterCheckLibrary.getTargetvalue().length() > 0) { - targetvalue1 = meterCheckLibrary.getTargetvalue(); - } - if (meterCheckLibrary.getTargetvalue2() != null && meterCheckLibrary.getTargetvalue2().length() > 0) { - targetvalue2 = meterCheckLibrary.getTargetvalue2(); - } - - if (targetvalueType.equals(MeterCheckLibrary.Targetvalue_Type_Percent)) { - if (!targetvalue1.equals("") && !targetvalue2.equals("")) { - double outValue = (meterCheck.getMpValue() - meterCheck.getInputValue()) / meterCheck.getMpValue() * 100; - if (Double.valueOf(targetvalue1) < outValue || Double.valueOf(targetvalue2) > outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } else if (!targetvalue1.equals("") && targetvalue2.equals("")) { - double outValue = (meterCheck.getMpValue() - meterCheck.getInputValue()) / meterCheck.getMpValue() * 100; - if (Double.valueOf(targetvalue1) < outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } - } else if (targetvalueType.equals(MeterCheckLibrary.Targetvalue_Type_Value)) { - if (!targetvalue1.equals("") && !targetvalue2.equals("")) { - double outValue = meterCheck.getMpValue() - meterCheck.getInputValue(); - if (Double.valueOf(targetvalue1) < outValue || Double.valueOf(targetvalue2) > outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } else if (!targetvalue1.equals("") && targetvalue2.equals("")) { - double outValue = meterCheck.getMpValue() - meterCheck.getInputValue(); - if (Double.valueOf(targetvalue1) < outValue) { - sendAlarm(meterCheckLibrary.getMpid(), meterCheckLibrary.getName(), meterCheck.getUnitId(),request); - } - } - } - - MPoint mPoint = new MPoint(); - MPointHistory mPointHistory = new MPointHistory(); - //插入主表 - mPoint.setId(mpid); - mPoint.setMeasuredt(nowtime); - mPoint.setParmvalue(new BigDecimal(values)); - mPointService.update(bizid, mPoint); - - //插入子表 - List list_his = mPointHistoryService.selectListByTableAWhere(bizid, "[tb_mp_" + mpid + "]", "where userid = '" + patrolRecordId + "'"); - if (list_his != null && list_his.size() > 0) { - //删除该任务之前填写的 - mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + mpid + "]", "where userid = '" + patrolRecordId + "'"); - - mPointHistory.setMeasuredt(nowtime); - mPointHistory.setParmvalue(new BigDecimal(values)); - mPointHistory.setUserid(patrolRecordId); - mPointHistory.setTbName("[tb_mp_" + mpid + "]"); - } else { - mPointHistory.setMeasuredt(nowtime); - mPointHistory.setParmvalue(new BigDecimal(values)); - mPointHistory.setUserid(patrolRecordId); - mPointHistory.setTbName("[tb_mp_" + mpid + "]"); - } - mPointHistoryService.save(bizid, mPointHistory); - } - result += this.meterCheckService.save(meterCheck); - } - - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - //插入报警信息 - public void sendAlarm(String mpid, String pointName, String unitId,HttpServletRequest request) { - ProAlarm proAlarm = new ProAlarm(); - proAlarm.setId(CommUtil.getUUID()); - proAlarm.setInsdt(CommUtil.nowDate()); - proAlarm.setAlarmTime(CommUtil.nowDate()); - proAlarm.setPointCode(mpid); - proAlarm.setPointName(pointName); - proAlarm.setBizId(unitId); - proAlarm.setStatus(ProAlarm.STATUS_ALARM); - proAlarm.setAlarmLevel(AlarmLevelsCodeEnum.level3.getKey()); - proAlarm.setDescribe(pointName + "化验对比时发生异常,偏差数据超过限值!"); - proAlarm.setAlarmType(AlarmMoldCodeEnum.Type_HYDB.getKey()); - this.proAlarmService.save(unitId, proAlarm); - - //报警数量+1 - this.proAlarmService.topAlarmNumC(request, mpid, ProAlarm.C_type_add); - - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("meterCheck") MeterCheck meterCheck) { - User cu = (User) request.getSession().getAttribute("cu"); - meterCheck.setInputUser(cu.getId()); - - MeterCheckLibrary meterCheckLibrary = this.meterCheckLibraryService.selectById(meterCheck.getLibraryId()); - if (meterCheckLibrary != null) { - List mPointHistory = this.mPointHistoryService.selectAggregateList(meterCheck.getUnitId(), "tb_mp_" + meterCheckLibrary.getMpid(), " where MeasureDT>='" + meterCheck.getInputTime() + "'", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() > 0) { - double mpValue = mPointHistory.get(0).getParmvalue().doubleValue(); - meterCheck.setMpValue(mpValue); - } - - MPoint mPoint = this.mPointService.selectById(meterCheckLibrary.getMpidRg()); - mPoint.setParmvalue(new BigDecimal(meterCheck.getInputValue())); - mPoint.setMeasuredt(meterCheck.getInputTime().substring(0, 16)); - this.mPointService.update2(mPoint.getBizid(), mPoint); - - List mPointHistory2 = this.mPointHistoryService.selectAggregateList(meterCheck.getUnitId(), "tb_mp_" + meterCheckLibrary.getMpidRg(), " where datediff(day,MeasureDT,'" + meterCheck.getInputTime().substring(0, 16) + "')=0 ", " top 1 * "); - MPointHistory mh = new MPointHistory(); - mh.setParmvalue(new BigDecimal(meterCheck.getInputValue())); - mh.setMeasuredt(meterCheck.getInputTime()); - mh.setTbName("tb_mp_" + meterCheckLibrary.getMpidRg()); - if (mPointHistory2 != null && mPointHistory2.size() > 0) { - this.mPointHistoryService.deleteByTableAWhere(mPoint.getBizid(), "tb_mp_" + meterCheckLibrary.getMpidRg(), " where datediff(day,MeasureDT,'" + meterCheck.getInputTime().substring(0, 16) + "')=0 "); - } - this.mPointHistoryService.save(mPoint.getBizid(), mh); - } - int result = this.meterCheckService.update(meterCheck); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.meterCheckService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("淇濆瓨澶辫触"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.meterCheckService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("淇濆瓨澶辫触"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/MeterCheckLibraryController.java b/src/com/sipai/controller/process/MeterCheckLibraryController.java deleted file mode 100644 index 1d39cca4..00000000 --- a/src/com/sipai/controller/process/MeterCheckLibraryController.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.MeterCheckLibrary; -import com.sipai.entity.user.User; -import com.sipai.service.process.MeterCheckLibraryService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/meterCheckLibrary") -public class MeterCheckLibraryController { - @Resource - private MeterCheckLibraryService meterCheckLibraryService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "process/meterCheckLibraryList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null) { - sort = " code "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.meterCheckLibraryService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getSelectJson.do") - public ModelAndView getSelectJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List list = this.meterCheckLibraryService.selectListByWhere(" where unit_id='" + unitId + "' " + " order by morder"); - JSONArray json = new JSONArray(); - if(list!=null&&list.size()>0){ - for (MeterCheckLibrary meterCheckLibrary: - list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id",meterCheckLibrary.getId()); - jsonObject.put("text",meterCheckLibrary.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/meterCheckLibraryAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - MeterCheckLibrary meterCheckLibrary = this.meterCheckLibraryService.selectById(id); - model.addAttribute("meterCheckLibrary", meterCheckLibrary); - return "process/meterCheckLibraryEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("meterCheckLibrary") MeterCheckLibrary meterCheckLibrary) { - User cu = (User) request.getSession().getAttribute("cu"); -// meterCheckLibrary.setInsdt(CommUtil.nowDate()); -// meterCheckLibrary.setInsuser(cu.getId()); - int result = this.meterCheckLibraryService.save(meterCheckLibrary); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("meterCheckLibrary") MeterCheckLibrary meterCheckLibrary) { - int result = this.meterCheckLibraryService.update(meterCheckLibrary); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.meterCheckLibraryService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("淇濆瓨澶辫触"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.meterCheckLibraryService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("淇濆瓨澶辫触"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/ProcessAdjustmentContentController.java b/src/com/sipai/controller/process/ProcessAdjustmentContentController.java deleted file mode 100644 index 1f76fb7c..00000000 --- a/src/com/sipai/controller/process/ProcessAdjustmentContentController.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.ProcessAdjustmentContent; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.ProcessAdjustmentContentService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/processAdjustmentContent") -public class ProcessAdjustmentContentController { - @Resource - private ProcessAdjustmentContentService processAdjustmentContentService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/processAdjustmentContentList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (pid != null && !pid.equals("")) { - wherestr += " and pid = '" + pid + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.processAdjustmentContentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/processAdjustmentContentAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ProcessAdjustmentContent processAdjustmentContent = this.processAdjustmentContentService.selectById(id); - model.addAttribute("processAdjustmentContent", processAdjustmentContent); - return "process/processAdjustmentContentEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ProcessAdjustmentContent processAdjustmentContent = this.processAdjustmentContentService.selectById(id); - model.addAttribute("processAdjustmentContent", processAdjustmentContent); - return "process/processAdjustmentContentView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("processAdjustmentContent") ProcessAdjustmentContent processAdjustmentContent) { - User cu = (User) request.getSession().getAttribute("cu"); - processAdjustmentContent.setId(CommUtil.getUUID()); - processAdjustmentContent.setInsdt(CommUtil.nowDate()); - processAdjustmentContent.setInsuser(cu.getId()); - int result = this.processAdjustmentContentService.save(processAdjustmentContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("processAdjustmentContent") ProcessAdjustmentContent processAdjustmentContent) { - int result = this.processAdjustmentContentService.update(processAdjustmentContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.processAdjustmentContentService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.processAdjustmentContentService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/updateLibrary.do") - public String updateLibrary(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "libraryIds") String libraryIds) { - String msg = ""; - int res = this.processAdjustmentContentService.updateLibrary(id, libraryIds); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getListForFile.do") - public ModelAndView getListForFile(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - String orderstr = " order by insdt desc"; - String wherestr = "where 1=1 and pid = '" + pid + "'"; - - List list = this.processAdjustmentContentService.selectListForFileByWhere(wherestr + orderstr); - JSONArray arr = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject obj = new JSONObject(); - obj.put("id", list.get(i).getId()); - obj.put("proName", list.get(i).getLibraryProcessAdjustment().getProName()); - obj.put("proCode", list.get(i).getLibraryProcessAdjustment().getProCode()); - obj.put("filename", list.get(i).getDocFileRelation().getCommonFile().getFilename()); - obj.put("docId", list.get(i).getDocFileRelation().getDocId()); - obj.put("upuser", list.get(i).getDocFileRelation().getCommonFile().getUser().getCaption()); - - arr.add(obj); - } - } - model.addAttribute("result", arr); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/process/ProcessAdjustmentController.java b/src/com/sipai/controller/process/ProcessAdjustmentController.java deleted file mode 100644 index 17310cc6..00000000 --- a/src/com/sipai/controller/process/ProcessAdjustmentController.java +++ /dev/null @@ -1,769 +0,0 @@ -package com.sipai.controller.process; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.base.Result; -import com.sipai.entity.process.*; -import com.sipai.service.base.LoginService; -import com.sipai.service.process.LibraryProcessAdjustmentService; -import com.sipai.service.process.ProcessAdjustmentContentService; -import com.sipai.tools.ActivitiUtil; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.process.ProcessAdjustmentService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/process/processAdjustment") -public class ProcessAdjustmentController { - @Resource - private ProcessAdjustmentService processAdjustmentService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private ProcessAdjustmentContentService processAdjustmentContentService; - @Resource - private LibraryProcessAdjustmentService libraryProcessAdjustmentService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - if (request.getParameter("userName") != null) { - if (request.getParameter("userName") != null) { - User cu = userService.getUserByLoginName(request.getParameter("userName")); - if (cu != null) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - } - } - return "process/processAdjustmentList"; - } - - @RequestMapping("/showListView.do") - public String showListView(HttpServletRequest request, Model model) { - return "process/processAdjustmentListView"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.processAdjustmentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListView.do") - public ModelAndView getListView(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 and status = '" + ProcessAdjustment.Status_Finish + "' "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.processAdjustmentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-BY-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(cu.getId()); - if (user != null) { - request.setAttribute("userId", user.getId()); - request.setAttribute("userName", user.getCaption()); - } - request.setAttribute("id", CommUtil.getUUID()); - return "process/processAdjustmentAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ProcessAdjustment processAdjustment = this.processAdjustmentService.selectById(id); - model.addAttribute("processAdjustment", processAdjustment); - return "process/processAdjustmentEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ProcessAdjustment processAdjustment = this.processAdjustmentService.selectById(id); - model.addAttribute("processAdjustment", processAdjustment); - return "process/processAdjustmentView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("processAdjustment") ProcessAdjustment processAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - processAdjustment.setInsdt(CommUtil.nowDate()); - processAdjustment.setInsuser(cu.getId()); - int result = this.processAdjustmentService.save(processAdjustment); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("processAdjustment") ProcessAdjustment processAdjustment) { - int result = this.processAdjustmentService.update(processAdjustment); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.processAdjustmentService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.processAdjustmentService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 更新,启动流程 - */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request, Model model, - @ModelAttribute ProcessAdjustment processAdjustment) { - User cu = (User) request.getSession().getAttribute("cu"); - processAdjustment.setInsuser(cu.getId()); - processAdjustment.setInsdt(CommUtil.nowDate()); - processAdjustment.setStatus(ProcessAdjustment.Status_Start); - int result = 0; - try { - result = this.processAdjustmentService.startProcess(processAdjustment); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + processAdjustment.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 工单提交 - * - * @param request - * @param model - * @param businessUnitHandle - * @return - */ - @RequestMapping("/doHandleProcess.do") - public String doHandleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - processAdjustmentService.updateStatus(businessUnitHandle.getBusinessid()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 - */ - @RequestMapping("/doAuditProcess.do") - public String doAuditProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.processAdjustmentService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示流程 流转信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_PROCESSADJUSTMENT_EDIT: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - /*case BusinessUnit.UNIT_PROCESSADJUSTMENT_HANDLE: - List list3 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list3) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_ANALYSIS: - List list4 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list4) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_EVALUATE: - List list5 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list5) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_DISTRIBUTION: - List list6 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list6) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break;*/ - default: - break; - } - // List list_audit = businessUnitAuditService.selectListByWhere("where businessid='" + scrapApplyId + "' "); - // for (BusinessUnitAudit businessUnitAudit : list_audit) { - // businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - // businessUnitRecords.add(businessUnitRecord); - // } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "process/processAdjustment_processView"; - } else { - return "process/processAdjustment_processView_alone"; - } - } - - /** - * 申请退回页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showHandle.do") - public String showHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(request.getParameter("unitId"));//流程节点id 不是unitId - model.addAttribute("businessUnitHandle", businessUnitHandle); - String entityId = pInstance.getBusinessKey(); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/processAdjustmentHandle"; - } - - /** - * 显示审核 - */ - @RequestMapping("/showAudit.do") - public String showAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitAudit.setUnitid(request.getParameter("unitId"));//流程节点id 不是unitId - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/processAdjustmentAudit"; - } - - /** - * 显示执行 -- 退回 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showApply.do") - public String showApply(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String entityId = pInstance.getBusinessKey(); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - // list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+inStockRecordId+"' order by insdt desc "); - //model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("entity", entity); - return "process/processAdjustmentApply"; - } - - /** - * 显示分析 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showAnalysis.do") - public String showAnalysis(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/processAdjustmentAnalysis"; - } - - /** - * 验收评价 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showEvaluate.do") - public String showEvaluate(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/processAdjustmentEvaluate"; - } - - /** - * 工时分配 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showDistribution.do") - public String showDistribution(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(request.getParameter("unitId"));//流程节点id 不是unitId - model.addAttribute("businessUnitHandle", businessUnitHandle); - String entityId = pInstance.getBusinessKey(); - ProcessAdjustment entity = this.processAdjustmentService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/processAdjustmentDistribution"; - } - - /** - * 查询所有附表的工单工时合计 - */ - @RequestMapping("/selectBaseHours.do") - public String selectBaseHours(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String wherestr = "where pid = '" + id + "'"; - int baseHours = 0; - List list = processAdjustmentContentService.selectListByWhere(wherestr); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - LibraryProcessAdjustment libraryProcessAdjustment = libraryProcessAdjustmentService.selectById(list.get(i).getLibraryId()); - if (libraryProcessAdjustment != null) { - baseHours += libraryProcessAdjustment.getReceiveRatedTime(); - } - } - } - model.addAttribute("result", baseHours); - return "result"; - } - - @RequestMapping("/updateData.do") - public ModelAndView updateData(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String evaluateScore = request.getParameter("evaluateScore"); - String evaluateWeight = request.getParameter("evaluateWeight"); - String coordinationScore = request.getParameter("coordinationScore"); - String coordinationWeight = request.getParameter("coordinationWeight"); - String baseHours = request.getParameter("baseHours"); - String totalScore = request.getParameter("totalScore"); - String workingHours = request.getParameter("workingHours"); - String checkExplain = request.getParameter("checkExplain"); - - ProcessAdjustment processAdjustment = new ProcessAdjustment(); - processAdjustment.setId(id); - if (evaluateScore != null && !evaluateScore.trim().equals("")) { - processAdjustment.setEvaluateScore(Float.parseFloat(evaluateScore)); - } - if (evaluateWeight != null && !evaluateWeight.trim().equals("")) { - processAdjustment.setEvaluateWeight(Float.parseFloat(evaluateWeight)); - } - if (coordinationScore != null && !coordinationScore.trim().equals("")) { - processAdjustment.setCoordinationScore(Float.parseFloat(coordinationScore)); - } - if (coordinationWeight != null && !coordinationWeight.trim().equals("")) { - processAdjustment.setCoordinationWeight(Float.parseFloat(coordinationWeight)); - } - if (baseHours != null && !baseHours.trim().equals("")) { - processAdjustment.setBaseHours(Float.parseFloat(baseHours)); - } - if (totalScore != null && !totalScore.trim().equals("")) { - processAdjustment.setTotalScore(Float.parseFloat(totalScore)); - } - if (workingHours != null && !workingHours.trim().equals("")) { - processAdjustment.setWorkingHours(Float.parseFloat(workingHours)); - } - processAdjustment.setCheckExplain(checkExplain); - int result = this.processAdjustmentService.update(processAdjustment); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/process/ProcessAdjustmentTypeController.java b/src/com/sipai/controller/process/ProcessAdjustmentTypeController.java deleted file mode 100644 index a88ce140..00000000 --- a/src/com/sipai/controller/process/ProcessAdjustmentTypeController.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.ProcessAdjustmentType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.ProcessAdjustmentTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/processAdjustmentType") -public class ProcessAdjustmentTypeController { - @Resource - private ProcessAdjustmentTypeService processAdjustmentTypeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/process/processAdjustmentTypeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - //wherestr += " and unit_id = '"+unitId+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.processAdjustmentTypeService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/processAdjustmentTypeAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - ProcessAdjustmentType processAdjustmentType = this.processAdjustmentTypeService.selectById(id); - model.addAttribute("processAdjustmentType", processAdjustmentType); - return "process/processAdjustmentTypeEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("processAdjustmentType") ProcessAdjustmentType processAdjustmentType) { - User cu = (User) request.getSession().getAttribute("cu"); - processAdjustmentType.setInsdt(CommUtil.nowDate()); - processAdjustmentType.setInsuser(cu.getId()); - int result = this.processAdjustmentTypeService.save(processAdjustmentType); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("processAdjustmentType") ProcessAdjustmentType processAdjustmentType) { - int result = this.processAdjustmentTypeService.update(processAdjustmentType); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.processAdjustmentTypeService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.processAdjustmentTypeService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 order by morder asc"; - List list = this.processAdjustmentTypeService.selectListByWhere(wherestr); - String json = processAdjustmentTypeService.getTreeListtest(list); - Result result = Result.success(json); - //System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getSelectList.do") - public String getSelectList(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 order by morder asc"; - List list = this.processAdjustmentTypeService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - for (ProcessAdjustmentType processAdjustmentType : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processAdjustmentType.getId()); - jsonObject.put("text", processAdjustmentType.getName()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray); - return "result"; - } -} diff --git a/src/com/sipai/controller/process/ProcessController.java b/src/com/sipai/controller/process/ProcessController.java deleted file mode 100644 index de114c42..00000000 --- a/src/com/sipai/controller/process/ProcessController.java +++ /dev/null @@ -1,634 +0,0 @@ -package com.sipai.controller.process; - -import java.io.UnsupportedEncodingException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.HttpUtil; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/process") -public class ProcessController { - @Resource - private ExtSystemService extSystemService; - - /*@RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/process/processKpiList"; - }*/ - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - /*HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "user/extsystem/showlist.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.extSystemService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}";*/ - JSONArray json = new JSONArray(); - JSONObject jsonobj1 = new JSONObject(); - JSONObject obj1 = new JSONObject(); - obj1.put("title", "全场单方处理水氯耗"); - obj1.put("status", 2); - jsonobj1.put("name", obj1); - jsonobj1.put("new", 2.1); - jsonobj1.put("unit", "Mg/L"); - jsonobj1.put("curve", ""); - jsonobj1.put("period", "5min"); - jsonobj1.put("updatedt", "2017-12-25 22:22:09"); - jsonobj1.put("datasource", "计算"); - jsonobj1.put("continue", "1h"); - jsonobj1.put("insuser", "sys"); - jsonobj1.put("status1", 2); - jsonobj1.put("status2", 1); - json.add(jsonobj1); - - JSONObject jsonobj2 = new JSONObject(); - JSONObject obj2 = new JSONObject(); - obj2.put("title", "沉淀池出水浊度"); - obj2.put("status", 2); - jsonobj2.put("name", obj2); - jsonobj2.put("new", 7.3); - jsonobj2.put("unit", "NUT"); - jsonobj2.put("curve", ""); - jsonobj2.put("period", "10min"); - jsonobj2.put("updatedt", "2017-12-25 21:15:19"); - jsonobj2.put("datasource", "仪表"); - jsonobj2.put("continue", "---"); - jsonobj2.put("insuser", "sys"); - jsonobj2.put("status1", 2); - jsonobj2.put("status2", 1); - json.add(jsonobj2); - - JSONObject jsonobj3 = new JSONObject(); - JSONObject obj3 = new JSONObject(); - obj3.put("title", "出厂压力"); - obj3.put("status", 1); - jsonobj3.put("name", obj3); - jsonobj3.put("new", 0.35); - jsonobj3.put("unit", "MPa"); - jsonobj3.put("curve", ""); - jsonobj3.put("period", "10min"); - jsonobj3.put("updatedt", "2017-12-25 14:17:21"); - jsonobj3.put("datasource", "仪表"); - jsonobj3.put("continue", "---"); - jsonobj3.put("insuser", "sys"); - jsonobj3.put("status1", 1); - jsonobj3.put("status2", 0); - json.add(jsonobj3); - - JSONObject jsonobj4 = new JSONObject(); - JSONObject obj4 = new JSONObject(); - obj4.put("title", "出厂压力达标率"); - obj4.put("status", 1); - jsonobj4.put("name", obj4); - jsonobj4.put("new", 96); - jsonobj4.put("unit", "%"); - jsonobj4.put("curve", ""); - jsonobj4.put("period", "12h"); - jsonobj4.put("updatedt", "2017-12-25 13:10:21"); - jsonobj4.put("datasource", "计算"); - jsonobj4.put("continue", "3min"); - jsonobj4.put("insuser", "sys"); - jsonobj4.put("status1", 1); - jsonobj4.put("status2", 1); - json.add(jsonobj4); - - JSONObject jsonobj5 = new JSONObject(); - JSONObject obj5 = new JSONObject(); - obj5.put("title", "出水浊度达标率"); - obj5.put("status", 1); - jsonobj5.put("name", obj5); - jsonobj5.put("new", 98.9); - jsonobj5.put("unit", "%"); - jsonobj5.put("curve", ""); - jsonobj5.put("period", "12h"); - jsonobj5.put("updatedt", "2017-12-25 10:17:21"); - jsonobj5.put("datasource", "计算"); - jsonobj5.put("continue", "2h25min"); - jsonobj5.put("insuser", "sys"); - jsonobj5.put("status1", 1); - jsonobj5.put("status2", 0); - json.add(jsonobj5); - - JSONObject jsonobj6 = new JSONObject(); - JSONObject obj6 = new JSONObject(); - obj6.put("title", "全场单方水水耗"); - obj6.put("status", 1); - jsonobj6.put("name", obj6); - jsonobj6.put("new", 5.86); - jsonobj6.put("unit", "L"); - jsonobj6.put("curve", ""); - jsonobj6.put("period", "12h"); - jsonobj6.put("updatedt", "2017-12-25 08:07:20"); - jsonobj6.put("datasource", "计算"); - jsonobj6.put("continue", "3h15min"); - jsonobj6.put("insuser", "sys"); - jsonobj6.put("status1", 1); - jsonobj6.put("status2", 1); - json.add(jsonobj6); - - JSONObject jsonobj7 = new JSONObject(); - JSONObject obj7 = new JSONObject(); - obj7.put("title", "全场单方水水耗"); - obj7.put("status", 0); - jsonobj7.put("name", obj7); - jsonobj7.put("new", 99.9); - jsonobj7.put("unit", "%"); - jsonobj7.put("curve", ""); - jsonobj7.put("period", "12h"); - jsonobj7.put("updatedt", "2017-12-24 08:07:20"); - jsonobj7.put("datasource", "计算"); - jsonobj7.put("continue", "---"); - jsonobj7.put("insuser", "sys"); - jsonobj7.put("status1", 0); - jsonobj7.put("status2", 0); - json.add(jsonobj7); - String result="{\"total\":99,\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/geterrlist.do") - public ModelAndView geterrlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - JSONArray json = new JSONArray(); - JSONObject jsonobj1 = new JSONObject(); - jsonobj1.put("status1", 2); - jsonobj1.put("code", "888-FT1"); - jsonobj1.put("name", "噪音"); - jsonobj1.put("type", "机械故障"); - jsonobj1.put("status3", 2); - jsonobj1.put("equ", "5#水泵"); - jsonobj1.put("insuser", "玉"); - jsonobj1.put("insdt", "2017-12-24 11:15:29"); - jsonobj1.put("sumbituser", "h"); - jsonobj1.put("level", "一般"); - jsonobj1.put("status2", 1); - json.add(jsonobj1); - - JSONObject jsonobj2 = new JSONObject(); - jsonobj2.put("status1", 2); - jsonobj2.put("code", "888-FT17101"); - jsonobj2.put("name", "用电变更"); - jsonobj2.put("type", "电气故障或异常"); - jsonobj2.put("status3", 1); - jsonobj2.put("equ", "---"); - jsonobj2.put("insuser", "sys"); - jsonobj2.put("insdt", "2017-12-24 10:04:09"); - jsonobj2.put("sumbituser", "h"); - jsonobj2.put("level", "一般"); - jsonobj2.put("status2", 1); - json.add(jsonobj2); - - JSONObject jsonobj3 = new JSONObject(); - jsonobj3.put("status1", 2); - jsonobj3.put("code", "222-FT1001"); - jsonobj3.put("name", "仪表故障"); - jsonobj3.put("type", "自控及仪表"); - jsonobj3.put("status3", 2); - jsonobj3.put("equ", "2#液位计"); - jsonobj3.put("insuser", "sys"); - jsonobj3.put("insdt", "2017-12-21 01:15:19"); - jsonobj3.put("sumbituser", "LIU"); - jsonobj3.put("level", "一般"); - jsonobj3.put("status2", 0); - json.add(jsonobj3); - - JSONObject jsonobj4 = new JSONObject(); - jsonobj4.put("status1", 2); - jsonobj4.put("code", "WZ0001-FT17"); - jsonobj4.put("name", "电脑故障"); - jsonobj4.put("type", "自控及仪表"); - jsonobj4.put("status3", 0); - jsonobj4.put("equ", "1#计算机"); - jsonobj4.put("insuser", "安4"); - jsonobj4.put("insdt", "2017-12-18 11:17:21"); - jsonobj4.put("sumbituser", "安4"); - jsonobj4.put("level", "一般"); - jsonobj4.put("status2", 0); - json.add(jsonobj4); - - JSONObject jsonobj5 = new JSONObject(); - jsonobj5.put("status1", 1); - jsonobj5.put("code", "555-FT5001"); - jsonobj5.put("name", "继电器接触失灵"); - jsonobj5.put("type", "自控及仪表"); - jsonobj5.put("status3", 0); - jsonobj5.put("equ", "5#继电器"); - jsonobj5.put("insuser", "sys"); - jsonobj5.put("insdt", "2017-12-15 15:19:01"); - jsonobj5.put("sumbituser", "h"); - jsonobj5.put("level", "严重"); - jsonobj5.put("status2", 0); - json.add(jsonobj5); - - JSONObject jsonobj6 = new JSONObject(); - jsonobj6.put("status1", 1); - jsonobj6.put("code", "WZ01-FT171"); - jsonobj6.put("name", "仪表读数异常"); - jsonobj6.put("type", "自控及仪表"); - jsonobj6.put("status3", 0); - jsonobj6.put("equ", "3#流量计"); - jsonobj6.put("insuser", "sys"); - jsonobj6.put("insdt", "2017-12-14 19:29:03"); - jsonobj6.put("sumbituser", "安4"); - jsonobj6.put("level", "严重"); - jsonobj6.put("status2", 1); - json.add(jsonobj6); - - JSONObject jsonobj7 = new JSONObject(); - jsonobj7.put("status1", 1); - jsonobj7.put("code", "2222-FT1121"); - jsonobj7.put("name", "漏油 "); - jsonobj7.put("type", "机械故障"); - jsonobj7.put("status3", 0); - jsonobj7.put("equ", "1#发电机"); - jsonobj7.put("insuser", "庄安"); - jsonobj7.put("insdt", "2017-12-14 15:55:39 "); - jsonobj7.put("sumbituser", "刘"); - jsonobj7.put("level", "一般"); - jsonobj7.put("status2", 0); - json.add(jsonobj7); - String result="{\"total\":199,\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getequlist.do") - public ModelAndView getequlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - JSONArray json = new JSONArray(); - JSONObject jsonobj1 = new JSONObject(); - jsonobj1.put("status1", 2); - jsonobj1.put("name", "水泵"); - jsonobj1.put("code", "200QE400-10-2"); - jsonobj1.put("company", "KSB"); - jsonobj1.put("type", "关键设备"); - jsonobj1.put("level", "机械设备"); - jsonobj1.put("location", "二级泵房"); - jsonobj1.put("status2", 1); - json.add(jsonobj1); - - JSONObject jsonobj2 = new JSONObject(); - jsonobj2.put("status1", 1); - jsonobj2.put("name", "水泵"); - jsonobj2.put("code", "200QE400-10-22"); - jsonobj2.put("company", "KSB"); - jsonobj2.put("type", "关键设备"); - jsonobj2.put("level", "机械设备"); - jsonobj2.put("location", "二级泵房"); - jsonobj2.put("status2", 1); - json.add(jsonobj2); - - JSONObject jsonobj3 = new JSONObject(); - jsonobj3.put("status1", 0); - jsonobj3.put("name", "水泵"); - jsonobj3.put("code", "400QW1200-10-45"); - jsonobj3.put("company", "KSB"); - jsonobj3.put("type", "关键设备"); - jsonobj3.put("level", "机械设备"); - jsonobj3.put("location", "二级泵房"); - jsonobj3.put("status2", 0); - json.add(jsonobj3); - - JSONObject jsonobj4 = new JSONObject(); - jsonobj4.put("status1", 0); - jsonobj4.put("name", "计量泵"); - jsonobj4.put("code", "-----"); - jsonobj4.put("company", "KSB"); - jsonobj4.put("type", "关键设备"); - jsonobj4.put("level", "机械设备"); - jsonobj4.put("location", ""); - jsonobj4.put("status2", 0); - json.add(jsonobj4); - - JSONObject jsonobj5 = new JSONObject(); - jsonobj5.put("status1", 0); - jsonobj5.put("name", "气动阀 "); - jsonobj5.put("code", "-----"); - jsonobj5.put("company", "VAG"); - jsonobj5.put("type", "关键设备"); - jsonobj5.put("level", "机械设备"); - jsonobj5.put("location", ""); - jsonobj5.put("status2", 1); - json.add(jsonobj5); - - JSONObject jsonobj6 = new JSONObject(); - jsonobj6.put("status1", 0); - jsonobj6.put("name", "气动阀 "); - jsonobj6.put("code", "-----"); - jsonobj6.put("company", "VAG"); - jsonobj6.put("type", "关键设备"); - jsonobj6.put("level", "机械设备"); - jsonobj6.put("location", ""); - jsonobj6.put("status2", 0); - json.add(jsonobj6); - - JSONObject jsonobj7 = new JSONObject(); - jsonobj7.put("status1", 0); - jsonobj7.put("name", "高压配电柜 "); - jsonobj7.put("code", "-----"); - jsonobj7.put("company", "威图"); - jsonobj7.put("type", "关键设备"); - jsonobj7.put("level", "机械设备"); - jsonobj7.put("location", ""); - jsonobj7.put("status2", 1); - json.add(jsonobj7); - String result="{\"total\":139,\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getalertlist.do") - public ModelAndView getalertlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - JSONArray json = new JSONArray(); - JSONObject jsonobj1 = new JSONObject(); - jsonobj1.put("status1", 2); - jsonobj1.put("code", "888-FT1"); - jsonobj1.put("name", "噪音"); - jsonobj1.put("type", "取水泵房"); - jsonobj1.put("status3", 1); - jsonobj1.put("equ", "5#水泵"); - jsonobj1.put("insuser", "玉"); - jsonobj1.put("insdt", "2017-12-24 11:15:29"); - jsonobj1.put("sumbituser", "h"); - jsonobj1.put("level", "一般"); - jsonobj1.put("status2", 1); - json.add(jsonobj1); - - JSONObject jsonobj2 = new JSONObject(); - jsonobj2.put("status1", 2); - jsonobj2.put("code", "888-FT17101"); - jsonobj2.put("name", "用电变更"); - jsonobj2.put("type", "取水泵房"); - jsonobj2.put("status3", 1); - jsonobj2.put("equ", "---"); - jsonobj2.put("insuser", "sys"); - jsonobj2.put("insdt", "2017-12-24 10:04:09"); - jsonobj2.put("sumbituser", "h"); - jsonobj2.put("level", "一般"); - jsonobj2.put("status2", 1); - json.add(jsonobj2); - - JSONObject jsonobj3 = new JSONObject(); - jsonobj3.put("status1", 2); - jsonobj3.put("code", "222-FT1001"); - jsonobj3.put("name", "仪表故障"); - jsonobj3.put("type", "二级泵房"); - jsonobj3.put("status3", 1); - jsonobj3.put("equ", "2#液位计"); - jsonobj3.put("insuser", "sys"); - jsonobj3.put("insdt", "2017-12-21 01:15:19"); - jsonobj3.put("sumbituser", "LIU"); - jsonobj3.put("level", "一般"); - jsonobj3.put("status2", 0); - json.add(jsonobj3); - - JSONObject jsonobj4 = new JSONObject(); - jsonobj4.put("status1", 2); - jsonobj4.put("code", "WZ0001-FT17"); - jsonobj4.put("name", "电脑故障"); - jsonobj4.put("type", "清水池"); - jsonobj4.put("status3", 0); - jsonobj4.put("equ", "1#计算机"); - jsonobj4.put("insuser", "安4"); - jsonobj4.put("insdt", "2017-12-18 11:17:21"); - jsonobj4.put("sumbituser", "安4"); - jsonobj4.put("level", "一般"); - jsonobj4.put("status2", 0); - json.add(jsonobj4); - - JSONObject jsonobj5 = new JSONObject(); - jsonobj5.put("status1", 1); - jsonobj5.put("code", "555-FT5001"); - jsonobj5.put("name", "继电器接触失灵"); - jsonobj5.put("type", "取水泵房"); - jsonobj5.put("status3", 0); - jsonobj5.put("equ", "5#继电器"); - jsonobj5.put("insuser", "sys"); - jsonobj5.put("insdt", "2017-12-15 15:19:01"); - jsonobj5.put("sumbituser", "h"); - jsonobj5.put("level", "严重"); - jsonobj5.put("status2", 0); - json.add(jsonobj5); - - JSONObject jsonobj6 = new JSONObject(); - jsonobj6.put("status1", 1); - jsonobj6.put("code", "WZ01-FT171"); - jsonobj6.put("name", "仪表读数异常"); - jsonobj6.put("type", "沉淀池"); - jsonobj6.put("status3", 0); - jsonobj6.put("equ", "3#流量计"); - jsonobj6.put("insuser", "sys"); - jsonobj6.put("insdt", "2017-12-14 19:29:03"); - jsonobj6.put("sumbituser", "安4"); - jsonobj6.put("level", "严重"); - jsonobj6.put("status2", 1); - json.add(jsonobj6); - - JSONObject jsonobj7 = new JSONObject(); - jsonobj7.put("status1", 1); - jsonobj7.put("code", "2222-FT1121"); - jsonobj7.put("name", "漏油 "); - jsonobj7.put("type", "二级泵房"); - jsonobj7.put("status3", 0); - jsonobj7.put("equ", "1#发电机"); - jsonobj7.put("insuser", "庄安"); - jsonobj7.put("insdt", "2017-12-14 15:55:39 "); - jsonobj7.put("sumbituser", "刘"); - jsonobj7.put("level", "一般"); - jsonobj7.put("status2", 0); - json.add(jsonobj7); - String result="{\"total\":199,\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "user/extSystemAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String extSystemId = request.getParameter("id"); - return "process/processEdit"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String extSystemId = request.getParameter("id"); - return "process/processView"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ExtSystem extSystem){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - extSystem.setId(id); - extSystem.setInsuser(cu.getId()); - extSystem.setInsdt(CommUtil.nowDate()); - - int result = this.extSystemService.save(extSystem); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ExtSystem extSystem){ - int result = this.extSystemService.update(extSystem); - String resstr="{\"res\":\""+result+"\",\"id\":\""+extSystem.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.extSystemService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.extSystemService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model) { - return "/user/extSystemListForSelect"; - } - - /** - * 请求企业微信审批数据 - * @param request - * @param model - * @param start 必须,获取审批记录的开始时间,格式为“YYYY-MM-DD hh:mm:ss” - * @param end 必须,获取审批记录的结束时间,格式为“YYYY-MM-DD hh:mm:ss” - * @param next_spnum 非必须,第一个拉取的审批单号,不填从该时间段的第一个审批单拉取 - * @return - */ - @RequestMapping("/getQyWeixinApprList.do") - public String getQyWeixinApprList(HttpServletRequest request,Model model, - @RequestParam(value="start") String start, - @RequestParam(value="end") String end) { - - JSONObject json = new JSONObject(); - JSONArray jsonarr = new JSONArray(); - String access_token = ""; - int num = 1; - HttpSession newSession = request.getSession(true); - if(newSession.getAttribute("access_token")!=null){ - access_token = newSession.getAttribute("access_token").toString();//access_token时效2小时,session时效需大于2小时 - }else{ - HttpUtil hu = new HttpUtil(); - String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wxfc73469c6d29b87c&corpsecret=43lns40GCaySKJZgz1snsbGBZsXsjB1kCvf4mq3z_Sg"; - System.out.println(url); - String str = hu.sendGet(url); - json = JSONObject.fromObject(str); - if(json != null){ - access_token = json.getString("access_token").toString();//设置session - newSession.setAttribute("access_token", access_token); - } - } - String next_spnum = request.getParameter("next_spnum"); - json = extSystemService.getQyWeixinApprData(access_token,start,end,next_spnum); - jsonarr.add(json); - if(json !=null && json.get("errmsg").toString().equals("ok")){ - if(json.get("total")!=null){ - num = Integer.valueOf(json.get("total").toString())/10000+1;//请求次数 - } - if(num>1){//数据大于10000条需多次请求,每次最多返回一万条 - for(int i=0;i list = this.processSectionInformationService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String processSectionId = request.getParameter("processSectionId"); - model.addAttribute("processSectionId",processSectionId); - List list = this.processSectionInformationService.selectListByWhere("where process_section_id='"+processSectionId+"' order by morder desc"); - int morder =1; - if(list!=null && list.size()>0){ - morder = list.size()+1; - } - model.addAttribute("morder",morder); - return "process/processSectionInformationAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.processSectionInformationService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.processSectionInformationService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("processSectionInformation") ProcessSectionInformation processSectionInformation){ - User cu= (User)request.getSession().getAttribute("cu"); - processSectionInformation.setId(CommUtil.getUUID()); - processSectionInformation.setInsuser(cu.getId()); - processSectionInformation.setInsdt(CommUtil.nowDate()); - int result = this.processSectionInformationService.save(processSectionInformation); - String resstr="{\"res\":\""+result+"\",\"id\":\""+processSectionInformation.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ProcessSectionInformation processSectionInformation = this.processSectionInformationService.selectById(id); - model.addAttribute("processSectionInformation", processSectionInformation); - return "process/processSectionInformationView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ProcessSectionInformation processSectionInformation = this.processSectionInformationService.selectById(id); - model.addAttribute("processSectionInformation", processSectionInformation); - return "process/processSectionInformationEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("processSectionInformation") ProcessSectionInformation processSectionInformation){ - User cu= (User)request.getSession().getAttribute("cu"); - processSectionInformation.setInsuser(cu.getId()); - processSectionInformation.setInsdt(CommUtil.nowDate()); - int result = this.processSectionInformationService.update(processSectionInformation); - String resstr="{\"res\":\""+result+"\",\"id\":\""+processSectionInformation.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** APP/小程序获取工艺段及信息介绍,默认启用信息,多条则取最新时间一条 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "APP/小程序工艺段及信息介绍", notes = "APP/小程序工艺段及信息介绍", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂区ID",dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value="/getList4Mobile.do", method = RequestMethod.GET) - @ResponseBody - public Result getList4Mobile(HttpServletRequest request,Model model) { - String orderstr = " order by id"; - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); - if (unitId != null && !unitId.isEmpty()) { - wherestr += " and unit_id = '" + unitId + "'"; - } - List list = this.processSectionService.selectListByWhere(wherestr + orderstr); - JSONArray json=JSONArray.fromObject(list); - String res = "{\"total\":"+list.size()+",\"rows\":"+json+"}"; - Result result = Result.success(res); - return result; - } -} diff --git a/src/com/sipai/controller/process/ProcessWebsiteController.java b/src/com/sipai/controller/process/ProcessWebsiteController.java deleted file mode 100644 index 954d0d5a..00000000 --- a/src/com/sipai/controller/process/ProcessWebsiteController.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.controller.process; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.process.ProcessWebsite; -import com.sipai.entity.user.User; -import com.sipai.service.process.ProcessWebsiteService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/processWebsite") -public class ProcessWebsiteController { - @Resource - private ProcessWebsiteService processWebsiteService; - - @RequestMapping("/showProcessWebsiteList.do") - public String showDataTypeList(HttpServletRequest request,Model model){ - return "process/processWebsiteList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.processWebsiteService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 打开新增数据类型(产线) - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - return "process/processWebsiteAdd"; - } - - /** - * 打开编辑数据类型(产线) - * @param request - * @param model - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ProcessWebsite processWebsite = this.processWebsiteService.selectById(id); - model.addAttribute("processWebsite", processWebsite); - return "process/processWebsiteEdit"; - } - - /** - * 保存数据类型(产线) - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("ProcessWebsite") ProcessWebsite processWebsite){ - User cu= (User)request.getSession().getAttribute("cu"); - processWebsite.setId(CommUtil.getUUID()); - processWebsite.setInsuser(cu.getId()); - processWebsite.setInsdt(CommUtil.nowDate()); - int result = this.processWebsiteService.save(processWebsite); - String resstr="{\"res\":\""+result+"\",\"id\":\""+processWebsite.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除数据类型(产线) - * @param request - * @param model - * @param id 交互id - * @return - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.processWebsiteService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新数据类型(产线) - * @param request - * @param model - * @param visualJsp - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ProcessWebsite processWebsite){ - User cu= (User)request.getSession().getAttribute("cu"); - processWebsite.setInsuser(cu.getId()); - processWebsite.setInsdt(CommUtil.nowDate()); - int result = this.processWebsiteService.update(processWebsite); - String resstr="{\"res\":\""+result+"\",\"id\":\""+processWebsite.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/process/RoutineWorkController.java b/src/com/sipai/controller/process/RoutineWorkController.java deleted file mode 100644 index a0e07853..00000000 --- a/src/com/sipai/controller/process/RoutineWorkController.java +++ /dev/null @@ -1,550 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.document.DocFileRelation; -import com.sipai.entity.process.*; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.document.DocFileRelationService; -import com.sipai.service.process.RoutineWorkService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/process/routineWork") -public class RoutineWorkController { - @Resource - private RoutineWorkService routineWorkService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private DocFileRelationService docFileRelationService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/routineWorkList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String typestr = request.getParameter("typestr"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - if (typestr != null && !typestr.equals("")) { - wherestr += " and type = '" + typestr + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.routineWorkService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/routineWorkAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RoutineWork routineWork = this.routineWorkService.selectById(id); - model.addAttribute("routineWork", routineWork); - return "process/routineWorkEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RoutineWork routineWork = this.routineWorkService.selectById(id); - model.addAttribute("routineWork", routineWork); - return "process/routineWorkView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("routineWork") RoutineWork routineWork) { - User cu = (User) request.getSession().getAttribute("cu"); - routineWork.setInsdt(CommUtil.nowDate()); - routineWork.setInsuser(cu.getId()); - int result = this.routineWorkService.save(routineWork); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("routineWork") RoutineWork routineWork) { - int result = this.routineWorkService.update(routineWork); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.routineWorkService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.routineWorkService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 创建工单 - * - * @param request - * @param model - * @param routineWork - * @return - */ - @RequestMapping("/doCreate.do") - public String doCreate(HttpServletRequest request, Model model, - @ModelAttribute("routineWork") RoutineWork routineWork) { - User cu = (User) request.getSession().getAttribute("cu"); - String libraryId = request.getParameter("libraryId"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("typestr"); - routineWork.setId(CommUtil.getUUID()); - routineWork.setInsdt(CommUtil.nowDate()); - routineWork.setInsuser(cu.getId()); - routineWork.setLibraryId(libraryId); - routineWork.setUnitId(unitId); - routineWork.setType(type); - routineWork.setPlanStartDate(CommUtil.nowDate()); - routineWork.setStatus(RoutineWork.Status_NotStart); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-ZQCG-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - routineWork.setJobNumber(jobNumber); - } - int res = this.routineWorkService.save(routineWork); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 更新,启动流程 - */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request, Model model, - @ModelAttribute RoutineWork routineWork) { - User cu = (User) request.getSession().getAttribute("cu"); - routineWork.setInsuser(cu.getId()); - routineWork.setInsdt(CommUtil.nowDate()); - routineWork.setStatus(RoutineWork.Status_Start); - int result = 0; - try { - result = this.routineWorkService.startProcess(routineWork); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + routineWork.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 更新,启动流程 多选下发 - */ - @RequestMapping("/startProcess2.do") - public String startProcess2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - RoutineWork routineWork = this.routineWorkService.selectById(request.getParameter("id")); - routineWork.setInsuser(cu.getId()); - routineWork.setInsdt(CommUtil.nowDate()); - routineWork.setStatus(RoutineWork.Status_Start); - routineWork.setPlanStartDate(request.getParameter("planStartDate")); - routineWork.setUnitId(request.getParameter("unitId")); - routineWork.setReceiveUserIds(request.getParameter("receiveUserIds")); - int result = 0; - try { - result = this.routineWorkService.startProcess(routineWork); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + routineWork.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doHandleProcess.do") - public String doHandleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - routineWorkService.updateStatus(businessUnitHandle.getBusinessid()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 - */ - @RequestMapping("/doAuditProcess.do") - public String doAuditProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.routineWorkService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示流程 流转信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - RoutineWork entity = this.routineWorkService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_RoutineWork_Handle: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_RoutineWork_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "process/routineWork_processView"; - } else { - return "process/routineWork_processView_alone"; - } - } - - /** - * 工单执行-页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showHandle.do") - public String showHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String entityId = pInstance.getBusinessKey(); - RoutineWork entity = this.routineWorkService.selectById(entityId); - // list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+inStockRecordId+"' order by insdt desc "); - //model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("entity", entity); - return "process/routineWorkHandle"; - } - - /** - * 工单验收-页面 - * @param request - * @param model - * @return - */ - @RequestMapping("/showAudit.do") - public String showAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - RoutineWork entity = this.routineWorkService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/routineWorkAudit"; - } - - @RequestMapping("/getListForFile.do") - public ModelAndView getListForFile(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); -// if (sort == null || sort.equals("id")) { -// sort = " insdt "; -// } -// if (order == null) { -// order = " desc "; -// } - String orderstr = " order by id desc"; - - String wherestr = "where 1=1 and id = '" + pid + "'"; - -// PageHelper.startPage(page, rows); - List list = this.routineWorkService.selectListByWhere(wherestr + orderstr); - JSONArray arr = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - String masterId = list.get(i).getLibraryId(); - List dlist = this.docFileRelationService.selectListByWhere(" where masterid='" + masterId + "' "); - if (dlist != null && dlist.size() > 0) { - for (DocFileRelation docFileRelation : dlist) { - JSONObject obj = new JSONObject(); - obj.put("id", docFileRelation.getId()); - obj.put("filename", docFileRelation.getCommonFile().getFilename()); - obj.put("upuser", docFileRelation.getCommonFile().getUser().getCaption()); - obj.put("docId", docFileRelation.getDocId()); - arr.add(obj); - } - } - - } - } -// PageInfo pi = new PageInfo(list); -// JSONArray json = JSONArray.fromObject(list); - -// String result = "{\"rows\":" + json + "}"; - model.addAttribute("result", arr); -// System.out.println(result); - return new ModelAndView("result"); - } - - @RequestMapping("/doRelease4slect.do") - public String doRelease4slect(HttpServletRequest request, Model model) { - return "/process/routineWorkRelease4slect"; - } - -} diff --git a/src/com/sipai/controller/process/TestIndexManageController.java b/src/com/sipai/controller/process/TestIndexManageController.java deleted file mode 100644 index b59249e1..00000000 --- a/src/com/sipai/controller/process/TestIndexManageController.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.TestIndexManage; -import com.sipai.entity.process.TestMethods; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.TestIndexManageService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.util.List; - -@Controller -@RequestMapping("/process/testIndexManage") -public class TestIndexManageController { - @Resource - private TestIndexManageService testIndexManageService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "process/testIndexManageList"; - } - - @RequestMapping("/selectMethods.do") - public String selectMethods(HttpServletRequest request, Model model) { - return "process/testIndexManageForSelectMethods"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null ) { - sort = " name "; - } - if (order == null) { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 and unitId='"+unitId+"' "; - - PageHelper.startPage(page, rows); - List list = this.testIndexManageService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListForSelect.do") - public ModelAndView getListForSelect(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null ) { - sort = " name "; - } - if (order == null) { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 and unitId='"+unitId+"' and active='"+TestIndexManage.Active_true+"' "; - - PageHelper.startPage(page, rows); - List list = this.testIndexManageService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "process/testIndexManageAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - TestIndexManage testIndexManage = this.testIndexManageService.selectById(id); - model.addAttribute("testIndexManage", testIndexManage); - return "process/testIndexManageEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("testIndexManage") TestIndexManage testIndexManage) { - User cu = (User) request.getSession().getAttribute("cu"); - testIndexManage.setId(CommUtil.getUUID()); - testIndexManage.setInsdt(CommUtil.nowDate()); - testIndexManage.setInsuser(cu.getId()); - int result = this.testIndexManageService.save(testIndexManage); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("testIndexManage") TestIndexManage testIndexManage) { - User cu = (User) request.getSession().getAttribute("cu"); - testIndexManage.setUpdt(CommUtil.nowDate()); - testIndexManage.setUpuser(cu.getId()); - int result = this.testIndexManageService.update(testIndexManage); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.testIndexManageService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.testIndexManageService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/TestMethodsController.java b/src/com/sipai/controller/process/TestMethodsController.java deleted file mode 100644 index 3bea38a5..00000000 --- a/src/com/sipai/controller/process/TestMethodsController.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.TestMethods; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.TestMethodsService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.util.List; - -@Controller -@RequestMapping("/process/testMethods") -public class TestMethodsController { - @Resource - private TestMethodsService testMethodsService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "process/testMethodsList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null ) { - sort = " name "; - } - if (order == null) { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 "; - - PageHelper.startPage(page, rows); - List list = this.testMethodsService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListForSelect.do") - public ModelAndView getListForSelect(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null ) { - sort = " name "; - } - if (order == null) { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 and active='"+TestMethods.Active_true+"' "; -// if (classId != null && !classId.trim().equals("")) { -// wherestr += " and type_id = '" + classId + "' "; -// } - - PageHelper.startPage(page, rows); - List list = this.testMethodsService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "process/testMethodsAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - TestMethods testMethods = this.testMethodsService.selectById(id); - model.addAttribute("testMethods", testMethods); - return "process/testMethodsEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("testMethods") TestMethods testMethods) { - User cu = (User) request.getSession().getAttribute("cu"); - testMethods.setId(CommUtil.getUUID()); - testMethods.setInsdt(CommUtil.nowDate()); - testMethods.setInsuser(cu.getId()); - int result = this.testMethodsService.save(testMethods); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("testMethods") TestMethods testMethods) { - User cu = (User) request.getSession().getAttribute("cu"); - testMethods.setUpdt(CommUtil.nowDate()); - testMethods.setUpuser(cu.getId()); - int result = this.testMethodsService.update(testMethods); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.testMethodsService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.testMethodsService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/TestTaskController.java b/src/com/sipai/controller/process/TestTaskController.java deleted file mode 100644 index a5a1a4c3..00000000 --- a/src/com/sipai/controller/process/TestTaskController.java +++ /dev/null @@ -1,388 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.TestIndexManage; -import com.sipai.entity.process.TestTask; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.TestIndexManageService; -import com.sipai.service.process.TestTaskService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.util.List; - -@Controller -@RequestMapping("/process/testTask") -public class TestTaskController { - @Resource - private TestTaskService testTaskService; - @Resource - private TestIndexManageService testIndexManageService; - - @RequestMapping("/showListForPlan.do") - public String showListForPlan(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("userId", cu.getId()); - return "process/testTaskListForPlan"; - } - - @RequestMapping("/showListForTask.do") - public String showListForTask(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("userId", cu.getId()); - return "process/testTaskListForTask"; - } - - @RequestMapping("/getListForPlan.do") - public ModelAndView getListForPlan(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null ) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 and unitId='"+request.getParameter("unitId")+"' "; - if(!cu.getId().equals("emp01")){ - wherestr+=" and ( ((sender='"+cu.getId()+"' or receiver='"+cu.getId()+"') and status='"+TestTask.Status_1+"') or ((sender='"+cu.getId()+"' or receiver='"+cu.getId()+"' or insuser='emp01') and status='"+TestTask.Status_0+"') or ((sender='"+cu.getId()+"' or receiver='"+cu.getId()+"') and status='"+TestTask.Status_2+"') ) "; - } - if(request.getParameter("status")!=null&&request.getParameter("status").length()>0){ - wherestr+=" and status='"+request.getParameter("status")+"' "; - } - if(request.getParameter("sdt")!=null&&request.getParameter("sdt").length()>0&&request.getParameter("edt")!=null&&request.getParameter("edt").length()>0){ - wherestr+=" and (insdt between '"+request.getParameter("sdt")+"' and '"+request.getParameter("edt")+"') "; - } - - PageHelper.startPage(page, rows); - List list = this.testTaskService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListForTask.do") - public ModelAndView getListForTask(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null ) { - sort = " name "; - } - if (order == null) { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 and unitId='"+request.getParameter("unitId")+"' "; - if(!cu.getId().equals("emp01")){ - wherestr+=" and receiver='"+cu.getId()+"' "; - } - if(request.getParameter("status")!=null&&request.getParameter("status").length()>0){ - wherestr+=" and status='"+request.getParameter("status")+"' "; - } - if(request.getParameter("sdt")!=null&&request.getParameter("sdt").length()>0&&request.getParameter("edt")!=null&&request.getParameter("edt").length()>0){ - wherestr+=" and (insdt between '"+request.getParameter("sdt")+"' and '"+request.getParameter("edt")+"') "; - } - - PageHelper.startPage(page, rows); - List list = this.testTaskService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "process/testTaskAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - TestTask testTask = this.testTaskService.selectById(id); - model.addAttribute("testTask", testTask); - return "process/testTaskEdit"; - } - - @RequestMapping("/doview.do") - public String view(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - TestTask testTask = this.testTaskService.selectById(id); - model.addAttribute("testTask", testTask); - return "process/testTaskView"; - } - - @RequestMapping("/doExec.do") - public String doExec(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - TestTask testTask = this.testTaskService.selectById(id); - model.addAttribute("testTask", testTask); - return "process/testTaskExec"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("testTask") TestTask testTask) { - User cu = (User) request.getSession().getAttribute("cu"); - testTask.setId(CommUtil.getUUID()); - testTask.setInsdt(CommUtil.nowDate()); - testTask.setInsuser(cu.getId()); - testTask.setSender(cu.getId()); - testTask.setStatus(TestTask.Status_0); - testTask.setPlantype(request.getParameter("planType")); - int res = this.testTaskService.save(testTask); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("撤回失败!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("testTask") TestTask testTask) { - User cu = (User) request.getSession().getAttribute("cu"); - int res = this.testTaskService.update(testTask); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("撤回失败!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.testTaskService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.testTaskService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/selectTestindexmanage.do") - public String selectMethods(HttpServletRequest request, Model model) { - return "process/testTaskForSelectTestindexmanage"; - } - - @RequestMapping("/sendTask.do") - public String sendTask(HttpServletRequest request, Model model, - @RequestParam(value = "userId") String userId, - @RequestParam(value = "ckids") String ckids) { - User cu = (User) request.getSession().getAttribute("cu"); - ckids = ckids.replace(",", "','"); - List list = this.testTaskService.selectListByWhere("where id in('" + ckids + "')"); - int totalnum=list.size(); - int failnum=0; - int res =0; - for (TestTask testTask : list) { - if(testTask.getStatus().equals(TestTask.Status_0)){ - testTask.setStatus(TestTask.Status_1); - testTask.setSender(cu.getId()); - testTask.setReceiver(userId); - testTask.setSenddt(CommUtil.nowDate()); - res+=this.testTaskService.update(testTask); - }else{ - failnum++; - } - } - - if (res == totalnum) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("一共需要下发"+totalnum+"条记录,其中"+failnum+"已被接单,无法下发!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/finishTask.do") - public String sendTask(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - TestTask testTask=this.testTaskService.selectById(id); - testTask.setStatus(TestTask.Status_2); -// testTask.setReceiver(""); - testTask.setReceivdt(CommUtil.nowDate()); - int res=this.testTaskService.update(testTask); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("撤回失败!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/replay.do") - public String replay(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - - TestTask testTask=this.testTaskService.selectById(id); - testTask.setStatus(TestTask.Status_0); - testTask.setReceiver(""); - testTask.setSenddt(null); - int res=this.testTaskService.update(testTask); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("撤回失败!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getTask.do") - public String getTask(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - TestTask testTask=this.testTaskService.selectById(id); - if(testTask.getStatus().equals(TestTask.Status_0)){ - testTask.setStatus(TestTask.Status_1); - testTask.setSender(cu.getId()); - testTask.setReceiver(cu.getId()); - testTask.setSenddt(CommUtil.nowDate()); - }else{ - Result result = Result.failed("接单失败,记录已被派单!"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - int res=this.testTaskService.update(testTask); - - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("接单失败!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/manualSend.do") - public String manualSend(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 and unitId='"+request.getParameter("unitId")+"' and active='"+TestIndexManage.Active_true+"' "; - List list = this.testIndexManageService.selectListByWhere(wherestr); - int res=0; - for (TestIndexManage testIndexManage : list) { - int cycle=testIndexManage.getCycle(); - String cycletype=testIndexManage.getCycletype(); - if(cycletype.equals(TestIndexManage.CycleType_hour)){ - for (int i = 0; i < 23; i=i+cycle) { - TestTask testTask=new TestTask(); - testTask.setId(CommUtil.getUUID()); - testTask.setInsdt(CommUtil.nowDate().substring(0,10)+" "+i+":00"); - testTask.setInsuser("emp01"); - testTask.setStatus(TestTask.Status_0); - testTask.setPlantype(TestTask.PlanType_0); - testTask.setTestindexmanageid(testIndexManage.getId()); - testTask.setUnitid(request.getParameter("unitId")); - res+=this.testTaskService.save(testTask); - } - } - if(cycletype.equals(TestIndexManage.CycleType_day)){ - List tasklist = this.testTaskService.selectTop1ListByWhere(" where 1=1 and unitId='"+request.getParameter("unitId")+"' and planType='"+TestTask.PlanType_0+"' and testIndexManageId='"+testIndexManage.getId()+"' order by insdt desc"); - if(tasklist!=null&&tasklist.size()>0){ - List cktasklist = this.testTaskService.selectTop1ListByWhere(" where 1=1 and unitId='"+request.getParameter("unitId")+"' and planType='"+TestTask.PlanType_0+"' and datediff(day,insdt,'"+CommUtil.subplus(CommUtil.nowDate(), "-"+cycle, "day")+"')=0 and testIndexManageId='"+testIndexManage.getId()+"' "); - if(cktasklist!=null&&cktasklist.size()>0){ - TestTask testTask=new TestTask(); - testTask.setId(CommUtil.getUUID()); - testTask.setInsdt(CommUtil.nowDate().substring(0, 10)); - testTask.setInsuser("emp01"); - testTask.setStatus(TestTask.Status_0); - testTask.setPlantype(TestTask.PlanType_0); - testTask.setTestindexmanageid(testIndexManage.getId()); - testTask.setUnitid(request.getParameter("unitId")); - res+=this.testTaskService.save(testTask); - } - }else{ - TestTask testTask=new TestTask(); - testTask.setId(CommUtil.getUUID()); - testTask.setInsdt(CommUtil.nowDate().substring(0, 10)); - testTask.setInsuser("emp01"); - testTask.setStatus(TestTask.Status_0); - testTask.setPlantype(TestTask.PlanType_0); - testTask.setTestindexmanageid(testIndexManage.getId()); - testTask.setUnitid(request.getParameter("unitId")); - res+=this.testTaskService.save(testTask); - - } - } - - } - - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("未有记录生成!"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - -} diff --git a/src/com/sipai/controller/process/WaterTestController.java b/src/com/sipai/controller/process/WaterTestController.java deleted file mode 100644 index 30758540..00000000 --- a/src/com/sipai/controller/process/WaterTestController.java +++ /dev/null @@ -1,449 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.process.WaterTestService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/process/waterTest") -public class WaterTestController { - @Resource - private WaterTestService waterTestService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/waterTestList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.waterTestService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-SZHY-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - } - request.setAttribute("id", CommUtil.getUUID()); - return "process/waterTestAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WaterTest waterTest = this.waterTestService.selectById(id); - model.addAttribute("waterTest", waterTest); - return "process/waterTestEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WaterTest waterTest = this.waterTestService.selectById(id); - model.addAttribute("waterTest", waterTest); - return "process/waterTestView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("waterTest") WaterTest waterTest) { - User cu = (User) request.getSession().getAttribute("cu"); - waterTest.setInsdt(CommUtil.nowDate()); - waterTest.setInsuser(cu.getId()); - int result = this.waterTestService.save(waterTest); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("waterTest") WaterTest waterTest) { - int result = this.waterTestService.update(waterTest); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.waterTestService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.waterTestService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 更新,启动流程 - */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request, Model model, - @ModelAttribute WaterTest waterTest) { - User cu = (User) request.getSession().getAttribute("cu"); - waterTest.setInsuser(cu.getId()); - waterTest.setInsdt(CommUtil.nowDate()); - waterTest.setStatus(WaterTest.Status_Start); - waterTest.setSendUserId(cu.getId()); - waterTest.setSendTime(CommUtil.nowDate()); - int result = 0; - try { - result = this.waterTestService.startProcess(waterTest); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + waterTest.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 - */ - @RequestMapping("/doAuditProcess.do") - public String doAuditProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.waterTestService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doHandleProcess.do") - public String doHandleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - String actualTime = request.getParameter("actualTime");//实际完成时间 - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result = 0; - } - waterTestService.updateStatus(businessUnitHandle.getBusinessid()); - waterTestService.updateOther(businessUnitHandle.getBusinessid(),actualTime); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示流程 流转信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - WaterTest entity = this.waterTestService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_WaterTest_Handle: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WaterTest_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "process/waterTest_processView"; - } else { - return "process/waterTest_processView_alone"; - } - } - - /** - * 显示执行 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showHandle.do") - public String showHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - /*String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - }*/ - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String inStockRecordId = pInstance.getBusinessKey(); - WaterTest entity = this.waterTestService.selectById(inStockRecordId); - // list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+inStockRecordId+"' order by insdt desc "); - //model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("entity", entity); - return "process/waterTestHandle"; - } - - /** - * 显示审核 - */ - @RequestMapping("/showAudit.do") - public String showAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - WaterTest entity = this.waterTestService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "process/waterTestAudit"; - } -} diff --git a/src/com/sipai/controller/process/WaterTestDetailController.java b/src/com/sipai/controller/process/WaterTestDetailController.java deleted file mode 100644 index 898e1b72..00000000 --- a/src/com/sipai/controller/process/WaterTestDetailController.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.controller.process; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.process.WaterTestDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.process.WaterTestDetailService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/process/waterTestDetail") -public class WaterTestDetailController { - @Resource - private WaterTestDetailService waterTestDetailService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/waterTestDetailList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (pid != null && !pid.equals("")) { - wherestr += " and pid = '" + pid + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.waterTestDetailService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "process/waterTestDetailAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WaterTestDetail waterTestDetail = this.waterTestDetailService.selectById(id); - model.addAttribute("waterTestDetail", waterTestDetail); - System.out.println(waterTestDetail.getLibraryWaterTest().getCode()); - return "process/waterTestDetailEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WaterTestDetail waterTestDetail = this.waterTestDetailService.selectById(id); - model.addAttribute("waterTestDetail", waterTestDetail); - return "process/waterTestDetailView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("waterTestDetail") WaterTestDetail waterTestDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - waterTestDetail.setInsdt(CommUtil.nowDate()); - waterTestDetail.setInsuser(cu.getId()); - int result = this.waterTestDetailService.save(waterTestDetail); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("waterTestDetail") WaterTestDetail waterTestDetail) { - int result = this.waterTestDetailService.update(waterTestDetail); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int res = this.waterTestDetailService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.waterTestDetailService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dosave4library.do") - public String dosave4library(HttpServletRequest request, Model model, - @ModelAttribute("waterTestDetail") WaterTestDetail waterTestDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - String libraryIds = request.getParameter("libraryIds"); - String unitId = request.getParameter("unitId"); - String jobId = request.getParameter("jobId"); - - int res = 0; - if (libraryIds != null && !libraryIds.equals("")) { - String[] libraryId = libraryIds.split(","); - for (int i = 0; i < libraryId.length; i++) { - waterTestDetail.setId(CommUtil.getUUID()); - waterTestDetail.setInsdt(CommUtil.nowDate()); - waterTestDetail.setInsuser(cu.getId()); - waterTestDetail.setLibraryId(libraryId[i]); - waterTestDetail.setPid(jobId); - res += this.waterTestDetailService.save(waterTestDetail); - } - } - - if (res > 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getListForFile.do") - public ModelAndView getListForFile(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (pid != null && !pid.equals("")) { - wherestr += " and pid = '" + pid + "' "; - } - - List list = this.waterTestDetailService.selectListForFileByWhere(wherestr + orderstr); - JSONArray arr=new JSONArray(); - if(list!=null&&list.size()>0){ - for (int i=0;i list = this.quesOptionService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showQuesOptionAdd.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("questitleid", request.getParameter("questitleid")); - return "question/quesOptionAdd"; - } - - @RequestMapping("/saveQuesOption.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("quesOption") QuesOption quesOption){ -// System.out.println("123+"+request.getParameter("id")); - - quesOption.setStatus(request.getParameter("optionstatus")); - quesOption.setOrd(Integer.parseInt(request.getParameter("optionord"))); - - User cu=(User)request.getSession().getAttribute("cu"); - quesOption.setId(CommUtil.getUUID()); - quesOption.setInsdt(CommUtil.nowDate()); - quesOption.setInsuser(cu.getId()); - int res = this.quesOptionService.save(quesOption); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showQuesOptionEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - QuesOption quesOption = this.quesOptionService.selectById(id); - model.addAttribute("quesOption",quesOption ); - return "question/quesOptionEdit"; - } - - @RequestMapping("/updateQuesOption.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("quesOption") QuesOption quesOption){ - quesOption.setId(request.getParameter("quesOptionid")); - quesOption.setStatus(request.getParameter("optionstatus")); - quesOption.setOrd(Integer.parseInt(request.getParameter("optionord"))); - - User cu=(User)request.getSession().getAttribute("cu"); - quesOption.setUpsdt(CommUtil.nowDate()); - quesOption.setUpsuser(cu.getId()); - - int res = this.quesOptionService.update(quesOption); - model.addAttribute("result",res); - - return new ModelAndView("result"); - } - - @RequestMapping("/deleteQuesOption.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.quesOptionService.deleteById(id); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteQuesOptions.do") - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.quesOptionService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",code); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/question/QuesTitleController.java b/src/com/sipai/controller/question/QuesTitleController.java deleted file mode 100644 index 7ae15752..00000000 --- a/src/com/sipai/controller/question/QuesTitleController.java +++ /dev/null @@ -1,331 +0,0 @@ -package com.sipai.controller.question; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.question.*; -import com.sipai.entity.user.User; -import com.sipai.service.question.*; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/question/quesTitle") -public class QuesTitleController { - @Resource - private QuesTitleService quesTitleService; - @Resource - private QuesOptionService quesOptionService; - @Resource - private SubjecttypeService subjecttypeService; - @Resource - private RankTypeService rankTypeService; - @Resource - private QuestTypeService questTypeService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "question/quesTitleList"; - } - - @RequestMapping(value = "getQuesTitleList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "subjecttypeid", required=false) String subjecttypeid, - @RequestParam(value = "ranktype", required=false) String ranktype, - @RequestParam(value = "questtype", required=false) String questtype) { - String wherestr = " where 1=1 "; - if(subjecttypeid!=null&&!subjecttypeid.isEmpty()){ - wherestr+=" and subjecttypeid = '"+subjecttypeid+"' "; - } - if(ranktype!=null&&!ranktype.isEmpty()){ - wherestr+=" and ranktypeid = '"+ranktype+"' "; - } - if(questtype!=null&&!questtype.isEmpty()){ - wherestr+=" and questtypeid = '"+questtype+"' "; - } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - PageHelper.startPage(page, rows); - List list = this.quesTitleService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showQuesTitleAdd.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("quesTitleid", CommUtil.getUUID()); - return "question/quesTitleAdd"; - } - - @RequestMapping("/saveQuesTitle.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("quesTitle") QuesTitle quesTitle){ - User cu=(User)request.getSession().getAttribute("cu"); - quesTitle.setInsdt(CommUtil.nowDate()); - quesTitle.setInsuser(cu.getId()); - quesTitle.setSubjecttypeid(request.getParameter("search_pid2")); - quesTitle.setRanktypeid(request.getParameter("ranktype")); - quesTitle.setQuesttypeid(request.getParameter("questtype")); - - Subjecttype subjecttype = this.subjecttypeService.selectById(quesTitle.getSubjecttypeid()); - RankType rankType = this.rankTypeService.selectById(quesTitle.getRanktypeid()); - QuestType questType = this.questTypeService.selectById(quesTitle.getQuesttypeid()); - - String subjecttypeid = quesTitle.getSubjecttypeid(); - String ranktypeid = quesTitle.getRanktypeid(); - String questtypeid = quesTitle.getQuesttypeid(); - int ordernumber = 1; - - if (subjecttype != null && rankType!=null && questType!=null) { // 如果都正常,并获得了二级列表id - // 针对二级列表id,获得该列表的最后顺序号+1 - ordernumber = this.quesTitleService.selectlastq(subjecttypeid,questtypeid,ranktypeid); - - String quescode=""; - if(ordernumber<10){ - quescode = subjecttype.getCode()+rankType.getCode()+questType.getCode()+"0"+ordernumber; - }else { - quescode = subjecttype.getCode()+rankType.getCode()+questType.getCode()+ordernumber; - } - quesTitle.setCode(quescode); - quesTitle.setOrd(ordernumber); - } - - int res = this.quesTitleService.save(quesTitle); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showQuesTitleEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - QuesTitle quesTitle = this.quesTitleService.selectById(id); - model.addAttribute("quesTitle",quesTitle ); - Subjecttype subjecttype = this.subjecttypeService.selectById(quesTitle.getSubjecttypeid()); - model.addAttribute("_subjectTypeName",subjecttype.getName() ); - return "question/quesTitleEdit"; - } - - @RequestMapping("/updateQuesTitle.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("quesTitle") QuesTitle quesTitle){ - User cu=(User)request.getSession().getAttribute("cu"); - quesTitle.setUpsdt(CommUtil.nowDate()); - quesTitle.setUpsuser(cu.getId()); - quesTitle.setSubjecttypeid(request.getParameter("search_pid2")); - quesTitle.setRanktypeid(request.getParameter("ranktype")); - quesTitle.setQuesttypeid(request.getParameter("questtype")); - - Subjecttype subjecttype = this.subjecttypeService.selectById(quesTitle.getSubjecttypeid()); - RankType rankType = this.rankTypeService.selectById(quesTitle.getRanktypeid()); - QuestType questType = this.questTypeService.selectById(quesTitle.getQuesttypeid()); - - String subjecttypeid = quesTitle.getSubjecttypeid(); - String ranktypeid = quesTitle.getRanktypeid(); - String questtypeid = quesTitle.getQuesttypeid(); - int ordernumber = 1; - - if (subjecttype != null && rankType!=null && questType!=null) { // 如果都正常,并获得了二级列表id - // 针对二级列表id,获得该列表的最后顺序号+1 - ordernumber = this.quesTitleService.selectlastq(subjecttypeid,questtypeid,ranktypeid); - - String quescode=""; - if(ordernumber<10){ - quescode = subjecttype.getCode()+rankType.getCode()+questType.getCode()+"0"+ordernumber; - }else { - quescode = subjecttype.getCode()+rankType.getCode()+questType.getCode()+ordernumber; - } - quesTitle.setCode(quescode); - quesTitle.setOrd(ordernumber); - } - - int res = this.quesTitleService.update(quesTitle); - model.addAttribute("result",res); - - return new ModelAndView("result"); - } - - @RequestMapping("/deleteQuesTitle.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.quesTitleService.deleteById(id); - this.quesOptionService.deleteByWhere(" where questitleid = '"+id+"'"); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteQuesTitles.do") - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.quesTitleService.deleteByWhere("where id in ('"+ids+"')"); - this.quesOptionService.deleteByWhere(" where questitleid in ('"+ids+"')"); - model.addAttribute("result",code); - return new ModelAndView("result"); - } - - @RequestMapping("/importQues.do") - public String doimport(HttpServletRequest request,Model model){ - return "question/quesImport"; - } - - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? quesTitleService.readXls(excelFile.getInputStream(),cu.getId()) : this.quesTitleService.readXlsx(excelFile.getInputStream(),cu.getId()); - - statusMap.put("status", true); - statusMap.put("msg", res); - System.out.println(res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodisplayexam.do") - public String dodisplayexam(HttpServletRequest request,Model model){ - String questitleid = request.getParameter("questitleid"); - User cu = (User)request.getSession().getAttribute("cu"); - int quesnum = 1; - - //查询考生信息 - List userlist= this.userService.selectListByWhere("where id='"+cu.getId()+"'"); - //查询考试信息 - - request.setAttribute("examtime", "60"); - request.setAttribute("examusernumber", "001"); - request.setAttribute("examusername", userlist.get(0).getCaption()); - request.setAttribute("examtype", "正式考试"); - request.setAttribute("examname", "XX考试"); - - //查询题目选项卡 -// String quesids = ""; -// for(int k = 0;k examtitlerangelist= this.examTitleRangeService.selectListByWhere("where pid='"+examrecordlist.get(0).getExamplanid()+"' order by ord"); - //查题目 - List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+questitleid+"'"); - - //按顺序查题型 -// List questtypes = this.questTypeService.selectListByWhere("where 1=1 order by ord"); - List selectcard = new ArrayList(); - for(int etr = 0;etr selecttitle = new ArrayList(); - List questtypelist = this.questTypeService.selectListByWhere("where id='"+questitlelist.get(etr).getQuesttypeid()+"'"); - for(int sq = 0;sq< questitlelist.size();sq++){ - JSONObject selectquestitle = new JSONObject(); - selectquestitle.put("questitlenum", sq+1); - selectquestitle.put("questitleid",questitlelist.get(sq).getId()); - selecttitle.add(selectquestitle); - } - selectquestype.put("ord", etr+1); - selectquestype.put("questypename", questtypelist.get(0).getName()); - selectquestype.put("questypenum", questitlelist.get(etr).getOrd()); - selectquestype.put("selecttitlelist", selecttitle); - selectcard.add(selectquestype); - } - - request.setAttribute("selectcard", selectcard); - -// List questitlelist = this.quesTitleService.selectListByWhere(" where id = '"+paperlist.get(0).getQuestitleid()+"'"); - //查题型 - List questtypelist1 = this.questTypeService.selectListByWhere("where id='"+questitlelist.get(0).getQuesttypeid()+"'"); - request.setAttribute("questypename", questtypelist1.get(0).getName()); - //查分值 -// List examTitleRanges = this.examTitleRangeService.selectListByWhere("where pid='"+examrecordlist.get(0).getExamplanid()+"' and questtypeid='"+paperlist.get(0).getQuesttypeid()+"'"); - request.setAttribute("singlyscore", "5"); - //查选项 - List options = this.quesOptionService.selectListByWhere("where questitleid='"+questitleid+"' order by ord"); - List optionlist = new ArrayList(); - if(options != null && options.size()>0){ - - for (int i = 0; i < options.size(); i++) { - JSONObject jsonoption = new JSONObject(); -// List options = this.quesOptionService.selectListByWhere("where id='"+testquesoptionlist.get(i).getQuesoptionid()+"'"); -// if(options!=null && options.size()>0){ - jsonoption.put("optionid", options.get(i).getId()); - jsonoption.put("optioncontent", options.get(i).getOptioncontent()); - jsonoption.put("optionx", options.get(i).getOptionnumber()); - optionlist.add(jsonoption); -// } - } - } - - if(questitlelist != null && questitlelist.size()>0){ - request.setAttribute("questitlelist", questitlelist.get(0)); - - }else{ - request.setAttribute("questitlelist", null); - - } - List questtypelist = this.questTypeService.selectListByWhere("where id='"+questitlelist.get(0).getQuesttypeid()+"'"); - request.setAttribute("quesoptionlist", optionlist); - request.setAttribute("questitlenum", "1"); - request.setAttribute("questype", questtypelist.get(0).getName()); - - - - request.setAttribute("quesnum", quesnum); - request.setAttribute("examrecordid", ""); - request.setAttribute("quesid", ""); - return "question/displayexam"; - } -} diff --git a/src/com/sipai/controller/question/QuestTypeController.java b/src/com/sipai/controller/question/QuestTypeController.java deleted file mode 100644 index 0ee7e671..00000000 --- a/src/com/sipai/controller/question/QuestTypeController.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.sipai.controller.question; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.question.QuestType; -import com.sipai.entity.user.User; -import com.sipai.service.question.QuestTypeService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/question/questtype") -public class QuestTypeController { - @Resource - private QuestTypeService questTypeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "question/questTypeList"; - } - - @RequestMapping(value = "getQuestTypeList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "search_name", required=false) String search_name) { - String wherestr = " where 1=1 "; - if(search_name!=null&&!search_name.isEmpty()){ - wherestr+=" and name like '%"+search_name+"%' "; - } - if(sort==null){ - sort = " insertdate "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - PageHelper.startPage(page, rows); - List list = this.questTypeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showQuestTypeAdd.do") - public String doadd(HttpServletRequest request,Model model){ - return "question/questTypeAdd"; - } - - @RequestMapping("/saveQuestType.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("questType") QuestType questType){ - User cu=(User)request.getSession().getAttribute("cu"); - questType.setId(CommUtil.getUUID()); - questType.setInsertdate(CommUtil.nowDate()); - questType.setInsertuserid(cu.getId()); - int res = this.questTypeService.save(questType); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showQuestTypeEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - QuestType questType = this.questTypeService.selectById(id); - model.addAttribute("questType",questType ); - return "question/questTypeEdit"; - } - - @RequestMapping("/updateQuestType.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("questType") QuestType questType){ - User cu=(User)request.getSession().getAttribute("cu"); - questType.setUpdatedate(CommUtil.nowDate()); - questType.setUpdateuserid(cu.getId()); - - int res = this.questTypeService.update(questType); - model.addAttribute("result",res); - - return new ModelAndView("result"); - } - - @RequestMapping("/deleteQuestType.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.questTypeService.deleteById(id); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteQuestTypes.do") - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.questTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",code); - return new ModelAndView("result"); - } - - @RequestMapping("/getQuestType4Select.do") - public String getQuestType4Select(HttpServletRequest request,Model model){ - List list = this.questTypeService.selectListByWhere("where status= '启用'"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (QuestType questType : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", questType.getId()); - jsonObject.put("text", questType.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - @RequestMapping("/getQuestTypesByIds.do") - public ModelAndView getQuestTypesByIds(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - List list = this.questTypeService.selectListByWhere("where id in ('"+ids+"')"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/questForSelect.do") - public ModelAndView questForSelect(HttpServletRequest request,Model model){ - String userIds=request.getParameter("userIds"); - if(userIds!=null && !userIds.isEmpty()){ - String ids=userIds.replace(",","','"); - List list = this.questTypeService.selectListByWhere("where id in ('"+ids+"')"); - model.addAttribute("users",JSONArray.fromObject(list)); - } - return new ModelAndView("exam/questForSelect"); - } -} diff --git a/src/com/sipai/controller/question/RankTypeController.java b/src/com/sipai/controller/question/RankTypeController.java deleted file mode 100644 index 5fa03220..00000000 --- a/src/com/sipai/controller/question/RankTypeController.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.sipai.controller.question; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.question.RankType; -import com.sipai.entity.user.User; -import com.sipai.service.question.RankTypeService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/question/ranktype") -public class RankTypeController { - @Resource - private RankTypeService rankTypeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "question/rankTypeList"; - } - - @RequestMapping(value = "getRankTypeList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "search_name", required=false) String search_name) { - - String wherestr = " where 1=1 "; - if(search_name!=null&&!search_name.isEmpty()){ - wherestr+=" and name like '%"+search_name+"%' "; - } - if(sort==null){ - sort = " insertdate "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - PageHelper.startPage(page, rows); - List list = this.rankTypeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showRankTypeAdd.do") - public String doadd(HttpServletRequest request,Model model){ - return "question/rankTypeAdd"; - } - - @RequestMapping("/saveRankType.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("rankType") RankType rankType){ - User cu=(User)request.getSession().getAttribute("cu"); - rankType.setId(CommUtil.getUUID()); - rankType.setInsertdate(CommUtil.nowDate()); - rankType.setInsertuserid(cu.getId()); - int res = this.rankTypeService.save(rankType); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/showRankTypeEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - RankType rankType = this.rankTypeService.selectById(id); - model.addAttribute("rankType",rankType ); - return "question/rankTypeEdit"; - } - - @RequestMapping("/updateRankType.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("rankType") RankType rankType){ - User cu=(User)request.getSession().getAttribute("cu"); - rankType.setUpdatedate(CommUtil.nowDate()); - rankType.setUpdateuserid(cu.getId()); - - int res = this.rankTypeService.update(rankType); - model.addAttribute("result",res); - - return new ModelAndView("result"); - } - - @RequestMapping("/deleteRankType.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.rankTypeService.deleteById(id); - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteRankTypes.do") - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.rankTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",code); - return new ModelAndView("result"); - } - - @RequestMapping("/getRankType4Select.do") - public String getRankType4Select(HttpServletRequest request,Model model){ - List list = this.rankTypeService.selectListByWhere("where status= '启用'"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (RankType rankType : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", rankType.getId()); - jsonObject.put("text", rankType.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - @RequestMapping("/getRankTypesByIds.do") - public ModelAndView getRankTypesByIds(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - List list = this.rankTypeService.selectListByWhere("where id in ('"+ids+"')"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/rankForSelect.do") - public ModelAndView rankForSelect(HttpServletRequest request,Model model){ - String userIds=request.getParameter("userIds"); - if(userIds!=null && !userIds.isEmpty()){ - String ids=userIds.replace(",","','"); - List list = this.rankTypeService.selectListByWhere("where id in ('"+ids+"')"); - model.addAttribute("users",JSONArray.fromObject(list)); - } - return new ModelAndView("exam/rankForSelect"); - } -} diff --git a/src/com/sipai/controller/question/SubjecttypeController.java b/src/com/sipai/controller/question/SubjecttypeController.java deleted file mode 100644 index 7885436c..00000000 --- a/src/com/sipai/controller/question/SubjecttypeController.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.sipai.controller.question; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.question.Subjecttype; -import com.sipai.entity.user.User; -import com.sipai.service.question.SubjecttypeService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - - -@Controller -@RequestMapping("/question/subjecttype") -public class SubjecttypeController { - @Resource - private SubjecttypeService subjecttypeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "question/subjecttypeshowlist"; - } - - @RequestMapping("/showSubjecttypeAdd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - Subjecttype subjecttype= subjecttypeService.selectById(pid); - model.addAttribute("pname",subjecttype.getName()); - request.setAttribute("code",subjecttype.getCode()); - request.setAttribute("codelength", subjecttype.getCode().length()); - }else{ - request.setAttribute("codelength", null); - } - return "question/subjecttypeAdd"; - } - - @RequestMapping("/saveSubjecttype.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("subjecttype") Subjecttype subjecttype){ - User cu=(User)request.getSession().getAttribute("cu"); - subjecttype.setId(CommUtil.getUUID()); - subjecttype.setInsuser(cu.getId()); - subjecttype.setInsdt(CommUtil.nowDate()); - if (subjecttype.getPid()==null || subjecttype.getPid().isEmpty()) { - subjecttype.setPid("-1"); - } - int result = this.subjecttypeService.save(subjecttype); - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - - @RequestMapping("/showSubjecttypeEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Subjecttype subjecttype= subjecttypeService.selectById(id); - if(subjecttypeService.selectById(subjecttype.getPid())!=null) { - subjecttype.set_pname(subjecttypeService.selectById(subjecttype.getPid()).getName()); - } - model.addAttribute("subjecttype",subjecttype ); - return "question/subjecttypeEdit"; - } - - @RequestMapping("/updateSubjecttype.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("subjecttype") Subjecttype subjecttype){ - User cu=(User)request.getSession().getAttribute("cu"); - subjecttype.setUpsuser(cu.getId()); - subjecttype.setUpsdt(CommUtil.nowDate()); - int result = this.subjecttypeService.update(subjecttype); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - @RequestMapping("/deleteSubjecttype.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @ModelAttribute("subjecttype") Subjecttype subjecttype){ - String msg = ""; - int result = 0; - List mlist = this.subjecttypeService.selectListByWhere(" where pid = '"+subjecttype.getId()+"'"); - //判断是否有子菜单,有的话不能删除 - if(mlist!=null && mlist.size()>0){ - msg="请先删除子菜单"; - }else{ - result = this.subjecttypeService.deleteById(subjecttype.getId()); - if(result>0){ - - }else{ - msg="删除失败"; - } - } - - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return new ModelAndView("result"); - } - - @RequestMapping("/getSubjecttypeJson.do") - public String getMenusJson(HttpServletRequest request,Model model){ - List list = this.subjecttypeService.selectListByWhere("where 1=1 order by ord"); - - /*List tree = new ArrayList(); - for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - node.setIconCls(resource.getImage()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("action", resource.getAction()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - String json = subjecttypeService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showsubjecttype4Select.do") - public String showsubjecttype4Select(HttpServletRequest request,Model model){ - return "question/subjecttype4select"; - } - - @RequestMapping("/getSubjectTypesByIds.do") - public ModelAndView getSubjectTypesByIds(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - List list = this.subjecttypeService.selectListByWhere("where id in ('"+ids+"')"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/subjectForSelect.do") - public ModelAndView subjectForSelect(HttpServletRequest request,Model model){ - String userIds=request.getParameter("userIds"); - if(userIds!=null && !userIds.isEmpty()){ - String ids=userIds.replace(",","','"); - List list = this.subjecttypeService.selectListByWhere("where id in ('"+ids+"')"); - model.addAttribute("users",JSONArray.fromObject(list)); - } - return new ModelAndView("exam/subjectForSelect"); - } - - @RequestMapping(value = "getSubjectTypeList.do") - public ModelAndView getList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "search_name", required=false) String search_name) { - String wherestr = " and 1=1 "; - if(search_name!=null&&!search_name.isEmpty()){ - wherestr+=" and name like '%"+search_name+"%' "; - } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - PageHelper.startPage(page, rows); - List list = this.subjecttypeService.selectListOnlyLast(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/report/CustomReportController.java b/src/com/sipai/controller/report/CustomReportController.java deleted file mode 100644 index ba393112..00000000 --- a/src/com/sipai/controller/report/CustomReportController.java +++ /dev/null @@ -1,857 +0,0 @@ -package com.sipai.controller.report; - -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.data.XServer; -import com.sipai.entity.user.UserRole; -import com.sipai.service.data.XServerService; -import com.sipai.service.user.UserRoleService; -import net.sf.json.JSONArray; -import net.sf.json.JSONNull; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.report.CustomReportMPoint; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.CustomReport; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserDetail; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.data.DataCurveService; -import com.sipai.service.report.BaseService; -import com.sipai.service.report.CustomReportMPointService; -import com.sipai.service.report.ReportEnergyPumpService; -import com.sipai.service.report.CustomReportService; -import com.sipai.service.report.ReportWaterBackWashEquipmentService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -//import com.sipai.tools.JasperHelper; -import com.sipai.tools.SpringContextUtil; - -@Controller -@RequestMapping("/report/customReport") -public class CustomReportController { - @Resource - private CustomReportService customReportService; - @Resource - private CustomReportMPointService customReportMPointService; - @Resource - private CommonFileService commonFileService; - @Resource - private ReportEnergyPumpService reportEnergyPumpService; - @Resource - private ReportWaterBackWashEquipmentService backWashEquipmentService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private DataCurveService dataCurveService; - @Resource - private UserService userService; - @Resource - private UserDetailService userDetailService; - @Resource - private XServerService xServerService; - @Resource - private UserRoleService userRoleService; - - - @RequestMapping("/showManageList.do") - public String showManageList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("cu", cu); - return "/report/customReportManageList"; - } - - @RequestMapping("/getTreeList.do") - public ModelAndView getReportList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String wherestr = " where 1=1 and unit_id = '" + unitId + "' and (insuser = '" + cu.getId() + "' or type <> '" + CustomReport.Type_user + "')"; - List list = this.customReportService.selectListByWhere(wherestr + " order by morder "); - String json = customReportService.getTreeList(null, list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getTreeViewList.do") - public ModelAndView getTreeViewList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String wherestr = " where 1=1 and unit_id = '" + unitId + "' and ((type='" + CustomReport.Type_user + "' and insuser='" + cu.getId() + "') or (type!='" + CustomReport.Type_user + "'))"; - List list = this.customReportService.selectListByWhere(wherestr + " order by morder "); - String json = customReportService.getTreeList(null, list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - return "/report/customReportAdd"; - } - - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("customReport") CustomReport customReport) { - User cu = (User) request.getSession().getAttribute("cu"); - customReport.setId(CommUtil.getUUID()); - customReport.setInsdt(CommUtil.nowDate()); - customReport.setInsuser(cu.getId()); - int result = this.customReportService.save(customReport); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - /** - * 删除方案树 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/delete.do") - public ModelAndView delete(HttpServletRequest request, Model model, - @ModelAttribute("menu") CustomReport customReport) { - String msg = ""; - int result = 0; - List mlist = this.customReportService.selectListByWhere(" where pid = '" + customReport.getId() + "' "); - //判断是否有子菜单,有的话不能删除 - if (mlist != null && mlist.size() > 0) { - msg = "请先删除子菜单"; - } else { - result = this.customReportService.deleteById(customReport.getId()); - if (result > 0) { - //删除菜单对应的测量点 - List funclist = this.customReportMPointService.selectListByWhere(" where pid = '" + customReport.getId() + "' "); - String ids = ""; - for (int i = 0; i < funclist.size(); i++) { - ids += funclist.get(i).getId() + ","; - } - ids = ids.replace(",", "','"); - this.customReportMPointService.deleteByWhere("where id in('" + ids + "')"); - } else { - msg = "删除失败"; - } - } - - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed(msg); - } - model.addAttribute("result", CommUtil.toJson(result1)); - - return new ModelAndView("result"); - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - CustomReport customReport = this.customReportService.selectById(id); - model.addAttribute("customReport", customReport); - return "/report/customReportEdit"; - } - - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("customReport") CustomReport customReport) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - customReport.setInsdt(CommUtil.nowDate()); - customReport.setInsuser(cu.getId()); - if (customReport.getType().equals("0")) { - customReport.setFrequencytype(null); - } - int result = this.customReportService.update(customReport); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - @RequestMapping("/manageView.do") - public String manageView(HttpServletRequest request, Model model) { - String j_username = request.getParameter("username"); - if (j_username != null && j_username.length() > 0) { - List userList = userService.selectListByWhere(" where name='" + j_username + "'"); - if (userList.size() > 0 && null != userList) { - User cu = userList.get(0); - String unitId = ""; - if (null != cu) { - //设置cu其他信息 - cu.setCurrentip(request.getRemoteAddr()); - cu.setLastlogintime(CommUtil.nowDate()); - - HttpSession currentSession = request.getSession(false); - if (null != currentSession) { - currentSession.invalidate(); - } - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - if (cu.getThemeclass() == null || cu.getThemeclass().isEmpty()) { - cu.setThemeclass(CommString.Default_Theme); - } - Company company = unitService.getCompanyByUserId(cu.getId()); - if (company != null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - } else { - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if (companies != null) { - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - - JSONObject jsob = JSONObject.fromObject(cu); - request.setAttribute("result", "{\"result\":\"pass\",\"re1\":" + - jsob.toString() + "}"); - jsob = null; - } else { - } - } - } - - return "/report/customReportManageView"; - } - - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - String programmeId = request.getParameter("programmeId"); - String mpids = ""; - - if (programmeId != null && programmeId.length() > 0) {//根据方案获取测量点 - String wherestr = "where 1=1 and pid='" + programmeId + "' "; - List list = this.customReportMPointService.selectListByWhere(wherestr + " order by morder"); - - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - String name = list.get(i).getmPoint().getParmname(); - if (StringUtils.isNotBlank(list.get(i).geteName())) { - name = list.get(i).geteName(); - } - mpids += list.get(i).getMpointId() + ":" + list.get(i).getmPoint().getUnit() + ":" + name + ":" + list.get(i).getmPoint().getBizid() + ":" + list.get(i).getmPoint().getNumtail() + ","; - } - } - - } else { - MPoint mPoint = mPointService.selectById(unitId, request.getParameter("mpid")); - mpids = request.getParameter("mpid") + ":" + mPoint.getUnit() + ":" + mPoint.getParmname() + ":" + mPoint.getBizid() + ":" + mPoint.getNumtail() + ","; - } - - model.addAttribute("mpids", mpids); - model.addAttribute("pid", programmeId); - return "/report/customReportView"; - } - - /** - * 获取方案测量点列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPointJson.do") - public ModelAndView getMPointJson(HttpServletRequest request, Model model) { - HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - - List alllist = new ArrayList(); - String checkedIds[] = request.getParameter("checkedIds").split(",");//分割测量点 - if (checkedIds != null && checkedIds.length > 0) { - for (int i = 0; i < checkedIds.length; i++) { - String mpandbiz[] = checkedIds[i].split(":");//分割出厂 - String mpid = mpandbiz[0]; - String unitId = mpandbiz[1]; - - List list = this.mPointService.selectListByWhere(unitId, " where id='" + mpid + "' order by parmname "); - if (list != null && list.size() > 0) { - list.get(0).setBizid(unitId); - } - alllist.addAll(list); - } - - } - JSONArray json = JSONArray.fromObject(alllist); - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 导出excel表 - * - * @throws IOException - */ - @RequestMapping(value = "/downloadCustomReportExcel.do") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "frequencytype") String frequencytype, - @RequestParam(value = "frequency") int frequency, - @RequestParam(value = "calculation") String calculation, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) throws IOException { - - //准备插入excel的数据 - JSONArray jsonarr = new JSONArray(); - try { - String[] idArr = ids.split(","); - - if (idArr != null) { - //判断频率/计算方式 - String otherwhere = ""; - String select = ""; - String tableWhere = ""; - String chooseDataWhere = ""; - - //数据筛选 - String chooseDataString = request.getParameter("chooseDataString"); - if (chooseDataString != null && chooseDataString.length() > 0) { - int chooseDataStringNum = 0; - String[] chooseDataStrings = chooseDataString.split(","); - for (String chooseData : - chooseDataStrings) { - String[] chooseDatas = chooseData.split(":"); - String jstype = chooseDatas[0]; - String jsvalue = chooseDatas[1]; - - if (chooseDataStrings.length == 1) { - chooseDataWhere += " and ParmValue" + jstype + "" + jsvalue + " "; - } else { - if (chooseDataStringNum == 0) { - chooseDataWhere += " and (ParmValue" + jstype + "" + jsvalue + " "; - } else if (chooseDataStringNum == (chooseDataStrings.length - 1)) { - chooseDataWhere += " and ParmValue" + jstype + "" + jsvalue + ") "; - } else { - chooseDataWhere += " and ParmValue" + jstype + "" + jsvalue + " "; - } - } - - chooseDataStringNum++; - } - } - - if (frequencytype != null && frequencytype.length() > 0) { - if (frequencytype.equals("0")) {//分钟 - int num = frequency / Integer.valueOf(request.getParameter("forwardingFrequency")); - if (num == 1) { - otherwhere = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and ItemID%" + num + "=0 " + chooseDataWhere; - } else { - otherwhere = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and ItemID%" + num + "=1 " + chooseDataWhere; - } - } else if (frequencytype.equals("1")) {//小时 - int num = 24 / frequency; - int starnum = 0; - String selectnum = ""; - for (int i = 0; i <= num; i++) { - if (i > 0) { - if (frequency + starnum != 24) { - selectnum += "DATEPART(hour, MeasureDT)=" + (frequency + starnum) + " or "; - starnum += frequency; - } - } else { - selectnum += "DATEPART(hour, MeasureDT)=" + (starnum) + " or "; - } - } - selectnum = "(" + selectnum.substring(0, selectnum.length() - 3) + ")"; - if (calculation.equals("first")) { - tableWhere = "(select *,ROW_NUMBER() over(PARTITION by DATEPART(year, MeasureDT), DATEPART(month, MeasureDT),DATEPART(day, MeasureDT),DATEPART(hour, MeasureDT) order by MeasureDT ) as num from [TB_MP_aaa] " - + " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and (" + selectnum + ") " + chooseDataWhere + ") d "; - } else { - select = " year(MeasureDT) as year, MONTH(MeasureDT) as month, DAY(MeasureDT) as day, DATEPART(hour, MeasureDT) as hour, " + calculation + "(ParmValue) as ParmValue"; - otherwhere = selectnum + chooseDataWhere + " group by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT), DATEPART(hour, MeasureDT) order by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT), DATEPART(hour, MeasureDT)"; - } - } else if (frequencytype.equals("2")) {//天 - String selectnum = getCalculationDayTime(sdt, edt, frequency); - if (selectnum.length() > 3) { - selectnum = "(" + selectnum.substring(0, selectnum.length() - 3) + ")"; - } - if (calculation.equals("first")) { - tableWhere = "(select *,ROW_NUMBER() over(PARTITION by DATEPART(year, MeasureDT), DATEPART(month, MeasureDT),DATEPART(day, MeasureDT) order by MeasureDT ) as num from [TB_MP_aaa] " - + " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and (" + selectnum + ") " + chooseDataWhere + ") d "; - } else { - select = " year(MeasureDT) as year, MONTH(MeasureDT) as month, DAY(MeasureDT) as day, " + calculation + "(ParmValue) as ParmValue"; - otherwhere = selectnum + chooseDataWhere + " group by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT) order by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT)"; - } - reportdayselect = ""; - } else if (frequencytype.equals("3")) {//月 - String selectnum = getCalculationMonthTime(sdt, edt, frequency); - if (selectnum.length() > 3) { - selectnum = "(" + selectnum.substring(0, selectnum.length() - 3) + ")"; - } - if (calculation.equals("first")) { - tableWhere = "(select *,ROW_NUMBER() over(PARTITION by DATEPART(year, MeasureDT), DATEPART(month, MeasureDT) order by MeasureDT ) as num from [TB_MP_aaa] " - + " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and (" + selectnum + ") " + chooseDataWhere + ") d "; - } else { - select = " year(MeasureDT) as year, MONTH(MeasureDT) as month, " + calculation + "(ParmValue) as ParmValue"; - otherwhere = selectnum + chooseDataWhere + " group by year(MeasureDT), MONTH(MeasureDT) order by year(MeasureDT), MONTH(MeasureDT)"; - } - reportmonthselect = ""; - } - } - - for (int i = 0; i < idArr.length; i++) { - JSONObject jsonObject_result = new JSONObject(); - String[] mpidAndUnit = idArr[i].split(":"); - if (mpidAndUnit != null) { - List mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='" + mpidAndUnit[0] + "' or MPointCode='" + mpidAndUnit[0] + "')"); - List list = new ArrayList<>(); - if (frequencytype.equals("0")) { - list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", otherwhere + " order by MeasureDT"); - } else { - if (!calculation.equals("first")) { - list = mPointHistoryService.selectReportList(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", - " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and " + otherwhere, select); - } else { - tableWhere = tableWhere.replace("TB_MP_aaa", "TB_MP_" + mplistList.get(0).getMpointcode()); - list = mPointHistoryService.selectReportList(mpidAndUnit[1], tableWhere, - " where d.num=1 order by MeasureDT", " * "); - tableWhere = tableWhere.replace("TB_MP_" + mplistList.get(0).getMpointcode(), "TB_MP_aaa"); - } - if (list != null && list.size() > 0) { - for (int m = 0; m < list.size(); m++) { - String measuredt = ""; - String year = ""; - String month = ""; - String day = ""; - String hour = ""; - String min = ""; - if (!calculation.equals("first") && !frequencytype.equals("0")) { - year = list.get(m).getYear().toString(); - month = list.get(m).getMonth().toString(); - if (!month.equals("")) { - if (Integer.valueOf(month) < 10) { - month = "0" + month; - } - } - if (list.get(m).getDay() != null) { - day = list.get(m).getDay().toString(); - if (!day.equals("")) { - if (Integer.valueOf(day) < 10) { - day = "0" + day; - } - } - } - if (list.get(m).getHour() != null) { - hour = list.get(m).getHour().toString(); - if (!hour.equals("")) { - if (Integer.valueOf(hour) < 10) { - hour = "0" + hour; - } - } - } - if (list.get(m).getMin() != null) { - min = list.get(m).getMin().toString(); - if (!min.equals("")) { - if (Integer.valueOf(min) < 10) { - min = "0" + min; - } - } - } - } else { - year = list.get(m).getMeasuredt().substring(0, 4); - month = list.get(m).getMeasuredt().substring(5, 7); - day = list.get(m).getMeasuredt().substring(8, 10); - hour = list.get(m).getMeasuredt().substring(11, 13); - min = list.get(m).getMeasuredt().substring(14, 16); - } - - if (frequencytype.equals("0")) {//分钟 - measuredt = year + "-" + month + "-" + day + " " + hour + ":" + min; - } else if (frequencytype.equals("1")) {//小时 - measuredt = year + "-" + month + "-" + day + " " + hour; - } else if (frequencytype.equals("2")) {//天 - measuredt = year + "-" + month + "-" + day; - } else if (frequencytype.equals("3")) {//月 - measuredt = year + "-" + month; - } - list.get(m).setMeasuredt(measuredt); - } - } - } - JSONArray json = JSONArray.fromObject(list); - - jsonObject_result.put("measurepointname", mplistList.get(0).getParmname()); - jsonObject_result.put("parmList", json); - } - jsonarr.add(jsonObject_result); - } - } - - this.dataCurveService.downloadExcel(response, jsonarr); - -// if(idArr !=null){ -// for(int i=0;i mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='"+mpidAndUnit[0]+"' or MPointCode='"+mpidAndUnit[0]+"')"); -// List list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1],"[TB_MP_"+mplistList.get(0).getMpointcode()+"]"," where MeasureDT >= '"+sdt+"' and MeasureDT<= '"+edt+"' order by measuredt"); -// JSONArray json=JSONArray.fromObject(list); -// -// jsonObject_result.put("measurepointname",mplistList.get(0).getParmname()); -// jsonObject_result.put("parmList",json); -// } -// -// jsonarr.add(jsonObject_result); -// } -// } - - //导出文件到指定目录,兼容Linux -// this.dataCurveService.downloadExcel(response, jsonarr); - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return null; - } - - static String reportdayselect = ""; - static String reportmonthselect = ""; - - /** - * 按天计算固定频率下是否达到结束时间 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd - * @param frequency 频率数值 - * @return 返回计算后的筛选条件 - */ - public static String getCalculationDayTime(String sd, String ed, int frequency) { - - try { - String calculationTime = CommUtil.subplus(sd, String.valueOf(frequency), "day"); - if (CommUtil.getDays(ed, calculationTime) >= 0) { - reportdayselect += "(year(MeasureDT)='" + (calculationTime.substring(0, 4)) + "' and month(MeasureDT)='" + (calculationTime.substring(5, 7)) + "' and DAY(MeasureDT)='" + (calculationTime.substring(8, 10)) + "') or "; - getCalculationDayTime(calculationTime, ed, frequency); - } - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return reportdayselect; - } - - /** - * 按月计算固定频率下是否达到结束时间 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd - * @param frequency 频率数值 - * @return 返回计算后的筛选条件 - */ - public static String getCalculationMonthTime(String sd, String ed, int frequency) { - - try { - String calculationTime = CommUtil.subplus(sd, String.valueOf(frequency), "month"); - if (CommUtil.getDays(ed, calculationTime) >= 0) { - reportmonthselect += "(year(MeasureDT)='" + (calculationTime.substring(0, 4)) + "' and month(MeasureDT)='" + (calculationTime.substring(5, 7)) + "') or "; - getCalculationMonthTime(calculationTime, ed, frequency); - } - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return reportmonthselect; - } - - - @RequestMapping("/getTabListFromSP.do") - public ModelAndView getTabListFromSP(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "frequencytype") String frequencytype, - @RequestParam(value = "frequency") int frequency, - @RequestParam(value = "calculation") String calculation, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - try { - JSONArray arr = new JSONArray(); - - String chooseDataString = request.getParameter("chooseDataString"); -// System.out.println(chooseDataString); - String chooseDataWhere = ""; - if (chooseDataString != null && chooseDataString.length() > 0) { - String[] chooseDataStrings = chooseDataString.split(","); - for (String jsContent : - chooseDataStrings) { - String[] jsContents = jsContent.split(":"); - chooseDataWhere += "[" + jsContents[2] + "]" + jsContents[0] + "" + jsContents[1] + ","; - } - } -// System.out.println(chooseDataWhere); - - List list = this.xServerService.selectListByWhere(" where bizid='" + bizId + "' "); - if (list != null && list.size() > 0) { - int mpcodeNums = 0; - String EPName = list.get(0).getDbname(); - - String[] mpidss = ids.split(","); - String endMpids = ""; - String Numtails = ""; - for (String mp : mpidss) { - String[] mMpids = mp.split(":"); - endMpids += mMpids[0] + ","; - - MPoint mPoint = this.mPointService.selectById(mMpids[0]); - if (mPoint != null) { - Numtails += mPoint.getNumtail() + ","; - } - } - - mpcodeNums = mpidss.length; - - String[] endMpidss = endMpids.split(","); - String[] Numtailss = Numtails.split(","); - - List> spCustomReportData = customReportService.getSpCustomReportData(sdt, edt, calculation, frequencytype, String.valueOf(frequency), endMpids, EPName, chooseDataWhere); -// System.out.println(spCustomReportData); - if (spCustomReportData != null && spCustomReportData.size() > 0) { - -// JSONArray jsonArrayD = new JSONArray(); - JSONObject obj = new JSONObject(); - int nowForNum = 0; - for (int i = 0; i < spCustomReportData.size(); i++) { - - int ckNum = Integer.valueOf(spCustomReportData.get(i).get("morder").toString()); - BigDecimal parmValue = CommUtil.formatMPointValue(new BigDecimal(spCustomReportData.get(i).get("ParmValue").toString()), Numtailss[ckNum], new BigDecimal("1")); - - if (nowForNum > ckNum) { - arr.add(obj); - obj = new JSONObject(); - } - - if (obj.size() > 0) { - if (spCustomReportData.get(i).get("MeasureDT").toString().equals(obj.getString("measuredt"))) { - obj.put("paramvalue" + ckNum, parmValue); - } - } else { - obj.put("measuredt", spCustomReportData.get(i).get("MeasureDT").toString()); - obj.put("paramvalue" + ckNum, parmValue); - } - nowForNum = ckNum; - } -// System.out.println(arr); - } - } - -// System.out.println(arr); - String result = "{\"rows\":" + arr + "}"; - model.addAttribute("result", arr); - - } catch (Exception e) { - System.out.println(e); - } - return new ModelAndView("result"); - } - - /** - * 导出excel表 - * - * @throws IOException - */ - @RequestMapping(value = "/getTabListFromSPExcel.do") - public ModelAndView getTabListFromSPExcel(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "frequencytype") String frequencytype, - @RequestParam(value = "frequency") int frequency, - @RequestParam(value = "calculation") String calculation, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - String pid) throws IOException { - - //准备插入excel的数据 - JSONArray arr = new JSONArray(); - String mpnames = ""; - try { - - String chooseDataString = request.getParameter("chooseDataString"); -// System.out.println(chooseDataString); - String chooseDataWhere = ""; - if (chooseDataString != null && chooseDataString.length() > 0) { - String[] chooseDataStrings = chooseDataString.split(","); - for (String jsContent : - chooseDataStrings) { - String[] jsContents = jsContent.split(":"); - chooseDataWhere += "[" + jsContents[2] + "]" + jsContents[0] + "" + jsContents[1] + ","; - } - } -// System.out.println(chooseDataWhere); - - List list = this.xServerService.selectListByWhere(" where bizid='" + bizId + "' "); - if (list != null && list.size() > 0) { - String EPName = list.get(0).getDbname(); - - String[] mpidss = ids.split(","); - String endMpids = ""; - String Numtails = ""; - for (String mp : mpidss) { - String[] mMpids = mp.split(":"); - endMpids += mMpids[0] + ","; - - MPoint mPoint = this.mPointService.selectById(mMpids[0]); - if (mPoint != null) { - Numtails += mPoint.getNumtail() + ","; - } - } - - String[] endMpidss = endMpids.split(","); - String[] Numtailss = Numtails.split(","); - - int totalNum = endMpidss.length; - - List> spCustomReportData = customReportService.getSpCustomReportData(sdt, edt, calculation, frequencytype, String.valueOf(frequency), endMpids, EPName, chooseDataWhere); -// System.out.println(spCustomReportData); - if (spCustomReportData != null && spCustomReportData.size() > 0) { - -// JSONArray jsonArrayD = new JSONArray(); - JSONObject obj = new JSONObject(); - int nowForNum = 0; - for (int i = 0; i < spCustomReportData.size(); i++) { - - int ckNum = Integer.valueOf(spCustomReportData.get(i).get("morder").toString()); - BigDecimal parmValue = CommUtil.formatMPointValue(new BigDecimal(spCustomReportData.get(i).get("ParmValue").toString()), Numtailss[ckNum], new BigDecimal("1")); - - if (nowForNum > ckNum) { - for (int m = 0; m < totalNum; m++) { - if (JSONNull.getInstance().equals(obj.get("paramvalue" + m))) { - obj.put("paramvalue" + m, "-"); - } - } - arr.add(obj); - obj = new JSONObject(); - } - - if (obj.size() > 0) { - if (spCustomReportData.get(i).get("MeasureDT").toString().equals(obj.getString("measuredt"))) { - obj.put("paramvalue" + ckNum, parmValue); - } - } else { - obj.put("measuredt", spCustomReportData.get(i).get("MeasureDT").toString()); - obj.put("paramvalue" + ckNum, parmValue); - } - nowForNum = ckNum; - } -// System.out.println(arr); - } - - for (String endShowPoint : - endMpidss) { - if (StringUtils.isNotBlank(pid)) { - List customReportMPoints = customReportMPointService.selectListByWhere("where pid = '" + pid + "' and mpoint_id = '" + endShowPoint + "'"); - MPoint mPoint = this.mPointService.selectById(bizId, endShowPoint); - mpnames += StringUtils.isBlank(mPoint.getUnit()) ? customReportMPoints.get(0).geteName() + "," : customReportMPoints.get(0).geteName() + " ( " + mPoint.getUnit() + " ),"; - } else { - MPoint mPoint = this.mPointService.selectById(bizId, endShowPoint); - mpnames += StringUtils.isBlank(mPoint.getUnit()) ? mPoint.getParmname() + "," : mPoint.getParmname() + " ( " + mPoint.getUnit() + " ),"; - } - } - } - - - JSONObject jsonObject = new JSONObject(); - -// System.out.println(arr); - jsonObject.put("parmList", arr); - jsonObject.put("names", mpnames); -// System.out.println("cssss:" + jsonObject); - - this.customReportService.downloadExcel(response, jsonObject); - -// if(idArr !=null){ -// for(int i=0;i mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='"+mpidAndUnit[0]+"' or MPointCode='"+mpidAndUnit[0]+"')"); -// List list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1],"[TB_MP_"+mplistList.get(0).getMpointcode()+"]"," where MeasureDT >= '"+sdt+"' and MeasureDT<= '"+edt+"' order by measuredt"); -// JSONArray json=JSONArray.fromObject(list); -// -// jsonObject_result.put("measurepointname",mplistList.get(0).getParmname()); -// jsonObject_result.put("parmList",json); -// } -// -// jsonarr.add(jsonObject_result); -// } -// } - - //导出文件到指定目录,兼容Linux -// this.dataCurveService.downloadExcel(response, jsonarr); - - - } catch ( - Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return null; - } - -} diff --git a/src/com/sipai/controller/report/CustomReportMPointController.java b/src/com/sipai/controller/report/CustomReportMPointController.java deleted file mode 100644 index c159d16b..00000000 --- a/src/com/sipai/controller/report/CustomReportMPointController.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.sipai.controller.report; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import net.sf.json.JSONArray; - -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.CustomReportMPoint; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.report.BaseService; -import com.sipai.service.report.ReportEnergyPumpService; -import com.sipai.service.report.CustomReportMPointService; -import com.sipai.service.report.ReportWaterBackWashEquipmentService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -//import com.sipai.tools.JasperHelper; -import com.sipai.tools.SpringContextUtil; - -@Controller -@RequestMapping("/report/customReportMPoint") -public class CustomReportMPointController { - @Resource - private CustomReportMPointService customReportMPointService; - @Resource - private CommonFileService commonFileService; - @Resource - private ReportEnergyPumpService reportEnergyPumpService; - @Resource - private ReportWaterBackWashEquipmentService backWashEquipmentService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - - @RequestMapping("/showManageList.do") - public String showManageList(HttpServletRequest request,Model model){ - return"/report/customReportMPointManageList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 and pid='"+request.getParameter("pid")+"' "; - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.customReportMPointService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "/report/customReportMPointAdd"; - } - - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("customReportMPoint") CustomReportMPoint customReportMPoint) { - User cu = (User) request.getSession().getAttribute("cu"); - customReportMPoint.setId(CommUtil.getUUID()); - customReportMPoint.setInsdt(CommUtil.nowDate()); - customReportMPoint.setInsuser(cu.getId()); - int result = this.customReportMPointService.save(customReportMPoint); - Result result1 = new Result(); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return new ModelAndView("result"); - } - - @RequestMapping("/saves.do") - public ModelAndView dosaves(HttpServletRequest request,Model model) { - User cu= (User)request.getSession().getAttribute("cu"); - String mpointid=request.getParameter("mpointids"); - JSONArray jsonArray = JSONArray.fromObject(mpointid); - int result =0; - String fail = ""; - if(mpointid!=null&&mpointid.length()>0){ - for(int i=0;i list = this.drainageDataomprehensiveTableConfigureService.selectListByWhere(" where 1=1 and pid='"+pid+"' and bizid='"+bizid+"' "); - if(list!=null&&list.size()>0){ - model.addAttribute("drainageDataomprehensiveTableConfigure",list.get(0) ); - model.addAttribute("ishavelist","1" ); - }else{ - model.addAttribute("ishavelist","0" ); - } - - model.addAttribute("bizid",bizid); - return "report/drainageDataomprehensiveTableConfigureEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("drainageDataomprehensiveTableConfigure") DrainageDataomprehensiveTableConfigure drainageDataomprehensiveTableConfigure){ - User cu= (User)request.getSession().getAttribute("cu"); - drainageDataomprehensiveTableConfigure.setId(CommUtil.getUUID()); - drainageDataomprehensiveTableConfigure.setInsdt(CommUtil.nowDate()); - drainageDataomprehensiveTableConfigure.setInsuser(cu.getId()); - int result = this.drainageDataomprehensiveTableConfigureService.save(drainageDataomprehensiveTableConfigure); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("drainageDataomprehensiveTableConfigure") DrainageDataomprehensiveTableConfigure drainageDataomprehensiveTableConfigure){ - int result = this.drainageDataomprehensiveTableConfigureService.update(drainageDataomprehensiveTableConfigure); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.drainageDataomprehensiveTableConfigureService.deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/getDrainageDataomprehensiveTableConfiguresJson.do") - public String getDrainageDataomprehensiveTableConfiguresJson(HttpServletRequest request,Model model){ - String whereString="where 1=1 "; - - String sql="select id,name,'-1' as pid,morder from tb_report_drainageDataomprehensiveTable_mainconfigure where 1=1 " - + " UNION" - + " select id,name,pid,morder from tb_report_drainageDataomprehensiveTable_mainconfigure_detail where 1=1 " - + " order by pid,morder "; - - List list = this.drainageDataomprehensiveTableMainconfigureService.getownsql(sql); - - -// if(request.getParameter("bizid")!=null&&request.getParameter("bizid").length()>0){ -// whereString+=" and bizid='"+request.getParameter("bizid")+"' "; -// }else{ -// whereString+=" and bizid='' "; -// } - -// List list = this.drainageDataomprehensiveTableConfigureService.selectListByWhere(whereString+" order by morder"); - String json = drainageDataomprehensiveTableMainconfigureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showActiveListSelect.do") - public String showActiveList4Select(HttpServletRequest request,Model model){ - return "report/drainageDataomprehensiveTableConfigureActiveselect"; - } - @RequestMapping("/getDrainageDataomprehensiveTableConfiguresJsonActive.do") - public String getMenusJsonActive(HttpServletRequest request,Model model){ - List list = this.drainageDataomprehensiveTableConfigureService.selectListByWhere("where active='"+CommString.Active_True+"' order by morder"); - /*for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - }*/ - String json = drainageDataomprehensiveTableConfigureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/report/DrainageDataomprehensiveTableController.java b/src/com/sipai/controller/report/DrainageDataomprehensiveTableController.java deleted file mode 100644 index 36253d25..00000000 --- a/src/com/sipai/controller/report/DrainageDataomprehensiveTableController.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.sipai.controller.report; - -import groovy.time.BaseDuration.From; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.report.DrainageDataomprehensiveTable; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigure; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigureDetail; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.report.BaseService; -import com.sipai.service.report.DrainageDataomprehensiveTableMainconfigureDetailService; -import com.sipai.service.report.DrainageDataomprehensiveTableMainconfigureService; -import com.sipai.service.report.DrainageDataomprehensiveTableService; -import com.sipai.service.report.ReportEnergyPumpService; -import com.sipai.service.report.ReportTemplateService; -import com.sipai.service.report.ReportWaterBackWashEquipmentService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -//import com.sipai.tools.JasperHelper; -import com.sipai.tools.SpringContextUtil; - -@Controller -@RequestMapping("/report/drainageDataomprehensiveTable") -public class DrainageDataomprehensiveTableController { - @Resource - private DrainageDataomprehensiveTableService drainageDataomprehensiveTableService; - @Resource - private DrainageDataomprehensiveTableMainconfigureService drainageDataomprehensiveTableMainconfigureService; - @Resource - private DrainageDataomprehensiveTableMainconfigureDetailService drainageDataomprehensiveTableMainconfigureDetailService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - String timeString=""; - String bizid=""; - String bizname=""; - - if(request.getParameter("bizid")!=null&&request.getParameter("bizid").length()>0){ - bizid=request.getParameter("bizid"); - bizname = this.unitService.getSnameById(bizid); - } - - int monthnum=0; - -// String wherestr=" where 1=1 and unit_id='"+bizid+"'"; -// String orderstr=" order by insdt "; - - if(request.getParameter("time")!=null&&request.getParameter("time").length()>0){ - timeString=request.getParameter("time"); -// String firstmonth=timeString.substring(0, 7).toString()+"-01"; -// String endmonth=timeString.substring(8, 15).toString()+"-28"; - int firstmonthnum=Integer.valueOf(timeString.substring(5, 7).toString()); - int endmonthnum=Integer.valueOf(timeString.substring(13, 15).toString()); - request.setAttribute("time", timeString); - request.setAttribute("timestatus", "1");//刷新进入 - monthnum=endmonthnum-firstmonthnum+1; -// wherestr+=" and (insdt between '"+firstmonth+"' and '"+endmonth+"') "; - }else{ - timeString=CommUtil.nowDate(); - request.setAttribute("timestatus", "0");//第一次进入 - monthnum=monthnum+1; -// wherestr+=" and datediff(month,insdt,'"+timeString+"')=0 "; - } - -// List list = this.drainageDataomprehensiveTableService.selectListByWhere(wherestr+orderstr); -// -// request.setAttribute("list", list); - request.setAttribute("monthnum", monthnum); - request.setAttribute("time", timeString); - request.setAttribute("bizid", bizid); - request.setAttribute("bizname", bizname); - - return"/report/drainageDataomprehensiveTableList"; - } - - @RequestMapping("/gettable.do") - public String gettable(HttpServletRequest request,Model model){ - - String orderstr2=" order by morder "; - String wherestr2=" where 1=1 "; - String sql2="select * from tb_report_drainageDataomprehensiveTable_mainconfigure "; - List list2 = this.drainageDataomprehensiveTableMainconfigureService.getownsql(sql2+wherestr2+orderstr2); - - String htmlString=""; - - String timeString=""; - String bizid=""; - - if(request.getParameter("bizid")!=null&&request.getParameter("bizid").length()>0){ - bizid=request.getParameter("bizid"); - } - - String sql="select distinct insdt from tb_report_drainageDataomprehensiveTable "; - String wherestr=" where 1=1 and unit_id='"+bizid+"' "; - String orderstr=" order by insdt"; - - if(request.getParameter("time")!=null&&request.getParameter("time").length()>0){ - timeString=request.getParameter("time"); - String firstmonth=timeString.substring(0, 7).toString()+"-01"; - String endmonth=timeString.substring(8, 15).toString()+"-28"; - wherestr+=" and (insdt between '"+firstmonth+"' and '"+endmonth+"') "; - }else{ - timeString=CommUtil.nowDate(); - wherestr+=" and datediff(month,insdt,'"+timeString+"')=0 "; - } - - List list = this.drainageDataomprehensiveTableService.getownsql(sql+wherestr+orderstr); - - if(list!=null&&list.size()>0){ - - htmlString+=""; - htmlString+=""; - htmlString+="指   标"; - htmlString+=""; - htmlString+=""; - htmlString+="目   标   值"; - htmlString+=""; - - for(int m=0;m"; - htmlString+=list.get(m).getInsdt().toString().substring(0, 7); - htmlString+=""; - -// if(m==0){ -// htmlString+=""; -// htmlString+="累计/平均"; -// htmlString+=""; -// htmlString+=""; -// } -// -// htmlString+=""; -// htmlString+="实   际   值"; -// htmlString+=""; -// htmlString+=""; -// htmlString+="去年同期值"; -// htmlString+=""; -// htmlString+=""; -// htmlString+="同比变动数"; -// htmlString+=""; -// htmlString+=""; -// htmlString+="目标差异数"; -// htmlString+=""; - - - } - htmlString+=""; - htmlString+="累计/平均"; - htmlString+=""; - htmlString+=""; - if(list!=null&&list.size()>0){ - for(int m=0;m"; - htmlString+="实   际   值"; - htmlString+=""; - htmlString+=""; - htmlString+="去年同期值"; - htmlString+=""; - htmlString+=""; - htmlString+="同比变动数"; - htmlString+=""; - htmlString+=""; - htmlString+="目标差异数"; - htmlString+=""; - } - } - htmlString+=""; - htmlString+="目   标   值"; - htmlString+=""; - htmlString+=""; - htmlString+="实   际   值"; - htmlString+=""; - htmlString+=""; - htmlString+="去年同期值"; - htmlString+=""; - htmlString+=""; - htmlString+="同比变动数"; - htmlString+=""; - htmlString+=""; - htmlString+="目标差异数"; - htmlString+=""; - htmlString+=""; - - if(list2!=null&&list2.size()>0){ - for(int i=0;i list3 = this.drainageDataomprehensiveTableMainconfigureDetailService.getownsql(sql3+wherestr3+orderstr3); - - if(list3!=null&&list3.size()>0){ - for(int j=0;j"; - htmlString+=list2.get(i).getName().toString(); - htmlString+=""; - } - htmlString+=""; - htmlString+=list3.get(j).getName().toString(); - htmlString+=""; - htmlString+=""; - if(list3.get(j).getTargetValue()!=null){ - htmlString+=list3.get(j).getTargetValue(); - }else{ - htmlString+="-"; - } - htmlString+=""; - - double totalTargetValue=0; - if(list3.get(j).getTargetValue()!=null){ - totalTargetValue=list3.get(j).getTargetValue()*list.size(); - } - double totalTurevalue=0; - double totalLastyearvalue=0; - double totalLastyeardiffvalue=0; - double totalTargetdiffvalue=0; - - for(int m=0;m datalist = this.drainageDataomprehensiveTableService.selectListByWhere("where valueId='"+list3.get(j).getId()+"' and datediff(month,insdt,'"+list.get(m).getInsdt()+"')=0 "); - if(datalist!=null&&datalist.size()>0){ - for(int n=0;n"; - if(datalist.get(n).getTurevalue()!=null){ - htmlString+=datalist.get(n).getTurevalue(); - totalTurevalue+=datalist.get(n).getTurevalue(); - }else{ - htmlString+="-"; - } - htmlString+=""; - htmlString+=""; - if(datalist.get(n).getLastyearvalue()!=null){ - htmlString+=datalist.get(n).getLastyearvalue(); - totalLastyearvalue+=datalist.get(n).getLastyearvalue(); - }else{ - htmlString+="-"; - } - htmlString+=""; - htmlString+=""; - if(datalist.get(n).getLastyeardiffvalue()!=null){ - htmlString+=datalist.get(n).getLastyeardiffvalue(); - totalLastyeardiffvalue+=datalist.get(n).getLastyeardiffvalue(); - }else{ - htmlString+="-"; - } - htmlString+=""; - htmlString+=""; - if(datalist.get(n).getTargetdiffvalue()!=null){ - htmlString+=datalist.get(n).getTargetdiffvalue(); - totalTargetdiffvalue+=datalist.get(n).getTargetdiffvalue(); - }else{ - htmlString+="-"; - } - htmlString+=""; - } - }else{ - htmlString+=""; - htmlString+="-"; - htmlString+=""; - htmlString+=""; - htmlString+="-"; - htmlString+=""; - htmlString+=""; - htmlString+="-"; - htmlString+=""; - htmlString+=""; - htmlString+="-"; - htmlString+=""; - } - } - - htmlString+=""; - htmlString+=totalTargetValue; - htmlString+=""; - htmlString+=""; - htmlString+=totalTurevalue; - htmlString+=""; - htmlString+=""; - htmlString+=totalLastyearvalue; - htmlString+=""; - htmlString+=""; - htmlString+=totalLastyeardiffvalue; - htmlString+=""; - htmlString+=""; - htmlString+=totalTargetdiffvalue; - htmlString+=""; - - htmlString+=""; - } - } - } - } - } - model.addAttribute("result",htmlString); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/report/DrainageDataomprehensiveTableMainconfigureController.java b/src/com/sipai/controller/report/DrainageDataomprehensiveTableMainconfigureController.java deleted file mode 100644 index fc16276d..00000000 --- a/src/com/sipai/controller/report/DrainageDataomprehensiveTableMainconfigureController.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.sipai.controller.report; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigure; -import com.sipai.entity.user.User; -import com.sipai.service.report.DrainageDataomprehensiveTableMainconfigureService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/report/drainageDataomprehensiveTableMainconfigure") -public class DrainageDataomprehensiveTableMainconfigureController { - @Resource - private DrainageDataomprehensiveTableMainconfigureService drainageDataomprehensiveTableMainconfigureService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "report/drainageDataomprehensiveTableMainconfigureList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); -/* int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " dr.morder "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order;*/ - String orderstr=" order by dr.morder "; - String wherestr="where 1=1 "; - String sql="select dr.*,u.caption as _insuser from tb_report_drainageDataomprehensiveTable_mainconfigure dr " - + " left outer join tb_user u on u.id=dr.insuser "; -// PageHelper.startPage(pages, pagesize); - List list = this.drainageDataomprehensiveTableMainconfigureService.getownsql(sql+wherestr+orderstr); -// PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "report/drainageDataomprehensiveTableMainconfigureAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure = this.drainageDataomprehensiveTableMainconfigureService.selectById(id); - model.addAttribute("drainageDataomprehensiveTableMainconfigure",drainageDataomprehensiveTableMainconfigure ); - return "report/drainageDataomprehensiveTableMainconfigureEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("drainageDataomprehensiveTableMainconfigure") DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure){ - User cu= (User)request.getSession().getAttribute("cu"); - drainageDataomprehensiveTableMainconfigure.setId(CommUtil.getUUID()); - drainageDataomprehensiveTableMainconfigure.setInsdt(CommUtil.nowDate()); - drainageDataomprehensiveTableMainconfigure.setInsuser(cu.getId()); - int result = this.drainageDataomprehensiveTableMainconfigureService.save(drainageDataomprehensiveTableMainconfigure); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("drainageDataomprehensiveTableMainconfigure") DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure){ - int result = this.drainageDataomprehensiveTableMainconfigureService.update(drainageDataomprehensiveTableMainconfigure); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.drainageDataomprehensiveTableMainconfigureService.deleteById(id); - model.addAttribute("result",result); -// model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/deletes.do") - public String deletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.drainageDataomprehensiveTableMainconfigureService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.drainageDataomprehensiveTableMainconfigureDetailService.getownsql(sql+wherestr+orderstr); -// PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("pid",request.getParameter("pid")); - return "report/drainageDataomprehensiveTableMainconfigureDetailAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail = this.drainageDataomprehensiveTableMainconfigureDetailService.selectById(id); - model.addAttribute("drainageDataomprehensiveTableMainconfigureDetail",drainageDataomprehensiveTableMainconfigureDetail ); - return "report/drainageDataomprehensiveTableMainconfigureDetailEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("drainageDataomprehensiveTableMainconfigureDetail") DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail){ - User cu= (User)request.getSession().getAttribute("cu"); - drainageDataomprehensiveTableMainconfigureDetail.setId(CommUtil.getUUID()); - drainageDataomprehensiveTableMainconfigureDetail.setInsdt(CommUtil.nowDate()); - drainageDataomprehensiveTableMainconfigureDetail.setInsuser(cu.getId()); - int result = this.drainageDataomprehensiveTableMainconfigureDetailService.save(drainageDataomprehensiveTableMainconfigureDetail); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("drainageDataomprehensiveTableMainconfigureDetail") DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail){ - int result = this.drainageDataomprehensiveTableMainconfigureDetailService.update(drainageDataomprehensiveTableMainconfigureDetail); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.drainageDataomprehensiveTableMainconfigureDetailService.deleteById(id); - model.addAttribute("result",result); -// model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/deletes.do") - public String deletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.drainageDataomprehensiveTableMainconfigureDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.unitService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/report/ReportTemplateController.java b/src/com/sipai/controller/report/ReportTemplateController.java deleted file mode 100644 index 559cd515..00000000 --- a/src/com/sipai/controller/report/ReportTemplateController.java +++ /dev/null @@ -1,284 +0,0 @@ -package com.sipai.controller.report; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.report.BaseService; -import com.sipai.service.report.ReportEnergyPumpService; -import com.sipai.service.report.ReportTemplateService; -import com.sipai.service.report.ReportWaterBackWashEquipmentService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -//import com.sipai.tools.JasperHelper; -import com.sipai.tools.SpringContextUtil; - -@Controller -@RequestMapping("/report/reportTemplate") -public class ReportTemplateController { - @Resource - private ReportTemplateService reportTemplateService; - @Resource - private CommonFileService commonFileService; - @Resource - private ReportEnergyPumpService reportEnergyPumpService; - @Resource - private ReportWaterBackWashEquipmentService backWashEquipmentService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return"/report/reportTemplateList"; - } - - @RequestMapping("/showReportList.do") - public String showReportList(HttpServletRequest request,Model model){ - return"/report/reportListShow"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("type_id")!= null && !request.getParameter("type_id").isEmpty()) { - wherestr += " and type_id = '"+request.getParameter("type_id")+"'"; - } - if (request.getParameter("companyId")!= null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.reportTemplateService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getReportList.do") - public ModelAndView getReportList(HttpServletRequest request,Model model) { - String wherestr = " where 1=1 "; - if (request.getParameter("type_id")!= null && !request.getParameter("type_id").isEmpty()) { - wherestr += " and type_id = '"+request.getParameter("type_id")+"'"; - } - if (request.getParameter("companyId")!= null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - List list = this.reportTemplateService.selectListByWhere(wherestr+"order by insdt desc"); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("id",CommUtil.getUUID()); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - return "/report/reportTemplateAdd"; - } - - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute ReportTemplate reportTemplate) { - User cu = (User) request.getSession().getAttribute("cu"); - reportTemplate.setInsdt(CommUtil.nowDate()); - reportTemplate.setInsuser(cu.getId()); - int result = this.reportTemplateService.save(reportTemplate); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+reportTemplate.getId()+"\"}"; - model.addAttribute("result",resultstr); - return new ModelAndView("result"); - } - - @RequestMapping("/delete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="tbName") String tbName){ - int result = this.reportTemplateService.deleteById(id,tbName); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value="tbName") String tbName){ - ids = ids.replace(",","','"); - int result = this.reportTemplateService.deleteByWhere("where id in ('"+ids+"')",tbName); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ReportTemplate reportTemplate = this.reportTemplateService.selectById(id); - model.addAttribute("reportTemplate", reportTemplate); - return "/report/reportTemplateEdit"; - } - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute ReportTemplate reportTemplate) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String tbName = request.getParameter("tbName"); - //判断有没有文件上传,有上传文件的删除原来的文件 - String fileLength = request.getParameter("fileLength"); - if (Integer.parseInt(fileLength) > 0) { - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid ='"+reportTemplate.getId()+"'"); - int res = 0; - if(commfiles!=null && commfiles.size()>0){ - res = this.commonFileService.deleteByTableAWhere(tbName, "where masterid='"+reportTemplate.getId()+"'"); - } - //删除文件地址后删除文件 - /*if(res>0){ - FileUtil.deleteFile(commfiles.get(0).getAbspath()); - }*/ - } - reportTemplate.setInsdt(CommUtil.nowDate()); - reportTemplate.setInsuser(cu.getId()); - int result = this.reportTemplateService.update(reportTemplate); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+reportTemplate.getId()+"\"}"; - model.addAttribute("result",resultstr); - return new ModelAndView("result"); - } - @RequestMapping("/view.do") - public String showReportTemplate(HttpServletRequest request,Model model) { - return "/report/reportTemplateView"; - } - /** - * 显示上传页面-bootstrap-fileinput - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - */ - @RequestMapping(value = "fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response,Model model,@RequestParam(value="masterId") String masterId, - @RequestParam(value="tbName") String tbName,@RequestParam(value="nameSpace") String nameSpace) { - model.addAttribute("tbName",tbName); - model.addAttribute("masterId",masterId); - model.addAttribute("nameSpace",nameSpace); - return "report/templateFileInput"; - } - @RequestMapping(value = "getInputFileList.do") - public ModelAndView getInputFileList(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+masterId+"'"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } -// /** -// * 打印报表模板 -// * @param request -// * @param model -// * @param response -// */ -// @RequestMapping("/exportReportTemplate.do") -// public void exportTest(HttpServletRequest request,Model model,HttpServletResponse response) { -// String id = request.getParameter("id"); -// String tbName = request.getParameter("tbName"); -// String type = request.getParameter("type"); -// ReportTemplate reportTemplate = this.reportTemplateService.selectById(id); -// List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+reportTemplate.getId()+"'"); -// BaseService service = (BaseService)SpringContextUtil.getBean(reportTemplate.getTemplateType().getServiceName()); -// List listData = service.selectList(reportTemplate.getTemplateType().getType(),reportTemplate.getBizId()); -// JRDataSource jrDataSource = new JRBeanCollectionDataSource(listData); -// Map map = new HashMap(); -// String filepathSever=request.getSession().getServletContext().getRealPath("/"); -// String pjName = request.getContextPath().substring(1, request.getContextPath().length()); -// int pjindex = filepathSever.indexOf(pjName); -// -// map.put("query","cesfsef"); -// int index=list.get(0).getAbspath().indexOf("UploadFile"); -// String urlString = list.get(0).getAbspath().substring(index); -// urlString = filepathSever.substring(0,pjindex)+urlString; -// File reportFile =new File(urlString); -// JasperHelper.export(type,reportTemplate.getName(),reportFile,request,response,map,jrDataSource); -// } -// /** -// * 展示报表模板 -// * @param request -// * @param model -// * @param response -// */ -// @RequestMapping("/showReportTemplate.do") -// public void showReportTemplate(HttpServletRequest request,Model model,HttpServletResponse response) { -// String id = request.getParameter("id"); -// String tbName = request.getParameter("tbName"); -// ReportTemplate reportTemplate = this.reportTemplateService.selectById(id); -// List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+reportTemplate.getId()+"'"); -// BaseService service = (BaseService)SpringContextUtil.getBean(reportTemplate.getTemplateType().getServiceName()); -// List listData = service.selectList(reportTemplate.getTemplateType().getType(),reportTemplate.getBizId()); -// JRDataSource jrDataSource = new JRBeanCollectionDataSource(listData); -// Map map = new HashMap(); -// String filepathSever=request.getSession().getServletContext().getRealPath("/"); -// String pjName = request.getContextPath().substring(1, request.getContextPath().length()); -// int pjindex = filepathSever.indexOf(pjName); -// -// map.put("query","cesfsef"); -// int index=list.get(0).getAbspath().indexOf("UploadFile"); -// String urlString = list.get(0).getAbspath().substring(index); -// urlString = filepathSever.substring(0,pjindex)+urlString; -// File reportFile =new File(urlString); -// try { -// JasperHelper.showPdf("pdf",reportFile.getPath(),request,response,map,jrDataSource); -// } catch (JRException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// } -} diff --git a/src/com/sipai/controller/report/RptCollectModeController.java b/src/com/sipai/controller/report/RptCollectModeController.java deleted file mode 100644 index 5857f111..00000000 --- a/src/com/sipai/controller/report/RptCollectModeController.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.controller.report; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.report.RptCollectMode; -import com.sipai.service.report.RptCollectModeService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.annotation.Resource; -import javax.json.Json; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 获取报表的采集类型 - */ -@Controller -@RequestMapping("/report/rptCollectMode") -public class RptCollectModeController { - @Resource - private RptCollectModeService rptCollectModeService; - - @RequestMapping("/getRptCollectMode4Select.do") - public String getRptCollectMode4Select(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - JSONArray jsonArray = new JSONArray(); - - List list = rptCollectModeService.selectListByWhere("where 1=1 order by morder asc"); - for (RptCollectMode collectMode : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", collectMode.getName()); - jsonObject.put("text", collectMode.getContent()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/report/RptCreateController.java b/src/com/sipai/controller/report/RptCreateController.java deleted file mode 100644 index 8b3ef55b..00000000 --- a/src/com/sipai/controller/report/RptCreateController.java +++ /dev/null @@ -1,1279 +0,0 @@ -package com.sipai.controller.report; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.report.*; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.business.BusinessUnitHandleService; - -import com.sipai.service.report.*; -import com.sipai.tools.*; -import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; -import io.minio.MinioClient; -import io.minio.errors.ErrorResponseException; -import io.minio.errors.InsufficientDataException; -import io.minio.errors.InternalException; -import io.minio.errors.InvalidArgumentException; -import io.minio.errors.InvalidBucketNameException; -import io.minio.errors.InvalidEndpointException; -import io.minio.errors.InvalidPortException; -import io.minio.errors.InvalidResponseException; -import io.minio.errors.MinioException; -import io.minio.errors.NoResponseException; -import io.minio.errors.RegionConflictException; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.math.BigDecimal; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import jdk.nashorn.internal.runtime.regexp.JoniRegExp; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -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.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.FillPatternType; -import org.apache.poi.ss.usermodel.FormulaEvaluator; -import org.apache.poi.ss.usermodel.IndexedColors; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; -import org.xmlpull.v1.XmlPullParserException; - -import com.alibaba.fastjson.JSONException; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.MinioConfiguration; -import com.sipai.entity.base.Result; -import com.sipai.entity.base.Result_Report; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.TempReport; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.base.MinioTemplate; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.TempReportService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; - -/** - * 报表生成记录 - * - * @author s123 - */ -@Controller -@RequestMapping("/report/rptCreate") -public class RptCreateController { - @Resource - private RptCreateService rptCreateService; - @Resource - private UnitService unitService; - @Resource - private TempReportService tempReportService; - @Resource - private RptInfoSetService rptInfoSetService; - @Resource - private CommonFileService commonFileService; - @Resource - private RptSpSetService rptSpSetService; - @Resource - private RptMpSetService rptMpSetService; - @Resource - private RptInfoSetFileService rptInfoSetFileService; - @Resource - private RptLogService rptLogService; - @Resource - private UserService userService; - @Resource - private MPointService mPointService; - @Resource - private TaskService taskService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private RuntimeService runtimeService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private RptInfoSetSheetService rptInfoSetSheetService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - - /** - * 报表生成 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showTree.do") - public String showTree(HttpServletRequest request, Model model) { - String j_username = request.getParameter("username"); - if (j_username != null && j_username.length() > 0) { - User cu = userService.getUserByLoginName(j_username); - if (cu != null) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - } - return "report/rptCreateTree"; - } - - /** - * 报表浏览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showTree4View.do") - public String showTree4View(HttpServletRequest request, Model model) { - return "report/rptCreateTree4View"; - } - - /** - * 获取报表配置页面树形数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree.do") - public String getTree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List list = this.rptInfoSetService.selectListByWhere(" where 1=1 and unit_id='" + unitId + "' order by morder"); - String json = this.rptInfoSetService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showList4Generate.do") - public String showList4Generate(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - model.addAttribute("userId", cu.getId()); - model.addAttribute("userName", cu.getCaption()); - } - String classId = request.getParameter("classId"); - if (classId != null) { - RptInfoSet rptInfoSet = rptInfoSetService.selectById4Simple(classId); - //只有日报显示 批量生成 - if (rptInfoSet != null && rptInfoSet.getRpttype() != null && rptInfoSet.getRpttype().contains("sp_report_day")) { - model.addAttribute("addMoreView", "1"); - } - } - return "report/rptCreateList4Generate"; - } - - @RequestMapping("/showList4Check.do") - public String showList4Check(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - model.addAttribute("userId", cu.getId()); - model.addAttribute("userName", cu.getCaption()); - } - return "report/rptCreateList4Check"; - } - - @RequestMapping("/showList4View.do") - public String showList4View(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - model.addAttribute("userId", cu.getId()); - model.addAttribute("userName", cu.getCaption()); - } - return "report/rptCreateList4View"; - } - - @RequestMapping("/getList4Generate.do") - public ModelAndView getList4Generate(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " rptdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and rptset_id='" + request.getParameter("classId") + "' "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - if (request.getParameter("stdt") != null && !request.getParameter("stdt").equals("")) { - wherestr += " and insdt >= '" + request.getParameter("stdt").substring(0, 10) + " 00:00:00" + "'"; - } - if (request.getParameter("eddt") != null && !request.getParameter("eddt").equals("")) { - wherestr += " and insdt <= '" + request.getParameter("eddt").substring(0, 10) + " 23:59:59" + "'"; - } - if (request.getParameter("st") != null && !request.getParameter("st").equals("")) { - wherestr += " and status = '" + request.getParameter("st") + "' "; - } else { - wherestr += " and (status is null or status = '' or status = '报表生成')";//默认未提交 - } - - PageHelper.startPage(page, rows); - List list = this.rptCreateService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getList4Check.do") - public ModelAndView getList4Check(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String classId = request.getParameter("classId"); -// if (sort == null || sort.equals("id")) { -// sort = " rptdt "; -// } -// if (order == null) { -// order = " desc "; -// } - String orderstr = " order by rptdt desc"; - - String wherestr = "where 1=1 and rptset_id='" + request.getParameter("classId") + "' and (status != '" + RptCreate.Status_Finish + "' or status is null)"; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - if (request.getParameter("stdt") != null && !request.getParameter("stdt").equals("")) { - wherestr += " and insdt >= '" + request.getParameter("stdt").substring(0, 10) + " 00:00:00" + "'"; - } - if (request.getParameter("eddt") != null && !request.getParameter("eddt").equals("")) { - wherestr += " and insdt <= '" + request.getParameter("eddt").substring(0, 10) + " 23:59:59" + "'"; - } - - String userId = cu.getId(); - Map map = null; - List list = workflowService.findTodoTasks(userId, null, map); - - List list2 = new ArrayList(); - - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - //对象id - String id = list.get(i).getVariables().get("businessKey").toString(); - if (list.get(i).getType().contains(ProcessType.Report_Check.getId())) { - RptCreate rptCreate = rptCreateService.selectById(id); - if (rptCreate != null && rptCreate.getRptsetId() != null && rptCreate.getRptsetId().equals(classId)) { - list2.add(list.get(i));//只添加报表的待办 - } - } - } - } - - for (TodoTask todoTask : list2) { - //对象id - String id = todoTask.getVariables().get("businessKey").toString(); - Maintenance maintenance = null; - if (todoTask.getType().contains(ProcessType.Report_Check.getId())) { - RptCreate rptCreate = rptCreateService.selectById(id); - maintenance = new Maintenance(); - if (rptCreate != null) { - Company company = unitService.getCompById(rptCreate.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("报表审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - } - - /*if(ids!=null && !ids.equals("")){ - ids = ids.substring(0, ids.length()-1); - wherestr += " and id in ("+ids+")"; - }*/ - - /* PageHelper.startPage(page, rows); - List list2 = this.rptCreateService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list2); - JSONArray json = JSONArray.fromObject(list2); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result");*/ - - JSONArray json = this.workflowService.todoTasklistToJsonArray(list2); - json = jsonArraySort(json, "task", true); - String result = json.toString(); - model.addAttribute("result", result); - System.out.println(result); - return new ModelAndView("result"); - } - - @RequestMapping("/getList4View.do") - public ModelAndView getList4View(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " rptdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 and rptset_id='" + request.getParameter("classId") + "' and status = '" + RptCreate.Status_Finish + "'"; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - if (request.getParameter("stdt") != null && !request.getParameter("stdt").equals("")) { - wherestr += " and insdt >= '" + request.getParameter("stdt").substring(0, 10) + " 00:00:00" + "'"; - } - if (request.getParameter("eddt") != null && !request.getParameter("eddt").equals("")) { - wherestr += " and insdt <= '" + request.getParameter("eddt").substring(0, 10) + " 23:59:59" + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.rptCreateService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - request.setAttribute("userId", cu.getId()); - request.setAttribute("userName", cu.getCaption()); - request.setAttribute("id", CommUtil.getUUID()); - String rpttype = request.getParameter("rpttype"); - if (RptInfoSet.RptType_Day.equals(rpttype)) { - request.setAttribute("dateD", CommUtil.nowDate().substring(0, 10)); - } else if (RptInfoSet.RptType_Month.equals(rpttype) || RptInfoSet.RptType_HalfYear.equals(rpttype)) { - request.setAttribute("dateM", CommUtil.nowDate().substring(0, 7)); - } else if (RptInfoSet.RptType_Quarterly.equals(rpttype)) { - request.setAttribute("dateQ", CommUtil.nowDate().substring(0, 7)); - } else if (RptInfoSet.RptType_Year.equals(rpttype)) { - request.setAttribute("dateY", CommUtil.nowDate().substring(0, 4)); - } - - return "report/rptCreateAdd"; - } - - @RequestMapping("/doaddMore.do") - public String doaddMore(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - request.setAttribute("userId", cu.getId()); - request.setAttribute("userName", cu.getCaption()); - request.setAttribute("id", CommUtil.getUUID()); - String rpttype = request.getParameter("rpttype"); - if (RptInfoSet.RptType_Day.equals(rpttype)) { - request.setAttribute("dateD", CommUtil.nowDate().substring(0, 10)); - } else if (RptInfoSet.RptType_Month.equals(rpttype) || RptInfoSet.RptType_Quarterly.equals(rpttype) || RptInfoSet.RptType_HalfYear.equals(rpttype)) { - request.setAttribute("dateD", CommUtil.nowDate().substring(0, 7)); - } else if (RptInfoSet.RptType_Year.equals(rpttype)) { - request.setAttribute("dateY", CommUtil.nowDate().substring(0, 4)); - } - - return "report/rptCreateAddMore"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptCreate rptCreate = this.rptCreateService.selectById(id); - model.addAttribute("rptCreate", rptCreate); - return "report/rptCreateEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptCreate rptCreate = this.rptCreateService.selectById(id); - model.addAttribute("rptCreate", rptCreate); - return "report/rptCreateView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("rptCreate") RptCreate rptCreate) { - User cu = (User) request.getSession().getAttribute("cu"); - String rptsetId = request.getParameter("rptsetId"); - int result = 0; - - RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId()); - if (rptInfoSet != null) { - //日报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Day)) { - rptCreate.setRptdt(rptCreate.getRptdt().replace(",", "").substring(0, 10)); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + rptCreate.getRptdt().substring(5, 7) + "月" + rptCreate.getRptdt().substring(8, 10) + "日)"); - } - //月报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Month)) { - rptCreate.setRptdt(rptCreate.getRptdt().replace(",", "").substring(0, 7) + "-01"); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + rptCreate.getRptdt().substring(5, 7) + "月)"); - } - //季报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Quarterly)) { - rptCreate.setRptdt(rptCreate.getRptdt().replace(",", "")); - int n = Integer.parseInt(rptCreate.getRptdt().substring(5, 7)); - if (n >= 1 && n <= 3) { - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + 1 + "季度)"); - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 4) + "-01-01"); - } - if (n >= 4 && n <= 6) { - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + 2 + "季度)"); - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 4) + "-04-01"); - } - if (n >= 7 && n <= 9) { - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + 3 + "季度)"); - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 4) + "-07-01"); - } - if (n >= 10 && n <= 12) { - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + 4 + "季度)"); - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 4) + "-10-01"); - } - } - //半年报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_HalfYear)) { - if (Integer.parseInt(rptCreate.getRptdt().replace(",", "").substring(5, 7)) <= 6) { - rptCreate.setRptdt(rptCreate.getRptdt().replace(",", "").substring(0, 4) + "-01-01"); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "上半年)"); - } else { - rptCreate.setRptdt(rptCreate.getRptdt().replace(",", "").substring(0, 4) + "-07-01"); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "下半年)"); - } - } - //年报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Year)) { - rptCreate.setRptdt(rptCreate.getRptdt().replace(",", "").substring(0, 4) + "-01-01"); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().replace(",", "").substring(0, 4) + "年)"); - } - } - - List rCreates = this.rptCreateService.selectListByWhere(" where rptdt='" + rptCreate.getRptdt() + "' and unit_id='" + rptCreate.getUnitId() + "' and rptset_id = '" + rptsetId + "'"); - if (rCreates != null && rCreates.size() > 0) { - RptCreate rptCreateU = rCreates.get(0); - rptCreateU.setUpsdt(CommUtil.nowDate()); - rptCreateU.setUpsuser(cu.getId()); - rptCreateU.setInputuser(cu.getId()); - rptCreateU.setId(rCreates.get(0).getId()); - rptCreateU.setMemo(rptCreate.getMemo()); - result = this.rptCreateService.update4generate(rptCreateU); - } else { - rptCreate.setId(CommUtil.getUUID()); - rptCreate.setInsdt(CommUtil.nowDate()); - rptCreate.setInsuser(cu.getId()); - rptCreate.setUpsdt(CommUtil.nowDate()); - rptCreate.setUpsuser(cu.getId()); - rptCreate.setMemo(rptCreate.getMemo()); - result = this.rptCreateService.save(rptCreate); - } - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dosaveAgain.do") - public ModelAndView dosaveAgain(HttpServletRequest request, Model model, - @RequestParam(value = "createId") String createId) { - User cu = (User) request.getSession().getAttribute("cu"); - - int result = 0; - List rCreates = this.rptCreateService.selectListByWhere(" where id ='" + createId + "'"); - if (rCreates != null && rCreates.size() > 0) { - RptCreate rptCreateU = rCreates.get(0); - //rptCreateU.setUpsdt(CommUtil.nowDate()); - //rptCreateU.setUpsuser(cu.getId()); - //rptCreateU.setInputuser(cu.getId()); - rptCreateU.setId(rptCreateU.getId()); - result = this.rptCreateService.update(rptCreateU); - } else { - RptCreate rptCreateU = new RptCreate(); - rptCreateU.setInsdt(CommUtil.nowDate()); - rptCreateU.setInsuser(cu.getId()); - rptCreateU.setUpsdt(CommUtil.nowDate()); - rptCreateU.setUpsuser(cu.getId()); - result = this.rptCreateService.save(rptCreateU); - } - -// if (rCreates != null && rCreates.size() > 0) { -// RptInfoSet rptInfoSet = rptInfoSetService.selectById(rCreates.get(0).getRptsetId()); -// //生成excel文件 -// CreateExcel(request, cu, rCreates.get(0), rptInfoSet); -// } - - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dosaveMore.do") - public ModelAndView dosaveMore(HttpServletRequest request, Model model, - @ModelAttribute("rptCreate") RptCreate rptCreate, - @RequestParam(value = "rptdt_start") String rptdt_start, - @RequestParam(value = "rptdt_end") String rptdt_end) { - User cu = (User) request.getSession().getAttribute("cu"); - String rptsetId = request.getParameter("rptsetId"); - int result = 0; - RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId()); - if (rptInfoSet != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - try { - //起始日期 - Date start = sdf.parse(rptdt_start); - //结束日期 - Date end = sdf.parse(rptdt_end); - Date temp = start; - Calendar calendar = Calendar.getInstance(); - calendar.setTime(start); - //打印2019-01-01到2019-11-27的日期 - while (temp.getTime() < end.getTime()) { - temp = calendar.getTime(); - String s = sdf.format(temp); - System.out.println("报表日期===" + s); - //天数+1 - calendar.add(Calendar.DAY_OF_MONTH, 1); - - RptCreate rptCreate1 = new RptCreate(); - rptCreate1.setRptdt(s); - rptCreate1.setUnitId(rptCreate.getUnitId()); - //日报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Day)) { - rptCreate1.setRptdt(rptCreate1.getRptdt().replace(",", "").substring(0, 10)); - rptCreate1.setRptname(rptInfoSet.getName() + "(" + rptCreate1.getRptdt().substring(0, 4) + "年" + rptCreate1.getRptdt().substring(5, 7) + "月" + rptCreate1.getRptdt().substring(8, 10) + "日)"); - } - //月报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Month)) { - rptCreate1.setRptdt(rptCreate1.getRptdt().replace(",", "").substring(0, 7) + "-01"); - rptCreate1.setRptname(rptInfoSet.getName() + "(" + rptCreate1.getRptdt().substring(0, 4) + "年" + rptCreate1.getRptdt().substring(5, 7) + "月)"); - } - //季报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Quarterly)) { - rptCreate1.setRptdt(rptCreate1.getRptdt().replace(",", "").substring(0, 10)); - rptCreate1.setRptname(rptInfoSet.getName() + "(" + rptCreate1.getRptdt().substring(0, 4) + "年" + rptCreate1.getRptdt().substring(5, 7) + "季度)"); - } - //半年报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_HalfYear)) { - if (Integer.parseInt(rptCreate1.getRptdt().replace(",", "").substring(5, 7)) <= 6) { - rptCreate1.setRptdt(rptCreate1.getRptdt().replace(",", "").substring(0, 4) + "-01-01"); - rptCreate1.setRptname(rptInfoSet.getName() + "(" + rptCreate1.getRptdt().substring(0, 4) + "上半年)"); - } else { - rptCreate1.setRptdt(rptCreate1.getRptdt().replace(",", "").substring(0, 4) + "-07-01"); - rptCreate1.setRptname(rptInfoSet.getName() + "(" + rptCreate1.getRptdt().substring(0, 4) + "下半年)"); - } - } - //年报 - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Year)) { - rptCreate1.setRptdt(rptCreate1.getRptdt().replace(",", "").substring(0, 4) + "-01-01"); - rptCreate1.setRptname(rptInfoSet.getName() + "(" + rptCreate1.getRptdt().replace(",", "").substring(0, 4) + "年)"); - } - - //新增或修改报表 - List rCreates = this.rptCreateService.selectListByWhere(" where rptdt='" + rptCreate1.getRptdt() + "' and unit_id='" + rptCreate1.getUnitId() + "' and rptset_id = '" + rptsetId + "'"); - if (rCreates != null && rCreates.size() > 0) { - RptCreate rptCreateU = rCreates.get(0); - rptCreateU.setUpsdt(CommUtil.nowDate()); - rptCreateU.setUpsuser(cu.getId()); - rptCreateU.setInputuser(cu.getId()); - rptCreateU.setId(rCreates.get(0).getId()); - rptCreateU.setMemo(rptCreate.getMemo()); - rptCreateU.setRptdt(s); - rptCreateU.setRptname(rptCreate1.getRptname()); - result = this.rptCreateService.update4generate(rptCreateU); - } else { - rptCreate.setId(CommUtil.getUUID()); - rptCreate.setInsdt(CommUtil.nowDate()); - rptCreate.setInsuser(cu.getId()); - rptCreate.setUpsdt(CommUtil.nowDate()); - rptCreate.setUpsuser(cu.getId()); - rptCreate.setMemo(rptCreate.getMemo()); - rptCreate.setRptdt(s); - rptCreate.setRptname(rptCreate1.getRptname()); - result = this.rptCreateService.save(rptCreate); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - - } - - - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("rptCreate") RptCreate rptCreate) { - int result = this.rptCreateService.update(rptCreate); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - this.commonFileService.deleteByTableAWhere("TB_Report_RptCreateFile", "where masterid='" + id + "'"); - int res = this.rptCreateService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - this.commonFileService.deleteByTableAWhere("TB_Report_RptCreateFile", "where masterid in('" + ids + "')"); - int res = this.rptCreateService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 将小数位后面多余0去掉 - * - * @param s - * @return - */ - public static String subZeroAndDot(String s) { - if (s.indexOf(".") > 0) { - s = s.replaceAll("0+?$", "");//去掉多余的0 - s = s.replaceAll("[.]$", "");//如最后一位是.则去掉 - } - return s; - } - - @RequestMapping("viewFile.do") - public String viewFile(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "sheetName") String sheetname, - @RequestParam(value = "layerType") String layerType) { - RptCreate rptCreate = this.rptCreateService.selectById(id); - if (rptCreate != null) {//报表生成 - try { - String base = this.rptCreateService.convertExceltoHtml(CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId()), sheetname, id, layerType, FileNameSpaceEnum.RptCreateFile.getNameSpace()); - //截取掉sheet名 目前只能先截取h2 - String result = subRangeString(base, "

", "

"); - result = result.replaceAll("", "
"); - model.addAttribute("result", result); - } catch (Exception e) { - e.printStackTrace(); - } - } else {//报表配置 - RptInfoSetFile rptInfoSetFile = rptInfoSetFileService.selectById(id); - if (rptInfoSetFile != null) { - try { - String path = rptInfoSetFile.getAbspath(); - path = path.replaceAll(".xls", ""); - path = path.replaceAll(".xlsx", ""); - String base = this.rptCreateService.convertExceltoHtml(CommUtil.fixRptCreateFileName(path), sheetname, id, layerType, FileNameSpaceEnum.RptInfoSetFile.getNameSpace()); - //截取掉sheet名 目前只能先截取h2 - String result = subRangeString(base, "

", "

"); - result = result.replaceAll("
", "
"); - model.addAttribute("result", result); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - return "result"; - } - - private String subRangeString(String body, String str1, String str2) { - while (true) { - int index1 = body.indexOf(str1); - if (index1 != -1) { - int index2 = body.indexOf(str2, index1); - if (index2 != -1) { - String str3 = body.substring(0, index1) + body.substring(index2 + str2.length(), body.length()); - body = str3; - } else { - return body; - } - } else { - return body; - } - } - } - - @RequestMapping("/onlineExcel.do") - public String onlineExcel(HttpServletRequest request, Model model) { - return "report/rptOnlineExcel"; - } - - @SuppressWarnings("rawtypes") - @RequestMapping("/getSheet.do") - public String getSheet(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result_Report result1 = new Result_Report(); - RptCreate rptCreate = this.rptCreateService.selectById(id); - if (rptCreate != null) {//报表生成中的预览 - List list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptCreate.getRptsetId() + "'"); - try { - String sourcePath = ""; - byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId())); - InputStream is = new ByteArrayInputStream(isb); - String sheets = ""; - if (sourcePath.indexOf(".xlsx") > 0) { - XSSFWorkbook workBook = new XSSFWorkbook(is); - for (int i = 0; i < workBook.getNumberOfSheets(); i++) { - XSSFSheet sheet = workBook.getSheetAt(i); - sheets += sheet.getSheetName() + ","; - } - } else { - HSSFWorkbook workBook = new HSSFWorkbook(is); - for (int i = 0; i < workBook.getNumberOfSheets(); i++) { - HSSFSheet sheet = workBook.getSheetAt(i); - sheets += sheet.getSheetName() + ","; - } - } - for (RptInfoSetSheet entity : list) { - sheets = sheets.replace(entity.getSheetName() + ",", ""); - } - result1 = Result_Report.success(Result.SUCCESS, sheets); - } catch (Exception e) { - e.printStackTrace(); - result1 = Result_Report.failed("获取失败"); - } - } else {//报表配置中的预览 - RptInfoSetFile rptInfoSetFile = rptInfoSetFileService.selectById(id); - if (rptInfoSetFile != null) { - List list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptInfoSetFile.getMasterid() + "'"); - try { - String sourcePath = ""; - String path = rptInfoSetFile.getAbspath(); - path = path.replaceAll(".xls", ""); - path = path.replaceAll(".xlsx", ""); - byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), CommUtil.fixRptCreateFileName(path)); - InputStream is = new ByteArrayInputStream(isb); - String sheets = ""; - if (sourcePath.indexOf(".xlsx") > 0) { - XSSFWorkbook workBook = new XSSFWorkbook(is); - for (int i = 0; i < workBook.getNumberOfSheets(); i++) { - XSSFSheet sheet = workBook.getSheetAt(i); - sheets += sheet.getSheetName() + ","; - } - } else { - HSSFWorkbook workBook = new HSSFWorkbook(is); - for (int i = 0; i < workBook.getNumberOfSheets(); i++) { - HSSFSheet sheet = workBook.getSheetAt(i); - sheets += sheet.getSheetName() + ","; - } - } - for (RptInfoSetSheet entity : list) { - sheets = sheets.replace(entity.getSheetName() + ",", ""); - } - result1 = Result_Report.success(Result.SUCCESS, sheets); - } catch (Exception e) { - e.printStackTrace(); - result1 = Result_Report.failed("获取失败"); - } - } - } - model.addAttribute("result", CommUtil.toJson(result1)); - return "result"; - } - - /** - * 报表下载 - * - * @param request - * @param id - * @return - * @throws IOException - */ - @RequestMapping("/downloadFile4minio.do") - public void downloadFile4minio(HttpServletResponse response, HttpServletRequest request, - @RequestParam(value = "id") String id) throws IOException { - try { - String path = ""; - String name = ""; - RptCreate rptCreate = this.rptCreateService.selectById(id); - if (rptCreate != null) { - path = rptCreate.getRptname() + rptCreate.getId() + ".xls"; - name = rptCreate.getRptname() + ".xls"; - } - byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path); - InputStream object = new ByteArrayInputStream(bytes); - byte buf[] = new byte[1024]; - int length = 0; - - String fileName = new String(name.getBytes(), "ISO-8859-1");//压缩包中文名称,不然乱码 - response.reset(); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - response.setContentType("application/octet-stream"); - response.setCharacterEncoding("UTF-8"); - OutputStream outputStream = response.getOutputStream(); - // 输出文件 - while ((length = object.read(buf)) > 0) { - outputStream.write(buf, 0, length); - } - // 关闭输出流 - outputStream.close(); - } catch (Exception ex) { - response.setHeader("Content-type", "text/html;charset=UTF-8"); - String data = "文件下载失败"; - OutputStream ps = response.getOutputStream(); - ps.write(data.getBytes("UTF-8")); - } - - } - - /** - * 更新,启动流程 - */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request, Model model, - @ModelAttribute RptCreate rptCreate) { - User cu = (User) request.getSession().getAttribute("cu"); -// rptCreate.setInputuser(cu.getId()); -// rptCreate.setInsdt(CommUtil.nowDate()); - rptCreate.setStatus(RptCreate.Status_Start); - int result = 0; - try { - RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId()); - if (rptInfoSet != null) { - //不需要审核的直接进浏览 - if (rptInfoSet.getCheckst().equals(RptInfoSet.Checkst_No)) { - rptCreate.setStatus(RptCreate.Status_Finish); - result = this.rptCreateService.update(rptCreate); - //需要审核的进流程 - } else { - result = this.rptCreateService.startProcess(rptCreate); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + rptCreate.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/handleProcess.do") - public String handleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - rptCreateService.updateStatus(businessUnitHandle.getBusinessid()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转 - */ - @RequestMapping("/doAuditProcess.do") - public String doAuditProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.rptCreateService.doAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示审核 - */ - @RequestMapping("/showCreate.do") - public String showCreate(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String entityId = pInstance.getBusinessKey(); - RptCreate entity = this.rptCreateService.selectById(entityId); - model.addAttribute("entity", entity); - return "report/rptCreateCreate"; - } - - /** - * 显示审核 - */ - @RequestMapping("/showAudit.do") - public String showAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - RptCreate entity = this.rptCreateService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "report/rptCreateAudit"; - } - - /** - * 显示流程 流转信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - RptCreate entity = this.rptCreateService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_REPORT_CREATE: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_REPORT_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "report/reportCreate_processView"; - } else { - return "report/reportCreate_processView_alone"; - } - } - - public JSONArray jsonArraySort(JSONArray jsonArr, final String sortKey, final boolean is_desc) { - //存放排序结果json数组 - JSONArray sortedJsonArray = new JSONArray(); - //用于排序的list - List jsonValues = new ArrayList(); - //将参数json数组每一项取出,放入list - for (int i = 0; i < jsonArr.size(); i++) { - jsonValues.add(JSONObject.fromObject(jsonArr.getJSONObject(i))); - } - //快速排序,重写compare方法,完成按指定字段比较,完成排序 - Collections.sort(jsonValues, new Comparator() { - //排序字段 - private final String KEY_NAME = sortKey; - - //重写compare方法 - @Override - public int compare(JSONObject a, JSONObject b) { - String valA = new String(); - String valB = new String(); - try { - valA = a.getString(KEY_NAME); - valB = b.getString(KEY_NAME); - } catch (JSONException e) { - e.printStackTrace(); - } - //是升序还是降序 - if (is_desc) { - return -valA.compareTo(valB); - } else { - return -valB.compareTo(valA); - } - - } - }); - //将排序后结果放入结果jsonArray - for (int i = 0; i < jsonArr.size(); i++) { - sortedJsonArray.add(jsonValues.get(i)); - } - return sortedJsonArray; - } - - /** - * 根据定时器配置的id生成对应的报表 - * - * @param request - * @param model - * @return - * @throws IOException - * @throws InvalidKeyException - * @throws NoSuchAlgorithmException - * @throws XmlPullParserException - */ -// @RequestMapping("/doAutoGenerate.do") -// public ModelAndView doAutoGenerate(HttpServletRequest request, Model model) throws IOException, InvalidKeyException, NoSuchAlgorithmException, XmlPullParserException { -// User cu = (User) request.getSession().getAttribute("cu"); -// String rptsetId = request.getParameter("rptsetId"); -// RptCreate rptCreate = new RptCreate(); -// -// RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(rptCreate.getRptsetId()); -// -// if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Day)) { -// rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 10)); -// rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + rptCreate.getRptdt().substring(5, 7) + "月" + rptCreate.getRptdt().substring(8, 10) + "日)"); -// } -// if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Month)) { -// rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 7) + "-01"); -// rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + rptCreate.getRptdt().substring(5, 7) + "月)"); -// } -// if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Year)) { -// rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 4) + "-01-01"); -// rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年)"); -// } -// -// int result = 0; -// List rCreates = this.rptCreateService.selectListByWhere(" where rptname='" + rptCreate.getRptname() + "' and unit_id='" + rptCreate.getUnitId() + "' and rptset_id = '" + rptsetId + "'"); -// if (rCreates != null && rCreates.size() > 0) { -// rptCreate.setUpsdt(CommUtil.nowDate()); -// rptCreate.setUpsuser(cu.getId()); -// rptCreate.setInputuser(cu.getId()); -// rptCreate.setId(rptCreate.getId()); -// rptCreate.setMemo(rptCreate.getMemo()); -// result = this.rptCreateService.update(rptCreate); -// } else { -// rptCreate.setInsdt(CommUtil.nowDate()); -// rptCreate.setInsuser(cu.getId()); -// rptCreate.setUpsdt(CommUtil.nowDate()); -// rptCreate.setUpsuser(cu.getId()); -// rptCreate.setMemo(rptCreate.getMemo()); -// result = this.rptCreateService.save(rptCreate); -// } -// //生成excel文件 -// CreateExcel(request, cu, rptCreate, rptInfoSet); -// -// model.addAttribute("result", "{\"res\":\"" + result + "\"}"); -// return new ModelAndView("result"); -// } - // - - - /** - * 获取单个 报表详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/getCreateById.do") - public ModelAndView getCreateById(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - RptCreate entity = this.rptCreateService.selectById(entityId); - com.alibaba.fastjson.JSONObject jsonObject = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(entity); - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/report/RptDayLogController.java b/src/com/sipai/controller/report/RptDayLogController.java deleted file mode 100644 index b2710b2c..00000000 --- a/src/com/sipai/controller/report/RptDayLogController.java +++ /dev/null @@ -1,475 +0,0 @@ -package com.sipai.controller.report; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptDayLog; -import com.sipai.entity.report.RptDeptSet; -import com.sipai.entity.user.User; -import com.sipai.service.report.RptDayLogService; -import com.sipai.service.report.RptDeptSetService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -@Controller -@RequestMapping("/report/RptDayLog") -public class RptDayLogController { - @Resource - private RptDayLogService rptDayLogService; - @Resource - private RptDeptSetService rptDeptSetService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private UserService userService; - - @RequestMapping("/showRptDayLogList.do") - public String showRptDayLogList(HttpServletRequest request,Model model){ - String rptdeptId = request.getParameter("rptdeptId"); - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - model.addAttribute("rptDeptSet",rptDeptSet); - return "/report/rptDayLogList"; - } - @RequestMapping("/showRptDayLogListAudit.do") - public String showRptDayLogListAudit(HttpServletRequest request,Model model){ - String rptdeptId = request.getParameter("rptdeptId"); - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - model.addAttribute("rptDeptSet",rptDeptSet); - return "/report/rptDayLogListAudit"; - } - @RequestMapping("/showRptDayLogListBrowse.do") - public String showRptDayLogListBrowse(HttpServletRequest request,Model model){ - String rptdeptId = request.getParameter("rptdeptId"); - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - model.addAttribute("rptDeptSet",rptDeptSet); - return "/report/rptDayLogListBrowse"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "rptdeptId") String rptdeptId, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - if(sort==null){ - sort = " rptdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where unit_id ='"+unitId+"' and rptdept_id = '"+rptdeptId+"' "; - - String stdt = request.getParameter("stdt"); - String eddt = request.getParameter("eddt"); - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - String dateType = null; - if(rptDeptSet!=null){ - dateType = rptDeptSet.getDateType(); - } - if(stdt!=null && !stdt.equals("")){ - stdt = this.rptDayLogService.splicingRptdt(dateType, stdt); - wherestr+=" and rptdt >= '"+stdt+"' "; - } - if(eddt!=null && !eddt.equals("")){ - eddt = this.rptDayLogService.splicingRptdt(dateType, eddt); - wherestr+=" and rptdt <= '"+eddt+"' "; - } - if(request.getParameter("audit")!=null && request.getParameter("audit").equals("1")){ - wherestr+=" and status not in ('未提交','已提交','已退回') "; - } - if(request.getParameter("view")!=null && request.getParameter("view").equals("1")){ - wherestr+=" and status in ('已提交','已审核') "; - } -// System.out.println(wherestr); - PageHelper.startPage(page, rows); - List list = this.rptDayLogService.selectListByWhere(wherestr+orderstr,dateType); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value = "rptdeptId") String rptdeptId, - @RequestParam(value = "rptdt") String rptdt) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId); - - Result result = Result.success(jsonObject); -// System.out.println(jsonObject); -// System.out.println(result); - model.addAttribute("rptDayLog", jsonObject); - return "/report/rptDayLogAdd"; - } - - @RequestMapping("/doadd4App.do") - public ModelAndView doadd4App(HttpServletRequest request,Model model, - @RequestParam(value = "rptdeptId") String rptdeptId, - @RequestParam(value = "rptdt") String rptdt, - @RequestParam(value = "userId") String userId) throws IOException { - JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId); - Result result = Result.success(jsonObject); - model.addAttribute("result",result.getResult()); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "rptdeptId") String rptdeptId) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId); - model.addAttribute("rptDayLog", jsonObject); -// return "/report/reportdetail"; - return "/report/rptDayLogEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "rptdeptId") String rptdeptId) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId); - model.addAttribute("rptDayLog", jsonObject); - //return "/report/reportdetail"; - return "/report/rptDayLogView"; - } - - @RequestMapping("/doaudit.do") - public String doaudit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "rptdeptId") String rptdeptId) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId); - model.addAttribute("rptDayLog", jsonObject); - return "/report/rptDayLogAudit"; - - } - - @RequestMapping("/docheckRptdt.do") - public String docheckRptdt(HttpServletRequest request,Model model, - @RequestParam(value = "rptdeptId") String rptdeptId, - @RequestParam(value = "rptdt") String rptdt){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - boolean flag = this.rptDayLogService.checkRptdt(rptdeptId,rptdt); - model.addAttribute("result", flag); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - String json = request.getParameter("json"); - JSONObject jsonObject = JSONObject.fromObject(json); - if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) { - jsonObject.put("id", CommUtil.getUUID()); - } - - try { - this.rptDayLogService.savejson(jsonObject, userId); - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("插入失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - Result result = Result.success(null); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/onekeyAudit.do")//一键审核 - public String onekeyAudit(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids, - @RequestParam(value = "rptdeptId") String rptdeptId){ - User cu = (User) request.getSession().getAttribute("cu"); - Result result = this.rptDayLogService.onekeyAudit(ids,cu,rptdeptId); - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.rptDayLogService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/downloadExcel.do") - public String downloadExcel(HttpServletRequest request, HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "rptdeptId") String rptdeptId) { - try { - this.rptDayLogService.downloadExcel(response, unitId, rptdeptId); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } - - @RequestMapping("/importRptDayLog.do") - public String importRptDayLog(HttpServletRequest request,Model model){ - return "report/rptDayLogImport"; - } - - @RequestMapping("/doimport.do") - public String doimport(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model, - @RequestParam(value = "unitId", required=false) String unitId, - @RequestParam(value = "rptdeptId", required=false) String rptdeptId) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - MultipartRequest multipartRequest = (MultipartRequest)request; - - List fileList = multipartRequest.getFiles("filelist"); - for (MultipartFile excelFile : fileList) { - Result result = new Result(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res; - try { - res = ("xls".equals(type)) ? this.rptDayLogService.readXls(excelFile.getInputStream(),userId,unitId,rptdeptId) : this.rptDayLogService.readXlsx(excelFile.getInputStream(),userId,unitId,rptdeptId); - result = Result.success(null); - } catch (Exception e) { - e.printStackTrace(); - res=e.getMessage(); - result = Result.failed(res); - } - System.out.println(res); - }else{ - result = Result.failed("请使用excel表格导入!"); - } - }else{ - result = Result.failed("未检测到导入文件!"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - - } - return "result"; - } - - //暂时没用到 -// @RequestMapping("/dodelete.do") -// public String dodel(HttpServletRequest request,Model model, -// @RequestParam(value="id") String id){ -// int code = 0; -// try { -// code = this.rptDayLogService.deleteById(id); -// } catch (Exception e) { -// e.printStackTrace(); -// Result result = Result.failed("删除失败"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } -// Result result = new Result(); -// if (code == Result.SUCCESS) { -// result = Result.success(code); -// } else { -// result = Result.failed("删除失败"); -// } -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } - - //好像没用到 -// @RequestMapping("/checkRptdtJSON.do") -// @ResponseBody -// public Result checkRptdtJSON(HttpServletRequest request,Model model, -// @RequestParam(value = "unitId") String unitId, -// @RequestParam(value = "rptdeptId") String rptdeptId, -// @RequestParam(value = "rptdt") String rptdt){ -// User cu = (User) request.getSession().getAttribute("cu"); -// String userId = cu.getId(); -// RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); -// String type = ""; -// switch (rptDeptSet.getDateType()) { -// case "I": -// rptdt = rptdt.substring(0, 19); -// type = "I"; -// break; -// case "H": -// rptdt = rptdt.substring(0, 13)+":00:00"; -// type = "H"; -// break; -// case "D": -// rptdt = rptdt.substring(0, 10); -// type = "D"; -// break; -// } -// System.out.println(rptdt); -// List list = this.rptDayLogService.selectListByWhere(" where unit_id = '"+unitId+"' and rptdept_id = '"+rptdeptId+"' and rptdt = '"+rptdt+"'"); -// -// if(list!=null&&list.size()>0){ -// System.out.println("回显已有数据"); -// -// String id = list.get(0).getId(); -// JSONObject jsonObject = this.rptDayLogService.selectById(id); -// jsonObject.put("type", type); -// -// Result result = Result.success(jsonObject); -//// model.addAttribute("rptDayLog", jsonObject); -//// System.out.println(CommUtil.toJson(result)); -// return result; -// }else { -// System.out.println("回显新数据"); -// -// //主表记录 -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("id", ""); -// jsonObject.put("rptdeptId", rptdeptId); -// jsonObject.put("rptdt", rptdt); -// jsonObject.put("unitId", unitId); -// jsonObject.put("type", type); -// jsonObject.put("memo", ""); -// jsonObject.put("user", this.userService.getUserById(userId));//user -// -// ArrayList MPointList = this.rptDayLogService.selectMPointList(unitId,rptdeptId); -// //测量点 -// JSONArray mPointList = new JSONArray(); -// JSONArray mPointHistoryList = new JSONArray(); -// for (int i = 0; i < MPointList.size(); i++) { -// JSONObject mPoint = new JSONObject(); -// mPoint.put("mpointcode", MPointList.get(i).getMpointcode()); -// mPoint.put("parmname", MPointList.get(i).getParmname()); -// -// mPoint.put("alarmmin", MPointList.get(i).getAlarmmin()); -// mPoint.put("alarmmax", MPointList.get(i).getAlarmmax()); -// mPoint.put("forcemin", MPointList.get(i).getForcemin()); -// mPoint.put("forcemax", MPointList.get(i).getForcemax()); -// mPoint.put("visible", false); -// mPoint.put("content", ""); -// -// //历史值 -// mPoint.put("parmvalue", ""); -// -// mPointList.add(mPoint); -// -// JSONObject mPointHistoryJson = new JSONObject(); -// mPointHistoryJson.put("parmvalue", ""); -// mPointHistoryList.add(mPointHistoryJson); -// } -// jsonObject.put("mPointList", mPointList); -// jsonObject.put("mPointHistoryList", mPointHistoryList); -// -// Result result = Result.success(jsonObject); -// model.addAttribute("rptDayLog", jsonObject); -// System.out.println(CommUtil.toJson(result)); -// return result; -// } -// } - - //好像没用到 -// @RequestMapping("/dosaveJSON.do") -// public Result dosaveJSON(HttpServletRequest request,Model model){ -// User cu = (User) request.getSession().getAttribute("cu"); -// String userId = cu.getId(); -// String json = request.getParameter("json"); -// JSONObject jsonObject = JSONObject.fromObject(json); -// -// System.out.println("保存或修改,以下为传入json"); -// System.out.println(request.getParameter("json")); -// -// if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {//新增 -// -// jsonObject.put("id", CommUtil.getUUID()); -// try { -// this.rptDayLogService.savejson(jsonObject, userId); -// } catch (Exception e) { -// e.printStackTrace(); -// Result result = Result.failed("新增失败"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return result; -// } -// -// }else {//修改 -// try { -// this.rptDayLogService.savejson(jsonObject, userId); -// } catch (Exception e) { -// e.printStackTrace(); -// Result result = Result.failed("更新失败"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return result; -// } -// -// } -// -// Result result = Result.success(null); -// model.addAttribute("result", CommUtil.toJson(result)); -// return result; -// } - - //用于app获取填报数据 -- 测试 - @RequestMapping("/doedit4APP.do") - public String doedit4APP(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "rptdeptId") String rptdeptId) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId); - model.addAttribute("result", CommUtil.toJson(jsonObject)); - return "result"; - } - @RequestMapping("/dosubmit.do") - public ModelAndView dosubmit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "rptdeptId") String rptdeptId){ - User cu = (User) request.getSession().getAttribute("cu"); - Result result = this.rptDayLogService.dosubmit(id,cu,rptdeptId); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/report/RptDayValSetController.java b/src/com/sipai/controller/report/RptDayValSetController.java deleted file mode 100644 index 4eeb7c7a..00000000 --- a/src/com/sipai/controller/report/RptDayValSetController.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.controller.report; - -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptDayValSet; -import com.sipai.entity.user.User; -import com.sipai.service.report.RptDayValSetService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/report/rptDayValSet") -public class RptDayValSetController { - @Resource - private RptDayValSetService rptDayValSetService; - @Resource - private MPointService mPointService; - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "pid") String pid) { -// String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - String orderstr=" order by morder asc"; - String wherestr=" where pid = '"+pid+"'"; -// PageHelper.startPage(page, rows); - List list = this.rptDayValSetService.selectListByWhere(wherestr+orderstr); -// PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doimport.do") - public String doimport(HttpServletRequest request,Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "mpids") String mpids){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - String unitId = request.getParameter("unitId"); - -// this.rptDayValSetService.deleteByWhere("where pid = '"+pid+"'"); - - int num = 0; - String[] mpidArr = mpids.split(","); - if (mpids!=null&&!mpids.isEmpty()){ - for (int i = 0; i < mpidArr.length; i++) { - List list = rptDayValSetService.selectListByWhere("where pid = '"+pid+"' and mpid = '"+mpidArr[i]+"'"); - if(list!=null && list.size()>0){ - //已存在 - }else{ - RptDayValSet rptDayValSet = new RptDayValSet(); - rptDayValSet.setId(CommUtil.getUUID()); - rptDayValSet.setPid(pid); - rptDayValSet.setMpid(mpidArr[i]); - rptDayValSet.setUnitId(unitId); - rptDayValSet.setInsuser(userId); - rptDayValSet.setInsdt(CommUtil.nowDate()); - rptDayValSet.setMorder(i); - int code = this.rptDayValSetService.save(rptDayValSet); - if(code==1){ - num++; - } - } - } - } - Result result = new Result(); - /*if (num == mpidArr.length) { - result = Result.success(num); - } else { - result = Result.failed("导入失败"); - }*/ - if (num > 0) { - result = Result.success(num); - } else { - result = Result.failed("导入失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.rptDayValSetService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int code = this.rptDayValSetService.deleteByWhere("where id in ('"+ids+"')"); - Result result = new Result(); - if (code >= 1) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i rptDeptSetList = this.rptDeptSetService.selectListByWhere("where pid='"+pid+"' order by morder desc"); - int morder = 1; - if(rptDeptSetList!=null && rptDeptSetList.size()>0){ - if(rptDeptSetList.get(0).getMorder()!=null){ - morder = rptDeptSetList.get(0).getMorder()+1; - } - } - model.addAttribute("morder", morder); - } - model.addAttribute("id", CommUtil.getUUID()); - if(type!=null && RptInfoSet.TYPE_CATALOGUE.equals(type)) - //目录 - return new ModelAndView("/report/rptDeptSetAdd4Catalogue"); - else - //填报 - return new ModelAndView("/report/rptDeptSetAdd"); - } - - /** - * 弹出选择报表目录页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showTree4Select.do") - public String showTree4Select(HttpServletRequest request, Model model) { - return "report/rptDeptSet4Select"; - } - //填报树 - @RequestMapping("/showRptDayLogTree1.do") - public String showRptDayLogTree(HttpServletRequest request,Model model){ - return "/report/rptDayLogTree"; - } - //浏览树 - @RequestMapping("/showRptDayLogBrowseTree1.do") - public String showRptDayLogAuditTree(HttpServletRequest request,Model model){ - return "/report/rptDayLogBrowseTree"; - } - //浏览树数据(全拿) - @RequestMapping("/getTree4RptDayLogBrowse.do") - public ModelAndView getTree4RptDayLogBrowse(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId) { - String orderstr=" order by name"; - String wherestr=" where unit_id ='"+unitId+"'"; - List list = this.rptDeptSetService.selectListByWhere(wherestr+orderstr); - DateType[] dateTypes = DateType.values(); - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < dateTypes.length; i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", dateTypes[i].getId()); - jsonObject.put("text", dateTypes[i].getName()); - JSONArray jsonArray2 = new JSONArray(); - for (int j = 0; j < list.size(); j++) { - if(dateTypes[i].getId()!=null&&dateTypes[i].getId().equals(list.get(j).getDateType())){ - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", list.get(j).getId()); - jsonObject2.put("text", list.get(j).getName()); - jsonObject2.put("rptTypeStatic", dateTypes[i].getId()); - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - Result success = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(success)); - return new ModelAndView("result"); - } - //配置树数据(全拿) - @RequestMapping("/getTree4RptDeptSet.do") - public ModelAndView getTree4RptDeptSet(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId) { - String orderstr=" order by name"; - String wherestr=" where unit_id ='"+unitId+"'"; - List list = this.rptDeptSetService.selectListByWhere(wherestr+orderstr); - DateType[] dateTypes = DateType.values(); - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < dateTypes.length; i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", dateTypes[i].getId()); - jsonObject.put("text", dateTypes[i].getName()); - JSONArray jsonArray2 = new JSONArray(); - for (int j = 0; j < list.size(); j++) { - if(dateTypes[i].getId()!=null&&dateTypes[i].getId().equals(list.get(j).getDateType())){ - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", list.get(j).getId()); - jsonObject2.put("text", list.get(j).getName()); - jsonObject2.put("rptTypeStatic", list.get(j).getDateType()); - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - Result success = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(success)); - return new ModelAndView("result"); - } - //配置树数据(全拿) - @RequestMapping("/getTree4RptDeptSetAll.do") - public ModelAndView getTree4RptDeptSetAll(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId) { - String orderstr=" order by name"; - String wherestr=" where unit_id ='"+unitId+"'"; - List list = this.rptDeptSetService.selectListByWhere(wherestr+orderstr); - DateType[] dateTypes = DateType.values(); - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < dateTypes.length; i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", dateTypes[i].getId()); - jsonObject.put("text", dateTypes[i].getName()); - JSONArray jsonArray2 = new JSONArray(); - for (int j = 0; j < list.size(); j++) { - if(dateTypes[i].getId()!=null&&dateTypes[i].getId().equals(list.get(j).getDateType())){ - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", list.get(j).getId()); - jsonObject2.put("text", list.get(j).getName()); - jsonObject2.put("rptTypeStatic", list.get(j).getDateType()); - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - Result success = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(success)); - return new ModelAndView("result"); - } - //审核树数据 - @RequestMapping("/getTree4RptDayLogAudit.do") - public ModelAndView getTree4RptDayLogAudit(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - List list = this.rptDeptSetService.selectListByWhere(" where unit_id ='"+unitId+"' and checkst = '是' and checkuser like '%"+userId+"%'"+" order by insdt desc"); -// if (userId.equals("emp01")) { -// list = this.rptDeptSetService.selectListByWhere(" where unit_id ='"+unitId+"' order by insdt desc"); -// } - DateType[] dateTypes = DateType.values(); - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < dateTypes.length; i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", dateTypes[i].getId()); - jsonObject.put("text", dateTypes[i].getName()); - JSONArray jsonArray2 = new JSONArray(); - for (int j = 0; j < list.size(); j++) { - if(dateTypes[i].getId()!=null&&dateTypes[i].getId().equals(list.get(j).getDateType())){ - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", list.get(j).getId()); - jsonObject2.put("text", list.get(j).getName()); - jsonObject2.put("rptTypeStatic", list.get(j).getDateType()); - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - Result success = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(success)); - return new ModelAndView("result"); - } - //填报树数据 - @RequestMapping("/getTree4RptDayLog.do") - public ModelAndView getTree4RptDayLog(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - List userJobs = this.userJobService.selectListByWhere("where userid = '"+userId+"'"); - String str = ""; - if (userJobs.size()!=0) { - str+="and ("; - for (int i = 0; i < userJobs.size(); i++) { - if (i==(userJobs.size()-1)) { - str+="inputjob like '%"+userJobs.get(i).getJobid()+"%'"; - }else { - str+="inputjob like '%"+userJobs.get(i).getJobid()+"%' or "; - } - } - str+=")"; - }else { - str="and inputjob='asdfsdaffdsfsdfgas'";//乱打的 本意是不让这段sql搜出东西来 - } - - List list = this.rptDeptSetService.selectListByWhere(" where unit_id ='"+unitId+"' and inputuser like '%"+userId+"%' and role_type='0'"+" order by name"); - List list2 = this.rptDeptSetService.selectListByWhere(" where unit_id ='"+unitId+"' "+str+" and role_type='1'"+" order by name"); - List list3 = this.rptDeptSetService.selectListByWhere(" where unit_id ='"+unitId+"' and role_type='2'"+" order by name"); - list.addAll(list2); - list.addAll(list3); -// if (userId.equals("emp01")) { -// list = this.rptDeptSetService.selectListByWhere(" where unit_id ='"+unitId+"' order by insdt desc"); -// } - DateType[] dateTypes = DateType.values(); - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < dateTypes.length; i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", dateTypes[i].getId()); - jsonObject.put("text", dateTypes[i].getName()); - JSONArray jsonArray2 = new JSONArray(); - for (int j = 0; j < list.size(); j++) { - if(dateTypes[i].getId()!=null&&dateTypes[i].getId().equals(list.get(j).getDateType())){ - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", list.get(j).getId()); - jsonObject2.put("text", list.get(j).getName()); - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - Result success = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(success)); - return new ModelAndView("result"); - } - /** - * 获取填报配置tree - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree.do") - public ModelAndView getTree(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - //类型:目录/填报 - String type = request.getParameter("type"); - String whereStr = ""; - if(type!=null && !"".equals(type)){ - whereStr = " and type = '"+type+"' "; - } - //是否需要目录类型不可点击 - boolean disabled = false; - //请求类型:录入/审核/浏览 - String urlType = request.getParameter("urlType"); - if(urlType!=null && !"".equals(urlType)){ - disabled = true; - String str= "(type = '"+RptInfoSet.TYPE_SETTING+"' or type is null or type='') "; - if(RptInfoSet.Role_Generate.equals(urlType)){ - //录入 - List userJobs = this.userJobService.selectListByWhere("where userid = '"+cu.getId()+"'"); - String inputStr = ""; - if (userJobs.size()!=0) { - for (int i = 0; i < userJobs.size(); i++) { - inputStr+=" or inputjob like '%"+userJobs.get(i).getJobid()+"%' "; - } - } - str += "and (inputuser like '%"+cu.getId()+"%' "+inputStr+" or role_type is null or role_type ='' " - + "or (inputuser is null and role_type='0') or (inputjob is null and role_type='1')) "; - } - if(RptInfoSet.Role_Check.equals(urlType)){ - //审核 - str += " and checkst = '是' and checkuser like '%"+cu.getId()+"%'"+" "; - } - if(RptInfoSet.Role_View.equals(urlType)){ - //浏览 - - } - //目录必有 - whereStr += " and (type = '"+RptInfoSet.TYPE_CATALOGUE+"' or ( "+str+") ) "; - } - List list = this.rptDeptSetService.selectListByWhere("where unit_id='"+unitId+"' "+whereStr+" order by morder,insdt desc"); - String json = this.rptDeptSetService.getTreeList(null, list,disabled); - Result success = Result.success(json); - model.addAttribute("result", CommUtil.toJson(success)); - return new ModelAndView("result"); - } - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute RptDeptSet rptDeptSet){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - rptDeptSet.setId(CommUtil.getUUID()); - rptDeptSet.setInsuser(userId); - rptDeptSet.setInsdt(CommUtil.nowDate()); - rptDeptSet.setRoleType(0); - rptDeptSet.setCheckst("是"); - int code = this.rptDeptSetService.save(rptDeptSet); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public ModelAndView doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(id); - model.addAttribute("rptDeptSet", rptDeptSet); - String pid = rptDeptSet.getPid(); - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - RptDeptSet rptDeptSetPe = this.rptDeptSetService.selectById(pid); - model.addAttribute("pname", rptDeptSetPe.getName()); - } - String type = rptDeptSet.getType(); - if(type!=null && RptInfoSet.TYPE_CATALOGUE.equals(type)) - //目录 - return new ModelAndView("/report/rptDeptSetEdit4Catalogue"); - else{ - String auditMan=""; - String[] rptDeptSetUsers = (rptDeptSet.getInputuser()==null?"":rptDeptSet.getInputuser()).split(","); - if (rptDeptSetUsers!=null&&rptDeptSetUsers.length>0) { - for (int i = 0; i < rptDeptSetUsers.length; i++) { - User user = this.userService.getUserById(rptDeptSetUsers[i]); - if (user==null) { - break; - } - if (i==rptDeptSetUsers.length-1) { - auditMan+=user.getCaption(); - }else { - auditMan+=user.getCaption()+","; - } - } - } - - String auditMan1=""; - String[] checkusers = (rptDeptSet.getCheckuser()==null?"":rptDeptSet.getCheckuser()).split(","); - if (checkusers!=null&&checkusers.length>0) { - for (int i = 0; i < checkusers.length; i++) { - User user = this.userService.getUserById(checkusers[i]); - if (user==null) { - break; - } - if (i==checkusers.length-1) { - auditMan1+=user.getCaption(); - }else { - auditMan1+=user.getCaption()+","; - } - } - } - - String auditJob=""; - String inputjob = rptDeptSet.getInputjob(); - if (inputjob==null) { - inputjob=""; - } - List jobs = this.jobService.selectListByWhere("where id in ('"+inputjob.replace("," , "','")+"') order by CHARINDEX(','+ id +',',',"+inputjob+",')"); - if (jobs!=null&&jobs.size()>0) { - for (int i = 0; i < jobs.size(); i++) { - if (i==jobs.size()-1) { - auditJob+=jobs.get(i).getName(); - }else { - auditJob+=jobs.get(i).getName()+","; - } - } - } - - model.addAttribute("auditMan", auditMan); - model.addAttribute("auditMan1", auditMan1); - model.addAttribute("auditJob", auditJob); - //填报 - return new ModelAndView("/report/rptDeptSetEdit"); - } - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute RptDeptSet rptDeptSet){ - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - rptDeptSet.setUpsuser(userId); - rptDeptSet.setUpsdt(CommUtil.nowDate()); - if (rptDeptSet.getRoleType()==null) { - rptDeptSet.setRoleType(2); - } - int code = this.rptDeptSetService.update(rptDeptSet); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.rptDeptSetService.deleteById(id); - //this.rptDeptSetUserService.deleteByWhere("where rptdept_id = '" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - this.rptDayValSetService.deleteByWhere("where pid='"+id+"' "); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getDateType4Select.do") - public String getDateType4Select(HttpServletRequest request,Model model){ - model.addAttribute("result", DateType.getAllDateType4JSON()); - return "result"; - } - - @RequestMapping("/getMessageType4Select.do") - public String getMessageType4Select(HttpServletRequest request,Model model){ - String json = ""; - json += "{\"id\":\""+"WriteDataBoth"+"\",\"text\":\""+"消息+短信"+"\"}"; - json += ",{\"id\":\""+"WriteDataMsg"+"\",\"text\":\""+"消息"+"\"}"; - json += ",{\"id\":\""+"WriteDataSms"+"\",\"text\":\""+"短信"+"\"}"; - json = "[" + json + "]"; - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getRoleType4Select.do") - public String getRoleType4Select(HttpServletRequest request,Model model){ - String json = ""; - json += "{\"id\":\""+"0"+"\",\"text\":\""+"人员"+"\"}"; - json += ",{\"id\":\""+"1"+"\",\"text\":\""+"岗位"+"\"}"; - json = "[" + json + "]"; - model.addAttribute("result", json); - return "result"; - } - -} diff --git a/src/com/sipai/controller/report/RptInfoSetController.java b/src/com/sipai/controller/report/RptInfoSetController.java deleted file mode 100644 index 5815ddeb..00000000 --- a/src/com/sipai/controller/report/RptInfoSetController.java +++ /dev/null @@ -1,637 +0,0 @@ -package com.sipai.controller.report; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.base.Result_Report; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.report.*; -import com.sipai.entity.user.Unit; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.report.RptInfoSetFileService; -import com.sipai.service.report.RptInfoSetSheetService; -import com.sipai.service.user.UserService; - -import com.sipai.tools.CommString; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.report.RptInfoSetService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -/** - * 报表信息设置 主表 - * - * @author s123 - */ -@Controller -@RequestMapping("/report/rptInfoSet") -public class RptInfoSetController { - @Resource - private RptInfoSetService rptInfoSetService; - @Resource - private UnitService unitService; - @Resource - private CommonFileService commonFileService; - @Resource - private WorkflowService workflowService; - @Resource - private RptCreateService rptCreateService; - @Resource - private CompanyService companyService; - @Resource - private RptInfoSetSheetService rptInfoSetSheetService; - @Resource - private RptInfoSetFileService rptInfoSetFileService; - - @RequestMapping("/showTree.do") - public String showTree(HttpServletRequest request, Model model) { - return "report/rptInfoSetTree"; - } - - /** - * 获取报表配置tree - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree.do") - public String getTree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String json = ""; - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", "all"); -// List list = this.rptInfoSetService.selectListByWhere(" where 1=1 and unit_id='" + unitId + "' order by morder"); -// String json = this.rptInfoSetService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取报表生成tree - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree4Generate.do") - public String getTree4Generate(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = null; - String json = ""; -// Company company = this.companyService.selectByPrimaryKey(unitId); - if (cu != null && cu.getId().equals("emp01")) { - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", "all"); -// list = this.rptInfoSetService.selectListByWhere("where unit_id='" + unitId + "' order by morder"); -// json = this.rptInfoSetService.getTreeList(null, list); - } else { - String roleIds = this.rptInfoSetService.getRptInfoSetIds(cu.getId(), unitId, RptInfoSet.Role_Generate); - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", roleIds); -// list = this.rptInfoSetService.selectListByWhere4Generate(cu.getId(), unitId); - } -// String json = this.rptInfoSetService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取报表审核tree - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree4Check.do") - public String getTree4Check(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - - - String userId = cu.getId(); - Map map = null; - List list = workflowService.findTodoTasks(userId, null, map); - - List str = new ArrayList(); - - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - //对象id - String id = list.get(i).getVariables().get("businessKey").toString(); - if (list.get(i).getType().contains(ProcessType.Report_Check.getId())) { - RptCreate rptCreate = rptCreateService.selectById(id); - if (rptCreate != null) { - str.add(rptCreate.getRptsetId());//只添加报表的待办 - } - } - } - } - - String json = ""; - if (cu != null && cu.getId().equals("emp01")) { - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", "all"); - } else { - String roleIds = this.rptInfoSetService.getRptInfoSetIds(cu.getId(), unitId, RptInfoSet.Role_Check); - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", roleIds); - } - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取报表审核tree - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getTree4View.do") - public String getTree4View(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = null; - String json = ""; - if (cu != null && cu.getId().equals("emp01")) { - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", "all"); - } else { - String roleIds = this.rptInfoSetService.getRptInfoSetIds(cu.getId(), unitId, RptInfoSet.Role_View); - json = this.rptInfoSetService.getChildrenUnitIdTree(null, unitId, "", roleIds); - } - model.addAttribute("result", json); - return "result"; - } - -// @RequestMapping("/getList.do") -// public String getList(HttpServletRequest request, Model model){ -// String unitId = request.getParameter("unitId"); -// List list = this.rptInfoSetService.selectListByWhere(" where 1=1 and pid!='-1' and unit_id='"+unitId+"' order by morder"); -// String json = this.rptInfoSetService.getTreeList(null, list); -// model.addAttribute("result", json); -// return "result"; -// } - - /** - * 获取报表配置数据 去除目录 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String orderstr = " order by morder"; - String wherestr = "where 1=1 and type='" + RptInfoSet.TYPE_SETTING + "' "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.rptInfoSetService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(pid); - model.addAttribute("pname", rptInfoSet.getName()); - } - model.addAttribute("id", CommUtil.getUUID()); - return "report/rptInfoSetAdd"; - } - - @RequestMapping("/doaddSimple.do") - public String doaddSimple(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(pid); - if (rptInfoSet != null) { - model.addAttribute("pname", rptInfoSet.getName()); - model.addAttribute("pid", pid); - } else { - model.addAttribute("pid", "-1"); - } - } else { - model.addAttribute("pid", "-1"); - } - model.addAttribute("id", CommUtil.getUUID()); - return "report/rptInfoSetAddSimple"; - } - - /** - * 报表编辑页面 - * - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(id); - if (rptInfoSet != null) { - RptInfoSet rptInfoSet2 = this.rptInfoSetService.selectById(rptInfoSet.getPid()); - if (rptInfoSet2 != null) { - model.addAttribute("pname", rptInfoSet2.getName()); - } - } - model.addAttribute("rptInfoSet", rptInfoSet); - return "report/rptInfoSetEdit"; - } - - /** - * 目录编辑页面 - * - * @return - */ - @RequestMapping("/doeditSimple.do") - public String doeditSimple(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(id); - if (rptInfoSet != null) { - RptInfoSet rptInfoSet2 = this.rptInfoSetService.selectById(rptInfoSet.getPid()); - if (rptInfoSet2 != null) { - model.addAttribute("pname", rptInfoSet2.getName()); - } - } - model.addAttribute("rptInfoSet", rptInfoSet); - return "report/rptInfoSetEditSimple"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(id); - model.addAttribute("rptInfoSet", rptInfoSet); - return "report/rptInfoSetView"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("rptInfoSet") RptInfoSet rptInfoSet) { - User cu = (User) request.getSession().getAttribute("cu"); -// acceptanceModel.setId(CommUtil.getUUID()); - rptInfoSet.setInsuser(cu.getId()); - rptInfoSet.setInsdt(CommUtil.nowDate()); - - int code = this.rptInfoSetService.save(rptInfoSet); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("rptInfoSet") RptInfoSet rptInfoSet) { - int code = 0; - if (rptInfoSet != null) { - code = this.rptInfoSetService.update(rptInfoSet); - } else { - code = Result.FAILED; - } - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.rptInfoSetService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.rptInfoSetService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 显示上传页面-bootstrap-fileinput - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping("/fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "base/fileinputForAcceptanceModel"; - } - - /** - * 上传文件通用接口 - * - * @param request 请求体 - */ - @RequestMapping("/inputFile.do") - public ModelAndView inputFile(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathSever.replaceAll(contextPath, "UploadFile" + "/" + nameSpace + "/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date()) + fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int) item.getSize()); - int res = commonFileService.insertByTable(tbName, commonFile); - - if (res == 1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + commonFile.getId() + "'"); - if (commfiles != null && commfiles.size() > 0) { - String excelpath = commfiles.get(0).getAbspath(); - String filename = commfiles.get(0).getFilename(); - - //生成HTM文件 - //设置文件的文件夹 - String fileforder = request.getRealPath("") + "_tohtm/" + nameSpace; -// System.out.println(fileforder); - try { - File file = new File(fileforder); - if (!file.exists()) { - file.mkdir(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 弹出选择报表目录页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showTree4Select.do") - public String showTree4Select(HttpServletRequest request, Model model) { - return "report/rptInfoSet4Select"; - } - - /** - * 根据id查询配置详情 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/getInfo.do") - public ModelAndView getInfo(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(id); - JSONArray json = JSONArray.fromObject(rptInfoSet); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - - @RequestMapping("/getSheetHide.do") - public String getSheetHide(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + id + "'"); - String result = "{\"total\":" + list.size() + ",\"rows\":" + CommUtil.toJson(list) + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showSheetAll.do") - public String showSheetAll(HttpServletRequest request, Model model) { - return "report/rptInfoSetSheetList"; - } - - @RequestMapping("/getSheetAll.do") - public ModelAndView getSheetAll(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String id = request.getParameter("id"); - - String orderstr = " order by id asc"; - String wherestr = "where 1=1 "; - - if (id != null && !id.equals("")) { - wherestr += " and masterid = '" + id + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.rptInfoSetFileService.selectListByWhere(wherestr + orderstr); - List list_sheet = new ArrayList<>(); - if (list != null && list.size() > 0) { - try { - String sourcePath = ""; - byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), list.get(0).getAbspath()); - InputStream is = new ByteArrayInputStream(isb); - String sheets = ""; - HSSFWorkbook workBook = new HSSFWorkbook(is); - for (int i = 0; i < workBook.getNumberOfSheets(); i++) { - HSSFSheet sheet = workBook.getSheetAt(i); - - RptInfoSetSheet rptInfoSetSheet = new RptInfoSetSheet(); - rptInfoSetSheet.setId(CommUtil.getUUID()); - rptInfoSetSheet.setSheetName(sheet.getSheetName()); - list_sheet.add(rptInfoSetSheet); - } - } catch (Exception e) { - System.out.println(e); - } - } - - PageInfo pi = new PageInfo(list_sheet); - JSONArray json = JSONArray.fromObject(list_sheet); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave4Sheet.do") - public String dosave4Sheet(HttpServletRequest request, Model model, - @RequestParam(value = "names") String names, - @RequestParam(value = "rptInfoSetId") String rptInfoSetId) { - Result result = new Result(); - int num = 0; - if (names != null && !names.equals("")) { - String[] name = names.split(","); - for (String s : name) { - RptInfoSetSheet rptInfoSetSheet = new RptInfoSetSheet(); - rptInfoSetSheet.setId(CommUtil.getUUID()); - rptInfoSetSheet.setSheetName(s); - rptInfoSetSheet.setRptinfosetId(rptInfoSetId); - num += rptInfoSetSheetService.save(rptInfoSetSheet); - } - } - if (num > 0) { - result = Result.success(num); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deleteSheet.do") - public String deleteSheet(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.rptInfoSetSheetService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getRoleType4Select.do") - public String getRoleType4Select(HttpServletRequest request, Model model) { - String json = ""; - json += "{\"id\":\"" + "0" + "\",\"text\":\"" + "人员" + "\"}"; - json += ",{\"id\":\"" + "1" + "\",\"text\":\"" + "岗位" + "\"}"; - json = "[" + json + "]"; - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/report/RptInfoSetFileController.java b/src/com/sipai/controller/report/RptInfoSetFileController.java deleted file mode 100644 index cb1c5c11..00000000 --- a/src/com/sipai/controller/report/RptInfoSetFileController.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.sipai.controller.report; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.report.RptCreate; -import com.sipai.service.base.CommonFileService; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptInfoSetFile; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.report.RptInfoSetFileService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/report/rptInfoSetFile") -public class RptInfoSetFileController { - @Resource - private RptInfoSetFileService rptInfoSetFileService; - @Resource - private UnitService unitService; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/rptInfoSetFileList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.rptInfoSetFileService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-SZHY-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - } - request.setAttribute("id", CommUtil.getUUID()); - return "process/rptInfoSetFileAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptInfoSetFile rptInfoSetFile = this.rptInfoSetFileService.selectById(id); - model.addAttribute("rptInfoSetFile", rptInfoSetFile); - return "process/rptInfoSetFileEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptInfoSetFile rptInfoSetFile = this.rptInfoSetFileService.selectById(id); - model.addAttribute("rptInfoSetFile", rptInfoSetFile); - return "process/rptInfoSetFileView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("rptInfoSetFile") RptInfoSetFile rptInfoSetFile) { - User cu = (User) request.getSession().getAttribute("cu"); - rptInfoSetFile.setInsdt(CommUtil.nowDate()); - rptInfoSetFile.setInsuser(cu.getId()); - int result = this.rptInfoSetFileService.save(rptInfoSetFile); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("rptInfoSetFile") RptInfoSetFile rptInfoSetFile) { - int result = this.rptInfoSetFileService.update(rptInfoSetFile); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.rptInfoSetFileService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.rptInfoSetFileService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/downloadFile4minio.do") - public void downloadFile4minio(HttpServletResponse response, HttpServletRequest request, - @RequestParam(value = "id") String id) throws IOException { - try { - String path = ""; - String name = ""; - String tbName = request.getParameter("tbName"); - byte[] bytes = new byte[0]; - if(StringUtils.isNotBlank(tbName)) { - List commonFiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - if (commonFiles != null && commonFiles.size() > 0) { - path = commonFiles.get(0).getAbspath(); - name = commonFiles.get(0).getFilename(); - bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.ReamrkFile.getNameSpace(), path); - } - } else { - RptInfoSetFile rptInfoSetFile = this.rptInfoSetFileService.selectById(id); - if (rptInfoSetFile != null) { - path = rptInfoSetFile.getAbspath(); - name = rptInfoSetFile.getFilename(); - bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path); - } - } - - InputStream object = new ByteArrayInputStream(bytes); - byte buf[] = new byte[1024]; - int length = 0; - - String fileName = new String(name.getBytes(), "ISO-8859-1");//压缩包中文名称,不然乱码 - response.reset(); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - response.setContentType("application/octet-stream"); - response.setCharacterEncoding("UTF-8"); - OutputStream outputStream = response.getOutputStream(); - // 输出文件 - while ((length = object.read(buf)) > 0) { - outputStream.write(buf, 0, length); - } - // 关闭输出流 - outputStream.close(); - } catch (Exception ex) { - response.setHeader("Content-type", "text/html;charset=UTF-8"); - String data = "文件下载失败"; - OutputStream ps = response.getOutputStream(); - ps.write(data.getBytes("UTF-8")); - } - - } -} diff --git a/src/com/sipai/controller/report/RptLogController.java b/src/com/sipai/controller/report/RptLogController.java deleted file mode 100644 index 58c145ec..00000000 --- a/src/com/sipai/controller/report/RptLogController.java +++ /dev/null @@ -1,256 +0,0 @@ -package com.sipai.controller.report; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.report.RptCreate; -import com.sipai.service.report.RptCreateService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.ibatis.jdbc.Null; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptLog; -import com.sipai.entity.user.User; -import com.sipai.service.report.RptLogService; -import com.sipai.tools.CommUtil; - -import java.io.IOException; -import java.util.List; - -@Controller -@RequestMapping("/report/rptLog") -public class RptLogController { - @Resource - private RptLogService rptLogService; - @Resource - private RptCreateService rptCreateService; - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @RequestParam(value = "sheet") String sheet, - @RequestParam(value = "creatId") String creatId, - @RequestParam(value = "type") String type, - @RequestParam(value = "posx") String posx, - @RequestParam(value = "posy") String posy, - @RequestParam(value = "posx_e") String posx_e, - @RequestParam(value = "posy_e") String posy_e, - @RequestParam(value = "beforeValue") String beforeValue, - @RequestParam(value = "afterValue") String afterValue) throws IOException, ParserConfigurationException, TransformerException { - int result = 0; - User cu = (User) request.getSession().getAttribute("cu"); - RptLog rptLog = new RptLog(); - rptLog.setId(CommUtil.getUUID()); - rptLog.setInsdt(CommUtil.nowDate()); - rptLog.setInsuser(cu.getId()); - rptLog.setSheet(sheet); - rptLog.setCreatId(creatId); - rptLog.setType(type); - rptLog.setPosx(posx); - rptLog.setPosy(posy); - rptLog.setPosxE(posx_e); - rptLog.setPosyE(posy_e); - rptLog.setBeforeValue(beforeValue);//修改前值 - rptLog.setAfterValue(afterValue);//修改后值 - rptLog.setStatus(RptLog.RptLog_Status_1); - - RptCreate rptCreate = rptCreateService.selectById(creatId); - if (rptCreate != null) { -// this.rptLogService.deleteByWhere("where creat_id = '" + creatId + "' and sheet = '" + sheet + "' and posx = '" + posx + "' and posy = '" + posy + "'"); - //保存修改日志 - result = this.rptLogService.save(rptLog); - if (result == 1) { - rptLogService.updateExcel(rptCreate.getRptname() + rptCreate.getId() + ".xls", sheet, afterValue, Integer.parseInt(posx_e), Integer.parseInt(posy_e)); - } - } - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave4Space.do") - public ModelAndView dosave4Space(HttpServletRequest request, Model model, - @RequestParam(value = "sheet") String sheet, - @RequestParam(value = "creatId") String creatId, - @RequestParam(value = "type") String type, - @RequestParam(value = "posx") String posx, - @RequestParam(value = "posy") String posy, - @RequestParam(value = "posx_e") String posx_e, - @RequestParam(value = "posy_e") String posy_e, - @RequestParam(value = "beforeValue") String beforeValue, - @RequestParam(value = "afterValue") String afterValue) throws IOException, ParserConfigurationException, TransformerException { - int result = 0; - User cu = (User) request.getSession().getAttribute("cu"); - RptLog rptLog = new RptLog(); - rptLog.setId(CommUtil.getUUID()); - rptLog.setInsdt(CommUtil.nowDate()); - rptLog.setInsuser(cu.getId()); - rptLog.setSheet(sheet); - rptLog.setCreatId(creatId); - rptLog.setType(type); - rptLog.setPosx(posx); - rptLog.setPosy(posy); - rptLog.setPosxE(posx_e); - rptLog.setPosyE(posy_e); - rptLog.setBeforeValue(beforeValue); - rptLog.setAfterValue(" "); - rptLog.setRemark(""); - rptLog.setStatus(RptLog.RptLog_Status_1); - - RptCreate rptCreate = rptCreateService.selectById(creatId); - if (rptCreate != null) { - this.rptLogService.deleteByWhere("where creat_id = '" + creatId + "' and sheet = '" + sheet + "' and posx = '" + posx + "' and posy = '" + posy + "'"); - //保存修改日志 - result = this.rptLogService.saveSelective(rptLog); - if (result == 1) { - rptLogService.updateExcel(rptCreate.getRptname() + rptCreate.getId() + ".xls", sheet, afterValue, Integer.parseInt(posx_e), Integer.parseInt(posy_e)); - } - } - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @RequestParam(value = "sheet") String sheet, - @RequestParam(value = "creatId") String creatId, - @RequestParam(value = "type") String type, - @RequestParam(value = "posx") String posx, - @RequestParam(value = "posy") String posy) { - User cu = (User) request.getSession().getAttribute("cu"); - String beforeValue = request.getParameter("beforeValue"); - String afterValue = request.getParameter("afterValue"); - RptLog rptLog = new RptLog(); - rptLog.setInsdt(CommUtil.nowDate()); - rptLog.setInsuser(cu.getId()); - rptLog.setSheet(sheet); - rptLog.setCreatId(creatId); - rptLog.setType(type); - rptLog.setPosx(posx); - rptLog.setPosy(posy); -// rptLog.setBeforeValue(beforeValue); -// rptLog.setAfterValue(afterValue); - rptLog.setStatus(RptLog.RptLog_Status_1); - - String sql = "where posx = '" + posx + "' and posy = '" + posy + "' and creat_id = '" + creatId + "' and sheet = '" + sheet + "' and type = '" + type + "'"; - RptLog rpt = rptLogService.selectByWhere(sql); - int result = 0; - if (rpt != null) { - rptLog.setId(rpt.getId()); - result = this.rptLogService.update(rptLog); - } else { - rptLog.setId(CommUtil.getUUID()); - result = this.rptLogService.save(rptLog); - } - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.rptLogService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.rptLogService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String createId = request.getParameter("createId");//报表id - String posx = request.getParameter("posx"); - String posy = request.getParameter("posy"); - - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 and creat_id='" + createId + "' and posx = '" + posx + "' and posy = '" + posy + "'"; - - PageHelper.startPage(page, rows); - List list = this.rptLogService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getJson.do") - public ModelAndView getJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String creatId = request.getParameter("creatId");//报表id - String sheet = request.getParameter("sheet");//报表sheet - - String wherestr = "where 1=1 "; - - if (creatId != null && !creatId.trim().equals("")) { - wherestr += " and creat_id = '" + creatId + "'"; - } else { - wherestr += " and creat_id = 'false'"; - } - - if (sheet != null && !sheet.trim().equals("")) { - wherestr += " and sheet = '" + sheet + "'"; - } - - List list = this.rptLogService.selectListByWhere(wherestr); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /*@RequestMapping("/test.do") - public ModelAndView test(HttpServletRequest request, Model model) { - List loglist =this.rptLogService.selectListByWhere(" where creat_id='2bb278877a8d47b0a2733cc1ac5f6372' and sheet='s2' "); - JSONObject obj = this.rptLogService.getJsonByXY(Integer.valueOf(2), Integer.valueOf(2), loglist); - if(obj== null ||obj.size()==0){ - Result result = Result.failed("只有原始数据才能添加数据备注"); - model.addAttribute("result", CommUtil.toJson(result)); - }else{ - Result result = Result.failed("2222222"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - }*/ - -} \ No newline at end of file diff --git a/src/com/sipai/controller/report/RptMpSetController.java b/src/com/sipai/controller/report/RptMpSetController.java deleted file mode 100644 index db9b0ce2..00000000 --- a/src/com/sipai/controller/report/RptMpSetController.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.controller.report; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.report.RptSpSet; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptDayValSet; -import com.sipai.entity.report.RptMpSet; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.report.RptMpSetService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/report/rptMpSet") -public class RptMpSetController { - @Resource - private RptMpSetService rptMpSetService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/report/rptMpSetList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String unitId = request.getParameter("unitId"); - String id = request.getParameter("id"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 "; - - /*if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - }*/ - if (id != null && !id.equals("")) { - wherestr += " and pid = '" + id + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.rptMpSetService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - //request.setAttribute("uuId3", CommUtil.getUUID()); - model.addAttribute("uuId3", CommUtil.getUUID()); - return "report/rptMpSetAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptMpSet rptMpSet = this.rptMpSetService.selectById(id); - model.addAttribute("rptMpSet", rptMpSet); - return "report/rptMpSetEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptMpSet rptMpSet = this.rptMpSetService.selectById(id); - model.addAttribute("rptMpSet", rptMpSet); - return "report/rptMpSetView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("rptMpSet") RptMpSet rptMpSet) { - User cu = (User) request.getSession().getAttribute("cu"); - rptMpSet.setInsdt(CommUtil.nowDate()); - rptMpSet.setInsuser(cu.getId()); - int result = this.rptMpSetService.save(rptMpSet); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - /** - * 保存导入的测量点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dosaveMp.do") - public ModelAndView dosaveMp(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "id") String id) { - User cu = (User) request.getSession().getAttribute("cu"); - int code = this.rptMpSetService.saveMp(ids, id); - Result result = null; - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 插入横杠 - * - * @param request - * @param model - * @param - * @param id - * @return - */ - @RequestMapping("/dosaveRod.do") - public ModelAndView dosaveRod(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int code = this.rptMpSetService.saveRod(id); - Result result = null; - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 插入日期 - * - * @param request - * @param model - * @param - * @param id - * @return - */ - @RequestMapping("/dosaveDt.do") - public ModelAndView dosaveDt(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int code = this.rptMpSetService.saveDt(id); - Result result = null; - if (code >= Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("rptMpSet") RptMpSet rptMpSet) { - int result = this.rptMpSetService.update(rptMpSet); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "rptMpSetId") String rptMpSetId) { - int res = this.rptMpSetService.deleteById(id, rptMpSetId); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "rptMpSetId") String rptMpSetId) { - ids = ids.replace(",", "','"); - int res = this.rptMpSetService.deleteByWhere("where id in('" + ids + "')", rptMpSetId); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 测量点拖拽排序 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - - //先查出当前页面最小morder - int mor = 0; - for (int i = 0; i < json.size(); i++) { - jsonOne = json.getJSONObject(i); - if (mor == 0) { - mor = Integer.parseInt(jsonOne.get("morder").toString()); - } else { - if (Integer.parseInt(jsonOne.get("morder").toString()) < mor) { - //小于 - mor = Integer.parseInt(jsonOne.get("morder").toString()); - } else { - //大于 - } - } - } - - //直接从最小morder开始累加 - for (int i = 0; i < json.size(); i++, mor++) { - RptMpSet rptMpSet = new RptMpSet(); - jsonOne = json.getJSONObject(i); - rptMpSet.setId((String) jsonOne.get("id")); - rptMpSet.setMorder(mor); - result = this.rptMpSetService.update(rptMpSet); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 查询指定行的 上下行显示 - * - * @param request - * @param model - * @param id - * @param pid - * @param morder - * @return - */ - @RequestMapping("/selectMorder.do") - public ModelAndView selectMorder(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "morder") int morder, - @RequestParam(value = "unitId") String unitId) { - List list = rptMpSetService.selectListByWhere("where pid = '" + pid + "' and morder = '" + (morder) + "'"); - List list2 = rptMpSetService.selectListByWhere("where pid = '" + pid + "' and morder = '" + (morder + 1) + "'"); - - String previous = "";//上一行点位 - String next = "";//下一行点位 - - if (list != null && list.size() > 0) { - MPoint mPoint = mPointService.selectById(unitId, list.get(0).getMpid()); - if (mPoint != null) { - previous = mPoint.getParmname(); - } else { - previous = list.get(0).getMpid(); - } - } else { - previous = "无"; - } - - if (list2 != null && list2.size() > 0) { - MPoint mPoint = mPointService.selectById(unitId, list2.get(0).getMpid()); - if (mPoint != null) { - next = mPoint.getParmname(); - } else { - next = list2.get(0).getMpid(); - } - } else { - next = "无"; - } - String result = "{\"previous\":\"" + previous + "\",\"next\":\"" + next + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/report/RptSpSetController.java b/src/com/sipai/controller/report/RptSpSetController.java deleted file mode 100644 index f6f22219..00000000 --- a/src/com/sipai/controller/report/RptSpSetController.java +++ /dev/null @@ -1,300 +0,0 @@ -package com.sipai.controller.report; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.enums.SourceTypeEnum; -import com.sipai.entity.report.*; -import com.sipai.tools.MinioProp; -import io.minio.MinioClient; -import io.minio.errors.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -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.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.base.Result_Report; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.process.ProcessAdjustmentType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.report.RptInfoSetFileService; -import com.sipai.service.report.RptSpSetService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import org.xmlpull.v1.XmlPullParserException; - -@Controller -@RequestMapping("/report/rptSpSet") -public class RptSpSetController { - @Resource - private RptSpSetService rptSpSetService; - @Resource - private UnitService unitService; - @Resource - private RptInfoSetFileService rptInfoSetFileService; - @Autowired - private MinioProp minioProp; - @Resource - private CommonFileService commonFileService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/report/rptSpSetList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String id = request.getParameter("id"); - String sheet = request.getParameter("sheet"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } -// String orderstr = " order by morder asc"; - String orderstr = " order by sheet,posx,posy asc"; - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - if (id != null && !id.equals("")) { - wherestr += " and pid = '" + id + "' "; - } - - if (StringUtils.isNotBlank(sheet)) { - wherestr += " and sheet = '" + sheet + "' "; - } - - if (type != null && !type.equals("")) { - if (type.equals(RptSpSet.RptSpSet_Type_Cal)) { - wherestr += " and type='" + RptSpSet.RptSpSet_Type_Cal + "'"; - } else { - wherestr += " and type!='" + RptSpSet.RptSpSet_Type_Cal + "'"; - } - } - - PageHelper.startPage(page, rows); -// System.out.println(wherestr); - List list = this.rptSpSetService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - @RequestMapping("/getSheetNameList.do") - public ModelAndView getSheetNameList(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String id = request.getParameter("id"); - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - if (id != null && !id.equals("")) { - wherestr += " and pid = '" + id + "' "; - } - - if (type != null && !type.equals("")) { - if (type.equals(RptSpSet.RptSpSet_Type_Cal)) { - wherestr += " and type='" + RptSpSet.RptSpSet_Type_Cal + "'"; - } else { - wherestr += " and type!='" + RptSpSet.RptSpSet_Type_Cal + "'"; - } - } - - List list = this.rptSpSetService.selectSheetNameList(wherestr); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - //新增sp--数据 - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("uuId2", CommUtil.getUUID()); - return "report/rptSpSetAdd"; - } - - //新增sp--其他 如 记录人、确认人、日期等 - @RequestMapping("/doaddOther.do") - public String doaddOther(HttpServletRequest request, Model model) { - request.setAttribute("uuId2", CommUtil.getUUID()); - return "report/rptSpSetAddOther"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptSpSet rptSpSet = this.rptSpSetService.selectById(id); - model.addAttribute("rptSpSet", rptSpSet); - return "report/rptSpSetEdit"; - } - - //修改sp--其他 如 记录人、确认人、日期等 - @RequestMapping("/doeditOther.do") - public String doeditOther(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptSpSet rptSpSet = this.rptSpSetService.selectById(id); - model.addAttribute("rptSpSet", rptSpSet); - return "report/rptSpSetEditOther"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptSpSet rptSpSet = this.rptSpSetService.selectById(id); - model.addAttribute("rptSpSet", rptSpSet); - return "report/rptSpSetView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("rptSpSet") RptSpSet rptSpSet) { - User cu = (User) request.getSession().getAttribute("cu"); - rptSpSet.setInsdt(CommUtil.nowDate()); - rptSpSet.setInsuser(cu.getId()); - int result = this.rptSpSetService.save(rptSpSet); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("rptSpSet") RptSpSet rptSpSet) { - int result = this.rptSpSetService.update(rptSpSet); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.rptSpSetService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.rptSpSetService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 测量点拖拽排序 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - for (int i = 0; i < json.size(); i++) { - RptSpSet rptSpSet = new RptSpSet(); - jsonOne = json.getJSONObject(i); - rptSpSet.setId((String) jsonOne.get("id")); - rptSpSet.setMorder(i + 1); - result = this.rptSpSetService.update(rptSpSet); - System.out.println(result); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getSheet.do") - public String getSheet(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) throws InvalidPortException, InvalidEndpointException, IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InvalidExpiresRangeException, InvalidResponseException, InternalException, NoResponseException, InvalidBucketNameException, XmlPullParserException, ErrorResponseException { - JSONArray jsonArray = new JSONArray(); - String bucketName = "rptinfosetfile"; - List list = rptInfoSetFileService.selectListByWhere("where masterid = '" + id + "' order by insdt desc"); - if (list != null && list.size() > 0) { - try { - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - String obj = minioClient2.presignedGetObject(bucketName, list.get(0).getAbspath(), 3600 * 24 * 7); - byte[] bytes = commonFileService.getInputStreamBytes("rptinfosetfile", list.get(0).getAbspath()); - InputStream is = new ByteArrayInputStream(bytes); - - HSSFWorkbook workbook = new HSSFWorkbook(is); -// workbook = new HSSFWorkbook(new FileInputStream(new File(obj))); - HSSFSheet sheet = null; - for (int i = 0; i < workbook.getNumberOfSheets(); i++) {//获取每个Sheet表 - sheet = workbook.getSheetAt(i); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", sheet.getSheetName()); - jsonObject.put("text", sheet.getSheetName()); - jsonArray.add(jsonObject); - } - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - model.addAttribute("result", jsonArray); - return "result"; - } - -} diff --git a/src/com/sipai/controller/report/RptTypeSetController.java b/src/com/sipai/controller/report/RptTypeSetController.java deleted file mode 100644 index bf280ae1..00000000 --- a/src/com/sipai/controller/report/RptTypeSetController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.report; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptTypeSet; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.report.RptTypeSetService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/report/rptTypeSet") -public class RptTypeSetController { - @Resource - private RptTypeSetService rptTypeSetService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/process/rptTypeSetList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String unitId = request.getParameter("unitId"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by insdt desc"; - - String wherestr = "where 1=1 "; - - if (unitId != null && !unitId.equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.rptTypeSetService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-SZHY-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - } - request.setAttribute("id", CommUtil.getUUID()); - return "process/rptTypeSetAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptTypeSet rptTypeSet = this.rptTypeSetService.selectById(id); - model.addAttribute("rptTypeSet", rptTypeSet); - return "process/rptTypeSetEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - RptTypeSet rptTypeSet = this.rptTypeSetService.selectById(id); - model.addAttribute("rptTypeSet", rptTypeSet); - return "process/rptTypeSetView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("rptTypeSet") RptTypeSet rptTypeSet) { - User cu = (User) request.getSession().getAttribute("cu"); - rptTypeSet.setInsdt(CommUtil.nowDate()); - rptTypeSet.setInsuser(cu.getId()); - int result = this.rptTypeSetService.save(rptTypeSet); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("rptTypeSet") RptTypeSet rptTypeSet) { - int result = this.rptTypeSetService.update(rptTypeSet); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.rptTypeSetService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.rptTypeSetService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } -} diff --git a/src/com/sipai/controller/report/TemplateTypeController.java b/src/com/sipai/controller/report/TemplateTypeController.java deleted file mode 100644 index 2159c665..00000000 --- a/src/com/sipai/controller/report/TemplateTypeController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.controller.report; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.User; -import com.sipai.service.report.TemplateTypeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/report/templateType") -public class TemplateTypeController { - @Resource - private TemplateTypeService templateTypeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return"/report/templateTypeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.templateTypeService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "/report/templateTypeAdd"; - } - - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute TemplateType templateType) { - User cu = (User) request.getSession().getAttribute("cu"); - templateType.setId(CommUtil.getUUID()); - templateType.setInsdt(CommUtil.nowDate()); - templateType.setInsuser(cu.getId()); - int result = this.templateTypeService.save(templateType); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+templateType.getId()+"\"}"; - model.addAttribute("result",resultstr); - return new ModelAndView("result"); - } - - @RequestMapping("/delete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.templateTypeService.deleteById(id); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.templateTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - TemplateType templateType = this.templateTypeService.selectById(id); - model.addAttribute("templateType", templateType); - return "/report/templateTypeEdit"; - } - - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute TemplateType templateType) { - User cu = (User) request.getSession().getAttribute("cu"); - templateType.setInsdt(CommUtil.nowDate()); - templateType.setInsuser(cu.getId()); - int result = this.templateTypeService.update(templateType); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+templateType.getId()+"\"}"; - model.addAttribute("result",resultstr); - return new ModelAndView("result"); - } - - /** - * 下拉框选择模板类型 - */ - @RequestMapping("/getTemplateTypeForSelect.do") - public String getTemplateTypeForSelect(HttpServletRequest request,Model model){ - List list = this.templateTypeService.selectListByWhere("where 1=1"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (TemplateType item : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", item.getId()); - jsonObject.put("text", item.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/robot/Ro2Controller.java b/src/com/sipai/controller/robot/Ro2Controller.java deleted file mode 100644 index c3a48331..00000000 --- a/src/com/sipai/controller/robot/Ro2Controller.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.sipai.controller.robot; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.Result; -import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.params.HttpMethodParams; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/ro2") -public class Ro2Controller { - - - private Logger logger = LoggerFactory.getLogger(Ro2Controller.class); - - @RequestMapping("/getList") - public JSONArray getList(){ - - - String url = "http://10.194.10.169:9206/nsapi/getoken?objkey=sipai"; - - - - - - String url1 = "http://10.194.10.169:9206/nsapi/cxlsbg"; - -// String url="http://localhost:8090/test"; - //生成HttpClient对象并设置参数 - HttpClient client = new HttpClient(); - //设置Http连接超时为5秒 - client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); - //生成postMethod对象并设置参数 - GetMethod method = new GetMethod(url); - - method.addRequestHeader("accept", "*/*"); - method.addRequestHeader("connection", "Keep-Alive"); - //设置json格式传送 - method.addRequestHeader("Content-Type", "application/json;charset=utf-8"); - //必须设置下面这个Header - method.addRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); - //设置请求体body -// method.setRequestBody(jsonObject.toString()); - //设置请求重试处理,用的是默认的重试处理:请求三次 - method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler()); - String res = ""; - - JSONObject jsonObject = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - - - - String jsStr="{\n" + - " \"creater_time\": \"\",\n" + - " \"execution_time\": \"\",\n" + - " \"id\": \"\",\n" + - " \"inspect_type\": 0,\n" + - " \"pageNum\": 0,\n" + - " \"pageSize\": 0,\n" + - " \"residence_time\": \"\",\n" + - " \"robot_config_id\": \"\",\n" + - " \"robot_name\": \"\",\n" + - " \"speed\": 0,\n" + - " \"task_name\": \"\",\n" + - " \"videotape_time\": 0\n" + - "}"; - - - - - - - - - //执行HTTP POST连接 - try { - int statusCode = client.executeMethod(method); - if (statusCode == HttpStatus.SC_OK) { - method.getParams().setContentCharset("UTF-8"); - String body = new String(method.getResponseBodyAsString().getBytes("GBK"));//调用返回结果 - - client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); - //生成postMethod对象并设置参数 - - - HttpClient client1 = new HttpClient(); - PostMethod method1 = new PostMethod(url1); - - method1.setRequestBody(jsStr); - - method1.addRequestHeader("accept", "*/*"); - method1.addRequestHeader("connection", "Keep-Alive"); - //设置json格式传送 - method1.addRequestHeader("Content-Type", "application/json;charset=utf-8"); - //必须设置下面这个Header - method1.addRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); - - method1.addRequestHeader("Authorization", body); - - //设置请求体body -// method.setRequestBody(jsonObject.toString()); - //设置请求重试处理,用的是默认的重试处理:请求三次 - method1.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler()); - - - - - try { - int statusCode1 = client1.executeMethod(method1); - if (statusCode1 == HttpStatus.SC_OK) { - method1.getParams().setContentCharset("UTF-8"); - String body1 = new String(method1.getResponseBodyAsString().getBytes("GBK"));//调用返回结果 - - client1.getHttpConnectionManager().getParams().setConnectionTimeout(5000); - //生成postMethod对象并设置参数 - - - -// if (!body.isEmpty()){ -// JSONObject jsonObject2=new JSONObject(); -// JSONObject jsonObject1 = JSONObject.parseObject(body); -// -// jsonObject2 jsonObject1.get("body"); -// -// -// } - - - String replaceBody = body1.replace("\\", ""); - JSONObject jsonObject1 = JSONObject.parseObject(replaceBody); -// - String rows = jsonObject1.getString("rows"); - System.out.println("body1======" + replaceBody); -// jsonObject.put("code",200); -// jsonObject.put("rows",jsonObject1.get("data")); - - return JSONArray.parseArray(jsonObject1.get("rows").toString()); -// jsonObject.put("result",rows); -// return jsonObject; - - } else { - jsonObject.put("rows", "调用第三方接口失败!!"); - } - } catch (Exception e) { - logger.error("程序出现异常{}", e.getMessage()); - e.printStackTrace(); - jsonObject.put("rows", "程序出现异常,请及时联系系统管理员!!!"); - } - - - - - -// if (!body.isEmpty()){ -// JSONObject jsonObject2=new JSONObject(); -// JSONObject jsonObject1 = JSONObject.parseObject(body); -// -// jsonObject2 jsonObject1.get("body"); -// -// -// } - - -// String replaceBody = body.replace("\\", ""); -// JSONObject jsonObject1 = JSONObject.parseObject(body); -// -// ; -// System.out.println("body======" + body); -//// jsonObject.put("code",200); -//// jsonObject.put("rows",jsonObject1.get("data")); -// -//// return JSONArray.parseArray(jsonObject1.get("data").toString()); -// jsonObject.put("token",body); - return jsonArray; - - } else { - jsonObject.put("rows", "调用第三方接口失败!!"); - } - } catch (Exception e) { - logger.error("程序出现异常{}", e.getMessage()); - e.printStackTrace(); - jsonObject.put("rows", "程序出现异常,请及时联系系统管理员!!!"); - } - return jsonArray; - } - - - - - -} diff --git a/src/com/sipai/controller/robot/RobotController.java b/src/com/sipai/controller/robot/RobotController.java deleted file mode 100644 index 44ff727d..00000000 --- a/src/com/sipai/controller/robot/RobotController.java +++ /dev/null @@ -1,275 +0,0 @@ -package com.sipai.controller.robot; - - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.tools.CommString; -import com.sipai.tools.HttpUtil; -import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.params.HttpMethodParams; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.ui.Model; -import org.springframework.web.HttpRequestHandler; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.Map; - -@RestController -@RequestMapping("/robot") -public class RobotController { - - - private Logger logger = LoggerFactory.getLogger(RobotController.class); - - @RequestMapping("/getJobList.do") - public JSONArray getJobList() { - - String url = "http://192.168.18.10:12249/stationCtlApi/getJobList?type=1&ip=192.168.1.91"; -// String url="http://localhost:8090/test"; - //生成HttpClient对象并设置参数 - HttpClient client = new HttpClient(); - //设置Http连接超时为5秒 - client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); - //生成postMethod对象并设置参数 - GetMethod method = new GetMethod(url); - - method.addRequestHeader("accept", "*/*"); - method.addRequestHeader("connection", "Keep-Alive"); - //设置json格式传送 - method.addRequestHeader("Content-Type", "application/json;charset=utf-8"); - //必须设置下面这个Header - method.addRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); - //设置请求体body -// method.setRequestBody(jsonObject.toString()); - //设置请求重试处理,用的是默认的重试处理:请求三次 - method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler()); - String res = ""; - - JSONObject jsonObject = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - - //执行HTTP POST连接 - try { - int statusCode = client.executeMethod(method); - if (statusCode == HttpStatus.SC_OK) { - method.getParams().setContentCharset("UTF-8"); - String body = new String(method.getResponseBodyAsString().getBytes("GBK"));//调用返回结果 - -// if (!body.isEmpty()){ -// JSONObject jsonObject2=new JSONObject(); -// JSONObject jsonObject1 = JSONObject.parseObject(body); -// -// jsonObject2 jsonObject1.get("body"); -// -// -// } - - - String replaceBody = body.replace("\\", ""); - JSONObject jsonObject1 = JSONObject.parseObject(replaceBody); - - ; - System.out.println("body======" + replaceBody); -// jsonObject.put("code",200); -// jsonObject.put("rows",jsonObject1.get("data")); - - return JSONArray.parseArray(jsonObject1.get("data").toString()); - - } else { - jsonObject.put("rows", "调用第三方接口失败!!"); - } - } catch (Exception e) { - logger.error("程序出现异常{}", e.getMessage()); - e.printStackTrace(); - jsonObject.put("rows", "程序出现异常,请及时联系系统管理员!!!"); - } - return jsonArray; - } - - - @RequestMapping("/taskStart.do") - public JSONObject taskStart(String taskId) { - String url = "http://192.168.18.10:12249/stationCtlApi/taskStart?type=1&taskId=" + taskId; - //生成HttpClient对象并设置参数 - HttpClient client = new HttpClient(); - //设置Http连接超时为5秒 - client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); - //生成postMethod对象并设置参数 - GetMethod method = new GetMethod(url); - - method.addRequestHeader("accept", "*/*"); - method.addRequestHeader("connection", "Keep-Alive"); - //设置json格式传送 - method.addRequestHeader("Content-Type", "application/json;charset=utf-8"); - //必须设置下面这个Header - method.addRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); - //设置请求体body -// method.setRequestBody(jsonObject.toString()); - //设置请求重试处理,用的是默认的重试处理:请求三次 - method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler()); - String res = ""; - - JSONObject jsonObject = new JSONObject(); - -// JSONArray jsonArray = new JSONArray(); - //执行HTTP POST连接 - try { - int statusCode = client.executeMethod(method); - if (statusCode == HttpStatus.SC_OK) { - method.getParams().setContentCharset("UTF-8"); - String body = new String(method.getResponseBodyAsString().getBytes("GBK"));//调用返回结果 - String replaceBody = body.replace("\\", ""); - System.out.println("body======" + replaceBody); - JSONObject jsonObject1 = JSONObject.parseObject(replaceBody); - jsonObject.put("code", 200); - jsonObject.put("body", JSONObject.toJSON(replaceBody)); -// return JSONArray.parseArray(jsonObject1.get("data").toString()); - } else { - jsonObject.put("body", "调用第三方接口失败!!"); - } - } catch (Exception e) { - logger.error("程序出现异常{}", e.getMessage()); - e.printStackTrace(); - jsonObject.put("body", "程序出现异常,请及时联系系统管理员!!!"); - } - return jsonObject; - } - - @RequestMapping("/taskResult.do") - public Object taskResult(String jobId) { - JSONArray jsonArray = new JSONArray(); - String url = "http://192.168.18.10:12249/stationCtlApi/taskResult?type=1&jobId=" + jobId; - //生成HttpClient对象并设置参数 - HttpClient client = new HttpClient(); - //设置Http连接超时为5秒 - client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); - //生成postMethod对象并设置参数 - GetMethod method = new GetMethod(url); - - method.addRequestHeader("accept", "*/*"); - method.addRequestHeader("connection", "Keep-Alive"); - //设置json格式传送 - method.addRequestHeader("Content-Type", "application/json;charset=utf-8"); - //必须设置下面这个Header - method.addRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); - //设置请求体body -// method.setRequestBody(jsonObject.toString()); - //设置请求重试处理,用的是默认的重试处理:请求三次 - method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler()); - String res = ""; - - JSONObject jsonObject = new JSONObject(); - //执行HTTP POST连接 - try { - int statusCode = client.executeMethod(method); - if (statusCode == HttpStatus.SC_OK) { - method.getParams().setContentCharset("UTF-8"); - String body = new String(method.getResponseBodyAsString().getBytes("GBK"));//调用返回结果 - String replaceBody = body.replace("\\", ""); - System.out.println("body======" + replaceBody); - jsonObject.put("code", 200); - jsonObject.put("body", JSONObject.toJSON(replaceBody)); - JSONObject jsonObject1 = JSONObject.parseObject(replaceBody); - return JSONArray.parseArray(JSONObject.parseObject(jsonObject1.get("data").toString()).get("result").toString()); - } else { - jsonObject.put("body", "调用第三方接口失败!!"); - } - } catch (Exception e) { - logger.error("程序出现异常{}", e.getMessage()); - e.printStackTrace(); - jsonObject.put("body", "程序出现异常,请及时联系系统管理员!!!"); - } - return jsonArray; - } - - - /** - * { - * "creater_time": "", - * "execution_time": "", - * "id": "", - * "inspect_type": 0, - * "pageNum": 0, - * "pageSize": 0, - * "residence_time": "", - * "robot_config_id": "", - * "robot_name": "", - * "speed": 0, - * "task_name": "", - * "task_type": "", - * "videotape_time": 0 - * } - * @param - * @param - * @return - */ - @RequestMapping("/getJobListTYPE_2.do") - public ModelAndView getJobListTYPE_2(HttpServletRequest request, Model model, - @RequestParam(name = "pageSize", required = false) Integer pageSize, - @RequestParam(name = "pageNum", required = false) Integer pageNum) { - if (pageSize == null) { - pageSize = 0; - } - if (pageNum == null) { - pageNum = 0; - } - String token = ""; -// String url = "http://127.0.0.1:8099/SIPAIIS_WMS/robot/test.do"; - String url = "http://10.194.10.169:9206/nsapi/cxlsbg"; -// String tokenURL = "http://127.0.0.1:8099/SIPAIIS_WMS/third/test"; - String tokenURL = "http://10.194.10.169:9206/nsapi/getoken?objkey=sipai"; - Map headerMap = new HashMap<>(); - headerMap.put("Authorization", "sipai"); - headerMap.put("Content-Type", "application/json;charset=utf-8"); - token = HttpUtil.sendGet(tokenURL, headerMap); - headerMap.put("Authorization", token); - JSONObject reqJSON = new JSONObject(); - reqJSON.put("creater_time", ""); - reqJSON.put("execution_time", ""); - reqJSON.put("id", ""); - reqJSON.put("inspect_type", 0); - reqJSON.put("pageNum", pageNum); - reqJSON.put("pageSize", pageSize); - reqJSON.put("residence_time", ""); - reqJSON.put("robot_config_id", ""); - reqJSON.put("robot_name", ""); - reqJSON.put("speed", 0); - reqJSON.put("task_name", ""); - reqJSON.put("task_type", ""); - reqJSON.put("videotape_time", 0); - String result = ""; - try { - String data = HttpUtil.sendPost(url, reqJSON, headerMap); - JSONObject jsonObject = JSON.parseObject(data); - result = JSON.toJSONString(jsonObject); - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/test.do") - public JSONObject test(HttpServletRequest request, Model model) { - String authorization = request.getHeader("Authorization"); - System.out.println(authorization); -// String test = "{\"code\":200,\"body\":\"{\\\"flag\\\":true,\\\"code\\\":200,\\\"message\\\":\\\"获取机器人作业列表成功\\\",\\\"data\\\":[]}\"}"; - String test = "{\"total\": 1,\"rows\": [{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检1\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检2\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检3\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检4\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检5\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检6\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检7\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检8\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检9\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检10\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检11\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null},{\"createBy\": null,\"createTime\": null,\"updateBy\": null,\"updateTime\": null,\"remark\": null,\"id\": \"0bf7127837a64691baad290f4dc53f4a\",\"task_name\": \"日常巡检12\",\"task_id\": \"0bf7127837a64691baad290f4dc54f4a\",\"task_type\": null,\"execution_time\": \"14\",\"residence_time\": \"1\",\"robot_config_id\": \"5ad16a4f17d145c4b25ed58804fd21b1\",\"robot_name\": \"南市1#机器人\",\"inspect_type\": 1,\"speed\": 0,\"creater_time\": \"2024-03-13T14:38:00.000+08:00\",\"creater_time_str\": \"2024-03-13\",\"create_times\": null,\"create_time_begin\": null,\"create_time_end\": null,\"video_ip1\": null,\"video_name1\": null,\"video_port1\": null,\"video_pwd1\": null,\"videotape_time\": 0,\"points\": null,\"pageNum\": null,\"pageSize\": null}],\"code\": 200,\"msg\": \"查询成功\"}"; - JSONObject jsonObject = JSON.parseObject(test); - - return jsonObject; - } - - -} diff --git a/src/com/sipai/controller/robot/ToRobotController.java b/src/com/sipai/controller/robot/ToRobotController.java deleted file mode 100644 index 9f229b88..00000000 --- a/src/com/sipai/controller/robot/ToRobotController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.controller.robot; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -public class ToRobotController { - - - - @RequestMapping("/torobot.do") - public String toRobot(){ - - - System.out.println("进入了项目-------------"); - - return "/robot"; - } - - -} diff --git a/src/com/sipai/controller/safety/SafetyCertificateController.java b/src/com/sipai/controller/safety/SafetyCertificateController.java deleted file mode 100644 index 1d4647aa..00000000 --- a/src/com/sipai/controller/safety/SafetyCertificateController.java +++ /dev/null @@ -1,497 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelReader; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.read.listener.PageReadListener; -import com.alibaba.excel.read.metadata.ReadSheet; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.safety.SafetyCertificate; -import com.sipai.entity.safety.SafetyFiles; -import com.sipai.entity.safety.SafetyInternalCertificateExcel; -import com.sipai.entity.safety.SafetyInternalCertificateVo; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.safety.SafetyCertificateService; -import com.sipai.service.safety.SafetyFilesService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author LiTao - * @date 2022-09-21 14:31:54 - * @description: 内部人员证书 - */ -@Controller -@RequestMapping("/safety/internalCertificate") -public class SafetyCertificateController { - - @Resource - private SafetyCertificateService service; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private SafetyFilesService safetyFilesService; - - - // 内部证书 - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/safety/InternalCertificateList"; - } - - // 内部证书 - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "issueDate", required = false) String issueDate, - @RequestParam(value = "jobType", required = false) String jobType) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("createTime")) { - sort = " sc.userid, sc.create_time "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where flag='1' "; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_code")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and u.pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and u.id in ('" + userIds + "') "; - } - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (u.caption like '%" + request.getParameter("search_name") + "%' " + - "or u.userCardId like '%" + request.getParameter("search_name") + "%') "; - } - - // 领证时间筛选 - String issueDate_param = request.getParameter("issueDate"); - if (org.apache.commons.lang3.StringUtils.isNotBlank(issueDate_param)) { - String[] split = issueDate_param.split("~"); - String issueDate_param_start_time = split[0].trim(); - String issueDate_param_end_time = split[1].trim(); - wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" + - " and sc.issue_date <= '" + issueDate_param_end_time + "'"; - } - - //作业类型 - String jobType_param = request.getParameter("jobType"); - if (org.apache.commons.lang3.StringUtils.isNotBlank(jobType_param)) { - wherestr += " and sc.job_type = '" + jobType_param + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.service.selectListByConditionForInternal(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - return "/safety/InternalCertificateAdd"; - } - - @RequestMapping("/save.do") - @Transactional(rollbackFor = Exception.class) - public String dosave(HttpServletRequest request, Model model, SafetyCertificate bean, - MultipartFile file) throws IOException { - bean.setFlag("1");// 内部证书 - - List count = this.service.selectOneByConditionForInternal(bean); - if (!CollectionUtils.isEmpty(count)) { - model.addAttribute("result", CommUtil.toJson(Result.failed("证书编号已存在!"))); - return "result"; - } - - bean.setId(UUID.randomUUID().toString()); - if (!file.isEmpty()) { - safetyFilesService.upload(request, file, SafetyFunctionEnum.CERTIFICATE_INSIDER.getId(), null, bean.getId()); - } - model.addAttribute("result", CommUtil.toJson(Result.success(this.service.save(bean)))); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - SafetyInternalCertificateVo vo = this.service.selectOneByIdForInternal(id); - model.addAttribute("safetyInternalCertificate", vo); - return "/safety/InternalCertificateEdit"; - } - - @RequestMapping("/update.do") - @Transactional(rollbackFor = Exception.class) - public String doupdate(HttpServletRequest request, Model model, SafetyInternalCertificateVo vo, - MultipartFile file) throws IOException { - SafetyCertificate bean = new SafetyCertificate(); - BeanUtils.copyProperties(vo, bean); - List count = this.service.selectOneByConditionForInternal(bean); - if (!CollectionUtils.isEmpty(count)) { - model.addAttribute("result", CommUtil.toJson(Result.failed("证书编号已存在!"))); - return "result"; - } - if (!file.isEmpty()) { - if (!StringUtils.isEmpty(vo.getFileId())) { - safetyFilesService.deleteById(vo.getFileId()); - } - safetyFilesService.upload(request, file, SafetyFunctionEnum.CERTIFICATE_INSIDER.getId(), null, bean.getId()); - } - model.addAttribute("result", CommUtil.toJson(Result.success(this.service.update(bean)))); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - SafetyInternalCertificateVo vo = this.service.selectOneByIdForInternal(id); - model.addAttribute("safetyInternalCertificate", vo); - return "/safety/InternalCertificateView"; - } - - @RequestMapping("/delete.do") - @Transactional(rollbackFor = Exception.class) - public String delete(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) throws IOException { - int result = service.deleteById(id); - safetyFilesService.deleteByBizId(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - @Transactional(rollbackFor = Exception.class) - public String delete(HttpServletRequest request, Model model, String[] ids) throws IOException { - int result = 0; - for (String id : ids) { - result += service.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 跳转导入页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelShow.do") - public String doimport(HttpServletRequest request, Model model) { - return "/safety/InternalCertificateImport"; - } - - /** - * excel导入 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/importExcel.do") - @Transactional(rollbackFor = Exception.class) - public String importExcel(@RequestParam(value = "filelist", required = false) MultipartFile file, - HttpServletRequest request, - Model model) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - StringBuilder errMsg = new StringBuilder(); - AtomicInteger successCount = new AtomicInteger(); - AtomicInteger failCount = new AtomicInteger(); - Map statusMap = new HashMap(); - - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - - ExcelReader excelReader = EasyExcel.read(excelFile.getInputStream()).build(); - excelReader.readAll(); - excelReader.finish(); - List sheets = excelReader.excelExecutor().sheetList(); - excelReader.finish(); - for (ReadSheet sheet : sheets) { - String[] sheetInfo = sheet.getSheetName().split("_"); - EasyExcel.read(excelFile.getInputStream(), SafetyInternalCertificateExcel.class, new PageReadListener(dataList -> { - int success = 0; - int fail = 0; - SafetyCertificate sc = null; // 证书 - for (int i = 0; i < dataList.size(); i++) { - SafetyInternalCertificateExcel excelEntity = dataList.get(i); - /* - * 1. 处理外部员工信息 - */ - //验参 - String userCardId = excelEntity.getUserCardId(); - if(org.apache.commons.lang3.StringUtils.isBlank(userCardId)){ - errMsg.append( "第" + (i+1) + "条,工号不能为空!\n"); - fail++; - continue; - } - String caption = excelEntity.getCaption(); - if(org.apache.commons.lang3.StringUtils.isBlank(caption)){ - errMsg.append( "第" + (i+1) + "条,姓名不能为空!\n"); - fail++; - continue; - } - String certificateName = excelEntity.getCertificateName(); - if(org.apache.commons.lang3.StringUtils.isBlank(certificateName)){ - errMsg.append( "第" + (i+1) + "条,证书名称不能为空!\n"); - fail++; - continue; - } - String certificateNo = excelEntity.getCertificateNo(); - if(org.apache.commons.lang3.StringUtils.isBlank(certificateNo)){ - errMsg.append( "第" + (i+1) + "条,证书编号不能为空!\n"); - fail++; - continue; - } - String issueDate = excelEntity.getIssueDate(); - if(org.apache.commons.lang3.StringUtils.isNotBlank(certificateNo)){ - try { - LocalDate.parse(issueDate.trim(), DateTimeFormatter.ISO_LOCAL_DATE); - } catch (DateTimeParseException e) { - errMsg.append( "第" + (i+1) + "条,领证时间格式不正确!\n"); - fail++; - continue; - } - } - String expirationDate = excelEntity.getExpirationDate(); - if(org.apache.commons.lang3.StringUtils.isNotBlank(expirationDate)){ - try { - LocalDate.parse(expirationDate.trim(), DateTimeFormatter.ISO_LOCAL_DATE); - } catch (DateTimeParseException e) { - errMsg.append( "第" + (i+1) + "条,有效期至时间格式不正确!\n"); - fail++; - continue; - } - } - - //根据工号 和 员工姓名查询 user - String where = "where active='1'" + - " and caption='" + caption + "'" + - " and userCardId='" + userCardId + "'" + - " order by id desc"; - List users = userService.selectListByWhere(where); - if(CollectionUtils.isEmpty(users)){ - errMsg.append( (i+1) + "条,姓名与工号不匹配或不存在!\n"); - fail++; - continue; - } - - //查询外部员工是否存在 存在则修改,不存在则新增 - sc = new SafetyCertificate(); - - sc.setUserid(users.get(0).getId()); - sc.setFlag("1"); // 数据标志 1内部证书 2外部证书 - sc.setCertificateNo(excelEntity.getCertificateNo()); - sc.setCertificateName(excelEntity.getCertificateName()); - - //判断证书是否存在 - List scList = null; - if(org.apache.commons.lang3.StringUtils.isNotBlank(excelEntity.getCertificateNo())){ - scList = service.selectOneByConditionForInternal(sc); - } - sc.setJobCode(excelEntity.getJobCode()); - sc.setJobType(excelEntity.getJobType()); - sc.setIssuingAuthority(excelEntity.getIssuingAuthority()); - sc.setIssueDate(excelEntity.getIssueDate()); - sc.setExpirationDate(excelEntity.getExpirationDate()); - - if(CollectionUtils.isEmpty(scList)){//新增 - sc.setId(UUID.randomUUID().toString()); - success += service.save(sc); - }else{ // 修改 - sc.setId(scList.get(0).getId()); - success += service.update(sc); - } - } - successCount.set(success); - failCount.set(fail); - })).sheet(sheet.getSheetName()).doRead(); - } - - if (!errMsg.toString().isEmpty()) { - statusMap.put("status", false); - statusMap.put("msg", "导入成功" + successCount.intValue() + "条!" + "失败" + failCount.intValue() + "条,错误信息:" + errMsg.toString()); - model.addAttribute("result", JSONObject.fromObject(statusMap).toString()); - return "result"; - } else { - statusMap.put("status", true); - statusMap.put("msg", "导入成功" + successCount.intValue() + "条!"); - model.addAttribute("result", JSONObject.fromObject(statusMap).toString()); - return "result"; - } - } - - /** - * excel导出 - * - * @param request - * @param response - * @throws IOException - */ - @RequestMapping("/exportExcel.do") - public void export(HttpServletRequest request, HttpServletResponse response, - @RequestParam(value = "issueDate", required = false) String issueDate, - @RequestParam(value = "jobType", required = false) String jobType) throws IOException { - // 摘自列表查询接口 start - User cu = (User) request.getSession().getAttribute("cu"); - String sort = " sc.userid, sc.create_time "; - String order = " desc "; - String orderstr = " order by " + sort + " " + order; - String wherestr = " where flag='1' "; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_code")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and u.pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and u.id in ('" + userIds + "') "; - } - } - - // 搜索框筛选 - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (u.caption like '%" + request.getParameter("search_name") + "%' " + - "or u.userCardId like '%" + request.getParameter("search_name") + "%') "; - } - - // 领证时间筛选 - if (org.apache.commons.lang3.StringUtils.isNotBlank(issueDate) && - !"null".equals(issueDate)) { - String[] split = issueDate.split("~"); - String issueDate_param_start_time = split[0].trim(); - String issueDate_param_end_time = split[1].trim(); - wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" + - " and sc.issue_date <= '" + issueDate_param_end_time + "'"; - } - - //作业类型 - if (org.apache.commons.lang3.StringUtils.isNotBlank(jobType) && - !"null".equals(jobType)) { - wherestr += " and sc.job_type = '" + jobType + "'"; - } - - List list = this.service.selectListByConditionForInternal(wherestr + orderstr); - List excelList = new ArrayList<>(); - SafetyInternalCertificateExcel excelEntity = null; - for (SafetyInternalCertificateVo vo : list) { - excelEntity = new SafetyInternalCertificateExcel(); - BeanUtils.copyProperties(vo, excelEntity); - excelList.add(excelEntity); - } - // 摘自列表查询接口 end - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("内部人员证书信息", "UTF-8") + ".xlsx"); - - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), SafetyInternalCertificateExcel.class).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet("内部人员证书信息").build(); - excelWriter.write(excelList, writeSheet); - excelWriter.finish(); - } - } - - - /** - * 作业类型下拉 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/jobTypePulldown.do") - public String jobTypePulldown(HttpServletRequest request, Model model) { - List> list = this.service.jobTypePulldown(); - model.addAttribute("result", JSON.toJSONString(list)); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/safety/SafetyCheckComprehensiveController.java b/src/com/sipai/controller/safety/SafetyCheckComprehensiveController.java deleted file mode 100644 index b90b79eb..00000000 --- a/src/com/sipai/controller/safety/SafetyCheckComprehensiveController.java +++ /dev/null @@ -1,466 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.*; -import com.sipai.entity.safety.SafetyCheckComprehensive; -import com.sipai.entity.safety.SafetyCheckComprehensiveExcel; -import com.sipai.entity.safety.SafetyCheckComprehensiveQuery; -import com.sipai.entity.safety.SafetyCheckComprehensiveVo; -import com.sipai.entity.user.User; -import com.sipai.service.safety.*; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -/** - * 综合检查 - * @author lt - */ -@Controller -@RequestMapping("/safety/SafetyCheckComprehensive") -public class SafetyCheckComprehensiveController { - - @Resource - private SafetyCheckComprehensiveService service; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - - @Resource - private SafetyCheckActivityService safetyCheckActivityService; - @Resource - private SafetyFlowTaskDetailService safetyFlowTaskDetailService; - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - // 查询条件 状态栏的状态 - model.addAttribute("statusDropdownList", SafetyCheckStatusEnum.getAllEnableType4JSON()); - return "safety/SafetyCheckComprehensiveList"; - } - - /** - * 获取分页列表信息 - * - * @Author: lt - * @Date: 2022/10/11 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyCheckComprehensiveQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = service.getList(query); - for (SafetyCheckComprehensiveVo vo : list) { - vo.setStatusName(SafetyCheckStatusEnum.getNameByid(vo.getStatus())); - vo.setCheckResultName(SafetyCheckResultEnum.getNameByid(vo.getCheckResult())); - } - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - // 当前登录人 - model.addAttribute("currUser", cu); - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemComprehensiveEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - return "safety/SafetyCheckComprehensiveAdd"; - } - - /** - * 新增保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile file) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - bean.setId(UUID.randomUUID().toString()); - if (file.getSize() > 0) { - safetyFilesService.upload(request, null, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId()); - } - bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE)); - if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - } else { - bean.setStatus(SafetyCheckStatusEnum.TEMP.getId()); - } - - bean.setCreateUserId(cu.getId()); - bean.setCreateUserName(cu.getCaption()); - service.save(bean); - return Result.success(); - } - - /** - * 新增申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/saveApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile file) throws Exception { - if(StringUtils.isEmpty(bean.getDutyUserId())){ - return Result.failed("整改负责人不能为空!"); - } - - save(request, bean, file); - // 不相符的才提交申请 - if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) { - safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_COMPREHENSIVE, bean.getId()); - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.APPLY.getTaskTitle(), - bean.getCreateUserId(), // 当前节点审批人 - bean.getCreateUserName(),// 当前节点审批人 - bean.getCopyUserId(), // 抄送人 - bean.getCopyUserName(),// 抄送人 - SafetyCheckStatusEnum.APPLY.getTaskRecordPass(bean.getCreateUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), // 当前节点审批人 - bean.getDutyUserName(), // 当前节点审批人 - null, // 抄送人 - null,// 抄送人 - null); - } - return Result.success(); - } - - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemComprehensiveEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - // 编辑对象 - model.addAttribute("bean", service.selectById(id)); - return "safety/SafetyCheckComprehensiveEdit"; - } - - /** - * 更新 - * - * @Author: lt - * @Date: 2022/10/12 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyCheckComprehensive bean) throws IOException { - if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - } else { - bean.setStatus(SafetyCheckStatusEnum.TEMP.getId()); - } - service.update(bean); - return Result.success(); - } - - /** - * 更新 提交申请 - * - * @Author: lt - * @Date: 2022/10/14 - **/ - @RequestMapping("/updateApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result apply(HttpServletRequest request, SafetyCheckComprehensive bean) throws IOException, ServiceException { - if(StringUtils.isEmpty(bean.getDutyUserId())){ - return Result.failed("整改负责人不能为空!"); - } - update(request, bean); - // 不相符的才提交申请 - if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) { - safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_COMPREHENSIVE, bean.getId()); - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.APPLY.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.APPLY.getTaskRecordPass(bean.getCreateUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - } - return Result.success(); - } - - - /** - * 跳转至详情弹窗 - * - * @Author: lt - * @Date: 2022/10/14 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemComprehensiveEnum.getAllEnableType4JSON()); - // 编辑对象 - model.addAttribute("bean", service.selectById(id)); - return "safety/SafetyCheckComprehensiveView"; - } - - /** - * 删除 - * - * @Author: lt - * @Date: 2022/10/12 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - service.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - - /** - * 跳转至编辑弹窗 提交整改 - * - * @Author: lt - * @Date: 2022/10/14 - **/ - @RequestMapping("/auditShow.do") - public String editRespnose(HttpServletRequest request, Model model, String bizId, String taskId, String processInstanceId) throws ServiceException { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemComprehensiveEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - // 编辑对象 - SafetyCheckComprehensive bean = service.selectById(bizId); - model.addAttribute("bean", bean); - // 工作流信息 - model.addAttribute("taskId", taskId); - model.addAttribute("processInstanceId", processInstanceId); - - if (bean.getStatus() == SafetyCheckStatusEnum.APPLY.getId()) { - return "safety/SafetyCheckComprehensiveEditResponse"; - } else if (bean.getStatus() == SafetyCheckStatusEnum.RESPONSE.getId()) { - return "safety/SafetyCheckComprehensiveEditConfirm"; - } else { - throw new ServiceException("非法状态!"); - } - } - - /** - * 提交整改 - * - * @Author: lt - * @Date: 2022/10/14 - **/ - @RequestMapping("/response.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId) throws IOException, ServiceException { - if(StringUtils.isEmpty(bean.getConfirmUserId())){ - return Result.failed("验证人不能为空!"); - } - - safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, 1); - bean.setStatus(SafetyCheckStatusEnum.RESPONSE.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.RESPONSE.getTaskRecordPass(bean.getDutyUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - return Result.success(); - } - - /** - * 提交验证 - * - * @Author: lt - * @Date: 2022/10/14 - **/ - @RequestMapping("/confirm.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId, int pass) throws IOException, ServiceException { - - safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass); - - //通过 - if (pass == 1) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass( bean.getConfirmUserName())); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - "结束", - null, - null, - null, - null, - null); - } - //不通过 - else { - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - service.update(bean); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.COMPLETE.getTaskRecordNotPass(bean.getDutyUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - } - return Result.success(); - } - - /** - * excel导出 - * - * @param request - * @param response - * @throws IOException - */ - @RequestMapping("/exportExcel.do") - public void export(HttpServletRequest request, HttpServletResponse response, Model model, SafetyCheckComprehensiveQuery query) throws IOException { - - List list = service.getList(query); - List excelList = new ArrayList<>(); - SafetyCheckComprehensiveExcel excelEntity = null; - for (SafetyCheckComprehensiveVo vo : list) { - excelEntity = new SafetyCheckComprehensiveExcel(); - BeanUtils.copyProperties(vo, excelEntity); - excelEntity.setStatusName(SafetyCheckStatusEnum.getNameByid(vo.getStatus())); - excelEntity.setCheckResultName(SafetyCheckResultEnum.getNameByid(vo.getCheckResult())); - excelEntity.setCheckDate(StringUtils.isNotBlank(vo.getCheckDate()) ? vo.getCheckDate().substring(0, 10) : ""); - String checkResultDetail = vo.getCheckResultDetail(); - if (StringUtils.isNotBlank(checkResultDetail)) { - StringBuffer sb = new StringBuffer(); - for (String s : checkResultDetail.split(",")) { - String name = SafetyCheckItemSpecialDetailEnum.getNameByid(Integer.valueOf(s)); - sb.append(name).append(","); - } - if (sb.length() > 0) { - excelEntity.setCheckResultDetail(sb.toString().substring(0, sb.toString().length() - 1)); - } - } - excelList.add(excelEntity); - } - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("综合安全检查", "UTF-8") + ".xlsx"); - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), SafetyCheckComprehensiveExcel.class).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet("综合安全检查").build(); - excelWriter.write(excelList, writeSheet); - excelWriter.finish(); - } - } -} diff --git a/src/com/sipai/controller/safety/SafetyCheckDaylyController.java b/src/com/sipai/controller/safety/SafetyCheckDaylyController.java deleted file mode 100644 index 7b3b19e8..00000000 --- a/src/com/sipai/controller/safety/SafetyCheckDaylyController.java +++ /dev/null @@ -1,468 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.*; -import com.sipai.entity.safety.SafetyCheckDayly; -import com.sipai.entity.safety.SafetyCheckDaylyExcel; -import com.sipai.entity.safety.SafetyCheckDaylyQuery; -import com.sipai.entity.safety.SafetyCheckDaylyVo; -import com.sipai.entity.user.User; -import com.sipai.service.safety.*; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -@Controller -@RequestMapping("/safety/SafetyCheckDayly") -public class SafetyCheckDaylyController { - - @Resource - private SafetyCheckDaylyService safetyCheckDaylyService; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - - @Resource - private SafetyCheckActivityService safetyCheckActivityService; - @Resource - private SafetyFlowTaskDetailService safetyFlowTaskDetailService; - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - // 查询条件 状态栏的状态 - model.addAttribute("statusDropdownList", SafetyCheckStatusEnum.getAllEnableType4JSON()); - return "safety/SafetyCheckDaylyList"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemDaylyEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - return "safety/SafetyCheckDaylyAdd"; - } - - /** - * 跳转至编辑弹窗 提交反馈 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/editApply.do") - public String editApply(HttpServletRequest request, Model model, String id) { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemDaylyEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - // 编辑对象 - model.addAttribute("bean", safetyCheckDaylyService.selectById(id)); - return "safety/SafetyCheckDaylyEditApply"; - } - - /** - * 跳转至编辑弹窗 提交整改 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/auditShow.do") - public String editRespnose(HttpServletRequest request, Model model, String bizId, String taskId, String processInstanceId) throws ServiceException { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemDaylyEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - // 编辑对象 - SafetyCheckDayly bean = safetyCheckDaylyService.selectById(bizId); - model.addAttribute("bean", bean); - // 工作流信息 - model.addAttribute("taskId", taskId); - model.addAttribute("processInstanceId", processInstanceId); - - if (bean.getStatus() == SafetyCheckStatusEnum.APPLY.getId()) { - return "safety/SafetyCheckDaylyEditResponse"; - } else if (bean.getStatus() == SafetyCheckStatusEnum.RESPONSE.getId()) { - return "safety/SafetyCheckDaylyEditConfirm"; - } else { - throw new ServiceException("非法状态!"); - } - - } - - - /** - * 跳转至详情弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - //检查项目下拉 - model.addAttribute("checkItemList", SafetyCheckItemDaylyEnum.getAllEnableType4JSON()); - // 编辑对象 - model.addAttribute("bean", safetyCheckDaylyService.selectById(id)); - return "safety/SafetyCheckDaylyView"; - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyCheckDaylyQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = safetyCheckDaylyService.getList(query); - for (SafetyCheckDaylyVo vo : list) { - vo.setStatusName(SafetyCheckStatusEnum.getNameByid(vo.getStatus())); - vo.setCheckResultName(SafetyCheckResultEnum.getNameByid(vo.getCheckResult())); - } - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - - /** - * 保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyCheckDayly bean, MultipartFile file) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - bean.setId(UUID.randomUUID().toString()); - if (file.getSize() > 0) { - safetyFilesService.upload(request, null, SafetyFunctionEnum.SAFETY_CHECK_DAYLY.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId()); - } - bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_DAYLY)); - if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - } else { - bean.setStatus(SafetyCheckStatusEnum.TEMP.getId()); - } - - bean.setCreateUserId(cu.getId()); - bean.setCreateUserName(cu.getCaption()); - safetyCheckDaylyService.save(bean); - return Result.success(); - } - - - /** - * 新增申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/saveApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveApply(HttpServletRequest request, SafetyCheckDayly bean, MultipartFile file) throws Exception { - if(StringUtils.isEmpty(bean.getDutyUserId())){ - return Result.failed("整改负责人不能为空!"); - } - - save(request, bean, file); - // 不相符的才提交申请 - if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) { - safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_DAYLY, bean.getId()); - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - safetyCheckDaylyService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.APPLY.getTaskTitle(), - bean.getCreateUserId(), // 当前节点审批人 - bean.getCreateUserName(),// 当前节点审批人 - bean.getCopyUserId(), // 抄送人 - bean.getCopyUserName(),// 抄送人 - SafetyCheckStatusEnum.APPLY.getTaskRecordPass(bean.getCreateUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), // 当前节点审批人 - bean.getDutyUserName(), // 当前节点审批人 - null, // 抄送人 - null,// 抄送人 - null); - - } - return Result.success(); - } - - /** - * 编辑申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/updateApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result apply(HttpServletRequest request, SafetyCheckDayly bean) throws IOException, ServiceException { - if(StringUtils.isEmpty(bean.getDutyUserId())){ - return Result.failed("整改负责人不能为空!"); - } - update(request, bean); - // 不相符的才提交申请 - if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) { - safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_DAYLY, bean.getId()); - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - safetyCheckDaylyService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.APPLY.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.APPLY.getTaskRecordPass(bean.getCreateUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - - } - return Result.success(); - } - - /** - * 更新 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyCheckDayly bean) throws IOException { - if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - } else { - bean.setStatus(SafetyCheckStatusEnum.TEMP.getId()); - } - safetyCheckDaylyService.update(bean); - return Result.success(); - } - - /** - * 删除 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - safetyCheckDaylyService.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - /** - * 编辑申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/response.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId) throws IOException, ServiceException { - if(StringUtils.isEmpty(bean.getConfirmUserId())){ - return Result.failed("验证人不能为空!"); - } - - safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, 1); - bean.setStatus(SafetyCheckStatusEnum.RESPONSE.getId()); - safetyCheckDaylyService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.RESPONSE.getTaskRecordPass(bean.getDutyUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - - - return Result.success(); - } - - /** - * 编辑申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/confirm.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId, int pass) throws IOException, ServiceException { - - safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass); - - //通过 - if (pass == 1) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - safetyCheckDaylyService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass( bean.getConfirmUserName())); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - "结束", - null, - null, - null, - null, - null); - - } - //不通过 - else { - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - safetyCheckDaylyService.update(bean); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.COMPLETE.getTaskRecordNotPass(bean.getDutyUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - } - - return Result.success(); - } - - - /** - * excel导出 - * - * @param request - * @param response - * @throws IOException - */ - @RequestMapping("/exportExcel.do") - public void export(HttpServletRequest request, HttpServletResponse response, Model model, SafetyCheckDaylyQuery query) throws IOException { - - List list = safetyCheckDaylyService.getList(query); - List excelList = new ArrayList<>(); - SafetyCheckDaylyExcel excelEntity = null; - for (SafetyCheckDaylyVo vo : list) { - excelEntity = new SafetyCheckDaylyExcel(); - BeanUtils.copyProperties(vo, excelEntity); - excelEntity.setStatusName(SafetyCheckStatusEnum.getNameByid(vo.getStatus())); - excelEntity.setCheckResultName(SafetyCheckResultEnum.getNameByid(vo.getCheckResult())); - excelEntity.setCheckDate(StringUtils.isNotBlank(vo.getCheckDate()) ? vo.getCheckDate().substring(0, 10) : ""); - String checkResultDetail = vo.getCheckResultDetail(); - if (StringUtils.isNotBlank(checkResultDetail)) { - StringBuffer sb = new StringBuffer(); - for (String s : checkResultDetail.split(",")) { - String name = SafetyCheckItemSpecialDetailEnum.getNameByid(Integer.valueOf(s)); - sb.append(name).append(","); - } - if (sb.length() > 0) { - excelEntity.setCheckResultDetail(sb.toString().substring(0, sb.toString().length() - 1)); - } - } - excelList.add(excelEntity); - } - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("日常安全检查", "UTF-8") + ".xlsx"); - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), SafetyCheckDaylyExcel.class).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet("日常安全检查").build(); - excelWriter.write(excelList, writeSheet); - excelWriter.finish(); - } - } - -} diff --git a/src/com/sipai/controller/safety/SafetyCheckSpecialController.java b/src/com/sipai/controller/safety/SafetyCheckSpecialController.java deleted file mode 100644 index 98635223..00000000 --- a/src/com/sipai/controller/safety/SafetyCheckSpecialController.java +++ /dev/null @@ -1,487 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.*; -import com.sipai.entity.safety.SafetyCheckSpecial; -import com.sipai.entity.safety.SafetyCheckSpecialExcel; -import com.sipai.entity.safety.SafetyCheckSpecialQuery; -import com.sipai.entity.safety.SafetyCheckSpecialVo; -import com.sipai.entity.user.User; -import com.sipai.service.safety.*; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -/** - * 专项安全检查 - * - * @author lt - */ -@Controller -@RequestMapping("/safety/SafetyCheckSpecial") -public class SafetyCheckSpecialController { - - @Resource - private SafetyCheckSpecialService service; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - - @Resource - private SafetyCheckActivityService safetyCheckActivityService; - @Resource - private SafetyFlowTaskDetailService safetyFlowTaskDetailService; - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - - /** - * 跳转至列表页 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - // 查询条件 状态栏的状态 - model.addAttribute("statusDropdownList", SafetyCheckStatusEnum.getAllEnableType4JSON()); - // 查询条件 状态栏的专项检查 - model.addAttribute("checkItemDropdownList", SafetyCheckItemSpecialEnum.getAllEnableType4JSON()); - return "safety/SafetyCheckSpecialList"; - } - - /** - * 获取分页列表信息 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyCheckSpecialQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = service.getList(query); - for (SafetyCheckSpecialVo vo : list) { - vo.setStatusName(SafetyCheckStatusEnum.getNameByid(vo.getStatus())); - vo.setCheckResultName(SafetyCheckResultEnum.getNameByid(vo.getCheckResult())); - vo.setCheckItemName(SafetyCheckItemSpecialEnum.getNameByid(vo.getCheckItem())); - } - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - // 当前登录人 - model.addAttribute("currUser", cu); - //专项检查下拉 - model.addAttribute("checkItemList", SafetyCheckItemSpecialEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - return "safety/SafetyCheckSpecialAdd"; - } - - /** - * 专项检查改变事件 - * - * @param request - * @param model - * @return - * @throws Exception - */ - @RequestMapping("/checkItemChange.do") - public String checkItemChange(HttpServletRequest request, Model model, @RequestParam(value = "checkItem") Integer checkItem) throws Exception { - //检查项目下拉 - model.addAttribute("result", SafetyCheckItemSpecialDetailEnum.getEnableType4JSONByGroup(checkItem)); - return "result"; - } - - /** - * 新增保存 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyCheckSpecial bean, MultipartFile file) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - bean.setId(UUID.randomUUID().toString()); - if (file.getSize() > 0) { - safetyFilesService.upload(request, null, SafetyFunctionEnum.SAFETY_CHECK_SPECIAL.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId()); - } - bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_SPECIAL)); - if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - } else { - bean.setStatus(SafetyCheckStatusEnum.TEMP.getId()); - } - - bean.setCreateUserId(cu.getId()); - bean.setCreateUserName(cu.getCaption()); - service.save(bean); - return Result.success(); - } - - /** - * 新增申请 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/saveApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveApply(HttpServletRequest request, SafetyCheckSpecial bean, MultipartFile file) throws Exception { - if (StringUtils.isEmpty(bean.getDutyUserId())) { - return Result.failed("整改负责人不能为空!"); - } - - save(request, bean, file); - // 不相符的才提交申请 - if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) { - safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_SPECIAL, bean.getId()); - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.APPLY.getTaskTitle(), - bean.getCreateUserId(), // 当前节点审批人 - bean.getCreateUserName(),// 当前节点审批人 - bean.getCopyUserId(), // 抄送人 - bean.getCopyUserName(),// 抄送人 - SafetyCheckStatusEnum.APPLY.getTaskRecordPass(bean.getCreateUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), // 当前节点审批人 - bean.getDutyUserName(), // 当前节点审批人 - null, // 抄送人 - null,// 抄送人 - null); - } - return Result.success(); - } - - - /** - * 跳转至编辑弹窗 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) { - //专项检查下拉 - model.addAttribute("checkItemList", SafetyCheckItemSpecialEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - // 编辑对象 - model.addAttribute("bean", service.selectById(id)); - return "safety/SafetyCheckSpecialEdit"; - } - - /** - * 更新 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyCheckSpecial bean) throws IOException { - if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - } else { - bean.setStatus(SafetyCheckStatusEnum.TEMP.getId()); - } - service.update(bean); - return Result.success(); - } - - /** - * 更新 提交申请 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/updateApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result apply(HttpServletRequest request, SafetyCheckSpecial bean) throws IOException, ServiceException { - if (StringUtils.isEmpty(bean.getDutyUserId())) { - return Result.failed("整改负责人不能为空!"); - } - update(request, bean); - // 不相符的才提交申请 - if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) { - safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_SPECIAL, bean.getId()); - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.APPLY.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.APPLY.getTaskRecordPass(bean.getCreateUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - } - return Result.success(); - } - - - /** - * 跳转至详情弹窗 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - //专项检查下拉 - model.addAttribute("checkItemList", SafetyCheckItemSpecialEnum.getAllEnableType4JSON()); - // 编辑对象 - model.addAttribute("bean", service.selectById(id)); - return "safety/SafetyCheckSpecialView"; - } - - /** - * 删除 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - service.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - - /** - * 跳转至编辑弹窗 提交整改 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/auditShow.do") - public String editRespnose(HttpServletRequest request, Model model, String bizId, String taskId, String processInstanceId) throws ServiceException { - //专项检查下拉 - model.addAttribute("checkItemList", SafetyCheckItemSpecialEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON()); - // 编辑对象 - SafetyCheckSpecial bean = service.selectById(bizId); - model.addAttribute("bean", bean); - // 工作流信息 - model.addAttribute("taskId", taskId); - model.addAttribute("processInstanceId", processInstanceId); - - if (bean.getStatus() == SafetyCheckStatusEnum.APPLY.getId()) { - return "safety/SafetyCheckSpecialEditResponse"; - } else if (bean.getStatus() == SafetyCheckStatusEnum.RESPONSE.getId()) { - return "safety/SafetyCheckSpecialEditConfirm"; - } else { - throw new ServiceException("非法状态!"); - } - } - - /** - * 提交整改 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/response.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId) throws IOException, ServiceException { - if (StringUtils.isEmpty(bean.getConfirmUserId())) { - return Result.failed("验证人不能为空!"); - } - - safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, 1); - bean.setStatus(SafetyCheckStatusEnum.RESPONSE.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.RESPONSE.getTaskRecordPass(bean.getDutyUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - return Result.success(); - } - - /** - * 提交验证 - * - * @Author: lt - * @Date: 2022/10/15 - **/ - @RequestMapping("/confirm.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId, int pass) throws IOException, ServiceException { - - safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass); - - //通过 - if (pass == 1) { - bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.COMPLETE.getTaskRecordPass(bean.getConfirmUserName())); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - "结束", - null, - null, - null, - null, - null); - } - //不通过 - else { - bean.setStatus(SafetyCheckStatusEnum.APPLY.getId()); - service.update(bean); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyCheckStatusEnum.COMPLETE.getTaskTitle(), - bean.getConfirmUserId(), - bean.getConfirmUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyCheckStatusEnum.COMPLETE.getTaskRecordNotPass(bean.getDutyUserName())); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyCheckStatusEnum.RESPONSE.getTaskTitle(), - bean.getDutyUserId(), - bean.getDutyUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - } - return Result.success(); - } - - - /** - * excel导出 - * - * @param request - * @param response - * @throws IOException - */ - @RequestMapping("/exportExcel.do") - public void export(HttpServletRequest request, HttpServletResponse response, Model model, SafetyCheckSpecialQuery query) throws IOException { - - List list = service.getList(query); - List excelList = new ArrayList<>(); - SafetyCheckSpecialExcel excelEntity = null; - for (SafetyCheckSpecialVo vo : list) { - excelEntity = new SafetyCheckSpecialExcel(); - BeanUtils.copyProperties(vo, excelEntity); - excelEntity.setStatusName(SafetyCheckStatusEnum.getNameByid(vo.getStatus())); - excelEntity.setCheckResultName(SafetyCheckResultEnum.getNameByid(vo.getCheckResult())); - excelEntity.setCheckItemName(SafetyCheckItemSpecialEnum.getNameByid(vo.getCheckItem())); - excelEntity.setCheckDate(StringUtils.isNotBlank(vo.getCheckDate()) ? vo.getCheckDate().substring(0, 10) : ""); - String checkResultDetail = vo.getCheckResultDetail(); - if (StringUtils.isNotBlank(checkResultDetail)) { - StringBuffer sb = new StringBuffer(); - for (String s : checkResultDetail.split(",")) { - String name = SafetyCheckItemSpecialDetailEnum.getNameByid(Integer.valueOf(s)); - sb.append(name).append(","); - } - if (sb.length() > 0) { - excelEntity.setCheckResultDetail(sb.toString().substring(0, sb.toString().length() - 1)); - } - } - excelList.add(excelEntity); - } - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("专项安全检查", "UTF-8") + ".xlsx"); - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), SafetyCheckSpecialExcel.class).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet("专项安全检查").build(); - excelWriter.write(excelList, writeSheet); - excelWriter.finish(); - } - } -} diff --git a/src/com/sipai/controller/safety/SafetyEducationBuilderController.java b/src/com/sipai/controller/safety/SafetyEducationBuilderController.java deleted file mode 100644 index 036967ec..00000000 --- a/src/com/sipai/controller/safety/SafetyEducationBuilderController.java +++ /dev/null @@ -1,411 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.enums.safety.SafetyJobInsideStatusEnum; -import com.sipai.entity.enums.safety.SafetyOutsiderJobStatusEnum; -import com.sipai.entity.safety.*; -import com.sipai.entity.user.User; -import com.sipai.service.safety.*; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.text.ParseException; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Controller -@RequestMapping("/safety/SafetyEducationBuilder") -public class SafetyEducationBuilderController { - - @Resource - private SafetyJobInsideService safetyJobInsideService; - - @Resource - private SafetyJobOutsideService safetyJobOutsideService; - - @Resource - private SafetyEducationBuilderService safetyEducationBuilderService; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - -@Resource - private SafetyFlowTaskService safetyFlowTaskService; - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - List list = safetyEducationBuilderService.companyList(); - - JSONArray array = JSONArray.fromObject(list); - model.addAttribute("companyList", array.toString()); - return "safety/EducationBuilderList"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - // 安全模块编号 - String educationCode = safetySeqService.code(request, SafetyFunctionEnum.EDUCATION_BUILDER); - model.addAttribute("educationCode", educationCode); - return "safety/EducationBuilderAdd"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) { - SafetyEducationBuilder educationBuilder = safetyEducationBuilderService.selectById(id); - if(educationBuilder.getFileId()!=null && !educationBuilder.getFileId().isEmpty()){ - String fileId = educationBuilder.getFileId(); - String[] fileIds = fileId.split(","); - String fileName = ""; - for(String file: fileIds){ - SafetyFiles safetyFiles = safetyFilesService.selectById(file); - if(safetyFiles!=null){ - fileName += safetyFiles.getOriginalFileName()+","; - } - } - model.addAttribute("fileName", fileName); - } - model.addAttribute("bean", educationBuilder); - return "safety/EducationBuilderEdit"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - SafetyEducationBuilder educationBuilder = safetyEducationBuilderService.selectById(id); - model.addAttribute("bean", educationBuilder); - if(educationBuilder.getFileId()!=null && !educationBuilder.getFileId().isEmpty()){ - String fileId = educationBuilder.getFileId(); - String[] fileIds = fileId.split(","); - String fileName = ""; - for(String file: fileIds){ - SafetyFiles safetyFiles = safetyFilesService.selectById(file); - if(safetyFiles!=null){ - fileName += safetyFiles.getOriginalFileName()+","; - } - } - model.addAttribute("fileName", fileName); - } - return "safety/EducationBuilderView"; - - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyEducationBuilderQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = safetyEducationBuilderService.getList(query); - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getUnbindList.do") - public String getUnbindList(HttpServletRequest request, Model model, - SafetyEducationBuilderQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = safetyEducationBuilderService.getUnbindList(query); - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyEducationBuilder bean, MultipartFile[] files) throws IOException, ParseException { - - if (!safetyEducationBuilderService.timeRangeCheck(bean)) { - return Result.failed("培训有效期早于培训日期!"); - } - - bean.setId(UUID.randomUUID().toString()); - if (files.length > 0) { - List fileBeanList = safetyFilesService.uploads(request, files, SafetyFunctionEnum.EDUCATION_VISITOR.getId(), null, bean.getId()); - if (fileBeanList.size() > 0) { - String fileIds = ""; - for(SafetyFiles safetyFiles : fileBeanList){ - fileIds += safetyFiles.getId()+","; - } - fileIds = fileIds.substring(0,fileIds.length()-1); - bean.setFileId(fileIds); - } - } - safetyEducationBuilderService.save(bean); - return Result.success(); - } - - /** - * 更新 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyEducationBuilder bean, MultipartFile[] files) throws IOException, ParseException { - - if (!safetyEducationBuilderService.timeRangeCheck(bean)) { - return Result.failed("培训有效期早于培训日期!"); - } - - SafetyEducationBuilder oldBean = safetyEducationBuilderService.selectById(bean.getId()); - //如果文件id是空的,代表用户重新上传的文件,先删除原来的文件,然后再上传新文件。 - if (StringUtils.isEmpty(bean.getFileId()) && files.length > 0) { - List fileBeanList = safetyFilesService.uploads(request, files, SafetyFunctionEnum.EDUCATION_BUILDER.getId(), null, bean.getId()); - if (fileBeanList.size() > 0) { - String fileIds = ""; - for(SafetyFiles safetyFiles : fileBeanList){ - fileIds += safetyFiles.getId()+","; - } - fileIds = fileIds.substring(0,fileIds.length()-1); - bean.setFileId(fileIds); - } - safetyEducationBuilderService.update(bean); - // 删除原来的附件记录 - safetyFilesService.deleteById(oldBean.getFileId()); - } else if (StringUtils.isEmpty(bean.getFileId()) && files.length == 0) { - bean.setFileId(null); - safetyEducationBuilderService.update(bean); - safetyFilesService.deleteById(oldBean.getFileId()); - } else { - safetyEducationBuilderService.update(bean); - } - return Result.success(); - } - - /** - * 删除 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - safetyEducationBuilderService.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - /** - * 删除附件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/deleteFile.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(HttpServletResponse response, String id) throws IOException { - SafetyEducationBuilder safetyEducationBuilder = safetyEducationBuilderService.selectById(id); - safetyFilesService.deleteById(safetyEducationBuilder.getFileId()); - safetyEducationBuilder.setFileId(""); - int row = safetyEducationBuilderService.update(safetyEducationBuilder); - if (row != 0) { - return Result.success(); - } - return Result.failed("删除失败!"); - } - - /** - * 绑定内部作业 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/bindJobInside.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result bindJobInside(HttpServletRequest request,String[] ids, String jobId) throws IOException, ServiceException { - User cu = (User) request.getSession().getAttribute("cu"); - SafetyJobInside job = safetyJobInsideService.selectById(jobId); - for (String id : ids) { - if (StringUtils.isNotEmpty(id)) { - SafetyEducationBuilder bean = safetyEducationBuilderService.selectById(id); - bean.setSafetyJobId(jobId); - safetyEducationBuilderService.update(bean); - } - } - safetyFlowTaskService.saveWorkFlowRecord(false, - job.getId(), - SafetyJobInsideStatusEnum.PROJECT_BEGIN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - job.getCopyUserId(), - job.getCopyUserName(), - cu.getCaption() + DateUtil.toStr(null, new Date()) + "关联安全培训。"); - return Result.success(); - } - - /** - * 绑定相关单位作业 - * - * @Author: lt - * @Date: 2022/10/21 - **/ - @RequestMapping("/bindJobOutside.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result bindJobOutside(HttpServletRequest request,String[] ids, String jobId) throws IOException, ServiceException { - User cu = (User) request.getSession().getAttribute("cu"); - SafetyJobOutside job = safetyJobOutsideService.selectById(jobId); - for (String id : ids) { - if (StringUtils.isNotEmpty(id)) { - SafetyEducationBuilder bean = safetyEducationBuilderService.selectById(id); - bean.setSafetyJobId(jobId); - safetyEducationBuilderService.update(bean); - } - } - safetyFlowTaskService.saveWorkFlowRecord(false, - job.getId(), - SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - null, - null, - cu.getCaption() + DateUtil.toStr(null, new Date()) + "关联安全培训。"); - return Result.success(); - } - - /** - * 绑定作业 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/unbindJob.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result unbindJob(HttpServletRequest request, String id) throws ServiceException { - User cu = (User) request.getSession().getAttribute("cu"); - SafetyEducationBuilder bean = safetyEducationBuilderService.selectById(id); - SafetyJobInside job = safetyJobInsideService.selectById(bean.getSafetyJobId()); - bean.setSafetyJobId(""); - safetyEducationBuilderService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyJobInsideStatusEnum.PROJECT_BEGIN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - job != null ? job.getCopyUserId() : null, - job != null ? job.getCopyUserName() : null, - cu.getCaption() + DateUtil.toStr(null, new Date()) + "解除关联安全培训。"); - - return Result.success(); - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/bindListShow.do") - public String bindListShow(Model model, String bizId) { - model.addAttribute("bizId", bizId); - return "safety/SafetyEducationBuilderBindList"; - } - - /** - * 绑定内部作业 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/companyList.do") - @Transactional(rollbackFor = Exception.class) - public String companyList(Model model) throws IOException, ServiceException { - List enumJsonObjects = safetyEducationBuilderService.companyList(); - String result; - if(enumJsonObjects==null){ - result= "[]"; - }else { - result= JSON.toJSONString(enumJsonObjects); - } - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/safety/SafetyEducationInsiderController.java b/src/com/sipai/controller/safety/SafetyEducationInsiderController.java deleted file mode 100644 index 8e830955..00000000 --- a/src/com/sipai/controller/safety/SafetyEducationInsiderController.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.controller.safety; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.SafetyEducationTypeEnum; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.safety.SafetyEducationInsider; -import com.sipai.entity.safety.SafetyEducationInsiderQuery; -import com.sipai.entity.safety.SafetyEducationInsiderVo; -import com.sipai.entity.safety.SafetyFiles; -import com.sipai.entity.user.Unit; -import com.sipai.service.safety.SafetyEducationInsiderService; -import com.sipai.service.safety.SafetyFilesService; -import com.sipai.service.safety.SafetySeqService; -import com.sipai.service.user.UnitService; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.UUID; -import java.util.stream.Collectors; - -@Controller -@RequestMapping("/safety/SafetyEducationInsider") -public class SafetyEducationInsiderController { - - @Resource - private SafetyEducationInsiderService safetyEducationInsiderService; - @Resource - private UnitService unitService; - @Resource - private SafetyFilesService safetyFilesService; - @Resource - private SafetySeqService safetySeqService; - - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - model.addAttribute("educationTypeCondition", SafetyEducationTypeEnum.getAllEnableType4JSON()); - return "safety/EducationInsiderList"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - String educationCode = safetySeqService.code(request, SafetyFunctionEnum.EDUCATION_INSIDER); - model.addAttribute("educationCode", educationCode); - model.addAttribute("educationType", SafetyEducationTypeEnum.getAllEnableType4JSON()); - return "safety/EducationInsiderAdd"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) { - SafetyEducationInsider educationInsider = safetyEducationInsiderService.selectById(id); - SafetyFiles file = safetyFilesService.selectById(educationInsider.getFileId()); - model.addAttribute("bean", educationInsider); - model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName()); - model.addAttribute("educationType", SafetyEducationTypeEnum.getAllEnableType4JSON()); - return "safety/EducationInsiderEdit"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - SafetyEducationInsider educationInsider = safetyEducationInsiderService.selectById(id); - SafetyFiles file = safetyFilesService.selectById(educationInsider.getFileId()); - model.addAttribute("bean", educationInsider); - model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName()); - model.addAttribute("educationType", SafetyEducationTypeEnum.getAllEnableType4JSON()); - return "safety/EducationInsiderView"; - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyEducationInsiderQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (org.apache.commons.lang.StringUtils.isNotEmpty(query.getDeptId())) { - List unitChildrenById = unitService.getUnitChildrenById(query.getDeptId()); - List deptIds = unitChildrenById.stream().map(Unit::getId).collect(Collectors.toList()); - deptIds.add(query.getDeptId()); - query.setChildrenDeptIdIn("'" + org.apache.commons.lang.StringUtils.join(deptIds, "','") + "'"); - } else { - query.setChildrenDeptIdIn("'@#'"); - } - - PageHelper.startPage(page, rows); - List list = safetyEducationInsiderService.getList(query); - for (SafetyEducationInsiderVo item : list) { - item.setEducationTypeName(SafetyEducationTypeEnum.getNameByid(item.getEducationType())); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyEducationInsider bean, MultipartFile file) throws IOException { - bean.setId(UUID.randomUUID().toString()); - if (file.getSize() > 0) { - List fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_VISITOR.getId(), null, bean.getId()); - bean.setFileId(fileBeanList.get(0).getId()); - } - safetyEducationInsiderService.save(bean); - return Result.success(); - } - - /** - * 更新 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyEducationInsider bean, MultipartFile file) throws IOException { - SafetyEducationInsider oldBean = safetyEducationInsiderService.selectById(bean.getId()); - //如果文件id是空的,代表用户重新上传的文件,先删除原来的文件,然后再上传新文件。 - if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() > 0) { - List fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_INSIDER.getId(), null, bean.getId()); - bean.setFileId(fileBeanList.get(0).getId()); - safetyEducationInsiderService.update(bean); - // 删除原来的附件记录 - safetyFilesService.deleteById(oldBean.getFileId()); - } else if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() == 0) { - bean.setFileId(null); - safetyEducationInsiderService.update(bean); - safetyFilesService.deleteById(oldBean.getFileId()); - } else { - safetyEducationInsiderService.update(bean); - } - return Result.success(); - } - - /** - * 删除 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - safetyEducationInsiderService.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - /** - * 删除附件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/deleteFile.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(HttpServletResponse response, String id) throws IOException { - SafetyEducationInsider bean = safetyEducationInsiderService.selectById(id); - safetyFilesService.deleteById(bean.getFileId()); - bean.setFileId(""); - int row = safetyEducationInsiderService.update(bean); - if (row != 0) { - return Result.success(); - } - return Result.failed("删除失败!"); - } -} diff --git a/src/com/sipai/controller/safety/SafetyEducationTraineeController.java b/src/com/sipai/controller/safety/SafetyEducationTraineeController.java deleted file mode 100644 index b7b63ea3..00000000 --- a/src/com/sipai/controller/safety/SafetyEducationTraineeController.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.sipai.controller.safety; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.SafetyEducationTypeEnum; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.safety.*; -import com.sipai.entity.user.Unit; -import com.sipai.service.safety.SafetyEducationTraineeService; -import com.sipai.service.safety.SafetyFilesService; -import com.sipai.service.safety.SafetySeqService; -import com.sipai.service.user.UnitService; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.text.ParseException; -import java.util.List; -import java.util.UUID; -import java.util.stream.Collectors; - -@Controller -@RequestMapping("/safety/SafetyEducationTrainee") -public class SafetyEducationTraineeController { - - @Resource - private SafetyEducationTraineeService safetyEducationTraineeService; - - @Resource - private SafetyFilesService safetyFilesService; - @Resource - private SafetySeqService safetySeqService; - - @Resource - private UnitService unitService; - - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - - return "safety/EducationTraineeList"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - String educationCode =safetySeqService.code(request,SafetyFunctionEnum.EDUCATION_TRAINEE); - model.addAttribute("educationCode", educationCode); - return "safety/EducationTraineeAdd"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) { - SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id); - SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId()); - model.addAttribute("bean", educationTrainee); - model.addAttribute("fileName", file==null?"":file.getOriginalFileName()); - return "safety/EducationTraineeEdit"; - } - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - SafetyEducationTrainee educationTrainee = safetyEducationTraineeService.selectById(id); - SafetyFiles file = safetyFilesService.selectById(educationTrainee.getFileId()); - model.addAttribute("bean", educationTrainee); - model.addAttribute("fileName",file==null?"":file.getOriginalFileName()); - return "safety/EducationTraineeView"; - } - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyEducationTraineeQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (org.apache.commons.lang.StringUtils.isNotEmpty(query.getDeptId())) { - List unitChildrenById = unitService.getUnitChildrenById(query.getDeptId()); - List deptIds = unitChildrenById.stream().map(Unit::getId).collect(Collectors.toList()); - deptIds.add(query.getDeptId()); - query.setChildrenDeptIdIn("'" + org.apache.commons.lang.StringUtils.join(deptIds, "','") + "'"); - } else { - query.setChildrenDeptIdIn("'@#'"); - } - - PageHelper.startPage(page, rows); - List list = safetyEducationTraineeService.getList(query); -// for (SafetyEducationInsiderVo item : list) { -// item.setEducationTypeName(SafetyEducationTypeEnum.getNameByid(item.getEducationType())); -// } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyEducationTrainee bean, MultipartFile file) throws IOException, ParseException { - - if (!safetyEducationTraineeService.timeRangeCheck(bean)) { - return Result.failed("培训有效期早于培训日期!"); - } - - bean.setId(UUID.randomUUID().toString()); - if (file.getSize() > 0) { - List fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_VISITOR.getId(), null, bean.getId()); - bean.setFileId(fileBeanList.get(0).getId()); - } - safetyEducationTraineeService.save(bean); - return Result.success(); - } - - /** - * 更新 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request,SafetyEducationTrainee bean, MultipartFile file) throws IOException, ParseException { - - if (!safetyEducationTraineeService.timeRangeCheck(bean)) { - return Result.failed("培训有效期早于培训日期!"); - } - SafetyEducationTrainee oldBean = safetyEducationTraineeService.selectById(bean.getId()); - //如果文件id是空的,代表用户重新上传的文件,先删除原来的文件,然后再上传新文件。 - if (StringUtils.isEmpty(bean.getFileId())&&file.getSize()>0) { - List fileBeanList = safetyFilesService.upload(request,file, SafetyFunctionEnum.EDUCATION_TRAINEE.getId(), null, bean.getId()); - bean.setFileId(fileBeanList.get(0).getId()); - safetyEducationTraineeService.update(bean); - // 删除原来的附件记录 - safetyFilesService.deleteById(oldBean.getFileId()); - } else if (StringUtils.isEmpty(bean.getFileId()) && file.getSize()==0) { - bean.setFileId(null); - safetyEducationTraineeService.update(bean); - safetyFilesService.deleteById(oldBean.getFileId()); - }else { - safetyEducationTraineeService.update(bean); - } - return Result.success(); - } - - /** - * 删除 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - safetyEducationTraineeService.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - /** - * 删除附件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/deleteFile.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(HttpServletResponse response, String id) throws IOException { - SafetyEducationTrainee bean = safetyEducationTraineeService.selectById(id); - safetyFilesService.deleteById(bean.getFileId()); - bean.setFileId(""); - int row = safetyEducationTraineeService.update(bean); - if (row!=0) { - return Result.success(); - } - return Result.failed("删除失败!"); - } -} diff --git a/src/com/sipai/controller/safety/SafetyEducationVisitorController.java b/src/com/sipai/controller/safety/SafetyEducationVisitorController.java deleted file mode 100644 index 3be631e0..00000000 --- a/src/com/sipai/controller/safety/SafetyEducationVisitorController.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.sipai.controller.safety; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationVisitor; -import com.sipai.entity.safety.SafetyFiles; -import com.sipai.service.safety.SafetyEducationVisitorService; -import com.sipai.service.safety.SafetyFilesService; -import com.sipai.service.safety.SafetySeqService; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.text.ParseException; -import java.util.List; -import java.util.UUID; - -@Controller -@RequestMapping("/safety/SafetyEducationVisitor") -public class SafetyEducationVisitorController { - - @Resource - private SafetyEducationVisitorService safetyEducationVisitorService; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - - return "safety/EducationVisitorList"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - - // 安全模块编号todo - String educationCode = safetySeqService.code(request, SafetyFunctionEnum.EDUCATION_VISITOR); - model.addAttribute("educationCode", educationCode); - return "safety/EducationVisitorAdd"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) { - SafetyEducationVisitor educationVisitor = safetyEducationVisitorService.selectById(id); - SafetyFiles file = safetyFilesService.selectById(educationVisitor.getFileId()); - model.addAttribute("bean", educationVisitor); - model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName()); - return "safety/EducationVisitorEdit"; - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - SafetyEducationVisitor educationVisitor = safetyEducationVisitorService.selectById(id); - SafetyFiles file = safetyFilesService.selectById(educationVisitor.getFileId()); - model.addAttribute("bean", educationVisitor); - model.addAttribute("fileName", file == null ? "" : file.getOriginalFileName()); - return "safety/EducationVisitorView"; - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyCommonQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = safetyEducationVisitorService.getList(query); - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyEducationVisitor bean, MultipartFile file) throws IOException, ParseException { - if (!safetyEducationVisitorService.timeRangeCheck(bean)) { - return Result.failed("离开时间应晚于来访时间!"); - } - - bean.setId(UUID.randomUUID().toString()); - if (file.getSize() > 0) { - List fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_VISITOR.getId(), null, bean.getId()); - bean.setFileId(fileBeanList.get(0).getId()); - } - safetyEducationVisitorService.save(bean); - return Result.success(); - } - - /** - * 更新 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyEducationVisitor bean, MultipartFile file) throws IOException, ParseException { - if (!safetyEducationVisitorService.timeRangeCheck(bean)) { - return Result.failed("离开时间应晚于来访时间!"); - } - SafetyEducationVisitor oldBean = safetyEducationVisitorService.selectById(bean.getId()); - //如果文件id是空的,代表用户重新上传的文件,先删除原来的文件,然后再上传新文件。 - if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() > 0) { - List fileBeanList = safetyFilesService.upload(request, file, SafetyFunctionEnum.EDUCATION_VISITOR.getId(), null, bean.getId()); - bean.setFileId(fileBeanList.get(0).getId()); - safetyEducationVisitorService.update(bean); - // 删除原来的附件记录 - safetyFilesService.deleteById(oldBean.getFileId()); - } else if (StringUtils.isEmpty(bean.getFileId()) && file.getSize() == 0) { - bean.setFileId(null); - safetyEducationVisitorService.update(bean); - safetyFilesService.deleteById(oldBean.getFileId()); - } else { - safetyEducationVisitorService.update(bean); - } - return Result.success(); - } - - /** - * 删除 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - safetyEducationVisitorService.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - /** - * 删除附件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/deleteFile.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(HttpServletResponse response, String id) throws IOException { - SafetyEducationVisitor bean = safetyEducationVisitorService.selectById(id); - safetyFilesService.deleteById(bean.getFileId()); - bean.setFileId(""); - int row = safetyEducationVisitorService.update(bean); - if (row != 0) { - return Result.success(); - } - return Result.failed("删除失败!"); - } -} diff --git a/src/com/sipai/controller/safety/SafetyExternalCertificateController.java b/src/com/sipai/controller/safety/SafetyExternalCertificateController.java deleted file mode 100644 index 9bf78801..00000000 --- a/src/com/sipai/controller/safety/SafetyExternalCertificateController.java +++ /dev/null @@ -1,618 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelReader; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.read.listener.PageReadListener; -import com.alibaba.excel.read.metadata.ReadSheet; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.safety.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.safety.SafetyCertificateService; -import com.sipai.service.safety.SafetyExternalStaffService; -import com.sipai.service.safety.SafetyFilesService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author LiTao - * @date 2022-09-21 14:31:54 - * @description: 外部人员证书 - */ -@Controller -@RequestMapping("/safety/externalCertificate") -public class SafetyExternalCertificateController { - - // 证书员服务 - @Resource - private SafetyCertificateService service; - - // 单位人员服务 - @Resource - private UnitService unitService; - - @Resource - private UserService userService; - - // 文件员服务 - @Resource - private SafetyFilesService safetyFilesService; - - // 外部人员服务 - @Resource - private SafetyExternalStaffService safetyExternalStaffService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/safety/ExternalCertificateList"; - } - - // 外部证书 - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "issueDate", required = false) String issueDate, - @RequestParam(value = "jobType", required = false) String jobType, - @RequestParam(value = "companyParam", required = false) String companyParam) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("createTime")) { - sort = " sc.userid, sc.create_time "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - //if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - // List unitlist = unitService.getUnitChildrenById(request.getParameter("search_code")); - // String pidstr = ""; - // for (int i = 0; i < unitlist.size(); i++) { - // pidstr += "'" + unitlist.get(i).getId() + "',"; - // } - // if (pidstr != "") { - // pidstr = pidstr.substring(0, pidstr.length() - 1); - // wherestr += "and u.pid in (" + pidstr + ") "; - // } - //} else { - // Company company = unitService.getCompanyByUserId(cu.getId()); - // String companyId = "-1"; - // if (company != null) { - // companyId = company.getId(); - // } - // List users = unitService.getChildrenUsersById(companyId); - // String userIds = ""; - // for (User user : users) { - // if (!userIds.isEmpty()) { - // userIds += "','"; - // } - // userIds += user.getId(); - // } - // if (!userIds.isEmpty()) { - // wherestr += "and u.id in ('" + userIds + "') "; - // } - //} - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (sc.certificate_name like '%" + request.getParameter("search_name") + "%'" + - " or ses.name like '%" + request.getParameter("search_name") + "%')"; - } - - // 领证时间筛选 - String issueDate_param = request.getParameter("issueDate"); - if (org.apache.commons.lang3.StringUtils.isNotBlank(issueDate_param)) { - String[] split = issueDate_param.split("~"); - String issueDate_param_start_time = split[0].trim(); - String issueDate_param_end_time = split[1].trim(); - wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" + - " and sc.issue_date <= '" + issueDate_param_end_time + "'"; - } - - //作业类型 - String jobType_param = request.getParameter("jobType"); - if (org.apache.commons.lang3.StringUtils.isNotBlank(jobType_param)) { - wherestr += " and sc.job_type = '" + jobType_param + "'"; - } - - //施工单位 - String company_param = request.getParameter("companyParam"); - if (org.apache.commons.lang3.StringUtils.isNotBlank(company_param)) { - wherestr += " and ses.company = '" + company_param + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.service.selectListByConditionForExternal(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - return "/safety/ExternalCertificateAdd"; - } - - @RequestMapping("/save.do") - @Transactional(rollbackFor = Exception.class) - public String dosave(HttpServletRequest request, Model model, SafetyExternalCertificateVo bean, - MultipartFile file) throws Exception { - bean.setFlag("2");// 外部证书 - - // 证书实体 - SafetyCertificate entity = new SafetyCertificate(); - entity.setFlag(bean.getFlag()); - entity.setCertificateNo(bean.getCertificateNo()); - - // 验证 证书编号如果不为空 - if (StringUtils.isNotBlank(bean.getCertificateNo())) { - List count = this.service.selectOneByConditionForExternal(bean); - if (!CollectionUtils.isEmpty(count)) { - model.addAttribute("result", CommUtil.toJson(Result.failed("证书编号已存在!"))); - return "result"; - } - } - - //判断新增外部人员还是修改外部人员 - SafetyExternalStaff ses = new SafetyExternalStaff(); - ses.setName(bean.getUsername()); - ses.setSex(bean.getSex()); - ses.setCompany(bean.getCompany()); - ses.setBirthday(bean.getBirthday()); - ses.setUsherId(bean.getUsherId()); - ses.setUsherDept(bean.getUsherDept()); - ses.setDuty(bean.getDuty()); - ses.setJobTitle(bean.getJobTitle()); - ses.setIdcard(bean.getIdcard()); - - if (StringUtils.isNotBlank(bean.getStaffId())) {//修改 - ses.setId(bean.getStaffId()); - //身份证唯一验证 - List list = safetyExternalStaffService.validationIdcard(ses); - if(!CollectionUtils.isEmpty(list)){ - model.addAttribute("result", CommUtil.toJson(Result.failed("身份证号已存在!"))); - return "result"; - } - safetyExternalStaffService.update(ses); - } else {//新增 - //身份证唯一 - List list = safetyExternalStaffService.validationIdcard(ses); - if(!CollectionUtils.isEmpty(list)){ - model.addAttribute("result", CommUtil.toJson(Result.failed("身份证号已存在!"))); - return "result"; - } - ses.setId(UUID.randomUUID().toString()); - safetyExternalStaffService.save(ses); - } - - - // 证书实体 - entity.setId(UUID.randomUUID().toString()); - entity.setUserid(ses.getId()); - entity.setCertificateName(bean.getCertificateName()); - entity.setCertificateNo(bean.getCertificateNo()); - entity.setJobCode(bean.getJobCode()); - entity.setJobType(bean.getJobType()); - entity.setIssuingAuthority(bean.getIssuingAuthority()); - entity.setIssueDate(StringUtils.isNotBlank(bean.getIssueDate()) ? bean.getIssueDate() : null); - entity.setExpirationDate(StringUtils.isNotBlank(bean.getExpirationDate()) ? bean.getExpirationDate() : null); - entity.setFlag(bean.getFlag()); - - // 上传附件 - if (!file.isEmpty()) { - safetyFilesService.upload(request, file, SafetyFunctionEnum.CERTIFICATE_INSIDER.getId(), null, entity.getId()); - } - // 保存证书 - model.addAttribute("result", CommUtil.toJson(Result.success(this.service.save(entity)))); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - SafetyExternalCertificateVo vo = this.service.selectOneByIdForExternal(id); - model.addAttribute("safetyExternalCertificate", vo); - return "/safety/ExternalCertificateEdit"; - } - - @RequestMapping("/update.do") - @Transactional(rollbackFor = Exception.class) - public String doupdate(HttpServletRequest request, Model model, SafetyExternalCertificateVo bean, - MultipartFile file) throws Exception { - bean.setFlag("2");// 外部证书 - - // 证书实体 - SafetyCertificate entity = new SafetyCertificate(); - entity.setFlag(bean.getFlag()); - entity.setCertificateNo(bean.getCertificateNo()); - - // 验证 证书编号如果不为空 - if (StringUtils.isNotBlank(bean.getCertificateNo())) { - List count = this.service.selectOneByConditionForExternal(bean); - if (!CollectionUtils.isEmpty(count)) { - model.addAttribute("result", CommUtil.toJson(Result.failed("证书编号已存在!"))); - return "result"; - } - } - - //判断新增外部人员还是修改外部人员 - SafetyExternalStaff ses = new SafetyExternalStaff(); - ses.setName(bean.getUsername()); - ses.setSex(bean.getSex()); - ses.setCompany(bean.getCompany()); - ses.setBirthday(bean.getBirthday()); - ses.setUsherId(bean.getUsherId()); - ses.setUsherDept(bean.getUsherDept()); - ses.setDuty(bean.getDuty()); - ses.setJobTitle(bean.getJobTitle()); - ses.setIdcard(bean.getIdcard()); - - if (StringUtils.isNotBlank(bean.getStaffId())) {//修改 - ses.setId(bean.getStaffId()); - //身份证唯一验证 - List list = safetyExternalStaffService.validationIdcard(ses); - if(!CollectionUtils.isEmpty(list)){ - model.addAttribute("result", CommUtil.toJson(Result.failed("身份证号已存在!"))); - return "result"; - } - safetyExternalStaffService.update(ses); - } else {//新增 - //身份证唯一验证 - List list = safetyExternalStaffService.validationIdcard(ses); - if(!CollectionUtils.isEmpty(list)){ - model.addAttribute("result", CommUtil.toJson(Result.failed("身份证号已存在!"))); - return "result"; - } - ses.setId(UUID.randomUUID().toString()); - safetyExternalStaffService.save(ses); - } - - - // 证书实体 - entity.setId(bean.getId()); - entity.setUserid(ses.getId()); - entity.setCertificateName(bean.getCertificateName()); - entity.setCertificateNo(bean.getCertificateNo()); - entity.setJobCode(bean.getJobCode()); - entity.setJobType(bean.getJobType()); - entity.setIssuingAuthority(bean.getIssuingAuthority()); - entity.setIssueDate(StringUtils.isNotBlank(bean.getIssueDate()) ? bean.getIssueDate() : null); - entity.setExpirationDate(StringUtils.isNotBlank(bean.getExpirationDate()) ? bean.getExpirationDate() : null); - entity.setFlag(bean.getFlag()); - - // 上传附件 - if (!file.isEmpty()) { - if (!org.springframework.util.StringUtils.isEmpty(bean.getFileId())) { - safetyFilesService.deleteById(bean.getFileId()); - } - safetyFilesService.upload(request, file, SafetyFunctionEnum.CERTIFICATE_INSIDER.getId(), null, entity.getId()); - } - // 修改证书 - model.addAttribute("result", CommUtil.toJson(Result.success(this.service.update(entity)))); - return "result"; - } - - @RequestMapping("/delete.do") - @Transactional(rollbackFor = Exception.class) - public String delete(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) throws IOException { - int result = service.deleteById(id); - safetyFilesService.deleteByBizId(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - @Transactional(rollbackFor = Exception.class) - public String delete(HttpServletRequest request, Model model, String[] ids) throws IOException { - int result = 0; - for (String id : ids) { - result += service.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 跳转导入页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelShow.do") - public String doimport(HttpServletRequest request, Model model) { - return "/safety/ExternalCertificateImport"; - } - - /** - * excel导入 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/importExcel.do") - @Transactional(rollbackFor = Exception.class) - public String importExcel(@RequestParam(value = "filelist", required = false) MultipartFile file, - HttpServletRequest request, - Model model) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - StringBuilder errMsg = new StringBuilder(); - AtomicInteger successCount = new AtomicInteger(); - AtomicInteger failCount = new AtomicInteger(); - Map statusMap = new HashMap(); - - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - - ExcelReader excelReader = EasyExcel.read(excelFile.getInputStream()).build(); - excelReader.readAll(); - excelReader.finish(); - List sheets = excelReader.excelExecutor().sheetList(); - excelReader.finish(); - for (ReadSheet sheet : sheets) { - String[] sheetInfo = sheet.getSheetName().split("_"); - EasyExcel.read(excelFile.getInputStream(), SafetyExternalCertificateExcel.class, new PageReadListener(dataList -> { - int success = 0; - int fail = 0; - SafetyExternalStaff ses = null; // 外部员工 - SafetyCertificate sc = null; // 证书 - for (int i = 0; i < dataList.size(); i++) { - SafetyExternalCertificateExcel excelEntity = dataList.get(i); - /* - * 1. 处理外部员工信息 - */ - //验参 - String username = excelEntity.getUsername(); - if(StringUtils.isBlank(username)){ - errMsg.append( (i+1) + "条,姓名不能为空!\n"); - fail++; - continue; - } - String idcard = excelEntity.getIdcard(); - if(StringUtils.isBlank(idcard)){ - errMsg.append( (i+1) + "条,身份证号不能为空!\n"); - fail++; - continue; - } - //String ushername = excelEntity.getUsherName(); - //if(StringUtils.isBlank(ushername)){ - // errMsg.append( (i+1) + "条,负责人不能为空!\n"); - // fail++; - // continue; - //} - //String usherdept = excelEntity.getUsherDept(); - //if(StringUtils.isBlank(usherdept)){ - // errMsg.append( (i+1) + "条,负责部门不能为空!\n"); - // fail++; - // continue; - //} - - //查询外部员工是否存在 存在则修改,不存在则新增 - ses = new SafetyExternalStaff(); - ses.setIdcard(excelEntity.getIdcard()); - List sesList = safetyExternalStaffService.getExternalStaffByCondition(ses); - - ses.setName(excelEntity.getUsername()); - ses.setCompany(excelEntity.getCompany()); - String sexText = excelEntity.getSexText(); - if (StringUtils.isNotBlank(sexText) && !"null".equals(sexText)) { - if (sexText.contains("男")) { - ses.setSex("1"); - } else { - ses.setSex("0"); - } - } - ses.setBirthday(excelEntity.getBirthday()); - //根据负责人名称 和 部门 查询负责人ID - if (StringUtils.isNotBlank(excelEntity.getUsherName()) && StringUtils.isNotBlank(excelEntity.getUsherDept())) { - /* - // 需要重新写sql: - select - a.id as userid, - a.caption as username, - b.name as deptname - from tb_user a - left join uv_unit b on a.pid = b.id - where 1=1 and a.active='1' - and a.caption = '伦文韬' and b.name = '佛山市三水佛水供水有限公司' - */ - String usherId = safetyExternalStaffService.selectUsher(excelEntity); - if(StringUtils.isNotBlank(usherId)){ - ses.setUsherId(usherId); - } - } - ses.setUsherDept(excelEntity.getUsherDept()); - ses.setDuty(excelEntity.getDuty()); - ses.setJobTitle(excelEntity.getJobTitle()); - - if (CollectionUtils.isEmpty(sesList)) {// 新增 - ses.setId(UUID.randomUUID().toString()); - success += safetyExternalStaffService.save(ses); - } else { //修改 - ses.setId(sesList.get(0).getId()); - success += safetyExternalStaffService.update(ses); - } - - - /* - * 2. 处理 证书信息 - * 如果证书名称不为空 处理证书信息 - */ - if(StringUtils.isNotBlank(excelEntity.getCertificateName())){ - sc = new SafetyCertificate(); - sc.setUserid(ses.getId()); - sc.setFlag("2"); // 数据标志 1内部证书 2外部证书 - sc.setCertificateNo(excelEntity.getCertificateNo()); - sc.setCertificateName(excelEntity.getCertificateName()); - sc.setUserid(ses.getId()); - - //判断证书是否存在 - List scList = null; - if(StringUtils.isNotBlank(excelEntity.getCertificateNo())){ - scList = service.selectOneByConditionForExternal(sc); - } - sc.setJobCode(excelEntity.getJobCode()); - sc.setJobType(excelEntity.getJobType()); - sc.setIssuingAuthority(excelEntity.getIssuingAuthority()); - sc.setIssueDate(excelEntity.getIssueDate()); - sc.setExpirationDate(excelEntity.getExpirationDate()); - - if(CollectionUtils.isEmpty(scList)){//新增 - sc.setId(UUID.randomUUID().toString()); - service.save(sc); - }else{ // 修改 - sc.setId(scList.get(0).getId()); - service.update(sc); - } - } - } - successCount.set(success); - failCount.set(fail); - })).sheet(sheet.getSheetName()).doRead(); - } - - if (!errMsg.toString().isEmpty()) { - statusMap.put("status", false); - statusMap.put("msg", "导入成功" + successCount.intValue() + "条!" + "失败" + failCount.intValue() + "条,错误信息:" + errMsg.toString()); - model.addAttribute("result", JSONObject.fromObject(statusMap).toString()); - return "result"; - } else { - statusMap.put("status", true); - statusMap.put("msg", "导入成功" + successCount.intValue() + "条!"); - model.addAttribute("result", JSONObject.fromObject(statusMap).toString()); - return "result"; - } - } - - /** - * excel导出 - * - * @param request - * @param response - * @throws IOException - */ - @RequestMapping("/exportExcel.do") - public void export(HttpServletRequest request, HttpServletResponse response, - @RequestParam(value = "issueDate", required = false) String issueDate, - @RequestParam(value = "jobType", required = false) String jobType, - @RequestParam(value = "companyParam", required = false) String companyParam) throws IOException { - // 摘自列表查询接口 start - User cu = (User) request.getSession().getAttribute("cu"); - String sort = " sc.userid, sc.create_time "; - String order = " desc "; - String orderstr = " order by " + sort + " " + order; - String wherestr = " where flag='2' "; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_code")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and u.pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and u.id in ('" + userIds + "') "; - } - } - - // 搜索框筛选 - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (sc.certificate_name like '%" + request.getParameter("search_name") + "%'" + - " or ses.name like '%" + request.getParameter("search_name") + "%')"; - } - - // 领证时间筛选 - if (StringUtils.isNotBlank(issueDate) && !"null".equals(issueDate)) { - String[] split = issueDate.split("~"); - String issueDate_param_start_time = split[0].trim(); - String issueDate_param_end_time = split[1].trim(); - wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" + - " and sc.issue_date <= '" + issueDate_param_end_time + "'"; - } - - //作业类型 - if (StringUtils.isNotBlank(jobType) && !"null".equals(jobType)) { - wherestr += " and sc.job_type = '" + jobType + "'"; - } - - //施工单位 - if (StringUtils.isNotBlank(companyParam) && !"null".equals(companyParam)) { - wherestr += " and ses.company = '" + companyParam + "'"; - } - - List list = this.service.selectListByConditionForExternal(wherestr + orderstr); - List excelList = new ArrayList<>(); - SafetyExternalCertificateExcel excelEntity = null; - for (SafetyExternalCertificateVo vo : list) { - excelEntity = new SafetyExternalCertificateExcel(); - BeanUtils.copyProperties(vo, excelEntity); - excelList.add(excelEntity); - } - // 摘自列表查询接口 end - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("外部人员证书信息", "UTF-8") + ".xlsx"); - - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), SafetyExternalCertificateExcel.class).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet("外部人员证书信息").build(); - excelWriter.write(excelList, writeSheet); - excelWriter.finish(); - } - } -} diff --git a/src/com/sipai/controller/safety/SafetyExternalStaffController.java b/src/com/sipai/controller/safety/SafetyExternalStaffController.java deleted file mode 100644 index 7373c3df..00000000 --- a/src/com/sipai/controller/safety/SafetyExternalStaffController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.safety.SafetyExternalStaff; -import com.sipai.entity.user.User; -import com.sipai.service.safety.SafetyExternalStaffService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -/** - * @author LiTao - * @date 2022-09-21 14:31:54 - * @description: 外部人员 - */ -@Controller -@RequestMapping("/safety/externalStaff") -public class SafetyExternalStaffController { - - // 外部人员服务 - @Resource - private SafetyExternalStaffService service; - - @RequestMapping("/selectExternalStaffModel.do") - public String selectEquipmentModel(HttpServletRequest request, Model model) { - String equipmentmodel = request.getParameter("staffId"); - model.addAttribute("staffId", equipmentmodel); - //String equipmentclassId = request.getParameter("equipmentclassid"); - //model.addAttribute("equipmentclassId",equipmentclassId); - return "/safety/selectExternalStaffModel"; - } - - // 外部人员 - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("createTime")) { - sort = " create_time "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%'"; - } - PageHelper.startPage(page, rows); - List list = this.service.selectListByWhere(wherestr + orderstr); - PageInfo pInfo = new PageInfo<>(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 施工单位下拉 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/companyPulldown.do") - public String jobTypePulldown(HttpServletRequest request, Model model) { - List> list = this.service.companyPulldown(); - model.addAttribute("result", JSON.toJSONString(list)); - return "result"; - } - - @RequestMapping("/delete.do") - public String delete(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - int result = service.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/safety/SafetyFilesController.java b/src/com/sipai/controller/safety/SafetyFilesController.java deleted file mode 100644 index e95fcfb8..00000000 --- a/src/com/sipai/controller/safety/SafetyFilesController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.base.Result; -import com.sipai.entity.safety.SafetyFiles; -import com.sipai.entity.safety.SafetyFilesVo; -import com.sipai.service.safety.SafetyFilesService; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.BufferedOutputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.List; -import java.util.UUID; - -@Controller -@RequestMapping("/safety/SafetyFiles") -public class SafetyFilesController { - - @Resource - private SafetyFilesService safetyFilesService; - - /** - * 下载附件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/download.do") - public void download(HttpServletResponse response, String fileId) throws IOException { - safetyFilesService.download(response, fileId); - } - - /** - * 文件列表 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/list.do") - @ResponseBody - public Result list(String bizId, Integer functionCode, Integer statusCode) throws IOException { - List list = safetyFilesService.list(bizId, functionCode, statusCode); - return Result.success(list); - } - - /** - * 新增文件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request,String bizId, Integer functionCode, Integer statusCode, MultipartFile saveFile) throws IOException { - safetyFilesService.upload(request,saveFile,functionCode,statusCode,bizId); - return Result.success(); - } - - /** - * 编辑文件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, String fileId, MultipartFile updateFile) throws IOException { - SafetyFiles oldFile = safetyFilesService.selectById(fileId); - safetyFilesService.upload(request, updateFile, oldFile.getFunctionCode(), oldFile.getStatusCode(), oldFile.getBizId()); - safetyFilesService.deleteById(oldFile.getId()); - return Result.success(); - } - /** - * 删除文件 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(HttpServletRequest request, String fileId ) throws IOException { - safetyFilesService.deleteById(fileId); - return Result.success(); - } - /** - * 渲染文件列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/fileListShow.do") - public String fileListShow(HttpServletRequest request, String bizId, Integer functionCode, Integer statusCode,boolean doNotUpload, Model model) throws IOException { - List list = safetyFilesService.list(bizId, functionCode, statusCode); - for (SafetyFilesVo vo : list) { - for (SafetyFiles file : vo.getFileList()) { - file.setAbsolutePath(java.net.URLEncoder.encode(file.getAbsolutePath())); - } - } - model.addAttribute("doNotUpload", doNotUpload); - model.addAttribute("bizId", bizId); - model.addAttribute("functionCode", functionCode); - model.addAttribute("statusCode", statusCode); - model.addAttribute("fileList", list == null ? "[]" : JSON.toJSONString(list)); - return "safety/SafetyCheckFileList"; - } - - - @RequestMapping("/toFindImg") - public void picToJSP(@RequestParam("imgUrl") String imgUrl, HttpServletRequest request, HttpServletResponse response){ - safetyFilesService.picToJSP(imgUrl,request,response); - - } - @RequestMapping("/toFindImgById") - public void picToJSPById(@RequestParam("fileId") String fileId, HttpServletRequest request, HttpServletResponse response){ - safetyFilesService.picToJSPById(fileId,request,response); - - } - -} diff --git a/src/com/sipai/controller/safety/SafetyFlowTaskController.java b/src/com/sipai/controller/safety/SafetyFlowTaskController.java deleted file mode 100644 index 9605a81d..00000000 --- a/src/com/sipai/controller/safety/SafetyFlowTaskController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.controller.safety; - -import com.sipai.entity.base.Result; -import com.sipai.entity.safety.SafetyFlowTaskVo; -import com.sipai.service.safety.SafetyFlowTaskDetailService; -import com.sipai.service.safety.SafetyFlowTaskService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.annotation.Resource; -import java.util.List; - -@Controller -@RequestMapping("/safety/SafetyFlowTask") -public class SafetyFlowTaskController { - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - @Resource - private SafetyFlowTaskDetailService safetyFlowTaskDetailService; - - @RequestMapping("/showList.do") - public String show(String bizId, Model model) { - List list = safetyFlowTaskService.getList(bizId); - model.addAttribute("bizId", bizId); - model.addAttribute("list", list); - return "safety/SafetyCheckFlowPathView"; - } - - @RequestMapping("/getList.do") - @ResponseBody - public Result list(String bizId) { - List list = safetyFlowTaskService.getList(bizId); - return Result.success(list); - } -} diff --git a/src/com/sipai/controller/safety/SafetyJobInsideController.java b/src/com/sipai/controller/safety/SafetyJobInsideController.java deleted file mode 100644 index c4512174..00000000 --- a/src/com/sipai/controller/safety/SafetyJobInsideController.java +++ /dev/null @@ -1,544 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.enums.safety.*; -import com.sipai.entity.safety.*; -import com.sipai.entity.user.User; -import com.sipai.service.safety.*; -import com.sipai.tools.DateUtil; -import org.activiti.engine.ActivitiObjectNotFoundException; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.text.ParseException; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Controller -@RequestMapping("/safety/SafetyJobInside") -public class SafetyJobInsideController { - - @Resource - private SafetyJobInsideService safetyJobInsideService; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - - @Resource - private SafetyJobInsideActivityService safetyJobInsideActivityService; - - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - - @Resource - private SafetyEducationBuilderService safetyEducationBuilderService; - - /** - * 跳转至列表页 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("cu", cu); - List list = safetyJobInsideService.getJobCompanyList(); - model.addAttribute("jobCompanyList", JSON.toJSONString(list)); - model.addAttribute("jobStatusList", SafetyJobInsideStatusEnum.getAllEnableType4JSON()); - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobInsideList"; - } - - /** - * 获取分页列表信息 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyJobCommonQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = safetyJobInsideService.getList(query); - for (SafetyJobInsideVo vo : list) { - vo.setJobStatusName(SafetyJobInsideStatusEnum.getNameByid(vo.getJobStatus())); - vo.setJobTypeName(SafetyJobTypeEnum.getNameByid(vo.getJobType().split(","))); - } - PageInfo pi = new PageInfo<>(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + JSON.toJSONString(list) + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobInsideAdd"; - } - - /** - * 保存 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyJobInside bean, MultipartFile file) throws Exception { - if (!safetyJobInsideService.timeRangeCheck(bean)) { - return Result.failed("项目结束时间早于项目开始时间!"); - } - - User cu = (User) request.getSession().getAttribute("cu"); - bean.setId(UUID.randomUUID().toString()); - String jobCode = safetySeqService.code(request, SafetyFunctionEnum.JOB_INSIDER); - bean.setJobCode(jobCode); - bean.setJobStatus(SafetyJobInsideStatusEnum.TEMP.getId()); - bean.setCreateUserId(cu.getId()); - bean.setCreateUserName(cu.getCaption()); - bean.setCountersignDetail(safetyJobInsideService.createSignDetail(bean)); - if (file.getSize() > 0) { - SafetyFiles fileBean = safetyFilesService.upload(request, null, SafetyFunctionEnum.JOB_INSIDER.getId(), SafetyJobInsideStatusEnum.TEMP.getId(), bean.getId()).get(0); - } - safetyJobInsideService.save(bean); - return Result.success(); - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) throws ServiceException { - SafetyJobInside bean = safetyJobInsideService.selectById(id); - model.addAttribute("bean", bean); - model.addAttribute("jobTypeListSub", SafetyJobTypeEnum.getAllEnableType4JSON()); - if (bean.getJobStatus() == SafetyJobInsideStatusEnum.TEMP.getId()) { - return "safety/SafetyJobInsideEdit"; - } else if (bean.getJobStatus() == SafetyJobInsideStatusEnum.PROJECT_BEGIN.getId()) { - return "safety/SafetyJobInsideIng"; - } else { - throw new ServiceException("非法页面"); - } - } - - /** - * 更新 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyJobInside bean) throws IOException, ParseException { - if (!safetyJobInsideService.timeRangeCheck(bean)) { - return Result.failed("项目结束时间早于项目开始时间!"); - } - bean.setJobStatus(SafetyJobInsideStatusEnum.TEMP.getId()); - safetyJobInsideService.update(bean); - - return Result.success(); - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - SafetyJobInside educationBuilder = safetyJobInsideService.selectById(id); - model.addAttribute("bean", educationBuilder); - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobInsideView"; - - } - - /** - * 删除 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - SafetyJobInside safetyJobInside = safetyJobInsideService.selectById(id); - if (safetyJobInside != null && SafetyJobInsideStatusEnum.TEMP.getId() != safetyJobInside.getJobStatus()) { - return Result.failed("只能删除草稿状态的数据。"); - } - safetyJobInsideService.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - - /** - * 新增申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/saveApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveApply(HttpServletRequest request, SafetyJobInside bean, MultipartFile file) throws Exception { - - save(request, bean, file); - - String processInstanceId = safetyJobInsideActivityService.apply(bean.getCreateUserId(), bean.getCountersignUserId(), ProcessType.SAFETY_JOB_INSIDE, bean.getId()); - bean.setProcessInstanceId(processInstanceId); - bean.setJobStatus(SafetyJobInsideStatusEnum.SIGN.getId()); - bean.setCountersignStatus(SafetyJobInsideCountersignStatusEnum.NO_BODY_SIGN.getId()); - safetyJobInsideService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyJobInsideStatusEnum.SIGN.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - bean.getCreateUserName() + DateUtil.toStr(null, new Date()) + "发起会签!"); - - - return Result.success(); - } - - /** - * 编辑申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/updateApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result apply(HttpServletRequest request, SafetyJobInside bean) throws IOException, ServiceException, ParseException { - - update(request, bean); - - safetyJobInsideActivityService.apply(bean.getCreateUserId(), bean.getCountersignUserId(), ProcessType.SAFETY_JOB_INSIDE, bean.getId()); - bean.setJobStatus(SafetyJobInsideStatusEnum.SIGN.getId()); - bean.setCountersignStatus(SafetyJobInsideCountersignStatusEnum.NO_BODY_SIGN.getId()); - safetyJobInsideService.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyJobInsideStatusEnum.SIGN.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - bean.getCreateUserName() + DateUtil.toStr(null, new Date()) + "发起会签!"); - - - return Result.success(); - } - - - /** - * 跳转至编辑弹窗 会签 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/auditShow.do") - public String editRespnose(HttpServletRequest request, Model model, String bizId, String taskId, String - processInstanceId) throws ServiceException { - //检查项目下拉 - model.addAttribute("agreeList", SafetyJobAgreeEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - // 编辑对象 - SafetyJobInside bean = safetyJobInsideService.selectById(bizId); - // 会签意见 - if (StringUtils.isNotEmpty(bean.getCountersignDetail())) { - model.addAttribute("signDetail", bean.getCountersignDetail()); - } else { - model.addAttribute("signDetail", "[]"); - } - - model.addAttribute("bean", bean); - - // 工作流信息 - model.addAttribute("taskId", taskId); - model.addAttribute("processInstanceId", processInstanceId); - - if (bean.getJobStatus() == SafetyJobInsideStatusEnum.SIGN.getId()) { - return "safety/SafetyJobInsideSign"; - } else { - throw new ServiceException("非法状态!"); - } - - } - - /** - * 跳转至编辑弹窗 会签 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/projectBeginShow.do") - public String projectBeginShow(HttpServletRequest request, Model model, String bizId) throws ServiceException { - //检查项目下拉 - model.addAttribute("agreeList", SafetyJobAgreeEnum.getAllEnableType4JSON()); - //检查结果下拉 - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - // 编辑对象 - SafetyJobInside bean = safetyJobInsideService.selectById(bizId); - // 会签意见 - if (StringUtils.isNotEmpty(bean.getCountersignDetail())) { - model.addAttribute("signDetail", bean.getCountersignDetail()); - } else { - model.addAttribute("signDetail", "[]"); - } - - model.addAttribute("bean", bean); - - return "safety/SafetyJobInsideSign"; - } - - /** - * 会签审批 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/audit.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result audit(HttpServletRequest request, String bizId, Integer pass, String remark, String taskId) throws - IOException, ServiceException { - User cu = (User) request.getSession().getAttribute("cu"); - - - safetyJobInsideActivityService.sign(cu.getId(), taskId, pass); - - SafetyJobInside bean = safetyJobInsideService.selectById(bizId); - String detail = bean.getCountersignDetail(); - com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(StringUtils.isEmpty(detail) ? "[]" : detail); - List list = jsonArray.toJavaList(SafetyJobInsideSignInfo.class); - for (SafetyJobInsideSignInfo item : list) { - - if (cu.getCaption().equals(item.getUserName())) { - item.setPass(pass == 1 ? "同意" : "不同意"); - item.setRemark(remark); - item.setTime(DateUtil.toStr(null, new Date())); - break; - } - - - } - - bean.setCountersignStatus(SafetyJobInsideCountersignStatusEnum.ANYONE_SIGN.getId()); - bean.setCountersignDetail(JSON.toJSONString(list)); - boolean allDoneFlag = true; - boolean hasRejection = false; - for (SafetyJobInsideSignInfo item : list) { - if ("尚未完成".equals(item.getPass())) { - allDoneFlag = false; - break; - } - if ("不同意".equals(item.getPass())) { - hasRejection = true; - } - - } - if (allDoneFlag && !hasRejection) { - bean.setJobStatus(SafetyJobInsideStatusEnum.PROJECT_BEGIN.getId()); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyJobInsideStatusEnum.SIGN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyJobInsideStatusEnum.SIGN.getTaskRecordPass(cu.getCaption() + DateUtil.toStr(null, new Date()))); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyJobInsideStatusEnum.PROJECT_BEGIN.getTaskTitle(), - null, - null, - bean.getCopyUserId(), - bean.getCopyUserName(), - null); - - } else if (allDoneFlag && hasRejection) { - //如果有人会签不同意,改条数据退回草稿状态 - bean.setJobStatus(SafetyJobInsideStatusEnum.TEMP.getId()); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyJobInsideStatusEnum.SIGN.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - bean.getCopyUserId(), - bean.getCopyUserName(), - "会签不通过!"); - } else { - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyJobInsideStatusEnum.SIGN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyJobInsideStatusEnum.SIGN.getTaskRecordPass(cu.getCaption() + DateUtil.toStr(null, new Date()))); - } - - - safetyJobInsideService.update(bean); - - - return Result.success(); - } - - /** - * 开局工单 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/saveFile.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveFile(HttpServletRequest request, String bizId, Integer functionCode, Integer statusCode, MultipartFile saveFile) throws IOException, ServiceException { - User cu = (User) request.getSession().getAttribute("cu"); - safetyFilesService.upload(request, saveFile, functionCode, statusCode, bizId); - SafetyJobInside bean = safetyJobInsideService.selectById(bizId); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyJobInsideStatusEnum.PROJECT_BEGIN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - bean.getCopyUserId(), - bean.getCopyUserName(), - cu.getCaption() + DateUtil.toStr(null, new Date()) + "开具工作单。"); - return Result.success(); - } - - - /** - * 关联安全管理页面 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/educationInsiderListForJobShow.do") - public String educationInsiderListForJob(HttpServletRequest request, String bizId, Model model) { - model.addAttribute("bizId", bizId); - model.addAttribute("educationTypeCondition", SafetyEducationTypeEnum.getAllEnableType4JSON()); - List companyList = safetyEducationBuilderService.companyList(); - model.addAttribute("companyList", JSON.toJSONString(companyList)); - return "safety/EducationBuilderListForInsideJob"; - } - - - /** - * 结束项目 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/endShow.do") - public String endShow(HttpServletRequest request, String id, Model model) throws ServiceException { - SafetyJobInside bean = safetyJobInsideService.selectById(id); - model.addAttribute("bean", bean); - model.addAttribute("jobTypeListSub", SafetyJobTypeEnum.getAllEnableType4JSON()); - - return "safety/SafetyJobInsideClose"; - - } - - /** - * 结束项目 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/end.do") - @ResponseBody - public Result educationInsiderListForJob(HttpServletRequest request, String id) throws ServiceException, IOException { - SafetyJobInside bean = safetyJobInsideService.selectById(id); - bean.setJobStatus(SafetyJobInsideStatusEnum.PROJECT_END.getId()); - User cu = (User) request.getSession().getAttribute("cu"); - safetyJobInsideService.update(bean); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyJobInsideStatusEnum.PROJECT_END.getTaskTitle(), - cu.getId(), - cu.getCaption(), - bean.getCopyUserId(), - bean.getCopyUserName(), - SafetyJobInsideStatusEnum.PROJECT_END.getTaskRecordPass(cu.getCaption() + DateUtil.toStr(null, new Date()))); - return Result.success(); - } - - /** - * 结束项目 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/revoke.do") - @ResponseBody -// @Transactional(noRollbackFor = ActivitiObjectNotFoundException.class) - public Result revoke(HttpServletRequest request, String id) throws ServiceException, IOException { - SafetyJobInside bean = safetyJobInsideService.selectById(id); - if (bean.getCountersignStatus().equals(SafetyJobInsideCountersignStatusEnum.NO_BODY_SIGN.getId())) { - try { - safetyJobInsideActivityService.closeProcessInstance(bean.getProcessInstanceId()); - } catch (ActivitiObjectNotFoundException ignored) { - - } - bean.setJobStatus(SafetyJobInsideStatusEnum.TEMP.getId()); - safetyFlowTaskService.deleteByBizId(id); - safetyJobInsideService.update(bean); - return Result.success(); - } else { - return Result.failed("已经有人发表会签意见,无法撤回!"); - } - - } -} diff --git a/src/com/sipai/controller/safety/SafetyJobOutsideController.java b/src/com/sipai/controller/safety/SafetyJobOutsideController.java deleted file mode 100644 index 8283924c..00000000 --- a/src/com/sipai/controller/safety/SafetyJobOutsideController.java +++ /dev/null @@ -1,351 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.enums.safety.*; -import com.sipai.entity.safety.*; -import com.sipai.entity.user.User; -import com.sipai.service.safety.*; -import com.sipai.tools.DateUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.text.ParseException; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Controller -@RequestMapping("/safety/SafetyJobOutside") -public class SafetyJobOutsideController { - - @Resource - private SafetyJobOutsideService service; - - @Resource - private SafetyFilesService safetyFilesService; - - @Resource - private SafetySeqService safetySeqService; - - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - - @Resource - private SafetyEducationBuilderService safetyEducationBuilderService; - - /** - * 跳转至列表页 - * - * @Author: lt - * @Date: 2022/10/18 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - List list = service.getJobCompanyList(); - model.addAttribute("jobCompanyList", JSON.toJSONString(list)); - model.addAttribute("jobStatusList", SafetyOutsiderJobStatusEnum.getAllEnableType4JSON()); - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobOutsideList"; - } - - /** - * 获取分页列表信息 - * - * @Author: lt - * @Date: 2022/10/18 - **/ - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - SafetyJobCommonQuery query, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - List list = service.getList(query); - for (SafetyJobOutsideVo vo : list) { - vo.setJobStatusName(SafetyOutsiderJobStatusEnum.getNameByid(vo.getJobStatus())); - if (StringUtils.isNotBlank(vo.getJobType())) { - vo.setJobTypeName(SafetyJobTypeEnum.getNameByid(vo.getJobType().split(","))); - } - } - PageInfo pi = new PageInfo<>(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + JSON.toJSONString(list) + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 跳转至新增弹窗 - * - * @Author: lt - * @Date: 2022/10/19 - **/ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) throws Exception { - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobOutsideAdd"; - } - - /** - * 保存 - * - * @Author: lt - * @Date: 2022/10/19 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result save(HttpServletRequest request, SafetyJobOutside bean, MultipartFile file) throws Exception { - if (!service.timeRangeCheck(bean)) { - return Result.failed("项目结束时间早于项目开始时间!"); - } - User cu = (User) request.getSession().getAttribute("cu"); - bean.setId(UUID.randomUUID().toString()); - String jobCode = safetySeqService.code(request, SafetyFunctionEnum.JOB_OUTSIDER); - bean.setJobCode(jobCode); - // 草稿 - bean.setJobStatus(SafetyOutsiderJobStatusEnum.TEMP.getId()); - bean.setCreateUserId(cu.getId()); - bean.setCreateUserName(cu.getCaption()); - if (file.getSize() > 0) { - safetyFilesService.upload(request, null, SafetyFunctionEnum.JOB_OUTSIDER.getId(), SafetyOutsiderJobStatusEnum.TEMP.getId(), bean.getId()); - } - service.save(bean); - return Result.success(); - } - - /** - * 新增申请 - * - * @Author: lt - * @Date: 2022/10/19 - **/ - @RequestMapping("/saveApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveApply(HttpServletRequest request, SafetyJobOutside bean, MultipartFile file) throws Exception { - save(request, bean, file); - - // 项目进行中 - bean.setJobStatus(SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getTaskTitle(), - bean.getCreateUserId(), // 当前节点审批人 - bean.getCreateUserName(),// 当前节点审批人 - null, - null, - bean.getCreateUserName() + DateUtil.toStr(null, new Date()) + "发起作业工单申请!"); - return Result.success(); - } - - /** - * 跳转至编辑弹窗 - * - * @Author: lt - * @Date: 2022/10/19 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id) throws ServiceException { - SafetyJobOutside bean = service.selectById(id); - if (bean != null) { - if (StringUtils.isNotBlank(bean.getProjectBeginDate())) { - bean.setProjectBeginDate(bean.getProjectBeginDate().substring(0, 19)); - } - if (StringUtils.isNotBlank(bean.getProjectEndDate())) { - bean.setProjectEndDate(bean.getProjectEndDate().substring(0, 19)); - } - } - model.addAttribute("bean", bean); - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - if (bean.getJobStatus() == SafetyOutsiderJobStatusEnum.TEMP.getId()) { - // 跳转至 草稿编辑弹窗 - return "safety/SafetyJobOutsideEdit"; - } else if (bean.getJobStatus() == SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getId()) { - // 跳转至编辑弹窗 开具工单 - return "safety/SafetyJobOutsideIng"; - } else { - throw new ServiceException("非法页面"); - } - } - - /** - * 更新 - * - * @Author: lt - * @Date: 2022/10/19 - **/ - @RequestMapping("/update.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result update(HttpServletRequest request, SafetyJobOutside bean) throws IOException, ParseException { - - if (!service.timeRangeCheck(bean)) { - return Result.failed("项目结束时间早于项目开始时间!"); - } - // 草稿 - bean.setJobStatus(SafetyOutsiderJobStatusEnum.TEMP.getId()); - service.update(bean); - return Result.success(); - } - - /** - * 编辑申请 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ - @RequestMapping("/updateApply.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result apply(HttpServletRequest request, SafetyJobOutside bean) throws IOException, ServiceException, ParseException { - - update(request, bean); - - // 项目进行中 - bean.setJobStatus(SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getId()); - service.update(bean); - - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getTaskTitle(), - bean.getCreateUserId(), - bean.getCreateUserName(), - null, - null, - bean.getCreateUserName() + DateUtil.toStr(null, new Date()) + "发起作业工单申请!"); - - return Result.success(); - } - - - /** - * 跳转至编辑弹窗 - * - * @Author: lt - * @Date: 2022/10/18 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id) { - SafetyJobOutside bean = service.selectById(id); - model.addAttribute("bean", bean); - model.addAttribute("jobTypeList", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobOutsideView"; - - } - - /** - * 删除 - * - * @Author: lt - * @Date: 2022/10/18 - **/ - @RequestMapping("/delete.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result delete(String[] ids) throws IOException { - for (String id : ids) { - service.deleteById(id); - } - for (String id : ids) { - safetyFilesService.deleteByBizId(id); - } - return Result.success(); - } - - /** - * 开具工单 - * - * @Author: lt - * @Date: 2022/10/20 - **/ - @RequestMapping("/saveFile.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result saveFile(HttpServletRequest request, String bizId, Integer functionCode, Integer statusCode, MultipartFile saveFile) throws IOException, ServiceException { - User cu = (User) request.getSession().getAttribute("cu"); - safetyFilesService.upload(request, saveFile, functionCode, statusCode, bizId); - SafetyJobOutside bean = service.selectById(bizId); - safetyFlowTaskService.saveWorkFlowRecord(false, - bean.getId(), - SafetyOutsiderJobStatusEnum.PROJECT_BEGIN.getTaskTitle(), - cu.getId(), - cu.getCaption(), - null, - null, - cu.getCaption() + DateUtil.toStr(null, new Date()) + "开具工作单。"); - return Result.success(); - } - - /** - * 关联安全管理页面 - * - * @Author: lt - * @Date: 2022/10/20 - **/ - @RequestMapping("/educationOutsiderListForJobShow.do") - public String educationOutsiderListForJob(HttpServletRequest request, String bizId, Model model) { - model.addAttribute("bizId", bizId); - model.addAttribute("educationTypeCondition", SafetyEducationTypeEnum.getAllEnableType4JSON()); - List companyList = safetyEducationBuilderService.companyList(); - model.addAttribute("companyList", JSON.toJSONString(companyList)); - return "safety/EducationBuilderListForOutsideJob"; - } - - /** - * 结束项目 - * - * @Author: lt - * @Date: 2022/10/20 - **/ - @RequestMapping("/endShow.do") - public String endShow(HttpServletRequest request, String id, Model model) throws ServiceException { - SafetyJobOutside bean = service.selectById(id); - model.addAttribute("bean", bean); - model.addAttribute("jobTypeListSub", SafetyJobTypeEnum.getAllEnableType4JSON()); - return "safety/SafetyJobOutsideClose"; - } - - /** - * 结束项目 - * - * @Author: lt - * @Date: 2022/10/20 - **/ - @RequestMapping("/end.do") - @ResponseBody - public Result educationOutsiderListForJob(HttpServletRequest request, String id) throws ServiceException, IOException { - SafetyJobOutside bean = service.selectById(id); - bean.setJobStatus(SafetyOutsiderJobStatusEnum.PROJECT_END.getId()); - User cu = (User) request.getSession().getAttribute("cu"); - service.update(bean); - safetyFlowTaskService.saveWorkFlowRecord(true, - bean.getId(), - SafetyOutsiderJobStatusEnum.PROJECT_END.getTaskTitle(), - cu.getId(), - cu.getCaption(), - null, - null, - SafetyOutsiderJobStatusEnum.PROJECT_END.getTaskRecordPass(cu.getCaption() + DateUtil.toStr(null, new Date()))); - return Result.success(); - } - -} diff --git a/src/com/sipai/controller/safety/StaffArchivesController.java b/src/com/sipai/controller/safety/StaffArchivesController.java deleted file mode 100644 index ce5b3369..00000000 --- a/src/com/sipai/controller/safety/StaffArchivesController.java +++ /dev/null @@ -1,430 +0,0 @@ -package com.sipai.controller.safety; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelReader; -import com.alibaba.excel.ExcelWriter; -import com.alibaba.excel.read.listener.PageReadListener; -import com.alibaba.excel.read.metadata.ReadSheet; -import com.alibaba.excel.write.metadata.WriteSheet; -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.safety.SafetyStaffArchives; -import com.sipai.entity.safety.SafetyStaffArchivesExcel; -import com.sipai.entity.safety.SafetyStaffArchivesVo; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.safety.StaffArchivesService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author LiTao - * @date 2022-09-19 17:29:16 - * @description: 人员档案管理 - */ -@Controller -@RequestMapping("/safety/staffArchives") -public class StaffArchivesController { - - @Resource - private StaffArchivesService staffArchivesService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/safety/staffArchivesList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("createTime")) { - sort = " ssa.create_time "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_code")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and u.pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and u.id in ('" + userIds + "') "; - } - } - - // 搜索框筛选 - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (u.caption like '%" + request.getParameter("search_name") + "%'" - + " or u.userCardId like '%" + request.getParameter("search_name") + "%') "; - } - - // 入职时间筛选 - String hiredate_param = request.getParameter("hiredate"); - if (StringUtils.isNotBlank(hiredate_param)) { - String[] split = hiredate_param.split("~"); - String hiredate_start_time = split[0].trim(); - String hiredate_end_time = split[1].trim(); - wherestr += " and ssa.hiredate >= '" + hiredate_start_time + "'" + - " and ssa.hiredate <= '" + hiredate_end_time + "'"; - } - //从事岗位 - String post_param = request.getParameter("post"); - if (StringUtils.isNotBlank(post_param)) { - wherestr += " and ssa.post = '" + post_param + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.staffArchivesService.selectListByCondition(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - return "/safety/staffArchivesAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute SafetyStaffArchives safetyStaffArchives) { - User cu = (User) request.getSession().getAttribute("cu"); - - //判断 人员档案是否存在 - SafetyStaffArchives ssa = this.staffArchivesService.selectById(safetyStaffArchives.getUserid()); - if (ssa != null) { - //result = this.staffArchivesService.update(safetyStaffArchives); - model.addAttribute("result", CommUtil.toJson(Result.failed("该人员档案已存在!"))); - return "result"; - } - - // 验证 身份证是否重复 - List list = this.staffArchivesService.verifyIdcardRepeat(safetyStaffArchives); - if(!CollectionUtils.isEmpty(list)){ - model.addAttribute("result", CommUtil.toJson(Result.failed("身份证号已存在!"))); - return "result"; - } - - this.staffArchivesService.save(safetyStaffArchives); - model.addAttribute("result", CommUtil.toJson(Result.success())); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - SafetyStaffArchivesVo vo = this.staffArchivesService.selectOneById(id); - model.addAttribute("safetyStaffArchives", vo); - return "/safety/staffArchivesEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute SafetyStaffArchives safetyStaffArchives) { - User cu = (User) request.getSession().getAttribute("cu"); - - // 验证 身份证是否重复 - List list = this.staffArchivesService.verifyIdcardRepeat(safetyStaffArchives); - if(!CollectionUtils.isEmpty(list)){ - model.addAttribute("result", CommUtil.toJson(Result.failed("身份证号已存在!"))); - return "result"; - } - - int result = this.staffArchivesService.update(safetyStaffArchives); - model.addAttribute("result", CommUtil.toJson(Result.success())); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - SafetyStaffArchivesVo vo = this.staffArchivesService.selectOneById(id); - model.addAttribute("safetyStaffArchives", vo); - return "/safety/staffArchivesdetails"; - } - - @RequestMapping("/detail.do") - @ResponseBody - public Result detail(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - SafetyStaffArchivesVo vo = this.staffArchivesService.selectOneById(id); - if (vo == null) { - vo = new SafetyStaffArchivesVo(); - } - return Result.success(vo); - } - - @RequestMapping("/del.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.staffArchivesService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dels.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.staffArchivesService.deleteByWhere("where userid in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 导入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelShow.do") - public String doimport(HttpServletRequest request, Model model) { - return "/safety/staffArchivesImport"; - } - - /** - * excel导入 - * - * @param file - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/importExcel.do") - @Transactional(rollbackFor = Exception.class) - public String importExcel(@RequestParam(value = "filelist", required = false) MultipartFile file, - HttpServletRequest request, - Model model) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - StringBuilder errMsg = new StringBuilder(); - AtomicInteger successCount = new AtomicInteger(); - AtomicInteger failCount = new AtomicInteger(); - Map statusMap = new HashMap(); - - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - - ExcelReader excelReader = EasyExcel.read(excelFile.getInputStream()).build(); - excelReader.readAll(); - excelReader.finish(); - List sheets = excelReader.excelExecutor().sheetList(); - excelReader.finish(); - for (ReadSheet sheet : sheets) { - String[] sheetInfo = sheet.getSheetName().split("_"); - EasyExcel.read(excelFile.getInputStream(), SafetyStaffArchivesExcel.class, new PageReadListener(dataList -> { - int success = 0; - int fail = 0; - for (SafetyStaffArchivesExcel excelEntity : dataList) { - User objUser = userService.getUserByUserCardId(excelEntity.getUserCardId()); - if (objUser == null) { - errMsg.append("工号" + excelEntity.getUserCardId() + "不存在!\n"); - fail++; - continue; - } - SafetyStaffArchives saveEntity = new SafetyStaffArchives(); - BeanUtils.copyProperties(excelEntity, saveEntity); - saveEntity.setUserid(objUser.getId()); - - // 验证 身份证是否重复 - List list = this.staffArchivesService.verifyIdcardRepeat(saveEntity); - if(!CollectionUtils.isEmpty(list)){ - errMsg.append("身份证号" + excelEntity.getIdcard() + "重复!\n"); - fail++; - continue; - } - - SafetyStaffArchives ssa = this.staffArchivesService.selectById(saveEntity.getUserid()); - if (ssa != null) { - success += this.staffArchivesService.update(saveEntity); - } else { - success += this.staffArchivesService.save(saveEntity); - } - } - successCount.set(success); - failCount.set(fail); - })).sheet(sheet.getSheetName()).doRead(); - } - - if (!errMsg.toString().isEmpty()) { - statusMap.put("status", false); - statusMap.put("msg", "导入成功" + successCount.intValue() + "条!" + "失败" + failCount.intValue() + "条,错误信息:" + errMsg.toString()); - model.addAttribute("result", JSONObject.fromObject(statusMap).toString()); - return "result"; - } else { - statusMap.put("status", true); - statusMap.put("msg", "导入成功" + successCount.intValue() + "条!"); - model.addAttribute("result", JSONObject.fromObject(statusMap).toString()); - return "result"; - } - } - - - /** - * excel导出 - * - * @param request - * @param response - * @throws IOException - */ - @RequestMapping("/exportExcel.do") - public void export(HttpServletRequest request, HttpServletResponse response, - @RequestParam(value = "hiredate", required = false) String hiredate, - @RequestParam(value = "post", required = false) String post) throws IOException { - // 摘自列表查询接口 start - User cu = (User) request.getSession().getAttribute("cu"); - String sort = " ssa.create_time "; - String order = " desc "; - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_code")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and u.pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and u.id in ('" + userIds + "') "; - } - } - - // 搜索框筛选 - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (u.caption like '%" + request.getParameter("search_name") + "%'" - + " or u.userCardId like '%" + request.getParameter("search_name") + "%') "; - } - - // 入职时间筛选 - if (StringUtils.isNotBlank(hiredate) && !"null".equals(hiredate)) { - String[] split = hiredate.split("~"); - String hiredate_start_time = split[0].trim(); - String hiredate_end_time = split[1].trim(); - wherestr += " and ssa.hiredate >= '" + hiredate_start_time + "'" + - " and ssa.hiredate <= '" + hiredate_end_time + "'"; - } - - //从事岗位 - if (StringUtils.isNotBlank(post) && !"null".equals(post)) { - wherestr += " and ssa.post = '" + post + "'"; - } - - List list = this.staffArchivesService.selectListByCondition(wherestr + orderstr); - List excelList = new ArrayList<>(); - SafetyStaffArchivesExcel excelEntity = null; - for (SafetyStaffArchivesVo vo : list) { - excelEntity = new SafetyStaffArchivesExcel(); - BeanUtils.copyProperties(vo, excelEntity); - excelList.add(excelEntity); - } - // 摘自列表查询接口 end - response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding("utf8"); - response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("内部员工档案", "UTF-8") + ".xlsx"); - - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), SafetyStaffArchivesExcel.class).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet("内部员工档案").build(); - excelWriter.write(excelList, writeSheet); - excelWriter.finish(); - } - } - - /** - * 从事岗位下拉 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/postPulldown.do") - public String postPulldown(HttpServletRequest request, Model model) { - List> list = this.staffArchivesService.postPulldown(); - model.addAttribute("result", JSON.toJSONString(list)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/schedule/ScheduleJobController.java b/src/com/sipai/controller/schedule/ScheduleJobController.java deleted file mode 100644 index b4dd7d35..00000000 --- a/src/com/sipai/controller/schedule/ScheduleJobController.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.sipai.controller.schedule; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.User; -import com.sipai.service.schedule.ScheduleJobService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/schedule/scheduleJob") -public class ScheduleJobController { - @Resource - private ScheduleJobService scheduleJobService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "schedule/scheduleJobList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order, - @RequestParam(value = "unitId") String unitId){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr = ""; - if(StringUtils.isNotBlank(unitId)) { - wherestr = "where unit_id = '"+unitId+"'"; - } else { - wherestr = "where 1=1 "; - } -// if(request.getParameter("modeltypeid")!=null && !request.getParameter("modeltypeid").equals("")){ -// wherestr = "where modeltypeid = '"+request.getParameter("modeltypeid")+"'"; -// } - PageHelper.startPage(page, rows); - List list = this.scheduleJobService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - - return "schedule/scheduleJobAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("ScheduleJob") ScheduleJob scheduleJob){ - User cu= (User)request.getSession().getAttribute("cu"); - scheduleJob.setId(CommUtil.getUUID()); - scheduleJob.setInsuser(cu.getId()); - scheduleJob.setInsdt(CommUtil.nowDate()); -// scheduleJob.setStatus(Integer.valueOf(scheduleJob.getStatus())); - int result = this.scheduleJobService.save(scheduleJob); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scheduleJob.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScheduleJob scheduleJob = this.scheduleJobService.selectById(id); - model.addAttribute("scheduleJob", scheduleJob); - return "schedule/scheduleJobEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ScheduleJob scheduleJob){ - User cu= (User)request.getSession().getAttribute("cu"); - scheduleJob.setUpsuser(cu.getId()); - scheduleJob.setUpsdt(CommUtil.nowDate()); -// scheduleJob.setStatus(Integer.valueOf(scheduleJob.getStatus())); - int result = this.scheduleJobService.update(scheduleJob); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scheduleJob.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.scheduleJobService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request,Model model){ - List list = this.scheduleJobService.selectListByWhere - ("where 1=1 "); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.scheduleJobDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 打开新增数据类型(产线) - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - String pid = request.getParameter("pid"); - String unitId = request.getParameter("unitId"); - String jobGroupId = request.getParameter("jobGroupId"); - if(jobGroupId!=null && !"".equals(jobGroupId)){ - ScheduleJobType scheduleJobType = this.scheduleJobTypeService.selectById(jobGroupId); - if(scheduleJobType!=null){ - request.setAttribute("scheduleJobTypeInterfaceUrl", scheduleJobType.getInterfaceurl()); - } - } - List scheduleJobDetails = this.scheduleJobDetailService.selectListByWhere("where pid = '"+pid+"'"); - String scheduleJobDetailsIds = ""; - if(scheduleJobDetails!=null && scheduleJobDetails.size()>0){ - for(int i=0;i list = this.scheduleJobTypeService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - - return "schedule/scheduleJobTypeAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("scheduleJobType") ScheduleJobType scheduleJobType){ - User cu= (User)request.getSession().getAttribute("cu"); - scheduleJobType.setId(CommUtil.getUUID()); - scheduleJobType.setInsuser(cu.getId()); - scheduleJobType.setInsdt(CommUtil.nowDate()); -// scheduleJob.setStatus(Integer.valueOf(scheduleJob.getStatus())); - int result = this.scheduleJobTypeService.save(scheduleJobType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scheduleJobType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScheduleJobType scheduleJobType = this.scheduleJobTypeService.selectById(id); - model.addAttribute("scheduleJobType", scheduleJobType); - return "schedule/scheduleJobTypeEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ScheduleJobType scheduleJobType){ - User cu= (User)request.getSession().getAttribute("cu"); - scheduleJobType.setUpsuser(cu.getId()); - scheduleJobType.setUpsdt(CommUtil.nowDate()); -// scheduleJob.setStatus(Integer.valueOf(scheduleJob.getStatus())); - int result = this.scheduleJobTypeService.update(scheduleJobType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scheduleJobType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.scheduleJobTypeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request,Model model){ - List list = this.scheduleJobTypeService.selectListByWhere - ("where 1=1 "); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.libraryMPointPropService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo<>(list); - JSONArray json=JSONArray.fromObject(list); - - String res = "{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - Result result = Result.success(res); - return result; - } - - @RequestMapping("/dodelete.do") - public Result dodelete(HttpServletRequest request, - @RequestParam(value="id") String id){ - int res = this.libraryMPointPropService.deleteById(id); - //删除关联测量点表的数据 - Listlist = this.libraryMPointPropSourceService.selectListByWhere("where pid = '"+id+"'"); - this.libraryMPointPropService.deletesMPointPropSource(list); - Result result = res>0?Result.success(res):Result.failed("删除失败"); - return result; - } - - @RequestMapping("/dodeletes.do") - public Result dodeletes(HttpServletRequest request, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.libraryMPointPropService.deleteByWhere("where id in ('"+ids+"')"); - Listlist = this.libraryMPointPropSourceService.selectListByWhere("where pid in ('"+ids+"')"); - this.libraryMPointPropService.deletesMPointPropSource(list); - Result result = res>0?Result.success(res):Result.failed("删除失败"); - return result; - } - - @RequestMapping("/dosave.do") - public Result dosave(HttpServletRequest request, - @ModelAttribute("libraryMPointProp") LibraryMPointProp libraryMPointProp){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu==null?"":cu.getId(); - if(libraryMPointProp.getId()==null || libraryMPointProp.getId().isEmpty()){ - Result result = Result.failed("未获取到id',保存失败"); - return result; - } - LibraryMPointProp last = this.libraryMPointPropService.selectById(libraryMPointProp.getId()); - if(last!=null){ - Result result = Result.failed("已有该id存在,请修改id后重试"); - return result; - } -// libraryMPointProp.setId(CommUtil.getUUID()); - libraryMPointProp.setInsuser(userId); - libraryMPointProp.setInsdt(CommUtil.nowDate()); - int res = this.libraryMPointPropService.save(libraryMPointProp); - Result result = res>0?Result.success(res):Result.failed("保存失败"); - return result; - } - - - @RequestMapping("/doedit.do") - public Result doedit(HttpServletRequest request){ - String id = request.getParameter("id"); - LibraryMPointProp libraryMPointProp = this.libraryMPointPropService.selectById(id); - Result result = libraryMPointProp!=null?Result.success(libraryMPointProp):Result.failed("获取失败"); - return result; - } - - @RequestMapping("/doupdate.do") - public Result doupdate(HttpServletRequest request, - @ModelAttribute("libraryMPointProp") LibraryMPointProp libraryMPointProp){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu==null?"":cu.getId(); - libraryMPointProp.setInsuser(userId); - libraryMPointProp.setInsdt(CommUtil.nowDate()); - int res = this.libraryMPointPropService.update(libraryMPointProp); - Result result = res>0?Result.success(res):Result.failed("更新失败"); - return result; - } - - @RequestMapping("/getPropSourceList.do") - public Result getPropSourceList(HttpServletRequest request, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where pid = '" + request.getParameter("pid") + "'"; -// if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and assetClassName like '%" + request.getParameter("search_name") + "%' "; -// } - PageHelper.startPage(page, rows); - List list = this.libraryMPointPropSourceService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String res = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - Result result = Result.success(res); - return result; - } - - @RequestMapping("/dodeletePropSource.do") - public Result doPropSourceDelete(HttpServletRequest request, - @RequestParam(value="id") String id){ - int res = this.libraryMPointPropSourceService.deleteById(id); - Result result = res>0?Result.success(res):Result.failed("删除失败"); - return result; - } - - @RequestMapping("/dodeletesPropSource.do") - public Result doPropSourceDeletes(HttpServletRequest request, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.libraryMPointPropSourceService.deleteByWhere("where id in ('"+ids+"')"); - Result result = res>0?Result.success(res):Result.failed("删除失败"); - return result; - } - - @RequestMapping("/dosavePropSource.do") - public Result dosavePropSource(HttpServletRequest request, - @ModelAttribute("libraryMPointPropSource") LibraryMPointPropSource libraryMPointPropSource){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu==null?"":cu.getId(); - libraryMPointPropSource.setId(CommUtil.getUUID()); - libraryMPointPropSource.setInsuser(userId); - libraryMPointPropSource.setInsdt(CommUtil.nowDate()); - int res = this.libraryMPointPropSourceService.save(libraryMPointPropSource); - Result result = res>0?Result.success(res):Result.failed("保存失败"); - return result; - } - - @RequestMapping("/doeditPropSource.do") - public Result doeditPropSource(HttpServletRequest request){ - String id = request.getParameter("id"); - LibraryMPointPropSource libraryMPointPropSource = this.libraryMPointPropSourceService.selectById(id); - Result result = libraryMPointPropSource!=null?Result.success(libraryMPointPropSource):Result.failed("获取失败"); - return result; - } - - @RequestMapping("/doupdatePropSource.do") - public Result doupdatePropSource(HttpServletRequest request, - @ModelAttribute("libraryMPointPropSource") LibraryMPointPropSource libraryMPointPropSource){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu==null?"":cu.getId(); - libraryMPointPropSource.setInsuser(userId); - libraryMPointPropSource.setInsdt(CommUtil.nowDate()); - int res = this.libraryMPointPropSourceService.update(libraryMPointPropSource); - Result result = res>0?Result.success(res):Result.failed("更新失败"); - return result; - } - - @RequestMapping("/getTree.do") - public Result getTree(HttpServletRequest request, - @RequestParam(value="type") String type, - @RequestParam(value="signaltag") String signaltag){ - String wherestr = " where [type] = '"+type+"' and signaltag = '"+signaltag+"'"; - List props = this.libraryMPointPropService.selectListByWhere(wherestr); - LibraryMPointProp prop = props.size()>0?props.get(0):null; - JSONObject res = this.libraryMPointPropService.getTree(prop,""); - Result result = Result.success(res); - return result; - } - - @RequestMapping("/createByLibrary.do") - public Result createByLibrary(HttpServletRequest request, - @RequestParam(value="type") String type, - @RequestParam(value="signaltag") String signaltag, - @RequestParam(value="unitId") String unitId){ - User cu= (User)request.getSession().getAttribute("cu"); - String userId = cu==null?CommString.ID_Admin:cu.getId(); - String wherestr = " where [type] = '"+type+"' and signaltag = '"+signaltag+"'"; - List props = this.libraryMPointPropService.selectListByWhere(wherestr); - LibraryMPointProp prop = props.size()>0?props.get(0):null; - LibraryMPoint libraryMPoint = this.libraryMPointPropService.getList(prop,null); - if(libraryMPoint == null){ - Result result = Result.failed("未获取到对应库数据"); - return result; - } - //1 prop - for(LibraryMPointProp lprop:libraryMPoint.getLibraryMPointProp()){ - String id = CommUtil.generateIdCode(lprop.getId(), unitId); - if(lprop.getEvaluationFormula()!=null && !lprop.getEvaluationFormula().isEmpty()) { - MPointProp mPointProp = new MPointProp(); - BeanUtils.copyProperties(lprop, mPointProp); - mPointProp.setId(id); - mPointProp.setInsdt(CommUtil.nowDate()); - mPointProp.setBizId(unitId); - mPointProp.setInsuser(userId); - MPointProp last = this.mPointPropService.selectById(unitId, id); - if (last != null) { - //update - int res = this.mPointPropService.update(unitId, mPointProp); - } else { - //insert - int res = this.mPointPropService.save(unitId, mPointProp); - } - List lastSource = this.mPointPropSourceService - .selectListByWhere(unitId, " where pid = '" + id + "'"); - if (lastSource.size() > 0) { - for (MPointPropSource s : lastSource) { - this.mPointPropSourceService.deleteById(unitId, s.getId()); - } - } - } - // todo 匹配或生成点 - MPoint mPoint = this.mPointService.selectById(id); - if (mPoint == null && !id.isEmpty()) { - // 没有就生成 - mPoint = new MPoint(); - mPoint.setId(id); - mPoint.setMpointid(id); - mPoint.setMpointcode(id); - mPoint.setParmname(lprop.getName()); - mPoint.setBizid(unitId); - mPoint.setDisname(lprop.getName()); - mPoint.setSourceType(MPoint.Flag_Type_KPI); - mPoint.setActive(CommString.Flag_Active); - mPoint.setSignaltag(lprop.getSignaltag()); - mPoint.setFreq(Integer.valueOf(prop.getCalfreq())); - mPoint.setFrequnit(prop.getCalrange()); - mPoint.setSourceType("AI"); - mPoint.setRate(BigDecimal.ONE); -// mPoint.setUnit(); - this.mPointService.save(unitId,mPoint); - } - } - - //2 propsource - for(LibraryMPointPropSource source:libraryMPoint.getLibraryMPointPropSource()){ - MPointPropSource mPointPropSource = new MPointPropSource(); - BeanUtils.copyProperties(source,mPointPropSource); - String mpid = CommUtil.generateIdCode(source.getMpid(),unitId); - String pid = CommUtil.generateIdCode(source.getPid(),unitId); - mPointPropSource.setId(CommUtil.getUUID()); - mPointPropSource.setPid(pid); - mPointPropSource.setMpid(mpid); - mPointPropSource.setInsdt(CommUtil.nowDate()); - mPointPropSource.setInsuser(userId); - int res = this.mPointPropSourceService.save(unitId,mPointPropSource); - // todo 匹配或生成点 - MPoint mPoint = this.mPointService.selectById(mpid); - if(mPoint == null){ - // 没有就生成 - - } - } - Result result = Result.success(1); - return result; - } -} diff --git a/src/com/sipai/controller/sparepart/ApplyPurchasePlanController.java b/src/com/sipai/controller/sparepart/ApplyPurchasePlanController.java deleted file mode 100644 index 3d016b23..00000000 --- a/src/com/sipai/controller/sparepart/ApplyPurchasePlanController.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.ApplyPurchasePlan; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ApplyPurchasePlanService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/applyPurchasePlan") -public class ApplyPurchasePlanController { - @Resource - private ApplyPurchasePlanService applyPurchasePlanService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/applyPurchasePlanList"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("startdt")!= null && !request.getParameter("startdt").isEmpty()) { - wherestr += " and insdt >= '"+request.getParameter("startdt")+"'"; - } - if (request.getParameter("enddt")!= null && !request.getParameter("enddt").isEmpty()) { - wherestr += " and insdt <= '"+request.getParameter("enddt")+"'"; - } - if (request.getParameter("dept_id")!= null && !request.getParameter("dept_id").isEmpty()) { - wherestr += " and department_id like '%"+request.getParameter("dept_id")+"%'"; - } - - PageHelper.startPage(page, rows); - List list = this.applyPurchasePlanService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "sparepart/applyPurchasePlan4select"; - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model){ - return "/sparepart/applyPurchasePlanAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ApplyPurchasePlan applyPurchasePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - applyPurchasePlan.setId(CommUtil.getUUID()); - applyPurchasePlan.setInsdt(CommUtil.nowDate()); - applyPurchasePlan.setInsuser(cu.getId()); - int result = this.applyPurchasePlanService.save(applyPurchasePlan); - if(result==1){ - this.applyPurchasePlanService.changeStatus(applyPurchasePlan); - } - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.applyPurchasePlanService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.applyPurchasePlanService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ApplyPurchasePlan applyPurchasePlan = this.applyPurchasePlanService.selectById(id); - model.addAttribute("applyPurchasePlan", applyPurchasePlan); - return "/sparepart/applyPurchasePlanEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ApplyPurchasePlan applyPurchasePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - applyPurchasePlan.setInsdt(CommUtil.nowDate()); - applyPurchasePlan.setInsuser(cu.getId()); - int result = this.applyPurchasePlanService.update(applyPurchasePlan); - if(result==1){ - this.applyPurchasePlanService.changeStatus(applyPurchasePlan); - } - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ApplyPurchasePlan applyPurchasePlan = this.applyPurchasePlanService.selectById(id); - model.addAttribute("applyPurchasePlan", applyPurchasePlan); - return "/sparepart/applyPurchasePlanView"; - } -} diff --git a/src/com/sipai/controller/sparepart/ChannelsController.java b/src/com/sipai/controller/sparepart/ChannelsController.java deleted file mode 100644 index 7c387226..00000000 --- a/src/com/sipai/controller/sparepart/ChannelsController.java +++ /dev/null @@ -1,428 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ChannelsService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Controller -@RequestMapping("/sparepart/channels") -public class ChannelsController { - @Resource - private ChannelsService channelsService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/channelsList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " source "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - String pid = request.getParameter("pid").replace(",","','"); - wherestr += " and pid in ('"+pid+"') "; - } - PageHelper.startPage(page, rows); - List list = this.channelsService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getChannelsJson.do") - public String getChannelsJson(HttpServletRequest request,Model model){ - String wherestr = ""; - String search_name=request.getParameter("search_name"); - if(search_name!= null && !search_name.equals("")){ - wherestr = " and name like '%"+search_name+"%' "; - } - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - String pid = request.getParameter("pid").replace(",","','"); - wherestr += " and ( id in ('"+pid+"')) "; - } - List list = this.channelsService.selectListByWhere("where 1=1 "+wherestr+" order by source,morder"); - //用于子项工程选择的树形显示,pid为已选择一级列资渠道id集合 - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - List list_all = this.channelsService.selectListByWhere(" order by source,morder"); - List list_children = new ArrayList(); - String[] pids = request.getParameter("pid").split(","); - for(String pid:pids){ - List list_result = this.channelsService.getChildren(pid,list_all); - list_children.addAll(list_result); - } - //子节点数据加入list - list.addAll(list_children); - } - String json = this.channelsService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "sparepart/channels4select"; - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - Channels channels= this.channelsService.selectById(pid); - model.addAttribute("pname",channels.getName()); - } - return "/sparepart/channelsAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Channels channels) { - User cu = (User) request.getSession().getAttribute("cu"); - channels.setId(CommUtil.getUUID()); - channels.setInsdt(CommUtil.nowDate()); - channels.setInsuser(cu.getId()); - channels.setSource(0);//自建数据 - int result = this.channelsService.save(channels); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+channels.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.channelsService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.channelsService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Channels channels = this.channelsService.selectById(id); - model.addAttribute("channels", channels); - return "/sparepart/channelsEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Channels channels) { - User cu = (User) request.getSession().getAttribute("cu"); - channels.setInsdt(CommUtil.nowDate()); - channels.setInsuser(cu.getId()); - channels.setSource(0);//自建数据 - int result = this.channelsService.update(channels); - String resstr="{\"res\":\""+result+"\",\"id\":\""+channels.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Channels channels = this.channelsService.selectById(id); - model.addAttribute("channels", channels); - return "/sparepart/channelsView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getChannels4Select.do") - public String getChannels4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String wherestr = ""; - String pid =request.getParameter("pid"); - if(pid!= null && !pid.equals("") ){ - wherestr = " and pid = '"+pid+"' "; - } - JSONArray json=new JSONArray(); - List list = this.channelsService.selectListByWhere("where 1=1"+wherestr+" order by source,morder"); - if(list!=null && list.size()>0){ - for (Channels channels : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", channels.getId()); - jsonObject.put("text", channels.getName()); - jsonObject.put("source", channels.getSource()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 选择列资渠道 - */ - @RequestMapping("/selectChannelsForSubscribeDetail.do") - public String selectChannelsForSubscribeDetail (HttpServletRequest request,Model model) { - String channelsid = request.getParameter("channelsid"); - request.setAttribute("channelsid", channelsid); - return "/sparepart/channels4SubscribeDetailSelects"; - } - - @RequestMapping("/downloadPost.do") - public ModelAndView downloadPlaceEquipmentExcel(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String fileName = "列资渠道表"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "列资渠道表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - String[] excelTitle ={"编号","列资渠道","上级菜单编号","上级菜单","顺序","数据来源","描述"}; - Font font = workbook.createFont(); - font.setBold(true); - - font.setFontHeightInPoints((short) 15); - font.setFontName("宋体"); - CellStyle cellStyle = workbook.createCellStyle(); - cellStyle.setFont(font); - HSSFRow row = sheet.createRow(0); - for (int i = 0; i < excelTitle.length; i++) { - sheet.setColumnWidth(i,20*256); - HSSFCell cell = row.createCell(i); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - cell.setCellStyle(cellStyle); - } - int rowIndex = 1; - List list = this.channelsService.selectListByWhere("where 1=1 "); - for (Channels channels : list) { - int columnIndex = 0; - row = sheet.createRow(rowIndex++); - row.createCell(columnIndex++).setCellValue(channels.getId()); - if(channels.getName()!=null){ - row.createCell(columnIndex++).setCellValue(channels.getName()); - }else{ - row.createCell(columnIndex++).setCellValue(""); - } - if(channels.getPid()!=null){ - row.createCell(columnIndex++).setCellValue(channels.getPid()); - }else{ - row.createCell(columnIndex++).setCellValue(""); - } - if(!"-1".equals(channels.getPid())&&channels.getPid()!=null){ - row.createCell(columnIndex++).setCellValue(this.channelsService.selectById(channels.getPid()).getName()); - }else{ - row.createCell(columnIndex++).setCellValue(""); - } - if(channels.getMorder()!=null){ - row.createCell(columnIndex++).setCellValue(channels.getMorder()); - }else{ - row.createCell(columnIndex++).setCellValue(""); - } - if(channels.getSource()!=null&&channels.getSource()==1){ - row.createCell(columnIndex++).setCellValue("外建"); - }else{ - row.createCell(columnIndex++).setCellValue("自建"); - } - row.createCell(columnIndex++).setCellValue(channels.getDescribe()); - } - try { - //response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - - } finally{ - workbook.close(); - } - return null; - } - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * @param request - * @param model - * @return - */ @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type)){ - HSSFWorkbook workbook = new HSSFWorkbook(excelFile.getInputStream()); - //int insertNum = 0; - int updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - System.out.println(numSheet); - System.out.println(workbook.getNumberOfSheets()); - HSSFSheet sheet = workbook.getSheetAt(numSheet); - - - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - String idNumber =""; - //id - HSSFCell id = row.getCell(0); - if(null!=id && !"".equals(id)){ - idNumber= getStringVal(id); - Channels channel = this.channelsService.selectById(idNumber); - if(channel!=null){ - - HSSFCell namecell = row.getCell(1); - if(null!=namecell && !"".equals(namecell)){ - channel.setName(getStringVal(namecell)); - } - HSSFCell pidcell = row.getCell(2); - if(null!=pidcell && !"".equals(pidcell)){ - channel.setPid(getStringVal(pidcell)); - } - String mordercell = getStringVal(row.getCell(4)); - if(null!=mordercell && !"".equals(mordercell)){ - channel.setMorder(Integer.valueOf(mordercell)); - } - HSSFCell describecell = row.getCell(6); - if(null!=describecell && !"".equals(describecell)){ - channel.setDescribe(getStringVal(describecell)); - } - this.channelsService.update(channel); - updateNum++; - } - }else{ - - continue; - } - - - }//row - }//sheet - String result = ""; - result +="更新成功数据"+updateNum+"条;"; - statusMap.put("status", true); - statusMap.put("msg", result); - workbook.close(); - String result1 =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result1); - return new ModelAndView("result"); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用.xls表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/importChannelsCard.do") - public String doimport(HttpServletRequest request,Model model){ - return "sparepart/placeChannelsImport"; - } - - private String getStringVal(HSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - }else{ - return null; - } - } - -} diff --git a/src/com/sipai/controller/sparepart/ConsumeDetailController.java b/src/com/sipai/controller/sparepart/ConsumeDetailController.java deleted file mode 100644 index 2fce7992..00000000 --- a/src/com/sipai/controller/sparepart/ConsumeDetailController.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.apache.ibatis.scripting.xmltags.WhereSqlNode; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.sparepart.ConsumeDetail; - - -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderConsume; -import com.sipai.service.sparepart.ConsumeDetailService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.OutStockRecordDetailService; -import com.sipai.service.workorder.WorkorderConsumeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/consumeDetail") -public class ConsumeDetailController { - @Resource - private ConsumeDetailService consumeDetailService; - @Resource - private GoodsService goodsService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private WorkorderConsumeService workorderConsumeService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/consumeDetailList"; - } - - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = "s.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " s.id is not null ";//mapper的selectListByWhere方法有了where 这里不需要加where - if (request.getParameter("companyId")!= null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - - PageHelper.startPage(page, rows); - List list = this.consumeDetailService.selectListByWhere(wherestr+orderstr); - - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/getOutConsumeDetailList.do") - public ModelAndView getOutConsumeDetailList(HttpServletRequest request,Model model) - { - User cu = (User) request.getSession().getAttribute("cu"); -// String user_id = request.getParameter("user_id"); - - String wherestr = " where a.user_id = '"+cu.getId()+"' "; - List list = this.consumeDetailService.ConsumeTotal(wherestr); - for (ConsumeDetail consumeDetail : list) { - if(consumeDetail!=null&&consumeDetail.getGoodsId()!=null){ - Goods goods = this.goodsService.selectById(consumeDetail.getGoodsId()); - consumeDetail.setGoods(goods); - List list1 = this.workorderConsumeService.selectListByWhere(" where insuser = '"+cu.getId()+"' and goods_id ='"+consumeDetail.getGoodsId()+"' and price = '"+consumeDetail.get_price()+"' "); - if(list1!=null){ - BigDecimal consumeNumber = new BigDecimal(0); - for (WorkorderConsume WorkorderConsume2 : list1) { - if(WorkorderConsume2.getNumber()!=null){ - consumeNumber = consumeNumber.add(new BigDecimal(WorkorderConsume2.getNumber())); - } - } - consumeDetail.setConsumeNumber(consumeNumber); - }else{ - consumeDetail.setConsumeNumber(new BigDecimal(0)); - } - BigDecimal allnumber = new BigDecimal(consumeDetail.get_allnumber()); - consumeDetail.set_nownumber(allnumber.subtract(consumeDetail.getConsumeNumber())); - - }} - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = ""+jsonArray; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ConsumeDetail consumeDetail = this.consumeDetailService.selectById(id); - model.addAttribute("consumeDetail", consumeDetail); - return "/sparepart/consumeDetailView"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, -// @RequestParam(value = "userId") String userId, - @RequestParam(value = "goodsId") String goodsId, - @RequestParam(value = "goodsNumber") String goodsNumber, - @RequestParam(value = "worksheetId") String worksheetId) { - User cu = (User) request.getSession().getAttribute("cu"); - String wherestr1 = " where a.user_id = '"+cu.getId()+"' and goods_id = '"+goodsId+"' "; - List list1 = this.consumeDetailService.ConsumeTotal(wherestr1); - String res= ""; - if(list1!=null&& Double.valueOf(list1.get(0).get_allnumber()) list = this.consumeDetailService.selectListByWhere(wherestr); - if(list!=null&&list.size()>0){ - ConsumeDetail consumeDetail = list.get(0); - if("0".equals(goodsNumber)||goodsNumber==null){ - this.consumeDetailService.deleteById(consumeDetail.getId()); - res = "已删除"; - }else{ - consumeDetail.setConsumeNumber(new BigDecimal(goodsNumber)); - this.consumeDetailService.update(consumeDetail); - res = "更新成功";} - }else { - ConsumeDetail consumeDetail = new ConsumeDetail(); - consumeDetail.setId(CommUtil.getUUID()); - consumeDetail.setInsdt(CommUtil.nowDate()); - consumeDetail.setInsuser(cu.getId()); - consumeDetail.setGoodsId(goodsId); - consumeDetail.setConsumeNumber(new BigDecimal(goodsNumber)); - consumeDetail.setWorkOrderId(worksheetId); - int result = this.consumeDetailService.save(consumeDetail); - res = "保存成功"; - } - } - String resultstr = "{\"res\":\""+res+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/deletebyWorksheetId.do") - public String deletebyWorksheetId(HttpServletRequest request,Model model, - @RequestParam(value = "worksheetId") String worksheetId) { - - int result = this.consumeDetailService.deleteByWhere("where work_order_id = '"+worksheetId+"'"); - model.addAttribute("result",result); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/ContractClassController.java b/src/com/sipai/controller/sparepart/ContractClassController.java deleted file mode 100644 index 689ced85..00000000 --- a/src/com/sipai/controller/sparepart/ContractClassController.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ContractClassService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/contractClass") -public class ContractClassController { - @Resource - private ContractClassService contractClassService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/contractClassList"; - } - - @RequestMapping("/getContractClassJson.do") - public String getContractClassJson(HttpServletRequest request,Model model){ - List list = this.contractClassService.selectListByWhere("where 1=1 order by morder"); - String json = this.contractClassService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.contractClassService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "sparepart/contractClass4select"; - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - ContractClass contractClass= this.contractClassService.selectById(pid); - model.addAttribute("pname",contractClass.getName()); - } - return "/sparepart/contractClassAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ContractClass contractClass) { - User cu = (User) request.getSession().getAttribute("cu"); - contractClass.setId(CommUtil.getUUID()); - contractClass.setInsdt(CommUtil.nowDate()); - contractClass.setInsuser(cu.getId()); - int result = this.contractClassService.save(contractClass); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.contractClassService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.contractClassService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractClass contractClass = this.contractClassService.selectById(id); - model.addAttribute("contractClass", contractClass); - return "/sparepart/contractClassEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ContractClass contractClass) { - User cu = (User) request.getSession().getAttribute("cu"); - contractClass.setInsdt(CommUtil.nowDate()); - contractClass.setInsuser(cu.getId()); - int result = this.contractClassService.update(contractClass); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ContractClass contractClass = this.contractClassService.selectById(id); - model.addAttribute("contractClass", contractClass); - return "/sparepart/contractClassView"; - } - /** - * 获取合同类型 - * */ - @RequestMapping("/getContractClass4Select.do") - public String getContractClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); -/* JSONArray json=new JSONArray(); - List list = this.contractClassService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (ContractClass contractClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", contractClass.getId()); - jsonObject.put("text", contractClass.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString());*/ - List list = this.contractClassService.selectListByWhere("where 1=1 order by morder"); - String json = this.contractClassService.getTreeList4select(null, list); - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/ContractController.java b/src/com/sipai/controller/sparepart/ContractController.java deleted file mode 100644 index 478e5423..00000000 --- a/src/com/sipai/controller/sparepart/ContractController.java +++ /dev/null @@ -1,1236 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitHandleDetail; -import com.sipai.entity.business.BusinessUnitInquiry; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.SpecialEquipment; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.ContractDetail; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitDeptApplyService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.business.BusinessUnitInquiryService; -import com.sipai.service.sparepart.ChannelsService; -import com.sipai.service.sparepart.ContractClassService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.PurchaseDetailService; -import com.sipai.service.sparepart.PurchasePlanService; -import com.sipai.service.sparepart.PurchaseRecordDetailService; -import com.sipai.service.sparepart.ContractDetailService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -@Controller -@RequestMapping("/sparepart/contract") -public class ContractController { - @Resource - private ContractService contractService; - @Resource - private ContractClassService contractClassService; - @Resource - private ChannelsService channelsService; - @Resource - private GoodsService goodsService; - @Resource - private PurchasePlanService purchasePlanService; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private BusinessUnitInquiryService businessUnitInquiryService; - @Resource - private BusinessUnitDeptApplyService businessUnitDeptApplyService; - @Resource - private ContractDetailService contractDetailService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - - /** - * 合同提醒 - */ - @RequestMapping("/remind.do") - public String remind(HttpServletRequest request, Model model) { - return "/sparepart/contractRemind"; - } - /** - * 合同界面 - */ - @RequestMapping("/summary.do") - public String summary(HttpServletRequest request, Model model) { - //当前时间 - String contractstartdate = CommUtil.nowDate().substring(0, 7); - model.addAttribute("contractstartdate",contractstartdate); - return "/sparepart/contractSummary"; - } - /** - * 合同界面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/contractList"; - } - /** - * 财务合同界面 - */ - @RequestMapping("/showPaymentAndInvoiceList.do") - public String showPaymentAndInvoiceList(HttpServletRequest request, Model model) { - return "/sparepart/contractPaymentAndInvoiceList"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - String status = request.getParameter("status"); - status = status.replace(",","','"); - wherestr += " and status in ('"+status+"') "; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("contractstatus")!= null && !request.getParameter("contractstatus").isEmpty()) { - String contractstatus = request.getParameter("contractstatus"); - if("1".equals(contractstatus)){ - wherestr += " and status = '"+SparePartCommString.STATUS_CONTRACT_FINISH+"' "; - }else if("0".equals(contractstatus)){ - wherestr += " and status != '"+SparePartCommString.STATUS_CONTRACT_FINISH+"' "; - } - - } - - if (request.getParameter("supplierid")!= null && !request.getParameter("supplierid").isEmpty()) { - wherestr += " and supplierid = '"+request.getParameter("supplierid")+"'"; - } - - if (request.getParameter("deptId")!= null && !request.getParameter("deptId").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("deptId")+"'"; - } - if (request.getParameter("agentid")!= null && !request.getParameter("agentid").isEmpty()) { - wherestr += " and agentId = '"+request.getParameter("agentid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (id like '%"+request.getParameter("search_name")+"%' " - + "or contractname like '%"+request.getParameter("search_name")+"%') "; - } - if (request.getParameter("classid")!= null && !request.getParameter("classid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("classid")+"'"; - } - if (request.getParameter("contractclassid")!= null && !request.getParameter("contractclassid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("contractclassid")+"'"; - } - if (request.getParameter("contractstartdate")!= null && !request.getParameter("contractstartdate").isEmpty()) { - String contractStartDate = request.getParameter("contractstartdate"); - wherestr += " and year(contractstartdate) ="+contractStartDate.substring(0, 4)+" and month(contractstartdate) ="+contractStartDate.substring(5, 7)+" "; - } - String edt = request.getParameter("edt"); - String sdt = request.getParameter("sdt"); - if(null!=sdt && !"".equals(sdt)){ - wherestr+=" and contractstartdate >="+"'"+sdt+"'"; - } - if(null!=edt &&!"".equals(edt)) { - wherestr+=" and contractstartdate <="+"'"+edt+"'"; - } - PageHelper.startPage(page, rows); - List list = this.contractService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getFinanceList.do") - public ModelAndView getFinanceList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - - wherestr += " and status = '"+SparePartCommString.STATUS_CONTRACT_EXECUTE+"' "; - - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("deptId")!= null && !request.getParameter("deptId").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("deptId")+"'"; - } - if (request.getParameter("agentid")!= null && !request.getParameter("agentid").isEmpty()) { - wherestr += " and agentId = '"+request.getParameter("agentid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (id like '%"+request.getParameter("search_name")+"%' " - + "or contractname like '%"+request.getParameter("search_name")+"%') "; - } - if (request.getParameter("classid")!= null && !request.getParameter("classid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("classid")+"'"; - } - if (request.getParameter("contractclassid")!= null && !request.getParameter("contractclassid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("contractclassid")+"'"; - } - if (request.getParameter("contractstartdate")!= null && !request.getParameter("contractstartdate").isEmpty()) { - String contractStartDate = request.getParameter("contractstartdate"); - wherestr += " and year(contractstartdate) ="+contractStartDate.substring(0, 4)+" and month(contractstartdate) ="+contractStartDate.substring(5, 7)+" "; - } - PageHelper.startPage(page, rows); - List list1 = this.contractService.selectListByWhere(wherestr+orderstr); - List list =new ArrayList<>(); - for (Contract contract : list1) { - if(contract.getPaymentList()!=null&&contract.getPaymentList().size()>0){ - list.add(contract); - } - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 按照类型、列资渠道汇总合同信息 - */ - @RequestMapping("/getSummary.do") - public ModelAndView getSummary(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by insdt desc"; - - //列资渠道 - String wherestr = ""; - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - String status = request.getParameter("status"); - status = status.replace(",","','"); - wherestr += " and status in ('"+status+"') "; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - String edt = request.getParameter("edt"); - String sdt = request.getParameter("sdt"); - if(null!=sdt && !"".equals(sdt)){ - wherestr+=" and contractstartdate >="+"'"+sdt+"'"; - } - if(null!=edt &&!"".equals(edt)) { - wherestr+=" and contractstartdate <="+"'"+edt+"'"; - } - if (request.getParameter("contractstatus")!= null && !request.getParameter("contractstatus").isEmpty()) { - String contractstatus = request.getParameter("contractstatus"); - if("1".equals(contractstatus)){ - wherestr += " and status = '"+SparePartCommString.STATUS_CONTRACT_FINISH+"' "; - }else if("0".equals(contractstatus)){ - wherestr += " and status != '"+SparePartCommString.STATUS_CONTRACT_FINISH+"' "; - } - - } - - if (request.getParameter("supplierid")!= null && !request.getParameter("supplierid").isEmpty()) { - wherestr += " and supplierid = '"+request.getParameter("supplierid")+"'"; - } - - if (request.getParameter("deptId")!= null && !request.getParameter("deptId").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("deptId")+"'"; - } - if (request.getParameter("agentid")!= null && !request.getParameter("agentid").isEmpty()) { - wherestr += " and agentId = '"+request.getParameter("agentid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (id like '%"+request.getParameter("search_name")+"%' " - + "or contractname like '%"+request.getParameter("search_name")+"%') "; - } - if (request.getParameter("classid")!= null && !request.getParameter("classid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("classid")+"'"; - } - if (request.getParameter("contractclassid")!= null && !request.getParameter("contractclassid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("contractclassid")+"'"; - } - if (request.getParameter("contractstartdate")!= null && !request.getParameter("contractstartdate").isEmpty()) { - String contractStartDate = request.getParameter("contractstartdate"); - wherestr += " and year(contractstartdate) ="+contractStartDate.substring(0, 4)+" and month(contractstartdate) ="+contractStartDate.substring(5, 7)+" "; - } - List contractClassList = contractClassService.selectList4ContractByWhere(orderstr,wherestr); - JSONArray jsonArray = JSONArray.fromObject(contractClassList); - List channelsList = channelsService.selectList4ContractByWhere(orderstr,wherestr); - JSONArray jsonArrayChannels = JSONArray.fromObject(channelsList); - String result = "{\"contractClass\":"+jsonArray+",\"channels\":"+jsonArrayChannels+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 按照类型、列资渠道汇总合同信息 - */ - @RequestMapping("/getprice.do") - public ModelAndView getprice(HttpServletRequest request,Model model) { - String id = request.getParameter("id"); - String edt = request.getParameter("edt"); - String sdt = request.getParameter("sdt"); - String orderstr = " order by contract.insdt desc"; - //String wherestr = "where a.goods_id ='"+id+"' "; - StringBuilder wherestr = new StringBuilder("where a.goods_id ='"+id+"' "); - if(null!=sdt && !"".equals(sdt)){ - wherestr.append(" and contract.contractStartDate >="+"'"+sdt+"'"); - } - if(null!=edt &&!"".equals(edt)) { - wherestr.append(" and contract.contractStartDate <="+"'"+edt+"'"); - } - List list1 = this.contractService.selectPriceByWhere(wherestr+orderstr); - ArrayList wscll= new ArrayList<>(); - for (Contract contract : list1) { - ArrayList list= new ArrayList<>(); - list.add(contract.getSupplierName()); - list.add(contract.getRemark()); - wscll.add(list); - } - JSONArray jsonArray = JSONArray.fromObject(wscll); - String result = "{\"contract\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 按照类型、列资渠道汇总合同信息 - */ - @RequestMapping("/getSummaryList.do") - public ModelAndView getSummaryList(HttpServletRequest request,Model model, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("contractclassid")!= null && !request.getParameter("contractclassid").isEmpty()) { - wherestr += " and contractClassId = '"+request.getParameter("contractclassid")+"'"; - } - if (request.getParameter("channelsid")!= null && !request.getParameter("channelsid").isEmpty()) { - wherestr += " and channelsId = '"+request.getParameter("channelsid")+"'"; - } - if (request.getParameter("contractstartdate")!= null && !request.getParameter("contractstartdate").isEmpty()) { - String contractStartDate = request.getParameter("contractstartdate"); - wherestr += " and year(contractstartdate) ="+contractStartDate.substring(0, 4)+" and month(contractstartdate) ="+contractStartDate.substring(5, 7)+" "; - } - if (request.getParameter("agentid")!= null && !request.getParameter("agentid").isEmpty()) { - wherestr += " and agentId = '"+request.getParameter("agentid")+"'"; - } - if (request.getParameter("contractstatus")!= null && !request.getParameter("contractstatus").isEmpty()) { - String contractstatus = request.getParameter("contractstatus"); - if("1".equals(contractstatus)){ - wherestr += " and status = '"+SparePartCommString.STATUS_CONTRACT_FINISH+"' "; - }else if("0".equals(contractstatus)){ - wherestr += " and status != '"+SparePartCommString.STATUS_CONTRACT_FINISH+"' "; - } - - } - - if (request.getParameter("supplierid")!= null && !request.getParameter("supplierid").isEmpty()) { - wherestr += " and supplierid = '"+request.getParameter("supplierid")+"'"; - } - String edt = request.getParameter("edt"); - String sdt = request.getParameter("sdt"); - if(null!=sdt && !"".equals(sdt)){ - wherestr+=" and contractstartdate >="+"'"+sdt+"'"; - } - if(null!=edt &&!"".equals(edt)) { - wherestr+=" and contractstartdate <="+"'"+edt+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - //模糊搜索经办人 - List userlist = this.userService.selectListByWhere("where name like '%"+request.getParameter("search_name")+"%' or caption like '%"+request.getParameter("search_name")+"%'"); - String userStr = ""; - if(userlist!=null && userlist.size()>0){ - String userID = ""; - for(int a=0;a list = this.contractService.selectListByWhere4SUM(wherestr+orderstr); - JSONArray jsonArray = JSONArray.fromObject(list); - model.addAttribute("result",jsonArray); - return new ModelAndView("result"); - } - //2020-07-13 start - /** - * 选择状态 - */ - @RequestMapping("/getContractCheckForSelect.do") - public String getContractCheckForSelect(HttpServletRequest request,Model model){ - JSONArray jsonArray=new JSONArray(); - for(String[] contractCheckType :SparePartCommString.ContractCheckStatusArr){ - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", contractCheckType[0]+","+contractCheckType[1]); - jsonObject.put("text", contractCheckType[1]); - jsonArray.add(jsonObject); - } - List list = this.contractService.selectStatusByWhere(" where PATINDEX('%[^0-9]%', status)!=0 order by status "); - for (Contract item : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", item.getStatus()); - jsonObject.put("text", item.getStatus()); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - //2020-07-13 end - /** - * 新增合同界面 - */ - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-BMHT-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("agentId",cu.getId()); - model.addAttribute("agentName",cu.getCaption()); - model.addAttribute("company",company); - return "/sparepart/contractAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Contract contract = this.contractService.selectById(id); - model.addAttribute("contract", contract); - return "/sparepart/contractEdit"; - } - - @RequestMapping("/editFinance.do") - public String doFinanceedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Contract contract = this.contractService.selectById(id); - model.addAttribute("contract", contract); - return "/sparepart/contractToFinanceEdit"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Contract contract) { - User cu = (User) request.getSession().getAttribute("cu"); - contract.setInsdt(CommUtil.nowDate()); - contract.setInsuser(cu.getId()); - contract.setHelpersLog(""); - if(contract.getContractenddate()==null || contract.getContractenddate().equals("")){ - contract.setContractenddate(null); - } - if(contract.getContractstartdate()==null || contract.getContractstartdate().equals("")){ - contract.setContractstartdate(null); - } - if(contract.getSupplyplanenddate()==null || contract.getSupplyplanenddate().equals("")){ - contract.setSupplyplanenddate(null); - } - if(contract.getSupplyplanstartdate()==null || contract.getSupplyplanstartdate().equals("")){ - contract.setSupplyplanstartdate(null); - } - if(contract.getSupplyactualenddate()==null || contract.getSupplyactualenddate().equals("")){ - contract.setSupplyactualenddate(null); - } - if(contract.getSupplyactualstartdate()==null || contract.getSupplyactualstartdate().equals("")){ - contract.setSupplyactualstartdate(null); - } - int result = this.contractService.save(contract); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+contract.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.contractService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.contractService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Contract contract) { - User cu = (User) request.getSession().getAttribute("cu"); - contract.setInsuser(cu.getId()); - //协助人流转记录初始置空 - contract.setHelpersLog(""); - if(contract.getContractenddate()==null || contract.getContractenddate().equals("")){ - contract.setContractenddate(null); - } - if(contract.getContractstartdate()==null || contract.getContractstartdate().equals("")){ - contract.setContractstartdate(null); - } - if(contract.getSupplyplanenddate()==null || contract.getSupplyplanenddate().equals("")){ - contract.setSupplyplanenddate(null); - } - if(contract.getSupplyplanstartdate()==null || contract.getSupplyplanstartdate().equals("")){ - contract.setSupplyplanstartdate(null); - } - if(contract.getSupplyactualenddate()==null || contract.getSupplyactualenddate().equals("")){ - contract.setSupplyactualenddate(null); - } - if(contract.getSupplyactualstartdate()==null || contract.getSupplyactualstartdate().equals("")){ - contract.setSupplyactualstartdate(null); - } - int result = this.contractService.update(contract); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contract.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Contract contract = this.contractService.selectById(id); - model.addAttribute("contract", contract); - return "/sparepart/contractView"; - } - /** - * 新增申购明细,选择物品信息界面,goodsIds显示已选择的物品 - */ - @RequestMapping("/selectGoodsForContractDetail.do") - public String doaddContractDetail (HttpServletRequest request,Model model) { - String goodsIds = request.getParameter("goodsIds"); - if(goodsIds!=null && !goodsIds.isEmpty()){ - String[] id_Array= goodsIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("goodsIds", jsonArray); - } - return "/sparepart/goods4ContractSelects"; - } - /** - * 保存合同明细,申购新增页面选择物品后保存物品明细 - */ - @RequestMapping("/updateContractDetails.do") - public String doupdateContractDetails(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String contractId = request.getParameter("contractId"); - String deptId = request.getParameter("deptId"); - String goodsIds = request.getParameter("goodsIds"); - String[] idArrary = goodsIds.split(","); - int result =0; - //申购单中已经存在的物品明细,再次新增明细时不用再次保存,防止明细的数量,单价等被清空 - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - String wherestr = "where contract_id = '"+contractId+"' and goods_id = '"+str+"'"; - List contractDetails = this.contractDetailService.selectListByWhere(wherestr); - if (contractDetails == null || contractDetails.size() == 0) { - ContractDetail contractDetail = new ContractDetail(); - contractDetail.setId(CommUtil.getUUID()); - contractDetail.setInsdt(CommUtil.nowDate()); - contractDetail.setInsuser(cu.getId()); - contractDetail.setContractId(contractId); - contractDetail.setGoodsId(str); - contractDetail.setDeptId(deptId); - result += this.contractDetailService.save(contractDetail); - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.contractDetailService.selectListByWhere("where contract_id = '"+contractId+"'"); - for (ContractDetail item : list) { - boolean isInArray = this.contractDetailService.isInArray(idArrary, item.getGoodsId()); - if (!isInArray) { - this.contractDetailService.deleteById(item.getId()); - }; - } - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/saveContractDetail.do") - public String dosavePurchaseDetail(HttpServletRequest request,Model model, - @ModelAttribute ContractDetail contractDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - contractDetail.setId(CommUtil.getUUID()); - contractDetail.setInsdt(CommUtil.nowDate()); - contractDetail.setInsuser(cu.getId()); - int result = this.contractDetailService.save(contractDetail); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+contractDetail.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/getContractDetailList.do") - public ModelAndView getContractDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = "where 1=1"; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and contract_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - //选择采购计划明细时用到,加载出所有完成审核的申购单的明细 - if (request.getParameter("pids")!= null && !request.getParameter("pids").isEmpty()) { - String pids = request.getParameter("pids"); - pids = pids.replace(",","','"); - wherestr += " and contract_id in ('"+pids+"')"; - } - PageHelper.startPage(page, rows); - List list = this.contractDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/editContractDetail.do") - public String doeditContractDetail(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractDetail contractDetail = this.contractDetailService.selectById(id); - model.addAttribute("contractDetail", contractDetail); - return "/sparepart/contractDetailEdit"; - } - /** - * 申购明细修改数量或价格后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateContractDetail.do") - public String doupdateContractDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - ContractDetail contractDetail = this.contractDetailService.selectById(id); - int result = this.contractDetailService.updateTotalMoney(contractDetail,number,price); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contractDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deletesContractDetail.do") - public String dodeletesContractDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.contractDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - /** - * 启动合同审批流程 - * @param request - * @param model - * @param subscribe - * @return - */ - @RequestMapping("/startContractProcess.do") - public String dostartContractProcess(HttpServletRequest request,Model model, - @ModelAttribute Contract contract) { - User cu = (User) request.getSession().getAttribute("cu"); - contract.setInsdt(CommUtil.nowDate()); - contract.setInsuser(cu.getId()); - int result = this.contractService.startContractProcess(contract); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contract.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/showContractView.do") - public String showContractView(HttpServletRequest request,Model model){ - String contractId = request.getParameter("id"); - Contract contract = this.contractService.selectById(contractId); - request.setAttribute("contract", contract); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(contract); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(contract.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_CONTRACT_APPLY: - List list_apply = businessUnitDeptApplyService.selectListByWhere("where subscribe_id='"+contractId+"' "); - for (BusinessUnitDeptApply businessUnitDeptApply : list_apply) { - //退回 - businessUnitRecord = new BusinessUnitRecord(contract,businessUnitDeptApply.getTargetusers()); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_CONTRACT_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+contractId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId=contract.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(contract.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/contractExecuteViewInModal"; - }else{ - return "sparepart/contractExecuteView"; - } - } - /** - * 显示任务审核 - * */ - @RequestMapping("/showContractAudit.do") - public String showContractAudit(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String contractId = request.getParameter("contractId"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - Contract contract = this.contractService.selectById(contractId); - model.addAttribute("contract", contract); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/contractAudit"; - } - /** - * 流程流转-任务审核*/ - @RequestMapping("/doAuditContract.do") - public String doAuditContract(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.contractService.doAudit(businessUnitAudit); - //修改协助人流转记录 - Contract contract = this.contractService.selectById(businessUnitAudit.getBusinessid()); - if(contract.getHelpersLog()!=null && !contract.getHelpersLog().equals("")){ - if(contract.getHelpers()!=null && !contract.getHelpers().equals("") && (contract.getHelpers().length()!=(contract.getHelpersLog().length()-1))){ - contract.setHelpersLog(contract.getHelpersLog()+businessUnitAudit.getTargetusers()+","); - } - }else{ - contract.setHelpersLog(businessUnitAudit.getTargetusers()+","); - } - this.contractService.update(contract); - //END - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 领导审核 - * */ - @RequestMapping("/showContractInquiry.do") - public String showContractInquiry(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - //String contractId = request.getParameter("contractId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - Contract contract = this.contractService.selectById(pInstance.getBusinessKey()); - model.addAttribute("contract", contract); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - /*ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - }*/ - return "sparepart/purchaseInquiry"; - } - /** - * 显示任务处理-部门申请 - * */ - @RequestMapping("/showDeptApply.do") - public String showDeptApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitDeptApply businessUnitDeptApply = new BusinessUnitDeptApply(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitDeptApplies = this.businessUnitDeptApplyService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitDeptApplies!= null && businessUnitDeptApplies.size()>0){ - businessUnitDeptApply = businessUnitDeptApplies.get(0); - //若任务退回后,需更新新的任务id - businessUnitDeptApply.setTaskid(taskId); - }else{ - businessUnitDeptApply.setId(CommUtil.getUUID()); - businessUnitDeptApply.setProcessid(processInstanceId); - businessUnitDeptApply.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitDeptApply.setSubscribeId(pInstance.getBusinessKey()); - businessUnitDeptApply.setTaskdefinitionkey(task.getTaskDefinitionKey()); - } - String userIds = businessUnitDeptApply.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitDeptApply", businessUnitDeptApply); - model.addAttribute("nowDate", CommUtil.nowDate()); - - Contract contract = this.contractService.selectById(businessUnitDeptApply.getSubscribeId()); - model.addAttribute("contract", contract); - List businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessId = '"+contract.getId()+"' order by insdt desc"); - String rejectReson =""; - if (businessUnitAudits!=null && businessUnitAudits.size()>0) { - rejectReson = businessUnitAudits.get(0).getAuditopinion(); - } - model.addAttribute("rejectReson", rejectReson); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/contractEditForDeptApply"; - } - /** - *流程流转-部门申请*/ - @RequestMapping("/doHandleDeptApply.do") - public String doHandleDeptApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitDeptApply businessUnitDeptApply){ - User cu= (User)request.getSession().getAttribute("cu"); - String routeNum=request.getParameter("routeNum"); - int result=0; - businessUnitDeptApply.setStatus(BusinessUnitHandle.Status_FINISH); - if(!this.businessUnitDeptApplyService.checkExit(businessUnitDeptApply)) { - businessUnitDeptApply.setInsuser(cu.getId()); - businessUnitDeptApply.setInsdt(CommUtil.nowDate()); - result =this.businessUnitDeptApplyService.save(businessUnitDeptApply); - }else { - result =this.businessUnitDeptApplyService.update(businessUnitDeptApply); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitDeptApply.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitDeptApply.getTaskid(), variables); - //发送消息 - if(businessUnitDeptApply.getTargetusers()!=null && !businessUnitDeptApply.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitDeptApply = businessUnitDeptApplyService.selectById(businessUnitDeptApply.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(); - businessUnitRecord.setId(businessUnitDeptApply.getId()); - businessUnitRecord.setInsdt(businessUnitDeptApply.getInsdt()); - businessUnitRecord.setInsuser(businessUnitDeptApply.getInsuser()); - businessUnitRecord.setBusinessId(businessUnitDeptApply.getSubscribeId()); - businessUnitRecord.setProcessid(businessUnitDeptApply.getProcessid()); - businessUnitRecord.setTaskdefinitionkey(businessUnitDeptApply.getTaskdefinitionkey()); - businessUnitRecord.setTaskid(businessUnitDeptApply.getTaskid()); - businessUnitRecord.setType(BusinessUnit.UNIT_DEPT_APPLY); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String handleDetail = businessUnitDeptApply.getHandledetail(); - String record=""; - if (BusinessUnitHandle.Status_FINISH.equals(businessUnitDeptApply.getStatus())) { - record="合同已提交,"; - String solver =businessUnitDeptApply.getTargetusers(); - if (solver!=null && !solver.isEmpty()) { - List users= userService.selectListByWhere("where id in('"+solver.replace(",", "','")+"')"); - String userNames=""; - for (User user : users) { - if(!userNames.isEmpty()){ - userNames+="、"; - } - userNames+=user.getCaption(); - } - if (!userNames.isEmpty()) { - record+="提交至:"+userNames+"审核。"; - } - } - }else{ - record="任务正在执行中... "; - } - - businessUnitRecord.setRecord(record); - - User user =userService.getUserById(businessUnitDeptApply.getInsuser()); - businessUnitRecord.setUser(user); - - ContractService contractService = (ContractService) SpringContextUtil.getBean("contractService"); - Contract contract = contractService.selectById(businessUnitDeptApply.getSubscribeId()); - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(contract.getProcessdefid(), businessUnitDeptApply.getTaskdefinitionkey()); - businessUnitRecord.setTaskName(activityImpl.getProperties().get("name").toString()); - businessUnitRecord.sendMessage(businessUnitDeptApply.getTargetusers(),""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitDeptApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - *流程流转-采购询价*/ - /*@RequestMapping("/doHandleInquiry.do") - public String doHandleInquiry(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitInquiry businessUnitInquiry){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitInquiry.setStatus(BusinessUnitHandle.Status_FINISH); - if(!this.businessUnitInquiryService.checkExit(businessUnitInquiry)) { - businessUnitInquiry.setInsuser(cu.getId()); - businessUnitInquiry.setInsdt(CommUtil.nowDate()); - result =this.businessUnitInquiryService.save(businessUnitInquiry); - }else { - result =this.businessUnitInquiryService.update(businessUnitInquiry); - } - try { - Map variables = new HashMap(); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitInquiry.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitInquiry.getTaskid(), variables); - //发送消息 - if(businessUnitInquiry.getTargetusers()!=null && !businessUnitInquiry.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitInquiry = businessUnitInquiryService.selectById(businessUnitInquiry.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitInquiry); - businessUnitRecord.sendMessage(businessUnitInquiry.getTargetusers(),""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitInquiry.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - }*/ - //2020-07-13 start - /** - * 获取编号 - */ - @RequestMapping("/doaddNumber.do") - public String doaddNumber(HttpServletRequest request,Model model){ - //合同类型 - String contractClassId = request.getParameter("contractClassId"); - //公司 - String companyNum = request.getParameter("companyNum"); - String channelsid = request.getParameter("channelsid"); - //部门 - String deptId = request.getParameter("deptId"); - Dept depts = this.unitService.getDeptById(deptId); - //时间 - String date = CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - //编号=公司-部门-合同类型-时间 12-456-89-11 12 13 14 15 - ContractClass contractClass =contractClassService.selectById(contractClassId); - String number = ""; - String msg = "执行成功"; - boolean result = true; - if(contractClass.getpClass()!=null){ - //1234-67-9 10 11 12-13 14 15 - if(contractClass.getpClass().getNumber().equals("GC")){ - if(channelsid!=null && !channelsid.equals("")){ - channelsid = channelsid.replace(",","','"); - List channels = this.channelsService.selectListByWhere("where id in ('"+channelsid+"') "); - if(channels!=null && channels.size()>0){ - for(int a=0;a list = this.contractService.selectListByWhere("where id in ('"+contractIds.replace("," , "','")+"') order by insdt desc "); - model.addAttribute("contracts",JSONArray.fromObject(list)); - } - return "sparepart/contract4Selects"; - } - - @RequestMapping("/getContractByIds.do") - public String getContractByIds(HttpServletRequest request,Model model){ - String contractIds = request.getParameter("contractIds"); - List list = this.contractService.selectListByWhere("where id in ('"+contractIds.replace("," , "','")+"') order by CHARINDEX(','+ id +',',',"+contractIds+",')"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return "result"; - } - - //用于合同筛选下拉框 - @RequestMapping("/getListForSelect.do") - public String getListForSelect(HttpServletRequest request,Model model) { - JSONArray jsonArray=new JSONArray(); - List list = this.contractService.selectListByWhere("order by insdt desc"); - for(Contract contract :list){ - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", contract.getId()); - jsonObject.put("text", contract.getContractname()); - jsonArray.add(jsonObject); - } - model.addAttribute("result",jsonArray); - return "result"; - } - @RequestMapping("/showcontractStockList.do") - public String showcontractStockList(HttpServletRequest request, Model model) { - return "/sparepart/contractStockList"; - } -} diff --git a/src/com/sipai/controller/sparepart/ContractDetailInvoiceController.java b/src/com/sipai/controller/sparepart/ContractDetailInvoiceController.java deleted file mode 100644 index 3c755992..00000000 --- a/src/com/sipai/controller/sparepart/ContractDetailInvoiceController.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.ContractDetailInvoice; -import com.sipai.entity.sparepart.ContractDetailPayment; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ContractDetailInvoiceService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/contractDetailInvoice") -public class ContractDetailInvoiceController { - @Resource - private ContractDetailInvoiceService contractDetailInvoiceService; - @Resource - private ContractService contractService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/contractDetailInvoiceList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - //合同id - if (request.getParameter("contractId")!= null && !request.getParameter("contractId").isEmpty()) { - wherestr += " and contract_id like '%"+request.getParameter("contractId")+"%'"; - }else{ - String result = "{\"total\":0,\"rows\":[]}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - PageHelper.startPage(page, rows); - List list = this.contractDetailInvoiceService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String contractId = request.getParameter("contractId"); - BigDecimal total = this.contractService.selectById(contractId).getContractamount(); - model.addAttribute("contractId", contractId); - model.addAttribute("total", total); - return "/sparepart/contractDetailInvoiceAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ContractDetailInvoice contractDetailInvoice) { - User cu = (User) request.getSession().getAttribute("cu"); - //contractDetailInvoice.setId(CommUtil.getUUID()); - contractDetailInvoice.setId(contractDetailInvoice.getNumber()); - contractDetailInvoice.setInsdt(CommUtil.nowDate()); - contractDetailInvoice.setInsuser(cu.getId()); - contractDetailInvoice.setInvoiceStatus("待确认"); - List list = this.contractDetailInvoiceService.selectListByWhere("where number ='"+contractDetailInvoice.getNumber()+"' "); - - if(list.size()>0){ - String resultstr = "{\"res\":\""+"发票号重复"+"\",\"id\":\""+contractDetailInvoice.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - int result = this.contractDetailInvoiceService.save(contractDetailInvoice); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+contractDetailInvoice.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/checknumber.do") - public String checknumber(HttpServletRequest request,Model model, - @RequestParam(value = "number") String number) { - - List list = this.contractDetailInvoiceService.selectListByWhere("where number ='"+number+"' "); - int result = 0; - if(list.size()>0){ - result=1; - } - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/comparetotal.do") - public String comparetotal(HttpServletRequest request,Model model, - @RequestParam(value = "number") String number,@RequestParam(value = "id") String id) { - - BigDecimal total = this.contractService.selectById(id).getContractamount(); - List list = this.contractDetailInvoiceService.selectListByWhere("where contract_id ='"+id+"' "); - BigDecimal bd=new BigDecimal(number); - for (ContractDetailInvoice contractDetailInvoice : list) { - bd = bd.add(contractDetailInvoice.getAmountinvoice()); - } - int result = 0; - if(total.compareTo(bd)==-1){ - result=1; - } - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.contractDetailInvoiceService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.contractDetailInvoiceService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractDetailInvoice contractDetailInvoice = this.contractDetailInvoiceService.selectById(id); - model.addAttribute("contractDetailInvoice", contractDetailInvoice); - return "/sparepart/contractDetailInvoiceEdit"; - } - @RequestMapping("/editFinance.do") - public String doeditFinance(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractDetailInvoice contractDetailInvoice = this.contractDetailInvoiceService.selectById(id); - model.addAttribute("contractDetailInvoice", contractDetailInvoice); - return "/sparepart/contractDetailFinanceInvoiceEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ContractDetailInvoice contractDetailInvoice) { - User cu = (User) request.getSession().getAttribute("cu"); - contractDetailInvoice.setInsdt(CommUtil.nowDate()); - contractDetailInvoice.setInsuser(cu.getId()); - int result = this.contractDetailInvoiceService.update(contractDetailInvoice); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contractDetailInvoice.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/updateFinance.do") - public String doupdateFinance(HttpServletRequest request,Model model, - @ModelAttribute ContractDetailInvoice contractDetailInvoice) { - User cu = (User) request.getSession().getAttribute("cu"); - contractDetailInvoice.setInsdt(CommUtil.nowDate()); - contractDetailInvoice.setInsuser(cu.getId()); - contractDetailInvoice.setInvoiceStatus("已确认"); - int result = this.contractDetailInvoiceService.update(contractDetailInvoice); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contractDetailInvoice.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ContractDetailInvoice contractDetailInvoice = this.contractDetailInvoiceService.selectById(id); - model.addAttribute("contractDetailInvoice", contractDetailInvoice); - return "/sparepart/contractDetailInvoiceView"; - } - @RequestMapping("/subscribeList4select.do") - public String subscribeList4select(HttpServletRequest request, Model model) { - String purchaseId = request.getParameter("invoiceIds"); - if(purchaseId!=null && !purchaseId.isEmpty()){ - String[] id_Array= purchaseId.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("purchaseId", jsonArray); - request.setAttribute("contractId", request.getParameter("contractId")); - - } - return "/sparepart/invoiceList4select"; - } -} diff --git a/src/com/sipai/controller/sparepart/ContractDetailPaymentController.java b/src/com/sipai/controller/sparepart/ContractDetailPaymentController.java deleted file mode 100644 index 0f9610b5..00000000 --- a/src/com/sipai/controller/sparepart/ContractDetailPaymentController.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.ContractDetailPayment; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ContractDetailPaymentService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/contractDetailPayment") -public class ContractDetailPaymentController { - @Resource - private ContractDetailPaymentService contractDetailPaymentService; - @Resource - private ContractService contractService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/contractDetailPaymentList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - //合同id - if (request.getParameter("contractId")!= null && !request.getParameter("contractId").isEmpty()) { - wherestr += " and contract_id like '%"+request.getParameter("contractId")+"%'"; - }else{ - String result = "{\"total\":0,\"rows\":[]}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - PageHelper.startPage(page, rows); - List list = this.contractDetailPaymentService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String contractId = request.getParameter("contractId"); - model.addAttribute("contractId", contractId); - String orderstr = " order by paymentdate desc"; - String wherestr = " where contract_id='"+contractId+"' "; - List list = this.contractDetailPaymentService.selectListByWhere(wherestr+orderstr); - BigDecimal amountoutstanding = null ; - if(list!=null && list.size()>0){ - amountoutstanding = list.get(0).getAmountoutstanding(); - }else{ - Contract contract = this.contractService.selectById(contractId); - amountoutstanding = contract.getContractamount(); - } - model.addAttribute("amountoutstanding", amountoutstanding); - return "/sparepart/contractDetailPaymentAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ContractDetailPayment contractDetailPayment) { - User cu = (User) request.getSession().getAttribute("cu"); - contractDetailPayment.setId(CommUtil.getUUID()); - contractDetailPayment.setInsdt(CommUtil.nowDate()); - contractDetailPayment.setInsuser(cu.getId()); - contractDetailPayment.setPaymentStatus("申请付款"); - Contract contract = this.contractService.selectById(contractDetailPayment.getContractId()); - List list = this.contractDetailPaymentService.selectListByWhere("where contract_id = '"+contractDetailPayment.getContractId()+"'"); - BigDecimal Amountoutst = contract.getContractamount(); - for (ContractDetailPayment contractDetailPayment2 : list) { - if(contractDetailPayment2.getAmountpaid()!=null){ - Amountoutst = Amountoutst.subtract(contractDetailPayment2.getAmountpaid()); - } - } - contractDetailPayment.setAmountoutstanding(Amountoutst); - int result = this.contractDetailPaymentService.save(contractDetailPayment); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+contractDetailPayment.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.contractDetailPaymentService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.contractDetailPaymentService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractDetailPayment contractDetailPayment = this.contractDetailPaymentService.selectById(id); - model.addAttribute("contractDetailPayment", contractDetailPayment); - return "/sparepart/contractDetailPaymentEdit"; - } - @RequestMapping("/editFinance.do") - public String doediteditFinance(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractDetailPayment contractDetailPayment = this.contractDetailPaymentService.selectById(id); - model.addAttribute("contractDetailPayment", contractDetailPayment); - return "/sparepart/contractDetailFinancePaymentEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ContractDetailPayment contractDetailPayment) { - User cu = (User) request.getSession().getAttribute("cu"); - contractDetailPayment.setInsdt(CommUtil.nowDate()); - contractDetailPayment.setInsuser(cu.getId()); - int result = this.contractDetailPaymentService.update(contractDetailPayment); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contractDetailPayment.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/updateFinance.do") - public String doupdateFinance(HttpServletRequest request,Model model, - @ModelAttribute ContractDetailPayment contractDetailPayment) { - User cu = (User) request.getSession().getAttribute("cu"); - contractDetailPayment.setInsdt(CommUtil.nowDate()); - contractDetailPayment.setInsuser(cu.getId()); - contractDetailPayment.setPaymentStatus("已付款"); - int result = this.contractDetailPaymentService.update(contractDetailPayment); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contractDetailPayment.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ContractDetailPayment contractDetailPayment = this.contractDetailPaymentService.selectById(id); - model.addAttribute("contractDetailPayment", contractDetailPayment); - return "/sparepart/contractDetailPaymentView"; - } - -} diff --git a/src/com/sipai/controller/sparepart/ContractTaxRateController.java b/src/com/sipai/controller/sparepart/ContractTaxRateController.java deleted file mode 100644 index 86e60a76..00000000 --- a/src/com/sipai/controller/sparepart/ContractTaxRateController.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.ContractTaxRate; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ContractTaxRateService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/contractTaxRate") -public class ContractTaxRateController { - @Resource - private ContractTaxRateService contractTaxRateService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/contractTaxRateList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; -// if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { -// wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; -// } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and taxRate like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.contractTaxRateService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/contractTaxRateAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ContractTaxRate contractTaxRate) { - User cu = (User) request.getSession().getAttribute("cu"); - contractTaxRate.setId(CommUtil.getUUID()); - contractTaxRate.setInsdt(CommUtil.nowDate()); - contractTaxRate.setInsuser(cu.getId()); - if (contractTaxRate.getTaxrate() != null) { - List contractTaxRates = contractTaxRateService.selectListByWhere("where taxRate = " + contractTaxRate.getTaxrate()); - if (contractTaxRates != null && contractTaxRates.size() > 0) { - String resultstr = "{\"res\":\"2\",\"res\":\"已存在当前税率请勿重复添加!\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - } - int result = this.contractTaxRateService.save(contractTaxRate); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+contractTaxRate.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.contractTaxRateService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.contractTaxRateService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ContractTaxRate contractTaxRate = this.contractTaxRateService.selectById(id); - model.addAttribute("contractTaxRate", contractTaxRate); - return "/sparepart/contractTaxRateEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ContractTaxRate contractTaxRate) { - User cu = (User) request.getSession().getAttribute("cu"); - contractTaxRate.setInsdt(CommUtil.nowDate()); - contractTaxRate.setInsuser(cu.getId()); - if (StringUtils.isNotBlank(contractTaxRate.getId())) { - List contractTaxRates = contractTaxRateService.selectListByWhere("where id != '" + contractTaxRate.getId() + "' and taxRate = " + contractTaxRate.getTaxrate()); - if (contractTaxRates != null && contractTaxRates.size() > 0) { - String resultstr = "{\"res\":\"2\",\"res\":\"已存在当前税率请勿重复添加!\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - } - int result = this.contractTaxRateService.update(contractTaxRate); - String resstr="{\"res\":\""+result+"\",\"id\":\""+contractTaxRate.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ContractTaxRate contractTaxRate = this.contractTaxRateService.selectById(id); - model.addAttribute("contractTaxRate", contractTaxRate); - return "/sparepart/contractTaxRateView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getContractTaxRate4Select.do") - public String getContractTaxRate4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.contractTaxRateService.selectListByWhere("where 1=1 order by insdt desc"); - if(list!=null && list.size()>0){ - for (ContractTaxRate contractTaxRate : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", contractTaxRate.getId()); - jsonObject.put("text", contractTaxRate.getTaxrate()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getContractTaxRate4Selecttext.do") - public String getContractTaxRate4Selecttext(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.contractTaxRateService.selectListByWhere("where 1=1 order by insdt desc"); - if(list!=null && list.size()>0){ - for (ContractTaxRate contractTaxRate : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", contractTaxRate.getTaxrate()); - jsonObject.put("text", contractTaxRate.getTaxrate()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/GoodsClassController.java b/src/com/sipai/controller/sparepart/GoodsClassController.java deleted file mode 100644 index 62134639..00000000 --- a/src/com/sipai/controller/sparepart/GoodsClassController.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.GoodsClassService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/goodsClass") -public class GoodsClassController { - @Resource - private GoodsClassService goodsClassService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/goodsClassList"; - } - @RequestMapping("/getGoodsClassJson.do") - public String getGoodsClassJson(HttpServletRequest request,Model model){ - List list = this.goodsClassService.selectListByWhere("where 1=1 order by morder"); - String json = this.goodsClassService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.goodsClassService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - GoodsClass goodsClass= this.goodsClassService.selectById(pid); - model.addAttribute("pname",goodsClass.getName()); - } - return "/sparepart/goodsClassAdd"; - } - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute GoodsClass goodsClass) { - User cu = (User) request.getSession().getAttribute("cu"); - goodsClass.setId(CommUtil.getUUID()); - goodsClass.setInsdt(CommUtil.nowDate()); - goodsClass.setInsuser(cu.getId()); - int result = this.goodsClassService.save(goodsClass); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - model.addAttribute("goodsClassId",request.getParameter("goodsClassId")); - return "sparepart/goodsClass4select"; - } - @RequestMapping("/delete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.goodsClassService.deleteById(id); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.goodsClassService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - GoodsClass goodsClass = this.goodsClassService.selectById(id); - model.addAttribute("goodsClass", goodsClass); - return "/sparepart/goodsClassEdit"; - } - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute GoodsClass goodsClass) { - User cu = (User) request.getSession().getAttribute("cu"); - goodsClass.setInsdt(CommUtil.nowDate()); - goodsClass.setInsuser(cu.getId()); - int result = this.goodsClassService.update(goodsClass); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - GoodsClass goodsClass = this.goodsClassService.selectById(id); - model.addAttribute("goodsClass", goodsClass); - return "/sparepart/goodsClassView"; - } -} diff --git a/src/com/sipai/controller/sparepart/GoodsController.java b/src/com/sipai/controller/sparepart/GoodsController.java deleted file mode 100644 index 9d778f8c..00000000 --- a/src/com/sipai/controller/sparepart/GoodsController.java +++ /dev/null @@ -1,587 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.sparepart.*; -import com.sipai.service.sparepart.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/goods") -public class GoodsController { - @Resource - private GoodsService goodsService; - @Resource - private StockCheckService stockCheckService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private GoodsClassService goodsClassService; - @Resource - private UnitService unitService; - @Resource - private GoodsReserveService goodsReserveService; - @Resource - private SubscribeService subscribeService; - @Resource - private SubscribeDetailService subscribeDetailService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/goodsList"; - } - @RequestMapping("/showSaleList.do") - public String showSaleList(HttpServletRequest request, Model model) { - return "/sparepart/goodsSaleList"; - } - @RequestMapping("/materialSummary.do") - public String materialSummary(HttpServletRequest request, Model model) { - String nowmonth = CommUtil.nowDate().substring(0, 7); - model.addAttribute("nowmonth", nowmonth); - return "/sparepart/materialSummary"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("classid")!= null && !request.getParameter("classid").isEmpty()) { - String classid = request.getParameter("classid"); - List goodsClassList = this.goodsClassService.selectListByWhere("where active=1 order by insdt"); - if(classid!=null && !classid.isEmpty() && !",".equals(classid.substring(classid.length()-1, classid.length()))){ - classid = classid+","; - } - String classids = this.goodsClassService.getChildrenID(classid,goodsClassList); - if(classids!=null && !classids.isEmpty()){ - classids = classids.substring(0, classids.length()-1); - } - classids = classids.replace(",","','"); - wherestr += " and class_id in ('"+classids+"') "; - } - - if (request.getParameter("className")!= null && !request.getParameter("className").isEmpty()) { - String className = request.getParameter("className"); - List goodsClassOne = this.goodsClassService.selectListByWhere("where name like '%"+className+"%' and active=1 order by insdt"); - if(goodsClassOne!=null && goodsClassOne.size()>0){ - List goodsClassList = this.goodsClassService.selectListByWhere("where active=1 order by insdt"); - String classid = ""; - for(GoodsClass goodsClass: goodsClassOne) { - classid += goodsClass.getId()+","; - } - classid = classid.substring(0, classid.length()-1); - String classids = this.goodsClassService.getChildrenID(classid,goodsClassList); - classids = classids.replace(",","','"); - wherestr += " and class_id in ('"+classids+"') "; - } - } - PageHelper.startPage(page, rows); - List list = this.goodsService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getDataList.do") - public ModelAndView getList(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String wherestr = "where 1 = 1"; - if (StringUtils.isNotBlank(request.getParameter("name"))) { - wherestr += " and name like '%" + request.getParameter("name") + "%'"; - } - List list = this.goodsService.selectListByWhere(wherestr + "order by name"); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getGoodsSaleList.do") - public ModelAndView getGoodsSaleList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " _cstotalmoney "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - String whereBiz_id = " and c.status = '2' "; - //System.out.println("monthtime_id"+request.getParameter("monthtime_id")); - //Date date =new Date(); - Calendar cal = Calendar.getInstance(); - String year =""; - String Month =""; - String nowMonth =""; - nowMonth = String.valueOf( cal.get(Calendar.MONTH+1)); - if(request.getParameter("monthtime_id")!= null && !request.getParameter("monthtime_id").isEmpty()){ - String[] timeDate = request.getParameter("monthtime_id").split("-"); - year = timeDate[0]; - Month = timeDate[1]; - }else{ - year = String.valueOf(cal.get(Calendar.YEAR)); - Month = String.valueOf( cal.get(Calendar.MONTH)); - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and( _outname like '%"+request.getParameter("search_name")+"%'"; - wherestr += " or _inname like '%"+request.getParameter("search_name")+"%'"; - wherestr += " or _csname like '%"+request.getParameter("search_name")+"%'"; - wherestr += " or _lsname like '%"+request.getParameter("search_name")+"%')"; - } - if (request.getParameter("warehouse_id")!= null && !request.getParameter("warehouse_id").isEmpty()) { - whereBiz_id += " and c.warehouse_id = '"+request.getParameter("warehouse_id")+"'"; - } - PageHelper.startPage(page, rows); - List list1 = new ArrayList<>(); - List list = new ArrayList<>(); - List StockChecklist = this.stockCheckService.selectListByWhere(" where year(now_time) = '"+year+"' and MONTH(now_time) = '"+Month+"' order by insdt"); -// List StockChecklist1 =this.stockCheckService.selectListByWhere(" where year(now_time) = '"+year+"' and MONTH(now_time) = '"+nowMonth+"' order by insdt"); -// if( StockChecklist !=null&&StockChecklist1!=null&&StockChecklist.size()!=0&&StockChecklist1.size()!=0) -// { -// list = this.goodsService.selectGoodsSela(year,Month,wherestr+orderstr,whereBiz_id); -// -// for (Goods goods : list) { -// if(goods!=null){ -// if(goods.get_outid()!=null){ -// goods.setId(goods.get_outid()); -// goods.setName(goods.get_outname()); -// list1.add(goods); -// }else if(goods.get_inid()!=null){ -// goods.setId(goods.get_inid()); -// goods.setName(goods.get_inname()); -// list1.add(goods); -// }else if(goods.get_csid()!=null){ -// goods.setId(goods.get_csid()); -// goods.setName(goods.get_csname()); -// list1.add(goods); -// }else if(goods.get_lsid()!=null){ -// goods.setId(goods.get_lsid()); -// goods.setName(goods.get_lsname()); -// list1.add(goods); -// } -// } -// } -// }else{ - list = this.goodsService.selectGoodsSelaNotCheck(year,Month,wherestr+orderstr,whereBiz_id); - - for (Goods goods : list) { - if(goods!=null){ - if(goods.get_outid()!=null){ - goods.setId(goods.get_outid()); - goods.setName(goods.get_outname()); - Goods goodsSon = this.goodsService.selectById(goods.getId()); - goods.setModel(goodsSon.getModel()); - list1.add(goods); - }else if(goods.get_inid()!=null){ - goods.setId(goods.get_inid()); - goods.setName(goods.get_inname()); - Goods goodsSon = this.goodsService.selectById(goods.getId()); - goods.setModel(goodsSon.getModel()); - list1.add(goods); - }else if(goods.get_csid()!=null){ - goods.setId(goods.get_csid()); - goods.setName(goods.get_csname()); - Goods goodsSon = this.goodsService.selectById(goods.getId()); - goods.setModel(goodsSon.getModel()); - list1.add(goods); - }else if(goods.get_lsid()!=null){ - goods.setId(goods.get_lsid()); - goods.setName(goods.get_lsname()); - Goods goodsSon = this.goodsService.selectById(goods.getId()); - goods.setModel(goodsSon.getModel()); - list1.add(goods); - } - } - } - - // } - PageInfo pInfo = new PageInfo(list1); - JSONArray jsonArray = JSONArray.fromObject(list1); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getList4Summary.do") - public ModelAndView getList4Summary(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String dt_month =request.getParameter("dt_month");//yyyy-mm - String unitid =request.getParameter("companyId"); - String warehouse_id =request.getParameter("warehouse_id"); - JSONObject jsonObject_result = new JSONObject(); - List unitlist = unitService.selectListByWhere("where pid='"+unitid+"' and type in ('B','D') "); - List GoodsClassListAll = this.goodsClassService.selectListByWhere("where 1=1 order by morder"); - List GoodsClassListOne = this.goodsClassService.selectListByWhere("where pid='-1' order by morder"); - if(GoodsClassListOne!=null && GoodsClassListOne.size()>0){ - JSONArray jsonArray_stock_bef = new JSONArray(); - JSONArray jsonArray_in_num_now = new JSONArray(); - for(GoodsClass goodsClass : GoodsClassListOne){ - JSONObject jsonObject_goodsClass = new JSONObject(); - jsonObject_goodsClass.put("name", goodsClass.getName()); - String goodsClassIds = this.goodsClassService.getChildrenID(goodsClass.getId()+",",GoodsClassListAll); - goodsClassIds = goodsClassIds.replace(",","','"); - BigDecimal in_num_bef = new BigDecimal("0"); - BigDecimal in_num_now = new BigDecimal("0"); - BigDecimal out_num_bef = new BigDecimal("0"); - //不含税 - BigDecimal in_totalMoney_bef = new BigDecimal("0"); - BigDecimal in_totalMoney_now = new BigDecimal("0"); - BigDecimal out_totalMoney_bef = new BigDecimal("0"); - //含税 - BigDecimal in_includeTaxrate_totalMoney_bef = new BigDecimal("0"); - BigDecimal in_includeTaxrate_totalMoney_now = new BigDecimal("0"); - BigDecimal out_includeTaxrate_totalMoney_bef = new BigDecimal("0"); - //本月之前已审核通过入库数量 - List inStockRecordDetailList_bef = this.inStockRecordDetailService.selectListByWhere("where instock_record_id in " - + "(select ins.id from TB_SparePart_InStockRecord ins left join uv_unit un on un.id=ins.instock_man_id " - + "where instock_date<'"+dt_month+"-01 00:00"+"' and status='2' and warehouse_id='"+warehouse_id+"' ) and " - + "goods_id in (select id from [TB_SparePart_Goods] where class_id in('"+goodsClassIds+"')) " - + "order by insdt "); - if(inStockRecordDetailList_bef!=null && inStockRecordDetailList_bef.size()>0){ - for(InStockRecordDetail inStockRecordDetail :inStockRecordDetailList_bef){ - in_num_bef = in_num_bef.add(inStockRecordDetail.getInstockNumber()); - if(inStockRecordDetail.getTotalMoney()!=null){ - in_totalMoney_bef = in_totalMoney_bef.add(inStockRecordDetail.getTotalMoney()); - } - if(inStockRecordDetail.getIncludeTaxrateTotalMoney()!=null){ - in_includeTaxrate_totalMoney_bef = in_includeTaxrate_totalMoney_bef.add(inStockRecordDetail.getIncludeTaxrateTotalMoney()); - } - } - } - //本月之前已审核通过出库数量 - List outStockRecordDetailList_bef = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id in " - + "(select id from [TB_SparePart_OutStockRecord] " - + "where out_date<'"+dt_month+"-01 00:00"+"' and status='2' and warehouse_id='"+warehouse_id+"' ) and goods_id " - + "in (select id from [TB_SparePart_Goods] where class_id in('"+goodsClassIds+"')) order by insdt "); - if(outStockRecordDetailList_bef!=null && outStockRecordDetailList_bef.size()>0){ - for(OutStockRecordDetail outStockRecordDetail :outStockRecordDetailList_bef){ - out_num_bef = out_num_bef.add(outStockRecordDetail.getOutNumber()); - if(outStockRecordDetail.getTotalMoney()!=null){ - out_totalMoney_bef = out_totalMoney_bef.add(outStockRecordDetail.getTotalMoney()); - } - if(outStockRecordDetail.getIncludedTaxTotalMoney()!=null){ - out_includeTaxrate_totalMoney_bef = out_includeTaxrate_totalMoney_bef.add(outStockRecordDetail.getIncludedTaxTotalMoney()); - } - } - } - jsonObject_goodsClass.put("stock_bef", in_num_bef.subtract(out_num_bef)); - jsonObject_goodsClass.put("stock_totalMoney_bef", in_totalMoney_bef.subtract(out_totalMoney_bef)); - jsonObject_goodsClass.put("stock_includeTaxrate_totalMoney_bef", in_includeTaxrate_totalMoney_bef.subtract(out_includeTaxrate_totalMoney_bef)); - - JSONObject jsonObject_goodsClass_in = new JSONObject(); - jsonObject_goodsClass_in.put("name", goodsClass.getName()); - //本月已审核通过入库数量 - List inStockRecordDetailList_now = this.inStockRecordDetailService.selectListByWhere("where instock_record_id in " - + "(select id from TB_SparePart_InStockRecord " - + "where year(instock_date)="+dt_month.substring(0, 4)+" " - + "and month(instock_date)="+dt_month.substring(5, 7)+" and status='2' and warehouse_id='"+warehouse_id+ - "' ) and goods_id in (select id from [TB_SparePart_Goods] where class_id in('"+goodsClassIds+"')) order by insdt "); - if(inStockRecordDetailList_now!=null && inStockRecordDetailList_now.size()>0){ - for(InStockRecordDetail inStockRecordDetail :inStockRecordDetailList_now){ - in_num_now = in_num_now.add(inStockRecordDetail.getInstockNumber()); - if(inStockRecordDetail.getTotalMoney()!=null){ - in_totalMoney_now = in_totalMoney_now.add(inStockRecordDetail.getTotalMoney()); - } - if(inStockRecordDetail.getIncludeTaxrateTotalMoney()!=null){ - in_includeTaxrate_totalMoney_now = in_includeTaxrate_totalMoney_now.add(inStockRecordDetail.getIncludeTaxrateTotalMoney()); - } - } - } - jsonObject_goodsClass_in.put("in_num_now", in_num_now); - jsonObject_goodsClass_in.put("in_totalMoney_now", in_totalMoney_now); - jsonObject_goodsClass_in.put("in_includeTaxrate_totalMoney_now", in_includeTaxrate_totalMoney_now); - jsonArray_stock_bef.add(jsonObject_goodsClass); - jsonArray_in_num_now.add(jsonObject_goodsClass_in); - } - JSONArray jsonArray_out_num_now = new JSONArray(); - if(unitlist!=null && unitlist.size()>0){ - for(Unit unit : unitlist){ - JSONObject jsonObject_unit = new JSONObject(); - jsonObject_unit.put("unitName", unit.getName()); - jsonObject_unit.put("unitSname", unit.getSname()); - JSONArray jsonArray_unit_out_num_now = new JSONArray(); - for(GoodsClass goodsClass : GoodsClassListOne){ - BigDecimal out_num_now = new BigDecimal("0"); - BigDecimal out_totalMoney_now = new BigDecimal("0"); - BigDecimal out_includeTaxrate_totalMoney_now = new BigDecimal("0"); - JSONObject jsonObject_goodsClass_out = new JSONObject(); - jsonObject_goodsClass_out.put("name", goodsClass.getName()); - String goodsClassIds = this.goodsClassService.getChildrenID(goodsClass.getId()+",",GoodsClassListAll); - goodsClassIds = goodsClassIds.replace(",","','"); - //本月已审核通过出库数量 - List outStockRecordDetailList_now = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id in " - + "(select outs.id from [TB_SparePart_OutStockRecord] outs left join uv_unit un on un.id=outs.user_id " - + "where year(out_date)="+dt_month.substring(0, 4)+" " - + "and month(out_date)="+dt_month.substring(5, 7)+" and status='2' and warehouse_id='"+warehouse_id+"' and un.pid='"+unit.getId()+ - "' ) and goods_id in (select id from [TB_SparePart_Goods] where class_id in('"+goodsClassIds+"')) order by insdt "); - if(outStockRecordDetailList_now!=null && outStockRecordDetailList_now.size()>0){ - for(OutStockRecordDetail outStockRecordDetail :outStockRecordDetailList_now){ - out_num_now = out_num_now.add(outStockRecordDetail.getOutNumber()); - if(outStockRecordDetail.getTotalMoney()!=null){ - out_totalMoney_now = out_totalMoney_now.add(outStockRecordDetail.getTotalMoney()); - } - if(outStockRecordDetail.getIncludedTaxTotalMoney()!=null){ - out_includeTaxrate_totalMoney_now = out_includeTaxrate_totalMoney_now.add(outStockRecordDetail.getIncludedTaxTotalMoney()); - } - } - } - jsonObject_goodsClass_out.put("out_num_now", out_num_now); - jsonObject_goodsClass_out.put("out_totalMoney_now", out_totalMoney_now); - jsonObject_goodsClass_out.put("out_includeTaxrate_totalMoney_now", out_includeTaxrate_totalMoney_now); - jsonArray_unit_out_num_now.add(jsonObject_goodsClass_out); - } - jsonObject_unit.put("unit_out_num_now",jsonArray_unit_out_num_now); - jsonArray_out_num_now.add(jsonObject_unit); - } - } - jsonObject_result.put("GoodsClass", GoodsClassListOne); - jsonObject_result.put("stock_bef", jsonArray_stock_bef); - jsonObject_result.put("in_num_now", jsonArray_in_num_now); - jsonObject_result.put("out_num_now", jsonArray_out_num_now); - } - model.addAttribute("result",jsonObject_result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String id = "WP-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", id); - String goodsClassId = request.getParameter("goodsClassId"); - if(goodsClassId!=null && !goodsClassId.isEmpty()){ - GoodsClass goodsClass =this.goodsClassService.selectById(goodsClassId); - if(goodsClass!=null){ - model.addAttribute("goodsClass", goodsClass); - } - } - String subscribeDetailIds = request.getParameter("subscribeDetailIds"); - if (StringUtils.isNotBlank(subscribeDetailIds)) { - String[] ids = subscribeDetailIds.split(","); - SubscribeDetail subscribeDetail = subscribeDetailService.selectById(ids[0]); - model.addAttribute("subscribeDetailIds", subscribeDetailIds); - model.addAttribute("subscribeDetail", subscribeDetail); - } - return "/sparepart/goodsAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Goods goods) { - User cu = (User) request.getSession().getAttribute("cu"); - goods.setInsdt(CommUtil.nowDate()); - goods.setInsuser(cu.getId()); - List GoodsList = this.goodsService.selectListByWhere("where number='"+goods.getNumber()+"' "); - int result = 0; - if(GoodsList!=null && GoodsList.size()>0){ - result = 2; - }else{ - result = this.goodsService.save(goods); - } - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+goods.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.goodsService.deleteById(id); - goodsReserveService.deleteByWhere("where pid = '" + id + "'"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.goodsService.deleteByWhere("where id in ('"+ids+"')"); - goodsReserveService.deleteByWhere("where pid in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Goods goods = this.goodsService.selectById(id); - model.addAttribute("goods", goods); - return "/sparepart/goodsEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Goods goods) { - User cu = (User) request.getSession().getAttribute("cu"); - goods.setInsdt(CommUtil.nowDate()); - goods.setInsuser(cu.getId()); - int result = this.goodsService.update(goods); - String resstr="{\"res\":\""+result+"\",\"id\":\""+goods.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Goods goods = this.goodsService.selectById(id); - model.addAttribute("goods", goods); - return "/sparepart/goodsView"; - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "sparepart/goods4select"; - } - - /** - * 设备选择 ,可多选 - * */ - @RequestMapping("/showEquipmentCardForGoodsSelects.do") - public String showEquipmentCardForGoodsSelects(HttpServletRequest request,Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - if(equipmentIds!=null && !equipmentIds.isEmpty()){ - String[] id_Array= equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - return "/equipment/equipmentCardListForGoodsSelects"; - } - /** - * 选择物品明细界面,新增直接新增物品明细 - */ - @RequestMapping("/goodsAddInSelects.do") - public String dogoodsAddForSelects (HttpServletRequest request,Model model) { - String id = "WP-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", id); - String goodsClassId = request.getParameter("goodsClassId"); - if(goodsClassId!=null && !goodsClassId.isEmpty()){ - GoodsClass goodsClass =this.goodsClassService.selectById(goodsClassId); - if(goodsClass!=null){ - model.addAttribute("goodsClass", goodsClass); - } - } - return "/sparepart/goodsAddInSelects"; - } - /** - * 生产编号=类型编号+类型下物品名称不重复数量/类型下物品名称相同直接使用中间段+类型下物品名称数量 - */ - @RequestMapping("/generationNumber.do") - public ModelAndView generationNumber(HttpServletRequest request,Model model) { - String goodsClassId = request.getParameter("goodsClassId"); - String goodsName = request.getParameter("goodsName"); - String goodsNumber = ""; - String goodsClassCode = ""; - GoodsClass goodsClass =this.goodsClassService.selectById(goodsClassId); - if(goodsClass!=null){ - ArrayList pCode = goodsClassService.getPCode(goodsClass); - // 此对象id不为空则表示当前物品或上级存在编号 - GoodsClass goodsClass1 = new GoodsClass(); - for (int i = pCode.size() -1 ; i >= 0; i--) { - if (StringUtils.isNotBlank(pCode.get(i).getGoodsClassCode())) { - goodsClass1 = pCode.get(i); - goodsClassCode += pCode.get(i).getGoodsClassCode(); - } - } - if (StringUtils.isNotBlank(goodsClass1.getGoodsClassCode())) { - goodsNumber = goodsNumber( goodsName, goodsClassId, goodsClassCode); - } else { - goodsNumber = "WP-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - } - -// if(goodsClass.getGoodsClassCode()!=null && !goodsClass.getGoodsClassCode().isEmpty()){ -// goodsClassCode = goodsClass.getGoodsClassCode(); -// goodsNumber = goodsNumber( goodsName, goodsClassId, goodsClassCode); -// }else{ -// goodsClassId = goodsClass.getPid(); -// goodsClass =this.goodsClassService.selectById(goodsClassId); -// if(goodsClass!=null){ -// if(goodsClass.getGoodsClassCode()!=null && !"".equals(goodsClass.getGoodsClassCode())){ -// goodsClassCode = goodsClass.getGoodsClassCode(); -// goodsNumber = goodsNumber( goodsName, goodsClassId, goodsClassCode); -// }else{ -// goodsNumber = "WP-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); -// } -// }else{ -// goodsNumber = "WP-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); -// } -// } - } - model.addAttribute("result",goodsNumber); - return new ModelAndView("result"); - } - public String goodsNumber(String goodsName,String goodsClassId,String goodsClassCode){ - String goodsNumber = ""; - String orderstr = " order by id desc"; - String wherestr = " where name='"+goodsName+"' and class_id='"+goodsClassId+"' "; - List list = this.goodsService.selectListByWhere(wherestr+orderstr); - if(list!=null && list.size()>0){ - String listOneID = list.get(0).getNumber(); - goodsNumber = goodsClassCode+listOneID.substring(goodsClassCode.length(), goodsClassCode.length()+3)+(String.format("%03d", list.size()+1)); - }else{ - orderstr = " order by name desc"; - wherestr = " where class_id='"+goodsClassId+"' "; - list = this.goodsService.selectListByWhere4DistinctName(wherestr+orderstr); - goodsNumber = goodsClassCode + "" + (String.format("%03d", list.size()+2))+"001"; - } - return goodsNumber; - } -} diff --git a/src/com/sipai/controller/sparepart/GoodsReserveController.java b/src/com/sipai/controller/sparepart/GoodsReserveController.java deleted file mode 100644 index 8f2065aa..00000000 --- a/src/com/sipai/controller/sparepart/GoodsReserveController.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.controller.sparepart; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.sparepart.*; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; - -@Controller -@RequestMapping("/sparepart/goodsReserve") -public class GoodsReserveController { - @Resource - private GoodsReserveService goodsReserveService; - @Resource - private CompanyService companyService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by biz_id desc"; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and pid = '"+request.getParameter("search_code")+"'"; - } - - if (request.getParameter("bizId") != null && !request.getParameter("bizId").isEmpty()) { - List companyList = companyService.selectListByWhere("where pid = '" + request.getParameter("bizId") + "'"); - String ids = request.getParameter("bizId") + ","; - for(Company company : companyList){ - ids+= company.getId()+","; - } - ids = ids.replace(",", "','"); - wherestr += " and biz_id in ('" + ids +"')"; - } - - PageHelper.startPage(page, rows); - List list = this.goodsReserveService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - model.addAttribute("pid", request.getParameter("pid")); - model.addAttribute("bizId", request.getParameter("bizId")); - return "/sparepart/goodsReserveAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute GoodsReserve goodsReserve) { - User cu = (User) request.getSession().getAttribute("cu"); - List goodsReserveList = this.goodsReserveService.selectListByWhere("where biz_id='"+goodsReserve.getBizId()+"' and " + - "pid = '" + goodsReserve.getPid() + "'"); - int result = 0; - if(goodsReserveList!=null && goodsReserveList.size()>0){ - result = 2; - }else{ - goodsReserve.setId(CommUtil.getUUID()); - result = this.goodsReserveService.save(goodsReserve); - } - String resultstr = "{\"res\":\""+result+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/deleteByWhere.do") - public String deleteByWhere(HttpServletRequest request,Model model, - @RequestParam(value = "bizId") String bizId) { - int result = this.goodsReserveService.deleteByWhere("where bizId = '" + bizId + "'"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.goodsReserveService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - int result = this.goodsReserveService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - GoodsReserve goodsReserve = this.goodsReserveService.selectById(id); - model.addAttribute("goodsReserve", goodsReserve); - return "/sparepart/goodsReserveEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute GoodsReserve goodsReserve) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.goodsReserveService.update(goodsReserve); - String resstr="{\"res\":\""+result+"\",\"id\":\""+goodsReserve.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - GoodsReserve goodsReserve = this.goodsReserveService.selectById(id); - model.addAttribute("goodsReserve", goodsReserve); - return "/sparepart/goodsReserveView"; - } -} diff --git a/src/com/sipai/controller/sparepart/InStockRecordController.java b/src/com/sipai/controller/sparepart/InStockRecordController.java deleted file mode 100644 index bbd195d8..00000000 --- a/src/com/sipai/controller/sparepart/InStockRecordController.java +++ /dev/null @@ -1,750 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadPoolExecutor; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.sparepart.*; -import com.sipai.service.sparepart.*; -import com.sipai.tools.ThreadPoolUpdateMoney; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.async.DeferredResult; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/inStockRecord") -public class InStockRecordController { - @Resource - private InStockRecordService inStockRecordService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private UnitService unitService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/inStockRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and id like '%"+request.getParameter("search_name")+"%'"; - } - if (StringUtils.isNotBlank(request.getParameter("fareAdjustment")) && !"3".equals(request.getParameter("fareAdjustment"))) { - wherestr += " and fare_adjustment = '"+request.getParameter("fareAdjustment")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.inStockRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-DJRK-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/inStockRecordAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute InStockRecord inStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - inStockRecord.setInsdt(CommUtil.nowDate()); - inStockRecord.setInsuser(cu.getId()); - int result = this.inStockRecordService.save(inStockRecord); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+inStockRecord.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.inStockRecordService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.inStockRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - InStockRecord inStockRecord = this.inStockRecordService.selectById(id); - model.addAttribute("inStockRecord", inStockRecord); - return "/sparepart/inStockRecordEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute InStockRecord inStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - inStockRecord.setInsdt(CommUtil.nowDate()); - inStockRecord.setInsuser(cu.getId()); - int result = this.inStockRecordService.updateByVat(inStockRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+inStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - InStockRecord inStockRecord = this.inStockRecordService.selectById(id); - if (inStockRecord.getFareAdjustment() != null) { - if (inStockRecord.getFareAdjustment() == 1) { - inStockRecord.setFareAdjustmentText("是"); - } else { - inStockRecord.setFareAdjustmentText("否"); - } - } - if (inStockRecord.getVatInvoice() != null) { - if (inStockRecord.getVatInvoice() == 1) { - inStockRecord.setVatInvoiceText("是"); - } else { - inStockRecord.setVatInvoiceText("否"); - } - } - model.addAttribute("inStockRecord", inStockRecord); - return "/sparepart/inStockRecordView"; - } - /** - * 获取入库记录的明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getInStockDetailList.do") - public ModelAndView getInStockDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and instock_record_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("type")!= null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '"+request.getParameter("type")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.inStockRecordDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 新增入库记录明细,选择采购记录明细界面 - */ - @RequestMapping("/selectPRDetailForInStockDetails.do")//PRDetail是purchaseRecordDetail的简写 - public String doselectPRDetailForInStockDetails (HttpServletRequest request,Model model) { - String whereStr = "where status = '"+SparePartCommString.STATUS_COMEIN+"'"; - if (request.getParameter("companyId")!= null && !request.getParameter("companyId").isEmpty()) { - whereStr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - //在打开采购计划明细界面时,先查询审核完成的申购单,为采购计划明细列表查询提供条件 - Listlist = this.purchaseRecordService.selectListByWhere(whereStr); - String purchaseRecordIds = ""; - if (list != null && list.size() > 0) { - for (PurchaseRecord item : list) { - if (purchaseRecordIds != "") { - purchaseRecordIds+= ","; - } - purchaseRecordIds+= item.getId(); - } - } - String PRDetailIds = request.getParameter("PRDetailIds"); - if(PRDetailIds!=null && !PRDetailIds.isEmpty()){ - String[] id_Array= PRDetailIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("PRDetailIds", jsonArray); - } - model.addAttribute("purchaseRecordIds",purchaseRecordIds); - return "/sparepart/purchaseRecordDetail4Selects"; - } - /** - * 入库明细修改数量或价格后更新,同时更新明细的合计金额 及不含税单价合计 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateInStockDetail.do") - public String doupdateInStockDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - String includeTaxratePrice = request.getParameter("includeTaxratePrice");//含税价格 - InStockRecordDetail inStockRecordDetail = this.inStockRecordDetailService.selectById(id); - inStockRecordDetail.setInstockNumber(new BigDecimal(number)); - inStockRecordDetail.setPrice(new BigDecimal(price)); - inStockRecordDetail.setIncludeTaxratePrice(new BigDecimal(includeTaxratePrice)); - if (StringUtils.isNotBlank(request.getParameter("sum"))) { - inStockRecordDetail.setTaxrate(new BigDecimal(request.getParameter("sum"))); - } - if (StringUtils.isNotBlank(request.getParameter("v"))) { - inStockRecordDetail.setV(Integer.valueOf(request.getParameter("v"))); - } - int result = this.inStockRecordDetailService.update(inStockRecordDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+inStockRecordDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 入库明细修改数量或价格后更新,同时更新明细的合计金额 及 含税单价及合计 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateInStockDetail_ITP_total.do") - public String updateInStockDetail_ITP_total(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - String includeTaxratePrice = request.getParameter("includeTaxratePrice");//含税价格 - InStockRecordDetail inStockRecordDetail = this.inStockRecordDetailService.selectById(id); - inStockRecordDetail.setInstockNumber(new BigDecimal(number)); - inStockRecordDetail.setPrice(new BigDecimal(price)); - inStockRecordDetail.setIncludeTaxratePrice(new BigDecimal(includeTaxratePrice)); - int result = this.inStockRecordDetailService.updateInStockDetail_ITP_total(inStockRecordDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+inStockRecordDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 入库明细修改合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateInStockDetail_total.do") - public String doupdateInStockDetail_total(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String totalMoney = request.getParameter("totalMoney");//合计 - String includeTaxrateTotalMoney = request.getParameter("includeTaxrateTotalMoney");//含税合计 - InStockRecordDetail inStockRecordDetail = this.inStockRecordDetailService.selectById(id); - inStockRecordDetail.setTotalMoney(new BigDecimal(totalMoney)); - inStockRecordDetail.setIncludeTaxrateTotalMoney(new BigDecimal(includeTaxrateTotalMoney)); - int result = this.inStockRecordDetailService.update_total(inStockRecordDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+inStockRecordDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 入库记录明细选择采购记录明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveInStockRecordDetails.do") - public String dosaveInStockRecordDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String PRDetailIds = request.getParameter("PRDetailIds");//PRDetail是purchaseRecordDetail的简写 - String instockRecordId = request.getParameter("instockRecordId"); - String[] idArrary = PRDetailIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - PurchaseRecordDetail purchaseRecordDetail = this.purchaseRecordDetailService.selectById(str); - Listlist = this.inStockRecordDetailService.selectListByWhere("where instock_record_id ='"+instockRecordId+"' and purchase_record_detail_id ='"+str+"'"); - if (list == null || list.size() == 0) { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setId(CommUtil.getUUID()); - inStockRecordDetail.setInsdt(CommUtil.nowDate()); - inStockRecordDetail.setInsuser(cu.getId()); - inStockRecordDetail.setGoodsId(purchaseRecordDetail.getGoodsId()); - inStockRecordDetail.setInstockNumber(purchaseRecordDetail.getNumber()); - inStockRecordDetail.setInstockRecordId(instockRecordId); - inStockRecordDetail.setIncludeTaxratePrice(purchaseRecordDetail.getPrice()); - inStockRecordDetail.setDeptId(purchaseRecordDetail.getDeptId()); - inStockRecordDetail.setSupplierId(purchaseRecordDetail.getSupplierId()); - inStockRecordDetail.setPurchaseRecordDetailId(purchaseRecordDetail.getId()); - inStockRecordDetail.setType(SparePartCommString.INSTOCK_PURCHASE); - result = this.inStockRecordDetailService.save(inStockRecordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.inStockRecordDetailService.selectListByWhere("where instock_record_id = '"+instockRecordId+"' and type = '"+SparePartCommString.INSTOCK_PURCHASE+"'"); - for (InStockRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getPurchaseRecordDetailId()); - if (!isInArray) { - result = this.inStockRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 入库记录明细选择其他物品明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveOtherDetails.do") - public String dosaveOtherDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String goodsIds = request.getParameter("goodsIds"); - String instockRecordId = request.getParameter("instockRecordId"); - String[] idArrary = goodsIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - Listlist = this.inStockRecordDetailService.selectListByWhere("where instock_record_id ='"+instockRecordId+"' and goods_id ='"+str+"' and type = '"+SparePartCommString.INSTOCK_OTHER+"'"); - if (list == null || list.size() == 0) { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setId(CommUtil.getUUID()); - inStockRecordDetail.setInsdt(CommUtil.nowDate()); - inStockRecordDetail.setInsuser(cu.getId()); - inStockRecordDetail.setGoodsId(str); - inStockRecordDetail.setInstockNumber(new BigDecimal(0)); - inStockRecordDetail.setInstockRecordId(instockRecordId); - inStockRecordDetail.setPrice(new BigDecimal(0)); - inStockRecordDetail.setType(SparePartCommString.INSTOCK_OTHER); - result = this.inStockRecordDetailService.save(inStockRecordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.inStockRecordDetailService.selectListByWhere("where instock_record_id = '"+instockRecordId+"' and type = '"+SparePartCommString.INSTOCK_OTHER+"'"); - for (InStockRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary,item.getGoodsId()); - if (!isInArray) { - result = this.inStockRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除入库明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesInStockRecordDetail.do") - public String dodeletesInStockRecordDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.inStockRecordDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - /** - * 更新,启动入库审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute InStockRecord inStockRecord){ - User cu= (User)request.getSession().getAttribute("cu"); - inStockRecord.setInsuser(cu.getId()); - inStockRecord.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.inStockRecordService.startProcess(inStockRecord); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+inStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看入库处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessInStockView.do") - public String showProcessInStockView(HttpServletRequest request,Model model){ - String inStockRecordId = request.getParameter("id"); - InStockRecord inStockRecord = this.inStockRecordService.selectById(inStockRecordId); - request.setAttribute("business", inStockRecord); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(inStockRecord); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(inStockRecord.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_IN_STOCK_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+inStockRecordId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_IN_STOCK_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+inStockRecordId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = inStockRecord.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(inStockRecord.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/inStockExecuteViewInModal"; - }else{ - return "sparepart/inStockExecuteView"; - } - } - /** - * 显示入库审核 - * */ - @RequestMapping("/showAuditInStock.do") - public String showAuditInStock(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String inStockRecordId= pInstance.getBusinessKey(); - InStockRecord inStockRecord = this.inStockRecordService.selectById(inStockRecordId); - - if (inStockRecord.getFareAdjustment() != null) { - if (inStockRecord.getFareAdjustment() == 1) { - inStockRecord.setFareAdjustmentText("是"); - } else { - inStockRecord.setFareAdjustmentText("否"); - } - } - if (inStockRecord.getVatInvoice() != null) { - if (inStockRecord.getVatInvoice() == 1) { - inStockRecord.setVatInvoiceText("是"); - } else { - inStockRecord.setVatInvoiceText("否"); - } - } - model.addAttribute("inStockRecord", inStockRecord); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/inStockAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/AuditInStockRecord.do") - public String doAuditInStockRecord(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.inStockRecordService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示入库业务处理 - * */ - @RequestMapping("/showInStockHandle.do") - public String showInStockHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String inStockRecordId = pInstance.getBusinessKey(); - InStockRecord inStockRecord = this.inStockRecordService.selectById(inStockRecordId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+inStockRecordId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("inStockRecord", inStockRecord); - return "sparepart/inStockRecordHandle"; - } - /** - * 流程流程,入库业务处理提交 - * */ - @RequestMapping("/submitInStockHandle.do") - public String dosubmitInStockHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.inStockRecordService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 异步后期补票方法todo - * @return - */ - @RequestMapping("/deferredResult.do") - public String deferredResult(HttpServletRequest request,Model model) { - String id = request.getParameter("id"); - CompletableFuture.supplyAsync(()-> inStockRecordService.doBusiness(id), Executors.newFixedThreadPool(1)).whenCompleteAsync((result, throwable)->{ }); - return "1"; - } - -} diff --git a/src/com/sipai/controller/sparepart/OutStockRecordController.java b/src/com/sipai/controller/sparepart/OutStockRecordController.java deleted file mode 100644 index b8601f17..00000000 --- a/src/com/sipai/controller/sparepart/OutStockRecordController.java +++ /dev/null @@ -1,789 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.sparepart.*; -import com.sipai.service.sparepart.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/outStockRecord") -public class OutStockRecordController { - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private UnitService unitService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private InOutDeatilService inOutDeatilService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - - - /** - * 打开物资领用界面 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/applyMaterialList"; - } - /** - * 打开出库记录界面 - */ - @RequestMapping("/showOutStockRecordList.do") - public String showOutStockRecordList(HttpServletRequest request, Model model) { - return "/sparepart/outStockRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - wherestr += " and status = '"+request.getParameter("status")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and id like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.outStockRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-WZLY-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/applyMaterialAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute OutStockRecord outStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - outStockRecord.setInsdt(CommUtil.nowDate()); - outStockRecord.setInsuser(cu.getId()); - int result = this.outStockRecordService.save(outStockRecord); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+outStockRecord.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.outStockRecordService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.outStockRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/applyMaterialEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute OutStockRecord outStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - outStockRecord.setInsdt(CommUtil.nowDate()); - outStockRecord.setInsuser(cu.getId()); - int result = this.outStockRecordService.update(outStockRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+outStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/outStockRecordView"; - } - @RequestMapping("/edit4Equ.do") - public String edit4Equ(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/outStockRecordView4Equ"; - } - - @RequestMapping("/edit4EquDetail.do") - public String edit4EquDetail(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - return "/sparepart/outStockRecordView4EquDetail"; - } - - /** - * 更新设备-领用时间 - */ - @RequestMapping("/save4EquDetail.do") - public String save4EquDetail(HttpServletRequest request,Model model){ - String equipmentCardId = request.getParameter("equipmentCardId"); - String receiveTime = request.getParameter("receiveTime"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentCardId); - equipmentCard.setReceiveTime(receiveTime); - int result = this.equipmentCardService.update(equipmentCard); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCard.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取出库记录的明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getOutStockDetailList.do") - public ModelAndView getOutStockDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and outstock_record_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("insuser")!= null && !request.getParameter("insuser").isEmpty()) { - wherestr += " and insuser = '"+cu.getId()+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.outStockRecordDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 新增物资领用明细,选择库存明细界面 - */ - @RequestMapping("/selectStockForOutStockDetails.do")//PRDetail是purchaseRecordDetail的简写 - public String doselectStockForOutStockDetails (HttpServletRequest request,Model model) { - String stockIds = request.getParameter("stockIds"); - if(stockIds!=null && !stockIds.isEmpty()){ - String[] id_Array= stockIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("stockIds", jsonArray); - } - return "/sparepart/stock4Selects"; - } - /** - * 物资领用明细选择库存明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveOutStockRecordDetails.do") - public String dosaveOutStockRecordDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String stockIds = request.getParameter("stockIds"); - String outstockRecordId = request.getParameter("outstockRecordId"); - String[] idArrary = stockIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - Stock stock = this.stockService.selectById(str); - Listlist = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id ='"+outstockRecordId+"' and stock_id ='"+str+"'"); - if (list == null || list.size() == 0) { - OutStockRecordDetail outStockRecordDetail = new OutStockRecordDetail(); - outStockRecordDetail.setId(CommUtil.getUUID()); - outStockRecordDetail.setInsdt(CommUtil.nowDate()); - outStockRecordDetail.setInsuser(cu.getId()); - outStockRecordDetail.setGoodsId(stock.getGoodsId()); - outStockRecordDetail.setOutstockRecordId(outstockRecordId); - //outStockRecordDetail.setIncludedTaxTotalMoney(stock.getIncludedTaxTotalMoney()); - outStockRecordDetail.setIncludedTaxCostPrice(stock.getIncludedTaxCostPrice()); - try { - // 平均法 - if (stock.getWarehouse().getOutboundType() == SparePartCommString.W_AVG ) { - outStockRecordDetail.setPrice(stock.getTotalMoney().divide(stock.getNowNumber(), 2, RoundingMode.HALF_UP)); - } else { - outStockRecordDetail.setPrice(stock.getCostPrice()); - } - } catch (ArithmeticException e) { - outStockRecordDetail.setPrice(new BigDecimal(0)); - } - - outStockRecordDetail.setStockId(stock.getId()); - result = this.outStockRecordDetailService.save(outStockRecordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id = '"+outstockRecordId+"'"); - for (OutStockRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getStockId()); - if (!isInArray) { - result = this.outStockRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除物资领用明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesOutStockRecordDetail.do") - public String dodeletesOutStockRecordDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.outStockRecordDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - /** - * 领用明细修改数量后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateOutStockDetail.do") - public String doupdateOutStockDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - String result = this.outStockRecordDetailService.updateTotalMoney(id, number, price); - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 更新,启动出库(物资领用)审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute OutStockRecord outStockRecord){ - User cu= (User)request.getSession().getAttribute("cu"); - outStockRecord.setInsuser(cu.getId()); - outStockRecord.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.outStockRecordService.startProcess(outStockRecord); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+outStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看出库(物资领用)处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessOutStockView.do") - public String showProcessOutStockView(HttpServletRequest request,Model model){ - String outStockRecordId = request.getParameter("id"); - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordId); - request.setAttribute("business", outStockRecord); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(outStockRecord); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(outStockRecord.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_OUT_STOCK_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+outStockRecordId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_OUT_STOCK_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+outStockRecordId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = outStockRecord.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(outStockRecord.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/outStockExecuteViewInModal"; - }else{ - return "sparepart/outStockExecuteView"; - } - } - /** - * 显示出库(物资领用)审核 - * */ - @RequestMapping("/showAuditOutStock.do") - public String showAuditOutStock(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String outStockRecordId= pInstance.getBusinessKey(); - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordId); - model.addAttribute("outStockRecord", outStockRecord); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/outStockAudit"; - } - /** - * 流程流转-出库审核 - * */ - @RequestMapping("/AuditOutStockRecord.do") - public String doAuditOutStockRecord(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.outStockRecordService.doAudit(businessUnitAudit); - // 进行可用数量缩减 - // 1. 查出当前出库物品 - OutStockRecord outStockRecord = outStockRecordService.selectById(businessUnitAudit.getBusinessid()); - List outStockRecordDetails = outStockRecordDetailService.selectListByWhere("where outstock_record_id = '" + outStockRecord.getId() + "'"); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - List stocks = stockService.selectListByWhere(" s.goods_id = '" + outStockRecordDetail.getGoodsId() + "'" + - " and warehouse_id = '" + outStockRecord.getWarehouseId() + - "' and included_tax_cost_price = " + outStockRecordDetail.getIncludedTaxCostPrice()); - for (Stock stock : stocks) { - if (!businessUnitAudit.getPassstatus()) { - stock.setAvailableNumber(stock.getAvailableNumber().add(outStockRecordDetail.getOutNumber())); - } - stockService.update(stock); - } - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示出库(物资领用)业务处理 - * */ - @RequestMapping("/showOutStockHandle.do") - public String showOutStockHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String outStockRecordId = pInstance.getBusinessKey(); - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+outStockRecordId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("outStockRecord", outStockRecord); - return "sparepart/applyMaterialHandle"; - } - /** - * 流程流程,出库(物资领用)业务处理提交 - * */ - @Transactional - @RequestMapping("/submitOutStockHandle.do") - public String dosubmitOutStockHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.outStockRecordService.updateStatus(businessUnitHandle.getBusinessid()); - // 进行可用数量缩减 - // 1. 查出当前出库物品 - OutStockRecord outStockRecord = outStockRecordService.selectById(businessUnitHandle.getBusinessid()); - List outStockRecordDetails = outStockRecordDetailService.selectListByWhere("where outstock_record_id = '" + outStockRecord.getId() + "'"); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - List stocks = stockService.selectListByWhere(" s.goods_id = '" + outStockRecordDetail.getGoodsId() + "'" + - " and warehouse_id = '" + outStockRecord.getWarehouseId() + - "' and included_tax_cost_price = " + outStockRecordDetail.getIncludedTaxCostPrice()); - for (Stock stock : stocks) { - stock.setAvailableNumber(stock.getAvailableNumber().subtract(outStockRecordDetail.getOutNumber())); - stockService.update(stock); - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 选择出库单,可多选 - * */ - @RequestMapping("/showOutStockForSelects.do") - public String showOutStockForSelects(HttpServletRequest request,Model model) { - String outStockIds = request.getParameter("outStockIds"); - if(outStockIds!=null && !outStockIds.isEmpty()){ - String[] id_Array= outStockIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("outStockIds", jsonArray); - } - return "/sparepart/outStockListForSelects"; - } - /** - * 选择出库单,可多选 - * */ - @RequestMapping("/getOutStockContents.do") - public String getOutStockContents(HttpServletRequest request,Model model) { - String outStockIds = request.getParameter("outStockIds"); - outStockIds = outStockIds.replace(",","','"); - ListoutStockRecords = this.outStockRecordService.selectListByWhere("where id in ('"+outStockIds+"')"); - String outContents = ""; - BigDecimal actualMoney = new BigDecimal(0); - for (OutStockRecord outStock :outStockRecords) { - ListoutDetails = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id = '"+outStock.getId()+"'"); - for (OutStockRecordDetail outDetail : outDetails) { - outContents += "使用"+outDetail.getGoods().getName()+outDetail.getOutNumber().doubleValue()+outDetail.getGoods().getUnit()+";"; - } - actualMoney = actualMoney.add(outStock.getTotalMoney()); - } - String resstr="{\"contents\":\""+outContents+"\",\"money\":\""+actualMoney.doubleValue()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/viewDetail.do") - public String doViewDetail(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/outStockRecordDetailView"; - } - - @RequestMapping("/getInOutDetailList.do") - public ModelAndView getInOutDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " id "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("id")!= null && !request.getParameter("id").isEmpty()) { - wherestr += " and outId = '"+request.getParameter("id")+"'"; - } - String type = request.getParameter("type"); - String result = ""; - if (Integer.valueOf(type) == SparePartCommString.W_AVG) { - OutStockRecordDetail outStockRecordDetail = outStockRecordDetailService.selectById(request.getParameter("id")); - InOutDeatil inOutDeatil = new InOutDeatil(); - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setPrice(outStockRecordDetail.getPrice()); - inStockRecordDetail.setTotalMoney(outStockRecordDetail.getTotalMoney()); - inOutDeatil.setInStockRecordDetail(inStockRecordDetail); - inOutDeatil.setNum(outStockRecordDetail.getOutNumber()); - JSONArray jsonArray = new JSONArray(); - jsonArray.add(inOutDeatil); - result = "{\"total\":"+1+",\"rows\":"+jsonArray+"}"; - } else { - List inOutDeatils = inOutDeatilService.selectListByWhere(wherestr + orderstr); - for (InOutDeatil inoutdeatil : inOutDeatils) { - if (StringUtils.isNotBlank(inoutdeatil.getInid())) { - InStockRecordDetail inStockRecordDetail = inStockRecordDetailService.selectById(inoutdeatil.getInid()); - inStockRecordDetail.setTotalMoney(inStockRecordDetail.getPrice().multiply(inoutdeatil.getNum())); - inoutdeatil.setInStockRecordDetail(inStockRecordDetail); - } - } - JSONArray jsonArray = JSONArray.fromObject(inOutDeatils); - result = "{\"total\":"+inOutDeatils.size()+",\"rows\":"+jsonArray+"}"; - } - - - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/sparepart/OutStockRecordSectionController.java b/src/com/sipai/controller/sparepart/OutStockRecordSectionController.java deleted file mode 100644 index 8c92f38a..00000000 --- a/src/com/sipai/controller/sparepart/OutStockRecordSectionController.java +++ /dev/null @@ -1,743 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.OutStockRecordDetail; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.sparepart.InStockRecordDetailService; -import com.sipai.service.sparepart.InStockRecordService; -import com.sipai.service.sparepart.OutStockRecordDetailService; -import com.sipai.service.sparepart.OutStockRecordService; -import com.sipai.service.sparepart.PurchaseRecordDetailService; -import com.sipai.service.sparepart.PurchaseRecordService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.sparepart.WarehouseService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/outStocksectionRecord") -public class OutStockRecordSectionController { - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private UnitService unitService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private WarehouseService warehouseService; - - /** - * 打开物资领用界面 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/applyMaterialSectionList"; - } - /** - * 打开出库记录界面 - */ - @RequestMapping("/showOutStockRecordList.do") - public String showOutStockRecordList(HttpServletRequest request, Model model) { - return "/sparepart/outStockRecordSectionList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - wherestr += " and status = '"+request.getParameter("status")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - wherestr += " and stock_type = '"+SparePartCommString.INSTOCK_SECTION+"'"; - PageHelper.startPage(page, rows); - List list = this.outStockRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-WZLY-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/applyMaterialSectionAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute OutStockRecord outStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - outStockRecord.setInsdt(CommUtil.nowDate()); - outStockRecord.setInsuser(cu.getId()); - outStockRecord.setStockType(SparePartCommString.INSTOCK_SECTION); - int result = this.outStockRecordService.save(outStockRecord); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+outStockRecord.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.outStockRecordService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.outStockRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - String pcompanyId = this.unitService.getCompById(outStockRecord.getBizId()).getPid(); - model.addAttribute("pcompanyId", pcompanyId); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/applyMaterialSectionEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute OutStockRecord outStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - outStockRecord.setInsdt(CommUtil.nowDate()); - outStockRecord.setInsuser(cu.getId()); - int result = this.outStockRecordService.updateSection(outStockRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+outStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/outStockRecordSectionView"; - } - @RequestMapping("/edit4Equ.do") - public String edit4Equ(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - return "/sparepart/outStockRecordView4Equ"; - } - - @RequestMapping("/edit4EquDetail.do") - public String edit4EquDetail(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(id); - model.addAttribute("outStockRecord", outStockRecord); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company",company); - return "/sparepart/outStockRecordView4EquDetail"; - } - - /** - * 更新设备-领用时间 - */ - @RequestMapping("/save4EquDetail.do") - public String save4EquDetail(HttpServletRequest request,Model model){ - String equipmentCardId = request.getParameter("equipmentCardId"); - String receiveTime = request.getParameter("receiveTime"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentCardId); - equipmentCard.setReceiveTime(receiveTime); - int result = this.equipmentCardService.update(equipmentCard); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentCard.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取出库记录的明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getOutStockDetailList.do") - public ModelAndView getOutStockDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and outstock_record_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.outStockRecordDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 新增物资领用明细,选择库存明细界面 - */ - @RequestMapping("/selectStockForOutStockDetails.do")//PRDetail是purchaseRecordDetail的简写 - public String doselectStockForOutStockDetails (HttpServletRequest request,Model model) { - String stockIds = request.getParameter("stockIds"); - if(stockIds!=null && !stockIds.isEmpty()){ - String[] id_Array= stockIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("stockIds", jsonArray); - } - return "/sparepart/stock4SectionSelects"; - } - /** - * 物资领用明细选择库存明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveOutStockRecordDetails.do") - public String dosaveOutStockRecordDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String stockIds = request.getParameter("stockIds"); - String outstockRecordId = request.getParameter("outstockRecordId"); - String[] idArrary = stockIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - Stock stock = this.stockService.selectById(str); - Listlist = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id ='"+outstockRecordId+"' and stock_id ='"+str+"'"); - if (list == null || list.size() == 0) { - OutStockRecordDetail outStockRecordDetail = new OutStockRecordDetail(); - outStockRecordDetail.setId(CommUtil.getUUID()); - outStockRecordDetail.setInsdt(CommUtil.nowDate()); - outStockRecordDetail.setInsuser(cu.getId()); - outStockRecordDetail.setGoodsId(stock.getGoodsId()); - outStockRecordDetail.setOutstockRecordId(outstockRecordId); - try { - outStockRecordDetail.setPrice(stock.getTotalMoney().divide(stock.getNowNumber(),2, RoundingMode.HALF_UP)); - } catch (ArithmeticException e) { - outStockRecordDetail.setPrice(new BigDecimal(0)); - } - outStockRecordDetail.setStockId(stock.getId()); - result = this.outStockRecordDetailService.save(outStockRecordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id = '"+outstockRecordId+"'"); - for (OutStockRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getStockId()); - if (!isInArray) { - result = this.outStockRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除物资领用明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesOutStockRecordDetail.do") - public String dodeletesOutStockRecordDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.outStockRecordDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - /** - * 领用明细修改数量后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateOutStockDetail.do") - public String doupdateOutStockDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - String result = this.outStockRecordDetailService.updateTotalMoney(id, number, price); - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 更新,启动出库(物资领用)审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute OutStockRecord outStockRecord){ - User cu= (User)request.getSession().getAttribute("cu"); - outStockRecord.setInsuser(cu.getId()); - outStockRecord.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.outStockRecordService.startSectionProcess(outStockRecord); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+outStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看出库(物资领用)处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessOutStockView.do") - public String showProcessOutStockView(HttpServletRequest request,Model model){ - String outStockRecordId = request.getParameter("id"); - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordId); - request.setAttribute("business", outStockRecord); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(outStockRecord); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(outStockRecord.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_SECTION_STOCK_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+outStockRecordId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_SECTION_STOCK_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+outStockRecordId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = outStockRecord.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(outStockRecord.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/outStockExecuteViewInModal"; - }else{ - return "sparepart/outStockExecuteView"; - } - } - /** - * 显示出库(物资领用)审核 - * */ - @RequestMapping("/showAuditOutStock.do") - public String showAuditOutStock(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String outStockRecordId= pInstance.getBusinessKey(); - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordId); - model.addAttribute("outStockRecord", outStockRecord); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/outStockSectionAudit"; - } - /** - * 流程流转-出库审核 - * */ - @RequestMapping("/AuditOutStockRecord.do") - public String doAuditOutStockRecord(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.outStockRecordService.doSectionAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示出库(物资领用)业务处理 - * */ - @RequestMapping("/showOutStockHandle.do") - public String showOutStockHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String outStockRecordId = pInstance.getBusinessKey(); - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+outStockRecordId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("outStockRecord", outStockRecord); - return "sparepart/applyMaterialSectionHandle"; - } - /** - * 流程流程,出库(物资领用)业务处理提交 - * */ - @Transactional - @RequestMapping("/submitOutStockHandle.do") - public String dosubmitOutStockHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.outStockRecordService.updateSectionStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 选择出库单,可多选 - * */ - @RequestMapping("/showOutStockForSelects.do") - public String showOutStockForSelects(HttpServletRequest request,Model model) { - String outStockIds = request.getParameter("outStockIds"); - if(outStockIds!=null && !outStockIds.isEmpty()){ - String[] id_Array= outStockIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("outStockIds", jsonArray); - } - return "/sparepart/outStockListForSelects"; - } - /** - * 选择出库单,可多选 - * */ - @RequestMapping("/getOutStockContents.do") - public String getOutStockContents(HttpServletRequest request,Model model) { - String outStockIds = request.getParameter("outStockIds"); - outStockIds = outStockIds.replace(",","','"); - ListoutStockRecords = this.outStockRecordService.selectListByWhere("where id in ('"+outStockIds+"')"); - String outContents = ""; - BigDecimal actualMoney = new BigDecimal(0); - for (OutStockRecord outStock :outStockRecords) { - ListoutDetails = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id = '"+outStock.getId()+"'"); - for (OutStockRecordDetail outDetail : outDetails) { - outContents += "使用"+outDetail.getGoods().getName()+outDetail.getOutNumber().doubleValue()+outDetail.getGoods().getUnit()+";"; - } - actualMoney = actualMoney.add(outStock.getTotalMoney()); - } - String resstr="{\"contents\":\""+outContents+"\",\"money\":\""+actualMoney.doubleValue()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 选择上级仓库 - * */ - @RequestMapping("/showinhouseIdForSelects.do") - public String showinhouseIdForSelects(HttpServletRequest request,Model model) { - String comId = request.getParameter("companyId"); - String companyId = ""; - /*String companyId = this.unitService.getCompById(comId).getPid();*/ - List companyList = this.unitService.getCompaniesByWhere("where pid='"+comId+"' "); - for(Company company : companyList){ - companyId+= company.getId()+","; - } - String wherestr = " where 1=1 "; - if(null!=companyId && !"".equals(companyId)){ - companyId = companyId.replace(",","','"); - wherestr += " and status = '"+SparePartCommString.WAREHOUSE_START+"' and biz_id in ('"+companyId+"') "; - }else{ - wherestr += " and status = '"+SparePartCommString.WAREHOUSE_START+"'"; - } - - List list = this.warehouseService.selectListByWhere(wherestr); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (Warehouse warehouse : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", warehouse.getId()); - jsonObject.put("text", warehouse.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/PerformanceController.java b/src/com/sipai/controller/sparepart/PerformanceController.java deleted file mode 100644 index 0e9d55d9..00000000 --- a/src/com/sipai/controller/sparepart/PerformanceController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Performance; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.PerformanceService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/performance") -public class PerformanceController { - @Resource - private PerformanceService performanceService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/performanceList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.performanceService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/performanceAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Performance performance) { - User cu = (User) request.getSession().getAttribute("cu"); - performance.setId(CommUtil.getUUID()); - performance.setInsdt(CommUtil.nowDate()); - performance.setInsuser(cu.getId()); - int result = this.performanceService.save(performance); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+performance.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.performanceService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.performanceService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Performance performance = this.performanceService.selectById(id); - model.addAttribute("performance", performance); - return "/sparepart/performanceEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Performance performance) { - User cu = (User) request.getSession().getAttribute("cu"); - performance.setInsdt(CommUtil.nowDate()); - performance.setInsuser(cu.getId()); - int result = this.performanceService.update(performance); - String resstr="{\"res\":\""+result+"\",\"id\":\""+performance.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Performance performance = this.performanceService.selectById(id); - model.addAttribute("performance", performance); - return "/sparepart/performanceView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getPerformance4Select.do") - public String getPerformance4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.performanceService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (Performance performance : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", performance.getId()); - jsonObject.put("text", performance.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/PurchaseMethodsController.java b/src/com/sipai/controller/sparepart/PurchaseMethodsController.java deleted file mode 100644 index 7ee4633f..00000000 --- a/src/com/sipai/controller/sparepart/PurchaseMethodsController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.PurchaseMethods; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.PurchaseMethodsService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/purchaseMethods") -public class PurchaseMethodsController { - @Resource - private PurchaseMethodsService purchaseMethodsService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/purchaseMethodsList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.purchaseMethodsService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/purchaseMethodsAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute PurchaseMethods purchaseMethods) { - User cu = (User) request.getSession().getAttribute("cu"); - purchaseMethods.setId(CommUtil.getUUID()); - purchaseMethods.setInsdt(CommUtil.nowDate()); - purchaseMethods.setInsuser(cu.getId()); - int result = this.purchaseMethodsService.save(purchaseMethods); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+purchaseMethods.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.purchaseMethodsService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.purchaseMethodsService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - PurchaseMethods purchaseMethods = this.purchaseMethodsService.selectById(id); - model.addAttribute("purchaseMethods", purchaseMethods); - return "/sparepart/purchaseMethodsEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute PurchaseMethods purchaseMethods) { - User cu = (User) request.getSession().getAttribute("cu"); - purchaseMethods.setInsdt(CommUtil.nowDate()); - purchaseMethods.setInsuser(cu.getId()); - int result = this.purchaseMethodsService.update(purchaseMethods); - String resstr="{\"res\":\""+result+"\",\"id\":\""+purchaseMethods.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - PurchaseMethods purchaseMethods = this.purchaseMethodsService.selectById(id); - model.addAttribute("purchaseMethods", purchaseMethods); - return "/sparepart/purchaseMethodsView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getPurchaseMethods4Select.do") - public String getPurchaseMethods4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.purchaseMethodsService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (PurchaseMethods purchaseMethods : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", purchaseMethods.getId()); - jsonObject.put("text", purchaseMethods.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/PurchasePlanController.java b/src/com/sipai/controller/sparepart/PurchasePlanController.java deleted file mode 100644 index 192e1ede..00000000 --- a/src/com/sipai/controller/sparepart/PurchasePlanController.java +++ /dev/null @@ -1,339 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.io.IOException; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.PurchaseDetailService; -import com.sipai.service.sparepart.PurchasePlanService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/purchasePlan") -public class PurchasePlanController { - @Resource - private GoodsService goodsService; - @Resource - private PurchasePlanService purchasePlanService; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private UnitService unitService; - @Resource - private SubscribeService subscribeService; - @Resource - private SubscribeDetailService subscribeDetailService; - - /** - * 采购计划界面 - */ - @RequestMapping("/showPurchasePlanList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/purchasePlanList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String type = request.getParameter("type"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where type = '"+type+"' "; - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - String status = request.getParameter("status").replace(",","','"); - wherestr += " and status in ('"+status+"')"; - } - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid is NULL or pid = ''"; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.purchasePlanService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute PurchasePlan purchasePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - purchasePlan.setInsdt(CommUtil.nowDate()); - purchasePlan.setInsuser(cu.getId()); - int result = this.purchasePlanService.save(purchasePlan); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+purchasePlan.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.purchasePlanService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.purchasePlanService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute PurchasePlan purchasePlan) { - User cu = (User) request.getSession().getAttribute("cu"); - purchasePlan.setInsdt(CommUtil.nowDate()); - purchasePlan.setInsuser(cu.getId()); - int result = this.purchasePlanService.update(purchasePlan); - String resstr="{\"res\":\""+result+"\",\"id\":\""+purchasePlan.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - PurchasePlan purchasePlan = this.purchasePlanService.selectById(id); - model.addAttribute("purchasePlan", purchasePlan); - return "/sparepart/purchasePlanView"; - } - - /** - * 新增申购计划界面 - */ - @RequestMapping("/addPurchasePlan.do") - public String doaddaddPurchasePlan (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = companyId+"-SGJH-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/purchasePlanAdd"; - } - - @RequestMapping("/editPurchasePlan.do") - public String doeditPurchasePlan(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - PurchasePlan purchasePlan = this.purchasePlanService.selectById(id); - model.addAttribute("purchasePlan", purchasePlan); - return "/sparepart/purchasePlanEdit"; - } - - /** - * 申购计划选择部门申购明细 - */ - @RequestMapping("/selectDepartmentPurchaseDetail.do") - public String doselectDepartmentPurchaseDetail (HttpServletRequest request,Model model) { - return "/sparepart/departmentPurchaseListForSelcts"; - } - @RequestMapping("/savePlanAndDeptPurchaseRelation.do") - public String dosavePlanAndDeptPurchaseRelation(HttpServletRequest request,Model model) { - String ids = request.getParameter("ids"); - String pid = request.getParameter("pid"); - ids = ids.replace(",","','"); - List list = this.purchasePlanService.selectListByWhere("where id in ('"+ids+"')"); - int result = 0; - for (PurchasePlan item : list) { - item.setPid(pid); - result += this.purchasePlanService.update(item); - } - model.addAttribute("result",result); - return "result"; - } - - /** - * 新增申购明细 - */ - @RequestMapping("/addPurchaseDetail.do") - public String doaddPurchaseDetail (HttpServletRequest request,Model model) { - String pid = request.getParameter("pid"); - model.addAttribute("pid",pid); - return "/sparepart/purchaseDetailAdd"; - } - - @RequestMapping("/savePurchaseDetail.do") - public String dosavePurchaseDetail(HttpServletRequest request,Model model, - @ModelAttribute PurchaseDetail purchaseDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - purchaseDetail.setId(CommUtil.getUUID()); - purchaseDetail.setInsdt(CommUtil.nowDate()); - purchaseDetail.setInsuser(cu.getId()); - int result = this.purchaseDetailService.save(purchaseDetail); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+purchaseDetail.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/getPurchaseDetailList.do") - public ModelAndView getPurchaseDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String type = request.getParameter("type"); - String pid = request.getParameter("pid"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = ""; - if (type.equals(SparePartCommString.PURCHASE_DEPARTMENT)) { - wherestr = " where pid = '"+pid+"' "; - }else if (type.equals(SparePartCommString.PURCHASE_PLAN)) { - ListpurchasePlans = this.purchasePlanService.selectListByWhere("where pid = '"+pid+"'"); - String ids =""; - for (PurchasePlan item : purchasePlans) { - if (ids != "") { - ids+= ","; - } - ids+=item.getId(); - } - ids = ids.replace(",","','"); - wherestr = " where pid in ('"+ids+"') "; - }else { - wherestr = " where 1=1 "; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.purchaseDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/editPurchaseDetail.do") - public String doeditPurchaseDetail(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - PurchaseDetail purchaseDetail = this.purchaseDetailService.selectById(id); - model.addAttribute("purchaseDetail", purchaseDetail); - return "/sparepart/purchaseDetailEdit"; - } - - @RequestMapping("/updatePurchaseDetail.do") - public String doupdatePurchaseDetail(HttpServletRequest request,Model model, - @ModelAttribute PurchaseDetail purchaseDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - purchaseDetail.setInsdt(CommUtil.nowDate()); - purchaseDetail.setInsuser(cu.getId()); - int result = this.purchaseDetailService.update(purchaseDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+purchaseDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deletesPurchaseDetail.do") - public String dodeletesPurchaseDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.purchaseDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - /** - * 导出明细表-沙口采购计划 - * @throws IOException - */ - @RequestMapping(value = "downloadSubscribeDetailExcel4Plan.do") - public ModelAndView downloadSubscribeDetailExcel4Plan(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String detailWherestr ="where id is not null "; - String detailOrderStr = " order by id "; - String subscribe_man = "";//申请人 - String subscribe_audit = "";//审核人 - if(request.getParameter("subscribeId")!=null && !request.getParameter("subscribeId").isEmpty()){ - String subscribeId = request.getParameter("subscribeId"); - Subscribe subscribe = this.subscribeService.selectById(subscribeId); - subscribe_man = subscribe.getSubscribeManName(); - subscribe_audit = subscribe.getSubscribeAuditName(); - detailWherestr +=" and subscribe_id in ('"+subscribeId+"') "; - detailOrderStr = " order by subscribe_id,id "; - } - if((request.getParameter("deptId")!=null && !request.getParameter("deptId").isEmpty()) - || (request.getParameter("subscribeDate")!=null && !request.getParameter("subscribeDate").isEmpty())){ - String deptId = request.getParameter("deptId"); - String subscribeDate = request.getParameter("subscribeDate");//yyyy-mm - String subscribeId = ""; - String wherestr =" where id is not null "; - String orderStr = " order by id "; - if(deptId!=null && !deptId.isEmpty()){ - wherestr +=" and dept_id ='"+deptId+"' "; - } - if(subscribeDate!=null && !subscribeDate.isEmpty()){ - wherestr +=" and year(subscribe_date)="+subscribeDate.substring(0, 4)+" and month(subscribe_date)="+subscribeDate.substring(5, 7)+" "; - } - List subscribeList = this.subscribeService.selectListByWhere(wherestr+orderStr); - if(subscribeList!=null && subscribeList.size()>0){ - for(Subscribe subscribe : subscribeList){ - subscribeId+= subscribe.getId()+","; - subscribe_man += subscribe.getSubscribeManName()+" "; - subscribe_audit += subscribe.getSubscribeAuditName()+" "; - } - subscribeId = subscribeId.replace(",","','"); - } - wherestr +=" and subscribe_id in ('"+subscribeId+"') "; - orderStr = " order by subscribe_id,id "; - } - ListsubscribeDetails = this.subscribeDetailService.selectListByWhere(detailWherestr+detailOrderStr); - //导出文件到指定目录,兼容Linux - this.subscribeDetailService.downloadSubscribeDetailExcel(response, subscribeDetails,subscribe_man,subscribe_audit); - return null; - } -} diff --git a/src/com/sipai/controller/sparepart/PurchaseRecordController.java b/src/com/sipai/controller/sparepart/PurchaseRecordController.java deleted file mode 100644 index ea2dd17e..00000000 --- a/src/com/sipai/controller/sparepart/PurchaseRecordController.java +++ /dev/null @@ -1,354 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.InStockRecordDetailService; -import com.sipai.service.sparepart.PurchaseDetailService; -import com.sipai.service.sparepart.PurchasePlanService; -import com.sipai.service.sparepart.PurchaseRecordDetailService; -import com.sipai.service.sparepart.PurchaseRecordService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sun.tools.xjc.generator.bean.ImplStructureStrategy.Result; - -@Controller -@RequestMapping("/sparepart/purchaseRecord") -public class PurchaseRecordController { - @Resource - private GoodsService goodsService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private UnitService unitService; - @Resource - private SubscribeService subscribeService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/purchaseRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1"; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and id like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.purchaseRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-CGJL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/purchaseRecordAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - PurchaseRecord purchaseRecord = this.purchaseRecordService.selectById(id); - model.addAttribute("purchaseRecord", purchaseRecord); - return "/sparepart/purchaseRecordEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute PurchaseRecord purchaseRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - purchaseRecord.setInsdt(CommUtil.nowDate()); - purchaseRecord.setInsuser(cu.getId()); - purchaseRecord.setAuditManId(cu.getId()); - int result = this.purchaseRecordService.save(purchaseRecord); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+purchaseRecord.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.purchaseRecordService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.purchaseRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute PurchaseRecord purchaseRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - purchaseRecord.setInsdt(CommUtil.nowDate()); - purchaseRecord.setInsuser(cu.getId()); - int result = this.purchaseRecordService.update(purchaseRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+purchaseRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - PurchaseRecord purchaseRecord = this.purchaseRecordService.selectById(id); - model.addAttribute("purchaseRecord", purchaseRecord); - return "/sparepart/purchaseRecordView"; - } - /** - * 新增采购记录明细,选择采购计划明细界面 - */ - @RequestMapping("/selectPurchaseDetails.do") - public String doselectPurchaseDetails (HttpServletRequest request,Model model) { - //在打开采购计划明细界面时,先查询审核完成的申购单,为采购计划明细列表查询提供条件 - Listlist = this.subscribeService.selectListByWhere("where status = '"+SparePartCommString.STATUS_FINISH+"'"); - String subscribeIds = ""; - if (list != null && list.size() > 0) { - for (Subscribe item : list) { - if (subscribeIds != "") { - subscribeIds+= ","; - } - subscribeIds+= item.getId(); - } - } - String subscribeDetailIds = request.getParameter("subscribeDetailIds"); - if(subscribeDetailIds!=null && !subscribeDetailIds.isEmpty()){ - String[] id_Array= subscribeDetailIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("subscribeDetailIds", jsonArray); - } - model.addAttribute("subscribeIds",subscribeIds); - return "/sparepart/purchaseDetail4Selects"; - } - - /** - *获取采购记录的明细列表 - */ - @RequestMapping("/getPurchaseRecordDetailList.do") - public ModelAndView getPurchaseRecordDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String type = request.getParameter("type"); - String pid = request.getParameter("pid"); - sort = " tsp.insdt "; - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and tspd.record_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and tspd.dept_id = '"+request.getParameter("search_code")+"'"; - } -// if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; -// } - //选择入库记录明细时用到,加载出所有完成审核的采购记录单的明细 - if (request.getParameter("pids")!= null && !request.getParameter("pids").isEmpty()) { - String pids = request.getParameter("pids"); - pids = pids.replace(",","','"); - wherestr += " and tspd.record_id in ('"+pids+"')"; - } - if (StringUtils.isNotBlank(request.getParameter("bizId"))) { - String bizId = request.getParameter("bizId"); - wherestr += " and tsp.biz_id = '" + bizId + "'"; - } - PageHelper.startPage(page, rows); -// List list = this.purchaseRecordDetailService.selectListByWhere(wherestr+orderstr, request.getParameter("search_name")); - List list = this.purchaseRecordDetailService.selectDetailListByWhere(wherestr+orderstr, request.getParameter("search_name")); - if (request.getParameter("pids")!= null && !request.getParameter("pids").isEmpty()) { - List recordDetails = new ArrayList<>(); - for (PurchaseRecordDetail itemDetail : list) { - List inStockRecordDetails = this.inStockRecordDetailService.selectListByWhere("where purchase_record_detail_id ='"+itemDetail.getId()+"' "); - if (inStockRecordDetails == null || inStockRecordDetails.size()==0) { - recordDetails.add(itemDetail); - } - } - list = recordDetails; - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+list.size()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 采购记录明细选择采购计划明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/savePurchaseRecordDetails.do") - public String dosavePurchaseRecordDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String ids = request.getParameter("ids"); - String recordId = request.getParameter("recordId"); - String[] idArrary = ids.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - SubscribeDetail subscribeDetail = this.subscribeDetailService.selectById(str); - Listlist = this.purchaseRecordDetailService.selectListByWhere("where record_id ='"+recordId+"' and subscribe_detail_id ='"+str+"'"); - if (list == null || list.size() == 0) { - PurchaseRecordDetail recordDetail = new PurchaseRecordDetail(); - recordDetail.setId(CommUtil.getUUID()); - recordDetail.setInsdt(CommUtil.nowDate()); - recordDetail.setInsuser(cu.getId()); - recordDetail.setGoodsId(subscribeDetail.getGoodsId()); - recordDetail.setRecordId(recordId); - recordDetail.setDeptId(subscribeDetail.getDeptId()); - recordDetail.setPrice(subscribeDetail.getPrice()); - recordDetail.setSubscribeDetailId(subscribeDetail.getId()); - result = this.purchaseRecordDetailService.save(recordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.purchaseRecordDetailService.selectListByWhere("where record_id = '"+recordId+"'"); - for (PurchaseRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getSubscribeDetailId()); - if (!isInArray) { - result = this.purchaseRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 申购明细修改数量或价格后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updatePurchaseRecordDetail.do") - public String doupdatePurchaseRecordDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - String result = this.purchaseRecordDetailService.updateTotalMoney(id, number, price); - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deletesPurchaseRecordDetail.do") - public String dodeletesPurchaseRecordDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.purchaseRecordDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - /** - * 获取供应商 - * */ - @RequestMapping("/getPurchase4Select.do") - public String getPurchaseRecord4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.purchaseRecordService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (PurchaseRecord purchaseRecord : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", purchaseRecord.getId()); - jsonObject.put("text", purchaseRecord.getId()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/PurposeController.java b/src/com/sipai/controller/sparepart/PurposeController.java deleted file mode 100644 index 60e7f5fb..00000000 --- a/src/com/sipai/controller/sparepart/PurposeController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Purpose; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.PurposeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/purpose") -public class PurposeController { - @Resource - private PurposeService purposeService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/purposeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.purposeService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/purposeAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Purpose purpose) { - User cu = (User) request.getSession().getAttribute("cu"); - purpose.setId(CommUtil.getUUID()); - purpose.setInsdt(CommUtil.nowDate()); - purpose.setInsuser(cu.getId()); - int result = this.purposeService.save(purpose); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+purpose.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.purposeService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.purposeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Purpose purpose = this.purposeService.selectById(id); - model.addAttribute("purpose", purpose); - return "/sparepart/purposeEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Purpose purpose) { - User cu = (User) request.getSession().getAttribute("cu"); - purpose.setInsdt(CommUtil.nowDate()); - purpose.setInsuser(cu.getId()); - int result = this.purposeService.update(purpose); - String resstr="{\"res\":\""+result+"\",\"id\":\""+purpose.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Purpose purpose = this.purposeService.selectById(id); - model.addAttribute("purpose", purpose); - return "/sparepart/purposeView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getPurpose4Select.do") - public String getPurpose4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.purposeService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (Purpose purpose : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", purpose.getId()); - jsonObject.put("value", purpose.getName()); - jsonObject.put("text", purpose.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/QualificationTypeController.java b/src/com/sipai/controller/sparepart/QualificationTypeController.java deleted file mode 100644 index b5dfc393..00000000 --- a/src/com/sipai/controller/sparepart/QualificationTypeController.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.image.SVGComposite.ScreenCompositeContext; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.sparepart.QualificationType; -import com.sipai.entity.sparepart.Score; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.sparepart.SupplierClass; -import com.sipai.entity.sparepart.SupplierQualification; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.QualificationTypeService; -import com.sipai.service.sparepart.SupplierQualificationService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DateUtil; - -@Controller -@RequestMapping("/sparepart/qualificationType") -public class QualificationTypeController { - - @Resource - private SupplierQualificationService supplierQualificationService; - @Resource - private QualificationTypeService qualificationTypeService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/qualificationTypeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - - - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and type_name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.qualificationTypeService.selectListByWhere(wherestr+orderstr); - - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - System.out.println(jsonArray); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model,HttpServletResponse response) { - - - return "/sparepart/qualificationTypeAdd"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model,HttpSession session, - @ModelAttribute QualificationType qualificationType) { - User cu = (User) request.getSession().getAttribute("cu"); - qualificationType.setId(CommUtil.getUUID()); - qualificationType.setInsdt(CommUtil.nowDate()); - qualificationType.setInsuser(cu.getId()); - - - int result = this.qualificationTypeService.save(qualificationType); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+qualificationType.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - QualificationType qualificationType = this.qualificationTypeService.selectById(id); - model.addAttribute("qualificationType", qualificationType); - return "/sparepart/qualificationTypeView"; - } - - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - QualificationType qualificationType = this.qualificationTypeService.selectById(id); - - model.addAttribute("qualificationType", qualificationType); - return "/sparepart/qualificationTypeEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute QualificationType qualificationType) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.qualificationTypeService.update(qualificationType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+qualificationType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.qualificationTypeService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - System.out.println("%%%%%%%"+ids); - int result = this.qualificationTypeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/sparepart/QualificationType_copyController.java b/src/com/sipai/controller/sparepart/QualificationType_copyController.java deleted file mode 100644 index 0d0eda5e..00000000 --- a/src/com/sipai/controller/sparepart/QualificationType_copyController.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.image.SVGComposite.ScreenCompositeContext; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.QualificationType_copy; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.QualificationType_copyService; -import com.sipai.service.sparepart.SupplierQualification_copyService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/qualificationType_copy") -public class QualificationType_copyController { - - @Resource - private SupplierQualification_copyService supplierQualification_copyService; - @Resource - private QualificationType_copyService qualificationType_copyService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/qualificationType_copyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - - - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and type_name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.qualificationType_copyService.selectListByWhere(wherestr+orderstr); - - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - System.out.println(jsonArray); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model,HttpServletResponse response) { - - - return "/sparepart/qualificationType_copyAdd"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model,HttpSession session, - @ModelAttribute QualificationType_copy qualificationType) { - User cu = (User) request.getSession().getAttribute("cu"); - qualificationType.setId(CommUtil.getUUID()); - qualificationType.setInsdt(CommUtil.nowDate()); - qualificationType.setInsuser(cu.getId()); - - - int result = this.qualificationType_copyService.save(qualificationType); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+qualificationType.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - QualificationType_copy qualificationType = this.qualificationType_copyService.selectById(id); - model.addAttribute("qualificationType", qualificationType); - return "/sparepart/qualificationType_copyView"; - } - - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - QualificationType_copy qualificationType = this.qualificationType_copyService.selectById(id); - - model.addAttribute("qualificationType", qualificationType); - return "/sparepart/qualificationType_copyEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute QualificationType_copy qualificationType) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.qualificationType_copyService.update(qualificationType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+qualificationType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.qualificationType_copyService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - System.out.println("%%%%%%%"+ids); - int result = this.qualificationType_copyService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/sparepart/RawMaterialController.java b/src/com/sipai/controller/sparepart/RawMaterialController.java deleted file mode 100644 index 5aab2d33..00000000 --- a/src/com/sipai/controller/sparepart/RawMaterialController.java +++ /dev/null @@ -1,611 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.sparepart.RawMaterial; -import com.sipai.entity.sparepart.RawMaterialDetail; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.sparepart.RawMaterialDetailService; -import com.sipai.service.sparepart.RawMaterialService; -import com.sipai.service.sparepart.PurchaseRecordDetailService; -import com.sipai.service.sparepart.PurchaseRecordService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/rawMaterial") -public class RawMaterialController { - @Resource - private RawMaterialService rawMaterialService; - @Resource - private RawMaterialDetailService rawMaterialDetailService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/rawMaterialList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.rawMaterialService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-YJDJ-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/rawMaterialAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute RawMaterial rawMaterial) { - User cu = (User) request.getSession().getAttribute("cu"); - rawMaterial.setInsdt(CommUtil.nowDate()); - rawMaterial.setInsuser(cu.getId()); - int result = this.rawMaterialService.save(rawMaterial); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+rawMaterial.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.rawMaterialService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.rawMaterialService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - RawMaterial rawMaterial = this.rawMaterialService.selectById(id); - model.addAttribute("rawMaterial", rawMaterial); - return "/sparepart/rawMaterialEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute RawMaterial rawMaterial) { - User cu = (User) request.getSession().getAttribute("cu"); - rawMaterial.setInsdt(CommUtil.nowDate()); - rawMaterial.setInsuser(cu.getId()); - int result = this.rawMaterialService.update(rawMaterial); - String resstr="{\"res\":\""+result+"\",\"id\":\""+rawMaterial.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - RawMaterial rawMaterial = this.rawMaterialService.selectById(id); - model.addAttribute("rawMaterial", rawMaterial); - return "/sparepart/rawMaterialView"; - } - /** - * 获取药剂登记记录的明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getRawMaterialDetailList.do") - public ModelAndView getRawMaterialDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and rawmaterial_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.rawMaterialDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 药剂登记明细修改数量或价格后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRawMaterialDetail.do") - public String doupdateRawMaterialDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - String includeTaxratePrice = request.getParameter("includeTaxratePrice");//含税价格 - RawMaterialDetail rawMaterialDetail = this.rawMaterialDetailService.selectById(id); - rawMaterialDetail.setRawmaterialNumber(new BigDecimal(number)); - rawMaterialDetail.setPrice(new BigDecimal(price)); - rawMaterialDetail.setIncludeTaxratePrice(new BigDecimal(includeTaxratePrice)); - int result = this.rawMaterialDetailService.update(rawMaterialDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+rawMaterialDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 药剂登记明细修改合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRawMaterialDetail_total.do") - public String doupdateRawMaterialDetail_total(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String totalMoney = request.getParameter("totalMoney");//合计 - String includeTaxrateTotalMoney = request.getParameter("includeTaxrateTotalMoney");//含税合计 - RawMaterialDetail rawMaterialDetail = this.rawMaterialDetailService.selectById(id); - rawMaterialDetail.setTotalMoney(new BigDecimal(totalMoney)); - rawMaterialDetail.setIncludeTaxrateTotalMoney(new BigDecimal(includeTaxrateTotalMoney)); - int result = this.rawMaterialDetailService.update_total(rawMaterialDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+rawMaterialDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 药剂登记记录明细选择其他物品明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveOtherDetails.do") - public String dosaveOtherDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String goodsIds = request.getParameter("goodsIds"); - String rawmaterialId = request.getParameter("rawmaterialId"); - String[] idArrary = goodsIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - Listlist = this.rawMaterialDetailService.selectListByWhere("where rawmaterial_id ='"+rawmaterialId+"' and goods_id ='"+str+"' "); - if (list == null || list.size() == 0) { - RawMaterialDetail rawMaterialDetail = new RawMaterialDetail(); - rawMaterialDetail.setId(CommUtil.getUUID()); - rawMaterialDetail.setInsdt(CommUtil.nowDate()); - rawMaterialDetail.setInsuser(cu.getId()); - rawMaterialDetail.setGoodsId(str); - rawMaterialDetail.setRawmaterialNumber(new BigDecimal(0)); - rawMaterialDetail.setRawmaterialId(rawmaterialId); - rawMaterialDetail.setPrice(new BigDecimal(0)); - result = this.rawMaterialDetailService.save(rawMaterialDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.rawMaterialDetailService.selectListByWhere("where rawmaterial_id = '"+rawmaterialId+"' "); - for (RawMaterialDetail item : list) { - boolean isInArray = this.isInArray(idArrary,item.getGoodsId()); - if (!isInArray) { - result = this.rawMaterialDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除药剂登记明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesRawMaterialDetail.do") - public String dodeletesRawMaterialDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.rawMaterialDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - /** - * 更新,启动药剂登记审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute RawMaterial rawMaterial){ - User cu= (User)request.getSession().getAttribute("cu"); - rawMaterial.setInsuser(cu.getId()); - rawMaterial.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.rawMaterialService.startProcess(rawMaterial); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+rawMaterial.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看药剂登记处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessRawMaterialView.do") - public String showProcessRawMaterialView(HttpServletRequest request,Model model){ - String rawMaterialId = request.getParameter("id"); - RawMaterial rawMaterial = this.rawMaterialService.selectById(rawMaterialId); - request.setAttribute("business", rawMaterial); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(rawMaterial); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(rawMaterial.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_RAW_MATERIAL_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+rawMaterialId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_RAW_MATERIAL_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+rawMaterialId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = rawMaterial.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(rawMaterial.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/rawMaterialExecuteViewInModal"; - }else{ - return "sparepart/rawMaterialExecuteView"; - } - } - /** - * 显示药剂登记审核 - * */ - @RequestMapping("/showAuditRawMaterial.do") - public String showAuditRawMaterial(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String rawMaterialId= pInstance.getBusinessKey(); - RawMaterial rawMaterial = this.rawMaterialService.selectById(rawMaterialId); - model.addAttribute("rawMaterial", rawMaterial); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/rawMaterialAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/AuditRawMaterial.do") - public String doAuditRawMaterial(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - String acceptanceResults = request.getParameter("acceptanceResults"); - String sampling = request.getParameter("sampling"); - String rawMaterialId = businessUnitAudit.getBusinessid(); - RawMaterial rawMaterial = this.rawMaterialService.selectById(rawMaterialId); - rawMaterial.setAcceptanceResults(acceptanceResults); - rawMaterial.setSampling(sampling); - int result = this.rawMaterialService.update(rawMaterial); - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.rawMaterialService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 显示药剂登记业务处理 - * */ - @RequestMapping("/showRawMaterialHandle.do") - public String showRawMaterialHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String rawMaterialId = pInstance.getBusinessKey(); - RawMaterial rawMaterial = this.rawMaterialService.selectById(rawMaterialId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+rawMaterialId+"' order by insdt desc "); - if(list!=null && list.size()>0){ - model.addAttribute("businessUnitAudit", list.get(0)); - } - model.addAttribute("rawMaterial", rawMaterial); - return "sparepart/rawMaterialHandle"; - } - /** - * 流程流程,药剂登记业务处理提交 - * */ - @RequestMapping("/submitRawMaterialHandle.do") - public String dosubmitRawMaterialHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNumStr=request.getParameter("routeNum"); - String passstatusStr=request.getParameter("passstatus"); - - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - - try { - boolean passstatus = true; - if(passstatusStr!=null && !"".equals(passstatusStr)){ - passstatus = Boolean.getBoolean(passstatusStr); - } - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, passstatus, routeNumStr); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.rawMaterialService.updateStatus(businessUnitHandle.getBusinessid(),passstatus); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 判断string字符串是否在数组中 - * @param arr - * @param str - * @return - */ - public boolean isInArray(String[] arr,String str){ - return Arrays.asList(arr).contains(str); - } -} diff --git a/src/com/sipai/controller/sparepart/ReturnStockRecordController.java b/src/com/sipai/controller/sparepart/ReturnStockRecordController.java deleted file mode 100644 index 697d768a..00000000 --- a/src/com/sipai/controller/sparepart/ReturnStockRecordController.java +++ /dev/null @@ -1,387 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.ReturnStockRecord; -import com.sipai.entity.sparepart.ReturnStockRecordDetail; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.OutStockRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.sparepart.ReturnStockRecordDetailService; -import com.sipai.service.sparepart.ReturnStockRecordService; -import com.sipai.service.sparepart.OutStockRecordDetailService; -import com.sipai.service.sparepart.OutStockRecordService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/returnStockRecord") -public class ReturnStockRecordController { - @Resource - private ReturnStockRecordService returnStockRecordService; - @Resource - private ReturnStockRecordDetailService returnStockRecordDetailService; - @Resource - private UnitService unitService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/returnStockRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.returnStockRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-DJTH-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - return "/sparepart/returnStockRecordAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ReturnStockRecord returnStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - returnStockRecord.setInsdt(CommUtil.nowDate()); - returnStockRecord.setInsuser(cu.getId()); - int result = this.returnStockRecordService.save(returnStockRecord); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+returnStockRecord.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.returnStockRecordService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.returnStockRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - ReturnStockRecord returnStockRecord = this.returnStockRecordService.selectById(id); - model.addAttribute("returnStockRecord", returnStockRecord); - return "/sparepart/returnStockRecordEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ReturnStockRecord returnStockRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - returnStockRecord.setInsdt(CommUtil.nowDate()); - returnStockRecord.setInsuser(cu.getId()); - int result = this.returnStockRecordService.update(returnStockRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+returnStockRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - ReturnStockRecord returnStockRecord = this.returnStockRecordService.selectById(id); - model.addAttribute("returnStockRecord", returnStockRecord); - return "/sparepart/returnStockRecordView"; - } - /** - * 获取退回入库记录的明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getReturnStockDetailList.do") - public ModelAndView getReturnStockDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and instock_record_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("type")!= null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '"+request.getParameter("type")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.returnStockRecordDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 新增退回入库记录明细,选择采购记录明细界面 - */ - @RequestMapping("/selectPRDetailForReturnStockDetails.do")//PRDetail是outStockRecordDetail的简写 - public String doselectPRDetailForReturnStockDetails (HttpServletRequest request,Model model) { - String whereStr = "where status = '"+SparePartCommString.STATUS_STOCK_FINISH+"'"; - if (request.getParameter("companyId")!= null && !request.getParameter("companyId").isEmpty()) { - whereStr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - //在打开采购计划明细界面时,先查询审核完成的申购单,为采购计划明细列表查询提供条件 - Listlist = this.outStockRecordService.selectListByWhere(whereStr); - String outStockRecordIds = ""; - if (list != null && list.size() > 0) { - for (OutStockRecord item : list) { - if (outStockRecordIds != "") { - outStockRecordIds+= ","; - } - outStockRecordIds+= item.getId(); - } - } - String PRDetailIds = request.getParameter("PRDetailIds"); - if(PRDetailIds!=null && !PRDetailIds.isEmpty()){ - String[] id_Array= PRDetailIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("PRDetailIds", jsonArray); - } - model.addAttribute("outStockRecordIds",outStockRecordIds); - return "/sparepart/outStockRecordDetail4Selects"; - } - /** - * 退回入库明细修改数量或价格后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateReturnStockDetail.do") - public String doupdateReturnStockDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - ReturnStockRecordDetail returnStockRecordDetail = this.returnStockRecordDetailService.selectById(id); - returnStockRecordDetail.setInstockNumber(new BigDecimal(number)); - returnStockRecordDetail.setPrice(new BigDecimal(price)); - int result = this.returnStockRecordDetailService.update(returnStockRecordDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+returnStockRecordDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 退回入库记录明细选择采购记录明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveReturnStockRecordDetails.do") - public String dosaveReturnStockRecordDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String PRDetailIds = request.getParameter("PRDetailIds");//PRDetail是outStockRecordDetail的简写 - String instockRecordId = request.getParameter("instockRecordId"); - String[] idArrary = PRDetailIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - OutStockRecordDetail outStockRecordDetail = this.outStockRecordDetailService.selectById(str); - Listlist = this.returnStockRecordDetailService.selectListByWhere("where instock_record_id ='"+instockRecordId+"' and purchase_record_detail_id ='"+str+"'"); - if (list == null || list.size() == 0) { - ReturnStockRecordDetail returnStockRecordDetail = new ReturnStockRecordDetail(); - returnStockRecordDetail.setId(CommUtil.getUUID()); - returnStockRecordDetail.setInsdt(CommUtil.nowDate()); - returnStockRecordDetail.setInsuser(cu.getId()); - returnStockRecordDetail.setGoodsId(outStockRecordDetail.getGoodsId()); - returnStockRecordDetail.setInstockNumber(outStockRecordDetail.getOutNumber()); - returnStockRecordDetail.setInstockRecordId(instockRecordId); - returnStockRecordDetail.setPrice(outStockRecordDetail.getPrice()); - returnStockRecordDetail.setDeptId(outStockRecordDetail.getDeptId()); - returnStockRecordDetail.setPurchaseRecordDetailId(outStockRecordDetail.getId()); - returnStockRecordDetail.setType(SparePartCommString.INSTOCK_PURCHASE); - result = this.returnStockRecordDetailService.save(returnStockRecordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.returnStockRecordDetailService.selectListByWhere("where instock_record_id = '"+instockRecordId+"' and type = '"+SparePartCommString.INSTOCK_OTHER+"'"); - for (ReturnStockRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getPurchaseRecordDetailId()); - if (!isInArray) { - result = this.returnStockRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 退回入库记录明细选择其他物品明细后保存 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveOtherDetails.do") - public String dosaveOtherDetails(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String goodsIds = request.getParameter("goodsIds"); - String instockRecordId = request.getParameter("instockRecordId"); - String[] idArrary = goodsIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - Listlist = this.returnStockRecordDetailService.selectListByWhere("where instock_record_id ='"+instockRecordId+"' and goods_id ='"+str+"' and type = '"+SparePartCommString.INSTOCK_OTHER+"'"); - if (list == null || list.size() == 0) { - ReturnStockRecordDetail returnStockRecordDetail = new ReturnStockRecordDetail(); - returnStockRecordDetail.setId(CommUtil.getUUID()); - returnStockRecordDetail.setInsdt(CommUtil.nowDate()); - returnStockRecordDetail.setInsuser(cu.getId()); - returnStockRecordDetail.setGoodsId(str); - returnStockRecordDetail.setInstockNumber(new BigDecimal(0)); - returnStockRecordDetail.setInstockRecordId(instockRecordId); - returnStockRecordDetail.setPrice(new BigDecimal(0)); - returnStockRecordDetail.setType(SparePartCommString.INSTOCK_OTHER); - result = this.returnStockRecordDetailService.save(returnStockRecordDetail); - if (result != 1) { - flag = false; - } - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.returnStockRecordDetailService.selectListByWhere("where instock_record_id = '"+instockRecordId+"' and type = '"+SparePartCommString.INSTOCK_OTHER+"'"); - for (ReturnStockRecordDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary,item.getGoodsId()); - if (!isInArray) { - result = this.returnStockRecordDetailService.deleteById(item.getId()); - if (result != 1) { - flag = false; - } - }; - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除退回入库明细 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesReturnStockRecordDetail.do") - public String dodeletesReturnStockRecordDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.returnStockRecordDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/ScoreController.java b/src/com/sipai/controller/sparepart/ScoreController.java deleted file mode 100644 index 5371ac07..00000000 --- a/src/com/sipai/controller/sparepart/ScoreController.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.image.SVGComposite.ScreenCompositeContext; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.sparepart.Score; -import com.sipai.entity.sparepart.SupplierClass; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.ScoreService; -import com.sipai.service.sparepart.SupplierClassService; -import com.sipai.service.sparepart.SupplierService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DateUtil; - -@Controller -@RequestMapping("/sparepart/Score") -public class ScoreController { - @Resource - private ScoreService scoreService; - @Resource - private SupplierService supplierService; - @Resource - private SupplierClassService supplierClassService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/scoreList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " total "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - String wherestr1 = wherestr+ " and name like '%"+request.getParameter("search_name")+"%'"; - List list = this.supplierService.selectListByWhere(wherestr1); - System.out.println(list); - for (Supplier supplier : list ) { - - wherestr += " and supplier_id = '"+supplier.getId()+"'"; - System.out.println(wherestr); - } - } - if (request.getParameter("years")!= null && !request.getParameter("years").isEmpty()) { - System.out.println(request.getParameter("years")); - wherestr += " and years like '%"+request.getParameter("years")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.scoreService.selectListByWhere(wherestr+orderstr); - for (Score score : list ) { - score.setYears(score.getYears().substring(0,4) ); - Supplier supplier = this.supplierService.selectById(score.getSupplierId()); - score.setCreationTime(score.getCreationTime()); - score.setLinkMan(supplier.getLinkMan()); - score.setSupplierId(score.getSupplierId()); - score.setSupplierName(supplier.getName()); - SupplierClass supplierClass = this.supplierClassService.selectById(supplier.getClassId()); - score.setSupplierType(supplierClass.getName()); - score.setTotal(score.getTotal()); - score.setYears(score.getYears()); - - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - System.out.println(jsonArray); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - - return "/sparepart/scoreAdd"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Score score) { - User cu = (User) request.getSession().getAttribute("cu"); - score.setId(CommUtil.getUUID()); - score.setUserId(cu.getId()); - score.setTotal(score.getCreditScore()+score.getDeliveryTimeScore()+score.getMatchingScore()+score.getPriceScore()+score.getQualityScore()+score.getServiceLevelScore()); - score.setCreationTime(CommUtil.nowDate()); - //score.setYears(years); - int result = this.scoreService.save(score); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+score.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Score stock = this.scoreService.selectById(id); - model.addAttribute("stock", stock); - return "/sparepart/scoreView"; - } - /** - * 获取供应商 - * */ - @RequestMapping("/getSupplier.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.supplierService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (Supplier supplier : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", supplier.getId()); - jsonObject.put("text", supplier.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Score score = this.scoreService.selectById(id); - score.setYears(score.getYears().substring(0,4) ); - model.addAttribute("score", score); - return "/sparepart/scoreEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Score score) { - User cu = (User) request.getSession().getAttribute("cu"); - score.setCreationTime(CommUtil.nowDate()); - score.setUserId(cu.getId()); - score.setTotal(score.getCreditScore()+score.getDeliveryTimeScore()+score.getMatchingScore()+score.getPriceScore()+score.getQualityScore()+score.getServiceLevelScore()); - int result = this.scoreService.update(score); - String resstr="{\"res\":\""+result+"\",\"id\":\""+score.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.scoreService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/deletebySupplierId.do") - public String deletebySupplierId(HttpServletRequest request,Model model, - @RequestParam(value = "id") String supplierId) { - supplierId = supplierId.replace(",","','"); - System.out.println("%%%%%%%"+supplierId); - int result = this.scoreService.deleteByWhere("where supplier_id in ('"+supplierId+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - System.out.println("%%%%%%%"+ids); - int result = this.scoreService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/Score_copyController.java b/src/com/sipai/controller/sparepart/Score_copyController.java deleted file mode 100644 index 7ece0a73..00000000 --- a/src/com/sipai/controller/sparepart/Score_copyController.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.image.SVGComposite.ScreenCompositeContext; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.Supplier_copy; -import com.sipai.entity.sparepart.Score_copy; -import com.sipai.entity.sparepart.SupplierClass_copy; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.Score_copyService; -import com.sipai.service.sparepart.SupplierClass_copyService; -import com.sipai.service.sparepart.Supplier_copyService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DateUtil; - -@Controller -@RequestMapping("/sparepart/Score_copy") -public class Score_copyController { - @Resource - private Score_copyService scoreService1; - @Resource - private Supplier_copyService supplierService1; - @Resource - private SupplierClass_copyService supplierClassService1; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/score_copyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " total "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - String wherestr1 = wherestr+ " and name like '%"+request.getParameter("search_name")+"%'"; - List list = this.supplierService1.selectListByWhere(wherestr1); - System.out.println(list); - for (Supplier_copy supplier : list ) { - - wherestr += " and supplier_id = '"+supplier.getId()+"'"; - System.out.println(wherestr); - } - } - if (request.getParameter("years")!= null && !request.getParameter("years").isEmpty()) { - System.out.println(request.getParameter("years")); - wherestr += " and years like '%"+request.getParameter("years")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.scoreService1.selectListByWhere(wherestr+orderstr); - for (Score_copy score : list ) { - score.setYears(score.getYears().substring(0,4) ); - Supplier_copy supplier = this.supplierService1.selectById(score.getSupplierId()); - score.setCreationTime(score.getCreationTime()); - score.setLinkMan(supplier.getLinkMan()); - score.setSupplierId(score.getSupplierId()); - score.setSupplierName(supplier.getName()); - SupplierClass_copy supplierClass = this.supplierClassService1.selectById(supplier.getClassId()); - score.setSupplierType(supplierClass.getName()); - score.setTotal(score.getTotal()); - score.setYears(score.getYears()); - - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - System.out.println(jsonArray); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - - return "/sparepart/score_copyAdd"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Score_copy score) { - User cu = (User) request.getSession().getAttribute("cu"); - score.setId(CommUtil.getUUID()); - score.setUserId(cu.getId()); - score.setTotal(score.getCreditScore()+score.getDeliveryTimeScore()+score.getMatchingScore()+score.getPriceScore()+score.getQualityScore()+score.getServiceLevelScore()); - score.setCreationTime(CommUtil.nowDate()); - //score.setYears(years); - int result = this.scoreService1.save(score); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+score.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Score_copy stock = this.scoreService1.selectById(id); - model.addAttribute("stock", stock); - return "/sparepart/score_copyView"; - } - /** - * 获取供应商 - * */ - @RequestMapping("/getSupplier.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.supplierService1.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (Supplier_copy supplier : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", supplier.getId()); - jsonObject.put("text", supplier.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Score_copy score = this.scoreService1.selectById(id); - score.setYears(score.getYears().substring(0,4) ); - model.addAttribute("score", score); - return "/sparepart/score_copyEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Score_copy score) { - User cu = (User) request.getSession().getAttribute("cu"); - score.setCreationTime(CommUtil.nowDate()); - score.setUserId(cu.getId()); - score.setTotal(score.getCreditScore()+score.getDeliveryTimeScore()+score.getMatchingScore()+score.getPriceScore()+score.getQualityScore()+score.getServiceLevelScore()); - int result = this.scoreService1.update(score); - String resstr="{\"res\":\""+result+"\",\"id\":\""+score.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.scoreService1.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletebySupplierId.do") - public String deletebySupplierId(HttpServletRequest request,Model model, - @RequestParam(value = "id") String supplierId) { - supplierId = supplierId.replace(",","','"); - System.out.println("%%%%%%%"+supplierId); - int result = this.scoreService1.deleteByWhere("where supplier_id in ('"+supplierId+"')"); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - System.out.println("%%%%%%%"+ids); - int result = this.scoreService1.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/SewageController.java b/src/com/sipai/controller/sparepart/SewageController.java deleted file mode 100644 index 42f7c432..00000000 --- a/src/com/sipai/controller/sparepart/SewageController.java +++ /dev/null @@ -1,357 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.Sewage; -import com.sipai.entity.sparepart.SewageInput; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.SewageService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/sewage") -public class SewageController { - @Resource - private SewageService sewageService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/sewageList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " contract_order "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - /*if (request.getParameter("unitId")!= null && !request.getParameter("unitId").isEmpty()) { - String unitIds = this.unitService.getUnitChildrenById2(request.getParameter("unitId")); - unitIds = unitIds.replace(",","','"); - wherestr += " and unit_id in ('"+unitIds+"') "; - }*/ - String companyId = request.getParameter("unitId"); - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and unit_id in (" + companyids + ") "; - } - } -// if (request.getParameter("unitId")!= null && !request.getParameter("unitId").isEmpty()) { -// wherestr += " and unit_id = '"+request.getParameter("unitId")+"'"; -// } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (contract_number like '%"+request.getParameter("search_name")+"%' or name like '%"+request.getParameter("search_name")+"%' ) "; - } - if (request.getParameter("processSectionId")!= null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and process_section_id = '"+request.getParameter("processSectionId")+"'"; - } - if (request.getParameter("city")!= null && !request.getParameter("city").isEmpty()) { - wherestr += " and city like '%"+request.getParameter("city")+"%'"; - } - if (request.getParameter("_input")!= null && !request.getParameter("_input").isEmpty()) { - String _input = request.getParameter("_input"); - if(Boolean.valueOf(_input)){ - wherestr += " and contract_number in ( select Distinct sewage_id from TB_Sewage_Input ) "; - }else{ - wherestr += " and contract_number not in ( select Distinct sewage_id from TB_Sewage_Input ) "; - } - } - if (request.getParameter("_point")!= null && !request.getParameter("_point").isEmpty()) { - String _point = request.getParameter("_point"); - if(Boolean.valueOf(_point)){ - wherestr += " and name in ( select Distinct psname from TB_JSYW_Point ) "; - }else{ - wherestr += " and name not in ( select psname sewage_id from TB_JSYW_Point ) "; - } - } - - PageHelper.startPage(page, rows); -// System.out.println(wherestr); - List list = this.sewageService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/sewageAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Sewage sewage) { - User cu = (User) request.getSession().getAttribute("cu"); - sewage.setId(CommUtil.getUUID()); - int result = this.sewageService.save(sewage); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+sewage.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.sewageService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.sewageService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Sewage sewage = this.sewageService.selectById(id); - model.addAttribute("sewage", sewage); - return "/sparepart/sewageEdit"; - } -// @RequestMapping("/getSearchBizsBIZ1Select.do") -// public String getSearchBizsBIZ1Select(HttpServletRequest request,Model model){ -// JSONArray json=new JSONArray(); -// List list = this.sewageService.selectAllArea(" where 1= 1 GROUP BY area "); -// //List companies=this.unitService.getCompanyByType(CommString.UNIT_TYPE_BIZ); -// if(list!=null && list.size()>0){ -// for (Sewage sewage : list) { -// if(sewage.getArea()!=null ){ -// JSONObject jsonObject =new JSONObject(); -// Company company = this.unitService.getCompById(sewage.getArea()); -// if(company!=null ){ -// jsonObject.put("id", company.getId()); -// jsonObject.put("text", company.getName()); -// json.add(jsonObject); -// } -// } -// } -// -// } -// /*}*/ -// System.out.println(json.toString()); -// model.addAttribute("result", json.toString()); -// return "result"; -// } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Sewage sewage) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.sewageService.update(sewage); - String resstr="{\"res\":\""+result+"\",\"id\":\""+sewage.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Sewage sewage = this.sewageService.selectById(id); - model.addAttribute("sewage", sewage); - return "/sparepart/sewageView"; - } - /** - * id转名称,传名称跟id到巡检点前端方法 - * 2021-07-28 sj 将name改为sname - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSewage4Select.do") - public ModelAndView getSewage4Select(HttpServletRequest request, Model model) { - String orderstr = " order by contract_order "; - String wherestr = " where 1=1 "; - if (request.getParameter("unitId")!= null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '"+request.getParameter("unitId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (contract_number like '%"+request.getParameter("search_name")+"%' or name like '%"+request.getParameter("search_name")+"%' ) "; - } - if (request.getParameter("search_name1")!= null && !request.getParameter("search_name1").isEmpty()) { - wherestr += " and city like '%"+request.getParameter("search_name1")+"%'"; - } - if (request.getParameter("processSectionId")!= null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and process_section_id = '"+request.getParameter("processSectionId")+"'"; - } - - List list = this.sewageService.selectListByWhere(wherestr+orderstr); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getContractNumber()); - jsonObject.put("text", list.get(i).getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return new ModelAndView("result"); - } - /** 树形结构,偏向于定制,关联工艺数据 - * @param request - * @param model - * @return - */ - @RequestMapping("/getTreeJson.do") - public ModelAndView getTreeJson(HttpServletRequest request,Model model) { - String wherestr = "where 1=1 "; - String orderstr = " order by unit_id,process_section_id"; - if (request.getParameter("unitId")!= null && !request.getParameter("unitId").isEmpty()) { - String unitIds = this.unitService.getUnitChildrenById2(request.getParameter("unitId")); - unitIds = unitIds.replace(",","','"); - wherestr += " and unit_id in ('"+unitIds+"') "; - } - List list = this.sewageService.selectListByWhere(wherestr+orderstr); - String json = this.sewageService.getTreeList(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 导入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelFun.do") - public String importExcelFun(HttpServletRequest request, Model model) { - return "sparepart/sewageExcelImport"; - } - - @RequestMapping("/saveExcelData.do") - public ModelAndView saveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = this.sewageService.readXls(excelFile.getInputStream(), cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 导出 - */ - @RequestMapping(value = "downloadExcelFun.do") - public ModelAndView downloadExcelFun(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - this.sewageService.outExcelFun(response); - return null; - } - - /** - * id转名称,传名称跟id到巡检点前端方法 - * 2021-07-28 sj 将name改为sname - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getSewageCity4Select.do") - public ModelAndView getSewageCity4Select(HttpServletRequest request, Model model) { - String orderstr = " order by city"; - String wherestr = " where city is not null and city !='' "; - if (request.getParameter("unitId")!= null && !request.getParameter("unitId").isEmpty()) { - String unitIds= this.unitService.getChildrenBizids(request.getParameter("unitId")); - unitIds = request.getParameter("unitId")+","+unitIds; - unitIds = unitIds.replace(",", "','"); - wherestr += " and unit_id in ('"+unitIds+"') "; - } - - List list = this.sewageService.selectDistinctCityByWhere(wherestr+orderstr); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getCity()); - jsonObject.put("text", list.get(i).getCity()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/sparepart/SewageInputController.java b/src/com/sipai/controller/sparepart/SewageInputController.java deleted file mode 100644 index 6728f7b7..00000000 --- a/src/com/sipai/controller/sparepart/SewageInputController.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.sipai.controller.sparepart; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.SewageInput; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.SewageInputService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -@Controller -@RequestMapping("/sparepart/sewageInput") -public class SewageInputController { - @Resource - private SewageInputService sewageInputService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/sewageInputList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " input_dt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - //填报时间筛选 - if (request.getParameter("sdt")!= null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and input_dt >= '"+request.getParameter("sdt")+"' "; - } - if (request.getParameter("edt")!= null && !request.getParameter("edt").isEmpty()) { - wherestr += " and input_dt <= '"+request.getParameter("edt")+"' "; - } - //填报人员筛选 - if (request.getParameter("input_userid")!= null && !request.getParameter("input_userid").isEmpty()) { - String input_userid = request.getParameter("input_userid").replace(",","','"); - wherestr += " and input_userid in ( '"+input_userid+"' ) "; - } - //排污源筛选 - if (request.getParameter("sewage_id")!= null && !request.getParameter("sewage_id").isEmpty()) { - String sewage_id = request.getParameter("sewage_id").replace(",","','"); - wherestr += " and sewage_id in ( '"+sewage_id+"' ) "; - } - //单位搜索 - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - String search_name = request.getParameter("search_name"); - wherestr += " and sewage_id in ( select contract_number from TB_Sewage_Source where name like '%"+search_name+"%' ) "; - } - //查看数据类型 - if (request.getParameter("type")!= null && !request.getParameter("type").isEmpty()) { - String type = request.getParameter("type"); - //排污源筛选 - if (request.getParameter("select_id")!= null && !request.getParameter("select_id").isEmpty()) { - String select_id = request.getParameter("select_id").replace(",","','"); - if("sewage".equals(type)){ - wherestr += " and sewage_id in ( '"+select_id+"' ) "; - } - if("processSection".equals(type)){ - wherestr += " and sewage_id in ( select id from TB_Sewage_Source where process_section_id in ('"+select_id+"') ) "; - } - if("unit".equals(type)){ - wherestr += " and sewage_id in ( select id from TB_Sewage_Source where unit_id in ('"+select_id+"') ) "; - } - } - } - PageHelper.startPage(page, rows); - List list = this.sewageInputService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/sewageInputAdd"; - } - - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute SewageInput sewageInput) { - User cu = (User) request.getSession().getAttribute("cu"); - sewageInput.setId(CommUtil.getUUID()); - sewageInput.setInsdt(CommUtil.nowDate()); - sewageInput.setInsuser(cu.getId()); - //填报人员默认当前登录人员 - sewageInput.setInputUserid(cu.getId()); - int result = this.sewageInputService.save(sewageInput); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+sewageInput.getId()+"\"}"; - model.addAttribute("result",resultstr); - return new ModelAndView("result"); - } - - @RequestMapping("/delete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.sewageInputService.deleteById(id); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/deletes.do") - public ModelAndView dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.sewageInputService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - SewageInput sewageInput = this.sewageInputService.selectById(id); - model.addAttribute("sewageInput", sewageInput); - return "/sparepart/sewageInputEdit"; - } - - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute SewageInput sewageInput) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.sewageInputService.update(sewageInput); - String resstr="{\"res\":\""+result+"\",\"id\":\""+sewageInput.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - SewageInput sewageInput = this.sewageInputService.selectById(id); - model.addAttribute("sewageInput", sewageInput); - return "/sparepart/sewageInputView"; - } - /** - * 导出 - */ - @RequestMapping(value = "downloadExcelFun.do") - public ModelAndView downloadExcelFun(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String sort = ""; - if (request.getParameter("sort")!= null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - }else{ - sort = " input_dt "; - } - String order = ""; - if (request.getParameter("order")!= null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - }else{ - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - //填报时间筛选 - if (request.getParameter("sdt")!= null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and input_dt >= '"+request.getParameter("sdt")+"' "; - } - if (request.getParameter("edt")!= null && !request.getParameter("edt").isEmpty()) { - wherestr += " and input_dt <= '"+request.getParameter("edt")+"' "; - } - //填报人员筛选 - if (request.getParameter("input_userid")!= null && !request.getParameter("input_userid").isEmpty()) { - String input_userid = request.getParameter("input_userid").replace(",","','"); - wherestr += " and input_userid in ( '"+input_userid+"' ) "; - } - //排污源筛选 - if (request.getParameter("sewage_id")!= null && !request.getParameter("sewage_id").isEmpty()) { - String sewage_id = request.getParameter("sewage_id").replace(",","','"); - wherestr += " and sewage_id in ( '"+sewage_id+"' ) "; - } - //单位搜索 - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - String search_name = request.getParameter("search_name"); - wherestr += " and sewage_id in ( select id from TB_Sewage_Source where name like '%"+search_name+"%' ) "; - } - //查看数据类型 - if (request.getParameter("type")!= null && !request.getParameter("type").isEmpty()) { - String type = request.getParameter("type"); - //排污源筛选 - if (request.getParameter("select_id")!= null && !request.getParameter("select_id").isEmpty()) { - String select_id = request.getParameter("select_id").replace(",","','"); - if("sewage".equals(type)){ - wherestr += " and sewage_id in ( '"+select_id+"' ) "; - } - if("processSection".equals(type)){ - wherestr += " and sewage_id in ( select id from TB_Sewage_Source where process_section_id in ('"+select_id+"') ) "; - } - if("unit".equals(type)){ - wherestr += " and sewage_id in ( select id from TB_Sewage_Source where unit_id in ('"+select_id+"') ) "; - } - } - } - this.sewageInputService.outExcelFun(response,wherestr,orderstr); - return null; - } -} diff --git a/src/com/sipai/controller/sparepart/StockCheckController.java b/src/com/sipai/controller/sparepart/StockCheckController.java deleted file mode 100644 index a386fe9b..00000000 --- a/src/com/sipai/controller/sparepart/StockCheckController.java +++ /dev/null @@ -1,669 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.io.BufferedOutputStream; -import java.io.Closeable; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.StockCheck; -import com.sipai.entity.sparepart.StockCheckDetail; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.sparepart.StockCheckDetailService; -import com.sipai.service.sparepart.StockCheckService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.sparepart.WarehouseService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sun.mail.iap.Response; - -@Controller -@RequestMapping("/sparepart/stockCheck") -public class StockCheckController { - @Resource - private StockCheckService stockCheckService; - @Resource - private StockCheckDetailService stockCheckDetailService; - @Resource - private UnitService unitService; - @Resource - private WarehouseService warehouseService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/stockCheckList"; - } - @RequestMapping("/showHistoryList.do") - public String showHistoryList(HttpServletRequest request, Model model) { - return "/sparepart/stockCheckHistoryList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and id like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - wherestr += " and status = '"+request.getParameter("status")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.stockCheckService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - String warehouseId = request.getParameter("warehouseId"); - Company company = this.unitService.getCompById(companyId); - Warehouse warehouse = this.warehouseService.selectById(warehouseId); - String id = company.getEname()+"-KCPD-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - model.addAttribute("warehouse",warehouse); - return "/sparepart/stockCheckAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute StockCheck stockCheck) { - User cu = (User) request.getSession().getAttribute("cu"); - //上次盘点月份和本次盘点月份,在页面选择的是年月,保存时要凑成年月日,否则会报字符串转换日期失败 - String nowTime = stockCheck.getNowTime()+"-01"; - String lastTime = stockCheck.getLastTime()+"-01"; - stockCheck.setNowTime(nowTime); - stockCheck.setLastTime(lastTime); - stockCheck.setInsdt(CommUtil.nowDate()); - stockCheck.setInsuser(cu.getId()); - int result = this.stockCheckService.save(stockCheck); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+stockCheck.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.stockCheckService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.stockCheckService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - StockCheck stockCheck = this.stockCheckService.selectById(id); - model.addAttribute("stockCheck", stockCheck); - return "/sparepart/stockCheckEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute StockCheck stockCheck) { - User cu = (User) request.getSession().getAttribute("cu"); - //stockCheck.setInsdt(CommUtil.nowDate()); - stockCheck.setInsuser(cu.getId()); - int result = this.stockCheckService.update(stockCheck); - String resstr="{\"res\":\""+result+"\",\"id\":\""+stockCheck.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - StockCheck stockCheck = this.stockCheckService.selectById(id); - model.addAttribute("stockCheck", stockCheck); - return "/sparepart/stockCheckView"; - } - /** - * 结束盘点 - * @return - */ - @RequestMapping("/finishStockCheck.do") - public String dofinishStockCheck(HttpServletRequest request,Model model, - @ModelAttribute StockCheck stockCheck) { - User cu = (User) request.getSession().getAttribute("cu"); - stockCheck = this.stockCheckService.selectById(stockCheck.getId()); - stockCheck.setInsdt(CommUtil.nowDate()); - stockCheck.setInsuser(cu.getId()); - stockCheck.setStatus(SparePartCommString.STATUS_CHECK_FINISH); - String resstr = ""; - Listdetails = this.stockCheckDetailService.selectListByWhere("where check_id = '"+stockCheck.getId()+"'"); - if (details != null && !details.isEmpty()) { - for (StockCheckDetail detail : details) { - //判断盘点数量未填写的不能结束盘点 - if (detail.getRealNumber() == null) { - resstr="{\"res\":\"部分库存物品的盘点数量未填写,不能结束盘点\",\"id\":\""+stockCheck.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - } - } - int result = this.stockCheckService.update(stockCheck); - //对差异数量生成入库或出库单 - //this.stockCheckService.launchInOrOutRecord(stockCheck, details); - resstr="{\"res\":\""+result+"\",\"id\":\""+stockCheck.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 检查明细是否全部盘点 - * @param request - * @param model - * @return - */ - @RequestMapping("/examineStockDetail.do") - public String doexamineStockDetail(HttpServletRequest request,Model model, - @RequestParam(value = "stockCheckId") String stockCheckId) { - int resstr = 0; - Listdetails = this.stockCheckDetailService.selectListByWhere("where check_id = '"+stockCheckId+"'"); - if (details != null && !details.isEmpty()) { - for (StockCheckDetail detail : details) { - //判断盘点数量未填写的不能结束盘点 - if (detail.getRealNumber() == null) { - resstr = 1; - } - } - } - String result = "{\"res\":\""+resstr+"\"}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getStockCheckDetailList.do") - public ModelAndView getStockCheckDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and check_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.stockCheckDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - //未盘点的数据显示中文“未盘点”,否则会显示0 - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject detalObject = jsonArray.getJSONObject(i); - String realNumber = detalObject.getString("realNumber"); - if (realNumber.equals("0")) { - detalObject.put("realNumber", "未盘点"); - } - } - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 更新盘点明细 - */ - @RequestMapping("/updateStockCheckDetail.do") - public String doupdateStockCheckDetail(HttpServletRequest request,Model model) { - String number = request.getParameter("realNumber"); - String id = request.getParameter("id"); - StockCheckDetail detail = this.stockCheckDetailService.selectById(id); - BigDecimal realNumber = new BigDecimal(number); - detail.setRealNumber(realNumber); - detail.setDifferenceNumber(realNumber.subtract(detail.getAccountNumber())); - int result = this.stockCheckDetailService.update(detail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+detail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 导出库存盘点表 - * @throws IOException - */ - @RequestMapping("exportStockCheckExcel.do") - public void doexportStockCheckExcel(HttpServletRequest request,HttpServletResponse response,Model model) throws IOException{ - String pid = request.getParameter("pid"); - ListstockCheckDetails = this.stockCheckDetailService.selectListByWhere("where check_id = '"+pid+"'"); - StockCheck stockCheck = this.stockCheckService.selectById(pid); - //导出文件到指定目录,兼容Linux - this.stockCheckService.exportStockCheckExcel(response, stockCheck, stockCheckDetails); - } - - @RequestMapping("/import.do") - public String doimport(HttpServletRequest request, Model model) { - model.addAttribute("checkId", request.getParameter("checkId")); - return "sparepart/stockCheckImport"; - } - - - /** - * 导入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) MultipartFile file, - @RequestParam(value = "checkId") String checkId, - HttpServletRequest request, - Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? stockCheckService.readXls(excelFile.getInputStream(), checkId) : stockCheckService.readXlsx( excelFile.getInputStream(), checkId); - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新,启动库存盘点审核流程 - * */ - @RequestMapping("/startProcess.do") - public String dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute StockCheck stockCheck){ - User cu= (User)request.getSession().getAttribute("cu"); - stockCheck.setInsuser(cu.getId()); - stockCheck.setInsdt(CommUtil.nowDate()); - int result=0; - try { - result =this.stockCheckService.startProcess(stockCheck); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+stockCheck.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 查看库存盘点审核处理流程详情 - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessStockCheckView.do") - public String showProcessInStockView(HttpServletRequest request,Model model){ - String stockCheckId = request.getParameter("id"); - StockCheck stockCheck = this.stockCheckService.selectById(stockCheckId); - request.setAttribute("business", stockCheck); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(stockCheck); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(stockCheck.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_STOCK_CHECK_HANDLE: - List list = businessUnitHandleService.selectListByWhere("where businessid='"+stockCheckId+"' "); - for (BusinessUnitHandle businessUnitHandle : list) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_STOCK_CHECK_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+stockCheckId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = stockCheck.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(stockCheck.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/stockCheckExecuteViewInModal"; - }else{ - return "sparepart/stockCheckExecuteView"; - } - } - /** - * 显示库存盘点审核 - * */ - @RequestMapping("/showAuditStockCheck.do") - public String showAuditStockCheck(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String stockCheckId= pInstance.getBusinessKey(); - StockCheck stockCheck = this.stockCheckService.selectById(stockCheckId); - model.addAttribute("stockCheck", stockCheck); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/stockCheckAudit"; - } - /** - * 流程流转 - * */ - @RequestMapping("/auditStockCheck.do") - public String doAuditStockCheck(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.stockCheckService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 流程流转 - * */ - @RequestMapping("/getCheck.do") - public String getCheck(HttpServletRequest request,Model model){ - String warehouseId = request.getParameter("warehouseId"); - List stockChecks = stockCheckService.selectListByWhere("where status != '" + SparePartCommString.STATUS_CHECK_FINISH + "'" + - " and warehouse_id = '" + warehouseId + "'"); - if (stockChecks != null && stockChecks.size() > 0) { - String resultstr = "{\"res\":\"当前存在盘点信息请完成盘点后再进行入库!\"}"; - model.addAttribute("result",resultstr); - return "result"; - } else { - String resultstr = "{\"data\":\"0\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - } - /** - * 显示库存盘点业务处理 - * */ - @RequestMapping("/showStockCheckHandle.do") - public String showStockCheckHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitHandles!= null && businessUnitHandles.size()>0){ - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String stockCheckId = pInstance.getBusinessKey(); - StockCheck stockCheck = this.stockCheckService.selectById(stockCheckId); - List list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+stockCheckId+"' order by insdt desc "); - model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("stockCheck", stockCheck); - return "sparepart/stockCheckHandle"; - } - /** - * 流程流程,入库业务处理提交 - * */ - @RequestMapping("/submitStockCheckHandle.do") - public String dosubmitStockCheckHandle(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.stockCheckService.updateStatus(businessUnitHandle.getBusinessid()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - -} diff --git a/src/com/sipai/controller/sparepart/StockController.java b/src/com/sipai/controller/sparepart/StockController.java deleted file mode 100644 index 0e16f09f..00000000 --- a/src/com/sipai/controller/sparepart/StockController.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.sparepart.*; -import com.sipai.service.sparepart.*; -import net.sf.json.JSONArray; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.user.User; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/stock") -public class StockController { - @Resource - private StockService stockService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private WarehouseService warehouseService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/stockList"; - } - @RequestMapping("/showStockAlarmList.do") - public String showStockAlarmList(HttpServletRequest request, Model model) { - return "/sparepart/stockAlarmList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = "s.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " s.id is not null ";//mapper的selectListByWhere方法有了where 这里不需要加where - if (request.getParameter("companyId")!= null && !request.getParameter("companyId").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("companyId")+"'"; - } - if (request.getParameter("warehouseId")!= null && !request.getParameter("warehouseId").isEmpty()) { - wherestr += " and warehouse_id = '"+request.getParameter("warehouseId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("equipmentId")!= null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and equipment_ids like '%"+request.getParameter("equipmentId")+"%'"; - } - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - wherestr += " and alarm_status = '"+request.getParameter("status")+"'"; - } - PageHelper.startPage(page, rows); - List list = this.stockService.selectListByWhere(wherestr+orderstr); - BigDecimal amount = new BigDecimal(0); - for (Stock stock : list ) { - if (null != stock.getTotalMoney()) { - amount = amount.add(stock.getIncludedTaxTotalMoney()); - } - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+",\"amount\":"+amount+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Stock stock = this.stockService.selectById(id); - model.addAttribute("stock", stock); - return "/sparepart/stockView"; - } - - - /** - * 出入库列表 - */ - @RequestMapping("/getIOStock.do") - public ModelAndView getIOStock(HttpServletRequest request, Model model) { - String goodsId = request.getParameter("goodsId"); - String warehouseId = request.getParameter("warehouseId"); - if (StringUtils.isBlank(goodsId)){ - com.alibaba.fastjson.JSONArray result = new com.alibaba.fastjson.JSONArray(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - if (StringUtils.isBlank(warehouseId)) { - com.alibaba.fastjson.JSONArray result = new com.alibaba.fastjson.JSONArray(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - String id = request.getParameter("id"); - Stock stock = stockService.selectById(id); - String whereStrin = "where goods_id = '" + goodsId + "' order by insdt asc"; - Warehouse warehouse = warehouseService.selectById(warehouseId); - if (warehouse.getOutboundType() == SparePartCommString.F_IN_OUT) { - whereStrin = "where goods_id = '" + goodsId + "' and include_taxrate_price = " + stock.getIncludedTaxCostPrice() + - " order by insdt asc"; - } - com.alibaba.fastjson.JSONArray resultJson = inStockRecordService.selectStockDetailByGoosId(whereStrin, stock, warehouse); -// resultJson.addAll(outStockRecordService.selectStockDetailByGoosId(goodsId, whereStrout, stock, warehouse)); - String result = "{\"total\":"+resultJson.size() +",\"rows\":"+resultJson+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 出入库列表 - */ - @RequestMapping("/checkStockDeatil.do") - public ModelAndView checkStockDeatil(HttpServletRequest request, Model model) { - String goodsId = request.getParameter("goodsId"); - String warehouseId = request.getParameter("warehouseId"); - List outStockRecords = outStockRecordService.selectListByWhere("where status != '0' " + - "and status != '2' " + - "and warehouse_id = '" + warehouseId + "'"); - List inStockRecords = inStockRecordService.selectListByWhere("where status != '0' " + - "and status != '2' " + - "and warehouse_id = '" + warehouseId + "'"); - if ((outStockRecords != null && outStockRecords.size() > 0) || (inStockRecords != null && inStockRecords.size() > 0)) { - String result = "{\"data\":"+ 1 +"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } else { - String result = "{\"data\":"+ 0 +"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - } - - - -} diff --git a/src/com/sipai/controller/sparepart/SubscribeController.java b/src/com/sipai/controller/sparepart/SubscribeController.java deleted file mode 100644 index e842f2d7..00000000 --- a/src/com/sipai/controller/sparepart/SubscribeController.java +++ /dev/null @@ -1,1343 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.io.IOException; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.google.gson.JsonArray; -import com.sipai.entity.sparepart.*; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitInquiry; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitDeptApplyService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.business.BusinessUnitInquiryService; -import com.sipai.service.sparepart.ApplyPurchasePlanService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.PurchaseDetailService; -import com.sipai.service.sparepart.PurchasePlanService; -import com.sipai.service.sparepart.PurchaseRecordDetailService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SSCL; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/sparepart/subscribe") -public class SubscribeController { - @Resource - private SubscribeService subscribeService; - @Resource - private GoodsService goodsService; - @Resource - private PurchasePlanService purchasePlanService; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private UnitService unitService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private BusinessUnitInquiryService businessUnitInquiryService; - @Resource - private BusinessUnitDeptApplyService businessUnitDeptApplyService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private ContractService contractService; - @Resource - private ApplyPurchasePlanService applyPurchasePlanService; - /** - * 部门申购界面 - */ - @RequestMapping("/showList.do") - public String showDepartmentPurchaseList(HttpServletRequest request, Model model) { - String relativelyPath = SSCL.cont; - //System.out.println(relativelyPath); - return "/sparepart/subscribeList"; - } - - /** - * 部门申购详情但未关联物品界面 - */ - @RequestMapping("/showDetailList.do") - public String showDetailList(HttpServletRequest request, Model model) { - return "/sparepart/subscribeDetailList"; - } - /** - * 选择申购信息界面 - */ - @RequestMapping("/subscribeList4select.do") - public String subscribeList4select(HttpServletRequest request, Model model) { - String purchaseId = request.getParameter("purchaseId"); - if(purchaseId!=null && !purchaseId.isEmpty()){ - String[] id_Array= purchaseId.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("purchaseId", jsonArray); - } - return "/sparepart/subscribeList4select"; - } - /** - * 采购询价界面 - */ - @RequestMapping("/showPurchaseInquiryList.do") - public String showPurchaseInquiryList(HttpServletRequest request, Model model) { - return "/sparepart/purchaseInquiryList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("status")!= null && !request.getParameter("status").isEmpty()) { - wherestr += " and status = '"+request.getParameter("status")+"'"; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("deptId")!= null && !request.getParameter("deptId").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("deptId")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and id like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("ids")!= null && !request.getParameter("ids").isEmpty()) { - String ids = request.getParameter("ids").replace(",","','"); - wherestr += " and id in ('"+ids+"') "; - } - if (request.getParameter("startdt")!= null && !request.getParameter("startdt").isEmpty()) { - wherestr += " and subscribe_date >= '"+request.getParameter("startdt")+"'"; - } - if (request.getParameter("enddt")!= null && !request.getParameter("enddt").isEmpty()) { - wherestr += " and subscribe_date <= '"+request.getParameter("enddt")+"'"; - } - if (request.getParameter("type")!= null && !request.getParameter("type").isEmpty()) { - String type = request.getParameter("type"); - type = type.replace("-","','"); - wherestr += " and type in ('"+type+"')"; - if(request.getParameter("type").equals(SparePartCommString.personal)){ - //个人申购 - wherestr += " and insuser = '"+cu.getId()+"' "; - } - if(request.getParameter("type").equals(SparePartCommString.department) - || request.getParameter("type").equals(SparePartCommString.temporary) ){ - String ids = this.unitService.getAllUsersByUserId(cu.getId()); - ids = ids.replace(",","','"); - //部门申购、临时申购 - wherestr += " and insuser in ('"+ids+"') "; - } - } - if (request.getParameter("select_type")!= null && !request.getParameter("select_type").isEmpty()) { - String type = request.getParameter("select_type"); - type = type.replace(",","','"); - wherestr += " and type in ('"+type+"')"; - } - if (request.getParameter("goods")!= null && !request.getParameter("goods").isEmpty()) { - String Subscribe=""; - List list = this.subscribeDetailService.selectListByWhere("where goods_id='"+request.getParameter("goods")+"' "); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.subscribeService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getDetailList.do") - public ModelAndView getDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - String unitId = request.getParameter("unitId"); - PageHelper.startPage(page, rows); - String where = "where tssd.goods_id = '' " + - "and biz_id = '" + unitId + "'"; - String order = " order by biz_id"; - String name = request.getParameter("name"); - if (StringUtils.isNotBlank(name)) { - where += " detail_goods_name = '" + name + "'"; - } - List subscribeDetails = subscribeDetailService.selectDetailByBizId(where + order); - PageInfo pInfo = new PageInfo<>(subscribeDetails); - JSONArray jsonArray = JSONArray.fromObject(subscribeDetails); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/doDetailUpdate.do") - public String doDetailUpdate(HttpServletRequest request,Model model) { - String subscribeDetailIds = request.getParameter("subscribeDetailIds"); - String goodsId = request.getParameter("goodsId"); - int result = 0; - if (StringUtils.isNotBlank(subscribeDetailIds) && StringUtils.isNotBlank(goodsId)) { - String replaceids = subscribeDetailIds.replace(",", "','"); - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setGoodsId(goodsId); - subscribeDetail.setWhere("where id in ('" + replaceids + "')"); - result = subscribeDetailService.updateGoodsIdByWhere(subscribeDetail); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 新增部门申购界面 - */ - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-BMSG-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - String type = request.getParameter("type"); - if(type!=null && !SparePartCommString.personal.equals(type)){ - //部门申购、临时申购 - String nowDate = CommUtil.nowDate(); - boolean judgmentType = applyPurchasePlanService.judgmentRange(nowDate,companyId,cu.getPid()); - if(judgmentType){ - //部门申购 - type = SparePartCommString.department; - }else{ - //临时申购 - type = SparePartCommString.temporary; - } - } - model.addAttribute("type",type); - return "/sparepart/subscribeAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Subscribe subscribe = this.subscribeService.selectById(id); - if(subscribe.getType()!=null && SparePartCommString.personal.equals(subscribe.getType())){ - //个人申购 - }else{ - //部门申购、临时申购 - boolean judgmentType = applyPurchasePlanService.judgmentRange(subscribe.getSubscribeDate(),subscribe.getBizId(),subscribe.getDeptId()); - if(judgmentType){ - //部门申购 - subscribe.setType(SparePartCommString.department); - }else{ - //临时申购 - subscribe.setType(SparePartCommString.temporary); - } - } - model.addAttribute("subscribe", subscribe); - return "/sparepart/subscribeEdit"; - } - - /** - * 通知库管页面 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/sendMessage.do") - public String sendMessage(HttpServletRequest request,Model model) { - return "/sparepart/subscribeSendMessage"; - } - /** - * 通知库管 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/sendMessageO.do") - public String sendMessageO(HttpServletRequest request,Model model, - @ModelAttribute SubscribeMessage subscribeMessage) { - User cu = (User) request.getSession().getAttribute("cu"); - subscribeMessage.setId(CommUtil.getUUID()); - subscribeMessage.setInsdt(CommUtil.nowDate()); - subscribeMessage.setInsuser(cu.getId()); - //推送mqtt消息 - if (StringUtils.isNotBlank(subscribeMessage.getSendManId())) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(subscribeMessage); -// businessUnitRecord.sendMessage(purchaseRecord.getsUserId(), "有新的采购记录提交,可进行入库操作!"); - businessUnitRecord.sendMessage(subscribeMessage.getSendManId(), ""); - - } - String resultstr = "{\"res\":\""+1+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Subscribe subscribe) { - User cu = (User) request.getSession().getAttribute("cu"); - if(subscribe.getType()!=null && SparePartCommString.personal.equals(subscribe.getType())){ - //个人申购 - subscribe.setStatus(SparePartCommString.STATUS_PERSONAL_START); - }else{ - //部门申购、临时申购 - boolean judgmentType = applyPurchasePlanService.judgmentRange(subscribe.getSubscribeDate(),subscribe.getBizId(),subscribe.getDeptId()); - if(judgmentType){ - //部门申购 - subscribe.setType(SparePartCommString.department); - }else{ - //临时申购 - subscribe.setType(SparePartCommString.temporary); - } - } - subscribe.setInsdt(CommUtil.nowDate()); - subscribe.setInsuser(cu.getId()); - subscribe.setSubscribeManId(cu.getId()); - int result = this.subscribeService.save(subscribe); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+subscribe.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.subscribeService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.subscribeService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Subscribe subscribe) { - User cu = (User) request.getSession().getAttribute("cu"); - subscribe.setInsuser(cu.getId()); - subscribe.setSubscribeManId(cu.getId()); - if(subscribe.getType()!=null && SparePartCommString.personal.equals(subscribe.getType())){ - //个人申购 - }else{ - //部门申购、临时申购 - boolean judgmentType = applyPurchasePlanService.judgmentRange(subscribe.getSubscribeDate(),subscribe.getBizId(),subscribe.getDeptId()); - if(judgmentType){ - //部门申购 - subscribe.setType(SparePartCommString.department); - }else{ - //临时申购 - subscribe.setType(SparePartCommString.temporary); - } - } - int result = this.subscribeService.update(subscribe); - String resstr="{\"res\":\""+result+"\",\"id\":\""+subscribe.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - Subscribe subscribe = this.subscribeService.selectById(id); - model.addAttribute("subscribe", subscribe); - if (SparePartCommString.personal.equals(subscribe.getType())) { - return "/sparepart/subscribePersonalView"; - } - return "/sparepart/subscribeView"; - } - /** - * 新增申购明细,选择物品信息界面,goodsIds显示已选择的物品,有pid则表示添加的是代替备件 - */ - @RequestMapping("/selectGoodsForSubscribeDetail.do") - public String doaddSubscribeDetail (HttpServletRequest request,Model model) { - String goodsIds = request.getParameter("goodsIds"); - if(goodsIds!=null && !goodsIds.isEmpty()){ - String[] id_Array= goodsIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("goodsIds", jsonArray); - } - return "/sparepart/goods4SubscribeSelects"; - } - /** - * 新增申购明细,选择物品信息界面,goodsIds显示已选择的物品,有pid则表示添加的是代替备件 - */ - @RequestMapping("/selectOneGoodsForSubscribeDetail.do") - public String selectOneGoodsForSubscribeDetail (HttpServletRequest request,Model model) { - String subscribeDetailIds = request.getParameter("subscribeDetailIds"); - if (StringUtils.isNotBlank(subscribeDetailIds)) { - model.addAttribute("subscribeDetailIds", subscribeDetailIds); - } - return "/sparepart/goods4SubscribeOneSelect"; - } - - //单选备件 - @RequestMapping("/getOneGoodsSelect.do") - public String getOneGoodsSelect(HttpServletRequest request, Model model) { - return "/sparepart/goodsForOneGoodsSelect"; - } - - /** - * 新增申购明细,选择物品信息界面,goodsIds显示已选择的物品--历史订单 - */ - @RequestMapping("/selectGoodsForSubscribeHistory.do") - public String doaddSubscribeDetail4History (HttpServletRequest request,Model model) { - String goodsIds = request.getParameter("goodsIds"); - if(goodsIds!=null && !goodsIds.isEmpty()){ - String[] id_Array= goodsIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("goodsIds", jsonArray); - } - return "/sparepart/goods4SubscribeSelectsHistory"; - } - /** - * 保存部门申购明细,申购新增页面选择物品后保存物品明细 - */ - @RequestMapping("/updateSubscribeDetails.do") - public String doupdateSubscribeDetails(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String subscribeId = request.getParameter("subscribeId"); - String deptId = request.getParameter("deptId"); - String goodsIds = request.getParameter("goodsIds"); - String[] idArrary = goodsIds.split(","); - int result =0; - //申购单中已经存在的物品明细,再次新增明细时不用再次保存,防止明细的数量,单价等被清空 - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - String wherestr = "where subscribe_id = '"+subscribeId+"' and goods_id = '"+str+"'"; - List subscribeDetails = this.subscribeDetailService.selectListByWhere(wherestr); - if (subscribeDetails == null || subscribeDetails.size() == 0) { - Goods goods = goodsService.selectById(str); - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setInsdt(CommUtil.nowDate()); - subscribeDetail.setInsuser(cu.getId()); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setGoodsId(str); - subscribeDetail.setDeptId(deptId); - subscribeDetail.setDetailGoodsModel(goods.getModel()); - subscribeDetail.setDetailGoodsSpecifications(goods.getModel()); - subscribeDetail.setDetailGoodsName(goods.getName()); - result += this.subscribeDetailService.save(subscribeDetail); - } - } - } - //再次选择时,取消原先选择的数据,要删除 - List list = this.subscribeDetailService.selectListByWhere("where subscribe_id = '"+subscribeId+"'"); - for (SubscribeDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getGoodsId()); - if (!isInArray && StringUtils.isNotBlank(item.getGoodsId())) { - this.subscribeDetailService.deleteById(item.getId()); - }; - } - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存合同中的物品明细,只更新合同ID - */ - @RequestMapping("/updateSubscribeDetails4contract.do") - public String updateSubscribeDetails4contract(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String subscribeIds = request.getParameter("subscribeId"); - String contractId = request.getParameter("contractId"); - String goodsIds = request.getParameter("goodsIds"); - String[] subscribeIdArrary = subscribeIds.split(","); - String[] idArrary = goodsIds.split(","); - //再次选择时,取消原先选择的数据,要删除 - List list = this.subscribeDetailService.selectListByWhere("where contract_id = '"+contractId+"'"); - for (SubscribeDetail item : list) { - boolean isInArray = this.subscribeDetailService.isInArray(idArrary, item.getGoodsId()); - if (!isInArray) { - item.setContractId(null); - this.subscribeDetailService.update(item); - }; - } - int result =0; - //申购单中已经存在的物品明细,再次新增明细时不用再次保存,防止明细的数量,单价等被清空 - for (String subscribeId : subscribeIdArrary) { - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - String wherestr = "where subscribe_id = '"+subscribeId+"' and goods_id = '"+str+"'"; - List subscribeDetails = this.subscribeDetailService.selectListByWhere(wherestr); - if (subscribeDetails != null && subscribeDetails.size() > 0) { - for (SubscribeDetail subscribeDetail: subscribeDetails) { - subscribeDetail.setContractId(contractId); - result += this.subscribeDetailService.update(subscribeDetail); - } - } - } - } - } - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/saveSubscribeDetail.do") - public String dosavePurchaseDetail(HttpServletRequest request,Model model, - @ModelAttribute SubscribeDetail subscribeDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setInsdt(CommUtil.nowDate()); - subscribeDetail.setInsuser(cu.getId()); - int result = this.subscribeDetailService.save(subscribeDetail); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+subscribeDetail.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/getSubscribeDetailList.do") - public ModelAndView getSubscribeDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String pid = request.getParameter("pid"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = "where 1=1"; - if (request.getParameter("subscribe_id")!= null && !request.getParameter("subscribe_id").isEmpty()) { - wherestr += " and subscribe_id like '%"+request.getParameter("subscribe_id")+"'%"; - } - if (request.getParameter("pid")!= null && !request.getParameter("pid").isEmpty()) { - wherestr += " and subscribe_id = '"+request.getParameter("pid")+"'"; - } - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and dept_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - //选择采购计划明细时用到,加载出所有完成审核的申购单的明细 - if (request.getParameter("pids")!= null && !request.getParameter("pids").isEmpty()) { - String pids = request.getParameter("pids"); - pids = pids.replace(",","','"); - wherestr += " and subscribe_id in ('"+pids+"')"; - } - if (request.getParameter("contractid")!= null && !request.getParameter("contractid").isEmpty()) { - wherestr += " and contract_id = '"+request.getParameter("contractid")+"'"; - } - //选择合同明细时用到 - if (request.getParameter("contractDetail")!= null && !request.getParameter("contractDetail").isEmpty()) { - wherestr += " and contract_id is null "; - } - PageHelper.startPage(page, rows); - List list = this.subscribeDetailService.selectListByWhere(wherestr+orderstr); - if (request.getParameter("pids")!= null && !request.getParameter("pids").isEmpty()) { - for (SubscribeDetail item : list) { - BigDecimal usableNumber = this.subscribeDetailService.getUsableNumber(item.getId()); - item.setUsableNumber(usableNumber); - } - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/editSubscribeDetail.do") - public String doeditSubscribeDetail(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - SubscribeDetail subscribeDetail = this.subscribeDetailService.selectById(id); - model.addAttribute("subscribeDetail", subscribeDetail); - return "/sparepart/subscribeDetailEdit"; - } - /** - * 申购明细修改数量或价格后更新,同时更新明细的合计金额 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateSubscribeDetail.do") - public String doupdateSubscribeDetail(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String number = request.getParameter("number");//数量 - String price = request.getParameter("price");//价格 - //用途 - String purpose = request.getParameter("purpose"); - //是否安装 - String install = request.getParameter("install"); - String brand = request.getParameter("brand"); - String design = request.getParameter("design"); - String manufacturer = request.getParameter("manufacturer"); - - String planArrivalTime = request.getParameter("planArrivalTime"); - String planArrivalPlace = request.getParameter("planArrivalPlace"); - - SubscribeDetail subscribeDetail = this.subscribeDetailService.selectById(id); - if(null != purpose && !purpose.equals("")){ - subscribeDetail.setPurpose(purpose); - } - if(null != install && !install.equals("")){ - subscribeDetail.setInstall(install); - } - if(null != brand && !brand.equals("")){ - subscribeDetail.setBrand(brand); - } - if(null != design && !design.equals("")){ - subscribeDetail.setDesign(design); - } - if(null != manufacturer && !manufacturer.equals("")){ - subscribeDetail.setManufacturer(manufacturer); - } - if(null != planArrivalTime && !planArrivalTime.equals("")){ - subscribeDetail.setPlanArrivalTime(planArrivalTime); - } - if(null != planArrivalPlace && !planArrivalPlace.equals("")){ - subscribeDetail.setPlanArrivalPlace(planArrivalPlace); - } - int result = this.subscribeDetailService.updateTotalMoney(subscribeDetail,number,price); - String resstr="{\"res\":\""+result+"\",\"id\":\""+subscribeDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deletesSubscribeDetail.do") - public String dodeletesSubscribeDetail(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.subscribeDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletesSubscribeDetail4contract.do") - public String deletesSubscribeDetail4contract(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result =0; - //再次选择时,取消原先选择的数据,要删除 - List list = this.subscribeDetailService.selectListByWhere("where id in ('"+ids+"')"); - if(list!=null && list.size()>0){ - for (SubscribeDetail item : list) { - item.setContractId(""); - result = this.subscribeDetailService.update(item); - } - } - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/addSubscribeDetailchannelsId.do") - public String addSubscribeDetailchannelsId(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,@RequestParam(value = "channelsId") String channelsid){ - int result = 0; - if(ids!=null && !ids.equals("")){ - String[] id = ids.split(","); - for(int i=0;i businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(subscribe); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(subscribe.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_DEPT_APPLY: - List list_apply = businessUnitDeptApplyService.selectListByWhere("where subscribe_id='"+subscribeId+"' "); - for (BusinessUnitDeptApply businessUnitDeptApply : list_apply) { - businessUnitRecord = new BusinessUnitRecord(businessUnitDeptApply); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_INQUIRY: - List list_inquiry = businessUnitInquiryService.selectListByWhere("where subscribe_id='"+subscribeId+"' "); - for (BusinessUnitInquiry businessUnitInquiry : list_inquiry) { - businessUnitRecord = new BusinessUnitRecord(businessUnitInquiry); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_SUBSCRIBE_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+subscribeId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId=subscribe.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(subscribe.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - - if(request.getParameter("inModal")!=null){ - //判断显示在流程处理模态框右侧 - return "sparepart/subscribeExecuteViewInModal"; - }else{ - return "sparepart/subscribeExecuteView"; - } - } - /** - * 显示任务审核 - * */ - @RequestMapping("/showSubscribeAudit.do") - public String showSubscribeAudit(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String subscribeId = request.getParameter("subscribeId"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - Subscribe subscribe = this.subscribeService.selectById(subscribeId); - model.addAttribute("subscribe", subscribe); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/subscribeAudit"; - } - /** - * 流程流转-任务审核*/ - @RequestMapping("/doAuditSubscribe.do") - public String doAuditSubscribe(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.subscribeService.doAudit(businessUnitAudit); - - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 采购询价审核 - * */ - @RequestMapping("/showSubscribeInquiry.do") - public String showSubscribeInquiry(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - //String subscribeId = request.getParameter("subscribeId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - Subscribe subscribe = this.subscribeService.selectById(pInstance.getBusinessKey()); - model.addAttribute("subscribe", subscribe); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - /*ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - }*/ - return "sparepart/purchaseInquiry"; - } - /** - * 显示任务处理-采购询价 - * */ - /*@RequestMapping("/showSubscribeInquiry.do") - public String showSubscribeInquiry(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitInquiry businessUnitInquiry = new BusinessUnitInquiry(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - //List commentString =workflowService.findTaskComments(taskId, processInstanceId); - model.addAttribute("taskName", task.getName()); - List businessUnitInquiries = this.businessUnitInquiryService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitInquiries!= null && businessUnitInquiries.size()>0){ - businessUnitInquiry = businessUnitInquiries.get(0); - //若任务退回后,需更新新的任务id - businessUnitInquiry.setTaskid(taskId); - }else{ - businessUnitInquiry.setId(CommUtil.getUUID()); - businessUnitInquiry.setProcessid(processInstanceId); - businessUnitInquiry.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitInquiry.setSubscribeId(pInstance.getBusinessKey()); - businessUnitInquiry.setTaskdefinitionkey(task.getTaskDefinitionKey()); - } - String userIds = businessUnitInquiry.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitInquiry", businessUnitInquiry); - model.addAttribute("nowDate", CommUtil.nowDate()); - Subscribe subscribe = this.subscribeService.selectById(businessUnitInquiry.getSubscribeId()); - model.addAttribute("subscribe", subscribe); - List businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessid = '"+subscribe.getId()+"' order by insdt desc"); - String rejectReson =""; - if (businessUnitAudits!=null && businessUnitAudits.size()>0) { - rejectReson = businessUnitAudits.get(0).getAuditopinion(); - } - model.addAttribute("rejectReson", rejectReson); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/purchaseInquiry"; - }*/ - /** - * 显示任务处理-部门申请 - * */ - @RequestMapping("/showDeptApply.do") - public String showDeptApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitDeptApply businessUnitDeptApply = new BusinessUnitDeptApply(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - //List commentString =workflowService.findTaskComments(taskId, processInstanceId); - model.addAttribute("taskName", task.getName()); - List businessUnitDeptApplies = this.businessUnitDeptApplyService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitDeptApplies!= null && businessUnitDeptApplies.size()>0){ - businessUnitDeptApply = businessUnitDeptApplies.get(0); - //若任务退回后,需更新新的任务id - businessUnitDeptApply.setTaskid(taskId); - }else{ - businessUnitDeptApply.setId(CommUtil.getUUID()); - businessUnitDeptApply.setProcessid(processInstanceId); - businessUnitDeptApply.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitDeptApply.setSubscribeId(pInstance.getBusinessKey()); - businessUnitDeptApply.setTaskdefinitionkey(task.getTaskDefinitionKey()); - } - String userIds = businessUnitDeptApply.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitDeptApply", businessUnitDeptApply); - model.addAttribute("nowDate", CommUtil.nowDate()); - Subscribe subscribe = this.subscribeService.selectById(businessUnitDeptApply.getSubscribeId()); - model.addAttribute("subscribe", subscribe); - List businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessId = '"+subscribe.getId()+"' order by insdt desc"); - String rejectReson =""; - if (businessUnitAudits!=null && businessUnitAudits.size()>0) { - rejectReson = businessUnitAudits.get(0).getAuditopinion(); - } - model.addAttribute("rejectReson", rejectReson); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "sparepart/subscribeEditForDeptApply"; - } - /** - *流程流转-部门申请*/ - @RequestMapping("/doHandleDeptApply.do") - public String doHandleDeptApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitDeptApply businessUnitDeptApply){ - User cu= (User)request.getSession().getAttribute("cu"); - String routeNum=request.getParameter("routeNum"); - int result=0; - businessUnitDeptApply.setStatus(BusinessUnitHandle.Status_FINISH); - if(!this.businessUnitDeptApplyService.checkExit(businessUnitDeptApply)) { - businessUnitDeptApply.setInsuser(cu.getId()); - businessUnitDeptApply.setInsdt(CommUtil.nowDate()); - result =this.businessUnitDeptApplyService.save(businessUnitDeptApply); - }else { - result =this.businessUnitDeptApplyService.update(businessUnitDeptApply); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitDeptApply.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitDeptApply.getTaskid(), variables); - //发送消息 - if(businessUnitDeptApply.getTargetusers()!=null && !businessUnitDeptApply.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitDeptApply = businessUnitDeptApplyService.selectById(businessUnitDeptApply.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitDeptApply); - businessUnitRecord.sendMessage(businessUnitDeptApply.getTargetusers(),""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitDeptApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 获取申购单 - * */ - @RequestMapping("/getSubscribe4Select.do") - public String getSubscribe4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.subscribeService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (Subscribe subscribe : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", subscribe.getId()); - jsonObject.put("text", subscribe.getId()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - /** - *流程流转-采购询价*/ - /*@RequestMapping("/doHandleInquiry.do") - public String doHandleInquiry(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitInquiry businessUnitInquiry){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitInquiry.setStatus(BusinessUnitHandle.Status_FINISH); - if(!this.businessUnitInquiryService.checkExit(businessUnitInquiry)) { - businessUnitInquiry.setInsuser(cu.getId()); - businessUnitInquiry.setInsdt(CommUtil.nowDate()); - result =this.businessUnitInquiryService.save(businessUnitInquiry); - }else { - result =this.businessUnitInquiryService.update(businessUnitInquiry); - } - try { - Map variables = new HashMap(); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitInquiry.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitInquiry.getTaskid(), variables); - //发送消息 - if(businessUnitInquiry.getTargetusers()!=null && !businessUnitInquiry.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitInquiry = businessUnitInquiryService.selectById(businessUnitInquiry.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitInquiry); - businessUnitRecord.sendMessage(businessUnitInquiry.getTargetusers(),""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitInquiry.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - }*/ - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - String subscribeId = request.getParameter("subscribeId"); - String contractId = request.getParameter("contractId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? subscribeDetailService.readXls(excelFile.getInputStream(),subscribeId,contractId,cu.getId()) : this.subscribeDetailService.readXlsx(excelFile.getInputStream(),subscribeId,contractId,cu.getId()); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 导入采购明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/importSubscribeDetail.do") - public String doimport(HttpServletRequest request,Model model){ - return "sparepart/subscribeDetailImport"; - } - /** - * 导入设备信息 - * @param request - * @param model - * @return - */ - @RequestMapping("/openExcelTemplate.do") - public String openExcelTemplate(HttpServletRequest request,Model model){ - return "sparepart/openExcelTemplate"; - } - /** - * 导出设备excel表 - * @throws IOException - */ - @RequestMapping(value = "downloadSubscribeDetailExcel.do") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String wherestr ="where id is not null "; - String orderStr = " order by id "; - int outType = 0;//0是申购,1是合同 - if(request.getParameter("subscribeId")!=null && !request.getParameter("subscribeId").isEmpty()){ - String subscribeId = request.getParameter("subscribeId").replace(",","','"); - wherestr +=" and subscribe_id in ('"+subscribeId+"') "; - orderStr = " order by subscribe_id,id "; - } - if(request.getParameter("contractId")!=null && !request.getParameter("contractId").isEmpty()){ - String contractId = request.getParameter("contractId").replace(",","','"); - wherestr +=" and contract_id in ('"+contractId+"') "; - orderStr = " order by contract_id,id "; - outType=1; - } - ListsubscribeDetails = this.subscribeDetailService.selectListByWhere(wherestr+orderStr); - //导出文件到指定目录,兼容Linux - this.subscribeDetailService.downloadSubscribeDetailExcel(response, subscribeDetails,outType); - return null; - } - - /** - * 导出excel表 的 模板 - * @throws IOException - */ - @RequestMapping(value = "downloadSubscribeDetailExcelTemplate.do") - public ModelAndView downloadFileTemplate(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - int excelCount = Integer.valueOf(request.getParameter("excelCount")); - String channelsids = request.getParameter("channelsid"); - String contractId = request.getParameter("contractId"); - int outType = 0;//0是申购,1是合同 - if(request.getParameter("contractId")!=null && !request.getParameter("contractId").isEmpty()){ - outType=1; - } - //导出文件到指定目录,兼容Linux - this.subscribeDetailService.downloadSubscribeDetailExcelTemplate(response, excelCount,channelsids,outType); - return null; - } - /** - * 导出设备excel表 - * @throws IOException - */ - @RequestMapping(value = "downloadEquipmentExcel.do") - public ModelAndView downloadEquipmentExcel(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String wherestr ="where id is not null "; - String orderStr = " order by id "; - if(request.getParameter("subscribeId")!=null && !request.getParameter("subscribeId").isEmpty()){ - String subscribeId = request.getParameter("subscribeId").replace(",","','"); - wherestr +=" and subscribe_id in ('"+subscribeId+"') "; - orderStr = " order by subscribe_id,id "; - } - String contractNumbers = ""; - if(request.getParameter("contractId")!=null && !request.getParameter("contractId").isEmpty()){ - String contractId = request.getParameter("contractId").replace(",","','"); - wherestr +=" and contract_id in ('"+contractId+"') "; - orderStr = " order by contract_id,id "; - List contractList = this.contractService.selectListByWhere("where id in ('"+contractId+"') order by insdt desc"); - for(Contract contract:contractList){ - contractNumbers += contract.getContractnumber()+","; - } - if(contractNumbers!=null && !contractNumbers.equals("") && contractNumbers.length()>0){ - contractNumbers = contractNumbers.substring(0, contractNumbers.length()-1); - } - } - ListsubscribeDetails = this.subscribeDetailService.selectListByWhere(wherestr+orderStr); - //导出文件到指定目录,兼容Linux - this.subscribeDetailService.downloadEquipmentExcel(response, subscribeDetails,contractNumbers); - return null; - } - - /** - * 选择个人申购信息界面 - */ - @RequestMapping("/subscribeList4personalselect.do") - public String subscribeList4personalselect(HttpServletRequest request, Model model) { - return "/sparepart/subscribeList4personalselect"; - } - @RequestMapping("/doSelectPersonalDetil.do") - public ModelAndView doSelectPersonalDetil(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - int res = 0; - String personalIds = ""; - String departmentId = request.getParameter("departmentId"); - if(request.getParameter("datas")!=null && !request.getParameter("datas").isEmpty()){ - personalIds = request.getParameter("datas").replace(",","','"); - } - res = this.subscribeDetailService.personalDetil2Department(personalIds,departmentId,cu); - String result = "{\"res\":"+res+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/sparepart/SupplierClassController.java b/src/com/sipai/controller/sparepart/SupplierClassController.java deleted file mode 100644 index fb94baa0..00000000 --- a/src/com/sipai/controller/sparepart/SupplierClassController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.SupplierClass; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.SupplierClassService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/supplierClass") -public class SupplierClassController { - @Resource - private SupplierClassService supplierClassService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/supplierClassList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.supplierClassService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/supplierClassAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute SupplierClass supplierClass) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierClass.setId(CommUtil.getUUID()); - supplierClass.setInsdt(CommUtil.nowDate()); - supplierClass.setInsuser(cu.getId()); - int result = this.supplierClassService.save(supplierClass); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+supplierClass.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.supplierClassService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.supplierClassService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - SupplierClass supplierClass = this.supplierClassService.selectById(id); - model.addAttribute("supplierClass", supplierClass); - return "/sparepart/supplierClassEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute SupplierClass supplierClass) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierClass.setInsdt(CommUtil.nowDate()); - supplierClass.setInsuser(cu.getId()); - int result = this.supplierClassService.update(supplierClass); - String resstr="{\"res\":\""+result+"\",\"id\":\""+supplierClass.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - SupplierClass supplierClass = this.supplierClassService.selectById(id); - model.addAttribute("supplierClass", supplierClass); - return "/sparepart/supplierClassView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getSupplierClass4Select.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.supplierClassService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (SupplierClass supplierClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", supplierClass.getId()); - jsonObject.put("text", supplierClass.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/SupplierClass_copyController.java b/src/com/sipai/controller/sparepart/SupplierClass_copyController.java deleted file mode 100644 index 2398a1ef..00000000 --- a/src/com/sipai/controller/sparepart/SupplierClass_copyController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.SupplierClass_copy; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.SupplierClass_copyService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/supplierClass_copy") -public class SupplierClass_copyController { - @Resource - private SupplierClass_copyService supplierClassService1; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/supplierClass_copyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.supplierClassService1.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/supplierClass_copyAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute SupplierClass_copy supplierClass) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierClass.setId(CommUtil.getUUID()); - supplierClass.setInsdt(CommUtil.nowDate()); - supplierClass.setInsuser(cu.getId()); - int result = this.supplierClassService1.save(supplierClass); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+supplierClass.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.supplierClassService1.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.supplierClassService1.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - SupplierClass_copy supplierClass = this.supplierClassService1.selectById(id); - model.addAttribute("supplierClass", supplierClass); - return "/sparepart/supplierClass_copyEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute SupplierClass_copy supplierClass) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierClass.setInsdt(CommUtil.nowDate()); - supplierClass.setInsuser(cu.getId()); - int result = this.supplierClassService1.update(supplierClass); - String resstr="{\"res\":\""+result+"\",\"id\":\""+supplierClass.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - SupplierClass_copy supplierClass = this.supplierClassService1.selectById(id); - model.addAttribute("supplierClass", supplierClass); - return "/sparepart/supplierClass_copyView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getSupplierClass4Select.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.supplierClassService1.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (SupplierClass_copy supplierClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", supplierClass.getId()); - jsonObject.put("text", supplierClass.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/SupplierController.java b/src/com/sipai/controller/sparepart/SupplierController.java deleted file mode 100644 index 3b0f8725..00000000 --- a/src/com/sipai/controller/sparepart/SupplierController.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.sparepart.SupplierQualification; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.SupplierQualificationService; -import com.sipai.service.sparepart.SupplierService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/supplier") -public class SupplierController { - @Resource - private SupplierService supplierService; - @Resource - private SupplierQualificationService supplierQualificationService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/supplierList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - if (request.getParameter("type_name")!= null && !request.getParameter("type_name").isEmpty()) { - wherestr += " and type_status like '%"+request.getParameter("type_name")+"%'"; - } - if (request.getParameter("supplierClass")!= null && !request.getParameter("supplierClass").isEmpty()) { - wherestr += " and class_id in ('"+request.getParameter("supplierClass")+"')"; - } - - PageHelper.startPage(page, rows); - //System.out.println(wherestr); - List list = this.supplierService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(updateTypeforList(list)); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - //System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/supplierAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Supplier supplier) { - User cu = (User) request.getSession().getAttribute("cu"); - supplier.setId(CommUtil.getUUID()); - supplier.setInsdt(CommUtil.nowDate()); - supplier.setInsuser(cu.getId()); - supplier.setType("启用"); - int result = this.supplierService.save(supplier); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.supplierService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.supplierService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Supplier supplier = this.supplierService.selectById(id); - model.addAttribute("supplier", supplier); - return "/sparepart/supplierEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Supplier supplier) { - User cu = (User) request.getSession().getAttribute("cu"); - supplier.setInsdt(CommUtil.nowDate()); - supplier.setInsuser(cu.getId()); - int result = this.supplierService.update(supplier); - String resstr="{\"res\":\""+result+"\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/updateType.do") - public void updateType() { - List list = this.supplierService.selectListByWhere("where 1=1"); - updateTypeforList(list); - } - @RequestMapping("/updateTypeforList.do") - public List updateTypeforList(List list ) { - - for (Supplier supplier : list) { - - - String wherestrQualification = " where 1=1 "+" and supplier_id = '"+supplier.getId()+"'"; - - List list1 = this.supplierQualificationService.selectListByWhere(wherestrQualification); - if(list1.size()==0){ - //njp 20200922 修改为当没有资质时,不进行状态判断,默认启用;考虑到不是所有类型的供应商都有必须有资质 - //supplier.setType("禁用"); - }else{ - int k=0; - for (SupplierQualification supplierQualification : list1) { - if(CommUtil.compare_time(supplierQualification.getQualificationValidityTime(),CommUtil.nowDate()) != 1|| "禁用".equals(supplierQualification.getQualificationState())){ - k=k+1; - } - } - if (k==list1.size()){ supplier.setType("禁用"); } - } - this.supplierService.update(supplier); - } - - return list; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Supplier supplier = this.supplierService.selectById(id); - model.addAttribute("supplier", supplier); - return "/sparepart/supplierView"; - } - @RequestMapping("/gettype.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - JSONArray json=new JSONArray(); - - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", "潜在"); - jsonObject.put("text","潜在"); - json.add(jsonObject); - JSONObject jsonObject1 =new JSONObject(); - jsonObject1.put("id", "登记"); - jsonObject1.put("text","登记"); - json.add(jsonObject1); - model.addAttribute("result", json.toString()); - return "result"; - } - /** - * 获取供应商 - * */ - @RequestMapping("/getSupplier4Select.do") - public String getSupplier4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.supplierService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (Supplier supplier : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", supplier.getId()); - jsonObject.put("text", supplier.getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/SupplierQualificationController.java b/src/com/sipai/controller/sparepart/SupplierQualificationController.java deleted file mode 100644 index 57f76957..00000000 --- a/src/com/sipai/controller/sparepart/SupplierQualificationController.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.batik.ext.awt.image.SVGComposite.ScreenCompositeContext; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.sparepart.QualificationType; -import com.sipai.entity.sparepart.Score; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.sparepart.SupplierClass; -import com.sipai.entity.sparepart.SupplierQualification; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.QualificationTypeService; -import com.sipai.service.sparepart.SupplierQualificationService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DateUtil; - -@Controller -@RequestMapping("/sparepart/supplierQualification") -public class SupplierQualificationController { - - @Resource - private SupplierQualificationService supplierQualificationService; - @Resource - private QualificationTypeService qualificationTypeService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/supplierQualificationList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - System.out.println("#####"+request.getParameter("modelid")); - - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - wherestr += " and supplier_id = '"+request.getParameter("modelid")+"'"; - - PageHelper.startPage(page, rows); - List list = this.supplierQualificationService.selectListByWhere(wherestr+orderstr); - for (SupplierQualification supplierQualification : list ) { - QualificationType qualificationType = this.qualificationTypeService.selectById(supplierQualification.getQualificationType()); - supplierQualification.setQualificationTypeName(qualificationType.getTypeName()); - supplierQualification.setQualificationValidityTime(supplierQualification.getQualificationValidityTime().substring(0,10)); - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - System.out.println(jsonArray); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - HttpSession session= request.getSession(); - session.setAttribute("usid1", request.getParameter("usid1")); - model.addAttribute("usid",request.getParameter("usid1")); - System.out.println("#####"+request.getParameter("usid1")); - System.out.println(request.getSession().getAttribute("usid1").toString()); - return "/sparepart/supplierQualificationAdd"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - //@RequestParam(value = "usid1") String usid1, - @ModelAttribute SupplierQualification supplierQualification) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierQualification.setId(CommUtil.getUUID()); - supplierQualification.setInsdt(CommUtil.nowDate()); - supplierQualification.setInsuser(cu.getId()); - //supplierQualification.setQualificationType(supplierQualification.getQualificationType()); - System.out.println("####type#"+supplierQualification.getQualificationType()); - //supplierQualification.setSupplierId(request.getSession().getAttribute("usid1").toString()); - int result = this.supplierQualificationService.save(supplierQualification); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+supplierQualification.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - SupplierQualification supplierQualification = this.supplierQualificationService.selectById(id); - model.addAttribute("supplierQualification", supplierQualification); - return "/sparepart/supplierQualificationView"; - } - - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - SupplierQualification supplierQualification = this.supplierQualificationService.selectById(id); - - model.addAttribute("supplierQualification", supplierQualification); - return "/sparepart/supplierQualificationEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute SupplierQualification supplierQualification) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierQualification.setInsdt(CommUtil.nowDate()); - supplierQualification.setInsuser(cu.getId()); - supplierQualification.setQualificationType(supplierQualification.getQualificationTypeName()); - int result = this.supplierQualificationService.update(supplierQualification); - System.out.println(supplierQualification.getId()+supplierQualification.getQualificationValidityTime()+supplierQualification.getName()); - String resstr="{\"res\":\""+result+"\",\"id\":\""+supplierQualification.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - System.out.println("%%%%%%%"+id); - int result = this.supplierQualificationService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/deletebySupplierId.do") - public String deletebySupplierId(HttpServletRequest request,Model model, - @RequestParam(value = "id") String supplierId) { - supplierId = supplierId.replace(",","','"); - System.out.println("%%%%%%%"+supplierId); - int result = this.supplierQualificationService.deleteByWhere("where supplier_id in ('"+supplierId+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - System.out.println("%%%%%%%"+ids); - int result = this.supplierQualificationService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/getQualificationType.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.qualificationTypeService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (QualificationType qualificationType : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", qualificationType.getId()); - jsonObject.put("text", qualificationType.getTypeName()); - - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/sparepart/SupplierQualification_copyController.java b/src/com/sipai/controller/sparepart/SupplierQualification_copyController.java deleted file mode 100644 index 3cb9e5b9..00000000 --- a/src/com/sipai/controller/sparepart/SupplierQualification_copyController.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.QualificationType_copy; -import com.sipai.entity.sparepart.SupplierQualification_copy; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.QualificationType_copyService; -import com.sipai.service.sparepart.SupplierQualification_copyService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/supplierQualification_copy") -public class SupplierQualification_copyController { - - @Resource - private SupplierQualification_copyService supplierQualificationService1; - @Resource - private QualificationType_copyService qualificationTypeService1; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/supplierQualification_copyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - System.out.println("#####"+request.getParameter("modelid")); - - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - wherestr += " and supplier_id = '"+request.getParameter("modelid")+"'"; - - PageHelper.startPage(page, rows); - List list = this.supplierQualificationService1.selectListByWhere(wherestr+orderstr); - for (SupplierQualification_copy supplierQualification : list ) { - QualificationType_copy qualificationType = this.qualificationTypeService1.selectById(supplierQualification.getQualificationType()); - supplierQualification.setQualificationTypeName(qualificationType.getTypeName()); - supplierQualification.setQualificationValidityTime(supplierQualification.getQualificationValidityTime().substring(0,10)); - } - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - System.out.println(jsonArray); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - HttpSession session= request.getSession(); - session.setAttribute("usid1", request.getParameter("usid1")); - model.addAttribute("usid",request.getParameter("usid1")); - System.out.println("#####"+request.getParameter("usid1")); - System.out.println(request.getSession().getAttribute("usid1").toString()); - return "/sparepart/supplierQualification_copyAdd"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - //@RequestParam(value = "usid1") String usid1, - @ModelAttribute SupplierQualification_copy supplierQualification) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierQualification.setId(CommUtil.getUUID()); - supplierQualification.setInsdt(CommUtil.nowDate()); - supplierQualification.setInsuser(cu.getId()); - //supplierQualification.setQualificationType(supplierQualification.getQualificationType()); - System.out.println("####type#"+supplierQualification.getQualificationType()); - //supplierQualification.setSupplierId(request.getSession().getAttribute("usid1").toString()); - int result = this.supplierQualificationService1.save(supplierQualification); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+supplierQualification.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - SupplierQualification_copy supplierQualification = this.supplierQualificationService1.selectById(id); - model.addAttribute("supplierQualification", supplierQualification); - return "/sparepart/supplierQualification_copyView"; - } - - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - SupplierQualification_copy supplierQualification = this.supplierQualificationService1.selectById(id); - - model.addAttribute("supplierQualification", supplierQualification); - return "/sparepart/supplierQualification_copyEdit"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute SupplierQualification_copy supplierQualification) { - User cu = (User) request.getSession().getAttribute("cu"); - supplierQualification.setInsdt(CommUtil.nowDate()); - supplierQualification.setInsuser(cu.getId()); - supplierQualification.setQualificationType(supplierQualification.getQualificationTypeName()); - int result = this.supplierQualificationService1.update(supplierQualification); - System.out.println(supplierQualification.getId()+supplierQualification.getQualificationValidityTime()+supplierQualification.getName()); - String resstr="{\"res\":\""+result+"\",\"id\":\""+supplierQualification.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - System.out.println("%%%%%%%"+id); - int result = this.supplierQualificationService1.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/deletebySupplierId.do") - public String deletebySupplierId(HttpServletRequest request,Model model, - @RequestParam(value = "id") String supplierId) { - supplierId = supplierId.replace(",","','"); - System.out.println("%%%%%%%"+supplierId); - int result = this.supplierQualificationService1.deleteByWhere("where supplier_id in ('"+supplierId+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - System.out.println("%%%%%%%"+ids); - int result = this.supplierQualificationService1.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/getQualificationType.do") - public String getSupplierClass4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.qualificationTypeService1.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (QualificationType_copy qualificationType : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", qualificationType.getId()); - jsonObject.put("text", qualificationType.getTypeName()); - - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - -} diff --git a/src/com/sipai/controller/sparepart/Supplier_copyController.java b/src/com/sipai/controller/sparepart/Supplier_copyController.java deleted file mode 100644 index 2fa9d464..00000000 --- a/src/com/sipai/controller/sparepart/Supplier_copyController.java +++ /dev/null @@ -1,311 +0,0 @@ -package com.sipai.controller.sparepart; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.dao.user.MobileManagementDao; -import com.sipai.entity.sparepart.SupplierQualification_copy; -import com.sipai.entity.sparepart.Supplier_copy; -import com.sipai.entity.user.*; -import com.sipai.service.sparepart.SupplierQualification_copyService; -import com.sipai.service.sparepart.Supplier_copyService; -import com.sipai.service.user.MobileManagementService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/sparepart/supplier_copy") -public class Supplier_copyController { - @Resource - private Supplier_copyService supplierService1; - @Resource - private MobileManagementService mobileManagementService; - @Resource - private MobileManagementDao mobileManagementDao; - @Resource - private SupplierQualification_copyService supplierQualificationService1; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/supplier_copyList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.supplierService1.selectListByWhere(wherestr+orderstr); - - PageInfo pInfo = new PageInfo(updateTypeforList(list)); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/supplier_copyAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Supplier_copy supplier) { - User cu = (User) request.getSession().getAttribute("cu"); - supplier.setId(CommUtil.getUUID()); - supplier.setInsdt(CommUtil.nowDate()); - supplier.setInsuser(cu.getId()); - supplier.setType("启用"); - //管理公司管理 - Company t = new Company(); - t.setId(supplier.getId()); - t.setName(supplier.getName()); - t.setAddress(supplier.getAddress()); - t.setActive(CommString.Flag_Active); - t.setType(CommString.UNIT_TYPE_Maintainer); - //新增移动设备 - if(supplier.getUserName()!=null&&!"".equals(supplier.getUserName())){ - MobileManagement mobileManagement = new MobileManagement(); - mobileManagement.setDeviceid(supplier.getUserTelephone()); - - if(mobileManagement.getDeviceid()!=null&&!this.mobileManagementService.checkCardidNotOccupied(mobileManagement.getId(), mobileManagement.getDeviceid())){ - String resultstr = "{\"res\":\"设备id重复\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - User user = new User(); - String userId = CommUtil.getUUID(); - user.setId(userId); - user.setPassword(UserCommStr.default_password); - user.setInsuser(cu.getId()); - user.setInsdt(CommUtil.nowDate()); - user.setSyncflag(CommString.Sync_Insert); - user.setCaption(supplier.getName()); - user.setName(supplier.getUserName()); - user.setActive(CommString.Flag_Active); - user.setPid(supplier.getId()); - if(!this.userService.checkNotOccupied(user.getId(), user.getName())){ - model.addAttribute("result", "{\"res\":\"用户名重复\"}"); - return "result"; - } - this.userService.saveUser(user); - mobileManagement.setUnitId(supplier.getId()); - mobileManagement.setUserId(user.getId()); - mobileManagement.setName(supplier.getUserName()); - mobileManagement.setStatus("启用"); - /* String mobileManagementId = CommUtil.getUUID(); - mobileManagement.setId(mobileManagementId);*/ - mobileManagement.setId(supplier.getId()); - this.mobileManagementService.save(mobileManagement); - } - - int result = this.supplierService1.save(supplier); - this.supplierService1.doCompanySave(t); - - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /* - * 外包单位删除时,关联删除用户、公司、关联设备 - **/ - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - List users = this.userService.selectListByWhere("where pid = '"+id+"'"); - if(users!=null&&users.size()>0){ - this.userService.deleteUserById(users.get(0).getId()); - } - this.unitService.deleteCompanyById(id); - this.mobileManagementService.deleteById(id); - int result = this.supplierService1.deleteById(id); - - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - List users = this.userService.selectListByWhere("where pid in ('"+ids+"')"); - if(users!=null&&users.size()>0){ - for (User user : users) { - this.userService.deleteUserById(user.getId()); - } - - } - List units = this.unitService.selectListByWhere("where id in ('"+ids+"')"); - if(units!=null&&units.size()>0){ - for (Unit unit : units) { - this.unitService.deleteCompanyById(unit.getId()); - } - - } - this.mobileManagementService.deleteByWhere("where id in ('"+ids+"')"); - int result = this.supplierService1.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Supplier_copy supplier = this.supplierService1.selectById(id); - model.addAttribute("supplier", supplier); - return "/sparepart/supplier_copyEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Supplier_copy supplier) { - User cu = (User) request.getSession().getAttribute("cu"); - supplier.setInsdt(CommUtil.nowDate()); - supplier.setInsuser(cu.getId()); - Company t = new Company(); - t.setId(supplier.getId()); - t.setName(supplier.getName()); - t.setAddress(supplier.getAddress()); - t.setActive(CommString.Flag_Active); - - if(supplier.getUserName()!=null&&!"".equals(supplier.getUserName())){ - MobileManagement mobileManagement = new MobileManagement(); - mobileManagement.setDeviceid(supplier.getUserTelephone()); - mobileManagement.setName(supplier.getUserName()); - mobileManagement.setId(supplier.getId()); - - - User user =new User(); - user.setCaption(supplier.getName()); - user.setName(supplier.getUserName()); - user.setId(CommUtil.getUUID()); - if(null == this.mobileManagementDao.selectByPrimaryKey(supplier.getId())){ - if(mobileManagement.getDeviceid()!=null&&!this.mobileManagementService.checkCardidNotOccupied(mobileManagement.getId(), mobileManagement.getDeviceid())){ - String resultstr = "{\"res\":\"设备id重复\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - mobileManagement.setUnitId(supplier.getId()); - mobileManagement.setUserId(cu.getId()); - mobileManagement.setStatus("启用"); - mobileManagement.setUserId(user.getId()); - - user.setPassword(UserCommStr.default_password); - user.setInsuser(cu.getId()); - user.setInsdt(CommUtil.nowDate()); - user.setSyncflag(CommString.Sync_Insert); - - user.setActive(CommString.Flag_Active); - user.setPid(supplier.getId()); - - if(!this.userService.checkNotOccupied(user.getId(), user.getName())){ - model.addAttribute("result", "{\"res\":\"用户名重复\"}"); - return "result"; - } - this.userService.saveUser(user); - this.mobileManagementService.save(mobileManagement); - }else{ - if(!this.userService.checkNotOccupied(supplier.getId(), supplier.getUserName())){ - model.addAttribute("result", "{\"res\":\"用户名重复\"}"); - return "result"; - } - if(mobileManagement.getDeviceid()!=null&&!this.mobileManagementService.checkCardidNotOccupied(mobileManagement.getId(), mobileManagement.getDeviceid())){ - String resultstr = "{\"res\":\"设备id重复\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - List users = this.userService.selectListByWhere("where pid = '"+supplier.getId()+"'"); - User user2 = users.get(0); - user2.setCaption(supplier.getName()); - user2.setName(supplier.getUserName()); - this.userService.updateUserById(user2); - this.mobileManagementService.update(mobileManagement); - } - - - - - } - - this.supplierService1.updateCompany(t); - - int result = this.supplierService1.update(supplier); - String resstr="{\"res\":\""+result+"\",\"id\":\""+supplier.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/updateType.do") - public void updateType() { - - List list = this.supplierService1.selectListByWhere("where 1=1"); - updateTypeforList(list); - - - } - @RequestMapping("/updateTypeforList.do") - public List updateTypeforList(List list ) { - - for (Supplier_copy supplier : list) { - - - String wherestrQualification = " where 1=1 "+" and supplier_id = '"+supplier.getId()+"'"; - - List list1 = this.supplierQualificationService1.selectListByWhere(wherestrQualification); - if(list1.size()==0){ - //njp 20200922 修改为当没有资质时,不进行状态判断,默认启用;考虑到不是所有类型的供应商都有必须有资质 - //supplier.setType("禁用"); - }else{ - int k=0; - for (SupplierQualification_copy supplierQualification : list1) { - if(CommUtil.compare_time(supplierQualification.getQualificationValidityTime(),CommUtil.nowDate()) != 1|| "禁用".equals(supplierQualification.getQualificationState())){ - k=k+1; - } - } - if (k==list1.size()){ supplier.setType("禁用"); } - } - this.supplierService1.update(supplier); - } - - return list; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Supplier_copy supplier = this.supplierService1.selectById(id); - model.addAttribute("supplier", supplier); - return "/sparepart/supplier_copyView"; - } -} diff --git a/src/com/sipai/controller/sparepart/WarehouseController.java b/src/com/sipai/controller/sparepart/WarehouseController.java deleted file mode 100644 index 905625ff..00000000 --- a/src/com/sipai/controller/sparepart/WarehouseController.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.WarehouseService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/warehouse") -public class WarehouseController { - @Resource - private WarehouseService warehouseService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/warehouseList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and biz_id in ("+companyids+") "; - } - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.warehouseService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-CK-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id", id); - model.addAttribute("company", company); - return "/sparepart/warehouseAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Warehouse warehouse) { - User cu = (User) request.getSession().getAttribute("cu"); - warehouse.setInsdt(CommUtil.nowDate()); - warehouse.setInsuser(cu.getId()); - int result = this.warehouseService.save(warehouse); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+warehouse.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.warehouseService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.warehouseService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - Warehouse warehouse = this.warehouseService.selectById(id); - model.addAttribute("warehouse", warehouse); - return "/sparepart/warehouseEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Warehouse warehouse) { - User cu = (User) request.getSession().getAttribute("cu"); - warehouse.setInsdt(CommUtil.nowDate()); - warehouse.setInsuser(cu.getId()); - int result = this.warehouseService.update(warehouse); - String resstr="{\"res\":\""+result+"\",\"id\":\""+warehouse.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - Warehouse warehouse = this.warehouseService.selectById(id); - model.addAttribute("warehouse", warehouse); - return "/sparepart/warehouseView"; - } - - /** - * 根据厂区id选择仓库,输入框下拉选择 - */ - @RequestMapping("/getWarehouseForSelectByCompanyId.do") - public String getWarehouseForSelect(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - String wherestr = " where 1=1 "; - if(null!=companyId && !"".equals(companyId)){ - wherestr += " and status = '"+SparePartCommString.WAREHOUSE_START+"' and biz_id = '"+companyId+"'"; - }else{ - wherestr += " and status = '"+SparePartCommString.WAREHOUSE_START+"'"; - } - - List list = this.warehouseService.selectListByWhere(wherestr); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (Warehouse warehouse : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", warehouse.getId()); - jsonObject.put("text", warehouse.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/sparepart/WarrantyPeriodController.java b/src/com/sipai/controller/sparepart/WarrantyPeriodController.java deleted file mode 100644 index 60ff27b9..00000000 --- a/src/com/sipai/controller/sparepart/WarrantyPeriodController.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.controller.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.sparepart.WarrantyPeriod; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.sparepart.WarrantyPeriodService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/sparepart/warrantyPeriod") -public class WarrantyPeriodController { - @Resource - private WarrantyPeriodService warrantyPeriodService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/sparepart/warrantyPeriodList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort==null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by "+sort+" "+order; - String wherestr = " where 1=1 "; - if (request.getParameter("search_code")!= null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id = '"+request.getParameter("search_code")+"'"; - } - if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - } - PageHelper.startPage(page, rows); - List list = this.warrantyPeriodService.selectListByWhere(wherestr+orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd (HttpServletRequest request,Model model) { - return "/sparepart/warrantyPeriodAdd"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute WarrantyPeriod warrantyPeriod) { - User cu = (User) request.getSession().getAttribute("cu"); - warrantyPeriod.setId(CommUtil.getUUID()); - warrantyPeriod.setInsdt(CommUtil.nowDate()); - warrantyPeriod.setInsuser(cu.getId()); - int result = this.warrantyPeriodService.save(warrantyPeriod); - String resultstr = "{\"res\":\""+result+"\",\"id\":\""+warrantyPeriod.getId()+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - int result = this.warrantyPeriodService.deleteById(id); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.warrantyPeriodService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id) { - WarrantyPeriod warrantyPeriod = this.warrantyPeriodService.selectById(id); - model.addAttribute("warrantyPeriod", warrantyPeriod); - return "/sparepart/warrantyPeriodEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute WarrantyPeriod warrantyPeriod) { - User cu = (User) request.getSession().getAttribute("cu"); - warrantyPeriod.setInsdt(CommUtil.nowDate()); - warrantyPeriod.setInsuser(cu.getId()); - int result = this.warrantyPeriodService.update(warrantyPeriod); - String resstr="{\"res\":\""+result+"\",\"id\":\""+warrantyPeriod.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - WarrantyPeriod warrantyPeriod = this.warrantyPeriodService.selectById(id); - model.addAttribute("warrantyPeriod", warrantyPeriod); - return "/sparepart/warrantyPeriodView"; - } - /** - * 获取供应商类型 - * */ - @RequestMapping("/getWarrantyPeriod4Select.do") - public String getWarrantyPeriod4Select(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - JSONArray json=new JSONArray(); - List list = this.warrantyPeriodService.selectListByWhere("where 1=1"); - if(list!=null && list.size()>0){ - for (WarrantyPeriod warrantyPeriod : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", warrantyPeriod.getId()); - jsonObject.put("text", warrantyPeriod.getPeriod()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } -} diff --git a/src/com/sipai/controller/structure/StructureCardController.java b/src/com/sipai/controller/structure/StructureCardController.java deleted file mode 100644 index e5105505..00000000 --- a/src/com/sipai/controller/structure/StructureCardController.java +++ /dev/null @@ -1,723 +0,0 @@ -package com.sipai.controller.structure; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.sql.Struct; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONException; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; - -import org.apache.axis2.databinding.types.soapencoding.Decimal; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Multiset.Entry; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.structure.Structure; -import com.sipai.entity.structure.StructureCard; -import com.sipai.entity.structure.StructureCardType; -import com.sipai.entity.structure.StructureClass; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Role; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.structure.StructureCardService; -import com.sipai.service.structure.StructureClassService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupManageService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sun.org.apache.bcel.internal.generic.NEW; - -@Controller -@RequestMapping("/structure") -public class StructureCardController { - @Resource - private StructureCardService structureCardService; - @Resource - private StructureClassService structureClassService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; -/* @Resource - private AssetClassService assetClassService;*/ - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private MPointService mPointService; - @Resource - private ExtSystemService extSystemService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EquipmentCardService equipmentCardService; - - /** - * 能力与负荷 - */ - @RequestMapping("/capacityLoad.do") - public String capacityLoad(HttpServletRequest request,Model model) { - return "/structure/capacityLoad"; - } - - @RequestMapping("/showStructureCard.do") - public String showlist(HttpServletRequest request,Model model) { - return "/structure/structureCardList"; - } - - @RequestMapping("/showStructure.do") - public String showStructure(HttpServletRequest request,Model model) { - return "/structure/structureList"; - } - @RequestMapping("/getStructureJson.do") - public String getStructureJson(HttpServletRequest request,Model model){ - List list = this.structureCardService.selectListByWhere4UV("where 1=1 order by morder"); - String json = structureCardService.getTreeList4Structure(null, list); - model.addAttribute("result", json); - return "result"; - } - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getEquList.do") - public ModelAndView getEquList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - - User cu=(User)request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where pid = '-1' "; - - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and (name like '%"+request.getParameter("search_name")+"%')"; - } - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - PageHelper.startPage(pages, pagesize); - List list = this.structureCardService.selectListByWhere(wherestr+orderstr); - if(list!=null && list.size()>0){ - String companyId = request.getParameter("companyId"); - for(int i=0;i< list.size();i++){ - BigDecimal design = new BigDecimal("0"); - BigDecimal adjustable = new BigDecimal("0"); - BigDecimal current = new BigDecimal("0"); - BigDecimal load = new BigDecimal("0"); - if(list.get(i).getDesignCode()!=null && !list.get(i).getDesignCode().equals("")){ - MPoint mp = this.mPointService.selectById(companyId, list.get(i).getDesignCode()); - design = mp.getParmvalue(); - } - if(list.get(i).getAdjustableCode()!=null && !list.get(i).getAdjustableCode().equals("")){ - MPoint mp = this.mPointService.selectById(companyId, list.get(i).getAdjustableCode()); - adjustable = mp.getParmvalue(); - } - if(list.get(i).getCurrentCode()!=null && !list.get(i).getCurrentCode().equals("")){ - MPoint mp = this.mPointService.selectById(companyId, list.get(i).getCurrentCode()); - current = mp.getParmvalue(); - } - if(list.get(i).getLoadCode()!=null && !list.get(i).getLoadCode().equals("")){ - MPoint mp = this.mPointService.selectById(companyId, list.get(i).getLoadCode()); - load = mp.getParmvalue(); - } - list.get(i).set_design(design); - list.get(i).set_adjustable(adjustable); - list.get(i).set_current(current); - list.get(i).set_load(load); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 根据厂区id,获取设备list数据,无厂区id显示所有 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model/*, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order*/) { - User cu=(User)request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " insdt "; - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; -// String wherestr="where 1=1"; - String wherestr="where unit_id = '"+request.getParameter("unitId")+"'"; - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - /*if(request.getParameter("lineId")!=null && !request.getParameter("lineId").isEmpty()){ - wherestr += " and L.line_id like '%"+request.getParameter("lineId")+"%' "; - }*/ - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",","','"); - wherestr +="and id in ('"+checkedIds+"')"; - } - PageHelper.startPage(pages, pagesize); - List list = this.structureCardService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - StructureCard structureCard= structureCardService.selectById(pid); - model.addAttribute("pname",structureCard.getName()); - } - return "/structure/structureCardAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - StructureCard structureCard = this.structureCardService.selectById(id); - model.addAttribute("structureCard",structureCard ); - return "/structure/structureCardEdit"; - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request,Model model){ - return "/structure/structureCard4select"; - } - @RequestMapping("/getStructureCardJson.do") - public String getStructureCardJson(HttpServletRequest request,Model model){ - List list = this.structureCardService.selectListByWhere("where 1=1 order by morder"); - String json = structureCardService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - /** - * 删除一个构筑物数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.structureCardService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /** - * 删除多个构筑物数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.structureCardService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存构筑物 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("structureCard") StructureCard structureCard){ - User cu= (User)request.getSession().getAttribute("cu"); - structureCard.setInsuser(cu.getId()); - structureCard.setInsdt(CommUtil.nowDate()); - //没有选择上级节点默认为根节点 - if(structureCard.getPid().isEmpty()){ - structureCard.setPid(CommString.Tree_Root); - } - //没有设置类型默认构筑物 - if(structureCard.getType()==null){ - structureCard.setType(Integer.valueOf(StructureCardType.StructureCard.getId())); - } - //默认启用 - if(structureCard.getActive()==null){ - structureCard.setActive(true); - } - structureCard.setId(CommUtil.getUUID()); - int result = this.structureCardService.save(structureCard); - String resstr="{\"res\":\""+result+"\",\"id\":\""+structureCard.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 检查厂内编号是否存在 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request,Model model) { - String number =request.getParameter("structurecardid"); - String id =request.getParameter("id"); - if(this.structureCardService.checkNotOccupied(id, number)){ - model.addAttribute("result","{\"valid\":"+false+"}"); - return "result"; - }else { - model.addAttribute("result","{\"valid\":"+true+"}"); - return "result"; - } - } - /** - * 查看构筑物 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - StructureCard structureCard = this.structureCardService.selectById(id); - model.addAttribute("structureCard",structureCard ); - return "/structure/structureCardView"; - } - /** - * 更新设备 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("structureCard") StructureCard structureCard){ - User cu= (User)request.getSession().getAttribute("cu"); - structureCard.setInsuser(cu.getId()); - structureCard.setInsdt(CommUtil.nowDate()); - int result = this.structureCardService.update(structureCard); - String resstr="{\"res\":\""+result+"\",\"id\":\""+structureCard.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @ModelAttribute("structureCard") StructureCard structureCard){ - String msg = ""; - int result = 0; - List mlist = this.structureCardService.selectListByWhere(" where pid = '"+structureCard.getId()+"' "); - //判断是否有子菜单,有的话不能删除 - if(mlist!=null && mlist.size()>0){ - msg="请先删除子构筑物"; - }else{ - result = this.structureCardService.deleteById(structureCard.getId()); - } - - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return new ModelAndView("result"); - } - - /** - * 构筑物类型下拉框 - * @param request - * @param model - * @return - */ - @RequestMapping("/getStructureCardType4Select.do") - public String getStructureCardType4Select(HttpServletRequest request,Model model) { - String json = StructureCardType.getAllType4JSON(); - //System.out.println(json); - model.addAttribute("result",json); - return "result"; - } - - /** - * 构筑物下拉框 - * @param request - * @param model - * @return - */ - @RequestMapping("/getStructureCard4Select.do") - public String getStructureCard4Select(HttpServletRequest request,Model model) { - String unitId = request.getParameter("unitId"); - String wherestr = " where unit_id = '"+ unitId +"'"; - String orderstr = " order by morder"; - List structureCards = this.structureCardService.selectListByWhere(wherestr+orderstr); - //生成树 - String json = this.structureCardService.getTreeList(null, structureCards, null, ""); - model.addAttribute("result",json); - return "result"; - } - - /** - * 获取关联设备明细 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipment4StructureCard.do") - public ModelAndView getEquipment4StructureCard(HttpServletRequest request,Model model, - String structureId, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - StringBuilder sb=new StringBuilder("where 1=1 "); - if(null!= structureId && !"".equals(structureId)) - sb.append("and structure_id ="+"'"+structureId+"'"); - - PageHelper.startPage(page, rows); - List esrList=equipmentCardService.selectListByWhereNew(sb.append(" order by insdt desc").toString()); - PageInfo pInfo = new PageInfo(esrList); - JSONArray jsonArray = JSONArray.fromObject(esrList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 新增关联设备 - */ - @RequestMapping("/selectEquipment4StructureCard.do") - public String selectEquipment4StructureCard (HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - if(equipmentCardIds!=null && !equipmentCardIds.isEmpty()){ - String[] id_Array= equipmentCardIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipmentCardIds", jsonArray); - } - return "/equipment/selectEquipmentCards"; - } - - - /** - * 保存关联设备 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipment4StructureCard.do") - public String dosaveEquipment4StructureCard(HttpServletRequest request,Model model) { - String equipmentCardIds = request.getParameter("equipmentCardIds"); - String structureId = request.getParameter("structureId"); - String[] idArrary = equipmentCardIds.split(","); - int result = 0; - boolean flag = true; - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - EquipmentCard ec = equipmentCardService.selectById(str); - ec.setStructureId(structureId); - result = this.equipmentCardService.update(ec); - if (result != 1) { - flag = false; - } - } - } - - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - /** - * 删除关联设备 - * @param request - * @param model - * @param ids - * @return - */ - @RequestMapping("/deletesEquipment4StructureCard.do") - public String deletesEquipment4StructureCard(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids,String money){ - boolean flag=false; - int result = 0; - String[] idsArr=ids.split(","); - for(String id:idsArr){ - if(id !=null && !id.isEmpty()){ - EquipmentCard ec = equipmentCardService.selectById(id); - ec.setStructureId(""); - result = this.equipmentCardService.update(ec); - if (result != 1) { - flag=true; - } - } - } - String resultstr = "{\"res\":\""+flag+"\"}"; - model.addAttribute("result",resultstr); - return "result"; - } - - /** - * 新增点位参数 - */ - @RequestMapping("/showlistMPointForSelects.do") - public String showlistMPointForSelects (HttpServletRequest request,Model model) { - String mpoints = request.getParameter("mpoints"); - if(mpoints!=null && !mpoints.isEmpty()){ - String[] id_Array= mpoints.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("mpoints", jsonArray); - } - return "/structure/mPointListForSelectsStructure"; - } - - - /** - * 保存点位参数 - * @param request - * @param model - * @return - */ -// @RequestMapping("/saveMPoint4StructureCard.do") -// public String saveMPoint4StructureCard(HttpServletRequest request,Model model) { -// String mpoints = request.getParameter("mpoints"); -// String structureId = request.getParameter("structureId"); -// String structureCodeType = request.getParameter("structureCodeType"); -// String companyId = request.getParameter("companyId"); -// String[] idArrary = mpoints.split(","); -// int result = 0; -// boolean flag = true; -// for (String str : idArrary) { -// if(str !=null && !str.isEmpty()){ -// MPoint mPoint = mPointService.selectById(companyId, str); -// mPoint.setStructureId(structureId); -// mPoint.setStructureCodeType(structureCodeType); -// result = this.mPointService.update(companyId,mPoint); -// if (result != 1) { -// flag = false; -// } -// } -// } -// -// String resultstr = "{\"res\":\""+flag+"\"}"; -// model.addAttribute("result",resultstr); -// return "result"; -// } - /** - * 删除点位参数 - * @param request - * @param model - * @param ids - * @return - */ -// @RequestMapping("/deletesMPoint4StructureCard.do") -// public String deletesMPoint4StructureCard(HttpServletRequest request,Model model, -// @RequestParam(value = "ids") String ids,String money){ -// String companyId = request.getParameter("companyId"); -// boolean flag=false; -// int result = 0; -// String[] idsArr=ids.split(","); -// for(String id:idsArr){ -// if(id !=null && !id.isEmpty()){ -// MPoint mPoint = mPointService.selectById(companyId, id); -// mPoint.setStructureId(""); -// mPoint.setStructureCodeType(""); -// result = this.mPointService.update(companyId,mPoint); -// if (result != 1) { -// flag=true; -// } -// } -// } -// String resultstr = "{\"res\":\""+flag+"\"}"; -// model.addAttribute("result",resultstr); -// return "result"; -// } - /** - * 构筑物配置 ,可多选 - * */ - @RequestMapping("/showStructureCardForSelects.do") - public String showStructureCardForSelects(HttpServletRequest request,Model model) { - String processSectionIds = request.getParameter("processSectionIds"); - if(processSectionIds!=null && !processSectionIds.isEmpty()){ - String[] id_Array= processSectionIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if(!item.isEmpty()){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("processSections", jsonArray); - } - return "/work/structureCardListForSelects"; - } - /** - * 获取产线构筑物 - * @param request - * @param model - * @return - */ -// @RequestMapping("/getListWithLine.do") -// public ModelAndView getListWithLine(HttpServletRequest request,Model model/*, -// @RequestParam(value = "page") Integer page, -// @RequestParam(value = "rows") Integer rows, -// @RequestParam(value = "sort", required=false) String sort, -// @RequestParam(value = "order", required=false) String order*/) { -// User cu=(User)request.getSession().getAttribute("cu"); -// int pages = 0; -// if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ -// pages = Integer.parseInt(request.getParameter("page")); -// }else { -// pages = 1; -// } -// int pagesize = 0; -// if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ -// pagesize = Integer.parseInt(request.getParameter("rows")); -// }else { -// pagesize = 20; -// } -// String sort=""; -// if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ -// sort = request.getParameter("sort"); -// }else { -// sort = " ps_order "; -// } -// String order=""; -// if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ -// order = request.getParameter("order"); -// }else { -// order = " asc "; -// } -// String orderstr=" order by "+sort+" "+order; -// String wherestr="where 1=1"; -// if(request.getParameter("lineId")!=null && !request.getParameter("lineId").isEmpty()){ -// wherestr += " and line_id = '"+request.getParameter("lineId")+"' "; -// } -// PageHelper.startPage(pages, pagesize); -// List list = this.lineProcessSectionService.selectListByWhere(wherestr+orderstr); -// PageInfo pi = new PageInfo(list); -// JSONArray json=JSONArray.fromObject(list); -// -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// model.addAttribute("result",result); -// return new ModelAndView("result"); -// } - - /** - * 更新主表中的设备id - */ -// @RequestMapping("/equidToMpoint.do") -// public String equidToMpoint(HttpServletRequest request,Model model){ -// long start,end; -// start = System.currentTimeMillis(); -// User cu= (User)request.getSession().getAttribute("cu"); -// String bizId = request.getParameter("unitId"); -// int result = 0; -// -// List mpList = this.mPointService.selectListByWhere(bizId, "where 1=1"); -// if(mpList!=null && mpList.size()>0){ -// for (int i = 0; i < mpList.size(); i++) { -// MPoint mPoint = mpList.get(i); -// List equipmentCards = this.equipmentCardService.selectEquipmentIdToMpoint(bizId, "'"+mpList.get(i).getParmname()+"'"); -// if(equipmentCards!=null && equipmentCards.size()>0){ -// mPoint.setEquipid(equipmentCards.get(0).getId()); -// System.out.println("mpointName:"+mPoint.getParmname()+"----"+"equipName:"+equipmentCards.get(0).getEquipmentname()); -// //根据equipid找出structureid 并更新到测量点主表 -// List structureUV = this.structureCardService.selectListByWhere4UV("where id = '"+equipmentCards.get(0).getId()+"'"); -// if(structureUV !=null && structureUV.size()>0){ -// mPoint.setStructureId(structureUV.get(0).getPid()); -// } -// }else{ -// System.out.println("mpointName:"+mPoint.getParmname()+"----"+"未匹配到设备"); -// } -// //更新mpoint -// result = this.mPointService.update(bizId, mPoint); -// } -// } -// end = System.currentTimeMillis(); -// System.out.println("start time:" + start+ "; end time:" + end+ "; Run Time:" + (end - start) + "(ms)"); -// String resstr="{\"res\":\""+result+"\"}"; -// model.addAttribute("result", resstr); -// return "result"; -// } - - -} diff --git a/src/com/sipai/controller/structure/StructureCardPictureController.java b/src/com/sipai/controller/structure/StructureCardPictureController.java deleted file mode 100644 index d3d87edf..00000000 --- a/src/com/sipai/controller/structure/StructureCardPictureController.java +++ /dev/null @@ -1,393 +0,0 @@ -package com.sipai.controller.structure; - -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.tools.HttpUtil; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.timeefficiency.PatrolAreaFloor; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.PatrolRoute; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.structure.StructureCardPictureRouteService; -import com.sipai.service.structure.StructureCardPictureService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.UnitService; -import com.sipai.entity.base.Result; -import com.sipai.entity.structure.StructureCardPicture; -import com.sipai.entity.structure.StructureCardPictureRoute; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/structure/structureCardPicture") -public class StructureCardPictureController { - - @Resource - private StructureCardPictureService structureCardPictureService; - @Resource - private UnitService unitService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private StructureCardPictureRouteService structureCardPictureRouteService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - //String orderstr=" order by "+sort+" "+order + ",morder asc"; - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 "; -// wherestr += " and patrol_area_id = '"+request.getParameter("patrolAreaId")+"' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - - if (request.getParameter("structureId") != null && !request.getParameter("structureId").isEmpty()) { - wherestr += " and structure_id = '" + request.getParameter("structureId") + "' "; - } - //上级unit 的id - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取unitId下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String unitIds = ""; - for (Unit unit : units) { - unitIds += "'" + unit.getId() + "',"; - } - if (unitIds != "") { - unitIds = unitIds.substring(0, unitIds.length() - 1); - wherestr += " and unit_id in (" + unitIds + ") "; - } - } - PageHelper.startPage(page, rows); - List list = this.structureCardPictureService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 添加 - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - String structureId = request.getParameter("structureId"); - - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("structureId", structureId); - return "/structure/structureCardPictureAdd"; - } - - /** - * 保存 - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute StructureCardPicture structureCardPicture) { - //String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - User cu = (User) request.getSession().getAttribute("cu"); - structureCardPicture.setId(structureCardPicture.getId()); - structureCardPicture.setInsuser(cu.getId()); - structureCardPicture.setInsdt(CommUtil.nowDate()); - int result = this.structureCardPictureService.save(structureCardPicture); - //同时加两个初始巡检点进去 - for (int i = 0; i < 2; i++) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setId(CommUtil.getUUID()); - patrolPoint.setInsuser(cu.getId()); - patrolPoint.setInsdt(CommUtil.nowDate()); - patrolPoint.setUnitId(structureCardPicture.getUnitId()); - patrolPoint.setActive("1"); - patrolPoint.setMorder(String.valueOf(i)); - if (i == 0) { - patrolPoint.setName(structureCardPicture.getName() + "起点"); - patrolPoint.setPatrolContent(structureCardPicture.getName() + "起点"); - } else if (i == 1) { - patrolPoint.setName(structureCardPicture.getName() + "终点"); - patrolPoint.setPatrolContent(structureCardPicture.getName() + "终点"); - } - patrolPoint.setReadOrWrite("1"); - patrolPoint.setType("P"); - patrolPoint.setFloorId(structureCardPicture.getId()); - this.patrolPointService.save(patrolPoint); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + structureCardPicture.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 数据删除方法 - */ - @RequestMapping("/delete.do") - public String delete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.structureCardPictureService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.structureCardPictureService.deleteByWhere("where id in ('" + ids + "')"); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * bootstrap 底图编辑 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - StructureCardPicture structureCardPicture = this.structureCardPictureService.selectById(Id); - model.addAttribute("structureCardPicture", structureCardPicture); - return "/structure/structureCardPictureEdit"; - } - - - /** - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute StructureCardPicture structureCardPicture) { - int res = this.structureCardPictureService.update(structureCardPicture); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/editRoute.do") - public String editRoute(HttpServletRequest request, Model model) { - String structureCardPictureId = request.getParameter("id"); - StructureCardPicture structureCardPicture = this.structureCardPictureService.selectById(structureCardPictureId); - model.addAttribute("structureCardPicture", structureCardPicture); - return "structure/structureCardPictureRouteEdit"; - } - - @RequestMapping("/getPictureList.do") - public ModelAndView getPictureList(HttpServletRequest request, Model model) { - String orderstr = "order by morder asc"; - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); - String structureCardPictureId = request.getParameter("structureCardPictureId"); - wherestr += " and unit_id = '" + unitId + "' and id = '" + structureCardPictureId + "'"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - List list = this.structureCardPictureService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 获取巡检点 - */ - @RequestMapping("/getPatrolPoints.do") - public String getPatrolPoints(HttpServletRequest request, Model model) { - String floorId = request.getParameter("floorId"); //structureCardPictureId - String type = request.getParameter("type"); - String unitId = request.getParameter("unitId"); -// List patrolPoints = this.patrolAreaService.getPatrolPoints(floorId, type); - List patrolPoints = patrolPointService.selectListByWhere("where unit_id = '" + unitId + "' and type = '" + type + "' and floor_id = '" + floorId + "' "); - model.addAttribute("result", JSONArray.fromObject(patrolPoints)); - return "result"; - } - - - /** - * 获取巡检路径上的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRoutePoints.do") - public ModelAndView getRoutePoints(HttpServletRequest request, Model model) { - //String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; -// if (request.getParameter("patrolPlanId") != null && !request.getParameter("patrolPlanId").isEmpty()) { -// wherestr += " and patrol_plan_id = '" + request.getParameter("patrolPlanId") + "' "; -// } - if (request.getParameter("floorId") != null && !request.getParameter("floorId").isEmpty()) { - wherestr += " and structure_card_picture_id = '" + request.getParameter("floorId") + "' "; - } - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - - List list = this.structureCardPictureRouteService.selectListByWhere(wherestr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - // System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存巡检路线中的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveRoutePoint.do") - public String saveRoutePoint(HttpServletRequest request, Model model, - @ModelAttribute StructureCardPictureRoute structureCardPictureRoute) { - User cu = (User) request.getSession().getAttribute("cu"); - /*String patrolRouteJson =request.getParameter("patrolRoute"); - JSONObject jsonObject=JSONObject.fromObject(patrolRouteJson); - PatrolRoute patrolRoute = (PatrolRoute)JSONObject.toBean(jsonObject, PatrolRoute.class);*/ - - //patrolRoute.setId(CommUtil.getUUID()); -// BigDecimal bignum1 = new BigDecimal("2"); -// BigDecimal posx = structureCardPictureRoute.getPosx(); -// BigDecimal posy = structureCardPictureRoute.getPosx(); - - structureCardPictureRoute.setInsdt(CommUtil.nowDate()); - structureCardPictureRoute.setInsuser(cu.getId()); -// structureCardPictureRoute.setPosx(posx.multiply(bignum1)); -// structureCardPictureRoute.setPosy(posy.multiply(bignum1)); - int result = this.structureCardPictureRouteService.save(structureCardPictureRoute); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + structureCardPictureRoute.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除巡检路线中的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteRoutePoint.do") - public String deleteRoutePoint(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "previousId") String previousId, - @RequestParam(value = "nextId") String nextId) { - int result = this.structureCardPictureRouteService.deletePoint(id, previousId, nextId); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return "result"; - } - - - /** - * 更新巡检路线中的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRoutePoint.do") - public String updateRoutePoint(HttpServletRequest request, Model model, - @ModelAttribute StructureCardPictureRoute structureCardPictureRoute) { - -// BigDecimal bignum1 = new BigDecimal("2"); -// BigDecimal posx = structureCardPictureRoute.getPosx(); -// BigDecimal posy = structureCardPictureRoute.getPosx(); -// -// -// structureCardPictureRoute.setPosx(posx.multiply(bignum1)); -// structureCardPictureRoute.setPosy(posy.multiply(bignum1)); - - int result = this.structureCardPictureRouteService.update(structureCardPictureRoute); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - /** - * 获取巡检路径上的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRoutePointsOrderbySort.do") - public ModelAndView getRoutePointsOrderbySort(HttpServletRequest request, Model model) { - //String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; -// if (request.getParameter("patrolPlanId") != null && !request.getParameter("patrolPlanId").isEmpty()) { -// wherestr += " and patrol_plan_id = '" + request.getParameter("patrolPlanId") + "' "; -// } - if (request.getParameter("floorId") != null && !request.getParameter("floorId").isEmpty()) { - wherestr += " and structure_card_picture_id = '" + request.getParameter("floorId") + "' "; - } - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - - List list = this.structureCardPictureRouteService.selectListByWhere(wherestr + " order by insdt desc"); - - List newstructureCardPictureRoutes = this.structureCardPictureRouteService.sort(list); - - PageInfo pi = new PageInfo(newstructureCardPictureRoutes); - JSONArray json = JSONArray.fromObject(newstructureCardPictureRoutes); - - String result = "{\"total\":" + newstructureCardPictureRoutes.size() + ",\"rows\":" + json + "}"; - // System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/editRoutePoint.do") - public String editRoutePoint(HttpServletRequest request, Model model) { - String structureCardPictureRouteId = request.getParameter("id"); - StructureCardPictureRoute structureCardPictureRoute = this.structureCardPictureRouteService.selectById(structureCardPictureRouteId); - model.addAttribute("structureCardPictureRoute", structureCardPictureRoute); - return "structure/structureCardPictureRoutePointEdit"; - } - -} diff --git a/src/com/sipai/controller/structure/StructureCardPictureRoutePointdetailController.java b/src/com/sipai/controller/structure/StructureCardPictureRoutePointdetailController.java deleted file mode 100644 index 025ec904..00000000 --- a/src/com/sipai/controller/structure/StructureCardPictureRoutePointdetailController.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.controller.structure; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.structure.StructureCardPictureRoutePointdetail; -import com.sipai.service.structure.StructureCardPictureRoutePointdetailService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/structure/structureCardPictureRoutePointdetail") -public class StructureCardPictureRoutePointdetailController { - @Resource - private StructureCardPictureRoutePointdetailService structureCardPictureRoutePointdetailService; - - @RequestMapping("/showProcessWebsiteList.do") - public String showDataTypeList(HttpServletRequest request,Model model){ - return "structure//"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.structureCardPictureRoutePointdetailService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 打开新增数据类型(产线) - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - String pid = request.getParameter("pid"); - request.setAttribute("pid", pid); - return "structure/structureCardPictureRoutePointdetailAdd"; - } - - /** - * 打开编辑数据类型(产线) - * @param request - * @param model - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - StructureCardPictureRoutePointdetail structureCardPictureRoutePointdetail = this.structureCardPictureRoutePointdetailService.selectById(id); - model.addAttribute("structureCardPictureRoutePointdetail", structureCardPictureRoutePointdetail); - return "structure/structureCardPictureRoutePointdetailEdit"; - } - - /** - * 保存数据类型(产线) - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("StructureCardPictureRoutePointdetail") StructureCardPictureRoutePointdetail structureCardPictureRoutePointdetail){ - User cu= (User)request.getSession().getAttribute("cu"); - structureCardPictureRoutePointdetail.setId(CommUtil.getUUID()); - structureCardPictureRoutePointdetail.setInsuser(cu.getId()); - structureCardPictureRoutePointdetail.setInsdt(CommUtil.nowDate()); - int result = this.structureCardPictureRoutePointdetailService.save(structureCardPictureRoutePointdetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+structureCardPictureRoutePointdetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除数据类型(产线) - * @param request - * @param model - * @param id 交互id - * @return - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.structureCardPictureRoutePointdetailService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新数据类型(产线) - * @param request - * @param model - * @param visualJsp - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute StructureCardPictureRoutePointdetail structureCardPictureRoutePointdetail){ - User cu= (User)request.getSession().getAttribute("cu"); - structureCardPictureRoutePointdetail.setInsuser(cu.getId()); - structureCardPictureRoutePointdetail.setInsdt(CommUtil.nowDate()); - int result = this.structureCardPictureRoutePointdetailService.update(structureCardPictureRoutePointdetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+structureCardPictureRoutePointdetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/structure/StructureClassController.java b/src/com/sipai/controller/structure/StructureClassController.java deleted file mode 100644 index 176dbffc..00000000 --- a/src/com/sipai/controller/structure/StructureClassController.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.sipai.controller.structure; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.structure.StructureClass; -import com.sipai.entity.user.User; -import com.sipai.service.structure.StructureClassService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/structure/structureClass") -public class StructureClassController { - @Resource - private StructureClassService structureClassService; - /** - * 打开设备类型界面 - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/structure/structureClassList"; - } - /** - * 获取设备类型list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.structureClassService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 打开新增设备类型界面 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "structure/structureClassAdd"; - } - /** - * 删除一条设备类型数据 - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.structureClassService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - /** - * 删除多条设备类型数据 - */ - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.structureClassService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存设备类型数据 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("structureClass") StructureClass structureClass){ - User cu= (User)request.getSession().getAttribute("cu"); - structureClass.setId(CommUtil.getUUID()); - structureClass.setInsuser(cu.getId()); - structureClass.setInsdt(CommUtil.nowDate()); - int result = this.structureClassService.save(structureClass); - String resstr="{\"res\":\""+result+"\",\"id\":\""+structureClass.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 检查设备类型的名称是否重复 - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request,Model model) { - String name =request.getParameter("name"); - String id =request.getParameter("id"); - if(this.structureClassService.checkNotOccupied(id, name)){ - model.addAttribute("result","{\"valid\":"+false+"}"); - return "result"; - }else { - model.addAttribute("result","{\"valid\":"+true+"}"); - return "result"; - } - } - /** - * 查看设备类型信息 - */ - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - StructureClass structureClass = this.structureClassService.selectById(id); - model.addAttribute("structureClass", structureClass); - return "structure/structureClassView"; - } - /** - * 打开编辑设备类型信息界面 - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - StructureClass structureClass = this.structureClassService.selectById(id); - model.addAttribute("structureClass", structureClass); - return "structure/structureClassEdit"; - } - /** - * 更新设备类型信息 - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("structureClass") StructureClass structureClass){ - User cu= (User)request.getSession().getAttribute("cu"); - structureClass.setInsuser(cu.getId()); - structureClass.setInsdt(CommUtil.nowDate()); - int result = this.structureClassService.update(structureClass); - String resstr="{\"res\":\""+result+"\",\"id\":\""+structureClass.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 选择设备类型 - */ - @RequestMapping("/getStructureClassForSelect.do") - public String getStructureClassForSelect(HttpServletRequest request,Model model){ - List list = this.structureClassService.selectListByWhere("where active= '1'"); - JSONArray jsonArray=new JSONArray(); - if(list!=null && list.size()>0){ - for (StructureClass structureClass : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", structureClass.getName()); - jsonObject.put("text", structureClass.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - @RequestMapping("/getStructureClassname.do") - public String getstructureclassname(HttpServletRequest request,Model model) { - String wherestr ="where 1=1"; - List list = this.structureClassService.selectListByWhere(wherestr); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return "result"; - } -} diff --git a/src/com/sipai/controller/teacher/TeacherFileController.java b/src/com/sipai/controller/teacher/TeacherFileController.java deleted file mode 100644 index 14393fd1..00000000 --- a/src/com/sipai/controller/teacher/TeacherFileController.java +++ /dev/null @@ -1,378 +0,0 @@ -package com.sipai.controller.teacher; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.teacher.TeacherFile; -import com.sipai.entity.teacher.Teachertype; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.teacher.TeacherFileService; -import com.sipai.service.teacher.TeachertypeService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/teacher/teacherfile") -public class TeacherFileController { - - private String BaseFolderName="UploadFile"; - - @Resource - private CommonFileService commonFileService; - - @Resource - private TeacherFileService teacherFileService; - - @Resource - private TeachertypeService teachertypeService; - - @RequestMapping("/showTeacherFileTree.do") - public String showTeacherFileTree(HttpServletRequest request, Model model) { - return "teacher/teacherFileManage"; - } - - - - - @RequestMapping("/doeditTeacherFile.do") - public String doeditTeacherFile(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ -// Data data = this.dataService.selectById(id); -// model.addAttribute("data",data );fileinput - - //判断是否是最后一个层级 - String is_lastnode = ""; - List list = teachertypeService.selectListByWhere("where pid='"+id+"'"); - if(list!=null && list.size()>0){ - is_lastnode = "no"; - } - else{ - is_lastnode = "yes"; - } - request.setAttribute("lastnode", is_lastnode); - return "teacher/teacherFileEdit"; - } - - @RequestMapping(value = "getFileList.do") - public ModelAndView getFileList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { -// System.out.println(sort); -// System.out.println(order); - User cu=(User)request.getSession().getAttribute("cu"); - String masterId = request.getParameter("masterId"); -// String tbName = request.getParameter("tbName"); - PageHelper.startPage(page, rows); - List list = this.teacherFileService.selectListByWhere("where masterid ='"+masterId+"' order by insdt"); -// List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+masterId+"' order by insdt desc"); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /*** - * 查询所有子节点下的附件素材 - * @param request - * @param response - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping(value = "getparentFileList.do") - public ModelAndView getparentFileList(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { -// System.out.println(sort); -// System.out.println(order); - User cu=(User)request.getSession().getAttribute("cu"); - String id = request.getParameter("masterId"); -// String tbName = request.getParameter("tbName"); - PageHelper.startPage(page, rows); - // - //递归查询所有子节点 - String whererStr = " where "; - if(id!=null && !id.isEmpty()){ - List unitlist=teachertypeService.getUnitChildrenById(id); - - String pidstr=""; - for(int i=0;i list = this.teacherFileService.selectListByWhere(whererStr+" order by insdt desc"); -// List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+masterId+"' order by insdt desc"); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response,Model model,@RequestParam(value="masterId") String masterId, - @RequestParam(value="tbName") String tbName,@RequestParam(value="nameSpace") String nameSpace) { - model.addAttribute("tbName",tbName); - model.addAttribute("masterId",masterId); - model.addAttribute("nameSpace",nameSpace); - return "teacher/fileAdd"; - } - - @RequestMapping(value = "inputFile.do") - public ModelAndView inputFile(HttpServletRequest request,HttpServletResponse response,Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - String filepath=filepathSever.replaceAll(contextPath, BaseFolderName+"/"+nameSpace+"/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date())+fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - TeacherFile teacherFile = new TeacherFile(); - String fileId = CommUtil.getUUID(); - teacherFile.setId(fileId); - teacherFile.setMasterid(masterId); - teacherFile.setFilename(fileName); - teacherFile.setType(fileType); - teacherFile.setAbspath(reportAddr); - //自己用 - //teacherFile.setUrlpath("/"+reportAddr.split("\\\\")[3]+"/"+reportAddr.split("\\\\")[4]+"/"+reportAddr.split("\\\\")[5]); - //服务器用 -// String[] urlpath = reportAddr.split("\\\\"); -// teacherFile.setUrlpath("/"+urlpath[5]+"/"+urlpath[6]+"/"+urlpath[7]); - String urlpath = reportAddr.substring(reportAddr.indexOf("webapps")+7,reportAddr.length()); - urlpath = urlpath.replace("\\","/"); - teacherFile.setUrlpath(urlpath); - teacherFile.setInsdt(CommUtil.nowDate()); - teacherFile.setInsuser(cu.getId()); - teacherFile.setSize((double)item.getSize()); - teacherFile.setFilefolder(BaseFolderName); - int res = this.teacherFileService.save(teacherFile); - //判断是否是word类型 - if(fileType.contains("word") || fileType.contains("sheet") || fileType.contains("excel") || fileType.contains("presentation") || fileType.contains("powerpoint")){ - String savePDFFileName = dateFormat.format(new Date())+ ".pdf"; - String reportAddrPDF = fileUploadPath + "/" + savePDFFileName; - reportAddrPDF = reportAddrPDF.replace("/", File.separator).replace("\\", File.separator); - - if(fileType.contains("word")){ - try { - FileUtil.toPdf(reportAddr,reportAddrPDF,"word"); - } catch (Exception e) { - // TODO: handle exception - } - - }else if (fileType.contains("sheet") || fileType.contains("excel")) { - try { - FileUtil.toPdf(reportAddr,reportAddrPDF,"excel"); - } catch (Exception e) { - // TODO: handle exception - } - - }else if (fileType.contains("presentation") || fileType.contains("powerpoint")) { - try { - FileUtil.toPdf(reportAddr,reportAddrPDF,"ppt"); - } catch (Exception e) { - // TODO: handle exception - } - - } - - - //上传文件成功,保存文件信息到表reportDetail - TeacherFile teacherFilePDF = new TeacherFile(); - teacherFilePDF.setId(CommUtil.getUUID()); - teacherFilePDF.setMasterid(fileId); - teacherFilePDF.setFilename(savePDFFileName); - teacherFilePDF.setType("application/pdf"); - teacherFilePDF.setAbspath(reportAddrPDF); - //自己用 - teacherFilePDF.setUrlpath("/"+reportAddrPDF.split("\\\\")[3]+"/"+reportAddrPDF.split("\\\\")[4]+"/"+reportAddrPDF.split("\\\\")[5]); - //服务器用 -// teacherFile.setUrlpath("/"+reportAddr.split("\\\\")[5]+"/"+reportAddr.split("\\\\")[6]+"/"+reportAddr.split("\\\\")[7]); - - teacherFilePDF.setInsdt(CommUtil.nowDate()); - teacherFilePDF.setInsuser(cu.getId()); - teacherFilePDF.setSize((double)item.getSize()); - teacherFilePDF.setFilefolder(BaseFolderName); - - this.teacherFileService.save(teacherFilePDF); - } - if (res==1) { - ret.put("suc", true); - ret.put("msg", teacherFile.getId()); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result =JSONObject.fromObject(ret).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodeleteFile.do") - public ModelAndView dodeleteFile(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="tbName") String tbName) throws IOException{ - int res=0; - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='"+id+"'"); - if(commfiles!=null && commfiles.size()>0){ - res = this.commonFileService.deleteByTableAWhere(tbName, "where id='"+id+"'"); - } - if(res>0){ - FileUtil.deleteFile(commfiles.get(0).getAbspath()); - ret.put("suc", true); - }else{ - ret.put("suc", false); - } - model.addAttribute("result",res); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - TeacherFile teacherFile = this.teacherFileService.selectById(id); - model.addAttribute("teacherFile",teacherFile); - return "teacher/teacherFileEditModel"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("teacherFile") TeacherFile teacherFile){ - int res = this.teacherFileService.update(teacherFile); - model.addAttribute("result",res); - return "result"; - } - - /*** - * 浏览课件 - * @param request - * @param model - * @return - */ - @RequestMapping("/showTeacherFileTreeview.do") - public String showTeacherFileTreeview(HttpServletRequest request, Model model) { - return "teacher/teacherFileManageview"; - } - - @RequestMapping("/doeditTeacherFileview.do") - public String doeditTeacherFileview(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ -// Data data = this.dataService.selectById(id); -// model.addAttribute("data",data ); - - //判断是否是最后一个层级 - String is_lastnode = ""; - List list = teachertypeService.selectListByWhere("where pid='"+id+"'"); - if(list!=null && list.size()>0){ - is_lastnode = "no"; - } - else{ - is_lastnode = "yes"; - } - request.setAttribute("lastnode", is_lastnode); - return "teacher/teacherFileEditview"; - } - - /*** - * 浏览图片 - */ - @RequestMapping("/doview.do") - public String doAdd(HttpServletRequest request,Model model){ - String relpath = request.getParameter("urlpath"); - if(relpath != null&& !relpath.isEmpty()){ - request.setAttribute("relpath", relpath); - }else{ - request.setAttribute("relpath", "error.jpg"); - } - return "teacher/viewpic"; - } - - /*** - * 浏览图片 - */ - @RequestMapping("/doview_Layer.do") - public String doview_Layer(HttpServletRequest request,Model model){ - String relpath = request.getParameter("urlpath"); - if(relpath != null&& !relpath.isEmpty()){ - request.setAttribute("relpath", relpath); - }else{ - request.setAttribute("relpath", "error.jpg"); - } - return "teacher/viewpic_Layer"; - } -} diff --git a/src/com/sipai/controller/teacher/TeachertypeController.java b/src/com/sipai/controller/teacher/TeachertypeController.java deleted file mode 100644 index 96f42e6d..00000000 --- a/src/com/sipai/controller/teacher/TeachertypeController.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.controller.teacher; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.teacher.Teachertype; -import com.sipai.entity.user.User; -import com.sipai.service.teacher.TeachertypeService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/teacher/teachertype") -public class TeachertypeController { - @Resource - private TeachertypeService teachertypeService; - - @RequestMapping("/showTeachertypeTree.do") - public String showTeachertypeTree(HttpServletRequest request, Model model) { - return "teacher/teachertypeManage"; - } - - @RequestMapping("/getTeachertypesJson.do") - public String getTeachertypesJson(HttpServletRequest request, Model model) { - List list = this.teachertypeService.selectListByWhere("order by ord"); - String json = teachertypeService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showTeachertypeAdd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - Teachertype teachertype = this.teachertypeService.selectById(pid); - model.addAttribute("pname",teachertype.getName()); - } - return "teacher/teachertypeAdd"; - } - - @RequestMapping("/showTeachertypeEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Teachertype teachertype = this.teachertypeService.selectById(id); - if(this.teachertypeService.selectById(teachertype.getPid())!=null){ - teachertype.set_pname(this.teachertypeService.selectById(teachertype.getPid()).getName()); - } - model.addAttribute("teachertype",teachertype ); - return "teacher/teachertypeEdit"; - } - - @RequestMapping("/saveTeachertype.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("teachertype") Teachertype teachertype){ - User cu=(User)request.getSession().getAttribute("cu"); - teachertype.setId(CommUtil.getUUID()); - teachertype.setInsuser(cu.getId()); - teachertype.setInsdt(CommUtil.nowDate()); - if (teachertype.getPid()==null || teachertype.getPid().isEmpty()) { - teachertype.setPid("-1"); - } - int result = this.teachertypeService.save(teachertype); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showTeachertype4Select.do") - public String showCoursewareType4Select(HttpServletRequest request,Model model){ - return "teacher/teachertype4select"; - } - - @RequestMapping("/updateTeachertype.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("teachertype") Teachertype teachertype){ - User cu=(User)request.getSession().getAttribute("cu"); - teachertype.setUpsuser(cu.getId()); - teachertype.setUpsdt(CommUtil.nowDate()); - int result = this.teachertypeService.update(teachertype); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteTeachertype.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @ModelAttribute("teachertype") Teachertype teachertype){ - String msg = ""; - int result = 0; - List mlist = this.teachertypeService.selectListByWhere(" where pid = '"+teachertype.getId()+"' "); - //判断是否有子菜单,有的话不能删除 - if(mlist!=null && mlist.size()>0){ - msg="请先删除子菜单"; - }else{ - result = this.teachertypeService.deleteById(teachertype.getId()); - if(result>0){ - - }else{ - msg="删除失败"; - } - } - - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - - return new ModelAndView("result"); - } - - /** - * 获取包含的子菜单列表 - * */ - @RequestMapping("/getPidJson.do") - public ModelAndView getPidJson(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { -// System.out.println(sort); -// System.out.println(order); - PageHelper.startPage(page, rows); - String id = request.getParameter("id"); - List list = this.teachertypeService.selectListByWhere("where 1=1 and pid='"+id+"' order by ord"); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request,Model model){ -// System.out.println(request.getParameter("jsondata")); - String ds = request.getParameter("jsondata"); - JSONArray json=JSONArray.fromObject(ds); - JSONObject jsonOne; - int result=0; - for(int i=0;i list = this.clockinRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /**APP接口。生成打卡记录*/ - @RequestMapping("/save.do") - public String save(HttpServletRequest request,Model model){ - // if(cu==null){ - // cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); - // } - String result = ""; - ClockinRecord clockinRecord = new ClockinRecord(); - try{ - if (request.getParameter("userid")!=null && !request.getParameter("userid").toString().isEmpty()) { - clockinRecord.setInsuser(request.getParameter("userid").toString()); - } - if (request.getParameter("location")!=null && !request.getParameter("location").toString().isEmpty()) { - clockinRecord.setRecordType(request.getParameter("location").toString()); - } - if (request.getParameter("companyId")!=null && !request.getParameter("companyId").toString().isEmpty()) { - clockinRecord.setBizId(request.getParameter("companyId").toString()); - } - clockinRecord.setInsdt(CommUtil.nowDate()); - clockinRecord.setId(CommUtil.getUUID()); - //判断是否准时 之后完善 - int res = this.clockinRecordService.save(clockinRecord); - if(res >0){ - result="{\"status\":\""+CommString.Status_Pass+"\"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - System.out.println(e); - } - - // System.out.println(result); - model.addAttribute("result",result); - return "result"; - } - - /** - * 查看 - * @param request - * @param model - * @return - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - ClockinRecord clockinRecord = this.clockinRecordService.selectById(Id); - model.addAttribute("clockinRecord", clockinRecord); - return "/timeefficiency/clockinRecordView"; - } - - /** - * - * 获取厂区人员打卡数据汇总 - * */ - @RequestMapping("/getCollection.do") - public ModelAndView getCollection(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - List companies=null; - companies=this.unitService.getCompanyByUserIdAndType(cu.getId(),CommString.UNIT_TYPE_BIZ); - for (Company company : companies){ - ClockinCollection clockinCollection = new ClockinCollection(); - //获取图片 - List list = this.commonFileService.selectListByTableAWhere(UserCommStr.Biz_Img_DataBase, "where masterid='"+company.getId()+"' order by insdt"); - - try{ - clockinCollection.setImgPath(list.get(0).getAbspath());//目前默认一张图片 - }catch(Exception e){ - e.printStackTrace(); - } - //计算 - //获取厂区内员工数 - List users = this.unitService.getChildrenUsersById(company.getId()); - clockinCollection.setUserTotalNum(users.size()); - - //获取员工打卡数(时间筛选) - String wherestr = " where biz_id = '"+company.getId()+"'"; - if(request.getParameter("date")!=null && !request.getParameter("date").isEmpty()){ - wherestr += " and Convert(varchar,insdt,120) like '"+request.getParameter("date")+"%' "; - } - List clockinUsers = this.clockinRecordService.selectClockinUserByWhere(wherestr); - clockinCollection.setClockinNum(clockinUsers.size()); - clockinCollection.setUnClockinNum(users.size()-clockinUsers.size()); - company.setClockinCollection(clockinCollection); - } - JSONArray json=JSONArray.fromObject(companies); - - String result="{\"total\":"+companies.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 导出巡检打卡人员记录excel表 - * @throws IOException - */ - @RequestMapping("downloadClockInRecordExcel.do") - public void downloadFile(HttpServletRequest request, - HttpServletResponse response,Model model, - String ids,String search_code,String search_name,String date) - throws IOException { - List crlist=null; - if(null==ids || "".equals(ids)){ - String wherestr="where 1=1 "; - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and R.biz_id ='"+request.getParameter("search_code")+"'"; - } - if(request.getParameter("date")!=null && !request.getParameter("date").isEmpty()){ - wherestr += " and Convert(varchar,R.insdt,120) like '"+request.getParameter("date")+"%' "; - } - - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "' and U.caption like %"+"'"+request.getParameter("search_name")+"'"+"%"; - } - crlist = this.clockinRecordService.selectListByWhere(wherestr); - }else{ - crlist = this.clockinRecordService.selectListByWhere("where R.id in"+"("+ids+")"); - - } - for(ClockinRecord cr:crlist){ - List companyList=unitService.getCompaniesByWhere("where ename="+"'"+cr.getBizId()+"'"); - cr.setCompanyName(companyList.get(0).getName()); - } - clockinRecordService.downloadClockInRecordExcel(response,crlist); - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/timeefficiency/ElectricityPriceController.java b/src/com/sipai/controller/timeefficiency/ElectricityPriceController.java deleted file mode 100644 index d1862828..00000000 --- a/src/com/sipai/controller/timeefficiency/ElectricityPriceController.java +++ /dev/null @@ -1,395 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.timeefficiency.EfficiencyProcess; -import com.sipai.entity.timeefficiency.ElectricityPrice; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderAchievement; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.timeefficiency.EfficiencyProcessService; -import com.sipai.service.timeefficiency.ElectricityPriceService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -/** - * 工作记录 - * - * @author SJ - */ -@Controller -@RequestMapping("/timeEfficiency/electricityPrice") -public class ElectricityPriceController { - - @Resource - private ElectricityPriceService electricityPriceService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private EfficiencyProcessService efficiencyProcessService; - @Resource - private MPointHistoryService mPointHistoryService; - - @RequestMapping("/showElectricityPricelist.do") - public String showElectricityPricelist(HttpServletRequest request, Model model) { - return "/timeefficiency/electricityPriceList"; - } - - @RequestMapping("/getElectricityPricelist.do") - public ModelAndView getElectricityPricelist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " deptid "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("bizId") != null && !request.getParameter("bizId").isEmpty()) { - wherestr += " and biz_id = '" + request.getParameter("bizId") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and contents like '%" + request.getParameter("search_name") + "%' "; - } - - PageHelper.startPage(page, rows); - List list = this.electricityPriceService.selectListByWhere(wherestr + orderstr); - for (ElectricityPrice electricityPrice : list) { - - Company company = unitService.getCompById(electricityPrice.getCompany()); - electricityPrice.setCompanys(company); - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getElectricityPricelist2.do") - public ModelAndView getElectricityPricelist2(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " asc "; - } - - String showdata = request.getParameter("showdata"); - String orderstr = " order by " + sort + " " + order; - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE); - String maxDateMString = ""; - if (maxDateM < 10) { - maxDateMString = "0" + maxDateM; - } else { - maxDateMString = maxDateM + ""; - } - String wherestr = "where 1=1 and (stop_time >'" + showdata.substring(0, 7) + "-" + (1) + "' or stop_time is null)"; - if (request.getParameter("bizId") != null && !request.getParameter("bizId").isEmpty()) { - wherestr += " and company = '" + request.getParameter("bizId") + "' "; - } - Double ElectricityPrice = (double) 0; - - PageHelper.startPage(page, rows); - List list = this.electricityPriceService.selectListByWhere(wherestr + orderstr); - for (ElectricityPrice electricityPrice : list) { - SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); - try { - Date fromDate = simpleFormat.parse(showdata.substring(0, 7) + "-" + (1) + " 00:00:00"); - Date fromDate2 = simpleFormat.parse(electricityPrice.getInsdt()); - - String from1 = electricityPrice.getInsdt(); - if (electricityPrice != null && fromDate.getTime() > fromDate2.getTime()) { - from1 = showdata.substring(0, 7) + "-01 00:00:00"; - } - Date toDate1 = simpleFormat.parse(showdata.substring(0, 7) + "-" + (maxDateMString) + " 23:59:59"); - String from2 = showdata.substring(0, 7) + "-" + (maxDateMString) + " 23:59:59"; - if (electricityPrice != null && electricityPrice.getStopTime() != null) { - from2 = electricityPrice.getStopTime(); - } - long to1 = toDate1.getTime(); - - Double electricitytime = this.electricityPriceService.getElectricitytimebybizId(request.getParameter("bizId"), from1, from2); - - ElectricityPrice = ElectricityPrice + electricitytime * electricityPrice.getDianduprice(); - electricityPrice.setPeakprice(electricitytime * electricityPrice.getDianduprice()); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } - - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - request.setAttribute("company", company); - return "timeefficiency/electricityPriceAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - ElectricityPrice electricityPrice = this.electricityPriceService.selectById(id); - model.addAttribute("electricityPrice", electricityPrice); - - model.addAttribute("result", JSONObject.fromObject(model)); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute ElectricityPrice electricityPrice) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - electricityPrice.setId(id); - electricityPrice.setInsuser(cu.getId()); - electricityPrice.setInsdt(CommUtil.nowDate()); - List list = this.electricityPriceService.selectListByWhere("where company = '" + electricityPrice.getCompany() + "' order by insdt"); - if (list != null && list.size() > 0) { - list.get(0).setStopTime(CommUtil.nowDate()); - - this.electricityPriceService.update(list.get(0)); - } - int result = this.electricityPriceService.save(electricityPrice); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute ElectricityPrice electricityPrice) { - int result = this.electricityPriceService.update(electricityPrice); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + electricityPrice.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - ElectricityPrice electricityPrice = this.electricityPriceService.selectById(id); - model.addAttribute("electricityPrice", electricityPrice); - return "timeefficiency/electricityPriceView"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.electricityPriceService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.electricityPriceService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doecharts1.do") - public String doecharts1(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - JSONObject json = new JSONObject(); - String bizid = request.getParameter("bizid"); - String showdata = request.getParameter("showdata"); - String datetype = "";//1 年 2月 - if (showdata.length() > 4) { - datetype = "2"; - showdata = showdata + "-01"; - } else { - datetype = "1"; - showdata = showdata + "-01-01"; - } - - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - List pvalueList1 = new ArrayList<>(); - List pvalueList2 = new ArrayList<>(); - List pvalueList3 = new ArrayList<>(); - - - for (int i = 0; i < maxDateM; i++) { - - List list = this.electricityPriceService.selectListByWhere("where insdt <= '" + showdata.substring(0, 7) + "-" + (i + 1) + "' and (stop_time > '" + showdata.substring(0, 7) + "-" + (i + 1) + "' or stop_time is null)"); - - // Double electricitytime = this.electricityPriceService.getElectricitytimebybizId(bizid, showdata.substring(0, 7)+"-"+(i+1), showdata.substring(0, 7)+"-"+(i+1)+" 23:59:59"); - if (list != null && list.size() > 0) { - Double ElectricityPrice = this.electricityPriceService.getElectricityPricebybizId(bizid, showdata.substring(0, 7) + "-" + (i + 1), showdata.substring(0, 7) + "-" + (i + 1) + " 23:59:59", list.get(0)); - - pvalueList1.add(ElectricityPrice.toString()); - } else { - pvalueList1.add(""); - } - - - } - - - Map> vmap = new LinkedHashMap<>(); - vmap.put("实际值", pvalueList1); - - json = json.fromObject(vmap); - request.setAttribute("result", json); - // List joalist = this.patrolPlanService.selectListByWhere(wherestr + orderstr); - return "result"; - } - - @RequestMapping("/doecharts2.do") - public String doecharts2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Map> vmap = new LinkedHashMap<>(); - - JSONObject json = new JSONObject(); - String bizid = request.getParameter("bizid"); - String showdata = request.getParameter("showdata"); - String datetype = "";//1 年 2月 - if (showdata.length() > 4) { - datetype = "2"; - showdata = showdata + "-01"; - } else { - datetype = "1"; - showdata = showdata + "-01-01"; - } - - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - - List pvalueList2 = new ArrayList<>(); - List pvalueList3 = new ArrayList<>(); - - - List efficiencyProcesss = this.efficiencyProcessService.selectListByWhere("where bizid = '" + bizid + "'"); - for (EfficiencyProcess efficiencyProcess : efficiencyProcesss) { - Double Electricitytime = (double) 0; - List pvalueList1 = new ArrayList<>(); - List mPointHistories = mPointHistoryService.selectListByTableAWhere(bizid, "TB_MP_" + efficiencyProcess.getCode(), " where MeasureDT >'" + showdata.substring(0, 7) + "-" + (1) + "' and MeasureDT <'" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59:59'"); - for (MPointHistory mPointHistory : mPointHistories) { - Electricitytime = Electricitytime + mPointHistory.getParmvalue().doubleValue(); - } - pvalueList1.add(Electricitytime.toString()); - pvalueList1.add(Electricitytime.toString()); - vmap.put(efficiencyProcess.getName(), pvalueList1); - - } - - - json = json.fromObject(vmap); - request.setAttribute("result", json); - // List joalist = this.patrolPlanService.selectListByWhere(wherestr + orderstr); - return "result"; - } - - @RequestMapping("/getelectricityCostAnalysis.do") - public String showlist(HttpServletRequest request, Model model, - HttpServletResponse response) { - User cu = (User) request.getSession().getAttribute("cu"); - - String datedifftype = ""; - String datetype = "";//1 年 2月 - String showdata = request.getParameter("showdata"); - - if (request.getParameter("datetype") != null && request.getParameter("datetype").length() > 0) { - datetype = request.getParameter("datetype"); - if (datetype.equals("2")) { - datedifftype = "month"; - if (showdata.length() > 4) { - showdata = request.getParameter("showdata").substring(0, 7); - } else { - showdata = CommUtil.subplus(CommUtil.nowDate(), "-1", "month").substring(0, 7); - } - } else { - datedifftype = "year"; - showdata = request.getParameter("showdata").substring(0, 4); - } - - } else { - datetype = "2"; - datedifftype = "month"; - showdata = CommUtil.subplus(CommUtil.nowDate(), "-1", "month").substring(0, 7); - } - request.setAttribute("datetype", datetype); - request.setAttribute("showdata", showdata); - // request.setAttribute("bizidmap", CompanyTool.getBizidList(cid,user.getCompanyid(),user.getId())); - // List list = this.electricityPriceService.selectListByWhere("where insdt >= '"+showdata.substring(0, 7)+"' and stop_time <= '"+showdata.substring(0, 7)+"' "); - Double ElectricityPrice = (double) 0; - //Double electricitytime = this.electricityPriceService.getElectricitytimebybizId(bizid, showdata.substring(0, 7)+"-"+(1), showdata.substring(0, 7)+"-"+(i+1)+"23:59:59"); -// if(list!=null||list.size()>0){ -// ElectricityPrice = list.get(0).getDianduprice() * electricitytime; -// -// } - request.setAttribute("totalpower", ElectricityPrice.toString()); - - return "/timeefficiency/electricityCostAnalysis"; - } -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolAreaController.java b/src/com/sipai/controller/timeefficiency/PatrolAreaController.java deleted file mode 100644 index 1b59c152..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolAreaController.java +++ /dev/null @@ -1,489 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.axiom.util.blob.Blob; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolAreaFloor; -import com.sipai.entity.timeefficiency.PatrolAreaProcessSection; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolAreaFloorService; -import com.sipai.service.timeefficiency.PatrolAreaProcessSectionService; -import com.sipai.service.timeefficiency.PatrolAreaService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/timeEfficiency/patrolArea") -public class PatrolAreaController { - - @Resource - private PatrolAreaService patrolAreaService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolAreaFloorService patrolAreaFloorService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private PatrolAreaProcessSectionService patrolAreaProcessSectionService; - @Resource - private PatrolPointService patrolPointService; - - - /** - * 主页 - */ - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/timeefficiency/patrolAreaList"; - } - - /** - * 巡检楼层配置 - */ - @RequestMapping("/showList4Floor.do") - public String showList4Floor(HttpServletRequest request, Model model) { - return "/timeefficiency/patrolAreaFloorList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and biz_id='" + request.getParameter("search_code") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - //格式化ids - String[] idArray = checkedIds.split(","); - String ids = ""; - for (String str : idArray) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += str; - } - wherestr += " and id in('" + ids.replace(",", "','") + "')"; - } - PageHelper.startPage(page, rows); - List list = this.patrolAreaService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 添加 - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - Company company = this.unitService.getCompById(request.getParameter("unitId")); - model.addAttribute("company", company); - return "/timeefficiency/patrolAreaAdd"; - } - - /** - * 保存 - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute PatrolArea patrolArea) { - User cu = (User) request.getSession().getAttribute("cu"); - patrolArea.setId(CommUtil.getUUID()); - patrolArea.setInsuser(cu.getId()); - patrolArea.setInsdt(CommUtil.nowDate()); - int result = this.patrolAreaService.save(patrolArea); - - -// String ProcessSectionId = request.getParameter("processSectionId"); -// String[] ProcessSectionIdStr = ProcessSectionId.split(","); -// String AreaId = patrolArea.getId(); - - /*for (int j = 0; j < ProcessSectionIdStr.length; j++) { - PatrolAreaProcessSection patrolAreaProcessSection = new PatrolAreaProcessSection(); - patrolAreaProcessSection.setId(CommUtil.getUUID()); - patrolAreaProcessSection.setInsuser(cu.getId()); - patrolAreaProcessSection.setInsdt(CommUtil.nowDate()); - patrolAreaProcessSection.setProcessSectionId(ProcessSectionIdStr[j]); - patrolAreaProcessSection.setPatrolAreaId(AreaId); - this.patrolAreaProcessSectionService.save(patrolAreaProcessSection); - }*/ - - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolArea.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolAreaService.deleteByWhere("where id in ('" + ids + "')"); - this.patrolAreaProcessSectionService.deleteByWhere("where patrol_area_id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletesFloor.do") - public String deletesFloor(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolAreaFloorService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /* - * 编辑 - */ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolArea patrolArea = this.patrolAreaService.selectById(Id); - Company company = this.unitService.getCompById(patrolArea.getBizId()); - model.addAttribute("patrolArea", patrolArea); - model.addAttribute("company", company); - return "timeefficiency/patrolAreaEdit"; - } - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PatrolArea patrolArea) { - - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.patrolAreaService.update(patrolArea); - - - this.patrolAreaProcessSectionService.deleteByWhere("where patrol_area_id = '" + patrolArea.getId() + "'"); - - String ProcessSectionId = request.getParameter("processSectionId"); - String[] ProcessSectionIdStr = ProcessSectionId.split(","); - String AreaId = patrolArea.getId(); - - for (int j = 0; j < ProcessSectionIdStr.length; j++) { - PatrolAreaProcessSection patrolAreaProcessSection = new PatrolAreaProcessSection(); - patrolAreaProcessSection.setId(CommUtil.getUUID()); - patrolAreaProcessSection.setInsuser(cu.getId()); - patrolAreaProcessSection.setInsdt(CommUtil.nowDate()); - patrolAreaProcessSection.setProcessSectionId(ProcessSectionIdStr[j]); - patrolAreaProcessSection.setPatrolAreaId(AreaId); - this.patrolAreaProcessSectionService.save(patrolAreaProcessSection); - } - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolArea.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolArea patrolArea = this.patrolAreaService.selectById(Id); - model.addAttribute("patrolArea", patrolArea); - return "/timeefficiency/patrolAreaView"; - } - - /** - * 获取工艺段 - */ - @RequestMapping("/getPatrolArea4Select.do") - public String getPatrolArea4Select(HttpServletRequest request, Model model) { - String bizId = request.getParameter("bizId"); - List patrolAreas = this.patrolAreaService.selectListByWhere("where biz_id='" + bizId + "'"); - JSONArray json = new JSONArray(); - if (patrolAreas != null && patrolAreas.size() > 0) { - for (int i = 0; i < patrolAreas.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolAreas.get(i).getId()); - jsonObject.put("text", patrolAreas.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 获取巡检点 - */ - @RequestMapping("/getPatrolPoints.do") - public String getPatrolPoints(HttpServletRequest request, Model model) { - String floorId = request.getParameter("floorId"); - String type = request.getParameter("type"); - String unitId = request.getParameter("unitId"); -// List patrolPoints = this.patrolAreaService.getPatrolPoints(floorId, type); - List patrolPoints = patrolPointService.selectListByWhere("where unit_id = '" + unitId + "' and type = '" + type + "' and floor_id = '" + floorId + "' "); - model.addAttribute("result", JSONArray.fromObject(patrolPoints)); - return "result"; - } - - /** - * @param request - * @param model - * @return - */ - @RequestMapping("/patrolAreaForSelect.do") - public String patrolAreaForSelect(HttpServletRequest request, Model model) { - String patrolAreaIds = request.getParameter("patrolAreaIds"); - String whereStr = "where id in ('" + patrolAreaIds.replace(",", "','") + "') "; - List list = this.patrolAreaService.selectListByWhere(whereStr); - model.addAttribute("patrolAreas", JSONArray.fromObject(list)); - return "timeefficiency/patrolAreaForSelect"; - } - - @RequestMapping("/getFloorList.do") - public ModelAndView getFloorList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - //String orderstr=" order by "+sort+" "+order + ",morder asc"; - String orderstr = " order by morder asc"; - - String wherestr = "where 1=1 "; -// wherestr += " and patrol_area_id = '"+request.getParameter("patrolAreaId")+"' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - //上级unit 的id - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取unitId下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String unitIds = ""; - for (Unit unit : units) { - unitIds += "'" + unit.getId() + "',"; - } - if (unitIds != "") { - unitIds = unitIds.substring(0, unitIds.length() - 1); - wherestr += " and unit_id in (" + unitIds + ") "; - } - } - PageHelper.startPage(page, rows); - List list = this.patrolAreaFloorService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getAllFloorList.do") - public ModelAndView getAllFloorList(HttpServletRequest request, Model model) { - String orderstr = "order by morder asc"; - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); -// //上级unit 的id -// if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ -// //获取unitId下所有子节点 -// List units = unitService.getUnitChildrenById(request.getParameter("unitId")); -// String unitIds=""; -// for(Unit unit : units){ -// unitIds += "'"+unit.getId()+"',"; -// } -// if(unitIds!=""){ -// unitIds = unitIds.substring(0, unitIds.length()-1); -// wherestr += " and unit_id in ("+unitIds+") "; -// } -// } - wherestr += " and unit_id = '" + unitId + "' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - List list = this.patrolAreaFloorService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getPatrolAreaFloor4Select.do") - public String getPatrolAreaFloor4Select(HttpServletRequest request, Model model) { - String orderstr = " order by morder asc"; - String wherestr = "where 1=1 "; - /*if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - //获取unitId下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String unitIds=""; - for(Unit unit : units){ - unitIds += "'"+unit.getId()+"',"; - } - if(unitIds!=""){ - unitIds = unitIds.substring(0, unitIds.length()-1); - wherestr += " and unit_id in ("+unitIds+") "; - } - }*/ - wherestr += " and unit_id = '" + request.getParameter("unitId") + "'"; - List list = this.patrolAreaFloorService.selectListByWhere(wherestr + orderstr); - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("text", list.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 添加 - */ - @RequestMapping("/addFloor.do") - public String addFloor(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "/timeefficiency/patrolAreaFloorAdd"; - } - - /** - * 保存 - */ - @RequestMapping("/saveFloor.do") - public String saveFloor(HttpServletRequest request, Model model, - @ModelAttribute PatrolAreaFloor patrolAreaFloor) { - //String userId= JwtUtil.getUserId(request.getHeader(CommString.TOKEN_HEADER)); - User cu = (User) request.getSession().getAttribute("cu"); -// patrolAreaFloor.setId(CommUtil.getUUID()); - patrolAreaFloor.setInsuser(cu.getId()); - patrolAreaFloor.setInsdt(CommUtil.nowDate()); - int result = this.patrolAreaFloorService.save(patrolAreaFloor); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolAreaFloor.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 数据删除方法 - */ - @RequestMapping("/deleteFloor.do") - public String deleteFloors(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.patrolAreaFloorService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.patrolAreaFloorService.deleteByWhere("where id in ('" + ids + "')"); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 编辑 - */ - @RequestMapping("/editFloor.do") - public String editFloor(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolAreaFloor patrolAreaFloor = this.patrolAreaFloorService.selectById(Id); - Result result = Result.success(patrolAreaFloor); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * bootstrap 巡检楼层编辑 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/edit4Floor.do") - public String edit4Floor(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolAreaFloor patrolAreaFloor = this.patrolAreaFloorService.selectById(Id); - model.addAttribute("patrolAreaFloor", patrolAreaFloor); - return "/timeefficiency/patrolAreaFloorEdit"; - } - - - /** - * 更新保存方法 - */ - @RequestMapping("/updateFloor.do") - public String doupdateFloor(HttpServletRequest request, Model model, - @ModelAttribute PatrolAreaFloor patrolAreaFloor) { - int res = this.patrolAreaFloorService.update(patrolAreaFloor); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } -} \ No newline at end of file diff --git a/src/com/sipai/controller/timeefficiency/PatrolAreaUserController.java b/src/com/sipai/controller/timeefficiency/PatrolAreaUserController.java deleted file mode 100644 index 3170646a..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolAreaUserController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolAreaProcessSection; -import com.sipai.entity.timeefficiency.PatrolAreaUser; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolAreaUserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/timeEfficiency/patrolAreaUser") -public class PatrolAreaUserController { - @Resource - private PatrolAreaUserService patrolAreaUserService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - if (request.getParameter("patrolAreaId") != null && !request.getParameter("patrolAreaId").isEmpty()) { - wherestr += " and patrol_area_id='" + request.getParameter("patrolAreaId") + "'"; - } - PageHelper.startPage(page, rows); - List list = this.patrolAreaUserService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存 - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @RequestParam(value = "patrolAreaId", required = true) String patrolAreaId, - @RequestParam(value = "ids", required = true) String ids) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (ids != null && !ids.trim().equals("")) { - String[] id = ids.split(","); - PatrolAreaUser patrolAreaUser = new PatrolAreaUser(); - for (String s : id) { - List list = patrolAreaUserService.selectListByWhere("where patrol_area_id = '" + patrolAreaId + "' and user_id = '" + s + "'"); - if (list != null && list.size() > 0) { - //重复 - } else { - patrolAreaUser.setId(CommUtil.getUUID()); - patrolAreaUser.setInsuser(cu.getId()); - patrolAreaUser.setInsdt(CommUtil.nowDate()); - patrolAreaUser.setUserId(s); - patrolAreaUser.setPatrolAreaId(patrolAreaId); - result += this.patrolAreaUserService.save(patrolAreaUser); - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.patrolAreaUserService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolAreaUserService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolContentsController.java b/src/com/sipai/controller/timeefficiency/PatrolContentsController.java deleted file mode 100644 index 1e82f1eb..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolContentsController.java +++ /dev/null @@ -1,643 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.timeefficiency.*; -import com.sipai.service.company.CompanyService; -import com.sipai.service.timeefficiency.PatrolContentsStandardService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - - -//import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -//import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -//import com.sipai.entity.maintenance.MaintenanceLibrary; -//import com.sipai.entity.maintenance.MaintenanceLibrary; -//import com.sipai.entity.equipment.EquipmentClass; -//import com.sipai.entity.equipment.EquipmentTypeNumber; -//import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.Company; -//import com.sipai.entity.user.Menu; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.timeefficiency.PatrolContentsService; -import com.sipai.service.timeefficiency.PatrolPointEquipmentCardService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 巡检内容--配置 - * - * @author SJ - */ -@Controller -@RequestMapping("/timeEfficiency/patrolContents") -public class PatrolContentsController { - - @Resource - private PatrolContentsService patrolContentsService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private PatrolContentsStandardService patrolContentsStandardService; - @Resource - private CompanyService companyService; - - //珠海专用 - @RequestMapping("/showPatrolPointEquipmentTree.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model) { - return "timeefficiency/patrolPointEquipmentTree"; - } - - //珠海专用 - @RequestMapping("/showPatrolContents.do") - public String showPatrolContents(HttpServletRequest request, Model model) { - model.addAttribute("pid", request.getParameter("id")); - model.addAttribute("type", request.getParameter("type")); - return "timeefficiency/patrolContentslList"; - } - - //珠海专用 - @RequestMapping("/doedit1.do") - public String doedit1(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolContents patrolContents = this.patrolContentsService.selectById(patrolPlanId); - model.addAttribute("patrolContents", patrolContents); - //Company company =unitService.getCompById(patrolContents.getCompanyId()); - //model.addAttribute("company", company); - return "timeefficiency/patrolContentsEdit"; - } - - @RequestMapping("/viewContents.do") - public String viewContents(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - - return "timeefficiency/patrolContentsView"; - } - - /*@RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String search_name_PointAndEq = request.getParameter("search_name_PointAndEq"); - if (type != null && !type.equals("")) { - // - } else { - type = PatrolType.Product.getId(); - } - - String equIds = "";//用于统计关联巡检点的设备id - - String wherestr = " where active='1' and type = '" + type + "' and unit_id='" + unitId + "' "; - String wherestr2 = " where 1=1 and e.id is not null "; - - *//*if (search_name_PointAndEq != null && !search_name_PointAndEq.trim().equals("")) { - wherestr2 += ""; - }*//* - - //挂了巡检点的设备 - List list = this.patrolPointService.selectListByWhere(wherestr + " order by morder"); - List list2 = this.patrolPointEquipmentCardService.selectListByWhereEquipmentCard(wherestr2); - JSONArray jsonArray = new JSONArray(); - for (PatrolPoint patrolPoint : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPoint.getId()); - jsonObject.put("name", patrolPoint.getName()); - jsonObject.put("text", patrolPoint.getName());//珠海专用 - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolPoint); - jsonObject.put("pid", "-1"); - JSONArray numArray = new JSONArray(); - for (PatrolPointEquipmentCard item : list2) { - if (patrolPoint.getId().equals(item.getPatrolPointId())) { - equIds += "'" + item.getEquipmentCardId() + "',"; - - JSONObject numObject = new JSONObject(); - numObject.put("id", item.getEquipmentCardId()); - if (item != null && item.getEquipmentCard() != null) { - numObject.put("name", item.getEquipmentCard().getEquipmentname()); - numObject.put("text", item.getEquipmentCard().getEquipmentname());//珠海专用 - } else { - numObject.put("name", ""); - numObject.put("text", "");//珠海专用 - } - numObject.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - numObject.put("pid", item.getPatrolPointId()); - - if (patrolPoint.getName().contains(search_name_PointAndEq)) { - numArray.add(numObject); - } else { - //根据模糊搜索显示设备名 - if (item.getEquipmentCard().getEquipmentname().contains(search_name_PointAndEq)) { - numArray.add(numObject); - } else { - - } - } - } - } - if (numArray.size() > 0) { - jsonObject.put("children", numArray); - jsonObject.put("nodes", numArray);//珠海专用 - } - //根据模糊搜索显示巡检点名 - if (search_name_PointAndEq != null && !search_name_PointAndEq.trim().equals("")) { - //search_name_PointAndEq不为空 则为开启了筛选 numArray大于0 则搜到了设备,关联的巡检点也显示出来 - if (numArray.size() > 0) { - jsonArray.add(jsonObject); - } - } else { - jsonArray.add(jsonObject); - } - - } - - //没有挂巡检点的设备 - if (type != null && !type.equals("") && type.equals(PatrolType.Equipment.getId())) { - String ids = "'-1'"; - if (equIds != null && !equIds.equals("")) { - ids = equIds.substring(0, equIds.length() - 1); - } - List list3 = this.equipmentCardService.selectSimpleListByWhere(" where bizId='" + unitId + "' and id not in (" + ids + ") order by equipmentCardID"); - for (EquipmentCard equipmentCard : list3) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCard.getId()); - jsonObject.put("name", equipmentCard.getEquipmentname()); - jsonObject.put("text", equipmentCard.getEquipmentname());//珠海专用 - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObject.put("pid", "-1"); - - if (search_name_PointAndEq != null && !search_name_PointAndEq.trim().equals("")) { - if (equipmentCard.getEquipmentname().contains(search_name_PointAndEq)) { - jsonArray.add(jsonObject); - } else { - - } - } else { - jsonArray.add(jsonObject); - } - } - } - model.addAttribute("result", "{\"treeList\":" + jsonArray + "}"); - - return "result"; - }*/ - - @RequestMapping("/getMenusJson.do") - public String getMenusJson(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String search_name = request.getParameter("search_name_PointAndEq"); - if (type != null && !type.equals("")) { - // - } else { - type = PatrolType.Product.getId(); - } - - String wherestr = " where p.active='1' and p.type = '" + type + "' and p.unit_id='" + unitId + "'"; -// String wherestr2 = " where 1=1 and e.id is not null "; - - //测量点和设备的关系map - Map map = new HashMap<>(); - //treeview Id和Text的关系临时缓存 - Map map2 = new HashMap<>(); - //未关联巡检点的设备 - Map map3 = new HashMap<>(); - - com.alibaba.fastjson.JSONArray jsonArray = patrolPointService.selectListByWhereGroup(wherestr, type, search_name, unitId); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - try { - com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(jsonArray.get(i).toString()); -// System.out.println(jsonObject); - //巡检点下挂了设备的 - if (jsonObject.get("equipmentId") != null) { - if (map.get(jsonObject.get("id").toString()) != null) { - map.put(jsonObject.get("id").toString(), map.get(jsonObject.get("id").toString()) + jsonObject.get("equipmentId").toString() + ";"); - map2.put(jsonObject.get("equipmentId").toString(), jsonObject.get("equipmentName").toString()); - } else { - map.put(jsonObject.get("id").toString(), jsonObject.get("equipmentId").toString() + ";"); - map2.put(jsonObject.get("id").toString(), jsonObject.get("name").toString()); - map2.put(jsonObject.get("equipmentId").toString(), jsonObject.get("equipmentName").toString()); - } - } else { - if (jsonObject.get("name") != null) { - map3.put(jsonObject.get("id").toString(), jsonObject.get("name").toString()); - map2.put(jsonObject.get("id").toString(), jsonObject.get("name").toString()); - } - } - //巡检点下未挂设备的 - if (jsonObject.get("point_type") != null && jsonObject.get("point_type").equals("noPoint")) { - map3.put(jsonObject.get("id").toString(), jsonObject.get("text").toString()); - map2.put(jsonObject.get("id").toString(), jsonObject.get("text").toString()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - JSONArray jsonArray_result = new JSONArray(); - for (Map.Entry entry : map.entrySet()) { - JSONArray numArray = new JSONArray(); - String key = (String) entry.getKey(); - String val = (String) entry.getValue(); - - JSONObject jsonObject_point = new JSONObject(); - jsonObject_point.put("id", key); - jsonObject_point.put("text", map2.get(key)); -// jsonObject_point.put("name", map2.get(key)); - jsonObject_point.put("pid", "-1"); - jsonObject_point.put("icon", TimeEfficiencyCommStr.PatrolPoint); - - JSONArray jsonArray_equipment = new JSONArray(); - if (val != null && !val.equals("")) { - String[] ids = val.split(";"); - if (ids != null && ids.length > 0) { - for (int i = 0; i < ids.length; i++) { - JSONObject jsonObject_equipment = new JSONObject(); - jsonObject_equipment.put("id", ids[i]); - jsonObject_equipment.put("text", map2.get(ids[i]));//wms前端使用 - jsonObject_equipment.put("pid", key); - jsonObject_equipment.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - - //根据模糊搜索显示巡检点名 - if (search_name != null && !search_name.trim().equals("")) { - //search_name_PointAndEq不为空 则为开启了筛选 numArray大于0 则搜到了设备,关联的巡检点也显示出来 - System.out.println(map2.get(ids[i]) + "======" + ids[i]); - if (map2.get(ids[i]) != null && (map2.get(ids[i]).contains(search_name) || map2.get(key).contains(search_name))) { -// if (map2.get(ids[i]).contains(search_name) || map2.get(key).contains(search_name)) { - if (map2.get(ids[i]) != null && !map2.get(ids[i]).equals("")) { - jsonArray_equipment.add(jsonObject_equipment); - } - numArray.add(jsonObject_equipment); - } - } else { - if (map2.get(ids[i]) != null && (map2.get(ids[i]) != null && !map2.get(ids[i]).equals(""))) { -// if (map2.get(ids[i]) != null && !map2.get(ids[i]).equals("")) { - jsonArray_equipment.add(jsonObject_equipment); - } - numArray.add(jsonObject_equipment); - } - - } - } - } - if (numArray.size() > 0) { - jsonObject_point.put("nodes", jsonArray_equipment);//wms前端使用 - jsonArray_result.add(jsonObject_point); - } - } - for (Map.Entry entry : map3.entrySet()) { - String key = (String) entry.getKey(); - - JSONObject jsonObject_point = new JSONObject(); - jsonObject_point.put("id", key); - jsonObject_point.put("text", map2.get(key)); - jsonObject_point.put("pid", "-1"); - if (type.equals("P")) { - jsonObject_point.put("icon", TimeEfficiencyCommStr.PatrolPoint); - } else if (type.equals("E")) { - jsonObject_point.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - } else { - jsonObject_point.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - } - //根据模糊搜索显示巡检点名 - if (search_name != null && !search_name.trim().equals("")) { - //search_name_PointAndEq不为空 则为开启了筛选 numArray大于0 则搜到了设备,关联的巡检点也显示出来 - if (map2.get(key).contains(search_name)) { - jsonArray_result.add(jsonObject_point); - } - } else { - jsonArray_result.add(jsonObject_point); - } - } -// System.out.println(jsonArray_result); - model.addAttribute("result", "{\"treeList\":" + jsonArray_result + "}"); - - return "result"; - } - - /** - * 根据巡检点id查询对应的巡检内容 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid"); - String type = request.getParameter("type"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " contents "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (pid != null && !pid.isEmpty()) { - wherestr += " and pid = '" + pid + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and contents like '%" + request.getParameter("search_name") + "%' "; - } - if (type != null && !type.isEmpty()) { - wherestr += " and patrol_contents_type = '" + type + "' "; - } - if (unitId != null && !unitId.isEmpty()) { - wherestr += " and unit_id = '" + unitId + "' "; - } - PageHelper.startPage(page, rows); - - List list = this.patrolContentsService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - request.setAttribute("company", company); - return "timeefficiency/patrolContentsAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolContents patrolContents = this.patrolContentsService.selectById(patrolPlanId); - model.addAttribute("patrolContents", patrolContents); - //Company company =unitService.getCompById(patrolContents.getCompanyId()); - //model.addAttribute("company", company); - model.addAttribute("result", JSONObject.fromObject(model)); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute PatrolContents patrolContents) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - patrolContents.setId(id); - patrolContents.setInsuser(cu.getId()); - patrolContents.setInsdt(CommUtil.nowDate()); - - int result = this.patrolContentsService.save(patrolContents); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PatrolContents patrolContents) { - int result = this.patrolContentsService.update(patrolContents); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolContents.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - PatrolContents patrolContents = this.patrolContentsService.selectById(id); - model.addAttribute("patrolContents", patrolContents); - return "timeefficiency/patrolContentsView"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.patrolContentsService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolContentsService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取 巡检点/设备 下配置的巡检内容 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolContents.do") - public ModelAndView getPatrolContents(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid");//巡检点Id/设备Id - String type = request.getParameter("type");//巡检类型P/E - type = TimeEfficiencyCommStr.PatrolType_Product; -// type = "E";s - String wherestr = " "; - List list = this.patrolContentsService.selectListByPlan(wherestr, pid, type); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - //System.out.println(CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取设备下配置的巡检内容 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolContents4Equipment.do") - public ModelAndView getPatrolContents4Equipment(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid");// 巡检点Id/设备Id - String type = request.getParameter("type");//巡检类型P/E - type = TimeEfficiencyCommStr.PatrolType_Equipment; - String wherestr = " where pid='" + pid + "' and patrol_contents_type = '" + type + "'"; - List list = this.patrolContentsService.selectListByWhere(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 复制巡检内容至其他巡检点界面 sj 2002-09-25 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/copyFun.do") - public String copyFun(HttpServletRequest request, Model model) { - String datas = request.getParameter("datas"); - model.addAttribute("datas", datas); - return "timeefficiency/patrolContentCopyList"; - } - - /** - * 执行复制的巡检内容到指定巡检点 sj 2020-09-25 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/copyPatrolContents4Point.do") - public String copyPatrolContents4Point(HttpServletRequest request, Model model) { - String patrolPointIds = request.getParameter("patrolPointIds");//需要执行复制的巡检点Ids - String patrolContentIds = request.getParameter("patrolContentIds");//勾选的巡检内容ids - int result = this.patrolContentsService.copyPatrolContents4Point(patrolPointIds, patrolContentIds); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/refresh.do") - public String refresh(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - int res = 0; - //运行巡检同步 - if (type != null && !type.equals("") && type.equals(PatrolType.Product.getId())) { - List list = this.patrolPointService.selectListByWhere(" where active='1' and type = '" + type + "' and unit_id='" + unitId + "' order by morder"); - List list2 = this.patrolPointEquipmentCardService.selectListByWhereEquipmentCard(" where 1=1 and e.id is not null "); - for (PatrolPoint patrolPoint : list) { - for (PatrolPointEquipmentCard item : list2) { - if (patrolPoint.getId().equals(item.getPatrolPointId())) { -// System.out.println(patrolPoint.getId()+"------"+item.getEquipmentCardId()); - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(item.getEquipmentCardId()); - if (equipmentCard != null) { - String whereStr = "where 1=1"; - //如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr += " and unit_id = '" + unitId + "' "; - } - whereStr += " and pid = '" + equipmentCard.getEquipmentclassid() + "' "; - //设备巡检同步 2级和3级巡检 - whereStr += " and patrol_rank = '" + TimeEfficiencyCommStr.Patrol_Rank1 + "' "; - - List liststand = patrolContentsStandardService.selectListByWhere(whereStr); - if (liststand != null && liststand.size() > 0) { - for (int i = 0; i < liststand.size(); i++) { - PatrolContents patrolContents = new PatrolContents(); - patrolContents.setUnitId(unitId); - patrolContents.setCode(liststand.get(i).getCode()); - patrolContents.setContents(liststand.get(i).getName()); - patrolContents.setContentsDetail(liststand.get(i).getContents()); - patrolContents.setPatrolContentsType(type); - patrolContents.setPatrolRank(liststand.get(i).getPatrolRank()); - patrolContents.setPid(equipmentCard.getId()); - patrolContents.setTool(liststand.get(i).getTool()); - patrolContents.setSafeNote(liststand.get(i).getSafeNote()); - - String wherestr = "where code = '" + liststand.get(i).getCode() + "' and unit_id = '" + unitId + "' and pid = '" + equipmentCard.getId() + "' and patrol_contents_type = '" + type + "'"; - List liststand2 = patrolContentsService.selectListByWhere(wherestr); - if (liststand2 != null && liststand2.size() > 0) { - patrolContents.setId(liststand2.get(0).getId()); - //res += patrolContentsService.update(patrolContents); - } else { - patrolContents.setId(CommUtil.getUUID()); - res += patrolContentsService.save(patrolContents); - } - } - } - } - } - } - } - } - - //设备巡检同步 - if (type != null && !type.equals("") && type.equals(PatrolType.Equipment.getId())) { - List list3 = this.equipmentCardService.selectSimpleListByWhere(" where bizId='" + unitId + "' order by equipmentCardID"); - for (EquipmentCard equipmentCard : list3) { - - String whereStr = "where 1=1"; - //如果配置了所属标准库则 查看对应的业务区库 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - whereStr += " and unit_id = '" + company.getLibraryBizid() + "'"; - } else { - whereStr += " and unit_id = '" + unitId + "' "; - } - whereStr += " and pid = '" + equipmentCard.getEquipmentclassid() + "' "; - //设备巡检同步 2级和3级巡检 - whereStr += " and (patrol_rank = '" + TimeEfficiencyCommStr.Patrol_Rank2 + "' or patrol_rank = '" + TimeEfficiencyCommStr.Patrol_Rank3 + "')"; - - List liststand = patrolContentsStandardService.selectListByWhere(whereStr); - if (liststand != null && liststand.size() > 0) { - for (int i = 0; i < liststand.size(); i++) { - PatrolContents patrolContents = new PatrolContents(); - patrolContents.setUnitId(unitId); - patrolContents.setCode(liststand.get(i).getCode()); - patrolContents.setContents(liststand.get(i).getName()); - patrolContents.setContentsDetail(liststand.get(i).getContents()); - patrolContents.setPatrolContentsType(type); - patrolContents.setPatrolRank(liststand.get(i).getPatrolRank()); - patrolContents.setPid(equipmentCard.getId()); - patrolContents.setTool(liststand.get(i).getTool()); - patrolContents.setSafeNote(liststand.get(i).getSafeNote()); - - String wherestr = "where code = '" + liststand.get(i).getCode() + "' and unit_id = '" + unitId + "' and pid = '" + equipmentCard.getId() + "' and patrol_contents_type = '" + type + "'"; - List liststand2 = patrolContentsService.selectListByWhere(wherestr); - if (liststand2 != null && liststand2.size() > 0) { - patrolContents.setId(liststand2.get(0).getId()); - //res += patrolContentsService.update(patrolContents); - } else { - patrolContents.setId(CommUtil.getUUID()); - res += patrolContentsService.save(patrolContents); - } - } - } - } - } - String resstr = "{\"res\":\"" + res + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolContentsPlanController.java b/src/com/sipai/controller/timeefficiency/PatrolContentsPlanController.java deleted file mode 100644 index bf8bc4d9..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolContentsPlanController.java +++ /dev/null @@ -1,272 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.sipai.entity.base.Result; -import com.sipai.entity.timeefficiency.PatrolContents; -import com.sipai.entity.timeefficiency.PatrolContentsPlan; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolContentsPlanService; -import com.sipai.service.timeefficiency.PatrolContentsService; -import com.sipai.service.timeefficiency.PatrolPlanPatrolEquipmentService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -/** - * 巡检内容--(关联巡检计划) 2020-03-16 - * @author SJ - * - */ -@Controller -@RequestMapping("/timeEfficiency/patrolContentsPlan") -public class PatrolContentsPlanController { - - @Resource - private PatrolContentsPlanService patrolContentsPlanService; - @Resource - private PatrolContentsService patrolContentsService; - @Resource - private PatrolPlanPatrolEquipmentService patrolPlanPatrolEquipmentService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - - @RequestMapping("/getPatrolContentsPlanlist.do") - public ModelAndView getPatrolContentsPlanlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " deptid "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("bizId")!=null && !request.getParameter("bizId").isEmpty()){ - wherestr += " and biz_id = '"+request.getParameter("bizId")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.patrolContentsPlanService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - // System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Company company =unitService.getCompById(companyId); - request.setAttribute("company", company); - return "timeefficiency/patrolContentsPlanAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String patrolPlanId = request.getParameter("id"); - PatrolContentsPlan patrolContentsPlan = this.patrolContentsPlanService.selectById(patrolPlanId); - model.addAttribute("patrolContentsPlan", patrolContentsPlan); - //Company company =unitService.getCompById(patrolContentsPlan.getCompanyId()); - //model.addAttribute("company", company); - model.addAttribute("result",JSONObject.fromObject(model)); - return "result"; - } - - /** - * 手动新增巡检内容 - * @param request - * @param model - * @param patrolContentsPlan - * @return - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute PatrolContentsPlan patrolContentsPlan){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - patrolContentsPlan.setId(id); - patrolContentsPlan.setInsuser(cu.getId()); - patrolContentsPlan.setInsdt(CommUtil.nowDate()); - - int result =this.patrolContentsPlanService.save(patrolContentsPlan); - - String msg = ""; - if(result!=0){ - msg = "新增成功"; - }else { - msg = "新增失败"; - } - //String resstr= CommUtil.getJsonResult(result, msg, null); - model.addAttribute("result", msg); - return "result"; - } - /** - * 手动修改巡检内容 - * @param request - * @param model - * @param patrolContentsPlan - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute PatrolContentsPlan patrolContentsPlan){ - int result = this.patrolContentsPlanService.update(patrolContentsPlan); - - String msg = ""; - if(result!=0){ - msg = "修改成功"; - }else { - msg = "修改失败"; - } - //String resstr= CommUtil.getJsonResult(result, msg, null); - model.addAttribute("result", msg); - return "result"; - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - PatrolContentsPlan patrolContentsPlan = this.patrolContentsPlanService.selectById(id); - model.addAttribute("patrolContentsPlan", patrolContentsPlan); - return "timeefficiency/patrolContentsPlanView"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.patrolContentsPlanService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.patrolContentsPlanService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取巡检计划下巡检点 已关联的巡检内容 (运行巡检) - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolContentsPlan.do") - public ModelAndView getPatrolContentsPlan(HttpServletRequest request,Model model) { - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String patrolPointId = request.getParameter("patrolPointId");//巡检点Id - //String unitId = request.getParameter("unitId"); - String wherestr = " where patrol_plan_id='"+patrolPlanId +"' and patrol_point_id='"+patrolPointId - +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"; - List list = this.patrolContentsPlanService.selectListByTree(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - //model.addAttribute("result",list); - return new ModelAndView("result"); - } - - /** - * 保存巡检计划下关联的巡检点下的巡检内容 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveByPatrolPlan.do") - public String saveByPatrolPlan(HttpServletRequest request,Model model){ - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String patrolPointId = request.getParameter("patrolPointId");//巡检点Id - String jsonStr = request.getParameter("jsonStr");//勾选的json - - User cu= (User)request.getSession().getAttribute("cu"); - - //删除设备中间表 - patrolPlanPatrolEquipmentService.deleteByWhere(" where patrol_point_id = '"+patrolPointId+"' and patrol_plan_id='"+patrolPlanId+"' "); - - //删除该巡检点下的巡检内容 - patrolContentsPlanService.deleteByWhere(" where patrol_point_id = '"+patrolPointId+"' and patrol_plan_id='"+patrolPlanId+"'"); - - //保存巡检内容 vue - //int res = this.patrolContentsPlanService.saveByPlan(jsonStr,patrolPlanId,patrolPointId,cu.getId(),TimeEfficiencyCommStr.PatrolEquipment_Point); - //保存巡检内容 bootstrap treeview - int res = this.patrolContentsPlanService.saveByPlan(jsonStr,patrolPlanId,patrolPointId,cu.getId(),TimeEfficiencyCommStr.PatrolEquipment_Point); - - Result result = Result.success(res); - System.out.println(CommUtil.toJson(result)); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取巡检计划下设备 已关联的巡检内容 (设备巡检) - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolContentsPlan4Equipment.do") - public ModelAndView getPatrolContentsPlan4Equipment(HttpServletRequest request,Model model) { - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String equipmentId = request.getParameter("equipmentId");//巡检点Id - //String unitId = request.getParameter("unitId"); - String wherestr = " where patrol_plan_id='"+patrolPlanId+"' and equipment_id='"+equipmentId+"' "; - List list = this.patrolContentsPlanService.selectListByWhere(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); -// System.out.println(CommUtil.toJson(result)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 保存巡检计划下关联的设备下的巡检内容 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmetPatrolContentsByPatrolPlan.do") - public String saveEquipmetPatrolContentsByPatrolPlan(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids, - @RequestParam(value="patrol_plan_id") String patrolPlanId){ - String equipmentId = request.getParameter("equipment_id");//测量点Id - User cu= (User)request.getSession().getAttribute("cu"); - //先删除对应的巡检内容 - patrolContentsPlanService - .deleteByWhere(" where equipment_id = '"+equipmentId+"' and patrol_plan_id='"+patrolPlanId+"'"); - int res = this.patrolContentsPlanService.saveByPlan(ids,patrolPlanId,equipmentId,cu.getId()); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolContentsRecordController.java b/src/com/sipai/controller/timeefficiency/PatrolContentsRecordController.java deleted file mode 100644 index a1bade37..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolContentsRecordController.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.timeefficiency.PatrolContentsPlan; -import com.sipai.entity.timeefficiency.PatrolContentsRecord; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolContentsRecordService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 巡检内容--(关联巡检记录) 2020-03-16 - * - * @author SJ - */ -@Controller -@RequestMapping("/timeEfficiency/patrolContentsRecord") -public class PatrolContentsRecordController { - - @Resource - private PatrolContentsRecordService patrolContentsRecordService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - - @RequestMapping("/showPatrolPointViewContentsMeasurepoints.do") - public String showPatrolPointViewContentsMeasurepoints(HttpServletRequest request, Model model) { - request.setAttribute("patrolRecordId", request.getParameter("patrolRecordId")); - request.setAttribute("patrolPointId", request.getParameter("patrolPointId")); - request.setAttribute("unitId", request.getParameter("unitId")); - return "timeefficiency/patrolPointViewContentsMeasurepoints"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - request.setAttribute("company", company); - return "timeefficiency/patrolContentsRecordAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolContentsRecord patrolContentsRecord = this.patrolContentsRecordService.selectById(patrolPlanId); - model.addAttribute("patrolContentsRecord", patrolContentsRecord); - //Company company =unitService.getCompById(patrolContentsRecord.getCompanyId()); - //model.addAttribute("company", company); - model.addAttribute("result", JSONObject.fromObject(model)); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute PatrolContentsRecord patrolContentsRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - patrolContentsRecord.setId(id); - patrolContentsRecord.setInsuser(cu.getId()); - patrolContentsRecord.setInsdt(CommUtil.nowDate()); - - int result = this.patrolContentsRecordService.save(patrolContentsRecord); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PatrolContentsRecord patrolContentsRecord) { - int result = this.patrolContentsRecordService.update(patrolContentsRecord); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolContentsRecord.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - PatrolContentsRecord patrolContentsRecord = this.patrolContentsRecordService.selectById(id); - model.addAttribute("patrolContentsRecord", patrolContentsRecord); - return "timeefficiency/patrolContentsRecordView"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.patrolContentsRecordService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolContentsRecordService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取巡检记录下巡检点 已关联的巡检内容 - * 如果为设备巡检 只有任务id和设备id 没有巡检点的id - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolContentsRecord.do") - public ModelAndView getPatrolContentsRecord(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - String patrolPointId = request.getParameter("patrolPointId");//巡检点id - String equipmentId = request.getParameter("equipmentId");//巡检点id - String unitId = request.getParameter("unitId");//部门id - List list = this.patrolContentsRecordService.selectListByTree(patrolRecordId, patrolPointId, equipmentId, unitId); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 更新巡检内容状态 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updatePatrolContents.do") - public ModelAndView updatePatrolContents(HttpServletRequest request, Model model) { - String json = request.getParameter("json"); - Boolean isLimited = Boolean.valueOf(request.getParameter("isLimited"));//是否 判断时间 true使用sid false使用id null使用id - - String idstr = "id"; - if (isLimited != null && !isLimited.equals("")) { - if (isLimited) { - idstr = "sid"; - } else { - idstr = "id"; - } - } else { - idstr = "id"; - } - - org.json.JSONObject jsonObject = new org.json.JSONObject(json); - org.json.JSONArray jsonArray = new org.json.JSONArray(jsonObject.opt("re1").toString()); - int count = 0; - for (int i = 0; i < jsonArray.length(); i++) { - String id = jsonArray.getJSONObject(i).optString(idstr); - String status = jsonArray.getJSONObject(i).optString("status"); - - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setId(id); - patrolContentsRecord.setStatus(status); - if (status != null && status.equals(PatrolRecord.Status_Finish)) { - patrolContentsRecord.setCompletedt(CommUtil.nowDate()); - } else { - patrolContentsRecord.setCompletedt(null); - } - int res = patrolContentsRecordService.update(patrolContentsRecord); - count = count + res; - } - Result result = null; - if (count == jsonArray.length()) { - result = Result.success(count); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - result = Result.failed(""); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 获取 巡检点 或 设备 下巡检内容 - * equipmentId为null则是巡检点 不为null则为设备 sj 2020-06-05 修改 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolContents4APP.do") - public ModelAndView getPatrolContents4APP(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - // String unitId = request.getParameter("unitId"); - String equipmentId = request.getParameter("equipmentId"); - String orderstr = " order by morder"; - String wherestr = ""; - String type = request.getParameter("type"); - if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(type)) { - //查看设备巡检下设备的巡检内容 - wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id is null and equipment_id='" + equipmentId + "' "; - } else if (TimeEfficiencyCommStr.PatrolType_Product.equals(type)) { - if (equipmentId != null && !equipmentId.equals("")) { - //查看运行巡检下设备的巡检内容 - wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id='" + equipmentId + "' "; - } else { - //查看运行巡检下巡检点的巡检内容 - wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id is null "; - } - } else { - return new ModelAndView("result"); - } - - List list = this.patrolContentsRecordService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - - } - -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolContentsStandardController.java b/src/com/sipai/controller/timeefficiency/PatrolContentsStandardController.java deleted file mode 100644 index 256319f0..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolContentsStandardController.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.timeefficiency.PatrolContentsStandard; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.timeefficiency.PatrolContentsStandardService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/timeEfficiency/patrolContentsStandard") -public class PatrolContentsStandardController { - @Resource - private PatrolContentsStandardService patrolContentsStandardService; - @Resource - private EquipmentClassService equipmentClassService; - - /** - * 设备巡检库标准化库 - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Tree.do") - public String showList4Tree(HttpServletRequest request,Model model){ - return "/timeefficiency/patrolContentsStandard4Tree"; - } - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "timeefficiency/patrolContentsStandardList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String classId = request.getParameter("classId"); - String unitId = request.getParameter("unitId"); - PageHelper.startPage(page, rows); - List list = this.patrolContentsStandardService.selectListByWhere("where 1=1 and pid = '"+classId+"' and unit_id = '"+unitId+"' order by code asc"); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!= null && !pid.equals("") && !pid.equals("-1")){ - EquipmentClass equipmentClass = equipmentClassService.selectById(pid); - model.addAttribute("pname",equipmentClass.getName()); - model.addAttribute("pid",pid); - } - return "timeefficiency/patrolContentsStandardAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("patrolContentsStandard") PatrolContentsStandard patrolContentsStandard){ - User cu= (User)request.getSession().getAttribute("cu"); - patrolContentsStandard.setId(CommUtil.getUUID()); - patrolContentsStandard.setUpddt(CommUtil.nowDate()); - patrolContentsStandard.setUpduser(cu.getId()); -// patrolContentsStandard.setUnitId("-1"); - int res = this.patrolContentsStandardService.save(patrolContentsStandard); - - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - PatrolContentsStandard patrolContentsStandard = this.patrolContentsStandardService.selectById(id); - if(patrolContentsStandard!=null){ - model.addAttribute("patrolContentsStandard",patrolContentsStandard ); - EquipmentClass equipmentClass = equipmentClassService.selectById(patrolContentsStandard.getPid()); - if(equipmentClass!=null){ - model.addAttribute("pname",equipmentClass.getName()); - } - } - return "timeefficiency/patrolContentsStandardEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("patrolContentsStandard") PatrolContentsStandard patrolContentsStandard){ - int res = this.patrolContentsStandardService.update(patrolContentsStandard); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("保存失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.patrolContentsStandardService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 导出 - */ - @RequestMapping(value = "doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response,Model model, - @RequestParam(value="unitId") String unitId) throws IOException { - - //获取单厂设备台帐中存在的设备大类 - String bigClassId = equipmentClassService.getTreeIdS4HaveBigId(unitId); - //获取单厂设备台帐中存在的设备小类 - String smallClassId = equipmentClassService.getTreeIdS4HaveSmallId(unitId); - - String wherestr = " where pid = '-1' and id in ("+bigClassId+") order by morder asc "; - List equipmentClasses = this.equipmentClassService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.patrolContentsStandardService.doExport(response, equipmentClasses, unitId, smallClassId); - return null; - } - - @RequestMapping("/doImport.do") - public String doImport(HttpServletRequest request,Model model){ - return "timeefficiency/patrolContentsStandardImport"; - } - - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - - //获取单厂设备台帐中存在的设备小类 然后递归大类 获取所有类别id - String allId = equipmentClassService.getTreeIdS4Have(unitId); - List list = this.equipmentClassService.selectListByWhere(" where id in ("+allId+") order by equipment_class_code asc"); - String jsonstr = equipmentClassService.getTreeListtest(null, list); - - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? patrolContentsStandardService.readXls(excelFile.getInputStream(),jsonstr,cu.getId(),unitId) : this.patrolContentsStandardService.readXlsx(excelFile.getInputStream(),jsonstr,cu.getId(),unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolMeasurePointPlanController.java b/src/com/sipai/controller/timeefficiency/PatrolMeasurePointPlanController.java deleted file mode 100644 index de4d99d4..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolMeasurePointPlanController.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.timeefficiency.PatrolContents; -import com.sipai.entity.timeefficiency.PatrolMeasurePointPlan; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolMeasurePointPlanService; -import com.sipai.service.timeefficiency.PatrolPointMeasurePointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -/** - * 填报内容--(关联巡检计划) 2020-04-10 - * @author SJ - * - */ -@Controller -@RequestMapping("/timeEfficiency/patrolMeasurePointPlan") -public class PatrolMeasurePointPlanController { - - @Resource - private PatrolMeasurePointPlanService patrolMeasurePointPlanService; - @Resource - private PatrolPointMeasurePointService patrolPointMeasurePointService; -// @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private EquipmentCardService equipmentCardService; - /** - * 获取填报内容----填报内容库中 - * @param request - * @param model - * @return - */ - @RequestMapping("/getMeasurePointByPatrolPoint.do") - public ModelAndView getMeasurePointByPatrolPoint(HttpServletRequest request,Model model) { - String patrolPointId = request.getParameter("patrolPointId");//巡检点id - String unitId = request.getParameter("unitId"); - String wherestr = " where patrol_point_id='"+patrolPointId+"'"; - List list = this.patrolPointMeasurePointService.selectListByWhereMPointAndEquiment(unitId,patrolPointId,wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - //System.out.println(CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取填报内容----巡检计划下 - * @param request - * @param model - * @return - */ - @RequestMapping("/getMeasurePointByPatrolPlan.do") - public ModelAndView getMeasurePointByPatrolPlan(HttpServletRequest request,Model model) { - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String patrolPointId = request.getParameter("patrolPointId");//巡检点Id - String unitId = request.getParameter("unitId"); - String wherestr = " where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id='"+patrolPointId - +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"; - List list = this.patrolMeasurePointPlanService.selectListByTree(unitId,wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - //model.addAttribute("result",list); - return new ModelAndView("result"); - } - - /** - * 保存巡检计划下关联的巡检点下的填报内容 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveByPatrolPlan.do") - public String saveByPatrolPlan(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String patrolPointId = request.getParameter("patrolPointId");//巡检点Id - String jsonStr = request.getParameter("jsonStr");//勾选的json - String unitId = request.getParameter("unitId");//部门Id - - //删除该巡检点下的填报内容 - patrolMeasurePointPlanService.deleteByWhere(" where patrol_point_id = '"+patrolPointId+"' and patrol_plan_id='"+patrolPlanId+"'"); - //保存填报内容 - int res = patrolMeasurePointPlanService.saveByPlan(jsonStr,patrolPlanId,patrolPointId,cu.getId(),unitId,TimeEfficiencyCommStr.PatrolEquipment_Point); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - System.out.println("保存填报:"+CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取设备填报内容(测量点) 白龙港vue之前为返回list格式 如需返回树形可调用 getMeasurePointByEquipmentTree - * @param request - * @param model - * @return - */ - @RequestMapping("/getMeasurePointByEquipment.do") - public ModelAndView getMeasurePointByEquipment(HttpServletRequest request,Model model) { - String equipmentId = request.getParameter("equipmentId");//巡检点id - String unitId = request.getParameter("unitId"); - //获取手动点 -// String wherestr = " where equipmentId='"+equipmentId+"' and type = '"+MPoint.Flag_Type_Hand+"'"; - String wherestr = " where equipmentId='"+equipmentId+"' and source_type = '"+MPoint.Flag_Type_Hand+"'"; - //白龙港 - //String wherestr = " where equipmentId='"+equipmentId+"' and source_type = '"+MPoint.Flag_Type_Hand+"'"; - List list = this.mPointService.selectListByWhere(unitId,wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - /** - * 获取设备填报内容(测量点) 返回树形 - * @param request - * @param model - * @return - */ -// @RequestMapping("/getMeasurePointByEquipmentTree.do") -// public ModelAndView getMeasurePointByEquipmentTree(HttpServletRequest request,Model model) { -// String equipmentId = request.getParameter("equipmentId");//巡检点id -// String unitId = request.getParameter("unitId"); -// //获取手动点 -// String wherestr = " where equipmentId='"+equipmentId+"' "; -// List list = this.mPointService.selectListByWhere(unitId,wherestr); -// JSONArray jsonArray = new JSONArray(); -// JSONArray jsonArrayPoint = new JSONArray(); -// for (MPoint mPoint : list) { -// JSONObject jsonObjectPoint = new JSONObject(); -// jsonObjectPoint.put("id", mPoint.getId()); -// jsonObjectPoint.put("name", mPoint.getParmname()); -// jsonObjectPoint.put("text", mPoint.getParmname()); -// jsonObjectPoint.put("icon", TimeEfficiencyCommStr.PatrolMeasurePoint); -// jsonArrayPoint.add(jsonObjectPoint); -// } -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("nodes",jsonArrayPoint); -// EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentId); -// if(equipmentCard!=null){ -// jsonObject.put("id", equipmentCard.getId()); -// jsonObject.put("name", equipmentCard.getEquipmentname()); -// jsonObject.put("text", equipmentCard.getEquipmentname());//之前树的取名未规范,后面名称都用text -// jsonObject.put("icon", TimeEfficiencyCommStr.PatrolEquipment); -// } -// jsonArray.add(jsonObject); -// Result result = Result.success(JSONArray.fromObject(jsonArray)); -// System.out.println(CommUtil.toJson(result)); -// model.addAttribute("result",CommUtil.toJson(result)); -// return new ModelAndView("result"); -// -// } - - /** - * 获取设备的填报内容----巡检计划下 - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentMPointByPatrolPlan.do") - public ModelAndView getEquipmentMPointByPatrolPlan(HttpServletRequest request,Model model) { - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String equipmentId = request.getParameter("equipmentId");//巡检点Id - String unitId = request.getParameter("unitId"); - String wherestr = " where patrol_plan_id='"+patrolPlanId+"' and equipment_id='"+equipmentId - +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Equipment+"'"; - List list = this.patrolMeasurePointPlanService.selectListByPlan(unitId,wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); -// System.out.println(CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 保存巡检计划下关联的巡检点下的填报内容 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentMPointByPatrolPlan.do") - public String saveByPatrolPlan(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids, - @RequestParam(value="patrol_plan_id") String patrol_plan_id, - @RequestParam(value="equipment_id") String equipment_id){ - User cu= (User)request.getSession().getAttribute("cu"); - //先删除pid对应的填报内容 - this.patrolMeasurePointPlanService - .deleteByWhere(" where equipment_id = '"+equipment_id+"' and patrol_plan_id='"+patrol_plan_id - +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Equipment+"'"); - //保存填报内容 - int res = this.patrolMeasurePointPlanService.saveByPlan(ids,patrol_plan_id,equipment_id,cu.getId()); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolMeasurePointRecordController.java b/src/com/sipai/controller/timeefficiency/PatrolMeasurePointRecordController.java deleted file mode 100644 index fe7030bc..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolMeasurePointRecordController.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.base.Result; -import com.sipai.entity.timeefficiency.PatrolContentsRecord; -import com.sipai.entity.timeefficiency.PatrolMeasurePointPlan; -import com.sipai.entity.timeefficiency.PatrolMeasurePointRecord; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.timeefficiency.PatrolMeasurePointRecordService; -import com.sipai.service.timeefficiency.PatrolPointMeasurePointService; -import com.sipai.tools.CommUtil; - -/** - * 填报内容--(关联巡检计划) 2020-04-10 - * - * @author SJ - */ -@Controller -@RequestMapping("/timeEfficiency/patrolMeasurePointRecord") -public class PatrolMeasurePointRecordController { - @Resource - private PatrolMeasurePointRecordService patrolMeasurePointRecordService; - @Resource - private PatrolPointMeasurePointService patrolPointMeasurePointService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointService mPointService; - - /** - * 获取填报内容----巡检记录下 2020-05-26 - * 如果为设备巡检 只有任务id和设备id 没有巡检点的id - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMeasurePointByPatrolRecord.do") - public ModelAndView getMeasurePointByPatrolRecord(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - String patrolPointId = request.getParameter("patrolPointId");//巡检点id - String equipmentId = request.getParameter("equipmentId");//巡检点id - String unitId = request.getParameter("unitId");//部门id - JSONArray list = this.patrolMeasurePointRecordService.selectListByTree(patrolRecordId, patrolPointId, equipmentId, unitId); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); -// System.out.println("~"+CommUtil.toJson(result)); - return new ModelAndView("result"); - } - /** - * 获取填报内容----巡检记录下 (老的列表) - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getMeasurePointByPatrolRecord.do") - public ModelAndView getMeasurePointByPatrolRecord(HttpServletRequest request,Model model) { - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - String patrolPointId = request.getParameter("patrolPointId");//巡检点id - String unitId = request.getParameter("unitId");//部门id - String wherestr = " where patrol_record_id='"+patrolRecordId+"' and patrol_point_id='"+patrolPointId+"' "; - List list = this.patrolMeasurePointRecordService.selectListByRecord(unitId,wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - }*/ - - /** - * 更新填报内容状态 - * - * @param request - * @param model - * @return - */ - @RequestMapping(value = "/updatePatrolMeasurePoint.do") - public ModelAndView updatePatrolMeasurePoint(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - String json = request.getParameter("json"); - String notime = CommUtil.nowDate(); - System.out.println("进了方法:" + notime); - - int count = 0; - PatrolRecord patrolRecord = patrolRecordService.selectById(patrolRecordId); - if (patrolRecord != null) { - org.json.JSONObject jsonObject = new org.json.JSONObject(json); - org.json.JSONArray jsonArray = new org.json.JSONArray(jsonObject.opt("re1").toString()); - - MPoint mPoint = new MPoint(); - MPointHistory mPointHistory = new MPointHistory(); - - for (int i = 0; i < jsonArray.length(); i++) { - String id = jsonArray.getJSONObject(i).optString("id");//填报内容列表id - String values = jsonArray.getJSONObject(i).optString("parmvalue"); - PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); - patrolMeasurePointRecord.setId(id); - if (values != null && !values.equals("")) { - String strValue = values; - //去除数据填报中的空格 - if (strValue != null && !strValue.equals("")) { - strValue = strValue.trim(); - } - BigDecimal bigValue = new BigDecimal(strValue); - patrolMeasurePointRecord.setMpvalue(strValue); - patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Finish); - - //插入主表 - mPoint.setId(jsonArray.getJSONObject(i).optString("mp_id")); - mPoint.setMeasuredt(notime); - mPoint.setParmvalue(bigValue); - mPointService.update(patrolRecord.getUnitId(), mPoint); - - //插入子表 - List list_his = mPointHistoryService.selectListByTableAWhere(patrolRecord.getUnitId(), "[tb_mp_" + jsonArray.getJSONObject(i).optString("mpointcode") + "]", "where userid = '" + patrolRecordId + "'"); - if (list_his != null && list_his.size() > 0) { - //删除该任务之前填写的 - mPointHistoryService.deleteByTableAWhere(patrolRecord.getUnitId(), "[tb_mp_" + jsonArray.getJSONObject(i).optString("mpointcode") + "]", "where userid = '" + patrolRecordId + "'"); - - mPointHistory.setMeasuredt(notime); - mPointHistory.setParmvalue(bigValue); - mPointHistory.setUserid(patrolRecordId); - mPointHistory.setTbName("[tb_mp_" + jsonArray.getJSONObject(i).optString("mpointcode") + "]"); - } else { - mPointHistory.setMeasuredt(notime); - mPointHistory.setParmvalue(bigValue); - mPointHistory.setUserid(patrolRecordId); - mPointHistory.setTbName("[tb_mp_" + jsonArray.getJSONObject(i).optString("mpointcode") + "]"); - } - mPointHistoryService.save(patrolRecord.getUnitId(), mPointHistory); - } else { - patrolMeasurePointRecord.setMpvalue(null); - patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Issue); - } - int res = patrolMeasurePointRecordService.update(patrolMeasurePointRecord); - count = count + res; - - - } - } - Result result = Result.success(count); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取 巡检点 或 设备 下填报内容 - * equipmentId为null则是巡检点 不为null则为设备 sj 2020-06-05 修改 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolMeasurePoint4APP.do") - public ModelAndView getPatrolMeasurePoint4APP(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - String unitId = request.getParameter("unitId"); - String equipmentId = request.getParameter("equipmentId"); -// String orderstr = " order by measure_point_id"; - String orderstr = " order by measure_point_id,LEFT([measure_point_id],PATINDEX('%[^0-9]%',[measure_point_id]))"; - String wherestr = ""; - String type = request.getParameter("type"); - if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(type)) { - //查看设备巡检下设备的填报内容 - wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id is null and equipment_id='" + equipmentId + "' "; - } else if (TimeEfficiencyCommStr.PatrolType_Product.equals(type)) { - if (equipmentId != null && !equipmentId.equals("")) { - //查看设备下填报内容 - wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id='" + equipmentId + "' "; - } else { - //查看巡检点下填报内容 - wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id is null "; - } - } else { - return new ModelAndView("result"); - } - List list = this.patrolMeasurePointRecordService.selectListByRecord(unitId, wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolModelController.java b/src/com/sipai/controller/timeefficiency/PatrolModelController.java deleted file mode 100644 index d2436087..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolModelController.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.info.Select2; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolModelService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/timeEfficiency/patrolModel") -public class PatrolModelController { - @Resource - private PatrolModelService patrolModelService; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - - @RequestMapping("/showPatrolModellist.do") - public String showPatrolModellist(HttpServletRequest request,Model model) { - return "/timeefficiency/patrolModelList"; - } - - @RequestMapping("/getPatrolModellist.do") - public ModelAndView getPatrolModellist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " unit_id "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - //水厂id - if(request.getParameter("bizId")!=null && !request.getParameter("bizId").isEmpty()){ - wherestr += " and biz_id = '"+request.getParameter("bizId")+"' "; - } - //上级unit 的id - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - //获取unitId下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String unitIds=""; - for(Unit unit : units){ - unitIds += "'"+unit.getId()+"',"; - } - if(unitIds!=""){ - unitIds = unitIds.substring(0, unitIds.length()-1); - wherestr += " and unit_id in ("+unitIds+") "; - } - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += " and type = '"+request.getParameter("type")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.patrolModelService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Company company =unitService.getCompById(companyId); - request.setAttribute("company", company); - return "timeefficiency/patrolModelAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String patrolPlanId = request.getParameter("id"); - PatrolModel patrolModel = this.patrolModelService.selectById(patrolPlanId); - model.addAttribute("patrolModel", patrolModel); - Company company =unitService.getCompById(patrolModel.getBizId()); - model.addAttribute("company", company); -// model.addAttribute("result",JSONObject.fromObject(patrolModel)); - return "timeefficiency/patrolModelEdit"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute PatrolModel patrolModel){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - patrolModel.setId(id); - patrolModel.setInsuser(cu.getId()); - patrolModel.setInsdt(CommUtil.nowDate()); - - if (patrolModel.getDefaultFlag()) { - List list = this.patrolModelService.selectListByWhere(" where unit_id ='"+patrolModel.getUnitId()+"' and type = '"+patrolModel.getType()+"'"); - for (PatrolModel patrolModel2 : list) { - patrolModel2.setDefaultFlag(false); - this.patrolModelService.update(patrolModel2); - } - } - - int result =this.patrolModelService.save(patrolModel); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute PatrolModel patrolModel){ - if (patrolModel.getDefaultFlag()) { - PatrolModel item = this.patrolModelService.selectById(patrolModel.getId()); - List list = this.patrolModelService.selectListByWhere(" where unit_id ='"+item.getUnitId()+"' and type = '"+item.getType()+"'"); - for (PatrolModel patrolModel2 : list) { - patrolModel2.setDefaultFlag(false); - this.patrolModelService.update(patrolModel2); - } - } - int result = this.patrolModelService.update(patrolModel); - String resstr="{\"res\":\""+result+"\",\"id\":\""+patrolModel.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - PatrolModel patrolModel = this.patrolModelService.selectById(id); - model.addAttribute("patrolModel", patrolModel); - return "timeefficiency/patrolModelView"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.patrolModelService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.patrolModelService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/getPatrolModel4Select.do") - public String getPatrolModel4Select(HttpServletRequest request,Model model){ - String companyId = request.getParameter("unitId"); - String type = request.getParameter("type"); - List patrolModels = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' and type='"+type+"' order by insdt"); - JSONArray json = new JSONArray(); - if(patrolModels!=null && patrolModels.size()>0){ - for(int i=0;i list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' and type='"+type+"' order by insdt"); - ArrayList list4select2 = new ArrayList(); - for (int i=0;i list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' and type='"+type+"' order by insdt"); - ArrayList list4select2 = new ArrayList(); - for (int i=0;i companies = null; - companies = this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_BIZ); - for (Company company : companies) { - //获取图片 - //获取图片 - List list = this.commonFileService.selectListByTableAWhere(UserCommStr.Biz_Img_DataBase, "where masterid='" + company.getId() + "' order by insdt"); - PatrolPlanCollection patrolPlanCollection = new PatrolPlanCollection(); - try { - patrolPlanCollection.setImgPath(list.get(0).getAbspath());//目前默认一张图片 - } catch (Exception e) { - - } - //获取各巡检分类数量 - String wherestr = " where biz_id = '" + company.getId() + "' and type = '" + PatrolType.Product.getId() + "' and Convert(varchar,start_time,120) like '" + CommUtil.nowDate().substring(0, 7) + "%'"; - List patrolRecords = this.patrolRecordService.selectListByWhere(wherestr); - if (patrolRecords != null && patrolRecords.size() != 0) { - int tempNum = 0;//临时 - int issuedNum = 0;//下发 - Double finishedNum = 0.0;//完成 - for (PatrolRecord patrolRecord : patrolRecords) { - if (patrolRecord.getStatus().equals(PatrolRecord.Status_Issue)) { - //未巡检数addTemp量 - issuedNum++; - } else if (patrolRecord.getStatus().equals(PatrolRecord.Status_Finish)) { - //完成数量 - finishedNum++; - } - if (patrolRecord.getPatrolModelId().equals(TimeEfficiencyCommStr.PatrolModel_TempTask)) { - //临时任务数量 - tempNum++; - } - } - patrolPlanCollection.setTotalPatrolRecordNum(patrolRecords.size()); - patrolPlanCollection.setCommPatrolRecordNum(patrolRecords.size() - tempNum); - patrolPlanCollection.setTempPatrolRecordNum(tempNum); - patrolPlanCollection.setIssuedPatrolRecordNum(issuedNum); - patrolPlanCollection.setFinishedPatrolRecordRate(finishedNum / patrolRecords.size()); - } - company.setPatrolPlanCollection(patrolPlanCollection); - } - JSONArray json = JSONArray.fromObject(companies); - - String result = "{\"total\":" + companies.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取所有巡检模式 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolTypesForSelect.do") - public String getPatrolTypesForSelect(HttpServletRequest request, Model model) { - //List list = this.schedulingService.selectListByWhere(""); - String json = PatrolType.getAllPatrolType4JSON(); - //System.out.println(json); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showCalendarPerBiz.do") - public String showCalendarPerBiz(HttpServletRequest request, Model model) { - request.setAttribute("companyId", request.getParameter("companyId"));//珠海专用 - return "/timeefficiency/patrolRecordCalendarPerBiz"; - } - - /** - * 巡检列表(生产巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - //巡检类型 - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Product); - request.setAttribute("unitId", request.getParameter("unitId")); - return "/timeefficiency/patrolPlanList"; - } - - /** - * 巡检列表(设备巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList_Equipment.do") - public String showList_Equipment(HttpServletRequest request, Model model) { - //巡检类型 - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Equipment); - return "/timeefficiency/patrolPlanList_Equipment"; - } - - /** - * 巡检列表(视频巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList_Camera.do") - public String showList_Camera(HttpServletRequest request, Model model) { - //巡检类型 - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Camera); - return "/timeefficiency/patrolPlanList_Camera"; - } - - /** - * 巡检列表(安全任务) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList_Safe.do") - public String showList_Safe(HttpServletRequest request, Model model) { - //巡检类型 - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Safe); - return "/timeefficiency/patrolPlanList_Safe"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " sdt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where type='" + request.getParameter("type") + "'"; - wherestr += " and unit_id='" + request.getParameter("unitId") + "'"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("patrolModelId") != null && !request.getParameter("patrolModelId").isEmpty()) { - wherestr += " and patrol_model_id='" + request.getParameter("patrolModelId") + "' "; - } - if (request.getParameter("groupTypeId") != null && !request.getParameter("groupTypeId").isEmpty()) { - wherestr += " and group_type_id='" + request.getParameter("groupTypeId") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.patrolPlanService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlist4Safe.do") - public ModelAndView getlist4Safe(HttpServletRequest request, Model model, HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " sdt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where type='" + request.getParameter("type") + "'"; - wherestr += " and unit_id='" + request.getParameter("unitId") + "'"; - /*if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - }*/ - if (request.getParameter("patrolModelId") != null && !request.getParameter("patrolModelId").isEmpty()) { - wherestr += " and patrol_model_id='" + request.getParameter("patrolModelId") + "' "; - } - if (request.getParameter("taskTypeName") != null && !request.getParameter("taskTypeName").isEmpty()) { - wherestr += " and task_type='" + request.getParameter("taskTypeName") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or patrol_content like '%" + request.getParameter("search_name") + "%')"; - } - - PageHelper.startPage(page, rows); - List list = this.patrolPlanService.selectListByWhere4Safe(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -// @RequestMapping("/exportTest.do") -// public void exportTest(HttpServletRequest request, Model model, HttpServletResponse response) { -// String orderstr = " order by insdt desc"; -// -// String wherestr = " where 1=1 and type='" + request.getParameter("type") + "'"; -// wherestr += " and unit_id='" + request.getParameter("unitId") + "'"; -// if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; -// } -// if (request.getParameter("patrolModelId") != null && !request.getParameter("patrolModelId").isEmpty()) { -// wherestr += " and patrol_model_id='" + request.getParameter("patrolModelId") + "' "; -// } -// -// PageHelper.startPage(1, 20); -// List list = this.patrolPlanService.selectListByWhere(wherestr + orderstr); -// JRDataSource jrDataSource = new JRBeanCollectionDataSource(list); -// Map map = new HashMap(); -// map.put("query", "cesfsef"); -// ServletContext context = request.getSession().getServletContext(); -// File reportFile = new File(context.getRealPath("/report/report1.jasper")); -// JasperHelper.export("pdf", "table测试", reportFile, request, response, map, jrDataSource); -// } -// -// @RequestMapping("/showReportTest.do") -// public void showReportTest(HttpServletRequest request, Model model, HttpServletResponse response) { -// String orderstr = " order by insdt desc"; -// -// String wherestr = " where 1=1 and type='" + request.getParameter("type") + "'"; -// wherestr += " and unit_id='" + request.getParameter("unitId") + "'"; -// if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; -// } -// if (request.getParameter("patrolModelId") != null && !request.getParameter("patrolModelId").isEmpty()) { -// wherestr += " and patrol_model_id='" + request.getParameter("patrolModelId") + "' "; -// } -// -// PageHelper.startPage(1, 20); -// List list = this.patrolPlanService.selectListByWhere(wherestr + orderstr); -// JRDataSource jrDataSource = new JRBeanCollectionDataSource(list); -// Map map = new HashMap(); -// map.put("query", "cesfsef"); -// ServletContext context = request.getSession().getServletContext(); -// File reportFile = new File(context.getRealPath("/report/report1.jasper")); -// try { -// //JasperHelper.showHtml("pdf",reportFile.getPath(),request,response,map,jrDataSource); -// JasperHelper.showPdf("pdf", reportFile.getPath(), request, response, map, jrDataSource); -// } catch (JRException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// } - - @RequestMapping("/showPatrolListReport.do") - public String showPatrolListReport(HttpServletRequest request, Model model) { - return "/timeefficiency/patrolListReport"; - } - - @RequestMapping("/getPatrolPoints.do") - public ModelAndView getPatrolPoints(HttpServletRequest request, Model model, @RequestParam(value = "page") Integer page, @RequestParam(value = "rows") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("patrolPlanId") != null && !request.getParameter("patrolPlanId").isEmpty()) { - wherestr += " and plan_id = '" + request.getParameter("patrolPlanId") + "' "; - } - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - - PageHelper.startPage(page, rows); - List list = this.patrolPlanPatrolPointService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - // System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/updatePatrolPoints.do") - public String updatePatrolPoints(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId"); - String patrolPointIds = request.getParameter("patrolPointIds"); - this.patrolPlanPatrolPointService.deleteByWhere("where plan_id ='" + patrolPlanId + "'"); - int result = 0; - String[] idArrary = patrolPointIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - PatrolPlanPatrolPoint patrolPlanPatrolPoint = new PatrolPlanPatrolPoint(); - patrolPlanPatrolPoint.setId(CommUtil.getUUID()); - patrolPlanPatrolPoint.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolPoint.setInsuser(cu.getId()); - patrolPlanPatrolPoint.setPlanId(patrolPlanId); - patrolPlanPatrolPoint.setPatrolPointId(str); - result += this.patrolPlanPatrolPointService.save(patrolPlanPatrolPoint); - } - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 新增任务(生产巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/add_produce.do") - public String add_produce(HttpServletRequest request, Model model) { - //预先设置巡检计划Id,用于新增时候关联巡检点 - String patrolPlanId = CommUtil.getUUID(); - request.setAttribute("patrolPlanId", patrolPlanId); - return "timeefficiency/patrolPlanAdd"; - } - - /** - * 新增任务(设备巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/add_Equipment.do") - public String add_Equipment(HttpServletRequest request, Model model) { - //预先设置巡检计划Id,用于新增时候关联巡检点 - String patrolPlanId = CommUtil.getUUID(); - //patrolPlanId="3513sf135"; - request.setAttribute("patrolPlanId", patrolPlanId); - return "timeefficiency/patrolPlanAdd_Equipment"; - } - - /** - * 视频巡检新增任务 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/add_Camera.do") - public String add_Camera(HttpServletRequest request, Model model) { - //预先设置巡检计划Id,用于新增时候关联巡检点 - String patrolPlanId = CommUtil.getUUID(); - //patrolPlanId="3513sf135"; - request.setAttribute("patrolPlanId", patrolPlanId); - return "timeefficiency/patrolPlanAdd_Camera"; - } - - /** - * 新增任务(安全任务) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/add_Safe.do") - public String add_Safe(HttpServletRequest request, Model model) { - //预先设置巡检计划Id,用于新增时候关联巡检点 - String patrolPlanId = CommUtil.getUUID(); - request.setAttribute("patrolPlanId", patrolPlanId); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "timeefficiency/patrolPlanAdd_Safe"; - } - - /** - * 新增任务(临时任务) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/addTemp.do") - public String addTemp(HttpServletRequest request, Model model) { - //预先设置巡检计划Id,用于新增时候关联巡检点 - String patrolPlanId = CommUtil.getUUID(); - request.setAttribute("patrolPlanId", patrolPlanId); - return "timeefficiency/patrolPlanAddTemp"; - } - - /** - * 编辑任务(生产巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/edit_produce.do") - public String edit_produce(HttpServletRequest request, Model model) { - System.out.println("in===" + CommUtil.nowDate()); - String patrolPlanId = request.getParameter("id"); - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - model.addAttribute("patrolPlan", patrolPlan); - - /* - * 下面一段白龙港框架未使用 用于常排这套使用 获取关联的班组 - */ - JSONArray json = new JSONArray(); - String whereStr = "where patrol_plan_id = '" + patrolPlanId + "'"; - List list = this.patrolPlanDeptService.selectListByWhere(whereStr); - for (PatrolPlanDept patrolPlanDept : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPlanDept.getDeptId()); - jsonObject.put("text", ""); - json.add(jsonObject); - } - model.addAttribute("patrolPlanDept", json); - /* - * - */ - - /* - * 下面一段白龙港框架未使用 用于常排这套使用 获取关联的区域 - */ - JSONArray json_area = new JSONArray(); - String ids = patrolPlan.getPatrolAreaId(); - if (ids != null && !ids.trim().equals("")) { - String[] id = ids.split(","); - for (String s : id) { - PatrolArea patrolArea = patrolAreaService.selectById(s); - if (patrolArea != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolArea.getId()); - jsonObject.put("text", ""); - json_area.add(jsonObject); - } - } - model.addAttribute("patrolPlanArea", json_area); - } - /* - * - */ - - return "timeefficiency/patrolPlanEdit"; - } - - /** - * 编辑任务(设备巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/edit_Equipment.do") - public String doedit_Equipment(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - model.addAttribute("patrolPlan", JSONObject.fromObject(patrolPlan)); - - /* - * 下面一段白龙港框架未使用 用于常排这套使用 - */ - JSONArray json = new JSONArray(); - String whereStr = "where patrol_plan_id = '" + patrolPlanId + "'"; - List list = this.patrolPlanDeptService.selectListByWhere(whereStr); - for (PatrolPlanDept patrolPlanDept : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPlanDept.getDeptId()); - jsonObject.put("text", ""); - json.add(jsonObject); - } - model.addAttribute("patrolPlanDept", json); - /* - * - */ - - /* - * 下面一段白龙港框架未使用 用于常排这套使用 获取关联的区域 - */ - JSONArray json_area = new JSONArray(); - String ids = patrolPlan.getPatrolAreaId(); - if (ids != null && !ids.trim().equals("")) { - String[] id = ids.split(","); - for (String s : id) { - PatrolArea patrolArea = patrolAreaService.selectById(s); - if (patrolArea != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolArea.getId()); - jsonObject.put("text", ""); - json_area.add(jsonObject); - } - } - model.addAttribute("patrolPlanArea", json_area); - } - /* - * - */ - - return "timeefficiency/patrolPlanEdit_Equipment"; - } - - /** - * 编辑任务(安全内容) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/edit_Safe.do") - public String edit_Safe(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - model.addAttribute("patrolPlan", JSONObject.fromObject(patrolPlan)); - - /* - * 下面一段白龙港框架未使用 用于常排这套使用 - */ - JSONArray json = new JSONArray(); - String whereStr = "where patrol_plan_id = '" + patrolPlanId + "'"; - List list = this.patrolPlanDeptService.selectListByWhere(whereStr); - for (PatrolPlanDept patrolPlanDept : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPlanDept.getDeptId()); - jsonObject.put("text", ""); - json.add(jsonObject); - } - model.addAttribute("patrolPlanDept", json); - /* - * - */ - - //月 - if (patrolPlan.getMonthRegister() != null && !patrolPlan.getMonthRegister().equals("")) { - JSONArray json2 = new JSONArray(); - String[] yearStr = patrolPlan.getMonthRegister().split(","); - for (String str : yearStr) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", str); - jsonObject.put("text", str); - json2.add(jsonObject); - } - model.addAttribute("monthRegister", json2); - } - //年 - if (patrolPlan.getYearRegister() != null && !patrolPlan.getYearRegister().equals("")) { - JSONArray json2 = new JSONArray(); - String[] yearStr = patrolPlan.getYearRegister().split(","); - for (String str : yearStr) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", str); - jsonObject.put("text", str); - json2.add(jsonObject); - } - model.addAttribute("yearRegister", json2); - } - - return "timeefficiency/patrolPlanEdit_Safe"; - } - - /** - * 获取设备巡检计划的设备台账 - * - * @param request - * @return - */ - @RequestMapping("/getEquipmentCards.do") - public ModelAndView getEquipmentCards(HttpServletRequest request, Model model) { - - String wherestr = " where patrol_plan_id = '" + request.getParameter("patrolPlanId") + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"; - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - String orderstr = " order by morder"; - List list = this.patrolPlanPatrolEquipmentService.selectListByWhere(wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); -// System.out.println(json); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取设备巡检计划的设备台账 - * - * @param request - * @return - */ - @RequestMapping("/getEquipmentCards4Safe.do") - public ModelAndView getEquipmentCards4Safe(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String patrolPlanId = request.getParameter("patrolPlanId"); - String patrolPointId = request.getParameter("patrolPointId"); -// String wherestr = " where patrol_plan_id = '" + patrolPlanId + "' and patrol_point_id = '" + patrolPointId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"; - String wherestr = " where patrol_plan_id = '" + patrolPlanId + "' and patrol_point_id = '" + patrolPointId + "' "; - String orderstr = " order by morder"; - PageHelper.startPage(page, rows); - List list = this.patrolPlanPatrolEquipmentService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备巡检计划的设备台账 - * - * @param request - * @return - */ - @RequestMapping("/getCameras.do") - public ModelAndView getCameras(HttpServletRequest request, Model model) { - - String wherestr = " where patrol_plan_id = '" + request.getParameter("patrolPlanId") + "'"; - - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - String orderstr = " order by morder"; - List list = this.patrolPlanPatrolCameraService.selectListByWhereCamera(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 新增设备 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveEquipmentCards.do") - public String saveEquipmentCards(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId"); - String patrolEquipmentIds = request.getParameter("patrolEquipmentIds"); - int res = 0; - if (cu != null) { - //删除对应的设备 - this.patrolPlanPatrolEquipmentService.deleteByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); - //删除对应的控制箱 - this.patrolRouteService.deleteByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); - //巡检计划下关联设备(后台会根据设备自动保存对应的控制箱) - res = patrolPlanService.saveEquipmentCards(patrolEquipmentIds, cu.getId(), patrolPlanId); - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deleteEquipmentCards.do") - public String deleteEquipmentCards(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId"); - String deleteEquipmentIds = request.getParameter("deleteEquipmentIds");//需要删除的设备附表ids - int res = 0; - if (cu != null) { - String[] ids = deleteEquipmentIds.split(","); - for (int i = 0; i < ids.length; i++) { - //删除对应的设备 - res += this.patrolPlanPatrolEquipmentService.deleteById(ids[i]); - } - - String patrolEquipmentIds = ""; - List list_e = this.patrolPlanPatrolEquipmentService.selectListByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); - for (PatrolPlanPatrolEquipment pe : list_e) { - patrolEquipmentIds += pe.getEquipmentId() + ","; - } - -// 删除对应的设备 - this.patrolPlanPatrolEquipmentService.deleteByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); -// 删除对应的控制箱 - this.patrolRouteService.deleteByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); -// 巡检计划下关联设备(后台会根据设备自动保存对应的控制箱) - this.patrolPlanService.saveEquipmentCards(patrolEquipmentIds, cu.getId(), patrolPlanId); - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 新增摄像头 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveCameras.do") - public String saveCameras(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId"); - String patrolCameraIds = request.getParameter("patrolCameraIds"); - this.patrolPlanPatrolCameraService.deleteByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); - this.patrolRouteService.deleteByWhere("where patrol_plan_id ='" + patrolPlanId + "'"); - int res = 0; - String[] idArray = patrolCameraIds.split(","); - HashSet hashSet = new HashSet<>(); - for (int i = 0; i < idArray.length; i++) { - if (idArray[i] != null && !idArray[i].isEmpty() && !idArray[i].equals("undefined") && !idArray[i].equals("weiguanlianxunjiandian")) { - hashSet.add(idArray[i]); - } - } - Iterator iterator = hashSet.iterator(); - int morder = 1; - while (iterator.hasNext()) { - String string = (String) iterator.next(); - Camera camera = cameraService.selectById(string); - if (camera != null) { - PatrolPlanPatrolCamera patrolPlanPatrolCamera = new PatrolPlanPatrolCamera(); - patrolPlanPatrolCamera.setId(CommUtil.getUUID()); - patrolPlanPatrolCamera.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolCamera.setInsuser(cu.getId()); - patrolPlanPatrolCamera.setPatrolPlanId(patrolPlanId); - patrolPlanPatrolCamera.setCameraid(string); - patrolPlanPatrolCamera.setMorder(morder); - morder++; - patrolPlanPatrolCamera.setType(TimeEfficiencyCommStr.PatrolEquipment_Camera); - List patrolPointCameras = this.patrolPointCameraService.selectListByWhere("where camera_Id = '" + string + "'"); - if (patrolPointCameras != null && patrolPointCameras.size() > 0) { - for (PatrolPointCamera patrolPointCamera : patrolPointCameras) { - PatrolPoint patrolPoint = this.patrolPointService.selectById(patrolPointCamera.getPatrolPointId()); - if (TimeEfficiencyCommStr.PatrolType_Camera.equals(patrolPoint.getType())) { - patrolPointCamera.setPatrolPointId(patrolPointCameras.get(0).getPatrolPointId()); - - List patrolRoutes = this.patrolRouteService.selectListByWhere("where patrol_plan_id = '" + patrolPlanId + "' and patrol_point_id = '" + patrolPoint.getId() + "'"); - if (!(patrolRoutes != null && patrolRoutes.size() > 0)) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setId(CommUtil.getUUID()); - patrolRoute.setInsdt(CommUtil.nowDate()); - patrolRoute.setInsuser(cu.getId()); - patrolRoute.setPatrolPlanId(patrolPlanId);//巡检计划id - patrolRoute.setType("0"); - patrolRoute.setMorder(morder); - morder++; - patrolRoute.setPatrolPointId(patrolPoint.getId()); - BigDecimal bigDecimal_x = new BigDecimal(0); - BigDecimal bigDecimal_y = new BigDecimal(0); - BigDecimal bigDecimal_width = new BigDecimal(0); - BigDecimal bigDecimal_height = new BigDecimal(0); - patrolRoute.setPosx(bigDecimal_x); - patrolRoute.setPosy(bigDecimal_y); - patrolRoute.setContainerWidth(bigDecimal_width); - patrolRoute.setContainerHeight(bigDecimal_height); - res += this.patrolRouteService.save(patrolRoute); - } - } - } - } - res += this.patrolPlanPatrolCameraService.save(patrolPlanPatrolCamera); - } - } - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 更新设备顺序 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateEquipmentCardsMorder.do") - public String updateEquipmentCardsMorder(HttpServletRequest request, Model model) { -// String patrolPlanId= request.getParameter("patrolPlanId"); - String ids = request.getParameter("ids"); - int res = 0; - String[] idArray = ids.split(","); - for (int i = 0; i < idArray.length; i++) { - if (idArray[i] != null && !idArray[i].isEmpty()) { - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setId(idArray[i]); - patrolPlanPatrolEquipment.setMorder(i); - res += this.patrolPlanPatrolEquipmentService.update(patrolPlanPatrolEquipment); - } - } - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/updateEquipmentCards4PatrollPlanSafe.do") - public String updateEquipmentCards4PatrollPlanSafe(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId"); - String patrolPointId = request.getParameter("patrolPointId"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); -// System.out.println("where patrol_point_id ='" + patrolPointId + "' and patrol_plan_id = '" + patrolPlanId + "'"); - this.patrolPlanPatrolEquipmentService.deleteByWhere("where patrol_point_id ='" + patrolPointId + "' and patrol_plan_id = '" + patrolPlanId + "'"); - int result = 0; - String[] idArrary = equipmentCardIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - PatrolPlanPatrolEquipment entity = new PatrolPlanPatrolEquipment(); - entity.setId(CommUtil.getUUID()); - entity.setInsdt(CommUtil.nowDate()); - entity.setInsuser(cu.getId()); - entity.setPatrolPointId(patrolPointId); - entity.setPatrolPlanId(patrolPlanId); - entity.setEquipmentId(str); - result += this.patrolPlanPatrolEquipmentService.save(entity); - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 设备巡检编辑任务 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/edit_Camera.do") - public String edit_Camera(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - model.addAttribute("patrolPlan", JSONObject.fromObject(patrolPlan)); - - /* - * 下面一段白龙港框架未使用 用于常排这套使用 - */ - JSONArray json = new JSONArray(); - String whereStr = "where patrol_plan_id = '" + patrolPlanId + "'"; - List list = this.patrolPlanDeptService.selectListByWhere(whereStr); - for (PatrolPlanDept patrolPlanDept : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPlanDept.getDeptId()); - jsonObject.put("text", ""); - json.add(jsonObject); - } - model.addAttribute("patrolPlanDept", json); - /* - * - */ - - return "timeefficiency/patrolPlanEdit_Camera"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, @ModelAttribute PatrolPlan patrolPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - if (patrolPlan.getId() == null || patrolPlan.getId().equals("")) { - patrolPlan.setId(CommUtil.getUUID()); - } - patrolPlan.setInsuser(cu.getId()); - patrolPlan.setInsdt(CommUtil.nowDate()); - String deptIds = request.getParameter("deptIds"); - if (deptIds != null && !deptIds.isEmpty()) { - List depts = new ArrayList<>(); - String[] ids = deptIds.split(","); - for (int i = 0; i < ids.length; i++) { - Dept dept = new Dept(); - dept.setId(ids[i]); - depts.add(dept); - } - patrolPlan.setDepts(depts); - } - if (patrolPlan.getColor() == null || patrolPlan.getColor().equals("")) { - patrolPlan.setColor("#357ca5");//不选颜色默认蓝色 - } - //是否去除节假日 - if (patrolPlan.getIsHoliday() != null && patrolPlan.getIsHoliday().equals("1")) { - patrolPlan.setIsHoliday("1"); - } else { - patrolPlan.setIsHoliday("0"); - } - int result = this.patrolPlanService.save(patrolPlan); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 存储临时计划并发布 - * - * @param request - * @param model - * @param patrolPlan - * @return - */ - @RequestMapping("/saveIssue.do") - public String dosaveIssue(HttpServletRequest request, Model model, @ModelAttribute PatrolPlan patrolPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - patrolPlan.setInsuser(cu.getId()); - patrolPlan.setInsdt(CommUtil.nowDate()); - patrolPlan.setActive(true); - patrolPlan.setType(com.sipai.entity.enums.PatrolType.Product.getId()); - patrolPlan.setUnitId("FS_SK11_C"); - - int result = 0; - result = this.patrolPlanService.save(patrolPlan); - if (result == 1) { - result = this.patrolRecordService.createPatrolRecord(CommUtil.nowDate(), patrolPlan.getId(), cu.getId()); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, @ModelAttribute PatrolPlan patrolPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - String deptIds = request.getParameter("deptIds"); - if (deptIds != null && !deptIds.isEmpty()) { - List depts = new ArrayList<>(); - String[] ids = deptIds.split(","); - for (int i = 0; i < ids.length; i++) { - Dept dept = new Dept(); - dept.setId(ids[i]); - dept.setInsdt(new Date()); - dept.setInsuser(cu.getId()); - depts.add(dept); - } - patrolPlan.setDepts(depts); - } - - //是否去除节假日 - if (patrolPlan.getIsHoliday() != null && patrolPlan.getIsHoliday().equals("1")) { - patrolPlan.setIsHoliday("1"); - } else { - patrolPlan.setIsHoliday("0"); - } - -// System.out.println("AdvanceDay======" + patrolPlan.getAdvanceDay()); - int result = this.patrolPlanService.update(patrolPlan); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - int result = this.patrolPlanService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolPlanService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/editRoute.do") - public String editRoute(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("id"); - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - model.addAttribute("patrolPlan", patrolPlan); - return "timeefficiency/patrolPlanRouteEdit"; - } - - /** - * 获取巡检路径上的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRoutePoints.do") - public ModelAndView getRoutePoints(HttpServletRequest request, Model model) { - //String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - if (request.getParameter("patrolPlanId") != null && !request.getParameter("patrolPlanId").isEmpty()) { - wherestr += " and patrol_plan_id = '" + request.getParameter("patrolPlanId") + "' "; - } - if (request.getParameter("floorId") != null && !request.getParameter("floorId").isEmpty()) { - wherestr += " and floor_id = '" + request.getParameter("floorId") + "' "; - } - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - - List list = this.patrolRouteService.selectListByWhere(wherestr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - // System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存巡检路线中的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveRoutePoint.do") - public String saveRoutePoint(HttpServletRequest request, Model model, @ModelAttribute PatrolRoute patrolRoute) { - User cu = (User) request.getSession().getAttribute("cu"); - /*String patrolRouteJson =request.getParameter("patrolRoute"); - JSONObject jsonObject=JSONObject.fromObject(patrolRouteJson); - PatrolRoute patrolRoute = (PatrolRoute)JSONObject.toBean(jsonObject, PatrolRoute.class);*/ - - //patrolRoute.setId(CommUtil.getUUID()); - patrolRoute.setInsdt(CommUtil.nowDate()); - patrolRoute.setInsuser(cu.getId()); - int result = this.patrolRouteService.save(patrolRoute); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolRoute.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除巡检路线中的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteRoutePoint.do") - public String deleteRoutePoint(HttpServletRequest request, Model model, @RequestParam(value = "id") String id, @RequestParam(value = "previousId") String previousId, @RequestParam(value = "nextId") String nextId) { - int result = this.patrolRouteService.deletePoint(id, previousId, nextId); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return "result"; - } - - - /** - * 更新巡检路线中的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRoutePoint.do") - public String updateRoutePoint(HttpServletRequest request, Model model, @ModelAttribute PatrolRoute patrolRoute) { - int result = this.patrolRouteService.update(patrolRoute); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 下发巡检任务 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/issueTask.do") - public String issueTask(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String ids = request.getParameter("ids"); - String[] idArray = ids.split(","); - int result = 0; - for (String item : idArray) { - try { - PatrolPlan patrolPlan = this.patrolPlanService.selectById(item); - if (patrolPlan != null && TimeEfficiencyCommStr.PatrolType_Product.equals(patrolPlan.getType())) { - result += this.patrolRecordService.createPatrolRecord(CommUtil.nowDate(), item, cu.getId()); - } else if (patrolPlan != null && TimeEfficiencyCommStr.PatrolType_Equipment.equals(patrolPlan.getType())) { - result += this.patrolRecordService.createPatrolRecord_Equipment(CommUtil.nowDate(), item, cu.getId()); - } else if (patrolPlan != null && TimeEfficiencyCommStr.PatrolType_Camera.equals(patrolPlan.getType())) { - result += this.patrolRecordService.createPatrolRecord_Camera(CommUtil.nowDate(), item, cu.getId()); - } else if (patrolPlan != null && TimeEfficiencyCommStr.PatrolType_GuangWang.equals(patrolPlan.getType())) { - result += this.patrolRecordService.createPatrolRecord(CommUtil.nowDate(), item, cu.getId()); - } else if (patrolPlan != null && TimeEfficiencyCommStr.PatrolType_Safe.equals(patrolPlan.getType())) { - result += this.patrolRecordService.createPatrolRecord_Safe(CommUtil.nowDate(), CommUtil.nowDate(), item, cu.getId()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 保存巡检内容及填报内容 --- 巡检计划 sj 2020-05-24 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveByPatrolPlan.do") - public String saveByPatrolPlan(HttpServletRequest request, Model model) { - String patrolPlanId = request.getParameter("patrolPlanId");//巡检计划Id - String patrolPointId = request.getParameter("patrolPointId");//巡检点Id - String jsonStr = request.getParameter("jsonStr");//保存的Id json - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - - //jsonStr 格式 - //{"content_point":"1,2","content_equ":"1b693085ef264c599deada2a1914315e","mp_point":"0512ZJG_xgsnp_mk","mp_equ":"022TJLG_B401B_ckwd"} - - org.json.JSONObject json = new org.json.JSONObject(jsonStr); - String content_point = json.getString("content_point"); - String content_equ = json.getString("content_equ"); - String mp_point = json.getString("mp_point"); - String mp_equ = json.getString("mp_equ"); - - //删除该巡检点下的巡检内容 - patrolContentsPlanService.deleteByWhere(" where patrol_point_id = '" + patrolPointId + "' and patrol_plan_id='" + patrolPlanId + "'"); - //删除该巡检点下的填报内容 - patrolMeasurePointPlanService.deleteByWhere(" where patrol_point_id = '" + patrolPointId + "' and patrol_plan_id='" + patrolPlanId + "'"); - //删除设备中间表 - patrolPlanPatrolEquipmentService.deleteByWhere(" where patrol_point_id = '" + patrolPointId + "' and patrol_plan_id='" + patrolPlanId + "' "); - - //保存巡检内容 - int res = this.patrolContentsPlanService.saveByPlan(content_point, patrolPlanId, patrolPointId, cu.getId(), "point"); - //保存巡检内容 - res = this.patrolContentsPlanService.saveByPlan(content_equ, patrolPlanId, patrolPointId, cu.getId(), "equ"); - //保存填报内容 - res = patrolMeasurePointPlanService.saveByPlan(mp_point, patrolPlanId, patrolPointId, cu.getId(), unitId, "point"); - //保存填报内容 - res = patrolMeasurePointPlanService.saveByPlan(mp_equ, patrolPlanId, patrolPointId, cu.getId(), unitId, "equ"); - - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 用于配置巡检内容及填报内容弹窗(运行巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/configure.do") - public String configure(HttpServletRequest request, Model model) { - return "timeefficiency/patrolPlanConfigure"; - } - - /** - * 用于关联设备弹窗(安全任务) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/configureEquipment4Safe.do") - public String configureEquipment4Safe(HttpServletRequest request, Model model) { - return "timeefficiency/patrolPlanConfigure4EquipmentSafe"; - } - - /** - * 用于配置巡检内容及填报内容弹窗(设备巡检) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/configure4Equipment.do") - public String configure4Equipment(HttpServletRequest request, Model model) { - return "timeefficiency/patrolPlanConfigure4Equipment"; - } - - @RequestMapping("/getUncheckedList.do") - public String showlist(HttpServletRequest request, Model model, HttpServletResponse response) { - String lastTime = CommUtil.subplus(CommUtil.nowDate(), "-1", "month"); - request.setAttribute("showdataMonth", lastTime.substring(0, 7)); - request.setAttribute("showdataYear", lastTime.substring(0, 4)); - int nowMonth = Integer.valueOf(lastTime.substring(5, 7)); - if (nowMonth < 4) { - request.setAttribute("showdataAquarteNum", "aquarter1"); - } else if (nowMonth >= 4 && nowMonth < 7) { - request.setAttribute("showdataAquarteNum", "aquarter2"); - } else if (nowMonth >= 7 && nowMonth < 10) { - request.setAttribute("showdataAquarteNum", "aquarter3"); - } else if (nowMonth >= 10 && nowMonth <= 12) { - request.setAttribute("showdataAquarteNum", "aquarter4"); - } - return "/timeefficiency/jobPerformancelist"; - } - - @RequestMapping("/doecharts1.do") - public String doecharts1(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - JSONObject json = new JSONObject(); - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - String showdata = request.getParameter("showdata") + "-01"; - - List pvalueList1 = new ArrayList<>(); - List pvalueList2 = new ArrayList<>(); - List pvalueList3 = new ArrayList<>(); - - java.text.DecimalFormat df = new java.text.DecimalFormat("#.0"); - - WorkorderAchievementOrder workorderAchievementOrder = this.workorderAchievementOrderService.selectById(id); - -// for (int i = 0; i < maxDateM; i++) { - String wString = ""; - if (workorderAchievementOrder.getTbType().equals("patrolRecord_P")) { - wString = "where datediff(month,start_time,'" + showdata + "')=0 and unit_id='" + bizid + "' and type='P' "; - List list = this.patrolRecordService.selectForAchievementWork(wString + " and status = '3'"); - List list2 = this.patrolRecordService.selectForAchievementWork(wString + " and status != '3'"); - - for (PatrolRecord patrolRecord : - list) { - int gs = 0; - String wcNum = "0"; - - gs = patrolRecord.getDuration(); - wcNum = patrolRecord.get_num(); - - pvalueList1.add(wcNum); - pvalueList3.add(df.format(gs / 60)); - - } - - for (PatrolRecord patrolRecord : - list2) { - int gs = 0; - String wwcNum = "0"; - - wwcNum = patrolRecord.get_num(); - - pvalueList2.add(wwcNum); - - } - - - } else if (workorderAchievementOrder.getTbType().equals("patrolRecord_E")) { - wString = "where datediff(month,start_time,'" + showdata + "')=0 and unit_id='" + bizid + "' and type='E' "; - List list = this.patrolRecordService.selectListByWhere(wString + " and status = '3'"); - List list2 = this.patrolRecordService.selectListByWhere(wString + " and status != '3'"); - - int gs = 0; - String wcNum = "0"; - String wwcNum = "0"; - if (list != null) { - gs = list.get(0).getDuration(); - wcNum = list.get(0).get_num(); - } - if (list2 != null) { - wwcNum = list2.get(0).get_num(); - } - - pvalueList1.add(wcNum); - pvalueList2.add(wwcNum); - pvalueList3.add(df.format(gs / 60)); - } else if (workorderAchievementOrder.getTbType().equals("workorderRepair")) { - wString = "where datediff(month,wd.complete_date,'" + showdata + "')=0 and wd.unit_id='" + bizid + "' and wd.type='" + WorkorderDetail.REPAIR + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and wd.status = '" + WorkorderDetail.Status_Finish + "' "); - List list2 = this.workorderDetailService.selectListByWhere(wString + " and wd.status != '" + WorkorderDetail.Status_Finish + "' "); - - int gs = 0; - int wcNum = 0; - int wwcNum = 0; - if (list != null) { - //gs = list.get(0).getWorkTime(); - //wcNum = list.get(0).get_num(); - } - if (list2 != null) { - //wwcNum = list2.get(0).get_num(); - } - - pvalueList1.add(String.valueOf(wcNum)); - pvalueList2.add(String.valueOf(wwcNum)); - pvalueList3.add(df.format(gs)); - } else if (workorderAchievementOrder.getTbType().equals("workorderMaintain")) { - wString = "where datediff(month,wd.complete_date,'" + showdata + "')=0 and wd.unit_id='" + bizid + "' and wd.type='" + WorkorderDetail.MAINTAIN + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and wd.status = '" + WorkorderDetail.Status_Finish + "' "); - List list2 = this.workorderDetailService.selectListByWhere(wString + " and wd.status != '" + WorkorderDetail.Status_Finish + "' "); - - int gs = 0; - int wcNum = 0; - int wwcNum = 0; - if (list != null) { - //gs = list.get(0).getWorkTime(); - //wcNum = list.get(0).get_num(); - } - if (list2 != null) { - //wwcNum = list2.get(0).get_num(); - } - - pvalueList1.add(String.valueOf(wcNum)); - pvalueList2.add(String.valueOf(wwcNum)); - pvalueList3.add(df.format(gs)); - } else if (workorderAchievementOrder.getTbType().equals("repairAndMaintain")) { - wString = "where datediff(month,wd.complete_date,'" + showdata + "')=0 and wd.unit_id='" + bizid + "' and (wd.type='" + WorkorderDetail.REPAIR + "' or wd.type='" + WorkorderDetail.MAINTAIN + "') "; - List list = this.workorderDetailService.selectListByWhere(wString + " and wd.status = '" + WorkorderDetail.Status_Finish + "' "); - List list2 = this.workorderDetailService.selectListByWhere(wString + " and wd.status != '" + WorkorderDetail.Status_Finish + "' "); - - int gs = 0; - int wcNum = 0; - int wwcNum = 0; - if (list != null) { - //gs = list.get(0).getWorkTime(); - //wcNum = list.get(0).get_num(); - } - if (list2 != null) { - //wwcNum = list2.get(0).get_num(); - } - - pvalueList1.add(String.valueOf(wcNum)); - pvalueList2.add(String.valueOf(wwcNum)); - pvalueList3.add(df.format(gs)); - } -// } - Map> vmap = new LinkedHashMap<>(); - vmap.put("已完成", pvalueList1); - vmap.put("未完成", pvalueList2); - vmap.put("消耗工时", pvalueList3); - json = json.fromObject(vmap); - System.out.println(json); - request.setAttribute("result", json); - return "result"; - } - - @RequestMapping("/doecharts2.do") - public String doecharts2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - JSONObject json = new JSONObject(); - String bizid = request.getParameter("bizid"); - String id = request.getParameter("id"); - String showdata = request.getParameter("showdata"); - - WorkorderAchievementOrder workorderAchievementOrder = this.workorderAchievementOrderService.selectById(id); - - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - List pvalueList1 = new ArrayList<>(); - List pvalueList2 = new ArrayList<>(); - List pvalueList3 = new ArrayList<>(); - - - if (workorderAchievementOrder.getTbType().equals("patrolRecord_P")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='P' "; - List list = this.patrolRecordService.selectListByWhere(wString + " and status = '3'"); - pvalueList1.add(String.valueOf(list.size())); - List list2 = this.patrolRecordService.selectListByWhere(wString + " and status != '3'"); - pvalueList2.add(String.valueOf(list2.size())); - if (list.size() + list2.size() > 0) { - double wcs = list.size(); - double wwcs = list.size() + list2.size(); - double wcl = wcs / wwcs * 100; - java.text.DecimalFormat df = new java.text.DecimalFormat("#.00"); - pvalueList3.add(df.format(wcl)); - } else { - pvalueList3.add("0"); - } - } else if (workorderAchievementOrder.getTbType().equals("patrolRecord_E")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='E' "; - List list = this.patrolRecordService.selectListByWhere(wString + " and status = '3'"); - pvalueList1.add(String.valueOf(list.size())); - List list2 = this.patrolRecordService.selectListByWhere(wString + " and status != '3'"); - pvalueList2.add(String.valueOf(list2.size())); - if (list.size() + list2.size() > 0) { - double wcs = list.size(); - double wwcs = list.size() + list2.size(); - double wcl = wcs / wwcs * 100; - java.text.DecimalFormat df = new java.text.DecimalFormat("#.00"); - pvalueList3.add(df.format(wcl)); - } else { - pvalueList3.add("0"); - } - } else if (workorderAchievementOrder.getTbType().equals("workorderRepair")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.REPAIR + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - pvalueList1.add(String.valueOf(list.size())); - List list2 = this.workorderDetailService.selectListByWhere(wString + " and status != '" + WorkorderDetail.Status_Finish + "' "); - pvalueList2.add(String.valueOf(list2.size())); - if (list.size() + list2.size() > 0) { - double wcs = list.size(); - double wwcs = list.size() + list2.size(); - double wcl = wcs / wwcs * 100; - java.text.DecimalFormat df = new java.text.DecimalFormat("#.00"); - pvalueList3.add(df.format(wcl)); - } else { - pvalueList3.add("0"); - } - } else if (workorderAchievementOrder.getTbType().equals("workorderMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.MAINTAIN + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - pvalueList1.add(String.valueOf(list.size())); - List list2 = this.workorderDetailService.selectListByWhere(wString + " and status != '" + WorkorderDetail.Status_Finish + "' "); - pvalueList2.add(String.valueOf(list2.size())); - if (list.size() + list2.size() > 0) { - double wcs = list.size(); - double wwcs = list.size() + list2.size(); - double wcl = wcs / wwcs * 100; - java.text.DecimalFormat df = new java.text.DecimalFormat("#.00"); - pvalueList3.add(df.format(wcl)); - } else { - pvalueList3.add("0"); - } - } else if (workorderAchievementOrder.getTbType().equals("repairAndMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and (type='" + WorkorderDetail.REPAIR + "' or type='" + WorkorderDetail.MAINTAIN + "') "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - pvalueList1.add(String.valueOf(list.size())); - List list2 = this.workorderDetailService.selectListByWhere(wString + " and status != '" + WorkorderDetail.Status_Finish + "' "); - pvalueList2.add(String.valueOf(list2.size())); - if (list.size() + list2.size() > 0) { - double wcs = list.size(); - double wwcs = list.size() + list2.size(); - double wcl = wcs / wwcs * 100; - java.text.DecimalFormat df = new java.text.DecimalFormat("#.00"); - pvalueList3.add(df.format(wcl)); - } else { - pvalueList3.add("0"); - } - } - - - Map> vmap = new LinkedHashMap<>(); - vmap.put("已完成数", pvalueList1); - vmap.put("未完成数", pvalueList2); - vmap.put("本月完成率", pvalueList3); - json = json.fromObject(vmap); -// System.out.println(json); - request.setAttribute("result", json); - return "result"; - } - - @RequestMapping("/doecharts3.do") - public String doecharts3(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - JSONObject json = new JSONObject(); - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - String showdata = request.getParameter("showdata"); - -// WorkorderAchievementOrder workorderAchievementOrder = this.workorderAchievementOrderService.selectById(id); - - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - - Map> vmap = new LinkedHashMap<>(); - - java.text.DecimalFormat df = new java.text.DecimalFormat("0.0"); - - List list = this.workorderAchievementOrderService.selectListByWhere("where stu_type='1' order by id "); - if (list != null && list.size() > 0) { - for (WorkorderAchievementOrder workorderAchievementOrder : list) { - List pvalueList = new ArrayList<>(); - if (workorderAchievementOrder.getTbType().equals("patrolRecord_P")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='P' "; - List plist = this.patrolRecordService.selectListByWhere(wString + " and status = '3'"); - int gs = 0; - for (PatrolRecord patrolRecord : plist) { - gs += patrolRecord.getDuration(); - } - pvalueList.add(df.format(gs / 60)); - vmap.put(workorderAchievementOrder.getName(), pvalueList); - } else if (workorderAchievementOrder.getTbType().equals("patrolRecord_E")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='E' "; - List plist = this.patrolRecordService.selectListByWhere(wString + " and status = '3'"); - int gs = 0; - for (PatrolRecord patrolRecord : plist) { - gs += patrolRecord.getDuration(); - } - pvalueList.add(df.format(gs / 60)); - vmap.put(workorderAchievementOrder.getName(), pvalueList); - } else if (workorderAchievementOrder.getTbType().equals("workorderRepair")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.REPAIR + "' "; - List plist = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - int gs = 0; - for (WorkorderDetail workorderDetail : plist) { - List timelist = this.workorderAchievementService.selectListByWhere(" where pid='" + workorderDetail.getId() + "'"); - if (timelist != null && timelist.size() > 0) { - for (WorkorderAchievement workorderAchievement : timelist) { - gs += workorderAchievement.getWorkTime(); - } - } - } - pvalueList.add(df.format(gs)); - vmap.put(workorderAchievementOrder.getName(), pvalueList); - } else if (workorderAchievementOrder.getTbType().equals("workorderMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.MAINTAIN + "' "; - List plist = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - int gs = 0; - for (WorkorderDetail workorderDetail : plist) { - List timelist = this.workorderAchievementService.selectListByWhere(" where pid='" + workorderDetail.getId() + "'"); - if (timelist != null && timelist.size() > 0) { - for (WorkorderAchievement workorderAchievement : timelist) { - gs += workorderAchievement.getWorkTime(); - } - } - } - pvalueList.add(df.format(gs)); - vmap.put(workorderAchievementOrder.getName(), pvalueList); - } else if (workorderAchievementOrder.getTbType().equals("repairAndMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and (type='" + WorkorderDetail.REPAIR + "' or type='" + WorkorderDetail.MAINTAIN + "') "; - List plist = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - int gs = 0; - for (WorkorderDetail workorderDetail : plist) { - List timelist = this.workorderAchievementService.selectListByWhere(" where pid='" + workorderDetail.getId() + "'"); - if (timelist != null && timelist.size() > 0) { - for (WorkorderAchievement workorderAchievement : timelist) { - gs += workorderAchievement.getWorkTime(); - } - } - } - pvalueList.add(df.format(gs)); - vmap.put(workorderAchievementOrder.getName(), pvalueList); - } - } - } - - json = json.fromObject(vmap); -// System.out.println(json); - request.setAttribute("result", json); - return "result"; - } - - @RequestMapping("/getlistforAchievement.do") - public ModelAndView getlistforAchievement(HttpServletRequest request, Model model, HttpServletResponse response) { - User cu = (User) request.getSession().getAttribute("cu"); - - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - String showdata = request.getParameter("showdata"); - - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - - WorkorderAchievementOrder workorderAchievementOrder = this.workorderAchievementOrderService.selectById(id); - - JSONArray jsonArray = new JSONArray(); - - java.text.DecimalFormat df = new java.text.DecimalFormat("#.0"); - - if (workorderAchievementOrder.getTbType().equals("patrolRecord_P")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='P' and status='3' "; - List list = this.patrolRecordService.selectTopByWhere(wString, "6"); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("jobNumber", "-"); - jsonObject.put("jobName", patrolRecord.getName()); - User user = this.userService.getUserById(patrolRecord.getWorkerId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "未识别人员"); - } - jsonObject.put("sdt", patrolRecord.getStartTime().substring(0, 16)); - jsonObject.put("edt", patrolRecord.getEndTime().substring(0, 16)); - jsonObject.put("workHour", df.format(patrolRecord.getDuration() / 60)); - jsonArray.add(jsonObject); - } - } - } else if (workorderAchievementOrder.getTbType().equals("patrolRecord_E")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='E' and status='3' "; - List list = this.patrolRecordService.selectTopByWhere(wString, "6"); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("jobNumber", "-"); - jsonObject.put("jobName", patrolRecord.getName()); - User user = this.userService.getUserById(patrolRecord.getWorkerId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "未识别人员"); - } - jsonObject.put("sdt", patrolRecord.getStartTime().substring(0, 16)); - jsonObject.put("edt", patrolRecord.getEndTime().substring(0, 16)); - jsonObject.put("workHour", df.format(patrolRecord.getDuration() / 60)); - jsonArray.add(jsonObject); - } - } - } else if (workorderAchievementOrder.getTbType().equals("workorderRepair")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.REPAIR + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("jobNumber", workorderDetail.getJobNumber()); - jsonObject.put("jobName", workorderDetail.getJobName()); - jsonObject.put("sdt", workorderDetail.getPlanDate().substring(0, 16)); - jsonObject.put("edt", workorderDetail.getCompleteDate().substring(0, 16)); - List timelist = this.workorderAchievementService.selectListByWhere(" where pid='" + workorderDetail.getId() + "'"); - String userNames = ""; - double workHour = 0.0; - if (timelist != null && timelist.size() > 0) { - for (WorkorderAchievement workorderAchievement : timelist) { - User user = this.userService.getUserById(workorderAchievement.getUserId()); - if (user != null) { - userNames += user.getCaption() + ","; - } else { - userNames += "未识别人员" + ","; - } - workHour += workorderAchievement.getWorkTime(); - } - } - if (userNames.length() > 0) { - userNames = userNames.substring(0, userNames.length() - 1); - } - jsonObject.put("workMan", userNames); - jsonObject.put("workHour", df.format(workHour)); - jsonArray.add(jsonObject); - } - } - } else if (workorderAchievementOrder.getTbType().equals("workorderMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.MAINTAIN + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("jobNumber", workorderDetail.getJobNumber()); - jsonObject.put("jobName", workorderDetail.getJobName()); - jsonObject.put("sdt", workorderDetail.getPlanDate().substring(0, 16)); - jsonObject.put("edt", workorderDetail.getCompleteDate().substring(0, 16)); - List timelist = this.workorderAchievementService.selectListByWhere(" where pid='" + workorderDetail.getId() + "'"); - String userNames = ""; - double workHour = 0.0; - if (timelist != null && timelist.size() > 0) { - for (WorkorderAchievement workorderAchievement : timelist) { - User user = this.userService.getUserById(workorderAchievement.getUserId()); - if (user != null) { - userNames += user.getCaption() + ","; - } else { - userNames += "未识别人员" + ","; - } - workHour += workorderAchievement.getWorkTime(); - } - } - if (userNames.length() > 0) { - userNames = userNames.substring(0, userNames.length() - 1); - } - jsonObject.put("workMan", userNames); - jsonObject.put("workHour", df.format(workHour)); - jsonArray.add(jsonObject); - } - } - } else if (workorderAchievementOrder.getTbType().equals("repairAndMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and (type='" + WorkorderDetail.REPAIR + "' or type='" + WorkorderDetail.MAINTAIN + "') "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("jobNumber", workorderDetail.getJobNumber()); - jsonObject.put("jobName", workorderDetail.getJobName()); - jsonObject.put("sdt", workorderDetail.getPlanDate().substring(0, 16)); - jsonObject.put("edt", workorderDetail.getCompleteDate().substring(0, 16)); - List timelist = this.workorderAchievementService.selectListByWhere(" where pid='" + workorderDetail.getId() + "'"); - String userNames = ""; - double workHour = 0.0; - if (timelist != null && timelist.size() > 0) { - for (WorkorderAchievement workorderAchievement : timelist) { - User user = this.userService.getUserById(workorderAchievement.getUserId()); - if (user != null) { - userNames += user.getCaption() + ","; - } else { - userNames += "未识别人员" + ","; - } - workHour += workorderAchievement.getWorkTime(); - } - } - if (userNames.length() > 0) { - userNames = userNames.substring(0, userNames.length() - 1); - } - jsonObject.put("workMan", userNames); - jsonObject.put("workHour", df.format(workHour)); - jsonArray.add(jsonObject); - } - } - } - - request.setAttribute("result", jsonArray); -// System.out.println(jsonArray); - return new ModelAndView("result"); - } - - @RequestMapping("/cancelList.do") - public String cancelList(HttpServletRequest request, Model model) { -// String patrolPlanIds = request.getParameter("ids"); - request.setAttribute("patrolDate", CommUtil.nowDate().substring(0, 10)); - return "timeefficiency/patrolPlanCancelList"; - } - - @RequestMapping("/doCancel.do") - public String doCancel(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { - String[] id = ids.split(","); - int result = 0; - if (id != null && !id.equals("")) { - for (int i = 0; i < id.length; i++) { - result += this.patrolRecordService.deleteByWhere("where id = '" + id[i] + "'"); - } - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取年月的json用于 select2下拉 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getYearRegisterSelect.do") - public String getYearRegisterSelect(HttpServletRequest request, Model model) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - - for (int i = 1; i <= 12; i++) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("id", i); - jsonObject.put("text", i + "月"); - - com.alibaba.fastjson.JSONArray jsonArray1 = new com.alibaba.fastjson.JSONArray(); - - int days = 0; - switch (i) { - case 1: - days = 31; - case 2: - days = 28; - case 3: - days = 31; - case 4: - days = 30; - case 5: - days = 31; - case 6: - days = 30; - case 7: - days = 31; - case 8: - days = 31; - case 9: - days = 30; - case 10: - days = 31; - case 11: - days = 30; - case 12: - days = 31; - } - - for (int j = 1; j <= days; j++) { - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("id", i + "." + j); - jsonObject1.put("text", i + "月" + j + "日"); - jsonArray1.add(jsonObject1); - } - - jsonObject.put("children", jsonArray1); - jsonArray.add(jsonObject); - } - - model.addAttribute("result", jsonArray); -// System.out.println(jsonArray); - return "result"; - } - - - /** - * 删除巡检计划下 --- 巡检点关联的设备 - */ - @RequestMapping("/deletesEquipment4patrolPlanPatrolPoint.do") - public String deletesEquipment4patrolPlanPatrolPoint(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - System.out.println("where id in ('" + ids + "')"); - int result = this.patrolPlanPatrolEquipmentService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * updatePatrolRiskLevels - * 更新安全任务计划里选择了的 关联的风险等级评估项 - * 2021 08 20 10:05:00 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updatePatrolRiskLevels.do") - public String updatePatrolRiskLevels(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPlanId = request.getParameter("patrolPlanId"); - String riskLevelIds = request.getParameter("riskLevelIds"); - - try { - this.patrolPlanRiskLevelService.deleteByWhere("where plan_id ='" + patrolPlanId + "'"); - } catch (Exception e) { - // TODO: handle exception - } - int result = 0; - String[] idArrary = riskLevelIds.split(","); - - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - PatrolPlanRiskLevel patrolPlanRiskLevel = new PatrolPlanRiskLevel(); - patrolPlanRiskLevel.setId(CommUtil.getUUID()); - patrolPlanRiskLevel.setInsdt(CommUtil.nowDate()); - patrolPlanRiskLevel.setInsuser(cu.getId()); - patrolPlanRiskLevel.setPlanId(patrolPlanId); - patrolPlanRiskLevel.setRiskLevelId(str); -// PatrolPoint selectById = patrolPointService.selectById(str); -// String morder = selectById.getMorder(); // 原来的morder里 是 int类型的 顺序 - patrolPlanRiskLevel.setMorder(1);//包装类 将字符串转换成int - - result += this.patrolPlanRiskLevelService.save(patrolPlanRiskLevel); - } - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取下发检修时间 - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "获取下次检修时间", notes = "获取下次检修时间", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "特种设备 或 任务点id", dataType = "String", paramType = "query", defaultValue = "", required = true), - @ApiImplicitParam(name = "type", value = "类型: 0为特种设备 1为安全用具或消防器具", dataType = "String", paramType = "query", defaultValue = "", required = true) - }) - @RequestMapping(value = "/getNextTime.do", method = RequestMethod.GET) - public ModelAndView getNextTime(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "type") String type) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - String dt = ""; - if (type.equals("0") && id != null && !id.equals("")) {//特种设备 - List list = patrolPlanPatrolEquipmentService.selectListByWhere("where equipment_id ='" + id + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - PatrolPlan patrolPlan = patrolPlanService.selectSimpleById(list.get(i).getPatrolPlanId()); - if (patrolPlan != null) { - if (patrolPlan.getPlanIssuanceDate() != null && !patrolPlan.getPlanIssuanceDate().equals("")) { - dt = patrolPlan.getPlanIssuanceDate().substring(0, 10) + ""; - - break;//跳出循环 - } - } - } - } - } else if (type.equals("1") && id != null && !id.equals("")) {//安全用具或消防器具 - List list = patrolRouteService.selectListByWhere("where patrol_point_id ='" + id + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - PatrolPlan patrolPlan = patrolPlanService.selectSimpleById(list.get(i).getPatrolPlanId()); - if (patrolPlan != null) { - if (patrolPlan.getPlanIssuanceDate() != null && !patrolPlan.getPlanIssuanceDate().equals("")) { - dt = patrolPlan.getPlanIssuanceDate().substring(0, 10) + ""; - - break;//跳出循环 - } - } - } - } - } else {//未知 - - } - - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("code", 1); - jsonObject.put("msg", ""); - jsonObject.put("result", dt); - - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolPlanTypeController.java b/src/com/sipai/controller/timeefficiency/PatrolPlanTypeController.java deleted file mode 100644 index c21ffa9b..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolPlanTypeController.java +++ /dev/null @@ -1,340 +0,0 @@ -package com.sipai.controller.timeefficiency; - - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolPlanType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.*; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -@Controller -@RequestMapping("/timeEfficiency/PatrolType") -public class PatrolPlanTypeController { - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPointMeasurePointService patrolPointMeasurePointService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private PatrolRecordPatrolEquipmentService patorlRecordPatrolEquipmentService; - @Resource - private PatrolRouteService patrolRouteService; - @Resource - private PatrolRecordPatrolRouteService patrolRecordPatrolRouteService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private PatrolPointCameraService patrolPointCameraService; - @Resource - private PatrolPlanPatrolPointService patrolPlanPatrolPointService;//lzh - - @Resource - private PatrolPlanTypeService patrolPlanTypeService; //lzh - - /** - * 主页 - */ - @RequestMapping("/showTypeList.do") - public String showTypeList(HttpServletRequest request, Model model) { - return "/timeefficiency/patrolTypeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getlist(HttpServletRequest request, Model model, -// HttpServletResponse response, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - request.setAttribute("type", "1"); - if (sort == null) { - sort = " morder "; // insdt - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1 = 1"; -// String wherestr = " where type='" + request.getParameter("type") + "'"; -// wherestr += " and unit_id='" + request.getParameter("unitId") + "'"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } -// if (request.getParameter("patrolModelId") != null && !request.getParameter("patrolModelId").isEmpty()) { -// wherestr += " and patrol_model_id='" + request.getParameter("patrolModelId") + "' "; -// } - - PageHelper.startPage(page, rows); - List list = this.patrolPlanTypeService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); //分页插件的东西 - JSONArray json = JSONArray.fromObject(list); - - // pi.getTotal() 是所含数据的个数 比如总数是5 生产巡检是3个,设备巡检是2个 - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); -// 这里,我又想多说一句:ModelMap对象主要用于传递控制方法处理数据到结果页面, -// 也就是说我们把结果页面上需要的数据放到ModelMap对象中即可, -// 他的作用类似于request对象的setAttribute方法的作用,用来在一个请求过程中传递处理的数据。 - } - - - /** - * 添加 - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - String unitId = request.getParameter("bizId"); - if (unitId != null && !unitId.equals("")) { - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - request.setAttribute("type", request.getParameter("patrolType")); - request.setAttribute("patrolPointId", CommUtil.getUUID()); - return "/timeefficiency/patrolTypeListAdd"; - } - - /* - * 编辑 - */ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPlanType planType = this.patrolPlanTypeService.selectById(Id); - - if (planType != null) { - Company company = companyService.selectByPrimaryKey(planType.getUnitId()); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - model.addAttribute("patrolplanType", planType); - return "timeefficiency/patrolTypeListEdit"; - } - - /* - * 查看 - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPlanType planType = this.patrolPlanTypeService.selectById(Id); - // 加入 所属公司 虹桥 - if (planType != null) { - Company company = companyService.selectByPrimaryKey(planType.getUnitId()); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - - model.addAttribute("patrolplanType", planType); - return "/timeefficiency/patrolTypeListView"; - } - - /** - * 保存 - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute PatrolPlanType patrolPlanType) { - - User cu = (User) request.getSession().getAttribute("cu"); - patrolPlanType.setId(CommUtil.getUUID()); - patrolPlanType.setInsuser(cu.getId()); - patrolPlanType.setInsdt(CommUtil.nowDate()); -// patrolPlanType.setName(patrolPlanType.getName().trim()); - String fileIds = request.getParameter("fileIds"); - if (fileIds != null && !fileIds.isEmpty()) { - List commonFiles = new ArrayList<>(); - String[] ids = fileIds.split(","); - for (int i = 0; i < ids.length; i++) { - CommonFile commonFile = new CommonFile(); - commonFile.setId(ids[i]); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFiles.add(commonFile); - } - patrolPlanType.setFiles(commonFiles); - } - int result = this.patrolPlanTypeService.save(patrolPlanType); - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPlanType.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.patrolPlanTypeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); // 前端传过来的 所有 勾选了的 选项的集合 - int result = this.patrolPlanTypeService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 根据公司id获取任务类型? - * 直接获取所有任务类型 - * - * @param request - * @param model - * @return - */ - - @RequestMapping("/getPlanTypeByBizId4Select.do") - public String getPlanTypeByBizId4Select(HttpServletRequest request, Model model) { - // 1、从前端传进公司的id,根据id查询所有公司下的任务类型 - String companyId = request.getParameter("companyId"); -// PatrolPlanType patrolPlanType = new PatrolPlanType(); 写错了 这是serviceimpl写的 -// patrolPlanType.setWhere("where unit_id = '" + companyId + "'"); 写错了 这是serviceimpl写的 -// Controller里面就传入 wherestr就行了 不然你每次都要写一遍 new对象??? - - List listByWhere = this.patrolPlanTypeService.selectListByWhere("where unit_id = '" + companyId + "'" - + "and active = '1' "); - // 2、判断不为空的话 就 new一个JSONObject对象,加入2个键值对 id和text(任务类型的名称) - // JSONObject jsonObject =new JSONObject(); - // 把每一个JSONObject对象加进 json JSONArray json=new JSONArray(); - JSONArray json = new JSONArray(); - - if (listByWhere != null && listByWhere.size() > 0) { - for (PatrolPlanType type : listByWhere) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", type.getId()); - jsonObject.put("text", type.getName()); - jsonObject.put("planSelect", type.getName()); - json.add(jsonObject); - } - } - // 3、给model加入Attribute——json - // - model.addAttribute("result", json.toString()); - return "result"; - - } - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PatrolPlanType patrolPlanType) { -// User cu= (User)request.getSession().getAttribute("cu"); -// String fileIds = request.getParameter("fileIds"); -// if (fileIds!=null && !fileIds.isEmpty()) { -// List commonFiles = new ArrayList<>(); -// String[] ids = fileIds.split(","); -// for (int i = 0; i < ids.length; i++) { -// CommonFile commonFile = new CommonFile(); -// commonFile.setId(ids[i]); -// commonFile.setInsdt(CommUtil.nowDate()); -// commonFile.setInsuser(cu.getId()); -// commonFiles.add(commonFile); -// } -// patrolPoint.setFiles(commonFiles); -// } - patrolPlanType.setName(patrolPlanType.getName().trim()); - int result = this.patrolPlanTypeService.update(patrolPlanType); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPlanType.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取工艺段 - */ - @RequestMapping("/getType4Select.do") - public String getType4Select(HttpServletRequest request, Model model) { -// String bizId = request.getParameter("bizId"); - List list = this.patrolPlanTypeService.selectListByWhere("where 1=1 order by morder asc"); - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("text", list.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 将提前下发时间 转为天数 一月按30天 一周按7天 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/countDay.do") - public String countDay(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - PatrolPlanType patrolPlanType = patrolPlanTypeService.selectById(id); - int days = 0; - if (patrolPlanType != null) { - switch (patrolPlanType.getRegister()) { - case PatrolPlanType.Register_Type_Day: - days = Integer.parseInt(patrolPlanType.getPatrolTypeContent()) * 1; - break; - case PatrolPlanType.Register_Type_Week: - days = Integer.parseInt(patrolPlanType.getPatrolTypeContent()) * 7; - break; - case PatrolPlanType.Register_Type_Month: - days = Integer.parseInt(patrolPlanType.getPatrolTypeContent()) * 30; - break; - case PatrolPlanType.Register_Type_Year: - days = Integer.parseInt(patrolPlanType.getPatrolTypeContent()) * 365; - break; - } - } - model.addAttribute("result", days); - return "result"; - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/timeefficiency/PatrolPointController.java b/src/com/sipai/controller/timeefficiency/PatrolPointController.java deleted file mode 100644 index e18e8f25..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolPointController.java +++ /dev/null @@ -1,1196 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.report.RptMpSet; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.work.AreaManageService; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPointCamera; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolEquipment; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; -import com.sipai.entity.timeefficiency.PatrolRoute; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolPointCameraService; -import com.sipai.service.timeefficiency.PatrolPointEquipmentCardService; -import com.sipai.service.timeefficiency.PatrolPointMeasurePointService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.timeefficiency.PatrolRecordPatrolEquipmentService; -import com.sipai.service.timeefficiency.PatrolRecordPatrolRouteService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.timeefficiency.PatrolRouteService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/timeEfficiency/patrolPoint") -@Api(value = "/timeEfficiency/patrolPoint", tags = "巡检管理/巡检点相关接口") -public class PatrolPointController { - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPointMeasurePointService patrolPointMeasurePointService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private PatrolRecordPatrolEquipmentService patorlRecordPatrolEquipmentService; - @Resource - private PatrolRouteService patrolRouteService; - @Resource - private PatrolRecordPatrolRouteService patrolRecordPatrolRouteService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private PatrolPointCameraService patrolPointCameraService; - @Resource - private AreaManageService areaManageService; - - /** - * 列表(通用:包含 运行/设备/视频巡检) - */ - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/timeefficiency/patrolPointList"; - } - - /** - * 列表(定制:包含 安全巡检) - */ - @RequestMapping("/showListSafe.do") - public String showListSafe(HttpServletRequest request, Model model) { - return "/timeefficiency/patrolPointListSafe"; - } - - @ApiOperation(value = "获取巡检点列表(通用)", notes = "获取巡检点列表(通用)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "sort", value = "升序还是降序", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "order", value = "排序字段", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - if (sort == null || sort.equals("id")) { - sort = " S.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by S.morder "; - - String wherestr = "where 1=1 "; - - //上级unit 的id - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取unitId下所有子节点 - List units = this.unitService.getUnitChildrenById(request.getParameter("unitId")); - String unitIds = ""; - for (Unit unit : units) { - unitIds += "'" + unit.getId() + "',"; - } - if (unitIds != "") { - unitIds = unitIds.substring(0, unitIds.length() - 1); - wherestr += " and S.unit_id in (" + unitIds + ") "; - } - } - - if (request.getParameter("patrolType") != null && !request.getParameter("patrolType").isEmpty()) { - wherestr += " and S.type = '" + request.getParameter("patrolType") + "' "; - } - - if (request.getParameter("processSectionId") != null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and process_section_id = '" + request.getParameter("processSectionId") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and s.name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - //格式化ids - String[] idArray = checkedIds.split(","); - String ids = ""; - for (String str : idArray) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += str; - } - wherestr += " and S.id in('" + ids.replace(",", "','") + "')"; - } -// System.out.println(wherestr); - PageHelper.startPage(pages, pagesize); - List list = this.patrolPointService.getPatrolPoints(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取巡检点列表(安全任务)", notes = "获取巡检点列表(安全任务)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "sort", value = "升序还是降序", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "order", value = "排序字段", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping("/getListSafe.do") - public ModelAndView getListSafe(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - if (sort == null || sort.equals("id")) { - sort = " S.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by S.morder "; - - String wherestr = "where 1=1 "; - - //上级unit 的id - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取unitId下所有子节点 - List units = this.unitService.getUnitChildrenById(request.getParameter("unitId")); - String unitIds = ""; - for (Unit unit : units) { - unitIds += "'" + unit.getId() + "',"; - } - if (unitIds != "") { - unitIds = unitIds.substring(0, unitIds.length() - 1); - wherestr += " and S.unit_id in (" + unitIds + ") "; - } - } - - if (request.getParameter("patrolType") != null && !request.getParameter("patrolType").isEmpty()) { - wherestr += " and S.type = '" + request.getParameter("patrolType") + "' "; - } - - if (request.getParameter("processSectionId") != null && !request.getParameter("processSectionId").isEmpty()) { - wherestr += " and process_section_id = '" + request.getParameter("processSectionId") + "' "; - } - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and s.name like '%" + request.getParameter("search_name") + "%' "; - } - - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - //格式化ids - String[] idArray = checkedIds.split(","); - String ids = ""; - for (String str : idArray) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += str; - } - wherestr += " and S.id in('" + ids.replace(",", "','") + "')"; - } - - String taskTypeSelect = request.getParameter("taskTypeSelect"); - String search_id = request.getParameter("search_id"); - - //任务属性筛选 - if (taskTypeSelect != null && !taskTypeSelect.equals("")) { - wherestr += " and S.point_code = '" + taskTypeSelect + "' "; - } - - if (search_id != null && !search_id.equals("")) { -// wherestr += " and S.area_id = '"+search_id+"' "; - wherestr += " and (S.area_id ='" + search_id + "' or a.pid = '" + search_id + "')"; - } - - PageHelper.startPage(pages, pagesize); - List list = this.patrolPointService.getPatrolPointsSafe(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); -// System.out.println(json); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 添加 - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - String unitId = request.getParameter("bizId"); - if (unitId != null && !unitId.equals("")) { - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - request.setAttribute("type", request.getParameter("patrolType")); - request.setAttribute("patrolPointId", CommUtil.getUUID()); - return "/timeefficiency/patrolPointAdd"; - } - - /** - * 添加 - */ - @RequestMapping("/addSafe.do") - public String addSafe(HttpServletRequest request, Model model) { - String unitId = request.getParameter("bizId"); - if (unitId != null && !unitId.equals("")) { - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - request.setAttribute("type", request.getParameter("patrolType")); - request.setAttribute("patrolPointId", CommUtil.getUUID()); - return "/timeefficiency/patrolPointAddSafe"; - } - - /* - * 编辑 (通用:包含 运行/设备/视频巡检) - */ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if (patrolPoint != null) { - Company company = companyService.selectByPrimaryKey(patrolPoint.getUnitId()); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - model.addAttribute("patrolPoint", patrolPoint); - return "timeefficiency/patrolPointEdit"; - } - - /* - * 编辑 (定制:包含 安全巡检) - */ - @RequestMapping("/editSafe.do") - public String editSafe(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if (patrolPoint != null) { - Company company = companyService.selectByPrimaryKey(patrolPoint.getUnitId()); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - AreaManage areaManage = areaManageService.selectById(patrolPoint.getAreaId()); - if (areaManage != null) { - request.setAttribute("areaName", areaManage.getName()); - } - } - model.addAttribute("patrolPoint", patrolPoint); - return "timeefficiency/patrolPointEditSafe"; - } - - /* - * 查看 - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if (patrolPoint != null) { - Company company = companyService.selectByPrimaryKey(patrolPoint.getUnitId()); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - } - model.addAttribute("patrolPoint", patrolPoint); - return "/timeefficiency/patrolPointView"; - } - - /* - * 查看 - */ - @RequestMapping("/viewSafe.do") - public String viewSafe(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if (patrolPoint != null) { - Company company = companyService.selectByPrimaryKey(patrolPoint.getUnitId()); - if (company != null) { - request.setAttribute("companyName", company.getSname()); - } - AreaManage areaManage = areaManageService.selectById(patrolPoint.getAreaId()); - if (areaManage != null) { - request.setAttribute("areaName", areaManage.getName()); - } - } - model.addAttribute("patrolPoint", patrolPoint); - return "/timeefficiency/patrolPointViewSafe"; - } - - /** - * 保存 - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute PatrolPoint patrolPoint) { - User cu = (User) request.getSession().getAttribute("cu"); - patrolPoint.setId(CommUtil.getUUID()); - patrolPoint.setInsuser(cu.getId()); - patrolPoint.setInsdt(CommUtil.nowDate()); - patrolPoint.setName(patrolPoint.getName().trim()); - String fileIds = request.getParameter("fileIds"); - if (fileIds != null && !fileIds.isEmpty()) { - List commonFiles = new ArrayList<>(); - String[] ids = fileIds.split(","); - for (int i = 0; i < ids.length; i++) { - CommonFile commonFile = new CommonFile(); - commonFile.setId(ids[i]); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFiles.add(commonFile); - } - patrolPoint.setFiles(commonFiles); - } - int result = this.patrolPointService.save(patrolPoint); - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPoint.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolPointService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /* - * 获取单条巡检点数据 - */ - @RequestMapping("/getData.do") - public String getData(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if (patrolPoint.getFiles() != null && patrolPoint.getFiles().size() > 0) { - Iterator iterator = patrolPoint.getFiles().iterator(); - String fileIds = ""; - String fileNames = ""; - while (iterator.hasNext()) { - CommonFile commonFile = iterator.next(); - if (!fileIds.isEmpty()) { - fileIds += ","; - } - fileIds += commonFile.getId(); - if (!fileNames.isEmpty()) { - fileNames += ","; - } - fileNames += commonFile.getFilename(); - } - model.addAttribute("fileIds", fileIds); - model.addAttribute("fileNames", fileNames); - } - model.addAttribute("result", JSONObject.fromObject(patrolPoint)); - return "result"; - } - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PatrolPoint patrolPoint) { - User cu = (User) request.getSession().getAttribute("cu"); - String fileIds = request.getParameter("fileIds"); - if (fileIds != null && !fileIds.isEmpty()) { - List commonFiles = new ArrayList<>(); - String[] ids = fileIds.split(","); - for (int i = 0; i < ids.length; i++) { - CommonFile commonFile = new CommonFile(); - commonFile.setId(ids[i]); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFiles.add(commonFile); - } - patrolPoint.setFiles(commonFiles); - } - patrolPoint.setName(patrolPoint.getName().trim()); - int result = this.patrolPointService.update(patrolPoint); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolPoint.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看 - * - * @param request - * @param model - * @return - */ -// @RequestMapping("/view.do") -// public String view(HttpServletRequest request,Model model){ -// String Id = request.getParameter("id"); -// PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); -// model.addAttribute("patrolPoint", patrolPoint); -// return "/timeefficiency/patrolPointView"; -// } - /* - * 关联数据传输方法 - */ - @RequestMapping("/getPatrolPoints.do") - public String getPatrolPoints(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - String wherestr = " where unit_id = '" + unitId + "'"; - if (request.getParameter("floorId") != null && !request.getParameter("floorId").isEmpty()) { - wherestr += " and (floor_id = '" + request.getParameter("floorId") + "' or floor_id is null)"; - } - String orderstr = " order by floor_id desc,morder asc"; - List patrolPoints = this.patrolPointService.selectListByWhere(wherestr + orderstr); - JSONArray json = new JSONArray(); - if (patrolPoints != null && patrolPoints.size() > 0) { - for (int i = 0; i < patrolPoints.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPoints.get(i).getId()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * @param request - * @param model - * @return - */ - @RequestMapping("/patrolPointForSelect.do") - public String patrolPointForSelect(HttpServletRequest request, Model model) { - String patrolPointIds = request.getParameter("patrolPointIds"); - String whereStr = "where id in ('" + patrolPointIds.replace(",", "','") + "') "; - List list = this.patrolPointService.selectListByWhere(whereStr); - //默认选中巡检点 - model.addAttribute("patrolPoints", patrolPointIds); - model.addAttribute("patrolPlanunitId", request.getParameter("bizId")); - return "timeefficiency/patrolPointForSelect"; - } - - /** - * @param request - * @param model - * @return - */ - @RequestMapping("/patrolPointForSelect_Safe.do") - public String patrolPointForSelect_Safe(HttpServletRequest request, Model model) { - String patrolPointIds = request.getParameter("patrolPointIds"); - String whereStr = "where id in ('" + patrolPointIds.replace(",", "','") + "') "; - List list = this.patrolPointService.selectListByWhere(whereStr); - //默认选中巡检点 - model.addAttribute("patrolPoints", patrolPointIds); - model.addAttribute("patrolPlanunitId", request.getParameter("bizId")); - return "timeefficiency/patrolPointForSelect_Safe"; - } - - @RequestMapping("/updateMPoints.do") - public String updateMPoints(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPointId = request.getParameter("patrolPointId"); - String mPointIds = request.getParameter("mPointIds"); -// this.patrolPointMeasurePointService.deleteByWhere("where patrol_point_id ='" + patrolPointId + "'"); - int result = 0; - String[] idArrary = mPointIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - PatrolPointMeasurePoint patrolPointMeasurePoint = new PatrolPointMeasurePoint(); - patrolPointMeasurePoint.setId(CommUtil.getUUID()); - patrolPointMeasurePoint.setInsdt(CommUtil.nowDate()); - patrolPointMeasurePoint.setInsuser(cu.getId()); - patrolPointMeasurePoint.setPatrolPointId(patrolPointId); - patrolPointMeasurePoint.setMeasurePointId(str); - result += this.patrolPointMeasurePointService.save(patrolPointMeasurePoint); - } - } - String resstr = "{\"res\":" + result + "}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateEquipmentCards.do") - public String updateEquipmentCards(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPointId = request.getParameter("patrolPointId"); - String equipmentCardIds = request.getParameter("equipmentCardIds"); - this.patrolPointEquipmentCardService.deleteByWhere("where patrol_point_id ='" + patrolPointId + "'"); - int result = 0; - String[] idArrary = equipmentCardIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - PatrolPointEquipmentCard patrolPointEquipmentCard = new PatrolPointEquipmentCard(); - patrolPointEquipmentCard.setId(CommUtil.getUUID()); - patrolPointEquipmentCard.setInsdt(CommUtil.nowDate()); - patrolPointEquipmentCard.setInsuser(cu.getId()); - patrolPointEquipmentCard.setPatrolPointId(patrolPointId); - patrolPointEquipmentCard.setEquipmentCardId(str); - result += this.patrolPointEquipmentCardService.save(patrolPointEquipmentCard); - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateCameras.do") - public String updateCameras(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolPointId = request.getParameter("patrolPointId"); - String cameraIds = request.getParameter("cameraIds"); - this.patrolPointCameraService.deleteByWhere("where patrol_point_id ='" + patrolPointId + "'"); - int result = 0; - String[] idArrary = cameraIds.split(","); - for (String str : idArrary) { - if (str != null && !str.isEmpty()) { - PatrolPointCamera patrolPointCamera = new PatrolPointCamera(); - patrolPointCamera.setId(CommUtil.getUUID()); - patrolPointCamera.setPatrolPointId(patrolPointId); - patrolPointCamera.setCameraId(str); - result += this.patrolPointCameraService.save(patrolPointCamera); - } - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取巡检点下关联测量点列表数据 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getMPoints.do") - public ModelAndView getMPoints(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("patrolPointId") != null && !request.getParameter("patrolPointId").isEmpty()) { - wherestr += " and patrol_point_id = '" + request.getParameter("patrolPointId") + "' "; - } - PageHelper.startPage(page, rows); - List list = this.patrolPointMeasurePointService.selectListByWhereMPoint(request.getParameter("unitId"), wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取巡检点下关联设备列表数据 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getEquipmentCards.do") - public ModelAndView getEquipmentCards(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " m.morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by e.equipmentCardID "; - - String wherestr = " where 1=1 and e.id is not null ";//有些台帐里面删掉的设备 导致无法查询出来 去除 - if (request.getParameter("patrolPointId") != null && !request.getParameter("patrolPointId").isEmpty()) { - wherestr += " and m.patrol_point_id = '" + request.getParameter("patrolPointId") + "' "; - } - PageHelper.startPage(page, rows); - List list = this.patrolPointEquipmentCardService.selectListByWhereEquipmentCard(wherestr + orderstr); - //如果传递记录id则查找设备是否巡检 - /*if (request.getParameter("patrolRecordId") != null && !request.getParameter("patrolRecordId").isEmpty()) { - for (PatrolPointEquipmentCard patrolPointEquipmentCard : list) { - List patrolRecordPatrolEquipment = this - .patorlRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '" + request.getParameter("patrolRecordId") + "' and equipment_id = '" + patrolPointEquipmentCard.getEquipmentCardId() + "'"); - if (patrolRecordPatrolEquipment != null && patrolRecordPatrolEquipment.size() != 0) { - patrolPointEquipmentCard.setPatrolStatus(patrolRecordPatrolEquipment.get(0).getStatus()); - } - } - }*/ - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getCameras.do") - public ModelAndView getCameras(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " asc "; - } -// String orderstr=" order by "+sort+" "+order; - String orderstr = " order by insdt "; - - String wherestr = " where 1=1 ";//有些台帐里面删掉的设备 导致无法查询出来 去除 - if (request.getParameter("patrolPointId") != null && !request.getParameter("patrolPointId").isEmpty()) { - wherestr += " and patrol_point_id = '" + request.getParameter("patrolPointId") + "' "; - } - PageHelper.startPage(page, rows); - List list = this.patrolPointCameraService.selectListByWhereCamera(wherestr + orderstr); - //如果传递记录id则查找设备是否巡检 - /*if(request.getParameter("patrolRecordId")!=null && !request.getParameter("patrolRecordId").isEmpty()){ - for(PatrolPointEquipmentCard patrolPointEquipmentCard :list){ - List patrolRecordPatrolEquipment = this - .patorlRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '"+request.getParameter("patrolRecordId")+"' and equipment_id = '"+patrolPointEquipmentCard.getEquipmentCardId()+"'"); - if(patrolRecordPatrolEquipment!=null&&patrolRecordPatrolEquipment.size()!=0){ - patrolPointEquipmentCard.setPatrolStatus(patrolRecordPatrolEquipment.get(0).getStatus()); - } - } - }*/ - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除多条数据(巡检点下关联的测量点) - */ - @RequestMapping("/dodeletes4MPoint.do") - public String dodeletes4MPoint(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolPointMeasurePointService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 删除多条数据(巡检点下关联的设备) - */ - @RequestMapping("/dodeletes4EquipmentCard.do") - public String dodeletes4EquipmentCard(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - System.out.println("where id in ('" + ids + "')"); - int result = this.patrolPointEquipmentCardService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * APP接口。获取巡检点列表 - * @param request - * @param model - * @return - */ -/* @RequestMapping("/getList4APP.do") - public ModelAndView getList4APP(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by S.insdt desc"; - - String wherestr="where 1=1 "; - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and S.biz_id='"+request.getParameter("search_code")+"'"; - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - wherestr += " and S.unit_id='"+request.getParameter("unitId")+"'"; - } - if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and process_section_id = '"+request.getParameter("processSectionId")+"' "; - } - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += " and S.type = '"+request.getParameter("type")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and s.name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and S.id in('"+ids.replace(",", "','")+"')"; - } - List list = this.patrolPointService.getPatrolPoints(wherestr+orderstr); - - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * APP接口。通过巡检测量点获取设备列表以及设备测量点 - * @param request - * @param model - * @return - */ /* - @RequestMapping("/getEquipmentListByPatrolPoint4APP.do") - public ModelAndView getEquipmentListByPatrolPoint4APP(HttpServletRequest request,Model model) { - String result = ""; - try{ - if(request.getParameter("id")!=null && !request.getParameter("id").isEmpty()){ - String wherestr = " where patrol_point_id='"+request.getParameter("id")+"' order by equipment_card_id asc"; - List ppequip = this.patrolPointEquipmentCardService.selectListByWhere(wherestr); - int size = ppequip.size(); - wherestr = " where 1=1"; - for(int i =0;i equipmentList = this.equipmentCardService.selectListByWhere(wherestr+"')" + orderstr); - for(int j=0;j mPointList = this.mPointService.selectListByWhere4APP(request.getParameter("unitId"), wherestrM); - ppequip.get(j).getEquipmentCard().setmPoint4APP(mPointList); - String patrolRecordId = request.getParameter("patrolRecordId"); - if (patrolRecordId!=null && !patrolRecordId.isEmpty()) { - List pEs=patorlRecordPatrolEquipmentService.selectListByWhere("where patrol_record_id ='"+patrolRecordId+"' and equipment_id ='"+ppequip.get(j).getEquipmentCardId()+"'"); - if (pEs!=null && pEs.size()>0) { - ppequip.get(j).setPatrolStatus(pEs.get(0).getStatus()); - } - } - } - JSONArray json=JSONArray.fromObject(ppequip); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json+"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - e.printStackTrace(); - } - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * 获取巡检计划下关联的巡检点 -- 巡检模块使用 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolPointForPlan.do") - public ModelAndView getPatrolPointForPlan(HttpServletRequest request, Model model) { - String planId = request.getParameter("planId"); - String wherestr = " where 1=1 and patrol_plan_id = '" + planId + "' and type = '" + PatrolRoute.Point_0 + "' order by morder"; - List list = this.patrolRouteService.selectListByPlan(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取巡检计划下关联的巡检点 -- 巡检模块使用 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolPointForPlanSafe.do") - public ModelAndView getPatrolPointForPlanSafe(HttpServletRequest request, Model model) { - String planId = request.getParameter("planId"); - String wherestr = " where 1=1 and patrol_plan_id = '" + planId + "' and type = '" + PatrolRoute.Point_0 + "' order by morder"; - List list = this.patrolRouteService.selectListByPlanSafe(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 删除计划下配置的巡检点 -- 巡检模块使用 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dodelete4PatrolPlan.do") - public ModelAndView dodelete4PatrolPlan(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - int res = patrolRouteService.deleteById(id); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取指定车间下的所有巡检点 -- 巡检模块使用 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolPointForUnitId.do") - public ModelAndView getPatrolPointForUnitId(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - if (type == null) {//目前没有该参数 默认运行点 加好后删除 - type = PatrolType.Product.getId(); - } - String wherestr = " where 1=1 and unit_id='" + unitId + "' and type = '" + type + "' order by morder"; - List list = this.patrolPointService.selectListByUnitId(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 保存计划下的关联的巡检点 - * - * @param patrolPlanId 巡检计划id - * @param patrolPointIds 巡检点id - * @return - */ - @RequestMapping("/saveRoutePointForPlan.do") - public String saveRoutePointForPlan(HttpServletRequest request, Model model, - @RequestParam(value = "patrolPlanId") String patrolPlanId, - @RequestParam(value = "patrolPointIds") String patrolPointIds) { - User cu = (User) request.getSession().getAttribute("cu"); - int res = this.patrolRouteService.saveByPlan(patrolPlanId, patrolPointIds, cu.getId()); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 拖拽排序计划下的关联的巡检点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRoutePointForPlan.do") - public String updateRoutePointForPlan(HttpServletRequest request, Model model, - @RequestParam(value = "patrolPlanId") String patrolPlanId, - @RequestParam(value = "ids") String ids) { - int res = this.patrolRouteService.updateByPlan(patrolPlanId, ids); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除计划下的关联的巡检点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteRoutePointForPlan.do") - public String deleteRoutePointForPlan(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "previousId") String previousId, - @RequestParam(value = "nextId") String nextId) { - int res = this.patrolRouteService.deleteByPlan(id, previousId, nextId); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取巡检记录下关联的巡检列表 - * sj 2020-04-24 平台手持端通用 - * ljl 2020-07-24 平台专用 app调用 getPatrolPointForRecord4APP.do 接口 - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "获取巡检记录下关联的巡检列表(平台专用)", notes = "获取巡检记录下关联的巡检列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "patrolRecordId", value = "任务id", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping("/getPatrolPointForRecord.do") - public ModelAndView getPatrolPointForRecord(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String wherestr = " where patrol_record_id='" + patrolRecordId + "' and type = '" + PatrolRoute.Point_0 + "' order by finishdt asc"; - List list = this.patrolRecordPatrolRouteService.selectListByWhere(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取巡检记录下关联的巡检列表(平台专用)", notes = "获取巡检记录下关联的巡检列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "patrolRecordId", value = "任务id", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping("/getPatrolPointForRecordSafe.do") - public ModelAndView getPatrolPointForRecordSafe(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String wherestr = " where patrol_record_id='" + patrolRecordId + "' and type = '" + PatrolRoute.Point_0 + "' order by finishdt asc"; - List list = this.patrolRecordPatrolRouteService.selectListByWhereSafe(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取巡检记录下关联的巡检列表 - * ljl 2020-07-24 手持端专用 运行/设备通用 - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "获取巡检记录下关联的巡检列表(app专用)", notes = "获取巡检记录下关联的巡检列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "patrolRecordId", value = "任务id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = " P or E or S", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/getPatrolPointForRecord4APP.do") - public ModelAndView getPatrolPointForRecord4APP(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String type = request.getParameter("type"); - JSONArray jsonArray = new JSONArray(); - if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(type)) { - jsonArray = this.patrolRecordService.getPointAndEquipJson4Equipment(patrolRecordId); - } else if (TimeEfficiencyCommStr.PatrolType_Product.equals(type)) { - jsonArray = this.patrolRecordService.getPointJson4Product(patrolRecordId); - } else if (TimeEfficiencyCommStr.PatrolType_Safe.equals(type)) { - jsonArray = this.patrolRecordService.getPointJson4Product(patrolRecordId); - } - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取 巡检点 下测量点(自动点) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPoint4APP.do") - public ModelAndView getMPoint4APP(HttpServletRequest request, Model model) { - String patrolPointId = request.getParameter("patrolPointId"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - List list = this.patrolPointMeasurePointService.selectList4MPoint(unitId, type, patrolPointId); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 巡检点拖拽排序 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dosort.do") - public String dosort(HttpServletRequest request, Model model) { - String ds = request.getParameter("jsondata"); - JSONArray json = JSONArray.fromObject(ds); - JSONObject jsonOne; - int result = 0; - - //先查出当前页面最小morder - int mor = 0; - for (int i = 0; i < json.size(); i++) { - jsonOne = json.getJSONObject(i); - if (mor == 0) { - mor = Integer.parseInt(jsonOne.get("morder").toString()); - } else { - if (Integer.parseInt(jsonOne.get("morder").toString()) < mor) { - //小于 - mor = Integer.parseInt(jsonOne.get("morder").toString()); - } else { - //大于 - } - } - } - - //直接从最小morder开始累加 - for (int i = 0; i < json.size(); i++, mor++) { - PatrolRoute patrolRoute = new PatrolRoute(); - jsonOne = json.getJSONObject(i); - patrolRoute.setId((String) jsonOne.get("id")); - patrolRoute.setMorder(mor); - result = this.patrolRouteService.update(patrolRoute); - } - - model.addAttribute("result", result); - return "result"; - } - - /** - * 巡检点下测量点拖拽排序 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/dosortMeasurePoint.do") - public String dosortMeasurePoint(HttpServletRequest request, Model model) { - String ids = request.getParameter("ids"); - int result = 0; - String[] id = ids.split(","); - if (id != null && id.length > 0) { - for (int i = 0; i < id.length; i++) { - PatrolPointMeasurePoint patrolPointMeasurePoint = patrolPointMeasurePointService.selectById(id[i]); - System.out.println(patrolPointMeasurePoint.getMeasurePointId() + "---" + i); - patrolPointMeasurePoint.setMorder(i); - result = this.patrolPointMeasurePointService.update(patrolPointMeasurePoint); - } - } - model.addAttribute("result", result); - return "result"; - } - - - /** - * 用于选择区域弹窗 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/selectAreaLayer.do") - public String selectAreaLayer(HttpServletRequest request, Model model) { - return "timeefficiency/selectAreaLayer"; - } - - /** - * 用于选择区域弹窗 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/selectAreasLayer.do") - public String selectAreasLayer(HttpServletRequest request, Model model) { - return "timeefficiency/selectAreasLayer"; - } -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolRecordController.java b/src/com/sipai/controller/timeefficiency/PatrolRecordController.java deleted file mode 100644 index 8bd7b9e0..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolRecordController.java +++ /dev/null @@ -1,3531 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.work.Scheduling; -import com.sipai.entity.work.SchedulingReplaceJob; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.*; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.*; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.HttpUtil; -import com.sun.jmx.snmp.Timestamp; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.axis.types.Day; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.checkerframework.checker.units.qual.C; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - - -@Controller -@RequestMapping("/timeEfficiency/patrolRecord") -@Api(value = "/timeEfficiency/patrolRecord", tags = "巡检管理/巡检记录相关接口") -public class PatrolRecordController { - @Resource - private PatrolRecordService patrolRecordService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ModbusFigService modbusFigService; - @Resource - private PatrolModelService patrolModelService; - @Resource - private PatrolPlanService patrolPlanService; - @Resource - private PatrolRouteService patrolRouteService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolRecordPatrolRouteService patrolRecordPatrolRouteService; - @Resource - private PatrolRecordPatrolEquipmentService patrolRecordPatrolEquipmentService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UserService userService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private GroupManageService groupManageService; - @Resource - private PatrolPlanPatrolEquipmentService patrolPlanPatrolEquipmentService; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private AbnormityService abnormityService; - @Resource - private PatrolRecordPatrolCameraService patrolRecordPatrolCameraService; - @Resource - private WorkerPositionService workerPositionService; - @Resource - private ExtSystemService extSystemService; - @Resource - private PatrolAreaService patrolAreaService; - @Resource - private PatrolPlanPatrolCameraService patrolPlanPatrolCameraService; - @Resource - private SchedulingService schedulingService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - - /** - * 生产巡检巡检任务集合 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCalendar.do") - public String showCalendar(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Product); - request.setAttribute("nowdate", CommUtil.nowDate()); - return "/timeefficiency/patrolRecordCalendar"; - } - - /** - * 生产巡检巡检任务集合 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCalendar_Alarm.do") - public String showCalendar_Alarm(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Alarm); - return "/timeefficiency/patrolRecordCalendar_Alarm"; - } - - /** - * 生产巡检巡检任务集合 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCalendar_Equipment.do") - public String showCalendar_Equipment(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Equipment); - request.setAttribute("nowdate", CommUtil.nowDate()); - return "/timeefficiency/patrolRecordCalendar_Equipment"; - } - - /** - * 生产巡检巡检任务集合 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCalendar_Camera.do") - public String showCalendar_Camera(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Camera); - return "/timeefficiency/patrolRecordCalendar_Camera"; - } - - /** - * 生产巡检记录清单 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Product); - return "/timeefficiency/patrolRecordList"; - } - - /** - * 设备巡检记录清单 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList_Equipment.do") - public String showList_Equipment(HttpServletRequest request, Model model) { - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Equipment); - return "/timeefficiency/patrolRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - sort = " start_time "; - if (order == null) { - order = " desc "; - } - String wherestr = " where 1=1 "; - String orderstr = " order by start_time desc "; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr = " where unit_id='" + request.getParameter("unitId") + "' "; - } - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and start_time >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and end_time <= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or content like '%" + request.getParameter("search_name") + "%') "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '" + request.getParameter("type") + "' "; - } - if (request.getParameter("patrolPlanIds") != null && !request.getParameter("patrolPlanIds").isEmpty()) { - wherestr += " and patrol_plan_id in ('" + request.getParameter("patrolPlanIds").replace(",", "','") + "') "; - } - //通过日期获取时间范围 - if (request.getParameter("date") != null && !request.getParameter("date").isEmpty()) { - //以服务器时间为准 - String[] dates = request.getParameter("date").split("~"); - wherestr += " and start_time >= '" + dates[0] + "' and start_time <='" + dates[1] + "' "; - } - - if (request.getParameter("status_select") != null && !request.getParameter("status_select").isEmpty()) { - if (request.getParameter("status_select").equals("0")) {//执行中 - wherestr += " and status in ('1','2') and start_time<='" + CommUtil.nowDate() + "' and '" + CommUtil.nowDate() + "'<=end_time "; - } - if (request.getParameter("status_select").equals("1")) {//已完成 - wherestr += " and status in ('3') "; - } - if (request.getParameter("status_select").equals("2")) {//已过期 - wherestr += " and status in ('1','2') and end_time<='" + CommUtil.nowDate() + "' "; - } - } - - PageHelper.startPage(page, rows); - List list = this.patrolRecordService.selectListByWhere4Safe(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - //巡检模式对象 - if (patrolRecord != null) { - if (!patrolRecord.getPatrolModelId().isEmpty() && !patrolRecord.getPatrolModelId().equals(TimeEfficiencyCommStr.PatrolModel_TempTask)) { - PatrolModel patrolModel = this.patrolModelService.selectById(patrolRecord.getPatrolModelId()); - if (patrolModel != null) { - patrolRecord.setPatrolModel(patrolModel); - } - } - } - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "result"; - } - - @RequestMapping("/view_Alarm.do") - public String view_Alarm(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - // boolean type = request.getParameter("recordType").toString().equals(PatrolType.Equipment.getId()); - // if(request.getParameter("recordType")!=null&&type){ - // //设备巡检详情 - // return "timeefficiency/patrolRecordView_Equipment"; - // }else{ - //生产巡检详情 - return "timeefficiency/patrolRecordView_Alarm"; - // } - } - - /** - * 获取生产巡检任务详情的统计信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getProductPatrolDetailStatistic.do") - public ModelAndView getProductPatrolDetailStatistic(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - List patrolRecordDetailStatistics = patrolRecordService.getProductPatrolDetailStatistic(patrolRecordId); - JSONArray jsonArray = JSONArray.fromObject(patrolRecordDetailStatistics); - //String result="{\"total\":"+patrolRecordDetailStatistics.size()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - - @RequestMapping("/getAllList.do") - public ModelAndView getAllList(HttpServletRequest request, Model model) { - String orderstr = " order by patrol_plan_id desc"; - - String wherestr = " where 1=1 and unit_id='" + request.getParameter("unitId") + "'"; - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and start_time >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and end_time <= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '" + request.getParameter("type") + "' "; - } - List list = this.patrolRecordService.selectListByWhere(wherestr + orderstr); - model.addAttribute("result", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - /** - * 获取巡检日历 每天的完成率、常规任务数、临时任务数 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListForCalendar.do") - public ModelAndView getListForCalendar(HttpServletRequest request, Model model) { - String wherestr = " where 1=1 and unit_id='" + request.getParameter("unitId") + "'"; - if (request.getParameter("sdt") != null && !request.getParameter("sdt").isEmpty()) { - wherestr += " and start_time >= '" + request.getParameter("sdt") + "' "; - } - if (request.getParameter("edt") != null && !request.getParameter("edt").isEmpty()) { - wherestr += " and end_time <= '" + request.getParameter("edt") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '" + request.getParameter("type") + "' "; - } - List list = this.patrolRecordService.selectListByWhereForCalendar(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/selectRecord.do") - public String selectRecord(HttpServletRequest request, Model model) { - return "timeefficiency/patrolRecordSelect"; - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - return "timeefficiency/patrolRecordAdd"; - } - - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordView"; - } - - @RequestMapping("/view_Equipment.do") - public String doview_Equipment(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordView_Equipment"; - } - - @RequestMapping("/view_Camera.do") - public String view_Camera(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordView_Camera"; - } - - @RequestMapping("/view_Safe.do") - public String view_Safe(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordView_Safe"; - } - - - /** - * 获取设备巡检任务详情的统计信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentPatrolDetailStatistic.do") - public ModelAndView getEquipmentPatrolDetailStatistic(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecordDetailStatistics patrolRecordDetailStatistics = patrolRecordService.getEquipmentPatrolDetailStatistic(patrolRecordId); - JSONArray jsonArray = JSONArray.fromObject(patrolRecordDetailStatistics); - //String result="{\"total\":"+patrolRecordDetailStatistics.size()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - /** - * 查看巡检轨迹(路线) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/viewDetial.do") - public String doviewDetial(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordViewLX"; - } - - /** - * 查看巡检轨迹(GPS) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/viewMap.do") - public String viewMap(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordViewMap_" + patrolRecord.getUnitId(); - } - - /*@RequestMapping("/viewMap.do") - public String viewMap(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/TDT_MAP_" + patrolRecord.getUnitId(); - }*/ - - /** - * 查看巡检轨迹 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/viewDetial_Equipment.do") - public String doviewDetial_Equipment(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("id"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - return "timeefficiency/patrolRecordDetailView_Equipment"; - } - - /** - * 查看巡检记录下巡检点具体内容 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/viewPatrolPointDetial.do") - public String viewPatrolPointDetial(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordPatrolPointView"; - } - - /** - * 查看设备巡检巡检记录下巡检设备具体内容 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/viewPatrolEquipmentDetail.do") - public String viewPatrolEquipmentDetail(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - model.addAttribute("patrolRecord", patrolRecord); - model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "timeefficiency/patrolRecordPatrolEquipmentView"; - } - - /** - * 巡检日历弹窗界面 - */ - @RequestMapping("/viewList.do") - public String view_List(HttpServletRequest request, Model model) { - return "timeefficiency/patrolRecordViewList"; - } - - /** - * 巡检日历弹窗界面 (异常列表) - */ - @RequestMapping("/viewAList.do") - public String viewAList(HttpServletRequest request, Model model) { - return "timeefficiency/patrolRecordViewList_abnormity"; - } - - /** - * 巡检日历弹窗界面 - */ - @RequestMapping("/viewJspList.do") - public String viewJspList(HttpServletRequest request, Model model) { - return "timeefficiency/patrolRecordViewJspList"; - } - - /** - * 获取巡检路径上的点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getRoutePoints.do") - public ModelAndView getRoutePoints(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String floorId = null; - if (request.getParameter("floorId") != null && !request.getParameter("floorId").isEmpty()) { - floorId = request.getParameter("floorId"); - } - List list = this.patrolRouteService.selectListWithRecord(patrolRecordId, floorId); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getPatrolRoutesListByPatrolRecordId.do") - public ModelAndView getPatrolRoutesListByPatrolRecordId(HttpServletRequest request, Model model, - //@RequestParam(value = "page") Integer page, - //@RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - if (sort == null || sort.equals("id")) { - sort = " "; - } - if (order == null) { - order = " desc "; - } - - String patrolRecordId = request.getParameter("patrolRecordId"); - String floorId = null; - if (request.getParameter("floorId") != null && !request.getParameter("floorId").isEmpty()) { - floorId = request.getParameter("floorId"); - } - PageHelper.startPage(pages, pagesize); - List list = this.patrolRouteService.selectListWithRecord(patrolRecordId, floorId); - - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取设备巡检记录的设备台账 - * - * @param request - * @param model - * @param sort - * @param order - * @return - */ - @RequestMapping("/getEquipmentCards.do") - public ModelAndView getEquipmentCards(HttpServletRequest request, Model model, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment - + "' and patrol_record_id = '" + request.getParameter("patrolRecordId") + "' "; - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - List list = this.patrolRecordPatrolEquipmentService.selectListByWhere(wherestr + orderstr); - Result result = Result.success(list); -// System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取视频巡检记录的摄像头 - * - * @param request - * @param model - * @param sort - * @param order - * @return - */ - @RequestMapping("/getCameras.do") - public ModelAndView getCameras(HttpServletRequest request, Model model, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where type = '" + TimeEfficiencyCommStr.PatrolEquipment_Camera - + "' and patrolrecordid = '" + request.getParameter("patrolRecordId") + "' "; - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - List list = this.patrolRecordPatrolCameraService.selectListCameraByWhere(wherestr + orderstr); - Result result = Result.success(list); -// System.out.println(CommUtil.toJson(result)); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute PatrolRecord patrolRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - patrolRecord.setId(id); - patrolRecord.setInsuser(cu.getId()); - if (patrolRecord.getInsdt() == null || patrolRecord.getInsdt().equals("")) { - patrolRecord.setInsdt(CommUtil.nowDate()); - } - patrolRecord.setStatus(PatrolRecord.Status_Issue); - if (patrolRecord.getPatrolModelId() == null || patrolRecord.getPatrolModelId().equals("")) { - patrolRecord.setPatrolModelId(TimeEfficiencyCommStr.PatrolModel_TempTask); - } - int result = this.patrolRecordService.save(patrolRecord); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PatrolRecord patrolRecord) { - int result = this.patrolRecordService.update(patrolRecord); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + patrolRecord.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.patrolRecordService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.patrolRecordService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/cancelRecord.do") - public String cancelRecord(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - List patrolPlans = patrolPlanService.selectListByWhere("where id in ('" + ids.replace(",", "','") + "')"); - String date = CommUtil.nowDate().substring(0, 10); - int result = 0; - if (patrolPlans != null && patrolPlans.size() > 0) { - if (PatrolType.Product.getId().equals(patrolPlans.get(0).getType())) { - //生产巡检 - for (PatrolPlan item : patrolPlans) { - String[] dayTime = groupManageService.getStartAndEndTime(date); - String sdt = dayTime[0]; - String edt = dayTime[1]; - result += this.patrolRecordService.cancelByWhere("where patrol_plan_id = '" + item.getId() + "' and start_time >='" + sdt + "' and end_time<='" + edt + "'"); - } - } else { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - for (PatrolPlan item : patrolPlans) { - String sdt = date; - try { - calendar.setTime(dateFormat.parse(sdt)); - calendar.add(Calendar.DAY_OF_MONTH, item.getDuration()); - } catch (ParseException e) { - e.printStackTrace(); - } - String edt = dateFormat.format(calendar.getTime()); - result += this.patrolRecordService.cancelByWhere("where patrol_plan_id = '" + item.getId() + "' and start_time >='" + sdt + "' and end_time<='" + edt + "'"); - } - } - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 选择巡检记录 - */ - @RequestMapping("/getPatrolRecordForSelect.do") - public String getPatrolRecordForSelect(HttpServletRequest request, Model model) { - List list = this.patrolRecordService.selectListByWhere("where 1=1 order by insdt desc"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolRecord.getId()); - jsonObject.put("text", patrolRecord.getName()); - jsonArray.add(jsonObject); - } - - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - /*** - * APP接口。通过巡检记录id找巡检记录详情和巡检点 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getPatrolRecordDetail4APP_Product.do") - public ModelAndView getPatrolRecordDetail4APP_Product(HttpServletRequest request,Model model) { -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String result = ""; - try{ - PatrolRecord patrolRecord = new PatrolRecord();//先定义一个空的巡检记录 - String orderstr=" order by R.floor_id asc,R.insdt asc";//巡检点sql语句 order 字符串 - - //String wherestr =" where P.[type] = '"+PatrolType.Product.getId()+"'"; - String wherestr =" where P.[type] = '"+request.getParameter("type").toString()+"'"; - if (request.getParameter("id")!=null && !request.getParameter("id").toString().isEmpty()) { - wherestr += " and R.patrol_record_id ='"+request.getParameter("id").toString()+"' "; - //巡检记录 - patrolRecord = this.patrolRecordService.selectById(request.getParameter("id").toString()); - //巡检点 - List partolPointList = this.patrolPointService.selectPointListByRecord(wherestr+orderstr); - //巡检点状态 - for(int i=0;i patrolRecordPatrolRoute = this.patrolRecordPatrolRouteService - .selectListByWhere(" where patrol_record_id = '"+request.getParameter("id")+"' and patrol_point_id = '"+partolPointList.get(i).getId()+"'"); - if(patrolRecordPatrolRoute!=null&&patrolRecordPatrolRoute.size()!=0){ - partolPointList.get(i).setStatus(patrolRecordPatrolRoute.get(0).getStatus()); - } - } - - //巡检任务设备列表(未考虑除重) - List equipmentCards = this.patrolRecordPatrolEquipmentService.getEquipmentCardsByPatrolRecordId(request.getParameter("id").toString()); - if(patrolRecord != null){ - patrolRecord.setPatrolPoint(partolPointList); - patrolRecord.setEquipmentCards(equipmentCards); - } - } - - JSONArray json1=JSONArray.fromObject(patrolRecord); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json1+"}"; - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /*** - * APP接口。通过巡检记录id找巡检记录详情和巡检点 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getPatrolRecordDetail4APP_Equipment.do") - public ModelAndView getPatrolRecordDetail4APP_Equipment(HttpServletRequest request,Model model) { -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String result = ""; - try{ - PatrolRecord patrolRecord = new PatrolRecord();//先定义一个空的巡检记录 - String orderstr=" order by start_time asc";//巡检点sql语句 order 字符串 - - if (request.getParameter("id")!=null && !request.getParameter("id").toString().isEmpty()) { - //巡检记录 - patrolRecord = this.patrolRecordService.selectById(request.getParameter("id").toString()); - //巡检点 - List partolPointList = this.patrolPlanPatrolPointService.getPatrolPointsByPatrolPlanId(patrolRecord.getPatrolPlanId()); - //巡检点状态 - - if(patrolRecord != null){ - patrolRecord.setPatrolPoint(partolPointList); - } - //List equipmentCards = this.patrolPlanPatrolEquipmentService.getEquipmentCardsByPatrolPlanId(patrolRecord.getPatrolPlanId()); - List equipmentCards = this.patrolRecordPatrolEquipmentService.getEquipmentCardsByPatrolRecordId(patrolRecord.getId()); - //巡检点状态 - - if(patrolRecord != null){ - patrolRecord.setEquipmentCards(equipmentCards); - } - } - - JSONArray json1=JSONArray.fromObject(patrolRecord); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json1+"}"; - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - /*** - * APP接口。通过巡检点找测量点(暂时未用) - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getPatrolPointMeasurePoint4APP.do") - public ModelAndView getPatrolPointMeasurePoint4APP(HttpServletRequest request,Model model) { - String result = ""; - String wherestr = " where 1=1"; - List mPoint4APP = new ArrayList(); - try{ - if (request.getParameter("unitId")!=null && !request.getParameter("unitId").toString().isEmpty()) { - if (request.getParameter("id")!=null && !request.getParameter("id").toString().isEmpty()) { - wherestr += " and patrol_point_id ='"+request.getParameter("id").toString()+"' "; - } - mPoint4APP = this.patrolPointMeasurePointService.selectMPointListByPatrolPoint(wherestr, request.getParameter("unitId").toString()); - } - - JSONArray json1=JSONArray.fromObject(mPoint4APP); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json1+"}"; - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - - /** - * APP接口。通过巡检点和巡检记录更改巡检路线和巡检点关系、巡检记录的状态 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getPatrolPointMPoint4APP.do") - public ModelAndView getPatrolPointMPoint4APP(HttpServletRequest request,Model model) { - String result = ""; - try{ - if (request.getParameter("patrolRecordId")!=null && !request.getParameter("patrolRecordId").toString().isEmpty()) { - if (request.getParameter("patrolPointId")!=null && !request.getParameter("patrolPointId").toString().isEmpty()) { - //更新巡检路线中巡检点状态 - String whereStr4Point = " where patrol_point_id = '"+request.getParameter("patrolPointId").toString()+"' and patrol_record_id = '"+request.getParameter("patrolRecordId").toString()+"'"; - PatrolRecordPatrolRoute Point = this.patrolRecordPatrolRouteService.selectListByWhere(whereStr4Point).get(0); - String floorid = Point.getFloorId(); - - String whereStr4Route = " where floor_id = '"+floorid+"' and patrol_record_id = '"+request.getParameter("patrolRecordId").toString()+"'"; - List allPoint = this.patrolRecordPatrolRouteService.selectListByWhere(whereStr4Route); - allPoint = this.patrolRouteService.sortRecord(allPoint);//排序 - int sign4Point = 0;//用于标识是否进入返回巡检点与上一个巡检点之间 0未进入 1进入 - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - //更新拐点 - for (int i=allPoint.size()-1;i>=0;i--){//倒序更新两巡检点之间的拐点 - if(sign4Point == 1){ - if(allPoint.get(i).getType().equals("1")){//进入目标的两个巡检点之间且为拐点 0巡检点 1拐点 - allPoint.get(i).setStatus(PatrolRecord.Status_Finish); - int patrolRouteTurnPointRes = this.patrolRecordPatrolRouteService.update(allPoint.get(i)); - }else{ - break; - } - } - if(allPoint.get(i).getPatrolPointId().equals(request.getParameter("patrolPointId").toString())){ - //找到所有点中拐点,并更改标识 - sign4Point = 1; - patrolRecordPatrolRoute = allPoint.get(i);//记录该点 - } - } - //之后更新巡检点 - patrolRecordPatrolRoute.setWorkerId(request.getParameter("workerId"));; - patrolRecordPatrolRoute.setFinishdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Finish); - int patrolRouteRes = this.patrolRecordPatrolRouteService.update(patrolRecordPatrolRoute); - - //判断巡检记录中所有点是否为结束,若全部为结束则更新巡检记录为结束 - //String whereStr4Select = " where patrol_record_id = '"+request.getParameter("patrolRecordId").toString()+"' and status ='"+PatrolRecord.Status_Finish+"'"; - //List patrolRecordPatrolRouteList = this.patrolRecordPatrolRouteService.selectListByWhere(whereStr4Select); - int patrolRecordRes = 0; - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setId(request.getParameter("patrolRecordId").toString()); - patrolRecord.setWorkerId(request.getParameter("workerId")); - patrolRecord.setStatus(PatrolRecord.Status_Start);// - patrolRecordRes = this.patrolRecordService.update(patrolRecord);// - - if(patrolRecordPatrolRouteList.size() == 0){ - //若结束的巡检点数量为0则更新巡检记录状态为结束 - patrolRecord.setStatus(PatrolRecord.Status_Finish); - patrolRecordRes = this.patrolRecordService.update(patrolRecord); - }else{ - //若结束的巡检点数量不为0则更新巡检记录状态为开始 - patrolRecord.setStatus(PatrolRecord.Status_Start); - patrolRecordRes = this.patrolRecordService.update(patrolRecord); - } - - //Modbus摄像头 - PatrolPoint patrolPoint = this.patrolPointService.selectById(request.getParameter("patrolPointId")); - if(patrolPoint.getModbusFigId()!=null && patrolPoint.getModbusFigId().length() > 0 ) - { - ModbusFig mf = this.modbusFigService.selectById(patrolPoint.getModbusFigId()); - short[] a =new short[] {1}; - ReadAWriteUtil.modbusWTCP(mf.getIpsever(), Integer.parseInt(mf.getPort()), Integer.parseInt(mf.getSlaveid()), Integer.parseInt(patrolPoint.getRegister()), a); - - } - - //获取测量点 - JSONArray jsonMPointM = new JSONArray(); - JSONArray jsonMPointA = new JSONArray(); - String unitId=request.getParameter("unitId"); - if (unitId!=null && !unitId.toString().isEmpty()) { - String wherestr4MP = " where patrol_point_id ='"+request.getParameter("patrolPointId").toString()+"' "; - List mPointList = this.patrolPointMeasurePointService.selectMPointListByPatrolPoint(wherestr4MP, unitId); - - List mPointListM = new ArrayList<>(); - List mPointListA = new ArrayList<>(); - for (MPoint4APP mPoint4APP : mPointList) { - if (MPoint.Flag_BizType_Hand.equals(mPoint4APP.getBiztype())) { - mPointListM.add(mPoint4APP); - }else{ - mPointListA.add(mPoint4APP); - } - } - jsonMPointM=JSONArray.fromObject(mPointListM); - jsonMPointA=JSONArray.fromObject(mPointListA); - } - - //获取文件信息 - JSONArray jsonFiles = new JSONArray(); - PatrolPoint patrolPoint = this.patrolPointService.selectById(request.getParameter("patrolPointId").toString()); - if(patrolPoint.getFiles()!=null && patrolPoint.getFiles().size()>0){ - Iterator iterator =patrolPoint.getFiles().iterator(); - while (iterator.hasNext()) { - CommonFile commonFile =iterator.next(); - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", commonFile.getId()); - jsonObject.put("name", commonFile.getFilename()); - jsonFiles.add(jsonObject); - } - } - - //判断是否都更新完毕 返回测量点 - if(patrolRouteRes>0&&patrolRecordRes>0){ - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+jsonMPointM+",\"content2\":"+jsonMPointA+",\"content3\":"+jsonFiles+"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - } - else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * APP接口。提交巡检点下测量点结果 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/updateMpointValue.do") - public ModelAndView updateMpointValue(HttpServletRequest request,Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "mpointId") String mpointId, - @RequestParam(value = "value") double value) { - User cu= (User)request.getSession().getAttribute("cu"); - String result = ""; - MPoint mPoint = new MPoint(); - mPoint.setId(mpointId); - mPoint.setParmvalue(BigDecimal.valueOf(value)); - String nowDate = CommUtil.nowDate(); - mPoint.setMeasuredt(nowDate); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowDate); - mPointHistory.setInsdt(nowDate); - mPointHistory.setParmvalue(BigDecimal.valueOf(value)); - mPointHistory.setUserid(cu.getId()); - try{ - if (request.getParameter("patrolRecordId")!=null && !request.getParameter("patrolRecordId").toString().isEmpty()) { - mPointHistory.setPatrolrecordid(request.getParameter("patrolRecordId")); - } - if (request.getParameter("patrolPointId")!=null && !request.getParameter("patrolPointId").toString().isEmpty()) { - mPointHistory.setPatrolpointid(request.getParameter("patrolPointId")); - } - int res = mPointService.updateValue(bizId, mPoint, mPointHistory); - if(res==1){ - result="{\"status\":\""+CommString.Status_Pass+"\"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * APP接口。提交巡检点下测量点结果 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/updateMpointValueByJson.do") - public ModelAndView updateMpointValueByJson(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "json") String json) { - User cu= (User)request.getSession().getAttribute("cu"); - String result = ""; - try{ -// org.json.JSONObject jsonObject = new org.json.JSONObject(data); -// org.json.JSONArray jsonArray = new org.json.JSONArray(jsonObject.getString("re1")); - JSONObject jsonobject = JSONObject.fromObject(json);//将json格式的字符串转换成JSONObject 对象 - JSONArray jsonArray = jsonobject.getJSONArray("re1"); //如果json格式的字符串里含有数组格式的属性,将其转换成JSONArray,以方便后面转换成对应的实体 - List mPointList = new ArrayList(); - List mPointHistoryList = new ArrayList(); - for(int i=0;i patrolRecordPatrolEquipment = this - .patrolRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '"+request.getParameter("patrolRecordId").toString()+"' and equipment_id = '"+request.getParameter("equipmentId")+"'"); - if(patrolRecordPatrolEquipment!=null&&patrolRecordPatrolEquipment.size()!=0){ - patrolRecordPatrolEquipment.get(0).setEquipmentId(request.getParameter("equipmentId")); - patrolRecordPatrolEquipment.get(0).setPatrolRecordId(request.getParameter("patrolRecordId").toString()); - patrolRecordPatrolEquipment.get(0).setStatus(PatrolRecord.Status_Finish); - equRes=this.patrolRecordPatrolEquipmentService.update(patrolRecordPatrolEquipment.get(0)); - } - }else{ - equRes=1; - } - } - int res = 0; - if(equRes != 0){ - res =mPointService.updateValue(unitId, mPointList, mPointHistoryList); - } - if(res==1){ - result="{\"status\":\""+CommString.Status_Pass+"\"}"; - }else if(jsonArray.size()==0 && res == 0){ - result="{\"status\":\""+CommString.Status_Pass+"\"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - System.out.println(e); - } -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * 导出excel表 - * - * @throws IOException - */ - @RequestMapping(value = "downloadExcel.do") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "companyId") String companyId) throws IOException { - String wherestr = " where 1=1 and biz_id='" + companyId + "' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '" + request.getParameter("type") + "' "; - } - List patrolRecord = this.patrolRecordService.selectListByWhere(wherestr); - //导出文件到指定目录,兼容Linux - this.patrolRecordService.downloadExcel(response, patrolRecord); - return null; - } - - /** - * 更新设备巡检中巡检设备详情 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/updatePatrolRecordPatrolEquipment.do") - public ModelAndView updatePatrolRecordPatrolEquipment(HttpServletRequest request,Model model, - @RequestParam(value = "patrolRecordId") String patrolRecordId, - @RequestParam(value = "equipmentId") String equipmentId, - //@RequestParam(value = "updatedt") String updatedt, - @RequestParam(value = "runningStatus") String runningStatus, - @RequestParam(value = "equipmentStatus") String equipmentStatus, - @RequestParam(value = "remark") String remark) { - String result=""; - User cu= (User)request.getSession().getAttribute("cu"); - List patrolRecordPatrolEquipments = this.patrolRecordPatrolEquipmentService - .selectListByWhere("where patrol_record_id ='"+patrolRecordId+"' and equipment_id='"+equipmentId+"' "); - try{ - if(patrolRecordPatrolEquipments!=null && patrolRecordPatrolEquipments.size()>0){ - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment=patrolRecordPatrolEquipments.get(0); - patrolRecordPatrolEquipment.setEquipmentId(equipmentId); - patrolRecordPatrolEquipment.setUpdateuser(cu.getId()); - patrolRecordPatrolEquipment.setUpdatedt(CommUtil.nowDate()); - patrolRecordPatrolEquipment.setRunningStatus(runningStatus); - patrolRecordPatrolEquipment.setEquipmentStatus(equipmentStatus); - //patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Finish); - patrolRecordPatrolEquipment.setRemark(remark); - int res = patrolRecordPatrolEquipmentService.update(patrolRecordPatrolEquipment); - - //更新设备卡片中的状态 目前没有判断成功标识 - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setId(patrolRecordPatrolEquipment.getEquipmentId()); - equipmentCard.setEquipmentstatus(equipmentStatus); - this.equipmentCardService.update(equipmentCard); - if(res==1){ - result="{\"status\":\""+CommString.Status_Pass+"\"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /*** - * APP接口。通过人员id寻找厂下或者同组人员信息list以及其他人员最近一次巡检点 - * @param request - * @param model - * @return - */ - /*@RequestMapping("/getOtherPatrolUsers.do") - public ModelAndView getOtherPatrolUsers(HttpServletRequest request,Model model) { - String result = ""; - String wherestr = " where 1=1"; - List otherUsers = new ArrayList(); - try{ - if (request.getParameter("userId")!=null && !request.getParameter("userId").toString().isEmpty()) { - User user = this.userService.getUserById(request.getParameter("userId")); - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(user.getPid()); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and pid in ("+companyids+") "; - } - otherUsers = this.userService.selectListByWhere(wherestr); - - //获取这些人员最近一次出现的巡检点(先找记录和巡检点或者巡检路线关系表) - for(int i=0;i equPatrolPoints = this.patrolRecordPatrolPointService.selectListByWhere(" where worker_id = '"+otherUsers.get(i).getId()+"' order by finishdt desc"); - //生产巡检点 - List producePatrolPoints = this.patrolRecordPatrolRouteService.selectListByWhere(" where worker_id = '"+otherUsers.get(i).getId()+"' order by finishdt desc"); - //对比 - try{ - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if(equPatrolPoints==null || equPatrolPoints.size()==0 || equPatrolPoints.get(0).getFinishdt().equals("")){ - //没有设备的巡检点取生产巡检点 - PatrolPoint patrolPoint = this.patrolPointService.selectById(producePatrolPoints.get(0).getPatrolPointId()); - otherUsers.get(i).setLastPatrolPoint(patrolPoint); - otherUsers.get(i).setLastPatrolTime(producePatrolPoints.get(0).getFinishdt()); - }else if (producePatrolPoints==null || equPatrolPoints.size()==0 || producePatrolPoints.get(0).getFinishdt().equals("")){ - //没有生产的取设备巡检点 - PatrolPoint patrolPoint = this.patrolPointService.selectById(equPatrolPoints.get(0).getPatrolPointId()); - otherUsers.get(i).setLastPatrolPoint(patrolPoint); - otherUsers.get(i).setLastPatrolTime(equPatrolPoints.get(0).getFinishdt()); - }else{ - Date equDate=sdf.parse(equPatrolPoints.get(0).getFinishdt()); - Date produceDate=sdf.parse(producePatrolPoints.get(0).getFinishdt()); - if(equDate.compareTo(produceDate)>=0){ - //前大于等于后 取前 - PatrolPoint patrolPoint = this.patrolPointService.selectById(equPatrolPoints.get(0).getPatrolPointId()); - otherUsers.get(i).setLastPatrolPoint(patrolPoint); - otherUsers.get(i).setLastPatrolTime(equPatrolPoints.get(0).getFinishdt()); - }else{ - //前小于后 取后 - PatrolPoint patrolPoint = this.patrolPointService.selectById(producePatrolPoints.get(0).getPatrolPointId()); - otherUsers.get(i).setLastPatrolPoint(patrolPoint); - otherUsers.get(i).setLastPatrolTime(producePatrolPoints.get(0).getFinishdt()); - } - } - }catch(Exception e){ - System.out.println(e); - } - } - } - - JSONArray json1=JSONArray.fromObject(otherUsers); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json1+"}"; - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - //System.out.println(e); - } - -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - @ApiOperation(value = "巡检日历--根据指定日期获取当天任务详情", notes = "巡检日历--根据指定日期获取当天任务详情 sj 2020-04-26 bootstrap + vue + gis 使用 (暂时去掉get请求类型的限制,gis用的是post请求)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "巡检类型 E or P", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolDate", value = "日期,yyyy-MM-dd", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolPlanIds", value = "有些需要仅查关联任务的id 可以传patrolPlanIds进行筛选", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "groupTypeId", value = "班组id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/getPatrolRecordByDay.do") - public String getPatrolRecordByDay(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate, - @RequestParam(value = "patrolPlanIds", required = false) String patrolPlanIds, - @RequestParam(value = "groupTypeId", required = false) String groupTypeId) { - String whereStr = " where unit_id='" + unitId + "' and type='" + type + "' and DateDiff(dd,start_time,'" + patrolDate + "')=0 "; - String orderStr = " order by start_time asc"; - - //有些需要仅查关联任务的id 可以传patrolPlanIds进行筛选 - if (patrolPlanIds != null && !patrolPlanIds.equals("")) { - String[] patrolPlanId = patrolPlanIds.split(","); - String ids = ""; - if (patrolPlanId != null) { - for (int i = 0; i < patrolPlanId.length; i++) { - ids += "'" + patrolPlanId[i] + "',"; - } - ids = ids.substring(0, ids.length() - 1); - } - whereStr += " and patrol_plan_id in (" + ids + ") "; - } - - List list = patrolRecordService.selectListAndASumByWhere(whereStr + orderStr, patrolDate); - - //进行班组筛选 - if (groupTypeId != null && !groupTypeId.equals("")) { - Iterator iterator = list.listIterator(); - while (iterator.hasNext()) { - PatrolRecord patrolRecord = iterator.next(); -// PatrolPlan patrolPlan = patrolPlanService.selectSimpleById(patrolRecord.getPatrolPlanId()); - if (patrolRecord != null && patrolRecord.getGroupTypeId() != null && patrolRecord.getGroupTypeId().equals(groupTypeId)) { - //保留 - } else { - //去除不是该班组的任务 - iterator.remove(); - } - } - } - - Result result = Result.success(list); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getPatrolRecordByDayForCameraJsp.do") - public String getPatrolRecordByDayForCameraJsp(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate, - @RequestParam(value = "pointCode") String pointCode) { - String patrolPlanIds = ""; - List patrolPointlist = patrolPointService.selectListByWhere(" where active='" + CommString.Active_True + "' and type='" + TimeEfficiencyCommStr.PatrolType_Camera + "' and point_code='" + pointCode + "' "); - if (patrolPointlist != null && patrolPointlist.size() > 0) { - List patrolRoutelist = patrolRouteService.selectListByWhere(" where patrol_point_id='" + patrolPointlist.get(0).getId() + "' "); - if (patrolRoutelist != null && patrolRoutelist.size() > 0) { - for (PatrolRoute patrolRoute : - patrolRoutelist) { - patrolPlanIds += patrolRoute.getPatrolPlanId() + ","; - } - } - } - - patrolPlanIds = patrolPlanIds.replace(",", "','"); - - String wherestr = " where unit_id='" + unitId + "' and type='" + type + "' and DateDiff(dd,start_time,'" + patrolDate + "')=0 and patrol_plan_id in ('" + patrolPlanIds + "') " - + " order by start_time asc"; - List list = patrolRecordService.selectListByWhere(wherestr); - Result result = Result.success(list); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 巡检总览---根据指定日期获取当天巡检情况 (完成率,总数,计划数,临时数,正在进行中,未完成,完成数) sj 2020-04-26 - * - * @param request - * @param model - * @param unitId 部门id - * @param dateType 日期类型 year month - * @param type 巡检类型 - * @param patrolDate 巡检日期 - * @return - */ - @ApiOperation(value = "巡检总览---巡检任务数接口", notes = "巡检总览---巡检任务数接口 (完成率,总数,计划数,临时数,正在进行中,未完成,完成数) sj 2020-04-26", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "type", value = "P or E", dataType = "String", paramType = "query", defaultValue = "P", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getPatrolRecordDetailsByDay.do", method = RequestMethod.GET) - public String getPatrolRecordDetailsByDay(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - String wherestr = " where type='" + type + "' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0"; - JSONArray jsonArray = patrolRecordService.getPatrolRecordDetailsByDay(wherestr, unitId); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 巡检总览---获取异常数和异常工单数 sj 2023-02-10 - * - * @param request - * @param model - * @param unitId 部门id - * @param dateType 日期类型 year month - * @param patrolDate 巡检日期 - * @return - */ - @ApiOperation(value = "巡检总览---获取异常数和异常工单数", notes = "巡检总览---获取异常数和异常工单数 sj 2023-02-10", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "筛选日期:year or month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getPatrolRecordAbnormityNum.do", method = RequestMethod.GET) - public String getPatrolRecordAbnormityNum(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - com.alibaba.fastjson.JSONObject jsonObject = patrolRecordService.getPatrolRecordAbnormityNum(unitId, dateType, patrolDate); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 根据指定日期获取临时任务 --巡检总览 sj 2020-04-26 (2020-09-25 sj 此方法因无分页弃用,白龙港目前还在用,待换成 getPatrolRecordTempTask_new 方法) - * - * @param request - * @param model - * @param unitId 部门id - * @param type 巡检类型 - * @param patrolDate 巡检日期 - * @return - */ - @RequestMapping("/getPatrolRecordTempTask.do") - public String getPatrolRecordTempTask(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - /*String wherestr = " where type='"+type+"' and DateDiff("+dateTypeStr+",start_time,'"+patrolDate+"')=0 " - + "and patrol_model_id='"+TimeEfficiencyCommStr.PatrolModel_TempTask+"' ";*/ - String wherestr = " where type='P' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0 " - + "and patrol_model_id='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' "; - List list = patrolRecordService.getPatrolRecordByTask(wherestr, unitId); - Result result = Result.success(list); - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 根据指定日期获取临时任务 --巡检总览 sj 2020-09-25 - * - * @param request - * @param model - * @param unitId 部门id - * @param type 巡检类型 - * @param patrolDate 巡检日期 - * @return - */ - @RequestMapping("/getPatrolRecordTempTask_new.do") - public String getPatrolRecordTempTask_new(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - /*String wherestr = " where type='"+type+"' and DateDiff("+dateTypeStr+",start_time,'"+patrolDate+"')=0 " - + "and patrol_model_id='"+TimeEfficiencyCommStr.PatrolModel_TempTask+"' ";*/ - String wherestr = " where type='P' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0 " - + "and patrol_model_id='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' "; - - List list = patrolRecordService.getPatrolRecordByTask(wherestr, unitId); - - String ids = ""; - for (PatrolRecord patrolRecord : list) { - ids += "'" + patrolRecord.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } else { - ids = "'无'"; - } - - PageHelper.startPage(page, rows); - List list2 = patrolRecordService.selectListByWhere("where id in (" + ids + ") order by start_time"); - PageInfo pi = new PageInfo(list2); - JSONArray json = JSONArray.fromObject(list2); - //System.out.println(pi.getTotal()); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - - model.addAttribute("result", result); - return "result"; - } - - /** - * 根据指定日期获取任务统计趋势图 --巡检总览 sj 2020-04-27 - * - * @param request - * @param model - * @param unitId - * @param dateType - * @param patrolDate - * @return - */ - @RequestMapping("/getPatrolRecordNum.do") - public String getPatrolRecordNum(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - String wherestr = ""; - JSONArray jsonArray = patrolRecordService.selectListByNum(wherestr, unitId, dateType, patrolDate); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 巡检总览---各类任务数折线图数据 - * - * @param request - * @param model - * @param unitId - * @param dateType - * @param patrolDate - * @return - */ - @ApiOperation(value = "巡检总览---各类任务数折线图数据", notes = "巡检总览---各类任务数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "type", value = "P or E", dataType = "String", paramType = "query", defaultValue = "P", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getPatrolRecordChartData.do", method = RequestMethod.GET) - public String getPatrolRecordChartData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONArray jsonArray = patrolRecordService.selectListByNum2(unitId, dateType, patrolDate, type); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 根据指定日期获取任务统计趋势图 -- 巡检异常上报 - * - * @param request - * @param model - * @param unitId - * @param dateType - * @param patrolDate - * @return - */ - @ApiOperation(value = "巡检总览---巡检异常上报曲线", notes = "巡检总览---根据指定日期获取任务统计趋势图 -- 巡检异常上报", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getPatrolRecordAbnormityChart.do", method = RequestMethod.GET) - public String getPatrolRecordAbnormityChart(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONArray jsonArray = abnormityService.selectListByNum("", unitId, dateType, patrolDate, ""); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 根据指定日期获取任务统计趋势图 -- 异常工单 - * - * @param request - * @param model - * @param unitId - * @param dateType - * @param patrolDate - * @return - */ - @ApiOperation(value = "巡检总览---异常工单曲线", notes = "巡检总览---根据指定日期获取任务统计趋势图 -- 异常工单", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getPatrolRecordWorkorderChart.do", method = RequestMethod.GET) - public String getPatrolRecordWorkorderChart(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - - JSONArray jsonArray = patrolRecordService.selectListByNum3("", unitId, dateType, patrolDate); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 通过patrolRecordId查找水厂Company对象 - * author:YYJ - */ - @RequestMapping("/getParentBizByPatrolRecordId.do") - public String getParentBizByPatrolRecordId(HttpServletRequest request, Model model) { - Company company = new Company(); - try { - String patrolRecordId = request.getParameter("patrolRecordId"); - //巡检记录对象 - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - //通过巡检记录找到巡检计划,确定属于哪一个unit -// PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolRecord.getPatrolPlanId()); -// String unitId = patrolPlan.getUnitId(); - String unitId = patrolRecord.getUnitId(); - Unit unit = unitService.getUnitById(unitId); - //通过unitId寻找水厂经纬度 - if (!unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { - if (!unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { - String bizId = unitService.getParentBizByUnitId(unit.getId()).getId(); - company = this.unitService.getCompById(bizId); - } - } else { - company = this.unitService.getCompById(unitId); - } - } catch (Exception e) { - System.out.println(e); - } - Result result = Result.success(company); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 通过patrolRecordId查找该记录的巡检点对象经纬度数组 - * author:YYJ - */ - @RequestMapping("/getPatorlPointsByPatrolRecordId.do") - public String getPatorlPointsByPatrolRecordId(HttpServletRequest request, Model model) { - List patrolPoints = new ArrayList(); - try { - String patrolRecordId = request.getParameter("patrolRecordId"); - //获取巡检记录巡检路线 - List patrolRecordPatrolRoute = this.patrolRecordPatrolRouteService.selectListByWhere(" where patrol_record_id = '" + patrolRecordId + "'"); - //获取巡检记录巡检路线上的巡检点 - String patrolPointIds = ""; - for (int i = 0; i < patrolRecordPatrolRoute.size(); i++) { - if (i == 0) { - patrolPointIds = patrolRecordPatrolRoute.get(i).getPatrolPointId(); - } else { - patrolPointIds += "','" + patrolRecordPatrolRoute.get(i).getPatrolPointId(); - } - } - patrolPoints = this.patrolPointService.selectListByWhere(" where id in ('" + patrolPointIds + "')"); - } catch (Exception e) { - System.out.println(e); - } - Result result = Result.success(patrolPoints); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 根据巡检总览--左上角巡检情况 点击5个数字弹出对应的记录列表 - * - * @param request - * @param model - * @param unitId - * @param dateType - * @param type - * @param patrolDate - * @return - */ - @RequestMapping("/getPatrolRecordByStatus.do") - public String getPatrolRecordByStatus(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate, - @RequestParam(value = "st") String st) {//分别对应的:计划-临时-未开始-进行中-完成 - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - String wherestr = " where type='" + type + "' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0"; - //JSONArray jsonArray = patrolRecordService.getPatrolRecordDetailsByDay(wherestr,unitId); - List list = patrolRecordService.getPatrolRecordByStatus(wherestr, unitId, st); - Result result = Result.success(list); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "APP获取巡检任务接口(运行和设备)", notes = "APP接口,通过userid和bizid获取巡检记录", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "运行还是设备巡检 P/E", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "unitId", value = "厂Id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "userIds", value = "巡检人员id 还包含顶班人员id 如张三定了李四的班 那userid为 张三id,李四id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "areaId", value = "区域Id 用于app根据区域id进行筛选", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping("/getPatrolRecord4APP.do") - public ModelAndView getPatrolRecord4APP(HttpServletRequest request, Model model, - @RequestParam(value = "type", required = true) String type, - @RequestParam(value = "unitId", required = true) String unitId, - @RequestParam(value = "userIds", required = true) String userIds, - @RequestParam(value = "areaId", required = false) String areaId) { - //老版本app传的是 userId - String userId = request.getParameter("userId"); - if (userIds == null || userIds.equals("")) { - userIds = userId; - } - - String orderstr = " order by start_time asc"; - //之前仅获取当天巡检任务 - //String wherestr = " where DateDiff(dd,start_time,getdate())=0 and unit_id = '" + unitId + "'"; - //改为获取巡检任务 开始到结束日期 之前的任务 - String wherestr = " where unit_id = '" + unitId + "' and start_time<='" + CommUtil.nowDate().substring(0, 10) + " 23:59:59' and '" + CommUtil.nowDate().substring(0, 10) + " 00:00:00' <=end_time"; - String result = null; - - if (areaId != null && !areaId.trim().equals("")) { - wherestr += " and patrol_area_id like '" + areaId + "'"; - } - - Set set = new HashSet(); - if (userIds != null && !userIds.trim().equals("")) { - String[] userid = userIds.split(","); - for (int i = 0; i < userid.length; i++) { - Set set2 = patrolRecordService.selectListByUserId(userid[i], wherestr, orderstr, unitId, type); - Iterator it = set2.iterator(); - while (it.hasNext()) { - String str = it.next(); - set.add(str); - } - } - } - - int allNum = 0;//所有巡检数 - int inCompleteNum = 0;//未完成巡检数 - int completeNum = 0;//已完成巡检数 - JSONArray json = null; - - String patrolRecordIds = ""; - Iterator it = set.iterator(); - while (it.hasNext()) { - patrolRecordIds += "'" + it.next() + "',"; - } - - if (patrolRecordIds != null && !patrolRecordIds.trim().equals("")) { - patrolRecordIds = patrolRecordIds.substring(0, patrolRecordIds.length() - 1); - } else { - patrolRecordIds = "'false'"; - } - - try { - String where2 = "where id in (" + patrolRecordIds + ")"; - List list_task = this.patrolRecordService.selectSimpleListByWhere(where2 + orderstr); - - //查询并赋值 区域 名称 - for (PatrolRecord patrolRecord : list_task) { - String areaName = ""; - PatrolPlan patrolPlan = patrolPlanService.selectById(patrolRecord.getPatrolPlanId()); - if (patrolPlan != null) { - if (patrolPlan.getPatrolAreaId() != null && !patrolPlan.getPatrolAreaId().equals("")) { - String[] areaIds = patrolPlan.getPatrolAreaId().split(","); - for (String s : areaIds) { - PatrolArea patrolArea = patrolAreaService.selectById(s); - if (patrolArea != null) { - areaName += patrolArea.getName() + ","; - } - } - } - if (areaName != null && !areaName.equals("")) { - areaName = areaName.substring(0, areaName.length() - 1); - } - patrolRecord.setPatrolAreaName(areaName); - } else { - //巡检计划已经删除 无法查找区域 - } - } - - if (list_task != null && list_task.size() > 0) { - allNum = list_task.size(); - json = JSONArray.fromObject(list_task); - } - - List listincomplete = this.patrolRecordService.selectSimpleListByWhere(where2 + " and (status='" + PatrolRecord.Status_Issue + "' or status='" + PatrolRecord.Status_Start + "')"); - - List listcomplete = this.patrolRecordService.selectSimpleListByWhere(where2 + " and (status='" + PatrolRecord.Status_Finish + "' or status='" + PatrolRecord.Status_PartFinish + "' or status='" + PatrolRecord.Status_Undo + "')"); - - if (listincomplete != null) { - inCompleteNum = listincomplete.size(); - } - if (listcomplete != null) { - completeNum = listcomplete.size(); - } - - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + ",\"allNum\":\"" + allNum + "\",\"inCompleteNum\":\"" + inCompleteNum + "\",\"completeNum\":\"" + completeNum + "\"}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @ApiOperation(value = "APP获取巡检任务接口(安全任务)", notes = "APP接口,通过userid和bizid获取巡检记录", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "固定传S", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "unitId", value = "厂Id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "userIds", value = "巡检人员id 还包含顶班人员id 如张三定了李四的班 那userid为 张三id,李四id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "areaId", value = "区域Id 用于app根据区域id进行筛选", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping("/getPatrolRecord4APPSafe.do") - public ModelAndView getPatrolRecord4APPSafe(HttpServletRequest request, Model model, - @RequestParam(value = "type", required = true) String type, - @RequestParam(value = "unitId", required = true) String unitId, - @RequestParam(value = "userIds", required = true) String userIds, - @RequestParam(value = "areaId", required = false) String areaId) { - //老版本app传的是 userId - String userId = request.getParameter("userId"); - if (userIds == null || userIds.equals("")) { - userIds = userId; - } - - String orderstr = " order by start_time desc"; - //改为获取巡检任务 开始到结束日期 之前的任务 -// String wherestr = " where unit_id = '" + unitId + "' and start_time<='" + CommUtil.nowDate().substring(0, 10) + " 23:59:59' and '" + CommUtil.nowDate().substring(0, 10) + " 00:00:00' <=end_time"; - //只查开始时间到今天365天内的数据 - String wherestr = " where unit_id = '" + unitId + "' and DATEDIFF(dd,start_time,GETDATE())<365"; - String result = null; - - if (areaId != null && !areaId.trim().equals("")) { - wherestr += " and patrol_area_id like '" + areaId + "'"; - } - - Set set = new HashSet(); - if (userIds != null && !userIds.trim().equals("")) { - String[] userid = userIds.split(","); - for (int i = 0; i < userid.length; i++) { - Set set2 = patrolRecordService.selectListByUserIdSafe(userid[i], wherestr, orderstr, unitId, type); - Iterator it = set2.iterator(); - while (it.hasNext()) { - String str = it.next(); - set.add(str); - } - } - } - - int allNum = 0;//所有巡检数 - int executingNum = 0;//未完成巡检数(未过期) - int expiredNum = 0;//未完成巡检数(已过期) - int completeNum = 0;//已完成巡检数 - JSONArray json = null; - - String patrolRecordIds = ""; - Iterator it = set.iterator(); - while (it.hasNext()) { - patrolRecordIds += "'" + it.next() + "',"; - } - - if (patrolRecordIds != null && !patrolRecordIds.trim().equals("")) { - patrolRecordIds = patrolRecordIds.substring(0, patrolRecordIds.length() - 1); - } else { - patrolRecordIds = "'false'"; - } - - try { - String where2 = "where id in (" + patrolRecordIds + ") and DATEDIFF(dd,start_time,GETDATE())<365"; - List list_task = this.patrolRecordService.selectListByWhere(where2 + orderstr); - - if (list_task != null && list_task.size() > 0) { - allNum = list_task.size(); - json = JSONArray.fromObject(list_task); - } - - //执行中(未过期) - List list_executing = this.patrolRecordService.selectListByWhere(where2 + " and DATEDIFF(dd,start_time,GETDATE())<365 and (status='" + PatrolRecord.Status_Issue + "' or status='" + PatrolRecord.Status_Start + "') and start_time<='" + CommUtil.nowDate() + "' and '" + CommUtil.nowDate() + "'<=end_time"); - //未完成(已过期) - List list_expired = this.patrolRecordService.selectListByWhere(where2 + " and DATEDIFF(dd,start_time,GETDATE())<365 and (status='" + PatrolRecord.Status_Issue + "' or status='" + PatrolRecord.Status_Start + "') and end_time<='" + CommUtil.nowDate() + "'"); - //已完成 - List list_complete = this.patrolRecordService.selectListByWhere(where2 + " and DATEDIFF(dd,start_time,GETDATE())<365 and (status='" + PatrolRecord.Status_Finish + "' or status='" + PatrolRecord.Status_PartFinish + "' or status='" + PatrolRecord.Status_Undo + "')"); - - if (list_executing != null) { - executingNum = list_executing.size(); - } - if (list_expired != null) { - expiredNum = list_expired.size(); - } - if (list_complete != null) { - completeNum = list_complete.size(); - } - - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + ",\"allNum\":\"" + allNum + "\",\"executingNum\":\"" + executingNum + "\",\"expiredNum\":\"" + expiredNum + "\",\"completeNum\":\"" + completeNum + "\"}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 根据已有任务 获取里面的区域下拉数据 (用于app任务列表筛选) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolArea4User.do") - public ModelAndView getPatrolArea4User(HttpServletRequest request, Model model) { - String type = request.getParameter("type");//运行还是设备巡检 P/E - String unitId = request.getParameter("unitId"); - String userIds = request.getParameter("userIds");//巡检人员id 还包含顶班人员id 如张三定了李四的班 那userid为 张三id,李四id - - //老版本app传的是 userId - String userId = request.getParameter("userId"); - if (userIds == null || userIds.equals("")) { - userIds = userId; - } - - String orderstr = " order by start_time asc"; - String wherestr = " where DateDiff(dd,start_time,getdate())=0 and unit_id = '" + unitId + "'"; - String result = null; - - /*Set set = new HashSet(); - if (userIds != null && !userIds.trim().equals("")) { - String[] userid = userIds.split(","); - for (int i = 0; i < userid.length; i++) { - System.out.println(userid[i]); - Set set2 = patrolRecordService.selectListByUserId(userid[i], wherestr, orderstr, unitId, type); - Iterator it = set2.iterator(); - while (it.hasNext()) { - String str = it.next(); - set.add(str); - } - } - } - - String patrolRecordIds = ""; - Iterator it = set.iterator(); - while (it.hasNext()) { - patrolRecordIds += "'" + it.next() + "',"; - } - - if (patrolRecordIds != null && !patrolRecordIds.trim().equals("")) { - patrolRecordIds = patrolRecordIds.substring(0, patrolRecordIds.length() - 1); - } else { - patrolRecordIds = "'false'"; - }*/ - - try { -// String where2 = "where id in (" + patrolRecordIds + ")"; - String where2 = wherestr; - List list_task = this.patrolRecordService.selectListByWhere(where2 + orderstr); - - Map map = new HashMap<>(); - //查询并赋值 区域 名称 - for (PatrolRecord patrolRecord : list_task) { - String areaName = ""; - PatrolPlan patrolPlan = patrolPlanService.selectById(patrolRecord.getPatrolPlanId()); - if (patrolPlan.getPatrolAreaId() != null && !patrolPlan.getPatrolAreaId().equals("")) { - String[] areaIds = patrolPlan.getPatrolAreaId().split(","); - for (String s : areaIds) { - PatrolArea patrolArea = patrolAreaService.selectById(s); - if (patrolArea != null) { - map.put(patrolArea.getId(), patrolArea.getName()); - } - } - } - } - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - for (String key : map.keySet()) {//keySet获取map集合key的集合 然后在遍历key即可 - String value = map.get(key).toString();// - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("id", key); - jsonObject.put("name", value); - jsonArray.add(jsonObject); - } - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"json\":" + jsonArray + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - - } - - /** - * APP接口。提交任务下巡检点 - * (弃用,暂时用 timeEfficiency/patrolRecord/subPatrolPoint4APP.do ) - * 金山现场还在用 2023-07-26 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updatePatrolPointByAPP.do") - public ModelAndView updatePatrolPointByAPP(HttpServletRequest request, Model model) { - Result result = null; - String id = request.getParameter("id"); - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - Boolean isLimited = Boolean.valueOf(request.getParameter("isLimited")); - if (isLimited != null && !isLimited.equals("")) { - if (isLimited) { - //需要判断时间 - PatrolRecord patrolRecord = patrolRecordService.selectById(patrolRecordId); - if (patrolRecord != null) { - // 0为范围内 1为范围外 - int timeInt = CommUtil.compare_time(patrolRecord.getStartTime(), patrolRecord.getEndTime(), CommUtil.nowDate()); - if (timeInt == 0) { - //范围内 继续 -// System.out.println("范围内"); - } - if (timeInt == 1) { - //范围外 - result = Result.failed("不在时间内"); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - } - } - } - - try { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = patrolRecordPatrolRouteService.selectById(id); - if (id != null && !id.toString().isEmpty()) { - patrolRecordPatrolRoute.setId(id.toString()); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Finish); - } - int res = this.patrolRecordPatrolRouteService.update(patrolRecordPatrolRoute); - if (res == 1) { - //提交巡检点的时候 重新计算巡检点下 巡检内容及填报内容 完成数 sj 2020-05-07 - patrolRecordPatrolRouteService.updateNum(patrolRecordPatrolRoute); - result = Result.success(res); - } else { - result = Result.failed(""); - } - } catch (Exception e) { - result = Result.failed(""); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * APP接口。提交任务下巡检点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updatePatrolPoint4GIS.do") - public ModelAndView updatePatrolPoint4GIS(HttpServletRequest request, Model model) { - Result result = null; - String patrolRecordId = request.getParameter("patrolRecordId");//巡检记录id - String patrolPointId = request.getParameter("patrolPointId");//巡检点id - String userId = request.getParameter("userId");//人员id - - try { - String sql = "where 1=1 and patrol_record_id = '" + patrolRecordId + "' and patrol_point_id = '" + patrolPointId + "'"; - List list = patrolRecordPatrolRouteService.selectListByWhere(sql); - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - if (list != null && list.size() > 0) { - patrolRecordPatrolRoute.setId(list.get(0).getId()); - patrolRecordPatrolRoute.setWorkerId(userId); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Finish); - patrolRecordPatrolRoute.setFinishdt(CommUtil.nowDate()); - } - int res = this.patrolRecordPatrolRouteService.update(patrolRecordPatrolRoute); - if (res == 1) { - //提交巡检点的时候 重新计算巡检点下 巡检内容及填报内容 完成数 sj 2020-05-07 - patrolRecordPatrolRouteService.updateNum(patrolRecordPatrolRoute); - result = Result.success(res); - } else { - result = Result.failed(""); - } - } catch (Exception e) { - result = Result.failed(""); - } - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * APP接口。提交任务 (根据任务下巡检点完成情况判断为完成还是部分完成) - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "手动刷新巡检任务下 巡检点打卡完成情况", notes = "手动刷新巡检任务下 巡检点打卡完成情况", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "记录主表id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "workerId", value = "巡检人员id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "workResult", value = "巡检结果", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "json", value = "gps-json", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/updatePatrolRecordByAPP.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView updatePatrolRecordByAPP(HttpServletRequest request, Model model) { - String id = request.getParameter("id");//记录主表id - String workResult = request.getParameter("workResult");//巡检结果 - String workerId = request.getParameter("workerId");//巡检人员id - String receiveUserId = request.getParameter("receiveUserId");//巡检人员id - String isStart = request.getParameter("isStart");// 不为空则启动流程 - System.out.println("isStart======" + isStart); - String json = request.getParameter("json");//gps-json - Boolean isLimited = Boolean.valueOf(request.getParameter("isLimited"));///是否 判断时间 true判断 false不判断 - Result result = null; - if (isLimited != null && !isLimited.equals("")) { - if (isLimited) { - //需要判断时间 - PatrolRecord patrolRecord = patrolRecordService.selectById(id); - if (patrolRecord != null) { - // 0为范围内 1为范围外 - int timeInt = CommUtil.compare_time(patrolRecord.getStartTime(), patrolRecord.getEndTime(), CommUtil.nowDate()); - if (timeInt == 0) { - //范围内 继续 - } - if (timeInt == 1) { - //范围外 - result = Result.failed("不在时间内"); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - } - } else { - //不需要判断时间 继续 - } - } else { - //不需要判断时间 继续 - } - try { - PatrolRecord patrolRecord = patrolRecordService.selectById(id); - if (patrolRecord != null) { -// patrolRecord.setId(id); - //巡检路线状态只有 已下发和已完成之分 所以查询是否还有已下发的巡检点来判断任务是否部分完成 - /*List unFinishRoutes = this.patrolRecordPatrolRouteService.selectListByWhere(" where patrol_record_id = '" + id + "' and type = '" + PatrolRoute.Point_0 + "' and status = '" + PatrolRecord.Status_Issue + "'"); - if (unFinishRoutes == null || unFinishRoutes.size() == 0) { - patrolRecord.setStatus(PatrolRecord.Status_Finish); - } else { - patrolRecord.setStatus(PatrolRecord.Status_PartFinish); - }*/ - - //运行巡检按巡检点统计打卡 - if (patrolRecord.getType().equals(PatrolType.Product.getId())) { - //查打卡点-总数 - List list_route1 = this.patrolRecordPatrolRouteService.selectListByWhere(" where patrol_record_id = '" + id + "' and type = '" + PatrolRoute.Point_0 + "' "); - if (list_route1 != null && list_route1.size() > 0) { - patrolRecord.setPointNumAll(list_route1.size()); - } else { - patrolRecord.setPointNumAll(0); - } - //查打卡点-完成数 - List list_route2 = this.patrolRecordPatrolRouteService.selectListByWhere(" where patrol_record_id = '" + id + "' and type = '" + PatrolRoute.Point_0 + "' and status = '" + PatrolRecord.Status_Finish + "'"); - if (list_route2 != null && list_route2.size() > 0) { - patrolRecord.setPointNumFinish(list_route2.size()); - } else { - patrolRecord.setPointNumFinish(0); - } - } - - //设备巡检按设备统计打卡 - if (patrolRecord.getType().equals(PatrolType.Equipment.getId())) { - //查打卡点-总数 - List list_route1 = this.patrolRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '" + id + "' and type = 'equipment' "); - if (list_route1 != null && list_route1.size() > 0) { - patrolRecord.setPointNumAll(list_route1.size()); - } else { - patrolRecord.setPointNumAll(0); - } - //查打卡点-完成数 - List list_route2 = this.patrolRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '" + id + "' and type = 'equipment' and status = '" + PatrolRecord.Status_Finish + "'"); - if (list_route2 != null && list_route2.size() > 0) { - patrolRecord.setPointNumFinish(list_route2.size()); - } else { - patrolRecord.setPointNumFinish(0); - } - } - - //任务下打卡总数和打卡完成数相等 则任务完成 否则为部分完成 - if (patrolRecord.getPointNumAll() == patrolRecord.getPointNumFinish()) { - patrolRecord.setStatus(PatrolRecord.Status_Finish); - } else { - patrolRecord.setStatus(PatrolRecord.Status_PartFinish); - } - - } - if (workResult != null && !workResult.isEmpty()) { - patrolRecord.setWorkResult(workResult); - } - if (workerId != null && !workerId.isEmpty()) { - patrolRecord.setWorkerId(workerId); - } - if (receiveUserId != null && !receiveUserId.isEmpty()) { - patrolRecord.setReceiveUserId(receiveUserId); - } - patrolRecord.setActFinishTime(CommUtil.nowDate()); - - //工时 - PatrolRecord patrolRecord2 = patrolRecordService.selectById(id); - if (patrolRecord2 != null) { - patrolRecord.setDuration(patrolRecord2.getDuration()); - } - - int res = this.patrolRecordService.submit(patrolRecord, json, isStart); - - result = Result.success(res); - } catch (Exception e) { - result = Result.failed(""); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - - @RequestMapping("/handleProcess.do") - public String handleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - patrolRecordService.updateStatus(businessUnitHandle.getBusinessid(), request.getParameter("status")); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -// /** -// * 巡检计划确认APP接口 -// * @param request -// * @param model -// * @return -// */ -// // todo -// @RequestMapping("/updatePatrolRecordByAPP.do") -// public ModelAndView doStart(HttpServletRequest request, Model model) { -// String result = ""; -// PatrolRecord patrolRecord = new PatrolRecord(); -// patrolRecord.setId(request.getParameter("id")); -// patrolRecord.setWorkerId(request.getParameter("workerId")); -// patrolRecord.setWorkResult(request.getParameter("workResult"));//巡检结果); -// patrolRecord.setBizId("FS_SK11_C"); -// patrolRecord.setReceiveUserId("emp01"); -// int start = patrolRecordService.start(patrolRecord); -// if (start == 1) { -// result = "{\"status\":\"" + CommString.Status_Pass + "\"}"; -// } else { -// result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; -// } -// model.addAttribute("result", result); -// return new ModelAndView("result"); -// } - - - /** - * 巡检提交 - */ - @RequestMapping("/showCreate.do") - public String showCreate(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String entityId = pInstance.getBusinessKey(); - PatrolRecord patrolRecord = patrolRecordService.selectById(entityId); - model.addAttribute("entity", patrolRecord); - return "timeefficiency/patrolRecordTaskCreate"; - } - - /** - * 工单执行页面(巡检) - * 2021-08-04 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showPatrolRecordTaskList.do") - public String showPatrolRecordTaskList(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - PatrolRecord entity = this.patrolRecordService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - - return "timeefficiency/patrolRecordTaskList"; - } - - - /** - * 显示流程 流转信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showProcessView.do") - public String showProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - PatrolRecord entity = this.patrolRecordService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_PATROL_CREATE: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_PATROL_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "report/reportCreate_processView"; - } else { - return "report/reportCreate_processView_alone"; - } - } - - /** - * APP接口。提交未巡检任务 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/updateUndoPatrolRecordByAPP.do") - public ModelAndView updateUndoPatrolRecordByAPP(HttpServletRequest request, Model model) { - String result = ""; - try { - PatrolRecord patrolRecord = new PatrolRecord();//先定义一个空的巡检记录 - if (request.getParameter("patrolRecordId") != null && !request.getParameter("patrolRecordId").toString().isEmpty()) { - patrolRecord.setId(request.getParameter("patrolRecordId").toString()); - patrolRecord.setStatus(PatrolRecord.Status_Undo); - } - if (request.getParameter("workResult") != null && !request.getParameter("workResult").toString().isEmpty()) { - patrolRecord.setWorkResult(request.getParameter("workResult").toString()); - } - if (request.getParameter("workerId") != null && !request.getParameter("workerId").toString().isEmpty()) { - patrolRecord.setWorkerId(request.getParameter("workerId").toString()); - } - patrolRecord.setActFinishTime(CommUtil.nowDate()); - int res = this.patrolRecordService.update(patrolRecord); - if (res == 1) { - result = "{\"status\":\"" + CommString.Status_Pass + "\"}"; - } else { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取任务中--巡检点下--关联的设备列表 设备下的自动点列表 sj 2020-06-03 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getEquipmentByPatrolPoint4APP.do") - public ModelAndView getEquipmentByPatrolPoint4APP(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - String unitId = request.getParameter("unitId"); - //String result = ""; - String orderstr = " order by insdt asc"; - String wherestr = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "'"; - List list = this.patrolRecordPatrolEquipmentService.selectListByWhere4APP(wherestr + orderstr, unitId); - JSONArray json = JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); -// System.out.println(CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 提交运行及设备巡检下的 设备 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/subEquipment4APP.do") - public ModelAndView subEquipment4APP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - String equipmentId = request.getParameter("equipmentId"); - int res = 0; - - String whereStr = ""; - if (patrolPointId != null && !patrolPointId.equals("")) { - whereStr += " where 1=1 and patrol_record_id='" + patrolRecordId + "' " - + "and patrol_point_id='" + patrolPointId + "' and equipment_id='" + equipmentId + "'"; - } else { - whereStr += " where 1=1 and patrol_record_id='" + patrolRecordId + "' " - + "and equipment_id='" + equipmentId + "'"; - } - - List list = patrolRecordPatrolEquipmentService.selectListByWhere(whereStr); - if (list != null && list.size() > 0) { - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setId(list.get(0).getId()); - patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Finish); - patrolRecordPatrolEquipment.setUpdateuser(cu.getId()); - patrolRecordPatrolEquipment.setUpdatedt(CommUtil.nowDate()); - patrolRecordPatrolEquipment.setPatrolRecordId(list.get(0).getPatrolRecordId()); - res = patrolRecordPatrolEquipmentService.update(patrolRecordPatrolEquipment); - } - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 提交运行巡检下的 巡检点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/subPatrolPoint4APP.do") - public ModelAndView subPatrolPoint4APP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Result result = null; - String userId = request.getParameter("userId"); - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - Boolean isLimited = Boolean.valueOf(request.getParameter("isLimited"));///是否 判断时间 true判断 false不判断 - String status = request.getParameter("status");//只有在安全任务里是接收app传来的参数,像运行巡检都是平台直接完成 - String remark = request.getParameter("remark"); - - if (isLimited != null && !isLimited.equals("")) { - if (isLimited) { - //需要判断时间 - PatrolRecord patrolRecord = patrolRecordService.selectById(patrolRecordId); - if (patrolRecord != null) { - // 0为范围内 1为范围外 - int timeInt = CommUtil.compare_time(patrolRecord.getStartTime(), patrolRecord.getEndTime(), CommUtil.nowDate()); - if (timeInt == 0) { - //范围内 继续 -// System.out.println("范围内"); - } - if (timeInt == 1) { - //范围外 - result = Result.failed("不在时间内"); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - } - } - } - - int res = 0; - String whereStr = " where 1=1 and patrol_record_id='" + patrolRecordId + "' " - + "and patrol_point_id='" + patrolPointId + "' "; - PatrolRecordPatrolRoute patrolRecordPatrolRoute = patrolRecordPatrolRouteService.selectByWhere(whereStr); - if (patrolRecordPatrolRoute != null) { - patrolRecordPatrolRoute.setId(patrolRecordPatrolRoute.getId()); - if (status != null && !status.equals("")) { - patrolRecordPatrolRoute.setStatus(status); - } else { - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Finish); - } - patrolRecordPatrolRoute.setWorkerId(userId); - patrolRecordPatrolRoute.setFinishdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setRemark(remark); - res = patrolRecordPatrolRouteService.update(patrolRecordPatrolRoute); - - if (res == 1) { - //提交巡检点的时候 重新计算巡检点下 巡检内容及填报内容 完成数 sj 2020-05-07 - patrolRecordPatrolRouteService.updateNum(patrolRecordPatrolRoute); - } - } - result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 提交运行巡检下的 巡检点 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/subPatrolPoint4APPSafe.do") - public ModelAndView subPatrolPoint4APPSafe(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - Result result = null; - String userId = request.getParameter("userId"); - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - Boolean isLimited = Boolean.valueOf(request.getParameter("isLimited"));///是否 判断时间 true判断 false不判断 - String status = request.getParameter("status");//只有在安全任务里是接收app传来的参数,像运行巡检都是平台直接完成 - String remark = request.getParameter("remark"); - - if (isLimited != null && !isLimited.equals("")) { - if (isLimited) { - //需要判断时间 - PatrolRecord patrolRecord = patrolRecordService.selectById(patrolRecordId); - if (patrolRecord != null) { - // 0为范围内 1为范围外 - int timeInt = CommUtil.compare_time(patrolRecord.getStartTime(), patrolRecord.getEndTime(), CommUtil.nowDate()); - if (timeInt == 0) { - //范围内 继续 - } - if (timeInt == 1) { - //范围外 - result = Result.failed("不在时间内"); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - } - } - } - - int res = 0; - String whereStr = " where 1=1 and patrol_record_id='" + patrolRecordId + "' " - + "and patrol_point_id='" + patrolPointId + "' "; - PatrolRecordPatrolRoute patrolRecordPatrolRoute = patrolRecordPatrolRouteService.selectByWhere(whereStr); - if (patrolRecordPatrolRoute != null) { - patrolRecordPatrolRoute.setId(patrolRecordPatrolRoute.getId()); - if (status != null && !status.equals("")) { - patrolRecordPatrolRoute.setStatus(status); - } else { - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Finish); - } - patrolRecordPatrolRoute.setWorkerId(userId); - patrolRecordPatrolRoute.setFinishdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setRemark(remark); - res = patrolRecordPatrolRouteService.update(patrolRecordPatrolRoute); - - if (res == 1) { - //提交巡检点的时候 重新计算巡检点下 巡检内容及填报内容 完成数 sj 2020-05-07 - patrolRecordPatrolRouteService.updateNum(patrolRecordPatrolRoute); - - //查询这个任务下所有的任务点是否打卡 全部打卡则自动提交该任务 - List list = patrolRecordPatrolRouteService.selectSimpleListByWhere("where patrol_record_id = '" + patrolRecordId + "' and status = '" + PatrolRecord.Status_Issue + "'"); - if (list == null || list.size() == 0) { - List list1 = patrolRecordService.selectSimpleListByWhere("where id = '" + patrolRecordId + "'"); - if (list1 != null && list1.size() > 0) { - PatrolRecord patrolRecord = list1.get(0); - patrolRecord.setStatus(PatrolRecord.Status_Finish); - patrolRecord.setActFinishTime(CommUtil.nowDate()); - patrolRecord.setWorkerId(userId); - patrolRecordService.update(patrolRecord); - } - } - } - } - result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "巡检总览页面", notes = "巡检总览页面", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - //@ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/showOverview.do", method = RequestMethod.GET) - public String showOverview(HttpServletRequest request, Model model) { - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt.substring(0, 4) + ""); - return "/timeefficiency/patrolRecordOverview"; - } - - @ApiOperation(value = "巡检总览页面2", notes = "巡检总览页面2", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - //@ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/showOverview2.do", method = RequestMethod.GET) - public String showOverview2(HttpServletRequest request, Model model) { - String rptdt = CommUtil.nowDate().substring(0, 7); -// request.setAttribute("datestr", rptdt.substring(0, 4) + ""); - request.setAttribute("datestr", rptdt); - return "/timeefficiency/patrolRecordOverview2"; - } - - //人员巡检完成情况统计界面 - @RequestMapping("/showFinishData.do") - public String showFinishData(HttpServletRequest request, Model model) { - return "timeefficiency/patrolRecordViewFinishData"; - } - - //获取人员巡检完成情况统计数据 - @RequestMapping("/getFinishData.do") - public ModelAndView getFinishData(HttpServletRequest request, Model model) { - String dateType = request.getParameter("dateType");//0 1 - String selectDate = request.getParameter("selectDate"); - String unitId = request.getParameter("unitId"); - - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - - JSONArray jsonArray = new JSONArray(); - - String wherestr_user = "where 1=1 "; - List unitlist = unitService.getUnitChildrenById(request.getParameter(unitId)); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr_user += "and pid in (" + pidstr + ") "; - } - - List users = userService.selectListByWhere(wherestr_user); - if (users != null && users.size() > 0) { - for (int i = 0; i < users.size(); i++) { - JSONObject jsonObject = new JSONObject(); - //人名 - jsonObject.put("userName", users.get(i).getCaption()); - - //巡检完成数 - String wherestr = " where DateDiff(" + dateTypeStr + ",start_time,'" + selectDate + "')=0 and worker_id = '" + users.get(i).getId() + "' and (status = '" + PatrolRecord.Status_Finish + "' or status = '" + PatrolRecord.Status_PartFinish + "') and biz_id = '" + unitId + "'"; - List listf = this.patrolRecordService.selectListByWhere(wherestr); - if (listf != null && listf.size() > 0) { - jsonObject.put("finishNum", listf.size()); - } else { - jsonObject.put("finishNum", 0 + ""); - } - - //工时 - float workingHours = 0; - if (listf != null && listf.size() > 0) { - for (int j = 0; j < listf.size(); j++) { - workingHours += listf.get(j).getDuration(); - } - } - jsonObject.put("workingHours", workingHours); - - //上报异常数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + selectDate + "')=0 and insuser = '" + users.get(i).getId() + "' and biz_id = '" + unitId + "'"; - List lista = abnormityService.selectListByWhere(wherestr); - if (lista != null && lista.size() > 0) { - jsonObject.put("abnormityNum", lista.size()); - } else { - jsonObject.put("abnormityNum", 0 + ""); - } - - jsonArray.add(jsonObject); - } - } - - int total = 0; - if (users != null && users.size() > 0) { - total = users.size(); - } - - String result = "{\"total\":" + total + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/showCameras.do") - public String showCameras(HttpServletRequest request, Model model) throws IOException { - String aString = request.getParameter("patrolRecordId"); - model.addAttribute("patrolRecordId", request.getParameter("patrolRecordId")); - model.addAttribute("patrolPointId", request.getParameter("patrolPointId")); - model.addAttribute("cid", request.getParameter("id")); - model.addAttribute("uuid", CommUtil.getUUID()); - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "websocketurl")); - return "timeefficiency/patrolRecordViewCameraDetails"; - } - - @RequestMapping("/getCamerasByPatrolRecordId.do") - public String getCamerasByPatrolRecordId(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - List list = this.patrolRecordPatrolCameraService - .selectListCameraByWhere("where patrolrecordid = '" + patrolRecordId + "' order by id"); - List cameras = new ArrayList<>(); - if (list != null && list.size() > 0) { - for (PatrolRecordPatrolCamera patrolCamera : list) { - cameras.add(patrolCamera.getCamera()); - } - } - model.addAttribute("result", JSONArray.fromObject(cameras)); - return "result"; - } - - @RequestMapping("/finishCameraPatrol.do") - public String finishCameraPatrol(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - List list = this.patrolRecordPatrolCameraService - .selectListCameraByWhere("where patrolrecordid = '" + patrolRecordId + "' order by id"); - for (PatrolRecordPatrolCamera patrolCamera : list) { - patrolCamera.setStatus(PatrolRecord.Status_Finish); - patrolCamera.setUpdatedt(CommUtil.nowDate()); - patrolCamera.setUpdateuser(((User) request.getSession().getAttribute("cu")).getId()); - this.patrolRecordPatrolCameraService.update(patrolCamera); - - } - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - patrolRecord.setStatus(PatrolRecord.Status_Finish); - int result = this.patrolRecordService.update(patrolRecord); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/finishCameraPatrol_New.do") - public String finishCameraPatrol_New(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - PatrolRecordPatrolCamera patrolCamera = this.patrolRecordPatrolCameraService.selectById(id); - int result = 0; - if (patrolCamera != null) { - patrolCamera.setStatus(PatrolRecord.Status_Finish); - patrolCamera.setUpdatedt(CommUtil.nowDate()); - patrolCamera.setUpdateuser(((User) request.getSession().getAttribute("cu")).getId()); - this.patrolRecordPatrolCameraService.update(patrolCamera); - List list = this.patrolRecordPatrolCameraService - .selectListCameraByWhere("where patrolrecordid = '" + - patrolCamera.getPatrolrecordid() + "' and status <> '" + PatrolRecord.Status_Finish + "' order by id"); - if (list != null && list.size() > 0) { - } else { - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolCamera.getPatrolrecordid()); - patrolRecord.setStatus(PatrolRecord.Status_Finish); - result = this.patrolRecordService.update(patrolRecord); - } - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dook.do") - public String dook(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String patrolRecordId = request.getParameter("patrolRecordId"); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); - patrolRecord.setWorkerId(cu.getId()); - patrolRecord.setActFinishTime(CommUtil.nowDate()); - patrolRecord.setStatus(PatrolRecord.Status_Finish); - int result = this.patrolRecordService.update(patrolRecord); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doCameraOk.do") - public String doCameraOk(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - List list = this.patrolRecordPatrolCameraService.selectListByWhere(" where patrolRecordId='" + request.getParameter("patrolRecordId") + "' " + - " and cameraId='" + request.getParameter("cameraId") + "' "); - - int result = 0; - if (list != null && list.size() > 0) { - PatrolRecordPatrolCamera patrolRecordPatrolCamera = list.get(0); - patrolRecordPatrolCamera.setStatus(PatrolRecord.Status_Finish); - patrolRecordPatrolCamera.setUpdatedt(CommUtil.nowDate()); - patrolRecordPatrolCamera.setUpdateuser(cu.getId()); - result = this.patrolRecordPatrolCameraService.update(patrolRecordPatrolCamera); - } - - model.addAttribute("result", result); - return "result"; - } - - /** - * 用于南市测试底图json返回 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getJson4Map.do") - public String getJson4Map(HttpServletRequest request, Model model) { -// String patrolRecordId = request.getParameter("id"); -// PatrolRecord patrolRecord = this.patrolRecordService.selectById(patrolRecordId); -// -// model.addAttribute("patrolRecord", patrolRecord); -// model.addAttribute("result", JSONObject.fromObject(patrolRecord)); - return "result"; - } - - /** - * 传任务id返回任务下所有的信息(运行巡检) 目前用于app离线巡检 - * - * @param request - * @param model - * @param patrolRecordId - * @return - */ - @RequestMapping("/getPatrolRecord4All.do") - public String getPatrolRecord4All(HttpServletRequest request, Model model, - @RequestParam(value = "patrolRecordId") String patrolRecordId) { - List list = patrolRecordService.selectListByWhere("where id = '" + patrolRecordId + "'"); - for (PatrolRecord patrolRecord : list) { - List list2 = patrolRecordPatrolRouteService.selectListByWhere2("where patrol_record_id = '" + patrolRecord.getId() + "'", patrolRecord.getUnitId()); - patrolRecord.setPatrolRecordPatrolRoutes(list2); - } - Result result = Result.success(list); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 传任务id返回任务下所有的信息(运行巡检) 目前用于app离线巡检 - * app → 平台 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/receivePatrolRecord4App.do") - public String receivePatrolRecord4App(HttpServletRequest request, Model model, - @RequestParam(value = "json") String json) { - - patrolRecordService.receivePatrolRecord4App(json); - - Result result = Result.success("1"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getGPS.do") - public ModelAndView getGPS(HttpServletRequest request, Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); -// String where = " where patrol_record_id = '" + patrolRecordId + "' "; - List list = workerPositionService.selectListByWhere(patrolRecordId); - JSONArray jsonArray = JSONArray.fromObject(list); - model.addAttribute("result", jsonArray); - return new ModelAndView("result"); - } - - /** - * 平台点击 人员 BIM系统显示人员的实时定位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/savePersonPositionCacheBIM.do") - public ModelAndView savePersonPositionCacheBIM(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId");//人员id - - HashMap map = new HashMap<>(); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - List list = extSystemService.selectListByWhere("where type = 'pump'"); - if (list != null && list.size() > 0) { - jsonObject.put("userId", userId); - jsonObject.put("timeStamp", System.currentTimeMillis()); - map.put("data", jsonObject.toString()); - HttpUtil.sendPost(list.get(0).getUrl() + "?", map); - } - - model.addAttribute("result", Result.success(map)); - return new ModelAndView("result"); - } - - @RequestMapping("/cameraDo.do") - public String cameraDo(HttpServletRequest request, Model model) throws IOException { - String recordId = request.getParameter("recordId"); - model.addAttribute("recordId", recordId); - return "timeefficiency/patrolRecordCameraDo"; - } - - @RequestMapping("/cameraDoIn.do") - public String cameraDoIn(HttpServletRequest request, Model model) throws IOException { - String recordId = request.getParameter("recordId"); - - List cameraslist = this.patrolRecordPatrolCameraService.selectListCameraByWhere("where patrolRecordId='" + recordId + "' order by morder "); - - JSONArray jsonArray = new JSONArray(); - if (cameraslist != null && cameraslist.size() > 0) { - for (PatrolRecordPatrolCamera patrolRecordPatrolCamera : - cameraslist) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolRecordPatrolCamera.getCamera().getId()); - jsonObject.put("text", patrolRecordPatrolCamera.getCamera().getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("cameraslist", jsonArray); - - model.addAttribute("uuid", CommUtil.getUUID()); - model.addAttribute("recordId", recordId); - return "timeefficiency/patrolRecordCameraDoIn"; - } - - @ApiOperation(value = "根据指定日期获取巡检班组信息统计 --巡检总览(饼图)", notes = "根据指定日期获取巡检班组信息统计 --巡检总览", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "dateType", value = "日期类型:year or month", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "巡检类型:P or E", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolDate", value = "时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getPatrolRecordBanZuByDay.do", method = RequestMethod.GET) -// @ResponseBody - public String getPatrolRecordBanZuByDay(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - String wherestr = " where type='" + type + "' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0 and unit_id='" + unitId + "'"; - com.alibaba.fastjson.JSONObject jsonObject = patrolRecordService.getPatrolRecordBanZuByDay(wherestr, unitId); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "根据指定日期获取巡检班组信息统计 --巡检总览(柱状图)", notes = "根据指定日期获取巡检班组信息统计 --巡检总览", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "dateType", value = "日期类型:year or month", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "巡检类型:P or E", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolDate", value = "时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getPatrolRecordBanZuByDay2.do", method = RequestMethod.GET) -// @ResponseBody - public String getPatrolRecordBanZuByDay2(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - String wherestr = " where type='" + type + "' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0 and unit_id='" + unitId + "'"; - com.alibaba.fastjson.JSONObject jsonObject = patrolRecordService.getPatrolRecordBanZuByDay2(wherestr, unitId); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "根据指定日期获取巡检班组信息统计 --巡检总览(柱状图)", notes = "根据指定日期获取巡检班组信息统计 --巡检总览", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "dateType", value = "日期类型:year or month", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "巡检类型:P or E", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolDate", value = "时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getPatrolRecordBanZuByDay3.do", method = RequestMethod.GET) - public String getPatrolRecordBanZuByDay3(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - String wherestr = " where type='" + type + "' and DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0 and unit_id='" + unitId + "'"; - com.alibaba.fastjson.JSONObject jsonObject = patrolRecordService.getPatrolRecordBanZuByDay3(wherestr, unitId); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "根据指定日期获取巡检班组及人员和打卡点数量 --巡检总览(柱状图)", notes = "根据指定日期获取巡检班组及人员和打卡点数量 --巡检总览", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "dateType", value = "日期类型:year or month", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolDate", value = "时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getFinishData2.do", method = RequestMethod.GET) - public String getFinishData2(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "patrolDate") String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - com.alibaba.fastjson.JSONObject jsonObject = patrolRecordService.getFinishData(dateTypeStr, patrolDate, unitId); -// System.out.println(jsonObject); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "手动刷新巡检任务下 巡检点打卡完成情况", notes = "手动刷新巡检任务下 巡检点打卡完成情况", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "sdt", value = "开始时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "edt", value = "结束时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/updatePointNum.do", method = RequestMethod.POST) - @ResponseBody - public ModelAndView updatePointNum(HttpServletRequest request, Model model, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { -// System.out.println("开始执行:updatePointNum:" + CommUtil.nowDate()); - String sql = "where 1=1 and start_time>='" + sdt + "' and start_time<='" + edt + "'"; - List list1 = patrolRecordService.selectListByWhere(sql); - int num = 0; - for (PatrolRecord patrolRecord1 : list1) { - //全部 - List list2 = patrolRecordPatrolRouteService.selectSimpleListByWhere("where patrol_record_id = '" + patrolRecord1.getId() + "'"); - //完成 - List list3 = patrolRecordPatrolRouteService.selectSimpleListByWhere("where patrol_record_id = '" + patrolRecord1.getId() + "' and status = '" + PatrolRecord.Status_Finish + "'"); - if (list2 != null && list2.size() > 0) { - patrolRecord1.setPointNumAll(list2.size()); - } else { - patrolRecord1.setPointNumAll(0); - } - if (list3 != null && list3.size() > 0) { - patrolRecord1.setPointNumFinish(list3.size()); - } else { - patrolRecord1.setPointNumFinish(0); - } - if (patrolRecord1.getWorkerId() == null || patrolRecord1.getWorkerId().equals("")) { - String dt = patrolRecord1.getStartTime(); - String orderstr = " order by stdt asc "; - String wherestr = " where bizid='" + patrolRecord1.getUnitId() + "' and (stdt<='" + dt + "' and eddt>='" + dt + "') "; - List list = this.schedulingService.selectCalenderListByWhere(wherestr + orderstr); - if (list != null && list.size() > 0) { - GroupDetail groupDetail = groupDetailService.selectById(list.get(0).getGroupdetailId()); - if (groupDetail != null) { - patrolRecord1.setWorkerId(groupDetail.getLeader()); - } - } - } - - //自动将未提交的巡检提交 - if (patrolRecord1.getStatus().equals(PatrolRecord.Status_Issue) || patrolRecord1.getStatus().equals(PatrolRecord.Status_Start)) { - //没有关联打卡点位的任务(总打卡点为0) - if (patrolRecord1.getPointNumAll() == 0) { - //状态不变还是未完成 - patrolRecord1.setStatus(patrolRecord1.Status_Issue); - } else { - //关联的打卡点位一个没打 - if (patrolRecord1.getPointNumFinish() == 0) { - //状态不变还是未完成 - patrolRecord1.setStatus(patrolRecord1.Status_Issue); - } else { - if (patrolRecord1.getPointNumAll() == patrolRecord1.getPointNumFinish()) { - patrolRecord1.setStatus(PatrolRecord.Status_Finish); - } else { - patrolRecord1.setStatus(PatrolRecord.Status_PartFinish); - } - } - } - patrolRecord1.setWorkResult("系统自动提交"); - patrolRecord1.setActFinishTime(patrolRecord1.getEndTime()); - } - - int res = patrolRecordService.update(patrolRecord1); - num += res; - } -// System.out.println("结束执行:updatePointNum:" + CommUtil.nowDate()); - Result result = Result.success(num); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - @ApiOperation(value = "获取巡检楼层对应的数据", notes = "获取巡检楼层对应的数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "patrolDate", value = "时间,yyyy-MM-dd", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "P or E", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getPatrolRecordFloorData.do", method = RequestMethod.GET) - public String getPatrolRecordFloorData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "patrolDate") String patrolDate, - @RequestParam(value = "type") String type) { - com.alibaba.fastjson.JSONArray jsonArray = patrolRecordService.getPatrolRecordFloorData(unitId, patrolDate, type); - System.out.println(jsonArray); -// Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(jsonArray)); - return "result"; - } - - @ApiOperation(value = "安全任务记录页面", notes = "安全任务记录页面", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - - }) - @RequestMapping(value = "/showList4Safe.do", method = RequestMethod.GET) - public String showList4Safe(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - request.setAttribute("type", TimeEfficiencyCommStr.PatrolType_Safe); - return "/timeefficiency/patrolRecordList4Safe"; - } - - /** - * 用于关联设备弹窗(安全任务) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/equipment4Safe.do") - public String equipment4Safe(HttpServletRequest request, Model model) { - System.out.println("===equipment4Safe"); - return "timeefficiency/patrolRecordEquipment4Safe"; - } - - /** - * 获取设备巡检计划的设备台账 - * - * @param request - * @return - */ - @RequestMapping("/getEquipmentCards4Safe.do") - public ModelAndView getEquipmentCards4Safe(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String patrolPointId = request.getParameter("patrolPointId"); - String wherestr = " where patrol_record_id = '" + patrolRecordId + "' and patrol_point_id = '" + patrolPointId + "' "; - String orderstr = " order by morder"; - PageHelper.startPage(page, rows); - List list = this.patrolRecordPatrolEquipmentService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @ApiOperation(value = "安全任务分析页面", notes = "安全任务分析页面", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - //@ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value = "/showOverviewAnalysis.do", method = RequestMethod.GET) - public String showOverviewAnalysis(HttpServletRequest request, Model model) { - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt); - return "/timeefficiency/patrolRecordOverviewAnalysis"; - } - - @ApiOperation(value = "巡检总览---各类任务数折线图数据", notes = "巡检总览---各类任务数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "type", value = "P or E", dataType = "String", paramType = "query", defaultValue = "P", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getAnalysisData.do", method = RequestMethod.GET) - public String getAnalysisData(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONArray jsonArray = patrolRecordService.getAnalysisData(unitId, dateType, patrolDate, type); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "巡检总览---各类任务数折线图数据", notes = "巡检总览---各类任务数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "FS_SK11_C", required = true), - @ApiImplicitParam(name = "dateType", value = "year month", dataType = "String", paramType = "query", defaultValue = "month", required = true), - @ApiImplicitParam(name = "type", value = "P or E", dataType = "String", paramType = "query", defaultValue = "P", required = true), - @ApiImplicitParam(name = "patrolDate", value = "筛选日期", dataType = "String", paramType = "query", defaultValue = "2022-12", required = true) - }) - @RequestMapping(value = "/getAnalysisData2.do", method = RequestMethod.GET) - public String getAnalysisData2(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "dateType") String dateType, - @RequestParam(value = "type") String type, - @RequestParam(value = "patrolDate") String patrolDate) { - JSONObject jsonObject = patrolRecordService.getAnalysisData2(unitId, dateType, patrolDate, type); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "巡检总览---各类任务数折线图数据", notes = "巡检总览---各类任务数折线图数据", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "patrolRecordId", value = "任务id", dataType = "String", paramType = "query", defaultValue = "", required = true) - }) - @RequestMapping(value = "/getPatrolRecordGroup.do", method = RequestMethod.GET) - public String getPatrolRecordGroup(HttpServletRequest request, Model model, - @RequestParam(value = "patrolRecordId") String patrolRecordId) { - JSONObject jsonObject = patrolRecordService.getPatrolRecordGroup(patrolRecordId); - Result result = Result.success(jsonObject); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doviewPic.do") - public String doviewPic(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - return "timeefficiency/patrolRecordViewPic"; - } - - @ApiOperation(value = "根据巡检点 查询出所有对应的任务", notes = "根据巡检点 查询出所有对应的任务", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "patrolPonitId", value = "任务id", dataType = "String", paramType = "query", defaultValue = "", required = true), - @ApiImplicitParam(name = "type", value = "安全任务固定传:S", dataType = "String", paramType = "query", defaultValue = "", required = true), - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", defaultValue = "", required = true), - @ApiImplicitParam(name = "userIds", value = "人员id", dataType = "String", paramType = "query", defaultValue = "", required = true) - }) - @RequestMapping(value = "/getPatrolRecord4PatrolPonitIdSafe.do", method = RequestMethod.GET) - public String getPatrolRecord4PatrolPonitIdSafe(HttpServletRequest request, Model model, - @RequestParam(value = "patrolPonitId", required = true) String patrolPonitId, - @RequestParam(value = "type", required = true) String type, - @RequestParam(value = "unitId", required = true) String unitId, - @RequestParam(value = "userIds", required = true) String userIds) { - String orderstr = " order by start_time desc"; - //只查开始时间到今天365天内的数据 - String wherestr = " where unit_id = '" + unitId + "' and DATEDIFF(dd,start_time,GETDATE())<365"; - - Set set = new HashSet(); - if (userIds != null && !userIds.trim().equals("")) { - String[] userid = userIds.split(","); - for (int i = 0; i < userid.length; i++) { - Set set2 = patrolRecordService.selectListByUserIdSafe(userid[i], wherestr, orderstr, unitId, type); - Iterator it = set2.iterator(); - while (it.hasNext()) { - String str = it.next(); - set.add(str); - } - } - } - - JSONArray json = null; - - String patrolRecordIds = ""; - Iterator it = set.iterator(); - while (it.hasNext()) { - patrolRecordIds += "'" + it.next() + "',"; - } - - if (patrolRecordIds != null && !patrolRecordIds.trim().equals("")) { - patrolRecordIds = patrolRecordIds.substring(0, patrolRecordIds.length() - 1); - } else { - patrolRecordIds = "'false'"; - } - - try { - String where2 = "where id in (" + patrolRecordIds + ") and DATEDIFF(dd,start_time,GETDATE())<365"; - //之前仅看时间范围内进行中的任务 -// List list_executing = this.patrolRecordService.selectListByWhere(where2 + " and DATEDIFF(dd,start_time,GETDATE())<365 and (status='" + PatrolRecord.Status_Issue + "' or status='" + PatrolRecord.Status_Start + "') and start_time<='" + CommUtil.nowDate() + "' and '" + CommUtil.nowDate() + "'<=end_time"); - - //2024-04-08 sj 超期的任务也需要显示出来 - List list_executing = this.patrolRecordService.selectListByWhere(where2 + " and DATEDIFF(dd,start_time,GETDATE())<365 and (status='" + PatrolRecord.Status_Issue + "' or status='" + PatrolRecord.Status_Start + "') "); - - List list = new ArrayList<>(); - //仅保留有该任务点的任务 - for (PatrolRecord patrolRecord : list_executing) { - List list_route = patrolRecordPatrolRouteService.selectListByWhereSafe("where patrol_point_id = '" + patrolPonitId + "' and patrol_record_id = '" + patrolRecord.getId() + "' and status = '" + PatrolRecord.Status_Issue + "'"); - if (list_route != null && list_route.size() > 0) { - patrolRecord.setPatrolRecordPatrolRoutes(list_route); - list.add(patrolRecord); - } - } - - if (list != null && list.size() > 0) { - json = JSONArray.fromObject(list); - } - } catch (Exception e) { - e.printStackTrace(); - } - - Result result = Result.success(json); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/timeefficiency/PatrolRecordViolationRecordController.java b/src/com/sipai/controller/timeefficiency/PatrolRecordViolationRecordController.java deleted file mode 100644 index 6844c8ab..00000000 --- a/src/com/sipai/controller/timeefficiency/PatrolRecordViolationRecordController.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.sipai.controller.timeefficiency; - - -import java.io.IOException; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolRecordViolationRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolPlanService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.user.UserServiceImpl; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/timeEfficiency/patrolRecordViolationRecord") -public class PatrolRecordViolationRecordController { - @Resource - private PatrolRecordService patrolRecordService; - //@Resource - //private PatrolRecordViolationRecordService patrolRecordViolationRecordService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private PatrolPlanService patrolPlanService; - -// @RequestMapping("/showList.do") -// public String showlist(HttpServletRequest request,Model model) { -// return "/timeefficiency/patrolRecordViolationRecordList"; -// } -// -// @RequestMapping("/getList.do") -// public ModelAndView getList( -// HttpServletRequest request, Model model, -// String sdt, String edt, -// String patrolName, String companyId,String workerId, -// @RequestParam(value = "page") Integer page, -// @RequestParam(value = "rows") Integer rows, -// @RequestParam(value = "sort", required = false) String sort, -// @RequestParam(value = "order", required = false) String order -// ) { -// StringBuilder sb=new StringBuilder("where 1=1"); -// if(null!=sdt && !"".equals(sdt)) -// sb.append(" and start_time >="+"'"+sdt+"'"); -// if(null!=edt && !"".equals(edt)) -// sb.append(" and end_time <="+"'"+edt+"'"); -// if(null!=patrolName && !"".equals(patrolName)) -// sb.append(" and name like "+"'"+"%"+patrolName+"%"+"'"); -// if(null!=companyId && !"".equals(companyId)) -// sb.append(" and biz_id ="+"'"+companyId+"'"); -// if(null!=workerId && !"".equals(workerId)) -// sb.append(" and worker_id ="+"'"+workerId+"'"); -// PageHelper.startPage(page, rows); -// List prvrList=patrolRecordViolationRecordService.selectListByWhere(sb.append(" order by insdt desc").toString()); -// for(int i=0;i pInfo = new PageInfo(prvrList); -// String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; -// model.addAttribute("result",result); -// return new ModelAndView("result"); -// -// } -// -// @RequestMapping("/doadd.do") -// public String doadd(HttpServletRequest request,Model model){ -// String companyId = request.getParameter("companyId"); -// Company company = this.unitService.getCompById(companyId); -// model.addAttribute("id", CommUtil.getUUID()); -// model.addAttribute("company",company); -// return "/timeefficiency/patrolRecordViolationRecordAdd"; -// } -// -// -// @RequestMapping("/dosave.do") -// public String dosave(HttpServletRequest request,Model model, -// @ModelAttribute PatrolRecordViolationRecord prvr -// ){ -// User cu= (User)request.getSession().getAttribute("cu"); -// prvr.setInsuser(cu.getId()); -// prvr.setInsdt(CommUtil.nowDate()); -// if("".equals(prvr.getId()) || null==prvr.getId() || prvr.getId().isEmpty()){ -// prvr.setId(CommUtil.getUUID()); -// } -// -// PatrolPlan pplan=patrolPlanService.selectById(prvr.getPatrolPlanId()); -// prvr.setPatrolAreaId(pplan.getPatrolAreaId()); -// prvr.setPatrolModelId(pplan.getPatrolModelId()); -// prvr.setType(pplan.getType()); -// //prvr.setStatus(PatrolRecord.Status_Finish); -// prvr.setStatus(PatrolRecord.Status_Issue); -// prvr.setStartTime(CommUtil.nowDate()); -// prvr.setEndTime(CommUtil.nowDate()); -// //int result =patrolRecordViolationRecordService.insertPatrolRecordViolationRecord(prvr); -// int result =patrolRecordViolationRecordService.save(prvr); -// String resstr="{\"res\":\""+result+"\",\"id\":\""+prvr.getId()+"\"}"; -// model.addAttribute("result", resstr); -// return "result"; -// } -// -// -// @RequestMapping("/delete.do") -// public String dodelete(HttpServletRequest request,Model model, -// @RequestParam(value = "id") String id) { -// int result =patrolRecordViolationRecordService.deleteById(id); -// model.addAttribute("result",result); -// return "result"; -// } -// -// -// @RequestMapping("/deletes.do") -// public String dodeletes(HttpServletRequest request,Model model, -// @RequestParam(value = "ids") String ids){ -// int result=0; -// String idArr[]=ids.split(","); -// for(String id:idArr){ -// result = patrolRecordViolationRecordService.deleteById(id); -// result++; -// } -// -// model.addAttribute("result",result); -// return "result"; -// } -// -// @RequestMapping("/edit.do") -// public String doedit(HttpServletRequest request,Model model, -// @RequestParam(value = "id") String id,String companyId) { -// -// String whereStr="where id="+"'"+id+"'"; -// //PatrolRecordViolationRecord prvr=new PatrolRecordViolationRecord(); -// // prvr.setWhere(whereStr); -// //List patrolRecordViolationRecord=patrolRecordViolationRecordService.findPatrolRecordViolationRecord(prvr); -// List patrolRecordViolationRecord=patrolRecordViolationRecordService.selectListByWhere(whereStr); -// Company company = this.unitService.getCompById(companyId); -// model.addAttribute("company",company); -// model.addAttribute("prvr", patrolRecordViolationRecord.get(0)); -// return "/timeefficiency/patrolRecordViolationRecordEdit"; -// -// } -// -// @RequestMapping("/update.do") -// public String doupdate(HttpServletRequest request,Model model, -// @ModelAttribute PatrolRecordViolationRecord prvr) { -// User cu = (User) request.getSession().getAttribute("cu"); -// prvr.setInsdt(CommUtil.nowDate()); -// prvr.setInsuser(cu.getId()); -// PatrolPlan pplan=patrolPlanService.selectById(prvr.getPatrolPlanId()); -// prvr.setPatrolAreaId(pplan.getPatrolAreaId()); -// prvr.setPatrolModelId(pplan.getPatrolModelId()); -// //int result=patrolRecordViolationRecordService.updateById(prvr); -// int result=patrolRecordViolationRecordService.update(prvr); -// String resstr="{\"res\":\""+result+"\",\"id\":\""+prvr.getId()+"\"}"; -// model.addAttribute("result", resstr); -// return "result"; -// } -// -// @RequestMapping("/getPatrolPlanByBizId4Select.do") -// public String getDeptByBizId4Select(HttpServletRequest request,Model model){ -// String companyId=request.getParameter("companyId"); -// //List depts = this.unitService.getDeptByPid(companyId); -// String str="where biz_id="+"'"+companyId+"'"+"order by insdt desc"; -// List patrolPlanList = this.patrolPlanService.selectListByWhere(str); -// JSONArray json=new JSONArray(); -// if(patrolPlanList!=null && patrolPlanList.size()>0){ -// //int i=0; -// for (PatrolPlan pplan : patrolPlanList) { -// JSONObject jsonObject =new JSONObject(); -// jsonObject.put("id", pplan.getId()); -// jsonObject.put("text", pplan.getName()); -// json.add(jsonObject); -// } -// } -// model.addAttribute("result", json.toString()); -// return "result"; -// } -// -// /** -// * -// * 根据厂区id,获取厂区负责人员 -// **/ -// @RequestMapping("getResponsiblerByCompanyIdForSelect.do") -// public String getResponsiblerByCompanyIdForSelect(HttpServletRequest request,Model model){ -// String companyId = request.getParameter("companyId"); -// List users = this.unitService.getChildrenUsersById(companyId); -// JSONArray json = new JSONArray(); -// if (users!=null && users.size()>0) { -// for (User user : users ) { -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("id",user.getId()); -// jsonObject.put("text", user.getCaption()); -// json.add(jsonObject); -// } -// } -// model.addAttribute("result", json.toString()); -// return "result"; -// } -// -// /** -// * 导出违规记录excel表 -// * @throws IOException -// */ -// @RequestMapping("downloadPRVRExcel.do") -// public void downloadFile(HttpServletRequest request, -// HttpServletResponse response,Model model,@RequestParam(value="companyId") String companyId) throws IOException { -// -// /* -// StringBuilder sb=new StringBuilder("where 1=1"); -// if(null!=sdt && !"".equals(sdt)) -// sb.append(" and act_finish_time >="+"'"+sdt+"'"); -// if(null!=edt && !"".equals(edt)) -// sb.append(" and act_finish_time <="+"'"+edt+"'"); -// if(null!=patrolName && !"".equals(patrolName)) -// sb.append(" and name like "+"'"+"%"+patrolName+"%"+"'"); -// -// if(null!=companyId && !"".equals(companyId)) -// sb.append(" and biz_id ="+"'"+companyId+"'"); -// */ -// //List prvrList=patrolRecordViolationRecordService.selectListByWhere(sb.append(" order by insdt desc").toString()); -// List prvrList=patrolRecordViolationRecordService.selectListByWhere("where biz_id="+"'"+companyId+"'"); -// for(int i=0;i list = this.riskLevelService.selectListByWhere(wherestr + orderstr); - - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); -// System.out.println(json); - String result="{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 添加 - * */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request,Model model){ - String unitId = request.getParameter("bizId"); - if(unitId!=null && !unitId.equals("")){ - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null){ - request.setAttribute("companyName", company.getSname()); - } - } - request.setAttribute("type", request.getParameter("patrolType")); - request.setAttribute("patrolPointId", CommUtil.getUUID()); - return "/timeefficiency/patrolPointAdd"; - } - - /* - * 编辑 - */ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if(patrolPoint!=null){ - Company company = companyService.selectByPrimaryKey(patrolPoint.getUnitId()); - if(company!=null){ - request.setAttribute("companyName", company.getSname()); - } - } - model.addAttribute("patrolPoint", patrolPoint); - return "timeefficiency/patrolPointEdit"; - } - - /* - * 查看 - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - model.addAttribute("patrolPoint", patrolPoint); - return "/timeefficiency/patrolPointView"; - } - - /** - * 保存*/ - @RequestMapping("/save.do") - public String save(HttpServletRequest request,Model model, - @ModelAttribute PatrolPoint patrolPoint){ - User cu= (User)request.getSession().getAttribute("cu"); - patrolPoint.setId(CommUtil.getUUID()); - patrolPoint.setInsuser(cu.getId()); - patrolPoint.setInsdt(CommUtil.nowDate()); - patrolPoint.setName(patrolPoint.getName().trim()); - String fileIds = request.getParameter("fileIds"); - if (fileIds!=null && !fileIds.isEmpty()) { - List commonFiles = new ArrayList<>(); - String[] ids = fileIds.split(","); - for (int i = 0; i < ids.length; i++) { - CommonFile commonFile = new CommonFile(); - commonFile.setId(ids[i]); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFiles.add(commonFile); - } - patrolPoint.setFiles(commonFiles); - } - int result =this.patrolPointService.save(patrolPoint); - - String resstr="{\"res\":\""+result+"\",\"id\":\""+patrolPoint.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.patrolPointService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /* - * 获取单条巡检点数据 - */ - @RequestMapping("/getData.do") - public String getData(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); - if(patrolPoint.getFiles()!=null && patrolPoint.getFiles().size()>0){ - Iterator iterator =patrolPoint.getFiles().iterator(); - String fileIds = ""; - String fileNames= ""; - while (iterator.hasNext()) { - CommonFile commonFile =iterator.next(); - if (!fileIds.isEmpty()) { - fileIds+=","; - } - fileIds+=commonFile.getId(); - if (!fileNames.isEmpty()) { - fileNames+=","; - } - fileNames+=commonFile.getFilename(); - } - model.addAttribute("fileIds", fileIds); - model.addAttribute("fileNames", fileNames); - } - model.addAttribute("result", JSONObject.fromObject(patrolPoint)); - return "result"; - } - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute PatrolPoint patrolPoint){ - User cu= (User)request.getSession().getAttribute("cu"); - String fileIds = request.getParameter("fileIds"); - if (fileIds!=null && !fileIds.isEmpty()) { - List commonFiles = new ArrayList<>(); - String[] ids = fileIds.split(","); - for (int i = 0; i < ids.length; i++) { - CommonFile commonFile = new CommonFile(); - commonFile.setId(ids[i]); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFiles.add(commonFile); - } - patrolPoint.setFiles(commonFiles); - } - patrolPoint.setName(patrolPoint.getName().trim()); - int result = this.patrolPointService.update(patrolPoint); - String resstr="{\"res\":\""+result+"\",\"id\":\""+patrolPoint.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看 - * @param request - * @param model - * @return - */ -// @RequestMapping("/view.do") -// public String view(HttpServletRequest request,Model model){ -// String Id = request.getParameter("id"); -// PatrolPoint patrolPoint = this.patrolPointService.selectById(Id); -// model.addAttribute("patrolPoint", patrolPoint); -// return "/timeefficiency/patrolPointView"; -// } - /* - * 关联数据传输方法 - */ - @RequestMapping("/getPatrolPoints.do") - public String getPatrolPoints(HttpServletRequest request,Model model, - @RequestParam(value = "unitId") String unitId){ - String wherestr = " where unit_id = '"+unitId+"'"; - if(request.getParameter("floorId")!=null&&!request.getParameter("floorId").isEmpty()){ - wherestr += " and (floor_id = '"+request.getParameter("floorId")+"' or floor_id is null)"; - } - String orderstr = " order by floor_id desc,morder asc"; - List patrolPoints = this.patrolPointService.selectListByWhere(wherestr + orderstr); - JSONArray json = new JSONArray(); - if(patrolPoints!=null && patrolPoints.size()>0){ - for(int i=0;i list = this.riskLevelService.selectListByWhere(whereStr); - //默认选中巡检点 - - model.addAttribute("riskLevelIds", riskLevelIds); - model.addAttribute("patrolPlanunitId",request.getParameter("bizId")); - return "timeefficiency/showAllPatrolRiskLevelForSelect"; - } - - @RequestMapping("/updateMPoints.do") - public String updateMPoints(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String patrolPointId= request.getParameter("patrolPointId"); - String mPointIds= request.getParameter("mPointIds"); - this.patrolPointMeasurePointService.deleteByWhere("where patrol_point_id ='"+patrolPointId+"'"); - int result =0; - String[] idArrary=mPointIds.split(","); - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - PatrolPointMeasurePoint patrolPointMeasurePoint = new PatrolPointMeasurePoint(); - patrolPointMeasurePoint.setId(CommUtil.getUUID()); - patrolPointMeasurePoint.setInsdt(CommUtil.nowDate()); - patrolPointMeasurePoint.setInsuser(cu.getId()); - patrolPointMeasurePoint.setPatrolPointId(patrolPointId); - patrolPointMeasurePoint.setMeasurePointId(str); - result += this.patrolPointMeasurePointService.save(patrolPointMeasurePoint); - } - } - - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateEquipmentCards.do") - public String updateEquipmentCards(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String patrolPointId= request.getParameter("patrolPointId"); - String equipmentCardIds= request.getParameter("equipmentCardIds"); - this.patrolPointEquipmentCardService.deleteByWhere("where patrol_point_id ='"+patrolPointId+"'"); - int result =0; - String[] idArrary=equipmentCardIds.split(","); - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - PatrolPointEquipmentCard patrolPointEquipmentCard = new PatrolPointEquipmentCard(); - patrolPointEquipmentCard.setId(CommUtil.getUUID()); - patrolPointEquipmentCard.setInsdt(CommUtil.nowDate()); - patrolPointEquipmentCard.setInsuser(cu.getId()); - patrolPointEquipmentCard.setPatrolPointId(patrolPointId); - patrolPointEquipmentCard.setEquipmentCardId(str); - result += this.patrolPointEquipmentCardService.save(patrolPointEquipmentCard); - } - } - - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateCameras.do") - public String updateCameras(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String patrolPointId= request.getParameter("patrolPointId"); - String cameraIds= request.getParameter("cameraIds"); - this.patrolPointCameraService.deleteByWhere("where patrol_point_id ='"+patrolPointId+"'"); - int result =0; - String[] idArrary=cameraIds.split(","); - for (String str : idArrary) { - if(str !=null && !str.isEmpty()){ - PatrolPointCamera patrolPointCamera = new PatrolPointCamera(); - patrolPointCamera.setId(CommUtil.getUUID()); - patrolPointCamera.setPatrolPointId(patrolPointId); - patrolPointCamera.setCameraId(str); - result += this.patrolPointCameraService.save(patrolPointCamera); - } - } - - String resstr="{\"res\":\""+result+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getMPoints.do") - public ModelAndView getMPoints(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = " where 1=1 "; - if(request.getParameter("patrolPointId")!=null && !request.getParameter("patrolPointId").isEmpty()){ - wherestr += " and patrol_point_id = '"+request.getParameter("patrolPointId")+"' "; - } - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - - PageHelper.startPage(page, rows); - List list = this.patrolPointMeasurePointService.selectListByWhereMPoint(request.getParameter("unitId"), wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getEquipmentCards.do") - public ModelAndView getEquipmentCards(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " m.morder "; - } - if(order==null){ - order = " asc "; - } -// String orderstr=" order by "+sort+" "+order; - String orderstr=" order by m.insdt "; - - String wherestr = " where 1=1 and e.id is not null ";//有些台帐里面删掉的设备 导致无法查询出来 去除 - if(request.getParameter("patrolPointId")!=null && !request.getParameter("patrolPointId").isEmpty()){ - wherestr += " and m.patrol_point_id = '"+request.getParameter("patrolPointId")+"' "; - } - /*if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("processSectionId")+"' "; - }*/ - //String ppidString = request.getParameter("patrolPointId"); - //String bizdString = request.getParameter("bizId"); - PageHelper.startPage(page, rows); - List list = this.patrolPointEquipmentCardService.selectListByWhereEquipmentCard(wherestr+orderstr); - //如果传递记录id则查找设备是否巡检 - if(request.getParameter("patrolRecordId")!=null && !request.getParameter("patrolRecordId").isEmpty()){ - for(PatrolPointEquipmentCard patrolPointEquipmentCard :list){ - List patrolRecordPatrolEquipment = this - .patorlRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '"+request.getParameter("patrolRecordId")+"' and equipment_id = '"+patrolPointEquipmentCard.getEquipmentCardId()+"'"); - if(patrolRecordPatrolEquipment!=null&&patrolRecordPatrolEquipment.size()!=0){ - patrolPointEquipmentCard.setPatrolStatus(patrolRecordPatrolEquipment.get(0).getStatus()); - } - } - } - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getCameras.do") - public ModelAndView getCameras(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } -// String orderstr=" order by "+sort+" "+order; - String orderstr=" order by insdt "; - - String wherestr = " where 1=1 ";//有些台帐里面删掉的设备 导致无法查询出来 去除 - if(request.getParameter("patrolPointId")!=null && !request.getParameter("patrolPointId").isEmpty()){ - wherestr += " and patrol_point_id = '"+request.getParameter("patrolPointId")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.patrolPointCameraService.selectListByWhereCamera(wherestr+orderstr); - //如果传递记录id则查找设备是否巡检 - /*if(request.getParameter("patrolRecordId")!=null && !request.getParameter("patrolRecordId").isEmpty()){ - for(PatrolPointEquipmentCard patrolPointEquipmentCard :list){ - List patrolRecordPatrolEquipment = this - .patorlRecordPatrolEquipmentService.selectListByWhere(" where patrol_record_id = '"+request.getParameter("patrolRecordId")+"' and equipment_id = '"+patrolPointEquipmentCard.getEquipmentCardId()+"'"); - if(patrolRecordPatrolEquipment!=null&&patrolRecordPatrolEquipment.size()!=0){ - patrolPointEquipmentCard.setPatrolStatus(patrolRecordPatrolEquipment.get(0).getStatus()); - } - } - }*/ - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * APP接口。获取巡检点列表 - * @param request - * @param model - * @return - */ -/* @RequestMapping("/getList4APP.do") - public ModelAndView getList4APP(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by S.insdt desc"; - - String wherestr="where 1=1 "; - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and S.biz_id='"+request.getParameter("search_code")+"'"; - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - wherestr += " and S.unit_id='"+request.getParameter("unitId")+"'"; - } - if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - wherestr += " and process_section_id = '"+request.getParameter("processSectionId")+"' "; - } - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += " and S.type = '"+request.getParameter("type")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and s.name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and S.id in('"+ids.replace(",", "','")+"')"; - } - List list = this.patrolPointService.getPatrolPoints(wherestr+orderstr); - - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * APP接口。通过巡检测量点获取设备列表以及设备测量点 - * @param request - * @param model - * @return - *//* - @RequestMapping("/getEquipmentListByPatrolPoint4APP.do") - public ModelAndView getEquipmentListByPatrolPoint4APP(HttpServletRequest request,Model model) { - String result = ""; - try{ - if(request.getParameter("id")!=null && !request.getParameter("id").isEmpty()){ - String wherestr = " where patrol_point_id='"+request.getParameter("id")+"' order by equipment_card_id asc"; - List ppequip = this.patrolPointEquipmentCardService.selectListByWhere(wherestr); - int size = ppequip.size(); - wherestr = " where 1=1"; - for(int i =0;i equipmentList = this.equipmentCardService.selectListByWhere(wherestr+"')" + orderstr); - for(int j=0;j mPointList = this.mPointService.selectListByWhere4APP(request.getParameter("unitId"), wherestrM); - ppequip.get(j).getEquipmentCard().setmPoint4APP(mPointList); - String patrolRecordId = request.getParameter("patrolRecordId"); - if (patrolRecordId!=null && !patrolRecordId.isEmpty()) { - List pEs=patorlRecordPatrolEquipmentService.selectListByWhere("where patrol_record_id ='"+patrolRecordId+"' and equipment_id ='"+ppequip.get(j).getEquipmentCardId()+"'"); - if (pEs!=null && pEs.size()>0) { - ppequip.get(j).setPatrolStatus(pEs.get(0).getStatus()); - } - } - } - JSONArray json=JSONArray.fromObject(ppequip); - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json+"}"; - }else{ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - e.printStackTrace(); - } - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - /** - * edit里 获取安全任务计划下 关联的 风险等级评估项 - * 2021 0820 10点08 - * @param request - * @param model - * @return - */ - @RequestMapping("/getRiskLevelsOfPlan.do") - public ModelAndView getRiskLevelsOfPlan(HttpServletRequest request,Model model) { - String planId = request.getParameter("planId"); -// String wherestr = " where 1=1 and patrol_plan_id = '"+planId+"' and type = '"+PatrolRoute.Point_0+"' order by morder"; - - String wherestr = " where 1 = 1 "; - if (request.getParameter("planId") != null && !request.getParameter("planId").isEmpty()) { - wherestr += " and plan_id = '" + request.getParameter("planId") + "' "; - } -// List list = this.patrolPointService.selectListByWhere(wherestr); -// List list = this.patrolRouteService.selectListByPlan(wherestr); //old - - List list = this.patrolPlanRiskLevelService.selectListByWhere(wherestr); - - - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - - } - - - /** - * 删除计划下 配置的 风险等级评估项 - * 2021 0820 10:21:00 - * @param request - * @param model - * @return - */ -// @RequestMapping("/dodelete4PatrolPlan.do") - @RequestMapping("/dodeleteWhenPatrolPlan.do") - public ModelAndView dodelete4PatrolPlan(HttpServletRequest request,Model model) { - String id = request.getParameter("id"); - String planId = request.getParameter("planid"); -// int res = patrolRouteService.deleteById(id);// old delete -// int res = this.patrolPlanPatrolPointService.deleteById(id); - String whereStr= "where 1=1 and plan_id = '" + planId + "' and risk_level_id = '" + id +"'"; -// String whereString = String.format(format, args) -// int res = this.patrolPlanPatrolPointService.deleteById(id); - int res = this.patrolPlanRiskLevelService.deleteByWhere(whereStr); - -// .deleteById(id) - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取指定车间下的所有巡检点 - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolPointForUnitId.do") - public ModelAndView getPatrolPointForUnitId(HttpServletRequest request,Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - if(type==null){//目前没有该参数 默认运行点 加好后删除 - type = PatrolType.Product.getId(); - } - String wherestr = " where 1=1 and unit_id='"+unitId+"' and type = '"+type+"' order by morder"; - List list = this.patrolPointService.selectListByUnitId(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 保存计划下的关联的巡检点 lzh 后面再改 - * @param patrolPlanId 巡检计划id - * @param patrolPointIds 巡检点id - * @return - */ - @RequestMapping("/saveRoutePointForPlan.do") - public String saveRoutePointForPlan(HttpServletRequest request,Model model, - @RequestParam(value="patrolPlanId") String patrolPlanId, - @RequestParam(value="patrolPointIds") String patrolPointIds){ - User cu= (User)request.getSession().getAttribute("cu"); - - int res = this.patrolRouteService.saveByPlan(patrolPlanId,patrolPointIds,cu.getId()); - -// int res = this.patrolPlanPatrolPointService.save(entity); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } -// @RequestMapping("/saveRoutePointForPlan.do") -// public String saveRoutePointForPlan(HttpServletRequest request,Model model, -// @RequestParam(value="patrolPlanId") String patrolPlanId, -// @RequestParam(value="patrolPointIds") String patrolPointIds){ -// User cu= (User)request.getSession().getAttribute("cu"); -// -// int res = this.patrolRouteService.saveByPlan(patrolPlanId,patrolPointIds,cu.getId()); -// -//// int res = this.patrolPlanPatrolPointService.save(entity); -// Result result = Result.success(res); -// model.addAttribute("result",CommUtil.toJson(result)); -// return "result"; -// } - - /** - * 拖拽排序计划下的关联的巡检点 - * @param request - * @param model - * @return - */ - @RequestMapping("/updateRoutePointForPlan.do") - public String updateRoutePointForPlan(HttpServletRequest request,Model model, - @RequestParam(value="patrolPlanId") String patrolPlanId, - @RequestParam(value="ids") String ids){ - int res = this.patrolRouteService.updateByPlan(patrolPlanId,ids); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 删除计划下的关联的巡检点 - * @param request - * @param model - * @return - */ - @RequestMapping("/deleteRoutePointForPlan.do") - public String deleteRoutePointForPlan(HttpServletRequest request,Model model, - @RequestParam(value="id") String id, - @RequestParam(value="previousId") String previousId, - @RequestParam(value="nextId") String nextId){ - int res = this.patrolRouteService.deleteByPlan(id,previousId,nextId); - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - - /** - * 获取巡检记录下关联的巡检列表 sj 2020-04-24 平台手持端通用 - * ljl 2020-07-24 平台专用 - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolPointForRecord.do") - public ModelAndView getPatrolPointForRecord(HttpServletRequest request,Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String wherestr = " where patrol_record_id='"+patrolRecordId+"' and type = '"+PatrolRoute.Point_0+"' order by finishdt asc"; - List list = this.patrolRecordPatrolRouteService.selectListByWhere(wherestr); - Result result = Result.success(JSONArray.fromObject(list)); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取巡检记录下关联的巡检列表 - * ljl 2020-07-24 手持端专用 运行/设备通用 - * @param request - * @param model - * @return - */ - @RequestMapping("/getPatrolPointForRecord4APP.do") - public ModelAndView getPatrolPointForRecord4APP(HttpServletRequest request,Model model) { - String patrolRecordId = request.getParameter("patrolRecordId"); - String type = request.getParameter("type"); - JSONArray jsonArray = new JSONArray(); - if(TimeEfficiencyCommStr.PatrolType_Equipment.equals(type)){ - jsonArray=this.patrolRecordService.getPointAndEquipJson4Equipment(patrolRecordId); - }else if (TimeEfficiencyCommStr.PatrolType_Product.equals(type)) { - jsonArray=this.patrolRecordService.getPointJson4Product(patrolRecordId); - } - Result result = Result.success(jsonArray); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取 巡检点 下测量点(自动点) - * @param request - * @param model - * @return - */ - @RequestMapping("/getMPoint4APP.do") - public ModelAndView getMPoint4APP(HttpServletRequest request,Model model){ - String patrolPointId = request.getParameter("patrolPointId"); - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - List list = this.patrolPointMeasurePointService.selectList4MPoint(unitId,type,patrolPointId); - JSONArray json=JSONArray.fromObject(list); - Result result = Result.success(json); - model.addAttribute("result",CommUtil.toJson(result)); - return new ModelAndView("result"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/timeefficiency/ViolationRecordCountController.java b/src/com/sipai/controller/timeefficiency/ViolationRecordCountController.java deleted file mode 100644 index 9c0896e7..00000000 --- a/src/com/sipai/controller/timeefficiency/ViolationRecordCountController.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.timeefficiency.ViolationRecordCount; -import com.sipai.service.timeefficiency.ViolationRecordCountService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; - -@Controller -@RequestMapping("/timeEfficiency/violationRecordCount") -public class ViolationRecordCountController { -// @Resource -// PatrolRecordViolationRecordService patrolRecordViolationRecordService; - @Resource - private ViolationRecordCountService violationRecordCountService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request,Model model) { - return "/timeefficiency/violationRecordCountList"; - } - - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - String companyId,String deptId,String violationPerson, - String sdt,String edt, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - ViolationRecordCount vrc=new ViolationRecordCount(); - if(!"".equals(companyId) && null!=companyId) - vrc.setBizId(companyId); - - if(!"".equals(deptId) && null!=deptId) - vrc.setDeptId(deptId); - - if(!"".equals(violationPerson) && null!=violationPerson) - vrc.setViolationPerson(violationPerson); - - if(!"".equals(sdt) && null!=sdt) - vrc.setSdt(sdt); - - if(!"".equals(edt) && null!=edt) - vrc.setEdt(edt); - - PageHelper.startPage(page, rows); - List vrcList=violationRecordCountService.selectListByCondition(vrc); - PageInfo pInfo = new PageInfo(vrcList); - JSONArray jsonArray = JSONArray.fromObject(vrcList); - String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - //List prvrList=patrolRecordViolationRecordService.selectListByWhere("where work_id="+"'"+id+"'"); - //EquipmentLoseApply ela=equipmentLoseApplyService.selectById(id); - //ela.setTotalMoney((new BigDecimal(new DecimalFormat("#.00").format(ela.getTotalMoney())))); - //model.addAttribute("ela", ela); - model.addAttribute("workerId", id); - return "/timeefficiency/violationRecordCountView"; - } - -} diff --git a/src/com/sipai/controller/timeefficiency/WorkRecordController.java b/src/com/sipai/controller/timeefficiency/WorkRecordController.java deleted file mode 100644 index d334be3a..00000000 --- a/src/com/sipai/controller/timeefficiency/WorkRecordController.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.timeefficiency.WorkRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.WorkRecordService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -/** - * 工作记录 - * @author SJ - * - */ -@Controller -@RequestMapping("/timeEfficiency/workRecord") -public class WorkRecordController { - - @Resource - private WorkRecordService workRecordService; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - - @RequestMapping("/showWorkRecordlist.do") - public String showWorkRecordlist(HttpServletRequest request,Model model) { - return "/timeefficiency/workRecordList"; - } - @RequestMapping("/getWorkRecordlist.do") - public ModelAndView getWorkRecordlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - //User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " deptid "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("bizId")!=null && !request.getParameter("bizId").isEmpty()){ - wherestr += " and biz_id = '"+request.getParameter("bizId")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and contents like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.workRecordService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Company company =unitService.getCompById(companyId); - request.setAttribute("company", company); - return "timeefficiency/workRecordAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - WorkRecord workRecord = this.workRecordService.selectById(id); - model.addAttribute("workRecord", workRecord); - Company company =unitService.getCompById(workRecord.getBizId()); - model.addAttribute("company", company); - model.addAttribute("result",JSONObject.fromObject(model)); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute WorkRecord workRecord){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - workRecord.setId(id); - workRecord.setInsuser(cu.getId()); - workRecord.setInsdt(CommUtil.nowDate()); - workRecord.setReportperson(cu.getId()); - workRecord.setReporttime(CommUtil.nowDate()); - - int result =this.workRecordService.save(workRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute WorkRecord workRecord){ - int result = this.workRecordService.update(workRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+workRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - WorkRecord workRecord = this.workRecordService.selectById(id); - model.addAttribute("workRecord", workRecord); - return "timeefficiency/workRecordView"; - } - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.workRecordService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.workRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/timeefficiency/WorkerPositionController.java b/src/com/sipai/controller/timeefficiency/WorkerPositionController.java deleted file mode 100644 index fd6f4eef..00000000 --- a/src/com/sipai/controller/timeefficiency/WorkerPositionController.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.sipai.controller.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import io.swagger.annotations.Api; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.timeefficiency.WorkerPosition; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.WorkerPositionService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/timeEfficiency/workerPosition") -@Api(value = "/timeEfficiency/workerPosition", tags = "定位接口") -public class WorkerPositionController { - @Resource - private WorkerPositionService workerPositionService; - @Resource - private RedissonClient redissonClient; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/timeefficiency/workerPositionList"; - } - /*@RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " deptid "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "timeEfficiency/workerPosition/showList.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and biz_id like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_pid")!=null && !request.getParameter("search_pid").isEmpty()){ - - } - - PageHelper.startPage(page, rows); - List list = this.workerPositionService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - return "timeefficiency/workerPositionAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model) { - String workerPositionId = request.getParameter("id"); - WorkerPosition workerPosition = this.workerPositionService.selectById(workerPositionId); - model.addAttribute("workerPosition", workerPosition); - model.addAttribute("result", JSONObject.fromObject(workerPosition)); - return "timeefficiency/workerPositionEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute WorkerPosition workerPosition) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - workerPosition.setId(id); - workerPosition.setInsuser(cu.getId()); - workerPosition.setInsdt(CommUtil.nowDate()); - - int result = this.workerPositionService.save(workerPosition); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute WorkerPosition workerPosition) { - int result = this.workerPositionService.update(workerPosition); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + workerPosition.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.workerPositionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.workerPositionService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取人员巡检轨迹 - * - * @param patrolRecordId 巡检记录id - * @return - */ - @RequestMapping("/getTrajectory.do") - public String getTrajectory(HttpServletRequest request, Model model, - @RequestParam(value = "patrolRecordId") String patrolRecordId) { - JSONArray jsonArray = workerPositionService.selectListByWhere(patrolRecordId); - Result result = Result.success(jsonArray); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 接收app传来的定位信息 - * - * @param request - * @param model - * @param insuser - * @param latitude - * @param longitude - * @return - */ - @RequestMapping("/realtimePosition.do") - public String realtimePosition(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "latitude") String latitude, - @RequestParam(value = "longitude") String longitude) { - WorkerPosition workerPosition = new WorkerPosition(); - String id = CommUtil.getUUID(); - workerPosition.setId(id); - workerPosition.setInsuser(unitId); - workerPosition.setInsdt(CommUtil.nowDate()); - workerPosition.setLatitude(latitude); - workerPosition.setLongitude(longitude); - int result = this.workerPositionService.realtimePosition(workerPosition); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/workerPositionRealtimeMap.do") - public String workerPositionRealtimeMap(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "userId") String userId) { - RMap map_redis = redissonClient.getMap(CommString.REDIS_KEY_TYPE_RealtimePosition); - com.alibaba.fastjson.JSONObject jsonObject = map_redis.get(userId); - if (jsonObject != null) { - request.setAttribute("latitude", Float.parseFloat(jsonObject.get("latitude").toString())); - request.setAttribute("longitude", Float.parseFloat(jsonObject.get("longitude").toString())); - request.setAttribute("time", jsonObject.get("time")); - User user = userService.getUserById(userId); - if (user != null) { - request.setAttribute("userName", user.getCaption()); - } else { - request.setAttribute("userName", "-"); - } - } else { - model.addAttribute("result", "无定位信息"); - return "result"; - } - return "/timeefficiency/workerPositionRealtimeMap_" + unitId; - } - -} diff --git a/src/com/sipai/controller/user/BonusPointController.java b/src/com/sipai/controller/user/BonusPointController.java deleted file mode 100644 index ef617be4..00000000 --- a/src/com/sipai/controller/user/BonusPointController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.sipai.controller.user; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.ResourceBundle; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.junit.runners.Parameterized.Parameter; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.business.BusinessUnitHandleDetail; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.user.BonusPoint; -import com.sipai.entity.user.BonusPointRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.user.BonusPointRecordService; -import com.sipai.service.user.BonusPointService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import com.sipai.tools.SessionManager; - - -@Controller -@RequestMapping("/bonuspoint") -public class BonusPointController { - @Resource - private UserService userService; - @Resource - private BonusPointService bonusPointService; - @Resource - private BonusPointRecordService bonusPointRecordService; - - @RequestMapping("/getCurrentPoints.do") - public ModelAndView getCurrentPoints(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String wherestr= "where userId='"+cu.getId()+"' and edt>'"+CommUtil.nowDate()+"'"; - long points=0; - List bonusPoints = bonusPointService.selectListByWhere(wherestr); - for (BonusPoint bonusPoint : bonusPoints) { - points+=bonusPoint.getPoint(); - } - String result="{\"res\":"+points+"}"; - - - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 添加发起问题-保养 - * */ - @RequestMapping("/showBonusPoints.do") - public String showBonusPoints(HttpServletRequest request,Model model){ - return "user/bonusPointList"; - } - /** - * 保存发起任务-保养*/ - @RequestMapping("/getBonusPoints.do") - public String getBonusPoints(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr="where 1=1 and userid='"+cu.getId()+"'"; - - PageHelper.startPage(page, rows); - List list = this.bonusPointRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - /** - * 保存发起任务-保养*/ - @RequestMapping("/purchaseWithPoint.do") - public String purchaseWithPoint(HttpServletRequest request,Model model){ - String userId = request.getParameter("userId"); - long point = Long.parseLong(request.getParameter("point")); - String reason ="消费"; - int res = this.bonusPointService.purchaseWithPoint(userId, point, reason); - - String result="{\"res\":"+res+"}"; - model.addAttribute("result",result); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/user/ExtSystemController.java b/src/com/sipai/controller/user/ExtSystemController.java deleted file mode 100644 index d9620eb6..00000000 --- a/src/com/sipai/controller/user/ExtSystemController.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.sipai.controller.user; - -import java.io.UnsupportedEncodingException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.HttpUtil; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/user/extsystem") -public class ExtSystemController { - @Resource - private ExtSystemService extSystemService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/user/extSystemList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "user/extsystem/showlist.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.extSystemService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "user/extSystemAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String extSystemId = request.getParameter("id"); - ExtSystem extSystem = this.extSystemService.selectById(extSystemId); - model.addAttribute("extSystem", extSystem); - return "user/extSystemEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ExtSystem extSystem){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - extSystem.setId(id); - extSystem.setInsuser(cu.getId()); - extSystem.setInsdt(CommUtil.nowDate()); - - int result = this.extSystemService.save(extSystem); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ExtSystem extSystem){ - int result = this.extSystemService.update(extSystem); - String resstr="{\"res\":\""+result+"\",\"id\":\""+extSystem.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.extSystemService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.extSystemService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model) { - return "/user/extSystemListForSelect"; - } - - /** - * 请求企业微信审批数据 - * @param request - * @param model - * @param start 必须,获取审批记录的开始时间,格式为“YYYY-MM-DD hh:mm:ss” - * @param end 必须,获取审批记录的结束时间,格式为“YYYY-MM-DD hh:mm:ss” - * @param next_spnum 非必须,第一个拉取的审批单号,不填从该时间段的第一个审批单拉取 - * @return - */ - @RequestMapping("/getQyWeixinApprList.do") - public String getQyWeixinApprList(HttpServletRequest request,Model model, - @RequestParam(value="start") String start, - @RequestParam(value="end") String end) { - - JSONObject json = new JSONObject(); - JSONArray jsonarr = new JSONArray(); - String access_token = ""; - int num = 1; - HttpSession newSession = request.getSession(true); - if(newSession.getAttribute("access_token")!=null){ - access_token = newSession.getAttribute("access_token").toString();//access_token时效2小时,session时效需大于2小时 - }else{ - HttpUtil hu = new HttpUtil(); - String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wxfc73469c6d29b87c&corpsecret=43lns40GCaySKJZgz1snsbGBZsXsjB1kCvf4mq3z_Sg"; - System.out.println(url); - String str = hu.sendGet(url); - json = JSONObject.fromObject(str); - if(json != null){ - access_token = json.getString("access_token").toString();//设置session - newSession.setAttribute("access_token", access_token); - } - } - String next_spnum = request.getParameter("next_spnum"); - json = extSystemService.getQyWeixinApprData(access_token,start,end,next_spnum); - jsonarr.add(json); - if(json !=null && json.get("errmsg").toString().equals("ok")){ - if(json.get("total")!=null){ - num = Integer.valueOf(json.get("total").toString())/10000+1;//请求次数 - } - if(num>1){//数据大于10000条需多次请求,每次最多返回一万条 - for(int i=0;i list = this.extSystemService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/user/JobController.java b/src/com/sipai/controller/user/JobController.java deleted file mode 100644 index 77bdae67..00000000 --- a/src/com/sipai/controller/user/JobController.java +++ /dev/null @@ -1,538 +0,0 @@ -package com.sipai.controller.user; - -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.dao.activiti.ModelNodeJobDao; -import com.sipai.entity.base.Tree; -import com.sipai.entity.enums.PositionTypeEnum; -import org.activiti.engine.RepositoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Job; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserJob; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserJobService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; - - -@Controller -@RequestMapping("/user") -public class JobController { - @Resource - private JobService jobService; - @Resource - private UnitService unitService; - @Resource - private UserJobService userJobService; - @Resource - private UserService userService; - @Autowired - RepositoryService repositoryService; - @Resource - private ModelNodeJobDao modelNodeJobDao; - - @RequestMapping("/showListJob.do") - public String showlist(HttpServletRequest request, Model model) { - return "user/jobList"; - } - - @RequestMapping("/getListJob.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - String bizId, String search_name, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - if (sort == null) { - sort = " id "; - } - if (order == null) { - order = " desc "; - } - - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (null != search_name && !"".equals(search_name)) { - wherestr += " and name like '%" + search_name + "%' "; - } - - if (null != bizId && !"".equals(bizId)) { - wherestr += " and biz_id= " + "'" + bizId + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.jobService.selectListByWhere(wherestr + orderstr); - for (Job item : list) { - //职位类型名称转换 - item.setlevelTypeName(PositionTypeEnum.getNameByid(item.getLevelType())); - } - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonJob.do") - public ModelAndView getJsonJob(HttpServletRequest request, Model model) { - String orderstr = " order by pri asc "; - String wherestr = " where 1=1 "; - List list = this.jobService.selectListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getJobs.do") - public ModelAndView getJobs(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " pid ";//morder - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 ";//CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and name like '%" + request.getParameter("search_name") + "%' "; - } - - if (request.getParameter("search_pid") != null && !request.getParameter("search_pid").isEmpty()) { - wherestr += "and biz_id like '%" + request.getParameter("search_pid") + "%' "; - } - - - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - //格式化ids - String[] idArray = checkedIds.split(","); - String ids = ""; - for (String str : idArray) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += str; - } - wherestr += " or id in('" + ids.replace(",", "','") + "')"; - orderstr = " order by CHARINDEX(','+ id +',','," + ids + ",') desc"; - } - - PageHelper.startPage(pages, pagesize); - List list = this.jobService.selectListByWhere(wherestr + orderstr); - - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonJobByUnit.do") - public ModelAndView getJsonJobByUnit(HttpServletRequest request, Model model) { - List list = this.jobService.selectListByUnitid(request.getParameter("unitid")); - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 根据用户id查询用户职位 - * - * @param userId : 用户id - * @return - * @author lichen - * @date 2021/10/14 15:02 - **/ - @RequestMapping("/getJsonJobByUser.do") - public ModelAndView getJsonJobByUser(HttpServletRequest request, Model model, - @RequestParam String userId) { - String result = ""; - List list = this.jobService.selectListByUserId(userId); - if (list == null || list.size() == 0) { - result = "{}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - result = JSONArray.fromObject(list).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/addJob.do") - public String addJob(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - String positionID = company.getEname() + "-XZZW-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - Unit unit = unitService.getUnitById(companyId); - request.setAttribute("unit", unit); - request.setAttribute("positionID", positionID); - model.addAttribute("positionTypeList", PositionTypeEnum.getAllEnableType4JSON()); - return "user/jobAdd"; - } - - @RequestMapping("/saveJob.do") - public String saveJob(HttpServletRequest request, Model model, - String pid, String positionID, String positionName, String userId, int levelType) { - - User cu = (User) request.getSession().getAttribute("cu"); - Job job = new Job(); - job.setId(positionID); - job.setInsdt(CommUtil.nowDate()); - job.setInsuser(cu.getId()); - job.setBizId(pid); - job.setName(positionName); - job.setSerial(java.util.UUID.randomUUID().toString()); - job.setLevelType(levelType); - - int result = 0; - result = this.jobService.save(job); - if (result > 0) { - UserJob uj = new UserJob(); - if (null != userId && !"".equals(userId)) { - uj.setInsdt(CommUtil.nowDate()); - uj.setInsuser(cu.getId()); - uj.setJobid(positionID); - uj.setSerial(job.getSerial()); - if (userId.indexOf(",") != -1) { - String[] userIds = userId.split(","); - for (String userIdTemp : userIds) { - uj.setId(CommUtil.getUUID()); - uj.setUserid(userIdTemp); - userJobService.save(uj); - result++; - } - } else { - uj.setId(CommUtil.getUUID()); - uj.setUserid(userId); - userJobService.save(uj); - result++; - } - } - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/editJob.do") - public String editJob(HttpServletRequest request, Model model, - String id, String companyId) { - String where = "where id=" + "'" + id + "'" + "order by id desc"; - List jobList = this.jobService.selectListByWhere(where); - //ArrayList userArray=null; - String userIds = ""; - for (Job jobId : jobList) { - if (jobId.getUser() != null) { - for (User user : jobId.getUser()) { - userIds += user.getId() + ","; - } - } - } - model.addAttribute("jobList", jobList); - model.addAttribute("userIds", userIds); - Unit unit = unitService.getUnitById(companyId); - request.setAttribute("unit", unit); - model.addAttribute("positionTypeList", PositionTypeEnum.getAllEnableType4JSON()); - - return "/user/jobEdit"; - - } - - @RequestMapping("/updateJob.do") - public String updateJob(HttpServletRequest request, Model model, - String pid, String positionID, - String positionName, String userId, int levelType) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - Job job = new Job(); - job.setId(positionID); - job.setBizId(pid); - job.setName(positionName); - job.setLevelType(levelType); - result = jobService.update(job); - String where = "where jobid=" + "'" + positionID + "'"; - List ujList = userJobService.selectListByWhere(where); - UserJob uj = null; - if (ujList.size() > 0 && !ujList.isEmpty() && null != ujList) { - uj = new UserJob(); - uj.setJobid(positionID); - //uj.setId(ujList.get(0).getId()); - boolean flag = false; - if (userId.indexOf(",") != -1) { - if (false == flag) { - result = userJobService.deleteByWhere("where jobid=" + "'" + positionID + "'"); - flag = true; - } - String[] userIds = userId.split(","); - for (String userIdTemp : userIds) { - uj.setId(CommUtil.getUUID()); - uj.setInsdt(CommUtil.nowDate()); - uj.setInsuser(cu.getId()); - uj.setUserid(userIdTemp); - result = userJobService.save(uj); - result++; - } - } else { - - if (null != userId && !"".equals(userId)) { - if (false == flag) { - result = userJobService.deleteByWhere("where jobid=" + "'" + positionID + "'"); - flag = true; - } - uj.setId(CommUtil.getUUID()); - uj.setInsdt(CommUtil.nowDate()); - uj.setInsuser(cu.getId()); - uj.setUserid(userId); - result = userJobService.save(uj); - } else { - result = userJobService.update(uj); - } - - result++; - } - } else { - - uj = new UserJob(); - uj.setInsdt(CommUtil.nowDate()); - uj.setInsuser(cu.getId()); - uj.setJobid(positionID); - if (userId.indexOf(",") != -1) { - String[] userIds = userId.split(","); - for (String userIdTemp : userIds) { - uj.setId(CommUtil.getUUID()); - uj.setUserid(userIdTemp); - result = userJobService.save(uj); - result++; - } - } else { - uj.setId(CommUtil.getUUID()); - uj.setUserid(userId); - result = userJobService.save(uj); - result++; - } - - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deleteJob.do") - public String deleteJob(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = 0; - result = userJobService.deleteByWhere("where jobid=" + "'" + id + "'"); - result = this.jobService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletesJob.do") - public String deletesJob(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - int result = 0; - String[] idStr = ids.split(","); - for (String id : idStr) { - userJobService.deleteByWhere("where jobid=" + "'" + id + "'"); - jobService.deleteById(id); - result++; - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showJob4Selects.do") - public String showJob4Selects(HttpServletRequest request, Model model, - @RequestParam(value = "modelid") String modelId, - @RequestParam(value = "resourceid") String resourceId, - @RequestParam(value = "bizid") String bizId) { - String orderstr = " order by id desc"; - String wherestr = " where 1=1 "; - - - if (null != bizId && !"".equals(bizId)) { - wherestr += " and biz_id= " + "'" + bizId + "'"; - } - String jobIds = request.getParameter("jobIds"); - if (jobIds != null && !jobIds.isEmpty()) { - List list = this.jobService.selectListByWhere("where id in ('" + jobIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + jobIds + ",')"); - model.addAttribute("jobs", JSONArray.fromObject(list)); - } - List list = this.jobService.selectListByWhere(wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("json", json); - model.addAttribute("modelId", modelId);//模型id - model.addAttribute("resourceId", resourceId);//流程节点id - return "user/job4selects"; - } - - @RequestMapping("/jobForSelectByStructure.do") - public String jobForSelectByStructure(HttpServletRequest request, Model model) { - String jobIds = request.getParameter("jobIds"); - if (jobIds != null && !jobIds.isEmpty()) { - List list = this.jobService.selectListByWhere("where id in ('" + jobIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + jobIds + ",')"); - model.addAttribute("jobs", JSONArray.fromObject(list)); - } - return "user/jobForSelectByStructure"; - } - - @RequestMapping("/getJobsByIds.do") - public String getJobsByIds(HttpServletRequest request, Model model) { - String jobIds = request.getParameter("jobIds"); - List list = this.jobService.selectListByWhere("where id in ('" + jobIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + jobIds + ",')"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getJobForSelects.do") - public ModelAndView getJobForSelects(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and (name like '%" + request.getParameter("search_name") + "%' or name like '%" + request.getParameter("search_name") + "%') "; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - List plist = this.unitService.getParentChildrenByUnitid(request.getParameter("pid")); - String pids = ""; - if (plist != null && plist.size() > 0) { - for (int p = 0; p < plist.size(); p++) { - pids += plist.get(p).getId() + ","; - } - } - wherestr += " and biz_id in ('" + pids.replace(",", "','") + "') "; - } - PageHelper.startPage(page, rows); - List list = this.jobService.selectListByWhere(wherestr + orderstr); - PageInfo pageInfo = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pageInfo.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存流程节点的职位 - * - * @param request - * @param model - * @param jobIds 职位ids - * @param resourceId 流程模板节点id - * @param modelId 流程模板id - * @return - */ - @RequestMapping("/updateModelNodeJob.do") - public String updateModelNodeJob(HttpServletRequest request, Model model, - @RequestParam("jobids") String jobIds, @RequestParam("resourceid") String resourceId, @RequestParam("modelid") String modelId) { - int result = this.jobService.updateModelNodeJob(resourceId, modelId, jobIds); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/findUser.do") - public String findUserByCompanyId(HttpServletRequest request, Model model, String userIdsStr) { - if (!"".equals(userIdsStr) && null != userIdsStr) { - String userIdsSubStr = userIdsStr.substring(0, userIdsStr.length() - 1); - model.addAttribute("users", userIdsSubStr); - } - //return "user/userForSelectByCompanyNew"; - return "user/findUser"; - } - - @ResponseBody - @RequestMapping("/findUserByIds.do") - public List findUserByIds(HttpServletRequest request, Model model, String userIdsStr) { - List result = new ArrayList(); - if (!"".equals(userIdsStr) && null != userIdsStr) { - - String userIdsSubStr = userIdsStr.substring(0, userIdsStr.length() - 1); - String[] ids = userIdsSubStr.split(","); - for (String id : ids) { - Map users = new HashMap(); - User user = userService.getUserById(id); - users.put("id", id); - users.put("name", user.getName()); - users.put("caption", user.getCaption()); - users.put("deptName",user.get_pname()); - result.add(users); - } - - - } - - return result; - } - - /** - * 获取流程第一步的节点岗位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getJobs4Activiti.do") - public ModelAndView getJobs4Activiti(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type");//类型类型 ProcessType.Workorder_Abnormity_Facilities 这种 - String ids = jobService.getJobs4Activiti(unitId, type); - model.addAttribute("result", ids); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/user/MenuController.java b/src/com/sipai/controller/user/MenuController.java deleted file mode 100644 index 91739bb0..00000000 --- a/src/com/sipai/controller/user/MenuController.java +++ /dev/null @@ -1,397 +0,0 @@ -package com.sipai.controller.user; - -import com.sipai.entity.base.Tree; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.RoleMenu; -import com.sipai.entity.user.User; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.RoleService; -import com.sipai.tools.ArchivesLog; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -@Controller -@RequestMapping("/user") -public class MenuController { - @Resource - private MenuService menuService; - - @Resource - private RoleService roleService; - - @RequestMapping("/showMenuListByCu.do") - public String showMenuListByCu(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - List list = this.menuService.getFullPower(cu.getId()); - if(list!=null &&list.size()>0){ - for(int i=list.size()-1;i>=0;i--){ - Menu menu=list.get(i); - if((menu.getType() !=null && menu.getType().equals("func")) - || (menu.getActive() !=null && menu.getActive().equals("禁用"))){ - list.remove(i); - } - } - } - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - list=this.menuService.getMenuListByWhereAndList(wherestr,list); - } - model.addAttribute("menulist",list); - if(request.getParameter("ng") != null){ - /*List tree = new ArrayList(); - for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - node.setIconCls(resource.getImage()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("action", resource.getAction()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree); - model.addAttribute("result", "{\"res\":"+json.toString()+"}");*/ - String result = menuService.getTreeList(null, list); - model.addAttribute("result", result); - return "result"; - } - return "menuitems"; - } - @RequestMapping("/showMenuTree.do") - public String showMenuTree(HttpServletRequest request,Model model){ - return "user/menuManage"; - } - @RequestMapping("/showMenu4Select.do") - public String showMenu4Select(HttpServletRequest request,Model model){ - return "user/menu4select"; - } - @RequestMapping("/showMenuAdd.do") - public String doadd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - Menu menu= menuService.getMenuById(pid); - model.addAttribute("pname",menu.getName()); - }else{ - pid = "-1"; - } - List menuList = menuService.selectListByWhere("where pid='"+pid+"' order by morder desc"); - int morder = 1; - if(menuList!=null && menuList.size()>0){ - if(menuList.get(0).getMorder()!=null){ - morder = menuList.get(0).getMorder()+1; - } - } - model.addAttribute("morder", morder); - return "user/menuAdd"; - } - - @RequestMapping("/showMenuEdit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Menu menu= menuService.getMenuById(id); - if(menuService.getMenuById(menu.getPid())!=null) - menu.set_pname(menuService.getMenuById(menu.getPid()).getName()); - model.addAttribute("menu",menu ); - return "user/menuEdit"; - } - - @RequestMapping("/saveMenu.do") - @ArchivesLog(operteContent = "新增菜单") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("menu") Menu menu){ - menu.setId(CommUtil.getUUID()); - menu.setType("menu"); - if (menu.getPid()==null || menu.getPid().isEmpty()) { - menu.setPid("-1"); - } - int result = this.menuService.saveMenu(menu); - //model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/saveDefaultFunc.do") - @ArchivesLog(operteContent = "添加默认按钮") - public ModelAndView dosaveDefaultFunc(HttpServletRequest request,Model model, - @ModelAttribute("menu") Menu menu){ - int result=0; - //新增默认的功能:新增、删除、修改、查看全部、查看部门 - String base_action=""; - if(menu.getLocation()!=null && menu.getLocation().indexOf("/")>0){ - base_action = menu.getLocation().substring(0, menu.getLocation().lastIndexOf("/")+1); - } - String[][] str={{"新增",base_action+"add.do"},{"删除",base_action+"delete.do"},{"修改",base_action+"edit.do"}, - {"查看部门",base_action+"showlist.do?scope=dept"},{"查看全部",base_action+"showlist.do?scope=all"}}; - for(int i=0;i mlist = this.menuService.selectListByWhere(" where pid = '"+menu.getId()+"' and type='menu' "); - //判断是否有子菜单,有的话不能删除 - if(mlist!=null && mlist.size()>0){ - msg="请先删除子菜单"; - }else{ - result = this.menuService.deleteMenuById(menu.getId()); - if(result>0){ - //删除菜单下的按钮 - this.menuService.deleteByPid(menu.getId()); - - //删除菜单对应的权限 - List funclist = this.menuService.selectListByWhere(" where pid = '"+menu.getId()+"' and type='func' "); - funclist.add(menu); - String menuids=""; - for(int i=0;i list = this.menuService.selectListByWhere("where type='menu' order by morder"); - - /*List tree = new ArrayList(); - for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - node.setIconCls(resource.getImage()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("action", resource.getAction()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - List> list_result = null; - String search_name = request.getParameter("search_name"); - if(search_name!=null && !search_name.isEmpty()){ - List list_search = this.menuService.selectListByWhere("where type='menu' and name like '%"+search_name+"%' order by morder"); - if(list_search!=null && list_search.size()>0){ - list_result = new ArrayList>(); - for(Menu k: list_search) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - } - String json = menuService.getTreeList(list_result, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getMenusJsonWithFuncByRoleID.do") - public String getMenusJsonWithFunc(HttpServletRequest request,Model model, - @RequestParam String roleid){ - List list = this.menuService.selectListByWhere("where type='menu' order by morder"); - List list1 = menuService.getFuncByRoleId(roleid); - for (Menu resource : list) { - String str=""; - for(int j=0;j listChecked = this.roleService.getRoleFunc(roleid,resource.getId()); - if(listChecked!=null && listChecked.size()>0){ - resource.set_checked("true"); - }*/ - } - - String result = menuService.getTreeList(null, list); - /*List tree = new ArrayList(); - - JSONArray json = JSONArray.fromObject(tree);*/ -// System.out.println(json); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getFuncJson.do") - public String getFuncJson(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - List list = this.menuService.selectListByWhere("where type='func' and pid='"+id+"' order by morder"); - - JSONArray json = JSONArray.fromObject(list); - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 根据菜单ID获取功能权限 - * @param request - * @param model - * @param menuid - * @return - */ - @RequestMapping("/getFuncByMenuid.do") - public String getFuncByMenuid(HttpServletRequest request,Model model, - @RequestParam(value = "menuid") String menuid){ - List menulist = this.menuService.getFuncByMenuId(menuid); - JSONArray menujson=JSONArray.fromObject(menulist); - model.addAttribute("result","{\"total\":\""+menulist.size()+"\",\"rows\":"+menujson+"}"); - - return "result"; - } - - @RequestMapping("/getMenusJsonActive.do") - public String getMenusJsonActive(HttpServletRequest request,Model model){ - List list = this.menuService.selectListByWhere("where active='启用' and type='menu' order by morder"); - - List tree = new ArrayList(); - for (Menu resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(resource.getName()); - Map attributes = new HashMap(); - attributes.put("url", resource.getLocation()); - attributes.put("target", resource.getTarget()); - node.setAttributes(attributes); - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree); -// System.out.println(json); - model.addAttribute("result", json); - return "result"; - } - @RequestMapping("/showFuncAdd.do") - public String doFuncAdd(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid){ - if(pid!=null && !pid.equals("")){ - Menu menu= menuService.getMenuById(pid); - model.addAttribute("pid",menu.getId()); - model.addAttribute("_pname",menu.getName()); - } - return "user/menuFuncAdd"; - } - - @RequestMapping("/showFuncEdit.do") - public String doFuncEdit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Menu menu= menuService.getMenuById(id); - if(menuService.getMenuById(menu.getPid())!=null) - menu.set_pname(menuService.getMenuById(menu.getPid()).getName()); - model.addAttribute("menu",menu ); - return "user/menuFuncEdit"; - } - @RequestMapping("/saveFunc.do") - @ArchivesLog(operteContent = "增加按钮") - public String dosaveFunc(HttpServletRequest request,Model model, - @ModelAttribute Menu menu){ - menu.setId(CommUtil.getUUID()); - menu.setType("func"); - int result = this.menuService.saveMenu(menu); - model.addAttribute("result", "{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); - return "result"; - } - - @RequestMapping("/updateFunc.do") - @ArchivesLog(operteContent = "更新按钮") - public String doupdateFunc(HttpServletRequest request,Model model, - @ModelAttribute Menu menu){ - int result = this.menuService.updateMenu(menu); - model.addAttribute("result", "{\"res\":\""+result+"\",\"id\":\""+menu.getId()+"\"}"); - return "result"; - } - - @RequestMapping("/getMenuInfo.do") - public String getMenuInfo(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - List list = this.menuService.selectListByWhere("where id='"+id+"'"); - - model.addAttribute("result", JSONArray.fromObject(list)); - return "result"; - } - /** - * 根据菜单的location等获取其父子节点 - * */ - @RequestMapping("/getMenuRelation.do") - public String getMenuRelation(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - List list = this.menuService.getFullPower(cu.getId()); - if(list!=null &&list.size()>0){ - for(int i=list.size()-1;i>=0;i--){ - Menu menu=list.get(i); - if((menu.getType() !=null && menu.getType().equals("func")) - || (menu.getActive() !=null && menu.getActive().equals("禁用"))){ - list.remove(i); - } - } - } - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; - list=this.menuService.getMenuListByWhereAndList(wherestr,list); - } - if(request.getParameter("location")!=null && !request.getParameter("location").isEmpty()){ - wherestr += " and location='"+request.getParameter("location")+"'"; - list=this.menuService.getMenuListByWhereAndList(wherestr,list); - } - model.addAttribute("result", JSONArray.fromObject(list)); - return "result"; - } -} diff --git a/src/com/sipai/controller/user/MobileManagementController.java b/src/com/sipai/controller/user/MobileManagementController.java deleted file mode 100644 index f8c6d4e8..00000000 --- a/src/com/sipai/controller/user/MobileManagementController.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.sipai.controller.user; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.MobileManagement; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.user.MobileManagementService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/user/mobileManagement") -public class MobileManagementController { - @Resource - private MobileManagementService mobileManagementService; - @Resource - private UnitService unitService; - - @RequestMapping("/showMobileManagementList.do") - public String showlist(HttpServletRequest request,Model model) { - return "/user/mobileManagementList"; - } - @RequestMapping("/getMobileManagement.do") - public ModelAndView getMobileManagement(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - int pages = 0; - if(request.getParameter("page")!=null&&!request.getParameter("page").isEmpty()){ - pages = Integer.parseInt(request.getParameter("page")); - }else { - pages = 1; - } - int pagesize = 0; - if(request.getParameter("rows")!=null&&!request.getParameter("rows").isEmpty()){ - pagesize = Integer.parseInt(request.getParameter("rows")); - }else { - pagesize = 20; - } - String sort=""; - if(request.getParameter("sort")!=null&&!request.getParameter("sort").isEmpty()){ - sort = request.getParameter("sort"); - }else { - sort = " id ";//morder - } - String order=""; - if(request.getParameter("order")!=null&&!request.getParameter("order").isEmpty()){ - order = request.getParameter("order"); - }else { - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 ";//CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "and name like '%"+request.getParameter("search_name")+"%' "; - } - //若有公司查询条件则按公司查询,如果没有则按登录人的公司查询 - String ppid = request.getParameter("unitId"); - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - List unitlist=unitService.getUnitChildrenById(request.getParameter("unitId")); - String pidstr=""; - for(int i=0;i users=unitService.getChildrenUsersById(companyId); - String userIds=""; - for (User user : users) { - if(!userIds.isEmpty()){ - userIds+="','"; - } - userIds+=user.getId(); - } - if(!userIds.isEmpty()){ - wherestr += "and id in ('"+userIds+"') "; - } - } - - PageHelper.startPage(pages, pagesize); - List list = this.mobileManagementService.selectListByWhere(wherestr+orderstr); - - PageInfo page = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+page.getTotal()+",\"rows\":"+json+"}"; - - - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/addMobileManagement.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Unit unit =unitService.getUnitById(companyId); - request.setAttribute("unit", unit); - return "user/mobileManagementAdd"; - } - - @RequestMapping("/editMobileManagement.do") - public String doedit(HttpServletRequest request,Model model){ - String userId = request.getParameter("id"); - MobileManagement mobileManagement = this.mobileManagementService.selectById(userId); -// JSONArray rolesjson = JSONArray.fromObject(user.getRoles()); -// model.addAttribute("roles",rolesjson); - model.addAttribute("mobileManagement", mobileManagement); - return "user/mobileManagementEdit"; - } - - @RequestMapping("/saveMobileManagement.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("mobileManagement") MobileManagement mobileManagement){ - User cu= (User)request.getSession().getAttribute("cu"); - -// if(!this.userService.checkNotOccupied(user.getId(), user.getName())){ -// model.addAttribute("result", "{\"res\":\"用户名重复\"}"); -// return "result"; -// } -// if(user.getSerial()!=null&&!this.userService.checkSerialNotOccupied(user.getId(), user.getSerial())){ -// model.addAttribute("result", "{\"res\":\"工号重复\"}"); -// return "result"; -// } - if(mobileManagement.getDeviceid()!=null&&!this.mobileManagementService.checkCardidNotOccupied(mobileManagement.getId(), mobileManagement.getDeviceid())){ - model.addAttribute("result", "{\"res\":\"设备id重复\"}"); - return "result"; - } - String mobileManagementId = CommUtil.getUUID(); - mobileManagement.setId(mobileManagementId); - - int result = this.mobileManagementService.save(mobileManagement); - String resstr="{\"res\":\""+result+"\",\"id\":\""+mobileManagementId+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateMobileManagement.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("mobileManagement") MobileManagement mobileManagement){ - - if(mobileManagement.getDeviceid()!=null&&!this.mobileManagementService.checkCardidNotOccupied(mobileManagement.getId(), mobileManagement.getDeviceid())){ - model.addAttribute("result", "{\"res\":\"设备id重复\"}"); - return "result"; - } - - int result = this.mobileManagementService.update(mobileManagement); - String resstr="{\"res\":\""+result+"\",\"id\":\""+mobileManagement.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deleteMobileManagement.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.mobileManagementService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletesMobileManagement.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.mobileManagementService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/user/ProcessSectionController.java b/src/com/sipai/controller/user/ProcessSectionController.java deleted file mode 100644 index 57bce59d..00000000 --- a/src/com/sipai/controller/user/ProcessSectionController.java +++ /dev/null @@ -1,660 +0,0 @@ -package com.sipai.controller.user; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSON; -import com.google.gson.JsonArray; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.company.CompanyService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.enums.PatrolType; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.scada.PersonalMpCollection; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.ProcessSectionType; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.PersonalMpCollectionService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.ProcessSectionTypeService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/user/processSection") -public class ProcessSectionController { - @Resource - private ProcessSectionService processSectionService; - @Resource - private ProcessSectionTypeService processSectionTypeService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - @Resource - private PersonalMpCollectionService personalMpCollectionService; - @Resource - private CompanyService companyService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/user/processSectionList"; - } - - @RequestMapping("/showlistForSystem.do") - public String showlistForSystem(HttpServletRequest request, Model model) { - return "/user/processSectionListForSystem"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model) { - // 20190321 YYJ 4个参数改为非必需 - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by code asc"; - -// String wherestr="where 1=1 and pid = '"+request.getParameter("search_code")+"' "; - - String wherestr = "where 1=1 "; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or code like '%" + request.getParameter("search_name") + "%' )"; - } - - //平台厂Id - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "'"; - } - - //App厂Id -- 暂时不好改 先用 search_code 后面改为unitId - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("search_code") + "'"; - } - //App用 - if (request.getParameter("ps_id") != null && !request.getParameter("ps_id").isEmpty()) { - wherestr += " and id = '" + request.getParameter("ps_id") + "'"; - } - - PageHelper.startPage(pages, pagesize); - List list = this.processSectionService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getSelectList.do") - public ModelAndView getSelectList(HttpServletRequest request, Model model) { - List list = this.processSectionService.selectListByWhere("where 1=1"); - JSONArray resultList = new JSONArray(); - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("text", list.get(i).getName()); - resultList.add(jsonObject); - } - model.addAttribute("result", resultList); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistForSystem.do") - public ModelAndView getlistForSystem(HttpServletRequest request, Model model) { - // 20190321 YYJ 4个参数改为非必需 - String wherestr = "where 1=1 "; - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("unitId"); - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or code like '%" + request.getParameter("search_name") + "%' )"; - } - List list = this.processSectionService.selectListByWhere(bizid, wherestr); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - request.setAttribute("company", company); - return "user/processSectionAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model) { - String processSectionId = request.getParameter("id"); - ProcessSection processSection = this.processSectionService.selectById(processSectionId); - model.addAttribute("processSection", processSection); - Company company = unitService.getCompById(processSection.getPid()); - request.setAttribute("company", company); - return "user/processSectionEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute ProcessSection processSection) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - processSection.setId(id); - if (StringUtils.isNotBlank(processSection.getUnitId())) { - List processSections = processSectionService.selectListByWhere("where unit_id = '" + processSection.getUnitId() + "' and (code = '" + processSection.getCode() + "' or morder = '" + processSection.getMorder() + "')"); - if (processSections.size() > 0) { - String resstr = "{\"res\":\" 序号重复或顺序重复 \",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - } - processSection.setInsuser(cu.getId()); - processSection.setInsdt(CommUtil.nowDate()); - //2020-07-14 工艺段一个项目统一 - processSection.setPid("-1"); - int result = this.processSectionService.save(processSection); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + id + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute ProcessSection processSection) { - int result = this.processSectionService.update(processSection); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + processSection.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.processSectionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.processSectionService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request, Model model) { - return "/user/processSectionListForSelect"; - } - - /** - * id转名称,传名称跟id到巡检点前端方法 - * 2021-07-28 sj 将name改为sname - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getProcessSection4Select.do") - public String getProcessSection4Select(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.companyService.selectByPrimaryKey(companyId); - - String wherestr = "where 1=1 and active='" + CommString.Active_True + "' "; - if (company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { - String bizs = "";//公司下属所有厂id - List blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId); - if (blist != null && blist.size() > 0) { - for (int i = 0; i < blist.size(); i++) { - if (blist.get(i).getType().equals(CommString.UNIT_TYPE_BIZ)) { - bizs += blist.get(i).getId() + ","; - } - } - } - bizs = bizs.replace(",", "','"); - wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) "; - } else if (company.getType().equals(CommString.UNIT_TYPE_BIZ)) { - wherestr += " and unit_id='" + companyId + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - - String orderstr = " order by code asc"; - - List processSections = this.processSectionService.selectListByWhere(wherestr + orderstr); - JSONArray jsonArray = new JSONArray(); - if (processSections != null && processSections.size() > 0) { - for (int i = 0; i < processSections.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processSections.get(i).getCode()); - if (company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { - if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) { - jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")"); - } else { - jsonObject.put("text", processSections.get(i).getSname()); - } - } else if (company.getType().equals(CommString.UNIT_TYPE_BIZ)) { - jsonObject.put("text", processSections.get(i).getSname()); - } - - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - - } - - @RequestMapping("/getProcessSection4camera.do") - public String getProcessSection4camera(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); -// List processSections = this.processSectionService.selectListByWhere("where 1=1 "); - List processSections = this.processSectionService.selectListGroupBy("where b.bizId = '" + companyId + "' group by a.id,a.name,a.morder order by a.name asc"); - if (companyId == null || companyId.equals("")) { - processSections = this.processSectionService.selectListByWhere("where 1=1 order by name asc"); - } - JSONArray json = new JSONArray(); - if (processSections != null && processSections.size() > 0) { - for (int i = 0; i < processSections.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processSections.get(i).getId()); - jsonObject.put("text", processSections.get(i).getSname()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/getProcessSectionType4Select.do") - public String getProcessSectionType4Select(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - List processSectionTypes = this.processSectionTypeService.selectListByWhere("where biz_id = '" + companyId + "' order by insdt asc"); - JSONArray json = new JSONArray(); - if (processSectionTypes != null && processSectionTypes.size() > 0) { - for (int i = 0; i < processSectionTypes.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processSectionTypes.get(i).getId()); - jsonObject.put("text", processSectionTypes.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - //code转名称,传名称跟code到测量点清单前端方法 - @RequestMapping("/getProcessSection4SelectCode.do") - public String getProcessSection4SelectCode(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - List processSections = this.processSectionService.selectListByWhere("where pid = '" + companyId + "'"); - JSONArray json = new JSONArray(); - if (processSections != null && processSections.size() > 0) { - for (int i = 0; i < processSections.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processSections.get(i).getCode()); - jsonObject.put("text", processSections.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/getMPointByProcessSection4APP.do") - public ModelAndView getMPointByProcessSection4APP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by id"; - String result = ""; - String wherestr = " where 1=1 and active = '启用'"; - List mPoint4APP = new ArrayList(); - JSONArray json = new JSONArray(); - try { - if (request.getParameter("bizid") != null && !request.getParameter("bizid").toString().isEmpty()) { -// wherestr += " and [BizId] = '"+request.getParameter("bizid").toString()+"'"; - if (request.getParameter("processSectionCode") != null && !request.getParameter("processSectionCode").toString().isEmpty()) { - wherestr += " and processSectionCode ='" + request.getParameter("processSectionCode").toString() + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").toString().isEmpty()) { - wherestr += " and ParmName like'%" + request.getParameter("search_name").toString() + "%'"; - } - mPoint4APP = this.mPointService.selectListByWhere4APP(request.getParameter("bizid").toString(), wherestr + orderstr); - } - json = JSONArray.fromObject(mPoint4APP); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getMPointByProcessSection4APPLeftCollection.do") - public ModelAndView getMPointByProcessSection4APPLeftCollection(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by morder asc"; - String result = ""; - String wherestr = " where 1=1 and active = '启用' "; - List mPoint4APP = new ArrayList(); - JSONArray json = new JSONArray(); - try { - if (request.getParameter("bizid") != null && !request.getParameter("bizid").toString().isEmpty()) { - if (request.getParameter("processSectionCode") != null && !request.getParameter("processSectionCode").toString().isEmpty()) { - //app目前传的工艺段id 修改平方便 暂时平台去查成code - ProcessSection processSection = processSectionService.selectById(request.getParameter("processSectionCode")); - if (processSection != null) { - wherestr += " and processSectionCode ='" + processSection.getCode() + "'"; - } else { - wherestr += " and processSectionCode ='" + request.getParameter("processSectionCode").toString() + "'"; - } - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").toString().isEmpty()) { - wherestr += " and ParmName like'%" + request.getParameter("search_name").toString() + "%'"; - } - if (request.getParameter("isCollected") != null && request.getParameter("isCollected").length() > 0) { - if (request.getParameter("isCollected").equals("true")) { - List clist = this.personalMpCollectionService.selectListByWhere(request.getParameter("bizid"), " where userid='" + request.getParameter("userId") + "' and unit_id='" + request.getParameter("bizid") + "'"); - String cmpids = ""; - if (clist != null && clist.size() > 0) { - for (int c = 0; c < clist.size(); c++) { - cmpids += clist.get(c).getMpids() + ","; - } - } - cmpids = cmpids.replace(",", "','"); - wherestr += " and MPointCode in ('" + cmpids + "')"; - } - } - mPoint4APP = this.mPointService.selectListByWhere4APPLeftCollection(request.getParameter("bizid").toString(), wherestr + orderstr, request.getParameter("userId")); - } - json = JSONArray.fromObject(mPoint4APP); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - System.out.println(e); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - //2020-07-08 start - @RequestMapping("/selectEquipmentProcessSection.do") - public String selectEquipmentClass(HttpServletRequest request, Model model) { - - String companyId = request.getParameter("companyId"); - String processsectionId = request.getParameter("processsectionid"); - model.addAttribute("companyId", companyId); - model.addAttribute("processsectionId", processsectionId); - return "user/selectEquipmentProcessSection"; - } - - //2020-07-08 end - @RequestMapping("/getPatrolType4Select.do") - public String getPatrolType4Select(HttpServletRequest request, Model model) { - //type用于平台菜单传参 仅显示 传参的巡检类型 - String type = request.getParameter("type"); - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - if (type != null && !type.equals("")) { - //仅查特定type的菜单 - com.alibaba.fastjson.JSONArray jsonArray2 = JSON.parseArray(PatrolType.getAllPatrolType4JSON()); - for (Object jsonObject : jsonArray2) { - com.alibaba.fastjson.JSONObject jsonObject1 = JSON.parseObject(jsonObject.toString()); - if (jsonObject1.get("id").equals(type)) { - jsonArray.add(jsonObject1); - } - } - } else { - //其他菜单 - jsonArray = JSON.parseArray(PatrolType.getAllPatrolType4JSON()); - } - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/getPatrolType4SelectAndNull.do") - public String getPatrolType4SelectAndNull(HttpServletRequest request, Model model) { - String json = PatrolType.getAllPatrolType4AndNullJSON(); - model.addAttribute("result", json); - return "result"; - } - - //2021-01-26 sj 获取泵站工艺类型 树形 目前为一层 - @RequestMapping("/getProcessType4Tree.do") - public String getProcessType4Tree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - List processSections = this.processSectionTypeService.selectListByWhere("where biz_id = '" + unitId + "'"); - JSONArray json = new JSONArray(); - if (processSections != null && processSections.size() > 0) { - for (int i = 0; i < processSections.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processSections.get(i).getId()); - jsonObject.put("text", processSections.get(i).getName()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/getIndexList.do") - public ModelAndView getIndexList(HttpServletRequest request, Model model) { - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 6; - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - //平台厂Id - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "'"; - } - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or code like '%" + request.getParameter("search_name") + "%' )"; - } - PageHelper.startPage(pages, pagesize); - List list = this.processSectionService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 设备台账获取工艺段列表 目前为一级层级 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getList4EquipmentCard.do") - public String getList4EquipmentCard(HttpServletRequest request, Model model) { - String orderstr = " order by id"; - String wherestr = "where 1=1 "; - String unitId = request.getParameter("unitId"); - if (unitId != null && !unitId.isEmpty()) { - wherestr += " and unit_id = '" + unitId + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or code like '%" + request.getParameter("search_name") + "%' )"; - } - List list = this.processSectionService.selectListByWhere(wherestr + orderstr); - JSONArray jsonArray = new JSONArray(); - for (ProcessSection equipmentCard : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCard.getId()); -// jsonObject.put("name", equipmentCard.getName()); - jsonObject.put("text", equipmentCard.getName()); -// jsonObject.put("icon", TimeEfficiencyCommStr.PatrolEquipment); -// jsonObject.put("pid", "-1"); - -// JSONArray numArray = new JSONArray(); -// jsonObject.put("children", numArray); -// jsonObject.put("nodes", numArray);//珠海专用 - - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); -// model.addAttribute("result", "{\"treeList\":" + jsonArray + "}"); - return "result"; - } - - /** - * 设备台账获取工艺段列表 目前为一级层级 树形 - * sj 2021-07-27 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getList4EquipmentCardTree.do") - public String getList4EquipmentCardTree(HttpServletRequest request, Model model) { - String orderstr = " order by id"; - String wherestr = "where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or code like '%" + request.getParameter("search_name") + "%' )"; - } - List list = this.processSectionService.selectListByWhere(wherestr + orderstr); - JSONArray jsonArray = new JSONArray(); - for (ProcessSection equipmentCard : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentCard.getId()); - jsonObject.put("name", equipmentCard.getName()); - jsonObject.put("text", equipmentCard.getName()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - jsonObject.put("pid", "-1"); - - JSONArray numArray = new JSONArray(); - jsonObject.put("children", numArray); - jsonObject.put("nodes", numArray);//珠海专用 - - jsonArray.add(jsonObject); - } - model.addAttribute("result", "{\"treeList\":" + jsonArray + "}"); - return "result"; - } - - /** - * 工艺段 - 库 - 列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/libraryList.do") - public String libraryList(HttpServletRequest request, Model model) { - return "user/processSectionLibraryList"; - } - - /** - * 工艺段 - 库 - 新增 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doAdd_Library.do") - public String doAdd_Library(HttpServletRequest request, Model model) { - String id = CommUtil.getUUID(); - request.setAttribute("id", id); - return "user/processSectionLibraryAdd"; - } - - /** - * 工艺段 - 库 - 修改 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doEdit_Library.do") - public String doEdit_Library(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - ProcessSection processSection = this.processSectionService.selectById(id); - model.addAttribute("processSection", processSection); - return "user/processSectionLibraryEdit"; - } - - @RequestMapping("/refresh.do") - public String refresh(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.processSectionService.refresh(unitId, cu); - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/user/ProcessSectionScoreController.java b/src/com/sipai/controller/user/ProcessSectionScoreController.java deleted file mode 100644 index 548746aa..00000000 --- a/src/com/sipai/controller/user/ProcessSectionScoreController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.sipai.controller.user; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.ProcessSectionScore; -import com.sipai.entity.user.User; -import com.sipai.service.user.ProcessSectionScoreService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("user/processSectionScore") -public class ProcessSectionScoreController { - @Resource - private ProcessSectionScoreService processSectionScoreService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "user/processSectionScoreList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - String wherestr = "where 1=1 "; - -// if(request.getParameter("modeltypeid")!=null && !request.getParameter("modeltypeid").equals("")){ -// wherestr = "where modeltypeid = '"+request.getParameter("modeltypeid")+"'"; -// } - PageHelper.startPage(page, rows); - List list = this.processSectionScoreService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - - return "user/processSectionScoreAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("ProcessSectionScore") ProcessSectionScore processSectionScore){ - User cu= (User)request.getSession().getAttribute("cu"); - processSectionScore.setId(CommUtil.getUUID()); - processSectionScore.setInsuser(cu.getId()); - processSectionScore.setInsdt(CommUtil.nowDate()); -// scheduleJob.setStatus(Integer.valueOf(scheduleJob.getStatus())); - int result = this.processSectionScoreService.save(processSectionScore); - String resstr="{\"res\":\""+result+"\",\"id\":\""+processSectionScore.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ProcessSectionScore processSectionScore = this.processSectionScoreService.selectById(id); - model.addAttribute("processSectionScore", processSectionScore); - return "user/processSectionScoreEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ProcessSectionScore processSectionScore){ - User cu= (User)request.getSession().getAttribute("cu"); - processSectionScore.setUpsuser(cu.getId()); - processSectionScore.setUpsdt(CommUtil.nowDate()); -// scheduleJob.setStatus(Integer.valueOf(scheduleJob.getStatus())); - int result = this.processSectionScoreService.update(processSectionScore); - String resstr="{\"res\":\""+result+"\",\"id\":\""+processSectionScore.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.processSectionScoreService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request,Model model){ - List list = this.processSectionScoreService.selectListByWhere - ("where 1=1 "); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i unitlist=unitService.getUnitChildrenById(request.getParameter("search_pid")); -// String pidstr=""; -// for(int i=0;i list = this.roleService.getList(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJsonRole.do") - public ModelAndView getJsonRole(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String orderstr = " order by morder asc "; - //List company = this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_BIZ); -// String wherestr=" where bizid is not null"; -// String userType=unitService.doCheckBizOrNot(cu.getId()); - -// if(CommString.UserType_Biz.equals(userType)){ -// wherestr+=" and serial in('"+MaintenanceService.RoleSerial_Launch+"','"+MaintenanceService.RoleSerial_Applicant+"') "; -// }else if (CommString.UserType_Maintainer.equals(userType)) { -// wherestr+=" and serial in('"+MaintenanceService.RoleSerial_Maintainer+"','"+MaintenanceService.RoleSerial_Solver+"') "; -// } - JSONArray json = new JSONArray(); - List list = this.roleService.getList("where 1=1 " + orderstr); - for (Role role : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", role.getId()); - jsonObject.put("text", role.getName()); - json.add(jsonObject); - } - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 通过厂区bizid找权限 - */ - @RequestMapping("/getJsonRoleByBizid.do") - public ModelAndView getJsonRoleByBizid(HttpServletRequest request, Model model, - @RequestParam(value = "bizid") String bizid) { - String orderstr = " order by morder asc "; - String wherestr = " where bizid = '" + bizid + "'"; - JSONArray json = new JSONArray(); - List list = this.roleService.getList(wherestr + orderstr); - for (Role role : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", role.getId()); - jsonObject.put("text", role.getName() + "(" + role.getBizname() + ")"); - json.add(jsonObject); - } - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/addRole.do") - public String addRole(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - request.setAttribute("company", company); - model.addAttribute("id", CommUtil.getUUID()); - return "user/roleAdd"; - } - - @RequestMapping("/editRole.do") - public String editRole(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Role role = new Role(); - List roles = this.roleService.getList("where id='" + id + "'"); - if (roles != null && roles.size() > 0) { - role = roles.get(0); - } - model.addAttribute("role", role); - return "user/roleEdit"; - } - - @RequestMapping("/saveRole.do") - @ArchivesLog(operteContent = "新增权限") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("role") Role role) { - if (!this.roleService.checkNotOccupied(role.getId(), role.getName())) { - model.addAttribute("result", "{\"res\":\"权限名称重复\"}"); - return "result"; - } - role.setId(CommUtil.getUUID()); - int result = this.roleService.dosave(role); - model.addAttribute("result", "{\"res\":\"" + result + "\",\"id\":\"" + role.getId() + "\"}"); - return "result"; - } - - @RequestMapping("/updateRole.do") - @ArchivesLog(operteContent = "修改权限") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("role") Role role) { - if (!this.roleService.checkNotOccupied(role.getId(), role.getName())) { - model.addAttribute("result", "{\"res\":\"权限名称重复\"}"); - return "result"; - } - int result = this.roleService.doupdate(role); - model.addAttribute("result", "{\"res\":\"" + result + "\",\"id\":\"" + role.getId() + "\"}"); - return "result"; - } - - @RequestMapping("/deleteRole.do") - @ArchivesLog(operteContent = "删除权限") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.roleService.dodel(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showRoleMenu.do") - public String showRoleMenu(HttpServletRequest request, Model model, - @RequestParam(value = "roleid") String roleid) { - List list = menuService.getFinalMenuByRoleId(roleid); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("json", json); - List roles = roleService.getList("where id='" + roleid + "'"); - if (roles != null && roles.size() > 0) { - model.addAttribute("rolename", roles.get(0).getName()); - } - model.addAttribute("roleid", roleid); - return "user/roleMenu"; - } - - @RequestMapping("/updateRoleMenu.do") - @ArchivesLog(operteContent = "更新角色和菜单关系") - public String updateRoleMenu(HttpServletRequest request, Model model, - @RequestParam("menustr") String menustr, @RequestParam("roleid") String roleid) { - int result = this.roleService.updateRoleMenu(roleid, menustr); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showRoleUser.do") - public String showRoleUser(HttpServletRequest request, Model model, - @RequestParam(value = "roleid") String roleid) { - List list = this.roleService.getUserRole(roleid); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("json", json); - model.addAttribute("roleid", roleid); - return "user/roleUser"; - } - - @RequestMapping("/updateUserRole.do") - @ArchivesLog(operteContent = "根据角色,更新用户关系") - public String updateUserRole(HttpServletRequest request, Model model, - @RequestParam("userstr") String userstr, @RequestParam("roleid") String roleid) { - int result = this.roleService.updateUserRole(roleid, userstr); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/updateRoleUser.do") - @ArchivesLog(operteContent = "根据用户,更新角色关系") - public String updateRoleUser(HttpServletRequest request, Model model, - @RequestParam("rolestr") String rolestr, @RequestParam("userid") String userid) { - int result = this.roleService.updateRoleUser(userid, rolestr); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/updateRoleDept.do") - @ArchivesLog(operteContent = "根据部门,更新部门权限关系 用户和权限关系") - public String updateRoleDept(HttpServletRequest request, Model model, - @RequestParam("deptid") String deptid, - @RequestParam("rolestr_new") String rolestr_new, - @RequestParam("rolestr_old") String rolestr_old) { - int result = this.roleService.updateRoleDept(deptid, rolestr_new, rolestr_old); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/roleForSelect.do") - public String roleforselect(HttpServletRequest request, Model model) { - if (request.getParameter("roleids") != null) { - model.addAttribute("roleids", request.getParameter("roleids")); - } - return "user/roleForSelect"; - } - - @RequestMapping("/getRolesForSelect.do") - public ModelAndView getrolesforselect(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - - PageHelper.startPage(page, rows); - List list = this.roleService.getList(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/roleFuncForSelect.do") - public String roleFuncForSelect(HttpServletRequest request, Model model, - @RequestParam(value = "roleid") String roleid) { - List list = this.roleService.getRoleFunc(roleid); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("json", json); - - return "user/roleFuncForSelect"; - } - - @RequestMapping("/updateFuncByRoleMenu.do") - @ArchivesLog(operteContent = "根据角色和菜单,更新功能权限") - public String updateFuncByRoleMenu(HttpServletRequest request, Model model, - @RequestParam(value = "menuid") String menuid, @RequestParam(value = "roleid") String roleid, - @RequestParam(value = "funcstr") String funcstr) { - int result = this.roleService.updateFuncByRoleMenu(roleid, menuid, funcstr); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/user/UnitController.java b/src/com/sipai/controller/user/UnitController.java deleted file mode 100644 index 401754bf..00000000 --- a/src/com/sipai/controller/user/UnitController.java +++ /dev/null @@ -1,1434 +0,0 @@ -package com.sipai.controller.user; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.sparepart.Supplier_copy; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolPlanDept; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.*; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.MaintainerService; -import com.sipai.service.sparepart.Supplier_copyService; -import com.sipai.service.timeefficiency.PatrolPlanDeptService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.*; -import com.sipai.tools.ArchivesLog; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; - - -@Controller -@RequestMapping("/user") -public class UnitController { - @Resource - private UnitService unitService; - @Resource - private MaintainerService maintainerService; - @Resource - private UserService userService; - @Resource - private ExtSystemService extSystemService; - @Resource - private DeptProcessService deptProcessService; - @Resource - private DeptRoleService deptRoleService; - @Resource - private DeptAreaService deptAreaService; - @Resource - private Supplier_copyService supplierService1; - @Resource - private CompanyService companyService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private PatrolPlanDeptService patrolPlanDeptService; - - @RequestMapping("/showUnitTree.do") - public String showUnitTree(HttpServletRequest request, Model model) { - return "user/unitTree"; - } - - @RequestMapping("/getUnitsJson.do") - public String getUnitsJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - //List list = this.unitService.selectList(); - String type = request.getParameter("type"); - List list = new ArrayList<>(); - List companies = this.unitService.getCompanyByUserIdAndType(cu.getId(), type); - if (type == null || type.isEmpty()) { - for (Company company : companies) { - List item = this.unitService.getUnitChildrenById(company.getId()); - if (item != null) { - list.addAll(item); - } - } - } else { - String companiesIds = ""; - for (Company company : companies) { - if (!companiesIds.isEmpty()) { - companiesIds += "','"; - } - companiesIds += company.getId(); - } - List item = this.unitService.selectListByWhere("where id in('" + companiesIds + "')"); - if (item != null) { - list.addAll(item); - } - } - - //第一层节点的父节点为“-1”,才能正常展示 - HashSet h = new HashSet<>(list); - list.clear(); - list.addAll(h); - for (Unit unit : list) { - String pid = unit.getPid(); - boolean flag = false; - for (Unit unitc : list) { - if (unitc.getId().equals(pid)) { - flag = true; - break; - } - } - if (!flag) { - unit.setPid("-1"); - } - } - //list = this.unitService.selectList(); - /*List tree = new ArrayList(); - for (Unit resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - - node.setText(this.unitService.getSnameById(resource.getId())); - - if(!resource.getId().equals("-1")){ - if(resource.getType().equals("D")){ - node.setIconCls("ext-icon-group"); - }else if(resource.getType().equals("C")){ - node.setIconCls("ext-icon-house"); - } - } - - Map attributes = new HashMap(); - attributes.put("type", resource.getType()); - node.setAttributes(attributes); - tree.add(node); - } - - JSONArray json = JSONArray.fromObject(tree);*/ - String json = unitService.getTreeList(null, list); -// System.out.println(json); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showCompany.do") - public String showCompany(HttpServletRequest request, Model model) { - return "user/companyManage"; - } - - @RequestMapping("/showCompanyAdd.do") - public String showCompanyAdd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid, - @RequestParam(value = "type") String type) { - Unit parent = this.unitService.getUnitById(pid); - if (parent != null) { - model.addAttribute("pname", parent.getName()); - } else { - model.addAttribute("pname", ""); - } - model.addAttribute("type", type); - return "user/companyAdd"; - } - - @RequestMapping("/showCompanyEdit.do") - public String showCompanyEdit(HttpServletRequest request, Model model, - @RequestParam String id) { - Company company = unitService.getCompById(id); - model.addAttribute("company", company); - Unit parent = this.unitService.getUnitById(company.getPid()); - if (parent != null) { - model.addAttribute("pname", parent.getName()); - } else { - model.addAttribute("pname", ""); - } - - //所属标准库层级 - Unit parentLibrary = this.unitService.getUnitById(company.getLibraryBizid()); - if (parentLibrary != null) { - model.addAttribute("_bizid", parentLibrary.getName()); - } else { - model.addAttribute("_bizid", ""); - } - - if (request.getParameter("ng") != null) { - Object obj = JSONObject.fromObject(company); - String result = "{\"company\":" + obj + "}"; - model.addAttribute("result", result); - return "result"; - } - return "user/companyEdit"; - } - - @RequestMapping("/saveCompany.do") - @ArchivesLog(operteContent = "新增公司或厂区") - public ModelAndView doCompanySave(HttpServletRequest request, Model model, - @ModelAttribute Company t) { - //除水厂外id自动生成 - if (t.getId() == null || t.getId().length() == 0) { - t.setId(CommUtil.getUUID()); - } - if (t.getPid() == null || t.getPid().length() == 0) { - t.setPid(CommString.Tree_Root); - } - int result = this.unitService.saveComp(t); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + t.getId() + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/updateCompany.do") - @ArchivesLog(operteContent = "修改公司或厂区") - public ModelAndView doCompanyUpdate(HttpServletRequest request, Model model, - @ModelAttribute Company t) { - int result = this.unitService.updateComp(t); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + t.getId() + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteCompany.do") - @ArchivesLog(operteContent = "删除公司或厂区") - public ModelAndView doCompanyDelete(HttpServletRequest request, Model model, - @RequestParam String id) { - int result = unitService.deleteCompanyById(id); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/showDeptAdd.do") - public String showDeptAdd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - Unit parent = this.unitService.getUnitById(pid); - if (parent != null) { - model.addAttribute("pname", parent.getName()); - } else { - model.addAttribute("pname", ""); - } - return "user/deptAdd"; - } - - @RequestMapping("/showDeptEdit.do") - public String showDeptEdit(HttpServletRequest request, Model model, - @RequestParam String id) { - Dept dept = unitService.getDeptById(id); - //若是小组则寻找权限和工艺 - if (dept != null) { - String wherestr = " where D.deptid = '" + dept.getId(); - List roleList = this.deptRoleService.selectRoleListByDept(wherestr + "' order by R.morder"); - JSONArray rolesjson = JSONArray.fromObject(roleList); - model.addAttribute("roles", rolesjson); - /*List processSectionList = this.deptProcessService.selectProcessListByDept(wherestr+"' order by P.morder"); - JSONArray processSectionjson = JSONArray.fromObject(processSectionList); - model.addAttribute("processSection",processSectionjson);*/ - List patrolAreaList = this.deptAreaService.selectAreaListByDept(wherestr + "' order by P.insdt desc"); - JSONArray patrolAreajson = JSONArray.fromObject(patrolAreaList); - model.addAttribute("areas", patrolAreajson); - } - model.addAttribute("dept", dept); - Unit parent = this.unitService.getUnitById(dept.getPid()); - if (parent != null) { - model.addAttribute("pname", parent.getName()); - } else { - model.addAttribute("pname", ""); - } - if (request.getParameter("ng") != null) { - Object obj = JSONObject.fromObject(dept); - String result = "{\"dept\":" + obj + "}"; - model.addAttribute("result", result); - return "result"; - } - return "user/deptEdit"; - } - - @RequestMapping("/saveDept.do") - @ArchivesLog(operteContent = "新增部门") - public ModelAndView doDeptSave(HttpServletRequest request, Model model, - @ModelAttribute Dept t) { - t.setId(CommUtil.getUUID()); - if (t.getPid() == null || t.getPid().length() == 0) { - t.setPid(CommString.Tree_Root); - } - int result = this.unitService.saveDept(t); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + t.getId() + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/updateDept.do") - @ArchivesLog(operteContent = "修改部门") - public ModelAndView doDeptUpdate(HttpServletRequest request, Model model, - @ModelAttribute Dept t) { - if (CommString.Tree_Outsourcer.equals(t.getPid())) { - Supplier_copy sCopy = new Supplier_copy(); - sCopy.setId(t.getId()); - sCopy.setName(t.getName()); - this.supplierService1.update(sCopy); - } - int result = this.unitService.updateDept(t); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + t.getId() + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/deleteDept.do") - @ArchivesLog(operteContent = "删除部门") - public ModelAndView doDeptDelete(HttpServletRequest request, Model model, - @RequestParam String id) { - //20191101Add start - //删除部门相应的角色权限tb_dept_role - deptRoleService.deleteByWhere("where deptid=" + "'" + id + "'"); - //删除该部门相应的区域tb_dept_area - deptAreaService.deleteByWhere("where deptid=" + "'" + id + "'"); - //删除部门tb_dept - int result = this.unitService.deleteDeptById(id); - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 根据公司id获取部门 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getDeptByBizId4Select.do") - public String getDeptByBizId4Select(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - List depts = this.unitService.getDeptByPid(companyId); - JSONArray json = new JSONArray(); - if (depts != null && depts.size() > 0) { - int i = 0; - for (Dept dept : depts) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", dept.getId()); - jsonObject.put("text", dept.getName()); - json.add(jsonObject); - } - } else { - Dept dept = this.unitService.getDeptById(companyId); - JSONObject jsonObject = new JSONObject(); - if (dept != null) { - jsonObject.put("id", dept.getId()); - jsonObject.put("text", dept.getName()); - } else { - Company company = this.unitService.getCompById(companyId); - jsonObject.put("id", companyId); - jsonObject.put("text", company.getName()); - } - json.add(jsonObject); - } - - /** - * 用于常排 下发计划能够选择外包单位 - */ - List units = this.unitService.selectListByWhere("where type = '" + CommString.UNIT_TYPE_Maintainer + "' and pid!='-1'"); - if (units != null && units.size() > 0) { - for (Unit unit : units) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", unit.getId()); - jsonObject.put("text", unit.getSname()); - json.add(jsonObject); - } - } - - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 保存顺序 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/saveUnitOrder.do") - public ModelAndView saveUnitOrder(HttpServletRequest request, Model model, - @RequestParam String target, @RequestParam String source, @RequestParam String point) { - Unit unitSource = this.unitService.getUnitById(source); - Unit unitTarget = this.unitService.getUnitById(target); - - switch (point) { - case "append": - unitSource.setPid(unitTarget.getId()); - if (unitTarget.getMorder() == null) { - unitSource.setMorder(0); - } else { - unitSource.setMorder(unitTarget.getMorder() + 1); - } - break; - case "top": - unitSource.setPid(unitTarget.getPid()); - if (unitTarget.getMorder() == null) { - unitSource.setMorder(0); - } else { - unitSource.setMorder(unitTarget.getMorder() - 1); - } - break; - case "bottom": - unitSource.setPid(unitTarget.getPid()); - if (unitTarget.getMorder() == null) { - unitSource.setMorder(0); - } else { - unitSource.setMorder(unitTarget.getMorder() + 1); - } - break; - } - - int result = 0; - switch (unitSource.getType()) { - case "C": - Company compSource = new Company(); - compSource.setId(unitSource.getId()); - compSource.setPid(unitSource.getPid()); - compSource.setMorder(unitSource.getMorder()); - - result = this.unitService.updateComp(compSource); - break; - case "D": - Dept deptSource = new Dept(); - deptSource.setId(unitSource.getId()); - deptSource.setPid(unitSource.getPid()); - deptSource.setMorder(unitSource.getMorder()); - - result = this.unitService.updateDept(deptSource); - break; - } - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/synUnitsInfo.do") - public String synUnitsInfo(HttpServletRequest request, Model model) { - String param = request.getParameter("param"); - JSONArray json_Resp = new JSONArray(); - try { - JSONArray jsonArray = JSONArray.fromObject(param); - List list = JSONArray.toList(jsonArray, new Unit(), new JsonConfig()); - - for (Unit unit : list) { - int res = 0; - switch (unit.getSyncflag()) { - - case CommString.Sync_Insert: - res = unitService.saveUnit(unit); - break; - case ""://若无标识先尝试更新,更新时会查询是否存在,不存在会插入 - case CommString.Sync_Edit: - res = unitService.updateUnit(unit); - break; - case CommString.Sync_Delete: - res = unitService.deleteUnit(unit); - break; - - default: - break; - } - if (res == 1) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", unit.getId()); - jsonObject.put("type", unit.getType()); - jsonObject.put("syncflag", CommString.Sync_Finish); - json_Resp.add(jsonObject); - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - model.addAttribute("result", json_Resp.toString()); - return "result"; - } - - /** - * 获取厂区用户负责的厂区 - */ - @RequestMapping("/getBizsByUserId4Select.do") - public String getBizsByUserId4Select(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - try { - List companies = null; - if (companyId != null && !companyId.isEmpty()) { - companies = this.unitService.getCompaniesByWhere("where id ='" + companyId + "' "); - } else { - companies = this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_BIZ); - } - JSONArray json = new JSONArray(); - if (companies != null && companies.size() > 0) { - int i = 0; - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - model.addAttribute("result", ""); - } - - return "result"; - } - - /** - * 根据厂区id,获取厂区负责人员 - **/ - @RequestMapping("getResponsiblerByCompanyIdForSelect.do") - public String getResponsiblerByCompanyIdForSelect(HttpServletRequest request, Model model) { - String companyId = request.getParameter("pid"); - List users = this.unitService.getChildrenUsersById(companyId); - JSONArray json = new JSONArray(); - if (users != null && users.size() > 0) { - for (User user : users) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", user.getId()); - jsonObject.put("text", user.getCaption()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 获取运营商的公司信息 - */ - @RequestMapping("/getMaintenancesByUserId4Select.do") - public String getMaintenancesByUserId4Select(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - List companies = this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_Maintainer); - JSONArray json = new JSONArray(); - if (companies != null && companies.size() > 0) { - int i = 0; - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 根据登录用户获取厂区列表 - * 厂区人员-获取对应厂区 - * 运维商-获取可运维的厂区 - */ - @RequestMapping("/getSearchBizsByUserId4Select.do") - public String getSearchBizsByUserId4Select(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - JSONArray json = new JSONArray(); - /*String userType = this.unitService.doCheckBizOrNot(cu.getId()); - if(CommString.UserType_Maintainer.equals(userType)){ - List maintainers=this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_Maintainer); - List companies =new ArrayList<>(); - for (Company company : maintainers) { - List units_= maintainerService.getMaintainerCompany(company.getId()); - companies.addAll(units_); - } - - if(companies!=null && companies.size()>0){ - for (Company company : companies) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - } - - }else{*/ - - List companies0 = this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_COMPANY); - List companies = this.unitService.getCompanyByUserIdAndType(cu.getId(), CommString.UNIT_TYPE_BIZ); - List companies1 = this.unitService.selectListByWhere("where type = '" + CommString.UNIT_TYPE_Maintainer + "'"); - - if (companies0 != null && companies0.size() > 0) { - for (Company company : companies0) { -// if (company.getPid().equals("-1")) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getSname()); - json.add(jsonObject); -// } - } - } - if (companies != null && companies.size() > 0) { - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getSname()); - json.add(jsonObject); - } - } - /** - * 用于常排选择外包单位 - */ - /*if (companies1 != null && companies1.size() > 0) { - for (Unit unit : companies1) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", unit.getId()); - jsonObject.put("text", unit.getSname()); - json.add(jsonObject); - } - }*/ - /*}*/ -// System.out.println(json.toString()); - model.addAttribute("result", json.toString()); - return "result"; - } - - /* - * 获得厂区 - */ - @RequestMapping("/getSearchBizsBIZ4Select.do") - public String getSearchBizsBIZ4Select(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - - List companies = this.unitService.getCompanyByType(CommString.UNIT_TYPE_BIZ); - if (companies != null && companies.size() > 0) { - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - /*}*/ - System.out.println(json.toString()); - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 根据登录用户获取公司列表 - */ - @RequestMapping("/getUnitsByUserId4Select.do") - public String getUnitsByUserId4Select(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - JSONArray json = new JSONArray(); - List companies = this.unitService.getCompaniesByUserId(cu.getId()); - if (companies != null && companies.size() > 0) { - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 获取所有公司列表 - */ - @RequestMapping("/getUnits4Select.do") - public String getUnits4Select(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - JSONArray json = new JSONArray(); - List companies = this.unitService.getCompany(); - if (companies != null && companies.size() > 0) { - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 获取所有公司列表 - */ - @RequestMapping("/getCompany4Select.do") - public String getCompany4Select(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - List companies = this.unitService.getCompaniesByWhere("order by morder"); - if (companies != null && companies.size() > 0) { - for (Company company : companies) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 获取所有厂区信息 - */ - @RequestMapping("/getAllBizs.do") - public ModelAndView getAllBizs(HttpServletRequest request, Model model, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - //格式化ids - String[] idArray = checkedIds.split(","); - String ids = ""; - for (String str : idArray) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += str; - } - wherestr += " and id in('" + ids.replace(",", "','") + "')"; - orderstr = " order by CHARINDEX(','+ id +',','," + ids + ",') desc"; - } - wherestr += " and type='" + CommString.UNIT_TYPE_BIZ + "' "; - PageHelper.startPage(pages, pagesize); - List list = this.unitService.getCompaniesByWhere(wherestr + orderstr); - //运维商编辑可维护厂区时传入maintainerId,当运维商已匹配的维护厂区存在时,将维护的开始日期,结束日期,运维商负责人和厂区联系人加到厂区中。 - String maintainerId = request.getParameter("maintainerId"); - List maintainers = maintainerService.selectMaintainerCompanyList(maintainerId); - if (maintainers != null && maintainers.size() > 0) { - for (Company companyitem : list) { - //初始化Company中的maintainerCompany实体,防止maintainerCompany为null - MaintainerCompany maintainerCompany = new MaintainerCompany(); - companyitem.setMaintainerCompany(maintainerCompany); - for (MaintainerCompany item : maintainers) { - if (companyitem.getId().equals(item.getCompanyid())) { - if (item.getStartdate() != null && !item.getStartdate().equals("")) { - item.setStartdate(item.getStartdate().substring(0, 10)); - } - if (item.getEnddate() != null && !item.getEnddate().equals("")) { - item.setEnddate(item.getEnddate().substring(0, 10)); - } - String contacter = item.getFactorycontacter(); - String factorycontacter = ""; - if (contacter != null && !contacter.equals("")) { - String[] contacterArr = contacter.split(","); - for (int i = 0; i < contacterArr.length; i++) { - User user = this.userService.getUserById(contacterArr[i]); - if (factorycontacter != "") { - factorycontacter += ","; - } - factorycontacter += user.getCaption(); - } - } - String leader = item.getMaintainerleader(); - String maintainerleader = ""; - if (leader != null && !leader.equals("")) { - String[] leaderArr = leader.split(","); - for (int i = 0; i < leaderArr.length; i++) { - User user = this.userService.getUserById(leaderArr[i]); - if (maintainerleader != "") { - maintainerleader += ","; - } - maintainerleader += user.getCaption(); - } - } - item.setFactorycontacter(factorycontacter); - item.setMaintainerleader(maintainerleader); - companyitem.setMaintainerCompany(item); - } - } - } - } else { - //当运维商未匹配到可维护厂区时,也要初始化Company中的maintainerCompany实体,防止maintainerCompany为null,前端页面报错 - for (Company companyitem : list) { - MaintainerCompany maintainerCompany = new MaintainerCompany(); - companyitem.setMaintainerCompany(maintainerCompany); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/showUnit4Select.do") - public String showMenu4Select(HttpServletRequest request, Model model) { - return "user/unit4select"; - } - - /** - * 受登陆人员id限制的Unit选择界面(只显示登陆人员的父节点和其父节点下的所有非人子节点) - * 2021-12-28 sj 修改为查看全部厂区和部门 - */ - @RequestMapping("/showUnit4Select_Limited.do") - public String showUnit4Select_Limited(HttpServletRequest request, Model model) { - return "user/unit4selectlimited"; - } - - /** - * 按用户权限获取设备清单 - */ - @RequestMapping("/getDataManageALLBizs.do") - public ModelAndView getDataManageALLBizs(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - String search_name = request.getParameter("search_name"); - String url = ""; - ExtSystem extSystem = this.extSystemService.getActiveDataManage(null); - if (extSystem != null) { - url = extSystem.getUrl(); - } - url += "/proapp.do?method=getDataBaseBizs"; - Map map = new HashMap(); - map.put("pid", pid); - map.put("name", search_name); - String resp = com.sipai.tools.HttpUtil.sendPost(url, map); - JSONObject response = JSONObject.fromObject(resp); - try { - JSONArray re1 = response.getJSONArray("re1"); - - JSONArray json = new JSONArray(); - for (int i = 0; i < re1.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", re1.getJSONObject(i).get("id")); - String text = re1.getJSONObject(i).get("name").toString() + "(" + re1.getJSONObject(i).get("_equNum").toString() + "/" + re1.getJSONObject(i).get("_mpointNum").toString() + ")"; - jsonObject.put("text", text); - if (!re1.getJSONObject(i).get("syncFlag").toString().equals(CommString.Sync_Finish)) { - jsonObject.put("syncFlag", false); - } else { - jsonObject.put("syncFlag", true); - } - - json.add(jsonObject); - } - - model.addAttribute("result", json.toString()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return new ModelAndView("result"); - } - - /** - * 获取公司树状结构 - */ - @RequestMapping("/getUnitForTree.do") - public String getUnitForTree(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getParentCompanyChildrenBiz(cu); - - /*List tree = new ArrayList(); - for (Unit resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - node.setId(resource.getId()); - node.setText(resource.getName()); - if(resource.getType().equals(CommString.UNIT_TYPE_BIZ)){ - node.setIcon(CommString.UNIT_BIZ_ICON); - }else if(resource.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - node.setIcon(CommString.UNIT_COMPANY_ICON); - }else if(resource.getType().equals(CommString.UNIT_TYPE_DEPT)){ - node.setIcon(CommString.UNIT_DEPT_ICON); - } - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - /** - * 获取公司树状结构 - */ - @RequestMapping("/getUnitForTreeByUnitId.do") - public String getUnitForTreeByUnitId(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getParentChildrenByUnitid(unitId); - - /*List tree = new ArrayList(); - for (Unit resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - node.setId(resource.getId()); - node.setText(resource.getName()); - if(resource.getType().equals(CommString.UNIT_TYPE_BIZ)){ - node.setIcon(CommString.UNIT_BIZ_ICON); - }else if(resource.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - node.setIcon(CommString.UNIT_COMPANY_ICON); - }else if(resource.getType().equals(CommString.UNIT_TYPE_DEPT)){ - node.setIcon(CommString.UNIT_DEPT_ICON); - } - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取公司树状结构 - */ - @RequestMapping("/getUnitForTree_Dept.do") - public String getUnitForTree_Dept(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu == null) { - String userId = request.getParameter("userId"); - cu = this.userService.getUserById(userId); - } - List list = this.unitService.getParentCompanyChildrenDept(cu); -//增加外包 - List maintainer = this.unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' and type = '" + CommString.UNIT_TYPE_Maintainer + "' order by morder asc"); - if (maintainer != null && maintainer.size() > 0) { - for (int i = 0; i < maintainer.size(); i++) { - list.add(maintainer.get(i)); - } - } - /*List tree = new ArrayList(); - for (Unit resource : list) { - Tree node = new Tree(); - BeanUtils.copyProperties(resource, node); - node.setId(resource.getId()); - node.setText(resource.getName()); - if(resource.getType().equals(CommString.UNIT_TYPE_BIZ)){ - node.setIcon(CommString.UNIT_BIZ_ICON); - }else if(resource.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - node.setIcon(CommString.UNIT_COMPANY_ICON); - }else if(resource.getType().equals(CommString.UNIT_TYPE_DEPT)){ - node.setIcon(CommString.UNIT_DEPT_ICON); - } - tree.add(node); - } - JSONArray json = JSONArray.fromObject(tree);*/ - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取公司树状结构 -- 完整的 用于管理员配置组织架构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getUnitForTree_Dept_All.do") - public String getUnitForTree_Dept_All(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = "emp01"; - cu = this.userService.getUserById(userId); - List list = this.unitService.getParentCompanyChildrenDept(cu); - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取公司树状结构 - */ - @RequestMapping("/getAllParentByUnitId.do") - public String getAllParentByUnitId(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - - List list = this.unitService.getParentChildrenByUnitid(unitId); - - if (request.getParameter("maintainerSt") != null && request.getParameter("maintainerSt").length() > 0 && request.getParameter("maintainerSt").equals("true")) { - List units_maintainer = this.unitService.selectListByWhere(" where type='" + CommString.UNIT_TYPE_Maintainer + "' "); - list.addAll(units_maintainer); - } - - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取公司树状结构 - */ - @RequestMapping("/getUnitForTreeFromTop.do") - public String getUnitForTreeFromTop(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getParentCompanyChildrenBizByUnitid(unitId); - - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取所有的公司,厂区树状结构 - */ - @RequestMapping("/getAllCompanyForTree.do") - public String getAllCompanyForTree(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - //获取非用户节点树(公司 水厂 部门) - List list = this.unitService.getAllCompanyNode(); - String json = unitService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 有筛选条件地获取公司树状结构(仅公司和水厂节点) - */ - @RequestMapping("/getUnitForTree_Selected.do") - public String getUnitForTree_Selected(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - //List list = new ArrayList(); - //获取非用户,节点树(公司 水厂 部门) - List listinsql = this.unitService.getParentCompanyChildrenBiz(cu); - - //若为管理员 添加 所有公司 节点(因珠海存在最根节点,所以去除此方法若要此功能请新增方法) - /*if(cu.getId().equals(CommString.ID_Admin)){ - Unit all = new Unit(); - all.setPid(CommString.Tree_Root); - all.setName("所有公司"); - all.setId(""); - all.setType(CommString.UNIT_TYPE_COMPANY); - list.add(all); - } - list.addAll(listinsql);*/ - - String json = unitService.getTreeList(null, listinsql); - model.addAttribute("result", json); - return "result"; - } - - /** - * 有筛选条件地获取公司树状结构(仅公司和水厂节点) - */ - @RequestMapping("/getUnitTreeForTop.do") - public String getUnitTreeForTop(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - User cu = (User) request.getSession().getAttribute("cu"); - List> list_result = new ArrayList>(); - if (pid != null && pid.length() > 0) { - List cList = this.companyService.selectListByWhere(" where active='" + CommString.Flag_Active + "' and pid='" + pid + "' "); - if (cList != null && cList.size() > 0) { - for (int c = 0; c < cList.size(); c++) { - List cList2 = this.companyService.selectListByWhere(" where active='" + CommString.Flag_Active + "' and pid='" + cList.get(c).getId() + "' "); - Map map = new HashMap(); - if (cList2.size() > 0) { - map.put("id", cList.get(c).getId().toString()); - map.put("text", cList.get(c).getSname() + "(" + cList2.size() + ")"); - map.put("next", "true"); - } else { - map.put("id", cList.get(c).getId().toString()); - map.put("text", cList.get(c).getSname()); - map.put("next", "false"); - } - map.put("showtext", cList.get(c).getSname()); - map.put("type", cList.get(c).getType()); - if (cList.get(c).getType().equals(CommString.UNIT_TYPE_BIZ)) { - map.put("icon", CommString.UNIT_BIZ_ICON); - } else if (cList.get(c).getType().equals(CommString.UNIT_TYPE_COMPANY)) { - map.put("icon", CommString.UNIT_COMPANY_ICON); - } else if (cList.get(c).getType().equals(CommString.UNIT_TYPE_DEPT)) { - map.put("icon", CommString.UNIT_DEPT_ICON); - } else if (cList.get(c).getType().equals(CommString.UNIT_TYPE_USER)) { - map.put("icon", CommString.UNIT_USER_ICON); - } else if (cList.get(c).getType().equals(CommString.UNIT_TYPE_Maintainer)) { - map.put("icon", CommString.UNIT_Maintainer_ICON); - } - list_result.add(map); - } - } - } else { - Company company = this.unitService.getCompanyByUserId(cu.getId()); - List cList = this.companyService.selectListByWhere(" where active='" + CommString.Flag_Active + "' and pid='" + company.getId() + "' "); - Map map = new HashMap(); - if (cList.size() > 0) { - map.put("id", company.getId().toString()); - map.put("text", company.getSname() + "(" + cList.size() + ")"); - map.put("next", "true"); - } else { - map.put("id", company.getId().toString()); - map.put("text", company.getSname()); - map.put("next", "false"); - } - map.put("showtext", company.getSname()); - map.put("type", company.getType()); - if (company.getType().equals(CommString.UNIT_TYPE_BIZ)) { - map.put("icon", CommString.UNIT_BIZ_ICON); - } else if (company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { - map.put("icon", CommString.UNIT_COMPANY_ICON); - } else if (company.getType().equals(CommString.UNIT_TYPE_DEPT)) { - map.put("icon", CommString.UNIT_DEPT_ICON); - } else if (company.getType().equals(CommString.UNIT_TYPE_USER)) { - map.put("icon", CommString.UNIT_USER_ICON); - } else if (company.getType().equals(CommString.UNIT_TYPE_Maintainer)) { - map.put("icon", CommString.UNIT_Maintainer_ICON); - } - list_result.add(map); - } - - String json = JSONArray.fromObject(list_result).toString(); - -// List listinsql = this.unitService.getParentCompanyChildrenBiz(cu); -// String json = unitService.getTreeList(null, listinsql); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取水厂所有父节点 - */ - @RequestMapping("/getAllParentBizId.do") - public String getAllParentBizId(HttpServletRequest request, Model model) { - String parentBizids = this.unitService.getAllParentBizId(request.getParameter("bizid")); - model.addAttribute("result", parentBizids); - return "result"; - } - - /** - * 有筛选条件地获取公司树状结构(仅公司和水厂节点) - */ - @RequestMapping("/getUnitForTree_SelectedForApp.do") - public String getUnitForTree_SelectedForApp(HttpServletRequest request, Model model) { - String userid = request.getParameter("userid"); - User cu = userService.getUserById(userid); -// User cu= (User)request.getSession().getAttribute("cu"); - //List list = new ArrayList(); - //获取非用户,节点树(公司 水厂 部门) - List listinsql = this.unitService.getParentCompanyChildrenBiz(cu); - - //若为管理员 添加 所有公司 节点(因珠海存在最根节点,所以去除此方法若要此功能请新增方法) - /*if(cu.getId().equals(CommString.ID_Admin)){ - Unit all = new Unit(); - all.setPid(CommString.Tree_Root); - all.setName("所有公司"); - all.setId(""); - all.setType(CommString.UNIT_TYPE_COMPANY); - list.add(all); - } - list.addAll(listinsql);*/ - - String json = unitService.getTreeList(null, listinsql); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showCompanySelectTree.do") - public String showCompanySelectTree(HttpServletRequest request, Model model) { - return "user/companySelectTree"; - } - - /** - * 显示对应厂区和部门 (根据用户账号来的) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCompanySelectTree_Dept.do") - public String showCompanySelectTree_Dept(HttpServletRequest request, Model model) { - return "user/companySelectTree_Dept"; - } - - /** - * 显示对应厂区和部门 (显示所有的) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCompanySelectTree_Dept_All.do") - public String showCompanySelectTree_Dept_All(HttpServletRequest request, Model model) { - return "user/companySelectTree_Dept_All"; - } - - @RequestMapping("/showCompany4Select.do") - public String showCompany4Select(HttpServletRequest request, Model model) { - return "user/company4select"; - } - - /** - * 保存小组和工艺关联 (暂时不用) - */ - @RequestMapping("/updateDeptProcess.do") - public ModelAndView updateDeptProcess(HttpServletRequest request, Model model, - @RequestParam(value = "deptid") String deptid, - @RequestParam(value = "processstr") String processstr) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.deptProcessService.updateDeptProcess(deptid, processstr); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 保存小组和区域关联 - */ - @RequestMapping("/updateDeptArea.do") - public ModelAndView updateDeptArea(HttpServletRequest request, Model model, - @RequestParam(value = "deptid") String deptid, - @RequestParam(value = "areastr") String areastr) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.deptAreaService.updateDeptArea(deptid, areastr); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 通过公司id返回公司 - */ - @RequestMapping("/getCompany.do") - public String getCompany(HttpServletRequest request, Model model) { - String result = ""; - try { - Company company = new Company(); - if (request.getParameter("id") != null && !request.getParameter("id").toString().isEmpty()) { - company = this.unitService.getCompById(request.getParameter("id").toString()); - } - - JSONArray json = JSONArray.fromObject(company); - result = "{\"status\":\"" + CommString.Status_Pass + "\",\"content1\":" + json + "}"; - } catch (Exception e) { - result = "{\"status\":\"" + CommString.Status_Fail + "\"}"; - //System.out.println(e); - } - model.addAttribute("result", result); - return "result"; - } - - /* - * 根据id获得Unit信息 - */ - @RequestMapping("/getUnitFromID.do") - public String getUnitFromID(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - String unitId = request.getParameter("id"); - Company company = this.unitService.getCompById(unitId); - json.add(company); - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 根据人员Id获取对应的厂区列表 APP 继续用 getSearchBizsByUserId4Select 接口 - * @param request - * @param model - * @return - */ -// @RequestMapping("/getBizList4APP.do") -// public String getBizList4APP(HttpServletRequest request,Model model){ -// String userId = request.getParameter("userId"); -// JSONArray json=new JSONArray(); -// List companies=this.unitService.getCompanyByUserIdAndType(userId,CommString.UNIT_TYPE_BIZ); -// if(companies!=null && companies.size()>0){ -// for (Company company : companies) { -// JSONObject jsonObject =new JSONObject(); -// jsonObject.put("id", company.getId()); -// jsonObject.put("text", company.getName()); -// json.add(jsonObject); -// } -// -// } -// model.addAttribute("result", json.toString()); -// return "result"; -// } - - /** - * 常排获取人员 所属的type 如外包人员为 M res2为外包人员对应的厂区列表 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getOutSource.do") - public String getOutSource(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - - JSONArray json = new JSONArray(); - - String resstr2 = ""; - String deptId = "";//巡检任务班组的id - User user = userService.getUserById(userId); - if (user != null) { - Unit unit = unitService.getUnitById(user.getPid()); - if (unit != null) { - resstr2 = unit.getType(); - deptId = unit.getId(); - } - } - - //取到当天任务所有的unitId - Set set = new HashSet(); - List list = patrolPlanDeptService.selectListByWhere("where dept_id = '" + deptId + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List list2 = patrolRecordService.selectListByWhere("where patrol_plan_id = '" + list.get(i).getPatrolPlanId() + "' and DateDiff(dd,insdt,getdate())=0 "); - if (list2 != null && list2.size() > 0) { - for (int j = 0; j < list2.size(); j++) { - set.add(list2.get(j).getUnitId()); - } - } - } - if (!set.isEmpty()) { - //获取对应任务的厂列表 - for (String str : set) { - JSONObject jsonObject = new JSONObject(); - Company company = companyService.selectByPrimaryKey(str); - if (company != null) { - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getSname()); - json.add(jsonObject); - } - } - } else { - Unit unit = unitService.getUnitById(user.getPid()); - if (unit != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", unit.getId()); - jsonObject.put("text", unit.getSname()); - json.add(jsonObject); - } - } - - } else { - Unit unit = unitService.getUnitById(user.getPid()); - if (unit != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", unit.getId()); - jsonObject.put("text", unit.getSname()); - json.add(jsonObject); - } - } - - String result = "{\"res1\":\"" + resstr2 + "\",\"res2\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 根据id获取组织架构列表 - */ - @RequestMapping("/getUnitsByUnitId4Select.do") - public String getUnitsByUnitId4Select(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - JSONArray json = new JSONArray(); - Unit unitParent = this.unitService.getUnitById(id); - JSONObject jsonObject = new JSONObject(); - List units = this.unitService.getUnitChildrenById(id); - if (units != null && units.size() > 0) { - for (Unit unit : units) { - if (!unit.getType().equals(CommString.UNIT_TYPE_USER)) { - jsonObject = new JSONObject(); - jsonObject.put("id", unit.getId()); - jsonObject.put("text", unit.getName()); - jsonObject.put("type", unit.getType()); - json.add(jsonObject); - } - } - } - - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/teamForSelectByCompany.do") - public String teamForSelectByCompany(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - /*if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - model.addAttribute("jobIds", jobIds);*/ - return "user/teamForSelectByCompany"; - } - - /** - * 部门多选页面 - * - * @param deptIds 用逗号隔开的部门ids - * @Author: lichen - * @Date: 2022/12/16 - **/ - @RequestMapping("/unit4SelectModalLimitedCheck.do") - public String unit4SelectModalLimitedCheck(HttpServletRequest request, Model model, - String formId, - String hiddenId, - String textId, - String deptIds) { - if (deptIds != null) { - String[] arr = deptIds.split(","); - model.addAttribute("checkedItemArr", JSON.toJSONString(arr)); - } else { - model.addAttribute("checkedItemArr", "[]"); - } - model.addAttribute("formId", formId); - model.addAttribute("hiddenId", hiddenId); - model.addAttribute("textId", textId); - return "user/unit4selectlimitedcheck"; - } -} diff --git a/src/com/sipai/controller/user/UserController.java b/src/com/sipai/controller/user/UserController.java deleted file mode 100644 index b738062a..00000000 --- a/src/com/sipai/controller/user/UserController.java +++ /dev/null @@ -1,1805 +0,0 @@ -package com.sipai.controller.user; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.dao.activiti.ModelNodeJobDao; -import com.sipai.entity.activiti.ModelNodeJob; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.kpi.KpiActivitiRequest; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.user.*; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.*; -import com.sipai.tools.*; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.activiti.engine.RepositoryService; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import sun.misc.BASE64Encoder; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -import static java.util.stream.Collectors.toList; - - -@SuppressWarnings("restriction") -@Controller -@RequestMapping("/user") -@Api(value = "/user", tags = "人员管理") -public class UserController { - @Resource - private UserService userService; - @Resource - private MsgServiceImpl msgServiceImpl; - @Resource - private MobileValidationService mobileValidationService; - @Resource - private UnitService unitService; - @Resource - private UserDetailService userDetailService; - @Resource - private ExtSystemService extSystemService; - @Resource - private UserJobService userJobService; - @Resource - private BasicComponentsService basicComponentsService; - @Autowired - RepositoryService repositoryService; - @Resource - private ModelNodeJobDao modelNodeJobDao; - @Resource - private UserOutsidersService userOutsidersService; - - @RequestMapping("/showUsers.do") - public String showlist(HttpServletRequest request, Model model) { - return "/user/userList"; - } - - @RequestMapping("/getUsers.do") - public ModelAndView getUsers(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String timeScope = request.getParameter("timeScope"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " pid ";//morder - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 ";//CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - String active = request.getParameter("active"); - if (StringUtils.isNotBlank(active)) { - wherestr += "and active='" + active + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and caption like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("lock") != null && !request.getParameter("lock").isEmpty()) { - String lock = request.getParameter("lock"); - if ("0".equals(lock)) { - //未锁定 - wherestr += "and lockTime is null "; - } else { - //已锁定 - wherestr += "and lockTime is not null "; - } - } - - //若有公司查询条件则按公司查询,如果没有则按登录人的公司查询 - String pid = request.getParameter("pid"); - if (StringUtils.isNotBlank(pid)) { - wherestr += "and pid = '" + pid + "' "; - } else { - if (request.getParameter("search_pid") != null && !request.getParameter("search_pid").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_pid")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and id in ('" + userIds + "') "; - } - } - } - - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - //格式化ids - String[] idArray = checkedIds.split(","); - String ids = ""; - for (String str : idArray) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += str; - } - wherestr += " and id in('" + ids.replace(",", "','") + "')"; - orderstr = " order by CHARINDEX(','+ id +',','," + ids + ",') desc"; - } - - /*String sql = ""; - if (sort != null && sort.equals("weekloginduration")) { - sql = wherestr; - } else { - sql = wherestr + orderstr; - }*/ - - //服务端分页 先查询出所有的list -// wherestr += " and totalTime is not null "; - List list = this.userService.selectListByWhere3(wherestr, timeScope); - try { - JSONObject results = new JSONObject(); - int total = list.size(); - results.put("total", total); - - //排序 - if (order != null && !order.isEmpty()) { - if (order.equals("asc")) {//正序 - if (sort.equals("insdt")) { - list = list.stream().sorted(Comparator.comparing(User::getInsdt)).collect(toList()); - } - if (sort.equals("totaltime")) { - list = list.stream().sorted(Comparator.comparing(User::getTotaltime, Comparator.nullsFirst(Double::compareTo))).collect(Collectors.toList()); - } - if (sort.equals("lastlogintime")) { - list = list.stream().sorted(Comparator.comparing(User::getLastlogintime, Comparator.nullsFirst(String::compareTo))).collect(Collectors.toList()); - } - if (sort.equals("weekloginduration")) { - list = list.stream().sorted(Comparator.comparing(User::getWeekloginduration, Comparator.nullsFirst(Double::compareTo))).collect(Collectors.toList()); - } - } - if (order.equals("desc")) {//倒序 - if (sort.equals("insdt")) { - list = list.stream().sorted(Comparator.comparing(User::getInsdt).reversed()).collect(toList()); - } - if (sort.equals("totaltime")) { - list = list.stream().sorted(Comparator.comparing(User::getTotaltime, Comparator.nullsFirst(Double::compareTo)).reversed()).collect(Collectors.toList()); - } - if (sort.equals("lastlogintime")) { - list = list.stream().sorted(Comparator.comparing(User::getLastlogintime, Comparator.nullsFirst(String::compareTo)).reversed()).collect(Collectors.toList()); - } - if (sort.equals("weekloginduration")) { - list = list.stream().sorted(Comparator.comparing(User::getWeekloginduration, Comparator.nullsFirst(Double::compareTo)).reversed()).collect(Collectors.toList()); - } - } - } else { - list = list.stream().sorted(Comparator.comparing(User::getTotaltime, Comparator.nullsFirst(Double::compareTo)).reversed()).collect(Collectors.toList()); - } - - //分页 - List tasks = list.stream().skip((pages - 1) * pagesize).limit(pagesize).collect(Collectors.toList()); - results.put("rows", tasks); - JSONArray json = results.getJSONArray("rows"); - //排序 - /*boolean is_desc = true; - if (order != null && !order.isEmpty()) { - if (order.equals("asc")) { - is_desc = false;//正序 - } - if (order.equals("desc")) { - is_desc = true;//倒序 - } - }*/ - //根据指定字段排序 -// json = CommUtil.jsonArraySort(json, sort, is_desc); - //服务端分页 - String result = "{\"total\":" + results.getString("total") + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - } catch (Exception e) { - e.printStackTrace(); - } - return new ModelAndView("result"); - } - - @RequestMapping("/getLockNum.do") - public ModelAndView getLockNum(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String timeScope = request.getParameter("timeScope"); - String wherestr = "where 1=1 "; - String active = request.getParameter("active"); - if (StringUtils.isNotBlank(active)) { - wherestr += "and active='" + active + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and caption like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("lock") != null && !request.getParameter("lock").isEmpty()) { - String lock = request.getParameter("lock"); - if ("0".equals(lock)) { - //未锁定 - wherestr += "and lockTime is null "; - } else { - //已锁定 - wherestr += "and lockTime is not null "; - } - } - - //若有公司查询条件则按公司查询,如果没有则按登录人的公司查询 - String pid = request.getParameter("pid"); - if (StringUtils.isNotBlank(pid)) { - wherestr += "and pid = '" + pid + "' "; - } else { - if (request.getParameter("search_pid") != null && !request.getParameter("search_pid").isEmpty()) { - List unitlist = unitService.getUnitChildrenById(request.getParameter("search_pid")); - String pidstr = ""; - for (int i = 0; i < unitlist.size(); i++) { - pidstr += "'" + unitlist.get(i).getId() + "',"; - } - if (pidstr != "") { - pidstr = pidstr.substring(0, pidstr.length() - 1); - wherestr += "and pid in (" + pidstr + ") "; - } - } else { - Company company = unitService.getCompanyByUserId(cu.getId()); - String companyId = "-1"; - if (company != null) { - companyId = company.getId(); - } - List users = unitService.getChildrenUsersById(companyId); - String userIds = ""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds += "','"; - } - userIds += user.getId(); - } - if (!userIds.isEmpty()) { - wherestr += "and id in ('" + userIds + "') "; - } - } - } - - List list = this.userService.selectListByWhere3(wherestr, timeScope); - int total = list.size(); - model.addAttribute("result", total); - return new ModelAndView("result"); - } - - /** - * 获取公司树状结构 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getUnitJson2.do") - public String getUnitJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - List list = unitService.getParentChildrenByUnitid(unitId); - ArrayList unitRespDtos = new ArrayList<>(); - for (int i = 0; i < list.size(); i++) { - UnitRespDto unitRespDto = new UnitRespDto(); - unitRespDto.setId(list.get(i).getId()); - unitRespDto.setText(list.get(i).getSname()); - unitRespDtos.add(unitRespDto); - } - JSONArray json = JSONArray.fromObject(unitRespDtos); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/addUser.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Unit unit = unitService.getUnitById(companyId); - request.setAttribute("unit", unit); - return "user/userAdd"; - } - - @RequestMapping("/editUser.do") - public String doedit(HttpServletRequest request, Model model) { - String userId = request.getParameter("id"); - User user = this.userService.getUserById(userId); - JSONArray rolesjson = JSONArray.fromObject(user.getRoles()); - model.addAttribute("roles", rolesjson); - model.addAttribute("user", user); - return "user/userEdit"; - } - - @RequestMapping("/viewUser.do") - public String doview(HttpServletRequest request, Model model) { - String userId = request.getParameter("id"); - User user = this.userService.getUserById(userId); - model.addAttribute("user", user); - return "user/userView"; - } - - @RequestMapping("/saveUser.do") - @ArchivesLog(operteContent = "新增用户信息") - public String dosave(HttpServletRequest request, Model model, @ModelAttribute("user") User user) { - User cu = (User) request.getSession().getAttribute("cu"); - - if (!this.userService.checkNotOccupied(user.getId(), user.getName())) { - model.addAttribute("result", "{\"res\":\"用户名重复\"}"); - return "result"; - } - if (user.getSerial() != null && !this.userService.checkSerialNotOccupied(user.getId(), user.getSerial())) { - model.addAttribute("result", "{\"res\":\"工号重复\"}"); - return "result"; - } - if (user.getCardid() != null && !user.getCardid().trim().equals("") && !this.userService.checkCardidNotOccupied(user.getId(), user.getCardid())) { - model.addAttribute("result", "{\"res\":\"卡号重复\"}"); - return "result"; - } - String userId = CommUtil.getUUID(); - user.setId(userId); - user.setPassword(UserCommStr.default_password); -// user.setPassword("Aa123456.."); - user.setInsuser(cu.getId()); - user.setInsdt(CommUtil.nowDate()); - user.setSyncflag(CommString.Sync_Insert); - int result = this.userService.saveUser(user); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + userId + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/updateUser.do") - @ArchivesLog(operteContent = "修改用户信息") - public String doupdate(HttpServletRequest request, Model model, @ModelAttribute("user") User user) { - if (!this.userService.checkNotOccupied(user.getId(), user.getName())) { - model.addAttribute("result", "{\"res\":\"用户名重复\"}"); - return "result"; - } - if (user.getSerial() != null && !this.userService.checkSerialNotOccupied(user.getId(), user.getSerial())) { - model.addAttribute("result", "{\"res\":\"工号重复\"}"); - return "result"; - } - if (user.getCardid() != null && !user.getCardid().trim().equals("") && !this.userService.checkCardidNotOccupied(user.getId(), user.getCardid())) { - model.addAttribute("result", "{\"res\":\"卡号重复\"}"); - return "result"; - } - user.setSyncflag(CommString.Sync_Edit); - int result = this.userService.updateUserById(user); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + user.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/deleteUser.do") - @ArchivesLog(operteContent = "删除用户信息") - public String dodel(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - int result = this.userService.deleteUserById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deleteUsers.do") - @ArchivesLog(operteContent = "批量删除用户信息") - public String dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.userService.deleteUserByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /** - * 修改密码界面 - */ - @RequestMapping("/showChangePasswordPage.do") - public String showChangePasswordPage(HttpServletRequest request, Model model) { - //修改密码配置信息 - com.alibaba.fastjson.JSONArray jsonArray = basicComponentsService.selectListByWhereAll("where active='1' and code like '%password%' order by morder "); - if (jsonArray != null && jsonArray.size() > 0) { - model.addAttribute("jsonArray", jsonArray); - } - return "/changePassword"; - } - - /** - * 修改主题 - */ - @RequestMapping("/showChangeTheme.do") - public String showChangeTheme(HttpServletRequest request, Model model) { - return "/changeTheme"; - } - - /** - * 保存主题 - */ - @RequestMapping("/saveTheme.do") - public String saveTheme(HttpServletRequest request, Model model) { - String themeClass = request.getParameter("themeClass"); - User user = (User) request.getSession().getAttribute("cu"); - user.setThemeclass(themeClass); - int result = this.userService.updateUserById(user); - if (result == 1) { - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", user); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 保存修改的密码 - */ - @RequestMapping("/saveChangePassword.do") - @ArchivesLog(operteContent = "用户修改密码") - public String saveChangePassword(HttpServletRequest request, Model model) { - String newPassword = request.getParameter("newPassword"); - String oldPassword = request.getParameter("oldPassword"); - User user = (User) request.getSession().getAttribute("cu"); - int result = 0; - oldPassword = (CommUtil.generatePassword(oldPassword)); - if (!user.getPassword().equals(oldPassword)) { - result = 2; - } else { - user.setPassword(CommUtil.generatePassword(newPassword)); - result = this.userService.updateUserById(user); - if (result == 1) { - String userId = user.getId(); - //更新用户附表 - UserDetail userDetail = userDetailService.selectByUserId(userId); - if (userDetail != null) { - userDetail.setLastlogintime(CommUtil.nowDate()); - userDetailService.update(userDetail); - } else { - userDetail = new UserDetail(); - userDetail.setId(CommUtil.getUUID()); - userDetail.setUserid(userId); - userDetail.setInsdt(CommUtil.nowDate()); - userDetail.setInsuser(userId); - userDetail.setLastlogintime(CommUtil.nowDate()); - userDetailService.save(userDetail); - } - } - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doimport.do") - public String doimport(HttpServletRequest request, Model model) { - //return "user/importUsers"; - return "user/userImport"; - } - - /** - * 查看个人信息界面 - */ - @RequestMapping("/viewPersonalInformation.do") - public String viewPersonalInformation(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - User user = this.userService.getUserById(id); - UserDetail userDetail = this.userDetailService.selectByUserId(id); - List companies = this.unitService.getCompaniesByUserId(id); - model.addAttribute("company", companies.get(0)); - user.setUserDetail(userDetail); - model.addAttribute("user", user); - return "user/viewPersonalInformation"; - } - - /** - * 绑定微信账号 - */ - @RequestMapping("/bindingWeChat.do") - public String bindingWeChat(HttpServletRequest request, Model model) { - int result = 0; - String id = request.getParameter("userId"); - String userInfo = request.getParameter("userInfo"); - JSONObject jsonObject = JSONObject.fromObject(userInfo); - User user = this.userService.getUserById(id); - user.setWechatid(jsonObject.getString("openid")); - result = this.userService.updateUserById(user); - model.addAttribute("weChatResult", result); - model.addAttribute("user", user); - return "/weChatAlert"; - } - - /** - * 显示头像上传页面-bootstrap-fileinput - * - * @return - */ - @RequestMapping("/fileinputHeadPortrait.do") - public String fileinputHeadPortrait(HttpServletRequest request, HttpServletResponse response, Model model) { - return "user/fileinputHeadPortrait"; - } - - /** - * 显示头像上传页面-bootstrap-fileinput - * - * @return - */ - @RequestMapping("/userHeadPortrait.do") - public String userHeadPortrait(HttpServletRequest request, HttpServletResponse response, Model model) { - return "user/userHeadPortrait"; - } - - /** - * 保存上传头像 - */ - @RequestMapping(value = "inputHeadPortrait.do") - public ModelAndView inputFile(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - MultipartFile multipartFile = multipartRequest.getFile("filelist"); //控件id - try { - //获取图片文件的输入流,转化成二进制字节 - InputStream in = multipartFile.getInputStream(); - byte[] data = new byte[in.available()]; - in.read(data); - in.close(); - //将二进制字节用base64编码,以字符串方式存到数据库中 - BASE64Encoder encoder = new BASE64Encoder(); - String headPortrait = encoder.encode(data); - User cu = (User) request.getSession().getAttribute("cu"); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - int res = 0; - if (userDetail != null) { - userDetail.setIcon(headPortrait); - res = this.userDetailService.update(userDetail); - } else { - UserDetail userDetailtwo = new UserDetail(); - userDetailtwo.setId(CommUtil.getUUID()); - userDetailtwo.setInsdt(CommUtil.nowDate()); - userDetailtwo.setInsuser(cu.getId()); - userDetailtwo.setUserid(cu.getId()); - userDetailtwo.setIcon(headPortrait); - res = this.userDetailService.save(userDetailtwo); - } - /* - cu.setHeadportrait(headPortrait); - int res = this.userService.updateUserById(cu);*/ - if (res == 1) { - ret.put("suc", true); - //设置session - UserDetail userDetailthree = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetailthree); - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } else { - ret.put("error", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("error", false); - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "saveHeadPortrait.do") - public ModelAndView saveHeadPortrait(HttpServletRequest request, HttpServletResponse response, Model model) { - String headPortrait = request.getParameter("imgBase"); - User cu = (User) request.getSession().getAttribute("cu"); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - int res = 0; - if (userDetail != null) { - userDetail.setIcon(headPortrait); - res = this.userDetailService.update(userDetail); - } else { - UserDetail userDetailtwo = new UserDetail(); - userDetailtwo.setId(CommUtil.getUUID()); - userDetailtwo.setInsdt(CommUtil.nowDate()); - userDetailtwo.setInsuser(cu.getId()); - userDetailtwo.setUserid(cu.getId()); - userDetailtwo.setIcon(headPortrait); - res = this.userDetailService.save(userDetailtwo); - } - if (res == 1) { - //设置session - UserDetail userDetailthree = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetailthree); - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - } - model.addAttribute("result", res); - return new ModelAndView("result"); - } - - @RequestMapping(value = "downtemplate.do") - public void downtemplate(HttpServletRequest request, HttpServletResponse response, Model model) throws IOException { - //文件的实际地址 - String filepath = request.getSession().getServletContext().getRealPath("/"); - String filename = "用户数据导入格式样本.xls"; - //兼容Linux路径 - filepath = filepath + "Template" + System.getProperty("file.separator") + "user" + System.getProperty("file.separator") + filename; - FileUtil.downloadFile(response, filename, filepath); - } - - @RequestMapping(value = "importUsers.do") - public ModelAndView importUsers(@RequestParam MultipartFile[] file, HttpServletRequest request, HttpServletResponse response, Model model) throws IOException { - //要存入的实际地址 - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName, "Temp"); - - String result = userService.doimport(realPath, file); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/exportUsers.do") - public String exportUsers(HttpServletRequest request, Model model) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("search_caption") != null && !request.getParameter("search_caption").isEmpty()) { - wherestr += "and caption like '%" + request.getParameter("search_caption") + "%' "; - } - if (request.getParameter("search_sex") != null && !request.getParameter("search_sex").isEmpty()) { - wherestr += "and sex = '" + request.getParameter("search_sex") + "' "; - } - List list = this.userService.selectListByWhere(wherestr + orderstr); - - //导出文件到指定目录,兼容Linux - String filePath = ""; - if ("\\".equals(System.getProperty("file.separator"))) { - filePath = "D:" + System.getProperty("file.separator") + "用户数据表.xls"; - } - if ("/".equals(System.getProperty("file.separator"))) { - filePath = "/user" + System.getProperty("file.separator") + "用户数据表.xls"; - } - - String result = this.userService.exportUsers(filePath, list); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/exportUsersByResponse.do") - public void exportUsersByResponse(HttpServletRequest request, HttpServletResponse response, Model model) throws IOException { - User cu = (User) request.getSession().getAttribute("cu"); - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += "and name like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("search_caption") != null && !request.getParameter("search_caption").isEmpty()) { - wherestr += "and caption like '%" + request.getParameter("search_caption") + "%' "; - } - if (request.getParameter("search_sex") != null && !request.getParameter("search_sex").isEmpty()) { - wherestr += "and sex = '" + request.getParameter("search_sex") + "' "; - } - List list = this.userService.selectListByWhere(wherestr + orderstr); - - //导出文件到指定目录,兼容Linux - String fileName = "用户数据表.xls"; - this.userService.exportUsersByResponse(response, fileName, list); - } - - /** - * 重置密码 - */ - @RequestMapping("/resetPassword.do") - public String resetPassword(HttpServletRequest request, Model model, @RequestParam String id) { - User user = userService.getUserById(id); - int result = this.userService.resetpassword(user, UserCommStr.default_password); - model.addAttribute("result", result); - return "result"; - } - - /** - * 解除锁定 - */ - @RequestMapping("/unlockFun.do") - public String unlockFun(HttpServletRequest request, Model model, @RequestParam String id) { - User user = userService.getUserById(id); - int result = this.userService.unlockFun(user); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/queryUsers.do") - public String doqueryUsers(HttpServletRequest request, Model model) { - String orderstr = " order by name"; - - String wherestr = "where 1=1 "; - - if (request.getParameter("queryusername") != null && !request.getParameter("queryusername").isEmpty()) { - String n = null; - try { - n = java.net.URLDecoder.decode(request.getParameter("queryusername"), "UTF-8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - wherestr += " and name like '%" + n + "%' "; - } - if (request.getParameter("orgid") != null && !request.getParameter("orgid").isEmpty()) { - wherestr += " and pid='" + request.getParameter("orgid") + "' "; - } - List list = new ArrayList(); - List listself = new ArrayList(); - list = this.unitService.getChildrenUsersById(request.getParameter("orgid")); - listself = this.userService.selectListByWhere(wherestr + orderstr); - list.addAll(listself); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/userForSelect.do") - public String userForSelect(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - String companyId = request.getParameter("companyId"); - //model.addAttribute("companyId",companyId); - return "user/userForSelect"; - } - - @RequestMapping("/userForOneSelect.do") - public String userForOneSelect(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - model.addAttribute("userId", userId); - return "user/userForOneSelect"; - } - - @RequestMapping("/userForOneSelectByStructure.do") - public String userForOneSelectByStructure(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - model.addAttribute("userId", userId); - return "safety/userForOneSelectByStructure"; - } - - @RequestMapping("/userForSelectByStructure.do") - public String userForAllSelect(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - return "user/userForSelectByStructure"; - } - - /** - * 人员选择界面,显示所有人员,可根据厂区筛选 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/userForSelectByCompany.do") - public String userForSelectByCompany(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); - String jobIds = request.getParameter("jobIds"); - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - model.addAttribute("jobIds", jobIds); - return "user/userForSelectByCompany"; - } - - @RequestMapping("/getUsersByIds.do") - public String getUsersByIds(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 选择报警消息发送的人员 - */ - @RequestMapping("/selectUserForMsgAlarmlevel.do") - public String selectUserForMsgAlarmlevel(HttpServletRequest request, Model model) { - List users = this.userService.selectListByWhere(""); - JSONArray json = new JSONArray(); - if (users != null && users.size() > 0) { - for (User user : users) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", user.getId()); - jsonObject.put("text", user.getCaption()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json.toString()); - return "result"; - } - - @RequestMapping("/userForSingleSelect.do") - public String userForSingleSelect(HttpServletRequest request, Model model) { - model.addAttribute("recvidname", request.getParameter("recvidname")); - return "user/userForSingleSelect"; - } - - @RequestMapping("/updateJobByUserid.do") - public String updateJobUser(HttpServletRequest request, Model model, @RequestParam String jobstr, @RequestParam String userid, @RequestParam String unitid) { - int result = userService.updateJobByUserid(jobstr, userid, unitid); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getRecvusersJson.do") - public String getRecvusersJson(HttpServletRequest request, Model model) { - String recvid = request.getParameter("recvid"); - String[] recvids = recvid.split(","); - List list = new ArrayList(); - for (int i = 0; i < recvids.length; i++) { - list.add(this.userService.getUserById(recvids[i])); - } - JSONArray json = JSONArray.fromObject(list); - String result = "{\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/isOnline.do") - public String isOnline(HttpServletRequest request, Model model) { - boolean result = false; - SessionManager sessionManager = new SessionManager(); - result = sessionManager.isOnline(request.getSession()); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showRegisterQRCode.do") - public String showRegisterQRCode(HttpServletRequest request, Model model) { - return "user/registerQrcode"; - } - - /** - * 检测是否已注册 - * - * @param - * @param - * @return - */ - @RequestMapping("/checkExist.do") - public String checkExist(HttpServletRequest request, Model model) { - String mobile = request.getParameter("mobile"); - boolean result = true; - List list = this.userService.selectListByWhere("where mobile='" + mobile + "'"); - if (list != null && list.size() > 0) { - result = false; - } - model.addAttribute("result", "{\"valid\":" + result + "}"); - return "result"; - } - - /** - * 用户注册 - */ - @RequestMapping("/saveRegisterUser.do") - public String saveRegisterUser(HttpServletRequest request, Model model, @ModelAttribute("user") User user) { - user.setId(user.getMobile()); - user.setName(user.getMobile()); - user.setActive(CommString.Active_True); - user.setInsdt(CommUtil.nowDate()); - int result = this.userService.saveUserWithBaseRole(user); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + user.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 微信用户注册 - */ - @RequestMapping("/saveweChatUser.do") - public String saveweChatUser(HttpServletRequest request, Model model) { - String userInfo = request.getParameter("userInfo"); - int result; - JSONObject jsonObject = JSONObject.fromObject(userInfo); - System.out.println(jsonObject); - String companyid = request.getParameter("unitId"); - User user = new User(); - user.setId(CommUtil.getUUID()); - user.setWechatid(jsonObject.getString("openid")); - user.setName(jsonObject.getString("nickname")); - user.setCaption(jsonObject.getString("nickname")); - //微信用户数据中,1为男,2为女 - String weChatSex = jsonObject.getString("sex"); - if (weChatSex.equals("1")) { - user.setSex(weChatSex); - } else if (weChatSex.equals("2")) { - user.setSex("0"); - } - user.setPid(companyid); - //检查该用户是否用微信注册过 - List list = this.userService.selectListByWhere("where wechatid= '" + jsonObject.getString("openid") + "'"); - if (list != null && list.size() > 0) { - result = 0; - } else { - result = 1; - } - model.addAttribute("user", user); - model.addAttribute("result", result); - return "/user/improveUserInformation"; - } - - /** - * 微信授权登录 - */ - @RequestMapping("/weChatLogin.do") - public String weChatLogin(HttpServletRequest request, Model model) { - String userInfo = request.getParameter("userInfo"); - int result = 0; - JSONObject jsonObject = JSONObject.fromObject(userInfo); - - //检查该用户是否用微信注册过,注册过的直接登录 - List list = this.userService.selectListByWhere("where wechatid= '" + jsonObject.getString("openid") + "'"); - //已注册为CommString.ONE_STRING,未注册为CommString.TWO_STRING - String wechatid = null; - if (list != null && list.size() > 0) { - result = CommString.ONE_STRING; - wechatid = list.get(0).getWechatid(); - } else { - result = CommString.TWO_STRING; - } - model.addAttribute("wechatid", wechatid); - //model.addAttribute("userId", userId); - model.addAttribute("result", result); - return "/login"; - } - - /** - * 完善用户信息 - */ - @RequestMapping("/updateUserInformation.do") - public String updateUserInformation(HttpServletRequest request, Model model, @ModelAttribute("user") User user) { - user.setPassword(UserCommStr.default_password); - user.setName(user.getMobile()); - user.setActive(CommString.Active_True); - int result = this.userService.saveUser(user); - user.setInsdt(CommUtil.nowDate()); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + user.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/syncUsers.do") - public String syncUsers(HttpServletRequest request, Model model, @RequestParam String ids) { - ids = ids.replace(",", "','"); - String wherestr = "where id in ('" + ids + "') "; //用户同步可能是同步用户在数据中心权限,所以不加同步状态筛选 - List users = this.unitService.selectListByWhere(wherestr); - int resp = this.userService.syncUsers(users); - model.addAttribute("result", resp); - return "result"; - } - - /** - * 发送手机验证码 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/sendVerificationCode.do") - public String sendVerificationCode(HttpServletRequest request, Model model) { - // 自动获得6位任意数字作为验证码 - String verificationCode = CommUtil.getRandomNumbers(6); - //手机号 - String mobileNumber = request.getParameter("mobile"); - int result = 0; - if (mobileNumber != null && !mobileNumber.equals("")) { - //如果有手机号存在,更新验证码和插入时间,不存在则新增加一条 - List list = mobileValidationService.selectListByWhere("where mobile ='" + mobileNumber + "'"); - if (list != null && list.size() > 0) { - MobileValidation mobileValidation = list.get(0); - mobileValidation.setVerificationcode(verificationCode); - mobileValidation.setSenddate(CommUtil.nowDate()); - result = this.mobileValidationService.update(mobileValidation); - } else { - MobileValidation mobileValidation = new MobileValidation(); - mobileValidation.setId(CommUtil.getUUID()); - mobileValidation.setInsdt(CommUtil.nowDate()); - mobileValidation.setMobile(mobileNumber); - mobileValidation.setSenddate(CommUtil.nowDate()); - mobileValidation.setVerificationcode(verificationCode); - result = this.mobileValidationService.save(mobileValidation); - } - } - //如果验证码和手机号保存成功,则发送验证码短信给用户 - boolean res = false; - if (result == 1) { - res = this.msgServiceImpl.sendVerificationCode("您的短信验证码是" + verificationCode + ",在10分钟内有效。如非本人操作请忽略。", mobileNumber); - } - String resstr = "{\"result\":\"" + res + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 校验发送的验证码 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/checkVerificationCode.do") - public String checkVerificationCode(HttpServletRequest request, Model model) { - String verificationCode = request.getParameter("verificationcode"); - int codeLength = verificationCode.length(); - boolean result = true; - //验证码是六位数字去验证,不是六位不进行验证,防止与js中6位验证冲突 - if (codeLength == 6) { - String mobileNumber = request.getParameter("mobile"); - List list = this.mobileValidationService.selectListByWhere("where mobile='" + mobileNumber + "' and verificationcode='" + verificationCode + "'"); - if (list != null && list.size() > 0) { - //比较时间,超过十分钟无效 - SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date start = null; - Date end = null; - try { - start = sdf.parse(list.get(0).getSenddate()); - end = sdf.parse(CommUtil.nowDate().substring(0, 19)); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.out.println("时间1:" + start.getTime()); - System.out.println("时间2:" + end.getTime()); - long number = end.getTime() - start.getTime(); - System.out.println("时间差值:" + number); - if (number <= 600000) { - //说明10分钟以内,返回true - result = true; - } else { - // 超出十分钟,则返回err - result = false; - } - - } else { - // 如果没有记录,则返回false - result = false; - } - } - model.addAttribute("result", "{\"valid\":" + result + "}"); - return "result"; - } - - /** - * 20181210 YYJ 通过公司id找人员 - */ - @RequestMapping("/getUsersById.do") - public ModelAndView getUsersById(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " morder "; - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - String pid = request.getParameter("id"); - String wherestr = "where pid = '" + pid + "'";//CommUtil.getwherestr("insuser", "user/getUsers.do", cu); - - PageHelper.startPage(pages, pagesize); - List list = this.userService.selectListByWhere(wherestr + orderstr); - - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - - - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 2020-11-23 njp PDF在线预览 - */ - @RequestMapping("/doManual.do") - public String doManual(HttpServletRequest request, Model model) { - - - return "user/showManual"; - } - - /** - * 用户在线时长预览 - */ - - @RequestMapping("/showTotalTimeList.do") - public String showTotalTimeList(HttpServletRequest request, Model model) { - return "/user/showTotalTimeList"; - } - - /** - * 用户在线详细记录 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showTotalTimeView.do") - public String showTotalTimeView(HttpServletRequest request, Model model) { - String userId = request.getParameter("userId"); - String curDateStart = request.getParameter("curDateStart"); - String curDateEnd = request.getParameter("curDateEnd"); - model.addAttribute("userId", userId); - model.addAttribute("curDateStart", curDateStart); - model.addAttribute("curDateEnd", curDateEnd); - return "user/showTotalTimeView"; - } - - @RequestMapping("/getListDetail.do") - public ModelAndView getListDetail(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = request.getParameter("userId"); - StringBuilder whereSb = new StringBuilder("where userid= '" + userId + "' "); - String curDateStart = request.getParameter("curDateStart"); - if (curDateStart != null && !"".equals(curDateStart)) { - whereSb.append("and sdate >='" + curDateStart + "'"); - } - String curDateEnd = request.getParameter("curDateEnd"); - if (curDateEnd != null && !"".equals(curDateEnd)) { - whereSb.append("and sdate <='" + curDateEnd + "'"); - } - String whereSql = whereSb.toString(); - List list = this.userService.selectUserTimeListByWhere(whereSql); - - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/userForAllSelectWorkOrder.do") - public String userForAllSelectWorkOrder(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); - String jobIds = request.getParameter("jobIds"); - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - model.addAttribute("jobIds", jobIds); - return "user/userForSelectByWorkOrder"; - } - - /** - * 获取异常上报 第一个节点的 岗位下人员 用于app (目前为异常上报所有节点人员) - * sj 2021-12-22 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getUsers4Abnormity.do") - public ModelAndView getUsers4Abnormity(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type");//e为设备异常 p为运行异常 - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " pid ";//morder - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - - String sql = ""; - - //运行异常 - if (type != null && type.equals(Abnormity.Type_Run)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Abnormity_Run + "-" + unitId + "'"; - } - //设备异常 - if (type != null && type.equals(Abnormity.Type_Equipment)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Abnormity_Equipment + "-" + unitId + "'"; - } - //设施异常 - if (type != null && type.equals(Abnormity.Type_Facilities)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Abnormity_Facilities + "-" + unitId + "'"; - } - //维修工单 - if (type != null && type.equals(WorkorderDetail.REPAIR)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Repair + "-" + unitId + "'"; - } - //保养工单 - if (type != null && type.equals(WorkorderDetail.MAINTAIN)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Maintain + "-" + unitId + "'"; - } - - List list_model = repositoryService.createNativeModelQuery().sql(sql).list(); - if (list_model != null && list_model.size() > 0) { - ModelNodeJob modelNodeJob = new ModelNodeJob(); - modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'"); - List list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob); - HashSet hs = new HashSet(); - for (int i = 0; i < list_model_node.size(); i++) { - List list_user_job = userJobService.selectListByWhere("where jobid = '" + list_model_node.get(i).getJobId() + "'"); - for (UserJob userJob : list_user_job) { - hs.add(userJob.getUserid()); - } - } - String userIdS = ""; - for (String str : hs) { - userIdS += "'" + str + "',"; - } - if (userIdS != null && !userIdS.equals("")) { - userIdS = userIdS.substring(0, userIdS.length() - 1); - wherestr += " and id in (" + userIdS + ")"; - } - - } - PageHelper.startPage(pages, pagesize); - List list = this.userService.selectListByWhere(wherestr + orderstr); - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 获取巡检 第一个节点的 岗位下人员 用于app - * sj 2021-12-22 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getUsers4PatrolRecord.do") - public ModelAndView getUsers4PatrolRecord(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " pid ";//morder - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - - String sql = ""; - - //运行异常 - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Patrol_Record + "-" + unitId + "'"; - - List list_model = repositoryService.createNativeModelQuery().sql(sql).list(); - if (list_model != null && list_model.size() > 0) { - ModelNodeJob modelNodeJob = new ModelNodeJob(); - modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'"); - List list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob); - HashSet hs = new HashSet(); - for (int i = 0; i < list_model_node.size(); i++) { - List list_user_job = userJobService.selectListByWhere("where jobid = '" + list_model_node.get(i).getJobId() + "'"); - for (UserJob userJob : list_user_job) { - hs.add(userJob.getUserid()); - } - } - String userIdS = ""; - for (String str : hs) { - userIdS += "'" + str + "',"; - } - if (userIdS != null && !userIdS.equals("")) { - userIdS = userIdS.substring(0, userIdS.length() - 1); - wherestr += " and id in (" + userIdS + ")"; - } - - } - PageHelper.startPage(pages, pagesize); - List list = this.userService.selectListByWhere(wherestr + orderstr); - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 人员选择弹窗界面(通用) 2024-02-20 sj 修改 - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "人员选择弹窗界面(页面)", notes = "人员选择弹窗页面 可参照 workorderDetailRepairAdd.jsp", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂Id", dataType = "String", paramType = "query", required = true, defaultValue = "厂id;会根据传入的厂id,向下查询所有数据"), - @ApiImplicitParam(name = "userIds", value = "人员Ids", dataType = "String", paramType = "query", required = false, defaultValue = "人员ids 逗号区分;用于已选人员的回显"), - @ApiImplicitParam(name = "jobIds", value = "职位Ids", dataType = "String", paramType = "query", required = false, defaultValue = "职位Ids 逗号区分;传入后只会查询改职位对应的人员"), - @ApiImplicitParam(name = "type", value = "流程类型", dataType = "String", paramType = "query", required = false, defaultValue = "流程类型;用于查询该流程类型第一个节点的职位,并筛选(用ProcessType中的id)"), - @ApiImplicitParam(name = "fucname", value = "回调方法名", dataType = "String", paramType = "query", required = false, defaultValue = "回调方法名;根据需要传参") - }) - @RequestMapping("/layerUser.do") - public String layerUser(HttpServletRequest request, Model model, - @RequestParam(value = "unitId", required = true) String unitId, - @RequestParam(value = "userIds", required = false) String userIds, - @RequestParam(value = "jobIds", required = false) String jobIds, - @RequestParam(value = "type", required = false) String type, - @RequestParam(value = "fucname", required = false) String fucname) { - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - model.addAttribute("jobIds", jobIds); - return "user/userSelectLayer"; - } - - @RequestMapping("/userForSelectByAbnormity.do") - public String userForSelectByAbnormity(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - return "user/userForSelectByAbnormity"; - } - - /** - * 根据type获取各流程首个节点 配置的岗位对应人员 (各模块通用) - * sj 2022-06-05 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/userForSelect4FirstActiviti.do") - public String userForSelect4FirstActiviti(HttpServletRequest request, Model model) { - String userIds = request.getParameter("userIds"); -// String type = request.getParameter("type"); - if (userIds != null && !userIds.isEmpty()) { - List list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')"); - model.addAttribute("users", JSONArray.fromObject(list)); - } - return "user/userForSelect4FirstActiviti"; - } - - /** - * 根据type获取各流程首个节点 配置的岗位对应人员 (各模块通用) - * sj 2022-06-05 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getUsers4FirstActiviti.do") - public ModelAndView getUsers4FirstActiviti(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String pid = request.getParameter("pid"); - String jobIds = request.getParameter("jobIds"); - String search_name = request.getParameter("search_name"); - - //默认查看右上角层级的人员 - if (pid == null || pid.equals("")) { - pid = unitId; - } - - int pages = 0; - if (request.getParameter("page") != null && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - String sort = ""; - if (request.getParameter("sort") != null && !request.getParameter("sort").isEmpty()) { - sort = request.getParameter("sort"); - } else { - sort = " pid ";//morder - } - String order = ""; - if (request.getParameter("order") != null && !request.getParameter("order").isEmpty()) { - order = request.getParameter("order"); - } else { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 and active='" + CommString.Active_True + "' "; - - String sql = ""; - - //运行异常 - if (type != null && type.equals(Abnormity.Type_Run)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Abnormity_Run + "-" + unitId + "'"; - } - //设备异常 - if (type != null && type.equals(Abnormity.Type_Equipment)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Abnormity_Equipment + "-" + unitId + "'"; - } - //设施异常 - if (type != null && type.equals(Abnormity.Type_Facilities)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Abnormity_Facilities + "-" + unitId + "'"; - } - //维修工单 - if (type != null && type.equals(WorkorderDetail.REPAIR)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Repair + "-" + unitId + "'"; - } - //保养工单 - if (type != null && type.equals(WorkorderDetail.MAINTAIN)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.Workorder_Maintain + "-" + unitId + "'"; - } - //kpi 计划 - if (type != null && type.equals(KpiActivitiRequest.Type_PLAN)) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + ProcessType.KPI_MAKE_PLAN + "-" + unitId + "'"; - } - - List list_model = repositoryService.createNativeModelQuery().sql(sql).list(); - if (list_model != null && list_model.size() > 0) { - ModelNodeJob modelNodeJob = new ModelNodeJob(); - modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'"); - List list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob); - HashSet hs = new HashSet(); - for (int i = 0; i < list_model_node.size(); i++) { - List list_user_job = userJobService.selectListByWhere("where jobid = '" + list_model_node.get(i).getJobId() + "'"); - for (UserJob userJob : list_user_job) { - hs.add(userJob.getUserid()); - } - } - String userIdS = ""; - for (String str : hs) { - userIdS += "'" + str + "',"; - } - if (userIdS != null && !userIdS.equals("")) { - userIdS = userIdS.substring(0, userIdS.length() - 1); - wherestr += " and id in (" + userIdS + ")"; - } - } - - //模糊搜索人名 - if (search_name != null && !search_name.trim().equals("")) { - wherestr += "and (caption like '%" + search_name + "%' or name like '%" + search_name + "%') "; - } - - //筛选厂区 - if (pid != null && !pid.isEmpty()) { - List plist = this.unitService.getParentChildrenByUnitid(pid); - String pids = ""; - if (plist != null && plist.size() > 0) { - for (int p = 0; p < plist.size(); p++) { - pids += plist.get(p).getId() + ","; - } - } - wherestr += " and pid in ('" + pids.replace(",", "','") + "') "; - } - //筛选班组 - if (jobIds != null && !jobIds.isEmpty()) { - String userIds = ""; - List list = this.userJobService.selectListByWhere("where jobid in ('" + jobIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + jobIds + ",')"); - for (UserJob item : list) { - String userid = item.getUserid(); - userIds += userid + ","; - } - if (userIds != null && userIds.length() > 1) { - userIds = userIds.substring(0, userIds.length() - 1); - } - if (userIds != null && !userIds.isEmpty()) { - wherestr += "and id in ('" + userIds.replace(",", "','") + "') "; - } - } - PageHelper.startPage(pages, pagesize); - List list = this.userService.selectListByWhere(wherestr + orderstr); - PageInfo page = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getUserForSelects.do") - public ModelAndView getUserForSelects(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String unitId = request.getParameter("unitId"); - String pid = request.getParameter("pid"); - String jobIds = request.getParameter("jobIds"); - String search_name = request.getParameter("search_name"); - String type = request.getParameter("type"); - String num = request.getParameter("num");//num为有些流程在大流程的下面 如:公司运维下面的 缺陷工单 一般流程不需要传 - - //默认查看右上角层级的人员 - if (pid == null || pid.equals("")) { - pid = unitId; - } - - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 and active='" + CommString.Active_True + "' "; - - //模糊搜索人员 - if (search_name != null && !search_name.isEmpty()) { - wherestr += "and (caption like '%" + search_name + "%' " + " or name like '%" + search_name + "%' " + " or userCardId like '%" + search_name + "%') "; - } - - //根据type查询流程 第一个节点的职位 对应的人员 - if(type!=null && !type.equals("")){ - String sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + "'"; - if (num != null && !num.trim().equals("")) { - sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + num + "'"; - } - List list_model = repositoryService.createNativeModelQuery().sql(sql).list(); - if (list_model != null && list_model.size() > 0) { - ModelNodeJob modelNodeJob = new ModelNodeJob(); - modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'"); - List list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob); - HashSet hs = new HashSet(); - for (int i = 0; i < list_model_node.size(); i++) { - List list_user_job = userJobService.selectListByWhere("where jobid = '" + list_model_node.get(i).getJobId() + "'"); - for (UserJob userJob : list_user_job) { - hs.add(userJob.getUserid()); - } - } - String userIdS = ""; - for (String str : hs) { - userIdS += "'" + str + "',"; - } - if (userIdS != null && !userIdS.equals("")) { - userIdS = userIdS.substring(0, userIdS.length() - 1); - wherestr += " and id in (" + userIdS + ")"; - } - } - } - - //根据pid筛选最高层级 - if (pid != null && !pid.isEmpty()) { - List plist = this.unitService.getParentChildrenByUnitid(pid); - String pids = ""; - if (plist != null && plist.size() > 0) { - for (int p = 0; p < plist.size(); p++) { - pids += plist.get(p).getId() + ","; - } - } - wherestr += " and pid in ('" + pids.replace(",", "','") + "') "; - } - - //筛选职位 - if (jobIds != null && !jobIds.isEmpty()) { - String userIds = ""; - List list = this.userJobService.selectListByWhere("where jobid in ('" + jobIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + jobIds + ",')"); - for (UserJob item : list) { - String userid = item.getUserid(); - userIds += userid + ","; - } - if (userIds != null && userIds.length() > 1) { - userIds = userIds.substring(0, userIds.length() - 1); - } - if (userIds != null && !userIds.isEmpty()) { - wherestr += "and id in ('" + userIds.replace(",", "','") + "') "; - } - } - - //仅看选择人员 - if (request.getParameter("isChoose") != null && request.getParameter("isChoose").equals("yes")) { - wherestr += "and id in ('" + request.getParameter("userIds").replace(",", "','") + "') "; - } - - PageHelper.startPage(page, rows); - List list = this.userService.selectListByWhere(wherestr + orderstr); - PageInfo pageInfo = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pageInfo.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @ApiOperation(value = "根据人员id获取对应的手机号码", notes = "根据人员id获取对应的手机号码(可多个)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "userIds", value = "人员ids", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/getMobile4UserIds.do", method = RequestMethod.GET) - public String getMobile4UserIds(HttpServletRequest request, Model model, - @RequestParam(value = "userIds") String userIds) { - String mobiles = ""; - if (userIds != null && !userIds.equals("")) { - String[] userId = userIds.split(","); - if (userId != null && userId.length > 0) { - for (int i = 0; i < userId.length; i++) { - User user = userService.getUserById(userId[i]); - if (user != null) { - if (user.getMobile() != null && !user.getMobile().trim().equals("")) { - mobiles += user.getMobile() + ","; - } else { - mobiles += "未配置" + ","; - } - } - } - } - } - if (mobiles != null && !mobiles.equals("")) { - mobiles = mobiles.substring(0, mobiles.length() - 1); - } -// Result result = Result.success(mobiles); - model.addAttribute("result", mobiles); - return "result"; - } - - @RequestMapping("/showUserOutsiders.do") - public String showUserOutsiders(HttpServletRequest request, Model model) { - return "/user/userOutsidersList"; - } - - @RequestMapping("/getList4UserOutsiders.do") - public ModelAndView getList4UserOutsiders(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and pid like '%" + request.getParameter("type") + "%' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.userOutsidersService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getPositionTagId.do") - public ModelAndView getPositionTagId(HttpServletRequest request, Model model) throws IOException { - String result = this.userOutsidersService.getPositionApi4tag(request.getParameter("cardid")); - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/valueEngineering/EquipmentDepreciationController.java b/src/com/sipai/controller/valueEngineering/EquipmentDepreciationController.java deleted file mode 100644 index f3a9fd10..00000000 --- a/src/com/sipai/controller/valueEngineering/EquipmentDepreciationController.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.sipai.controller.valueEngineering; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/valueEngineering/equipmentDepreciation") -public class EquipmentDepreciationController { - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UnitService unitService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/valueEngineering/equipmentDepreciationList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("companyId")!=null && !request.getParameter("companyId").isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and bizId in ("+companyids+") "; - } - } - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processSectionId = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and equipmentName like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - Company company = unitService.getCompById(companyId); - model.addAttribute("company", company); - return "/valueEngineering/equipmentDepreciationAdd"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentCardService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentCardService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("equipmentDep") EquipmentCard equipmentDep){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentDep.setId(CommUtil.getUUID()); - equipmentDep.setInsuser(cu.getId()); - equipmentDep.setInsdt(CommUtil.nowDate()); - //新增设备保存时,计算设备的年折旧额、月折旧额、累计折旧额、当前价值、年折旧率、月折旧率 - int result = this.equipmentCardService.save(equipmentDep); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentDep.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - model.addAttribute("equipmentCard", equipmentCard); - return "/valueEngineering/equipmentDepreciationView"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - model.addAttribute("equipmentCard", equipmentCard); - return "/valueEngineering/equipmentDepreciationEdit"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("equipmentDep") EquipmentCard equipmentDep){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentDep.setInsuser(cu.getId()); - equipmentDep.setInsdt(CommUtil.nowDate()); - int result = this.equipmentCardService.update(equipmentDep); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentDep.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/valueEngineering/EquipmentEvaluateController.java b/src/com/sipai/controller/valueEngineering/EquipmentEvaluateController.java deleted file mode 100644 index 5f3af829..00000000 --- a/src/com/sipai/controller/valueEngineering/EquipmentEvaluateController.java +++ /dev/null @@ -1,1290 +0,0 @@ -package com.sipai.controller.valueEngineering; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.LineChart; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentAge; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentClassProp; -import com.sipai.entity.equipment.EquipmentCommStr; -import com.sipai.entity.equipment.EquipmentIncreaseValue; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentStatistics; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.equipment.EquipmentUseAge; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserCommStr; -import com.sipai.entity.valueEngineering.EquipmentEvaluate; -import com.sipai.entity.valueEngineering.EquipmentEvaluateCommStr; -import com.sipai.entity.valueEngineering.EquipmentModel; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassPropService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentIncreaseValueService; -import com.sipai.service.equipment.EquipmentLevelService; -import com.sipai.service.equipment.EquipmentSpecificationService; -import com.sipai.service.equipment.EquipmentStatisticsService; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.service.equipment.EquipmentUseAgeService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.user.UnitService; -import com.sipai.service.valueEngineering.EquipmentEvaluateService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping("/valueEngineering/equipmentEvaluate") -public class EquipmentEvaluateController { - @Resource - private UnitService unitService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private AbnormityService abnormityService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentClassPropService equipmentClassPropService; - @Resource - private EquipmentEvaluateService equipmentEvaluateService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - @Resource - private EquipmentUseAgeService equipmentUseAgeService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EquipmentStatisticsService equipmentStatisticsService; - @Resource - private EquipmentIncreaseValueService equipmentIncreaseValueService; - @Resource - private AssetClassService assetClassService; - @Resource - private EquipmentLevelService equipmentLevelService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/valueEngineering/equipmentEvalueList"; - } - - /** - * 设备评价中选择设备 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showEquipmentForEvaluateSelects.do") - public String showEquipmentForEvaluateSelects(HttpServletRequest request, - Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - if (equipmentIds != null && !equipmentIds.isEmpty()) { - String[] id_Array = equipmentIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("equipments", jsonArray); - } - return "/equipment/equipmentCardListForEvaluateSelects"; - } - - /** - * 设备指标详情界面 - */ - @RequestMapping("/viewEconomic.do") - public String doviewEconomic(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("id"); - EquipmentCardProp equipmentProp = this.equipmentCardPropService - .selectByEquipmentId(equipmentId); - BigDecimal energyMoney = new BigDecimal(0); - if (null != equipmentProp.getEnergyMoney()) { - energyMoney = equipmentProp.getEnergyMoney(); - } - BigDecimal repairMoney = new BigDecimal(0); - if (null != equipmentProp.getRepairMoney()) { - repairMoney = equipmentProp.getRepairMoney(); - } - BigDecimal maintainMoney = new BigDecimal(0); - if (null != equipmentProp.getMaintainMoney()) { - maintainMoney = equipmentProp.getMaintainMoney(); - } - BigDecimal laborMoney = new BigDecimal(0); - if (null != equipmentProp.getLaborMoney()) { - laborMoney = equipmentProp.getLaborMoney(); - } - BigDecimal purchaseMoney = new BigDecimal(0); - if (null != equipmentProp.getPurchaseMoney()) { - purchaseMoney = equipmentProp.getPurchaseMoney(); - } - double residualValueRate = 0; - if (null != equipmentProp.getResidualValueRate()) { - residualValueRate = equipmentProp.getResidualValueRate(); - } - double useTime = 0; - if (null != equipmentProp.getUseTime()) { - useTime = equipmentProp.getUseTime(); - } - BigDecimal totalLaborMoney = laborMoney.multiply(new BigDecimal( - useTime * 12)); - BigDecimal runMoney = energyMoney.add(repairMoney).add(maintainMoney) - .add(totalLaborMoney); - BigDecimal residualMoney = purchaseMoney.multiply(new BigDecimal( - residualValueRate)); - model.addAttribute("purchaseMoney", - purchaseMoney.setScale(2, BigDecimal.ROUND_HALF_UP));// 设备的采购费 - model.addAttribute("runMoney", - runMoney.setScale(2, BigDecimal.ROUND_HALF_UP));// 设备的运行维修费 - model.addAttribute("residualMoney", - residualMoney.setScale(2, BigDecimal.ROUND_HALF_UP));// 设备的残值 - model.addAttribute("LCC", (residualMoney.add(runMoney) - .add(purchaseMoney)).setScale(2, BigDecimal.ROUND_HALF_UP));// 设备的生命周期成本 - model.addAttribute("equipmentProp", equipmentProp);// 设备附属信息 - return "/valueEngineering/economicView"; - } - - @RequestMapping("/getEquipmentCost.do") - public String getEquipmentCost(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - EquipmentCardProp equipmentProp = this.equipmentCardPropService - .selectByEquipmentId(equipmentId); - BigDecimal energyMoney = new BigDecimal(0); - if (null != equipmentProp.getEnergyMoney()) { - energyMoney = equipmentProp.getEnergyMoney(); - } - BigDecimal repairMoney = new BigDecimal(0); - if (null != equipmentProp.getRepairMoney()) { - repairMoney = equipmentProp.getRepairMoney(); - } - BigDecimal maintainMoney = new BigDecimal(0); - if (null != equipmentProp.getMaintainMoney()) { - maintainMoney = equipmentProp.getMaintainMoney(); - } - BigDecimal laborMoney = new BigDecimal(0); - if (null != equipmentProp.getLaborMoney()) { - laborMoney = equipmentProp.getLaborMoney(); - } - BigDecimal purchaseMoney = new BigDecimal(0); - if (null != equipmentProp.getPurchaseMoney()) { - purchaseMoney = equipmentProp.getPurchaseMoney(); - } - double residualValueRate = 0; - if (null != equipmentProp.getResidualValueRate()) { - residualValueRate = equipmentProp.getResidualValueRate(); - } - double useTime = 0; - if (null != equipmentProp.getUseTime()) { - useTime = equipmentProp.getUseTime(); - } - BigDecimal totalLaborMoney = laborMoney.multiply(new BigDecimal( - useTime * 12)); - BigDecimal runMoney = energyMoney.add(repairMoney).add(maintainMoney) - .add(totalLaborMoney); - BigDecimal residualMoney = purchaseMoney.multiply(new BigDecimal( - residualValueRate)); - String result = "{\"purchaseMoney\":" - + purchaseMoney.setScale(2, BigDecimal.ROUND_HALF_UP) - + "," - + "\"runMoney\":" - + runMoney.setScale(2, BigDecimal.ROUND_HALF_UP) - + ", " - + "\"residualMoney\":" - + residualMoney.setScale(2, BigDecimal.ROUND_HALF_UP) - + ", " - + "\"LCC\":" - + (residualMoney.add(runMoney).add(purchaseMoney)).setScale(2, - BigDecimal.ROUND_HALF_UP) + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 添加设备类型对比 - */ - @RequestMapping("/addEquipmentClassForCompare.do") - public String doaddEquipmentClassForCompare(HttpServletRequest request, - Model model) { - String equipmentData = request.getParameter("data"); - String classId = ""; - String useTime = ""; - String specification = ""; - if (null != equipmentData && !equipmentData.isEmpty()) { - JSONArray jsonArray = JSONArray.parseArray(equipmentData); - JSONObject jsonObject = (JSONObject) jsonArray.get(0); - classId = (String) jsonObject.get("classId"); - useTime = (String) jsonObject.get("useTime"); - specification = (String) jsonObject.get("specification"); - } - model.addAttribute("classId", classId); - model.addAttribute("useTime", useTime); - model.addAttribute("specification", specification); - return "/valueEngineering/compareAdd"; - } - - /** - * 选择好对比条件后,生成对比数据 - */ - @RequestMapping("/createCompareData.do") - public String docreateCompareData(HttpServletRequest request, Model model, - @ModelAttribute EquipmentEvaluate evaluate) { - String models = evaluate.getModel().replace(",", "','"); - String wherestr = "where class_id = '" + evaluate.getClassId() + "' " - + "and specification = '" + evaluate.getSpecification() + "' " - + "and use_time = '" + evaluate.getUseTime() + "' " - + "and model in ('" + models + "')"; - List list = this.equipmentEvaluateService - .selectListByWhere(wherestr); - JSONArray json = (JSONArray) JSONArray.toJSON(list); - String result = "{\"res\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 查看设备维护履历 - * - * @return - */ - @RequestMapping("/viewMaintainDetail.do") - public String doviewMaintainDetail(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService - .selectByEquipmentId(equipmentId); - BigDecimal maintainMoney = new BigDecimal(0); - if (null != equipmentCardProp.getMaintainMoney()) { - maintainMoney = equipmentCardProp.getMaintainMoney(); - } - model.addAttribute("maintainMoney", - maintainMoney.setScale(2, BigDecimal.ROUND_HALF_UP)); - return "valueEngineering/maintainView"; - } - - /** - * 查看设备维修履历 - * - * @return - */ - @RequestMapping("/viewRepairDetail.do") - public String doviewRepairDetail(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService - .selectByEquipmentId(equipmentId); - BigDecimal repairMoney = new BigDecimal(0); - if (null != equipmentCardProp.getRepairMoney()) { - repairMoney = equipmentCardProp.getRepairMoney(); - } - model.addAttribute("repairMoney", - repairMoney.setScale(2, BigDecimal.ROUND_HALF_UP)); - return "valueEngineering/repairView"; - } - - /** - * 查看设备价值增加 - * - * @return - */ - @RequestMapping("/viewIncreaseValue.do") - public String doviewIncreaseValue(HttpServletRequest request, Model model) { - String equipmentId = request.getParameter("equipmentId"); - List increaseValues = this.equipmentIncreaseValueService - .selectListByWhere("where equipment_id = '" + equipmentId + "'"); - BigDecimal increaseValue = new BigDecimal(0); - if (null != increaseValues && increaseValues.size() > 0) { - for (EquipmentIncreaseValue value : increaseValues) { - if (null != value.getIncreaseValue()) { - increaseValue = increaseValue.add(value.getIncreaseValue()); - } - } - } - model.addAttribute("increaseValue", - increaseValue.setScale(2, BigDecimal.ROUND_HALF_UP)); - return "valueEngineering/increaseValueView"; - } - - @RequestMapping("/viewEnergyMoney.do") - public String doviewEnergyMoney(HttpServletRequest request, Model model) { - /* - * String equipmentId = request.getParameter("equipmentId"); - * EquipmentCardProp equipmentCardProp = - * this.equipmentCardPropService.selectByEquipmentId(equipmentId); - * BigDecimal repairMoney = new BigDecimal(0); if (null != - * equipmentCardProp.getRepairMoney()) { repairMoney = - * equipmentCardProp.getRepairMoney(); } - * model.addAttribute("repairMoney", - * repairMoney.setScale(2,BigDecimal.ROUND_HALF_UP)); - */ - return "valueEngineering/energyView"; - } - - /** - * 根据设备类型筛选设备规格 - */ - @RequestMapping("/getEquipmentSpecificationForSelect.do") - public String getEquipmentSpecificationForSelect( - HttpServletRequest request, Model model) { - String equipmentClassId = request.getParameter("equipmentClassId"); - // String companyId = request.getParameter("companyId"); - List list = this.equipmentCardService - .selectListByWhere("where equipmentClassID = '" - + equipmentClassId + "'"); - String specificS = ""; - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (EquipmentCard item : list) { - if (null != item.getSpecification() - && !item.getSpecification().isEmpty()) { - if (specificS != "") { - specificS += ","; - } - specificS += item.getSpecification(); - } - } - } - specificS = this.abnormityService.deleteRepeatElement(specificS); - specificS = specificS.replace(",", "','"); - List specifications = this.equipmentSpecificationService - .selectListByWhere("where id in ('" + specificS + "')"); - if (specifications != null && specifications.size() > 0) { - for (EquipmentSpecification item : specifications) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item.getId()); - jsonObject.put("text", item.getName()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray.toString()); - return "result"; - } - - /** - * 根据设备类型、规格筛选设备列表 - */ - @RequestMapping("/getEquipmentList.do") - public ModelAndView getEquipmentList(HttpServletRequest request, - Model model, @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String useTimeId = request.getParameter("useTime"); - String whereProp = ""; - String equipmentIds = ""; - if (null != useTimeId && !useTimeId.isEmpty()) { - EquipmentUseAge useAge = this.equipmentUseAgeService - .selectById(useTimeId); - if (null != useAge.getValueMax()) { - whereProp += "where use_time > '" + useAge.getValueMin() - + "' and use_time <= '" + useAge.getValueMax() + "'"; - } else { - whereProp += "where use_time > '" + useAge.getValueMin() + "'"; - } - // 根据已用年限选择出设备的id - List props = this.equipmentCardPropService - .selectListByWhere(whereProp); - if (null != props && props.size() > 0) { - for (EquipmentCardProp prop : props) { - if (equipmentIds != "") { - equipmentIds += ","; - } - equipmentIds += prop.getEquipmentId(); - } - } - } - equipmentIds = equipmentIds.replace(",", "','"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where id in ('" + equipmentIds + "')" - + " and equipmentClassID = '" - + request.getParameter("equipmentClassId") + "' " - + " and specification = '" - + request.getParameter("specification") + "' "; - PageHelper.startPage(page, rows); - List list = this.equipmentCardService - .selectListByWhere(wherestr + orderstr); - // 去除设备型号一样的数据 - Set set = new TreeSet<>(new Comparator() { - public int compare(EquipmentCard o1, EquipmentCard o2) { - // 字符串,则按照asicc码升序排列 - return o1.getEquipmentmodel().compareTo(o2.getEquipmentmodel()); - } - - }); - set.addAll(list); - list = new ArrayList<>(set); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.parseArray(JSON.toJSONString(list)); - String result = "{\"total\":" + list.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 查看设备指标前选择设备 - * - * @return - */ - @RequestMapping("/showEquipmentCardForEvalueSelect.do") - public String showEquipmentCardForEvalueSelect(HttpServletRequest request, - Model model) { - String equipmentData = request.getParameter("equipmentData"); - if (null == equipmentData || ("").equals(equipmentData)) { - model.addAttribute("equipmentId", - request.getParameter("equipmentId")); - model.addAttribute("ids", request.getParameter("ids")); - model.addAttribute("status", "other"); - return "valueEngineering/equipmentCardForEvalueSelect"; - } - JSONObject jsonObject = JSONObject.parseObject(equipmentData); - String classId = jsonObject.getString("classId"); - String specification = jsonObject.getString("specification"); - String equipmentModel = jsonObject.getString("model"); - String useTimeId = jsonObject.getString("useTime"); - String whereProp = ""; - if (null != useTimeId && !useTimeId.isEmpty()) { - EquipmentUseAge useAge = this.equipmentUseAgeService - .selectById(useTimeId); - if (null != useAge.getValueMax()) { - whereProp += "where use_time > '" + useAge.getValueMin() - + "' and use_time <= '" + useAge.getValueMax() + "'"; - } else { - whereProp += "where use_time > '" + useAge.getValueMin() + "'"; - } - } - /* - * switch (useTime) { case "0": whereProp += "where use_time < 3"; - * break; case "1": whereProp += "where use_time >= 3 and use_time <5"; - * break; case "2": whereProp += "where use_time >= 5 and use_time <7"; - * break; case "3": whereProp += "where use_time >7"; break; default: - * break; } - */ - // 根据已用年限选择出设备的id - List props = this.equipmentCardPropService - .selectListByWhere(whereProp); - String equipmentIds = ""; - if (null != props && props.size() > 0) { - for (EquipmentCardProp prop : props) { - if (equipmentIds != "") { - equipmentIds += ","; - } - equipmentIds += prop.getEquipmentId(); - } - } - equipmentIds = equipmentIds.replace(",", "','"); - // 根据设备的类型,规格,型号,id,筛选出设备 - String wherestr = "where equipmentClassID = '" + classId - + "' and specification = '" + specification + "' " - + "and equipmentModel = '" + equipmentModel + "' and id in ('" - + equipmentIds + "')"; - List equipmentCards = this.equipmentCardService - .selectListByWhere(wherestr); - String ids = ""; - if (null != equipmentCards && equipmentCards.size() > 0) { - for (EquipmentCard equipmentCard : equipmentCards) { - if (ids != "") { - ids += ","; - } - ids += equipmentCard.getId(); - } - } - model.addAttribute("id", equipmentCards.get(0).getId()); - model.addAttribute("name", equipmentCards.get(0).getEquipmentname()); - model.addAttribute("ids", ids); - model.addAttribute("status", "first"); - return "valueEngineering/equipmentCardForEvalueSelect"; - } - - /** - * 根据设备类型分类id,查询4个评分排名历史纪录 - */ - @RequestMapping("/getRankLineChart.do") - public String getRankLineChart(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - List lineChart = this.equipmentEvaluateService - .getRankLineChart(id); - JSONArray json = (JSONArray) JSONArray.toJSON(lineChart); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showEconomicLife.do") - public String showEconomicLife(HttpServletRequest request, Model model) { - return "/valueEngineering/economicLife"; - } - @RequestMapping("/showEconomicLife4pumpAnalysis.do") - public String showEconomicLife4pumpAnalysis(HttpServletRequest request, Model model) { - String startdate = CommUtil.subplus(CommUtil.nowDate(),"-24", "hour"); - String enddate = CommUtil.nowDate(); - model.addAttribute("startdate", startdate); - model.addAttribute("enddate", enddate); - return "/valueEngineering/economicLife4pumpAnalysis"; - } - @RequestMapping("/showEconomicLife4pumpAnalysisContrast.do") - public String showEconomicLife4pumpAnalysisContrast(HttpServletRequest request, Model model) { - String startdate = CommUtil.subplus(CommUtil.nowDate(),"-24", "hour"); - String enddate = CommUtil.nowDate(); - model.addAttribute("startdate", startdate); - model.addAttribute("enddate", enddate); - return "/valueEngineering/economicLife4pumpAnalysisContrast"; - } - @RequestMapping("/showEconomicLife4pumpAnalysisModelContrast.do") - public String showEconomicLife4pumpAnalysisModelContrast(HttpServletRequest request, Model model) { - String startdate = CommUtil.subplus(CommUtil.nowDate(),"-24", "hour"); - String enddate = CommUtil.nowDate(); - model.addAttribute("startdate", startdate); - model.addAttribute("enddate", enddate); - return "/valueEngineering/economicLife4pumpAnalysisModelContrast"; - } - @RequestMapping("/showEconomicLife4fanAnalysis.do") - public String showEconomicLife4fanAnalysis(HttpServletRequest request, Model model) { - String startdate = CommUtil.subplus(CommUtil.nowDate(),"-24", "hour"); - String enddate = CommUtil.nowDate(); - model.addAttribute("startdate", startdate); - model.addAttribute("enddate", enddate); - return "/valueEngineering/economicLife4fanAnalysis"; - } - - /** - * 根据设备id,获取经济寿命曲线 - */ - @RequestMapping("/getEconomicLifeLineChart.do") - public String getEconomicLifeLineChart(HttpServletRequest request, - Model model) { - String id = request.getParameter("id"); - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentLifeLine(id); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - /** - * 根据设备id,获取泵性能分析 - */ - @RequestMapping("/getPumpAnalysisChartDataOld.do") - public String getPumpAnalysisChartDataOld(HttpServletRequest request, - Model model) { - String id = request.getParameter("id"); - String timeType = request.getParameter("timeType"); - String num = request.getParameter("num"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String pumpMultiple = request.getParameter("pumpMultiple"); - - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentPumpAnalysis(id,timeType,num,startdate,enddate); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - /** - * 根据设备id,获取泵性能分析 - */ - @RequestMapping("/getPumpAnalysisChartData.do") - public String getPumpAnalysisChartData(HttpServletRequest request, - Model model) { - String id = request.getParameter("id"); - String timeType = request.getParameter("timeType"); - String num = request.getParameter("num"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String pumpMultiple = request.getParameter("pumpMultiple"); - - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentPumpAnalysis(id,timeType,num,startdate,enddate,pumpMultiple); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - /** - * 根据设备id,获取泵性能分析 - */ - @RequestMapping("/getPumpAnalysisContrastChartData.do") - public String getPumpAnalysisContrastChartData(HttpServletRequest request, - Model model) { - String id = request.getParameter("id"); - String timeType = request.getParameter("timeType"); - String num = request.getParameter("num"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String pumpMultiple = request.getParameter("pumpMultiple"); - - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentPumpAnalysisContrast(id,timeType,num,startdate,enddate,pumpMultiple); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - /** - * 根据设备id,获取风机性能分析 - */ - @RequestMapping("/getFanAnalysisChartData.do") - public String getFanAnalysisChartData(HttpServletRequest request, - Model model) { - String id = request.getParameter("id"); - String timeType = request.getParameter("timeType"); - String num = request.getParameter("num"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentFanAnalysis(id,timeType,num,startdate,enddate); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 根据设备的型号规格和制造厂家,获取泵单耗分析 - */ - @RequestMapping("/getPumpAnalysisModelChartData.do") - public String getPumpAnalysisModelChartData(HttpServletRequest request, - Model model) { - String selectionModels = request.getParameter("selectionModels"); - String timeType = request.getParameter("timeType"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String unitId = request.getParameter("unitId"); - String pumpMultiple = request.getParameter("pumpMultiple"); - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentPumpAnalysisModel( - selectionModels,timeType,startdate,enddate,unitId,pumpMultiple); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - /** - * 根据设备的型号规格和制造厂家,获取泵单耗分析 - */ - @RequestMapping("/getPumpAnalysisDHModelChartData.do") - public String getPumpAnalysisDHModelChartData(HttpServletRequest request, - Model model) { - String selectionModels = request.getParameter("selectionModels"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String unitId = request.getParameter("unitId"); - String pumpMultiple = request.getParameter("pumpMultiple"); - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentPumpAnalysisDHModel( - selectionModels,startdate,enddate,unitId,pumpMultiple); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - /** - * 根据设备的型号规格和制造厂家,获取泵单耗分析 - */ - @RequestMapping("/getPumpAnalysisDHChartData.do") - public String getPumpAnalysisDHChartData(HttpServletRequest request, - Model model) { - String selectionModels = request.getParameter("selectionModels"); - String startdate = request.getParameter("startdate"); - String enddate = request.getParameter("enddate"); - String unitId = request.getParameter("unitId"); - String pumpMultiple = request.getParameter("pumpMultiple"); - String result = ""; - try { - result = this.equipmentEvaluateService.getEquipmentPumpAnalysisDH( - selectionModels,startdate,enddate,unitId,pumpMultiple); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/showEquipmentStatisticsList.do") - public String showEquipmentStatisticsList(HttpServletRequest request, - Model model) { - return "/valueEngineering/equipmentStatisticsList"; - } - - /** - * 根据厂区id组获取统计数据 - */ - @RequestMapping("/getCompanyStatistics.do") - public String getCompanyStatistics(HttpServletRequest request, Model model) { - int pages = 0; - if (request.getParameter("page") != null - && !request.getParameter("page").isEmpty()) { - pages = Integer.parseInt(request.getParameter("page")); - } else { - pages = 1; - } - int pagesize = 0; - if (request.getParameter("rows") != null - && !request.getParameter("rows").isEmpty()) { - pagesize = Integer.parseInt(request.getParameter("rows")); - } else { - pagesize = 20; - } - // String sort=""; - /* - * if(request.getParameter("sort")!=null&&!request.getParameter("sort"). - * isEmpty()){ sort = request.getParameter("sort"); }else { sort = - * " pid ";//morder } String order=""; - * if(request.getParameter("order")!= - * null&&!request.getParameter("order").isEmpty()){ order = - * request.getParameter("order"); }else { order = " asc "; } String - * orderstr=" order by "+sort+" "+order; - */ - String ids = request.getParameter("ids");// 获取前台页面公司与水厂id组字符串 - ids = ids.replace(",", "','"); - String wherestr = " where C.type = '" + CommString.UNIT_TYPE_BIZ - + "' and S.company_id in ('" + ids + "')"; - if (request.getParameter("equipmentLevelId") != null - && !request.getParameter("equipmentLevelId").isEmpty()) { - wherestr += " and S.equipment_level_id = '" - + request.getParameter("equipmentLevelId") + "'"; - } - if (request.getParameter("stdt") != null - && !request.getParameter("stdt").isEmpty()) { - wherestr += " and S.insdt >= '" + request.getParameter("stdt") - + "'"; - } - if (request.getParameter("eddt") != null - && !request.getParameter("eddt").isEmpty()) { - wherestr += " and S.insdt <= '" + request.getParameter("eddt") - + "'"; - } - String orderstr = " order by C.type desc,C.morder,C.name,L.levelName,C.insdt desc"; - PageHelper.startPage(pages, pagesize); - List equipmentStatistics = this.equipmentStatisticsService - .selectListByWhere(wherestr + orderstr); - - PageInfo page = new PageInfo( - equipmentStatistics); - JSONArray json = (JSONArray) JSONArray.toJSON(equipmentStatistics); - - String result = "{\"total\":" + page.getTotal() + ",\"rows\":" + json - + "}"; - - model.addAttribute("result", result); - return "result"; - } - - /** - * 能耗费用历史表 - */ - @RequestMapping("/getEnergyList.do") - public ModelAndView getEnergyList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String equipmentId = request.getParameter("equipmentId"); - String result = ""; - if (null != equipmentId && !equipmentId.isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService - .selectById(equipmentId); - String energyTab = "TB_MP_" + equipmentCard.getEquipmentcardid() - + "_energy"; - PageHelper.startPage(page, rows); - List mPointHistories = this.mPointHistoryService - .selectListByTableAWhere(equipmentCard.getBizid(), - energyTab, "where 1=1" + orderstr); - PageInfo pi = new PageInfo( - mPointHistories); - JSONArray json = JSONArray.parseArray(JSONArray - .toJSONString(mPointHistories)); - result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/intactRateAndfaultRate.do") - @ResponseBody - public Map intactRateAndfaultRate(String companyId, String pSectionId, - String equipmentLevel, String equipmentClass, String stdt, - String eddt) { - int allEquipmentNumber = 0; - int goodsEquipmentNumber = 0; - Map result = new HashMap<>(); - StringBuilder commonSql = new StringBuilder("where 1=1 "); - - StringBuilder allProEquCardsql = new StringBuilder(); - StringBuilder goodsProEquCardsql = new StringBuilder(); - /* - * if(!"".equals(companyId) && null!= companyId){ - * sql.append(" and bizId = '"+companyId+"'"); } - */ - if (!"".equals(pSectionId) && null != pSectionId) { - commonSql.append(" and a.processsectionid = '" + pSectionId + "'"); - } - if (!"".equals(equipmentLevel) && null != equipmentLevel) { - commonSql - .append(" and a.equipmentLevelId = '" + equipmentLevel + "'"); - } - if (!"".equals(equipmentClass) && null != equipmentClass) { - commonSql - .append(" and a.equipmentClassId = '" + equipmentClass + "'"); - } - -// allProEquCardsql.append(commonSql.toString() -// + " and equipmentStatus in (" + "'" + EquipmentCard.Status_ON -// + "'," + "'" + EquipmentCard.Status_Scrap + "'," + "'" -// + EquipmentCard.Status_Fault + "'" +"'" + EquipmentCard.Status_OFF + "'"+")"); -// goodsProEquCardsql.append(commonSql.toString() -// + " and equipmentStatus='" + EquipmentCard.Status_ON + "'"); - //使用查询状态的联合查询 - allProEquCardsql.append(commonSql.toString() - + " and b.name in (" + "'" + EquipmentCard.equipmentStatus_ON - + "'," + "'" + EquipmentCard.equipmentStatus_OFF + "'," + "'" - + EquipmentCard.equipmentStatus_Stock + "'" +"'" + EquipmentCard.equipmentStatus_Scrap + "'"+")"); - goodsProEquCardsql.append(commonSql.toString() - + " and b.name='" + EquipmentCard.equipmentStatus_ON + "'"); - -/* Company company = unitService.getCompById(companyId); - List companyList = companyEquipmentCardCountService - .findAllCompanyByCompanyId(company); - List companyListVar = companyList; - CompanyEquipmentCardCountService.allcompanyList = new ArrayList<>(); - for (Company companyVar : companyListVar) { - // 查询厂区生产设备总数 - List equipmentCards = this.equipmentCardService - .selectListByWhere4Count(allProEquCardsql.toString() - + " and bizId='" + companyVar.getId() + "'"); - // 查询完好设备总数 - List goodsEquipmentCards = this.equipmentCardService - .selectListByWhere4Count(goodsProEquCardsql.toString() - + " and bizId='" + companyVar.getId() + "'"); - allEquipmentNumber += equipmentCards.size(); - goodsEquipmentNumber += goodsEquipmentCards.size(); - } - - if(0==allEquipmentNumber){ - result.put("intactRate", "0%"); - result.put("faultRate","0%"); - return result; - }else{ - // 创建一个数值格式化对象 - NumberFormat numberFormat = NumberFormat.getInstance(); - // 设置精确到小数点后2位 - numberFormat.setMaximumFractionDigits(2); - // 计算设备完好率 - String intactRate = numberFormat.format((double)goodsEquipmentNumber/(double)allEquipmentNumber*100)+"%"; - // 计算设备故障率 - String faultRate = numberFormat.format(((double)1-(double)goodsEquipmentNumber/(double)allEquipmentNumber)*100)+"%"; - result.put("intactRate", intactRate); - result.put("faultRate", faultRate); - return result; - }*/ - - - String companyIds=""; - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - companyIds+= " and bizId in ("+companyids+") "; - } - - // 查询厂区生产设备总数 - List equipmentCards = this.equipmentCardService - .selectListForStatus(allProEquCardsql.toString() - +companyIds); - // 查询完好设备总数 - List goodsEquipmentCards = this.equipmentCardService - .selectListForStatus(goodsProEquCardsql.toString() - + companyIds); - - allEquipmentNumber = equipmentCards.size(); - goodsEquipmentNumber = goodsEquipmentCards.size(); - //System.out.println("allEquipmentNumber================"+allEquipmentNumber); - //System.out.println("goodsEquipmentNumber============="+goodsEquipmentNumber); - if(0==allEquipmentNumber){ - result.put("intactRate", "0%"); - result.put("faultRate","0%"); - return result; - }else{ - // 创建一个数值格式化对象 - NumberFormat numberFormat = NumberFormat.getInstance(); - // 设置精确到小数点后2位 - numberFormat.setMaximumFractionDigits(2); - // 计算设备完好率 - String intactRate = numberFormat.format((double)goodsEquipmentNumber/(double)allEquipmentNumber*100)+"%"; - // 计算设备故障率 - String faultRate = numberFormat.format(((double)1-(double)goodsEquipmentNumber/(double)allEquipmentNumber)*100)+"%"; - result.put("intactRate", intactRate); - result.put("faultRate", faultRate); - return result; - } - } - /** - * 设备经济寿命模型 - */ - @RequestMapping("/showEquipmentAgeTemporary.do") - public String showEquipmentAge(HttpServletRequest request, Model model) { - return "equipment/equipmentAgeListTemporary"; - } - - @RequestMapping("/getEquipmentAgeListTemporary.do") - public ModelAndView getEquipmentAgeList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " dateadd(year,physical_life,E.install_date), dateadd(year, technical_life, E.install_date),dateadd(year,economic_life,E.install_date)"; - } else if (sort.equals("physicalLifeTime")) { - sort = " dateadd(year,physical_life,E.install_date)"; - } else if (sort.equals("technicalLifeTime")) { - sort = " dateadd(year, technical_life, E.install_date)"; - } else if (sort.equals("economicLifeTime")) { - sort = " dateadd(year,economic_life,E.install_date)"; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where (dateadd(year,physical_life,E.install_date) is not null " - + "or dateadd(year,technical_life,E.install_date) is not null " - + "or dateadd(year,R.eco_life_set,E.install_date) is not null ) " - + "and purchase_money is not null and R.eco_life_set is not null " - + "and E.residual_value_rate is not null "; - - if (request.getParameter("companyId") != null && !request.getParameter("companyId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and E.bizId in (" + companyids + ") "; - } - } - if (request.getParameter("equipmentClass") != null && !request.getParameter("equipmentClass").isEmpty()) { - wherestr += " and equipmentClassId = '" + request.getParameter("equipmentClass") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (equipmentName like '%" + request.getParameter("search_name") + "%' or equipmentCardID like '%" - + request.getParameter("search_name") + "%')"; - } - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("unitId")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and E.bizId in (" + companyids + ") "; - } - } - - if (request.getParameter("pSectionId") != null && !request.getParameter("pSectionId").isEmpty()) { - wherestr += " and processsectionid = '" + request.getParameter("pSectionId") + "' "; - } - - if (request.getParameter("equipmentLevel") != null && !request.getParameter("equipmentLevel").isEmpty()) { - wherestr += " and equipmentLevelId = '" + request.getParameter("equipmentLevel") + "' "; - } - - - String processSectionId = request.getParameter("processSectionId"); - String equipmentCardClass = request.getParameter("search_pid1"); - String name = request.getParameter("search_name"); - String equipmentLevel = request.getParameter("equipmentLevel");//abc分类 - String equipmentStatus = request.getParameter("equipmentstatus"); //设备状态 - String assetClass = request.getParameter("search_pid2"); //资产类型 - - String isequipcode = request.getParameter("isequipcode"); //设备编码 - - //为了设备报废申请单查询 - String equipmentNames = request.getParameter("equipmentName"); - - - //设备归属--常排项目用 - String equipmentBelong = request.getParameter("equipmentBelong"); - - //是否是过保查询 - String isoverdue = request.getParameter("isoverdue"); - - if (!"".equals(processSectionId) && processSectionId != null) { - wherestr += " and processSectionId = '" + processSectionId + "' "; - } - if (!"".equals(equipmentCardClass) && equipmentCardClass != null && !"-999".equals(equipmentCardClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = equipmentClassService.getUnitChildrenById(equipmentCardClass); - String companyids = ""; - for (EquipmentClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and equipmentClassID in (" + companyids + ") "; - } else { - wherestr += " and equipmentClassID='" + equipmentCardClass + "'"; - } - } - if (!"".equals(name) && name != null) { - wherestr += " and (equipmentCardID like '%" + name + "%' or equipmentName like '%" + name + "%' or equipmentModelName like '%" + name + "%' or equipmentmanufacturer like '%" + name + "%') "; - } - - if (!"".equals(equipmentNames) && equipmentNames != null) { - wherestr += " and (equipmentName like '%" + equipmentNames + "%' or equipmentCardID like '%" + equipmentNames + "%' or assetNumber like '%" + equipmentNames + "%') "; - } - - if (!"".equals(equipmentLevel) && equipmentLevel != null) { - wherestr += " and equipmentLevelId = '" + equipmentLevel + "' "; - } - - //设备归属--常排项目 - if (!"".equals(equipmentBelong) && equipmentBelong != null) { - wherestr += " and equipment_belong_id = '" + equipmentBelong + "' "; - } - - if (!"".equals(equipmentStatus) && equipmentStatus != null) { - wherestr += " and equipmentStatus = '" + equipmentStatus + "' "; - } - - if (!"".equals(assetClass) && assetClass != null && !"-999".equals(assetClass)) { - //遍历 - //递归查询 - //获取所有子节点 - List units = assetClassService.getUnitChildrenById(assetClass); - String companyids = ""; - for (AssetClass unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and asset_type in (" + companyids + ") "; - } else { - wherestr += " and asset_type='" + assetClass + "'"; - } - } - - //2020-07-13 start - if (request.getParameter("equipmentBelongId") != null && !request.getParameter("equipmentBelongId").isEmpty()) { - wherestr += " and equipment_belong_id = '" + request.getParameter("equipmentBelongId") + "' "; - } - - if (request.getParameter("equipmentCardType") != null && !request.getParameter("equipmentCardType").isEmpty()) { - wherestr += " and equipment_card_type = '" + request.getParameter("equipmentCardType") + "' "; - } - - //2020-10-12 设备编码筛选 - if (!"".equals(isequipcode) && null != isequipcode) { - switch (isequipcode) { - case "0": - wherestr += " and (equipmentCardID is not null and equipmentCardID != '' ) "; - break; - case "1": - wherestr += " and equipmentCardID like '%null%' "; - break; - case "2": - wherestr += " and (equipmentCardID is null or equipmentCardID = '' or equipmentCardID = null ) "; - break; - - default: - break; - } - - } - - if (isoverdue != null && !"".equals(isoverdue) && isoverdue.equals("1")) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowdate = null; - - try { - nowdate = sdf.parse(CommUtil.nowDate()); - } catch (Exception e) { - // TODO Auto-generated catch block - - } - - Calendar cl = Calendar.getInstance(); - cl.setTime(nowdate); - - EquipmentCard equipmentCard = new EquipmentCard(); - cl.add(Calendar.MONTH, -(equipmentCard.guaranteeTime * 12 - 3)); - nowdate = cl.getTime(); - //sdf.format(date); - - wherestr += " and install_date < '" + sdf.format(nowdate) + "' "; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - String checkedIds = request.getParameter("checkedIds"); - checkedIds = checkedIds.replace(",", "','"); - wherestr += "and id in ('" + checkedIds + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("pid") + "' "; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and responsibleDepartment like '%" + request.getParameter("search_dept") + "%'"; - } - //20200319 start========================================================================== - //设备规格 - String specification = request.getParameter("specification"); - //设备型号 - String equipmentmodel = request.getParameter("equipmentmodel"); - //设备级别 - String equipmentlevel = request.getParameter("equipmentlevel"); - - if (!"".equals(specification) && null != specification) { - StringBuilder esIdAllStr = new StringBuilder(); - StringBuilder esIdInAllStr = new StringBuilder("and specification in ("); - List esList = equipmentSpecificationService.selectListByWhere("where name like '%" + specification + "%'"); - - for (EquipmentSpecification es : esList) { - esIdAllStr.append("'" + es.getId() + "'" + ','); - } - - String esIdStr = esIdAllStr.substring(0, esIdAllStr.length() - 1); - esIdInAllStr.append(esIdStr + ")"); - wherestr += esIdInAllStr.toString(); - } - - if (!"".equals(equipmentmodel) && null != equipmentmodel) { - StringBuilder emIdAllStr = new StringBuilder(); - StringBuilder emIdInAllStr = new StringBuilder("and equipmentmodel in ("); - List emList = equipmentTypeNumberService.selectListByWhere("where name like '%" + equipmentmodel + "%'"); - for (EquipmentTypeNumber em : emList) { - emIdAllStr.append("'" + em.getId() + "'" + ','); - } - String emIdStr = emIdAllStr.substring(0, emIdAllStr.length() - 1); - emIdInAllStr.append(emIdStr + ")"); - wherestr += emIdInAllStr.toString(); - } - - if (!"".equals(equipmentlevel) && null != equipmentlevel) { - StringBuilder elIdAllStr = new StringBuilder(); - StringBuilder elIdInAllStr = new StringBuilder("and equipmentLevelId in ("); - List elList = equipmentLevelService.selectListByWhere("where levelName like '%" + equipmentlevel + "%'"); - for (EquipmentLevel el : elList) { - elIdAllStr.append("'" + el.getId() + "'" + ','); - } - String elIdStr = elIdAllStr.substring(0, elIdAllStr.length() - 1); - elIdInAllStr.append(elIdStr + ")"); - wherestr += elIdInAllStr.toString(); - - } - //20200319 end========================================================================== - - String equipmentBigClassId = request.getParameter("equipmentBigClassId"); - String ratedPower = request.getParameter("ratedPower"); - String likeSea = request.getParameter("likeSea"); - if (!"".equals(equipmentBigClassId) && null != equipmentBigClassId) { - wherestr += " and equipment_big_class_id='" + equipmentBigClassId + "'"; - } - if (!"".equals(ratedPower) && null != ratedPower) { - wherestr += " and ratedPower='" + ratedPower + "'"; - } - if (!"".equals(likeSea) && null != likeSea) { - wherestr += " and equipmentName like '%" + likeSea + "%'"; - } - PageHelper.startPage(page, rows); - List list = this.equipmentCardPropService.selectAgeListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - net.sf.json.JSONArray json = net.sf.json.JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/valueEngineering/EquipmentModelController.java b/src/com/sipai/controller/valueEngineering/EquipmentModelController.java deleted file mode 100644 index 6d8da396..00000000 --- a/src/com/sipai/controller/valueEngineering/EquipmentModelController.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.sipai.controller.valueEngineering; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.entity.valueEngineering.EquipmentModel; -import com.sipai.service.scada.MPointService; -import com.sipai.service.valueEngineering.EquipmentModelService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping("/valueEngineering/equipmentModel") -public class EquipmentModelController { - @Resource - private EquipmentModelService equipmentModelService; - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/valueEngineering/equipmentModelList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("companyId"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - - PageHelper.startPage(page, rows); - List list = this.equipmentModelService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - net.sf.json.JSONArray json=net.sf.json.JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "/valueEngineering/equipmentModelAdd"; - } - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String userId = request.getParameter("id"); - EquipmentModel equipmentModel = this.equipmentModelService.selectById(userId); - model.addAttribute("equipmentModel", equipmentModel); - return "/valueEngineering/equipmentModelEdit"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String userId = request.getParameter("id"); - EquipmentModel equipmentModel = this.equipmentModelService.selectById(userId); - model.addAttribute("equipmentModel", equipmentModel); - return "/valueEngineering/equipmentModelView"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute EquipmentModel equipmentModel){ - User cu= (User)request.getSession().getAttribute("cu"); - equipmentModel.setId(CommUtil.getUUID()); - //若为启用,其他均为禁用 - if(CommString.Flag_Active.equals(equipmentModel.getStatus())){ - List list = this.equipmentModelService.selectListByWhere(" where status='"+CommString.Flag_Active+"'"); - for(EquipmentModel item:list){ - item.setStatus(CommString.Active_False); - int result = this.equipmentModelService.update(item); - } - } - int result = this.equipmentModelService.save(equipmentModel); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentModel.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute EquipmentModel equipmentModel){ - User cu= (User)request.getSession().getAttribute("cu"); - //若为启用,其他均为禁用 - if(CommString.Flag_Active.equals(equipmentModel.getStatus())){ - List list = this.equipmentModelService.selectListByWhere(" where status='"+CommString.Flag_Active+"'"); - for(EquipmentModel item:list){ - item.setStatus(CommString.Active_False); - int result = this.equipmentModelService.update(item); - } - } - int result = this.equipmentModelService.update(equipmentModel); - String resstr="{\"res\":\""+result+"\",\"id\":\""+equipmentModel.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 数学模型参数重置 - * @param request - * @param model - * @param equipmentModel - * @return - */ - @RequestMapping("/reset.do") - public String doreset(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - String flag = request.getParameter("flag"); - String value = request.getParameter("value"); - int result = this.equipmentModelService.reset(flag,value); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.equipmentModelService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.equipmentModelService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /*** - * 设备寿命模型获取启用的模型常量 - * @param request - * @param model - * @return - */ - @RequestMapping("/getActiveModal.do") - public ModelAndView getActiveModal(HttpServletRequest request,Model model) { - String wherestr="where status = '"+CommString.Active_True+"'"; - List list = this.equipmentModelService.selectListByWhere(wherestr); - - net.sf.json.JSONArray json=net.sf.json.JSONArray.fromObject(list); - - String result="{\"total\":"+list.size()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/valueEngineering/TodoController.java b/src/com/sipai/controller/valueEngineering/TodoController.java deleted file mode 100644 index d93ff3bf..00000000 --- a/src/com/sipai/controller/valueEngineering/TodoController.java +++ /dev/null @@ -1,510 +0,0 @@ -package com.sipai.controller.valueEngineering; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.jsp.jstl.sql.Result; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.DiskFileUpload; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.msg.MsgRecv; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.work.KPIPoint; -import com.sipai.service.command.EmergencyRecordsService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.msg.MsgRecvServiceImpl; -import com.sipai.service.msg.MsgService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.visual.GetValueService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.work.KPIPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/todo") -public class TodoController { - @Resource - private MsgService msgService; - @Resource - private UserService userService; - @Resource - private MsgRecvServiceImpl msgrecvService; - @Resource - private UnitService unitService; - @Resource - private EmergencyRecordsService emergencyRecordsService; - @Resource - private KPIPointService kPIPointService; - @Resource - private JspElementService jspElementService; - @Resource - private GetValueService getValueService; - @Resource - private CompanyService companyService; - - /**运行质量评价 - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/qualityEvaluation.do") - public String qualityEvaluation(HttpServletRequest request,Model model) throws IOException{ - String nowDate = CommUtil.subplus(CommUtil.nowDate(), "-24", "hour").substring(0, 10); - model.addAttribute("nowDate", nowDate); - return "todo/qualityEvaluation"; - } - @RequestMapping("/getValue4Group.do") - public String getValue4Group(HttpServletRequest request,Model model){ - long AllstartTime=System.currentTimeMillis(); //获取开始时间 - System.out.println("总开始时间:"+AllstartTime); - String bizid=""; - String jsp_id=""; - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - bizid=request.getParameter("bizid"); - } - String time=""; - if(request.getParameter("time")!=null && !request.getParameter("time").isEmpty()){ - time=request.getParameter("time"); - } - if(request.getParameter("jsp_id")!=null && !request.getParameter("jsp_id").isEmpty()){ - jsp_id=request.getParameter("jsp_id"); - } - - JSONArray jsonArray = new JSONArray(); - jsonArray = getValue4Group(bizid,time,jsp_id); - int res=0; - if(jsonArray!=null && jsonArray.size()>0){ - res=1; - } - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - //返回 区控中心(R)、厂区(F\B) - List companylistm = this.companyService.selectListByWhere("where type='B' and pid='"+bizid+"' order by morder"); - if(companylistm!=null && companylistm.size()>0){ - for(int i=0;i companylistr = this.companyService.selectListByWhere("where type='R' and pid='"+bizid+"' order by morder"); - if(companylistr!=null && companylistr.size()>0){ - for(int i=0;i companylistf = this.companyService.selectListByWhere("where type='F' and pid='"+bizid+"' order by morder"); - if(companylistf!=null && companylistf.size()>0){ - for(int i=0;i list = this.jspElementService.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i0){ - res=1; - } - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - //返回管理中心(M)、区控中心(R)、厂区(F) - List companylistm = this.companyService.selectListByWhere("where type='M' and pid='"+bizid+"' order by morder"); - if(companylistm!=null && companylistm.size()>0){ - for(int i=0;i companylistr = this.companyService.selectListByWhere("where type='R' and pid='"+bizid+"' order by morder"); - if(companylistr!=null && companylistr.size()>0){ - for(int i=0;i companylistf = this.companyService.selectListByWhere("where type='F' and pid='"+bizid+"' order by morder"); - if(companylistf!=null && companylistf.size()>0){ - for(int i=0;i list = this.jspElementService.selectListByWhere("where pid like '%"+jsp_id+"%' "+bizStr+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i0){ - res=1; - } - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - //返回管理中心(M)、区控中心(R)、厂区(F) - List companylistm = this.companyService.selectListByWhere("where type='M' and pid='"+bizid+"' order by morder"); - if(companylistm!=null && companylistm.size()>0){ - for(int i=0;i companylistr = this.companyService.selectListByWhere("where type='R' and pid='"+bizid+"' order by morder"); - if(companylistr!=null && companylistr.size()>0){ - for(int i=0;i companylistf = this.companyService.selectListByWhere("where type='F' and pid='"+bizid+"' order by morder"); - if(companylistf!=null && companylistf.size()>0){ - for(int i=0;i list = this.jspElementService.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i0){ - res=1; - } - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - //返回管理中心(M)、区控中心(R)、厂区(F) - List companylistm = this.companyService.selectListByWhere("where type='M' and pid='"+bizid+"' order by morder"); - if(companylistm!=null && companylistm.size()>0){ - for(int i=0;i companylistr = this.companyService.selectListByWhere("where type='R' and pid='"+bizid+"' order by morder"); - if(companylistr!=null && companylistr.size()>0){ - for(int i=0;i companylistf = this.companyService.selectListByWhere("where type='F' and pid='"+bizid+"' order by morder"); - if(companylistf!=null && companylistf.size()>0){ - for(int i=0;i list = this.jspElementService.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.safeAreaService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "visit/safeAreaAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.safeAreaService.deleteById(id); - if(result==0){ - this.safeAreaPositionService.deleteByWhere("where safeArea_id='"+id+"' "); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.safeAreaService.deleteByWhere("where id in ('"+ids+"')"); - if(result==0){ - this.safeAreaPositionService.deleteByWhere("where safeArea_id in ('"+ids+"') "); - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("safeArea") SafeArea safeArea){ - User cu= (User)request.getSession().getAttribute("cu"); - safeArea.setId(CommUtil.getUUID()); - safeArea.setInsuser(cu.getId()); - safeArea.setInsdt(CommUtil.nowDate()); - int result = this.safeAreaService.save(safeArea); - String resstr="{\"res\":\""+result+"\",\"id\":\""+safeArea.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - SafeArea safeArea = this.safeAreaService.selectById(id); - model.addAttribute("safeArea", safeArea); - return "visit/safeAreaView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - SafeArea safeArea = this.safeAreaService.selectById(id); - model.addAttribute("safeArea", safeArea); - return "visit/safeAreaEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("safeArea") SafeArea safeArea){ - User cu= (User)request.getSession().getAttribute("cu"); - safeArea.setInsuser(cu.getId()); - safeArea.setInsdt(CommUtil.nowDate()); - int result = this.safeAreaService.update(safeArea); - String resstr="{\"res\":\""+result+"\",\"id\":\""+safeArea.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 获取点数组 - * @param request - * @param model - * @return - */ - @RequestMapping("/getLngLats.do") - public ModelAndView getLngLats(HttpServletRequest request,Model model){ - String safeAreaId = request.getParameter("safeAreaId"); - List safeAreaPositionList = this.safeAreaPositionService.selectListByWhere("where safeArea_id='"+safeAreaId+"' order by morder"); - int result = safeAreaPositionList.size(); - JSONArray json=JSONArray.fromObject(safeAreaPositionList); - String resstr="{\"res\":\""+result+"\",\"lngLats\":"+json+"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - /** - * 保存点数组 - * @param request - * @param model - * @return - */ - @RequestMapping("/setLngLats.do") - public ModelAndView setLngLats(HttpServletRequest request,Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - String LngLats = request.getParameter("LngLats"); - String safeAreaId = request.getParameter("safeAreaId"); - String bizId = request.getParameter("bizId"); - String centerLng = request.getParameter("centerLng"); - String centerLat = request.getParameter("centerLat"); - SafeArea safeArea = this.safeAreaService.selectById(safeAreaId); - //更新地图中心点 - BigDecimal lngitude = new BigDecimal(centerLng); - BigDecimal latitude = new BigDecimal(centerLat); - safeArea.setLatitude(latitude); - safeArea.setLongitude(lngitude); - int result = this.safeAreaService.update(safeArea); - //更新配置区域坐标 - com.alibaba.fastjson.JSONArray LngLatArray = com.alibaba.fastjson.JSONArray.parseArray(LngLats); - SafeAreaPosition safeAreaPosition = null; - this.safeAreaPositionService.deleteByWhere("where safeArea_id='"+safeAreaId+"' "); - for (int i= 0;i list = this.visitApplyService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "visit/visitApplyAdd"; - } - @RequestMapping(value = "/delete.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除一条数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "数据ID",dataType = "String", paramType = "query", required = true), - }) - @ResponseBody - public ModelAndView delete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visitApplyService.deleteById(id); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "/deletes.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除多条数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "数据ID,以英文逗号分隔",dataType = "String", paramType = "query", required = true), - }) - @ResponseBody - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.visitApplyService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping(value = "/save.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "新增数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("visitApply") VisitApply visitApply){ - User cu= (User)request.getSession().getAttribute("cu"); - visitApply.setId(CommUtil.getUUID()); - visitApply.setInsuser(cu.getId()); - visitApply.setInsdt(CommUtil.nowDate()); - int result = this.visitApplyService.save(visitApply); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitApply.getId()+"\"}"; - model.addAttribute("result",resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitApply visitApply = this.visitApplyService.selectById(id); - model.addAttribute("visitApply", visitApply); - return "visit/visitApplyView"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitApply visitApply = this.visitApplyService.selectById(id); - model.addAttribute("visitApply", visitApply); - return "visit/visitApplyEdit"; - } - - @RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "修改数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("visitApply") VisitApply visitApply){ - User cu= (User)request.getSession().getAttribute("cu"); - visitApply.setInsuser(cu.getId()); - visitApply.setInsdt(CommUtil.nowDate()); - int result = this.visitApplyService.update(visitApply); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 启动审批流程 - * @param request - * @param model - * @param visitApply - * @return - */ - @RequestMapping(value = "/startProcess.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "启动流程", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute VisitApply visitApply) { - User cu = (User) request.getSession().getAttribute("cu"); - visitApply.setInsdt(CommUtil.nowDate()); - visitApply.setInsuser(cu.getId()); - int result = this.visitApplyService.doStartProcess(visitApply); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitApply.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - @RequestMapping("/showExecuteView.do") - public ModelAndView showExecuteView(HttpServletRequest request,Model model){ - String visitApplyId = request.getParameter("id"); - VisitApply visitApply = this.visitApplyService.selectById(visitApplyId); - User user = userService.getUserById(visitApply.getInsuser()); - request.setAttribute("visitApply", visitApply); - String recordUser = visitApply.getAuditMan(); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(visitApply.getInsdt(),visitApply.getInsuser(), - visitApply.getId(),visitApply.getProcessid(),visitApply.getUnitId(), - null,"提交了参观申请表至" + recordUser + "进行审批。",user,"流程发起"); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(visitApply.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - User cu =null; - for (String item : keys) { - switch (item) { - case BusinessUnit.VISIT_APPLY_HANDLE: - List list_apply = businessUnitHandleService.selectListByWhere("where businessid='"+visitApplyId+"' "); - for (BusinessUnitHandle businessUnitHandle : list_apply) { - cu = userService.getUserById(businessUnitHandle.getTargetusers()); - if(cu!=null){ - recordUser = cu.getCaption(); - }else{ - recordUser = ""; - } - businessUnitRecord = new BusinessUnitRecord(visitApply.getInsdt(),visitApply.getInsuser(), - visitApply.getId(),visitApply.getProcessid(),visitApply.getUnitId(), - businessUnitHandle.getTargetusers(),"参观申请表返回" + recordUser + "进行内容调整。",user,"内容调整"); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.VISIT_APPLY_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+visitApplyId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId=visitApply.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(visitApply.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - //显示在流程处理模态框右侧 - return new ModelAndView("visit/executeViewInModal"); - } - /** - * 显示任务审核 - * */ - @RequestMapping("/showAudit.do") - public ModelAndView showAudit(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String visitApplyId = request.getParameter("businessKey"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - VisitApply visitApply = this.visitApplyService.selectById(visitApplyId); - model.addAttribute("visitApply", visitApply); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return new ModelAndView("visit/visitApplyAudit"); - } - /** - * 流程流转-任务审核*/ - @RequestMapping(value = "/doAudit.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "流程流转-任务审核", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView doAudit(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.visitApplyService.doAuditProcess(businessUnitAudit); - //END - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - /** - * 显示任务处理-退回申请 - * */ - @RequestMapping("/showApply.do") - public ModelAndView showApply(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitDeptApplies = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitDeptApplies!= null && businessUnitDeptApplies.size()>0){ - businessUnitHandle = businessUnitDeptApplies.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - - VisitApply visitApply = this.visitApplyService.selectById(businessUnitHandle.getBusinessid()); - model.addAttribute("visitApply", visitApply); - List businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessId = '"+visitApply.getId()+"' order by insdt desc"); - String rejectReson =""; - if (businessUnitAudits!=null && businessUnitAudits.size()>0) { - rejectReson = businessUnitAudits.get(0).getAuditopinion(); - } - model.addAttribute("rejectReson", rejectReson); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return new ModelAndView("visit/visitApplyEditForApply"); - } - /** - *流程流转-提交申请*/ - @RequestMapping(value = "/doHandleApply.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "流程流转-提交申请", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView doHandleApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - User cu= (User)request.getSession().getAttribute("cu"); - String routeNum=request.getParameter("routeNum"); - int result=0; - businessUnitHandle.setStatus(VisitCommString.STATUS_VISIT_AUDIT); - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(); - businessUnitRecord.setId(businessUnitHandle.getId()); - businessUnitRecord.setInsdt(businessUnitHandle.getInsdt()); - businessUnitRecord.setInsuser(businessUnitHandle.getInsuser()); - businessUnitRecord.setBusinessId(businessUnitHandle.getBusinessid()); - businessUnitRecord.setProcessid(businessUnitHandle.getProcessid()); - businessUnitRecord.setTaskdefinitionkey(businessUnitHandle.getTaskdefinitionkey()); - businessUnitRecord.setTaskid(businessUnitHandle.getTaskid()); - businessUnitRecord.setType(BusinessUnit.UNIT_DEPT_APPLY); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String handleDetail = businessUnitHandle.getHandledetail(); - String record=""; - if (BusinessUnitHandle.Status_FINISH.equals(businessUnitHandle.getStatus())) { - record="提交了参观申请表"; - String solver =businessUnitHandle.getTargetusers(); - if (solver!=null && !solver.isEmpty()) { - List users= userService.selectListByWhere("where id in('"+solver.replace(",", "','")+"')"); - String userNames=""; - for (User user : users) { - if(!userNames.isEmpty()){ - userNames+="、"; - } - userNames+=user.getCaption(); - } - if (!userNames.isEmpty()) { - record+="至:"+userNames+"进行审批。"; - } - } - }else{ - record="任务正在执行中... "; - } - - businessUnitRecord.setRecord(record); - - User user =userService.getUserById(businessUnitHandle.getInsuser()); - businessUnitRecord.setUser(user); - - VisitApplyService visitApplyService = (VisitApplyService) SpringContextUtil.getBean("visitApplyService"); - VisitApply visitApply = visitApplyService.selectById(businessUnitHandle.getBusinessid()); - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(visitApply.getProcessdefid(), businessUnitHandle.getTaskdefinitionkey()); - businessUnitRecord.setTaskName(activityImpl.getProperties().get("name").toString()); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - String res = ("xls".equals(type)) ? visitApplyService.readXls(excelFile.getInputStream(),cu.getId()) : this.visitApplyService.readXlsx(excelFile.getInputStream(),cu.getId()); - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - /** - * 导入参观申请表 - * @param request - * @param model - * @return - */ - @RequestMapping("/importVisitApply.do") - public String doimport(HttpServletRequest request,Model model){ - return "visit/visitApplyImport"; - } - - /** - * 模板页面 - * @param request - * @param model - * @return - */ - @RequestMapping("/openExcelTemplate.do") - public String openExcelTemplate(HttpServletRequest request,Model model){ - return "visit/openExcelTemplate"; - } - /** - * 导出excel表 的 模板 - * @throws IOException - */ - @RequestMapping(value = "downloadExcelTemplate.do") - public ModelAndView downloadFileTemplate(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - int excelCount = Integer.valueOf(request.getParameter("excelCount")); - //导出文件到指定目录,兼容Linux - this.visitApplyService.downloadExcelTemplate(response, excelCount); - return null; - } - - /** APP/小程序获取列表,默认当天 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "APP/小程序查询参观申请列表", notes = "APP/小程序查询参观申请列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "visitTime", value = "参观时间,yyyy-MM-dd",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value="/getList4Mobile.do", method = RequestMethod.GET) - @ResponseBody - public Result getList4Mobile(HttpServletRequest request,Model model) { - String orderstr=" order by morder"; - String visitTime = request.getParameter("visitTime");//yyyy-MM-dd - if(visitTime==null || visitTime.isEmpty()){ - //默认当天 - visitTime = CommUtil.nowDate().substring(0, 10); - }else{ - visitTime = visitTime.trim().substring(0, 10); - } - String wherestr="where visit_time between '"+visitTime+" 00:00:00' and '"+visitTime+" 23:59:59' and state in ('"+VisitCommString.STATUS_VISIT_EXECUTE+"','"+VisitCommString.STATUS_VISIT_FINISH+"') "; - List list = this.visitApplyService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - String res = "{\"total\":"+list.size()+",\"rows\":"+json+"}"; - Result result = Result.success(res); - return result; - } -} diff --git a/src/com/sipai/controller/visit/VisitPositionController.java b/src/com/sipai/controller/visit/VisitPositionController.java deleted file mode 100644 index 9f77e2bd..00000000 --- a/src/com/sipai/controller/visit/VisitPositionController.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.sipai.controller.visit; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.*; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.visit.*; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/visit/visitPosition") -@Api(value = "/visit/visitPosition", tags = "外来人员参观-参观人员定位信息") -public class VisitPositionController { - @Resource - private VisitPositionService visitPositionService; - @Resource - private VisitVisitorsService visitVisitorsService; - @Resource - private VisitRegisterService visitRegisterService; - @Resource - private SafeAreaService safeAreaService; - @Resource - private SafeAreaPositionService safeAreaPositionService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/visit/visitPositionList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and visit_units like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.visitPositionService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "visit/visitPositionAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visitPositionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.visitPositionService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("visitPosition") VisitPosition visitPosition){ - User cu= (User)request.getSession().getAttribute("cu"); - visitPosition.setId(CommUtil.getUUID()); - visitPosition.setInsuser(cu.getId()); - visitPosition.setInsdt(CommUtil.nowDate()); - int result = this.visitPositionService.save(visitPosition); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitPosition.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitPosition visitPosition = this.visitPositionService.selectById(id); - model.addAttribute("visitPosition", visitPosition); - return "visit/visitPositionView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitPosition visitPosition = this.visitPositionService.selectById(id); - model.addAttribute("visitPosition", visitPosition); - return "visit/visitPositionEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("visitPosition") VisitPosition visitPosition){ - User cu= (User)request.getSession().getAttribute("cu"); - visitPosition.setInsuser(cu.getId()); - visitPosition.setInsdt(CommUtil.nowDate()); - int result = this.visitPositionService.update(visitPosition); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitPosition.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** APP/小程序定位数据上传接口 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "APP/小程序定位数据上传接口", notes = "APP/小程序定位数据上传接口", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "visitorsID", value = "人员表ID",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "latitude", value = "纬度",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "longitude", value = "经度",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "mobileType", value = "手持端类型:APP;WX",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "imei", value = "手持端imei",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value="/uploadPosition4Mobile.do", method = RequestMethod.POST) - @ResponseBody - public Result uploadPosition4Mobile(HttpServletRequest request,Model model, - @ModelAttribute("visitorsID") String visitorsID, - @ModelAttribute("latitude") String latitudeStr, - @ModelAttribute("longitude") String longitudeStr, - @ModelAttribute("mobileType") String mobileType) { - String imei = request.getParameter("imei"); - Result result = null; - if(visitorsID !=null && !visitorsID.isEmpty()){ - int state = 0; - // 被检测的经纬度点 - Map orderLocation = new HashMap(); - //纬度latitude - orderLocation.put("X", latitudeStr); - //经度longitude - orderLocation.put("Y", longitudeStr); - - VisitVisitors visitVisitors = this.visitVisitorsService.selectById(visitorsID); - //获取年龄,根据年龄选择安全区域 - int age = visitVisitors.getAge(); - String orderstr=" order by morder"; - //启用 - String wherestr="where id is not null "; - //18岁以上为成年人 - if(age>18){ - wherestr += " and type= '"+ VisitSafetyCommitment.ADULT+"' "; - }else{ - //18岁以下为青少年 - wherestr += " and type= '"+VisitSafetyCommitment.CHILDREN+"' "; - } - String safeAreaIds = ""; - //获取安全区域 - List safeAreaList = safeAreaService.selectListByWhere(wherestr+orderstr); - if (safeAreaList != null && safeAreaList.size()>0){ - for (SafeArea safeArea : safeAreaList){ - safeAreaIds += safeArea.getId()+","; - } - safeAreaIds = safeAreaIds.substring(0, safeAreaIds.length() - 1); - } - //判断当前位置是否在安全区域内 - boolean isIn = this.safeAreaPositionService.isInPolygon(orderLocation, safeAreaIds); - String msg = ""; - if (isIn){ - state=0; - }else{ - state=1; - msg = "警告!您已进入危险区域!"; - //根据申请表id,查找登记表中的讲解员id,发送msg - List visitRegisterList = this.visitRegisterService.selectListByWhere("where apply_id='"+visitVisitors.getApplyId()+"' "); - if(visitRegisterList!=null && visitRegisterList.size()>0){ - if(visitRegisterList.get(0).getCommentator()!=null - && !"".equals(visitRegisterList.get(0).getCommentator())){ - //发送信息 - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - String content = "警告!有人员进入危险区域!"; - msgService.insertMsgSend("system", content, visitRegisterList.get(0).getCommentator(), "emp01", "U"); - }; - } - } - VisitPosition visitPosition = new VisitPosition(); - visitPosition.setId(CommUtil.getUUID()); - visitPosition.setDttime(CommUtil.nowDate()); - visitPosition.setInsdt(CommUtil.nowDate()); - visitPosition.setInsuser(visitorsID); - visitPosition.setVisitorsId(visitorsID); - visitPosition.setState(state); - visitPosition.setType(mobileType); - BigDecimal latitude = new BigDecimal(latitudeStr); - visitPosition.setLatitude(latitude); - BigDecimal longitude = new BigDecimal(longitudeStr); - visitPosition.setLongitude(longitude); - visitPosition.setImei(imei); - this.visitPositionService.save(visitPosition); - String res = "{\"state\":"+state+",\"msg\":\""+msg+"\"}"; - result = Result.success(res); - }else{ - result = Result.failed("人员ID不能为空"); - } - return result; - } - -} diff --git a/src/com/sipai/controller/visit/VisitRegisterController.java b/src/com/sipai/controller/visit/VisitRegisterController.java deleted file mode 100644 index af864f27..00000000 --- a/src/com/sipai/controller/visit/VisitRegisterController.java +++ /dev/null @@ -1,565 +0,0 @@ -package com.sipai.controller.visit; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.VisitCommString; -import com.sipai.entity.visit.VisitRegister; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UserService; -import com.sipai.service.visit.VisitRegisterService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/visit/visitRegister") -@Api(value = "/visit/visitRegister", tags = "外来人员参观-参观登记信息") -public class VisitRegisterController { - @Resource - private VisitRegisterService visitRegisterService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public ModelAndView showList(HttpServletRequest request,Model model) { - return new ModelAndView("/visit/visitRegisterList"); - } - - /** 获取列表 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "查询参观登记列表", notes = "查询参观登记列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "startTime", value = "筛选开始时间(填表时间)",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "endTime", value = "筛选结束时间(填表时间)",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "search_name", value = "搜索公司名称",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "state", value = "状态",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "sort", value = "排序字段", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "order", value = "排序方式", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "page", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "rows", value = "每页条数", dataType = "int", paramType = "query", required = true), - }) - @RequestMapping(value="/getList.do", method = RequestMethod.GET) - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and ( visit_units like '%"+request.getParameter("search_name")+"%'" - + " or leader_name like '%"+request.getParameter("search_name")+"%')) "; - } - if(request.getParameter("startTime")!=null && !request.getParameter("startTime").isEmpty()){ - wherestr += " and insdt >= '"+request.getParameter("startTime")+"' "; - } - if(request.getParameter("endTime")!=null && !request.getParameter("endTime").isEmpty()){ - wherestr += " and insdt <= '"+request.getParameter("endTime")+"' "; - } - if(request.getParameter("state")!=null && !request.getParameter("state").isEmpty()){ - wherestr += " and state = "+request.getParameter("state")+" "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and unit_id = '"+request.getParameter("search_code")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.visitRegisterService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public ModelAndView doadd(HttpServletRequest request,Model model){ - model.addAttribute("insdt",CommUtil.nowDate()); - return new ModelAndView("visit/visitRegisterAdd"); - } - - @RequestMapping(value = "/delete.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除一条数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "数据ID",dataType = "String", paramType = "query", required = true), - }) - @ResponseBody - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visitRegisterService.deleteById(id); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - @RequestMapping(value = "/deletes.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除多条数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "数据ID,以英文逗号分隔",dataType = "String", paramType = "query", required = true), - }) - @ResponseBody - public ModelAndView dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.visitRegisterService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "/save.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "新增数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("visitRegister") VisitRegister visitRegister){ - User cu= (User)request.getSession().getAttribute("cu"); - visitRegister.setId(CommUtil.getUUID()); - visitRegister.setInsuser(cu.getId()); - int result = this.visitRegisterService.save(visitRegister); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitRegister.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - @RequestMapping("/view.do") - public ModelAndView doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitRegister visitRegister = this.visitRegisterService.selectById(id); - model.addAttribute("visitRegister", visitRegister); - return new ModelAndView("visit/visitRegisterView"); - } - - @RequestMapping("/edit.do") - public ModelAndView doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitRegister visitRegister = this.visitRegisterService.selectById(id); - model.addAttribute("visitRegister", visitRegister); - return new ModelAndView("visit/visitRegisterEdit"); - } - - @RequestMapping(value = "/update.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "修改数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("visitRegister") VisitRegister visitRegister){ - User cu= (User)request.getSession().getAttribute("cu"); - visitRegister.setInsuser(cu.getId()); - int result = this.visitRegisterService.update(visitRegister); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitRegister.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - @RequestMapping(value = "/visitEnd.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "结束参观", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView visitEnd(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - User cu= (User)request.getSession().getAttribute("cu"); - VisitRegister visitRegister = this.visitRegisterService.selectById(id); - visitRegister.setSubmissionTime(CommUtil.nowDate()); - visitRegister.setState(VisitCommString.STATUS_VISIT_FINISH); - int result = this.visitRegisterService.update(visitRegister); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitRegister.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - - /** - * 启动审批流程 - * @param request - * @param model - * @param visitRegister - * @return - */ - @RequestMapping(value = "/startProcess.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "启动流程", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView dostartProcess(HttpServletRequest request,Model model, - @ModelAttribute VisitRegister visitRegister) { - User cu = (User) request.getSession().getAttribute("cu"); - visitRegister.setInsdt(CommUtil.nowDate()); - visitRegister.setInsuser(cu.getId()); - int result = this.visitRegisterService.doStartProcess(visitRegister); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitRegister.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - @RequestMapping("/showExecuteView.do") - public ModelAndView showExecuteView(HttpServletRequest request,Model model){ - String visitRegisterId = request.getParameter("id"); - VisitRegister visitRegister = this.visitRegisterService.selectById(visitRegisterId); - User user = userService.getUserById(visitRegister.getInsuser()); - request.setAttribute("visitRegister", visitRegister); - String recordUser = visitRegister.getAuditMan(); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(visitRegister.getInsdt(),visitRegister.getInsuser(), - visitRegister.getId(),visitRegister.getProcessid(),visitRegister.getUnitId(), - null,"提交了参观登记表至" + recordUser + "进行审批。",user,"流程发起"); - businessUnitRecords.add(businessUnitRecord); - - List workTasks=workflowProcessDefinitionService.getAllPDTask(visitRegister.getProcessdefid(), "desc"); - List keys=new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys=new ArrayList<>(); - keys.addAll(set); - User cu =null; - for (String item : keys) { - switch (item) { - case BusinessUnit.VISIT_REGISTER_HANDLE: - List list_apply = businessUnitHandleService.selectListByWhere("where businessid='"+visitRegisterId+"' "); - for (BusinessUnitHandle businessUnitHandle : list_apply) { - cu = userService.getUserById(businessUnitHandle.getTargetusers()); - if(cu!=null){ - recordUser = cu.getCaption(); - }else{ - recordUser = ""; - } - businessUnitRecord = new BusinessUnitRecord(visitRegister.getInsdt(),visitRegister.getInsuser(), - visitRegister.getId(),visitRegister.getProcessid(),visitRegister.getUnitId(), - businessUnitHandle.getTargetusers(),"参观登记表返回" + recordUser + "进行内容调整。",user,"内容调整"); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.VISIT_REGISTER_AUDIT: - List list_audit = businessUnitAuditService.selectListByWhere("where businessid='"+visitRegisterId+"' "); - for (BusinessUnitAudit businessUnitAudit : list_audit) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId=visitRegister.getProcessid(); - List list=this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee()==null || task.getClaimTime()==null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try{ - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - }catch(Exception e){ - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray =JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords",jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num =runtimeService.createProcessInstanceQuery().processInstanceId(visitRegister.getProcessid()).count(); - if(num>0){ - model.addAttribute("finishFlag", false); - }else{ - model.addAttribute("finishFlag", true); - } - //显示在流程处理模态框右侧 - return new ModelAndView("visit/executeViewInModal"); - } - /** - * 显示任务审核 - * */ - @RequestMapping("/showAudit.do") - public ModelAndView showAudit(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String visitRegisterId = request.getParameter("businessKey"); - String unitId = request.getParameter("unitId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - VisitRegister visitRegister = this.visitRegisterService.selectById(visitRegisterId); - model.addAttribute("visitRegister", visitRegister); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - businessUnitAudit.setUnitid(unitId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return new ModelAndView("visit/visitRegisterAudit"); - } - /** - * 流程流转-任务审核*/ - @RequestMapping(value = "/doAudit.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "流程流转-任务审核", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView doAudit(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - if(businessUnitAudit.getPassstatus()){ - //审核通过,配置讲解人 - String visitRegisterid = request.getParameter("visitRegisterid"); - String commentator = request.getParameter("commentator"); - VisitRegister visitRegister = this.visitRegisterService.selectById(visitRegisterid); - visitRegister.setCommentator(commentator); - this.visitRegisterService.update(visitRegister); - } - result =this.visitRegisterService.doAuditProcess(businessUnitAudit); - //END - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } - /** - * 显示任务处理-退回申请 - * */ - @RequestMapping("/showRegister.do") - public ModelAndView showRegister(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitDeptApplies = this.businessUnitHandleService.selectListByWhere("where processid='"+processInstanceId+"' and taskId='"+taskId+"'"); - if(businessUnitDeptApplies!= null && businessUnitDeptApplies.size()>0){ - businessUnitHandle = businessUnitDeptApplies.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - }else{ - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - } - String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - } - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - - VisitRegister visitRegister = this.visitRegisterService.selectById(businessUnitHandle.getBusinessid()); - model.addAttribute("visitRegister", visitRegister); - List businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessId = '"+visitRegister.getId()+"' order by insdt desc"); - String rejectReson =""; - if (businessUnitAudits!=null && businessUnitAudits.size()>0) { - rejectReson = businessUnitAudits.get(0).getAuditopinion(); - } - model.addAttribute("rejectReson", rejectReson); - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - ActivityImpl activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS); - if ("userTask".equals(activityImpl.getProperties().get("type"))) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return new ModelAndView("visit/visitRegisterEditForApply"); - } - /** - *流程流转-提交申请*/ - @RequestMapping(value = "/doHandleApply.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "流程流转-提交登记", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - @ResponseBody - public ModelAndView doHandleApply(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - User cu= (User)request.getSession().getAttribute("cu"); - String routeNum=request.getParameter("routeNum"); - int result=0; - businessUnitHandle.setStatus(VisitCommString.STATUS_VISIT_AUDIT); - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables =ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(); - businessUnitRecord.setId(businessUnitHandle.getId()); - businessUnitRecord.setInsdt(businessUnitHandle.getInsdt()); - businessUnitRecord.setInsuser(businessUnitHandle.getInsuser()); - businessUnitRecord.setBusinessId(businessUnitHandle.getBusinessid()); - businessUnitRecord.setProcessid(businessUnitHandle.getProcessid()); - businessUnitRecord.setTaskdefinitionkey(businessUnitHandle.getTaskdefinitionkey()); - businessUnitRecord.setTaskid(businessUnitHandle.getTaskid()); - businessUnitRecord.setType(BusinessUnit.UNIT_DEPT_APPLY); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String handleDetail = businessUnitHandle.getHandledetail(); - String record=""; - if (BusinessUnitHandle.Status_FINISH.equals(businessUnitHandle.getStatus())) { - record="提交了参观登记表"; - String solver =businessUnitHandle.getTargetusers(); - if (solver!=null && !solver.isEmpty()) { - List users= userService.selectListByWhere("where id in('"+solver.replace(",", "','")+"')"); - String userNames=""; - for (User user : users) { - if(!userNames.isEmpty()){ - userNames+="、"; - } - userNames+=user.getCaption(); - } - if (!userNames.isEmpty()) { - record+="至:"+userNames+"进行审批。"; - } - } - }else{ - record="任务正在执行中... "; - } - - businessUnitRecord.setRecord(record); - - User user =userService.getUserById(businessUnitHandle.getInsuser()); - businessUnitRecord.setUser(user); - - VisitRegisterService visitRegisterService = (VisitRegisterService) SpringContextUtil.getBean("visitRegisterService"); - VisitRegister visitRegister = visitRegisterService.selectById(businessUnitHandle.getBusinessid()); - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(visitRegister.getProcessdefid(), businessUnitHandle.getTaskdefinitionkey()); - businessUnitRecord.setTaskName(activityImpl.getProperties().get("name").toString()); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/visit/VisitSafetyCommitmentController.java b/src/com/sipai/controller/visit/VisitSafetyCommitmentController.java deleted file mode 100644 index dc10fe3b..00000000 --- a/src/com/sipai/controller/visit/VisitSafetyCommitmentController.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.controller.visit; - -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.VisitSafetyCommitment; -import com.sipai.entity.visit.VisitVisitors; -import com.sipai.service.visit.VisitSafetyCommitmentService; -import com.sipai.service.visit.VisitVisitorsService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/visit/visitSafetyCommitment") -@Api(value = "/visit/visitSafetyCommitment", tags = "外来人员参观-参观安全承诺书-内容库") -public class VisitSafetyCommitmentController { - @Resource - private VisitSafetyCommitmentService visitSafetyCommitmentService; - @Resource - private VisitVisitorsService visitVisitorsService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/visit/visitSafetyCommitmentList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and visit_units like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ - wherestr += " and unit_id = '"+request.getParameter("unitId")+"' "; - } - - if(request.getParameter("edition")!=null && !request.getParameter("edition").isEmpty()){ - wherestr += " and edition = '"+request.getParameter("edition")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.visitSafetyCommitmentService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "visit/visitSafetyCommitmentAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visitSafetyCommitmentService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.visitSafetyCommitmentService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("visitSafetyCommitment") VisitSafetyCommitment visitSafetyCommitment){ - User cu= (User)request.getSession().getAttribute("cu"); - visitSafetyCommitment.setId(CommUtil.getUUID()); - visitSafetyCommitment.setInsuser(cu.getId()); - visitSafetyCommitment.setInsdt(CommUtil.nowDate()); - int result = this.visitSafetyCommitmentService.save(visitSafetyCommitment); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitSafetyCommitment.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitSafetyCommitment visitSafetyCommitment = this.visitSafetyCommitmentService.selectById(id); - model.addAttribute("visitSafetyCommitment", visitSafetyCommitment); - return "visit/visitSafetyCommitmentView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitSafetyCommitment visitSafetyCommitment = this.visitSafetyCommitmentService.selectById(id); - model.addAttribute("visitSafetyCommitment", visitSafetyCommitment); - return "visit/visitSafetyCommitmentEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("visitSafetyCommitment") VisitSafetyCommitment visitSafetyCommitment){ - User cu= (User)request.getSession().getAttribute("cu"); - visitSafetyCommitment.setInsuser(cu.getId()); - visitSafetyCommitment.setInsdt(CommUtil.nowDate()); - int result = this.visitSafetyCommitmentService.update(visitSafetyCommitment); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitSafetyCommitment.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** APP/小程序获取安全承诺书 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "APP/小程序获取安全承诺书", notes = "APP/小程序获取安全承诺书", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "visitVisitorsId", value = "参观人员表ID",dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value="/getList4Mobile.do", method = RequestMethod.GET) - @ResponseBody - public Result getList4Mobile(HttpServletRequest request,Model model) { - String visitVisitorsId = request.getParameter("visitVisitorsId"); - VisitVisitors visitVisitors = visitVisitorsService.selectById(visitVisitorsId); - //获取年龄,根据年龄分配承诺书 - int age = visitVisitors.getAge(); - String orderstr=" order by morder"; - String wherestr="where state=1 ";//启用 - //18岁以上为成年人 - if(age>18){ - wherestr += " and edition= '"+VisitSafetyCommitment.ADULT+"' "; - }else{ - //18岁以下为青少年 - wherestr += " and edition= '"+VisitSafetyCommitment.CHILDREN+"' "; - } - List list = this.visitSafetyCommitmentService.selectListByWhere(wherestr+orderstr); - VisitSafetyCommitment visitSafetyCommitment = null; - Result result = Result.failed("获取失败。"); - if(list!=null && list.size()>0){ - visitSafetyCommitment = list.get(0); - String json = JSONObject.toJSONString(visitSafetyCommitment); - result = Result.success(json); - } - return result; - } -} diff --git a/src/com/sipai/controller/visit/VisitSafetyCommitmentRecordController.java b/src/com/sipai/controller/visit/VisitSafetyCommitmentRecordController.java deleted file mode 100644 index 1f940f9a..00000000 --- a/src/com/sipai/controller/visit/VisitSafetyCommitmentRecordController.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.controller.visit; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.VisitSafetyCommitment; -import com.sipai.entity.visit.VisitSafetyCommitmentRecord; -import com.sipai.service.visit.VisitSafetyCommitmentRecordService; -import com.sipai.service.visit.VisitSafetyCommitmentService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/visit/visitSafetyCommitmentRecord") -@Api(value = "/visit/visitSafetyCommitmentRecord", tags = "外来人员参观-参观安全承诺书-使用记录") -public class VisitSafetyCommitmentRecordController { - @Resource - private VisitSafetyCommitmentRecordService visitSafetyCommitmentRecordService; - @Resource - private VisitSafetyCommitmentService visitSafetyCommitmentService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/visit/visitSafetyCommitmentRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and visit_units like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.visitSafetyCommitmentRecordService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "visit/visitSafetyCommitmentRecordAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visitSafetyCommitmentRecordService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.visitSafetyCommitmentRecordService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("visitSafetyCommitmentRecord") VisitSafetyCommitmentRecord visitSafetyCommitmentRecord){ - User cu= (User)request.getSession().getAttribute("cu"); - visitSafetyCommitmentRecord.setId(CommUtil.getUUID()); - visitSafetyCommitmentRecord.setInsuser(cu.getId()); - visitSafetyCommitmentRecord.setInsdt(CommUtil.nowDate()); - int result = this.visitSafetyCommitmentRecordService.save(visitSafetyCommitmentRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitSafetyCommitmentRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitSafetyCommitmentRecord visitSafetyCommitmentRecord = this.visitSafetyCommitmentRecordService.selectById(id); - model.addAttribute("visitSafetyCommitmentRecord", visitSafetyCommitmentRecord); - return "visit/visitSafetyCommitmentRecordView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitSafetyCommitmentRecord visitSafetyCommitmentRecord = this.visitSafetyCommitmentRecordService.selectById(id); - model.addAttribute("visitSafetyCommitmentRecord", visitSafetyCommitmentRecord); - return "visit/visitSafetyCommitmentRecordEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("visitSafetyCommitmentRecord") VisitSafetyCommitmentRecord visitSafetyCommitmentRecord){ - User cu= (User)request.getSession().getAttribute("cu"); - visitSafetyCommitmentRecord.setInsuser(cu.getId()); - visitSafetyCommitmentRecord.setInsdt(CommUtil.nowDate()); - int result = this.visitSafetyCommitmentRecordService.update(visitSafetyCommitmentRecord); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitSafetyCommitmentRecord.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** APP/小程序安全承诺书确认 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "APP/小程序安全承诺书确认", notes = "APP/小程序安全承诺书确认", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "visitSafetyCommitmentId", value = "安全承诺书ID",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "visitVisitorsId", value = "参观人员表ID",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "signImgPath", value = "签字图片路径",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value="/confirm4Mobile.do", method = RequestMethod.POST) - @ResponseBody - public Result confirm4Mobile(HttpServletRequest request,Model model) { - String visitSafetyCommitmentId = request.getParameter("visitSafetyCommitmentId"); - String visitVisitorsId = request.getParameter("visitVisitorsId"); - String signImgPath = request.getParameter("signImgPath"); - VisitSafetyCommitment visitSafetyCommitment = this.visitSafetyCommitmentService.selectById(visitSafetyCommitmentId); - Result result = null; - if(visitSafetyCommitment!=null){ - VisitSafetyCommitmentRecord visitSafetyCommitmentRecord = new VisitSafetyCommitmentRecord(); - visitSafetyCommitmentRecord.setId(CommUtil.getUUID()); - visitSafetyCommitmentRecord.setInsuser(visitVisitorsId); - visitSafetyCommitmentRecord.setInsdt(CommUtil.nowDate()); - visitSafetyCommitmentRecord.setPromisor(visitVisitorsId); - visitSafetyCommitmentRecord.setCommitmentTime(CommUtil.nowDate()); - visitSafetyCommitmentRecord.setContent(visitSafetyCommitment.getContent()); - visitSafetyCommitmentRecord.setState(1);//已确认 - visitSafetyCommitmentRecord.setSignImgPath(signImgPath); - int res = this.visitSafetyCommitmentRecordService.save(visitSafetyCommitmentRecord); - if(res>0){ - result = Result.success(res); - }else{ - result = Result.failed("提交失败。"); - } - }else{ - result = Result.failed("提交失败,承诺书异常。"); - } - return result; - } -} diff --git a/src/com/sipai/controller/visit/VisitVisitorsController.java b/src/com/sipai/controller/visit/VisitVisitorsController.java deleted file mode 100644 index 32fb894d..00000000 --- a/src/com/sipai/controller/visit/VisitVisitorsController.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.sipai.controller.visit; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.VisitVisitors; -import com.sipai.service.visit.VisitVisitorsService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/visit/visitVisitors") -@Api(value = "/visit/visitVisitors", tags = "参观申请人员信息") -public class VisitVisitorsController { - @Resource - private VisitVisitorsService visitVisitorsService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/visit/visitVisitorsList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and full_name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("applyID")!=null && !request.getParameter("applyID").isEmpty()){ - wherestr += " and apply_id = '"+request.getParameter("applyID")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.visitVisitorsService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String applyId = request.getParameter("applyId"); - model.addAttribute("applyId",applyId); - List list = this.visitVisitorsService.selectListByWhere("where apply_id='"+applyId+"' order by morder desc"); - int morder =1; - if(list!=null && list.size()>0){ - morder = list.size()+1; - } - model.addAttribute("morder",morder); - return "visit/visitVisitorsAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visitVisitorsService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.visitVisitorsService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("visitVisitors") VisitVisitors visitVisitors){ - User cu= (User)request.getSession().getAttribute("cu"); - visitVisitors.setId(CommUtil.getUUID()); - visitVisitors.setInsuser(cu.getId()); - visitVisitors.setInsdt(CommUtil.nowDate()); - int result = this.visitVisitorsService.save(visitVisitors); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitVisitors.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitVisitors visitVisitors = this.visitVisitorsService.selectById(id); - model.addAttribute("visitVisitors", visitVisitors); - return "visit/visitVisitorsView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisitVisitors visitVisitors = this.visitVisitorsService.selectById(id); - model.addAttribute("visitVisitors", visitVisitors); - return "visit/visitVisitorsEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("visitVisitors") VisitVisitors visitVisitors){ - User cu= (User)request.getSession().getAttribute("cu"); - visitVisitors.setInsuser(cu.getId()); - visitVisitors.setInsdt(CommUtil.nowDate()); - int result = this.visitVisitorsService.update(visitVisitors); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visitVisitors.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** APP/小程序获取列表,默认当天 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "查询参观申请人员列表", notes = "查询参观申请人员列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "applyId", value = "参观申请信息ID",dataType = "String", paramType = "query", required = true), - }) - @RequestMapping(value="/getList4Mobile.do", method = RequestMethod.GET) - @ResponseBody - public Result getList4Mobile(HttpServletRequest request,Model model) { - String orderstr=" order by morder"; - String applyId = request.getParameter("applyId"); - String wherestr="where apply_id = '"+applyId+"' and state=0 "; - List list = this.visitVisitorsService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - String res = "{\"total\":"+list.size()+",\"rows\":"+json+"}"; - Result result = Result.success(res); - return result; - } - /** APP/小程序个人参观登记确认 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "个人参观登记确认", notes = "个人参观登记确认", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "visitVisitorsId", value = "人员表ID",dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "telephone", value = "电话号码",dataType = "String", paramType = "query", required = false), - }) - @RequestMapping(value="/confirm4Mobile.do", method = RequestMethod.POST) - @ResponseBody - public Result confirm4Mobile(HttpServletRequest request,Model model) { - String visitVisitorsId = request.getParameter("visitVisitorsId"); - String telephone = request.getParameter("telephone"); - VisitVisitors visitVisitors = this.visitVisitorsService.selectById(visitVisitorsId); - Result result = null; - if(visitVisitors!=null){ - if(visitVisitors.getState()!=null && visitVisitors.getState()<1){ - visitVisitors.setState(1); - visitVisitors.setContactInformation(telephone); - int res = this.visitVisitorsService.update(visitVisitors); - result = Result.success(res); - }else{ - result = Result.failed("提交失败,人员信息已使用。"); - } - }else{ - result = Result.failed("提交失败,人员信息无效。"); - } - return result; - } -} diff --git a/src/com/sipai/controller/visual/ChangGangController.java b/src/com/sipai/controller/visual/ChangGangController.java deleted file mode 100644 index 1b032570..00000000 --- a/src/com/sipai/controller/visual/ChangGangController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.controller.visual; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.user.Company; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.JspElementService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * 长岗工艺仿真 - * - * @author NJP - * 2024-03-25 - */ -@Controller -@RequestMapping("/changGang") -public class ChangGangController { - - @Resource - private JspElementService jspElementService; - @Resource - private UnitService unitService; - @Resource - private MPointHistoryService mPointHistoryService; - //工艺仿真 - @RequestMapping("/processSimulation.do") - public ModelAndView processSimulation(HttpServletRequest request, Model model) { - return new ModelAndView("visual/cg_process_simulation"); - } - - @RequestMapping("/getCgData.do") - public ModelAndView getCgData(HttpServletRequest request, Model model) { - JSONArray result = new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - if (bizid == null || bizid.isEmpty()) { - List companyList = this.unitService.getCompaniesByWhere("where active='1' order by morder"); - if (companyList != null && companyList.size() > 0) { - bizid = companyList.get(0).getId(); - } - } - result = this.jspElementService.getValue(bizid, time, jsp_id); - model.addAttribute("result", "{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/getCgData4ES.do") - public ModelAndView getCgData4ES(HttpServletRequest request, Model model) { - JSONArray result = new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - if (bizid == null || bizid.isEmpty()) { - List companyList = this.unitService.getCompaniesByWhere("where active='1' order by morder"); - if (companyList != null && companyList.size() > 0) { - bizid = companyList.get(0).getId(); - } - } - result = this.jspElementService.getValue4ES(bizid, time, jsp_id); - model.addAttribute("result", "{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/visual/CityHallShowController.java b/src/com/sipai/controller/visual/CityHallShowController.java deleted file mode 100644 index 9cbb2ce4..00000000 --- a/src/com/sipai/controller/visual/CityHallShowController.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.controller.visual; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.teacher.TeacherFile; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/cityHallShow") -public class CityHallShowController { - - private String BaseFolderName = "UploadFile"; - - @Resource - CommonFileService commonFileService; - - @RequestMapping("/cityHallShow.do") - public ModelAndView cityHallShow(HttpServletRequest request,Model model) { - return new ModelAndView("visual/cityHallShow"); - } - @RequestMapping("/cityHallFileList.do") - public ModelAndView cityHallFileList(HttpServletRequest request,Model model) { - return new ModelAndView("visual/cityHallFileList"); - } - /** - * 获取文件json - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getFileList.do") - public ModelAndView getInputFileList(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "' order by insdt desc"); - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - @RequestMapping(value = "fileinput.do") - public ModelAndView fileinput(HttpServletRequest request, - HttpServletResponse response,Model model,@RequestParam(value="masterId") String masterId, - @RequestParam(value="tbName") String tbName,@RequestParam(value="nameSpace") String nameSpace) { - model.addAttribute("tbName",tbName); - model.addAttribute("masterId",masterId); - model.addAttribute("nameSpace",nameSpace); - return new ModelAndView("visual/cityHallfileAdd"); - } - - @RequestMapping(value = "inputFile.do") - public ModelAndView inputFile(HttpServletRequest request,HttpServletResponse response,Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathSever.replaceAll(contextPath, BaseFolderName + "/" + nameSpace + "/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date()) + fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setSize((int) item.getSize()); - int res = commonFileService.insertByTable(tbName, commonFile); - - if (res == 1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/visual/DataTypeController.java b/src/com/sipai/controller/visual/DataTypeController.java deleted file mode 100644 index 6272a214..00000000 --- a/src/com/sipai/controller/visual/DataTypeController.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.sipai.controller.visual; - - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - - - - - - - - - - - - - - - - - - - - - - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.InteractionMethod; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.Layout; -import com.sipai.entity.visual.PlanInteraction; -import com.sipai.entity.visual.VisualJsp; -import com.sipai.service.visual.DataTypeService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.visual.VisualJspService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/datatype") -public class DataTypeController { - @Resource - private DataTypeService dataTypeService; - - @RequestMapping("/showDataTypeList.do") - public String showDataTypeList(HttpServletRequest request,Model model){ - return "visual/dataTypeList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " data_type_name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and id in('"+ids.replace(",", "','")+"')"; - } - PageHelper.startPage(page, rows); - List list = this.dataTypeService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 打开新增数据类型(产线) - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - return "visual/dataTypeAdd"; - } - - /** - * 打开编辑数据类型(产线) - * @param request - * @param model - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - DataType dataType = this.dataTypeService.selectById(id); - model.addAttribute("dataType", dataType); - return "visual/dataTypeEdit"; - } - - /** - * 保存数据类型(产线) - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("DataType") DataType DataType){ - User cu= (User)request.getSession().getAttribute("cu"); - DataType.setId(CommUtil.getUUID()); - DataType.setInsuser(cu.getId()); - DataType.setInsdt(CommUtil.nowDate()); - int result = this.dataTypeService.save(DataType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+DataType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除数据类型(产线) - * @param request - * @param model - * @param id 交互id - * @return - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.dataTypeService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新数据类型(产线) - * @param request - * @param model - * @param visualJsp - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute DataType DataType){ - User cu= (User)request.getSession().getAttribute("cu"); - DataType.setInsuser(cu.getId()); - DataType.setInsdt(CommUtil.nowDate()); - int result = this.dataTypeService.update(DataType); - String resstr="{\"res\":\""+result+"\",\"id\":\""+DataType.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 数据类型(产线)选择 - * @param request - * @param model - * @return - */ - @RequestMapping("/showDataTypeForSelect.do") - public String showDataTypeForSelect(HttpServletRequest request,Model model){ - return "visual/dataType4Select"; - } - - /** - * 获取所有交互打开页面枚举 - * - * @param request - * @param model - * @param patrolModel - * @return - */ - @RequestMapping("/getDataType4Select2.do") - public String getAllDataType(HttpServletRequest request, Model model, - @ModelAttribute PlanInteraction planInteraction) { - List dataTypeList = this.dataTypeService.selectListByWhere("order by morder"); - JSONArray jsonArray = new JSONArray(); - for(int i=0;i companyList = this.unitService.getCompaniesByWhere("where active='1' order by morder"); - if (companyList != null && companyList.size() > 0) { - bizid = companyList.get(0).getId(); - } - } - result = this.jspElementService.getValue(bizid, time, jsp_id); - model.addAttribute("result", "{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/getEvaluateData4ES.do") - public ModelAndView getEvaluateData4ES(HttpServletRequest request, Model model) { - JSONArray result = new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - if (bizid == null || bizid.isEmpty()) { - List companyList = this.unitService.getCompaniesByWhere("where active='1' order by morder"); - if (companyList != null && companyList.size() > 0) { - bizid = companyList.get(0).getId(); - } - } - result = this.jspElementService.getValue4ES(bizid, time, jsp_id); - model.addAttribute("result", "{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - - /* - * 水质模型 - * */ - @RequestMapping("/waterQualityModel.do") - public ModelAndView waterQualityModel(HttpServletRequest request, Model model) { - return new ModelAndView("visual/waterQualityModel"); - } - - /* - * 地磅数据 - * */ - @RequestMapping("/wagonBalance.do") - public ModelAndView wagonBalance(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - String filepathServer = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathServer + "WEB-INF/classes/wagonBalance.json"; - JSONObject wagonBalancejson = readJsonFile(filepath); - String code = wagonBalancejson.getString("code"); - if ("1".equals(code)) { - String bizId = wagonBalancejson.getString("bizId"); - String yesterdayCode = wagonBalancejson.getString("yesterdayCode"); - String wherestr = " order by measuredt desc "; - BigDecimal yesterday = new BigDecimal("0"); - if (!yesterdayCode.isEmpty()) { - List yesterdayHistorys = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, " top 1 ", "TB_MP_" + yesterdayCode, wherestr); - if (yesterdayHistorys != null && yesterdayHistorys.size() > 0) { - //昨日处理量 - yesterday = yesterdayHistorys.get(0).getParmvalue(); - } - } - //昨日处理量 - wagonBalancejson.put("yesterdayValue", yesterday.toString()); - JSONArray goodsArray = wagonBalancejson.getJSONArray("goods"); - JSONArray goodsArrayNew = new JSONArray(); - for (int i = 0; i < goodsArray.size(); i++) { - JSONObject obj = goodsArray.getJSONObject(i); - String drugConsumptionCode = obj.getString("drugConsumptionCode"); - BigDecimal drugConsumptionValue = new BigDecimal("0"); - if (!drugConsumptionCode.isEmpty()) { - List drugConsumption = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, " top 1 ", "TB_MP_" + drugConsumptionCode, wherestr); - if (drugConsumption != null && drugConsumption.size() > 0) { - //昨日处理量 - drugConsumptionValue = drugConsumption.get(0).getParmvalue(); - } - } - obj.put("drugConsumptionValue", drugConsumptionValue); - - String currentCode = obj.getString("currentCode"); - BigDecimal currentValue = new BigDecimal("0"); - if (!currentCode.isEmpty()) { - List current = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, " top 1 ", "TB_MP_" + currentCode, wherestr); - if (current != null && current.size() > 0) { - //昨日处理量 - currentValue = current.get(0).getParmvalue(); - } - } - obj.put("currentValue", currentValue); - goodsArrayNew.add(obj); - } - wagonBalancejson.put("goods", goodsArrayNew); - } - model.addAttribute("wagonBalancejson", wagonBalancejson); - return new ModelAndView("visual/wagonBalance"); - } - - /* - * 地磅数据更新 - * */ - @RequestMapping("/wagonBalanceList.do") - public ModelAndView wagonBalanceList(HttpServletRequest request, Model model) throws IOException { - String modelIp = new CommUtil().getProperties("modelConfig.properties", "ip"); - model.addAttribute("modelIp", modelIp); - return new ModelAndView("visual/wagonBalanceList"); - } - - public JSONObject readJsonFile(String filename) { - String jsonString = ""; - File jsonFile = new File(filename); - try { - FileReader fileReader = new FileReader(jsonFile); - Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8"); - int ch = 0; - StringBuffer stringBuffer = new StringBuffer(); - while ((ch = reader.read()) != -1) { - stringBuffer.append((char) ch); - } - fileReader.close(); - reader.close(); - jsonString = stringBuffer.toString(); - } catch (FileNotFoundException e) { - JSONObject notFoundJson = new JSONObject(); - notFoundJson.put("code", 0); - notFoundJson.put("msg", "json文件不存在!"); - return notFoundJson; - } catch (IOException e) { - e.printStackTrace(); - } - return JSONObject.parseObject(jsonString); - } - - /* - * 物料拉动 - * */ - @RequestMapping("/material.do") - public ModelAndView material(HttpServletRequest request, Model model) { - return new ModelAndView("visual/material"); - } - - /* - * 工况预测 - * */ - @RequestMapping("/workPrediction.do") - public ModelAndView workPrediction(HttpServletRequest request, Model model) { - return new ModelAndView("visual/workPrediction"); - } -} diff --git a/src/com/sipai/controller/visual/ExpoController.java b/src/com/sipai/controller/visual/ExpoController.java deleted file mode 100644 index 2dbe4b8a..00000000 --- a/src/com/sipai/controller/visual/ExpoController.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.controller.visual; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.user.Company; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.JspElementService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -/** - * 世博文化公园 - * - * @author NJP - * 2023-10-23 - */ -@Controller -@RequestMapping("/expo") -public class ExpoController { - - @Resource - private JspElementService jspElementService; - @Resource - private UnitService unitService; - @Resource - private MPointHistoryService mPointHistoryService; - - //top - @RequestMapping("/top.do") - public ModelAndView top(HttpServletRequest request, Model model) { - return new ModelAndView("visual/expo_top"); - } - //主页 - @RequestMapping("/homepage.do") - public ModelAndView homepage(HttpServletRequest request, Model model) { - return new ModelAndView("visual/expo_homepage"); - } - - @RequestMapping("/getExpoData.do") - public ModelAndView getExpoData(HttpServletRequest request, Model model) { - JSONArray result = new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - if (bizid == null || bizid.isEmpty()) { - List companyList = this.unitService.getCompaniesByWhere("where active='1' order by morder"); - if (companyList != null && companyList.size() > 0) { - bizid = companyList.get(0).getId(); - } - } - result = this.jspElementService.getValue(bizid, time, jsp_id); - model.addAttribute("result", "{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/getExpoData4ES.do") - public ModelAndView getExpoData4ES(HttpServletRequest request, Model model) { - JSONArray result = new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - if (bizid == null || bizid.isEmpty()) { - List companyList = this.unitService.getCompaniesByWhere("where active='1' order by morder"); - if (companyList != null && companyList.size() > 0) { - bizid = companyList.get(0).getId(); - } - } - result = this.jspElementService.getValue4ES(bizid, time, jsp_id); - model.addAttribute("result", "{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/visual/InteractionController.java b/src/com/sipai/controller/visual/InteractionController.java deleted file mode 100644 index e1e1d34c..00000000 --- a/src/com/sipai/controller/visual/InteractionController.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.sipai.controller.visual; - - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - - - - - - - - - - - - - - - - - - - - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.Interaction; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.Layout; -import com.sipai.entity.visual.PlanInteraction; -import com.sipai.entity.visual.VisualJsp; -import com.sipai.entity.visual.InteractionMethod; -import com.sipai.service.visual.InteractionService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.visual.VisualJspService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/interaction") -public class InteractionController { - @Resource - private InteractionService interactionService; - - @RequestMapping("/showInteractionList.do") - public String showInteractionList(HttpServletRequest request,Model model){ - return "visual/interactionList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and id in('"+ids.replace(",", "','")+"')"; - } - PageHelper.startPage(page, rows); - List list = this.interactionService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /** - * 打开新增交互 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - return "visual/interactionAdd"; - } - - /** - * 打开编辑交互 - * @param request - * @param model - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - Interaction interaction = this.interactionService.selectById(id); - model.addAttribute("interaction", interaction); - return "visual/interactionEdit"; - } - - /** - * 保存交互 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("interaction") Interaction interaction){ - User cu= (User)request.getSession().getAttribute("cu"); - interaction.setId(CommUtil.getUUID()); - interaction.setInsuser(cu.getId()); - interaction.setInsdt(CommUtil.nowDate()); - int result = this.interactionService.save(interaction); - String resstr="{\"res\":\""+result+"\",\"id\":\""+interaction.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除交互 - * @param request - * @param model - * @param id 交互id - * @return - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.interactionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新交互 - * @param request - * @param model - * @param visualJsp - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Interaction interaction){ - User cu= (User)request.getSession().getAttribute("cu"); - interaction.setInsuser(cu.getId()); - interaction.setInsdt(CommUtil.nowDate()); - int result = this.interactionService.update(interaction); - String resstr="{\"res\":\""+result+"\",\"id\":\""+interaction.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 交互选择 - * @param request - * @param model - * @return - */ - @RequestMapping("/showInteractionForSelect.do") - public String showInteractionForSelect(HttpServletRequest request,Model model){ - return "visual/interaction4Select"; - } - - - /** - * 获取所有交互打开页面枚举 - * - * @param request - * @param model - * @param patrolModel - * @return - */ - @RequestMapping("/getAllMethodCode.do") - public String getAllDataType(HttpServletRequest request, Model model, - @ModelAttribute PlanInteraction planInteraction) { - String methodStr = InteractionMethod.getAll4JSON(); - model.addAttribute("result", methodStr); - return "result"; - } -} diff --git a/src/com/sipai/controller/visual/InterfaceController.java b/src/com/sipai/controller/visual/InterfaceController.java deleted file mode 100644 index fa9c398c..00000000 --- a/src/com/sipai/controller/visual/InterfaceController.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.controller.visual; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.service.user.UnitService; - - -@Controller -@RequestMapping("/visual/interface") -public class InterfaceController { - @Resource - private UnitService unitService; - - @RequestMapping("/getAlarmJson.do") - public ModelAndView getList(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - - String orderstr=" order by alarmtime desc"; - String wherestr=" where 1=1 and unitId='"+unitId+"' "; - -// List list = this.proAlarmService.selectTop5ListByWhere(wherestr+orderstr); - -// JSONArray json=JSONArray.fromObject(list); - -// model.addAttribute("result",json); - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/visual/JspConfigureController.java b/src/com/sipai/controller/visual/JspConfigureController.java deleted file mode 100644 index 19d5ca0a..00000000 --- a/src/com/sipai/controller/visual/JspConfigureController.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.sipai.controller.visual; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.JspConfigure; -import com.sipai.service.visual.JspConfigureService; -import com.sipai.entity.visual.JspConfigureDetail; -import com.sipai.service.visual.JspConfigureDetailService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/jspConfigure") -public class JspConfigureController { - - @Resource - private JspConfigureService jspConfigureService; - @Resource - private JspConfigureDetailService jspConfigureDetailService; - - @RequestMapping("/getSmartImgData.do") - public ModelAndView getSmartImgData(HttpServletRequest request,Model model) { - String bizid = request.getParameter("bizid"); - String jsp_id = request.getParameter("jsp_id"); - List jspConfigureList = this.jspConfigureService.selectListByWhere( - "where pid='"+jsp_id+"' and unit_id='"+bizid+"' order by morder"); - String result = JSON.toJSONString(jspConfigureList); - model.addAttribute("result","{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/jspConfigureDetail.do") - public ModelAndView jspConfigureDetail(HttpServletRequest request,Model model) { - String jspConfigureId = request.getParameter("jspConfigureId"); - model.addAttribute("jspConfigureId",jspConfigureId); - return new ModelAndView("visual/jspConfigureDetail"); - } - - @RequestMapping("/save.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute JspConfigure jspConfigure) { - User cu = (User) request.getSession().getAttribute("cu"); - jspConfigure.setId(CommUtil.getUUID()); - jspConfigure.setInsdt(CommUtil.nowDate()); - jspConfigure.setInsuser(cu.getId()); - if(request.getParameter("companyid")!=null && !request.getParameter("companyid").isEmpty()){ - jspConfigure.setSelectUnitId(request.getParameter("companyid")); - } - int result = this.jspConfigureService.save(jspConfigure); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/delete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.jspConfigureService.deleteById(id); - this.jspConfigureDetailService.deleteByWhere("where configure_ids in ('"+id+"')"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/deletes.do") - public ModelAndView dodeletes(HttpServletRequest request,Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",","','"); - int result = this.jspConfigureService.deleteByWhere("where id in ('"+ids+"')"); - this.jspConfigureDetailService.deleteByWhere("where configure_ids in ('"+ids+"')"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/update.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute JspConfigure jspConfigure) { - User cu = (User) request.getSession().getAttribute("cu"); - jspConfigure.setInsdt(CommUtil.nowDate()); - jspConfigure.setInsuser(cu.getId()); - if(request.getParameter("companyid")!=null && !request.getParameter("companyid").isEmpty()){ - jspConfigure.setSelectUnitId(request.getParameter("companyid")); - } - int result = this.jspConfigureService.update(jspConfigure); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/updatedrag.do") - public ModelAndView doupdatedrag(HttpServletRequest request,Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - JspConfigure jspConfigure = new JspConfigure(); - jspConfigure.setId(request.getParameter("id")); - String elementLeft = request.getParameter("elementLeft"); - String elementTop = request.getParameter("elementTop"); - String windowsHeight = request.getParameter("windowsHeight"); - String windowsWidth = request.getParameter("windowsWidth"); - jspConfigure.setElementLeft(Double.parseDouble(elementLeft)); - jspConfigure.setElementTop(Double.parseDouble(elementTop)); - jspConfigure.setWindowsHeight(Double.parseDouble(windowsHeight)); - jspConfigure.setWindowsWidth(Double.parseDouble(windowsWidth)); - jspConfigure.setInsdt(CommUtil.nowDate()); - jspConfigure.setInsuser(cu.getId()); - if(request.getParameter("companyid")!=null && !request.getParameter("companyid").isEmpty()){ - jspConfigure.setSelectUnitId(request.getParameter("companyid")); - } - int result = this.jspConfigureService.update(jspConfigure); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/jspConfigureDetailGetTreeJson.do") - public String jspConfigureDetailGetTreeJson(HttpServletRequest request,Model model){ - String configureId = request.getParameter("configureId"); - String wherestr ="where 1=1 "; - if (null!=configureId && !"".equals(configureId)) { - wherestr += " and configure_id = '"+configureId+"' "; - } - String orderString = " order by morder"; - List list = this.jspConfigureDetailService.selectListByWhere(wherestr+orderString); - String json = this.jspConfigureDetailService.getTreeList(null, list,configureId); - Result result = Result.success(json); - model.addAttribute("result",CommUtil.toJson(result)); - return "result"; - } - /** - * 打开新增配置参数界面 - */ - @RequestMapping("/jspConfigureDetailAdd.do") - public String jspConfigureDetailAdd(HttpServletRequest request,Model model){ - return "visual/jspConfigureDetailAdd"; - } - /** - * 删除多条配置参数 - */ - @RequestMapping("/jspConfigureDetailDeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.jspConfigureDetailService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /** - * 保存新增的配置参数数据 - */ - @RequestMapping("/jspConfigureDetailSave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("jspConfigureDetail") JspConfigureDetail jspConfigureDetail){ - User cu= (User)request.getSession().getAttribute("cu"); - jspConfigureDetail.setId(CommUtil.getUUID()); - jspConfigureDetail.setInsdt(CommUtil.nowDate()); - if(jspConfigureDetail.getConfigureId() == null || jspConfigureDetail.getConfigureId().equals("")){ - jspConfigureDetail.setConfigureId("-1"); - } - int result = this.jspConfigureDetailService.save(jspConfigureDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+jspConfigureDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /** - * 打开配置参数界面 - */ - @RequestMapping("/jspConfigureDetailEdit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - JspConfigureDetail jspConfigureDetail = this.jspConfigureDetailService.selectById(id); - model.addAttribute("jspConfigureDetail", jspConfigureDetail); - return "visual/jspConfigureDetailEdit"; - } - /** - * 更新配置参数数据 - */ - @RequestMapping("/jspConfigureDetailUpdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("jspConfigureDetail") JspConfigureDetail jspConfigureDetail){ - User cu= (User)request.getSession().getAttribute("cu"); - jspConfigureDetail.setInsdt(CommUtil.nowDate()); - int result = this.jspConfigureDetailService.update(jspConfigureDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+jspConfigureDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/visual/LayoutController.java b/src/com/sipai/controller/visual/LayoutController.java deleted file mode 100644 index 55ddc701..00000000 --- a/src/com/sipai/controller/visual/LayoutController.java +++ /dev/null @@ -1,307 +0,0 @@ -package com.sipai.controller.visual; - - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - - - - - - - - - - - - - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.Layout; -import com.sipai.entity.visual.LayoutDetail; -import com.sipai.service.visual.LayoutDetailService; -import com.sipai.service.visual.LayoutService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/layout") -public class LayoutController { - @Resource - private LayoutService layoutService; - @Resource - private LayoutDetailService layoutDetailService; - - @RequestMapping("/showLayoutList.do") - public String showLayoutList(HttpServletRequest request,Model model){ - return "visual/layoutList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and id in('"+ids.replace(",", "','")+"')"; - } - PageHelper.startPage(page, rows); - List list = this.layoutService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getDetailList.do") - public ModelAndView getDetailList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " rowno,morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and id in('"+ids.replace(",", "','")+"')"; - } - PageHelper.startPage(page, rows); - List list = this.layoutDetailService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - - /** - * 打开新增布局 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - return "visual/layoutAdd"; - } - - /** - * 打开编辑布局 - * @param request - * @param model - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - Layout layout = this.layoutService.selectById(id); - model.addAttribute("layout", layout); - return "visual/layoutEdit"; - } - - /** - * 保存布局 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("layout") Layout layout){ - User cu= (User)request.getSession().getAttribute("cu"); - layout.setId(CommUtil.getUUID()); - layout.setInsuser(cu.getId()); - layout.setInsdt(CommUtil.nowDate()); - int result = this.layoutService.save(layout); - String resstr="{\"res\":\""+result+"\",\"id\":\""+layout.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除布局 - * @param request - * @param model - * @param id 布局id - * @return - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.layoutService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新布局 - * @param request - * @param model - * @param patrolModel - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Layout layout){ - User cu= (User)request.getSession().getAttribute("cu"); - layout.setInsuser(cu.getId()); - layout.setInsdt(CommUtil.nowDate()); - int result = this.layoutService.update(layout); - String resstr="{\"res\":\""+result+"\",\"id\":\""+layout.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 打开新增布局元素 - */ - @RequestMapping("/doaddDetail.do") - public String doaddDetail(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - String pid = request.getParameter("pid"); - model.addAttribute("pid",pid); - return "visual/layoutDetailAdd"; - } - - /** - * 打开编辑布局元素 - * @param request - * @param model - * @return - */ - @RequestMapping("/doeditDetail.do") - public String doeditDetail(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - LayoutDetail layoutDetail = this.layoutDetailService.selectById(id); - model.addAttribute("layoutDetail", layoutDetail); - return "visual/layoutDetailEdit"; - } - - /** - * 保存布局元素 - */ - @RequestMapping("/dosaveDetail.do") - public String dosaveDetail(HttpServletRequest request,Model model, - @ModelAttribute("layoutDetail") LayoutDetail layoutDetail){ - User cu= (User)request.getSession().getAttribute("cu"); - layoutDetail.setId(CommUtil.getUUID()); - layoutDetail.setInsuser(cu.getId()); - layoutDetail.setInsdt(CommUtil.nowDate()); - int result = this.layoutDetailService.save(layoutDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+layoutDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除布局元素 - * @param request - * @param model - * @param id 布局元素id - * @return - */ - @RequestMapping("/dodeleteDetail.do") - public String dodeleteDetail(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.layoutDetailService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新布局元素 - * @param request - * @param model - * @param patrolModel - * @return - */ - @RequestMapping("/doupdateDetail.do") - public String doupdateDetail(HttpServletRequest request,Model model, - @ModelAttribute LayoutDetail layoutDetail){ - User cu= (User)request.getSession().getAttribute("cu"); - layoutDetail.setInsuser(cu.getId()); - layoutDetail.setInsdt(CommUtil.nowDate()); - int result = this.layoutDetailService.update(layoutDetail); - String resstr="{\"res\":\""+result+"\",\"id\":\""+layoutDetail.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 布局选择 - * @param request - * @param model - * @return - */ - @RequestMapping("/showLayoutForSelect.do") - public String showLayoutForSelect(HttpServletRequest request,Model model){ - String layoutIds=request.getParameter("layoutId"); - if(layoutIds!=null && !layoutIds.isEmpty()){ - String wherestr = "where id in ('"+layoutIds.replace("," , "','")+"') order by CHARINDEX(','+ id +',',',"+layoutIds+",')"; - List list = this.layoutService.selectListByWhere(wherestr); - model.addAttribute("layouts",JSONArray.fromObject(list)); - } - return "visual/layout4Select"; - } -} diff --git a/src/com/sipai/controller/visual/PlanController.java b/src/com/sipai/controller/visual/PlanController.java deleted file mode 100644 index 34d0b9e1..00000000 --- a/src/com/sipai/controller/visual/PlanController.java +++ /dev/null @@ -1,906 +0,0 @@ -package com.sipai.controller.visual; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSON; -import net.sf.json.JSONArray; - -import org.activiti.engine.impl.util.json.JSONObject; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Tree; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserDetail; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.Interaction; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.Layout; -import com.sipai.entity.visual.LayoutDetail; -import com.sipai.entity.visual.Plan; -import com.sipai.entity.visual.PlanInteraction; -import com.sipai.entity.visual.PlanLayout; -import com.sipai.entity.visual.VisualJsp; -import com.sipai.entity.work.Camera; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.service.visual.DataTypeService; -import com.sipai.service.visual.GetValueService; -import com.sipai.service.visual.InteractionService; -import com.sipai.service.visual.LayoutDetailService; -import com.sipai.service.visual.LayoutService; -import com.sipai.service.visual.PlanInteractionService; -import com.sipai.service.visual.PlanLayoutService; -import com.sipai.service.visual.PlanService; -import com.sipai.service.visual.VisualJspService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.websocket.VisualMessage; - -@Controller -@RequestMapping("/plan") -public class PlanController { - @Resource - private PlanService planService; - @Resource - private PlanLayoutService planLayoutService; - @Resource - private PlanInteractionService planInteractionService; - @Resource - private LayoutService layoutService; - @Resource - private LayoutDetailService layoutDetailService; - @Resource - private VisualJspService visualJspService; - @Resource - private InteractionService interactionService; - @Resource - private MPointService mPointService; - @Resource - private GetValueService getValueService; - @Resource - private CameraService cameraService; - @Resource - private DataTypeService dataTypeService; - @Resource - private UserService userService; - @Resource - private UserDetailService userDetailService; - @Resource - private UnitService unitService; - - @RequestMapping("/showPlanTree.do") - public String showPlanTree(HttpServletRequest request, Model model) { - return "visual/planManage"; - } - - - /** - * 通过方案布局id获取jspelement 以及配置的值 - * @param request - * @param model - * @return - */ - @RequestMapping("/getJspWholeInfoByPlanLayoutId.do") - public String getJspWholeInfoByPlanLayoutId(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planLayoutId = request.getParameter("planLayoutId"); - String sdt=request.getParameter("sdt"); - String edt=request.getParameter("edt"); - String elementCode=request.getParameter("elementCode"); - List jspElements = this.planService.getJspWholeInfoByPlanLayoutId(planLayoutId,sdt,edt,elementCode); - JSONArray json=JSONArray.fromObject(jspElements); - model.addAttribute("result", json); - return "result"; - } - - /** - * 通过方案布局id获取摄像头 - * @param request - * @param model - * @return - */ - @RequestMapping("/getCameraByPlanLayoutId.do") - public String getCameraByPlanLayoutId(HttpServletRequest request, Model model) { - //User cu = (User) request.getSession().getAttribute("cu"); - String planLayoutId = request.getParameter("planLayoutId"); - Camera camera = this.planService.getCameraByPlanLayoutId(planLayoutId); - JSONArray json=JSONArray.fromObject(camera); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取plan的布局list - * @param request - * @param model - * @return - */ - @RequestMapping("/getPlanWholeInfo.do") - public String getPlanWholeInfo(HttpServletRequest request, Model model) { - //User cu = (User) request.getSession().getAttribute("cu"); - String planId = request.getParameter("planId"); - Plan plan = this.planService.selectWholeInfoById(planId); - JSONArray json=JSONArray.fromObject(plan); - model.addAttribute("result", json); - return "result"; - } - - /** - * 投屏方案切换 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showPlanSwitch.do") - public String showPlanSwitch(HttpServletRequest request, Model model) { - return "visual/planSwitch"; - } - - /** - * 投屏方案切换 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showPlanSwitchForApp.do") - public String showPlanSwitchForApp(HttpServletRequest request, Model model) { - return "visual/planSwitchForApp"; - } - - /** - * 投屏方案展示 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doPlan.do") - public String doPlan(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Plan plan = planService.getPlanById(id); - //获取交互 - List planInteractions = this.planInteractionService.selectListByWhere(" where plan_id = '"+plan.getId()+"'"); - plan.setPlanInteraction(planInteractions); - if (planService.getPlanById(plan.getPid()) != null){ - plan.set_pname(planService.getPlanById(plan.getPid()).getName()); - } - JSONArray json=JSONArray.fromObject(plan); - model.addAttribute("plan", json); - - return "visual/plan"; - } - - /** - * 投屏 - * - * @param request - * @param model - * @return - * @throws IOException - */ - @RequestMapping("/doSwitch.do") - public String doSwitch(HttpServletRequest request, Model model) throws IOException { - String planId = request.getParameter("planId"); - model.addAttribute("planId", planId); - return "visual/switch"; - } - - @RequestMapping("/doSwitchForView.do") - public String doSwitchForView(HttpServletRequest request, Model model) { - String planId = request.getParameter("planId"); - model.addAttribute("planId", planId); - return "visual/switchForView"; - } - - /** - * 浏览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doView.do") - public String doView(HttpServletRequest request, Model model) { - String planId = request.getParameter("planId"); - model.addAttribute("planId", planId); - return "visual/view"; - } - - - - /** - * demo-展示工艺节点信息(文件夹) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/ShowNode.do") - public String ShowNode(HttpServletRequest request, Model model) { - return "visual/node/ShowNode"; - } - - /** - * 获取工艺节点状态(文件夹) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getProcess.do") - public String getProcess(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String type = request.getParameter("type"); - String planLayoutId = request.getParameter("planLayoutId"); - List jspElements = this.getValueService.getValueByplanLayoutId(planLayoutId, cu.getPid(),type); - JSONArray json=JSONArray.fromObject(jspElements); - List nodeList = this.planService.selectListByWhere("where type='"+type+"' and pid <> '-1' order by morder"); - JSONArray nodeJson=JSONArray.fromObject(nodeList); - String result="{\"process\":"+json+",\"node\":"+nodeJson+"}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取工艺节点(文件夹) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getProcessNode.do") - public String getProcessNode(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - List list = this.planService.selectListByWhere("where type='"+type+"' and pid <> '-1' order by morder"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - - @RequestMapping("/showPlan4Select.do") - public String showPlan4Select(HttpServletRequest request, Model model) { - return "visual/plan4select"; - } - - @RequestMapping("/showPlanAdd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("")) { - Plan plan = planService.getPlanById(pid); - model.addAttribute("pname", plan.getName()); - } - String id = CommUtil.getUUID(); - model.addAttribute("id", id); - return "visual/planAdd"; - } - - @RequestMapping("/showPlanEdit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Plan plan = planService.getPlanById(id); - if (planService.getPlanById(plan.getPid()) != null) - plan.set_pname(planService.getPlanById(plan.getPid()).getName()); - if (layoutService.selectById(plan.getLayoutId()) != null) { - plan.setLayoutName(layoutService.selectById(plan.getLayoutId()) - .getName()); - } - model.addAttribute("plan", plan); - return "visual/planEdit"; - } - - @RequestMapping("/savePlan.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("plan") Plan plan) { - // plan.setId(CommUtil.getUUID()); - plan.setType("plan"); - if (plan.getPid() == null || plan.getPid().isEmpty()) { - plan.setPid("-1"); - } - int result = this.planService.savePlan(plan); - // model.addAttribute("result","{\"res\":\""+result+"\",\"id\":\""+plan.getId()+"\"}"); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/updatePlan.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("plan") Plan plan) { - int result = this.planService.updatePlan(plan); - model.addAttribute("result", result); - - return new ModelAndView("result"); - } - - @RequestMapping("/deletePlan.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @ModelAttribute("plan") Plan plan) { - String msg = ""; - int result = 0; - List mlist = this.planService.selectListByWhere(" where pid = '" - + plan.getId() + "' and type='plan' "); - // 判断是否有子菜单,有的话不能删除 - if (mlist != null && mlist.size() > 0) { - msg = "请先删除子菜单"; - } else { - result = this.planService.deletePlanById(plan.getId()); - if (result > 0) { - - } else { - msg = "删除失败"; - } - } - - model.addAttribute("result", "{\"res\":\"" + result + "\",\"msg\":\"" - + msg + "\"}"); - - return new ModelAndView("result"); - } - - @RequestMapping("/getPlansJson.do") - public String getPlansJson(HttpServletRequest request, Model model) { - List list = this.planService - .selectListByWhere("where type='plan' order by morder"); - String json = planService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getPlansJsonActive.do") - public String getPlansJsonActive(HttpServletRequest request, Model model) { - List list = this.planService - .selectListByWhere("where type='plan' and active='启用' order by morder"); - String json = planService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getPlanById.do") - public String getPlanById(HttpServletRequest request, Model model) { - Plan plan = planService.getPlanById(request.getParameter("id")); - JSONArray json=JSONArray.fromObject(plan); - model.addAttribute("result", json); - return "result"; - } - -// @RequestMapping("/getPlansJsonActive.do") -// public String getPlansJsonActive(HttpServletRequest request, Model model) { -// List list = this.planService -// .selectListByWhere("where active='启用' and type='plan' order by morder"); -// -// List tree = new ArrayList(); -// for (Plan resource : list) { -// Tree node = new Tree(); -// BeanUtils.copyProperties(resource, node); -// -// node.setText(resource.getName()); -// Map attributes = new HashMap(); -// attributes.put("url", resource.getLocation()); -// attributes.put("target", resource.getTarget()); -// node.setAttributes(attributes); -// tree.add(node); -// } -// JSONArray json = JSONArray.fromObject(tree); -// // System.out.println(json); -// model.addAttribute("result", json); -// return "result"; -// } - - - - @RequestMapping("/showView.do") - public String showView(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Plan plan = this.planService.selectWholeInfoById(id); - return "visual/view"; - } - - /** - * plan页面编辑时选择布局 更改下方plan的布局元素,先查询是否该planId和layoutId有数据,无则新增 - * - * @param request - * @param model - * @param id - * plan的id - * @param layoutId - * 布局的id - * @return - */ - @RequestMapping("/createPlanLayout.do") - public String createPlanLayout(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planId = request.getParameter("id"); - String layoutId = request.getParameter("layoutId"); - //更新方案选择布局 - Plan plan = new Plan(); - plan.setId(planId); - plan.setLayoutId(layoutId); - this.planService.updatePlan(plan); - //更新布局详细 - int result = this.planService.createPlanLayout(planId, layoutId, - cu.getId()); - model.addAttribute("result", result); - return "result"; - } - - /** - * 强制更新方案布局 - * - * @param request - * @param model - * @param id - * plan的id - * @param layoutId - * 布局的id - * @return - */ - @RequestMapping("/updatePlanLayout.do") - public String updatePlanLayout(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planId = request.getParameter("id"); - String layoutId = request.getParameter("layoutId"); - int result = this.planService.updatePlanLayout(planId, layoutId, - cu.getId()); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取plan的布局list - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getPlanLayoutList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("layoutId") != null - && !request.getParameter("layoutId").isEmpty()) { - wherestr += " and layout_id = '" + request.getParameter("layoutId") - + "' "; - } else { - wherestr = " where 1=0 ";// 若未传布局id则搜不到数据 - } - - if (request.getParameter("planId") != null - && !request.getParameter("planId").isEmpty()) { - wherestr += " and plan_id = '" + request.getParameter("planId") - + "' "; - } else { - wherestr = " where 1=0 ";// 若未传planid则搜不到数据 - } - - PageHelper.startPage(page, rows); - List list = this.planLayoutService - .selectListByWhere(wherestr + orderstr); - // 获取planLayout 对应的布局元素LayoutDetail 的信息 - for (int i = 0; i < list.size(); i++) { - LayoutDetail layoutDetail = this.layoutDetailService - .selectById(list.get(i).getPid()); - list.get(i).setLayoutDetail(layoutDetail); - try{ - // 获取jspname - if (list.get(i).getJspCode() != null - && !list.get(i).getJspCode().equals("")) { - List visualJsp = this.visualJspService - .selectListByWhere(" where id = '" - + list.get(i).getJspCode() + "'"); - list.get(i).setJspName(visualJsp.get(0).getName()); - list.get(i).setJspCode(visualJsp.get(0).getJspCode()); - } - }catch(Exception e){ - System.out.println(e); - } - try{ - //摄像头 - if(list.get(i).getCameraId()!=null&&!list.get(i).getCameraId().equals("")){ - Camera camera = this.cameraService.selectById(list.get(i).getCameraId()); - if(camera != null){ - list.get(i).setCamera(camera); - } - } - }catch(Exception e){ - System.out.println(e); - } - try{ - //产线 - if(list.get(i).getDataType()!=null&&!list.get(i).getDataType().equals("")){ - DataType dataType = this.dataTypeService.selectById(list.get(i).getDataType()); - if(dataType != null){ - list.get(i).setDataTypeName(dataType.getDataTypeName()); - } - } - }catch(Exception e){ - System.out.println(e); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json - + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 更新方案布局中的jspCode - * - * @param request - * @param model - * @param planLayoutId - * 方案布局中的id - * @param jspCode - * 模块的code - * @return - */ - @RequestMapping("/savePlanLayoutJSP.do") - public String savePlanLayoutJSP(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planLayoutId = request.getParameter("planLayoutId"); - String jspCode = request.getParameter("jspCode"); - PlanLayout planLayout = this.planLayoutService.selectById(planLayoutId); - planLayout.setInsdt(CommUtil.nowDate()); - planLayout.setInsuser(cu.getId()); - planLayout.setJspCode(jspCode); - int result = this.planLayoutService.update(planLayout); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新方案布局中的dataType - * - * @param request - * @param model - * @param planLayoutId - * 方案布局中的id - * @param dataTypeId - * 数据类型ID - * @return - */ - @RequestMapping("/savePlanLayoutDataType.do") - public String savePlanLayoutDataType(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planLayoutId = request.getParameter("planLayoutId"); - String dataTypeId = request.getParameter("dataTypeId"); - PlanLayout planLayout = this.planLayoutService.selectById(planLayoutId); - planLayout.setInsdt(CommUtil.nowDate()); - planLayout.setInsuser(cu.getId()); - planLayout.setDataType(dataTypeId); - int result = this.planLayoutService.update(planLayout); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新方案布局中的显示摄像头 - * - * @param request - * @param model - * @param planLayoutId - * 方案布局中的id - * @param cameraId - * 摄像头ID - * @return - */ - @RequestMapping("/savePlanLayoutCamera.do") - public String savePlanLayoutCamera(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planLayoutId = request.getParameter("planLayoutId"); - String cameraId = request.getParameter("cameraId"); - PlanLayout planLayout = this.planLayoutService.selectById(planLayoutId); - planLayout.setInsdt(CommUtil.nowDate()); - planLayout.setInsuser(cu.getId()); - planLayout.setCameraId(cameraId); - int result = this.planLayoutService.update(planLayout); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取方案的交互list - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getPlanInteractionList.do") - public ModelAndView getPlanInteractionList(HttpServletRequest request, - Model model, @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - - if (request.getParameter("planId") != null - && !request.getParameter("planId").isEmpty()) { - wherestr += " and plan_id = '" + request.getParameter("planId") - + "' "; - } else { - wherestr = " where 1=0 ";// 若未传planid则搜不到数据 - } - - PageHelper.startPage(page, rows); - List list = this.planInteractionService - .selectListByWhere(wherestr + orderstr); - for (int i = 0; i < list.size(); i++) { - Interaction interaction = this.interactionService.selectById(list - .get(i).getInteractionId()); - list.get(i).setInteraction(interaction); - // 获取测量点名称s - if (list.get(i).getParameter() != null) { - List mPoints = this.mPointService.selectListByWhere( - cu.getPid(), "where id in ('" - + list.get(i).getParameter() - .replace(",", "','") + "')");// 暂时用人员的厂区ID作为数据建库查询ID - String parameterNames = ""; - for (int j = 0; j < mPoints.size(); j++) { - if (j == 0) { - parameterNames = mPoints.get(j).getParmname(); - } else { - parameterNames += "," + mPoints.get(j).getParmname(); - } - } - list.get(i).setParameterNames(parameterNames); - } - // 获取摄像头 - if(list.get(i).getCameraId() != null&& !list.get(i).getCameraId().equals("")){ - Camera camera = this.cameraService.selectById(list.get(i).getCameraId()); - if(camera!=null){ - list.get(i).setCamera(camera); - } - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json - + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doAddPlanInteraction.do") - public String doAddPlanInteraction(HttpServletRequest request, Model model) { - String planId = request.getParameter("planId"); - model.addAttribute("planId", planId); - return "visual/planInteractionAdd"; - } - - /** - * 保存方案交互 - */ - @RequestMapping("/doSaveInteraction.do") - public String doSaveInteraction(HttpServletRequest request, Model model, - @ModelAttribute("planInteraction") PlanInteraction planInteraction) { - User cu = (User) request.getSession().getAttribute("cu"); - planInteraction.setId(CommUtil.getUUID()); - planInteraction.setInsuser(cu.getId()); - planInteraction.setInsdt(CommUtil.nowDate()); - int result = this.planInteractionService.save(planInteraction); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" - + planInteraction.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除方案交互 - * - * @param request - * @param model - * @param id - * 方案交互id - * @return - */ - @RequestMapping("/dodeletePlanInteraction.do") - public String dodeletePlanInteraction(HttpServletRequest request, - Model model, @RequestParam(value = "id") String id) { - int result = this.planInteractionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 重置的测量点选择方法 仅供大屏使用 多选 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showMPoint4Select.do") - public String showMPoint4Select(HttpServletRequest request, Model model) { - return "visual/mPointListForVisualSelects"; - } - - /** - * 重置的测量点选择方法 仅供大屏使用 单选 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showMPoint4SingleSelect.do") - public String showMPoint4SingleSelect(HttpServletRequest request, Model model) { - return "visual/mPointListForVisualSelect"; - } - - /** - * 打开编辑方案交互 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/doEditPlanInteraction.do") - public String doEditPlanInteraction(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - PlanInteraction planInteraction = this.planInteractionService - .selectById(id); - // 获取交互名称 - if (planInteraction != null - && planInteraction.getInteractionId() != null) { - Interaction interaction = this.interactionService - .selectById(planInteraction.getInteractionId()); - planInteraction.setInteraction(interaction); - } - // 获取测量点名称s - if (planInteraction != null && planInteraction.getParameter() != null) { - List mPoints = this.mPointService.selectListByWhere( - cu.getPid(), "where id in ('" - + planInteraction.getParameter() - .replace(",", "','") + "')");// 暂时用人员的厂区ID作为数据建库查询ID - String parameterNames = ""; - for (int i = 0; i < mPoints.size(); i++) { - if (i == 0) { - parameterNames = mPoints.get(i).getParmname(); - } else { - parameterNames += "," + mPoints.get(i).getParmname(); - } - } - planInteraction.setParameterNames(parameterNames); - } - // 获取摄像头 - if(planInteraction.getCameraId() != null&& !planInteraction.getCameraId().equals("")){ - Camera camera = this.cameraService.selectById(planInteraction.getCameraId()); - if(camera!=null){ - planInteraction.setCamera(camera); - } - } - - model.addAttribute("planInteraction", planInteraction); - return "visual/planInteractionEdit"; - } - - /** - * 更新方案交互 - * - * @param request - * @param model - * @param patrolModel - * @return - */ - @RequestMapping("/doUpdateInteraction.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute PlanInteraction planInteraction) { - User cu = (User) request.getSession().getAttribute("cu"); - planInteraction.setInsuser(cu.getId()); - planInteraction.setInsdt(CommUtil.nowDate()); - int result = this.planInteractionService.update(planInteraction); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" - + planInteraction.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - /** - * 打开交互模态 - * @param request - * @param model - * @return - */ - @RequestMapping("/openInteraction.do") - public String openInteraction(HttpServletRequest request, Model model) { - String planInteractionId = request.getParameter("id"); - PlanInteraction planInteraction = this.planInteractionService.selectById(planInteractionId); - Interaction interaction = this.interactionService.selectById(planInteraction.getInteractionId()); - model.addAttribute("planInteractionId", planInteractionId); -// if(request.getParameter("videoTypeInteraction")!=null&& !request.getParameter("videoTypeInteraction").isEmpty()) { -// model.addAttribute("videoTypeInteraction", request.getParameter("videoTypeInteraction")); -// } - String url = "visual/interaction/"+interaction.getMethodcode(); - return url; - } - - /**获取交互模态的数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getDataByPlanInteractionId.do") - public String getDataByPlanInteractionId(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String planInteractionId = request.getParameter("planInteractionId"); - PlanInteraction planInteraction = this.planInteractionService.selectById(planInteractionId); - planInteraction = this.getValueService.getHistoryByPlanInteraction(planInteraction,cu.getPid()); - JSONArray json = JSONArray.fromObject(planInteraction); - model.addAttribute("result", json); - return "result"; - } - - /**获取交互模态的摄像头 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCameraByPlanInteractionId.do") - public String getCameraByPlanInteractionId(HttpServletRequest request, Model model) { - //User cu = (User) request.getSession().getAttribute("cu"); - String planInteractionId = request.getParameter("planInteractionId"); - PlanInteraction planInteraction = this.planInteractionService.selectById(planInteractionId); - Camera camera = this.cameraService.selectById(planInteraction.getCameraId()); - JSONArray json = JSONArray.fromObject(camera); - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/visual/ProcessOperationController.java b/src/com/sipai/controller/visual/ProcessOperationController.java deleted file mode 100644 index 9a05ed89..00000000 --- a/src/com/sipai/controller/visual/ProcessOperationController.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.controller.visual; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.user.Company; -import com.sipai.entity.visual.ProcessOperation; -import com.sipai.service.visual.ProcessOperationService; - - -@Controller -@RequestMapping("/processOperation") -public class ProcessOperationController { - @Resource - private ProcessOperationService processOperationService; - - @RequestMapping("/getProcessOperationList.do") - public ModelAndView getProcessOperationList(HttpServletRequest request,Model model) { - String bizid=""; - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - bizid=request.getParameter("bizid"); - } - //先找到区域的list - List processOperationList = this.processOperationService.selectListByWhere("where unit_id='"+bizid+"' order by id"); - JSONArray result=JSONArray.fromObject(processOperationList); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/visual/ShaKouController.java b/src/com/sipai/controller/visual/ShaKouController.java deleted file mode 100644 index b1b491a5..00000000 --- a/src/com/sipai/controller/visual/ShaKouController.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.controller.visual; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.user.Unit; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.JspElementService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/shakou") -public class ShaKouController { - - @Resource - private JspElementService jspElementService; - @Resource - private UnitService unitService; - - @RequestMapping("/shakou.do") - public ModelAndView shakou(HttpServletRequest request,Model model) { - return new ModelAndView("visual/shakou"); - } - @RequestMapping("/shakouFactory.do") - public ModelAndView shakouFactory(HttpServletRequest request,Model model) { - request.setAttribute("nowdate", CommUtil.nowDate()); - return new ModelAndView("visual/shakouFactory"); - } - @RequestMapping("/shakouCompany.do") - public ModelAndView shakouCompany(HttpServletRequest request,Model model) { - return new ModelAndView("visual/shakouCompany"); - } - - @RequestMapping("/judgeShaKou4UnitType.do") - public ModelAndView judgeShaKou4UnitType(HttpServletRequest request,Model model) { - String result= "/shakou/shakouFactory.do"; - String bizid = request.getParameter("bizid"); - Unit unit = this.unitService.getUnitById(bizid); - if(unit!=null && unit.getType()!=null){ - if(unit.getType().equals(CommString.UNIT_TYPE_BIZ)){ - //水厂 - result= "/shakou/shakouFactory.do"; - }else{ - if(unit.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - //公司 - result= "/shakou/shakouCompany.do"; - } - } - } - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getShaKouData.do") - public ModelAndView getShaKouData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - result = this.jspElementService.getValue(bizid,time,jsp_id); - model.addAttribute("result","{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/getShaKouCompanyData.do") - public ModelAndView getShaKouCompanyData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - JSONArray result_sk= new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - result = this.jspElementService.getValue(bizid,time,jsp_id); - List unitSK = unitService.selectListByWhere("where name like '%沙口%' "); - if(unitSK!=null && unitSK.size()>0){ - result_sk = this.jspElementService.getValue(unitSK.get(0).getId(),time,jsp_id); - } - model.addAttribute("result","{\"rows\":" + result + ",\"shakou\":" + result_sk + "}"); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/visual/SmartController.java b/src/com/sipai/controller/visual/SmartController.java deleted file mode 100644 index c0c2b330..00000000 --- a/src/com/sipai/controller/visual/SmartController.java +++ /dev/null @@ -1,339 +0,0 @@ -package com.sipai.controller.visual; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.JspConfigureDetail; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.VisualCacheData; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.visual.VisualCacheConfigService; -import com.sipai.service.visual.VisualCacheDataService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/smart") -public class SmartController { - - @Resource - private JspElementService jspElementService; - @Resource - private UnitService unitService; - @Resource - private VisualCacheDataService visualCacheDataService; - - @RequestMapping("/smart.do") - public ModelAndView smart(HttpServletRequest request,Model model) { - return new ModelAndView("visual/smart"); - } - - /**厂区首页 - * @param request - * @param model - * @return - */ - @RequestMapping("/smartFactory.do") - public ModelAndView smartFactory(HttpServletRequest request,Model model) { - return new ModelAndView("visual/smartFactory"); - } - - /**厂区首页配置 - * @param request - * @param model - * @return - */ - @RequestMapping("/smartFactoryConfigure.do") - public ModelAndView smartFactoryConfigure(HttpServletRequest request,Model model) { - return new ModelAndView("visual/smartFactoryConfigure"); - } - - /**公司首页 - * @param request - * @param model - * @return - */ - @RequestMapping("/smartCompany.do") - public ModelAndView smartCompany(HttpServletRequest request,Model model) { - return new ModelAndView("visual/smartCompany"); - } - - /**公司首页配置 - * @param request - * @param model - * @return - */ - @RequestMapping("/smartCompanyConfigure.do") - public ModelAndView smartCompanyConfigure(HttpServletRequest request,Model model) { - return new ModelAndView("visual/smartCompanyConfigure"); - } - @RequestMapping("/judgeSmart4UnitType.do") - public ModelAndView judgeSmart4UnitType(HttpServletRequest request,Model model) { - String result= "/smart/smartFactory.do"; - String bizid = request.getParameter("bizid"); - String configure = request.getParameter("configure"); - Unit unit = this.unitService.getUnitById(bizid); - if(unit!=null && unit.getType()!=null){ - if(unit.getType().equals(CommString.UNIT_TYPE_BIZ)){ - //水厂 - if(configure!=null && !configure.isEmpty() && "configure".equals(configure)){ - result= "/smart/smartFactoryConfigure.do"; - }else{ - result= "/smart/smartFactory.do"; - } - }else{ - if(unit.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - //公司 - if(configure!=null && !configure.isEmpty() && "configure".equals(configure)){ - result= "/smart/smartCompanyConfigure.do"; - }else{ - result= "/smart/smartCompany.do"; - } - } - } - } - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getSmartData.do") - public ModelAndView getSmartData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - result = this.jspElementService.getValueAndHisForMonth(bizid,time,jsp_id,request); - model.addAttribute("result","{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/getSmartCompanyData.do") - public ModelAndView getSmartCompanyData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - JSONArray result_bj= new JSONArray(); - JSONArray result_xj= new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - result = this.jspElementService.getValueAndHisForMonth(bizid,time,jsp_id,request); - List unitBj = unitService.selectListByWhere("where name like '%北江%' "); - if(unitBj!=null && unitBj.size()>0){ - result_bj = this.jspElementService.getValue(unitBj.get(0).getId(),time,jsp_id); - } - List unitXj = unitService.selectListByWhere("where name like '%西江%' "); - if(unitXj!=null && unitXj.size()>0){ - result_xj = this.jspElementService.getValue(unitXj.get(0).getId(),time,jsp_id); - } - model.addAttribute("result","{\"rows\":" + result + ",\"beijiang\":" + result_bj + ",\"xijiang\":" + result_xj + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/getSmartImgData.do") - public ModelAndView getSmartImgData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - String bizid = request.getParameter("bizid"); - String jsp_id = request.getParameter("jsp_id"); - - model.addAttribute("result","{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - @RequestMapping("/showCompany4Select.do") - public ModelAndView showCompany4Select(HttpServletRequest request,Model model){ - return new ModelAndView("user/company4select"); - } - @RequestMapping("/getMonitorData.do") - public ModelAndView getMonitorData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - result = this.jspElementService.getValueAndHisForMonth(bizid,time,jsp_id,request); - model.addAttribute("result","{\"rows\":" + result + "}"); - return new ModelAndView("result"); - } - /* - * 配置监测点 - * */ - @RequestMapping("/monitor.do") - public ModelAndView monitor(HttpServletRequest request,Model model){ - return new ModelAndView("visual/monitor"); - } - @RequestMapping("/monitorEdit.do") - public ModelAndView monitorEdit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - JspElement jspElement = this.jspElementService.selectById(id); - model.addAttribute("jspElement", jspElement); - List unitBj = unitService.selectListByWhere("where name like '%北江%' "); - if(unitBj!=null && unitBj.size()>0 && jspElement!=null){ - List visualCacheData = this.visualCacheDataService.selectListByWhere("where dataName='"+jspElement.getValueUrl() - +"' and unitId='"+unitBj.get(0).getId()+"' order by insdt desc"); - if(visualCacheData!=null && visualCacheData.size()>0){ - model.addAttribute("visualCacheData", visualCacheData.get(0)); - } - } - return new ModelAndView("visual/monitorEdit"); - } - /* - * 监测点树形结构, - * */ - @RequestMapping("/monitorGetTreeJson.do") - public ModelAndView monitorGetTreeJson(HttpServletRequest request,Model model){ - String jsp_id = request.getParameter("jsp_id"); - String wherestr ="where 1=1 "; - if (null!=jsp_id && !"".equals(jsp_id)) { - wherestr += " and pid like '%"+jsp_id+"%' "; - } - String orderString = " order by morder"; - List list = this.jspElementService.selectListByWhere(wherestr+orderString); - JSONArray list_result = new JSONArray(); - JSONObject map = new JSONObject(); - if(list!=null && list.size()>0){ - JSONArray childlist_pressure = new JSONArray(); - JSONArray childlist_flow = new JSONArray(); - for(JspElement k: list) { - map = new JSONObject(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - if("monitor_pressure".equals(k.getPid())){ - childlist_pressure.add(map); - } - if("monitor_flow".equals(k.getPid())){ - childlist_flow.add(map); - } - } - JSONObject state = new JSONObject(); - state.put("disabled", true); - - map = new JSONObject(); - map.put("id", "monitor_pressure"); - map.put("text", "压力"); - map.put("pid", "-1"); - map.put("state", state); - map.put("nodes", childlist_pressure); - list_result.add(map); - map = new JSONObject(); - map.put("id", "monitor_flow"); - map.put("text", "流量"); - map.put("pid", "-1"); - map.put("state", state); - map.put("nodes", childlist_flow); - list_result.add(map); - } - Result result = Result.success(list_result); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - /** - * 删除多条配置参数 - */ - @RequestMapping("/monitorDeletes.do") - public ModelAndView domonitordels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String unitId = request.getParameter("unitId"); - ids=ids.replace(",","','"); - int result = this.jspElementService.deleteByWhere("where id in ('"+ids+"')"); - result = this.visualCacheDataService.deleteByWhere("where id in ('"+ids+"') and unitId='"+unitId+"' ") ; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - /** - * 更新配置参数数据 - */ - @RequestMapping("/monitorUpdate.do") - public ModelAndView domonitorupdate(HttpServletRequest request,Model model, - @ModelAttribute("jspElement") JspElement jspElement){ - User cu= (User)request.getSession().getAttribute("cu"); - String value = request.getParameter("value"); - String mpcode = request.getParameter("mpcode"); - String unitId = request.getParameter("unitId"); - int result = 0; - List unitBj = unitService.selectListByWhere("where name like '%北江%' "); - if(unitBj!=null && unitBj.size()>0){ - unitId = unitBj.get(0).getId(); - } - if(jspElement.getId()!=null && !jspElement.getId().isEmpty()){ - JspElement jspElementOLD = this.jspElementService.selectById(jspElement.getId()); - jspElement.setInsdt(CommUtil.nowDate()); - jspElement.setInsuser(cu.getId()); - jspElement.setValueUrl(jspElement.getName()+jspElement.getElementCode()); - result = this.jspElementService.update(jspElement); - if(result==1){ - List visualCacheDatas = this.visualCacheDataService.selectListByWhere("where id='"+jspElementOLD.getId() - +"' and unitId='"+unitId+"' order by insdt desc"); - if(visualCacheDatas!=null && visualCacheDatas.size()>0){ - VisualCacheData visualCacheData = visualCacheDatas.get(0); - visualCacheData.setDataname(jspElement.getValueUrl()); - visualCacheData.setMorder(jspElement.getMorder()); - visualCacheData.setMpcode(mpcode); - if(value!=null && !value.isEmpty()){ - //验证是否为数字 - Boolean strResult = value.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if(strResult == true) { - visualCacheData.setValue(Double.parseDouble(value)); - } - } - result = this.visualCacheDataService.update(visualCacheData); - }else{ - //没有则新增 - VisualCacheData visualCacheData = new VisualCacheData(); - visualCacheData.setId(jspElement.getId()); - visualCacheData.setDataname(jspElement.getValueUrl()); - visualCacheData.setUnitid(unitBj.get(0).getId()); - visualCacheData.setMorder(jspElement.getMorder()); - visualCacheData.setMpcode(mpcode); - if(value!=null && !value.isEmpty()){ - //验证是否为数字 - Boolean strResult = value.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if(strResult == true) { - visualCacheData.setValue(Double.parseDouble(value)); - } - } - result = this.visualCacheDataService.save(visualCacheData); - } - } - }else{ - jspElement.setId(CommUtil.getUUID()); - jspElement.setInsdt(CommUtil.nowDate()); - jspElement.setInsuser(cu.getId()); - jspElement.setElementCode(jspElement.getId()); - jspElement.setValueUrl(jspElement.getName()+jspElement.getElementCode()); - result = this.jspElementService.save(jspElement); - if(result==1){ - //新增 - VisualCacheData visualCacheData = new VisualCacheData(); - visualCacheData.setId(jspElement.getId()); - visualCacheData.setDataname(jspElement.getValueUrl()); - visualCacheData.setUnitid(unitId); - visualCacheData.setMorder(jspElement.getMorder()); - visualCacheData.setMpcode(mpcode); - if(value!=null && !value.isEmpty()){ - //验证是否为数字 - Boolean strResult = value.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if(strResult == true) { - visualCacheData.setValue(Double.parseDouble(value)); - } - } - result = this.visualCacheDataService.save(visualCacheData); - } - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+jspElement.getId()+"\"}"; - model.addAttribute("result", resstr); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/visual/VisualJspController.java b/src/com/sipai/controller/visual/VisualJspController.java deleted file mode 100644 index c0e6b1cd..00000000 --- a/src/com/sipai/controller/visual/VisualJspController.java +++ /dev/null @@ -1,385 +0,0 @@ -package com.sipai.controller.visual; - - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - - - - - - - - - - - - - - - - - - - - - - - - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentPoint; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.Layout; -import com.sipai.entity.visual.VisualJsp; -import com.sipai.entity.work.Camera; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.DataTypeService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.visual.VisualJspService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/visualjsp") -public class VisualJspController { - @Resource - private VisualJspService visualJspService; - @Resource - private JspElementService jspElementService; - @Resource - private CameraService cameraService; - @Resource - private DataTypeService dataTypeService; - @Resource - private MPointService mPointService; - @Resource - private UnitService unitService; - - @RequestMapping("/showJspList.do") - public String showJspList(HttpServletRequest request,Model model){ - return "visual/jspList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " name "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and id in('"+ids.replace(",", "','")+"')"; - } - PageHelper.startPage(page, rows); - List list = this.visualJspService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getJspElementList.do") - public ModelAndView getJspElementList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " morder,name "; - } - if(order==null){ - order = " asc "; - } - - String orderstr=" order by "+sort+" "+order; - - - String wherestr=" where 1=1 "; - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and pid = '"+request.getParameter("pid")+"' "; - } - if(request.getParameter("dataType")!=null && !request.getParameter("dataType").isEmpty()){ - wherestr += " and data_type = '"+request.getParameter("dataType")+"' "; - } - if(request.getParameter("checkedIds")!=null && !request.getParameter("checkedIds").isEmpty()){ - String checkedIds=request.getParameter("checkedIds"); - //格式化ids - String[] idArray =checkedIds.split(","); - String ids =""; - for (String str : idArray) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=str; - } - wherestr+=" and id in('"+ids.replace(",", "','")+"')"; - } - PageHelper.startPage(page, rows); - List list = this.jspElementService.selectListByWhere(wherestr+orderstr); - //获取摄像头 - for(int i=0;i pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - - /** - * 打开新增jsp - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - return "visual/jspAdd"; - } - - /** - * 打开编辑jsp - * @param request - * @param model - * @return - */ - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - VisualJsp visualJsp = this.visualJspService.selectById(id); - model.addAttribute("visualJsp", visualJsp); - return "visual/jspEdit"; - } - - /** - * 保存布局 - */ - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("visualJsp") VisualJsp visualJsp){ - User cu= (User)request.getSession().getAttribute("cu"); - visualJsp.setId(CommUtil.getUUID()); - visualJsp.setInsuser(cu.getId()); - visualJsp.setInsdt(CommUtil.nowDate()); - int result = this.visualJspService.save(visualJsp); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visualJsp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除jsp - * @param request - * @param model - * @param id 布局id - * @return - */ - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.visualJspService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新jsp - * @param request - * @param model - * @param visualJsp - * @return - */ - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute VisualJsp visualJsp){ - User cu= (User)request.getSession().getAttribute("cu"); - visualJsp.setInsuser(cu.getId()); - visualJsp.setInsdt(CommUtil.nowDate()); - int result = this.visualJspService.update(visualJsp); - String resstr="{\"res\":\""+result+"\",\"id\":\""+visualJsp.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 打开新增jsp元素 - */ - @RequestMapping("/doaddJspElement.do") - public String doaddJspElement(HttpServletRequest request,Model model){ -// String id = CommUtil.getUUID(); -// model.addAttribute("id",id); - String pid = request.getParameter("pid"); - model.addAttribute("pid",pid); - return "visual/jspElementAdd"; - } - - /** - * 打开编辑jsp元素 - * @param request - * @param model - * @return - */ - @RequestMapping("/doeditJspElement.do") - public String doeditJspElement(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - JspElement jspElement = this.jspElementService.selectById(id); - //获取摄像头 -// if(jspElement.getCameraId()!=null&&!jspElement.getCameraId().equals("")){ -// Camera camera = this.cameraService.selectById(jspElement.getCameraId()); -// if(camera != null){ -// jspElement.setCamera(camera); -// } -// } - model.addAttribute("jspElement", jspElement); - return "visual/jspElementEdit"; - } - - /** - * 保存布局元素 - */ - @RequestMapping("/dosaveJspElement.do") - public String dosaveJspElement(HttpServletRequest request,Model model, - @ModelAttribute("JspElement") JspElement jspElement){ - User cu= (User)request.getSession().getAttribute("cu"); - jspElement.setId(CommUtil.getUUID()); - jspElement.setInsuser(cu.getId()); - jspElement.setInsdt(CommUtil.nowDate()); - int result = this.jspElementService.save(jspElement); - String resstr="{\"res\":\""+result+"\",\"id\":\""+jspElement.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 删除jsp元素 - * @param request - * @param model - * @param id 布局元素id - * @return - */ - @RequestMapping("/dodeleteJspElement.do") - public String dodeleteJspElement(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.jspElementService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - /** - * 更新jsp元素 - * @param request - * @param model - * @param jspElement - * @return - */ - @RequestMapping("/doupdateJspElement.do") - public String doupdateJspElement(HttpServletRequest request,Model model, - @ModelAttribute JspElement jspElement){ - User cu= (User)request.getSession().getAttribute("cu"); - jspElement.setInsuser(cu.getId()); - jspElement.setInsdt(CommUtil.nowDate()); - int result = this.jspElementService.update(jspElement); - String resstr="{\"res\":\""+result+"\",\"id\":\""+jspElement.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 模块选择 - * @param request - * @param model - * @return - */ - @RequestMapping("/showJSPForSelect.do") - public String showLayoutForSelect(HttpServletRequest request,Model model){ - return "visual/jsp4Select"; - } - - /** - * 编辑测量点值 - * @param request - * @param model - * @return - */ - @RequestMapping("/editMPoint.do") - public String editMPoint(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - String bizId = cu.getPid(); - Company company = this.unitService.getCompById(bizId); - model.addAttribute("company", company); - String id = request.getParameter("id"); - MPoint mPoint = this.mPointService.selectById(bizId,id); - model.addAttribute("mPoint", mPoint); - return "visual/mPointVisualEdit"; - } - - @RequestMapping("/openJspCode.do") - public String openJspCode(HttpServletRequest request,Model model){ - String jspCode=request.getParameter("jspCode"); - - return "visual/modules/"+jspCode+""; - } - -} diff --git a/src/com/sipai/controller/visual/ZengChengController.java b/src/com/sipai/controller/visual/ZengChengController.java deleted file mode 100644 index 76f38963..00000000 --- a/src/com/sipai/controller/visual/ZengChengController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.controller.visual; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UnitService; -import com.sipai.service.visual.JspElementService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/zengCheng") -public class ZengChengController { - - @Resource - private JspElementService jspElementService; - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - - @RequestMapping("/zengCheng.do") - public ModelAndView zengCheng(HttpServletRequest request,Model model) { - return new ModelAndView("visual/zengCheng"); - } - @RequestMapping("/zengChengFactory.do") - public ModelAndView zengChengFactory(HttpServletRequest request,Model model) { - String unitSname = request.getParameter("unitSname"); - if(unitSname!=null && !unitSname.isEmpty()){ - model.addAttribute("unitSname",unitSname); - } - return new ModelAndView("visual/zengChengFactory"); - } - @RequestMapping("/zengChengCompany.do") - public ModelAndView zengChengCompany(HttpServletRequest request,Model model) { - String unitSname = request.getParameter("unitSname"); - if(unitSname!=null && !unitSname.isEmpty()){ - model.addAttribute("unitSname",unitSname); - } - return new ModelAndView("visual/zengChengCompany"); - } - - @RequestMapping("/judgeZengCheng4UnitType.do") - public ModelAndView judgeZengCheng4UnitType(HttpServletRequest request,Model model) { - String result= "/zengCheng/zengChengFactory.do"; - String bizid = request.getParameter("bizid"); - Unit unit = this.unitService.getUnitById(bizid); - if(unit!=null && unit.getType()!=null){ - if(unit.getType().equals(CommString.UNIT_TYPE_BIZ)){ - //水厂 - result= "/zengCheng/zengChengFactory.do?unitSname="+unit.getName(); - }else{ - if(unit.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - //公司 - result= "/zengCheng/zengChengCompany.do?unitSname="+unit.getName(); - } - } - } - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getZengChengData.do") - public ModelAndView getZengChengData(HttpServletRequest request,Model model) { - JSONArray result= new JSONArray(); - String bizid = request.getParameter("bizid"); - String time = request.getParameter("time"); - String jsp_id = request.getParameter("jsp_id"); - result = this.jspElementService.getValue(bizid,time,jsp_id); - - JSONObject jsonObject_children = new JSONObject(); - JSONArray jsonArray_children = new JSONArray(); - //返回 区控中心(R)、厂区(F\B) - List companylistm = this.companyService.selectListByWhere("where type in ('B','R','F') and pid='"+bizid+"' order by morder"); - if(companylistm!=null && companylistm.size()>0){ - for(int i=0;i companylistm = this.companyService.selectListByWhere("where type in ('B','R','F') and pid='"+bizid+"' order by morder"); - if(companylistm!=null && companylistm.size()>0){ - for(int i=0;i list = this.equipmentCardLinksService.selectListByWhere(whereStr,null, request); - if(list!=null && list.size()>0){ - EquipmentCardLinks equipmentCardLinks = list.get(0); - if(equipmentCardLinks!=null){ - if(equipmentCardLinks.getLinkUrl()!=null){ - //配置接口信息 - url = equipmentCardLinks.getLinkUrl(); - } - if(equipmentCardLinks.getLinksParameterList()!=null){ - //配置参数信息 - List parameters = equipmentCardLinks.getLinksParameterList(); - if(parameters.size()>0){ - JSONObject object = new JSONObject(); - for(EquipmentCardLinksParameter parameter: parameters){ - object.put(parameter.getParameter(), parameter.getParameterValue()); - } - json = object.toJSONString(); - } - } - } - } - } - HttpClient httpClient = new DefaultHttpClient(); - HttpPost post = new HttpPost(url); - StringEntity postingString = null; - String token = ""; - JSONObject jsonstr = new JSONObject(); - try { - postingString = new StringEntity(json); - post.setEntity(postingString); - post.setHeader("Content-type", "application/json"); - HttpResponse response = httpClient.execute(post); - String content = EntityUtils.toString(response.getEntity()); - JSONObject jsonObject = JSONObject.parseObject(content); - - JSONObject jsonObject2 = JSONObject.parseObject(jsonObject.get("data").toString()); - jsonstr.put("token", jsonObject2.get("token")); - jsonstr.put("expirationTime", jsonObject2.get("expirationTime")); - jsonstr.put("stationId", stationId); - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", jsonstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/whp/HYSHomePageController.java b/src/com/sipai/controller/whp/HYSHomePageController.java deleted file mode 100644 index e194d555..00000000 --- a/src/com/sipai/controller/whp/HYSHomePageController.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.controller.whp; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.servlet.http.HttpServletRequest; - -@Controller -@RequestMapping("/whp/HYSHomePage") -public class HYSHomePageController { - - @RequestMapping("/homePage.do") - public String showListForTest(HttpServletRequest request, Model model) { - - return "whp/HYSHomePage"; - } - -} diff --git a/src/com/sipai/controller/whp/baseinfo/TestController.java b/src/com/sipai/controller/whp/baseinfo/TestController.java deleted file mode 100644 index 86e8b68c..00000000 --- a/src/com/sipai/controller/whp/baseinfo/TestController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - - -import com.sipai.service.whp.baseinfo.WhpTestOrgService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - - - - - - -/** - * @author 28415 - */ -@Controller -@RequestMapping("/whp/baseinfo/Test") -public class TestController { - @Resource - private WhpTestOrgService testOrgService; - - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model){ - - return "whp/text/Test"; - } - @RequestMapping("/showListWatch.do") - public String showListWatch(HttpServletRequest request,Model model){ - return "whp/text/Watch"; - } -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpEquipmentController.java b/src/com/sipai/controller/whp/baseinfo/WhpEquipmentController.java deleted file mode 100644 index e5cc511d..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpEquipmentController.java +++ /dev/null @@ -1,229 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.*; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; -import com.sipai.service.whp.baseinfo.WhpEquipmentService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 设备管理Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpEquipment") -public class WhpEquipmentController { - - @Resource - private WhpEquipmentService whpEquipmentService; - - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - model.addAttribute("addressConditionDropDown", JSON.toJSONString( whpEquipmentService.addressDropDownList())); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpEquipmentList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpEquipmentQuery query - ) { - - PageHelper.startPage(page, rows); - List list = whpEquipmentService.queryList(query); - List voList = new ArrayList<>(); - // 编辑列表需要的字段 - for (WhpEquipment item : list) { - WhpEquipmentVo vo = new WhpEquipmentVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - - ) { - - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpEquipmentAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpEquipment bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpEquipmentService.bizCheck(bean); - whpEquipmentService.save(bean); - - - return Result.success(); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpEquipment whpEquipment = whpEquipmentService.selectById(id); - model.addAttribute("bean", whpEquipment); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpEquipmentEdit"; - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpEquipment bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpEquipmentService.bizCheck(bean); - whpEquipmentService.update(bean); - - - return Result.success(); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - - for(String id:ids.split(",")){ - List whpSamplingPlanTaskTestConfirms = whpSamplingPlanTaskTestConfirmService.selectListByWhere(" where equipment_id='"+ id+"' order by id desc"); - if(whpSamplingPlanTaskTestConfirms.size()>0){ - return Result.failed("该设备已经绑定检测任务,不允许删除!"); - } - } - - - ids = ids.replace(",", "','"); - whpEquipmentService.deleteByWhere("where id in ('" + ids + "')"); - - return Result.success(); - } - - /** - * 获取设备单条记录 - * - * @Author: zxq - * @Date: 2023/2/2 - **/ - @GetMapping("/getOne") - @ResponseBody - public Result getOne(HttpServletRequest request, Model model, - String id - ) { - WhpEquipment whpEquipment = whpEquipmentService.selectById(id); - return Result.success(whpEquipment); - } - - - @RequestMapping("/WhpEquipmentForOneSelect.do") - public String userForOneSelect(HttpServletRequest request, Model model) { - model.addAttribute("addressConditionDropDown", JSON.toJSONString( whpEquipmentService.addressDropDownList())); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - String equipmentId = request.getParameter("equipmentId"); - model.addAttribute("equipmentId", equipmentId); - return "whp/baseinfo/WhpEquipmentForOneSelect"; - } - - @RequestMapping("/getwhpEquipmentByIds.do") - public String getUsersByIds(HttpServletRequest request, Model model) { - String equipmentIds = request.getParameter("equipmentIds"); - List list = this.whpEquipmentService.selectListByWhere("where id in ('" + equipmentIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + equipmentIds + ",')"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - @Resource - private WhpSamplingPlanTaskTestConfirmService whpSamplingPlanTaskTestConfirmService; - -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpLiquidWasteDisposeOrgController.java b/src/com/sipai/controller/whp/baseinfo/WhpLiquidWasteDisposeOrgController.java deleted file mode 100644 index 484e56d3..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpLiquidWasteDisposeOrgController.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrg; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrgQuery; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrgVo; -import com.sipai.service.whp.baseinfo.WhpLiquidWasteDisposeOrgService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 废液处理机构Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpLiquidWasteDisposeOrg") -public class WhpLiquidWasteDisposeOrgController { - - @Resource - private WhpLiquidWasteDisposeOrgService whpLiquidWasteDisposeOrgService; - - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpLiquidWasteDisposeOrgList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpLiquidWasteDisposeOrgQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpLiquidWasteDisposeOrgService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpLiquidWasteDisposeOrg item : list) { - WhpLiquidWasteDisposeOrgVo vo = new WhpLiquidWasteDisposeOrgVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - - ) { - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - - return "whp/baseinfo/WhpLiquidWasteDisposeOrgAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpLiquidWasteDisposeOrg bean - ) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = whpLiquidWasteDisposeOrgService.uniqueCheck(bean); - if (result.getCode() == Result.SUCCESS) { - whpLiquidWasteDisposeOrgService.save(bean); - return Result.success(); - } else { - return result; - } - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpLiquidWasteDisposeOrg whpLiquidWasteDisposeOrg = whpLiquidWasteDisposeOrgService.selectById(id); - model.addAttribute("bean", whpLiquidWasteDisposeOrg); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpLiquidWasteDisposeOrgEdit"; - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpLiquidWasteDisposeOrg bean - ) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = whpLiquidWasteDisposeOrgService.uniqueCheck(bean); - if (result.getCode() == Result.SUCCESS) { - whpLiquidWasteDisposeOrgService.update(bean); - return Result.success(); - } else { - return result; - } - } - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - whpLiquidWasteDisposeOrgService.deleteByWhere("where id in ('" + ids + "')"); - return Result.success(); - } - -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpResidualSampleDisposeTypeController.java b/src/com/sipai/controller/whp/baseinfo/WhpResidualSampleDisposeTypeController.java deleted file mode 100644 index b0fe049d..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpResidualSampleDisposeTypeController.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeType; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeTypeQuery; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeTypeVo; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; -import com.sipai.service.whp.baseinfo.WhpResidualSampleDisposeTypeService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 余样处置方式Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpResidualSampleDisposeType") -public class WhpResidualSampleDisposeTypeController { - - @Resource - private WhpResidualSampleDisposeTypeService whpResidualSampleDisposeTypeService; - - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpResidualSampleDisposeTypeList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpResidualSampleDisposeTypeQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpResidualSampleDisposeTypeService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpResidualSampleDisposeType item : list) { - WhpResidualSampleDisposeTypeVo vo = new WhpResidualSampleDisposeTypeVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - - ) { - - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpResidualSampleDisposeTypeAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpResidualSampleDisposeType bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpResidualSampleDisposeTypeService.bizCheck(bean); - whpResidualSampleDisposeTypeService.save(bean); - - - return Result.success(); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpResidualSampleDisposeType whpResidualSampleDisposeType = whpResidualSampleDisposeTypeService.selectById(id); - model.addAttribute("bean", whpResidualSampleDisposeType); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpResidualSampleDisposeTypeEdit"; - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpResidualSampleDisposeType bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpResidualSampleDisposeTypeService.bizCheck(bean); - whpResidualSampleDisposeTypeService.update(bean); - - - return Result.success(); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - - for(String id:ids.split(",")){ - List list = whpSamplingPlanTaskService.selectListByWhere(" where sample_type_id='"+ id+"' order by id desc"); - if(list.size()>0){ - return Result.failed("该处置类型已经被使用,不允许删除!"); - } - } - - ids = ids.replace(",", "','"); - whpResidualSampleDisposeTypeService.deleteByWhere("where id in ('" + ids + "')"); - - return Result.success(); - } - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpSampleCodeController.java b/src/com/sipai/controller/whp/baseinfo/WhpSampleCodeController.java deleted file mode 100644 index be3c87e6..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpSampleCodeController.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpSampleCode; -import com.sipai.entity.whp.baseinfo.WhpSampleCodeQuery; -import com.sipai.entity.whp.baseinfo.WhpSampleCodeVo; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import com.sipai.service.whp.baseinfo.WhpSampleCodeService; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.baseinfo.WhpTestItemService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * 采样编码Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpSampleCode") -public class WhpSampleCodeController { - - @Resource - private WhpSampleCodeService whpSampleCodeService; - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpTestItemService whpTestItemService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - List enumJsonObjects = new ArrayList<>(); - enumJsonObjects.add(new EnumJsonObject("","所有采样类型","","")); - List dropDownList = whpSampleTypeService.dropDownList(); - enumJsonObjects.addAll(dropDownList); - model.addAttribute("sampleTypeDropDown", JSON.toJSONString(enumJsonObjects)); - return "whp/baseinfo/WhpSampleCodeList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSampleCodeQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpSampleCodeService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSampleCode item : list) { - WhpSampleCodeVo vo = new WhpSampleCodeVo(); - BeanUtils.copyProperties(item, vo); - // 此处加工Vo数据 - vo.setTestItemNames(whpTestItemService.getTestItemNamesByIds(item.getTestItemIds())); - WhpSampleType whpSampleType = whpSampleTypeService.selectById(item.getTypeId()); - vo.setSampleTypeName(whpSampleType==null?"未知检测项目":whpSampleType.getName()); - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - , String selectedSampleTypeId - ) { - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - // 检测项目下拉 - model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); - // 树选中的采样类型id - model.addAttribute("sampleTypeDefaultId", selectedSampleTypeId); - // 样品类别下拉 - model.addAttribute("sampleTypeDropDownList", JSON.toJSONString(whpSampleTypeService.dropDownList())); - - return "whp/baseinfo/WhpSampleCodeAdd"; - } - - - /** - * 采样车间回显数据 - * - * @Author: ZLY - * @Date: 2024年1月15日18:13:09 - **/ - @RequestMapping("/showdept.do") - @ResponseBody - public ModelAndView doshowdept(HttpServletRequest request, Model model - , String typeId - ) { - WhpSampleType whpSampleType = whpSampleTypeService.selectById(typeId); - String result = JSON.toJSONString(whpSampleType); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpSampleCode bean - ) throws BizCheckException { - -// Result r1 = whpSampleCodeService.bizCheck(bean); -// if(r1.getCode() == 0){ -// return r1; -// } - whpSampleCodeService.bizCheck(bean); - whpSampleCodeService.save(bean); - - return Result.success(); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpSampleCode whpSampleCode = whpSampleCodeService.selectById(id); - model.addAttribute("bean", whpSampleCode); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - // 检测项目下拉 - model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); - // 样品类别下拉 - model.addAttribute("sampleTypeDropDownList", JSON.toJSONString(whpSampleTypeService.dropDownList())); - return "whp/baseinfo/WhpSampleCodeEdit"; - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpSampleCode bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpSampleCodeService.bizCheck(bean); - whpSampleCodeService.update(bean); - - - System.out.println("ddddd"); - - return Result.success(); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - - ids = ids.replace(",", "','"); - whpSampleCodeService.deleteByWhere("where id in ('" + ids + "')"); - - return Result.success(); - } - -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpSampleTypeController.java b/src/com/sipai/controller/whp/baseinfo/WhpSampleTypeController.java deleted file mode 100644 index ab89eff1..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpSampleTypeController.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -//import com.sipai.entity.enums.whp.AmplingPeriodEnum; -import com.sipai.entity.enums.whp.AmplingPeriodEnum; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpSampleCode; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import com.sipai.entity.whp.baseinfo.WhpSampleTypeQuery; -import com.sipai.entity.whp.baseinfo.WhpSampleTypeVo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.service.whp.baseinfo.WhpSampleCodeService; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 采样类型Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpSampleType") -public class WhpSampleTypeController { - - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpSampleCodeService whpSampleCodeService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpSampleTypeList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSampleTypeQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpSampleTypeService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSampleType item : list) { - WhpSampleTypeVo vo = new WhpSampleTypeVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - if (item.getAmplingPeriod() != null) { - vo.setAmplingPeriodName(AmplingPeriodEnum.getNameByid(item.getAmplingPeriod())); - - - } - - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - ) { - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("amplingPeriodEnumDropDown", AmplingPeriodEnum.getAll4JSON()); - return "whp/baseinfo/WhpSampleTypeAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpSampleType bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - whpSampleTypeService.bizCheck(bean); - whpSampleTypeService.save(bean); - return Result.success(); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpSampleType whpSampleType = whpSampleTypeService.selectById(id); - model.addAttribute("bean", whpSampleType); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("amplingPeriodEnumDropDown", AmplingPeriodEnum.getAll4JSON()); - return "whp/baseinfo/WhpSampleTypeEdit"; - } - - /** - * 获取单条记录 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @GetMapping("/getOne") - @ResponseBody - public Result getOne(HttpServletRequest request, Model model, - String id - ) { - WhpSampleType whpSampleType = whpSampleTypeService.selectById(id); - return Result.success(whpSampleType); - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpSampleType bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpSampleTypeService.bizCheck(bean); - whpSampleTypeService.update(bean); - - return Result.success(); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - for (String id : ids.split(",")) { - List list = whpSampleCodeService.selectListByWhere(" where type_id='" + id + "' order by id desc"); - if (list.size() > 0) { - return Result.failed("该样品类型已经被使用,不允许删除!"); - } - } - ids = ids.replace(",", "','"); - whpSampleTypeService.deleteByWhere("where id in ('" + ids + "')"); - - return Result.success(); - } - - - //获取采样类型树 - @RequestMapping("/getSampleTypeDropDown.do") - public String getSampleTypeDropDown(HttpServletRequest request, Model model) { - JSONArray json = JSONArray.fromObject(whpSampleTypeService.dropDownList()); - model.addAttribute("result", json); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpTestItemController.java b/src/com/sipai/controller/whp/baseinfo/WhpTestItemController.java deleted file mode 100644 index c7b8f540..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpTestItemController.java +++ /dev/null @@ -1,249 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.enums.whp.TestCurveFormulatypeEnum; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.*; - -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.whp.baseinfo.WhpEquipmentService; -import com.sipai.service.whp.baseinfo.WhpSampleCodeService; -import com.sipai.service.whp.baseinfo.WhpTestItemService; -import com.sipai.service.whp.baseinfo.WhpTestItemWorkingCurveService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 检测项目Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpTestItem") -public class WhpTestItemController { - - @Resource - private WhpTestItemService whpTestItemService; - @Resource - private WhpTestItemWorkingCurveService whpTestItemWorkingCurveService; - @Resource - private WhpEquipmentService whpEquipmentService; - @Resource - private UnitService unitService; - - @Resource - private MPointService mPointService; - @Resource - private WhpSampleCodeService whpSampleCodeService; - - - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - - // 检测部门下拉 - model.addAttribute("deptDropDown", JSON.toJSONString(whpTestItemService.testOrgDropDownList())); - // 状态部门下拉 - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpTestItemList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpTestItemQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpTestItemService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpTestItem item : list) { - WhpTestItemVo vo = new WhpTestItemVo(); - BeanUtils.copyProperties(item, vo); - // 此处加工Vo数据 - WhpTestItemWorkingCurve curve=whpTestItemWorkingCurveService.selectByTestItemId(item.getId()); - if(curve.getKpi_id()!=null) - { - // - MPoint mPoint= mPointService.selectById(curve.getKpi_id()); - if(mPoint!=null) - { - vo.setWorkingCurveStr(mPoint.getExp()); - } - - - } - - vo.setEquipmentName(whpEquipmentService.selectNamesByIds(item.getEquipmentId())); - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - ) { - String companyId = request.getParameter("unitId"); - Company company = this.unitService.getCompById(companyId); - String id = company.getEname()+"-YJDJ-"+ CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - model.addAttribute("id",id); - model.addAttribute("company",company); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("equipmentDropDown", JSON.toJSONString(whpEquipmentService.equipmentDropDownList())); - return "whp/baseinfo/WhpTestItemAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpTestItem bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpTestItemService.bizCheck(bean); - whpTestItemService.save(bean); - - - return Result.success(); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpTestItem whpTestItem = whpTestItemService.selectById(id); - WhpTestItemVo vo = new WhpTestItemVo(); - whpTestItem.setCompany(this.unitService.getCompById(whpTestItem.getBizId())); - BeanUtils.copyProperties(whpTestItem, vo); - - vo.setEquipmentName(whpEquipmentService.selectNamesByIds(whpTestItem.getEquipmentId())); - model.addAttribute("bean", vo); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getAll4JSON()); - model.addAttribute("equipmentDropDown", JSON.toJSONString(whpEquipmentService.equipmentDropDownList())); - - - - - - return "whp/baseinfo/WhpTestItemEdit"; - } - - - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpTestItem bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - - whpTestItemService.bizCheck(bean); - whpTestItemService.update(bean); - - - return Result.success(); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - for(String id:ids.split(",")){ - List list = whpSampleCodeService.selectListByWhere(" where test_item_ids like'%"+ id+"%' order by id desc"); - if(list.size()>0){ - return Result.failed("该检测项目已经被使用,不允许删除!"); - } - } - ids = ids.replace(",", "','"); - whpTestItemService.deleteByWhere("where id in ('" + ids + "')"); - - return Result.success(); - } - -} diff --git a/src/com/sipai/controller/whp/baseinfo/WhpTestItemWorkingCurveController.java b/src/com/sipai/controller/whp/baseinfo/WhpTestItemWorkingCurveController.java deleted file mode 100644 index 3815755b..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpTestItemWorkingCurveController.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.controller.whp.baseinfo; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sipai.entity.base.Result; import com.sipai.controller.exception.BizCheckException; import com.sipai.entity.enums.EnableTypeEnum; import com.sipai.entity.enums.whp.TestCurveFormulatypeEnum; import com.sipai.entity.scada.MPoint; import com.sipai.entity.scada.MPointFormula; import com.sipai.entity.scada.MPointPropSource; import com.sipai.entity.whp.baseinfo.*; import com.sipai.entity.user.User; import com.sipai.service.scada.MPointFormulaService; import com.sipai.service.scada.MPointPropSourceService; import com.sipai.service.scada.MPointService; import com.sipai.service.whp.baseinfo.*; import com.sipai.entity.base.Result; import com.sipai.service.user.UserService; import com.sipai.tools.DateUtil; import net.sf.json.JSONArray; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; /** * 方法依据Controller类 * * @Author: zxq * @Date: 2023/05/15 **/ @Controller @RequestMapping("/whp/baseinfo/WhpTestItemWorkingCurve") public class WhpTestItemWorkingCurveController { @Resource private WhpTestItemWorkingCurveService whpTestItemWorkingCurveService; @Resource private MPointService mPointService; @Resource private MPointFormulaService mPointFormulaService; @Resource private MPointPropSourceService mPointPropSourceService; /** * 页面跳转:列表页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/showList.do") public String showList(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); return "whp/baseinfo/WhpTestItemWorkingCurveList"; } /** * 获取列表 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/getList.do") public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpTestItemWorkingCurveQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); PageHelper.startPage(page, rows); List list = whpTestItemWorkingCurveService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpTestItemWorkingCurve item : list) { WhpTestItemWorkingCurveVo vo = new WhpTestItemWorkingCurveVo(); BeanUtils.copyProperties(item, vo); if (item.getKpi_id() != null && !item.getKpi_id().equals("")) { MPoint mPoint = mPointService.selectById(item.getKpi_id()); if (mPoint != null) { vo.setMPoint(mPoint); } } else { MPoint mPoint = new MPoint(); mPoint.setParmname(item.getName()); mPoint.setDisname(item.getName()); mPoint.setUnit(item.getUnit()); vo.setMPoint(mPoint); } if (item.getFormulatype() != null) { vo.setFormulaName(TestCurveFormulatypeEnum.getNameByid(Integer.valueOf(item.getFormulatype()))); } vo.setDefaultValue(vo.getDefault_value()); // 此处加工Vo数据 voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 原始数据配置获取列表 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/getfamList.do") public ModelAndView getfamList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, String unitId,String kpi_id ) { User cu = (User) request.getSession().getAttribute("cu"); String sql=" where pid='"+kpi_id+"' order by index_details"; PageHelper.startPage(page, rows); // List list = mPointFormulaService.selectListByWhere(unitId,sql); List list = this.mPointPropSourceService.selectListByWhere(unitId,sql); PageInfo pi = new PageInfo(list); JSONArray json = JSONArray.fromObject(list); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 页面跳转:曲线新增页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/add.do") public String doadd(HttpServletRequest request, Model model, String test_item_id ) { System.out.println(TestCurveFormulatypeEnum.getForm4JSON()); model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getForm4JSON()); model.addAttribute("test_item_id", test_item_id); return "whp/baseinfo/WhpTestItemWorkingCurveAdd"; } /** * 页面跳转:调整曲线常量新增页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/constantadd.do") public String doconstantadd(HttpServletRequest request, Model model, String test_item_id) { //model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getAll4JSON()); model.addAttribute("test_item_id", test_item_id); return "whp/baseinfo/WhpTestItemWorkingConstantAdd"; } /** * 页面跳转:跳转 基础秒速增页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/basicadd.do") public String dobasicadd(HttpServletRequest request, Model model, String test_item_id) { //model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getAll4JSON()); model.addAttribute("test_item_id", test_item_id); return "whp/baseinfo/WhpTestItemBasicAdd"; } /** * 新增 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/save.do") @ResponseBody public Result dosave(HttpServletRequest request, Model model, WhpTestItemWorkingCurve bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpTestItemWorkingCurveService.bizCheck(bean); whpTestItemWorkingCurveService.save(bean); return Result.success(); } /** * 页面跳转:常量编辑页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/constantedit.do") public String doconstantedit(HttpServletRequest request, Model model, String id) { //model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getForm4JSON()); WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectById(id); WhpTestItemWorkingCurveVo vo = new WhpTestItemWorkingCurveVo(); BeanUtils.copyProperties(curve, vo); if (curve.getKpi_id() != null && !curve.getKpi_id().equals("")) { MPoint mPoint = mPointService.selectById(curve.getKpi_id()); if (mPoint != null) { vo.setMPoint(mPoint); } } model.addAttribute("bean", vo); return "whp/baseinfo/WhpTestItemWorkingConstantEdit"; } /* *//** * 页面跳转:基础描述编辑页面 * * @Author: zxq * @Date: 2023/05/15 **//* @RequestMapping("/basicedit.do") public String dobasicedit(HttpServletRequest request, Model model, String id ) { // model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getForm4JSON()); WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectById(id); WhpTestItemWorkingCurveVo vo = new WhpTestItemWorkingCurveVo(); BeanUtils.copyProperties(curve, vo); if(curve.getKpi_id()!=null&&!curve.getKpi_id().equals("")) { MPoint mPoint= mPointService.selectById(curve.getKpi_id()); if(mPoint!=null) { vo.setMPoint(mPoint); } } model.addAttribute("bean", vo); return "whp/baseinfo/WhpTestItemBasicEdit"; }*/ /** * 页面跳转:曲线编辑页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/edit.do") public String doedit(HttpServletRequest request, Model model, String id) { model.addAttribute("formulatypeDropDown", TestCurveFormulatypeEnum.getForm4JSON()); WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectById(id); WhpTestItemWorkingCurveVo vo = new WhpTestItemWorkingCurveVo(); BeanUtils.copyProperties(curve, vo); if (curve.getKpi_id() != null && !curve.getKpi_id().equals("")) { MPoint mPoint = mPointService.selectById(curve.getKpi_id()); if (mPoint != null) { vo.setMPoint(mPoint); } } model.addAttribute("bean", vo); if (curve.getFormulatype() != null && curve.getFormulatype().equals("0")) { return "whp/baseinfo/WhpTestItemBasicEdit"; } else { return "whp/baseinfo/WhpTestItemWorkingCurveEdit"; } } /** * 更新 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/update.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpTestItemWorkingCurve bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpTestItemWorkingCurveService.bizCheck(bean); whpTestItemWorkingCurveService.update(bean); return Result.success(); } /** * 批量删除 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/deletes.do") @ResponseBody public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { ids = ids.replace(",", "','"); whpTestItemWorkingCurveService.deleteByWhere("where id in ('" + ids + "')"); return Result.success(); } } \ No newline at end of file diff --git a/src/com/sipai/controller/whp/baseinfo/WhpTestMethodController.java b/src/com/sipai/controller/whp/baseinfo/WhpTestMethodController.java deleted file mode 100644 index 1a37a946..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpTestMethodController.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.controller.whp.baseinfo; import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sipai.entity.base.Result; import com.sipai.controller.exception.BizCheckException; import com.sipai.entity.enums.EnableTypeEnum; import com.sipai.entity.enums.whp.TestCurveFormulatypeEnum; import com.sipai.entity.user.Company; import com.sipai.entity.whp.baseinfo.*; import com.sipai.entity.user.User; import com.sipai.service.user.UnitService; import com.sipai.service.whp.baseinfo.*; import com.sipai.entity.base.Result; import com.sipai.service.user.UserService; import com.sipai.tools.DateUtil; import net.sf.json.JSONArray; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; /** * 方法依据Controller类 * * @Author: zxq * @Date: 2023/05/15 **/ @Controller @RequestMapping("/whp/baseinfo/WhpTestMethod") public class WhpTestMethodController { @Resource private WhpTestMethodService whpTestMethodService; @Resource private WhpTestItemService whpTestItemService; @Resource private UnitService unitService; /** * 页面跳转:列表页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/showList.do") public String showList(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); // 检测项目下拉 model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); return "whp/baseinfo/WhpTestMethodList"; } /** * 获取列表 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/getList.do") public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpTestMethodQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); PageHelper.startPage(page, rows); List list = whpTestMethodService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpTestMethod item : list) { WhpTestMethodVo vo = new WhpTestMethodVo(); BeanUtils.copyProperties(item, vo); vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); vo.setTestItemNames(whpTestItemService.getTestItemNamesByIds(item.getTestItem_id())); voList.add(vo); // 此处加工Vo数据 } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 页面跳转:新增页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/add.do") public String doadd(HttpServletRequest request, Model model ) { String companyId = request.getParameter("unitId"); Company company = this.unitService.getCompById(companyId); model.addAttribute("company",company); // 检测项目下拉 model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); // 启用下拉框 model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); return "whp/baseinfo/WhpTestMethodAdd"; } /** * 新增 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/save.do") @ResponseBody public Result dosave(HttpServletRequest request, Model model, WhpTestMethod bean) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpTestMethodService.bizCheck(bean); whpTestMethodService.save(bean); return Result.success(); } /** * 页面跳转:编辑页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/edit.do") public String doedit(HttpServletRequest request, Model model, String id ) { // 检测项目下拉 model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); // 启用下拉框 model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); WhpTestMethod whpTestMethod = whpTestMethodService.selectById(id); WhpTestMethodVo vo = new WhpTestMethodVo(); BeanUtils.copyProperties(whpTestMethod, vo); if (null != whpTestMethod.getBizId() && !whpTestMethod.getBizId().isEmpty()) { Company company = this.unitService.getCompById(whpTestMethod.getBizId()); vo.setCompany(company); } if(whpTestMethod.getTestItem_id()!=null) { vo.setTestItemNames(whpTestItemService.getTestItemNamesByIds(whpTestMethod.getTestItem_id())); } model.addAttribute("bean", vo); return "whp/baseinfo/WhpTestMethodEdit"; } /** * 更新 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/update.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpTestMethod bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpTestMethodService.bizCheck(bean); whpTestMethodService.update(bean); return Result.success(); } /** * 批量删除 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/deletes.do") @ResponseBody public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { ids = ids.replace(",", "','"); whpTestMethodService.deleteByWhere("where id in ('" + ids + "')"); return Result.success(); } @RequestMapping("/whpTestItemPop.do") public String unit4SelectModalLimitedCheck(HttpServletRequest request, Model model) { // 检测部门下拉 model.addAttribute("deptDropDown", JSON.toJSONString(whpTestItemService.testOrgDropDownList())); // 状态部门下拉 model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); return "whp/baseinfo/WhpTestItemPop"; } } \ No newline at end of file diff --git a/src/com/sipai/controller/whp/baseinfo/WhpTestOrgController.java b/src/com/sipai/controller/whp/baseinfo/WhpTestOrgController.java deleted file mode 100644 index 94846f2d..00000000 --- a/src/com/sipai/controller/whp/baseinfo/WhpTestOrgController.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.sipai.controller.whp.baseinfo; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpTestOrg; -import com.sipai.entity.whp.baseinfo.WhpTestOrgQuery; -import com.sipai.entity.whp.baseinfo.WhpTestOrgVo; -import com.sipai.service.whp.baseinfo.WhpTestOrgService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 检测机构Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ -@Controller -@RequestMapping("/whp/baseinfo/WhpTestOrg") -public class WhpTestOrgController { - - @Resource - private WhpTestOrgService testOrgService; - - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpTestOrgList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpTestOrgQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = testOrgService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpTestOrg item : list) { - WhpTestOrgVo vo = new WhpTestOrgVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(EnableTypeEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - - ) { - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - - return "whp/baseinfo/WhpTestOrgAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/save.do") - @ResponseBody - public Result dosave(HttpServletRequest request, Model model, WhpTestOrg bean - ) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = testOrgService.uniqueCheck(bean); - if (result.getCode() == Result.SUCCESS) { - testOrgService.save(bean); - return Result.success(); - } else { - return result; - } - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpTestOrg testOrg = testOrgService.selectById(id); - model.addAttribute("bean", testOrg); - model.addAttribute("enableDropDown", EnableTypeEnum.getAllEnableType4JSON()); - return "whp/baseinfo/WhpTestOrgEdit"; - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpTestOrg bean - ) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = testOrgService.uniqueCheck(bean); - if (result.getCode() == Result.SUCCESS) { - testOrgService.update(bean); - return Result.success(); - } else { - return result; - } - } - - - - /** - * 主键查询 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - @RequestMapping("/getById.do") - @ResponseBody - public Result doupdate(String id - ) { - WhpTestOrg whpTestOrg = testOrgService.selectById(id); - return Result.success(whpTestOrg); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - testOrgService.deleteByWhere("where id in ('" + ids + "')"); - return Result.success(); - } - -} diff --git a/src/com/sipai/controller/whp/liquidWasteDispose/WhpLiquidWasteDisposeController.java b/src/com/sipai/controller/whp/liquidWasteDispose/WhpLiquidWasteDisposeController.java deleted file mode 100644 index eac33138..00000000 --- a/src/com/sipai/controller/whp/liquidWasteDispose/WhpLiquidWasteDisposeController.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.controller.whp.liquidWasteDispose; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.util.MapUtils; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.fill.FillConfig; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sipai.controller.exception.BizCheckException; import com.sipai.entity.base.Result; import com.sipai.entity.enums.whp.LiquidWasteDisposeStatusEnum; import com.sipai.entity.enums.whp.LiquidWasteDisposeTypeEnum; import com.sipai.entity.user.User; import com.sipai.entity.whp.liquidWasteDispose.*; import com.sipai.service.whp.liquidWasteDispose.WhpLiquidWasteDisposeLogService; import com.sipai.service.whp.liquidWasteDispose.WhpLiquidWasteDisposeService; import com.sipai.tools.DateUtil; import net.sf.json.JSONArray; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import sun.plugin.util.UIUtil; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.math.BigDecimal; import java.util.*; /** * 余样处置方式Controller类 * * @Author: 李晨 * @Date: 2022/12/20 **/ @Controller @RequestMapping("/whp/liquidWasteDispose/WhpLiquidWasteDispose") public class WhpLiquidWasteDisposeController { @Resource private WhpLiquidWasteDisposeService whpLiquidWasteDisposeService; @Resource private WhpLiquidWasteDisposeLogService whpLiquidWasteDisposeLogService; /** * 页面跳转:废液入库页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/showListInput.do") public String showList(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("statusConditionDropDown", LiquidWasteDisposeStatusEnum.getAll4JSON()); model.addAttribute("typeConditionDropDown", LiquidWasteDisposeTypeEnum.getAll4JSON()); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeListInput"; } /** * 页面跳转:废液处置页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/showListDispose.do") public String showListDispose(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("statusConditionDropDown", LiquidWasteDisposeStatusEnum.getWithOutRecord4JSON()); model.addAttribute("typeConditionDropDown", LiquidWasteDisposeTypeEnum.getAll4JSON()); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeListDispose"; } /** * 获取列表 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/getList.do") public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpLiquidWasteDisposeQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); PageHelper.startPage(page, rows); List list = whpLiquidWasteDisposeService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpLiquidWasteDispose item : list) { WhpLiquidWasteDisposeVo vo = new WhpLiquidWasteDisposeVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 vo.setStatusName(LiquidWasteDisposeStatusEnum.getNameByid(item.getStatus())); vo.setLiquidWasteTypeName(LiquidWasteDisposeTypeEnum.getNameByid(item.getLiquidWasteType())); voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } @RequestMapping("/getCurrentNumbCount.do") @ResponseBody public Float getCurrentNumbCount(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpLiquidWasteDisposeQuery query){ Float countnum=0.0f; countnum=whpLiquidWasteDisposeService.getCurrentNumbCount(query); return countnum; } /** * 获取列表 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/getListDispose.do") public ModelAndView getListDispose(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpLiquidWasteDisposeQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); PageHelper.startPage(page, rows); List list = whpLiquidWasteDisposeService.queryListDispose(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpLiquidWasteDispose item : list) { WhpLiquidWasteDisposeVo vo = new WhpLiquidWasteDisposeVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 vo.setStatusName(LiquidWasteDisposeStatusEnum.getNameByid(item.getStatus())); vo.setLiquidWasteTypeName(LiquidWasteDisposeTypeEnum.getNameByid(item.getLiquidWasteType())); voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 页面跳转:新增页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/add.do") public String doadd(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("cu", cu); model.addAttribute("typeConditionDropDownList", LiquidWasteDisposeTypeEnum.getAll4JSON()); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeAdd"; } /** * 新增(登记) * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/save.do") @ResponseBody public Result dosave(HttpServletRequest request, Model model, WhpLiquidWasteDispose bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); bean.setStatus(LiquidWasteDisposeStatusEnum.RECORD.getId()); bean.setCurrentNumber(bean.getNumber()); whpLiquidWasteDisposeService.save(bean); return Result.success(); } /** * 页面跳转:处置页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/editDispose.do") public String editDispose(HttpServletRequest request, Model model, String id ) { User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("cu", cu); WhpLiquidWasteDispose whpLiquidWasteDispose = whpLiquidWasteDisposeService.selectById(id); model.addAttribute("bean", whpLiquidWasteDispose); model.addAttribute("typeConditionDropDownList", LiquidWasteDisposeTypeEnum.getAll4JSON()); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeEditDispose"; } /** * 页面跳转:批量处置页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/editBatchDispose.do") public String editBatchDispose(HttpServletRequest request, Model model, String ids ) { User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("cu", cu); String idsstr=ids.replaceAll(",","','"); WhpLiquidWasteDisposeQuery query=new WhpLiquidWasteDisposeQuery(); query.setIds("('"+idsstr+"')"); Float countnum=whpLiquidWasteDisposeService.getNumberCount(query); int countnumInt = countnum.intValue(); model.addAttribute("countnum",countnumInt); model.addAttribute("ids",ids); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeBatchEditDispose"; } /** * 页面跳转:入库页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/editInput.do") public String doedit(HttpServletRequest request, Model model, String id ) { WhpLiquidWasteDispose whpLiquidWasteDispose = whpLiquidWasteDisposeService.selectById(id); model.addAttribute("bean", whpLiquidWasteDispose); model.addAttribute("typeConditionDropDownList", LiquidWasteDisposeTypeEnum.getAll4JSON()); User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("cu", cu); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeEditInput"; } /** * 页面跳转:批量入库页面 * * @Author: zxq * @Date: 2023/8/1 **/ @RequestMapping("/doBatches.do") public String doBatchedit(HttpServletRequest request, Model model, String ids ) { model.addAttribute("ids", ids); User cu = (User) request.getSession().getAttribute("cu"); model.addAttribute("cu", cu); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeBatchEditInput"; } /** * 页面跳转:入库详情页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/viewInput.do") public String view(HttpServletRequest request, Model model, String id ) { WhpLiquidWasteDispose whpLiquidWasteDispose = whpLiquidWasteDisposeService.selectById(id); model.addAttribute("bean", whpLiquidWasteDispose); model.addAttribute("typeConditionDropDownList", LiquidWasteDisposeTypeEnum.getAll4JSON()); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeViewInput"; } /** * 页面跳转:处置详情页面 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/viewDispose.do") public String viewDispose(HttpServletRequest request, Model model, String id ) { WhpLiquidWasteDispose whpLiquidWasteDispose = whpLiquidWasteDisposeService.selectById(id); model.addAttribute("bean", whpLiquidWasteDispose); model.addAttribute("typeConditionDropDownList", LiquidWasteDisposeTypeEnum.getAll4JSON()); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeViewDispose"; } /** * 更新(入库) * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/updateInput.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpLiquidWasteDispose bean ) throws BizCheckException { whpLiquidWasteDisposeService.updateInputBizCheck(bean); WhpLiquidWasteDisposeLog wasteDisposeLog=new WhpLiquidWasteDisposeLog(); BeanUtils.copyProperties(bean,wasteDisposeLog); wasteDisposeLog.setDisposeId(bean.getId()); wasteDisposeLog.setId(UUID.randomUUID().toString()); whpLiquidWasteDisposeLogService.save(wasteDisposeLog); bean.setStatus(LiquidWasteDisposeStatusEnum.NON_DISPOSED.getId()); whpLiquidWasteDisposeService.update(bean); return Result.success(); } /** * 更新(登记编辑) * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/update.do") @ResponseBody public Result update(HttpServletRequest request, Model model, WhpLiquidWasteDispose bean ) throws BizCheckException { whpLiquidWasteDisposeService.updateInputBizCheck(bean); WhpLiquidWasteDisposeLog wasteDisposeLog=new WhpLiquidWasteDisposeLog(); BeanUtils.copyProperties(bean,wasteDisposeLog); wasteDisposeLog.setDisposeId(bean.getId()); wasteDisposeLog.setId(UUID.randomUUID().toString()); whpLiquidWasteDisposeLogService.save(wasteDisposeLog); bean.setRepositionUserId(""); bean.setRepositionUserName(""); whpLiquidWasteDisposeService.update(bean); return Result.success(); } /** * 更新(处置) * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/updateDispose.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result updateDispose(HttpServletRequest request, Model model, WhpLiquidWasteDispose bean, BigDecimal disposeNumber ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); if (Objects.isNull(disposeNumber) || disposeNumber == BigDecimal.ZERO) { throw new BizCheckException("转移数量不能是0!"); } else if (disposeNumber.compareTo(bean.getNumber())==1) { throw new BizCheckException("转移数量不能超过库存数量!"); } else if (disposeNumber .compareTo(bean.getNumber())==-1) { WhpLiquidWasteDispose disposeOne = new WhpLiquidWasteDispose(); BeanUtils.copyProperties(bean, disposeOne); disposeOne.setNumber(disposeNumber); disposeOne.setStatus(LiquidWasteDisposeStatusEnum.DISPOSED.getId()); whpLiquidWasteDisposeService.save(disposeOne); bean.setNumber(bean.getNumber().subtract(disposeNumber) ); whpLiquidWasteDisposeService.update(bean); } else { bean.setStatus(LiquidWasteDisposeStatusEnum.DISPOSED.getId()); bean.setOuputDate(DateUtil.toStr(null, new Date())); whpLiquidWasteDisposeService.update(bean); } return Result.success(); } /** * 更新( 批量处置) * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/updateBatchDispose.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result updateBatchDispose(HttpServletRequest request, Model model, WhpLiquidWasteDispose bean,String ids ) throws BizCheckException { for (String id : ids.split(",")) { WhpLiquidWasteDispose whpLiquidWasteDispose=new WhpLiquidWasteDispose(); BeanUtils.copyProperties(bean,whpLiquidWasteDispose); whpLiquidWasteDispose.setId(id); whpLiquidWasteDisposeService.updateInputBatchBizCheck(whpLiquidWasteDispose,1); whpLiquidWasteDispose.setStatus(LiquidWasteDisposeStatusEnum.DISPOSED.getId()); whpLiquidWasteDispose.setOuputDate(DateUtil.toStr(null, new Date())); whpLiquidWasteDisposeService.update(whpLiquidWasteDispose); } return Result.success(); } /** * 批量入库 * * @Author: 李晨 * @Date: 2022/12/20s * 2023/08/01 * 完善 todo 批量入库的时候,运送经办人统一填写 **/ @RequestMapping("/inputs.do") @ResponseBody @Transactional(rollbackFor = BizCheckException.class) public Result inputs(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids,WhpLiquidWasteDispose bean) throws BizCheckException { // for (String id : ids.split(",")) { WhpLiquidWasteDispose whpLiquidWasteDispose =whpLiquidWasteDisposeService.selectById(id); whpLiquidWasteDisposeService.updateInputBatchBizCheck(whpLiquidWasteDispose,0); whpLiquidWasteDispose.setStatus(LiquidWasteDisposeStatusEnum.NON_DISPOSED.getId()); whpLiquidWasteDispose.setInputTime(bean.getInputTime()); whpLiquidWasteDispose.setTransportUserId(bean.getTransportUserId()); whpLiquidWasteDispose.setTransportUserName(bean.getTransportUserName()); whpLiquidWasteDispose.setRepositionUserId(bean.getRepositionUserId()); whpLiquidWasteDispose.setRepositionUserName(bean.getRepositionUserName()); //whpLiquidWasteDispose.setId(id); whpLiquidWasteDisposeService.update(whpLiquidWasteDispose); } return Result.success(); } /** * 批量删除 * * @Author: 李晨 * @Date: 2022/12/20 **/ @RequestMapping("/deletes.do") @ResponseBody public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) throws BizCheckException { String idsCondition = ids.replace(",", "','"); for (String id : ids.split(",")) { WhpLiquidWasteDispose whpLiquidWasteDispose = whpLiquidWasteDisposeService.selectById(id); if (whpLiquidWasteDispose.getStatus() != LiquidWasteDisposeStatusEnum.RECORD.getId()) { throw new BizCheckException("只能删除状态是“登记”的记录!"); } } whpLiquidWasteDisposeService.deleteByWhere("where id in ('" + idsCondition + "')"); return Result.success(); } @RequestMapping("/export.do") public void export(HttpServletRequest request, HttpServletResponse response, Model model, WhpLiquidWasteDisposeQuery query) throws IOException { Map map = MapUtils.newHashMap(); if (query.getLiquidWasteType()!=2) { map.put("liquidWasteTypeName", LiquidWasteDisposeTypeEnum.getNameByid(query.getLiquidWasteType())); //query.setLiquidWasteType(null); }else{ map.put("liquidWasteTypeName", "全部"); } //获取列表 List listInfo = whpLiquidWasteDisposeService.queryListDispose(query); List volist = new ArrayList<>(); for (WhpLiquidWasteDispose item : listInfo) { WhpLiquidWasteDisposeVo vo = new WhpLiquidWasteDisposeVo(); BeanUtils.copyProperties(item, vo); if (item.getStatus() == LiquidWasteDisposeStatusEnum.NON_DISPOSED.getId()) { vo.setOutputNumber(BigDecimal.ZERO); } else { vo.setOutputNumber(item.getNumber()); } if(item.getOuputDate()!=null) { vo.setOuputDate(item.getOuputDate().substring(0,10)); } vo.setInputTime(item.getInputTime().substring(0,10)); volist.add(vo); } //文件的实际地址 String filepath = request.getSession().getServletContext().getRealPath("/"); String filename = "WhpLiquidWasteDispose.xls"; //兼容Linux路径 filepath = filepath + "Template" + System.getProperty("file.separator") + "whp" + System.getProperty("file.separator") + filename; response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf8"); String fileName = "白龙港污水处理厂化验室危废储存记录表.xls"; response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode(fileName)); try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(filepath).build()) { WriteSheet writeSheet = EasyExcel.writerSheet().build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); excelWriter.fill(map, writeSheet); excelWriter.fill(volist, fillConfig, writeSheet); excelWriter.finish(); } } @RequestMapping("/preview.do") public String dopreview(HttpServletRequest request,Model model,WhpLiquidWasteDisposeQuery query) throws IOException { //获取列表 List listInfo = whpLiquidWasteDisposeService.queryListDispose(query); List volist = new ArrayList<>(); for (WhpLiquidWasteDispose item : listInfo) { WhpLiquidWasteDisposeVo vo = new WhpLiquidWasteDisposeVo(); BeanUtils.copyProperties(item, vo); if (item.getStatus() == LiquidWasteDisposeStatusEnum.NON_DISPOSED.getId()) { vo.setOutputNumber(BigDecimal.ZERO); } else { vo.setOutputNumber(item.getNumber()); } volist.add(vo); } JSONArray json = JSONArray.fromObject(volist); model.addAttribute("bean", json); model.addAttribute("disposeQuery", query); return "whp/liquidWasteDispose/WhpLiquidWasteDisposePreview"; } } \ No newline at end of file diff --git a/src/com/sipai/controller/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogController.java b/src/com/sipai/controller/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogController.java deleted file mode 100644 index e2619c7f..00000000 --- a/src/com/sipai/controller/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogController.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.controller.whp.liquidWasteDispose; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sipai.entity.base.Result; import com.sipai.controller.exception.BizCheckException; import com.sipai.entity.whp.liquidWasteDispose.*; import com.sipai.entity.user.User; import com.sipai.service.whp.liquidWasteDispose.*; import com.sipai.entity.base.Result; import com.sipai.service.user.UserService; import com.sipai.tools.DateUtil; import net.sf.json.JSONArray; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; /** * 方法依据Controller类 * * @Author: zxq * @Date: 2023/05/15 **/ @Controller @RequestMapping("/whp/liquidWasteDispose/WhpLiquidWasteDisposeLog") public class WhpLiquidWasteDisposeLogController { @Resource private WhpLiquidWasteDisposeLogService whpLiquidWasteDisposeLogService; /** * 页面跳转:列表页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/showList.do") public String showList(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeLogList"; } /** * 获取列表 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/getList.do") public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpLiquidWasteDisposeLogQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); PageHelper.startPage(page, rows); List list = whpLiquidWasteDisposeLogService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpLiquidWasteDisposeLog item : list) { WhpLiquidWasteDisposeLogVo vo = new WhpLiquidWasteDisposeLogVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 页面跳转:新增页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/add.do") public String doadd(HttpServletRequest request, Model model ) { return "whp/liquidWasteDispose/WhpLiquidWasteDisposeLogAdd"; } /** * 新增 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/save.do") @ResponseBody public Result dosave(HttpServletRequest request, Model model, WhpLiquidWasteDisposeLog bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpLiquidWasteDisposeLogService.bizCheck(bean); whpLiquidWasteDisposeLogService.save(bean); return Result.success(); } /** * 页面跳转:编辑页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/edit.do") public String doedit(HttpServletRequest request, Model model, String id ) { WhpLiquidWasteDisposeLog whpLiquidWasteDisposeLog = whpLiquidWasteDisposeLogService.selectById(id); model.addAttribute("bean", whpLiquidWasteDisposeLog); return "whp/liquidWasteDispose/WhpLiquidWasteDisposeLogEdit"; } /** * 页面跳转:编辑页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/doDisPoseLogList.do") public String doDisPoseLogList(HttpServletRequest request, Model model, String disposeId) { model.addAttribute("disposeId", disposeId); return "whp/liquidWasteDispose/WhpLiquidWasteCheckDisposeLog"; } /** * 更新 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/update.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpLiquidWasteDisposeLog bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpLiquidWasteDisposeLogService.bizCheck(bean); whpLiquidWasteDisposeLogService.update(bean); return Result.success(); } /** * 批量删除 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/deletes.do") @ResponseBody public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { ids = ids.replace(",", "','"); whpLiquidWasteDisposeLogService.deleteByWhere("where id in ('" + ids + "')"); return Result.success(); } } \ No newline at end of file diff --git a/src/com/sipai/controller/whp/plan/WhpSamplingPlanController.java b/src/com/sipai/controller/whp/plan/WhpSamplingPlanController.java deleted file mode 100644 index db98ea6e..00000000 --- a/src/com/sipai/controller/whp/plan/WhpSamplingPlanController.java +++ /dev/null @@ -1,683 +0,0 @@ -package com.sipai.controller.whp.plan; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import com.sipai.entity.whp.baseinfo.WhpTestItem; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.plan.WhpSamplingPlanVo; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.baseinfo.WhpTestItemService; -import com.sipai.service.whp.plan.WhpSamplingPlanService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.*; - -/** - * 采样计划Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ -@Controller -@RequestMapping("/whp/plan/WhpSamplingPlan") -public class WhpSamplingPlanController { - - @Resource - private WhpSamplingPlanService whpSamplingPlanService; - - @Resource - private WhpSampleTypeService whpSampleTypeService; - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpTestItemService whpTestItemService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - //查询计划状态 - model.addAttribute("status", SamplingPlanStatusEnum.getAll4JSON()); - - List isAutoPlanList = new ArrayList<>(); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("id","1"); - jsonObject1.put("text","是"); - - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id","0"); - jsonObject2.put("text","否"); - - isAutoPlanList.add(jsonObject1); - isAutoPlanList.add(jsonObject2); - model.addAttribute("isAutoPlanStatus", JSON.toJSONString(isAutoPlanList)); - return "whp/plan/WhpSamplingPlanList"; - } - - /** - * 页面跳转:车间列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/showWorkList.do") - public String showWorkList(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - //查询计划状态 - model.addAttribute("status", SamplingPlanStatusEnum.getAll4JSON()); - return "whp/plan/WhpSamplingPlanWorkList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - query.setPlayType(0); - PageHelper.startPage(page, rows); - List list = whpSamplingPlanService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSamplingPlan item : list) { - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(whpSamplingPlanService.writeStatusString(item)); - - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/getWorkList.do") - public ModelAndView getWorkList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - query.setCreateUserId(cu.getId()); - query.setPlayType(1); - - PageHelper.startPage(page, rows); - List list = whpSamplingPlanService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSamplingPlan item : list) { - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setStatusName(whpSamplingPlanService.writeStatusString(item)); - - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model - - ) { - //查询采样类型 - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - model.addAttribute("enableDropDown", SamplingPlanStatusEnum.getAll4JSON()); - - return "whp/plan/WhpSamplingPlanAdd"; - } - - /** - * 页面跳转:新增页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/doWorkadd.do") - public String doWorkadd(HttpServletRequest request, Model model - - ) { - //查询采样类型 - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - model.addAttribute("enableDropDown", SamplingPlanStatusEnum.getAll4JSON()); - - return "whp/plan/WhpSamplingPlanWorkAdd"; - } - - - /** - * 新增 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/save.do") - @ResponseBody - @Transactional(rollbackFor = BizCheckException.class) - public Result dosave(HttpServletRequest request, Model model, WhpSamplingPlan bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - bean.setCreateUserId(cu.getId()); - //采样单编码 - whpSamplingPlanService.code(bean); - whpSamplingPlanService.bizCheck(bean); - whpSamplingPlanService.save(bean); - whpSamplingPlanTaskService.save(bean); - return Result.success(); - } - - /** - * 车间新增 完成接单 接单人默认为当前人 - * - * @Author: - * @Date: 2022/12/29 - **/ - @RequestMapping("/workSave.do") - @ResponseBody - @Transactional(rollbackFor = BizCheckException.class) - public Result doWorksave(HttpServletRequest request, Model model, WhpSamplingPlan bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - bean.setCreateUserId(cu.getId()); - bean.setStatus(SamplingPlanStatusEnum.SAMPLING.getId()); - //采样单编码 - whpSamplingPlanService.code(bean); - whpSamplingPlanService.bizCheck(bean); - whpSamplingPlanService.save(bean); - whpSamplingPlanTaskService.workSave(bean); - - return Result.success(); - } - - /** - * 车间采样登记提交 - * - * @Author: - * @Date: 2022/12/30 - **/ - @RequestMapping("/workSubmit.do") - @ResponseBody - public Result workSubmit(HttpServletRequest request, Model model, WhpSamplingPlan bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - bean.setStatus(SamplingPlanStatusEnum.SAMPLING_DONE.getId()); - whpSamplingPlanService.update(bean); - List taskList = whpSamplingPlanTaskService.selectListByPlanId(bean.getId()); - whpSamplingPlanTaskService.delByPlanIdNotTest(bean.getId()); - whpSamplingPlanTaskService.workSubmit(taskList); - - - return Result.success(); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(id); - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(whpSamplingPlan, vo); - - WhpSampleType whpSampleType = whpSampleTypeService.selectById(whpSamplingPlan.getSampleTypeId()); - if (whpSampleType.getAmplingPeriod() != null) { - vo.setSamplingPeriodName(AmplingPeriodEnum.getNameByid(whpSampleType.getAmplingPeriod())); - vo.setSamplingPeriodCode(whpSampleType.getAmplingPeriod()); - - - } - vo.setIntervalDay(whpSampleType.getIntervalDay()); - model.addAttribute("bean", vo); - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - // 检测项目下拉 - model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); - return "whp/plan/WhpSamplingPlanEdit"; - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/workEdit.do") - public String doWorkEdit(HttpServletRequest request, Model model, - String id - ) { - WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(id); - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(whpSamplingPlan, vo); - - WhpSampleType whpSampleType = whpSampleTypeService.selectById(whpSamplingPlan.getSampleTypeId()); - if (whpSampleType.getAmplingPeriod() != null) { - vo.setSamplingPeriodName(AmplingPeriodEnum.getNameByid(whpSampleType.getAmplingPeriod())); - vo.setSamplingPeriodCode(whpSampleType.getAmplingPeriod()); - - - } - vo.setIntervalDay(whpSampleType.getIntervalDay()); - model.addAttribute("bean", vo); - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - // 检测项目下拉 - model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); - return "whp/plan/WhpSamplingPlanWorkEdit"; - } - - /** - * 页面跳转:浏览页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id - ) { - WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(id); - model.addAttribute("bean", whpSamplingPlan); - model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); - return "whp/plan/WhpSamplingPlanView"; - } - - /** - * 页面跳转:打印页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/print.do") - public String print(HttpServletRequest request, Model model, String id - ) { - WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(id); - List taskList = whpSamplingPlanTaskService.selectListByWhere("where plan_id='" + whpSamplingPlan.getId() + "' order by plan_code ,convert(int,substring(\n" + - " sample_code, " + - " charindex('-',sample_code)+1,len(sample_code)-charindex('-',sample_code) " + - " )) "); - StringBuilder samplingUserNameBuilder = new StringBuilder(""); - StringBuilder remarkStr = new StringBuilder("备注:
"); - for (WhpSamplingPlanTask task : taskList) { - String samplingUserName = task.getSamplingUserName(); - if (StringUtils.isNotEmpty(samplingUserName) && !samplingUserNameBuilder.toString().contains(samplingUserName)) { - samplingUserNameBuilder.append(samplingUserName).append(","); - } - - remarkStr.append("样品编号:").append(task.getSampleCode()).append(" ") - .append("地点:").append(task.getSampleAddress()).append(" ") - .append("数量:").append(task.getSampleAmount() == null ? "" : task.getSampleAmount() + "ml").append(" ") - .append("外观:").append(task.getSamplingEnv() == null ? "" : SamplingPlanTaskEnvEnum.getNameByid(task.getSamplingEnv())).append(" ") - .append(task.getSampleAppearance() == null ? "" : SampleAppearanceEnum.getNameByid(task.getSampleAppearance())).append(" ") - .append(task.getSampleSupernatant() == null ? "" : SampleSupernatantEnum.getNameByid(task.getSampleSupernatant())).append(" ") - .append(task.getSampleNature() == null ? "" : SampleNatureEnum.getNameByid(task.getSampleNature())).append(" ") - .append(task.getSampleState() == null ? "" : SampleStateEnum.getNameByid(task.getSampleState())) - .append("
"); - - String[] testItemIds = task.getTestItemIds().split(","); - String name = ""; - for (String testItemId : testItemIds) { - WhpTestItem whpTestItem = whpTestItemService.selectById(testItemId); - name += whpTestItem == null ? "未知测试项目" : whpTestItem.getName(); - name += ","; - } - name = name.substring(0, name.length() - 1); - task.setTestItemIds(name); - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("header", "上海城投污水处理有限公司白龙港污水处理厂化验室"); - jsonObject.put("sn", "CTWS-BLG/CX 8.2.4-01-JL01"); - String samplingUserNameStr = ""; - if (!"".equals(samplingUserNameBuilder.toString())) { - samplingUserNameStr = samplingUserNameBuilder.substring(0, samplingUserNameBuilder.lastIndexOf(",")); - } - jsonObject.put("samplingUserNameStr", samplingUserNameStr); - jsonObject.put("remark", remarkStr.toString()); - - model.addAttribute("data", jsonObject); - //采样计划信息 - model.addAttribute("bean", whpSamplingPlan); - //采样任务信息 - model.addAttribute("taskList", taskList); - return "whp/plan/WhpSamplingPlanPrint"; - } - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpSamplingPlan bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - whpSamplingPlanService.update(bean); - return Result.success(); - } - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/docancel.do") - @ResponseBody - public Result docancel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(id); - whpSamplingPlan.setIsAutoPlan(0); - whpSamplingPlanService.update(whpSamplingPlan); - return Result.success(); - } - - /** - * 下发 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/submit.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result submit(WhpSamplingPlan bean - ) { - // WhpSamplingPlan bean = whpSamplingPlanService.selectById(whpSamplingPlan.getId()); - // WhpSampleType whpSampleType = whpSampleTypeService.selectById(bean.getSampleTypeId()); - List taskList = whpSamplingPlanTaskService.selectListByPlanId(bean.getId()); - whpSamplingPlanTaskService.delByPlanIdNotTest(bean.getId()); - //if (!isBatch) { - bean.setStatus(SamplingPlanStatusEnum.SUBMIT.getId()); - whpSamplingPlanService.update(bean); - whpSamplingPlanTaskService.submit(taskList); - /*} else { - Date firstDate = DateUtil.toDate(bean.getDate()); - - Date nextDate = DateUtil.getFetureDate(firstDate, 7); - Date end = DateUtil.toDate(endDate); - bean.setStatus(SamplingPlanStatusEnum.SUBMIT.getId()); - whpSamplingPlanService.update(bean); - whpSamplingPlanTaskService.submit(bean, taskList); - while (!nextDate.after(end)) { - WhpSamplingPlan batch = new WhpSamplingPlan(); - BeanUtils.copyProperties(bean, batch); - batch.setCode(whpSampleType.getCode() + DateUtil.toStr("yyMMdd", nextDate)); - batch.setDate(DateUtil.toStr(null, nextDate)); - batch.setReportDate(DateUtil.toStr(null, DateUtil.getFetureDate(nextDate, 1))); - bean.setStatus(SamplingPlanStatusEnum.SUBMIT.getId()); - whpSamplingPlanService.save(batch); - whpSamplingPlanTaskService.submit(batch, taskList); - nextDate = DateUtil.getFetureDate(nextDate, 7); - } - }*/ - return Result.success(); - } - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - whpSamplingPlanService.deleteByWhere("where id in ('" + ids + "')"); - whpSamplingPlanTaskService.deleteByWhere("where plan_id in ('" + ids + "') "); - return Result.success(); - } - - - /** - * 首页 统计 - * - * @param request - * @param query - * @return - */ - //---------------------首页 统计--------------------- - @RequestMapping("/queryListPlanTj.do") - @ResponseBody - public PlanIndexJson queryListPlanTj(HttpServletRequest request, WhpSamplingPlanQuery query) { - Date date = DateUtil.toDate(query.getDateBegin()); - //月份 - if (query.getDateBegin().length() < 8) { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getMonthEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getMonthStartTime(date))); - } else { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getDayEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getDayStartTime(date))); - } - User cu = (User) request.getSession().getAttribute("cu"); - query.setUserId(cu.getId()); - PlanIndexJson planIndexJson = new PlanIndexJson(); - List list = whpSamplingPlanTaskService.queryListPlanTj(query); - int realityRate = 0; - if (list != null && list.size() > 0) { - planIndexJson = list.get(0); - int realityCount = planIndexJson.getRealityCount(); - int plansamplecount = planIndexJson.getPlanSampleCount(); - if (plansamplecount != 0) { - if (realityCount != 0) { - realityRate = (realityCount * 100) / plansamplecount; - /* realityRate=(double)(Math.round(realityCount*100/plansamplecount)/100.0);*/ - } - planIndexJson.setRealityRate(realityRate + "%"); - - } else { - planIndexJson.setRealityRate(0 + "%"); - - } - } else { - planIndexJson.setRealityRate(0 + "%"); - } - return planIndexJson; - - } - - /** - * 首页 完成检测项目统计 - * - * @param request - * @param query - * @return - */ - //---------------------首页 完成检测项目统计--------------------- - @RequestMapping("/selectItemCount.do") - @ResponseBody - public List selectItemCount(HttpServletRequest request, WhpSamplingPlanQuery query) { - - Date date = DateUtil.toDate(query.getDateBegin()); - //月份 - if (query.getDateBegin().length() < 8) { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getMonthEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getMonthStartTime(date))); - } else { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getDayEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getDayStartTime(date))); - } - User cu = (User) request.getSession().getAttribute("cu"); - query.setUserId(cu.getId()); - - List list = whpSamplingPlanTaskService.selectItemCount(query); - - return list; - - } - - /** - * 首页 检测类型统计 - * - * @param request - * @param query - * @return - */ - //---------------------首页 检测类型统计--------------------- - @RequestMapping("/selectTypeByDate.do") - @ResponseBody - public List selectTypeByDate(HttpServletRequest request, WhpSamplingPlanQuery query) { - Date date = DateUtil.toDate(query.getDateBegin()); - //月份 - if (query.getDateBegin().length() < 8) { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getMonthEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getMonthStartTime(date))); - } else { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getDayEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getDayStartTime(date))); - } - User cu = (User) request.getSession().getAttribute("cu"); - query.setUserId(cu.getId()); - List list = whpSamplingPlanTaskService.selectTypeByDate(query); - - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (PlanIndexJson item : list) { - - PlanIndexJson vo = new PlanIndexJson(); - BeanUtils.copyProperties(item, vo); - // 此处加工Vo数据 - // List list1=whpSamplingPlanTaskService.selectListByPlanId(item.getId()); - //vo.setSampleCount(list1.size()); - ///vo.setIncomplete(list1.size()-whpSamplingPlanService.writeIndexStatusString(item)); - Map map = whpSamplingPlanService.writeIndexStatusString(item); - vo.setFinishCount(map.get("done") != null ? map.get("done") : 0); - vo.setSampleCount(map.get("all") != null ? map.get("all") : 0); - voList.add(vo); - } - - return voList; - - } - - /** - * 根据 月份 时间分组查询 采样计划完成 和未完成数 - * - * @param request - * @param query - * @return - */ - - //---------------------根据 月份 查询 时间分组查询 采样计划完成 和总数 --------------------- - @RequestMapping("/selectPlanByDate.do") - @ResponseBody - public List selectPlanByDate(HttpServletRequest request, WhpSamplingPlanQuery query) { - Date date = DateUtil.toDate(query.getDateBegin()); - //月份 - if (query.getDateBegin().length() < 8) { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getMonthEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getMonthStartTime(date))); - } else { - query.setDateEnd(DateUtil.toStr(null, DateUtil.getDayEndTime(date))); - query.setDateBegin(DateUtil.toStr(null, DateUtil.getDayStartTime(date))); - } - User cu = (User) request.getSession().getAttribute("cu"); - query.setUserId(cu.getId()); - - List list = whpSamplingPlanTaskService.selectPlanByDate(query); - //List listv=new ArrayList<>(); - - /* if(list!=null&&list.size()>0) - { - for(int i=0;i list = whpSamplingPlanTaskService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpSamplingPlanTask item : list) { WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 vo.setStatusName(SamplingPlanTaskStatusEnum.getNameByid(item.getStatus())); vo.setTestItemNames(whpTestItemService.getTestItemNamesByIds(item.getTestItemIds())); voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 获取列表 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/getListNoTemplate.do") public ModelAndView getListNoTemplate(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpSamplingPlanTaskQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); if (!request.getParameter("status").equals("")) { query.setDeptId(cu.getPid()); query.setStatus(Integer.valueOf(request.getParameter("status"))); } if (query.getStatus() != null) { if (query.getStatus() == 2) {//2只看自己 query.setReceiverUserId(cu.getId()); } } PageHelper.startPage(page, rows); List list = whpSamplingPlanTaskService.queryListNoTemplate(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpSamplingPlanTask item : list) { WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 vo.setStatusName(SamplingPlanTaskStatusEnum.getNameByid(item.getStatus())); vo.setTestItemNames(whpTestItemService.getTestItemNamesByIds(item.getTestItemIds())); voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 页面跳转:采样登记 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/edit.do") public String doedit(HttpServletRequest request, Model model, String id ) { User cu = (User) request.getSession().getAttribute("cu"); WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); if (StringUtils.isEmpty(whpSamplingPlanTask.getSamplingUserId())) { whpSamplingPlanTask.setSamplingUserId(cu.getId()); whpSamplingPlanTask.setSamplingUserName(cu.getCaption()); } model.addAttribute("bean", whpSamplingPlanTask); String all4JSON = SamplingPlanTaskEnvEnum.getAll4JSON(); //现场采样情况 model.addAttribute("samplingPlanTaskEnvDropDown", SamplingPlanTaskEnvEnum.getAll4JSON()); //样品外观 model.addAttribute("sampleAppearanceDropDown", SampleAppearanceEnum.getAll4JSON()); //样品上清液 model.addAttribute("sampleSupernatantDropDown", SampleSupernatantEnum.getAll4JSON()); //样品性质 model.addAttribute("sampleNatureDropDown", SampleNatureEnum.getAll4JSON()); //样品状态 model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); return "whp/plan/WhpSamplingPlanTaskEdit"; } /** * 页面跳转:采样登记 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/workEdit.do") public String doWorkEdit(HttpServletRequest request, Model model, String id ) { User cu = (User) request.getSession().getAttribute("cu"); WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); if (StringUtils.isEmpty(whpSamplingPlanTask.getSamplingUserId())) { whpSamplingPlanTask.setSamplingUserId(cu.getId()); whpSamplingPlanTask.setSamplingUserName(cu.getCaption()); } model.addAttribute("bean", whpSamplingPlanTask); //现场采样情况 model.addAttribute("samplingPlanTaskEnvDropDown", SamplingPlanTaskEnvEnum.getAll4JSON()); //样品外观 model.addAttribute("sampleAppearanceDropDown", SampleAppearanceEnum.getAll4JSON()); //样品上清液 model.addAttribute("sampleSupernatantDropDown", SampleSupernatantEnum.getAll4JSON()); //样品性质 model.addAttribute("sampleNatureDropDown", SampleNatureEnum.getAll4JSON()); //样品状态 model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); return "whp/plan/WhpSamplingPlanWorkTaskEdit"; } /** * 采样登记保存 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/update.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpSamplingPlanTask bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 车间采样登记保存 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/workUpdate.do") @ResponseBody public Result doWorkupdate(HttpServletRequest request, Model model, WhpSamplingPlanTask bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); bean.setStatus(SamplingPlanTaskStatusEnum.AUDIT.getId()); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 采样登记提交 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/submit.do") @ResponseBody public Result submit(HttpServletRequest request, Model model, WhpSamplingPlanTask bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); bean.setStatus(SamplingPlanTaskStatusEnum.AUDIT.getId()); whpSamplingPlanTaskService.update(bean); WhpSamplingPlanTask task = whpSamplingPlanTaskService.selectById(bean.getId()); whpSamplingPlanService.isSamplingPlanTaskDone(task.getPlanId()); return Result.success(); } /** * 页面跳转:接单页面 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/showConfirm.do") public String showConfirm(HttpServletRequest request, Model model, String id ) { WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(whpSamplingPlanTask.getPlanId()); WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); BeanUtils.copyProperties(whpSamplingPlanTask, vo); vo.setDeptNames(whpSamplingPlan.getDeptNames()); model.addAttribute("bean", vo); //查询采样类型 model.addAttribute("type", JSON.toJSONString(whpSampleTypeService.dropDownList())); model.addAttribute("enableDropDown", SamplingPlanStatusEnum.getAll4JSON()); return "whp/plan/WhpSamplingPlanTaskShowConfirm"; } /** * 接单 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/confirm.do") @ResponseBody public Result confirm(HttpServletRequest request, String id) { WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); User cu = (User) request.getSession().getAttribute("cu"); whpSamplingPlanTask.setReceiverUserId(cu.getId()); whpSamplingPlanTask.setStatus(SamplingPlanTaskStatusEnum.ING.getId()); whpSamplingPlanTaskService.update(whpSamplingPlanTask); List list = whpSamplingPlanTaskService.selectListByWhere(" where plan_id='" + whpSamplingPlanTask.getPlanId() + "' and status='" + SamplingPlanTaskStatusEnum.WAIT.getId() + "'"); if (list.size() == 0) { WhpSamplingPlan whpSamplingPlan = whpSamplingPlanService.selectById(whpSamplingPlanTask.getPlanId()); whpSamplingPlan.setStatus(SamplingPlanStatusEnum.SAMPLING.getId()); whpSamplingPlanService.update(whpSamplingPlan); } return Result.success(); } /** * 页面跳转:详情页面 * * @Author: 李晨 * @Date: 2022/12/29 **/ @RequestMapping("/view.do") public String view(HttpServletRequest request, Model model, String id ) { WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); model.addAttribute("bean", whpSamplingPlanTask); //现场采样情况 model.addAttribute("samplingPlanTaskEnvDropDown", SamplingPlanTaskEnvEnum.getAll4JSON()); //样品外观 model.addAttribute("sampleAppearanceDropDown", SampleAppearanceEnum.getAll4JSON()); //样品上清液 model.addAttribute("sampleSupernatantDropDown", SampleSupernatantEnum.getAll4JSON()); //样品性质 model.addAttribute("sampleNatureDropDown", SampleNatureEnum.getAll4JSON()); //样品状态 model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); return "whp/plan/WhpSamplingPlanTaskView"; } /** * 批量接单 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/confirms.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { for (String id : ids.split(",")) { confirm(request, id); } return Result.success(); } /** * 是否检测更新 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/isTest.do") @ResponseBody public Result isTest(String id, Boolean isTest) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setIsTest(isTest); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 检测项目更新 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/testItems.do") @ResponseBody public Result testItems(String id, String testItemIds) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setTestItemIds(testItemIds); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 样品数量更新 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/amount.do") @ResponseBody public Result amount(String id, Integer amount) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setSampleAmount(amount); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 样品状态更新 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/state.do") @ResponseBody public Result state(String id, Integer state) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setSampleState(state); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 样品外观更新 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/appearance.do") @ResponseBody public Result appearance(String id, Integer appearance) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setSampleAppearance(appearance); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 样品上清液 * * @Author: * @Date: 2022/12/30 **/ @RequestMapping("/supernatant.do") @ResponseBody public Result supernatant(String id, Integer supernatant) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setSampleSupernatant(supernatant); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 样品性质 * * @Author: * @Date: 2022/12/30 **/ @RequestMapping("/nature.do") @ResponseBody public Result nature(String id, Integer nature) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setId(id); bean.setSampleNature(nature); whpSamplingPlanTaskService.update(bean); return Result.success(); } /** * 退回 * * @Author: 李晨 * @Date: 2022/12/30 **/ @RequestMapping("/reject.do") @ResponseBody public Result reject(String id) { //采样任务状态修改 WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); whpSamplingPlanTask.setStatus(SamplingPlanTaskStatusEnum.REJECTION.getId()); whpSamplingPlanTaskService.update(whpSamplingPlanTask); //采样单状态修改 WhpSamplingPlan plan = new WhpSamplingPlan(); plan.setId(whpSamplingPlanTask.getPlanId()); plan.setStatus(SamplingPlanStatusEnum.SAMPLING.getId()); whpSamplingPlanService.update(plan); return Result.success(); } @RequestMapping("/dodeletes.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result dodeletes(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { ids = ids.replace(",", "','"); whpSamplingPlanTaskService.deleteByWhere("where id in ('" + ids + "') "); return Result.success(); } /** * 添加平行飞样 **/ @RequestMapping("/addPXFY.do") public String addPXFY(HttpServletRequest request, Model model) { String id = request.getParameter("id"); WhpSamplingPlanTask whpSamplingPlanTask = this.whpSamplingPlanTaskService.selectById(id); whpSamplingPlanTask.setId(CommUtil.getUUID()); whpSamplingPlanTask.setSampleCode("P" + whpSamplingPlanTask.getSampleCode()); whpSamplingPlanTask.setSampleAddress(whpSamplingPlanTask.getSampleAddress() + " 平行"); List list = whpSamplingPlanTaskService.selectListByWhere(" where sample_code='" + whpSamplingPlanTask.getSampleCode() + "' "); if (list != null && list.size() > 0) { model.addAttribute("result", CommUtil.toJson(Result.failed("重复添加!"))); } else { int code = this.whpSamplingPlanTaskService.save(whpSamplingPlanTask); Result result = new Result(); if (code == Result.SUCCESS) { result = Result.success(code); } else { result = Result.failed("更新失败"); } model.addAttribute("result", CommUtil.toJson(result)); } return "result"; } /** * 地点(下拉) **/ @RequestMapping("/getAddress.do") public String getAddress(HttpServletRequest request, Model model) { String json = JSON.toJSONString(whpSamplingPlanTaskService.addressDropDown()); model.addAttribute("result", json); return "result"; } /** * 采样人(下拉) **/ @RequestMapping("/getSamplingUser.do") public String getSamplingUser(HttpServletRequest request, Model model) { String json = JSON.toJSONString(whpSamplingPlanTaskService.sampleUserDropDown()); model.addAttribute("result", json); return "result"; } /** * 采样类型(下拉) **/ @RequestMapping("/getSampleType.do") public String getSampleType(HttpServletRequest request, Model model) { String json = JSON.toJSONString(whpSampleTypeService.dropDownList()); model.addAttribute("result", json); return "result"; } /** * 界面数据 **/ @RequestMapping("/getWhpSamplingPlanTaskDataById.do") public String getWhpSamplingPlanTaskDataById(HttpServletRequest request, Model model) { String id = request.getParameter("id"); User cu = (User) request.getSession().getAttribute("cu"); WhpSamplingPlanTask whpSamplingPlanTask = whpSamplingPlanTaskService.selectById(id); if (StringUtils.isEmpty(whpSamplingPlanTask.getSamplingUserId())) { whpSamplingPlanTask.setSamplingUserId(cu.getId()); whpSamplingPlanTask.setSamplingUserName(cu.getCaption()); } model.addAttribute("result", JSON.toJSONString(whpSamplingPlanTask)); return "result"; } /** * 现场采样情况 **/ @RequestMapping("/getSamplingPlanTaskEnv.do") public String getSamplingPlanTaskEnv(HttpServletRequest request, Model model) { String json = JSON.toJSONString(SamplingPlanTaskEnvEnum.getAll4JSON()); model.addAttribute("result", json); return "result"; } /** * 样品外观 **/ @RequestMapping("/getSampleAppearanceDrop.do") public String getSampleAppearanceDrop(HttpServletRequest request, Model model) { String json = JSON.toJSONString(SampleAppearanceEnum.getAll4JSON()); model.addAttribute("result", json); return "result"; } /** * 样品上清液 **/ @RequestMapping("/getSampleSupernatantDrop.do") public String getSampleSupernatantDrop(HttpServletRequest request, Model model) { String json = JSON.toJSONString(SampleSupernatantEnum.getAll4JSON()); model.addAttribute("result", json); return "result"; } /** * 样品性质 **/ @RequestMapping("/getSampleNatureDrop.do") public String getSampleNatureDrop(HttpServletRequest request, Model model) { String json = JSON.toJSONString(SampleNatureEnum.getAll4JSON()); model.addAttribute("result", json); return "result"; } /** * 样品状态 **/ @RequestMapping("/getSampleStateDrop.do") public String getSampleStateDrop(HttpServletRequest request, Model model) { String json = JSON.toJSONString(SampleStateEnum.getAll4JSON()); model.addAttribute("result", json); return "result"; } } \ No newline at end of file diff --git a/src/com/sipai/controller/whp/sample/WhpResidualSampleDisposeController.java b/src/com/sipai/controller/whp/sample/WhpResidualSampleDisposeController.java deleted file mode 100644 index 89938ef9..00000000 --- a/src/com/sipai/controller/whp/sample/WhpResidualSampleDisposeController.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.sipai.controller.whp.sample; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskVo; -import com.sipai.service.whp.baseinfo.WhpResidualSampleDisposeTypeService; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * 余样处置Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/sample/ResidualSampleDispose") -public class WhpResidualSampleDisposeController { - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpResidualSampleDisposeTypeService whpResidualSampleDisposeTypeService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - //查询采样类型 - model.addAttribute("sampleTypeDropDown", JSON.toJSONString(whpSampleTypeService.dropDownList())); - //处置方式 - model.addAttribute("disposeTypeDropDown", JSON.toJSONString(whpResidualSampleDisposeTypeService.dropDownList())); -// //样品状态 -// model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); - //状态 - model.addAttribute("disposeStatusDropDown", ResidualSampleDisposeStatusEnum.getAllEnableType4JSON()); - return "whp/sample/WhpResidualSampleDisposeList"; - } - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanTaskQuery query - ) { - //query.setDisposeStatus(ResidualSampleDisposeStatusEnum.AUDIT.getId()); - PageHelper.startPage(page, rows); - List list = whpSamplingPlanTaskService.queryListNoTemplate(query); - List voList = new ArrayList<>(); - // 编辑列表需要的字段 - for (WhpSamplingPlanTask item : list) { - WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setSampleAppearanceName(SampleAppearanceEnum.getNameByid(item.getSampleAppearance())); - vo.setSmpleSupernatantName(SampleSupernatantEnum.getNameByid(item.getSampleSupernatant())); - vo.setSampleNatureName(SampleNatureEnum.getNameByid(item.getSampleNature())); - - vo.setDisposeStatusName(ResidualSampleDisposeStatusEnum.getNameByid(item.getDisposeStatus())); - vo.setStatusName(SamplingPlanTaskStatusEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:余样审核页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlanTask task = whpSamplingPlanTaskService.selectById(id); - model.addAttribute("bean", task); - model.addAttribute("cu", cu); - //处置方式 - model.addAttribute("disposeTypeDropDownList", JSON.toJSONString(whpResidualSampleDisposeTypeService.dropDownList())); - return "whp/sample/ResidualSampleDisposeEdit"; - } - - - /** - * 通过 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/pass.do") - @ResponseBody - public Result pass(HttpServletRequest request, Model model, WhpSamplingPlanTask bean - ) { - bean.setAuditTime(DateUtil.toStr(null, new Date())); - bean.setDisposeStatus(ResidualSampleDisposeStatusEnum.DONE.getId()); - whpSamplingPlanTaskService.update(bean); - return Result.success(); - } - - /** - * 退回 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/notPass.do") - @ResponseBody - public Result notPass(HttpServletRequest request, Model model, WhpSamplingPlanTask bean - ) { - - bean.setDisposeStatus(ResidualSampleDisposeStatusEnum.REJECT.getId()); - whpSamplingPlanTaskService.update(bean); - return Result.success(); - } - - - /** - * 页面跳转:余样审核浏览页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, - String id - ) { - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlanTask task = whpSamplingPlanTaskService.selectById(id); - model.addAttribute("bean", task); - - //处置方式 - model.addAttribute("disposeTypeDropDownList", JSON.toJSONString(whpResidualSampleDisposeTypeService.dropDownList())); - //处置状态 - model.addAttribute("disposeStatusDropDownList", ResidualSampleDisposeStatusEnum.getAllEnableType4JSON()); - return "whp/sample/ResidualSampleDisposeView"; - } - - /** - * 界面数据 - **/ - @RequestMapping("/getResidualSampleDisposeDataById.do") - public String getResidualSampleDisposeDataById(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlanTask task = whpSamplingPlanTaskService.selectById(id); - model.addAttribute("bean", task); - return "result"; - } - - /** - * 处置方式 - **/ - @RequestMapping("/getDisposeType.do") - public String getDisposeType(HttpServletRequest request, Model model) { - String json = JSON.toJSONString(whpResidualSampleDisposeTypeService.dropDownList()); - model.addAttribute("result", json); - return "result"; - } - - /** - * 处置状态 - **/ - @RequestMapping("/getDisposeStatus.do") - public String getDisposeStatus(HttpServletRequest request, Model model) { - String json = JSON.toJSONString(ResidualSampleDisposeStatusEnum.getAllEnableType4JSON()); - model.addAttribute("result", json); - return "result"; - } - -} diff --git a/src/com/sipai/controller/whp/sample/WhpResidualSampleManagementController.java b/src/com/sipai/controller/whp/sample/WhpResidualSampleManagementController.java deleted file mode 100644 index 2a96560d..00000000 --- a/src/com/sipai/controller/whp/sample/WhpResidualSampleManagementController.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.controller.whp.sample; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskVo; -import com.sipai.service.whp.baseinfo.WhpResidualSampleDisposeTypeService; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 余样管理Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/sample/ResidualSampleManagement") -public class WhpResidualSampleManagementController { - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpResidualSampleDisposeTypeService whpResidualSampleDisposeTypeService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - //查询采样类型 - model.addAttribute("sampleTypeDropDown", JSON.toJSONString(whpSampleTypeService.dropDownList())); - //处置方式 - model.addAttribute("disposeTypeDropDown", JSON.toJSONString(whpResidualSampleDisposeTypeService.dropDownList())); - //样品状态 - model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); - //查询计划状态 - model.addAttribute("statusDropDown", SamplingPlanStatusEnum.getAll4JSON()); - return "whp/SampleManagement/WhpResidualSampleList"; - } - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanTaskQuery query - ) { - query.setStatus(SamplingPlanTaskStatusEnum.DONE.getId()); - PageHelper.startPage(page, rows); - List list = whpSamplingPlanTaskService.queryListNoTemplate(query); - List voList = new ArrayList<>(); - // 编辑列表需要的字段 - for (WhpSamplingPlanTask item : list) { - WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setSampleAppearanceName(SampleAppearanceEnum.getNameByid(item.getSampleAppearance())); - vo.setSmpleSupernatantName(SampleSupernatantEnum.getNameByid(item.getSampleSupernatant())); - vo.setSampleNatureName(SampleNatureEnum.getNameByid(item.getSampleNature())); - vo.setDisposeStatusName(ResidualSampleDisposeStatusEnum.getNameByid(item.getDisposeStatus())); - vo.setStatusName(SamplingPlanTaskStatusEnum.getNameByid(item.getStatus())); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlanTask task = whpSamplingPlanTaskService.selectById(id); - model.addAttribute("bean", task); - model.addAttribute("cu", cu); - //处置方式 - model.addAttribute("disposeTypeDropDownList", JSON.toJSONString(whpResidualSampleDisposeTypeService.dropDownList())); - return "whp/SampleManagement/WhpResidualSampleEdit"; - } - - - /** - * 保存 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpSamplingPlanTask bean - ) { - - bean.setDisposeStatus(ResidualSampleDisposeStatusEnum.AUDIT.getId()); - bean.setDisposeTypeName(whpResidualSampleDisposeTypeService.selectById(bean.getDisposeTypeId()).getName()); - whpSamplingPlanTaskService.update(bean); - return Result.success(); - } - -} diff --git a/src/com/sipai/controller/whp/sample/WhpSampleRepositoryController.java b/src/com/sipai/controller/whp/sample/WhpSampleRepositoryController.java deleted file mode 100644 index 8590d10d..00000000 --- a/src/com/sipai/controller/whp/sample/WhpSampleRepositoryController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.controller.whp.sample; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskVo; -import com.sipai.service.whp.baseinfo.WhpResidualSampleDisposeTypeService; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 样品库Controller类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Controller -@RequestMapping("/whp/sample/WhpSampleRepository") -public class WhpSampleRepositoryController { - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpResidualSampleDisposeTypeService whpResidualSampleDisposeTypeService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - //查询采样类型 - List enumJsonObjects = new ArrayList<>(); - enumJsonObjects.add(new EnumJsonObject("","所有采样类型","","")); - List dropDownList = whpSampleTypeService.dropDownList(); - enumJsonObjects.addAll(dropDownList); - model.addAttribute("sampleTypeDropDown", JSON.toJSONString(enumJsonObjects)); - //处置方式 - model.addAttribute("disposeStatusDropDown", ResidualSampleDisposeStatusEnum.getAllEnableType4JSON()); - //样品状态 - model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); - //查询计划状态 - model.addAttribute("statusDropDown", SamplingPlanTaskStatusEnum.getAll4JsonWithOutTemplate()); - return "whp/sample/WhpSampleRepositoryList"; - } - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanTaskQuery query - ) { - PageHelper.startPage(page, rows); - List list = whpSamplingPlanTaskService.queryListNoTemplate(query); - List voList = new ArrayList<>(); - // 编辑列表需要的字段 - for (WhpSamplingPlanTask item : list) { - WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); - BeanUtils.copyProperties(item, vo); - - // 此处加工Vo数据 - vo.setSampleAppearanceName(SampleAppearanceEnum.getNameByid(item.getSampleAppearance())); - vo.setSmpleSupernatantName(SampleSupernatantEnum.getNameByid(item.getSampleSupernatant())); - vo.setSampleNatureName(SampleNatureEnum.getNameByid(item.getSampleNature())); - vo.setDisposeStatusName(ResidualSampleDisposeStatusEnum.getNameByid(item.getDisposeStatus())); - vo.setStatusName(whpSamplingPlanTaskService.writeStatusString(item)); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - @RequestMapping("/view.do") - public String doedit(HttpServletRequest request, Model model, - String id - ) { - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlanTaskVo vo = new WhpSamplingPlanTaskVo(); - - - - WhpSamplingPlanTask task = whpSamplingPlanTaskService.selectById(id); - BeanUtils.copyProperties(task,vo); - - vo.setSampleAppearanceName(SampleAppearanceEnum.getNameByid(task.getSampleAppearance())); - if(task.getSampleSupernatant()!=null) - { - vo.setSmpleSupernatantName(SampleSupernatantEnum.getNameByid(task.getSampleSupernatant())); - } - if (task.getSampleNature()!=null) - { - vo.setSampleNatureName(SampleNatureEnum.getNameByid(task.getSampleNature())); - } - - if(task.getSampleState()!=null) - { - vo.setSampleStateName(SampleStateEnum.getNameByid(task.getSampleState())); - } - if (task.getSamplingEnv()!=null) - { - vo.setSamplingCondition(SamplingPlanTaskEnvEnum.getNameByid(task.getSamplingEnv())); - } - if (task.getDisposeStatus()!=null) { - vo.setDisposeStatusName(ResidualSampleDisposeStatusEnum.getNameByid(task.getDisposeStatus())); - } - - model.addAttribute("bean", vo); - model.addAttribute("cu", cu); - - return "whp/sample/WhpSampleRepositoryView"; - } - -} diff --git a/src/com/sipai/controller/whp/test/WhpSamplingPlanAuditController.java b/src/com/sipai/controller/whp/test/WhpSamplingPlanAuditController.java deleted file mode 100644 index 0f7ae1c7..00000000 --- a/src/com/sipai/controller/whp/test/WhpSamplingPlanAuditController.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.sipai.controller.whp.test; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanVo; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItem; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.baseinfo.WhpTestItemService; -import com.sipai.service.whp.plan.WhpSamplingPlanService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestItemService; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * 采样计划审核 - * - * @Author: lichen - * @Date: 2023/1/4 - **/ -@Controller -@RequestMapping("/whp/test/WhpSamplingPlanAudit") -public class WhpSamplingPlanAuditController { - - @Resource - private WhpSamplingPlanService whpSamplingPlanService; - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpTestItemService whpTestItemService; - @Resource - private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; - @Resource - private WhpSamplingPlanTaskTestConfirmService whpSamplingPlanTaskTestConfirmService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/showListForAudit.do") - public String showListForTest(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - //任务状态(下拉) - model.addAttribute("statusDropDown", SamplingPlanStatusEnum.getAll4JSONOUTTEMPLATE()); - //采样类型(下拉) - model.addAttribute("sampleTypeDropDown", JSON.toJSONString(whpSampleTypeService.dropDownList())); - - return "whp/test/WhpSamplingPlanTaskListForAudit"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanQuery query - ) { - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpSamplingPlanService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSamplingPlan item : list) { - - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(item, vo); - // 此处加工Vo数据 - vo.setStatusName(whpSamplingPlanService.writeStatusString(item)); - vo.setTaskNumber(whpSamplingPlanTaskService.selectListByPlanId(item.getId()).size()); - voList.add(vo); - - - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - - - - /** - * 页面跳转:详情页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id - ) { - WhpSamplingPlan bean = whpSamplingPlanService.selectById(id); - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(bean,vo); - vo.setTaskNumber(whpSamplingPlanTaskService.selectListByPlanId(bean.getId()).size()); - //采样单内容 - model.addAttribute("bean", vo); - return "whp/test/WhpSamplingPlanTaskListForAuditView"; - } - - /** - * 页面跳转:审核页面 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlan bean = whpSamplingPlanService.selectById(id); - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(bean,vo); - vo.setTaskNumber(whpSamplingPlanTaskService.selectListByPlanId(bean.getId()).size()); - //采样单内容 - model.addAttribute("bean", vo); - - //外观 - model.addAttribute("sampleAppearanceDropDown", SampleAppearanceEnum.getAll4JSON()); - //样品上清液 - model.addAttribute("sampleSupernatantDropDown", SampleSupernatantEnum.getAll4JSON()); - //样品性质 - model.addAttribute("sampleNatureDropDown", SampleNatureEnum.getAll4JSON()); - //状态 - model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); - //审核结果 - model.addAttribute("auditStatusDropDown", SamplingPlanStatusEnum.getIsAudit4JSON()); - return "whp/test/WhpSamplingPlanTaskListForAuditEdit"; - } - - /** - * 保存 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result update(HttpServletRequest request, Model model, WhpSamplingPlan bean - - ) { - //保存时不提交审核结果 - bean.setStatus(null); - whpSamplingPlanService.update(bean); - return Result.success(); - } - - /** - * 保存并提交 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/submit.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result submit(WhpSamplingPlan plan) throws BizCheckException { - //更新计划 - whpSamplingPlanService.update(plan); - if (plan.getStatus() == SamplingPlanStatusEnum.ALL_DONE.getId()) { - - //更新采样任务 - whpSamplingPlanTaskService.updateStatusByPlanId(plan.getId(), SamplingPlanTaskStatusEnum.DONE.getId()); - - }else{ - List confirmslist=whpSamplingPlanTaskTestConfirmService.selectListByWhere("where plan_id='"+plan.getId()+"'"); - if(confirmslist!=null&&confirmslist.size()>0) - { - for (WhpSamplingPlanTaskTestConfirm confirm:confirmslist) - { - confirm.setStatus(SamplingPlanTaskTestConfirmStatusEnum.BACK_FROM_AUDIT.getId()); - whpSamplingPlanTaskTestConfirmService.update(confirm); - WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); - testItem.setTestConfirmId(confirm.getId()); - testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.TEST.getId()); - whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem); - } - } - } - return Result.success(); - } - - - -} diff --git a/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskAuditController.java b/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskAuditController.java deleted file mode 100644 index ff644441..00000000 --- a/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskAuditController.java +++ /dev/null @@ -1,305 +0,0 @@ -package com.sipai.controller.whp.test; - -import com.alibaba.fastjson.JSON; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpTestItem; -import com.sipai.entity.whp.baseinfo.WhpTestMethod; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.plan.WhpSamplingPlanVo; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItem; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.baseinfo.WhpTestItemService; -import com.sipai.service.whp.baseinfo.WhpTestMethodService; -import com.sipai.service.whp.baseinfo.WhpTestOrgService; -import com.sipai.service.whp.plan.WhpSamplingPlanService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestItemService; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * 检测任务下达 - * - * @Author: lichen - * @Date: 2023/1/4 - **/ -@Controller -@RequestMapping("/whp/test/WhpSamplingPlanTaskAudit") -public class WhpSamplingPlanTaskAuditController { - - @Resource - private WhpSamplingPlanService whpSamplingPlanService; - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpTestItemService whpTestItemService; - @Resource - private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; - @Resource - private WhpSamplingPlanTaskTestConfirmService whpSamplingPlanTaskTestConfirmService; - - @Resource - private WhpTestMethodService whpTestMethodService; - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/showListForTest.do") - public String showListForTest(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - //任务状态(下拉) - model.addAttribute("statusDropDown", SamplingPlanTaskStatusEnum.getAll4JSON()); - //采样类型(下拉) - model.addAttribute("sampleTypeDropDown", JSON.toJSONString(whpSampleTypeService.dropDownList())); - - return "whp/test/WhpSamplingPlanTaskListForTest"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanQuery query - ) { - query.setStatus(SamplingPlanStatusEnum.SAMPLING_DONE.getId()); - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpSamplingPlanService.queryList(query); - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSamplingPlan item : list) { - - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(item, vo); - // 此处加工Vo数据 - vo.setStatusName(SamplingPlanStatusEnum.getNameByid(item.getStatus())); - vo.setTaskNumber(whpSamplingPlanTaskService.selectListByPlanId(item.getId()).size()); - voList.add(vo); - - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面跳转:详情页面 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, String id - ) { - WhpSamplingPlan bean = whpSamplingPlanService.selectById(id); - WhpSamplingPlanVo vo = new WhpSamplingPlanVo(); - BeanUtils.copyProperties(bean,vo); - vo.setTaskNumber(whpSamplingPlanTaskService.selectListByPlanId(bean.getId()).size()); - //采样单内容 - model.addAttribute("bean", vo); - return "whp/test/WhpSamplingPlanTaskView"; - } - - /** - * 页面跳转:下发页面 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, String id - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - WhpSamplingPlan bean = whpSamplingPlanService.selectById(id); - //采样单内容 - model.addAttribute("bean", bean); - //外观 - model.addAttribute("sampleAppearanceDropDown", SampleAppearanceEnum.getAll4JSON()); - //样品上清液 - model.addAttribute("sampleSupernatantDropDown", SampleSupernatantEnum.getAll4JSON()); - //样品性质 - model.addAttribute("sampleNatureDropDown", SampleNatureEnum.getAll4JSON()); - //状态 - model.addAttribute("sampleStateDropDown", SampleStateEnum.getAll4JSON()); - model.addAttribute("whpTestItemDropDown", JSON.toJSONString(whpTestItemService.testItemDropDownList())); - //外送样检测机构 - model.addAttribute("sampleTestOrgDropDown", JSON.toJSONString( whpTestOrgService.dropDown())); - return "whp/test/WhpSamplingPlanTaskEditForTest"; - } - @Resource - private WhpTestOrgService whpTestOrgService; - /** - * 保存 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result update(HttpServletRequest request, Model model, WhpSamplingPlan bean - - ) { - whpSamplingPlanService.update(bean); - return Result.success(); - } - - /** - * 下发 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - @RequestMapping("/submit.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result submit(HttpServletRequest request,WhpSamplingPlan plan) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); - //1.先检查任务的状态全部是采样完成 - List taskList = whpSamplingPlanTaskService.selectListByPlanId(plan.getId()); - for (WhpSamplingPlanTask task : taskList) { - if (task.getStatus() != SamplingPlanTaskStatusEnum.AUDIT.getId()) { - throw new BizCheckException("该采样计划存在未完成的采样任务!"); - } - } - //2.更新采样单状态 - plan.setAcceptDate(DateUtil.toStr(null,new Date())); - plan.setAcceptUserId(cu.getId()); - plan.setAcceptUserName(cu.getCaption()); - plan.setStatus(SamplingPlanStatusEnum.TESTING.getId()); - whpSamplingPlanService.update(plan); - plan = whpSamplingPlanService.selectById(plan.getId()); - - //3.拆解任务 - List testItemIdList = new ArrayList<>(); - List testItemList = new ArrayList<>(); - for (WhpSamplingPlanTask task : taskList) { - if(task.getIsTest()) { - String[] testItemArr = task.getTestItemIds().split(","); - for (String testItemId : testItemArr) { - WhpTestItem testItemInfo = whpTestItemService.selectById(testItemId); - testItemInfo.setSamplingDate(task.getSamplingTime()); - if (!testItemIdList.contains(testItemId)) { - testItemIdList.add(testItemId); - testItemList.add(testItemInfo); - } - WhpSamplingPlanTaskTestItem planTaskTestItem = new WhpSamplingPlanTaskTestItem(); - planTaskTestItem.setPlanId(plan.getId()); - planTaskTestItem.setPlanCode(plan.getCode()); - planTaskTestItem.setSampleTypeId(plan.getSampleTypeId()); - planTaskTestItem.setSampleTypeName(plan.getSampleTypeName()); - planTaskTestItem.setPlanDate(plan.getDate()); - planTaskTestItem.setReportDate(plan.getReportDate()); - planTaskTestItem.setSampingDate(task.getSamplingTime()); - planTaskTestItem.setStatus(SamplingPlanTaskTestItemStatusEnum.WAIT.getId()); - planTaskTestItem.setSampleCode(task.getSampleCode()); - planTaskTestItem.setTestItemId(testItemId); - planTaskTestItem.setTestItemName(testItemInfo.getName()); - planTaskTestItem.setUnit(task.getUnit()); - whpSamplingPlanTaskTestItemService.save(planTaskTestItem); - } - //4.更新采样任务的状态 - task.setStatus(SamplingPlanTaskStatusEnum.TEST.getId()); - whpSamplingPlanTaskService.update(task); - } - } - //5. 更新检测项目分组状态 - for (WhpTestItem item : testItemList) { - WhpSamplingPlanTaskTestConfirm confirm = new WhpSamplingPlanTaskTestConfirm(); - confirm.setPlanId(plan.getId()); - confirm.setPlanCode(plan.getCode()); - confirm.setSampleTypeId(plan.getSampleTypeId()); - confirm.setSampleTypeName(plan.getSampleTypeName()); - confirm.setConfirmUserId(item.getConfirmUserId()); - confirm.setConfirmUserName(item.getConfirmUserName()); - confirm.setTestAddress(item.getTestAddress()); - confirm.setStatus(SamplingPlanTaskTestConfirmStatusEnum.WAIT.getId()); - confirm.setTestItemId(item.getId()); - confirm.setTestItemName(item.getName()); - confirm.setPlanDate(plan.getDate()); - confirm.setReportDate(plan.getReportDate()); - confirm.setSamplingDate(item.getSamplingDate()); - List methods=whpTestMethodService.selectListByWhere(" where test_item_id='"+item.getId()+"'"); - if (methods!=null&&methods.size()>0) - { - confirm.setMethod(methods.get(0).getId()); - } - - whpSamplingPlanTaskTestConfirmService.save(confirm); - whpSamplingPlanTaskTestItemService.updateConfirmId(confirm); - } - - return Result.success(); - } - - - /** - * 测试接口 - * @param request - * @param model - * @return - */ - @RequestMapping("/test1111.do") - public void test1111(HttpServletRequest request, Model model, @RequestParam("method") String method, @RequestParam("params") String params) { - System.out.println("================================="); - System.out.println(params); - System.out.println("================================="); - } - /** - * 测试接口 - * @param request - * @param model - * @return - */ - @RequestMapping("/testWhp.do") - public void testAPI(HttpServletRequest request, Model model) { - System.out.println("================================="); -// whpSamplingPlanService.syncSamplingPlan(); - whpSamplingPlanTaskTestConfirmService.syncSamplingPlanTask(); - System.out.println("================================="); - } -} diff --git a/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskTestConfirmController.java b/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskTestConfirmController.java deleted file mode 100644 index 30acaccd..00000000 --- a/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskTestConfirmController.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.controller.whp.test; import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sipai.entity.base.Result; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.enums.whp.SamplingPlanTaskStatusEnum; import com.sipai.entity.enums.whp.SamplingPlanTaskTestConfirmStatusEnum; import com.sipai.entity.enums.whp.SamplingPlanTaskTestItemStatusEnum; import com.sipai.entity.enums.whp.TableHeader; import com.sipai.entity.scada.MPoint; import com.sipai.entity.user.User; import com.sipai.entity.whp.baseinfo.*; import com.sipai.entity.whp.plan.WhpSamplingPlanTask; import com.sipai.entity.whp.test.*; import com.sipai.service.scada.MPointService; import com.sipai.service.whp.baseinfo.*; import com.sipai.service.whp.plan.WhpSamplingPlanService; import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; import com.sipai.service.whp.test.WhpSamplingPlanTaskTestItemService; import com.sipai.service.whp.test.WhpTaskItemCurveService; import com.sipai.tools.DateUtil; import net.sf.json.JSONArray; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.UUID; /** * 计划单检测项目分组信息Controller类 * * @Author: 李晨 * @Date: 2023/1/5 **/ @Controller @RequestMapping("/whp/test/WhpSamplingPlanTaskTestConfirm") public class WhpSamplingPlanTaskTestConfirmController { @Resource private WhpSamplingPlanService whpSamplingPlanService; @Resource private WhpSamplingPlanTaskTestConfirmService whpSamplingPlanTaskTestConfirmService; @Resource private WhpSampleTypeService sampleTypeService; @Resource private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; @Resource private WhpTestItemWorkingCurveService whpTestItemWorkingCurveService; @Resource private WhpEquipmentService whpEquipmentService; @Resource private WhpTestItemWorkingCurveService workingCurveService; @Resource private MPointService mPointService; @Resource private WhpTaskItemCurveService whpTaskItemCurveService; @Resource private WhpTestMethodService whpTestMethodService; @Resource private WhpTestItemService whpTestItemService; @Resource private WhpSamplingPlanTaskService whpSamplingPlanTaskService; /** * 页面跳转:我的任务 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/showListForTestTask.do") public String showListForTestTask(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); //登录人id model.addAttribute("loginUserId", cu.getId()); //采样类型 model.addAttribute("sampleTypeDropDown", JSON.toJSONString(sampleTypeService.dropDownList())); //我的任务任务状态 model.addAttribute("StatusDropDown", SamplingPlanTaskTestConfirmStatusEnum.getAll4JsonWithInTask()); return "whp/test/WhpSamplingPlanTaskTestTask"; } /** * 页面跳转:检验任务管理 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/showListForTestConfirm.do") public String showListForTestConfirm(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); //登录人id model.addAttribute("loginUserId", cu.getId()); //采样类型 model.addAttribute("sampleTypeDropDown", JSON.toJSONString(sampleTypeService.dropDownList())); //我的任务任务状态 model.addAttribute("StatusDropDown", SamplingPlanTaskTestConfirmStatusEnum.getAll4JsonWithInCONFIRM()); return "whp/test/WhpSamplingPlanTaskConfirmList"; } /** * 检测项目下拉 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/TestItemTree.do") @ResponseBody public Result dosave(HttpServletRequest request, String testItemName ) { WhpSamplingPlanTaskTestConfirmQuery query = new WhpSamplingPlanTaskTestConfirmQuery(); User cu = (User) request.getSession().getAttribute("cu"); //query.setDeptId(cu.getPid()); query.setLikeString(testItemName); return Result.success(whpSamplingPlanTaskTestConfirmService.testItemTree(query)); } /** * 获取列表 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/getList.do") public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpSamplingPlanTaskTestConfirmQuery query ) { String whereStr = ""; User cu = (User) request.getSession().getAttribute("cu"); String user_unitId = cu.getPid(); //获取检验任务管理下 人员对应部门的 检测项目 String testItemIds = ""; List WhpTestItem_list = whpTestItemService.selectListByWhere(" where dept_ids like '%" + user_unitId + "%' "); if (WhpTestItem_list != null && WhpTestItem_list.size() > 0) { for (int i = 0; i < WhpTestItem_list.size(); i++) { testItemIds += WhpTestItem_list.get(i).getId() + ","; } } if (testItemIds.length() > 0) { // testItemIds = testItemIds.replaceAll(",", "','"); testItemIds = "'"+testItemIds.replace(",","','")+"'"; }else{ testItemIds = ""; } // Sy打打 stem.out.println(testItemIds);,'2093a295-b9ff-4f41-9118-32af3f3a4746" query.setTestItemIds(testItemIds); PageHelper.startPage(page, rows); List list = whpSamplingPlanTaskTestConfirmService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpSamplingPlanTaskTestConfirm item : list) { WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 vo.setStatusName(whpSamplingPlanTaskTestConfirmService.writeStatusString(item)); vo.setSamplingTaskNumber(whpSamplingPlanTaskTestItemService.countByConfirmId(item.getId())); if (item.getConfirmDate() == null || item.getConfirmDate() == "") { vo.setConfirmUserName(""); } voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 获取列表 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/getIndexTaskList.do") public ModelAndView getIndexTaskList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpSamplingPlanTaskTestConfirmQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); query.setTestUserId(cu.getId()); query.setStatus(SamplingPlanTaskTestConfirmStatusEnum.TEST.getId()); PageHelper.startPage(page, rows); List list = whpSamplingPlanTaskTestConfirmService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpSamplingPlanTaskTestConfirm item : list) { WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 vo.setStatusName(whpSamplingPlanTaskTestConfirmService.writeIndexStatusString(item)); vo.setSamplingTaskNumber(whpSamplingPlanTaskTestItemService.countByConfirmId(item.getId())); voList.add(vo); } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 保存检测结果 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/update.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestConfirmVo bean ) { User cu = (User) request.getSession().getAttribute("cu"); List contantlist = bean.getContantCurvelist(); if (bean.getContantCurvelist() != null) { for (int i = 0; i < contantlist.size(); i++) { WhpTaskItemCurve taskItemCurve = contantlist.get(i); if (taskItemCurve.getId() != null && !taskItemCurve.getId().equals("")) { WhpTaskItemCurve whpTaskItemCurve = contantlist.get(0); whpTaskItemCurveService.update(contantlist.get(0)); /* WhpTestItemWorkingCurve whpTestItemWorkingCurve = new WhpTestItemWorkingCurve(); whpTestItemWorkingCurve.setId(taskItemCurve.getWorking_curve_id()); whpTestItemWorkingCurve.setDefault_value(taskItemCurve.getCalculated_value()); whpTestItemWorkingCurveService.update(whpTestItemWorkingCurve);*/ } else { taskItemCurve.setId(UUID.randomUUID().toString()); taskItemCurve.setPlan_code(bean.getPlanCode()); whpTaskItemCurveService.save(taskItemCurve); } } } whpSamplingPlanTaskTestConfirmService.update(bean); return Result.success(); } /** * 保存提交检测结果 *

* 2023.8.30 更新为 提交即复核完成 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/submit.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result submit(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestConfirm bean ) { User cu = (User) request.getSession().getAttribute("cu"); // bean.setStatus(SamplingPlanTaskTestConfirmStatusEnum.CONFIRM.getId()); // bean.setStatus(SamplingPlanTaskTestConfirmStatusEnum.AUDIT.getId()); whpSamplingPlanTaskTestConfirmService.update(bean); /* WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); testItem.setTestConfirmId(bean.getId()); testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.CONFIRM.getId());*/ WhpSamplingPlanTaskTestConfirm confirm = whpSamplingPlanTaskTestConfirmService.selectById(bean.getId()); // 检测完成提交 复核信息填写 confirm.setConfirmUserId(confirm.getTestUserId()); confirm.setConfirmUserName(confirm.getTestUserName()); confirm.setConfirmDate(confirm.getTestDate()); confirm.setStatus(SamplingPlanTaskTestConfirmStatusEnum.AUDIT.getId()); whpSamplingPlanTaskTestConfirmService.update(confirm); //更新检测项目 复核完成 WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); testItem.setTestConfirmId(bean.getId()); testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.AUDIT.getId()); whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem); whpSamplingPlanService.isTestConfirmDone(confirm.getPlanId()); return Result.success(); } /** * 保存提交检测复核结果 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/confirm.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result confirm(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestConfirmVo bean ) { User cu = (User) request.getSession().getAttribute("cu"); List contantlist = bean.getContantCurvelist(); if (contantlist != null) { for (int i = 0; i < contantlist.size(); i++) { WhpTaskItemCurve taskItemCurve = contantlist.get(i); if (taskItemCurve.getId() != null && !taskItemCurve.getId().equals("")) { whpTaskItemCurveService.update(contantlist.get(0)); } else { taskItemCurve.setId(UUID.randomUUID().toString()); taskItemCurve.setPlan_code(bean.getPlanCode()); whpTaskItemCurveService.save(taskItemCurve); } } } if (bean.getStatus() != SamplingPlanTaskTestConfirmStatusEnum.BACK_FROM_CONFIRM.getId()) { bean.setStatus(SamplingPlanTaskTestConfirmStatusEnum.AUDIT.getId()); WhpSamplingPlanTaskTestConfirm confirm = whpSamplingPlanTaskTestConfirmService.selectById(bean.getId()); whpSamplingPlanService.isTestConfirmDone(confirm.getPlanId()); WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); testItem.setTestConfirmId(bean.getId()); testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.AUDIT.getId()); whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem); } whpSamplingPlanTaskTestConfirmService.update(bean); return Result.success(); } /** * 页面跳转:接单弹窗 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/acceptShow.do") public String doedit(HttpServletRequest request, Model model, String id ) { WhpSamplingPlanTaskTestConfirm bean = whpSamplingPlanTaskTestConfirmService.selectById(id); WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(bean, vo); vo.setSamplingTaskNumber(whpSamplingPlanTaskTestItemService.countByConfirmId(bean.getId())); model.addAttribute("bean", vo); return "whp/test/WhpSamplingPlanTaskTestConfirmEditAccept"; } /** * 页面跳转:监测数据复核弹窗 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/confirmShow.do") public String confirmShow(HttpServletRequest request, Model model, String id ) { WhpSamplingPlanTaskTestConfirm whpSamplingPlanTaskTestConfirm = whpSamplingPlanTaskTestConfirmService.selectById(id); //查询结果公式 WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectByTestItemId(whpSamplingPlanTaskTestConfirm.getTestItemId()); if (curve.getKpi_id() != null) { // MPoint mPoint = mPointService.selectById(curve.getKpi_id()); if (mPoint != null) { whpSamplingPlanTaskTestConfirm.setWorkCurveName(mPoint.getExp()); } } WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(whpSamplingPlanTaskTestConfirm, vo); //查询 关联测点信息 List whpTestItemWorkingCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestConfirm.getTestItemId(), "1"); if (whpTestItemWorkingCurves != null && whpTestItemWorkingCurves.size() > 0) { for (WhpTestItemWorkingCurveVo item : whpTestItemWorkingCurves) { String sql = " where plan_code= '" + whpSamplingPlanTaskTestConfirm.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL"; List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); //若保存值不为空 则 替换为最新值 if (taskItemCurveList != null && taskItemCurveList.size() > 0) { item.setTaskitemCureid(taskItemCurveList.get(0).getId()); item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); } if (item.getMPoint() != null && item.getMPoint().getNumtail() != null) { //item.setDefault_value(item.getDefault_value().setScale(Integer.parseInt(item.getMPoint().getNumtail()),BigDecimal.ROUND_HALF_UP)); // item.setDefault_value(NumberUtil.roundHalfEven(item.getDefault_value(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); item.setDefault_value(item.getDefault_value()); } } } vo.setContantworkingCurveVoslist(whpTestItemWorkingCurves); // HashMap hashMap=new HashMap(); // JSONArray json = JSONArray.fromObject(voList); // String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; //表头 List tablelist = new ArrayList(); List list = workingCurveService.selectListByItem(whpSamplingPlanTaskTestConfirm.getTestItemId(), "0,2,3"); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { WhpTestItemWorkingCurveVo curveVo = list.get(i); TableHeader header = new TableHeader(); if (curveVo.getFormulatype().equals("0")) { header.setField(curveVo.getName()); header.setTitle(curveVo.getName()); header.setAlign("center"); header.setValign("middle"); } else { header.setField(curveVo.getMPoint().getMpointcode()); String parmname = curveVo.getMPoint().getParmname(); if (parmname.contains("(")) { parmname = parmname.substring(0, parmname.indexOf("(")); } if (parmname.contains("(")) { parmname = parmname.substring(0, parmname.indexOf("(")); } header.setTitle(parmname); header.setAlign("center"); header.setValign("middle"); } tablelist.add(header); } } JSONArray json = JSONArray.fromObject(tablelist); model.addAttribute("itemMethodDropDown", JSON.toJSONString(whpTestMethodService.testMethodDropDownList(whpSamplingPlanTaskTestConfirm.getTestItemId()))); model.addAttribute("tableheaders", json); model.addAttribute("confirmStatusDropDown", SamplingPlanTaskTestConfirmStatusEnum.getIsConfirm4JSON()); model.addAttribute("bean", vo); return "whp/test/WhpSamplingPlanTaskTestConfirmEditConfirm"; } /** * 接单 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/accept.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result accept(HttpServletRequest request, String id ) { User cu = (User) request.getSession().getAttribute("cu"); WhpSamplingPlanTaskTestConfirm bean = new WhpSamplingPlanTaskTestConfirm(); bean.setId(id); bean.setStatus(SamplingPlanTaskTestConfirmStatusEnum.TEST.getId()); bean.setTestUserId(cu.getId()); bean.setTestUserName(cu.getCaption()); whpSamplingPlanTaskTestConfirmService.update(bean); WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); testItem.setTestConfirmId(id); testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.TEST.getId()); whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem); return Result.success(); } /** * 撤销 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/back.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result back(HttpServletRequest request, String id ) { User cu = (User) request.getSession().getAttribute("cu"); WhpSamplingPlanTaskTestConfirm bean = new WhpSamplingPlanTaskTestConfirm(); bean.setId(id); bean.setStatus(SamplingPlanTaskTestConfirmStatusEnum.WAIT.getId()); bean.setTestUserId(""); bean.setTestUserName(""); whpSamplingPlanTaskTestConfirmService.update(bean); WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); testItem.setTestConfirmId(id); testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.WAIT.getId()); whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem); return Result.success(); } /** * 页面跳转:检测任务浏览页面 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/view.do") public String view(HttpServletRequest request, Model model, String id ) { WhpSamplingPlanTaskTestConfirm confirm = whpSamplingPlanTaskTestConfirmService.selectById(id); //查询结果公式 WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectByTestItemId(confirm.getTestItemId()); if (curve.getKpi_id() != null) { // MPoint mPoint = mPointService.selectById(curve.getKpi_id()); if (mPoint != null) { confirm.setWorkCurveName(mPoint.getExp()); } } WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(confirm, vo); //查询 关联测点信息 List whpTestItemWorkingCurves = workingCurveService.selectListByItem(confirm.getTestItemId(), "1"); if (whpTestItemWorkingCurves != null && whpTestItemWorkingCurves.size() > 0) { for (WhpTestItemWorkingCurveVo item : whpTestItemWorkingCurves) { String sql = " where plan_code= '" + confirm.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL"; List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); //若保存值不为空 则 替换为最新值 if (taskItemCurveList != null && taskItemCurveList.size() > 0) { item.setTaskitemCureid(taskItemCurveList.get(0).getId()); if (item.getMPoint().getNumtail() != null && item.getMPoint().getNumtail() != "") { // item.setDefault_value(taskItemCurveList.get(0).getCalculated_value().setScale(Integer.valueOf(item.getMPoint().getNumtail()), BigDecimal.ROUND_HALF_UP)); // item.setDefault_value(NumberUtil.roundHalfEven(taskItemCurveList.get(0).getCalculated_value(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); } else { item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); } } } } vo.setContantworkingCurveVoslist(whpTestItemWorkingCurves); // HashMap hashMap=new HashMap(); // JSONArray json = JSONArray.fromObject(voList); // String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; //表头 List tablelist = new ArrayList(); List list = workingCurveService.selectListByItem(confirm.getTestItemId(), "0,2,3"); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { WhpTestItemWorkingCurveVo curveVo = list.get(i); TableHeader header = new TableHeader(); if (curveVo.getFormulatype().equals("0")) { header.setField(curveVo.getName()); header.setTitle(curveVo.getName()); header.setAlign("center"); header.setValign("middle"); } else { header.setField(curveVo.getMPoint().getMpointcode()); header.setTitle(curveVo.getMPoint().getParmname()); header.setAlign("center"); header.setValign("middle"); } tablelist.add(header); } } JSONArray json = JSONArray.fromObject(tablelist); if (vo.getConfirmDate() == null || vo.getConfirmDate() == "") { vo.setConfirmUserName(""); } model.addAttribute("bean", vo); model.addAttribute("plan", whpSamplingPlanService.selectById(confirm.getPlanId())); // model.addAttribute("workCurveDropDown", ""); model.addAttribute("equipmentDropDown", JSON.toJSONString(whpEquipmentService.equipmentDropDownList())); model.addAttribute("itemMethodDropDown", JSON.toJSONString(whpTestMethodService.testMethodDropDownList(confirm.getTestItemId()))); model.addAttribute("tableheaders", json); // model.addAttribute("bean", confirm); // model.addAttribute("plan", whpSamplingPlanService.selectById(confirm.getPlanId())); model.addAttribute("confirmStatusDropDown", SamplingPlanTaskTestConfirmStatusEnum.getAll4JSON()); return "whp/test/WhpSamplingPlanTaskTestConfirmViewTest"; } /** * 批量接单 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/acceptBatch.do") @ResponseBody @Transactional(rollbackFor = Exception.class) public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { String[] idArr = ids.split(","); for (String id : idArr) { accept(request, id); } return Result.success(); } /** * 页面跳转:开始检测弹窗 * * @Author: 李晨 * @Date: 2023/1/5 **/ @RequestMapping("/showTest.do") public String showTest(HttpServletRequest request, Model model, String id ) { WhpSamplingPlanTaskTestConfirm whpSamplingPlanTaskTestConfirm = whpSamplingPlanTaskTestConfirmService.selectById(id); //查询结果公式 WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectByTestItemId(whpSamplingPlanTaskTestConfirm.getTestItemId()); if (curve.getKpi_id() != null) { // MPoint mPoint = mPointService.selectById(curve.getKpi_id()); if (mPoint != null) { whpSamplingPlanTaskTestConfirm.setWorkCurveName(mPoint.getExp()); } } WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(whpSamplingPlanTaskTestConfirm, vo); //查询 关联测点信息 List whpTestItemWorkingCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestConfirm.getTestItemId(), "1"); if (whpTestItemWorkingCurves != null && whpTestItemWorkingCurves.size() > 0) { // 查询是否 有常量 项目值 for (WhpTestItemWorkingCurveVo item : whpTestItemWorkingCurves) { String sql = " where plan_code= '" + whpSamplingPlanTaskTestConfirm.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL"; List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); //若保存值不为空 则 替换为最新值 if (taskItemCurveList != null && taskItemCurveList.size() > 0) { item.setTaskitemCureid(taskItemCurveList.get(0).getId()); if (item.getMPoint().getNumtail() != null && item.getMPoint().getNumtail() != "") { //item.setDefault_value(taskItemCurveList.get(0).getCalculated_value().setScale(Integer.valueOf(item.getMPoint().getNumtail()), BigDecimal.ROUND_HALF_UP)); // BigDecimal bigDecimal = NumberUtil.roundHalfEven(taskItemCurveList.get(0).getCalculated_value(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail()))); // item.setDefault_value(NumberUtil.roundHalfEven(taskItemCurveList.get(0).getCalculated_value(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); // BigDecimal calculated_value = new BigDecimal(5.203012); // item.setDefault_value(calculated_value); } else { item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); } } } } vo.setContantworkingCurveVoslist(whpTestItemWorkingCurves); // HashMap hashMap=new HashMap(); // JSONArray json = JSONArray.fromObject(voList); // String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; //表头 List tablelist = new ArrayList(); // 使用试剂为空,查询检测项目数据进行默认值赋值 if (vo.getReagent() == null) { // 检测项目 WhpTestItem whpTestItem = whpTestItemService.selectById(whpSamplingPlanTaskTestConfirm.getTestItemId()); vo.setReagent(whpTestItem.getReagent()); } List list = workingCurveService.selectListByItem(whpSamplingPlanTaskTestConfirm.getTestItemId(), "0,2,3"); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { WhpTestItemWorkingCurveVo curveVo = list.get(i); TableHeader header = new TableHeader(); if (curveVo.getFormulatype().equals("0")) { header.setField(curveVo.getName()); header.setTitle(curveVo.getName()); header.setAlign("center"); header.setValign("middle"); } else { header.setField(curveVo.getMPoint().getMpointcode()); String parmname = curveVo.getMPoint().getParmname(); if (parmname.contains("(")) { parmname = parmname.substring(0, parmname.indexOf("(")); } if (parmname.contains("(")) { parmname = parmname.substring(0, parmname.indexOf("(")); } header.setTitle(parmname); header.setAlign("center"); header.setValign("middle"); } tablelist.add(header); } } JSONArray json = JSONArray.fromObject(tablelist); model.addAttribute("bean", vo); model.addAttribute("plan", whpSamplingPlanService.selectById(whpSamplingPlanTaskTestConfirm.getPlanId())); // model.addAttribute("workCurveDropDown", ""); WhpTestItem testItem = whpTestItemService.selectById(vo.getTestItemId()); if (testItem.getEquipmentId() != null) { String equids = testItem.getEquipmentId().replaceAll(",", "','"); String sql = " where status = 1 and id in ('" + equids + "')"; model.addAttribute("equipmentDropDown", JSON.toJSONString(whpEquipmentService.equipmentDropDownListByWhere(sql))); } else { model.addAttribute("equipmentDropDown", ""); } // List enumJsonObjects = whpTestMethodService.testMethodDropDownList(whpSamplingPlanTaskTestConfirm.getTestItemId()); model.addAttribute("itemMethodDropDown", JSON.toJSONString(enumJsonObjects)); model.addAttribute("tableheaders", json); return "whp/test/WhpSamplingPlanTaskTestConfirmEditTest"; // return "whp/test/WhpSamplingPlanTaskTestConfirmViewTest"; } /** * 检测任务 检测画面数据 **/ @RequestMapping("/getWhpTestItemWorkingCurves.do") public String getWhpTestItemWorkingCurves(HttpServletRequest request, Model model) { String id = request.getParameter("id"); WhpSamplingPlanTaskTestConfirm whpSamplingPlanTaskTestConfirm = whpSamplingPlanTaskTestConfirmService.selectById(id); //查询结果公式 WhpTestItemWorkingCurve curve = whpTestItemWorkingCurveService.selectByTestItemId(whpSamplingPlanTaskTestConfirm.getTestItemId()); if (curve.getKpi_id() != null) { // MPoint mPoint = mPointService.selectById(curve.getKpi_id()); if (mPoint != null) { whpSamplingPlanTaskTestConfirm.setWorkCurveName(mPoint.getExp()); } } WhpSamplingPlanTaskTestConfirmVo vo = new WhpSamplingPlanTaskTestConfirmVo(); BeanUtils.copyProperties(whpSamplingPlanTaskTestConfirm, vo); //查询 关联测点信息 List whpTestItemWorkingCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestConfirm.getTestItemId(), "1"); if (whpTestItemWorkingCurves != null && whpTestItemWorkingCurves.size() > 0) { // 查询是否 有常量 项目值 for (WhpTestItemWorkingCurveVo item : whpTestItemWorkingCurves) { String sql = " where plan_code= '" + whpSamplingPlanTaskTestConfirm.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL"; List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); //若保存值不为空 则 替换为最新值 if (taskItemCurveList != null && taskItemCurveList.size() > 0) { item.setTaskitemCureid(taskItemCurveList.get(0).getId()); if (item.getMPoint().getNumtail() != null && item.getMPoint().getNumtail() != "") { //item.setDefault_value(taskItemCurveList.get(0).getCalculated_value().setScale(Integer.valueOf(item.getMPoint().getNumtail()), BigDecimal.ROUND_HALF_UP)); // item.setDefault_value(NumberUtil.roundHalfEven(taskItemCurveList.get(0).getCalculated_value(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); } else { item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); } } } } vo.setContantworkingCurveVoslist(whpTestItemWorkingCurves); // WhpTestItem testItem = whpTestItemService.selectById(vo.getTestItemId()); // if (testItem.getEquipmentId() != null) { // String equids = testItem.getEquipmentId().replaceAll(",", "','"); // String sql = " where status = 1 and id in ('" + equids + "')"; // model.addAttribute("equipmentDropDown", JSON.toJSONString(whpEquipmentService.equipmentDropDownListByWhere(sql))); // } String json = JSON.toJSONString(vo); model.addAttribute("result", json); return "result"; } /** * 检测任务 检测画面数据-仪器 **/ @RequestMapping("/getInstrumentData.do") public String getInstrumentData(HttpServletRequest request, Model model) { String id = request.getParameter("id"); WhpTestItem testItem = whpTestItemService.selectById(id); if (testItem.getEquipmentId() != null) { String equids = testItem.getEquipmentId().replaceAll(",", "','"); String sql = " where status = 1 and id in ('" + equids + "')"; model.addAttribute("result", JSON.toJSONString(whpEquipmentService.equipmentDropDownListByWhere(sql))); } else { model.addAttribute("result", ""); } return "result"; } /** * 检测任务 检测画面数据-方法依据 **/ @RequestMapping("/getMethodBasis.do") public String getMethodBasis(HttpServletRequest request, Model model) { String id = request.getParameter("id"); WhpSamplingPlanTaskTestConfirm whpSamplingPlanTaskTestConfirm = whpSamplingPlanTaskTestConfirmService.selectById(id); model.addAttribute("result", JSON.toJSONString(whpTestMethodService.testMethodDropDownList(whpSamplingPlanTaskTestConfirm.getTestItemId()))); return "result"; } /** * 检测任务数据 **/ @RequestMapping("/getListypByheaders.do") public String getListypByheaders(HttpServletRequest request, Model model) { String id = request.getParameter("id"); WhpSamplingPlanTaskTestConfirm whpSamplingPlanTaskTestConfirm = whpSamplingPlanTaskTestConfirmService.selectById(id); List tablelist = new ArrayList(); List list = workingCurveService.selectListByItem(whpSamplingPlanTaskTestConfirm.getTestItemId(), "0,2,3"); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { WhpTestItemWorkingCurveVo curveVo = list.get(i); TableHeader header = new TableHeader(); if (curveVo.getFormulatype().equals("0")) { header.setField(curveVo.getName()); header.setTitle(curveVo.getName()); header.setAlign("center"); header.setValign("middle"); } else { header.setField(curveVo.getMPoint().getMpointcode()); header.setTitle(curveVo.getMPoint().getParmname()); header.setAlign("center"); header.setValign("middle"); } tablelist.add(header); } } JSONArray json = JSONArray.fromObject(tablelist); model.addAttribute("result", json); return "result"; } /** * 检测任务数据 **/ @RequestMapping("/syncSamplingPlanTask.do") public String syncSamplingPlanTask(HttpServletRequest request, Model model) { whpSamplingPlanTaskTestConfirmService.syncSamplingPlanTask(); return "result"; } } \ No newline at end of file diff --git a/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskTestItemController.java b/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskTestItemController.java deleted file mode 100644 index c788deed..00000000 --- a/src/com/sipai/controller/whp/test/WhpSamplingPlanTaskTestItemController.java +++ /dev/null @@ -1,1170 +0,0 @@ -package com.sipai.controller.whp.test; - -import cn.hutool.core.util.NumberUtil; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.singularsys.jep.functions.Str; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointFormula; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurve; -import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveVo; -import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.plan.WhpSamplingPlanTaskQuery; -import com.sipai.entity.whp.test.*; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.whp.baseinfo.WhpTestItemWorkingCurveService; -import com.sipai.service.whp.plan.WhpSamplingPlanService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestItemService; -import com.sipai.service.whp.test.WhpTaskItemCurveService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.axis2.databinding.types.soapencoding.Decimal; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 计划单检测项目记录Controller类 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ -@Controller -@RequestMapping("/whp/test/WhpSamplingPlanTaskTestItem") -public class WhpSamplingPlanTaskTestItemController { - - @Resource - private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; - @Resource - private WhpSamplingPlanTaskTestConfirmService whpSamplingPlanTaskTestConfirmService; - - @Resource - private WhpTestItemWorkingCurveService workingCurveService; - @Resource - private WhpTaskItemCurveService whpTaskItemCurveService; - - @Resource - private WhpSamplingPlanService whpSamplingPlanService; - - @Resource - private MPointFormulaService mPointFormulaService; - @Resource - private MPointService mPointService; - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private MPointHistoryService mPointHistoryService; - - - /** - * 页面跳转:列表页面 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - - return "whp/test/WhpSamplingPlanTaskTestItemList"; - } - - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanTaskTestItemQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - - List list = whpSamplingPlanTaskTestItemService.queryList(query); - - List voList = new ArrayList<>(); - - // 编辑列表需要的字段 - for (WhpSamplingPlanTaskTestItem item : list) { - WhpSamplingPlanTaskTestItemVo vo = new WhpSamplingPlanTaskTestItemVo(); - BeanUtils.copyProperties(item, vo); - // 此处加工Vo数据 - vo.setStatusName(SamplingPlanTaskTestItemStatusEnum.getNameByid(item.getStatus())); - List planTasks = whpSamplingPlanTaskService.selectListByWhere(" where sample_code='" + item.getSampleCode() + "' and plan_id='" + item.getPlanId() + "' order by id desc "); - if (planTasks.size() > 0) { - vo.setSampleAddress(planTasks.get(0).getSampleAddress()); - vo.setSampleAppearance(SampleAppearanceEnum.getNameByid(planTasks.get(0).getSampleAppearance())); - vo.setSampleSupernatant(SampleSupernatantEnum.getNameByid(planTasks.get(0).getSampleSupernatant())); - vo.setSampleNature(SampleNatureEnum.getNameByid(planTasks.get(0).getSampleNature())); - vo.setSampleState(SampleStateEnum.getNameByid(planTasks.get(0).getSampleState())); - vo.setSampleAmount(planTasks.get(0).getSampleAmount()); - } - WhpSamplingPlanTaskTestConfirm confirm = whpSamplingPlanTaskTestConfirmService.selectById(item.getTestConfirmId()); - vo.setConfirmDate(confirm.getConfirmDate()); - vo.setConfirmUserName(confirm.getConfirmUserName()); - vo.setTestUserName(confirm.getTestUserName()); - vo.setTestDate(confirm.getTestDate()); - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/getListByplanId.do") - public ModelAndView getListByplanId(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanTaskQuery query - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - List voList = new ArrayList<>(); - - PageHelper.startPage(page, rows); - List taskslist = whpSamplingPlanTaskService.queryList(query); - // List list = whpSamplingPlanTaskTestItemService.queryList(query); - - - // 编辑列表需要的字段 - for (WhpSamplingPlanTask item : taskslist) { - WhpSamplingPlanTaskTestItemVo vo = new WhpSamplingPlanTaskTestItemVo(); - - BeanUtils.copyProperties(item, vo); - - vo.setSampleAddress(item.getSampleAddress()); - vo.setSampleAppearance(SampleAppearanceEnum.getNameByid(item.getSampleAppearance())); - //vo.setSampleSupernatant(SampleSupernatantEnum.getNameByid(item.getSampleSupernatant())); - //vo.setSampleNature(SampleNatureEnum.getNameByid(item.getSampleNature())); - //vo.setSampleState(SampleStateEnum.getNameByid(item.getSampleState())); - vo.setSampleAmount(item.getSampleAmount()); - if (item.getSampleSupernatant() != null) { - vo.setSampleSupernatant(SampleSupernatantEnum.getNameByid(item.getSampleSupernatant())); - } - if (item.getSampleNature() != null) { - vo.setSampleNature(SampleNatureEnum.getNameByid(item.getSampleNature())); - } - - if (item.getSampleState() != null) { - vo.setSampleState(SampleStateEnum.getNameByid(item.getSampleState())); - } - - - List itemTask = whpSamplingPlanTaskTestItemService.selectListByWhere(" where sample_code='" + item.getSampleCode() + "' and plan_id='" + item.getPlanId() + "' order by id desc "); - // 此处加工Vo数据 - if (itemTask != null && itemTask.size() > 0) { - - BeanUtils.copyProperties(itemTask.get(0), vo); - WhpSamplingPlanTaskTestConfirm confirm = whpSamplingPlanTaskTestConfirmService.selectById(itemTask.get(0).getTestConfirmId()); - if (confirm.getConfirmDate() != null && confirm.getConfirmDate() != "") { - vo.setConfirmDate(confirm.getConfirmDate()); - vo.setConfirmUserName(confirm.getConfirmUserName()); - } - - vo.setTestUserName(confirm.getTestUserName()); - vo.setTestDate(confirm.getTestDate()); - vo.setIstestid(vo.getId()); - } - vo.setStatusName(SamplingPlanTaskTestItemStatusEnum.getNameByid(item.getStatus())); - - - voList.add(vo); - } - - PageInfo pi = new PageInfo<>(taskslist); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取列表 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/getListyp.do") - public ModelAndView getListyp(HttpServletRequest request, Model model, - @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, - @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - WhpSamplingPlanTaskTestItemQuery query, String unitId - ) { - - User cu = (User) request.getSession().getAttribute("cu"); - PageHelper.startPage(page, rows); - List list = whpSamplingPlanTaskTestItemService.queryList(query); - List> voList = new ArrayList>(); - - for (WhpSamplingPlanTaskTestItem item : list) { - Map temp = new HashMap(); - temp.put("id", item.getId()); - temp.put("sampleCode", item.getSampleCode()); - Map contMap = new HashMap<>(); - List curveVoList = workingCurveService.selectCurveListByItemForm(item.getTestItemId(), "0,2,3", unitId, item.getId(), contMap); - if (curveVoList != null && curveVoList.size() > 0) { - for (int i = 0; i < curveVoList.size(); i++) { - WhpTestItemWorkingCurveVo curveVo = curveVoList.get(i); - //如果是基础描述 - if (curveVo.getFormulatype().equals("0")) { - String sql = " where plan_code= '" + item.getPlanCode() + "' and working_curve_id ='" + curveVo.getId() + "' AND sample_code = '" + item.getSampleCode() + "'"; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - temp.put(curveVo.getName(), taskItemCurveList.get(0).getCalculated_value()); - } else { - temp.put(curveVo.getName(), ""); - } - } else { - temp.put(curveVo.getMPoint().getMpointcode(), curveVo.getMPoint().getParmvalueStr()); - } - - - } - } - voList.add(temp); - - - } - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(voList); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 页面跳转:编辑页面 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - String itemid, String unitId, WhpSamplingPlanTaskTestConfirm confirm, int edittype - ) { - /* WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem = whpSamplingPlanTaskTestItemService.selectById(id); - WhpSamplingPlanTaskTestItemVo vo = new WhpSamplingPlanTaskTestItemVo(); - BeanUtils.copyProperties(whpSamplingPlanTaskTestItem, vo); - Map contaneMap=new HashMap<>(); - //常量 - List contantCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestItem.getTestItemId(), "1"); - if (contantCurves != null && contantCurves.size() > 0) { - for (WhpTestItemWorkingCurveVo item : contantCurves) { - if(contaneMap.get(item.getMPoint().getMpointcode())==null) - { - contaneMap.put(item.getMPoint().getMpointcode(),item.getMPoint().getMpointcode()); - - } - - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(item.getMPoint().getBizid(), - "tb_mp_" +item.getMPoint().getMpointcode() , " where userid='" + id + "' ", "*"); - if (mPointHistoryList!=null&&mPointHistoryList.size()>0) - { - if (item.getMPoint().getNumtail()!=null) { - item.getMPoint().setParmvalue(mPointHistoryList.get(0).getParmvalue().setScale(Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())), BigDecimal.ROUND_HALF_UP)); - }else{ - - item.getMPoint().setParmvalue(mPointHistoryList.get(0).getParmvalue()); - } - } - //若检测值不为空 则 替换为最新值 - if (item.getMPoint().getParmvalue() != null && !item.getMPoint().getParmvalue().equals("") && item.getMPoint().getParmvalue().compareTo(BigDecimal.ZERO) != 0) - item.setDefault_value(item.getMPoint().getParmvalue()); - else { - //若为空 则 填写 订单号 常量值信息 - String sql = " where plan_code= '" + whpSamplingPlanTaskTestItem.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL "; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - // item.setTaskitemCureid(taskItemCurveList.get(0).getId()); - if (item.getMPoint().getNumtail()!=null) { - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value().setScale(Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())), BigDecimal.ROUND_HALF_UP)); - }else{ - - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); - } - - } - } - - } - } - *//** - * 查询结果公式 - *//* - List curve = workingCurveService.selectCurveListByItemForm(whpSamplingPlanTaskTestItem.getTestItemId(), "3", unitId,id,contaneMap); - if (curve != null && curve.size() > 0) { - WhpTestItemWorkingCurveVo curveVo = curve.get(0); - if (curveVo.getKpi_id() != null) - // - { - vo.setWorkCurveName(curveVo.getMPoint().getExp()); - } - } - - //查询 基础描述 - List basicCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestItem.getTestItemId(), "0"); - if (basicCurves != null && basicCurves.size() > 0) { - - for (WhpTestItemWorkingCurveVo item : basicCurves) { - - String sql = " where plan_code= '" + whpSamplingPlanTaskTestItem.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code ='" + whpSamplingPlanTaskTestItem.getSampleCode() + "'"; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - //若检测值不为空 则 替换为最新值 - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - item.setTaskitemCureid(taskItemCurveList.get(0).getId()); - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); - } - } - } - - - //过程公式 - List processCurves = workingCurveService.selectCurveListByItemForm(whpSamplingPlanTaskTestItem.getTestItemId(), "2", unitId,id,contaneMap); - if (processCurves != null && processCurves.size() > 0) { - - for (WhpTestItemWorkingCurveVo item : processCurves) { - //若检测值不为空 则 替换为最新值 - if (item.getMPoint().getParmvalue() != null) { - item.setDefault_value(item.getMPoint().getParmvalue()); - } - - } - } - - JSONArray json = JSONArray.fromObject(processCurves); - JSONArray jsoncurve = JSONArray.fromObject(curve); - - model.addAttribute("basiCurveslist", basicCurves);//基础描述 - model.addAttribute("processCurveslist", json);//过程公式 - model.addAttribute("contantCurveslist", contantCurves);//常量 - model.addAttribute("curve", jsoncurve);//结果公式 - model.addAttribute("bean", vo);*/ - - model.addAttribute("unitId", unitId); - model.addAttribute("itemid", itemid); - model.addAttribute("confirm", confirm); - if (edittype == 0) { - return "whp/test/WhpSamplingPlanTaskTestItemEdit"; - - } else { - - return "whp/test/WhpSamplingPlanTaskTestItemEdit2"; - } - - } - - /** - * 查询 下一个检测项编辑页面 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/doNextedit.do") - @ResponseBody - public Map doNextedit(HttpServletRequest request, Model model, - WhpSamplingPlanTaskTestItemVo bean, String unitId - ) { - Map map = new HashMap<>(); - WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem = new WhpSamplingPlanTaskTestItem(); - List list = new ArrayList(); - int num = 0; - if (bean.getId() != null && bean.getId() != "" && (bean.getPlanCode() == null || bean.getPlanCode() == "")) { - whpSamplingPlanTaskTestItem = whpSamplingPlanTaskTestItemService.selectById(bean.getId()); - list = whpSamplingPlanTaskTestItemService.selectListByWhere(" where plan_code='" + whpSamplingPlanTaskTestItem.getPlanCode() - + "' and test_item_id='" - + whpSamplingPlanTaskTestItem.getTestItemId() + "' and ( detected is null or detected=0) and id != '" + bean.getId() + "' ORDER BY plan_date desc,plan_code , convert(int,substring( " + - " sample_code, " + - " charindex('-',sample_code)+1,len(sample_code)-charindex('-',sample_code) " + - " )) "); - num = list.size(); - } else { - list = whpSamplingPlanTaskTestItemService.selectListByWhere(" where plan_code='" + bean.getPlanCode() + "' and test_item_id='" + bean.getTestItemId() + "' and ( detected is null or detected=0) ORDER BY plan_date desc,plan_code , convert(int,substring( " + - " sample_code, " + - " charindex('-',sample_code)+1,len(sample_code)-charindex('-',sample_code) " + - " )) "); - if (list != null && list.size() > 0) { - whpSamplingPlanTaskTestItem = list.get(0); - } - num = list.size() - 1; - } - WhpSamplingPlanTaskTestItemVo vo = new WhpSamplingPlanTaskTestItemVo(); - BeanUtils.copyProperties(whpSamplingPlanTaskTestItem, vo); - - if (vo != null && vo.getId() != null) { - - - Map contaneMap = new HashMap<>(); - - //常量 - List contantCurves = workingCurveService.selectListByItem(vo.getTestItemId(), "1"); - List contantCurveList = new ArrayList<>(); - if (contantCurves != null && contantCurves.size() > 0) { - for (WhpTestItemWorkingCurveVo item : contantCurves) { - if (contaneMap.get(item.getMPoint().getMpointcode()) == null) { - contaneMap.put(item.getMPoint().getMpointcode(), item.getMPoint().getMpointcode()); - - } -// List mPointHistoryList = this.mPointHistoryService.selectAggregateList(item.getMPoint().getBizid(), -// "tb_mp_" + item.getMPoint().getMpointcode(), " where userid='" + vo.getId() + "' ", "*"); - List mPointHistoryList = new ArrayList<>(); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - if (item.getMPoint().getNumtail() != null) { - // item.getMPoint().setParmvalue(mPointHistoryList.get(0).getParmvalue().setScale(Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())), BigDecimal.ROUND_HALF_UP)); - //item.getMPoint().setParmvalue(NumberUtil.roundHalfEven(mPointHistoryList.get(0).getParmvalue(),Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); - //item.setDefault_value(NumberUtil.roundHalfEven(mPointHistoryList.get(0).getParmvalue(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); - BigDecimal parmvalue = mPointHistoryList.get(0).getParmvalue(); - item.setDefault_value(mPointHistoryList.get(0).getParmvalue().toPlainString()); - item.setDefaultValue(mPointHistoryList.get(0).getParmvalue().toPlainString()); - item.setDefault_value(mPointHistoryList.get(0).getParmvalue().toPlainString()); - item.setDefaultValue(mPointHistoryList.get(0).getParmvalue().toPlainString()); - } else { - - // item.getMPoint().setParmvalue(mPointHistoryList.get(0).getParmvalue()); - item.setDefault_value(mPointHistoryList.get(0).getParmvalue().toPlainString()); - item.setDefaultValue(mPointHistoryList.get(0).getParmvalue().toPlainString()); - item.setDefault_value(mPointHistoryList.get(0).getParmvalue().toPlainString()); - item.setDefaultValue(mPointHistoryList.get(0).getParmvalue().toPlainString()); - } - } else { - //若为空 则 填写 订单号 常量值信息 - String sql = " where plan_code= '" + vo.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL "; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - // item.setTaskitemCureid(taskItemCurveList.get(0).getId()); - if (item.getMPoint().getNumtail() != null) { - // item.setDefault_value(taskItemCurveList.get(0).getCalculated_value().setScale(Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())), BigDecimal.ROUND_HALF_UP)); -// BigDecimal bigDecimal = NumberUtil.roundHalfEven(taskItemCurveList.get(0).getCalculated_value(), Integer.parseInt("8")); - WhpTaskItemCurve whpTaskItemCurve = taskItemCurveList.get(0); - String calculated_value = whpTaskItemCurve.getCalculated_value(); - item.setDefault_value(calculated_value); - item.setDefaultValue(calculated_value); - String taskitemCureid = whpTaskItemCurve.getId(); - item.setTaskitemCureid(taskitemCureid); - } else { - WhpTaskItemCurve whpTaskItemCurve = taskItemCurveList.get(0); - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); - item.setDefaultValue(taskItemCurveList.get(0).getCalculated_value()); - item.setTaskitemCureid(whpTaskItemCurve.getId()); - } - - } - } - //contantCurveList.add(item); - - } - } - - //过程公式 - List processCurves = workingCurveService.selectCurveListByItemForm(vo.getTestItemId(), "2", unitId, vo.getId(), contaneMap); - if (processCurves != null && processCurves.size() > 0) { - - for (WhpTestItemWorkingCurveVo item : processCurves) { - //若检测值不为空 则 替换为最新值 - if (item.getMPoint().getParmvalue() != null) { - BigDecimal parmvalue = item.getMPoint().getParmvalue(); - item.setDefault_value(item.getMPoint().getParmvalueStr()); - - } - contaneMap.put(item.getMPoint().getMpointcode(), item.getMPoint().getMpointcode()); - - } - } - /** - * 查询结果公式 - */ - List curve = workingCurveService.selectCurveListByItemForm(vo.getTestItemId(), "3", unitId, vo.getId(), contaneMap); - if (curve != null && curve.size() > 0) { - WhpTestItemWorkingCurveVo curveVo = curve.get(0); - if (curveVo.getKpi_id() != null) - // - { - vo.setWorkCurveName(curveVo.getMPoint().getExp()); - } - } - - //查询 基础描述 - List basicCurves = workingCurveService.selectListByItem(vo.getTestItemId(), "0"); - if (basicCurves != null && basicCurves.size() > 0) { - - for (WhpTestItemWorkingCurveVo item : basicCurves) { - - String sql = " where plan_code= '" + vo.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code ='" + vo.getSampleCode() + "'"; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - //若检测值不为空 则 替换为最新值 - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - item.setTaskitemCureid(taskItemCurveList.get(0).getId()); - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); - } - } - } - -/* - JSONArray json = JSONArray.fromObject(processCurves); - JSONArray jsoncurve = JSONArray.fromObject(curve); - JSONArray jsoncontantCurves = JSONArray.fromObject(contantCurves);*/ - map.put("basiCurveslist", basicCurves);//基础描述 - map.put("processCurveslist", processCurves);//过程公式 - map.put("contantCurveslist", contantCurves);//常量 - map.put("curve", curve);//结果公式 - map.put("bean", vo); - map.put("code", 0); - map.put("listcount", num); - - } else { - - map.put("code", 1); - map.put("listcount", 0); - } - - return map; - } - - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/update.do") - @ResponseBody - public Result doupdate(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestItemVo bean - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); -// request. - List basicCurves = bean.getBasicCurvelist(); - if (basicCurves != null && basicCurves.size() > 0) { - for (int i = 0; i < basicCurves.size(); i++) { - WhpTaskItemCurve taskItemCurve = basicCurves.get(i); - if (taskItemCurve != null) { - if (taskItemCurve.getId() != null && !taskItemCurve.getId().equals("") && !taskItemCurve.getId().equals("undefined")) { - whpTaskItemCurveService.update(taskItemCurve); - } else { - taskItemCurve.setPlan_code(bean.getPlanCode()); - taskItemCurve.setSample_code(bean.getSampleCode()); - taskItemCurve.setTask_test_item_id(bean.getId()); - whpTaskItemCurveService.save(taskItemCurve); - - } - - } - } - } - //whpSamplingPlanTaskTestItemService.bizCheck(bean); - WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem = new WhpSamplingPlanTaskTestItem(); - whpSamplingPlanTaskTestItem.setId(bean.getId()); - whpSamplingPlanTaskTestItem.setDetected(1); - whpSamplingPlanTaskTestItemService.update(whpSamplingPlanTaskTestItem); - - - return Result.success(); - } - - /** - * 更新 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/updatesubmint.do") - @ResponseBody - public Result doupdateSubmit(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestItemVo bean, - WhpSamplingPlanTaskTestConfirm confirm - ) throws BizCheckException { - User cu = (User) request.getSession().getAttribute("cu"); -// request. - List basicCurves = bean.getBasicCurvelist(); - if (basicCurves != null && basicCurves.size() > 0) { - for (int i = 0; i < basicCurves.size(); i++) { - WhpTaskItemCurve taskItemCurve = basicCurves.get(i); - if (taskItemCurve != null) { - if (taskItemCurve.getId() != null && !taskItemCurve.getId().equals("") && !taskItemCurve.getId().equals("undefined")) { - whpTaskItemCurveService.update(taskItemCurve); - } else { - taskItemCurve.setPlan_code(bean.getPlanCode()); - taskItemCurve.setSample_code(bean.getSampleCode()); - whpTaskItemCurveService.save(taskItemCurve); - - } - - } - } - } - - WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem = new WhpSamplingPlanTaskTestItem(); - whpSamplingPlanTaskTestItem.setId(bean.getId()); - whpSamplingPlanTaskTestItem.setDetected(1); - whpSamplingPlanTaskTestItemService.update(whpSamplingPlanTaskTestItem); - - //更新状态及复核信息 - confirm.setId(bean.getTestConfirmId()); - confirm.setConfirmUserId(confirm.getTestUserId()); - confirm.setConfirmUserName(confirm.getTestUserName()); - confirm.setConfirmDate(bean.getTestDate()); - confirm.setStatus(SamplingPlanTaskTestConfirmStatusEnum.AUDIT.getId()); - whpSamplingPlanTaskTestConfirmService.update(confirm); - - - //更新 检测项目状态为审核中 - WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); - testItem.setTestConfirmId(bean.getTestConfirmId()); - testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.CONFIRM.getId()); - whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem); - - whpSamplingPlanService.isTestConfirmDone(bean.getPlanId()); - - - // whpSamplingPlanTaskTestConfirmService - - /*confirm.setStatus(SamplingPlanTaskTestConfirmStatusEnum.CONFIRM.getId());*/ - - /* WhpSamplingPlanTaskTestItem testItem = new WhpSamplingPlanTaskTestItem(); - testItem.setTestConfirmId(bean.getTestConfirmId()); - testItem.setStatus(SamplingPlanTaskTestItemStatusEnum.CONFIRM.getId()); - whpSamplingPlanTaskTestItemService.updateStatusByConfirmId(testItem);*/ - - return Result.success(); - } - - @RequestMapping("/getJSResult.do") - @ResponseBody - public ModelAndView getJSResult(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestItemVo bean - ) throws BizCheckException { - JSONArray outJson = new JSONArray(); - User cu = (User) request.getSession().getAttribute("cu"); - List processCurveslist = bean.getProcessCurveslist(); - List curveslist = bean.getCurves(); - List contantCurvelist = bean.getContantCurvelist(); - String markId = bean.getId(); - String nowTime = CommUtil.nowDate(); - - if (contantCurvelist != null && contantCurvelist.size() > 0) { - for (MPoint mPoint_main : - contantCurvelist) { - String fMpid = mPoint_main.getMpointcode(); -// BigDecimal pvalue = mPoint_main.getParmvalue(); - String pvalueStr = mPoint_main.getParmvalue().toString(); - - MPoint sMPoint = this.mPointService.selectById(fMpid); - this.mPointService.update(sMPoint.getBizid(), sMPoint); - - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(sMPoint.getBizid(), "tb_mp_" + fMpid, " where userid='" + markId + "' ", "*"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - WhpTaskItemCurve whpTaskItemCurve = new WhpTaskItemCurve(); - whpTaskItemCurve.setId(mPoint_main.getId()); - whpTaskItemCurve.setCalculated_value(pvalueStr); - whpTaskItemCurveService.update(whpTaskItemCurve); - // "ParmValue=" + pvalue + - this.mPointHistoryService.updateByWhere(sMPoint.getBizid(), "tb_mp_" + fMpid, "memo='" + pvalueStr.toString() + "',MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); -// mPointHistory.setParmvalue(pvalue); - mPointHistory.setMemo(pvalueStr); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + fMpid); - this.mPointHistoryService.save(sMPoint.getBizid(), mPointHistory); - } - } - } - - if (processCurveslist != null && processCurveslist.size() > 0) { - for (MPoint mPoint : processCurveslist) { - JSONObject outJsonO = new JSONObject(); - MPoint mPoint_main = mPoint; - if (mPoint_main.getmPointFormulalist() != null && mPoint_main.getmPointFormulalist().size() > 0) { - for (MPointFormula formula : - mPoint_main.getmPointFormulalist()) { - String fMpid = formula.getMpid(); -// System.out.println(fMpid); -// BigDecimal pvalue = new BigDecimal(0); - String parmvalueStr = ""; - if (formula.getmPoint() != null) { -// pvalue = new BigDecimal(formula.getmPoint().getParmvalueStr()); - parmvalueStr = formula.getmPoint().getParmvalueStr(); - } - MPoint sMPoint = this.mPointService.selectById(fMpid); -// sMPoint.setMeasuredt(nowTime); -// sMPoint.setParmvalue(pvalue); - this.mPointService.update(sMPoint.getBizid(), sMPoint); - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(sMPoint.getBizid(), "tb_mp_" + fMpid, " where userid='" + markId + "' ", "*"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { -// System.out.println(pvalue); -// System.out.println(sMPoint.getBizid()); - this.mPointHistoryService.updateByWhere(sMPoint.getBizid(), "tb_mp_" + fMpid, "memo='" + parmvalueStr.toString() + "',MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); -// mPointHistory.setParmvalue(pvalue); - mPointHistory.setMemo(parmvalueStr); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + fMpid); - this.mPointHistoryService.save(sMPoint.getBizid(), mPointHistory); - } - - - } - } - - String fResult_mpid = mPoint_main.getMpointcode(); - MPoint m_MPoint = this.mPointService.selectById(fResult_mpid); -// System.out.println(fResult_mpid); - List> spData = this.mPointFormulaService.getSpData(m_MPoint.getBizid(), nowTime, "mark", fResult_mpid, markId); - if (spData != null && spData.size() > 0) { - String out_mpid = ""; - String out_ParmValue = ""; - for (int i = 0; i < spData.size(); i++) { - if (spData.get(i).get("mpid") != null) { - if (spData.get(i).get("mpid").equals(fResult_mpid)) { - out_mpid = spData.get(i).get("mpid").toString(); - if (spData.get(i).get("ParmValue") != null) { - out_ParmValue = spData.get(i).get("ParmValue").toString(); - } - } - } - - } - outJsonO.put("mpid", out_mpid); - outJsonO.put("value", out_ParmValue); - outJson.add(outJsonO); - } - } - - } - - if (curveslist != null && curveslist.size() > 0) { - for (MPoint mPoint : - curveslist) { - JSONObject outJsonO = new JSONObject(); - MPoint mPoint_main = mPoint; - if (mPoint_main.getmPointFormulalist() != null && mPoint_main.getmPointFormulalist().size() > 0) { - for (MPointFormula formula : - mPoint_main.getmPointFormulalist()) { - String fMpid = formula.getMpid(); -// System.out.println(fMpid); -// BigDecimal pvalue = new BigDecimal(0); - String parmvalueStr = ""; - if (formula.getmPoint() != null) { -// pvalue = formula.getmPoint().getParmvalue(); - parmvalueStr = formula.getmPoint().getParmvalueStr(); - } - MPoint sMPoint = this.mPointService.selectById(fMpid); -// sMPoint.setMeasuredt(nowTime); -// sMPoint.setParmvalue(pvalue); - this.mPointService.update(sMPoint.getBizid(), sMPoint); - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(sMPoint.getBizid(), "tb_mp_" + fMpid, " where userid='" + markId + "' ", "*"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { -// System.out.println(pvalue); -// System.out.println(sMPoint.getBizid()); - this.mPointHistoryService.updateByWhere(sMPoint.getBizid(), "tb_mp_" + fMpid, "memo='" + parmvalueStr.toString() + "',MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); -// mPointHistory.setParmvalue(pvalue); - mPointHistory.setMemo(parmvalueStr.toString()); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + fMpid); - this.mPointHistoryService.save(sMPoint.getBizid(), mPointHistory); - } - } - } else { - String fMpid = mPoint_main.getMpointcode(); -// System.out.println(fMpid); -// BigDecimal pvalue = new BigDecimal(0); -// pvalue = mPoint_main.getParmvalue(); - String parmvalueStr = mPoint_main.getParmvalueStr(); - MPoint sMPoint = this.mPointService.selectById(fMpid); -// sMPoint.setMeasuredt(nowTime); -// sMPoint.setParmvalue(pvalue); - this.mPointService.update(sMPoint.getBizid(), sMPoint); - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(sMPoint.getBizid(), "tb_mp_" + fMpid, " where userid='" + markId + "' ", "ItemID, MeasureDT, memotype, memo, userid, insdt"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { -// System.out.println(pvalue); -// System.out.println(sMPoint.getBizid()); - // "ParmValue=" + pvalue + - this.mPointHistoryService.updateByWhere(sMPoint.getBizid(), "tb_mp_" + fMpid, "memo='" + parmvalueStr.toString() + "',MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); -// mPointHistory.setParmvalue(pvalue); - mPointHistory.setMemo(parmvalueStr.toString()); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + fMpid); - this.mPointHistoryService.save(sMPoint.getBizid(), mPointHistory); - } - } - - String fResult_mpid = mPoint_main.getMpointcode(); - MPoint m_MPoint = this.mPointService.selectById(fResult_mpid); -// System.out.println("cs:" + fResult_mpid); - List> spData = this.mPointFormulaService.getSpData(m_MPoint.getBizid(), nowTime, "mark", fResult_mpid, markId); - if (spData != null && spData.size() > 0) { - String out_mpid = ""; - String out_ParmValue = ""; - for (int i = 0; i < spData.size(); i++) { - if (spData.get(i).get("mpid") != null) { - if (spData.get(i).get("mpid").equals(fResult_mpid)) { - out_mpid = spData.get(i).get("mpid").toString(); - if (spData.get(i).get("ParmValue") != null) { - out_ParmValue = spData.get(i).get("ParmValue").toString(); - } - } - } - - } - outJsonO.put("mpid", out_mpid); - outJsonO.put("value", out_ParmValue); - outJson.add(outJsonO); - } - - } - } -// System.out.println(outJson); - - model.addAttribute("result", outJson); - return new ModelAndView("result"); - } - - @RequestMapping("/updateResult.do") - @ResponseBody - public Result updateResult(HttpServletRequest request, Model model, WhpSamplingPlanTaskTestItemVo bean - ) throws BizCheckException { - List processCurveslist = bean.getProcessCurveslist(); - List contantCurvelist = bean.getContantCurvelist(); - - String markId = bean.getId(); - String nowTime = CommUtil.nowDate(); - - if (contantCurvelist != null && contantCurvelist.size() > 0) { - for (MPoint mPoint_main : contantCurvelist) { - String fMpid = mPoint_main.getMpointcode(); - BigDecimal pvalue = mPoint_main.getParmvalue(); - - MPoint sMPoint = this.mPointService.selectById(fMpid); - this.mPointService.update(sMPoint.getBizid(), sMPoint); - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(sMPoint.getBizid(), "tb_mp_" + fMpid, " where userid='" + markId + "' ", "*"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - WhpTaskItemCurve whpTaskItemCurve = new WhpTaskItemCurve(); - whpTaskItemCurve.setId(mPoint_main.getId()); - whpTaskItemCurve.setCalculated_value(mPoint_main.getParmvalue().toPlainString()); - whpTaskItemCurveService.update(whpTaskItemCurve); - this.mPointHistoryService.updateByWhere(sMPoint.getBizid(), "tb_mp_" + fMpid, "ParmValue=" + pvalue + ",MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setParmvalue(pvalue); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + fMpid); - this.mPointHistoryService.save(sMPoint.getBizid(), mPointHistory); - } - } - } - - if (processCurveslist != null && processCurveslist.size() > 0) { - MPoint mPoint_main = processCurveslist.get(0); - String main_mpid = mPoint_main.getMpointcode(); - BigDecimal main_value = mPoint_main.getParmvalue(); - - MPoint sMainMPoint = this.mPointService.selectById(main_mpid); -// sMPoint.setMeasuredt(nowTime); -// sMPoint.setParmvalue(pvalue); - this.mPointService.update(sMainMPoint.getBizid(), sMainMPoint); - List mPointMHistoryList = this.mPointHistoryService.selectAggregateList(sMainMPoint.getBizid(), "tb_mp_" + main_mpid, " where userid='" + markId + "' ", "*"); - if (mPointMHistoryList != null && mPointMHistoryList.size() > 0) { -// System.out.println(pvalue); -// System.out.println(sMPoint.getBizid()); - this.mPointHistoryService.updateByWhere(sMainMPoint.getBizid(), "tb_mp_" + main_mpid, "ParmValue=" + main_value + ",MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setParmvalue(main_value); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + main_mpid); - this.mPointHistoryService.save(sMainMPoint.getBizid(), mPointHistory); - } - - if (mPoint_main.getmPointFormulalist() != null && mPoint_main.getmPointFormulalist().size() > 0) { - for (MPointFormula formula : - mPoint_main.getmPointFormulalist()) { - String fMpid = formula.getMpid(); -// System.out.println(fMpid); - BigDecimal pvalue = new BigDecimal(0); - if (formula.getmPoint() != null) { - pvalue = formula.getmPoint().getParmvalue(); - } - MPoint sMPoint = this.mPointService.selectById(fMpid); -// sMPoint.setMeasuredt(nowTime); -// sMPoint.setParmvalue(pvalue); - this.mPointService.update(sMPoint.getBizid(), sMPoint); - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(sMPoint.getBizid(), "tb_mp_" + fMpid, " where userid='" + markId + "' ", "*"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { -// System.out.println(pvalue); -// System.out.println(sMPoint.getBizid()); - this.mPointHistoryService.updateByWhere(sMPoint.getBizid(), "tb_mp_" + fMpid, "ParmValue=" + pvalue + ",MeasureDT='" + nowTime + "'", "where userid='" + markId + "' "); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setParmvalue(pvalue); - mPointHistory.setUserid(markId); - mPointHistory.setTbName("tb_mp_" + fMpid); - this.mPointHistoryService.save(sMPoint.getBizid(), mPointHistory); - } - } - } - } - - - return Result.success(); - } - - - /** - * 批量删除 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/deletes.do") - @ResponseBody - public Result dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - //计划 平行飞样 删除 - List list = whpSamplingPlanTaskTestItemService.selectListByWhere("where id in ('" + ids + "') and pxfySt='true' "); - if (list != null && list.size() > 0) { - List planlist = whpSamplingPlanTaskService.selectListByWhere(" where sample_code='" + list.get(0).getSampleCode() + "' and pxfySt='true' "); - if (planlist != null && planlist.size() > 0) { - whpSamplingPlanTaskService.deleteByWhere("where id='" + planlist.get(0).getId() + "' "); - } - } - - ids = ids.replace(",", "','"); - whpSamplingPlanTaskTestItemService.deleteByWhere("where id in ('" + ids + "')"); - return Result.success(); - } - - /** - * 退回单条测试任务 - * - * @Author: lichen - * @Date: 2023/1/6 - **/ - @RequestMapping("/backFromAudit.do") - @ResponseBody - @Transactional(rollbackFor = Exception.class) - public Result backFromAudit(HttpServletRequest request, Model model, - String id) { - WhpSamplingPlanTaskTestItem testItem = whpSamplingPlanTaskTestItemService.selectById(id); - WhpSamplingPlanTaskTestConfirm confirm = whpSamplingPlanTaskTestConfirmService.selectById(testItem.getTestConfirmId()); - confirm.setStatus(SamplingPlanTaskTestConfirmStatusEnum.BACK_FROM_AUDIT.getId()); - whpSamplingPlanTaskTestConfirmService.update(confirm); - return Result.success(); - } - - /** - * 页面跳转:测试结果浏览页面 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model, - String id, String unitId - ) { - WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem = whpSamplingPlanTaskTestItemService.selectById(id); - - WhpSamplingPlanTaskTestItemVo vo = new WhpSamplingPlanTaskTestItemVo(); - BeanUtils.copyProperties(whpSamplingPlanTaskTestItem, vo); - Map contaneMap = new HashMap<>(); - //常量 - List contantCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestItem.getTestItemId(), "1"); - if (contantCurves != null && contantCurves.size() > 0) { - for (WhpTestItemWorkingCurveVo item : contantCurves) { - if (contaneMap.get(item.getMPoint().getMpointcode()) != null) { - contaneMap.put(item.getMPoint().getMpointcode(), item.getMPoint().getMpointcode()); - - } - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(item.getMPoint().getBizid(), - "tb_mp_" + item.getMPoint().getMpointcode(), " where userid='" + id + "' ", "*"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - - if (item.getMPoint().getNumtail() != null) { - // item.getMPoint().setParmvalue(mPointHistoryList.get(0).getParmvalue().setScale(Integer.valueOf(item.getMPoint().getNumtail()), BigDecimal.ROUND_HALF_UP)); - item.getMPoint().setParmvalue(NumberUtil.roundHalfEven(mPointHistoryList.get(0).getParmvalue(), Integer.parseInt(String.valueOf(item.getMPoint().getNumtail())))); - } else { - - item.getMPoint().setParmvalue(mPointHistoryList.get(0).getParmvalue()); - } - - } - //若检测值不为空 则 替换为最新值 - if (item.getMPoint().getParmvalue() != null && !item.getMPoint().getParmvalue().equals("") && item.getMPoint().getParmvalue().compareTo(BigDecimal.ZERO) != 0) - item.setDefault_value(item.getMPoint().getParmvalue().toPlainString()); - else { - //若为空 则 填写 订单号 常量值信息 - String sql = " where plan_code= '" + whpSamplingPlanTaskTestItem.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code is NULL "; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - // item.setTaskitemCureid(taskItemCurveList.get(0).getId()); - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); - } - } - - } - } - - - //过程公式 - List processCurves = workingCurveService.selectCurveListByItemForm(whpSamplingPlanTaskTestItem.getTestItemId(), "2", unitId, id, contaneMap); - if (processCurves != null && processCurves.size() > 0) { - - for (WhpTestItemWorkingCurveVo item : processCurves) { - //若检测值不为空 则 替换为最新值 - if (item.getMPoint().getParmvalue() != null) { - item.setDefault_value(item.getMPoint().getParmvalue().toPlainString()); - - } - contaneMap.put(item.getMPoint().getMpointcode(), item.getMPoint().getMpointcode()); - - } - } - /** - * 查询结果公式 - */ - List curve = workingCurveService.selectCurveListByItemForm(whpSamplingPlanTaskTestItem.getTestItemId(), "3", unitId, id, contaneMap); - if (curve != null && curve.size() > 0) { - WhpTestItemWorkingCurveVo curveVo = curve.get(0); - if (curveVo.getKpi_id() != null) - // - { - vo.setWorkCurveName(curveVo.getMPoint().getExp()); - } - } - - //查询 基础描述 - List basicCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestItem.getTestItemId(), "0"); - if (basicCurves != null && basicCurves.size() > 0) { - - for (WhpTestItemWorkingCurveVo item : basicCurves) { - - String sql = " where plan_code= '" + whpSamplingPlanTaskTestItem.getPlanCode() + "' and working_curve_id ='" + item.getId() + "' AND sample_code ='" + whpSamplingPlanTaskTestItem.getSampleCode() + "'"; - List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); - //若检测值不为空 则 替换为最新值 - if (taskItemCurveList != null && taskItemCurveList.size() > 0) { - item.setTaskitemCureid(taskItemCurveList.get(0).getId()); - item.setDefault_value(taskItemCurveList.get(0).getCalculated_value()); - } - } - } - - - JSONArray json = JSONArray.fromObject(processCurves); - JSONArray jsoncurve = JSONArray.fromObject(curve); - - model.addAttribute("basiCurveslist", basicCurves);//基础描述 - model.addAttribute("processCurveslist", json);//过程公式 - model.addAttribute("contantCurveslist", contantCurves);//常量 - model.addAttribute("curve", jsoncurve);//结果公式 - model.addAttribute("bean", vo); - return "whp/test/WhpSamplingPlanTaskTestItemView"; - } - - /** - * 添加平行飞样 - **/ - @RequestMapping("/addPXFY.do") - public String addPXFY(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String testConfirmId = request.getParameter("testConfirmId"); - - WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem = this.whpSamplingPlanTaskTestItemService.selectById(id); - - String sample_code = whpSamplingPlanTaskTestItem.getSampleCode(); - whpSamplingPlanTaskTestItem.setId(CommUtil.getUUID()); - whpSamplingPlanTaskTestItem.setSampleCode("P" + sample_code); - whpSamplingPlanTaskTestItem.setPxfySt("true"); -// whpSamplingPlanTaskTestItem.setSampleAddress(whpSamplingPlanTaskTestItem.getSampleAddress() + " 平行"); - - List list = whpSamplingPlanTaskTestItemService.selectListByWhere(" where sample_code='" + whpSamplingPlanTaskTestItem.getSampleCode() + "' and test_confirm_id='" + testConfirmId + "' "); - if (list != null && list.size() > 0) { - model.addAttribute("result", CommUtil.toJson(Result.failed("重复添加!"))); - } else { - int code = this.whpSamplingPlanTaskTestItemService.save(whpSamplingPlanTaskTestItem); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - //插入计划 - List planlist = whpSamplingPlanTaskService.selectListByWhere(" where sample_code='" + sample_code + "' "); - if (planlist != null && planlist.size() > 0) { - List planlist2 = whpSamplingPlanTaskService.selectListByWhere(" where sample_code='P" + sample_code + "' "); - if (planlist2 == null && planlist2.size() == 0) { - WhpSamplingPlanTask whpSamplingPlanTask = planlist.get(0); - whpSamplingPlanTask.setId(CommUtil.getUUID()); - whpSamplingPlanTask.setSampleCode("P" + sample_code); - whpSamplingPlanTask.setSampleAddress(whpSamplingPlanTask.getSampleAddress() + " 平行"); - whpSamplingPlanTask.setPxfySt("true"); - this.whpSamplingPlanTaskService.save(whpSamplingPlanTask); - } - } - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - } - - return "result"; - } -} - diff --git a/src/com/sipai/controller/whp/test/WhpTaskItemCurveController.java b/src/com/sipai/controller/whp/test/WhpTaskItemCurveController.java deleted file mode 100644 index 402bbf69..00000000 --- a/src/com/sipai/controller/whp/test/WhpTaskItemCurveController.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.controller.whp.test; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sipai.entity.base.Result; import com.sipai.controller.exception.BizCheckException; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurve; import com.sipai.entity.whp.test.*; import com.sipai.entity.user.User; import com.sipai.service.whp.baseinfo.WhpTestItemWorkingCurveService; import com.sipai.service.whp.test.*; import com.sipai.entity.base.Result; import com.sipai.service.user.UserService; import com.sipai.tools.DateUtil; import net.sf.json.JSONArray; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; /** * 方法依据Controller类 * * @Author: zxq * @Date: 2023/05/15 **/ @Controller @RequestMapping("/whp/test/WhpTaskItemCurve") public class WhpTaskItemCurveController { @Resource private WhpTaskItemCurveService whpTaskItemCurveService; @Resource private WhpTestItemWorkingCurveService whpTestItemWorkingCurveService; /** * 页面跳转:列表页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/showList.do") public String showList(HttpServletRequest request, Model model ) { User cu = (User) request.getSession().getAttribute("cu"); return "whp/test/WhpTaskItemCurveList"; } /** * 获取列表 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/getList.do") public ModelAndView getList(HttpServletRequest request, Model model, @RequestParam(value = "page", required = false, defaultValue = "1") Integer page, @RequestParam(value = "rows", required = false, defaultValue = "10") Integer rows, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, WhpTaskItemCurveQuery query ) { User cu = (User) request.getSession().getAttribute("cu"); PageHelper.startPage(page, rows); List list = whpTaskItemCurveService.queryList(query); List voList = new ArrayList<>(); // 编辑列表需要的字段 for (WhpTaskItemCurve item : list) { WhpTaskItemCurveVo vo = new WhpTaskItemCurveVo(); BeanUtils.copyProperties(item, vo); // 此处加工Vo数据 } PageInfo pi = new PageInfo<>(list); JSONArray json = JSONArray.fromObject(voList); String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; model.addAttribute("result", result); return new ModelAndView("result"); } /** * 页面跳转:新增页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/add.do") public String doadd(HttpServletRequest request, Model model ) { return "whp/test/WhpTaskItemCurveAdd"; } /** * 新增 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/save.do") @ResponseBody public Result dosave(HttpServletRequest request, Model model, WhpTaskItemCurve bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpTaskItemCurveService.bizCheck(bean); whpTaskItemCurveService.save(bean); return Result.success(); } /** * 页面跳转:编辑页面 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/edit.do") public String doedit(HttpServletRequest request, Model model, String id ) { WhpTaskItemCurve whpTaskItemCurve = whpTaskItemCurveService.selectById(id); model.addAttribute("bean", whpTaskItemCurve); return "whp/test/WhpTaskItemCurveEdit"; } /** * 更新 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/update.do") @ResponseBody public Result doupdate(HttpServletRequest request, Model model, WhpTaskItemCurve bean ) throws BizCheckException { User cu = (User) request.getSession().getAttribute("cu"); whpTaskItemCurveService.bizCheck(bean); if(bean.getId()!=null&&bean.getId()!="") { whpTaskItemCurveService.update(bean); }else{ String sql = " where plan_code= '" + bean.getPlan_code() + "' and working_curve_id ='" + bean.getWorking_curve_id() + "' AND sample_code is NULL"; List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); if(taskItemCurveList!=null&&taskItemCurveList.size()>0) { bean.setId(taskItemCurveList.get(0).getId()); whpTaskItemCurveService.update(bean); /*WhpTestItemWorkingCurve whpTestItemWorkingCurve = new WhpTestItemWorkingCurve(); whpTestItemWorkingCurve.setId(bean.getWorking_curve_id()); whpTestItemWorkingCurve.setDefault_value(bean.getCalculated_value()); whpTestItemWorkingCurveService.update(whpTestItemWorkingCurve);*/ }else{ whpTaskItemCurveService.save(bean); } } return Result.success(); } /** * 批量删除 * * @Author: zxq * @Date: 2023/05/15 **/ @RequestMapping("/deletes.do") @ResponseBody public Result dodels(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) { ids = ids.replace(",", "','"); whpTaskItemCurveService.deleteByWhere("where id in ('" + ids + "')"); return Result.success(); } } \ No newline at end of file diff --git a/src/com/sipai/controller/work/AlarmTypesController.java b/src/com/sipai/controller/work/AlarmTypesController.java deleted file mode 100644 index 99f6b220..00000000 --- a/src/com/sipai/controller/work/AlarmTypesController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.service.work.AlarmTypesService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/work/alarmTypes") -public class AlarmTypesController { - @Resource - private AlarmTypesService alarmTypesService; - - @RequestMapping("/showList.do") - public String shouList(HttpServletRequest request, HttpServletResponse response) { - return "work/alarmTypesList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = alarmTypesService.selectListByWhere(wherestr + orderstr); - PageInfo pageInfo = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pageInfo.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/add.do") - public String add(HttpServletRequest request, HttpServletResponse response, Model model) { - return "/work/alarmTypesAdd"; - } - - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - // type 为f则只可选中父级 type为s则只可选中子级 - model.addAttribute("type", type); - return "work/alarmTypes4select"; - } - - @RequestMapping("/getAlarmTypesJson.do") - public String getAlarmTypesJson(HttpServletRequest request, Model model) { - List list = this.alarmTypesService.selectListByWhere(" order by name"); - String json = this.alarmTypesService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getPidJson.do") - public String getPidJson(HttpServletRequest request, Model model) { - List list = this.alarmTypesService.selectListByWhere(" where pid = '-1' order by name"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - //100,95;138,95;132,115;443,115;480,132;632,132;632,216;473,216;426,232;49,232 - - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute AlarmTypes alarmTypes) { - User cu = (User) request.getSession().getAttribute("cu"); - alarmTypes.setId(CommUtil.getUUID());; - int result = this.alarmTypesService.save(alarmTypes); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - AlarmTypes alarmTypes = this.alarmTypesService.selectById(id); - model.addAttribute("alarmTypes", alarmTypes); - return "work/alarmTypesEdit"; - } - - @RequestMapping("/update.do") - public String update(HttpServletRequest request, Model model, - @ModelAttribute AlarmTypes alarmTypes) { - int result = this.alarmTypesService.update(alarmTypes); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.alarmTypesService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/AreaManageController.java b/src/com/sipai/controller/work/AreaManageController.java deleted file mode 100644 index 00bbeb6b..00000000 --- a/src/com/sipai/controller/work/AreaManageController.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -@Controller -@RequestMapping("/work/areaManage") -@Api(value = "/work/areaManage", tags = "区域管理") -public class AreaManageController { - @Resource - private AreaManageService areaManageService; - - @RequestMapping("/showList.do") - public String shouList(HttpServletRequest request, HttpServletResponse response) { - return "security/areaManageListnew"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = areaManageService.selectListByWhere(wherestr + orderstr); - PageInfo pageInfo = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pageInfo.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/add.do") - public String add(HttpServletRequest request, HttpServletResponse response, - Model model, @RequestParam(value = "pid") String pid) { - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - AreaManage areaManage = this.areaManageService.selectById(pid); - model.addAttribute("pname", areaManage.getName()); - } - return "security/areaManageAddnew"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, HttpServletResponse response) { - return "security/areaManageAdd"; - } - - @RequestMapping("/showList4Select.do") - public String showList4Select(HttpServletRequest request, Model model) { - return "security/areaManage4select"; - } - - @RequestMapping("/getAreaManageJson.do") - public String getAreaManageJson(HttpServletRequest request, Model model) { - List list = this.areaManageService.selectListByWhere(" order by name"); - String json = this.areaManageService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - //100,95;138,95;132,115;443,115;480,132;632,132;632,216;473,216;426,232;49,232 - - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute AreaManage areaManage) { - User cu = (User) request.getSession().getAttribute("cu"); - areaManage.setId(CommUtil.getUUID()); - areaManage.setInsdt(CommUtil.nowDate()); - areaManage.setInsuser(cu.getId()); - int result = this.areaManageService.save(areaManage); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - AreaManage areaManage = this.areaManageService.selectById(id); - model.addAttribute("areaManage", areaManage); - return "security/areaManageEdit"; - } - - @RequestMapping("/update.do") - public String update(HttpServletRequest request, Model model, - @ModelAttribute AreaManage areaManage) { - int result = this.areaManageService.update(areaManage); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.areaManageService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @ApiOperation(value = "人员定位显示页面", notes = "人员定位显示页面(目前在虹桥安全项目使用)", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "人员id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/showUserPosition.do", method = RequestMethod.GET) - public String showUserPosition(HttpServletRequest request, HttpServletResponse response, - @RequestParam(value = "userId",required = false) String userId) { - User cu = (User) request.getSession().getAttribute("cu"); - if (userId != null && !userId.equals("")) { - //app请求 - request.setAttribute("userId", userId); - } else { - //平台请求 - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - } - return "work/showUserPosition"; - } - - @RequestMapping("/getCoordinate4Areas.do") - public String getCoordinate4Areas(HttpServletRequest request, Model model) { - model.addAttribute("layer", request.getParameter("layer")); - return "work/getCoordinate4Areas"; - } -} diff --git a/src/com/sipai/controller/work/AutoAlertController.java b/src/com/sipai/controller/work/AutoAlertController.java deleted file mode 100644 index 689d5c10..00000000 --- a/src/com/sipai/controller/work/AutoAlertController.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.controller.work; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.info.Select2; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AutoAlert; -import com.sipai.service.work.AutoAlertService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/autoAlert") -public class AutoAlertController { - @Resource - private AutoAlertService autoAlertService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/work/autoAlertList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 "; - if(request.getParameter("bizId")!=null && !request.getParameter("bizId").isEmpty()){ - wherestr += " and biz_id= '"+request.getParameter("bizId")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.autoAlertService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getlistForSelect.do") - public ModelAndView getlistForSelect(HttpServletRequest request,Model model, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 "; - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("wdt")!=null && !request.getParameter("wdt").isEmpty()){ - wherestr += " and eddt >= '"+request.getParameter("wdt")+"' "; - } - - List list = this.autoAlertService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/showlistforselect.do") - public String showlistforselect(HttpServletRequest request,Model model) { - return "/work/autoAlertListForSelect"; - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/autoAlertAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - AutoAlert autoAlert = this.autoAlertService.selectById(Id); - model.addAttribute("autoAlert", autoAlert); - return "work/autoAlertEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute AutoAlert autoAlert){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - autoAlert.setId(id); - autoAlert.setInsdt(CommUtil.nowDate()); - autoAlert.setInsuser(cu.getId()); - int result = this.autoAlertService.save(autoAlert); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute AutoAlert autoAlert){ - User cu= (User)request.getSession().getAttribute("cu"); - autoAlert.setInsuser(cu.getId()); - autoAlert.setInsdt(CommUtil.nowDate()); - int result = this.autoAlertService.update(autoAlert); - String resstr="{\"res\":\""+result+"\",\"id\":\""+autoAlert.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.autoAlertService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.autoAlertService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/CameraController.java b/src/com/sipai/controller/work/CameraController.java deleted file mode 100644 index 08c499ff..00000000 --- a/src/com/sipai/controller/work/CameraController.java +++ /dev/null @@ -1,837 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.CameraFile; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.hqconfig.HQAlarmRecordService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.work.AreaManageService; -import com.sipai.service.work.CameraDetailService; -import com.sipai.service.work.CameraFileService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.*; - -@Controller -@RequestMapping("/work/camera") -public class CameraController { - - @Resource - private CameraService cameraService; - @Resource - private CameraDetailService cameraDetailService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - @Resource - private CommonFileService commonFileService; - @Resource - private CameraFileService cameraFileService; - @Resource - private EquipmentCardCameraService equipmentCardCameraService; - @Resource - private AreaManageService areaManageService; - @Resource - HQAlarmRecordService hqAlarmRecordService; - - - /** - * 主页 - */ - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/cameraList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " name "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String codeString = request.getParameter("search_code"); - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and bizid='" + request.getParameter("unitId") + "'"; - } - if (request.getParameter("processsectionid") != null && !request.getParameter("processsectionid").isEmpty()) { - wherestr += " and processsectionid = '" + request.getParameter("processsectionid") + "' "; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (name like '%" + request.getParameter("search_name") + "%' or url like '%" + request.getParameter("search_name") + "%') "; - } - if (request.getParameter("search_channel") != null && !request.getParameter("search_channel").isEmpty()) { - wherestr += " and channel='" + request.getParameter("search_channel") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.cameraService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * camera插件js方法有冲突,所有将显示放在iframe中 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showCameraDetail.do") - public String showCameraDetail(HttpServletRequest request, Model model) { - return "/work/cameraDetail"; - } - - /** - * 摄像机-海康 - */ - @RequestMapping("/cameraview.do") - public String cameraview(HttpServletRequest request, Model model) { - Camera camera = this.cameraService.selectById(request.getParameter("id")); - if (camera != null && camera.getType().equalsIgnoreCase("hikvision")) { - request.setAttribute("camera", camera); - request.setAttribute("url", camera.getUrl().split(":")[0]); - request.setAttribute("port", camera.getUrl().split(":")[1]); - //String encodeStr = new String(Base64.encode(camera.getPwd(), "UTF-8")); // 编码 - //request.setAttribute("encodeStr", encodeStr); - if (camera.getViewscopes() == null) { - request.setAttribute("streamtype", "1");//主码流 - } else { - request.setAttribute("streamtype", "2");//子码流 - } - } - return ("/work/cameraview"); - } - - /** - * 摄像机-海康 - */ - @RequestMapping("/cameraview_new.do") - public String cameraview_new(HttpServletRequest request, Model model) { - Camera camera = this.cameraService.selectById(request.getParameter("id")); - if (camera != null && camera.getType().equalsIgnoreCase("hikvision")) { - request.setAttribute("camera", camera); - request.setAttribute("url", camera.getUrl().split(":")[0]); - request.setAttribute("port", camera.getUrl().split(":")[1]); - //String encodeStr = new String(Base64.encode(camera.getPwd(), "UTF-8")); // 编码 - //request.setAttribute("encodeStr", encodeStr); - if (camera.getViewscopes() == null) { - request.setAttribute("streamtype", "1");//主码流 - } else { - request.setAttribute("streamtype", "2");//子码流 - } - } - return ("/work/scadapic/processVideoView"); - } - - /** - * 摄像机-大华 - */ - @RequestMapping("/cameraview_dahua_new.do") - public String cameraview_dahua_new(HttpServletRequest request, Model model) { - Camera camera = this.cameraService.selectById(request.getParameter("id")); - request.setAttribute("camera", camera); - return ("/work/scadapic/processVideoView_Dahua"); - } - - /** - * 添加 - */ - @RequestMapping("/add.do") - public String add(HttpServletRequest request, Model model) { - request.setAttribute("id", CommUtil.getUUID()); - return "/work/cameraAdd"; - } - - /** - * 保存 - */ - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model, - @ModelAttribute Camera camera) { - User cu = (User) request.getSession().getAttribute("cu"); - - if (request.getParameter("processsectionid") == null) { - camera.setProcesssectionid(""); - } - - String channel = request.getParameter("channel"); - if (channel.split("-").length > 1) { - int min = Integer.parseInt(channel.split("-")[0]); - int max = Integer.parseInt(channel.split("-")[1]); - for (int i = min; i <= max; i++) { - camera.setId(CommUtil.getUUID()); - camera.setInsuser(cu.getId()); - camera.setInsdt(CommUtil.nowDate()); - camera.setChannel(i + ""); - camera.setName(request.getParameter("name") + "_" + camera.getChannel()); - this.cameraService.save(camera); - } - } else { - camera.setId(CommUtil.getUUID()); - camera.setInsuser(cu.getId()); - camera.setInsdt(CommUtil.nowDate()); - this.cameraService.save(camera); - } - - String resstr = "{\"res\":\"1\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.cameraDetailService.deleteCameraByWhere(ids); -// int result = this.cameraService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - /* - * 编辑 - */ - @RequestMapping("/edit.do") - public String edit(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Camera camera = this.cameraService.selectById(Id); - model.addAttribute("camera", camera); - return "work/cameraEdit"; - } - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute Camera camera) { - if (request.getParameter("processsectionid") == null) { - camera.setProcesssectionid(""); - } - int result = this.cameraService.update(camera); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + camera.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 查看 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model) { - String Id = request.getParameter("id"); - Camera camera = this.cameraService.selectById(Id); - model.addAttribute("camera", camera); - return "/work/cameraView"; - } - - /* - * 关联数据传输方法 - */ - @RequestMapping("/getCameras.do") - public String getCameras(HttpServletRequest request, Model model) { - List cameras = this.cameraService.selectListByWhere("where 1=1"); - JSONArray json = new JSONArray(); - if (cameras != null && cameras.size() > 0) { - for (int i = 0; i < cameras.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", cameras.get(i).getId()); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * LJP 2019-02-27 根据工艺段id获取摄像头的方法 - */ - @RequestMapping("/getCamerasByProcessSectionId.do") - public String getCamerasByProcessSectionId(HttpServletRequest request, Model model) { - String processSectionId = request.getParameter("processSectionId"); - List cameras = this.cameraService.selectListByWhere("where processsectionid = '" + processSectionId + "'"); - /*JSONArray json = new JSONArray(); - if(cameras!=null && cameras.size()>0){ - for(int i=0;i list = this.cameraService.selectListByWhere(whereStr); - model.addAttribute("cameras", JSONArray.fromObject(list)); - model.addAttribute("processSectionId", processSectionId); - return "timeefficiency/patroPointCameraListForSelect"; - } - - /** - * 设备关联业务通用方法(该界面获取设备ids) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getCameraIdsForSelect.do") - public String getCameraIdsForSelect(HttpServletRequest request, Model model) { - String cameraIds = request.getParameter("cameraIds"); - String bizId = request.getParameter("bizId"); - String processSectionId = request.getParameter("processSectionId"); - String whereStr = "where id in ('" + cameraIds.replace(",", "','") + "')";// and bizId = '"+bizId+"' - List list = this.cameraService.selectListByWhere(whereStr); - model.addAttribute("cameras", JSONArray.fromObject(list)); - model.addAttribute("processSectionId", processSectionId); - return "work/cameraListForSelectShow"; - } - - @RequestMapping("/showVideo.do") - public String showVideo(HttpServletRequest request, Model model) throws IOException { - //model.addAttribute("channel", request.getParameter("channel")); - model.addAttribute("id", request.getParameter("id")); - model.addAttribute("time", request.getParameter("time")); - model.addAttribute("uuid", CommUtil.getUUID()); - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "websocketurl")); - model.addAttribute("netws", new CommUtil().getProperties("camera.properties", "netwebsocketurl")); - return "work/showVideo"; - } - - @RequestMapping("/showCameraVideo.do") - public String showCameraVideo(HttpServletRequest request, Model model) throws IOException { - //model.addAttribute("channel", request.getParameter("channel")); - model.addAttribute("id", request.getParameter("id")); - model.addAttribute("time", request.getParameter("time")); - model.addAttribute("uuid", CommUtil.getUUID()); - - String nowUrl = request.getParameter("nowUrl"); - if (new CommUtil().getProperties("camera.properties", "projectUrl").equals(nowUrl)) { - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "websocketurl")); - } else if (new CommUtil().getProperties("camera.properties", "outprojectUrl").equals(nowUrl)) { - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "netwebsocketurl")); - } - - return "work/showCameraVideo"; - } - - @RequestMapping("/showVideos.do") - public String showVideos(HttpServletRequest request, Model model) throws IOException { - //model.addAttribute("channel", request.getParameter("channel")); - model.addAttribute("id", request.getParameter("id")); - model.addAttribute("time", request.getParameter("time")); - model.addAttribute("uuid", CommUtil.getUUID()); -// model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "websocketurl")); -// model.addAttribute("netws", new CommUtil().getProperties("camera.properties", "netwebsocketurl")); - - - return "work/showVideos"; - } - - @RequestMapping("/closeWebSocket.do") - public String closeWebSocket(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String time = request.getParameter("time"); - String uuid = request.getParameter("uuid"); - //Map map = VideoWebSocket.flagMap; - //System.out.println(VideoWebSocket.flagMap.remove(id+time+uuid)); - return "result"; - } - - @RequestMapping("/isNet.do") - public String isNet(HttpServletRequest request, Model model) { - String nowUrl = request.getParameter("nowUrl"); - JSONObject jsonObject = new JSONObject(); - try { - if (new CommUtil().getProperties("camera.properties", "projectUrl").equals(nowUrl)) { - jsonObject.put("type", "1"); - jsonObject.put("url", new CommUtil().getProperties("camera.properties", "websocketurl")); - } else if (new CommUtil().getProperties("camera.properties", "outprojectUrl").equals(nowUrl)) { - jsonObject.put("type", "2"); - jsonObject.put("url", new CommUtil().getProperties("camera.properties", "netwebsocketurl")); - } else if (new CommUtil().getProperties("camera.properties", "projectUrl2").equals(nowUrl)) { - jsonObject.put("type", "3"); - jsonObject.put("url", new CommUtil().getProperties("camera.properties", "websocketurl2")); - } else if (new CommUtil().getProperties("camera.properties", "outprojectUrl2").equals(nowUrl)) { - jsonObject.put("type", "4"); - jsonObject.put("url", new CommUtil().getProperties("camera.properties", "netwebsocketurl2")); - } - } catch (IOException e) { - e.printStackTrace(); - } - - model.addAttribute("result", jsonObject); - return "result"; - } - - @RequestMapping("/closeRPCWebSocket.do") - public String closeRPCWebSocket(HttpServletRequest request, Model model) throws MalformedURLException, IOException { - String id = request.getParameter("id"); - String time = request.getParameter("time"); - String uuid = request.getParameter("uuid"); - Camera camera = this.cameraService.selectById(id); - //Map map = VideoWebSocket.flagMap; - //System.out.println(VideoWebSocket.flagMap.remove(id+time+uuid)); - URL url = new URL(new CommUtil().getProperties("camera.properties", "url") + "/video/closeWebSocket.do?" - + "ip=" + camera.getUrl() + "&time=" + time + "&uuid=" + uuid); - URLConnection connection = url.openConnection(); - HttpURLConnection httpURLConnection = (HttpURLConnection) connection; - int code = httpURLConnection.getResponseCode(); - //System.out.println(code); - if (code == 200) { - InputStream inputStream = connection.getInputStream(); - String result = IOUtils.toString(inputStream, "utf-8"); - //System.out.println(result); - } - return "result"; - } - - @ResponseBody - @RequestMapping("/getJson.do") - public JSONArray getJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - String companyId = request.getParameter("companyId"); - List list = this.cameraService.selectList_OnlineByWhere( - "where processsectionid = '" + pid.replace(companyId, "").replace("P", "") + "' order by name"); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - if (!list.get(i).isOnline()) { - jsonObject.put("name", list.get(i).getName() + "(离线)"); - } else { - jsonObject.put("name", list.get(i).getName() + "(在线)"); - } - - jsonObject.put("pid", pid); - jsonObject.put("flag", "V"); - jsonObject.put("online", list.get(i).isOnline()); - jsonArray.add(jsonObject); - } - //String k = cameraService.getTree(companyId); - return jsonArray; - } - return null; - } - - @RequestMapping("/getTree.do") - public String getTree(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - String cameraName = request.getParameter("cameraName"); - String online = request.getParameter("online"); - JSONObject k = cameraService.getTree(companyId, cameraName, online, request); - model.addAttribute("result", k); - return "result"; - } - - @RequestMapping("/getCamerasTree.do") - public String getCamerasTree(HttpServletRequest request, Model model) { - String cameraIds = request.getParameter("cameraIds"); - cameraIds = cameraIds.replace(",", "','"); - - String where = " where 1=1 and id in ('" + cameraIds + "')"; - if (request.getParameter("cameraName") != null && request.getParameter("cameraName").length() > 0) { - where += " and name like '%" + request.getParameter("cameraName") + "%' "; - } - - JSONArray jsonArray = new JSONArray(); - List list = this.cameraService.selectListByWhere(where); - - for (Camera camera : - list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", camera.getId()); - jsonObject.put("text", camera.getName()); - jsonObject.put("type", "V"); - jsonObject.put("online", true); - jsonArray.add(jsonObject); - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - @RequestMapping("/OneCameraForDP.do") - public String OneCameraForDP(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Camera camera = this.cameraService.selectList_OnlineByWhere - ("where id = '" + id + "' order by id").get(0); - model.addAttribute("id", id); - model.addAttribute("online", camera.isOnline()); - return "work/OneCameraVideoForDP"; - } - - @RequestMapping("/getCameraJsp.do") - public String getCameraJsp(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - Camera camera = this.cameraService.selectList_OnlineByWhere - ("where id = '" + id + "' order by id").get(0); - model.addAttribute("id", id); - model.addAttribute("online", camera.isOnline()); - model.addAttribute("uuid", CommUtil.getUUID()); - return "work/cameraVideoJsp"; - } - - @RequestMapping("/appCameraView.do") - public String appCamera(HttpServletRequest request, Model model) throws IOException { - String id = request.getParameter("id"); -// Camera camera = this.cameraService.selectList_OnlineByWhere -// ("where id = '"+id+"' order by id").get(0); - model.addAttribute("id", id); -// model.addAttribute("online", camera.isOnline()); - model.addAttribute("uuid", CommUtil.getUUID()); - model.addAttribute("net", request.getParameter("net")); - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "websocketurl")); - model.addAttribute("netws", new CommUtil().getProperties("camera.properties", "netwebsocketurl")); - return "work/appCameraView"; - } - - @RequestMapping("/getCameraById.do") - public String getCameraById(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); -// String net = request.getParameter("net"); - Camera camera = this.cameraService.selectById(id); -// if ("2".equals(net)) { -// camera.setUrl(camera.getNetUrl()); -// } - //System.out.println(JSONObject.fromObject(camera).toString()); - model.addAttribute("result", JSONObject.fromObject(camera).toString()); - return "result"; - } - - @RequestMapping("/getCameraUrl.do") - public String getCameraUrl(HttpServletRequest request, Model model) throws IOException { - String id = request.getParameter("id"); - String nowUrl = request.getParameter("nowUrl"); - Camera camera = this.cameraService.selectById(id); -// http://132.120.136.243:8080/VIDEO/video/getVideo.do?ip=132.120.136.228:554&username=admin&password=admin12345&channel=42&time=now&brand=hk -// http://132.120.136.243:8080/VIDEO/video/getBigVideo.do?ip=132.120.136.228:554&username=admin&password=admin12345&channel=44&time=now&brand=hikvision - - String url = ""; - String ip = ""; - if (new CommUtil().getProperties("camera.properties", "projectUrl").equals(nowUrl)) { - url = new CommUtil().getProperties("camera.properties", "url"); - ip = camera.getUrl(); - } else if (new CommUtil().getProperties("camera.properties", "outprojectUrl").equals(nowUrl)) { - url = new CommUtil().getProperties("camera.properties", "neturl"); - ip = camera.getNeturl(); - } - - String username = camera.getUsername(); - String password = camera.getPassword(); - String channel = camera.getChannel(); - String brand = camera.getType(); - url += "/video/getVideo.do?ip=" + ip + "&username=" + username + "&password=" + password + "&channel=" + channel + "&time=now&brand=" + brand; - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("url", url); - - model.addAttribute("result", jsonObject); - return "result"; - } - - @RequestMapping("/hisCameraView.do") - public String hisCameraView(HttpServletRequest request, Model model) throws IOException { - String id = request.getParameter("id"); - String time = request.getParameter("time"); - Camera camera = this.cameraService.selectList_OnlineByWhere - ("where id = '" + id + "' order by id").get(0); - model.addAttribute("id", id); - if (StringUtils.isNotBlank(time)) { - try { - Date date = CommUtil.formatDate("yyyy-MM-dd HH:mm:ss", time); - date.setTime(date.getTime() - 5000); - time = CommUtil.formatDate("yyyy-MM-dd HH:mm:ss", date); - } catch (Exception e) { - e.printStackTrace(); - } - } else { - Date date = new Date(); - date.setTime(date.getTime() - 5000); - time = CommUtil.formatDate("yyyy-MM-dd HH:mm:ss", date); - } - model.addAttribute("time", time); - model.addAttribute("online", camera.isOnline()); - model.addAttribute("uuid", CommUtil.getUUID()); - model.addAttribute("cameraNVR", camera.getCameraNVR()); - return "work/hisCameraView"; - } - - @RequestMapping("/getViewscopes.do") - public String getViewscopes(HttpServletRequest request, Model model) throws IOException { - String unitIds = this.unitService.getAllBizIdFromFather(request.getParameter("unitId"), ""); - unitIds = request.getParameter("unitId") + "," + unitIds; - unitIds = unitIds.replace(",", "','"); - - //安防 - List aflist = this.cameraService.selectListByWhere( - "where viewscopes='0' and bizid in ('" + unitIds + "') "); - - //生产 - List sclist = this.cameraService.selectListByWhere( - "where viewscopes='1' and bizid in ('" + unitIds + "') "); - - JSONObject jsonObject = new JSONObject(); - if (aflist != null && aflist.size() > 0) { - jsonObject.put("af", aflist.size()); - } else { - jsonObject.put("af", 0); - } - - if (sclist != null && sclist.size() > 0) { - jsonObject.put("sc", sclist.size()); - } else { - jsonObject.put("sc", 0); - } - - model.addAttribute("result", jsonObject); - return "result"; - } - - @RequestMapping("/cameraIdsShowList.do") - public String cameraIdsShowList(HttpServletRequest request, Model model) { - String cameraIds = request.getParameter("cameraIds"); - model.addAttribute("cameraIds", cameraIds); - model.addAttribute("uuid", CommUtil.getUUID()); - - return "/work/cameraIdsShowlist"; - } - - @RequestMapping("/cameraIdsHisShowList.do") - public String cameraIdsHisShowList(HttpServletRequest request, Model model) { - String cameraIds = request.getParameter("cameraIds"); - String alarmId = request.getParameter("alarmId"); - model.addAttribute("cameraIds", cameraIds); - model.addAttribute("uuid", CommUtil.getUUID()); - model.addAttribute("alarmId", alarmId); - - return "/work/cameraIdsHisShowlist"; - } - - @RequestMapping("/saveImage.do") - public String saveImage(HttpServletRequest request, Model model) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - - String masterId = request.getParameter("id"); - String imgData = request.getParameter("imgData"); - String contentType = request.getParameter("contentType"); - - Camera camera = this.cameraService.selectById(masterId); - String nowTime = CommUtil.nowDate(); - - int res = this.cameraService.saveImage(masterId, imgData, contentType, camera.getName() + "_" + cu.getName() + "_" + nowTime.substring(0, 19), nowTime, ""); - - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/showImageList.do") - public String showImageList(HttpServletRequest request, Model model) { - model.addAttribute("masterId", request.getParameter("masterId")); - model.addAttribute("tbName", request.getParameter("tbName")); - model.addAttribute("nameSpace", request.getParameter("nameSpace")); - return "/work/showCameraImageList"; - } - - @RequestMapping("/showAlarmImageList.do") - public String showAlarmImageList(HttpServletRequest request, Model model) { - model.addAttribute("masterId", request.getParameter("masterId")); - model.addAttribute("tbName", request.getParameter("tbName")); - model.addAttribute("nameSpace", request.getParameter("nameSpace")); - model.addAttribute("alarmId", request.getParameter("alarmId")); - return "/work/showCameraAlarmImageList"; - } - - @RequestMapping("/saveCameraAlarmNews.do") - public String saveCameraAlarmNews(HttpServletRequest request, Model model) { - int res = 0; - String mpid = request.getParameter("mpid"); - String alarmId = request.getParameter("alarmId"); - MPoint mPoint = this.mPointService.selectById(mpid); - String eqid = mPoint.getEquipmentid(); -// System.out.println(eqid); - if (!eqid.equals("")) { - List equipmentCardCameraList = this.equipmentCardCameraService.selectListByWhere(" where eqid='" + eqid + "' "); - if (equipmentCardCameraList != null && equipmentCardCameraList.size() > 0) { - for (EquipmentCardCamera equipmentCardCamera : - equipmentCardCameraList) { - String cameraId = equipmentCardCamera.getCameraid(); - Camera camera = this.cameraService.selectById(cameraId); - if (camera != null) { - res = this.cameraService.savePicFromCameraSys(camera, alarmId, "alarm"); - } - } - } - } - model.addAttribute("result", res); - return "result"; - } - - @RequestMapping("/downloadFile4minio.do") - public void downloadFile4minio(HttpServletResponse response, HttpServletRequest request, - @RequestParam(value = "id") String id) throws IOException { - try { - String path = ""; - String name = ""; - CameraFile cameraFile = this.cameraFileService.selectById(id); - if (cameraFile != null) { - path = cameraFile.getAbspath(); - name = cameraFile.getFilename(); - } - byte[] bytes = commonFileService.getInputStreamBytes("cameraimg", path); - InputStream object = new ByteArrayInputStream(bytes); - byte buf[] = new byte[1024]; - int length = 0; - - String fileName = new String(name.getBytes(), "ISO-8859-1");//压缩包中文名称,不然乱码 - response.reset(); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - response.setContentType("application/octet-stream"); - response.setCharacterEncoding("UTF-8"); - OutputStream outputStream = response.getOutputStream(); - // 输出文件 - while ((length = object.read(buf)) > 0) { - outputStream.write(buf, 0, length); - } - // 关闭输出流 - outputStream.close(); - } catch (Exception ex) { - response.setHeader("Content-type", "text/html;charset=UTF-8"); - String data = "文件下载失败"; - OutputStream ps = response.getOutputStream(); - ps.write(data.getBytes("UTF-8")); - } - - } - @RequestMapping("/showCameraVideo4identifyAreas.do") - public String showCameraVideo4identifyAreas(HttpServletRequest request, Model model) throws IOException { - model.addAttribute("id", request.getParameter("id")); - model.addAttribute("time", request.getParameter("time")); - model.addAttribute("uuid", CommUtil.getUUID()); - - String nowUrl = request.getParameter("nowUrl"); - if (new CommUtil().getProperties("camera.properties", "projectUrl").equals(nowUrl)) { - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "websocketurl")); - } else if (new CommUtil().getProperties("camera.properties", "outprojectUrl").equals(nowUrl)) { - model.addAttribute("ws", new CommUtil().getProperties("camera.properties", "netwebsocketurl")); - } - return "work/showCameraVideo4identifyAreas"; - } - @RequestMapping("/showCameraVideo4visionAreas.do") - public String showCameraVideo4visionAreas(HttpServletRequest request, Model model) throws IOException { - - String Id = request.getParameter("id"); - Camera camera = this.cameraService.selectById(Id); - if(camera!=null && camera.getProcesssectionid()!=null && !camera.getProcesssectionid().isEmpty()){ - AreaManage areaManage = this.areaManageService.selectById(camera.getProcesssectionid()); - if(areaManage!=null && areaManage.getLayer()!=null){ - model.addAttribute("layer", areaManage.getLayer()); - } - } - - return "work/showCameraVideo4visionAreas"; - } - - @RequestMapping("/getCameraAlarmType.do") - public String getCameraAlarmType(HttpServletRequest request, Model model) throws IOException { - String cameraid = request.getParameter("cameraid"); - String[] cameraids = cameraid.split(","); - JSONArray jsonArray = new JSONArray(); - for (String id : cameraids) { - List hqAlarmRecords = hqAlarmRecordService.selectListByWhere("where state = '1' and cameraid = '" + cameraid + "' order by insdt desc"); - if (hqAlarmRecords != null && hqAlarmRecords.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("cameraId", id); - jsonObject.put("type", 2); - jsonArray.add(jsonObject); - } -// Integer type = CommString.typeMap.get(id); -// if (type != null) { -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("cameraId", id); -// jsonObject.put("type", type); -// jsonArray.add(jsonObject); -// } - } - - model.addAttribute("result", jsonArray); - return "result"; - } - - -} diff --git a/src/com/sipai/controller/work/CameraDetailController.java b/src/com/sipai/controller/work/CameraDetailController.java deleted file mode 100644 index b39e70a0..00000000 --- a/src/com/sipai/controller/work/CameraDetailController.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.CameraDetail; -import com.sipai.entity.work.CameraFile; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.CameraDetailService; -import com.sipai.service.work.CameraFileService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.io.IOUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.List; - -@Controller -@RequestMapping("/work/cameraDetail") -public class CameraDetailController { - - @Resource - private CameraDetailService cameraDetailService; - @Resource - private CameraService cameraService; - - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - User cu = (User) request.getSession().getAttribute("cu"); - - String sort = " insdt "; - String order = " desc "; - - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("cameraid") != null && !request.getParameter("cameraid").isEmpty()) { - wherestr += " and cameraid = '" + request.getParameter("cameraid") + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.cameraDetailService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 添加 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String cameraid = request.getParameter("cameraid"); - request.setAttribute("cameraid", cameraid); - return "work/cameradetailAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - CameraDetail cameraDetail = this.cameraDetailService.selectById(id); - model.addAttribute("cameraDetail",cameraDetail); - return "work/cameradetailEdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("cameradetail") CameraDetail cameradetail){ - cameradetail.setId(CommUtil.getUUID()); - int result = this.cameraDetailService.save(cameradetail); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.cameraDetailService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.cameraDetailService.deleteById(id); - model.addAttribute("result",result); - /*model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}");*/ - return new ModelAndView("result"); - } - - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute CameraDetail cameraDetail) { - int result = this.cameraDetailService.update(cameraDetail); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + cameraDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/CameraNVRController.java b/src/com/sipai/controller/work/CameraNVRController.java deleted file mode 100644 index f7bf0994..00000000 --- a/src/com/sipai/controller/work/CameraNVRController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.sipai.controller.work; - -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.work.CameraNVR; -import com.sipai.service.work.CameraNVRService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/work/cameraNVR") -public class CameraNVRController { - - @Resource - private CameraNVRService cameraNVRService; - - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - User cu = (User) request.getSession().getAttribute("cu"); - - String sort = " insdt "; - String order = " desc "; - - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("cameraid") != null && !request.getParameter("cameraid").isEmpty()) { - wherestr += " and id = '" + request.getParameter("cameraid") + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.cameraNVRService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 添加 - */ - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - String cameraid = request.getParameter("cameraid"); - request.setAttribute("cameraid", cameraid); - return "work/cameraNVRAdd"; - } - - @RequestMapping("/doEdit.do") - public String doEdit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - CameraNVR cameraNVR = this.cameraNVRService.selectById(id); - model.addAttribute("cameraNVR",cameraNVR); - return "/work/cameraNVREdit"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("cameraNVR") CameraNVR cameraNVR){ - if (cameraNVRService.selectById(cameraNVR.getId()) != null) { - JSONObject result = new JSONObject(); - result.put("res", "已存在nvr设置请删除或编辑!"); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - int result = this.cameraNVRService.save(cameraNVR); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /* - * 多条数据删除方法 - */ - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.cameraNVRService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.cameraNVRService.deleteById(id); - model.addAttribute("result",result); - /*model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}");*/ - return new ModelAndView("result"); - } - - /* - * 更新保存方法 - */ - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute CameraNVR cameraNVR) { - int result = this.cameraNVRService.update(cameraNVR); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + cameraNVR.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/ChannelPortConfigController.java b/src/com/sipai/controller/work/ChannelPortConfigController.java deleted file mode 100644 index 8a3e6f88..00000000 --- a/src/com/sipai/controller/work/ChannelPortConfigController.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AreaManage; -import com.sipai.entity.work.ChannelPortConfig; -import com.sipai.service.work.AreaManageService; -import com.sipai.service.work.ChannelPortConfigService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.List; - -@Controller -@RequestMapping("work/channelPortConfig") -public class ChannelPortConfigController { - @Resource - private ChannelPortConfigService channelPortConfigService; - @Resource - private AreaManageService areaManageService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "work/channelPortConfigList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows){ - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" ORDER BY sort ASC"; - String wherestr = "where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += "and a.name like '%" + request.getParameter("search_name") + "%'"; - } - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += "and a.type = '" + request.getParameter("type") + "'"; - } - if(request.getParameter("processSelect")!=null && !request.getParameter("processSelect").isEmpty()){ - wherestr += "and a.processid like '%" + request.getParameter("processSelect") + "%'"; - } - if(request.getParameter("areaId")!=null && !request.getParameter("areaId").isEmpty()){ - String area = request.getParameter("areaId"); - List areaManageList= areaManageService.selectListByWhere("where pid='"+area+"' or id = '" + area + "'"); - if(areaManageList!=null && areaManageList.size()>0){ - String areaId = ""; - for(AreaManage areaManage: areaManageList){ - areaId += areaManage.getId()+","; - } - areaId = areaId.substring(0,areaId.length()-1); - areaId = areaId.replace(",","','"); - wherestr += "and address in ('" + areaId + "')"; - } - } - PageHelper.startPage(page, rows); - List list = this.channelPortConfigService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json= JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - @RequestMapping("/doAdd.do") - public String doadd(HttpServletRequest request,Model model){ - String uuid = CommUtil.getUUID(); - model.addAttribute("id", uuid); - return "work/channelPortConfigAdd"; - } - - @RequestMapping("/doSave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ChannelPortConfig channelPortConfig){ - User cu= (User)request.getSession().getAttribute("cu"); - String id = request.getParameter("id"); - channelPortConfig.setId(id); - channelPortConfig.setInsuser(cu.getId()); - channelPortConfig.setInsdt(CommUtil.nowDate()); - int result = this.channelPortConfigService.save(channelPortConfig); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doEdit.do") - public String doedit(HttpServletRequest request,Model model,@RequestParam(value = "id") String id){ - ChannelPortConfig channelPortConfig = this.channelPortConfigService.selectById(id); - model.addAttribute("channelPortConfig", channelPortConfig); - return "work/channelPortConfigEdit"; - } - @RequestMapping("/doView.do") - public String doView(HttpServletRequest request,Model model,@RequestParam(value = "id") String id){ - ChannelPortConfig channelPortConfig = this.channelPortConfigService.selectById(id); - model.addAttribute("channelPortConfig", channelPortConfig); - return "work/channelPortConfigView"; - } - - @RequestMapping("/doUpdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("channelPortConfig") ChannelPortConfig channelPortConfig){ - int code = this.channelPortConfigService.update(channelPortConfig); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.channelPortConfigService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.channelPortConfigService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getModalList.do") - public String getModalList(HttpServletRequest request,Model model){ - String sort = " id "; - String order = " desc "; - String orderstr=" order by "+sort+" "+order; - String wherestr = "where id is not null "; - if(request.getParameter("area")!=null && !request.getParameter("area").isEmpty()){ - String area = request.getParameter("area"); - List areaManageList= areaManageService.selectListByWhere("where pid='"+area+"' "); - if(areaManageList!=null && areaManageList.size()>0){ - String areaId = ""; - for(AreaManage areaManage: areaManageList){ - areaId += areaManage.getId()+","; - } - areaId = areaId.substring(0,areaId.length()-1); - areaId = areaId.replace(",","','"); - wherestr += "and address in ('%" + areaId + "%')"; - } - } - List list = this.channelPortConfigService.selectListByWhere(wherestr+orderstr); - JSONArray json= JSONArray.fromObject(list); - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - @RequestMapping("/doModal.do") - public String doModal(HttpServletRequest request,Model model,@RequestParam(value = "id") String id){ - ChannelPortConfig channelPortConfig = this.channelPortConfigService.selectById(id); - model.addAttribute("channelPortConfig", channelPortConfig); - return "work/channelPortConfigModal"; - } - @RequestMapping("/getCoordinate4ChannelPort.do") - public String showCameraVideo4visionAreas(HttpServletRequest request, Model model) throws IOException { - String processid = request.getParameter("processid"); - AreaManage areaManage = this.areaManageService.selectById(processid); - if(areaManage!=null && areaManage.getLayer()!=null){ - model.addAttribute("layer", areaManage.getLayer()); - } - return "work/getCoordinate4ChannelPort"; - } -} diff --git a/src/com/sipai/controller/work/GetSSOldOPMData.java b/src/com/sipai/controller/work/GetSSOldOPMData.java deleted file mode 100644 index e102cb5b..00000000 --- a/src/com/sipai/controller/work/GetSSOldOPMData.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.controller.work; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.SpringContextUtil; - - -@Controller -@RequestMapping("/work/getSSOldOPMData") -public class GetSSOldOPMData { - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model) { - String content=request.getParameter("content"); - String bizid=request.getParameter("bizid"); - String rptDt=request.getParameter("rptDt"); - String dtType=request.getParameter("dtType"); - - String selectDt="day"; - if(dtType.equals("月")){ - selectDt="month"; - } - -// try { - String[] datas=content.split(","); - String outString=""; - if(datas!=null&&datas.length>0){ - for(int i=0;i0){ - String mpcode=datass[0]; - String value=datass[1]; - MPointService mPointService = (MPointService)SpringContextUtil.getBean("mPointService"); - MPoint mPoint = mPointService.selectById(bizid,mpcode); - if(mPoint!=null){ - mPoint.setParmvalue(new BigDecimal(value)); - mPoint.setMeasuredt(rptDt); - mPointService.update(bizid, mPoint); - outString+=mpcode+":"+value+","; - } - - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - List mphislist=mPointHistoryService.selectListByTableAWhere(bizid, "TB_MP_"+mpcode, " where datediff("+selectDt+",MeasureDT,'"+rptDt+"')=0"); - if(mphislist!=null&&mphislist.size()>0){ - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(rptDt); - mPointHistory.setTbName("[TB_MP_"+mpcode+"]"); - mPointHistoryService.updateByMeasureDt(bizid, mPointHistory); - }else{ - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(rptDt); - mPointHistory.setTbName("[TB_MP_"+mpcode+"]"); - mPointHistoryService.save(bizid, mPointHistory); - } - } - } - } - String result = "上实OMP数据传输成功,数据{"+outString+"}"; - System.out.println("上实OMP数据传输成功,数据{"+outString+"}"); - model.addAttribute("result",result); -// } catch (RuntimeException e) { -// String result = "上实OMP数据传输失败"; -// System.out.println("上实OMP数据传输失败"); -// model.addAttribute("result",result);; -// } - - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/GroupContentController.java b/src/com/sipai/controller/work/GroupContentController.java deleted file mode 100644 index a6232a56..00000000 --- a/src/com/sipai/controller/work/GroupContentController.java +++ /dev/null @@ -1,309 +0,0 @@ -package com.sipai.controller.work; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.GroupContentForm; -import com.sipai.entity.work.GroupContentFormData; -import com.sipai.entity.work.GroupDetail; -import com.sipai.service.scada.MPointService; -import com.sipai.service.work.GroupContentFormDataService; -import com.sipai.service.work.GroupContentFormService; -import com.sipai.service.work.GroupDetailService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupContent; -import com.sipai.service.work.GroupContentService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/groupContent") -public class GroupContentController { - @Resource - private GroupContentService groupContentService; - @Resource - private GroupContentFormService groupContentFormService; - @Resource - private GroupContentFormDataService groupContentFormDataService; - @Resource - private MPointService mPointService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/groupContentList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id= '" + request.getParameter("unitId") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.groupContentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/work/groupContentAdd"; - } - - @RequestMapping("/getGroupContentTree.do") - public ModelAndView getAccidentTypeTree(HttpServletRequest request, Model model) { - String wherestr = "where 1=1"; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id= '" + request.getParameter("unitId") + "' "; - } - List list = this.groupContentService.selectListByWhere(wherestr + " order by morder"); - - String tree = this.groupContentService.getTreeList(null, list); - - model.addAttribute("result", tree); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute GroupContent groupContent) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - groupContent.setId(CommUtil.getUUID()); - groupContent.setType(request.getParameter("type")); - - int code = this.groupContentService.save(groupContent); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - GroupContent groupContent = this.groupContentService.selectById(id); - model.addAttribute("groupContent", groupContent); - return "/work/groupContentEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute GroupContent groupContent) { - User cu = (User) request.getSession().getAttribute("cu"); - - int code = this.groupContentService.update(groupContent); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.groupContentService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.groupContentService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -// @RequestMapping("/getLastGroup.do") -// public ModelAndView getLastGroup(HttpServletRequest request, Model model) { -// String wherestr = "where 1=1 and unit_id= '"+request.getParameter("unitId")+"' and groupTypeId= '"+request.getParameter("groupType")+"' " + -// " and type='"+GroupContent.Type_Content+"' and (groupTypeId is not null or groupTypeId!='null' ) "; -// -// List list = this.groupContentService.selectListByWhere(wherestr+" order by morder"); -// -// JSONArray jsondata = new JSONArray(); -// if(list!=null&&list.size()>0){ -// GroupContent groupContent=list.get(0); -// List gfrList = this.groupContentFormService.selectListByWhere(" where pid='"+groupContent.getId()+"' and type='"+GroupContentForm.Type_row+"' order by insertRow"); -// for (GroupContentForm gfr: -// gfrList) { -// JSONObject jsonObjectM = new JSONObject(); -// List gfcList = this.groupContentFormService.selectListByWhere(" where pid='"+gfr.getId()+"' and type='"+GroupContentForm.Type_column+"' order by insertColumn"); -// JSONArray jsondataD = new JSONArray(); -// for (GroupContentForm gfc: -// gfcList) { -// JSONObject jsonObjectD = new JSONObject(); -// -// jsonObjectD.put("id",gfc.getId()); -// jsonObjectD.put("type",GroupContentForm.Type_column); -// jsonObjectD.put("column",gfc.getInsertcolumn()); -// jsonObjectD.put("rows",gfc.getRows()); -// jsonObjectD.put("columns",gfc.getColumns()); -// jsonObjectD.put("width",gfc.getWidth()); -// jsonObjectD.put("height",gfc.getHeight()); -// jsonObjectD.put("showText",gfc.getShowtext()); -// jsondataD.add(jsonObjectD); -// } -// jsonObjectM.put("id",gfr.getId()); -// jsonObjectM.put("type",GroupContentForm.Type_row); -// jsonObjectM.put("rows",gfr.getInsertrow()); -// jsonObjectM.put("nodes",jsondataD); -// jsondata.add(jsonObjectM); -// } -// -// } -// -// model.addAttribute("result", jsondata); -// return new ModelAndView("result"); -// } - - @RequestMapping("/getLastGroup.do") - public ModelAndView getLastGroup(HttpServletRequest request, Model model) { - String schedulingId = request.getParameter("schedulingId"); - - String wherestr = "where 1=1 and unit_id= '" + request.getParameter("unitId") + "' and groupTypeId= '" + request.getParameter("groupType") + "' " + - " and type='" + GroupContent.Type_Content + "' and (groupTypeId is not null or groupTypeId!='null' ) "; - - List list = this.groupContentService.selectListByWhere(wherestr + " order by morder"); - - JSONArray jsondata = new JSONArray(); - if (list != null && list.size() > 0) { - GroupContent groupContent = list.get(0); - List gfrList = this.groupContentFormService.selectListByWhere(" where pid='" + groupContent.getId() + "' and type='" + GroupContentForm.Type_row + "' order by insertRow"); - for (GroupContentForm gfr : - gfrList) { - JSONObject jsonObjectM = new JSONObject(); - List gfcList = this.groupContentFormService.selectListByWhere(" where pid='" + gfr.getId() + "' and type='" + GroupContentForm.Type_column + "' order by insertColumn"); - JSONArray jsondataD = new JSONArray(); - for (GroupContentForm gfc : - gfcList) { - JSONObject jsonObjectD = new JSONObject(); - - jsonObjectD.put("id", gfc.getId()); - jsonObjectD.put("type", GroupContentForm.Type_column); - jsonObjectD.put("column", gfc.getInsertcolumn()); - jsonObjectD.put("rows", gfc.getRows()); - jsonObjectD.put("columns", gfc.getColumns()); - jsonObjectD.put("width", gfc.getWidth()); - jsonObjectD.put("height", gfc.getHeight()); - jsonObjectD.put("showtextst", gfc.getShowtextst()); - if (schedulingId != null && !schedulingId.equals("")) { - if (gfc.getShowtextst() != null && gfc.getShowtextst().equals(GroupContentForm.Showtextst_FALSE)) { - jsonObjectD.put("showText", gfc.getShowtext()); - } else { - List groupContentoFrmDataLis = this.groupContentFormDataService.selectListByWhere(" where schedulingId='" + schedulingId + "' and formId='" + gfc.getId() + "' "); - if (groupContentoFrmDataLis != null && groupContentoFrmDataLis.size() > 0) { - jsonObjectD.put("showText", groupContentoFrmDataLis.get(0).getValue()); - } else { - if (gfc.getDatampid() != null && !gfc.getDatampid().equals("")) { - if (gfc.getMpst() != null && !gfc.getMpst().equals("")) { - if (gfc.getMpst().equals(GroupContentForm.Mpst_2)) { - MPoint mPoint = this.mPointService.selectById(gfc.getDatampid()); - if (mPoint != null) { - jsonObjectD.put("showText", mPoint.getParmvalue()); - } - } else { - jsonObjectD.put("showText", ""); - } - } else { - jsonObjectD.put("showText", ""); - } - } else { - jsonObjectD.put("showText", ""); - } - } - } - } else { - jsonObjectD.put("showText", gfc.getShowtext()); - } - jsonObjectD.put("fontsize", gfc.getFontsize()); - jsonObjectD.put("fontweight", gfc.getFontweight()); - jsonObjectD.put("fontcolor", gfc.getFontcolor()); - jsonObjectD.put("backgroundcolor", gfc.getBackgroundcolor()); - jsonObjectD.put("textalign", gfc.getTextalign()); - - - jsondataD.add(jsonObjectD); - } - jsonObjectM.put("id", gfr.getId()); - jsonObjectM.put("type", GroupContentForm.Type_row); - jsonObjectM.put("rows", gfr.getInsertrow()); - jsonObjectM.put("nodes", jsondataD); - jsondata.add(jsonObjectM); - } - - } - - model.addAttribute("result", jsondata); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/GroupContentFormController.java b/src/com/sipai/controller/work/GroupContentFormController.java deleted file mode 100644 index 67e86901..00000000 --- a/src/com/sipai/controller/work/GroupContentFormController.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.sipai.controller.work; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.work.GroupDetail; -import com.sipai.service.work.GroupDetailService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupContentForm; -import com.sipai.service.work.GroupContentFormService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/groupContentForm") -public class GroupContentFormController { - @Resource - private GroupContentFormService groupContentFormService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/work/groupContentFormList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - - String orderstr=""; - - String type=request.getParameter("type"); - if(type.equals(GroupContentForm.Type_row)){ - orderstr=" order by insertRow"; - }else if(type.equals(GroupContentForm.Type_column)){ - orderstr=" order by insertcolumn"; - } - - String wherestr= " where 1=1 and pid='"+request.getParameter("pid")+"' and type='"+type+"' "; - List list = this.groupContentFormService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "/work/groupContentFormAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute GroupContentForm groupContentForm){ - User cu= (User)request.getSession().getAttribute("cu"); - groupContentForm.setId(CommUtil.getUUID()); - groupContentForm.setType(GroupContentForm.Type_column); - - Result result = new Result(); - int code = this.groupContentFormService.save(groupContentForm); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosaveForRow.do") - public String dosaveForRow(HttpServletRequest request, Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - - String pid=request.getParameter("pid"); - GroupContentForm groupContentForm=new GroupContentForm(); - - groupContentForm.setId(CommUtil.getUUID()); - List list = this.groupContentFormService.selectListByWhere(" where type='"+GroupContentForm.Type_row+"' " - + " and pid='"+pid+"' order by insertRow desc "); - - if(list!=null&&list.size()>0){ - int nowrow=list.get(0).getInsertrow(); - int changerow=nowrow+1; - groupContentForm.setInsertrow(changerow); - groupContentForm.setPid(pid); - groupContentForm.setType(GroupContentForm.Type_row); - }else{ - groupContentForm.setInsertrow(1); - groupContentForm.setPid(pid); - groupContentForm.setType(GroupContentForm.Type_row); - } - - Result result = new Result(); - int code = this.groupContentFormService.save(groupContentForm); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doupdateForColumn.do") - public String doupdateForColumn(HttpServletRequest request,Model model, - @ModelAttribute(value="groupContentForm") GroupContentForm groupContentForm){ - User cu= (User)request.getSession().getAttribute("cu"); - - int changecolumn=groupContentForm.getInsertcolumn(); - - Result result = new Result(); - int code = this.groupContentFormService.update(groupContentForm); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id){ - GroupContentForm groupContentForm = this.groupContentFormService.selectById(id); - model.addAttribute("groupContentForm", groupContentForm); - return "/work/groupContentFormEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute GroupContentForm groupContentForm){ - User cu = (User) request.getSession().getAttribute("cu"); - - int code = this.groupContentFormService.update(groupContentForm); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.groupContentFormService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.groupContentFormService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelForRow.do") - public String dodelForRow(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - - List list2 = this.groupContentFormService.selectListByWhere(" where " - + " pid='"+id+"' "); - if(list2!=null&&list2.size()>0){ - result = Result.failed("删除失败,信息被占用"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - GroupContentForm wForm=this.groupContentFormService.selectById(id); - - String pid=request.getParameter("pid"); - List list = this.groupContentFormService.selectListByWhere(" where type='"+GroupContentForm.Type_row+"' " - + " and pid='"+pid+"' and insertRow>"+wForm.getInsertrow()+" order by insertRow desc "); - - if(list!=null&&list.size()>0){ - for (int i = 0; i < list.size(); i++) { - GroupContentForm wForm2=list.get(i); - int changerow=wForm2.getInsertrow()-1; - wForm2.setInsertrow(wForm2.getInsertrow()-1); - this.groupContentFormService.update(wForm2); - } - } - int code = this.groupContentFormService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelForColumn.do") - public String dodelForColumn(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - - GroupContentForm wForm=this.groupContentFormService.selectById(id); - String pid=request.getParameter("pid"); - List list = this.groupContentFormService.selectListByWhere(" where type='"+GroupContentForm.Type_column+"' " - + " and pid='"+pid+"' and insertColumn>"+wForm.getInsertcolumn()+" order by insertColumn desc "); - - if(list!=null&&list.size()>0){ - for (int i = 0; i < list.size(); i++) { - GroupContentForm wForm2=list.get(i); - int changecolumn=wForm2.getInsertcolumn()-1; - wForm2.setInsertcolumn(changecolumn); - this.groupContentFormService.update(wForm2); - } - } - - int code = this.groupContentFormService.deleteById(id); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } -} diff --git a/src/com/sipai/controller/work/GroupController.java b/src/com/sipai/controller/work/GroupController.java deleted file mode 100644 index fd44a95a..00000000 --- a/src/com/sipai/controller/work/GroupController.java +++ /dev/null @@ -1,248 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.UserWorkStation; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.GroupMemberService; -import com.sipai.service.work.GroupService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/group") -public class GroupController { - @Resource - private GroupService groupService; - @Resource - private GroupMemberService groupMemberService; - @Resource - private UnitService unitService; - @Resource - private LoginService loginService; - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/work/recorder"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " deptid "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "work/group/showlist.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_pid")!=null && !request.getParameter("search_pid").isEmpty()){ - List unitlist=unitService.getUnitChildrenById(request.getParameter("search_pid")); - String pidstr=""; - for(int i=0;i list = this.groupService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/demoAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String groupId = request.getParameter("id"); - Group group = this.groupService.selectById(groupId); - model.addAttribute("group", group); - model.addAttribute("result", JSONObject.fromObject(group)); - return "work/demoEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute Group group){ - User cu= (User)request.getSession().getAttribute("cu"); - if(!this.groupService.checkNotOccupied(group.getId(), group.getName())){ - model.addAttribute("result", "{\"res\":\"班组名称重复\"}"); - return "result"; - } - String id = CommUtil.getUUID(); - group.setId(id); - group.setInsuser(cu.getId()); - group.setInsdt(CommUtil.nowDate()); - - int result =this.groupService.save(group); - /*if(result>0){ - groupMemberService.saveMembers(group.getId(), request.getParameter("leaderid"), "leader"); - groupMemberService.saveMembers(group.getId(), request.getParameter("memberid"), "member"); - groupMemberService.saveMembers(group.getId(), request.getParameter("chiefid"), "chief"); - }*/ - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute Group group){ - if(!this.groupService.checkNotOccupied(group.getId(), group.getName())){ - model.addAttribute("result", "{\"res\":\"班组名称重复\"}"); - return "result"; - } - int result = this.groupService.update(group); - /*if(result>0){ - groupMemberService.deleteByGroupId(group.getId()); - groupMemberService.saveMembers(group.getId(), request.getParameter("leaderid"), "leader"); - groupMemberService.saveMembers(group.getId(), request.getParameter("memberid"), "member"); - groupMemberService.saveMembers(group.getId(), request.getParameter("chiefid"), "chief"); - }*/ - String resstr="{\"res\":\""+result+"\",\"id\":\""+group.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.groupService.deleteById(id); - /*if(result>0){ - this.groupMemberService.deleteByGroupId(id); - }*/ - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.groupService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model) { - return "/work/groupListForSelect"; - } - @RequestMapping("/getListForSelect.do") - public String getListForSelect(HttpServletRequest request,Model model) { - List list = this.groupService.selectListByWhere(""); - JSONArray json=new JSONArray(); - if(list!=null && list.size()>0){ - int i=0; - for (Group group : list) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", group.getName()); - jsonObject.put("text", group.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result",json); - return "result"; - } - @RequestMapping("/showlistForSelectByGroup.do") - public String showlistForSelectByGroup(HttpServletRequest request,Model model) { - return "/work/groupListForSelectByGroup"; - } - @RequestMapping("/edit4scheduling.do") - public String edit4scheduling(HttpServletRequest request,Model model) { - String groupid = request.getParameter("id"); - String userids = request.getParameter("userids"); - String workstationids = request.getParameter("workstationids"); - model.addAttribute("groupid", groupid); - model.addAttribute("userids", userids); - model.addAttribute("workstationids", workstationids); - return "/work/groupMemberListForScheduling"; - } - @RequestMapping("/getMemberListByGroupId.do") - public ModelAndView getMemberListByGroupId(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - - PageHelper.startPage(page, rows); - List list = this.groupMemberService.selectListByGroupId(request.getParameter("groupid")); - String userids=request.getParameter("userids"); - String workstationids=request.getParameter("workstationids"); - - - if(userids!=null&&!userids.isEmpty()){ - String[] item=userids.split(","); - String[] item_ws=new String[item.length]; - if(workstationids!=null && !workstationids.isEmpty()){ - item_ws=workstationids.split(","); - System.out.println(); - } - for(int i=0;i pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/GroupDetailController.java b/src/com/sipai/controller/work/GroupDetailController.java deleted file mode 100644 index 90bf73d6..00000000 --- a/src/com/sipai/controller/work/GroupDetailController.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.sipai.controller.work; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.info.Select2; -import com.sipai.entity.work.GroupType; -import com.sipai.service.work.GroupTypeService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupDetail; -import com.sipai.service.work.GroupDetailService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/groupDetail") -public class GroupDetailController { - @Resource - private GroupDetailService groupDetailService; - @Resource - private GroupTypeService groupTypeService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/groupDetailList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id= '" + request.getParameter("unitId") + "' "; - } - - //查询所属班组 - String groupTypeCode = request.getParameter("groupTypeCode"); - if (groupTypeCode != null) { - List groupTypes = groupTypeService.selectListByWhere("where patrolType = '" + groupTypeCode + "'"); - if (groupTypes != null && groupTypes.size() > 0) { - wherestr += " and grouptype_id = '" + groupTypes.get(0).getId() + "'"; - } - } - if (request.getParameter("grouptypeId") != null && !request.getParameter("grouptypeId").isEmpty()) { - if(!request.getParameter("grouptypeId").equals("-1")){ - wherestr += " and grouptype_id= '" + request.getParameter("grouptypeId") + "' "; - } - } - - PageHelper.startPage(page, rows); - List list = this.groupDetailService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/work/groupDetailAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute GroupDetail groupDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - groupDetail.setId(CommUtil.getUUID()); - groupDetail.setInsdt(CommUtil.nowDate()); - groupDetail.setInsuser(userId); - int code = this.groupDetailService.save(groupDetail); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - GroupDetail groupDetail = this.groupDetailService.selectById(id); - model.addAttribute("groupDetail", groupDetail); - return "/work/groupDetailEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute GroupDetail groupDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.groupDetailService.update(groupDetail); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.groupDetailService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.groupDetailService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getlistForSelect2.do") - public ModelAndView getlistForSelect2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String orderstr = " order by name "; - String wherestr = " where 1=1 and unit_id='" + request.getParameter("unitId") + "' "; - if (request.getParameter("grouptype") != null && !request.getParameter("grouptype").isEmpty()) { - wherestr += " and grouptype_id = '" + request.getParameter("grouptype") + "' "; - } - List list = this.groupDetailService.selectListByWhere(wherestr + orderstr); - - List selet2List = new ArrayList(); - for (int i = 0; i < list.size(); i++) { - Select2 select2 = new Select2(); - select2.setId(list.get(i).getId()); - select2.setText(list.get(i).getName()); - selet2List.add(select2); - } - - JSONArray json = JSONArray.fromObject(selet2List); - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getGroupDetailTree.do") - public ModelAndView getGroupDetailTree(HttpServletRequest request, Model model) { - String sqlstr = "where 1=1 and grouptype_id='"+request.getParameter("groupTypeId")+"' and unit_id='"+request.getParameter("unitId")+"' "; - List list = this.groupDetailService.selectListByWhere(sqlstr + " order by name"); - - ArrayList> list_result = new ArrayList>(); - for (GroupDetail groupDetail : list) { - Map map = new HashMap(); - map.put("id", groupDetail.getId()); - map.put("text", groupDetail.getName()); - list_result.add(map); - } - String treeList = JSONArray.fromObject(list_result).toString(); - - model.addAttribute("result", treeList); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/GroupManageController.java b/src/com/sipai/controller/work/GroupManageController.java deleted file mode 100644 index 84285efc..00000000 --- a/src/com/sipai/controller/work/GroupManageController.java +++ /dev/null @@ -1,250 +0,0 @@ -package com.sipai.controller.work; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.info.Select2; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupManage; -import com.sipai.service.work.GroupManageService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -/** - * 暂时弃用 - * sj 2021-08-13 - */ -@Controller -@RequestMapping("/work/groupManage") -public class GroupManageController { - @Resource - private GroupManageService groupManageService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/work/groupManageList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr = "where 1=1 "; - if(request.getParameter("bizId")!=null && !request.getParameter("bizId").isEmpty()){ - wherestr += " and biz_id= '"+request.getParameter("bizId")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.groupManageService.selectActivteListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - @RequestMapping("/getlistForSelect.do") - public ModelAndView getlistForSelect(HttpServletRequest request,Model model, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=CommUtil.getwherestr("insuser", "work/groupManage/showlist.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("wdt")!=null && !request.getParameter("wdt").isEmpty()){ - wherestr += " and eddt >= '"+request.getParameter("wdt")+"' "; - } - - List list = this.groupManageService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/showlistforselect.do") - public String showlistforselect(HttpServletRequest request,Model model) { - return "/work/groupManageListForSelect"; - } - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/groupManageAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String Id = request.getParameter("id"); - GroupManage groupManage = this.groupManageService.selectById(Id); - model.addAttribute("groupManage", groupManage); - return "work/groupManageEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute GroupManage groupManage){ - if(!this.groupManageService.checkNotOccupied(groupManage.getId(), groupManage.getName())){ - model.addAttribute("result", "{\"res\":\"班次名称重复\"}"); - return "result"; - } - User cu= (User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - groupManage.setId(id); - groupManage.setInsdt(CommUtil.nowDate()); - groupManage.setInsuser(cu.getId()); - groupManage.setDelflag(false); - int result = this.groupManageService.save(groupManage); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute GroupManage groupManage){ - /*if(!this.groupManageService.checkNotOccupied(groupManage.getId(), groupManage.getName())){ - model.addAttribute("result", "{\"res\":\"班次名称重复\"}"); - return "result"; - }*/ - User cu= (User)request.getSession().getAttribute("cu"); - groupManage.setInsuser(cu.getId()); - groupManage.setInsdt(CommUtil.nowDate()); - int result = this.groupManageService.update(groupManage); - String resstr="{\"res\":\""+result+"\",\"id\":\""+groupManage.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.groupManageService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.groupManageService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - /* - * 每隔两小时获取时间段 - * */ - @RequestMapping("/getTimePeriod.do") - public ModelAndView getTimePeriod(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String nowdate = request.getParameter("nowdate"); - String timeperiod = request.getParameter("timeperiod"); - String time[] = this.groupManageService.getStartAndEndTime(nowdate); - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); -// Date nowDate=sdf.parse(time[0]); - List> list =new ArrayList<>(); - try{ - Calendar cal_start=Calendar.getInstance(); - cal_start.setTime(sdf.parse(time[0])); - Calendar cal_end=Calendar.getInstance(); - cal_end.setTime(sdf.parse(time[1])); - - while(cal_start.getTime().getTime() itemMap= new HashMap<>(); - String time1=sdf.format(cal_start.getTime()); - itemMap.put("id", time1); - cal_start.add(Calendar.HOUR_OF_DAY, Integer.valueOf(timeperiod)); - itemMap.put("value", time1.substring(10,16)+"~"+sdf.format(cal_start.getTime()).substring(10,16)); - list.add(itemMap); - } - }catch(Exception e){ - e.printStackTrace(); - } - JSONArray json=JSONArray.fromObject(list); - - model.addAttribute("result",json); - return new ModelAndView("result"); - } - @RequestMapping("/getlistForSelect2.do") - public ModelAndView getlistForSelect2(HttpServletRequest request,Model model, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1";//CommUtil.getwherestr("insuser", "work/groupManage/showlist.do", cu); - if(request.getParameter("querytype")!=null&&request.getParameter("querytype").equals("select")){ - wherestr = " where 1=1 "; - } - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - wherestr += " and biz_id = '"+request.getParameter("bizid")+"' "; - } - - List list = this.groupManageService.selectListByWhere(wherestr+orderstr); - List selet2List = new ArrayList(); - for (int i=0;i pi = new PageInfo(selet2List); - JSONArray json=JSONArray.fromObject(selet2List); - -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",json); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/GroupTimeController.java b/src/com/sipai/controller/work/GroupTimeController.java deleted file mode 100644 index c35b7c41..00000000 --- a/src/com/sipai/controller/work/GroupTimeController.java +++ /dev/null @@ -1,534 +0,0 @@ -package com.sipai.controller.work; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.info.Select2; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.work.Scheduling; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.work.SchedulingService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupTime; -import com.sipai.service.work.GroupTimeService; -import com.sipai.tools.CommUtil; - -/** - * 班次管理 - * sj 2021-08-13 - */ -@Controller -@RequestMapping("/work/groupTime") -public class GroupTimeController { - @Resource - private GroupTimeService groupTimeService; - @Resource - private SchedulingService schedulingService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private UserService userService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/groupTimeList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " sdt "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id= '" + request.getParameter("unitId") + "' "; - } - - PageHelper.startPage(page, rows); - List list = this.groupTimeService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/work/groupTimeAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute GroupTime groupTime) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - groupTime.setId(CommUtil.getUUID()); - groupTime.setInsdt(CommUtil.nowDate()); - groupTime.setInsuser(userId); - if (groupTime.getSdt().length() == 4) { - groupTime.setSdt("0" + groupTime.getSdt()); - } - if (groupTime.getEdt().length() == 4) { - groupTime.setEdt("0" + groupTime.getEdt()); - } - int code = this.groupTimeService.save(groupTime); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - GroupTime groupTime = this.groupTimeService.selectById(id); - model.addAttribute("groupTime", groupTime); - return "/work/groupTimeEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute GroupTime groupTime) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - if (groupTime.getSdt().length() == 4) { - groupTime.setSdt("0" + groupTime.getSdt()); - } - if (groupTime.getEdt().length() == 4) { - groupTime.setEdt("0" + groupTime.getEdt()); - } - - int code = this.groupTimeService.update(groupTime); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.groupTimeService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.groupTimeService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getlistForSelect2.do") - public ModelAndView getlistForSelect2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by sdt "; - - String wherestr = "where 1=1 ";//CommUtil.getwherestr("insuser", "work/groupManage/showlist.do", cu); - if (request.getParameter("grouptype") != null && !request.getParameter("grouptype").isEmpty()) { - wherestr += " and grouptype_id = '" + request.getParameter("grouptype") + "' "; - } - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "' "; - } - List list = this.groupTimeService.selectListByWhere(wherestr + orderstr); - - List selet2List = new ArrayList(); - for (int i = 0; i < list.size(); i++) { - Select2 select2 = new Select2(); - select2.setId(list.get(i).getId()); - select2.setText(list.get(i).getName()); - selet2List.add(select2); - } - - JSONArray json = JSONArray.fromObject(selet2List); - - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getNowGrouptimeForSucceed.do") - public ModelAndView getNowGrouptimeForSucceed(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String nowTime = CommUtil.nowDate(); - int nowHour = Integer.valueOf(nowTime.substring(11, 13)); - String unitId = request.getParameter("bizid"); - String groupType = request.getParameter("groupType"); - - JSONArray jsondata = new JSONArray(); - String lstjsondata = ""; - List groupTimeList = this.groupTimeService.selectListByWhere(" where unit_id='" + unitId + "' and grouptype_id='" + groupType + "' order by sdt "); - int nowGroupTimeNum = 0; - if (groupTimeList != null && groupTimeList.size() > 0) { - int firstHour = Integer.valueOf(groupTimeList.get(0).getSdt().substring(0, 2)); - for (int i = 0; i < groupTimeList.size(); i++) { - GroupTime groupTime = groupTimeList.get(i); - String sdt = nowTime.substring(0, 11) + groupTime.getSdt().substring(0, 5); - String edtAdd = String.valueOf(groupTime.getEdtadd()); - String edt = nowTime.substring(0, 11) + groupTime.getEdt().substring(0, 5); - if (nowHour < firstHour) { - sdt = CommUtil.subplus(sdt, "-" + edtAdd, "day"); - } else { - edt = CommUtil.subplus(edt, edtAdd, "day").substring(0, 11) + edt.substring(11, 16); - } - -// System.out.println(nowTime); -// System.out.println(sdt); -// System.out.println(edt); -// System.out.println(CommUtil.compare_time(sdt, nowTime)); -// System.out.println(CommUtil.compare_time(edt, nowTime)); - if (CommUtil.compare_time(sdt + ":00", nowTime) == -1 && CommUtil.compare_time(edt + ":00", nowTime) == 1) { - JSONObject jsonObject = new JSONObject(); - - jsonObject.put("id", groupTime.getId()); - jsonObject.put("text", groupTime.getName()); - jsonObject.put("sdt", sdt); - jsonObject.put("edt", edt); -// System.out.println(sdt); -// System.out.println(edt); - - //获取当前交接班内容信息 -值班人员和接班备注内容 可能无(未交接班并且无排班),那么获取班组内系统配置人员 - List schedulingList = this.schedulingService.selectListByWhere2(" where schedulingtype='" + groupType + "' " + - "and bizid='" + unitId + "' and (stdt<='" + sdt + "' and eddt>'" + sdt + "') and CHARINDEX('" + cu.getId() + "',workpeople)>0 order by stdt desc "); - if (schedulingList != null && schedulingList.size() > 0) { - Scheduling scheduling = schedulingList.get(0); - if (scheduling.getStatus().equals(Scheduling.Status_Succeeded) || scheduling.getStatus().equals(Scheduling.Status_Handovered)) { - jsonObject.put("nowSchedulingId", scheduling.getId()); - jsonObject.put("workpeople", scheduling.getWorkpeople()); - jsonObject.put("_workpeople", scheduling.get_workpeopleName()); - jsonObject.put("succeedremark", scheduling.getSucceedremark()); - jsonObject.put("schedulingSt", scheduling.getStatus()); - } else { - String groupDetailId = scheduling.getGroupdetailId(); - List groupDetailList = this.groupDetailService.selectListByWhere(" where CHARINDEX(id,'" + groupDetailId + "')>0 "); - if (groupDetailList != null && groupDetailList.size() > 0) { - GroupDetail groupDetail = groupDetailList.get(0); - jsonObject.put("nowSchedulingId", scheduling.getId()); - jsonObject.put("groupDetailId", groupDetail.getId()); - jsonObject.put("workpeople", scheduling.getWorkpeople()); - jsonObject.put("_workpeople", scheduling.get_workpeopleName()); - jsonObject.put("succeedremark", ""); - jsonObject.put("schedulingSt", ""); - } else { - jsonObject.put("nowSchedulingId", scheduling.getId()); - jsonObject.put("groupDetailId", ""); - jsonObject.put("workpeople", ""); - jsonObject.put("_workpeople", ""); - jsonObject.put("succeedremark", ""); - jsonObject.put("schedulingSt", ""); - } - } - } else { - List groupDetailList = this.groupDetailService.selectListByWhere(" where unit_id='" + unitId + "' and grouptype_id='" + groupType + "' and (leader='" + cu.getId() + "' or CHARINDEX('" + cu.getId() + "',members)>0 ) "); - if (groupDetailList != null && groupDetailList.size() > 0) { - List schedulingList2 = this.schedulingService.selectListByWhere2(" where schedulingtype='" + groupType + "' " + - "and bizid='" + unitId + "' and (stdt<='" + sdt + "' and eddt>'" + sdt + "') order by stdt desc "); - GroupDetail groupDetail = groupDetailList.get(0); - if (schedulingList2 != null && schedulingList2.size() > 0) { - jsonObject.put("nowSchedulingId", schedulingList2.get(0).getId()); - jsonObject.put("succeedremark", schedulingList2.get(0).getSucceedremark()); - if (schedulingList2.get(0).getStatus().equals(Scheduling.Status_Succeeded) || schedulingList2.get(0).getStatus().equals(Scheduling.Status_Handovered)) { - jsonObject.put("schedulingSt", schedulingList2.get(0).getStatus()); - } else { - jsonObject.put("schedulingSt", ""); - } - } else { - jsonObject.put("schedulingSt", ""); - } - jsonObject.put("groupDetailId", groupDetail.getId()); - User user = this.userService.getUserById(cu.getId()); - jsonObject.put("workpeople", cu.getId()); - jsonObject.put("_workpeople", user.getCaption()); - } else { - jsonObject.put("groupDetailId", ""); - jsonObject.put("workpeople", ""); - jsonObject.put("_workpeople", ""); - jsonObject.put("succeedremark", ""); - jsonObject.put("schedulingSt", ""); - } - } - - jsondata.add(jsonObject); - nowGroupTimeNum = i; - - break; - } - - } - -// //获取上个交班信息,用于展示交班内容 - GroupTime lastgroupTime = new GroupTime(); - if (nowGroupTimeNum == 0) { - lastgroupTime = groupTimeList.get(groupTimeList.size() - 1); - } else { - lastgroupTime = groupTimeList.get(nowGroupTimeNum - 1); - } - - String sdt = nowTime.substring(0, 11) + lastgroupTime.getSdt().substring(0, 5); - String edtAdd = String.valueOf(lastgroupTime.getEdtadd()); - String edt = nowTime.substring(0, 11) + lastgroupTime.getEdt().substring(0, 5); - if (nowHour < firstHour) { - sdt = CommUtil.subplus(sdt, "-" + edtAdd, "day"); - } else { - edt = CommUtil.subplus(edt, edtAdd, "day").substring(0, 11) + edt.substring(11, 16); - } - if (nowGroupTimeNum == 0) { - sdt = CommUtil.subplus(sdt, "-1", "day").substring(0,11)+sdt.substring(11,16); - edt = CommUtil.subplus(edt, "-1", "day").substring(0,11)+edt.substring(11,16); - } -// System.out.println(sdt); -// System.out.println(edt); - List schedulingList = this.schedulingService.selectListByWhere(" where (status=" + Scheduling.Status_Succeeded + " or status=" + Scheduling.Status_Handovered + ") and schedulingtype='" + groupType + "' " + - "and bizid='" + unitId + "' and (stdt<='" + sdt + "' and eddt>'" + sdt + "') order by stdt desc "); - if (schedulingList != null && schedulingList.size() > 0) { - lstjsondata = schedulingList.get(0).getId(); - } - - } - - JSONObject jsonObjectM = new JSONObject(); - jsonObjectM.put("data", jsondata); - jsonObjectM.put("lastSchedulingId", lstjsondata); - - model.addAttribute("result", jsonObjectM); - return new ModelAndView("result"); - } - - @RequestMapping("/getNowGrouptimeForSucceed2.do") - public ModelAndView getNowGrouptimeForSucceed2(HttpServletRequest request, Model model) { - String nowTime = CommUtil.nowDate(); - int nowHour = Integer.valueOf(nowTime.substring(11, 13)); - String unitId = request.getParameter("bizid"); - String groupType = request.getParameter("groupType"); - - JSONArray jsondata = new JSONArray(); - String lstjsondata = ""; - List groupTimeList = this.groupTimeService.selectListByWhere(" where unit_id='" + unitId + "' and grouptype_id='" + groupType + "' order by sdt "); - int nowGroupTimeNum = 0; - if (groupTimeList != null && groupTimeList.size() > 0) { - int firstHour = Integer.valueOf(groupTimeList.get(0).getSdt().substring(0, 2)); - for (int i = 0; i < groupTimeList.size(); i++) { - GroupTime groupTime = groupTimeList.get(i); - String sdt = nowTime.substring(0, 11) + groupTime.getSdt().substring(0, 5); - String edtAdd = String.valueOf(groupTime.getEdtadd()); - String edt = nowTime.substring(0, 11) + groupTime.getEdt().substring(0, 5); - if (nowHour < firstHour) { - sdt = CommUtil.subplus(sdt, "-" + edtAdd, "day"); - } else { - edt = CommUtil.subplus(edt, edtAdd, "day").substring(0, 11) + edt.substring(11, 16); - } - -// System.out.println(nowTime); -// System.out.println(sdt); -// System.out.println(edt); -// System.out.println(CommUtil.compare_time(sdt, nowTime)); -// System.out.println(CommUtil.compare_time(edt, nowTime)); - if (CommUtil.compare_time(sdt + ":00", nowTime) == -1 && CommUtil.compare_time(edt + ":00", nowTime) == 1) { - JSONObject jsonObject = new JSONObject(); - - jsonObject.put("id", groupTime.getId()); - jsonObject.put("text", groupTime.getName()); - jsonObject.put("sdt", sdt); - jsonObject.put("edt", edt); -// System.out.println(sdt); -// System.out.println(edt); - - //获取当前交接班内容信息 -值班人员和接班备注内容 可能无(未交接班并且无排班),那么获取班组内系统配置人员 - List schedulingList = this.schedulingService.selectListByWhere2(" where schedulingtype='" + groupType + "' " + - "and bizid='" + unitId + "' and (stdt<='" + sdt + "' and eddt>'" + sdt + "') order by stdt desc "); - if (schedulingList != null && schedulingList.size() > 0) { - Scheduling scheduling = schedulingList.get(0); - if (scheduling.getStatus().equals(Scheduling.Status_Succeeded) || scheduling.getStatus().equals(Scheduling.Status_Handovered)) { - jsonObject.put("nowSchedulingId", scheduling.getId()); - jsonObject.put("workpeople", scheduling.getWorkpeople()); - jsonObject.put("_workpeople", scheduling.get_workpeopleName()); - jsonObject.put("succeedremark", scheduling.getSucceedremark()); - jsonObject.put("schedulingSt", scheduling.getStatus()); - } else { - String groupDetailId = scheduling.getGroupdetailId(); - List groupDetailList = this.groupDetailService.selectListByWhere(" where CHARINDEX(id,'" + groupDetailId + "')>0 "); - if (groupDetailList != null && groupDetailList.size() > 0) { - GroupDetail groupDetail = groupDetailList.get(0); - jsonObject.put("nowSchedulingId", scheduling.getId()); - jsonObject.put("groupDetailId", groupDetail.getId()); - jsonObject.put("workpeople", scheduling.getWorkpeople()); - jsonObject.put("_workpeople", scheduling.get_workpeopleName()); - jsonObject.put("succeedremark", ""); - jsonObject.put("schedulingSt", ""); - } else { - jsonObject.put("nowSchedulingId", scheduling.getId()); - jsonObject.put("groupDetailId", ""); - jsonObject.put("workpeople", ""); - jsonObject.put("_workpeople", ""); - jsonObject.put("succeedremark", ""); - jsonObject.put("schedulingSt", ""); - } - } - } else { - List groupDetailList = this.groupDetailService.selectListByWhere(" where unit_id='" + unitId + "' and grouptype_id='" + groupType + "' "); - if (groupDetailList != null && groupDetailList.size() > 0) { - List schedulingList2 = this.schedulingService.selectListByWhere2(" where schedulingtype='" + groupType + "' " + - "and bizid='" + unitId + "' and (stdt<='" + sdt + "' and eddt>'" + sdt + "') order by stdt desc "); - GroupDetail groupDetail = groupDetailList.get(0); - if (schedulingList2 != null && schedulingList2.size() > 0) { - jsonObject.put("nowSchedulingId", schedulingList2.get(0).getId()); - jsonObject.put("succeedremark", schedulingList2.get(0).getSucceedremark()); - if (schedulingList2.get(0).getStatus().equals(Scheduling.Status_Succeeded) || schedulingList2.get(0).getStatus().equals(Scheduling.Status_Handovered)) { - jsonObject.put("schedulingSt", schedulingList2.get(0).getStatus()); - } else { - jsonObject.put("schedulingSt", ""); - } - } else { - jsonObject.put("schedulingSt", ""); - } - jsonObject.put("groupDetailId", groupDetail.getId()); - /*User user = this.userService.getUserById(cu.getId()); - jsonObject.put("workpeople", cu.getId()); - jsonObject.put("_workpeople", user.getCaption());*/ - } else { - jsonObject.put("groupDetailId", ""); - jsonObject.put("workpeople", ""); - jsonObject.put("_workpeople", ""); - jsonObject.put("succeedremark", ""); - jsonObject.put("schedulingSt", ""); - } - } - - jsondata.add(jsonObject); - nowGroupTimeNum = i; - - break; - } - - } - -// //获取上个交班信息,用于展示交班内容 - GroupTime lastgroupTime = new GroupTime(); - if (nowGroupTimeNum == 0) { - lastgroupTime = groupTimeList.get(groupTimeList.size() - 1); - } else { - lastgroupTime = groupTimeList.get(nowGroupTimeNum - 1); - } - - String sdt = nowTime.substring(0, 11) + lastgroupTime.getSdt().substring(0, 5); - String edtAdd = String.valueOf(lastgroupTime.getEdtadd()); - String edt = nowTime.substring(0, 11) + lastgroupTime.getEdt().substring(0, 5); - if (nowHour < firstHour) { - sdt = CommUtil.subplus(sdt, "-" + edtAdd, "day"); - } else { - edt = CommUtil.subplus(edt, edtAdd, "day").substring(0, 11) + edt.substring(11, 16); - } - if (nowGroupTimeNum == 0) { - sdt = CommUtil.subplus(sdt, "-1", "day").substring(0,11)+sdt.substring(11,16); - edt = CommUtil.subplus(edt, "-1", "day").substring(0,11)+edt.substring(11,16); - } -// System.out.println(sdt); -// System.out.println(edt); - List schedulingList = this.schedulingService.selectListByWhere(" where (status=" + Scheduling.Status_Succeeded + " or status=" + Scheduling.Status_Handovered + ") and schedulingtype='" + groupType + "' " + - "and bizid='" + unitId + "' and (stdt<='" + sdt + "' and eddt>'" + sdt + "') order by stdt desc "); - if (schedulingList != null && schedulingList.size() > 0) { - lstjsondata = schedulingList.get(0).getId(); - } - - } - - JSONObject jsonObjectM = new JSONObject(); - jsonObjectM.put("data", jsondata); - jsonObjectM.put("lastSchedulingId", lstjsondata); - - model.addAttribute("result", jsonObjectM); - return new ModelAndView("result"); - } - - @RequestMapping("/getNowGrouptimeForHandover.do") - public ModelAndView getNowGrouptimeForHandover(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String nowTime = CommUtil.nowDate(); - String unitId = request.getParameter("bizid"); - String groupType = request.getParameter("groupType"); - - List groupTimeList = this.groupTimeService.selectListByWhere(" where unit_id='" + unitId + "' and grouptype_id='" + groupType + "' order by sdt "); - for (GroupTime groupTime : - groupTimeList) { - String dt = groupTime.getEdt(); - String timeExpand = String.valueOf(groupTime.getTimeexpand()); - - String sdt = CommUtil.subplus(nowTime.substring(0, 11) + dt, "-" + timeExpand, "min"); - String edt = CommUtil.subplus(nowTime.substring(0, 11) + dt, timeExpand, "min"); - - System.out.println(nowTime); - System.out.println(sdt); - System.out.println(CommUtil.compare_date(sdt, nowTime)); - if (CommUtil.compare_date(sdt, nowTime) < 0 && CommUtil.compare_date(edt, nowTime) > 0) { - System.out.println(groupTime.getName()); - } - - } - - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/GroupTypeController.java b/src/com/sipai/controller/work/GroupTypeController.java deleted file mode 100644 index f4c139d9..00000000 --- a/src/com/sipai/controller/work/GroupTypeController.java +++ /dev/null @@ -1,315 +0,0 @@ -package com.sipai.controller.work; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.work.GroupDetail; -import com.sipai.service.work.GroupDetailService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupType; -import com.sipai.service.work.GroupTypeService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/groupType") -public class GroupTypeController { - @Resource - private GroupTypeService groupTypeService; - @Resource - private GroupDetailService groupDetailService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/groupTypeList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; -// if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ -// wherestr += " and unit_id= '"+request.getParameter("unitId")+"' "; -// } - - PageHelper.startPage(page, rows); - List list = this.groupTypeService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "/work/groupTypeAdd"; - } - - @RequestMapping("/showGroupType4Select.do") - public String showAccidentType4Select(HttpServletRequest request, Model model) { - return "/work/groupType4Select"; - } - - @RequestMapping("/getGroupTypeTree.do") - public ModelAndView getGroupTypeTree(HttpServletRequest request, Model model) { - String sqlstr = "where 1=1 order by morder"; - List list = this.groupTypeService.selectListByWhere(sqlstr); - - ArrayList> list_result = new ArrayList>(); - for (GroupType groupType : list) { - Map map = new HashMap(); - map.put("id", groupType.getId()); - map.put("text", groupType.getName()); - list_result.add(map); - } - String treeList = JSONArray.fromObject(list_result).toString(); - - model.addAttribute("result", treeList); - return new ModelAndView("result"); - } - - @RequestMapping("/getSelect2ForSearch.do") - public ModelAndView getSelect2ForSearch(HttpServletRequest request, Model model) { - String sqlstr = "where 1=1"; - List list = this.groupTypeService.selectListByWhere(sqlstr); - - ArrayList> list_result = new ArrayList>(); - Map allmap = new HashMap(); - allmap.put("id", "-1"); - allmap.put("text", "全部"); - list_result.add(allmap); - for (GroupType groupType : list) { - Map map = new HashMap(); - map.put("id", groupType.getId()); - map.put("text", groupType.getName()); - list_result.add(map); - } - String treeList = JSONArray.fromObject(list_result).toString(); - - model.addAttribute("result", treeList); - return new ModelAndView("result"); - } - - @RequestMapping("/getGroupTypeTreeFromDetail.do") - public ModelAndView getGroupTypeTreeFromDetail(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - List groupDetailList = this.groupDetailService.selectListByWhere(" where unit_id='" + unitId + "' "); - - if (groupDetailList != null && groupDetailList.size() > 0) { - String typeIds = ""; - for (int i = 0; i < groupDetailList.size(); i++) { - typeIds += groupDetailList.get(i).getGrouptypeId() + ","; - } - typeIds = typeIds.replace(",", "','"); - List list = this.groupTypeService.selectListByWhere("where id in ('" + typeIds + "')"); - - ArrayList> list_result = new ArrayList>(); - for (GroupType groupType : list) { - Map map = new HashMap(); - map.put("id", groupType.getId()); - map.put("text", groupType.getName()); - map.put("patroltype", groupType.getPatroltype()); - list_result.add(map); - } - String treeList = JSONArray.fromObject(list_result).toString(); - - model.addAttribute("result", treeList); - - } - - return new ModelAndView("result"); - } - - @RequestMapping("/getAllGroupTypeTree.do") - public ModelAndView getAllGroupTypeTree(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - List groupTypeList = this.groupTypeService.selectListByWhere(" order by morder "); - - ArrayList> list_result = new ArrayList>(); - for (GroupType groupType : groupTypeList) { - Map map = new HashMap(); - map.put("id", groupType.getId()); - map.put("text", groupType.getName()); - map.put("type", "0"); - - List groupDetailList = this.groupDetailService.selectListByWhere(" where grouptype_id='" + groupType.getId() + "' and unit_id='" + unitId + "' order by name "); - List> childlistD = new ArrayList>(); - for (GroupDetail groupDetail : groupDetailList) { - Map mapD = new HashMap(); - mapD.put("id", groupDetail.getId()); - mapD.put("text", groupDetail.getName()); - mapD.put("type", "1"); - childlistD.add(mapD); - } - map.put("nodes", childlistD); - - list_result.add(map); - } - - String treeList = JSONArray.fromObject(list_result).toString(); - model.addAttribute("result", treeList); - - return new ModelAndView("result"); - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute GroupType groupType) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - groupType.setId(CommUtil.getUUID()); - groupType.setInsdt(CommUtil.nowDate()); - groupType.setInsuser(userId); - int code = this.groupTypeService.save(groupType); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - GroupType groupType = this.groupTypeService.selectById(id); - model.addAttribute("groupType", groupType); - return "/work/groupTypeEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute GroupType groupType) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu.getId(); - - int code = this.groupTypeService.update(groupType); - - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Result result = new Result(); - int code = this.groupTypeService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.groupTypeService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/getNowGroupType.do") - public ModelAndView getNowGroupType(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String inuserId = request.getParameter("userId"); - String userId = ""; - if (inuserId != null && inuserId.length() > 0) { - userId = inuserId; - } else { - userId = cu.getId(); - } - - String nowTime = CommUtil.nowDate(); - String unitId = request.getParameter("bizid"); - - List groupDetailList = this.groupDetailService.selectListByWhere(" where unit_id='" + unitId + "' and (leader='" + userId + "' or CHARINDEX('" + userId + "',members)>0 )"); - JSONArray jsondata = new JSONArray(); - if (groupDetailList != null && groupDetailList.size() > 0) { - String nowIds = ""; - for (int i = 0; i < groupDetailList.size(); i++) { - GroupType groupType = this.groupTypeService.selectById(groupDetailList.get(i).getGrouptypeId()); - if (nowIds.contains(groupType.getId())) { - //防止同一班组类别,人员配到多班组 - - } else { - //防止重复班组数据 - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", groupType.getId()); - jsonObject.put("text", groupType.getName()); -// jsonObject.put("workpeople", groupDetailList.get(i).getLeader()+","+groupDetailList.get(i).getMembers()+",");//目前一个人同一个班组类别配两个班组上,会随机获得其中一个班组信息,以后需求需要多配人的话再考虑 -// jsonObject.put("_workpeople", groupDetailList.get(i).get_leader()+","+groupDetailList.get(i).get_members()); -// jsonObject.put("groupDetailId", groupDetailList.get(i).getId()); - jsondata.add(jsonObject); - } - nowIds += groupType.getId() + ","; - } - } else { - //该人不在班组人员内 - - } - model.addAttribute("result", jsondata); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/work/KPIPointController.java b/src/com/sipai/controller/work/KPIPointController.java deleted file mode 100644 index b83c38a4..00000000 --- a/src/com/sipai/controller/work/KPIPointController.java +++ /dev/null @@ -1,337 +0,0 @@ -package com.sipai.controller.work; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.base.Result; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.util.JavaScriptUtils; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.entity.work.KPIPoint; -import com.sipai.entity.work.KPIPointProfessor; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.KPIPointProfessorService; -import com.sipai.service.work.KPIPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/kpipoint") -public class KPIPointController { - @Resource - private KPIPointService kPIPointService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - @Resource - private KPIPointProfessorService kPIPointProfessorService; - @Resource - private UserService userService; - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/work/KPIPointList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("companyId"); - String pSectionId=request.getParameter("pSectionId"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - if(companyId!=null && !companyId.isEmpty()){ - wherestr += " and bizId = '"+companyId+"' "; - } - if(pSectionId!=null && !pSectionId.isEmpty()){ - wherestr += " and processsectionid = '"+pSectionId+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and mpointId like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.kPIPointService.selectListByWhere(wherestr+orderstr); -// List lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); -// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); - for (int i=0; i < list.size(); i++) { - ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid()); - if (processSection != null) { - list.get(i).setProcessectionname(processSection.getName()); - } - Company company = this.unitService.getCompById(list.get(i).getBizid()); - if (company != null) { - list.get(i).setBizid(company.getName()); - } - User user = this.userService.getUserById(list.get(i).getInsuser()); - if (user != null) { - list.get(i).setInsuser(user.getCaption()); - } - MPoint mPoint = this.mPointService.selectById(companyId,list.get(i).getMpointid()); - if (mPoint != null) { - list.get(i).setMpointname(mPoint.getParmname()); - list.get(i).setMpoint(mPoint); - } - List kPIPointProfessor = this.kPIPointProfessorService.selectListByWhere(" where flag='"+KPIPointProfessor.Flag_Yes+"'and mpid='"+list.get(i).getMpointid()+"'"); - if(kPIPointProfessor!=null && kPIPointProfessor.size()>0){ - list.get(i).setFlag(kPIPointProfessor.get(0).getFlag()); - } - } - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/KPIPointAdd"; - } - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String userId = request.getParameter("id"); - KPIPoint kPIPoint = this.kPIPointService.selectById(userId); - ProcessSection processSection = this.processSectionService.selectById(kPIPoint.getProcesssectionid()); - MPoint mPoint = this.mPointService.selectById(kPIPoint.getBizid(),kPIPoint.getMpointid()); - if (mPoint != null) { - kPIPoint.setMpointname(mPoint.getParmname()); - } - model.addAttribute("kPIPoint", kPIPoint); - return "work/KPIPointEdit"; - } - - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String userId = request.getParameter("id"); - KPIPoint kPIPoint = this.kPIPointService.selectById(userId); - ProcessSection processSection = this.processSectionService.selectById(kPIPoint.getProcesssectionid()); - if (processSection != null) { - kPIPoint.setProcessectionname(processSection.getName()); - } - Company company = this.unitService.getCompById(kPIPoint.getBizid()); - if (company != null) { - kPIPoint.setBizid(company.getName()); - } - MPoint mPoint = this.mPointService.selectById(kPIPoint.getBizid(),kPIPoint.getMpointid()); - if (mPoint != null) { - kPIPoint.setMpointname(mPoint.getParmname()); - } - model.addAttribute("kPIPoint", kPIPoint); - return "work/KPIPointView"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute KPIPoint kPIPoint){ - User cu= (User)request.getSession().getAttribute("cu"); - kPIPoint.setId(CommUtil.getUUID()); - kPIPoint.setInsuser(cu.getId()); - kPIPoint.setInsdt(CommUtil.nowDate()); - int result = this.kPIPointService.save(kPIPoint); - String resstr="{\"res\":\""+result+"\",\"id\":\""+kPIPoint.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute KPIPoint kPIPoint){ - User cu= (User)request.getSession().getAttribute("cu"); - kPIPoint.setInsuser(cu.getId()); - kPIPoint.setInsdt(CommUtil.nowDate()); - int result = this.kPIPointService.update(kPIPoint); - String resstr="{\"res\":\""+result+"\",\"id\":\""+kPIPoint.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.kPIPointService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.kPIPointService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request,Model model, - @RequestParam(value="pid") String pid) { - request.setAttribute("pid", request.getParameter("pid")); - return "/work/KPIPointListForSelect"; - } - @RequestMapping("/showlistForSelects.do") - public String showlistForSelects(HttpServletRequest request,Model model) { - return "/work/KPIPointListForSelects"; - } - /* - * KPI测量点多维曲线 - */ -// @RequestMapping("/showchart.do") -// public String showchart(HttpServletRequest request,Model model, -// @RequestParam(value="ids") String ids, -// @RequestParam(value="sdt") String sdt, -// @RequestParam(value="edt") String edt, -// @RequestParam(value="companyId") String companyId) { -// String[] idarr = ids.split(","); -// String namestr=""; -// String unitstr=""; -// String idstr=""; -// JavaScriptUtils javaScriptUtils = new JavaScriptUtils(); -// for(int i=0;i list = this.kPIPointService.selectListByWhere(wherestr+orderstr); - - for (int i=0; i < list.size(); i++) { - ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid()); - if (processSection != null) { - list.get(i).setProcessectionname(processSection.getName()); - } - Company company = this.unitService.getCompById(list.get(i).getBizid()); - if (company != null) { - list.get(i).setBizid(company.getName()); - } - User user = this.userService.getUserById(list.get(i).getInsuser()); - if (user != null) { - list.get(i).setInsuser(user.getCaption()); - } - MPoint4APP mPoint4APP = this.mPointService.selectByWhere4APP(request.getParameter("bizid").toString(),list.get(i).getMpointid()); - list.get(i).setmPoint4APP(mPoint4APP); - - } - - JSONArray json=JSONArray.fromObject(list); - - result="{\"status\":\""+CommString.Status_Pass+"\",\"content1\":"+json+"}"; - }catch(Exception e){ - result="{\"status\":\""+CommString.Status_Fail+"\"}"; - } -// System.out.println(result); - model.addAttribute("result",result); - - return new ModelAndView("result"); - } - - @RequestMapping("/getKPIPointTree.do") - public ModelAndView getKPIPointTree(HttpServletRequest request, Model model, - @RequestParam(value = "mpointId") String mpointId) { - - //获取测量点的关系树 - Map tree = new HashMap(); - if (!mpointId.isEmpty()) { - tree = kPIPointService.getMPointTree(mpointId, MPoint.Flag_Type_KPI); - } -// JSONArray json = JSONArray.fromObject(tree); -// System.out.println(tree.size()); - Result result = tree.size() != 0 ? Result.success(tree) : Result.failed("没有获取到相关测量点"); - String json = CommUtil.toJson(result); - model.addAttribute("result", json); - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/KPIPointProfessorController.java b/src/com/sipai/controller/work/KPIPointProfessorController.java deleted file mode 100644 index 36ca1510..00000000 --- a/src/com/sipai/controller/work/KPIPointProfessorController.java +++ /dev/null @@ -1,303 +0,0 @@ -//package com.sipai.controller.work; -// -//import java.math.BigDecimal; -//import java.text.DecimalFormat; -//import java.text.SimpleDateFormat; -//import java.util.ArrayList; -//import java.util.Calendar; -//import java.util.Date; -//import java.util.HashMap; -//import java.util.List; -//import java.util.Map; -// -//import javax.annotation.Resource; -//import javax.servlet.http.HttpServletRequest; -//import javax.servlet.http.HttpServletResponse; -//import javax.servlet.http.HttpSession; -// -//import net.sf.json.JSONArray; -//import net.sf.json.JSONObject; -// -//import org.springframework.stereotype.Controller; -//import org.springframework.ui.Model; -//import org.springframework.web.bind.annotation.ModelAttribute; -//import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.bind.annotation.RequestParam; -//import org.springframework.web.servlet.ModelAndView; -//import org.springframework.web.util.JavaScriptUtils; -// -//import com.github.pagehelper.PageHelper; -//import com.github.pagehelper.PageInfo; -//import com.sipai.entity.msg.Msg; -//import com.sipai.entity.scada.MPoint; -//import com.sipai.entity.user.ProcessSection; -//import com.sipai.entity.user.User; -//import com.sipai.entity.work.KPIPointProfessor; -//import com.sipai.entity.work.KPIPointProfessorParam; -//import com.sipai.service.scada.MPointService; -//import com.sipai.service.user.ProcessSectionService; -//import com.sipai.service.user.UnitService; -//import com.sipai.service.user.UserService; -//import com.sipai.service.work.KPIPointProfessorParamService; -//import com.sipai.service.work.KPIPointProfessorService; -//import com.sipai.tools.HttpUtil; -//import com.sipai.tools.CommString; -//import com.sipai.tools.CommUtil; -// -// -//@Controller -//@RequestMapping("/work/KPIPro") -//public class KPIPointProfessorController { -// @Resource -// private KPIPointProfessorService kPIPointProfessorService; -// @Resource -// private KPIPointProfessorParamService kPIPointProfessorParamService; -// @Resource -// private ProcessSectionService processSectionService; -// @Resource -// private UnitService unitService; -// @Resource -// private MPointService mPointService; -// @Resource -// private UserService userService; -// /**给主页显示当天的需滚动消息*/ -// @RequestMapping("/getUnreadMsgs4main.do") -// public String getUnreadMsgs4main(HttpServletRequest request,Model model){ -// User cu= (User) request.getSession().getAttribute("cu"); -// SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// Calendar calendar = Calendar.getInstance(); -// calendar.setTime(new Date()); -// calendar.add(Calendar.DATE, -1); -// String nowDate = simpleDateFormat.format(calendar.getTime()); -// String orderstr=" order by M.insdt desc"; -// String wherestr=" where 1=1"; -// //wherestr+=" and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+cu.getId()+"' and V.status='U' "; -//// wherestr+=" and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+cu.getId()+"' and V.status='U' and m.insdt>='"+nowDate+"' "; -// //List list = this.msgService.getMsgrecv(wherestr+orderstr); -// List list = this.kPIPointProfessorService.selectListByWhere(""); -// JSONArray jsonArray =JSONArray.fromObject(list); -// String result ="{\"total\":"+list.size()+",\"rows\":"+jsonArray.toString()+"}"; -// model.addAttribute("result", result); -// return "result"; -// } -// -// @RequestMapping("/getData.do") -// public ModelAndView getData(HttpServletRequest request,Model model){ -// User cu= (User)request.getSession().getAttribute("cu"); -// List list = this.kPIPointProfessorService.selectListByWhere(""); -// JSONArray json = JSONArray.fromObject(list); -// -// for(int i=0;i kPIPointProfessorParam = this.kPIPointProfessorParamService.selectListByWhere(" where pid='"+list.get(i).getId()+"'"); -// JSONArray jsonarr=JSONArray.fromObject(kPIPointProfessorParam); -// jsonobj.put("kPIPointProfessorParam", jsonarr); -// } -// String result = json.toString(); -// request.setAttribute("result", result); -// return new ModelAndView("result"); -// } -// @RequestMapping("/showlist.do") -// public String showlist(HttpServletRequest request,Model model) { -// return "/work/KPIPointProfessorList"; -// } -// @RequestMapping("/getlist.do") -// public ModelAndView getlist(HttpServletRequest request,Model model, -// @RequestParam(value = "page") Integer page, -// @RequestParam(value = "rows") Integer rows, -// @RequestParam(value = "sort", required=false) String sort, -// @RequestParam(value = "order", required=false) String order) { -// HttpSession currentSession = request.getSession(false); -// User cu=(User)request.getSession().getAttribute("cu"); -// String companyId =request.getParameter("companyId"); -// String pSectionId=request.getParameter("pSectionId"); -//// if(cu==null){ -//// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -//// } -// if(sort==null){ -// sort = " insdt "; -// } -// if(order==null){ -// order = " asc "; -// } -// String orderstr=" order by "+sort+" "+order; -// -// String wherestr="where 1=1"; -// if(companyId!=null && !companyId.isEmpty()){ -// wherestr += " and biz_id = '"+companyId+"' "; -// } -// if(pSectionId!=null && !pSectionId.isEmpty()){ -// wherestr += " and process_section_id = '"+pSectionId+"' "; -// } -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// wherestr += " and text like '%"+request.getParameter("search_name")+"%' "; -// } -// PageHelper.startPage(page, rows); -// List list = this.kPIPointProfessorService.getListByWhere(wherestr+orderstr); -//// List lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); -//// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); -// for (int i=0; i < list.size(); i++) { -// ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcessSectionId()); -// if (processSection != null) { -// list.get(i).setProcessSectionName(processSection.getName()); -// } -// } -// -// PageInfo pi = new PageInfo(list); -// JSONArray json=JSONArray.fromObject(list); -// -// String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -//// System.out.println(result); -// model.addAttribute("result",result); -// return new ModelAndView("result"); -// } -// -// -// -// @RequestMapping("/add.do") -// public String doadd(HttpServletRequest request,Model model){ -// return "work/KPIPointProfessorAdd"; -// } -// @RequestMapping("/edit.do") -// public String doedit(HttpServletRequest request,Model model){ -// String userId = request.getParameter("id"); -// KPIPointProfessor kPIPointProfessor = this.kPIPointProfessorService.selectById(userId); -// model.addAttribute("kPIPointProfessor", kPIPointProfessor); -// return "work/KPIPointProfessorEdit"; -// } -// -// @RequestMapping("/view.do") -// public String doview(HttpServletRequest request,Model model){ -// String companyId = request.getParameter("companyId"); -// String mpid = request.getParameter("mpid"); -// List list = this.kPIPointProfessorService.getListByWhere(" where mpid='"+mpid+"'"); -// JSONArray json = new JSONArray(); -// model.addAttribute("list", list); -// if(list !=null){ -// for(int i=0;i kPIPointProfessorParam = this.kPIPointProfessorParamService.selectListByWhere(" where pid='"+list.get(i).getAid()+"'"); -// if(kPIPointProfessorParam!=null){ -// for(int j=0;j mp = this.mPointService.selectListByWhere(companyId, " where MPointCode='"+kPIPointProfessorParam.get(j).getMpcode()+"'"); -// if(mp!=null){ -// kPIPointProfessorParam.get(j).setMpoint(mp.get(0)); -// } -// } -// } -// JSONArray jsonarr=JSONArray.fromObject(kPIPointProfessorParam); -// JSONObject jsonobj = new JSONObject(); -// jsonobj.put("index", i); -// jsonobj.put("companyId", list.get(i).getBizId()); -// jsonobj.put("mpoint", jsonarr); -// json.add(jsonobj); -// } -// } -// model.addAttribute("data",json); -// -// return "work/KPIPointProfessorView"; -// } -// @RequestMapping("/getMpointData.do") -// public ModelAndView getMpointData(HttpServletRequest request,Model model, -// @RequestParam(value = "bizId") String bizId, -// @RequestParam(value = "ids") String ids, -// @RequestParam(value = "sdt") String sdt, -// @RequestParam(value = "edt") String edt) { -// /*List kPIPointProfessorParam = this.kPIPointProfessorParamService.selectListByWhere(" where pid='"+id+"'"); -// JSONArray jsonarr=JSONArray.fromObject(kPIPointProfessorParam); -// model.addAttribute("result",jsonarr.toString());*/ -// return new ModelAndView("result"); -// } -// @RequestMapping("/save.do") -// public String dosave(HttpServletRequest request,Model model, -// @ModelAttribute KPIPointProfessor kPIPointProfessor){ -// User cu= (User)request.getSession().getAttribute("cu"); -// kPIPointProfessor.setId(CommUtil.getUUID()); -// kPIPointProfessor.setInsdt(CommUtil.nowDate()); -// int result = this.kPIPointProfessorService.save(kPIPointProfessor); -// String resstr="{\"res\":\""+result+"\",\"id\":\""+kPIPointProfessor.getId()+"\"}"; -// model.addAttribute("result", resstr); -// return "result"; -// } -// @RequestMapping("/update.do") -// public String doupdate(HttpServletRequest request,Model model, -// @ModelAttribute KPIPointProfessor kPIPointProfessor){ -// User cu= (User)request.getSession().getAttribute("cu"); -// kPIPointProfessor.setInsdt(CommUtil.nowDate()); -// int result = this.kPIPointProfessorService.update(kPIPointProfessor); -// String resstr="{\"res\":\""+result+"\",\"id\":\""+kPIPointProfessor.getId()+"\"}"; -// model.addAttribute("result", resstr); -// return "result"; -// } -// -// @RequestMapping("/delete.do") -// public String dodel(HttpServletRequest request,Model model, -// @RequestParam(value="id") String id){ -// int result = this.kPIPointProfessorService.deleteById(id); -// model.addAttribute("result", result); -// return "result"; -// } -// -// @RequestMapping("/deletes.do") -// public String dodels(HttpServletRequest request,Model model, -// @RequestParam(value="ids") String ids){ -// ids=ids.replace(",","','"); -// int result = this.kPIPointProfessorService.deleteByWhere("where id in ('"+ids+"')"); -// model.addAttribute("result", result); -// return "result"; -// } -// -// @RequestMapping("/showlistForSelect.do") -// public String showlistForSelect(HttpServletRequest request,Model model, -// @RequestParam(value="pid") String pid) { -// request.setAttribute("pid", request.getParameter("pid")); -// return "/work/KPIPointProfessorListForSelect"; -// } -// @RequestMapping("/showlistForSelects.do") -// public String showlistForSelects(HttpServletRequest request,Model model) { -// return "/work/KPIPointListForSelects"; -// } -// /* -// * KPI测量点多维曲线 -// */ -// @RequestMapping("/showchart.do") -// public String showchart(HttpServletRequest request,Model model, -// @RequestParam(value="ids") String ids, -// @RequestParam(value="sdt") String sdt, -// @RequestParam(value="edt") String edt, -// @RequestParam(value="companyId") String companyId) { -// String[] idarr = ids.split(","); -// String namestr=""; -// String unitstr=""; -// String idstr=""; -// JavaScriptUtils javaScriptUtils = new JavaScriptUtils(); -// for(int i=0;i mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - - JSONObject jsonObject=new JSONObject(); - - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' and columnNum='"+column+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i mplist = this.mPointService.selectListByWhere(unitId, "where (id='"+mpid+"' or MPointCode='"+mpid+"')"); - - JSONArray jsondata=new JSONArray(); - - if(mplist!=null&&mplist.size()>0){ - if(mplist.get(0).getParmvalue()!=null){ - jsondata.add(mplist.get(0).getParmvalue()); - jsondata.add(mplist.get(0).getMpointcode()); - } - if(mplist.get(0).getUnit()!=null){ - unit="("+mplist.get(0).getUnit()+")"; - } - } - - jsonObject.put(mpname+unit+":", jsondata); - - } - } - - - } - - JSONArray json=JSONArray.fromObject(jsonObject); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - //昨日处理量 - @RequestMapping("/getZRCLL.do") - public ModelAndView getZRCLL(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String wherestr=" where 1=1 and name='昨日处理量' "; - String orderstr=" order by morder "; - List mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - - BigDecimal pv=null; - - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>0){ - String mpid=dlist.get(0).getMpid(); - - List mplist = this.mPointService.selectListByWhere(unitId, "where (id='"+mpid+"' or MPointCode='"+mpid+"')"); - - JSONArray jsondata=new JSONArray(); - - if(mplist!=null&&mplist.size()>0){ - if(mplist.get(0).getParmvalue()!=null){ - BigDecimal bignum = new BigDecimal("10000"); - pv=mplist.get(0).getParmvalue().divide(bignum).setScale(1, BigDecimal.ROUND_HALF_UP); - } - } - - } - - - } - - model.addAttribute("result",pv); - return new ModelAndView("result"); - } - - //达标率 - @RequestMapping("/getcomplianceRate.do") - public ModelAndView getcomplianceRate(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String type=request.getParameter("type"); - - String wherestr=" where 1=1 and name='"+type+"' "; - String orderstr=" order by morder "; - List mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - - BigDecimal pv=new BigDecimal("0"); - - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>1){ - String mpid1=dlist.get(0).getMpid();//实际值 - String mpid2=dlist.get(1).getMpid();//目标值 - - List mplist1 = this.mPointService.selectListByWhere(unitId, "where (id='"+mpid1+"' or MPointCode='"+mpid1+"')"); - List mplist2 = this.mPointService.selectListByWhere(unitId, "where (id='"+mpid2+"' or MPointCode='"+mpid2+"')"); - - BigDecimal sjpv=null; - BigDecimal mbpv=null; - if(mplist1!=null&&mplist1.size()>0){ - if(mplist1.get(0).getParmvalue()!=null){ - sjpv=mplist1.get(0).getParmvalue(); - } - } - if(mplist2!=null&&mplist2.size()>0){ - if(mplist2.get(0).getParmvalue()!=null){ - mbpv=mplist2.get(0).getParmvalue(); - } - } - if(mbpv.doubleValue()>0){ - BigDecimal bignum = new BigDecimal(mbpv.doubleValue()); - pv=sjpv.divide(bignum,2); - BigDecimal bignum2 = new BigDecimal(100); - pv=pv.multiply(bignum2).setScale(1, BigDecimal.ROUND_HALF_UP); - } - - } - - } - - model.addAttribute("result",pv); - return new ModelAndView("result"); - } - - //折线图 - @RequestMapping("/getLineData.do") - public ModelAndView getLineData(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String type=request.getParameter("type"); - - String nowdate=CommUtil.nowDate(); - String sdt=CommUtil.subplus(nowdate, "-8", "day"); - String edt=CommUtil.subplus(nowdate, "-1", "day"); - - String wherestr=" where 1=1 and name='"+type+"' "; - String orderstr=" order by morder "; - List mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - -// JSONObject jsonObject=new JSONObject(); - JSONArray mainjsondata=new JSONArray(); - - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i mplist = this.mPointHistoryService.selectListByTableAWhere(unitId,"tb_mp_"+mpid," where Measuredt between '"+sdt+"' and '"+edt+"' order by Measuredt "); - - JSONArray jsondata=new JSONArray(); - - if(mplist!=null&&mplist.size()>0){ - for(int j=0;j mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - -// JSONObject jsonObject=new JSONObject(); - JSONArray mainjsondata=new JSONArray(); - - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i mplist = this.mPointHistoryService.selectListByTableAWhere(unitId,"tb_mp_"+mpid," where Measuredt between '"+sdt+"' and '"+edt+"' order by Measuredt "); - - JSONArray jsondata=new JSONArray(); - - if(mplist!=null&&mplist.size()>0){ - for(int j=0;j list = this.lagerScreenDataService.selectListByWhere(" where 1=1 "); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarm.do") - public ModelAndView getAlarm(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String unitIds=""; - if(unitId!=null && !unitId.isEmpty()){ - unitIds=unitService.getUnitChildrenById2(unitId).replace(",","','"); - } -// List list = this.proAlarmService.selectTop5ListByWhere(" where 1=1 and unitId in ('"+unitIds+"') "+" order by alarmtime desc"); -// List list = this.scadaAppAlarmService.selectTopNumListByTableAWhere(""," top 5 ", " order by alarmtime desc "); - -// JSONArray json=JSONArray.fromObject(list); -// model.addAttribute("result",json); - return new ModelAndView("result"); - } - - @RequestMapping("/getOnlineWater.do") - public ModelAndView getOnlineWater(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String wherestr=" where 1=1 and name='在线水质' "; - String orderstr=" order by morder "; - List mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - - JSONArray jsondata=new JSONArray(); - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i mplist = this.mPointService.selectListByWhere(unitId, "where (id='"+mpid+"' or MPointCode='"+mpid+"')"); -// if(mplist!=null&&mplist.size()>0){ -// if(mplist.get(0).getParmvalue()!=null){ -// jsondata.add(mplist.get(0).getParmvalue()); -// } -// } - - jsonObject.put("name", mpname); - if(mplist!=null&&mplist.size()>0){ - String numTail=mplist.get(0).getNumtail(); - DecimalFormat df = new DecimalFormat("###,##0"+numTail.substring(1, numTail.length())); - - jsonObject.put("data", df.format(mplist.get(0).getParmvalue())); - } - jsondata.add(jsonObject); - } - } - - } - - JSONArray json=JSONArray.fromObject(jsondata); - model.addAttribute("result",json); - - return new ModelAndView("result"); - } - - @RequestMapping("/getNowWater.do") - public ModelAndView getNowWater(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String wherestr=" where 1=1 and name='水量数据' "; - String orderstr=" order by morder "; - List mainlist = this.lagerScreenConfigureService.selectListByWhere(wherestr+orderstr); - - JSONArray jsondata=new JSONArray(); - if(mainlist!=null&&mainlist.size()>0){ - String mainid=mainlist.get(0).getId(); - String dwherestr=" where 1=1 and pid='"+mainid+"' "; - String dorderstr=" order by morder "; - List dlist = this.lagerScreenConfigureDetailService.selectListByWhere(dwherestr+dorderstr); - - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i mplist = this.mPointService.selectListByWhere(unitId, "where (id='"+mpid+"' or MPointCode='"+mpid+"')"); -// if(mplist!=null&&mplist.size()>0){ -// if(mplist.get(0).getParmvalue()!=null){ -// jsondata.add(mplist.get(0).getParmvalue()); -// } -// } - - jsonObject.put("name", mpname); - if(mplist!=null&&mplist.size()>0){ - String numTail=mplist.get(0).getNumtail(); - DecimalFormat df = new DecimalFormat("###,##0"+numTail.substring(1, numTail.length())); - - jsonObject.put("data", df.format(mplist.get(0).getParmvalue())); - } - jsondata.add(jsonObject); - } - } - - } - - JSONArray json=JSONArray.fromObject(jsondata); - model.addAttribute("result",json); - - return new ModelAndView("result"); - } - - -} \ No newline at end of file diff --git a/src/com/sipai/controller/work/MPointController.java b/src/com/sipai/controller/work/MPointController.java deleted file mode 100644 index fb35057a..00000000 --- a/src/com/sipai/controller/work/MPointController.java +++ /dev/null @@ -1,5021 +0,0 @@ -package com.sipai.controller.work; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.CurveRemark; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.equipment.*; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.scada.*; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.user.*; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.VisualCacheData; -import com.sipai.entity.work.MeasurePoint_DATA; -import com.sipai.entity.work.OverviewProduce; -import com.sipai.entity.work.OverviewProduceBlot; -import com.sipai.service.company.CompanyService; -import com.sipai.service.data.CurveMpointService; -import com.sipai.service.data.CurveRemarkService; -import com.sipai.service.data.DataCurveService; -import com.sipai.service.data.XServerService; -import com.sipai.service.equipment.*; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.scada.MPointExpandService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointPropService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.sparepart.GoodsClassService; -import com.sipai.service.sparepart.PurchaseRecordService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.visual.GetValueService; -import com.sipai.service.visual.JspElementService; -import com.sipai.service.visual.VisualJspService; -import com.sipai.service.work.MeasurePoint_DATAService; -import com.sipai.service.work.ModbusFigService; -import com.sipai.service.work.ModbusRecordService; -import com.sipai.tools.ArchivesLog; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DataSources; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.search.sort.SortOrder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -@Controller -@RequestMapping("/work/mpoint") -public class MPointController { - @Resource - private MPointService mPointService; - @Resource - private MPointPropService mPointPropService; - @Resource - private ModbusFigService modbusFigService; - @Resource - private ModbusRecordService modbusRecordService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EquipmentPointService equipmentPointService; - @Resource - private EquipmentCardService equipmentcardService; - @Resource - private ExtSystemService extSystemService; - @Resource - private UnitService unitService; - @Resource - private EquipmentClassService equipmentClassService; - // @Resource -// private MPointPropServiceImpl mPointPropService; - @Resource - private CurveMpointService curveMpointService; - @Resource - private CurveRemarkService curveRemarkService; - @Resource - private DataCurveService dataCurveService; - @Resource - private HomePageService homePageService; - @Resource - private EquipmentLevelService equipmentLevelService; - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private SubscribeService subscribeService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private StockService stockService; - @Resource - private GoodsClassService goodsClassService; - @Resource - private MeasurePoint_DATAService measurePoint_DATAService; - @Resource - private GetValueService getValueService; - @Resource - private VisualJspService visualJspService; - @Resource - private JspElementService jspElementService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private XServerService xServerService; - @Resource - private MPointExpandService mPointExpandService; - @Autowired - private CompanyService companyService; - @Resource - private UserService userService; - - /** - * 从数据库查数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/mPointList"; - } - - - /** - * 从数据库查KPI数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showlistKPI.do") - public String showlistKPI(HttpServletRequest request, Model model) { - return "/work/mPointListKPI"; - } - - /** - * 从es查数据 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showlistES.do") - public String showlistES(HttpServletRequest request, Model model) { - return "/work/mPointListES"; - } - - @RequestMapping("/showKPIList.do") - public String showKPIList(HttpServletRequest request, Model model) { - return "/work/kPointList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pSectionId = request.getParameter("pSectionId"); - String modbusfigidSelect = request.getParameter("modbusfigidSelect"); - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String type = request.getParameter("type"); - String existenceIds = request.getParameter("existenceIds");//已存在ids 已选择的不在列表中存在 - String companyids = ""; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - } - } - if (sort == null) { - sort = " MPointCode "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (parmname like '%" + request.getParameter("search_name") + "%' or mpointcode like '%" + request.getParameter("search_name") + "%')"; - } - if (request.getParameter("active") != null && !request.getParameter("active").isEmpty()) { - wherestr += " and active='" + request.getParameter("active") + "' "; - } - /*if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processSectionCode like '%"+request.getParameter("pSectionId")+"%' "; - }*/ - if (request.getParameter("search_mpointcode") != null && !request.getParameter("search_mpointcode").isEmpty()) { - wherestr += " and mpointcode like '%" + request.getParameter("search_mpointcode") + "%' "; - } - if (request.getParameter("search_mpointid") != null && !request.getParameter("search_mpointid").isEmpty()) { - wherestr += " and id like '%" + request.getParameter("search_mpointid") + "%'"; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and parmname like '%" + request.getParameter("search_dept") + "%'"; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - wherestr += " and id in ('" + request.getParameter("checkedIds").replace(",", "','") + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and equipmentId = '" + request.getParameter("pid") + "'"; - } - //设备台账那边可以挂id也可以挂设备编号 - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and (equipmentId = '" + request.getParameter("equipmentId") + "' or equipmentId = '" + request.getParameter("equipmentcardId") + "')"; - } - if (modbusfigidSelect != null && !modbusfigidSelect.isEmpty()) { - wherestr += " and modbusfigid = '" + modbusfigidSelect + "' "; - } - if (request.getParameter("signaltype") != null && !request.getParameter("signaltype").isEmpty()) { - wherestr += " and SignalType ='" + request.getParameter("signaltype") + "' "; - } - if (request.getParameter("signalType") != null && !request.getParameter("signalType").isEmpty()) { - if (!request.getParameter("signalType").equals("-1")) {//-1为全部 - wherestr += " and SignalType ='" + request.getParameter("signalType") + "' "; - } - } - if (request.getParameter("structureId") != null && !request.getParameter("structureId").isEmpty()) { - if (!request.getParameter("structureId").equals("-1")) {//-1为全部 - wherestr += " and structureId ='" + request.getParameter("structureId") + "' "; - } - } - if (request.getParameter("equipid") != null && !request.getParameter("equipid").isEmpty()) { - wherestr += " and equipid ='" + request.getParameter("equipid") + "' "; - } - if (request.getParameter("onlyequipid") != null && !request.getParameter("onlyequipid").isEmpty()) { - wherestr += " and equipid ='" + request.getParameter("onlyequipid") + "' "; - } - if (type != null && !"".equals(type) && !"all".equals(type)) { - wherestr += " and source_type = '" + type + "'"; - } - if (existenceIds != null && !existenceIds.trim().equals("")) { - wherestr += " and id not in (" + existenceIds + ")"; - } - - PageHelper.startPage(page, rows); - List list = this.mPointService.selectListByWhere(companyId, wherestr + orderstr); -// for (MPoint mPoint : list) { -// mPoint.setCompany(this.unitService.getCompById(mPoint.getBizid())); -// } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistKPI.do") - public ModelAndView getlistKPI(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pSectionId = request.getParameter("pSectionId"); - String modbusfigidSelect = request.getParameter("modbusfigidSelect"); - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String type = request.getParameter("type"); - String existenceIds = request.getParameter("existenceIds");//已存在ids 已选择的不在列表中存在 - String companyids = ""; - if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - } - } - if (sort == null) { - sort = " MPointCode "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (parmname like '%" + request.getParameter("search_name") + "%' or mpointcode like '%" + request.getParameter("search_name") + "%')"; - } - if (request.getParameter("active") != null && !request.getParameter("active").isEmpty()) { - wherestr += " and active='" + request.getParameter("active") + "' "; - } - /*if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processSectionCode like '%"+request.getParameter("pSectionId")+"%' "; - }*/ - if (request.getParameter("search_mpointcode") != null && !request.getParameter("search_mpointcode").isEmpty()) { - wherestr += " and mpointcode like '%" + request.getParameter("search_mpointcode") + "%' "; - } - if (request.getParameter("search_mpointid") != null && !request.getParameter("search_mpointid").isEmpty()) { - wherestr += " and id like '%" + request.getParameter("search_mpointid") + "%'"; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and parmname like '%" + request.getParameter("search_dept") + "%'"; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - wherestr += " and id in ('" + request.getParameter("checkedIds").replace(",", "','") + "')"; - } - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and equipmentId = '" + request.getParameter("pid") + "'"; - } - //设备台账那边可以挂id也可以挂设备编号 - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and (equipmentId = '" + request.getParameter("equipmentId") + "' or equipmentId = '" + request.getParameter("equipmentcardId") + "')"; - } - if (modbusfigidSelect != null && !modbusfigidSelect.isEmpty()) { - wherestr += " and modbusfigid = '" + modbusfigidSelect + "' "; - } - if (request.getParameter("signaltype") != null && !request.getParameter("signaltype").isEmpty()) { - wherestr += " and SignalType ='" + request.getParameter("signaltype") + "' "; - } - if (request.getParameter("signalType") != null && !request.getParameter("signalType").isEmpty()) { - if (!request.getParameter("signalType").equals("-1")) {//-1为全部 - wherestr += " and SignalType ='" + request.getParameter("signalType") + "' "; - } - } - if (request.getParameter("structureId") != null && !request.getParameter("structureId").isEmpty()) { - if (!request.getParameter("structureId").equals("-1")) {//-1为全部 - wherestr += " and structureId ='" + request.getParameter("structureId") + "' "; - } - } - if (request.getParameter("equipid") != null && !request.getParameter("equipid").isEmpty()) { - wherestr += " and equipid ='" + request.getParameter("equipid") + "' "; - } - if (request.getParameter("onlyequipid") != null && !request.getParameter("onlyequipid").isEmpty()) { - wherestr += " and equipid ='" + request.getParameter("onlyequipid") + "' "; - } - if (type != null && !"".equals(type) && !"all".equals(type)) { - wherestr += " and source_type = '" + type + "'"; - } - if (existenceIds != null && !existenceIds.trim().equals("")) { - wherestr += " and id not in (" + existenceIds + ")"; - } - - PageHelper.startPage(page, rows); - List list = this.mPointService.selectListByWhereForKPI(companyId, wherestr + orderstr); -// for (MPoint mPoint : list) { -// mPoint.setCompany(this.unitService.getCompById(mPoint.getBizid())); -// } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistES.do") - public ModelAndView getlistES(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String companyId = request.getParameter("companyId"); - sort = "morder"; - SortOrder sortOrder = null; -// if (order == null || order == "asc") { -// sortOrder = SortOrder.ASC; -// } else { -// sortOrder = SortOrder.DESC; -// } - sortOrder = SortOrder.ASC; - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - - BoolQueryBuilder childBoolQueryBuilder = QueryBuilders.boolQuery(); - String searchName = request.getParameter("search_name"); - String searchCode = request.getParameter("search_code"); - String pSectionId = request.getParameter("pSectionId"); - String type = request.getParameter("type"); - String signaltype = request.getParameter("signaltype"); - - if (searchName != null && !searchName.isEmpty()) { - childBoolQueryBuilder.must(QueryBuilders.wildcardQuery("parmname.keyword", "*" + searchName + "*")); - } - if (searchCode != null && !searchCode.isEmpty()) { - childBoolQueryBuilder.must(QueryBuilders.wildcardQuery("mpointcode.keyword", "*" + searchCode + "*")); -// childBoolQueryBuilder.must(QueryBuilders.matchPhrasePrefixQuery("mpointcode", searchCode)); - } - if (type != null && !type.isEmpty() && !type.equals("all")) { - childBoolQueryBuilder.must(QueryBuilders.matchPhraseQuery("source_type", type)); - } - if (pSectionId != null && !pSectionId.isEmpty() && !pSectionId.equals("")) { - childBoolQueryBuilder.must(QueryBuilders.matchPhraseQuery("processsectioncode", pSectionId)); - } - if (signaltype != null && !signaltype.isEmpty() && !signaltype.equals("-1") && !signaltype.equals("") && !signaltype.equals("all")) { - childBoolQueryBuilder.must(QueryBuilders.matchPhraseQuery("signaltype", signaltype)); - } - - //设备id - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - childBoolQueryBuilder.must(QueryBuilders.matchPhraseQuery("equipmentid", request.getParameter("pid"))); - } - - //设备编号 - if (request.getParameter("equipmentcardId") != null && !request.getParameter("equipmentcardId").isEmpty()) { - EquipmentCard equipmentCard = equipmentCardService.getEquipmentByEquipmentCardId(request.getParameter("equipmentcardId")); - if (equipmentCard != null) { - childBoolQueryBuilder.must(QueryBuilders.matchPhraseQuery("equipmentid", equipmentCard.getId())); - } - } - -// if (request.getParameter("signaltag") != null && !request.getParameter("signaltag").isEmpty()) { -// String signalTag = request.getParameter("signaltag").replace(",", " "); -// childBoolQueryBuilder.must(QueryBuilders.matchQuery("signaltag", signalTag)); -// } - -// childBoolQueryBuilder.must(QueryBuilders.matchQuery("bizid", companyId)); - - String unitId = request.getParameter("unitId"); - - if (unitId != null && !unitId.isEmpty()) { - List units = this.unitService.getChildrenCBWByUnitId(unitId); - Unit unit = this.unitService.getUnitById(unitId); - if (unit != null) { - units.add(unit); - } - //二次查询 - - String bizids = ""; - - //根据搜索关键字如果存在对应组织id,并且在搜索的bizid范围内,则将关键字搜索优先搜索 - if (searchName != null && !searchName.isEmpty()) { - int lastMatchNum = 1; - String keyword = ""; - char[] sNchars = searchName.toCharArray(); -// logger.info("units--"+JSONArray.fromObject(units).toString()); - for (int u = 0; u < units.size(); u++) { - int matchNum = 0; - for (char item : sNchars) { - if (units.get(u).getSname().contains(String.valueOf(item))) { - matchNum++; - } - } -// logger.info("unit-match--"+u+"--"+matchNum); - if (matchNum > lastMatchNum) { - keyword = units.get(u).getId(); - } - - } - if (!keyword.isEmpty()) { - units = this.getParent(keyword, units); - //关键字提前,优先搜索 - bizids = keyword; - } -// logger.info("units---match--"+JSONArray.fromObject(units).toString()); - } - for (int u = 0; u < units.size(); u++) { -// if(!CommString.UNIT_TYPE_DEPT.equals(units.get(u).getType()) && !CommString.UNIT_TYPE_USER.equals(units.get(u).getType()) ){ - if (!bizids.isEmpty()) { - bizids += " "; - } - bizids += units.get(u).getId(); -// } - } -// System.out.println("测量点搜索查询bizId--" + bizids); - childBoolQueryBuilder.must(QueryBuilders.matchQuery("bizid", bizids)); - } - - -// System.out.println("---查询条件--" + childBoolQueryBuilder.toString()); - boolQueryBuilder.should(childBoolQueryBuilder); - nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort(sort).order(sortOrder)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - -// Page list= this.mPointService.selectListByES(nativeSearchQueryBuilder); - -// int total = list.size(); - nativeSearchQueryBuilder.withPageable(PageRequest.of(page - 1, rows)); - Page list = this.mPointService.selectListByES(nativeSearchQueryBuilder); - - - /*for (MPoint mp : list) { - Unit unit = this.unitService.getUnitById(mp.getBizid()); - if (unit != null) { - String unitName = unit.getSname(); - if (unitName == null || unitName.isEmpty()) { - unitName = unit.getName(); - } - mp.setBizname(unitName); - } - }*/ - - //查询工艺段 - for (MPoint mp : list) { - List processSections = processSectionService.selectSimpleListByWhere("where code = '" + mp.getProcesssectioncode() + "'"); - if (processSections != null && processSections.size() > 0) { - mp.setProcessSection(processSections.get(0)); - } - } - - JSONArray json = JSONArray.fromObject(list.getContent()); - - - String result = "{\"total\":" + list.getTotalElements() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getKPIList.do") - public ModelAndView getKPIList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String companyId = request.getParameter("companyId"); - if (sort == null) { - sort = " MPointCode "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and parmname like '%" + request.getParameter("search_name") + "%' "; - } - /*if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and processSectionCode like '%"+request.getParameter("pSectionId")+"%' "; - }*/ - if (request.getParameter("search_mpointcode") != null && !request.getParameter("search_mpointcode").isEmpty()) { - wherestr += " and mpointcode like '%" + request.getParameter("search_mpointcode") + "%' "; - } - if (request.getParameter("search_mpointid") != null && !request.getParameter("search_mpointid").isEmpty()) { - wherestr += " and id like '%" + request.getParameter("search_mpointid") + "%'"; - } - if (request.getParameter("search_dept") != null && !request.getParameter("search_dept").isEmpty()) { - wherestr += " and parmname like '%" + request.getParameter("search_dept") + "%'"; - } - if (request.getParameter("checkedIds") != null && !request.getParameter("checkedIds").isEmpty()) { - wherestr += " and id like '%" + request.getParameter("checkedIds") + "%'"; - } - - wherestr = ""; - - PageHelper.startPage(page, rows); - List list = this.mPointService.selectListByWhere(companyId, wherestr + orderstr); -// List lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); -// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getCurvelist.do") - public ModelAndView getCurvelist(HttpServletRequest request, Model model) { - String pSectionId = request.getParameter("pSectionId"); - User cu = (User) request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } -// String companyId = request.getParameter("companyId"); - String companyids2 = unitService.getUnitChildrenById2(request.getParameter("companyId")); - String companyids = ""; - -// List xlist = this.xServerService.selectListByWhere(" where (status='启用' or status is null) order by name"); - DataSources[] pzBizids = DataSources.values(); - if (pzBizids != null && pzBizids.length > 0) { - for (int i = 0; i < pzBizids.length; i++) { - String dataSources = pzBizids[i].toString().replace("SCADA_", ""); - if (!dataSources.equals("MASTER") && companyids2.contains(dataSources)) { - companyids += dataSources + ","; - } - - } - } - - String orderstr = " order by MPointCode"; - - String wherestr = " where 1=1 and active='启用' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (parmname like '%" + request.getParameter("search_name") + "%' or mpointcode like '%" + request.getParameter("search_name") + "%')"; - } - if (request.getParameter("active") != null && !request.getParameter("active").isEmpty()) { - wherestr += " and active='" + request.getParameter("active") + "' "; - } - if (pSectionId != null && !pSectionId.isEmpty()) { - wherestr += " and processSectionCode = '" + pSectionId + "' "; - } - if (request.getParameter("signalType") != null && !request.getParameter("signalType").isEmpty()) { - if (!request.getParameter("signalType").equals("-1")) {//-1为全部 - wherestr += " and SignalType ='" + request.getParameter("signalType") + "' "; - } - } - if (request.getParameter("sourceType") != null && !request.getParameter("sourceType").isEmpty()) { - if (!request.getParameter("sourceType").equals("-1")) {//-1为全部 - wherestr += " and source_type ='" + request.getParameter("sourceType") + "' "; - } - } - - JSONArray arr = new JSONArray(); -// long total =0; - - String[] companyidsList = companyids.split(","); - - for (int i = 0; i < companyidsList.length; i++) { -// PageHelper.startPage(page, rows); - List list = this.mPointService.selectListByWhere(companyidsList[i], wherestr + orderstr); - if (list != null && list.size() > 0) { - for (int j = 0; j < list.size(); j++) { - JSONObject obj = new JSONObject(); - obj.put("id", list.get(j).getId()); - obj.put("mpointcode", list.get(j).getMpointcode()); - obj.put("parmname", list.get(j).getParmname()); - Company company = this.unitService.getCompById(companyidsList[i]); - obj.put("bizid", company.getId()); - obj.put("bizname", company.getSname()); - arr.add(obj); - } - } -// PageInfo pi = new PageInfo(list); -// total=pi.getTotal(); - } - - String result = "{\"rows\":" + arr + "}"; -// System.out.println(result); - model.addAttribute("result", arr); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarmMPointList.do") - public ModelAndView getAlarmMPointList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pSectionId = request.getParameter("pSectionId"); -// User cu=(User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - if (sort == null) { - sort = " MPointCode "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and (parmname like '%" + request.getParameter("search_name") + "%' or mpointcode like '%" + request.getParameter("search_name") + "%')"; - } - if (pSectionId != null && !pSectionId.isEmpty()) { - wherestr += " and processSectionCode = '" + pSectionId + "' "; - } - if (request.getParameter("signalType") != null && !request.getParameter("signalType").isEmpty()) { - if (!request.getParameter("signalType").equals("-1")) {//-1为全部 - wherestr += " and SignalType ='" + request.getParameter("signalType") + "' "; - } - } - if (request.getParameter("triggerAlarm") != null && !request.getParameter("triggerAlarm").isEmpty()) { - if (!request.getParameter("triggerAlarm").equals("-1")) {//-1为全部 - wherestr += " and TriggerAlarm ='" + request.getParameter("triggerAlarm") + "' "; - } - } - PageHelper.startPage(page, rows); - List list = this.mPointService.selectListByWhere(companyId, wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getAllMPoints.do") - public ModelAndView getAllMPoints(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - String pSectionId = request.getParameter("pSectionId"); - String url = ""; - ExtSystem extSystem = this.extSystemService.getActiveDataManage(null); - if (extSystem != null) { - url = extSystem.getUrl(); - } - url += "/proapp.do?method=getAllMeasurePoints"; - Map map = new HashMap(); - map.put("bizid", companyId); - map.put("page", page.toString()); - map.put("rows", rows.toString()); - map.put("paramName", request.getParameter("search_name")); - map.put("psectionid", request.getParameter("pSectionId")); - String resp = com.sipai.tools.HttpUtil.sendPost(url, map); - JSONObject jsonObject = JSONObject.fromObject(resp); - try { - JSONObject re1 = jsonObject.getJSONObject("re1"); - String result = "{\"total\":" + re1.get("total") + ",\"rows\":" + re1.getJSONArray("rows") + "}"; -// System.out.println(result); - model.addAttribute("result", result); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/showHistory.do") - public String showHistory(HttpServletRequest request, Model model) { - String idString = request.getParameter("id"); - idString = CommUtil.string2Json(idString); - request.setAttribute("id", idString); - return "/work/mpointHistory"; - } - - /** - * 获取测量点历史曲线数据 - */ - @RequestMapping("/getHistory.do") - public ModelAndView getHistory(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - try { - JSONArray jsonarr = new JSONArray(); - String[] idarr = ids.split(","); - for (int j = 0; j < idarr.length; j++) { - //DataSourceHolder.setDataSources(DataSources.SCADA); - List list = mPointHistoryService.selectListByTableAWhere(bizId, "[TB_MP_" + idarr[j] + "]", " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' order by MeasureDT"); - //DataSourceHolder.setDataSources(DataSources.MASTER); - JSONArray json = new JSONArray(); - if (list.size() > 0) { - int timeInterval = Integer.valueOf(request.getParameter("timeInterval") == null ? "0" : request.getParameter("timeInterval")); - //若存在时间间隔,则整理时间 - if (timeInterval > 0) { - try { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar calendar = Calendar.getInstance(); - - double sum_value = 0.0; - int num = 0; - Date fixDate = new Date(); - for (int i = 0; i < list.size(); i++) { - if (num == 0) { - String measuredt = list.get(i).getMeasuredt(); - calendar.setTime(sdf.parse(measuredt)); - calendar.add(Calendar.HOUR, 1); - fixDate = calendar.getTime();//获取一年前的时间,或者一个月前的时间   - } - String measuredt = list.get(i).getMeasuredt(); - calendar.setTime(sdf.parse(measuredt)); - calendar.add(Calendar.MINUTE, timeInterval); - Date nowDate = calendar.getTime();//获取一年前的时间,或者一个月前的时间   - - double parmvalue = list.get(i).getParmvalue().doubleValue(); - sum_value += parmvalue; - num++; - if (num > 0 && fixDate.getTime() < nowDate.getTime()) { - JSONObject jsonObject_result = new JSONObject(); - jsonObject_result.put("measuredt", measuredt); - jsonObject_result.put("parmvalue", sum_value / num); - json.add(jsonObject_result); - sum_value = 0.0; - num = 0; - } - } - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - } else { - json = JSONArray.fromObject(list); - } - - } - - jsonarr.add(json); - } - - - model.addAttribute("result", jsonarr.toString()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("result"); - } - - /** - * 获取测量点历史表格数据 - */ - @RequestMapping("/getHistoryList.do") - public ModelAndView getHistoryList(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - try { - String[] idArr = ids.split(","); - long total = 0; - JSONArray arr = new JSONArray(); - if (idArr != null) { - for (int i = 0; i < idArr.length; i++) { - PageHelper.startPage(page, rows); - List list = mPointHistoryService.selectListByTableAWhere(bizId, "[TB_MP_" + idArr[i] + "]", " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' order by measuredt"); - PageInfo pi = new PageInfo(list); - total = pi.getTotal(); - JSONArray json = JSONArray.fromObject(list); - arr.add(json); - } - } - int length = arr.getJSONArray(0).size(); - JSONArray jsonarr = new JSONArray(); - for (int j = 0; j < length; j++) { - JSONObject obj = new JSONObject(); - obj.put("measuredt", arr.getJSONArray(0).getJSONObject(j).get("measuredt").toString().substring(0, 16)); - - - for (int i = 0; i < arr.size(); i++) { - - obj.put("paramvalue" + i, arr.getJSONArray(i).getJSONObject(j).get("parmvalue")); - //jsonobj.put("paramname","name"+i); - - } - jsonarr.add(obj); - - } - String result = "{\"total\":" + total + ",\"rows\":" + jsonarr + "}"; - model.addAttribute("result", result); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("result"); - } - - /** - * 获取测量点历史表格数据 - */ - @RequestMapping("/getDiffUnitHistoryList.do") - public ModelAndView getDiffUnitHistoryList(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - try { - String[] idArr = ids.split(","); - long total = 0; - JSONArray arr = new JSONArray(); - if (idArr != null) { - for (int i = 0; i < idArr.length; i++) { - String[] mpidAndUnit = idArr[i].split(":"); - if (mpidAndUnit != null) { - List programmeroglist = this.dataCurveService.selectListByWhere(" where id='" + mpidAndUnit[0] + "' "); - if (programmeroglist != null && programmeroglist.size() > 0) { - List programmerogDlist = this.curveMpointService.selectListWithNameByWhere(" where 1=1 and data_curve_id='" + mpidAndUnit[0] + "' " + " order by morder"); - if (programmerogDlist != null && programmerogDlist.size() > 0) { - for (int m = 0; m < programmerogDlist.size(); m++) { - List mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='" + programmerogDlist.get(m).getMpointId() + "' or MPointCode='" + programmerogDlist.get(m).getMpointId() + "')"); - PageHelper.startPage(page, rows); - List list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' order by measuredt"); - PageInfo pi = new PageInfo(list); - total = pi.getTotal(); - JSONArray json = JSONArray.fromObject(list); - arr.add(json); - } - } - } else { - List mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='" + mpidAndUnit[0] + "' or MPointCode='" + mpidAndUnit[0] + "')"); - PageHelper.startPage(page, rows); - List list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' order by measuredt"); - PageInfo pi = new PageInfo(list); - total = pi.getTotal(); - JSONArray json = JSONArray.fromObject(list); - arr.add(json); - } - } - } - } - int length = arr.getJSONArray(0).size(); - JSONArray jsonarr = new JSONArray(); - for (int j = 0; j < length; j++) { - JSONObject obj = new JSONObject(); - obj.put("measuredt", arr.getJSONArray(0).getJSONObject(j).get("measuredt").toString().substring(0, 16)); - - for (int i = 0; i < arr.size(); i++) { - - obj.put("paramvalue" + i, arr.getJSONArray(i).getJSONObject(j).get("parmvalue")); - //jsonobj.put("paramname","name"+i); - - } - jsonarr.add(obj); - - } - String result = "{\"total\":" + total + ",\"rows\":" + jsonarr + "}"; - model.addAttribute("result", result); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("result"); - } - - /** - * 获取测量点历史表格数据 - */ - @RequestMapping("/getDiffUnitHistoryListForReport.do") - public ModelAndView getDiffUnitHistoryListForReport(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "frequencytype") String frequencytype, - @RequestParam(value = "frequency") int frequency, - @RequestParam(value = "calculation") String calculation, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - - try { - String[] idArr = ids.split(","); - long total = 0; - JSONArray arr = new JSONArray(); - - if (idArr != null) { - //判断频率/计算方式 - String otherwhere = ""; - String select = ""; - String tableWhere = ""; - String chooseDataWhere = ""; - - //数据筛选 - String chooseDataString = request.getParameter("chooseDataString"); - if (chooseDataString != null && chooseDataString.length() > 0) { - int chooseDataStringNum = 0; - String[] chooseDataStrings = chooseDataString.split(","); - for (String chooseData : - chooseDataStrings) { - String[] chooseDatas = chooseData.split(":"); - String jstype = chooseDatas[0]; - String jsvalue = chooseDatas[1]; - - if (chooseDataStrings.length == 1) { - chooseDataWhere += " and ParmValue" + jstype + "" + jsvalue + " "; - } else { - if (chooseDataStringNum == 0) { - chooseDataWhere += " and (ParmValue" + jstype + "" + jsvalue + " "; - } else if (chooseDataStringNum == (chooseDataStrings.length - 1)) { - chooseDataWhere += " and ParmValue" + jstype + "" + jsvalue + ") "; - } else { - chooseDataWhere += " and ParmValue" + jstype + "" + jsvalue + " "; - } - } - - chooseDataStringNum++; - } - } -// System.out.println(chooseDataWhere); - - if (frequencytype != null && frequencytype.length() > 0) { - if (frequencytype.equals("0")) {//分钟 - -// int num = frequency / Integer.valueOf(request.getParameter("forwardingFrequency")); -// if (num == 1) { -// otherwhere = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and ItemID%" + num + "=0 "+chooseDataWhere; -// } else { -// otherwhere = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and ItemID%" + num + "=1 "+chooseDataWhere; -// } - } else if (frequencytype.equals("1")) {//小时 - int num = 24 / frequency; - int starnum = 0; - String selectnum = ""; - for (int i = 0; i <= num; i++) { - if (i > 0) { - if (frequency + starnum != 24) { - selectnum += "DATEPART(hour, MeasureDT)=" + (frequency + starnum) + " or "; - starnum += frequency; - } - } else { - selectnum += "DATEPART(hour, MeasureDT)=" + (starnum) + " or "; - } - } - selectnum = "(" + selectnum.substring(0, selectnum.length() - 3) + ")"; - if (calculation.equals("first")) { - tableWhere = "(select *,ROW_NUMBER() over(PARTITION by DATEPART(year, MeasureDT), DATEPART(month, MeasureDT),DATEPART(day, MeasureDT),DATEPART(hour, MeasureDT) order by MeasureDT ) as num from [TB_MP_aaa] " - + " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and (" + selectnum + ") " + chooseDataWhere + ") d "; - } else { - select = " year(MeasureDT) as year, MONTH(MeasureDT) as month, DAY(MeasureDT) as day, DATEPART(hour, MeasureDT) as hour, " + calculation + "(ParmValue) as ParmValue"; - otherwhere = selectnum + chooseDataWhere + " group by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT), DATEPART(hour, MeasureDT) order by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT), DATEPART(hour, MeasureDT)"; - } - } else if (frequencytype.equals("2")) {//天 - String selectnum = getCalculationDayTime(sdt, edt, frequency); - if (selectnum.length() > 3) { - selectnum = "(" + selectnum.substring(0, selectnum.length() - 3) + ")"; - } - if (calculation.equals("first")) { - tableWhere = "(select *,ROW_NUMBER() over(PARTITION by DATEPART(year, MeasureDT), DATEPART(month, MeasureDT),DATEPART(day, MeasureDT) order by MeasureDT ) as num from [TB_MP_aaa] " - + " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and (" + selectnum + ") " + chooseDataWhere + ") d "; - } else { - select = " year(MeasureDT) as year, MONTH(MeasureDT) as month, DAY(MeasureDT) as day, " + calculation + "(ParmValue) as ParmValue"; - otherwhere = selectnum + chooseDataWhere + " group by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT) order by year(MeasureDT), MONTH(MeasureDT), DAY(MeasureDT)"; - } - reportdayselect = ""; - } else if (frequencytype.equals("3")) {//月 - String selectnum = getCalculationMonthTime(sdt, edt, frequency); - if (selectnum.length() > 3) { - selectnum = "(" + selectnum.substring(0, selectnum.length() - 3) + ")"; - } - if (calculation.equals("first")) { - tableWhere = "(select *,ROW_NUMBER() over(PARTITION by DATEPART(year, MeasureDT), DATEPART(month, MeasureDT) order by MeasureDT ) as num from [TB_MP_aaa] " - + " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and (" + selectnum + ") " + chooseDataWhere + ") d "; - } else { - select = " year(MeasureDT) as year, MONTH(MeasureDT) as month, " + calculation + "(ParmValue) as ParmValue"; - otherwhere = selectnum + chooseDataWhere + " group by year(MeasureDT), MONTH(MeasureDT) order by year(MeasureDT), MONTH(MeasureDT)"; - } - reportmonthselect = ""; - } - } - - - for (int i = 0; i < idArr.length; i++) { - String[] mpidAndUnit = idArr[i].split(":"); - if (mpidAndUnit != null) { - List mplistList = mPointService.selectListByWhere(mpidAndUnit[1], "where (id='" + mpidAndUnit[0] + "' or MPointCode='" + mpidAndUnit[0] + "')"); - PageHelper.startPage(page, rows); - List list = new ArrayList<>(); - if (frequencytype.equals("0")) { - list = mPointHistoryService.selectListByTableAWhere(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", otherwhere + " order by MeasureDT"); - } else { - if (!calculation.equals("first")) { - list = mPointHistoryService.selectReportList(mpidAndUnit[1], "[TB_MP_" + mplistList.get(0).getMpointcode() + "]", - " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "' and " + otherwhere, select); - } else { - tableWhere = tableWhere.replace("TB_MP_aaa", "TB_MP_" + mplistList.get(0).getMpointcode()); - list = mPointHistoryService.selectReportList(mpidAndUnit[1], tableWhere, - " where d.num=1 order by MeasureDT", " * "); - tableWhere = tableWhere.replace("TB_MP_" + mplistList.get(0).getMpointcode(), "TB_MP_aaa"); - } - } - PageInfo pi = new PageInfo(list); - total = pi.getTotal(); - JSONArray json = JSONArray.fromObject(list); - arr.add(json); - } - } - } - int length = arr.getJSONArray(0).size(); - JSONArray jsonarr = new JSONArray(); - for (int j = 0; j < length; j++) { - JSONObject obj = new JSONObject(); - String measuredt = ""; - if (!calculation.equals("first") && !frequencytype.equals("0")) { - String year = arr.getJSONArray(0).getJSONObject(j).get("year").toString(); - String month = arr.getJSONArray(0).getJSONObject(j).get("month").toString(); - if (!month.equals("")) { - if (Integer.valueOf(month) < 10) { - month = "0" + month; - } - } - String day = arr.getJSONArray(0).getJSONObject(j).get("day").toString(); - if (!day.equals("")) { - if (Integer.valueOf(day) < 10) { - day = "0" + day; - } - } - String hour = arr.getJSONArray(0).getJSONObject(j).get("hour").toString(); - if (!hour.equals("")) { - if (Integer.valueOf(hour) < 10) { - hour = "0" + hour; - } - } - String min = arr.getJSONArray(0).getJSONObject(j).get("min").toString(); - if (!min.equals("")) { - if (Integer.valueOf(min) < 10) { - min = "0" + min; - } - } - if (frequencytype.equals("0")) {//分钟 - measuredt = year + "-" + month + "-" + day + " " + hour + ":" + min; - } else if (frequencytype.equals("1")) {//小时 - measuredt = year + "-" + month + "-" + day + " " + hour; - } else if (frequencytype.equals("2")) {//天 - measuredt = year + "-" + month + "-" + day; - } else if (frequencytype.equals("3")) {//月 - measuredt = year + "-" + month; - } - obj.put("measuredt", measuredt); - } else { - obj.put("measuredt", arr.getJSONArray(0).getJSONObject(j).get("measuredt").toString().substring(0, 16)); - } - - for (int i = 0; i < arr.size(); i++) { - obj.put("paramvalue" + i, arr.getJSONArray(i).getJSONObject(j).get("parmvalue")); - //jsonobj.put("paramname","name"+i); - } - jsonarr.add(obj); - - } - String result = "{\"total\":" + total + ",\"rows\":" + jsonarr + "}"; - model.addAttribute("result", result); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("result"); - } - - static String reportdayselect = ""; - static String reportmonthselect = ""; - - /** - * 5 - * 按天计算固定频率下是否达到结束时间 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd - * @param frequency 频率数值 - * @return 返回计算后的筛选条件 - */ - public static String getCalculationDayTime(String sd, String ed, int frequency) { - - try { - String calculationTime = CommUtil.subplus(sd, String.valueOf(frequency), "day"); - if (CommUtil.getDays(ed, calculationTime) >= 0) { - reportdayselect += "(year(MeasureDT)='" + (calculationTime.substring(0, 4)) + "' and month(MeasureDT)='" + (calculationTime.substring(5, 7)) + "' and DAY(MeasureDT)='" + (calculationTime.substring(8, 10)) + "') or "; - getCalculationDayTime(calculationTime, ed, frequency); - } - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return reportdayselect; - } - - /** - * 按月计算固定频率下是否达到结束时间 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd - * @param frequency 频率数值 - * @return 返回计算后的筛选条件 - */ - public static String getCalculationMonthTime(String sd, String ed, int frequency) { - - try { - String calculationTime = CommUtil.subplus(sd, String.valueOf(frequency), "month"); - if (CommUtil.getDays(ed, calculationTime) >= 0) { - reportmonthselect += "(year(MeasureDT)='" + (calculationTime.substring(0, 4)) + "' and month(MeasureDT)='" + (calculationTime.substring(5, 7)) + "') or "; - getCalculationMonthTime(calculationTime, ed, frequency); - } - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return reportmonthselect; - } - - /*@RequestMapping("/getHistoryList.do") - public ModelAndView getHistoryList(HttpServletRequest request,Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - - try{ - - List list = mPointHistoryService.selectListByTableAWhere("[TB_MP_"+id+"]"," where MeasureDT >= '"+sdt+"' and MeasureDT<= '"+edt+"'"); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("result"); - } -*/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - return "work/mPointAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) { - Company company = this.unitService.getCompById(bizId); - model.addAttribute("company", company); - //查生产库 - MPoint mPoint = this.mPointService.selectById(bizId, id); - //差es -// MPoint mPoint = this.mPointService.selectById(id); - model.addAttribute("mPoint", mPoint); - List list = new ArrayList(); - - if (mPoint != null && mPoint.getEquipmentid() != null) { - EquipmentCard equipmentCard = this.equipmentcardService.selectById(mPoint.getEquipmentid()); - model.addAttribute("equipmentCard", equipmentCard); - } - - List list_expand = mPointExpandService.selectListByWhere(bizId, "where measure_point_id = '" + id + "'"); - if (list_expand != null && list_expand.size() > 0) { - model.addAttribute("mPointExpand", list_expand.get(0)); - } - - if (request.getParameter("ng") != null) { - String res = "{\"mPoint\":" + JSONObject.fromObject(mPoint) + "}"; - model.addAttribute("result", res); - return "result"; - } - return "work/mPointEdit"; - } - - @RequestMapping("/editModbus.do") - public String editModbus(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) { - MPoint mPoint = this.mPointService.selectById(bizId, id); - model.addAttribute("mPoint", mPoint); - return "work/mPointEditModbus"; - } - - /*@RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - com.alibaba.fastjson.JSONObject fastjson = new com.alibaba.fastjson.JSONObject(); - - String url = "http://" + CommString.NanShiIp + "/SIPAIIS_Model/process/processinterface/getJson.do"; - String sendPost = sendPost(url, fastjson.toJSONString()); - com.alibaba.fastjson.JSONArray jsonArray = com.alibaba.fastjson.JSONArray.parseArray(sendPost.toString()); - - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - com.alibaba.fastjson.JSONObject jsonObject2 = jsonArray.getJSONObject(i); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", jsonObject2.get("id")); - jsonObject.put("text", jsonObject2.get("text")); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - }*/ - - /** - * 向指定 URL 发送POST方法的请求 - * - * @param url 发送请求的 URL - * @param json 请求参数, - * @return 所代表远程资源的响应结果 - */ - public static String sendPost(String url, String json) { - String response = null; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - try { - httpclient = HttpClients.createDefault(); - HttpPost httppost = new HttpPost(url); - StringEntity stringentity = new StringEntity(json, - ContentType.create("application/json", "UTF-8")); - httppost.setEntity(stringentity); - httpresponse = httpclient.execute(httppost); - response = EntityUtils - .toString(httpresponse.getEntity()); - - } finally { - if (httpclient != null) { - httpclient.close(); - } - if (httpresponse != null) { - httpresponse.close(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return response; - } - - @RequestMapping("/formula.do") - public String doFormula(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) { - MPoint mPoint = this.mPointService.selectById(bizId, id); - model.addAttribute("mPoint", mPoint); - List mPointPropL = this.mPointPropService.selectListByWhere(bizId, " where pid='" + id + "' "); - MPointProp mPointProp = new MPointProp(); - if (mPointPropL != null && mPointPropL.size() > 0) { - mPointProp = mPointPropL.get(0); - } - model.addAttribute("mPointProp", mPointProp); - return "work/mPointFormula"; - } - - /** - * 测量点查看界面 - */ - @RequestMapping("/view.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) { - Company company = this.unitService.getCompById(bizId); - model.addAttribute("company", company); - MPoint mPoint = this.mPointService.selectById(bizId, id); - model.addAttribute("mPoint", mPoint); - return "work/mPointView"; - } - - /** - * 测量点查看界面New - */ - @RequestMapping("/viewNew.do") - public String doviewNew(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) { - Company company = this.unitService.getCompById(bizId); - model.addAttribute("company", company); - MPoint mPoint = this.mPointService.selectById(bizId, id); - if (mPoint != null && StringUtils.isNotBlank(mPoint.getProcesssectioncode())) { - mPoint.setProcessSection(processSectionService.selectById(mPoint.getProcesssectioncode())); - } - if (mPoint != null && mPoint.getEquipmentid() != null) { - EquipmentCard equipmentCard = this.equipmentcardService.selectById(mPoint.getEquipmentid()); - model.addAttribute("equipmentCard", equipmentCard); - } - List list_expand = mPointExpandService.selectListByWhere(bizId, "where measure_point_id = '" + id + "'"); - if (list_expand != null && list_expand.size() > 0) { - model.addAttribute("mPointExpand", list_expand.get(0)); - } - model.addAttribute("mPoint", mPoint); - return "work/mPointViewNew"; - } - - @RequestMapping("/save.do") - @ArchivesLog(operteContent = "新增测量点") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute MPoint mPoint) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu == null ? request.getParameter("userId") : cu.getId(); -// if (MPoint.Flag_Type_KPI.equals(mPoint.getSourceType()) || MPoint.Flag_Type_CAL.equals(mPoint.getSourceType())) { -// MPointProp mPointProp = new MPointProp(); -// mPointProp.setId(mPoint.getId()); -// mPointProp.setPid(mPoint.getId()); -// mPointProp.setBizId(mPoint.getBizid()); -// mPointProp.setInsuser(userId); -// mPointProp.setInsdt(CommUtil.nowDate()); -// this.mPointPropService.save(mPoint.getBizid(), mPointProp); -// } - Result result1 = new Result(); - if (mPoint.getBizid() == null || mPoint.getBizid().isEmpty()) { - result1 = Result.failed("厂区获取失败,新增失败"); - } else { - MPoint oldMPoint = this.mPointService.selectById(mPoint.getId()); - if (oldMPoint != null) { - result1 = Result.failed("此ID的测量点已存在"); - } else { - int result = this.mPointService.save(mPoint.getBizid(), mPoint); - if (result == Result.SUCCESS) { - result1 = Result.success(result); - } else { - result1 = Result.failed("新增失败"); - } - } - - } - model.addAttribute("result", CommUtil.toJson(result1)); -// String resstr="{\"res\":\""+result+"\",\"id\":\""+mPoint.getId()+"\"}"; -// model.addAttribute("result", resstr); - return "result"; - } - - /** - * 修改测量点(修改es和拓展表) - * - * @param request - * @param model - * @param mPoint - * @return - */ - @RequestMapping("/update.do") - @ArchivesLog(operteContent = "更新测量点,同时更新es和拓展表") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute MPoint mPoint) { - String expandId = request.getParameter("expandId");//拓展表id - String explain = request.getParameter("explain");//测量点解释 - Result result1 = new Result(); - int result = this.mPointService.update(mPoint.getBizid(), mPoint); - if (result == 1) { - result1 = Result.success(result); - - //更新拓展表 - MPointExpand mPointExpand = mPointExpandService.selectById(mPoint.getBizid(), expandId); - if (mPointExpand != null) { - mPointExpand.setExplain(explain); - mPointExpandService.update(mPoint.getBizid(), mPointExpand); - } else { - MPointExpand mPointExpand2 = new MPointExpand(); - mPointExpand2.setId(CommUtil.getUUID()); - mPointExpand2.setInsdt(CommUtil.nowDate()); - mPointExpand2.setExplain(explain); - mPointExpand2.setMeasurePointId(mPoint.getId()); - mPointExpandService.save(mPoint.getBizid(), mPointExpand2); - } - } else { - result1 = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result1)); - return "result"; - } - - /** - * 修改测量点(不修改es和拓展表) - * - * @param request - * @param model - * @param mPoint - * @return - */ - @RequestMapping("/update2.do") - @ArchivesLog(operteContent = "更新测量点,不更新es和拓展表") - public String update2(HttpServletRequest request, Model model, - @ModelAttribute MPoint mPoint) { - int result = this.mPointService.update2(mPoint.getBizid(), mPoint); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPoint.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - @ArchivesLog(operteContent = "删除测量点") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) { - int result = this.mPointService.deleteById(bizId, id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - @ArchivesLog(operteContent = "批量删除测量点") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.mPointService.deleteByWhere(bizId, "where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletesEs.do") - @ArchivesLog(operteContent = "批量删除测量点(ES)") - public String deletesEs(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids) { - int result = 0; - if (ids != null && !ids.trim().equals("")) { - String[] id = ids.split(","); - for (int i = 0; i < id.length; i++) { - MPoint mPoint = mPointService.selectById(id[i]); - if (mPoint != null) { - result += this.mPointService.deleteByIdEs(mPoint.getBizid(), id[i]); - } - } - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getvaluefunc.do") - public String getvaluefunc(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "ids") String ids) { - List result = this.mPointService.getvaluefunc(bizId, ids); - JSONArray json = JSONArray.fromObject(result); - String resultstr = "{\"total\":" + result.size() + ",\"rows\":" + json + "}"; - model.addAttribute("result", resultstr); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request, Model model) { - request.setAttribute("pid", request.getParameter("pid")); - request.setAttribute("mpid", request.getParameter("mpid")); - return "/work/mPointListForSelect"; - } - - @RequestMapping("/showForSignalTest.do") - public String showForSignalTest(HttpServletRequest request, Model model) { - String idsString = request.getParameter("ids"); - request.setAttribute("ids", request.getParameter("ids")); - return "/work/mPointForSignalTest"; - } - - @RequestMapping("/getMPLikeName.do") - public ModelAndView getMPLikeName(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId) { - String wherestr = " where 1=1 and ParmName like '%" + request.getParameter("formulaname") + "%' "; - String orderstr = " order by mpointcode asc "; - List list = this.mPointService.selectListByWhere(unitId, wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list.get(0)); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/getPointName.do") - public ModelAndView getlistname(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId) { - String wherestr = " where 1=1 "; - String orderstr = " order by mpointcode asc "; - List list = this.mPointService.selectListByWhere(bizId, wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/showlistForSelects.do") - public String showlistForSelects(HttpServletRequest request, Model model) { - return "/work/mPointListForSelects"; - } - - /** - * 用来保存关联的设备 - * - * @param request - * @param model - * @param mids - * @return - */ - @RequestMapping("/savep.do") - public String dosaveMachine(HttpServletRequest request, Model model, - @RequestParam(value = "mids") String mids) { - String no = request.getParameter("no"); - this.equipmentPointService.deleteByWhere("where pointid='" + no + "'"); - EquipmentPoint equipmentPoint = new EquipmentPoint(); - String[] midarr = mids.split(","); - int result = 0; - for (int i = 0; i < midarr.length; i++) { - if (!midarr[i].equals("")) { - String id = CommUtil.getUUID(); - equipmentPoint.setId(id); - equipmentPoint.setEquipmentcardid(midarr[i]); - equipmentPoint.setPointid(no); - result += this.equipmentPointService.save(equipmentPoint); - } - } - - String resstr = "{\"res\":\"" + result + "\",\"pointid\":\"" + no + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getMPointFunType4Combo.do") - public ModelAndView getProdManagementViews4Combo(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - JSONArray jsonArray = new JSONArray(); - String[] views = CommString.MPointFunType; - for (String str : views) { -// String[] items = str.split(":"); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", str); - jsonObject.put("name", str); - jsonArray.add(jsonObject); - } - model.addAttribute("result", jsonArray.toString()); - return new ModelAndView("result"); - } - - /** - * 测量点关联巡检点回传测量点方法 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/patroPointMPointForSelect.do") - public String patroPointMPointForSelect(HttpServletRequest request, Model model) { - String mPointIds = request.getParameter("mPointIds"); - String processSectionId = request.getParameter("processSectionId"); - String bizId = request.getParameter("bizId"); - String whereStr = "where MPointID in ('" + mPointIds.replace(",", "','") + "') "; - List list = this.mPointService.selectListByWhere(bizId, whereStr); - model.addAttribute("mPoints", JSONArray.fromObject(list)); - model.addAttribute("processSectionId", processSectionId); - return "timeefficiency/patroPointMPointListForSelect"; - } - - @RequestMapping("/getMpointsJson.do") - public ModelAndView getMpointJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizId = request.getParameter("bizId"); - List list = this.mPointService.selectListByWhere(bizId, ""); - model.addAttribute("mPoints", JSONArray.fromObject(list)); - return new ModelAndView("result"); - } - - @RequestMapping("/showEquipmentCardForMpointSelect.do") - public String showEquipmentCardForMpointSelect(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - String equipmentId = request.getParameter("equipmentId"); -// System.out.println(companyId + equipmentId); - return "/equipment/equipmentCardListForMpointSelect"; - } - - /*** - * 根据选择的测量点返回一段时间的值,曲线 @author JY - * @param request - * @param model - * @param unitId - * @param sdt - * @param edt - * @return - */ - @RequestMapping("/getMpointJsonFormpids.do") - public ModelAndView getMpointJsonFormpids(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpids") String mpids, - @RequestParam(value = "func") String func, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - User cu = (User) request.getSession().getAttribute("cu"); - String dataAaccuracy = request.getParameter("dataAaccuracy");//数据精度 - - String bizId = unitId; - - JSONArray mainjsondata = new JSONArray(); - - if (mpids.contains(";")) { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - - String[] idarr = mpids.split(";"); - String selectString = ""; - String fromString = ""; - String leftString = ""; - String tbnametop1 = ""; - if (func.equals("sum") || func.equals("SUM") || func.equals("Sum")) { - if (idarr.length > 1) { - for (int i = 0; i < idarr.length; i++) { - String tbname = "[tb_mp_" + idarr[i] + "]"; - selectString += tbname + ".ParmValue+"; - if (i == 0) { - fromString = tbname; - tbnametop1 = tbname; - } else { - leftString += " left outer join " + tbname + " on " + "SUBSTRING(convert(varchar(100)," + tbnametop1 + ".MeasureDT,20),0,17)=SUBSTRING(convert(varchar(100)," + tbname + ".MeasureDT,20),0,17)"; - } - } - } - selectString = "(" + selectString.substring(0, selectString.length() - 1) + ") as parmvalue," + "SUBSTRING(convert(varchar(100),tb_mp_" + idarr[0] + ".MeasureDT,20),0,17) AS MeasureDT "; - } else if (func.equals("avg") || func.equals("AVG") || func.equals("Avg")) { - if (idarr.length > 1) { - for (int i = 0; i < idarr.length; i++) { - String tbname = "tb_mp_" + idarr[i]; - selectString += tbname + ".ParmValue+"; - if (i == 0) { - fromString = tbname; - tbnametop1 = tbname; - } else { - leftString += " left outer join " + tbname + " on " + "SUBSTRING(convert(varchar(100)," + tbnametop1 + ".MeasureDT,20),0,17)=SUBSTRING(convert(varchar(100)," + tbname + ".MeasureDT,20),0,17)"; - } - } - } - selectString = "(" + selectString.substring(0, selectString.length() - 1) + ")/(" + idarr.length + ") as parmvalue," + "SUBSTRING(convert(varchar(100),tb_mp_" + idarr[0] + ".MeasureDT,20),0,17) AS MeasureDT "; - } - - List list = mPointHistoryService - .selectAggregateList(unitId, fromString, leftString + " where (" + tbnametop1 + ".MeasureDT>='" + sdt + "' and " + tbnametop1 + ".MeasureDT<='" + edt + "') and " + tbnametop1 + ".parmvalue>'-9990' order by " + tbnametop1 + ".measuredt ", selectString); - - if (list != null && list.size() > 0) { - String mpname = request.getParameter("mpname"); - jsonObject2.put("name", mpname); - - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < list.size(); j++) { - String[] dataValue = new String[4]; - String measuredt = list.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(list.get(j).getParmvalue().doubleValue()); - dataValue[2] = ""; - -// dataValue[3]=String.valueOf(j); - - jsondata.add(dataValue); - } - - jsonObject2.put("data", jsondata); - jsonObject2.put("maxlimit", "-"); - jsonObject2.put("minlimit", "-"); - - mainjsondata.add(jsonObject2); - - } - - } else { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - - List mplistList = mPointService.selectListByWhere(bizId, "where (id='" + mpids + "' or MPointCode='" + mpids + "')"); - - if (mplistList != null && mplistList.size() > 0) { - List list = mPointHistoryService - .selectListByTableAWhere(unitId, "[tb_mp_" + mplistList.get(0).getMpointcode() + "]", " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt"); - - //是否包含备注 - List remarkList = curveRemarkService.selectListByWhere(" where (charindex('" + mplistList.get(0).getMpointcode() + "',mpoint_id)>0 or charindex('" + mplistList.get(0).getId() + "',mpoint_id)>0) and charindex('" + bizId + "',mpoint_id)>0 " - + " and ((sdt>='" + sdt + "' and edt<='" + edt + "') "//全包含 - + " or (sdt<'" + sdt + "' and edt>'" + sdt + "') "//左包含 - + " or (edt>'" + edt + "' and sdt<'" + edt + "'))");//右包含 - - if (list != null && list.size() > 0) { - String mpname = mplistList.get(0).getParmname(); - String unit = "-"; - if (mplistList.get(0).getUnit() != null) { - unit = mplistList.get(0).getUnit(); - } - - String numTail = "2"; - if (mplistList.get(0).getNumtail() != null) { - numTail = mplistList.get(0).getNumtail(); - } - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - - jsonObject2.put("name", mpname); - - JSONArray jsondata = new JSONArray(); - JSONArray remarkSRangejson = new JSONArray(); - JSONArray remarkERangejson = new JSONArray(); - boolean rmSst = false; - boolean rmEst = false; - for (int j = 0; j < list.size(); j++) { - JSONArray jsonArray = new JSONArray(); -// String[] dataValue = new String[4]; - String measuredtString = list.get(j).getMeasuredt(); - long measuredt = CommUtil.getMillisecondByDateTime(list.get(j).getMeasuredt()) * 1000; - jsonArray.add(measuredt); -// dataValue[0] = measuredt; -// if (dataAaccuracy.equals("min")) { -// dataValue[0] = measuredt.substring(0, 16); -// } else if (dataAaccuracy.equals("sec")) { -// dataValue[0] = measuredt; -// } -// dataValue[4] = CommUtil.getMillisecondByDateTime(measuredt); - jsonArray.add(list.get(j).getParmvalue().doubleValue()); -// dataValue[1] = df.format(list.get(j).getParmvalue().doubleValue()); - - //判断是否存在于备注时间内 - String remarkString = ""; - if (remarkList != null && remarkList.size() > 0) { - for (int r = 0; r < remarkList.size(); r++) { - int n1 = CommUtil.compare_time(remarkList.get(r).getSdt(), measuredtString); - int n2 = CommUtil.compare_time(remarkList.get(r).getEdt(), measuredtString); - if ((n1 == 0 || n1 == -1) && (n2 == 0 || n2 == 1)) { - remarkString += remarkList.get(r).getContent() + "
"; - if (rmSst) { - } else { - remarkSRangejson.add(j); - } - rmSst = true; - } - } - if (!remarkString.equals("") && remarkString.length() > 4) { - jsonArray.add(remarkString.substring(0, remarkString.length() - 4)); -// dataValue[2] = remarkString.substring(0, remarkString.length() - 4); - } else { - jsonArray.add(""); -// dataValue[2] = ""; - if (rmSst) { - rmEst = true; - } - rmSst = false; - } - } else { - jsonArray.add(""); -// dataValue[2] = ""; - if (rmSst) { - rmEst = true; - } - rmSst = false; - } - - if (rmSst) { - } else { - if (rmEst) { - remarkERangejson.add(j); - rmEst = false; - } - } - -// dataValue[3]=String.valueOf(j); - jsonArray.add(unit); -// dataValue[3] = unit; - jsondata.add(jsonArray); - } - - if (rmEst) { - } else { - remarkERangejson.add(list.size()); - } - -// System.out.println(remarkSRangejson); -// System.out.println(remarkERangejson); -// System.out.println(list.size()); - jsonObject2.put("data", jsondata); - - jsonObject2.put("remarkS", remarkSRangejson); - jsonObject2.put("remarkE", remarkERangejson); - if (mplistList.get(0).getAlarmmax() != null) { - jsonObject2.put("maxlimit", mplistList.get(0).getAlarmmax()); - } else { - jsonObject2.put("maxlimit", "-"); - } - if (mplistList.get(0).getAlarmmin() != null) { - jsonObject2.put("minlimit", mplistList.get(0).getAlarmmin()); - } else { - jsonObject2.put("minlimit", "-"); - } - - mainjsondata.add(jsonObject2); - - } else { - } - - } - - } - model.addAttribute("result", mainjsondata); - - return new ModelAndView("result"); - } - - /*** - * 根据选择的测量点 以及时间 返回历史数据 @author JY - * @param request - * @param model - * @param unitId - * @return - */ - @RequestMapping("/getMpointJsonForHisContrast.do") - public String getMpointJsonForHisContrast(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpid") String mpid, - @RequestParam(value = "basicsDt") String basicsDt, - @RequestParam(value = "hisDt") String hisDt) { - - try { - String bizId = unitId; - - basicsDt = basicsDt.substring(0, 7) + "-01"; - hisDt = hisDt.substring(0, 7) + "-01"; - - int diffnum = CommUtil.getDays(hisDt, basicsDt, "month"); - - List mplistList = mPointService.selectListByWhere(bizId, "where (id='" + mpid + "' or MPointCode='" + mpid + "')"); - - List blist = mPointHistoryService - .selectListByTableAWhere(unitId, "[tb_mp_" + mplistList.get(0).getMpointcode() + "]", " where datediff(month,MeasureDT,'" + basicsDt + "')=0 and parmvalue>'-9990' order by measuredt"); - List hlist = mPointHistoryService - .selectListByTableAWhere(unitId, "[tb_mp_" + mplistList.get(0).getMpointcode() + "]", " where datediff(month,MeasureDT,'" + hisDt + "')=0 and parmvalue>'-9990' order by measuredt"); - - com.alibaba.fastjson.JSONArray mainjsondata = new com.alibaba.fastjson.JSONArray(); -// com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(); - - if (blist != null && blist.size() > 0) { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONArray jsondata = new com.alibaba.fastjson.JSONArray(); - - String mpname = "基础月:"; - if (mplistList != null && mplistList.size() > 0) { - mpname = mpname + mplistList.get(0).getParmname(); - } else { - mpname = mpname + ""; - } - jsonObject2.put("name", mpname); - - String numTail = "2"; - if (mplistList.get(0).getNumtail() != null) { - numTail = mplistList.get(0).getNumtail(); - } - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - - for (int j = 0; j < blist.size(); j++) { - String[] dataValue = new String[3]; - String mdata = blist.get(j).getMeasuredt(); - dataValue[0] = mdata.substring(0, 19); - dataValue[1] = df.format(blist.get(j).getParmvalue()); - dataValue[2] = mdata.substring(0, 19); - jsondata.add(dataValue); - } - jsonObject2.put("data", jsondata); - - if (mplistList.get(0).getAlarmmax() != null) { - jsonObject2.put("maxlimit", mplistList.get(0).getAlarmmax()); - } else { - jsonObject2.put("maxlimit", "-"); - } - if (mplistList.get(0).getAlarmmin() != null) { - jsonObject2.put("minlimit", mplistList.get(0).getAlarmmin()); - } else { - jsonObject2.put("minlimit", "-"); - } - - mainjsondata.add(jsonObject2); - - } else { - - } - - if (hlist != null && hlist.size() > 0) { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONArray jsondata = new com.alibaba.fastjson.JSONArray(); - - String mpname = "对比月:"; - if (mplistList != null && mplistList.size() > 0) { - mpname = mpname + mplistList.get(0).getParmname(); - } else { - mpname = mpname + ""; - } - jsonObject2.put("name", mpname); - - String numTail = "2"; - if (mplistList.get(0).getNumtail() != null) { - numTail = mplistList.get(0).getNumtail(); - } - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - - for (int j = 0; j < hlist.size(); j++) { - String[] dataValue = new String[3]; - String mdata = hlist.get(j).getMeasuredt(); - dataValue[0] = CommUtil.subplus(mdata, String.valueOf(diffnum), "month").substring(0, 10) + mdata.substring(10, 19); - dataValue[1] = df.format(hlist.get(j).getParmvalue()); - dataValue[2] = mdata.substring(0, 19); - jsondata.add(dataValue); - } - jsonObject2.put("data", jsondata); - - if (mplistList.get(0).getAlarmmax() != null) { - jsonObject2.put("maxlimit", mplistList.get(0).getAlarmmax()); - } else { - jsonObject2.put("maxlimit", "-"); - } - if (mplistList.get(0).getAlarmmin() != null) { - jsonObject2.put("minlimit", mplistList.get(0).getAlarmmin()); - } else { - jsonObject2.put("minlimit", "-"); - } - - mainjsondata.add(jsonObject2); - - } else { - } - - model.addAttribute("result", mainjsondata); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return "result"; - } - - /*** - * 根据选择的测量点 以及时间 数据偏移 @author JY - * @param request - * @param model - * @param unitId - * @param sdt - * @param edt - * @return - */ - @RequestMapping("/getMpointJsonForDataMove.do") - public String getMpointJsonForDataMove(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpids") String mpids, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - - try { - String bizId = unitId; - String[] idarr = mpids.split(";"); - - JSONArray mainjsondata = new JSONArray(); -// com.alibaba.fastjson.JSONObject jsonObject=new com.alibaba.fastjson.JSONObject(); - - if (idarr != null && idarr.length > 0) { - for (int i = 0; i < idarr.length; i++) { - String[] mpidAndMoveTime = idarr[i].split(",");//隔开测量点及偏移小时数 - String mpid = mpidAndMoveTime[0];//测量点 - String moveTime = mpidAndMoveTime[1];//偏移小时数 - - String newsdt = CommUtil.subplus(sdt, moveTime, "hour"); - String newedt = CommUtil.subplus(edt, moveTime, "hour"); - - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - JSONArray jsondata = new JSONArray(); - - List mplistList = mPointService.selectListByWhere(bizId, "where (id='" + mpid + "' or MPointCode='" + mpid + "')"); - if (mplistList != null && mplistList.size() > 0) { - List list = mPointHistoryService - .selectListByTableAWhere(unitId, "tb_mp_" + mplistList.get(0).getMpointcode(), " where (MeasureDT>='" + newsdt + "' and MeasureDT<='" + newedt + "') and parmvalue>'-9990' order by measuredt"); - - if (moveTime.contains("-")) { - moveTime = moveTime.replace("-", ""); - } else { - moveTime = "-" + moveTime; - } - - if (list != null && list.size() > 0) { - String mpname = mplistList.get(0).getParmname(); - jsonObject2.put("name", mpname); - - for (int j = 0; j < list.size(); j++) { - String[] dataValue = new String[3]; - dataValue[0] = CommUtil.subplus(list.get(j).getMeasuredt(), moveTime, "hour"); - dataValue[1] = String.valueOf(list.get(j).getParmvalue().doubleValue()); - dataValue[2] = list.get(j).getMeasuredt(); - jsondata.add(dataValue); - } - jsonObject2.put("data", jsondata); - - if (mplistList.get(0).getAlarmmax() != null) { - jsonObject2.put("maxlimit", mplistList.get(0).getAlarmmax()); - } else { - jsonObject2.put("maxlimit", "-"); - } - if (mplistList.get(0).getAlarmmin() != null) { - jsonObject2.put("minlimit", mplistList.get(0).getAlarmmin()); - } else { - jsonObject2.put("minlimit", "-"); - } - - mainjsondata.add(jsonObject2); - - } else { - } - } - - } - } - model.addAttribute("result", mainjsondata); -// model.addAttribute("result", jsonarr.toString()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return "result"; - } - - /*** - * 根据选择的测量点返回一段时间的备注内容 @author JY - * @param request - * @param model - * @param unitId - * @param sdt - * @param edt - * @return - */ - @RequestMapping("/getMpointJsonForRemark.do") - public ModelAndView getMpointJsonForRemark(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpids") String mpids, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - User cu = (User) request.getSession().getAttribute("cu"); - - try { - String bizId = unitId; - String[] idarr = mpids.split(","); - - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - - if (idarr != null && idarr.length > 0) { - for (int i = 0; i < idarr.length; i++) { - - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - JSONArray jsondata = new JSONArray(); - - List remarkList = curveRemarkService.selectListByWhere(" where mpoint_id='" + idarr[i] + "' and insuser='" + cu.getId() + "' " - + " and ((sdt>='" + sdt + "' and edt<='" + edt + "') "//全包含 - + " or (sdt<'" + sdt + "' and edt>'" + sdt + "') "//左包含 - + " or (edt>'" + edt + "' and sdt<'" + edt + "'))");//右包含 - - List mplistList = mPointService.selectListByWhere(bizId, "where (id='" + idarr[i] + "' or MPointCode='" + idarr[i] + "')"); - if (mplistList != null && mplistList.size() > 0) { - List list = mPointHistoryService - .selectListByTableAWhere(unitId, "tb_mp_" + mplistList.get(0).getMpointcode(), " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt"); - - if (list != null && list.size() > 0) { - String mpname = mplistList.get(0).getParmname(); - - for (int j = 0; j < list.size(); j++) { - String[] dataValue = new String[3]; - String measuredt = list.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(list.get(j).getParmvalue().doubleValue()); - //判断是否存在于备注时间内 - String remarkString = ""; - if (remarkList != null && remarkList.size() > 0) { - for (int r = 0; r < remarkList.size(); r++) { - int n1 = CommUtil.compare_time(remarkList.get(r).getSdt(), measuredt); - int n2 = CommUtil.compare_time(remarkList.get(r).getEdt(), measuredt); - if ((n1 == 0 || n1 == -1) && (n2 == 0 || n2 == 1)) { - remarkString += remarkList.get(r).getContent() + "
"; - } - } - if (!remarkString.equals("") && remarkString.length() > 4) { - dataValue[2] = remarkString.substring(0, remarkString.length() - 4); - } else { - dataValue[2] = ""; - } - } else { - dataValue[2] = ""; - } - - jsondata.add(dataValue); - } - jsonObject2.put("数据", jsondata); - - JSONArray jsondata2 = new JSONArray(); - String[] dataValue2 = new String[2]; - - if (mplistList.get(0).getAlarmmax() != null) { - dataValue2[0] = String.valueOf(mplistList.get(0).getAlarmmax()); - } else { - dataValue2[0] = String.valueOf(""); - } - if (mplistList.get(0).getAlarmmin() != null) { - dataValue2[1] = String.valueOf(mplistList.get(0).getAlarmmin()); - } else { - dataValue2[1] = String.valueOf(""); - } - - jsondata2.add(dataValue2); - jsonObject2.put("限值", jsondata2); - - jsonObject.put(mpname, jsonObject2); - - } else { - String mpname = mplistList.get(0).getParmname(); - - jsonObject.put(mpname, "无数据"); - } - - } - - } - } - model.addAttribute("result", jsonObject); -// model.addAttribute("result", jsonarr.toString()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return new ModelAndView("result"); - } - - /** - * 生产运行总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewProduce.do") - public String overviewProduce(HttpServletRequest request, Model model) { - return "/work/overviewProduce"; - } - - /** - * 生产运行总览,根据bot来动态修改页面上的数值 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewProduceWithBot.do") - public String overviewProduceWithBot(HttpServletRequest request, Model model) { - - return "/work/overviewProduceWithBot"; - } - - - @RequestMapping("/overviewProduceBlack.do") - public String overviewProduceBlack(HttpServletRequest request, Model model) { - return "/work/overviewProduceBlack"; - } - - /** - * 生产运行总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewProduce2020.do") - public String overviewProduce2020(HttpServletRequest request, Model model) { - return "/work/overviewProduce2020"; - } - - @RequestMapping("/overviewProduce2020test.do") - public String overviewProduce2020test(HttpServletRequest request, Model model) { - return "/work/overviewProduce2020test"; - } - - @RequestMapping("/overviewEquipment2020.do") - public String overviewEquipment2020(HttpServletRequest request, Model model) { - return "/work/overviewEquipment2020"; - } - - @RequestMapping("/getOverviewProduce.do") - public ModelAndView getOverviewProduce(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String whereBiz = ""; - String whereBiz2 = ""; - String whereBiz3 = ""; -//System.out.println("###"+request.getParameter("biz_id")); - String bizId = request.getParameter("biz_id"); - if (request.getParameter("biz_id") != null && !request.getParameter("biz_id").isEmpty() && bizId != "undefined") { - whereBiz += " and biz_id = '" + bizId + "'"; - whereBiz2 += " and bizId = '" + bizId + "'"; - whereBiz3 += " and d.companyId = '" + bizId + "'"; - } - OverviewProduce homePage = new OverviewProduce(); - - //设备类型 -// List equipmentLevels = this.equipmentLevelService.selectListByWhere("where 1=1"); -// for (EquipmentLevel equipmentLevel : equipmentLevels) { -// if("A".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalA( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"'"+ whereBiz2+"").getAssetnumber()); } -// if("B".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalB( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"' "+ whereBiz2+"").getAssetnumber()); } -// if("C".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalC( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"' "+ whereBiz2+"").getAssetnumber()); } -// -// } -// String equipmentTotal = this.homePageService.selectEquipmentTotal("where 1=1 "+ whereBiz2+"").getAssetnumber(); -// homePage.setEquipmentTotal(equipmentTotal); - homePage.setEquipmentTotalA(findDATA(bizId, "EquipmentTotalA", "1")); - homePage.setEquipmentTotalB(findDATA(bizId, "EquipmentTotalB", "1")); - homePage.setEquipmentTotalC(findDATA(bizId, "EquipmentTotalC", "1")); - String equipmentTotal = findDATA(bizId, "EquipmentTotal", "1"); - homePage.setEquipmentTotal(equipmentTotal); - - homePage.setEquipmentTotalRun(findDATA(bizId, "EquipmentTotalRun", "1")); - homePage.setEquipmentIntactRate(Integer.parseInt(findDATA(bizId, "EquipmentIntactRate", "1"))); - homePage.setEquipmentInspection(Integer.parseInt(findDATA(bizId, "EquipmentInspection", "1"))); - homePage.setEquipmentRepair(Integer.parseInt(findDATA(bizId, "EquipmentRepair", "1"))); - homePage.setEquipmentAnomaliesTotal(Integer.parseInt(findDATA(bizId, "EquipmentAnomaliesTotal", "1"))); - homePage.setEquipmentMaintain(Integer.parseInt(findDATA(bizId, "EquipmentMaintain", "1"))); - homePage.setEquipmentRunAnomalies(Integer.parseInt(findDATA(bizId, "EquipmentRunAnomalies", "1"))); - homePage.setEquipmentToAnomalies(Integer.parseInt(findDATA(bizId, "EquipmentToAnomalies", "1"))); - - homePage.setData13(findDATA(bizId, "data13", "1")); - homePage.setData14(findDATA(bizId, "data14", "1")); - homePage.setData15(findDATA(bizId, "data15", "1")); - homePage.setData16(findDATA(bizId, "data16", "1")); - homePage.setData17(findDATA(bizId, "data17", "1")); - homePage.setData18(findDATA(bizId, "data18", "1")); - - //设备状态 -// List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where 1=1"); -// for (EquipmentStatusManagement equipmentStatusManagement : equipmentStatusManagements) { -// if("在用".equals(equipmentStatusManagement.getName())){ -// String equipmentin = this.homePageService.selectEquipmentTotal("where 1=1 and equipmentStatus = '"+equipmentStatusManagement.getId()+"' "+ whereBiz2+"").getAssetnumber(); -// homePage.setEquipmentTotalRun( equipmentin); -// int a = Integer.parseInt(equipmentTotal); -// int b = Integer.parseInt(equipmentin); -// if(a!=0){ -// homePage.setEquipmentIntactRate(b*100/a); -// }else{ -// homePage.setEquipmentIntactRate(0); -// } -// //System.out.println("##"+homePage.getEquipmentIntactRate()); -// } -// } - //设备维修 -// List maintenanceDetails = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.type=2 "+ whereBiz3+" "); -// int maintenanceDetailin=0; -// for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { -// if("1".equals(maintenanceDetail.getStatus())){ -// maintenanceDetailin = maintenanceDetailin + 1 ; -// } -// } -// if(maintenanceDetails.size()!=0){ -// homePage.setEquipmentRepair(maintenanceDetailin*100/maintenanceDetails.size()); -// }else{ -// homePage.setEquipmentRepair(0); -// } -// homePage.setData15(String.valueOf(maintenanceDetails.size())); -// //设备保养 -// List maintenanceDetails2 = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.type=1 "+ whereBiz3+" "); -// int maintenanceDetailin2=0; -// for (MaintenanceDetail maintenanceDetail : maintenanceDetails2) { -// if("1".equals(maintenanceDetail.getStatus())){ -// maintenanceDetailin2 = maintenanceDetailin2 + 1; -// } -// } -// if(maintenanceDetails2.size()!=0){ -// homePage.setEquipmentMaintain(maintenanceDetailin2*100/maintenanceDetails2.size()); -// }else{ -// homePage.setEquipmentMaintain(0); -// } -// homePage.setEquipmentRunAnomalies(0); -// homePage.setData17(String.valueOf(maintenanceDetails.size())); -// //已完成 -// Stock xj3= this.stockService.RecordTotal("where 1=1 and status = '3' "+ whereBiz+" "); -// //全部 -// Stock xj= this.stockService.RecordTotal("where 1=1 and status = '3' "+ whereBiz+" "); -// homePage.setData13(xj.getGoodsId()); -// -// if(xj.getGoodsId()!=null&& Integer.parseInt(xj.getGoodsId())!=0){ -// int a = Integer.parseInt(xj3.getGoodsId()); -// int b = Integer.parseInt(xj.getGoodsId()); -// homePage.setEquipmentInspection(a/b); -// }else{ -// homePage.setEquipmentInspection(0); -// } -// //巡检工时 -// Stock xjDuration= this.stockService.RecordDurationTotal("where 1=1 "+ whereBiz+" "); -// if(xjDuration!=null){ -// homePage.setData14(xjDuration.getGoodsId()); -// }else{ -// homePage.setData14("0"); -// } -// //维修工时 -// Stock wxDuration= this.stockService.MaintenanceWorkinghoursTotal("where 1=1 and type=2 "); -// if(wxDuration!=null){ -// homePage.setData16(subNumberText(wxDuration.getGoodsId())); -// }else{ -// homePage.setData16("0"); -// } -// //保养工时 -// Stock byDuration= this.stockService.MaintenanceWorkinghoursTotal("where 1=1 and type=1 "); -// if(byDuration!=null){ -// homePage.setData18(subNumberText(byDuration.getGoodsId())); -// }else{ -// homePage.setData18("0"); -// } - //findArrayDATA(String bizId,String data_number,String page_nub,int nub) - homePage.setWscll(findArrayDATA(bizId, "wscll", "1")); - homePage.setWnwyl(findArrayDATA(bizId, "wnwyl", "1")); - homePage.setSdtscll(findArrayDATA(bizId, "sdtscll", "1")); - homePage.setSywnl(findArrayDATA(bizId, "sywnl", "1")); - homePage.setYyl(findArrayDATA(bizId, "yyl", "1")); - homePage.setYdl(findArrayDATA(bizId, "ydl", "1")); - //findDATA(String bizId,String data_number,String page_nub) - homePage.setData(findDATA(bizId, "data", "1")); - homePage.setData1(findDATA(bizId, "data1", "1")); - homePage.setData2(findDATA(bizId, "data2", "1")); - homePage.setData3(findDATA(bizId, "data3", "1")); - homePage.setData4(findDATA(bizId, "data4", "1")); - homePage.setData5(findDATA(bizId, "data5", "1")); - homePage.setData6(findDATA(bizId, "data6", "1")); - homePage.setData7(findDATA(bizId, "data7", "1")); - homePage.setData8(findDATA(bizId, "data8", "1")); - homePage.setData9(findDATA(bizId, "data9", "1")); - homePage.setData10(findDATA(bizId, "data10", "1")); - homePage.setData11(findDATA(bizId, "data11", "1")); - homePage.setData12(findDATA(bizId, "data12", "1")); - //进水实际值 - homePage.setData19(Integer.parseInt(findDATA(bizId, "data19", "1"))); - //目标值 - homePage.setData20(Integer.parseInt(findDATA(bizId, "data20", "1"))); - //出水实际值 - homePage.setData21(Integer.parseInt(findDATA(bizId, "data21", "1"))); - //目标值 - homePage.setData22(Integer.parseInt(findDATA(bizId, "data22", "1"))); - - - JSONObject fromObject = JSONObject.fromObject(homePage); - String resstr = "{\"res\":\"" + fromObject + "\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); - } - - - /** - * 获取首页数据 - */ - - @RequestMapping("/getpage.do") - public ModelAndView getpage(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String whereBiz = ""; - String whereBiz2 = ""; - String whereBiz3 = ""; -// System.out.println("###" + request.getParameter("biz_id")); - if (request.getParameter("biz_id") != null && !request.getParameter("biz_id").isEmpty()) { - whereBiz += " and biz_id = '" + request.getParameter("biz_id") + "'"; - whereBiz2 += " and bizId = '" + request.getParameter("biz_id") + "'"; - whereBiz3 += " and d.companyId = '" + request.getParameter("biz_id") + "'"; - } - HomePage homePage = new HomePage(); - //设备类型 - List equipmentLevels = this.equipmentLevelService.selectListByWhere("where 1=1"); - for (EquipmentLevel equipmentLevel : equipmentLevels) { - if ("A".equals(equipmentLevel.getLevelname())) { - homePage.setEquipmentTotalA(this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '" + equipmentLevel.getId() + "'" + whereBiz2 + "").getAssetnumber()); - } - if ("B".equals(equipmentLevel.getLevelname())) { - homePage.setEquipmentTotalB(this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '" + equipmentLevel.getId() + "' " + whereBiz2 + "").getAssetnumber()); - } - if ("C".equals(equipmentLevel.getLevelname())) { - homePage.setEquipmentTotalC(this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '" + equipmentLevel.getId() + "' " + whereBiz2 + "").getAssetnumber()); - } - - } - String equipmentTotal = this.homePageService.selectEquipmentTotal("where 1=1 " + whereBiz2 + "").getAssetnumber(); - homePage.setEquipmentTotal(equipmentTotal); - //设备状态 - List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where 1=1"); - for (EquipmentStatusManagement equipmentStatusManagement : equipmentStatusManagements) { - if ("在用".equals(equipmentStatusManagement.getName())) { - String equipmentin = this.homePageService.selectEquipmentTotal("where 1=1 and equipmentStatus = '" + equipmentStatusManagement.getId() + "' " + whereBiz2 + "").getAssetnumber(); - homePage.setEquipmentTotalRun(equipmentin); - int a = Integer.parseInt(equipmentTotal); - int b = Integer.parseInt(equipmentin); - if (a != 0) { - homePage.setEquipmentIntactRate(b * 100 / a); - } else { - homePage.setEquipmentIntactRate(0); - } - //System.out.println("##"+homePage.getEquipmentIntactRate()); - } - } - //设备维修 - List maintenanceDetails = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.status!='1' and d.type=2 " + whereBiz3 + " "); - int maintenanceDetailin = 0; - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - if ("1".equals(maintenanceDetail.getStatus())) { - maintenanceDetailin = maintenanceDetailin + 1; - } - } - if (maintenanceDetails.size() != 0) { - homePage.setEquipmentRepair(maintenanceDetailin * 100 / maintenanceDetails.size()); - } else { - homePage.setEquipmentRepair(0); - } - homePage.setEquipmentAnomaliesTotal(maintenanceDetails.size()); - //设备保养 - List maintenanceDetails2 = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.status!='1' and d.type=1 " + whereBiz3 + " "); - int maintenanceDetailin2 = 0; - for (MaintenanceDetail maintenanceDetail : maintenanceDetails2) { - if ("1".equals(maintenanceDetail.getStatus())) { - maintenanceDetailin2 = maintenanceDetailin2 + 1; - } - } - if (maintenanceDetails2.size() != 0) { - homePage.setEquipmentMaintain(maintenanceDetailin2 * 100 / maintenanceDetails2.size()); - } else { - homePage.setEquipmentMaintain(0); - } - homePage.setEquipmentRunAnomalies(0); - homePage.setEquipmentToAnomalies(maintenanceDetails.size()); - //物资申请 - Subscribe sutotal = this.subscribeService.SubscribeMoneyTotal("where 1=1 " + whereBiz + ""); - homePage.setMaterialApplication(sutotal.getStatus()); - if (sutotal.getTotalMoney() != null) { - homePage.setMaterialApplicationTotal(subNumberText(sutotal.getTotalMoney().toString())); - } else { - homePage.setMaterialApplicationTotal("0"); - } - PurchaseRecord purchaseRecord = this.purchaseRecordService.PurchaseRecordMoneyTotal("where 1=1 and status = '1' " + whereBiz + " "); - homePage.setCompletePurchase(subNumberText(purchaseRecord.getStatus())); - if (purchaseRecord.getTotalMoney() != null) { - homePage.setCompletePurchaseTotal(subNumberText(purchaseRecord.getTotalMoney().toString())); - } else { - homePage.setCompletePurchaseTotal("0"); - } - PurchaseRecord purchaseRecord1 = this.purchaseRecordService.PurchaseRecordMoneyTotal("where 1=1 and status = '0' " + whereBiz + " "); - homePage.setRunPurchase(purchaseRecord1.getStatus()); - if (purchaseRecord1.getTotalMoney() != null) { - homePage.setRunPurchaseTotal(subNumberText(purchaseRecord1.getTotalMoney().toString())); - } else { - homePage.setRunPurchaseTotal("0"); - } - Stock stock = this.stockService.numberTotal("where 1=1"); - homePage.setInventory(subNumberText(stock.getNowNumber().toString())); - Stock stock1 = this.stockService.maxTotal("where 1=1"); - homePage.setInventoryMax(subNumberText(stock1.getGoodsId())); - //泵站巡检 - Stock xj2 = this.stockService.RecordTotal("where 1=1 and biz_id = '7b19e5c1efe94009b6ba777f096f4caa' "); - homePage.setPzxjs(xj2.getGoodsId()); - //已完成 - Stock xj3 = this.stockService.RecordTotal("where 1=1 and biz_id = '7b19e5c1efe94009b6ba777f096f4caa' and status = '3' "); - homePage.setPzxjsywc(xj3.getGoodsId()); - //进行中 - Stock xj4 = this.stockService.RecordTotal("where 1=1 and biz_id = '7b19e5c1efe94009b6ba777f096f4caa' and status = '2' "); - homePage.setPzxjsjxz(xj4.getGoodsId()); - //未开始 - Stock xj5 = this.stockService.RecordTotal("where 1=1 and biz_id = '7b19e5c1efe94009b6ba777f096f4caa' and status = '1'"); - homePage.setPzxjswks(xj5.getGoodsId()); - int x1 = Integer.parseInt(xj2.getGoodsId()); - int x2 = Integer.parseInt(xj3.getGoodsId()); - if (x1 != 0) { - homePage.setPzxjswcl(x2 * 100 / x1); - } else { - homePage.setPzxjswcl(0); - } - //污水厂巡检 - Stock sc2 = this.stockService.RecordTotal("where 1=1 and (biz_id = 'JB' or biz_id = 'QC' or biz_id = 'QT')"); - homePage.setWszxjs(sc2.getGoodsId()); - //已完成 - Stock sc3 = this.stockService.RecordTotal("where 1=1 and (biz_id = 'JB' or biz_id = 'QC' or biz_id = 'QT')and status = '3' "); - homePage.setWszxjsywc(sc3.getGoodsId()); - //进行中 - Stock sc4 = this.stockService.RecordTotal("where 1=1 and (biz_id = 'JB' or biz_id = 'QC' or biz_id = 'QT')and status = '2' "); - homePage.setWszxjsjxz(sc4.getGoodsId()); - //未开始 - Stock sc5 = this.stockService.RecordTotal("where 1=1 and (biz_id = 'JB' or biz_id = 'QC' or biz_id = 'QT') and status = '1'"); - homePage.setWszxjswks(sc5.getGoodsId()); - int scx1 = Integer.parseInt(sc2.getGoodsId()); - int scx2 = Integer.parseInt(sc3.getGoodsId()); - if (scx1 != 0) { - homePage.setWszxjswcl(scx2 * 100 / scx1); - } else { - homePage.setWszxjswcl(0); - } - - //合同 - Stock ht1 = this.stockService.ContractTotal("where 1=1 " + whereBiz + ""); - homePage.setHtzs(ht1.getGoodsId()); - Stock ht2 = this.stockService.ContractTotal("where 1=1 and (status != '7' or status != '6') " + whereBiz + ""); - homePage.setZqhts(ht2.getGoodsId()); - Stock ht3 = this.stockService.ContractTotal("where 1=1 and status = '6' " + whereBiz + ""); - homePage.setZxhts(ht3.getGoodsId()); - Stock ht4 = this.stockService.ContractTotal("where 1=1 and status = '7' " + whereBiz + ""); - int htx1 = Integer.parseInt(ht1.getGoodsId()); - int htx2 = Integer.parseInt(ht4.getGoodsId()); - if (htx1 != 0) { - homePage.setHtxcl(htx2 * 100 / htx1); - } else { - homePage.setHtxcl(0); - } - homePage.setHtwxcl(100 - homePage.getHtxcl()); - JSONObject fromObject = JSONObject.fromObject(homePage); - String resstr = "{\"res\":\"" + fromObject + "\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); - } - - @RequestMapping("/getoverviewProduceGroup.do") - public ModelAndView getoverviewProduceGroup(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String whereBiz = ""; - String whereBiz2 = ""; - String whereBiz3 = ""; - // System.out.println("###"+request.getParameter("biz_id")); - String bizId = null; - Company company = this.unitService.getCompById(request.getParameter("biz_id")); - if (company == null) { - company.setPid("-1"); - } - //if (request.getParameter("biz_id")!= null && !request.getParameter("biz_id").isEmpty()&& !request.getParameter("biz_id").equals("undefined")&&!"-1".equals(company.getPid())) { - if (request.getParameter("biz_id") != null && !request.getParameter("biz_id").isEmpty() && !request.getParameter("biz_id").equals("undefined")) { - whereBiz += " and biz_id = '" + request.getParameter("biz_id") + "'"; - whereBiz2 += " and bizId = '" + request.getParameter("biz_id") + "'"; - whereBiz3 += " and d.companyId = '" + request.getParameter("biz_id") + "'"; - bizId = request.getParameter("biz_id"); - } - OverviewProduceBlot homePage = new OverviewProduceBlot(); - //设备类型 - List equipmentLevels = this.equipmentLevelService.selectListByWhere("where 1=1"); - //for (EquipmentLevel equipmentLevel : equipmentLevels) { -// if("A".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalA( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"'"+ whereBiz2+"").getAssetnumber()); } -// if("B".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalB( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"' "+ whereBiz2+"").getAssetnumber()); } -// if("C".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalC( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"' "+ whereBiz2+"").getAssetnumber()); } -// -// } - homePage.setEquipmentTotalA(findDATA(bizId, "EquipmentTotalA", "3")); - homePage.setEquipmentTotalB(findDATA(bizId, "EquipmentTotalB", "3")); - homePage.setEquipmentTotalC(findDATA(bizId, "EquipmentTotalC", "3")); - String equipmentTotal = findDATA(bizId, "EquipmentTotal", "3"); - homePage.setEquipmentTotal(equipmentTotal); - //设备状态 -// List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where 1=1"); -// for (EquipmentStatusManagement equipmentStatusManagement : equipmentStatusManagements) { -// if("在用".equals(equipmentStatusManagement.getName())){ -// String equipmentin = this.homePageService.selectEquipmentTotal("where 1=1 and equipmentStatus = '"+equipmentStatusManagement.getId()+"' "+ whereBiz2+"").getAssetnumber(); -// homePage.setEquipmentTotalRun( equipmentin); -// int a = Integer.parseInt(equipmentTotal); -// int b = Integer.parseInt(equipmentin); -// if(a!=0){ -// homePage.setEquipmentIntactRate(b*100/a); -// }else{ -// homePage.setEquipmentIntactRate(0); -// } -// //System.out.println("##"+homePage.getEquipmentIntactRate()); -// } -// } - homePage.setEquipmentTotalRun(findDATA(bizId, "EquipmentTotalRun", "3")); - homePage.setEquipmentIntactRate(Integer.parseInt(findDATA(bizId, "EquipmentIntactRate", "3"))); - homePage.setEquipmentRepair(Integer.parseInt(findDATA(bizId, "EquipmentRepair", "3"))); - homePage.setEquipmentAnomaliesTotal(Integer.parseInt(findDATA(bizId, "EquipmentAnomaliesTotal", "3"))); - homePage.setEquipmentMaintain(Integer.parseInt(findDATA(bizId, "EquipmentMaintain", "3"))); - homePage.setEquipmentRunAnomalies(Integer.parseInt(findDATA(bizId, "EquipmentRunAnomalies", "3"))); - homePage.setEquipmentToAnomalies(Integer.parseInt(findDATA(bizId, "EquipmentToAnomalies", "3"))); - homePage.setYxxj(Integer.parseInt(findDATA(bizId, "Yxxj", "3"))); - homePage.setSbxj(Integer.parseInt(findDATA(bizId, "Sbxj", "3"))); - homePage.setFwmj(findDATA(bizId, "Fwmj", "3")); - homePage.setFwrk(findDATA(bizId, "Fwrk", "3")); - homePage.setZxyyclnl(findDATA(bizId, "Zxyyclnl", "3")); - homePage.setJnljclsl(findDATA(bizId, "Jnljclsl", "3")); - //设备维修 -// List maintenanceDetails = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.type=2 "+ whereBiz3+" "); -// int maintenanceDetailin=0; -// for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { -// if("1".equals(maintenanceDetail.getStatus())){ -// maintenanceDetailin = maintenanceDetailin + 1 ; -// } -// } -// if(maintenanceDetails.size()!=0){ -// homePage.setEquipmentRepair(maintenanceDetailin*100/maintenanceDetails.size()); -// }else{ -// homePage.setEquipmentRepair(0); -// } -// homePage.setEquipmentAnomaliesTotal(maintenanceDetails.size()); - //设备保养 -// List maintenanceDetails2 = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.type=1 "+ whereBiz3+" "); -// int maintenanceDetailin2=0; -// for (MaintenanceDetail maintenanceDetail : maintenanceDetails2) { -// if("1".equals(maintenanceDetail.getStatus())){ -// maintenanceDetailin2 = maintenanceDetailin2 + 1; -// } -// } -// if(maintenanceDetails2.size()!=0){ -// homePage.setEquipmentMaintain(maintenanceDetailin2*100/maintenanceDetails2.size()); -// }else{ -// homePage.setEquipmentMaintain(0); -// } -// homePage.setEquipmentRunAnomalies(0); -// homePage.setEquipmentToAnomalies(maintenanceDetails.size()); -// //运行巡检 -// Stock xj2 = this.stockService.RecordTotal("where 1=1 and type = 'P' "); -// //已完成 -// Stock sc3= this.stockService.RecordTotal("where 1=1 and type = 'P' and status = '3' "); -// -// if(Integer.parseInt(xj2.getGoodsId())!=0){ -// homePage.setYxxj(Integer.parseInt(sc3.getGoodsId())*100/ Integer.parseInt(xj2.getGoodsId())); -// }else{ -// homePage.setYxxj(0); -// } -// //设备巡检 -// Stock xj1 = this.stockService.RecordTotal("where 1=1 and type = 'E' "); -// //已完成 -// Stock sc1= this.stockService.RecordTotal("where 1=1 and type = 'E' and status = '3' "); -// -// if(Integer.parseInt(xj1.getGoodsId())!=0){ -// homePage.setSbxj(Integer.parseInt(sc1.getGoodsId())*100/ Integer.parseInt(xj1.getGoodsId())); -// }else{ -// homePage.setSbxj(0); -// } - homePage.setData(findArrayDATA(bizId, "data", "3")); - homePage.setData1(findArrayDATA(bizId, "data1", "3")); - homePage.setData2(findArrayDATA(bizId, "data2", "3")); - homePage.setData3(findArrayDATA(bizId, "data3", "3")); - homePage.setData4(findArrayDATA(bizId, "data4", "3")); - homePage.setData5(findArrayDATA(bizId, "data5", "3")); - homePage.setData6(findArrayDATA(bizId, "data6", "3")); - homePage.setData7(findArrayDATA(bizId, "data7", "3")); - - homePage.setData8(conArrayDATA(bizId, "data", "3")); - homePage.setData9(conArrayDATA(bizId, "data1", "3")); - homePage.setData10(conArrayDATA(bizId, "data2", "3")); - homePage.setData11(conArrayDATA(bizId, "data3", "3")); - homePage.setData12(conArrayDATA(bizId, "data4", "3")); - homePage.setData13(conArrayDATA(bizId, "data5", "3")); - homePage.setData14(conArrayDATA(bizId, "data6", "3")); - homePage.setData15(conArrayDATA(bizId, "data7", "3")); - homePage.setData16(findDATA(bizId, "data16", "3")); - homePage.setData17(findDATA(bizId, "data17", "3")); - homePage.setData18(findDATA(bizId, "data18", "3")); - homePage.setData19(findDATA(bizId, "data19", "3")); - homePage.setData20(findDATA(bizId, "data20", "3")); - //进水实际值 - homePage.setData21(Integer.parseInt(findDATA(bizId, "data21", "3"))); - //目标值 - homePage.setData22(Integer.parseInt(findDATA(bizId, "data22", "3"))); - //出水实际值 - homePage.setData23(Integer.parseInt(findDATA(bizId, "data23", "3"))); - //目标值 - homePage.setData24(Integer.parseInt(findDATA(bizId, "data24", "3"))); - //水量 - homePage.setData25(Integer.parseInt(findDATA(bizId, "data25", "3"))); - //最大水量 - homePage.setData26(Integer.parseInt(findDATA(bizId, "data26", "3"))); - //泥量 - homePage.setData27(Integer.parseInt(findDATA(bizId, "data27", "3"))); - //最大泥量 - homePage.setData28(Integer.parseInt(findDATA(bizId, "data28", "3"))); - //List units = unitService.getUnitChildrenById(bizId); - homePage.setData29(Integer.parseInt(findDATA(bizId, "data29", "3"))); - homePage.setData30(Integer.parseInt(findDATA(bizId, "data30", "3"))); - JSONObject fromObject = JSONObject.fromObject(homePage); - String resstr = "{\"res\":\"" + fromObject + "\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); - } - - @RequestMapping("/getoverviewProduceBlot.do") - public ModelAndView getoverviewProduceBlot(HttpServletRequest request, Model model - - ) { - User cu = (User) request.getSession().getAttribute("cu"); - String whereBiz = ""; - String whereBiz2 = ""; - String whereBiz3 = ""; - // System.out.println("###"+request.getParameter("biz_id")); - String bizId = null; - if (request.getParameter("biz_id") != null && !request.getParameter("biz_id").isEmpty() && !request.getParameter("biz_id").equals("undefined")) { - whereBiz += " and biz_id = '" + request.getParameter("biz_id") + "'"; - whereBiz2 += " and bizId = '" + request.getParameter("biz_id") + "'"; - whereBiz3 += " and d.companyId = '" + request.getParameter("biz_id") + "'"; - bizId = request.getParameter("biz_id"); - } - OverviewProduceBlot homePage = new OverviewProduceBlot(); - //设备类型 - List equipmentLevels = this.equipmentLevelService.selectListByWhere("where 1=1"); -// for (EquipmentLevel equipmentLevel : equipmentLevels) { -// if("A".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalA( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"'"+ whereBiz2+"").getAssetnumber()); } -// if("B".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalB( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"' "+ whereBiz2+"").getAssetnumber()); } -// if("C".equals(equipmentLevel.getLevelname())){homePage.setEquipmentTotalC( this.homePageService.selectEquipmentTotal("where 1=1 and equipmentLevelId = '"+equipmentLevel.getId()+"' "+ whereBiz2+"").getAssetnumber()); } -// -// } - homePage.setEquipmentTotalA(findDATA(bizId, "EquipmentTotalA", "2")); - homePage.setEquipmentTotalB(findDATA(bizId, "EquipmentTotalB", "2")); - homePage.setEquipmentTotalC(findDATA(bizId, "EquipmentTotalC", "2")); - String equipmentTotal = findDATA(bizId, "EquipmentTotal", "2"); - homePage.setEquipmentTotal(equipmentTotal); - //设备状态 -// List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where 1=1"); -// for (EquipmentStatusManagement equipmentStatusManagement : equipmentStatusManagements) { -// if("在用".equals(equipmentStatusManagement.getName())){ -// String equipmentin = this.homePageService.selectEquipmentTotal("where 1=1 and equipmentStatus = '"+equipmentStatusManagement.getId()+"' "+ whereBiz2+"").getAssetnumber(); -// homePage.setEquipmentTotalRun( equipmentin); -// int a = Integer.parseInt(equipmentTotal); -// int b = Integer.parseInt(equipmentin); -// if(a!=0){ -// homePage.setEquipmentIntactRate(b*100/a); -// }else{ -// homePage.setEquipmentIntactRate(0); -// } -// //System.out.println("##"+homePage.getEquipmentIntactRate()); -// } -// } - homePage.setEquipmentTotalRun(findDATA(bizId, "EquipmentTotalRun", "2")); - homePage.setEquipmentIntactRate(Integer.parseInt(findDATA(bizId, "EquipmentIntactRate", "2"))); - homePage.setEquipmentRepair(Integer.parseInt(findDATA(bizId, "EquipmentRepair", "2"))); - homePage.setEquipmentAnomaliesTotal(Integer.parseInt(findDATA(bizId, "EquipmentAnomaliesTotal", "2"))); - homePage.setEquipmentMaintain(Integer.parseInt(findDATA(bizId, "EquipmentMaintain", "2"))); - homePage.setEquipmentRunAnomalies(Integer.parseInt(findDATA(bizId, "EquipmentRunAnomalies", "2"))); - homePage.setEquipmentToAnomalies(Integer.parseInt(findDATA(bizId, "EquipmentToAnomalies", "2"))); - homePage.setYxxj(Integer.parseInt(findDATA(bizId, "Yxxj", "2"))); - homePage.setSbxj(Integer.parseInt(findDATA(bizId, "Sbxj", "2"))); - homePage.setFwmj(findDATA(bizId, "Fwmj", "2")); - homePage.setFwrk(findDATA(bizId, "Fwrk", "2")); - homePage.setZxyyclnl(findDATA(bizId, "Zxyyclnl", "2")); - homePage.setJnljclsl(findDATA(bizId, "Jnljclsl", "2")); -// //设备维修 -// List maintenanceDetails = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.type=2 "+ whereBiz3+" "); -// int maintenanceDetailin=0; -// for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { -// if("1".equals(maintenanceDetail.getStatus())){ -// maintenanceDetailin = maintenanceDetailin + 1 ; -// } -// } -// if(maintenanceDetails.size()!=0){ -// homePage.setEquipmentRepair(maintenanceDetailin*100/maintenanceDetails.size()); -// }else{ -// homePage.setEquipmentRepair(0); -// } -// homePage.setEquipmentAnomaliesTotal(maintenanceDetails.size()); -// //设备保养 -// List maintenanceDetails2 = this.maintenanceDetailService.selectListWithMaintenanceByWhere("where 1=1 and d.type=1 "+ whereBiz3+" "); -// int maintenanceDetailin2=0; -// for (MaintenanceDetail maintenanceDetail : maintenanceDetails2) { -// if("1".equals(maintenanceDetail.getStatus())){ -// maintenanceDetailin2 = maintenanceDetailin2 + 1; -// } -// } -// if(maintenanceDetails2.size()!=0){ -// homePage.setEquipmentMaintain(maintenanceDetailin2*100/maintenanceDetails2.size()); -// }else{ -// homePage.setEquipmentMaintain(0); -// } -// homePage.setEquipmentRunAnomalies(0); -// homePage.setEquipmentToAnomalies(maintenanceDetails.size()); -// //运行巡检 -// Stock xj2 = this.stockService.RecordTotal("where 1=1 and type = 'P' "); -// //已完成 -// Stock sc3= this.stockService.RecordTotal("where 1=1 and type = 'P' and status = '3' "); -// -// if(Integer.parseInt(xj2.getGoodsId())!=0){ -// homePage.setYxxj(Integer.parseInt(sc3.getGoodsId())*100/ Integer.parseInt(xj2.getGoodsId())); -// }else{ -// homePage.setYxxj(0); -// } -// //设备巡检 -// Stock xj1 = this.stockService.RecordTotal("where 1=1 and type = 'E' "); -// //已完成 -// Stock sc1= this.stockService.RecordTotal("where 1=1 and type = 'E' and status = '3' "); -// -// if(Integer.parseInt(xj1.getGoodsId())!=0){ -// homePage.setSbxj(Integer.parseInt(sc1.getGoodsId())*100/ Integer.parseInt(xj1.getGoodsId())); -// }else{ -// homePage.setSbxj(0); -// } - homePage.setData(findArrayDATA(bizId, "data", "2")); - homePage.setData1(findArrayDATA(bizId, "data1", "2")); - homePage.setData2(findArrayDATA(bizId, "data2", "2")); - homePage.setData3(findArrayDATA(bizId, "data3", "2")); - homePage.setData4(findArrayDATA(bizId, "data4", "2")); - homePage.setData5(findArrayDATA(bizId, "data5", "2")); - homePage.setData6(findArrayDATA(bizId, "data6", "2")); - homePage.setData7(findArrayDATA(bizId, "data7", "2")); - homePage.setData8(conArrayDATA(bizId, "data", "2")); - homePage.setData9(conArrayDATA(bizId, "data1", "2")); - homePage.setData10(conArrayDATA(bizId, "data2", "2")); - homePage.setData11(conArrayDATA(bizId, "data3", "2")); - homePage.setData12(conArrayDATA(bizId, "data4", "2")); - homePage.setData13(conArrayDATA(bizId, "data5", "2")); - homePage.setData14(conArrayDATA(bizId, "data6", "2")); - homePage.setData15(conArrayDATA(bizId, "data7", "2")); - homePage.setData16(findDATA(bizId, "data16", "2")); - homePage.setData17(findDATA(bizId, "data17", "2")); - homePage.setData18(findDATA(bizId, "data18", "2")); - homePage.setData19(findDATA(bizId, "data19", "2")); - homePage.setData20(findDATA(bizId, "data20", "2")); - homePage.setFwmj(findDATA(bizId, "Fwmj", "2")); - homePage.setFwrk(findDATA(bizId, "Fwrk", "2")); - homePage.setZxyyclnl(findDATA(bizId, "Zxyyclnl", "2")); - homePage.setJnljclsl(findDATA(bizId, "Jnljclsl", "2")); - //进水实际值 - homePage.setData21(Integer.parseInt(findDATA(bizId, "data21", "2"))); - //目标值 - homePage.setData22(Integer.parseInt(findDATA(bizId, "data22", "2"))); - //出水实际值 - homePage.setData23(Integer.parseInt(findDATA(bizId, "data23", "2"))); - //目标值 - homePage.setData24(Integer.parseInt(findDATA(bizId, "data24", "2"))); - //水量 - homePage.setData25(Integer.parseInt(findDATA(bizId, "data25", "2"))); - //最大水量 - homePage.setData26(Integer.parseInt(findDATA(bizId, "data26", "2"))); - //泥量 - homePage.setData27(Integer.parseInt(findDATA(bizId, "data27", "2"))); - //最大泥量 - homePage.setData28(Integer.parseInt(findDATA(bizId, "data28", "2"))); - //List units = unitService.getUnitChildrenById(bizId); - homePage.setData29(Integer.parseInt(findDATA(bizId, "data29", "2"))); - homePage.setData30(Integer.parseInt(findDATA(bizId, "data30", "2"))); - JSONObject fromObject = JSONObject.fromObject(homePage); - String resstr = "{\"res\":\"" + fromObject + "\"}"; - model.addAttribute("result", fromObject); - - return new ModelAndView("result"); - } - - /** - * 集团生产运行总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewProduceGroup.do") - public String overviewProduceGroup(HttpServletRequest request, Model model) { - return "/work/overviewProduceGroup"; - } - - @RequestMapping("/overviewProduceGroupBlack.do") - public String overviewProduceGroupBlack(HttpServletRequest request, Model model) { - return "/work/overviewProduceGroupBlack"; - } - //获取实际水量 - - @RequestMapping("/getValue4Group.do") - public String getValue4Group(HttpServletRequest request, Model model) { - List list = this.jspElementService.selectListByWhere("where pid='集团' order by morder"); - String bizId = request.getParameter("bizId"); - JSONArray jsonArray = new JSONArray(); - int res = 0; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - jsonArray.add(i, getValueService.getCacheDataByJspElement(list.get(i), list.get(i).getUnitId())); - } - res = list.size(); - } - String result = "{\"res\":" + res + ",\"rows\":" + jsonArray + "}"; - request.setAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistOverview.do") - public String showlistOverview(HttpServletRequest request, Model model) { -// System.out.println("###" + request.getParameter("biz_id")); - String wherestrCode = ""; - if (request.getParameter("biz_id") != null && !request.getParameter("biz_id").isEmpty() && !request.getParameter("biz_id").equals("undefined")) { - wherestrCode += " and (id = '" + request.getParameter("biz_id") + "' or pid = '" + request.getParameter("biz_id") + "') "; - - } - List companylistm = this.unitService.getCompaniesByWhere("where 1=1 " + wherestrCode + " "); - List jsonarray = new ArrayList(); - if (companylistm != null) { - int size = 0; - for (int i = 0; i < companylistm.size(); i++) { - List Stocks = this.stockService.StocktypeTotal(" where biz_id = '" + companylistm.get(i).getId() + "' GROUP BY b.class_id"); - if (Stocks != null && Stocks.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("companyId", companylistm.get(i).getId()); - jsonObject.put("companyName", companylistm.get(i).getName()); - jsonarray.add(jsonObject); - size = size + 1; - } - } - request.setAttribute("companySize", size); - request.setAttribute("companyList", jsonarray); - } - return "/work/materialDeployOverview"; - } - - @RequestMapping("/showthelistOverview.do") - public String getlistOverview(HttpServletRequest request, Model model) { - return "/work/materverview"; - } - - @RequestMapping("/getEchartData.do") - public String getEchartData(HttpServletRequest request, Model model) throws UnsupportedEncodingException { - //List companylistm = this.unitService.getCompaniesByWhere("where 1=1 "); - String biz_id = request.getParameter("id");//厂区id - String typeId = request.getParameter("typeId");//物资大类id - String typeIdDetail = request.getParameter("typeIdDetail");//物资小类id - String searchName = java.net.URLDecoder.decode(request.getParameter("searchName"), "utf-8");//设备名称模糊搜索 - String searchName1 = java.net.URLDecoder.decode(request.getParameter("searchName1"), "utf-8"); - String searchName2 = java.net.URLDecoder.decode(request.getParameter("searchName2"), "utf-8"); - String wherestrCode = ""; - //设备类别搜索 - if (typeIdDetail != null && !"undefined".equals(typeIdDetail) && !typeIdDetail.equals("bx2") && !"".equals(typeIdDetail)) { - wherestrCode += " and b.class_id = '" + typeIdDetail + "' "; - } else if (typeId != null && !"undefined".equals(typeId) && !typeId.equals("bx1") && !"".equals(typeId)) { - wherestrCode += " and c.pid = '" + typeId + "' "; - } - - if (searchName != null && !"undefined".equals(searchName) && !searchName.equals("")) { - wherestrCode += " and b.name like '%" + searchName + "%' "; - } - if (searchName1 != null && !"undefined".equals(searchName1) && !searchName1.equals("")) { - if (searchName2 != null && !"undefined".equals(searchName2) && !searchName2.equals("")) { - wherestrCode += " and a.cost_price BETWEEN '" + searchName1 + "' and '" + searchName2 + "' "; - } else { - wherestrCode += " and a.cost_price >='" + searchName1 + "' "; - } - } else if (searchName2 != null && !"undefined".equals(searchName2) && !searchName2.equals("")) { - wherestrCode += " and a.cost_price <='" + searchName2 + "' "; - } - - List jsonarray = new ArrayList(); - List Stocks = this.stockService.StocktypeTotal(" where biz_id = '" + biz_id + "' " + wherestrCode + " GROUP BY b.class_id"); - if (Stocks != null && Stocks.size() > 0) { - for (Stock stock : Stocks) { - List goods = this.goodsClassService.selectListByWhere("where 1 = 1 and id = '" + stock.get_fid() + "'"); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("fnum", stock.get_fnum()); - if (stock.get_fprice() != null) { - jsonObject.put("fprice", stock.get_fprice()); - } else { - jsonObject.put("fprice", 0); - } - jsonObject.put("fid", stock.get_fid()); - jsonObject.put("fname", goods.get(0).getName()); - jsonarray.add(jsonObject); - } - } - request.setAttribute("result", jsonarray); - - - return "result"; - } - - /** - * 区域生产运行总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewProduceBlot.do") - public String overviewProduceBlot(HttpServletRequest request, Model model) { - return "/work/overviewProduceBlot"; - } - - @RequestMapping("/overviewProduceBlotBlack.do") - public String overviewProduceBlotBlack(HttpServletRequest request, Model model) { - return "/work/overviewProduceBlotBlack"; - } - - /** - * 巡检管理总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewInspection.do") - public String overviewInspection(HttpServletRequest request, Model model) { - String rptdt = CommUtil.nowDate().substring(0, 7); - request.setAttribute("datestr", rptdt + ""); - return "/work/overviewInspection"; - } - - /** - * 设备管理总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewEquipment.do") - public String overviewEquipment(HttpServletRequest request, Model model) { - return "/work/overviewEquipment"; - } - - /** - * 生产管理总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewManagement.do") - public String overviewManagement(HttpServletRequest request, Model model) { - return "/work/overviewManagement"; - } - - /** - * 实时监控总览 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/overviewMonitor.do") - public String overviewMonitor(HttpServletRequest request, Model model) { - return "/work/overviewMonitor"; - } - - public String subNumberText(String result) { - - if (result == null) { - return ""; - } - if (result.contains(".")) {// 是小数 - while (true) { - if (result.charAt(result.length() - 1) == '0') { - result = result.substring(0, result.length() - 1); - } else { - if (result.endsWith(".")) { - result = result.substring(0, result.length() - 1); - } - break; - } - - } - - } - return result; - } - - /* - * 生成折线所需的数据 - */ - public ArrayList conArrayDATA1(String bizId, String data_number, String page_nub) { - String wherestr = "where 1=1"; - - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and data_number = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and page_nub = '" + page_nub + "' "; - } - List companys = this.unitService.getCompaniesByWhere("where pid = '" + bizId + "'"); - ArrayList wscll = new ArrayList<>(); - int b = 1; - for (Company company : companys) { - BigDecimal parmvalue = new BigDecimal(0); - if (company != null && companys.size() != 0) { - wherestr += " and biz_id = '" + company.getId() + "' "; - } - ArrayList list = new ArrayList<>(); - list.add(company.getEname()); - List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - for (MeasurePoint_DATA measurePoint_DATA : measurePoint_DATAs) { - List mPoints = this.mPointService.selectListByWhere(bizId, "where 1=1 and MPointCode = '" + measurePoint_DATA.getMpointcode() + "' "); - if (mPoints.size() != 0) { - for (MPoint mPoint : mPoints) { - parmvalue = parmvalue.add(mPoint.getParmvalue()); - } - } - } - list.add(subNumberText(parmvalue.toString())); - wscll.add(list); - b = b + 1; - } - - return wscll; - } - - public ArrayList conArrayDATA(String bizId, String data_number, String page_nub) { - /*if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and pid = '" + page_nub + "' "; - }*/ - - List companys = this.unitService.getCompaniesByWhere("where pid = '" + bizId + "'"); - ArrayList wscll = new ArrayList<>(); - int b = 1; - for (Company company : companys) { - String wherestr = "where 1=1"; - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and element_code = '" + data_number + "' "; - } - BigDecimal parmvalue = new BigDecimal(0); - if (company != null && companys.size() != 0) { - wherestr += " and unit_id = '" + company.getId() + "' "; - } - ArrayList list = new ArrayList<>(); - list.add(company.getSname()); - // List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - List jspElements = this.jspElementService.selectListByWhere(wherestr); - - for (JspElement jspElement : jspElements) { - List visualCacheDatas = getValueService.getAllCacheDataByJspElement(jspElement, company.getId()); - for (VisualCacheData visualCacheData : visualCacheDatas) { - if (visualCacheData.getValue() != null && visualCacheData.getValue() > 0) { - parmvalue = parmvalue.add(new BigDecimal(visualCacheData.getValue())); - } else { - List mPoints = this.mPointService.selectListByWhere(company.getId(), "where 1=1 and MPointCode = '" + visualCacheData.getMpcode() + "' "); - if (mPoints.size() != 0) { - for (MPoint mPoint : mPoints) { - parmvalue = parmvalue.add(mPoint.getParmvalue()); - } - } - } - } - } - list.add(subNumberText(parmvalue.setScale(2, BigDecimal.ROUND_HALF_UP).toString())); - wscll.add(list); - b = b + 1; - } - - return wscll; - } - - public String aDATA(String bizId, String table) { - List mPoints = this.mPointService.selectListByWhere(bizId, "where 1=1 and MPointCode = '" + table + "' "); - if (mPoints.size() != 0) { - return subNumberText(mPoints.get(0).getParmvalue().toString()); - } else { - return ""; - } - } - - public String findDATA(String bizId, String data_number, String page_nub) { - Double parmvalue = new Double(0); - String wherestr = "where 1=1"; - if (bizId != null && !bizId.isEmpty()) { - wherestr += " and unit_id = '" + bizId + "' "; - } - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and element_code = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and pid = '" + page_nub + "' "; - } - List jspElements = this.jspElementService.selectListByWhere(wherestr); - - //List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - for (JspElement jspElement : jspElements) { - List visualCacheDatas = getValueService.getAllCacheDataByJspElement(jspElement, bizId); - // List mPoints = this.mPointService.selectListByWhere(bizId,"where 1=1 and MPointCode = '"+measurePoint_DATA.getMpointcode()+"' "); - if (visualCacheDatas.size() != 0) { - for (VisualCacheData visualCacheData : visualCacheDatas) { - parmvalue = parmvalue + visualCacheData.getValue(); - } - } - } - - - return subNumberText(parmvalue.toString()); - } - - public String findDATA1(String bizId, String data_number, String page_nub) { - BigDecimal parmvalue = new BigDecimal(0); - String wherestr = "where 1=1"; - if (bizId != null && !bizId.isEmpty()) { - wherestr += " and biz_id = '" + bizId + "' "; - } - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and data_number = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and page_nub = '" + page_nub + "' "; - } - List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - for (MeasurePoint_DATA measurePoint_DATA : measurePoint_DATAs) { - List mPoints = this.mPointService.selectListByWhere(bizId, "where 1=1 and MPointCode = '" + measurePoint_DATA.getMpointcode() + "' "); - if (mPoints.size() != 0) { - for (MPoint mPoint : mPoints) { - parmvalue = parmvalue.add(mPoint.getParmvalue()); - } - } - } - - - return subNumberText(parmvalue.toString()); - } - - public ArrayList findArrayEquDATA(String bizId, String data_number, String page_nub) { - ArrayList listDATA = new ArrayList<>(); - - return listDATA; - } - - @RequestMapping("/getStockDetail.do") - public String getStockDetail(HttpServletRequest request, Model model) { - String id = request.getParameter("id");//设备大类id - - //查询所有设备大类 - List equipmentTypeList = this.goodsClassService.selectListByWhere(" where pid='" + id + "' order by morder"); - List jsonarray = new ArrayList(); - if (equipmentTypeList != null) { - for (int i = 0; i < equipmentTypeList.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("stockTypeId", equipmentTypeList.get(i).getId()); - jsonObject.put("stockTypeName", equipmentTypeList.get(i).getName()); - jsonarray.add(jsonObject); - } - } - request.setAttribute("result", jsonarray); - return "result"; - } - - @RequestMapping("/getStockType.do") - public String getStockType(HttpServletRequest request, Model model) { - //查询所有设备大类 - List equipmentTypeList = this.goodsClassService.selectListByWhere(" where pid='-1' order by morder asc"); - List jsonarray = new ArrayList(); - if (equipmentTypeList != null) { - for (int i = 0; i < equipmentTypeList.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("stockTypeId", equipmentTypeList.get(i).getId()); - jsonObject.put("stockTypeName", equipmentTypeList.get(i).getName()); - jsonarray.add(jsonObject); - } - } - request.setAttribute("result", jsonarray); - return "result"; - } - - public ArrayList findArrayDATA(String bizId, String data_number, String page_nub) { - Date date = new Date(); - int hours = date.getHours(); - //System.out.println(hours); - String wherestr = "where 1=1"; - if (bizId != null && !bizId.isEmpty()) { - wherestr += " and unit_id = '" + bizId + "' "; - } - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and element_code = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and pid = '" + page_nub + "' "; - } - List jspElements = this.jspElementService.selectListByWhere(wherestr); - ArrayList wscll = new ArrayList<>(); - //List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - - //System.out.println("jspElements"+jspElements.get(0).getElementCode()); - for (JspElement jspElement : jspElements) { - //List visualCacheDatas = getValueService.getAllCacheDataByJspElement(jspElement, bizId); - - - BigDecimal parmvalue = new BigDecimal(0); - List mPointHistories = null; - mPointHistories = this.getValueService.getAll7dayHistoryByJspElement(jspElement, jspElement.getUnitId2()); - //measurePoint_DATA.setmPointHistories(mPointHistories); - - if (mPointHistories != null && mPointHistories.size() != 0) { - for (MPointHistory mPointHistory : mPointHistories) { - ArrayList list = new ArrayList<>(); - parmvalue = mPointHistory.getParmvalue(); - list.add(mPointHistory.getMeasuredt().substring(5, 10)); - - list.add(subNumberText(parmvalue.toString())); - wscll.add(list); - } - - } - - - } - return wscll; - } - - public ArrayList findArrayDATA1(String bizId, String data_number, String page_nub) { - Date date = new Date(); - int hours = date.getHours(); - //System.out.println(hours); - String wherestr = "where 1=1"; - if (bizId != null && !bizId.isEmpty()) { - wherestr += " and biz_id = '" + bizId + "' "; - } - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and data_number = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and page_nub = '" + page_nub + "' "; - } - ArrayList wscll = new ArrayList<>(); - List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - - - for (MeasurePoint_DATA measurePoint_DATA : measurePoint_DATAs) { - for (int i = hours; i >= 0; i--) { - ArrayList list = new ArrayList<>(); - list.add(String.valueOf(i) + ":00"); - BigDecimal parmvalue = new BigDecimal(0); - List mPointHistories = this.mPointHistoryService.selectTop1RecordPerHour1(bizId, "TB_MP_" + measurePoint_DATA.getMpointcode(), " and DateDiff(dd,MeasureDT,getdate())=0 and DATEPART(hh,t.MeasureDT) =" + i + " ", " TOP " + hours + " "); - //measurePoint_DATA.setmPointHistories(mPointHistories); - if (mPointHistories.size() != 0) { - for (MPointHistory mPointHistory : mPointHistories) { - parmvalue = parmvalue.add(mPointHistory.getParmvalue()); - } - list.add(subNumberText(parmvalue.toString())); - } - wscll.add(list); - } - - } - return wscll; - } - - @RequestMapping("/getMpointData.do") - public String getMpointData(HttpServletRequest request, Model model) { - - String bizid = request.getParameter("unitId"); - String pid = request.getParameter("pid"); - - List jspElements = this.jspElementService.selectListByWhere("where unit_id = '" + bizid + "' and pid = '" + pid + "'"); - JSONArray mpcodelistArray = new JSONArray(); - if (jspElements != null && jspElements.size() > 0) { - String mpcodes = ""; - for (int i = 0; i < jspElements.size(); i++) { - JSONObject jsonObject = new JSONObject(); - MPoint mPoint = this.mPointService.selectById(bizid, jspElements.get(i).getElementCode()); // - if (mPoint != null) { - jsonObject.put("mpcode", jspElements.get(i).getElementCode()); - jsonObject.put("mpname", jspElements.get(i).getName()); - jsonObject.put("mpvalue", mPoint.getParmvalue()); - jsonObject.put("unit", mPoint.getUnit()); - } else { - jsonObject.put("mpcode", jspElements.get(i).getElementCode()); - jsonObject.put("mpname", jspElements.get(i).getName()); - jsonObject.put("mpvalue", 0); - jsonObject.put("unit", ""); - } - mpcodelistArray.add(jsonObject); - } - } else { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("mpcode", ""); - jsonObject.put("mpname", "等待配置相关点位"); - jsonObject.put("mpvalue", 0); - jsonObject.put("unit", ""); - mpcodelistArray.add(jsonObject); - } - - model.addAttribute("result", mpcodelistArray); - return "result"; - } - - @RequestMapping("/getEquData.do") - public String getEquData(HttpServletRequest request, Model model) { - - String bizid = request.getParameter("unitId"); - - JSONObject equObject = new JSONObject(); - - List equipmentCards = this.equipmentcardService.selectListByWhere("where 1=1 "); - List equipmentCardsA = this.equipmentcardService.selectListByWhere("where 1=1 and equipmentlevelid = 'A'"); - List equipmentCardsB = this.equipmentcardService.selectListByWhere("where 1=1 and equipmentlevelid = 'B'"); - List equipmentCardsC = this.equipmentcardService.selectListByWhere("where 1=1 and equipmentlevelid = 'C'"); - if (equipmentCards != null && equipmentCards.size() > 0) { - equObject.put("equAllNum", equipmentCards.size()); -// int A = 0; -// int B = 0; -// int C = 0; -// for(int i = 0;i list = this.mPointService.getList4Layer(unitId, wherestr + orderstr); - for (MPoint item : list) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(item.getEquipmentid()); - item.setEquipmentCard(equipmentCard); - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /* - * 按工艺段 - */ - @RequestMapping("/getTreeFomProcessSection.do") - public String getTreeFomProcessSection(HttpServletRequest request, Model model) { - JSONArray json = new JSONArray(); - String unitId = request.getParameter("unitId"); - String mpsearchname = request.getParameter("mpsearchname"); - String signalType = request.getParameter("signalType"); - String sourceType = request.getParameter("sourceType"); - String pSectionId = request.getParameter("pSectionId"); - - String processSectionsIds = ""; - - String whereString = " where 1=1 and unit_id='" + unitId + "' "; - if (pSectionId != null && pSectionId.length() > 0) { - whereString += " and code='" + pSectionId + "' "; - } - - String whereMpString = " where 1=1 "; - if (mpsearchname != null && mpsearchname.length() > 0) { - whereMpString += " and (parmname like '%" + mpsearchname + "%' )";//or mpointcode like '%" + mpsearchname + "%' - } - if (signalType != null && !signalType.isEmpty()) { - if (!signalType.equals("-1")) {//-1为全部 - whereMpString += " and SignalType ='" + request.getParameter("signalType") + "' "; - } - } - if (sourceType != null && !sourceType.isEmpty()) { - if (!sourceType.equals("-1")) {//-1为全部 - whereMpString += " and source_type ='" + request.getParameter("sourceType") + "' "; - } - } - - List processSections = this.processSectionService.selectListByWhere(whereString + " order by code asc"); - if (processSections != null && processSections.size() > 0) { - for (int i = 0; i < processSections.size(); i++) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - - List mPoints = this.mPointService.selectListByWhere(unitId, whereMpString + " and processSectionCode='" + processSections.get(i).getCode() + "' and active='启用' "); - JSONArray jsonD = new JSONArray(); - if (mPoints != null && mPoints.size() > 0) { - for (int j = 0; j < mPoints.size(); j++) { - com.alibaba.fastjson.JSONObject jsonObjectD = new com.alibaba.fastjson.JSONObject(); - jsonObjectD.put("id", mPoints.get(j).getId()); - jsonObjectD.put("text", mPoints.get(j).getParmname()); - jsonObjectD.put("type", "l2"); - jsonObjectD.put("bizid", unitId); -// jsonObject.put("icon", "fa fa-th-large"); - jsonD.add(jsonObjectD); - } - jsonObject.put("nodes", jsonD); - } - if (jsonD != null && jsonD.size() > 0) { - jsonObject.put("id", processSections.get(i).getId()); - processSectionsIds += processSections.get(i).getId() + ","; - jsonObject.put("text", processSections.get(i).getName()); - jsonObject.put("icon", "fa fa-th-large"); - jsonObject.put("type", "l1"); - - json.add(jsonObject); - } - - } - } - - if (pSectionId.equals("")) { -// processSectionsIds = processSectionsIds.replace(",", "','");//or processSectionCode not in ('" + processSectionsIds + "') - List mPoints = this.mPointService.selectListByWhere(unitId, whereMpString + " and active='启用' and (processSectionCode is null ) "); - if (mPoints != null && mPoints.size() > 0) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - - JSONArray jsonD = new JSONArray(); - for (int j = 0; j < mPoints.size(); j++) { - com.alibaba.fastjson.JSONObject jsonObjectD = new com.alibaba.fastjson.JSONObject(); - jsonObjectD.put("id", mPoints.get(j).getId()); - jsonObjectD.put("text", mPoints.get(j).getParmname()); - jsonObjectD.put("type", "l2"); - jsonObjectD.put("bizid", unitId); -// jsonObject.put("icon", "fa fa-th-large"); - jsonD.add(jsonObjectD); - } - - if (jsonD != null && jsonD.size() > 0) { - jsonObject.put("nodes", jsonD); - jsonObject.put("id", "999"); - jsonObject.put("text", "其他"); - jsonObject.put("icon", "fa fa-th-large"); - jsonObject.put("type", "l1"); - - json.add(jsonObject); - } - - } - } - - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 通用 查询测量点最新值 - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValue.do") - public String getValue(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - - MPoint mPoint = this.mPointService.selectById(unitId, mpointCode); // - Object obj = com.alibaba.fastjson.JSONArray.toJSON(mPoint); - String json = null; - if (obj != null) { - json = obj.toString(); - } - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getValue2.do") - public String getValue2(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "data_number") String data_number, - @RequestParam(value = "page_nub") String page_nub) { - - String nowtime = CommUtil.nowDate(); -// String nowtime = "2021-08-10 13:19:19"; - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(nowtime.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(nowtime.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - - BigDecimal parmvalue = new BigDecimal(0); - String wherestr = "where 1=1"; - if (bizId != null && !bizId.isEmpty()) { - wherestr += " and biz_id = '" + bizId + "' "; - } - if (data_number != null && !data_number.isEmpty()) { - wherestr += " and data_number = '" + data_number + "' "; - } - if (page_nub != null && !page_nub.isEmpty()) { - wherestr += " and page_nub = '" + page_nub + "' "; - } - JSONObject jsonObject = new JSONObject(); - List datalisttime = new ArrayList(); - for (int i = 0; i < maxDateM; i++) { - datalisttime.add(String.valueOf(i)); - - } - jsonObject.put("value", datalisttime); - List measurePoint_DATAs = this.measurePoint_DATAService.selectListByWhere(wherestr); - int inub = 0; - for (MeasurePoint_DATA measurePoint_DATA : measurePoint_DATAs) { - - //String mpcodeString = measurePoint_DATA.getMpointcode(); - List datalist = new ArrayList(); - for (int i = 0; i < maxDateM; i++) { - - List mPointHistories = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + measurePoint_DATA.getMpointcode(), "where MeasureDT BETWEEN '" + nowtime.substring(0, 7) + "-" + (i + 1) + "' AND dateadd(second,-1,dateadd(day,1,'" + nowtime.substring(0, 7) + "-" + (i + 1) + "')) "); - BigDecimal parmvalue1 = new BigDecimal(0); - for (MPointHistory mPointHistory : mPointHistories) { - parmvalue1 = parmvalue1.add(mPointHistory.getParmvalue()); - } - datalist.add(String.valueOf(parmvalue1)); - - } - jsonObject.put("value" + inub, datalist); - inub = inub + 1; - } - model.addAttribute("result", jsonObject); - return "result"; - } - - /** - * 通用 查询测量点最新值 -- es - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValue4Es.do") - public String getValue4Es(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - - MPoint mPoint = this.mPointService.selectById(mpointCode); // - Object obj = com.alibaba.fastjson.JSONArray.toJSON(mPoint); - String json = null; - if (obj != null) { - json = obj.toString(); - } - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取每日数据--柱状图 - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - /*@RequestMapping("/getValueDayColumnar.do") - public String getValueDayColumnar(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - String nowtime = CommUtil.nowDate(); - nowtime = "2021-03-23 00:00:00"; - List datalist = new ArrayList(); - for (int i = 0; i < 24; i++) { - String sdt = nowtime.substring(0,10)+" "+i+":"+"00:00"; - List list = mPointHistoryService.selectListByTableAWhere(unitId,"TB_MP_"+mpointCode,"where MeasureDT = '"+sdt+"'"); - if(list!=null && list.size()>0){ - datalist.add(list.get(0).getParmvalue()); - } - } - String result = "{\"name\":" + 123 + ",\"datalist\":" + datalist + "}"; - model.addAttribute("result", result); - return "result"; - }*/ - - /** - * 获取天的数据(24小时)--折现图 - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValueDay.do") - public String getValueDay(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - String nowtime = CommUtil.nowDate(); -// nowtime = "2021-03-23 00:00:00"; - List datalist = new ArrayList(); - for (int i = 0; i < 24; i++) { - String sdt = nowtime.substring(0, 10) + " " + i + ":" + "00:00"; - List list = mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + mpointCode, "where MeasureDT = '" + sdt + "'"); - if (list != null && list.size() > 0) { - datalist.add(list.get(0).getParmvalue()); - } - } - List minlist = new ArrayList(); - List maxlist = new ArrayList(); - String mpname = ""; - MPoint mPoint = mPointService.selectById(unitId, mpointCode); - if (mPoint != null) { - if (mPoint.getAlarmmin() != null && !mPoint.getAlarmmin().equals("")) { - for (int i = 0; i < 24; i++) { - minlist.add(mPoint.getAlarmmin()); - } - } else { - for (int i = 0; i < 24; i++) { - BigDecimal val = new BigDecimal(0); - minlist.add(val); - } - } - if (mPoint.getAlarmmax() != null && !mPoint.getAlarmmax().equals("")) { - for (int i = 0; i < 24; i++) { - maxlist.add(mPoint.getAlarmmax()); - } - } else { - for (int i = 0; i < 24; i++) { - BigDecimal val = new BigDecimal(0); - maxlist.add(val); - } - } - mpname = mPoint.getParmname(); - } - String result = "{\"name\":\"" + mpname + "\",\"datalist\":" + datalist + ",\"minlist\":" + minlist + ",\"maxlist\":" + maxlist + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取月的数据(31天)--折现图 - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValueMonth.do") - public String getValueMonth(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - String nowtime = CommUtil.nowDate(); - List datalist = new ArrayList(); - - //通过es查询bizid - MPoint mPoint_es = mPointService.selectById(mpointCode); - if (mPoint_es != null) { - unitId = mPoint_es.getBizid(); - } - - int days = CommUtil.getDaysByYearMonth(Integer.parseInt(nowtime.substring(0, 4)), Integer.parseInt(nowtime.substring(5, 7))); - for (int i = 0; i < days; i++) { - String sdt = nowtime.substring(0, 7) + "-" + (i + 1); - List list = mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + mpointCode, "where DateDiff(dd,MeasureDT,'" + sdt + "')=0"); - if (list != null && list.size() > 0) { - datalist.add(list.get(0).getParmvalue()); - } else { - datalist.add(new BigDecimal("0")); - } - } - List minlist = new ArrayList(); - List maxlist = new ArrayList(); - String mpname = ""; - MPoint mPoint = mPointService.selectById(unitId, mpointCode); - if (mPoint != null) { - if (mPoint.getAlarmmin() != null && !mPoint.getAlarmmin().equals("")) { - for (int i = 0; i < 31; i++) { - minlist.add(mPoint.getAlarmmin()); - } - } else { - for (int i = 0; i < 31; i++) { - BigDecimal val = new BigDecimal(0); - minlist.add(val); - } - } - if (mPoint.getAlarmmax() != null && !mPoint.getAlarmmax().equals("")) { - for (int i = 0; i < 31; i++) { - maxlist.add(mPoint.getAlarmmax()); - } - } else { - for (int i = 0; i < 31; i++) { - BigDecimal val = new BigDecimal(0); - maxlist.add(val); - } - } - mpname = mPoint.getParmname(); - } - String result = "{\"name\":\"" + mpname + "\",\"datalist\":" + datalist + ",\"minlist\":" + minlist + ",\"maxlist\":" + maxlist + "}"; - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取周的数据(7天) - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValueWeekS.do") - public String getValueWeekS(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - com.alibaba.fastjson.JSONArray jsonArray_data = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray jsonArray_time = new com.alibaba.fastjson.JSONArray(); - - if (mpointCode != null && !mpointCode.equals("")) { - String[] ids = mpointCode.split(","); - if (ids != null && !ids.equals("")) { - for (int i = 0; i < ids.length; i++) { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - - //通过es查询bizid - MPoint mPoint_es = mPointService.selectById(ids[i]); - if (mPoint_es != null) { - unitId = mPoint_es.getBizid(); - - jsonObject2.put("name", mPoint_es.getParmname()); - jsonObject2.put("type", "bar"); - jsonObject2.put("stack", "total"); - jsonObject2.put("barWidth", 30); - - com.alibaba.fastjson.JSONObject jsonObject3 = new com.alibaba.fastjson.JSONObject(); - jsonObject3.put("show", "true"); - jsonObject2.put("label", jsonObject3); - - List datalist = new ArrayList(); - for (int j = 7; j >= 1; j--) { - String dt = CommUtil.differenceDate(-j); - List list = mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + mPoint_es.getMpointcode(), "where DateDiff(dd,MeasureDT,'" + dt + "')=0"); - if (list != null && list.size() > 0) { - datalist.add(list.get(0).getParmvalue()); - } else { - datalist.add(new BigDecimal("0")); - } - - //x轴只生成1次 - if (i == 0) { - jsonArray_time.add(dt); - } - } - jsonObject2.put("data", datalist); - jsonArray_data.add(jsonObject2); - } - - } - } - } - - com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject(); - json.put("dataJson", jsonArray_data); - json.put("timeJson", jsonArray_time); -// String result = "{\"res1\":\"" + jsonArray_data + "\",\"res2\":" + jsonArray_time + "}"; - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取本月数据 - * sj 2021-12-13 - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValue4Month.do") - public String getValue4Month(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - com.alibaba.fastjson.JSONArray jsonArray_data = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray jsonArray_time = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray jsonArray_legend = new com.alibaba.fastjson.JSONArray(); - - //获取当月天数 - int maxDays = CommUtil.getDaysByYearMonth(Integer.parseInt(CommUtil.nowDate().substring(0, 4)), Integer.parseInt(CommUtil.nowDate().substring(5, 7))); - - if (mpointCode != null && !mpointCode.equals("")) { - String[] ids = mpointCode.split(","); - if (ids != null && !ids.equals("")) { - for (int i = 0; i < ids.length; i++) { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - - //查询bizid - MPoint mPoint_es = this.mPointService.selectById(unitId, ids[i]); - if (mPoint_es != null) { - unitId = mPoint_es.getBizid(); - jsonArray_legend.add(mPoint_es.getParmname()); - - jsonObject2.put("name", mPoint_es.getParmname()); - jsonObject2.put("type", "line"); -// jsonObject2.put("stack", "total"); -// jsonObject2.put("barWidth",30); - - com.alibaba.fastjson.JSONObject jsonObject3 = new com.alibaba.fastjson.JSONObject(); - jsonObject3.put("show", "true"); - jsonObject2.put("label", jsonObject3); - - List datalist = new ArrayList(); - - //days为当天的天数,循环次数为天数 - int days = Integer.parseInt(CommUtil.nowDate().substring(8, 10)); - for (int j = 1; j <= days; j++) { - String dt = ""; - if (j < 10) { - dt = CommUtil.nowDate().substring(0, 7) + "-0" + j; - } else { - dt = CommUtil.nowDate().substring(0, 7) + "-" + j; - } - - List list = mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + mPoint_es.getMpointcode(), "where DateDiff(dd,MeasureDT,'" + dt + "')=0"); - if (list != null && list.size() > 0) { - datalist.add(list.get(0).getParmvalue()); - } else { - datalist.add(new BigDecimal("0")); - } - - //x轴只生成1次 -// if(i == 0){ -// jsonArray_time.add(j); -// } - } - - jsonObject2.put("data", datalist); - jsonArray_data.add(jsonObject2); - } - - } - } - } - - for (int i = 0; i < maxDays; i++) { - jsonArray_time.add(i); - } - - com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject(); - json.put("dataJson", jsonArray_data); - json.put("timeJson", jsonArray_time); - json.put("legendJson", jsonArray_legend); - model.addAttribute("result", json); - return "result"; - } - - /** - * 获取指定天数的 数据 - * - * @param request - * @param model - * @param unitId - * @param mpointCode - * @return - */ - @RequestMapping("/getValue4Days.do") - public String getValue4Days(HttpServletRequest request, Model model, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "mpointCode") String mpointCode) { - com.alibaba.fastjson.JSONArray jsonArray_data = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray jsonArray_time = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray jsonArray_legend = new com.alibaba.fastjson.JSONArray(); - - //获取当月天数 - ArrayList dayList = CommUtil.getDays4PastOrFuture(11); - //倒叙 - Collections.reverse(dayList); - - if (mpointCode != null && !mpointCode.equals("")) { - String[] ids = mpointCode.split(","); - if (ids != null && !ids.equals("")) { - for (int i = 0; i < ids.length; i++) { - com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject(); - - //查询bizid - MPoint mPoint_es = this.mPointService.selectById(unitId, ids[i]); - if (mPoint_es != null) { - unitId = mPoint_es.getBizid(); - jsonArray_legend.add(mPoint_es.getParmname()); - - jsonObject2.put("name", mPoint_es.getParmname()); - jsonObject2.put("type", "bar"); - - com.alibaba.fastjson.JSONObject jsonObject3 = new com.alibaba.fastjson.JSONObject(); - jsonObject3.put("show", "true"); - jsonObject2.put("label", jsonObject3); - - List datalist = new ArrayList(); - - for (int j = 0; j < dayList.size() - 1; j++) { - String dt = dayList.get(j); - - List list = mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + mPoint_es.getMpointcode(), "where DateDiff(dd,MeasureDT,'" + dt + "')=0"); - if (list != null && list.size() > 0) { - datalist.add(list.get(0).getParmvalue()); - } else { - datalist.add(new BigDecimal("0")); - } - } - - jsonObject2.put("data", datalist); - jsonArray_data.add(jsonObject2); - } - - } - } - } - - for (int i = 0; i < dayList.size() - 1; i++) { - jsonArray_time.add(dayList.get(i).substring(5, 10)); - } - - com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject(); - json.put("dataJson", jsonArray_data); - json.put("timeJson", jsonArray_time); - json.put("legendJson", jsonArray_legend); - model.addAttribute("result", json); - return "result"; - } - - /** - * 南市 上位机调平台页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("showlistForSWJ.do") - public String showlistForSWJ(HttpServletRequest request, Model model) { - return "/work/mPointListForSWJ"; - } - - public List getParent(String pid, List t) { - - List t2 = new ArrayList(); - for (int i = 0; i < t.size(); i++) { - if (t.get(i).getId() != null && t.get(i).getId().equalsIgnoreCase(pid)) { -// t.get(i).setName(t.get(i).getName()); - t2.add(t.get(i)); - List result = getParent(t.get(i).getPid(), t); - if (result != null) { - t2.addAll(result); - } - } - } - return t2; - } - - @RequestMapping("/getMpointForJson.do") - public ModelAndView getMpointForJson(HttpServletRequest request, Model model) { - String mpid = request.getParameter("mpid"); - String unitId = request.getParameter("unitId"); - MPoint mPoint = this.mPointService.selectById(unitId, mpid); - model.addAttribute("result", JSONArray.fromObject(mPoint)); - return new ModelAndView("result"); - } - - @RequestMapping("/getMpointJsonForEX.do") - public ModelAndView getMpointJsonForEX(HttpServletRequest request, Model model) { - String mpid = request.getParameter("mpid"); - MPoint mPoint = this.mPointService.selectById(mpid); - model.addAttribute("result", JSONArray.fromObject(mPoint)); - return new ModelAndView("result"); - } - - @RequestMapping("/getMpointJsonForEXAndDV.do") - public ModelAndView getMpointJsonForEXAndDV(HttpServletRequest request, Model model) { - String mpid = request.getParameter("mpid"); - String valuemethod = request.getParameter("valuemethod"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - if (sdt != null && sdt.length() > 10) { - } else { - sdt += " 00:00"; - } - if (edt != null && edt.length() > 0) { - if (edt != null && edt.length() > 10) { - } else { - edt += " 23:59"; - } - } else { - edt = request.getParameter("sdt") + " 23:59"; - } - - MPoint mPoint = this.mPointService.selectById(mpid); - if (valuemethod.equals("nowTime")) { - - } else { - String unitId = mPoint.getBizid(); - String whereString = ""; - List mpVlist = new ArrayList<>(); - if (valuemethod.equals("first")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt desc "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " top 1 * "); - } else if (valuemethod.equals("last")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " top 1 * "); - } else if (valuemethod.equals("diff")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " (max(ParmValue)-min(ParmValue)) as ParmValue "); - } else if (valuemethod.equals("avg")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " avg(ParmValue) as ParmValue "); - } else if (valuemethod.equals("min")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " min(ParmValue) as ParmValue "); - } else if (valuemethod.equals("max")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " max(ParmValue) as ParmValue "); - } else if (valuemethod.equals("sum")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " sum(ParmValue) as ParmValue "); - } - - if (mpVlist != null && mpVlist.size() > 0) { - if (mpVlist.get(0) != null) { - mPoint.setParmvalue(mpVlist.get(0).getParmvalue()); - BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - } else { - mPoint.setParmvalue(new BigDecimal(0)); - } - } - - } - - model.addAttribute("result", JSONArray.fromObject(mPoint)); - return new ModelAndView("result"); - } - - - /** - * @param request - * @param model - * @param ids 多个测量点值 逗号分离 - * @return MPoint4APP(简化字段) - * @author YYJ - * 获取多个测量点信息(包含KH) - */ - @RequestMapping("/getMPoints.do") - public ModelAndView getMPoints(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - List mPointList = new ArrayList<>(); - try { -// String rtdb = request.getParameter("rtdb"); -// rtdb=null; -// String unitId = null; -// if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { -// unitId = request.getParameter("unitId"); -// } -// if (rtdb != null && !rtdb.isEmpty() && !RealTimeDataBaseType.SQL.getId().equals(rtdb)) { -// MPointQuery mPointQuery = new MPointQuery(); -// mPointQuery.setId(ids); -// mPointList = this.mPointHistoryService.selectPresentValue(mPointQuery); -// } else { - //生产库 - ids = ids.replace(",", " "); -// String[] idarr = ids.split("','"); - // YYJ 20201113 es查询测量点 - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("id", ids)); -// for(int i=0;i mpoints = this.mPointService.selectListByWhere(nativeSearchQueryBuilder); - mPointList = this.mPointService.copyProperties2Unit(mpoints); -// } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - Result result = Result.success(mPointList); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 获取一条测量点数据 - */ - @RequestMapping("/getMpoint.do") - public String getMpoint(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "id") String id) throws JsonProcessingException { - MPoint mPoint = this.mPointService.selectById(id); - // jackson -// ObjectMapper jsonstr=new ObjectMapper(); - String json = ""; - - //fastjson -// com.alibaba.fastjson.JSONObject json= new com.alibaba.fastjson.JSONObject(); - - if (null != mPoint) { -// json = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(mPoint); -// json = jsonstr.writeValueAsString(mPoint); -// 更改序列化后的通用方法 - json = CommUtil.toJson(mPoint); - } - String res = "{\"mPoint\":" + json + "}"; - model.addAttribute("result", res); - return "result"; - } - - /** - * 拼接测量点信息 - */ - @RequestMapping("/getMpoint4Mq.do") - public String getMpoint4Mq(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) throws JsonProcessingException { - MPoint mPoint = this.mPointService.selectById(id); - String json = ""; - if (null != mPoint) { - json = CommUtil.toJson(mPoint); - } - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showHisData.do") - public String showHisData(HttpServletRequest request, Model model) { - String mpid = request.getParameter("mpcode"); - MPoint mPoint = this.mPointService.selectById(mpid); - model.addAttribute("mPoint", mPoint); - return "/work/mPointHisData"; - } - - @RequestMapping("/showHisDataNew.do") - public String showHisDataNew(HttpServletRequest request, Model model) { - String mpid = request.getParameter("mpcode"); - MPoint mPoint = this.mPointService.selectById(mpid); - model.addAttribute("mPoint", mPoint); - return "/work/mPointHisDataNew"; - } - - @RequestMapping("/getHisDataList.do") - public ModelAndView getHisDataList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - Properties properties = new Properties(); - InputStream dbnameIn = MPointController.class.getClassLoader().getResourceAsStream("db.properties"); - String dburl = ""; - try { - properties.load(dbnameIn); - dburl = properties.getProperty("url"); - } catch (IOException e) { - e.printStackTrace(); - } - String dbname = dburl.split("=")[1]; - - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("bizid"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpid = request.getParameter("mpid"); - if (sort == null) { - sort = " measuredt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "'"; -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; -// } - //小于等于该数据 - String maxData = request.getParameter("maxData"); - if (maxData != null && !maxData.isEmpty()) { - wherestr += " and ParmValue<= " + maxData + " "; - } - //大于等于该数据 - String minData = request.getParameter("minData"); - if (minData != null && !minData.isEmpty()) { - wherestr += " and ParmValue >= " + minData + " "; - } - //等于该数据 - String equalData = request.getParameter("equalData"); - if (equalData != null && !equalData.isEmpty()) { - wherestr += " and ParmValue = " + equalData + " "; - } - - PageHelper.startPage(page, rows); - List list = mPointHistoryService.selectMpHisDataLeftMpHisChange(bizid, mpid,"'"+mpid+"'", wherestr + orderstr, dbname); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getHisDataListForKPI.do") - public ModelAndView getHisDataListForKPI(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("bizid"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpid = request.getParameter("mpid"); - if (sort == null) { - sort = " measuredt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "'"; -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; -// } - //小于等于该数据 - String maxData = request.getParameter("maxData"); - if (maxData != null && !maxData.isEmpty()) { - wherestr += " and ParmValue<= " + maxData + " "; - } - //大于等于该数据 - String minData = request.getParameter("minData"); - if (minData != null && !minData.isEmpty()) { - wherestr += " and ParmValue >= " + minData + " "; - } - //等于该数据 - String equalData = request.getParameter("equalData"); - if (equalData != null && !equalData.isEmpty()) { - wherestr += " and ParmValue = " + equalData + " "; - } - - PageHelper.startPage(page, rows); - List list = mPointHistoryService.selectListByTableAWhereForKPI(bizid, "[TB_MP_" + mpid + "]", wherestr + orderstr); - for (MPointHistory item : list) { - if (StringUtils.isNotBlank(item.getUserid())) { - item.setUser(userService.getUserById(item.getUserid())); - } - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /* - * 获取历史数据最大、最小、平均值 - */ - @RequestMapping("/getHisData4Screen.do") - public ModelAndView getHisData4Screen(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpid = request.getParameter("mpid"); - String wherestr = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "'"; - //小于等于该数据 - String maxData = request.getParameter("maxData"); - if (maxData != null && !maxData.isEmpty()) { - wherestr += " and ParmValue<= " + maxData + " "; - } - //大于等于该数据 - String minData = request.getParameter("minData"); - if (minData != null && !minData.isEmpty()) { - wherestr += " and ParmValue >= " + minData + " "; - } - //等于该数据 - String equalData = request.getParameter("equalData"); - if (equalData != null && !equalData.isEmpty()) { - wherestr += " and ParmValue = " + equalData + " "; - } - List avglist = mPointHistoryService.selectAVG(bizid, "[TB_MP_" + mpid + "]", wherestr); - BigDecimal avg = null; - if (avglist != null && avglist.size() > 0 && avglist.get(0) != null) { - avg = avglist.get(0).getParmvalue(); - } - List maxlist = mPointHistoryService.selectMAX(bizid, "[TB_MP_" + mpid + "]", wherestr); - BigDecimal max = null; - if (maxlist != null && maxlist.size() > 0 && maxlist.get(0) != null) { - max = maxlist.get(0).getParmvalue(); - } - List minlist = mPointHistoryService.selectMIN(bizid, "[TB_MP_" + mpid + "]", wherestr); - BigDecimal min = null; - if (minlist != null && minlist.size() > 0 && minlist.get(0) != null) { - min = minlist.get(0).getParmvalue(); - } - String result = "{\"avg\":" + avg + ",\"max\":" + max + ",\"min\":" + min + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /* - * 获取历史数据最大、最小、平均值 - */ - @RequestMapping("/HisDataExportExcel.do") - public ModelAndView HisDataExportExcel(HttpServletRequest request, HttpServletResponse response, Model model) throws IOException { - String orderstr = " order by measuredt desc"; - String bizid = request.getParameter("bizid"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - String mpid = request.getParameter("mpid"); - String wherestr = " where MeasureDT >= '" + sdt + "' and MeasureDT<= '" + edt + "'"; - //小于等于该数据 - String maxData = request.getParameter("maxData"); - if (maxData != null && !maxData.isEmpty()) { - wherestr += " and ParmValue<= " + maxData + " "; - } - //大于等于该数据 - String minData = request.getParameter("minData"); - if (minData != null && !minData.isEmpty()) { - wherestr += " and ParmValue >= " + minData + " "; - } - //等于该数据 - String equalData = request.getParameter("equalData"); - if (equalData != null && !equalData.isEmpty()) { - wherestr += " and ParmValue = " + equalData + " "; - } - List list = mPointHistoryService.selectListByTableAWhere(bizid, "[TB_MP_" + mpid + "]", wherestr + orderstr); - mPointHistoryService.downloadExcel(response, list, mpid); - return null; - } - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/hisDataImportExcel.do") - public ModelAndView hisDataImportExcel(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - String unitId = request.getParameter("companyId"); - String mpid = request.getParameter("mpid"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? mPointService.readXlsHis(unitId, mpid, excelFile.getInputStream(), cu.getId()) : this.mPointService.readXlsxHis(unitId, mpid, excelFile.getInputStream(), cu.getId()); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * excel批量导入点位历史数据,处理、保存数据,支持xls和xlsx两种格式 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/hisDataMultipleImportExcel.do") - public ModelAndView hisDataMultipleImportExcel(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - String unitId = request.getParameter("companyId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? mPointService.readXlsHisMultiple(unitId, excelFile.getInputStream()) : this.mPointService.readXlsxHisMultiple(unitId, excelFile.getInputStream()); - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 删除测量点数据 - * - * @return - */ - @RequestMapping("/delMPointHistory.do") - @ArchivesLog(operteContent = "删除测量点数据") - public ModelAndView delMPointHistory(HttpServletRequest request, Model model) throws JsonProcessingException { - String unitId = request.getParameter("unitId"); - String mpid = request.getParameter("mpid"); - String itemid = request.getParameter("itemid"); - String wherestr = "where itemid in (" + itemid + ") "; - int res = this.mPointHistoryService.deleteByTableAWhere(unitId, "[TB_MP_" + mpid + "]", wherestr); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 添加测量点数据 - * - * @return - */ - @RequestMapping("/saveMPointHistory.do") - @ArchivesLog(operteContent = "新增测量点数据") - public ModelAndView saveMPointHistory(HttpServletRequest request, Model model) throws JsonProcessingException { - String unitId = request.getParameter("unitId"); - String mpid = request.getParameter("mpid"); - String measuredt = request.getParameter("measuredt"); - String parmValue = request.getParameter("parmValue"); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - mPointHistory.setMeasuredt(measuredt); - BigDecimal value = new BigDecimal(parmValue); - mPointHistory.setParmvalue(value); - int res = this.mPointHistoryService.save(unitId, mPointHistory); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 修改一条测量点数据 - */ - @RequestMapping("/upHisDateValue.do") - @ArchivesLog(operteContent = "修改测量点数据") - public ModelAndView upHisDateValue(HttpServletRequest request, Model model) throws JsonProcessingException { - String measuredt = request.getParameter("measuredt"); - String unitId = request.getParameter("unitId"); - String mpid = request.getParameter("mpid"); - String newValue = request.getParameter("newValue"); - - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - mPointHistory.setMeasuredt(measuredt); - BigDecimal bvalue = new BigDecimal(newValue); - mPointHistory.setParmvalue(bvalue); - int res = this.mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return new ModelAndView("result"); - } - - /** - * 查询传入时间后的 第一个值 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/selectTop14Time.do") - public ModelAndView selectTop14Time(HttpServletRequest request, Model model) { - String rptdt = request.getParameter("rptdt"); - String mpointcode = request.getParameter("mpointcode"); - String unitId = request.getParameter("unitId"); - List list = mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "TB_MP_" + mpointcode, "where MeasureDT>'" + rptdt + "' order by MeasureDT asc"); - String result = ""; - if (list != null && list.size() > 0) { - result = list.get(0).getParmvalue().toString(); - } else { - result = "-"; - } - String res = "{\"value\":\"" + result + "\"}"; - model.addAttribute("result", CommUtil.toJson(res)); - System.out.println(CommUtil.toJson(res)); - return new ModelAndView("result"); - } - - /** - * 拼接测量点信息 - */ - @RequestMapping("/getMpointSelectTree.do") - public String getMpointSelectTree(HttpServletRequest request, Model model) throws JsonProcessingException { - String mpidss = request.getParameter("mpids"); - String[] mpids = mpidss.split(","); - JSONArray jsonArray = new JSONArray(); - for (String mpid : - mpids) { - MPoint mPoint = this.mPointService.selectById(mpid); - if (mPoint != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", mpid); - jsonObject.put("text", mPoint.getParmname()); - jsonObject.put("unitId", mPoint.getBizid()); - jsonArray.add(jsonObject); - } - } - model.addAttribute("result", jsonArray); - return "result"; - } - - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - String unitId = request.getParameter("companyId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - if (!company.getType().equals("B")) { - model.addAttribute("result", "请右上角切换至对应厂区进行处理"); - return new ModelAndView("result"); - } - } else { - model.addAttribute("result", "请右上角切换至对应厂区进行处理"); - return new ModelAndView("result"); - } - - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? mPointService.readXls(unitId, excelFile.getInputStream(), cu.getId()) : this.mPointService.readXlsx(unitId, excelFile.getInputStream(), cu.getId()); - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - /** - * 导出 - */ - @RequestMapping(value = "doExport.do") - @ArchivesLog(operteContent = "导出测量点") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.mPointService.doExport(unitId, request, response); - return null; - } - - /** - * 验证公司级 - */ - @RequestMapping(value = "getUnType.do") - public ModelAndView getUnType(HttpServletRequest request, - HttpServletResponse response, - Model model, - @RequestParam(value = "unitId") String unitId) { - Map statusMap = new HashMap(); - String res = ""; - Boolean status = false; - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - status = true; - if (!company.getType().equals("B")) { - res = "请右上角切换至对应厂区进行处理"; - } else { - status = true; - } - } else { - res = "请右上角切换至对应厂区进行处理"; - } - statusMap.put("status", status); - statusMap.put("msg", res); - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/importMpoint.do") - public String doimport(HttpServletRequest request, Model model) { - return "work/mPointImport"; - } - - /** - * 导入点位历史数据-单点位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importMpointHis.do") - public String importMpointHis(HttpServletRequest request, Model model) { - model.addAttribute("mpid", request.getParameter("mpid")); - return "work/mPointHisImport"; - } - - /** - * 获取对应点位的数据 (第一条) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getData4MpCodes.do") - public ModelAndView getData4MpCodes(HttpServletRequest request, Model model) { - String mpcodes = request.getParameter("mpcodes"); - String unitId = request.getParameter("unitId"); - System.out.println(unitId + "======" + mpcodes); - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - if (mpcodes != null && !mpcodes.equals("")) { - String[] mpcode = mpcodes.split(","); - if (mpcode != null && mpcode.length > 0) { - for (int i = 0; i < mpcode.length; i++) { - List list = mPointService.selectListByWhere(unitId, "where MPointCode = '" + mpcode[i] + "'"); - if (list != null && list.size() > 0) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("mpcode", mpcode[i]); - jsonObject.put("parmvalue", list.get(0).getParmvalue()); - jsonArray.add(jsonObject); - } - } - } - } - model.addAttribute("result", CommUtil.toJson(jsonArray)); - return new ModelAndView("result"); - } - - /** - * 获取对应点位的数据 (合计) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getData4LastNum.do") - public ModelAndView getData4LastNum(HttpServletRequest request, Model model) { - String mpcodes = request.getParameter("mpcodes"); - String unitId = request.getParameter("unitId"); - System.out.println(unitId + "======" + mpcodes); - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - if (mpcodes != null && !mpcodes.equals("")) { - String[] mpcode = mpcodes.split(","); - if (mpcode != null && mpcode.length > 0) { - for (int i = 0; i < mpcode.length; i++) { - List list = mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + mpcode[i], "where DATEDIFF(dd,measuredt,GETDATE()-1)=0"); - if (list != null && list.size() > 0) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("mpcode", mpcode[i]); - //合计值 - BigDecimal average = list.stream().map(MPointHistory::getParmvalue).reduce(BigDecimal.ZERO, BigDecimal::add); - jsonObject.put("parmvalue", average); - jsonArray.add(jsonObject); - } else { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("mpcode", mpcode[i]); - jsonObject.put("parmvalue", "没有昨日消耗"); - jsonArray.add(jsonObject); - } - } - } - } - model.addAttribute("result", CommUtil.toJson(jsonArray)); - return new ModelAndView("result"); - } - - /** - * 导入点位历史数据-多点位 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importMpointHisMultiple.do") - public String importMpointHisMultiple(HttpServletRequest request, Model model) { - model.addAttribute("unitId", request.getParameter("unitId")); - return "work/mPointHisImportMultiple"; - } - - /** - * 导入点位历史数据模板 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/hisDataMultipleImportExcelTemp.do") - public String hisDataMultipleImportExcelTemp(HttpServletRequest request, HttpServletResponse response, Model model) throws IOException { - mPointHistoryService.downloadExcelTemplate(response); - return null; - } -} diff --git a/src/com/sipai/controller/work/MPointFormulaAutoHourController.java b/src/com/sipai/controller/work/MPointFormulaAutoHourController.java deleted file mode 100644 index 55779afc..00000000 --- a/src/com/sipai/controller/work/MPointFormulaAutoHourController.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPointFormulaAutoHour; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointFormulaAutoHourService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/mPointFormulaAutoHour") -public class MPointFormulaAutoHourController { - @Resource - private MPointFormulaAutoHourService mPointFormulaAutoHourService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/work/mPointFormulaAutoHourList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String bizid=request.getParameter("bizid"); - if(sort==null){ - sort = " sdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 and pid='"+request.getParameter("pid")+"' "; - PageHelper.startPage(page, rows); - List list = this.mPointFormulaAutoHourService.selectListByWhere(bizid,wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/mPointFormulaAutoHourAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String bizid=request.getParameter("bizid"); - int result = this.mPointFormulaAutoHourService.deleteById(bizid,id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.mPointFormulaAutoHourService.deleteByWhere("","where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("mPointFormulaAutoHour") MPointFormulaAutoHour mPointFormulaAutoHour){ - User cu= (User)request.getSession().getAttribute("cu"); - String bizid=request.getParameter("bizid"); - mPointFormulaAutoHour.setId(CommUtil.getUUID()); - int result = this.mPointFormulaAutoHourService.save(bizid,mPointFormulaAutoHour); - String resstr="{\"res\":\""+result+"\",\"id\":\""+mPointFormulaAutoHour.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - String bizid=request.getParameter("bizid"); - MPointFormulaAutoHour mPointFormulaAutoHour = this.mPointFormulaAutoHourService.selectById(bizid,id); - model.addAttribute("mPointFormulaAutoHour", mPointFormulaAutoHour); - return "work/mPointFormulaAutoHourEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("mPointFormulaAutoHour") MPointFormulaAutoHour mPointFormulaAutoHour){ - String bizid=request.getParameter("bizid"); - User cu= (User)request.getSession().getAttribute("cu"); - int result = this.mPointFormulaAutoHourService.update(bizid,mPointFormulaAutoHour); - String resstr="{\"res\":\""+result+"\",\"id\":\""+mPointFormulaAutoHour.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/MPointFormulaController.java b/src/com/sipai/controller/work/MPointFormulaController.java deleted file mode 100644 index 0be4d4a0..00000000 --- a/src/com/sipai/controller/work/MPointFormulaController.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.controller.work; - -import java.util.HashMap; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.scada.MPointPropSource; -import com.sipai.service.scada.MPointPropSourceService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPointFormula; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/mPointFormula") -public class MPointFormulaController { - @Resource - private MPointFormulaService mPointFormulaService; - @Resource - private MPointPropSourceService mPointPropSourceService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/work/mPointFormulaList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("bizid"); - if (sort == null) { - sort = " formulaname "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pmpid='" + request.getParameter("pmpid") + "' "; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.mPointFormulaService.selectListByWhere(bizid, wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "work/mPointFormulaAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String bizid = request.getParameter("bizid"); - int result = this.mPointFormulaService.deleteById(bizid, id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.mPointFormulaService.deleteByWhere("", "where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("mPointFormula") MPointFormula mPointFormula) { - User cu = (User) request.getSession().getAttribute("cu"); - String bizid = request.getParameter("bizid"); - mPointFormula.setId(CommUtil.getUUID()); - mPointFormula.setInsuser(cu.getId()); - mPointFormula.setInsdt(CommUtil.nowDate()); - int result = this.mPointFormulaService.save(bizid, mPointFormula); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointFormula.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - MPointPropSource mPointPropSource = this.mPointPropSourceService.selectById(bizid, id); - model.addAttribute("mPointPropSource", mPointPropSource); - model.addAttribute("bizid", bizid); -// MPointFormula mPointFormula = this.mPointFormulaService.selectById(bizid, id); -// model.addAttribute("mPointFormula", mPointFormula); - return "work/mPointFormulaEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("mPointFormula") MPointFormula mPointFormula) { - String bizid = request.getParameter("bizid"); - User cu = (User) request.getSession().getAttribute("cu"); - mPointFormula.setInsuser(cu.getId()); - mPointFormula.setInsdt(CommUtil.nowDate()); - int result = this.mPointFormulaService.update(bizid, mPointFormula); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointFormula.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/getWhpSpData.do") - public ModelAndView getWhpSpData(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); - String execTime = CommUtil.nowDate(); - String execType = "nowTime"; - String inMpids = request.getParameter("inMpids"); - String mark = request.getParameter("mark"); -// String bizid = "FS_BJ11_C"; -// String execTime = "2023-06-20"; -// String execType = "nowTime"; -// String inMpids = "BJSC_QSBF_ZYDL_PV"; -// String mark = "123,554"; - - List> spData = this.mPointFormulaService.getSpData(bizid, execTime, execType, inMpids, mark); - - if (spData != null && spData.size() > 0) { - for (int i = 0; i < spData.size(); i++) { - if (spData.get(i).get("") != null) { -//spData.get(i).get(cname).toString() - } - } - } - - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - - @RequestMapping("/getMpHisDataByUserid.do") - public ModelAndView getMpHisDataByUserid(HttpServletRequest request, Model model) { - String bizid = "FS_BJ11_C"; - String execTime = "2023-06-20"; - String execType = "nowTime"; - String inMpids = "BJSC_QSBF_ZYDL_PV"; - String mark = "123,554"; - - List mpHisData = this.mPointFormulaService.getMpHisDataByUserid(bizid, inMpids, mark); - - model.addAttribute("result", "1"); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/work/MPointFormulaDenominatorController.java b/src/com/sipai/controller/work/MPointFormulaDenominatorController.java deleted file mode 100644 index 0ea22460..00000000 --- a/src/com/sipai/controller/work/MPointFormulaDenominatorController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPointFormulaDenominator; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointFormulaDenominatorService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/mPointFormulaDenominator") -public class MPointFormulaDenominatorController { - @Resource - private MPointFormulaDenominatorService mPointFormulaDenominatorService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model) { - return "/work/mPointFormulaDenominatorList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String bizid=request.getParameter("bizid"); - if(sort==null){ - sort = " denominatorName "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1 and pmpid='"+request.getParameter("pmpid")+"' "; - - PageHelper.startPage(page, rows); - List list = this.mPointFormulaDenominatorService.selectListByWhere(bizid,wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/mPointFormulaDenominatorAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String bizid=request.getParameter("bizid"); - int result = this.mPointFormulaDenominatorService.deleteById(bizid,id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.mPointFormulaDenominatorService.deleteByWhere("","where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute("mPointFormulaDenominator") MPointFormulaDenominator mPointFormulaDenominator){ - User cu= (User)request.getSession().getAttribute("cu"); - String bizid=request.getParameter("bizid"); - mPointFormulaDenominator.setId(CommUtil.getUUID()); - int result = this.mPointFormulaDenominatorService.save(bizid,mPointFormulaDenominator); - String resstr="{\"res\":\""+result+"\",\"id\":\""+mPointFormulaDenominator.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - String bizid=request.getParameter("bizid"); - MPointFormulaDenominator mPointFormulaDenominator = this.mPointFormulaDenominatorService.selectById(bizid,id); - model.addAttribute("mPointFormulaDenominator", mPointFormulaDenominator); - return "work/mPointFormulaDenominatorEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute("mPointFormulaDenominator") MPointFormulaDenominator mPointFormulaDenominator){ - String bizid=request.getParameter("bizid"); - User cu= (User)request.getSession().getAttribute("cu"); - int result = this.mPointFormulaDenominatorService.update(bizid,mPointFormulaDenominator); - String resstr="{\"res\":\""+result+"\",\"id\":\""+mPointFormulaDenominator.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/MPointHisChangeDataController.java b/src/com/sipai/controller/work/MPointHisChangeDataController.java deleted file mode 100644 index ee4d1140..00000000 --- a/src/com/sipai/controller/work/MPointHisChangeDataController.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.data.DataCleaningHistory; -import com.sipai.service.data.DataCleaningHistoryService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.MPointHisChangeData; -import com.sipai.entity.user.User; -import com.sipai.service.work.MPointHisChangeDataService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/mPointHisChangeData") -public class MPointHisChangeDataController { - @Resource - private MPointHisChangeDataService mPointHisChangeDataService; - @Resource - private DataCleaningHistoryService dataCleaningHistoryService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/work/mPointHisChangeDataList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " changeTime "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and mpid='" + request.getParameter("mpid") + "' "; - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()&&request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += " and valueTime between '"+request.getParameter("sdt")+"' and '"+request.getParameter("edt")+"' "; - } - PageHelper.startPage(page, rows); - List list = this.mPointHisChangeDataService.selectListByWhereUnionCleaning(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doView.do") - public String doView(HttpServletRequest request, Model model) { - return "work/mPointHisChangeDataView"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "work/mPointHisChangeDataAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String bizid = request.getParameter("bizid"); - int result = this.mPointHisChangeDataService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.mPointHisChangeDataService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model) { - MPointHisChangeData mPointHisChangeData = new MPointHisChangeData(); - User cu = (User) request.getSession().getAttribute("cu"); - String changeType=request.getParameter("changeType"); - mPointHisChangeData.setId(CommUtil.getUUID()+"_"+changeType); - mPointHisChangeData.setMpid(request.getParameter("mpid")); - mPointHisChangeData.setChangepeople(cu.getId()); - if(request.getParameter("newValue")!=null){ - mPointHisChangeData.setChangedata(Double.valueOf(request.getParameter("newValue"))); - } - if(request.getParameter("olddata")!=null){ - mPointHisChangeData.setOlddata(Double.valueOf(request.getParameter("olddata"))); - } - mPointHisChangeData.setChangetime(CommUtil.nowDate()); - mPointHisChangeData.setValuetime(request.getParameter("measuredt")); - int result = this.mPointHisChangeDataService.save(mPointHisChangeData); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointHisChangeData.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - MPointHisChangeData mPointHisChangeData = this.mPointHisChangeDataService.selectById(id); - model.addAttribute("mPointHisChangeData", mPointHisChangeData); - return "work/mPointHisChangeDataEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("mPointHisChangeData") MPointHisChangeData mPointHisChangeData) { - String bizid = request.getParameter("bizid"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = this.mPointHisChangeDataService.update(mPointHisChangeData); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointHisChangeData.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/MPointPropController.java b/src/com/sipai/controller/work/MPointPropController.java deleted file mode 100644 index 205d944f..00000000 --- a/src/com/sipai/controller/work/MPointPropController.java +++ /dev/null @@ -1,679 +0,0 @@ -package com.sipai.controller.work; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSONObject; -import com.singularsys.jep.Jep; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.TimeUnitEnum; -import com.sipai.service.scada.*; -import com.sipai.service.score.LibraryMPointPropService; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; - -import org.apache.log4j.Logger; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointProp; -import com.sipai.entity.scada.MPointPropSource; -import com.sipai.entity.scada.MPointPropTarget; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/mPointProp") -public class MPointPropController { - private static Logger logger = Logger.getLogger(MPointPropController.class); - @Resource - private MPointService mPointService; - @Resource - private MPointPropService mPointPropService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointPropSourceService mPointPropSourceService; - @Resource - private MPointPropTargetService mPointPropTargetService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "/work/mPointPropList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and assetClassName like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.mPointPropService.selectListByWhere(companyId, wherestr + orderstr); - for (MPointProp item : list) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String companyId = request.getParameter("companyId"); - Company company = this.unitService.getCompById(companyId); - model.addAttribute("company", company); - return "/work/mPointPropAdd"; - } - - @RequestMapping("/dodelete.do") - public String dodelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "companyId") String companyId) { - int result = this.mPointPropService.deleteById(companyId, id); - //删除关联测量点表的数据 - List list = this.mPointPropSourceService.selectListByWhere(companyId, "where pid = '" + id + "'"); - this.mPointPropService.deletesMPointPropSource(companyId, list); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodelete2.do") - public String dodelete2(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "companyId") String companyId) { - List list = this.mPointPropSourceService.selectListByWhere(companyId, "where id = '" + id + "'"); - int result = this.mPointPropService.deletesMPointPropSource(companyId, list); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "companyId") String companyId) { - ids = ids.replace(",", "','"); - int result = this.mPointPropService.deleteByWhere(companyId, "where id in ('" + ids + "')"); - List list = this.mPointPropSourceService.selectListByWhere(companyId, "where pid in ('" + ids + "')"); - this.mPointPropService.deletesMPointPropSource(companyId, list); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute("mPointProp") MPointProp mPointProp) { - User cu = (User) request.getSession().getAttribute("cu"); - mPointProp.setId(CommUtil.getUUID()); - mPointProp.setInsuser(cu.getId()); - mPointProp.setInsdt(CommUtil.nowDate()); - int result = this.mPointPropService.save(mPointProp.getBizId(), mPointProp); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dosave2.do") - public String dosave2(HttpServletRequest request, Model model, - @ModelAttribute("mPointProp") MPointProp mPointProp) { - User cu = (User) request.getSession().getAttribute("cu"); - List list = this.mPointPropService.selectListByWhere(mPointProp.getBizId(), " where pid='" + mPointProp.getPid() + "' "); -// MPointProp mPointPropCk = this.mPointPropService.selectById(mPointProp.getBizId(), id); - String exp = mPointProp.getEvaluationFormula(); - MPoint mPoint = this.mPointService.selectById(mPointProp.getPid()); - if(mPoint!=null){ - mPoint.setExp(exp); - this.mPointService.update(mPoint.getBizid(), mPoint); - } - int result = 0; - if (list != null && list.size() > 0) { - result = this.mPointPropService.update(mPointProp.getBizId(), mPointProp); - } else { - mPointProp.setId(CommUtil.getUUID()); - mPointProp.setInsuser(cu.getId()); - mPointProp.setInsdt(CommUtil.nowDate()); - result = this.mPointPropService.save(mPointProp.getBizId(), mPointProp); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String companyId = request.getParameter("companyId"); - MPointProp mPointProp = this.mPointPropService.selectById(companyId, id); - model.addAttribute("mPointProp", mPointProp); - return "work/mPointPropView"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); -// Company company = this.unitService.getCompById(companyId); -// model.addAttribute("company", company); - net.sf.json.JSONObject jsonObject = new net.sf.json.JSONObject(); - MPointProp mPointProp = this.mPointPropService.selectById(unitId, id); - int res = 1; - if (mPointProp == null) { - mPointProp = new MPointProp(); -// MPoint mPoint = mPointService.selectById(id); - mPointProp.setId(id); - mPointProp.setPid(id); - mPointProp.setBizId(unitId); - mPointProp.setInsdt(CommUtil.nowDate()); - res = this.mPointPropService.save(unitId, mPointProp); - MPoint mpoint = mPointService.selectById(id); - mPointProp.setMpoint(mpoint); - } - if (res == 1) { - jsonObject = net.sf.json.JSONObject.fromObject(mPointProp); - JSONArray jsonArray = new JSONArray(); - // 拆分公式 - String WITH_DELIMITER = "((?<=%1$s)|(?=%1$s))";//split保留分隔符 - if (mPointProp.getEvaluationFormula() != null && mPointProp.getEvaluationFormula() != "") { - jsonArray = JSONArray.fromObject(mPointProp.getEvaluationFormula().split(String.format(WITH_DELIMITER, "\\+|\\-|\\*|\\/|\\(|\\)"))); - } - //给标签对象传值 - JSONArray resultJsonArray = new JSONArray(); - for (int i = 0; i < jsonArray.size(); i++) { - net.sf.json.JSONObject obj = new net.sf.json.JSONObject(); - obj.put("index", i); - obj.put("name", jsonArray.get(i).toString()); - resultJsonArray.add(obj); - } - - jsonObject.put("evaluationFormulaArr", resultJsonArray); - model.addAttribute("result", net.sf.json.JSONObject.fromObject(jsonObject)); - } - return "result"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("mPointProp") MPointProp mPointProp) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu == null ? request.getParameter("userId") : cu.getId(); - mPointProp.setInsuser(userId); - mPointProp.setInsdt(CommUtil.nowDate()); - int result = this.mPointPropService.update(mPointProp.getBizId(), mPointProp); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointProp.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doaddPropSource.do") - public String doaddPropSource(HttpServletRequest request, Model model) { - String id = request.getParameter("pid"); - String companyId = request.getParameter("companyId"); - MPointProp mPointProp = this.mPointPropService.selectById(companyId, id); - MPoint mPoint = this.mPointService.selectById(companyId, mPointProp.getPid()); - model.addAttribute("mpoint", mPoint); - - return "/work/mPointPropSourceAdd"; - } - - @RequestMapping("/doaddPropTarget.do") - public String doaddPropTarget(HttpServletRequest request, Model model) { - return "/work/mPointPropTargetAdd"; - } - - @RequestMapping("/getPropSourceList.do") - public ModelAndView getPropSourceList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where pid = '" + request.getParameter("pid") + "'"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and assetClassName like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.mPointPropSourceService.selectListByWhere(companyId, wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getPropTargetList.do") - public ModelAndView getPropTargetList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where pid = '" + request.getParameter("pid") + "'"; - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and assetClassName like '%" + request.getParameter("search_name") + "%' "; - } - PageHelper.startPage(page, rows); - List list = this.mPointPropTargetService.selectListByWhere(companyId, wherestr + orderstr); -// List lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); -// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); - - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodeletePropSource.do") - public String doPropSourceDelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "companyId") String companyId) { - int result = this.mPointPropSourceService.deleteById(companyId, id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletesPropSource.do") - public String doPropSourceDeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "companyId") String companyId) { - ids = ids.replace(",", "','"); - int result = this.mPointPropSourceService.deleteByWhere(companyId, "where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletePropTarget.do") - public String doPropTargetDelete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "companyId") String companyId) { - int result = this.mPointPropTargetService.deleteById(companyId, id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/dodeletesPropTarget.do") - public String doPropTargetDeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "companyId") String companyId) { - ids = ids.replace(",", "','"); - int result = this.mPointPropTargetService.deleteByWhere(companyId, "where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping(value = "/dosavePropSource.do", method = RequestMethod.POST) - public String dosavePropSource(HttpServletRequest request, Model model, - @ModelAttribute("mPointPropSource") MPointPropSource mPointPropSource) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu == null ? request.getParameter("userId") : cu.getId(); - String unitId = request.getParameter("unitId"); - MPoint mPoint = mPointService.selectById(mPointPropSource.getMpid()); - if (mPoint != null) { - mPointPropSource.setIndexDetails(mPoint.getParmname()); - } - mPointPropSource.setId(CommUtil.getUUID()); - mPointPropSource.setInsuser(userId); - mPointPropSource.setInsdt(CommUtil.nowDate()); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("pid", mPointPropSource.getPid())); - boolQueryBuilder.must(QueryBuilders.wildcardQuery("index_details.keyword", "*" + mPointPropSource.getIndexDetails() + "*")); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List list = mPointPropSourceService.selectListByWhere(nativeSearchQueryBuilder); - if (list.size() > 0) { -// logger.info("----dosavePropSource-parrentid--"+mPoint.getId()+"--"+com.alibaba.fastjson.JSONArray.toJSONString(list)); - mPointPropSource.setIndexDetails(mPointPropSource.getIndexDetails() + "_" + list.size()); - } - - int result = this.mPointPropSourceService.save(unitId, mPointPropSource); - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointPropSource.getId() + "\",\"parmname\":\"" + mPointPropSource.getIndexDetails() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping(value = "/checkFormula.do", method = RequestMethod.POST) - @ResponseBody - public Result checkFormula(HttpServletRequest request, Model model, - @RequestParam(value = "bizId") String bizId, - @RequestParam(value = "mpointId") String mpointId) { - MPointProp mPointProp = mPointPropService.selectById(bizId, mpointId); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("pid", mPointProp.getId())); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List list = mPointPropSourceService.selectListByWhere(nativeSearchQueryBuilder); - Jep jep = new Jep(); - try { - Pattern pattern = Pattern.compile("^[\\u4e00-\\u9fa5a-zA-Z]"); - for (MPointPropSource item : list) { - String name = item.getIndexDetails(); - if (name == null || name.isEmpty()) { - return Result.failed("变量不能为空"); - } else if (!pattern.matcher(name).find()) { - return Result.failed(name + ",变量只能以字母或者汉字开头"); - } else if (name.contains("(") || name.contains(")") || name.contains("(") || name.contains(")")) { - return Result.failed("变量不能包含括号"); - } - String param = CommUtil.formatJepFormula(name); - double test = 1.0; - jep.addVariable(param, test); - - } - String evaluationFormula = CommUtil.formatJepFormula(mPointProp.getEvaluationFormula()); - jep.parse(evaluationFormula); - //3. 计算结果 - Object resulta = jep.evaluate(); - } catch (Exception e) { - e.printStackTrace(); - return Result.failed("公式验证失败,请检查公式中变量是否与参与计算点位名称对应一致!"); - } - - return Result.success(null); - - } - - @RequestMapping("/dosavePropTarget.do") - public String dosavePropTarget(HttpServletRequest request, Model model, - @ModelAttribute("mPointPropTarget") MPointPropTarget mPointPropTarget) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - mPointPropTarget.setId(CommUtil.getUUID()); - mPointPropTarget.setInsuser(cu.getId()); - mPointPropTarget.setInsdt(CommUtil.nowDate()); - int result = this.mPointPropTargetService.save(companyId, mPointPropTarget); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointPropTarget.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doviewPropSource.do") - public String doviewPropSource(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String companyId = request.getParameter("companyId"); - MPointPropSource mPointPropSource = this.mPointPropSourceService.selectById(companyId, id); - model.addAttribute("mPointPropSource", mPointPropSource); - return "work/mPointPropSourceView"; - } - - @RequestMapping("/doeditPropSource.do") - public String doeditPropSource(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); - MPointPropSource mPointPropSource = this.mPointPropSourceService.selectById(unitId, id); - Result result = Result.success(mPointPropSource); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doeditPropTarget.do") - public String doeditPropTarget(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String companyId = request.getParameter("companyId"); - MPointPropTarget mPointPropTarget = this.mPointPropTargetService.selectById(companyId, id); - model.addAttribute("mPointPropTarget", mPointPropTarget); - model.addAttribute("companyId", companyId); - return "work/mPointPropTargetEdit"; - } - - @RequestMapping("/dosavePropSource2.do") - public String dosavePropSource2(HttpServletRequest request, Model model, - @ModelAttribute("mPointPropSource") MPointPropSource mPointPropSource) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu == null ? request.getParameter("userId") : cu.getId(); - String unitId = request.getParameter("unitId"); - mPointPropSource.setId(CommUtil.getUUID()); - mPointPropSource.setInsuser(userId); - mPointPropSource.setInsdt(CommUtil.nowDate()); - int result = this.mPointPropSourceService.save(unitId, mPointPropSource); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointPropSource.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doupdatePropSource.do") - public String doupdatePropSource(HttpServletRequest request, Model model, - @ModelAttribute("mPointPropSource") MPointPropSource mPointPropSource) { - User cu = (User) request.getSession().getAttribute("cu"); - String userId = cu == null ? request.getParameter("userId") : cu.getId(); - String unitId = request.getParameter("unitId"); - mPointPropSource.setInsuser(userId); - mPointPropSource.setInsdt(CommUtil.nowDate()); - int result = this.mPointPropSourceService.update(unitId, mPointPropSource); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointPropSource.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/doupdatePropTarget.do") - public String doupdatePropTarget(HttpServletRequest request, Model model, - @ModelAttribute("mPointPropTarget") MPointPropTarget mPointPropTarget) { - User cu = (User) request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - mPointPropTarget.setInsuser(cu.getId()); - mPointPropTarget.setInsdt(CommUtil.nowDate()); - int result = this.mPointPropTargetService.update(companyId, mPointPropTarget); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + mPointPropTarget.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/saveHistory.do") - public String saveHistory(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - @RequestParam(value = "unitId") String unitId) { - // 业务方法 - MPoint mPoint_s = this.mPointService - .selectById(id); - List mPoints = new ArrayList<>(); - //是否搜索所有子kpi计算,默认不计算 - boolean searchChildFlag = Boolean.valueOf(request.getParameter("searchChildFlag")).booleanValue(); -// if(searchChildFlag){ - mPoints = mPointPropService.getChildKPIPointsWithKPIPoints(searchChildFlag, id); -// } - logger.info("----getChildKPIPointsWithKPIPoints---" + JSONArray.fromObject(mPoints).toString()); -// for (MPoint mPoint_s : mPoints_source) { - int i = 0; - for (i = 0; i < mPoints.size(); i++) { - if (mPoint_s.getId().equals(mPoints.get(i).getId())) { - break; - } - } - //计算频率单位 - String frequnit = mPoint_s.getFrequnit(); - //计算频率 - int freq = mPoint_s.getFreq(); - //要计算的所有时间 - List nowdates = new ArrayList(); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//注意月份是MM - Date enddate; - Date nowdate; - try { -// this.mPointHistoryService.deleteByTableAWhere(mPoint_s.getBizid(),CommUtil.getMPointTableName(mPoint_s.getMpointcode()),"where measuredt>'"+sdt+"' and measuredt<'"+edt+"'"); - enddate = simpleDateFormat.parse(edt); - sdt = CommUtil.adjustTime(sdt, frequnit, false); - nowdate = simpleDateFormat.parse(sdt); - - this.mPointHistoryService.deleteByTableAWhere(mPoint_s.getBizid(), CommUtil.getMPointTableName(mPoint_s.getMpointcode()), "where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"); - Calendar cal = Calendar.getInstance(); - cal.setTime(nowdate);//初始当前时间为开始时间 - - int res = 0; - while (nowdate.getTime() <= enddate.getTime()) { - String caltime = simpleDateFormat.format(nowdate);//获得计算的时间 - if (i == mPoints.size() && checkExec(caltime, mPoint_s)) { - // 启用线程getChildKPIPointsWithKPIPoints - //因为后续时间计算结果可能由前面时间计算结果运算得出,因此不能使用异步计算 - this.mPointPropService.calculateAndSave(mPoint_s.getBizid(), mPoint_s, caltime); - } - logger.info("--需同步执行计算点位--" + caltime + "--" + JSONArray.fromObject(mPoints).toString()); - for (MPoint mPoint : mPoints) { - if (mPoint != null && checkExec(caltime, mPoint)) { - logger.info("--同步执行计算--" + caltime + "--" + mPoint.getId()); - this.mPointPropService.calculateAndSave(mPoint.getBizid(), mPoint, caltime); - } - } - res++; - switch (frequnit) { - case "day": - cal.add(Calendar.DATE, freq); - break; - case "month": - cal.add(Calendar.MONTH, freq); - break; - case "year": - cal.add(Calendar.YEAR, freq); - break; - case "minute": - cal.add(Calendar.MINUTE, freq); - break; - case "hour": - cal.add(Calendar.HOUR, freq); - break; - default: - break; - } - nowdate = cal.getTime(); - continue; - } - String resstr = "{\"res\":" + res + "}"; - model.addAttribute("result", CommUtil.toJson(Result.success(resstr))); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - model.addAttribute("result", CommUtil.toJson(Result.failed("历史生产失败:" + e.getMessage()))); - } - - -// } - - return "result"; - } - - /** - * 检测测量点频率freq,是否满足执行条件 - * - * @param mPoint - * @return - */ - public boolean checkExec(String nowTime, MPoint mPoint) { - boolean res = false; - if (mPoint.getFrequnit() == null || mPoint.getFreq() == null) { - return res; - } - Calendar calendar = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date date = sdf.parse(nowTime); - calendar.setTime(date); - TimeUnitEnum timeUnitEnum = TimeUnitEnum.getTypeByValue(mPoint.getFrequnit()); - int pastTime = 1; - switch (timeUnitEnum) { - case MINUTE: - pastTime = calendar.get(Calendar.MINUTE); - break; - case HOUR: - pastTime = calendar.get(Calendar.HOUR_OF_DAY); - break; - case DAY: - pastTime = calendar.get(Calendar.DAY_OF_YEAR); - break; - case MONTH: - pastTime = calendar.get(Calendar.MONTH); - break; - case YEAR: - pastTime = calendar.get(Calendar.YEAR); - break; - } - if (pastTime % mPoint.getFreq() == 0) { - res = true; - } - } catch (ParseException e) { - e.printStackTrace(); - } - return res; - } - - @Resource - private LibraryMPointPropService libraryMPointPropService; - - @RequestMapping("/getTree.do") - @ResponseBody - public Result getTree(HttpServletRequest request, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "signaltag") String signaltag) { - Map map = new HashMap<>(); - map.put("bizid", unitId); - map.put("signaltag", signaltag); - List mpoints = this.mPointService.selectListByES(map, 1, 1); - if (mpoints.size() == 0) { - Result result = Result.failed("未获取到指定计算点"); - return result; - } -// MPointProp mPointProp = this.mPointPropService.selectById(mpoints.get(0).getBizid(),mpoints.get(0).getId()); - JSONObject res = this.libraryMPointPropService.getTree(mpoints.get(0).getId(), ""); - Result result = Result.success(res); - return result; - } -} diff --git a/src/com/sipai/controller/work/ModbusConfigController.java b/src/com/sipai/controller/work/ModbusConfigController.java deleted file mode 100644 index 028f7c7e..00000000 --- a/src/com/sipai/controller/work/ModbusConfigController.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.sipai.controller.work; - -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.ModbusDataTypeEnum; -import com.sipai.entity.enums.ModbusTypeEnum; -import com.sipai.entity.work.ModbusConfig; -import com.sipai.service.work.ModbusConfigService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.checkerframework.checker.units.qual.C; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @description tb_work_interface_modbus - * @author ycy - * @date 2023-02-08 - */ -@RestController -@RequestMapping(value = "/work/configModbus") -@Api(value = "/work/ConfigModbus", tags = "Modbus配置接口") -public class ModbusConfigController { - - - @Resource - private ModbusConfigService configModbusService; - - /** - * 新增 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/dosave.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "新增数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result insert(HttpServletRequest request, Model model, - @ModelAttribute ModbusConfig modbusConfig){ - Result result = new Result(); - if (modbusConfig.getType() != null) { - List modbusConfigs = configModbusService.selectListByWhere("where p_id = '" + modbusConfig.getpId() + "' and type = " + modbusConfig.getType()); - if (!CollectionUtils.isEmpty(modbusConfigs)) { - result = Result.failed("新增失败!当前类型已存在!请尝试编辑页面修改或删除"); - return result; - } - } - modbusConfig.setId(CommUtil.getUUID()); - int code = configModbusService.save(modbusConfig); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - return result; - } - - /** - * 刪除 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/delete.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result delete(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id){ - int code = configModbusService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - return result; - } - /** - * 多删 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/deletes.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result deletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",", "','"); - int code = this.configModbusService.deleteByWhere("where id in ('" + ids + "')"); - Result result = new Result(); - if (code > 0) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - return result; - } - - /** - * 更新 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/doUpdate.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "修改数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result update(HttpServletRequest request, Model model, - @ModelAttribute ModbusConfig modbusConfig){ - List modbusConfigs = configModbusService.selectListByWhere("where id != '" + modbusConfig.getId() + "' and p_id = '" + modbusConfig.getpId() + "' and type = '" + modbusConfig.getType() + "'"); - if (!CollectionUtils.isEmpty(modbusConfigs)) { - return Result.failed("更新失败——请确认当前数据类型是否已经配置!"); - } - int code = configModbusService.update(modbusConfig); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - return result; - } - - /** - * 查询 根据主键 id 查询 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping("/doAdd.do") - public ModelAndView doAdd(HttpServletRequest request, Model model, ModelAndView mv){ - mv.addObject("pId", request.getParameter("pid")); - mv.setViewName("work/modbusConfigAdd"); - return mv; - } - /** - * 查询 根据主键 id 查询 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping("/doEdit.do") - public ModelAndView doedit(HttpServletRequest request, Model model, ModelAndView mv, - @RequestParam(value = "id") String id){ - ModbusConfig modbusConfig = configModbusService.selectById(id); - mv.addObject("modbusConfig", modbusConfig); - mv.setViewName("work/modbusConfigEdit"); - return mv; - } - - /** - * 查询 分页查询 - * @author ycy - * @date 2023/02/08 - **/ - /** 获取列表 - * @param request - * @param - * @return - */ - @ApiOperation(value = "modbus配置列表查询", notes = "modbus配置列表查询", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "pId", value = "父链接id",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "status", value = "状态",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "sort", value = "排序字段", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "order", value = "排序方式", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "page", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "rows", value = "每页条数", dataType = "int", paramType = "query", required = true), - }) - @RequestMapping(value="/getList.do", method = RequestMethod.GET) - public JSONObject pageList(HttpServletRequest request, ModelAndView mv, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if(request.getParameter("pid")!=null && !request.getParameter("pid").isEmpty()){ - wherestr += " and p_id= '"+request.getParameter("pid")+"' "; - } - - PageHelper.startPage(page, rows); - List list = configModbusService.selectListByWhere(wherestr + orderstr); - for (ModbusConfig modbusConfig : list) { - modbusConfig.setTypeText(ModbusTypeEnum.getNameByid(modbusConfig.getType())); - modbusConfig.setDataTypeText(ModbusDataTypeEnum.getNameByid(modbusConfig.getDataType())); - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - JSONObject jsonObject = JSONObject.parseObject(result); - return jsonObject ; - } - -} diff --git a/src/com/sipai/controller/work/ModbusFigController.java b/src/com/sipai/controller/work/ModbusFigController.java deleted file mode 100644 index 8b1f39e0..00000000 --- a/src/com/sipai/controller/work/ModbusFigController.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.axis2.AxisFault; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.serotonin.modbus4j.sero.util.queue.ByteQueue; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ModbusFig; -import com.sipai.entity.work.ModbusRecord; -import com.sipai.service.work.ModbusFigService; -import com.sipai.service.work.ModbusRecordService; -import com.sipai.tools.CommUtil; -import com.sipai.webservice.client.user.UserClient; - - -@Controller -@RequestMapping("/work/modbusfig") -public class ModbusFigController { - @Resource - private ModbusFigService modbusFigService; - @Resource - private ModbusRecordService modbusRecordService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - User user; -// return "/views/leaveApp"; - return "/work/modbusfigList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " ipsever "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr=" where 1=1"; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and company_id = '"+request.getParameter("search_code")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.modbusFigService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/modbusfigAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ModbusFig modbusFig = this.modbusFigService.selectById(id); - model.addAttribute("modbusFig", modbusFig); - return "work/modbusfigEdit"; - } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ModbusFig modbusFig){ - User cu= (User)request.getSession().getAttribute("cu"); - - String id = CommUtil.getUUID(); - modbusFig.setId(id); - modbusFig.setInsuser(cu.getId()); - modbusFig.setInsdt(CommUtil.nowDate()); - - int result = this.modbusFigService.save(modbusFig); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ModbusFig modbusFig){ - int result = this.modbusFigService.update(modbusFig); - String resstr="{\"res\":\""+result+"\",\"id\":\""+modbusFig.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.modbusFigService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/testfun.do") - public String testfun(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - ModbusFig modbusFig = this.modbusFigService.selectById(id); - ByteQueue rece=new ByteQueue(); - rece=ReadAWriteUtil.modbusTCP(modbusFig.getIpsever(), Integer.parseInt(modbusFig.getPort()), - 0, 2); - if(rece==null){ - model.addAttribute("result", 0); - }else{ - model.addAttribute("result", 1); - } - //保存通讯信息 - User cu= (User)request.getSession().getAttribute("cu"); - ModbusRecord modbusRecord=new ModbusRecord(); - modbusRecord.setId(CommUtil.getUUID()); - modbusRecord.setInsdt(CommUtil.nowDate()); - modbusRecord.setLastdate(CommUtil.nowDate()); - modbusRecord.setRecord(ReadAWriteUtil.errordetails); - modbusRecord.setInsuser(cu.getId()); - modbusRecordService.save(modbusRecord); - return "result"; - } - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.modbusFigService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getlist4combo.do") - public ModelAndView getlist4combo(HttpServletRequest request,Model model) { - - List list = this.modbusFigService.selectListByWhere(" where flag='启用'"); - - //PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - //String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - - //id转名称,传名称跟id到巡检点前端方法 - @RequestMapping("/getModbusFig4Select.do") - public String getModbusFig4Select(HttpServletRequest request,Model model){ - List modbusFigs = this.modbusFigService.selectListByWhere("where 1=1"); - JSONArray json = new JSONArray(); - if(modbusFigs!=null && modbusFigs.size()>0){ - for(int i=0;i list = modbusInterfaceService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value="/getTreeList.do", method = RequestMethod.POST) - public ModelAndView getTreeList(HttpServletRequest request, Model model) { - String wherestr = "where 1=1 "; - -// if(request.getParameter("unitId")!=null && !request.getParameter("unitId").isEmpty()){ -// wherestr += " and unit_id = '"+request.getParameter("unitId")+"' "; -// } - - List list = new ArrayList<>(); - - try { - list = modbusInterfaceService.selectListByWhere(wherestr); - } catch (Exception e) { - e.printStackTrace(); - } - JSONArray result = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - for (ModbusInterface modbusInterface : list) { - jsonObject.put("id", modbusInterface.getId()); - jsonObject.put("text", modbusInterface.getName()); - result.add(jsonObject); - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/controller/work/ModbusPointController.java b/src/com/sipai/controller/work/ModbusPointController.java deleted file mode 100644 index 2a303cd5..00000000 --- a/src/com/sipai/controller/work/ModbusPointController.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.AbnormityStatusEnum; -import com.sipai.entity.enums.ModbusRegisterTypeEnum; -import com.sipai.entity.enums.ModbusTypeEnum; -import com.sipai.entity.work.ModbusPoint; -import com.sipai.service.work.ModbusPointService; -import com.sipai.tools.CommUtil; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; -import org.springframework.security.access.method.P; -import org.springframework.ui.Model; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.List; - -/** - * @description tb_work_interface_modbus - * @author ycy - * @date 2023-02-08 - */ -@RestController -@RequestMapping(value = "/work/pointModbus") -@Api(value = "/work/pointModbus", tags = "Modbus点位配置接口") -public class ModbusPointController { - - - @Resource - private ModbusPointService modbusPointService; - - /** - * 新增 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/dosave.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "新增数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result insert(@ModelAttribute ModbusPoint modbusPoint){ - // 同一modbus服务器下 寄存器类型下 地址不可重复 - - List modbusPoints = new ArrayList<>(); - try { - modbusPoints = modbusPointService.selectListByWhere("where address = '" + modbusPoint.getAddress() + "' and p_id = '" + modbusPoint.getpId() + "' and reguster_type = '" + modbusPoint.getRegusterType() + "'"); - } catch (Exception e) { - e.printStackTrace(); - } - if (!CollectionUtils.isEmpty(modbusPoints)) { - return Result.failed("新增失败——请确认当前Modbus服务器相同寄存器类型下是否存在该录入寄存器地址!"); - } - modbusPoint.setId(CommUtil.getUUID()); - modbusPoint.setCode(modbusPoint.getpId() + "_" + modbusPoint.getRegusterType() + "_" + modbusPoint.getAddress()); - int code = modbusPointService.save(modbusPoint); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - return result; - } - - /** - * 刪除 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/delete.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result delete(@RequestParam(value = "id") String id){ - int code = modbusPointService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - return result; - } - - /** - * 多删 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/deletes.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "删除数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result deletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids){ - ids = ids.replace(",", "','"); - int code = this.modbusPointService.deleteByWhere("where id in ('" + ids + "')"); - Result result = new Result(); - if (code > 0) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - return result; - } - - /** - * 更新 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping(value = "/doUpdate.do", method = RequestMethod.POST, produces = {"application/json"}) - @ApiOperation(value = "修改数据", notes = "") - @ApiResponses({ - @ApiResponse(code = 400, message = "请求参数错误"), - @ApiResponse(code = 404, message = "接口路径不正确") - }) - public Result update(HttpServletRequest request, Model model, - @ModelAttribute ModbusPoint modbusPoint){ - List modbusPoints = modbusPointService.selectListByWhere("where id != '"+ modbusPoint.getId() +"' and address = '" + modbusPoint.getAddress() + "' and p_id = '" + modbusPoint.getpId() + "' and reguster_type = '" + modbusPoint.getRegusterType() + "'"); - if (!CollectionUtils.isEmpty(modbusPoints)) { - return Result.failed("新增失败——请确认当前Modbus服务器相同寄存器类型下是否存在该录入寄存器地址!"); - } - int code = modbusPointService.update(modbusPoint); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - return result; - } - - /** - * 查询 根据主键 id 查询 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping("/doAdd.do") - public ModelAndView doAdd(HttpServletRequest request, ModelAndView mv, - @RequestParam(value = "pId") String pId){ - mv.addObject("pId", pId); - mv.setViewName("work/modbusPointAdd"); - return mv; - } - /** - * 查询 根据主键 id 查询 - * @author ycy - * @date 2023/02/08 - **/ - @RequestMapping("/doEdit.do") - public ModelAndView doedit(HttpServletRequest request, ModelAndView mv, - @RequestParam(value = "id") String id){ - ModbusPoint modbusPoint = modbusPointService.selectById(id); - mv.addObject("modbusPoint", modbusPoint); - mv.setViewName("work/modbusPointEdit"); - return mv; - } - - /** - * 查询 分页查询 - * @author ycy - * @date 2023/02/08 - **/ - /** 获取列表 - * @param request - * @param model - * @return - */ - @ApiOperation(value = "modbus点位配置列表", notes = "modbus点位配置列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "pId", value = "父链接id",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "status", value = "状态",dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "sort", value = "排序字段", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "order", value = "排序方式", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "page", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "rows", value = "每页条数", dataType = "int", paramType = "query", required = true), - }) - @RequestMapping(value="/getList.do", method = RequestMethod.GET) - public ModelAndView pageList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null) { - sort = " morder "; - } - if (order == null) { - order = " asc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - - if(request.getParameter("pId")!=null && !request.getParameter("pId").isEmpty()){ - wherestr += " and p_id= '"+request.getParameter("pId")+"' "; - } - - PageHelper.startPage(page, rows); - List list = modbusPointService.selectListByWhere(wherestr + orderstr); - for (ModbusPoint modbusPoint : list) { - modbusPoint.setStatusText(modbusPoint.getStatus() == 0 ? "禁用" : "启用"); - modbusPoint.setPointTypeText(ModbusTypeEnum.getNameByid(modbusPoint.getPointType())); - modbusPoint.setResgusterTypeText(ModbusRegisterTypeEnum.getNameByid(modbusPoint.getRegusterType())); - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/work/PersonalMpCollectionController.java b/src/com/sipai/controller/work/PersonalMpCollectionController.java deleted file mode 100644 index a5100b79..00000000 --- a/src/com/sipai/controller/work/PersonalMpCollectionController.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.entity.scada.PersonalMpCollection; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.scada.PersonalMpCollectionService; -import com.sipai.service.work.ScadaPicService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/personalMpCollection") -public class PersonalMpCollectionController { - @Resource - private PersonalMpCollectionService personalMpCollectionService; - @Resource - private UserService userService; - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model){ - PersonalMpCollection pCollection =new PersonalMpCollection(); - pCollection.setId(CommUtil.getUUID()); - pCollection.setUserid(request.getParameter("userId")); - pCollection.setMpids(request.getParameter("mpid")); - pCollection.setUnitId(request.getParameter("bizid")); - - int code = this.personalMpCollectionService.save(request.getParameter("bizid"),pCollection); - String result=""; - if(code==1){ - result="suc"; - }else{ - result="fail"; - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model){ - String wherestr=" where userid='"+request.getParameter("userId")+"' and unit_id='"+request.getParameter("bizid")+"' and mpids='"+request.getParameter("mpid")+"' "; - List list = this.personalMpCollectionService.selectListByWhere(request.getParameter("bizid"),wherestr); - int codes=0; - String result=""; - if(list!=null&&list.size()>0){ - for(int i=0;i0){ - result="suc"; - }else{ - result="fail"; - } - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/work/ProductionIndexDataController.java b/src/com/sipai/controller/work/ProductionIndexDataController.java deleted file mode 100644 index 9eeba92b..00000000 --- a/src/com/sipai/controller/work/ProductionIndexDataController.java +++ /dev/null @@ -1,933 +0,0 @@ -package com.sipai.controller.work; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; -import org.apache.poi.xwpf.usermodel.ParagraphAlignment; -import org.apache.poi.xwpf.usermodel.XWPFDocument; -import org.apache.poi.xwpf.usermodel.XWPFParagraph; -import org.apache.poi.xwpf.usermodel.XWPFRun; -import org.apache.poi.xwpf.usermodel.XWPFStyle; -import org.apache.poi.xwpf.usermodel.XWPFStyles; -import org.apache.poi.xwpf.usermodel.XWPFTable; -import org.apache.poi.xwpf.usermodel.XWPFTableRow; -import org.apache.xmlbeans.XmlException; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTShd; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyle; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyles; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STShd; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STStyleType; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.base.PoiUtils; -import com.sipai.entity.base.Result; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexData; -import com.sipai.entity.work.ProductionIndexPlanNameData; -import com.sipai.service.work.ProductionIndexPlanNameConfigureService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.work.ProductionIndexDataService; -import com.sipai.service.work.ProductionIndexPlanNameDataService; -import com.sipai.tools.CommUtil; - -import static com.sipai.entity.enums.DayValueEnum.AVG_VALUE; -import static com.sipai.entity.enums.DayValueEnum.MONTH_VALUE; - -@Controller -@RequestMapping("/work/productionIndexData") -public class ProductionIndexDataController { - @Resource - private ProductionIndexDataService productionIndexDataService; - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; - @Resource - private ProductionIndexPlanNameDataService productionIndexPlanNameDataService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "work/productionIndexDataList"; - } - - @RequestMapping("/showViewList.do") - public String showViewList(HttpServletRequest request, Model model) { - return "work/productionIndexDataViewList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("date"); - User cu = (User) request.getSession().getAttribute("cu"); - - JSONArray arr = new JSONArray(); - - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id='" + unitId + "' order by morder asc "); - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Year + "' and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectAvgByLineCWhere(whereString); - if (dmlist2.get(0) != null) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - for (int d = 1; d < 13; d++) { - String cDate = String.valueOf(d); - if (d < 10) { - cDate = "0" + cDate; - } - cDate = date.substring(0, 4) + "-" + cDate; - - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", cDate); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + cDate + "-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - - JSONObject obj2 = new JSONObject(); - JSONArray arrd2 = new JSONArray(); - obj2.put("date", cDate); - obj2.put("type", ProductionIndexPlanNameData.Type_Month); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + cDate + "-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd2.add(dmlist2.get(0).getValue()); - } else { - arrd2.add(0); - } - } - obj2.put("value", arrd2); - arr.add(obj2); - } - - } - -// if(clist!=null&&clist.size()>0){ -// int maxDate=CommUtil.getDaysByYearMonth(Integer.valueOf(date.substring(0, 4)),Integer.valueOf(date.substring(5, 7))); -// for(int d=1;d<(maxDate+1);d++){ -// String showdate=String.valueOf(d); -// if(d<10){ -// showdate="0"+String.valueOf(d); -// } -// //目标值 -// JSONObject obj = new JSONObject(); -// JSONArray arrd=new JSONArray(); -// obj.put("date", date.substring(0, 7)+"-"+showdate); -// obj.put("type", ProductionIndexPlanNameData.Type_Day); -// for(int i=0;i dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); -// if(dmlist2!=null&&dmlist2.size()>0){ -// arrd.add(dmlist2.get(0).getValue()); -// }else{ -// arrd.add(0); -// } -// } -// obj.put("value", arrd); -// arr.add(obj); -// //实际值 -// JSONObject obj2 = new JSONObject(); -// JSONArray arrd2=new JSONArray(); -// obj2.put("date", date.substring(0, 7)+"-"+showdate); -// obj2.put("type", ProductionIndexPlanNameData.Type_Day); -// for(int i=0;i dmlist2 = this.productionIndexDataService.selectListByWhere(whereString); -// if(dmlist2!=null&&dmlist2.size()>0){ -// arrd2.add(dmlist2.get(0).getValue()); -// }else{ -// arrd2.add(0); -// } -// } -// obj2.put("value", arrd2); -// arr.add(obj2); -// } -// } - - String result = "{\"rows\":" + arr + "}"; -// System.out.println(arr); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getViewList.do") - public ModelAndView getViewList(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("date"); - User cu = (User) request.getSession().getAttribute("cu"); - - JSONArray arr = new JSONArray(); - - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id='" + unitId + "' order by morder asc "); - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Year + "' and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectAvgByLineCWhere(whereString); - if (dmlist2.get(0) != null) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - for (int m = 1; m < 13; m++) { - String monthdate = date.substring(0, 4); - if (m < 10) { - monthdate = monthdate + "-0" + m; - } else { - monthdate = monthdate + "-" + m; - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", monthdate.substring(0, 7)); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + monthdate + "-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", monthdate.substring(0, 7)); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + monthdate + "-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - } - - String result = "{\"rows\":" + arr + "}"; -// System.out.println(arr); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getDayViewList.do") - public ModelAndView getDayViewList(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("date"); - User cu = (User) request.getSession().getAttribute("cu"); - - JSONArray arr = new JSONArray(); - - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id='" + unitId + "' order by morder asc "); - - if (clist != null && clist.size() > 0) { - int maxDate = CommUtil.getDaysByYearMonth(Integer.valueOf(date.substring(0, 4)), Integer.valueOf(date.substring(5, 7))); - for (int d = 1; d < (maxDate + 1); d++) { - String showdate = String.valueOf(d); - if (d < 10) { - showdate = "0" + String.valueOf(d); - } - //目标值 - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 7) + "-" + showdate); - obj.put("type", ProductionIndexPlanNameData.Type_Day); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + date.substring(0, 7) + "-" + showdate + "')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - //实际值 - JSONObject obj2 = new JSONObject(); - JSONArray arrd2 = new JSONArray(); - obj2.put("date", date.substring(0, 7) + "-" + showdate); - obj2.put("type", ProductionIndexPlanNameData.Type_Day); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Day + "' and datediff(day,planDate,'" + date.substring(0, 7) + "-" + showdate + "')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd2.add(dmlist2.get(0).getValue()); - } else { - arrd2.add(0); - } - } - obj2.put("value", arrd2); - arr.add(obj2); - } - } - - String result = "{\"rows\":" + arr + "}"; -// System.out.println(arr); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - return "work/productionIndexDataAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String planDate = ""; - - List list = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' order by morder asc "); - int sucNum = 0; - - String orderstr = ""; - String wherestr = ""; - List dlist = null; - - if (type.equals(ProductionIndexPlanNameData.Type_Month)) { - planDate = request.getParameter("monthtimeId") + "-01"; - wherestr = " where 1=1 and datediff(month,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Month + "' and unit_id='" + unitId + "' "; - dlist = this.productionIndexDataService.selectListByWhere(wherestr); - } else if (type.equals(ProductionIndexPlanNameData.Type_Year)) { - planDate = request.getParameter("yeartimeId") + "-01-01"; - wherestr = " where 1=1 and datediff(year,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Year + "' and unit_id='" + unitId + "' "; - dlist = this.productionIndexDataService.selectListByWhere(wherestr); - } - - if (dlist.size() == 0) { - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - double value = Double.valueOf(request.getParameter(list.get(i).getId())); - ProductionIndexData pIndexPlanNameData = new ProductionIndexData(); - pIndexPlanNameData.setId(CommUtil.getUUID()); - pIndexPlanNameData.setConfigureid(list.get(i).getId()); - pIndexPlanNameData.setValue(value); - pIndexPlanNameData.setPlandate(planDate); - pIndexPlanNameData.setType(type); - pIndexPlanNameData.setUnitId(unitId); - int code = this.productionIndexDataService.save(pIndexPlanNameData); - - if (code == Result.SUCCESS) { - sucNum++; - } else { - } - } - } - } else { - sucNum = -1; - } - - model.addAttribute("result", CommUtil.toJson(sucNum)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model) { - -// ProductionIndexData productionIndexData = this.productionIndexDataService.selectById(id); -// model.addAttribute("productionIndexData",productionIndexData); - return "work/productionIndexDataEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute("productionIndexData") ProductionIndexData productionIndexData) { - String[] datas = request.getParameter("datas").split(","); - String planDate = ""; - if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Month)) { - planDate = request.getParameter("planDate") + "-01"; - } else if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Year)) { - planDate = request.getParameter("planDate") + "-01-01"; - } else if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Day)) { - planDate = request.getParameter("planDate"); - } - - int code = 0; - if (datas != null && datas.length > 0) { - for (int i = 0; i < datas.length; i++) { - String[] datass = datas[i].split(":"); - if (datass != null && datass.length > 1) { - String cid = datass[0]; - double value = Double.valueOf(datass[1]); - - String wherestr = ""; - List list = null; - if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Month)) { - wherestr = " where 1=1 and datediff(month,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Month + "' and configureId='" + cid + "' and unit_id='" + productionIndexData.getUnitId() + "' "; - list = this.productionIndexDataService.selectListByWhere(wherestr); - } else if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Year)) { - wherestr = " where 1=1 and datediff(year,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Year + "' and configureId='" + cid + "' and unit_id='" + productionIndexData.getUnitId() + "' "; - list = this.productionIndexDataService.selectListByWhere(wherestr); - } else if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Day)) { - wherestr = " where 1=1 and datediff(day,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Day + "' and configureId='" + cid + "' and unit_id='" + productionIndexData.getUnitId() + "' "; - list = this.productionIndexDataService.selectListByWhere(wherestr); - } - - if (list != null && list.size() > 0) { - ProductionIndexData p = list.get(0); - p.setValue(value); - int res = this.productionIndexDataService.update(p); - - //更新测量点数据 - if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Day)) { - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where id='" + p.getConfigureid() + "' "); - if (clist != null && clist.size() > 0) { - if (clist.get(0).getMpid() != null && !clist.get(0).getMpid().equals("")) { - String unitId = clist.get(0).getUnitId(); - String mpid = clist.get(0).getMpid(); - - MPoint mPoint = this.mPointService.selectById(unitId, mpid); - mPoint.setParmvalue(new BigDecimal(value)); - mPoint.setMeasuredt(planDate); - this.mPointService.update2(unitId, mPoint); - - List mphlist = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + mpid, " where datediff(day,measuredt,'" + planDate + "')=0 "); - if (mphlist != null && mphlist.size() > 0) {//主表更新方法里带有附表更新功能 - MPointHistory mPointHistory = mphlist.get(0); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(planDate + " 00:00:00.000"); - mPointHistory.setTbName("tb_mp_" + mpid); - this.mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(planDate); - mPointHistory.setTbName("tb_mp_" + mpid); - this.mPointHistoryService.save(unitId, mPointHistory); - } - } - - } - } - - - if (res == 1) { - code++; - } - } else {//找不到记录则新增(配置新点时) - ProductionIndexData productionIndexDataAdd = new ProductionIndexData(); - productionIndexDataAdd.setId(CommUtil.getUUID()); - productionIndexDataAdd.setConfigureid(cid); - productionIndexDataAdd.setValue(Double.valueOf(value)); - productionIndexDataAdd.setPlandate(planDate); - productionIndexDataAdd.setType(productionIndexData.getType()); - productionIndexDataAdd.setUnitId(productionIndexData.getUnitId()); - int res = this.productionIndexDataService.save(productionIndexDataAdd); - - //更新测量点数据 - if (productionIndexData.getType().equals(ProductionIndexPlanNameData.Type_Day)) { - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where id='" + productionIndexDataAdd.getConfigureid() + "' "); - if (clist != null && clist.size() > 0) { - if (clist.get(0).getMpid() != null && !clist.get(0).getMpid().equals("")) { - String unitId = clist.get(0).getUnitId(); - String mpid = clist.get(0).getMpid(); - - MPoint mPoint = this.mPointService.selectById(unitId, mpid); - mPoint.setParmvalue(new BigDecimal(value)); - mPoint.setMeasuredt(planDate); - this.mPointService.update2(unitId, mPoint); - - List mphlist = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + mpid, " where datediff(day,measuredt,'" + planDate + "')=0 "); - if (mphlist != null && mphlist.size() > 0) {//主表更新方法里带有附表更新功能 - MPointHistory mPointHistory = mphlist.get(0); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(planDate + " 00:00:00.000"); - mPointHistory.setTbName("tb_mp_" + mpid); - this.mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - } else { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(planDate); - mPointHistory.setTbName("tb_mp_" + mpid); - this.mPointHistoryService.save(unitId, mPointHistory); - } - } - - } - } - - - if (res == 1) { - code++; - } - } - } - } - } - - model.addAttribute("result", code); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - String planDate = request.getParameter("date"); - String unitId = request.getParameter("unitId"); - - String orderstr = ""; - String wherestr = ""; - List dlist = null; - - if (type.equals(ProductionIndexPlanNameData.Type_Month)) { - planDate = planDate + "-01"; - orderstr = " order by morder "; - wherestr = " where 1=1 and datediff(month,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Month + "' and unit_id='" + unitId + "' "; - dlist = this.productionIndexDataService.selectListByWhere(wherestr + orderstr); - } else if (type.equals(ProductionIndexPlanNameData.Type_Year)) { - planDate = planDate + "-01-01"; - orderstr = " order by morder "; - wherestr = " where 1=1 and datediff(year,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Year + "' and unit_id='" + unitId + "' "; - dlist = this.productionIndexDataService.selectListByWhere(wherestr + orderstr); - } - String ids = ""; - if (dlist != null && dlist.size() > 0) { - for (int i = 0; i < dlist.size(); i++) { - ids += dlist.get(i).getId() + ","; - } - } - ids = ids.replace(",", "','"); - - int code = this.productionIndexDataService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", code); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - - String delids = ""; - String[] ids = request.getParameter("ids").split(","); - if (ids != null && ids.length > 0) { - for (int i = 0; i < ids.length; i++) { - String[] idss = ids[i].split(":"); - if (idss != null && idss.length > 1) { - String type = idss[0]; - String planDate = idss[1]; - - String orderstr = ""; - String wherestr = ""; - List dlist = null; - - if (type.equals(ProductionIndexPlanNameData.Type_Month)) { - planDate = planDate + "-01"; - orderstr = " order by morder "; - wherestr = " where 1=1 and datediff(month,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Month + "' and unit_id='" + unitId + "' "; - dlist = this.productionIndexDataService.selectListByWhere(wherestr + orderstr); - } else if (type.equals(ProductionIndexPlanNameData.Type_Year)) { - planDate = planDate + "-01-01"; - orderstr = " order by morder "; - wherestr = " where 1=1 and datediff(year,planDate,'" + planDate + "')=0 and type='" + ProductionIndexPlanNameData.Type_Year + "' and unit_id='" + unitId + "' "; - dlist = this.productionIndexDataService.selectListByWhere(wherestr + orderstr); - } - - if (dlist != null && dlist.size() > 0) { - for (int m = 0; m < dlist.size(); m++) { - delids += dlist.get(m).getId() + ","; - } - } - - } - } - } - - delids = delids.replace(",", "','"); - int code = this.productionIndexDataService.deleteByWhere("where id in ('" + delids + "')"); - model.addAttribute("result", code); - return "result"; - } - - @RequestMapping("/getConfigureJson.do") - public String getConfigureJson(HttpServletRequest request, Model model) { - List list = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' order by morder asc "); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getEditDataJson.do") - public String getEditDataJson(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - String planDate = request.getParameter("planDate"); - String unitId = request.getParameter("unitId"); - - String whereString = " where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id='" + request.getParameter("unitId") + "' "; - if (request.getParameter("cid") != null && request.getParameter("cid").length() > 0) { - String cids = request.getParameter("cid").replace(",", "','"); - whereString += " and id in ('" + cids + "') "; - } - - List list = this.productionIndexPlanNameConfigureService.selectListByWhereForEdit2(whereString + " order by morder asc", type, planDate, unitId); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getDayTargetAndActualValue.do") - public String getDayTargetAndActualValue(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - String planDate = request.getParameter("planDate"); - String unitId = request.getParameter("unitId"); - - String whereString = " where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id='" + request.getParameter("unitId") + "' "; - if (request.getParameter("cid") != null && request.getParameter("cid").length() > 0) { - String cids = request.getParameter("cid").replace(",", "','"); - whereString += " and id in ('" + cids + "') "; - } - - List list = this.productionIndexPlanNameConfigureService.getDayTargetAndActualValue(whereString + " order by morder asc", planDate, unitId); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - - @RequestMapping("/getListForWorkOrder.do") - public ModelAndView getListForWorkOrder(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String date = request.getParameter("date"); - User cu = (User) request.getSession().getAttribute("cu"); - - JSONArray arr = new JSONArray(); - - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='" + ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id='" + unitId + "' order by morder asc "); - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Year + "' and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectAvgByLineCWhere(whereString); - if (dmlist2.get(0) != null) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 7)); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + date.substring(0, 7) + "-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 7)); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + date.substring(0, 7) + "-01')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd.add(dmlist2.get(0).getValue()); - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - } - - if (clist != null && clist.size() > 0) { -// int maxDate=CommUtil.getDaysByYearMonth(Integer.valueOf(date.substring(0, 4)),Integer.valueOf(date.substring(5, 7))); - int maxDate = 0; - if (date.substring(5, 7).equals(CommUtil.nowDate().substring(5, 7))) { - maxDate = Integer.valueOf(CommUtil.nowDate().substring(8, 10)); - } else { - maxDate = CommUtil.getDaysByYearMonth(Integer.valueOf(date.substring(0, 4)), Integer.valueOf(date.substring(5, 7))); - } - for (int d = maxDate; d > 0; d--) { - String showdate = String.valueOf(d); - if (d < 10) { - showdate = "0" + String.valueOf(d); - } - //目标值 - JSONObject obj = new JSONObject(); - JSONArray arrd = new JSONArray(); - obj.put("date", date.substring(0, 7) + "-" + showdate); - obj.put("type", ProductionIndexPlanNameData.Type_Day); - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' and datediff(month,planDate,'" + date.substring(0, 7) + "-" + showdate + "')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - if (AVG_VALUE.getId().equals(clist.get(i).getDayValue())) { - try { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - Date parseDate = simpleDateFormat.parse(date); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(parseDate); - int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - Double avg = (dmlist2.get(0).getValue()/actualMaximum); - String format = new DecimalFormat("#.00").format(avg); - if (avg < 1) { - format = "0" + format; - } - arrd.add(format); - } catch (Exception e) { - arrd.add(dmlist2.get(0).getValue()); - } - } else { - arrd.add(dmlist2.get(0).getValue()); - } - } else { - arrd.add(0); - } - } - obj.put("value", arrd); - arr.add(obj); - //实际值 - JSONObject obj2 = new JSONObject(); - JSONArray arrd2 = new JSONArray(); - obj2.put("date", date.substring(0, 7) + "-" + showdate); - obj2.put("type", ProductionIndexPlanNameData.Type_Day); - String cids = ""; - for (int i = 0; i < clist.size(); i++) { - String cid = clist.get(i).getId(); - String whereString = " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Day + "' and datediff(day,planDate,'" + date.substring(0, 7) + "-" + showdate + "')=0 and unit_id='" + unitId + "' "; - List dmlist2 = this.productionIndexDataService.selectListByWhere(whereString); - if (dmlist2 != null && dmlist2.size() > 0) { - arrd2.add(dmlist2.get(0).getValue()); - } else { - arrd2.add(0); - } - cids += cid + ","; - } - obj2.put("value", arrd2); - obj2.put("cid", cids); - arr.add(obj2); - } - } - - String result = "{\"rows\":" + arr + "}"; -// System.out.println(arr); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getCurveData.do") - public ModelAndView getCurveData(HttpServletRequest request, Model model) { - String cid = request.getParameter("cid"); - String date = request.getParameter("date"); - String unitId = request.getParameter("unitId"); - - JSONObject planObject = new JSONObject(); - List dmlist = this.productionIndexPlanNameDataService.selectListByWhere( - " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Month + "' " + - " and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' order by planDate"); - JSONArray planJson = new JSONArray(); - for (ProductionIndexPlanNameData plan : - dmlist) { - JSONArray j = new JSONArray(); - j.add(plan.getPlandate().substring(0,10)); - j.add(plan.getValue()); - planJson.add(j); - } - planObject.put("name", "计划值"); - planObject.put("data", planJson); - - JSONObject dataObject = new JSONObject(); - List dmlist2 = this.productionIndexDataService.selectListByWhere( - " where 1=1 and configureId='" + cid + "' and type='" + ProductionIndexPlanNameData.Type_Day + "' " + - " and datediff(year,planDate,'" + date.substring(0, 4) + "-01-01')=0 and unit_id='" + unitId + "' order by planDate"); - JSONArray dataJson = new JSONArray(); - for (ProductionIndexData data : - dmlist2) { - JSONArray j = new JSONArray(); - j.add(data.getPlandate().substring(0,10)); - j.add(data.getValue()); - dataJson.add(j); - } - dataObject.put("name", "实际值"); - dataObject.put("data", dataJson); - - JSONArray mainJson = new JSONArray(); - mainJson.add(planObject); - mainJson.add(dataObject); - - model.addAttribute("result", mainJson); - return new ModelAndView("result"); - } - - @RequestMapping("/showCurveView.do") - public String showCurveView(HttpServletRequest request, Model model) { - return "work/productionIndexDataCurve"; - } - -} diff --git a/src/com/sipai/controller/work/ProductionIndexPlanNameConfigureController.java b/src/com/sipai/controller/work/ProductionIndexPlanNameConfigureController.java deleted file mode 100644 index 2d72a611..00000000 --- a/src/com/sipai/controller/work/ProductionIndexPlanNameConfigureController.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.sipai.controller.work; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.WordAnalysisReportStructure; -import com.sipai.service.work.ProductionIndexPlanNameConfigureService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/productionIndexPlanNameConfigure") -public class ProductionIndexPlanNameConfigureController { - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; - - @RequestMapping("/showList.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "work/productionIndexPlanNameConfigureList"; - } - - @RequestMapping("/showManage.do") - public String showManage(HttpServletRequest request, Model model){ - return "work/productionIndexPlanNameConfigureManage"; - } - - @RequestMapping("/showTree.do") - public String showTree(HttpServletRequest request, Model model){ - return "work/productionIndexPlanNameConfigureTree"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - - String orderstr=" order by morder asc"; - String wherestr=" where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+request.getParameter("unitId")+"' "; - -// PageHelper.startPage(page, rows); - List list = this.productionIndexPlanNameConfigureService.selectListByWhere(wherestr+orderstr); -// PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - - return "work/productionIndexPlanNameConfigureAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="productionIndexPlanNameConfigure") ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure){ - User cu= (User)request.getSession().getAttribute("cu"); - productionIndexPlanNameConfigure.setId(CommUtil.getUUID()); - productionIndexPlanNameConfigure.setInsdt(CommUtil.nowDate()); - productionIndexPlanNameConfigure.setInsuser(cu.getId()); - - int code = this.productionIndexPlanNameConfigureService.save(productionIndexPlanNameConfigure); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure = this.productionIndexPlanNameConfigureService.selectById(id); - model.addAttribute("productionIndexPlanNameConfigure",productionIndexPlanNameConfigure); - return "work/productionIndexPlanNameConfigureEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="productionIndexPlanNameConfigure") ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure){ - int code = this.productionIndexPlanNameConfigureService.update(productionIndexPlanNameConfigure); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code = this.productionIndexPlanNameConfigureService.deleteById(id); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - int sucNum =0; - ids=ids.replace(",","','"); - List list = this.productionIndexPlanNameConfigureService.selectListByWhere("where id in ('"+ids+"')"); - if(list!=null&&list.size()>0){ - for(int i=0;i list = this.productionIndexPlanNameConfigureService.selectListByWhere("where 1=1 and unit_id='"+unitId+"' " - + " " - + " order by type,morder"); - - String json = this.productionIndexPlanNameConfigureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } -} diff --git a/src/com/sipai/controller/work/ProductionIndexPlanNameDataController.java b/src/com/sipai/controller/work/ProductionIndexPlanNameDataController.java deleted file mode 100644 index 21a96288..00000000 --- a/src/com/sipai/controller/work/ProductionIndexPlanNameDataController.java +++ /dev/null @@ -1,549 +0,0 @@ -package com.sipai.controller.work; - -import java.io.File; -import java.io.IOException; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.log.SysoCounter; -import com.sipai.entity.base.Result; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexData; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexPlanNameData; -import com.sipai.entity.work.ProductionIndexPlanNameDataHis; -import com.sipai.service.work.ProductionIndexPlanNameConfigureService; -import com.sipai.service.work.ProductionIndexPlanNameDataHisService; -import com.sipai.service.work.ProductionIndexPlanNameDataService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/productionIndexPlanNameData") -public class ProductionIndexPlanNameDataController { - @Resource - private ProductionIndexPlanNameDataService productionIndexPlanNameDataService; - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; - @Resource - private ProductionIndexPlanNameDataHisService productionIndexPlanNameDataHisService; - - @RequestMapping("/showList.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "work/productionIndexPlanNameDataList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String date=request.getParameter("date"); - User cu=(User)request.getSession().getAttribute("cu"); - - JSONArray arr=new JSONArray(); - - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+unitId+"' order by morder asc "); - if(clist!=null&&clist.size()>0){ - JSONObject obj = new JSONObject(); - for(int i=0;i dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if(dmlist2!=null&&dmlist2.size()>0){ - if(i==0){ - obj.put("date", dmlist2.get(0).getPlandate().substring(0, 4)); - obj.put("type", ProductionIndexPlanNameData.Type_Year); - } - List planNameDataHis = this.productionIndexPlanNameDataHisService.selectListByWhere(" where pid='"+dmlist2.get(0).getId()+"' "); - if(planNameDataHis!=null&&planNameDataHis.size()>0){ - obj.put("value"+i,dmlist2.get(0).getValue()+","+dmlist2.get(0).getId()); - }else{ - obj.put("value"+i,dmlist2.get(0).getValue()); - } - }else{ - obj.put("value"+i,0); - } - } - arr.add(obj); - } - - if(clist!=null&&clist.size()>0){ - JSONObject obj = new JSONObject(); - for(int d=1;d<13;d++){ - for(int i=0;i dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if(dmlist2!=null&&dmlist2.size()>0){ - if(dmlist2!=null&&dmlist2.size()>0){ - if(i==0){ - obj.put("date", dmlist2.get(0).getPlandate().substring(0, 7)); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - } - List planNameDataHis = this.productionIndexPlanNameDataHisService.selectListByWhere(" where pid='"+dmlist2.get(0).getId()+"' "); - if(planNameDataHis!=null&&planNameDataHis.size()>0){ - obj.put("value"+i,dmlist2.get(0).getValue()+","+dmlist2.get(0).getId()); - }else{ - obj.put("value"+i,dmlist2.get(0).getValue()); - } - }else{ - obj.put("value"+i,0); - } - }else{ - if(i==0){ - String showdate=String.valueOf(d); - if(d<10){ - showdate="0"+String.valueOf(d); - } - obj.put("date", date.substring(0, 4)+"-"+showdate); - obj.put("type", ProductionIndexPlanNameData.Type_Month); - } - obj.put("value"+i,0); - } - } - arr.add(obj); - - } - } - - String result="{\"rows\":"+arr+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getDayList.do") - public ModelAndView getDayList(HttpServletRequest request,Model model) { - String unitId=request.getParameter("unitId"); - String data=request.getParameter("monthDate"); - User cu=(User)request.getSession().getAttribute("cu"); - - JSONArray arr=new JSONArray(); - - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+unitId+"' order by morder asc "); - if(clist!=null&&clist.size()>0){ - JSONObject obj = new JSONObject(); - int maxDate=CommUtil.getDaysByYearMonth(Integer.valueOf(data.substring(0, 4)),Integer.valueOf(data.substring(5, 7))); - for(int d=1;d<(maxDate+1);d++){ - for(int i=0;i dmlist2 = this.productionIndexPlanNameDataService.selectListByWhere(whereString); - if(dmlist2!=null&&dmlist2.size()>0){ - if(i==0){ - obj.put("date", dmlist2.get(0).getPlandate().substring(0, 10)); - obj.put("type", ProductionIndexPlanNameData.Type_Day); - } - if(dmlist2!=null&&dmlist2.size()>0){ - obj.put("value"+i,dmlist2.get(0).getValue()); - }else{ - obj.put("value"+i,0); - } - }else{ - if(i==0){ - String showdate=String.valueOf(d); - if(d<10){ - showdate="0"+String.valueOf(d); - } - obj.put("date", data.substring(0, 7)+"-"+showdate); - obj.put("type", ProductionIndexPlanNameData.Type_Day); - } - obj.put("value"+i,0); - } - } - arr.add(obj); - } - } - - - String result="{\"rows\":"+arr+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/productionIndexPlanNameDataAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model){ - String unitId=request.getParameter("unitId"); - String type=request.getParameter("type"); - String planDate=""; - - List list = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+unitId+"' order by morder asc "); - int sucNum=0; - - String orderstr=""; - String wherestr=""; - List dlist = null; - - if(type.equals(ProductionIndexPlanNameData.Type_Month)){ - planDate=request.getParameter("monthtimeId")+"-01"; - wherestr=" where 1=1 and datediff(month,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Month+"' and unit_id='"+unitId+"' "; - dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr); - }else if(type.equals(ProductionIndexPlanNameData.Type_Year)){ - planDate=request.getParameter("yeartimeId")+"-01-01"; - wherestr=" where 1=1 and datediff(year,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Year+"' and unit_id='"+unitId+"' "; - dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr); - } - - if(dlist.size()==0){ - if(list!=null&&list.size()>0){ - for(int i=0;i1){ -// numberNum="."; -// for(int n=0;n0){ - for(int i=0;i1){ - String cid=datass[0]; - double value=Double.valueOf(datass[1]); - String wherestr=""; - List list = null; - if(productionIndexPlanNameData.getType().equals(ProductionIndexPlanNameData.Type_Month)){ - wherestr=" where 1=1 and datediff(month,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Month+"' and configureId='"+cid+"' and unit_id='"+productionIndexPlanNameData.getUnitId()+"' "; - list = this.productionIndexPlanNameDataService.selectListByWhere(wherestr); - }else if(productionIndexPlanNameData.getType().equals(ProductionIndexPlanNameData.Type_Year)){ - wherestr=" where 1=1 and datediff(year,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Year+"' and configureId='"+cid+"' and unit_id='"+productionIndexPlanNameData.getUnitId()+"' "; - list = this.productionIndexPlanNameDataService.selectListByWhere(wherestr); - } -// else if(productionIndexPlanNameData.getType().equals(ProductionIndexPlanNameData.Type_Day)){ -// wherestr=" where 1=1 and datediff(day,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Day+"' and configureId='"+cid+"' and unit_id='"+productionIndexPlanNameData.getUnitId()+"' "; -// list = this.productionIndexPlanNameDataService.selectListByWhere(wherestr); -// } - - if(list!=null&&list.size()>0){ - ProductionIndexPlanNameData p=list.get(0); - - //和之前值对比,如果不同则记录调整历史 -// System.out.println(p.getConfigureid()+"===="+p.getValue()); -// System.out.println(p.getConfigureid()+"===="+value); - if(p.getValue()!=value){ - ProductionIndexPlanNameDataHis pDataHis=new ProductionIndexPlanNameDataHis(); - pDataHis.setId(CommUtil.getUUID()); - pDataHis.setInsuser(cu.getId()); - pDataHis.setInsdt(CommUtil.nowDate()); - pDataHis.setValue(p.getValue()); - pDataHis.setPid(p.getId()); - pDataHis.setRemark(request.getParameter(p.getConfigureid()+"Remark")); - this.productionIndexPlanNameDataHisService.save(pDataHis); - } - - p.setValue(value); - int res=this.productionIndexPlanNameDataService.update(p); - if(res==1){ - code++; - } - }else{//找不到记录则新增 - ProductionIndexPlanNameData pIndexPlanNameData=new ProductionIndexPlanNameData(); - pIndexPlanNameData.setId(CommUtil.getUUID()); - pIndexPlanNameData.setConfigureid(cid); - pIndexPlanNameData.setValue(Double.valueOf(value)); - pIndexPlanNameData.setPlandate(planDate); - pIndexPlanNameData.setType(productionIndexPlanNameData.getType()); - pIndexPlanNameData.setUnitId(productionIndexPlanNameData.getUnitId()); - int res=this.productionIndexPlanNameDataService.save(pIndexPlanNameData); - if(res==1){ - code++; - } - } - } - } - } - - model.addAttribute("result", code); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model){ - String type=request.getParameter("type"); - String planDate=request.getParameter("date"); - String unitId=request.getParameter("unitId"); - - String orderstr=""; - String wherestr=""; - List dlist = null; - - if(type.equals(ProductionIndexPlanNameData.Type_Month)){ -// planDate=planDate+"-01"; - orderstr=" order by morder "; - wherestr=" where 1=1 and datediff(month,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Month+"' and unit_id='"+unitId+"' "; - dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr+orderstr); - //删除所属日数据 - String daywherestr=" where 1=1 and datediff(month,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Day+"' and unit_id='"+unitId+"' "; - List daylist = this.productionIndexPlanNameDataService.selectListByWhere(daywherestr+orderstr); - dlist.addAll(daylist); - }else if(type.equals(ProductionIndexPlanNameData.Type_Year)){ -// planDate=planDate+"-01-01"; - orderstr=" order by morder "; - wherestr=" where 1=1 and datediff(year,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Year+"' and unit_id='"+unitId+"' "; - dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr+orderstr); - } -// else if(type.equals(ProductionIndexPlanNameData.Type_Day)){ -// planDate=planDate; -// orderstr=" order by morder "; -// wherestr=" where 1=1 and datediff(day,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Day+"' and unit_id='"+unitId+"' "; -// dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr+orderstr); -// } - String ids=""; - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i0){ - for(int i=0;i1){ - String type=idss[0]; - String planDate=idss[1]; - - String orderstr=""; - String wherestr=""; - List dlist = null; - - if(type.equals(ProductionIndexPlanNameData.Type_Month)){ - planDate=planDate+"-01"; - orderstr=" order by morder "; - wherestr=" where 1=1 and datediff(month,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Month+"' and unit_id='"+unitId+"' "; - dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr+orderstr); - //删除所属日数据 - String daywherestr=" where 1=1 and datediff(month,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Day+"' and unit_id='"+unitId+"' "; - List daylist = this.productionIndexPlanNameDataService.selectListByWhere(daywherestr+orderstr); - dlist.addAll(daylist); - }else if(type.equals(ProductionIndexPlanNameData.Type_Year)){ - planDate=planDate+"-01-01"; - orderstr=" order by morder "; - wherestr=" where 1=1 and datediff(year,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Year+"' and unit_id='"+unitId+"' "; - dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr+orderstr); - } -// else if(type.equals(ProductionIndexPlanNameData.Type_Day)){ -// planDate=planDate; -// orderstr=" order by morder "; -// wherestr=" where 1=1 and datediff(day,planDate,'"+planDate+"')=0 and type='"+ProductionIndexPlanNameData.Type_Day+"' and unit_id='"+unitId+"' "; -// dlist = this.productionIndexPlanNameDataService.selectListByWhere(wherestr+orderstr); -// } - - if(dlist!=null&&dlist.size()>0){ - for(int m=0;m list = this.productionIndexPlanNameConfigureService.selectListByWhere(" where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+request.getParameter("unitId")+"' order by morder asc "); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getEditDataJson.do") - public String getEditDataJson(HttpServletRequest request,Model model){ - String type=request.getParameter("type"); - String planDate=request.getParameter("planDate"); - String unitId=request.getParameter("unitId"); - - List list = this.productionIndexPlanNameConfigureService.selectListByWhereForEdit(" where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+request.getParameter("unitId")+"' order by morder asc ",type,planDate,unitId); - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result", json); - return "result"; - } - - /** - * 导入选择界面 - * @param request - * @param model - * @return - */ - @RequestMapping("/importSelect.do") - public String importSelect(HttpServletRequest request,Model model){ - return "work/productionIndexPlanImportSelect"; - } - - /** - * 导出excel表 的 模板 - * @throws IOException - */ - @RequestMapping("/downloadExcelTemplate.do") - public ModelAndView downloadExcelTemplate(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - this.productionIndexPlanNameDataService.downloadExcelTemplate(request, response); - return null; - } - - /** - * 导出excel表 的 模板 - * @throws IOException - */ - @RequestMapping("/outExcelTemplate.do") - public ModelAndView outExcelTemplate(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String date=request.getParameter("date"); - String unitId=request.getParameter("unitId"); - - this.productionIndexPlanNameDataService.outExcelTemplate(response,date,unitId); - return null; - } - - /** - * 导入设备excel后处理,保存数据,支持xls和xlsx两种格式 - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file,HttpServletRequest request,Model model) throws IOException{ - MultipartRequest multipartRequest = (MultipartRequest)request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu=(User)request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if(excelFile != null){ - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".")+1); - //根据excel类型取数据 - if("xls".equals(type) || "xlsx".equals(type)){ - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = ("xls".equals(type)) ? productionIndexPlanNameDataService.readXls(excelFile.getInputStream(),unitId,cu.getId()) : this.productionIndexPlanNameDataService.readXlsx(excelFile.getInputStream(),unitId,cu.getId()); - - statusMap.put("status", true); - statusMap.put("msg", res); - }else{ - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - }else{ - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result =JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/work/ProductionIndexPlanNameDataHisController.java b/src/com/sipai/controller/work/ProductionIndexPlanNameDataHisController.java deleted file mode 100644 index 6c0fc52b..00000000 --- a/src/com/sipai/controller/work/ProductionIndexPlanNameDataHisController.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.ProductionIndexPlanNameDataHis; -import com.sipai.entity.user.User; -import com.sipai.service.work.ProductionIndexPlanNameDataHisService; - -@Controller -@RequestMapping("/work/productionIndexPlanNameDataHis") -public class ProductionIndexPlanNameDataHisController { - @Resource - private ProductionIndexPlanNameDataHisService productionIndexPlanNameDataHisService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and pid='"+request.getParameter("pid")+"' "; -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; -// } - PageHelper.startPage(page, rows); - List list = this.productionIndexPlanNameDataHisService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/showList.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "work/productionIndexPlanNameDataHisList"; - } -} diff --git a/src/com/sipai/controller/work/ProductionIndexWorkOrderController.java b/src/com/sipai/controller/work/ProductionIndexWorkOrderController.java deleted file mode 100644 index c5f0e8c7..00000000 --- a/src/com/sipai/controller/work/ProductionIndexWorkOrderController.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.sipai.controller.work; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexWorkOrder; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.work.ProductionIndexPlanNameConfigureService; -import com.sipai.service.work.ProductionIndexWorkOrderService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/productionIndexWorkOrder") -public class ProductionIndexWorkOrderController { - @Resource - private ProductionIndexWorkOrderService productionIndexWorkOrderService; - @Resource - private UserService userService; - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; - - @RequestMapping("/showList.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model){ - return "work/productionIndexWorkOrderList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 and unit_id='"+request.getParameter("unitId")+"' "; - if(!cu.getId().equals("emp01")){ - wherestr += " and writePerson='"+cu.getId()+"' "; - } - if(request.getParameter("date")!=null&&request.getParameter("date").length()>0){ - wherestr += " and datediff(day,writeDate,'"+request.getParameter("date")+"')=0 "; - } -// if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ -// wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; -// } - PageHelper.startPage(page, rows); - List list = this.productionIndexWorkOrderService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - model.addAttribute("id", CommUtil.getUUID()); - return "work/productionIndexWorkOrderAdd"; - } - - @RequestMapping("/doCreate.do") - public String doCreate(HttpServletRequest request, Model model){ -// List cplist = this.productionIndexPlanNameConfigureService.selectSendPersonList(); -// int code=0; -// if(cplist!=null&&cplist.size()>0){ -// for(int u=0;u clist = this.productionIndexPlanNameConfigureService.selectListByWhere(" where sendPersonId='"+cplist.get(u).getSendpersonid()+"' "); -// String cid=""; -// for(int i=0;i CommString.ALARM_BLUE) { - // 由于摄像头与模型关联 因一摄像头对应多模型 且模型对应报警 则选择先获取摄像头集合再获取旗下模型报警值 - Integer type = 0; - if (CommString.typeMap.get(workModel.getCameraDetail().getCamera().getId()) != null) { - type = CommString.typeMap.get(workModel.getCameraDetail().getCamera().getId()).get(workModel.getModelName()); - } - if (type != null && type < CommString.ALARM_YELLOW) { - hqAlarmRecordService.pushMqtt(workModel, CommString.ALARM_YELLOW); - } - } else { - hqAlarmRecordService.pushMqtt(workModel, CommString.ALARM_BLUE); - } - //根据视野区域得到人员定位信息 - boolean[] userNumberSt = {true}; - //final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1); - //for(int i=0;i<10;i++){ - for(int i=0;i<2;i++){ -// System.out.println("nowDate-----------"+ CommUtil.nowDate()); - //当前任务执行时候 - if (Integer.parseInt(String.valueOf(pythonReceiveData.getResult()))!=0) { - int userNumber = positionsCasualService.getUserNumber(workModel.getCameraDetail().getVisionAreas()); -// System.out.println("pythonResult---------"+pythonReceiveData.getResult()); -// System.out.println("userNumber-----------"+userNumber); - if (!(userNumber < Integer.parseInt(String.valueOf(pythonReceiveData.getResult())))) { - //每秒执行一次。只要有一次相同,就不报警 - userNumberSt[0] = false; - } - }else{ - userNumberSt[0] = false; - } - try { - Thread.sleep(1000);//阻断1秒 - } catch (InterruptedException e) { - e.printStackTrace(); - } - //每秒执行一次,最多10秒结束 - /* scheduledExecutorService.schedule(new Runnable() { - @Override - public void run() { - //当前任务执行时候 - if (Integer.parseInt(String.valueOf(pythonReceiveData.getResult()))!=0) { - int userNumber = positionsCasualService.getUserNumber(workModel.getCameraDetail().getVisionAreas()); - System.out.println("pythonResult---------"+pythonReceiveData.getResult()); - System.out.println("userNumber-----------"+userNumber); - if (!(userNumber < Integer.parseInt(String.valueOf(pythonReceiveData.getResult())))) { - //每秒执行一次。只要有一次相同,就不报警 - userNumberSt[0] = false; - } - }else{ - userNumberSt[0] = false; - } - } - }, 1, TimeUnit.SECONDS);*/ - } - if (Integer.parseInt(String.valueOf(pythonReceiveData.getResult()))==0) { - userNumberSt[0] = false; - } - //scheduledExecutorService.shutdown(); - - //System.out.println("userNumberSt-----------"+ userNumberSt[0]); - if (userNumberSt[0]) { - hqAlarmRecordService.addAlarm(workModel,alarmDt); - } else { - hqAlarmRecordService.eliminateAlarm(workModel); - } - } - // 行车停止位模型 - else if ("crane".equals(pythonReceiveData.getModel())) { - // 将数据保存为全局变量 - CommString.craneModelMap.put(pythonReceiveData.getId(), pythonReceiveData); - } - // 人员经过模型 - else if ("person".equals(pythonReceiveData.getModel())) { - if (Integer.parseInt(String.valueOf(pythonReceiveData.getResult())) > CommString.ALARM_BLUE) { - Integer type = 0; - if (CommString.typeMap.get(workModel.getCameraDetail().getCamera().getId()) != null) { - type = CommString.typeMap.get(workModel.getCameraDetail().getCamera().getId()).get(workModel.getModelName()); - } - if (type <= CommString.ALARM_YELLOW) { - hqAlarmRecordService.pushMqtt(workModel, CommString.ALARM_YELLOW); - } - } else { - hqAlarmRecordService.pushMqtt(workModel, CommString.ALARM_BLUE); - } - } else { - // 未出现报警 - if ("0".equals(String.valueOf(pythonReceiveData.getResult())) || "good".equals(String.valueOf(pythonReceiveData.getResult()))) { - // 消除报警 - hqAlarmRecordService.eliminateAlarm(workModel); - } else { - // 新增报警 - hqAlarmRecordService.addAlarm(workModel); - } - } - } else { - System.out.println("超时报警"); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - if(buffer !=null){ - try { - buffer.close(); - } catch (Exception e2) { - e2.printStackTrace(); - } - } - } - model.addAttribute("result", 0); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/work/ReadAWriteUtil.java b/src/com/sipai/controller/work/ReadAWriteUtil.java deleted file mode 100644 index 6a9b2576..00000000 --- a/src/com/sipai/controller/work/ReadAWriteUtil.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.sipai.controller.work; - - -//import com.battery.bean.CommunityExceptionRecord; -import javax.annotation.Resource; - -import org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut; -import org.springframework.stereotype.Controller; - -import com.serotonin.modbus4j.ModbusFactory; -import com.serotonin.modbus4j.ModbusMaster; -import com.serotonin.modbus4j.exception.ModbusInitException; -import com.serotonin.modbus4j.exception.ModbusTransportException; -import com.serotonin.modbus4j.ip.IpParameters; -import com.serotonin.modbus4j.msg.ModbusRequest; -import com.serotonin.modbus4j.msg.ModbusResponse; -import com.serotonin.modbus4j.msg.ReadHoldingRegistersRequest; -import com.serotonin.modbus4j.msg.WriteRegistersRequest; -import com.serotonin.modbus4j.msg.WriteRegistersResponse; -import com.serotonin.modbus4j.sero.util.queue.ByteQueue; - -import com.sipai.entity.user.User; -import com.sipai.entity.work.ModbusRecord; -import com.sipai.service.work.ModbusFigService; -import com.sipai.service.work.ModbusRecordService; -import com.sipai.tools.CommUtil; - - -public class ReadAWriteUtil { - static ModbusMaster tcpMasterr; //读写使用不同的ModbusMaster,防止同时操作时候出乱 - static ModbusMaster tcpMasterw; - static String errordetails=""; - static String paramsStr; - public static void modbusWTCP(String ip, int port, int slaveId, int start, short[] values) { - - ModbusFactory modbusFactory = new ModbusFactory(); - // 设备ModbusTCP的Ip与端口,如果不设定端口则默认为502 - boolean ch=false; //检测tcpMaster是否发生改变,若更改则重新初始化 - IpParameters params=new IpParameters(); - params.setHost(ip); - if(502!=port){params.setPort(port);}//设置端口,默认502 - String ipport=ip+port; - if(paramsStr!=null) - { - if(!paramsStr.equals(ipport)) - { - ch=false; - }else{ - ch=true; - } - } - paramsStr=ipport; - if(tcpMasterw==null||ch==false) - { - tcpMasterw = modbusFactory.createTcpMaster(params, true); - } - try { - if(!tcpMasterw.isInitialized() || errordetails.contains("失败")||ch==false) - { - tcpMasterw.init(); - } - } catch (ModbusInitException e) { - // 如果出现了通信异常信息,则记录信息 - errordetails="连接服务器失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",连通结果:无法连接到modbus服务器!"; -// System.out.println("连接服务器失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",连通结果:无法连接到modbus服务器!"); - } - if(tcpMasterw.isInitialized()) - { - try { - WriteRegistersRequest request = new WriteRegistersRequest(slaveId, start, values); - WriteRegistersResponse response =(WriteRegistersResponse) tcpMasterw.send(request); - if (response.isException()) { - //记录modbus操作结果,保存到数据库 - errordetails="写入失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",站地址"+slaveId+",写入寄存器"+start+","+values.length+"个字节失败!"; - }else{ - //System.out.println("Success"); - //记录modbus操作结果,保存到数据库 - errordetails="成功写入。服务器:"+params.getHost()+",端口号:"+params.getPort()+",站地址"+slaveId+",写入寄存器"+start+","+values.length+"个字节成功!"; - //System.out.println("成功写入。服务器:"+params.getHost()+",端口号:"+params.getPort()+",站地址"+slaveId+",写入寄存器"+start+","+values.length+"个字节成功!"); - } - } catch (ModbusTransportException e) { - //e.printStackTrace(); - //记录modbus操作结果,保存到数据库 - errordetails="写入失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",站地址"+slaveId+",写入寄存器"+start+","+values.length+"个字节失败!"; - //System.out.println("写入失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",站地址"+slaveId+",写入寄存器"+start+","+values.length+"个字节失败!"); - } - } - } - - public static ByteQueue modbusTCP(String ip, int port, int start,int readLenth) { - ModbusFactory modbusFactory = new ModbusFactory(); - // 设备ModbusTCP的Ip与端口,如果不设定端口则默认为502 - boolean ch=false; //检测tcpMaster是否发生改变,若更改则重新初始化 - IpParameters params=new IpParameters(); - params.setHost(ip); - if(502!=port){params.setPort(port);}//设置端口,默认502 - String ipport=ip+port; - if(paramsStr!=null) - { - if(!paramsStr.equals(ipport)) - { - ch=false; - }else{ - ch=true; - } - } - paramsStr=ipport; - if(tcpMasterr==null||ch==false) - { - tcpMasterr = modbusFactory.createTcpMaster(params, true); - } - try { - if(!tcpMasterr.isInitialized() || errordetails.contains("失败")||ch==false) - { - tcpMasterr.init(); - } - } catch (ModbusInitException e) { - // 如果出现了通信异常信息,则保存到数据库中 - errordetails="连接服务器失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",连通结果:无法连接到modbus服务器!"; - //System.out.println("连接服务器失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",连通结果:无法连接到modbus服务器!"); - return null; - } - ModbusRequest modbusRequest=null; - try { - modbusRequest = new ReadHoldingRegistersRequest(1,start, readLenth);//功能码03 - } catch (ModbusTransportException e) { - //记录modbus操作结果,保存到数据库 - errordetails="构造发送帧失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",读取寄存器"+start+","+readLenth+"个字节失败!"; - //System.out.println("构造发送帧失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",读取寄存器"+start+","+readLenth+"个字节失败!"); - return null; - } - ModbusResponse modbusResponse=null; - try { - modbusResponse = tcpMasterr.send(modbusRequest); - } catch (ModbusTransportException e) { - //记录modbus操作结果,保存到数据库 - errordetails="读取失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",读取寄存器"+start+","+readLenth+"个字节失败!"; - //System.out.println("读取失败。服务器:"+params.getHost()+",端口号:"+params.getPort()+",读取寄存器"+start+","+readLenth+"个字节失败!"); - return null; - } - ByteQueue byteQueue= new ByteQueue(12); - modbusResponse.write(byteQueue); -// System.out.println("功能码:"+modbusRequest.getFunctionCode()); -// System.out.println("从站地址:"+modbusRequest.getSlaveId()); -// System.out.println("收到的响应信息大小:"+byteQueue.size()); - errordetails="读取成功!服务器:"+params.getHost()+",端口号:"+params.getPort()+",读取寄存器"+start+","+readLenth+"个字节成功!"; -//System.out.println("收到的响应信息值:"+byteQueue); - return byteQueue; - } - public static String returnMsg() - { - return errordetails; - } - -} diff --git a/src/com/sipai/controller/work/ScadaAlarmController.java b/src/com/sipai/controller/work/ScadaAlarmController.java deleted file mode 100644 index 1db3c1a2..00000000 --- a/src/com/sipai/controller/work/ScadaAlarmController.java +++ /dev/null @@ -1,263 +0,0 @@ -package com.sipai.controller.work; - - -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.scada.ScadaAlarm; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.scada.ScadaAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/scadaAlarm") -public class ScadaAlarmController { - @Resource - private ScadaAlarmService scadaAlarmService; - @Resource - private ProcessSectionService processSectionService; - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model) { - return "/work/scadaAlarmList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - if(sort==null){ - sort = " alarm_time "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr= " where 1=1 "; - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += " and alarm_time >= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += " and alarm_time <= '"+request.getParameter("edt")+"' "; - } - if(request.getParameter("alarmlevel")!=null && !request.getParameter("alarmlevel").isEmpty()){ - wherestr += " and alarm_level = '"+request.getParameter("alarmlevel")+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and (describe like '%"+request.getParameter("search_name")+"%' or mpoint_name like '%"+request.getParameter("search_name")+"%' or mpoint_code like '%"+request.getParameter("search_name")+"%') "; - } - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - wherestr += " and process_section_code = '"+request.getParameter("pSectionId")+"' "; - } - if(request.getParameter("alarmTypeLv1")!=null && !request.getParameter("alarmTypeLv1").isEmpty()){ - wherestr += " and alarm_type_lv1 = '"+request.getParameter("alarmTypeLv1")+"' "; - } - if(request.getParameter("status")!=null && !request.getParameter("status").isEmpty()){ - wherestr += " and status = '"+request.getParameter("status")+"' "; - } - - PageHelper.startPage(page, rows); - List list = this.scadaAlarmService.selectListByWhere(companyId,wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarmJson.do") - public ModelAndView getAlarmJson(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String companyId = request.getParameter("companyId"); - - String orderstr=" order by alarm_time desc"; - - String wherestr = "where 1=1 and (status='"+ScadaAlarm.STATUS_ALARM+"' or status='"+ScadaAlarm.STATUS_ALARM_CONFIRM+"') "; - - List list = this.scadaAlarmService.selectListByWhere(companyId,wherestr+orderstr); - - JSONArray jsondata=new JSONArray(); - if(list!=null&&list.size()>0){ - for (ScadaAlarm scadaAlarm : list) { - JSONObject jsonObject=new JSONObject(); - jsonObject.put("mpcode", scadaAlarm.getMpointCode()); - jsonObject.put("mpname", scadaAlarm.getMpointName()); - jsonObject.put("alarmTime", scadaAlarm.getAlarmTime()); - jsonObject.put("describe", scadaAlarm.getDescribe()); - if(scadaAlarm.getAlarmTypeLv1().equals(ScadaAlarm.AlarmTypeLv1_PRO)){ - jsonObject.put("alarmTypeLv1", "超限报警"); - }else if(scadaAlarm.getAlarmTypeLv1().equals(ScadaAlarm.AlarmTypeLv1_EQU)){ - jsonObject.put("alarmTypeLv1", "设备故障"); - } - if(scadaAlarm.getProcessSectionCode()!=null&&!scadaAlarm.getProcessSectionCode().equals("")){ - ProcessSection processSection= this.processSectionService.selectById(scadaAlarm.getProcessSectionCode()); - if(processSection!=null){ - jsonObject.put("processSectionCode", processSection.getCode()); - }else{ - jsonObject.put("processSectionCode", "-"); - } - }else{ - jsonObject.put("processSectionCode", "-"); - } - - jsondata.add(jsonObject); - } - } - - model.addAttribute("result",jsondata); - return new ModelAndView("result"); - } - - @RequestMapping("/getAlarmNum.do") - public ModelAndView getAlarmNum(HttpServletRequest request,Model model) { - String companyId = request.getParameter("unitId"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - String orderstr=" order by alarm_time desc"; - - String wherestr = "where 1=1 and (status='"+ScadaAlarm.STATUS_ALARM+"' or status='"+ScadaAlarm.STATUS_ALARM_CONFIRM+"') " - + " and alarm_time between '"+sdt+"' and '"+edt+"'"; - - List list = this.scadaAlarmService.selectListByWhere(companyId,wherestr+orderstr); - - JSONObject jsonObject=new JSONObject(); - if(list!=null&&list.size()>0){ - jsonObject.put("alarmNum", list.size()); - }else{ - jsonObject.put("alarmNum", 0); - } - - model.addAttribute("result",jsonObject); - return new ModelAndView("result"); - } - - /** - * 根据时间跨度获取报警数量 - * @param request - * @param model - * @return - */ - @RequestMapping("/getAlarmNumberByDateSpan.do") - public String getAlarmNumberByDateSpan(HttpServletRequest request,Model model, - @RequestParam(value = "dateSpan") String dateSpan){ - String companyId = request.getParameter("companyId"); - String processSectionCode=""; - if(request.getParameter("processSectionId")!=null && !request.getParameter("processSectionId").isEmpty()){ - ProcessSection processSection= this.processSectionService.selectById(request.getParameter("processSectionId")); - processSectionCode= processSection.getCode(); - } - String nowDate = CommUtil.nowDate(); - List> list = this.scadaAlarmService.getAmountByDateSpan(companyId, processSectionCode, dateSpan,nowDate); - model.addAttribute("result", JSONArray.fromObject(list)); - return "result"; - } - - - @RequestMapping("/getAlarmNumber.do") - public String getAlarmNumber(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - List processSections = this.processSectionService.selectListByWhere("where pid = '"+companyId+"'"); - JSONArray json = new JSONArray(); - if(processSections!=null && processSections.size()>0){ - String wherestr= "where 1=1 "; - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += " and insdt >= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += " and insdt <= '"+request.getParameter("edt")+"' "; - } - - for(int i=0;i list = this.scadaAlarmService.getListByWhere(companyId, wherestr+"and process_section_name='"+processSections.get(i).getName()+"'"); - long num =0; - long num_recover=0; - for (ScadaAlarm scadaAlarm : list) { - if (ScadaAlarm.STATUS_ALARM.equals(scadaAlarm.getStatus())) { - num++; - }else if(ScadaAlarm.STATUS_ALARM_RECOVER.equals(scadaAlarm.getStatus())){ - num_recover++; - } - } - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", processSections.get(i).getId()); - jsonObject.put("p_name", processSections.get(i).getName()); - jsonObject.put("num", num); - jsonObject.put("num_recover", num_recover); - json.add(jsonObject); - } - } - model.addAttribute("result", json.toString()); - return "result"; - } - - /** - * 设备统计分析表获取 指定水厂指定工艺段报警数量 - * @param request - * @param model - * @return - */ - @RequestMapping("/getAlarmNumberByProcessSection.do") - public String getAlarmNumberByProcessSection(HttpServletRequest request,Model model){ - String companyId = request.getParameter("companyId"); - JSONArray json = new JSONArray(); - String wherestr= "where 1=1 "; - if(request.getParameter("sdt")!=null && !request.getParameter("sdt").isEmpty()){ - wherestr += " and insdt >= '"+request.getParameter("sdt")+"' "; - } - if(request.getParameter("edt")!=null && !request.getParameter("edt").isEmpty()){ - wherestr += " and insdt <= '"+request.getParameter("edt")+"' "; - } - if(request.getParameter("pSectionId")!=null && !request.getParameter("pSectionId").isEmpty()){ - ProcessSection processSection =processSectionService.selectById(request.getParameter("pSectionId")); - wherestr += " and process_section_code = '"+processSection.getCode()+"' "; - } - List list = this.scadaAlarmService.getListByWhere(companyId, wherestr); - model.addAttribute("result", list.size()); - return "result"; - } - - /*** - * 大屏获取每月关键报警数(需要更改) - * @param request - * @param model - * @return - */ - @RequestMapping("/getAlarmNumber4Visual.do") - public String getAlarmNumber4Visual(HttpServletRequest request,Model model){ - int result = 0; - try{ - String companyId = "0756ZH"; - String wherestr = " where Convert(varchar,[insdt],120) like '"+CommUtil.nowDate().substring(0,7)+"%' and status = '"+ScadaAlarm.STATUS_ALARM+"'"; - List list = this.scadaAlarmService.getListByWhere(companyId, wherestr); - result = list.size(); - }catch(Exception e){ - System.out.println(e); - } - model.addAttribute("result", result); - return "result"; - } -} diff --git a/src/com/sipai/controller/work/ScadaPicController.java b/src/com/sipai/controller/work/ScadaPicController.java deleted file mode 100644 index 12cf7743..00000000 --- a/src/com/sipai/controller/work/ScadaPicController.java +++ /dev/null @@ -1,825 +0,0 @@ -package com.sipai.controller.work; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.TaskService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.scada.ScadaAlarm; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.KPIPointProfessor; -import com.sipai.entity.work.ScadaPic; -import com.sipai.entity.work.ScadaPic_EM; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.entity.work.ScadaPic_MPoint_Expression; -import com.sipai.entity.work.ScadaPic_ProcessSection; -import com.sipai.entity.work.ScadaPic_Txt; -import com.sipai.service.activiti.WorkflowTraceService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.scada.ScadaAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.CameraService; -import com.sipai.service.work.GroupManageService; -import com.sipai.service.work.KPIPointProfessorService; -import com.sipai.service.work.ScadaPicService; -import com.sipai.service.work.ScadaPic_EMService; -import com.sipai.service.work.ScadaPic_MPointService; -import com.sipai.service.work.ScadaPic_MPoint_ExpressionService; -import com.sipai.service.work.ScadaPic_ProcessSectionService; -import com.sipai.service.work.ScadaPic_TxtService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - - -@Controller -@RequestMapping("/work/scadaPic") -public class ScadaPicController { - @Resource - private ScadaPicService scadaPicService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private UnitService unitService; - @Resource - private ScadaPic_TxtService scadaPic_TxtService; - @Resource - private ScadaPic_MPointService scadaPic_MPointService; - @Resource - private ScadaPic_EMService scadaPic_EMService; - @Resource - private ScadaPic_ProcessSectionService scadaPic_ProcessSectionService; - @Resource - private ScadaPic_MPoint_ExpressionService scadaPic_MPoint_ExpressionService; - @Resource - private WorkflowTraceService traceService; - @Resource - private CommonFileService commonFileService; - @Resource - private GroupManageService groupManageService; - @Resource - private ScadaAlarmService scadaAlarmService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private CameraService cameraService; - @Resource - private KPIPointProfessorService kPIPointProfessorService; - - /*** 20181206 WP 可视化基础视图 返回视图类型和id共用接口 **/ - @RequestMapping("/getlist4Combo.do") - public ModelAndView getlist4Combo(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - String orderstr=" order by type asc"; - String companyId =request.getParameter("companyId"); - String pSectionId=request.getParameter("pSectionId"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - String wherestr="where 1=1"; - - if(companyId!=null && !companyId.isEmpty()){ - wherestr += " and bizId = '"+companyId+"' "; - } - if(pSectionId!=null && !pSectionId.isEmpty()){ - wherestr += " and processSectionId = '"+pSectionId+"' "; - } - if(request.getParameter("type") !=null && request.getParameter("type")!=""){ - wherestr += " and type='"+request.getParameter("type")+"'"; - } - - - List list = this.scadaPicService.selectListByWhere(wherestr+orderstr); - - JSONArray json=JSONArray.fromObject(list); - - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - /*** 20181227 WP 可视化基础视图新增 **/ - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request,Model model){ - return "/work/scadapic/scadaPicList"; - } - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String companyId =request.getParameter("companyId"); - String pSectionId=request.getParameter("pSectionId"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1"; - /*if(companyId!=null && !companyId.isEmpty()){ - wherestr += " and bizId = '"+companyId+"' "; - }*/ - if(companyId!=null && !companyId.isEmpty()){ - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("companyId")); - String companyids=""; - for(Unit unit : units){ - companyids += "'"+unit.getId()+"',"; - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += "and bizId in ("+companyids+") "; - } - } - if(pSectionId!=null && !pSectionId.isEmpty()){ - wherestr += " and processSectionId = '"+pSectionId+"' "; - } - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and text like '%"+request.getParameter("search_name")+"%' "; - } - PageHelper.startPage(page, rows); - List list = this.scadaPicService.selectListByWhere(wherestr+orderstr); -// List lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); -// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'"); - for (int i=0; i < list.size(); i++) { - ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid()); - if (processSection != null) { - list.get(i).setProcessectionname(processSection.getName()); - } - Company company = this.unitService.getCompById(list.get(i).getBizid()); - if (company != null) { - list.get(i).setBizid(company.getName()); - } - - - } - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - /*** 20181227 WP 可视化基础视图新增 **/ - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("id", CommUtil.getUUID()); - model.addAttribute("nowdate", CommUtil.nowDate()); - return "work/scadapic/scadaPicAdd"; - } - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScadaPic scadaPic = this.scadaPicService.selectById(id); - Company company = this.unitService.getCompById(scadaPic.getBizid()); - model.addAttribute("ScadaPic", scadaPic); - model.addAttribute("companyName", company.getName()); - return "work/scadapic/scadaPicEdit"; - } - @RequestMapping("/view.do") - public String doview(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScadaPic scadaPic = this.scadaPicService.selectById(id); - model.addAttribute("ScadaPic", scadaPic); - return "work/scadapic/scadaPicView"; - } - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic scadaPic){ - List slist = this.scadaPicService.selectListByWhere(" where processSectionId ='"+scadaPic.getProcesssectionid()+"'"); - if(slist!=null&&slist.size()>0){ - String result="工艺段已存在"; - String resstr="{\"res\":\""+result+"\",\"id\":\""+scadaPic.getId()+"\"}"; - model.addAttribute("result", resstr); - }else{ - User cu= (User)request.getSession().getAttribute("cu"); - scadaPic.setInsuser(cu.getId()); - scadaPic.setInsdt(CommUtil.nowDate()); - List list = this.commonFileService.selectListByTableAWhere("TB_SCADAPIC_FILE", "where masterid='"+scadaPic.getId()+"'"); - if(list !=null &&list.size()>0){ - int index = list.get(0).getAbspath().indexOf("webapps")+7; - String picpath = list.get(0).getAbspath().substring(index); - scadaPic.setPicpath(picpath.replace("\\", "/")); - } - int result = this.scadaPicService.save(scadaPic); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scadaPic.getId()+"\"}"; - model.addAttribute("result", resstr); - } - return "result"; - } - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic scadaPic){ - User cu= (User)request.getSession().getAttribute("cu"); - scadaPic.setInsuser(cu.getId()); - scadaPic.setInsdt(CommUtil.nowDate()); - List list = this.commonFileService.selectListByTableAWhere("TB_SCADAPIC_FILE", "where masterid='"+scadaPic.getId()+"'"); - if(list !=null){ - int index = list.get(0).getAbspath().indexOf("webapps")+7; - String picpath = list.get(0).getAbspath().substring(index); - scadaPic.setPicpath(picpath.replace("\\", "/")); - } - int result = this.scadaPicService.update(scadaPic); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scadaPic.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.commonFileService.deleteByTableAWhere("TB_SCADAPIC_FILE"," where masterid='"+id+"'");//删除附件表 - result = this.scadaPicService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.commonFileService.deleteByTableAWhere("TB_SCADAPIC_FILE"," where masterid in ('"+ids+"')");//删除附件表 - result = this.scadaPicService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - /**工艺可视化查看*/ - @RequestMapping("/showProcess.do") - public String showProcess(HttpServletRequest request,Model model) { - return "/work/scadapic/processView"; - } - - @RequestMapping("/showVideoDetail.do") - public String showVideoDetail(HttpServletRequest request,Model model){ - return "/work/scadapic/processVideoDetail"; - } - - /**现场监控视频*/ - @RequestMapping("/showLiveSurveillanceVideo.do") - public String showLiveSurveillanceVideo(HttpServletRequest request,Model model) { - Camera camera =this.cameraService.selectById(request.getParameter("id")); - if(camera!=null && camera.getType().equalsIgnoreCase("hikvision")){ - request.setAttribute("camera", camera); - //String encodeStr = new String(Base64.encode(camera.getPwd(), "UTF-8")); // 编码 - //request.setAttribute("encodeStr", encodeStr); - if(camera.getViewscopes()==null){ - request.setAttribute("streamtype","1");//主码流 - }else{ - request.setAttribute("streamtype","2");//子码流 - } - } - return "/work/scadapic/processVideoView"; - } - /**现场监控视频*/ - @RequestMapping("/showLiveSurveillanceVideo_Dahua.do") - public String showLiveSurveillanceVideo_dahua(HttpServletRequest request,Model model) { - Camera camera =this.cameraService.selectById(request.getParameter("id")); - request.setAttribute("camera", camera); - return "/work/scadapic/processVideoView_Dahua"; - } - - /**获取摄像头数据的接口*/ - @RequestMapping("/getCamera.do") - public ModelAndView getCamera(HttpServletRequest request,Model model) { - Camera camera =this.cameraService.selectById(request.getParameter("id")); - JSONArray json=JSONArray.fromObject(camera); - String result="{\"camera\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - - /**工艺可视化设计*/ - @RequestMapping("/processDesign.do") - public String processDesign(HttpServletRequest request,Model model) { - return "/work/scadapic/processdesign"; - } - - /**车间可视化查看*/ - @RequestMapping("/showPic.do") - public String showPic(HttpServletRequest request,Model model) { - return "/work/scadapic/picView"; - } - /**车间可视化设计*/ - @RequestMapping("/picDesign.do") - public String picDesign(HttpServletRequest request,Model model) { - return "/work/scadapic/picdesign"; - } - /**制品管理可视化查看*/ - @RequestMapping("/showProdManagement.do") - public String showProdManagement(HttpServletRequest request,Model model) { - return "/work/scadapic/prodManagement"; - } - /**制品管理可视化查看具体内容(工艺部分)*/ - @RequestMapping("/showProdManagementItem.do") - public String showProdManagementItem(HttpServletRequest request,Model model) { - return "/work/scadapic/prodManagementViewItem"; - } - - /**制品管理可视化查看具体内容(工序分别查看部分)*/ - @RequestMapping("/showProdManagementItem_PIC.do") - public String showProdManagementItem_PIC(HttpServletRequest request,Model model) { - return "/work/scadapic/prodManagementViewPIC"; - } - /**制品管理可视化设计*/ - @RequestMapping("/prodManagementDesign.do") - public String prodManagementDesign(HttpServletRequest request,Model model) { - return "/work/scadapic/prodManagementDesign"; - } - @RequestMapping("/getProdManagementInfoList.do") - public ModelAndView getProdManagementInfoList(HttpServletRequest request,Model model) { - String pid =request.getParameter("pid"); - String type = request.getParameter("type"); - String wherestr="where 1=1 and pid='"+pid+"' "; - List list = this.scadaPic_EMService.selectListWithEquipInfoByWhereAndType(wherestr,type); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - @RequestMapping("/getProdManagementViews4Combo.do") - public ModelAndView getProdManagementViews4Combo(HttpServletRequest request,Model model) { - User cu=(User)request.getSession().getAttribute("cu"); - JSONArray jsonArray=new JSONArray(); - String[] views=CommString.ProdManageViews; - for (String str : views) { - String[] items = str.split(":"); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", items[0]); - jsonObject.put("name", items[1]); - List commonFiles=commonFileService.selectByMasterId(items[0], "document.DocFileMapper"); - if(commonFiles.size()>0){ - jsonObject.put("commonFile", JSONObject.fromObject(commonFiles.get(0))); - } - jsonArray.add(jsonObject); - } - model.addAttribute("result",jsonArray.toString()); - return new ModelAndView("result"); - } - @RequestMapping("/showProdManagementDesign_Pic.do") - public String showProdManagementDesign_Pic(HttpServletRequest request,Model model) { - return "/work/scadapic/prodManagementDesign_Pic"; - } - /** - * 输出定义流程信息,包括产品信息 - * - * @param processInstanceId - * @return - * @throws Exception - */ - @RequestMapping(value = "traceProcessDefinitionWithPInfo") - @ResponseBody - public List> traceProcessDefinitionWithPInfo(HttpServletRequest request,Model model){ - String processDefinitionId = request.getParameter("pdid"); - String key = request.getParameter("key"); - List> activityInfos= new ArrayList<>(); - try{ - activityInfos = traceService.traceProcessByDefinitionId(processDefinitionId); - for (Map map : activityInfos) { - Map vars =(Map)map.get("vars"); - String activityId = (String)vars.get("activityId"); - String res =""; - if(key.equals("xbk")){ - res="12"; - }else if(key.equals("kl")) { - res="13"; - } - - - vars.clear(); - if(!activityId.equals("startEvent")&& !activityId.equals("endEvent")){ - vars.put(key, res); - } - map.put("vars", vars); - } - }catch(Exception e){ - e.printStackTrace(); - } - return activityInfos; - } - - /*@RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); -// if(cu==null){ -// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd")); -// } - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){ - wherestr += " and name like '%"+request.getParameter("search_name")+"%' "; - } - - PageHelper.startPage(page, rows); - List list = this.workShopService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - }*/ - @RequestMapping("/addTxt.do") - public String addTxt(HttpServletRequest request,Model model){ - return "/work/scadapic/scadaPic_TxtAdd"; - } - @RequestMapping("/showMPoint.do") - public String showMPoint(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScadaPic_MPoint scadaPic_MPoint = this.scadaPic_MPointService.selectById(id); - model.addAttribute("scadaPic_MPoint", scadaPic_MPoint); - return "/work/scadapic/scadaPic_MPointView"; - } - @RequestMapping("/addMPoint.do") - public String addMPoint(HttpServletRequest request,Model model){ - return "/work/scadapic/scadaPic_MPointAdd"; - } - @RequestMapping("/editMPoint.do") - public String editMPoint(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScadaPic_MPoint scadaPic_MPoint = this.scadaPic_MPointService.selectById(id); - model.addAttribute("scadaPic_MPoint", scadaPic_MPoint); - return "/work/scadapic/scadaPic_MPointEdit"; - } - @RequestMapping("/addMPointExpression.do") - public String addMPointExpression(HttpServletRequest request,Model model){ - return "/work/scadapic/scadaPic_MPoint_ExpressionAdd"; - } - @RequestMapping("/addEM.do") - public String addEM(HttpServletRequest request,Model model){ - return "/work/scadapic/scadaPic_EMAdd"; - } - @RequestMapping("/addPS.do") - public String addPS(HttpServletRequest request,Model model){ - return "/work/scadapic/scadaPic_PSAdd"; - } - @RequestMapping("/editPS.do") - public String editPS(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - ScadaPic_ProcessSection scadaPic_ProcessSection = this.scadaPic_ProcessSectionService.selectById(id); - model.addAttribute("ps", scadaPic_ProcessSection); - return "/work/scadapic/scadaPic_PSEdit"; - } - @RequestMapping("/saveTxt.do") - public String saveTxt(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_Txt scadaPic_Txt){ - User cu=(User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - scadaPic_Txt.setId(id); - scadaPic_Txt.setInsuser(cu.getId()); - scadaPic_Txt.setInsdt(CommUtil.nowDate()); - - int result= this.scadaPic_TxtService.save(scadaPic_Txt); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/saveMPoint.do") - public String saveMPoint(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_MPoint scadaPic_MPoint){ - User cu=(User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - scadaPic_MPoint.setId(id); - scadaPic_MPoint.setInsuser(cu.getId()); - scadaPic_MPoint.setInsdt(CommUtil.nowDate()); - String result =""; - List scadaPic_MPoints=this.scadaPic_MPointService.selectListByWhere("where mpid='"+scadaPic_MPoint.getMpid()+"' and pid='"+scadaPic_MPoint.getPid()+"'"); - if(scadaPic_MPoints!=null && scadaPic_MPoints.size()>0){ - result="测量点重复添加"; - }else{ - int res= this.scadaPic_MPointService.save(scadaPic_MPoint); - result =String.valueOf(res); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/updateMPoint.do") - public String updateMPoint(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_MPoint scadaPic_MPoint){ - User cu=(User)request.getSession().getAttribute("cu"); - scadaPic_MPoint.setInsuser(cu.getId()); - scadaPic_MPoint.setInsdt(CommUtil.nowDate()); - String result =""; - List scadaPic_MPoints=this.scadaPic_MPointService.selectListByWhere("where mpid='"+scadaPic_MPoint.getMpid()+"'"); - if(scadaPic_MPoints!=null && scadaPic_MPoints.size()>0){ - result="测量点重复添加"; - }else{ - int res= this.scadaPic_MPointService.save(scadaPic_MPoint); - result =String.valueOf(res); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+scadaPic_MPoint.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/saveMPointExpression.do") - public String saveMPointExpression(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_MPoint_Expression scadaPic_MPoint_Expression){ - User cu=(User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - scadaPic_MPoint_Expression.setId(id); - scadaPic_MPoint_Expression.setInsuser(cu.getId()); - scadaPic_MPoint_Expression.setInsdt(CommUtil.nowDate()); - int result= this.scadaPic_MPoint_ExpressionService.save(scadaPic_MPoint_Expression); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/saveEM.do") - public String saveEM(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_EM scadaPic_EM){ - User cu=(User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - scadaPic_EM.setId(id); - scadaPic_EM.setInsuser(cu.getId()); - scadaPic_EM.setInsdt(CommUtil.nowDate()); - String result =""; - List scadaPic_EMs=this.scadaPic_EMService.selectListByWhere("where equipid='"+scadaPic_EM.getEquipid()+"'"); - if(scadaPic_EMs!=null && scadaPic_EMs.size()>0){ - result="设备重复添加"; - }else{ - int res= this.scadaPic_EMService.save(scadaPic_EM); - result =String.valueOf(res); - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/savePS.do") - public String savePS(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_ProcessSection scadaPic_ProcessSection){ - User cu=(User)request.getSession().getAttribute("cu"); - String id = CommUtil.getUUID(); - scadaPic_ProcessSection.setId(id); - scadaPic_ProcessSection.setInsuser(cu.getId()); - scadaPic_ProcessSection.setInsdt(CommUtil.nowDate()); - String result =""; - int res= this.scadaPic_ProcessSectionService.save(scadaPic_ProcessSection); - result =String.valueOf(res); - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/updatePS.do") - public String updatePS(HttpServletRequest request,Model model, - @ModelAttribute ScadaPic_ProcessSection scadaPic_ProcessSection){ - User cu=(User)request.getSession().getAttribute("cu"); - scadaPic_ProcessSection.setInsuser(cu.getId()); - scadaPic_ProcessSection.setInsdt(CommUtil.nowDate()); - String result =""; - int res= this.scadaPic_ProcessSectionService.update(scadaPic_ProcessSection); - result =String.valueOf(res); - String resstr="{\"res\":\""+result+"\",\"id\":\""+scadaPic_ProcessSection.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - @RequestMapping("/deleteTxt.do") - public String deleteTxt(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.scadaPic_TxtService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/deleteMPoint.do") - public String deleteMPoint(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.scadaPic_MPointService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/deleteMPointExpression.do") - public String deleteMPointExpression(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids = ids.replace(",", "','"); - int result = this.scadaPic_MPoint_ExpressionService.deleteByWhere("where id in('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/deleteEM.do") - public String deleteEM(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.scadaPic_EMService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/deletePS.do") - public String deletePS(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int result = this.scadaPic_ProcessSectionService.deleteById(id); - model.addAttribute("result", result); - return "result"; - } - @RequestMapping("/getTxtList.do") - public ModelAndView getTxtList(HttpServletRequest request,Model model) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String pid =request.getParameter("pid"); - String wherestr="where 1=1 and pid='"+pid+"' "; - List list = this.scadaPic_TxtService.selectListByWhere(wherestr); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - @RequestMapping("/getMPointList.do") - public ModelAndView getMPointList(HttpServletRequest request,Model model) { - String companyId =request.getParameter("companyId"); - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String pid =request.getParameter("pid"); - String wherestr="where 1=1 and pid='"+pid+"' "; - List list = this.scadaPic_MPointService.selectListWithPointValueByWhere(companyId,wherestr); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - @RequestMapping("/getMPoint_ExpressionList.do") - public ModelAndView getMPoint_ExpressionList(HttpServletRequest request,Model model) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String mpid =request.getParameter("mpid"); - String wherestr="where 1=1 and mpid='"+mpid+"' "; - List list = this.scadaPic_MPoint_ExpressionService.selectListByWhere(wherestr); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - /*@RequestMapping("/getMPExpressionWay4Commbo.do") - public ModelAndView getMPExpressionWay4Commbo(HttpServletRequest request,Model model) { - String express[]= CommString.Scada_Mp_Pic; - JSONArray json =new JSONArray(); - for (int i = 0; i < express.length; i++) { - JSONObject jsonObject =new JSONObject(); - jsonObject.put("id", i); - jsonObject.put("path", express[i]); - json.add(jsonObject); - } - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - }*/ - @RequestMapping("/getEMList.do") - public ModelAndView getEMList(HttpServletRequest request,Model model) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String pid =request.getParameter("pid"); - String wherestr="where 1=1 and pid='"+pid+"' "; - List list = this.scadaPic_EMService.selectListWithEquipInfoByWhere(wherestr); - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - @RequestMapping("/getPSList.do") - public ModelAndView getPSList(HttpServletRequest request,Model model) { - HttpSession currentSession = request.getSession(false); - User cu=(User)request.getSession().getAttribute("cu"); - String pid =request.getParameter("pid"); - String companyId =request.getParameter("companyId"); - String wherestr="where 1=1 and s.pid='"+pid+"' "; - List list = this.scadaPic_ProcessSectionService.selectListWithNameByWhere(wherestr); - if(list!=null && list.size()>0){ - for(int i=0;i scadaAlarm = this.scadaAlarmService.getListByWhere(companyId, " where process_section_code like '%"+list.get(i).getProcessSection().getCode()+"%' "); - list.get(i).setAlarmNumber(scadaAlarm.size()); - List maintenanceDetail = this.maintenanceDetailService.selectListWithMaintenanceByWhere(" where 1=1 and d.companyid='"+companyId+"' and d.type = '"+MaintenanceCommString.MAINTENANCE_TYPE_REPAIR+"' and d.process_section_id = '"+list.get(i).getProcesssectionid()+"' "); - list.get(i).setProblemNumber(maintenanceDetail.size()); - List kPIPointProfessor = this.kPIPointProfessorService.selectListByWhere(" where process_section_id='"+list.get(i).getProcesssectionid()+"'"); - list.get(i).setProfessorNumber(kPIPointProfessor.size()); - } - } - } - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json.toString()); - return new ModelAndView("result"); - } - - //更新布局 - @RequestMapping("/updateLayout.do") - public String updateLayout(HttpServletRequest request,Model model){ - String id=request.getParameter("id"); - String posx=request.getParameter("posx").replace("px", ""); - String posy=request.getParameter("posy").replace("px", "");; - String containerWidth=request.getParameter("containerWidth").replace("px", ""); - String containerHeight=request.getParameter("containerHeight").replace("px", ""); - String width=request.getParameter("width").replace("px", ""); - String height=request.getParameter("height").replace("px", "");; - String type =request.getParameter("type"); - int result=0; - switch (type) { - case ScadaPic_Txt.Flag_Txt: - ScadaPic_Txt scadaPic_Txt=scadaPic_TxtService.selectById(id); - scadaPic_Txt.setPosx(Double.valueOf(posx)); - scadaPic_Txt.setPosy(Double.valueOf(posy)); - scadaPic_Txt.setContainerwidth(Double.valueOf(containerWidth)); - scadaPic_Txt.setContainerheight(Double.valueOf(containerHeight)); - result =this.scadaPic_TxtService.update(scadaPic_Txt); - break; - case ScadaPic_Txt.Flag_MPoint: - ScadaPic_MPoint scadaPic_MPoint=scadaPic_MPointService.selectById(id); - scadaPic_MPoint.setPosx(Double.valueOf(posx)); - scadaPic_MPoint.setPosy(Double.valueOf(posy)); - scadaPic_MPoint.setContainerwidth(Double.valueOf(containerWidth)); - scadaPic_MPoint.setContainerheight(Double.valueOf(containerHeight)); - result =this.scadaPic_MPointService.update(scadaPic_MPoint); - break; - case ScadaPic_Txt.Flag_EM: - ScadaPic_EM scadaPic_EM=scadaPic_EMService.selectById(id); - scadaPic_EM.setPosx(Double.valueOf(posx)); - scadaPic_EM.setPosy(Double.valueOf(posy)); - scadaPic_EM.setContainerwidth(Double.valueOf(containerWidth)); - scadaPic_EM.setContainerheight(Double.valueOf(containerHeight)); - scadaPic_EM.setWidth(Double.valueOf(width)); - scadaPic_EM.setHeight(Double.valueOf(height)); - result =this.scadaPic_EMService.update(scadaPic_EM); - break; - case ScadaPic_Txt.Flag_PS: - ScadaPic_ProcessSection scadaPic_ProcessSection=scadaPic_ProcessSectionService.selectById(id); - scadaPic_ProcessSection.setPosx(Double.valueOf(posx)); - scadaPic_ProcessSection.setPosy(Double.valueOf(posy)); - scadaPic_ProcessSection.setContainerwidth(Double.valueOf(containerWidth)); - scadaPic_ProcessSection.setContainerheight(Double.valueOf(containerHeight)); - scadaPic_ProcessSection.setWidth(Double.valueOf(width)); - scadaPic_ProcessSection.setHeight(Double.valueOf(height)); - result =this.scadaPic_ProcessSectionService.update(scadaPic_ProcessSection); - break; - default: - break; - } - - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - /**获取车间生产情况,(统计车间内产线生产信息)*/ - /*@RequestMapping("/getWorkShopInfo.do") - public String getWorkShopInfo(HttpServletRequest request,Model model){ - String workShopId=request.getParameter("workShopId"); - SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time= simpleDateFormat.format(new Date()); - String date=groupManageService.getWorkOrderDate(time); - List taskorders =workShopService.getWorkShopWorkInfo(workShopId, date); - JSONArray jsonArray = JSONArray.fromObject(taskorders); - String equinfo= workShopService.getWorkShopEquInfo(workShopId); - String resstr="{\"res\":"+jsonArray.toString()+",\"equinfo\":"+equinfo+"}"; - model.addAttribute("result", resstr); - return "result"; - }*/ - @RequestMapping("/showWorkShopInfos.do") - public String showWorkShopInfos(HttpServletRequest request,Model model){ - return "/work/scadapic/workShopInfos4main"; - } -} diff --git a/src/com/sipai/controller/work/SchedulingController.java b/src/com/sipai/controller/work/SchedulingController.java deleted file mode 100644 index 830d45d3..00000000 --- a/src/com/sipai/controller/work/SchedulingController.java +++ /dev/null @@ -1,1317 +0,0 @@ -package com.sipai.controller.work; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.nio.charset.StandardCharsets; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.work.*; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolModelService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.*; -import com.sipai.tools.GroupManage; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - - -@Controller -@RequestMapping("/work/scheduling") -public class SchedulingController { - @Resource - private SchedulingService schedulingService; - @Resource - private GroupTypeService groupTypeService; - @Resource - private UnitService unitService; - @Resource - private GroupTimeService groupTimeService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private GroupContentService groupContentService; - @Resource - private GroupContentFormService groupContentFormService; - @Resource - private GroupContentFormDataService groupContentFormDataService; - @Resource - private PatrolModelService patrolModelService; - @Resource - private UserService userService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - - @RequestMapping("/showlist.do") - public String showlist(HttpServletRequest request, Model model) { - return "/work/schedulingCalender"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "bizid") String bizid, - @RequestParam(value = "schedulingtype") String schedulingtype) { - //HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); - String orderstr = " order by stdt asc "; - - String wherestr = " where bizid='" + bizid + "' and schedulingtype='" + schedulingtype + "'"; - if (request.getParameter("date") != null && !request.getParameter("date").isEmpty()) { - wherestr += " and Convert(varchar,stdt,120) like '" + request.getParameter("date") + "%' "; - } - if (request.getParameter("isTypeSetting") != null && !request.getParameter("isTypeSetting").isEmpty()) { - wherestr += " and isTypeSetting='" + request.getParameter("isTypeSetting") + "' "; - } - //PageHelper.startPage(page, rows); -// System.out.println(wherestr+orderstr); - List list = this.schedulingService.selectCalenderListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getNowTimelist.do") - public ModelAndView getNowTimelist(HttpServletRequest request, Model model) { - //HttpSession currentSession = request.getSession(false); - User cu = (User) request.getSession().getAttribute("cu"); - String schedulingtype = request.getParameter("schedulingtype"); - String bizid = request.getParameter("bizid"); - - String nowTime = CommUtil.nowDate(); - String orderstr = " order by stdt asc "; - String wherestr = " where bizid='" + bizid + "' and (stdt<='" + nowTime + "' and eddt>='" + nowTime + "') "; - - List list = this.schedulingService.selectCalenderListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/showSchedulingList.do") - public String showSchedulingList(HttpServletRequest request, Model model, - @RequestParam(value = "date") String date) { - model.addAttribute("date", date.substring(0, 10)); - return "/work/schedulingList"; - } - - @RequestMapping("/add.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "date") String date) { - model.addAttribute("date", date.substring(0, 10)); - return "work/schedulingAdd"; - } - - @RequestMapping("/edit.do") - public String doedit(HttpServletRequest request, Model model) { - String schedulingId = request.getParameter("id"); - String wherestr = " where s.id = '" + schedulingId + "'"; - List scheduling = this.schedulingService.selectCalenderListByWhere(wherestr); - model.addAttribute("scheduling", scheduling.get(0)); - return "work/schedulingEdit"; - } - - @RequestMapping("/getScheduling.do") - public ModelAndView getScheduling(HttpServletRequest request, Model model) { - String schedulingId = request.getParameter("schedulingId"); - Scheduling scheduling = this.schedulingService.selectById(schedulingId); - - model.addAttribute("result", CommUtil.toJson(scheduling)); - return new ModelAndView("result"); - } - -// @RequestMapping("/showSingleScheduling.do") -// public String showSingleScheduling(HttpServletRequest request,Model model){ -// String wherestr = " where Convert(varchar,stdt,120) like '"+ request.getParameter("date") -// + "%' and groupManageid = '"+ request.getParameter("groupManageid") -// +"' and bizid = '"+ request.getParameter("bizid")+"' and schedulingtype = '"+ request.getParameter("schedulingtype") -// //+"' and patrolmode = '"+scheduling.getPatrolmode() 巡检模式不是定位条件 -// +"'"; -// String orderstr = " order by insdt"; -// List scheduling = this.schedulingService.selectAllinfo(wherestr+orderstr); -// model.addAttribute("scheduling", scheduling.get(0)); -// return "work/schedulingEdit"; -// } - - @RequestMapping("/save.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute Scheduling scheduling) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - String id = CommUtil.getUUID(); - scheduling.setId(id); - scheduling.setInsuser(cu.getId()); - scheduling.setStatus(Scheduling.Status_UnSucceeded); - scheduling.setIstypesetting(Scheduling.IsTypeSetting_True);//已排班 - scheduling.setInsdt(CommUtil.nowDate()); - - //获取当前班次的起止时间 - String[] stAndEdTime = this.groupTimeService.getGroupTimeStartAndEndTime(scheduling.getGroupmanageid(), scheduling.getDate()); - if (stAndEdTime != null && stAndEdTime[0] != "") { - scheduling.setStdt(stAndEdTime[0]); - scheduling.setEddt(stAndEdTime[1]); - } - String[] groupdetailIds = scheduling.getGroupdetailId().split(","); - String workPeoples = ""; - for (String groupdetailId : - groupdetailIds) { - GroupDetail groupDetail = this.groupDetailService.selectById(groupdetailId); - String leader = groupDetail.getLeader(); - String members = groupDetail.getMembers(); - - if (!members.equals("")) { - workPeoples += members + ","; - } - if (!workPeoples.equals("")) { - if (workPeoples.contains(leader)) { - } else { - workPeoples = leader + "," + workPeoples; - } - } else { - workPeoples = leader + ","; - } -// workPeoples += workPeople + ","; - } - scheduling.setWorkpeople(workPeoples); - - //重复排班 递归生成List - if (scheduling.getRepeat()) { - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - int diffdays = (int) ((formatter.parse(scheduling.getRepeatEddt()).getTime() - formatter.parse(scheduling.getDate()).getTime()) / (1000 * 3600 * 24)); - diffdays++; - int interval = scheduling.getRepeatInterval(); - int cycle = 0; - if (diffdays % interval != 0) { - cycle = diffdays / interval + 1; - } else { - cycle = diffdays / interval; - } - -// System.out.println(diffdays); -// System.out.println(cycle); - String firstDate = scheduling.getDate(); - for (int i = 0; i < cycle; i++) { - String nowdate = CommUtil.subplus(firstDate, String.valueOf(i * interval), "day"); -// System.out.println(nowdate); - scheduling.setId(CommUtil.getUUID()); - scheduling.setDate(nowdate); - //获取当前班次的起止时间 - String[] nowstAndEdTime = this.groupTimeService.getGroupTimeStartAndEndTime(scheduling.getGroupmanageid(), scheduling.getDate()); - if (nowstAndEdTime != null && nowstAndEdTime[0] != "") { - scheduling.setStdt(nowstAndEdTime[0].substring(0, 16)); - scheduling.setEddt(nowstAndEdTime[1].substring(0, 16)); - } - result += this.schedulingService.save(scheduling); - } - } catch (Exception e) { - e.printStackTrace(); - } - } else { - result = this.schedulingService.save(scheduling); - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - - } - - @RequestMapping("/update.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute Scheduling scheduling) { - User cu = (User) request.getSession().getAttribute("cu"); - scheduling.setInsuser(cu.getId()); - scheduling.setInsdt(CommUtil.nowDate()); - - //获取当前班次的起止时间 - String[] stAndEdTime = this.groupTimeService.getGroupTimeStartAndEndTime(scheduling.getGroupmanageid(), scheduling.getDate()); - if (stAndEdTime != null && stAndEdTime[0] != "") { - scheduling.setStdt(stAndEdTime[0].substring(0, 16)); - scheduling.setEddt(stAndEdTime[1].substring(0, 16)); - } - - //统一更改当日的巡检模式 - List schedulinglist = this.schedulingService.selectListByWhere(" where datediff(day,'" + scheduling.getStdt() + "',stdt)=0 and bizid='" + scheduling.getBizid() + "' and schedulingtype='" + scheduling.getSchedulingtype() + "' and isTypeSetting='" + Scheduling.IsTypeSetting_True + "' "); - if (schedulinglist != null && schedulinglist.size() > 0) { - for (Scheduling sc : schedulinglist) { - sc.setPatrolmode(scheduling.getPatrolmode()); - this.schedulingService.update(sc); - } - } - String[] groupdetailIds = scheduling.getGroupdetailId().split(","); - String workPeoples = ""; - for (String groupdetailId : - groupdetailIds) { - GroupDetail groupDetail = this.groupDetailService.selectById(groupdetailId); - String leader = groupDetail.getLeader(); - String members = groupDetail.getMembers(); - - if (!members.equals("")) { - workPeoples += members + ","; - } - if (!workPeoples.equals("")) { - if (workPeoples.contains(leader)) { - } else { - workPeoples = leader + "," + workPeoples; - } - } else { - workPeoples = leader + ","; - } -// workPeoples += workPeople + ","; - } - scheduling.setWorkpeople(workPeoples); - - int result = this.schedulingService.update(scheduling); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + scheduling.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/delete.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int result = this.schedulingService.deleteById(id); - /*if(result>0){ - this.schedulingService.deleteByschedulingId(id); - }*/ - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/deletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.schedulingService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/showlistForSelect.do") - public String showlistForSelect(HttpServletRequest request, Model model) { - return "/work/schedulingListForSelect"; - } - - @RequestMapping("/getListForSelect.do") - public String getListForSelect(HttpServletRequest request, Model model) { - List list = this.schedulingService.selectListByWhere(""); - JSONArray json = new JSONArray(); - if (list != null && list.size() > 0) { - int i = 0; - for (Scheduling scheduling : list) { - JSONObject jsonObject = new JSONObject(); - //jsonObject.put("id", scheduling.getName()); - //jsonObject.put("text", scheduling.getName()); - json.add(jsonObject); - } - - } - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/showShiftChange.do") - public String showShiftChange(HttpServletRequest request, Model model) { - - return "/work/schedulingForShiftChange"; - } - - @RequestMapping("/doShiftChange.do") - public String doShiftChange(HttpServletRequest request, Model model) { - String olduserId = request.getParameter("olduserId"); - String oldSchedulingId = request.getParameter("oldSchedulingId"); - String ckuserId = request.getParameter("ckuserId"); - String ckschedulingId = request.getParameter("ckschedulingId"); - - - Scheduling scheduling = this.schedulingService.selectById(oldSchedulingId); - String oldworkpeople = scheduling.getWorkpeople(); - oldworkpeople = oldworkpeople.replaceAll(olduserId, ckuserId); - scheduling.setWorkpeople(oldworkpeople); - - - Scheduling ckscheduling = this.schedulingService.selectById(ckschedulingId); - String ckworkpeople = ckscheduling.getWorkpeople(); - ckworkpeople = ckworkpeople.replaceAll(ckuserId, olduserId); - ckscheduling.setWorkpeople(ckworkpeople); - - if (request.getParameter("groupDetailChangeSt") != null && request.getParameter("groupDetailChangeSt").length() > 0) { - if (request.getParameter("groupDetailChangeSt").equals("change")) { - String oldGroupDetailId = scheduling.getGroupdetailId(); - String ckGroupDetailId = ckscheduling.getGroupdetailId(); - - scheduling.setGroupdetailId(ckGroupDetailId); - ckscheduling.setGroupdetailId(oldGroupDetailId); - } - } - - - this.schedulingService.update(scheduling); - this.schedulingService.update(ckscheduling); - - return "result"; - } - - @RequestMapping("/getWorkPeopleList.do") - public ModelAndView getWorkPeopleList(HttpServletRequest request, Model model) { - String[] workpeopleids = request.getParameter("workpeopleids").split(","); - GroupDetail groupDetail = this.groupDetailService.selectById(request.getParameter("groupdetailId")); - - JSONArray array = new JSONArray(); - if (workpeopleids != null && workpeopleids.length > 0) { - if (!workpeopleids[0].equals("")) { - for (int i = 0; i < workpeopleids.length; i++) { - JSONObject object = new JSONObject(); - User user = this.userService.getUserById(workpeopleids[i]); - object.put("id", user.getId()); - object.put("caption", user.getCaption()); - - if (workpeopleids[i].equals(groupDetail.getLeader())) { - object.put("job", "组长"); - } else { - object.put("job", "组员"); - } - if (workpeopleids.length == 1) { - object.put("groupDetailChangeSt", "change"); - } else { - object.put("groupDetailChangeSt", "unchange"); - } - array.add(object); - } - } - } - String result = "{\"total\":" + workpeopleids.length + ",\"rows\":" + array + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/workPeopleAdd.do") - public String workPeopleAdd(HttpServletRequest request, Model model) { - return "work/schedulingWorkPeopleAdd"; - } - - @RequestMapping("/workPeopleSave.do") - public String workPeopleSave(HttpServletRequest request, Model model) { - String schedulingId = request.getParameter("schedulingId"); - String userIds = request.getParameter("userIds"); - Scheduling scheduling = this.schedulingService.selectById(schedulingId); - String workPeople = scheduling.getWorkpeople(); - if (workPeople != null && workPeople.length() > 0) { - workPeople += userIds; - } else { - workPeople = userIds; - } - scheduling.setWorkpeople(workPeople); - this.schedulingService.update(scheduling); - - model.addAttribute("result", workPeople); - return "result"; - } - - @RequestMapping("/workPeopleDelete.do") - public String workPeopleDelete(HttpServletRequest request, Model model) { - String id = request.getParameter("schedulingId"); - String userId = request.getParameter("userId"); - Scheduling scheduling = this.schedulingService.selectById(id); - String workPeoples = scheduling.getWorkpeople(); - workPeoples = workPeoples.replaceAll(userId + ",", ""); - scheduling.setWorkpeople(workPeoples); - int code = this.schedulingService.update(scheduling); - -// Result result = new Result(); -// if (code == Result.SUCCESS) { -// result = Result.success(code); -// } else { -// result = Result.failed("删除失败"); -// } - - model.addAttribute("result", workPeoples); - return "result"; - } - - @RequestMapping("/getWorkPeopleById.do") - public ModelAndView getWorkPeopleById(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String userId = request.getParameter("userId"); - - Scheduling scheduling = this.schedulingService.selectById(id); - if (scheduling != null) { - JSONArray array = new JSONArray(); - String[] workpeopleids = scheduling.getWorkpeople().split(","); - if (workpeopleids != null && workpeopleids.length > 0) { - if (!workpeopleids[0].equals("")) { - for (int i = 0; i < workpeopleids.length; i++) { - if (!userId.equals(workpeopleids[i])) { - JSONObject object = new JSONObject(); - User user = this.userService.getUserById(workpeopleids[i]); - object.put("id", user.getId()); - object.put("caption", user.getCaption()); - - array.add(object); - } - - } - } - } -// String result = "{\"rows\":" + array + "}"; - model.addAttribute("result", array); - } - - return new ModelAndView("result"); - } - - @RequestMapping("/canReplaceTask.do") - public String canReplaceTask(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String nowTime = CommUtil.nowDate(); - List list = this.schedulingService.selectListByWhere2(" where bizid='" + unitId + "' and (stdt<='" + nowTime + "' and eddt>='" + nowTime + "' ) "); - if (list != null && list.size() > 0) { - model.addAttribute("result", JSONArray.fromObject(list)); - } else { - model.addAttribute("result", "当前无排班数据"); - } - - return "result"; - } - - @RequestMapping("/showlistForSelectByscheduling.do") - public String showlistForSelectByscheduling(HttpServletRequest request, Model model) { - return "/work/schedulingListForSelectByscheduling"; - } - - @RequestMapping("/edit4scheduling.do") - public String edit4scheduling(HttpServletRequest request, Model model) { - String schedulingid = request.getParameter("id"); - String userids = request.getParameter("userids"); - String workstationids = request.getParameter("workstationids"); - model.addAttribute("schedulingid", schedulingid); - model.addAttribute("userids", userids); - model.addAttribute("workstationids", workstationids); - return "/work/schedulingMemberListForScheduling"; - } - - @RequestMapping("/getSchedulingTypeListForSelect.do") - public String getSchedulingTypeListForSelect(HttpServletRequest request, Model model) { - //List list = this.schedulingService.selectListByWhere(""); - String json = GroupManage.getAllPatrolType4JSON(); - //System.out.println(json); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getlCalenderEvents.do") - public ModelAndView getlCalenderEvents(HttpServletRequest request, Model model, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - @RequestParam(value = "schedulingtype") String schedulingtype) { - //HttpSession currentSession = request.getSession(false); - //User cu=(User)request.getSession().getAttribute("cu"); - if (request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()) { - String orderstr = " order by stdt asc,groupManageid asc"; - - String wherestr = " where bizid='" + request.getParameter("bizid") + "' and isTypeSetting='" + Scheduling.IsTypeSetting_True + "' and schedulingtype='" + schedulingtype + "' " + - " and (stdt>='" + sdt + "' and stdt<'" + edt + "') "; -// " and stdt between '"+ sdt +"' and '"+ edt +"'"; - - -// System.out.println(wherestr); - //PageHelper.startPage(page, rows); - List list = this.schedulingService.selectCalenderListByWhere(wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); -// System.out.println(result); - model.addAttribute("result", json); - } - return new ModelAndView("result"); - } - - @RequestMapping("/getlCalenderEventsForR.do") - public ModelAndView getlCalenderEventsForR(HttpServletRequest request, Model model, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt, - @RequestParam(value = "schedulingtype") String schedulingtype) { - //HttpSession currentSession = request.getSession(false); - //User cu=(User)request.getSession().getAttribute("cu"); - if (request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()) { - String orderstr = " order by stdt asc,groupManageid asc"; - - String wherestr = " where bizid='" + request.getParameter("bizid") + "' and schedulingtype='" + schedulingtype + "' " + - " and (stdt>='" + sdt + "' and stdt<'" + edt + "') "; - - //PageHelper.startPage(page, rows); - List list = this.schedulingService.selectCalenderListByWhere(wherestr + orderstr); - - JSONArray json = JSONArray.fromObject(list); -// System.out.println(result); - model.addAttribute("result", json); - } - return new ModelAndView("result"); - } - - /** - * 交接班方法 - */ - @RequestMapping("/showHandover.do") - public String showHandover(HttpServletRequest request, Model model) { - String nowDate = CommUtil.nowDate(); - model.addAttribute("nowDate", nowDate); - return "/work/schedulingHandover"; - } - - @RequestMapping("/showSucceed.do") - public String showSucceed(HttpServletRequest request, Model model) { - return "/work/schedulingSucceed"; - } - - /** - * 判断是否可以交班 - * - * @param request - * @param model - * @param scheduling - * @return - */ - @RequestMapping("/validateHandover.do") - public String validateHandover(HttpServletRequest request, Model model, - @ModelAttribute Scheduling scheduling) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = -1; - String wherestr = " where Convert(varchar,stdt,120) like '" + scheduling.getStdt() - + "%' and groupManageid = '" + scheduling.getGroupmanageid() - + "' and bizid = '" + scheduling.getBizid() + "' and schedulingtype = '" + scheduling.getSchedulingtype() - //+"' and patrolmode = '"+scheduling.getPatrolmode() 巡检模式不是定位条件 - + "'"; - String orderstr = " order by insdt"; - - List schedulingList = this.schedulingService.selectListByWhere(wherestr + orderstr); - if (schedulingList != null && schedulingList.size() != 0) { - //有排班记录,默认只有一条 - /*if(schedulingList.get(0).getStatus() == Scheduling.Status_Arranged){ - result = Scheduling.Status_Arranged; - }else{*/ - result = schedulingList.get(0).getStatus(); - //} - } else { - //没有排班记录,状态未排班 -// result = Scheduling.Status_Unarranged; - } - - //String resstr="{\"res\":"+result+"}"; - model.addAttribute("result", result); - return "result"; - } - - - /** - * 交班操作 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/handover.do") - public String handover(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String groupType = request.getParameter("groupType"); - String unitId = request.getParameter("unitId"); - String schedulingId = request.getParameter("schedulingId"); - String workpeople = request.getParameter("workpeople"); - - if (request.getParameter("saveSt").equals("1")) { - Scheduling scheduling = this.schedulingService.selectById(schedulingId); - if (scheduling != null) { - scheduling.setStatus(Scheduling.Status_Handovered); - scheduling.setHandoveruser(cu.getId()); - scheduling.setHandoverdt(CommUtil.nowDate()); - scheduling.setWorkpeople(workpeople); - - this.schedulingService.update(scheduling); - } - } - - String wherestr = "where 1=1 and unit_id= '" + unitId + "' and groupTypeId= '" + groupType + "' " + - " and type='" + GroupContent.Type_Content + "' and (groupTypeId is not null or groupTypeId!='null' ) "; - List list = this.groupContentService.selectListByWhere(wherestr + " order by morder"); - - if (list != null && list.size() > 0) { - GroupContent groupContent = list.get(0); - List gfrList = this.groupContentFormService.selectListByWhere(" where pid='" + groupContent.getId() + "' and type='" + GroupContentForm.Type_row + "' order by insertRow"); - for (GroupContentForm gfr : - gfrList) { - List gfcList = this.groupContentFormService.selectListByWhere(" where pid='" + gfr.getId() + "' and type='" + GroupContentForm.Type_column + "' order by insertColumn"); - for (GroupContentForm gfc : - gfcList) { - String gfcid = gfc.getId(); - String value = request.getParameter(gfcid); - if (gfc.getShowtextst() != null && gfc.getShowtextst().equals(GroupContentForm.Showtextst_TRUE)) { - if (gfc.getDatampid() != null && !gfc.getDatampid().equals("")) { - if (gfc.getMpst() != null && !gfc.getMpst().equals("")) { - if (gfc.getMpst().equals(GroupContentForm.Mpst_1)) { - //同时将数据存入生产库 - String nowTime = CommUtil.nowDate(); - MPoint mPoint = this.mPointService.selectById(gfc.getDatampid()); - BigDecimal bv = new BigDecimal(value); - mPoint.setParmvalue(bv); - mPoint.setMeasuredt(nowTime); - this.mPointService.update(mPoint.getBizid(), mPoint); - - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(bv); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setTbName("[TB_MP_" + gfc.getDatampid() + "]"); - this.mPointHistoryService.save(mPoint.getBizid(), mPointHistory); - - } - } - } - } - List groupContentoFrmDataLis = this.groupContentFormDataService.selectListByWhere(" where schedulingId='" + schedulingId + "' and formId='" + gfcid + "' "); - if (groupContentoFrmDataLis != null && groupContentoFrmDataLis.size() > 0) { - GroupContentFormData groupContentFormData = groupContentoFrmDataLis.get(0); - groupContentFormData.setInsdt(CommUtil.nowDate()); - groupContentFormData.setValue(value); - this.groupContentFormDataService.update(groupContentFormData); - } else { - if (gfc.getShowtext() == null || gfc.getShowtext().equals("")) { - if (request.getParameter(gfcid) != null && !request.getParameter(gfcid).equals("")) { - GroupContentFormData groupContentFormData = new GroupContentFormData(); - groupContentFormData.setId(CommUtil.getUUID()); - groupContentFormData.setInsdt(CommUtil.nowDate()); - groupContentFormData.setFormid(gfcid); - groupContentFormData.setSchedulingid(schedulingId); - groupContentFormData.setValue(value); - this.groupContentFormDataService.save(groupContentFormData); - } - - } - } - - - } - } - - } - Result result = new Result(); - result = Result.success(1); - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - - /** - * 判断是否可以接班 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/validateSucceed.do") - public String validateSucceed(HttpServletRequest request, Model model, - @RequestParam(value = "bizid") String bizid, - @RequestParam(value = "schedulingtype") String schedulingtype) { - User cu = (User) request.getSession().getAttribute("cu"); - - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - String wherestr = " where bizid = '" + bizid + "' and schedulingtype = '" + schedulingtype + "' " + - " and (stdt>='" + sdt + "' and stdt<'" + edt + "') "; -// " and (datediff(MINUTE,stdt,'"+sdt+"')=0 and datediff(MINUTE,eddt,'"+edt+"')=0 )"; -// System.out.println(wherestr); - List schedulingList = this.schedulingService.selectListByWhere2(wherestr); - - JSONArray json = JSONArray.fromObject(schedulingList); - - model.addAttribute("result", json); - return "result"; - } - - /** - * 接班 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/succeed.do") - public String succeed(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String nowSchedulingId = request.getParameter("nowSchedulingId"); - String succeedremark = request.getParameter("succeedremark");//接班备注 - String workpeople = request.getParameter("workpeople");//工作人员 - - Scheduling scheduling = this.schedulingService.selectById(nowSchedulingId); - - scheduling.setStatus(Scheduling.Status_Succeeded); - scheduling.setSucceeduser(cu.getId()); - scheduling.setSucceeddt(CommUtil.nowDate()); - scheduling.setSucceedremark(succeedremark); - scheduling.setWorkpeople(workpeople); - - Result result = new Result(); - - int code = this.schedulingService.update(scheduling); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("提交失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 非当班人员接单 目前执行内容与直接接班无区别 前台会有提示 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/succeed2.do") - public String succeed2(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String nowSchedulingId = request.getParameter("nowSchedulingId"); - String succeedremark = request.getParameter("succeedremark");//接班备注 - String workpeople = request.getParameter("workpeople");//工作人员 - - Scheduling scheduling = this.schedulingService.selectById(nowSchedulingId); - - scheduling.setStatus(Scheduling.Status_Succeeded); - scheduling.setSucceeduser(cu.getId()); - scheduling.setSucceeddt(CommUtil.nowDate()); - scheduling.setSucceedremark(succeedremark); - scheduling.setWorkpeople(workpeople); - - Result result = new Result(); - - int code = this.schedulingService.update(scheduling); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("提交失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 当前无排班,直接添加接班记录 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/succeed3.do") - public String succeed3(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - String groupType = request.getParameter("groupType");//班组类型 - String groupDetailId = request.getParameter("groupDetailId");//班组 - String groupTime = request.getParameter("groupTime");//班次 - String sdt = request.getParameter("sdt");//当前班次起始时间 - String edt = request.getParameter("edt");//当前班次结束时间 - String succeedremark = request.getParameter("succeedremark");//接班备注 - String workpeople = request.getParameter("workpeople");//工作人员 - - Scheduling scheduling = new Scheduling(); - scheduling.setId(CommUtil.getUUID()); - scheduling.setInsdt(CommUtil.nowDate()); - scheduling.setInsuser(cu.getId()); - scheduling.setBizid(unitId); - scheduling.setGroupdetailId(groupDetailId); - scheduling.setGroupmanageid(groupTime); - scheduling.setSchedulingtype(groupType); - scheduling.setStdt(sdt); - scheduling.setEddt(edt); - scheduling.setStatus(Scheduling.Status_Succeeded); - scheduling.setIstypesetting(Scheduling.IsTypeSetting_False); - scheduling.setSucceeduser(cu.getId()); - scheduling.setSucceeddt(CommUtil.nowDate()); - scheduling.setSucceedremark(succeedremark); - scheduling.setWorkpeople(workpeople); - - Result result = new Result(); - - int code = this.schedulingService.save(scheduling); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("提交失败"); - } - - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - /** - * 判断是否为当班人员 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/isGroupDetailUser.do") - public String isGroupDetailUser(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("bizid"); - String groupType = request.getParameter("groupType");//班组类型 - String groupTime = request.getParameter("groupTime");//班次 - String sdt = request.getParameter("sdt");//当前班次起始时间 - String edt = request.getParameter("edt");//当前班次结束时间 - String nowTime = CommUtil.nowDate(); - - JSONObject jsonObject = new JSONObject(); -// System.out.println("where schedulingtype='"+groupType+"' and groupManageid='"+groupTime+"' and bizid='"+unitId+"' and (stdt<='"+sdt+"' and etdt>='"+edt+"')"); - List schedulingList = this.schedulingService.selectListByWhere(" where schedulingtype='" + groupType + "' and groupManageid='" + groupTime + "' " + - "and bizid='" + unitId + "' and (stdt<='" + nowTime + "' and eddt>='" + nowTime + "') "); - if (schedulingList != null && schedulingList.size() > 0) { - Scheduling scheduling = schedulingList.get(0); - - //判断是否是当班人员 - String inUserIds = scheduling.getWorkpeople() != null ? scheduling.getWorkpeople() : ""; -// String[] groupDetailIds = scheduling.getGroupdetailId().split(","); -// for (String groupDetailId : -// groupDetailIds) { -// GroupDetail groupDetail = this.groupDetailService.selectById(groupDetailId); -// inUserIds += groupDetail.getLeader() + "," + groupDetail.getMembers() + ","; -// } - - if (inUserIds.contains(cu.getId())) { - jsonObject.put("res", '1');//在当班人员列表中 - } else { - jsonObject.put("res", '2');//不在当班人员列表中 - } - - } else { - //未排班 - jsonObject.put("res", '3'); - } - - model.addAttribute("result", jsonObject); - return "result"; - } - - /** - * 获取当前接班记录 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/getNowRecord.do") - public String getNowRecord(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - String nowTime = CommUtil.nowDate(); - int nowHour = Integer.valueOf(nowTime.substring(11, 13)); - int nowMin = Integer.valueOf(nowTime.substring(14, 16)); - - int nowTimeCK = nowHour+(nowMin/60); - - JSONArray jsonM = new JSONArray(); - List groupTypeList = this.groupTypeService.selectListByWhere(" where 1=1 order by morder "); - for (GroupType groupType : - groupTypeList) { - List groupTimeList = this.groupTimeService.selectListByWhere(" where unit_id='" + unitId + "' and grouptype_id='" + groupType.getId() + "' order by sdt "); - for (GroupTime groupTime : - groupTimeList) { - int timeExpand = 0; - if (groupTime.getTimeexpand() != null) { - timeExpand = groupTime.getTimeexpand(); - } -// String sdt=groupTime.getSdt(); -// String edt=groupTime.getEdt(); -// String expandedt=CommUtil.subplus(edt,String.valueOf(timeExpand),"min"); - int firstHour = Integer.valueOf(groupTime.getSdt().substring(0, 2)); - String sdt = nowTime.substring(0, 11) + groupTime.getSdt().substring(0, 5); - String edtAdd = String.valueOf(groupTime.getEdtadd()); - String edt = nowTime.substring(0, 11) + groupTime.getEdt().substring(0, 5); - if (nowTimeCK < firstHour) { -// sdt = CommUtil.subplus(sdt, "-" + edtAdd, "day"); - } else { - edt = CommUtil.subplus(edt, edtAdd, "day").substring(0, 11) + edt.substring(11, 16); - } - String expandsdt = CommUtil.subplus(edt, "-" + String.valueOf(timeExpand), "min"); - String expandedt = CommUtil.subplus(edt, String.valueOf(timeExpand), "min"); - -// String expandSNowTime = CommUtil.subplus(nowTime,"-"+String.valueOf(timeExpand),"min"); -// String expandENowTime = CommUtil.subplus(nowTime,String.valueOf(timeExpand),"min"); - - List schedulingList = this.schedulingService.selectListByWhere2(" where (status=" + Scheduling.Status_Succeeded + " or status=" + Scheduling.Status_Handovered + ") and schedulingtype='" + groupType.getId() + "' and groupManageid='" + groupTime.getId() + "' " + - "and bizid='" + unitId + "' and (stdt<='" + nowTime + "' and dateAdd(minute," + timeExpand + ",eddt)>='" + nowTime + "') and (CHARINDEX('" + cu.getId() + "',workPeople)>0 or succeeduser='" + cu.getId() + "' ) order by stdt desc"); - if (schedulingList != null && schedulingList.size() > 0) { - Scheduling scheduling = schedulingList.get(0); - JSONObject jsonObject = new JSONObject(); - - jsonObject.put("id", scheduling.getId()); - jsonObject.put("groupTypeId", groupType.getId()); - jsonObject.put("groupTypeName", groupType.getName()); - jsonObject.put("groupTimeId", groupTime.getId()); - jsonObject.put("groupTimeName", groupTime.getName()); - jsonObject.put("workPeople", scheduling.getWorkpeople()); - jsonObject.put("workPeopleName", scheduling.get_workpeopleName()); - jsonObject.put("expandsdt", expandsdt); - jsonObject.put("expandedt", expandedt); - if (scheduling.getStatus() == Scheduling.Status_Succeeded) { - jsonObject.put("handovered", "false"); - } else if (scheduling.getStatus() == Scheduling.Status_Handovered) { - jsonObject.put("handovered", "true"); - } - - jsonM.add(jsonObject); - } - } - - } -// System.out.println(jsonM); - model.addAttribute("result", jsonM); - return "result"; - } - - /** - * 获取type下的当班人员 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/getNowPeopleByType.do") - public String getNowPeopleByType(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String nowTime = CommUtil.nowDate(); - - List schedulingList = this.schedulingService.selectListByWhere(" where bizid='" + unitId + "' and ('" + nowTime + "'>=stdt and '" + nowTime + "'<=eddt) and schedulingtype='" + type + "'"); - String workPeopel = ""; - if (schedulingList != null && schedulingList.size() > 0) { - workPeopel = schedulingList.get(0).getWorkpeople(); - } - - model.addAttribute("result", workPeopel); - return "result"; - } - - /** - * 获取某巡检模式下当前的当班人员 - * - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/getNowPeopleByPatrolType.do") - public String getNowPeopleByPatrolType(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String type = request.getParameter("type"); - String nowTime = CommUtil.nowDate(); - - List schedulingList = this.schedulingService.selectListByWhere2(" where bizid='" + unitId + "' and ('" + nowTime + "'>=stdt and '" + nowTime + "'<=eddt) "); - String groupdetailId = ""; - if (schedulingList != null && schedulingList.size() > 0) { - for (int i = 0; i < schedulingList.size(); i++) { - GroupType grouptype = this.groupTypeService.selectById(schedulingList.get(i).getSchedulingtype()); - if (grouptype != null) { - if (grouptype.getPatroltype().equals(type)) { - groupdetailId = schedulingList.get(i).getGroupdetailId(); - } - } - } - } - - JSONObject jsonObject = new JSONObject(); - GroupDetail groupdetail = this.groupDetailService.selectById(groupdetailId); - if (groupdetail != null) { - String userIds = ""; - if (groupdetail.getLeader() != null) { - userIds += groupdetail.getLeader() + ","; - } - if (groupdetail.getMembers() != null) { - userIds += groupdetail.getMembers(); - } - jsonObject.put("userIds", userIds); - } - - model.addAttribute("result", jsonObject); - return "result"; - } - - /** - * 交接班记录(日历) - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showHandoverRecord.do") - public String showHandoverRecord(HttpServletRequest request, Model model) { - return "/work/schedulingHandoverRecord"; - } - - /** - * 交接班记录(列表) - * - * @param request - * @param model - * @param date - * @return - */ - @RequestMapping("/showHandoverList.do") - public String showHandoverList(HttpServletRequest request, Model model, - @RequestParam(value = "date") String date) { - model.addAttribute("date", date.substring(0, 10)); - return "/work/schedulingHandoverList"; - } - - /** - * 交接班记录详细信息 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/view.do") - public String view(HttpServletRequest request, Model model) { - String schedulingId = request.getParameter("id"); - String wherestr = " where id = '" + schedulingId + "'"; - List schedulingList = this.schedulingService.selectListByWhere2(wherestr); - - Scheduling scheduling = new Scheduling(); - if (schedulingList != null && schedulingList.size() > 0) { - scheduling = schedulingList.get(0); - if (scheduling.getPatrolmode() != null) { - if (!scheduling.getPatrolmode().equals("")) { - PatrolModel patrolModel = this.patrolModelService.selectById(scheduling.getPatrolmode()); - if (patrolModel != null) { - scheduling.setPatrolmodeName(patrolModel.getName()); - } -// scheduling.setPatrolmodeName(PatrolType.getName(scheduling.getPatrolmode())); - } - } - - String schedulingtypeId = scheduling.getSchedulingtype(); - GroupType groupType = this.groupTypeService.selectById(schedulingtypeId); - if (groupType.getPatroltype() != null) { - scheduling.setPatroltypeName(PatrolType.getName(groupType.getPatroltype())); - } - } - - model.addAttribute("scheduling", scheduling); - return "work/schedulingView"; - } - - - /** - * 导入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/importExcelFun.do") - public String importExcelFun(HttpServletRequest request, Model model) { - return "work/schedulingExcelImport"; - } - - @RequestMapping("/saveExcelData.do") - public ModelAndView saveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - String unitId = request.getParameter("unitId"); - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - //String res = equipmentCardService.readXls(excelFile.getInputStream()); - String res = this.schedulingService.readXls(excelFile.getInputStream(), cu.getId(), unitId); - - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 模板导出 - */ - @RequestMapping(value = "outTemplateExcelFun.do") - public ModelAndView outTemplateExcelFun(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - - this.schedulingService.outTemplateExcelFun(response); - return null; - } - - /** - * 导出 - */ - @RequestMapping(value = "downloadExcelFun.do") - public ModelAndView downloadExcelFun(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String date = request.getParameter("date"); - String unitId = request.getParameter("unitId"); - String groupType = request.getParameter("groupType"); - this.schedulingService.outExcelFun(response, date.substring(0, 10), unitId, groupType); - return null; - } - - @RequestMapping(value = "getXYNowPeople.do") - public ModelAndView getXYNowPeople(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String nowTime = CommUtil.nowDate(); - String bizid = request.getParameter("bizid"); - - List typelist = this.groupTypeService.selectListByWhere(" where name='运行班' order by morder"); - - String leader = ""; - if (typelist != null && typelist.size() > 0) { - String typeId = typelist.get(0).getId(); - List schedulingList = this.schedulingService.selectListByWhere(" where schedulingtype='" + typeId + "' and bizid='" + bizid + "' and (stdt<='" + nowTime + "' and eddt>='" + nowTime + "') order by stdt desc"); - if (schedulingList != null && schedulingList.size() > 0) { - String groupdetailId = schedulingList.get(0).getGroupdetailId(); - - GroupDetail groupdetail = this.groupDetailService.selectById(groupdetailId); - if (groupdetail != null) { - leader = groupdetail.get_leader(); - } - } - - } - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("result", leader); - - model.addAttribute("result", jsonObject); - return new ModelAndView("result"); - } - - @RequestMapping("/editChangeShiftsUser.do") - public String userForOneSelect(HttpServletRequest request, Model model) { - return "work/schedulingEditChangeShiftsUser"; - } - - @RequestMapping(value = "changeShiftsUserDo.do") - public ModelAndView changeShiftsUserDo(HttpServletRequest request, - HttpServletResponse response, Model model) { - String id = request.getParameter("id"); - String userId = request.getParameter("userId"); - String type = request.getParameter("type"); - String time = request.getParameter("time"); - String unitId = request.getParameter("unitId"); - - List groupDetailList = this.groupDetailService.selectListByWhere(" where (leader='" + userId + "' or members like '%" + userId + "%')" + - " and unit_id='" + unitId + "' "); - - if (groupDetailList != null && groupDetailList.size() > 0) { - Scheduling scheduling = this.schedulingService.selectById(id); - if (type.equals("0")) {//更改接班人 - scheduling.setSucceeduser(userId); - scheduling.setSucceeddt(time); - scheduling.setGroupdetailId(groupDetailList.get(0).getId());//修改班组 - } else if (type.equals("1")) {//更改交班人 - scheduling.setHandoveruser(userId); - scheduling.setHandoverdt(time); - } - - int result = this.schedulingService.update(scheduling); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - } else { - model.addAttribute("result", "{\"res\":\"-2\"}"); - } - return new ModelAndView("result"); - } - - @RequestMapping(value = "changeStatus.do") - public ModelAndView changeStatus(HttpServletRequest request, - HttpServletResponse response, Model model) { - String st = request.getParameter("st"); - String id = request.getParameter("id"); - Scheduling scheduling = this.schedulingService.selectById(id); - - if (st.equals("0")) {//接班 - scheduling.setStatus(Scheduling.Status_Succeeded); - } else if (st.equals("1")) {//交班 - scheduling.setStatus(Scheduling.Status_Handovered); - } - int result = this.schedulingService.update(scheduling); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - - return new ModelAndView("result"); - } -} diff --git a/src/com/sipai/controller/work/SchedulingReplaceJobController.java b/src/com/sipai/controller/work/SchedulingReplaceJobController.java deleted file mode 100644 index d10d3f5c..00000000 --- a/src/com/sipai/controller/work/SchedulingReplaceJobController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.work.Scheduling; -import com.sipai.service.work.SchedulingService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.SchedulingReplaceJob; -import com.sipai.service.work.SchedulingReplaceJobService; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping("/work/schedulingReplaceJob") -public class SchedulingReplaceJobController { - @Resource - private SchedulingReplaceJobService schedulingReplaceJobService; - @Resource - private SchedulingService schedulingService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "work/schedulingReplaceJobList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null || sort.equals("id")) { - sort = " replacetime "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - if (request.getParameter("replacepeople") != null && !request.getParameter("replacepeople").isEmpty()) { - wherestr += " and replacePeople='" + request.getParameter("replacepeople") + "'"; - } - if (request.getParameter("schedulingid") != null && !request.getParameter("schedulingid").isEmpty()) { - wherestr += " and schedulingId='" + request.getParameter("schedulingid") + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.schedulingReplaceJobService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/doReplace.do") - public ModelAndView doReplace(HttpServletRequest request, Model model) { - String schedulingId = request.getParameter("schedulingId"); - String oldPeople = request.getParameter("oldPeople"); - String replacePeople = request.getParameter("replacePeople"); - - Scheduling scheduling = this.schedulingService.selectById(schedulingId); - if (scheduling != null) { -// String workPeople = scheduling.getWorkpeople(); -// scheduling.setWorkpeople(workPeople.replace(oldPeople, replacePeople)); -// int code = this.schedulingService.update(scheduling); - - SchedulingReplaceJob schedulingReplaceJob = new SchedulingReplaceJob(); - schedulingReplaceJob.setId(CommUtil.getUUID()); - schedulingReplaceJob.setReplacetime(CommUtil.nowDate()); - schedulingReplaceJob.setOldpeople(oldPeople); - schedulingReplaceJob.setReplacepeople(replacePeople); - schedulingReplaceJob.setSchedulingid(schedulingId); - - int code2 = this.schedulingReplaceJobService.save(schedulingReplaceJob); - if (code2 == 1 ) { - model.addAttribute("result", "true"); - } else { - model.addAttribute("result", "fail"); - } - } - - return new ModelAndView("result"); - } - - @RequestMapping("/getListByUserId.do") - public String getListByUserId(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - String userId = request.getParameter("userId"); - String nowTime = CommUtil.nowDate(); - - List slist = this.schedulingService.selectListByWhere(" where bizid='"+unitId+"' and (stdt<='"+nowTime+"' and eddt>='"+nowTime+"' ) "); - String scid=""; - if(slist!=null&&slist.size()>0){ - for (Scheduling scheduling : slist) { - scid+=scheduling.getId()+","; - } - } - scid = scid.replace(",", "','"); - - List list = this.schedulingReplaceJobService.selectListByWhere(" where 1=1 and replacePeople='"+userId+"' and schedulingId in ('" + scid + "') "); - String userid=""; - if(list!=null&&list.size()>0){ - for (SchedulingReplaceJob schedulingReplaceJob : list) { - if(userid.indexOf(schedulingReplaceJob.getOldpeople())<0){ - userid+=schedulingReplaceJob.getOldpeople()+","; - } - } - } - model.addAttribute("result", userid); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/SendDataService_Hour.java b/src/com/sipai/controller/work/SendDataService_Hour.java deleted file mode 100644 index 8b334870..00000000 --- a/src/com/sipai/controller/work/SendDataService_Hour.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.sipai.controller.work; - -import java.sql.ResultSet; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.scada.DataSummary; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.DataSummaryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/dataSummary") -public class SendDataService_Hour { - @Resource - private CompanyService companyService; - @Resource - private DataSummaryService dataSummaryService; - - @RequestMapping("/sendData.do") - public String sendData(String text,String factoryname){ - try { -// text=charSetConvert(text); - System.out.println("收到text----"+text); - System.out.println("收到factoryname----"+factoryname.toUpperCase()); - //System.out.println("utf-8 编码:" + text) ; - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - sendData_ALL(text,factoryname.toUpperCase()); - return "factory:"+factoryname+";text:"+text; - } - - public String charSetConvert(String xmlRequest){ - String charSet = getEncoding(xmlRequest); - try { - byte[] b = xmlRequest.getBytes(charSet); - xmlRequest = new String(b, "UTF-8"); - } catch (Exception e) { - // logger.error("输入的内容不属于常见的编码格式,请再仔细核实", e); - } - return xmlRequest; - - } - - public static String getEncoding(String str) { - String encode = "GB2312"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是GB2312 - String s = encode; - return s; // 是的话,返回GB2312,以下代码同理 - } - } catch (Exception e) { - // logger.error("getEncoding异常---GB2312", e); - } - encode = "ISO-8859-1"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是ISO-8859-1 - String s1 = encode; - return s1; - } - } catch (Exception e) { - // logger.error("getEncoding异常---ISO-8859-1", e); - } - encode = "UTF-8"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是UTF-8编码 - String s2 = encode; - return s2; - } - } catch (Exception e) { - // logger.error("getEncoding异常---UTF-8", e); - } - encode = "GBK"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是GBK - String s3 = encode; - return s3; - } - } catch (Exception e) { - // logger.error("getEncoding异常---GBK", e); - } - return ""; // 到这一步,你就应该检查是不是其他编码啦 - } - - public void sendData_ALL(String text,String factoryname){ - String uploaddt=""; - String parmvalue=""; - if(text.indexOf(",")>0) - { - uploaddt=text.substring(0, text.indexOf(",")); - parmvalue=text.substring(text.indexOf(",")+1,text.length()); - } - try { - List list=this.companyService.selectListByWhere(" where ename='"+factoryname+"' "); - if(list!=null&&list.size()>0){ - String bizid=list.get(0).getId(); - - DataSummary dataSummary=new DataSummary(); - dataSummary.setId(CommUtil.getUUID()); - dataSummary.setInsdt(CommUtil.nowDate()); - dataSummary.setParmvalue(parmvalue); - dataSummary.setUploaddt(uploaddt); - dataSummary.setDisplay("0"); - this.dataSummaryService.save(bizid, dataSummary); - - } - } catch (Throwable e) { - e.printStackTrace(); - } finally { - uploaddt = null; - parmvalue = null; - } - } -} diff --git a/src/com/sipai/controller/work/SpeechRecognitionController.java b/src/com/sipai/controller/work/SpeechRecognitionController.java deleted file mode 100644 index 2446c4ff..00000000 --- a/src/com/sipai/controller/work/SpeechRecognitionController.java +++ /dev/null @@ -1,354 +0,0 @@ -package com.sipai.controller.work; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.work.SpeechRecognitionMpRespond; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.work.SpeechRecognitionMpRespondService; -import com.sipai.tools.ChangeToPinYinJP; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.singularsys.jep.functions.Add; -import com.sipai.entity.work.SpeechRecognition; -import com.sipai.service.work.SpeechRecognitionService; - -@Controller -@RequestMapping("/work/speechRecognition") -public class SpeechRecognitionController { - @Resource - private SpeechRecognitionService speechRecognitionService; - @Resource - private SpeechRecognitionMpRespondService speechRecognitionMpRespondService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "work/speechRecognitionList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - if (sort == null || sort.equals("id")) { - sort = " time "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String codeString = request.getParameter("search_code"); - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and bizid='" + request.getParameter("search_code") + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.speechRecognitionService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); - String text = request.getParameter("text"); - - List list = new ArrayList(); - - String[] results = null; - String cl = "an,en,in"; - - if(id!=null&&!id.equals("")){ - list = this.speechRecognitionService.selectListByWhere("where id='"+id+"' "); - }else{ - - if (text!=null&&text.length() > 0) { - if ((text.substring(text.length() - 1, text.length())).equals("。")) { - text = text.substring(0, text.length() - 1); - } - } - - String inResult = text; - String outResult = ""; - results = ChangeToPinYinJP.changeToTonePinYin(inResult).split(" "); -// System.out.println(ChangeToPinYinJP.changeToTonePinYin(inResult)); - //前鼻音:【an en in un vn】 - //后鼻音:【ang eng ing ong】 - //那模糊处理的为 an(g) en(g) in(g) - - if (results != null && results.length > 0) { - for (int i = 0; i < results.length; i++) { - String result = results[i]; - if (result.length() >= 2) { - if (cl.indexOf(result.substring(result.length() - 2, result.length())) >= 0) { -// System.out.println(result); - outResult += result + "g"; - } else { - outResult += result; - } - } else { - outResult += result; - } - - } - } - System.out.println(outResult); - list = this.speechRecognitionService.selectListByWhere("where (CHARINDEX('" + outResult + "',text)>0) and unitId='" + unitId + "' "); - } - - if(list.size()==0){ - List cklistTrue = new ArrayList(); - if (results != null && results.length > 0) { -// System.out.println(Math.ceil(results.length)); - - for (int i = 0; i < results.length; i++) { - String result = results[i]; - if (result.length() >= 2) { - if (cl.indexOf(result.substring(result.length() - 2, result.length())) >= 0) { - result = result + "g"; - } - } - - List cklist = this.speechRecognitionService.selectListByWhere("where text like '%"+result+"%' " - + " and (textLength>="+results.length+" and textLength<="+Math.ceil(results.length*1.2)+") and unitId='" + unitId + "' "); - if(cklist!=null&&cklist.size()>0){ - for (SpeechRecognition s : cklist) { - int inNum=0; - for (SpeechRecognition s2 : cklistTrue) { - if(s2.getId().equals(s.getId())){ - s2.setCknum(s2.getCknum()+1); - inNum=1; - } - } - - if(inNum==0){ - SpeechRecognition ckspeechRecognition = new SpeechRecognition(); - ckspeechRecognition.setId(s.getId()); - ckspeechRecognition.setCknum(1); - ckspeechRecognition.setTextlength(s.getTextlength()); - cklistTrue.add(ckspeechRecognition); - } - } - } - - } - - } - - String maxId=""; - int maxNum=0; - float rate=0; - for (SpeechRecognition cktrue : cklistTrue) { - if(cktrue.getCknum()>maxNum){ - maxId=cktrue.getId(); - maxNum=cktrue.getCknum(); - rate=(float)cktrue.getCknum()/cktrue.getTextlength()*100; - } - } - if(!maxId.equals("")&&rate>=60){ - System.out.println("修正id(符合率"+Math.round(rate*10000)/10000+"):"+maxId); - list = this.speechRecognitionService.selectListByWhere("where id='"+maxId+"' "); - } - } - - String regex = "(?<=\\{)(.+?)(?=\\})"; - //语音反馈内容判断 - if (list != null && list.size() > 0) { - for (SpeechRecognition speechRecognition : - list) { - if (speechRecognition.getRespondvoice() != null) { - String respondvoice = speechRecognition.getRespondvoice(); - Pattern p = Pattern.compile(regex); - Matcher m = p.matcher(respondvoice); - while (m.find()) { -// System.out.println(m.group(0)); - String[] ds = m.group(0).split(","); - - String mpResult = ""; - - String dsName = ds[0]; - List mpResponds = this.speechRecognitionMpRespondService.selectListByWhere - ("where pid='" + speechRecognition.getId() + "' and pname='" + dsName + "' order by morder "); - - String speakType = ""; - int speakNum = 0; - String mp = ""; - if (!ds.equals("")&&ds.length > 0) { - if (ds.length > 1) { - speakType = ds[1]; - if (speakType.equals(SpeechRecognition.SpeakType_AnyNumber) && ds.length > 2) { - speakNum = Integer.valueOf(ds[2]); - } else if (speakType.equals(SpeechRecognition.SpeakType_All)) { - speakNum = mpResponds.size(); - } else if (speakType.equals(SpeechRecognition.SpeakType_One)) { - speakNum = 1; - } - } - - if (mpResponds != null && mpResponds.size() > 0) { - int speak_num = 0; - for (SpeechRecognitionMpRespond mpRespond : - mpResponds) { - mp = mpRespond.getMpid(); - MPoint mPoint = this.mPointService.selectById(mp); - - double jsvalue = mpRespond.getJsvalue()!=null?mpRespond.getJsvalue():0;//用于比较的值 - String jsMethod = mpRespond.getJsmethod()!=null?mpRespond.getJsmethod():"";//>,>=,=,<,<= - String valuemethod = mpRespond.getValuemethod()!=null?mpRespond.getValuemethod():"";//nowTime,sum,diff,avg,max,min,first,last//目前就nowTime - - if (valuemethod.equals("nowTime")) { - - } else { - String sdt = ""; - String edt = ""; - String whereString = ""; - List mpVlist = new ArrayList<>(); - if (valuemethod.equals("first")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt desc "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " top 1 * "); - } else if (valuemethod.equals("last")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " top 1 * "); - } else if (valuemethod.equals("diff")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " (max(ParmValue)-min(ParmValue)) as ParmValue "); - } else if (valuemethod.equals("avg")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " avg(ParmValue) as ParmValue "); - } else if (valuemethod.equals("min")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " min(ParmValue) as ParmValue "); - } else if (valuemethod.equals("max")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " max(ParmValue) as ParmValue "); - } else if (valuemethod.equals("sum")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mp, whereString, " sum(ParmValue) as ParmValue "); - } - - if (mpVlist != null && mpVlist.size() > 0) { - if (mpVlist.get(0) != null) { - mPoint.setParmvalue(mpVlist.get(0).getParmvalue()); - BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - } else { - - } - } - - } - - if (mPoint != null) { - double nowValue = Double.parseDouble(mPoint.getParmvalue().toString()); - - if (speakType.equals(SpeechRecognition.SpeakType_One)) { - if (jsMethod.equals(">") && nowValue > jsvalue) { - mpResult = mpRespond.getRespondtextTrue(); - speak_num++; - break; - } else if (jsMethod.equals(">=") && nowValue >= jsvalue) { - mpResult = mpRespond.getRespondtextTrue(); - speak_num++; - break; - } else if (jsMethod.equals("<") && nowValue < jsvalue) { - mpResult = mpRespond.getRespondtextTrue(); - speak_num++; - break; - } else if (jsMethod.equals("<=") && nowValue <= jsvalue) { - mpResult = mpRespond.getRespondtextTrue(); - speak_num++; - break; - } else if (jsMethod.equals("=") && nowValue == jsvalue) { - mpResult = mpRespond.getRespondtextTrue(); - speak_num++; - break; - } - } else if (speakType.equals(SpeechRecognition.SpeakType_All) || speakType.equals(SpeechRecognition.SpeakType_AnyNumber)) { - if (jsMethod.equals(">") && nowValue > jsvalue) { - speak_num++; - } else if (jsMethod.equals(">=") && nowValue >= jsvalue) { - speak_num++; - } else if (jsMethod.equals("<") && nowValue < jsvalue) { - speak_num++; - } else if (jsMethod.equals("<=") && nowValue <= jsvalue) { - speak_num++; - } else if (jsMethod.equals("=") && nowValue == jsvalue) { - speak_num++; - } - }else{ - if (mPoint != null) { - mpResult = mPoint.getParmvalue().toString(); - } - } - - } - } - - if (speakType.equals(SpeechRecognition.SpeakType_One) && speak_num == 0) { - mpResult = mpResponds.get(0).getRespondtextFalse(); - } else if (speakType.equals(SpeechRecognition.SpeakType_All) || speakType.equals(SpeechRecognition.SpeakType_AnyNumber)) { - if (speak_num >= speakNum) { - mpResult = mpResponds.get(0).getRespondtextTrue(); - } else { - mpResult = mpResponds.get(0).getRespondtextFalse(); - } - } - } else { - //直接给文本赋测量点当前值 - MPoint mPoint = this.mPointService.selectById(ds[0]); - if (mPoint != null) { - mpResult = mPoint.getParmvalue().toString(); - } - } - respondvoice = respondvoice.replace("{" + m.group(0) + "}", mpResult); - } - - speechRecognition.setRespondvoice(respondvoice); - } - } - } - System.out.println(list.get(0).getRespondvoice()); - } - - model.addAttribute("result", JSONArray.fromObject(list)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/WeatherNewController.java b/src/com/sipai/controller/work/WeatherNewController.java deleted file mode 100644 index 2c65c203..00000000 --- a/src/com/sipai/controller/work/WeatherNewController.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.controller.work; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.user.User; -import com.sipai.entity.work.WeatherNew; -import com.sipai.service.work.WeatherNewService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartRequest; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping("/work/weather") -public class WeatherNewController { - @Resource - private WeatherNewService weatherNewService; - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request,Model model){ - return "work/weatherNewList"; - } - - @RequestMapping("/getList.do") - public String getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - String insdt = request.getParameter("insdt"); - if(sort==null || sort.equals("id")){ - sort = " time "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr="where 1=1 "; - if(request.getParameter("search_code")!=null && !request.getParameter("search_code").isEmpty()){ - wherestr += " and bizid='"+request.getParameter("search_code")+"'"; - } - if(request.getParameter("bizid")!=null && !request.getParameter("bizid").isEmpty()){ - wherestr += " and bizid='"+request.getParameter("bizid")+"'"; - } - if(request.getParameter("time")!=null && !request.getParameter("time").isEmpty()){ - wherestr += " and time='"+request.getParameter("time")+"'"; - } - if(request.getParameter("type")!=null && !request.getParameter("type").isEmpty()){ - wherestr += " and type='"+request.getParameter("type")+"'"; - } - if (insdt != null && !insdt.equals("")) { - String[] str = insdt.split("~"); - wherestr += " and time between'" + str[0] + "'and'" + str[1] + "'"; - } - - PageHelper.startPage(page, rows); - List list = this.weatherNewService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return "result"; - } - - /** - * 导出 - */ - @RequestMapping(value = "/doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - //导出文件到指定目录,兼容Linux - this.weatherNewService.doExport(request, response); - return null; - } - - /** - * 导出模板 - */ - @RequestMapping(value = "/exportTemp.do") - public ModelAndView exportTemp(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - //导出文件到指定目录,兼容Linux - this.weatherNewService.exportTemp(request, response); - return null; - } - - /** - * 导入 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/saveExcelData.do") - public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false) - MultipartFile file, HttpServletRequest request, Model model) throws IOException { - MultipartRequest multipartRequest = (MultipartRequest) request; - MultipartFile excelFile = multipartRequest.getFile("filelist"); - - User cu = (User) request.getSession().getAttribute("cu"); - Map statusMap = new HashMap(); - - if (excelFile != null) { - String fileName = excelFile.getOriginalFilename(); - String type = fileName.substring(fileName.lastIndexOf(".") + 1); - //根据excel类型取数据 - if ("xls".equals(type) || "xlsx".equals(type)) { - String res = ("xls".equals(type)) ? weatherNewService.readXls(excelFile.getInputStream(), cu.getId()) : this.weatherNewService.readXlsx( excelFile.getInputStream(), cu.getId()); - statusMap.put("status", true); - statusMap.put("msg", res); - } else { - statusMap.put("status", false); - statusMap.put("msg", "请使用excel表格导入!"); - } - } else { - statusMap.put("status", false); - statusMap.put("msg", "未检测到导入文件!"); - } - - String result = JSONObject.fromObject(statusMap).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/import.do") - public String doimport(HttpServletRequest request, Model model) { - return "work/weatherImport"; - } - -} diff --git a/src/com/sipai/controller/work/WordAnalysisReportContentController.java b/src/com/sipai/controller/work/WordAnalysisReportContentController.java deleted file mode 100644 index b350d4f1..00000000 --- a/src/com/sipai/controller/work/WordAnalysisReportContentController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.WordAnalysisReportContent; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.work.WordAnalysisReportContentService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/wordAnalysisReportContent") -public class WordAnalysisReportContentController { - @Resource - private WordAnalysisReportContentService wordAnalysisReportContentService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr= " where 1=1 and pid='"+request.getParameter("pid")+"' "; - PageHelper.startPage(page, rows); - List list = this.wordAnalysisReportContentService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/wordAnalysisReportContentAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="wordAnalysisReportContent") WordAnalysisReportContent wordAnalysisReportContent){ - User cu= (User)request.getSession().getAttribute("cu"); - wordAnalysisReportContent.setId(CommUtil.getUUID()); - wordAnalysisReportContent.setInsdt(CommUtil.nowDate()); - wordAnalysisReportContent.setInsuser(cu.getId()); - - Result result = new Result(); - int code = this.wordAnalysisReportContentService.save(wordAnalysisReportContent); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - WordAnalysisReportContent wordAnalysisReportContent = this.wordAnalysisReportContentService.selectById(id); - model.addAttribute("wordAnalysisReportContent",wordAnalysisReportContent); - - return "work/wordAnalysisReportContentEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="wordAnalysisReportContent") WordAnalysisReportContent wordAnalysisReportContent){ - User cu= (User)request.getSession().getAttribute("cu"); - - wordAnalysisReportContent.setInsdt(CommUtil.nowDate()); - wordAnalysisReportContent.setInsuser(cu.getId()); - Result result = new Result(); - int code = this.wordAnalysisReportContentService.update(wordAnalysisReportContent); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.wordAnalysisReportContentService.deleteById(id); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.wordAnalysisReportContentService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/WordAnalysisReportContentCurveAxisController.java b/src/com/sipai/controller/work/WordAnalysisReportContentCurveAxisController.java deleted file mode 100644 index b2c3ebd3..00000000 --- a/src/com/sipai/controller/work/WordAnalysisReportContentCurveAxisController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.WordAnalysisReportContentCurveAxis; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.work.WordAnalysisReportContentCurveAxisService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/wordAnalysisReportContentCurveAxis") -public class WordAnalysisReportContentCurveAxisController { - @Resource - private WordAnalysisReportContentCurveAxisService wordAnalysisReportContentCurveAxisService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " num "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr= " where 1=1 and pid='"+request.getParameter("pid")+"' "; - PageHelper.startPage(page, rows); - List list = this.wordAnalysisReportContentCurveAxisService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/wordAnalysisReportContentCurveAxisAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="wordAnalysisReportContentCurveAxis") WordAnalysisReportContentCurveAxis wordAnalysisReportContentCurveAxis){ - User cu= (User)request.getSession().getAttribute("cu"); - wordAnalysisReportContentCurveAxis.setId(CommUtil.getUUID()); - - Result result = new Result(); - int code = this.wordAnalysisReportContentCurveAxisService.save(wordAnalysisReportContentCurveAxis); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - WordAnalysisReportContentCurveAxis wordAnalysisReportContentCurveAxis = this.wordAnalysisReportContentCurveAxisService.selectById(id); - model.addAttribute("wordAnalysisReportContentCurveAxis",wordAnalysisReportContentCurveAxis); - - return "work/wordAnalysisReportContentCurveAxisEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="wordAnalysisReportContentCurveAxis") WordAnalysisReportContentCurveAxis wordAnalysisReportContentCurveAxis){ - User cu= (User)request.getSession().getAttribute("cu"); - - Result result = new Result(); - int code = this.wordAnalysisReportContentCurveAxisService.update(wordAnalysisReportContentCurveAxis); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.wordAnalysisReportContentCurveAxisService.deleteById(id); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.wordAnalysisReportContentCurveAxisService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/WordAnalysisReportContentCurveController.java b/src/com/sipai/controller/work/WordAnalysisReportContentCurveController.java deleted file mode 100644 index 26b3a237..00000000 --- a/src/com/sipai/controller/work/WordAnalysisReportContentCurveController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.WordAnalysisReportContentCurve; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.work.WordAnalysisReportContentCurveService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/wordAnalysisReportContentCurve") -public class WordAnalysisReportContentCurveController { - @Resource - private WordAnalysisReportContentCurveService wordAnalysisReportContentCurveService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order){ - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null){ - sort = " morder "; - } - if(order==null){ - order = " asc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr= " where 1=1 and pid='"+request.getParameter("pid")+"' "; - PageHelper.startPage(page, rows); - List list = this.wordAnalysisReportContentCurveService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/wordAnalysisReportContentCurveAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value="wordAnalysisReportContentCurve") WordAnalysisReportContentCurve wordAnalysisReportContentCurve){ - User cu= (User)request.getSession().getAttribute("cu"); - wordAnalysisReportContentCurve.setId(CommUtil.getUUID()); - - Result result = new Result(); - int code = this.wordAnalysisReportContentCurveService.save(wordAnalysisReportContentCurve); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - WordAnalysisReportContentCurve wordAnalysisReportContentCurve = this.wordAnalysisReportContentCurveService.selectById(id); - model.addAttribute("wordAnalysisReportContentCurve",wordAnalysisReportContentCurve); - - return "work/wordAnalysisReportContentCurveEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="wordAnalysisReportContentCurve") WordAnalysisReportContentCurve wordAnalysisReportContentCurve){ - User cu= (User)request.getSession().getAttribute("cu"); - - Result result = new Result(); - int code = this.wordAnalysisReportContentCurveService.update(wordAnalysisReportContentCurve); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - int code = this.wordAnalysisReportContentCurveService.deleteById(id); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.wordAnalysisReportContentCurveService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/WordAnalysisReportContentFormController.java b/src/com/sipai/controller/work/WordAnalysisReportContentFormController.java deleted file mode 100644 index 6b95c299..00000000 --- a/src/com/sipai/controller/work/WordAnalysisReportContentFormController.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.sipai.controller.work; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.work.WordAnalysisReportContentForm; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.service.work.WordAnalysisReportContentFormService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/wordAnalysisReportContentForm") -public class WordAnalysisReportContentFormController { - @Resource - private WordAnalysisReportContentFormService wordAnalysisReportContentFormService; - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request,Model model){ - User cu=(User)request.getSession().getAttribute("cu"); - - String orderstr=""; - - String type=request.getParameter("type"); - if(type.equals(WordAnalysisReportContentForm.Type_row)){ - orderstr=" order by insertRow"; - }else if(type.equals(WordAnalysisReportContentForm.Type_column)){ - orderstr=" order by insertcolumn"; - } - - String wherestr= " where 1=1 and pid='"+request.getParameter("pid")+"' and type='"+type+"' "; - List list = this.wordAnalysisReportContentFormService.selectListByWhere(wherestr+orderstr); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"rows\":"+json+"}"; -// System.out.println(result); - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - return "work/wordAnalysisReportContentFormAdd"; - } - - @RequestMapping("/dosaveForcolumn.do") - public String dosaveForcolumn(HttpServletRequest request, Model model, - @ModelAttribute(value="wordAnalysisReportContentForm") WordAnalysisReportContentForm wordAnalysisReportContentForm){ - User cu= (User)request.getSession().getAttribute("cu"); - wordAnalysisReportContentForm.setId(CommUtil.getUUID()); - wordAnalysisReportContentForm.setType(WordAnalysisReportContentForm.Type_column); - wordAnalysisReportContentForm.setName("第"+wordAnalysisReportContentForm.getInsertcolumn()+"列"); - - Result result = new Result(); - int code = this.wordAnalysisReportContentFormService.save(wordAnalysisReportContentForm); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dosaveForRow.do") - public String dosaveForRow(HttpServletRequest request, Model model){ - User cu= (User)request.getSession().getAttribute("cu"); - - String pid=request.getParameter("pid"); - WordAnalysisReportContentForm wordAnalysisReportContentForm=new WordAnalysisReportContentForm(); - - wordAnalysisReportContentForm.setId(CommUtil.getUUID()); - List list = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='"+WordAnalysisReportContentForm.Type_row+"' " - + " and pid='"+pid+"' order by insertRow desc "); - - if(list!=null&&list.size()>0){ - int nowrow=list.get(0).getInsertrow(); - int changerow=nowrow+1; - wordAnalysisReportContentForm.setName("第"+changerow+"行"); - wordAnalysisReportContentForm.setInsertrow(changerow); - wordAnalysisReportContentForm.setPid(pid); - wordAnalysisReportContentForm.setType(WordAnalysisReportContentForm.Type_row); - }else{ - wordAnalysisReportContentForm.setName("第1行"); - wordAnalysisReportContentForm.setInsertrow(1); - wordAnalysisReportContentForm.setPid(pid); - wordAnalysisReportContentForm.setType(WordAnalysisReportContentForm.Type_row); - } - - Result result = new Result(); - int code = this.wordAnalysisReportContentFormService.save(wordAnalysisReportContentForm); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - WordAnalysisReportContentForm wordAnalysisReportContentForm = this.wordAnalysisReportContentFormService.selectById(id); - model.addAttribute("wordAnalysisReportContentForm",wordAnalysisReportContentForm); - - return "work/wordAnalysisReportContentFormEdit"; - } - - @RequestMapping("/doupdateForColumn.do") - public String doupdate(HttpServletRequest request,Model model, - @ModelAttribute(value="wordAnalysisReportContentForm") WordAnalysisReportContentForm wordAnalysisReportContentForm){ - User cu= (User)request.getSession().getAttribute("cu"); - - int changecolumn=wordAnalysisReportContentForm.getInsertcolumn(); - wordAnalysisReportContentForm.setName("第"+changecolumn+"列"); - - Result result = new Result(); - int code = this.wordAnalysisReportContentFormService.update(wordAnalysisReportContentForm); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelForColumn.do") - public String dodelForColumn(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - - WordAnalysisReportContentForm wForm=this.wordAnalysisReportContentFormService.selectById(id); - String pid=request.getParameter("pid"); - List list = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='"+WordAnalysisReportContentForm.Type_column+"' " - + " and pid='"+pid+"' and insertColumn>"+wForm.getInsertcolumn()+" order by insertColumn desc "); - - if(list!=null&&list.size()>0){ - for (int i = 0; i < list.size(); i++) { - WordAnalysisReportContentForm wForm2=list.get(i); - int changecolumn=wForm2.getInsertcolumn()-1; - wForm2.setName("第"+changecolumn+"列"); - wForm2.setInsertcolumn(changecolumn); - this.wordAnalysisReportContentFormService.update(wForm2); - } - } - - int code = this.wordAnalysisReportContentFormService.deleteById(id); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodelForRow.do") - public String dodelForRow(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - Result result = new Result(); - - List list2 = this.wordAnalysisReportContentFormService.selectListByWhere(" where " - + " pid='"+id+"' "); - if(list2!=null&&list2.size()>0){ - result = Result.failed("删除失败,信息被占用"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - WordAnalysisReportContentForm wForm=this.wordAnalysisReportContentFormService.selectById(id); - - String pid=request.getParameter("pid"); - List list = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='"+WordAnalysisReportContentForm.Type_row+"' " - + " and pid='"+pid+"' and insertRow>"+wForm.getInsertrow()+" order by insertRow desc "); - - if(list!=null&&list.size()>0){ - for (int i = 0; i < list.size(); i++) { - WordAnalysisReportContentForm wForm2=list.get(i); - int changerow=wForm2.getInsertrow()-1; - wForm2.setName("第"+changerow+"行"); - wForm2.setInsertrow(wForm2.getInsertrow()-1); - this.wordAnalysisReportContentFormService.update(wForm2); - } - } - int code = this.wordAnalysisReportContentFormService.deleteById(id); - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int result = this.wordAnalysisReportContentFormService.deleteByWhere("where id in ('"+ids+"')"); - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/WordAnalysisReportRecordController.java b/src/com/sipai/controller/work/WordAnalysisReportRecordController.java deleted file mode 100644 index 45a47883..00000000 --- a/src/com/sipai/controller/work/WordAnalysisReportRecordController.java +++ /dev/null @@ -1,525 +0,0 @@ -package com.sipai.controller.work; - -import java.io.File; -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.user.Unit; -import com.sipai.service.user.UnitService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.itextpdf.text.log.SysoCounter; -import com.sipai.entity.work.WordAnalysisReportContent; -import com.sipai.entity.work.WordAnalysisReportContentCurve; -import com.sipai.entity.work.WordAnalysisReportContentForm; -import com.sipai.entity.work.WordAnalysisReportFormData; -import com.sipai.entity.work.WordAnalysisReportRecord; -import com.sipai.entity.work.WordAnalysisReportStructure; -import com.sipai.entity.work.WordAnalysisReportText; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.work.WordAnalysisReportContentFormService; -import com.sipai.service.work.WordAnalysisReportContentService; -import com.sipai.service.work.WordAnalysisReportFormDataService; -import com.sipai.service.work.WordAnalysisReportRecordService; -import com.sipai.service.work.WordAnalysisReportStructureService; -import com.sipai.service.work.WordAnalysisReportTextService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/work/wordAnalysisReportRecord") -public class WordAnalysisReportRecordController { - @Resource - private WordAnalysisReportRecordService wordAnalysisReportRecordService; - @Resource - private WordAnalysisReportStructureService wordAnalysisReportStructureService; - @Resource - private WordAnalysisReportContentFormService wordAnalysisReportContentFormService; - @Resource - private WordAnalysisReportFormDataService wordAnalysisReportFormDataService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private WordAnalysisReportContentService wordAnalysisReportContentService; - @Resource - private WordAnalysisReportTextService wordAnalysisReportTextService; - @Resource - private UnitService unitService; - - @RequestMapping("/showMange.do") - public String showMange(HttpServletRequest request, Model model) { - return "work/wordAnalysisReportRecordMange"; - } - - @RequestMapping("/showList.do") - public String showList(HttpServletRequest request, Model model) { - return "work/wordAnalysisReportRecordList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " sdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = " where 1=1 and pid='" + request.getParameter("pid") + "' "; - PageHelper.startPage(page, rows); - List list = this.wordAnalysisReportRecordService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; -// System.out.println(result); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getTreeJson.do") - public String getTreeJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and unitId='" + unitId + "' " - + " and type='" + WordAnalysisReportStructure.Type_word + "' " - + " order by type,morder"); - - String json = this.wordAnalysisReportStructureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String unitId = request.getParameter("unitId"); - Unit unit = this.unitService.getUnitById(unitId); - if (unit != null) { - if (unit.getSname() != null) { - model.addAttribute("unitName", unit.getSname()); - } else { - model.addAttribute("unitName", unit.getName()); - } - } - WordAnalysisReportStructure wordAnalysisReportStructure = this.wordAnalysisReportStructureService.selectById(request.getParameter("pid")); - model.addAttribute("reportName", wordAnalysisReportStructure.getName()); - return "work/wordAnalysisReportRecordAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value = "wordAnalysisReportRecord") WordAnalysisReportRecord wordAnalysisReportRecord) throws ScriptException { - User cu = (User) request.getSession().getAttribute("cu"); - String dt = wordAnalysisReportRecord.getSdt() + "-01"; - - wordAnalysisReportRecord.setId(CommUtil.getUUID()); - wordAnalysisReportRecord.setSdt(dt); - - Result result = new Result(); - - List wlist = this.wordAnalysisReportRecordService.selectListByWhere("where 1=1 " - + " and pid='" + wordAnalysisReportRecord.getPid() + "' and name='" + wordAnalysisReportRecord.getName() + "' "); - - if (wlist != null && wlist.size() > 0) { - result = Result.failed("名称不能重复"); - } else { - - int code = this.wordAnalysisReportRecordService.save(wordAnalysisReportRecord); - - WordAnalysisReportStructure wStructure = this.wordAnalysisReportStructureService.selectById(wordAnalysisReportRecord.getPid()); - String unitId = wStructure.getUnitid(); - - String starDay = wStructure.getStartday(); - String endDay = wStructure.getEndday(); - String starthour = wStructure.getStarthour(); - - String sdt = ""; - String edt = ""; - if (starDay.equals("1") || starDay.equals("01")) { - sdt = dt.substring(0, 7) + "-01 " + starthour + ":00"; - } else { - sdt = CommUtil.subplus(dt.substring(0, 7) + "-" + starDay, "-1", "month").substring(0, 10) + " " + starthour + ":00"; - } - if (endDay.equals("-")) { -// int maxDay = CommUtil.getDaysByYearMonth(Integer.valueOf(dt.substring(0, 4)), Integer.valueOf(dt.substring(5, 7))); - edt= CommUtil.subplus(sdt, "1", "month"); -// edt = dt.substring(0, 7) + "-" + maxDay + " " + starthour + ":00"; - } else { - edt = dt.substring(0, 7) + "-" + endDay + " " + starthour + ":00"; - } - -// System.out.println(sdt); -// System.out.println(edt); - - String sydt = ""; - String eydt = ""; - if (starDay.equals("1") || starDay.equals("01")) { - sydt = dt.substring(0, 4) + "-01-01 " + starthour + ":00"; - } else { - sydt = CommUtil.subplus(dt.substring(0, 4) + "-01-" + starDay, "-1", "month").substring(0, 10) + " " + starthour + ":00"; - } - if (endDay.equals("-")) { -// int maxMDay = CommUtil.getDaysByYearMonth(Integer.valueOf(dt.substring(0, 4)), Integer.valueOf(dt.substring(5, 7))); - eydt= CommUtil.subplus(sydt, "1", "year"); -// eydt = dt.substring(0, 8) + maxMDay + starthour + ":00"; - } else { - eydt = dt.substring(0, 8) + endDay + " " + starthour + ":00"; - } -// String sydt=dt.substring(0,4)+"-01-01"+" "+starthour+":00"; -// String eydt=CommUtil.subplus(sydt, "1", "year").substring(0,4)+"-01-01"+" "+starthour+":00"; - - -// System.out.println(sydt); -// System.out.println(eydt); - //文本缓存数据 - String textids = this.wordAnalysisReportStructureService.getTextIds(wordAnalysisReportRecord.getPid(), ""); - String[] textidss = textids.split(","); - if (textidss != null && textidss.length > 0) { - for (int i = 0; i < textidss.length; i++) { - String textId = textidss[i]; - WordAnalysisReportContent wReportContent = this.wordAnalysisReportContentService.selectById(textId); - if (wReportContent != null) { - String textContent = wReportContent.getTextcontent(); - textContent = this.wordAnalysisReportStructureService.calculation(textContent, dt); - - WordAnalysisReportText wReportText = new WordAnalysisReportText(); - wReportText.setId(CommUtil.getUUID()); - wReportText.setPid(wordAnalysisReportRecord.getId()); - wReportText.setModeformld(wReportContent.getId()); - wReportText.setText(textContent); - this.wordAnalysisReportTextService.save(wReportText); - } - } - } - - //报表缓存数据 - String formids = this.wordAnalysisReportStructureService.getFormIds(wordAnalysisReportRecord.getPid(), ""); - // System.out.println(formids); - String[] formidss = formids.split(","); - if (formidss != null && formidss.length > 0) { - for (int i = 0; i < formidss.length; i++) { - String formId = formidss[i]; - List rowlist = this.wordAnalysisReportContentFormService.selectListByWhere(" where" - + " pid='" + formId + "' "); - if (rowlist != null && rowlist.size() > 0) { - for (int j = 0; j < rowlist.size(); j++) { - List columnlist = this.wordAnalysisReportContentFormService.selectListByWhere(" where" - + " pid='" + rowlist.get(j).getId() + "' "); - if (columnlist != null && columnlist.size() > 0) { - for (int k = 0; k < columnlist.size(); k++) { - String mpid = columnlist.get(k).getMpid(); - String valueRange = columnlist.get(k).getValuerange(); - if (mpid != null && mpid.length() > 0) { - String cal = columnlist.get(k).getCalculationmethod(); - String unitconversion = columnlist.get(k).getUnitconversion(); - - String selectString = ""; - String whereString = ""; - String orderString = ""; - - WordAnalysisReportFormData wReportFormData = new WordAnalysisReportFormData(); - wReportFormData.setId(CommUtil.getUUID()); - wReportFormData.setMpid(mpid); - wReportFormData.setPid(wordAnalysisReportRecord.getId()); - wReportFormData.setModeformld(columnlist.get(k).getId()); - - if (cal.equals("first")) { - selectString = " top 1 * "; - orderString = " order by MeasureDT desc"; - } else if (cal.equals("sum")) { - selectString = " sum(ParmValue) as ParmValue "; - } else if (cal.equals("avg")) { - selectString = " avg(ParmValue) as ParmValue "; - } else if (cal.equals("max")) { - selectString = " max(ParmValue) as ParmValue "; - } else if (cal.equals("min")) { - selectString = " min(ParmValue) as ParmValue "; - } else if (cal.equals("diff")) { - selectString = " (max(ParmValue)-min(ParmValue)) as ParmValue "; - } - - if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_chainComparison)) { - List blist1 = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, " where (MeasureDT between '" + sdt + "' and '" + edt + "') and ParmValue>-9999 " + orderString, selectString); - - List blist2 = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, " where (MeasureDT between '" + CommUtil.subplus(sdt, "-1", "month").substring(0, 10) + " " + starthour + ":00" + "' and '" + CommUtil.subplus(edt, "-1", "month").substring(0,10) + " " + starthour + ":00" + "') and ParmValue>-9999 " + orderString, selectString); - double v1 = 0; - double v2 = 0; - if (blist1 != null && blist1.size() > 0) { - if (blist1.get(0) != null) { - v1 = blist1.get(0).getParmvalue().doubleValue(); - } - } - if (blist2 != null && blist2.size() > 0) { - if (blist2.get(0) != null) { - v2 = blist2.get(0).getParmvalue().doubleValue(); - } - } - double v = 0; - if (v2 != 0) { - v = (v1 - v2) / v2 * 100; - } - String sv = new java.text.DecimalFormat("0.00").format(v); - wReportFormData.setValue(Double.valueOf(sv)); - - } else if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_yearOnYear)) { - List blist1 = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, " where (MeasureDT between '" + sdt + "' and '" + edt + "') and ParmValue>-9999 " + orderString, selectString); - - List blist2 = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, " where (MeasureDT between '" + CommUtil.subplus(sdt, "-1", "year") + "' and '" + CommUtil.subplus(edt, "-1", "year") + "') and ParmValue>-9999 " + orderString, selectString); - double v1 = 0; - double v2 = 0; - if (blist1 != null && blist1.size() > 0) { - if (blist1.get(0) != null) { - v1 = blist1.get(0).getParmvalue().doubleValue(); - } - } - if (blist2 != null && blist2.size() > 0) { - if (blist2.get(0) != null) { - v2 = blist2.get(0).getParmvalue().doubleValue(); - } - } - double v = 0; - if (v2 != 0) { - v = (v1 - v2) / v2 * 100; - } - String sv = new java.text.DecimalFormat("0.00").format(v); - wReportFormData.setValue(Double.valueOf(sv)); - - } else if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_yearOnYear_year)) { - List blist1 = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, " where (MeasureDT between '" + sydt + "' and '" + eydt + "') and ParmValue>-9999 " + orderString, selectString); - - List blist2 = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, " where (MeasureDT between '" + CommUtil.subplus(sdt, "-1", "year").substring(0, 10) + " " + starthour + ":00" + "' and '" + CommUtil.subplus(edt, "-1", "year").substring(0, 10) + " " + starthour + ":00" + "') and ParmValue>-9999 " + orderString, selectString); - double v1 = 0; - double v2 = 0; - if (blist1 != null && blist1.size() > 0) { - if (blist1.get(0) != null) { - v1 = blist1.get(0).getParmvalue().doubleValue(); - } - } - if (blist2 != null && blist2.size() > 0) { - if (blist2.get(0) != null) { - v2 = blist2.get(0).getParmvalue().doubleValue(); - } - } - double v = 0; - if (v2 != 0) { - v = (v1 - v2) / v2 * 100; - } - String sv = new java.text.DecimalFormat("0.00").format(v); - wReportFormData.setValue(Double.valueOf(sv)); - - } else { - if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_nowMonth)) { - whereString = " where (MeasureDT between '" + sdt + "' and '" + edt + "') and ParmValue>-9999 "; - } else if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_lastMonth)) { - whereString = " where (MeasureDT between '" + CommUtil.subplus(sdt, "-1", "month").substring(0, 10) + " " + starthour + ":00" + "' and '" + CommUtil.subplus(edt, "-1", "month").substring(0,10) + " " + starthour + ":00" + "') and ParmValue>-9999 "; - } else if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_nowYear)) { - whereString = " where (MeasureDT between '" + sydt + "' and '" + eydt + "') and ParmValue>-9999 "; - } else if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_lastYear)) { - whereString = " where (MeasureDT between '" + CommUtil.subplus(sydt, "-1", "year").substring(0, 10) + " " + starthour + ":00" + "' and '" + CommUtil.subplus(eydt, "-1", "year").substring(0, 4) + "-12-31" + " " + starthour + ":00" + "') and ParmValue>-9999 "; - } else if (valueRange.equals(WordAnalysisReportContentForm.ValueRange_lastYearToMonth)) { - whereString = " where (MeasureDT between '" + CommUtil.subplus(sdt, "-1", "year").substring(0, 10) + " " + starthour + ":00" + "' and '" + CommUtil.subplus(edt, "-1", "year").substring(0, 10) + " " + starthour + ":00" + "') and ParmValue>-9999 "; - } - - List blist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString + orderString, selectString); - - if (blist != null && blist.size() > 0) { - if (blist.get(0) != null) { - double value = 0; - if (unitconversion != null && unitconversion.length() > 0) { - ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); - Object parmValueD = jse.eval(String.valueOf(blist.get(0).getParmvalue().doubleValue()) + unitconversion); - value = ((Number) parmValueD).doubleValue(); - wReportFormData.setValue(blist.get(0).getParmvalue().doubleValue()); - } else { - value = blist.get(0).getParmvalue().doubleValue(); - } - wReportFormData.setValue(value); - } else { - wReportFormData.setValue(0.0); - } - } else { - wReportFormData.setValue(0.0); - } - } - - this.wordAnalysisReportFormDataService.save(wReportFormData); - } else if (columnlist.get(k).getShowtextst() != null && columnlist.get(k).getShowtextst().length() > 0) { - if (columnlist.get(k).getShowtextst().equals(WordAnalysisReportContentForm.Showtextst_TRUE)) { - WordAnalysisReportFormData wReportFormData = new WordAnalysisReportFormData(); - wReportFormData.setId(CommUtil.getUUID()); - wReportFormData.setPid(wordAnalysisReportRecord.getId()); - wReportFormData.setModeformld(columnlist.get(k).getId()); - wReportFormData.setShowtext(columnlist.get(k).getShowtext()); - this.wordAnalysisReportFormDataService.save(wReportFormData); - } - } - } - } - - } - } - } - } - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - } - - JSONArray mainjson = new JSONArray(); - mainjson.add(result); - mainjson.add(wordAnalysisReportRecord.getId()); - mainjson.add(wordAnalysisReportRecord.getPid()); - mainjson.add(wordAnalysisReportRecord.getName()); - model.addAttribute("result", mainjson); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WordAnalysisReportRecord wordAnalysisReportRecord = this.wordAnalysisReportRecordService.selectById(id); - model.addAttribute("wordAnalysisReportRecord", wordAnalysisReportRecord); - - return "work/wordAnalysisReportRecordEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute(value = "wordAnalysisReportRecord") WordAnalysisReportRecord wordAnalysisReportRecord) { - User cu = (User) request.getSession().getAttribute("cu"); - - Result result = new Result(); - int code = this.wordAnalysisReportRecordService.update(wordAnalysisReportRecord); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String fileName = request.getParameter("fileName"); - String url = System.getProperty("catalina.home") + "/webapps/UploadFile/wordAnalysisReport/" + fileName + ".docx"; - - Result result = new Result(); - int code = this.wordAnalysisReportRecordService.deleteById(id); - - this.wordAnalysisReportFormDataService.deleteByWhere(" where pid='" + id + "' "); - this.wordAnalysisReportTextService.deleteByWhere(" where pid='" + id + "' "); - - File file = new File(url); - if (file.exists()) { - file.delete(); - } - - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.wordAnalysisReportRecordService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/changeRecordFormValue.do") - public String changeRecordValue(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "value") String value) { - WordAnalysisReportFormData wReportFormData = this.wordAnalysisReportFormDataService.selectById(id); - wReportFormData.setValue(Double.valueOf(value)); - - Result result = new Result(); - int code = this.wordAnalysisReportFormDataService.update(wReportFormData); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/changeRecordFormText.do") - public String changeRecordFormText(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "value") String value) { - WordAnalysisReportFormData wReportFormData = this.wordAnalysisReportFormDataService.selectById(id); - wReportFormData.setShowtext(value); - - Result result = new Result(); - int code = this.wordAnalysisReportFormDataService.update(wReportFormData); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/changeRecordTextValue.do") - public String changeRecordTextValue(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "value") String value) { - - WordAnalysisReportText wReportText = this.wordAnalysisReportTextService.selectById(id); - wReportText.setText(value); - - Result result = new Result(); - int code = this.wordAnalysisReportTextService.update(wReportText); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - -} diff --git a/src/com/sipai/controller/work/WordAnalysisReportStructureController.java b/src/com/sipai/controller/work/WordAnalysisReportStructureController.java deleted file mode 100644 index 6a15b903..00000000 --- a/src/com/sipai/controller/work/WordAnalysisReportStructureController.java +++ /dev/null @@ -1,761 +0,0 @@ -package com.sipai.controller.work; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.text.DecimalFormat; -import java.util.List; - -import javax.annotation.Resource; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.servlet.ServletInputStream; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.work.*; -import com.sipai.service.work.*; -import net.sf.json.JSONArray; - -import org.apache.poi.xwpf.usermodel.BreakType; -import org.apache.poi.xwpf.usermodel.ParagraphAlignment; -import org.apache.poi.xwpf.usermodel.XWPFDocument; -import org.apache.poi.xwpf.usermodel.XWPFParagraph; -import org.apache.poi.xwpf.usermodel.XWPFRun; -import org.apache.poi.xwpf.usermodel.XWPFTable; -import org.apache.poi.xwpf.usermodel.XWPFTableRow; -import org.apache.xmlbeans.XmlException; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.itextpdf.text.log.SysoCounter; -import com.sipai.controller.base.PoiUtils; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import sun.misc.BASE64Decoder; -import sun.misc.BASE64Encoder; - -@SuppressWarnings({"restriction", "unused"}) -@Controller -@RequestMapping("/work/wordAnalysisReportStructure") -public class WordAnalysisReportStructureController { - @Resource - private WordAnalysisReportStructureService wordAnalysisReportStructureService; - @Resource - private WordAnalysisReportContentService wordAnalysisReportContentService; - @Resource - private WordAnalysisReportContentCurveService wordAnalysisReportContentCurveService; - @Resource - private WordAnalysisReportRecordService wordAnalysisReportRecordService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointService mPointService; - @Resource - private WordAnalysisReportContentCurveAxisService wordAnalysisReportContentCurveAxisService; - @Resource - private WordAnalysisReportFormDataService wordAnalysisReportFormDataService; - - - static ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); - - @RequestMapping("/showManage.do") - public String showPatrolPointEquipmentTree(HttpServletRequest request, Model model) { - return "work/wordAnalysisReportStructureManage"; - } - - @RequestMapping("/showTree.do") - public String showTree(HttpServletRequest request, Model model) { - - return "work/wordAnalysisReportStructureTree"; - } - - @RequestMapping("/getJson.do") - public String getJson(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String unitId = request.getParameter("unitId"); - List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and unitId='" + unitId + "' " - + " " - + " order by type,morder"); - - String json = this.wordAnalysisReportStructureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - if (pid != null && !pid.equals("") && !pid.equals("-1")) { - WordAnalysisReportStructure wordAnalysisReportStructure = this.wordAnalysisReportStructureService.selectById(pid); - model.addAttribute("pname", wordAnalysisReportStructure.getName()); - } else { - model.addAttribute("pname", "-1"); - } - return "work/wordAnalysisReportStructureAdd"; - } - - @RequestMapping("/dosave.do") - public String dosave(HttpServletRequest request, Model model, - @ModelAttribute(value = "wordAnalysisReportStructure") WordAnalysisReportStructure wordAnalysisReportStructure) { - User cu = (User) request.getSession().getAttribute("cu"); - wordAnalysisReportStructure.setId(CommUtil.getUUID()); - wordAnalysisReportStructure.setInsdt(CommUtil.nowDate()); - wordAnalysisReportStructure.setInsuser(cu.getId()); - wordAnalysisReportStructure.setUnitid(request.getParameter("unitId")); - - Result result = new Result(); - if (wordAnalysisReportStructure.getPid().equals("-1")) { - if (!wordAnalysisReportStructure.getType().equals(WordAnalysisReportStructure.Type_word)) { - result = Result.failed("必须先添加文本"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - } -// if(wordAnalysisReportStructure.getType().equals(WordAnalysisReportStructure.Type_title)){ -// List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and unitId='"+wordAnalysisReportStructure.getUnitid()+"' and type='"+WordAnalysisReportStructure.Type_title+"' "); -// if(list.size()>0){ -// result = Result.failed("无法再添加标题"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } -// } -// if(wordAnalysisReportStructure.getType().equals(WordAnalysisReportStructure.Type_subtitle)){ -// List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and unitId='"+wordAnalysisReportStructure.getUnitid()+"' and type='"+WordAnalysisReportStructure.Type_subtitle+"' "); -// if(list.size()>0){ -// result = Result.failed("无法再添加副标题"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } -// } - - int code = this.wordAnalysisReportStructureService.save(wordAnalysisReportStructure); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("新增失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WordAnalysisReportStructure wordAnalysisReportStructure = this.wordAnalysisReportStructureService.selectById(id); - model.addAttribute("wordAnalysisReportStructure", wordAnalysisReportStructure); - - if (!wordAnalysisReportStructure.getPid().equals("-1")) { - WordAnalysisReportStructure pname = this.wordAnalysisReportStructureService.selectById(wordAnalysisReportStructure.getPid()); - model.addAttribute("pname", pname.getName()); - } else { - model.addAttribute("pname", "-1"); - } - - return "work/wordAnalysisReportStructureEdit"; - } - - @RequestMapping("/doupdate.do") - public String doupdate(HttpServletRequest request, Model model, - @ModelAttribute(value = "wordAnalysisReportStructure") WordAnalysisReportStructure wordAnalysisReportStructure) { - User cu = (User) request.getSession().getAttribute("cu"); - - wordAnalysisReportStructure.setInsdt(CommUtil.nowDate()); - wordAnalysisReportStructure.setInsuser(cu.getId()); - Result result = new Result(); - if (wordAnalysisReportStructure.getPid().equals("-1")) { - if (!wordAnalysisReportStructure.getType().equals(WordAnalysisReportStructure.Type_word)) { - result = Result.failed("必须先添加文本"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - } -// if(wordAnalysisReportStructure.getType().equals(WordAnalysisReportStructure.Type_title)){ -// List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and id!='"+wordAnalysisReportStructure.getId()+"' and unitId='"+wordAnalysisReportStructure.getUnitid()+"' and type='"+WordAnalysisReportStructure.Type_title+"' "); -// if(list.size()>0){ -// result = Result.failed("无法再添加标题"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } -// } -// if(wordAnalysisReportStructure.getType().equals(WordAnalysisReportStructure.Type_subtitle)){ -// List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and id!='"+wordAnalysisReportStructure.getId()+"' and unitId='"+wordAnalysisReportStructure.getUnitid()+"' and type='"+WordAnalysisReportStructure.Type_subtitle+"' "); -// if(list.size()>0){ -// result = Result.failed("无法再添加副标题"); -// model.addAttribute("result", CommUtil.toJson(result)); -// return "result"; -// } -// } - int code = this.wordAnalysisReportStructureService.update(wordAnalysisReportStructure); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("更新失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodel.do") - public String dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - List list = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and pid='" + id + "' "); - Result result = new Result(); - if (list != null && list.size() > 0) { - result = Result.failed("删除失败,信息被占用"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - int code = this.wordAnalysisReportStructureService.deleteById(id); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int result = this.wordAnalysisReportStructureService.deleteByWhere("where id in ('" + ids + "')"); - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/outWordView.do") - public String outWordView(HttpServletRequest request, Model model) { - - return "work/wordAnalysisReportOutView"; - } - - @RequestMapping("/outWordEdit.do") - public String outWordEdit(HttpServletRequest request, Model model) { - - return "work/wordAnalysisReportOutEdit"; - } - - @RequestMapping("/outWordStructureView.do") - public String outWordStructureView(HttpServletRequest request, Model model) { - - return "work/wordAnalysisReportOutStructureView"; - } - - @RequestMapping("/getOutWordViewJson.do") - public String getOutWordViewJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - String ids = this.wordAnalysisReportStructureService.getTreeIds(pid, ""); - List list = this.wordAnalysisReportStructureService.selectListByWhere("where id in ('" + ids.replace(",", "','") + "') " - + " order by type,morder"); - - String json = this.wordAnalysisReportStructureService.getTreeList(null, list); - model.addAttribute("result", json); - return "result"; - } - - @RequestMapping("/getOutWordViewForCurveJson.do") - public String getOutWordViewForCurveJson(HttpServletRequest request, Model model) { - String pid = request.getParameter("pid"); - WordAnalysisReportStructure wStructure = this.wordAnalysisReportStructureService.selectById(pid); - String unitId = wStructure.getUnitid(); - String ids = this.wordAnalysisReportStructureService.getCurveIds(pid, ""); - - com.alibaba.fastjson.JSONObject Object = new com.alibaba.fastjson.JSONObject(); - - Object.put("unitId", unitId); - Object.put("ids", ids); - - model.addAttribute("result", Object); - return "result"; - } - - @RequestMapping("/outWord.do") - public String outWorld(HttpServletRequest request, Model model) throws IOException, XmlException { - String rid = request.getParameter("rid");//记录id - String pid = request.getParameter("pid");//word分析id - String wordName = request.getParameter("wordName");//word分析id - - WordAnalysisReportRecord wordAnalysisReportRecord = this.wordAnalysisReportRecordService.selectById(rid); - - - String sdt = wordAnalysisReportRecord.getSdt(); - String edt = wordAnalysisReportRecord.getEdt(); - - - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String imgpath = filepathSever.replaceAll(contextPath, "UploadFile" + "/wordAnalysisReport/curve/"); - String wordpath = filepathSever.replaceAll(contextPath, "UploadFile" + "/wordAnalysisReport"); - - List wordlist = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 and unitId='" + request.getParameter("unitId") + "' " - + " and type='" + WordAnalysisReportStructure.Type_word + "' and id='" + pid + "' " - + " order by morder"); - - if (wordlist != null && wordlist.size() > 0) { - for (int m = 0; m < wordlist.size(); m++) { - XWPFDocument document = new XWPFDocument(); - String outputFile = wordpath + "/" + wordName + ".docx"; - FileOutputStream out = new FileOutputStream(new File(outputFile)); - try { - - List contentList = this.wordAnalysisReportStructureService.selectListByWhere("where 1=1 " - + " and pid='" + wordlist.get(m).getId() + "' " - + " order by type,morder"); - - if (contentList != null && contentList.size() > 0) { - for (int i = 0; i < contentList.size(); i++) { - if (contentList.get(i).getType().equals(WordAnalysisReportStructure.Type_title)) { - //添加标题 - XWPFParagraph titleParagraph = document.createParagraph(); - //设置段落居中 - titleParagraph.setAlignment(ParagraphAlignment.CENTER); - PoiUtils.addCustomHeadingStyle(document, "标题", 1); - // 样式 - titleParagraph.setStyle("标题"); - - XWPFRun titleParagraphRun = titleParagraph.createRun(); - - String name = contentList.get(i).getName(); - name = wordAnalysisReportStructureService.calculation(name, sdt); - titleParagraphRun.setText(name); - titleParagraphRun.setColor("000000"); - titleParagraphRun.setFontFamily("等线"); - // titleParagraphRun.addBreak(BreakType.PAGE); //分页 - titleParagraphRun.setFontSize(18); - if (contentList.size() == 1) { - titleParagraphRun.addBreak(BreakType.TEXT_WRAPPING);//换行 - } - - } else if (contentList.get(i).getType().equals(WordAnalysisReportStructure.Type_paragraph)) { - int paragraphLevelNum = 1; - //添加段落 - XWPFParagraph titleParagraph = document.createParagraph(); - //设置段落居中 - titleParagraph.setAlignment(ParagraphAlignment.LEFT); - if (titleParagraph.getStyle() == null) { - PoiUtils.addCustomHeadingStyle(document, "标题样式1", 1); - } - // 样式 - titleParagraph.setStyle("标题样式1"); - - XWPFRun titleParagraphRun = titleParagraph.createRun(); - titleParagraphRun.setText(contentList.get(i).getName()); - titleParagraphRun.setFontFamily("等线"); - titleParagraphRun.setColor("000000"); - titleParagraphRun.setFontSize(14); - - this.wordAnalysisReportStructureService.getParagraphs(contentList.get(i).getId(), document, paragraphLevelNum, sdt, edt, contentList.get(i).getUnitid(), imgpath, rid); - } - } - } - - // //添加页眉 - // CTP ctpHeader = CTP.Factory.newInstance(); - // CTR ctrHeader = ctpHeader.addNewR(); - // CTText ctHeader = ctrHeader.addNewT(); - // String headerText = "Java POI create MS word file."; - // ctHeader.setStringValue(headerText); - // XWPFParagraph headerParagraph = new XWPFParagraph(ctpHeader, document); - // //设置为右对齐 - // headerParagraph.setAlignment(ParagraphAlignment.RIGHT); - // XWPFParagraph[] parsHeader = new XWPFParagraph[1]; - // parsHeader[0] = headerParagraph; - // policy.createHeader(XWPFHeaderFooterPolicy.DEFAULT, parsHeader); - // - // //添加页脚 - // CTP ctpFooter = CTP.Factory.newInstance(); - // CTR ctrFooter = ctpFooter.addNewR(); - // CTText ctFooter = ctrFooter.addNewT(); - // String footerText = "http:www.gongyoumishu.com/"; - // ctFooter.setStringValue(footerText); - // XWPFParagraph footerParagraph = new XWPFParagraph(ctpFooter, document); - // headerParagraph.setAlignment(ParagraphAlignment.CENTER); - // XWPFParagraph[] parsFooter = new XWPFParagraph[1]; - // parsFooter[0] = footerParagraph; - // policy.createFooter(XWPFHeaderFooterPolicy.DEFAULT, parsFooter); - - document.write(out); - out.close(); - System.out.println(CommUtil.nowDate() + "world分析生成成功"); - model.addAttribute("result", "生成成功"); - return "result"; - } catch (Exception e) { - out.close(); - System.out.println(CommUtil.nowDate() + "world分析生成失败"); - model.addAttribute("result", "生成失败"); - return "result"; - } - } - } - return "result"; - } - - @RequestMapping("/getOutWordViewContentJson.do") - public String getOutWordViewContentJson(HttpServletRequest request, Model model) throws ScriptException { - String result = ""; - String id = request.getParameter("id"); - String rid = request.getParameter("rid"); - String view = "0"; - - String sdt = ""; - String edt = ""; - if (request.getParameter("view") != null) { - view = request.getParameter("view"); - WordAnalysisReportRecord wordAnalysisReportRecord = this.wordAnalysisReportRecordService.selectById(rid); - sdt = wordAnalysisReportRecord.getSdt(); - edt = wordAnalysisReportRecord.getEdt(); - } else { - sdt = CommUtil.nowDate(); - edt = CommUtil.nowDate(); - } - - WordAnalysisReportStructure wStructure = this.wordAnalysisReportStructureService.selectById(id); - - if (wStructure != null) { - if (wStructure.getType().equals(WordAnalysisReportStructure.Type_title)) { - String text = this.wordAnalysisReportStructureService.calculation(wStructure.getName(), sdt); - result += "

" + text + "
"; - } else if (wStructure.getType().equals(WordAnalysisReportStructure.Type_paragraph)) { - String text = this.wordAnalysisReportStructureService.calculation(wStructure.getName(), sdt); - result += "
" + text + "
"; - int paragraphLevelNum = 1; - result = this.wordAnalysisReportStructureService.getParagraphsForView(result, wStructure.getId(), paragraphLevelNum, sdt, edt, wStructure.getUnitid(), rid, view); - } - } - model.addAttribute("result", result); - return "result"; - } - - @RequestMapping("/getOutWordViewContentForCurveDataJson.do") - public String getOutWordViewContentForCurveDataJson(HttpServletRequest request, Model model) throws ScriptException { - JSONArray mainjson = new JSONArray(); - - String id = request.getParameter("id"); - String unitId = request.getParameter("unitId"); - String rid = request.getParameter("rid");//记录id - - WordAnalysisReportStructure wStructure = this.wordAnalysisReportStructureService.selectById(request.getParameter("worldId")); - String dt = ""; - if (rid != null && rid.length() > 0) { - WordAnalysisReportRecord wordAnalysisReportRecord = this.wordAnalysisReportRecordService.selectById(rid); - dt = wordAnalysisReportRecord.getSdt(); - } else { - dt = CommUtil.nowDate(); - } - String sdt = ""; - String edt = ""; - String starDay = wStructure.getStartday(); - String endDay = wStructure.getEndday(); - - if (starDay.equals("1") || starDay.equals("01")) { - sdt = dt.substring(0, 7) + "-01 " + wStructure.getStarthour() + ":00"; - } else { - sdt = CommUtil.subplus(dt.substring(0, 7) + "-" + starDay, "-1", "month").substring(0, 10) + " " + wStructure.getStarthour() + ":00"; - } - if (endDay.equals("-")) { - int maxDay = CommUtil.getDaysByYearMonth(Integer.valueOf(dt.substring(0, 4)), Integer.valueOf(dt.substring(5, 7))); - edt = dt.substring(0, 7) + "-" + maxDay + " " + wStructure.getStarthour() + ":00"; - } else { - edt = dt.substring(0, 7) + "-" + endDay + " " + wStructure.getStarthour() + ":00"; - } - - JSONArray xDataJson = new JSONArray(); - JSONArray seriesDataJson = new JSONArray(); - JSONArray seriesTypeJson = new JSONArray(); - JSONArray legendJson = new JSONArray(); - JSONArray axisDJson = new JSONArray(); - JSONArray curveunitDJson = new JSONArray(); - JSONArray legendshapeJson = new JSONArray(); - JSONArray curvescalestJson = new JSONArray(); - JSONArray curvesMaxAndMinJson = new JSONArray(); - -// com.alibaba.fastjson.JSONObject seriesObject=new com.alibaba.fastjson.JSONObject(); - - WordAnalysisReportContent wContent = this.wordAnalysisReportContentService.selectById(id); - - String curveType = wContent.getCurvetype(); - String titleName = wContent.getName(); - - titleName = this.wordAnalysisReportStructureService.calculation(titleName, dt); - - curveunitDJson.add(wContent.getCurveunit()); - curvescalestJson.add(wContent.getCurvescalest()); - - String maxValue ="-"; - String minValue ="-"; - String curveinterval ="-"; - if(wContent.getCurvemaxvalue()!=null&&wContent.getCurvemaxvalue().length()>0){ - maxValue=wContent.getCurvemaxvalue(); - } - if(wContent.getCurveminvalue()!=null&&wContent.getCurveminvalue().length()>0){ - minValue=wContent.getCurveminvalue(); - } - if(wContent.getCurveinterval()!=null&&wContent.getCurveinterval().length()>0){ - curveinterval=wContent.getCurveinterval(); - } - - curvesMaxAndMinJson.add(maxValue); - curvesMaxAndMinJson.add(minValue); - curvesMaxAndMinJson.add(curveinterval); - - List curvelist = this.wordAnalysisReportContentCurveService.selectListByWhere(" where pid='" + wContent.getId() + "' " - + " order by morder asc "); - if (curvelist != null && curvelist.size() > 0) { - int fixnum = 0; - for (int c = 0; c < curvelist.size(); c++) { - JSONArray seriesDataJsonD = new JSONArray(); - JSONArray xDataJsonD = new JSONArray(); - - seriesTypeJson.add(curveType); - axisDJson.add(curvelist.get(c).getAxisnum()); - - String dname = curvelist.get(c).getName(); - dname = this.wordAnalysisReportStructureService.calculation(dname, dt); - String unitconversion = curvelist.get(c).getUnitconversion(); - - legendJson.add(dname); - if (curvelist.get(c).getLegendshape() != null) { - legendshapeJson.add(curvelist.get(c).getLegendshape()); - } else { - legendshapeJson.add("none"); - } - - String mpid = curvelist.get(c).getMpid(); - String valueRange = curvelist.get(c).getValuerange(); - - if (!mpid.equals("") && mpid.length() > 0) { - String cal = curvelist.get(c).getCalculationmethod(); - - String selectString = ""; - String orderString = ""; - if (cal.equals("first")) { - selectString = " top 1 * "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " top 1 (ParmValue" + unitconversion + ") as ParmValue "; - } - orderString = " order by MeasureDT desc"; - } else if (cal.equals("sum")) { - selectString = " sum(ParmValue) as ParmValue "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " sum(ParmValue" + unitconversion + ") as ParmValue "; - } - } else if (cal.equals("avg")) { - selectString = " avg(ParmValue) as ParmValue "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " avg(ParmValue" + unitconversion + ") as ParmValue "; - } - } else if (cal.equals("max")) { - selectString = " max(ParmValue) as ParmValue "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " max(ParmValue" + unitconversion + ") as ParmValue "; - } - } else if (cal.equals("min")) { - selectString = " min(ParmValue) as ParmValue "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " min(ParmValue" + unitconversion + ") as ParmValue "; - } - } else if (cal.equals("diff")) { - selectString = " (max(ParmValue)-min(ParmValue)) as ParmValue "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " (max(ParmValue" + unitconversion + ")-min(ParmValue" + unitconversion + ")) as ParmValue "; - } - } - - String whereString = ""; - -// if(valueRange.equals(WordAnalysisReportContentForm.ValueRange_chainComparison)){ -// -// }else{ - if (valueRange.equals(WordAnalysisReportContentCurve.ValueRange_nowMonth)) { - whereString = " where (MeasureDT between '" + sdt + "' and '" + edt + "') and ParmValue>-9999 "; - } else if (valueRange.equals(WordAnalysisReportContentCurve.ValueRange_lastMonth)) { - whereString = " where (MeasureDT between '" + CommUtil.subplus(sdt, "-1", "month") + "' and '" + CommUtil.subplus(edt, "-1", "month") + "') and ParmValue>-9999 "; - } else if (valueRange.equals(WordAnalysisReportContentCurve.ValueRange_hisData)) { - selectString = " * "; - if (unitconversion != null && unitconversion.length() > 0) { - selectString = " (ParmValue" + unitconversion + ") as ParmValue,MeasureDT "; - } - whereString = " where (MeasureDT between '" + sdt + "' and '" + edt + "') and ParmValue>-9999 "; - orderString = " order by MeasureDT "; - } - - List blist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString + orderString, selectString); - - MPoint mPoint = this.mPointService.selectById(unitId, mpid); - String numTail = mPoint.getNumtail(); - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - - if (blist != null && blist.size() > 0) { - if (blist.get(0) != null) { - for (int j = 0; j < blist.size(); j++) { - String measuredt = ""; - if (blist.get(j).getMeasuredt() != null) { - measuredt = blist.get(j).getMeasuredt().substring(0, 10); - } - fixnum++; - xDataJsonD.add(measuredt); - - BigDecimal db = blist.get(j).getParmvalue(); - String vString = db.toPlainString(); - double value = Double.valueOf(vString); -// if(unitconversion!=null&&unitconversion.length()>0){ -// ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); -// Object parmValueD=jse.eval(vString+unitconversion); -// value=((Number)parmValueD).doubleValue(); -// } - seriesDataJsonD.add(df.format(value)); - } - } else { - xDataJsonD.add(""); - seriesDataJsonD.add("0.0"); - } - } else { - xDataJsonD.add(""); - seriesDataJsonD.add("0.0"); - } -// } - } else { - if (valueRange.equals(WordAnalysisReportContentCurve.ValueRange_formData)) { - List wordAnalysisReportFormData = this.wordAnalysisReportFormDataService.selectListByWhere(" where pid='" + rid + "' and modeFormld='" + curvelist.get(c).getFixedvalue() + "' "); - if (wordAnalysisReportFormData != null && wordAnalysisReportFormData.size() > 0) { - MPoint mPoint = this.mPointService.selectById(wordAnalysisReportFormData.get(0).getMpid()); - String numTail = mPoint.getNumtail(); - String vString = String.valueOf(wordAnalysisReportFormData.get(0).getValue()); - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - seriesDataJsonD.add(String.valueOf(df.format(Double.valueOf(vString)))); - } else { - seriesDataJsonD.add(0); - } - xDataJsonD.add(""); - } else { - double fixedvalue = Double.valueOf(curvelist.get(c).getFixedvalue()); - for (int i = 0; i < fixnum; i++) { - seriesDataJsonD.add(fixedvalue); - } - } - } - - seriesDataJson.add(seriesDataJsonD); - xDataJson.add(xDataJsonD); - } - - } - - JSONArray axisDataJson = new JSONArray(); - - if (wContent.getAxis().equals(WordAnalysisReportContent.Axis_multi)) { - List curveaxislist = this.wordAnalysisReportContentCurveAxisService.selectListByWhere(" where pid='" + wContent.getId() + "' " - + " order by num asc "); - if (curveaxislist != null && curveaxislist.size() > 0) { - int leftNum = 0; - int rightNum = 0; - for (int i = 0; i < curveaxislist.size(); i++) { - JSONArray axisDataJsonD = new JSONArray(); - axisDataJsonD.add(curveaxislist.get(i).getNum()); - axisDataJsonD.add(curveaxislist.get(i).getPosition()); - if (curveaxislist.get(i).getPosition().equals("left")) { - axisDataJsonD.add(leftNum * 50); - leftNum++; - } else if (curveaxislist.get(i).getPosition().equals("right")) { - axisDataJsonD.add(rightNum * 50); - rightNum++; - } - axisDataJsonD.add(curveaxislist.get(i).getUnit()); - axisDataJsonD.add(curveaxislist.get(i).getCurveinterval()); - axisDataJsonD.add(curveaxislist.get(i).getCurvemaxvalue()); - axisDataJsonD.add(curveaxislist.get(i).getCurveminvalue()); - axisDataJson.add(axisDataJsonD); - } - } - } - - mainjson.add(xDataJson); - mainjson.add(seriesDataJson); - mainjson.add(seriesTypeJson); - mainjson.add(legendJson); - mainjson.add(titleName); - mainjson.add(id); - mainjson.add(axisDataJson); - mainjson.add(axisDJson); - mainjson.add(curveunitDJson); - mainjson.add(legendshapeJson); - mainjson.add(curvescalestJson); - mainjson.add(curvesMaxAndMinJson); - - model.addAttribute("result", mainjson); - return "result"; - } - - @RequestMapping("/saveImage.do") - public void saveImage(HttpServletRequest request) throws Exception { - ServletInputStream ris = request.getInputStream(); - StringBuilder content = new StringBuilder(); - byte[] b = new byte[1]; - int lens = -1; - while ((lens = ris.read(b)) > 0) { - content.append(new String(b, 0, lens)); - } - String strcont = content.toString();// 内容 -// System.out.println(strcont); - String[] strconts = strcont.split(","); - - String id = strconts[0]; - String img = strconts[2]; - - byte[] b2 = new BASE64Decoder().decodeBuffer(img); - for (int i = 0; i < b2.length; ++i) { - if (b2[i] < 0) {// 调整异常数据 - b2[i] += 256; - } - } - // 生成png图片 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String imgpath = filepathSever.replaceAll(contextPath, "UploadFile" + "/wordAnalysisReport/curve/"); - File fileUploadPath = new File(imgpath); - //判断是否存在目录. 不存在则创建 - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - OutputStream out = new FileOutputStream(imgpath + id + ".png"); - out.write(b2); - out.flush(); - out.close(); - } - -} diff --git a/src/com/sipai/controller/workorder/FileUpload.java b/src/com/sipai/controller/workorder/FileUpload.java deleted file mode 100644 index 15d027ad..00000000 --- a/src/com/sipai/controller/workorder/FileUpload.java +++ /dev/null @@ -1,704 +0,0 @@ -package com.sipai.controller.workorder; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.controller.base.PDFFileUtil; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import com.sipai.tools.MinioProp; -import io.minio.MinioClient; -import io.minio.errors.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import org.xmlpull.v1.XmlPullParserException; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Controller -@RequestMapping(value = "/overhaul") -public class FileUpload { - - private String BaseFolderName = "UploadFile"; - @Resource - CommonFileService commonFileService; - @Autowired - private MinioProp minioProp; - - /** - * 显示上传页面 - * - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - */ - @RequestMapping(value = "fileupload.do", method = RequestMethod.GET) - public String fileupload(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterid") String masterid, - @RequestParam(value = "mappernamespace") String mappernamespace) { - model.addAttribute("mappernamespace", mappernamespace); - model.addAttribute("masterid", masterid); - return "workorder/fileupload"; - } - - /** - * 上传文件 - * - * @param file - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "uploadfile.do") - public ModelAndView uploadFile(@RequestParam MultipartFile[] file, HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterid") String masterid, - @RequestParam(value = "mappernamespace") String mappernamespace) throws IOException { - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName, BaseFolderName); - - User user = (User) request.getSession().getAttribute("cu"); - String result = this.commonFileService.uploadFile(realPath, mappernamespace, masterid, user, file); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 下载文件 - * - * @param request - * @param response - * @param model - * @param id - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "downloadFile.do") - public ModelAndView downloadFile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - if (commfiles != null && commfiles.size() > 0) { - FileUtil.downloadFile(response, commfiles.get(0).getFilename(), commfiles.get(0).getAbspath()); - } else { - } - return null; - } - - /** - * 下载文件 用于记录和文件唯一对应的情况 - * - * @param request - * @param response - * @param model - * @param id - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "downloadFileFromMasterid.do") - public ModelAndView downloadFileFromMasterid(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + id + "'"); - if (commfiles != null && commfiles.size() > 0) { - FileUtil.downloadFile(response, commfiles.get(0).getFilename(), commfiles.get(0).getAbspath()); - } else { - } - return null; - } - - /** - * 删除文件 - * - * @param request - * @param response - * @param model - * @param id - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "deletefile.do") - public ModelAndView deletefile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "id") String id, - @RequestParam(value = "mappernamespace") String mappernamespace) throws IOException { - CommonFile commfile = this.commonFileService.selectById(id, mappernamespace); - int res = this.commonFileService.deleteById(id, mappernamespace); - if (res > 0) { - FileUtil.deleteFile(commfile.getAbspath()); - model.addAttribute("result", "删除成功"); - } - return new ModelAndView("result"); - } - - /** - * 获取主ID下的文件列表 - * - * @param request - * @param response - * @param model - * @param masterid - * @param mappernamespace - * @return - * @throws IOException - */ - @RequestMapping(value = "getFileList.do") - public ModelAndView getFileList(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterid") String masterid, - @RequestParam(value = "mappernamespace") String mappernamespace) throws IOException { - List list = this.commonFileService.selectByMasterId(masterid, mappernamespace); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/doimportExcel.do") - public String doimportExcel(HttpServletRequest request, Model model) { - return "/base/importExcel"; - } - - @RequestMapping("/doPrint.do") - public String doPrint(HttpServletRequest request, Model model) { - return "/base/print"; - } - - /** - * 显示上传页面-bootstrap-fileinput - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinput.do") - public String fileinput(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "workorder/fileinput"; - } - - /** - * 显示上传页面-minio (通用) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinputMinio.do") - public String fileinputMinio(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "workorder/fileinputMinio"; - } - - /** - * 显示上传页面-minio (Report) - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "fileinputMinio_Report.do") - public String fileinputMinio_Report(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "workorder/fileinputMinio_Report"; - } - - /** - * 上传文件通用接口 - * - * @param request 请求体 - * @param dstFileName html上传组件中(input中name属性),上传文件体名称,通过此名称获取所有上传的文件map - * @param reportGroupId (特殊)上传报告所述报告组id - */ - @RequestMapping(value = "inputFile.do") - public ModelAndView inputFile(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathSever.replaceAll(contextPath, BaseFolderName + "/" + nameSpace + "/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date()) + fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int) item.getSize()); - int res = commonFileService.insertByTable(tbName, commonFile); - - if (res == 1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "inputFilemore.do") - public ModelAndView inputFilemore(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String nameSpace = request.getParameter("nameSpace"); - String typeId = request.getParameter("typeId"); - User cu = (User) request.getSession().getAttribute("cu"); - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String filepath = filepathSever.replaceAll(contextPath, BaseFolderName + "/" + nameSpace + "/"); - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - String fileName = ""; //当前上传文件全名称 - String fileType = ""; //当前上传文件类型 - String saveFileName = ""; //保存到服务器目录的文件名称 - String reportAddr = ""; //保存到服务器目录的文件全路径 - try { - fileName = item.getOriginalFilename(); - fileType = item.getContentType(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - saveFileName = dateFormat.format(new Date()) + fileName; - reportAddr = fileUploadPath + "/" + saveFileName; - reportAddr = reportAddr.replace("/", File.separator).replace("\\", File.separator); - - File savedFile = new File(fileUploadPath, saveFileName); - item.transferTo(savedFile); - - //上传文件成功,保存文件信息到表reportDetail - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID() + "-" + typeId); - commonFile.setMasterid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(fileType); - commonFile.setAbspath(reportAddr); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setInsuser(cu.getId()); - commonFile.setSize((int) item.getSize()); - int res = commonFileService.insertByTable(tbName, commonFile); - - if (res == 1) { - ret.put("suc", true); - ret.put("msg", commonFile.getId()); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取文件json - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList.do") - public ModelAndView getInputFileList(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String masterId = request.getParameter("masterId"); - //masterId="56aa5f35dac644deb7b3938a79cf3fde"; - String tbName = request.getParameter("tbName"); - //String nameSpace = request.getParameter("nameSpace"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "'"); - /* String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - contextPath=request.getSession().getServletContext().getContextPath();*/ - - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 获取文件json - minio中 - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList_minio.do") - public ModelAndView getInputFileList_minio(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidPortException, InvalidEndpointException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, InternalException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String bucketName = request.getParameter("bucketName"); - System.out.println(masterId+"---------"+tbName+"---------"+bucketName); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "'"); - for (CommonFile commonFile : list) { - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - String obj = minioClient2.presignedGetObject(bucketName, commonFile.getAbspath(), 3600 * 24 * 7); - commonFile.setAbspath(obj); - } - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 获取文件json - minio中 (List格式) - * - * @param request - * @param response - * @param model - * @return - * @throws IOException - */ - @RequestMapping(value = "getInputFileList_minio2.do") - public ModelAndView getInputFileList_minio2(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidPortException, InvalidEndpointException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, InternalException { - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - String bucketName = request.getParameter("bucketName"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "'"); - for (CommonFile commonFile : list) { - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - String obj = minioClient2.presignedGetObject(bucketName, commonFile.getAbspath(), 3600 * 24 * 7); - commonFile.setAbspath(obj); - } - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + 1 + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "getInputFileList2.do") - public String getInputFileList2(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException, InvalidBucketNameException, InsufficientDataException, XmlPullParserException, ErrorResponseException, NoSuchAlgorithmException, NoResponseException, InvalidKeyException, InvalidResponseException, InternalException, InvalidPortException, InvalidEndpointException, InvalidExpiresRangeException { - String bucketName = "maintenance"; - String objectName = "2021-09-07-10-06-5811111111.png"; - MinioClient minioClient2 = new MinioClient("http://127.0.0.1:9000", "sipai", "ZAQwsx@2008"); - String obj = minioClient2.presignedGetObject(bucketName, objectName, 3600 * 24 * 7); - System.out.println(obj); - return obj; - } - - @RequestMapping(value = "getInputFileTableList.do") - public String getInputFileTableList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - PageHelper.startPage(page, rows); - String masterId = request.getParameter("masterId"); - String tbName = request.getParameter("tbName"); - //String nameSpace = request.getParameter("nameSpace"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + masterId + "' order by insdt desc"); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return ("result"); - } - - @RequestMapping(value = "deleteInputFile.do") - public String deleteInputFile(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - int code = 0; - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - - if (commfiles != null && commfiles.size() > 0) { - File file = new File(commfiles.get(0).getAbspath()); - if (file.exists()) { - file.delete();//删除文件 - } - code = this.commonFileService.deleteByTableAWhere(tbName, "where id='" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - //用于记录和文件唯一对应的情况 - @RequestMapping(value = "deleteInputFileFromMasterid.do") - public String deleteInputFileFromMasterid(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "key") String id, @RequestParam(value = "tbName") String tbName) throws IOException { - int code = 0; - Map ret = new HashMap(); - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='" + id + "'"); - - if (commfiles != null && commfiles.size() > 0) { - File file = new File(commfiles.get(0).getAbspath()); - if (file.exists()) { - file.delete();//删除文件 - } - code = this.commonFileService.deleteByTableAWhere(tbName, "where masterid='" + id + "'"); - Result result = new Result(); - if (code == Result.SUCCESS) { - result = Result.success(code); - } else { - result = Result.failed("删除失败"); - } - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - /** - * 保存PDF临时文档,返回文档地址 - */ - @RequestMapping("/getPDFUrl.do") - public ModelAndView getPDFUrl(HttpServletRequest request, Model model) { - - String htmlStr = request.getParameter("htmlStr"); - String realPath = request.getSession().getServletContext().getRealPath("/"); - String pjName = request.getContextPath().substring(1, request.getContextPath().length()); - realPath = realPath.replace(pjName, BaseFolderName); - realPath += "TempFiles\\"; - File dir = new File(realPath); - if (!dir.exists()) { - try { - dir.mkdir(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - dir = null; - String fileName = CommUtil.getUUID() + ".pdf"; - realPath += fileName; - PDFFileUtil.html2Pdf(realPath, htmlStr); - String result = "{\"res\":\"" + realPath.substring(realPath.indexOf(BaseFolderName), realPath.length()).replace("\\", "/") + "\"}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 流程审核上传资料页面 - * - * @return - */ - @RequestMapping(value = "fileInputForProcess.do") - public String fileInputForProcess(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - return "fileinputMinio"; - } - - @RequestMapping(value = "fileInputForProcessmore.do") - public String fileInputForProcessmore(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace, @RequestParam(value = "typeId") String typeId) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - model.addAttribute("typeId", typeId); - return "workorder/fileInputForProcessMore"; - } - - @RequestMapping(value = "fileInputForProcessmore1.do") - public String fileInputForProcessmore1(HttpServletRequest request, - HttpServletResponse response, Model model, @RequestParam(value = "masterId") String masterId, - @RequestParam(value = "tbName") String tbName, @RequestParam(value = "nameSpace") String nameSpace, @RequestParam(value = "typeId") String typeId) { - model.addAttribute("tbName", tbName); - model.addAttribute("masterId", masterId); - model.addAttribute("nameSpace", nameSpace); - model.addAttribute("typeId", typeId); - return "workorder/fileInputForProcessMore1"; - } - - /* - * 根据id获取单个文件 - */ - @RequestMapping(value = "getInputFile4Id.do") - public ModelAndView getInputFile4Id(HttpServletRequest request, - HttpServletResponse response, Model model) throws IOException { - String id = request.getParameter("id"); - String tbName = request.getParameter("tbName"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where id='" + id + "'"); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - - /** - * 以下方法为 minio 文件相关方法 - */ - /** - * minio 文件上传 - * - * @param request - * @param response - * @param model - * @return - */ - @RequestMapping(value = "updateFile.do") - public ModelAndView updateFile(HttpServletRequest request, HttpServletResponse response, Model model) { - Map ret = new HashMap(); - String masterId = request.getParameter("masterId"); - String nameSpace = request.getParameter("nameSpace"); - // YYJ 20201229 - String tbName = request.getParameter("tbName"); - if (nameSpace != null && !nameSpace.isEmpty()) { - if (tbName == null || tbName.isEmpty()) { - tbName = FileNameSpaceEnum.getTbName(nameSpace); - } - } - - if (ServletFileUpload.isMultipartContent(request)) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List fileList = multipartRequest.getFiles("filelist"); //控件id - //for循环只执行一次 - for (MultipartFile item : fileList) { - try { - int res = commonFileService.updateFile(masterId, nameSpace, tbName, item); - - if (res == 1) { - ret.put("suc", true); - } else { - ret.put("suc", false); - } - } catch (Exception e) { - e.printStackTrace(); - ret.put("suc", false); - ret.put("msg", e.getMessage()); - } - } - } - String result = JSONObject.fromObject(ret).toString(); - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "getInputFileListById.do") - public ModelAndView getInputFileListById(HttpServletRequest request, - HttpServletResponse response,Model model) throws IOException { - String id = request.getParameter("id"); - //masterId="56aa5f35dac644deb7b3938a79cf3fde"; - String tbName = request.getParameter("tbName"); - //String nameSpace = request.getParameter("nameSpace"); - List list = this.commonFileService.selectListByTableAWhere(tbName, "where id='"+id+"'"); - /* String contextPath=request.getContextPath().replace("/", ""); - String filepathSever=request.getSession().getServletContext().getRealPath(""); - contextPath=request.getSession().getServletContext().getContextPath();*/ - if(list!=null && list.size()>0){ - String typeString = list.get(0).getType(); - if(typeString.contains("word") || typeString.contains("sheet") || typeString.contains("excel") || typeString.contains("presentation") || typeString.contains("powerpoint")){ - list = this.commonFileService.selectListByTableAWhere(tbName, "where masterid='"+id+"'"); - } - } - - JSONArray json=JSONArray.fromObject(list); - model.addAttribute("result",json); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/workorder/OverhaulController.java b/src/com/sipai/controller/workorder/OverhaulController.java deleted file mode 100644 index d495f9e3..00000000 --- a/src/com/sipai/controller/workorder/OverhaulController.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.sipai.controller.workorder; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.equipment.EquipmentStopRecord; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.OverhaulStatistics; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.equipment.EquipmentStopRecordService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.workorder.OverhaulItemEquipmentService; -import com.sipai.service.workorder.OverhaulService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/workorder/overhaul") -public class OverhaulController { - @Resource - private OverhaulService overhaulService; - @Resource - private UnitService unitService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private UserService userService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private EquipmentStopRecordService equipmentStopRecordService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - model.addAttribute("type", 0); - return "/workorder/overhaulList"; - } - - @RequestMapping("/showList1.do") - public String showlist1(HttpServletRequest request, Model model) { - model.addAttribute("type", 1); - return "/workorder/overhaulList"; - } - - @RequestMapping("/showList2.do") - public String showlist2(HttpServletRequest request, Model model) { - model.addAttribute("type", 2); - return "/workorder/overhaulList"; - } - - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "processStatus", required = false) String status, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "sort", required = false) String sort) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = CommUtil.getwherestr("insuser", "maintenance/getList.do", cu); - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - wherestr += " and companyid='" + request.getParameter("search_code") + "'"; - } - if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { - wherestr += " and problem like '%" + request.getParameter("search_name") + "%' "; - } - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "' "; - } - wherestr += " and process_status in (" + status + ") "; - PageHelper.startPage(page, rows); - List list = this.overhaulService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-DX-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("companyName", company.getSname()); - } - User user = userService.getUserById(cu.getId()); - if (user != null) { - request.setAttribute("userId", user.getId()); - request.setAttribute("userName", user.getCaption()); - } - request.setAttribute("id", CommUtil.getUUID()); - return "workorder/overhaulAdd"; - } - - @Autowired - private OverhaulItemEquipmentService overhaulItemEquipmentService; - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, @RequestParam(value = "flag") Integer flag) { - Overhaul overhaul = this.overhaulService.selectById(id); - model.addAttribute("overhaul", overhaul); - model.addAttribute("flag", flag); - OverhaulStatistics overhaulStatistics1 = overhaulItemEquipmentService.selectByOverhaulId(id); - model.addAttribute("overhaulStatistics", overhaulStatistics1); - - - try { - String taskId = request.getParameter("taskId"); - model.addAttribute("taskId", taskId); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String equipmentStopApplyId = pInstance.getBusinessKey(); - EquipmentStopRecord esr = this.equipmentStopRecordService.selectById(equipmentStopApplyId); - model.addAttribute("esr", esr); - -//获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "workorder/overhaulEdit"; - } catch (Exception e) { - return "workorder/overhaulEdit"; - } - - - //查询该是什么保养类型 前端调用不同类型的库 - /*if (overhaul != null) { - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(overhaul.getOverhaulType()); - if (equipmentPlanType != null) { - model.addAttribute("equipmentType", equipmentPlanType.getType()); - l } - }*/ - - - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - Overhaul overhaul = this.overhaulService.selectById(id); - model.addAttribute("overhaul", overhaul); - return "workorder/overhaulView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("overhaul") Overhaul overhaul) { - User cu = (User) request.getSession().getAttribute("cu"); - overhaul.setProcessStatus("11"); -// overhaul.setId(CommUtil.getUUID()); - overhaul.setInsdt(CommUtil.nowDate()); - overhaul.setInsuser(cu.getId()); - int result = this.overhaulService.save(overhaul); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("overhaul") Overhaul overhaul) { - int result = this.overhaulService.update(overhaul); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodel.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String msg = ""; - int result = this.overhaulService.deleteById(id); - model.addAttribute("result", "{\"res\":\"" + result + "\",\"msg\":\"" + msg + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/deletes.do") - public ModelAndView deletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - int result = this.overhaulService.deleteByWhere("where id in('" + ids.replace(",", "','") + "')"); - model.addAttribute("result", "{\"res\":\"" + result + "\",\"msg\":\"" + msg + "\"}"); - return new ModelAndView("result"); - } - - -} diff --git a/src/com/sipai/controller/workorder/OverhaulItemContentController.java b/src/com/sipai/controller/workorder/OverhaulItemContentController.java deleted file mode 100644 index 331347a3..00000000 --- a/src/com/sipai/controller/workorder/OverhaulItemContentController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.sipai.controller.workorder; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.workorder.OverhaulItemContent; -import com.sipai.entity.user.User; -import com.sipai.service.workorder.OverhaulItemContentService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 大修分项-内容 - * sj 2020-11-17 - */ -@Controller -@RequestMapping("/workorder/overhaulItemContent") -public class OverhaulItemContentController { - @Resource - private OverhaulItemContentService overhaulItemContentService; - - /** - * 获取list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String pid =request.getParameter("pid"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by insdt asc"; - String wherestr=" where 1=1"; - if(pid!=null && !pid.isEmpty()){ - wherestr += " and item_id = '"+ pid +"'"; - } - PageHelper.startPage(page, rows); - List list = this.overhaulItemContentService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.overhaulItemContentService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.overhaulItemContentService.deleteByWhere("where id in ('"+ids+"')"); - if(res >= 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("uuId", CommUtil.getUUID()); - return "workorder/overhaulItemContentAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("overhaulItemContent") OverhaulItemContent overhaulItemContent){ - User cu= (User)request.getSession().getAttribute("cu"); - overhaulItemContent.setInsdt(CommUtil.nowDate()); - overhaulItemContent.setInsuser(cu.getId()); - int result = this.overhaulItemContentService.save(overhaulItemContent); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - OverhaulItemContent overhaulItemContent = this.overhaulItemContentService.selectById(id); - model.addAttribute("overhaulItemContent",overhaulItemContent); - return "workorder/overhaulItemContentEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("overhaulItemContent") OverhaulItemContent overhaulItemContent){ - int result = this.overhaulItemContentService.update(overhaulItemContent); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/workorder/OverhaulItemEquipmentController.java b/src/com/sipai/controller/workorder/OverhaulItemEquipmentController.java deleted file mode 100644 index 81b08ea5..00000000 --- a/src/com/sipai/controller/workorder/OverhaulItemEquipmentController.java +++ /dev/null @@ -1,399 +0,0 @@ -package com.sipai.controller.workorder; - -import com.alibaba.druid.sql.visitor.functions.If; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.ActivitiCommStr; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.user.Company; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.workorder.OverhaulItemEquipment; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.OverhaulStatistics; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.maintenance.EquipmentPlanService; -import com.sipai.service.user.UnitService; -import com.sipai.service.workorder.OverhaulItemEquipmentService; -import com.sipai.service.workorder.OverhaulService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.runtime.ProcessInstanceQuery; -import org.activiti.engine.task.Task; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -/** - * @author chiliz - * @date 2021-11-16 14:24:23 - * @description: TODO - */ -@Controller -@RequestMapping("/workorder/overhaulItemEquipment") -public class OverhaulItemEquipmentController { - @Resource - private OverhaulItemEquipmentService overhaulItemEquipmentService; - @Resource - private UnitService unitService; - @Resource - private EquipmentPlanService equipmentPlanService; - @Autowired - protected RuntimeService runtimeService; - @Resource - private TaskService taskService; - @Resource - private WorkflowService workflowService; - @Resource - private OverhaulService overhaulService; - - /** - * 获取list数据 - * 因缺少设备表,所以只查询设备编号, - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid"); -// if (sort == null) { -// sort = " insdt "; -// } -// if (order == null) { -// order = " desc "; -// } - String orderstr = " order by tmoie.insdt asc"; - String wherestr = " where 1=1 AND tmoie.pid='" + pid + "'"; - - PageHelper.startPage(page, rows); - List list = this.overhaulItemEquipmentService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.overhaulItemEquipmentService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.overhaulItemEquipmentService.deleteByWhere("where id in ('" + ids + "')"); - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, String projectId) { - request.setAttribute("uuId", CommUtil.getUUID()); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-FX-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - } - request.setAttribute("nowDate", CommUtil.nowDate().substring(0, 10)); - request.setAttribute("pid", projectId); - return "workorder/overhaulItemEquipment"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("overhaulItemEquipment") OverhaulItemEquipment overhaulItemEquipment) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - String[] splitId = overhaulItemEquipment.getEquipmentId().split(","); - for (String s : splitId) { - overhaulItemEquipment.setId(UUID.randomUUID().toString()); - //数据插入时间 - overhaulItemEquipment.setInsdt(CommUtil.nowDate()); - //数据插入人 - overhaulItemEquipment.setInsuser(cu.getId()); - overhaulItemEquipment.setEquipmentId(s); - result=overhaulItemEquipmentService.save(overhaulItemEquipment); - } - - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "edit") String edit) { - String orderstr = " order by tmoie.insdt asc"; - String wherestr = " where 1=1 AND tmoie.id='" + id + "'"; - OverhaulItemEquipment overhaulItemEquipment = this.overhaulItemEquipmentService.selectById(id); - model.addAttribute("overhaulItemEquipment", overhaulItemEquipment); - OverhaulItemEquipment overhaulItemEquipment1 = overhaulItemEquipmentService.selectByWhere(wherestr + orderstr); - model.addAttribute("equipmentName", overhaulItemEquipment1.getEquipmentName()); - request.setAttribute("pid", overhaulItemEquipment.getPid()); - request.setAttribute("edit", edit); - return "workorder/overhaulItemEquipment"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("overhaulItemEquipment") OverhaulItemEquipment overhaulItemEquipment) { - - //未找到计划开始时间字段存储位置 -// Overhaul overhaul=new Overhaul(); -// overhaul.setId(overhaulItemEquipment.getPid()); -// overhaul.setPlanDate(overhaulItemEquipment.getPlanEndDate()); -// overhaulService.update(overhaul); - int result = this.overhaulItemEquipmentService.update(overhaulItemEquipment); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - - //大修编制申请 - @RequestMapping("/startOverhaul.do") - public String startWorkorderDetail(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlan equipmentPlan) { - User cu = (User) request.getSession().getAttribute("cu"); - equipmentPlan.setInsuser(cu.getId()); - equipmentPlan.setInsdt(CommUtil.nowDate()); - //11提起审核 - equipmentPlan.setOverhaulId(request.getParameter("id")); - equipmentPlan.setProcessStatus("21"); - equipmentPlan.setUnitId(request.getParameter("unitId")); - Overhaul overhaul=new Overhaul(); - overhaul.setProcessStatus("21"); - overhaul.setId(equipmentPlan.getId()); - overhaulService.update(overhaul); - - int result = 0; - try { - result = this.overhaulItemEquipmentService.startOverhaul("", equipmentPlan); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - - /** - * 更新,启动d大修计划审核流程 - */ - - @RequestMapping("/startPlanAudit.do") - public String startPlanAudit(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlan equipmentPlan, - @RequestParam(value = "taskId") String taskId, - @RequestParam(value = "processStatus") Integer processStatus) { - User cu = (User) request.getSession().getAttribute("cu"); - Overhaul overhaul = new Overhaul(); - - equipmentPlan.setInsdt(CommUtil.nowDate()); - equipmentPlan.setAuditId(cu.getId()); - String id = request.getParameter("id"); - Overhaul overhaul1 = overhaulService.selectById(equipmentPlan.getId()); - String sendUserId = overhaul1.getSendUserId(); - equipmentPlan.setInsuser(sendUserId); - - int result = 0; - if (processStatus == 0) { - try { - runtimeService.deleteProcessInstance(equipmentPlan.getProcessid(), ""); - result = 1; - // 需要更新流程状态: - overhaul.setId(id); - overhaul.setProcessStatus("22"); - overhaulService.update(overhaul); - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentPlan); - businessUnitRecord.sendMessage(equipmentPlan.getAuditId(), "您发起的大修计划已被驳回,请重新发起"); - } catch (Exception e) { - // TODO: handle exception - result = 0; - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - try { - //判断按哪条路径走,网关里,在判断条件中route=1,passFlag=true,进入下一步 - String routeNum = request.getParameter("routeNum"); - String targetUser = equipmentPlan.getInsuser(); - equipmentPlan.setInsuser(cu.getId()); - equipmentPlan.setInsdt(CommUtil.nowDate()); - - - Map variables = new HashMap(); - //variables流程变量 - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - //候选人:数据插入人,也就是当前用户 - variables.put(CommString.ACTI_KEK_Candidate_Users, targetUser); - //受让人 - variables.put(CommString.ACTI_KEK_Assignee, null); - //complete的作用估计是进入流程的下一步 - taskService.complete(taskId, variables); - //通过的话,更新状态为实施中 - overhaul.setId(id); - overhaul.setProcessStatus("31"); - overhaulService.update(overhaul); - //发送消息 - if (targetUser != null && !targetUser.isEmpty()) { - //补全所有字段信息 - equipmentPlan = equipmentPlanService.selectById(equipmentPlan.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentPlan); - businessUnitRecord.sendMessage(targetUser, ""); - } - //获取任务列表 - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentPlan.getProcessid()).list(); - if (task != null && task.size() > 0) { - equipmentPlan.setProcessStatus(task.get(0).getName()); - } else { - equipmentPlan.setProcessStatus(ActivitiCommStr.Activiti_FINISH); - } - result = equipmentPlanService.update(equipmentPlan); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + equipmentPlan.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 大修实施附表 - */ - @RequestMapping("/getSlave.do") - public ModelAndView getSlave(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "overhaulId", required = false) String overhaulId) { - PageHelper.startPage(page, rows); - OverhaulStatistics overhaulStatistics1 = overhaulItemEquipmentService.selectByOverhaulId(overhaulId); - model.addAttribute("result", overhaulStatistics1); - return new ModelAndView("result"); - } - - @RequestMapping("/doSlaveApply.do") - public String doSlaveApply(HttpServletRequest request, Model model, - @ModelAttribute EquipmentPlan equipmentPlan, - @ModelAttribute("overhaulStatistics") OverhaulStatistics overhaulStatistics) { - - String taskId = request.getParameter("taskId"); - - if (taskId.equals("")) { - taskId = this.taskService.createTaskQuery().processInstanceBusinessKey(equipmentPlan.getId()).singleResult().getId(); - } - int result = 0; - Map variables = new HashMap(); - //variables流程变量 - variables = ActivitiUtil.fixVariableWithRoute(variables, true, "1"); - //候选人:数据插入人,也就是当前用户 - variables.put(CommString.ACTI_KEK_Candidate_Users, equipmentPlan.getInsuser()); - //受让人 - variables.put(CommString.ACTI_KEK_Assignee, null); - variables.put("userIds", request.getParameter("auditId")); - String id = request.getParameter("id"); - taskService.complete(taskId, variables); - OverhaulStatistics overhaulStatistics1 = overhaulItemEquipmentService.selectByOverhaulId(overhaulStatistics.getId()); - if (overhaulStatistics1 != null && !overhaulStatistics1.equals("")) { - overhaulStatistics.setCreateTime(CommUtil.nowDate()); - result = overhaulItemEquipmentService.updateSlave(overhaulStatistics); - } else { - overhaulStatistics.setUpdateTime(CommUtil.nowDate()); - overhaulStatistics.setOverhaulId(request.getParameter("id")); - result = overhaulItemEquipmentService.saveSlave(overhaulStatistics); - } - - - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - //大修验收 - @RequestMapping("/doSlaveHandle.do") - public String doSlavaSave(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit, - @ModelAttribute OverhaulStatistics overhaulStatistics) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - if (request.getParameter("processStatus").equals("1")){ - businessUnitAudit.setPassstatus(true); - }else { - businessUnitAudit.setPassstatus(false); - - businessUnitAudit.setRouteNum(2); - } - - - -// OverhaulStatistics overhaulStatistics =new OverhaulStatistics(); - - OverhaulStatistics overhaulStatistics1 = overhaulItemEquipmentService.selectByOverhaulId(businessUnitAudit.getId()); - if (overhaulStatistics != null && !overhaulStatistics.equals("")) { - overhaulStatistics.setCreateTime(CommUtil.nowDate()); - result = overhaulItemEquipmentService.updateSlave(overhaulStatistics); - } else { - overhaulStatistics.setOverhaulId(request.getParameter("id")); - overhaulStatistics.setUpdateTime(CommUtil.nowDate()); - result = overhaulItemEquipmentService.saveSlave(overhaulStatistics); - } - result = this.overhaulService.cheak(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/workorder/OverhaulItemProjectController.java b/src/com/sipai/controller/workorder/OverhaulItemProjectController.java deleted file mode 100644 index 2ba6d3ff..00000000 --- a/src/com/sipai/controller/workorder/OverhaulItemProjectController.java +++ /dev/null @@ -1,468 +0,0 @@ -package com.sipai.controller.workorder; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.OverhaulItemContent; -import com.sipai.entity.workorder.OverhaulItemProject; -import com.sipai.entity.workorder.OverhaulType; -import com.sipai.entity.workorder.WorkorderAchievement; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.workorder.OverhaulItemContentService; -import com.sipai.service.workorder.OverhaulItemProjectService; -import com.sipai.service.workorder.OverhaulTypeService; -import com.sipai.service.workorder.WorkorderAchievementService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import java.util.*; - -/** - * 大修分项-项目 - * sj 2020-11-17 - */ -@Controller -@RequestMapping("/workorder/overhaulItemProject") -public class OverhaulItemProjectController { - @Resource - private OverhaulItemProjectService overhaulItemProjectService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private OverhaulItemContentService overhaulItemContentService; - @Resource - private WorkorderAchievementService workorderAchievementService; - @Resource - private OverhaulTypeService overhaulTypeService; - @Resource - private UnitService unitService; - - /** - * 获取list数据 - */ - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - String pid =request.getParameter("pid"); - if(sort==null){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by insdt asc"; - String wherestr=" where 1=1"; - if(pid!=null && !pid.isEmpty()){ - wherestr += " and project_id = '"+ pid +"'"; - } - PageHelper.startPage(page, rows); - List list = this.overhaulItemProjectService.selectListByWhere(wherestr+orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int res = this.overhaulItemProjectService.deleteById(id); - if(res == 1){ - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - ids=ids.replace(",","','"); - int res = this.overhaulItemProjectService.deleteByWhere("where id in ('"+ids+"')"); - if(res >= 1){ - Result result = Result.success(res); - model.addAttribute("result",CommUtil.toJson(result)); - }else { - Result result = Result.failed("操作失败"); - model.addAttribute("result",CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("uuId", CommUtil.getUUID()); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-FX-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("jobNumber", jobNumber); - } - request.setAttribute("nowDate", CommUtil.nowDate().substring(0,10)); - return "workorder/overhaulItemProjectAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("overhaulItemProject") OverhaulItemProject overhaulItemProject){ - User cu= (User)request.getSession().getAttribute("cu"); - overhaulItemProject.setInsdt(CommUtil.nowDate()); - overhaulItemProject.setInsuser(cu.getId()); - String projectTypeId = overhaulItemProject.getProjectTypeId(); - String projectId = overhaulItemProject.getProjectId(); - String str="where project_type_id = '"+projectTypeId+"' AND project_id = '"+projectId+"'"; - OverhaulItemProject overhaulItemProject1 = overhaulItemProjectService.selectByWhere(str); - if (overhaulItemProject1!=null&&!overhaulItemProject1.equals("")){ - String result = "项目名称重复"; - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - }else { - int result = this.overhaulItemProjectService.save(overhaulItemProject); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id,@RequestParam(value="edit") String edit){ - OverhaulItemProject overhaulItemProject = this.overhaulItemProjectService.selectById(id); - model.addAttribute("overhaulItemProject",overhaulItemProject); - model.addAttribute("edit",edit); - return "workorder/overhaulItemProjectEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - OverhaulItemProject overhaulItemProject = this.overhaulItemProjectService.selectById(id); - model.addAttribute("overhaulItemProject",overhaulItemProject); - return "workorder/overhaulItemProjectView"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("overhaulItemProject") OverhaulItemProject overhaulItemProject){ - int result = this.overhaulItemProjectService.update(overhaulItemProject); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - /** - * 发起流程 - */ - @RequestMapping("/createProcessFun.do") - public String createProcessFun(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - int code=0; - User cu= (User)request.getSession().getAttribute("cu"); - OverhaulItemProject entity=this.overhaulItemProjectService.selectById(id); - Map variables = new HashMap(); - if(!entity.getReceiveUserIds().isEmpty()){ - variables.put("userIds", entity.getReceiveUserIds()); - }else{ - //无处理人员则不发起 - code= MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - - //查询流程id - OverhaulType overhaulType = null; - if(entity!=null){ - overhaulType = overhaulTypeService.selectById(entity.getProjectTypeId()); - } - System.out.println(overhaulType.getActivitiId()); - if(overhaulType!=null){ - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(overhaulType.getActivitiId()+"-"+entity.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - code=MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(entity.getId(), entity.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - entity.setProcessStatus(OverhaulItemProject.Status_Start); - this.overhaulItemProjectService.update(entity); - code=1; - }else{ - code=0; - throw new RuntimeException(); - } - } - //发送消息 -// BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(repair); -// businessUnitRecord.sendMessage(repair.getReceiveUserIds(),""); - model.addAttribute("result", code); - return "result"; - } - - /* - 显示工单处理页面 - */ - @RequestMapping("/showHandle.do") - public String showHandle(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task nowtask = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", nowtask.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(nowtask.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String jobId= pInstance.getBusinessKey(); - - OverhaulItemProject overhaulItemProject = this.overhaulItemProjectService.selectById(jobId); - model.addAttribute("overhaulItemProject",overhaulItemProject); - return "workorder/overhaulItemProjectHandle"; - } - - /** - * 工单处理 - * @param request - * @param model - * @param businessUnitHandle - * @return - */ - @RequestMapping("/doHandleProcess.do") - public String doHandleProcess(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle){ - String routeNum=request.getParameter("routeNum"); - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - if(!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result =this.businessUnitHandleService.save(businessUnitHandle); - }else { - result =this.businessUnitHandleService.update(businessUnitHandle); - } - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if(businessUnitHandle.getTargetusers()!=null && !businessUnitHandle.getTargetusers().isEmpty()){ - //补全所有字段信息 -// businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); -// BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); -// businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(),""); - } - this.overhaulItemProjectService.updateStatus(businessUnitHandle.getBusinessid()); - - /* - 修改接单人 - */ - OverhaulItemProject overhaulItemProject = new OverhaulItemProject(); - overhaulItemProject.setId(businessUnitHandle.getBusinessid()); - overhaulItemProject.setReceiveUserId(cu.getId()); - overhaulItemProjectService.update(overhaulItemProject); - - } catch (Exception e) { - e.printStackTrace(); - result=0; - } - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitHandle.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /* - 显示工单验收页面 - */ - @RequestMapping("/showAudit.do") - public String showAudit(HttpServletRequest request,Model model){ - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit=new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String jobId= pInstance.getBusinessKey(); - OverhaulItemProject overhaulItemProject = this.overhaulItemProjectService.selectById(jobId); - model.addAttribute("overhaulItemProject",overhaulItemProject); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls=workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size()>0) { - model.addAttribute("showTargetUsersFlag", true); - }else{ - model.addAttribute("showTargetUsersFlag", false); - } - return "workorder/overhaulItemProjectAudit"; - } - - /** - * 工单验收 - * @param request - * @param model - * @param businessUnitAudit - * @return - */ - @RequestMapping("/doAuditProcess.do") - public String doAuditProcess(HttpServletRequest request,Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit){ - User cu= (User)request.getSession().getAttribute("cu"); - int result=0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result =this.overhaulItemProjectService.doAudit(businessUnitAudit); - String resstr="{\"res\":\""+result+"\",\"id\":\""+businessUnitAudit.getId()+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 异步计算总工时和剩余工时 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/doCountWorkingHours.do") - public String doCountWorkingHours(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - String difficultyDegreeStr = request.getParameter("difficultyDegree");//难度系数 - String workEvaluateScoreStr = request.getParameter("workEvaluateScore");//评价得分 - float workAlltime = 0;//绩效总工时 - float actAlltime = 0;//绩效总工时 - float surplustime = 0;//剩余工时 - float consumeTime = 0;//消耗工时 - float difficultyDegree = 0; - float workEvaluateScore = 0; - - //查询总工时 - List list = overhaulItemContentService.selectListByWhere("where item_id = '"+id+"'"); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - workAlltime += list.get(i).getWorkingHours(); - } - } - if(difficultyDegreeStr!=null && !difficultyDegreeStr.equals("")){ - difficultyDegree = Float.parseFloat(difficultyDegreeStr); - } - if(workEvaluateScoreStr!=null && !workEvaluateScoreStr.equals("")){ - workEvaluateScore = Float.parseFloat(workEvaluateScoreStr); - } - - //计算总工时 - actAlltime = workAlltime * difficultyDegree * workEvaluateScore/100; - - List listach = workorderAchievementService.selectListByWhere("where pid = '"+id+"'"); - if(listach!=null && listach.size()>0){ - for (int i = 0; i < listach.size(); i++) { - consumeTime += listach.get(i).getWorkTime(); - } - } - - //计算剩余工时 - surplustime = actAlltime - consumeTime; - - String resstr="{\"workAlltime\":\""+workAlltime+"\",\"actAlltime\":\""+actAlltime+"\",\"surplustime\":\""+ surplustime +"\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 异步修改难度系数和评价得分 - * @param request - * @param model - * @param - * @return - */ - @RequestMapping("/doRevise.do") - public String doRevise(HttpServletRequest request,Model model){ - String id = request.getParameter("id"); - String difficultyDegreeStr = request.getParameter("difficultyDegree");//难度系数 - String workEvaluateScoreStr = request.getParameter("workEvaluateScore");//评价得分 - int result=0; - - float difficultyDegree = 0; - float workEvaluateScore = 0; - if(difficultyDegreeStr!=null && !difficultyDegreeStr.equals("")){ - difficultyDegree = Float.parseFloat(difficultyDegreeStr); - } - if(workEvaluateScoreStr!=null && !workEvaluateScoreStr.equals("")){ - workEvaluateScore = Float.parseFloat(workEvaluateScoreStr); - } - - OverhaulItemProject overhaulItemProject = new OverhaulItemProject(); - overhaulItemProject.setId(id); - overhaulItemProject.setDifficultyDegree(difficultyDegree); - overhaulItemProject.setWorkEvaluateScore(workEvaluateScore); - result =this.overhaulItemProjectService.update(overhaulItemProject); - - String resstr="{\"res\":\""+result+"\",\"id\":\""+id+"\"}"; - model.addAttribute("result", resstr); - return "result"; - } -} diff --git a/src/com/sipai/controller/workorder/OverhaulTypeController.java b/src/com/sipai/controller/workorder/OverhaulTypeController.java deleted file mode 100644 index e1b9cac6..00000000 --- a/src/com/sipai/controller/workorder/OverhaulTypeController.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.controller.workorder; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.workorder.OverhaulType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.workorder.OverhaulTypeService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Controller -@RequestMapping("/workorder/overhaulType") -public class OverhaulTypeController { - @Resource - private OverhaulTypeService overhaulTypeService; - - @RequestMapping("/showList.do") - public String showlist(HttpServletRequest request, Model model) { - return "/workorder/overhaulTypeList"; - } - @RequestMapping("/getList.do") - public ModelAndView getList(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required=false) String sort, - @RequestParam(value = "order", required=false) String order) { - User cu=(User)request.getSession().getAttribute("cu"); - if(sort==null || sort.equals("id")){ - sort = " insdt "; - } - if(order==null){ - order = " desc "; - } - String orderstr=" order by "+sort+" "+order; - - String wherestr= "where 1=1 "; - - PageHelper.startPage(page, rows); - List list = this.overhaulTypeService.selectListByWhere(wherestr+orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json=JSONArray.fromObject(list); - - String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}"; - model.addAttribute("result",result); - return new ModelAndView("result"); - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request,Model model){ - request.setAttribute("id", CommUtil.getUUID()); - return "workorder/overhaulTypeAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - OverhaulType overhaulType = this.overhaulTypeService.selectById(id); - model.addAttribute("overhaulType",overhaulType); - return "workorder/overhaulTypeEdit"; - } - - @RequestMapping("/doview.do") - public String doview(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - OverhaulType overhaulType = this.overhaulTypeService.selectById(id); - model.addAttribute("overhaulType",overhaulType ); - return "workorder/overhaulTypeView"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request,Model model, - @ModelAttribute("overhaulType") OverhaulType overhaulType){ - User cu= (User)request.getSession().getAttribute("cu"); - int result = this.overhaulTypeService.save(overhaulType); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request,Model model, - @ModelAttribute("overhaulType") OverhaulType overhaulType){ - int result = this.overhaulTypeService.update(overhaulType); - model.addAttribute("result","{\"res\":\""+result+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodelete(HttpServletRequest request,Model model, - @RequestParam(value="id") String id){ - String msg = ""; - int result = this.overhaulTypeService.deleteById(id); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dodeletes.do") - public ModelAndView dodeletes(HttpServletRequest request,Model model, - @RequestParam(value="ids") String ids){ - String msg = ""; - ids=ids.replace(",","','"); - int result = this.overhaulTypeService.deleteByWhere("where id in('"+ids+"')"); - model.addAttribute("result","{\"res\":\""+result+"\",\"msg\":\""+msg+"\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/getSelectList.do") - public String getSelectList(HttpServletRequest request,Model model) { - String orderstr=" order by morder"; - String wherestr= "where 1=1 and active = '"+ CommString.Flag_Active +"'"; - - List list = this.overhaulTypeService.selectListByWhere(wherestr+orderstr); - JSONArray json = new JSONArray(); - if(list!=null && list.size()>0){ - for(int i=0;i list = this.workorderAchievementService.selectListByWhere(wherestr + orderstr); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "/showUserWorkList.do") - public String showUserWorkList(HttpServletRequest request, Model model, - @RequestParam(value = "sdtAndEdt", required = true) String sdtAndEdt, - @RequestParam(value = "userId", required = false) String userId, - @RequestParam(value = "type", required = false) String type) { - request.setAttribute("sdtAndEdt", sdtAndEdt); - request.setAttribute("userId", userId); - request.setAttribute("type", type); - return "workorder/workorderList"; - } - - /** - * 获取list数据 - */ - @RequestMapping("/getListByUserId.do") - public ModelAndView getListByUserId(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows) { - String userId = request.getParameter("userId"); - String type = request.getParameter("type"); - String sdtAndEdt = request.getParameter("sdtAndEdt"); - String orderstr = ""; - String wherestr = " where 1=1"; - if (StringUtils.isNotBlank(userId)) { - wherestr += " and a.user_id = '" + userId + "'"; - } - if (StringUtils.isNotBlank(userId)) { - if (type.equals("P") || type.equals("E")) { - wherestr += " and m.status = '" + 3 + "'"; - orderstr = " start_time desc "; - } else { - wherestr += " and m.status = 'finish'"; - orderstr = " complete_date desc "; - } - wherestr += " and m.type = '" + type + "'"; - } - if (StringUtils.isNotBlank(sdtAndEdt)) { - String startTime = ""; - String endTime = ""; - if (sdtAndEdt != null && !sdtAndEdt.equals("")) { - String[] str = sdtAndEdt.split("~"); - startTime = str[0]; - endTime = str[1]; - } - if (type.equals("P") || type.equals("E")) { - wherestr += "and start_time between '" + startTime + "' and '" + endTime + "'"; - } else { - wherestr += "and complete_date between '" + startTime + "' and '" + endTime + "'"; - } - - } - PageHelper.startPage(page, rows, orderstr); - List list = new ArrayList<>(); - try { - list = this.workorderAchievementService.selectByWhere4Detail(type, wherestr); - } catch (Exception e) { - e.printStackTrace(); - } - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getListNew.do") - public ModelAndView getListNew(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String pid = request.getParameter("pid"); - if (sort == null) { - sort = " id "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1"; - if (pid != null && !pid.isEmpty()) { - wherestr += " and pid = '" + pid + "'"; - } - PageHelper.startPage(page, rows); - Map vmap = new LinkedHashMap<>(); - List list = this.workorderAchievementService.selectListByWhere(wherestr + orderstr); - for (int i = 0; i < list.size(); i++) { - User user = userService.getUserById(list.get(i).getUserId()); - list.get(i).setUser(user); - vmap.put(String.valueOf(i + 1), list.get(i)); - } - JSONObject json = new JSONObject(); - json = json.fromObject(vmap); - request.setAttribute("result", json); - return new ModelAndView("result"); - } - - @RequestMapping("/dodelete.do") - public ModelAndView dodel(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - int res = this.workorderAchievementService.deleteById(id); - if (res == 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return new ModelAndView("result"); - } - - /** - * 删除多条数据 - */ - @RequestMapping("/dodeletes.do") - public String dodels(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.workorderAchievementService.deleteByWhere("where id in ('" + ids + "')"); - if (res >= 1) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("操作失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model) { - request.setAttribute("uuId2", CommUtil.getUUID()); - System.out.println(CommUtil.getUUID()); - return "workorder/workorderAchievementAdd"; - } - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("workorderAchievement") WorkorderAchievement workorderAchievement) { -// User cu= (User)request.getSession().getAttribute("cu"); -// workorderAchievement.setId(CommUtil.getUUID()); -// workorderAchievement.setInsdt(CommUtil.nowDate()); -// workorderAchievement.setInsuser(cu.getId()); - int result = this.workorderAchievementService.save(workorderAchievement); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WorkorderAchievement workorderAchievement = this.workorderAchievementService.selectById(id); - model.addAttribute("workorderAchievement", workorderAchievement); - //人名 - if (workorderAchievement != null) { - User user = userService.getUserById(workorderAchievement.getUserId()); - if (user != null) { - model.addAttribute("userName", user.getCaption()); - } - } - return "workorder/workorderAchievementEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("workorderAchievement") WorkorderAchievement workorderAchievement) { - int result = this.workorderAchievementService.update(workorderAchievement); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/doworkTimeTotal.do") - public ModelAndView workTimeTotal(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - - String id = request.getParameter("id"); - String bizid = request.getParameter("bizid"); - String showdata = request.getParameter("showdata"); - String st = ""; - if (request.getParameter("st") != null) { - st = request.getParameter("st"); - } - - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, Integer.parseInt(showdata.substring(0, 4))); - a.set(Calendar.MONTH, Integer.parseInt(showdata.substring(5, 7)) - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDateM = a.get(Calendar.DATE);//当前月天数 - - WorkorderAchievementOrder workorderAchievementOrder = this.workorderAchievementOrderService.selectById(id); - - JSONArray jsonArray = new JSONArray(); - - java.text.DecimalFormat df = new java.text.DecimalFormat("#.0"); - - if (workorderAchievementOrder.getTbType().equals("patrolRecord_P")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='P' and status='3' "; - List list = this.patrolRecordService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(patrolRecord.getWorkerId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", patrolRecord.get_num()); - jsonObject.put("workHour", df.format(patrolRecord.getDuration() / 60)); - jsonArray.add(jsonObject); - } - } - - } else if (workorderAchievementOrder.getTbType().equals("patrolRecord_E")) { - String wString = "where start_time >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and start_time <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='E' and status='3' "; - List list = this.patrolRecordService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(patrolRecord.getWorkerId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", patrolRecord.get_num()); - jsonObject.put("workHour", df.format(patrolRecord.getDuration() / 60)); - jsonArray.add(jsonObject); - } - } - - } else if (workorderAchievementOrder.getTbType().equals("workorderRepair")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.REPAIR + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - String mainIds = ""; - for (WorkorderDetail workorderDetail : - list) { - mainIds += workorderDetail.getId() + ","; - } - mainIds = mainIds.replace(",", "','"); - List timelist = this.workorderAchievementService.selectDistinctWorkTimeByWhere(" where pid in ('" + mainIds + "') "); - if (list != null && list.size() > 0) { - for (WorkorderAchievement workorderAchievement : - timelist) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(workorderAchievement.getUserId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderAchievement.get_num()); - jsonObject.put("workHour", workorderAchievement.getWorkTime()); - jsonArray.add(jsonObject); - } - } - - } - - } else if (workorderAchievementOrder.getTbType().equals("workorderMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and type='" + WorkorderDetail.MAINTAIN + "' "; - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - String mainIds = ""; - for (WorkorderDetail workorderDetail : - list) { - mainIds += workorderDetail.getId() + ","; - } - mainIds = mainIds.replace(",", "','"); - List timelist = this.workorderAchievementService.selectDistinctWorkTimeByWhere(" where pid in ('" + mainIds + "') "); - if (list != null && list.size() > 0) { - for (WorkorderAchievement workorderAchievement : - timelist) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(workorderAchievement.getUserId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderAchievement.get_num()); - jsonObject.put("workHour", workorderAchievement.getWorkTime()); - jsonArray.add(jsonObject); - } - } - } - } else if (workorderAchievementOrder.getTbType().equals("repairAndMaintain")) { - String wString = "where complete_date >= '" + showdata.substring(0, 7) + "-" + (01) + " 00:00' and complete_date <= '" + showdata.substring(0, 7) + "-" + (maxDateM) + " 23:59' and unit_id='" + bizid + "' and (type='" + WorkorderDetail.REPAIR + "' or type='" + WorkorderDetail.MAINTAIN + "') "; - - List list = this.workorderDetailService.selectListByWhere(wString + " and status = '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - String mainIds = ""; - for (WorkorderDetail workorderDetail : - list) { - mainIds += workorderDetail.getId() + ","; - } - mainIds = mainIds.replace(",", "','"); - List timelist = this.workorderAchievementService.selectDistinctWorkTimeByWhere(" where pid in ('" + mainIds + "') "); - if (list != null && list.size() > 0) { - for (WorkorderAchievement workorderAchievement : - timelist) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(workorderAchievement.getUserId()); - if (!st.equals("全部")) { -// String selectSt =""; -// if (st == "repairSelect") { -// selectSt = "机电维修班"; -// } else if (st == "autoSelect") { -// selectSt = "自动化班"; -// } - List deptList = this.unitService.selectListByWhere(" where name like '%" + st + "%' and id='" + user.getPid() + "' "); - if (deptList != null && deptList.size() > 0) { - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderAchievement.get_num()); - jsonObject.put("workHour", workorderAchievement.getWorkTime()); - jsonArray.add(jsonObject); - } - } else { - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderAchievement.get_num()); - jsonObject.put("workHour", workorderAchievement.getWorkTime()); - jsonArray.add(jsonObject); - } - - } - } - } - } - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("data", jsonArray); -// System.out.println(jsonArray); - jsonObject.put("type", workorderAchievementOrder.getTbType()); - - request.setAttribute("result", jsonObject); - return new ModelAndView("result"); - } - - @RequestMapping("/getOrderJson.do") - public ModelAndView getOrderJson(HttpServletRequest request, Model model) { - String id = request.getParameter("id"); - WorkorderAchievementOrder workorderAchievementOrder = this.workorderAchievementOrderService.selectById(id); - JSONArray json = JSONArray.fromObject(workorderAchievementOrder); - request.setAttribute("result", json); - return new ModelAndView("result"); - } - - @ApiOperation(value = "人员工时统计页面", notes = "人员工时统计页面", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - //无参数 - }) - @RequestMapping(value = "/showListWorkingHours.do", method = RequestMethod.GET) - public String showListWorkingHours(HttpServletRequest request, Model model) { - request.setAttribute("monthStartDate", CommUtil.nowDate().substring(0, 7) + "-01 00:00"); - return "workorder/workorderDetailWorkingHours"; - } - - @ApiOperation(value = "人员工时统计列表", notes = "人员工时统计列表", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "sdtAndEdt", value = "时间范围", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "unitId", value = "厂Id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "userName", value = "人员姓名", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "groupTypeId", value = "班组类型id (如:运行班、化验班)", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "groupDetailId", value = "班组类型id (如:运行1班、运行2班)", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/getListWorkingHours.do", method = RequestMethod.GET) - @ResponseBody - public ModelAndView getListWorkingHours(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order, - @RequestParam(value = "sdtAndEdt", required = true) String sdtAndEdt, - @RequestParam(value = "unitId", required = true) String unitId, - @RequestParam(value = "userName", required = false) String userName, - @RequestParam(value = "groupTypeId", required = false) String groupTypeId, - @RequestParam(value = "groupDetailId", required = false) String groupDetailId) { - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = "where 1=1 "; - - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - - String wherestr_groupDetail = "where 1=1 "; - //厂区筛选 - if (unitId != null && !unitId.isEmpty()) { - wherestr_groupDetail += " and unit_id= '" + unitId + "' "; - } - //班组类型筛选 - if (groupTypeId != null && !groupTypeId.isEmpty() && !groupTypeId.equals("-1")) { - wherestr_groupDetail += " and grouptype_id= '" + groupTypeId + "' "; - } - PageHelper.startPage(page, rows); - List list = this.groupDetailService.selectListByWhere(wherestr_groupDetail + orderstr); -// PageInfo pi = new PageInfo(list); - Set set = new HashSet<>(); - String userIds = ""; - //所有userId拼成一个字符串 - for (GroupDetail groupDetail : list) { - userIds += groupDetail.getLeader() + ","; - userIds += groupDetail.getMembers() + ","; - } - String[] userId = userIds.split(","); - String sql_id = "'',"; - //所有userId拼成sql - if (userId != null && userId.length > 0) { - for (String u_id : userId) { - sql_id += "'" + u_id + "',"; - } - } - sql_id = sql_id.substring(0, sql_id.length() - 1); - - String user_sql = "where 1=1 and tu.id in (" + sql_id + ")"; - if (userName != null && !userName.trim().equals("")) { - user_sql += " and tu.caption like '%" + userName + "%'"; - } - - List workTimeRespDtos = workorderAchievementService.selectByWhereSumWorkTimeByWhere(user_sql, sdtAndEdt); -// List userList = userService.selectListByWhere(user_sql); -// if (userList != null && userList.size() > 0) { -// for (int i = 0; i < userList.size(); i++) { -// com.alibaba.fastjson.JSONObject json = this.workorderAchievementService.getListWorkingHours(wherestr, sdtAndEdt, userList.get(i).getId(), userList.get(i).getCaption()); -// jsonArray.add(json); -// } -// } - -// String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + CommUtil.toJson(workTimeRespDtos) + "}"; - String result = "{\"total\":" + workTimeRespDtos.size() + ",\"rows\":" + CommUtil.toJson(workTimeRespDtos) + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping(value = "/getUserOneWorkingHours.do") - public String getUserOneWorkingHours(HttpServletRequest request, Model model, - @RequestParam(value = "sdtAndEdt", required = true) String sdtAndEdt, - @RequestParam(value = "userId", required = false) String userId) { - request.setAttribute("sdtAndEdt", sdtAndEdt); - request.setAttribute("userId", userId); - String user_sql = "where 1=1 and tu.id = '" + userId + "'"; - WorkUserTimeRespDto workUserTimeRespDto = workorderAchievementService.selectUserOneByWhereSumWorkTimeByWhere(user_sql, sdtAndEdt); - request.setAttribute("workUserTimeRespDto", workUserTimeRespDto); - return "workorder/workorderUserTimeView"; - } - - /** - * 导出 - */ - @RequestMapping(value = "/doExport.do") - public ModelAndView doExport(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "unitId") String unitId) throws IOException { - //导出文件到指定目录,兼容Linux - this.workorderAchievementService.doExport(unitId, request, response); - return null; - } - - @RequestMapping("/getAchievementWorkPeopleData.do") - public ModelAndView getAchievementWorkPeopleData(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); -// String showdata = request.getParameter("showdata"); -// String dateType = request.getParameter("dateType"); - String bzIds = request.getParameter("bzIds"); - - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - bzIds = bzIds.replace(",", "','"); - - List workOrderList = this.workorderAchievementOrderService.selectListByWhere("where stu_type='1' order by id "); - -// JSONArray jsonArray = new JSONArray(); - - JSONObject workOrderjsonObject = new JSONObject(); - - JSONArray peoplejsonArray = new JSONArray(); - JSONArray chartjsonArray = new JSONArray(); - - List groupDetailList = this.groupDetailService.selectListByWhere(" where id in ('" + bzIds + "') "); - for (GroupDetail groupDetail : - groupDetailList) { - String peoples = groupDetail.getLeader() + "," + groupDetail.getMembers(); - peoples = peoples.replace(",", "','"); - - for (WorkorderAchievementOrder workorderAchievementOrder : - workOrderList) { - - String tbType = workorderAchievementOrder.getTbType(); - - java.text.DecimalFormat df = new java.text.DecimalFormat("#.0"); - if (tbType.equals(WorkorderAchievementOrder.TbType_P)) { - String wString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and worker_id in ('" + peoples + "') and unit_id='" + bizid + "' and type='P' and status='3' "; - List list = this.patrolRecordService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(patrolRecord.getWorkerId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", patrolRecord.get_num()); - jsonObject.put("workHour", df.format(patrolRecord.getDuration() / 60)); - jsonObject.put("bzName", groupDetail.getName()); - jsonObject.put("grabOrdersNum", "-"); - peoplejsonArray.add(jsonObject); - - } - } - } else if (tbType.equals(WorkorderAchievementOrder.TbType_E)) { - String wString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and worker_id in ('" + peoples + "') and unit_id='" + bizid + "' and type='E' and status='3' "; - List list = this.patrolRecordService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(patrolRecord.getWorkerId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", patrolRecord.get_num()); - jsonObject.put("workHour", df.format(patrolRecord.getDuration() / 60)); - jsonObject.put("bzName", groupDetail.getName()); - jsonObject.put("grabOrdersNum", "-"); - peoplejsonArray.add(jsonObject); - - } - } - } else if (tbType.equals(WorkorderAchievementOrder.TbType_R)) { - String wString = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and user_id in ('" + peoples + "') and unit_id='" + bizid + "' and wd.type='" + WorkorderDetail.REPAIR + "' and wd.status = '" + WorkorderDetail.Status_Finish + "' "; - List list = this.workorderDetailService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(workorderDetail.getReceiveUserId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderDetail.get_num()); - jsonObject.put("workHour", workorderDetail.getWorkTime()); - jsonObject.put("bzName", groupDetail.getName()); - //获取抢单数 - String grabOrdersType = WorkorderDetail.REPAIR + ","; - grabOrdersType = grabOrdersType.replace(",", "','"); - int grabOrdersNum = this.workorderDetailService.getGrabOrdersNum(workorderDetail.getReceiveUserId(), sdt, edt, bizid, grabOrdersType); - jsonObject.put("grabOrdersNum", grabOrdersNum); - peoplejsonArray.add(jsonObject); - - } - } - } else if (tbType.equals(WorkorderAchievementOrder.TbType_M)) { - String wString = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and user_id in ('" + peoples + "') and unit_id='" + bizid + "' and wd.type='" + WorkorderDetail.MAINTAIN + "' and wd.status = '" + WorkorderDetail.Status_Finish + "' "; - List list = this.workorderDetailService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(workorderDetail.getReceiveUserId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderDetail.get_num()); - jsonObject.put("workHour", workorderDetail.getWorkTime()); - jsonObject.put("bzName", groupDetail.getName()); - //获取抢单数 - String grabOrdersType = WorkorderDetail.MAINTAIN + ","; - grabOrdersType = grabOrdersType.replace(",", "','"); - int grabOrdersNum = this.workorderDetailService.getGrabOrdersNum(workorderDetail.getReceiveUserId(), sdt, edt, bizid, grabOrdersType); - jsonObject.put("grabOrdersNum", grabOrdersNum); - peoplejsonArray.add(jsonObject); - - } - } - } else if (tbType.equals(WorkorderAchievementOrder.TbType_RM)) { - String wString = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and user_id in ('" + peoples + "') and unit_id='" + bizid + "' and (wd.type='" + WorkorderDetail.REPAIR + "' or wd.type='" + WorkorderDetail.MAINTAIN + "') and wd.status = '" + WorkorderDetail.Status_Finish + "' "; - List list = this.workorderDetailService.selectDistinctWorkTimeByWhere(wString); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : - list) { - JSONObject jsonObject = new JSONObject(); - User user = this.userService.getUserById(workorderDetail.getReceiveUserId()); - if (user != null) { - jsonObject.put("workMan", user.getCaption()); - } else { - jsonObject.put("workMan", "-"); - } - jsonObject.put("havenDoneWork", workorderDetail.get_num()); - jsonObject.put("workHour", workorderDetail.getWorkTime()); - jsonObject.put("bzName", groupDetail.getName()); - String grabOrdersType = WorkorderDetail.REPAIR + "," + WorkorderDetail.MAINTAIN + ","; - grabOrdersType = grabOrdersType.replace(",", "','"); - int grabOrdersNum = this.workorderDetailService.getGrabOrdersNum(workorderDetail.getReceiveUserId(), sdt, edt, bizid, grabOrdersType); - jsonObject.put("grabOrdersNum", grabOrdersNum); - peoplejsonArray.add(jsonObject); - - } - } - } - } - - JSONArray chartDatajsonArray = new JSONArray(); - - String chartWString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and worker_id in ('" + peoples + "') and unit_id='" + bizid + "' and (type='P' or type='E') and status='3' "; - List list2 = this.patrolRecordService.selectForAchievementWork(chartWString); - if (list2 != null && list2.size() > 0) { - for (PatrolRecord patrolRecord : - list2) { - JSONArray chartDataDjsonArray = new JSONArray(); - chartDataDjsonArray.add(patrolRecord.getStartTime()); - chartDataDjsonArray.add(patrolRecord.get_num()); - chartDatajsonArray.add(chartDataDjsonArray); - } - } - - String chartWString2 = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and user_id in ('" + peoples + "') and unit_id='" + bizid + "' and (wd.type='" + WorkorderDetail.REPAIR + "' or wd.type='" + WorkorderDetail.MAINTAIN + "') and wd.status = '" + WorkorderDetail.Status_Finish + "' "; - List list3 = this.workorderDetailService.selectForAchievementWork(chartWString2); - if (list3 != null && list3.size() > 0) { - for (WorkorderDetail workorderDetail : - list3) { - JSONArray chartDataDjsonArray = new JSONArray(); - chartDataDjsonArray.add(workorderDetail.getCompleteDate()); - chartDataDjsonArray.add(workorderDetail.get_num()); - chartDatajsonArray.add(chartDataDjsonArray); - } - } - - JSONObject chartjsonObject = new JSONObject(); - chartjsonObject.put("name", groupDetail.getName()); - chartjsonObject.put("data", chartDatajsonArray); - chartjsonArray.add(chartjsonObject); - } - - workOrderjsonObject.put("people", peoplejsonArray); - workOrderjsonObject.put("chart", chartjsonArray); -// jsonArray.add(workOrderjsonObject); - -// System.out.println(workOrderjsonObject); - request.setAttribute("result", workOrderjsonObject); - return new ModelAndView("result"); - } - - @RequestMapping("/getAchievementWorkData.do") - public ModelAndView getAchievementWorkData(HttpServletRequest request, Model model) { - String bizid = request.getParameter("bizid"); -// String showdata = request.getParameter("showdata"); -// String dateType = request.getParameter("dateType"); - String sdt = request.getParameter("sdt"); - String edt = request.getParameter("edt"); - - List workOrderList = this.workorderAchievementOrderService.selectListByWhere("where stu_type='1' order by id "); - - JSONArray jsonArray = new JSONArray(); - - if (workOrderList != null && workOrderList.size() > 0) { - for (WorkorderAchievementOrder workorderAchievementOrder : - workOrderList) { - - JSONObject workOrderjsonObject = new JSONObject(); - - String tbType = workorderAchievementOrder.getTbType(); - - workOrderjsonObject.put("tbType", tbType); - workOrderjsonObject.put("tbName", workorderAchievementOrder.getName()); - java.text.DecimalFormat df = new java.text.DecimalFormat("#.0"); - if (tbType.equals(WorkorderAchievementOrder.TbType_P)) { - JSONArray havenDoneWorkChartDatajsonArray = new JSONArray();//已完成工单 - JSONArray workTimeChartDatajsonArray = new JSONArray();//消耗工时 - JSONArray unhavenDoneWorkChartDatajsonArray = new JSONArray();//未完成工单 - int totalWorkNum = 0;//总工单数 - int totalWorkTimeNum = 0;// - int totalCompleteWorkNum = 0; - int totalUnCompleteWorkNum = 0; - - String wString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and unit_id='" + bizid + "' and type='P' and status='3' "; - String unCompleteWString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and unit_id='" + bizid + "' and type='P' and status!='3' "; - List list = this.patrolRecordService.selectForAchievementWork(wString); - List dislist = this.patrolRecordService.selectForAchievementWork(unCompleteWString); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : - list) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(patrolRecord.getStartTime()); - workOrderJSONArrayD.add(patrolRecord.get_num()); - havenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - JSONArray workOrderJSONArrayD2 = new JSONArray(); - workOrderJSONArrayD2.add(patrolRecord.getStartTime()); - workOrderJSONArrayD2.add(df.format(patrolRecord.getDuration() / 60)); - workTimeChartDatajsonArray.add(workOrderJSONArrayD2); - - totalCompleteWorkNum += Integer.valueOf(patrolRecord.get_num()); - totalWorkTimeNum += patrolRecord.getDuration() / 60; - } - } - if (dislist != null && dislist.size() > 0) { - for (PatrolRecord patrolRecord : - dislist) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(patrolRecord.getStartTime()); - workOrderJSONArrayD.add(patrolRecord.get_num()); - unhavenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - totalUnCompleteWorkNum += Integer.valueOf(patrolRecord.get_num()); - } - } - workOrderjsonObject.put("havenDoneWorkChartData", havenDoneWorkChartDatajsonArray); - workOrderjsonObject.put("workTimeChartData", workTimeChartDatajsonArray); - workOrderjsonObject.put("unhavenDoneWorkChartData", unhavenDoneWorkChartDatajsonArray); - - totalWorkNum = totalCompleteWorkNum + totalUnCompleteWorkNum; - - workOrderjsonObject.put("totalWorkNum", totalWorkNum); - workOrderjsonObject.put("totalWorkTimeNum", totalWorkTimeNum); - workOrderjsonObject.put("totalCompleteWorkNum", totalCompleteWorkNum); - workOrderjsonObject.put("totalUnCompleteWorkNum", totalUnCompleteWorkNum); - } else if (tbType.equals(WorkorderAchievementOrder.TbType_E)) { - JSONArray havenDoneWorkChartDatajsonArray = new JSONArray();//已完成工单 - JSONArray workTimeChartDatajsonArray = new JSONArray();//消耗工时 - JSONArray unhavenDoneWorkChartDatajsonArray = new JSONArray();//未完成工单 - int totalWorkNum = 0;//总工单数 - int totalWorkTimeNum = 0;// - int totalCompleteWorkNum = 0; - int totalUnCompleteWorkNum = 0; - - String wString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and unit_id='" + bizid + "' and type='E' and status='3' "; - String unCompleteWString = "where (start_time>='" + sdt + "' and start_time<='" + edt + "') and unit_id='" + bizid + "' and type='E' and status!='3' "; - List list = this.patrolRecordService.selectForAchievementWork(wString); - List dislist = this.patrolRecordService.selectForAchievementWork(unCompleteWString); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : - list) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(patrolRecord.getStartTime()); - workOrderJSONArrayD.add(patrolRecord.get_num()); - havenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - JSONArray workOrderJSONArrayD2 = new JSONArray(); - workOrderJSONArrayD2.add(patrolRecord.getStartTime()); - workOrderJSONArrayD2.add(df.format(patrolRecord.getDuration() / 60)); - workTimeChartDatajsonArray.add(workOrderJSONArrayD2); - - totalCompleteWorkNum += Integer.valueOf(patrolRecord.get_num()); - totalWorkTimeNum += patrolRecord.getDuration() / 60; - } - } - if (dislist != null && dislist.size() > 0) { - for (PatrolRecord patrolRecord : - dislist) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(patrolRecord.getStartTime()); - workOrderJSONArrayD.add(patrolRecord.get_num()); - unhavenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - totalUnCompleteWorkNum += Integer.valueOf(patrolRecord.get_num()); - } - } - workOrderjsonObject.put("havenDoneWorkChartData", havenDoneWorkChartDatajsonArray); - workOrderjsonObject.put("workTimeChartData", workTimeChartDatajsonArray); - workOrderjsonObject.put("unhavenDoneWorkChartData", unhavenDoneWorkChartDatajsonArray); - - totalWorkNum = totalCompleteWorkNum + totalUnCompleteWorkNum; - - workOrderjsonObject.put("totalWorkNum", totalWorkNum); - workOrderjsonObject.put("totalWorkTimeNum", totalWorkTimeNum); - workOrderjsonObject.put("totalCompleteWorkNum", totalCompleteWorkNum); - workOrderjsonObject.put("totalUnCompleteWorkNum", totalUnCompleteWorkNum); - } else if (tbType.equals(WorkorderAchievementOrder.TbType_R)) { - JSONArray havenDoneWorkChartDatajsonArray = new JSONArray();//已完成工单 - JSONArray workTimeChartDatajsonArray = new JSONArray();//消耗工时 - JSONArray unhavenDoneWorkChartDatajsonArray = new JSONArray();//未完成工单 - int totalWorkNum = 0;//总工单数 - int totalWorkTimeNum = 0;// - int totalCompleteWorkNum = 0; - int totalUnCompleteWorkNum = 0; - - String wString = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and unit_id='" + bizid + "' and wd.type='" + WorkorderDetail.REPAIR + "' "; - List list = this.workorderDetailService.selectForAchievementWork(wString + " and wd.status = '" + WorkorderDetail.Status_Finish + "' "); - List dislist = this.workorderDetailService.selectForAchievementWork(wString + " and wd.status != '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : - list) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD.add(workorderDetail.get_num()); - havenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - JSONArray workOrderJSONArrayD2 = new JSONArray(); - workOrderJSONArrayD2.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD2.add(workorderDetail.getWorkTime()); - workTimeChartDatajsonArray.add(workOrderJSONArrayD2); - - totalCompleteWorkNum += workorderDetail.get_num(); - totalWorkTimeNum += workorderDetail.getWorkTime(); - } - } - if (dislist != null && dislist.size() > 0) { - for (WorkorderDetail workorderDetail : - dislist) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD.add(workorderDetail.get_num()); - unhavenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - totalUnCompleteWorkNum += workorderDetail.get_num(); - } - } - workOrderjsonObject.put("havenDoneWorkChartData", havenDoneWorkChartDatajsonArray); - workOrderjsonObject.put("workTimeChartData", workTimeChartDatajsonArray); - workOrderjsonObject.put("unhavenDoneWorkChartData", unhavenDoneWorkChartDatajsonArray); - - totalWorkNum = totalCompleteWorkNum + totalUnCompleteWorkNum; - - workOrderjsonObject.put("totalWorkNum", totalWorkNum); - workOrderjsonObject.put("totalWorkTimeNum", totalWorkTimeNum); - workOrderjsonObject.put("totalCompleteWorkNum", totalCompleteWorkNum); - workOrderjsonObject.put("totalUnCompleteWorkNum", totalUnCompleteWorkNum); - - - } else if (tbType.equals(WorkorderAchievementOrder.TbType_M)) { - JSONArray havenDoneWorkChartDatajsonArray = new JSONArray();//已完成工单 - JSONArray workTimeChartDatajsonArray = new JSONArray();//消耗工时 - JSONArray unhavenDoneWorkChartDatajsonArray = new JSONArray();//未完成工单 - int totalWorkNum = 0;//总工单数 - int totalWorkTimeNum = 0;// - int totalCompleteWorkNum = 0; - int totalUnCompleteWorkNum = 0; - - String wString = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and unit_id='" + bizid + "' and wd.type='" + WorkorderDetail.MAINTAIN + "' "; - List list = this.workorderDetailService.selectForAchievementWork(wString + " and wd.status = '" + WorkorderDetail.Status_Finish + "' "); - List dislist = this.workorderDetailService.selectForAchievementWork(wString + " and wd.status != '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : - list) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD.add(workorderDetail.get_num()); - havenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - JSONArray workOrderJSONArrayD2 = new JSONArray(); - workOrderJSONArrayD2.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD2.add(workorderDetail.getWorkTime()); - workTimeChartDatajsonArray.add(workOrderJSONArrayD2); - - totalCompleteWorkNum += workorderDetail.get_num(); - totalWorkTimeNum += workorderDetail.getWorkTime(); - } - } - if (dislist != null && dislist.size() > 0) { - for (WorkorderDetail workorderDetail : - dislist) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD.add(workorderDetail.get_num()); - unhavenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - totalUnCompleteWorkNum += workorderDetail.get_num(); - } - } - workOrderjsonObject.put("havenDoneWorkChartData", havenDoneWorkChartDatajsonArray); - workOrderjsonObject.put("workTimeChartData", workTimeChartDatajsonArray); - workOrderjsonObject.put("unhavenDoneWorkChartData", unhavenDoneWorkChartDatajsonArray); - - totalWorkNum = totalCompleteWorkNum + totalUnCompleteWorkNum; - - workOrderjsonObject.put("totalWorkNum", totalWorkNum); - workOrderjsonObject.put("totalWorkTimeNum", totalWorkTimeNum); - workOrderjsonObject.put("totalCompleteWorkNum", totalCompleteWorkNum); - workOrderjsonObject.put("totalUnCompleteWorkNum", totalUnCompleteWorkNum); - - - } else if (tbType.equals(WorkorderAchievementOrder.TbType_RM)) { - JSONArray havenDoneWorkChartDatajsonArray = new JSONArray();//已完成工单 - JSONArray workTimeChartDatajsonArray = new JSONArray();//消耗工时 - JSONArray unhavenDoneWorkChartDatajsonArray = new JSONArray();//未完成工单 - int totalWorkNum = 0;//总工单数 - int totalWorkTimeNum = 0;// - int totalCompleteWorkNum = 0; - int totalUnCompleteWorkNum = 0; - - String wString = "where (complete_date>='" + sdt + "' and complete_date<='" + edt + "') and unit_id='" + bizid + "' and (wd.type='" + WorkorderDetail.REPAIR + "' or wd.type='" + WorkorderDetail.MAINTAIN + "') "; - List list = this.workorderDetailService.selectForAchievementWork(wString + " and wd.status = '" + WorkorderDetail.Status_Finish + "' "); - List dislist = this.workorderDetailService.selectForAchievementWork(wString + " and wd.status != '" + WorkorderDetail.Status_Finish + "' "); - if (list != null && list.size() > 0) { - for (WorkorderDetail workorderDetail : - list) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD.add(workorderDetail.get_num()); - havenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - JSONArray workOrderJSONArrayD2 = new JSONArray(); - workOrderJSONArrayD2.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD2.add(workorderDetail.getWorkTime()); - workTimeChartDatajsonArray.add(workOrderJSONArrayD2); - - totalCompleteWorkNum += workorderDetail.get_num(); - totalWorkTimeNum += workorderDetail.getWorkTime(); - } - } - if (dislist != null && dislist.size() > 0) { - for (WorkorderDetail workorderDetail : - dislist) { - JSONArray workOrderJSONArrayD = new JSONArray(); - workOrderJSONArrayD.add(workorderDetail.getCompleteDate()); - workOrderJSONArrayD.add(workorderDetail.get_num()); - unhavenDoneWorkChartDatajsonArray.add(workOrderJSONArrayD); - - totalUnCompleteWorkNum += workorderDetail.get_num(); - } - } - workOrderjsonObject.put("havenDoneWorkChartData", havenDoneWorkChartDatajsonArray); - workOrderjsonObject.put("workTimeChartData", workTimeChartDatajsonArray); - workOrderjsonObject.put("unhavenDoneWorkChartData", unhavenDoneWorkChartDatajsonArray); - - totalWorkNum = totalCompleteWorkNum + totalUnCompleteWorkNum; - - workOrderjsonObject.put("totalWorkNum", totalWorkNum); - workOrderjsonObject.put("totalWorkTimeNum", totalWorkTimeNum); - workOrderjsonObject.put("totalCompleteWorkNum", totalCompleteWorkNum); - workOrderjsonObject.put("totalUnCompleteWorkNum", totalUnCompleteWorkNum); - - - } - - jsonArray.add(workOrderjsonObject); - } - } - -// System.out.println(jsonArray); - request.setAttribute("result", jsonArray); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/controller/workorder/WorkorderConsumeController.java b/src/com/sipai/controller/workorder/WorkorderConsumeController.java deleted file mode 100644 index ad1cd49a..00000000 --- a/src/com/sipai/controller/workorder/WorkorderConsumeController.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.sipai.controller.workorder; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.workorder.WorkorderRepairContent; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import afu.org.checkerframework.checker.units.qual.s; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.dao.sparepart.ConsumeDetailDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.sparepart.OutStockRecordDetail; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderConsume; -import com.sipai.service.sparepart.ConsumeDetailService; -import com.sipai.service.sparepart.OutStockRecordDetailService; -import com.sipai.service.workorder.WorkorderConsumeService; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/workorder/workorderConsume") -public class WorkorderConsumeController { - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private WorkorderConsumeService workorderConsumeService; - @Resource - private ConsumeDetailService consumeDetailService; - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - String wherestr = " where 1=1 "; - if (request.getParameter("pid") != null && !request.getParameter("pid").isEmpty()) { - wherestr += " and pid = '" + request.getParameter("pid") + "'"; - } - PageHelper.startPage(page, rows); - List list = this.workorderConsumeService.selectListByWhere(wherestr + orderstr); - PageInfo pInfo = new PageInfo(list); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - -// @RequestMapping("/updateOutStockDetailConsume.do") -// public String doupdateOutStockDetail(HttpServletRequest request,Model model) { -// User cu = (User) request.getSession().getAttribute("cu"); -// String id = request.getParameter("id"); -// String number = request.getParameter("number");//数量 -// String result = this.workorderConsumeService.updateNumber(id, number); -// String resstr="{\"res\":\""+result+"\"}"; -// model.addAttribute("result", resstr); -// return "result"; -// } - - @RequestMapping("/showConsumeFromUser.do") - public String selectStockForOutStockDetails(HttpServletRequest request, Model model) { - String OutStockRecordDetailIds = request.getParameter("OutStockRecordDetailIds"); - if (OutStockRecordDetailIds != null && !OutStockRecordDetailIds.isEmpty()) { - String[] id_Array = OutStockRecordDetailIds.split(","); - JSONArray jsonArray = new JSONArray(); - for (String item : id_Array) { - if (!item.isEmpty()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item); - jsonArray.add(jsonObject); - } - } - request.setAttribute("consumeIds", jsonArray); - } - return "/workorder/consume4Selects"; - } - - @RequestMapping("/save.do") - public String save(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String goodsId = request.getParameter("goodsIds"); - String worksheetId = request.getParameter("worksheetId"); - String id = request.getParameter("id"); - int number = Integer.parseInt(request.getParameter("number"));//数量 - BigDecimal price = new BigDecimal(request.getParameter("price"));//单价 - System.out.println(id); - int result = 0; - WorkorderConsume workorderConsume = this.workorderConsumeService.selectById(id); - if (workorderConsume != null) { - workorderConsume.setGoodsId(goodsId); - workorderConsume.setInsdt(CommUtil.nowDate()); - workorderConsume.setInsuser(cu.getId()); - workorderConsume.setNumber(number); - workorderConsume.setPrice(price); - workorderConsume.setTotalPrice(price.multiply(new BigDecimal(number))); - result = this.workorderConsumeService.update(workorderConsume); - } else { - workorderConsume = new WorkorderConsume(); - workorderConsume.setId(CommUtil.getUUID()); - workorderConsume.setPid(worksheetId); - workorderConsume.setGoodsId(goodsId); - workorderConsume.setInsdt(CommUtil.nowDate()); - workorderConsume.setInsuser(cu.getId()); - workorderConsume.setStockType("库内"); - workorderConsume.setNumber(number); - workorderConsume.setPrice(price); - workorderConsume.setTotalPrice(price.multiply(new BigDecimal(number))); - result = this.workorderConsumeService.save(workorderConsume); - } - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/saves.do") - public String saves(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String goodsId = request.getParameter("goodsIds"); - String worksheetId = request.getParameter("worksheetId"); - String id = request.getParameter("id"); - int number = Integer.parseInt(request.getParameter("number"));//数量 - BigDecimal price = new BigDecimal(request.getParameter("price"));//单价 - System.out.println(id); - int result = 0; - - if (goodsId != null && !goodsId.equals("")) { - String[] goodsIds = goodsId.split(","); - for (String s : goodsIds) { - WorkorderConsume workorderConsume = this.workorderConsumeService.selectById(s); - if (workorderConsume != null) { - workorderConsume.setGoodsId(s); - workorderConsume.setInsdt(CommUtil.nowDate()); - workorderConsume.setInsuser(cu.getId()); - workorderConsume.setNumber(1); - workorderConsume.setPrice(price); - workorderConsume.setTotalPrice(price.multiply(new BigDecimal(number))); - result = this.workorderConsumeService.update(workorderConsume); - } else { - workorderConsume = new WorkorderConsume(); - workorderConsume.setId(CommUtil.getUUID()); - workorderConsume.setPid(worksheetId); - workorderConsume.setGoodsId(s); - workorderConsume.setInsdt(CommUtil.nowDate()); - workorderConsume.setInsuser(cu.getId()); -// workorderConsume.setStockType("库内"); - workorderConsume.setNumber(1); - workorderConsume.setPrice(price); - workorderConsume.setTotalPrice(price.multiply(new BigDecimal(number))); - result = this.workorderConsumeService.save(workorderConsume); - } - } - } - - String resstr = "{\"res\":\"" + result + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String[] idArray = ids.split(","); - try { - for (int i = 0; i < idArray.length; i++) { - this.workorderConsumeService.deleteById(idArray[i]); - } - } catch (Exception e) { - e.printStackTrace(); - Result result = Result.failed("删除失败"); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - Result result = Result.success(1); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WorkorderConsume workorderConsume = this.workorderConsumeService.selectById(id); - model.addAttribute("workorderConsume", workorderConsume); - return "/workorder/workorderConsumeEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("workorderConsume") WorkorderConsume workorderConsume) { - User cu = (User) request.getSession().getAttribute("cu"); - workorderConsume.setUpsdt(CommUtil.nowDate()); - workorderConsume.setUpsuser(cu.getId()); - int result = this.workorderConsumeService.update(workorderConsume); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - -// @RequestMapping("/getOutStockDetailList.do") -// public ModelAndView getOutStockDetailList(HttpServletRequest request,Model model, -// @RequestParam(value = "page") Integer page, -// @RequestParam(value = "rows") Integer rows, -// @RequestParam(value = "sort", required = false) String sort, -// @RequestParam(value = "order", required = false) String order) { -// User cu = (User) request.getSession().getAttribute("cu"); -// if (sort==null || sort.equals("id")) { -// sort = " insdt "; -// } -// if (order == null) { -// order = " desc "; -// } -// String orderstr = " order by "+sort+" "+order; -// String wherestr = " where 1=1 and (out_number != consume_number or consume_number is null)"; -// if (request.getParameter("insuser")!= null && !request.getParameter("insuser").isEmpty()) { -// wherestr += " and insuser = '"+cu.getId()+"'"; -// } -// if (request.getParameter("search_name")!= null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%"+request.getParameter("search_name")+"%'"; -// } -// PageHelper.startPage(page, rows); -// List list = this.outStockRecordDetailService.selectListByWhere(wherestr+orderstr); -// PageInfo pInfo = new PageInfo(list); -// JSONArray jsonArray = JSONArray.fromObject(list); -// String result = "{\"total\":"+pInfo.getTotal()+",\"rows\":"+jsonArray+"}"; -// model.addAttribute("result",result); -// return new ModelAndView("result"); -// } - -// @RequestMapping("/saveOutStockRecordDetails.do") -// public String dosaveOutStockRecordDetails(HttpServletRequest request,Model model) { -// User cu = (User) request.getSession().getAttribute("cu"); -// String OutStockRecordDetailIds = request.getParameter("OutStockRecordDetailIds"); -// String maintenanceDetailId = request.getParameter("maintenanceDetailId"); -// String[] idArrary = OutStockRecordDetailIds.split(","); -// int result = 0; -// boolean flag = true; -// //取消原先选择的数据,要删除 -// List list = this.workorderConsumeService.selectListByWhere("where maintenance_detail_id = '"+maintenanceDetailId+"'"); -// for (WorkorderConsume item : list) { -// result = this.workorderConsumeService.deleteById(item.getId()); -// if (result != 1) { -// flag = false; -// } -// } -// for (String str : idArrary) { -// if(str !=null && !str.isEmpty()){ -// OutStockRecordDetail outStockRecordDetail = this.outStockRecordDetailService.selectById(str); -// WorkorderConsume workorderConsume = new WorkorderConsume(); -// workorderConsume.setId(CommUtil.getUUID()); -// workorderConsume.setInsdt(CommUtil.nowDate()); -// workorderConsume.setInsuser(cu.getId()); -// workorderConsume.setMaintenanceDetailId(maintenanceDetailId); -// workorderConsume.setOutstockRecordDetailId(str); -// workorderConsume.setGoodsId(outStockRecordDetail.getGoodsId()); -// workorderConsume.setConsumeNumber(new BigDecimal(0)); -// -// result = this.workorderConsumeService.save(workorderConsume); -// if (result != 1) { -// flag = false; -// } -// } -// } -// String resultstr = "{\"res\":\""+flag+"\"}"; -// model.addAttribute("result",resultstr); -// return "result"; -// } - - -} diff --git a/src/com/sipai/controller/workorder/WorkorderDetailController.java b/src/com/sipai/controller/workorder/WorkorderDetailController.java deleted file mode 100644 index 8fa9c92e..00000000 --- a/src/com/sipai/controller/workorder/WorkorderDetailController.java +++ /dev/null @@ -1,1546 +0,0 @@ -package com.sipai.controller.workorder; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.accident.Roast; -import com.sipai.entity.base.Result; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.work.GroupDetail; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.EquipmentPlanMainYearService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.service.workorder.WorkorderRepairContentService; -import com.sipai.tools.*; -import io.swagger.annotations.*; -import net.sf.json.JSONArray; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.user.UnitService; - -@Controller -@RequestMapping("/workorder/workorderDetail") -@Api(value = "/workorder/workorderDetail", tags = "设备工单") -public class WorkorderDetailController { - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private EquipmentPlanMainYearService equipmentPlanMainYearService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private AbnormityService abnormityService; - @Resource - private WorkorderRepairContentService workorderRepairContentService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - - //维修list - @RequestMapping("/showRepairList.do") - public String showRepairList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - return "workorder/workorderDetailRepairList"; - } - - //维修list -- 用于app嵌入 - @RequestMapping("/showRepairListApp.do") - public String showRepairListApp(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - request.setAttribute("unitId", request.getParameter("unitId")); - return "workorder/workorderDetailRepairListApp"; - } - - //保养list - @RequestMapping("/showMaintainList.do") - public String showMaintainList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - return "workorder/workorderDetailMaintainList"; - } - - @ApiOperation(value = "维修记录页面", notes = "维修页面-unitId和equipmentId为APP调用平台的参数", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "equipmentId", value = "设备id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/showEndRepairList.do", method = RequestMethod.GET) -// @ResponseBody - public String showEndRepairList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - request.setAttribute("unitId", request.getParameter("unitId")); - request.setAttribute("equipmentId", request.getParameter("equipmentId")); - return "workorder/workorderDetailEndRepairList"; - } - - @ApiOperation(value = "保养记录页面", notes = "保养页面-unitId和equipmentId为APP调用平台的参数", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = false), - @ApiImplicitParam(name = "equipmentId", value = "设备id", dataType = "String", paramType = "query", required = false) - }) - @RequestMapping(value = "/showEndMaintainList.do", method = RequestMethod.GET) -// @ResponseBody - public String showEndMaintainList(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - if (cu != null) { - request.setAttribute("userId", cu.getId()); - } - request.setAttribute("unitId", request.getParameter("unitId")); - request.setAttribute("equipmentId", request.getParameter("equipmentId")); - return "workorder/workorderDetailEndMaintainList"; - } - - //维修+保养 记录list - @RequestMapping("/showEndList.do") - public String showEndList(HttpServletRequest request, Model model) { - request.setAttribute("type", WorkorderDetail.REPAIR + "," + WorkorderDetail.MAINTAIN); - return "workorder/workorderDetailEndList"; - } - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - String date = request.getParameter("date");//日期 - String name = request.getParameter("name");//姓名 - String isCompete = request.getParameter("isCompete");//派单方式 - String searchContent = request.getParameter("searchContent");//模糊搜索内容 - String saveType = request.getParameter("saveType");//设备名称 - String monthDt = request.getParameter("monthDt");//月份 - 如设备总览传过来的 - if (sort == null || sort.equals("id")) { - sort = " twd.insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String type = unitService.doCheckBizOrNot(cu.getId()); - - if (CommString.UserType_Maintainer.equals(type)) { - wherestr = CommUtil.getwherestr("d.maintainerId", "", cu); - } - - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and twd.unit_id in (" + companyids + ") "; - } - } - - // 2021.11.23 status - String status = request.getParameter("status"); - if (status != null && !status.isEmpty()) { - if (status.equals("0")) {//进行中的 - wherestr += " and twd.status != '" + WorkorderDetail.Status_Finish + "' "; - } else if (status.equals("1")) {//已完成的 - wherestr += " and twd.status = '" + WorkorderDetail.Status_Finish + "' "; - } else { - wherestr += " "; - } - } - - String types = request.getParameter("type"); - if (types != null && !types.equals("")) { - String[] str = types.split(","); - String type_s = ""; - for (String s : str) { - type_s += "'" + s + "',"; - } - type_s = type_s.substring(0, type_s.length() - 1); - wherestr += " and twd.type in (" + type_s + ") "; - } - - if (request.getParameter("equipmentId") != null && !request.getParameter("equipmentId").isEmpty()) { - wherestr += " and twd.equipment_id = '" + request.getParameter("equipmentId") + "' "; - } - - if (isCompete != null && !isCompete.isEmpty()) { - wherestr += " and twd.is_compete = '" + isCompete + "' "; - } - - if (StringUtils.isNotBlank(saveType)) { - if ("0".equals(saveType)) { - wherestr += " and twd.save_type is null "; - } else { - wherestr += " and twd.save_type = '" + saveType + "' "; - } - } - if (searchContent != null && !searchContent.isEmpty()) { - wherestr += " and (twd.job_number like '%" + searchContent + "%' "; - wherestr += " or twd.job_name like '%" + searchContent + "%' "; - wherestr += " or tee.equipmentcardid like '%" + searchContent + "%' "; - wherestr += " or tee.equipmentname like '%" + searchContent + "%') "; - } - - if (date != null && !date.equals("")) { - String[] str = date.split("~"); - wherestr += " and twd.insdt between'" + str[0] + "'and'" + str[1] + "'"; - } - - if (monthDt != null && !monthDt.equals("")) { - wherestr += " and DATEDIFF(month,twd.insdt,'" + monthDt + "-01')=0 "; - } - - //先查出模糊搜索人名对应所有的id,再带进去查询 - if (name != null && !name.trim().equals("")) { - String ids = "'-',";//避免报错 - List users = userService.selectListByWhere2("where caption like '%" + name + "%'"); - for (User user : users) { - ids += "'" + user.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - wherestr += " and twd.receive_user_id in (" + ids + ") "; - } - - PageHelper.startPage(page, rows); - List list = this.workorderDetailService.selectListByWhereE(wherestr + orderstr); - - PageInfo pi = new PageInfo<>(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - @RequestMapping("/getlistApp.do") - public ModelAndView getlistApp(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - String orderstr = " order by insdt desc"; - String wherestr = " where 1=1 "; - /*if (companyId != null && !companyId.isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(companyId); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += " and unit_id in (" + companyids + ") "; - } - }*/ -// if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) { -// wherestr += " and name like '%" + request.getParameter("search_name") + "%' "; -// } -// if (request.getParameter("takeFlag") != null && !request.getParameter("takeFlag").isEmpty()) { -// wherestr += " and take_flag = '" + request.getParameter("takeFlag") + "' "; -// } - - String type = request.getParameter("type"); - String status = request.getParameter("statusSelectAPP"); - if (status != null && status.equals("1")) {//已完成 - wherestr += " and type = '" + type + "' and unit_id = '" + unitId + "' and status in ('finish','cancel') "; - } else {//处理中 - wherestr += " and type = '" + type + "' and unit_id = '" + unitId + "' and status!='finish' and status!='cancel' "; - } -// System.out.println(wherestr); - List list = this.workorderDetailService.selectSimpleEuipmentListByWhere(wherestr + orderstr); - JSONArray json = JSONArray.fromObject(list); -// System.out.println(json); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - //新增维修工单 - @RequestMapping("/doAddRepair.do") - public String doAddRepair(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - String jobNumber = company.getEname() + "-WXGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("type", WorkorderDetail.REPAIR); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - //查询该项目是否需要抢单 - Work work = (Work) SpringContextUtil.getBean("work"); - model.addAttribute("compete", work.getCompete()); - return "workorder/workorderDetailRepairAdd"; - } - - // 补录维修记录 - @RequestMapping("/doAddEndRepair.do") - public String doAddEndRepair(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - String jobNumber = company.getEname() + "-WXGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("type", WorkorderDetail.REPAIR); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "workorder/workorderDetailEndRepairAdd"; - } - - // 保存 维修和保养记录 - @RequestMapping("/doInEndRepair.do") - public String doInEndRepair(HttpServletRequest request, - @ModelAttribute WorkorderDetail workorderDetail, - Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - workorderDetail.setId(CommUtil.getUUID()); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setInsuser(cu.getId()); - workorderDetail.setReceiveUserId(cu.getId()); -// workorderDetail.setRepairDate(CommUtil.nowDate()); - workorderDetail.setCompleteDate(workorderDetail.getRepairDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Finish); - int save = 0; - try { - save = workorderDetailService.save(workorderDetail); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + save + "\",\"id\":\"" + workorderDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - //新增保养工单 - @RequestMapping("/doAddMaintain.do") - public String doAddMaintain(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - String jobNumber = company.getEname() + "-BYGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("type", WorkorderDetail.MAINTAIN); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - //查询该项目是否需要抢单 - Work work = (Work) SpringContextUtil.getBean("work"); - model.addAttribute("compete", work.getCompete()); - return "workorder/workorderDetailMaintainAdd"; - } - - // 补录保养记录 - @RequestMapping("/doAddEndMaintain.do") - public String doAddEndMaintain(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String unitId = request.getParameter("unitId"); - Company company = unitService.getCompById(unitId); - String jobNumber = company.getEname() + "-BYGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - request.setAttribute("company", company); - request.setAttribute("jobNumber", jobNumber); - request.setAttribute("type", WorkorderDetail.MAINTAIN); - request.setAttribute("id", CommUtil.getUUID()); - request.setAttribute("nowDate", CommUtil.nowDate()); - return "workorder/workorderDetailEndMaintainAdd"; - } - - @ApiOperation(value = "维修记录删除", notes = "维修记录删除(同时删除对应流程)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "工单的id,用逗号隔开", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/delete4Repair.do", method = RequestMethod.POST) - public String delete4Repair(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.workorderDetailService.deleteByWhere("where id in ('" + ids + "')"); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "保养记录删除", notes = "保养记录删除(同时删除对应流程)", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "工单的id,用逗号隔开", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/delete4Maintain.do", method = RequestMethod.POST) - public String delete4Maintain(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - ids = ids.replace(",", "','"); - int res = this.workorderDetailService.deleteByWhere("where id in ('" + ids + "')"); - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - return "result"; - } - - @ApiOperation(value = "启动设备工单流程", notes = "启动设备工单流程", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "ids", value = "工单的id,用逗号隔开", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping(value = "/startWorkorderDetail.do", method = RequestMethod.POST) - public String startWorkorderDetail(HttpServletRequest request, Model model, - @ModelAttribute WorkorderDetail workorderDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - String receiveUserId = workorderDetail.getReceiveUserId(); - if (StringUtils.isNotBlank(workorderDetail.getId())) { - WorkorderDetail backWork = workorderDetailService.selectById(workorderDetail.getId()); - if (backWork != null) { - workorderDetail = backWork; - } - } - workorderDetail.setReceiveUserId(receiveUserId); - workorderDetail.setStatus(WorkorderDetail.Status_Start); - workorderDetail.setInsuser(cu.getId()); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setIsCompete(CommString.Active_True); - int result = 0; - try { - result = this.workorderDetailService.startWorkorderDetail("", workorderDetail); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + workorderDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 工单下发页面 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showWorkorderDetailRepairIssue.do") - public String showWorkorderDetailRepairIssue(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String inStockRecordId = pInstance.getBusinessKey(); - WorkorderDetail entity = this.workorderDetailService.selectById(inStockRecordId); - model.addAttribute("entity", entity); - return "workorder/workorderDetailRepairIssue"; - } - - /** - * 工单执行页面(维修) - * 2021-08-04 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showWorkorderDetailRepairHandle.do") - public String showWorkorderDetailRepairHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - WorkorderDetail entity = this.workorderDetailService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - - //当前时间 - model.addAttribute("nowDate", CommUtil.nowDate().substring(0, 16)); - return "workorder/workorderDetailRepairHandle"; - } - - /** - * 工单执行页面(保养) - * 2021-08-04 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showWorkorderDetailMaintainHandle.do") - public String showWorkorderDetailMaintainHandle(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - String unitId = request.getParameter("unitId"); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - List businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'"); - if (businessUnitHandles != null && businessUnitHandles.size() > 0) { - businessUnitHandle = businessUnitHandles.get(0); - //若任务退回后,需更新新的任务id - businessUnitHandle.setTaskid(taskId); - } else { - businessUnitHandle.setId(CommUtil.getUUID()); - businessUnitHandle.setProcessid(processInstanceId); - businessUnitHandle.setTaskid(taskId); - businessUnitHandle.setBusinessid(pInstance.getBusinessKey()); - businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey()); - businessUnitHandle.setUnitid(unitId); - } - /*String userIds = businessUnitHandle.getTargetusers(); - if(userIds!= null && !userIds.isEmpty()){ - List users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - String targetUsersName =""; - for (User user : users) { - if(!targetUsersName.isEmpty()){ - targetUsersName+=","; - } - targetUsersName+=user.getCaption(); - } - model.addAttribute("targetUsersName", targetUsersName); - }*/ - - model.addAttribute("businessUnitHandle", businessUnitHandle); - model.addAttribute("nowDate", CommUtil.nowDate()); - String inStockRecordId = pInstance.getBusinessKey(); - WorkorderDetail entity = this.workorderDetailService.selectById(inStockRecordId); - // list = this.businessUnitAuditService.selectListByWhere("where businessId = '"+inStockRecordId+"' order by insdt desc "); - //model.addAttribute("businessUnitAudit", list.get(0)); - model.addAttribute("entity", entity); - return "workorder/workorderDetailMaintainHandle"; - } - - // @ApiOperation(value = "维修工单下发", notes = "维修工单发起(维修工单下发)", httpMethod = "POST") -// @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @RequestMapping("/doWorkorderDetailRepairIssueProcess.do") - public String doWorkorderDetailRepairIssueProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - workorderDetailService.updateStatus(businessUnitHandle.getBusinessid()); - - //修改工单维修时间 - WorkorderDetail entity = workorderDetailService.selectById(businessUnitHandle.getBusinessid()); - entity.setRepairDate(CommUtil.nowDate()); - entity.setReceiveUserId(cu.getId()); - workorderDetailService.update(entity); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - @ApiOperation(value = "维修工单提交", notes = "维修工单提交", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @RequestMapping("/doWorkorderDetailRepairHandleProcess.do") - public String doWorkorderDetailRepairHandleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - result = this.workorderDetailService.doWorkorderDetailRepairAudit(businessUnitAudit); - - //修改工单维修时间 - WorkorderDetail entity = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - String repairDate = request.getParameter("repairDate"); - if (StringUtils.isNotBlank(repairDate)) { - entity.setRepairDate(repairDate); - } else { - entity.setRepairDate(CommUtil.nowDate()); - } - entity.setReceiveUserId(cu.getId()); - workorderDetailService.update(entity); - - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - - return "result"; - } - - @ApiOperation(value = "保养工单提交", notes = "保养工单提交", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @RequestMapping("/doWorkorderDetailMaintainHandleProcess.do") - public String doWorkorderDetailMaintainHandleProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitHandle businessUnitHandle) { - String routeNum = request.getParameter("routeNum"); - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) { - businessUnitHandle.setInsuser(cu.getId()); - businessUnitHandle.setInsdt(CommUtil.nowDate()); - result = this.businessUnitHandleService.save(businessUnitHandle); - } else { - result = this.businessUnitHandleService.update(businessUnitHandle); - } - //由于业务没有状态信息,可以不采用回滚方式 - if (result == 1) { - try { - Map variables = new HashMap(); - variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum); - variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers()); - variables.put(CommString.ACTI_KEK_Assignee, null); - taskService.complete(businessUnitHandle.getTaskid(), variables); - //发送消息 - if (businessUnitHandle.getTargetusers() != null && !businessUnitHandle.getTargetusers().isEmpty()) { - //补全所有字段信息 - businessUnitHandle = businessUnitHandleService.selectById(businessUnitHandle.getId()); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecord.sendMessage(businessUnitHandle.getTargetusers(), ""); - } - } catch (Exception e) { - e.printStackTrace(); - result = 0; - } - workorderDetailService.updateStatus(businessUnitHandle.getBusinessid()); - - //修改工单完成时间 - WorkorderDetail entity = workorderDetailService.selectById(businessUnitHandle.getBusinessid()); - String repairDate = request.getParameter("repairDate"); - entity.setRepairDate(StringUtils.isNotBlank(repairDate) ? repairDate : CommUtil.nowDate()); - entity.setReceiveUserId(cu.getId()); - workorderDetailService.update(entity); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitHandle.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示审核 (维修) - * 2021-08-04 - */ - @RequestMapping("/showWorkorderDetailRepairAudit.do") - public String showWorkorderDetailRepairAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - WorkorderDetail entity = this.workorderDetailService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - model.addAttribute("nowDate", CommUtil.nowDate().substring(0, 16)); - return "workorder/workorderDetailRepairAudit"; - } - - /** - * 显示审核 (保养) - * 2021-08-04 - */ - @RequestMapping("/showWorkorderDetailMaintainAudit.do") - public String showWorkorderDetailMaintainAudit(HttpServletRequest request, Model model) { - String taskId = request.getParameter("taskId"); - String processInstanceId = request.getParameter("processInstanceId"); - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - - Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult(); - model.addAttribute("taskName", task.getName()); - - businessUnitAudit.setId(CommUtil.getUUID()); - businessUnitAudit.setProcessid(processInstanceId); - businessUnitAudit.setTaskid(taskId); - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery() - .processInstanceId(processInstanceId) - .singleResult(); - businessUnitAudit.setBusinessid(pInstance.getBusinessKey()); - businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey()); - model.addAttribute("businessUnitAudit", businessUnitAudit); - String entityId = pInstance.getBusinessKey(); - WorkorderDetail entity = this.workorderDetailService.selectById(entityId); - model.addAttribute("entity", entity); - - //获取任务下一节点,若为任务节点,则显示目标用户div,否则不显示 - List activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey()); - if (activityImpls.size() > 0) { - model.addAttribute("showTargetUsersFlag", true); - } else { - model.addAttribute("showTargetUsersFlag", false); - } - return "workorder/workorderDetailMaintainAudit"; - } - - /** - * 流程流转(维修) - */ - @RequestMapping("/doWorkorderDetailRepairAuditProcess.do") - public String doWorkorderDetailRepairAuditProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - String completeDate = request.getParameter("completeDate"); - if (StringUtils.isNotBlank(completeDate)) { - result = this.workorderDetailService.doWorkorderDetailRepairAudit(completeDate, businessUnitAudit); - } else { - result = this.workorderDetailService.doWorkorderDetailRepairAudit(businessUnitAudit); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 流程流转(保养) - */ - @RequestMapping("/doWorkorderDetailMaintainAuditProcess.do") - public String doWorkorderDetailMaintainAuditProcess(HttpServletRequest request, Model model, - @ModelAttribute BusinessUnitAudit businessUnitAudit) { - User cu = (User) request.getSession().getAttribute("cu"); - int result = 0; - businessUnitAudit.setInsuser(cu.getId()); - businessUnitAudit.setInsdt(CommUtil.nowDate()); - - String completeDate = request.getParameter("completeDate"); - if (StringUtils.isNotBlank(completeDate)) { - result = this.workorderDetailService.doWorkorderDetailRepairAudit(completeDate, businessUnitAudit); - } else { - result = this.workorderDetailService.doWorkorderDetailRepairAudit(businessUnitAudit); - } -// result = this.workorderDetailService.doWorkorderDetailRepairAudit(businessUnitAudit); - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - /** - * 显示流程 流转信息 (维修) - *

- * sj 2022-06-09 目前改为维修保养通用了 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showWorkorderDetailRepairProcessView.do") - public String showWorkorderDetailRepairProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - WorkorderDetail entity = this.workorderDetailService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - if (entity.getProcessdefid() != null && !entity.getProcessdefid().equals("")) { - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - - for (String item : keys) { - switch (item) { - /** - * 维修工单 - */ - case BusinessUnit.UNIT_WORKORDER_REPAIR_ISSUE: - List list0 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list0) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE: - List list1 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - /** - * 保养工单 - */ - case BusinessUnit.UNIT_WORKORDER_MAINTAIN_HANDLE: - List list4 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list4) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_MAINTAIN_APPLY_AUDIT: - List list5 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list5) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_MAINTAIN_CHECK_AUDIT: - List list6 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list6) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - } else { - model.addAttribute("result", "暂无流程! 1.补录的工单无流程;2.待抢单的工单抢单后产生流程"); - return "result"; - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "workorder/workorderDetailRepair_processView"; - } else { - return "workorder/workorderDetailRepair_processView_alone"; - } - } - - /** - * 显示流程 流转信息 (保养) - *

- * sj 2022-06-09 暂时没用,目前直接用: showWorkorderDetailRepairProcessView - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showWorkorderDetailMaintainProcessView.do") - public String showWorkorderDetailMaintainProcessView(HttpServletRequest request, Model model) { - String entityId = request.getParameter("id"); - WorkorderDetail entity = this.workorderDetailService.selectById(entityId); - request.setAttribute("business", entity); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_REPAIR_APPLY_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_REPAIR_CHECK_AUDIT: - List list3 = businessUnitAuditService.selectListByWhere("where businessid='" + entityId + "' "); - for (BusinessUnitAudit businessUnitAudit : list3) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - - JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - model.addAttribute("businessUnitRecords", jsonArray); - //检测流程实例是否结束,结束则历史记录最后节点变化 - long num = runtimeService.createProcessInstanceQuery().processInstanceId(entity.getProcessid()).count(); - if (num > 0) { - model.addAttribute("finishFlag", false); - } else { - model.addAttribute("finishFlag", true); - } - - if (request.getParameter("inModal") != null) { - //判断显示在流程处理模态框右侧 - return "workorder/workorderDetailMaintain_processView"; - } else { - return "workorder/workorderDetailMaintain_processView_alone"; - } - } - - /** - * 维修浏览页面 - * sj 2021-10-13 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/doViewRepair.do") - public String doViewRepair(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - WorkorderDetail entity = this.workorderDetailService.selectById(id); - String wxCount = request.getParameter("wxCount"); - model.addAttribute("entity", entity); - model.addAttribute("wxCount", wxCount); - if (entity != null && entity.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(entity.getAbnormityId()); - model.addAttribute("abnormity", abnormity); - } - return "workorder/workorderDetailRepairView"; - } - - /** - * 保养浏览页面 - * sj 2021-10-13 - * - * @param request - * @param model - * @param id - * @return - */ - @RequestMapping("/doViewMaintain.do") - public String doViewMaintain(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) { - WorkorderDetail entity = this.workorderDetailService.selectById(id); - model.addAttribute("entity", entity); - return "workorder/workorderDetailMaintainView"; - } - - /** - * app获取维修单列表 SJ 2021-11-01 - * - * @param userId 人员id - * @param unitId 厂id - * @param compete 是否抢单(抢单:CommString.Active_True=1 非抢单:CommString.Active_False=0) - * @return - */ - @ApiOperation(value = "app获取维修单列表", notes = "app获取维修单列表 SJ 2021-11-01", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "人员id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "unitId", value = "厂id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "compete", value = "是否抢单(抢单:CommString.Active_True=1 非抢单:CommString.Active_False=0)", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/getList4App.do") - public ModelAndView getList4App(HttpServletRequest request, Model model, - @RequestParam(value = "userId") String userId, - @RequestParam(value = "unitId") String unitId, - @RequestParam(value = "compete") String compete) { - String wherestr = "where 1=1 and status = '" + WorkorderDetail.Status_Compete + "'"; - String orderstr = " order by insdt desc"; - - if (compete != null && !compete.trim().equals("")) { - wherestr += " and is_compete = '" + compete + "' "; - } - - if (unitId != null && !unitId.trim().equals("")) { - wherestr += " and unit_id = '" + unitId + "' "; - } - - List list = this.workorderDetailService.selectListByWhere4App(wherestr + orderstr, userId); - JSONArray json = JSONArray.fromObject(list); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * app抢单 - * - * @param request - * @param model - * @param id - * @return - */ - @ApiOperation(value = "app抢单", notes = "app抢单", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "表单Id", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "userId", value = "人员id", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/doCompete4Repair.do") - public String doCompete4Repair(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "userId") String userId) { - String result = this.workorderDetailService.doCompete4Repair(id, userId); - model.addAttribute("result", result); - return "result"; - } - - /** - * 发起抢单 - */ - @ApiOperation(value = "发起抢单", notes = "发起抢单", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ -// @ApiImplicitParam(name = "id", value = "表单Id", dataType = "String", paramType = "query", required = true), - }) - @RequestMapping("/startCompete4Repair.do") - public String startCompete4Repair(HttpServletRequest request, Model model, - @ModelAttribute WorkorderDetail workorderDetail) { - User cu = (User) request.getSession().getAttribute("cu"); - String targetusers = request.getParameter("targetusers"); - workorderDetail.setInsuser(cu.getId()); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Compete); - workorderDetail.setCompeteTeamIds(targetusers); - int result = 0; - try { - result = this.workorderDetailService.save(workorderDetail); - } catch (Exception e) { - e.printStackTrace(); - } - String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + workorderDetail.getId() + "\"}"; - model.addAttribute("result", resstr); - return "result"; - } - - // 无参数直接查询work表 - @RequestMapping("/getGList") - public ModelAndView getGList(HttpServletRequest request, Model model, - @RequestParam("type") String type, - @RequestParam("unitId") String unitId) { - String where = "where 1=1"; - if (StringUtils.isNotBlank(type)) { - where += " and type = '" + type + "'"; - } - if (StringUtils.isNotBlank(unitId)) { - where += " and unit_id = '" + unitId + "'"; - } - where += " order by insdt desc"; - List workorderDetails = workorderDetailService.selectListByWhere(where); - JSONArray json = JSONArray.fromObject(workorderDetails); - model.addAttribute("result", json); - return new ModelAndView("result"); - } - - /** - * 维修记录导出 (项目通用) - * sj 2022-03-08 - * - * @param request - * @param response - * @param model - * @param ids - * @param type - * @return - * @throws IOException - */ - @ApiOperation(value = "维修记录导出", notes = "维修记录导出", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ids", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "维修:repair 保养:maintain", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/doExportRepair.do") - public ModelAndView doExportRepair(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "type") String type) throws IOException { - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - String workorderDetailsIds = ""; - for (String s : id) { - workorderDetailsIds += "'" + s + "',"; - } - String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")"; - try { - List workorderDetails = workorderDetailService.selectListByWhere(whereStr); - this.workorderDetailService.doExportRepair(response, workorderDetails, type); - } catch (Exception e) { - e.printStackTrace(); - } - } - return null; - } - - /** - * 维修记录导出 (金山项目) sj 2022-03-08 - * ---暂时不用了 sj 2023-02-06 - * - * @param request - * @param response - * @param model - * @param ids - * @param type - * @return - * @throws IOException - */ - @ApiOperation(value = "维修记录导出 (金山项目)", notes = "维修记录导出 (金山项目)暂时不用", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ids", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "维修:repair 保养:maintain", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/doExportRepairJS.do") - public ModelAndView doExportRepairJS(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "type") String type) throws IOException { - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - String workorderDetailsIds = ""; - for (String s : id) { - workorderDetailsIds += "'" + s + "',"; - } - String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")"; - try { - List workorderDetails = workorderDetailService.selectListByWhere(whereStr); - this.workorderDetailService.doExportRepairJS(response, workorderDetails, type); - } catch (Exception e) { - e.printStackTrace(); - } - } - return null; - } - - /** - * 保养记录导出 (项目通用) - * sj 2022-03-08 - * - * @param request - * @param response - * @param model - * @param ids - * @param type - * @return - * @throws IOException - */ - @ApiOperation(value = "保养记录导出", notes = "保养记录导出", httpMethod = "POST") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ids", dataType = "String", paramType = "query", required = true), - @ApiImplicitParam(name = "type", value = "维修:repair 保养:maintain", dataType = "String", paramType = "query", required = true) - }) - @RequestMapping("/doExportMain.do") - public ModelAndView doExportMain(HttpServletRequest request, - HttpServletResponse response, Model model, - @RequestParam(value = "ids") String ids, - @RequestParam(value = "type") String type) throws IOException { - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - String workorderDetailsIds = ""; - for (String s : id) { - workorderDetailsIds += "'" + s + "',"; - } - String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")"; -// System.out.println(whereStr); - try { - List workorderDetails = workorderDetailService.selectListByWhere(whereStr); - this.workorderDetailService.doExportMain(response, workorderDetails, type); - } catch (Exception e) { - e.printStackTrace(); - } - } - return null; - } - - /** - * 日历中弹出指定日期的 维修单 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/showList4Date.do") - public String showList4Date(HttpServletRequest request, Model model) { - return "workorder/workorderDetailRepairList4Date"; - } - - /** - * 根据日期获取维修数据 - * - * @param request - * @param model - * @param page - * @param rows - * @param sort - * @param order - * @return - */ - @RequestMapping("/getJson4Date.do") - public ModelAndView getJson4Date(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String orderstr = " order by insdt asc"; - String wherestr = "where 1=1 "; - String dateStr = request.getParameter("dateStr"); - - if (request.getParameter("type") != null && !request.getParameter("type").isEmpty()) { - wherestr += " and type = '" + request.getParameter("type") + "' "; - } - - if (request.getParameter("unitId") != null && !request.getParameter("unitId").isEmpty()) { - wherestr += " and unit_id = '" + request.getParameter("unitId") + "' "; - } - - if (dateStr != null && !dateStr.equals("")) { - // DateDiff(dd,datetime类型字段,getdate())=0 - wherestr += " and DateDiff(dd,insdt,'" + dateStr + "')=0 "; - } - - PageHelper.startPage(page, rows); - List list = this.workorderDetailService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 维修单中修改设备id (北江需求 维修设备不一定是上报的设备 equipmentId为实际id equipmentId2为上报设备) - * - * @param request - * @param model - * @param id - * @param equipmentId - * @return - */ - @RequestMapping("/updateEquipmentId.do") - public String updateEquipmentId(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "equipmentId") String equipmentId) { - int result = 0; - WorkorderDetail workorderDetail = workorderDetailService.selectById(id); - if (workorderDetail != null) { - workorderDetail.setEquipmentId2(workorderDetail.getEquipmentId()); - workorderDetail.setEquipmentId(equipmentId); - result = workorderDetailService.update(workorderDetail); - } - model.addAttribute("result", result); - return "result"; - } - - /** - * 查询工单对应的抢单班组 - * - * @param request - * @param model - * @return - */ - @ApiOperation(value = "查询工单对应的抢单班组", notes = "查询工单对应的抢单班组", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "工单的id", dataType = "String", paramType = "query", required = true, defaultValue = "123") - }) - @RequestMapping("/selectCompeteTeamNames.do") - public ModelAndView selectCompeteTeamNames(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - String names = ""; - WorkorderDetail workorderDetail = workorderDetailService.selectById(id); - if (workorderDetail != null && workorderDetail.getCompeteTeamIds() != null) { - String[] ids = workorderDetail.getCompeteTeamIds().split(","); - if (ids != null && !ids.equals("")) { - for (int i = 0; i < ids.length; i++) { - GroupDetail groupDetail = groupDetailService.selectById(ids[i]); - if (groupDetail != null) { - names += groupDetail.getName() + "、"; - } - } - } - if (names != null && !names.equals("")) { - names = names.substring(0, names.length() - 1); - } - } else { - names = "未关联班组"; - } - model.addAttribute("result", names); - return new ModelAndView("result"); - } - - /** - * @param request - * @param model - * @param sdt - * @param edt - * @return - */ - @RequestMapping("/compareDate.do") - public String compareDate(HttpServletRequest request, Model model, - @RequestParam(value = "sdt") String sdt, - @RequestParam(value = "edt") String edt) { - int result = 0; - result = CommUtil.compare_time(sdt, edt); - model.addAttribute("result", result); - return "result"; - } - - /** - * 获取维修工单的 故障时间 sj 2023-05-22 - * - * @param request - * @param id - * @return - */ - @ApiOperation(value = "获取维修工单的 故障时间", notes = "获取维修工单的 故障时间", httpMethod = "GET") - @ApiResponses({@ApiResponse(code = 400, message = "请求参数没填好")}) - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "工单的id", dataType = "String", paramType = "query", required = true, defaultValue = "工单的id") - }) - @RequestMapping("/getAbnormityTime.do") - public String getAbnormityTime(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - JSONObject jsonObject = null; - try { - WorkorderDetail workorderDetail = workorderDetailService.selectSimpleById(id); - if (workorderDetail != null) { - jsonObject = workorderDetailService.getAbnormityTime(workorderDetail); - } - } catch (Exception e) { - e.printStackTrace(); - } - model.addAttribute("result", jsonObject); - return "result"; - } - - @RequestMapping("/getLastDt.do") - public String getLastDt(HttpServletRequest request, Model model) { - String type = request.getParameter("type"); - String equipmentId = request.getParameter("equipmentId"); - String orderstr = " order by repair_date desc"; - String wherestr = "where 1=1 and repair_date is not null "; - //仅查已完成的 - wherestr += " and status = '" + WorkorderDetail.Status_Finish + "' "; - - if (type != null && !type.equals("")) { - wherestr += " and type = '" + type + "' "; - } - if (equipmentId != null && !equipmentId.isEmpty()) { - wherestr += " and equipment_id = '" + equipmentId + "' "; - } -// System.out.println(wherestr + orderstr); - List list = this.workorderDetailService.selectSimpleListByWhere(wherestr + orderstr); - String result = ""; - if(list!=null && list.size()>0){ - result = list.get(0).getRepairDate().substring(0,10); - }else{ - result = "无"; - } - model.addAttribute("result", result); - return "result"; - } - -} diff --git a/src/com/sipai/controller/workorder/WorkorderRepairContentController.java b/src/com/sipai/controller/workorder/WorkorderRepairContentController.java deleted file mode 100644 index 0230781b..00000000 --- a/src/com/sipai/controller/workorder/WorkorderRepairContentController.java +++ /dev/null @@ -1,346 +0,0 @@ -package com.sipai.controller.workorder; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.service.workorder.WorkorderDetailService; -import net.sf.json.JSONArray; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sipai.entity.base.Result; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.entity.workorder.WorkorderRepairContent; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.LibraryRepairBlocService; -import com.sipai.service.user.UnitService; -import com.sipai.service.workorder.WorkorderRepairContentService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Controller -@RequestMapping("/workorder/workorderRepairContent") -public class WorkorderRepairContentController { - - @Resource - private WorkorderRepairContentService workorderRepairContentService; - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - - @RequestMapping("/getlist.do") - public ModelAndView getlist(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - User cu = (User) request.getSession().getAttribute("cu"); - if (sort == null || sort.equals("id")) { - sort = " insdt "; - } - if (order == null) { - order = " desc "; - } - String orderstr = " order by " + sort + " " + order; - - String wherestr = "where 1=1 "; - String type = unitService.doCheckBizOrNot(cu.getId()); - if (CommString.UserType_Maintainer.equals(type)) { - wherestr = CommUtil.getwherestr("d.maintainerId", "", cu); - } - if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) { - //获取公司下所有子节点 - List units = unitService.getUnitChildrenById(request.getParameter("search_code")); - String companyids = ""; - for (Unit unit : units) { - companyids += "'" + unit.getId() + "',"; - } - if (companyids != "") { - companyids = companyids.substring(0, companyids.length() - 1); - wherestr += "and unit_id in (" + companyids + ") "; - } - } - - String detailId = request.getParameter("pid"); - wherestr += "and detail_id = '" + detailId + "'"; - - PageHelper.startPage(page, rows); - List list = this.workorderRepairContentService.selectListByWhere(wherestr + orderstr); - - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - - //维修库 模态框页面 - @RequestMapping("/showlist4Content.do") - public String showlist4Content(HttpServletRequest request, Model model) { - String detailId = request.getParameter("detailId");//工单id - String eqId = request.getParameter("eqId");//工单id - model.addAttribute("detailId", detailId); - model.addAttribute("eqId", eqId); - return "/workorder/RepairBlocList4Content"; - } - - /** - * 获取改维修工单下的设备下的所有维修库 cpj 2021 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonBiz.do") - public ModelAndView getListJsonBiz(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String detailId = request.getParameter("detailId");//维修工单id - String unitId = request.getParameter("unitId");//设备型号的id - String whereStr = "where 1=1 "; - String unitStr = ""; - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - unitStr = company.getLibraryBizid(); - } else { - unitStr = "无"; - } - //查单条故障库对应的维修库 - if (detailId != null && !detailId.equals("")) { - //找到这个维修工单下的设备及其equipmentClassID - WorkorderDetail workorderDetail = this.workorderDetailService.selectById(detailId); - if (workorderDetail != null) { - String equipmentId = workorderDetail.getEquipmentId(); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentId); - if (equipmentCard != null) { - //拿到equipmentClassID - String equipmentClassID = equipmentCard.getEquipmentclassid(); - //找到该class下的所有故障 - List libraryFaultBlocs = this.libraryFaultBlocService.selectListByWhere("where pid = '" + equipmentClassID + "' and unit_id = '"+ unitId +"'"); - String libraryFaultBlocIds = ""; - for (int lfb = 0; lfb < libraryFaultBlocs.size(); lfb++) { - libraryFaultBlocIds += "'" + libraryFaultBlocs.get(lfb).getId() + "',"; - } - - if (libraryFaultBlocIds != "") { - libraryFaultBlocIds = libraryFaultBlocIds.substring(0, libraryFaultBlocIds.length() - 1); - whereStr += " and pid in (" + libraryFaultBlocIds + ") "; - } - } - } - } - String sortStr = "order by insdt desc"; - PageHelper.startPage(page, rows); - List list = this.libraryRepairBlocService.selectListByWhere2(whereStr + sortStr, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - /** - * 获取改维修工单下的设备下的所有维修库 ycy 2023/2/8 - * - * @param request - * @param model - * @return - */ - @RequestMapping("/getListJsonByClassId.do") - public ModelAndView getListJsonByClassId(HttpServletRequest request, Model model, - @RequestParam(value = "page") Integer page, - @RequestParam(value = "rows") Integer rows, - @RequestParam(value = "sort", required = false) String sort, - @RequestParam(value = "order", required = false) String order) { - String detailId = request.getParameter("detailId");//维修工单id - String unitId = request.getParameter("unitId");//设备型号的id - String whereStr = "where 1=1 "; - //拿到equipmentClassID - String equipmentClassID = request.getParameter("eqClassId"); - if (StringUtils.isNotBlank(equipmentClassID)) { - //找到该class下的所有故障 - List libraryFaultBlocs = this.libraryFaultBlocService.selectListByWhere("where pid = '" + equipmentClassID + "' and unit_id = '" + unitId + "'"); - String libraryFaultBlocIds = ""; - for (int lfb = 0; lfb < libraryFaultBlocs.size(); lfb++) { - libraryFaultBlocIds += "'" + libraryFaultBlocs.get(lfb).getId() + "',"; - } - - libraryFaultBlocIds = libraryFaultBlocIds.substring(0, libraryFaultBlocIds.length() - 1); - whereStr += " and pid in (" + libraryFaultBlocIds + ") "; - } - - String sortStr = "order by insdt desc"; - PageHelper.startPage(page, rows); - List list = this.libraryRepairBlocService.selectListByWhere2(whereStr + sortStr, unitId); - PageInfo pi = new PageInfo(list); - JSONArray json = JSONArray.fromObject(list); - String result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/dosave.do") - public ModelAndView dosave(HttpServletRequest request, Model model, - @ModelAttribute("workorderRepairContent") WorkorderRepairContent workorderRepairContent) { - User cu = (User) request.getSession().getAttribute("cu"); - workorderRepairContent.setUpsdt(CommUtil.nowDate()); - workorderRepairContent.setUpsuser(cu.getId()); - int result = this.workorderRepairContentService.save(workorderRepairContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - @RequestMapping("/dosave4Library.do") - public ModelAndView dosave4Library(HttpServletRequest request, Model model) { - User cu = (User) request.getSession().getAttribute("cu"); - String libraryRepairIds = request.getParameter("libraryRepairIds"); - String detailId = request.getParameter("detailId"); - String unitId = request.getParameter("unitId"); - - String repairName = request.getParameter("repairName");//维修内容 - String insideRepairTime = request.getParameter("insideRepairTime"); - String outsideRepairCost = request.getParameter("outsideRepairCost"); - String materialCost = request.getParameter("materialCost"); - String totalCost = request.getParameter("totalCost"); - - int result = 0; - if (!libraryRepairIds.equals("")) { - String[] List = libraryRepairIds.split(","); - String[] repairNameList = repairName.split(","); - String[] insideRepairTimeList = insideRepairTime.split(","); - String[] outsideRepairCostList = outsideRepairCost.split(","); - String[] materialCostList = materialCost.split(","); - String[] totalCostList = totalCost.split(","); - - for (int i = 0; i < List.length; i++) { - WorkorderRepairContent workorderRepairContent = new WorkorderRepairContent(); - workorderRepairContent.setId(CommUtil.getUUID()); - workorderRepairContent.setDetailId(detailId); - workorderRepairContent.setRepairContentId(List[i]); - workorderRepairContent.setUnitId(unitId); - workorderRepairContent.setInsuser(cu.getId()); - workorderRepairContent.setInsdt(CommUtil.nowDate()); - //拿到repair_bloc_id 去查找 并拿出工时 工费 赋值 - //TODO 如果厂级为空去找业务区的,这里先找厂级 后续逻辑再补充完整 - /*LibraryRepairBloc libraryRepairBloc = this.libraryRepairBlocService.selectById(List[i]); - if(libraryRepairBloc!=null){ - workorderRepairContent.setSelfQuotaHour(new BigDecimal(Float.toString(libraryRepairBloc.getInsideRepairTime()))); - workorderRepairContent.setSelfActualHour(new BigDecimal(Float.toString(libraryRepairBloc.getInsideRepairTime()))); - workorderRepairContent.setOutsourceQuotaFee(new BigDecimal(Float.toString(libraryRepairBloc.getOutsideRepairCost()))); - workorderRepairContent.setOutsourceActualFee(new BigDecimal(Float.toString(libraryRepairBloc.getOutsideRepairCost()))); - }*/ - workorderRepairContent.setRepairName(repairNameList[i]); - workorderRepairContent.setSelfQuotaHour(Float.parseFloat(insideRepairTimeList[i])); - workorderRepairContent.setSelfActualHour(Float.parseFloat(insideRepairTimeList[i])); - workorderRepairContent.setOutsourceQuotaFee(Float.parseFloat(outsideRepairCostList[i])); - workorderRepairContent.setOutsourceActualFee(Float.parseFloat(outsideRepairCostList[i])); - result = this.workorderRepairContentService.save(workorderRepairContent); - } - } - model.addAttribute("result", result); - return new ModelAndView("result"); - } - - - @RequestMapping("/dodeletes.do") - public String dodeletes(HttpServletRequest request, Model model, - @RequestParam(value = "ids") String ids) { - String msg = ""; - ids = ids.replace(",", "','"); - int res = this.workorderRepairContentService.deleteByWhere("where id in('" + ids + "')"); - if (res >= 0) { - Result result = Result.success(res); - model.addAttribute("result", CommUtil.toJson(result)); - } else { - Result result = Result.failed("保存失败"); - model.addAttribute("result", CommUtil.toJson(result)); - } - return "result"; - } - - @RequestMapping("/doadd.do") - public String doadd(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - model.addAttribute("uuid", CommUtil.getUUID()); - return "workorder/workorderRepairContentAdd"; - } - - @RequestMapping("/doedit.do") - public String doedit(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id) { - WorkorderRepairContent workorderRepairContent = this.workorderRepairContentService.selectById(id); - model.addAttribute("workorderRepairContent", workorderRepairContent); - return "workorder/workorderRepairContentEdit"; - } - - @RequestMapping("/doupdate.do") - public ModelAndView doupdate(HttpServletRequest request, Model model, - @ModelAttribute("workorderRepairContent") WorkorderRepairContent workorderRepairContent) { - User cu = (User) request.getSession().getAttribute("cu"); - workorderRepairContent.setUpsdt(CommUtil.nowDate()); - workorderRepairContent.setUpsuser(cu.getId()); - int result = this.workorderRepairContentService.update(workorderRepairContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - - /** - * 修改自修工时或委外费用 - * - * @param request - * @param model - * @param id - * @param selfActualHour 自修工时 - * @param outsourceActualFee 委外费 - * @return - */ - @RequestMapping("/updateNumber.do") - public ModelAndView updateNumber(HttpServletRequest request, Model model, - @RequestParam(value = "id") String id, - @RequestParam(value = "selfActualHour") String selfActualHour, - @RequestParam(value = "outsourceActualFee") String outsourceActualFee) { - User cu = (User) request.getSession().getAttribute("cu"); - WorkorderRepairContent workorderRepairContent = workorderRepairContentService.selectById(id); - workorderRepairContent.setUpsdt(CommUtil.nowDate()); - workorderRepairContent.setUpsuser(cu.getId()); - workorderRepairContent.setSelfActualHour(Float.parseFloat(selfActualHour)); - workorderRepairContent.setOutsourceActualFee(Float.parseFloat(outsourceActualFee)); - int result = this.workorderRepairContentService.update(workorderRepairContent); - model.addAttribute("result", "{\"res\":\"" + result + "\"}"); - return new ModelAndView("result"); - } - -} diff --git a/src/com/sipai/dao/Listener/ListenerHisDao.java b/src/com/sipai/dao/Listener/ListenerHisDao.java deleted file mode 100644 index 0e4d186b..00000000 --- a/src/com/sipai/dao/Listener/ListenerHisDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.Listener; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.Listener.ListenerHis; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ListenerHisDao extends CommDaoImpl { - - public ListenerHisDao() { - super(); - this.setMappernamespace("Listener.ListenerHisMapper"); - } - - public List selectTopByWhere(String where) { - ListenerHis listenerHis = new ListenerHis(); - listenerHis.setWhere(where); - List list = this.getSqlSession().selectList("Listener.ListenerHisMapper.selectTopByWhere", listenerHis); - return list; - } - -} diff --git a/src/com/sipai/dao/Listener/ListenerInterfaceDao.java b/src/com/sipai/dao/Listener/ListenerInterfaceDao.java deleted file mode 100644 index 780c6234..00000000 --- a/src/com/sipai/dao/Listener/ListenerInterfaceDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.Listener; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.Listener.ListenerInterface; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ListenerInterfaceDao extends CommDaoImpl { - - public ListenerInterfaceDao() { - super(); - this.setMappernamespace("Listener.ListenerInterfaceMapper"); - } - -} diff --git a/src/com/sipai/dao/Listener/ListenerMessageDao.java b/src/com/sipai/dao/Listener/ListenerMessageDao.java deleted file mode 100644 index b57e8915..00000000 --- a/src/com/sipai/dao/Listener/ListenerMessageDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.Listener; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.Listener.ListenerMessage; -import org.springframework.stereotype.Repository; - -@Repository -public class ListenerMessageDao extends CommDaoImpl { - - public ListenerMessageDao() { - super(); - this.setMappernamespace("Listener.ListenerMessageMapper"); - } - -} diff --git a/src/com/sipai/dao/Listener/ListenerPointDao.java b/src/com/sipai/dao/Listener/ListenerPointDao.java deleted file mode 100644 index 6c7dafe1..00000000 --- a/src/com/sipai/dao/Listener/ListenerPointDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.Listener; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.Listener.ListenerPoint; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ListenerPointDao extends CommDaoImpl { - - public ListenerPointDao() { - super(); - this.setMappernamespace("Listener.ListenerPointMapper"); - } - -} diff --git a/src/com/sipai/dao/access/AccessAlarmHistoryDao.java b/src/com/sipai/dao/access/AccessAlarmHistoryDao.java deleted file mode 100644 index b3335cdc..00000000 --- a/src/com/sipai/dao/access/AccessAlarmHistoryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.access; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.access.AccessAlarmHistory; -import org.springframework.stereotype.Repository; - -@Repository -public class AccessAlarmHistoryDao extends CommDaoImpl { - public AccessAlarmHistoryDao() { - super(); - this.setMappernamespace("access.AccessAlarmHistoryMapper"); - } -} diff --git a/src/com/sipai/dao/access/AccessAlarmSettingDao.java b/src/com/sipai/dao/access/AccessAlarmSettingDao.java deleted file mode 100644 index c79f5484..00000000 --- a/src/com/sipai/dao/access/AccessAlarmSettingDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.access; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.access.AccessAlarmSetting; -import org.springframework.stereotype.Repository; - -@Repository -public class AccessAlarmSettingDao extends CommDaoImpl { - public AccessAlarmSettingDao() { - super(); - this.setMappernamespace("access.AccessAlarmSettingMapper"); - } -} diff --git a/src/com/sipai/dao/access/AccessEigenHistoryDao.java b/src/com/sipai/dao/access/AccessEigenHistoryDao.java deleted file mode 100644 index c042d148..00000000 --- a/src/com/sipai/dao/access/AccessEigenHistoryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.access; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.access.AccessEigenHistory; -import org.springframework.stereotype.Repository; - -@Repository -public class AccessEigenHistoryDao extends CommDaoImpl { - public AccessEigenHistoryDao() { - super(); - this.setMappernamespace("access.AccessEigenHistoryMapper"); - } -} diff --git a/src/com/sipai/dao/access/AccessRealDataDao.java b/src/com/sipai/dao/access/AccessRealDataDao.java deleted file mode 100644 index 29992352..00000000 --- a/src/com/sipai/dao/access/AccessRealDataDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.access; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.access.AccessRealData; -import org.springframework.stereotype.Repository; - -@Repository -public class AccessRealDataDao extends CommDaoImpl { - public AccessRealDataDao() { - super(); - this.setMappernamespace("access.AccessRealDataMapper"); - } -} diff --git a/src/com/sipai/dao/accident/AccidentDao.java b/src/com/sipai/dao/accident/AccidentDao.java deleted file mode 100644 index e9cb19ac..00000000 --- a/src/com/sipai/dao/accident/AccidentDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.accident; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.accident.Accident; - -@Repository -public class AccidentDao extends CommDaoImpl { - public AccidentDao(){ - super(); - this.setMappernamespace("accident.AccidentMapper"); - } -} diff --git a/src/com/sipai/dao/accident/AccidentTypeDao.java b/src/com/sipai/dao/accident/AccidentTypeDao.java deleted file mode 100644 index fa2f7300..00000000 --- a/src/com/sipai/dao/accident/AccidentTypeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.accident; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.accident.AccidentType; - -@Repository -public class AccidentTypeDao extends CommDaoImpl { - public AccidentTypeDao(){ - super(); - this.setMappernamespace("accident.AccidentTypeMapper"); - } -} diff --git a/src/com/sipai/dao/accident/ReasonableAdviceDao.java b/src/com/sipai/dao/accident/ReasonableAdviceDao.java deleted file mode 100644 index 98245683..00000000 --- a/src/com/sipai/dao/accident/ReasonableAdviceDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.accident; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.accident.ReasonableAdvice; - -@Repository -public class ReasonableAdviceDao extends CommDaoImpl { - public ReasonableAdviceDao(){ - super(); - this.setMappernamespace("accident.ReasonableAdviceMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/accident/RoastDao.java b/src/com/sipai/dao/accident/RoastDao.java deleted file mode 100644 index 3637e965..00000000 --- a/src/com/sipai/dao/accident/RoastDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.accident; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.accident.Roast; - -@Repository -public class RoastDao extends CommDaoImpl { - public RoastDao(){ - super(); - this.setMappernamespace("accident.RoastMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/achievement/AcceptanceModelDao.java b/src/com/sipai/dao/achievement/AcceptanceModelDao.java deleted file mode 100644 index de101e43..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModel; - -@Repository -public class AcceptanceModelDao extends CommDaoImpl{ - public AcceptanceModelDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/AcceptanceModelDataDao.java b/src/com/sipai/dao/achievement/AcceptanceModelDataDao.java deleted file mode 100644 index 825ae24e..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelData; - -@Repository -public class AcceptanceModelDataDao extends CommDaoImpl{ - public AcceptanceModelDataDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelDataMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/AcceptanceModelMPointDao.java b/src/com/sipai/dao/achievement/AcceptanceModelMPointDao.java deleted file mode 100644 index e7c5a9b3..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelMPointDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelMPoint; - -@Repository -public class AcceptanceModelMPointDao extends CommDaoImpl{ - public AcceptanceModelMPointDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelMPointMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/AcceptanceModelOutputDao.java b/src/com/sipai/dao/achievement/AcceptanceModelOutputDao.java deleted file mode 100644 index d30f89c4..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelOutputDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelOutput; - -@Repository -public class AcceptanceModelOutputDao extends CommDaoImpl { - public AcceptanceModelOutputDao(){ - super(); - this.setMappernamespace("achievement.AcceptanceModelOutputMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/achievement/AcceptanceModelOutputDataDao.java b/src/com/sipai/dao/achievement/AcceptanceModelOutputDataDao.java deleted file mode 100644 index 3b25d196..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelOutputDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelOutputData; - -@Repository -public class AcceptanceModelOutputDataDao extends CommDaoImpl{ - public AcceptanceModelOutputDataDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelOutputDataMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/AcceptanceModelRecordDao.java b/src/com/sipai/dao/achievement/AcceptanceModelRecordDao.java deleted file mode 100644 index 93b6571e..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelRecord; - -@Repository -public class AcceptanceModelRecordDao extends CommDaoImpl{ - public AcceptanceModelRecordDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelRecordMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/AcceptanceModelTextDao.java b/src/com/sipai/dao/achievement/AcceptanceModelTextDao.java deleted file mode 100644 index 7578ec28..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelTextDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelText; - -@Repository -public class AcceptanceModelTextDao extends CommDaoImpl{ - public AcceptanceModelTextDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelTextMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/AcceptanceModelTextDataDao.java b/src/com/sipai/dao/achievement/AcceptanceModelTextDataDao.java deleted file mode 100644 index 583666f1..00000000 --- a/src/com/sipai/dao/achievement/AcceptanceModelTextDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.achievement; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.AcceptanceModelTextData; - -@Repository -public class AcceptanceModelTextDataDao extends CommDaoImpl{ - public AcceptanceModelTextDataDao() { - super(); - this.setMappernamespace("achievement.AcceptanceModelTextDataMapper"); - } -} diff --git a/src/com/sipai/dao/achievement/ModelLibraryDao.java b/src/com/sipai/dao/achievement/ModelLibraryDao.java deleted file mode 100644 index 16ebf7eb..00000000 --- a/src/com/sipai/dao/achievement/ModelLibraryDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.achievement; - - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.achievement.ModelLibrary; -import org.springframework.stereotype.Repository; - -@Repository -public class ModelLibraryDao extends CommDaoImpl { - public ModelLibraryDao() { - super(); - this.setMappernamespace("achievement.ModelLibraryMapper"); - } - - /*public List selectList4Tree(ModelLibrary entity) { - List list = this.getSqlSession().selectList("achievement.ModelLibraryMapper.selectList4Tree", entity); - return list; - }*/ -} diff --git a/src/com/sipai/dao/activiti/LeaveDao.java b/src/com/sipai/dao/activiti/LeaveDao.java deleted file mode 100644 index 5b753d71..00000000 --- a/src/com/sipai/dao/activiti/LeaveDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.activiti; - -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.activiti.Leave; -import com.sipai.entity.work.Group; - -/** - * 请假实体管理接口 - * - * @author HenryYan - */ -@Repository -public class LeaveDao extends CommDaoImpl{ - public LeaveDao() { - super(); - this.setMappernamespace("activiti.LeaveMapper"); - } -} -/* -public interface LeaveDao extends CrudRepository { -}*/ \ No newline at end of file diff --git a/src/com/sipai/dao/activiti/ModelNodeJobDao.java b/src/com/sipai/dao/activiti/ModelNodeJobDao.java deleted file mode 100644 index 7135f00c..00000000 --- a/src/com/sipai/dao/activiti/ModelNodeJobDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.activiti; - - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -import com.sipai.entity.activiti.ModelNodeJob; - - -/** - * 流程模板节点职位关系实体管理接口 - * - * @author HenryYan - */ -@Repository -public class ModelNodeJobDao extends CommDaoImpl{ - public ModelNodeJobDao() { - super(); - this.setMappernamespace("activiti.ModelNodeJobMapper"); - } -} -/* -public interface LeaveDao extends CrudRepository { -}*/ \ No newline at end of file diff --git a/src/com/sipai/dao/activiti/OEProcessDao.java b/src/com/sipai/dao/activiti/OEProcessDao.java deleted file mode 100644 index 50570c08..00000000 --- a/src/com/sipai/dao/activiti/OEProcessDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.activiti; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.activiti.OEProcess; - -@Repository -public class OEProcessDao extends CommDaoImpl{ - public OEProcessDao() { - super(); - this.setMappernamespace("activiti.OEProcessMapper"); - } -} diff --git a/src/com/sipai/dao/administration/IndexClassDao.java b/src/com/sipai/dao/administration/IndexClassDao.java deleted file mode 100644 index 09b27534..00000000 --- a/src/com/sipai/dao/administration/IndexClassDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.IndexClass; -@Repository -public class IndexClassDao extends CommDaoImpl{ - public IndexClassDao(){ - super(); - this.setMappernamespace("administration.IndexClassMapper"); - } -} diff --git a/src/com/sipai/dao/administration/IndexCycleDao.java b/src/com/sipai/dao/administration/IndexCycleDao.java deleted file mode 100644 index a3a94c9f..00000000 --- a/src/com/sipai/dao/administration/IndexCycleDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.IndexCycle; -@Repository -public class IndexCycleDao extends CommDaoImpl{ - public IndexCycleDao(){ - super(); - this.setMappernamespace("administration.IndexCycleMapper"); - } -} diff --git a/src/com/sipai/dao/administration/IndexDao.java b/src/com/sipai/dao/administration/IndexDao.java deleted file mode 100644 index a81552c8..00000000 --- a/src/com/sipai/dao/administration/IndexDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.Index; -@Repository -public class IndexDao extends CommDaoImpl{ - public IndexDao(){ - super(); - this.setMappernamespace("administration.IndexMapper"); - } -} diff --git a/src/com/sipai/dao/administration/IndexWorkDao.java b/src/com/sipai/dao/administration/IndexWorkDao.java deleted file mode 100644 index 63b1674c..00000000 --- a/src/com/sipai/dao/administration/IndexWorkDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.IndexWork; -@Repository -public class IndexWorkDao extends CommDaoImpl{ - public IndexWorkDao(){ - super(); - this.setMappernamespace("administration.IndexWorkMapper"); - } -} diff --git a/src/com/sipai/dao/administration/OrganizationClassDao.java b/src/com/sipai/dao/administration/OrganizationClassDao.java deleted file mode 100644 index ac53bef9..00000000 --- a/src/com/sipai/dao/administration/OrganizationClassDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.OrganizationClass; -@Repository -public class OrganizationClassDao extends CommDaoImpl{ - public OrganizationClassDao(){ - super(); - this.setMappernamespace("administration.OrganizationClassMapper"); - } -} diff --git a/src/com/sipai/dao/administration/OrganizationDao.java b/src/com/sipai/dao/administration/OrganizationDao.java deleted file mode 100644 index 29053544..00000000 --- a/src/com/sipai/dao/administration/OrganizationDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.Organization; -@Repository -public class OrganizationDao extends CommDaoImpl{ - public OrganizationDao(){ - super(); - this.setMappernamespace("administration.OrganizationMapper"); - } -} diff --git a/src/com/sipai/dao/administration/TemporaryDao.java b/src/com/sipai/dao/administration/TemporaryDao.java deleted file mode 100644 index 1e1ae235..00000000 --- a/src/com/sipai/dao/administration/TemporaryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.administration; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.administration.Temporary; -@Repository -public class TemporaryDao extends CommDaoImpl{ - public TemporaryDao(){ - super(); - this.setMappernamespace("administration.TemporaryMapper"); - } -} diff --git a/src/com/sipai/dao/alarm/AlarmConditionDao.java b/src/com/sipai/dao/alarm/AlarmConditionDao.java deleted file mode 100644 index 270bce93..00000000 --- a/src/com/sipai/dao/alarm/AlarmConditionDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmCondition; -@Repository -public class AlarmConditionDao extends CommDaoImpl{ - public AlarmConditionDao(){ - super(); - this.setMappernamespace("alarm.AlarmConditionMapper"); - } -} diff --git a/src/com/sipai/dao/alarm/AlarmInformationDao.java b/src/com/sipai/dao/alarm/AlarmInformationDao.java deleted file mode 100644 index f601e99f..00000000 --- a/src/com/sipai/dao/alarm/AlarmInformationDao.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.dao.alarm; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmInformation; - -@Repository -public class AlarmInformationDao extends CommDaoImpl{ - public AlarmInformationDao(){ - super(); - this.setMappernamespace("alarm.AlarmInformationMapper"); - } - - public AlarmInformation selectCountByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - AlarmInformation alarmInformation = this.getSqlSession().selectOne("alarm.AlarmInformationMapper.getCountByWhere", paramMap); - return alarmInformation; - } - - public List getDistinctMold(AlarmInformation entity){ - List informationList = this.getSqlSession().selectList("alarm.AlarmInformationMapper.getDistinctMold",entity); - return informationList; - } - -} diff --git a/src/com/sipai/dao/alarm/AlarmLevelsConfigDao.java b/src/com/sipai/dao/alarm/AlarmLevelsConfigDao.java deleted file mode 100644 index e14d5894..00000000 --- a/src/com/sipai/dao/alarm/AlarmLevelsConfigDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.alarm; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmLevels; -import com.sipai.entity.alarm.AlarmLevelsConfig; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.Map; - -@Repository -public class AlarmLevelsConfigDao extends CommDaoImpl{ - public AlarmLevelsConfigDao(){ - super(); - this.setMappernamespace("alarm.AlarmLevelsConfigMapper"); - } - - -} diff --git a/src/com/sipai/dao/alarm/AlarmLevelsDao.java b/src/com/sipai/dao/alarm/AlarmLevelsDao.java deleted file mode 100644 index ede5d792..00000000 --- a/src/com/sipai/dao/alarm/AlarmLevelsDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.alarm; - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmLevels; -@Repository -public class AlarmLevelsDao extends CommDaoImpl{ - public AlarmLevelsDao(){ - super(); - this.setMappernamespace("alarm.AlarmLevelsMapper"); - } - - public AlarmLevels selectCountByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - AlarmLevels scadaAlarm = this.getSqlSession().selectOne("alarm.AlarmLevelsMapper.getCountByWhere", paramMap); - return scadaAlarm; - } - -} diff --git a/src/com/sipai/dao/alarm/AlarmMoldDao.java b/src/com/sipai/dao/alarm/AlarmMoldDao.java deleted file mode 100644 index c96a3d76..00000000 --- a/src/com/sipai/dao/alarm/AlarmMoldDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.alarm; - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmMold; -@Repository -public class AlarmMoldDao extends CommDaoImpl{ - public AlarmMoldDao(){ - super(); - this.setMappernamespace("alarm.AlarmMoldMapper"); - } - - public AlarmMold selectCountByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - AlarmMold scadaAlarm = this.getSqlSession().selectOne("alarm.AlarmMoldMapper.getCountByWhere", paramMap); - return scadaAlarm; - } - -} diff --git a/src/com/sipai/dao/alarm/AlarmPointDao.java b/src/com/sipai/dao/alarm/AlarmPointDao.java deleted file mode 100644 index e0f7a55d..00000000 --- a/src/com/sipai/dao/alarm/AlarmPointDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmPoint; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class AlarmPointDao extends CommDaoImpl{ - public AlarmPointDao(){ - super(); - this.setMappernamespace("alarm.AlarmPointMapper"); - } - - public List selectListJoinInformationByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - List scadaAlarm = this.getSqlSession().selectList("alarm.AlarmPointMapper.selectListJoinInformationByWhere", paramMap); - return scadaAlarm; - } -} diff --git a/src/com/sipai/dao/alarm/AlarmPointRiskLevelDao.java b/src/com/sipai/dao/alarm/AlarmPointRiskLevelDao.java deleted file mode 100644 index 67cbc0fe..00000000 --- a/src/com/sipai/dao/alarm/AlarmPointRiskLevelDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmPointRiskLevel; - -@Repository -public class AlarmPointRiskLevelDao extends CommDaoImpl{ - public AlarmPointRiskLevelDao(){ - super(); - this.setMappernamespace("alarm.AlarmPointRiskLevelMapper"); - } -} diff --git a/src/com/sipai/dao/alarm/AlarmRecordDao.java b/src/com/sipai/dao/alarm/AlarmRecordDao.java deleted file mode 100644 index 77e5990f..00000000 --- a/src/com/sipai/dao/alarm/AlarmRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmRecord; -@Repository -public class AlarmRecordDao extends CommDaoImpl{ - public AlarmRecordDao(){ - super(); - this.setMappernamespace("alarm.AlarmRecordMapper"); - } - -} diff --git a/src/com/sipai/dao/alarm/AlarmSolutionDao.java b/src/com/sipai/dao/alarm/AlarmSolutionDao.java deleted file mode 100644 index 75c0193c..00000000 --- a/src/com/sipai/dao/alarm/AlarmSolutionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmSolution; -@Repository -public class AlarmSolutionDao extends CommDaoImpl{ - public AlarmSolutionDao(){ - super(); - this.setMappernamespace("alarm.AlarmSolutionMapper"); - } - -} diff --git a/src/com/sipai/dao/alarm/AlarmSubscribeDao.java b/src/com/sipai/dao/alarm/AlarmSubscribeDao.java deleted file mode 100644 index 176b0a3f..00000000 --- a/src/com/sipai/dao/alarm/AlarmSubscribeDao.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmSubscribe; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class AlarmSubscribeDao extends CommDaoImpl{ - public AlarmSubscribeDao(){ - super(); - this.setMappernamespace("alarm.AlarmSubscribeMapper"); - } - - public List selectLeftOuterListByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - List scadaAlarm = this.getSqlSession().selectList("alarm.AlarmSubscribeMapper.selectLeftOuterListByWhere", paramMap); - return scadaAlarm; - } - - public List selectMoldCountByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - List alarmSubscribe = this.getSqlSession().selectList("alarm.AlarmSubscribeMapper.selectMoldCountByWhere", paramMap); - return alarmSubscribe; - } - - public List selectlevelCountByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - List alarmSubscribe = this.getSqlSession().selectList("alarm.AlarmSubscribeMapper.selectlevelCountByWhere", paramMap); - return alarmSubscribe; - } -} diff --git a/src/com/sipai/dao/alarm/AlarmTypeDao.java b/src/com/sipai/dao/alarm/AlarmTypeDao.java deleted file mode 100644 index 3629a6b5..00000000 --- a/src/com/sipai/dao/alarm/AlarmTypeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.alarm; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.AlarmType; -@Repository -public class AlarmTypeDao extends CommDaoImpl{ - public AlarmTypeDao(){ - super(); - this.setMappernamespace("alarm.AlarmTypeMapper"); - } - -} diff --git a/src/com/sipai/dao/alarm/RiskPDao.java b/src/com/sipai/dao/alarm/RiskPDao.java deleted file mode 100644 index 0d5c2de8..00000000 --- a/src/com/sipai/dao/alarm/RiskPDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.alarm; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.alarm.RiskP; -import org.springframework.stereotype.Repository; - -@Repository -public class RiskPDao extends CommDaoImpl{ - public RiskPDao(){ - super(); - this.setMappernamespace("alarm.RiskPMapper"); - } - - -} diff --git a/src/com/sipai/dao/app/AppDataConfigureDao.java b/src/com/sipai/dao/app/AppDataConfigureDao.java deleted file mode 100644 index 0b034d1a..00000000 --- a/src/com/sipai/dao/app/AppDataConfigureDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.app; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.app.AppDataConfigure; -@Repository -public class AppDataConfigureDao extends CommDaoImpl{ - public AppDataConfigureDao(){ - super(); - this.setMappernamespace("app.AppDataConfigureMapper"); - } - - public List selectListByCacheData(AppDataConfigure appDataConfigure){ - List list= getSqlSession().selectList("app.AppDataConfigureMapper.selectListByCacheData", appDataConfigure); - return list; - } - -} diff --git a/src/com/sipai/dao/app/AppHomePageDataDao.java b/src/com/sipai/dao/app/AppHomePageDataDao.java deleted file mode 100644 index ec6913f3..00000000 --- a/src/com/sipai/dao/app/AppHomePageDataDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.app; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.app.AppHomePageData; -@Repository -public class AppHomePageDataDao extends CommDaoImpl{ - public AppHomePageDataDao(){ - super(); - this.setMappernamespace("app.AppHomePageDataMapper"); - } -} diff --git a/src/com/sipai/dao/app/AppMenuitemDao.java b/src/com/sipai/dao/app/AppMenuitemDao.java deleted file mode 100644 index 3d412b73..00000000 --- a/src/com/sipai/dao/app/AppMenuitemDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.app; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.app.AppMenuitem; -@Repository -public class AppMenuitemDao extends CommDaoImpl{ - public AppMenuitemDao(){ - super(); - this.setMappernamespace("app.AppMenuitemMapper"); - } -} diff --git a/src/com/sipai/dao/app/AppProductMonitorDao.java b/src/com/sipai/dao/app/AppProductMonitorDao.java deleted file mode 100644 index aabe2632..00000000 --- a/src/com/sipai/dao/app/AppProductMonitorDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.app; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.app.AppProductMonitor; -@Repository -public class AppProductMonitorDao extends CommDaoImpl{ - public AppProductMonitorDao(){ - super(); - this.setMappernamespace("app.AppProductMonitorMapper"); - } -} diff --git a/src/com/sipai/dao/app/AppProductMonitorMpDao.java b/src/com/sipai/dao/app/AppProductMonitorMpDao.java deleted file mode 100644 index 73eab731..00000000 --- a/src/com/sipai/dao/app/AppProductMonitorMpDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.app; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.app.AppProductMonitorMp; -@Repository -public class AppProductMonitorMpDao extends CommDaoImpl{ - public AppProductMonitorMpDao(){ - super(); - this.setMappernamespace("app.AppProductMonitorMpMapper"); - } -} diff --git a/src/com/sipai/dao/app/AppRoleMenuDao.java b/src/com/sipai/dao/app/AppRoleMenuDao.java deleted file mode 100644 index 0c9e537b..00000000 --- a/src/com/sipai/dao/app/AppRoleMenuDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.app; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.app.AppRoleMenu; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class AppRoleMenuDao extends CommDaoImpl{ - public AppRoleMenuDao(){ - super(); - this.setMappernamespace("app.AppRoleMenuMapper"); - } - - public List selectDistinctMenuIDListByWhere(AppRoleMenu appRoleMenu){ - List list= getSqlSession().selectList("app.AppRoleMenuMapper.selectDistinctMenuIDListByWhere", appRoleMenu); - return list; - } - -} diff --git a/src/com/sipai/dao/base/BasicComponentsDao.java b/src/com/sipai/dao/base/BasicComponentsDao.java deleted file mode 100644 index fcf79a7f..00000000 --- a/src/com/sipai/dao/base/BasicComponentsDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.base; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.BasicComponents; - -@Repository -public class BasicComponentsDao extends CommDaoImpl{ - public BasicComponentsDao() { - super(); - this.setMappernamespace("base.BasicComponentsMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/base/BasicConfigureDao.java b/src/com/sipai/dao/base/BasicConfigureDao.java deleted file mode 100644 index 3796ea1e..00000000 --- a/src/com/sipai/dao/base/BasicConfigureDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.base; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.BasicConfigure; - -@Repository -public class BasicConfigureDao extends CommDaoImpl{ - public BasicConfigureDao() { - super(); - this.setMappernamespace("base.BasicConfigureMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/base/BasicHomePageDao.java b/src/com/sipai/dao/base/BasicHomePageDao.java deleted file mode 100644 index 218da988..00000000 --- a/src/com/sipai/dao/base/BasicHomePageDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.base; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.BasicHomePage; - -@Repository -public class BasicHomePageDao extends CommDaoImpl{ - public BasicHomePageDao() { - super(); - this.setMappernamespace("base.BasicHomePageMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/base/CommDao.java b/src/com/sipai/dao/base/CommDao.java deleted file mode 100644 index 049faa12..00000000 --- a/src/com/sipai/dao/base/CommDao.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.sipai.dao.base; - -import java.util.List; - - -public interface CommDao{ - /**====基础的CURD操作====**/ - /** - * 根据id查找唯一对象 - * @param mapper - * @param t - * @return - */ - public T selectByPrimaryKey(String t); - /** - * 根据id删除唯一对象 - * @param mapper - * @param t - * @return - */ - public int deleteByPrimaryKey(String t); - /** - * 根据对象信息插入数据 - * @param mapper - * @param t - * @return - */ - public int insert(T t); - /** - * 根据对象信息插入数据,只插入不为null的字段,不会影响有默认值的字段 - * @param mapper - * @param t - * @return - */ -// public int insertSelective(T t); - /** - * 根据对象信息更新数据,只跟新不为null的字段 - * @param mapper - * @param t - * @return - */ - public int updateByPrimaryKeySelective(T t); - /** - * 根据对象id信息更新数据,只跟新不为null的字段 - * @param mapper - * @param t - * @return - */ -// public int updateByPrimaryKey(T t); - - /**=====扩展的查询=====**/ - /** - * 根据where条件查找唯一对象 - * @param mapper - * @param t - * @return - */ - public T selectByWhere(T t); - - /** - * 根据where条件查找对象列表 - * @param mapper - * @param t - * @return - */ - public List selectList(T t); - /** - * 查找和t某些值相等的对象列表 - * @param mapper - * @param t - * @return - */ - - /** - * 根据where条件查找对象列表 - * @param mapper - * @param t - * @return - */ - public List selectListByWhere(T t); - /** - * 查找和t某些值相等的对象列表 - * @param mapper - * @param t - * @return - */ - public List selectListByObj(T t); - /** - * 根据sql语句查找对象列表 - * @param mapper - * @param t - * @return - */ - public List selectListBySql(T t); - /** - * 根据sql语句查询唯一字段值 - * @param mapper - * @param t - * @return - */ - public Object selectValueBySql(T t); - /** - * 根据where条件删除 - * @param mapper - * @param t - */ - public int deleteByWhere(T t); - /** - * 根据where条件更新 - * @param mapper - * @param t - */ - public int updateByWhere(T t); - /** - * 执行sql语句 :增,删,改 - * @param mapper - * @param t - */ - public int executeSql(T t); - public void commit(); - public void close(); - - -} - diff --git a/src/com/sipai/dao/base/CommDaoImpl.java b/src/com/sipai/dao/base/CommDaoImpl.java deleted file mode 100644 index 4b5bb112..00000000 --- a/src/com/sipai/dao/base/CommDaoImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.dao.base; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.springframework.stereotype.Repository; - -@Repository -public class CommDaoImpl implements CommDao { - @Resource - private SqlSessionFactory sqlSessionFactory; - @Resource - private SqlSession sqlSession; - private String mappernamespace; // 需要操作的mappernamespace名(也是数据库表名) - private boolean isAuto = true;// 默认自动提交 - - public CommDaoImpl() { - super(); - } - - public SqlSessionFactory getSqlSessionFactory() { - return sqlSessionFactory; - } - - public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) { - this.sqlSessionFactory = sqlSessionFactory; - } - - public boolean isAuto() { - return isAuto; - } - - public void setAuto(boolean isAuto) { - this.isAuto = isAuto; - } - - public String getMappernamespace() { - return mappernamespace; - } - - public void setMappernamespace(String mappernamespace) { - this.mappernamespace = mappernamespace; - } - - public T selectByPrimaryKey(String t){ - T o = getSqlSession().selectOne(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return o; - } - /** - * wxp为activiti测试修改 - * @param t - * @return - */ - public T selectByID(BigDecimal t){ - T o = getSqlSession().selectOne(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return o; - } - public int deleteByPrimaryKey(String t) { - return getSqlSession().delete(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int insert(T t){ - return getSqlSession().insert(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int insertSelective(T t){ - return getSqlSession().insert(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByPrimaryKeySelective(T t){ - return getSqlSession().update(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - -// public int updateByPrimaryKey(T t){ -// return getSqlSession().update(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); -// } - - public T selectByWhere( T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - public List selectList(T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListByWhere( T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListByObj(T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - public List selectListByt( T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListBySql( T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public T selectValueBySql( T t) { - List list = getSqlSession().selectList(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - public int deleteByWhere( T t) { - return this.getSqlSession().delete(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByWhere( T t) { - return this.getSqlSession().update(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int executeSql( T t) { - return this.getSqlSession().update(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public void commit() { - if (sqlSession != null) - sqlSession.commit(); - } - - public SqlSession getSqlSession() { - sqlSession = sqlSession == null ? sqlSessionFactory.openSession(isAuto) : sqlSession; - return sqlSession; - } - - public void close() { - if (sqlSession != null) - sqlSession.close(); - } - -} diff --git a/src/com/sipai/dao/base/CommDaoImplERP.java b/src/com/sipai/dao/base/CommDaoImplERP.java deleted file mode 100644 index c1d46545..00000000 --- a/src/com/sipai/dao/base/CommDaoImplERP.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.dao.base; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.springframework.stereotype.Repository; - -@Repository -public class CommDaoImplERP implements CommDao { - @Resource - private SqlSessionFactory sqlSessionFactoryERP; - @Resource - private SqlSession sqlSessionERP; - private String mappernamespaceERP; // 需要操作的mappernamespace名(也是数据库表名) - private boolean isAuto = true;// 默认自动提交 - - public CommDaoImplERP() { - super(); - } - - public SqlSessionFactory getSqlSessionFactory() { - return sqlSessionFactoryERP; - } - - public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) { - this.sqlSessionFactoryERP = sqlSessionFactory; - } - - public boolean isAuto() { - return isAuto; - } - - public void setAuto(boolean isAuto) { - this.isAuto = isAuto; - } - - public String getMappernamespace() { - return mappernamespaceERP; - } - - public void setMappernamespace(String mappernamespace) { - this.mappernamespaceERP = mappernamespace; - } - - public T selectByPrimaryKey(String t){ - T o = getSqlSession().selectOne(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return o; - } - /** - * wxp为activiti测试修改 - * @param t - * @return - */ - public T selectByID(BigDecimal t){ - T o = getSqlSession().selectOne(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return o; - } - public int deleteByPrimaryKey(String t) { - return getSqlSession().delete(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int insert(T t){ - return getSqlSession().insert(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int insertSelective(T t){ - return getSqlSession().insert(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByPrimaryKeySelective(T t){ - return getSqlSession().update(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - -// public int updateByPrimaryKey(T t){ -// return getSqlSession().update(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); -// } - - public T selectByWhere( T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - public List selectList(T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListByWhere( T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListByObj(T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - public List selectListByt( T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListBySql( T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public T selectValueBySql( T t) { - List list = getSqlSession().selectList(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - public int deleteByWhere( T t) { - return this.getSqlSession().delete(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByWhere( T t) { - return this.getSqlSession().update(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int executeSql( T t) { - return this.getSqlSession().update(mappernamespaceERP+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public void commit() { - if (sqlSessionERP != null) - sqlSessionERP.commit(); - } - - public SqlSession getSqlSession() { - sqlSessionERP = sqlSessionERP == null ? sqlSessionFactoryERP.openSession(isAuto) : sqlSessionERP; - return sqlSessionERP; - } - - public void close() { - if (sqlSessionERP != null) - sqlSessionERP.close(); - } - -} diff --git a/src/com/sipai/dao/base/CommDaoImplScada.java b/src/com/sipai/dao/base/CommDaoImplScada.java deleted file mode 100644 index 1147e5e0..00000000 --- a/src/com/sipai/dao/base/CommDaoImplScada.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.dao.base; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.springframework.stereotype.Repository; - -@Repository -public class CommDaoImplScada implements CommDao { - @Resource - private SqlSessionFactory sqlSessionFactoryScada; - @Resource - private SqlSession sqlSessionScada; - private String mappernamespacescada; // 需要操作的mappernamespace名(也是数据库表名) - private boolean isAuto = true;// 默认自动提交 - - public CommDaoImplScada() { - super(); - } - - public SqlSessionFactory getSqlSessionFactory() { - return sqlSessionFactoryScada; - } - - public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) { - this.sqlSessionFactoryScada = sqlSessionFactory; - } - - public boolean isAuto() { - return isAuto; - } - - public void setAuto(boolean isAuto) { - this.isAuto = isAuto; - } - - public String getMappernamespace() { - return mappernamespacescada; - } - - public void setMappernamespace(String mappernamespace) { - this.mappernamespacescada = mappernamespace; - } - - public T selectByPrimaryKey(String t){ - T o = getSqlSession().selectOne(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return o; - } - /** - * wxp为activiti测试修改 - * @param t - * @return - */ - public T selectByID(BigDecimal t){ - T o = getSqlSession().selectOne(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return o; - } - public int deleteByPrimaryKey(String t) { - return getSqlSession().delete(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int insert(T t){ - return getSqlSession().insert(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int insertSelective(T t){ - return getSqlSession().insert(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByPrimaryKeySelective(T t){ - return getSqlSession().update(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - -// public int updateByPrimaryKey(T t){ -// return getSqlSession().update(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); -// } - - public T selectByWhere( T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - public List selectList(T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListByWhere( T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListByObj(T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - public List selectListByt( T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListBySql( T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public T selectValueBySql( T t) { - List list = getSqlSession().selectList(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - public int deleteByWhere( T t) { - return this.getSqlSession().delete(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByWhere( T t) { - return this.getSqlSession().update(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int executeSql( T t) { - return this.getSqlSession().update(mappernamespacescada+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public void commit() { - if (sqlSessionScada != null) - sqlSessionScada.commit(); - } - - public SqlSession getSqlSession() { - sqlSessionScada = sqlSessionScada == null ? sqlSessionFactoryScada.openSession(isAuto) : sqlSessionScada; - return sqlSessionScada; - } - - public void close() { - if (sqlSessionScada != null) - sqlSessionScada.close(); - } - -} diff --git a/src/com/sipai/dao/base/CommonFileDao.java b/src/com/sipai/dao/base/CommonFileDao.java deleted file mode 100644 index 0bb271dd..00000000 --- a/src/com/sipai/dao/base/CommonFileDao.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.dao.base; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.scada.MPointHistory; -@Repository -public class CommonFileDao extends CommDaoImpl { - - public CommonFileDao() { - super(); - this.setMappernamespace("base.CommonFileMapper"); - } - - public List selectByMasterId(String masterid){ - return this.getSqlSession().selectList(this.getMappernamespace()+".selectByMasterId",masterid); - } - - public int deleteByMasterId(String masterid){ - return this.getSqlSession().delete(this.getMappernamespace()+".deleteByMasterId",masterid); - } - - /** - * 动态切换插入表 - * */ - public List selectListByTableAWhere(String tablename, String wherestr) { - Map paramMap=new HashMap<>(); - paramMap.put("table",tablename); - paramMap.put("where",wherestr); - List list = getSqlSession().selectList(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - public int deleteByTableAWhere(String tablename, String wherestr) { - Map paramMap=new HashMap<>(); - paramMap.put("table",tablename); - paramMap.put("where",wherestr); - return this.getSqlSession().delete(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - public int insertByTable(String tablename, CommonFile commonFile) { - Map paramMap=new HashMap<>(); - paramMap.put("table",tablename); - try { - Field[] fields =commonFile.getClass().getDeclaredFields(); - for (Field field : fields) { - field.setAccessible(true); - String fieldName = field.getName(); - Object value = field.get(commonFile); - paramMap.put(fieldName, value); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return this.getSqlSession().insert(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - public int insertByTable2(String tablename, CommonFile commonFile) { - Map paramMap=new HashMap<>(); - paramMap.put("table",tablename); - try { - Field[] fields =commonFile.getClass().getDeclaredFields(); - for (Field field : fields) { - field.setAccessible(true); - String fieldName = field.getName(); - Object value = field.get(commonFile); - paramMap.put(fieldName, value); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return this.getSqlSession().insert(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - public List selectListByTableAWhereForEquip(String tablename, String wherestr) { - Map paramMap=new HashMap<>(); - paramMap.put("table",tablename); - paramMap.put("where",wherestr); - List list = getSqlSession().selectList(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } -} diff --git a/src/com/sipai/dao/base/MainConfigDao.java b/src/com/sipai/dao/base/MainConfigDao.java deleted file mode 100644 index 0f4fb889..00000000 --- a/src/com/sipai/dao/base/MainConfigDao.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.dao.base; - -import com.sipai.entity.base.MainConfig; -import org.springframework.stereotype.Repository; - -@Repository -public class MainConfigDao extends CommDaoImpl{ - public MainConfigDao() { - super(); - this.setMappernamespace("base.MainConfigMapper"); - } -} diff --git a/src/com/sipai/dao/base/MainPageDao.java b/src/com/sipai/dao/base/MainPageDao.java deleted file mode 100644 index 1757deb6..00000000 --- a/src/com/sipai/dao/base/MainPageDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.base; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.MainPage; - -@Repository -public class MainPageDao extends CommDaoImpl{ - public MainPageDao() { - super(); - this.setMappernamespace("base.MainPageMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/base/MainPageTypeDao.java b/src/com/sipai/dao/base/MainPageTypeDao.java deleted file mode 100644 index 0111e935..00000000 --- a/src/com/sipai/dao/base/MainPageTypeDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.base; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.MainPageType; - -@Repository -public class MainPageTypeDao extends CommDaoImpl{ - public MainPageTypeDao() { - super(); - this.setMappernamespace("base.MainPageTypeMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/base/MainPageTypeUserDao.java b/src/com/sipai/dao/base/MainPageTypeUserDao.java deleted file mode 100644 index dd4b7f3e..00000000 --- a/src/com/sipai/dao/base/MainPageTypeUserDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.base; - - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.MainPageTypeUser; - -@Repository -public class MainPageTypeUserDao extends CommDaoImpl{ - public MainPageTypeUserDao() { - super(); - this.setMappernamespace("base.MainPageTypeUserMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/bim/BIMAlarmThresholdDao.java b/src/com/sipai/dao/bim/BIMAlarmThresholdDao.java deleted file mode 100644 index 28c47d54..00000000 --- a/src/com/sipai/dao/bim/BIMAlarmThresholdDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.bim; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.BIMAlarmThreshold; -import org.springframework.stereotype.Repository; - -@Repository -public class BIMAlarmThresholdDao extends CommDaoImpl { - public BIMAlarmThresholdDao() { - super(); - this.setMappernamespace("bim.BIMAlarmThresholdMapper"); - } -} diff --git a/src/com/sipai/dao/bim/BIMCDHomePageTreeDao.java b/src/com/sipai/dao/bim/BIMCDHomePageTreeDao.java deleted file mode 100644 index c88ba34e..00000000 --- a/src/com/sipai/dao/bim/BIMCDHomePageTreeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.bim; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.BIMCDHomePageTree; -import org.springframework.stereotype.Repository; - -@Repository -public class BIMCDHomePageTreeDao extends CommDaoImpl { - public BIMCDHomePageTreeDao() { - super(); - this.setMappernamespace("bim.BIMCDHomePageTreeMapper"); - } -} diff --git a/src/com/sipai/dao/bim/BIMCameraDao.java b/src/com/sipai/dao/bim/BIMCameraDao.java deleted file mode 100644 index bece37f3..00000000 --- a/src/com/sipai/dao/bim/BIMCameraDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.bim; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.BIMCamera; -import org.springframework.stereotype.Repository; - -@Repository -public class BIMCameraDao extends CommDaoImpl { - public BIMCameraDao() { - super(); - this.setMappernamespace("bim.BIMCameraMapper"); - } -} diff --git a/src/com/sipai/dao/bim/BIMCurrencyDao.java b/src/com/sipai/dao/bim/BIMCurrencyDao.java deleted file mode 100644 index 4e4a2bf5..00000000 --- a/src/com/sipai/dao/bim/BIMCurrencyDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.bim; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.BIMCurrency; - -@Repository -public class BIMCurrencyDao extends CommDaoImpl{ - public BIMCurrencyDao() { - super(); - this.setMappernamespace("bim.BIMCurrencyMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/bim/BimRouteDataDao.java b/src/com/sipai/dao/bim/BimRouteDataDao.java deleted file mode 100644 index 4dfd06d4..00000000 --- a/src/com/sipai/dao/bim/BimRouteDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.bim; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.BimRouteData; - -@Repository -public class BimRouteDataDao extends CommDaoImpl{ - public BimRouteDataDao() { - super(); - this.setMappernamespace("bim.BimRouteDataMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/bim/BimRouteEqDataDao.java b/src/com/sipai/dao/bim/BimRouteEqDataDao.java deleted file mode 100644 index 2510954c..00000000 --- a/src/com/sipai/dao/bim/BimRouteEqDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.bim; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.BimRouteEqData; - -@Repository -public class BimRouteEqDataDao extends CommDaoImpl{ - public BimRouteEqDataDao() { - super(); - this.setMappernamespace("bim.BimRouteEqDataMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/bim/YsAlarmRecordDao.java b/src/com/sipai/dao/bim/YsAlarmRecordDao.java deleted file mode 100644 index 63a12bf8..00000000 --- a/src/com/sipai/dao/bim/YsAlarmRecordDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.bim; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bim.YsAlarmRecord; -import org.springframework.stereotype.Repository; - -@Repository -public class YsAlarmRecordDao extends CommDaoImpl { - public YsAlarmRecordDao() { - super(); - this.setMappernamespace("bim.YsAlarmRecordMapper"); - } -} diff --git a/src/com/sipai/dao/bot/BotDao.java b/src/com/sipai/dao/bot/BotDao.java deleted file mode 100644 index afc5ec72..00000000 --- a/src/com/sipai/dao/bot/BotDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.bot; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.bot.Bot; -@Repository -public class BotDao extends CommDaoImpl{ - public BotDao(){ - super(); - this.setMappernamespace("bot.BotMapper"); - } -} diff --git a/src/com/sipai/dao/business/BusinessUnitAuditDao.java b/src/com/sipai/dao/business/BusinessUnitAuditDao.java deleted file mode 100644 index 5121069b..00000000 --- a/src/com/sipai/dao/business/BusinessUnitAuditDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.business; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; - -@Repository -public class BusinessUnitAuditDao extends CommDaoImpl{ - public BusinessUnitAuditDao() { - super(); - this.setMappernamespace("business.BusinessUnitAuditMapper"); - } - -} diff --git a/src/com/sipai/dao/business/BusinessUnitDao.java b/src/com/sipai/dao/business/BusinessUnitDao.java deleted file mode 100644 index 0c9b1f45..00000000 --- a/src/com/sipai/dao/business/BusinessUnitDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.business; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnit; - -@Repository -public class BusinessUnitDao extends CommDaoImpl{ - public BusinessUnitDao() { - super(); - this.setMappernamespace("business.BusinessUnitMapper"); - } - -} diff --git a/src/com/sipai/dao/business/BusinessUnitDeptApplyDao.java b/src/com/sipai/dao/business/BusinessUnitDeptApplyDao.java deleted file mode 100644 index 4677b67d..00000000 --- a/src/com/sipai/dao/business/BusinessUnitDeptApplyDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.business; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitHandle; - -@Repository -public class BusinessUnitDeptApplyDao extends CommDaoImpl{ - public BusinessUnitDeptApplyDao() { - super(); - this.setMappernamespace("business.BusinessUnitDeptApplyMapper"); - } - -} diff --git a/src/com/sipai/dao/business/BusinessUnitHandleDao.java b/src/com/sipai/dao/business/BusinessUnitHandleDao.java deleted file mode 100644 index 273bbb61..00000000 --- a/src/com/sipai/dao/business/BusinessUnitHandleDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.business; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitHandle; - -@Repository -public class BusinessUnitHandleDao extends CommDaoImpl{ - public BusinessUnitHandleDao() { - super(); - this.setMappernamespace("business.BusinessUnitHandleMapper"); - } - - public List selectdoneworkList(BusinessUnitHandle businessUnitHandle){ - List list = this.getSqlSession().selectList("business.BusinessUnitHandleMapper.selectdoneworkList", businessUnitHandle); - return list; - } -} diff --git a/src/com/sipai/dao/business/BusinessUnitHandleDetailDao.java b/src/com/sipai/dao/business/BusinessUnitHandleDetailDao.java deleted file mode 100644 index 2875fea9..00000000 --- a/src/com/sipai/dao/business/BusinessUnitHandleDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.business; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnitHandleDetail; - -@Repository -public class BusinessUnitHandleDetailDao extends CommDaoImpl{ - public BusinessUnitHandleDetailDao() { - super(); - this.setMappernamespace("business.BusinessUnitHandleDetailMapper"); - } - -} diff --git a/src/com/sipai/dao/business/BusinessUnitInquiryDao.java b/src/com/sipai/dao/business/BusinessUnitInquiryDao.java deleted file mode 100644 index 470ef641..00000000 --- a/src/com/sipai/dao/business/BusinessUnitInquiryDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.business; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitInquiry; - -@Repository -public class BusinessUnitInquiryDao extends CommDaoImpl{ - public BusinessUnitInquiryDao() { - super(); - this.setMappernamespace("business.BusinessUnitInquiryMapper"); - } - -} diff --git a/src/com/sipai/dao/business/BusinessUnitIssueDao.java b/src/com/sipai/dao/business/BusinessUnitIssueDao.java deleted file mode 100644 index c482cc0a..00000000 --- a/src/com/sipai/dao/business/BusinessUnitIssueDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.business; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitIssue; - -@Repository -public class BusinessUnitIssueDao extends CommDaoImpl{ - public BusinessUnitIssueDao() { - super(); - this.setMappernamespace("business.BusinessUnitIssueMapper"); - } - -} diff --git a/src/com/sipai/dao/command/EmergencyConfigureDao.java b/src/com/sipai/dao/command/EmergencyConfigureDao.java deleted file mode 100644 index 530e6eb4..00000000 --- a/src/com/sipai/dao/command/EmergencyConfigureDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.command; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyConfigureInfo; - - -@Repository -public class EmergencyConfigureDao extends CommDaoImpl{ - public EmergencyConfigureDao() { - super(); - this.setMappernamespace("command.EmergencyConfigureMapper"); - } - - public List getListByuser(EmergencyConfigure emergencyConfigure){ - List list = this.getSqlSession().selectList("command.EmergencyConfigureMapper.selectusernameByWhere", emergencyConfigure); - return list; - } - -} diff --git a/src/com/sipai/dao/command/EmergencyConfigureDetailDao.java b/src/com/sipai/dao/command/EmergencyConfigureDetailDao.java deleted file mode 100644 index 91ba734c..00000000 --- a/src/com/sipai/dao/command/EmergencyConfigureDetailDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.command; -import com.sipai.dao.base.CommDaoImpl; -import org.springframework.stereotype.Repository; -import com.sipai.entity.command.EmergencyConfigureDetail; - -@Repository -public class EmergencyConfigureDetailDao extends CommDaoImpl { - public EmergencyConfigureDetailDao() { - super(); - this.setMappernamespace("command.EmergencyConfigureDetailMapper"); - } - -} diff --git a/src/com/sipai/dao/command/EmergencyConfigureInfoDao.java b/src/com/sipai/dao/command/EmergencyConfigureInfoDao.java deleted file mode 100644 index bc06e0c5..00000000 --- a/src/com/sipai/dao/command/EmergencyConfigureInfoDao.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.dao.command; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigureInfo; - -@Repository -public class EmergencyConfigureInfoDao extends CommDaoImpl { - public EmergencyConfigureInfoDao() { - super(); - this.setMappernamespace("command.EmergencyConfigureInfoMapper"); - } - - public List getListByStartcondition(EmergencyConfigureInfo emergencyConfigureInfo){ - List list = this.getSqlSession().selectList("command.EmergencyConfigureInfoMapper.selectstartconditionListByWhere", emergencyConfigureInfo); - return list; - } - - public List getListByrank(EmergencyConfigureInfo emergencyConfigureInfo){ - List list = this.getSqlSession().selectList("command.EmergencyConfigureInfoMapper.selectrankListByWhere", emergencyConfigureInfo); - return list; - } - - public List getListBycontentsstart(EmergencyConfigureInfo emergencyConfigureInfo){ - List list = this.getSqlSession().selectList("command.EmergencyConfigureInfoMapper.selectcontentsstartListByWhere", emergencyConfigureInfo); - return list; - } - - public List getListBycount(EmergencyConfigureInfo emergencyConfigureInfo){ - List list = this.getSqlSession().selectList("command.EmergencyConfigureInfoMapper.selectcountByWhere", emergencyConfigureInfo); - return list; - } - -} diff --git a/src/com/sipai/dao/command/EmergencyConfigureWorkOrderDao.java b/src/com/sipai/dao/command/EmergencyConfigureWorkOrderDao.java deleted file mode 100644 index d1f12cf4..00000000 --- a/src/com/sipai/dao/command/EmergencyConfigureWorkOrderDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.command; - -import java.util.List; - -import org.springframework.stereotype.Repository; - - - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyConfigureWorkOrder; -import com.sipai.entity.command.EmergencyRecords; - -@Repository -public class EmergencyConfigureWorkOrderDao extends CommDaoImpl{ - public EmergencyConfigureWorkOrderDao() { - super(); - this.setMappernamespace("command.EmergencyConfigureWorkOrderMapper"); - } - - public List getListByrecords(EmergencyConfigureWorkOrder emergencyConfigureWorkOrder){ - List list = this.getSqlSession().selectList("command.EmergencyConfigureWorkOrderMapper.selectrecordslistByWhere", emergencyConfigureWorkOrder); - return list; - } - -} diff --git a/src/com/sipai/dao/command/EmergencyConfigurefileDao.java b/src/com/sipai/dao/command/EmergencyConfigurefileDao.java deleted file mode 100644 index 77e32ae6..00000000 --- a/src/com/sipai/dao/command/EmergencyConfigurefileDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.command; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigurefile; - - -@Repository -public class EmergencyConfigurefileDao extends CommDaoImpl{ - public EmergencyConfigurefileDao(){ - super(); - this.setMappernamespace("command.EmergencyConfigurefileMapper"); - } - -} diff --git a/src/com/sipai/dao/command/EmergencyPlanDao.java b/src/com/sipai/dao/command/EmergencyPlanDao.java deleted file mode 100644 index cf3e889a..00000000 --- a/src/com/sipai/dao/command/EmergencyPlanDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.command; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyPlan; -import org.springframework.stereotype.Repository; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2021/10/23/10:22 - * @Description: - */ -@Repository -public class EmergencyPlanDao extends CommDaoImpl { - public EmergencyPlanDao() { - super(); - this.setMappernamespace("command.EmergencyPlanMapper"); - } -} diff --git a/src/com/sipai/dao/command/EmergencyRecordsDao.java b/src/com/sipai/dao/command/EmergencyRecordsDao.java deleted file mode 100644 index c1823afc..00000000 --- a/src/com/sipai/dao/command/EmergencyRecordsDao.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.dao.command; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyRecords; - - -@Repository -public class EmergencyRecordsDao extends CommDaoImpl { - public EmergencyRecordsDao(){ - super(); - this.setMappernamespace("command.EmergencyRecordsMapper"); - } - - public List getListByrecords(EmergencyRecords emergencyRecords){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsMapper.selectrecordslistByWhere", emergencyRecords); - return list; - } - - public List getTypeCountByrecords(EmergencyRecords emergencyRecords){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsMapper.selectTypeCountByWhere", emergencyRecords); - return list; - } - - public List getAllCountByrecords(EmergencyRecords emergencyRecords){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsMapper.selectAllCountByWhere", emergencyRecords); - return list; - } - - public List getAllCountByrecordsAsc(EmergencyRecords emergencyRecords){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsMapper.selectAllCountByWhereAsc", emergencyRecords); - return list; - } - - public List getAllCountByrecordsDesc(EmergencyRecords emergencyRecords){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsMapper.selectAllCountByWhereDesc", emergencyRecords); - return list; - } - -} diff --git a/src/com/sipai/dao/command/EmergencyRecordsDetailDao.java b/src/com/sipai/dao/command/EmergencyRecordsDetailDao.java deleted file mode 100644 index f60eab85..00000000 --- a/src/com/sipai/dao/command/EmergencyRecordsDetailDao.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.dao.command; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.entity.command.EmergencyRecordsDetail; - -@Repository -public class EmergencyRecordsDetailDao extends CommDaoImpl { - public EmergencyRecordsDetailDao(){ - super(); - this.setMappernamespace("command.EmergencyRecordsDetailMapper"); - } - - public List getListByrank(EmergencyRecordsDetail emergencyRecordsDetail){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsDetailMapper.selectrankListByWhere", emergencyRecordsDetail); - return list; - } - - public List getListBycontent(EmergencyRecordsDetail emergencyRecordsDetail){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsDetailMapper.selectcontentListByWhere", emergencyRecordsDetail); - return list; - } - - public List selectListForJson(EmergencyRecordsDetail entity){ - List list = getSqlSession().selectList("command.EmergencyRecordsDetailMapper.selectListForJson",entity); - return list; - } - -} diff --git a/src/com/sipai/dao/command/EmergencyRecordsWorkOrderDao.java b/src/com/sipai/dao/command/EmergencyRecordsWorkOrderDao.java deleted file mode 100644 index 40687c42..00000000 --- a/src/com/sipai/dao/command/EmergencyRecordsWorkOrderDao.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.dao.command; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyRecordsWorkOrder; - -@Repository -public class EmergencyRecordsWorkOrderDao extends CommDaoImpl { - public EmergencyRecordsWorkOrderDao(){ - super(); - this.setMappernamespace("command.EmergencyRecordsWorkOrderMapper"); - } - - public List getListByuser(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsWorkOrderMapper.selectusernameByWhere", emergencyRecordsWorkOrder); - return list; - } - - public List getListBycompany(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsWorkOrderMapper.selectcompanynameByWhere", emergencyRecordsWorkOrder); - return list; - } - - public List getListBylayer(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder){ - List list = this.getSqlSession().selectList("command.EmergencyRecordsWorkOrderMapper.selectlistlayerByWhere", emergencyRecordsWorkOrder); - return list; - } - -} diff --git a/src/com/sipai/dao/cqbyt/CqbytSampleValueDao.java b/src/com/sipai/dao/cqbyt/CqbytSampleValueDao.java deleted file mode 100644 index a6e4c039..00000000 --- a/src/com/sipai/dao/cqbyt/CqbytSampleValueDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.cqbyt; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.cqbyt.CqbytSampleValue; - -@Repository -public class CqbytSampleValueDao extends CommDaoImpl { - public CqbytSampleValueDao(){ - super(); - this.setMappernamespace("cqbyt.CqbytSampleValueMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/cqbyt/CqbytVISITOUTINDATADao.java b/src/com/sipai/dao/cqbyt/CqbytVISITOUTINDATADao.java deleted file mode 100644 index 89739314..00000000 --- a/src/com/sipai/dao/cqbyt/CqbytVISITOUTINDATADao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.cqbyt; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.cqbyt.CqbytVISITOUTINDATA; - -@Repository -public class CqbytVISITOUTINDATADao extends CommDaoImpl { - public CqbytVISITOUTINDATADao(){ - super(); - this.setMappernamespace("cqbyt.CqbytVISITOUTINDATAMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/cqbyt/KpiAnalysisDao.java b/src/com/sipai/dao/cqbyt/KpiAnalysisDao.java deleted file mode 100644 index 109b8600..00000000 --- a/src/com/sipai/dao/cqbyt/KpiAnalysisDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.cqbyt; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.cqbyt.KpiAnalysis; - -@Repository -public class KpiAnalysisDao extends CommDaoImpl { - public KpiAnalysisDao(){ - super(); - this.setMappernamespace("cqbyt.KpiAnalysisMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/cqbyt/TestReportDao.java b/src/com/sipai/dao/cqbyt/TestReportDao.java deleted file mode 100644 index 48c18353..00000000 --- a/src/com/sipai/dao/cqbyt/TestReportDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.cqbyt; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.cqbyt.TestReport; -import java.util.List; -import org.springframework.stereotype.Repository; - -@Repository -public class TestReportDao extends CommDaoImpl { - public TestReportDao() { - this.setMappernamespace("cqbyt.TestReportMapper"); - } -} diff --git a/src/com/sipai/dao/cqbyt/TestReportDetailsDao.java b/src/com/sipai/dao/cqbyt/TestReportDetailsDao.java deleted file mode 100644 index 7f30945b..00000000 --- a/src/com/sipai/dao/cqbyt/TestReportDetailsDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.cqbyt; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.cqbyt.TestReportDetails; -import java.util.List; -import org.springframework.stereotype.Repository; - -@Repository -public class TestReportDetailsDao extends CommDaoImpl { - public TestReportDetailsDao() { - this.setMappernamespace("cqbyt.TestReportDetailsMapper"); - } -} diff --git a/src/com/sipai/dao/cqbyt/YtsjDao.java b/src/com/sipai/dao/cqbyt/YtsjDao.java deleted file mode 100644 index 1adf8d50..00000000 --- a/src/com/sipai/dao/cqbyt/YtsjDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.cqbyt; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.cqbyt.Ytsj; -import java.util.List; -import org.springframework.stereotype.Repository; - -@Repository -public class YtsjDao extends CommDaoImpl { - public YtsjDao() { - this.setMappernamespace("cqbyt.YtsjMapper"); - } - - public List selectListByWhere1(Ytsj where) { - List list = this.getSqlSession().selectList("cqbyt.YtsjMapper.selectListByWhere1", where); - return list; - } -} diff --git a/src/com/sipai/dao/data/CurveMpointDao.java b/src/com/sipai/dao/data/CurveMpointDao.java deleted file mode 100644 index f86b7236..00000000 --- a/src/com/sipai/dao/data/CurveMpointDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.data; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.CurveMpoint; - -@Repository -public class CurveMpointDao extends CommDaoImpl{ - public CurveMpointDao() { - super(); - this.setMappernamespace("data.CurveMpointMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/CurveRemarkDao.java b/src/com/sipai/dao/data/CurveRemarkDao.java deleted file mode 100644 index 4d13c915..00000000 --- a/src/com/sipai/dao/data/CurveRemarkDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.data; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.CurveRemark; - -@Repository -public class CurveRemarkDao extends CommDaoImpl{ - public CurveRemarkDao() { - super(); - this.setMappernamespace("data.CurveRemarkMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/CurveRemarkFileDao.java b/src/com/sipai/dao/data/CurveRemarkFileDao.java deleted file mode 100644 index 36b194ee..00000000 --- a/src/com/sipai/dao/data/CurveRemarkFileDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.data; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.CurveRemarkFile; - -@Repository -public class CurveRemarkFileDao extends CommDaoImpl{ - public CurveRemarkFileDao() { - super(); - this.setMappernamespace("data.CurveRemarkFileMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/DataCleaningConditionDao.java b/src/com/sipai/dao/data/DataCleaningConditionDao.java deleted file mode 100644 index 7500dbfb..00000000 --- a/src/com/sipai/dao/data/DataCleaningConditionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.data; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataCleaningCondition; - -@Repository -public class DataCleaningConditionDao extends CommDaoImpl { - public DataCleaningConditionDao(){ - super(); - this.setMappernamespace("data.DataCleaningConditionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/DataCleaningConfigureDao.java b/src/com/sipai/dao/data/DataCleaningConfigureDao.java deleted file mode 100644 index 86b53700..00000000 --- a/src/com/sipai/dao/data/DataCleaningConfigureDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.data; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataSource; -import com.sipai.entity.data.DataCleaningConfigure; - -@Repository -public class DataCleaningConfigureDao extends CommDaoImpl { - public DataCleaningConfigureDao(){ - super(); - this.setMappernamespace("data.DataCleaningConfigureMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/DataCleaningHistoryDao.java b/src/com/sipai/dao/data/DataCleaningHistoryDao.java deleted file mode 100644 index 7d97ad73..00000000 --- a/src/com/sipai/dao/data/DataCleaningHistoryDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.data; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataCleaningHistory; - -@Repository -public class DataCleaningHistoryDao extends CommDaoImpl { - public DataCleaningHistoryDao(){ - super(); - this.setMappernamespace("data.DataCleaningHistoryMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/DataCleaningPointDao.java b/src/com/sipai/dao/data/DataCleaningPointDao.java deleted file mode 100644 index 36b7cbcd..00000000 --- a/src/com/sipai/dao/data/DataCleaningPointDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.data; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataSource; -import com.sipai.entity.data.DataCleaningPoint; - -@Repository -public class DataCleaningPointDao extends CommDaoImpl { - public DataCleaningPointDao(){ - super(); - this.setMappernamespace("data.DataCleaningPointMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/DataCurveDao.java b/src/com/sipai/dao/data/DataCurveDao.java deleted file mode 100644 index 7d3b2ae0..00000000 --- a/src/com/sipai/dao/data/DataCurveDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.data; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataCurve; - -@Repository -public class DataCurveDao extends CommDaoImpl{ - public DataCurveDao() { - super(); - this.setMappernamespace("data.DataCurveMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/data/DataTransConfigDao.java b/src/com/sipai/dao/data/DataTransConfigDao.java deleted file mode 100644 index 934b75d0..00000000 --- a/src/com/sipai/dao/data/DataTransConfigDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.data; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataTransConfig; -import org.springframework.stereotype.Repository; - -@Repository -public class DataTransConfigDao extends CommDaoImpl { - public DataTransConfigDao() { - super(); - this.setMappernamespace("data.DataTransConfigMapper"); - } -} diff --git a/src/com/sipai/dao/data/XServerDao.java b/src/com/sipai/dao/data/XServerDao.java deleted file mode 100644 index 2e425f3b..00000000 --- a/src/com/sipai/dao/data/XServerDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.data; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.data.DataSource; -import com.sipai.entity.data.XServer; - -@Repository -public class XServerDao extends CommDaoImpl { - public XServerDao(){ - super(); - this.setMappernamespace("data.XServerMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/digitalProcess/DispatchSheetEntryDao.java b/src/com/sipai/dao/digitalProcess/DispatchSheetEntryDao.java deleted file mode 100644 index e9ddb199..00000000 --- a/src/com/sipai/dao/digitalProcess/DispatchSheetEntryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.digitalProcess; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.digitalProcess.DispatchSheetEntry; -import org.springframework.stereotype.Repository; - -@Repository -public class DispatchSheetEntryDao extends CommDaoImpl { - public DispatchSheetEntryDao(){ - super(); - this.setMappernamespace("digitalProcess.DispatchSheetEntryMapper"); - } -} diff --git a/src/com/sipai/dao/document/DataDao.java b/src/com/sipai/dao/document/DataDao.java deleted file mode 100644 index b4fbd7bc..00000000 --- a/src/com/sipai/dao/document/DataDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.document; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.document.Data; - -@Repository -public class DataDao extends CommDaoImpl{ - public DataDao() { - super(); - this.setMappernamespace("document.DataMapper"); - } - - public List getListByNumberAndType(String number, String doctype) { - Data data = new Data(); - data.setNumber(number); - data.setDoctype(doctype); - List list = this.getSqlSession().selectList("document.DataMapper.getListByNumberAndType", data); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/document/DocFileRelationDao.java b/src/com/sipai/dao/document/DocFileRelationDao.java deleted file mode 100644 index ec52a77c..00000000 --- a/src/com/sipai/dao/document/DocFileRelationDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.document; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.document.DocFileRelation; - -@Repository -public class DocFileRelationDao extends CommDaoImpl{ - public DocFileRelationDao() { - super(); - this.setMappernamespace("document.DocFileRelationMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/document/DocumentDao.java b/src/com/sipai/dao/document/DocumentDao.java deleted file mode 100644 index 98744be4..00000000 --- a/src/com/sipai/dao/document/DocumentDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.document; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.document.Document; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class DocumentDao extends CommDaoImpl{ - public DocumentDao() { - super(); - this.setMappernamespace("document.DocumentMapper"); - } - - public List selectListFileByWhere(Document document) { - List list = this.getSqlSession().selectList("document.DocumentMapper.selectListFileByWhere", document); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/ConstituteConfigureDao.java b/src/com/sipai/dao/efficiency/ConstituteConfigureDao.java deleted file mode 100644 index 1ad5948d..00000000 --- a/src/com/sipai/dao/efficiency/ConstituteConfigureDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.efficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.ConstituteConfigure; - -@Repository -public class ConstituteConfigureDao extends CommDaoImpl{ - public ConstituteConfigureDao() { - super(); - this.setMappernamespace("efficiency.ConstituteConfigureMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/ConstituteConfigureDetailDao.java b/src/com/sipai/dao/efficiency/ConstituteConfigureDetailDao.java deleted file mode 100644 index 7c08f88d..00000000 --- a/src/com/sipai/dao/efficiency/ConstituteConfigureDetailDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.efficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.ConstituteConfigureDetail; - -@Repository -public class ConstituteConfigureDetailDao extends CommDaoImpl{ - public ConstituteConfigureDetailDao() { - super(); - this.setMappernamespace("efficiency.ConstituteConfigureDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/ConstituteConfigureSchemeDao.java b/src/com/sipai/dao/efficiency/ConstituteConfigureSchemeDao.java deleted file mode 100644 index 1ef5505c..00000000 --- a/src/com/sipai/dao/efficiency/ConstituteConfigureSchemeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.efficiency; - -import com.sipai.entity.efficiency.ConstituteConfigureScheme; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -@Repository -public class ConstituteConfigureSchemeDao extends CommDaoImpl{ - public ConstituteConfigureSchemeDao() { - super(); - this.setMappernamespace("efficiency.ConstituteConfigureSchemeMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/EfficiencyOverviewConfigureAssemblyDao.java b/src/com/sipai/dao/efficiency/EfficiencyOverviewConfigureAssemblyDao.java deleted file mode 100644 index 42c2fb50..00000000 --- a/src/com/sipai/dao/efficiency/EfficiencyOverviewConfigureAssemblyDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.efficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigure; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigureAssembly; - -@Repository -public class EfficiencyOverviewConfigureAssemblyDao extends CommDaoImpl{ - public EfficiencyOverviewConfigureAssemblyDao() { - super(); - this.setMappernamespace("efficiency.EfficiencyOverviewConfigureAssemblyMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/EfficiencyOverviewConfigureDao.java b/src/com/sipai/dao/efficiency/EfficiencyOverviewConfigureDao.java deleted file mode 100644 index 784a33a4..00000000 --- a/src/com/sipai/dao/efficiency/EfficiencyOverviewConfigureDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.efficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigure; - -@Repository -public class EfficiencyOverviewConfigureDao extends CommDaoImpl{ - public EfficiencyOverviewConfigureDao() { - super(); - this.setMappernamespace("efficiency.EfficiencyOverviewConfigureMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/EfficiencyOverviewMpConfigureDao.java b/src/com/sipai/dao/efficiency/EfficiencyOverviewMpConfigureDao.java deleted file mode 100644 index 67b6afdb..00000000 --- a/src/com/sipai/dao/efficiency/EfficiencyOverviewMpConfigureDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.efficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; - -@Repository -public class EfficiencyOverviewMpConfigureDao extends CommDaoImpl{ - public EfficiencyOverviewMpConfigureDao() { - super(); - this.setMappernamespace("efficiency.EfficiencyOverviewMpConfigureMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/EfficiencyStatisticsDao.java b/src/com/sipai/dao/efficiency/EfficiencyStatisticsDao.java deleted file mode 100644 index 27801ffa..00000000 --- a/src/com/sipai/dao/efficiency/EfficiencyStatisticsDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.efficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.EfficiencyStatistics; - -@Repository -public class EfficiencyStatisticsDao extends CommDaoImpl { - public EfficiencyStatisticsDao() { - super(); - this.setMappernamespace("efficiency.EfficiencyStatisticsMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/efficiency/WaterSpreadDataConfigureDao.java b/src/com/sipai/dao/efficiency/WaterSpreadDataConfigureDao.java deleted file mode 100644 index 3e888e3b..00000000 --- a/src/com/sipai/dao/efficiency/WaterSpreadDataConfigureDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.efficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.efficiency.WaterSpreadDataConfigure; - -@Repository -public class WaterSpreadDataConfigureDao extends CommDaoImpl{ - public WaterSpreadDataConfigureDao() { - super(); - this.setMappernamespace("efficiency.WaterSpreadDataConfigureMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/AssetClassDao.java b/src/com/sipai/dao/equipment/AssetClassDao.java deleted file mode 100644 index 24e8a8fe..00000000 --- a/src/com/sipai/dao/equipment/AssetClassDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.AssetClass; -@Repository -public class AssetClassDao extends CommDaoImpl{ - public AssetClassDao() { - super(); - this.setMappernamespace("equipment.AssetClassMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/CharacteristicDao.java b/src/com/sipai/dao/equipment/CharacteristicDao.java deleted file mode 100644 index 9806fe63..00000000 --- a/src/com/sipai/dao/equipment/CharacteristicDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.Characteristic; -@Repository -public class CharacteristicDao extends CommDaoImpl{ - public CharacteristicDao() { - super(); - this.setMappernamespace("equipment.CharacteristicMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentAcceptanceApplyDao.java b/src/com/sipai/dao/equipment/EquipmentAcceptanceApplyDao.java deleted file mode 100644 index be5e882b..00000000 --- a/src/com/sipai/dao/equipment/EquipmentAcceptanceApplyDao.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.dao.equipment; -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentAcceptanceApply; - -@Repository -public class EquipmentAcceptanceApplyDao extends CommDaoImpl{ - public EquipmentAcceptanceApplyDao() { - super(); - this.setMappernamespace("equipment.EquipmentAcceptanceApplyMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentAcceptanceApplyDetailDao.java b/src/com/sipai/dao/equipment/EquipmentAcceptanceApplyDetailDao.java deleted file mode 100644 index ca277028..00000000 --- a/src/com/sipai/dao/equipment/EquipmentAcceptanceApplyDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentAcceptanceApply; -import com.sipai.entity.equipment.EquipmentAcceptanceApplyDetail; - -@Repository -public class EquipmentAcceptanceApplyDetailDao extends CommDaoImpl{ - public EquipmentAcceptanceApplyDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentAcceptanceApplyDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentAccidentDao.java b/src/com/sipai/dao/equipment/EquipmentAccidentDao.java deleted file mode 100644 index e65a5061..00000000 --- a/src/com/sipai/dao/equipment/EquipmentAccidentDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentAccident; - - -@Repository -public class EquipmentAccidentDao extends CommDaoImpl{ - public EquipmentAccidentDao() { - super(); - this.setMappernamespace("equipment.EquipmentAccidentMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentAccidentDetailDao.java b/src/com/sipai/dao/equipment/EquipmentAccidentDetailDao.java deleted file mode 100644 index 6cd4bf7d..00000000 --- a/src/com/sipai/dao/equipment/EquipmentAccidentDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentAccidentDetail; - -@Repository -public class EquipmentAccidentDetailDao extends CommDaoImpl{ - public EquipmentAccidentDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentAccidentDetailMapper"); - } -} - - diff --git a/src/com/sipai/dao/equipment/EquipmentArrangementDao.java b/src/com/sipai/dao/equipment/EquipmentArrangementDao.java deleted file mode 100644 index 9eb5f258..00000000 --- a/src/com/sipai/dao/equipment/EquipmentArrangementDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentArrangement; -import com.sipai.entity.equipment.EquipmentCard; -@Repository -public class EquipmentArrangementDao extends CommDaoImpl{ - public EquipmentArrangementDao() { - super(); - this.setMappernamespace("equipment.EquipmentArrangementMapper"); - } - public List selectEquipArrangementByWhere(EquipmentArrangement equipmentArrangement){ - List list= getSqlSession().selectList("equipment.EquipmentArrangementMapper.selectEquipArrangementByWhere", equipmentArrangement); - return list; - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentBelongDao.java b/src/com/sipai/dao/equipment/EquipmentBelongDao.java deleted file mode 100644 index 613a79b0..00000000 --- a/src/com/sipai/dao/equipment/EquipmentBelongDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentBelong; - -@Repository -public class EquipmentBelongDao extends CommDaoImpl{ - public EquipmentBelongDao() { - super(); - this.setMappernamespace("equipment.EquipmentBelongMapper"); - } - - - - public List selectDistinctBeToByComapnyId(String companyId) { - List list = this.getSqlSession().selectList("equipment.EquipmentBelongMapper.selectDistinctBeToByComapnyId", companyId); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentCardCameraDao.java b/src/com/sipai/dao/equipment/EquipmentCardCameraDao.java deleted file mode 100644 index 3c985b0d..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCardCameraDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCardCamera; - -@Repository -public class EquipmentCardCameraDao extends CommDaoImpl{ - public EquipmentCardCameraDao() { - super(); - this.setMappernamespace("equipment.EquipmentCardCameraMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentCardDao.java b/src/com/sipai/dao/equipment/EquipmentCardDao.java deleted file mode 100644 index 5ded9730..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCardDao.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCard; - -@Repository -public class EquipmentCardDao extends CommDaoImpl{ - public EquipmentCardDao() { - super(); - this.setMappernamespace("equipment.EquipmentCardMapper"); - } - public List getEquipmentCard(EquipmentCard equipmentcard){ - List list= getSqlSession().selectList("equipment.EquipmentCardMapper.getEquipmentCard", equipmentcard); - return list; - } - - public List getListByName(String equipmentcardid){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.getEquipmentCardByCardId", equipmentcardid); - return list; - } - - public List selectEquipmentRunTimeTotal(String where){ - List one= getSqlSession().selectList("equipment.EquipmentCardMapper.selectEquipmentRunTimeTotal", where); - return one; - } - public EquipmentCard selectEquipmentTotal(String where){ - EquipmentCard one= getSqlSession().selectOne("equipment.EquipmentCardMapper.selectEquipmentTotal", where); - return one; - } - public EquipmentCard selectSimpleListById(Object id){ - EquipmentCard one= getSqlSession().selectOne("equipment.EquipmentCardMapper.selectSimpleListByPrimaryKey", id); - return one; - } - - public List selectSimpleListByWhere(EquipmentCard equipmentcard){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectSimpleListByWhere", equipmentcard); - return list; - } - - - public List selectEquipmentByWhere(EquipmentCard equipmentcard){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectEquipmentByWhere", equipmentcard); - return list; - } - - - public List getEquipmentClassIdGroup(String bizid){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.getEquipmentClassIdGroup", bizid); - return list; - } - - public List getEquipmentCardByWhere(String where){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.getEquipmentCardByWhere", where); - return list; - } - //泵站设备 - public List selectPompListByWhere(String where){ - List List= this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectPompListByWhere", where); - return List; - } - //根据条件获取分组后的设备小类 - public List getEquipmentClassIdGroupByBizId(String bizid){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.getEquipmentClassIdGroupByBizId", bizid); - return list; - } - - //获取设备总价 - public List getEquipmentValue(EquipmentCard equipmentcard){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.getEquipmentValue", equipmentcard); - return list; - } - - //获取维修大于等于2的设备台账 - public List selectListForScrap(EquipmentCard equipmentcard){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectListForScrap", equipmentcard); - return list; - } - - //获取不同状态的设备台账 - public List selectListForStatus(EquipmentCard equipmentCard){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectListForStatus", equipmentCard); - return list; - } - - //获取第一条 - public List selectTop1ListByWhere(EquipmentCard equipmentCard){ - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectTop1ListByWhere", equipmentCard); - return list; - } - - public List selectEquipmentIdToMpoint(EquipmentCard equipmentCard) { - List list = this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectEquipmentIdToMpoint", equipmentCard); - return list; - } - //泵站设备 - public List selectListByWhereForModelData(EquipmentCard equipmentCard){ - List List= this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectListByWhereForModelData", equipmentCard); - return List; - } - - //近期需保养设备 - public List selectListByWhereForMaintenance(EquipmentCard equipmentCard){ - List List= this.getSqlSession().selectList("equipment.EquipmentCardMapper.selectListByWhereForMaintenance", equipmentCard); - return List; - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentCardLinksDao.java b/src/com/sipai/dao/equipment/EquipmentCardLinksDao.java deleted file mode 100644 index 89089887..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCardLinksDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCardLinks; - -@Repository -public class EquipmentCardLinksDao extends CommDaoImpl{ - public EquipmentCardLinksDao() { - super(); - this.setMappernamespace("equipment.EquipmentCardLinksMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentCardLinksParameterDao.java b/src/com/sipai/dao/equipment/EquipmentCardLinksParameterDao.java deleted file mode 100644 index 14533f19..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCardLinksParameterDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCardLinksParameter; - -@Repository -public class EquipmentCardLinksParameterDao extends CommDaoImpl{ - public EquipmentCardLinksParameterDao() { - super(); - this.setMappernamespace("equipment.EquipmentCardLinksParameterMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentCardPropDao.java b/src/com/sipai/dao/equipment/EquipmentCardPropDao.java deleted file mode 100644 index 73ad29da..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCardPropDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentAge; -import com.sipai.entity.equipment.EquipmentCardProp; -@Repository -public class EquipmentCardPropDao extends CommDaoImpl{ - public EquipmentCardPropDao() { - super(); - this.setMappernamespace("equipment.EquipmentCardPropMapper"); - } - public List selectAgeListByWhere(EquipmentAge equipmentAge){ - List list= getSqlSession().selectList("equipment.EquipmentCardPropMapper.selectAgeListByWhere", equipmentAge); - return list; - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentCardRemarkDao.java b/src/com/sipai/dao/equipment/EquipmentCardRemarkDao.java deleted file mode 100644 index 70e55cf5..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCardRemarkDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCardRemark; -import org.springframework.stereotype.Repository; - - -@Repository -public class EquipmentCardRemarkDao extends CommDaoImpl{ - public EquipmentCardRemarkDao() { - super(); - this.setMappernamespace("equipment.EquipmentCardRemarkMapper"); - } - -} diff --git a/src/com/sipai/dao/equipment/EquipmentClassDao.java b/src/com/sipai/dao/equipment/EquipmentClassDao.java deleted file mode 100644 index 644a79bd..00000000 --- a/src/com/sipai/dao/equipment/EquipmentClassDao.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -@Repository -public class EquipmentClassDao extends CommDaoImpl{ - public EquipmentClassDao() { - super(); - this.setMappernamespace("equipment.EquipmentClassMapper"); - } - -/* public List selectEquBigClassByProSecAndCompanyId(EquipmentCard equipmentCard) { - List list = this.getSqlSession().selectList("equipment.EquipmentClassMapper.selectEquBigClassByProSecAndCompanyId", equipmentCard); - return list; - }*/ - - public List selectEquSmallClassByBigClass(EquipmentCard equipmentCard) { - List list = this.getSqlSession().selectList("equipment.EquipmentClassMapper.selectEquSmallClassByBigClass", equipmentCard); - return list; - } - - public List selectDistinctEquBigClass(EquipmentCard equipmentCard) { - List list = this.getSqlSession().selectList("equipment.EquipmentClassMapper.selectDistinctEquBigClass", equipmentCard); - return list; - } - -/* public List selectDistinctEquSmallClass(EquipmentCard equipmentCard) { - List list = this.getSqlSession().selectList("equipment.EquipmentClassMapper.selectDistinctEquSmallClass", equipmentCard); - return list; - }*/ - - public List selectList4Tree(EquipmentClass equipmentClass) { - List list = this.getSqlSession().selectList("equipment.EquipmentClassMapper.selectList4Tree", equipmentClass); - return list; - } - - -} diff --git a/src/com/sipai/dao/equipment/EquipmentClassPropDao.java b/src/com/sipai/dao/equipment/EquipmentClassPropDao.java deleted file mode 100644 index 594d8423..00000000 --- a/src/com/sipai/dao/equipment/EquipmentClassPropDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentClassProp; -@Repository -public class EquipmentClassPropDao extends CommDaoImpl{ - public EquipmentClassPropDao() { - super(); - this.setMappernamespace("equipment.EquipmentClassPropMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentCodeDao.java b/src/com/sipai/dao/equipment/EquipmentCodeDao.java deleted file mode 100644 index c8857e2b..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCodeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCode; - -@Repository -public class EquipmentCodeDao extends CommDaoImpl{ - public EquipmentCodeDao() { - super(); - this.setMappernamespace("equipment.EquipmentCodeMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentCodeLibraryDao.java b/src/com/sipai/dao/equipment/EquipmentCodeLibraryDao.java deleted file mode 100644 index 108afbc2..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCodeLibraryDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCodeLibrary; - -@Repository -public class EquipmentCodeLibraryDao extends CommDaoImpl{ - public EquipmentCodeLibraryDao() { - super(); - this.setMappernamespace("equipment.EquipmentCodeLibraryMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentCodeRuleDao.java b/src/com/sipai/dao/equipment/EquipmentCodeRuleDao.java deleted file mode 100644 index 0aa4e564..00000000 --- a/src/com/sipai/dao/equipment/EquipmentCodeRuleDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.DynamicCodeCondition; -import com.sipai.entity.equipment.EquipmentCodeRule; - -@Repository -public class EquipmentCodeRuleDao extends CommDaoImpl{ - public EquipmentCodeRuleDao() { - super(); - this.setMappernamespace("equipment.EquipmentCodeRuleMapper"); - } - - public String dynameicSelectCodeByDynInfo(DynamicCodeCondition dcc){ - String fieldCode= getSqlSession().selectOne("equipment.EquipmentCodeRuleMapper.dynameicSelectCodeByDynInfo", dcc); - return fieldCode; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentDialinDao.java b/src/com/sipai/dao/equipment/EquipmentDialinDao.java deleted file mode 100644 index 82d8a14d..00000000 --- a/src/com/sipai/dao/equipment/EquipmentDialinDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentDialin; -import com.sipai.entity.equipment.EquipmentDialinVO; - -@Repository -public class EquipmentDialinDao extends CommDaoImpl{ - public EquipmentDialinDao() { - super(); - this.setMappernamespace("equipment.EquipmentDialinMapper"); - } - -} diff --git a/src/com/sipai/dao/equipment/EquipmentFileDao.java b/src/com/sipai/dao/equipment/EquipmentFileDao.java deleted file mode 100644 index 5d9ff9f9..00000000 --- a/src/com/sipai/dao/equipment/EquipmentFileDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentFile; -@Repository -public class EquipmentFileDao extends CommDaoImpl{ - public EquipmentFileDao() { - super(); - this.setMappernamespace("equipment.EquipmentFileMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentFittingsDao.java b/src/com/sipai/dao/equipment/EquipmentFittingsDao.java deleted file mode 100644 index baf472ce..00000000 --- a/src/com/sipai/dao/equipment/EquipmentFittingsDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentFittings; -import com.sipai.entity.report.DrainageDataomprehensiveTable; -@Repository -public class EquipmentFittingsDao extends CommDaoImpl{ - public EquipmentFittingsDao() { - super(); - this.setMappernamespace("equipment.EquipmentFittingsMapper"); - } - - public List selectListWithEqByWhere(EquipmentFittings equipmentFittings){ - return this.getSqlSession().selectList("equipment.EquipmentFittingsMapper.selectListWithEqByWhere", equipmentFittings); - } - - public List selectListWithFaByWhere(EquipmentFittings equipmentFittings){ - return this.getSqlSession().selectList("equipment.EquipmentFittingsMapper.selectListWithFaByWhere", equipmentFittings); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentIncreaseValueDao.java b/src/com/sipai/dao/equipment/EquipmentIncreaseValueDao.java deleted file mode 100644 index 827e47be..00000000 --- a/src/com/sipai/dao/equipment/EquipmentIncreaseValueDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentIncreaseValue; -@Repository -public class EquipmentIncreaseValueDao extends CommDaoImpl{ - public EquipmentIncreaseValueDao() { - super(); - this.setMappernamespace("equipment.EquipmentIncreaseValueMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentLevelDao.java b/src/com/sipai/dao/equipment/EquipmentLevelDao.java deleted file mode 100644 index 063fd327..00000000 --- a/src/com/sipai/dao/equipment/EquipmentLevelDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentLevel; -@Repository -public class EquipmentLevelDao extends CommDaoImpl{ - public EquipmentLevelDao() { - super(); - this.setMappernamespace("equipment.EquipmentLevelMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentLoseApplyDao.java b/src/com/sipai/dao/equipment/EquipmentLoseApplyDao.java deleted file mode 100644 index 6f26d786..00000000 --- a/src/com/sipai/dao/equipment/EquipmentLoseApplyDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentLoseApply; - - -@Repository -public class EquipmentLoseApplyDao extends CommDaoImpl{ - public EquipmentLoseApplyDao() { - super(); - this.setMappernamespace("equipment.EquipmentLoseApplyMapper"); - } - - public EquipmentLoseApply selectEquipmentOtherInfoById(String id){ - EquipmentLoseApply list = this.getSqlSession().selectOne("equipment.EquipmentLoseApplyMapper.selectEquipmentOtherInfoById", id); - return list; - - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentLoseApplyDetailDao.java b/src/com/sipai/dao/equipment/EquipmentLoseApplyDetailDao.java deleted file mode 100644 index cc127ead..00000000 --- a/src/com/sipai/dao/equipment/EquipmentLoseApplyDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentLoseApplyDetail; - -@Repository -public class EquipmentLoseApplyDetailDao extends CommDaoImpl{ - public EquipmentLoseApplyDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentLoseApplyDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentMaintainDao.java b/src/com/sipai/dao/equipment/EquipmentMaintainDao.java deleted file mode 100644 index 86571fcc..00000000 --- a/src/com/sipai/dao/equipment/EquipmentMaintainDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.equipment; - - - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentMaintain; - - -@Repository -public class EquipmentMaintainDao extends CommDaoImpl { - public EquipmentMaintainDao() { - super(); - this.setMappernamespace("equipment.EquipmentMaintainMapper"); - } - public List getEquipmentMaintain(EquipmentMaintain equipmentmaintain){ - List list= getSqlSession().selectList("equipment.EquipmentMaintainMapper.getEquipmentMaintain", equipmentmaintain); - return list; - } - - -} diff --git a/src/com/sipai/dao/equipment/EquipmentParamsetDao.java b/src/com/sipai/dao/equipment/EquipmentParamsetDao.java deleted file mode 100644 index b11fc381..00000000 --- a/src/com/sipai/dao/equipment/EquipmentParamsetDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentParamSetVO; -import com.sipai.entity.equipment.EquipmentParamset; -import com.sipai.entity.equipment.EquipmentParamsetDetail; - - -@Repository -public class EquipmentParamsetDao extends CommDaoImpl{ - public EquipmentParamsetDao() { - super(); - this.setMappernamespace("equipment.EquipmentParamsetMapper"); - } - - - public List selectEquipmentParamSetDetail(String equipmentClassId){ - List list= getSqlSession().selectList("equipment.EquipmentParamsetMapper.selectEquipmentParamSetDetail", equipmentClassId); - return list; - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentParamsetDetailDao.java b/src/com/sipai/dao/equipment/EquipmentParamsetDetailDao.java deleted file mode 100644 index 685e070f..00000000 --- a/src/com/sipai/dao/equipment/EquipmentParamsetDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentParamsetDetail; - -@Repository -public class EquipmentParamsetDetailDao extends CommDaoImpl{ - public EquipmentParamsetDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentParamsetDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentParamsetStatusEvaluationDao.java b/src/com/sipai/dao/equipment/EquipmentParamsetStatusEvaluationDao.java deleted file mode 100644 index 2cb9476e..00000000 --- a/src/com/sipai/dao/equipment/EquipmentParamsetStatusEvaluationDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentParamsetStatusEvaluation; - -@Repository -public class EquipmentParamsetStatusEvaluationDao extends CommDaoImpl{ - public EquipmentParamsetStatusEvaluationDao() { - super(); - this.setMappernamespace("equipment.EquipmentParamsetStatusEvaluationMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentParamsetValueDao.java b/src/com/sipai/dao/equipment/EquipmentParamsetValueDao.java deleted file mode 100644 index 5cb05d36..00000000 --- a/src/com/sipai/dao/equipment/EquipmentParamsetValueDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentParamsetDetail; -import com.sipai.entity.equipment.EquipmentParamsetValue; - -@Repository -public class EquipmentParamsetValueDao extends CommDaoImpl{ - public EquipmentParamsetValueDao() { - super(); - this.setMappernamespace("equipment.EquipmentParamsetValueMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentPointDao.java b/src/com/sipai/dao/equipment/EquipmentPointDao.java deleted file mode 100644 index 1e486364..00000000 --- a/src/com/sipai/dao/equipment/EquipmentPointDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentPoint; - - -@Repository -public class EquipmentPointDao extends CommDaoImpl{ - public EquipmentPointDao() { - super(); - this.setMappernamespace("equipment.EquipmentPointMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentRepairPlanDao.java b/src/com/sipai/dao/equipment/EquipmentRepairPlanDao.java deleted file mode 100644 index 8f190af0..00000000 --- a/src/com/sipai/dao/equipment/EquipmentRepairPlanDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentRepairPlan; -@Repository -public class EquipmentRepairPlanDao extends CommDaoImpl{ - public EquipmentRepairPlanDao() { - super(); - this.setMappernamespace("equipment.EquipmentRepairPlanMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentSaleApplyDao.java b/src/com/sipai/dao/equipment/EquipmentSaleApplyDao.java deleted file mode 100644 index 18eb3322..00000000 --- a/src/com/sipai/dao/equipment/EquipmentSaleApplyDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentSaleApply; - -@Repository -public class EquipmentSaleApplyDao extends CommDaoImpl{ - public EquipmentSaleApplyDao() { - super(); - this.setMappernamespace("equipment.EquipmentSaleApply"); - } - - public EquipmentSaleApply selectEquipmentOtherInfoById(String id){ - EquipmentSaleApply list = this.getSqlSession().selectOne("equipment.EquipmentSaleApply.selectEquipmentOtherInfoById", id); - return list; - - } - -} - - - diff --git a/src/com/sipai/dao/equipment/EquipmentSaleApplyDetailDao.java b/src/com/sipai/dao/equipment/EquipmentSaleApplyDetailDao.java deleted file mode 100644 index e6e337e4..00000000 --- a/src/com/sipai/dao/equipment/EquipmentSaleApplyDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentSaleApplyDetail; - - -@Repository -public class EquipmentSaleApplyDetailDao extends CommDaoImpl{ - public EquipmentSaleApplyDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentSaleApplyDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentScrapApplyDao.java b/src/com/sipai/dao/equipment/EquipmentScrapApplyDao.java deleted file mode 100644 index d0e9166b..00000000 --- a/src/com/sipai/dao/equipment/EquipmentScrapApplyDao.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentScrapApply; -import com.sipai.entity.equipment.EquipmentScrapApplyCollect; - - - -@Repository -public class EquipmentScrapApplyDao extends CommDaoImpl{ - public EquipmentScrapApplyDao() { - super(); - this.setMappernamespace("equipment.EquipmentScrapApply"); - } - - public EquipmentScrapApply selectEquipmentOtherInfoById(String id){ - EquipmentScrapApply list = this.getSqlSession().selectOne("equipment.EquipmentScrapApply.selectEquipmentOtherInfoById", id); - return list; - - } - - - public List findEquScrapCollect(String where){ - List list = this.getSqlSession().selectList("equipment.EquipmentScrapApply.findEquScrapCollect", where); - return list; - - } - - -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentScrapApplyDetailDao.java b/src/com/sipai/dao/equipment/EquipmentScrapApplyDetailDao.java deleted file mode 100644 index 38968ee8..00000000 --- a/src/com/sipai/dao/equipment/EquipmentScrapApplyDetailDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.equipment; - -import com.sipai.entity.equipment.EquipmentScrapApply; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentScrapApplyDetail; - -import java.util.List; - -@Repository -public class EquipmentScrapApplyDetailDao extends CommDaoImpl{ - public EquipmentScrapApplyDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentScrapApplyDetailMapper"); - } - - public List selectListByWhereAndApplyStatus(EquipmentScrapApplyDetail esad) { - List list = this.getSqlSession().selectList("equipment.EquipmentScrapApplyDetailMapper.selectListByWhereAndApplyStatus", esad); - return list; - } - -} diff --git a/src/com/sipai/dao/equipment/EquipmentSpecificationDao.java b/src/com/sipai/dao/equipment/EquipmentSpecificationDao.java deleted file mode 100644 index 48735e94..00000000 --- a/src/com/sipai/dao/equipment/EquipmentSpecificationDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentSpecification; -@Repository -public class EquipmentSpecificationDao extends CommDaoImpl{ - public EquipmentSpecificationDao() { - super(); - this.setMappernamespace("equipment.EquipmentSpecificationMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentStatisticsDao.java b/src/com/sipai/dao/equipment/EquipmentStatisticsDao.java deleted file mode 100644 index cbeb0141..00000000 --- a/src/com/sipai/dao/equipment/EquipmentStatisticsDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentStatistics; -@Repository -public class EquipmentStatisticsDao extends CommDaoImpl{ - public EquipmentStatisticsDao() { - super(); - this.setMappernamespace("equipment.EquipmentStatisticsMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentStatusManagementDao.java b/src/com/sipai/dao/equipment/EquipmentStatusManagementDao.java deleted file mode 100644 index a0f757e4..00000000 --- a/src/com/sipai/dao/equipment/EquipmentStatusManagementDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentStatusManagement; -@Repository -public class EquipmentStatusManagementDao extends CommDaoImpl{ - public EquipmentStatusManagementDao() { - super(); - this.setMappernamespace("equipment.EquipmentStatusManagementMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentStopRecordDao.java b/src/com/sipai/dao/equipment/EquipmentStopRecordDao.java deleted file mode 100644 index 9dd69755..00000000 --- a/src/com/sipai/dao/equipment/EquipmentStopRecordDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentStopRecord; - -@Repository -public class EquipmentStopRecordDao extends CommDaoImpl{ - public EquipmentStopRecordDao() { - super(); - this.setMappernamespace("equipment.EquipmentStopRecordMapper"); - } - - public List selectListByEquipClass(EquipmentStopRecord equipmentStopRecord){ - List list = this.getSqlSession().selectList("equipment.EquipmentStopRecordMapper.selectListByEquipClass", equipmentStopRecord); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentStopRecordDetailDao.java b/src/com/sipai/dao/equipment/EquipmentStopRecordDetailDao.java deleted file mode 100644 index 5f4cde78..00000000 --- a/src/com/sipai/dao/equipment/EquipmentStopRecordDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentStopRecordDetail; - - -@Repository -public class EquipmentStopRecordDetailDao extends CommDaoImpl{ - public EquipmentStopRecordDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentStopRecordDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentTransfersApplyDao.java b/src/com/sipai/dao/equipment/EquipmentTransfersApplyDao.java deleted file mode 100644 index 18265521..00000000 --- a/src/com/sipai/dao/equipment/EquipmentTransfersApplyDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import javax.mail.Session; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentTransfersApply; -import com.sipai.entity.equipment.EquipmentTransfersApplyCollect; - - - -@Repository -public class EquipmentTransfersApplyDao extends CommDaoImpl{ - public EquipmentTransfersApplyDao() { - super(); - this.setMappernamespace("equipment.EquipmentTransfersApplyMapper"); - } - - public List findEquTraApplyCollect(String where) { - List list = this.getSqlSession().selectList("equipment.EquipmentTransfersApplyMapper.findEquTraApplyCollect", where); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentTransfersApplyDetailDao.java b/src/com/sipai/dao/equipment/EquipmentTransfersApplyDetailDao.java deleted file mode 100644 index 7d5823da..00000000 --- a/src/com/sipai/dao/equipment/EquipmentTransfersApplyDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentTransfersApplyDetail; - -@Repository -public class EquipmentTransfersApplyDetailDao extends CommDaoImpl{ - public EquipmentTransfersApplyDetailDao() { - super(); - this.setMappernamespace("equipment.EquipmentTransfersApplyDetailMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/equipment/EquipmentTypeNumberDao.java b/src/com/sipai/dao/equipment/EquipmentTypeNumberDao.java deleted file mode 100644 index 35e38f23..00000000 --- a/src/com/sipai/dao/equipment/EquipmentTypeNumberDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentTypeNumber; - -@Repository -public class EquipmentTypeNumberDao extends CommDaoImpl{ - public EquipmentTypeNumberDao() { - super(); - this.setMappernamespace("equipment.EquipmentTypeNumberMapper"); - } - - //根据设备类别查询 - public List selectList4Class(EquipmentTypeNumber equipmentTypeNumber) { - List list = getSqlSession().selectList("equipment.EquipmentTypeNumberMapper.selectList4Class", equipmentTypeNumber); - return list; - } -} diff --git a/src/com/sipai/dao/equipment/EquipmentUseAgeDao.java b/src/com/sipai/dao/equipment/EquipmentUseAgeDao.java deleted file mode 100644 index ede9663d..00000000 --- a/src/com/sipai/dao/equipment/EquipmentUseAgeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.equipment.EquipmentUseAge; -@Repository -public class EquipmentUseAgeDao extends CommDaoImpl{ - public EquipmentUseAgeDao() { - super(); - this.setMappernamespace("equipment.EquipmentUseAgeMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/FacilitiesCardDao.java b/src/com/sipai/dao/equipment/FacilitiesCardDao.java deleted file mode 100644 index ab6d7a39..00000000 --- a/src/com/sipai/dao/equipment/FacilitiesCardDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.FacilitiesCard; - -@Repository -public class FacilitiesCardDao extends CommDaoImpl{ - public FacilitiesCardDao() { - super(); - this.setMappernamespace("equipment.FacilitiesCardMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/FacilitiesClassDao.java b/src/com/sipai/dao/equipment/FacilitiesClassDao.java deleted file mode 100644 index b025d130..00000000 --- a/src/com/sipai/dao/equipment/FacilitiesClassDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.FacilitiesClass; - -@Repository -public class FacilitiesClassDao extends CommDaoImpl{ - public FacilitiesClassDao() { - super(); - this.setMappernamespace("equipment.FacilitiesClassMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/GeographyAreaDao.java b/src/com/sipai/dao/equipment/GeographyAreaDao.java deleted file mode 100644 index 922066e6..00000000 --- a/src/com/sipai/dao/equipment/GeographyAreaDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.GeographyArea; -@Repository -public class GeographyAreaDao extends CommDaoImpl{ - public GeographyAreaDao() { - super(); - this.setMappernamespace("equipment.GeographyAreaMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/MaintenancePlanDao.java b/src/com/sipai/dao/equipment/MaintenancePlanDao.java deleted file mode 100644 index a1cfd8c4..00000000 --- a/src/com/sipai/dao/equipment/MaintenancePlanDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.equipment; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.MaintenancePlan; -@Repository -public class MaintenancePlanDao extends CommDaoImpl{ - public MaintenancePlanDao() { - super(); - this.setMappernamespace("equipment.MaintenancePlanMapper"); - } -} diff --git a/src/com/sipai/dao/equipment/SpecialEquipmentDao.java b/src/com/sipai/dao/equipment/SpecialEquipmentDao.java deleted file mode 100644 index cea30e23..00000000 --- a/src/com/sipai/dao/equipment/SpecialEquipmentDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.equipment; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentArrangement; -import com.sipai.entity.equipment.SpecialEquipment; - -@Repository -public class SpecialEquipmentDao extends CommDaoImpl{ - public SpecialEquipmentDao() { - super(); - this.setMappernamespace("equipment.SpecialEquipmentMapper"); - } - -/* public List selectSpecialEquipmentInfo(SpecialEquipment specialEquipment){ - List list= getSqlSession().selectList("equipment.SpecialEquipmentMapper.selectEquipArrangementByWhere", equipmentArrangement); - return list; - }*/ -} diff --git a/src/com/sipai/dao/evaluation/EvaluationCriterionDao.java b/src/com/sipai/dao/evaluation/EvaluationCriterionDao.java deleted file mode 100644 index f08eca5d..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationCriterionDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationCriterion; - -@Repository -public class EvaluationCriterionDao extends CommDaoImpl{ - - public EvaluationCriterionDao(){ - super(); - this.setMappernamespace("evaluation.evaluationCriterion"); - } - -} diff --git a/src/com/sipai/dao/evaluation/EvaluationIndexDao.java b/src/com/sipai/dao/evaluation/EvaluationIndexDao.java deleted file mode 100644 index 99e6bac2..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationIndexDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationIndex; - -@Repository -public class EvaluationIndexDao extends CommDaoImpl{ - public EvaluationIndexDao(){ - super(); - this.setMappernamespace("evaluation.EvaluationIndex"); - } -} diff --git a/src/com/sipai/dao/evaluation/EvaluationIndexDayDao.java b/src/com/sipai/dao/evaluation/EvaluationIndexDayDao.java deleted file mode 100644 index a4e3bd2b..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationIndexDayDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationIndexDay; - -@Repository -public class EvaluationIndexDayDao extends CommDaoImpl{ - public EvaluationIndexDayDao() { - super(); - this.setMappernamespace("evaluation.EvaluationIndexDay"); - } -} diff --git a/src/com/sipai/dao/evaluation/EvaluationIndexMDao.java b/src/com/sipai/dao/evaluation/EvaluationIndexMDao.java deleted file mode 100644 index f674ed34..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationIndexMDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationIndexM; - -@Repository -public class EvaluationIndexMDao extends CommDaoImpl{ - - public EvaluationIndexMDao(){ - super();this.setMappernamespace("evaluation.EvaluationIndex_m"); - } -} diff --git a/src/com/sipai/dao/evaluation/EvaluationIndexMontDao.java b/src/com/sipai/dao/evaluation/EvaluationIndexMontDao.java deleted file mode 100644 index ec3cd71c..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationIndexMontDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationIndexMonth; - -@Repository -public class EvaluationIndexMontDao extends CommDaoImpl{ - public EvaluationIndexMontDao(){ - super(); - this.setMappernamespace("evaluation.EvaluationIndexMonth"); - } - -} diff --git a/src/com/sipai/dao/evaluation/EvaluationIndexYDao.java b/src/com/sipai/dao/evaluation/EvaluationIndexYDao.java deleted file mode 100644 index 282f8670..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationIndexYDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationIndexY; - -@Repository -public class EvaluationIndexYDao extends CommDaoImpl{ - public EvaluationIndexYDao(){ - super(); - this.setMappernamespace("evaluation.EvaluationIndexY"); - } -} diff --git a/src/com/sipai/dao/evaluation/EvaluationIndexYearDao.java b/src/com/sipai/dao/evaluation/EvaluationIndexYearDao.java deleted file mode 100644 index da445242..00000000 --- a/src/com/sipai/dao/evaluation/EvaluationIndexYearDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.evaluation; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.evaluation.EvaluationIndexYear; - -@Repository -public class EvaluationIndexYearDao extends CommDaoImpl{ - public EvaluationIndexYearDao(){ - super(); - this.setMappernamespace("evaluation.EvaluationIndexYear"); - } -} diff --git a/src/com/sipai/dao/exam/DaytestPaperDao.java b/src/com/sipai/dao/exam/DaytestPaperDao.java deleted file mode 100644 index 0a188a37..00000000 --- a/src/com/sipai/dao/exam/DaytestPaperDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.DaytestPaper; -import org.springframework.stereotype.Repository; - -@Repository -public class DaytestPaperDao extends CommDaoImpl{ - public DaytestPaperDao() { - super(); - this.setMappernamespace("exam.DaytestPaperMapper"); - } - -} diff --git a/src/com/sipai/dao/exam/DaytestQuesOptionDao.java b/src/com/sipai/dao/exam/DaytestQuesOptionDao.java deleted file mode 100644 index bdb88e70..00000000 --- a/src/com/sipai/dao/exam/DaytestQuesOptionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.DaytestQuesOption; -import org.springframework.stereotype.Repository; - -@Repository -public class DaytestQuesOptionDao extends CommDaoImpl{ - public DaytestQuesOptionDao() { - super(); - this.setMappernamespace("exam.DaytestQuesOptionMapper"); - } - -} diff --git a/src/com/sipai/dao/exam/DaytestRecordDao.java b/src/com/sipai/dao/exam/DaytestRecordDao.java deleted file mode 100644 index 8451c4ef..00000000 --- a/src/com/sipai/dao/exam/DaytestRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.DaytestRecord; -import org.springframework.stereotype.Repository; - -@Repository -public class DaytestRecordDao extends CommDaoImpl{ - public DaytestRecordDao() { - super(); - this.setMappernamespace("exam.DaytestRecordMapper"); - } - -} diff --git a/src/com/sipai/dao/exam/ExamPlanDao.java b/src/com/sipai/dao/exam/ExamPlanDao.java deleted file mode 100644 index 9ce93ad7..00000000 --- a/src/com/sipai/dao/exam/ExamPlanDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.ExamPlan; -import org.springframework.stereotype.Repository; - -@Repository -public class ExamPlanDao extends CommDaoImpl { - public ExamPlanDao() { - super(); - this.setMappernamespace("exam.ExamPlanMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/exam/ExamRecordDao.java b/src/com/sipai/dao/exam/ExamRecordDao.java deleted file mode 100644 index 4b54f9d9..00000000 --- a/src/com/sipai/dao/exam/ExamRecordDao.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.ExamRecord; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ExamRecordDao extends CommDaoImpl{ - public ExamRecordDao() { - super(); - this.setMappernamespace("exam.ExamRecordMapper"); - } - - public List selectTestListByWhere(ExamRecord examRecord){ - List list = this.getSqlSession().selectList("exam.ExamRecordMapper.selectTestListByWhere", examRecord); - return list; - } - - public List selectmonicount(ExamRecord examRecord){ - List list = this.getSqlSession().selectList("exam.ExamRecordMapper.selectmonicount", examRecord); - return list; - } - - public List selectsearch(ExamRecord examRecord){ - List list = this.getSqlSession().selectList("exam.ExamRecordMapper.selectsearch", examRecord); - return list; - } - -} diff --git a/src/com/sipai/dao/exam/ExamTitleRangeDao.java b/src/com/sipai/dao/exam/ExamTitleRangeDao.java deleted file mode 100644 index b59bb1b8..00000000 --- a/src/com/sipai/dao/exam/ExamTitleRangeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.ExamTitleRange; -import org.springframework.stereotype.Repository; - -@Repository -public class ExamTitleRangeDao extends CommDaoImpl { - public ExamTitleRangeDao() { - super(); - this.setMappernamespace("exam.ExamTitleRangeMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/exam/TestPaperDao.java b/src/com/sipai/dao/exam/TestPaperDao.java deleted file mode 100644 index 6c93936a..00000000 --- a/src/com/sipai/dao/exam/TestPaperDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.TestPaper; -import org.springframework.stereotype.Repository; - -@Repository -public class TestPaperDao extends CommDaoImpl{ - public TestPaperDao() { - super(); - this.setMappernamespace("exam.TestPaperMapper"); - } -} diff --git a/src/com/sipai/dao/exam/TestQuesOptionDao.java b/src/com/sipai/dao/exam/TestQuesOptionDao.java deleted file mode 100644 index f80bec89..00000000 --- a/src/com/sipai/dao/exam/TestQuesOptionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.exam; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.exam.TestQuesOption; -import org.springframework.stereotype.Repository; - -@Repository -public class TestQuesOptionDao extends CommDaoImpl{ - public TestQuesOptionDao() { - super(); - this.setMappernamespace("exam.TestQuesOptionMapper"); - } - -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenBalanceDao.java b/src/com/sipai/dao/fangzhen/FangZhenBalanceDao.java deleted file mode 100644 index 10fe15d3..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenBalanceDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenBalance; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenBalanceDao extends CommDaoImpl { - public FangZhenBalanceDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenBalanceMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenBrowserDao.java b/src/com/sipai/dao/fangzhen/FangZhenBrowserDao.java deleted file mode 100644 index da167b58..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenBrowserDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenBrowser; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenBrowserDao extends CommDaoImpl { - public FangZhenBrowserDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenBrowserMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenEquipmentDao.java b/src/com/sipai/dao/fangzhen/FangZhenEquipmentDao.java deleted file mode 100644 index fb28a57e..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenEquipmentDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenEquipment; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenEquipmentDao extends CommDaoImpl { - public FangZhenEquipmentDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenEquipmentMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenHeadUIDao.java b/src/com/sipai/dao/fangzhen/FangZhenHeadUIDao.java deleted file mode 100644 index 3215d038..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenHeadUIDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenEquipment; -import com.sipai.entity.fangzhen.FangZhenHeadUI; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenHeadUIDao extends CommDaoImpl { - public FangZhenHeadUIDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenHeadUIMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenPipeDao.java b/src/com/sipai/dao/fangzhen/FangZhenPipeDao.java deleted file mode 100644 index d2b64c2e..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenPipeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenPipe; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenPipeDao extends CommDaoImpl { - public FangZhenPipeDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenPipeMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenStationDao.java b/src/com/sipai/dao/fangzhen/FangZhenStationDao.java deleted file mode 100644 index 7f317583..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenStationDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenPipe; -import com.sipai.entity.fangzhen.FangZhenStation; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenStationDao extends CommDaoImpl { - public FangZhenStationDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenStationMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenWaterDao.java b/src/com/sipai/dao/fangzhen/FangZhenWaterDao.java deleted file mode 100644 index a568146f..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenWaterDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenStation; -import com.sipai.entity.fangzhen.FangZhenWater; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenWaterDao extends CommDaoImpl { - public FangZhenWaterDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenWaterMapper"); - } -} diff --git a/src/com/sipai/dao/fangzhen/FangZhenXeomaDao.java b/src/com/sipai/dao/fangzhen/FangZhenXeomaDao.java deleted file mode 100644 index b7660513..00000000 --- a/src/com/sipai/dao/fangzhen/FangZhenXeomaDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.fangzhen; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fangzhen.FangZhenWater; -import com.sipai.entity.fangzhen.FangZhenXeoma; -import org.springframework.stereotype.Repository; - -@Repository -public class FangZhenXeomaDao extends CommDaoImpl { - public FangZhenXeomaDao() { - super(); - this.setMappernamespace("fangzhen.FangZhenXeomaMapper"); - } -} diff --git a/src/com/sipai/dao/finance/FinanceEquipmentDeptInfoDao.java b/src/com/sipai/dao/finance/FinanceEquipmentDeptInfoDao.java deleted file mode 100644 index a0331f5c..00000000 --- a/src/com/sipai/dao/finance/FinanceEquipmentDeptInfoDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.finance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.finance.FinanceEquipmentDeptInfo; - - -@Repository -public class FinanceEquipmentDeptInfoDao extends CommDaoImpl{ - public FinanceEquipmentDeptInfoDao() { - super(); - this.setMappernamespace("finance.financeEquipmentDeptInfoMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/fwk/MenunumberDao.java b/src/com/sipai/dao/fwk/MenunumberDao.java deleted file mode 100644 index 4dd57373..00000000 --- a/src/com/sipai/dao/fwk/MenunumberDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.fwk; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fwk.Menunumber; - -@Repository -public class MenunumberDao extends CommDaoImpl{ - public MenunumberDao(){ - super(); - this.setMappernamespace("fwk.MenunumberMapper"); - } - - public List selectCountListByWhere(Menunumber entity){ - List list= getSqlSession().selectList("fwk.MenunumberMapper.selectCountListByWhere", entity); - return list; - } - - public List selectCountListByWhereDetail(Menunumber entity){ - List list= getSqlSession().selectList("fwk.MenunumberMapper.selectCountListByWhereDetail", entity); - return list; - } - -} diff --git a/src/com/sipai/dao/fwk/UserToMenuDao.java b/src/com/sipai/dao/fwk/UserToMenuDao.java deleted file mode 100644 index 98673832..00000000 --- a/src/com/sipai/dao/fwk/UserToMenuDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.fwk; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fwk.UserToMenu; - -@Repository -public class UserToMenuDao extends CommDaoImpl{ - public UserToMenuDao(){ - super(); - this.setMappernamespace("fwk.UserToMenuMapper"); - } -} diff --git a/src/com/sipai/dao/fwk/WeatherHistoryDao.java b/src/com/sipai/dao/fwk/WeatherHistoryDao.java deleted file mode 100644 index a67260a5..00000000 --- a/src/com/sipai/dao/fwk/WeatherHistoryDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.fwk; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.fwk.WeatherHistory; - -@Repository -public class WeatherHistoryDao extends CommDaoImpl{ - public WeatherHistoryDao(){ - super(); - this.setMappernamespace("fwk.WeatherHistoryMapper"); - } - -} diff --git a/src/com/sipai/dao/hqconfig/EnterRecordDao.java b/src/com/sipai/dao/hqconfig/EnterRecordDao.java deleted file mode 100644 index 2c3a5335..00000000 --- a/src/com/sipai/dao/hqconfig/EnterRecordDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.dao.hqconfig; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.hqconfig.EnterRecord; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -@Repository -public class EnterRecordDao extends CommDaoImpl { - public EnterRecordDao(){ - super(); - this.setMappernamespace("hqconfig.EnterRecordMapper"); - } - - public List selectCountListByWhere(EnterRecord entity){ - List list= getSqlSession().selectList("hqconfig.EnterRecordMapper.selectCountListByWhere", entity); - return list; - } - - public List selectCountListByWhereDetail(EnterRecord entity){ - List list= getSqlSession().selectList("hqconfig.EnterRecordMapper.selectCountListByWhereDetail", entity); - return list; - } - - public List selectTopNlistByWhere(Map map){ - return getSqlSession().selectList("hqconfig.EnterRecordMapper.selectTopNlistByWhere", map); - } - - public List selectCount4state(){ - return getSqlSession().selectList("hqconfig.EnterRecordMapper.selectCount4state"); - } - -} diff --git a/src/com/sipai/dao/hqconfig/HQAlarmRecordDao.java b/src/com/sipai/dao/hqconfig/HQAlarmRecordDao.java deleted file mode 100644 index b18d547a..00000000 --- a/src/com/sipai/dao/hqconfig/HQAlarmRecordDao.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.dao.hqconfig; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.timeefficiency.PatrolRecord; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class HQAlarmRecordDao extends CommDaoImpl{ - public HQAlarmRecordDao(){ - super(); - this.setMappernamespace("hqconfig.HQAlarmRecordMapper"); - } - - public List selectCountListByWhere(HQAlarmRecord entity){ - List list= getSqlSession().selectList("hqconfig.HQAlarmRecordMapper.selectCountListByWhere", entity); - return list; - } - - public List selectCountListByWhereDetail(HQAlarmRecord entity){ - List list= getSqlSession().selectList("hqconfig.HQAlarmRecordMapper.selectCountListByWhereDetail", entity); - return list; - } - - public List selectAlarmAndRiskLevelByWhere(HQAlarmRecord hqAlarmRecord){ - return getSqlSession().selectList("hqconfig.HQAlarmRecordMapper.selectAlarmAndRiskLevelByWhere", hqAlarmRecord); - } - - public List selectABCDListByDate(String where,String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectABCDListByDate", map); - return list; - } - - public List selectAreaListByDate(String where,String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectAreaListByDate", map); - return list; - } - - public List selectListByNum(String where, String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByNum", map); - return list; - } - - public List selectListByNumArea(String where, String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByNumArea", map); - return list; - } - -} diff --git a/src/com/sipai/dao/hqconfig/PositionsCasualDao.java b/src/com/sipai/dao/hqconfig/PositionsCasualDao.java deleted file mode 100644 index 8ff5aab5..00000000 --- a/src/com/sipai/dao/hqconfig/PositionsCasualDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.hqconfig; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.hqconfig.PositionsCasual; -import org.springframework.stereotype.Repository; - -/** - * @author SIPAIIS-NJP - */ -@Repository -public class PositionsCasualDao extends CommDaoImpl{ - public PositionsCasualDao(){ - super(); - this.setMappernamespace("hqconfig.PositionsCasualMapper"); - } -} diff --git a/src/com/sipai/dao/hqconfig/RiskLevelDao.java b/src/com/sipai/dao/hqconfig/RiskLevelDao.java deleted file mode 100644 index 943d6819..00000000 --- a/src/com/sipai/dao/hqconfig/RiskLevelDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.hqconfig; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.hqconfig.RiskLevel; - -@Repository -public class RiskLevelDao extends CommDaoImpl{ - public RiskLevelDao(){ - super(); - this.setMappernamespace("hqconfig.RiskLevelMapper"); - } - - public List selectCountListByWhere(RiskLevel entity){ - List list= getSqlSession().selectList("hqconfig.RiskLevelMapper.selectCountListByWhere", entity); - return list; - } - - public List selectCountListByWhereDetail(RiskLevel entity){ - List list= getSqlSession().selectList("hqconfig.RiskLevelMapper.selectCountListByWhereDetail", entity); - return list; - } -} diff --git a/src/com/sipai/dao/hqconfig/WorkModelDao.java b/src/com/sipai/dao/hqconfig/WorkModelDao.java deleted file mode 100644 index 7ab62961..00000000 --- a/src/com/sipai/dao/hqconfig/WorkModelDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.hqconfig; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.hqconfig.WorkModel; - -@Repository -public class WorkModelDao extends CommDaoImpl{ - public WorkModelDao(){ - super(); - this.setMappernamespace("hqconfig.WorkModelMapper"); - } - - public List selectCountListByWhere(WorkModel entity){ - List list= getSqlSession().selectList("hqconfig.WorkModelMapper.selectCountListByWhere", entity); - return list; - } - - public List selectCountListByWhereDetail(WorkModel entity){ - List list= getSqlSession().selectList("hqconfig.WorkModelMapper.selectCountListByWhereDetail", entity); - return list; - } -} diff --git a/src/com/sipai/dao/info/InfoDao.java b/src/com/sipai/dao/info/InfoDao.java deleted file mode 100644 index 913bbf3d..00000000 --- a/src/com/sipai/dao/info/InfoDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.info; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.info.Info; - -@Repository -public class InfoDao extends CommDaoImpl{ - public InfoDao() { - super(); - this.setMappernamespace("info.InfoMapper"); - } - public List selectListWithRecvByWhere(Info info) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithRecvByWhere", info); - return list; - } - - public List selectListTopByWhere(Info info) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListTopByWhere", info); - return list; - } -} diff --git a/src/com/sipai/dao/info/InfoRecvDao.java b/src/com/sipai/dao/info/InfoRecvDao.java deleted file mode 100644 index d73e5b2c..00000000 --- a/src/com/sipai/dao/info/InfoRecvDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.info; - - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.info.InfoRecv; - -@Repository -public class InfoRecvDao extends CommDaoImpl{ - public InfoRecvDao() { - super(); - this.setMappernamespace("info.InfoRecvMapper"); - } -} diff --git a/src/com/sipai/dao/info/LogInfoDao.java b/src/com/sipai/dao/info/LogInfoDao.java deleted file mode 100644 index a3160c99..00000000 --- a/src/com/sipai/dao/info/LogInfoDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.info; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.info.LogInfo; -import org.springframework.stereotype.Repository; - -@Repository -public class LogInfoDao extends CommDaoImpl{ - public LogInfoDao() { - super(); - this.setMappernamespace("info.LogInfoMapper"); - } -} diff --git a/src/com/sipai/dao/jsyw/JsywCompanyDao.java b/src/com/sipai/dao/jsyw/JsywCompanyDao.java deleted file mode 100644 index 176fedfb..00000000 --- a/src/com/sipai/dao/jsyw/JsywCompanyDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.jsyw; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.jsyw.JsywCompany; - -@Repository -public class JsywCompanyDao extends CommDaoImpl { - public JsywCompanyDao(){ - super(); - this.setMappernamespace("jsyw.JsywCompanyMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/jsyw/JsywPointDao.java b/src/com/sipai/dao/jsyw/JsywPointDao.java deleted file mode 100644 index 46b379d9..00000000 --- a/src/com/sipai/dao/jsyw/JsywPointDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.jsyw; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.jsyw.JsywPoint; - -@Repository -public class JsywPointDao extends CommDaoImpl { - public JsywPointDao(){ - super(); - this.setMappernamespace("jsyw.JsywPointMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/kpi/KpiApplyBizDao.java b/src/com/sipai/dao/kpi/KpiApplyBizDao.java deleted file mode 100644 index 896e4731..00000000 --- a/src/com/sipai/dao/kpi/KpiApplyBizDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiApplyBiz; -import org.springframework.stereotype.Repository; - -/** - * 直接上级编制的计划 - * - * @author lichen - */ -@Repository -public class KpiApplyBizDao extends CommDaoImpl { - public KpiApplyBizDao() { - super(); - this.setMappernamespace("kpi.KpiApplyBizMapper"); - } - -} diff --git a/src/com/sipai/dao/kpi/KpiDimensionDao.java b/src/com/sipai/dao/kpi/KpiDimensionDao.java deleted file mode 100644 index ebd8a085..00000000 --- a/src/com/sipai/dao/kpi/KpiDimensionDao.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.Tree; -import com.sipai.entity.kpi.KpiDimension; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; - -/** - * 考核维度管理表Dao - * - * @author lichen - */ -@Repository -public class KpiDimensionDao extends CommDaoImpl { - public KpiDimensionDao() { - super(); - this.setMappernamespace("kpi.KpiDimensionMapper"); - } - - public List selectForJson(String where) { - return getSqlSession().selectList("kpi.KpiDimensionMapper.selectForJson",where); - } - - public List getPeriodTypeListByJobType(String jobType) { - return getSqlSession().selectList("kpi.KpiDimensionMapper.getPeriodTypeListByJobType",jobType); - } - - public String getDimensionId(String dimensionName, int jobLeveL, int periodType) { - HashMap hashMap=new HashMap<>(); - hashMap.put("dimensionName",dimensionName); - hashMap.put("jobLeveL",jobLeveL); - hashMap.put("periodType",periodType); - return getSqlSession().selectOne("kpi.KpiDimensionMapper.getDimensionId",hashMap); - } -} diff --git a/src/com/sipai/dao/kpi/KpiIndicatorLibDao.java b/src/com/sipai/dao/kpi/KpiIndicatorLibDao.java deleted file mode 100644 index 09c5bd46..00000000 --- a/src/com/sipai/dao/kpi/KpiIndicatorLibDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiIndicatorLib; -import org.springframework.stereotype.Repository; - -/** - * @author maxinhui - * @date 2021/10/13 下午 1:46 - */ -@Repository -public class KpiIndicatorLibDao extends CommDaoImpl { - public KpiIndicatorLibDao() { - super(); - this.setMappernamespace("kpi.KpiIndicatorLibMapper"); - } -} diff --git a/src/com/sipai/dao/kpi/KpiIndicatorLibDetailDao.java b/src/com/sipai/dao/kpi/KpiIndicatorLibDetailDao.java deleted file mode 100644 index 6b1f812e..00000000 --- a/src/com/sipai/dao/kpi/KpiIndicatorLibDetailDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiIndicatorLibDetail; -import org.springframework.stereotype.Repository; - -/** - * @author maxinhui - * @date 2021/10/15 上午 9:21 - */ -@Repository -public class KpiIndicatorLibDetailDao extends CommDaoImpl { - public KpiIndicatorLibDetailDao() { - super(); - this.setMappernamespace("kpi.KpiIndicatorLibDetailMapper"); - - } -} diff --git a/src/com/sipai/dao/kpi/KpiPeriodInstanceDao.java b/src/com/sipai/dao/kpi/KpiPeriodInstanceDao.java deleted file mode 100644 index 9d4376d4..00000000 --- a/src/com/sipai/dao/kpi/KpiPeriodInstanceDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiPeriodInstance; -import com.sipai.entity.kpi.KpiPeriodInstanceVo; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 考核维度管理表Dao - * - * @author lichen - */ -@Repository -public class KpiPeriodInstanceDao extends CommDaoImpl { - public KpiPeriodInstanceDao() { - super(); - this.setMappernamespace("kpi.KpiPeriodInstanceMapper"); - } - - public List selectPageList(String userId) { - List list= getSqlSession().selectList("kpi.KpiPeriodInstanceMapper.selectPageList",userId); - return list; - - } -} diff --git a/src/com/sipai/dao/kpi/KpiPlanDao.java b/src/com/sipai/dao/kpi/KpiPlanDao.java deleted file mode 100644 index e897788b..00000000 --- a/src/com/sipai/dao/kpi/KpiPlanDao.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiPlan; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 考核计划表Dao - * @author lihongye - * @date 2021/10/12 10:15 - */ -@Repository -public class KpiPlanDao extends CommDaoImpl { - public KpiPlanDao() { - super(); - this.setMappernamespace("kpi.KpiPlanMapper"); - } - - public List selectCopySource(int peroidType, int jobType, String createUserId) { - KpiPlan kpiPlan =new KpiPlan(); - kpiPlan.setPeriodType(peroidType); - kpiPlan.setLevelType(jobType); - kpiPlan.setCreateUserId(createUserId); - return getSqlSession().selectList("kpi.KpiPlanMapper.selectCopySource", kpiPlan); - } - - public KpiPlan selectByObjUserIdAndPeriodTypeId(String objUserId, String jobId, int periodType,String createUserId) { - KpiPlan kpiPlan =new KpiPlan(); - kpiPlan.setPeriodType(periodType); - kpiPlan.setJobId(jobId); - kpiPlan.setObjUserId(objUserId); - kpiPlan.setCreateUserId(createUserId); - return getSqlSession().selectOne("kpi.KpiPlanMapper.selectByObjUserIdAndPeriodTypeId", kpiPlan); - } -} diff --git a/src/com/sipai/dao/kpi/KpiPlanDetailDao.java b/src/com/sipai/dao/kpi/KpiPlanDetailDao.java deleted file mode 100644 index 9df7e490..00000000 --- a/src/com/sipai/dao/kpi/KpiPlanDetailDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiPlan; -import com.sipai.entity.kpi.KpiPlanDetail; -import org.springframework.stereotype.Repository; - -/** - * 考核计划详情表Dao - * @author lihongye - * @date 2021/10/12 10:15 - */ -@Repository -public class KpiPlanDetailDao extends CommDaoImpl { - public KpiPlanDetailDao() { - super(); - this.setMappernamespace("kpi.KpiPlanDetailMapper"); - } - - public int deleteByByPlanId(String planId) { - KpiPlanDetail kpiPlanDetail = new KpiPlanDetail(); - kpiPlanDetail.setPlanId(planId); - return getSqlSession().delete("kpi.KpiPlanDetailMapper.deleteByByPlanId", kpiPlanDetail); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/kpi/KpiPlanStaffDao.java b/src/com/sipai/dao/kpi/KpiPlanStaffDao.java deleted file mode 100644 index 1de17153..00000000 --- a/src/com/sipai/dao/kpi/KpiPlanStaffDao.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiApplyBiz; -import com.sipai.entity.kpi.KpiPlanStaff; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 考核维度管理表Dao - * - * @author lichen - */ -@Repository -public class KpiPlanStaffDao extends CommDaoImpl { - public KpiPlanStaffDao() { - super(); - this.setMappernamespace("kpi.KpiPlanStaffMapper"); - } - - public List selectPageListByCreateUserIdAndApplyBizId(KpiPlanStaff entity){ - List list= getSqlSession().selectList("kpi.KpiPlanStaffMapper.selectPageListByCreateUserIdAndApplyBizId", entity); - return list; - } - /** - * 更新状态 - * @Author: lichen - * @Date: 2022/7/14 - **/ - public int updateStatusByApplyBizId(KpiApplyBiz kpiApplyBiz){ - int update = getSqlSession().update("kpi.KpiPlanStaffMapper.updateStatusByApplyBizId", kpiApplyBiz); - return update; - } - -} diff --git a/src/com/sipai/dao/kpi/KpiPlanStaffDetailDao.java b/src/com/sipai/dao/kpi/KpiPlanStaffDetailDao.java deleted file mode 100644 index 4894a22e..00000000 --- a/src/com/sipai/dao/kpi/KpiPlanStaffDetailDao.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiMarkListQuery; -import com.sipai.entity.kpi.KpiPlanStaffDetail; -import org.springframework.stereotype.Repository; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -/** - * 考核维度管理表Dao - * - * @author lichen - */ -@Repository -public class KpiPlanStaffDetailDao extends CommDaoImpl { - public KpiPlanStaffDetailDao() { - super(); - this.setMappernamespace("kpi.KpiPlanStaffDetailMapper"); - } - - /** - * 查询当前总权重 - * - * @author lichen - * @date 2021/10/15 10:55 - * - * @return*/ - public Map getTotalWeight(String planStaffId) { - KpiPlanStaffDetail kpiPlanStaffDetail =new KpiPlanStaffDetail(); - kpiPlanStaffDetail.setPlanStaffId(planStaffId); - return getSqlSession().selectOne("kpi.KpiPlanStaffDetailMapper.getTotalWeight", kpiPlanStaffDetail); - } - - public List selectListByWhereWihtCompletionStatus(KpiMarkListQuery bean) { - return getSqlSession().selectList("kpi.KpiPlanStaffDetailMapper.selectListByWhereWihtCompletionStatus", bean); - } - - public List selectListByWhereWihtCompletionStatusFianl(KpiMarkListQuery s) { - return getSqlSession().selectList("kpi.KpiPlanStaffDetailMapper.selectListByWhereWihtCompletionStatusFianl", s); - } -} diff --git a/src/com/sipai/dao/kpi/KpiResultDao.java b/src/com/sipai/dao/kpi/KpiResultDao.java deleted file mode 100644 index d496bce3..00000000 --- a/src/com/sipai/dao/kpi/KpiResultDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.*; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 评分结果 - * - * @author lichen - */ -@Repository -public class KpiResultDao extends CommDaoImpl { - public KpiResultDao() { - super(); - this.setMappernamespace("kpi.KpiResultMapper"); - } - - public List selectListByPeriodAndObjUserIds(KpiResultStatisticsListRequest bean) { - return getSqlSession().selectList("kpi.KpiResultMapper.selectListByPeriodAndObjUserIds", bean); - } - - public KpiYearAvgResponse resultAvgPointByYear(String objUserId, String periodYear) { - KpiYearAvgRequest kpiYearAvgRequest = new KpiYearAvgRequest(); - kpiYearAvgRequest.setObjUserId(objUserId); - kpiYearAvgRequest.setPeriodYear(periodYear); - return getSqlSession().selectOne("kpi.KpiResultMapper.resultAvgPointByYear", kpiYearAvgRequest); - } - - public List selectResultList(KpiResultQuery query) { - return getSqlSession().selectList("kpi.KpiResultMapper.selectResultList", query); - } -} diff --git a/src/com/sipai/dao/kpi/KpiResultIndicatorDao.java b/src/com/sipai/dao/kpi/KpiResultIndicatorDao.java deleted file mode 100644 index c6b33f33..00000000 --- a/src/com/sipai/dao/kpi/KpiResultIndicatorDao.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiActivitiRequest; -import com.sipai.entity.kpi.KpiMarUserList; -import com.sipai.entity.kpi.KpiMarkListQuery; -import com.sipai.entity.kpi.KpiResultIndicator; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 单项评分表 - * - * @author lichen - */ -@Repository -public class KpiResultIndicatorDao extends CommDaoImpl { - public KpiResultIndicatorDao() { - super(); - this.setMappernamespace("kpi.KpiResultIndicatorMapper"); - } - - public List selectByPlanStaffIdAndAuditorId(KpiActivitiRequest kpiActivitiRequest) { - return getSqlSession().selectList("kpi.KpiResultIndicatorMapper.selectByPlanStaffIdAndAuditorId", kpiActivitiRequest); - } - - public List auditList(KpiMarkListQuery query) { - return getSqlSession().selectList("kpi.KpiResultIndicatorMapper.auditList", query); - } - -} diff --git a/src/com/sipai/dao/kpi/KpiResultIndicatorWeightDao.java b/src/com/sipai/dao/kpi/KpiResultIndicatorWeightDao.java deleted file mode 100644 index dceeaede..00000000 --- a/src/com/sipai/dao/kpi/KpiResultIndicatorWeightDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.kpi; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiResultIndicatorWeight; -import org.springframework.stereotype.Repository; - -/** - * 单项权重评分表 - * - * @author lichen - */ -@Repository -public class KpiResultIndicatorWeightDao extends CommDaoImpl { - public KpiResultIndicatorWeightDao() { - super(); - this.setMappernamespace("kpi.KpiResultIndicatorWeightMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/AbnormityDao.java b/src/com/sipai/dao/maintenance/AbnormityDao.java deleted file mode 100644 index 633261b7..00000000 --- a/src/com/sipai/dao/maintenance/AbnormityDao.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Abnormity; - -@Repository -public class AbnormityDao extends CommDaoImpl{ - public AbnormityDao() { - super(); - this.setMappernamespace("maintenance.AbnormityMapper"); - } - public List selectListByWhere20200831(Abnormity abnormity) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByWhere20200831", abnormity); - return list; - } - public Abnormity countListByWhere(Abnormity abnormity) { - Abnormity one = this.getSqlSession().selectOne(this.getMappernamespace()+".countListByWhere", abnormity); - return one; - } - public List selectListByNum(String where,String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByNum", map); - return list; - } -} diff --git a/src/com/sipai/dao/maintenance/AnticorrosiveLibraryDao.java b/src/com/sipai/dao/maintenance/AnticorrosiveLibraryDao.java deleted file mode 100644 index d8d7f805..00000000 --- a/src/com/sipai/dao/maintenance/AnticorrosiveLibraryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; - -@Repository -public class AnticorrosiveLibraryDao extends CommDaoImpl{ - public AnticorrosiveLibraryDao() { - super(); - this.setMappernamespace("maintenance.AnticorrosiveLibraryMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/AnticorrosiveLibraryEquipmentDao.java b/src/com/sipai/dao/maintenance/AnticorrosiveLibraryEquipmentDao.java deleted file mode 100644 index 6c2e34b5..00000000 --- a/src/com/sipai/dao/maintenance/AnticorrosiveLibraryEquipmentDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.AnticorrosiveLibraryEquipment; - -@Repository -public class AnticorrosiveLibraryEquipmentDao extends CommDaoImpl{ - public AnticorrosiveLibraryEquipmentDao() { - super(); - this.setMappernamespace("maintenance.AnticorrosiveLibraryEquipmentMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/AnticorrosiveLibraryMaterialDao.java b/src/com/sipai/dao/maintenance/AnticorrosiveLibraryMaterialDao.java deleted file mode 100644 index 4086d904..00000000 --- a/src/com/sipai/dao/maintenance/AnticorrosiveLibraryMaterialDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.AnticorrosiveLibraryMaterial; - -@Repository -public class AnticorrosiveLibraryMaterialDao extends CommDaoImpl{ - public AnticorrosiveLibraryMaterialDao() { - super(); - this.setMappernamespace("maintenance.AnticorrosiveLibraryMaterialMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/AnticorrosiveMaterialDao.java b/src/com/sipai/dao/maintenance/AnticorrosiveMaterialDao.java deleted file mode 100644 index 5bc11bb4..00000000 --- a/src/com/sipai/dao/maintenance/AnticorrosiveMaterialDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.AnticorrosiveMaterial; - -@Repository -public class AnticorrosiveMaterialDao extends CommDaoImpl{ - public AnticorrosiveMaterialDao() { - super(); - this.setMappernamespace("maintenance.AnticorrosiveMaterialMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/EquipmentPlanDao.java b/src/com/sipai/dao/maintenance/EquipmentPlanDao.java deleted file mode 100644 index 0e8ec1e5..00000000 --- a/src/com/sipai/dao/maintenance/EquipmentPlanDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.EquipmentPlan; - -import java.util.List; - - -@Repository -public class EquipmentPlanDao extends CommDaoImpl{ - public EquipmentPlanDao() { - super(); - this.setMappernamespace("maintenance.EquipmentPlanMapper"); - } - public EquipmentPlan countListByWhere(EquipmentPlan equipmentPlan) { - EquipmentPlan one = this.getSqlSession().selectOne(this.getMappernamespace()+".countListByWhere", equipmentPlan); - return one; - } - - public List selectListByWhereWithEqu(EquipmentPlan entity) { - return this.getSqlSession().selectList(this.getMappernamespace()+".selectListByWhereWithEqu", entity); - } -} diff --git a/src/com/sipai/dao/maintenance/EquipmentPlanEquDao.java b/src/com/sipai/dao/maintenance/EquipmentPlanEquDao.java deleted file mode 100644 index f950c8b4..00000000 --- a/src/com/sipai/dao/maintenance/EquipmentPlanEquDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.EquipmentPlanEqu; - -import java.util.List; - -@Repository -public class EquipmentPlanEquDao extends CommDaoImpl{ - public EquipmentPlanEquDao() { - super(); - this.setMappernamespace("maintenance.EquipmentPlanEquMapper"); - } - - public List selectListByWhereWithEqu(EquipmentPlanEqu entity) { - return this.getSqlSession().selectList(this.getMappernamespace()+".selectListByWhereWithEqu", entity); - } -} diff --git a/src/com/sipai/dao/maintenance/EquipmentPlanMainYearDao.java b/src/com/sipai/dao/maintenance/EquipmentPlanMainYearDao.java deleted file mode 100644 index a05e5b7a..00000000 --- a/src/com/sipai/dao/maintenance/EquipmentPlanMainYearDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.EquipmentPlanMainYear; - -import java.util.List; - -@Repository -public class EquipmentPlanMainYearDao extends CommDaoImpl{ - public EquipmentPlanMainYearDao() { - super(); - this.setMappernamespace("maintenance.EquipmentPlanMainYearMapper"); - } - - public List selectListByWhereWithEqu(EquipmentPlanMainYear equipmentPlanMainYear) { - return this.getSqlSession().selectList(this.getMappernamespace()+".selectListByWhereWithEqu", equipmentPlanMainYear); - } -} diff --git a/src/com/sipai/dao/maintenance/EquipmentPlanMainYearDetailDao.java b/src/com/sipai/dao/maintenance/EquipmentPlanMainYearDetailDao.java deleted file mode 100644 index 831d8f0f..00000000 --- a/src/com/sipai/dao/maintenance/EquipmentPlanMainYearDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.EquipmentPlanMainYearDetail; - -@Repository -public class EquipmentPlanMainYearDetailDao extends CommDaoImpl{ - public EquipmentPlanMainYearDetailDao() { - super(); - this.setMappernamespace("maintenance.EquipmentPlanMainYearDetailMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/EquipmentPlanTypeDao.java b/src/com/sipai/dao/maintenance/EquipmentPlanTypeDao.java deleted file mode 100644 index 90077ef7..00000000 --- a/src/com/sipai/dao/maintenance/EquipmentPlanTypeDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.maintenance; - -import com.sipai.entity.maintenance.LibraryRepairBloc; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.EquipmentPlanType; - -import java.util.HashMap; -import java.util.List; - -@Repository -public class EquipmentPlanTypeDao extends CommDaoImpl{ - public EquipmentPlanTypeDao() { - super(); - this.setMappernamespace("maintenance.EquipmentPlanTypeMapper"); - } - - public EquipmentPlanType selectByCode(String code){ - EquipmentPlanType o = getSqlSession().selectOne("maintenance.EquipmentPlanTypeMapper.selectByCode", code); - return o; - } -} diff --git a/src/com/sipai/dao/maintenance/FaultLibraryDao.java b/src/com/sipai/dao/maintenance/FaultLibraryDao.java deleted file mode 100644 index 1b8c26a4..00000000 --- a/src/com/sipai/dao/maintenance/FaultLibraryDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.FaultLibrary; -import com.sipai.entity.user.Menu; - -@Repository -public class FaultLibraryDao extends CommDaoImpl{ - public FaultLibraryDao() { - super(); - this.setMappernamespace("maintenance.FaultLibraryMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/LibraryAddResetProjectBizDao.java b/src/com/sipai/dao/maintenance/LibraryAddResetProjectBizDao.java deleted file mode 100644 index 14ced177..00000000 --- a/src/com/sipai/dao/maintenance/LibraryAddResetProjectBizDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryAddResetProjectBiz; - -@Repository -public class LibraryAddResetProjectBizDao extends CommDaoImpl{ - public LibraryAddResetProjectBizDao() { - super(); - this.setMappernamespace("maintenance.LibraryAddResetProjectBizMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryAddResetProjectBlocDao.java b/src/com/sipai/dao/maintenance/LibraryAddResetProjectBlocDao.java deleted file mode 100644 index 7b4956a9..00000000 --- a/src/com/sipai/dao/maintenance/LibraryAddResetProjectBlocDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryAddResetProjectBloc; - -@Repository -public class LibraryAddResetProjectBlocDao extends CommDaoImpl{ - public LibraryAddResetProjectBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryAddResetProjectBlocMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryAddResetProjectDao.java b/src/com/sipai/dao/maintenance/LibraryAddResetProjectDao.java deleted file mode 100644 index 3fcc1299..00000000 --- a/src/com/sipai/dao/maintenance/LibraryAddResetProjectDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.List; -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryAddResetProject; - -@Repository -public class LibraryAddResetProjectDao extends CommDaoImpl{ - public LibraryAddResetProjectDao() { - super(); - this.setMappernamespace("maintenance.LibraryAddResetProjectMapper"); - } - - //根据设备类别查询所有的大修内容 - public List selectList4Class(LibraryAddResetProject libraryAddResetProject) { - List list = getSqlSession().selectList("maintenance.LibraryAddResetProjectMapper.selectList4Class", libraryAddResetProject); - return list; - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryBaseDao.java b/src/com/sipai/dao/maintenance/LibraryBaseDao.java deleted file mode 100644 index d38b2e13..00000000 --- a/src/com/sipai/dao/maintenance/LibraryBaseDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.maintenance; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryBase; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryBaseDao extends CommDaoImpl { - - public LibraryBaseDao() { - super(); - this.setMappernamespace("maintenance.LibraryBaseMapper"); - } - -} diff --git a/src/com/sipai/dao/maintenance/LibraryFaultBlocDao.java b/src/com/sipai/dao/maintenance/LibraryFaultBlocDao.java deleted file mode 100644 index 2925efa3..00000000 --- a/src/com/sipai/dao/maintenance/LibraryFaultBlocDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryFaultBloc; - -@Repository -public class LibraryFaultBlocDao extends CommDaoImpl{ - public LibraryFaultBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryFaultBlocMapper"); - } - - public void doInit(LibraryFaultBloc libraryFaultBloc) { - this.getSqlSession().insert(this.getMappernamespace() + ".doInit", libraryFaultBloc); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/LibraryMaintainCarDao.java b/src/com/sipai/dao/maintenance/LibraryMaintainCarDao.java deleted file mode 100644 index f04a9d81..00000000 --- a/src/com/sipai/dao/maintenance/LibraryMaintainCarDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaintainCar; -@Repository -public class LibraryMaintainCarDao extends CommDaoImpl{ - public LibraryMaintainCarDao() { - super(); - this.setMappernamespace("maintenance.LibraryMaintainCarMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/LibraryMaintainCarDetailDao.java b/src/com/sipai/dao/maintenance/LibraryMaintainCarDetailDao.java deleted file mode 100644 index 1f581733..00000000 --- a/src/com/sipai/dao/maintenance/LibraryMaintainCarDetailDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaintainCarDetail; -@Repository -public class LibraryMaintainCarDetailDao extends CommDaoImpl{ - public LibraryMaintainCarDetailDao() { - super(); - this.setMappernamespace("maintenance.LibraryMaintainCarDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/LibraryMaintenanceCommonContentDao.java b/src/com/sipai/dao/maintenance/LibraryMaintenanceCommonContentDao.java deleted file mode 100644 index c66f257b..00000000 --- a/src/com/sipai/dao/maintenance/LibraryMaintenanceCommonContentDao.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.HashMap; -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaintenanceCommonContent; - -@Repository -public class LibraryMaintenanceCommonContentDao extends CommDaoImpl{ - public LibraryMaintenanceCommonContentDao() { - super(); - this.setMappernamespace("maintenance.LibraryMaintenanceCommonContentMapper"); - } - - //根据设备类别查询所有的大修内容 有部件 - public List selectList4Class(String wherestr,String unitId,String type) { - HashMap hashMap = new HashMap<>(); - hashMap.put("where",wherestr); - hashMap.put("unitId","'"+unitId+"'"); - hashMap.put("type","'"+type+"'"); - List list = getSqlSession().selectList("maintenance.LibraryMaintenanceCommonContentMapper.selectList4Class", hashMap); - return list; - } - - //根据设备类别查询所有的大修内容 没有部件的 - public List selectList3Class(String wherestr,String unitId,String type) { - HashMap hashMap = new HashMap<>(); - hashMap.put("where",wherestr); - hashMap.put("unitId","'"+unitId+"'"); - hashMap.put("type","'"+type+"'"); - List list = getSqlSession().selectList("maintenance.LibraryMaintenanceCommonContentMapper.selectList3Class", hashMap); - return list; - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryMaintenanceCommonDao.java b/src/com/sipai/dao/maintenance/LibraryMaintenanceCommonDao.java deleted file mode 100644 index d55a300e..00000000 --- a/src/com/sipai/dao/maintenance/LibraryMaintenanceCommonDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaintenanceCommon; - -@Repository -public class LibraryMaintenanceCommonDao extends CommDaoImpl{ - public LibraryMaintenanceCommonDao() { - super(); - this.setMappernamespace("maintenance.LibraryMaintenanceCommonMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryMaintenanceLubricationDao.java b/src/com/sipai/dao/maintenance/LibraryMaintenanceLubricationDao.java deleted file mode 100644 index 87a0cc68..00000000 --- a/src/com/sipai/dao/maintenance/LibraryMaintenanceLubricationDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaintenanceLubrication; - -@Repository -public class LibraryMaintenanceLubricationDao extends CommDaoImpl{ - public LibraryMaintenanceLubricationDao() { - super(); - this.setMappernamespace("maintenance.LibraryMaintenanceLubricationMapper"); - } - - //根据设备类别查询所有的库 - public List selectList4Class(LibraryMaintenanceLubrication libraryMaintenanceLubrication) { - List list = getSqlSession().selectList("maintenance.LibraryMaintenanceLubricationMapper.selectList4Class", libraryMaintenanceLubrication); - return list; - } - -} diff --git a/src/com/sipai/dao/maintenance/LibraryMaterialQuotaDao.java b/src/com/sipai/dao/maintenance/LibraryMaterialQuotaDao.java deleted file mode 100644 index f59c0257..00000000 --- a/src/com/sipai/dao/maintenance/LibraryMaterialQuotaDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaterialQuota; - -@Repository -public class LibraryMaterialQuotaDao extends CommDaoImpl{ - public LibraryMaterialQuotaDao() { - super(); - this.setMappernamespace("maintenance.LibraryMaterialQuotaMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryOverhaulContentBlocDao.java b/src/com/sipai/dao/maintenance/LibraryOverhaulContentBlocDao.java deleted file mode 100644 index d3effd52..00000000 --- a/src/com/sipai/dao/maintenance/LibraryOverhaulContentBlocDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.HashMap; -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; - -@Repository -public class LibraryOverhaulContentBlocDao extends CommDaoImpl{ - public LibraryOverhaulContentBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryOverhaulContentBlocMapper"); - } - - //根据设备类别查询所有的大修内容 - public List selectList4Class(String wherestr,String unitId) { - HashMap hashMap = new HashMap<>(); - hashMap.put("where",wherestr); - hashMap.put("unitId","'"+unitId+"'"); - List list = getSqlSession().selectList("maintenance.LibraryOverhaulContentBlocMapper.selectList4Class", hashMap); - return list; - } - -} diff --git a/src/com/sipai/dao/maintenance/LibraryOverhaulContentEquBizDao.java b/src/com/sipai/dao/maintenance/LibraryOverhaulContentEquBizDao.java deleted file mode 100644 index 27e9bd19..00000000 --- a/src/com/sipai/dao/maintenance/LibraryOverhaulContentEquBizDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; - -@Repository -public class LibraryOverhaulContentEquBizDao extends CommDaoImpl{ - public LibraryOverhaulContentEquBizDao() { - super(); - this.setMappernamespace("maintenance.LibraryOverhaulContentEquBizMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryOverhaulContentModelBlocDao.java b/src/com/sipai/dao/maintenance/LibraryOverhaulContentModelBlocDao.java deleted file mode 100644 index f5c7df16..00000000 --- a/src/com/sipai/dao/maintenance/LibraryOverhaulContentModelBlocDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; - -@Repository -public class LibraryOverhaulContentModelBlocDao extends CommDaoImpl{ - public LibraryOverhaulContentModelBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryOverhaulContentModelBlocMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryOverhaulProjectBlocDao.java b/src/com/sipai/dao/maintenance/LibraryOverhaulProjectBlocDao.java deleted file mode 100644 index 294fe791..00000000 --- a/src/com/sipai/dao/maintenance/LibraryOverhaulProjectBlocDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; - -@Repository -public class LibraryOverhaulProjectBlocDao extends CommDaoImpl{ - public LibraryOverhaulProjectBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryOverhaulProjectBlocMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryOverhaulProjectEquBizDao.java b/src/com/sipai/dao/maintenance/LibraryOverhaulProjectEquBizDao.java deleted file mode 100644 index 7c815c6a..00000000 --- a/src/com/sipai/dao/maintenance/LibraryOverhaulProjectEquBizDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryOverhaulProjectEquBiz; - -@Repository -public class LibraryOverhaulProjectEquBizDao extends CommDaoImpl{ - public LibraryOverhaulProjectEquBizDao() { - super(); - this.setMappernamespace("maintenance.LibraryOverhaulProjectEquBizMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryOverhaulProjectModelBlocDao.java b/src/com/sipai/dao/maintenance/LibraryOverhaulProjectModelBlocDao.java deleted file mode 100644 index 2d237c0a..00000000 --- a/src/com/sipai/dao/maintenance/LibraryOverhaulProjectModelBlocDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; - -@Repository -public class LibraryOverhaulProjectModelBlocDao extends CommDaoImpl{ - public LibraryOverhaulProjectModelBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryOverhaulProjectModelBlocMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryRepairBlocDao.java b/src/com/sipai/dao/maintenance/LibraryRepairBlocDao.java deleted file mode 100644 index a8313bf7..00000000 --- a/src/com/sipai/dao/maintenance/LibraryRepairBlocDao.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.HashMap; -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryRepairBloc; - -@Repository -public class LibraryRepairBlocDao extends CommDaoImpl{ - public LibraryRepairBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryRepairBlocMapper"); - } - - //根据设备类别查询所有的大修内容 (有组件的) - public List selectList4Class(String wherestr,String unitId) { - HashMap hashMap = new HashMap<>(); - hashMap.put("where",wherestr); - hashMap.put("unitId","'"+unitId+"'"); - List list = getSqlSession().selectList("maintenance.LibraryRepairBlocMapper.selectList4Class", hashMap); - return list; - } - - //根据设备类别查询所有的大修内容 (没有组件的) - public List selectList3Class(String wherestr, String unitId) { - HashMap hashMap = new HashMap<>(); - hashMap.put("where",wherestr); - hashMap.put("unitId","'"+unitId+"'"); - List list = getSqlSession().selectList("maintenance.LibraryRepairBlocMapper.selectList3Class", hashMap); - return list; - } - - public void doInit(LibraryRepairBloc libraryRepairBloc) { - this.getSqlSession().insert(this.getMappernamespace() + ".doInit", libraryRepairBloc); - } - public void deletePid(LibraryRepairBloc libraryRepairBloc) { - this.getSqlSession().insert(this.getMappernamespace() + ".deletePid", libraryRepairBloc); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryRepairEquBizDao.java b/src/com/sipai/dao/maintenance/LibraryRepairEquBizDao.java deleted file mode 100644 index d2d65607..00000000 --- a/src/com/sipai/dao/maintenance/LibraryRepairEquBizDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryRepairEquBiz; - -import java.util.HashMap; -import java.util.List; - -@Repository -public class LibraryRepairEquBizDao extends CommDaoImpl{ - public LibraryRepairEquBizDao() { - super(); - this.setMappernamespace("maintenance.LibraryRepairEquBizMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/LibraryRepairModelBlocDao.java b/src/com/sipai/dao/maintenance/LibraryRepairModelBlocDao.java deleted file mode 100644 index 2e5b268d..00000000 --- a/src/com/sipai/dao/maintenance/LibraryRepairModelBlocDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryRepairModelBloc; - -@Repository -public class LibraryRepairModelBlocDao extends CommDaoImpl{ - public LibraryRepairModelBlocDao() { - super(); - this.setMappernamespace("maintenance.LibraryRepairModelBlocMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/MaintainCarDao.java b/src/com/sipai/dao/maintenance/MaintainCarDao.java deleted file mode 100644 index dade9433..00000000 --- a/src/com/sipai/dao/maintenance/MaintainCarDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.MaintainCar; -@Repository -public class MaintainCarDao extends CommDaoImpl{ - public MaintainCarDao() { - super(); - this.setMappernamespace("maintenance.MaintainCarMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/MaintainDao.java b/src/com/sipai/dao/maintenance/MaintainDao.java deleted file mode 100644 index e7b170a2..00000000 --- a/src/com/sipai/dao/maintenance/MaintainDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintain; - -@Repository -public class MaintainDao extends CommDaoImpl{ - public MaintainDao() { - super(); - this.setMappernamespace("maintenance.MaintainMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/MaintainPlanDao.java b/src/com/sipai/dao/maintenance/MaintainPlanDao.java deleted file mode 100644 index 9cec6583..00000000 --- a/src/com/sipai/dao/maintenance/MaintainPlanDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.MaintainPlan; -import com.sipai.entity.user.Menu; - -@Repository -public class MaintainPlanDao extends CommDaoImpl{ - public MaintainPlanDao() { - super(); - this.setMappernamespace("maintenance.MaintainPlanMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/MaintainerCompanyDao.java b/src/com/sipai/dao/maintenance/MaintainerCompanyDao.java deleted file mode 100644 index 35744876..00000000 --- a/src/com/sipai/dao/maintenance/MaintainerCompanyDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.work.Group; - -@Repository -public class MaintainerCompanyDao extends CommDaoImpl{ - public MaintainerCompanyDao() { - super(); - this.setMappernamespace("maintenance.MaintainerCompanyMapper"); - } - -} diff --git a/src/com/sipai/dao/maintenance/MaintainerDao.java b/src/com/sipai/dao/maintenance/MaintainerDao.java deleted file mode 100644 index 8cc4778b..00000000 --- a/src/com/sipai/dao/maintenance/MaintainerDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.work.Group; - -@Repository -public class MaintainerDao extends CommDaoImpl{ - public MaintainerDao() { - super(); - this.setMappernamespace("maintenance.MaintainerMapper"); - } - -} diff --git a/src/com/sipai/dao/maintenance/MaintainerSelectTypeDao.java b/src/com/sipai/dao/maintenance/MaintainerSelectTypeDao.java deleted file mode 100644 index 190963d7..00000000 --- a/src/com/sipai/dao/maintenance/MaintainerSelectTypeDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerSelectType; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.work.Group; - -@Repository -public class MaintainerSelectTypeDao extends CommDaoImpl{ - public MaintainerSelectTypeDao() { - super(); - this.setMappernamespace("maintenance.MaintainerSelectTypeMapper"); - } - - public ListselectMaintainerType(MaintainerType maintainerType) { - List list = this.getSqlSession().selectList("maintenance.MaintainerSelectTypeMapper.selectMaintainerType",maintainerType); - return list; - } - -} diff --git a/src/com/sipai/dao/maintenance/MaintainerTypeDao.java b/src/com/sipai/dao/maintenance/MaintainerTypeDao.java deleted file mode 100644 index dcbf13dc..00000000 --- a/src/com/sipai/dao/maintenance/MaintainerTypeDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.work.Group; - -@Repository -public class MaintainerTypeDao extends CommDaoImpl{ - public MaintainerTypeDao() { - super(); - this.setMappernamespace("maintenance.MaintainerTypeMapper"); - } - -} diff --git a/src/com/sipai/dao/maintenance/MaintenanceDao.java b/src/com/sipai/dao/maintenance/MaintenanceDao.java deleted file mode 100644 index fa1ded9f..00000000 --- a/src/com/sipai/dao/maintenance/MaintenanceDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.work.Group; - -@Repository -public class MaintenanceDao extends CommDaoImpl{ - public MaintenanceDao() { - super(); - this.setMappernamespace("maintenance.MaintenanceMapper"); - } - public List selectListWithEquByWhere(Maintenance maintenance) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithEquByWhere", maintenance); - return list; - } -} diff --git a/src/com/sipai/dao/maintenance/MaintenanceDetailDao.java b/src/com/sipai/dao/maintenance/MaintenanceDetailDao.java deleted file mode 100644 index 374b9fa7..00000000 --- a/src/com/sipai/dao/maintenance/MaintenanceDetailDao.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.dao.maintenance; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.workorder.WorkorderDetail; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.work.Group; - -@Repository -public class MaintenanceDetailDao extends CommDaoImpl{ - public MaintenanceDetailDao() { - super(); - this.setMappernamespace("maintenance.MaintenanceDetailMapper"); - } - public List selectListWithMaintenanceByWhere(MaintenanceDetail maintenanceDetail) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithMaintenanceByWhere", maintenanceDetail); - return list; - } - - public MaintenanceDetail selectTotalMoneyByWhere(MaintenanceDetail maintenanceDetail) { - MaintenanceDetail one = this.getSqlSession().selectOne(this.getMappernamespace()+".selectTotalMoneyByWhere", maintenanceDetail); - return one; - } - - public List getPlanTypeByWhere(MaintenanceDetail maintenanceDetail) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithMaintenanceByWhere", maintenanceDetail); - return list; - } - - public List selectListByWhere20200831(MaintenanceDetail maintenanceDetail) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByWhere20200831", maintenanceDetail); - return list; - } - public List selectTotalBizNumberByWhere(MaintenanceDetail maintenanceDetail) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectTotalBizNumberByWhere", maintenanceDetail); - return list; - } - //查询设备类型故障次数 - public List getRepairCount4Class(MaintenanceDetail maintenanceDetail) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getRepairCount4Class", maintenanceDetail); - return list; - } - //查询设备故障次数 - public List getRepairCount4Equipment(MaintenanceDetail maintenanceDetail) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getRepairCount4Equipment", maintenanceDetail); - return list; - } - - public List selectListByNum(String where, String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByNum", map); - return list; - } - -} diff --git a/src/com/sipai/dao/maintenance/MaintenanceEquipmentConfigDao.java b/src/com/sipai/dao/maintenance/MaintenanceEquipmentConfigDao.java deleted file mode 100644 index c2dd5cc5..00000000 --- a/src/com/sipai/dao/maintenance/MaintenanceEquipmentConfigDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.MaintenanceEquipmentConfig; -import org.springframework.stereotype.Repository; - -@Repository -public class MaintenanceEquipmentConfigDao extends CommDaoImpl { - public MaintenanceEquipmentConfigDao() { - super(); - this.setMappernamespace("maintenance.MaintenanceEquipmentConfigMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/MaintenanceEquipmentDao.java b/src/com/sipai/dao/maintenance/MaintenanceEquipmentDao.java deleted file mode 100644 index bd50923e..00000000 --- a/src/com/sipai/dao/maintenance/MaintenanceEquipmentDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceEquipment; -import com.sipai.entity.work.Group; - -@Repository -public class MaintenanceEquipmentDao extends CommDaoImpl{ - public MaintenanceEquipmentDao() { - super(); - this.setMappernamespace("maintenance.MaintenanceEquipmentMapper"); - } - -} diff --git a/src/com/sipai/dao/maintenance/MaintenanceRecordDao.java b/src/com/sipai/dao/maintenance/MaintenanceRecordDao.java deleted file mode 100644 index b7c87864..00000000 --- a/src/com/sipai/dao/maintenance/MaintenanceRecordDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.MaintenanceRecord; - -@Repository -public class MaintenanceRecordDao extends CommDaoImpl{ - public MaintenanceRecordDao() { - super(); - this.setMappernamespace("maintenance.MaintenanceRecordMapper"); - } - -} diff --git a/src/com/sipai/dao/maintenance/PlanRecordAbnormityDao.java b/src/com/sipai/dao/maintenance/PlanRecordAbnormityDao.java deleted file mode 100644 index b3085979..00000000 --- a/src/com/sipai/dao/maintenance/PlanRecordAbnormityDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -@Repository -public class PlanRecordAbnormityDao extends CommDaoImpl{ - public PlanRecordAbnormityDao() { - super(); - this.setMappernamespace("maintenance.PlanRecordAbnormityMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/RepairCarDao.java b/src/com/sipai/dao/maintenance/RepairCarDao.java deleted file mode 100644 index eb07374e..00000000 --- a/src/com/sipai/dao/maintenance/RepairCarDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.RepairCar; - -@Repository -public class RepairCarDao extends CommDaoImpl{ - public RepairCarDao() { - super(); - this.setMappernamespace("maintenance.RepairCarMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/maintenance/RepairDao.java b/src/com/sipai/dao/maintenance/RepairDao.java deleted file mode 100644 index 2894165b..00000000 --- a/src/com/sipai/dao/maintenance/RepairDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Repair; -@Repository -public class RepairDao extends CommDaoImpl{ - public RepairDao() { - super(); - this.setMappernamespace("maintenance.RepairMapper"); - } -} diff --git a/src/com/sipai/dao/maintenance/WorkorderLibraryMaintainDao.java b/src/com/sipai/dao/maintenance/WorkorderLibraryMaintainDao.java deleted file mode 100644 index 6429c37a..00000000 --- a/src/com/sipai/dao/maintenance/WorkorderLibraryMaintainDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.maintenance; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.WorkorderLibraryMaintain; - -@Repository -public class WorkorderLibraryMaintainDao extends CommDaoImpl{ - public WorkorderLibraryMaintainDao() { - super(); - this.setMappernamespace("maintenance.WorkorderLibraryMaintainMapper"); - } -} diff --git a/src/com/sipai/dao/model/ModelSetValueDao.java b/src/com/sipai/dao/model/ModelSetValueDao.java deleted file mode 100644 index 89277759..00000000 --- a/src/com/sipai/dao/model/ModelSetValueDao.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.dao.model; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.model.ModelSetValue; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class ModelSetValueDao extends CommDaoImpl { - - public ModelSetValueDao() { - super(); - this.setMappernamespace("model.ModelSetValueMapper"); - } - - /** - * 潮汐表查询 - * @param where - * @return - */ - public List selectListByWhereTide(String where,String num) { - Map map = new HashMap(); - map.put("where", where); - map.put("num", num); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListByWhereTide", map); - return list; - } - - /** - * 压力表查询 - * @param where - * @return - */ - public List selectListByWherePressure(String where,String num) { - Map map = new HashMap(); - map.put("where", where); - map.put("num", num); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListByWherePressure", map); - return list; - } - -} diff --git a/src/com/sipai/dao/msg/EmppAdminDao.java b/src/com/sipai/dao/msg/EmppAdminDao.java deleted file mode 100644 index 9e5318da..00000000 --- a/src/com/sipai/dao/msg/EmppAdminDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.EmppAdmin; - -@Repository -public class EmppAdminDao extends CommDaoImpl{ - public EmppAdminDao() { - super(); - this.setMappernamespace("msg.EmppAdminMapper"); - } - -} diff --git a/src/com/sipai/dao/msg/EmppSendDao.java b/src/com/sipai/dao/msg/EmppSendDao.java deleted file mode 100644 index 462d2328..00000000 --- a/src/com/sipai/dao/msg/EmppSendDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.EmppSend; - -@Repository -public class EmppSendDao extends CommDaoImpl{ - public EmppSendDao() { - super(); - this.setMappernamespace("msg.EmppSendMapper"); - } - -} diff --git a/src/com/sipai/dao/msg/EmppSendUserDao.java b/src/com/sipai/dao/msg/EmppSendUserDao.java deleted file mode 100644 index 8e444e8a..00000000 --- a/src/com/sipai/dao/msg/EmppSendUserDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.EmppSendUser; - -@Repository -public class EmppSendUserDao extends CommDaoImpl{ - public EmppSendUserDao() { - super(); - this.setMappernamespace("msg.EmppSendUserMapper"); - } - -} diff --git a/src/com/sipai/dao/msg/FrequentContactsDao.java b/src/com/sipai/dao/msg/FrequentContactsDao.java deleted file mode 100644 index 373a96ca..00000000 --- a/src/com/sipai/dao/msg/FrequentContactsDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.msg; - - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.FrequentContacts; -import org.springframework.stereotype.Repository; - -@Repository -public class FrequentContactsDao extends CommDaoImpl { - public FrequentContactsDao() { - super(); - this.setMappernamespace("msg.FrequentContactsMapper"); - } -} diff --git a/src/com/sipai/dao/msg/MsgAlarmlevelDao.java b/src/com/sipai/dao/msg/MsgAlarmlevelDao.java deleted file mode 100644 index 7f49904e..00000000 --- a/src/com/sipai/dao/msg/MsgAlarmlevelDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.MsgAlarmlevel; - -@Repository -public class MsgAlarmlevelDao extends CommDaoImpl{ - public MsgAlarmlevelDao() { - super(); - this.setMappernamespace("msg.MsgAlarmlevelMapper"); - } - -} diff --git a/src/com/sipai/dao/msg/MsgDao.java b/src/com/sipai/dao/msg/MsgDao.java deleted file mode 100644 index eb4401e4..00000000 --- a/src/com/sipai/dao/msg/MsgDao.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.dao.msg; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.Msg; - -@Repository -public class MsgDao extends CommDaoImpl { - public MsgDao() { - super(); - this.setMappernamespace("msg.MsgMapper"); - } - - public List getMsgsendlist(Msg msg) { - // TODO Auto-generated method stub - List list = getSqlSession().selectList("msg.MsgMapper.getMsgsendlist", msg); - return list; - } - - public List getMsgsend(Msg msg) { - List list = getSqlSession().selectList("msg.MsgMapper.getMsgrecv",msg); - return list; - } - - public List getMsgrecv(Msg msg) { - // TODO Auto-generated method stub - List list = getSqlSession().selectList("msg.MsgMapper.getMsgrecv",msg); - return list; - } - - public List getMsgrecv_RU(Msg msg) { - // TODO Auto-generated method stub - List list = getSqlSession().selectList("msg.MsgMapper.getMsgrecv_RU",msg); - return list; - } - - public List getMsgrecvTop1(Msg msg) { - // TODO Auto-generated method stub - List list = getSqlSession().selectList("msg.MsgMapper.getMsgrecvTop1", msg); - return list; - } - - public List getMsgrecvNum(Msg msg) { - // TODO Auto-generated method stub - List list = getSqlSession().selectList("msg.MsgMapper.getMsgrecvNum", msg); - return list; - } - - public int updateBySetAndWhere(Msg msg) { - return getSqlSession().update("msg.MsgMapper.updateBySetAndWhere", msg); - } -} diff --git a/src/com/sipai/dao/msg/MsgRecvDao.java b/src/com/sipai/dao/msg/MsgRecvDao.java deleted file mode 100644 index a49969ab..00000000 --- a/src/com/sipai/dao/msg/MsgRecvDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.MsgRecv; -@Repository -public class MsgRecvDao extends CommDaoImpl{ - public MsgRecvDao() { - super(); - this.setMappernamespace("msg.MsgRecvMapper"); - } - public int updateBySetAndWhere(MsgRecv msgRecv){ - return getSqlSession().update("msg.MsgRecvMapper.updateBySetAndWhere", msgRecv); - } -} diff --git a/src/com/sipai/dao/msg/MsgRoleDao.java b/src/com/sipai/dao/msg/MsgRoleDao.java deleted file mode 100644 index 65b3473a..00000000 --- a/src/com/sipai/dao/msg/MsgRoleDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.MsgRole; - -@Repository -public class MsgRoleDao extends CommDaoImpl{ - public MsgRoleDao() { - super(); - this.setMappernamespace("msg.MsgRoleMapper"); - } - -} diff --git a/src/com/sipai/dao/msg/MsgTypeDao.java b/src/com/sipai/dao/msg/MsgTypeDao.java deleted file mode 100644 index 408e5ba4..00000000 --- a/src/com/sipai/dao/msg/MsgTypeDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.msg; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.MsgType; - -@Repository -public class MsgTypeDao extends CommDaoImpl{ - public MsgTypeDao() { - super(); - this.setMappernamespace("msg.MsgTypeMapper"); - } - public List getMsgType(MsgType msgtype) { - // TODO Auto-generated method stub - List list = getSqlSession().selectList("msg.MsgTypeMapper.getMsgType", msgtype); - return list; - } -} diff --git a/src/com/sipai/dao/msg/MsguserDao.java b/src/com/sipai/dao/msg/MsguserDao.java deleted file mode 100644 index 34b96165..00000000 --- a/src/com/sipai/dao/msg/MsguserDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.Msguser; - -@Repository -public class MsguserDao extends CommDaoImpl{ - public MsguserDao() { - super(); - this.setMappernamespace("msg.MsguserMapper"); - } -} - - diff --git a/src/com/sipai/dao/msg/SmsuserDao.java b/src/com/sipai/dao/msg/SmsuserDao.java deleted file mode 100644 index 5c63d7a7..00000000 --- a/src/com/sipai/dao/msg/SmsuserDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.msg; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.msg.Smsuser; - -@Repository -public class SmsuserDao extends CommDaoImpl{ - public SmsuserDao() { - super(); - this.setMappernamespace("msg.SmsuserMapper"); - } - -} diff --git a/src/com/sipai/dao/process/DataPatrolDao.java b/src/com/sipai/dao/process/DataPatrolDao.java deleted file mode 100644 index 7a40db29..00000000 --- a/src/com/sipai/dao/process/DataPatrolDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataPatrol; - -@Repository -public class DataPatrolDao extends CommDaoImpl{ - public DataPatrolDao() { - super(); - this.setMappernamespace("process.DataPatrolMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataPatrolResultDataDao.java b/src/com/sipai/dao/process/DataPatrolResultDataDao.java deleted file mode 100644 index 8270af2d..00000000 --- a/src/com/sipai/dao/process/DataPatrolResultDataDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataPatrolResultData; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class DataPatrolResultDataDao extends CommDaoImpl{ - public DataPatrolResultDataDao() { - super(); - this.setMappernamespace("process.DataPatrolResultDataMapper"); - } - - public List selectAnyByWhere(String where,String any) { - Map paramMap=new HashMap<>(); - paramMap.put("any",any); - paramMap.put("where",where); - List list = getSqlSession().selectList("process.DataPatrolResultDataMapper.selectAnyByWhere", paramMap); - return list; - } - -} diff --git a/src/com/sipai/dao/process/DataVisualBarChartDao.java b/src/com/sipai/dao/process/DataVisualBarChartDao.java deleted file mode 100644 index bce04de0..00000000 --- a/src/com/sipai/dao/process/DataVisualBarChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualBarChart; - -@Repository -public class DataVisualBarChartDao extends CommDaoImpl{ - public DataVisualBarChartDao() { - super(); - this.setMappernamespace("process.DataVisualBarChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualBarChartSeriesDao.java b/src/com/sipai/dao/process/DataVisualBarChartSeriesDao.java deleted file mode 100644 index 8a349f17..00000000 --- a/src/com/sipai/dao/process/DataVisualBarChartSeriesDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualBarChartSeries; - -@Repository -public class DataVisualBarChartSeriesDao extends CommDaoImpl{ - public DataVisualBarChartSeriesDao() { - super(); - this.setMappernamespace("process.DataVisualBarChartSeriesMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualBarChartYAxisDao.java b/src/com/sipai/dao/process/DataVisualBarChartYAxisDao.java deleted file mode 100644 index 661a9502..00000000 --- a/src/com/sipai/dao/process/DataVisualBarChartYAxisDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualBarChartYAxis; - -@Repository -public class DataVisualBarChartYAxisDao extends CommDaoImpl{ - public DataVisualBarChartYAxisDao() { - super(); - this.setMappernamespace("process.DataVisualBarChartYAxisMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualCameraAlarmDao.java b/src/com/sipai/dao/process/DataVisualCameraAlarmDao.java deleted file mode 100644 index a20a8be0..00000000 --- a/src/com/sipai/dao/process/DataVisualCameraAlarmDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualCameraAlarm; - -@Repository -public class DataVisualCameraAlarmDao extends CommDaoImpl{ - public DataVisualCameraAlarmDao() { - super(); - this.setMappernamespace("process.DataVisualCameraAlarmMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualCameraDao.java b/src/com/sipai/dao/process/DataVisualCameraDao.java deleted file mode 100644 index 1dcdaf44..00000000 --- a/src/com/sipai/dao/process/DataVisualCameraDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualCamera; - -@Repository -public class DataVisualCameraDao extends CommDaoImpl{ - public DataVisualCameraDao() { - super(); - this.setMappernamespace("process.DataVisualCameraMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualContentDao.java b/src/com/sipai/dao/process/DataVisualContentDao.java deleted file mode 100644 index b31471e4..00000000 --- a/src/com/sipai/dao/process/DataVisualContentDao.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualContent; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class DataVisualContentDao extends CommDaoImpl{ - public DataVisualContentDao() { - super(); - this.setMappernamespace("process.DataVisualContentMapper"); - } - - public int updateFixedByWhere(String wherestr,String fixedSt) { - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - paramMap.put("fixedSt",fixedSt); - return this.getSqlSession().update("process.DataVisualContentMapper.updateFixedByWhere", paramMap); - } - - public List selectDistinctTypeListByWhere(String wherestr) { - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - return this.getSqlSession().selectList("process.DataVisualContentMapper.selectDistinctTypeListByWhere", paramMap); - } - - -} diff --git a/src/com/sipai/dao/process/DataVisualDateDao.java b/src/com/sipai/dao/process/DataVisualDateDao.java deleted file mode 100644 index 2352cad8..00000000 --- a/src/com/sipai/dao/process/DataVisualDateDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualDate; - -@Repository -public class DataVisualDateDao extends CommDaoImpl{ - public DataVisualDateDao() { - super(); - this.setMappernamespace("process.DataVisualDateMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualDateSelectDao.java b/src/com/sipai/dao/process/DataVisualDateSelectDao.java deleted file mode 100644 index 07c92648..00000000 --- a/src/com/sipai/dao/process/DataVisualDateSelectDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualDateSelect; - -@Repository -public class DataVisualDateSelectDao extends CommDaoImpl{ - public DataVisualDateSelectDao() { - super(); - this.setMappernamespace("process.DataVisualDateSelectMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualEqPointsDao.java b/src/com/sipai/dao/process/DataVisualEqPointsDao.java deleted file mode 100644 index 4ed9b586..00000000 --- a/src/com/sipai/dao/process/DataVisualEqPointsDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualEqPoints; - -@Repository -public class DataVisualEqPointsDao extends CommDaoImpl{ - public DataVisualEqPointsDao() { - super(); - this.setMappernamespace("process.DataVisualEqPointsMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualFormDao.java b/src/com/sipai/dao/process/DataVisualFormDao.java deleted file mode 100644 index 67525ce3..00000000 --- a/src/com/sipai/dao/process/DataVisualFormDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualForm; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class DataVisualFormDao extends CommDaoImpl{ - public DataVisualFormDao() { - super(); - this.setMappernamespace("process.DataVisualFormMapper"); - } - - public List> getSpData(String content) { - Map paramMap = new HashMap<>(); - paramMap.put("content", content); - List> list = this.getSqlSession().selectList("process.DataVisualFormMapper.getSpData", paramMap); - return list; - } -} diff --git a/src/com/sipai/dao/process/DataVisualFormShowStyleDao.java b/src/com/sipai/dao/process/DataVisualFormShowStyleDao.java deleted file mode 100644 index d60a98ea..00000000 --- a/src/com/sipai/dao/process/DataVisualFormShowStyleDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualFormShowStyle; - -@Repository -public class DataVisualFormShowStyleDao extends CommDaoImpl{ - public DataVisualFormShowStyleDao() { - super(); - this.setMappernamespace("process.DataVisualFormShowStyleMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualFormSqlPointDao.java b/src/com/sipai/dao/process/DataVisualFormSqlPointDao.java deleted file mode 100644 index 57a6f7a5..00000000 --- a/src/com/sipai/dao/process/DataVisualFormSqlPointDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualFormSqlPoint; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class DataVisualFormSqlPointDao extends CommDaoImpl{ - public DataVisualFormSqlPointDao() { - super(); - this.setMappernamespace("process.DataVisualFormSqlPointMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualFrameContainerDao.java b/src/com/sipai/dao/process/DataVisualFrameContainerDao.java deleted file mode 100644 index 45ef490f..00000000 --- a/src/com/sipai/dao/process/DataVisualFrameContainerDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.process; - -import java.util.List; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualFrameContainer; - -@Repository -public class DataVisualFrameContainerDao extends CommDaoImpl{ - public DataVisualFrameContainerDao() { - super(); - this.setMappernamespace("process.DataVisualFrameContainerMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualFrameDao.java b/src/com/sipai/dao/process/DataVisualFrameDao.java deleted file mode 100644 index baad0f5a..00000000 --- a/src/com/sipai/dao/process/DataVisualFrameDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.process; - -import java.util.List; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.scada.MPoint4APP; - -@Repository -public class DataVisualFrameDao extends CommDaoImpl{ - public DataVisualFrameDao() { - super(); - this.setMappernamespace("process.DataVisualFrameMapper"); - } - - public int morderUpBywhere(DataVisualFrame t) { - return this.getSqlSession().update("process.DataVisualFrameMapper.morderUpBywhere", t); - } - - public int morderDownBywhere(DataVisualFrame t) { - return this.getSqlSession().update("process.DataVisualFrameMapper.morderDownBywhere", t); - } -} diff --git a/src/com/sipai/dao/process/DataVisualGaugeChartDao.java b/src/com/sipai/dao/process/DataVisualGaugeChartDao.java deleted file mode 100644 index 1e8edac4..00000000 --- a/src/com/sipai/dao/process/DataVisualGaugeChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualGaugeChart; - -@Repository -public class DataVisualGaugeChartDao extends CommDaoImpl{ - public DataVisualGaugeChartDao() { - super(); - this.setMappernamespace("process.DataVisualGaugeChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualLineChartDao.java b/src/com/sipai/dao/process/DataVisualLineChartDao.java deleted file mode 100644 index 20929d34..00000000 --- a/src/com/sipai/dao/process/DataVisualLineChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualLineChart; - -@Repository -public class DataVisualLineChartDao extends CommDaoImpl{ - public DataVisualLineChartDao() { - super(); - this.setMappernamespace("process.DataVisualLineChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualLineChartSeriesDao.java b/src/com/sipai/dao/process/DataVisualLineChartSeriesDao.java deleted file mode 100644 index 9727dd54..00000000 --- a/src/com/sipai/dao/process/DataVisualLineChartSeriesDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualLineChartSeries; - -@Repository -public class DataVisualLineChartSeriesDao extends CommDaoImpl{ - public DataVisualLineChartSeriesDao() { - super(); - this.setMappernamespace("process.DataVisualLineChartSeriesMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualLineChartYAxisDao.java b/src/com/sipai/dao/process/DataVisualLineChartYAxisDao.java deleted file mode 100644 index 70c72455..00000000 --- a/src/com/sipai/dao/process/DataVisualLineChartYAxisDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualLineChartYAxis; - -@Repository -public class DataVisualLineChartYAxisDao extends CommDaoImpl{ - public DataVisualLineChartYAxisDao() { - super(); - this.setMappernamespace("process.DataVisualLineChartYAxisMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualMPointDao.java b/src/com/sipai/dao/process/DataVisualMPointDao.java deleted file mode 100644 index 5cf18f7f..00000000 --- a/src/com/sipai/dao/process/DataVisualMPointDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualMPoint; - -@Repository -public class DataVisualMPointDao extends CommDaoImpl{ - public DataVisualMPointDao() { - super(); - this.setMappernamespace("process.DataVisualMPointMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualMPointWarehouseDao.java b/src/com/sipai/dao/process/DataVisualMPointWarehouseDao.java deleted file mode 100644 index 5ae722a0..00000000 --- a/src/com/sipai/dao/process/DataVisualMPointWarehouseDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualMPointWarehouse; - -@Repository -public class DataVisualMPointWarehouseDao extends CommDaoImpl{ - public DataVisualMPointWarehouseDao() { - super(); - this.setMappernamespace("process.DataVisualMPointWarehouseMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualMpViewDao.java b/src/com/sipai/dao/process/DataVisualMpViewDao.java deleted file mode 100644 index 50ea1fc3..00000000 --- a/src/com/sipai/dao/process/DataVisualMpViewDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualMpView; - -@Repository -public class DataVisualMpViewDao extends CommDaoImpl{ - public DataVisualMpViewDao() { - super(); - this.setMappernamespace("process.DataVisualMpViewMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualPercentChartDao.java b/src/com/sipai/dao/process/DataVisualPercentChartDao.java deleted file mode 100644 index e8e575c4..00000000 --- a/src/com/sipai/dao/process/DataVisualPercentChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualPercentChart; - -@Repository -public class DataVisualPercentChartDao extends CommDaoImpl{ - public DataVisualPercentChartDao() { - super(); - this.setMappernamespace("process.DataVisualPercentChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualPersonnelPositioningDao.java b/src/com/sipai/dao/process/DataVisualPersonnelPositioningDao.java deleted file mode 100644 index 3983f9ed..00000000 --- a/src/com/sipai/dao/process/DataVisualPersonnelPositioningDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualPersonnelPositioning; - -@Repository -public class DataVisualPersonnelPositioningDao extends CommDaoImpl{ - public DataVisualPersonnelPositioningDao() { - super(); - this.setMappernamespace("process.DataVisualPersonnelPositioningMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualPieChartDao.java b/src/com/sipai/dao/process/DataVisualPieChartDao.java deleted file mode 100644 index e9185a2e..00000000 --- a/src/com/sipai/dao/process/DataVisualPieChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualPieChart; - -@Repository -public class DataVisualPieChartDao extends CommDaoImpl{ - public DataVisualPieChartDao() { - super(); - this.setMappernamespace("process.DataVisualPieChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualPieChartSeriesDao.java b/src/com/sipai/dao/process/DataVisualPieChartSeriesDao.java deleted file mode 100644 index 74eeaf10..00000000 --- a/src/com/sipai/dao/process/DataVisualPieChartSeriesDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualPieChartSeries; - -@Repository -public class DataVisualPieChartSeriesDao extends CommDaoImpl{ - public DataVisualPieChartSeriesDao() { - super(); - this.setMappernamespace("process.DataVisualPieChartSeriesMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualPolarCoordinatesDao.java b/src/com/sipai/dao/process/DataVisualPolarCoordinatesDao.java deleted file mode 100644 index a6da72d0..00000000 --- a/src/com/sipai/dao/process/DataVisualPolarCoordinatesDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualPolarCoordinates; - -@Repository -public class DataVisualPolarCoordinatesDao extends CommDaoImpl{ - public DataVisualPolarCoordinatesDao() { - super(); - this.setMappernamespace("process.DataVisualPolarCoordinatesMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualPolarCoordinatesSeriesDao.java b/src/com/sipai/dao/process/DataVisualPolarCoordinatesSeriesDao.java deleted file mode 100644 index 1b62864f..00000000 --- a/src/com/sipai/dao/process/DataVisualPolarCoordinatesSeriesDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualPolarCoordinatesSeries; - -@Repository -public class DataVisualPolarCoordinatesSeriesDao extends CommDaoImpl{ - public DataVisualPolarCoordinatesSeriesDao() { - super(); - this.setMappernamespace("process.DataVisualPolarCoordinatesSeriesMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualProgressBarChartDao.java b/src/com/sipai/dao/process/DataVisualProgressBarChartDao.java deleted file mode 100644 index 07ca64ef..00000000 --- a/src/com/sipai/dao/process/DataVisualProgressBarChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualProgressBarChart; - -@Repository -public class DataVisualProgressBarChartDao extends CommDaoImpl{ - public DataVisualProgressBarChartDao() { - super(); - this.setMappernamespace("process.DataVisualProgressBarChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualRadarChartAxisDao.java b/src/com/sipai/dao/process/DataVisualRadarChartAxisDao.java deleted file mode 100644 index d722182b..00000000 --- a/src/com/sipai/dao/process/DataVisualRadarChartAxisDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualRadarChartAxis; - -@Repository -public class DataVisualRadarChartAxisDao extends CommDaoImpl{ - public DataVisualRadarChartAxisDao() { - super(); - this.setMappernamespace("process.DataVisualRadarChartAxisMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualRadarChartDao.java b/src/com/sipai/dao/process/DataVisualRadarChartDao.java deleted file mode 100644 index 1f878015..00000000 --- a/src/com/sipai/dao/process/DataVisualRadarChartDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualRadarChart; - -@Repository -public class DataVisualRadarChartDao extends CommDaoImpl{ - public DataVisualRadarChartDao() { - super(); - this.setMappernamespace("process.DataVisualRadarChartMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualRadarChartSeriesDao.java b/src/com/sipai/dao/process/DataVisualRadarChartSeriesDao.java deleted file mode 100644 index 19da5443..00000000 --- a/src/com/sipai/dao/process/DataVisualRadarChartSeriesDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualRadarChartSeries; - -@Repository -public class DataVisualRadarChartSeriesDao extends CommDaoImpl{ - public DataVisualRadarChartSeriesDao() { - super(); - this.setMappernamespace("process.DataVisualRadarChartSeriesMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualSelectDao.java b/src/com/sipai/dao/process/DataVisualSelectDao.java deleted file mode 100644 index ec7b81bb..00000000 --- a/src/com/sipai/dao/process/DataVisualSelectDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualSelect; - -@Repository -public class DataVisualSelectDao extends CommDaoImpl{ - public DataVisualSelectDao() { - super(); - this.setMappernamespace("process.DataVisualSelectMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualSuspensionFrameDao.java b/src/com/sipai/dao/process/DataVisualSuspensionFrameDao.java deleted file mode 100644 index bd3bb755..00000000 --- a/src/com/sipai/dao/process/DataVisualSuspensionFrameDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualSuspensionFrame; - -@Repository -public class DataVisualSuspensionFrameDao extends CommDaoImpl{ - public DataVisualSuspensionFrameDao() { - super(); - this.setMappernamespace("process.DataVisualSuspensionFrameMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualSvgAlarmDao.java b/src/com/sipai/dao/process/DataVisualSvgAlarmDao.java deleted file mode 100644 index 5efa5cec..00000000 --- a/src/com/sipai/dao/process/DataVisualSvgAlarmDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualSvgAlarm; - -@Repository -public class DataVisualSvgAlarmDao extends CommDaoImpl{ - public DataVisualSvgAlarmDao() { - super(); - this.setMappernamespace("process.DataVisualSvgAlarmMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualSvgDao.java b/src/com/sipai/dao/process/DataVisualSvgDao.java deleted file mode 100644 index 5eb1da95..00000000 --- a/src/com/sipai/dao/process/DataVisualSvgDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualSvg; - -@Repository -public class DataVisualSvgDao extends CommDaoImpl{ - public DataVisualSvgDao() { - super(); - this.setMappernamespace("process.DataVisualSvgMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualSwitchDao.java b/src/com/sipai/dao/process/DataVisualSwitchDao.java deleted file mode 100644 index 6cca472b..00000000 --- a/src/com/sipai/dao/process/DataVisualSwitchDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualSwitch; - -@Repository -public class DataVisualSwitchDao extends CommDaoImpl{ - public DataVisualSwitchDao() { - super(); - this.setMappernamespace("process.DataVisualSwitchMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualSwitchPointDao.java b/src/com/sipai/dao/process/DataVisualSwitchPointDao.java deleted file mode 100644 index 3dc10676..00000000 --- a/src/com/sipai/dao/process/DataVisualSwitchPointDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualSwitchPoint; - -@Repository -public class DataVisualSwitchPointDao extends CommDaoImpl{ - public DataVisualSwitchPointDao() { - super(); - this.setMappernamespace("process.DataVisualSwitchPointMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualTabDao.java b/src/com/sipai/dao/process/DataVisualTabDao.java deleted file mode 100644 index 758b2c6f..00000000 --- a/src/com/sipai/dao/process/DataVisualTabDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.process; - -import java.util.List; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.DataVisualTab; - -@Repository -public class DataVisualTabDao extends CommDaoImpl{ - public DataVisualTabDao() { - super(); - this.setMappernamespace("process.DataVisualTabMapper"); - } - - public int updateByWhere(DataVisualFrame t) { - return this.getSqlSession().update("process.DataVisualTabMapper.updateByWhere", t); - } -} diff --git a/src/com/sipai/dao/process/DataVisualTaskPointsDao.java b/src/com/sipai/dao/process/DataVisualTaskPointsDao.java deleted file mode 100644 index 40a3f685..00000000 --- a/src/com/sipai/dao/process/DataVisualTaskPointsDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualTaskPoints; - -@Repository -public class DataVisualTaskPointsDao extends CommDaoImpl{ - public DataVisualTaskPointsDao() { - super(); - this.setMappernamespace("process.DataVisualTaskPointsMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualTextDao.java b/src/com/sipai/dao/process/DataVisualTextDao.java deleted file mode 100644 index 76ef652b..00000000 --- a/src/com/sipai/dao/process/DataVisualTextDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualText; - -@Repository -public class DataVisualTextDao extends CommDaoImpl{ - public DataVisualTextDao() { - super(); - this.setMappernamespace("process.DataVisualTextMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualTextWarehouseDao.java b/src/com/sipai/dao/process/DataVisualTextWarehouseDao.java deleted file mode 100644 index 7dad3305..00000000 --- a/src/com/sipai/dao/process/DataVisualTextWarehouseDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualTextWarehouse; - -@Repository -public class DataVisualTextWarehouseDao extends CommDaoImpl{ - public DataVisualTextWarehouseDao() { - super(); - this.setMappernamespace("process.DataVisualTextWarehouseMapper"); - } -} diff --git a/src/com/sipai/dao/process/DataVisualWeatherDao.java b/src/com/sipai/dao/process/DataVisualWeatherDao.java deleted file mode 100644 index 7676fe96..00000000 --- a/src/com/sipai/dao/process/DataVisualWeatherDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DataVisualWeather; - -import java.util.List; - -@Repository -public class DataVisualWeatherDao extends CommDaoImpl { - public DataVisualWeatherDao() { - super(); - this.setMappernamespace("process.DataVisualWeatherMapper"); - } - - public List selectTop1ListByWhere(DataVisualWeather entity) { - List list = this.getSqlSession().selectList("process.DataVisualWeatherMapper.selectTop1ListByWhere", entity); - return list; - } -} diff --git a/src/com/sipai/dao/process/DecisionExpertBaseDao.java b/src/com/sipai/dao/process/DecisionExpertBaseDao.java deleted file mode 100644 index c9aac5a7..00000000 --- a/src/com/sipai/dao/process/DecisionExpertBaseDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DecisionExpertBase; - -@Repository -public class DecisionExpertBaseDao extends CommDaoImpl { - public DecisionExpertBaseDao() { - super(); - this.setMappernamespace("process.DecisionExpertBaseMapper"); - } -} diff --git a/src/com/sipai/dao/process/DecisionExpertBaseTextDao.java b/src/com/sipai/dao/process/DecisionExpertBaseTextDao.java deleted file mode 100644 index 984d6416..00000000 --- a/src/com/sipai/dao/process/DecisionExpertBaseTextDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.DecisionExpertBaseText; - -@Repository -public class DecisionExpertBaseTextDao extends CommDaoImpl { - public DecisionExpertBaseTextDao() { - super(); - this.setMappernamespace("process.DecisionExpertBaseTextMapper"); - } -} diff --git a/src/com/sipai/dao/process/EquipmentAdjustmentDao.java b/src/com/sipai/dao/process/EquipmentAdjustmentDao.java deleted file mode 100644 index ee3ab009..00000000 --- a/src/com/sipai/dao/process/EquipmentAdjustmentDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.entity.process.EquipmentAdjustment; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -@Repository -public class EquipmentAdjustmentDao extends CommDaoImpl { - public EquipmentAdjustmentDao(){ - super(); - this.setMappernamespace("process.EquipmentAdjustmentMapper"); - } -} diff --git a/src/com/sipai/dao/process/EquipmentAdjustmentDetailDao.java b/src/com/sipai/dao/process/EquipmentAdjustmentDetailDao.java deleted file mode 100644 index 82a50da9..00000000 --- a/src/com/sipai/dao/process/EquipmentAdjustmentDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.EquipmentAdjustmentDetail; - -@Repository -public class EquipmentAdjustmentDetailDao extends CommDaoImpl { - public EquipmentAdjustmentDetailDao(){ - super(); - this.setMappernamespace("process.EquipmentAdjustmentDetailMapper"); - } -} diff --git a/src/com/sipai/dao/process/LibraryProcessAbnormalDao.java b/src/com/sipai/dao/process/LibraryProcessAbnormalDao.java deleted file mode 100644 index 3ae2146e..00000000 --- a/src/com/sipai/dao/process/LibraryProcessAbnormalDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryProcessAbnormal; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryProcessAbnormalDao extends CommDaoImpl { - public LibraryProcessAbnormalDao() { - super(); - this.setMappernamespace("process.LibraryProcessAbnormalMapper"); - } -} diff --git a/src/com/sipai/dao/process/LibraryProcessAdjustmentDao.java b/src/com/sipai/dao/process/LibraryProcessAdjustmentDao.java deleted file mode 100644 index 00fc5b65..00000000 --- a/src/com/sipai/dao/process/LibraryProcessAdjustmentDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryProcessAdjustment; - -@Repository -public class LibraryProcessAdjustmentDao extends CommDaoImpl{ - public LibraryProcessAdjustmentDao() { - super(); - this.setMappernamespace("process.LibraryProcessAdjustmentMapper"); - } -} diff --git a/src/com/sipai/dao/process/LibraryProcessManageDao.java b/src/com/sipai/dao/process/LibraryProcessManageDao.java deleted file mode 100644 index aac05e89..00000000 --- a/src/com/sipai/dao/process/LibraryProcessManageDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryProcessManage; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryProcessManageDao extends CommDaoImpl { - public LibraryProcessManageDao() { - super(); - this.setMappernamespace("process.LibraryProcessManageMapper"); - } -} diff --git a/src/com/sipai/dao/process/LibraryProcessManageDetailDao.java b/src/com/sipai/dao/process/LibraryProcessManageDetailDao.java deleted file mode 100644 index dc0951a5..00000000 --- a/src/com/sipai/dao/process/LibraryProcessManageDetailDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryProcessManageDetail; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryProcessManageDetailDao extends CommDaoImpl { - public LibraryProcessManageDetailDao() { - super(); - this.setMappernamespace("process.LibraryProcessManageDetailMapper"); - } -} diff --git a/src/com/sipai/dao/process/LibraryProcessManageTypeDao.java b/src/com/sipai/dao/process/LibraryProcessManageTypeDao.java deleted file mode 100644 index b9de335e..00000000 --- a/src/com/sipai/dao/process/LibraryProcessManageTypeDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryProcessManageType; - -@Repository -public class LibraryProcessManageTypeDao extends CommDaoImpl{ - public LibraryProcessManageTypeDao() { - super(); - this.setMappernamespace("process.LibraryProcessManageTypeMapper"); - } - -} diff --git a/src/com/sipai/dao/process/LibraryProcessManageWorkOrderDao.java b/src/com/sipai/dao/process/LibraryProcessManageWorkOrderDao.java deleted file mode 100644 index e20619ec..00000000 --- a/src/com/sipai/dao/process/LibraryProcessManageWorkOrderDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryProcessManageWorkOrder; - -@Repository -public class LibraryProcessManageWorkOrderDao extends CommDaoImpl{ - public LibraryProcessManageWorkOrderDao() { - super(); - this.setMappernamespace("process.LibraryProcessManageWorkOrderMapper"); - } - - -} diff --git a/src/com/sipai/dao/process/LibraryRoutineWorkDao.java b/src/com/sipai/dao/process/LibraryRoutineWorkDao.java deleted file mode 100644 index 4fb2a6b5..00000000 --- a/src/com/sipai/dao/process/LibraryRoutineWorkDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryRoutineWork; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryRoutineWorkDao extends CommDaoImpl { - public LibraryRoutineWorkDao() { - super(); - this.setMappernamespace("process.LibraryRoutineWorkMapper"); - } -} diff --git a/src/com/sipai/dao/process/LibraryWaterTestDao.java b/src/com/sipai/dao/process/LibraryWaterTestDao.java deleted file mode 100644 index 474d6da7..00000000 --- a/src/com/sipai/dao/process/LibraryWaterTestDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.LibraryWaterTest; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryWaterTestDao extends CommDaoImpl { - public LibraryWaterTestDao() { - super(); - this.setMappernamespace("process.LibraryWaterTestMapper"); - } -} diff --git a/src/com/sipai/dao/process/MeterCheckDao.java b/src/com/sipai/dao/process/MeterCheckDao.java deleted file mode 100644 index f3e604f3..00000000 --- a/src/com/sipai/dao/process/MeterCheckDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.MeterCheck; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class MeterCheckDao extends CommDaoImpl { - public MeterCheckDao() { - super(); - this.setMappernamespace("process.MeterCheckMapper"); - } - - public List selectListLeftLibraryByWhere(MeterCheck entity) { - List list = this.getSqlSession().selectList("process.MeterCheckMapper.selectListLeftLibraryByWhere", entity); - return list; - } - -} diff --git a/src/com/sipai/dao/process/MeterCheckLibraryDao.java b/src/com/sipai/dao/process/MeterCheckLibraryDao.java deleted file mode 100644 index 719e6ab0..00000000 --- a/src/com/sipai/dao/process/MeterCheckLibraryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.MeterCheckLibrary; -import org.springframework.stereotype.Repository; - -@Repository -public class MeterCheckLibraryDao extends CommDaoImpl { - public MeterCheckLibraryDao() { - super(); - this.setMappernamespace("process.MeterCheckLibraryMapper"); - } -} diff --git a/src/com/sipai/dao/process/ProcessAdjustmentContentDao.java b/src/com/sipai/dao/process/ProcessAdjustmentContentDao.java deleted file mode 100644 index 12e301c7..00000000 --- a/src/com/sipai/dao/process/ProcessAdjustmentContentDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.ProcessAdjustmentContent; -import org.springframework.stereotype.Repository; - -@Repository -public class ProcessAdjustmentContentDao extends CommDaoImpl { - public ProcessAdjustmentContentDao() { - super(); - this.setMappernamespace("process.ProcessAdjustmentContentMapper"); - } -} diff --git a/src/com/sipai/dao/process/ProcessAdjustmentDao.java b/src/com/sipai/dao/process/ProcessAdjustmentDao.java deleted file mode 100644 index 560cae61..00000000 --- a/src/com/sipai/dao/process/ProcessAdjustmentDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.ProcessAdjustment; - -@Repository -public class ProcessAdjustmentDao extends CommDaoImpl{ - public ProcessAdjustmentDao() { - super(); - this.setMappernamespace("process.ProcessAdjustmentMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/process/ProcessAdjustmentTypeDao.java b/src/com/sipai/dao/process/ProcessAdjustmentTypeDao.java deleted file mode 100644 index b08aae2b..00000000 --- a/src/com/sipai/dao/process/ProcessAdjustmentTypeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.ProcessAdjustmentType; -import org.springframework.stereotype.Repository; - -@Repository -public class ProcessAdjustmentTypeDao extends CommDaoImpl { - public ProcessAdjustmentTypeDao() { - super(); - this.setMappernamespace("process.ProcessAdjustmentTypeMapper"); - } -} diff --git a/src/com/sipai/dao/process/ProcessSectionInformationDao.java b/src/com/sipai/dao/process/ProcessSectionInformationDao.java deleted file mode 100644 index 7d4340fb..00000000 --- a/src/com/sipai/dao/process/ProcessSectionInformationDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.process; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.ProcessSectionInformation; -@Repository -public class ProcessSectionInformationDao extends CommDaoImpl{ - public ProcessSectionInformationDao() { - super(); - this.setMappernamespace("process.ProcessSectionInformationMapper"); - } - -} diff --git a/src/com/sipai/dao/process/ProcessWebsiteDao.java b/src/com/sipai/dao/process/ProcessWebsiteDao.java deleted file mode 100644 index 3faf98a3..00000000 --- a/src/com/sipai/dao/process/ProcessWebsiteDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.process; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.ProcessWebsite; -@Repository -public class ProcessWebsiteDao extends CommDaoImpl{ - public ProcessWebsiteDao() { - super(); - this.setMappernamespace("process.ProcessWebsiteMapper"); - } - -} diff --git a/src/com/sipai/dao/process/RoutineWorkDao.java b/src/com/sipai/dao/process/RoutineWorkDao.java deleted file mode 100644 index 7429479f..00000000 --- a/src/com/sipai/dao/process/RoutineWorkDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.RoutineWork; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -@Repository -public class RoutineWorkDao extends CommDaoImpl { - public RoutineWorkDao() { - super(); - this.setMappernamespace("process.RoutineWorkMapper"); - } - - public List selectCountByWhere(RoutineWork routineWork) { - List list = getSqlSession().selectList("process.RoutineWorkMapper.selectCountByWhere", routineWork); - return list; - } -} diff --git a/src/com/sipai/dao/process/TestIndexManageDao.java b/src/com/sipai/dao/process/TestIndexManageDao.java deleted file mode 100644 index e8b267c5..00000000 --- a/src/com/sipai/dao/process/TestIndexManageDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.TestIndexManage; - - -import org.springframework.stereotype.Repository; - -@Repository -public class TestIndexManageDao extends CommDaoImpl { - public TestIndexManageDao() { - super(); - this.setMappernamespace("process.TestIndexManageMapper"); - } -} diff --git a/src/com/sipai/dao/process/TestMethodsDao.java b/src/com/sipai/dao/process/TestMethodsDao.java deleted file mode 100644 index d99ec768..00000000 --- a/src/com/sipai/dao/process/TestMethodsDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.TestMethods; -import org.springframework.stereotype.Repository; - -@Repository -public class TestMethodsDao extends CommDaoImpl { - public TestMethodsDao() { - super(); - this.setMappernamespace("process.TestMethodsMapper"); - } -} diff --git a/src/com/sipai/dao/process/TestTaskDao.java b/src/com/sipai/dao/process/TestTaskDao.java deleted file mode 100644 index 1c279fbe..00000000 --- a/src/com/sipai/dao/process/TestTaskDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.TestTask; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -@Repository -public class TestTaskDao extends CommDaoImpl { - public TestTaskDao() { - super(); - this.setMappernamespace("process.TestTaskMapper"); - } - - public List selectTop1ListByWhere(TestTask testTask) { - List list = getSqlSession().selectList("process.TestTaskMapper.selectTop1ListByWhere", testTask); - return list; - } - -} diff --git a/src/com/sipai/dao/process/WaterTestDao.java b/src/com/sipai/dao/process/WaterTestDao.java deleted file mode 100644 index e694509d..00000000 --- a/src/com/sipai/dao/process/WaterTestDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.WaterTest; -import org.springframework.stereotype.Repository; - -@Repository -public class WaterTestDao extends CommDaoImpl { - public WaterTestDao() { - super(); - this.setMappernamespace("process.WaterTestMapper"); - } -} diff --git a/src/com/sipai/dao/process/WaterTestDetailDao.java b/src/com/sipai/dao/process/WaterTestDetailDao.java deleted file mode 100644 index 4193e560..00000000 --- a/src/com/sipai/dao/process/WaterTestDetailDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.process; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.process.WaterTestDetail; -import org.springframework.stereotype.Repository; - -@Repository -public class WaterTestDetailDao extends CommDaoImpl { - public WaterTestDetailDao() { - super(); - this.setMappernamespace("process.WaterTestDetailMapper"); - } -} diff --git a/src/com/sipai/dao/question/QuesOptionDao.java b/src/com/sipai/dao/question/QuesOptionDao.java deleted file mode 100644 index a5d23ba6..00000000 --- a/src/com/sipai/dao/question/QuesOptionDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.question; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.question.QuesOption; -import org.springframework.stereotype.Repository; - -@Repository -public class QuesOptionDao extends CommDaoImpl { - public QuesOptionDao() { - super(); - this.setMappernamespace("question.QuesOptionMapper"); - } -} diff --git a/src/com/sipai/dao/question/QuesTitleDao.java b/src/com/sipai/dao/question/QuesTitleDao.java deleted file mode 100644 index 399e249d..00000000 --- a/src/com/sipai/dao/question/QuesTitleDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.question; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.question.QuesTitle; -import org.springframework.stereotype.Repository; - -@Repository -public class QuesTitleDao extends CommDaoImpl { - public QuesTitleDao() { - super(); - this.setMappernamespace("question.QuesTitleMapper"); - } - public int selectNumByWhere(QuesTitle t) { - QuesTitle quesTitle = getSqlSession().selectOne("question.QuesTitleMapper.selectNumByWhere", t); - return quesTitle.getNum(); - } -} - diff --git a/src/com/sipai/dao/question/QuestTypeDao.java b/src/com/sipai/dao/question/QuestTypeDao.java deleted file mode 100644 index 6772e7b9..00000000 --- a/src/com/sipai/dao/question/QuestTypeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.question; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.question.QuestType; -import org.springframework.stereotype.Repository; - -@Repository -public class QuestTypeDao extends CommDaoImpl { - public QuestTypeDao() { - super(); - this.setMappernamespace("question.QuestTypeMapper"); - } -} diff --git a/src/com/sipai/dao/question/RankTypeDao.java b/src/com/sipai/dao/question/RankTypeDao.java deleted file mode 100644 index 9579e12f..00000000 --- a/src/com/sipai/dao/question/RankTypeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.question; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.question.RankType; -import org.springframework.stereotype.Repository; - -@Repository -public class RankTypeDao extends CommDaoImpl { - public RankTypeDao() { - super(); - this.setMappernamespace("question.RankTypeMapper"); - } -} diff --git a/src/com/sipai/dao/question/SubjecttypeDao.java b/src/com/sipai/dao/question/SubjecttypeDao.java deleted file mode 100644 index f5ef2749..00000000 --- a/src/com/sipai/dao/question/SubjecttypeDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.question; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.question.Subjecttype; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class SubjecttypeDao extends CommDaoImpl{ - public SubjecttypeDao(){ - super(); - this.setMappernamespace("question.SubjecttypeMapper"); - } - public List selectListOnlyLast( Subjecttype t) { - List list = getSqlSession().selectList("question.SubjecttypeMapper.selectListOnlyLast", t); - return list; - } - - -} diff --git a/src/com/sipai/dao/report/CustomReportDao.java b/src/com/sipai/dao/report/CustomReportDao.java deleted file mode 100644 index ce03f699..00000000 --- a/src/com/sipai/dao/report/CustomReportDao.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.CustomReport; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class CustomReportDao extends CommDaoImpl { - public CustomReportDao() { - super(); - this.setMappernamespace("report.CustomReportMapper"); - } - - public List> getSpCustomReportData(String sdt, String edt, String calculation, String frequencyType, String frequency, String mpids, String EPName, String chooseDataWhere) { - Map paramMap = new HashMap<>(); - paramMap.put("sdt", sdt); - paramMap.put("edt", edt); - paramMap.put("calculation", calculation); - paramMap.put("frequencyType", frequencyType); - paramMap.put("frequency", frequency); - paramMap.put("mpids", mpids); - paramMap.put("EPName", EPName); - paramMap.put("chooseDataWhere", chooseDataWhere); - List> list = this.getSqlSession().selectList("report.CustomReportMapper.getSpCustomReportData", paramMap); - return list; - } -} diff --git a/src/com/sipai/dao/report/CustomReportMPointDao.java b/src/com/sipai/dao/report/CustomReportMPointDao.java deleted file mode 100644 index 7778e8c0..00000000 --- a/src/com/sipai/dao/report/CustomReportMPointDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.CustomReportMPoint; - -@Repository -public class CustomReportMPointDao extends CommDaoImpl{ - public CustomReportMPointDao(){ - super(); - this.setMappernamespace("report.CustomReportMPointMapper"); - } -} diff --git a/src/com/sipai/dao/report/DrainageDataomprehensiveTableConfigureDao.java b/src/com/sipai/dao/report/DrainageDataomprehensiveTableConfigureDao.java deleted file mode 100644 index 6c3c4a2c..00000000 --- a/src/com/sipai/dao/report/DrainageDataomprehensiveTableConfigureDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.DrainageDataomprehensiveTableConfigure; - -@Repository -public class DrainageDataomprehensiveTableConfigureDao extends CommDaoImpl{ - public DrainageDataomprehensiveTableConfigureDao(){ - super(); - this.setMappernamespace("report.drainageDataomprehensiveTableConfigure"); - } -} diff --git a/src/com/sipai/dao/report/DrainageDataomprehensiveTableDao.java b/src/com/sipai/dao/report/DrainageDataomprehensiveTableDao.java deleted file mode 100644 index 9de8f4a6..00000000 --- a/src/com/sipai/dao/report/DrainageDataomprehensiveTableDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.report; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.DrainageDataomprehensiveTable; - -@Repository -public class DrainageDataomprehensiveTableDao extends CommDaoImpl{ - public DrainageDataomprehensiveTableDao(){ - super(); - this.setMappernamespace("report.drainageDataomprehensiveTable"); - } - - public List getownsql(DrainageDataomprehensiveTable drainageDataomprehensiveTable){ - return this.getSqlSession().selectList("report.drainageDataomprehensiveTable.getownsql", drainageDataomprehensiveTable); - } -} diff --git a/src/com/sipai/dao/report/DrainageDataomprehensiveTableMainconfigureDao.java b/src/com/sipai/dao/report/DrainageDataomprehensiveTableMainconfigureDao.java deleted file mode 100644 index e157c9d8..00000000 --- a/src/com/sipai/dao/report/DrainageDataomprehensiveTableMainconfigureDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.report; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigure; - -@Repository -public class DrainageDataomprehensiveTableMainconfigureDao extends CommDaoImpl{ - public DrainageDataomprehensiveTableMainconfigureDao(){ - super(); - this.setMappernamespace("report.drainageDataomprehensiveTableMainconfigure"); - } - - public List getownsql(DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure){ - return this.getSqlSession().selectList("report.drainageDataomprehensiveTableMainconfigure.getownsql", drainageDataomprehensiveTableMainconfigure); - } - -} diff --git a/src/com/sipai/dao/report/DrainageDataomprehensiveTableMainconfigureDetailDao.java b/src/com/sipai/dao/report/DrainageDataomprehensiveTableMainconfigureDetailDao.java deleted file mode 100644 index 5b2f31fb..00000000 --- a/src/com/sipai/dao/report/DrainageDataomprehensiveTableMainconfigureDetailDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.report; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigure; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigureDetail; - -@Repository -public class DrainageDataomprehensiveTableMainconfigureDetailDao extends CommDaoImpl{ - public DrainageDataomprehensiveTableMainconfigureDetailDao(){ - super(); - this.setMappernamespace("report.drainageDataomprehensiveTableMainconfigureDetail"); - } - - public List getownsql(DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail){ - return this.getSqlSession().selectList("report.drainageDataomprehensiveTableMainconfigureDetail.getownsql", drainageDataomprehensiveTableMainconfigureDetail); - } -} diff --git a/src/com/sipai/dao/report/ReportTemplateDao.java b/src/com/sipai/dao/report/ReportTemplateDao.java deleted file mode 100644 index 27827f61..00000000 --- a/src/com/sipai/dao/report/ReportTemplateDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.ReportTemplate; - -@Repository -public class ReportTemplateDao extends CommDaoImpl{ - public ReportTemplateDao(){ - super(); - this.setMappernamespace("report.ReportTemplateMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptCollectModeDao.java b/src/com/sipai/dao/report/RptCollectModeDao.java deleted file mode 100644 index 5e259367..00000000 --- a/src/com/sipai/dao/report/RptCollectModeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptCollectMode; -@Repository -public class RptCollectModeDao extends CommDaoImpl{ - public RptCollectModeDao(){ - super(); - this.setMappernamespace("report.RptCollectModeMapper"); - } - -} diff --git a/src/com/sipai/dao/report/RptCreateDao.java b/src/com/sipai/dao/report/RptCreateDao.java deleted file mode 100644 index c7d44b6c..00000000 --- a/src/com/sipai/dao/report/RptCreateDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptCreate; - -@Repository -public class RptCreateDao extends CommDaoImpl{ - public RptCreateDao() { - super(); - this.setMappernamespace("report.RptCreateMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/report/RptDayLogDao.java b/src/com/sipai/dao/report/RptDayLogDao.java deleted file mode 100644 index be49e3bd..00000000 --- a/src/com/sipai/dao/report/RptDayLogDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptDayLog; - -@Repository -public class RptDayLogDao extends CommDaoImpl { - public RptDayLogDao(){ - super(); - this.setMappernamespace("report.RptDayLogMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptDayValSetDao.java b/src/com/sipai/dao/report/RptDayValSetDao.java deleted file mode 100644 index 14247c98..00000000 --- a/src/com/sipai/dao/report/RptDayValSetDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptDayValSet; - -@Repository -public class RptDayValSetDao extends CommDaoImpl { - public RptDayValSetDao(){ - super(); - this.setMappernamespace("report.RptDayValSetMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptDeptSetDao.java b/src/com/sipai/dao/report/RptDeptSetDao.java deleted file mode 100644 index 4db704c6..00000000 --- a/src/com/sipai/dao/report/RptDeptSetDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptDeptSet; - -@Repository -public class RptDeptSetDao extends CommDaoImpl { - public RptDeptSetDao(){ - super(); - this.setMappernamespace("report.RptDeptSetMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptDeptSetUserDao.java b/src/com/sipai/dao/report/RptDeptSetUserDao.java deleted file mode 100644 index 5581e61a..00000000 --- a/src/com/sipai/dao/report/RptDeptSetUserDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptDeptSetUser; - -@Repository -public class RptDeptSetUserDao extends CommDaoImpl { - public RptDeptSetUserDao(){ - super(); - this.setMappernamespace("report.RptDeptSetUserMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptInfoSetDao.java b/src/com/sipai/dao/report/RptInfoSetDao.java deleted file mode 100644 index 03909ee2..00000000 --- a/src/com/sipai/dao/report/RptInfoSetDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptInfoSet; - -@Repository -public class RptInfoSetDao extends CommDaoImpl{ - public RptInfoSetDao() { - super(); - this.setMappernamespace("report.RptInfoSetMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/report/RptInfoSetFileDao.java b/src/com/sipai/dao/report/RptInfoSetFileDao.java deleted file mode 100644 index 83738e83..00000000 --- a/src/com/sipai/dao/report/RptInfoSetFileDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptInfoSetFile; - -@Repository -public class RptInfoSetFileDao extends CommDaoImpl{ - public RptInfoSetFileDao() { - super(); - this.setMappernamespace("report.RptInfoSetFileMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptInfoSetSheetDao.java b/src/com/sipai/dao/report/RptInfoSetSheetDao.java deleted file mode 100644 index 4608a812..00000000 --- a/src/com/sipai/dao/report/RptInfoSetSheetDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.report; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptInfoSetFile; -import com.sipai.entity.report.RptInfoSetSheet; -import org.springframework.stereotype.Repository; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2022/02/17/14:44 - * @Description: - */ - -@Repository -public class RptInfoSetSheetDao extends CommDaoImpl { - public RptInfoSetSheetDao() { - super(); - this.setMappernamespace("report.RptInfoSetSheetMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptLogDao.java b/src/com/sipai/dao/report/RptLogDao.java deleted file mode 100644 index 080cf623..00000000 --- a/src/com/sipai/dao/report/RptLogDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptLog; - -@Repository -public class RptLogDao extends CommDaoImpl{ - public RptLogDao(){ - super(); - this.setMappernamespace("report.RptLogMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptMpSetDao.java b/src/com/sipai/dao/report/RptMpSetDao.java deleted file mode 100644 index 98ed3aa6..00000000 --- a/src/com/sipai/dao/report/RptMpSetDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptMpSet; - -@Repository -public class RptMpSetDao extends CommDaoImpl { - public RptMpSetDao(){ - super(); - this.setMappernamespace("report.RptMpSetMapper"); - } -} diff --git a/src/com/sipai/dao/report/RptSpSetDao.java b/src/com/sipai/dao/report/RptSpSetDao.java deleted file mode 100644 index 28021b38..00000000 --- a/src/com/sipai/dao/report/RptSpSetDao.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.dao.report; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptSpSet; - -@Repository -public class RptSpSetDao extends CommDaoImpl{ - public RptSpSetDao() { - super(); - this.setMappernamespace("report.RptSpSetMapper"); - } - public int updateRptstByPid(String rptsdt,String starthour,String pid){ - Map paramMap=new HashMap<>(); - paramMap.put("rptsdt",rptsdt); - paramMap.put("starthour",starthour); - paramMap.put("pid",pid); - int result= this.getSqlSession().update( - getMappernamespace()+".updateRptsdtByPid", paramMap); - - return result; - } - - public List selectSheetNameList(String s) { - Map paramMap=new HashMap<>(); - paramMap.put("where",s); - return this.getSqlSession().selectList("report.RptSpSetMapper.selectSheetNameList", paramMap); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/report/RptTypeSetDao.java b/src/com/sipai/dao/report/RptTypeSetDao.java deleted file mode 100644 index 3c180efa..00000000 --- a/src/com/sipai/dao/report/RptTypeSetDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.RptTypeSet; - -@Repository -public class RptTypeSetDao extends CommDaoImpl { - public RptTypeSetDao(){ - super(); - this.setMappernamespace("report.RptTypeSetMapper"); - } -} diff --git a/src/com/sipai/dao/report/TemplateTypeDao.java b/src/com/sipai/dao/report/TemplateTypeDao.java deleted file mode 100644 index ae0fd5a5..00000000 --- a/src/com/sipai/dao/report/TemplateTypeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.report; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.report.TemplateType; - -@Repository -public class TemplateTypeDao extends CommDaoImpl{ - public TemplateTypeDao(){ - super(); - this.setMappernamespace("report.TemplateTypeMapper"); - } -} diff --git a/src/com/sipai/dao/repository/MPointPropSourceRepo.java b/src/com/sipai/dao/repository/MPointPropSourceRepo.java deleted file mode 100644 index f42caca9..00000000 --- a/src/com/sipai/dao/repository/MPointPropSourceRepo.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sipai.dao.repository; - -import com.sipai.entity.scada.MPointPropSource; -import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; - -public interface MPointPropSourceRepo extends ElasticsearchRepository{ - -} diff --git a/src/com/sipai/dao/repository/MPointRepo.java b/src/com/sipai/dao/repository/MPointRepo.java deleted file mode 100644 index 537873c2..00000000 --- a/src/com/sipai/dao/repository/MPointRepo.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sipai.dao.repository; - -import com.sipai.entity.scada.MPoint; -import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; - -public interface MPointRepo extends ElasticsearchRepository,MPointRepository{ - -} diff --git a/src/com/sipai/dao/repository/MPointRepository.java b/src/com/sipai/dao/repository/MPointRepository.java deleted file mode 100644 index 432f9bfa..00000000 --- a/src/com/sipai/dao/repository/MPointRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.dao.repository; - -import com.sipai.entity.scada.MPoint; -import org.springframework.data.elasticsearch.core.query.SearchQuery; - -import java.util.List; - -public interface MPointRepository { - int updateSelective(MPoint mpoint); -// void batchInsert(List mPointES); - public List getAllList(SearchQuery searchQuery); -} diff --git a/src/com/sipai/dao/repository/MPointRepositoryImpl.java b/src/com/sipai/dao/repository/MPointRepositoryImpl.java deleted file mode 100644 index bc13d7df..00000000 --- a/src/com/sipai/dao/repository/MPointRepositoryImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.dao.repository; - -//import com.google.gson.Gson; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.MPointES; -import com.sipai.tools.CommUtil; -import org.apache.log4j.Logger; -import org.elasticsearch.action.index.IndexRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; -import org.springframework.data.elasticsearch.core.ScrolledPage; -import org.springframework.data.elasticsearch.core.query.SearchQuery; -import org.springframework.data.elasticsearch.core.query.UpdateQuery; -import org.springframework.data.elasticsearch.core.query.UpdateQueryBuilder; - -import java.beans.PropertyDescriptor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -public class MPointRepositoryImpl implements MPointRepository { - private static final Logger logger = Logger.getLogger(MPointRepositoryImpl.class); - @Autowired - private ElasticsearchTemplate elasticsearchTemplate; - -// @Override - public int updateSelective(MPoint mpoint){ - int res = 1; - if(mpoint.getId() == null){ - return 0; - } - try { - IndexRequest indexRequest = new IndexRequest(); - // TODO 等你优化 -// if(mpoint.getSourceType()!=null){ -// indexRequest.source("source_type", mpoint.getSourceType()); -// UpdateQuery updateQuery = new UpdateQueryBuilder().withId(mpoint.getId()).withClass(MPoint.class).withIndexRequest(indexRequest).build(); -// elasticsearchTemplate.update(updateQuery); -// } - //TODO YYJ 有两个名称要改 - for(Field f : mpoint.getClass().getDeclaredFields()){ - f.setAccessible(true); - if(f.get(mpoint) != null){ - try { - Class clazz = Class.forName("com.sipai.entity.scada.MPoint"); - PropertyDescriptor pd = new PropertyDescriptor(f.getName(), clazz); - Method rM = pd.getReadMethod();//获得读方法 - Object value = rM.invoke(mpoint); - indexRequest.source(f.getName(), value); - UpdateQuery updateQuery = new UpdateQueryBuilder().withId(mpoint.getId()).withClass(MPoint.class).withIndexRequest(indexRequest).build(); - elasticsearchTemplate.update(updateQuery); - }catch(Exception e){ - continue; - } - } - } - }catch(Exception e){ - res = 0; - logger.info("----------测量点更新传参问题-------------"); - logger.info(CommUtil.toJson(mpoint)); - } - elasticsearchTemplate.refresh("es_measurepoint"); - return res; - } - - public void batchInsert(List mPointES){ - - int counter = 0; - - //判断index 是否存在 - if (!elasticsearchTemplate.indexExists("es_measurepoint")) { - elasticsearchTemplate.createIndex("es_measurepoint"); - } - - List queries = new ArrayList<>(); - if(mPointES != null && mPointES.size()>0){ - for (MPointES item : mPointES) { - if(item.getMeasuredt()!=null){ - IndexRequest indexRequest = new IndexRequest(); - indexRequest.source("measuredt", item.getMeasuredt()); - UpdateQuery updateQuery = new UpdateQueryBuilder().withId(item.getId()).withClass(MPoint.class).withIndexRequest(indexRequest).build(); - queries.add(updateQuery); - } - if(item.getParmvalue()!=null){ - IndexRequest indexRequest = new IndexRequest(); - indexRequest.source("parmvalue", item.getParmvalue()); - UpdateQuery updateQuery = new UpdateQueryBuilder().withId(item.getId()).withClass(MPoint.class).withIndexRequest(indexRequest).build(); - queries.add(updateQuery); - } - //分批提交索引 - if (counter % 500 == 0) { - elasticsearchTemplate.bulkUpdate(queries); - queries.clear(); - System.out.println("bulkIndex counter : " + counter); - } - counter++; - } - - } - //不足批的索引最后不要忘记提交 - if (queries.size() > 0) { - elasticsearchTemplate.bulkUpdate(queries); - } -// elasticsearchTemplate.refresh("es_measurepoint"); - } - public List getAllList(SearchQuery searchQuery){ - List mPoints = new ArrayList<>(); - // 滚动查询 - ScrolledPage scroll = (ScrolledPage) elasticsearchTemplate.startScroll(3000, searchQuery, MPoint.class); - -// 判断是否有内容 - while (scroll.hasContent()) { - List content = scroll.getContent(); - mPoints.addAll(content); - // 业务逻辑省略 - //取下一页,scrollId在es服务器上可能会发生变化,需要用最新的。发起continueScroll请求会重新刷新快照保留时间 - scroll = (ScrolledPage) elasticsearchTemplate.continueScroll(scroll.getScrollId(), 3000, MPoint.class); - } - -// 最后释放查询 - elasticsearchTemplate.clearScroll(scroll.getScrollId()); - return mPoints; - } -} diff --git a/src/com/sipai/dao/safety/SafetyCertificateDao.java b/src/com/sipai/dao/safety/SafetyCertificateDao.java deleted file mode 100644 index 3f08786c..00000000 --- a/src/com/sipai/dao/safety/SafetyCertificateDao.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyCertificate; -import com.sipai.entity.safety.SafetyExternalCertificateVo; -import com.sipai.entity.safety.SafetyInternalCertificateVo; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -/** - * @author LiTao - * @date 2022-09-21 14:41:59 - * @description: 人员证书 - */ -@Repository -public class SafetyCertificateDao extends CommDaoImpl { - - public SafetyCertificateDao(){ - super(); - this.setMappernamespace("safety.SafetyCertificateMapper"); - } - - /** - * 作业类型下拉 - * @return - */ - public List> jobTypePulldown() { - List> result = this.getSqlSession().selectList(this.getMappernamespace()+".jobTypePulldown"); - return result; - } - -//------------------ 内部证书 --------------------- - public List selectListByConditionForInternal(SafetyInternalCertificateVo vo) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByConditionForInternal", vo); - return list; - } - - public SafetyInternalCertificateVo selectOneByIdForInternal(String id) { - SafetyInternalCertificateVo result = this.getSqlSession().selectOne(this.getMappernamespace()+".selectOneByIdForInternal", id); - return result; - } - - public List selectOneByConditionForInternal(SafetyCertificate bean) { - List result = this.getSqlSession().selectList(this.getMappernamespace()+".selectOneByConditionForInternal", bean); - return result; - } - -//------------------ 外部证书 --------------------- - - - public List selectListByConditionForExternal(SafetyExternalCertificateVo vo) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByConditionForExternal", vo); - return list; - } - - public SafetyExternalCertificateVo selectOneByIdForExternal(String id) { - SafetyExternalCertificateVo result = this.getSqlSession().selectOne(this.getMappernamespace()+".selectOneByIdForExternal", id); - return result; - } - - public List selectOneByConditionForExternal(SafetyCertificate bean) { - List result = this.getSqlSession().selectList(this.getMappernamespace()+".selectOneByConditionForExternal", bean); - return result; - } - - -} diff --git a/src/com/sipai/dao/safety/SafetyCheckComprehensiveDao.java b/src/com/sipai/dao/safety/SafetyCheckComprehensiveDao.java deleted file mode 100644 index a237ddbe..00000000 --- a/src/com/sipai/dao/safety/SafetyCheckComprehensiveDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyCheckComprehensive; -import com.sipai.entity.safety.SafetyCheckComprehensiveQuery; -import com.sipai.entity.safety.SafetyCheckComprehensiveVo; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 综合检查 - * - * @author lt - */ -@Repository -public class SafetyCheckComprehensiveDao extends CommDaoImpl { - public SafetyCheckComprehensiveDao() { - super(); - this.setMappernamespace("safety.SafetyCheckComprehensiveMapper"); - } - - public List getList(SafetyCheckComprehensiveQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - -} diff --git a/src/com/sipai/dao/safety/SafetyCheckDaylyDao.java b/src/com/sipai/dao/safety/SafetyCheckDaylyDao.java deleted file mode 100644 index ef105070..00000000 --- a/src/com/sipai/dao/safety/SafetyCheckDaylyDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyCheckDaylyVo; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyCheckDayly; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyCheckDaylyDao extends CommDaoImpl { - public SafetyCheckDaylyDao() { - super(); - this.setMappernamespace("safety.SafetyCheckDaylyMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - -} diff --git a/src/com/sipai/dao/safety/SafetyCheckSpecialDao.java b/src/com/sipai/dao/safety/SafetyCheckSpecialDao.java deleted file mode 100644 index 9121ed9f..00000000 --- a/src/com/sipai/dao/safety/SafetyCheckSpecialDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyCheckSpecial; -import com.sipai.entity.safety.SafetyCheckSpecialQuery; -import com.sipai.entity.safety.SafetyCheckSpecialVo; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 专项安全检查 - * - * @author lt - */ -@Repository -public class SafetyCheckSpecialDao extends CommDaoImpl { - public SafetyCheckSpecialDao() { - super(); - this.setMappernamespace("safety.SafetyCheckSpecialMapper"); - } - - public List getList(SafetyCheckSpecialQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - -} diff --git a/src/com/sipai/dao/safety/SafetyEducationBuilderDao.java b/src/com/sipai/dao/safety/SafetyEducationBuilderDao.java deleted file mode 100644 index 2dc28255..00000000 --- a/src/com/sipai/dao/safety/SafetyEducationBuilderDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationBuilder; -import com.sipai.entity.safety.SafetyEducationBuilderQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyEducationBuilderDao extends CommDaoImpl { - public SafetyEducationBuilderDao() { - super(); - this.setMappernamespace("safety.SafetyEducationBuilderMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - - public List companyList() { - return this.getSqlSession().selectList(this.getMappernamespace()+".companyList"); - } - - public List getUnbindList(SafetyEducationBuilderQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getUnbindList",query); - } -} diff --git a/src/com/sipai/dao/safety/SafetyEducationInsiderDao.java b/src/com/sipai/dao/safety/SafetyEducationInsiderDao.java deleted file mode 100644 index 85ac1206..00000000 --- a/src/com/sipai/dao/safety/SafetyEducationInsiderDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationInsider; -import com.sipai.entity.safety.SafetyEducationInsiderVo; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyEducationInsiderDao extends CommDaoImpl { - public SafetyEducationInsiderDao() { - super(); - this.setMappernamespace("safety.SafetyEducationInsiderMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } -} diff --git a/src/com/sipai/dao/safety/SafetyEducationTraineeDao.java b/src/com/sipai/dao/safety/SafetyEducationTraineeDao.java deleted file mode 100644 index 74c89084..00000000 --- a/src/com/sipai/dao/safety/SafetyEducationTraineeDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationTrainee; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyEducationTraineeDao extends CommDaoImpl { - public SafetyEducationTraineeDao() { - super(); - this.setMappernamespace("safety.SafetyEducationTraineeMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+ ".getList", query); - } -} diff --git a/src/com/sipai/dao/safety/SafetyEducationVisitorDao.java b/src/com/sipai/dao/safety/SafetyEducationVisitorDao.java deleted file mode 100644 index 9d710cef..00000000 --- a/src/com/sipai/dao/safety/SafetyEducationVisitorDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.kpi.KpiApplyBiz; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationVisitor; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyEducationVisitorDao extends CommDaoImpl { - public SafetyEducationVisitorDao() { - super(); - this.setMappernamespace("safety.SafetyEducationVisitorMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+ ".getList", query); - } -} diff --git a/src/com/sipai/dao/safety/SafetyExternalStaffDao.java b/src/com/sipai/dao/safety/SafetyExternalStaffDao.java deleted file mode 100644 index 6de14db4..00000000 --- a/src/com/sipai/dao/safety/SafetyExternalStaffDao.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyExternalCertificateExcel; -import com.sipai.entity.safety.SafetyExternalStaff; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -/** - * @author LiTao - * @date 2022-09-21 14:41:59 - * @description: 外部人员 - */ -@Repository -public class SafetyExternalStaffDao extends CommDaoImpl { - - public SafetyExternalStaffDao() { - super(); - this.setMappernamespace("safety.SafetyExternalStaffMapper"); - } - - /** - * 施工单位下拉 - * - * @return - */ - public List> companyPulldown() { - List> result = this.getSqlSession().selectList(this.getMappernamespace() + ".companyPulldown"); - return result; - } - - /** - * 根据条件获取外部人员信息列表 - * - * @param externalStaff - * @return - */ - public List getExternalStaffByCondition(SafetyExternalStaff externalStaff) { - List result = this.getSqlSession().selectList(this.getMappernamespace() + ".getExternalStaffByCondition", externalStaff); - return result; - } - - /** - * 外部人员身份证号验证唯一 - * @param safetyExternalStaff - * @return - */ - public List validationIdcard(SafetyExternalStaff safetyExternalStaff){ - List result = this.getSqlSession().selectList(this.getMappernamespace() + ".validationIdcard", safetyExternalStaff); - return result; - } - - public String selectUsher(SafetyExternalCertificateExcel excelEntity){ - return this.getSqlSession().selectOne(this.getMappernamespace() + ".selectUsher", excelEntity); - } -} diff --git a/src/com/sipai/dao/safety/SafetyFilesDao.java b/src/com/sipai/dao/safety/SafetyFilesDao.java deleted file mode 100644 index a3511a00..00000000 --- a/src/com/sipai/dao/safety/SafetyFilesDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyFiles; -import org.springframework.stereotype.Repository; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyFilesDao extends CommDaoImpl { - public SafetyFilesDao() { - super(); - this.setMappernamespace("safety.SafetyFilesMapper"); - } - - public void deleteByBizId(String bizId) { - this.getSqlSession().delete("deleteByBizId", bizId); - } -} diff --git a/src/com/sipai/dao/safety/SafetyFlowTaskDao.java b/src/com/sipai/dao/safety/SafetyFlowTaskDao.java deleted file mode 100644 index e4c6776a..00000000 --- a/src/com/sipai/dao/safety/SafetyFlowTaskDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyFlowTask; -import com.sipai.entity.safety.SafetyCommonQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyFlowTaskDao extends CommDaoImpl { - public SafetyFlowTaskDao() { - super(); - this.setMappernamespace("safety.SafetyFlowTaskMapper"); - } - - public List getList(String bizId) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",bizId); - } - -} diff --git a/src/com/sipai/dao/safety/SafetyFlowTaskDetailDao.java b/src/com/sipai/dao/safety/SafetyFlowTaskDetailDao.java deleted file mode 100644 index d44e8870..00000000 --- a/src/com/sipai/dao/safety/SafetyFlowTaskDetailDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyFlowTaskDetail; -import com.sipai.entity.safety.SafetyCommonQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 安全管理文件 - * - * @author lichen - */ -@Repository -public class SafetyFlowTaskDetailDao extends CommDaoImpl { - public SafetyFlowTaskDetailDao() { - super(); - this.setMappernamespace("safety.SafetyFlowTaskDetailMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - -} diff --git a/src/com/sipai/dao/safety/SafetyJobInsideDao.java b/src/com/sipai/dao/safety/SafetyJobInsideDao.java deleted file mode 100644 index 0acc8249..00000000 --- a/src/com/sipai/dao/safety/SafetyJobInsideDao.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.safety.*; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 内部作业 - * - * @author lichen - */ -@Repository -public class SafetyJobInsideDao extends CommDaoImpl { - public SafetyJobInsideDao() { - super(); - this.setMappernamespace("safety.SafetyJobInsideMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - - public List jobCompanyList() { - return this.getSqlSession().selectList(this.getMappernamespace()+".jobCompanyList"); - } - -} diff --git a/src/com/sipai/dao/safety/SafetyJobOutsideDao.java b/src/com/sipai/dao/safety/SafetyJobOutsideDao.java deleted file mode 100644 index 97ff966b..00000000 --- a/src/com/sipai/dao/safety/SafetyJobOutsideDao.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyJobOutside; -import com.sipai.entity.safety.SafetyJobOutsideVo; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 外部作业 - * - * @author lichen - */ -@Repository -public class SafetyJobOutsideDao extends CommDaoImpl { - public SafetyJobOutsideDao() { - super(); - this.setMappernamespace("safety.SafetyJobOutsideMapper"); - } - - public List getList(SafetyCommonQuery query) { - return this.getSqlSession().selectList(this.getMappernamespace()+".getList",query); - } - - public List jobCompanyList() { - return this.getSqlSession().selectList(this.getMappernamespace()+".jobCompanyList"); - } - -} diff --git a/src/com/sipai/dao/safety/StaffArchivesDao.java b/src/com/sipai/dao/safety/StaffArchivesDao.java deleted file mode 100644 index adc9a4b4..00000000 --- a/src/com/sipai/dao/safety/StaffArchivesDao.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.dao.safety; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.safety.SafetyStaffArchives; -import com.sipai.entity.safety.SafetyStaffArchivesVo; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -@Repository -public class StaffArchivesDao extends CommDaoImpl { - public StaffArchivesDao() { - super(); - this.setMappernamespace("safety.SafetyStaffArchivesMapper"); - } - - public List selectListByCondition(SafetyStaffArchivesVo vo) { - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListByCondition", vo); - return list; - } - - public SafetyStaffArchivesVo selectOneById(String id) { - SafetyStaffArchivesVo result = this.getSqlSession().selectOne(this.getMappernamespace() + ".selectOneById", id); - return result; - } - - public List> postPulldown() { - List> result = this.getSqlSession().selectList(this.getMappernamespace() + ".postPulldown"); - return result; - } - - // 验证身份证号重复 - public List verifyIdcardRepeat(SafetyStaffArchives safetyStaffArchives){ - List result = this.getSqlSession().selectList(this.getMappernamespace() + ".verifyIdcardRepeat", safetyStaffArchives); - return result; - } - -} diff --git a/src/com/sipai/dao/scada/DataSummaryDao.java b/src/com/sipai/dao/scada/DataSummaryDao.java deleted file mode 100644 index c990fcff..00000000 --- a/src/com/sipai/dao/scada/DataSummaryDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.scada; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.DataSummary; - -@Repository -public class DataSummaryDao extends CommDaoImpl{ - public DataSummaryDao() { - super(); - this.setMappernamespace("scada.DataSummaryMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/MPointDao.java b/src/com/sipai/dao/scada/MPointDao.java deleted file mode 100644 index 41ff4d17..00000000 --- a/src/com/sipai/dao/scada/MPointDao.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.dao.scada; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; - -@Repository -public class MPointDao extends CommDaoImpl{ - - public MPointDao() { - super(); - this.setMappernamespace("scada.MPointMapper"); - } - - public MPoint4APP selectByWhere4APP(String t){ - MPoint4APP mPoint4APP = getSqlSession().selectOne("scada.MPointMapper.selectByWhere4APP", t); - return mPoint4APP; - } - - public List selectListByWhere4APP(MPoint4APP t) { - List list = this.getSqlSession().selectList("scada.MPointMapper.selectListByWhere4APP", t); - return list; - } - - public List selectTopNumListByTableAWhere(MPoint mPoint) { - List list = getSqlSession().selectList("scada.MPointMapper.selectTopNumListByTableAWhere", mPoint); - return list; - } - - public List selectTopNumListByWhere(String where,String topNum) { - Map paramMap=new HashMap<>(); - paramMap.put("where",where); - paramMap.put("topNum",topNum); - List list = getSqlSession().selectList("scada.MPointMapper.selectTopNumListByWhere", paramMap); - return list; - } - - public MPoint selectByMpointCode(String mpointcode){ - MPoint mPoint = this.getSqlSession().selectOne("scada.MPointMapper.selectByMpointCode", mpointcode); - return mPoint; - } - - public int updateAlarmmax(String mpointcode) { - Map paramMap=new HashMap<>(); - paramMap.put("mpointcode",mpointcode); - return this.getSqlSession().delete("scada.MPointMapper.updateAlarmmax", paramMap); - } - public int updateAlarmmin(String mpointcode) { - Map paramMap=new HashMap<>(); - paramMap.put("mpointcode",mpointcode); - return this.getSqlSession().delete("scada.MPointMapper.updateAlarmmin", paramMap); - } - public int updateHalarmmax(String mpointcode) { - Map paramMap=new HashMap<>(); - paramMap.put("mpointcode",mpointcode); - return this.getSqlSession().delete("scada.MPointMapper.updateHalarmmax", paramMap); - } - public int updateLalarmmin(String mpointcode) { - Map paramMap=new HashMap<>(); - paramMap.put("mpointcode",mpointcode); - return this.getSqlSession().delete("scada.MPointMapper.updateLalarmmin", paramMap); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/MPointExpandDao.java b/src/com/sipai/dao/scada/MPointExpandDao.java deleted file mode 100644 index a71c36ed..00000000 --- a/src/com/sipai/dao/scada/MPointExpandDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.scada; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointExpand; -import org.springframework.stereotype.Repository; - -@Repository -public class MPointExpandDao extends CommDaoImpl { - public MPointExpandDao() { - super(); - this.setMappernamespace("scada.MPointExpandMapper"); - } -} diff --git a/src/com/sipai/dao/scada/MPointFormulaAutoHourDao.java b/src/com/sipai/dao/scada/MPointFormulaAutoHourDao.java deleted file mode 100644 index 7fdc46de..00000000 --- a/src/com/sipai/dao/scada/MPointFormulaAutoHourDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.scada; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointFormulaAutoHour; -import org.springframework.stereotype.Repository; - -@Repository -public class MPointFormulaAutoHourDao extends CommDaoImpl { - public MPointFormulaAutoHourDao() { - super(); - this.setMappernamespace("scada.MPointFormulaAutoHourMapper"); - } -} diff --git a/src/com/sipai/dao/scada/MPointFormulaDao.java b/src/com/sipai/dao/scada/MPointFormulaDao.java deleted file mode 100644 index b566d930..00000000 --- a/src/com/sipai/dao/scada/MPointFormulaDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.dao.scada; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointFormula; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class MPointFormulaDao extends CommDaoImpl { - - public MPointFormulaDao() { - super(); - this.setMappernamespace("scada.MPointFormulaMapper"); - } - - public List> getSpData(String execTime, String execType, String inMpids, String mark) { - List> list = null; - try { - Map paramMap = new HashMap<>(); - paramMap.put("execTime", execTime); - paramMap.put("execType", execType); - paramMap.put("inMpids", inMpids); - paramMap.put("mark", mark); - list = this.getSqlSession().selectList("scada.MPointFormulaMapper.getSpData", paramMap); - } catch (Exception e) { - System.out.println(e); - } - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/MPointFormulaDenominatorDao.java b/src/com/sipai/dao/scada/MPointFormulaDenominatorDao.java deleted file mode 100644 index c48ebd2b..00000000 --- a/src/com/sipai/dao/scada/MPointFormulaDenominatorDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.scada; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointFormulaDenominator; - -@Repository -public class MPointFormulaDenominatorDao extends CommDaoImpl{ - - public MPointFormulaDenominatorDao() { - super(); - this.setMappernamespace("scada.MPointFormulaDenominatorMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/MPointHistoryDao.java b/src/com/sipai/dao/scada/MPointHistoryDao.java deleted file mode 100644 index 9b457b49..00000000 --- a/src/com/sipai/dao/scada/MPointHistoryDao.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.sipai.dao.scada; - - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.apache.poi.ss.formula.functions.T; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImplScada; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; - -@Repository -public class MPointHistoryDao { - - @Resource - private SqlSessionFactory sqlSessionFactoryScada; - @Resource - private SqlSession sqlSessionScada; - private String mappernamespacescada; // 需要操作的mappernamespace名(也是数据库表名) - private boolean isAuto = true;// 默认自动提交 - - - public MPointHistoryDao() { - super(); - this.setMappernamespace("scada.MPointHistoryMapper"); - } - - public SqlSessionFactory getSqlSessionFactory() { - return sqlSessionFactoryScada; - } - - public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) { - this.sqlSessionFactoryScada = sqlSessionFactory; - } - - public boolean isAuto() { - return isAuto; - } - - public void setAuto(boolean isAuto) { - this.isAuto = isAuto; - } - - public String getMappernamespace() { - return mappernamespacescada; - } - - public void setMappernamespace(String mappernamespace) { - this.mappernamespacescada = mappernamespace; - } - - public void commit() { - if (sqlSessionScada != null) - sqlSessionScada.commit(); - } - - public SqlSession getSqlSession() { - sqlSessionScada = sqlSessionScada == null ? sqlSessionFactoryScada.openSession(isAuto) : sqlSessionScada; - return sqlSessionScada; - } - - public void close() { - if (sqlSessionScada != null) - sqlSessionScada.close(); - } - - public List selectListByTableAWhere(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectListByTableAWhere4insdt(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public MPointHistory selectSumValueByTableAWhere(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - MPointHistory one = getSqlSession().selectOne(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return one; - } - - public List selectTopNumListByTableAWhere(String tablename, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("topNum", topNum); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - //System.out.println("mappernamespacescada:"+mappernamespacescada); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectTopNumListByTableMultipleWhere(String tableA, String tableB, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("topNum", topNum); - paramMap.put("tableA", tableA); - paramMap.put("tableB", tableB); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List getRankHistory(String tablename, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("topNum", topNum); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public int deleteByTableAWhere(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - return this.getSqlSession().delete(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - /** - * 删除历史表,没有值才删除 - */ - public int dropTable(String tablename) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - List mPointHistories = this.selectListByTableAWhere(tablename, "where 1=1 "); - if (mPointHistories != null && mPointHistories.size() > 0) { - return 1; - } else { - return this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - } - - public int insertSelective(MPointHistory t) { - return getSqlSession().insert(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public List selectTop1RecordPerHour(String tablename, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - paramMap.put("topNum", topNum); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectTop1RecordPerHour1(String tablename, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - paramMap.put("topNum", topNum); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectReportList(String tablename, String wherestr, String select) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - paramMap.put("select", select); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectAggregateList(String tablename, String wherestr, String select) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - paramMap.put("select", select); - List list = getSqlSession().selectList(this.mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public int updateByMeasureDt(MPointHistory t) { - return getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), t); - } - - public int updateByWhere(String tbName, String set, String where) { - Map paramMap = new HashMap<>(); - paramMap.put("tbName", tbName); - paramMap.put("set", set); - paramMap.put("where", where); - return this.getSqlSession().delete(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - public List selectAVGday(String tablename, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - paramMap.put("topNum", topNum); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectAVGmonth(String tablename, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - paramMap.put("topNum", topNum); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectAVGdayMultiple(String tableA, String tableB, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("tableA", tableA); - paramMap.put("tableB", tableB); - paramMap.put("where", wherestr); - paramMap.put("topNum", topNum); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectAVGmonthMultiple(String tableA, String tableB, String wherestr, String topNum) { - Map paramMap = new HashMap<>(); - paramMap.put("tableA", tableA); - paramMap.put("tableB", tableB); - paramMap.put("where", wherestr); - paramMap.put("topNum", topNum); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectAVG(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectMAX(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectMIN(String tablename, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("table", tablename); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public List selectMpHisDataLeftMpHisChange(String table,String mpid, String wherestr, String dbname) { - Map paramMap = new HashMap<>(); - paramMap.put("table", table); - paramMap.put("mpid", mpid); - paramMap.put("where", wherestr); - paramMap.put("dbname", dbname); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/MPointProgrammeDao.java b/src/com/sipai/dao/scada/MPointProgrammeDao.java deleted file mode 100644 index 00580298..00000000 --- a/src/com/sipai/dao/scada/MPointProgrammeDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.scada; - - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.dao.base.CommDaoImplScada; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.scada.MPointProgramme; -import com.sipai.entity.work.Camera; - -@Repository -public class MPointProgrammeDao extends CommDaoImpl{ - public MPointProgrammeDao() { - super(); - this.setMappernamespace("scada.MPointProgramme"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/MPointProgrammeDetailDao.java b/src/com/sipai/dao/scada/MPointProgrammeDetailDao.java deleted file mode 100644 index 258981bb..00000000 --- a/src/com/sipai/dao/scada/MPointProgrammeDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.scada; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointProgrammeDetail; - -@Repository -public class MPointProgrammeDetailDao extends CommDaoImpl{ - public MPointProgrammeDetailDao() { - super(); - this.setMappernamespace("scada.MPointProgrammeDetail"); - } - -} diff --git a/src/com/sipai/dao/scada/MPointPropDao.java b/src/com/sipai/dao/scada/MPointPropDao.java deleted file mode 100644 index 16128364..00000000 --- a/src/com/sipai/dao/scada/MPointPropDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.scada; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.dao.base.CommDaoImplScada; -import com.sipai.entity.scada.MPointProp; - -@Repository -public class MPointPropDao extends CommDaoImpl{ - public MPointPropDao() { - super(); - this.setMappernamespace("scada.MPointPropMapper"); - } -} diff --git a/src/com/sipai/dao/scada/MPointPropSourceDao.java b/src/com/sipai/dao/scada/MPointPropSourceDao.java deleted file mode 100644 index 562adf4f..00000000 --- a/src/com/sipai/dao/scada/MPointPropSourceDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.scada; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.dao.base.CommDaoImplScada; -import com.sipai.entity.scada.MPointProp; -import com.sipai.entity.scada.MPointPropSource; - -@Repository -public class MPointPropSourceDao extends CommDaoImpl{ - public MPointPropSourceDao() { - super(); - this.setMappernamespace("scada.MPointPropSourceMapper"); - } -} diff --git a/src/com/sipai/dao/scada/MPointPropTargetDao.java b/src/com/sipai/dao/scada/MPointPropTargetDao.java deleted file mode 100644 index 977331d0..00000000 --- a/src/com/sipai/dao/scada/MPointPropTargetDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.scada; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointPropTarget; - - -@Repository -public class MPointPropTargetDao extends CommDaoImpl{ - public MPointPropTargetDao() { - super(); - this.setMappernamespace("scada.MPointPropTargetMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/PersonalMpCollectionDao.java b/src/com/sipai/dao/scada/PersonalMpCollectionDao.java deleted file mode 100644 index 8fb33ebd..00000000 --- a/src/com/sipai/dao/scada/PersonalMpCollectionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.scada; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.PersonalMpCollection; - -@Repository -public class PersonalMpCollectionDao extends CommDaoImpl{ - public PersonalMpCollectionDao() { - super(); - this.setMappernamespace("scada.PersonalMpCollectionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/ProAlarmBaseTextDao.java b/src/com/sipai/dao/scada/ProAlarmBaseTextDao.java deleted file mode 100644 index 8b169cbd..00000000 --- a/src/com/sipai/dao/scada/ProAlarmBaseTextDao.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.dao.scada; - - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.ProAlarmBaseText; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class ProAlarmBaseTextDao extends CommDaoImpl { - public ProAlarmBaseTextDao() { - super(); - this.setMappernamespace("scada.ProAlarmBaseTextMapper"); - } - - public List selectCountByWhere(ProAlarmBaseText t) { - List list = this.getSqlSession().selectList("scada.ProAlarmBaseTextMapper.selectCountByWhere", t); - return list; - } - - public List selectListByWhere2(ProAlarmBaseText t) { - List list = this.getSqlSession().selectList("scada.ProAlarmBaseTextMapper.selectListByWhere2", t); - return list; - } - - public List selectNumFromDateByWhere(String where, String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectNumFromDateByWhere", map); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/ProAlarmDao.java b/src/com/sipai/dao/scada/ProAlarmDao.java deleted file mode 100644 index 410bd8ee..00000000 --- a/src/com/sipai/dao/scada/ProAlarmDao.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.dao.scada; - - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.ProAlarm; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class ProAlarmDao extends CommDaoImpl { - public ProAlarmDao() { - super(); - this.setMappernamespace("scada.ProAlarmMapper"); - } - - public int recoverAlarmByWhere(String recover_time, String recover_value, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("where", wherestr); - paramMap.put("recover_time", recover_time); - paramMap.put("recover_value", recover_value); - return this.getSqlSession().update("scada.ProAlarmMapper.recoverAlarmByWhere", paramMap); - } - - public List selectCountByWhere(String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("where", wherestr); - return this.getSqlSession().selectList("scada.ProAlarmMapper.selectCountByWhere", paramMap); - } - - public List selectTop1ListByWhere(ProAlarm entity) { - List list = this.getSqlSession().selectList("scada.ProAlarmMapper.selectTop1ListByWhere", entity); - return list; - } - - public List selectTopNumListByWhere(String wherestr, String num) { - Map paramMap = new HashMap<>(); - paramMap.put("num", num); - paramMap.put("where", wherestr); - List list = this.getSqlSession().selectList("scada.ProAlarmMapper.selectTopNumListByWhere", paramMap); - return list; - } - - public List selectNumFromDateByWhere(String where, String str) { - Map map = new HashMap(); - map.put("where", where); - map.put("str", str); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectNumFromDateByWhere", map); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/ProAlarmDataStopHisPointDao.java b/src/com/sipai/dao/scada/ProAlarmDataStopHisPointDao.java deleted file mode 100644 index 04b94018..00000000 --- a/src/com/sipai/dao/scada/ProAlarmDataStopHisPointDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.scada; - - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.ProAlarmDataStopHisPoint; -import org.springframework.stereotype.Repository; - -@Repository -public class ProAlarmDataStopHisPointDao extends CommDaoImpl { - public ProAlarmDataStopHisPointDao() { - super(); - this.setMappernamespace("scada.ProAlarmDataStopHisPointMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/ScadaAlarmDao.java b/src/com/sipai/dao/scada/ScadaAlarmDao.java deleted file mode 100644 index 2d525497..00000000 --- a/src/com/sipai/dao/scada/ScadaAlarmDao.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.dao.scada; - - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.ScadaAlarm; - -@Repository -public class ScadaAlarmDao extends CommDaoImpl{ - public ScadaAlarmDao() { - super(); - this.setMappernamespace("scada.ScadaAlarmMapper"); - } - - public int updateStatusByWhere(String status,String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - paramMap.put("status",status); - return this.getSqlSession().update("scada.ScadaAlarmMapper.updateStatusByWhere", paramMap); - } - - public int recoverAlarmByWhere(String recover_time,String recover_value,String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - paramMap.put("recover_time",recover_time); - paramMap.put("recover_value",recover_value); - return this.getSqlSession().update("scada.ScadaAlarmMapper.recoverAlarmByWhere", paramMap); - } - - - public ScadaAlarm selectCountByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - ScadaAlarm scadaAlarm = this.getSqlSession().selectOne("scada.ScadaAlarmMapper.selectCountByWhere", paramMap); - return scadaAlarm; - } - - public ScadaAlarm selectOneByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - ScadaAlarm scadaAlarm = this.getSqlSession().selectOne("scada.ScadaAlarmMapper.selectOneByWhere", paramMap); - return scadaAlarm; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/scada/TempReportDao.java b/src/com/sipai/dao/scada/TempReportDao.java deleted file mode 100644 index 54de2602..00000000 --- a/src/com/sipai/dao/scada/TempReportDao.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.sipai.dao.scada; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.sipai.tools.CommUtil; -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.TempReport; - -@Repository -public class TempReportDao extends CommDaoImpl { - @Resource - private SqlSessionFactory sqlSessionFactoryScada; - @Resource - private SqlSession sqlSessionScada; - private String mappernamespacescada; // 需要操作的mappernamespace名(也是数据库表名) - private boolean isAuto = true;// 默认自动提交 - - public TempReportDao() { - super(); - this.setMappernamespace("scada.TempReportMapper"); - } - - public SqlSessionFactory getSqlSessionFactory() { - return sqlSessionFactoryScada; - } - - public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) { - this.sqlSessionFactoryScada = sqlSessionFactory; - } - - public boolean isAuto() { - return isAuto; - } - - public void setAuto(boolean isAuto) { - this.isAuto = isAuto; - } - - public String getMappernamespace() { - return mappernamespacescada; - } - - public void setMappernamespace(String mappernamespace) { - this.mappernamespacescada = mappernamespace; - } - - public void commit() { - if (sqlSessionScada != null) - sqlSessionScada.commit(); - } - - public SqlSession getSqlSession() { - sqlSessionScada = sqlSessionScada == null ? sqlSessionFactoryScada.openSession(isAuto) : sqlSessionScada; - return sqlSessionScada; - } - - public void close() { - if (sqlSessionScada != null) - sqlSessionScada.close(); - } - - /** - * 日报 - * - * @param spname - * @param stime - * @param etime - * @param starthour - * @param endhour - * @param intval - * @param mpstr - * @param rownum - * @return - */ - public int execSql_ReportDay(String spname, String stime, String etime, int starthour, int endhour, int intval, String mpstr, int rownum, String userid) { - Map paramMap = new HashMap<>(); - paramMap.put("spname", spname); - paramMap.put("stime", stime); - paramMap.put("etime", etime); - paramMap.put("starthour", String.valueOf(starthour)); - paramMap.put("endhour", String.valueOf(endhour)); - paramMap.put("intval", String.valueOf(intval)); - paramMap.put("mpstr", mpstr); - paramMap.put("rownum", String.valueOf(rownum)); - paramMap.put("userid", userid); - System.out.println("log日报:" + paramMap); -// System.out.println("s------------------------"+ CommUtil.nowDate()); -// System.out.println(this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap)); -// System.out.println("e------------------------"); - return this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - /** - * 月报 - * - * @param spname - * @param stime - * @param etime - * @param starthour - * @param - * @param intval - * @param mpstr - * @param rownum - * @return - */ - public int execSql_ReportMth(String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - Map paramMap = new HashMap<>(); - paramMap.put("spname", spname); - paramMap.put("stime", stime); - paramMap.put("etime", etime); - paramMap.put("starthour", String.valueOf(starthour)); - paramMap.put("intval", String.valueOf(intval)); - paramMap.put("mpstr", mpstr); - paramMap.put("rownum", String.valueOf(rownum)); - paramMap.put("userid", userid); - System.out.println("log月报:" + paramMap); - return this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - /** - * 季报 - * - * @param spname - * @param stime - * @param etime - * @param starthour - * @param - * @param intval - * @param mpstr - * @param rownum - * @return - */ - public int execSql_ReportQua(String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - Map paramMap = new HashMap<>(); - paramMap.put("spname", spname); - paramMap.put("stime", stime); - paramMap.put("etime", etime); - paramMap.put("starthour", String.valueOf(starthour)); - paramMap.put("intval", String.valueOf(intval)); - paramMap.put("mpstr", mpstr); - paramMap.put("rownum", String.valueOf(rownum)); - paramMap.put("userid", userid); - System.out.println("log月报:" + paramMap); - return this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - /** - * 半年报 - * - * @param spname - * @param stime - * @param etime - * @param starthour - * @param intval - * @param mpstr - * @param rownum - * @return - */ - public int execSql_ReportHalfYear(String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - Map paramMap = new HashMap<>(); - paramMap.put("spname", spname); - paramMap.put("stime", stime); - paramMap.put("etime", etime); - paramMap.put("starthour", String.valueOf(starthour)); - paramMap.put("intval", String.valueOf(intval)); - paramMap.put("mpstr", mpstr); - paramMap.put("rownum", String.valueOf(rownum)); - paramMap.put("userid", userid); - System.out.println("log半年报:" + paramMap); - return this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - /** - * 年报 - * - * @param spname - * @param stime - * @param etime - * @param starthour - * @param intval - * @param mpstr - * @param rownum - * @return - */ - public int execSql_ReportYear(String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - Map paramMap = new HashMap<>(); - paramMap.put("spname", spname); - paramMap.put("stime", stime); - paramMap.put("etime", etime); - paramMap.put("starthour", String.valueOf(starthour)); - paramMap.put("intval", String.valueOf(intval)); - paramMap.put("mpstr", mpstr); - paramMap.put("rownum", String.valueOf(rownum)); - paramMap.put("userid", userid); - System.out.println("log年报:" + paramMap); - return this.getSqlSession().update(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - } - - public List selectListByWhere(String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("where", wherestr); - List list = getSqlSession().selectList(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - - public int deleteListByWhere(String spname, String wherestr) { - Map paramMap = new HashMap<>(); - paramMap.put("where", wherestr); - int list = getSqlSession().delete(mappernamespacescada + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/schedule/ScheduleJobDao.java b/src/com/sipai/dao/schedule/ScheduleJobDao.java deleted file mode 100644 index 974cc8f8..00000000 --- a/src/com/sipai/dao/schedule/ScheduleJobDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.schedule; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.schedule.ScheduleJob; - -@Repository -public class ScheduleJobDao extends CommDaoImpl{ - public ScheduleJobDao(){ - super(); - this.setMappernamespace("schedule.ScheduleJobMapper"); - } - -} diff --git a/src/com/sipai/dao/schedule/ScheduleJobDetailDao.java b/src/com/sipai/dao/schedule/ScheduleJobDetailDao.java deleted file mode 100644 index 629b6067..00000000 --- a/src/com/sipai/dao/schedule/ScheduleJobDetailDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.schedule; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.schedule.ScheduleJobDetail; -@Repository -public class ScheduleJobDetailDao extends CommDaoImpl{ - - public ScheduleJobDetailDao(){ - super(); - this.setMappernamespace("schedule.ScheduleJobDetailMapper"); - } - -} diff --git a/src/com/sipai/dao/schedule/ScheduleJobTypeDao.java b/src/com/sipai/dao/schedule/ScheduleJobTypeDao.java deleted file mode 100644 index 0727d704..00000000 --- a/src/com/sipai/dao/schedule/ScheduleJobTypeDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.schedule; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.schedule.ScheduleJobType; -@Repository -public class ScheduleJobTypeDao extends CommDaoImpl{ - - public ScheduleJobTypeDao(){ - super(); - this.setMappernamespace("schedule.ScheduleJobTypeMapper"); - } - -} diff --git a/src/com/sipai/dao/score/LibraryMPointPropDao.java b/src/com/sipai/dao/score/LibraryMPointPropDao.java deleted file mode 100644 index a850e720..00000000 --- a/src/com/sipai/dao/score/LibraryMPointPropDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.score; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.score.LibraryMPointProp; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryMPointPropDao extends CommDaoImpl { - public LibraryMPointPropDao(){ - super(); - this.setMappernamespace("score.LibraryMPointPropMapper"); - } - -} diff --git a/src/com/sipai/dao/score/LibraryMPointPropSourceDao.java b/src/com/sipai/dao/score/LibraryMPointPropSourceDao.java deleted file mode 100644 index df9e0f6d..00000000 --- a/src/com/sipai/dao/score/LibraryMPointPropSourceDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.score; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.score.LibraryMPointPropSource; -import org.springframework.stereotype.Repository; - -@Repository -public class LibraryMPointPropSourceDao extends CommDaoImpl { - public LibraryMPointPropSourceDao(){ - super(); - this.setMappernamespace("score.LibraryMPointPropSourceMapper"); - } - -} diff --git a/src/com/sipai/dao/sparepart/ApplyPurchasePlanDao.java b/src/com/sipai/dao/sparepart/ApplyPurchasePlanDao.java deleted file mode 100644 index 6669f5b7..00000000 --- a/src/com/sipai/dao/sparepart/ApplyPurchasePlanDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.ApplyPurchasePlan; - -@Repository -public class ApplyPurchasePlanDao extends CommDaoImpl { - public ApplyPurchasePlanDao(){ - super(); - this.setMappernamespace("sparepart.ApplyPurchasePlanMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ChannelsDao.java b/src/com/sipai/dao/sparepart/ChannelsDao.java deleted file mode 100644 index 8ccbda6c..00000000 --- a/src/com/sipai/dao/sparepart/ChannelsDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Channels; - -@Repository -public class ChannelsDao extends CommDaoImpl { - public ChannelsDao(){ - super(); - this.setMappernamespace("sparepart.ChannelsMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ConsumeDetailDao.java b/src/com/sipai/dao/sparepart/ConsumeDetailDao.java deleted file mode 100644 index 68313197..00000000 --- a/src/com/sipai/dao/sparepart/ConsumeDetailDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.sparepart; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.ConsumeDetail; - - - -@Repository -public class ConsumeDetailDao extends CommDaoImpl { - public ConsumeDetailDao(){ - super(); - this.setMappernamespace("sparepart.ConsumeDetailMapper"); - } - public List ConsumeTotal(String where){ - List one= getSqlSession().selectList("sparepart.ConsumeDetailMapper.ConsumeTotal", where); - return one; - } -} diff --git a/src/com/sipai/dao/sparepart/ContractChangeFileDao.java b/src/com/sipai/dao/sparepart/ContractChangeFileDao.java deleted file mode 100644 index b1862199..00000000 --- a/src/com/sipai/dao/sparepart/ContractChangeFileDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractChangeFile; - -@Repository -public class ContractChangeFileDao extends CommDaoImpl { - public ContractChangeFileDao(){ - super(); - this.setMappernamespace("sparepart.ContractChangeFileMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractClassDao.java b/src/com/sipai/dao/sparepart/ContractClassDao.java deleted file mode 100644 index da66a404..00000000 --- a/src/com/sipai/dao/sparepart/ContractClassDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractClass; - -@Repository -public class ContractClassDao extends CommDaoImpl { - public ContractClassDao(){ - super(); - this.setMappernamespace("sparepart.ContractClassMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractDao.java b/src/com/sipai/dao/sparepart/ContractDao.java deleted file mode 100644 index 7462bafa..00000000 --- a/src/com/sipai/dao/sparepart/ContractDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.dao.sparepart; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.sparepart.Contract; - -@Repository -public class ContractDao extends CommDaoImpl { - public ContractDao(){ - super(); - this.setMappernamespace("sparepart.ContractMapper"); - } - public List selectStatusByWhere(Contract contract){ - List list= getSqlSession().selectList("sparepart.ContractMapper.selectStatusByWhere", contract); - return list; - } - - public List selectPriceByWhere(Contract contract){ - List list= getSqlSession().selectList("sparepart.ContractMapper.selectPriceByWhere", contract); - return list; - } -} diff --git a/src/com/sipai/dao/sparepart/ContractDetailDao.java b/src/com/sipai/dao/sparepart/ContractDetailDao.java deleted file mode 100644 index 725ad9da..00000000 --- a/src/com/sipai/dao/sparepart/ContractDetailDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractDetail; - -@Repository -public class ContractDetailDao extends CommDaoImpl { - public ContractDetailDao(){ - super(); - this.setMappernamespace("sparepart.ContractDetailMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractDetailInvoiceDao.java b/src/com/sipai/dao/sparepart/ContractDetailInvoiceDao.java deleted file mode 100644 index 84f48602..00000000 --- a/src/com/sipai/dao/sparepart/ContractDetailInvoiceDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractDetailInvoice; - -@Repository -public class ContractDetailInvoiceDao extends CommDaoImpl { - public ContractDetailInvoiceDao(){ - super(); - this.setMappernamespace("sparepart.ContractDetailInvoiceMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractDetailInvoiceFileDao.java b/src/com/sipai/dao/sparepart/ContractDetailInvoiceFileDao.java deleted file mode 100644 index 662ea3c3..00000000 --- a/src/com/sipai/dao/sparepart/ContractDetailInvoiceFileDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractDetailInvoiceFile; - -@Repository -public class ContractDetailInvoiceFileDao extends CommDaoImpl { - public ContractDetailInvoiceFileDao(){ - super(); - this.setMappernamespace("sparepart.ContractDetailInvoiceFileMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractDetailPaymentDao.java b/src/com/sipai/dao/sparepart/ContractDetailPaymentDao.java deleted file mode 100644 index 0e61d9d9..00000000 --- a/src/com/sipai/dao/sparepart/ContractDetailPaymentDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractDetailPayment; - -@Repository -public class ContractDetailPaymentDao extends CommDaoImpl { - public ContractDetailPaymentDao(){ - super(); - this.setMappernamespace("sparepart.ContractDetailPaymentMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractFileDao.java b/src/com/sipai/dao/sparepart/ContractFileDao.java deleted file mode 100644 index 4070bc2f..00000000 --- a/src/com/sipai/dao/sparepart/ContractFileDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractFile; - -@Repository -public class ContractFileDao extends CommDaoImpl { - public ContractFileDao(){ - super(); - this.setMappernamespace("sparepart.ContractFileMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ContractTaxRateDao.java b/src/com/sipai/dao/sparepart/ContractTaxRateDao.java deleted file mode 100644 index 93805529..00000000 --- a/src/com/sipai/dao/sparepart/ContractTaxRateDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.ContractTaxRate; - -@Repository -public class ContractTaxRateDao extends CommDaoImpl { - public ContractTaxRateDao(){ - super(); - this.setMappernamespace("sparepart.ContractTaxRateMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/GoodsAcceptanceApplyDetailDao.java b/src/com/sipai/dao/sparepart/GoodsAcceptanceApplyDetailDao.java deleted file mode 100644 index 49ac0dad..00000000 --- a/src/com/sipai/dao/sparepart/GoodsAcceptanceApplyDetailDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.GoodsAcceptanceApplyDetail; - - -@Repository -public class GoodsAcceptanceApplyDetailDao extends CommDaoImpl{ - public GoodsAcceptanceApplyDetailDao(){ - super(); - this.setMappernamespace("sparepart.goodsAcceptanceApplyDetailMapper"); - } -} - - - diff --git a/src/com/sipai/dao/sparepart/GoodsApplyDao.java b/src/com/sipai/dao/sparepart/GoodsApplyDao.java deleted file mode 100644 index 09b4bd7f..00000000 --- a/src/com/sipai/dao/sparepart/GoodsApplyDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.sparepart; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.sparepart.GoodsApply; - - -@Repository -public class GoodsApplyDao extends CommDaoImpl { - - public GoodsApplyDao(){ - super(); - this.setMappernamespace("sparepart.GoodsApplyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/GoodsClassDao.java b/src/com/sipai/dao/sparepart/GoodsClassDao.java deleted file mode 100644 index e340bceb..00000000 --- a/src/com/sipai/dao/sparepart/GoodsClassDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.GoodsClass; - -@Repository -public class GoodsClassDao extends CommDaoImpl { - public GoodsClassDao(){ - super(); - this.setMappernamespace("sparepart.GoodsClassMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/GoodsDao.java b/src/com/sipai/dao/sparepart/GoodsDao.java deleted file mode 100644 index 1c8697b9..00000000 --- a/src/com/sipai/dao/sparepart/GoodsDao.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.dao.sparepart; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.sparepart.Goods; - - -@Repository -public class GoodsDao extends CommDaoImpl { - - public GoodsDao(){ - super(); - this.setMappernamespace("sparepart.GoodsMapper"); - } - public List selectGoodsSela(String year, String month, String wherestr, String biz) { - Map paramMap=new HashMap<>(); - paramMap.put("year",year); - paramMap.put("month",month); - paramMap.put("where",wherestr); - paramMap.put("biz",biz); - List list = getSqlSession().selectList("sparepart.GoodsMapper"+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - public List selectGoodsSelaNotCheck(String year, String month, String wherestr, String biz) { - Map paramMap=new HashMap<>(); - paramMap.put("year",year); - paramMap.put("month",month); - paramMap.put("where",wherestr); - paramMap.put("biz",biz); - List list = getSqlSession().selectList("sparepart.GoodsMapper"+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), paramMap); - return list; - } - public List selectListByWhere4DistinctName(Goods goods) { - List list = getSqlSession().selectList("sparepart.GoodsMapper"+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), goods); - return list; - } - -} diff --git a/src/com/sipai/dao/sparepart/GoodsReserveDao.java b/src/com/sipai/dao/sparepart/GoodsReserveDao.java deleted file mode 100644 index bffa7fc3..00000000 --- a/src/com/sipai/dao/sparepart/GoodsReserveDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.GoodsReserve; -import org.springframework.stereotype.Repository; - - -@Repository -public class GoodsReserveDao extends CommDaoImpl { - - public GoodsReserveDao(){ - super(); - this.setMappernamespace("sparepart.GoodsReserveMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/HazardousChemicalsDao.java b/src/com/sipai/dao/sparepart/HazardousChemicalsDao.java deleted file mode 100644 index 71438a41..00000000 --- a/src/com/sipai/dao/sparepart/HazardousChemicalsDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.HazardousChemicals; -import org.springframework.stereotype.Repository; - -@Repository -public class HazardousChemicalsDao extends CommDaoImpl { - public HazardousChemicalsDao(){ - super(); - this.setMappernamespace("sparepart.HazardousChemicalsMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/InOutDeatilDao.java b/src/com/sipai/dao/sparepart/InOutDeatilDao.java deleted file mode 100644 index 4254725a..00000000 --- a/src/com/sipai/dao/sparepart/InOutDeatilDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.InOutDeatil; -import org.springframework.stereotype.Repository; - -@Repository -public class InOutDeatilDao extends CommDaoImpl { - public InOutDeatilDao(){ - super(); - this.setMappernamespace("sparepart.InOutDeatilMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/InStockRecordDao.java b/src/com/sipai/dao/sparepart/InStockRecordDao.java deleted file mode 100644 index 2727c7b7..00000000 --- a/src/com/sipai/dao/sparepart/InStockRecordDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Stock; - -@Repository -public class InStockRecordDao extends CommDaoImpl { - public InStockRecordDao(){ - super(); - this.setMappernamespace("sparepart.InStockRecordMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/InStockRecordDetailDao.java b/src/com/sipai/dao/sparepart/InStockRecordDetailDao.java deleted file mode 100644 index a37f6335..00000000 --- a/src/com/sipai/dao/sparepart/InStockRecordDetailDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.entity.sparepart.*; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -import java.util.List; - -@Repository -public class InStockRecordDetailDao extends CommDaoImpl { - public InStockRecordDetailDao(){ - super(); - this.setMappernamespace("sparepart.InStockRecordDetailMapper"); - } - - - public List selectListByWhereWithRecord(InStockRecordDetail inStockRecordDetail){ - List inStockRecordDetails = getSqlSession().selectList("sparepart.InStockRecordDetailMapper.selectListByWhereWithRecord", inStockRecordDetail); - return inStockRecordDetails; - } - - public InStockRecordDetail selectTopByWhereWithRecord(InStockRecordDetail inStockRecordDetail){ - InStockRecordDetail inDetail = getSqlSession().selectOne("sparepart.InStockRecordDetailMapper.selectTopByWhereWithRecord", inStockRecordDetail); - return inDetail; - } -} diff --git a/src/com/sipai/dao/sparepart/InStockRecordUpdateMoneyDao.java b/src/com/sipai/dao/sparepart/InStockRecordUpdateMoneyDao.java deleted file mode 100644 index fbf3e816..00000000 --- a/src/com/sipai/dao/sparepart/InStockRecordUpdateMoneyDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.InStockRecordUpdateMoney; -import org.springframework.stereotype.Repository; - -@Repository -public class InStockRecordUpdateMoneyDao extends CommDaoImpl { - public InStockRecordUpdateMoneyDao(){ - super(); - this.setMappernamespace("sparepart.InStockRecordUpdateMoneyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/OutStockRecordDao.java b/src/com/sipai/dao/sparepart/OutStockRecordDao.java deleted file mode 100644 index c17065c2..00000000 --- a/src/com/sipai/dao/sparepart/OutStockRecordDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Stock; - -@Repository -public class OutStockRecordDao extends CommDaoImpl { - public OutStockRecordDao(){ - super(); - this.setMappernamespace("sparepart.OutStockRecordMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/OutStockRecordDetailDao.java b/src/com/sipai/dao/sparepart/OutStockRecordDetailDao.java deleted file mode 100644 index a8bb1d2c..00000000 --- a/src/com/sipai/dao/sparepart/OutStockRecordDetailDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.OutStockRecordDetail; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Stock; - -import java.util.List; - -@Repository -public class OutStockRecordDetailDao extends CommDaoImpl { - public OutStockRecordDetailDao(){ - super(); - this.setMappernamespace("sparepart.OutStockRecordDetailMapper"); - } - - public List selectListByWhereWithRecord(OutStockRecordDetail outStockRecordDetail) { - List outStockRecordDetails = getSqlSession().selectList("sparepart.OutStockRecordDetailMapper.selectListByWhereWithRecord", outStockRecordDetail); - return outStockRecordDetails; - } -} diff --git a/src/com/sipai/dao/sparepart/PerformanceDao.java b/src/com/sipai/dao/sparepart/PerformanceDao.java deleted file mode 100644 index ee8a6f93..00000000 --- a/src/com/sipai/dao/sparepart/PerformanceDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Performance; - -@Repository -public class PerformanceDao extends CommDaoImpl { - public PerformanceDao(){ - super(); - this.setMappernamespace("sparepart.PerformanceMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/PurchaseDetailDao.java b/src/com/sipai/dao/sparepart/PurchaseDetailDao.java deleted file mode 100644 index 111db3d5..00000000 --- a/src/com/sipai/dao/sparepart/PurchaseDetailDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchasePlan; - -@Repository -public class PurchaseDetailDao extends CommDaoImpl { - public PurchaseDetailDao(){ - super(); - this.setMappernamespace("sparepart.PurchaseDetailMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/PurchaseMethodsDao.java b/src/com/sipai/dao/sparepart/PurchaseMethodsDao.java deleted file mode 100644 index 4aa89acf..00000000 --- a/src/com/sipai/dao/sparepart/PurchaseMethodsDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.PurchaseMethods; - -@Repository -public class PurchaseMethodsDao extends CommDaoImpl { - public PurchaseMethodsDao(){ - super(); - this.setMappernamespace("sparepart.PurchaseMethodsMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/PurchasePlanDao.java b/src/com/sipai/dao/sparepart/PurchasePlanDao.java deleted file mode 100644 index e02a2aaa..00000000 --- a/src/com/sipai/dao/sparepart/PurchasePlanDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; - -@Repository -public class PurchasePlanDao extends CommDaoImpl { - public PurchasePlanDao(){ - super(); - this.setMappernamespace("sparepart.PurchasePlanMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/PurchaseRecordDao.java b/src/com/sipai/dao/sparepart/PurchaseRecordDao.java deleted file mode 100644 index 5a3a3c30..00000000 --- a/src/com/sipai/dao/sparepart/PurchaseRecordDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.PurchaseRecord; - - -@Repository -public class PurchaseRecordDao extends CommDaoImpl { - public PurchaseRecordDao(){ - super(); - this.setMappernamespace("sparepart.PurchaseRecordMapper"); - } - public PurchaseRecord PurchaseRecordMoneyTotal(String where){ - PurchaseRecord one= getSqlSession().selectOne("sparepart.PurchaseRecordMapper.PurchaseRecordMoneyTotal", where); - return one; - } -} diff --git a/src/com/sipai/dao/sparepart/PurchaseRecordDetailDao.java b/src/com/sipai/dao/sparepart/PurchaseRecordDetailDao.java deleted file mode 100644 index 42f9d52e..00000000 --- a/src/com/sipai/dao/sparepart/PurchaseRecordDetailDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.entity.sparepart.PurchaseRecord; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.PurchaseRecordDetail; - -import java.util.List; - -@Repository -public class PurchaseRecordDetailDao extends CommDaoImpl { - public PurchaseRecordDetailDao(){ - super(); - this.setMappernamespace("sparepart.PurchaseRecordDetailMapper"); - } - - - public List selectDetailListByWhere(PurchaseRecordDetail where){ - List list= getSqlSession().selectList("sparepart.PurchaseRecordDetailMapper.selectDetailListByWhere", where); - return list; - } - -} diff --git a/src/com/sipai/dao/sparepart/PurposeDao.java b/src/com/sipai/dao/sparepart/PurposeDao.java deleted file mode 100644 index 7c9160a4..00000000 --- a/src/com/sipai/dao/sparepart/PurposeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Purpose; - -@Repository -public class PurposeDao extends CommDaoImpl { - public PurposeDao(){ - super(); - this.setMappernamespace("sparepart.PurposeMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/QualificationTypeDao.java b/src/com/sipai/dao/sparepart/QualificationTypeDao.java deleted file mode 100644 index 2d067d17..00000000 --- a/src/com/sipai/dao/sparepart/QualificationTypeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.QualificationType; - -@Repository -public class QualificationTypeDao extends CommDaoImpl { - public QualificationTypeDao(){ - super(); - this.setMappernamespace("sparepart.QualificationTypeMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/QualificationType_copyDao.java b/src/com/sipai/dao/sparepart/QualificationType_copyDao.java deleted file mode 100644 index 8367e221..00000000 --- a/src/com/sipai/dao/sparepart/QualificationType_copyDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.QualificationType_copy; - -@Repository -public class QualificationType_copyDao extends CommDaoImpl { - public QualificationType_copyDao(){ - super(); - this.setMappernamespace("sparepart.QualificationType_copyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/RawMaterialDao.java b/src/com/sipai/dao/sparepart/RawMaterialDao.java deleted file mode 100644 index e2799056..00000000 --- a/src/com/sipai/dao/sparepart/RawMaterialDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.RawMaterial; - -@Repository -public class RawMaterialDao extends CommDaoImpl { - public RawMaterialDao(){ - super(); - this.setMappernamespace("sparepart.RawMaterialMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/RawMaterialDetailDao.java b/src/com/sipai/dao/sparepart/RawMaterialDetailDao.java deleted file mode 100644 index f6428756..00000000 --- a/src/com/sipai/dao/sparepart/RawMaterialDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.RawMaterialDetail; - -@Repository -public class RawMaterialDetailDao extends CommDaoImpl { - public RawMaterialDetailDao(){ - super(); - this.setMappernamespace("sparepart.RawMaterialDetailMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ReturnStockRecordDao.java b/src/com/sipai/dao/sparepart/ReturnStockRecordDao.java deleted file mode 100644 index 26dd9575..00000000 --- a/src/com/sipai/dao/sparepart/ReturnStockRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.ReturnStockRecord; - -@Repository -public class ReturnStockRecordDao extends CommDaoImpl { - public ReturnStockRecordDao(){ - super(); - this.setMappernamespace("sparepart.ReturnStockRecordMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ReturnStockRecordDetailDao.java b/src/com/sipai/dao/sparepart/ReturnStockRecordDetailDao.java deleted file mode 100644 index 2fe48cd5..00000000 --- a/src/com/sipai/dao/sparepart/ReturnStockRecordDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.ReturnStockRecordDetail; - -@Repository -public class ReturnStockRecordDetailDao extends CommDaoImpl { - public ReturnStockRecordDetailDao(){ - super(); - this.setMappernamespace("sparepart.ReturnStockRecordDetailMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/ScoreDao.java b/src/com/sipai/dao/sparepart/ScoreDao.java deleted file mode 100644 index 7f728bb2..00000000 --- a/src/com/sipai/dao/sparepart/ScoreDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Score; - -@Repository -public class ScoreDao extends CommDaoImpl { - public ScoreDao(){ - super(); - this.setMappernamespace("sparepart.ScoreMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/Score_copyDao.java b/src/com/sipai/dao/sparepart/Score_copyDao.java deleted file mode 100644 index 33b86a7c..00000000 --- a/src/com/sipai/dao/sparepart/Score_copyDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Score_copy; - -@Repository -public class Score_copyDao extends CommDaoImpl { - public Score_copyDao(){ - super(); - this.setMappernamespace("sparepart.Score_copyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SewageDao.java b/src/com/sipai/dao/sparepart/SewageDao.java deleted file mode 100644 index 5129dfae..00000000 --- a/src/com/sipai/dao/sparepart/SewageDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.sparepart; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Sewage; - -@Repository -public class SewageDao extends CommDaoImpl { - public SewageDao(){ - super(); - this.setMappernamespace("sparepart.SewageMapper"); - } - public List selectDistinctCityByWhere( Sewage sewage) { - List list = getSqlSession().selectList(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), sewage); - return list; - } - -} diff --git a/src/com/sipai/dao/sparepart/SewageInputDao.java b/src/com/sipai/dao/sparepart/SewageInputDao.java deleted file mode 100644 index 5398f626..00000000 --- a/src/com/sipai/dao/sparepart/SewageInputDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.SewageInput; - -@Repository -public class SewageInputDao extends CommDaoImpl { - public SewageInputDao(){ - super(); - this.setMappernamespace("sparepart.SewageInputMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/StockCheckDao.java b/src/com/sipai/dao/sparepart/StockCheckDao.java deleted file mode 100644 index 29229edf..00000000 --- a/src/com/sipai/dao/sparepart/StockCheckDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.StockCheck; - -@Repository -public class StockCheckDao extends CommDaoImpl { - public StockCheckDao(){ - super(); - this.setMappernamespace("sparepart.StockCheckMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/StockCheckDetailDao.java b/src/com/sipai/dao/sparepart/StockCheckDetailDao.java deleted file mode 100644 index 0b1abc85..00000000 --- a/src/com/sipai/dao/sparepart/StockCheckDetailDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.StockCheckDetail; - -@Repository -public class StockCheckDetailDao extends CommDaoImpl { - public StockCheckDetailDao(){ - super(); - this.setMappernamespace("sparepart.StockCheckDetailMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/StockDao.java b/src/com/sipai/dao/sparepart/StockDao.java deleted file mode 100644 index 4caa44ff..00000000 --- a/src/com/sipai/dao/sparepart/StockDao.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.dao.sparepart; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Stock; - -@Repository -public class StockDao extends CommDaoImpl { - public StockDao(){ - super(); - this.setMappernamespace("sparepart.StockMapper"); - } - public Stock numberTotal(String where){ - Stock one= getSqlSession().selectOne("sparepart.StockMapper.numberTotal", where); - return one; - } - public Stock maxTotal(String where){ - Stock one= getSqlSession().selectOne("sparepart.StockMapper.maxTotal", where); - return one; - } - public Stock RecordTotal(String where){ - Stock one= getSqlSession().selectOne("sparepart.StockMapper.RecordTotal", where); - return one; - } - public Stock ContractTotal(String where){ - Stock one= getSqlSession().selectOne("sparepart.StockMapper.ContractTotal", where); - return one; - } - public List StocktypeTotal(String where){ - List one= getSqlSession().selectList("sparepart.StockMapper.StocktypeTotal", where); - return one; - } - public Stock MaintenanceWorkinghoursTotal(String where){ - Stock one= getSqlSession().selectOne("sparepart.StockMapper.MaintenanceWorkinghoursTotal", where); - return one; - } - public Stock RecordDurationTotal(String where){ - Stock one= getSqlSession().selectOne("sparepart.StockMapper.RecordDurationTotal", where); - return one; - } -} diff --git a/src/com/sipai/dao/sparepart/StockTransfersApplyDetailDao.java b/src/com/sipai/dao/sparepart/StockTransfersApplyDetailDao.java deleted file mode 100644 index 1f0afb42..00000000 --- a/src/com/sipai/dao/sparepart/StockTransfersApplyDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.StockTransfersApplyDetail; - -@Repository -public class StockTransfersApplyDetailDao extends CommDaoImpl { - public StockTransfersApplyDetailDao(){ - super(); - this.setMappernamespace("sparepart.StockTransfersApplyDetailMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SubscribeDao.java b/src/com/sipai/dao/sparepart/SubscribeDao.java deleted file mode 100644 index 5584f37c..00000000 --- a/src/com/sipai/dao/sparepart/SubscribeDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.Subscribe; - -@Repository -public class SubscribeDao extends CommDaoImpl { - public SubscribeDao(){ - super(); - this.setMappernamespace("sparepart.SubscribeMapper"); - } - public Subscribe SubscribeMoneyTotal(String where){ - Subscribe one= getSqlSession().selectOne("sparepart.SubscribeMapper.SubscribeMoneyTotal", where); - return one; - } -} diff --git a/src/com/sipai/dao/sparepart/SubscribeDetailDao.java b/src/com/sipai/dao/sparepart/SubscribeDetailDao.java deleted file mode 100644 index 32004302..00000000 --- a/src/com/sipai/dao/sparepart/SubscribeDetailDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.sparepart; - -import com.sipai.entity.sparepart.*; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -import java.util.List; - -@Repository -public class SubscribeDetailDao extends CommDaoImpl { - public SubscribeDetailDao(){ - super(); - this.setMappernamespace("sparepart.SubscribeDetailMapper"); - } - - public List selectDetailByBizId(SubscribeDetail wherestr) { - List subscribeDetails = getSqlSession().selectList("sparepart.SubscribeDetailMapper.selectDetailByBizId", wherestr); - return subscribeDetails; - } - public int updateGoodsIdByWhere(SubscribeDetail wherestr) { - int update = getSqlSession().update("sparepart.SubscribeDetailMapper.updateGoodsIdByWhere", wherestr); - return update; - } -} diff --git a/src/com/sipai/dao/sparepart/SupplierClassDao.java b/src/com/sipai/dao/sparepart/SupplierClassDao.java deleted file mode 100644 index dfea4748..00000000 --- a/src/com/sipai/dao/sparepart/SupplierClassDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.SupplierClass; - -@Repository -public class SupplierClassDao extends CommDaoImpl { - public SupplierClassDao(){ - super(); - this.setMappernamespace("sparepart.SupplierClassMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SupplierClass_copyDao.java b/src/com/sipai/dao/sparepart/SupplierClass_copyDao.java deleted file mode 100644 index a44321d5..00000000 --- a/src/com/sipai/dao/sparepart/SupplierClass_copyDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -import com.sipai.entity.sparepart.SupplierClass_copy; - -@Repository -public class SupplierClass_copyDao extends CommDaoImpl { - public SupplierClass_copyDao(){ - super(); - this.setMappernamespace("sparepart.SupplierClass_copyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SupplierDao.java b/src/com/sipai/dao/sparepart/SupplierDao.java deleted file mode 100644 index e065ded1..00000000 --- a/src/com/sipai/dao/sparepart/SupplierDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.Supplier; - -@Repository -public class SupplierDao extends CommDaoImpl { - public SupplierDao(){ - super(); - this.setMappernamespace("sparepart.SupplierMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SupplierQualificationDao.java b/src/com/sipai/dao/sparepart/SupplierQualificationDao.java deleted file mode 100644 index 326486f9..00000000 --- a/src/com/sipai/dao/sparepart/SupplierQualificationDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.SupplierQualification; - -@Repository -public class SupplierQualificationDao extends CommDaoImpl { - public SupplierQualificationDao(){ - super(); - this.setMappernamespace("sparepart.SupplierQualificationMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SupplierQualification_copyDao.java b/src/com/sipai/dao/sparepart/SupplierQualification_copyDao.java deleted file mode 100644 index 827968f6..00000000 --- a/src/com/sipai/dao/sparepart/SupplierQualification_copyDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.SupplierQualification_copy; - -@Repository -public class SupplierQualification_copyDao extends CommDaoImpl { - public SupplierQualification_copyDao(){ - super(); - this.setMappernamespace("sparepart.SupplierQualification_copyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/SupplierQualification_fileDao.java b/src/com/sipai/dao/sparepart/SupplierQualification_fileDao.java deleted file mode 100644 index 0afccc97..00000000 --- a/src/com/sipai/dao/sparepart/SupplierQualification_fileDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.SupplierQualification_file; - -@Repository -public class SupplierQualification_fileDao extends CommDaoImpl { - public SupplierQualification_fileDao(){ - super(); - this.setMappernamespace("sparepart.SupplierQualification_fileMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/Supplier_copyDao.java b/src/com/sipai/dao/sparepart/Supplier_copyDao.java deleted file mode 100644 index 5eff22e9..00000000 --- a/src/com/sipai/dao/sparepart/Supplier_copyDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -import com.sipai.entity.sparepart.Supplier_copy; - -@Repository -public class Supplier_copyDao extends CommDaoImpl { - public Supplier_copyDao(){ - super(); - this.setMappernamespace("sparepart.Supplier_copyMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/WarehouseDao.java b/src/com/sipai/dao/sparepart/WarehouseDao.java deleted file mode 100644 index e00a3ee2..00000000 --- a/src/com/sipai/dao/sparepart/WarehouseDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Warehouse; - -@Repository -public class WarehouseDao extends CommDaoImpl { - public WarehouseDao(){ - super(); - this.setMappernamespace("sparepart.WarehouseMapper"); - } -} diff --git a/src/com/sipai/dao/sparepart/WarrantyPeriodDao.java b/src/com/sipai/dao/sparepart/WarrantyPeriodDao.java deleted file mode 100644 index c048fb89..00000000 --- a/src/com/sipai/dao/sparepart/WarrantyPeriodDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.sparepart; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.WarrantyPeriod; - -@Repository -public class WarrantyPeriodDao extends CommDaoImpl { - public WarrantyPeriodDao(){ - super(); - this.setMappernamespace("sparepart.WarrantyPeriodMapper"); - } -} diff --git a/src/com/sipai/dao/structure/StructureCardDao.java b/src/com/sipai/dao/structure/StructureCardDao.java deleted file mode 100644 index 631f296f..00000000 --- a/src/com/sipai/dao/structure/StructureCardDao.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.dao.structure; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.structure.Structure; -import com.sipai.entity.structure.StructureCard; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -@Repository -public class StructureCardDao extends CommDaoImpl{ - public StructureCardDao() { - super(); - this.setMappernamespace("structure.StructureCardMapper"); - } - public List getStructureCard(StructureCard structurecard){ - List list= getSqlSession().selectList("structure.StructureCardMapper.getStructureCard", structurecard); - return list; - } - - public List getListByName(String structurecardid){ - List list = this.getSqlSession().selectList("structure.StructureCardMapper.getStructureCardByCardId", structurecardid); - return list; - } - - public List selectStructureListByLine(StructureCard structureCard) { - List list = this.getSqlSession().selectList("structure.StructureCardMapper.selectStructureListByLine", structureCard); - return list; - } - - public List selectListByWhere4UV(Structure structure) { - List list = this.getSqlSession().selectList("structure.StructureCardMapper.selectListByWhere4UV", structure); - return list; - } -} diff --git a/src/com/sipai/dao/structure/StructureCardPictureDao.java b/src/com/sipai/dao/structure/StructureCardPictureDao.java deleted file mode 100644 index 40585c47..00000000 --- a/src/com/sipai/dao/structure/StructureCardPictureDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.dao.structure; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.structure.StructureCardPicture; - -@Repository -public class StructureCardPictureDao extends CommDaoImpl{ - public StructureCardPictureDao() { - super(); - this.setMappernamespace("structure.StructureCardPictureMapper"); - } - - - public List selectListGroupByFloor(StructureCardPicture t) { - List list = getSqlSession().selectList("structure.StructureCardPictureMapper"+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - - public List selectListGroupByStructureId(StructureCardPicture t) { - List list = getSqlSession().selectList("structure.StructureCardPictureMapper"+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t); - return list; - } - -} diff --git a/src/com/sipai/dao/structure/StructureCardPictureRouteDao.java b/src/com/sipai/dao/structure/StructureCardPictureRouteDao.java deleted file mode 100644 index 775f2936..00000000 --- a/src/com/sipai/dao/structure/StructureCardPictureRouteDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.structure; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.structure.StructureCardPictureRoute; - -@Repository -public class StructureCardPictureRouteDao extends CommDaoImpl{ - public StructureCardPictureRouteDao() { - super(); - this.setMappernamespace("structure.StructureCardPictureRouteMapper"); - } -} diff --git a/src/com/sipai/dao/structure/StructureCardPictureRoutePointdetailDao.java b/src/com/sipai/dao/structure/StructureCardPictureRoutePointdetailDao.java deleted file mode 100644 index f61a5e34..00000000 --- a/src/com/sipai/dao/structure/StructureCardPictureRoutePointdetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.structure; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.structure.StructureCardPictureRoutePointdetail; - -@Repository -public class StructureCardPictureRoutePointdetailDao extends CommDaoImpl { - public StructureCardPictureRoutePointdetailDao() { - super(); - this.setMappernamespace("structure.StructureCardPictureRoutePointdetailMapper"); - } -} diff --git a/src/com/sipai/dao/structure/StructureClassDao.java b/src/com/sipai/dao/structure/StructureClassDao.java deleted file mode 100644 index 3d793ee8..00000000 --- a/src/com/sipai/dao/structure/StructureClassDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.structure; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.structure.StructureClass; -@Repository -public class StructureClassDao extends CommDaoImpl{ - public StructureClassDao() { - super(); - this.setMappernamespace("structure.StructureClassMapper"); - } -} diff --git a/src/com/sipai/dao/teacher/TeacherFileDao.java b/src/com/sipai/dao/teacher/TeacherFileDao.java deleted file mode 100644 index 5b67cf7c..00000000 --- a/src/com/sipai/dao/teacher/TeacherFileDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.teacher; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.teacher.TeacherFile; -@Repository -public class TeacherFileDao extends CommDaoImpl{ - public TeacherFileDao() { - super(); - this.setMappernamespace("teacher.TeacherFileMapper"); - } - -} diff --git a/src/com/sipai/dao/teacher/TeachertypeDao.java b/src/com/sipai/dao/teacher/TeachertypeDao.java deleted file mode 100644 index 20f0c871..00000000 --- a/src/com/sipai/dao/teacher/TeachertypeDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.teacher; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.teacher.Teachertype; - -@Repository -public class TeachertypeDao extends CommDaoImpl{ - public TeachertypeDao() { - super(); - this.setMappernamespace("teacher.TeachertypeMapper"); - } - - public Teachertype getUnitById(String id){ - return this.getSqlSession().selectOne("teacher.TeachertypeMapper.getUnitById",id); - } - -} diff --git a/src/com/sipai/dao/timeefficiency/ClockinRecordDao.java b/src/com/sipai/dao/timeefficiency/ClockinRecordDao.java deleted file mode 100644 index c39601df..00000000 --- a/src/com/sipai/dao/timeefficiency/ClockinRecordDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.ClockinRecord; -import com.sipai.entity.timeefficiency.PatrolArea; - -@Repository -public class ClockinRecordDao extends CommDaoImpl{ - public ClockinRecordDao() { - super(); - this.setMappernamespace("timeefficiency.ClockinRecordMapper"); - } - public List selectClockinUserByWhere(ClockinRecord clockinRecord) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectClockinUserByWhere", clockinRecord); - return list; - } -} diff --git a/src/com/sipai/dao/timeefficiency/EfficiencyProcessDao.java b/src/com/sipai/dao/timeefficiency/EfficiencyProcessDao.java deleted file mode 100644 index 521b1d53..00000000 --- a/src/com/sipai/dao/timeefficiency/EfficiencyProcessDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.EfficiencyProcess; - -@Repository -public class EfficiencyProcessDao extends CommDaoImpl{ - public EfficiencyProcessDao() { - super(); - this.setMappernamespace("timeefficiency.EfficiencyProcessMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/ElectricityPriceDao.java b/src/com/sipai/dao/timeefficiency/ElectricityPriceDao.java deleted file mode 100644 index 95c0b8d9..00000000 --- a/src/com/sipai/dao/timeefficiency/ElectricityPriceDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.ElectricityPrice; - -@Repository -public class ElectricityPriceDao extends CommDaoImpl{ - public ElectricityPriceDao() { - super(); - this.setMappernamespace("timeefficiency.ElectricityPriceMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/ElectricityPriceDetailDao.java b/src/com/sipai/dao/timeefficiency/ElectricityPriceDetailDao.java deleted file mode 100644 index 06cc74a2..00000000 --- a/src/com/sipai/dao/timeefficiency/ElectricityPriceDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.ElectricityPriceDetail; - -@Repository -public class ElectricityPriceDetailDao extends CommDaoImpl{ - public ElectricityPriceDetailDao() { - super(); - this.setMappernamespace("timeefficiency.ElectricityPriceDetailMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolAreaDao.java b/src/com/sipai/dao/timeefficiency/PatrolAreaDao.java deleted file mode 100644 index c6f99304..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolAreaDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolArea; - -@Repository -public class PatrolAreaDao extends CommDaoImpl{ - public PatrolAreaDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolAreaMapper"); - } - public List selectListWithEquByWhere(PatrolArea patrolarea) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithEquByWhere", patrolarea); - return list; - } - public List getPatrolAreas(PatrolArea patrolarea){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getPatrolArea", patrolarea); - return list; - } - public List selectAreaListByDept(PatrolArea patrolArea) { - List list = this.getSqlSession().selectList("timeefficiency.PatrolAreaMapper.selectAreaListByDept", patrolArea); - return list; - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolAreaFloorDao.java b/src/com/sipai/dao/timeefficiency/PatrolAreaFloorDao.java deleted file mode 100644 index 95169b68..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolAreaFloorDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolAreaFloor; - -@Repository -public class PatrolAreaFloorDao extends CommDaoImpl{ - public PatrolAreaFloorDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolAreaFloorMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolAreaProcessSectionDao.java b/src/com/sipai/dao/timeefficiency/PatrolAreaProcessSectionDao.java deleted file mode 100644 index 7d941365..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolAreaProcessSectionDao.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolAreaProcessSection; - -@Repository -public class PatrolAreaProcessSectionDao extends CommDaoImpl{ - public PatrolAreaProcessSectionDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolAreaProcessSectionMapper"); - } - public List selectNewProcessSectionByWhere(PatrolAreaProcessSection patrolAreaProcessSection) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectNewProcessSectionByWhere", patrolAreaProcessSection); - return list; - } - -// public List selectListWithEquByWhere(PatrolAreaProcessSection patrolareaprocesssection) { -// List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithEquByWhere", patrolareaprocesssection); -// return list; -// } -// public List getPatrolAreaProcessSections(PatrolAreaProcessSection patrolareaprocesssection){ -// List list = this.getSqlSession().selectList(this.getMappernamespace()+".getPatrolAreaProcessSection", patrolareaprocesssection); -// return list; -// } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolAreaUserDao.java b/src/com/sipai/dao/timeefficiency/PatrolAreaUserDao.java deleted file mode 100644 index 8324e842..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolAreaUserDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolAreaUser; -import org.springframework.stereotype.Repository; - -@Repository -public class PatrolAreaUserDao extends CommDaoImpl { - public PatrolAreaUserDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolAreaUserMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolContentsDao.java b/src/com/sipai/dao/timeefficiency/PatrolContentsDao.java deleted file mode 100644 index 977982c2..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolContentsDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import com.sipai.entity.timeefficiency.PatrolPoint; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolContents; - -import java.util.List; - -@Repository -public class PatrolContentsDao extends CommDaoImpl{ - public PatrolContentsDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolContentsMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolContentsPlanDao.java b/src/com/sipai/dao/timeefficiency/PatrolContentsPlanDao.java deleted file mode 100644 index f8f809d7..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolContentsPlanDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolContentsPlan; - -@Repository -public class PatrolContentsPlanDao extends CommDaoImpl{ - public PatrolContentsPlanDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolContentsPlanMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolContentsRecordDao.java b/src/com/sipai/dao/timeefficiency/PatrolContentsRecordDao.java deleted file mode 100644 index d5d7cd17..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolContentsRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolContentsRecord; - -@Repository -public class PatrolContentsRecordDao extends CommDaoImpl{ - public PatrolContentsRecordDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolContentsRecordMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolContentsStandardDao.java b/src/com/sipai/dao/timeefficiency/PatrolContentsStandardDao.java deleted file mode 100644 index 5a755afc..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolContentsStandardDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.LibraryMaintenanceLubrication; -import com.sipai.entity.timeefficiency.PatrolContentsStandard; - -@Repository -public class PatrolContentsStandardDao extends CommDaoImpl{ - public PatrolContentsStandardDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolContentsStandardMapper"); - } - - //根据设备类别查询所有的库 - public List selectList4Class(PatrolContentsStandard patrolContentsStandard) { - List list = getSqlSession().selectList("timeefficiency.PatrolContentsStandardMapper.selectList4Class", patrolContentsStandard); - return list; - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolMeasurePointPlanDao.java b/src/com/sipai/dao/timeefficiency/PatrolMeasurePointPlanDao.java deleted file mode 100644 index 4a45291c..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolMeasurePointPlanDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolMeasurePointPlan; - -@Repository -public class PatrolMeasurePointPlanDao extends CommDaoImpl{ - public PatrolMeasurePointPlanDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolMeasurePointPlanMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolMeasurePointRecordDao.java b/src/com/sipai/dao/timeefficiency/PatrolMeasurePointRecordDao.java deleted file mode 100644 index 1ae65885..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolMeasurePointRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolMeasurePointRecord; - -@Repository -public class PatrolMeasurePointRecordDao extends CommDaoImpl{ - public PatrolMeasurePointRecordDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolMeasurePointRecordMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolModelDao.java b/src/com/sipai/dao/timeefficiency/PatrolModelDao.java deleted file mode 100644 index 636c91fc..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolModelDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolModel; -@Repository -public class PatrolModelDao extends CommDaoImpl{ - public PatrolModelDao(){ - super(); - this.setMappernamespace("timeefficiency.PatrolModelMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanDao.java deleted file mode 100644 index 4619694b..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.work.Group; - -@Repository -public class PatrolPlanDao extends CommDaoImpl{ - public PatrolPlanDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPlanMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanDeptDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanDeptDao.java deleted file mode 100644 index 45318478..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanDeptDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanDept; -import com.sipai.entity.work.Group; - -@Repository -public class PatrolPlanDeptDao extends CommDaoImpl{ - public PatrolPlanDeptDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPlanDeptMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolCameraDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolCameraDao.java deleted file mode 100644 index b618338b..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolCameraDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolCamera; -@Repository -public class PatrolPlanPatrolCameraDao extends CommDaoImpl{ - public PatrolPlanPatrolCameraDao(){ - super(); - this.setMappernamespace("timeefficiency.PatrolPlanPatrolCameraMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolEquipmentDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolEquipmentDao.java deleted file mode 100644 index 9c3ed209..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolEquipmentDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPoint; - -@Repository -public class PatrolPlanPatrolEquipmentDao extends CommDaoImpl{ - public PatrolPlanPatrolEquipmentDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPlanPatrolEquipmentMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolPointDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolPointDao.java deleted file mode 100644 index 471022cd..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanPatrolPointDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPoint; - -@Repository -public class PatrolPlanPatrolPointDao extends CommDaoImpl{ - public PatrolPlanPatrolPointDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPlanPatrolPointMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanRiskLevelDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanRiskLevelDao.java deleted file mode 100644 index 0d499c43..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanRiskLevelDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanRiskLevel; -import org.springframework.stereotype.Repository; - - -@Repository -public class PatrolPlanRiskLevelDao extends CommDaoImpl { - public PatrolPlanRiskLevelDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPlanRiskLevelMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPlanTypeDao.java b/src/com/sipai/dao/timeefficiency/PatrolPlanTypeDao.java deleted file mode 100644 index 18bd2aa0..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPlanTypeDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanType; -import org.springframework.stereotype.Repository; - - -@Repository -public class PatrolPlanTypeDao extends CommDaoImpl{ - public PatrolPlanTypeDao(){ - super(); - this.setMappernamespace("timeefficiency.patrolPlanTypeMapper"); - } - - -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPointCameraDao.java b/src/com/sipai/dao/timeefficiency/PatrolPointCameraDao.java deleted file mode 100644 index d1623ed2..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPointCameraDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPointCamera; -@Repository -public class PatrolPointCameraDao extends CommDaoImpl{ - public PatrolPointCameraDao(){ - super(); - this.setMappernamespace("timeefficiency.PatrolPointCameraMapper"); - } - -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPointDao.java b/src/com/sipai/dao/timeefficiency/PatrolPointDao.java deleted file mode 100644 index 404f4210..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPointDao.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolContents; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPoint; - -@Repository -public class PatrolPointDao extends CommDaoImpl{ - public PatrolPointDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPointMapper"); - } - public List selectListWithEquByWhere(PatrolPoint patrolpoint) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithEquByWhere", patrolpoint); - return list; - } - - public List getPatrolPoints(PatrolPoint patrolpoint){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getPatrolPoint", patrolpoint); - return list; - } - - public List getPatrolPointsSafe(PatrolPoint patrolpoint){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getPatrolPointSafe", patrolpoint); - return list; - } - - public List getNewProcessSectionPatrolPoint(PatrolPoint patrolpoint){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getNewProcessSectionPatrolPoint", patrolpoint); - return list; - } - - public List selectPointListByRecord(PatrolPoint patrolpoint){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectPointListByRecord", patrolpoint); - return list; - } - - public List selectListByWhereGroup(PatrolPoint entity){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByWhereGroup", entity); - return list; - } - -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPointEquipmentCardDao.java b/src/com/sipai/dao/timeefficiency/PatrolPointEquipmentCardDao.java deleted file mode 100644 index 0656b19a..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPointEquipmentCardDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; - -@Repository -public class PatrolPointEquipmentCardDao extends CommDaoImpl{ - public PatrolPointEquipmentCardDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPointEquipmentCardMapper"); - } - public List selectListByEquipment(PatrolPointEquipmentCard patrolpointequipmentcard) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByEquipment", patrolpointequipmentcard); - return list; - } - /*public List getPatrolPointEquipmentCards(PatrolPointEquipmentCard patrolpointequipmentcard){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getPatrolPointEquipmentCard", patrolpointequipmentcard); - return list; - }*/ -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPointFileDao.java b/src/com/sipai/dao/timeefficiency/PatrolPointFileDao.java deleted file mode 100644 index 36384a5c..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPointFileDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPointFile; - -@Repository -public class PatrolPointFileDao extends CommDaoImpl{ - public PatrolPointFileDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPointFileMapper"); - } - -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolPointMeasurePointDao.java b/src/com/sipai/dao/timeefficiency/PatrolPointMeasurePointDao.java deleted file mode 100644 index 44fd9fcf..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolPointMeasurePointDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; - -@Repository -public class PatrolPointMeasurePointDao extends CommDaoImpl{ - public PatrolPointMeasurePointDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolPointMeasurePointMapper"); - } - public List selectListWithEquByWhere(PatrolPointMeasurePoint patrolpointmeasurepoint) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithEquByWhere", patrolpointmeasurepoint); - return list; - } - public List getPatrolPointMeasurePoints(PatrolPointMeasurePoint patrolpointmeasurepoint){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getPatrolPointMeasurePoint", patrolpointmeasurepoint); - return list; - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordCollectionDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordCollectionDao.java deleted file mode 100644 index 28bfe6f4..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordCollectionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRecordCollection; - -@Repository -public class PatrolRecordCollectionDao extends CommDaoImpl{ - public PatrolRecordCollectionDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordCollectionMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordDao.java deleted file mode 100644 index f276d934..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordDao.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.dao.timeefficiency; - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRecord; - -@Repository -public class PatrolRecordDao extends CommDaoImpl { - public PatrolRecordDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordMapper"); - } - - /* - * 根据条件去重复时间 - */ - public List selectDateDistinct(PatrolRecord patrolRecord) { - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectDateDistinct", patrolRecord); - return list; - } - - public List selectListByNum(String where, String str) { - Map map = new HashMap(); - map.put("where", where); - map.put("str", str); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListByNum", map); - return list; - } - - public List selectTopByWhere(String where, String topNum) { - Map map = new HashMap(); - map.put("where", where); - map.put("topNum", topNum); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectTopByWhere", map); - return list; - } - - public List selectDistinctWorkTimeByWhere(String where) { - Map map = new HashMap(); - map.put("where", where); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectDistinctWorkTimeByWhere", map); - return list; - } - - public List selectForAchievementWork(String where) { - Map map = new HashMap(); - map.put("where", where); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectForAchievementWork", map); - return list; - } - - /*public List getUnit(String where) { - Map map = new HashMap(); - map.put("where",where); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getUnit", map); - return list; - }*/ - - public List getPatrolRecordFloorData(String where) { - Map map = new HashMap(); - map.put("where", where); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".getPatrolRecordFloorData", map); - return list; - } - - public List getPatrolRecord4AreaId(String where, String groupWhere,String orderWhere) { - Map map = new HashMap(); - map.put("where", where); - map.put("groupWhere", groupWhere); - map.put("orderWhere", orderWhere); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".getPatrolRecord4AreaId", map); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordDeptDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordDeptDao.java deleted file mode 100644 index 44e4a201..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordDeptDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlanDept; -import com.sipai.entity.timeefficiency.PatrolRecordDept; -import org.springframework.stereotype.Repository; - -@Repository -public class PatrolRecordDeptDao extends CommDaoImpl{ - public PatrolRecordDeptDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordDeptMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolCameraDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolCameraDao.java deleted file mode 100644 index b99396cb..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolCameraDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolCamera; -@Repository -public class PatrolRecordPatrolCameraDao extends CommDaoImpl{ - public PatrolRecordPatrolCameraDao(){ - super(); - this.setMappernamespace("timeefficiency.PatrolRecordPatrolCameraMapper"); - } - -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolEquipmentDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolEquipmentDao.java deleted file mode 100644 index 4c58d383..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolEquipmentDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.sipai.entity.timeefficiency.*; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; - -@Repository -public class PatrolRecordPatrolEquipmentDao extends CommDaoImpl{ - public PatrolRecordPatrolEquipmentDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordPatrolEquipmentMapper"); - } - - public List selectListGroupByWhere(String where, String name) { - Map map = new HashMap(); - map.put("where", where); - map.put("name", name); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListGroupByWhere", map); - return list; - } -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolPointDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolPointDao.java deleted file mode 100644 index 51576434..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolPointDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.timeefficiency; - - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolPoint; - -@Repository -public class PatrolRecordPatrolPointDao extends CommDaoImpl{ - public PatrolRecordPatrolPointDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordPatrolPointMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolRouteDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolRouteDao.java deleted file mode 100644 index cc908543..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordPatrolRouteDao.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.dao.timeefficiency; - - -import com.sipai.entity.timeefficiency.PatrolRecord; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class PatrolRecordPatrolRouteDao extends CommDaoImpl { - public PatrolRecordPatrolRouteDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordPatrolRouteMapper"); - } - - public List selectListGroupByWhere(String where, String name) { - Map map = new HashMap(); - map.put("where", where); - map.put("name", name); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListGroupByWhere", map); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/PatrolRecordViolationRecordDao.java b/src/com/sipai/dao/timeefficiency/PatrolRecordViolationRecordDao.java deleted file mode 100644 index 270c5bb1..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRecordViolationRecordDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolRecordViolationRecord; - - -@Repository -public class PatrolRecordViolationRecordDao extends CommDaoImpl{ - public PatrolRecordViolationRecordDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRecordViolationRecordMapper"); - } - -} diff --git a/src/com/sipai/dao/timeefficiency/PatrolRouteDao.java b/src/com/sipai/dao/timeefficiency/PatrolRouteDao.java deleted file mode 100644 index 9ce998fb..00000000 --- a/src/com/sipai/dao/timeefficiency/PatrolRouteDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolRoute; - -@Repository -public class PatrolRouteDao extends CommDaoImpl{ - public PatrolRouteDao() { - super(); - this.setMappernamespace("timeefficiency.PatrolRouteMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/timeefficiency/ViolationRecordCountDao.java b/src/com/sipai/dao/timeefficiency/ViolationRecordCountDao.java deleted file mode 100644 index 9929575a..00000000 --- a/src/com/sipai/dao/timeefficiency/ViolationRecordCountDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.apache.ibatis.session.SqlSession; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.timeefficiency.PatrolRecordViolationRecord; -import com.sipai.entity.timeefficiency.ViolationRecordCount; - -@Repository -public class ViolationRecordCountDao extends CommDaoImpl{ - public ViolationRecordCountDao() { - super(); - this.setMappernamespace("timeefficiency.ViolationRecordCountMapper"); - } - - public List selectListByCondition(ViolationRecordCount vrc){ - return this.getSqlSession().selectList("timeefficiency.ViolationRecordCountMapper.selectListByCondition",vrc); - } - - -} - - - diff --git a/src/com/sipai/dao/timeefficiency/WorkRecordDao.java b/src/com/sipai/dao/timeefficiency/WorkRecordDao.java deleted file mode 100644 index cb19ff34..00000000 --- a/src/com/sipai/dao/timeefficiency/WorkRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.WorkRecord; - -@Repository -public class WorkRecordDao extends CommDaoImpl{ - public WorkRecordDao() { - super(); - this.setMappernamespace("timeefficiency.WorkRecordMapper"); - } -} diff --git a/src/com/sipai/dao/timeefficiency/WorkerPositionDao.java b/src/com/sipai/dao/timeefficiency/WorkerPositionDao.java deleted file mode 100644 index 33fde898..00000000 --- a/src/com/sipai/dao/timeefficiency/WorkerPositionDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.timeefficiency; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.timeefficiency.WorkerPosition; -import com.sipai.entity.work.Group; - -@Repository -public class WorkerPositionDao extends CommDaoImpl{ - public WorkerPositionDao() { - super(); - this.setMappernamespace("timeefficiency.WorkerPositionMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/BonusPointDao.java b/src/com/sipai/dao/user/BonusPointDao.java deleted file mode 100644 index a50b8069..00000000 --- a/src/com/sipai/dao/user/BonusPointDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.BonusPoint; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.work.Group; - -@Repository -public class BonusPointDao extends CommDaoImpl{ - public BonusPointDao() { - super(); - this.setMappernamespace("user.BonusPointMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/BonusPointRecordDao.java b/src/com/sipai/dao/user/BonusPointRecordDao.java deleted file mode 100644 index 12c177e9..00000000 --- a/src/com/sipai/dao/user/BonusPointRecordDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.BonusPoint; -import com.sipai.entity.user.BonusPointRecord; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.work.Group; - -@Repository -public class BonusPointRecordDao extends CommDaoImpl{ - public BonusPointRecordDao() { - super(); - this.setMappernamespace("user.BonusPointRecordMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/CompanyDao.java b/src/com/sipai/dao/user/CompanyDao.java deleted file mode 100644 index 76f61396..00000000 --- a/src/com/sipai/dao/user/CompanyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCardTree; -import com.sipai.entity.user.Company; - -@Repository -public class CompanyDao extends CommDaoImpl{ - public CompanyDao() { - super(); - this.setMappernamespace("user.CompanyMapper"); - } - - public List findCompanyByWhere(Company company){ - return selectListByWhere(company); - } - - public List selectEquipmentCardTree(EquipmentCardTree equipmentCardTree){ - List equipmentCardTreeList = this.getSqlSession().selectList("user.CompanyMapper.selectEquipmentCardTree", equipmentCardTree); - return equipmentCardTreeList; - } - - public EquipmentCardTree selectEquCardTreeConditionByPId(String pid){ - EquipmentCardTree equipmentCardTree = this.getSqlSession().selectOne("user.CompanyMapper.selectEquCardTreeConditionByPId", pid); - return equipmentCardTree; - } - public List selectPumpCardTree(EquipmentCardTree equipmentCardTree){ - List equipmentCardTreeList = this.getSqlSession().selectList("user.CompanyMapper.selectPumpCardTree", equipmentCardTree); - return equipmentCardTreeList; - } - - public EquipmentCardTree selectpumpCardTreeConditionByPId(String pid){ - EquipmentCardTree equipmentCardTree = this.getSqlSession().selectOne("user.CompanyMapper.selectpumpCardTreeConditionByPId", pid); - return equipmentCardTree; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/DeptAreaDao.java b/src/com/sipai/dao/user/DeptAreaDao.java deleted file mode 100644 index 894fd8f0..00000000 --- a/src/com/sipai/dao/user/DeptAreaDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.DeptArea; - -@Repository -public class DeptAreaDao extends CommDaoImpl{ - public DeptAreaDao() { - super(); - this.setMappernamespace("user.DeptAreaMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/DeptDao.java b/src/com/sipai/dao/user/DeptDao.java deleted file mode 100644 index 30dcd52c..00000000 --- a/src/com/sipai/dao/user/DeptDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.Dept; - -@Repository -public class DeptDao extends CommDaoImpl{ - public DeptDao() { - super(); - this.setMappernamespace("user.DeptMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/DeptProcessDao.java b/src/com/sipai/dao/user/DeptProcessDao.java deleted file mode 100644 index 080b28cc..00000000 --- a/src/com/sipai/dao/user/DeptProcessDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.DeptProcess; - -@Repository -public class DeptProcessDao extends CommDaoImpl{ - public DeptProcessDao() { - super(); - this.setMappernamespace("user.DeptProcessMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/DeptRoleDao.java b/src/com/sipai/dao/user/DeptRoleDao.java deleted file mode 100644 index c11f9e69..00000000 --- a/src/com/sipai/dao/user/DeptRoleDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.DeptRole; - -@Repository -public class DeptRoleDao extends CommDaoImpl{ - public DeptRoleDao() { - super(); - this.setMappernamespace("user.DeptRoleMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/ExtSystemDao.java b/src/com/sipai/dao/user/ExtSystemDao.java deleted file mode 100644 index 15bd8191..00000000 --- a/src/com/sipai/dao/user/ExtSystemDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.work.Group; - -@Repository -public class ExtSystemDao extends CommDaoImpl{ - public ExtSystemDao() { - super(); - this.setMappernamespace("user.ExtSystemMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/JobDao.java b/src/com/sipai/dao/user/JobDao.java deleted file mode 100644 index a5e6f5c2..00000000 --- a/src/com/sipai/dao/user/JobDao.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import com.sipai.entity.base.Tree; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.Job; - -@Repository -public class JobDao extends CommDaoImpl{ - public JobDao() { - super(); - this.setMappernamespace("user.JobMapper"); - } - - public List selectListByUnitid(String unitid){ - List list = this.getSqlSession().selectList("user.JobMapper.selectListByUnitid", unitid); - return list; - } - - public List selectListByUserId(String userId) { - return this.getSqlSession().selectList("user.JobMapper.selectListByUserId", userId); - } - - public Job selectByName(String name) { - return this.getSqlSession().selectOne("user.JobMapper.selectByName", name); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/MenuDao.java b/src/com/sipai/dao/user/MenuDao.java deleted file mode 100644 index 8c0d3fd4..00000000 --- a/src/com/sipai/dao/user/MenuDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.Menu; - -@Repository -public class MenuDao extends CommDaoImpl

{ - public MenuDao() { - super(); - this.setMappernamespace("user.MenuMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/MobileManagementDao.java b/src/com/sipai/dao/user/MobileManagementDao.java deleted file mode 100644 index a7d9b70e..00000000 --- a/src/com/sipai/dao/user/MobileManagementDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.MobileManagement; -import com.sipai.entity.user.User; - -@Repository -public class MobileManagementDao extends CommDaoImpl{ - public MobileManagementDao() { - super(); - this.setMappernamespace("user.MobileManagementMapper"); - } - - public List getListByCardid(String cardid) { - List list = this.getSqlSession().selectList("user.MobileManagementMapper.getListByCardid", cardid); - return list; - } - -} diff --git a/src/com/sipai/dao/user/MobileValidationDao.java b/src/com/sipai/dao/user/MobileValidationDao.java deleted file mode 100644 index 8863cb66..00000000 --- a/src/com/sipai/dao/user/MobileValidationDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.MobileValidation; -import com.sipai.entity.user.UserRole; - -@Repository -public class MobileValidationDao extends CommDaoImpl{ - public MobileValidationDao() { - super(); - this.setMappernamespace("user.MobileValidationMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/ProcessSectionDao.java b/src/com/sipai/dao/user/ProcessSectionDao.java deleted file mode 100644 index c9539c96..00000000 --- a/src/com/sipai/dao/user/ProcessSectionDao.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Role; - -@Repository -public class ProcessSectionDao extends CommDaoImpl{ - public ProcessSectionDao() { - super(); - this.setMappernamespace("user.ProcessSectionMapper"); - } - - public List selectProcessListByDept(ProcessSection processSection) { - List list = this.getSqlSession().selectList("user.ProcessSectionMapper.selectProcessListByDept", processSection); - return list; - } - - public List selectListGroupBy(ProcessSection processSection){ - List list = this.getSqlSession().selectList("user.ProcessSectionMapper.selectListGroupBy", processSection); - return list; - } - -/* public List selectProSecByComapnyId(String companyId) { - List list = this.getSqlSession().selectList("user.ProcessSectionMapper.selectProSecByComapnyId", companyId); - return list; - }*/ - -/* public List selectDistinctProSecByComapnyId(String companyId) { - List list = this.getSqlSession().selectList("user.ProcessSectionMapper.selectDistinctProSecByComapnyId", companyId); - return list; - }*/ - - public List selectDistinctProSecByBTo(EquipmentCard equipmentCard) { - List list = this.getSqlSession().selectList("user.ProcessSectionMapper.selectDistinctProSecByBTo", equipmentCard); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/ProcessSectionScoreDao.java b/src/com/sipai/dao/user/ProcessSectionScoreDao.java deleted file mode 100644 index 827b4ec9..00000000 --- a/src/com/sipai/dao/user/ProcessSectionScoreDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.ProcessSectionScore; - -@Repository -public class ProcessSectionScoreDao extends CommDaoImpl{ - public ProcessSectionScoreDao(){ - super(); - this.setMappernamespace("user.ProcessSectionScoreMapper"); - } -} diff --git a/src/com/sipai/dao/user/ProcessSectionTypeDao.java b/src/com/sipai/dao/user/ProcessSectionTypeDao.java deleted file mode 100644 index b18bb2fb..00000000 --- a/src/com/sipai/dao/user/ProcessSectionTypeDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.ProcessSectionType; -import com.sipai.entity.user.Role; - -@Repository -public class ProcessSectionTypeDao extends CommDaoImpl{ - public ProcessSectionTypeDao() { - super(); - this.setMappernamespace("user.ProcessSectionTypeMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/RoleDao.java b/src/com/sipai/dao/user/RoleDao.java deleted file mode 100644 index f8b4d87d..00000000 --- a/src/com/sipai/dao/user/RoleDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.Role; - -@Repository -public class RoleDao extends CommDaoImpl{ - public RoleDao() { - super(); - this.setMappernamespace("user.RoleMapper"); - } - - public List selectRoleListByDept(Role role) { - List list = this.getSqlSession().selectList("user.RoleMapper.selectRoleListByDept", role); - return list; - } - - public List selectRoleListByUser(Role role) { - List list = this.getSqlSession().selectList("user.RoleMapper.selectRoleListByUser", role); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/RoleMenuDao.java b/src/com/sipai/dao/user/RoleMenuDao.java deleted file mode 100644 index a666367e..00000000 --- a/src/com/sipai/dao/user/RoleMenuDao.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.dao.user; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.RoleMenu; - -@Repository -public class RoleMenuDao extends CommDaoImpl{ - public RoleMenuDao() { - super(); - this.setMappernamespace("user.RoleMenuMapper"); - } - - public List selectMenuListByRole(String roleid){ - return this.getSqlSession().selectList("user.RoleMenuMapper.selectMenuListByRole", roleid); - } - - public List selectFuncListByRole(String roleid){ - return this.getSqlSession().selectList("user.RoleMenuMapper.selectFuncListByRole", roleid); - } - - public int deleteMenuByRole(String roleid){ - return this.getSqlSession().delete("user.RoleMenuMapper.deleteMenuByRole", roleid); - } - - public int deleteFuncByRoleMenu(String roleid,String menuid){ - Map param=new HashMap(); - param.put("roleid1", roleid); - param.put("menuid1", menuid); - return this.getSqlSession().delete("user.RoleMenuMapper.deleteFuncByRoleMenu",param); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UnitDao.java b/src/com/sipai/dao/user/UnitDao.java deleted file mode 100644 index e89d8113..00000000 --- a/src/com/sipai/dao/user/UnitDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Unit; - -@Repository -public class UnitDao extends CommDaoImpl{ - public UnitDao() { - super(); - this.setMappernamespace("user.UnitMapper"); - } - - public Unit getUnitById(String id){ - return this.getSqlSession().selectOne("user.UnitMapper.getUnitById",id); - } - - public List getMaintenanceBizsByWhere(Unit unit) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getMaintenanceBizsByWhere", unit); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserDao.java b/src/com/sipai/dao/user/UserDao.java deleted file mode 100644 index afddbe8b..00000000 --- a/src/com/sipai/dao/user/UserDao.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.dao.user; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.User; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class UserDao extends CommDaoImpl{ - public UserDao() { - super(); - this.setMappernamespace("user.UserMapper"); - } - - public List getListByLoginName(String name){ - List list = this.getSqlSession().selectList("user.UserMapper.getUserByName", name); - return list; - } - - public List getListBySerial(String serial) { - List list = this.getSqlSession().selectList("user.UserMapper.getListBySerial", serial); - return list; - } - - public List getListByCardid(String cardid) { - List list = this.getSqlSession().selectList("user.UserMapper.getListByCardid", cardid); - return list; - } - - public User getListByUserCardid(String userCardid) { - User user = this.getSqlSession().selectOne("user.UserMapper.getListByUserCardid", userCardid); - return user; - } - - public User getUserByLoginName(String name) { - User user = this.getSqlSession().selectOne("user.UserMapper.getUserByLoginName", name); - return user; - } - - public int updateByPrimaryKey4Lock(String id){ - return this.getSqlSession().update("user.UserMapper.updateByPrimaryKey4Lock", id); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserDetailDao.java b/src/com/sipai/dao/user/UserDetailDao.java deleted file mode 100644 index d2e07a2c..00000000 --- a/src/com/sipai/dao/user/UserDetailDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.user; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.UserDetail; -import com.sipai.entity.user.UserJob; - -@Repository -public class UserDetailDao extends CommDaoImpl{ - public UserDetailDao() { - super(); - this.setMappernamespace("user.UserDetailMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserJobDao.java b/src/com/sipai/dao/user/UserJobDao.java deleted file mode 100644 index 67a102f2..00000000 --- a/src/com/sipai/dao/user/UserJobDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.UserJob; - -@Repository -public class UserJobDao extends CommDaoImpl{ - public UserJobDao() { - super(); - this.setMappernamespace("user.UserJobMapper"); - } - - //通过jobid查询UserJob - public List selectUserJobByJobId(String jobId) { - List list = this.getSqlSession().selectList("user.UserJobMapper.selectUserJobByJobId", jobId); - return list; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserOutsidersDao.java b/src/com/sipai/dao/user/UserOutsidersDao.java deleted file mode 100644 index 8df155b9..00000000 --- a/src/com/sipai/dao/user/UserOutsidersDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.user; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.UserOutsiders; -import org.springframework.stereotype.Repository; - -/** - * @author SIPAIIS-NJP - */ -@Repository -public class UserOutsidersDao extends CommDaoImpl{ - public UserOutsidersDao() { - super(); - this.setMappernamespace("user.UserOutsidersMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserPowerDao.java b/src/com/sipai/dao/user/UserPowerDao.java deleted file mode 100644 index a23a77fd..00000000 --- a/src/com/sipai/dao/user/UserPowerDao.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.UserPower; - -@Repository -public class UserPowerDao extends CommDaoImpl{ - - public List selectListByUserId(String id){ - List list = this.getSqlSession().selectList("user.UserPowerMapper.selectListByUserId", id); - return list; - } - - public List selectMenuByUserId(String id){ - List list = this.getSqlSession().selectList("user.UserPowerMapper.selectMenuByUserId", id); - return list; - } - - public List selectFuncByUserId(String id){ - List list = this.getSqlSession().selectList("user.UserPowerMapper.selectFuncByUserId", id); - return list; - } - public List selectListByWhere(String whereStr){ - UserPower userPower =new UserPower(); - userPower.setWhere(whereStr); - List list = this.getSqlSession().selectList("user.UserPowerMapper.selectListByWhere", userPower); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserRoleDao.java b/src/com/sipai/dao/user/UserRoleDao.java deleted file mode 100644 index 2f167fef..00000000 --- a/src/com/sipai/dao/user/UserRoleDao.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.UserRole; - -@Repository -public class UserRoleDao extends CommDaoImpl{ - public UserRoleDao() { - super(); - this.setMappernamespace("user.UserRoleMapper"); - } - - public List selectListByRole(String roleid){ - return this.getSqlSession().selectList("user.UserRoleMapper.selectListByRole", roleid); - } - - public int deleteByRole(String roleid){ - return this.getSqlSession().delete("user.UserRoleMapper.deleteByRole", roleid); - } - - public int deleteByWhere(UserRole userRole){ - return this.getSqlSession().delete("user.UserRoleMapper.deleteByWhere", userRole); - } - - public int deleteByUser(String userid){ - return this.getSqlSession().delete("user.UserRoleMapper.deleteByUser", userid); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/user/UserTimeDao.java b/src/com/sipai/dao/user/UserTimeDao.java deleted file mode 100644 index aeca95fc..00000000 --- a/src/com/sipai/dao/user/UserTimeDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.user; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserTime; - -@Repository -public class UserTimeDao extends CommDaoImpl{ - public UserTimeDao() { - super(); - this.setMappernamespace("user.UserTimeMapper"); - } - - public Double getTotaltimeByUserId(String userId){ - List list = this.getSqlSession().selectList("user.UserTimeMapper.getTotaltimeByUserId", userId); - return list.get(0).getLogintime(); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/valueEngineering/EquipmentDepreciationDao.java b/src/com/sipai/dao/valueEngineering/EquipmentDepreciationDao.java deleted file mode 100644 index da934aad..00000000 --- a/src/com/sipai/dao/valueEngineering/EquipmentDepreciationDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.valueEngineering; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.valueEngineering.EquipmentDepreciation; - -@Repository -public class EquipmentDepreciationDao extends CommDaoImpl{ - public EquipmentDepreciationDao() { - super(); - this.setMappernamespace("valueEngineering.EquipmentDepreciationMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/valueEngineering/EquipmentEvaluateDao.java b/src/com/sipai/dao/valueEngineering/EquipmentEvaluateDao.java deleted file mode 100644 index 6d92877d..00000000 --- a/src/com/sipai/dao/valueEngineering/EquipmentEvaluateDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.valueEngineering; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.valueEngineering.EquipmentEvaluate; -import com.sipai.entity.valueEngineering.EquipmentModel; -import com.sipai.entity.work.KPIPoint; - -@Repository -public class EquipmentEvaluateDao extends CommDaoImpl{ - public EquipmentEvaluateDao() { - super(); - this.setMappernamespace("valueEngineering.EquipmentEvaluateMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/valueEngineering/EquipmentModelDao.java b/src/com/sipai/dao/valueEngineering/EquipmentModelDao.java deleted file mode 100644 index 93cb1f2a..00000000 --- a/src/com/sipai/dao/valueEngineering/EquipmentModelDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.valueEngineering; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.valueEngineering.EquipmentModel; -import com.sipai.entity.work.KPIPoint; - -@Repository -public class EquipmentModelDao extends CommDaoImpl{ - public EquipmentModelDao() { - super(); - this.setMappernamespace("valueEngineering.EquipmentModelMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/SafeAreaDao.java b/src/com/sipai/dao/visit/SafeAreaDao.java deleted file mode 100644 index 6d632e7b..00000000 --- a/src/com/sipai/dao/visit/SafeAreaDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.visit; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.SafeArea; -import org.springframework.stereotype.Repository; - -@Repository -public class SafeAreaDao extends CommDaoImpl{ - public SafeAreaDao() { - super(); - this.setMappernamespace("visit.SafeAreaMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/SafeAreaPositionDao.java b/src/com/sipai/dao/visit/SafeAreaPositionDao.java deleted file mode 100644 index b160dc5a..00000000 --- a/src/com/sipai/dao/visit/SafeAreaPositionDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.visit; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.SafeAreaPosition; -import org.springframework.stereotype.Repository; - -@Repository -public class SafeAreaPositionDao extends CommDaoImpl{ - public SafeAreaPositionDao() { - super(); - this.setMappernamespace("visit.SafeAreaPositionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/VisitApplyDao.java b/src/com/sipai/dao/visit/VisitApplyDao.java deleted file mode 100644 index ac112a5d..00000000 --- a/src/com/sipai/dao/visit/VisitApplyDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visit; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.VisitApply; - -@Repository -public class VisitApplyDao extends CommDaoImpl{ - public VisitApplyDao() { - super(); - this.setMappernamespace("visit.VisitApplyMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/VisitPositionDao.java b/src/com/sipai/dao/visit/VisitPositionDao.java deleted file mode 100644 index f983f2df..00000000 --- a/src/com/sipai/dao/visit/VisitPositionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visit; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.VisitPosition; - -@Repository -public class VisitPositionDao extends CommDaoImpl{ - public VisitPositionDao() { - super(); - this.setMappernamespace("visit.VisitPositionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/VisitRegisterDao.java b/src/com/sipai/dao/visit/VisitRegisterDao.java deleted file mode 100644 index 026a056d..00000000 --- a/src/com/sipai/dao/visit/VisitRegisterDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visit; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.VisitRegister; - -@Repository -public class VisitRegisterDao extends CommDaoImpl{ - public VisitRegisterDao() { - super(); - this.setMappernamespace("visit.VisitRegisterMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/VisitSafetyCommitmentDao.java b/src/com/sipai/dao/visit/VisitSafetyCommitmentDao.java deleted file mode 100644 index 1fb58769..00000000 --- a/src/com/sipai/dao/visit/VisitSafetyCommitmentDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visit; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.VisitSafetyCommitment; - -@Repository -public class VisitSafetyCommitmentDao extends CommDaoImpl{ - public VisitSafetyCommitmentDao() { - super(); - this.setMappernamespace("visit.VisitSafetyCommitmentMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/VisitSafetyCommitmentRecordDao.java b/src/com/sipai/dao/visit/VisitSafetyCommitmentRecordDao.java deleted file mode 100644 index 5abe81e8..00000000 --- a/src/com/sipai/dao/visit/VisitSafetyCommitmentRecordDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visit; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.VisitSafetyCommitmentRecord; - -@Repository -public class VisitSafetyCommitmentRecordDao extends CommDaoImpl{ - public VisitSafetyCommitmentRecordDao() { - super(); - this.setMappernamespace("visit.VisitSafetyCommitmentRecordMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visit/VisitVisitorsDao.java b/src/com/sipai/dao/visit/VisitVisitorsDao.java deleted file mode 100644 index 569d7549..00000000 --- a/src/com/sipai/dao/visit/VisitVisitorsDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visit; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visit.VisitVisitors; - -@Repository -public class VisitVisitorsDao extends CommDaoImpl{ - public VisitVisitorsDao() { - super(); - this.setMappernamespace("visit.VisitVisitorsMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/CacheDataDao.java b/src/com/sipai/dao/visual/CacheDataDao.java deleted file mode 100644 index 4271b8e5..00000000 --- a/src/com/sipai/dao/visual/CacheDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.CacheData; - -@Repository -public class CacheDataDao extends CommDaoImpl{ - public CacheDataDao() { - super(); - this.setMappernamespace("visual.CacheDataMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/DataTypeDao.java b/src/com/sipai/dao/visual/DataTypeDao.java deleted file mode 100644 index 1d0649fe..00000000 --- a/src/com/sipai/dao/visual/DataTypeDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.Interaction; - -@Repository -public class DataTypeDao extends CommDaoImpl{ - public DataTypeDao() { - super(); - this.setMappernamespace("visual.DataTypeMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/InteractionDao.java b/src/com/sipai/dao/visual/InteractionDao.java deleted file mode 100644 index e26734a7..00000000 --- a/src/com/sipai/dao/visual/InteractionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.Interaction; - -@Repository -public class InteractionDao extends CommDaoImpl{ - public InteractionDao() { - super(); - this.setMappernamespace("visual.InteractionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/JspConfigureDao.java b/src/com/sipai/dao/visual/JspConfigureDao.java deleted file mode 100644 index b2a35d11..00000000 --- a/src/com/sipai/dao/visual/JspConfigureDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.JspConfigure; - -@Repository -public class JspConfigureDao extends CommDaoImpl{ - public JspConfigureDao() { - super(); - this.setMappernamespace("visual.JspConfigureMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/JspConfigureDetailDao.java b/src/com/sipai/dao/visual/JspConfigureDetailDao.java deleted file mode 100644 index fc3fdf0c..00000000 --- a/src/com/sipai/dao/visual/JspConfigureDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.JspConfigureDetail; - -@Repository -public class JspConfigureDetailDao extends CommDaoImpl{ - public JspConfigureDetailDao() { - super(); - this.setMappernamespace("visual.JspConfigureDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/JspElementDao.java b/src/com/sipai/dao/visual/JspElementDao.java deleted file mode 100644 index d1cd7d75..00000000 --- a/src/com/sipai/dao/visual/JspElementDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.JspElement; - -@Repository -public class JspElementDao extends CommDaoImpl{ - public JspElementDao() { - super(); - this.setMappernamespace("visual.JspElementMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/LayoutDao.java b/src/com/sipai/dao/visual/LayoutDao.java deleted file mode 100644 index f9c19e3b..00000000 --- a/src/com/sipai/dao/visual/LayoutDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.Layout; - -@Repository -public class LayoutDao extends CommDaoImpl{ - public LayoutDao() { - super(); - this.setMappernamespace("visual.LayoutMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/LayoutDetailDao.java b/src/com/sipai/dao/visual/LayoutDetailDao.java deleted file mode 100644 index 30c7634a..00000000 --- a/src/com/sipai/dao/visual/LayoutDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.LayoutDetail; - -@Repository -public class LayoutDetailDao extends CommDaoImpl{ - public LayoutDetailDao() { - super(); - this.setMappernamespace("visual.LayoutDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/PlanDao.java b/src/com/sipai/dao/visual/PlanDao.java deleted file mode 100644 index 8d33ad0f..00000000 --- a/src/com/sipai/dao/visual/PlanDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.Plan; - -@Repository -public class PlanDao extends CommDaoImpl{ - public PlanDao() { - super(); - this.setMappernamespace("visual.PlanMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/PlanInteractionDao.java b/src/com/sipai/dao/visual/PlanInteractionDao.java deleted file mode 100644 index 1c14c2c1..00000000 --- a/src/com/sipai/dao/visual/PlanInteractionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.PlanInteraction; - -@Repository -public class PlanInteractionDao extends CommDaoImpl{ - public PlanInteractionDao() { - super(); - this.setMappernamespace("visual.PlanInteractionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/PlanLayoutDao.java b/src/com/sipai/dao/visual/PlanLayoutDao.java deleted file mode 100644 index 0a82e547..00000000 --- a/src/com/sipai/dao/visual/PlanLayoutDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.PlanLayout; - -@Repository -public class PlanLayoutDao extends CommDaoImpl{ - public PlanLayoutDao() { - super(); - this.setMappernamespace("visual.PlanLayoutMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/ProcessOperationDao.java b/src/com/sipai/dao/visual/ProcessOperationDao.java deleted file mode 100644 index a0ff7986..00000000 --- a/src/com/sipai/dao/visual/ProcessOperationDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.ProcessOperation; - -@Repository -public class ProcessOperationDao extends CommDaoImpl{ - public ProcessOperationDao() { - super(); - this.setMappernamespace("visual.ProcessOperationMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/VisualCacheConfigDao.java b/src/com/sipai/dao/visual/VisualCacheConfigDao.java deleted file mode 100644 index 0c430375..00000000 --- a/src/com/sipai/dao/visual/VisualCacheConfigDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.VisualCacheConfig; - -@Repository -public class VisualCacheConfigDao extends CommDaoImpl{ - public VisualCacheConfigDao() { - super(); - this.setMappernamespace("visual.VisualCacheConfigMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/VisualCacheDataDao.java b/src/com/sipai/dao/visual/VisualCacheDataDao.java deleted file mode 100644 index b6c7699d..00000000 --- a/src/com/sipai/dao/visual/VisualCacheDataDao.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.dao.visual; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.VisualCacheData; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class VisualCacheDataDao extends CommDaoImpl{ - public VisualCacheDataDao() { - super(); - this.setMappernamespace("visual.VisualCacheDataMapper"); - } - public List selectAggregateList(String tablename, String wherestr,String select){ - Map paramMap=new HashMap<>(); - paramMap.put("table",tablename); - paramMap.put("where",wherestr); - paramMap.put("select",select); - List list= getSqlSession().selectList("visual.VisualCacheDataMapper.selectAggregateList", paramMap); - return list; - } - public VisualCacheData selectListByWhere4TopOne( VisualCacheData item){ - VisualCacheData list= getSqlSession().selectOne("visual.VisualCacheDataMapper.selectListByWhere4TopOne", item); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/visual/VisualJspDao.java b/src/com/sipai/dao/visual/VisualJspDao.java deleted file mode 100644 index 7b17b9aa..00000000 --- a/src/com/sipai/dao/visual/VisualJspDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.visual; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.visual.VisualJsp; - -@Repository -public class VisualJspDao extends CommDaoImpl{ - public VisualJspDao() { - super(); - this.setMappernamespace("visual.VisualJspMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/whp/baseinfo/WhpEquipmentDao.java b/src/com/sipai/dao/whp/baseinfo/WhpEquipmentDao.java deleted file mode 100644 index a3925207..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpEquipmentDao.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpEquipmentQuery; -import com.sipai.entity.whp.baseinfo.WhpEquipment; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 设备管理Dao - * @Author: 李晨 - * @Date: 2022/12/16 - */ -@Repository -public class WhpEquipmentDao extends CommDaoImpl { - public WhpEquipmentDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpEquipmentMapper"); - } - - public List queryList(WhpEquipmentQuery s) { - return getSqlSession().selectList("whp.baseinfo.WhpEquipmentMapper.queryList", s); - } - - public List< EnumJsonObject> addressList(){ - return getSqlSession().selectList("whp.baseinfo.WhpEquipmentMapper.addressList"); - } - - public List< EnumJsonObject> equipmentDropDownList(){ - return getSqlSession().selectList("whp.baseinfo.WhpEquipmentMapper.equipmentDropDownList"); - } - - public List< EnumJsonObject> equipmentDropDownListByWhere(WhpEquipment t){ - return getSqlSession().selectList("whp.baseinfo.WhpEquipmentMapper.equipmentDropDownListByWhere",t); - } -} diff --git a/src/com/sipai/dao/whp/baseinfo/WhpLiquidWasteDisposeOrgDao.java b/src/com/sipai/dao/whp/baseinfo/WhpLiquidWasteDisposeOrgDao.java deleted file mode 100644 index b04148d6..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpLiquidWasteDisposeOrgDao.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrg; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrgQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * po类Dao - * - * @Author: 李晨 - * @Date: 2022/12/5 - */ -@Repository -public class WhpLiquidWasteDisposeOrgDao extends CommDaoImpl { - public WhpLiquidWasteDisposeOrgDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpLiquidWasteDisposeOrgMapper"); - } - - public List queryList(WhpLiquidWasteDisposeOrgQuery s) { - return getSqlSession().selectList("whp.baseinfo.WhpLiquidWasteDisposeOrgMapper.queryList", s); - } - -} diff --git a/src/com/sipai/dao/whp/baseinfo/WhpResidualSampleDisposeTypeDao.java b/src/com/sipai/dao/whp/baseinfo/WhpResidualSampleDisposeTypeDao.java deleted file mode 100644 index 387a1199..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpResidualSampleDisposeTypeDao.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeType; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeTypeQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 余样处置方式Dao - * - * @Author: 李晨 - * @Date: 2022/12/19 - */ -@Repository -public class WhpResidualSampleDisposeTypeDao extends CommDaoImpl { - public WhpResidualSampleDisposeTypeDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpResidualSampleDisposeTypeMapper"); - } - - public List queryList(WhpResidualSampleDisposeTypeQuery s) { - return getSqlSession().selectList("whp.baseinfo.WhpResidualSampleDisposeTypeMapper.queryList", s); - } - - public List dropDownList() { - return getSqlSession().selectList("whp.baseinfo.WhpResidualSampleDisposeTypeMapper.dropDownList"); - } -} diff --git a/src/com/sipai/dao/whp/baseinfo/WhpSampleCodeDao.java b/src/com/sipai/dao/whp/baseinfo/WhpSampleCodeDao.java deleted file mode 100644 index a265ec46..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpSampleCodeDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.whp.baseinfo.WhpSampleCodeQuery; -import com.sipai.entity.whp.baseinfo.WhpSampleCode; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 采样编码Dao - * @Author: 李晨 - * @Date: 2022/12/16 - */ -@Repository -public class WhpSampleCodeDao extends CommDaoImpl { - public WhpSampleCodeDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpSampleCodeMapper"); - } - - public List queryList(WhpSampleCodeQuery s) { - return getSqlSession().selectList("whp.baseinfo.WhpSampleCodeMapper.queryList", s); - } - -} diff --git a/src/com/sipai/dao/whp/baseinfo/WhpSampleTypeDao.java b/src/com/sipai/dao/whp/baseinfo/WhpSampleTypeDao.java deleted file mode 100644 index fd811f1d..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpSampleTypeDao.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpSampleTypeQuery; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 采样类型Dao - * @Author: 李晨 - * @Date: 2022/12/16 - */ -@Repository -public class WhpSampleTypeDao extends CommDaoImpl { - public WhpSampleTypeDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpSampleTypeMapper"); - } - - public List queryList(WhpSampleTypeQuery s) { - return getSqlSession().selectList("whp.baseinfo.WhpSampleTypeMapper.queryList", s); - } - - public List dropDownList() { - return getSqlSession().selectList("whp.baseinfo.WhpSampleTypeMapper.dropDownList"); - } - -} diff --git a/src/com/sipai/dao/whp/baseinfo/WhpTestItemDao.java b/src/com/sipai/dao/whp/baseinfo/WhpTestItemDao.java deleted file mode 100644 index 9190e39a..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpTestItemDao.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpTestItem; -import com.sipai.entity.whp.baseinfo.WhpTestItemQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 检测项目Dao - * - * @Author: 李晨 - * @Date: 2022/12/16 - */ -@Repository -public class WhpTestItemDao extends CommDaoImpl { - public WhpTestItemDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpTestItemMapper"); - } - - public List queryList(WhpTestItemQuery s) { - s.setDeptIdsCondition(); - return getSqlSession().selectList("whp.baseinfo.WhpTestItemMapper.queryList", s); - } - - public List testItemDropDownList() { - return getSqlSession().selectList("whp.baseinfo.WhpTestItemMapper.testItemDropDownList"); - } - - /** - * 返回用逗号隔开的部门id - * - * @Author: lichen - * @Date: 2022/12/19 - **/ - public String testOrgDropDownList() { - return getSqlSession().selectOne("whp.baseinfo.WhpTestItemMapper.testOrgDropDownList"); - } - - public List testItemDropDownListByRange(String conditionInStr) { - WhpTestItem bean = new WhpTestItem(); - bean.setWhere(conditionInStr); - return getSqlSession().selectList("whp.baseinfo.WhpTestItemMapper.testItemDropDownListByRange",bean); - } -} diff --git a/src/com/sipai/dao/whp/baseinfo/WhpTestItemWorkingCurveDao.java b/src/com/sipai/dao/whp/baseinfo/WhpTestItemWorkingCurveDao.java deleted file mode 100644 index 740cacdb..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpTestItemWorkingCurveDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.baseinfo; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveQuery; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurve; import org.springframework.stereotype.Repository; import java.util.List; /** * 方法依据Dao * @Author: zxq * @Date: 2023/05/15 */ @Repository public class WhpTestItemWorkingCurveDao extends CommDaoImpl { public WhpTestItemWorkingCurveDao() { super(); this.setMappernamespace("whp.baseinfo.WhpTestItemWorkingCurveMapper"); } public List queryList(WhpTestItemWorkingCurveQuery s) { return getSqlSession().selectList("whp.baseinfo.WhpTestItemWorkingCurveMapper.queryList", s); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/baseinfo/WhpTestMethodDao.java b/src/com/sipai/dao/whp/baseinfo/WhpTestMethodDao.java deleted file mode 100644 index 935c0493..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpTestMethodDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.baseinfo; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.whp.baseinfo.WhpTestItem; import com.sipai.entity.whp.baseinfo.WhpTestMethodQuery; import com.sipai.entity.whp.baseinfo.WhpTestMethod; import org.springframework.stereotype.Repository; import java.util.List; /** * 方法依据Dao * @Author: zxq * @Date: 2023/05/15 */ @Repository public class WhpTestMethodDao extends CommDaoImpl { public WhpTestMethodDao() { super(); this.setMappernamespace("whp.baseinfo.WhpTestMethodMapper"); } public List queryList(WhpTestMethodQuery s) { return getSqlSession().selectList("whp.baseinfo.WhpTestMethodMapper.queryList", s); } public List testMethodDropDownList(WhpTestMethodQuery s) { return getSqlSession().selectList("whp.baseinfo.WhpTestMethodMapper.testMethodDropDownList",s); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/baseinfo/WhpTestOrgDao.java b/src/com/sipai/dao/whp/baseinfo/WhpTestOrgDao.java deleted file mode 100644 index 501d3fc9..00000000 --- a/src/com/sipai/dao/whp/baseinfo/WhpTestOrgDao.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.dao.whp.baseinfo; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpTestOrg; -import com.sipai.entity.whp.baseinfo.WhpTestOrgQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * po类Dao - * - * @Author: 李晨 - * @Date: 2022/12/5 - */ -@Repository -public class WhpTestOrgDao extends CommDaoImpl { - public WhpTestOrgDao() { - super(); - this.setMappernamespace("whp.baseinfo.WhpTestOrgMapper"); - } - - public List queryList(WhpTestOrgQuery s) { - return getSqlSession().selectList("whp.baseinfo.WhpTestOrgMapper.queryList", s); - } - - public List dropDown() { - return getSqlSession().selectList("whp.baseinfo.WhpTestOrgMapper.dropDown"); - } -} diff --git a/src/com/sipai/dao/whp/liquidWasteDispose/WhpLiquidWasteDisposeDao.java b/src/com/sipai/dao/whp/liquidWasteDispose/WhpLiquidWasteDisposeDao.java deleted file mode 100644 index 1b0f2304..00000000 --- a/src/com/sipai/dao/whp/liquidWasteDispose/WhpLiquidWasteDisposeDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.liquidWasteDispose; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDisposeQuery; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDispose; import org.springframework.stereotype.Repository; import java.util.List; /** * 余样处置方式Dao * @Author: 李晨 * @Date: 2022/12/20 */ @Repository public class WhpLiquidWasteDisposeDao extends CommDaoImpl { public WhpLiquidWasteDisposeDao() { super(); this.setMappernamespace("whp.liquidWasteDispose.WhpLiquidWasteDisposeMapper"); } public List queryList(WhpLiquidWasteDisposeQuery s) { return getSqlSession().selectList("whp.liquidWasteDispose.WhpLiquidWasteDisposeMapper.queryList", s); } public Float getCurrentNumbCount(WhpLiquidWasteDisposeQuery s) { return getSqlSession().selectOne("whp.liquidWasteDispose.WhpLiquidWasteDisposeMapper.getCurrentNumbCount", s); } public Float getNumberCount(WhpLiquidWasteDisposeQuery s) { return getSqlSession().selectOne("whp.liquidWasteDispose.WhpLiquidWasteDisposeMapper.getNumberCount", s); } public List queryListDispose(WhpLiquidWasteDisposeQuery s) { return getSqlSession().selectList("whp.liquidWasteDispose.WhpLiquidWasteDisposeMapper.queryListDispose", s); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogDao.java b/src/com/sipai/dao/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogDao.java deleted file mode 100644 index fe31195a..00000000 --- a/src/com/sipai/dao/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.liquidWasteDispose; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDisposeLogQuery; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDisposeLog; import org.springframework.stereotype.Repository; import java.util.List; /** * 方法依据Dao * @Author: zxq * @Date: 2023/05/15 */ @Repository public class WhpLiquidWasteDisposeLogDao extends CommDaoImpl { public WhpLiquidWasteDisposeLogDao() { super(); this.setMappernamespace("whp.liquidWasteDispose.WhpLiquidWasteDisposeLogMapper"); } public List queryList(WhpLiquidWasteDisposeLogQuery s) { return getSqlSession().selectList("whp.liquidWasteDispose.WhpLiquidWasteDisposeLogMapper.queryList", s); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/plan/WhpSamplingPlanDao.java b/src/com/sipai/dao/whp/plan/WhpSamplingPlanDao.java deleted file mode 100644 index 21daf2cc..00000000 --- a/src/com/sipai/dao/whp/plan/WhpSamplingPlanDao.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.dao.whp.plan; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.enums.whp.PlanIndexJson; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 采样计划Dao - * - * @Author: 李晨 - * @Date: 2022/12/29 - */ -@Repository -public class WhpSamplingPlanDao extends CommDaoImpl { - public WhpSamplingPlanDao() { - super(); - this.setMappernamespace("whp.plan.WhpSamplingPlanMapper"); - } - - public List queryList(WhpSamplingPlanQuery s) { - return getSqlSession().selectList("whp.plan.WhpSamplingPlanMapper.queryList", s); - - } - -} diff --git a/src/com/sipai/dao/whp/plan/WhpSamplingPlanTaskDao.java b/src/com/sipai/dao/whp/plan/WhpSamplingPlanTaskDao.java deleted file mode 100644 index 9397444c..00000000 --- a/src/com/sipai/dao/whp/plan/WhpSamplingPlanTaskDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.plan; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.enums.whp.PlanIndexJson; import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; import com.sipai.entity.whp.plan.WhpSamplingPlanTaskQuery; import com.sipai.entity.whp.plan.WhpSamplingPlanTask; import org.springframework.stereotype.Repository; import java.util.List; /** * 采样任务Dao * @Author: 李晨 * @Date: 2022/12/30 */ @Repository public class WhpSamplingPlanTaskDao extends CommDaoImpl { public WhpSamplingPlanTaskDao() { super(); this.setMappernamespace("whp.plan.WhpSamplingPlanTaskMapper"); } public List queryList(WhpSamplingPlanTaskQuery s) { return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.queryList", s); } public List sampleUserDropDown() { return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.sampleUserDropDown"); } public List addressDropDown() { return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.addressDropDown"); } public List queryListNoTemplate(WhpSamplingPlanTaskQuery query) { return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.queryListNoTemplate", query); } public void updateStatusByPlanId(WhpSamplingPlanTask bean) { getSqlSession().update("whp.plan.WhpSamplingPlanTaskMapper.updateStatusByPlanId", bean); } public List queryListPlanTj(WhpSamplingPlanQuery s){ return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.selectPlanCount", s); } public List selectItemCount(WhpSamplingPlanQuery s){ return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.selectItemCount", s); } public List selectTypeByDate(WhpSamplingPlanQuery s){ return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.selectTypeByDate", s); } public List selectPlanByDate(WhpSamplingPlanQuery s){ return getSqlSession().selectList("whp.plan.WhpSamplingPlanTaskMapper.selectPlanByDate", s); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/test/WhpSamplingPlanTaskTestConfirmDao.java b/src/com/sipai/dao/whp/test/WhpSamplingPlanTaskTestConfirmDao.java deleted file mode 100644 index 112e339b..00000000 --- a/src/com/sipai/dao/whp/test/WhpSamplingPlanTaskTestConfirmDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.test; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirmQuery; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirmListVo; import org.springframework.stereotype.Repository; import java.util.List; /** * 计划单检测项目分组信息Dao * @Author: 李晨 * @Date: 2023/1/5 */ @Repository public class WhpSamplingPlanTaskTestConfirmDao extends CommDaoImpl { public WhpSamplingPlanTaskTestConfirmDao() { super(); this.setMappernamespace("whp.test.WhpSamplingPlanTaskTestConfirmMapper"); } public List queryList(WhpSamplingPlanTaskTestConfirmQuery s) { return getSqlSession().selectList("whp.test.WhpSamplingPlanTaskTestConfirmMapper.queryList", s); } public List testItemTree(WhpSamplingPlanTaskTestConfirmQuery query) { return getSqlSession().selectList("whp.test.WhpSamplingPlanTaskTestConfirmMapper.testItemTree", query); } public List selectPlanCodeList(WhpSamplingPlanTaskTestConfirm query) { return getSqlSession().selectList("whp.test.WhpSamplingPlanTaskTestConfirmMapper.selectPlanCodeList", query); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/test/WhpSamplingPlanTaskTestItemDao.java b/src/com/sipai/dao/whp/test/WhpSamplingPlanTaskTestItemDao.java deleted file mode 100644 index 715d03c2..00000000 --- a/src/com/sipai/dao/whp/test/WhpSamplingPlanTaskTestItemDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.test; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItemQuery; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItem; import org.springframework.stereotype.Repository; import java.util.List; /** * 计划单检测项目记录Dao * @Author: 李晨 * @Date: 2023/1/5 */ @Repository public class WhpSamplingPlanTaskTestItemDao extends CommDaoImpl { public WhpSamplingPlanTaskTestItemDao() { super(); this.setMappernamespace("whp.test.WhpSamplingPlanTaskTestItemMapper"); } public List queryList(WhpSamplingPlanTaskTestItemQuery s) { return getSqlSession().selectList("whp.test.WhpSamplingPlanTaskTestItemMapper.queryList", s); } public int updateConfirmId(WhpSamplingPlanTaskTestConfirm confirm) { return getSqlSession().update("whp.test.WhpSamplingPlanTaskTestItemMapper.updateConfirmId", confirm); } public int updateStatusByConfirmId(WhpSamplingPlanTaskTestItem confirm) { return getSqlSession().update("whp.test.WhpSamplingPlanTaskTestItemMapper.updateStatusByConfirmId", confirm); } } \ No newline at end of file diff --git a/src/com/sipai/dao/whp/test/WhpTaskItemCurveDao.java b/src/com/sipai/dao/whp/test/WhpTaskItemCurveDao.java deleted file mode 100644 index a1728585..00000000 --- a/src/com/sipai/dao/whp/test/WhpTaskItemCurveDao.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.dao.whp.test; import com.sipai.dao.base.CommDaoImpl; import com.sipai.entity.whp.test.WhpTaskItemCurveQuery; import com.sipai.entity.whp.test.WhpTaskItemCurve; import org.springframework.stereotype.Repository; import java.util.List; /** * 方法依据Dao * @Author: zxq * @Date: 2023/05/15 */ @Repository public class WhpTaskItemCurveDao extends CommDaoImpl { public WhpTaskItemCurveDao() { super(); this.setMappernamespace("whp.test.WhpTaskItemCurveMapper"); } public List queryList(WhpTaskItemCurveQuery s) { return getSqlSession().selectList("whp.test.WhpTaskItemCurveMapper.queryList", s); } } \ No newline at end of file diff --git a/src/com/sipai/dao/work/AlarmTypesDao.java b/src/com/sipai/dao/work/AlarmTypesDao.java deleted file mode 100644 index 7619ca40..00000000 --- a/src/com/sipai/dao/work/AlarmTypesDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.AlarmTypes; -import org.springframework.stereotype.Repository; - -@Repository -public class AlarmTypesDao extends CommDaoImpl { - - public AlarmTypesDao(){ - super(); - this.setMappernamespace("work.AlarmTypesMapper"); - } -} diff --git a/src/com/sipai/dao/work/AreaManageDao.java b/src/com/sipai/dao/work/AreaManageDao.java deleted file mode 100644 index 11fe0194..00000000 --- a/src/com/sipai/dao/work/AreaManageDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.AreaManage; -import org.springframework.stereotype.Repository; - -@Repository -public class AreaManageDao extends CommDaoImpl { - - public AreaManageDao(){ - super(); - this.setMappernamespace("work.AreaManageMapper"); - } -} diff --git a/src/com/sipai/dao/work/AutoAlertDao.java b/src/com/sipai/dao/work/AutoAlertDao.java deleted file mode 100644 index 0f2e44ae..00000000 --- a/src/com/sipai/dao/work/AutoAlertDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.AutoAlert; - -@Repository -public class AutoAlertDao extends CommDaoImpl{ - public AutoAlertDao() { - super(); - this.setMappernamespace("work.AutoAlertMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/CameraDao.java b/src/com/sipai/dao/work/CameraDao.java deleted file mode 100644 index a7eb81e1..00000000 --- a/src/com/sipai/dao/work/CameraDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Camera; - -@Repository -public class CameraDao extends CommDaoImpl{ - public CameraDao() { - super(); - this.setMappernamespace("work.CameraMapper"); - } - public List selectListWithEquByWhere(Camera camera) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithEquByWhere", camera); - return list; - } - public List getCameras(Camera camera){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".getCamera", camera); - return list; - } - public List selecttoponeById(Camera camera){ - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selecttoponeById", camera); - return list; - } -} diff --git a/src/com/sipai/dao/work/CameraDetailDao.java b/src/com/sipai/dao/work/CameraDetailDao.java deleted file mode 100644 index 958ca2fd..00000000 --- a/src/com/sipai/dao/work/CameraDetailDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.CameraDetail; -import com.sipai.entity.work.GroupManage; -import org.springframework.stereotype.Repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class CameraDetailDao extends CommDaoImpl{ - public CameraDetailDao() { - super(); - this.setMappernamespace("work.CameraDetailMapper"); - } -} diff --git a/src/com/sipai/dao/work/CameraFileDao.java b/src/com/sipai/dao/work/CameraFileDao.java deleted file mode 100644 index 05d2de7a..00000000 --- a/src/com/sipai/dao/work/CameraFileDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.CameraFile; - -@Repository -public class CameraFileDao extends CommDaoImpl{ - public CameraFileDao() { - super(); - this.setMappernamespace("work.CameraFileMapper"); - } -} diff --git a/src/com/sipai/dao/work/CameraNVRDao.java b/src/com/sipai/dao/work/CameraNVRDao.java deleted file mode 100644 index c5615169..00000000 --- a/src/com/sipai/dao/work/CameraNVRDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.CameraNVR; -import org.springframework.stereotype.Repository; - -@Repository -public class CameraNVRDao extends CommDaoImpl{ - public CameraNVRDao() { - super(); - this.setMappernamespace("work.CameraNVRMapper"); - } -} diff --git a/src/com/sipai/dao/work/ChannelPortConfigDao.java b/src/com/sipai/dao/work/ChannelPortConfigDao.java deleted file mode 100644 index b93f1232..00000000 --- a/src/com/sipai/dao/work/ChannelPortConfigDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ChannelPortConfig; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ChannelPortConfigDao extends CommDaoImpl{ - public ChannelPortConfigDao(){ - super(); - this.setMappernamespace("work.ChannelPortConfigMapper"); - } - -} diff --git a/src/com/sipai/dao/work/ElectricityMeterDao.java b/src/com/sipai/dao/work/ElectricityMeterDao.java deleted file mode 100644 index 539e105e..00000000 --- a/src/com/sipai/dao/work/ElectricityMeterDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ElectricityMeter; - -@Repository -public class ElectricityMeterDao extends CommDaoImpl{ - public ElectricityMeterDao() { - super(); - this.setMappernamespace("work.ElectricityMeterMapper"); - } -} diff --git a/src/com/sipai/dao/work/GroupContentDao.java b/src/com/sipai/dao/work/GroupContentDao.java deleted file mode 100644 index bae8e9f2..00000000 --- a/src/com/sipai/dao/work/GroupContentDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupContent; - -@Repository -public class GroupContentDao extends CommDaoImpl{ - public GroupContentDao() { - super(); - this.setMappernamespace("work.GroupContentMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupContentFormDao.java b/src/com/sipai/dao/work/GroupContentFormDao.java deleted file mode 100644 index 72d2d5c9..00000000 --- a/src/com/sipai/dao/work/GroupContentFormDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupContentForm; - -@Repository -public class GroupContentFormDao extends CommDaoImpl{ - public GroupContentFormDao() { - super(); - this.setMappernamespace("work.GroupContentFormMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupContentFormDataDao.java b/src/com/sipai/dao/work/GroupContentFormDataDao.java deleted file mode 100644 index 32826aa9..00000000 --- a/src/com/sipai/dao/work/GroupContentFormDataDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupContentFormData; - -@Repository -public class GroupContentFormDataDao extends CommDaoImpl{ - public GroupContentFormDataDao() { - super(); - this.setMappernamespace("work.GroupContentFormDataMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupDao.java b/src/com/sipai/dao/work/GroupDao.java deleted file mode 100644 index 374eb628..00000000 --- a/src/com/sipai/dao/work/GroupDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Group; - -@Repository -public class GroupDao extends CommDaoImpl{ - public GroupDao() { - super(); - this.setMappernamespace("work.GroupMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupDetailDao.java b/src/com/sipai/dao/work/GroupDetailDao.java deleted file mode 100644 index 734a3f0a..00000000 --- a/src/com/sipai/dao/work/GroupDetailDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupDetail; - -@Repository -public class GroupDetailDao extends CommDaoImpl{ - public GroupDetailDao() { - super(); - this.setMappernamespace("work.GroupDetailMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupManageDao.java b/src/com/sipai/dao/work/GroupManageDao.java deleted file mode 100644 index 4d07e821..00000000 --- a/src/com/sipai/dao/work/GroupManageDao.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.dao.work; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupMember; -import com.sipai.entity.work.GroupManage; - -@Repository -public class GroupManageDao extends CommDaoImpl{ - public GroupManageDao() { - super(); - this.setMappernamespace("work.GroupManageMapper"); - } - public int updateDelFlagByWhere(String wherestr){ - Map param= new HashMap(); - param.put("where", wherestr); - return this.getSqlSession().update(getMappernamespace()+".updateDelFlagByWhere", param); - } - public List selectListByDate(String date){ - Map param= new HashMap(); - param.put("date", date); - return this.getSqlSession().selectList(getMappernamespace()+".selectListByDate", param); - } -} diff --git a/src/com/sipai/dao/work/GroupMemberDao.java b/src/com/sipai/dao/work/GroupMemberDao.java deleted file mode 100644 index 700d35f1..00000000 --- a/src/com/sipai/dao/work/GroupMemberDao.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupMember; - -@Repository -public class GroupMemberDao extends CommDaoImpl{ - public GroupMemberDao() { - super(); - this.setMappernamespace("work.GroupMemberMapper"); - } - - public List selectListByGroupId(String groupid){ - return this.getSqlSession().selectList("work.GroupMemberMapper.selectListByGroupId", groupid); - } - - public int deleteByGroupId(String groupid){ - return this.getSqlSession().delete("work.GroupMemberMapper.deleteByGroupId", groupid); - } - - public List selectListByScheduling(String wherestr){ - return this.getSqlSession().selectList("work.GroupMemberMapper.selectListByScheduling", wherestr); - } - - public List getUserid(GroupMember groupmember){ - return this.getSqlSession().selectList("work.GroupMemberMapper.getUserid", groupmember); - } - - public List getLeaderForTree(GroupMember groupmember){ - return this.getSqlSession().selectList("work.GroupMemberMapper.getLeaderForTree", groupmember); - } - - public List getAll(GroupMember groupmember){ - return this.getSqlSession().selectList("work.GroupMemberMapper.getAll", groupmember); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupTimeDao.java b/src/com/sipai/dao/work/GroupTimeDao.java deleted file mode 100644 index d25a913c..00000000 --- a/src/com/sipai/dao/work/GroupTimeDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupTime; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class GroupTimeDao extends CommDaoImpl{ - public GroupTimeDao() { - super(); - this.setMappernamespace("work.GroupTimeMapper"); - } - - public List selectListByDate(String date){ - Map param= new HashMap(); - param.put("date", date); - return this.getSqlSession().selectList(getMappernamespace()+".selectListByDate", param); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/GroupTypeDao.java b/src/com/sipai/dao/work/GroupTypeDao.java deleted file mode 100644 index 15639034..00000000 --- a/src/com/sipai/dao/work/GroupTypeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.GroupType; - -@Repository -public class GroupTypeDao extends CommDaoImpl{ - public GroupTypeDao() { - super(); - this.setMappernamespace("work.GroupTypeMapper"); - } -} diff --git a/src/com/sipai/dao/work/KPIPointDao.java b/src/com/sipai/dao/work/KPIPointDao.java deleted file mode 100644 index ca8df93e..00000000 --- a/src/com/sipai/dao/work/KPIPointDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.KPIPoint; - -@Repository -public class KPIPointDao extends CommDaoImpl{ - public KPIPointDao() { - super(); - this.setMappernamespace("work.KPIPointMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/KPIPointProfessorDao.java b/src/com/sipai/dao/work/KPIPointProfessorDao.java deleted file mode 100644 index a54f7f5c..00000000 --- a/src/com/sipai/dao/work/KPIPointProfessorDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.KPIPointProfessor; - -@Repository -public class KPIPointProfessorDao extends CommDaoImpl{ - public KPIPointProfessorDao() { - super(); - this.setMappernamespace("work.KPIPointProfessorMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/KPIPointProfessorParamDao.java b/src/com/sipai/dao/work/KPIPointProfessorParamDao.java deleted file mode 100644 index abac3bd9..00000000 --- a/src/com/sipai/dao/work/KPIPointProfessorParamDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.KPIPointProfessorParam; - -@Repository -public class KPIPointProfessorParamDao extends CommDaoImpl{ - public KPIPointProfessorParamDao() { - super(); - this.setMappernamespace("work.KPIPointProfessorParamMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/LagerScreenConfigureDao.java b/src/com/sipai/dao/work/LagerScreenConfigureDao.java deleted file mode 100644 index 5180397a..00000000 --- a/src/com/sipai/dao/work/LagerScreenConfigureDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.LagerScreenConfigure; - -@Repository -public class LagerScreenConfigureDao extends CommDaoImpl{ - public LagerScreenConfigureDao() { - super(); - this.setMappernamespace("work.LagerScreenConfigureMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/LagerScreenConfigureDetailDao.java b/src/com/sipai/dao/work/LagerScreenConfigureDetailDao.java deleted file mode 100644 index ffa21bed..00000000 --- a/src/com/sipai/dao/work/LagerScreenConfigureDetailDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.LagerScreenConfigureDetail; - -@Repository -public class LagerScreenConfigureDetailDao extends CommDaoImpl{ - public LagerScreenConfigureDetailDao() { - super(); - this.setMappernamespace("work.LagerScreenConfigureDetailMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/LagerScreenDataDao.java b/src/com/sipai/dao/work/LagerScreenDataDao.java deleted file mode 100644 index c134a1f5..00000000 --- a/src/com/sipai/dao/work/LagerScreenDataDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.LagerScreenData; - -@Repository -public class LagerScreenDataDao extends CommDaoImpl{ - public LagerScreenDataDao() { - super(); - this.setMappernamespace("work.LagerScreenDataMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/MPointHisChangeDataDao.java b/src/com/sipai/dao/work/MPointHisChangeDataDao.java deleted file mode 100644 index df1ae50d..00000000 --- a/src/com/sipai/dao/work/MPointHisChangeDataDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.MPointHisChangeData; - -import java.util.List; - -@Repository -public class MPointHisChangeDataDao extends CommDaoImpl{ - public MPointHisChangeDataDao() { - super(); - this.setMappernamespace("work.MPointHisChangeDataMapper"); - } - - public List selectListByWhereUnionCleaning(MPointHisChangeData mPointHisChangeData){ - return this.getSqlSession().selectList("work.MPointHisChangeDataMapper.selectListByWhereUnionCleaning", mPointHisChangeData); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/MeasurePoint_DATADao.java b/src/com/sipai/dao/work/MeasurePoint_DATADao.java deleted file mode 100644 index a576bfec..00000000 --- a/src/com/sipai/dao/work/MeasurePoint_DATADao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.MeasurePoint_DATA; - -@Repository -public class MeasurePoint_DATADao extends CommDaoImpl{ - public MeasurePoint_DATADao() { - super(); - this.setMappernamespace("work.MeasurePoint_DATAMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ModbusConfigDao.java b/src/com/sipai/dao/work/ModbusConfigDao.java deleted file mode 100644 index db697470..00000000 --- a/src/com/sipai/dao/work/ModbusConfigDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ModbusConfig; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ModbusConfigDao extends CommDaoImpl { - - public ModbusConfigDao() { - super(); - this.setMappernamespace("work.ModbusConfigMapper"); - } - -} diff --git a/src/com/sipai/dao/work/ModbusFigDao.java b/src/com/sipai/dao/work/ModbusFigDao.java deleted file mode 100644 index 2051a36e..00000000 --- a/src/com/sipai/dao/work/ModbusFigDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ModbusFig; - -@Repository -public class ModbusFigDao extends CommDaoImpl{ - public ModbusFigDao() { - super(); - this.setMappernamespace("work.ModbusFigMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ModbusInterfaceDao.java b/src/com/sipai/dao/work/ModbusInterfaceDao.java deleted file mode 100644 index dc0362d0..00000000 --- a/src/com/sipai/dao/work/ModbusInterfaceDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ModbusInterface; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ModbusInterfaceDao extends CommDaoImpl { - - public ModbusInterfaceDao() { - super(); - this.setMappernamespace("work.ModbusInterfaceMapper"); - } - -} diff --git a/src/com/sipai/dao/work/ModbusPointDao.java b/src/com/sipai/dao/work/ModbusPointDao.java deleted file mode 100644 index d3bd1e97..00000000 --- a/src/com/sipai/dao/work/ModbusPointDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ModbusPoint; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -@Repository -public class ModbusPointDao extends CommDaoImpl { - - public ModbusPointDao() { - super(); - this.setMappernamespace("work.ModbusPointMapper"); - } -} diff --git a/src/com/sipai/dao/work/ModbusRecordDao.java b/src/com/sipai/dao/work/ModbusRecordDao.java deleted file mode 100644 index 3a2c345e..00000000 --- a/src/com/sipai/dao/work/ModbusRecordDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ModbusFig; -import com.sipai.entity.work.ModbusRecord; - -@Repository -public class ModbusRecordDao extends CommDaoImpl{ - public ModbusRecordDao() { - super(); - this.setMappernamespace("work.ModbusRecordMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ProductionIndexDataDao.java b/src/com/sipai/dao/work/ProductionIndexDataDao.java deleted file mode 100644 index a8849855..00000000 --- a/src/com/sipai/dao/work/ProductionIndexDataDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ProductionIndexData; -import com.sipai.entity.work.ProductionIndexData; - -@Repository -public class ProductionIndexDataDao extends CommDaoImpl{ - public ProductionIndexDataDao() { - super(); - this.setMappernamespace("work.ProductionIndexDataMapper"); - } - - public List selectListByLineCWhere(ProductionIndexData productionIndexData){ - return this.getSqlSession().selectList("work.ProductionIndexDataMapper.selectListByLineCWhere", productionIndexData); - } - - public List selectAvgByLineCWhere(ProductionIndexData productionIndexData){ - return this.getSqlSession().selectList("work.ProductionIndexDataMapper.selectAvgByLineCWhere", productionIndexData); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ProductionIndexPlanNameConfigureDao.java b/src/com/sipai/dao/work/ProductionIndexPlanNameConfigureDao.java deleted file mode 100644 index 2eb36447..00000000 --- a/src/com/sipai/dao/work/ProductionIndexPlanNameConfigureDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; - -@Repository -public class ProductionIndexPlanNameConfigureDao extends CommDaoImpl{ - public ProductionIndexPlanNameConfigureDao() { - super(); - this.setMappernamespace("work.ProductionIndexPlanNameConfigureMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ProductionIndexPlanNameDataDao.java b/src/com/sipai/dao/work/ProductionIndexPlanNameDataDao.java deleted file mode 100644 index 8120a98d..00000000 --- a/src/com/sipai/dao/work/ProductionIndexPlanNameDataDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ProductionIndexPlanNameData; - -@Repository -public class ProductionIndexPlanNameDataDao extends CommDaoImpl{ - public ProductionIndexPlanNameDataDao() { - super(); - this.setMappernamespace("work.ProductionIndexPlanNameDataMapper"); - } - - public List selectListByLineCWhere(ProductionIndexPlanNameData productionIndexPlanNameData){ - return this.getSqlSession().selectList("work.ProductionIndexPlanNameDataMapper.selectListByLineCWhere", productionIndexPlanNameData); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ProductionIndexPlanNameDataHisDao.java b/src/com/sipai/dao/work/ProductionIndexPlanNameDataHisDao.java deleted file mode 100644 index 281558b9..00000000 --- a/src/com/sipai/dao/work/ProductionIndexPlanNameDataHisDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ProductionIndexPlanNameDataHis; - -@Repository -public class ProductionIndexPlanNameDataHisDao extends CommDaoImpl{ - public ProductionIndexPlanNameDataHisDao() { - super(); - this.setMappernamespace("work.ProductionIndexPlanNameDataHisMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ProductionIndexWorkOrderDao.java b/src/com/sipai/dao/work/ProductionIndexWorkOrderDao.java deleted file mode 100644 index a752166f..00000000 --- a/src/com/sipai/dao/work/ProductionIndexWorkOrderDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ProductionIndexWorkOrder; - -@Repository -public class ProductionIndexWorkOrderDao extends CommDaoImpl{ - public ProductionIndexWorkOrderDao() { - super(); - this.setMappernamespace("work.ProductionIndexWorkOrderMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ScadaPicDao.java b/src/com/sipai/dao/work/ScadaPicDao.java deleted file mode 100644 index 3aae267e..00000000 --- a/src/com/sipai/dao/work/ScadaPicDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ScadaPic; -import com.sipai.entity.work.ScadaPic_ProcessSection; - -@Repository -public class ScadaPicDao extends CommDaoImpl{ - public ScadaPicDao() { - super(); - this.setMappernamespace("work.ScadaPicMapper"); - } - - public List selectListForPSection(ScadaPic scadaPic) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListForPSection", scadaPic); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ScadaPic_EMDao.java b/src/com/sipai/dao/work/ScadaPic_EMDao.java deleted file mode 100644 index 7c58a285..00000000 --- a/src/com/sipai/dao/work/ScadaPic_EMDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.ScadaPic_EM; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.entity.work.ScadaPic_Txt; - -@Repository -public class ScadaPic_EMDao extends CommDaoImpl{ - public ScadaPic_EMDao() { - super(); - this.setMappernamespace("work.ScadaPic_EMMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ScadaPic_MPointDao.java b/src/com/sipai/dao/work/ScadaPic_MPointDao.java deleted file mode 100644 index c344d402..00000000 --- a/src/com/sipai/dao/work/ScadaPic_MPointDao.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.entity.work.ScadaPic_Txt; - -@Repository -public class ScadaPic_MPointDao extends CommDaoImpl{ - public ScadaPic_MPointDao() { - super(); - this.setMappernamespace("work.ScadaPic_MPointMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ScadaPic_MPoint_ExpressionDao.java b/src/com/sipai/dao/work/ScadaPic_MPoint_ExpressionDao.java deleted file mode 100644 index 2c899b89..00000000 --- a/src/com/sipai/dao/work/ScadaPic_MPoint_ExpressionDao.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.entity.work.ScadaPic_MPoint_Expression; -import com.sipai.entity.work.ScadaPic_Txt; - -@Repository -public class ScadaPic_MPoint_ExpressionDao extends CommDaoImpl{ - public ScadaPic_MPoint_ExpressionDao() { - super(); - this.setMappernamespace("work.ScadaPic_MPoint_ExpressionMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ScadaPic_ProcessSectionDao.java b/src/com/sipai/dao/work/ScadaPic_ProcessSectionDao.java deleted file mode 100644 index 59f6b62d..00000000 --- a/src/com/sipai/dao/work/ScadaPic_ProcessSectionDao.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.ScadaPic_ProcessSection; - - -@Repository -public class ScadaPic_ProcessSectionDao extends CommDaoImpl{ - public ScadaPic_ProcessSectionDao() { - super(); - this.setMappernamespace("work.ScadaPic_ProcessSectionMapper"); - } - public List selectListWithNameByWhere(ScadaPic_ProcessSection scadaPic_ProcessSection) { - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListWithNameByWhere", scadaPic_ProcessSection); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/ScadaPic_TxtDao.java b/src/com/sipai/dao/work/ScadaPic_TxtDao.java deleted file mode 100644 index 787b4b64..00000000 --- a/src/com/sipai/dao/work/ScadaPic_TxtDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.ScadaPic_Txt; - -@Repository -public class ScadaPic_TxtDao extends CommDaoImpl{ - public ScadaPic_TxtDao() { - super(); - this.setMappernamespace("work.ScadaPic_TxtMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/SchedulingDao.java b/src/com/sipai/dao/work/SchedulingDao.java deleted file mode 100644 index 8406d0de..00000000 --- a/src/com/sipai/dao/work/SchedulingDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.dao.work; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Scheduling; - -@Repository -public class SchedulingDao extends CommDaoImpl{ - public SchedulingDao() { - super(); - this.setMappernamespace("work.SchedulingMapper"); - } - - public List selectCalenderListByWhere(String wherestr){ - Map paramMap=new HashMap<>(); - paramMap.put("where",wherestr); - List scheduling = this.getSqlSession().selectList("work.SchedulingMapper.selectCalenderListByWhere", paramMap); - return scheduling; - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/SchedulingReplaceJobDao.java b/src/com/sipai/dao/work/SchedulingReplaceJobDao.java deleted file mode 100644 index df828c54..00000000 --- a/src/com/sipai/dao/work/SchedulingReplaceJobDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.work; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.SchedulingReplaceJob; - -@Repository -public class SchedulingReplaceJobDao extends CommDaoImpl{ - public SchedulingReplaceJobDao() { - super(); - this.setMappernamespace("work.SchedulingReplaceJobMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/SpeechRecognitionDao.java b/src/com/sipai/dao/work/SpeechRecognitionDao.java deleted file mode 100644 index 8f5e74d3..00000000 --- a/src/com/sipai/dao/work/SpeechRecognitionDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.SpeechRecognition; - -@Repository -public class SpeechRecognitionDao extends CommDaoImpl{ - public SpeechRecognitionDao() { - super(); - this.setMappernamespace("work.SpeechRecognitionMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/SpeechRecognitionMpRespondDao.java b/src/com/sipai/dao/work/SpeechRecognitionMpRespondDao.java deleted file mode 100644 index 1cb14d58..00000000 --- a/src/com/sipai/dao/work/SpeechRecognitionMpRespondDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.SpeechRecognitionMpRespond; - -@Repository -public class SpeechRecognitionMpRespondDao extends CommDaoImpl{ - public SpeechRecognitionMpRespondDao(){ - super(); - this.setMappernamespace("work.SpeechRecognitionMpRespondMapper"); - } - -} diff --git a/src/com/sipai/dao/work/UserWorkStationDao.java b/src/com/sipai/dao/work/UserWorkStationDao.java deleted file mode 100644 index d5c5521f..00000000 --- a/src/com/sipai/dao/work/UserWorkStationDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.UserWorkStation; - -@Repository -public class UserWorkStationDao extends CommDaoImpl{ - public UserWorkStationDao() { - super(); - this.setMappernamespace("work.UserWorkStationMapper"); - } -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WeatherDao.java b/src/com/sipai/dao/work/WeatherDao.java deleted file mode 100644 index 07485f97..00000000 --- a/src/com/sipai/dao/work/WeatherDao.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.dao.work; - -import java.util.List; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.Weather; - -@Repository -public class WeatherDao extends CommDaoImpl{ - public WeatherDao() { - super(); - this.setMappernamespace("work.WeatherMapper"); - } - - public List getownsql(Weather weather){ - return this.getSqlSession().selectList("work.WeatherMapper.getownsql", weather); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WeatherNewDao.java b/src/com/sipai/dao/work/WeatherNewDao.java deleted file mode 100644 index 7379413a..00000000 --- a/src/com/sipai/dao/work/WeatherNewDao.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WeatherNew; - -import java.util.List; - -@Repository -public class WeatherNewDao extends CommDaoImpl { - public WeatherNewDao() { - super(); - this.setMappernamespace("work.WeatherNewMapper"); - } - - public List selectTop1ListByWhere(WeatherNew entity) { - List list = this.getSqlSession().selectList("work.WeatherNewMapper.selectTop1ListByWhere", entity); - return list; - } - - public int updateByTimeSelective(WeatherNew t) { - this.getSqlSession().selectList("work.WeatherNewMapper.updateByTimeSelective", t); - return 0; - } - public int deleteAllByWhere(String where) { - WeatherNew t = new WeatherNew(); - t.setWhere(where); - this.getSqlSession().selectList("work.WeatherNewMapper.deleteByWhere", t); - return 0; - } -} diff --git a/src/com/sipai/dao/work/WeatherSaveNameDao.java b/src/com/sipai/dao/work/WeatherSaveNameDao.java deleted file mode 100644 index 99b1e52c..00000000 --- a/src/com/sipai/dao/work/WeatherSaveNameDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WeatherSaveName; -import org.springframework.stereotype.Repository; - -@Repository -public class WeatherSaveNameDao extends CommDaoImpl { - - public WeatherSaveNameDao() { - super(); - this.setMappernamespace("work.WeatherSaveNameMapper"); - } - -} diff --git a/src/com/sipai/dao/work/WordAnalysisReportContentCurveAxisDao.java b/src/com/sipai/dao/work/WordAnalysisReportContentCurveAxisDao.java deleted file mode 100644 index 35413740..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportContentCurveAxisDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportContentCurveAxis; - -@Repository -public class WordAnalysisReportContentCurveAxisDao extends CommDaoImpl{ - public WordAnalysisReportContentCurveAxisDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportContentCurveAxisMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportContentCurveDao.java b/src/com/sipai/dao/work/WordAnalysisReportContentCurveDao.java deleted file mode 100644 index d6b3bfe4..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportContentCurveDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportContentCurve; - -@Repository -public class WordAnalysisReportContentCurveDao extends CommDaoImpl{ - public WordAnalysisReportContentCurveDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportContentCurveMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportContentDao.java b/src/com/sipai/dao/work/WordAnalysisReportContentDao.java deleted file mode 100644 index 68d2315e..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportContentDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportContent; - -@Repository -public class WordAnalysisReportContentDao extends CommDaoImpl{ - public WordAnalysisReportContentDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportContentMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportContentFormDao.java b/src/com/sipai/dao/work/WordAnalysisReportContentFormDao.java deleted file mode 100644 index 647a9b14..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportContentFormDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportContentForm; - -@Repository -public class WordAnalysisReportContentFormDao extends CommDaoImpl{ - public WordAnalysisReportContentFormDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportContentFormMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportFormDataDao.java b/src/com/sipai/dao/work/WordAnalysisReportFormDataDao.java deleted file mode 100644 index 170e123f..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportFormDataDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportFormData; - -@Repository -public class WordAnalysisReportFormDataDao extends CommDaoImpl{ - public WordAnalysisReportFormDataDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportFormDataMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportRecordDao.java b/src/com/sipai/dao/work/WordAnalysisReportRecordDao.java deleted file mode 100644 index 04eb3a5c..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportRecordDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportRecord; - -@Repository -public class WordAnalysisReportRecordDao extends CommDaoImpl{ - public WordAnalysisReportRecordDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportRecordMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportStructureDao.java b/src/com/sipai/dao/work/WordAnalysisReportStructureDao.java deleted file mode 100644 index 8d324815..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportStructureDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportStructure; - -@Repository -public class WordAnalysisReportStructureDao extends CommDaoImpl{ - public WordAnalysisReportStructureDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportStructureMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/work/WordAnalysisReportTextDao.java b/src/com/sipai/dao/work/WordAnalysisReportTextDao.java deleted file mode 100644 index 16dafef1..00000000 --- a/src/com/sipai/dao/work/WordAnalysisReportTextDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.work; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.work.WordAnalysisReportText; - -@Repository -public class WordAnalysisReportTextDao extends CommDaoImpl{ - public WordAnalysisReportTextDao() { - super(); - this.setMappernamespace("work.WordAnalysisReportTextMapper"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/dao/workorder/OverhaulDao.java b/src/com/sipai/dao/workorder/OverhaulDao.java deleted file mode 100644 index 63ccd1df..00000000 --- a/src/com/sipai/dao/workorder/OverhaulDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.Overhaul; -import org.springframework.stereotype.Repository; - -@Repository -public class OverhaulDao extends CommDaoImpl { - public OverhaulDao() { - super(); - this.setMappernamespace("workorder.OverhaulMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/OverhaulItemContentDao.java b/src/com/sipai/dao/workorder/OverhaulItemContentDao.java deleted file mode 100644 index 1a38ba8a..00000000 --- a/src/com/sipai/dao/workorder/OverhaulItemContentDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.OverhaulItemContent; -import org.springframework.stereotype.Repository; - -@Repository -public class OverhaulItemContentDao extends CommDaoImpl { - public OverhaulItemContentDao() { - super(); - this.setMappernamespace("workorder.OverhaulItemContentMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/OverhaulItemEquipmentDao.java b/src/com/sipai/dao/workorder/OverhaulItemEquipmentDao.java deleted file mode 100644 index 332b8ca6..00000000 --- a/src/com/sipai/dao/workorder/OverhaulItemEquipmentDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.OverhaulItemEquipment; -import org.springframework.stereotype.Repository; - -/** - * @author chiliz - * @date 2021-11-16 15:55:09 - * @description: TODO - */ -@Repository -public class OverhaulItemEquipmentDao extends CommDaoImpl { - public OverhaulItemEquipmentDao() { - super(); - this.setMappernamespace("workorder.OverhaulItemEquipmentMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/OverhaulItemEquipmentSlaveDao.java b/src/com/sipai/dao/workorder/OverhaulItemEquipmentSlaveDao.java deleted file mode 100644 index c40c1fae..00000000 --- a/src/com/sipai/dao/workorder/OverhaulItemEquipmentSlaveDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.OverhaulStatistics; -import org.springframework.stereotype.Repository; - -/** - * @author chiliz - * @date 2021-11-29 10:03:32 - * @description: TODO - */ -@Repository -public class OverhaulItemEquipmentSlaveDao extends CommDaoImpl { - public OverhaulItemEquipmentSlaveDao() { - super(); - this.setMappernamespace("workorder.OverhaulStatisticsMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/OverhaulItemProjectDao.java b/src/com/sipai/dao/workorder/OverhaulItemProjectDao.java deleted file mode 100644 index ccfd699e..00000000 --- a/src/com/sipai/dao/workorder/OverhaulItemProjectDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.OverhaulItemProject; -import org.springframework.stereotype.Repository; - -@Repository -public class OverhaulItemProjectDao extends CommDaoImpl { - public OverhaulItemProjectDao() { - super(); - this.setMappernamespace("workorder.OverhaulItemProjectMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/OverhaulStatisticsDao.java b/src/com/sipai/dao/workorder/OverhaulStatisticsDao.java deleted file mode 100644 index 3fbad81d..00000000 --- a/src/com/sipai/dao/workorder/OverhaulStatisticsDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.OverhaulStatistics; -import org.springframework.stereotype.Repository; - -@Repository -public class OverhaulStatisticsDao extends CommDaoImpl { - public OverhaulStatisticsDao() { - super(); - this.setMappernamespace("workorder.OverhaulStatisticsMapper"); - } - -} diff --git a/src/com/sipai/dao/workorder/OverhaulTypeDao.java b/src/com/sipai/dao/workorder/OverhaulTypeDao.java deleted file mode 100644 index be1a35d8..00000000 --- a/src/com/sipai/dao/workorder/OverhaulTypeDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.OverhaulType; -import org.springframework.stereotype.Repository; - -@Repository -public class OverhaulTypeDao extends CommDaoImpl { - public OverhaulTypeDao() { - super(); - this.setMappernamespace("workorder.OverhaulTypeMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/WorkorderAchievementDao.java b/src/com/sipai/dao/workorder/WorkorderAchievementDao.java deleted file mode 100644 index 9b64b699..00000000 --- a/src/com/sipai/dao/workorder/WorkorderAchievementDao.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.dao.workorder; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.sipai.entity.workorder.WorkTimeRespDto; -import com.sipai.entity.workorder.WorkUserTimeRespDto; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.workorder.WorkorderAchievement; - -@Repository -public class WorkorderAchievementDao extends CommDaoImpl{ - public WorkorderAchievementDao() { - super(); - this.setMappernamespace("maintenance.WorkorderAchievementMapper"); - } - public List WorkTimeTotal(String where){ - List one= getSqlSession().selectList("maintenance.WorkorderAchievementMapper.WorkTimeTotal", where); - return one; - } - - public List selectDistinctWorkTimeByWhere(String where) { - Map map = new HashMap(); - map.put("where",where); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectDistinctWorkTimeByWhere", map); - return list; - } - - public List selectByWhere4WorkorderDetail(String where) { - Map map = new HashMap(); - map.put("where",where); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectByWhere4WorkorderDetail", map); - return list; - } - - public List selectByWhere4PatrolRecord(String where) { - Map map = new HashMap(); - map.put("where",where); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectByWhere4PatrolRecord", map); - return list; - } - public List selectByWhereSumWorkTimeByWhere(String where, String startTime, String endTime) { - Map map = new HashMap(); - map.put("where",where); - map.put("startTime",startTime); - map.put("endTime",endTime); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectByWhereSumWorkTimeByWhere", map); - return list; - } - - public WorkUserTimeRespDto selectUserOneByWhereSumWorkTimeByWhere(String where, String startTime, String endTime) { - Map map = new HashMap(); - map.put("where",where); - map.put("startTime",startTime); - map.put("endTime",endTime); - WorkUserTimeRespDto workUserTimeRespDto = this.getSqlSession().selectOne(this.getMappernamespace()+".selectUserOneByWhereSumWorkTimeByWhere", map); - return workUserTimeRespDto; - } - -} diff --git a/src/com/sipai/dao/workorder/WorkorderAchievementOrderDao.java b/src/com/sipai/dao/workorder/WorkorderAchievementOrderDao.java deleted file mode 100644 index f4dcef45..00000000 --- a/src/com/sipai/dao/workorder/WorkorderAchievementOrderDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.dao.workorder; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.WorkorderAchievementOrder; - -@Repository -public class WorkorderAchievementOrderDao extends CommDaoImpl{ - - public WorkorderAchievementOrderDao(){ - super(); - this.setMappernamespace("workorder.WorkorderAchievementOrderMapper"); - } - -} diff --git a/src/com/sipai/dao/workorder/WorkorderConsumeDao.java b/src/com/sipai/dao/workorder/WorkorderConsumeDao.java deleted file mode 100644 index 98ea974f..00000000 --- a/src/com/sipai/dao/workorder/WorkorderConsumeDao.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.dao.workorder; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.WorkorderConsume; - -@Repository -public class WorkorderConsumeDao extends CommDaoImpl{ - public WorkorderConsumeDao() { - super(); - this.setMappernamespace("workorder.WorkorderConsumeMapper"); - } -} diff --git a/src/com/sipai/dao/workorder/WorkorderDetailDao.java b/src/com/sipai/dao/workorder/WorkorderDetailDao.java deleted file mode 100644 index 7ea2ade1..00000000 --- a/src/com/sipai/dao/workorder/WorkorderDetailDao.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.dao.workorder; - -import com.sipai.entity.timeefficiency.PatrolRecord; -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.WorkorderDetail; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class WorkorderDetailDao extends CommDaoImpl { - - public WorkorderDetailDao() { - super(); - this.setMappernamespace("workorder.WorkorderDetailMapper"); - } - - public List selectForAchievementWork(String where) { - Map map = new HashMap(); - map.put("where", where); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectForAchievementWork", map); - return list; - } - - public List selectDistinctWorkTimeByWhere(String where) { - Map map = new HashMap(); - map.put("where", where); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectDistinctWorkTimeByWhere", map); - return list; - } - - - public List selectListByWhereWithE(String where) { - Map map = new HashMap(); - map.put("where", where); - List list = this.getSqlSession().selectList(this.getMappernamespace() + ".selectListByWhereWithE", map); - return list; - } - - public List selectListByNum(String where, String str) { - Map map = new HashMap(); - map.put("where",where); - map.put("str",str); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectListByNum", map); - return list; - } - - public List selectCountByWhere(String where) { - Map map = new HashMap(); - map.put("where",where); - List list = this.getSqlSession().selectList(this.getMappernamespace()+".selectCountByWhere", map); - return list; - } - -} diff --git a/src/com/sipai/dao/workorder/WorkorderRepairContentDao.java b/src/com/sipai/dao/workorder/WorkorderRepairContentDao.java deleted file mode 100644 index fe2d5e2a..00000000 --- a/src/com/sipai/dao/workorder/WorkorderRepairContentDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.dao.workorder; - -import org.springframework.stereotype.Repository; - -import com.sipai.dao.base.CommDaoImpl; -import com.sipai.entity.workorder.WorkorderRepairContent; -@Repository -public class WorkorderRepairContentDao extends CommDaoImpl{ - - public WorkorderRepairContentDao(){ - super(); - this.setMappernamespace("workorder.WorkorderRepairContentMapper"); - } - -} diff --git a/src/com/sipai/emsg/Mo.java b/src/com/sipai/emsg/Mo.java deleted file mode 100644 index c7f9587e..00000000 --- a/src/com/sipai/emsg/Mo.java +++ /dev/null @@ -1,307 +0,0 @@ -/** - * Mo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package com.sipai.emsg; - -import java.io.Serializable; - -public class Mo implements Serializable { - private java.lang.String addSerial; - - private java.lang.String addSerialRev; - - private java.lang.String channelnumber; - - private java.lang.String mobileNumber; - - private java.lang.String sentTime; - - private java.lang.String smsContent; - - public Mo() { - } - - public Mo( - java.lang.String addSerial, - java.lang.String addSerialRev, - java.lang.String channelnumber, - java.lang.String mobileNumber, - java.lang.String sentTime, - java.lang.String smsContent) { - this.addSerial = addSerial; - this.addSerialRev = addSerialRev; - this.channelnumber = channelnumber; - this.mobileNumber = mobileNumber; - this.sentTime = sentTime; - this.smsContent = smsContent; - } - - - /** - * Gets the addSerial value for this Mo. - * - * @return addSerial - */ - public String getAddSerial() { - return addSerial; - } - - - /** - * Sets the addSerial value for this Mo. - * - * @param addSerial - */ - public void setAddSerial(String addSerial) { - this.addSerial = addSerial; - } - - - /** - * Gets the addSerialRev value for this Mo. - * - * @return addSerialRev - */ - public String getAddSerialRev() { - return addSerialRev; - } - - - /** - * Sets the addSerialRev value for this Mo. - * - * @param addSerialRev - */ - public void setAddSerialRev(String addSerialRev) { - this.addSerialRev = addSerialRev; - } - - - /** - * Gets the channelnumber value for this Mo. - * - * @return channelnumber - */ - public String getChannelnumber() { - return channelnumber; - } - - - /** - * Sets the channelnumber value for this Mo. - * - * @param channelnumber - */ - public void setChannelnumber(String channelnumber) { - this.channelnumber = channelnumber; - } - - - /** - * Gets the mobileNumber value for this Mo. - * - * @return mobileNumber - */ - public String getMobileNumber() { - return mobileNumber; - } - - - /** - * Sets the mobileNumber value for this Mo. - * - * @param mobileNumber - */ - public void setMobileNumber(String mobileNumber) { - this.mobileNumber = mobileNumber; - } - - - /** - * Gets the sentTime value for this Mo. - * - * @return sentTime - */ - public String getSentTime() { - return sentTime; - } - - - /** - * Sets the sentTime value for this Mo. - * - * @param sentTime - */ - public void setSentTime(String sentTime) { - this.sentTime = sentTime; - } - - - /** - * Gets the smsContent value for this Mo. - * - * @return smsContent - */ - public String getSmsContent() { - return smsContent; - } - - - /** - * Sets the smsContent value for this Mo. - * - * @param smsContent - */ - public void setSmsContent(String smsContent) { - this.smsContent = smsContent; - } - - private Object __equalsCalc = null; - public synchronized boolean equals(Object obj) { - if (!(obj instanceof Mo)) return false; - Mo other = (Mo) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.addSerial==null && other.getAddSerial()==null) || - (this.addSerial!=null && - this.addSerial.equals(other.getAddSerial()))) && - ((this.addSerialRev==null && other.getAddSerialRev()==null) || - (this.addSerialRev!=null && - this.addSerialRev.equals(other.getAddSerialRev()))) && - ((this.channelnumber==null && other.getChannelnumber()==null) || - (this.channelnumber!=null && - this.channelnumber.equals(other.getChannelnumber()))) && - ((this.mobileNumber==null && other.getMobileNumber()==null) || - (this.mobileNumber!=null && - this.mobileNumber.equals(other.getMobileNumber()))) && - ((this.sentTime==null && other.getSentTime()==null) || - (this.sentTime!=null && - this.sentTime.equals(other.getSentTime()))) && - ((this.smsContent==null && other.getSmsContent()==null) || - (this.smsContent!=null && - this.smsContent.equals(other.getSmsContent()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getAddSerial() != null) { - _hashCode += getAddSerial().hashCode(); - } - if (getAddSerialRev() != null) { - _hashCode += getAddSerialRev().hashCode(); - } - if (getChannelnumber() != null) { - _hashCode += getChannelnumber().hashCode(); - } - if (getMobileNumber() != null) { - _hashCode += getMobileNumber().hashCode(); - } - if (getSentTime() != null) { - _hashCode += getSentTime().hashCode(); - } - if (getSmsContent() != null) { - _hashCode += getSmsContent().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(Mo.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "mo")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("addSerial"); - elemField.setXmlName(new javax.xml.namespace.QName("", "addSerial")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("addSerialRev"); - elemField.setXmlName(new javax.xml.namespace.QName("", "addSerialRev")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("channelnumber"); - elemField.setXmlName(new javax.xml.namespace.QName("", "channelnumber")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("mobileNumber"); - elemField.setXmlName(new javax.xml.namespace.QName("", "mobileNumber")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("sentTime"); - elemField.setXmlName(new javax.xml.namespace.QName("", "sentTime")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("smsContent"); - elemField.setXmlName(new javax.xml.namespace.QName("", "smsContent")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/src/com/sipai/emsg/SDKClient.java b/src/com/sipai/emsg/SDKClient.java deleted file mode 100644 index 8ce745fc..00000000 --- a/src/com/sipai/emsg/SDKClient.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * SDKClient.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package com.sipai.emsg; - -public interface SDKClient extends java.rmi.Remote { - public java.lang.String getVersion() throws java.rmi.RemoteException; - public com.sipai.emsg.StatusReport[] getReport(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException; - public int cancelMOForward(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException; - public int chargeUp(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException; - public double getBalance(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException; - public double getEachFee(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException; - public com.sipai.emsg.Mo[] getMO(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException; - public int logout(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException; - public int registDetailInfo(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, java.lang.String arg7, java.lang.String arg8, java.lang.String arg9) throws java.rmi.RemoteException; - public int registEx(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException; - public int sendSMS(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String[] arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, int arg7, long arg8) throws java.rmi.RemoteException; - public java.lang.String sendVoice(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String[] arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, int arg7, long arg8) throws java.rmi.RemoteException; - public int serialPwdUpd(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException; - public int setMOForward(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException; - public int setMOForwardEx(java.lang.String arg0, java.lang.String arg1, java.lang.String[] arg2) throws java.rmi.RemoteException; -} diff --git a/src/com/sipai/emsg/SDKClientProxy.java b/src/com/sipai/emsg/SDKClientProxy.java deleted file mode 100644 index 4cbef281..00000000 --- a/src/com/sipai/emsg/SDKClientProxy.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.emsg; - -public class SDKClientProxy implements com.sipai.emsg.SDKClient { - private String _endpoint = null; - private com.sipai.emsg.SDKClient sDKClient = null; - - public SDKClientProxy() { - _initSDKClientProxy(); - } - - public SDKClientProxy(String endpoint) { - _endpoint = endpoint; - _initSDKClientProxy(); - } - - private void _initSDKClientProxy() { - try { - sDKClient = (new com.sipai.emsg.SDKServiceLocator()).getSDKService(); - if (sDKClient != null) { - if (_endpoint != null) - ((javax.xml.rpc.Stub)sDKClient)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - else - _endpoint = (String)((javax.xml.rpc.Stub)sDKClient)._getProperty("javax.xml.rpc.service.endpoint.address"); - } - - } - catch (javax.xml.rpc.ServiceException serviceException) {} - } - - public String getEndpoint() { - return _endpoint; - } - - public void setEndpoint(String endpoint) { - _endpoint = endpoint; - if (sDKClient != null) - ((javax.xml.rpc.Stub)sDKClient)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - - } - - public com.sipai.emsg.SDKClient getSDKClient() { - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient; - } - - public java.lang.String getVersion() throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.getVersion(); - } - - public com.sipai.emsg.StatusReport[] getReport(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.getReport(arg0, arg1); - } - - public int cancelMOForward(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.cancelMOForward(arg0, arg1); - } - - public int chargeUp(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.chargeUp(arg0, arg1, arg2, arg3); - } - - public double getBalance(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.getBalance(arg0, arg1); - } - - public double getEachFee(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.getEachFee(arg0, arg1); - } - - public com.sipai.emsg.Mo[] getMO(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.getMO(arg0, arg1); - } - - public int logout(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.logout(arg0, arg1); - } - - public int registDetailInfo(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, java.lang.String arg7, java.lang.String arg8, java.lang.String arg9) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.registDetailInfo(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); - } - - public int registEx(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.registEx(arg0, arg1, arg2); - } - - public int sendSMS(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String[] arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, int arg7, long arg8) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.sendSMS(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); - } - - public java.lang.String sendVoice(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String[] arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, int arg7, long arg8) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.sendVoice(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); - } - - public int serialPwdUpd(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.serialPwdUpd(arg0, arg1, arg2, arg3); - } - - public int setMOForward(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.setMOForward(arg0, arg1, arg2); - } - - public int setMOForwardEx(java.lang.String arg0, java.lang.String arg1, java.lang.String[] arg2) throws java.rmi.RemoteException{ - if (sDKClient == null) - _initSDKClientProxy(); - return sDKClient.setMOForwardEx(arg0, arg1, arg2); - } - - -} \ No newline at end of file diff --git a/src/com/sipai/emsg/SDKService.java b/src/com/sipai/emsg/SDKService.java deleted file mode 100644 index 7cf10e39..00000000 --- a/src/com/sipai/emsg/SDKService.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * SDKService.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package com.sipai.emsg; - -public interface SDKService extends javax.xml.rpc.Service { - public java.lang.String getSDKServiceAddress(); - - public com.sipai.emsg.SDKClient getSDKService() throws javax.xml.rpc.ServiceException; - - public com.sipai.emsg.SDKClient getSDKService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; -} diff --git a/src/com/sipai/emsg/SDKServiceBindingStub.java b/src/com/sipai/emsg/SDKServiceBindingStub.java deleted file mode 100644 index b418f4c8..00000000 --- a/src/com/sipai/emsg/SDKServiceBindingStub.java +++ /dev/null @@ -1,976 +0,0 @@ -/** - * SDKServiceBindingStub.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package com.sipai.emsg; - -public class SDKServiceBindingStub extends org.apache.axis.client.Stub implements com.sipai.emsg.SDKClient { - private java.util.Vector cachedSerClasses = new java.util.Vector(); - private java.util.Vector cachedSerQNames = new java.util.Vector(); - private java.util.Vector cachedSerFactories = new java.util.Vector(); - private java.util.Vector cachedDeserFactories = new java.util.Vector(); - - static org.apache.axis.description.OperationDesc [] _operations; - - static { - _operations = new org.apache.axis.description.OperationDesc[15]; - _initOperationDesc1(); - _initOperationDesc2(); - } - - private static void _initOperationDesc1(){ - org.apache.axis.description.OperationDesc oper; - org.apache.axis.description.ParameterDesc param; - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getVersion"); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - oper.setReturnClass(java.lang.String.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[0] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getReport"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "statusReport")); - oper.setReturnClass(com.sipai.emsg.StatusReport[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[1] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("cancelMOForward"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[2] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("chargeUp"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg3"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[3] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getBalance"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double")); - oper.setReturnClass(double.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[4] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getEachFee"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double")); - oper.setReturnClass(double.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[5] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getMO"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "mo")); - oper.setReturnClass(com.sipai.emsg.Mo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[6] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("logout"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[7] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("registDetailInfo"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg3"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg4"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg5"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg6"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg7"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg8"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg9"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[8] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("registEx"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[9] = oper; - - } - - private static void _initOperationDesc2(){ - org.apache.axis.description.OperationDesc oper; - org.apache.axis.description.ParameterDesc param; - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("sendSMS"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg3"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String[].class, false, false); - param.setOmittable(true); - param.setNillable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg4"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg5"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg6"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg7"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg8"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[10] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("sendVoice"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg3"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String[].class, false, false); - param.setOmittable(true); - param.setNillable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg4"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg5"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg6"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg7"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg8"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - oper.setReturnClass(java.lang.String.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[11] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("serialPwdUpd"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg3"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[12] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("setMOForward"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[13] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("setMOForwardEx"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg1"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - param.setOmittable(true); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "arg2"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String[].class, false, false); - param.setOmittable(true); - param.setNillable(true); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - oper.setReturnClass(int.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "return")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[14] = oper; - - } - - public SDKServiceBindingStub() throws org.apache.axis.AxisFault { - this(null); - } - - public SDKServiceBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - this(service); - super.cachedEndpoint = endpointURL; - } - - public SDKServiceBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - if (service == null) { - super.service = new org.apache.axis.client.Service(); - } else { - super.service = service; - } - ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); - java.lang.Class cls; - javax.xml.namespace.QName qName; - javax.xml.namespace.QName qName2; - java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; - java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; - java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; - java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; - java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; - java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; - java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; - java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; - java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; - java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; - qName = new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "mo"); - cachedSerQNames.add(qName); - cls = com.sipai.emsg.Mo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "statusReport"); - cachedSerQNames.add(qName); - cls = com.sipai.emsg.StatusReport.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - } - - protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { - try { - org.apache.axis.client.Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - java.util.Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - java.lang.String key = (java.lang.String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); - javax.xml.namespace.QName qName = - (javax.xml.namespace.QName) cachedSerQNames.get(i); - java.lang.Object x = cachedSerFactories.get(i); - if (x instanceof Class) { - java.lang.Class sf = (java.lang.Class) - cachedSerFactories.get(i); - java.lang.Class df = (java.lang.Class) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { - org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) - cachedSerFactories.get(i); - org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } - catch (java.lang.Throwable _t) { - throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); - } - } - - public java.lang.String getVersion() throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "getVersion")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (java.lang.String) _resp; - } catch (java.lang.Exception _exception) { - return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public com.sipai.emsg.StatusReport[] getReport(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[1]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "getReport")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (com.sipai.emsg.StatusReport[]) _resp; - } catch (java.lang.Exception _exception) { - return (com.sipai.emsg.StatusReport[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.sipai.emsg.StatusReport[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int cancelMOForward(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[2]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "cancelMOForward")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int chargeUp(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[3]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "chargeUp")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2, arg3}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public double getBalance(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[4]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "getBalance")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Double) _resp).doubleValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Double) org.apache.axis.utils.JavaUtils.convert(_resp, double.class)).doubleValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public double getEachFee(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[5]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "getEachFee")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Double) _resp).doubleValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Double) org.apache.axis.utils.JavaUtils.convert(_resp, double.class)).doubleValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public com.sipai.emsg.Mo[] getMO(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[6]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "getMO")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (com.sipai.emsg.Mo[]) _resp; - } catch (java.lang.Exception _exception) { - return (com.sipai.emsg.Mo[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.sipai.emsg.Mo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int logout(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[7]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "logout")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int registDetailInfo(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, java.lang.String arg7, java.lang.String arg8, java.lang.String arg9) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[8]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "registDetailInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int registEx(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[9]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "registEx")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int sendSMS(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String[] arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, int arg7, long arg8) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[10]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "sendSMS")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2, arg3, arg4, arg5, arg6, new java.lang.Integer(arg7), new java.lang.Long(arg8)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public java.lang.String sendVoice(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String[] arg3, java.lang.String arg4, java.lang.String arg5, java.lang.String arg6, int arg7, long arg8) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[11]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "sendVoice")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2, arg3, arg4, arg5, arg6, new java.lang.Integer(arg7), new java.lang.Long(arg8)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (java.lang.String) _resp; - } catch (java.lang.Exception _exception) { - return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int serialPwdUpd(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[12]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "serialPwdUpd")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2, arg3}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int setMOForward(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[13]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "setMOForward")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public int setMOForwardEx(java.lang.String arg0, java.lang.String arg1, java.lang.String[] arg2) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[14]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "setMOForwardEx")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {arg0, arg1, arg2}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Integer) _resp).intValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public static void main(String[] args)throws Exception { - - java.net.URL endpointURL=new java.net.URL("http://116.58.219.223:8081/sdk/SDKService?wsdl"); - javax.xml.rpc.Service service=null; - SDKServiceBindingStub client=new SDKServiceBindingStub(endpointURL, service); - int regValue=client.registEx("2SDK-EMY-6688-JBUQR", "911305", "911305"); - System.out.println("注册:"+regValue); - double blance=client.getBalance("2SDK-EMY-6688-JBUQR", "911305"); - System.out.println("余额:"+blance); - StringBuffer sb=new StringBuffer(); - for(int i=1;i<10;i++){ - sb.append(i); - String sendValue= client.sendVoice("2SDK-EMY-6688-JBUQR", "911305", null, new String[]{"13717882257"}, sb.toString(), "", "GBK", 5, System.currentTimeMillis()); - System.out.println("发送内容:"+sb+"返回值:"+sendValue); - } - - } - -} diff --git a/src/com/sipai/emsg/SDKServiceLocator.java b/src/com/sipai/emsg/SDKServiceLocator.java deleted file mode 100644 index 6f202b62..00000000 --- a/src/com/sipai/emsg/SDKServiceLocator.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * SDKServiceLocator.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package com.sipai.emsg; - -import java.util.PropertyResourceBundle; - -public class SDKServiceLocator extends org.apache.axis.client.Service implements com.sipai.emsg.SDKService { - - public SDKServiceLocator() { - } - - - public SDKServiceLocator(org.apache.axis.EngineConfiguration config) { - super(config); - } - - public SDKServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { - super(wsdlLoc, sName); - } - - // Use to get a proxy class for SDKService -// private java.lang.String SDKService_address = "http://116.58.219.223:8081/sdk/SDKService"; - - private java.lang.String SDKService_address =PropertyResourceBundle.getBundle("emsg").getString("uri"); - - public java.lang.String getSDKServiceAddress() { - return SDKService_address; - } - - // The WSDD service name defaults to the port name. - private java.lang.String SDKServiceWSDDServiceName = "SDKService"; - - public java.lang.String getSDKServiceWSDDServiceName() { - return SDKServiceWSDDServiceName; - } - - public void setSDKServiceWSDDServiceName(java.lang.String name) { - SDKServiceWSDDServiceName = name; - } - - public com.sipai.emsg.SDKClient getSDKService() throws javax.xml.rpc.ServiceException { - java.net.URL endpoint; - try { - endpoint = new java.net.URL(SDKService_address); - } - catch (java.net.MalformedURLException e) { - throw new javax.xml.rpc.ServiceException(e); - } - return getSDKService(endpoint); - } - - public com.sipai.emsg.SDKClient getSDKService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { - try { - com.sipai.emsg.SDKServiceBindingStub _stub = new com.sipai.emsg.SDKServiceBindingStub(portAddress, this); - _stub.setPortName(getSDKServiceWSDDServiceName()); - return _stub; - } - catch (org.apache.axis.AxisFault e) { - return null; - } - } - - public void setSDKServiceEndpointAddress(java.lang.String address) { - SDKService_address = address; - } - - /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. - */ - public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { - try { - if (com.sipai.emsg.SDKClient.class.isAssignableFrom(serviceEndpointInterface)) { - com.sipai.emsg.SDKServiceBindingStub _stub = new com.sipai.emsg.SDKServiceBindingStub(new java.net.URL(SDKService_address), this); - _stub.setPortName(getSDKServiceWSDDServiceName()); - return _stub; - } - } - catch (java.lang.Throwable t) { - throw new javax.xml.rpc.ServiceException(t); - } - throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); - } - - /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. - */ - public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { - if (portName == null) { - return getPort(serviceEndpointInterface); - } - java.lang.String inputPortName = portName.getLocalPart(); - if ("SDKService".equals(inputPortName)) { - return getSDKService(); - } - else { - java.rmi.Remote _stub = getPort(serviceEndpointInterface); - ((org.apache.axis.client.Stub) _stub).setPortName(portName); - return _stub; - } - } - - public javax.xml.namespace.QName getServiceName() { - return new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "SDKService"); - } - - private java.util.HashSet ports = null; - - public java.util.Iterator getPorts() { - if (ports == null) { - ports = new java.util.HashSet(); - ports.add(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "SDKService")); - } - return ports.iterator(); - } - - /** - * Set the endpoint address for the specified port name. - */ - public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - -if ("SDKService".equals(portName)) { - setSDKServiceEndpointAddress(address); - } - else -{ // Unknown Port Name - throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); - } - } - - /** - * Set the endpoint address for the specified port name. - */ - public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - setEndpointAddress(portName.getLocalPart(), address); - } - -} diff --git a/src/com/sipai/emsg/StatusReport.java b/src/com/sipai/emsg/StatusReport.java deleted file mode 100644 index 2d3d90b3..00000000 --- a/src/com/sipai/emsg/StatusReport.java +++ /dev/null @@ -1,369 +0,0 @@ -/** - * StatusReport.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package com.sipai.emsg; - -public class StatusReport implements java.io.Serializable { - private java.lang.String errorCode; - - private java.lang.String memo; - - private java.lang.String mobile; - - private java.lang.String receiveDate; - - private int reportStatus; - - private long seqID; - - private java.lang.String serviceCodeAdd; - - private java.lang.String submitDate; - - public StatusReport() { - } - - public StatusReport( - java.lang.String errorCode, - java.lang.String memo, - java.lang.String mobile, - java.lang.String receiveDate, - int reportStatus, - long seqID, - java.lang.String serviceCodeAdd, - java.lang.String submitDate) { - this.errorCode = errorCode; - this.memo = memo; - this.mobile = mobile; - this.receiveDate = receiveDate; - this.reportStatus = reportStatus; - this.seqID = seqID; - this.serviceCodeAdd = serviceCodeAdd; - this.submitDate = submitDate; - } - - - /** - * Gets the errorCode value for this StatusReport. - * - * @return errorCode - */ - public java.lang.String getErrorCode() { - return errorCode; - } - - - /** - * Sets the errorCode value for this StatusReport. - * - * @param errorCode - */ - public void setErrorCode(java.lang.String errorCode) { - this.errorCode = errorCode; - } - - - /** - * Gets the memo value for this StatusReport. - * - * @return memo - */ - public java.lang.String getMemo() { - return memo; - } - - - /** - * Sets the memo value for this StatusReport. - * - * @param memo - */ - public void setMemo(java.lang.String memo) { - this.memo = memo; - } - - - /** - * Gets the mobile value for this StatusReport. - * - * @return mobile - */ - public java.lang.String getMobile() { - return mobile; - } - - - /** - * Sets the mobile value for this StatusReport. - * - * @param mobile - */ - public void setMobile(java.lang.String mobile) { - this.mobile = mobile; - } - - - /** - * Gets the receiveDate value for this StatusReport. - * - * @return receiveDate - */ - public java.lang.String getReceiveDate() { - return receiveDate; - } - - - /** - * Sets the receiveDate value for this StatusReport. - * - * @param receiveDate - */ - public void setReceiveDate(java.lang.String receiveDate) { - this.receiveDate = receiveDate; - } - - - /** - * Gets the reportStatus value for this StatusReport. - * - * @return reportStatus - */ - public int getReportStatus() { - return reportStatus; - } - - - /** - * Sets the reportStatus value for this StatusReport. - * - * @param reportStatus - */ - public void setReportStatus(int reportStatus) { - this.reportStatus = reportStatus; - } - - - /** - * Gets the seqID value for this StatusReport. - * - * @return seqID - */ - public long getSeqID() { - return seqID; - } - - - /** - * Sets the seqID value for this StatusReport. - * - * @param seqID - */ - public void setSeqID(long seqID) { - this.seqID = seqID; - } - - - /** - * Gets the serviceCodeAdd value for this StatusReport. - * - * @return serviceCodeAdd - */ - public java.lang.String getServiceCodeAdd() { - return serviceCodeAdd; - } - - - /** - * Sets the serviceCodeAdd value for this StatusReport. - * - * @param serviceCodeAdd - */ - public void setServiceCodeAdd(java.lang.String serviceCodeAdd) { - this.serviceCodeAdd = serviceCodeAdd; - } - - - /** - * Gets the submitDate value for this StatusReport. - * - * @return submitDate - */ - public java.lang.String getSubmitDate() { - return submitDate; - } - - - /** - * Sets the submitDate value for this StatusReport. - * - * @param submitDate - */ - public void setSubmitDate(java.lang.String submitDate) { - this.submitDate = submitDate; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof StatusReport)) return false; - StatusReport other = (StatusReport) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.errorCode==null && other.getErrorCode()==null) || - (this.errorCode!=null && - this.errorCode.equals(other.getErrorCode()))) && - ((this.memo==null && other.getMemo()==null) || - (this.memo!=null && - this.memo.equals(other.getMemo()))) && - ((this.mobile==null && other.getMobile()==null) || - (this.mobile!=null && - this.mobile.equals(other.getMobile()))) && - ((this.receiveDate==null && other.getReceiveDate()==null) || - (this.receiveDate!=null && - this.receiveDate.equals(other.getReceiveDate()))) && - this.reportStatus == other.getReportStatus() && - this.seqID == other.getSeqID() && - ((this.serviceCodeAdd==null && other.getServiceCodeAdd()==null) || - (this.serviceCodeAdd!=null && - this.serviceCodeAdd.equals(other.getServiceCodeAdd()))) && - ((this.submitDate==null && other.getSubmitDate()==null) || - (this.submitDate!=null && - this.submitDate.equals(other.getSubmitDate()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getErrorCode() != null) { - _hashCode += getErrorCode().hashCode(); - } - if (getMemo() != null) { - _hashCode += getMemo().hashCode(); - } - if (getMobile() != null) { - _hashCode += getMobile().hashCode(); - } - if (getReceiveDate() != null) { - _hashCode += getReceiveDate().hashCode(); - } - _hashCode += getReportStatus(); - _hashCode += new Long(getSeqID()).hashCode(); - if (getServiceCodeAdd() != null) { - _hashCode += getServiceCodeAdd().hashCode(); - } - if (getSubmitDate() != null) { - _hashCode += getSubmitDate().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(StatusReport.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://sdkhttp.eucp.b2m.cn/", "statusReport")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("errorCode"); - elemField.setXmlName(new javax.xml.namespace.QName("", "errorCode")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("memo"); - elemField.setXmlName(new javax.xml.namespace.QName("", "memo")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("mobile"); - elemField.setXmlName(new javax.xml.namespace.QName("", "mobile")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("receiveDate"); - elemField.setXmlName(new javax.xml.namespace.QName("", "receiveDate")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("reportStatus"); - elemField.setXmlName(new javax.xml.namespace.QName("", "reportStatus")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("seqID"); - elemField.setXmlName(new javax.xml.namespace.QName("", "seqID")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("serviceCodeAdd"); - elemField.setXmlName(new javax.xml.namespace.QName("", "serviceCodeAdd")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("submitDate"); - elemField.setXmlName(new javax.xml.namespace.QName("", "submitDate")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/src/com/sipai/entity/Listener/ListenerHis.java b/src/com/sipai/entity/Listener/ListenerHis.java deleted file mode 100644 index e51877be..00000000 --- a/src/com/sipai/entity/Listener/ListenerHis.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.Listener; - -import com.sipai.entity.base.SQLAdapter; - -public class ListenerHis extends SQLAdapter { - - private String id; - - private String pointid; - - private String value; - - private String type; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPointid() { - return pointid; - } - - public void setPointid(String pointid) { - this.pointid = pointid; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} diff --git a/src/com/sipai/entity/Listener/ListenerInterface.java b/src/com/sipai/entity/Listener/ListenerInterface.java deleted file mode 100644 index 7d8d80c0..00000000 --- a/src/com/sipai/entity/Listener/ListenerInterface.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.Listener; - -import com.sipai.entity.base.SQLAdapter; - -public class ListenerInterface extends SQLAdapter { - - private String id; - - private String name; - - private String type; - - private String url; - - private String port; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } -} diff --git a/src/com/sipai/entity/Listener/ListenerMessage.java b/src/com/sipai/entity/Listener/ListenerMessage.java deleted file mode 100644 index af182049..00000000 --- a/src/com/sipai/entity/Listener/ListenerMessage.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.Listener; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -public class ListenerMessage extends SQLAdapter { - - private String id; - - private String Cmdtype; - - private String Objid; - - private String Action; - - private String insdt; - - private MPoint mPoint; - private ProcessSection processSection; - private Company company; - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCmdtype() { - return Cmdtype; - } - - public void setCmdtype(String cmdtype) { - Cmdtype = cmdtype; - } - - public String getObjid() { - return Objid; - } - - public void setObjid(String objid) { - Objid = objid; - } - - public String getAction() { - return Action; - } - - public void setAction(String action) { - Action = action; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} diff --git a/src/com/sipai/entity/Listener/ListenerPoint.java b/src/com/sipai/entity/Listener/ListenerPoint.java deleted file mode 100644 index b901b9d1..00000000 --- a/src/com/sipai/entity/Listener/ListenerPoint.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.sipai.entity.Listener; - -import com.sipai.entity.base.SQLAdapter; - -public class ListenerPoint extends SQLAdapter { - - private String id; - - private String intid; - - private String name; - - private String address; - - private String type; - - private String mpcode; - - private String datatype; - - private String unitid; - - //逻辑条件 - //= 等于 - //> 大于 - //< 小于 - //change 变化 - private String logi; - - //逻辑条件对应的值 - private String logiVal; - - //动作 如等于reset 为置0 - private String action; - - public String getLogi() { - return logi; - } - - public void setLogi(String logi) { - this.logi = logi; - } - - public String getLogiVal() { - return logiVal; - } - - public void setLogiVal(String logiVal) { - this.logiVal = logiVal; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getIntid() { - return intid; - } - - public void setIntid(String intid) { - this.intid = intid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public String getDatatype() { - return datatype; - } - - public void setDatatype(String datatype) { - this.datatype = datatype; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } -} diff --git a/src/com/sipai/entity/access/AccessAlarmHistory.java b/src/com/sipai/entity/access/AccessAlarmHistory.java deleted file mode 100644 index 81f5a06a..00000000 --- a/src/com/sipai/entity/access/AccessAlarmHistory.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.sipai.entity.access; - -import com.sipai.entity.base.SQLAdapter; - -public class AccessAlarmHistory extends SQLAdapter { - - private String id; - - private Integer npumpid; - - private Integer nsensorid; - - private Integer nevent; - - private String strevent; - - private Integer ftemperature; - - private Float fptpX; - - private Float fptpY; - - private Float fptpZ; - - private Float frmsX; - - private Float frmsY; - - private Float frmsZ; - - private Float fpeakX; - - private Float fpeakY; - - private Float fpeakZ; - - private Float fvveX; - - private Float fvveY; - - private Float fvveZ; - - private String tmvalue; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Integer getNpumpid() { - return npumpid; - } - - public void setNpumpid(Integer npumpid) { - this.npumpid = npumpid; - } - - public Integer getNsensorid() { - return nsensorid; - } - - public void setNsensorid(Integer nsensorid) { - this.nsensorid = nsensorid; - } - - public Integer getNevent() { - return nevent; - } - - public void setNevent(Integer nevent) { - this.nevent = nevent; - } - - public String getStrevent() { - return strevent; - } - - public void setStrevent(String strevent) { - this.strevent = strevent; - } - - public Integer getFtemperature() { - return ftemperature; - } - - public void setFtemperature(Integer ftemperature) { - this.ftemperature = ftemperature; - } - - public Float getFptpX() { - return fptpX; - } - - public void setFptpX(Float fptpX) { - this.fptpX = fptpX; - } - - public Float getFptpY() { - return fptpY; - } - - public void setFptpY(Float fptpY) { - this.fptpY = fptpY; - } - - public Float getFptpZ() { - return fptpZ; - } - - public void setFptpZ(Float fptpZ) { - this.fptpZ = fptpZ; - } - - public Float getFrmsX() { - return frmsX; - } - - public void setFrmsX(Float frmsX) { - this.frmsX = frmsX; - } - - public Float getFrmsY() { - return frmsY; - } - - public void setFrmsY(Float frmsY) { - this.frmsY = frmsY; - } - - public Float getFrmsZ() { - return frmsZ; - } - - public void setFrmsZ(Float frmsZ) { - this.frmsZ = frmsZ; - } - - public Float getFpeakX() { - return fpeakX; - } - - public void setFpeakX(Float fpeakX) { - this.fpeakX = fpeakX; - } - - public Float getFpeakY() { - return fpeakY; - } - - public void setFpeakY(Float fpeakY) { - this.fpeakY = fpeakY; - } - - public Float getFpeakZ() { - return fpeakZ; - } - - public void setFpeakZ(Float fpeakZ) { - this.fpeakZ = fpeakZ; - } - - public Float getFvveX() { - return fvveX; - } - - public void setFvveX(Float fvveX) { - this.fvveX = fvveX; - } - - public Float getFvveY() { - return fvveY; - } - - public void setFvveY(Float fvveY) { - this.fvveY = fvveY; - } - - public Float getFvveZ() { - return fvveZ; - } - - public void setFvveZ(Float fvveZ) { - this.fvveZ = fvveZ; - } - - public String getTmvalue() { - return tmvalue; - } - - public void setTmvalue(String tmvalue) { - this.tmvalue = tmvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/access/AccessAlarmSetting.java b/src/com/sipai/entity/access/AccessAlarmSetting.java deleted file mode 100644 index 746119bf..00000000 --- a/src/com/sipai/entity/access/AccessAlarmSetting.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.access; - -import com.sipai.entity.base.SQLAdapter; - -public class AccessAlarmSetting extends SQLAdapter { - - private String id; - - private Integer npumpid; - - private Integer nsensorid; - - private Float ftempalarmlo; - - private Float ftempalarmhi; - - private Float fptpalarmhi; - - private Float frmsalarmhi; - - private Float fpeakalarmhi; - - private Float fvvealarmhi; - - private String tmmodify; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Integer getNpumpid() { - return npumpid; - } - - public void setNpumpid(Integer npumpid) { - this.npumpid = npumpid; - } - - public Integer getNsensorid() { - return nsensorid; - } - - public void setNsensorid(Integer nsensorid) { - this.nsensorid = nsensorid; - } - - public Float getFtempalarmlo() { - return ftempalarmlo; - } - - public void setFtempalarmlo(Float ftempalarmlo) { - this.ftempalarmlo = ftempalarmlo; - } - - public Float getFtempalarmhi() { - return ftempalarmhi; - } - - public void setFtempalarmhi(Float ftempalarmhi) { - this.ftempalarmhi = ftempalarmhi; - } - - public Float getFptpalarmhi() { - return fptpalarmhi; - } - - public void setFptpalarmhi(Float fptpalarmhi) { - this.fptpalarmhi = fptpalarmhi; - } - - public Float getFrmsalarmhi() { - return frmsalarmhi; - } - - public void setFrmsalarmhi(Float frmsalarmhi) { - this.frmsalarmhi = frmsalarmhi; - } - - public Float getFpeakalarmhi() { - return fpeakalarmhi; - } - - public void setFpeakalarmhi(Float fpeakalarmhi) { - this.fpeakalarmhi = fpeakalarmhi; - } - - public Float getFvvealarmhi() { - return fvvealarmhi; - } - - public void setFvvealarmhi(Float fvvealarmhi) { - this.fvvealarmhi = fvvealarmhi; - } - - public String getTmmodify() { - return tmmodify; - } - - public void setTmmodify(String tmmodify) { - this.tmmodify = tmmodify; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/access/AccessEigenHistory.java b/src/com/sipai/entity/access/AccessEigenHistory.java deleted file mode 100644 index dc5ac1c0..00000000 --- a/src/com/sipai/entity/access/AccessEigenHistory.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.entity.access; - -import com.sipai.entity.base.SQLAdapter; - -public class AccessEigenHistory extends SQLAdapter { - - private String id; - - private Integer npumpid; - - private Integer nsensorid; - - private Integer ftemperature; - - private Float fptpX; - - private Float fptpY; - - private Float fptpZ; - - private Float frmsX; - - private Float frmsY; - - private Float frmsZ; - - private Float fpeakX; - - private Float fpeakY; - - private Float fpeakZ; - - private Float fvveX; - - private Float fvveY; - - private Float fvveZ; - - private String tmvalue; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Integer getNpumpid() { - return npumpid; - } - - public void setNpumpid(Integer npumpid) { - this.npumpid = npumpid; - } - - public Integer getNsensorid() { - return nsensorid; - } - - public void setNsensorid(Integer nsensorid) { - this.nsensorid = nsensorid; - } - - public Integer getFtemperature() { - return ftemperature; - } - - public void setFtemperature(Integer ftemperature) { - this.ftemperature = ftemperature; - } - - public Float getFptpX() { - return fptpX; - } - - public void setFptpX(Float fptpX) { - this.fptpX = fptpX; - } - - public Float getFptpY() { - return fptpY; - } - - public void setFptpY(Float fptpY) { - this.fptpY = fptpY; - } - - public Float getFptpZ() { - return fptpZ; - } - - public void setFptpZ(Float fptpZ) { - this.fptpZ = fptpZ; - } - - public Float getFrmsX() { - return frmsX; - } - - public void setFrmsX(Float frmsX) { - this.frmsX = frmsX; - } - - public Float getFrmsY() { - return frmsY; - } - - public void setFrmsY(Float frmsY) { - this.frmsY = frmsY; - } - - public Float getFrmsZ() { - return frmsZ; - } - - public void setFrmsZ(Float frmsZ) { - this.frmsZ = frmsZ; - } - - public Float getFpeakX() { - return fpeakX; - } - - public void setFpeakX(Float fpeakX) { - this.fpeakX = fpeakX; - } - - public Float getFpeakY() { - return fpeakY; - } - - public void setFpeakY(Float fpeakY) { - this.fpeakY = fpeakY; - } - - public Float getFpeakZ() { - return fpeakZ; - } - - public void setFpeakZ(Float fpeakZ) { - this.fpeakZ = fpeakZ; - } - - public Float getFvveX() { - return fvveX; - } - - public void setFvveX(Float fvveX) { - this.fvveX = fvveX; - } - - public Float getFvveY() { - return fvveY; - } - - public void setFvveY(Float fvveY) { - this.fvveY = fvveY; - } - - public Float getFvveZ() { - return fvveZ; - } - - public void setFvveZ(Float fvveZ) { - this.fvveZ = fvveZ; - } - - public String getTmvalue() { - return tmvalue; - } - - public void setTmvalue(String tmvalue) { - this.tmvalue = tmvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/access/AccessRealData.java b/src/com/sipai/entity/access/AccessRealData.java deleted file mode 100644 index e3a1c008..00000000 --- a/src/com/sipai/entity/access/AccessRealData.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.sipai.entity.access; - -import com.sipai.entity.base.SQLAdapter; - -public class AccessRealData extends SQLAdapter { - - private Integer npumpid; - - private Integer nsensorid; - - private Integer ftemperature; - - private Float fptpX; - - private Float fptpY; - - private Float fptpZ; - - private Float frmsX; - - private Float frmsY; - - private Float frmsZ; - - private Float fpeakX; - - private Float fpeakY; - - private Float fpeakZ; - - private Float fvveX; - - private Float fvveY; - - private Float fvveZ; - - private String tmvalue; - - public Integer getNpumpid() { - return npumpid; - } - - public void setNpumpid(Integer npumpid) { - this.npumpid = npumpid; - } - - public Integer getNsensorid() { - return nsensorid; - } - - public void setNsensorid(Integer nsensorid) { - this.nsensorid = nsensorid; - } - - public Integer getFtemperature() { - return ftemperature; - } - - public void setFtemperature(Integer ftemperature) { - this.ftemperature = ftemperature; - } - - public Float getFptpX() { - return fptpX; - } - - public void setFptpX(Float fptpX) { - this.fptpX = fptpX; - } - - public Float getFptpY() { - return fptpY; - } - - public void setFptpY(Float fptpY) { - this.fptpY = fptpY; - } - - public Float getFptpZ() { - return fptpZ; - } - - public void setFptpZ(Float fptpZ) { - this.fptpZ = fptpZ; - } - - public Float getFrmsX() { - return frmsX; - } - - public void setFrmsX(Float frmsX) { - this.frmsX = frmsX; - } - - public Float getFrmsY() { - return frmsY; - } - - public void setFrmsY(Float frmsY) { - this.frmsY = frmsY; - } - - public Float getFrmsZ() { - return frmsZ; - } - - public void setFrmsZ(Float frmsZ) { - this.frmsZ = frmsZ; - } - - public Float getFpeakX() { - return fpeakX; - } - - public void setFpeakX(Float fpeakX) { - this.fpeakX = fpeakX; - } - - public Float getFpeakY() { - return fpeakY; - } - - public void setFpeakY(Float fpeakY) { - this.fpeakY = fpeakY; - } - - public Float getFpeakZ() { - return fpeakZ; - } - - public void setFpeakZ(Float fpeakZ) { - this.fpeakZ = fpeakZ; - } - - public Float getFvveX() { - return fvveX; - } - - public void setFvveX(Float fvveX) { - this.fvveX = fvveX; - } - - public Float getFvveY() { - return fvveY; - } - - public void setFvveY(Float fvveY) { - this.fvveY = fvveY; - } - - public Float getFvveZ() { - return fvveZ; - } - - public void setFvveZ(Float fvveZ) { - this.fvveZ = fvveZ; - } - - public String getTmvalue() { - return tmvalue; - } - - public void setTmvalue(String tmvalue) { - this.tmvalue = tmvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/accident/Accident.java b/src/com/sipai/entity/accident/Accident.java deleted file mode 100644 index bbb2bf3d..00000000 --- a/src/com/sipai/entity/accident/Accident.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.sipai.entity.accident; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class Accident extends SQLAdapter { - private String id; - - private String happenDate; - - private String happenPlace; - - private String accidentTypeId; - - private String accidentDescription; - - private Integer emergencyPlanTrue; - - private String emergencyPlanId; - - private String handleResult; - - private String insuser; - - private String insdt; - - private String unitId; - - private AccidentType accidentType; - - private User user; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getHappenDate() { - return happenDate; - } - - public void setHappenDate(String happenDate) { - this.happenDate = happenDate; - } - - public String getHappenPlace() { - return happenPlace; - } - - public void setHappenPlace(String happenPlace) { - this.happenPlace = happenPlace; - } - - public String getAccidentTypeId() { - return accidentTypeId; - } - - public void setAccidentTypeId(String accidentTypeId) { - this.accidentTypeId = accidentTypeId; - } - - public String getAccidentDescription() { - return accidentDescription; - } - - public void setAccidentDescription(String accidentDescription) { - this.accidentDescription = accidentDescription; - } - - public Integer getEmergencyPlanTrue() { - return emergencyPlanTrue; - } - - public void setEmergencyPlanTrue(Integer emergencyPlanTrue) { - this.emergencyPlanTrue = emergencyPlanTrue; - } - - public String getEmergencyPlanId() { - return emergencyPlanId; - } - - public void setEmergencyPlanId(String emergencyPlanId) { - this.emergencyPlanId = emergencyPlanId; - } - - public String getHandleResult() { - return handleResult; - } - - public void setHandleResult(String handleResult) { - this.handleResult = handleResult; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public AccidentType getAccidentType() { - return accidentType; - } - - public void setAccidentType(AccidentType accidentType) { - this.accidentType = accidentType; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/accident/AccidentCommString.java b/src/com/sipai/entity/accident/AccidentCommString.java deleted file mode 100644 index 6d3fa6e6..00000000 --- a/src/com/sipai/entity/accident/AccidentCommString.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.sipai.entity.accident; - -public class AccidentCommString { - //合理化建议状态 - public static final String STATUS_RA_START = "0";//未提交 - public static final String STATUS_RA_AUDIT = "1";//提交审核 - public static final String STATUS_RA_FINISH = "2";//审核完成,采纳 - public static final String STATUS_RA_FAIL = "3";//审核完成,不采纳 -} diff --git a/src/com/sipai/entity/accident/AccidentType.java b/src/com/sipai/entity/accident/AccidentType.java deleted file mode 100644 index be3f0c9e..00000000 --- a/src/com/sipai/entity/accident/AccidentType.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.accident; - -import com.sipai.entity.base.SQLAdapter; - -public class AccidentType extends SQLAdapter { - private String id; - - private String pid; - - private String name; - - private String harmDescription; - - private String note; - - private String active; - - private String memo; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getHarmDescription() { - return harmDescription; - } - - public void setHarmDescription(String harmDescription) { - this.harmDescription = harmDescription; - } - - public String getNote() { - return note; - } - - public void setNote(String note) { - this.note = note; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/accident/ReasonableAdvice.java b/src/com/sipai/entity/accident/ReasonableAdvice.java deleted file mode 100644 index 762221e8..00000000 --- a/src/com/sipai/entity/accident/ReasonableAdvice.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.sipai.entity.accident; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -public class ReasonableAdvice extends BusinessUnitAdapter { - - private String adviceType; - - private String processdefid; - - private String processid; - - private String auditManId; - - private String auditManName;//审核人名�?? - - public String getAdviceType() { - return adviceType; - } - - public void setAdviceType(String adviceType) { - this.adviceType = adviceType; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } - - private String id; - - private String name; - - private String content; - - private String unitId; - - private String insdt; - - private String userLead; - - private String usersHelp; - - private String takeFlag; - - private String auditContent; - - private String advice_type; - - private Company company; - - private User user; - - private String caption; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUserLead() { - return userLead; - } - - public void setUserLead(String userLead) { - this.userLead = userLead; - } - - public String getUsersHelp() { - return usersHelp; - } - - public void setUsersHelp(String usersHelp) { - this.usersHelp = usersHelp; - } - - public String getTakeFlag() { - return takeFlag; - } - - public void setTakeFlag(String takeFlag) { - this.takeFlag = takeFlag; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getAuditContent() { - return auditContent; - } - - public void setAuditContent(String auditContent) { - this.auditContent = auditContent; - } - - public String getAdvice_type() { - return advice_type; - } - - public void setAdvice_type(String advice_type) { - this.advice_type = advice_type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/accident/Roast.java b/src/com/sipai/entity/accident/Roast.java deleted file mode 100644 index a6ee50ab..00000000 --- a/src/com/sipai/entity/accident/Roast.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.sipai.entity.accident; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -public class Roast extends BusinessUnitAdapter { - - private String adviceType; - - private String processdefid; - - private String processid; - - private String auditManId;//审核人Id - - private String auditManName;//审核人名 - - public String getAdviceType() { - return adviceType; - } - - public void setAdviceType(String adviceType) { - this.adviceType = adviceType; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } - - private String id; - - private String name;//吐槽名称 - - private String content;//吐槽内容 - - private String unitId; - - private String insdt; - - private String insuser; - - private String userLead; - - private String usersHelp; - - private String takeFlag; - - private String auditContent;//审核内容 - - private String advice_type;//类型 - - private String anonymous;//是否匿名 0为不匿名 1为匿名 - - private Company company; - - private User user; - - private String caption; - - public String getAnonymous() { - return anonymous; - } - - public void setAnonymous(String anonymous) { - this.anonymous = anonymous; - } - - @Override - public String getInsuser() { - return insuser; - } - - @Override - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUserLead() { - return userLead; - } - - public void setUserLead(String userLead) { - this.userLead = userLead; - } - - public String getUsersHelp() { - return usersHelp; - } - - public void setUsersHelp(String usersHelp) { - this.usersHelp = usersHelp; - } - - public String getTakeFlag() { - return takeFlag; - } - - public void setTakeFlag(String takeFlag) { - this.takeFlag = takeFlag; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getAuditContent() { - return auditContent; - } - - public void setAuditContent(String auditContent) { - this.auditContent = auditContent; - } - - public String getAdvice_type() { - return advice_type; - } - - public void setAdvice_type(String advice_type) { - this.advice_type = advice_type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModel.java b/src/com/sipai/entity/achievement/AcceptanceModel.java deleted file mode 100644 index 6c10291a..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModel.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.sipai.entity.achievement; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class AcceptanceModel extends SQLAdapter implements Serializable { - - private static final long serialVersionUID = -7608492419538630987L; - - private String id; - - private String pid; - - private String name; - - private String active; - - private String type; - - private String remark; - - private String insuser; - - private String insdt; - - private Integer morder; - - private String unitId; - - private String checkstandard; - - private String modelgoal; - - private String requirement; - - private String userid; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getCheckstandard() { - return checkstandard; - } - - public void setCheckstandard(String checkstandard) { - this.checkstandard = checkstandard; - } - - public String getModelgoal() { - return modelgoal; - } - - public void setModelgoal(String modelgoal) { - this.modelgoal = modelgoal; - } - - public String getRequirement() { - return requirement; - } - - public void setRequirement(String requirement) { - this.requirement = requirement; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelData.java b/src/com/sipai/entity/achievement/AcceptanceModelData.java deleted file mode 100644 index 651570e5..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelData.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AcceptanceModelData extends SQLAdapter{ - private String id; - - private String mpid; - - private Double value; - - private String pid; - - private String modeMPld; - - private MPoint mPoint; - - private AcceptanceModelMPoint acceptanceModelMPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getModeMPld() { - return modeMPld; - } - - public void setModeMPld(String modeMPld) { - this.modeMPld = modeMPld; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public AcceptanceModelMPoint getAcceptanceModelMPoint() { - return acceptanceModelMPoint; - } - - public void setAcceptanceModelMPoint(AcceptanceModelMPoint acceptanceModelMPoint) { - this.acceptanceModelMPoint = acceptanceModelMPoint; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelMPoint.java b/src/com/sipai/entity/achievement/AcceptanceModelMPoint.java deleted file mode 100644 index a41d8880..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelMPoint.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AcceptanceModelMPoint extends SQLAdapter{ - private String id; - - private String acceptanceModelId;//主表id - - private String mpointId; - - private String mpointName; - - private String unitconversion; - - private String insuser; - - private String insdt; - - private Integer morder; - - private String posX;//excel横轴位置 从0开始 - - private String posY;//excel纵轴位置 从0开始 - - private String sheetName;//sheet名称 - - private String valueType;//计算方式 - - private Integer movedata;//数据取值范围(模型创建日期前移的天数到模型创建日期) - - private String monthrange;//月份范围 用,隔开 - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getAcceptanceModelId() { - return acceptanceModelId; - } - - public void setAcceptanceModelId(String acceptanceModelId) { - this.acceptanceModelId = acceptanceModelId; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public String getMpointName() { - return mpointName; - } - - public void setMpointName(String mpointName) { - this.mpointName = mpointName; - } - - public String getUnitconversion() { - return unitconversion; - } - - public void setUnitconversion(String unitconversion) { - this.unitconversion = unitconversion; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getPosX() { - return posX; - } - - public void setPosX(String posX) { - this.posX = posX; - } - - public String getPosY() { - return posY; - } - - public void setPosY(String posY) { - this.posY = posY; - } - - public String getSheetName() { - return sheetName; - } - - public void setSheetName(String sheetName) { - this.sheetName = sheetName; - } - - public String getValueType() { - return valueType; - } - - public void setValueType(String valueType) { - this.valueType = valueType; - } - - public Integer getMovedata() { - return movedata; - } - - public void setMovedata(Integer movedata) { - this.movedata = movedata; - } - - public String getMonthrange() { - return monthrange; - } - - public void setMonthrange(String monthrange) { - this.monthrange = monthrange; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelOutput.java b/src/com/sipai/entity/achievement/AcceptanceModelOutput.java deleted file mode 100644 index 36cb922a..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelOutput.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AcceptanceModelOutput extends SQLAdapter{ - private String id; - - private String acceptanceModelId; - - private String name; - - private String mpointId; - - private String sheetName; - - private String baseId; - - private String posX; - - private String posY; - - private Integer morder; - - private String insdt; - - private String insuser; - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getAcceptanceModelId() { - return acceptanceModelId; - } - - public void setAcceptanceModelId(String acceptanceModelId) { - this.acceptanceModelId = acceptanceModelId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public String getSheetName() { - return sheetName; - } - - public void setSheetName(String sheetName) { - this.sheetName = sheetName; - } - - public String getBaseId() { - return baseId; - } - - public void setBaseId(String baseId) { - this.baseId = baseId; - } - - public String getPosX() { - return posX; - } - - public void setPosX(String posX) { - this.posX = posX; - } - - public String getPosY() { - return posY; - } - - public void setPosY(String posY) { - this.posY = posY; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelOutputData.java b/src/com/sipai/entity/achievement/AcceptanceModelOutputData.java deleted file mode 100644 index 3b387431..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelOutputData.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; - -public class AcceptanceModelOutputData extends SQLAdapter{ - //合格状态 - public static final String Status_qualified = "qualified";//合格 - public static final String Status_unqualified = "unqualified";//不合格 - - private String id; - - private Double value; - - private String pid; - - private String modeoutputld; - - private String status;//合格状态 - - private String name;//指标名称 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getModeoutputld() { - return modeoutputld; - } - - public void setModeoutputld(String modeoutputld) { - this.modeoutputld = modeoutputld; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelRecord.java b/src/com/sipai/entity/achievement/AcceptanceModelRecord.java deleted file mode 100644 index 1309bb27..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelRecord.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; - -public class AcceptanceModelRecord extends SQLAdapter{ - private String id; - - private String name; - - private String sdt; - - private String edt; - - private String insdt; - - private String insuser; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelText.java b/src/com/sipai/entity/achievement/AcceptanceModelText.java deleted file mode 100644 index 5df6c639..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelText.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; - -public class AcceptanceModelText extends SQLAdapter{ - private String id; - - private String acceptanceModelId; - - private String name; - - private String insuser; - - private String insdt; - - private Integer morder; - - private Integer posX; - - private Integer posY; - - private String sheetName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getAcceptanceModelId() { - return acceptanceModelId; - } - - public void setAcceptanceModelId(String acceptanceModelId) { - this.acceptanceModelId = acceptanceModelId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getPosX() { - return posX; - } - - public void setPosX(Integer posX) { - this.posX = posX; - } - - public Integer getPosY() { - return posY; - } - - public void setPosY(Integer posY) { - this.posY = posY; - } - - public String getSheetName() { - return sheetName; - } - - public void setSheetName(String sheetName) { - this.sheetName = sheetName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/AcceptanceModelTextData.java b/src/com/sipai/entity/achievement/AcceptanceModelTextData.java deleted file mode 100644 index 68fa4928..00000000 --- a/src/com/sipai/entity/achievement/AcceptanceModelTextData.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; - -public class AcceptanceModelTextData extends SQLAdapter{ - private String id; - - private String text; - - private String pid; - - private String modetextld; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getModetextld() { - return modetextld; - } - - public void setModetextld(String modetextld) { - this.modetextld = modetextld; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/achievement/ModelLibrary.java b/src/com/sipai/entity/achievement/ModelLibrary.java deleted file mode 100644 index 6737f854..00000000 --- a/src/com/sipai/entity/achievement/ModelLibrary.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.sipai.entity.achievement; - -import com.sipai.entity.base.SQLAdapter; - -public class ModelLibrary extends SQLAdapter { - - public static final String Type_Large = "大于";//大于 - public static final String Type_Little = "小于";//小于 - public static final String Type_In = "区间内";//区间内 - public static final String Type_Out = "区间外";//区间外 - public static final String Type_NotNull = "不为空";//不为空 - - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String unitId; - - private String type; - - private Integer morder; - - private String paramName; - - private String paramCode; - - private String referenceHighValue; - - private String referenceLowValue; - - private String referenceValue; - - private String referenceType; - - private String unit; - - private String explain; - - private String remark; - - private String projectType; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getParamName() { - return paramName; - } - - public void setParamName(String paramName) { - this.paramName = paramName == null ? null : paramName.trim(); - } - - public String getParamCode() { - return paramCode; - } - - public void setParamCode(String paramCode) { - this.paramCode = paramCode == null ? null : paramCode.trim(); - } - - public String getReferenceHighValue() { - return referenceHighValue; - } - - public void setReferenceHighValue(String referenceHighValue) { - this.referenceHighValue = referenceHighValue == null ? null : referenceHighValue.trim(); - } - - public String getReferenceLowValue() { - return referenceLowValue; - } - - public void setReferenceLowValue(String referenceLowValue) { - this.referenceLowValue = referenceLowValue == null ? null : referenceLowValue.trim(); - } - - public String getReferenceValue() { - return referenceValue; - } - - public void setReferenceValue(String referenceValue) { - this.referenceValue = referenceValue == null ? null : referenceValue.trim(); - } - - public String getReferenceType() { - return referenceType; - } - - public void setReferenceType(String referenceType) { - this.referenceType = referenceType == null ? null : referenceType.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } - - public String getExplain() { - return explain; - } - - public void setExplain(String explain) { - this.explain = explain == null ? null : explain.trim(); - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public String getProjectType() { - return projectType; - } - - public void setProjectType(String projectType) { - this.projectType = projectType == null ? null : projectType.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/activiti/ActivitiCommStr.java b/src/com/sipai/entity/activiti/ActivitiCommStr.java deleted file mode 100644 index fa77bb90..00000000 --- a/src/com/sipai/entity/activiti/ActivitiCommStr.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.activiti; - -public class ActivitiCommStr { - - //流程状态 - public static final String Ativiti_START = "0";//未提交 - public static final String Activiti_HANDLE = "1";//已下达 - public static final String Activiti_AUDIT = "2";//审核 - public static final String Activiti_FINISH = "3";//审核通过 - - - public final static int Response_StartProcess_NoProcessDef =2;//未定义流程 - public final static int Response_StartProcess_NoUser =3;//无任务接收用户 - public final static int Response_StartProcess_PlanIssued =4;//计划已下发 - -} diff --git a/src/com/sipai/entity/activiti/Leave.java b/src/com/sipai/entity/activiti/Leave.java deleted file mode 100644 index 3c065405..00000000 --- a/src/com/sipai/entity/activiti/Leave.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.sipai.entity.activiti; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - - - - - - -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Comment; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; -@Component -public class Leave extends SQLAdapter implements Cloneable{ - private BigDecimal id; - - private String applyTime; - - private String endTime; - - private String leaveType; - - private String processInstanceId; - - private String realityEndTime; - - private String realityStartTime; - - private String reason; - - private String startTime; - - private String userId; - - private String taskId; - - private String name; - - private String processDefinitionId; - - private String type; - - //-- 临时属性 --// - - // 流程任务 - private Task task; - - private HistoricTaskInstance taskHis; - - private Map variables; - - // 运行中的流程实例 - private ProcessInstance processInstance; - - // 历史的流程实例 - private HistoricProcessInstance historicProcessInstance; - - // 流程定义 - private ProcessDefinition processDefinition; - - private List comments; - - private Object business; - - private User assigneeUser; - - public User getAssigneeUser() { - return assigneeUser; - } - - public void setAssigneeUser(User assigneeUser) { - this.assigneeUser = assigneeUser; - } - - public HistoricTaskInstance getTaskHis() { - return taskHis; - } - - public void setTaskHis(HistoricTaskInstance taskHis) { - this.taskHis = taskHis; - } - - public Object getBusiness() { - return business; - } - - public void setBusiness(Object business) { - this.business = business; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getProcessDefinitionId() { - return processDefinitionId; - } - - public void setProcessDefinitionId(String processDefinitionId) { - this.processDefinitionId = processDefinitionId; - } - - public List getComments() { - return comments; - } - - public void setComments(List comments) { - this.comments = comments; - } - - public Task getTask() { - return task; - } - - public void setTask(Task task) { - this.task = task; - } - - public Map getVariables() { - return variables; - } - - public void setVariables(Map variables) { - this.variables = variables; - } - - public ProcessInstance getProcessInstance() { - return processInstance; - } - - public void setProcessInstance(ProcessInstance processInstance) { - this.processInstance = processInstance; - } - - public HistoricProcessInstance getHistoricProcessInstance() { - return historicProcessInstance; - } - - public void setHistoricProcessInstance( - HistoricProcessInstance historicProcessInstance) { - this.historicProcessInstance = historicProcessInstance; - } - - public ProcessDefinition getProcessDefinition() { - return processDefinition; - } - - public void setProcessDefinition(ProcessDefinition processDefinition) { - this.processDefinition = processDefinition; - } - - public BigDecimal getId() { - return id; - } - - public void setId(BigDecimal id) { - this.id = id; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public String getLeaveType() { - return leaveType; - } - - public void setLeaveType(String leaveType) { - this.leaveType = leaveType; - } - - public String getProcessInstanceId() { - return processInstanceId; - } - - public void setProcessInstanceId(String processInstanceId) { - this.processInstanceId = processInstanceId; - } - - public String getRealityEndTime() { - return realityEndTime; - } - - public void setRealityEndTime(String realityEndTime) { - this.realityEndTime = realityEndTime; - } - - public String getRealityStartTime() { - return realityStartTime; - } - - public void setRealityStartTime(String realityStartTime) { - this.realityStartTime = realityStartTime; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - - //深复制 - public Object clone() - { - Object o=null; - try - { - o=(Leave)super.clone();//Object中的clone()识别出你要复制的是哪一个对象。 - } - catch(CloneNotSupportedException e) - { - System.out.println(e.toString()); - } - return o; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/activiti/ModelNodeJob.java b/src/com/sipai/entity/activiti/ModelNodeJob.java deleted file mode 100644 index 5db76fd9..00000000 --- a/src/com/sipai/entity/activiti/ModelNodeJob.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.entity.activiti; - -import com.sipai.entity.base.SQLAdapter; - -public class ModelNodeJob extends SQLAdapter{ - private String id; - - private String resourceId; - - private String jobId; - - private String modelId; - - private String name; - - private String serial;//流程组id - - - public String getSerial() { - return serial; - } - - public void setSerial(String serial) { - this.serial = serial; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getJobId() { - return jobId; - } - - public void setJobId(String jobId) { - this.jobId = jobId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/activiti/OEProcess.java b/src/com/sipai/entity/activiti/OEProcess.java deleted file mode 100644 index 80a95c71..00000000 --- a/src/com/sipai/entity/activiti/OEProcess.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.entity.activiti; - -import com.sipai.entity.base.SQLAdapter; - -public class OEProcess extends SQLAdapter{ - - private String id; - private String processnum; - private String username; - private String meno; - private String url; - private String ywlb; - - public String getYwlb() { - return ywlb; - } - - public void setYwlb(String ywlb) { - this.ywlb = ywlb; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getProcessnum() { - return processnum; - } - - public void setProcessnum(String processnum) { - this.processnum = processnum; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getMeno() { - return meno; - } - - public void setMeno(String meno) { - this.meno = meno; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/activiti/ProcessType.java b/src/com/sipai/entity/activiti/ProcessType.java deleted file mode 100644 index 14e302bf..00000000 --- a/src/com/sipai/entity/activiti/ProcessType.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.entity.activiti; - -import java.util.HashMap; -import java.util.Map; - -import com.sipai.entity.timeefficiency.PatrolType; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -public enum ProcessType { - SAFETY_JOB_INSIDE("safety_job_inside","内部作业会签"), - - SAFETY_CHECK_DAYLY("safety_check_dayly","日常安全检查"), - SAFETY_CHECK_COMPREHENSIVE("safety_check_comprehensive","综合安全检查"), - SAFETY_CHECK_SPECIAL("safety_check_special","专项安全检查"), - - KPI_MAKE_PLAN("KPI_MAKE_PLAN","绩效考核:绩效方案审核"), - KPI_MARK("KPI_MARK","绩效考核:考核项目评分"), - - S_Maintenance("System_Maintenance","客户运维"), - B_Maintenance( "Business_Maintenance","公司运维"), - B_Purchase( "Business_Purchase","公司采购"), - B_Contract( "Business_Contract","合同管理"), - //暂时不用 用下面的工艺调整 - //B_ProcessAdjustment("Business_ProcessAdjustment","工艺调整"), - I_Stock("In_Stock","入库管理"),O_Stock("Out_Stock","出库管理"),Raw_Material("Raw_Material","药剂管理"), - Reasonable_Advice("Reasonable_Advice","合理化建议"), - Roast("Roast","吐槽内容"), - Stock_Check("Stock_Check","库存盘点"),Lose_Apply("Lose_Apply","丢失申请"),Sale_Apply("Sale_Apply","出售申请"), - Scrap_Apply("Scrap_Apply","报废申请"),Transfers_Apply("Transfers_Apply","调拨申请"),Acceptance_Apply("Acceptance_Apply","验收申请"), - EquipmentStop_Apply("EquipmentStop_Apply","设备停用申请"), - Scetion_Stock("Scetion_Stock","处级物资领用"), - Maintenance_Repair("Maintenance_Repair","维修流程"), - Maintain_Car("Maintain_Car","车辆维保"), - Repair_Car("Repair_Car","车辆维修"), - - /* - 设备计划 - */ - Maintain_Plan("Maintain_Plan","保养计划"), - Repair_Plan("Repair_Plan","维修计划"), - Overhaul_PLAN("Overhaul_PLAN", "大修计划"), - /* - 用于周期性常规任务 - */ - Routine_Work("Routine_Work","周期常规任务"), - /*指标控制*/ - Administration_IndexWork("Administration_IndexWork","指标控制"), - /*组织工作*/ - Administration_Organization("Administration_Organization","组织工作"), - /*预案*/ - Administration_Reserve("Administration_Reserve","预案工作"), - /*预案*/ - Administration_Temporary("Administration_Temporary","临时任务"), - /*工艺调整*/ - Process_Adjustment("Process_Adjustment","工艺调整"), - /*水质化验*/ - Water_Test("Water_Test","水质化验"), - - /*报表审核*/ - Report_Check("Report_Check","报表审核"), - TestManagement("TestManagement","化验管理"), - - /*异常上报*/ - Workorder_Abnormity_Run("Workorder_Abnormity_Run", "异常上报(运行)"), - Workorder_Abnormity_Equipment("Workorder_Abnormity_Equipment", "异常上报(设备)"), - Workorder_Abnormity_Facilities("Workorder_Abnormity_Facilities", "异常上报(设施)"), - /*维修工单*/ - Workorder_Repair("Workorder_Repair", "维修工单"), - /*保养工单*/ - Workorder_Maintain("Workorder_Maintain", "保养工单"), - - /*大修项目 包括计划和实施*/ - Overhaul("Overhaul", "大修项目"), - - /* - 用于大修分项 -- 暂时不开发 - */ - Programme_Write("Programme_Write","方案编制"), - Bidding_Price("Bidding_Price","招标比价"), - Install_Debug("Install_Debug","安装调试"), - Project_Check("Project_Check","项目验收"), - - //外来人员 - Visit_Apply("Visit_Apply","参观申请"), - Visit_Register("Visit_Register","参观登记"), - - // 巡检计划确认 - Patrol_Record("Patrol_Record", " 巡检计划确认"), - - ; - - private String id; - private String name; - - private ProcessType(String id,String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (PatrolType item :PatrolType.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - public static JSONArray toJson() { - JSONArray jsonArray = new JSONArray(); - for (PatrolType item :PatrolType.values()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item.getId()); - jsonObject.put("name", item.getName()); - jsonArray.add(jsonObject); - - } - return jsonArray; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/src/com/sipai/entity/activiti/TaskModel.java b/src/com/sipai/entity/activiti/TaskModel.java deleted file mode 100644 index 4b29ee1d..00000000 --- a/src/com/sipai/entity/activiti/TaskModel.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.activiti; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - - - -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Comment; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -@Component -public class TaskModel extends SQLAdapter { - private String id; - - private String name; - - private String target_true; - - private String target_false; - - private String type; - - private String documentation; - - - public String getDocumentation() { - return documentation; - } - - public void setDocumentation(String documentation) { - this.documentation = documentation; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getTarget_true() { - return target_true; - } - - public void setTarget_true(String target_true) { - this.target_true = target_true; - } - - public String getTarget_false() { - return target_false; - } - - public void setTarget_false(String target_false) { - this.target_false = target_false; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/activiti/TodoTask.java b/src/com/sipai/entity/activiti/TodoTask.java deleted file mode 100644 index ce44d3c3..00000000 --- a/src/com/sipai/entity/activiti/TodoTask.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.entity.activiti; - -import java.util.List; -import java.util.Map; - - - - - - - -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Comment; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Component; - -import com.sipai.entity.user.User; -/** - * 待办任务bean - * */ -@Component -public class TodoTask implements Cloneable { - - private String id; - - private String name; - - private String type; - - //-- 临时属性 --// - - // 流程任务 - private Task task; - - private Map variables; - - // 运行中的流程实例 - private ProcessInstance processInstance; - - // 历史的流程实例 - private HistoricProcessInstance historicProcessInstance; - - // 流程定义 - private ProcessDefinition processDefinition; - private List comments; - - private Object business; - - private User assigneeUser; - - - public User getAssigneeUser() { - return assigneeUser; - } - - public void setAssigneeUser(User assigneeUser) { - this.assigneeUser = assigneeUser; - } - - public Object getBusiness() { - return business; - } - - public void setBusiness(Object business) { - this.business = business; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Task getTask() { - return task; - } - - public void setTask(Task task) { - this.task = task; - } - - public Map getVariables() { - return variables; - } - - public void setVariables(Map variables) { - this.variables = variables; - } - - public ProcessInstance getProcessInstance() { - return processInstance; - } - - public void setProcessInstance(ProcessInstance processInstance) { - this.processInstance = processInstance; - } - - public HistoricProcessInstance getHistoricProcessInstance() { - return historicProcessInstance; - } - - public void setHistoricProcessInstance( - HistoricProcessInstance historicProcessInstance) { - this.historicProcessInstance = historicProcessInstance; - } - - public ProcessDefinition getProcessDefinition() { - return processDefinition; - } - - public void setProcessDefinition(ProcessDefinition processDefinition) { - this.processDefinition = processDefinition; - } - - public List getComments() { - return comments; - } - - public void setComments(List comments) { - this.comments = comments; - } - - //深复制 - public Object clone() - { - Object o=null; - try - { - o=(TodoTask)super.clone();//Object中的clone()识别出你要复制的是哪一个对象。 - } - catch(CloneNotSupportedException e) - { - System.out.println(e.toString()); - } - return o; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/activiti/WorkTask.java b/src/com/sipai/entity/activiti/WorkTask.java deleted file mode 100644 index 267531d5..00000000 --- a/src/com/sipai/entity/activiti/WorkTask.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.sipai.entity.activiti; - -import java.util.List; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentArrangement; -@Component -public class WorkTask extends SQLAdapter { - - private String id; - - private String name; - - private String taskKey; - - private String type; - - private String multiInstance; - - private boolean passFlag; - - private int routeNum; - - private String pd_id; - - private String pd_name; - - private String pd_key; - - private String pd_resourceName; - - private String pd_revision; - - private String pd_suspended; - - private String pd_deploymentId; - - private String pd_description; - - private String pd_diagramResourceName; - - - public String getMultiInstance() { - return multiInstance; - } - - public void setMultiInstance(String multiInstance) { - this.multiInstance = multiInstance; - } - - public boolean isPassFlag() { - return passFlag; - } - - public void setPassFlag(boolean passFlag) { - this.passFlag = passFlag; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public int getRouteNum() { - return routeNum; - } - - public void setRouteNum(int routeNum) { - this.routeNum = routeNum; - } - - public String getTaskKey() { - return taskKey; - } - - public void setTaskKey(String taskKey) { - this.taskKey = taskKey; - } - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPd_id() { - return pd_id; - } - - public void setPd_id(String pd_id) { - this.pd_id = pd_id; - } - - public String getPd_name() { - return pd_name; - } - - public void setPd_name(String pd_name) { - this.pd_name = pd_name; - } - - public String getPd_key() { - return pd_key; - } - - public void setPd_key(String pd_key) { - this.pd_key = pd_key; - } - - public String getPd_resourceName() { - return pd_resourceName; - } - - public void setPd_resourceName(String pd_resourceName) { - this.pd_resourceName = pd_resourceName; - } - - public String getPd_revision() { - return pd_revision; - } - - public void setPd_revision(String pd_revision) { - this.pd_revision = pd_revision; - } - - public String getPd_suspended() { - return pd_suspended; - } - - public void setPd_suspended(String pd_suspended) { - this.pd_suspended = pd_suspended; - } - - public String getPd_deploymentId() { - return pd_deploymentId; - } - - public void setPd_deploymentId(String pd_deploymentId) { - this.pd_deploymentId = pd_deploymentId; - } - - public String getPd_description() { - return pd_description; - } - - public void setPd_description(String pd_description) { - this.pd_description = pd_description; - } - - public String getPd_diagramResourceName() { - return pd_diagramResourceName; - } - - public void setPd_diagramResourceName(String pd_diagramResourceName) { - this.pd_diagramResourceName = pd_diagramResourceName; - } - - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/Index.java b/src/com/sipai/entity/administration/Index.java deleted file mode 100644 index 05eeef7a..00000000 --- a/src/com/sipai/entity/administration/Index.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.sipai.entity.administration; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; - -public class Index extends SQLAdapter{ - - private String dateYear; - - public String getDateYear() { - return dateYear; - } - - public void setDateYear(String dateYear) { - this.dateYear = dateYear; - } - - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String sname; - - private String active; - - private String code; - - private String deptid; - - private String userid; - - private BigDecimal budget; - - private String classid; - - private String remarks; - - private String unitId; - - //非表中字�? - private String pname; - private IndexClass indexClass; - private Company company; - private Dept dept; - private String userName; - private List indexCycleList; - //end - - public String getPname() { - return pname; - } - - public List getIndexCycleList() { - return indexCycleList; - } - - public void setIndexCycleList(List indexCycleList) { - this.indexCycleList = indexCycleList; - } - - public IndexClass getIndexClass() { - return indexClass; - } - - public void setIndexClass(IndexClass indexClass) { - this.indexClass = indexClass; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public void setPname(String pname) { - this.pname = pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getDeptid() { - return deptid; - } - - public void setDeptid(String deptid) { - this.deptid = deptid; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public BigDecimal getBudget() { - return budget; - } - - public void setBudget(BigDecimal budget) { - this.budget = budget; - } - - public String getClassid() { - return classid; - } - - public void setClassid(String classid) { - this.classid = classid; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/IndexClass.java b/src/com/sipai/entity/administration/IndexClass.java deleted file mode 100644 index 433536df..00000000 --- a/src/com/sipai/entity/administration/IndexClass.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.entity.administration; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class IndexClass extends SQLAdapter{ - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String sname; - - private String active; - - private String code; - - private String remarks; - - private String unitId; - //非表中字段 - private String pname; - - private List indexList; - //end - - public String getPname() { - return pname; - } - - public List getIndexList() { - return indexList; - } - - public void setIndexList(List indexList) { - this.indexList = indexList; - } - - public void setPname(String pname) { - this.pname = pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/IndexCycle.java b/src/com/sipai/entity/administration/IndexCycle.java deleted file mode 100644 index d817de07..00000000 --- a/src/com/sipai/entity/administration/IndexCycle.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.administration; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; - -public class IndexCycle extends SQLAdapter{ - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String active; - - private BigDecimal money; - - private String memo; - - //非表中字段 - private String pname; - - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public BigDecimal getMoney() { - return money; - } - - public void setMoney(BigDecimal money) { - this.money = money; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/IndexWork.java b/src/com/sipai/entity/administration/IndexWork.java deleted file mode 100644 index b7194d53..00000000 --- a/src/com/sipai/entity/administration/IndexWork.java +++ /dev/null @@ -1,377 +0,0 @@ -package com.sipai.entity.administration; - -import java.math.BigDecimal; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.Company; -import java.util.Date; - -public class IndexWork extends BusinessUnitAdapter{ - - private String evaluateUserId; - - public String getEvaluateUserId() { - return evaluateUserId; - } - - public void setEvaluateUserId(String evaluateUserId) { - this.evaluateUserId = evaluateUserId; - } - - private String id; - - private String indexid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String active; - - private String cycle; - - private String unit; - - private BigDecimal min; - - private BigDecimal max; - - private BigDecimal actual; - - private BigDecimal complete; - - private String standard; - - private String measures; - - private String receiveUserId; - - private BigDecimal quotaHours; - - private BigDecimal bonusPenalty; - - private String enclosure; - - private String remarks; - - private String unitId; - - private String jobNumber; - - private String sendUserId; - - private String receiveUserIds; - - private String receiveDt; - - private String workingHours; - - private String processid; - - private String processdefid; - - private String processStatus; - - private String finishDate; - - //非表中字�? - private Index index; - private IndexCycle indexCycle; - private Company company; - private String sendUser; - private String receiveUser; - private String evaluateUser; - //end - - public String getId() { - return id; - } - - public IndexCycle getIndexCycle() { - return indexCycle; - } - - public void setIndexCycle(IndexCycle indexCycle) { - this.indexCycle = indexCycle; - } - - public String getSendUser() { - return sendUser; - } - - public void setSendUser(String sendUser) { - this.sendUser = sendUser; - } - - public String getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(String receiveUser) { - this.receiveUser = receiveUser; - } - - public String getEvaluateUser() { - return evaluateUser; - } - - public void setEvaluateUser(String evaluateUser) { - this.evaluateUser = evaluateUser; - } - - public Index getIndex() { - return index; - } - - public void setIndex(Index index) { - this.index = index; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public void setId(String id) { - this.id = id; - } - - public String getIndexid() { - return indexid; - } - - public void setIndexid(String indexid) { - this.indexid = indexid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public BigDecimal getMin() { - return min; - } - - public void setMin(BigDecimal min) { - this.min = min; - } - - public BigDecimal getMax() { - return max; - } - - public void setMax(BigDecimal max) { - this.max = max; - } - - public BigDecimal getActual() { - return actual; - } - - public void setActual(BigDecimal actual) { - this.actual = actual; - } - - public BigDecimal getComplete() { - return complete; - } - - public void setComplete(BigDecimal complete) { - this.complete = complete; - } - - public String getStandard() { - return standard; - } - - public void setStandard(String standard) { - this.standard = standard; - } - - public String getMeasures() { - return measures; - } - - public void setMeasures(String measures) { - this.measures = measures; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public BigDecimal getQuotaHours() { - return quotaHours; - } - - public void setQuotaHours(BigDecimal quotaHours) { - this.quotaHours = quotaHours; - } - - public BigDecimal getBonusPenalty() { - return bonusPenalty; - } - - public void setBonusPenalty(BigDecimal bonusPenalty) { - this.bonusPenalty = bonusPenalty; - } - - public String getEnclosure() { - return enclosure; - } - - public void setEnclosure(String enclosure) { - this.enclosure = enclosure; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getFinishDate() { - return finishDate; - } - - public void setFinishDate(String finishDate) { - this.finishDate = finishDate; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getReceiveDt() { - return receiveDt; - } - - public void setReceiveDt(String receiveDt) { - this.receiveDt = receiveDt; - } - - public String getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(String workingHours) { - this.workingHours = workingHours; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/Organization.java b/src/com/sipai/entity/administration/Organization.java deleted file mode 100644 index c12571db..00000000 --- a/src/com/sipai/entity/administration/Organization.java +++ /dev/null @@ -1,412 +0,0 @@ -package com.sipai.entity.administration; - -import java.math.BigDecimal; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import java.util.Date; - -public class Organization extends BusinessUnitAdapter{ - - private String projectCont; - - public String getProjectCont() { - return projectCont; - } - - public void setProjectCont(String projectCont) { - this.projectCont = projectCont; - } - - private String planStartDate; - - private String checkDate; - - private String code; - - public String getPlanStartDate() { - return planStartDate; - } - - public void setPlanStartDate(String planStartDate) { - this.planStartDate = planStartDate; - } - - public String getCheckDate() { - return checkDate; - } - - public void setCheckDate(String checkDate) { - this.checkDate = checkDate; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - private String id; - - private String typeid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String active; - - private String receiveUserId; - - private BigDecimal quotaHours; - - private BigDecimal bonusPenalty; - - private String enclosure; - - private String remarks; - - private String unitId; - - private String jobNumber; - - private String finishDate; - - private String sendUserId; - - private String sendUser; - - private String receiveUserIds; - - private String receiveUser; - - private String receiveDt; - - private String workingHours; - - private String processid; - - private String processdefid; - - private String processStatus; - - private String projectName; - - private String planStartString; - - private String planFinishDate; - - private String classid; - - private BigDecimal actualCost; - - private BigDecimal quotaCost; - - private String evaluateUserId; - - private String evaluateUser; - - private String evaluateOpinion; - - private String checkString; - - //非表中字�?? - private OrganizationClass organizationClass; - private Company company; - //end - - public String getId() { - return id; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getSendUser() { - return sendUser; - } - - public void setSendUser(String sendUser) { - this.sendUser = sendUser; - } - - public String getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(String receiveUser) { - this.receiveUser = receiveUser; - } - - public String getEvaluateUser() { - return evaluateUser; - } - - public void setEvaluateUser(String evaluateUser) { - this.evaluateUser = evaluateUser; - } - - public OrganizationClass getOrganizationClass() { - return organizationClass; - } - - public void setOrganizationClass(OrganizationClass organizationClass) { - this.organizationClass = organizationClass; - } - - public void setId(String id) { - this.id = id; - } - - public String getTypeid() { - return typeid; - } - - public void setTypeid(String typeid) { - this.typeid = typeid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public BigDecimal getQuotaHours() { - return quotaHours; - } - - public void setQuotaHours(BigDecimal quotaHours) { - this.quotaHours = quotaHours; - } - - public BigDecimal getBonusPenalty() { - return bonusPenalty; - } - - public void setBonusPenalty(BigDecimal bonusPenalty) { - this.bonusPenalty = bonusPenalty; - } - - public String getEnclosure() { - return enclosure; - } - - public void setEnclosure(String enclosure) { - this.enclosure = enclosure; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getFinishDate() { - return finishDate; - } - - public void setFinishDate(String finishDate) { - this.finishDate = finishDate; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getReceiveDt() { - return receiveDt; - } - - public void setReceiveDt(String receiveDt) { - this.receiveDt = receiveDt; - } - - public String getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(String workingHours) { - this.workingHours = workingHours; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getPlanStartString() { - return planStartString; - } - - public void setPlanStartString(String planStartString) { - this.planStartString = planStartString; - } - - public String getPlanFinishDate() { - return planFinishDate; - } - - public void setPlanFinishDate(String planFinishDate) { - this.planFinishDate = planFinishDate; - } - - public String getClassid() { - return classid; - } - - public void setClassid(String classid) { - this.classid = classid; - } - - public BigDecimal getActualCost() { - return actualCost; - } - - public void setActualCost(BigDecimal actualCost) { - this.actualCost = actualCost; - } - - public BigDecimal getQuotaCost() { - return quotaCost; - } - - public void setQuotaCost(BigDecimal quotaCost) { - this.quotaCost = quotaCost; - } - - public String getEvaluateUserId() { - return evaluateUserId; - } - - public void setEvaluateUserId(String evaluateUserId) { - this.evaluateUserId = evaluateUserId; - } - - public String getEvaluateOpinion() { - return evaluateOpinion; - } - - public void setEvaluateOpinion(String evaluateOpinion) { - this.evaluateOpinion = evaluateOpinion; - } - - public String getCheckString() { - return checkString; - } - - public void setCheckString(String checkString) { - this.checkString = checkString; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/OrganizationClass.java b/src/com/sipai/entity/administration/OrganizationClass.java deleted file mode 100644 index 97d39323..00000000 --- a/src/com/sipai/entity/administration/OrganizationClass.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.sipai.entity.administration; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class OrganizationClass extends SQLAdapter{ - public static final String Type_0="0";//岗位类型 - public static final String Type_1="1";//工作类型 - - //岗位的属性 - public static final String Attribute_0="0";//运行 - public static final String Attribute_1="1";//行政 - public static final String Attribute_2="2";//维修 - public static final String Attribute_3="3";//化验 - - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String sname; - - private String active; - - private String code; - - private String remarks; - - private String unitId; - - private String type; - - private String attribute; - - //非表中字段 - private String pname; - - private List organizationList; - //end - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getAttribute() { - return attribute; - } - - public void setAttribute(String attribute) { - this.attribute = attribute; - } - - public List getOrganizationList() { - return organizationList; - } - - public void setOrganizationList(List organizationList) { - this.organizationList = organizationList; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/administration/OrganizationCommStr.java b/src/com/sipai/entity/administration/OrganizationCommStr.java deleted file mode 100644 index 04148415..00000000 --- a/src/com/sipai/entity/administration/OrganizationCommStr.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.sipai.entity.administration; - -public class OrganizationCommStr { - - //类型 - public static final String Administration_Type_Organization = "organization";//表示组织 - public static final String Administration_Type_Reserve = "reserve";//表示预案 - -} diff --git a/src/com/sipai/entity/administration/Temporary.java b/src/com/sipai/entity/administration/Temporary.java deleted file mode 100644 index 512892a0..00000000 --- a/src/com/sipai/entity/administration/Temporary.java +++ /dev/null @@ -1,310 +0,0 @@ -package com.sipai.entity.administration; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class Temporary extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String active; - - private String receiveUserId; - - private BigDecimal bonusPenalty; - - private String remarks; - - private String unitId; - - private String jobNumber; - - private String finishDate; - - private String sendUserId; - - private String receiveUserIds; - - private String receiveDt; - - private String workingHours; - - private String processid; - - private String processdefid; - - private String processStatus; - - private String projectName; - - private String planStartDate; - - private String planFinishDate; - - private String classid; - - private String checkDate; - - private String code; - - private String projectCont; - - - private Company company; - - private String sendUser; - private String receiveUser; - private String evaluateUser; - - - public String getSendUser() { - return sendUser; - } - - public void setSendUser(String sendUser) { - this.sendUser = sendUser; - } - - public String getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(String receiveUser) { - this.receiveUser = receiveUser; - } - - public String getEvaluateUser() { - return evaluateUser; - } - - public void setEvaluateUser(String evaluateUser) { - this.evaluateUser = evaluateUser; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public BigDecimal getBonusPenalty() { - return bonusPenalty; - } - - public void setBonusPenalty(BigDecimal bonusPenalty) { - this.bonusPenalty = bonusPenalty; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getFinishDate() { - return finishDate; - } - - public void setFinishDate(String finishDate) { - this.finishDate = finishDate; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getReceiveDt() { - return receiveDt; - } - - public void setReceiveDt(String receiveDt) { - this.receiveDt = receiveDt; - } - - public String getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(String workingHours) { - this.workingHours = workingHours; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getPlanStartDate() { - return planStartDate; - } - - public void setPlanStartDate(String planStartDate) { - this.planStartDate = planStartDate; - } - - public String getPlanFinishDate() { - return planFinishDate; - } - - public void setPlanFinishDate(String planFinishDate) { - this.planFinishDate = planFinishDate; - } - - public String getClassid() { - return classid; - } - - public void setClassid(String classid) { - this.classid = classid; - } - - public String getCheckDate() { - return checkDate; - } - - public void setCheckDate(String checkDate) { - this.checkDate = checkDate; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getProjectCont() { - return projectCont; - } - - public void setProjectCont(String projectCont) { - this.projectCont = projectCont; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmCondition.java b/src/com/sipai/entity/alarm/AlarmCondition.java deleted file mode 100644 index 387e26f9..00000000 --- a/src/com/sipai/entity/alarm/AlarmCondition.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AlarmCondition extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String alarmtypeid; - - private String mpointid; - - private MPoint mPoint; - - private String compare;//1:大于 -1:小于 0:等于 2:范围内[a,b] 3:范围外[-∞,a],[b,+∞] - - private Double val;//大于小于 等于的值 - - private Double upperlimit;//范围上限 - - private Double lowerlimit;//范围下限 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getAlarmtypeid() { - return alarmtypeid; - } - - public void setAlarmtypeid(String alarmtypeid) { - this.alarmtypeid = alarmtypeid; - } - - public String getMpointid() { - return mpointid; - } - - public void setMpointid(String mpointid) { - this.mpointid = mpointid; - } - - public String getCompare() { - return compare; - } - - public void setCompare(String compare) { - this.compare = compare; - } - - public Double getVal() { - return val; - } - - public void setVal(Double val) { - this.val = val; - } - - public Double getUpperlimit() { - return upperlimit; - } - - public void setUpperlimit(Double upperlimit) { - this.upperlimit = upperlimit; - } - - public Double getLowerlimit() { - return lowerlimit; - } - - public void setLowerlimit(Double lowerlimit) { - this.lowerlimit = lowerlimit; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmInformation.java b/src/com/sipai/entity/alarm/AlarmInformation.java deleted file mode 100644 index fbea1ba8..00000000 --- a/src/com/sipai/entity/alarm/AlarmInformation.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.base.SQLAdapter; - -public class AlarmInformation extends SQLAdapter{ - - private String id; - - private String insuser; - - private String insdt; - - private String updater; - - private String updatetime; - - private String name; - - private String code; - - private String unitId; - - private String levelCode; - - private String moldCode; - - private String alarmMode; - - private String alarmReceivers; - - private Integer num; - - private String alarmModeName; - - private String alarmReceiversName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpdater() { - return updater; - } - - public void setUpdater(String updater) { - this.updater = updater; - } - - public String getUpdatetime() { - return updatetime; - } - - public void setUpdatetime(String updatetime) { - this.updatetime = updatetime; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getLevelCode() { - return levelCode; - } - - public void setLevelCode(String levelCode) { - this.levelCode = levelCode; - } - - public String getMoldCode() { - return moldCode; - } - - public void setMoldCode(String moldCode) { - this.moldCode = moldCode; - } - - public String getAlarmMode() { - return alarmMode; - } - - public void setAlarmMode(String alarmMode) { - this.alarmMode = alarmMode; - } - - public String getAlarmReceivers() { - return alarmReceivers; - } - - public void setAlarmReceivers(String alarmReceivers) { - this.alarmReceivers = alarmReceivers; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - - public String getAlarmModeName() { - return alarmModeName; - } - - public void setAlarmModeName(String alarmModeName) { - this.alarmModeName = alarmModeName; - } - - public String getAlarmReceiversName() { - return alarmReceiversName; - } - - public void setAlarmReceiversName(String alarmReceiversName) { - this.alarmReceiversName = alarmReceiversName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmInformationAlarmModeEnum.java b/src/com/sipai/entity/alarm/AlarmInformationAlarmModeEnum.java deleted file mode 100644 index 7da83430..00000000 --- a/src/com/sipai/entity/alarm/AlarmInformationAlarmModeEnum.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.ArrayList; -import java.util.List; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import net.sf.json.JSONArray; - -/** - * 报警方式 枚举 - * - */ -public enum AlarmInformationAlarmModeEnum { - news("news","消息"), - message("message","短信"), - all("all","消息+短信"); - - private String name; - private String key; - - AlarmInformationAlarmModeEnum(String key,String name){ - this.key = key; - this.name = name; - } - - /** - * 根据key返回枚举 - * @param key - * @return - */ - public static String getName(String key){ - for(AlarmInformationAlarmModeEnum alarmInformationEnum:values()){ - if(alarmInformationEnum.key.equals(key)){ - return alarmInformationEnum.name; - } - } - return null; - } - - public static String getJsonString(){ - JSONArray jsondata=new JSONArray(); - for(AlarmInformationAlarmModeEnum alarmInformationEnum:values()){ - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmInformationEnum.key); - jsonObject.put("text",alarmInformationEnum.name); - jsondata.add(jsonObject); - } - String str = JSON.toJSONString(jsondata); - return str; - } - - public static List getList(){ - List list=new ArrayList<>(); - for(AlarmInformationAlarmModeEnum alarmInformationEnum:values()){ - AlarmInformation alarmInformation=new AlarmInformation(); - alarmInformation.setCode(alarmInformationEnum.key); - alarmInformation.setName(alarmInformationEnum.name); - list.add(alarmInformation); - } - return list; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmLevels.java b/src/com/sipai/entity/alarm/AlarmLevels.java deleted file mode 100644 index a46baf6a..00000000 --- a/src/com/sipai/entity/alarm/AlarmLevels.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.base.SQLAdapter; - -public class AlarmLevels extends SQLAdapter{ - private String id; - - private String name; - - private String code; - - private Integer morder; - - private Integer num; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmLevelsCodeEnum.java b/src/com/sipai/entity/alarm/AlarmLevelsCodeEnum.java deleted file mode 100644 index 2e40b768..00000000 --- a/src/com/sipai/entity/alarm/AlarmLevelsCodeEnum.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.ArrayList; -import java.util.List; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import net.sf.json.JSONArray; - -/** - * 报警等级 枚举 - * - */ -public enum AlarmLevelsCodeEnum { - level1("level1","1级"), - level2("level2","2级"), - level3("level3","3级"); - - private String name; - private String key; - - AlarmLevelsCodeEnum(String key,String name){ - this.key = key; - this.name = name; - } - - /** - * 根据key返回枚举 - * @param key - * @return - */ - public static String getName(String key){ - for(AlarmLevelsCodeEnum alarmLevelsEnum:values()){ - if(alarmLevelsEnum.key.equals(key)){ - return alarmLevelsEnum.name; - } - } - return null; - } - - public static String getJsonString(){ - JSONArray jsondata=new JSONArray(); - for(AlarmLevelsCodeEnum alarmLevelsEnum:values()){ - JSONObject jsonObject=new JSONObject(); - jsonObject.put("id",alarmLevelsEnum.key); - jsonObject.put("text",alarmLevelsEnum.name); - jsondata.add(jsonObject); - } - String str = JSON.toJSONString(jsondata); - return str; - } - - public static List getList(){ - List list=new ArrayList<>(); - int index=0; - for(AlarmLevelsCodeEnum alarmLevelsEnum:values()){ - AlarmLevels alarmLevels=new AlarmLevels(); - alarmLevels.setCode(alarmLevelsEnum.key); - alarmLevels.setName(alarmLevelsEnum.name); - alarmLevels.setMorder(index); - list.add(alarmLevels); - index++; - } - return list; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmLevelsConfig.java b/src/com/sipai/entity/alarm/AlarmLevelsConfig.java deleted file mode 100644 index f25561e6..00000000 --- a/src/com/sipai/entity/alarm/AlarmLevelsConfig.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.entity.alarm; - -public class AlarmLevelsConfig { - private String id; - - private Integer upperLimit; - - private Integer lowerLimit; - - private String level; - - private String color; - - private Integer fraction; - - private String remark; - - private Integer code; - - private String limit; - - private String where; - - public String getLimit() { - return limit; - } - - public void setLimit(String limit) { - this.limit = limit; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public Integer getUpperLimit() { - return upperLimit; - } - - public void setUpperLimit(Integer upperLimit) { - this.upperLimit = upperLimit; - } - - public Integer getLowerLimit() { - return lowerLimit; - } - - public void setLowerLimit(Integer lowerLimit) { - this.lowerLimit = lowerLimit; - } - - public String getLevel() { - return level; - } - - public void setLevel(String level) { - this.level = level == null ? null : level.trim(); - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color == null ? null : color.trim(); - } - - public Integer getFraction() { - return fraction; - } - - public void setFraction(Integer fraction) { - this.fraction = fraction; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } -} diff --git a/src/com/sipai/entity/alarm/AlarmMold.java b/src/com/sipai/entity/alarm/AlarmMold.java deleted file mode 100644 index 2ed58a59..00000000 --- a/src/com/sipai/entity/alarm/AlarmMold.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.base.SQLAdapter; - -public class AlarmMold extends SQLAdapter{ - private String id; - - private String name; - - private String code; - - private Integer morder; - - private Integer num; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmMoldCodeEnum.java b/src/com/sipai/entity/alarm/AlarmMoldCodeEnum.java deleted file mode 100644 index a3b42b0d..00000000 --- a/src/com/sipai/entity/alarm/AlarmMoldCodeEnum.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.ArrayList; -import java.util.List; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - -import net.sf.json.JSONArray; - -/** - * 报警类型 枚举 - */ -public enum AlarmMoldCodeEnum { - // Up_Pro("Up_Pro","上限报警"), -// UpTop_Pro("UpTop_Pro","上极限报警"), -// Low_Pro("Low_Pro","下限报警"), -// LowTop_Pro("LowTop_Pro","下极限报警"), - LimitValue_Pro("LimitValue_Pro", "限值报警"), - EquAbnormal_Pro("EquAbnormal_Pro", "设备异常报警"), - EquShutdown_Pro("EquShutdown_Pro", "设备停机报警"), - ValueMutation_Pro("ValueMutation_Pro", "值突变报警"), - CycleAnomaly_Pro("CycleAnomaly_Pro", "周期异常报警"), - DataStop_Pro("DataStop_Pro", "数据停滞报警"), - Urgent_Button("Urgent_Button", "紧急报警"), - Type_ZNPD("Type_ZNPD", "智能配电报警"), - Type_HYDB("Type_HYDB", "化验超标报警"), - Type_SCADA("Type_SCADA", "上位机报警"), - Type_PeopleSafe("Type_PeopleSafe", "人员安全报警"), - Type_Location_Fence("Type_Location_Fence", "电子围栏报警"), - Type_Data_Stop("Type_Data_Stop", "数据中断"), - Type_Data_Anomaly("Type_Data_Anomaly", "异常趋势"), - Type_External_Sys_Alarm("Type_External_Sys_Alarm", "外部集成报警"), - Type_Emergency("Type_Emergency", "应急预案"); - - - private String name; - private String key; - - AlarmMoldCodeEnum(String key, String name) { - this.key = key; - this.name = name; - } - - /** - * 根据key返回枚举 - * - * @param key - * @return - */ - public static String getName(String key) { - for (AlarmMoldCodeEnum alarmLevelsEnum : values()) { - if (alarmLevelsEnum.key.equals(key)) { - return alarmLevelsEnum.name; - } - } - return null; - } - - public static String getJsonString() { - JSONArray jsondata = new JSONArray(); - for (AlarmMoldCodeEnum alarmLevelsEnum : values()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", alarmLevelsEnum.key); - jsonObject.put("text", alarmLevelsEnum.name + "(" + alarmLevelsEnum.key + ")"); - jsonObject.put("name", alarmLevelsEnum.name); - jsondata.add(jsonObject); - } - String str = JSON.toJSONString(jsondata); - return str; - } - - public static String getJsonString2() { - JSONArray jsondata = new JSONArray(); - for (AlarmMoldCodeEnum alarmLevelsEnum : values()) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", alarmLevelsEnum.key); - jsonObject.put("text", alarmLevelsEnum.name); - jsondata.add(jsonObject); - } - String str = JSON.toJSONString(jsondata); - return str; - } - - public static List getList() { - List list = new ArrayList<>(); - int index = 0; - for (AlarmMoldCodeEnum alarmLevelsEnum : values()) { - AlarmMold alarmLevels = new AlarmMold(); - alarmLevels.setCode(alarmLevelsEnum.key); - alarmLevels.setName(alarmLevelsEnum.name); - alarmLevels.setMorder(index); - list.add(alarmLevels); - index++; - } - return list; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmPoint.java b/src/com/sipai/entity/alarm/AlarmPoint.java deleted file mode 100644 index be93ad47..00000000 --- a/src/com/sipai/entity/alarm/AlarmPoint.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AlarmPoint extends SQLAdapter{ - public final static String Type_MPoint="MPoint"; - public final static String Type_Other="other"; - - private String id; - - private String insuser; - - private String insdt; - - private String updater; - - private String updatetime; - - private String alarmPoint; - - private String baseValue; - - private String informationCode; - - private String type; - - private String unitId; - - private String alarmPointName; - - private String informationCodeName; - - private MPoint mPoint; - - private String alarmMode; - - private String alarmReceivers; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpdater() { - return updater; - } - - public void setUpdater(String updater) { - this.updater = updater; - } - - public String getUpdatetime() { - return updatetime; - } - - public void setUpdatetime(String updatetime) { - this.updatetime = updatetime; - } - - public String getAlarmPoint() { - return alarmPoint; - } - - public void setAlarmPoint(String alarmPoint) { - this.alarmPoint = alarmPoint; - } - - public String getBaseValue() { - return baseValue; - } - - public void setBaseValue(String baseValue) { - this.baseValue = baseValue; - } - - public String getInformationCode() { - return informationCode; - } - - public void setInformationCode(String informationCode) { - this.informationCode = informationCode; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getAlarmPointName() { - return alarmPointName; - } - - public void setAlarmPointName(String alarmPointName) { - this.alarmPointName = alarmPointName; - } - - public String getInformationCodeName() { - return informationCodeName; - } - - public void setInformationCodeName(String informationCodeName) { - this.informationCodeName = informationCodeName; - } - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getAlarmMode() { - return alarmMode; - } - - public void setAlarmMode(String alarmMode) { - this.alarmMode = alarmMode; - } - - public String getAlarmReceivers() { - return alarmReceivers; - } - - public void setAlarmReceivers(String alarmReceivers) { - this.alarmReceivers = alarmReceivers; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmPointRiskLevel.java b/src/com/sipai/entity/alarm/AlarmPointRiskLevel.java deleted file mode 100644 index 0311fa87..00000000 --- a/src/com/sipai/entity/alarm/AlarmPointRiskLevel.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.work.AreaManage; - -public class AlarmPointRiskLevel extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String areaId; - - private String riskLevelId; - - private Integer morder; - - private String alarmpointId; - - private String areaText; - - private RiskLevel riskLevel; - - private AreaManage areaManage; - - public String getAreaText() { - return areaText; - } - - public void setAreaText(String areaText) { - this.areaText = areaText; - } - - public RiskLevel getRiskLevel() { - return riskLevel; - } - - public void setRiskLevel(RiskLevel riskLevel) { - this.riskLevel = riskLevel; - } - - public AreaManage getAreaManage() { - return areaManage; - } - - public void setAreaManage(AreaManage areaManage) { - this.areaManage = areaManage; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getAreaId() { - return areaId; - } - - public void setAreaId(String areaId) { - this.areaId = areaId == null ? null : areaId.trim(); - } - - public String getRiskLevelId() { - return riskLevelId; - } - - public void setRiskLevelId(String riskLevelId) { - this.riskLevelId = riskLevelId == null ? null : riskLevelId.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getAlarmpointId() { - return alarmpointId; - } - - public void setAlarmpointId(String alarmpointId) { - this.alarmpointId = alarmpointId == null ? null : alarmpointId.trim(); - } -} diff --git a/src/com/sipai/entity/alarm/AlarmRecord.java b/src/com/sipai/entity/alarm/AlarmRecord.java deleted file mode 100644 index 14f1aedc..00000000 --- a/src/com/sipai/entity/alarm/AlarmRecord.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class AlarmRecord extends SQLAdapter{ - private String id; - - private String insdt; - - private String alarmtypeid; - - private String state; - - private AlarmType alarmType; - - private String operates; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getAlarmtypeid() { - return alarmtypeid; - } - - public void setAlarmtypeid(String alarmtypeid) { - this.alarmtypeid = alarmtypeid; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public AlarmType getAlarmType() { - return alarmType; - } - - public void setAlarmType(AlarmType alarmType) { - this.alarmType = alarmType; - } - - public String getOperates() { - return operates; - } - - public void setOperates(String operates) { - this.operates = operates; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmSolution.java b/src/com/sipai/entity/alarm/AlarmSolution.java deleted file mode 100644 index b8350d80..00000000 --- a/src/com/sipai/entity/alarm/AlarmSolution.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; - -public class AlarmSolution extends SQLAdapter{ - private String id; - - private String alarmtypeid; - - private String insdt; - - private String insuser; - - private String solution;//解决措施 - - private String result;//预计效果 - - private Boolean isissueorder;//是否下发工单 - - private String ordertype;//工单类型 - - private String orderdescribe;//工单描述 - - private String deptids;//接收岗位ids - - private List depts;//接收岗位 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getAlarmtypeid() { - return alarmtypeid; - } - - public void setAlarmtypeid(String alarmtypeid) { - this.alarmtypeid = alarmtypeid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSolution() { - return solution; - } - - public void setSolution(String solution) { - this.solution = solution; - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result; - } - - public Boolean getIsissueorder() { - return isissueorder; - } - - public void setIsissueorder(Boolean isissueorder) { - this.isissueorder = isissueorder; - } - - public String getOrdertype() { - return ordertype; - } - - public void setOrdertype(String ordertype) { - this.ordertype = ordertype; - } - - public String getOrderdescribe() { - return orderdescribe; - } - - public void setOrderdescribe(String orderdescribe) { - this.orderdescribe = orderdescribe; - } - - public String getDeptids() { - return deptids; - } - - public void setDeptids(String deptids) { - this.deptids = deptids; - } - - public List getDepts() { - return depts; - } - - public void setDepts(List depts) { - this.depts = depts; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmSubscribe.java b/src/com/sipai/entity/alarm/AlarmSubscribe.java deleted file mode 100644 index b70cd237..00000000 --- a/src/com/sipai/entity/alarm/AlarmSubscribe.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AlarmSubscribe extends SQLAdapter { - private String id; - - private String unitId; - - private String alarmPointId; - - private String userid; - - private String moldCode; - private String levelCode; - private String alarmPoint; - private String alarmPointName; - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getAlarmPointId() { - return alarmPointId; - } - - public void setAlarmPointId(String alarmPointId) { - this.alarmPointId = alarmPointId == null ? null : alarmPointId.trim(); - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid == null ? null : userid.trim(); - } - - public String getMoldCode() { - return moldCode; - } - - public void setMoldCode(String moldCode) { - this.moldCode = moldCode; - } - - public String getLevelCode() { - return levelCode; - } - - public void setLevelCode(String levelCode) { - this.levelCode = levelCode; - } - - public String getAlarmPoint() { - return alarmPoint; - } - - public void setAlarmPoint(String alarmPoint) { - this.alarmPoint = alarmPoint; - } - - public String getAlarmPointName() { - return alarmPointName; - } - - public void setAlarmPointName(String alarmPointName) { - this.alarmPointName = alarmPointName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/AlarmType.java b/src/com/sipai/entity/alarm/AlarmType.java deleted file mode 100644 index ef6cb2b9..00000000 --- a/src/com/sipai/entity/alarm/AlarmType.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class AlarmType extends SQLAdapter{ - private String id; - - private String type; - - private String pid; - - private String insdt; - - private String insuser; - - private String _pname; - - private String describe;//预警异常描述 - - private String noticeType;//提醒类型 - - private String no;//编号 - - private String operaterId; - - private List operaters; - - private boolean state;//启用、禁用 - - private boolean autoIssue;//自动下发 - - private String unitid;//厂区 - - public boolean isState() { - return state; - } - - public void setState(boolean state) { - this.state = state; - } - - public boolean isAutoIssue() { - return autoIssue; - } - - public void setAutoIssue(boolean autoIssue) { - this.autoIssue = autoIssue; - } - - public String getOperaterId() { - return operaterId; - } - - public void setOperaterId(String operaterId) { - this.operaterId = operaterId; - } - - public List getOperaters() { - return operaters; - } - - public void setOperaters(List operaters) { - this.operaters = operaters; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public String getNoticeType() { - return noticeType; - } - - public void setNoticeType(String noticeType) { - this.noticeType = noticeType; - } - - public String getNo() { - return no; - } - - public void setNo(String no) { - this.no = no; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/alarm/OrderType.java b/src/com/sipai/entity/alarm/OrderType.java deleted file mode 100644 index c7b97698..00000000 --- a/src/com/sipai/entity/alarm/OrderType.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.sipai.entity.alarm; - -import java.util.Arrays; -import java.util.List; - -public enum OrderType { - TT("T","临时任务"),PA("P","工艺调整申请"),EA("E","设备调整申请"); - - private String id; - private String name; - private OrderType(String id,String name){ - this.setId(id); - this.setName(name); - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - public static String getName(String id){ - for(OrderType orderType:OrderType.values()){ - if(orderType.getId().equals(id)){ - return orderType.getName(); - } - } - return null; - } - - public static List getList(){ - List list = Arrays.asList(OrderType.values()); - return list; - } -} diff --git a/src/com/sipai/entity/alarm/RiskP.java b/src/com/sipai/entity/alarm/RiskP.java deleted file mode 100644 index 3f314fe6..00000000 --- a/src/com/sipai/entity/alarm/RiskP.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.alarm; - -import com.sipai.entity.hqconfig.RiskLevel; - -public class RiskP { - private String id; - - /** - * 父id - */ - private String pId; - - /** - * 风险项id - */ - private String rId; - - /** - * 区域ids - */ - private String place; - - private RiskLevel riskLevel; - - private String where; - - public RiskLevel getRiskLevel() { - return riskLevel; - } - - public void setRiskLevel(RiskLevel riskLevel) { - this.riskLevel = riskLevel; - } - - public String getPlace() { - return place; - } - - public void setPlace(String place) { - this.place = place; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getpId() { - return pId; - } - - public void setpId(String pId) { - this.pId = pId == null ? null : pId.trim(); - } - - public String getrId() { - return rId; - } - - public void setrId(String rId) { - this.rId = rId == null ? null : rId.trim(); - } - -} diff --git a/src/com/sipai/entity/app/AppDataConfigure.java b/src/com/sipai/entity/app/AppDataConfigure.java deleted file mode 100644 index d1e0f78c..00000000 --- a/src/com/sipai/entity/app/AppDataConfigure.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.entity.app; - -import com.sipai.entity.base.SQLAdapter; - -public class AppDataConfigure extends SQLAdapter{ - - public final static String type_newData="newData"; - public final static String type_hisData="hisData"; - - private String id; - - private String dataname; - - private String showname; - - private String unitid; - - private String type; - - private String datatype; - - private Integer morder; - - private String active; - - private Double value; - - private Double inivalue; - - private String mpcode; - - private String insdt; - - private String bizname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataname() { - return dataname; - } - - public void setDataname(String dataname) { - this.dataname = dataname; - } - - public String getShowname() { - return showname; - } - - public void setShowname(String showname) { - this.showname = showname; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public Double getInivalue() { - return inivalue; - } - - public void setInivalue(Double inivalue) { - this.inivalue = inivalue; - } - - public String getDatatype() { - return datatype; - } - - public void setDatatype(String datatype) { - this.datatype = datatype; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizname() { - return bizname; - } - - public void setBizname(String bizname) { - this.bizname = bizname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/app/AppHomePageData.java b/src/com/sipai/entity/app/AppHomePageData.java deleted file mode 100644 index 14474b16..00000000 --- a/src/com/sipai/entity/app/AppHomePageData.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.entity.app; - -import com.sipai.entity.base.SQLAdapter; - -public class AppHomePageData extends SQLAdapter{ - private String id; - - private Double todayyearwater;//今年累计处理量 - - private Double onlinewater;//在线运营处理能力 - - private Double waterquantity;//水量 - - private Double waterrate;//水达标率 - - private Double mudvolume;//泥量 - - private Double mudrate;//泥达标率 - - private Integer totaleqnum;//总设备数量 - - private Integer usingeqnum;//投运设备数量 - - private Integer aeq;//A类设备 - - private Integer beq;//B类设备 - - private Integer ceq;//C类设备 - - private Double eqrate;//设备完好率 - - private Double overhaulrate;//大修完成率 - - private Double maintainrate;//保养完成率 - - private Integer abnormalnum;//异常数量 - - private Integer abnormaladdnum;//今日新增异常数量 - - private Integer workingabnormalnum;//运行异常数量 - - private Integer eqabnormalnum;//设备异常数量 - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Double getTodayyearwater() { - return todayyearwater; - } - - public void setTodayyearwater(Double todayyearwater) { - this.todayyearwater = todayyearwater; - } - - public Double getOnlinewater() { - return onlinewater; - } - - public void setOnlinewater(Double onlinewater) { - this.onlinewater = onlinewater; - } - - public Double getWaterquantity() { - return waterquantity; - } - - public void setWaterquantity(Double waterquantity) { - this.waterquantity = waterquantity; - } - - public Double getWaterrate() { - return waterrate; - } - - public void setWaterrate(Double waterrate) { - this.waterrate = waterrate; - } - - public Double getMudvolume() { - return mudvolume; - } - - public void setMudvolume(Double mudvolume) { - this.mudvolume = mudvolume; - } - - public Double getMudrate() { - return mudrate; - } - - public void setMudrate(Double mudrate) { - this.mudrate = mudrate; - } - - public Integer getTotaleqnum() { - return totaleqnum; - } - - public void setTotaleqnum(Integer totaleqnum) { - this.totaleqnum = totaleqnum; - } - - public Integer getUsingeqnum() { - return usingeqnum; - } - - public void setUsingeqnum(Integer usingeqnum) { - this.usingeqnum = usingeqnum; - } - - public Integer getAeq() { - return aeq; - } - - public void setAeq(Integer aeq) { - this.aeq = aeq; - } - - public Integer getBeq() { - return beq; - } - - public void setBeq(Integer beq) { - this.beq = beq; - } - - public Integer getCeq() { - return ceq; - } - - public void setCeq(Integer ceq) { - this.ceq = ceq; - } - - public Double getEqrate() { - return eqrate; - } - - public void setEqrate(Double eqrate) { - this.eqrate = eqrate; - } - - public Double getOverhaulrate() { - return overhaulrate; - } - - public void setOverhaulrate(Double overhaulrate) { - this.overhaulrate = overhaulrate; - } - - public Double getMaintainrate() { - return maintainrate; - } - - public void setMaintainrate(Double maintainrate) { - this.maintainrate = maintainrate; - } - - public Integer getAbnormalnum() { - return abnormalnum; - } - - public void setAbnormalnum(Integer abnormalnum) { - this.abnormalnum = abnormalnum; - } - - public Integer getAbnormaladdnum() { - return abnormaladdnum; - } - - public void setAbnormaladdnum(Integer abnormaladdnum) { - this.abnormaladdnum = abnormaladdnum; - } - - public Integer getWorkingabnormalnum() { - return workingabnormalnum; - } - - public void setWorkingabnormalnum(Integer workingabnormalnum) { - this.workingabnormalnum = workingabnormalnum; - } - - public Integer getEqabnormalnum() { - return eqabnormalnum; - } - - public void setEqabnormalnum(Integer eqabnormalnum) { - this.eqabnormalnum = eqabnormalnum; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/app/AppMenuitem.java b/src/com/sipai/entity/app/AppMenuitem.java deleted file mode 100644 index fb7ec361..00000000 --- a/src/com/sipai/entity/app/AppMenuitem.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.app; - -import com.sipai.entity.base.SQLAdapter; - -public class AppMenuitem extends SQLAdapter { - private String id; - - private String pid; - - private String name; - - private String description; - - private String location; - - private Integer morder; - - private String active; - - private String type; - - private String status; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location == null ? null : location.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active == null ? null : active.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/app/AppProductMonitor.java b/src/com/sipai/entity/app/AppProductMonitor.java deleted file mode 100644 index 7baffc22..00000000 --- a/src/com/sipai/entity/app/AppProductMonitor.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.sipai.entity.app; - -import com.sipai.entity.base.SQLAdapter; - -public class AppProductMonitor extends SQLAdapter { - private String id; - - private String name; - - private String runMpid; - - private String faultMpid; - - private String currentMpid; - - private String memo; - - private Integer morder; - - private String type; - - private String insdt; - - private String insuser; - - private String unitId; - - private String sname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRunMpid() { - return runMpid; - } - - public void setRunMpid(String runMpid) { - this.runMpid = runMpid; - } - - public String getFaultMpid() { - return faultMpid; - } - - public void setFaultMpid(String faultMpid) { - this.faultMpid = faultMpid; - } - - public String getCurrentMpid() { - return currentMpid; - } - - public void setCurrentMpid(String currentMpid) { - this.currentMpid = currentMpid; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/app/AppProductMonitorMp.java b/src/com/sipai/entity/app/AppProductMonitorMp.java deleted file mode 100644 index 71a50ea3..00000000 --- a/src/com/sipai/entity/app/AppProductMonitorMp.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.entity.app; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class AppProductMonitorMp extends SQLAdapter { - private String id; - - private String pid; - - private String mpid; - - private String posx; - - private String posy; - - private String insdt; - - private String insuser; - - private String ownerId; - - private String txt; - - private String fsize; - - private Integer accuracy; - - private Integer morder; - - private String unitId; - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getPosx() { - return posx; - } - - public void setPosx(String posx) { - this.posx = posx; - } - - public String getPosy() { - return posy; - } - - public void setPosy(String posy) { - this.posy = posy; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getOwnerId() { - return ownerId; - } - - public void setOwnerId(String ownerId) { - this.ownerId = ownerId; - } - - public String getTxt() { - return txt; - } - - public void setTxt(String txt) { - this.txt = txt; - } - - public String getFsize() { - return fsize; - } - - public void setFsize(String fsize) { - this.fsize = fsize; - } - - public Integer getAccuracy() { - return accuracy; - } - - public void setAccuracy(Integer accuracy) { - this.accuracy = accuracy; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/app/AppRoleMenu.java b/src/com/sipai/entity/app/AppRoleMenu.java deleted file mode 100644 index ea43f4bb..00000000 --- a/src/com/sipai/entity/app/AppRoleMenu.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.entity.app; - -import com.sipai.entity.base.SQLAdapter; - -public class AppRoleMenu extends SQLAdapter { - private String roleid; - - private String menuid; - - public String getRoleid() { - return roleid; - } - - public void setRoleid(String roleid) { - this.roleid = roleid == null ? null : roleid.trim(); - } - - public String getMenuid() { - return menuid; - } - - public void setMenuid(String menuid) { - this.menuid = menuid == null ? null : menuid.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/BaseConfig.java b/src/com/sipai/entity/base/BaseConfig.java deleted file mode 100644 index 1fd180e1..00000000 --- a/src/com/sipai/entity/base/BaseConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.entity.base; - -import java.util.List; - -public class BaseConfig { - private String TargetServer_MiniMes; - private String TargetServer_RFID; - private String TargetServer_MiniMesForActwo; - public String getTargetServer_MiniMesForActwo() { - return TargetServer_MiniMesForActwo; - } - public void setTargetServer_MiniMesForActwo(String targetServer_MiniMesForActwo) { - TargetServer_MiniMesForActwo = targetServer_MiniMesForActwo; - } - public String getTargetServer_MiniMes() { - return TargetServer_MiniMes; - } - public void setTargetServer_MiniMes(String targetServer_MiniMes) { - TargetServer_MiniMes = targetServer_MiniMes; - } - public String getTargetServer_RFID() { - return TargetServer_RFID; - } - public void setTargetServer_RFID(String targetServer_RFID) { - TargetServer_RFID = targetServer_RFID; - } - - - -} diff --git a/src/com/sipai/entity/base/BasicComponents.java b/src/com/sipai/entity/base/BasicComponents.java deleted file mode 100644 index df70c996..00000000 --- a/src/com/sipai/entity/base/BasicComponents.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.base; - -import java.util.Date; - -public class BasicComponents extends SQLAdapter{ - private String code; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String active; - - private String remark; - - private String type; - - private BasicConfigure basicConfigure; - - - public BasicConfigure getBasicConfigure() { - return basicConfigure; - } - - public void setBasicConfigure(BasicConfigure basicConfigure) { - this.basicConfigure = basicConfigure; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/BasicConfigure.java b/src/com/sipai/entity/base/BasicConfigure.java deleted file mode 100644 index ec0e3a1d..00000000 --- a/src/com/sipai/entity/base/BasicConfigure.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.base; - -import java.util.Date; - -public class BasicConfigure extends SQLAdapter{ - - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String active; - - private String remark; - - private String type; - - private String abspath; - - private String url; - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/BasicHomePage.java b/src/com/sipai/entity/base/BasicHomePage.java deleted file mode 100644 index 8a9671eb..00000000 --- a/src/com/sipai/entity/base/BasicHomePage.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.base; - -public class BasicHomePage extends SQLAdapter { - public static final String Type_Sys = "sys";//系统 - public static final String Type_Personal = "personal";//个人 - - private String id; - - private String userid; - - private String unitid; - - private String type; - - private String active; - - private String url; - - private String rolepeople; - - private String unrolepeople; - - private String rolepeopleName; - private String unrolepeopleName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid == null ? null : userid.trim(); - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active == null ? null : active.trim(); - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url == null ? null : url.trim(); - } - - public String getRolepeople() { - return rolepeople; - } - - public void setRolepeople(String rolepeople) { - this.rolepeople = rolepeople == null ? null : rolepeople.trim(); - } - - public String getUnrolepeople() { - return unrolepeople; - } - - public void setUnrolepeople(String unrolepeople) { - this.unrolepeople = unrolepeople == null ? null : unrolepeople.trim(); - } - - public String getRolepeopleName() { - return rolepeopleName; - } - - public void setRolepeopleName(String rolepeopleName) { - this.rolepeopleName = rolepeopleName; - } - - public String getUnrolepeopleName() { - return unrolepeopleName; - } - - public void setUnrolepeopleName(String unrolepeopleName) { - this.unrolepeopleName = unrolepeopleName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/BusinessUnitAdapter.java b/src/com/sipai/entity/base/BusinessUnitAdapter.java deleted file mode 100644 index 2b4844cd..00000000 --- a/src/com/sipai/entity/base/BusinessUnitAdapter.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.base; - -public class BusinessUnitAdapter extends SQLAdapter{ - private String processdefid; - private String processid; - private String insuser; - public String getProcessdefid() { - return processdefid; - } - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - public String getProcessid() { - return processid; - } - public void setProcessid(String processid) { - this.processid = processid; - } - public String getInsuser() { - return insuser; - } - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - -} diff --git a/src/com/sipai/entity/base/CommonFile.java b/src/com/sipai/entity/base/CommonFile.java deleted file mode 100644 index 5c88298b..00000000 --- a/src/com/sipai/entity/base/CommonFile.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.entity.base; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.User; - -public class CommonFile extends SQLAdapter { - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private int size; - - private String insuser; - - private String insdt; - - private String type; - - private User user; - - private String equipmentcardnames; - - private String equipmentcardids; - - private String streamFile; - - private String pointId; - - private String documentName; - - private String equipmentName; - - private String equipmentCardID; - - private String equipmentId; - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getEquipmentCardID() { - return equipmentCardID; - } - - public void setEquipmentCardID(String equipmentCardID) { - this.equipmentCardID = equipmentCardID; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getDocumentName() { - return documentName; - } - - public void setDocumentName(String documentName) { - this.documentName = documentName; - } - - public String getStreamFile() { - return streamFile; - } - - public void setStreamFile(String streamFile) { - this.streamFile = streamFile; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getEquipmentcardnames() { - return equipmentcardnames; - } - - public void setEquipmentcardnames(String equipmentcardnames) { - this.equipmentcardnames = equipmentcardnames; - } - - public String getEquipmentcardids() { - return equipmentcardids; - } - - public void setEquipmentcardids(String equipmentcardids) { - this.equipmentcardids = equipmentcardids; - } - - public String getPointId() { - return pointId; - } - - public void setPointId(String pointId) { - this.pointId = pointId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/LineChart.java b/src/com/sipai/entity/base/LineChart.java deleted file mode 100644 index 1f30d6f5..00000000 --- a/src/com/sipai/entity/base/LineChart.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.entity.base; - -import java.math.BigDecimal; -import java.util.ArrayList; - - -public class LineChart{ - - private ArrayList value; - - private ArrayList datetime; - - - public ArrayList getValue() { - return value; - } - - public void setValue(ArrayList value) { - this.value = value; - } - - public ArrayList getDatetime() { - return datetime; - } - - public void setDatetime(ArrayList datetime) { - this.datetime = datetime; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/MainConfig.java b/src/com/sipai/entity/base/MainConfig.java deleted file mode 100644 index 2acc2dac..00000000 --- a/src/com/sipai/entity/base/MainConfig.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.entity.base; - -/** - * 配置首页点位 - */ -public class MainConfig extends SQLAdapter{ - public final static String type_pro="pro";//生产 - public final static String type_safe="safe";//安全 - public final static String type_eff="eff";//效率 - public final static String type_pic="pic";//左上角图片 - - private String id; - - private String mpointId; - - private String type; - - private Integer morder; - - private String funName; - - private String divId; - - private String testId; - - private String memo; - - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getFunName() { - return funName; - } - - public void setFunName(String funName) { - this.funName = funName; - } - - public String getDivId() { - return divId; - } - - public void setDivId(String divId) { - this.divId = divId; - } - - public String getTestId() { - return testId; - } - - public void setTestId(String testId) { - this.testId = testId; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/MainPage.java b/src/com/sipai/entity/base/MainPage.java deleted file mode 100644 index bcf80f99..00000000 --- a/src/com/sipai/entity/base/MainPage.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.base; - -import java.util.Date; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; - -public class MainPage extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String mpointId; - - private String type; - - private String showWay; - - private Integer morder; - - private MPoint mPoint; - - private MPoint4APP mPoint4APP; - - private MainPageType mainPageType; - - public MainPageType getMainPageType() { - return mainPageType; - } - public void setMainPageType(MainPageType mainPageType) { - this.mainPageType = mainPageType; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getShowWay() { - return showWay; - } - - public void setShowWay(String showWay) { - this.showWay = showWay; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public MPoint4APP getmPoint4APP() { - return mPoint4APP; - } - - public void setmPoint4APP(MPoint4APP mPoint4APP) { - this.mPoint4APP = mPoint4APP; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/MainPageType.java b/src/com/sipai/entity/base/MainPageType.java deleted file mode 100644 index 32a284d4..00000000 --- a/src/com/sipai/entity/base/MainPageType.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.base; - -import java.util.Date; - -public class MainPageType extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String title; - - private Integer morder; - - private Integer height; - - private Integer classlg; - - private Boolean active; - - private String style; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getHeight() { - return height; - } - - public void setHeight(Integer height) { - this.height = height; - } - - public Integer getClasslg() { - return classlg; - } - - public void setClasslg(Integer classlg) { - this.classlg = classlg; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/MainPageTypeStyleEnum.java b/src/com/sipai/entity/base/MainPageTypeStyleEnum.java deleted file mode 100644 index 97622413..00000000 --- a/src/com/sipai/entity/base/MainPageTypeStyleEnum.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.sipai.entity.base; -/** - * - * @author WXP - * - */ -public enum MainPageTypeStyleEnum { - produce,efficiency,verticalBlock,horizontalBlock -} diff --git a/src/com/sipai/entity/base/MainPageTypeUser.java b/src/com/sipai/entity/base/MainPageTypeUser.java deleted file mode 100644 index bb92307b..00000000 --- a/src/com/sipai/entity/base/MainPageTypeUser.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.base; - -import java.util.Date; - -public class MainPageTypeUser extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String type; - - private Integer morder; - - private Boolean active; - - private MainPageType mainPageType; - - - public MainPageType getMainPageType() { - return mainPageType; - } - - public void setMainPageType(MainPageType mainPageType) { - this.mainPageType = mainPageType; - } - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/base/MinioConfiguration.java b/src/com/sipai/entity/base/MinioConfiguration.java deleted file mode 100644 index 7a0cabc2..00000000 --- a/src/com/sipai/entity/base/MinioConfiguration.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.base; - -import io.minio.MinioClient; -import io.minio.errors.InvalidEndpointException; -import io.minio.errors.InvalidPortException; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -import com.sipai.tools.MinioProp; - -@Configuration -@ComponentScan -public class MinioConfiguration { - - @Autowired - private MinioProp minioProp; - - @Bean - public MinioClient minioClient() throws InvalidPortException, InvalidEndpointException { - MinioClient client =new MinioClient(minioProp.getEndPoint(),minioProp.getAccessKey(),minioProp.getSecretKey()); - return client; - } - -} diff --git a/src/com/sipai/entity/base/Result.java b/src/com/sipai/entity/base/Result.java deleted file mode 100644 index cb4cbd75..00000000 --- a/src/com/sipai/entity/base/Result.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.base; - -import com.alibaba.fastjson.JSON; - -/** - * - * @author WXP - * - */ -public class Result { - public static final int SUCCESS = 1; - public static final int FAILED = 0; - public static final int REPEATED = 2;//重复添加 - - public Result(){ - - } - public Result(int code, String message, Object result) { - this.code = code; - this.msg = message; - if (result instanceof String) { - this.result = JSON.parse(result.toString()); - }else{ - this.result =result; - } - - } - public static Result success(Object result,String msg) { - return new Result(SUCCESS, msg, result); - } - public static Result success(Object result) { - return new Result(SUCCESS, "", result); - } - public static Result success() { - return new Result(SUCCESS, "", null); - } - public static Result failed(String msg) { - return new Result(FAILED, msg, null); - } - public int code; - public String msg; - public Object result; - - public int getCode() { - return code; - } - public void setCode(int code) { - this.code = code; - } - public String getMsg() { - return msg; - } - public void setMsg(String msg) { - this.msg = msg; - } - public Object getResult() { - return result; - } - public void setResult(Object result) { - this.result = result; - } - - - -} diff --git a/src/com/sipai/entity/base/Result_Report.java b/src/com/sipai/entity/base/Result_Report.java deleted file mode 100644 index c4e4f5a4..00000000 --- a/src/com/sipai/entity/base/Result_Report.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.entity.base; - -import com.alibaba.fastjson.JSON; - -/** - * @author WXP - */ -//@ApiModel(value = "Result", description = "统一返回包装") -public class Result_Report { - public static final int SUCCESS = 1; - public static final int FAILED = 0; - public static final int REPEATED = 2;//重复添加 - - public Result_Report() { - - } - - public Result_Report(int code, String message, T result) { - this.code = code; - this.msg = message; - if (result instanceof String) { - this.result = (T) JSON.parse(result.toString()); - } else { - this.result = result; - } - } - - public static Result_Report success(T result) { - return new Result_Report(SUCCESS, "", result); - } - - public static Result_Report success(T result, String msg) { - return new Result_Report(SUCCESS, msg, result); - } - - public static Result_Report failed(String msg) { - return new Result_Report(FAILED, msg, null); - } - - public int code; - public String msg; - public T result; - - public Result_Report setCode(Integer code) { - this.code = code; - return this; - } - - public Result_Report setMsg(String msg) { - this.msg = msg; - return this; - } - - public Result_Report setData(T result) { - this.result = result; - return this; - } - - - public int getCode() { - return code; - } - - public String getMsg() { - return msg; - } - - public T getResult() { - return result; - } - -} diff --git a/src/com/sipai/entity/base/SQLAdapter.java b/src/com/sipai/entity/base/SQLAdapter.java deleted file mode 100644 index 86647c66..00000000 --- a/src/com/sipai/entity/base/SQLAdapter.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.entity.base; - -import com.alibaba.excel.annotation.ExcelIgnore; - -public class SQLAdapter { - @ExcelIgnore - private String sql; - @ExcelIgnore - private String where; - - public String getSql() { - return sql; - } - public void setSql(String sql) { - this.sql = sql; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - -} diff --git a/src/com/sipai/entity/base/ServerConfig.java b/src/com/sipai/entity/base/ServerConfig.java deleted file mode 100644 index f52758b6..00000000 --- a/src/com/sipai/entity/base/ServerConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.entity.base; - -import java.util.List; - -public class ServerConfig { - private String type; - - private String name; - - private String url; - private String namespace; - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getUrl() { - return url; - } - public void setUrl(String url) { - this.url = url; - } - public String getNamespace() { - return namespace; - } - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - - -} diff --git a/src/com/sipai/entity/base/ServerObject.java b/src/com/sipai/entity/base/ServerObject.java deleted file mode 100644 index 4018417c..00000000 --- a/src/com/sipai/entity/base/ServerObject.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.entity.base; - -import java.util.Hashtable; - -/** - * @author IBM 服务器对象 - */ - -public class ServerObject { - - /** - * 记录所有服务器属性的hashtable,从serverconfig.xml读取 - */ - public static Hashtable atttable = new Hashtable(); - - public static Hashtable getAtttable() { - return atttable; - } - - public static void setAtttable(Hashtable atttable) { - ServerObject.atttable = atttable; - } -} diff --git a/src/com/sipai/entity/base/Tree.java b/src/com/sipai/entity/base/Tree.java deleted file mode 100644 index 291794af..00000000 --- a/src/com/sipai/entity/base/Tree.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.entity.base; - -import java.util.List; - -/** - * BootStrap TreeView模型 - * - */ -public class Tree implements java.io.Serializable { - - private String id; - private String text; - private String icon; - private Object nodes; - private Object attributes; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getText() { - return text; - } - public void setText(String text) { - this.text = text; - } - public String getIcon() { - return icon; - } - public void setIcon(String icon) { - this.icon = icon; - } - public Object getNodes() { - return nodes; - } - public void setNodes(Object nodes) { - this.nodes = nodes; - } - public Object getAttributes() { - return attributes; - } - public void setAttributes(Object attributes) { - this.attributes = attributes; - } - -} diff --git a/src/com/sipai/entity/bim/BIMAlarmThreshold.java b/src/com/sipai/entity/bim/BIMAlarmThreshold.java deleted file mode 100644 index 538b5ddf..00000000 --- a/src/com/sipai/entity/bim/BIMAlarmThreshold.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.entity.bim; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -/** - * BIM返回报警阈值数据 - */ -public class BIMAlarmThreshold extends SQLAdapter{ - private String id; - - private String st; - - private String ct; - - private String placeId; - - private String placeName; - - private String tagName; - - private BigDecimal foreshowMaxVal; - - private BigDecimal foreshowMinVal; - - private BigDecimal maxVal; - - private BigDecimal minVal; - - private String pkId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSt() { - return st; - } - - public void setSt(String st) { - this.st = st; - } - - public String getCt() { - return ct; - } - - public void setCt(String ct) { - this.ct = ct; - } - - public String getPlaceId() { - return placeId; - } - - public void setPlaceId(String placeId) { - this.placeId = placeId; - } - - public String getPlaceName() { - return placeName; - } - - public void setPlaceName(String placeName) { - this.placeName = placeName; - } - - public String getTagName() { - return tagName; - } - - public void setTagName(String tagName) { - this.tagName = tagName; - } - - public BigDecimal getForeshowMaxVal() { - return foreshowMaxVal; - } - - public void setForeshowMaxVal(BigDecimal foreshowMaxVal) { - this.foreshowMaxVal = foreshowMaxVal; - } - - public BigDecimal getForeshowMinVal() { - return foreshowMinVal; - } - - public void setForeshowMinVal(BigDecimal foreshowMinVal) { - this.foreshowMinVal = foreshowMinVal; - } - - public BigDecimal getMaxVal() { - return maxVal; - } - - public void setMaxVal(BigDecimal maxVal) { - this.maxVal = maxVal; - } - - public BigDecimal getMinVal() { - return minVal; - } - - public void setMinVal(BigDecimal minVal) { - this.minVal = minVal; - } - - public String getPkId() { - return pkId; - } - - public void setPkId(String pkId) { - this.pkId = pkId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/BIMCDHomePageTree.java b/src/com/sipai/entity/bim/BIMCDHomePageTree.java deleted file mode 100644 index c5aa6358..00000000 --- a/src/com/sipai/entity/bim/BIMCDHomePageTree.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.entity.bim; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 首页树数�?--目前仅用于成都BIM首页 - * sj 2021-02-28 - */ -public class BIMCDHomePageTree extends SQLAdapter { - - private String id; - - private String pid; - - private String name; - - private String type;//景观地标:landmark 检测设备:equipment - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/BIMCamera.java b/src/com/sipai/entity/bim/BIMCamera.java deleted file mode 100644 index fc2bc9e5..00000000 --- a/src/com/sipai/entity/bim/BIMCamera.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.entity.bim; - -import com.sipai.entity.base.SQLAdapter; - -/** - * BIM返回摄像头数据表 - */ -public class BIMCamera extends SQLAdapter{ - - private String id; - - private String st; - - private String ct; - - private String name; - - private String devicePass; - - private String lon; - - private String lat; - - private String interfaces; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSt() { - return st; - } - - public void setSt(String st) { - this.st = st; - } - - public String getCt() { - return ct; - } - - public void setCt(String ct) { - this.ct = ct; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDevicePass() { - return devicePass; - } - - public void setDevicePass(String devicePass) { - this.devicePass = devicePass; - } - - public String getLon() { - return lon; - } - - public void setLon(String lon) { - this.lon = lon; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getInterfaces() { - return interfaces; - } - - public void setInterfaces(String interfaces) { - this.interfaces = interfaces; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/BIMCurrency.java b/src/com/sipai/entity/bim/BIMCurrency.java deleted file mode 100644 index 5c498f36..00000000 --- a/src/com/sipai/entity/bim/BIMCurrency.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.entity.bim; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -/** - * BIM返回通用数据表 - */ -public class BIMCurrency extends SQLAdapter{ - - private String id; - - private Date st; - - private Date ct; - - private BigDecimal value; - - private String name; - - private String locationId; - - private String locationDetails; - - private String lon; - - private String lat; - - private String tagId; - - private String tagName; - - private String mpointCode; - - private String serverId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getSt() { - return st; - } - - public void setSt(Date st) { - this.st = st; - } - - public Date getCt() { - return ct; - } - - public void setCt(Date ct) { - this.ct = ct; - } - - public BigDecimal getValue() { - return value; - } - - public void setValue(BigDecimal value) { - this.value = value; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLocationId() { - return locationId; - } - - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - public String getLocationDetails() { - return locationDetails; - } - - public void setLocationDetails(String locationDetails) { - this.locationDetails = locationDetails; - } - - public String getLon() { - return lon; - } - - public void setLon(String lon) { - this.lon = lon; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getTagId() { - return tagId; - } - - public void setTagId(String tagId) { - this.tagId = tagId; - } - - public String getTagName() { - return tagName; - } - - public void setTagName(String tagName) { - this.tagName = tagName; - } - - public String getMpointCode() { - return mpointCode; - } - - public void setMpointCode(String mpointCode) { - this.mpointCode = mpointCode; - } - - public String getServerId() { - return serverId; - } - - public void setServerId(String serverId) { - this.serverId = serverId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/BimRouteCKMp.java b/src/com/sipai/entity/bim/BimRouteCKMp.java deleted file mode 100644 index 14881c6a..00000000 --- a/src/com/sipai/entity/bim/BimRouteCKMp.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.entity.bim; - - -public class BimRouteCKMp { - private String id; - private String name; - private String mpid; - private Double alarmvalue; - private String code; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public Double getAlarmvalue() { - return alarmvalue; - } - - public void setAlarmvalue(Double alarmvalue) { - this.alarmvalue = alarmvalue; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - private String unitid; - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/BimRouteData.java b/src/com/sipai/entity/bim/BimRouteData.java deleted file mode 100644 index 279985e5..00000000 --- a/src/com/sipai/entity/bim/BimRouteData.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.bim; - -import com.sipai.entity.base.SQLAdapter; - -public class BimRouteData extends SQLAdapter { - - private String id; - - private String name; - - private String eqname; - - private String mpid; - - private String mpname; - - private String alarmcontent; - - private Double alarmvalue; - - private String code; - - private String unitid; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getEqname() { - return eqname; - } - - public void setEqname(String eqname) { - this.eqname = eqname == null ? null : eqname.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname == null ? null : mpname.trim(); - } - - public String getAlarmcontent() { - return alarmcontent; - } - - public void setAlarmcontent(String alarmcontent) { - this.alarmcontent = alarmcontent == null ? null : alarmcontent.trim(); - } - - public Double getAlarmvalue() { - return alarmvalue; - } - - public void setAlarmvalue(Double alarmvalue) { - this.alarmvalue = alarmvalue; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code == null ? null : code.trim(); - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/BimRouteEqData.java b/src/com/sipai/entity/bim/BimRouteEqData.java deleted file mode 100644 index fd8379b7..00000000 --- a/src/com/sipai/entity/bim/BimRouteEqData.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.entity.bim; - -import com.sipai.entity.base.SQLAdapter; - -public class BimRouteEqData extends SQLAdapter { - - private String id; - - private Integer eqNum; - - private Integer pointNum; - - private Integer abnormalPointNum; - - private Integer abnormalEqNum; - - private Integer normalEqNum; - - private String unitid; - - private String code; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public Integer getEqNum() { - return eqNum; - } - - public void setEqNum(Integer eqNum) { - this.eqNum = eqNum; - } - - public Integer getPointNum() { - return pointNum; - } - - public void setPointNum(Integer pointNum) { - this.pointNum = pointNum; - } - - public Integer getAbnormalPointNum() { - return abnormalPointNum; - } - - public void setAbnormalPointNum(Integer abnormalPointNum) { - this.abnormalPointNum = abnormalPointNum; - } - - public Integer getAbnormalEqNum() { - return abnormalEqNum; - } - - public void setAbnormalEqNum(Integer abnormalEqNum) { - this.abnormalEqNum = abnormalEqNum; - } - - public Integer getNormalEqNum() { - return normalEqNum; - } - - public void setNormalEqNum(Integer normalEqNum) { - this.normalEqNum = normalEqNum; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code == null ? null : code.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/bim/YsAlarmRecord.java b/src/com/sipai/entity/bim/YsAlarmRecord.java deleted file mode 100644 index c44a7b30..00000000 --- a/src/com/sipai/entity/bim/YsAlarmRecord.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.bim; - -import com.sipai.entity.base.SQLAdapter; - -public class YsAlarmRecord extends SQLAdapter { - private String id; - - private String recordId; - - private String recordType; - - private String recordVal; - - private String recordValOld; - - private String recordTime; - - private String insdt; - - private String status; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRecordId() { - return recordId; - } - - public void setRecordId(String recordId) { - this.recordId = recordId; - } - - public String getRecordType() { - return recordType; - } - - public void setRecordType(String recordType) { - this.recordType = recordType; - } - - public String getRecordVal() { - return recordVal; - } - - public void setRecordVal(String recordVal) { - this.recordVal = recordVal; - } - - public String getRecordValOld() { - return recordValOld; - } - - public void setRecordValOld(String recordValOld) { - this.recordValOld = recordValOld; - } - - public String getRecordTime() { - return recordTime; - } - - public void setRecordTime(String recordTime) { - this.recordTime = recordTime; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/bot/Bot.java b/src/com/sipai/entity/bot/Bot.java deleted file mode 100644 index 0cc4d927..00000000 --- a/src/com/sipai/entity/bot/Bot.java +++ /dev/null @@ -1,368 +0,0 @@ -package com.sipai.entity.bot; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; - -public class Bot extends SQLAdapter{ - - private String id; - - private String bizid; - - private String designScale; - - private Long dsnum; - - private String emission; - - private String influentIndex; - - private String effluentIndex; - - private String process; - - private String price; - - private String calculation; - - private String signdate; - - private String franchisePeriod; - - private String type; - - private String serviceArea; - - private String servicePopulation; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String address; - - private BigDecimal lgtd; - - private BigDecimal lttd; - - private String lineMapUrl; - - private String pointMapUrl; - - private Long linetotal; - - private Long pointnum; - - private String clickState; - - private String defaultLoad; - - private String legalPersonCode; - - private String outletId; - - private String outletName; - - private String entranceId; - - private String entranceName; - - private Integer townNum; - - private Integer villageNum; - - private Integer pumpNum; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid == null ? null : bizid.trim(); - } - - public String getDesignScale() { - return designScale; - } - - public void setDesignScale(String designScale) { - this.designScale = designScale == null ? null : designScale.trim(); - } - - public Long getDsnum() { - return dsnum; - } - - public void setDsnum(Long dsnum) { - this.dsnum = dsnum; - } - - public String getEmission() { - return emission; - } - - public void setEmission(String emission) { - this.emission = emission == null ? null : emission.trim(); - } - - public String getInfluentIndex() { - return influentIndex; - } - - public void setInfluentIndex(String influentIndex) { - this.influentIndex = influentIndex == null ? null : influentIndex.trim(); - } - - public String getEffluentIndex() { - return effluentIndex; - } - - public void setEffluentIndex(String effluentIndex) { - this.effluentIndex = effluentIndex == null ? null : effluentIndex.trim(); - } - - public String getProcess() { - return process; - } - - public void setProcess(String process) { - this.process = process == null ? null : process.trim(); - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price == null ? null : price.trim(); - } - - public String getCalculation() { - return calculation; - } - - public void setCalculation(String calculation) { - this.calculation = calculation == null ? null : calculation.trim(); - } - - public String getSigndate() { - return signdate; - } - - public void setSigndate(String signdate) { - this.signdate = signdate == null ? null : signdate.trim(); - } - - public String getFranchisePeriod() { - return franchisePeriod; - } - - public void setFranchisePeriod(String franchisePeriod) { - this.franchisePeriod = franchisePeriod == null ? null : franchisePeriod.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getServiceArea() { - return serviceArea; - } - - public void setServiceArea(String serviceArea) { - this.serviceArea = serviceArea == null ? null : serviceArea.trim(); - } - - public String getServicePopulation() { - return servicePopulation; - } - - public void setServicePopulation(String servicePopulation) { - this.servicePopulation = servicePopulation == null ? null : servicePopulation.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser == null ? null : upsuser.trim(); - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address == null ? null : address.trim(); - } - - public BigDecimal getLgtd() { - return lgtd; - } - - public void setLgtd(BigDecimal lgtd) { - this.lgtd = lgtd; - } - - public BigDecimal getLttd() { - return lttd; - } - - public void setLttd(BigDecimal lttd) { - this.lttd = lttd; - } - - public String getLineMapUrl() { - return lineMapUrl; - } - - public void setLineMapUrl(String lineMapUrl) { - this.lineMapUrl = lineMapUrl == null ? null : lineMapUrl.trim(); - } - - public String getPointMapUrl() { - return pointMapUrl; - } - - public void setPointMapUrl(String pointMapUrl) { - this.pointMapUrl = pointMapUrl == null ? null : pointMapUrl.trim(); - } - - public Long getLinetotal() { - return linetotal; - } - - public void setLinetotal(Long linetotal) { - this.linetotal = linetotal; - } - - public Long getPointnum() { - return pointnum; - } - - public void setPointnum(Long pointnum) { - this.pointnum = pointnum; - } - - public String getClickState() { - return clickState; - } - - public void setClickState(String clickState) { - this.clickState = clickState == null ? null : clickState.trim(); - } - - public String getDefaultLoad() { - return defaultLoad; - } - - public void setDefaultLoad(String defaultLoad) { - this.defaultLoad = defaultLoad == null ? null : defaultLoad.trim(); - } - - public String getLegalPersonCode() { - return legalPersonCode; - } - - public void setLegalPersonCode(String legalPersonCode) { - this.legalPersonCode = legalPersonCode == null ? null : legalPersonCode.trim(); - } - - public String getOutletId() { - return outletId; - } - - public void setOutletId(String outletId) { - this.outletId = outletId == null ? null : outletId.trim(); - } - - public String getOutletName() { - return outletName; - } - - public void setOutletName(String outletName) { - this.outletName = outletName == null ? null : outletName.trim(); - } - - public String getEntranceId() { - return entranceId; - } - - public void setEntranceId(String entranceId) { - this.entranceId = entranceId == null ? null : entranceId.trim(); - } - - public String getEntranceName() { - return entranceName; - } - - public void setEntranceName(String entranceName) { - this.entranceName = entranceName == null ? null : entranceName.trim(); - } - - public Integer getTownNum() { - return townNum; - } - - public void setTownNum(Integer townNum) { - this.townNum = townNum; - } - - public Integer getVillageNum() { - return villageNum; - } - - public void setVillageNum(Integer villageNum) { - this.villageNum = villageNum; - } - - public Integer getPumpNum() { - return pumpNum; - } - - public void setPumpNum(Integer pumpNum) { - this.pumpNum = pumpNum; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnit.java b/src/com/sipai/entity/business/BusinessUnit.java deleted file mode 100644 index 44f36925..00000000 --- a/src/com/sipai/entity/business/BusinessUnit.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.sipai.entity.business; - -import com.sipai.entity.base.SQLAdapter; - -public class BusinessUnit extends SQLAdapter { - - public final static String UNIT_HANDLE = "handle"; - public final static String UNIT_AUDIT = "audit"; - - public final static String UNIT_TEAM_HANDLE = "repair_team_handle";//维修班处�? - public final static String UNIT_OFFICE_HANDLE = "equipment_office_handle";//设备办处�? - public final static String UNIT_OUTSOURCING_HANDLE = "outsourcing_handle";//外包处理 - public final static String UNIT_RECEIVE_HANDLE = "check_receive_handle";//维修、保养验�? - public final static String UNIT_BASE_AUDIT = "base_audit";//基层领导审核 - public final static String UNIT_PRODUCT_AUDIT = "product_audit";//生产运营中心审核 - public final static String UNIT_CENTER_AUDIT = "center_audit";//中层领导审核 - //申购 - public final static String UNIT_SUBSCRIBE_AUDIT = "subscribe_audit"; - public final static String UNIT_DEPT_APPLY = "dept_apply"; - public final static String UNIT_INQUIRY = "inquiry"; - //合同 - public final static String UNIT_CONTRACT_APPLY = "contract_apply"; - public final static String UNIT_CONTRACT_AUDIT = "contract_audit"; - public final static String UNIT_CONTRACT_ADJUST = "contract_adjust"; - - //工艺调整流程节点 - public final static String UNIT_PROCESSADJUSTMENT_EDIT = "process_adjustment_edit"; //编制 - public final static String UNIT_PROCESSADJUSTMENT_AUDIT = "process_adjustment_audit"; //审核 - public final static String UNIT_PROCESSADJUSTMENT_HANDLE = "process_adjustment_handle"; //执行 - public final static String UNIT_PROCESSADJUSTMENT_ANALYSIS = "process_adjustment_analysis";//分析 - public final static String UNIT_PROCESSADJUSTMENT_EVALUATE = "process_adjustment_evaluate";//评价 - public final static String UNIT_PROCESSADJUSTMENT_DISTRIBUTION = "process_adjustment_distribution";//工时分配 - - //入库审核流程节点 - public final static String UNIT_IN_STOCK_AUDIT = "in_stock_audit";//入库审核 - public final static String UNIT_IN_STOCK_HANDLE = "in_stock_handle";//入库业务处理 - //出库审核流程节点 - public final static String UNIT_OUT_STOCK_AUDIT = "out_stock_audit";//出库审核 - public final static String UNIT_OUT_STOCK_HANDLE = "out_stock_handle";//出库业务处理 - //处级物资领用审核流程节点 - public final static String UNIT_SECTION_STOCK_AUDIT = "section_stock_audit";//出库审核 - public final static String UNIT_SECTION_STOCK_HANDLE = "section_stock_handle";//出库业务处理 - //药剂审核流程节点 - public final static String UNIT_RAW_MATERIAL_AUDIT = "raw_material_audit";//药剂审核 - public final static String UNIT_RAW_MATERIAL_HANDLE = "raw_material_handle";//药剂业务处理 - //合理化建议审核流程节�? - public final static String UNIT_REASONABLE_ADVICE_AUDIT = "reasonable_advice_audit";//合理化建议审�? - public final static String UNIT_REASONABLE_ADVICE_HANDLE = "reasonable_advice_handle";//合理化建议业务处�? - - //吐槽内容 - public final static String UNIT_ROAST_AUDIT = "roast_audit";//合理化建议审�? - public final static String UNIT_ROAST_HANDLE = "roast_handle";//合理化建议业务处�? - - //保养计划审核流程节点 - public final static String UNIT_Maintain_HANDLE = "maintainPlan_handle";//保养计划-编辑 - public final static String UNIT_Maintain_AUDIT = "maintainPlan_audit";//保养计划-审核 - - //维修计划审核流程节点 - public final static String UNIT_Repair_HANDLE = "repairPlan_handle";//维修计划-编辑 - public final static String UNIT_Repair_AUDIT = "repairPlan_audit";//维修计划-审核 - - //维修工单流程 - public final static String UNIT_Maintenance_Repair_Handle = "Maintenance_Repair_Handle";//维修执行 - public final static String UNIT_Maintenance_Repair_ProductionAudit = "Maintenance_Repair_ProductionAudit";//生产部验�? - public final static String UNIT_Maintenance_Repair_EqAudit = "Maintenance_Repair_EqAudit";//设备部验�? - - //库存盘点审核流程节点 - public final static String UNIT_STOCK_CHECK_AUDIT = "stock_check_audit";//库存盘点审核 - public final static String UNIT_STOCK_CHECK_HANDLE = "stock_check_handle";//库存盘点业务处理 - //丢失申请审核流程节点 - public final static String UNIT_LOSE_APPLY_AUDIT = "lose_apply_audit";//丢失申请审核 - public final static String UNIT_LOSE_APPLY_ADJUST = "lose_apply_adjust";//丢失申请业务调整 - //报废申请审核流程节点 - public final static String UNIT_SCRAP_APPLY_AUDIT = "scrap_apply_audit";//报废申请审核 - public final static String UNIT_SCRAP_APPLY_ADJUST = "scrap_apply_adjust";//报废申请业务调整 - //出售申请审核流程节点 - public final static String UNIT_SALE_APPLY_AUDIT = "sale_apply_audit";//出售申请审核 - public final static String UNIT_SALE_APPLY_ADJUST = "sale_apply_adjust";//出售申请业务调整 - //调拨申请审核流程节点 - public final static String UNIT_TRANSFERS_APPLY_AUDIT = "transfers_apply_audit";//调拨申请审核 - public final static String UNIT_TRANSFERS_APPLY_ADJUST = "transfers_apply_adjust";//调拨申请业务调整 - //验收申请审核流程节点 - public final static String UNIT_ACCEPTANCE_APPLY_AUDIT = "acceptance_apply_audit";//验收申请审核 - public final static String UNIT_ACCEPTANCE_APPLY_ADJUST = "acceptance_apply_adjust";//验收申请业务调整 - - //设备停用申请审核流程节点 - public final static String UNIT_EQUIPMENT_STOP_APPLY_AUDIT = "equipmentStop_apply_audit";//设备停用申请审核 - public final static String UNIT_EQUIPMENT_STOP_APPLY_ADJUST = "equipmentStop_apply_adjust";//设备停用申请业务调整 - - //方案编制 - public final static String UNIT_Programme_Write_Handle = "programme_write_handle";//执行 - public final static String UNIT_Programme_Write_Audit = "programme_write_audit";//审核 - //方案编制 - public final static String UNIT_Bidding_Price_Handle = "bidding_price_handle";//执行 - public final static String UNIT_Bidding_Price_Audit = "bidding_price_audit";//审核 - //方案编制 - public final static String UNIT_Install_Debug_Handle = "install_debug_handle";//执行 - public final static String UNIT_Install_Debug_Audit = "install_debug_audit";//审核 - //方案编制 - public final static String UNIT_Project_Check_Handle = "project_check_handle";//执行 - public final static String UNIT_Project_Check_Audit = "project_check_audit";//审核 - //车辆维保 维修 - public final static String UNIT_Maintain_Car_Audit = "maintain_car_audit";//执行 - public final static String UNIT_Repair_Car_Audit = "repair_car_audit";//审核 - - //指标审核流程节点 - public final static String UNIT_IndexWork_AUDIT = "indexWork_audit";//指标审核 - public final static String UNIT_IndexWork_HANDLE = "indexWork_handle";//指标业务处理 - //组织工作审核流程节点 - public final static String UNIT_Organization_AUDIT = "organization_audit";//指标审核 - public final static String UNIT_Organization_HANDLE = "organization_handle";//指标业务处理 - //预案工作审核流程节点 - public final static String UNIT_Reserve_AUDIT = "reserve_audit";//指标审核 - public final static String UNIT_Reserve_HANDLE = "reserve_handle";//指标业务处理 - //预案工作审核流程节点 - public final static String UNIT_Temporary_AUDIT = "temporary_audit";//指标审核 - public final static String UNIT_Temporary_HANDLE = "temporary_handle";//指标业务处理 - - /** - * 运行模块 - */ - //周期性常规工�? - public final static String UNIT_RoutineWork_Handle = "routineWork_handle";//执行 - public final static String UNIT_RoutineWork_AUDIT = "routineWork_audit";//审核 - //水质化验 - public final static String UNIT_WaterTest_Handle = "water_test_handle";//执行 - public final static String UNIT_WaterTest_AUDIT = "water_test_audit";//审核 - - public final static String UNIT_REPORT_CREATE = "report_create"; //报表生成 - public final static String UNIT_REPORT_AUDIT = "report_audit"; //报表审核 - - public final static String UNIT_PATROL_AUDIT = "patrol_audit"; //运行巡检审核 - public final static String UNIT_PATROL_CREATE = "patrol_create"; //运行巡检提交 - - - //2021.05.28 维修工单流程 - - public final static String UNIT_WORKORDER_REPAIR_ISSUE = "workorder_repair_issue";//工单下发 - public final static String UNIT_WORKORDER_REPAIR_HANDLE = "workorder_repair_handle"; //工单处理 - public final static String UNIT_WORKORDER_REPAIR_APPLY_AUDIT = "workorder_repair_apply_audit"; //工单审核 - public final static String UNIT_WORKORDER_REPAIR_CHECK_AUDIT = "workorder_repair_check_audit"; //工单验收 - //2021.05.28 保养工单流程 - public final static String UNIT_WORKORDER_MAINTAIN_HANDLE = "workorder_maintain_handle"; //工单处理 - public final static String UNIT_WORKORDER_MAINTAIN_APPLY_AUDIT = "workorder_maintain_apply_audit"; //工单审核 - public final static String UNIT_WORKORDER_MAINTAIN_CHECK_AUDIT = "workorder_maintain_check_audit"; //工单验收 - - //2021.09.03 异常上报(运行) Workorder_Abnormity_Run-020ZCYH - public final static String UNIT_WORKORDER_ABNORMITY_HANDLE_RUN = "workorder_abnormity_handle_run"; //异常上报处理 - public final static String UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN = "workorder_abnormity_handle_issue_run"; //异常上报处理(可下发�? - //2021.09.03 异常上报(运行) - public final static String UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment = "workorder_abnormity_handle_equipment"; //异常上报处理 - public final static String UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment = "workorder_abnormity_handle_issue_equipment"; //异常上报处理(可下发�? - //2021.09.03 异常上报(运行) - public final static String UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities = "workorder_abnormity_handle_facilities"; //异常上报处理 - public final static String UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities = "workorder_abnormity_handle_issue_facilities"; //异常上报处理(可下发�? - - //绩效考核:计划编制审核 - public final static String KPI_PLAN_APPLY = "kpi_plan_apply"; //考核计划申请 - public final static String KPI_PLAN_AUDIT_1 = "kpi_plan_audit_1"; // 考核计划审批 - public final static String KPI_PLAN_AUDIT_2 = "kpi_plan_audit_2"; // 考核计划审批 - //绩效考核:打分 - public final static String KPI_MARK_1 = "kpi_mark_1"; // �?级评价人 - public final static String KPI_MARK_2 = "kpi_mark_2"; // 二级评价�? - public final static String KPI_MARK_3 = "kpi_mark_3"; // 三级评价�? - - //日常安全检查 - public final static String SAFETY_CHECK_DAYLY_APPLY = "safety_check_dayly_apply"; // 发起人 - public final static String SAFETY_CHECK_DAYLY_RESPONSE = "safety_check_dayly_response"; // 整改负责人 - public final static String SAFETY_CHECK_DAYLY_CONFIRM = "safety_check_dayly_confirm"; // 验证人 - //综合安全检查 - public final static String SAFETY_CHECK_COMPREHENSIVE_APPLY = "safety_check_comprehensive_apply"; // 发起人 - public final static String SAFETY_CHECK_COMPREHENSIVE_RESPONSE = "safety_check_comprehensive_response"; // 整改负责人 - public final static String SAFETY_CHECK_COMPREHENSIVE_CONFIRM = "safety_check_comprehensive_confirm"; // 验证人 - //专项安全检查 - public final static String SAFETY_CHECK_SPECIAL_APPLY = "safety_check_special_apply"; // 发起人 - public final static String SAFETY_CHECK_SPECIAL_RESPONSE = "safety_check_special_response"; // 整改负责人 - public final static String SAFETY_CHECK_SPECIAL_CONFIRM = "safety_check_special_confirm"; // 验证人 - - //内部作业 - public final static String SAFETY_JOB_INSIDE_APPLY = "safety_job_inside_apply"; // 发起人 - - -// public final static String OVERHAUL_APPLY = "overhaul_apply"; -// public final static String OVERHAUL_AUDIT = "overhaul_audit"; -// public final static String OVERHAUL_CHEAK = "overhaul_cheak"; -// public final static String OVERHAUL_HANDLE = "overhaul_handle"; - - public final static String OVERHAUL_PLAN_APPLY = "overhaul_plan_apply";//计划申请 - public final static String OVERHAUL_PLAN_AUDIT = "overhaul_plan_audit";//计划审核 - public final static String OVERHAUL_IMPL_HANDLE = "overhaul_impl_handle";//工单实施 - public final static String OVERHAUL_impl_CHEAK = "overhaul_impl_check";//工单验收 - - - public final static String VISIT_APPLY_AUDIT = "visit_apply_audit"; //参观申请审批 - public final static String VISIT_APPLY_HANDLE = "visit_apply_handle"; // 参观申请处理 - - public final static String VISIT_REGISTER_AUDIT = "visit_register_audit"; //参观登记审批 - public final static String VISIT_REGISTER_HANDLE = "visit_register_handle"; // 参观登记处理 - - private String id; - private String name; - private String processTypeId; - private String insdt; - private String insuser; - private String active; - - private String url; - private String modalId; - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getModalId() { - return modalId; - } - - public void setModalId(String modalId) { - this.modalId = modalId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getProcessTypeId() { - return processTypeId; - } - - public void setProcessTypeId(String processTypeId) { - this.processTypeId = processTypeId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - -} diff --git a/src/com/sipai/entity/business/BusinessUnitAudit.java b/src/com/sipai/entity/business/BusinessUnitAudit.java deleted file mode 100644 index fb713e26..00000000 --- a/src/com/sipai/entity/business/BusinessUnitAudit.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.sipai.entity.business; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BusinessUnitAudit extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String businessid; - - private String taskdefinitionkey; - - private String processid; - - private String taskid; - - private String auditopinion; - - private String targetusers; - - private Boolean passstatus; - - private String unitid; - - private int routeNum; - - - public int getRouteNum() { - return routeNum; - } - - public void setRouteNum(int routeNum) { - this.routeNum = routeNum; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBusinessid() { - return businessid; - } - - public void setBusinessid(String businessid) { - this.businessid = businessid; - } - - public String getTaskdefinitionkey() { - return taskdefinitionkey; - } - - public void setTaskdefinitionkey(String taskdefinitionkey) { - this.taskdefinitionkey = taskdefinitionkey; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getAuditopinion() { - return auditopinion; - } - - public void setAuditopinion(String auditopinion) { - this.auditopinion = auditopinion; - } - - public String getTargetusers() { - return targetusers; - } - - public void setTargetusers(String targetusers) { - this.targetusers = targetusers; - } - - public Boolean getPassstatus() { - return passstatus; - } - - public void setPassstatus(Boolean passstatus) { - this.passstatus = passstatus; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnitDeptApply.java b/src/com/sipai/entity/business/BusinessUnitDeptApply.java deleted file mode 100644 index 22f2efac..00000000 --- a/src/com/sipai/entity/business/BusinessUnitDeptApply.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.entity.business; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BusinessUnitDeptApply extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String subscribeId; - - private String taskdefinitionkey; - - private String processid; - - private String taskid; - - private String targetusers; - - private String handledetail; - - private String status; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSubscribeId() { - return subscribeId; - } - - public void setSubscribeId(String subscribeId) { - this.subscribeId = subscribeId; - } - - public String getTaskdefinitionkey() { - return taskdefinitionkey; - } - - public void setTaskdefinitionkey(String taskdefinitionkey) { - this.taskdefinitionkey = taskdefinitionkey; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getTargetusers() { - return targetusers; - } - - public void setTargetusers(String targetusers) { - this.targetusers = targetusers; - } - - public String getHandledetail() { - return handledetail; - } - - public void setHandledetail(String handledetail) { - this.handledetail = handledetail; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnitHandle.java b/src/com/sipai/entity/business/BusinessUnitHandle.java deleted file mode 100644 index 4c7fe977..00000000 --- a/src/com/sipai/entity/business/BusinessUnitHandle.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.sipai.entity.business; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BusinessUnitHandle extends SQLAdapter{ - - public final static String Status_HANDLE="0"; - public final static String Status_FINISH="1"; - - private String id; - private String insdt; - private String insuser; - private String businessid; - private String taskdefinitionkey; - private String processid; - private String taskid; - private String handledetail; - private String handledt; - private String targetusers; - private String status; - private String unitid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBusinessid() { - return businessid; - } - - public void setBusinessid(String businessid) { - this.businessid = businessid; - } - - public String getTaskdefinitionkey() { - return taskdefinitionkey; - } - - public void setTaskdefinitionkey(String taskdefinitionkey) { - this.taskdefinitionkey = taskdefinitionkey; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getHandledetail() { - return handledetail; - } - - public void setHandledetail(String handledetail) { - this.handledetail = handledetail; - } - - public String getHandledt() { - return handledt; - } - - public void setHandledt(String handledt) { - this.handledt = handledt; - } - - public String getTargetusers() { - return targetusers; - } - - public void setTargetusers(String targetusers) { - this.targetusers = targetusers; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnitHandleDetail.java b/src/com/sipai/entity/business/BusinessUnitHandleDetail.java deleted file mode 100644 index bb4cd17e..00000000 --- a/src/com/sipai/entity/business/BusinessUnitHandleDetail.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.entity.business; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.maintenance.MaintenanceDetail; - -public class BusinessUnitHandleDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String maintenancedetailid; - - private String taskdefinitionkey; - - private String problem; - - private String handledetail; - - private String detailsupplement; - - private String handledt; - - private String processsectionid; - - private String equipmentids; - - private String faultlibraryid; - - private String equipmentNames; - - private String insuserName; - - private String processSectionName; - - private String faultLibraryName; - - private MaintenanceDetail maintenanceDetail; - - public MaintenanceDetail getMaintenanceDetail() { - return maintenanceDetail; - } - - public void setMaintenanceDetail(MaintenanceDetail maintenanceDetail) { - this.maintenanceDetail = maintenanceDetail; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMaintenancedetailid() { - return maintenancedetailid; - } - - public void setMaintenancedetailid(String maintenancedetailid) { - this.maintenancedetailid = maintenancedetailid; - } - - public String getTaskdefinitionkey() { - return taskdefinitionkey; - } - - public void setTaskdefinitionkey(String taskdefinitionkey) { - this.taskdefinitionkey = taskdefinitionkey; - } - - public String getProblem() { - return problem; - } - - public void setProblem(String problem) { - this.problem = problem; - } - - public String getHandledetail() { - return handledetail; - } - - public void setHandledetail(String handledetail) { - this.handledetail = handledetail; - } - - public String getDetailsupplement() { - return detailsupplement; - } - - public void setDetailsupplement(String detailsupplement) { - this.detailsupplement = detailsupplement; - } - - public String getHandledt() { - return handledt; - } - - public void setHandledt(String handledt) { - this.handledt = handledt; - } - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid; - } - - public String getEquipmentids() { - return equipmentids; - } - - public void setEquipmentids(String equipmentids) { - this.equipmentids = equipmentids; - } - - public String getFaultlibraryid() { - return faultlibraryid; - } - - public void setFaultlibraryid(String faultlibraryid) { - this.faultlibraryid = faultlibraryid; - } - - - - - public String getInsuserName() { - return insuserName; - } - - public void setInsuserName(String insuserName) { - this.insuserName = insuserName; - } - - public String getProcessSectionName() { - return processSectionName; - } - - public void setProcessSectionName(String processSectionName) { - this.processSectionName = processSectionName; - } - - - public String getFaultLibraryName() { - return faultLibraryName; - } - - public void setFaultLibraryName(String faultLibraryName) { - this.faultLibraryName = faultLibraryName; - } - - public String getEquipmentNames() { - return equipmentNames; - } - - public void setEquipmentNames(String equipmentNames) { - this.equipmentNames = equipmentNames; - } - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnitInquiry.java b/src/com/sipai/entity/business/BusinessUnitInquiry.java deleted file mode 100644 index 36458e36..00000000 --- a/src/com/sipai/entity/business/BusinessUnitInquiry.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.entity.business; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BusinessUnitInquiry extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String subscribeId; - - private String taskdefinitionkey; - - private String processid; - - private String taskid; - - private String targetusers; - - private String handledetail; - - private String status; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSubscribeId() { - return subscribeId; - } - - public void setSubscribeId(String subscribeId) { - this.subscribeId = subscribeId; - } - - public String getTaskdefinitionkey() { - return taskdefinitionkey; - } - - public void setTaskdefinitionkey(String taskdefinitionkey) { - this.taskdefinitionkey = taskdefinitionkey; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getTargetusers() { - return targetusers; - } - - public void setTargetusers(String targetusers) { - this.targetusers = targetusers; - } - - public String getHandledetail() { - return handledetail; - } - - public void setHandledetail(String handledetail) { - this.handledetail = handledetail; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnitIssue.java b/src/com/sipai/entity/business/BusinessUnitIssue.java deleted file mode 100644 index 8db641e3..00000000 --- a/src/com/sipai/entity/business/BusinessUnitIssue.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.business; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BusinessUnitIssue extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String maintenancedetailid; - - private String processid; - - private String usertaskid; - - private String auditopinion; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMaintenancedetailid() { - return maintenancedetailid; - } - - public void setMaintenancedetailid(String maintenancedetailid) { - this.maintenancedetailid = maintenancedetailid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getUsertaskid() { - return usertaskid; - } - - public void setUsertaskid(String usertaskid) { - this.usertaskid = usertaskid; - } - - public String getAuditopinion() { - return auditopinion; - } - - public void setAuditopinion(String auditopinion) { - this.auditopinion = auditopinion; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/business/BusinessUnitRecord.java b/src/com/sipai/entity/business/BusinessUnitRecord.java deleted file mode 100644 index 870c55e8..00000000 --- a/src/com/sipai/entity/business/BusinessUnitRecord.java +++ /dev/null @@ -1,1872 +0,0 @@ -package com.sipai.entity.business; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.accident.ReasonableAdvice; -import com.sipai.entity.accident.Roast; -import com.sipai.entity.administration.IndexWork; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.administration.OrganizationCommStr; -import com.sipai.entity.administration.Temporary; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.equipment.*; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.sparepart.*; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.administration.IndexWorkService; -import com.sipai.service.administration.OrganizationService; -import com.sipai.service.administration.TemporaryService; -import com.sipai.service.base.CommonFileServiceImpl; -import com.sipai.service.equipment.*; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.process.ProcessAdjustmentService; -import com.sipai.service.process.RoutineWorkService; -import com.sipai.service.process.WaterTestService; -import com.sipai.service.process.impl.RoutineWorkServiceImpl; -import com.sipai.service.process.impl.WaterTestServiceImpl; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.sparepart.*; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.*; -import io.minio.MinioClient; -import org.activiti.engine.HistoryService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.apache.axis.encoding.Base64; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class BusinessUnitRecord { - - private String tbName = "tb_maintenance_file"; - private String tbName_problem = "tb_maintenance_problem_fille"; - private final String MsgType_Both = "MaintenanceDetail"; - private final String MsgType_Msg = "MaintenanceDetail"; - - @Autowired -// private MinioProp minioProp; - MinioProp minioProp = (MinioProp) SpringContextUtil.getBean("minioProp"); - WorkorderDetailService workorderDetailService = (WorkorderDetailService) SpringContextUtil.getBean("workorderDetailService"); - - public BusinessUnitRecord() { - - } - /** 通用简式 - * @param insdt 写入时间 - * @param insuser 写入人/发送人id - * @param businessId 业务表id,用于关联 - * @param processid 流程id - * @param bizId 厂区id - * @param targetusers 接收人id - * @param record 流程内容 - * @param user 发送人实体类 - * @param taskName 步骤名称 - */ - public BusinessUnitRecord(String insdt,String insuser, - String businessId,String processid,String bizId, - String targetusers,String record,User user,String taskName) { - this.setId(businessId); - this.setInsdt(insdt); - this.setInsuser(insuser); - this.setBusinessId(businessId); - this.setProcessid(processid); - this.setRecord(record); - this.setUser(user); - this.setTaskName(taskName); - } - public BusinessUnitRecord(MaintenanceDetail maintenanceDetail) { - this.setId(maintenanceDetail.getId()); - this.setInsdt(maintenanceDetail.getInsdt()); - this.setInsuser(maintenanceDetail.getInsuser()); - this.setBusinessId(maintenanceDetail.getId()); - this.setProcessid(maintenanceDetail.getProcessid()); - //this.setTaskdefinitionkey(""); - //this.setTaskid(maintenanceDetail.getTaskid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); -// UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(maintenanceDetail.getCompanyid()); - String problem = maintenanceDetail.getProblemcontent(); - String companyName = ""; - if (company == null) { - MaintenanceService maintenanceService = (MaintenanceService) SpringContextUtil.getBean("maintenanceService"); - Maintenance maintenance = maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - companyName = maintenance.getCompany().getName(); - } else { - companyName = company.getName(); - } - String record = ""; - String type = maintenanceDetail.getType(); - /*if (Maintenance.TYPE_MAINTAIN.equals(type)) { - record+="发起保养任务,内容为:"+companyName+","+problem+"。"; - }else { - record+="发起运维任务,问题为:"+companyName+","+problem+"。"; - }*/ - if (MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(type)) { - record += "发起保养任务,保养内容为:" + companyName + "," + problem + "。"; - this.setTaskName("保养发起"); - } else if (MaintenanceCommString.MAINTENANCE_TYPE_REPAIR.equals(type)) { - record += "发起维修任务,维修内容为:" + companyName + "," + problem + "。"; - this.setTaskName("维修发起"); - } else { - record += "发起缺陷处理任务,缺陷内容为:" + companyName + "," + problem + "。"; - this.setTaskName("缺陷发起"); - } - /*if (maintenanceDetail.getPlannedenddt()!=null&& maintenanceDetail.getPlannedenddt().length()>10) { - record+="预计完成日期为:"+maintenanceDetail.getPlannedenddt().substring(0,10)+"。"; - }*/ - String solver = maintenanceDetail.getSolver(); - if (solver != null && !solver.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + solver.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "选择审核人为:" + userNames + "。"; - } - } - String contactids = maintenanceDetail.getContactids(); - if (contactids != null && !contactids.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + contactids.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption() + "(" + user.getMobile() + ")"; - } - if (!userNames.isEmpty()) { - record += "选择厂区联系人为:" + userNames + "。"; - } - } - this.setRecord(record); - - User user = userService.getUserById(maintenanceDetail.getInsuser()); - this.setUser(user); - - CommonFileServiceImpl commonFileService = (CommonFileServiceImpl) SpringContextUtil.getBean("commonFileServiceImpl"); - List list = new ArrayList<>(); - /*缺陷能查到关联的异常数据时,说明是由异常生成的缺陷,缺陷处理记录查看中显示多条异常的图片, - * 如果没查到数据,说明不是异常生成的缺陷,按照缺陷的id查图片 - * lius-20190325 - */ - if (maintenanceDetail.getId() != null && !maintenanceDetail.getId().isEmpty()) { - PlanRecordAbnormityService planRecordAbnormityService = (PlanRecordAbnormityService) SpringContextUtil.getBean("planRecordAbnormityService"); - List abnormities = planRecordAbnormityService.selectListByWhere("where son_id = '" + maintenanceDetail.getId() + "'"); - String masterIds = ""; - if (abnormities != null && abnormities.size() > 0) {//缺陷能查到关联的异常数据时,说明是由异常生成的缺陷,缺陷处理中显示多条异常的图片 - for (PlanRecordAbnormity item : abnormities) { - if (masterIds != "") { - masterIds += ","; - } - masterIds += item.getFatherId(); - } - masterIds = masterIds.replace(",", "','"); - list = commonFileService.selectListByTableAWhere(tbName_problem, "where masterid in ('" + masterIds + "')"); - } else {//如果没查到数据,说明不是异常生成的缺陷 - list = commonFileService.selectListByTableAWhere(tbName_problem, "where masterid='" + maintenanceDetail.getId() + "'"); - } - } - //json路径处理 -// for (CommonFile commonFile : list) { -// commonFile.setAbspath(CommUtil.string2Json(commonFile.getAbspath())); -// } - try { - for (CommonFile commonFile : list) { - String path = commonFile.getAbspath(); - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - - //直接读取图片地址 存在外网无法使用 后面都换成下面的流文件 - String obj = minioClient2.presignedGetObject("maintenance", path, 3600 * 24 * 7); - commonFile.setAbspath(obj); - - //解析成流文件 后面都用这个 - byte[] buffer = commonFileService.getInputStreamBytes("maintenance", path); - String base = Base64.encode(buffer); - commonFile.setStreamFile(base); - } - } catch (Exception e) { - System.out.println(e); - } - - this.setFiles(list); - } - - - public BusinessUnitRecord(Subscribe subscribe) { - this.setId(subscribe.getId()); - this.setInsdt(subscribe.getInsdt()); - this.setInsuser(subscribe.getInsuser()); - this.setBusinessId(subscribe.getId()); - this.setProcessid(subscribe.getProcessid()); - //this.setTaskdefinitionkey(""); - //this.setTaskid(maintenanceDetail.getTaskid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(subscribe.getBizId()); - Dept dept = unitService.getDeptById(subscribe.getDeptId()); - User cu = userService.getUserById(subscribe.getSubscribeAuditId()); - String record = ""; - String status = subscribe.getStatus(); - //if (SparePartCommString.STATUS_DEPT_AUDIT.equals(status)) { - if (dept != null) { - record += "提交了" + company.getName() + dept.getName() + "的部门申购清单,提交给部门负责人" + cu.getCaption() + "进行审核。"; - } else { - record += "提交了" + company.getName() + "的部门申购清单,提交给部门负责人" + cu.getCaption() + "进行审核。"; - } - /*}else { - record+=""; - }*/ - this.setRecord(record); - User user = userService.getUserById(subscribe.getInsuser()); - this.setUser(user); - this.setTaskName("申购发起"); - } - - public BusinessUnitRecord(Contract contract) { - this.setId(contract.getId()); - this.setInsdt(contract.getInsdt()); - this.setInsuser(contract.getInsuser()); - this.setBusinessId(contract.getId()); - this.setProcessid(contract.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(contract.getBizId()); - Dept dept = unitService.getDeptById(contract.getDeptId()); - User cu = userService.getUserById(contract.getContractAuditId()); - String record = ""; - String status = contract.getStatus(); - if (dept != null) { - record += "提交了" + company.getName() + dept.getName() + "的合同清单,提交给部门负责人" + cu.getCaption() + "进行审核。"; - } else { - record += "提交了" + company.getName() + "的合同清单,提交给部门负责人" + cu.getCaption() + "进行审核。"; - } - this.setRecord(record); - User user = userService.getUserById(contract.getInsuser()); - this.setUser(user); - this.setTaskName("合同发起"); - } - - public BusinessUnitRecord(Contract contract, String targetusers) { - this.setId(contract.getId()); - this.setInsdt(contract.getInsdt()); - this.setInsuser(contract.getInsuser()); - this.setBusinessId(contract.getId()); - this.setProcessid(contract.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(contract.getBizId()); - Dept dept = unitService.getDeptById(contract.getDeptId()); - User cu = userService.getUserById(targetusers); - String record = ""; - if (dept != null) { - record += company.getName() + dept.getName() + "合同清单返回" + cu.getCaption() + "进行调整。"; - } - this.setRecord(record); - User user = userService.getUserById(contract.getInsuser()); - this.setUser(user); - this.setTaskName("合同调整"); - } - - public BusinessUnitRecord(BusinessUnitHandle businessUnitHandle) { -// WorkorderDetailService workorderDetailService = null; - AbnormityService abnormityService = null; - this.setId(businessUnitHandle.getId()); - this.setInsdt(businessUnitHandle.getInsdt()); - this.setInsuser(businessUnitHandle.getInsuser()); - this.setBusinessId(businessUnitHandle.getBusinessid()); - this.setProcessid(businessUnitHandle.getProcessid()); - this.setTaskdefinitionkey(businessUnitHandle.getTaskdefinitionkey()); - this.setTaskid(businessUnitHandle.getTaskid()); - this.setType(BusinessUnit.UNIT_HANDLE); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - ProcessAdjustmentService processAdjustmentService = (ProcessAdjustmentService) SpringContextUtil.getBean("processAdjustmentService"); - String handleDetail = businessUnitHandle.getHandledetail(); - //String handledt = businessUnitHandle.getHandledt(); - - User user = userService.getUserById(businessUnitHandle.getInsuser()); - this.setUser(user); - String record = ""; - BusinessUnitAdapter businessUnitAdapter = new BusinessUnitAdapter(); - if (businessUnitHandle.getUnitid() != null) {//老版本工艺未存储unitid - switch (businessUnitHandle.getUnitid()) { - case BusinessUnit.UNIT_PROCESSADJUSTMENT_EDIT: - businessUnitAdapter = processAdjustmentService.selectById(businessUnitHandle.getBusinessid()); - record += "提交了工艺调整申请!"; - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_AUDIT: - businessUnitAdapter = processAdjustmentService.selectById(businessUnitHandle.getBusinessid()); - record += "完成了工艺调整审批!"; - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_HANDLE: - businessUnitAdapter = processAdjustmentService.selectById(businessUnitHandle.getBusinessid()); - record += "完成了工艺调整!"; - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_ANALYSIS: - businessUnitAdapter = processAdjustmentService.selectById(businessUnitHandle.getBusinessid()); - record += "完成了工艺调整分析!"; - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_EVALUATE: - businessUnitAdapter = processAdjustmentService.selectById(businessUnitHandle.getBusinessid()); - record += "完成了工艺调整评价!"; - break; - case BusinessUnit.UNIT_PROCESSADJUSTMENT_DISTRIBUTION: - businessUnitAdapter = processAdjustmentService.selectById(businessUnitHandle.getBusinessid()); - record += "完成了工艺调整工时分配!"; - break; - //保养计划处理 - case BusinessUnit.UNIT_Maintain_HANDLE: - MaintenancePlanService maintenancePlanService = (MaintenancePlanService) SpringContextUtil.getBean("maintenancePlanService"); - businessUnitAdapter = maintenancePlanService.selectById(businessUnitHandle.getBusinessid()); - MaintenancePlan maintenancePlan = maintenancePlanService.selectById(businessUnitHandle.getBusinessid()); - if (maintenancePlan.getPlanType().equals(MaintenanceCommString.MAINTAIN_MONTH)) { - record += user.getCaption() + "重新提交了月度保养计划,"; - } else { - record += user.getCaption() + "重新提交了年度保养计划,"; - } - break; - //入库业务处理 - case BusinessUnit.UNIT_IN_STOCK_HANDLE: - InStockRecordService inStockRecordService = (InStockRecordService) SpringContextUtil.getBean("inStockRecordService"); - businessUnitAdapter = inStockRecordService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了入库申请!"; - break; - //处级物资领用 - case BusinessUnit.UNIT_SECTION_STOCK_HANDLE: - OutStockRecordService outStockRecordService1 = (OutStockRecordService) SpringContextUtil.getBean("outStockRecordService"); - businessUnitAdapter = outStockRecordService1.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了入库申请!"; - break; - //出库业务处理 - case BusinessUnit.UNIT_OUT_STOCK_HANDLE: - OutStockRecordService outStockRecordService = (OutStockRecordService) SpringContextUtil.getBean("outStockRecordService"); - businessUnitAdapter = outStockRecordService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了出库申请!"; - break; - //库存盘点 - case BusinessUnit.UNIT_STOCK_CHECK_HANDLE: - StockCheckService stockCheckService = (StockCheckService) SpringContextUtil.getBean("stockCheckService"); - businessUnitAdapter = stockCheckService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了库存盘点申请!"; - break; - //指标控制 - case BusinessUnit.UNIT_IndexWork_HANDLE: - IndexWorkService indexWorkService = (IndexWorkService) SpringContextUtil.getBean("indexWorkService"); - businessUnitAdapter = indexWorkService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了指标控制处理!"; - break; - //设备验收 - case BusinessUnit.UNIT_Organization_HANDLE: - OrganizationService organizationService = (OrganizationService) SpringContextUtil.getBean("organizationService"); - businessUnitAdapter = organizationService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了组织工作处理!"; - break; - //设备验收 - case BusinessUnit.UNIT_Reserve_HANDLE: - OrganizationService reserveService = (OrganizationService) SpringContextUtil.getBean("organizationService"); - businessUnitAdapter = reserveService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了预案工作处理!"; - break; - //设备验收 - case BusinessUnit.UNIT_Temporary_HANDLE: - TemporaryService temporaryService = (TemporaryService) SpringContextUtil.getBean("temporaryService"); - businessUnitAdapter = temporaryService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了临时工作处理!"; - break; - //设备停用 - case BusinessUnit.UNIT_EQUIPMENT_STOP_APPLY_ADJUST: - - EquipmentStopRecordService equipmentStopRecordService = (EquipmentStopRecordService) SpringContextUtil.getBean("equipmentStopRecordService"); - businessUnitAdapter = equipmentStopRecordService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了设备停用申请!"; - break; - //设备丢失 - case BusinessUnit.UNIT_LOSE_APPLY_ADJUST: - EquipmentLoseApplyService equipmentLoseApplyService = (EquipmentLoseApplyService) SpringContextUtil.getBean("equipmentLoseApplyService"); - businessUnitAdapter = equipmentLoseApplyService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了设备丢失申请!"; - break; - //设备出售 - case BusinessUnit.UNIT_SALE_APPLY_ADJUST: - EquipmentSaleApplyService equipmentSaleApplyService = (EquipmentSaleApplyService) SpringContextUtil.getBean("equipmentSaleApplyService"); - businessUnitAdapter = equipmentSaleApplyService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了设备出售申请!"; - break; - //设备报废 - case BusinessUnit.UNIT_SCRAP_APPLY_ADJUST: - EquipmentScrapApplyService equipmentScrapApplyService = (EquipmentScrapApplyService) SpringContextUtil.getBean("equipmentScrapApplyService"); - businessUnitAdapter = equipmentScrapApplyService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了设备报废申请!"; - break; - //设备调拨 - case BusinessUnit.UNIT_TRANSFERS_APPLY_ADJUST: - EquipmentTransfersApplyService equipmentTransfersApplyService = (EquipmentTransfersApplyService) SpringContextUtil.getBean("equipmentTransfersApplyService"); - businessUnitAdapter = equipmentTransfersApplyService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了设备调拨申请!"; - break; - //设备验收 - case BusinessUnit.UNIT_ACCEPTANCE_APPLY_ADJUST: - EquipmentAcceptanceApplyService equipmentAcceptanceApplyService = (EquipmentAcceptanceApplyService) SpringContextUtil.getBean("equipmentAcceptanceApplyService"); - businessUnitAdapter = equipmentAcceptanceApplyService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了设备调拨申请!"; - break; - //周期常规任务工单 - case BusinessUnit.UNIT_RoutineWork_Handle: - RoutineWorkService routineWorkService = (RoutineWorkServiceImpl) SpringContextUtil.getBean("routineWorkServiceImpl"); - businessUnitAdapter = routineWorkService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了周期常规任务工单!"; - break; - //化验工单 - case BusinessUnit.UNIT_WaterTest_Handle: - WaterTestService waterTestService = (WaterTestServiceImpl) SpringContextUtil.getBean("waterTestServiceImpl"); - businessUnitAdapter = waterTestService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了化验工单!"; - break; - //维修工单 - case BusinessUnit.UNIT_WORKORDER_REPAIR_ISSUE: -// workorderDetailService = (WorkorderDetailService) SpringContextUtil.getBean("workorderDetailService"); - businessUnitAdapter = workorderDetailService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "下发了维修工单!"; - break; - /*//维修工单 - case BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE: - workorderDetailService = (WorkorderDetailService) SpringContextUtil.getBean("workorderDetailService"); - businessUnitAdapter = workorderDetailService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了维修工单!"; - break;*/ - //保养工单 - case BusinessUnit.UNIT_WORKORDER_MAINTAIN_HANDLE: -// workorderDetailService = (WorkorderDetailService) SpringContextUtil.getBean("workorderDetailService"); - businessUnitAdapter = workorderDetailService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了保养工单!"; - break; - //异常处理(运行) - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_RUN: - abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - businessUnitAdapter = abnormityService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了异常处理!"; - break; - //异常处理_下发(运行) - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN: - abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - businessUnitAdapter = abnormityService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "下发了异常工单!"; - break; - //药剂业务处理 - case BusinessUnit.UNIT_RAW_MATERIAL_HANDLE: - RawMaterialService rawMaterialService = (RawMaterialService) SpringContextUtil.getBean("rawMaterialService"); - businessUnitAdapter = rawMaterialService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "重新提交了药剂登记申请!"; - break; - //异常处理(设备) - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment: - abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - businessUnitAdapter = abnormityService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了异常处理!"; - break; - //异常处理_下发(设备) - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment: - abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - businessUnitAdapter = abnormityService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "下发了异常工单!"; - break; - //异常处理(设施) - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities: - abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - businessUnitAdapter = abnormityService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了异常处理!"; - break; - //异常处理_下发(设施) - case BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities: - abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - businessUnitAdapter = abnormityService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "下发了异常工单!"; - break; - //报表生成 - case BusinessUnit.UNIT_REPORT_CREATE: - RptCreateService rptCreateService = (RptCreateService) SpringContextUtil.getBean("rptCreateService"); - businessUnitAdapter = rptCreateService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了报表生成!"; - break; - //巡检 - case BusinessUnit.UNIT_PATROL_CREATE: - PatrolRecordService patrolRecordService = (PatrolRecordService) SpringContextUtil.getBean("patrolRecordService"); - businessUnitAdapter = patrolRecordService.selectById(businessUnitHandle.getBusinessid()); - record += user.getCaption() + "提交了巡检确认!"; - break; - default://运维 - MaintenanceDetailService maintenanceDetailService = (MaintenanceDetailService) SpringContextUtil.getBean("maintenanceDetailService"); - businessUnitAdapter = maintenanceDetailService.selectById(businessUnitHandle.getBusinessid()); - break; - } - } else { - MaintenanceDetailService maintenanceDetailService = (MaintenanceDetailService) SpringContextUtil.getBean("maintenanceDetailService"); - businessUnitAdapter = maintenanceDetailService.selectById(businessUnitHandle.getBusinessid()); - } - - - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(businessUnitAdapter.getProcessdefid(), businessUnitHandle.getTaskdefinitionkey()); - /*TaskService taskService = (TaskService) SpringContextUtil.getBean("taskService"); - - Task task= taskService.createTaskQuery().taskDefinitionKey(businessUnitHandle.getTaskdefinitionkey()).singleResult();*/ - this.setTaskName(activityImpl.getProperties().get("name").toString()); - String solver = businessUnitHandle.getTargetusers(); - String userNames = ""; - //下一级人员 - if (solver != null && !solver.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + solver.replace(",", "','") + "')"); - for (User item : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += item.getCaption(); - } - } - if (BusinessUnitHandle.Status_FINISH.equals(businessUnitHandle.getStatus())) { - record += "已完成下发任务,"; - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "。"; - } - } else if (BusinessUnit.UNIT_Maintain_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_IN_STOCK_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_OUT_STOCK_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_STOCK_CHECK_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_LOSE_APPLY_ADJUST.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_SALE_APPLY_ADJUST.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_SCRAP_APPLY_ADJUST.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_RoutineWork_Handle.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_PROCESSADJUSTMENT_EDIT.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_WaterTest_Handle.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_TRANSFERS_APPLY_ADJUST.equals(businessUnitHandle.getUnitid())) { - record += "提交至" + userNames + "审核。"; - } else if (BusinessUnit.UNIT_HANDLE.equals(businessUnitHandle.getUnitid())) {//保养,维修任务调整 - record += "已完成任务,处理内容为" + businessUnitHandle.getHandledetail() + ",提交至" + userNames + "审核。"; - this.setType(""); - } else if (BusinessUnit.UNIT_IndexWork_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_Organization_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_Reserve_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_Temporary_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_REPORT_CREATE.equals(businessUnitHandle.getUnitid())) { - record += "提交至" + userNames + "审核。"; - } else if (BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_RUN.equals(businessUnitHandle.getUnitid())//异常 - || BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Equipment.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_Facilities.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_PROCESSADJUSTMENT_HANDLE.equals(businessUnitHandle.getUnitid()) - ) { - record = "提交至" + userNames + "处理。"; - } else if (BusinessUnit.UNIT_PROCESSADJUSTMENT_DISTRIBUTION.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_PROCESSADJUSTMENT_EVALUATE.equals(businessUnitHandle.getUnitid())) { - record = "已处理"; - } else if (BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE.equals(businessUnitHandle.getUnitid()) - || BusinessUnit.UNIT_WORKORDER_MAINTAIN_HANDLE.equals(businessUnitHandle.getUnitid())) { - record = "提交至" + userNames + "验收。";//维修工单 和 保养工单 - } else if (BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_RUN.equals(businessUnitHandle.getUnitid())) { - record = "已转为缺陷工单,下发至" + userNames + "处理!";//异常上报 - } else if (BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Equipment.equals(businessUnitHandle.getUnitid())) { - record = "已转为维修工单,下发至" + userNames + "处理。";//异常上报 - } else if (BusinessUnit.UNIT_WORKORDER_ABNORMITY_HANDLE_ISSUE_Facilities.equals(businessUnitHandle.getUnitid())) { - record = "已转为设施工单,下发至" + userNames + "处理。";//异常上报 - } else if (BusinessUnit.UNIT_RAW_MATERIAL_HANDLE.equals(businessUnitHandle.getUnitid())) { - record = "信息完善 ";//药剂管理 - } else { - record = "任务正在执行中... "; - } - this.setRecord(record); - CommonFileServiceImpl commonFileService = (CommonFileServiceImpl) SpringContextUtil.getBean("commonFileServiceImpl"); - List list = commonFileService.selectListByTableAWhere(tbName, "where masterid='" + businessUnitHandle.getId() + "'"); - //json路径处理 - for (CommonFile commonFile : list) { - commonFile.setAbspath(CommUtil.string2Json(commonFile.getAbspath())); - } - this.setFiles(list); - } - - public BusinessUnitRecord(BusinessUnitInquiry businessUnitInquiry) { - this.setId(businessUnitInquiry.getId()); - this.setInsdt(businessUnitInquiry.getInsdt()); - this.setInsuser(businessUnitInquiry.getInsuser()); - this.setBusinessId(businessUnitInquiry.getSubscribeId()); - this.setProcessid(businessUnitInquiry.getProcessid()); - this.setTaskdefinitionkey(businessUnitInquiry.getTaskdefinitionkey()); - this.setTaskid(businessUnitInquiry.getTaskid()); - this.setType(BusinessUnit.UNIT_INQUIRY); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String handleDetail = businessUnitInquiry.getHandledetail(); - //String handledt = businessUnitHandle.getHandledt(); - String record = ""; - if (BusinessUnitHandle.Status_FINISH.equals(businessUnitInquiry.getStatus())) { - record = "申购清单已完成询价,"; - String solver = businessUnitInquiry.getTargetusers(); - if (solver != null && !solver.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + solver.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "审核。"; - } - } - } else { - record = "任务正在执行中... "; - } - - this.setRecord(record); - - User user = userService.getUserById(businessUnitInquiry.getInsuser()); - this.setUser(user); - - SubscribeService subscribeService = (SubscribeService) SpringContextUtil.getBean("subscribeService"); - Subscribe subscribe = subscribeService.selectById(businessUnitInquiry.getSubscribeId()); - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(subscribe.getProcessdefid(), businessUnitInquiry.getTaskdefinitionkey()); - this.setTaskName(activityImpl.getProperties().get("name").toString()); - } - - public BusinessUnitRecord(BusinessUnitDeptApply businessUnitDeptApply) { - this.setId(businessUnitDeptApply.getId()); - this.setInsdt(businessUnitDeptApply.getInsdt()); - this.setInsuser(businessUnitDeptApply.getInsuser()); - this.setBusinessId(businessUnitDeptApply.getSubscribeId()); - this.setProcessid(businessUnitDeptApply.getProcessid()); - this.setTaskdefinitionkey(businessUnitDeptApply.getTaskdefinitionkey()); - this.setTaskid(businessUnitDeptApply.getTaskid()); - this.setType(BusinessUnit.UNIT_DEPT_APPLY); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String handleDetail = businessUnitDeptApply.getHandledetail(); - //String handledt = businessUnitHandle.getHandledt(); - String record = ""; - if (BusinessUnitHandle.Status_FINISH.equals(businessUnitDeptApply.getStatus())) { - record = "申购清单已提交,"; - String solver = businessUnitDeptApply.getTargetusers(); - if (solver != null && !solver.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + solver.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "审核。"; - } - } - } else { - record = "任务正在执行中... "; - } - - this.setRecord(record); - - User user = userService.getUserById(businessUnitDeptApply.getInsuser()); - this.setUser(user); - - SubscribeService subscribeService = (SubscribeService) SpringContextUtil.getBean("subscribeService"); - Subscribe subscribe = subscribeService.selectById(businessUnitDeptApply.getSubscribeId()); - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(subscribe.getProcessdefid(), businessUnitDeptApply.getTaskdefinitionkey()); - this.setTaskName(activityImpl.getProperties().get("name").toString()); - } - - public BusinessUnitRecord(BusinessUnitAudit businessUnitAudit) { - this.setId(businessUnitAudit.getId()); - this.setInsdt(businessUnitAudit.getInsdt()); - this.setInsuser(businessUnitAudit.getInsuser()); - this.setBusinessId(businessUnitAudit.getBusinessid()); - this.setProcessid(businessUnitAudit.getProcessid()); - this.setTaskdefinitionkey(businessUnitAudit.getTaskdefinitionkey()); - this.setTaskid(businessUnitAudit.getTaskid()); - this.setType(BusinessUnit.UNIT_AUDIT); - boolean passStatus = businessUnitAudit.getPassstatus(); - String auditOpinion = businessUnitAudit.getAuditopinion(); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String record = ""; - MaintenanceDetailService maintenanceDetailService = (MaintenanceDetailService) SpringContextUtil.getBean("maintenanceDetailService"); - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(businessUnitAudit.getBusinessid()); - BusinessUnitAdapter businessUnitAdapter = new BusinessUnitAdapter(); - if (passStatus) { - if (businessUnitAudit.getUnitid() != null) { - switch (businessUnitAudit.getUnitid()) { - case BusinessUnit.UNIT_PROCESSADJUSTMENT_ANALYSIS: - record = "分析结果为:通过。"; - break; - case BusinessUnit.UNIT_AUDIT: - record = "审核结果为:通过;审核意见为:" + maintenanceDetail.getEquipmentOpinion() + "。"; - break; - case BusinessUnit.UNIT_BASE_AUDIT: - record = "审核结果为:通过;审核意见为:" + maintenanceDetail.getBaseOpinion() + "。"; - break; - case BusinessUnit.UNIT_PRODUCT_AUDIT: - record = "审核结果为:通过;审核意见为:" + maintenanceDetail.getProductOpinion() + "。"; - break; - case BusinessUnit.UNIT_CENTER_AUDIT: - record = "审核结果为:通过;审核意见为:" + maintenanceDetail.getMiddleOpinion() + "。"; - break; - case BusinessUnit.UNIT_RECEIVE_HANDLE: - record = "审核结果为:通过;审核意见为:" + businessUnitAudit.getAuditopinion() + "。"; - break; - //申购审核 - case BusinessUnit.UNIT_SUBSCRIBE_AUDIT: - record = "审核结果为:通过;审核意见为:" + auditOpinion + ";"; - break; - //合同审核 - case BusinessUnit.UNIT_CONTRACT_AUDIT: - record = "审核结果为:通过;审核意见为:" + auditOpinion + ";"; - break; - //维修执行 - case BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - record = "维修工单提交;提交内容为:" + auditOpinion + ";"; - break; - //维修审核 - case BusinessUnit.UNIT_WORKORDER_REPAIR_APPLY_AUDIT: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - record = "审核结果为:通过;审核意见为:" + auditOpinion + ";"; - break; - //维修确认 - case BusinessUnit.UNIT_WORKORDER_REPAIR_CHECK_AUDIT: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - record = "审核结果为:通过;审核意见为:" + auditOpinion + ";"; - break; - default: - record = "审核结果为:通过;审核意见为:" + auditOpinion + "。"; - break; - } - } else { - record = "审核结果为:通过。"; - } - } else { - if (businessUnitAudit.getUnitid() != null) { - switch (businessUnitAudit.getUnitid()) { - //合同审核 - case BusinessUnit.UNIT_RAW_MATERIAL_AUDIT: - record = "检验结果为:不合格;检验意见为:" + auditOpinion + ";"; - break; - //维修执行 - case BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - record = "维修工单退回;退回内容为:" + auditOpinion + ";"; - break; - //维修审核 - case BusinessUnit.UNIT_WORKORDER_REPAIR_APPLY_AUDIT: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - record = "审核结果为:退回;审核意见为:" + auditOpinion + ";"; - break; - //维修确认 - case BusinessUnit.UNIT_WORKORDER_REPAIR_CHECK_AUDIT: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - record = "审核结果为:退回;审核意见为:" + auditOpinion + ";"; - break; - //报废 - case BusinessUnit.UNIT_SCRAP_APPLY_AUDIT: - businessUnitAdapter = workorderDetailService.selectById(businessUnitAudit.getBusinessid()); - // 不通过报废结束 routeNum前端配置跟此处一样才可以更改状态 且对于后续报废状态有关系 - if (businessUnitAudit.getRouteNum() == 0) { - record = "审核结果为:不通过;审核意见为:" + auditOpinion + ";"; - } else { - record = "审核结果为:退回;审核意见为:" + auditOpinion + ";"; - } - break; - default: - record = "审核结果为:退回,退回意见为:" + auditOpinion + "。"; - break; - } - } else { - record = "审核结果为:退回,退回意见为:" + auditOpinion + "。"; - } - } - String solver = businessUnitAudit.getTargetusers(); - if (solver != null && !solver.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + solver.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "。"; - } - } - this.setRecord(record); - - User user = userService.getUserById(businessUnitAudit.getInsuser()); - this.setUser(user); - - /*WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - if (maintenanceDetail != null) { - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(maintenanceDetail.getProcessdefid(), businessUnitAudit.getTaskdefinitionkey()); - this.setTaskName(activityImpl.getProperties().get("name").toString()); - }*/ - - if (businessUnitAdapter != null && businessUnitAdapter.getProcessdefid() != null) { - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(businessUnitAdapter.getProcessdefid(), businessUnitAudit.getTaskdefinitionkey()); - this.setTaskName(activityImpl.getProperties().get("name").toString()); - }else{ - HistoryService historyService = (HistoryService) SpringContextUtil.getBean("historyService"); - HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(businessUnitAudit.getTaskid()).singleResult(); - if(task!=null){ - this.setTaskName(task.getName()); - } - } - - /*TaskService taskService = (TaskService) SpringContextUtil.getBean("taskService"); - - Task task= taskService.createTaskQuery().taskDefinitionKey(businessUnitHandle.getTaskdefinitionkey()).singleResult();*/ - CommonFileServiceImpl commonFileService = (CommonFileServiceImpl) SpringContextUtil.getBean("commonFileServiceImpl"); - List list = commonFileService.selectListByTableAWhere(tbName, "where masterid='" + businessUnitAudit.getId() + "'"); - //json路径处理 - for (CommonFile commonFile : list) { - commonFile.setAbspath(CommUtil.string2Json(commonFile.getAbspath())); - } - this.setFiles(list); - } - - public BusinessUnitRecord(ProcessAdjustment processAdjustment) { - this.setId(processAdjustment.getId()); - this.setInsdt(processAdjustment.getInsdt()); - this.setInsuser(processAdjustment.getInsuser()); - this.setProcessid(processAdjustment.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(processAdjustment.getUnitId()); - - String[] userIds = processAdjustment.getTargetUserIds().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - - String record = ""; - //if (SparePartCommString.STATUS_DEPT_AUDIT.equals(status)) { - //record += "提交了的工艺调整申请,提交至" + userNames.substring(0, (userNames.length() - 1)) + "。调整内容为:" + processAdjustment.getContents(); - record += "提交了的工艺调整申请,提交至" + userNames.substring(0, (userNames.length() - 1)) + "。"; - this.setRecord(record); - User user = userService.getUserById(processAdjustment.getInsuser()); - this.setUser(user); - this.setTaskName("调整申请"); - } - - public BusinessUnitRecord(RptCreate rptCreate) { - this.setId(rptCreate.getId()); - this.setInsdt(rptCreate.getInsdt()); - this.setInsuser(rptCreate.getInsuser()); - this.setProcessid(rptCreate.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(rptCreate.getUnitId()); - - String[] userIds = rptCreate.getCheckuser().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - - String record = ""; - //if (SparePartCommString.STATUS_DEPT_AUDIT.equals(status)) { - record += "提交了的报表审核,提交至" + userNames.substring(0, (userNames.length() - 1)) + "。"; - this.setRecord(record); - User user = userService.getUserById(rptCreate.getInsuser()); - this.setUser(user); - this.setTaskName("提交审核"); - } - - /** - * 周期常规任务 - * - * @param entity - */ - public BusinessUnitRecord(RoutineWork entity) { - this.setId(entity.getId()); - this.setInsdt(entity.getInsdt()); - this.setInsuser(entity.getInsuser()); - this.setProcessid(entity.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(entity.getUnitId()); - - String[] userIds = entity.getReceiveUserIds().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - - String record = ""; - //if (SparePartCommString.STATUS_DEPT_AUDIT.equals(status)) { - record += "下发了周期常规任务工单,下发至" + userNames.substring(0, (userNames.length() - 1)); - this.setRecord(record); - User user = userService.getUserById(entity.getInsuser()); - this.setUser(user); - this.setTaskName("常规任务"); - } - - /** - * 水质化验 - * - * @param entity - */ - public BusinessUnitRecord(WaterTest entity) { - this.setId(entity.getId()); - this.setInsdt(entity.getInsdt()); - this.setInsuser(entity.getInsuser()); - this.setProcessid(entity.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(entity.getUnitId()); - - String[] userIds = entity.getReceiveUserIds().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - - String record = ""; - //if (SparePartCommString.STATUS_DEPT_AUDIT.equals(status)) { - record += "下发了水质化验工单,下发至" + userNames.substring(0, (userNames.length() - 1)); - this.setRecord(record); - User user = userService.getUserById(entity.getInsuser()); - this.setUser(user); - this.setTaskName("水质化验工单"); - } - - /** - * 入库发起记录 - */ - public BusinessUnitRecord(InStockRecord inStockRecord) { - this.setId(inStockRecord.getId()); - this.setInsdt(inStockRecord.getInsdt()); - this.setInsuser(inStockRecord.getInsuser()); - this.setProcessid(inStockRecord.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String[] userIds = inStockRecord.getAuditManId().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - String record = ""; - record += "提交了物资入库申请,提交至" + userNames.substring(0, (userNames.length() - 1)) + "审核。"; - this.setRecord(record); - User user = userService.getUserById(inStockRecord.getInsuser()); - this.setUser(user); - this.setTaskName("发起入库申请"); - } - - /** - * 药剂登记发起记录 - */ - public BusinessUnitRecord(RawMaterial rawMaterial) { - this.setId(rawMaterial.getId()); - this.setInsdt(rawMaterial.getInsdt()); - this.setInsuser(rawMaterial.getInsuser()); - this.setProcessid(rawMaterial.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String[] userIds = rawMaterial.getAuditManId().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - String record = ""; - record += "提交了药剂登记申请,提交至" + userNames.substring(0, (userNames.length() - 1)) + "审核。"; - this.setRecord(record); - User user = userService.getUserById(rawMaterial.getInsuser()); - this.setUser(user); - this.setTaskName("发起药剂登记申请"); - } - - /** - * 合理化建议发起记录 - */ - public BusinessUnitRecord(ReasonableAdvice reasonableAdvice) { - this.setId(reasonableAdvice.getId()); - this.setInsdt(reasonableAdvice.getInsdt()); - this.setInsuser(reasonableAdvice.getUserLead()); - this.setProcessid(reasonableAdvice.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String[] userIds = reasonableAdvice.getAuditManId().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - String record = ""; - record += "提交了合理化建议申请,提交至" + userNames.substring(0, (userNames.length() - 1)) + "审核。"; - this.setRecord(record); - User user = userService.getUserById(reasonableAdvice.getUserLead()); - this.setUser(user); - this.setTaskName("发起合理化建议申请"); - } - - /** - * 吐槽 发起记录 - */ - public BusinessUnitRecord(Roast roast) { - this.setId(roast.getId()); - this.setInsdt(roast.getInsdt()); - this.setInsuser(roast.getInsuser()); - this.setProcessid(roast.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String[] userIds = roast.getAuditManId().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - String record = ""; - record += "提交了吐槽内容,提交至" + userNames.substring(0, (userNames.length() - 1)) + "审核。"; - this.setRecord(record); - User user = userService.getUserById(roast.getInsuser()); - this.setUser(user); - this.setTaskName("发起吐槽内容"); - } - - /** - * 车辆维保记录 - */ - public BusinessUnitRecord(MaintainCar maintainCar) { - this.setId(maintainCar.getId()); - this.setInsdt(maintainCar.getInsdt()); - this.setInsuser(maintainCar.getInsuser()); - this.setProcessid(maintainCar.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String[] userIds = maintainCar.getSolver().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - String record = ""; - record += "提交了车辆维保工单,提交至" + userNames.substring(0, (userNames.length() - 1)) + "审核。"; - this.setRecord(record); - User user = userService.getUserById(maintainCar.getInsuser()); - this.setUser(user); - this.setTaskName("发起车辆维保工单"); - } - - - public BusinessUnitRecord(RepairCar repairCar) { - this.setId(repairCar.getId()); - this.setInsdt(repairCar.getInsdt()); - this.setInsuser(repairCar.getInsuser()); - this.setProcessid(repairCar.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String[] userIds = repairCar.getSolver().split(","); - String userNames = ""; - for (int i = 0; userIds.length > i; i++) { - User cu = userService.getUserById(userIds[i]); - userNames += cu.getCaption() + ","; - } - String record = ""; - record += "提交了车辆维修工单,提交至" + userNames.substring(0, (userNames.length() - 1)) + "审核。"; - this.setRecord(record); - User user = userService.getUserById(repairCar.getInsuser()); - this.setUser(user); - this.setTaskName("发起车辆维修工单"); - } - - /** - * 出库发起记录 - */ - public BusinessUnitRecord(OutStockRecord outStockRecord) { - this.setId(outStockRecord.getId()); - this.setInsdt(outStockRecord.getInsdt()); - this.setInsuser(outStockRecord.getInsuser()); - this.setProcessid(outStockRecord.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(outStockRecord.getAuditManId()); - String record = ""; - record += "提交了物资领用申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(outStockRecord.getInsuser()); - this.setUser(user); - this.setTaskName("发起出库申请"); - } - - - /** - * 库存盘点审核发起记录 - */ - public BusinessUnitRecord(StockCheck stockCheck) { - this.setId(stockCheck.getId()); - this.setInsdt(stockCheck.getInsdt()); - this.setInsuser(stockCheck.getInsuser()); - this.setProcessid(stockCheck.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(stockCheck.getAuditId()); - String record = ""; - record += "提交了库存盘点申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(stockCheck.getInsuser()); - this.setUser(user); - this.setTaskName("发起库存盘点申请"); - } - - /** - * 设备丢失申请发起记录 - */ - public BusinessUnitRecord(EquipmentLoseApply equipmentLoseApply) { - this.setId(equipmentLoseApply.getId()); - this.setInsdt(equipmentLoseApply.getInsdt()); - this.setInsuser(equipmentLoseApply.getInsuser()); - this.setProcessid(equipmentLoseApply.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(equipmentLoseApply.getAuditId()); - String record = ""; - record += "提交了设备丢失申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(equipmentLoseApply.getInsuser()); - this.setUser(user); - this.setTaskName("发起设备丢失申请"); - } - - /** - * 设备出售申请发起记录 - */ - public BusinessUnitRecord(EquipmentSaleApply equipmentSaleApply) { - this.setId(equipmentSaleApply.getId()); - this.setInsdt(equipmentSaleApply.getInsdt()); - this.setInsuser(equipmentSaleApply.getInsuser()); - this.setProcessid(equipmentSaleApply.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(equipmentSaleApply.getAuditId()); - String record = ""; - record += "提交了设备出售申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(equipmentSaleApply.getInsuser()); - this.setUser(user); - this.setTaskName("发起设备出售申请"); - } - - /** - * 设备报废申请发起记录 - */ - public BusinessUnitRecord(EquipmentScrapApply equipmentScrapApply) { - this.setId(equipmentScrapApply.getId()); - this.setInsdt(equipmentScrapApply.getInsdt()); - this.setInsuser(equipmentScrapApply.getInsuser()); - this.setProcessid(equipmentScrapApply.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(equipmentScrapApply.getAuditId()); - String record = ""; - record += "提交了设备报废申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(equipmentScrapApply.getInsuser()); - this.setUser(user); - this.setTaskName("发起设备报废申请"); - } - - /** - * 设备调拨申请发起记录 - */ - public BusinessUnitRecord(EquipmentTransfersApply equipmentTransfersApply) { - this.setId(equipmentTransfersApply.getId()); - this.setInsdt(equipmentTransfersApply.getInsdt()); - this.setInsuser(equipmentTransfersApply.getInsuser()); - this.setProcessid(equipmentTransfersApply.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(equipmentTransfersApply.getAuditId()); - String record = ""; - record += "提交了设备调拨申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(equipmentTransfersApply.getInsuser()); - this.setUser(user); - this.setTaskName("发起设备调拨申请"); - } - - /** - * 设备验收申请发起记录 - */ - public BusinessUnitRecord(EquipmentAcceptanceApply eaa) { - this.setId(eaa.getId()); - this.setInsdt(eaa.getInsdt()); - this.setInsuser(eaa.getInsuser()); - this.setProcessid(eaa.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(eaa.getAuditId()); - String record = ""; - record += "提交了设备验收申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(eaa.getInsuser()); - this.setUser(user); - this.setTaskName("发起设备验收申请"); - } - - - /** - * 设备停用申请发起记录 - */ - public BusinessUnitRecord(EquipmentStopRecord esr) { - this.setId(esr.getId()); - this.setInsdt(esr.getInsdt()); - this.setInsuser(esr.getInsuser()); - this.setProcessid(esr.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(esr.getAuditId()); - String record = ""; - record += "提交了设备停用申请,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - User user = userService.getUserById(esr.getInsuser()); - this.setUser(user); - this.setTaskName("发起设备停用申请"); - } - - //任务签收记录 - public BusinessUnitRecord(HistoricTaskInstance historicTaskInstance) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - this.setInsdt(sdf.format(historicTaskInstance.getClaimTime())); - this.setInsuser(historicTaskInstance.getAssignee()); - this.setTaskdefinitionkey(historicTaskInstance.getTaskDefinitionKey()); - this.setTaskid(historicTaskInstance.getId()); - //this.setType(historicTaskInstance.getDescription()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - String record = "完成任务签收!"; - this.setRecord(record); - - User user = userService.getUserById(historicTaskInstance.getAssignee()); - this.setUser(user); - WorkflowProcessDefinitionService workflowProcessDefinitionService = (WorkflowProcessDefinitionService) SpringContextUtil.getBean("workflowProcessDefinitionService"); - ActivityImpl activityImpl = workflowProcessDefinitionService.getActivitiImp(historicTaskInstance.getProcessDefinitionId(), historicTaskInstance.getTaskDefinitionKey()); - this.setTaskName(activityImpl.getProperties().get("name").toString()); - } - - /** - * 运维子流程消息发送 - * - * @param userIds 消息接收人员- 人员id以逗号隔开 - */ - public Map sendMessage(String userIds, String content) { - Map ret = new HashMap(); - String result = ""; - String sendUserId = this.getInsuser(); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User user = userService.getUserById(sendUserId); - if (content == null || content.isEmpty()) { - content = user.getCaption() + "于" + CommUtil.nowDate().substring(0, 16) + "," + this.getRecord() + "请及时处理。"; - } else { - content = "提醒您:" + content; - } - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - result = msgService.insertMsgSend(MsgType_Both, content, userIds, sendUserId, "U"); - if (result.contains("成功")) { - ret.put("suc", true); - - //推送mqtt消息 - if (userIds != null && !userIds.equals("")) { - Mqtt mqtt = (Mqtt) SpringContextUtil.getBean("mqtt"); - if (mqtt.getStatus().equals("0")) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("content", content); - String[] recvids = userIds.split(","); - for (String userId : recvids) { - MqttUtil.publish(jsonObject, userId); - } - } - } - - } else { - ret.put("suc", false); - } - return ret; - } - - /** - * 保养计划审核记录 - */ - public BusinessUnitRecord(MaintenancePlan maintenancePlan) { - this.setId(maintenancePlan.getId()); - this.setInsdt(maintenancePlan.getInsdt()); - this.setInsuser(maintenancePlan.getInsuser()); - this.setProcessid(maintenancePlan.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(maintenancePlan.getAuditId()); - User user = userService.getUserById(maintenancePlan.getInsuser()); - String record = ""; - if (maintenancePlan.getPlanType().equals(MaintenanceCommString.MAINTAIN_MONTH)) { - record += user.getCaption() + "提交了一个月度保养计划,提交至" + cu.getCaption() + "审核。"; - } else { - record += user.getCaption() + "提交了一个年度保养计划,提交至" + cu.getCaption() + "审核。"; - } - this.setRecord(record); - this.setUser(user); - this.setTaskName("发起保养计划"); - } - - public BusinessUnitRecord(EquipmentRepairPlan maintenancePlan) { - this.setId(maintenancePlan.getId()); - this.setInsdt(maintenancePlan.getInsdt()); - this.setInsuser(maintenancePlan.getInsuser()); - this.setProcessid(maintenancePlan.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(maintenancePlan.getAuditId()); - User user = userService.getUserById(maintenancePlan.getInsuser()); - String record = ""; -// if (maintenancePlan.getPlanType().equals(MaintenanceCommString.MAINTAIN_MONTH)) { -// record+=user.getCaption()+"提交了一个月度保养计划,提交至"+cu.getCaption()+"审核。"; -// }else { -// record+=user.getCaption()+"提交了一个年度保养计划,提交至"+cu.getCaption()+"审核。"; -// } - record += user.getCaption() + "提交了一个维修计划,提交至" + cu.getCaption() + "审核。"; - this.setRecord(record); - this.setUser(user); - this.setTaskName("发起维修计划"); - } - - /** - * 通用设备计划 - * - * @param equipmentPlan - */ - public BusinessUnitRecord(EquipmentPlan equipmentPlan) { - this.setId(equipmentPlan.getId()); - this.setInsdt(equipmentPlan.getInsdt()); - this.setInsuser(equipmentPlan.getInsuser()); - this.setProcessid(equipmentPlan.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(equipmentPlan.getAuditId()); - User user = userService.getUserById(equipmentPlan.getInsuser()); - String record = ""; - if (equipmentPlan.getPlanTypeSmall() != null) { - - //设备维修 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_Wx)) { - record += user.getCaption() + "提交了一个设备维修计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备维修计划"); - } - - //设备保养(四类走一个流程) - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_By)) { - record += user.getCaption() + "提交了一个设备保养计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备保养计划"); - } - - //设备大修 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_Dx)) { - record += user.getCaption() + "提交了一个设备大修计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备大修计划"); - } - - /*//设备维修 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Wx)) { - record += user.getCaption() + "提交了一个设备维修计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备维修计划"); - } - //通用保养 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Ty)) { - record += user.getCaption() + "提交了一个通用保养计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起通用保养计划"); - } - //润滑保养 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Rh)) { - record += user.getCaption() + "提交了一个润滑保养计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起润滑保养计划"); - } - //防腐保养 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Ff)) { - record += user.getCaption() + "提交了一个防腐保养计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起防腐保养计划"); - } - //仪表保养 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Yb)) { - record += user.getCaption() + "提交了一个仪表保养计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起仪表保养计划"); - } - //设备大修 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Dx)) { - record += user.getCaption() + "提交了一个设备大修计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备大修计划"); - } - //设备重置 - if (equipmentPlan.getPlanTypeSmall().equals(EquipmentPlanType.Type_Xz)) { - record += user.getCaption() + "提交了一个设备大修计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备大修计划"); - }*/ - } - - this.setRecord(record); - this.setUser(user); - - } - - public BusinessUnitRecord(Overhaul equipmentPlan) { - this.setId(equipmentPlan.getId()); - this.setInsdt(equipmentPlan.getInsdt()); - this.setInsuser(equipmentPlan.getInsuser()); - this.setBusinessId(equipmentPlan.getId()); - this.setProcessid(equipmentPlan.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(equipmentPlan.getReceiveUserId()); - User user = userService.getUserById(equipmentPlan.getInsuser()); - String record = ""; - - record += user.getCaption() + "提交了一个设备大修计划,提交至" + cu.getCaption() + "审核。"; - this.setTaskName("发起设备大修计划"); - this.setRecord(record); - this.setUser(user); - - } - - public BusinessUnitRecord(Temporary temporary) { - this.setId(temporary.getId()); - this.setInsdt(temporary.getInsdt()); - this.setInsuser(temporary.getInsuser()); - this.setBusinessId(temporary.getId()); - this.setProcessid(temporary.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(temporary.getUnitId()); - String project = temporary.getProjectName(); - String companyName = company.getName(); - String record = "发起行政综合临时任务,工作内容为:" + companyName + "," + project + "。"; - this.setTaskName("行政综合临时任务发起"); - this.setRecord(record); - User user = userService.getUserById(temporary.getInsuser()); - this.setUser(user); - } - - public BusinessUnitRecord(Organization organization) { - this.setId(organization.getId()); - this.setInsdt(organization.getInsdt()); - this.setInsuser(organization.getInsuser()); - this.setBusinessId(organization.getId()); - this.setProcessid(organization.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(organization.getUnitId()); - String project = organization.getProjectName(); - String companyName = company.getName(); - String record = ""; - String type = organization.getTypeid(); - if (OrganizationCommStr.Administration_Type_Organization.equals(type)) { - record += "发起组织工作,工作内容为:" + companyName + "," + project + "。"; - this.setTaskName("组织工作发起"); - } else if (OrganizationCommStr.Administration_Type_Reserve.equals(type)) { - record += "发起预案工作,工作内容为:" + companyName + "," + project + "。"; - this.setTaskName("预案工作发起"); - } - //评价人员 - String evaluate = organization.getEvaluateUserId(); - if (evaluate != null && !evaluate.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + evaluate.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "选择审核人为:" + userNames + "。"; - } - } - this.setRecord(record); - User user = userService.getUserById(organization.getInsuser()); - this.setUser(user); - } - - public BusinessUnitRecord(IndexWork indexWork) { - this.setId(indexWork.getId()); - this.setInsdt(indexWork.getInsdt()); - this.setInsuser(indexWork.getInsuser()); - this.setBusinessId(indexWork.getId()); - this.setProcessid(indexWork.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - Company company = unitService.getCompById(indexWork.getUnitId()); - String project = indexWork.getIndex().getName() + "(" + indexWork.getIndexCycle().getMorder() + "月)"; - String companyName = company.getName(); - String record = "发起指标控制工作,工作内容为:" + companyName + "," + project + "。"; - this.setTaskName("指标控制发起"); - //评价人员 - String evaluate = indexWork.getEvaluateUserId(); - if (evaluate != null && !evaluate.isEmpty()) { - List users = userService.selectListByWhere("where id in('" + evaluate.replace(",", "','") + "')"); - String userNames = ""; - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "选择审核人为:" + userNames + "。"; - } - } - this.setRecord(record); - User user = userService.getUserById(indexWork.getInsuser()); - this.setUser(user); - } - - public BusinessUnitRecord(WorkorderDetail workorderDetail) { - this.setId(workorderDetail.getId()); - this.setInsdt(workorderDetail.getInsdt()); - this.setInsuser(workorderDetail.getInsuser()); - this.setProcessid(workorderDetail.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu = userService.getUserById(workorderDetail.getReceiveUserId()); - User user = userService.getUserById(workorderDetail.getInsuser()); - String record = ""; - if (WorkorderDetail.REPAIR.equals(workorderDetail.getType())) { -// record += user.getCaption() + "提交了一个维修工单,提交至" + cu.getCaption() + "处理。"; - record += user.getCaption() + "下发了维修工单。"; - this.setTaskName("发起维修工单"); - } else if (WorkorderDetail.MAINTAIN.equals(workorderDetail.getType()) || WorkorderDetail.INSTRUMENT.equals(workorderDetail.getType()) || WorkorderDetail.LUBRICATION.equals(workorderDetail.getType()) || WorkorderDetail.ANTISEPTIC.equals(workorderDetail.getType())) { -// record += user.getCaption() + "提交了一个保养工单,提交至" + cu.getCaption() + "处理。"; - record += user.getCaption() + "下发了保养工单。"; - this.setTaskName("发起保养工单"); - } - this.setRecord(record); - this.setUser(user); - - - CommonFileServiceImpl commonFileService = (CommonFileServiceImpl) SpringContextUtil.getBean("commonFileServiceImpl"); - List list = new ArrayList<>(); - /*缺陷能查到关联的异常数据时,说明是由异常生成的缺陷,缺陷处理记录查看中显示多条异常的图片, - * 如果没查到数据,说明不是异常生成的缺陷,按照缺陷的id查图片 - * lius-20190325 - */ - if (workorderDetail.getId() != null && !workorderDetail.getId().isEmpty()) { - PlanRecordAbnormityService planRecordAbnormityService = (PlanRecordAbnormityService) SpringContextUtil.getBean("planRecordAbnormityService"); - List abnormities = planRecordAbnormityService.selectListByWhere("where son_id = '" + workorderDetail.getId() + "'"); - String masterIds = ""; - if (abnormities != null && abnormities.size() > 0) {//缺陷能查到关联的异常数据时,说明是由异常生成的缺陷,缺陷处理中显示多条异常的图片 - for (PlanRecordAbnormity item : abnormities) { - if (masterIds != "") { - masterIds += ","; - } - masterIds += item.getFatherId(); - } - masterIds = masterIds.replace(",", "','"); - list = commonFileService.selectListByTableAWhere(tbName_problem, "where masterid in ('" + masterIds + "')"); - } else {//如果没查到数据,说明不是异常生成的缺陷 - list = commonFileService.selectListByTableAWhere(tbName_problem, "where masterid='" + workorderDetail.getId() + "'"); - } - } - try { - for (CommonFile commonFile : list) { -// MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); -// String obj = minioClient2.presignedGetObject("maintenance", commonFile.getAbspath(), 3600 * 24 * 7); -// commonFile.setAbspath(obj); - - String path = commonFile.getAbspath(); - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - - //直接读取图片地址 存在外网无法使用 后面都换成下面的流文件 - String obj = minioClient2.presignedGetObject("maintenance", path, 3600 * 24 * 7); - commonFile.setAbspath(obj); - - //解析成流文件 后面都用这个 - byte[] buffer = commonFileService.getInputStreamBytes("maintenance", path); - String base = Base64.encode(buffer); - commonFile.setStreamFile(base); - - } - } catch (Exception e) { - System.out.println(e); - } - this.setFiles(list); - } - - public BusinessUnitRecord(Abnormity abnormity) { - this.setId(abnormity.getId()); - this.setInsdt(abnormity.getInsdt()); - this.setInsuser(abnormity.getInsuser()); - this.setProcessid(abnormity.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - String record = ""; - String userNames = ""; - if (abnormity.getReceiveUserId() != null && !abnormity.getReceiveUserId().isEmpty()) { - List users = userService.selectListByWhere("where id in('" + abnormity.getReceiveUserId().replace(",", "','") + "')"); - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "审核。"; - } - } - -// User cu = userService.getUserById(abnormity.getReceiveUserId()); - User user = userService.getUserById(abnormity.getInsuser()); - - record += user.getCaption() + "提交了一个异常单,提交至" + userNames + "处理。"; - this.setTaskName("发起异常上报"); - - this.setRecord(record); - this.setUser(user); - } - - public BusinessUnitRecord(PatrolRecord patrolRecord) { - this.setId(patrolRecord.getId()); - this.setInsdt(patrolRecord.getInsdt()); - this.setInsuser(patrolRecord.getWorkerId()); - this.setProcessid(patrolRecord.getProcessid()); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - String record = ""; - String userNames = ""; - if (patrolRecord.getReceiveUserId() != null && !patrolRecord.getReceiveUserId().isEmpty()) { - List users = userService.selectListByWhere("where id in('" + patrolRecord.getReceiveUserId().replace(",", "','") + "')"); - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "审核。"; - } - } - -// User cu = userService.getUserById(abnormity.getReceiveUserId()); - User user = userService.getUserById(patrolRecord.getWorkerId()); - - record += user.getCaption() + "提交了一个巡检任务单,提交至" + userNames + "处理。"; - this.setTaskName("发起巡检任务"); - - this.setRecord(record); - this.setUser(user); - } - - - - public BusinessUnitRecord(PurchaseRecord purchaseRecord) { - this.setId(purchaseRecord.getId()); - this.setInsdt(purchaseRecord.getInsdt()); - this.setInsuser(purchaseRecord.getInsuser()); - this.setBusinessId(purchaseRecord.getId()); - - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - String record = ""; - String userNames = ""; - if (StringUtils.isNotBlank(purchaseRecord.getsUserId())) { - List users = userService.selectListByWhere("where id in('" + purchaseRecord.getsUserId().replace(",", "','") + "')"); - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "审核。"; - } - } - -// User cu = userService.getUserById(abnormity.getReceiveUserId()); -// User user = userService.getUserById(patrolRecord.getWorkerId()); - - record += "有新的采购记录提交,可进行入库操作!"; - this.setTaskName("采购记录提交"); - - this.setRecord(record); -// this.setUser(user); - } - - - - public BusinessUnitRecord(SubscribeMessage subscribeMessage) { - this.setId(subscribeMessage.getId()); - this.setInsdt(subscribeMessage.getInsdt()); - this.setInsuser(subscribeMessage.getInsuser()); - this.setBusinessId(subscribeMessage.getId()); - - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - - String record = ""; - String userNames = ""; - if (StringUtils.isNotBlank(subscribeMessage.getSendManId())) { - List users = userService.selectListByWhere("where id in('" + subscribeMessage.getSendManId().replace(",", "','") + "')"); - for (User user : users) { - if (!userNames.isEmpty()) { - userNames += "、"; - } - userNames += user.getCaption(); - } - if (!userNames.isEmpty()) { - record += "提交至:" + userNames + "审核。"; - } - } - -// User cu = userService.getUserById(abnormity.getReceiveUserId()); -// User user = userService.getUserById(patrolRecord.getWorkerId()); - - record += "有新的申购提交,请进行关联物品!"; - this.setTaskName("申购提交"); - - this.setRecord(record); -// this.setUser(user); - } - - private String id; - - private String insdt; - - private String insuser; - - private String businessId; - - private String taskdefinitionkey; - - private String processid; - - private String taskid; - - private String record; - private String type;//记录业务单元类型 - - private User user; - - private String taskName; - - private List files; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getTaskName() { - return taskName; - } - - public void setTaskName(String taskName) { - this.taskName = taskName; - } - - public String getRecord() { - return record; - } - - public void setRecord(String record) { - this.record = record; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - - public String getBusinessId() { - return businessId; - } - - public void setBusinessId(String businessId) { - this.businessId = businessId; - } - - public String getTaskdefinitionkey() { - return taskdefinitionkey; - } - - public void setTaskdefinitionkey(String taskdefinitionkey) { - this.taskdefinitionkey = taskdefinitionkey; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - -} diff --git a/src/com/sipai/entity/command/EmergencyConfigure.java b/src/com/sipai/entity/command/EmergencyConfigure.java deleted file mode 100644 index e61cddbf..00000000 --- a/src/com/sipai/entity/command/EmergencyConfigure.java +++ /dev/null @@ -1,257 +0,0 @@ -package com.sipai.entity.command; -import com.sipai.entity.base.SQLAdapter; - -/** - * 应急预案配置 - */ -public class EmergencyConfigure extends SQLAdapter{ - public final static String Type_Catalogue="catalogue";//目录 - public final static String Type_Setting="setting";//预案 - public final static String Type_Step="step";//步骤 - - /** - * 默认步骤 - */ - public final static String[] STEP_DEFAULT = {"演练计划","演练准备","演练实施","演练评估","持续改进"}; - - private String id; - - private String name; - - private String pid; - - private String pname; - - private String st="启用"; - - private Integer ord; - - private String memo; - - private String insuser; - - private String insdt; - - private String bizid; - - private String num; - - private Integer grade; - - private String firstperson; - - private String _firstPerson; - - private String startingcondition;//启动条件(只是文字描述什么样的情况下启动改应急预案,与触发条件不一样) - - private String checked = "false"; - - private String _treeForRank;//层级 - - private String firstpersonid; //总负责人id - - private String description; - - /** - * 类型 - * 目录:catalogue - * 预案:setting - */ - private String type; - /** - * 关联报警点 - */ - private String mpointcodes; - /** - * 流程图存储 - */ - private String nodes; - /** - * 是否报警,1是0否 - */ - private Integer alarmSt; - - public Integer getAlarmSt() { - return alarmSt; - } - - public void setAlarmSt(Integer alarmSt) { - this.alarmSt = alarmSt; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - - public String getSt() { - return st; - } - - public void setSt(String st) { - this.st = st; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getNum() { - return num; - } - - public void setNum(String num) { - this.num = num; - } - - public Integer getGrade() { - return grade; - } - - public void setGrade(Integer grade) { - this.grade = grade; - } - - public String getFirstperson() { - return firstperson; - } - - public void setFirstperson(String firstperson) { - this.firstperson = firstperson; - } - - public String get_firstPerson() { - return _firstPerson; - } - - public void set_firstPerson(String _firstPerson) { - this._firstPerson = _firstPerson; - } - - public String getStartingcondition() { - return startingcondition; - } - - public void setStartingcondition(String startingcondition) { - this.startingcondition = startingcondition; - } - - public String getChecked() { - return checked; - } - - public void setChecked(String checked) { - this.checked = checked; - } - - public String get_treeForRank() { - return _treeForRank; - } - - public void set_treeForRank(String _treeForRank) { - this._treeForRank = _treeForRank; - } - - public String getFirstpersonid() { - return firstpersonid; - } - - public void setFirstpersonid(String firstpersonid) { - this.firstpersonid = firstpersonid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMpointcodes() { - return mpointcodes; - } - - public void setMpointcodes(String mpointcodes) { - this.mpointcodes = mpointcodes; - } - - public String getNodes() { - return nodes; - } - - public void setNodes(String nodes) { - this.nodes = nodes; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyConfigureDetail.java b/src/com/sipai/entity/command/EmergencyConfigureDetail.java deleted file mode 100644 index f9b6cb34..00000000 --- a/src/com/sipai/entity/command/EmergencyConfigureDetail.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.command; -import com.sipai.entity.base.SQLAdapter; -import java.math.BigDecimal; -import java.util.Date; - -public class EmergencyConfigureDetail extends SQLAdapter { - private String id; - - private String name; - - private String pid; - - private String insuser; - - private String insdt; - - private String triggertype; - - private BigDecimal triggernumber; - - private String mpid; - - private String mpname; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getTriggertype() { - return triggertype; - } - - public void setTriggertype(String triggertype) { - this.triggertype = triggertype; - } - - public BigDecimal getTriggernumber() { - return triggernumber; - } - - public void setTriggernumber(BigDecimal triggernumber) { - this.triggernumber = triggernumber; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyConfigureInfo.java b/src/com/sipai/entity/command/EmergencyConfigureInfo.java deleted file mode 100644 index eed3c718..00000000 --- a/src/com/sipai/entity/command/EmergencyConfigureInfo.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.sipai.entity.command; -import com.sipai.entity.base.SQLAdapter; - -public class EmergencyConfigureInfo extends SQLAdapter { - - private String visualization; - - public String getVisualization() { - return visualization; - } - - public void setVisualization(String visualization) { - this.visualization = visualization; - } - - private String id; - - private String pid; - - private String st; - - private Integer ord; - - private String memo; - - private String insuser; - - private String insdt; - - private String bizid; - - private String contents; - - private String contentsdetail; - - private Integer grade; - - private String roles; - - private String personliableid; - - private String personliablename; - - private String itemnumber; - - private String startupcondition; - - private String corresponding; - - private String issuer; - - private Integer rank; - - private String contentsstart; - - private String startid; - - private String planTime;//计划完成时间 - - private String _count;//该节点下的工单数�? - - public String getPlanTime() { - return planTime; - } - - public void setPlanTime(String planTime) { - this.planTime = planTime; - } - - public String get_count() { - return _count; - } - - public void set_count(String _count) { - this._count = _count; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getStartid() { - return startid; - } - - public void setStartid(String startid) { - this.startid = startid; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getSt() { - return st; - } - - public void setSt(String st) { - this.st = st; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getContentsdetail() { - return contentsdetail; - } - - public void setContentsdetail(String contentsdetail) { - this.contentsdetail = contentsdetail; - } - - public Integer getGrade() { - return grade; - } - - public void setGrade(Integer grade) { - this.grade = grade; - } - - public String getRoles() { - return roles; - } - - public void setRoles(String roles) { - this.roles = roles; - } - - public String getPersonliableid() { - return personliableid; - } - - public void setPersonliableid(String personliableid) { - this.personliableid = personliableid; - } - - public String getPersonliablename() { - return personliablename; - } - - public void setPersonliablename(String personliablename) { - this.personliablename = personliablename; - } - - public String getItemnumber() { - return itemnumber; - } - - public void setItemnumber(String itemnumber) { - this.itemnumber = itemnumber; - } - - public String getStartupcondition() { - return startupcondition; - } - - public void setStartupcondition(String startupcondition) { - this.startupcondition = startupcondition; - } - - public String getCorresponding() { - return corresponding; - } - - public void setCorresponding(String corresponding) { - this.corresponding = corresponding; - } - - public String getIssuer() { - return issuer; - } - - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - public Integer getRank() { - return rank; - } - - public void setRank(Integer rank) { - this.rank = rank; - } - - public String getContentsstart() { - return contentsstart; - } - - public void setContentsstart(String contentsstart) { - this.contentsstart = contentsstart; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyConfigureWorkOrder.java b/src/com/sipai/entity/command/EmergencyConfigureWorkOrder.java deleted file mode 100644 index a65782ed..00000000 --- a/src/com/sipai/entity/command/EmergencyConfigureWorkOrder.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.sipai.entity.command; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EmergencyConfigureWorkOrder extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String bizid; - - private String worksenduser; - - private String workreceiveuser; - - private String workcontent; - - private String worksenddt; - - private String workfinishdt; - - private Integer status; - - private String nodeid; - - private String recordid; - - private String workreceivedt; - - private String workreceivecontent; - - private String _worksenduser; - private String _workreceiveuser; - private String _companyName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getWorksenduser() { - return worksenduser; - } - - public void setWorksenduser(String worksenduser) { - this.worksenduser = worksenduser; - } - - public String getWorkreceiveuser() { - return workreceiveuser; - } - - public void setWorkreceiveuser(String workreceiveuser) { - this.workreceiveuser = workreceiveuser; - } - - public String getWorkcontent() { - return workcontent; - } - - public void setWorkcontent(String workcontent) { - this.workcontent = workcontent; - } - - public String getWorksenddt() { - return worksenddt; - } - - public void setWorksenddt(String worksenddt) { - this.worksenddt = worksenddt; - } - - public String getWorkfinishdt() { - return workfinishdt; - } - - public void setWorkfinishdt(String workfinishdt) { - this.workfinishdt = workfinishdt; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getNodeid() { - return nodeid; - } - - public void setNodeid(String nodeid) { - this.nodeid = nodeid; - } - - public String getRecordid() { - return recordid; - } - - public void setRecordid(String recordid) { - this.recordid = recordid; - } - - public String getWorkreceivedt() { - return workreceivedt; - } - - public void setWorkreceivedt(String workreceivedt) { - this.workreceivedt = workreceivedt; - } - - public String getWorkreceivecontent() { - return workreceivecontent; - } - - public void setWorkreceivecontent(String workreceivecontent) { - this.workreceivecontent = workreceivecontent; - } - - public String get_worksenduser() { - return _worksenduser; - } - public void set_worksenduser(String _worksenduser) { - this._worksenduser = _worksenduser; - } - public String get_workreceiveuser() { - return _workreceiveuser; - } - public void set_workreceiveuser(String _workreceiveuser) { - this._workreceiveuser = _workreceiveuser; - } - public String get_companyName() { - return _companyName; - } - public void set_companyName(String _companyName) { - this._companyName = _companyName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyConfigurefile.java b/src/com/sipai/entity/command/EmergencyConfigurefile.java deleted file mode 100644 index c83114bc..00000000 --- a/src/com/sipai/entity/command/EmergencyConfigurefile.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.command; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EmergencyConfigurefile extends SQLAdapter{ - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private Double size; - - private String insuser; - - private String insdt; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public Double getSize() { - return size; - } - - public void setSize(Double size) { - this.size = size; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyPlan.java b/src/com/sipai/entity/command/EmergencyPlan.java deleted file mode 100644 index 9891bd6d..00000000 --- a/src/com/sipai/entity/command/EmergencyPlan.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.sipai.entity.command; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -/** - * 应急预案计划 - * sj 2021-10-23 - */ -public class EmergencyPlan extends SQLAdapter { - public final static String Status_NoStart="0";//已下发 - public final static String Status_Start="5";//进行中 - public final static String Status_Finish="10";//已完成 - - private String id; - - private String insdt; - - private String insuser; - - private String status; - - private String planDate; - - private String unitId; - - private String emergencyConfigureId; - - private String emergencyRecordId; - - private EmergencyConfigure emergencyConfigure; - private EmergencyRecords emergencyRecords; - private Company company; - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EmergencyConfigure getEmergencyConfigure() { - return emergencyConfigure; - } - - public void setEmergencyConfigure(EmergencyConfigure emergencyConfigure) { - this.emergencyConfigure = emergencyConfigure; - } - - public EmergencyRecords getEmergencyRecords() { - return emergencyRecords; - } - - public void setEmergencyRecords(EmergencyRecords emergencyRecords) { - this.emergencyRecords = emergencyRecords; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getEmergencyConfigureId() { - return emergencyConfigureId; - } - - public void setEmergencyConfigureId(String emergencyConfigureId) { - this.emergencyConfigureId = emergencyConfigureId; - } - - public String getEmergencyRecordId() { - return emergencyRecordId; - } - - public void setEmergencyRecordId(String emergencyRecordId) { - this.emergencyRecordId = emergencyRecordId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyRecords.java b/src/com/sipai/entity/command/EmergencyRecords.java deleted file mode 100644 index abed0300..00000000 --- a/src/com/sipai/entity/command/EmergencyRecords.java +++ /dev/null @@ -1,443 +0,0 @@ -package com.sipai.entity.command; - -import com.sipai.entity.base.SQLAdapter; - -import java.util.Date; - -public class EmergencyRecords extends SQLAdapter { - - private String statusPlan; - - public String getStatusPlan() { - return statusPlan; - } - - public void setStatusPlan(String statusPlan) { - this.statusPlan = statusPlan; - } - - public final static String Status_NoStart="0";//已下�? - public final static String Status_Start="5";//进行�? - public final static String Status_Finish="10";//已完�? - public final static String Inside="Inside";//计划�? - public final static String Outside="Outside";//计划�? - - private String id; - - private String insdt; - - private String insuser; - - private String bizid; - - private String starter;//启动人id(�?般为总负责人) - - private String starttime; - - private String ender;//结束人id - - private String endtime; - - private String urgentreason; - - private String remarks; - - private String status;//状�?? 0:未启�? 5:启动中 10:结�? - - private String personliableid; - - private String personliablename; - - private Integer grade; - - private String firstmenu; - - private String secondmenu; - - private String thirdmenu; - - private String reportperson; - - private String firstperson; - - private Date reporttime; - - private Integer type; - - private String name; - - private String _starter; - - private String _bizidname; - - private String _firstmenu; - - private String _secondmenu; - - private String _thirdmenu; - - private String _firstPerson; - - private Integer _num; - - private Integer _handlenum; - - private Integer _untreatednum; - - private String memo; - - private String startingcondition; - - private String _memo; - - private String _startingcondition; - - private Integer biztype; - - private String emergencytype; - - private String color; - - private String sname; - - private String _regionid; - /** - * 关联报警点 - */ - private String mpointcodes; - /** - * 流程图存储 - */ - private String nodes; - - public void set_firstPerson(String _firstPerson) { - this._firstPerson = _firstPerson; - } - - public String getEmergencytype() { - return emergencytype; - } - public void setEmergencytype(String emergencytype) { - this.emergencytype = emergencytype; - } - - public Integer getBiztype() { - return biztype; - } - - public void setBiztype(Integer biztype) { - this.biztype = biztype; - } - - public String getMemo() { - return memo; - } - public void setMemo(String memo) { - this.memo = memo; - } - - public String getStartingcondition() { - return startingcondition; - } - public void setStartingcondition(String startingcondition) { - this.startingcondition = startingcondition; - } - - public String get_memo() { - return _memo; - } - public void set_memo(String _memo) { - this._memo = _memo; - } - - public String get_startingcondition() { - return _startingcondition; - } - public void set_startingcondition(String _startingcondition) { - this._startingcondition = _startingcondition; - } - - public String get_firstPerson() { - return _firstPerson; - } - - public String getEnder() { - return ender; - } - public void setEnder(String ender) { - this.ender = ender; - } - - public String get_starter() { - return _starter; - } - - public void set_starter(String _starter) { - this._starter = _starter; - } - - public String get_bizidname() { - return _bizidname; - } - - public void set_bizidname(String _bizidname) { - this._bizidname = _bizidname; - } - - public String get_firstmenu() { - return _firstmenu; - } - - public void set_firstmenu(String _firstmenu) { - this._firstmenu = _firstmenu; - } - - public String get_secondmenu() { - return _secondmenu; - } - - public void set_secondmenu(String _secondmenu) { - this._secondmenu = _secondmenu; - } - - public String get_thirdmenu() { - return _thirdmenu; - } - - public void set_thirdmenu(String _thirdmenu) { - this._thirdmenu = _thirdmenu; - } - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getStarter() { - return starter; - } - - public void setStarter(String starter) { - this.starter = starter; - } - - public String getStarttime() { - return starttime; - } - - public void setStarttime(String starttime) { - this.starttime = starttime; - } - - public String getEndtime() { - return endtime; - } - - public void setEndtime(String endtime) { - this.endtime = endtime; - } - - public String getUrgentreason() { - return urgentreason; - } - - public void setUrgentreason(String urgentreason) { - this.urgentreason = urgentreason; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getPersonliableid() { - return personliableid; - } - - public void setPersonliableid(String personliableid) { - this.personliableid = personliableid; - } - - public String getPersonliablename() { - return personliablename; - } - - public void setPersonliablename(String personliablename) { - this.personliablename = personliablename; - } - - public Integer getGrade() { - return grade; - } - - public void setGrade(Integer grade) { - this.grade = grade; - } - - public String getFirstmenu() { - return firstmenu; - } - - public void setFirstmenu(String firstmenu) { - this.firstmenu = firstmenu; - } - - public String getSecondmenu() { - return secondmenu; - } - - public void setSecondmenu(String secondmenu) { - this.secondmenu = secondmenu; - } - - public String getThirdmenu() { - return thirdmenu; - } - - public void setThirdmenu(String thirdmenu) { - this.thirdmenu = thirdmenu; - } - - public String getReportperson() { - return reportperson; - } - - public void setReportperson(String reportperson) { - this.reportperson = reportperson; - } - - public String getFirstperson() { - return firstperson; - } - - public void setFirstperson(String firstperson) { - this.firstperson = firstperson; - } - - public Date getReporttime() { - return reporttime; - } - - public void setReporttime(Date reporttime) { - this.reporttime = reporttime; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer get_num() { - return _num; - } - - public void set_num(Integer _num) { - this._num = _num; - } - - public Integer get_handlenum() { - return _handlenum; - } - - public void set_handlenum(Integer _handlenum) { - this._handlenum = _handlenum; - } - - public Integer get_untreatednum() { - return _untreatednum; - } - - public void set_untreatednum(Integer _untreatednum) { - this._untreatednum = _untreatednum; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public String get_regionid() { - return _regionid; - } - - public void set_regionid(String _regionid) { - this._regionid = _regionid; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getMpointcodes() { - return mpointcodes; - } - - public void setMpointcodes(String mpointcodes) { - this.mpointcodes = mpointcodes; - } - - public String getNodes() { - return nodes; - } - - public void setNodes(String nodes) { - this.nodes = nodes; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyRecordsDetail.java b/src/com/sipai/entity/command/EmergencyRecordsDetail.java deleted file mode 100644 index c482e532..00000000 --- a/src/com/sipai/entity/command/EmergencyRecordsDetail.java +++ /dev/null @@ -1,301 +0,0 @@ -package com.sipai.entity.command; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import io.swagger.annotations.ApiModelProperty; - -public class EmergencyRecordsDetail extends SQLAdapter { - - private String visualization; - - public String getVisualization() { - return visualization; - } - - public void setVisualization(String visualization) { - this.visualization = visualization; - } - - public final static String Status_NoStart="0";//已下�? - public final static String Status_Start="1";//进行�? - public final static String Status_Finish="2";//已完�? - public final static String Status_Close="3";//已完�? - public final static String Msg_Type="EmergencyPlan";//消息类型 - - private String id; - - private String insdt; - - private String insuser; - - private String bizid; - - private Integer ord; - - private String pid; - - private String ecdetailid; - - private String status;//0:未开�? 1:执行�? (启动) 2:已完�?(提交) 3:关闭 - - private Integer rank; - - private String personliableid; //无法加字�? NS项目中用�? tb_Repair_EmergencyConfigureInfo 表的 Id 别的项目还是不变 - - private String personliablename; - - private String contents; - - private String contentdetail; - - private String itemnumber; - - private String startupcondition; - - private String corresponding; - - private String issuer; - - private String startId; - - private String contentsStart; - - /* - * 2019-10-15 演练及实际过程中的每�?步操作记�? - */ - private String starter;//启动�? - private String startdt;//启动时间 - private String submitter;//提交�? - private String submitdt;//提交时间 - private String closer;//关闭�? - private String closedt;//关闭时间 - - private String planTime;//计划完成时间 - - private String _ord; - private String _id; - private String memo; - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getPlanTime() { - return planTime; - } - - public void setPlanTime(String planTime) { - this.planTime = planTime; - } - - public String get_ord() { - return _ord; - } - - public void set_ord(String _ord) { - this._ord = _ord; - } - - public String get_id() { - return _id; - } - - public void set_id(String _id) { - this._id = _id; - } - - public String getStarter() { - return starter; - } - public void setStarter(String starter) { - this.starter = starter; - } - public String getStartdt() { - return startdt; - } - public void setStartdt(String startdt) { - this.startdt = startdt; - } - public String getSubmitter() { - return submitter; - } - public void setSubmitter(String submitter) { - this.submitter = submitter; - } - public String getSubmitdt() { - return submitdt; - } - public void setSubmitdt(String submitdt) { - this.submitdt = submitdt; - } - public String getCloser() { - return closer; - } - public void setCloser(String closer) { - this.closer = closer; - } - public String getClosedt() { - return closedt; - } - public void setClosedt(String closedt) { - this.closedt = closedt; - } - - public String getContentsStart(){ - return contentsStart; - } - - public void setContentsStart(String contentsStart){ - this.contentsStart = contentsStart; - } - - public String getStartId(){ - return startId; - } - - public void setStartId(String startId){ - this.startId = startId; - } - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getEcdetailid() { - return ecdetailid; - } - - public void setEcdetailid(String ecdetailid) { - this.ecdetailid = ecdetailid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getRank() { - return rank; - } - - public void setRank(Integer rank) { - this.rank = rank; - } - - public String getPersonliableid() { - return personliableid; - } - - public void setPersonliableid(String personliableid) { - this.personliableid = personliableid; - } - - public String getPersonliablename() { - return personliablename; - } - - public void setPersonliablename(String personliablename) { - this.personliablename = personliablename; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getContentdetail() { - return contentdetail; - } - - public void setContentdetail(String contentdetail) { - this.contentdetail = contentdetail; - } - - public String getItemnumber() { - return itemnumber; - } - - public void setItemnumber(String itemnumber) { - this.itemnumber = itemnumber; - } - - public String getStartupcondition() { - return startupcondition; - } - - public void setStartupcondition(String startupcondition) { - this.startupcondition = startupcondition; - } - - public String getCorresponding() { - return corresponding; - } - - public void setCorresponding(String corresponding) { - this.corresponding = corresponding; - } - - public String getIssuer() { - return issuer; - } - - public void setIssuer(String issuer) { - this.issuer = issuer; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/command/EmergencyRecordsWorkOrder.java b/src/com/sipai/entity/command/EmergencyRecordsWorkOrder.java deleted file mode 100644 index 9d5ea808..00000000 --- a/src/com/sipai/entity/command/EmergencyRecordsWorkOrder.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.sipai.entity.command; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.timeefficiency.PatrolRecord; - -public class EmergencyRecordsWorkOrder extends SQLAdapter { - - public final static String Status_NoIssue = "0";//待下发 - public final static String Status_NoReceive = "3";//待接单 - public final static String Status_Receive = "5";//已接单 - public final static String Status_Complete = "10";//已完成 - - private String id; - - private String insdt; - - private String insuser; - - private String bizid; - - private String worksenduser; - - private String workreceiveuser; - - private String workreceiveuserid; - - private String workcontent; - - private String worksenddt; - - private String workfinishdt; - - /** - * case 0: '待下发'; - * case 3: '待接单'; - * case 5: '已接单'; - * case 10: '已完成'; - */ - private Integer status; - - private String nodeid; - - private String recordid; - - private String workreceivedt;//接单时间 - - private String workreceivecontent;//完成内容 - - private String _worksenduser; - - private String _workreceiveuser; - - private String _companyName; - - private String worksendusername; - - private String workreceiveusername; - - private String patrolRecordId; - - private PatrolRecord patrolRecord; - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public PatrolRecord getPatrolRecord() { - return patrolRecord; - } - - public void setPatrolRecord(PatrolRecord patrolRecord) { - this.patrolRecord = patrolRecord; - } - - public String getWorksendusername() { - return worksendusername; - } - - public void setWorksendusername(String worksendusername) { - this.worksendusername = worksendusername; - } - - public String getWorkreceiveusername() { - return workreceiveusername; - } - - public void setWorkreceiveusername(String workreceiveusername) { - this.workreceiveusername = workreceiveusername; - } - - public String getWorkreceivedt() { - return workreceivedt; - } - public void setWorkreceivedt(String workreceivedt) { - this.workreceivedt = workreceivedt; - } - public String get_companyName() { - return _companyName; - } - public void set_companyName(String _companyName) { - this._companyName = _companyName; - } - public String getWorkreceivecontent() { - return workreceivecontent; - } - public void setWorkreceivecontent(String workreceivecontent) { - this.workreceivecontent = workreceivecontent; - } - - public String get_worksenduser() { - return _worksenduser; - } - - public void set_worksenduser(String _worksenduser) { - this._worksenduser = _worksenduser; - } - - public String get_workreceiveuser() { - return _workreceiveuser; - } - - public void set_workreceiveuser(String _workreceiveuser) { - this._workreceiveuser = _workreceiveuser; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getWorksenduser() { - return worksenduser; - } - - public void setWorksenduser(String worksenduser) { - this.worksenduser = worksenduser; - } - - public String getWorkreceiveuser() { - return workreceiveuser; - } - - public void setWorkreceiveuser(String workreceiveuser) { - this.workreceiveuser = workreceiveuser; - } - - public String getWorkreceiveuserid() { - return workreceiveuserid; - } - - public void setWorkreceiveuserid(String workreceiveuserid) { - this.workreceiveuserid = workreceiveuserid; - } - - public String getWorkcontent() { - return workcontent; - } - - public void setWorkcontent(String workcontent) { - this.workcontent = workcontent; - } - - public String getWorksenddt() { - return worksenddt; - } - - public void setWorksenddt(String worksenddt) { - this.worksenddt = worksenddt; - } - - public String getWorkfinishdt() { - return workfinishdt; - } - - public void setWorkfinishdt(String workfinishdt) { - this.workfinishdt = workfinishdt; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getNodeid() { - return nodeid; - } - - public void setNodeid(String nodeid) { - this.nodeid = nodeid; - } - - public String getRecordid() { - return recordid; - } - - public void setRecordid(String recordid) { - this.recordid = recordid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/cqbyt/CqbytSampleValue.java b/src/com/sipai/entity/cqbyt/CqbytSampleValue.java deleted file mode 100644 index 5f40f9df..00000000 --- a/src/com/sipai/entity/cqbyt/CqbytSampleValue.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.entity.cqbyt; - -import com.sipai.entity.base.SQLAdapter; - -public class CqbytSampleValue extends SQLAdapter { - private String id; - - private String samplecode; - - private String itemcode; - - private String itemname; - - private String itemunit; - - private String checkstandardcode; - - private String checkstandardname; - - private String itemlimit; - - private String originalvalue; - - private String tempprocessvalue; - - private Double value; - - private String specialvalue; - - private String strategy; - - private String logicvalue; - - private String companycode; - - private String reserve1; - - private String reserve2; - - private String reserve3; - - private String reserve4; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSamplecode() { - return samplecode; - } - - public void setSamplecode(String samplecode) { - this.samplecode = samplecode; - } - - public String getItemcode() { - return itemcode; - } - - public void setItemcode(String itemcode) { - this.itemcode = itemcode; - } - - public String getItemname() { - return itemname; - } - - public void setItemname(String itemname) { - this.itemname = itemname; - } - - public String getItemunit() { - return itemunit; - } - - public void setItemunit(String itemunit) { - this.itemunit = itemunit; - } - - public String getCheckstandardcode() { - return checkstandardcode; - } - - public void setCheckstandardcode(String checkstandardcode) { - this.checkstandardcode = checkstandardcode; - } - - public String getCheckstandardname() { - return checkstandardname; - } - - public void setCheckstandardname(String checkstandardname) { - this.checkstandardname = checkstandardname; - } - - public String getItemlimit() { - return itemlimit; - } - - public void setItemlimit(String itemlimit) { - this.itemlimit = itemlimit; - } - - public String getOriginalvalue() { - return originalvalue; - } - - public void setOriginalvalue(String originalvalue) { - this.originalvalue = originalvalue; - } - - public String getTempprocessvalue() { - return tempprocessvalue; - } - - public void setTempprocessvalue(String tempprocessvalue) { - this.tempprocessvalue = tempprocessvalue; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getSpecialvalue() { - return specialvalue; - } - - public void setSpecialvalue(String specialvalue) { - this.specialvalue = specialvalue; - } - - public String getStrategy() { - return strategy; - } - - public void setStrategy(String strategy) { - this.strategy = strategy; - } - - public String getLogicvalue() { - return logicvalue; - } - - public void setLogicvalue(String logicvalue) { - this.logicvalue = logicvalue; - } - - public String getCompanycode() { - return companycode; - } - - public void setCompanycode(String companycode) { - this.companycode = companycode; - } - - public String getReserve1() { - return reserve1; - } - - public void setReserve1(String reserve1) { - this.reserve1 = reserve1; - } - - public String getReserve2() { - return reserve2; - } - - public void setReserve2(String reserve2) { - this.reserve2 = reserve2; - } - - public String getReserve3() { - return reserve3; - } - - public void setReserve3(String reserve3) { - this.reserve3 = reserve3; - } - - public String getReserve4() { - return reserve4; - } - - public void setReserve4(String reserve4) { - this.reserve4 = reserve4; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/cqbyt/CqbytVISITOUTINDATA.java b/src/com/sipai/entity/cqbyt/CqbytVISITOUTINDATA.java deleted file mode 100644 index f3269d1b..00000000 --- a/src/com/sipai/entity/cqbyt/CqbytVISITOUTINDATA.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.entity.cqbyt; - -import com.sipai.entity.base.SQLAdapter; - -public class CqbytVISITOUTINDATA extends SQLAdapter { - private Integer id; - - private String name; - - private String gender; - - private String cardid; - - private String images; - - private String phone; - - private String carnum; - - private Integer visitortype; - - private Integer outintype; - - private Integer devicetype; - - private Integer vTotalpeople; - - private String v_Reason; - - private String vRemark; - - private String staffname; - - private String intervieweename; - - private String createtime; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public String getCardid() { - return cardid; - } - - public void setCardid(String cardid) { - this.cardid = cardid; - } - - public String getImages() { - return images; - } - - public void setImages(String images) { - this.images = images; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getCarnum() { - return carnum; - } - - public void setCarnum(String carnum) { - this.carnum = carnum; - } - - public Integer getVisitortype() { - return visitortype; - } - - public void setVisitortype(Integer visitortype) { - this.visitortype = visitortype; - } - - public Integer getOutintype() { - return outintype; - } - - public void setOutintype(Integer outintype) { - this.outintype = outintype; - } - - public Integer getDevicetype() { - return devicetype; - } - - public void setDevicetype(Integer devicetype) { - this.devicetype = devicetype; - } - - public Integer getvTotalpeople() { - return vTotalpeople; - } - - public void setvTotalpeople(Integer vTotalpeople) { - this.vTotalpeople = vTotalpeople; - } - - public String getv_Reason() { - return v_Reason; - } - - public void setv_Reason(String v_Reason) { - this.v_Reason = v_Reason; - } - - public String getvRemark() { - return vRemark; - } - - public void setvRemark(String vRemark) { - this.vRemark = vRemark; - } - - public String getStaffname() { - return staffname; - } - - public void setStaffname(String staffname) { - this.staffname = staffname; - } - - public String getIntervieweename() { - return intervieweename; - } - - public void setIntervieweename(String intervieweename) { - this.intervieweename = intervieweename; - } - - public String getCreatetime() { - return createtime; - } - - public void setCreatetime(String createtime) { - this.createtime = createtime; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/cqbyt/KpiAnalysis.java b/src/com/sipai/entity/cqbyt/KpiAnalysis.java deleted file mode 100644 index d32d9a3d..00000000 --- a/src/com/sipai/entity/cqbyt/KpiAnalysis.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.entity.cqbyt; - -import com.sipai.entity.base.SQLAdapter; - -public class KpiAnalysis extends SQLAdapter { - - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - private String id; - - private String mpointcode; - - private String fCalculationid; - - private String fOrgid; - - private String fRemark; - - private String fSourceid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpointcode() { - return mpointcode; - } - - public void setMpointcode(String mpointcode) { - this.mpointcode = mpointcode; - } - - public String getfCalculationid() { - return fCalculationid; - } - - public void setfCalculationid(String fCalculationid) { - this.fCalculationid = fCalculationid; - } - - public String getfOrgid() { - return fOrgid; - } - - public void setfOrgid(String fOrgid) { - this.fOrgid = fOrgid; - } - - public String getfRemark() { - return fRemark; - } - - public void setfRemark(String fRemark) { - this.fRemark = fRemark; - } - - public String getfSourceid() { - return fSourceid; - } - - public void setfSourceid(String fSourceid) { - this.fSourceid = fSourceid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/cqbyt/TestReport.java b/src/com/sipai/entity/cqbyt/TestReport.java deleted file mode 100644 index 5df8fa02..00000000 --- a/src/com/sipai/entity/cqbyt/TestReport.java +++ /dev/null @@ -1,458 +0,0 @@ -package com.sipai.entity.cqbyt; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class TestReport extends SQLAdapter { - private String id; - - private String reportcode; - - private String code; - - private String name; - - private Integer datasource; - - private String samplesource; - - private String checkpropertycode; - - private String checkpropertyname; - - private String classifycode; - - private String classifyname; - - private String evaluatestandardcode; - - private String evaluatestandardname; - - private String sampleplancode; - - private String sampleplanname; - - private String becheckedunitcode; - - private String becheckedunitname; - - private String sampleinstitutioncode; - - private String sampleinstitutionname; - - private String sampleaddress; - - private String sampledate; - - private String samplestate; - - private String sampler; - - private String receivingdate; - - private String checkdate; - - private String checkitems; - - private String checkconclusion; - - private Double longitude; - - private Double latitude; - - private String companycode; - - private String waterpointcode; - - private String waterpointname; - - private String createtime; - - private String createman; - - private Integer tsistatus; - - private String tsitime; - - private String des; - - private String reserved1; - - private String reserved2; - - private String reserved3; - - private String sampledatestart; - - private String sampledateend; - - private String tsitimestart; - - private String tsitimeend; - - private String companyname; - - private List testReportDetails; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getReportcode() { - return reportcode; - } - - public void setReportcode(String reportcode) { - this.reportcode = reportcode; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getDatasource() { - return datasource; - } - - public void setDatasource(Integer datasource) { - this.datasource = datasource; - } - - public String getSamplesource() { - return samplesource; - } - - public void setSamplesource(String samplesource) { - this.samplesource = samplesource; - } - - public String getCheckpropertycode() { - return checkpropertycode; - } - - public void setCheckpropertycode(String checkpropertycode) { - this.checkpropertycode = checkpropertycode; - } - - public String getCheckpropertyname() { - return checkpropertyname; - } - - public void setCheckpropertyname(String checkpropertyname) { - this.checkpropertyname = checkpropertyname; - } - - public String getClassifycode() { - return classifycode; - } - - public void setClassifycode(String classifycode) { - this.classifycode = classifycode; - } - - public String getClassifyname() { - return classifyname; - } - - public void setClassifyname(String classifyname) { - this.classifyname = classifyname; - } - - public String getEvaluatestandardcode() { - return evaluatestandardcode; - } - - public void setEvaluatestandardcode(String evaluatestandardcode) { - this.evaluatestandardcode = evaluatestandardcode; - } - - public String getEvaluatestandardname() { - return evaluatestandardname; - } - - public void setEvaluatestandardname(String evaluatestandardname) { - this.evaluatestandardname = evaluatestandardname; - } - - public String getSampleplancode() { - return sampleplancode; - } - - public void setSampleplancode(String sampleplancode) { - this.sampleplancode = sampleplancode; - } - - public String getSampleplanname() { - return sampleplanname; - } - - public void setSampleplanname(String sampleplanname) { - this.sampleplanname = sampleplanname; - } - - public String getBecheckedunitcode() { - return becheckedunitcode; - } - - public void setBecheckedunitcode(String becheckedunitcode) { - this.becheckedunitcode = becheckedunitcode; - } - - public String getBecheckedunitname() { - return becheckedunitname; - } - - public void setBecheckedunitname(String becheckedunitname) { - this.becheckedunitname = becheckedunitname; - } - - public String getSampleinstitutioncode() { - return sampleinstitutioncode; - } - - public void setSampleinstitutioncode(String sampleinstitutioncode) { - this.sampleinstitutioncode = sampleinstitutioncode; - } - - public String getSampleinstitutionname() { - return sampleinstitutionname; - } - - public void setSampleinstitutionname(String sampleinstitutionname) { - this.sampleinstitutionname = sampleinstitutionname; - } - - public String getSampleaddress() { - return sampleaddress; - } - - public void setSampleaddress(String sampleaddress) { - this.sampleaddress = sampleaddress; - } - - public String getSampledate() { - return sampledate; - } - - public void setSampledate(String sampledate) { - this.sampledate = sampledate; - } - - public String getSamplestate() { - return samplestate; - } - - public void setSamplestate(String samplestate) { - this.samplestate = samplestate; - } - - public String getSampler() { - return sampler; - } - - public void setSampler(String sampler) { - this.sampler = sampler; - } - - public String getReceivingdate() { - return receivingdate; - } - - public void setReceivingdate(String receivingdate) { - this.receivingdate = receivingdate; - } - - public String getCheckdate() { - return checkdate; - } - - public void setCheckdate(String checkdate) { - this.checkdate = checkdate; - } - - public String getCheckitems() { - return checkitems; - } - - public void setCheckitems(String checkitems) { - this.checkitems = checkitems; - } - - public String getCheckconclusion() { - return checkconclusion; - } - - public void setCheckconclusion(String checkconclusion) { - this.checkconclusion = checkconclusion; - } - - public Double getLongitude() { - return longitude; - } - - public void setLongitude(Double longitude) { - this.longitude = longitude; - } - - public Double getLatitude() { - return latitude; - } - - public void setLatitude(Double latitude) { - this.latitude = latitude; - } - - public String getCompanycode() { - return companycode; - } - - public void setCompanycode(String companycode) { - this.companycode = companycode; - } - - public String getWaterpointcode() { - return waterpointcode; - } - - public void setWaterpointcode(String waterpointcode) { - this.waterpointcode = waterpointcode; - } - - public String getWaterpointname() { - return waterpointname; - } - - public void setWaterpointname(String waterpointname) { - this.waterpointname = waterpointname; - } - - public String getCreatetime() { - return createtime; - } - - public void setCreatetime(String createtime) { - this.createtime = createtime; - } - - public String getCreateman() { - return createman; - } - - public void setCreateman(String createman) { - this.createman = createman; - } - - public Integer getTsistatus() { - return tsistatus; - } - - public void setTsistatus(Integer tsistatus) { - this.tsistatus = tsistatus; - } - - public String getTsitime() { - return tsitime; - } - - public void setTsitime(String tsitime) { - this.tsitime = tsitime; - } - - public String getDes() { - return des; - } - - public void setDes(String des) { - this.des = des; - } - - public String getReserved1() { - return reserved1; - } - - public void setReserved1(String reserved1) { - this.reserved1 = reserved1; - } - - public String getReserved2() { - return reserved2; - } - - public void setReserved2(String reserved2) { - this.reserved2 = reserved2; - } - - public String getReserved3() { - return reserved3; - } - - public void setReserved3(String reserved3) { - this.reserved3 = reserved3; - } - - public String getSampledatestart() { - return sampledatestart; - } - - public void setSampledatestart(String sampledatestart) { - this.sampledatestart = sampledatestart; - } - - public String getSampledateend() { - return sampledateend; - } - - public void setSampledateend(String sampledateend) { - this.sampledateend = sampledateend; - } - - public String getTsitimestart() { - return tsitimestart; - } - - public void setTsitimestart(String tsitimestart) { - this.tsitimestart = tsitimestart; - } - - public String getTsitimeend() { - return tsitimeend; - } - - public void setTsitimeend(String tsitimeend) { - this.tsitimeend = tsitimeend; - } - - public String getCompanyname() { - return companyname; - } - - public void setCompanyname(String companyname) { - this.companyname = companyname; - } - - public List getTestReportDetails() { - return testReportDetails; - } - - public void setTestReportDetails(List testReportDetails) { - this.testReportDetails = testReportDetails; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/cqbyt/TestReportDetails.java b/src/com/sipai/entity/cqbyt/TestReportDetails.java deleted file mode 100644 index 5d93c2a6..00000000 --- a/src/com/sipai/entity/cqbyt/TestReportDetails.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.entity.cqbyt; - -import com.sipai.entity.base.SQLAdapter; - -public class TestReportDetails extends SQLAdapter { - private String id; - - private String samplecode; - - private String itemcode; - - private String itemname; - - private String itemunit; - - private Integer datasource; - - private String checkstandardcode; - - private String checkstandardname; - - private String itemlimit; - - private String originalvalue; - - private String tempprocessvalue; - - private Double value; - - private String specialvalue; - - private String strategy; - - private Integer logicvalue; - - private String companycode; - - private String reserve1; - - private String reserve2; - - private String reserve3; - - private String reserve4; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSamplecode() { - return samplecode; - } - - public void setSamplecode(String samplecode) { - this.samplecode = samplecode; - } - - public String getItemcode() { - return itemcode; - } - - public void setItemcode(String itemcode) { - this.itemcode = itemcode; - } - - public String getItemname() { - return itemname; - } - - public void setItemname(String itemname) { - this.itemname = itemname; - } - - public String getItemunit() { - return itemunit; - } - - public void setItemunit(String itemunit) { - this.itemunit = itemunit; - } - - public Integer getDatasource() { - return datasource; - } - - public void setDatasource(Integer datasource) { - this.datasource = datasource; - } - - public String getCheckstandardcode() { - return checkstandardcode; - } - - public void setCheckstandardcode(String checkstandardcode) { - this.checkstandardcode = checkstandardcode; - } - - public String getCheckstandardname() { - return checkstandardname; - } - - public void setCheckstandardname(String checkstandardname) { - this.checkstandardname = checkstandardname; - } - - public String getItemlimit() { - return itemlimit; - } - - public void setItemlimit(String itemlimit) { - this.itemlimit = itemlimit; - } - - public String getOriginalvalue() { - return originalvalue; - } - - public void setOriginalvalue(String originalvalue) { - this.originalvalue = originalvalue; - } - - public String getTempprocessvalue() { - return tempprocessvalue; - } - - public void setTempprocessvalue(String tempprocessvalue) { - this.tempprocessvalue = tempprocessvalue; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getSpecialvalue() { - return specialvalue; - } - - public void setSpecialvalue(String specialvalue) { - this.specialvalue = specialvalue; - } - - public String getStrategy() { - return strategy; - } - - public void setStrategy(String strategy) { - this.strategy = strategy; - } - - public Integer getLogicvalue() { - return logicvalue; - } - - public void setLogicvalue(Integer logicvalue) { - this.logicvalue = logicvalue; - } - - public String getCompanycode() { - return companycode; - } - - public void setCompanycode(String companycode) { - this.companycode = companycode; - } - - public String getReserve1() { - return reserve1; - } - - public void setReserve1(String reserve1) { - this.reserve1 = reserve1; - } - - public String getReserve2() { - return reserve2; - } - - public void setReserve2(String reserve2) { - this.reserve2 = reserve2; - } - - public String getReserve3() { - return reserve3; - } - - public void setReserve3(String reserve3) { - this.reserve3 = reserve3; - } - - public String getReserve4() { - return reserve4; - } - - public void setReserve4(String reserve4) { - this.reserve4 = reserve4; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/cqbyt/Ytsj.java b/src/com/sipai/entity/cqbyt/Ytsj.java deleted file mode 100644 index f4721159..00000000 --- a/src/com/sipai/entity/cqbyt/Ytsj.java +++ /dev/null @@ -1,362 +0,0 @@ -package com.sipai.entity.cqbyt; - -import com.sipai.entity.base.SQLAdapter; -import java.math.BigDecimal; - -public class Ytsj extends SQLAdapter { - private String insdt; - private String insuser; - private String accountNumber; - private String accountName; - private String abbreviation; - private String area; - private String importantLevel; - private String remarks; - private String factorname; - private String valuetype; - private String expr1; - private Integer expr2; - private String expr3; - private String id; - private String contractNumber; - private Integer contractOrder; - private String name; - private String address; - private String contractDate; - private String username; - private String phone; - private String processSectionId; - private String unitId; - private String ventNum; - private String permitNum; - private String planeNum; - private String environmentNum; - private String trade; - private String permit; - private Integer displacement; - private String standard; - private String city; - private String societyNumber; - private String longitudeLatitude; - private String attribute; - private String remark; - private String tstamp; - private BigDecimal pollutantvalue; - private String outputname; - - public Ytsj() { - } - - public String getExpr1() { - return this.expr1; - } - - public void setExpr1(String expr1) { - this.expr1 = expr1; - } - - public Integer getExpr2() { - return this.expr2; - } - - public void setExpr2(Integer expr2) { - this.expr2 = expr2; - } - - public String getExpr3() { - return this.expr3; - } - - public void setExpr3(String expr3) { - this.expr3 = expr3; - } - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContractNumber() { - return this.contractNumber; - } - - public void setContractNumber(String contractNumber) { - this.contractNumber = contractNumber; - } - - public Integer getContractOrder() { - return this.contractOrder; - } - - public void setContractOrder(Integer contractOrder) { - this.contractOrder = contractOrder; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return this.address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getContractDate() { - return this.contractDate; - } - - public void setContractDate(String contractDate) { - this.contractDate = contractDate; - } - - public String getUsername() { - return this.username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPhone() { - return this.phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getProcessSectionId() { - return this.processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getUnitId() { - return this.unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getVentNum() { - return this.ventNum; - } - - public void setVentNum(String ventNum) { - this.ventNum = ventNum; - } - - public String getPermitNum() { - return this.permitNum; - } - - public void setPermitNum(String permitNum) { - this.permitNum = permitNum; - } - - public String getPlaneNum() { - return this.planeNum; - } - - public void setPlaneNum(String planeNum) { - this.planeNum = planeNum; - } - - public String getEnvironmentNum() { - return this.environmentNum; - } - - public void setEnvironmentNum(String environmentNum) { - this.environmentNum = environmentNum; - } - - public String getTrade() { - return this.trade; - } - - public void setTrade(String trade) { - this.trade = trade; - } - - public String getPermit() { - return this.permit; - } - - public void setPermit(String permit) { - this.permit = permit; - } - - public Integer getDisplacement() { - return this.displacement; - } - - public void setDisplacement(Integer displacement) { - this.displacement = displacement; - } - - public String getStandard() { - return this.standard; - } - - public void setStandard(String standard) { - this.standard = standard; - } - - public String getCity() { - return this.city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getSocietyNumber() { - return this.societyNumber; - } - - public void setSocietyNumber(String societyNumber) { - this.societyNumber = societyNumber; - } - - public String getLongitudeLatitude() { - return this.longitudeLatitude; - } - - public void setLongitudeLatitude(String longitudeLatitude) { - this.longitudeLatitude = longitudeLatitude; - } - - public String getAttribute() { - return this.attribute; - } - - public void setAttribute(String attribute) { - this.attribute = attribute; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getTstamp() { - return this.tstamp; - } - - public void setTstamp(String tstamp) { - this.tstamp = tstamp; - } - - public BigDecimal getPollutantvalue() { - return this.pollutantvalue; - } - - public void setPollutantvalue(BigDecimal pollutantvalue) { - this.pollutantvalue = pollutantvalue; - } - - public String getOutputname() { - return this.outputname; - } - - public void setOutputname(String outputname) { - this.outputname = outputname; - } - - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public String getAccountName() { - return accountName; - } - - public void setAccountName(String accountName) { - this.accountName = accountName; - } - - public String getAbbreviation() { - return abbreviation; - } - - public void setAbbreviation(String abbreviation) { - this.abbreviation = abbreviation; - } - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getImportantLevel() { - return importantLevel; - } - - public void setImportantLevel(String importantLevel) { - this.importantLevel = importantLevel; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getFactorname() { - return factorname; - } - - public void setFactorname(String factorname) { - this.factorname = factorname; - } - - public String getValuetype() { - return valuetype; - } - - public void setValuetype(String valuetype) { - this.valuetype = valuetype; - } -} diff --git a/src/com/sipai/entity/data/CurveMpoint.java b/src/com/sipai/entity/data/CurveMpoint.java deleted file mode 100644 index 5ae9851b..00000000 --- a/src/com/sipai/entity/data/CurveMpoint.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.data; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; - -public class CurveMpoint extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -7680535275644727503L; - - private String id; - - private String dataCurveId; - - private String mpointId; - - private String disname; - - private String insuser; - - private String insdt; - - private Integer morder; - - private String func; - - private String unitId; - - private MPoint mPoint; - - private Unit unit; - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataCurveId() { - return dataCurveId; - } - - public void setDataCurveId(String dataCurveId) { - this.dataCurveId = dataCurveId; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public String getDisname() { - return disname; - } - - public void setDisname(String disname) { - this.disname = disname; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getFunc() { - return func; - } - - public void setFunc(String func) { - this.func = func; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/CurveRemark.java b/src/com/sipai/entity/data/CurveRemark.java deleted file mode 100644 index 5811d5dd..00000000 --- a/src/com/sipai/entity/data/CurveRemark.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sipai.entity.data; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class CurveRemark extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -4824897931464116003L; - - private String id; - - private String sdt; - - private String edt; - - private String insuser; - - private String insdt; - - private String content; - - private String mpointId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/CurveRemarkFile.java b/src/com/sipai/entity/data/CurveRemarkFile.java deleted file mode 100644 index b28d185a..00000000 --- a/src/com/sipai/entity/data/CurveRemarkFile.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; - -public class CurveRemarkFile extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String masterid; - - private String filename; - - private String abspath; - - private String filepath; - - private String type; - - private Integer size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid == null ? null : masterid.trim(); - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename == null ? null : filename.trim(); - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath == null ? null : abspath.trim(); - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath == null ? null : filepath.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getSize() { - return size; - } - - public void setSize(Integer size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataCleaningCondition.java b/src/com/sipai/entity/data/DataCleaningCondition.java deleted file mode 100644 index a649454d..00000000 --- a/src/com/sipai/entity/data/DataCleaningCondition.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; - -public class DataCleaningCondition extends SQLAdapter { - - private String id; - - private String pid; - - private String jstype; - - private Double jsvalue; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getJstype() { - return jstype; - } - - public void setJstype(String jstype) { - this.jstype = jstype == null ? null : jstype.trim(); - } - - public Double getJsvalue() { - return jsvalue; - } - - public void setJsvalue(Double jsvalue) { - this.jsvalue = jsvalue; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataCleaningConfigure.java b/src/com/sipai/entity/data/DataCleaningConfigure.java deleted file mode 100644 index 677e5b18..00000000 --- a/src/com/sipai/entity/data/DataCleaningConfigure.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; - -public class DataCleaningConfigure extends SQLAdapter { - public final static String ReplaceType_previous = "previous";//上一条正确范围内数据 - public final static String ReplaceType_avg = "avg";//时间范围内正确数据的均值 - public final static String ReplaceType_max = "max";//时间范围内正确数据的最大值 - public final static String ReplaceType_min = "min";//时间范围内正确数据的最小值 - public final static String ReplaceType_none = "none";//无需替换(删除被清洗数据) - public final static String ReplaceType_same = "same";//相同数值和日期数据删除 - - private String id; - - private String timerange; - - private String replacetype; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getTimerange() { - return timerange; - } - - public void setTimerange(String timerange) { - this.timerange = timerange == null ? null : timerange.trim(); - } - - public String getReplacetype() { - return replacetype; - } - - public void setReplacetype(String replacetype) { - this.replacetype = replacetype == null ? null : replacetype.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataCleaningHistory.java b/src/com/sipai/entity/data/DataCleaningHistory.java deleted file mode 100644 index f1b57bac..00000000 --- a/src/com/sipai/entity/data/DataCleaningHistory.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -public class DataCleaningHistory extends SQLAdapter { - private String id; - - private String mpid; - - private BigDecimal parmvalue; - - private String measuredt; - - private BigDecimal replaceparmvalue; - - private String cleaningdt; - - private String unitid; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public BigDecimal getParmvalue() { - return parmvalue; - } - - public void setParmvalue(BigDecimal parmvalue) { - this.parmvalue = parmvalue; - } - - public String getMeasuredt() { - return measuredt; - } - - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - - public BigDecimal getReplaceparmvalue() { - return replaceparmvalue; - } - - public void setReplaceparmvalue(BigDecimal replaceparmvalue) { - this.replaceparmvalue = replaceparmvalue; - } - - public String getCleaningdt() { - return cleaningdt; - } - - public void setCleaningdt(String cleaningdt) { - this.cleaningdt = cleaningdt; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataCleaningPoint.java b/src/com/sipai/entity/data/DataCleaningPoint.java deleted file mode 100644 index a6820784..00000000 --- a/src/com/sipai/entity/data/DataCleaningPoint.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; - -public class DataCleaningPoint extends SQLAdapter { - private String id; - - private String unitid; - - private String point; - - private String insdt; - - private String insuser; - - private String timerange; - - private String replacetype; - - private String pointName; - private String insuserName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getPoint() { - return point; - } - - public void setPoint(String point) { - this.point = point == null ? null : point.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getTimerange() { - return timerange; - } - - public void setTimerange(String timerange) { - this.timerange = timerange == null ? null : timerange.trim(); - } - - public String getReplacetype() { - return replacetype; - } - - public void setReplacetype(String replacetype) { - this.replacetype = replacetype == null ? null : replacetype.trim(); - } - - public String getPointName() { - return pointName; - } - - public void setPointName(String pointName) { - this.pointName = pointName; - } - - public String getInsuserName() { - return insuserName; - } - - public void setInsuserName(String insuserName) { - this.insuserName = insuserName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataCurve.java b/src/com/sipai/entity/data/DataCurve.java deleted file mode 100644 index 2451b3d6..00000000 --- a/src/com/sipai/entity/data/DataCurve.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.sipai.entity.data; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class DataCurve extends SQLAdapter implements Serializable{ - - private static final long serialVersionUID = 1120702528984972427L; - public final static String Type_group = "1";//类型为曲线分组 - public final static String Type_curve = "2";//类型为曲线组合 - public final static String Type_curve_mpoint = "3";//类型为测量点组合 - public final static String Type_sys = "4";//系统曲线 - public final static String Type_user = "5";//用户曲线 - public final static String Type_mp = "6";//测量点 - - //树状图图标 - public static final String DATA_CURVE_GROUP_ICON = "fa fa-bank";//曲线分组 - public static final String DATA_CURVE_ICON = "el-icon-s-home";//曲线组合 - public static final String DATA_CURVE_MPOINT_ICON = "el-icon-s-data";//测量点组合 - - //启用状态 - public final static String Active_true = "0";//启用 - public final static String Active_false = "1";//禁用 - public final static String Active_ProgrammeTrue = "启用";//生产库启用 - - private String id; - - private String pid; - - private String name; - - private String active; - - private String type; - - private String remark; - - private String insuser; - - private String insdt; - - private Integer morder; - - private String unitId; - - private String curvetype; - - private String axistype; - - private String pname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active == null ? null : active.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getCurvetype() { - return curvetype; - } - - public void setCurvetype(String curvetype) { - this.curvetype = curvetype == null ? null : curvetype.trim(); - } - - public String getAxistype() { - return axistype; - } - - public void setAxistype(String axistype) { - this.axistype = axistype == null ? null : axistype.trim(); - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataSource.java b/src/com/sipai/entity/data/DataSource.java deleted file mode 100644 index 9121bddc..00000000 --- a/src/com/sipai/entity/data/DataSource.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class DataSource extends SQLAdapter{ - private String id; - - private String name; - - private String serverType; - - private String ipAddress; - - private String port; - - private String username; - - private String password; - - private String databaseName; - - private String databaseType; - - private String unitId; - - private Integer scheduledScanStatus; - - private Integer scheduledScanMinutes; - - private String connectionStatus; - - private String lastScanTime; - - private String active; - - private Company company; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getServerType() { - return serverType; - } - - public void setServerType(String serverType) { - this.serverType = serverType; - } - - public String getIpAddress() { - return ipAddress; - } - - public void setIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getDatabaseName() { - return databaseName; - } - - public void setDatabaseName(String databaseName) { - this.databaseName = databaseName; - } - - public String getDatabaseType() { - return databaseType; - } - - public void setDatabaseType(String databaseType) { - this.databaseType = databaseType; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getScheduledScanStatus() { - return scheduledScanStatus; - } - - public void setScheduledScanStatus(Integer scheduledScanStatus) { - this.scheduledScanStatus = scheduledScanStatus; - } - - public Integer getScheduledScanMinutes() { - return scheduledScanMinutes; - } - - public void setScheduledScanMinutes(Integer scheduledScanMinutes) { - this.scheduledScanMinutes = scheduledScanMinutes; - } - - public String getConnectionStatus() { - return connectionStatus; - } - - public void setConnectionStatus(String connectionStatus) { - this.connectionStatus = connectionStatus; - } - - public String getLastScanTime() { - return lastScanTime; - } - - public void setLastScanTime(String lastScanTime) { - this.lastScanTime = lastScanTime; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/DataTransConfig.java b/src/com/sipai/entity/data/DataTransConfig.java deleted file mode 100644 index 215515db..00000000 --- a/src/com/sipai/entity/data/DataTransConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.entity.data; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 竹一定制表,根据配置的modbus寄存器地址,将数据转到生产库中 - */ -public class DataTransConfig extends SQLAdapter { - private String id; - - private String modbusUrl; - - private String register; - - private String mpcode; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getModbusUrl() { - return modbusUrl; - } - - public void setModbusUrl(String modbusUrl) { - this.modbusUrl = modbusUrl == null ? null : modbusUrl.trim(); - } - - public String getRegister() { - return register; - } - - public void setRegister(String register) { - this.register = register == null ? null : register.trim(); - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode == null ? null : mpcode.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/data/XServer.java b/src/com/sipai/entity/data/XServer.java deleted file mode 100644 index d1b65aee..00000000 --- a/src/com/sipai/entity/data/XServer.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.entity.data; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class XServer extends SQLAdapter{ - private String id; - - private String name; - - private String ipaddress; - - private String loginname; - - private String password; - - private String domain; - - private String typeid; - - private String memo; - - private String dbname; - - private String dbtype; - - private String port; - - private String clsid; - - private String bizid; - - private String status; - - private String startup; - - private String driver; - - private String lastdate; - - private String enddate; - - private String flag; - - private Integer timespan; - - private String connectionStatus; - - private Company company; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getIpaddress() { - return ipaddress; - } - - public void setIpaddress(String ipaddress) { - this.ipaddress = ipaddress; - } - - public String getLoginname() { - return loginname; - } - - public void setLoginname(String loginname) { - this.loginname = loginname; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public String getTypeid() { - return typeid; - } - - public void setTypeid(String typeid) { - this.typeid = typeid; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getDbname() { - return dbname; - } - - public void setDbname(String dbname) { - this.dbname = dbname; - } - - public String getDbtype() { - return dbtype; - } - - public void setDbtype(String dbtype) { - this.dbtype = dbtype; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } - - public String getClsid() { - return clsid; - } - - public void setClsid(String clsid) { - this.clsid = clsid; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getStartup() { - return startup; - } - - public void setStartup(String startup) { - this.startup = startup; - } - - public String getDriver() { - return driver; - } - - public void setDriver(String driver) { - this.driver = driver; - } - - public String getLastdate() { - return lastdate; - } - - public void setLastdate(String lastdate) { - this.lastdate = lastdate; - } - - public String getEnddate() { - return enddate; - } - - public void setEnddate(String enddate) { - this.enddate = enddate; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public Integer getTimespan() { - return timespan; - } - - public void setTimespan(Integer timespan) { - this.timespan = timespan; - } - - public String getConnectionStatus() { - return connectionStatus; - } - - public void setConnectionStatus(String connectionStatus) { - this.connectionStatus = connectionStatus; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/digitalProcess/DispatchSheetEntry.java b/src/com/sipai/entity/digitalProcess/DispatchSheetEntry.java deleted file mode 100644 index 7ac44572..00000000 --- a/src/com/sipai/entity/digitalProcess/DispatchSheetEntry.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.entity.digitalProcess; - -import com.sipai.entity.base.SQLAdapter; - - -public class DispatchSheetEntry extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String recorddt; - - private String startdt; - - private String enddt; - - private String dispatchclass; - - private Double output; - - private Double throughput; - - private String remark; - - private String exitremark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getRecorddt() { - return recorddt; - } - - public void setRecorddt(String recorddt) { - this.recorddt = recorddt; - } - - public String getStartdt() { - return startdt; - } - - public void setStartdt(String startdt) { - this.startdt = startdt; - } - - public String getEnddt() { - return enddt; - } - - public void setEnddt(String enddt) { - this.enddt = enddt; - } - - public String getDispatchclass() { - return dispatchclass; - } - - public void setDispatchclass(String dispatchclass) { - this.dispatchclass = dispatchclass == null ? null : dispatchclass.trim(); - } - - public Double getOutput() { - return output; - } - - public void setOutput(Double output) { - this.output = output; - } - - public Double getThroughput() { - return throughput; - } - - public void setThroughput(Double throughput) { - this.throughput = throughput; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public String getExitremark() { - return exitremark; - } - - public void setExitremark(String exitremark) { - this.exitremark = exitremark == null ? null : exitremark.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/document/Data.java b/src/com/sipai/entity/document/Data.java deleted file mode 100644 index 51796b57..00000000 --- a/src/com/sipai/entity/document/Data.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.sipai.entity.document; - - - -import com.sipai.entity.base.SQLAdapter; - -public class Data extends SQLAdapter{ - //资料分类为设备技术档案、设备管理制度 - public static final String Science_File ="0";//技术档案 - public static final String Manage_File ="1";//管理制度 - public static final String Contingency_Plan ="2";//应急预案 - - private String id; - - private String doctype; - - private String docname; - - private String number; - - private String insuser; - - private String insdt; - - private String updateuser; - - private String updatedt; - - private String memo; - - private String path; - - private String st; - - private Integer level; - - private String pid; - - private String details; - - private String pname; - - private String bizId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDoctype() { - return doctype; - } - - public void setDoctype(String doctype) { - this.doctype = doctype; - } - - public String getDocname() { - return docname; - } - - public void setDocname(String docname) { - this.docname = docname; - } - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpdateuser() { - return updateuser; - } - - public void setUpdateuser(String updateuser) { - this.updateuser = updateuser; - } - - public String getUpdatedt() { - return updatedt; - } - - public void setUpdatedt(String updatedt) { - this.updatedt = updatedt; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getSt() { - return st; - } - - public void setSt(String st) { - this.st = st; - } - - public Integer getLevel() { - return level; - } - - public void setLevel(Integer level) { - this.level = level; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDetails() { - return details; - } - - public void setDetails(String details) { - this.details = details; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/document/DocFileRelation.java b/src/com/sipai/entity/document/DocFileRelation.java deleted file mode 100644 index 8f1bfb9d..00000000 --- a/src/com/sipai/entity/document/DocFileRelation.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.entity.document; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.SQLAdapter; - -public class DocFileRelation extends SQLAdapter{ - - public static final String Type_libraryRoutineWork = "libraryRoutineWork";//周期常规库 - public static final String Type_libraryProcessAdjustment = "libraryProcessAdjustment";//工艺调整库 - public static final String Type_libraryWaterTest = "libraryWaterTest";//水质化验库 - - private String id; - - private String docId; - - private String masterid; - - private String type; - - private CommonFile commonFile; - - private String insuserName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDocId() { - return docId; - } - - public void setDocId(String docId) { - this.docId = docId; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getInsuserName() { - return insuserName; - } - - public void setInsuserName(String insuserName) { - this.insuserName = insuserName; - } - - public CommonFile getCommonFile() { - return commonFile; - } - - public void setCommonFile(CommonFile commonFile) { - this.commonFile = commonFile; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/document/Doctype.java b/src/com/sipai/entity/document/Doctype.java deleted file mode 100644 index 7e3e80be..00000000 --- a/src/com/sipai/entity/document/Doctype.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.entity.document; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Doctype extends SQLAdapter{ - private String id; - private String name; - private String pid; - private Integer level; - private String insuser; - private Date insdt; - private String updateuser; - private Date updatedt; - - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getPid() { - return pid; - } - public void setPid(String pid) { - this.pid = pid; - } - public Integer getLevel() { - return level; - } - public void setLevel(Integer level) { - this.level = level; - } - public String getInsuser() { - return insuser; - } - public void setInsuser(String insuser) { - this.insuser = insuser; - } - public Date getInsdt() { - return insdt; - } - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - public String getUpdateuser() { - return updateuser; - } - public void setUpdateuser(String updateuser) { - this.updateuser = updateuser; - } - public Date getUpdatedt() { - return updatedt; - } - public void setUpdatedt(Date updatedt) { - this.updatedt = updatedt; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/document/Document.java b/src/com/sipai/entity/document/Document.java deleted file mode 100644 index 6f71ba3b..00000000 --- a/src/com/sipai/entity/document/Document.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.document; - -import com.sipai.entity.user.User; - -import java.math.BigDecimal; - -public class Document { - private String id; - - private String wName; - - private String wContent; - - private String masterId; - - private String insertUserId; - - private String insertTime; - - private String where; - - private String devId; - - private String equipmentIds; - - private BigDecimal fileSize; - - private Integer fileSum; - - private User user; - - public BigDecimal getFileSize() { - return fileSize; - } - - public void setFileSize(BigDecimal fileSize) { - this.fileSize = fileSize; - } - - public Integer getFileSum() { - return fileSum; - } - - public void setFileSum(Integer fileSum) { - this.fileSum = fileSum; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getDevId() { - return devId; - } - - public void setDevId(String devId) { - this.devId = devId; - } - - public String getEquipmentIds() { - return equipmentIds; - } - - public void setEquipmentIds(String equipmentIds) { - this.equipmentIds = equipmentIds; - } - - public String getInsertTime() { - return insertTime; - } - - public void setInsertTime(String insertTime) { - this.insertTime = insertTime; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getwName() { - return wName; - } - - public void setwName(String wName) { - this.wName = wName == null ? null : wName.trim(); - } - - public String getwContent() { - return wContent; - } - - public void setwContent(String wContent) { - this.wContent = wContent == null ? null : wContent.trim(); - } - - public String getMasterId() { - return masterId; - } - - public void setMasterId(String masterId) { - this.masterId = masterId; - } - - public String getInsertUserId() { - return insertUserId; - } - - public void setInsertUserId(String insertUserId) { - this.insertUserId = insertUserId == null ? null : insertUserId.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/document/FileIn.java b/src/com/sipai/entity/document/FileIn.java deleted file mode 100644 index b2a1c8d3..00000000 --- a/src/com/sipai/entity/document/FileIn.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.entity.document; - - -import com.sipai.entity.base.SQLAdapter; - -import java.io.IOException; -import java.io.InputStream; - -public class FileIn { - private String name; - - private String originalFilename; - - private String contentType; - - private boolean isEmpty; - - private long size; - - private byte[] bytes; - - private InputStream inputStream; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getOriginalFilename() { - return originalFilename; - } - - public void setOriginalFilename(String originalFilename) { - this.originalFilename = originalFilename; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public boolean isEmpty() { - return isEmpty; - } - - public void setEmpty(boolean empty) { - isEmpty = empty; - } - - public long getSize() { - return size; - } - - public void setSize(long size) { - this.size = size; - } - - public byte[] getBytes() throws IOException { - return bytes; - } - - public void setBytes(byte[] bytes) throws IOException{ - this.bytes = bytes; - } - - public InputStream getInputStream() throws IOException{ - return inputStream; - } - - public void setInputStream(InputStream inputStream) throws IOException{ - this.inputStream = inputStream; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/ConstituteConfigure.java b/src/com/sipai/entity/efficiency/ConstituteConfigure.java deleted file mode 100644 index 9db81f80..00000000 --- a/src/com/sipai/entity/efficiency/ConstituteConfigure.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; - -public class ConstituteConfigure extends SQLAdapter{ - - private String id; - - private String pid; - - private String name; - - private String remark; - - private Integer morder; - - private String unitid; - - private String schemeId; - - private String unit; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getSchemeId() { - return schemeId; - } - - public void setSchemeId(String schemeId) { - this.schemeId = schemeId == null ? null : schemeId.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/ConstituteConfigureDetail.java b/src/com/sipai/entity/efficiency/ConstituteConfigureDetail.java deleted file mode 100644 index a422e99a..00000000 --- a/src/com/sipai/entity/efficiency/ConstituteConfigureDetail.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; - -public class ConstituteConfigureDetail extends SQLAdapter{ - //类型 - public static final String Type_Day = "_day";//日数据 - public static final String Type_Month = "_month";//月数据 - public static final String Type_Hour = "_hour";//小时数据 - public static final String Type_Empty = "";//空 - - private String id; - - private String pid; - - private String mpid; - - private String mpname; - - private Integer morder; - - private String dsmpid;//吨水电耗mpid - - private String xlmpid;//效率mpid - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getDsmpid() { - return dsmpid; - } - - public void setDsmpid(String dsmpid) { - this.dsmpid = dsmpid; - } - - public String getXlmpid() { - return xlmpid; - } - - public void setXlmpid(String xlmpid) { - this.xlmpid = xlmpid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/ConstituteConfigureScheme.java b/src/com/sipai/entity/efficiency/ConstituteConfigureScheme.java deleted file mode 100644 index ed8d4f07..00000000 --- a/src/com/sipai/entity/efficiency/ConstituteConfigureScheme.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; - -public class ConstituteConfigureScheme extends SQLAdapter { - private String id; - - private String name; - - private Integer morder; - - private String unitid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/EfficiencyNumber.java b/src/com/sipai/entity/efficiency/EfficiencyNumber.java deleted file mode 100644 index a1559108..00000000 --- a/src/com/sipai/entity/efficiency/EfficiencyNumber.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.entity.efficiency; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class EfficiencyNumber { - - private BigDecimal max; - - private BigDecimal min; - - private BigDecimal sum; - -} diff --git a/src/com/sipai/entity/efficiency/EfficiencyOverviewConfigure.java b/src/com/sipai/entity/efficiency/EfficiencyOverviewConfigure.java deleted file mode 100644 index 7508256b..00000000 --- a/src/com/sipai/entity/efficiency/EfficiencyOverviewConfigure.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class EfficiencyOverviewConfigure extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String unitid; - - private String name; - - private String picurl; - - private Integer morder; - - private String type; - - private Integer upperlimit; - - private Integer lowerlimit; - - private Integer grade; - - private String colorgroup; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPicurl() { - return picurl; - } - - public void setPicurl(String picurl) { - this.picurl = picurl; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getUpperlimit() { - return upperlimit; - } - - public void setUpperlimit(Integer upperlimit) { - this.upperlimit = upperlimit; - } - - public Integer getLowerlimit() { - return lowerlimit; - } - - public void setLowerlimit(Integer lowerlimit) { - this.lowerlimit = lowerlimit; - } - - public Integer getGrade() { - return grade; - } - - public void setGrade(Integer grade) { - this.grade = grade; - } - - public String getColorgroup() { - return colorgroup; - } - - public void setColorgroup(String colorgroup) { - this.colorgroup = colorgroup; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/EfficiencyOverviewConfigureAssembly.java b/src/com/sipai/entity/efficiency/EfficiencyOverviewConfigureAssembly.java deleted file mode 100644 index bc9517dd..00000000 --- a/src/com/sipai/entity/efficiency/EfficiencyOverviewConfigureAssembly.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; - -public class EfficiencyOverviewConfigureAssembly extends SQLAdapter{ - - private String id; - private String insuser; - private String insdt; - private String unitid; - private String name; - private Integer morder; - private String type; - private String active; - private String pid; - private Double width; - private Double height; - private Double txtsize; - private String textcolor; - private String bkcolor; - private Double x; - private Double y; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Double getWidth() { - return width; - } - - public void setWidth(Double width) { - this.width = width; - } - - public Double getHeight() { - return height; - } - - public void setHeight(Double height) { - this.height = height; - } - - public Double getTxtsize() { - return txtsize; - } - - public void setTxtsize(Double txtsize) { - this.txtsize = txtsize; - } - - public String getTextcolor() { - return textcolor; - } - - public void setTextcolor(String textcolor) { - this.textcolor = textcolor; - } - - public String getBkcolor() { - return bkcolor; - } - - public void setBkcolor(String bkcolor) { - this.bkcolor = bkcolor; - } - - public Double getX() { - return x; - } - - public void setX(Double x) { - this.x = x; - } - - public Double getY() { - return y; - } - - public void setY(Double y) { - this.y = y; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/EfficiencyOverviewMpConfigure.java b/src/com/sipai/entity/efficiency/EfficiencyOverviewMpConfigure.java deleted file mode 100644 index 3e3175e2..00000000 --- a/src/com/sipai/entity/efficiency/EfficiencyOverviewMpConfigure.java +++ /dev/null @@ -1,229 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class EfficiencyOverviewMpConfigure extends SQLAdapter{ - - private String assembly; - - private Integer upperlimit; - - private Integer lowerlimit; - - private Integer grade; - - private String colorgroup; - - private EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly; - - public EfficiencyOverviewConfigureAssembly getEfficiencyOverviewConfigureAssembly() { - return efficiencyOverviewConfigureAssembly; - } - - public void setEfficiencyOverviewConfigureAssembly( - EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly) { - this.efficiencyOverviewConfigureAssembly = efficiencyOverviewConfigureAssembly; - } - - public String getAssembly() { - return assembly; - } - - public void setAssembly(String assembly) { - this.assembly = assembly; - } - - public Integer getUpperlimit() { - return upperlimit; - } - - public void setUpperlimit(Integer upperlimit) { - this.upperlimit = upperlimit; - } - - public Integer getLowerlimit() { - return lowerlimit; - } - - public void setLowerlimit(Integer lowerlimit) { - this.lowerlimit = lowerlimit; - } - - public Integer getGrade() { - return grade; - } - - public void setGrade(Integer grade) { - this.grade = grade; - } - - public String getColorgroup() { - return colorgroup; - } - - public void setColorgroup(String colorgroup) { - this.colorgroup = colorgroup; - } - - private String id; - - private String mpid; - - private String mpname; - - private Double x; - - private Double y; - - private Integer txtsize; - - private String textcolor; - - private Double width; - - private Double height; - - private String bkcolor; - - private String picid; - - private Integer morder; - - private String showParmValue; - - private String showUnit; - - private MPoint mPoint; - - //经纬度坐标组 - private String lnglats; - - public String getLnglats() { - return lnglats; - } - - public void setLnglats(String lnglats) { - this.lnglats = lnglats; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public Double getX() { - return x; - } - - public void setX(Double x) { - this.x = x; - } - - public Double getY() { - return y; - } - - public void setY(Double y) { - this.y = y; - } - - public Integer getTxtsize() { - return txtsize; - } - - public void setTxtsize(Integer txtsize) { - this.txtsize = txtsize; - } - - public String getTextcolor() { - return textcolor; - } - - public void setTextcolor(String textcolor) { - this.textcolor = textcolor; - } - - public Double getWidth() { - return width; - } - - public void setWidth(Double width) { - this.width = width; - } - - public Double getHeight() { - return height; - } - - public void setHeight(Double height) { - this.height = height; - } - - public String getBkcolor() { - return bkcolor; - } - - public void setBkcolor(String bkcolor) { - this.bkcolor = bkcolor; - } - - public String getPicid() { - return picid; - } - - public void setPicid(String picid) { - this.picid = picid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getShowParmValue() { - return showParmValue; - } - - public void setShowParmValue(String showParmValue) { - this.showParmValue = showParmValue; - } - - public String getShowUnit() { - return showUnit; - } - - public void setShowUnit(String showUnit) { - this.showUnit = showUnit; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/EfficiencyStatistics.java b/src/com/sipai/entity/efficiency/EfficiencyStatistics.java deleted file mode 100644 index 9053fe6c..00000000 --- a/src/com/sipai/entity/efficiency/EfficiencyStatistics.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.entity.efficiency; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class EfficiencyStatistics extends SQLAdapter { - private String id; - - private String name; - - private String pid; - - private String unitId; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private Integer morder; - - private String mpointId; - - private MPoint mPoint; - private BigDecimal sum; - private List childList; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public BigDecimal getSum() { - return sum; - } - - public void setSum(BigDecimal sum) { - this.sum = sum; - } - - public List getChildList() { - return childList; - } - - public void setChildList(List childList) { - this.childList = childList; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/efficiency/WaterSpreadDataConfigure.java b/src/com/sipai/entity/efficiency/WaterSpreadDataConfigure.java deleted file mode 100644 index a54acbd9..00000000 --- a/src/com/sipai/entity/efficiency/WaterSpreadDataConfigure.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.entity.efficiency; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class WaterSpreadDataConfigure extends SQLAdapter{ - private String id; - - private String mpid; - - private String mpname; - - private String unitId; - - private Integer morder; - - private String showParmValue; - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getShowParmValue() { - return showParmValue; - } - - public void setShowParmValue(String showParmValue) { - this.showParmValue = showParmValue; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/enums/AbnormityStatusEnum.java b/src/com/sipai/entity/enums/AbnormityStatusEnum.java deleted file mode 100644 index 64d5a53e..00000000 --- a/src/com/sipai/entity/enums/AbnormityStatusEnum.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum AbnormityStatusEnum { - STATUS_START("start","处理中"), - STATUS_FINISH("finish","已完成"), - STATUS_CLEAR("clear","已销单"); - - private String id; - private String name; - - AbnormityStatusEnum(String id, String name){ - this.id=id; - this.name=name; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (AbnormityStatusEnum item : AbnormityStatusEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(String id) { - for (AbnormityStatusEnum item : AbnormityStatusEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static String getIdByName(String name) { - AbnormityStatusEnum[] enableTypeEnums = values(); - for (AbnormityStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/AbnormityTypeEnum.java b/src/com/sipai/entity/enums/AbnormityTypeEnum.java deleted file mode 100644 index 0a99e194..00000000 --- a/src/com/sipai/entity/enums/AbnormityTypeEnum.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum AbnormityTypeEnum { - TYPE_RUN("run","运行异常"), - TYPE_EQUIPMENT("equipment","设备异常"), - TYPE_FACILITIES("facilities","设施异常"); - - private String id; - private String name; - - AbnormityTypeEnum(String id, String name){ - this.id=id; - this.name=name; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (AbnormityTypeEnum item : AbnormityTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(String id) { - for (AbnormityTypeEnum item : AbnormityTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static String getIdByName(String name) { - AbnormityTypeEnum[] enableTypeEnums = values(); - for (AbnormityTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/AchievementTypeEnum.java b/src/com/sipai/entity/enums/AchievementTypeEnum.java deleted file mode 100644 index 200a435d..00000000 --- a/src/com/sipai/entity/enums/AchievementTypeEnum.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum AchievementTypeEnum { - TYPE_REPAIR("0","repair"), - TYPE_MAINTAIN("1","maintain"), - TYPE_P("2","P"), - TYPE_E("3","E"); - - private String id; - private String name; - - AchievementTypeEnum(String id, String name){ - this.id=id; - this.name=name; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (AchievementTypeEnum item : AchievementTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(String id) { - for (AchievementTypeEnum item : AchievementTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static String getIdByName(String name) { - AchievementTypeEnum[] enableTypeEnums = values(); - for (AchievementTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/CameraCtrlEnum.java b/src/com/sipai/entity/enums/CameraCtrlEnum.java deleted file mode 100644 index 7259eab5..00000000 --- a/src/com/sipai/entity/enums/CameraCtrlEnum.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum CameraCtrlEnum { - TILT_UP(21,"UP( 上仰 )"), - TILT_DOWN(22,"DOWN( 下俯 )"), - PAN_LEFT(23,"LEFT( 左转 )"), - PAN_RIGHT(24,"RIGHT( 右转 )"), - UP_LEFT(25,"UP_LEFT( 上仰和左转 )"), - UP_RIGHT(26,"UP_RIGHT( 上仰和右转 )"), - DOWN_LEFT(27,"DOWN_LEFT( 下俯和左转 )"), - DOWN_RIGHT( 28,"DOWN_RIGHT( 下俯和右转 )"); - - private int id; - private String name; - - CameraCtrlEnum(int id, String name){ - this.id=id; - this.name=name; - } - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (CameraCtrlEnum item : CameraCtrlEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (CameraCtrlEnum item : CameraCtrlEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - CameraCtrlEnum[] enableTypeEnums = values(); - for (CameraCtrlEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/DateType.java b/src/com/sipai/entity/enums/DateType.java deleted file mode 100644 index 8ca0ca89..00000000 --- a/src/com/sipai/entity/enums/DateType.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 填报时间类型: - */ -public enum DateType { - Irregular("I","不定时"), Hour("H","小时"), Day( "D","日"), - Month( "M","月"), Year( "Y","年") ; - private String id; - private String name; - - private DateType(String id,String name){ - this.id=id; - this.name=name; - } - - public static String getNameById(String id) { - for (DateType item :DateType.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllDateType4JSON() { - String json = ""; - for (DateType item :DateType.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -// /** -// * 获取测量点巡检类型筛选,例:传P过来获取 !E 的测量点 -// * @param type -// * @return -// */ -// public static String getElsePatrolType4Wherestr(String type) { -// String wherestr = ""; -// for (PatrolType item :PatrolType.values()) { -// if(item.getId().equals(type)){ -// wherestr += "patrol_type = '"+item.getId()+"'"; -// } -// } -// wherestr = " and (" + wherestr+ " or patrol_type is null)"; -// return wherestr; -// } - -} diff --git a/src/com/sipai/entity/enums/DayValueEnum.java b/src/com/sipai/entity/enums/DayValueEnum.java deleted file mode 100644 index 243d04ca..00000000 --- a/src/com/sipai/entity/enums/DayValueEnum.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum DayValueEnum { - MONTH_VALUE("0","同值"), - AVG_VALUE("1","均值"); - - private String id; - private String name; - - DayValueEnum(String id, String name){ - this.id=id; - this.name=name; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (DayValueEnum item : DayValueEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(String id) { - for (DayValueEnum item : DayValueEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static String getIdByName(String name) { - DayValueEnum[] enableTypeEnums = values(); - for (DayValueEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/DimensionTypeEnum.java b/src/com/sipai/entity/enums/DimensionTypeEnum.java deleted file mode 100644 index 8f5041ad..00000000 --- a/src/com/sipai/entity/enums/DimensionTypeEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 维度类型 - * @author lichen - */ -public enum DimensionTypeEnum { - Normal(0,"普通"), - Neibu( 1,"内部"), - Avg(2,"年度内绩效考核平均成绩"); - - private int id; - private String name; - - DimensionTypeEnum(int id, String name){ - this.id=id; - this.name=name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (DimensionTypeEnum item : DimensionTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (DimensionTypeEnum item : DimensionTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/EnableTypeEnum.java b/src/com/sipai/entity/enums/EnableTypeEnum.java deleted file mode 100644 index 1ee1b582..00000000 --- a/src/com/sipai/entity/enums/EnableTypeEnum.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.entity.enums; - -import com.sipai.tools.ValueTypeEnum; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum EnableTypeEnum { - Enable(1,"启用"), - Disable( 0,"禁用"); - - private int id; - private String name; - - EnableTypeEnum(int id, String name){ - this.id=id; - this.name=name; - } - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (EnableTypeEnum item : EnableTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (EnableTypeEnum item : EnableTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - EnableTypeEnum[] enableTypeEnums = values(); - for (EnableTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/EnumJsonObject.java b/src/com/sipai/entity/enums/EnumJsonObject.java deleted file mode 100644 index 23eb13b9..00000000 --- a/src/com/sipai/entity/enums/EnumJsonObject.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.entity.enums; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class EnumJsonObject { - private String id; - private String text; - /** - * - * - * @author zxq - * @date 2023/2/2 - * 因 检测任务管理 仪器设备栏位改为可选, 新增 仪器编码和仪器名称两个字段 - * - */ - private String code; - private String name; -} diff --git a/src/com/sipai/entity/enums/FileNameSpaceEnum.java b/src/com/sipai/entity/enums/FileNameSpaceEnum.java deleted file mode 100644 index 886e9332..00000000 --- a/src/com/sipai/entity/enums/FileNameSpaceEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.entity.enums; - -public enum FileNameSpaceEnum { - //namespace必须小写 - RptInfoSetFile("rptinfosetfile","TB_Report_RptInfoSetFile"), -// RptCreateFile("rptcreatefile",""), - RptCreateFile("report",""), - ReamrkFile("reamrkfile","tb_doc_file"), - RptModifyFile("rptmodifyfile","TB_Report_ModifyFile"), - BudgetFile("budgetfile","TB_Budget_File"); - - public String getNameSpace() { - return nameSpace; - } - - public void setNameSpace(String nameSpace) { - this.nameSpace = nameSpace; - } - - public String getTbName() { - return tbName; - } - - public void setTbName(String tbName) { - this.tbName = tbName; - } - - private String nameSpace; - private String tbName; - - private FileNameSpaceEnum(String nameSpace,String tbName){ - this.nameSpace=nameSpace; - this.tbName=tbName; - } - - public static String getTbName(String nameSpace) { - //nameSpace作为 minio的bucket名称,必须为小心, - nameSpace=nameSpace.toLowerCase(); - for (FileNameSpaceEnum item :FileNameSpaceEnum.values()) { - if (item.getNameSpace().equals(nameSpace)) { - return item.getTbName(); - } - } - return null; - } -} diff --git a/src/com/sipai/entity/enums/ForecastEnum.java b/src/com/sipai/entity/enums/ForecastEnum.java deleted file mode 100644 index 4a69e779..00000000 --- a/src/com/sipai/entity/enums/ForecastEnum.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 维度类型 - * @author lichen - */ -public enum ForecastEnum { - // 宝山区未来30日降雨量预报mm - TH_RAINFALL_FORECAST_30_DAYS(0,"TH_RAINFALL_FORECAST_30_DAYS", "TH_RAINFALL_FORECAST_30_DAYS_SAVE"), - // 宝山区未来30日最高气温预报℃ - TH_MAX_TEMP_FORECAST_30_DAYS(1,"TH_MAX_TEMP_FORECAST_30_DAYS", "TH_MAX_TEMP_FORECAST_30_DAYS_SAVE"), - // 宝山区未来30日最低气温预报℃ - TH_MIN_TEMP_FORECAST_30_DAYS( 2,"TH_MIN_TEMP_FORECAST_30_DAYS", "TH_MIN_TEMP_FORECAST_30_DAYS_SAVE"), - // 潮汐 - TH_TIDE_FORECAST_30_DAYS( 3,"TH_TIDE_FORECAST_30_DAYS", "TH_TIDE_FORECAST_30_DAYS_SAVE"); - - private int id; - private String tbName; - private String tbHisName; - - ForecastEnum(int id, String tbName, String tbHisName){ - this.id=id; - this.tbName=tbName; - this.tbHisName=tbHisName; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getTbName() { - return tbName; - } - - public void setTbName(String tbName) { - this.tbName = tbName; - } - - public String getTbHisName() { - return tbHisName; - } - - public void setTbHisName(String tbHisName) { - this.tbHisName = tbHisName; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (ForecastEnum item : ForecastEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"tbName\":\""+item.getTbName()+"\",\"tbHisName\":\""+item.getTbHisName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"tbName\":\""+item.getTbName()+"\",\"tbHisName\":\""+item.getTbHisName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (ForecastEnum item : ForecastEnum.values()) { - if (item.getId() == id) { - return item.getTbName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/KpiApplyStatusEnum.java b/src/com/sipai/entity/enums/KpiApplyStatusEnum.java deleted file mode 100644 index 6bdb9eac..00000000 --- a/src/com/sipai/entity/enums/KpiApplyStatusEnum.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 绩效考核状态 - * - * @author lichen - */ -public enum KpiApplyStatusEnum { - PlanMaking(0, "制定中"), - PlanReject(7, "考核内容被驳回"), - PlanAuditing(1, "审核中"), - PlanAudited(2, "审核通过待下发"), - PlanAccessed(3, "已下发"), - PlanMarking(4, "评分中"), - PlanMarked(5, "评分完成"), - PlanConfirmed(6, "评分已确认" ), - PlanMarkReject(8, "评分被驳回"); - - private int id; - private String name; - - KpiApplyStatusEnum(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (KpiApplyStatusEnum item : KpiApplyStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (KpiApplyStatusEnum item : KpiApplyStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/KpiConstant.java b/src/com/sipai/entity/enums/KpiConstant.java deleted file mode 100644 index 65ec93a7..00000000 --- a/src/com/sipai/entity/enums/KpiConstant.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.entity.enums; - -import java.math.BigDecimal; - -/** - * 绩效考核所使用的常量 - * - * @Author: lichen - * @Date: 2021/10/20 - **/ -public class KpiConstant { - // 特殊处理维度标识"内部客户" - public final static String SPECIAL_DIMENSION ="内部客户"; - - // 绩效考核消息类型 - public final static String MSG_TYPE_KPI = "KPI"; - - //完成结果、过程表现的权重 - public final static int[] RESULT_PROCESS_WEIGHT = {80, 20}; - - // 两级评价人时的权重 - public final static int[] MARK_LEVEL_2_WEIGHT = {70, 30}; - - // 三级评价人时的权重 - public final static int[] MARK_LEVEL_3_WEIGHT = {70, 20, 10}; - - // 评级分割线 优秀|称职A级|称职B级|称职C级|基本称职|不称职 - public final static BigDecimal LEVEL_EXCELLENT_A =new BigDecimal("90"); - public final static BigDecimal LEVEL_A_B = new BigDecimal("85.00"); - public final static BigDecimal LEVEL_B_C = new BigDecimal("80.00"); - public final static BigDecimal LEVEL_C_BASICALLY_COMPETENT = new BigDecimal("75.00"); - public final static BigDecimal LEVEL_BASICALLY_COMPETENT_NOT_COMPETENT = new BigDecimal("60.00"); - -} diff --git a/src/com/sipai/entity/enums/MPointPropValueTypeEnum.java b/src/com/sipai/entity/enums/MPointPropValueTypeEnum.java deleted file mode 100644 index 5dbde4e4..00000000 --- a/src/com/sipai/entity/enums/MPointPropValueTypeEnum.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.enums; - -/** - * KPI计算时取值类型 - * - */ -public enum MPointPropValueTypeEnum { - max("max","最大"), - min("min","最小"), - avg("avg","平均"), - sum("sum","累加"), - sum_day("sum_day","日累计"), - sum_month("sum_month","月累计"), - sum_year("sum_year","年累计"), - vector("vector","向量"), - first("first","首值"), - last("last","末值"), - median("median","中位数"); - - private String id; - private String name; - - private MPointPropValueTypeEnum(String id, String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (MPointPropValueTypeEnum item :MPointPropValueTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - /** - * 通过value取枚举 - * @param value - * @return - */ - public static MPointPropValueTypeEnum getTypeByValue(String value){ - - for (MPointPropValueTypeEnum enums : MPointPropValueTypeEnum.values()) { - if (enums.getId().equals(value)) { - return enums; - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (MPointPropValueTypeEnum item :MPointPropValueTypeEnum.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/enums/MeterLibraryTypeEnum.java b/src/com/sipai/entity/enums/MeterLibraryTypeEnum.java deleted file mode 100644 index d1c66fed..00000000 --- a/src/com/sipai/entity/enums/MeterLibraryTypeEnum.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 巡检情况树状显示 - * - */ -public enum MeterLibraryTypeEnum { - TYPE_VALUE(0,"value"), - TYPE_PERCENT(1,"percent"); - - private Integer id; - private String name; - - private MeterLibraryTypeEnum(Integer id, String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (MeterLibraryTypeEnum item : MeterLibraryTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - /** - * 通过value取枚举 - * @param value - * @return - */ - public static MeterLibraryTypeEnum getTypeByValue(String value){ - - for (MeterLibraryTypeEnum enums : MeterLibraryTypeEnum.values()) { - if (enums.getId().equals(value)) { - return enums; - } - } - return null; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (MeterLibraryTypeEnum item : MeterLibraryTypeEnum.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/enums/MeterTypeEnum.java b/src/com/sipai/entity/enums/MeterTypeEnum.java deleted file mode 100644 index 8b7d276e..00000000 --- a/src/com/sipai/entity/enums/MeterTypeEnum.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 巡检情况树状显示 - * - */ -public enum MeterTypeEnum { - TYPE_PT(0,"普通树状"), - TYPE_BG(1,"表格树状"); - - private Integer id; - private String name; - - private MeterTypeEnum(Integer id, String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (MeterTypeEnum item :MeterTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - /** - * 通过value取枚举 - * @param value - * @return - */ - public static MeterTypeEnum getTypeByValue(String value){ - - for (MeterTypeEnum enums : MeterTypeEnum.values()) { - if (enums.getId().equals(value)) { - return enums; - } - } - return null; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (MeterTypeEnum item :MeterTypeEnum.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/enums/ModbusDataTypeEnum.java b/src/com/sipai/entity/enums/ModbusDataTypeEnum.java deleted file mode 100644 index 08224d5e..00000000 --- a/src/com/sipai/entity/enums/ModbusDataTypeEnum.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.enums; - -public enum ModbusDataTypeEnum { - - // com.serotonin.modbus4j.locator.NumericLocator 类中方法 如果出现1 会报错 -// BINARY(1,"BINARY ( 1 )"), - TWO_BYTE_INT_UNSIGNED(2,"TWO_BYTE_INT_UNSIGNED ( 2 )"), - TWO_BYTE_INT_SIGNED(3,"TWO_BYTE_INT_SIGNED ( 3 )"), - TWO_BYTE_INT_UNSIGNED_SWAPPED(22,"TWO_BYTE_INT_UNSIGNED_SWAPPED ( 22 )"), - TWO_BYTE_INT_SIGNED_SWAPPED(23,"TWO_BYTE_INT_SIGNED_SWAPPED ( 23 )"), - FOUR_BYTE_INT_UNSIGNED(4,"FOUR_BYTE_INT_UNSIGNED ( 4 )"), - FOUR_BYTE_INT_SIGNED(5,"FOUR_BYTE_INT_SIGNED ( 5 )"), - FOUR_BYTE_INT_UNSIGNED_SWAPPED(6,"FOUR_BYTE_INT_UNSIGNED_SWAPPED ( 6 )"), - FOUR_BYTE_INT_SIGNED_SWAPPED(7,"FOUR_BYTE_INT_SIGNED_SWAPPED ( 7 )"), - FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED(24,"FOUR_BYTE_INT_UNSIGNED_SWAPPED_SWAPPED ( 24 )"), - FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED(25,"FOUR_BYTE_INT_SIGNED_SWAPPED_SWAPPED ( 25 )"), - FOUR_BYTE_FLOAT(8,"FOUR_BYTE_FLOAT ( 8 )"), - FOUR_BYTE_FLOAT_SWAPPED(9,"FOUR_BYTE_FLOAT_SWAPPED ( 9 )"), - FOUR_BYTE_FLOAT_SWAPPED_INVERTED(21,"FOUR_BYTE_FLOAT_SWAPPED_INVERTED ( 21 )"), - EIGHT_BYTE_INT_UNSIGNED(10,"EIGHT_BYTE_INT_UNSIGNED ( 10 )"), - EIGHT_BYTE_INT_SIGNED(11,"EIGHT_BYTE_INT_SIGNED ( 11 )"), - EIGHT_BYTE_INT_UNSIGNED_SWAPPED(12,"EIGHT_BYTE_INT_UNSIGNED_SWAPPED ( 12 )"), - EIGHT_BYTE_INT_SIGNED_SWAPPED(13,"EIGHT_BYTE_INT_SIGNED_SWAPPED ( 13 )"), - EIGHT_BYTE_FLOAT(14,"EIGHT_BYTE_FLOAT ( 14 )"), - EIGHT_BYTE_FLOAT_SWAPPED(15,"EIGHT_BYTE_FLOAT_SWAPPED ( 15 )"), - TWO_BYTE_BCD(16,"TWO_BYTE_BCD ( 16 )"), - FOUR_BYTE_BCD(17,"FOUR_BYTE_BCD ( 17 )"), - FOUR_BYTE_BCD_SWAPPED(20,"FOUR_BYTE_BCD_SWAPPED ( 20 )"), - CHAR(18,"CHAR ( 18 )"), - VARCHAR(19,"VARCHAR ( 19 )"); - - private Integer id; - private String name; - - ModbusDataTypeEnum(Integer id, String name){ - this.id=id; - this.name=name; - } - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (ModbusDataTypeEnum item : ModbusDataTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(Integer id) { - for (ModbusDataTypeEnum item : ModbusDataTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static Integer getIdByName(String name) { - ModbusDataTypeEnum[] enableTypeEnums = values(); - for (ModbusDataTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/ModbusRegisterTypeEnum.java b/src/com/sipai/entity/enums/ModbusRegisterTypeEnum.java deleted file mode 100644 index 6eba383d..00000000 --- a/src/com/sipai/entity/enums/ModbusRegisterTypeEnum.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.enums; - -public enum ModbusRegisterTypeEnum { - - COIL_STATUS(0,"线圈状态 ( Coil Status 可读可写 )"), - INPUT_STATUS(1,"离散输入状态 ( Input Status 只读 )"), - HOLDING_REGISTER(4,"保持寄存器 ( Holding Register 可读可写 )"), - INPUT_REGISTER(3,"输入寄存器 ( Input Register 只读 )"),; - - private Integer id; - private String name; - - ModbusRegisterTypeEnum(Integer id, String name){ - this.id=id; - this.name=name; - } - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (ModbusRegisterTypeEnum item : ModbusRegisterTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(Integer id) { - for (ModbusRegisterTypeEnum item : ModbusRegisterTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static Integer getIdByName(String name) { - ModbusRegisterTypeEnum[] enableTypeEnums = values(); - for (ModbusRegisterTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/ModbusTypeEnum.java b/src/com/sipai/entity/enums/ModbusTypeEnum.java deleted file mode 100644 index 54151655..00000000 --- a/src/com/sipai/entity/enums/ModbusTypeEnum.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.enums; - -public enum ModbusTypeEnum { - - MODBUS_POINT_I(0,"I ( 整数类型 )", "I"), - MODBUS_POINT_L(1,"L ( 浮点类型 )", "L"), - MODBUS_POINT_F(2,"F ( 浮点类型 )", "F"), - MODBUS_POINT_LF(3,"LF ( 浮点类型 )", "LF"); - - private Integer id; - private String name; - private String value; - - ModbusTypeEnum(Integer id, String name, String value){ - this.id=id; - this.name=name; - this.value=value; - } - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (ModbusTypeEnum item : ModbusTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(Integer id) { - for (ModbusTypeEnum item : ModbusTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - public static String getValueByid(Integer id) { - for (ModbusTypeEnum item : ModbusTypeEnum.values()) { - if (item.getId().equals(id)) { - return item.getValue(); - } - } - return null; - } - - - public static Integer getIdByName(String name) { - ModbusTypeEnum[] enableTypeEnums = values(); - for (ModbusTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/PatrolType.java b/src/com/sipai/entity/enums/PatrolType.java deleted file mode 100644 index b02027dd..00000000 --- a/src/com/sipai/entity/enums/PatrolType.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 巡检区域: - */ -public enum PatrolType { - Product("P","运行巡检"), Equipment( "E","设备巡检"), Camera("C","视频巡检"), Safe("S","安全任务"); - private String id; - private String name; - - private PatrolType(String id,String name){ - this.id=id; - this.name=name; - } - -// public static String getName(String id) { -// for (PatrolType item :PatrolType.values()) { -// if (item.getId().equals(id)) { -// return item.getName(); -// } -// } -// return null; -// } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllPatrolType4JSON() { - String json = ""; - for (PatrolType item :PatrolType.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getAllPatrolType4AndNullJSON() { - String json = ""; - json += "{\"id\":\"-\",\"text\":\"无\"}"; - for (PatrolType item :PatrolType.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -// /** -// * 获取测量点巡检类型筛选,例:传P过来获取 !E 的测量点 -// * @param type -// * @return -// */ -// public static String getElsePatrolType4Wherestr(String type) { -// String wherestr = ""; -// for (PatrolType item :PatrolType.values()) { -// if(item.getId().equals(type)){ -// wherestr += "patrol_type = '"+item.getId()+"'"; -// } -// } -// wherestr = " and (" + wherestr+ " or patrol_type is null)"; -// return wherestr; -// } - -} diff --git a/src/com/sipai/entity/enums/PeriodNoHalfEnum.java b/src/com/sipai/entity/enums/PeriodNoHalfEnum.java deleted file mode 100644 index cb52f78a..00000000 --- a/src/com/sipai/entity/enums/PeriodNoHalfEnum.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 周期类型 - * @author lichen - */ -public enum PeriodNoHalfEnum { - one(1,"上半年"), - two ( 2,"下半年"); - private int id; - private String name; - - PeriodNoHalfEnum(int id, String name){ - this.id=id; - this.name=name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (PeriodNoHalfEnum item : PeriodNoHalfEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (PeriodNoHalfEnum item : PeriodNoHalfEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/PeriodNoQuarterEnum.java b/src/com/sipai/entity/enums/PeriodNoQuarterEnum.java deleted file mode 100644 index 86aef013..00000000 --- a/src/com/sipai/entity/enums/PeriodNoQuarterEnum.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 周期类型 - * - * @author lichen - */ -public enum PeriodNoQuarterEnum { - one(1, "第一季度"), - two(2, "第二季度"), - three(3, "第三季度"), - four(4, "第四季度"); - private int id; - private String name; - - PeriodNoQuarterEnum(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (PeriodNoQuarterEnum item : PeriodNoQuarterEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (PeriodNoQuarterEnum item : PeriodNoQuarterEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/PeriodNoYearEnum.java b/src/com/sipai/entity/enums/PeriodNoYearEnum.java deleted file mode 100644 index fe63db6b..00000000 --- a/src/com/sipai/entity/enums/PeriodNoYearEnum.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 周期类型 - * @author lichen - */ -public enum PeriodNoYearEnum { - year(1,"全年"); - private int id; - private String name; - - PeriodNoYearEnum(int id, String name){ - this.id=id; - this.name=name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (PeriodNoYearEnum item : PeriodNoYearEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (PeriodNoYearEnum item : PeriodNoYearEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/PeriodTypeEnum.java b/src/com/sipai/entity/enums/PeriodTypeEnum.java deleted file mode 100644 index bb595ce1..00000000 --- a/src/com/sipai/entity/enums/PeriodTypeEnum.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 周期类型 - * - * @author lichen - */ -public enum PeriodTypeEnum { - Quarter(0, "季度"), - Half(1, "半年"), - Year(2, "年度"); - private int id; - private String name; - - PeriodTypeEnum(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (PeriodTypeEnum item : PeriodTypeEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (PeriodTypeEnum item : PeriodTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - public static Integer getIdByName(String name) { - for (PeriodTypeEnum item : PeriodTypeEnum.values()) { - if (item.getName().equals(name)) { - return item.getId(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/PositionTypeEnum.java b/src/com/sipai/entity/enums/PositionTypeEnum.java deleted file mode 100644 index 551c5b21..00000000 --- a/src/com/sipai/entity/enums/PositionTypeEnum.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 岗位类型 - * - * @author lichen - */ -public enum PositionTypeEnum { - - GrassRoots(0, "基层"), - Sponsor(1, "主办"), - MiddleManager(2, "中层"), -// Other(9, "其它") - ; - private int id; - private String name; - - PositionTypeEnum(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (PositionTypeEnum item : PositionTypeEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (PositionTypeEnum item : PositionTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/ProcessSectionCodeEnum.java b/src/com/sipai/entity/enums/ProcessSectionCodeEnum.java deleted file mode 100644 index d1f962ee..00000000 --- a/src/com/sipai/entity/enums/ProcessSectionCodeEnum.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.enums; - -import com.sipai.tools.ValueTypeEnum; - -public enum ProcessSectionCodeEnum { - ONE("01", "一级泵房"), - TWO("02", "投矾间"), - THREE("03", "二氧化氯车间"), - FOUR("04", "次氯酸钠投加间"), - FIVE("05", "反应池"), - SIX("06", "沉淀池"), - SEVEN("07", "滤池"), - EGIHT("08", "反冲洗房"), - NINE("09", "二级泵房"), - TEN("10", "排水泵房"), - ELEVEN("11", "中试基地"), - TWELVE("12", "机房"), - THIRTEEN("13", "厂区道路"), - FOURTEEN("98", "智能供配电"), - FIFTEEN("99", "其它区段" ); - - private String id; - private String type; - - ProcessSectionCodeEnum(String id, String type) { - this.id = id; - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public static String getValue(String id) { - ProcessSectionCodeEnum[] processSectionCodeEnums = values(); - for (ProcessSectionCodeEnum value : processSectionCodeEnums) { - if (value.getId().equals(id)) { - return value.getType(); - } - } - return null; - } -} diff --git a/src/com/sipai/entity/enums/SourceTypeEnum.java b/src/com/sipai/entity/enums/SourceTypeEnum.java deleted file mode 100644 index 014c431e..00000000 --- a/src/com/sipai/entity/enums/SourceTypeEnum.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.sipai.entity.enums; - -public enum SourceTypeEnum { - - FLAG_TYPE_KPI("KPI", "KPI计算点"), - FLAG_TYPE_HAND("hand", "手动录入点"), -// FLAG_TYPE_DATA("data", "自控采集点"); - FLAG_TYPE_DATA("auto", "自控采集点"); - - private String id; - private String name; - - SourceTypeEnum(String id, String name) { - this.id = id; - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getNameById(String id) { - SourceTypeEnum[] sourceTypeEnums = values(); - for (SourceTypeEnum sourceTypeEnum : sourceTypeEnums) { - if (sourceTypeEnum.getId().equals(id)) { - return sourceTypeEnum.getName(); - } - } - return null; - } - - public static String getIdByName(String name) { - SourceTypeEnum[] sourceTypeEnums = values(); - for (SourceTypeEnum sourceTypeEnum : sourceTypeEnums) { - if (sourceTypeEnum.getName().equals(name)) { - return sourceTypeEnum.getId(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/TimeUnitEnum.java b/src/com/sipai/entity/enums/TimeUnitEnum.java deleted file mode 100644 index 525c6805..00000000 --- a/src/com/sipai/entity/enums/TimeUnitEnum.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.entity.enums; - -/** - * KPI计算时计算范围 - * - */ -public enum TimeUnitEnum { - MINUTE("minute","分钟"), - HOUR("hour","小时"), - DAY("day","天"), - MONTH("month","月"), - YEAR("year","年"); - - private String id; - private String name; - private TimeUnitEnum(String id, String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (TimeUnitEnum item :TimeUnitEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - /** - * 通过value取枚举 - * @param value - * @return - */ - public static TimeUnitEnum getTypeByValue(String value){ - - for (TimeUnitEnum enums : TimeUnitEnum.values()) { - if (enums.getId().equals(value)) { - return enums; - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (TimeUnitEnum item :TimeUnitEnum.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/enums/WeatherTypeEnum.java b/src/com/sipai/entity/enums/WeatherTypeEnum.java deleted file mode 100644 index 655a6dde..00000000 --- a/src/com/sipai/entity/enums/WeatherTypeEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 维度类型 - * @author lichen - */ -public enum WeatherTypeEnum { - WEATHER_TYPE_REALTIME(0,"实时天气"), - WEATHER_TYPE_FUTURE( 1,"预报天气"); - - private int id; - private String name; - - WeatherTypeEnum(int id, String name){ - this.id=id; - this.name=name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (WeatherTypeEnum item : WeatherTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (WeatherTypeEnum item : WeatherTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/XimenziDescriptionEnum.java b/src/com/sipai/entity/enums/XimenziDescriptionEnum.java deleted file mode 100644 index cdc90490..00000000 --- a/src/com/sipai/entity/enums/XimenziDescriptionEnum.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 巡检情况树状显示 - * - */ -public enum XimenziDescriptionEnum { - TYPE_1("Rotor Unbalance","转子不平衡"), - TYPE_2("Misalignment of Rotor Shaft","转轴不对中"), - TYPE_3("Horizontal Loosen","电机水平松动"), - TYPE_4("Loosing Base","电机底座松动"), - TYPE_5("Horizontal Misalignment","相邻两转轴的轴心线与轴承中心线偏移"), - TYPE_6("Angular Misalignment","相邻两转轴的轴心线与轴承中心线偏移"), - TYPE_7("Poor Bearing Lubrication","轴承润滑不良,发生干摩擦"), - TYPE_8("Bearing Outer Ring Wear","电机驱动端轴承外圈磨损"), - TYPE_9("Bearing Inner Ring Wear","电机驱动端轴承内圈磨损"), - TYPE_10("Bearing Rolling Element Wear","电机驱动端轴承滚动体磨损"), - TYPE_11("Bearing Cage Failure","电机驱动端轴承保持架故障"), - TYPE_12("Misalignment of Coupling","平行不对中、角度不对中,或两种形式同时存在"), - TYPE_13("Broken Gear Teeth","齿轮断齿"), - TYPE_14("Gear Wear","齿轮磨损"), - TYPE_15("Gear Pitting","齿轮工作表面金属小块剥落,出现点状小坑"), - TYPE_16("Gear Mesh Failure","齿轮啮合不良"), - TYPE_17("Poor Coupling Assembly","联轴器全跳动的偏差值超出要求范围"), - TYPE_18("Excessive Coupling Clearance","联轴器尼龙棒间隙过大,起动延迟"), - TYPE_19("Impeller Unbalance","叶轮压力不一,回转体不平衡"), - TYPE_20("Impeller Worn","叶轮磨损。"), - TYPE_21("Shaft Bending","轴弯曲。"), - TYPE_22("Horizontal Loosen Driven End","电机底座驱动端水平松动"), - TYPE_23("Horizontal Loosen Non-Driven End","电机底座非驱动端水平松动"), - TYPE_24("Vertical Loosen Driven End","电机底座驱动端垂直松动"), - TYPE_25("Vertical Loosen Non-Driven End","电机底座非驱动端垂直松动"), - ; - - private String id; - private String name; - - private XimenziDescriptionEnum(String id, String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (XimenziDescriptionEnum item : XimenziDescriptionEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - /** - * 通过value取枚举 - * @param value - * @return - */ - public static XimenziDescriptionEnum getTypeByValue(String value){ - - for (XimenziDescriptionEnum enums : XimenziDescriptionEnum.values()) { - if (enums.getId().equals(value)) { - return enums; - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (XimenziDescriptionEnum item : XimenziDescriptionEnum.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/enums/YorNTypeEnum.java b/src/com/sipai/entity/enums/YorNTypeEnum.java deleted file mode 100644 index c629e911..00000000 --- a/src/com/sipai/entity/enums/YorNTypeEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.enums; - -/** - * 启用禁用状态: - * @author lichen - */ -public enum YorNTypeEnum { - Enable(1,"是"), - Disable( 0,"否"); - - private int id; - private String name; - - YorNTypeEnum(int id, String name){ - this.id=id; - this.name=name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllEnableType4JSON() { - String json = ""; - for (YorNTypeEnum item : YorNTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (YorNTypeEnum item : YorNTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckConstant.java b/src/com/sipai/entity/enums/safety/SafetyCheckConstant.java deleted file mode 100644 index 9d4021e3..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckConstant.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.entity.enums.safety; - -/** - * 安管管理所使用的常量 - * - * @Author: lichen - * @Date: 2021/10/20 - **/ -public class SafetyCheckConstant { - - // 安全检查 - public final static String MSG_TYPE_SAFETY_CHECK = "SAFETY_CHECK"; - - // 安全检查 - public final static String MSG_TYPE_SAFETY_JOB = "SAFETY_JOB"; - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckItemComprehensiveEnum.java b/src/com/sipai/entity/enums/safety/SafetyCheckItemComprehensiveEnum.java deleted file mode 100644 index 6dda0a34..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckItemComprehensiveEnum.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 综合安全检查项目 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyCheckItemComprehensiveEnum { - - ITEM_1(1,"安全管理","单位负责人、安全管理人员、特种作业人员未经培训持证上岗"), - ITEM_2(2,"安全管理","未建立健全安全管理制度、操作规程和应急预案"), - ITEM_3(3,"安全管理","员工未按要求进行安全教育培训"), - ITEM_4(4,"安全管理","员工未遵守安全管理制度、操作规程和劳动纪律"), - ITEM_5(5,"安全管理","未按规定发放、使用个人防护用品"), - ITEM_6(6,"安全管理","在禁烟区内吸烟"), - ITEM_7(7,"安全管理","特种作业未办理许可证,未进行安全交底,防护措施不到位"), - - ITEM_8(8,"消防安全","未建立健全消防安全责任制、消防安全管理制度"), - ITEM_9(9,"消防安全","未按规定对相关人员进行消防培训"), - ITEM_10(10,"消防安全","未按规定设置应急照明、疏散指示标志"), - ITEM_11(11,"消防安全","未按规定配置消防设施、器材,并定期检查、维护保养"), - ITEM_12(12,"消防安全","占用、堵塞、封闭消防通道、疏散通道或安全出口"), - ITEM_13(13,"消防安全","埋压、圈占、停用、挪用、遮挡消防设施、器材"), - - ITEM_14(14,"用电安全","电气设备、设施接地不良"), - ITEM_15(15,"用电安全","各类设备、电线、插座及灯具欠缺,照明不良"), - ITEM_16(16,"用电安全","配电房未按规定配置安全防护用具"), - ITEM_17(17,"用电安全","未按规定设置避雷装置设施,并对其性能定期进行检测"), - - ITEM_18(18,"有限空间","有限空间内通风不良"), - ITEM_19(19,"有限空间","进入有限空间,未做好安全防护"), - - ITEM_20(20,"特种设备","质量合格证、使用证、安全检验合格证欠缺"), - ITEM_21(21,"特种设备","未在有效期内使用;未定期检验、维护保养"), - - ITEM_22(22,"设备设施","设备有锈蚀;建筑物、构筑物有渗水、漏水"), - ITEM_23(23,"设备设施","门窗、护栏、安全设备设施欠缺"), - ITEM_24(24,"设备设施","物品、设备和工器具未进行定置管理"), - - ITEM_25(25,"其它","未规范使用危化品、规范处置危废,污染环境"), - ITEM_26(25,"其它","其它"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String group; - @Setter - @Getter - private String name; - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyCheckItemComprehensiveEnum item : SafetyCheckItemComprehensiveEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\",\"group\":\"" + item.getGroup() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\",\"group\":\"" + item.getGroup() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyCheckItemComprehensiveEnum item : SafetyCheckItemComprehensiveEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckItemDaylyEnum.java b/src/com/sipai/entity/enums/safety/SafetyCheckItemDaylyEnum.java deleted file mode 100644 index 9d0e6798..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckItemDaylyEnum.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 安全检查日常检查项目 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyCheckItemDaylyEnum { - - ITEM_1(1,"不遵守安全管理制度和操作规程"), - ITEM_2(2,"不按规定使用个人防护用品"), - ITEM_3(3,"禁烟区有吸烟现象"), - ITEM_4(4,"易燃易爆场所有使用明火"), - ITEM_5(5,"消防通道、安全出口不畅通"), - ITEM_6(6,"消防设施位置不固定、有挪用"), - ITEM_7(7,"消防设施有堵塞、性能不完好"), - ITEM_8(8,"安全标识不清晰完好"), - ITEM_9(9,"照明设备、应急照明灯不完好有效"), - ITEM_10(10,"地面清洁、有积水积油"), - ITEM_11(11,"工器具未摆放整齐"), - ITEM_12(12,"电气设施绝缘不良、线路有破损"), - ITEM_13(13,"设备设施性能不良"), - ITEM_14(14,"特种作业未办理作业许可证"), - ITEM_15(15,"特种作业未进行安全交底"), - ITEM_16(16,"未规范使用危化品、规范处置危废,不污染环境"), - ITEM_17(17,"不符合其它安全要求"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyCheckItemDaylyEnum item : SafetyCheckItemDaylyEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyCheckItemDaylyEnum item : SafetyCheckItemDaylyEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckItemSpecialDetailEnum.java b/src/com/sipai/entity/enums/safety/SafetyCheckItemSpecialDetailEnum.java deleted file mode 100644 index 55aace4a..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckItemSpecialDetailEnum.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 专项安全检查项目 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyCheckItemSpecialDetailEnum { - - ITEM_1(1, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"消防安全制度不完善"), - ITEM_2(2, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"消防安全责任落实不到位"), - ITEM_3(3, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"建筑消防设施破损无效"), - ITEM_4(4, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"未搭建临时建筑"), - ITEM_5(5, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"搭建的临时建筑不符合消防安全要求"), - ITEM_6(6, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"消防车通道、安全出口及疏散通道不畅通"), - ITEM_7(7, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"没有消防水源"), - ITEM_8(8, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"消防设施和器材不齐全、破损无效"), - ITEM_9(9, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"电气线路未穿管保护"), - ITEM_10(10, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"电气线路老化"), - ITEM_11(11, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"存在违章动火"), - ITEM_12(12, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"禁烟区有吸烟现象"), - ITEM_13(13, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"有违规使用电器及电气设备"), - ITEM_14(14, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"存在违章私拉乱接电线现象"), - ITEM_15(15, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"电气设备接地不良"), - ITEM_49(49, SafetyCheckItemSpecialEnum.FIRE_CHECK.getId(),"其它"), - - ITEM_50(50, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"防汛应急预案欠缺"), - ITEM_51(51, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"未指定专人关注气象信息,未及时发布汛情"), - ITEM_52(52, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"未落实汛期值班制度"), - ITEM_53(53, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"值班人员不熟悉汛情上报方式"), - ITEM_54(54, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"建筑物有塌陷、渗水、漏水现象"), - ITEM_55(55, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"抢险通道、人员逃生通道不畅通"), - ITEM_56(56, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"门窗欠缺或无法紧闭、应急照明设施欠缺"), - ITEM_57(57, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"防汛重点区域排水管道不畅通"), - ITEM_58(58, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"窨井盖欠缺、电缆沟有积水"), - ITEM_59(59, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"抢险器材、物资欠缺、账物不符,欠缺无效"), - ITEM_60(60, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"避雷装置、设施安全性能欠缺"), - ITEM_61(61, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"悬挂物不牢固固定、电线架设不符合安全要求"), - ITEM_62(62, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"设备无防风、防雨、防触电措施"), - ITEM_63(63, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"管道有外溢现象"), - ITEM_100(100, SafetyCheckItemSpecialEnum.FLOOD_CHECK.getId(),"其它"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private int group; - @Setter - @Getter - private String name; - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyCheckItemSpecialDetailEnum item : SafetyCheckItemSpecialDetailEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\",\"group\":\"" + item.getGroup() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\",\"group\":\"" + item.getGroup() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getEnableType4JSONByGroup(int group) { - String json = ""; - for (SafetyCheckItemSpecialDetailEnum item : SafetyCheckItemSpecialDetailEnum.values()) { - if (item.getGroup() == group) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\",\"group\":\"" + item.getGroup() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\",\"group\":\"" + item.getGroup() + "\"}"; - } - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyCheckItemSpecialDetailEnum item : SafetyCheckItemSpecialDetailEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckItemSpecialEnum.java b/src/com/sipai/entity/enums/safety/SafetyCheckItemSpecialEnum.java deleted file mode 100644 index fcc1c555..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckItemSpecialEnum.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 专项安全检查项目 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyCheckItemSpecialEnum { - - FIRE_CHECK(1,"消防安全专项检查"), - FLOOD_CHECK(2,"防汛防台专项安全检查"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyCheckItemSpecialEnum item : SafetyCheckItemSpecialEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyCheckItemSpecialEnum item : SafetyCheckItemSpecialEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckResultEnum.java b/src/com/sipai/entity/enums/safety/SafetyCheckResultEnum.java deleted file mode 100644 index 120ba67b..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckResultEnum.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 安全检查结果 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyCheckResultEnum { - - - OK(1,"相符"), - NOT_OK(2,"不相符"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyCheckResultEnum item : SafetyCheckResultEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyCheckResultEnum item : SafetyCheckResultEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyCheckStatusEnum.java b/src/com/sipai/entity/enums/safety/SafetyCheckStatusEnum.java deleted file mode 100644 index 650e0ae7..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyCheckStatusEnum.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 安全检查状态 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyCheckStatusEnum { - TEMP(0, "草稿", null,null, null,null), - APPLY(1, "整改中", "提交反馈","整改前", "{}提交了一份检查反馈单。",null), - RESPONSE(2, "整改完成", "整改","整改后", "{}提交了一份检查反馈单。",null), - COMPLETE(3, "验证完成", "验证",null, "{}确认整改。","{}退回整改。"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - @Setter - @Getter - private String taskTitle; - @Setter - @Getter - private String fileListTitle; - @Setter - private String taskRecordPass; - @Setter - private String taskRecordNotPass; - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyCheckStatusEnum item : SafetyCheckStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public String getTaskRecordPass(String userName) { - return this.taskRecordPass.replace("{}", userName); - } - public String getTaskRecordNotPass(String userName) { - return this.taskRecordNotPass.replace("{}", userName); - } - public static String getFileListTitleByid(int id) { - for (SafetyCheckStatusEnum item : SafetyCheckStatusEnum.values()) { - if (item.getId() == id) { - return item.getFileListTitle(); - } - } - return null; - } - - public static String getNameByid(int id) { - for (SafetyCheckStatusEnum item : SafetyCheckStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } -} diff --git a/src/com/sipai/entity/enums/safety/SafetyEducationTypeEnum.java b/src/com/sipai/entity/enums/safety/SafetyEducationTypeEnum.java deleted file mode 100644 index ae9244e5..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyEducationTypeEnum.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 培训类型 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyEducationTypeEnum { - - - EDUCATION_TYPE_NEW(1, "新入职人员三级教育"), - EDUCATION_TYPE_TURN(2, "人员转岗教育"), - EDUCATION_TYPE_BACK(3, "人员复岗教育"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyEducationTypeEnum item : SafetyEducationTypeEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyEducationTypeEnum item : SafetyEducationTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyFunctionEnum.java b/src/com/sipai/entity/enums/safety/SafetyFunctionEnum.java deleted file mode 100644 index c6879731..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyFunctionEnum.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 功能 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyFunctionEnum { - - - EDUCATION_INSIDER(1, "内部人员教育","NB"), - EDUCATION_VISITOR(2, "外来访客教育","WB"), - EDUCATION_TRAINEE(3, "实习人员教育","SX"), - EDUCATION_BUILDER(4, "施工人员教育","SG"), - - JOB_INSIDER(5, "内部作业管理","NB"), - JOB_OUTSIDER(6, "相关单位作业管理","XG"), - - SAFETY_CHECK_DAYLY(8, "日常安全检查","RC"), - SAFETY_CHECK_COMPREHENSIVE(9, "综合安全检查","ZH"), - SAFETY_CHECK_SPECIAL(10, "专项安全检查","ZX"), - - CERTIFICATE_INSIDER(11, "内部人员证书","NB"), - CERTIFICATE_OUTSIDER(12, "外部人员证书","WB"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - @Setter - @Getter - private String code; - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyFunctionEnum item : SafetyFunctionEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyFunctionEnum item : SafetyFunctionEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyJobAgreeEnum.java b/src/com/sipai/entity/enums/safety/SafetyJobAgreeEnum.java deleted file mode 100644 index 0ce640ea..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyJobAgreeEnum.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 安全检查结果 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyJobAgreeEnum { - - - OK(1,"同意"), - NOT_OK(0,"不同意"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyJobAgreeEnum item : SafetyJobAgreeEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyJobAgreeEnum item : SafetyJobAgreeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyJobInsideCountersignStatusEnum.java b/src/com/sipai/entity/enums/safety/SafetyJobInsideCountersignStatusEnum.java deleted file mode 100644 index c2d9ebbf..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyJobInsideCountersignStatusEnum.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 安全管理 安全检查结果 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyJobInsideCountersignStatusEnum { - - - ANYONE_SIGN(1,"有人已经会签"), - NO_BODY_SIGN(0,"还没有人会签"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyJobInsideCountersignStatusEnum item : SafetyJobInsideCountersignStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SafetyJobInsideCountersignStatusEnum item : SafetyJobInsideCountersignStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/safety/SafetyJobInsideStatusEnum.java b/src/com/sipai/entity/enums/safety/SafetyJobInsideStatusEnum.java deleted file mode 100644 index 97410623..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyJobInsideStatusEnum.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 内部作业状态 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyJobInsideStatusEnum { - - TEMP(0, "草稿","发起项目","项目附件",null,null), - SIGN(1, "部门会签","部门会签",null,"{}完成会签。意见:同意","{}完成会签。意见:不同意"), - PROJECT_BEGIN(2, "项目进行中","项目进行中","工单开具","{}开具了工单。",null), - PROJECT_END(3, "项目结束","项目结束",null,"{}结束了项目。",null); - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - @Setter - @Getter - private String taskTitle; - @Setter - @Getter - private String fileListTitle; - @Setter - private String taskRecordPass; - @Setter - private String taskRecordNotPass; - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyJobInsideStatusEnum item : SafetyJobInsideStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public String getTaskRecordPass(String userName) { - return this.taskRecordPass.replace("{}", userName); - } - public String getTaskRecordNotPass(String userName) { - return this.taskRecordNotPass.replace("{}", userName); - } - public static String getFileListTitleByid(int id) { - for (SafetyJobInsideStatusEnum item : SafetyJobInsideStatusEnum.values()) { - if (item.getId() == id) { - return item.getFileListTitle(); - } - } - return null; - } - - public static String getNameByid(int id) { - for (SafetyJobInsideStatusEnum item : SafetyJobInsideStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } -} diff --git a/src/com/sipai/entity/enums/safety/SafetyJobTypeEnum.java b/src/com/sipai/entity/enums/safety/SafetyJobTypeEnum.java deleted file mode 100644 index 472bae7f..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyJobTypeEnum.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; -import org.apache.commons.lang3.StringUtils; - -/** - * 作业类型 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyJobTypeEnum { - - TYPE_1(1, "高处作业"), - TYPE_2(2, "动火作业"), - TYPE_3(3, "吊装作业"), - TYPE_4(4, "有限空间作业"), - TYPE_5(5, "临时用电"), - TYPE_6(6, "动土作业"), - TYPE_7(7, "潜水作业"), - TYPE_8(8, "其它作业"); - - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyJobTypeEnum item : SafetyJobTypeEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(String[] ids) { - String result=""; - for (SafetyJobTypeEnum item : SafetyJobTypeEnum.values()) { - for (String id : ids) { - if (StringUtils.isNotEmpty(id) && String.valueOf(item.getId()).equals(id)) { - result+= item.getName() +","; - } - } - } - return result.substring(0, result.length()-1); - } - - public static String getFileListTitleByid(int id) { - for (SafetyCheckStatusEnum item : SafetyCheckStatusEnum.values()) { - if (item.getId() == id) { - return item.getFileListTitle(); - } - } - return null; - } -} diff --git a/src/com/sipai/entity/enums/safety/SafetyOutsiderJobStatusEnum.java b/src/com/sipai/entity/enums/safety/SafetyOutsiderJobStatusEnum.java deleted file mode 100644 index cb3a933b..00000000 --- a/src/com/sipai/entity/enums/safety/SafetyOutsiderJobStatusEnum.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.entity.enums.safety; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * 相关单位作业状态 - * - * @author lichen - */ -@AllArgsConstructor -public enum SafetyOutsiderJobStatusEnum { - - TEMP(0, "草稿","发起项目","项目附件",null,null), - //SIGN(1, "部门会签","部门会签",null,"{}完成会签。意见:同意","{}完成会签。意见:不同意"), - PROJECT_BEGIN(2, "项目进行中","项目进行中","工单开具",null,null), - PROJECT_END(3, "项目结束","项目结束",null,"{}结束了项目。",null); - @Setter - @Getter - private int id; - @Setter - @Getter - private String name; - @Setter - @Getter - private String taskTitle; - @Setter - @Getter - private String fileListTitle; - @Setter - private String taskRecordPass; - @Setter - private String taskRecordNotPass; - - public static String getAllEnableType4JSON() { - String json = ""; - for (SafetyJobInsideStatusEnum item : SafetyJobInsideStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public String getTaskRecordPass(String userName) { - return this.taskRecordPass.replace("{}", userName); - } - public String getTaskRecordNotPass(String userName) { - return this.taskRecordNotPass.replace("{}", userName); - } - public static String getFileListTitleByid(int id) { - for (SafetyJobInsideStatusEnum item : SafetyJobInsideStatusEnum.values()) { - if (item.getId() == id) { - return item.getFileListTitle(); - } - } - return null; - } - - public static String getNameByid(int id) { - for (SafetyJobInsideStatusEnum item : SafetyJobInsideStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - -} diff --git a/src/com/sipai/entity/enums/whp/AmplingPeriodEnum.java b/src/com/sipai/entity/enums/whp/AmplingPeriodEnum.java deleted file mode 100644 index 1dadfbeb..00000000 --- a/src/com/sipai/entity/enums/whp/AmplingPeriodEnum.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.entity.enums.whp; - -public enum AmplingPeriodEnum { - - - AMPLDAY(0, "天"), - AMPLWEEK(1, "周"), - AMPLTENDAY(2, "旬"), - AMPLMONTH(3, "月"); - - private int id; - private String name; - - - AmplingPeriodEnum(int id, String name) { - this.id = id; - this.name = name; - - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public static String getAll4JSON() { - String json = ""; - for (AmplingPeriodEnum item : AmplingPeriodEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (AmplingPeriodEnum item : AmplingPeriodEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - AmplingPeriodEnum[] amplingPeriodEnums = values(); - for (AmplingPeriodEnum amplingPeriodEnum : amplingPeriodEnums) { - if (amplingPeriodEnum.getName().equals(name)) { - return amplingPeriodEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/LiquidWasteDisposeStatusEnum.java b/src/com/sipai/entity/enums/whp/LiquidWasteDisposeStatusEnum.java deleted file mode 100644 index bffded76..00000000 --- a/src/com/sipai/entity/enums/whp/LiquidWasteDisposeStatusEnum.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.enums.whp; - -/** - * 废液处置状态: - * @author lichen - */ -public enum LiquidWasteDisposeStatusEnum { - RECORD(0,"登记"), - NON_DISPOSED(1,"已入库"), - DISPOSED( 2,"已处置"); - - private int id; - private String name; - - LiquidWasteDisposeStatusEnum(int id, String name){ - this.id=id; - this.name=name; - } - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (LiquidWasteDisposeStatusEnum item : LiquidWasteDisposeStatusEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getWithOutRecord4JSON() { - String json = ""; - for (LiquidWasteDisposeStatusEnum item : LiquidWasteDisposeStatusEnum.values()) { - if(LiquidWasteDisposeStatusEnum.RECORD.equals(item)){ - continue; - } - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (LiquidWasteDisposeStatusEnum item : LiquidWasteDisposeStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - LiquidWasteDisposeStatusEnum[] enableTypeEnums = values(); - for (LiquidWasteDisposeStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/LiquidWasteDisposeTypeEnum.java b/src/com/sipai/entity/enums/whp/LiquidWasteDisposeTypeEnum.java deleted file mode 100644 index 5e245a0f..00000000 --- a/src/com/sipai/entity/enums/whp/LiquidWasteDisposeTypeEnum.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.enums.whp; - -/** - * 废液代码及名称: - * @author lichen - */ -public enum LiquidWasteDisposeTypeEnum { - RECORD(0,"碱性"), - NON_DISPOSED(1,"酸性"); - - private int id; - private String name; - - LiquidWasteDisposeTypeEnum(int id, String name){ - this.id=id; - this.name=name; - } - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (LiquidWasteDisposeTypeEnum item : LiquidWasteDisposeTypeEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (LiquidWasteDisposeTypeEnum item : LiquidWasteDisposeTypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - LiquidWasteDisposeTypeEnum[] enableTypeEnums = values(); - for (LiquidWasteDisposeTypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/PlanIndexJson.java b/src/com/sipai/entity/enums/whp/PlanIndexJson.java deleted file mode 100644 index c9d1b8c9..00000000 --- a/src/com/sipai/entity/enums/whp/PlanIndexJson.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class PlanIndexJson { - - - private String id; - - private Integer status; - /** - * 采样计划数 - */ - private Integer planCount; - - /** - * 计划 样品数 - */ - private Integer planSampleCount; - - /** - * 时间 采样样品数 - */ - private Integer realityCount; - - /** - * 采样完成率 - */ - private String realityRate; - - /** - * 样品数 - */ - private Integer sampleCount; - - /** - * 检测任务数 - */ - private Integer testCount; - - - /** - * 名称 - */ - private String name; - - /** - * 项目数 - */ - private Integer itemCount; - - - /** - * 完成数 - */ - private Integer finishCount; - - - /** - * 未完成 - */ - private Integer incomplete; - - /** - * 状态描述 - */ - private String statusName; - - - /** - * 类型编码 - */ - private String code; - - - /** - * 日期 - */ - private String date; - - - - - - -} diff --git a/src/com/sipai/entity/enums/whp/ResidualSampleDisposeStatusEnum.java b/src/com/sipai/entity/enums/whp/ResidualSampleDisposeStatusEnum.java deleted file mode 100644 index 60a56fac..00000000 --- a/src/com/sipai/entity/enums/whp/ResidualSampleDisposeStatusEnum.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 余姚处置状态: - * - * @author lichen - */ -@AllArgsConstructor -public enum ResidualSampleDisposeStatusEnum { - WAIT(0, "未处置"), - AUDIT(1, "处置待审核"), - REJECT(2, "处置审核驳回"), - DONE(3, "处置完成"); - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - - public static String getAllEnableType4JSON() { - String json = ""; - for (ResidualSampleDisposeStatusEnum item : ResidualSampleDisposeStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(Integer id) { - for (ResidualSampleDisposeStatusEnum item : ResidualSampleDisposeStatusEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static Integer getIdByName(String name) { - ResidualSampleDisposeStatusEnum[] enableTypeEnums = values(); - for (ResidualSampleDisposeStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return null; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SampleAppearanceEnum.java b/src/com/sipai/entity/enums/whp/SampleAppearanceEnum.java deleted file mode 100644 index fb5e994a..00000000 --- a/src/com/sipai/entity/enums/whp/SampleAppearanceEnum.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 样品外观 - * - * @author lichen - */ -@AllArgsConstructor -public enum SampleAppearanceEnum { - - - - GREY(1, "灰色"), - BLACK(2, "黑色"), - YELLOW(3, "黄色"), - BROWN(4, "褐色"), - NEARCOLORLESS(5, "近无色"), - LIGHTCOLOUR(6, "浅色"); - - - - - private Integer id; - - private String name; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (SampleAppearanceEnum item : SampleAppearanceEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(Integer id) { - for (SampleAppearanceEnum item : SampleAppearanceEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SampleAppearanceEnum[] enableTypeEnums = values(); - for (SampleAppearanceEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SampleNatureEnum.java b/src/com/sipai/entity/enums/whp/SampleNatureEnum.java deleted file mode 100644 index a076fac1..00000000 --- a/src/com/sipai/entity/enums/whp/SampleNatureEnum.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.Getter; -import lombok.Setter; - -/** - * 样品 性质 - */ -public enum SampleNatureEnum { - - DRYMUD(4, "干泥"), - WETMUD(1, "湿泥"), - PARTICLE(2, "颗粒"), - POWDER(3, "粉末"); - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - - SampleNatureEnum(int id, String name) { - this.id=id; - this.name=name; - } - - - public static String getAll4JSON() { - String json = ""; - for (SampleNatureEnum item : SampleNatureEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(Integer id) { - for (SampleNatureEnum item : SampleNatureEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SampleNatureEnum[] enableTypeEnums = values(); - for (SampleNatureEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - -} diff --git a/src/com/sipai/entity/enums/whp/SampleStateEnum.java b/src/com/sipai/entity/enums/whp/SampleStateEnum.java deleted file mode 100644 index c04367c4..00000000 --- a/src/com/sipai/entity/enums/whp/SampleStateEnum.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.entity.enums.whp; - -/** - * 样品状态 - * - * @author lichen - */ -public enum SampleStateEnum { - SOLID(2, "固体"), - LIQUID(1, "液体"); - - private int id; - private String name; - - SampleStateEnum(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (SampleStateEnum item : SampleStateEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SampleStateEnum item : SampleStateEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SampleStateEnum[] enableTypeEnums = values(); - for (SampleStateEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SampleSupernatantEnum.java b/src/com/sipai/entity/enums/whp/SampleSupernatantEnum.java deleted file mode 100644 index 8f7c1515..00000000 --- a/src/com/sipai/entity/enums/whp/SampleSupernatantEnum.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.Getter; -import lombok.Setter; - -/** - * 上清液 - */ -public enum SampleSupernatantEnum { - - - - CLEAR(2, "清澈"), - TURBID(1, "浑浊"); - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - - SampleSupernatantEnum(int id, String name) { - this.id=id; - this.name=name; - } - - - public static String getAll4JSON() { - String json = ""; - for (SampleSupernatantEnum item : SampleSupernatantEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(Integer id) { - for (SampleSupernatantEnum item : SampleSupernatantEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SampleSupernatantEnum[] enableTypeEnums = values(); - for (SampleSupernatantEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - -} diff --git a/src/com/sipai/entity/enums/whp/SamplingPlanStatusEnum.java b/src/com/sipai/entity/enums/whp/SamplingPlanStatusEnum.java deleted file mode 100644 index d1fffb4a..00000000 --- a/src/com/sipai/entity/enums/whp/SamplingPlanStatusEnum.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 采样计划状态: - * @author lichen - */ -@AllArgsConstructor -public enum SamplingPlanStatusEnum { - TEMPLATE(1,"计划编制中"), - SUBMIT(2,"已下发"), - SAMPLING(3,"采样中"), - SAMPLING_DONE(4,"采样完成"), - TESTING(5,"检测中"), - AUDIT(6,"审核中"), - ALL_DONE(7,"全部完成"); - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - public static String getIsAudit4JSON() { - String json = ""; - json = "[{\"id\":\"" + SamplingPlanStatusEnum.ALL_DONE.getId() + "\",\"text\":\"通过\"}," + - "{\"id\":\"" + SamplingPlanStatusEnum.TESTING.getId() + "\",\"text\":\"不通过\"}]"; - - return json; - } - public static String getAll4JSON() { - String json = ""; - for (SamplingPlanStatusEnum item : SamplingPlanStatusEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getAll4JSONOUTTEMPLATE() { - String json = ""; - for (SamplingPlanStatusEnum item : SamplingPlanStatusEnum.values()) { - if (item.getId()!=SamplingPlanStatusEnum.TEMPLATE.getId()) - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (SamplingPlanStatusEnum item : SamplingPlanStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SamplingPlanStatusEnum[] enableTypeEnums = values(); - for (SamplingPlanStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SamplingPlanSyncEnum.java b/src/com/sipai/entity/enums/whp/SamplingPlanSyncEnum.java deleted file mode 100644 index f896515c..00000000 --- a/src/com/sipai/entity/enums/whp/SamplingPlanSyncEnum.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 采样计划状态: - * @author lichen - */ -@AllArgsConstructor -public enum SamplingPlanSyncEnum { - NSYNC(0,"未同步"), - YSYNC(1,"已同步"); - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - public static String getAll4JSON() { - String json = ""; - for (SamplingPlanSyncEnum item : SamplingPlanSyncEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (SamplingPlanSyncEnum item : SamplingPlanSyncEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SamplingPlanSyncEnum[] enableTypeEnums = values(); - for (SamplingPlanSyncEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SamplingPlanTaskEnvEnum.java b/src/com/sipai/entity/enums/whp/SamplingPlanTaskEnvEnum.java deleted file mode 100644 index 721c35d1..00000000 --- a/src/com/sipai/entity/enums/whp/SamplingPlanTaskEnvEnum.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.entity.enums.whp; - -/** - * 现场采样情况 - * - * @author lichen - */ -public enum SamplingPlanTaskEnvEnum { - GOOD(0, "良好"), - OTHER(1, "其它"); - - private int id; - private String name; - - SamplingPlanTaskEnvEnum(int id, String name) { - this.id = id; - this.name = name; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (SamplingPlanTaskEnvEnum item : SamplingPlanTaskEnvEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SamplingPlanTaskEnvEnum item : SamplingPlanTaskEnvEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SamplingPlanTaskEnvEnum[] enableTypeEnums = values(); - for (SamplingPlanTaskEnvEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SamplingPlanTaskStatusEnum.java b/src/com/sipai/entity/enums/whp/SamplingPlanTaskStatusEnum.java deleted file mode 100644 index 0324a6a7..00000000 --- a/src/com/sipai/entity/enums/whp/SamplingPlanTaskStatusEnum.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 采样任务状态: - * - * @author lichen - */ -@AllArgsConstructor -public enum SamplingPlanTaskStatusEnum { - TEMPLATE(0, "草稿"), - WAIT(1, "未接单"), - ING(2, "采样中"), - REJECTION(3, "重新采样"), - AUDIT(4, "待审核"), - TEST(5, "检测中"), - DONE(6, "计划审核完成"); - - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - - public static String getAll4JsonWithOutTemplate() { - String json = ""; - for (SamplingPlanTaskStatusEnum item : SamplingPlanTaskStatusEnum.values()) { - if(SamplingPlanTaskStatusEnum.TEMPLATE.equals(item)){ - continue; - } - - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getAll4JSON() { - String json = ""; - for (SamplingPlanTaskStatusEnum item : SamplingPlanTaskStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(Integer id) { - for (SamplingPlanTaskStatusEnum item : SamplingPlanTaskStatusEnum.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SamplingPlanTaskStatusEnum[] enableTypeEnums = values(); - for (SamplingPlanTaskStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SamplingPlanTaskTestConfirmStatusEnum.java b/src/com/sipai/entity/enums/whp/SamplingPlanTaskTestConfirmStatusEnum.java deleted file mode 100644 index 6ffb5de8..00000000 --- a/src/com/sipai/entity/enums/whp/SamplingPlanTaskTestConfirmStatusEnum.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -/** - * 计划单检验任务复核状态: - * - * @author lichen - */ -@AllArgsConstructor -public enum SamplingPlanTaskTestConfirmStatusEnum { - WAIT(0, "未接单"), - TEST(1, "检验中"), - BACK_FROM_CONFIRM(2, "复核退回"), - BACK_FROM_AUDIT(3, "审核退回"), - CONFIRM(4, "复核中"), - AUDIT(5, "复核完成"), - DONE(6, "审核完成"); - - - @Getter - @Setter - private Integer id; - @Getter - @Setter - private String name; - - - public static String getAll4JsonWithOutWait() { - String json = ""; - for (SamplingPlanTaskTestConfirmStatusEnum item : SamplingPlanTaskTestConfirmStatusEnum.values()) { - if (item.equals(SamplingPlanTaskTestConfirmStatusEnum.WAIT)) { - continue; - } - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getAll4JsonWithInCONFIRM() { - String json = ""; - for (SamplingPlanTaskTestConfirmStatusEnum item : SamplingPlanTaskTestConfirmStatusEnum.values()) { - if (item.equals(SamplingPlanTaskTestConfirmStatusEnum.CONFIRM) ||item.equals(SamplingPlanTaskTestConfirmStatusEnum.AUDIT)) { - - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - } - json = "[" + json + "]"; - return json; - } -public static String getAll4JsonWithInTask() { - String json = ""; - for (SamplingPlanTaskTestConfirmStatusEnum item : SamplingPlanTaskTestConfirmStatusEnum.values()) { - if (item.equals(SamplingPlanTaskTestConfirmStatusEnum.TEST) ||item.equals(SamplingPlanTaskTestConfirmStatusEnum.BACK_FROM_CONFIRM) - ||item.equals(SamplingPlanTaskTestConfirmStatusEnum.BACK_FROM_AUDIT) - ) { - - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - } - json = "[" + json + "]"; - return json; - } - - public static String getIsConfirm4JSON() { - String json = ""; - json = "[{\"id\":\"" + SamplingPlanTaskTestConfirmStatusEnum.AUDIT.getId() + "\",\"text\":\"通过\"}," + - "{\"id\":\"" + SamplingPlanTaskTestConfirmStatusEnum.BACK_FROM_CONFIRM.getId() + "\",\"text\":\"不通过\"}]"; - - return json; - } - - public static String getAll4JSON() { - String json = ""; - for (SamplingPlanTaskTestConfirmStatusEnum item : SamplingPlanTaskTestConfirmStatusEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (SamplingPlanTaskTestConfirmStatusEnum item : SamplingPlanTaskTestConfirmStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SamplingPlanTaskTestConfirmStatusEnum[] enableTypeEnums = values(); - for (SamplingPlanTaskTestConfirmStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/SamplingPlanTaskTestItemStatusEnum.java b/src/com/sipai/entity/enums/whp/SamplingPlanTaskTestItemStatusEnum.java deleted file mode 100644 index a0283b18..00000000 --- a/src/com/sipai/entity/enums/whp/SamplingPlanTaskTestItemStatusEnum.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.enums.whp; - -/** - * 检验任务状态: - * @author lichen - */ -public enum SamplingPlanTaskTestItemStatusEnum { - WAIT(0,"未接单"), - TEST(1,"检测中"), - CONFIRM(2,"复核中"), - AUDIT(3,"审核中"), - DONE(4,"完成"); - - - private int id; - private String name; - - SamplingPlanTaskTestItemStatusEnum(int id, String name){ - this.id=id; - this.name=name; - } - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public static String getAll4JsonWithOutWait() { - String json = ""; - for (SamplingPlanTaskTestItemStatusEnum item : SamplingPlanTaskTestItemStatusEnum.values()) { - if(item.equals(SamplingPlanTaskTestItemStatusEnum.WAIT)||item.equals(SamplingPlanTaskTestItemStatusEnum.TEST)){ - continue; - } - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getAll4JSON() { - String json = ""; - for (SamplingPlanTaskTestItemStatusEnum item : SamplingPlanTaskTestItemStatusEnum.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - public static String getNameByid(int id) { - for (SamplingPlanTaskTestItemStatusEnum item : SamplingPlanTaskTestItemStatusEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - SamplingPlanTaskTestItemStatusEnum[] enableTypeEnums = values(); - for (SamplingPlanTaskTestItemStatusEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/entity/enums/whp/TableHeader.java b/src/com/sipai/entity/enums/whp/TableHeader.java deleted file mode 100644 index d1a31b75..00000000 --- a/src/com/sipai/entity/enums/whp/TableHeader.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.entity.enums.whp; - -import lombok.Data; - -@Data -public class TableHeader { - - - private String field; - private String title; - private String align; - private String valign; -} diff --git a/src/com/sipai/entity/enums/whp/TestCurveFormulatypeEnum.java b/src/com/sipai/entity/enums/whp/TestCurveFormulatypeEnum.java deleted file mode 100644 index 4a83a575..00000000 --- a/src/com/sipai/entity/enums/whp/TestCurveFormulatypeEnum.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.entity.enums.whp; - -public enum TestCurveFormulatypeEnum { - BASEID(0, "基础描述"), - CONSTANTID(1, "常量"), - PROCESSID(2, "过程公式"), - RESULTID(3, "结果公式"); - - private int id; - private String name; - - TestCurveFormulatypeEnum(int id, String name) { - this.id = id; - this.name = name; - } - - - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (TestCurveFormulatypeEnum item : TestCurveFormulatypeEnum.values()) { - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } - - public static String getForm4JSON() { - String json = ""; - for (TestCurveFormulatypeEnum item : TestCurveFormulatypeEnum.values()) { - if(item.getId()!=0&&item.getId()!=1) - { - - if (json.equals("")) { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - - } - json = "[" + json + "]"; - return json; - } - - public static String getNameByid(int id) { - for (TestCurveFormulatypeEnum item : TestCurveFormulatypeEnum.values()) { - if (item.getId() == id) { - return item.getName(); - } - } - return null; - } - - - public static int getIdByName(String name) { - TestCurveFormulatypeEnum[] enableTypeEnums = values(); - for (TestCurveFormulatypeEnum enableTypeEnum : enableTypeEnums) { - if (enableTypeEnum.getName().equals(name)) { - return enableTypeEnum.getId(); - } - } - return 0; - } - -} diff --git a/src/com/sipai/entity/equipment/AssetClass.java b/src/com/sipai/entity/equipment/AssetClass.java deleted file mode 100644 index bd757967..00000000 --- a/src/com/sipai/entity/equipment/AssetClass.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -//资产类型 -public class AssetClass extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String assetclassnumber; - - private String assetclassname; - - private Double depreciablelife; - - private Double yeardepreciation; - - private Double netsalvageratio; - - private String active; - - private String remark; - - private String pid; - - private String equipmentBelongId; - - private EquipmentBelong equipmentBelong; - - private String classId; - - private String belongCode; - - private String _pidname; - - private EquipmentClass equipmentClass; - - - - public String get_pidname() { - return _pidname; - } - - public void set_pidname(String _pidname) { - this._pidname = _pidname; - } - - public EquipmentClass getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(EquipmentClass equipmentClass) { - this.equipmentClass = equipmentClass; - } - - public String getBelongCode() { - return belongCode; - } - - public void setBelongCode(String belongCode) { - this.belongCode = belongCode; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getAssetclassnumber() { - return assetclassnumber; - } - - public void setAssetclassnumber(String assetclassnumber) { - this.assetclassnumber = assetclassnumber; - } - - public String getAssetclassname() { - return assetclassname; - } - - public void setAssetclassname(String assetclassname) { - this.assetclassname = assetclassname; - } - - public Double getDepreciablelife() { - return depreciablelife; - } - - public void setDepreciablelife(Double depreciablelife) { - this.depreciablelife = depreciablelife; - } - - public Double getYeardepreciation() { - return yeardepreciation; - } - - public void setYeardepreciation(Double yeardepreciation) { - this.yeardepreciation = yeardepreciation; - } - - public Double getNetsalvageratio() { - return netsalvageratio; - } - - public void setNetsalvageratio(Double netsalvageratio) { - this.netsalvageratio = netsalvageratio; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getEquipmentBelongId() { - return equipmentBelongId; - } - - public void setEquipmentBelongId(String equipmentBelongId) { - this.equipmentBelongId = equipmentBelongId; - } - - public EquipmentBelong getEquipmentBelong() { - return equipmentBelong; - } - - public void setEquipmentBelong(EquipmentBelong equipmentBelong) { - this.equipmentBelong = equipmentBelong; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/Characteristic.java b/src/com/sipai/entity/equipment/Characteristic.java deleted file mode 100644 index 53d121bf..00000000 --- a/src/com/sipai/entity/equipment/Characteristic.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Characteristic extends SQLAdapter { - private String id; - - private Date insdt; - - private String insuser; - - private String equipmentId; - - private String characteristic; - - private String cType; - - private String memo; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getCharacteristic() { - return characteristic; - } - - public void setCharacteristic(String characteristic) { - this.characteristic = characteristic; - } - - public String getcType() { - return cType; - } - - public void setcType(String cType) { - this.cType = cType; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/DynamicCodeCondition.java b/src/com/sipai/entity/equipment/DynamicCodeCondition.java deleted file mode 100644 index e5d4ba5a..00000000 --- a/src/com/sipai/entity/equipment/DynamicCodeCondition.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -public class DynamicCodeCondition extends SQLAdapter { - - private String tableName; - private String tableColumn; - private String id; - public String getTableName() { - return tableName; - } - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getTableColumn() { - return tableColumn; - } - public void setTableColumn(String tableColumn) { - this.tableColumn = tableColumn; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - -} diff --git a/src/com/sipai/entity/equipment/EquipmentAcceptanceApply.java b/src/com/sipai/entity/equipment/EquipmentAcceptanceApply.java deleted file mode 100644 index 6415fd26..00000000 --- a/src/com/sipai/entity/equipment/EquipmentAcceptanceApply.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentAcceptanceApply extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String warehouseId; - - private String warehouseName; - - private String applyPeopleId; - - private String applyPeopleName; - - private String applyTime; - - private String acceptanceApplyNumber; - - private String processdefid; - - private String processid; - - private String auditId; - - private String auditMan; - - private String status; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getWarehouseName() { - return warehouseName; - } - - public void setWarehouseName(String warehouseName) { - this.warehouseName = warehouseName; - } - - public String getApplyPeopleId() { - return applyPeopleId; - } - - public void setApplyPeopleId(String applyPeopleId) { - this.applyPeopleId = applyPeopleId; - } - - public String getApplyPeopleName() { - return applyPeopleName; - } - - public void setApplyPeopleName(String applyPeopleName) { - this.applyPeopleName = applyPeopleName; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getAcceptanceApplyNumber() { - return acceptanceApplyNumber; - } - - public void setAcceptanceApplyNumber(String acceptanceApplyNumber) { - this.acceptanceApplyNumber = acceptanceApplyNumber; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentAcceptanceApplyDetail.java b/src/com/sipai/entity/equipment/EquipmentAcceptanceApplyDetail.java deleted file mode 100644 index 7367c85c..00000000 --- a/src/com/sipai/entity/equipment/EquipmentAcceptanceApplyDetail.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseRecordDetail; - -public class EquipmentAcceptanceApplyDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String acceptanceApplyNumber; - - private String acceptancePurchaseRecordDetailId; - - private Goods goods; - - private PurchaseRecordDetail purchaseRecordDetail; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getAcceptanceApplyNumber() { - return acceptanceApplyNumber; - } - - public void setAcceptanceApplyNumber(String acceptanceApplyNumber) { - this.acceptanceApplyNumber = acceptanceApplyNumber; - } - - public String getAcceptancePurchaseRecordDetailId() { - return acceptancePurchaseRecordDetailId; - } - - public void setAcceptancePurchaseRecordDetailId(String acceptancePurchaseRecordDetailId) { - this.acceptancePurchaseRecordDetailId = acceptancePurchaseRecordDetailId; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public PurchaseRecordDetail getPurchaseRecordDetail() { - return purchaseRecordDetail; - } - - public void setPurchaseRecordDetail(PurchaseRecordDetail purchaseRecordDetail) { - this.purchaseRecordDetail = purchaseRecordDetail; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentAccident.java b/src/com/sipai/entity/equipment/EquipmentAccident.java deleted file mode 100644 index 1fe370df..00000000 --- a/src/com/sipai/entity/equipment/EquipmentAccident.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentAccident extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String bizId; - - private String accidentNumber; - - private String accidentTime; - - private String accidentPlace; - - private String workerId; - - private String workerName; - - private String accidentDescribe; - - private String accidentReason; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getAccidentNumber() { - return accidentNumber; - } - - public void setAccidentNumber(String accidentNumber) { - this.accidentNumber = accidentNumber; - } - - public String getAccidentTime() { - return accidentTime; - } - - public void setAccidentTime(String accidentTime) { - this.accidentTime = accidentTime; - } - - public String getAccidentPlace() { - return accidentPlace; - } - - public void setAccidentPlace(String accidentPlace) { - this.accidentPlace = accidentPlace; - } - - public String getWorkerId() { - return workerId; - } - - public void setWorkerId(String workerId) { - this.workerId = workerId; - } - - public String getWorkerName() { - return workerName; - } - - public void setWorkerName(String workerName) { - this.workerName = workerName; - } - - public String getAccidentDescribe() { - return accidentDescribe; - } - - public void setAccidentDescribe(String accidentDescribe) { - this.accidentDescribe = accidentDescribe; - } - - public String getAccidentReason() { - return accidentReason; - } - - public void setAccidentReason(String accidentReason) { - this.accidentReason = accidentReason; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentAccidentDetail.java b/src/com/sipai/entity/equipment/EquipmentAccidentDetail.java deleted file mode 100644 index 994a65ff..00000000 --- a/src/com/sipai/entity/equipment/EquipmentAccidentDetail.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class EquipmentAccidentDetail extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String accidentNumber; - - private String equipmentCardId; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getAccidentNumber() { - return accidentNumber; - } - - public void setAccidentNumber(String accidentNumber) { - this.accidentNumber = accidentNumber; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentAge.java b/src/com/sipai/entity/equipment/EquipmentAge.java deleted file mode 100644 index c13246aa..00000000 --- a/src/com/sipai/entity/equipment/EquipmentAge.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; - -public class EquipmentAge extends EquipmentCard{ - private BigDecimal purchaseMoney; - - private Double residualValueRate; - - private BigDecimal maintainIncrement; - - private String bizName; - - private String equipmentClassId; - - private String equipmentCardID; - - private String installDate; - - private Double physicalLife; - - private Double technicalLife; - - private Double economicLife; - - private String physicalLifeTime; - - private String technicalLifeTime; - - private String economicLifeTime; - - private Double alreadyUsedYears;//用于前端颜色判断 ,已使用时长(年) - - private Double warningYears;//用于前端颜色判断 ,预警年限 - - public BigDecimal getPurchaseMoney() { - return purchaseMoney; - } - - public void setPurchaseMoney(BigDecimal purchaseMoney) { - this.purchaseMoney = purchaseMoney; - } - - public Double getResidualValueRate() { - return residualValueRate; - } - - public void setResidualValueRate(Double residualValueRate) { - this.residualValueRate = residualValueRate; - } - - public BigDecimal getMaintainIncrement() { - return maintainIncrement; - } - - public void setMaintainIncrement(BigDecimal maintainIncrement) { - this.maintainIncrement = maintainIncrement; - } - - public String getInstallDate() { - return installDate; - } - - public void setInstallDate(String installDate) { - this.installDate = installDate; - } - - public Double getPhysicalLife() { - return physicalLife; - } - - public void setPhysicalLife(Double physicalLife) { - this.physicalLife = physicalLife; - } - - public Double getTechnicalLife() { - return technicalLife; - } - - public void setTechnicalLife(Double technicalLife) { - this.technicalLife = technicalLife; - } - - public Double getEconomicLife() { - return economicLife; - } - - public void setEconomicLife(Double economicLife) { - this.economicLife = economicLife; - } - - public String getPhysicalLifeTime() { - return physicalLifeTime; - } - - public void setPhysicalLifeTime(String physicalLifeTime) { - this.physicalLifeTime = physicalLifeTime; - } - - public String getTechnicalLifeTime() { - return technicalLifeTime; - } - - public void setTechnicalLifeTime(String technicalLifeTime) { - this.technicalLifeTime = technicalLifeTime; - } - - public String getEconomicLifeTime() { - return economicLifeTime; - } - - public void setEconomicLifeTime(String economicLifeTime) { - this.economicLifeTime = economicLifeTime; - } - - public Double getAlreadyUsedYears() { - return alreadyUsedYears; - } - - public void setAlreadyUsedYears(Double alreadyUsedYears) { - this.alreadyUsedYears = alreadyUsedYears; - } - - public Double getWarningYears() { - return warningYears; - } - - public void setWarningYears(Double warningYears) { - this.warningYears = warningYears; - } - - public String getBizName() { - return bizName; - } - - public void setBizName(String bizName) { - this.bizName = bizName; - } - - public String getEquipmentClassId() { - return equipmentClassId; - } - - public void setEquipmentClassId(String equipmentClassId) { - this.equipmentClassId = equipmentClassId; - } - - public String getEquipmentCardID() { - return equipmentCardID; - } - - public void setEquipmentCardID(String equipmentCardID) { - this.equipmentCardID = equipmentCardID; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentArrangement.java b/src/com/sipai/entity/equipment/EquipmentArrangement.java deleted file mode 100644 index fe54cb27..00000000 --- a/src/com/sipai/entity/equipment/EquipmentArrangement.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -@Component -public class EquipmentArrangement extends SQLAdapter{ - private String id; - - private String workorderid; - private String _workorderno; - - private String taskcode; - - private String insdt; - - private String insuser; - - private String equipmentid; - - private String arrangementdate; - - private String groupManageid; - - private String stdt; - - private String enddt; - - - private String gt_sdt;//班次groupManage的开始时间 - private String gt_enddt;//班次groupManage的结束时间 - private String gt_name;//班次groupManage的名称 - - private boolean checkFlag=true;//默认所有班次都选择 - - - - public String get_workorderno() { - return _workorderno; - } - - public void set_workorderno(String _workorderno) { - this._workorderno = _workorderno; - } - - public boolean isCheckFlag() { - return checkFlag; - } - - public void setCheckFlag(boolean checkFlag) { - this.checkFlag = checkFlag; - } - - public String getGt_sdt() { - return gt_sdt; - } - - public void setGt_sdt(String gt_sdt) { - this.gt_sdt = gt_sdt; - } - - public String getGt_enddt() { - return gt_enddt; - } - - public void setGt_enddt(String gt_enddt) { - this.gt_enddt = gt_enddt; - } - - public String getGt_name() { - return gt_name; - } - - public void setGt_name(String gt_name) { - this.gt_name = gt_name; - } - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - - public String getWorkorderid() { - return workorderid; - } - - public void setWorkorderid(String workorderid) { - this.workorderid = workorderid; - } - - public String getTaskcode() { - return taskcode; - } - - public void setTaskcode(String taskcode) { - this.taskcode = taskcode; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getEquipmentid() { - return equipmentid; - } - - public void setEquipmentid(String equipmentid) { - this.equipmentid = equipmentid; - } - - public String getArrangementdate() { - return arrangementdate; - } - - public void setArrangementdate(String arrangementdate) { - this.arrangementdate = arrangementdate; - } - - public String getGroupManageid() { - return groupManageid; - } - - public void setGroupManageid(String groupManageid) { - this.groupManageid = groupManageid; - } - - public String getStdt() { - return stdt; - } - - public void setStdt(String stdt) { - this.stdt = stdt; - } - - public String getEnddt() { - return enddt; - } - - public void setEnddt(String enddt) { - this.enddt = enddt; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentBelong.java b/src/com/sipai/entity/equipment/EquipmentBelong.java deleted file mode 100644 index 44ed1de6..00000000 --- a/src/com/sipai/entity/equipment/EquipmentBelong.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentBelong extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String belongName; - - private String belongCode; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBelongName() { - return belongName; - } - - public void setBelongName(String belongName) { - this.belongName = belongName; - } - - public String getBelongCode() { - return belongCode; - } - - public void setBelongCode(String belongCode) { - this.belongCode = belongCode; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCard.java b/src/com/sipai/entity/equipment/EquipmentCard.java deleted file mode 100644 index 16632dcb..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCard.java +++ /dev/null @@ -1,1333 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -public class EquipmentCard extends SQLAdapter { - - public static String[] equipmentCardTypeArr = {"生产设备", "特种设备", "仪器仪表", "车辆", "安全工具", "其它"}; - public static String[] equipmentCardCycleUnitArr = {"年", "月", "日"}; - - public static String Status_OFF = "0";//封存 Status_OFF - public static String Status_Fault = "2";//故障异常 - public static String Status_ON = "1";//在用 - public static String Status_Scrap = "3";//报废 - public static String Status_Transfer = "4";//调拨(拨出) - public static String Status_Sale = "5";//出售 - public static String Status_Lose = "6";//丢失 - public static String Status_STOP = "7";//停用 - public static String Status_IN = "8";//拨入 - - public static String equipmentStatus_ON = "在用"; - public static String equipmentStatus_OFF = "闲置"; - public static String equipmentStatus_Stock = "库存"; - public static String equipmentStatus_Scrap = "待报废"; - - public static String ABC_A = "A"; //A类设备 - public static String ABC_B = "B"; //B类设备 - public static String ABC_C = "C"; //C类设备 - - public static Integer CompulsoryStatus_OFF = 0;//无需强检 - public static Integer CompulsoryStatus_ON = 1;//需强检 - - public static String CompulsoryInspectionType_EQUIP = "0"; //特种设备 - public static String CompulsoryInspectionType_APP = "1"; //仪器仪表 - public static String CompulsoryInspectionType_CAR = "2"; //车辆 - - public static String AssetType_MECH = "0"; //机械设备 - public static String AssetType_ELEC = "1"; //电气设备 - public static String AssetType_APP = "2"; //仪器仪表 - public static String AssetType_AUTO = "3"; //自动化控制设备 - public static String AssetType_HALFAUTO = "4"; //半自动化控制设备 - public static String AssetType_INDUS = "5"; //工控计算机 - - public static Integer guaranteeTime = 3; - - public static Integer getGuaranteeTime() { - return guaranteeTime; - } - - public static void setGuaranteeTime(Integer guaranteeTime) { - EquipmentCard.guaranteeTime = guaranteeTime; - } - - - private String id; - private String insuser; - private String insdt; - private String equipmentcardid; - private String equipmentname; - private String equipmentclassid; - private String equipmentmodel; - private String equipmentmodelname; - private String areaid; - private String currentmanageflag; - private String processsectionid; - private String assetclassid; - private String assetnumber; - private String equipmentlevelid; - private String bizid; - private String responsibledepartment; - private Double ratedpower; - private Double ratedcurrent; - private Double ratedvoltage; - private String supplierid; - private String equipmentmanufacturer; - private String leavefactorynumber; - private String productiondate; - private String servicephone; - private String usedate; - private Double useage; - private BigDecimal equipmentvalue; - private BigDecimal residualvalue; - private BigDecimal nowtotaldepreciation; - private String purchasedate; - private String majorparameter; - private String maintenancecondition; - private String pid; - private Double totaltime; - private String equipmentstatus; - private String remark; - private String specification; - private String lng; - private String lat; - private String xCoord; - private String yCoord; - private String patrolStatus;//巡检状态 - private BigDecimal purchaseValue; - private String inCode; // 内部编号 - - //2020-07-04 新增字段 - private String waterNumLong; - private Integer waterNumShort; - private String equipmentCodeId; - - //2020-07-06 新增字段 - //财产归属或项目类别 - private String equipmentBelongId; - //设备大类 - private String equipmentBigClassId; - //设备小类 - private String equipmentSmallClassId; - - private EquipmentBelong equipmentBelong; - - //2020-07-13 start - private String equipmentCardType; - //2020-07-13 end - - //2020-07-16 start - private String firstTime; - private String nextTime; - private String checkCycle; - private String cycleUnit; - //2020-07-16 end - - private String unit; - //财务--部门代码(财务系统中各个部门的代码) - private String code; - - //入库时间 - private String inStockTime; - //领用时间 - private String receiveTime; - //(1表示是0表示否)是否单一资产 - private String isSingleAsset; - - private String equipmentClassCode; - - //拨入编号 - private String equipmentDialinNum; - - //增加方式 - private String addWay; - - //2020-09-08 新增字段 - - private String abcType; - - private String techParameters; - - private String factoryNumber; - - private String openDate; - - private Double serviceLife; - - private Integer isCompulsoryInspection;//是否强检 - - private String compulsoryInspectionType;//强检类型 - - private String assetType; - - private String buyTime; - - private BigDecimal equipWorth; - - private Double depreciationLife; - - private Double residualValueRate; - - private String equipmentStatusMemo; - - private String equipmentLevelCode; - - private String equEntryType; - - private String ifFixedAssets; - - private EquipmentClass equipmentClass; - private GeographyArea geographyarea; - private Company company; - private EquipmentLevel equipmentLevel; - private EquipmentStatusManagement EquipmentStatusManagement; - private ProcessSection processSection; - private AssetClass assetClass; - private EquipmentCard equipmentPid; - private String equipname; - private EquipmentSpecification equipmentSpecification; - private EquipmentTypeNumber equipmentTypeNumber; - private EquipmentCardProp equipmentCardProp; - private List mPoint4APP; - private Integer type; - private String equipmentOutIds; - private Double equipmentSetTime; - private Double equipmentClearTime; - private String installDate; - - private String _processSectionCode; - - private int _useEquipmentAge; - - //构筑物相关 - private String structureId; - - /** - * 下面是三维使用 - */ - private String controlId; - private String powerId; - private String controlName; - private String powerName; - - //2021.4.26 用于导入导出 - private EquipmentCard equipmentCard; - private EquipmentTypeNumber equType; - private String _assetclassname; - private String _equipmentnumber1; - private BigDecimal _purchaseValue1; - - private String _equipmentBelongName; - - private JSONArray mpointArray; - - public String getControlId() { - return controlId; - } - - public void setControlId(String controlId) { - this.controlId = controlId; - } - - public String getPowerId() { - return powerId; - } - - public void setPowerId(String powerId) { - this.powerId = powerId; - } - - public String getControlName() { - return controlName; - } - - public void setControlName(String controlName) { - this.controlName = controlName; - } - - public String getPowerName() { - return powerName; - } - - public void setPowerName(String powerName) { - this.powerName = powerName; - } - - public JSONArray getMpointArray() { - return mpointArray; - } - - public void setMpointArray(JSONArray mpointArray) { - this.mpointArray = mpointArray; - } - - public String get_equipmentnumber1() { - return _equipmentnumber1; - } - - public void set_equipmentnumber1(String _equipmentnumber1) { - this._equipmentnumber1 = _equipmentnumber1; - } - - public BigDecimal get_purchaseValue1() { - return _purchaseValue1; - } - - public void set_purchaseValue1(BigDecimal _purchaseValue1) { - this._purchaseValue1 = _purchaseValue1; - } - - public EquipmentTypeNumber getEquType() { - return equType; - } - - public void setEquType(EquipmentTypeNumber equType) { - this.equType = equType; - } - - public String get_assetclassname() { - return _assetclassname; - } - - public void set_assetclassname(String _assetclassname) { - this._assetclassname = _assetclassname; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getEquEntryType() { - return equEntryType; - } - - public void setEquEntryType(String equEntryType) { - this.equEntryType = equEntryType; - } - - public String getIfFixedAssets() { - return ifFixedAssets; - } - - public void setIfFixedAssets(String ifFixedAssets) { - this.ifFixedAssets = ifFixedAssets; - } - - public int get_useEquipmentAge() { - return _useEquipmentAge; - } - - public void set_useEquipmentAge(int _useEquipmentAge) { - this._useEquipmentAge = _useEquipmentAge; - } - - public String get_processSectionCode() { - return _processSectionCode; - } - - public void set_processSectionCode(String _processSectionCode) { - this._processSectionCode = _processSectionCode; - } - - public String getEquipmentOutIds() { - return equipmentOutIds; - } - - public void setEquipmentOutIds(String equipmentOutIds) { - this.equipmentOutIds = equipmentOutIds; - } - - public Double getEquipmentSetTime() { - return equipmentSetTime; - } - - public void setEquipmentSetTime(Double equipmentSetTime) { - this.equipmentSetTime = equipmentSetTime; - } - - public Double getEquipmentClearTime() { - return equipmentClearTime; - } - - public void setEquipmentClearTime(Double equipmentClearTime) { - this.equipmentClearTime = equipmentClearTime; - } - - - private Double _equipmentValueAll; - - private Integer _equfixnum; - - public Integer get_equfixnum() { - return _equfixnum; - } - - public void set_equfixnum(Integer _equfixnum) { - this._equfixnum = _equfixnum; - } - - public Double get_equipmentValueAll() { - return _equipmentValueAll; - } - - public void set_equipmentValueAll(Double _equipmentValueAll) { - this._equipmentValueAll = _equipmentValueAll; - } - - public String getPatrolStatus() { - return patrolStatus; - } - - public void setPatrolStatus(String patrolStatus) { - this.patrolStatus = patrolStatus; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getEquipmentcardid() { - return equipmentcardid; - } - - public void setEquipmentcardid(String equipmentcardid) { - this.equipmentcardid = equipmentcardid; - } - - public String getEquipmentname() { - return equipmentname; - } - - public void setEquipmentname(String equipmentname) { - this.equipmentname = equipmentname; - } - - public String getEquipmentclassid() { - return equipmentclassid; - } - - public void setEquipmentclassid(String equipmentclassid) { - this.equipmentclassid = equipmentclassid; - } - - public String getEquipmentmodel() { - return equipmentmodel; - } - - public void setEquipmentmodel(String equipmentmodel) { - this.equipmentmodel = equipmentmodel; - } - - public String getEquipmentmodelname() { - return equipmentmodelname; - } - - public void setEquipmentmodelname(String equipmentmodelname) { - this.equipmentmodelname = equipmentmodelname; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public String getCurrentmanageflag() { - return currentmanageflag; - } - - public void setCurrentmanageflag(String currentmanageflag) { - this.currentmanageflag = currentmanageflag; - } - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid; - } - - public String getAssetclassid() { - return assetclassid; - } - - public void setAssetclassid(String assetclassid) { - this.assetclassid = assetclassid; - } - - public String getAssetnumber() { - return assetnumber; - } - - public void setAssetnumber(String assetnumber) { - this.assetnumber = assetnumber; - } - - public String getEquipmentlevelid() { - return equipmentlevelid; - } - - public void setEquipmentlevelid(String equipmentlevelid) { - this.equipmentlevelid = equipmentlevelid; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getResponsibledepartment() { - return responsibledepartment; - } - - public void setResponsibledepartment(String responsibledepartment) { - this.responsibledepartment = responsibledepartment; - } - - public Double getRatedpower() { - return ratedpower; - } - - public void setRatedpower(Double ratedpower) { - this.ratedpower = ratedpower; - } - - public Double getRatedcurrent() { - return ratedcurrent; - } - - public void setRatedcurrent(Double ratedcurrent) { - this.ratedcurrent = ratedcurrent; - } - - public Double getRatedvoltage() { - return ratedvoltage; - } - - public void setRatedvoltage(Double ratedvoltage) { - this.ratedvoltage = ratedvoltage; - } - - public String getSupplierid() { - return supplierid; - } - - public void setSupplierid(String supplierid) { - this.supplierid = supplierid; - } - - public String getEquipmentmanufacturer() { - return equipmentmanufacturer; - } - - public void setEquipmentmanufacturer(String equipmentmanufacturer) { - this.equipmentmanufacturer = equipmentmanufacturer; - } - - public String getLeavefactorynumber() { - return leavefactorynumber; - } - - public void setLeavefactorynumber(String leavefactorynumber) { - this.leavefactorynumber = leavefactorynumber; - } - - public String getProductiondate() { - return productiondate; - } - - public void setProductiondate(String productiondate) { - this.productiondate = productiondate; - } - - public String getServicephone() { - return servicephone; - } - - public void setServicephone(String servicephone) { - this.servicephone = servicephone; - } - - public String getUsedate() { - return usedate; - } - - public void setUsedate(String usedate) { - this.usedate = usedate; - } - - public Double getUseage() { - return useage; - } - - public void setUseage(Double useage) { - this.useage = useage; - } - - public BigDecimal getEquipmentvalue() { - return equipmentvalue; - } - - public void setEquipmentvalue(BigDecimal equipmentvalue) { - this.equipmentvalue = equipmentvalue; - } - - public BigDecimal getResidualvalue() { - return residualvalue; - } - - public void setResidualvalue(BigDecimal residualvalue) { - this.residualvalue = residualvalue; - } - - public BigDecimal getNowtotaldepreciation() { - return nowtotaldepreciation; - } - - public void setNowtotaldepreciation(BigDecimal nowtotaldepreciation) { - this.nowtotaldepreciation = nowtotaldepreciation; - } - - public String getPurchasedate() { - return purchasedate; - } - - public void setPurchasedate(String purchasedate) { - this.purchasedate = purchasedate; - } - - public String getMajorparameter() { - return majorparameter; - } - - public void setMajorparameter(String majorparameter) { - this.majorparameter = majorparameter; - } - - public String getMaintenancecondition() { - return maintenancecondition; - } - - public void setMaintenancecondition(String maintenancecondition) { - this.maintenancecondition = maintenancecondition; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Double getTotaltime() { - return totaltime; - } - - public void setTotaltime(Double totaltime) { - this.totaltime = totaltime; - } - - public String getEquipmentstatus() { - return equipmentstatus; - } - - public void setEquipmentstatus(String equipmentstatus) { - this.equipmentstatus = equipmentstatus; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getSpecification() { - return specification; - } - - public void setSpecification(String specification) { - this.specification = specification; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getxCoord() { - return xCoord; - } - - public void setxCoord(String xCoord) { - this.xCoord = xCoord; - } - - public String getyCoord() { - return yCoord; - } - - public void setyCoord(String yCoord) { - this.yCoord = yCoord; - } - - public EquipmentClass getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(EquipmentClass equipmentClass) { - this.equipmentClass = equipmentClass; - } - - public GeographyArea getGeographyarea() { - return geographyarea; - } - - public void setGeographyarea(GeographyArea geographyarea) { - this.geographyarea = geographyarea; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentLevel getEquipmentLevel() { - return equipmentLevel; - } - - public void setEquipmentLevel(EquipmentLevel equipmentLevel) { - this.equipmentLevel = equipmentLevel; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public AssetClass getAssetClass() { - return assetClass; - } - - public void setAssetClass(AssetClass assetClass) { - this.assetClass = assetClass; - } - - public EquipmentCard getEquipmentPid() { - return equipmentPid; - } - - public void setEquipmentPid(EquipmentCard equipmentPid) { - this.equipmentPid = equipmentPid; - } - - public EquipmentSpecification getEquipmentSpecification() { - return equipmentSpecification; - } - - public void setEquipmentSpecification( - EquipmentSpecification equipmentSpecification) { - this.equipmentSpecification = equipmentSpecification; - } - - public EquipmentTypeNumber getEquipmentTypeNumber() { - return equipmentTypeNumber; - } - - public void setEquipmentTypeNumber(EquipmentTypeNumber equipmentTypeNumber) { - this.equipmentTypeNumber = equipmentTypeNumber; - } - - public EquipmentCardProp getEquipmentCardProp() { - return equipmentCardProp; - } - - public void setEquipmentCardProp(EquipmentCardProp equipmentCardProp) { - this.equipmentCardProp = equipmentCardProp; - } - - public List getmPoint4APP() { - return mPoint4APP; - } - - public void setmPoint4APP(List mPoint4APP) { - this.mPoint4APP = mPoint4APP; - } - - public String getWaterNumLong() { - return waterNumLong; - } - - public void setWaterNumLong(String waterNumLong) { - this.waterNumLong = waterNumLong; - } - - public Integer getWaterNumShort() { - return waterNumShort; - } - - public void setWaterNumShort(Integer waterNumShort) { - this.waterNumShort = waterNumShort; - } - - public String getEquipmentCodeId() { - return equipmentCodeId; - } - - public void setEquipmentCodeId(String equipmentCodeId) { - this.equipmentCodeId = equipmentCodeId; - } - - public String getEquipmentBelongId() { - return equipmentBelongId; - } - - public void setEquipmentBelongId(String equipmentBelongId) { - this.equipmentBelongId = equipmentBelongId; - } - - public String getEquipmentBigClassId() { - return equipmentBigClassId; - } - - public void setEquipmentBigClassId(String equipmentBigClassId) { - this.equipmentBigClassId = equipmentBigClassId; - } - - public String getEquipmentSmallClassId() { - return equipmentSmallClassId; - } - - public void setEquipmentSmallClassId(String equipmentSmallClassId) { - this.equipmentSmallClassId = equipmentSmallClassId; - } - - public EquipmentBelong getEquipmentBelong() { - return equipmentBelong; - } - - public void setEquipmentBelong(EquipmentBelong equipmentBelong) { - this.equipmentBelong = equipmentBelong; - } - - public String getEquipmentCardType() { - return equipmentCardType; - } - - public void setEquipmentCardType(String equipmentCardType) { - this.equipmentCardType = equipmentCardType; - } - - public String getFirstTime() { - return firstTime; - } - - public void setFirstTime(String firstTime) { - this.firstTime = firstTime; - } - - public String getNextTime() { - return nextTime; - } - - public void setNextTime(String nextTime) { - this.nextTime = nextTime; - } - - public String getCheckCycle() { - return checkCycle; - } - - public void setCheckCycle(String checkCycle) { - this.checkCycle = checkCycle; - } - - public String getCycleUnit() { - return cycleUnit; - } - - public void setCycleUnit(String cycleUnit) { - this.cycleUnit = cycleUnit; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - - public String getInStockTime() { - return inStockTime; - } - - public void setInStockTime(String inStockTime) { - this.inStockTime = inStockTime; - } - - public String getReceiveTime() { - return receiveTime; - } - - public void setReceiveTime(String receiveTime) { - this.receiveTime = receiveTime; - } - - public String getIsSingleAsset() { - return isSingleAsset; - } - - public void setIsSingleAsset(String isSingleAsset) { - this.isSingleAsset = isSingleAsset; - } - - - public String getEquipmentClassCode() { - return equipmentClassCode; - } - - public void setEquipmentClassCode(String equipmentClassCode) { - this.equipmentClassCode = equipmentClassCode; - } - - public String getEquipmentDialinNum() { - return equipmentDialinNum; - } - - public void setEquipmentDialinNum(String equipmentDialinNum) { - this.equipmentDialinNum = equipmentDialinNum; - } - - - public String getAddWay() { - return addWay; - } - - public void setAddWay(String addWay) { - this.addWay = addWay; - } - - public String getAbcType() { - return abcType; - } - - public void setAbcType(String abcType) { - this.abcType = abcType; - } - - public String getTechParameters() { - return techParameters; - } - - public void setTechParameters(String techParameters) { - this.techParameters = techParameters; - } - - public String getFactoryNumber() { - return factoryNumber; - } - - public void setFactoryNumber(String factoryNumber) { - this.factoryNumber = factoryNumber; - } - - public String getOpenDate() { - return openDate; - } - - public void setOpenDate(String openDate) { - this.openDate = openDate; - } - - public Double getServiceLife() { - return serviceLife; - } - - public void setServiceLife(Double serviceLife) { - this.serviceLife = serviceLife; - } - - public Integer getIsCompulsoryInspection() { - return isCompulsoryInspection; - } - - public void setIsCompulsoryInspection(Integer isCompulsoryInspection) { - this.isCompulsoryInspection = isCompulsoryInspection; - } - - public String getCompulsoryInspectionType() { - return compulsoryInspectionType; - } - - public void setCompulsoryInspectionType(String compulsoryInspectionType) { - this.compulsoryInspectionType = compulsoryInspectionType; - } - - public String getAssetType() { - return assetType; - } - - public void setAssetType(String assetType) { - this.assetType = assetType; - } - - public String getBuyTime() { - return buyTime; - } - - public void setBuyTime(String buyTime) { - this.buyTime = buyTime; - } - - public BigDecimal getEquipWorth() { - return equipWorth; - } - - public void setEquipWorth(BigDecimal equipWorth) { - this.equipWorth = equipWorth; - } - - public Double getDepreciationLife() { - return depreciationLife; - } - - public void setDepreciationLife(Double depreciationLife) { - this.depreciationLife = depreciationLife; - } - - public Double getResidualValueRate() { - return residualValueRate; - } - - public void setResidualValueRate(Double residualValueRate) { - this.residualValueRate = residualValueRate; - } - - public String getEquipmentStatusMemo() { - return equipmentStatusMemo; - } - - public void setEquipmentStatusMemo(String equipmentStatusMemo) { - this.equipmentStatusMemo = equipmentStatusMemo; - } - - public String getEquipmentLevelCode() { - return equipmentLevelCode; - } - - public void setEquipmentLevelCode(String equipmentLevelCode) { - this.equipmentLevelCode = equipmentLevelCode; - } - - public EquipmentStatusManagement getEquipmentStatusManagement() { - return EquipmentStatusManagement; - } - - public void setEquipmentStatusManagement( - EquipmentStatusManagement equipmentStatusManagement) { - EquipmentStatusManagement = equipmentStatusManagement; - } - - public String getInstallDate() { - return installDate; - } - - public void setInstallDate(String installDate) { - this.installDate = installDate; - } - - public String get_equipmentBelongName() { - return _equipmentBelongName; - } - - public void set_equipmentBelongName(String _equipmentBelongName) { - this._equipmentBelongName = _equipmentBelongName; - } - - public static String[] downloadPlaceEquipmentCompanyExcelTitleArr = { - "固定资产编码", - "固定资产名称", - "固定资产类型编码", - "部门编码", - "增加方式编码", - "使用状况编码", - "使用年限", - "使用比例", - "折旧方法编码", - "开始使用日期", - "币种", - "汇率", - "原值", - "规格型号", - "存放地点", - "累计折旧", - "项目大类", - "工作总量", - "累计工作量", - "工作量单位", - "已使用月份", - "外币原值", - "净残值率", - "净残值", - "折旧科目编码", - "项目编码", - "电机功率", - "电机数量", - "间数", - "建筑面积", - "录入日期", - "录入员", - - "原始资产编码", - "采购日期", - "代销单位", - "原始凭证号", - "制造厂商", - "数量", - "计量单位", - "汽车牌照", - "设备编号", - "设备UUID", - }; - - - public static String[] downloadPlaceEquipmentExcelTitleArr = { - "卡片编号", - "资产名称", - "资产代码", - "设备ID", - "设备编码", - "类别代码", - "类别名称", - "原值", - "计量单位", - "开始使用日期", - "部门代码", - "部门名称", - "使用部门代码", - "使用部门", - "已用月份", - "资产类型代码", - "资产类型名称", - "使用状况", - "增加方式", - "数量", - "R9i资产启用日期", - "公司代码", - "对应折旧科目", - "是否已注销", - "型号", - "保存地点", - "累计工作量", - "工作总量", - "工作量单位", - "等级", - "月折旧率", - "月折旧额", - "净残值", - "净值", - "净残值率", - "预计清理费", - "重估增值", - "累计折旧", - "预计使用年限", - "折旧方法", - "资产来源", - "货币单位", - "已计提月份", - "建筑面积", - "间(座)数", - "电机功率", - "制造厂家", - "出厂日期", - "车牌照号", - "项目", - "减少方式", - "录入人", - "录入日期", - "是否已编制凭证", - "是否已审核", - "审核人", - "注销人", - "注销日期", - "记账凭证号", - "减值准备", - "图片路径", - "备注", - "使用人", - "土地面积", - "权属证书所有权人", - "发证日期", - "土地证载明面积", - "入帐形式", - "土地来源", - "产权形式", - "自用面积", - "后勤面积", - "出租面积", - "出借面积", - "闲置面积", - "其他", - "使用方向", - "坐落位置", - "权属性质", - "文物等级", - "车辆产地", - "权属证书发证时间", - "权属所有人", - "厂牌型号", - "排气量", - "行驶里程", - "车辆分类用途", - "编制情况", - "建筑结构", - "单位负担费用面积", - "计算机机房面积", - "会议室面积", - "车库面积", - "食堂用房面积", - "配电房面积", - "使用面积", - "地下面积", - "地下使用面积", - "竣工日期", - "投入使用日期", - "资产状态", - "处置方式", - "保修截止日期", - "权属证书编号", - "房屋建筑物占用面积", - "管理部门", - "构建时间", - "集中供热面积", - "自供暖面积", - "价值类型", - "购入价值", - "购买批文号", - "购置时间", - "供应商", - "存放地点", - "事项经办人", - "发动机号码", - "原卡片代码", - "占地面积", - "办公用房面积", - "其他特殊业务面积", - "取得日期", - "后勤面积", - "资产大类", - "东至", - "西至", - "南至", - "北至", - "资产图片", - "单位名称", - "是否拆分卡片", - }; - - public String getEquipname() { - return equipname; - } - - public void setEquipname(String equipname) { - this.equipname = equipname; - } - - public BigDecimal getPurchaseValue() { - return purchaseValue; - } - - public void setPurchaseValue(BigDecimal purchaseValue) { - this.purchaseValue = purchaseValue; - } - - public String getStructureId() { - return structureId; - } - - public void setStructureId(String structureId) { - this.structureId = structureId; - } - - public String getInCode() { - return inCode; - } - - public void setInCode(String inCode) { - this.inCode = inCode; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCardCamera.java b/src/com/sipai/entity/equipment/EquipmentCardCamera.java deleted file mode 100644 index 92411178..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCardCamera.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.Camera; - -public class EquipmentCardCamera extends SQLAdapter { - private String id; - - private String eqid; - - private String cameraid; - - private Integer morder; - - private Camera camera; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEqid() { - return eqid; - } - - public void setEqid(String eqid) { - this.eqid = eqid; - } - - public String getCameraid() { - return cameraid; - } - - public void setCameraid(String cameraid) { - this.cameraid = cameraid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCardLinks.java b/src/com/sipai/entity/equipment/EquipmentCardLinks.java deleted file mode 100644 index 51a68212..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCardLinks.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class EquipmentCardLinks extends SQLAdapter { - - public static String Status_OFF="未配置"; - public static String Status_ON="已配置"; - - private String linkIpIntranet; - - private String linkIpExtranet; - - private String equipmentId; - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getLinkIpIntranet() { - return linkIpIntranet; - } - - public void setLinkIpIntranet(String linkIpIntranet) { - this.linkIpIntranet = linkIpIntranet; - } - - public String getLinkIpExtranet() { - return linkIpExtranet; - } - - public void setLinkIpExtranet(String linkIpExtranet) { - this.linkIpExtranet = linkIpExtranet; - } - - private String id; - - private String insuser; - - private String insdt; - - private String linkUrl; - - private String linkName; - - private String linkType; - - private String linkReturn; - - private String remarks; - - private Integer version; - - private Integer morder; - - private String active; - - private String bizid; - - private List LinksParameterList; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getLinkUrl() { - return linkUrl; - } - - public void setLinkUrl(String linkUrl) { - this.linkUrl = linkUrl; - } - - public String getLinkName() { - return linkName; - } - - public void setLinkName(String linkName) { - this.linkName = linkName; - } - - public String getLinkType() { - return linkType; - } - - public void setLinkType(String linkType) { - this.linkType = linkType; - } - - public String getLinkReturn() { - return linkReturn; - } - - public void setLinkReturn(String linkReturn) { - this.linkReturn = linkReturn; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public List getLinksParameterList() { - return LinksParameterList; - } - - public void setLinksParameterList( - List linksParameterList) { - LinksParameterList = linksParameterList; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCardLinksParameter.java b/src/com/sipai/entity/equipment/EquipmentCardLinksParameter.java deleted file mode 100644 index 040bf17e..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCardLinksParameter.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class EquipmentCardLinksParameter extends SQLAdapter { - - private String dynamic; - - public String getDynamic() { - return dynamic; - } - - public void setDynamic(String dynamic) { - this.dynamic = dynamic; - } - - private String id; - - private String insdt; - - private String insuser; - - private String linkId; - - private String parameter; - - private String parameterValue; - - private String parameterType; - - private String remarks; - - private Integer version; - - private Integer morder; - - private String active; - - private String equipmentId; - - private String parameterValueType; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getLinkId() { - return linkId; - } - - public void setLinkId(String linkId) { - this.linkId = linkId; - } - - public String getParameter() { - return parameter; - } - - public void setParameter(String parameter) { - this.parameter = parameter; - } - - public String getParameterValue() { - return parameterValue; - } - - public void setParameterValue(String parameterValue) { - this.parameterValue = parameterValue; - } - - public String getParameterType() { - return parameterType; - } - - public void setParameterType(String parameterType) { - this.parameterType = parameterType; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getParameterValueType() { - return parameterValueType; - } - - public void setParameterValueType(String parameterValueType) { - this.parameterValueType = parameterValueType; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCardProp.java b/src/com/sipai/entity/equipment/EquipmentCardProp.java deleted file mode 100644 index f45b2869..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCardProp.java +++ /dev/null @@ -1,485 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentCardProp extends SQLAdapter{ - - private String contractId; - - private String _contractName; - - public String getContractId() { - return contractId; - } - - public void setContractId(String contractId) { - this.contractId = contractId; - } - - public String get_contractName() { - return _contractName; - } - - public void set_contractName(String _contractName) { - this._contractName = _contractName; - } - - private String id; - - private String insuser; - - private String insdt; - - private String equipmentId; - - private BigDecimal energyMoney; - - private BigDecimal repairMoney; - - private BigDecimal maintainMoney; - - private BigDecimal laborMoney; - - private BigDecimal purchaseMoney; - - private Double residualValueRate; - - private Double useTime; - - private Double faultStopTime; - - private String installDate; - - private Double runTime; - - private Double repairNumber; - - private Double faultNumber; - - private Double intactRate; - - private Double instantFlow; - - private Double en; - - private Double outputFlow; - - private Double physicalLife; - - private Double technicalLife; - - private Double economicLife; - - private BigDecimal maintainIncrement; - - private BigDecimal monthDepreciationRate; - - private BigDecimal yearDepreciationRate; - - private BigDecimal monthDepreciation; - - private BigDecimal yearDepreciation; - - private BigDecimal totalDepreciation; - - private BigDecimal currentValue; - - private BigDecimal residualValue; - - private BigDecimal increaseValue; - - private BigDecimal netSalvageValue; - - private String isBackup; - - private Integer keynum; - - private String specification; - - private Integer _state; - - private String estimatedLife; - - private String cardTypeId; - - private String bookkeepVoucher; - - private String equLogoutDate; - - private String ifFixedAssets; - - private String equUserDepartment; - - private EquipmentSpecification equipmentSpecification; - - private String taxAmount; - - - - public String getTaxAmount() { - return taxAmount; - } - - public void setTaxAmount(String taxAmount) { - this.taxAmount = taxAmount; - } - - public String getEstimatedLife() { - return estimatedLife; - } - - public void setEstimatedLife(String estimatedLife) { - this.estimatedLife = estimatedLife; - } - - public String getCardTypeId() { - return cardTypeId; - } - - public void setCardTypeId(String cardTypeId) { - this.cardTypeId = cardTypeId; - } - - public String getBookkeepVoucher() { - return bookkeepVoucher; - } - - public void setBookkeepVoucher(String bookkeepVoucher) { - this.bookkeepVoucher = bookkeepVoucher; - } - - - - public String getEquLogoutDate() { - return equLogoutDate; - } - - public void setEquLogoutDate(String equLogoutDate) { - this.equLogoutDate = equLogoutDate; - } - - public String getIfFixedAssets() { - return ifFixedAssets; - } - - public void setIfFixedAssets(String ifFixedAssets) { - this.ifFixedAssets = ifFixedAssets; - } - - public String getEquUserDepartment() { - return equUserDepartment; - } - - public void setEquUserDepartment(String equUserDepartment) { - this.equUserDepartment = equUserDepartment; - } - - public BigDecimal getMonthDepreciationRate() { - return monthDepreciationRate; - } - - public void setMonthDepreciationRate(BigDecimal monthDepreciationRate) { - this.monthDepreciationRate = monthDepreciationRate; - } - - public BigDecimal getYearDepreciationRate() { - return yearDepreciationRate; - } - - public void setYearDepreciationRate(BigDecimal yearDepreciationRate) { - this.yearDepreciationRate = yearDepreciationRate; - } - - public BigDecimal getMonthDepreciation() { - return monthDepreciation; - } - - public void setMonthDepreciation(BigDecimal monthDepreciation) { - this.monthDepreciation = monthDepreciation; - } - - public BigDecimal getYearDepreciation() { - return yearDepreciation; - } - - public void setYearDepreciation(BigDecimal yearDepreciation) { - this.yearDepreciation = yearDepreciation; - } - - public BigDecimal getTotalDepreciation() { - return totalDepreciation; - } - - public void setTotalDepreciation(BigDecimal totalDepreciation) { - this.totalDepreciation = totalDepreciation; - } - - public BigDecimal getCurrentValue() { - return currentValue; - } - - public void setCurrentValue(BigDecimal currentValue) { - this.currentValue = currentValue; - } - - public BigDecimal getResidualValue() { - return residualValue; - } - - public void setResidualValue(BigDecimal residualValue) { - this.residualValue = residualValue; - } - - public BigDecimal getIncreaseValue() { - return increaseValue; - } - - public void setIncreaseValue(BigDecimal increaseValue) { - this.increaseValue = increaseValue; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public BigDecimal getEnergyMoney() { - return energyMoney; - } - - public void setEnergyMoney(BigDecimal energyMoney) { - this.energyMoney = energyMoney; - } - - public BigDecimal getRepairMoney() { - return repairMoney; - } - - public void setRepairMoney(BigDecimal repairMoney) { - this.repairMoney = repairMoney; - } - - public BigDecimal getMaintainMoney() { - return maintainMoney; - } - - public void setMaintainMoney(BigDecimal maintainMoney) { - this.maintainMoney = maintainMoney; - } - - public BigDecimal getLaborMoney() { - return laborMoney; - } - - public void setLaborMoney(BigDecimal laborMoney) { - this.laborMoney = laborMoney; - } - - public BigDecimal getPurchaseMoney() { - return purchaseMoney; - } - - public void setPurchaseMoney(BigDecimal purchaseMoney) { - this.purchaseMoney = purchaseMoney; - } - - public Double getResidualValueRate() { - return residualValueRate; - } - - public void setResidualValueRate(Double residualValueRate) { - this.residualValueRate = residualValueRate; - } - - public Double getUseTime() { - return useTime; - } - - public void setUseTime(Double useTime) { - this.useTime = useTime; - } - - public Double getFaultStopTime() { - return faultStopTime; - } - - public void setFaultStopTime(Double faultStopTime) { - this.faultStopTime = faultStopTime; - } - - public String getInstallDate() { - return installDate; - } - - public void setInstallDate(String installDate) { - this.installDate = installDate; - } - - public Double getRunTime() { - return runTime; - } - - public void setRunTime(Double runTime) { - this.runTime = runTime; - } - - public Double getRepairNumber() { - return repairNumber; - } - - public void setRepairNumber(Double repairNumber) { - this.repairNumber = repairNumber; - } - - public Double getFaultNumber() { - return faultNumber; - } - - public void setFaultNumber(Double faultNumber) { - this.faultNumber = faultNumber; - } - - public Double getIntactRate() { - return intactRate; - } - - public void setIntactRate(Double intactRate) { - this.intactRate = intactRate; - } - - public Double getInstantFlow() { - return instantFlow; - } - - public void setInstantFlow(Double instantFlow) { - this.instantFlow = instantFlow; - } - - public Double getEn() { - return en; - } - - public void setEn(Double en) { - this.en = en; - } - - public Double getOutputFlow() { - return outputFlow; - } - - public void setOutputFlow(Double outputFlow) { - this.outputFlow = outputFlow; - } - - public Double getPhysicalLife() { - return physicalLife; - } - - public void setPhysicalLife(Double physicalLife) { - this.physicalLife = physicalLife; - } - - public Double getTechnicalLife() { - return technicalLife; - } - - public void setTechnicalLife(Double technicalLife) { - this.technicalLife = technicalLife; - } - - public Double getEconomicLife() { - return economicLife; - } - - public void setEconomicLife(Double economicLife) { - this.economicLife = economicLife; - } - - public BigDecimal getMaintainIncrement() { - return maintainIncrement; - } - - public void setMaintainIncrement(BigDecimal maintainIncrement) { - this.maintainIncrement = maintainIncrement; - } - - public BigDecimal getNetSalvageValue() { - return netSalvageValue; - } - - public void setNetSalvageValue(BigDecimal netSalvageValue) { - this.netSalvageValue = netSalvageValue; - } - - public String getIsBackup() { - return isBackup; - } - - public void setIsBackup(String isBackup) { - this.isBackup = isBackup; - } - - public Integer getKeynum() { - return keynum; - } - - public void setKeynum(Integer keynum) { - this.keynum = keynum; - } - - public String getSpecification() { - return specification; - } - - public void setSpecification(String specification) { - this.specification = specification; - } - - public Integer get_state() { - return _state; - } - - public void set_state(Integer _state) { - this._state = _state; - } - - public EquipmentSpecification getEquipmentSpecification() { - return equipmentSpecification; - } - - public void setEquipmentSpecification( - EquipmentSpecification equipmentSpecification) { - this.equipmentSpecification = equipmentSpecification; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCardRemark.java b/src/com/sipai/entity/equipment/EquipmentCardRemark.java deleted file mode 100644 index 55dc333e..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCardRemark.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -public class EquipmentCardRemark { - private String id; - - private String name; - - private String content; - - private String insUser; - - private String insdt; - - private String cardId; - - private String userName; - - private String where; - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } - - public String getInsUser() { - return insUser; - } - - public void setInsUser(String insUser) { - this.insUser = insUser == null ? null : insUser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getCardId() { - return cardId; - } - - public void setCardId(String cardId) { - this.cardId = cardId == null ? null : cardId.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCardTree.java b/src/com/sipai/entity/equipment/EquipmentCardTree.java deleted file mode 100644 index fc70dc2b..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCardTree.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.equipment; - -public class EquipmentCardTree { - - private String uid; - - private String id; - - private String name; - - private String pid; - - private String flag; - - public String getUid() { - return uid; - } - - public void setUid(String uid) { - this.uid = uid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - -} diff --git a/src/com/sipai/entity/equipment/EquipmentClass.java b/src/com/sipai/entity/equipment/EquipmentClass.java deleted file mode 100644 index 32c24985..00000000 --- a/src/com/sipai/entity/equipment/EquipmentClass.java +++ /dev/null @@ -1,307 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -//设备类型 -public class EquipmentClass extends SQLAdapter { - private String id; - - private String name; - - private String insdt; - - private String insuser; - - private String remark;//备注 - - private String unit;//计算单位 如:台 - - private String active;//启用状态 - - private String pid; - - private String bizidId; - - private String unitId; - - private String equipmentClassCode; - - private String equipmentClassCodeFull;//equipmentClassCode只存独立的编号 equipmentClassCodeFull为完整编号 - - private String equipmentLevelId;//设备等级Id 如 ABC类 - - private Integer morder;//排序 - - private String type;//类别 定义设备种类、设备、部位等 CommString类中有常量定义 - - private EquipmentClassProp equipmentClassProp; - - private EquipmentLevel equipmentLevel; - - private String _pname; - - - private String b_id; - private String b_code; - private String b_name; - private String b_remark; - private String s_id; - private String s_code; - private String s_name; - private String s_remark; - private String p_id; - private String p_code; - private String p_name; - - private String assetClassId;//资产类型ID - private String _assetClassname; - - - public String get_assetClassname() { - return _assetClassname; - } - - public void set_assetClassname(String _assetClassname) { - this._assetClassname = _assetClassname; - } - - public String getAssetClassId() { - return assetClassId; - } - - public void setAssetClassId(String assetClassId) { - this.assetClassId = assetClassId; - } - - public String getB_remark() { - return b_remark; - } - - public void setB_remark(String b_remark) { - this.b_remark = b_remark; - } - - public String getS_remark() { - return s_remark; - } - - public void setS_remark(String s_remark) { - this.s_remark = s_remark; - } - - public String getB_id() { - return b_id; - } - - public void setB_id(String b_id) { - this.b_id = b_id; - } - - public String getB_code() { - return b_code; - } - - public void setB_code(String b_code) { - this.b_code = b_code; - } - - public String getB_name() { - return b_name; - } - - public void setB_name(String b_name) { - this.b_name = b_name; - } - - public String getS_id() { - return s_id; - } - - public void setS_id(String s_id) { - this.s_id = s_id; - } - - public String getS_code() { - return s_code; - } - - public void setS_code(String s_code) { - this.s_code = s_code; - } - - public String getS_name() { - return s_name; - } - - public void setS_name(String s_name) { - this.s_name = s_name; - } - - public String getP_id() { - return p_id; - } - - public void setP_id(String p_id) { - this.p_id = p_id; - } - - public String getP_code() { - return p_code; - } - - public void setP_code(String p_code) { - this.p_code = p_code; - } - - public String getP_name() { - return p_name; - } - - public void setP_name(String p_name) { - this.p_name = p_name; - } - - public String getEquipmentClassCodeFull() { - return equipmentClassCodeFull; - } - - public void setEquipmentClassCodeFull(String equipmentClassCodeFull) { - this.equipmentClassCodeFull = equipmentClassCodeFull; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public EquipmentLevel getEquipmentLevel() { - return equipmentLevel; - } - - public void setEquipmentLevel(EquipmentLevel equipmentLevel) { - this.equipmentLevel = equipmentLevel; - } - - public String getEquipmentLevelId() { - return equipmentLevelId; - } - - public void setEquipmentLevelId(String equipmentLevelId) { - this.equipmentLevelId = equipmentLevelId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBizidId() { - return bizidId; - } - - public void setBizidId(String bizidId) { - this.bizidId = bizidId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public EquipmentClassProp getEquipmentClassProp() { - return equipmentClassProp; - } - - public void setEquipmentClassProp(EquipmentClassProp equipmentClassProp) { - this.equipmentClassProp = equipmentClassProp; - } - - public String getEquipmentClassCode() { - return equipmentClassCode; - } - - public void setEquipmentClassCode(String equipmentClassCode) { - this.equipmentClassCode = equipmentClassCode; - } - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentClassProp.java b/src/com/sipai/entity/equipment/EquipmentClassProp.java deleted file mode 100644 index 32b3735f..00000000 --- a/src/com/sipai/entity/equipment/EquipmentClassProp.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentClassProp extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String equipmentClassId; - - private Double ecoLifeSet; - - private String ecoLifeSetRes; - - private Double maintainceFeeSet; - - private String maintainceFeeSetRes; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getEquipmentClassId() { - return equipmentClassId; - } - - public void setEquipmentClassId(String equipmentClassId) { - this.equipmentClassId = equipmentClassId; - } - - public Double getEcoLifeSet() { - return ecoLifeSet; - } - - public void setEcoLifeSet(Double ecoLifeSet) { - this.ecoLifeSet = ecoLifeSet; - } - - public String getEcoLifeSetRes() { - return ecoLifeSetRes; - } - - public void setEcoLifeSetRes(String ecoLifeSetRes) { - this.ecoLifeSetRes = ecoLifeSetRes; - } - - public Double getMaintainceFeeSet() { - return maintainceFeeSet; - } - - public void setMaintainceFeeSet(Double maintainceFeeSet) { - this.maintainceFeeSet = maintainceFeeSet; - } - - public String getMaintainceFeeSetRes() { - return maintainceFeeSetRes; - } - - public void setMaintainceFeeSetRes(String maintainceFeeSetRes) { - this.maintainceFeeSetRes = maintainceFeeSetRes; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCode.java b/src/com/sipai/entity/equipment/EquipmentCode.java deleted file mode 100644 index 91eff94b..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCode.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentCode extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String codeRule; - - private Integer waterNumLen; - - private Integer active; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getCodeRule() { - return codeRule; - } - - public void setCodeRule(String codeRule) { - this.codeRule = codeRule; - } - - public Integer getWaterNumLen(){ - return waterNumLen; - } - - public void setWaterNumLen(Integer waterNumLen){ - this.waterNumLen=waterNumLen; - } - - public Integer getActive() { - return active; - } - - public void setActive(Integer active) { - this.active = active; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCodeLibrary.java b/src/com/sipai/entity/equipment/EquipmentCodeLibrary.java deleted file mode 100644 index 8e9776b9..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCodeLibrary.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentCodeLibrary extends SQLAdapter { - private Integer id; - - private String insdt; - - private String insuser; - - private String tableName; - - private String tableColumn; - - private String field; - - private String remark; - - private Integer active; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getField() { - return field; - } - - public void setField(String field) { - this.field = field; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getActive() { - return active; - } - - public void setActive(Integer active) { - this.active = active; - } - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getTableColumn() { - return tableColumn; - } - - public void setTableColumn(String tableColumn) { - this.tableColumn = tableColumn; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCodeRule.java b/src/com/sipai/entity/equipment/EquipmentCodeRule.java deleted file mode 100644 index 945924e5..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCodeRule.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentCodeRule extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String aliasName; - - private String codeName; - - private String tableName; - - private String tableColumn; - - private String codeField; - - private Integer codeNum; - - private Integer morder; - - private Integer type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getCodeName() { - return codeName; - } - - public void setCodeName(String codeName) { - this.codeName = codeName; - } - - public String getCodeField() { - return codeField; - } - - public void setCodeField(String codeField) { - this.codeField = codeField; - } - - public Integer getCodeNum() { - return codeNum; - } - - public void setCodeNum(Integer codeNum) { - this.codeNum = codeNum; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getAliasName() { - return aliasName; - } - - public void setAliasName(String aliasName) { - this.aliasName = aliasName; - } - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getTableColumn() { - return tableColumn; - } - - public void setTableColumn(String tableColumn) { - this.tableColumn = tableColumn; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentCommStr.java b/src/com/sipai/entity/equipment/EquipmentCommStr.java deleted file mode 100644 index 0abefd86..00000000 --- a/src/com/sipai/entity/equipment/EquipmentCommStr.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.entity.equipment; - -public class EquipmentCommStr { - - //设备效率测量点 - public static final String EquipmentEfficiency_1H = "[TB_MP_NK_SBXL_KPI_1H]";//1小时 - public static final String EquipmentEfficiency_8H = "[TB_MP_NK_SBXL_KPI_8H]";//8小时 - - //设备年份报警 预警标识 - public static final String EquipmentLife_Warning = "EL_Warning"; - public static final String EquipmentLife_Alarm = "EL_Alarm"; - public static final String EquipmentLife_All = "EL_All"; - - //展示全部设备等级标识 - public static final String Equipment_Level_All = "all"; - - //设备类型经济寿命标准来源 - public static final String EquipmentLife_Standard_Trade = "trade";//行业标准 - public static final String EquipmentLife_Standard_Supplier = "supplier";//供应商标准 - public static final String EquipmentLife_Standard_Enterprise = "enterprise";//企业标准 - //设备上传资料的节点 - public static final String Equipment_FileNode = "equipmentFileNode"; -} diff --git a/src/com/sipai/entity/equipment/EquipmentDialin.java b/src/com/sipai/entity/equipment/EquipmentDialin.java deleted file mode 100644 index 05ff3a24..00000000 --- a/src/com/sipai/entity/equipment/EquipmentDialin.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentDialin extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String dialinComId; - - private String dialinComName; - - private String applyTime; - - private String dialinId; - - private String dialinName; - - private String acceptId; - - private String acceptName; - - private String remark; - - private String docPath; - - private String warehouseId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getDialinComId() { - return dialinComId; - } - - public void setDialinComId(String dialinComId) { - this.dialinComId = dialinComId; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getDialinId() { - return dialinId; - } - - public void setDialinId(String dialinId) { - this.dialinId = dialinId; - } - - public String getAcceptId() { - return acceptId; - } - - public void setAcceptId(String acceptId) { - this.acceptId = acceptId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getDocPath() { - return docPath; - } - - public void setDocPath(String docPath) { - this.docPath = docPath; - } - - public String getDialinComName() { - return dialinComName; - } - - public void setDialinComName(String dialinComName) { - this.dialinComName = dialinComName; - } - - public String getDialinName() { - return dialinName; - } - - public void setDialinName(String dialinName) { - this.dialinName = dialinName; - } - - public String getAcceptName() { - return acceptName; - } - - public void setAcceptName(String acceptName) { - this.acceptName = acceptName; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentDialinVO.java b/src/com/sipai/entity/equipment/EquipmentDialinVO.java deleted file mode 100644 index 058f5eb6..00000000 --- a/src/com/sipai/entity/equipment/EquipmentDialinVO.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.equipment; - -public class EquipmentDialinVO { - - private String Id; - - private String dialinComId; - - private String dialinComName; - - private String applyTime; - - private String dialinId; - - private String dialinName; - - private String acceptId; - - private String acceptName; - - private String remark; - - private String docPath; - - - public String getId() { - return Id; - } - - public void setId(String id) { - Id = id; - } - - public String getDialinComId() { - return dialinComId; - } - - public void setDialinComId(String dialinComId) { - this.dialinComId = dialinComId; - } - - public String getDialinComName() { - return dialinComName; - } - - public void setDialinComName(String dialinComName) { - this.dialinComName = dialinComName; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getDialinId() { - return dialinId; - } - - public void setDialinId(String dialinId) { - this.dialinId = dialinId; - } - - public String getDialinName() { - return dialinName; - } - - public void setDialinName(String dialinName) { - this.dialinName = dialinName; - } - - public String getAcceptId() { - return acceptId; - } - - public void setAcceptId(String acceptId) { - this.acceptId = acceptId; - } - - public String getAcceptName() { - return acceptName; - } - - public void setAcceptName(String acceptName) { - this.acceptName = acceptName; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getDocPath() { - return docPath; - } - - public void setDocPath(String docPath) { - this.docPath = docPath; - } - - -} diff --git a/src/com/sipai/entity/equipment/EquipmentFile.java b/src/com/sipai/entity/equipment/EquipmentFile.java deleted file mode 100644 index 5bea05de..00000000 --- a/src/com/sipai/entity/equipment/EquipmentFile.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentFile extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String equipmentId; - - private String fileId; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentFittings.java b/src/com/sipai/entity/equipment/EquipmentFittings.java deleted file mode 100644 index bdc033da..00000000 --- a/src/com/sipai/entity/equipment/EquipmentFittings.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.Stock; - -public class EquipmentFittings extends SQLAdapter { - - public final static String Type_Z="0";//装用备件 - public final static String Type_T="1";//替代备件 - - private String id; - - private String equipmentId; - - private String goodsId; - - private String type; //0 装用备件 1 替代备件 - - private String pid; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private String equipmentOrFacility; - - private String equipmentCardID; - private String equipmentName; - private String equipmentClassID; - private String equipmentClassName; - private String equipmentModelName; - private String goodsName; - private String goodsModel; - - private Goods goods; - - private Stock stock; - - private EquipmentCard equipmentCard; - - private FacilitiesCard facilitiesCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getEquipmentCardID() { - return equipmentCardID; - } - - public void setEquipmentCardID(String equipmentCardID) { - this.equipmentCardID = equipmentCardID; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getEquipmentClassID() { - return equipmentClassID; - } - - public void setEquipmentClassID(String equipmentClassID) { - this.equipmentClassID = equipmentClassID; - } - - public String getEquipmentClassName() { - return equipmentClassName; - } - - public void setEquipmentClassName(String equipmentClassName) { - this.equipmentClassName = equipmentClassName; - } - - public String getEquipmentModelName() { - return equipmentModelName; - } - - public void setEquipmentModelName(String equipmentModelName) { - this.equipmentModelName = equipmentModelName; - } - - public String getGoodsName() { - return goodsName; - } - - public void setGoodsName(String goodsName) { - this.goodsName = goodsName; - } - - public String getGoodsModel() { - return goodsModel; - } - - public void setGoodsModel(String goodsModel) { - this.goodsModel = goodsModel; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Stock getStock() { - return stock; - } - - public void setStock(Stock stock) { - this.stock = stock; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getEquipmentOrFacility() { - return equipmentOrFacility; - } - - public void setEquipmentOrFacility(String equipmentOrFacility) { - this.equipmentOrFacility = equipmentOrFacility; - } - - public FacilitiesCard getFacilitiesCard() { - return facilitiesCard; - } - - public void setFacilitiesCard(FacilitiesCard facilitiesCard) { - this.facilitiesCard = facilitiesCard; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentIncreaseValue.java b/src/com/sipai/entity/equipment/EquipmentIncreaseValue.java deleted file mode 100644 index 9646f6fe..00000000 --- a/src/com/sipai/entity/equipment/EquipmentIncreaseValue.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentIncreaseValue extends SQLAdapter{ - private String id; - - private String equipmentId; - - private BigDecimal increaseValue; - - private String insdt; - - private String insuser; - - private String remark; - - private String bizId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public BigDecimal getIncreaseValue() { - return increaseValue; - } - - public void setIncreaseValue(BigDecimal increaseValue) { - this.increaseValue = increaseValue; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentLevel.java b/src/com/sipai/entity/equipment/EquipmentLevel.java deleted file mode 100644 index d3f36cf6..00000000 --- a/src/com/sipai/entity/equipment/EquipmentLevel.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -//设备等级 -public class EquipmentLevel extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String levelname; - - private String active; - - private String remark; - - private String equipmentLevelCode; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getLevelname() { - return levelname; - } - - public void setLevelname(String levelname) { - this.levelname = levelname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getEquipmentLevelCode() { - return equipmentLevelCode; - } - - public void setEquipmentLevelCode(String equipmentLevelCode) { - this.equipmentLevelCode = equipmentLevelCode; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentLoseApply.java b/src/com/sipai/entity/equipment/EquipmentLoseApply.java deleted file mode 100644 index b050dd55..00000000 --- a/src/com/sipai/entity/equipment/EquipmentLoseApply.java +++ /dev/null @@ -1,301 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentLoseApply extends BusinessUnitAdapter { - - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String workProcessName; - - private String sendToBizId; - - private String sendToBizName; - - private String equipmentId; - - private String equipmentName; - - private String equipmentModel; - - private String equipmentModelName; - - private String assetsCode; - - private String deptId; - - private String deptName; - - private Integer number; - - private String unit; - - private String applyPeopleId; - - private String applyPeopleName; - - private String remark; - - private String filePath; - - private String loseInstr; - - private String applyTime; - - private String loseApplyNumber; - - private String auditMan; - - private String auditId; - - private String processdefid; - - private String processid; - - private BigDecimal totalMoney; - - private String status; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getWorkProcessName() { - return workProcessName; - } - - public void setWorkProcessName(String workProcessName) { - this.workProcessName = workProcessName; - } - - public String getSendToBizId() { - return sendToBizId; - } - - public void setSendToBizId(String sendToBizId) { - this.sendToBizId = sendToBizId; - } - - public String getSendToBizName() { - return sendToBizName; - } - - public void setSendToBizName(String sendToBizName) { - this.sendToBizName = sendToBizName; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getEquipmentModel() { - return equipmentModel; - } - - public void setEquipmentModel(String equipmentModel) { - this.equipmentModel = equipmentModel; - } - - public String getEquipmentModelName() { - return equipmentModelName; - } - - public void setEquipmentModelName(String equipmentModelName) { - this.equipmentModelName = equipmentModelName; - } - - public String getAssetsCode() { - return assetsCode; - } - - public void setAssetsCode(String assetsCode) { - this.assetsCode = assetsCode; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getApplyPeopleId() { - return applyPeopleId; - } - - public void setApplyPeopleId(String applyPeopleId) { - this.applyPeopleId = applyPeopleId; - } - - public String getApplyPeopleName() { - return applyPeopleName; - } - - public void setApplyPeopleName(String applyPeopleName) { - this.applyPeopleName = applyPeopleName; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public String getLoseInstr() { - return loseInstr; - } - - public void setLoseInstr(String loseInstr) { - this.loseInstr = loseInstr; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getLoseApplyNumber() { - return loseApplyNumber; - } - - public void setLoseApplyNumber(String loseApplyNumber) { - this.loseApplyNumber = loseApplyNumber; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentLoseApplyDetail.java b/src/com/sipai/entity/equipment/EquipmentLoseApplyDetail.java deleted file mode 100644 index 704d7ce6..00000000 --- a/src/com/sipai/entity/equipment/EquipmentLoseApplyDetail.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentLoseApplyDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String loseApplyNumber; - - private String equipmentCardId; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getLoseApplyNumber() { - return loseApplyNumber; - } - - public void setLoseApplyNumber(String loseApplyNumber) { - this.loseApplyNumber = loseApplyNumber; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentMaintain.java b/src/com/sipai/entity/equipment/EquipmentMaintain.java deleted file mode 100644 index 1038156f..00000000 --- a/src/com/sipai/entity/equipment/EquipmentMaintain.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.sipai.entity.equipment; -import java.util.List; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - - -@Component -public class EquipmentMaintain extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String equipmentcardid; - - private String equipmentname; - - private String equipmentclassid; - - private String equipmentmodel; - - private String areaid; - - private String currentmanageflag; - - private String describe; - - private String maintenanceman; - - private String time; - - private String equipmentcode;//设备编码 如"T001" - - private String mancaption;//维修者名字 - - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getEquipmentcardid() { - return equipmentcardid; - } - - public void setEquipmentcardid(String equipmentcardid) { - this.equipmentcardid = equipmentcardid; - } - - public String getEquipmentname() { - return equipmentname; - } - - public void setEquipmentname(String equipmentname) { - this.equipmentname = equipmentname; - } - - public String getEquipmentclassid() { - return equipmentclassid; - } - - public void setEquipmentclassid(String equipmentclassid) { - this.equipmentclassid = equipmentclassid; - } - - public String getEquipmentmodel() { - return equipmentmodel; - } - - public void setEquipmentmodel(String equipmentmodel) { - this.equipmentmodel = equipmentmodel; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public String getCurrentmanageflag() { - return currentmanageflag; - } - - public void setCurrentmanageflag(String currentmanageflag) { - this.currentmanageflag = currentmanageflag; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public String getMaintenanceman() { - return maintenanceman; - } - - public void setMaintenanceman(String maintenanceman) { - this.maintenanceman = maintenanceman; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public String getEquipmentcode() { - return equipmentcode; - } - - public void setEquipmentcode(String equipmentcode) { - this.equipmentcode = equipmentcode; - } - - public String getMancaption() { - return mancaption; - } - - public void setMancaption(String mancaption) { - this.mancaption = mancaption; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentParamSetVO.java b/src/com/sipai/entity/equipment/EquipmentParamSetVO.java deleted file mode 100644 index d8472079..00000000 --- a/src/com/sipai/entity/equipment/EquipmentParamSetVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.equipment; - -public class EquipmentParamSetVO { - - private String id; - - private String equipmentClassName; - - private String paramNameOne; - - private String paramNameTwo; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEquipmentClassName() { - return equipmentClassName; - } - - public void setEquipmentClassName(String equipmentClassName) { - this.equipmentClassName = equipmentClassName; - } - - public String getParamNameOne() { - return paramNameOne; - } - - public void setParamNameOne(String paramNameOne) { - this.paramNameOne = paramNameOne; - } - - public String getParamNameTwo() { - return paramNameTwo; - } - - public void setParamNameTwo(String paramNameTwo) { - this.paramNameTwo = paramNameTwo; - } - -} diff --git a/src/com/sipai/entity/equipment/EquipmentParamset.java b/src/com/sipai/entity/equipment/EquipmentParamset.java deleted file mode 100644 index c7ef018f..00000000 --- a/src/com/sipai/entity/equipment/EquipmentParamset.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentParamset extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String pid; - - private Integer active; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getActive() { - return active; - } - - public void setActive(Integer active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentParamsetDetail.java b/src/com/sipai/entity/equipment/EquipmentParamsetDetail.java deleted file mode 100644 index 0ea170eb..00000000 --- a/src/com/sipai/entity/equipment/EquipmentParamsetDetail.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - - -public class EquipmentParamsetDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String paramId; - - private String name; - - private String equipmentClassId; - - private String alarmOutputLevel1; - - private String alarmOutputLevel2; - - private String alarmOutputLevel3; - - private String statusEvaluationProjectId; - - private Integer allowableDatumDeviation; - - private Integer weight; - - private String evaluationCriteriaAndDecision; - - private String evaluationMethod; - - private String libraryBizid; - - private EquipmentClass equipmentClass; - private EquipmentParamset equipmentParamset; - private EquipmentParamsetValue equipmentParamsetValue; - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getParamId() { - return paramId; - } - - public void setParamId(String paramId) { - this.paramId = paramId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getEquipmentClassId() { - return equipmentClassId; - } - - public void setEquipmentClassId(String equipmentClassId) { - this.equipmentClassId = equipmentClassId; - } - - public String getAlarmOutputLevel1() { - return alarmOutputLevel1; - } - - public void setAlarmOutputLevel1(String alarmOutputLevel1) { - this.alarmOutputLevel1 = alarmOutputLevel1; - } - - public String getAlarmOutputLevel2() { - return alarmOutputLevel2; - } - - public void setAlarmOutputLevel2(String alarmOutputLevel2) { - this.alarmOutputLevel2 = alarmOutputLevel2; - } - - public String getAlarmOutputLevel3() { - return alarmOutputLevel3; - } - - public void setAlarmOutputLevel3(String alarmOutputLevel3) { - this.alarmOutputLevel3 = alarmOutputLevel3; - } - - public String getStatusEvaluationProjectId() { - return statusEvaluationProjectId; - } - - public void setStatusEvaluationProjectId(String statusEvaluationProjectId) { - this.statusEvaluationProjectId = statusEvaluationProjectId; - } - - public Integer getAllowableDatumDeviation() { - return allowableDatumDeviation; - } - - public void setAllowableDatumDeviation(Integer allowableDatumDeviation) { - this.allowableDatumDeviation = allowableDatumDeviation; - } - - public Integer getWeight() { - return weight; - } - - public void setWeight(Integer weight) { - this.weight = weight; - } - - public String getEvaluationCriteriaAndDecision() { - return evaluationCriteriaAndDecision; - } - - public void setEvaluationCriteriaAndDecision(String evaluationCriteriaAndDecision) { - this.evaluationCriteriaAndDecision = evaluationCriteriaAndDecision; - } - - public String getEvaluationMethod() { - return evaluationMethod; - } - - public void setEvaluationMethod(String evaluationMethod) { - this.evaluationMethod = evaluationMethod; - } - - public EquipmentParamset getEquipmentParamset() { - return equipmentParamset; - } - - public void setEquipmentParamset(EquipmentParamset equipmentParamset) { - this.equipmentParamset = equipmentParamset; - } - - public EquipmentParamsetValue getEquipmentParamsetValue() { - return equipmentParamsetValue; - } - - public void setEquipmentParamsetValue(EquipmentParamsetValue equipmentParamsetValue) { - this.equipmentParamsetValue = equipmentParamsetValue; - } - - public String getLibraryBizid() { - return libraryBizid; - } - - public void setLibraryBizid(String libraryBizid) { - this.libraryBizid = libraryBizid; - } - - public EquipmentClass getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(EquipmentClass equipmentClass) { - this.equipmentClass = equipmentClass; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentParamsetStatusEvaluation.java b/src/com/sipai/entity/equipment/EquipmentParamsetStatusEvaluation.java deleted file mode 100644 index e74a0c6b..00000000 --- a/src/com/sipai/entity/equipment/EquipmentParamsetStatusEvaluation.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - - -public class EquipmentParamsetStatusEvaluation extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Integer score; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getScore() { - return score; - } - - public void setScore(Integer score) { - this.score = score; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentParamsetValue.java b/src/com/sipai/entity/equipment/EquipmentParamsetValue.java deleted file mode 100644 index 06c254b2..00000000 --- a/src/com/sipai/entity/equipment/EquipmentParamsetValue.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentParamsetValue extends SQLAdapter{ - private String id; - - private String equipmentId; - - private String equipmentClassId; - - private String detailId; - - private String insdt; - - private String insuser; - - private Double value; - - private Double alarmLimit1; - - private Double alarmLimit2; - - private Double alarmLimit3; - - private String actualSource; - - private Double baseValue; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getEquipmentClassId() { - return equipmentClassId; - } - - public void setEquipmentClassId(String equipmentClassId) { - this.equipmentClassId = equipmentClassId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public Double getAlarmLimit1() { - return alarmLimit1; - } - - public void setAlarmLimit1(Double alarmLimit1) { - this.alarmLimit1 = alarmLimit1; - } - - public Double getAlarmLimit2() { - return alarmLimit2; - } - - public void setAlarmLimit2(Double alarmLimit2) { - this.alarmLimit2 = alarmLimit2; - } - - public Double getAlarmLimit3() { - return alarmLimit3; - } - - public void setAlarmLimit3(Double alarmLimit3) { - this.alarmLimit3 = alarmLimit3; - } - - public String getActualSource() { - return actualSource; - } - - public void setActualSource(String actualSource) { - this.actualSource = actualSource; - } - - public Double getBaseValue() { - return baseValue; - } - - public void setBaseValue(Double baseValue) { - this.baseValue = baseValue; - } - - public String getDetailId() { - return detailId; - } - - public void setDetailId(String detailId) { - this.detailId = detailId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentPoint.java b/src/com/sipai/entity/equipment/EquipmentPoint.java deleted file mode 100644 index 175d7dad..00000000 --- a/src/com/sipai/entity/equipment/EquipmentPoint.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.equipment; - - - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentPoint extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String equipmentcardid; - - private String pointid; - - private String equipmentcardname; - - private String pointname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getEquipmentcardid() { - return equipmentcardid; - } - - public void setEquipmentcardid(String equipmentcardid) { - this.equipmentcardid = equipmentcardid; - } - - public String getPointid() { - return pointid; - } - - public void setPointid(String pointid) { - this.pointid = pointid; - } - - public String getEquipmentcardname() { - return equipmentcardname; - } - - public void setEquipmentcardname(String equipmentcardname) { - this.equipmentcardname = equipmentcardname; - } - - public String getPointname() { - return pointname; - } - - public void setPointname(String pointname) { - this.pointname = pointname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentRepairPlan.java b/src/com/sipai/entity/equipment/EquipmentRepairPlan.java deleted file mode 100644 index 8f47d0ee..00000000 --- a/src/com/sipai/entity/equipment/EquipmentRepairPlan.java +++ /dev/null @@ -1,259 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -public class EquipmentRepairPlan extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String planNumber; - - private String bizId; - - private String equipmentId; - - private String processSectionId; - - private String planType; - - private String maintenanceMan; - - private String initialDate; - - private Integer intervalPeriod; - - private Integer planConsumeTime; - - private String planDate; - - private String maintenanceWay; - - private BigDecimal planMoney; - - private String content; - - private String active; - - private String remark; - - private String processdefid; - - private String processid; - - private String auditId; - - private String auditMan; - - private Company company; - private ProcessSection processSection; - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPlanNumber() { - return planNumber; - } - - public void setPlanNumber(String planNumber) { - this.planNumber = planNumber; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getPlanType() { - return planType; - } - - public void setPlanType(String planType) { - this.planType = planType; - } - - public String getMaintenanceMan() { - return maintenanceMan; - } - - public void setMaintenanceMan(String maintenanceMan) { - this.maintenanceMan = maintenanceMan; - } - - public String getInitialDate() { - return initialDate; - } - - public void setInitialDate(String initialDate) { - this.initialDate = initialDate; - } - - public Integer getIntervalPeriod() { - return intervalPeriod; - } - - public void setIntervalPeriod(Integer intervalPeriod) { - this.intervalPeriod = intervalPeriod; - } - - public Integer getPlanConsumeTime() { - return planConsumeTime; - } - - public void setPlanConsumeTime(Integer planConsumeTime) { - this.planConsumeTime = planConsumeTime; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getMaintenanceWay() { - return maintenanceWay; - } - - public void setMaintenanceWay(String maintenanceWay) { - this.maintenanceWay = maintenanceWay; - } - - public BigDecimal getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(BigDecimal planMoney) { - this.planMoney = planMoney; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentSaleApply.java b/src/com/sipai/entity/equipment/EquipmentSaleApply.java deleted file mode 100644 index b81bf27e..00000000 --- a/src/com/sipai/entity/equipment/EquipmentSaleApply.java +++ /dev/null @@ -1,301 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentSaleApply extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String workProcessName; - - private String sendToBizId; - - private String sendToBizName; - - private String equipmentId; - - private String equipmentName; - - private String equipmentModel; - - private String equipmentModelName; - - private String assetsCode; - - private String deptId; - - private String deptName; - - private Integer number; - - private String unit; - - private String applyPeopleId; - - private String applyPeopleName; - - private String remark; - - private String filePath; - - private String saleInstr; - - private String applyTime; - - private String saleApplyNumber; - - private String auditMan; - - private String auditId; - - private String processdefid; - - private String processid; - - private BigDecimal totalMoney; - - private String status; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getWorkProcessName() { - return workProcessName; - } - - public void setWorkProcessName(String workProcessName) { - this.workProcessName = workProcessName; - } - - public String getSendToBizId() { - return sendToBizId; - } - - public void setSendToBizId(String sendToBizId) { - this.sendToBizId = sendToBizId; - } - - public String getSendToBizName() { - return sendToBizName; - } - - public void setSendToBizName(String sendToBizName) { - this.sendToBizName = sendToBizName; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getEquipmentModel() { - return equipmentModel; - } - - public void setEquipmentModel(String equipmentModel) { - this.equipmentModel = equipmentModel; - } - - public String getEquipmentModelName() { - return equipmentModelName; - } - - public void setEquipmentModelName(String equipmentModelName) { - this.equipmentModelName = equipmentModelName; - } - - public String getAssetsCode() { - return assetsCode; - } - - public void setAssetsCode(String assetsCode) { - this.assetsCode = assetsCode; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getApplyPeopleId() { - return applyPeopleId; - } - - public void setApplyPeopleId(String applyPeopleId) { - this.applyPeopleId = applyPeopleId; - } - - public String getApplyPeopleName() { - return applyPeopleName; - } - - public void setApplyPeopleName(String applyPeopleName) { - this.applyPeopleName = applyPeopleName; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public String getSaleInstr() { - return saleInstr; - } - - public void setSaleInstr(String saleInstr) { - this.saleInstr = saleInstr; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getSaleApplyNumber() { - return saleApplyNumber; - } - - public void setSaleApplyNumber(String saleApplyNumber) { - this.saleApplyNumber = saleApplyNumber; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentSaleApplyDetail.java b/src/com/sipai/entity/equipment/EquipmentSaleApplyDetail.java deleted file mode 100644 index 7510ff47..00000000 --- a/src/com/sipai/entity/equipment/EquipmentSaleApplyDetail.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentSaleApplyDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String saleApplyNumber; - - private String equipmentCardId; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSaleApplyNumber() { - return saleApplyNumber; - } - - public void setSaleApplyNumber(String saleApplyNumber) { - this.saleApplyNumber = saleApplyNumber; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentScrapApply.java b/src/com/sipai/entity/equipment/EquipmentScrapApply.java deleted file mode 100644 index 38859fca..00000000 --- a/src/com/sipai/entity/equipment/EquipmentScrapApply.java +++ /dev/null @@ -1,462 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.BusinessUnitAdapter; - -public class EquipmentScrapApply extends BusinessUnitAdapter{ - - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String workProcessName; - - private String sendToBizId; - - private String sendToBizName; - - private String equipmentId; - - private String equipmentName; - - private String equipmentModel; - - private String equipmentModelName; - - private String assetsCode; - - private String deptId; - - private String deptName; - - private int number; - - private String unit; - - private String applyPeopleId; - - private String applyPeopleName; - - private String remark; - - private String filePath; - - private String scrapInstr; - - private String applyTime; - - private String auditId; - - private String auditMan; - - private String scrapApplyNumber; - - private String status; - - private BigDecimal totalMoney; - - private String processdefid; - - private String processid; - - private List equipmentScrapApplyDetail; - - /* - * 流程里的审核人 - */ - private String _user0; - private String _user1; - private String _user2; - private String _user3; - private String _user4; - private String _user5; - private String _user6; - /* - * 流程里的审核意见 - */ - private String _auditopinion0; - private String _auditopinion1; - private String _auditopinion2; - private String _auditopinion3; - private String _auditopinion4; - private String _auditopinion5; - private String _auditopinion6; - - private String _applyTime; - - - public String get_applyTime() { - return _applyTime; - } - - public void set_applyTime(String _applyTime) { - this._applyTime = _applyTime; - } - - public String get_auditopinion0() { - return _auditopinion0; - } - - public void set_auditopinion0(String _auditopinion0) { - this._auditopinion0 = _auditopinion0; - } - - public String get_auditopinion1() { - return _auditopinion1; - } - - public void set_auditopinion1(String _auditopinion1) { - this._auditopinion1 = _auditopinion1; - } - - public String get_auditopinion2() { - return _auditopinion2; - } - - public void set_auditopinion2(String _auditopinion2) { - this._auditopinion2 = _auditopinion2; - } - - public String get_auditopinion3() { - return _auditopinion3; - } - - public void set_auditopinion3(String _auditopinion3) { - this._auditopinion3 = _auditopinion3; - } - - public String get_auditopinion4() { - return _auditopinion4; - } - - public void set_auditopinion4(String _auditopinion4) { - this._auditopinion4 = _auditopinion4; - } - - public String get_auditopinion5() { - return _auditopinion5; - } - - public void set_auditopinion5(String _auditopinion5) { - this._auditopinion5 = _auditopinion5; - } - - public String get_auditopinion6() { - return _auditopinion6; - } - - public void set_auditopinion6(String _auditopinion6) { - this._auditopinion6 = _auditopinion6; - } - - public String get_user0() { - return _user0; - } - - public void set_user0(String _user0) { - this._user0 = _user0; - } - - public String get_user1() { - return _user1; - } - - public void set_user1(String _user1) { - this._user1 = _user1; - } - - public String get_user2() { - return _user2; - } - - public void set_user2(String _user2) { - this._user2 = _user2; - } - - public String get_user3() { - return _user3; - } - - public void set_user3(String _user3) { - this._user3 = _user3; - } - - public String get_user4() { - return _user4; - } - - public void set_user4(String _user4) { - this._user4 = _user4; - } - - public String get_user5() { - return _user5; - } - - public void set_user5(String _user5) { - this._user5 = _user5; - } - - public String get_user6() { - return _user6; - } - - public void set_user6(String _user6) { - this._user6 = _user6; - } - - public List getEquipmentScrapApplyDetail() { - return equipmentScrapApplyDetail; - } - - public void setEquipmentScrapApplyDetail( - List equipmentScrapApplyDetail) { - this.equipmentScrapApplyDetail = equipmentScrapApplyDetail; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - - - public String getSendToBizId() { - return sendToBizId; - } - - public void setSendToBizId(String sendToBizId) { - this.sendToBizId = sendToBizId; - } - - public String getSendToBizName() { - return sendToBizName; - } - - public void setSendToBizName(String sendToBizName) { - this.sendToBizName = sendToBizName; - } - - public String getWorkProcessName() { - return workProcessName; - } - - public void setWorkProcessName(String workProcessName) { - this.workProcessName = workProcessName; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getEquipmentModel() { - return equipmentModel; - } - - public String getEquipmentModelName() { - return equipmentModelName; - } - - public void setEquipmentModelName(String equipmentModelName) { - this.equipmentModelName = equipmentModelName; - } - - public void setEquipmentModel(String equipmentModel) { - this.equipmentModel = equipmentModel; - } - - public String getAssetsCode() { - return assetsCode; - } - - public void setAssetsCode(String assetsCode) { - this.assetsCode = assetsCode; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getApplyPeopleId() { - return applyPeopleId; - } - - public void setApplyPeopleId(String applyPeopleId) { - this.applyPeopleId = applyPeopleId; - } - - public String getApplyPeopleName() { - return applyPeopleName; - } - - public void setApplyPeopleName(String applyPeopleName) { - this.applyPeopleName = applyPeopleName; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public String getScrapInstr() { - return scrapInstr; - } - - public void setScrapInstr(String scrapInstr) { - this.scrapInstr = scrapInstr; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public String getScrapApplyNumber() { - return scrapApplyNumber; - } - - public void setScrapApplyNumber(String scrapApplyNumber) { - this.scrapApplyNumber = scrapApplyNumber; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public void setNumber(int number) { - this.number = number; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentScrapApplyCollect.java b/src/com/sipai/entity/equipment/EquipmentScrapApplyCollect.java deleted file mode 100644 index 5d1dd406..00000000 --- a/src/com/sipai/entity/equipment/EquipmentScrapApplyCollect.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -public class EquipmentScrapApplyCollect extends SQLAdapter{ - - /** - * equipmentCardCode, - equipmentCardName, - applyTime, - scrapApplyNumber, - companyName, - deptName, - name - */ - private String equipmentCardCode; - - private String equipmentCardName; - - private String applyTime; - - private String scrapApplyNumber; - - private String companyName; - - private String deptName; - - private String name; - private String _equipmentId; - - private String _equipmentAssetNumber; - - private BigDecimal equipmentValue; - - private BigDecimal equipWorth; - - - public String get_equipmentId() { - return _equipmentId; - } - - public void set_equipmentId(String _equipmentId) { - this._equipmentId = _equipmentId; - } - - public String get_equipmentAssetNumber() { - return _equipmentAssetNumber; - } - - public void set_equipmentAssetNumber(String _equipmentAssetNumber) { - this._equipmentAssetNumber = _equipmentAssetNumber; - } - - public String getEquipmentCardCode() { - return equipmentCardCode; - } - - public void setEquipmentCardCode(String equipmentCardCode) { - this.equipmentCardCode = equipmentCardCode; - } - - public String getEquipmentCardName() { - return equipmentCardName; - } - - public void setEquipmentCardName(String equipmentCardName) { - this.equipmentCardName = equipmentCardName; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getScrapApplyNumber() { - return scrapApplyNumber; - } - - public void setScrapApplyNumber(String scrapApplyNumber) { - this.scrapApplyNumber = scrapApplyNumber; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public BigDecimal getEquipmentValue() { - return equipmentValue; - } - - public void setEquipmentValue(BigDecimal equipmentValue) { - this.equipmentValue = equipmentValue; - } - - public BigDecimal getEquipWorth() { - return equipWorth; - } - - public void setEquipWorth(BigDecimal equipWorth) { - this.equipWorth = equipWorth; - } -} diff --git a/src/com/sipai/entity/equipment/EquipmentScrapApplyDetail.java b/src/com/sipai/entity/equipment/EquipmentScrapApplyDetail.java deleted file mode 100644 index b4c202b9..00000000 --- a/src/com/sipai/entity/equipment/EquipmentScrapApplyDetail.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentScrapApplyDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String scrapApplyNumber; - - private String equipmentCardId; - - private EquipmentCard equipmentCard; - - private String _unit; - - private String _tousedate; - - public String get_tousedate() { - return _tousedate; - } - - public void set_tousedate(String _tousedate) { - this._tousedate = _tousedate; - } - - public String get_unit() { - return _unit; - } - - public void set_unit(String _unit) { - this._unit = _unit; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getScrapApplyNumber() { - return scrapApplyNumber; - } - - public void setScrapApplyNumber(String scrapApplyNumber) { - this.scrapApplyNumber = scrapApplyNumber; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentSpecification.java b/src/com/sipai/entity/equipment/EquipmentSpecification.java deleted file mode 100644 index 816de1a9..00000000 --- a/src/com/sipai/entity/equipment/EquipmentSpecification.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentSpecification extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String name; - - private String active; - - private String pid; - - private String bizId; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentStatistics.java b/src/com/sipai/entity/equipment/EquipmentStatistics.java deleted file mode 100644 index 30851015..00000000 --- a/src/com/sipai/entity/equipment/EquipmentStatistics.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - - -public class EquipmentStatistics extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String equipmentLevelId; - - private String companyId; - - private Integer totalEquipNum; - - private Integer intactEquipNum; - - private Integer faultEquipNum; - - private Double intactRate; - - private Company company; - - private EquipmentLevel equipmentLevel; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getEquipmentLevelId() { - return equipmentLevelId; - } - - public void setEquipmentLevelId(String equipmentLevelId) { - this.equipmentLevelId = equipmentLevelId; - } - - public String getCompanyId() { - return companyId; - } - - public void setCompanyId(String companyId) { - this.companyId = companyId; - } - - public Integer getTotalEquipNum() { - return totalEquipNum; - } - - public void setTotalEquipNum(Integer totalEquipNum) { - this.totalEquipNum = totalEquipNum; - } - - public Integer getIntactEquipNum() { - return intactEquipNum; - } - - public void setIntactEquipNum(Integer intactEquipNum) { - this.intactEquipNum = intactEquipNum; - } - - public Integer getFaultEquipNum() { - return faultEquipNum; - } - - public void setFaultEquipNum(Integer faultEquipNum) { - this.faultEquipNum = faultEquipNum; - } - - public Double getIntactRate() { - return intactRate; - } - - public void setIntactRate(Double intactRate) { - this.intactRate = intactRate; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentLevel getEquipmentLevel() { - return equipmentLevel; - } - - public void setEquipmentLevel(EquipmentLevel equipmentLevel) { - this.equipmentLevel = equipmentLevel; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentStatusManagement.java b/src/com/sipai/entity/equipment/EquipmentStatusManagement.java deleted file mode 100644 index fc702637..00000000 --- a/src/com/sipai/entity/equipment/EquipmentStatusManagement.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentStatusManagement extends SQLAdapter{ - //工单状态 - public final static String Workorderst_True="1";//启用 - public final static String Workorderst_False="0";//禁用 - - private String id; - - private String name; - - private String active; - - private String workorderst; - - private String insdt; - - private String insuser; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getWorkorderst() { - return workorderst; - } - - public void setWorkorderst(String workorderst) { - this.workorderst = workorderst; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentStopRecord.java b/src/com/sipai/entity/equipment/EquipmentStopRecord.java deleted file mode 100644 index 5668cfe6..00000000 --- a/src/com/sipai/entity/equipment/EquipmentStopRecord.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.entity.equipment; - - -import com.sipai.entity.base.BusinessUnitAdapter; - -public class EquipmentStopRecord extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String applyPeople; - - private String stopReson; - - private String applyTime; - - private String stopApplyNumber; - - private String bizId; - - private String processdefid; - - private String processid; - - private String auditId; - - private String auditMan; - - private String status; - - private String stopTime; - - private String startTime; - - private String type; - - - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getStopReson() { - return stopReson; - } - - public void setStopReson(String stopReson) { - this.stopReson = stopReson; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getStopApplyNumber() { - return stopApplyNumber; - } - - public void setStopApplyNumber(String stopApplyNumber) { - this.stopApplyNumber = stopApplyNumber; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getStopTime() { - return stopTime; - } - - public void setStopTime(String stopTime) { - this.stopTime = stopTime; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getApplyPeople() { - return applyPeople; - } - - public void setApplyPeople(String applyPeople) { - this.applyPeople = applyPeople; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentStopRecordDetail.java b/src/com/sipai/entity/equipment/EquipmentStopRecordDetail.java deleted file mode 100644 index 650ba896..00000000 --- a/src/com/sipai/entity/equipment/EquipmentStopRecordDetail.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; - -public class EquipmentStopRecordDetail extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String stopApplyNumber; - - private String equipmentCardId; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getStopApplyNumber() { - return stopApplyNumber; - } - - public void setStopApplyNumber(String stopApplyNumber) { - this.stopApplyNumber = stopApplyNumber; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentTransfersApply.java b/src/com/sipai/entity/equipment/EquipmentTransfersApply.java deleted file mode 100644 index 7aad77e7..00000000 --- a/src/com/sipai/entity/equipment/EquipmentTransfersApply.java +++ /dev/null @@ -1,308 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; - -import java.util.Date; -import java.util.List; - -public class EquipmentTransfersApply extends BusinessUnitAdapter{ - private String id; - private String insdt; - private String insuser; - private String bizId; - private String companyName; - private String workProcessName; - private String sendToBizId; - private String sendToBizName; - private String equipmentId; - private String equipmentName; - private String equipmentModel; - private String assetsCode; - private String deptId; - private String deptName; - private String unit; - private Integer number; - private String applyPeopleId; - private String applyPeopleName; - private String remark; - private String filePath; - private String transfersInstr; - private String applyTime; - private String processdefid; - private String processid; - private String auditId; - private String auditMan; - private String transfersApplyNumber; - private String status; - private BigDecimal totalMoney; - - private String deptOpinion; - - List equipmentTransfersApplyDetails; - /* - * 报表数据 - */ - private String _data1; - private String _data2; - private String _data3; - private String _data4; - private String _data5; - private String _data6; - private String _data7; - private String _data8; - private String _data9; - private String _data10; - - - public String get_data1() { - return _data1; - } - public void set_data1(String _data1) { - this._data1 = _data1; - } - public String get_data2() { - return _data2; - } - public void set_data2(String _data2) { - this._data2 = _data2; - } - public String get_data3() { - return _data3; - } - public void set_data3(String _data3) { - this._data3 = _data3; - } - public String get_data4() { - return _data4; - } - public void set_data4(String _data4) { - this._data4 = _data4; - } - public String get_data5() { - return _data5; - } - public void set_data5(String _data5) { - this._data5 = _data5; - } - public String get_data6() { - return _data6; - } - public void set_data6(String _data6) { - this._data6 = _data6; - } - public String get_data7() { - return _data7; - } - public void set_data7(String _data7) { - this._data7 = _data7; - } - public String get_data8() { - return _data8; - } - public void set_data8(String _data8) { - this._data8 = _data8; - } - public String get_data9() { - return _data9; - } - public void set_data9(String _data9) { - this._data9 = _data9; - } - public String get_data10() { - return _data10; - } - public void set_data10(String _data10) { - this._data10 = _data10; - } - public List getEquipmentTransfersApplyDetails() { - return equipmentTransfersApplyDetails; - } - public void setEquipmentTransfersApplyDetails( - List equipmentTransfersApplyDetails) { - this.equipmentTransfersApplyDetails = equipmentTransfersApplyDetails; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getInsdt() { - return insdt; - } - public void setInsdt(String insdt) { - this.insdt = insdt; - } - public String getInsuser() { - return insuser; - } - public void setInsuser(String insuser) { - this.insuser = insuser; - } - public String getBizId() { - return bizId; - } - public void setBizId(String bizId) { - this.bizId = bizId; - } - public String getCompanyName() { - return companyName; - } - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - public String getWorkProcessName() { - return workProcessName; - } - public void setWorkProcessName(String workProcessName) { - this.workProcessName = workProcessName; - } - public String getSendToBizId() { - return sendToBizId; - } - public void setSendToBizId(String sendToBizId) { - this.sendToBizId = sendToBizId; - } - public String getSendToBizName() { - return sendToBizName; - } - public void setSendToBizName(String sendToBizName) { - this.sendToBizName = sendToBizName; - } - public String getEquipmentId() { - return equipmentId; - } - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - public String getEquipmentName() { - return equipmentName; - } - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - public String getEquipmentModel() { - return equipmentModel; - } - public void setEquipmentModel(String equipmentModel) { - this.equipmentModel = equipmentModel; - } - public String getAssetsCode() { - return assetsCode; - } - public void setAssetsCode(String assetsCode) { - this.assetsCode = assetsCode; - } - public String getDeptId() { - return deptId; - } - public void setDeptId(String deptId) { - this.deptId = deptId; - } - public String getDeptName() { - return deptName; - } - public void setDeptName(String deptName) { - this.deptName = deptName; - } - public String getUnit() { - return unit; - } - public void setUnit(String unit) { - this.unit = unit; - } - public Integer getNumber() { - return number; - } - public void setNumber(Integer number) { - this.number = number; - } - public String getApplyPeopleId() { - return applyPeopleId; - } - public void setApplyPeopleId(String applyPeopleId) { - this.applyPeopleId = applyPeopleId; - } - public String getApplyPeopleName() { - return applyPeopleName; - } - public void setApplyPeopleName(String applyPeopleName) { - this.applyPeopleName = applyPeopleName; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public String getFilePath() { - return filePath; - } - public void setFilePath(String filePath) { - this.filePath = filePath; - } - public String getTransfersInstr() { - return transfersInstr; - } - public void setTransfersInstr(String transfersInstr) { - this.transfersInstr = transfersInstr; - } - public String getApplyTime() { - return applyTime; - } - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - public String getProcessdefid() { - return processdefid; - } - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - public String getProcessid() { - return processid; - } - public void setProcessid(String processid) { - this.processid = processid; - } - public String getAuditId() { - return auditId; - } - public void setAuditId(String auditId) { - this.auditId = auditId; - } - public String getAuditMan() { - return auditMan; - } - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - public String getTransfersApplyNumber() { - return transfersApplyNumber; - } - public void setTransfersApplyNumber(String transfersApplyNumber) { - this.transfersApplyNumber = transfersApplyNumber; - } - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - public BigDecimal getTotalMoney() { - return totalMoney; - } - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - public String getDeptOpinion() { - return deptOpinion; - } - public void setDeptOpinion(String deptOpinion) { - this.deptOpinion = deptOpinion; - } - -} diff --git a/src/com/sipai/entity/equipment/EquipmentTransfersApplyCollect.java b/src/com/sipai/entity/equipment/EquipmentTransfersApplyCollect.java deleted file mode 100644 index 22a2ec56..00000000 --- a/src/com/sipai/entity/equipment/EquipmentTransfersApplyCollect.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentTransfersApplyCollect extends SQLAdapter { - - private String equipmentCardCode; - - private String equipmentName; - - private String goodName; - - private String transfersApplyNumber; - - private String applyTime; - - private String outCompanyName; - - private String inCompanyName; - - private String inDeptName; - - private String _equipmentId; - - private String _equipmentAssetNumber; - - public String get_equipmentId() { - return _equipmentId; - } - - public void set_equipmentId(String _equipmentId) { - this._equipmentId = _equipmentId; - } - - public String get_equipmentAssetNumber() { - return _equipmentAssetNumber; - } - - public void set_equipmentAssetNumber(String _equipmentAssetNumber) { - this._equipmentAssetNumber = _equipmentAssetNumber; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getGoodName() { - return goodName; - } - - public void setGoodName(String goodName) { - this.goodName = goodName; - } - - public String getTransfersApplyNumber() { - return transfersApplyNumber; - } - - public void setTransfersApplyNumber(String transfersApplyNumber) { - this.transfersApplyNumber = transfersApplyNumber; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getOutCompanyName() { - return outCompanyName; - } - - public void setOutCompanyName(String outCompanyName) { - this.outCompanyName = outCompanyName; - } - - public String getInCompanyName() { - return inCompanyName; - } - - public void setInCompanyName(String inCompanyName) { - this.inCompanyName = inCompanyName; - } - - public String getInDeptName() { - return inDeptName; - } - - public void setInDeptName(String inDeptName) { - this.inDeptName = inDeptName; - } - - public String getEquipmentCardCode() { - return equipmentCardCode; - } - - public void setEquipmentCardCode(String equipmentCardCode) { - this.equipmentCardCode = equipmentCardCode; - } - -} diff --git a/src/com/sipai/entity/equipment/EquipmentTransfersApplyDetail.java b/src/com/sipai/entity/equipment/EquipmentTransfersApplyDetail.java deleted file mode 100644 index 3130f944..00000000 --- a/src/com/sipai/entity/equipment/EquipmentTransfersApplyDetail.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.entity.equipment; - - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentTransfersApplyDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String transfersApplyNumber; - - private String equipmentCardId; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getTransfersApplyNumber() { - return transfersApplyNumber; - } - - public void setTransfersApplyNumber(String transfersApplyNumber) { - this.transfersApplyNumber = transfersApplyNumber; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentTypeNumber.java b/src/com/sipai/entity/equipment/EquipmentTypeNumber.java deleted file mode 100644 index 7d96cc6e..00000000 --- a/src/com/sipai/entity/equipment/EquipmentTypeNumber.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentTypeNumber extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String active; - - private String pid; - - private String remark; - - private String bizId; - - //用于导出查询 - private String b_id;//设备大类 - private String b_name; - private String b_code; - private String s_id;//设备小类 - private String s_name; - private String s_code; - - public String getB_id() { - return b_id; - } - - public void setB_id(String b_id) { - this.b_id = b_id; - } - - public String getB_name() { - return b_name; - } - - public void setB_name(String b_name) { - this.b_name = b_name; - } - - public String getB_code() { - return b_code; - } - - public void setB_code(String b_code) { - this.b_code = b_code; - } - - public String getS_id() { - return s_id; - } - - public void setS_id(String s_id) { - this.s_id = s_id; - } - - public String getS_name() { - return s_name; - } - - public void setS_name(String s_name) { - this.s_name = s_name; - } - - public String getS_code() { - return s_code; - } - - public void setS_code(String s_code) { - this.s_code = s_code; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/EquipmentUseAge.java b/src/com/sipai/entity/equipment/EquipmentUseAge.java deleted file mode 100644 index 94fd379b..00000000 --- a/src/com/sipai/entity/equipment/EquipmentUseAge.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentUseAge extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private Integer valueMin; - - private String name; - - private Integer valueMax; - - private String pid; - - private String remark; - - private String bizId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getValueMin() { - return valueMin; - } - - public void setValueMin(Integer valueMin) { - this.valueMin = valueMin; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getValueMax() { - return valueMax; - } - - public void setValueMax(Integer valueMax) { - this.valueMax = valueMax; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/FacilitiesCard.java b/src/com/sipai/entity/equipment/FacilitiesCard.java deleted file mode 100644 index 8a789ba5..00000000 --- a/src/com/sipai/entity/equipment/FacilitiesCard.java +++ /dev/null @@ -1,344 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -/** - * 设施台帐 - * @author SJ - * - */ -public class FacilitiesCard extends SQLAdapter{ - - public final static String Type_Facilities="0";//设施 - public final static String Type_Pipeline="1";//管道 - - private String id; - - private String insuser; - - private String insdt; - - private String position;//位置 - - private String assetClassId;//资产id - - private String assetClassCode;//资产编号 - - private String code;//权证编号 - - private String name;//建(构)筑物名称 - - private String facilitiesClassId;//设施类别 - - private String structure;//结构 - - private String completedTime;//建成年月 - - private float useYearsLimit;//使用年限 - - private String mainParams;//主要参数 - - private String builtArea;//建筑面积或体积 - - private float number;//数量(座) - - private float depreciationYearsLimit;//折旧年限(年) - - private float originalValue;//账面原值(元) - - private float nowValue;//账面净值(元) - - private String designUnit;//设计单位 - - private String constructionUnit;//承建单位 - - private String assetStatus;//资产状态 - - private String assetEvaluate;//资产状况评价 - - private String remarks;//备注 - - private String model;//规格型号 - - private String materialQuality;//材质 - - private String measureUnit;//计量单位(km) - - private float length;//长度 - - private String type;//顶部申明了 设施与管道的常量 - - private String unitId; - - private FacilitiesClass facilitiesClass;//设施分类 - private EquipmentStatusManagement equipmentStatusManagement;//设备设施状态 - private Company company; - private AssetClass assetClass;//资产类别 - - public AssetClass getAssetClass() { - return assetClass; - } - - public void setAssetClass(AssetClass assetClass) { - this.assetClass = assetClass; - } - - public String getAssetClassCode() { - return assetClassCode; - } - - public void setAssetClassCode(String assetClassCode) { - this.assetClassCode = assetClassCode; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentStatusManagement getEquipmentStatusManagement() { - return equipmentStatusManagement; - } - - public void setEquipmentStatusManagement( - EquipmentStatusManagement equipmentStatusManagement) { - this.equipmentStatusManagement = equipmentStatusManagement; - } - - public FacilitiesClass getFacilitiesClass() { - return facilitiesClass; - } - - public void setFacilitiesClass(FacilitiesClass facilitiesClass) { - this.facilitiesClass = facilitiesClass; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getAssetClassId() { - return assetClassId; - } - - public void setAssetClassId(String assetClassId) { - this.assetClassId = assetClassId; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getFacilitiesClassId() { - return facilitiesClassId; - } - - public void setFacilitiesClassId(String facilitiesClassId) { - this.facilitiesClassId = facilitiesClassId; - } - - public String getStructure() { - return structure; - } - - public void setStructure(String structure) { - this.structure = structure; - } - - public String getCompletedTime() { - return completedTime; - } - - public void setCompletedTime(String completedTime) { - this.completedTime = completedTime; - } - - public float getUseYearsLimit() { - return useYearsLimit; - } - - public void setUseYearsLimit(float useYearsLimit) { - this.useYearsLimit = useYearsLimit; - } - - public String getMainParams() { - return mainParams; - } - - public void setMainParams(String mainParams) { - this.mainParams = mainParams; - } - - public String getBuiltArea() { - return builtArea; - } - - public void setBuiltArea(String builtArea) { - this.builtArea = builtArea; - } - - public float getNumber() { - return number; - } - - public void setNumber(float number) { - this.number = number; - } - - public float getDepreciationYearsLimit() { - return depreciationYearsLimit; - } - - public void setDepreciationYearsLimit(float depreciationYearsLimit) { - this.depreciationYearsLimit = depreciationYearsLimit; - } - - public float getOriginalValue() { - return originalValue; - } - - public void setOriginalValue(float originalValue) { - this.originalValue = originalValue; - } - - public float getNowValue() { - return nowValue; - } - - public void setNowValue(float nowValue) { - this.nowValue = nowValue; - } - - public String getDesignUnit() { - return designUnit; - } - - public void setDesignUnit(String designUnit) { - this.designUnit = designUnit; - } - - public String getConstructionUnit() { - return constructionUnit; - } - - public void setConstructionUnit(String constructionUnit) { - this.constructionUnit = constructionUnit; - } - - public String getAssetStatus() { - return assetStatus; - } - - public void setAssetStatus(String assetStatus) { - this.assetStatus = assetStatus; - } - - public String getAssetEvaluate() { - return assetEvaluate; - } - - public void setAssetEvaluate(String assetEvaluate) { - this.assetEvaluate = assetEvaluate; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public String getMaterialQuality() { - return materialQuality; - } - - public void setMaterialQuality(String materialQuality) { - this.materialQuality = materialQuality; - } - - public String getMeasureUnit() { - return measureUnit; - } - - public void setMeasureUnit(String measureUnit) { - this.measureUnit = measureUnit; - } - - public float getLength() { - return length; - } - - public void setLength(float length) { - this.length = length; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/FacilitiesClass.java b/src/com/sipai/entity/equipment/FacilitiesClass.java deleted file mode 100644 index bb24f6a3..00000000 --- a/src/com/sipai/entity/equipment/FacilitiesClass.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 设施分类 - * @author SJ - * - */ -public class FacilitiesClass extends SQLAdapter{ - - private String id; - - private String code; - - private String name; - - private String remark; - - private String unitId; - - private String type; - - private String pid; - - private Integer morder; - - private String insuser; - - private String insdt; - - private String _pname; - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/GeographyArea.java b/src/com/sipai/entity/equipment/GeographyArea.java deleted file mode 100644 index c06b8e76..00000000 --- a/src/com/sipai/entity/equipment/GeographyArea.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.sipai.entity.equipment; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class GeographyArea extends SQLAdapter{ - private String id; - - private String name; - - private String insdt; - - private String insuser; - - private String remark; - - private String status; - - private String bizid; - - private String code; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} - \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/HomePage.java b/src/com/sipai/entity/equipment/HomePage.java deleted file mode 100644 index e88901f7..00000000 --- a/src/com/sipai/entity/equipment/HomePage.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - - -//主页数据类 -public class HomePage extends SQLAdapter{ - private String equipmentTotal; - private String equipmentTotalA; - private String equipmentTotalB; - private String equipmentTotalC; - //投运设备数 - private String equipmentTotalRun; - //设备完好率 - private int equipmentIntactRate; - //大修完成率 - private int equipmentRepair; - //保养完成率 - private int equipmentMaintain; - //总异常数量 - private int equipmentAnomaliesTotal; - //运行异常数量 - private int equipmentRunAnomalies; - //设备异常数量 - private int equipmentToAnomalies; - - - //物资申请 - private String materialApplication; - //物资申请总额 - private String materialApplicationTotal; - //已完成的采购 - private String completePurchase; - //已完成的采购总额 - private String completePurchaseTotal; - //进行的采购 - private String runPurchase; - //进行的采购总额 - private String runPurchaseTotal; - //库存数 - private String inventory; - //库存总数 - private String inventoryMax; - - private String pzxjs; - private int pzxjswcl; - private String pzxjsywc; - private String pzxjsjxz; - private String pzxjswks; - - private String wszxjs; - private int wszxjswcl; - private String wszxjsywc; - private String wszxjsjxz; - private String wszxjswks; - - private String htzs; - private String zqhts; - private String zxhts; - private int htxcl; - private int htwxcl; - - public String getEquipmentTotal() { - return equipmentTotal; - } - public void setEquipmentTotal(String equipmentTotal) { - this.equipmentTotal = equipmentTotal; - } - public String getEquipmentTotalA() { - return equipmentTotalA; - } - public void setEquipmentTotalA(String equipmentTotalA) { - this.equipmentTotalA = equipmentTotalA; - } - public String getEquipmentTotalB() { - return equipmentTotalB; - } - public void setEquipmentTotalB(String equipmentTotalB) { - this.equipmentTotalB = equipmentTotalB; - } - public String getEquipmentTotalC() { - return equipmentTotalC; - } - public void setEquipmentTotalC(String equipmentTotalC) { - this.equipmentTotalC = equipmentTotalC; - } - public String getEquipmentTotalRun() { - return equipmentTotalRun; - } - public void setEquipmentTotalRun(String equipmentTotalRun) { - this.equipmentTotalRun = equipmentTotalRun; - } - public int getEquipmentIntactRate() { - return equipmentIntactRate; - } - public void setEquipmentIntactRate(int equipmentIntactRate) { - this.equipmentIntactRate = equipmentIntactRate; - } - - public int getEquipmentRepair() { - return equipmentRepair; - } - public void setEquipmentRepair(int equipmentRepair) { - this.equipmentRepair = equipmentRepair; - } - public int getEquipmentMaintain() { - return equipmentMaintain; - } - public void setEquipmentMaintain(int equipmentMaintain) { - this.equipmentMaintain = equipmentMaintain; - } - public int getEquipmentAnomaliesTotal() { - return equipmentAnomaliesTotal; - } - public void setEquipmentAnomaliesTotal(int equipmentAnomaliesTotal) { - this.equipmentAnomaliesTotal = equipmentAnomaliesTotal; - } - public int getEquipmentRunAnomalies() { - return equipmentRunAnomalies; - } - public void setEquipmentRunAnomalies(int equipmentRunAnomalies) { - this.equipmentRunAnomalies = equipmentRunAnomalies; - } - public int getEquipmentToAnomalies() { - return equipmentToAnomalies; - } - public void setEquipmentToAnomalies(int equipmentToAnomalies) { - this.equipmentToAnomalies = equipmentToAnomalies; - } - public String getMaterialApplication() { - return materialApplication; - } - public void setMaterialApplication(String materialApplication) { - this.materialApplication = materialApplication; - } - public String getMaterialApplicationTotal() { - return materialApplicationTotal; - } - public void setMaterialApplicationTotal(String materialApplicationTotal) { - this.materialApplicationTotal = materialApplicationTotal; - } - public String getCompletePurchase() { - return completePurchase; - } - public void setCompletePurchase(String completePurchase) { - this.completePurchase = completePurchase; - } - public String getCompletePurchaseTotal() { - return completePurchaseTotal; - } - public void setCompletePurchaseTotal(String completePurchaseTotal) { - this.completePurchaseTotal = completePurchaseTotal; - } - public String getRunPurchase() { - return runPurchase; - } - public void setRunPurchase(String runPurchase) { - this.runPurchase = runPurchase; - } - public String getRunPurchaseTotal() { - return runPurchaseTotal; - } - public void setRunPurchaseTotal(String runPurchaseTotal) { - this.runPurchaseTotal = runPurchaseTotal; - } - public String getInventory() { - return inventory; - } - public void setInventory(String inventory) { - this.inventory = inventory; - } - public String getInventoryMax() { - return inventoryMax; - } - public void setInventoryMax(String inventoryMax) { - this.inventoryMax = inventoryMax; - } - public String getPzxjs() { - return pzxjs; - } - public void setPzxjs(String pzxjs) { - this.pzxjs = pzxjs; - } - - - public String getPzxjsjxz() { - return pzxjsjxz; - } - public void setPzxjsjxz(String pzxjsjxz) { - this.pzxjsjxz = pzxjsjxz; - } - public String getPzxjswks() { - return pzxjswks; - } - public void setPzxjswks(String pzxjswks) { - this.pzxjswks = pzxjswks; - } - public String getWszxjs() { - return wszxjs; - } - public void setWszxjs(String wszxjs) { - this.wszxjs = wszxjs; - } - - - public int getPzxjswcl() { - return pzxjswcl; - } - public void setPzxjswcl(int pzxjswcl) { - this.pzxjswcl = pzxjswcl; - } - public int getWszxjswcl() { - return wszxjswcl; - } - public void setWszxjswcl(int wszxjswcl) { - this.wszxjswcl = wszxjswcl; - } - public String getPzxjsywc() { - return pzxjsywc; - } - public void setPzxjsywc(String pzxjsywc) { - this.pzxjsywc = pzxjsywc; - } - public String getWszxjsywc() { - return wszxjsywc; - } - public void setWszxjsywc(String wszxjsywc) { - this.wszxjsywc = wszxjsywc; - } - public String getWszxjsjxz() { - return wszxjsjxz; - } - public void setWszxjsjxz(String wszxjsjxz) { - this.wszxjsjxz = wszxjsjxz; - } - public String getWszxjswks() { - return wszxjswks; - } - public void setWszxjswks(String wszxjswks) { - this.wszxjswks = wszxjswks; - } - public String getHtzs() { - return htzs; - } - public void setHtzs(String htzs) { - this.htzs = htzs; - } - public String getZqhts() { - return zqhts; - } - public void setZqhts(String zqhts) { - this.zqhts = zqhts; - } - public String getZxhts() { - return zxhts; - } - public void setZxhts(String zxhts) { - this.zxhts = zxhts; - } - public int getHtxcl() { - return htxcl; - } - public void setHtxcl(int htxcl) { - this.htxcl = htxcl; - } - public int getHtwxcl() { - return htwxcl; - } - public void setHtwxcl(int htwxcl) { - this.htwxcl = htwxcl; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/MaintenancePlan.java b/src/com/sipai/entity/equipment/MaintenancePlan.java deleted file mode 100644 index 65b962ee..00000000 --- a/src/com/sipai/entity/equipment/MaintenancePlan.java +++ /dev/null @@ -1,259 +0,0 @@ -package com.sipai.entity.equipment; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -public class MaintenancePlan extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String planNumber; - - private String bizId; - - private String equipmentId; - - private String processSectionId; - - private String planType; - - private String maintenanceMan; - - private String initialDate; - - private Integer intervalPeriod; - - private Integer planConsumeTime; - - private String planDate; - - private String maintenanceWay; - - private BigDecimal planMoney; - - private String content; - - private String active; - - private String remark; - - private String processdefid; - - private String processid; - - private String auditId; - - private String auditMan; - - private Company company; - private ProcessSection processSection; - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPlanNumber() { - return planNumber; - } - - public void setPlanNumber(String planNumber) { - this.planNumber = planNumber; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getPlanType() { - return planType; - } - - public void setPlanType(String planType) { - this.planType = planType; - } - - public String getMaintenanceMan() { - return maintenanceMan; - } - - public void setMaintenanceMan(String maintenanceMan) { - this.maintenanceMan = maintenanceMan; - } - - public String getInitialDate() { - return initialDate; - } - - public void setInitialDate(String initialDate) { - this.initialDate = initialDate; - } - - public Integer getIntervalPeriod() { - return intervalPeriod; - } - - public void setIntervalPeriod(Integer intervalPeriod) { - this.intervalPeriod = intervalPeriod; - } - - public Integer getPlanConsumeTime() { - return planConsumeTime; - } - - public void setPlanConsumeTime(Integer planConsumeTime) { - this.planConsumeTime = planConsumeTime; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getMaintenanceWay() { - return maintenanceWay; - } - - public void setMaintenanceWay(String maintenanceWay) { - this.maintenanceWay = maintenanceWay; - } - - public BigDecimal getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(BigDecimal planMoney) { - this.planMoney = planMoney; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/equipment/SpecialEquipment.java b/src/com/sipai/entity/equipment/SpecialEquipment.java deleted file mode 100644 index aa65d924..00000000 --- a/src/com/sipai/entity/equipment/SpecialEquipment.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.sipai.entity.equipment; - -import com.sipai.entity.base.SQLAdapter; - -public class SpecialEquipment extends SQLAdapter{ - - //全部 - public static final String STATUS_ALL="0"; - //正常 - public static final String STATUS_NORMAL="正常"; - //到期 - public static final String STATUS_EXPIRE="到期"; - //预警 - public static final String STATUS_WARN="预警"; - //过期 - public static final String STATUS_EXPIRED="过期"; - - public static String[] equipmentCardCheckStatusArr={"正常","到期","预警"}; - - - public static final String CAR="车辆"; - - public static final String SPECIAL_EQUIPMENT="特种设备"; - - public static final String INSTRUMENT="仪器仪表"; - - public static final String TOOLS="安全工具"; - - public static final String OTHERS="其它"; - - public static final String ALREADY_DEAL ="已处理"; - public static final String NORMAL ="正常"; - - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String equipmentCardId; - - private String nextRecordTime; - - private String equipmentClass; - - private String status; - - private String recentTime; - - private String dealDesc; - - private String actFinishTime; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public String getNextRecordTime() { - return nextRecordTime; - } - - public void setNextRecordTime(String nextRecordTime) { - this.nextRecordTime = nextRecordTime; - } - - public String getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(String equipmentClass) { - this.equipmentClass = equipmentClass; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getRecentTime() { - return recentTime; - } - - public void setRecentTime(String recentTime) { - this.recentTime = recentTime; - } - - public String getDealDesc() { - return dealDesc; - } - - public void setDealDesc(String dealDesc) { - this.dealDesc = dealDesc; - } - - public String getActFinishTime() { - return actFinishTime; - } - - public void setActFinishTime(String actFinishTime) { - this.actFinishTime = actFinishTime; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationCriterion.java b/src/com/sipai/entity/evaluation/EvaluationCriterion.java deleted file mode 100644 index 1ff65ed1..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationCriterion.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -/** - * 评价标准 - * @author 54588 - * - */ -public class EvaluationCriterion extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String criterionName;//标准名称 - - private Double nationCriterionValue;//国家标准比较基准值 - - private Double nationCriterionMin;//国家标准比较基准小值 - - private Double nationCriterionMax;//国家标准比较基准大值 - - private Double areaCriterionValue;//地区标准比较基准值 - - private Double areaCriterionMin;//地区标准比较基准小值 - - private Double areaCriterionMax;//地区标准比较基准大值 - - private Double companyCriterionValue;//内控标准比较基准值 - - private Double companyCriterionMax;//内控标准比较基准大值 - - private Double companyCriterionMin;//内控标准比较基准小值 - - private String condition;//比较条件 1:大于 2:小于 3:区间内 4:区间外 - - private Double detectionLimit;//检测限 - - private boolean isSeries;//是否是级数 - - public boolean getIsSeries() { - return isSeries; - } - - public void setIsSeries(boolean isSeries) { - this.isSeries = isSeries; - } - - public Double getDetectionLimit() { - return detectionLimit; - } - - public void setDetectionLimit(Double detectionLimit) { - this.detectionLimit = detectionLimit; - } - - private String remark;//备注 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getCriterionName() { - return criterionName; - } - - public void setCriterionName(String criterionName) { - this.criterionName = criterionName; - } - - public Double getNationCriterionValue() { - return nationCriterionValue; - } - - public void setNationCriterionValue(Double nationCriterionValue) { - this.nationCriterionValue = nationCriterionValue; - } - - public Double getNationCriterionMin() { - return nationCriterionMin; - } - - public void setNationCriterionMin(Double nationCriterionMin) { - this.nationCriterionMin = nationCriterionMin; - } - - public Double getNationCriterionMax() { - return nationCriterionMax; - } - - public void setNationCriterionMax(Double nationCriterionMax) { - this.nationCriterionMax = nationCriterionMax; - } - - public Double getAreaCriterionValue() { - return areaCriterionValue; - } - - public void setAreaCriterionValue(Double areaCriterionValue) { - this.areaCriterionValue = areaCriterionValue; - } - - public Double getAreaCriterionMin() { - return areaCriterionMin; - } - - public void setAreaCriterionMin(Double areaCriterionMin) { - this.areaCriterionMin = areaCriterionMin; - } - - public Double getAreaCriterionMax() { - return areaCriterionMax; - } - - public void setAreaCriterionMax(Double areaCriterionMax) { - this.areaCriterionMax = areaCriterionMax; - } - - public Double getCompanyCriterionValue() { - return companyCriterionValue; - } - - public void setCompanyCriterionValue(Double companyCriterionValue) { - this.companyCriterionValue = companyCriterionValue; - } - - public Double getCompanyCriterionMax() { - return companyCriterionMax; - } - - public void setCompanyCriterionMax(Double companyCriterionMax) { - this.companyCriterionMax = companyCriterionMax; - } - - public Double getCompanyCriterionMin() { - return companyCriterionMin; - } - - public void setCompanyCriterionMin(Double companyCriterionMin) { - this.companyCriterionMin = companyCriterionMin; - } - - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationIndex.java b/src/com/sipai/entity/evaluation/EvaluationIndex.java deleted file mode 100644 index 4b66ee6a..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationIndex.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 评价指数配置主表 - * @author 54588 - * - */ -public class EvaluationIndex extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String indexName;//评价指数名称 - - private String indexDefinition;//评价指数定义 - - private String indexFrequency;//评价频率 - - private String indexFunction;//评价方式 - - private String evaluationCriterionIds;//关联评价标准 - - private List evaluationCriterions;//关联评价标准 - - private String _evaluationCriterions; - - private String type; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String get_evaluationCriterions() { - return _evaluationCriterions; - } - - public void set_evaluationCriterions(String _evaluationCriterions) { - this._evaluationCriterions = _evaluationCriterions; - } - - public String getEvaluationCriterionIds() { - return evaluationCriterionIds; - } - - public void setEvaluationCriterionIds(String evaluationCriterionIds) { - this.evaluationCriterionIds = evaluationCriterionIds; - } - - public List getEvaluationCriterions() { - return evaluationCriterions; - } - - public void setEvaluationCriterions( - List evaluationCriterions) { - this.evaluationCriterions = evaluationCriterions; - } - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public String getIndexDefinition() { - return indexDefinition; - } - - public void setIndexDefinition(String indexDefinition) { - this.indexDefinition = indexDefinition; - } - - public String getIndexFrequency() { - return indexFrequency; - } - - public void setIndexFrequency(String indexFrequency) { - this.indexFrequency = indexFrequency; - } - - public String getIndexFunction() { - return indexFunction; - } - - public void setIndexFunction(String indexFunction) { - this.indexFunction = indexFunction; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationIndexDay.java b/src/com/sipai/entity/evaluation/EvaluationIndexDay.java deleted file mode 100644 index e2d07e77..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationIndexDay.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -/** - * 日评指数 - * @author 54588 - * - */ -public class EvaluationIndexDay extends SQLAdapter{ - private String id; - - private String insdt; - - private String date; - - private String criterionValue;//检测值json数据 - - private String subIndexNation;//分指数(国标)json数据 - - private String subIndexArea;//分指数(地标)json数据 - - private String subIndexCompany;//分指数(内控)json数据 - - private Double wqiDayNation;//日评指数值(国标) - - private Double wqiDayArea;//日评指数值(地标) - - private Double wqiDayCompany;//日评指数值(内控) - - public Double getWqiDayNation() { - return wqiDayNation; - } - - public void setWqiDayNation(Double wqiDayNation) { - this.wqiDayNation = wqiDayNation; - } - - public Double getWqiDayArea() { - return wqiDayArea; - } - - public void setWqiDayArea(Double wqiDayArea) { - this.wqiDayArea = wqiDayArea; - } - - public Double getWqiDayCompany() { - return wqiDayCompany; - } - - public void setWqiDayCompany(Double wqiDayCompany) { - this.wqiDayCompany = wqiDayCompany; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public String getCriterionValue() { - return criterionValue; - } - - public void setCriterionValue(String criterionValue) { - this.criterionValue = criterionValue; - } - - public String getSubIndexNation() { - return subIndexNation; - } - - public void setSubIndexNation(String subIndexNation) { - this.subIndexNation = subIndexNation; - } - - public String getSubIndexArea() { - return subIndexArea; - } - - public void setSubIndexArea(String subIndexArea) { - this.subIndexArea = subIndexArea; - } - - public String getSubIndexCompany() { - return subIndexCompany; - } - - public void setSubIndexCompany(String subIndexCompany) { - this.subIndexCompany = subIndexCompany; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationIndexM.java b/src/com/sipai/entity/evaluation/EvaluationIndexM.java deleted file mode 100644 index ccc4f5b7..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationIndexM.java +++ /dev/null @@ -1,229 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -/** - * 月评价指数配置 - * @author 54588 - */ -public class EvaluationIndexM extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String indexName;//评价指数名称 - - private String indexDefinition;//评价指数定义 - - private String indexFrequency;//评价频率 - - private String indexFunction;//评价方式 - - private String remark; - - private String evaluationcriterionBacteriologyIds;//关联评价标准-细菌学指标ids - - private String evaluationcriterionDisinfectantIds;//关联评价标准-消毒剂指标ids - - private String evaluationcriterionSensoryorgansIds;//关联评价标准-感官指标ids - - private String evaluationcriterionToxicologyIds;//关联评价标准-毒理指标ids - - private String type;// - - private List evaluationCriterionBacteriologys;//关联评价标准-细菌学指标 - - private List evaluationCriterionDisinfectants;//关联评价标准-消毒剂指标 - - private List evaluationCriterionSensoryorgans;//关联评价标准-感官指标 - - private List evaluationCriterionToxicologys;//关联评价标准-毒理指标 - - private String _evaluationCriterionBacteriologys; - - private String _evaluationCriterionDisinfectants; - - private String _evaluationCriterionSensoryorgans; - - private String _evaluationCriterionToxicologys; - - public List getEvaluationCriterionBacteriologys() { - return evaluationCriterionBacteriologys; - } - - public void setEvaluationCriterionBacteriologys( - List evaluationCriterionBacteriologys) { - this.evaluationCriterionBacteriologys = evaluationCriterionBacteriologys; - } - - public List getEvaluationCriterionDisinfectants() { - return evaluationCriterionDisinfectants; - } - - public void setEvaluationCriterionDisinfectants( - List evaluationCriterionDisinfectants) { - this.evaluationCriterionDisinfectants = evaluationCriterionDisinfectants; - } - - public List getEvaluationCriterionSensoryorgans() { - return evaluationCriterionSensoryorgans; - } - - public void setEvaluationCriterionSensoryorgans( - List evaluationCriterionSensoryorgans) { - this.evaluationCriterionSensoryorgans = evaluationCriterionSensoryorgans; - } - - public List getEvaluationCriterionToxicologys() { - return evaluationCriterionToxicologys; - } - - public void setEvaluationCriterionToxicologys( - List evaluationCriterionToxicologys) { - this.evaluationCriterionToxicologys = evaluationCriterionToxicologys; - } - - public String get_evaluationCriterionBacteriologys() { - return _evaluationCriterionBacteriologys; - } - - public void set_evaluationCriterionBacteriologys( - String _evaluationCriterionBacteriologys) { - this._evaluationCriterionBacteriologys = _evaluationCriterionBacteriologys; - } - - public String get_evaluationCriterionDisinfectants() { - return _evaluationCriterionDisinfectants; - } - - public void set_evaluationCriterionDisinfectants( - String _evaluationCriterionDisinfectants) { - this._evaluationCriterionDisinfectants = _evaluationCriterionDisinfectants; - } - - public String get_evaluationCriterionSensoryorgans() { - return _evaluationCriterionSensoryorgans; - } - - public void set_evaluationCriterionSensoryorgans( - String _evaluationCriterionSensoryorgans) { - this._evaluationCriterionSensoryorgans = _evaluationCriterionSensoryorgans; - } - - public String get_evaluationCriterionToxicologys() { - return _evaluationCriterionToxicologys; - } - - public void set_evaluationCriterionToxicologys( - String _evaluationCriterionToxicologys) { - this._evaluationCriterionToxicologys = _evaluationCriterionToxicologys; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public String getIndexDefinition() { - return indexDefinition; - } - - public void setIndexDefinition(String indexDefinition) { - this.indexDefinition = indexDefinition; - } - - public String getIndexFrequency() { - return indexFrequency; - } - - public void setIndexFrequency(String indexFrequency) { - this.indexFrequency = indexFrequency; - } - - public String getIndexFunction() { - return indexFunction; - } - - public void setIndexFunction(String indexFunction) { - this.indexFunction = indexFunction; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getEvaluationcriterionBacteriologyIds() { - return evaluationcriterionBacteriologyIds; - } - - public void setEvaluationcriterionBacteriologyIds(String evaluationcriterionBacteriologyIds) { - this.evaluationcriterionBacteriologyIds = evaluationcriterionBacteriologyIds; - } - - public String getEvaluationcriterionDisinfectantIds() { - return evaluationcriterionDisinfectantIds; - } - - public void setEvaluationcriterionDisinfectantIds(String evaluationcriterionDisinfectantIds) { - this.evaluationcriterionDisinfectantIds = evaluationcriterionDisinfectantIds; - } - - public String getEvaluationcriterionSensoryorgansIds() { - return evaluationcriterionSensoryorgansIds; - } - - public void setEvaluationcriterionSensoryorgansIds(String evaluationcriterionSensoryorgansIds) { - this.evaluationcriterionSensoryorgansIds = evaluationcriterionSensoryorgansIds; - } - - public String getEvaluationcriterionToxicologyIds() { - return evaluationcriterionToxicologyIds; - } - - public void setEvaluationcriterionToxicologyIds(String evaluationcriterionToxicologyIds) { - this.evaluationcriterionToxicologyIds = evaluationcriterionToxicologyIds; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationIndexMonth.java b/src/com/sipai/entity/evaluation/EvaluationIndexMonth.java deleted file mode 100644 index 22a2ea60..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationIndexMonth.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 月评价指数 - * @author 54588 - * - */ -public class EvaluationIndexMonth extends SQLAdapter{ - private String id; - - private String insdt; - - private String date; - - private String criterionBacteriologyValue;//细菌学指标检测值json数据 - - private String criterionDisinfectantValue;//消毒剂指标检测值json数据 - - private String criterionSensoryorganValue;//感官指标检测值json数据 - - private String criterionToxicologyValue;//毒理指标检测值json数据 - - private String subIndexNation;//分指数(国标)json数据 - - private String subIndexArea;//分指数(地标)json数据 - - private String subIndexCompany;//分指数(内控)json数据 - - private Double wqiBacteriologyMonthNation;//细菌学指标国标综合指数 - - private Double wqiBacteriologyMonthArea;//细菌学指标地标综合指数 - - private Double wqiBacteriologyMonthCompany;//细菌学指标内控综合指数 - - private Double wqiDisinfectantMonthNation;//消毒剂指标国标综合指数 - - private Double wqiDisinfectantMonthArea;//消毒剂指标地标综合指数 - - private Double wqiDisinfectantMonthCompany;//消毒剂指标内控综合指数 - - private Double wqiSensoryorganMonthNation;//感官指标国标综合指数 - - private Double wqiSensoryorganMonthArea;//感官指标地标综合指数 - - private Double wqiSensoryorganMonthCompany;//感官指标内控综合指数 - - private Double wqiToxicologyMonthNation;//毒理指标国标综合指数 - - private Double wqiToxicologyMonthArea;//毒理指标地标综合指数 - - private Double wqiToxicologyMonthCompany;//毒理指标内控综合指数 - - private Double wqiMonthNation;//月评指数国标 - - private Double wqiMonthArea;//月评指数地标 - - private Double wqiMonthCompany;//月评指数内控 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public String getCriterionBacteriologyValue() { - return criterionBacteriologyValue; - } - - public void setCriterionBacteriologyValue(String criterionBacteriologyValue) { - this.criterionBacteriologyValue = criterionBacteriologyValue; - } - - public String getCriterionDisinfectantValue() { - return criterionDisinfectantValue; - } - - public void setCriterionDisinfectantValue(String criterionDisinfectantValue) { - this.criterionDisinfectantValue = criterionDisinfectantValue; - } - - public String getCriterionSensoryorganValue() { - return criterionSensoryorganValue; - } - - public void setCriterionSensoryorganValue(String criterionSensoryorganValue) { - this.criterionSensoryorganValue = criterionSensoryorganValue; - } - - public String getCriterionToxicologyValue() { - return criterionToxicologyValue; - } - - public void setCriterionToxicologyValue(String criterionToxicologyValue) { - this.criterionToxicologyValue = criterionToxicologyValue; - } - - public String getSubIndexNation() { - return subIndexNation; - } - - public void setSubIndexNation(String subIndexNation) { - this.subIndexNation = subIndexNation; - } - - public String getSubIndexArea() { - return subIndexArea; - } - - public void setSubIndexArea(String subIndexArea) { - this.subIndexArea = subIndexArea; - } - - public String getSubIndexCompany() { - return subIndexCompany; - } - - public void setSubIndexCompany(String subIndexCompany) { - this.subIndexCompany = subIndexCompany; - } - - public Double getWqiBacteriologyMonthNation() { - return wqiBacteriologyMonthNation; - } - - public void setWqiBacteriologyMonthNation(Double wqiBacteriologyMonthNation) { - this.wqiBacteriologyMonthNation = wqiBacteriologyMonthNation; - } - - public Double getWqiBacteriologyMonthArea() { - return wqiBacteriologyMonthArea; - } - - public void setWqiBacteriologyMonthArea(Double wqiBacteriologyMonthArea) { - this.wqiBacteriologyMonthArea = wqiBacteriologyMonthArea; - } - - public Double getWqiBacteriologyMonthCompany() { - return wqiBacteriologyMonthCompany; - } - - public void setWqiBacteriologyMonthCompany(Double wqiBacteriologyMonthCompany) { - this.wqiBacteriologyMonthCompany = wqiBacteriologyMonthCompany; - } - - public Double getWqiDisinfectantMonthNation() { - return wqiDisinfectantMonthNation; - } - - public void setWqiDisinfectantMonthNation(Double wqiDisinfectantMonthNation) { - this.wqiDisinfectantMonthNation = wqiDisinfectantMonthNation; - } - - public Double getWqiDisinfectantMonthArea() { - return wqiDisinfectantMonthArea; - } - - public void setWqiDisinfectantMonthArea(Double wqiDisinfectantMonthArea) { - this.wqiDisinfectantMonthArea = wqiDisinfectantMonthArea; - } - - public Double getWqiDisinfectantMonthCompany() { - return wqiDisinfectantMonthCompany; - } - - public void setWqiDisinfectantMonthCompany(Double wqiDisinfectantMonthCompany) { - this.wqiDisinfectantMonthCompany = wqiDisinfectantMonthCompany; - } - - public Double getWqiSensoryorganMonthNation() { - return wqiSensoryorganMonthNation; - } - - public void setWqiSensoryorganMonthNation(Double wqiSensoryorganMonthNation) { - this.wqiSensoryorganMonthNation = wqiSensoryorganMonthNation; - } - - public Double getWqiSensoryorganMonthArea() { - return wqiSensoryorganMonthArea; - } - - public void setWqiSensoryorganMonthArea(Double wqiSensoryorganMonthArea) { - this.wqiSensoryorganMonthArea = wqiSensoryorganMonthArea; - } - - public Double getWqiSensoryorganMonthCompany() { - return wqiSensoryorganMonthCompany; - } - - public void setWqiSensoryorganMonthCompany(Double wqiSensoryorganMonthCompany) { - this.wqiSensoryorganMonthCompany = wqiSensoryorganMonthCompany; - } - - public Double getWqiToxicologyMonthNation() { - return wqiToxicologyMonthNation; - } - - public void setWqiToxicologyMonthNation(Double wqiToxicologyMonthNation) { - this.wqiToxicologyMonthNation = wqiToxicologyMonthNation; - } - - public Double getWqiToxicologyMonthArea() { - return wqiToxicologyMonthArea; - } - - public void setWqiToxicologyMonthArea(Double wqiToxicologyMonthArea) { - this.wqiToxicologyMonthArea = wqiToxicologyMonthArea; - } - - public Double getWqiToxicologyMonthCompany() { - return wqiToxicologyMonthCompany; - } - - public void setWqiToxicologyMonthCompany(Double wqiToxicologyMonthCompany) { - this.wqiToxicologyMonthCompany = wqiToxicologyMonthCompany; - } - - public Double getWqiMonthNation() { - return wqiMonthNation; - } - - public void setWqiMonthNation(Double wqiMonthNation) { - this.wqiMonthNation = wqiMonthNation; - } - - public Double getWqiMonthArea() { - return wqiMonthArea; - } - - public void setWqiMonthArea(Double wqiMonthArea) { - this.wqiMonthArea = wqiMonthArea; - } - - public Double getWqiMonthCompany() { - return wqiMonthCompany; - } - - public void setWqiMonthCompany(Double wqiMonthCompany) { - this.wqiMonthCompany = wqiMonthCompany; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationIndexY.java b/src/com/sipai/entity/evaluation/EvaluationIndexY.java deleted file mode 100644 index 2ed7ce4b..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationIndexY.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 年评价指标配置 - * @author 54588 - * - */ -public class EvaluationIndexY extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String indexName; - - private String indexDefinition; - - private String indexFrequency; - - private String indexFunction; - - private String remark; - - private String evaluationcriterionOrganicIds;//关联评价标准-有机物指标ids - - private String evaluationcriterionSmellIds;//关联评价标准-嗅味指标ids - - private String evaluationcriterionDbpsIds;//关联评价标准-消毒副产品指标ids - - private String evaluationcriterionBacteriologyIds;//关联评价标准-细菌学指标ids - - private String evaluationcriterionDisinfectantIds;//关联评价标准-消毒剂指标ids - - private String evaluationcriterionSensoryorgansIds;//关联评价标准-感官指标ids - - private String evaluationcriterionToxicologyIds;//关联评价标准-毒理指标ids - - private String type;// - - private List evaluationCriterionBacteriologys;//关联评价标准-细菌学指标 - - private List evaluationCriterionDisinfectants;//关联评价标准-消毒剂指标 - - private List evaluationCriterionSensoryorgans;//关联评价标准-感官指标 - - private List evaluationCriterionToxicologys;//关联评价标准-毒理指标 - - private List evaluationcriterionOrganics;//关联评价标准-有机物指标 - - private List evaluationcriterionSmells;//关联评价标准-嗅味指标 - - private List evaluationcriterionDbpss;//关联评价标准-消毒副产品指标 - - private String _evaluationCriterionBacteriologys; - - private String _evaluationCriterionDisinfectants; - - private String _evaluationCriterionSensoryorgans; - - private String _evaluationCriterionToxicologys; - - private String _evaluationcriterionOrganics; - - private String _evaluationcriterionSmells; - - private String _evaluationcriterionDbpss; - - public List getEvaluationCriterionBacteriologys() { - return evaluationCriterionBacteriologys; - } - - public void setEvaluationCriterionBacteriologys( - List evaluationCriterionBacteriologys) { - this.evaluationCriterionBacteriologys = evaluationCriterionBacteriologys; - } - - public List getEvaluationCriterionDisinfectants() { - return evaluationCriterionDisinfectants; - } - - public void setEvaluationCriterionDisinfectants( - List evaluationCriterionDisinfectants) { - this.evaluationCriterionDisinfectants = evaluationCriterionDisinfectants; - } - - public List getEvaluationCriterionSensoryorgans() { - return evaluationCriterionSensoryorgans; - } - - public void setEvaluationCriterionSensoryorgans( - List evaluationCriterionSensoryorgans) { - this.evaluationCriterionSensoryorgans = evaluationCriterionSensoryorgans; - } - - public List getEvaluationCriterionToxicologys() { - return evaluationCriterionToxicologys; - } - - public void setEvaluationCriterionToxicologys( - List evaluationCriterionToxicologys) { - this.evaluationCriterionToxicologys = evaluationCriterionToxicologys; - } - - public List getEvaluationcriterionOrganics() { - return evaluationcriterionOrganics; - } - - public void setEvaluationcriterionOrganics( - List evaluationcriterionOrganics) { - this.evaluationcriterionOrganics = evaluationcriterionOrganics; - } - - public List getEvaluationcriterionSmells() { - return evaluationcriterionSmells; - } - - public void setEvaluationcriterionSmells( - List evaluationcriterionSmells) { - this.evaluationcriterionSmells = evaluationcriterionSmells; - } - - public List getEvaluationcriterionDbpss() { - return evaluationcriterionDbpss; - } - - public void setEvaluationcriterionDbpss( - List evaluationcriterionDbpss) { - this.evaluationcriterionDbpss = evaluationcriterionDbpss; - } - - public String get_evaluationCriterionBacteriologys() { - return _evaluationCriterionBacteriologys; - } - - public void set_evaluationCriterionBacteriologys( - String _evaluationCriterionBacteriologys) { - this._evaluationCriterionBacteriologys = _evaluationCriterionBacteriologys; - } - - public String get_evaluationCriterionDisinfectants() { - return _evaluationCriterionDisinfectants; - } - - public void set_evaluationCriterionDisinfectants( - String _evaluationCriterionDisinfectants) { - this._evaluationCriterionDisinfectants = _evaluationCriterionDisinfectants; - } - - public String get_evaluationCriterionSensoryorgans() { - return _evaluationCriterionSensoryorgans; - } - - public void set_evaluationCriterionSensoryorgans( - String _evaluationCriterionSensoryorgans) { - this._evaluationCriterionSensoryorgans = _evaluationCriterionSensoryorgans; - } - - public String get_evaluationCriterionToxicologys() { - return _evaluationCriterionToxicologys; - } - - public void set_evaluationCriterionToxicologys( - String _evaluationCriterionToxicologys) { - this._evaluationCriterionToxicologys = _evaluationCriterionToxicologys; - } - - public String get_evaluationcriterionOrganics() { - return _evaluationcriterionOrganics; - } - - public void set_evaluationcriterionOrganics(String _evaluationcriterionOrganics) { - this._evaluationcriterionOrganics = _evaluationcriterionOrganics; - } - - public String get_evaluationcriterionSmells() { - return _evaluationcriterionSmells; - } - - public void set_evaluationcriterionSmells(String _evaluationcriterionSmells) { - this._evaluationcriterionSmells = _evaluationcriterionSmells; - } - - public String get_evaluationcriterionDbpss() { - return _evaluationcriterionDbpss; - } - - public void set_evaluationcriterionDbpss(String _evaluationcriterionDbpss) { - this._evaluationcriterionDbpss = _evaluationcriterionDbpss; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public String getIndexDefinition() { - return indexDefinition; - } - - public void setIndexDefinition(String indexDefinition) { - this.indexDefinition = indexDefinition; - } - - public String getIndexFrequency() { - return indexFrequency; - } - - public void setIndexFrequency(String indexFrequency) { - this.indexFrequency = indexFrequency; - } - - public String getIndexFunction() { - return indexFunction; - } - - public void setIndexFunction(String indexFunction) { - this.indexFunction = indexFunction; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getEvaluationcriterionBacteriologyIds() { - return evaluationcriterionBacteriologyIds; - } - - public void setEvaluationcriterionBacteriologyIds(String evaluationcriterionBacteriologyIds) { - this.evaluationcriterionBacteriologyIds = evaluationcriterionBacteriologyIds; - } - - public String getEvaluationcriterionDisinfectantIds() { - return evaluationcriterionDisinfectantIds; - } - - public void setEvaluationcriterionDisinfectantIds(String evaluationcriterionDisinfectantIds) { - this.evaluationcriterionDisinfectantIds = evaluationcriterionDisinfectantIds; - } - - public String getEvaluationcriterionSensoryorgansIds() { - return evaluationcriterionSensoryorgansIds; - } - - public void setEvaluationcriterionSensoryorgansIds(String evaluationcriterionSensoryorgansIds) { - this.evaluationcriterionSensoryorgansIds = evaluationcriterionSensoryorgansIds; - } - - public String getEvaluationcriterionToxicologyIds() { - return evaluationcriterionToxicologyIds; - } - - public void setEvaluationcriterionToxicologyIds(String evaluationcriterionToxicologyIds) { - this.evaluationcriterionToxicologyIds = evaluationcriterionToxicologyIds; - } - - public String getEvaluationcriterionOrganicIds() { - return evaluationcriterionOrganicIds; - } - - public void setEvaluationcriterionOrganicIds(String evaluationcriterionOrganicIds) { - this.evaluationcriterionOrganicIds = evaluationcriterionOrganicIds; - } - - public String getEvaluationcriterionSmellIds() { - return evaluationcriterionSmellIds; - } - - public void setEvaluationcriterionSmellIds(String evaluationcriterionSmellIds) { - this.evaluationcriterionSmellIds = evaluationcriterionSmellIds; - } - - public String getEvaluationcriterionDbpsIds() { - return evaluationcriterionDbpsIds; - } - - public void setEvaluationcriterionDbpsIds(String evaluationcriterionDbpsIds) { - this.evaluationcriterionDbpsIds = evaluationcriterionDbpsIds; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/evaluation/EvaluationIndexYear.java b/src/com/sipai/entity/evaluation/EvaluationIndexYear.java deleted file mode 100644 index ef4b3d20..00000000 --- a/src/com/sipai/entity/evaluation/EvaluationIndexYear.java +++ /dev/null @@ -1,412 +0,0 @@ -package com.sipai.entity.evaluation; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 年评价指数 - * @author 54588 - * - */ -public class EvaluationIndexYear extends SQLAdapter{ - private String id; - - private String insdt; - - private String date; - - private String criterionBacteriologyValue;//细菌学指标检测值json数据 - - private String criterionDisinfectantValue;//消毒剂指标检测值json数据 - - private String criterionSensoryorganValue;//感官指标检测值json数据 - - private String criterionToxicologyValue;//毒理指标检测值json数据 - - private String criterionOrganicValue;//有机物指标检测值json数据 - - private String criterionSmellValue;//嗅味指标检测值json数据 - - private String criterionDbpsValue;//消毒副产品指标检测值json数据 - - private Double wqiBacteriologyYearNation;//细菌学指标国标综合指数 - - private Double wqiBacteriologyYearArea;//细菌学指标地标综合指数 - - private Double wqiBacteriologyYearCompany;//细菌学指标内控综合指数 - - private Double wqiDisinfectantYearNation;//消毒剂指标国标综合指数 - - private Double wqiDisinfectantYearArea;//消毒剂指标地标综合指数 - - private Double wqiDisinfectantYearCompany;//消毒剂指标内控综合指数 - - private Double wqiSensoryorganYearNation;//感官指标国标综合指数 - - private Double wqiSensoryorganYearArea;//感官指标地标综合指数 - - private Double wqiSensoryorganYearCompany;//感官指标内控综合指数 - - private Double wqiToxicologyYearNation;//毒理指标国标综合指数 - - private Double wqiToxicologyYearArea;//毒理指标地标综合指数 - - private Double wqiToxicologyYearCompany;//毒理指标内控综合指数 - - private Double wqiOrganicYearNation;//有机物指标国标综合指数 - - private Double wqiOrganicYearArea;//有机物指标地标综合指数 - - private Double wqiOrganicYearCompany;//有机物指标内控综合指数 - - private Double wqiSmellYearNation;//嗅味指标国标综合指数 - - private Double wqiSmellYearArea;//嗅味指标地标综合指数 - - private Double wqiSmellYearCompany;//嗅味指标内控综合指数 - - private Double wqiDbpsYearNation;//消毒副产品指标国标综合指数 - - private Double wqiDbpsYearArea;//消毒副产品指标地标综合指数 - - private Double wqiDbpsYearCompany;//消毒副产品指标内控综合指数 - - private Double wqiBasicYearNation;//基础国标指数 - - private Double wqiBasicYearArea;//基础地标指数 - - private Double wqiBasicYearCompany;//基础内控指数 - - private Double wqiFeaturesYearNation;//特征国标指数 - - private Double wqiFeaturesYearArea;//特征地标指数 - - private Double wqiFeaturesYearCompany;//特征内控指数 - - private Double wqiYearNation;//年评价国标指数 - - private Double wqiYearArea;//年评价地标指数 - - private Double wqiYearCompany;//年评价内控指数 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public String getCriterionBacteriologyValue() { - return criterionBacteriologyValue; - } - - public void setCriterionBacteriologyValue(String criterionBacteriologyValue) { - this.criterionBacteriologyValue = criterionBacteriologyValue; - } - - public String getCriterionDisinfectantValue() { - return criterionDisinfectantValue; - } - - public void setCriterionDisinfectantValue(String criterionDisinfectantValue) { - this.criterionDisinfectantValue = criterionDisinfectantValue; - } - - public String getCriterionSensoryorganValue() { - return criterionSensoryorganValue; - } - - public void setCriterionSensoryorganValue(String criterionSensoryorganValue) { - this.criterionSensoryorganValue = criterionSensoryorganValue; - } - - public String getCriterionToxicologyValue() { - return criterionToxicologyValue; - } - - public void setCriterionToxicologyValue(String criterionToxicologyValue) { - this.criterionToxicologyValue = criterionToxicologyValue; - } - - public String getCriterionOrganicValue() { - return criterionOrganicValue; - } - - public void setCriterionOrganicValue(String criterionOrganicValue) { - this.criterionOrganicValue = criterionOrganicValue; - } - - public String getCriterionSmellValue() { - return criterionSmellValue; - } - - public void setCriterionSmellValue(String criterionSmellValue) { - this.criterionSmellValue = criterionSmellValue; - } - - public String getCriterionDbpsValue() { - return criterionDbpsValue; - } - - public void setCriterionDbpsValue(String criterionDbpsValue) { - this.criterionDbpsValue = criterionDbpsValue; - } - - public Double getWqiBacteriologyYearNation() { - return wqiBacteriologyYearNation; - } - - public void setWqiBacteriologyYearNation(Double wqiBacteriologyYearNation) { - this.wqiBacteriologyYearNation = wqiBacteriologyYearNation; - } - - public Double getWqiBacteriologyYearArea() { - return wqiBacteriologyYearArea; - } - - public void setWqiBacteriologyYearArea(Double wqiBacteriologyYearArea) { - this.wqiBacteriologyYearArea = wqiBacteriologyYearArea; - } - - public Double getWqiBacteriologyYearCompany() { - return wqiBacteriologyYearCompany; - } - - public void setWqiBacteriologyYearCompany(Double wqiBacteriologyYearCompany) { - this.wqiBacteriologyYearCompany = wqiBacteriologyYearCompany; - } - - public Double getWqiDisinfectantYearNation() { - return wqiDisinfectantYearNation; - } - - public void setWqiDisinfectantYearNation(Double wqiDisinfectantYearNation) { - this.wqiDisinfectantYearNation = wqiDisinfectantYearNation; - } - - public Double getWqiDisinfectantYearArea() { - return wqiDisinfectantYearArea; - } - - public void setWqiDisinfectantYearArea(Double wqiDisinfectantYearArea) { - this.wqiDisinfectantYearArea = wqiDisinfectantYearArea; - } - - public Double getWqiDisinfectantYearCompany() { - return wqiDisinfectantYearCompany; - } - - public void setWqiDisinfectantYearCompany(Double wqiDisinfectantYearCompany) { - this.wqiDisinfectantYearCompany = wqiDisinfectantYearCompany; - } - - public Double getWqiSensoryorganYearNation() { - return wqiSensoryorganYearNation; - } - - public void setWqiSensoryorganYearNation(Double wqiSensoryorganYearNation) { - this.wqiSensoryorganYearNation = wqiSensoryorganYearNation; - } - - public Double getWqiSensoryorganYearArea() { - return wqiSensoryorganYearArea; - } - - public void setWqiSensoryorganYearArea(Double wqiSensoryorganYearArea) { - this.wqiSensoryorganYearArea = wqiSensoryorganYearArea; - } - - public Double getWqiSensoryorganYearCompany() { - return wqiSensoryorganYearCompany; - } - - public void setWqiSensoryorganYearCompany(Double wqiSensoryorganYearCompany) { - this.wqiSensoryorganYearCompany = wqiSensoryorganYearCompany; - } - - public Double getWqiToxicologyYearNation() { - return wqiToxicologyYearNation; - } - - public void setWqiToxicologyYearNation(Double wqiToxicologyYearNation) { - this.wqiToxicologyYearNation = wqiToxicologyYearNation; - } - - public Double getWqiToxicologyYearArea() { - return wqiToxicologyYearArea; - } - - public void setWqiToxicologyYearArea(Double wqiToxicologyYearArea) { - this.wqiToxicologyYearArea = wqiToxicologyYearArea; - } - - public Double getWqiToxicologyYearCompany() { - return wqiToxicologyYearCompany; - } - - public void setWqiToxicologyYearCompany(Double wqiToxicologyYearCompany) { - this.wqiToxicologyYearCompany = wqiToxicologyYearCompany; - } - - public Double getWqiOrganicYearNation() { - return wqiOrganicYearNation; - } - - public void setWqiOrganicYearNation(Double wqiOrganicYearNation) { - this.wqiOrganicYearNation = wqiOrganicYearNation; - } - - public Double getWqiOrganicYearArea() { - return wqiOrganicYearArea; - } - - public void setWqiOrganicYearArea(Double wqiOrganicYearArea) { - this.wqiOrganicYearArea = wqiOrganicYearArea; - } - - public Double getWqiOrganicYearCompany() { - return wqiOrganicYearCompany; - } - - public void setWqiOrganicYearCompany(Double wqiOrganicYearCompany) { - this.wqiOrganicYearCompany = wqiOrganicYearCompany; - } - - public Double getWqiSmellYearNation() { - return wqiSmellYearNation; - } - - public void setWqiSmellYearNation(Double wqiSmellYearNation) { - this.wqiSmellYearNation = wqiSmellYearNation; - } - - public Double getWqiSmellYearArea() { - return wqiSmellYearArea; - } - - public void setWqiSmellYearArea(Double wqiSmellYearArea) { - this.wqiSmellYearArea = wqiSmellYearArea; - } - - public Double getWqiSmellYearCompany() { - return wqiSmellYearCompany; - } - - public void setWqiSmellYearCompany(Double wqiSmellYearCompany) { - this.wqiSmellYearCompany = wqiSmellYearCompany; - } - - public Double getWqiDbpsYearNation() { - return wqiDbpsYearNation; - } - - public void setWqiDbpsYearNation(Double wqiDbpsYearNation) { - this.wqiDbpsYearNation = wqiDbpsYearNation; - } - - public Double getWqiDbpsYearArea() { - return wqiDbpsYearArea; - } - - public void setWqiDbpsYearArea(Double wqiDbpsYearArea) { - this.wqiDbpsYearArea = wqiDbpsYearArea; - } - - public Double getWqiDbpsYearCompany() { - return wqiDbpsYearCompany; - } - - public void setWqiDbpsYearCompany(Double wqiDbpsYearCompany) { - this.wqiDbpsYearCompany = wqiDbpsYearCompany; - } - - public Double getWqiBasicYearNation() { - return wqiBasicYearNation; - } - - public void setWqiBasicYearNation(Double wqiBasicYearNation) { - this.wqiBasicYearNation = wqiBasicYearNation; - } - - public Double getWqiBasicYearArea() { - return wqiBasicYearArea; - } - - public void setWqiBasicYearArea(Double wqiBasicYearArea) { - this.wqiBasicYearArea = wqiBasicYearArea; - } - - public Double getWqiBasicYearCompany() { - return wqiBasicYearCompany; - } - - public void setWqiBasicYearCompany(Double wqiBasicYearCompany) { - this.wqiBasicYearCompany = wqiBasicYearCompany; - } - - public Double getWqiFeaturesYearNation() { - return wqiFeaturesYearNation; - } - - public void setWqiFeaturesYearNation(Double wqiFeaturesYearNation) { - this.wqiFeaturesYearNation = wqiFeaturesYearNation; - } - - public Double getWqiFeaturesYearArea() { - return wqiFeaturesYearArea; - } - - public void setWqiFeaturesYearArea(Double wqiFeaturesYearArea) { - this.wqiFeaturesYearArea = wqiFeaturesYearArea; - } - - public Double getWqiFeaturesYearCompany() { - return wqiFeaturesYearCompany; - } - - public void setWqiFeaturesYearCompany(Double wqiFeaturesYearCompany) { - this.wqiFeaturesYearCompany = wqiFeaturesYearCompany; - } - - public Double getWqiYearNation() { - return wqiYearNation; - } - - public void setWqiYearNation(Double wqiYearNation) { - this.wqiYearNation = wqiYearNation; - } - - public Double getWqiYearArea() { - return wqiYearArea; - } - - public void setWqiYearArea(Double wqiYearArea) { - this.wqiYearArea = wqiYearArea; - } - - public Double getWqiYearCompany() { - return wqiYearCompany; - } - - public void setWqiYearCompany(Double wqiYearCompany) { - this.wqiYearCompany = wqiYearCompany; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/DaytestPaper.java b/src/com/sipai/entity/exam/DaytestPaper.java deleted file mode 100644 index 5f01aa33..00000000 --- a/src/com/sipai/entity/exam/DaytestPaper.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class DaytestPaper extends SQLAdapter { - private String id; - - private String daytestrecordid; - - private String questitleid; - - private String answervalue; - - private String status; - - private String mark; - - private Integer ord; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String questypeid; - - private String useranswer; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDaytestrecordid() { - return daytestrecordid; - } - - public void setDaytestrecordid(String daytestrecordid) { - this.daytestrecordid = daytestrecordid; - } - - public String getQuestitleid() { - return questitleid; - } - - public void setQuestitleid(String questitleid) { - this.questitleid = questitleid; - } - - public String getAnswervalue() { - return answervalue; - } - - public void setAnswervalue(String answervalue) { - this.answervalue = answervalue; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getMark() { - return mark; - } - - public void setMark(String mark) { - this.mark = mark; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getQuestypeid() { - return questypeid; - } - - public void setQuestypeid(String questypeid) { - this.questypeid = questypeid; - } - - public String getUseranswer() { - return useranswer; - } - - public void setUseranswer(String useranswer) { - this.useranswer = useranswer; - } - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/DaytestQuesOption.java b/src/com/sipai/entity/exam/DaytestQuesOption.java deleted file mode 100644 index 2d7dc0d5..00000000 --- a/src/com/sipai/entity/exam/DaytestQuesOption.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class DaytestQuesOption extends SQLAdapter { - private String id; - - private String daytestpaperid; - - private String quesoptionid; - - private String optionnumber; - - private Integer ord; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDaytestpaperid() { - return daytestpaperid; - } - - public void setDaytestpaperid(String daytestpaperid) { - this.daytestpaperid = daytestpaperid; - } - - public String getQuesoptionid() { - return quesoptionid; - } - - public void setQuesoptionid(String quesoptionid) { - this.quesoptionid = quesoptionid; - } - - public String getOptionnumber() { - return optionnumber; - } - - public void setOptionnumber(String optionnumber) { - this.optionnumber = optionnumber; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/DaytestRecord.java b/src/com/sipai/entity/exam/DaytestRecord.java deleted file mode 100644 index 1af43609..00000000 --- a/src/com/sipai/entity/exam/DaytestRecord.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class DaytestRecord extends SQLAdapter { - private String id; - - private String examuserid; - - private String examstarttime; - - private String examendtime; - - private String status; - - private String insuser; - - private String insdt; - - private String memo; - - private String subjecttypeids; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getExamuserid() { - return examuserid; - } - - public void setExamuserid(String examuserid) { - this.examuserid = examuserid; - } - - public String getExamstarttime() { - return examstarttime; - } - - public void setExamstarttime(String examstarttime) { - this.examstarttime = examstarttime; - } - - public String getExamendtime() { - return examendtime; - } - - public void setExamendtime(String examendtime) { - this.examendtime = examendtime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getSubjecttypeids() { - return subjecttypeids; - } - - public void setSubjecttypeids(String subjecttypeids) { - this.subjecttypeids = subjecttypeids; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/ExamPlan.java b/src/com/sipai/entity/exam/ExamPlan.java deleted file mode 100644 index 5c0025f7..00000000 --- a/src/com/sipai/entity/exam/ExamPlan.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class ExamPlan extends SQLAdapter { - private String id; - - private String examhallid; - - private String examtype; - - private Double passscore; - - private String exammethod; - - private Integer examnum; - - private String releasetime; - - private String status; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String startdate; - - private String enddate; - - private String computescore; - - private String frequency; - - private Integer examminutes; - - private String examuserids; - - private String memo; - - private String examname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getExamhallid() { - return examhallid; - } - - public void setExamhallid(String examhallid) { - this.examhallid = examhallid; - } - - public String getExamtype() { - return examtype; - } - - public void setExamtype(String examtype) { - this.examtype = examtype; - } - - public Double getPassscore() { - return passscore; - } - - public void setPassscore(Double passscore) { - this.passscore = passscore; - } - - public String getExammethod() { - return exammethod; - } - - public void setExammethod(String exammethod) { - this.exammethod = exammethod; - } - - public Integer getExamnum() { - return examnum; - } - - public void setExamnum(Integer examnum) { - this.examnum = examnum; - } - - public String getReleasetime() { - return releasetime; - } - - public void setReleasetime(String releasetime) { - this.releasetime = releasetime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getStartdate() { - return startdate; - } - - public void setStartdate(String startdate) { - this.startdate = startdate; - } - - public String getEnddate() { - return enddate; - } - - public void setEnddate(String enddate) { - this.enddate = enddate; - } - - public String getComputescore() { - return computescore; - } - - public void setComputescore(String computescore) { - this.computescore = computescore; - } - - public String getFrequency() { - return frequency; - } - - public void setFrequency(String frequency) { - this.frequency = frequency; - } - - public Integer getExamminutes() { - return examminutes; - } - - public void setExamminutes(Integer examminutes) { - this.examminutes = examminutes; - } - - public String getExamuserids() { - return examuserids; - } - - public void setExamuserids(String examuserids) { - this.examuserids = examuserids; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getExamname() { - return examname; - } - - public void setExamname(String examname) { - this.examname = examname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/ExamRecord.java b/src/com/sipai/entity/exam/ExamRecord.java deleted file mode 100644 index a2962921..00000000 --- a/src/com/sipai/entity/exam/ExamRecord.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class ExamRecord extends SQLAdapter { - private String id; - - private String examplanid; - - private String examhallid; - - private Integer examcount; - - private String startdate; - - private String enddate; - - private String examuserid; - - private String examusernumber; - - private String examdate; - - private String examstarttime; - - private String examendtime; - - private Double examscore; - - private String status; - - private String insuser; - - private String insdt; - - private String passstatus; - //考试计划 - private ExamPlan examPlan; - - private String _examname; - - private String _username; - - private String _allcount; - - private String _notcount; - - private String _passcount; - - public String get_username() { - return _username; - } - - public void set_username(String _username) { - this._username = _username; - } - - public String get_examname() { - return _examname; - } - - public void set_examname(String _examname) { - this._examname = _examname; - } - - public ExamPlan getExamPlan() { - return examPlan; - } - - public void setExamPlan(ExamPlan examPlan) { - this.examPlan = examPlan; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getExamplanid() { - return examplanid; - } - - public void setExamplanid(String examplanid) { - this.examplanid = examplanid; - } - - public String getExamhallid() { - return examhallid; - } - - public void setExamhallid(String examhallid) { - this.examhallid = examhallid; - } - - public Integer getExamcount() { - return examcount; - } - - public void setExamcount(Integer examcount) { - this.examcount = examcount; - } - - public String getStartdate() { - return startdate; - } - - public void setStartdate(String startdate) { - this.startdate = startdate; - } - - public String getEnddate() { - return enddate; - } - - public void setEnddate(String enddate) { - this.enddate = enddate; - } - - public String getExamuserid() { - return examuserid; - } - - public void setExamuserid(String examuserid) { - this.examuserid = examuserid; - } - - public String getExamusernumber() { - return examusernumber; - } - - public void setExamusernumber(String examusernumber) { - this.examusernumber = examusernumber; - } - - public String getExamdate() { - return examdate; - } - - public void setExamdate(String examdate) { - this.examdate = examdate; - } - - public String getExamstarttime() { - return examstarttime; - } - - public void setExamstarttime(String examstarttime) { - this.examstarttime = examstarttime; - } - - public String getExamendtime() { - return examendtime; - } - - public void setExamendtime(String examendtime) { - this.examendtime = examendtime; - } - - public Double getExamscore() { - return examscore; - } - - public void setExamscore(Double examscore) { - this.examscore = examscore; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getPassstatus() { - return passstatus; - } - - public void setPassstatus(String passstatus) { - this.passstatus = passstatus; - } - - public String get_allcount() { - return _allcount; - } - - public void set_allcount(String _allcount) { - this._allcount = _allcount; - } - - public String get_notcount() { - return _notcount; - } - - public void set_notcount(String _notcount) { - this._notcount = _notcount; - } - - public String get_passcount() { - return _passcount; - } - - public void set_passcount(String _passcount) { - this._passcount = _passcount; - } - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/ExamTitleRange.java b/src/com/sipai/entity/exam/ExamTitleRange.java deleted file mode 100644 index fdc992e6..00000000 --- a/src/com/sipai/entity/exam/ExamTitleRange.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class ExamTitleRange extends SQLAdapter { - private String id; - - private String pid; - - private String subjecttypeids; - - private String ranktypeids; - - private String questtypeid; - - private Integer singlyscore; - - private Integer titlenum; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private Integer ord; - - private String _subjectTypeName; - private String _rankTypeName; - private String _questTypeName; - private Integer _score; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getSubjecttypeids() { - return subjecttypeids; - } - - public void setSubjecttypeids(String subjecttypeids) { - this.subjecttypeids = subjecttypeids; - } - - public String getRanktypeids() { - return ranktypeids; - } - - public void setRanktypeids(String ranktypeids) { - this.ranktypeids = ranktypeids; - } - - public String getQuesttypeid() { - return questtypeid; - } - - public void setQuesttypeid(String questtypeid) { - this.questtypeid = questtypeid; - } - - public Integer getSinglyscore() { - return singlyscore; - } - - public void setSinglyscore(Integer singlyscore) { - this.singlyscore = singlyscore; - } - - public Integer getTitlenum() { - return titlenum; - } - - public void setTitlenum(Integer titlenum) { - this.titlenum = titlenum; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String get_subjectTypeName() { - return _subjectTypeName; - } - - public void set_subjectTypeName(String _subjectTypeName) { - this._subjectTypeName = _subjectTypeName; - } - - public String get_rankTypeName() { - return _rankTypeName; - } - - public void set_rankTypeName(String _rankTypeName) { - this._rankTypeName = _rankTypeName; - } - - public String get_questTypeName() { - return _questTypeName; - } - - public void set_questTypeName(String _questTypeName) { - this._questTypeName = _questTypeName; - } - - public Integer get_score() { - return _score; - } - - public void set_score(Integer _score) { - this._score = _score; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/TestPaper.java b/src/com/sipai/entity/exam/TestPaper.java deleted file mode 100644 index b69a9a8e..00000000 --- a/src/com/sipai/entity/exam/TestPaper.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class TestPaper extends SQLAdapter { - private String id; - - private String examrecordid; - - private String questitleid; - - private String answervalue; - - private String useranswer; - - private String status; - - private Integer ord; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String mark; - - private String questtypeid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getExamrecordid() { - return examrecordid; - } - - public void setExamrecordid(String examrecordid) { - this.examrecordid = examrecordid; - } - - public String getQuestitleid() { - return questitleid; - } - - public void setQuestitleid(String questitleid) { - this.questitleid = questitleid; - } - - public String getAnswervalue() { - return answervalue; - } - - public void setAnswervalue(String answervalue) { - this.answervalue = answervalue; - } - - public String getUseranswer() { - return useranswer; - } - - public void setUseranswer(String useranswer) { - this.useranswer = useranswer; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getMark() { - return mark; - } - - public void setMark(String mark) { - this.mark = mark; - } - - public String getQuesttypeid() { - return questtypeid; - } - - public void setQuesttypeid(String questtypeid) { - this.questtypeid = questtypeid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/exam/TestQuesOption.java b/src/com/sipai/entity/exam/TestQuesOption.java deleted file mode 100644 index a10a4d01..00000000 --- a/src/com/sipai/entity/exam/TestQuesOption.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.exam; - -import com.sipai.entity.base.SQLAdapter; - -public class TestQuesOption extends SQLAdapter { - private String id; - - private String testpaperid; - - private String quesoptionid; - - private String optionnumber; - - private Integer ord; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTestpaperid() { - return testpaperid; - } - - public void setTestpaperid(String testpaperid) { - this.testpaperid = testpaperid; - } - - public String getQuesoptionid() { - return quesoptionid; - } - - public void setQuesoptionid(String quesoptionid) { - this.quesoptionid = quesoptionid; - } - - public String getOptionnumber() { - return optionnumber; - } - - public void setOptionnumber(String optionnumber) { - this.optionnumber = optionnumber; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenBalance.java b/src/com/sipai/entity/fangzhen/FangZhenBalance.java deleted file mode 100644 index 5cbda7fd..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenBalance.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 获取调度仿真时的工位UI数据信号数据 - */ -public class FangZhenBalance extends BusinessUnitAdapter { - private String name; - - private String staytime; - - private String flowsignal; - - private String leftsignal; - - private String lodsignal; - - private String levelsignal; - - private Integer mode; - - private String waterqualitysignal; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getStaytime() { - return staytime; - } - - public void setStaytime(String staytime) { - this.staytime = staytime == null ? null : staytime.trim(); - } - - public String getFlowsignal() { - return flowsignal; - } - - public void setFlowsignal(String flowsignal) { - this.flowsignal = flowsignal == null ? null : flowsignal.trim(); - } - - public String getLeftsignal() { - return leftsignal; - } - - public void setLeftsignal(String leftsignal) { - this.leftsignal = leftsignal == null ? null : leftsignal.trim(); - } - - public String getLodsignal() { - return lodsignal; - } - - public void setLodsignal(String lodsignal) { - this.lodsignal = lodsignal == null ? null : lodsignal.trim(); - } - - public String getLevelsignal() { - return levelsignal; - } - - public void setLevelsignal(String levelsignal) { - this.levelsignal = levelsignal == null ? null : levelsignal.trim(); - } - - public Integer getMode() { - return mode; - } - - public void setMode(Integer mode) { - this.mode = mode; - } - - public String getWaterqualitysignal() { - return waterqualitysignal; - } - - public void setWaterqualitysignal(String waterqualitysignal) { - this.waterqualitysignal = waterqualitysignal == null ? null : waterqualitysignal.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenBrowser.java b/src/com/sipai/entity/fangzhen/FangZhenBrowser.java deleted file mode 100644 index 21fc77c0..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenBrowser.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 获取窗口配置信息 - */ -public class FangZhenBrowser extends BusinessUnitAdapter { - private String browsername; - - private Double x; - - private Double y; - - private Double width; - - private Double height; - - private String url; - - private String stationid; - - private Integer scenemodeindex; - - public String getBrowsername() { - return browsername; - } - - public void setBrowsername(String browsername) { - this.browsername = browsername == null ? null : browsername.trim(); - } - - public Double getX() { - return x; - } - - public void setX(Double x) { - this.x = x; - } - - public Double getY() { - return y; - } - - public void setY(Double y) { - this.y = y; - } - - public Double getWidth() { - return width; - } - - public void setWidth(Double width) { - this.width = width; - } - - public Double getHeight() { - return height; - } - - public void setHeight(Double height) { - this.height = height; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url == null ? null : url.trim(); - } - - public String getStationid() { - return stationid; - } - - public void setStationid(String stationid) { - this.stationid = stationid == null ? null : stationid.trim(); - } - - public Integer getScenemodeindex() { - return scenemodeindex; - } - - public void setScenemodeindex(Integer scenemodeindex) { - this.scenemodeindex = scenemodeindex; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenEquipment.java b/src/com/sipai/entity/fangzhen/FangZhenEquipment.java deleted file mode 100644 index a45d0db9..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenEquipment.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 读取设备配置表 - */ -public class FangZhenEquipment extends BusinessUnitAdapter { - private String equipobjname; - - private String equipid; - - private String equipuiname; - - private String equiptype; - - private String runsignal; - - private String stationid; - - public String getEquipobjname() { - return equipobjname; - } - - public void setEquipobjname(String equipobjname) { - this.equipobjname = equipobjname == null ? null : equipobjname.trim(); - } - - public String getEquipid() { - return equipid; - } - - public void setEquipid(String equipid) { - this.equipid = equipid == null ? null : equipid.trim(); - } - - public String getEquipuiname() { - return equipuiname; - } - - public void setEquipuiname(String equipuiname) { - this.equipuiname = equipuiname == null ? null : equipuiname.trim(); - } - - public String getEquiptype() { - return equiptype; - } - - public void setEquiptype(String equiptype) { - this.equiptype = equiptype == null ? null : equiptype.trim(); - } - - public String getRunsignal() { - return runsignal; - } - - public void setRunsignal(String runsignal) { - this.runsignal = runsignal == null ? null : runsignal.trim(); - } - - public String getStationid() { - return stationid; - } - - public void setStationid(String stationid) { - this.stationid = stationid == null ? null : stationid.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenHeadUI.java b/src/com/sipai/entity/fangzhen/FangZhenHeadUI.java deleted file mode 100644 index e19f170b..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenHeadUI.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 读取页眉点位配置 - */ -public class FangZhenHeadUI extends BusinessUnitAdapter { - private String signalname; - - private String unit; - - private String rowindex; - - private String colindex; - - private String tabletype; - - private String tableindex; - - private String rowname; - - private String colname; - - public String getSignalname() { - return signalname; - } - - public void setSignalname(String signalname) { - this.signalname = signalname == null ? null : signalname.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } - - public String getRowindex() { - return rowindex; - } - - public void setRowindex(String rowindex) { - this.rowindex = rowindex == null ? null : rowindex.trim(); - } - - public String getColindex() { - return colindex; - } - - public void setColindex(String colindex) { - this.colindex = colindex == null ? null : colindex.trim(); - } - - public String getTabletype() { - return tabletype; - } - - public void setTabletype(String tabletype) { - this.tabletype = tabletype == null ? null : tabletype.trim(); - } - - public String getTableindex() { - return tableindex; - } - - public void setTableindex(String tableindex) { - this.tableindex = tableindex == null ? null : tableindex.trim(); - } - - public String getRowname() { - return rowname; - } - - public void setRowname(String rowname) { - this.rowname = rowname == null ? null : rowname.trim(); - } - - public String getColname() { - return colname; - } - - public void setColname(String colname) { - this.colname = colname == null ? null : colname.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenPipe.java b/src/com/sipai/entity/fangzhen/FangZhenPipe.java deleted file mode 100644 index 7b0d6f57..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenPipe.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 未定义 - */ -public class FangZhenPipe extends BusinessUnitAdapter { - private String name; - - private String id; - - private String stationid; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getStationid() { - return stationid; - } - - public void setStationid(String stationid) { - this.stationid = stationid == null ? null : stationid.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenStation.java b/src/com/sipai/entity/fangzhen/FangZhenStation.java deleted file mode 100644 index ee3a6f9b..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenStation.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 读取工位配置表 - */ -public class FangZhenStation extends BusinessUnitAdapter { - private String stationname; - - private String stationid; - - private String structuresid; - - private String leftsignal; - - private String lodsignal; - - private String flowsignal; - - private String waterqualitysignal; - - private String levelsignal; - - public String getStationname() { - return stationname; - } - - public void setStationname(String stationname) { - this.stationname = stationname == null ? null : stationname.trim(); - } - - public String getStationid() { - return stationid; - } - - public void setStationid(String stationid) { - this.stationid = stationid == null ? null : stationid.trim(); - } - - public String getStructuresid() { - return structuresid; - } - - public void setStructuresid(String structuresid) { - this.structuresid = structuresid == null ? null : structuresid.trim(); - } - - public String getLeftsignal() { - return leftsignal; - } - - public void setLeftsignal(String leftsignal) { - this.leftsignal = leftsignal == null ? null : leftsignal.trim(); - } - - public String getLodsignal() { - return lodsignal; - } - - public void setLodsignal(String lodsignal) { - this.lodsignal = lodsignal == null ? null : lodsignal.trim(); - } - - public String getFlowsignal() { - return flowsignal; - } - - public void setFlowsignal(String flowsignal) { - this.flowsignal = flowsignal == null ? null : flowsignal.trim(); - } - - public String getWaterqualitysignal() { - return waterqualitysignal; - } - - public void setWaterqualitysignal(String waterqualitysignal) { - this.waterqualitysignal = waterqualitysignal == null ? null : waterqualitysignal.trim(); - } - - public String getLevelsignal() { - return levelsignal; - } - - public void setLevelsignal(String levelsignal) { - this.levelsignal = levelsignal == null ? null : levelsignal.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenWater.java b/src/com/sipai/entity/fangzhen/FangZhenWater.java deleted file mode 100644 index 7a9f404a..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenWater.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 获取水池运行信号数据 - */ -public class FangZhenWater extends BusinessUnitAdapter { - private String name; - - private String runsignal; - - private String stopsignal; - - private String backflushsignal; - - private String filtrationsignal; - - private String maintainsignal; - - private String levelsignal; - - private String id; - - private String ntu; - - private String hcio; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getRunsignal() { - return runsignal; - } - - public void setRunsignal(String runsignal) { - this.runsignal = runsignal == null ? null : runsignal.trim(); - } - - public String getStopsignal() { - return stopsignal; - } - - public void setStopsignal(String stopsignal) { - this.stopsignal = stopsignal == null ? null : stopsignal.trim(); - } - - public String getBackflushsignal() { - return backflushsignal; - } - - public void setBackflushsignal(String backflushsignal) { - this.backflushsignal = backflushsignal == null ? null : backflushsignal.trim(); - } - - public String getFiltrationsignal() { - return filtrationsignal; - } - - public void setFiltrationsignal(String filtrationsignal) { - this.filtrationsignal = filtrationsignal == null ? null : filtrationsignal.trim(); - } - - public String getMaintainsignal() { - return maintainsignal; - } - - public void setMaintainsignal(String maintainsignal) { - this.maintainsignal = maintainsignal == null ? null : maintainsignal.trim(); - } - - public String getLevelsignal() { - return levelsignal; - } - - public void setLevelsignal(String levelsignal) { - this.levelsignal = levelsignal == null ? null : levelsignal.trim(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getNtu() { - return ntu; - } - - public void setNtu(String ntu) { - this.ntu = ntu == null ? null : ntu.trim(); - } - - public String getHcio() { - return hcio; - } - - public void setHcio(String hcio) { - this.hcio = hcio == null ? null : hcio.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fangzhen/FangZhenXeoma.java b/src/com/sipai/entity/fangzhen/FangZhenXeoma.java deleted file mode 100644 index 61f0b5ee..00000000 --- a/src/com/sipai/entity/fangzhen/FangZhenXeoma.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.entity.fangzhen; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 读取摄像头配置信息 - */ -public class FangZhenXeoma extends BusinessUnitAdapter { - private String name; - - private String id; - - private String station; - - private String ip; - - private String channel; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getStation() { - return station; - } - - public void setStation(String station) { - this.station = station == null ? null : station.trim(); - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip == null ? null : ip.trim(); - } - - public String getChannel() { - return channel; - } - - public void setChannel(String channel) { - this.channel = channel == null ? null : channel.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/finance/FinanceEquipmentDeptInfo.java b/src/com/sipai/entity/finance/FinanceEquipmentDeptInfo.java deleted file mode 100644 index 689e9910..00000000 --- a/src/com/sipai/entity/finance/FinanceEquipmentDeptInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.finance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class FinanceEquipmentDeptInfo extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String code; - - private String belongCode; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getBelongCode() { - return belongCode; - } - - public void setBelongCode(String belongCode) { - this.belongCode = belongCode; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fwk/Menunumber.java b/src/com/sipai/entity/fwk/Menunumber.java deleted file mode 100644 index 0973d2d7..00000000 --- a/src/com/sipai/entity/fwk/Menunumber.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.fwk; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Menunumber extends SQLAdapter{ - private String id; - - private String menuitemid; - - private String onclickdatetime; - - private String userid; - - private String _name; - - private int _number; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMenuitemid() { - return menuitemid; - } - - public void setMenuitemid(String menuitemid) { - this.menuitemid = menuitemid; - } - - public String getOnclickdatetime() { - return onclickdatetime; - } - - public void setOnclickdatetime(String onclickdatetime) { - this.onclickdatetime = onclickdatetime; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String get_name() { - return _name; - } - - public void set_name(String _name) { - this._name = _name; - } - - public int get_number() { - return _number; - } - - public void set_number(int _number) { - this._number = _number; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fwk/UserToMenu.java b/src/com/sipai/entity/fwk/UserToMenu.java deleted file mode 100644 index c32226e6..00000000 --- a/src/com/sipai/entity/fwk/UserToMenu.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.fwk; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class UserToMenu extends SQLAdapter{ - private String id; - - private String touserid; - - private String menuitemname; - - private String menuitemid; - - private String menuitemurl; - - private String pid; - - private Integer morder; - - private String insertuserid; - - private String insertdate; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTouserid() { - return touserid; - } - - public void setTouserid(String touserid) { - this.touserid = touserid; - } - - public String getMenuitemname() { - return menuitemname; - } - - public void setMenuitemname(String menuitemname) { - this.menuitemname = menuitemname; - } - - public String getMenuitemid() { - return menuitemid; - } - - public void setMenuitemid(String menuitemid) { - this.menuitemid = menuitemid; - } - - public String getMenuitemurl() { - return menuitemurl; - } - - public void setMenuitemurl(String menuitemurl) { - this.menuitemurl = menuitemurl; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getInsertuserid() { - return insertuserid; - } - - public void setInsertuserid(String insertuserid) { - this.insertuserid = insertuserid; - } - - public String getInsertdate() { - return insertdate; - } - - public void setInsertdate(String insertdate) { - this.insertdate = insertdate; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/fwk/WeatherHistory.java b/src/com/sipai/entity/fwk/WeatherHistory.java deleted file mode 100644 index db20bb8b..00000000 --- a/src/com/sipai/entity/fwk/WeatherHistory.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.fwk; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class WeatherHistory extends SQLAdapter{ - private String id; - - private String nowTemp; - - private String highTemp; - - private String lowTemp; - - private String wind; - - private String weather; - - private String insdt; - - private String insuser; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getNowTemp() { - return nowTemp; - } - - public void setNowTemp(String nowTemp) { - this.nowTemp = nowTemp; - } - - public String getHighTemp() { - return highTemp; - } - - public void setHighTemp(String highTemp) { - this.highTemp = highTemp; - } - - public String getLowTemp() { - return lowTemp; - } - - public void setLowTemp(String lowTemp) { - this.lowTemp = lowTemp; - } - - public String getWind() { - return wind; - } - - public void setWind(String wind) { - this.wind = wind; - } - - public String getWeather() { - return weather; - } - - public void setWeather(String weather) { - this.weather = weather; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/hqconfig/EnterRecord.java b/src/com/sipai/entity/hqconfig/EnterRecord.java deleted file mode 100644 index f11fedd6..00000000 --- a/src/com/sipai/entity/hqconfig/EnterRecord.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.sipai.entity.hqconfig; - -import com.sipai.entity.user.User; -import com.sipai.entity.work.AreaManage; - -import java.util.Date; - -public class EnterRecord { - private String id; - - private String intime; - - private String enterid; - - private String areaid; - - private Boolean state;//1:进入 0:已离开 - - private String _state;//1:进入 0:已离开 - - private AreaManage area; - - private AreaManage areaT; - - private Double duration; - - private String fid; - - private String outtime; - - private String where; - - private User enter; - - private String areaName; - - private String personName; - - private String jobText; - - private String areaText; - - // 逗留时长文本 - private String durationText; - - public String getJobText() { - return jobText; - } - - public void setJobText(String jobText) { - this.jobText = jobText; - } - - public String getDurationText() { - return durationText; - } - - public void setDurationText(String durationText) { - this.durationText = durationText; - } - - public String getAreaText() { - return areaText; - } - - public void setAreaText(String areaText) { - this.areaText = areaText; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getIntime() { - return intime; - } - - public void setIntime(String intime) { - this.intime = intime; - } - - public String getEnterid() { - return enterid; - } - - public void setEnterid(String enterid) { - this.enterid = enterid; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public Boolean getState() { - return state; - } - - public void setState(Boolean state) { - this.state = state; - } - - public String get_state() { - return _state; - } - - public void set_state(String _state) { - this._state = _state; - } - - public AreaManage getArea() { - return area; - } - - public void setArea(AreaManage area) { - this.area = area; - } - - public AreaManage getAreaT() { - return areaT; - } - - public void setAreaT(AreaManage areaT) { - this.areaT = areaT; - } - - public Double getDuration() { - return duration; - } - - public void setDuration(Double duration) { - this.duration = duration; - } - - public String getFid() { - return fid; - } - - public void setFid(String fid) { - this.fid = fid; - } - - public String getOuttime() { - return outtime; - } - - public void setOuttime(String outtime) { - this.outtime = outtime; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public User getEnter() { - return enter; - } - - public void setEnter(User enter) { - this.enter = enter; - } - - public String getAreaName() { - return areaName; - } - - public void setAreaName(String areaName) { - this.areaName = areaName; - } - - public String getPersonName() { - return personName; - } - - public void setPersonName(String personName) { - this.personName = personName; - } -} diff --git a/src/com/sipai/entity/hqconfig/HQAlarmRecord.java b/src/com/sipai/entity/hqconfig/HQAlarmRecord.java deleted file mode 100644 index f42dbdeb..00000000 --- a/src/com/sipai/entity/hqconfig/HQAlarmRecord.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.sipai.entity.hqconfig; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 风险诊断记录 - */ -public class HQAlarmRecord extends SQLAdapter{ - private String id; - - private String insdt; - - private String areaid; - - private String cameraid; - - private String alarmtypeid;//报警类型id - - private String state; - - private String eliminatedt; - - private String confirmerid; - - private String confirmdt; - - private String remark; - - private String name;//报警内容 - - private String areaName;//区域名称 - - private String riskLevel;//风险等级 数据库存:ABCD - private String mpcode;//测量点code - - private String dataframe; - - /** - * 摄像头关联模型id - */ - private String cameraDetailId; - - private String unitId; - - private RiskLevel riskLevel_entity; - - private Double _num;//仅用于统计查询中as l 2021-09-14 - - private String _date; - private String _areaName1;//一级区域名称 - private String _areaName2;//二级区域名称 - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - private String targetid;//可以关联人或点位,用于消除报警时查找道响应的报警人或点位 - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Double get_num() { - return _num; - } - - public String get_areaName1() { - return _areaName1; - } - - public void set_areaName1(String _areaName1) { - this._areaName1 = _areaName1; - } - - public String get_areaName2() { - return _areaName2; - } - - public void set_areaName2(String _areaName2) { - this._areaName2 = _areaName2; - } - - public String getCameraDetailId() { - return cameraDetailId; - } - - public void setCameraDetailId(String cameraDetailId) { - this.cameraDetailId = cameraDetailId; - } - - public String getTargetid() { - return targetid; - } - - public void setTargetid(String targetid) { - this.targetid = targetid; - } - - public void set_num(Double _num) { - this._num = _num; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } - - public RiskLevel getRiskLevel_entity() { - return riskLevel_entity; - } - - public void setRiskLevel_entity(RiskLevel riskLevel_entity) { - this.riskLevel_entity = riskLevel_entity; - } - - public String getAreaName() { - return areaName; - } - - public void setAreaName(String areaName) { - this.areaName = areaName; - } - - public String getRiskLevel() { - return riskLevel; - } - - public void setRiskLevel(String riskLevel) { - this.riskLevel = riskLevel; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public String getCameraid() { - return cameraid; - } - - public void setCameraid(String cameraid) { - this.cameraid = cameraid; - } - - public String getAlarmtypeid() { - return alarmtypeid; - } - - public void setAlarmtypeid(String alarmtypeid) { - this.alarmtypeid = alarmtypeid; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getEliminatedt() { - return eliminatedt; - } - - public void setEliminatedt(String eliminatedt) { - this.eliminatedt = eliminatedt; - } - - public String getConfirmerid() { - return confirmerid; - } - - public void setConfirmerid(String confirmerid) { - this.confirmerid = confirmerid; - } - - public String getConfirmdt() { - return confirmdt; - } - - public void setConfirmdt(String confirmdt) { - this.confirmdt = confirmdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDataframe() { - return dataframe; - } - - public void setDataframe(String dataframe) { - this.dataframe = dataframe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/hqconfig/PositionsCasual.java b/src/com/sipai/entity/hqconfig/PositionsCasual.java deleted file mode 100644 index 62a3d99c..00000000 --- a/src/com/sipai/entity/hqconfig/PositionsCasual.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.entity.hqconfig; - -import com.sipai.entity.base.SQLAdapter; - -import java.util.Date; - -public class PositionsCasual extends SQLAdapter { - private String id; - - private String name; - - private String x; - - private String y; - - private String floor; - - private Integer morder; - - private String cardid; - - private String insuser; - - private String insdt; - - private String locationtime; - - private String indoor; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getX() { - return x; - } - - public void setX(String x) { - this.x = x == null ? null : x.trim(); - } - - public String getY() { - return y; - } - - public void setY(String y) { - this.y = y == null ? null : y.trim(); - } - - public String getFloor() { - return floor; - } - - public void setFloor(String floor) { - this.floor = floor == null ? null : floor.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getCardid() { - return cardid; - } - - public void setCardid(String cardid) { - this.cardid = cardid == null ? null : cardid.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getLocationtime() { - return locationtime; - } - - public void setLocationtime(String locationtime) { - this.locationtime = locationtime == null ? null : locationtime.trim(); - } - - public String getIndoor() { - return indoor; - } - - public void setIndoor(String indoor) { - this.indoor = indoor == null ? null : indoor.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/hqconfig/RiskLevel.java b/src/com/sipai/entity/hqconfig/RiskLevel.java deleted file mode 100644 index e7c2b9c9..00000000 --- a/src/com/sipai/entity/hqconfig/RiskLevel.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.sipai.entity.hqconfig; - -import java.util.Date; - -import com.sipai.entity.alarm.AlarmLevelsConfig; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.AreaManage; - -public class RiskLevel extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String securitycontent; - - private String safetyinspection; - - private String place; - - private String accidentcategory; - - private String safetyinspectionname; - - - public String getSafetyinspectionname() { - return safetyinspectionname; - } - - public void setSafetyinspectionname(String safetyinspectionname) { - this.safetyinspectionname = safetyinspectionname; - } - - private String consequences; - - private String lvalue; - - private String svalue; - - private String rvalue; - - private String risklevel; - - private String areaid; - - private String actionstaken; - - private AreaManage area; - - public AreaManage getArea() { - return area; - } - - public void setArea(AreaManage area) { - this.area = area; - } - - private AlarmLevelsConfig alarmLevelsConfig; - - public AlarmLevelsConfig getAlarmLevelsConfig() { - return alarmLevelsConfig; - } - - public void setAlarmLevelsConfig(AlarmLevelsConfig alarmLevelsConfig) { - this.alarmLevelsConfig = alarmLevelsConfig; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getSecuritycontent() { - return securitycontent; - } - - public void setSecuritycontent(String securitycontent) { - this.securitycontent = securitycontent; - } - - public String getSafetyinspection() { - return safetyinspection; - } - - public void setSafetyinspection(String safetyinspection) { - this.safetyinspection = safetyinspection; - } - - public String getPlace() { - return place; - } - - public void setPlace(String place) { - this.place = place; - } - - public String getAccidentcategory() { - return accidentcategory; - } - - public void setAccidentcategory(String accidentcategory) { - this.accidentcategory = accidentcategory; - } - - public String getConsequences() { - return consequences; - } - - public void setConsequences(String consequences) { - this.consequences = consequences; - } - - public String getLvalue() { - return lvalue; - } - - public void setLvalue(String lvalue) { - this.lvalue = lvalue; - } - - public String getSvalue() { - return svalue; - } - - public void setSvalue(String svalue) { - this.svalue = svalue; - } - - public String getRvalue() { - return rvalue; - } - - public void setRvalue(String rvalue) { - this.rvalue = rvalue; - } - - - - - public String getRisklevel() { - return risklevel; - } - - public void setRisklevel(String risklevel) { - this.risklevel = risklevel; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public String getActionstaken() { - return actionstaken; - } - - public void setActionstaken(String actionstaken) { - this.actionstaken = actionstaken; - } -} diff --git a/src/com/sipai/entity/hqconfig/WorkModel.java b/src/com/sipai/entity/hqconfig/WorkModel.java deleted file mode 100644 index 063431fc..00000000 --- a/src/com/sipai/entity/hqconfig/WorkModel.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.entity.hqconfig; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.AreaManage; -import com.sipai.entity.work.CameraDetail; -import com.sipai.entity.work.CameraNVR; - -public class WorkModel extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String modelName; - - private String name; - - private String output; - - private String isalarm; - - private String remark; - - private String status; - - private String riskLevelId; - - private RiskLevel riskLevel; - - private AreaManage areaManage; - - private CameraDetail cameraDetail; - - private List cameraDetailList; - - public List getCameraDetailList() { - return cameraDetailList; - } - - public void setCameraDetailList(List cameraDetailList) { - this.cameraDetailList = cameraDetailList; - } - - public AreaManage getAreaManage() { - return areaManage; - } - - public void setAreaManage(AreaManage areaManage) { - this.areaManage = areaManage; - } - - public CameraDetail getCameraDetail() { - return cameraDetail; - } - - public void setCameraDetail(CameraDetail cameraDetail) { - this.cameraDetail = cameraDetail; - } - - public String getRiskLevelId() { - return riskLevelId; - } - - public void setRiskLevelId(String riskLevelId) { - this.riskLevelId = riskLevelId; - } - - public RiskLevel getRiskLevel() { - return riskLevel; - } - - public void setRiskLevel(RiskLevel riskLevel) { - this.riskLevel = riskLevel; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getOutput() { - return output; - } - - public void setOutput(String output) { - this.output = output; - } - - public String getIsalarm() { - return isalarm; - } - - public void setIsalarm(String isalarm) { - this.isalarm = isalarm; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/src/com/sipai/entity/info/Info.java b/src/com/sipai/entity/info/Info.java deleted file mode 100644 index acc322e0..00000000 --- a/src/com/sipai/entity/info/Info.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.sipai.entity.info; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class Info extends SQLAdapter{ - private String id; - - private String title; - - private String matter; - - private String typeid; - - private String recvid; - - private String publishtime1; - - private String publishtime2; - - private String insuser; - - private String insdt; - - private String modifydt; - - private User userInsuser;//发布人对象 - - public User getUserInsuser() { - return userInsuser; - } - - public void setUserInsuser(User userInsuser) { - this.userInsuser = userInsuser; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getMatter() { - return matter; - } - - public void setMatter(String matter) { - this.matter = matter; - } - - public String getTypeid() { - return typeid; - } - - public void setTypeid(String typeid) { - this.typeid = typeid; - } - - public String getRecvid() { - return recvid; - } - - public void setRecvid(String recvid) { - this.recvid = recvid; - } - - public String getPublishtime1() { - return publishtime1; - } - - public void setPublishtime1(String publishtime1) { - this.publishtime1 = publishtime1; - } - - public String getPublishtime2() { - return publishtime2; - } - - public void setPublishtime2(String publishtime2) { - this.publishtime2 = publishtime2; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getModifydt() { - return modifydt; - } - - public void setModifydt(String modifydt) { - this.modifydt = modifydt; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/info/InfoRecv.java b/src/com/sipai/entity/info/InfoRecv.java deleted file mode 100644 index bdee7fd7..00000000 --- a/src/com/sipai/entity/info/InfoRecv.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.entity.info; - -import com.sipai.entity.base.SQLAdapter; - -public class InfoRecv extends SQLAdapter{ - private String id; - - private String masterid; - - private String recvid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getRecvid() { - return recvid; - } - - public void setRecvid(String recvid) { - this.recvid = recvid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/info/LogInfo.java b/src/com/sipai/entity/info/LogInfo.java deleted file mode 100644 index 80b4af5d..00000000 --- a/src/com/sipai/entity/info/LogInfo.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.sipai.entity.info; - -import com.sipai.entity.base.SQLAdapter; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; -import java.util.Date; - -public class LogInfo extends SQLAdapter implements Serializable { - private static final long serialVersionUID = 3204169314032723061L; - public static final String TYPE_NOMAL = "正常"; - public static final String TYPE_ERROE = "异常"; - - private Long id; - @ApiModelProperty("包名") - private String controller; - @ApiModelProperty("方法") - private String method; - @ApiModelProperty("操作人Id") - private String userId; - - @ApiModelProperty("请求参数") - private String param; - @ApiModelProperty("请求IP地址") - private String ip; - @ApiModelProperty("操作时间") - private String insdt; - @ApiModelProperty("操作内容") - private String operateContent; - @ApiModelProperty("类型:正常/异常") - private String type; - @ApiModelProperty("异常信息") - private String exMsg; - @ApiModelProperty("用户名") - private String userCaption; - @ApiModelProperty("返回信息") - private String result; - @ApiModelProperty("用户端口") - private String remotePort; - @ApiModelProperty("用户请求方式") - private String userMethod; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getController() { - return controller; - } - - public void setController(String controller) { - this.controller = controller == null ? null : controller.trim(); - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method == null ? null : method.trim(); - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId == null ? null : userId.trim(); - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip == null ? null : ip.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getOperateContent() { - return operateContent; - } - - public void setOperateContent(String operateContent) { - this.operateContent = operateContent == null ? null : operateContent.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getExMsg() { - return exMsg; - } - - public void setExMsg(String exMsg) { - this.exMsg = exMsg == null ? null : exMsg.trim(); - } - - public String getUserCaption() { - return userCaption; - } - - public void setUserCaption(String userCaption) { - this.userCaption = userCaption == null ? null : userCaption.trim(); - } - - public String getParam() { - return param; - } - - public void setParam(String param) { - this.param = param == null ? null : param.trim(); - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result == null ? null : result.trim(); - } - - public String getRemotePort() { - return remotePort; - } - - public void setRemotePort(String remotePort) { - this.remotePort = remotePort == null ? null : remotePort.trim(); - } - - public String getUserMethod() { - return userMethod; - } - - public void setUserMethod(String userMethod) { - this.userMethod = userMethod == null ? null : userMethod.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/info/Select2.java b/src/com/sipai/entity/info/Select2.java deleted file mode 100644 index c14ece6e..00000000 --- a/src/com/sipai/entity/info/Select2.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.entity.info; - -public class Select2{ - private String id; - - private String text; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/jsyw/JsywCompany.java b/src/com/sipai/entity/jsyw/JsywCompany.java deleted file mode 100644 index bc15cc65..00000000 --- a/src/com/sipai/entity/jsyw/JsywCompany.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.jsyw; - -import com.sipai.entity.base.SQLAdapter; - -public class JsywCompany extends SQLAdapter { - private String id; - - private String wrylbText; - - private String xzqh; - - private String createTime; - - private Integer year; - - private String dwmc; - - private String itemids; - - private String scdz; - - private String latitude; - - private String longitude; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getWrylbText() { - return wrylbText; - } - - public void setWrylbText(String wrylbText) { - this.wrylbText = wrylbText; - } - - public String getXzqh() { - return xzqh; - } - - public void setXzqh(String xzqh) { - this.xzqh = xzqh; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public Integer getYear() { - return year; - } - - public void setYear(Integer year) { - this.year = year; - } - - public String getDwmc() { - return dwmc; - } - - public void setDwmc(String dwmc) { - this.dwmc = dwmc; - } - - public String getItemids() { - return itemids; - } - - public void setItemids(String itemids) { - this.itemids = itemids; - } - - public String getScdz() { - return scdz; - } - - public void setScdz(String scdz) { - this.scdz = scdz; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/jsyw/JsywPoint.java b/src/com/sipai/entity/jsyw/JsywPoint.java deleted file mode 100644 index 90bbdd94..00000000 --- a/src/com/sipai/entity/jsyw/JsywPoint.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.entity.jsyw; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class JsywPoint extends SQLAdapter { - - private String id; - - private String factorname; - - private String psname; - - private String updateDate; - - private String updateTime; - - private String outputname; - - private String tstamp; - - private BigDecimal pollutantvalue; - - private String valuetype; - - public String getValuetype() { - return valuetype; - } - - public void setValuetype(String valuetype) { - this.valuetype = valuetype; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getFactorname() { - return factorname; - } - - public void setFactorname(String factorname) { - this.factorname = factorname; - } - - public String getPsname() { - return psname; - } - - public void setPsname(String psname) { - this.psname = psname; - } - - public String getUpdateDate() { - return updateDate; - } - - public void setUpdateDate(String updateDate) { - this.updateDate = updateDate; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public String getOutputname() { - return outputname; - } - - public void setOutputname(String outputname) { - this.outputname = outputname; - } - - public String getTstamp() { - return tstamp; - } - - public void setTstamp(String tstamp) { - this.tstamp = tstamp; - } - - public BigDecimal getPollutantvalue() { - return pollutantvalue; - } - - public void setPollutantvalue(BigDecimal pollutantvalue) { - this.pollutantvalue = pollutantvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiActivitiRequest.java b/src/com/sipai/entity/kpi/KpiActivitiRequest.java deleted file mode 100644 index 4e76bca4..00000000 --- a/src/com/sipai/entity/kpi/KpiActivitiRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 审核提交 - * - * @Author: lichen - * @Date: 2021/10/16 - **/ -@Data -public class KpiActivitiRequest { - public static final String Type_PLAN = "kpi_plan";//计划 - public static final String Type_MARK = "kpi_mark";//打分 - - /** - * 业务数据主键 - */ - private String bizId; - - /** - * 当前登录人id - */ - private String loginUserId; - - /** - * 下级审核人id - */ - private String auditorId; - /** - * taskId - */ - private String taskId; - /** - * 审核意见 - */ - private String auditComment; - /** - * 审核结果(1:通过;0:驳回) - */ - private String pass; - /** - * 单列指标名称 - */ - private String singleIndicatorName; - /** - * 单列指标分数 - */ - private BigDecimal singleIndicatorPoint; - /** - * 厂区id - */ - private String unitId; - - /** - * 给mapper传参用 - */ - private String planStaffId; -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiApplyBiz.java b/src/com/sipai/entity/kpi/KpiApplyBiz.java deleted file mode 100644 index c093a4f8..00000000 --- a/src/com/sipai/entity/kpi/KpiApplyBiz.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.apache.commons.lang3.StringUtils; - -import java.util.Arrays; -import java.util.List; - -@EqualsAndHashCode(callSuper = true) -@Data -public class KpiApplyBiz extends SQLAdapter { - private String id; - - private String periodInstanceId; - - private Integer status; - - private String createUserId; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - private String auditors; - - private String rejectionComment; - - private String unitId; - - private String marker; - - // 评分驳回时应该设置谁作为工作流下个task的assnginee - public String getUserIdForRejectTo() { - - if (StringUtils.isEmpty(marker)) { - return createUserId; - } else { - List ids = Arrays.asList(marker.split(",")); - if(ids.size()>0){ - return ids.get(ids.size()-1); - } - } - return createUserId; - } -} - diff --git a/src/com/sipai/entity/kpi/KpiApplyBizBo.java b/src/com/sipai/entity/kpi/KpiApplyBizBo.java deleted file mode 100644 index 543c4833..00000000 --- a/src/com/sipai/entity/kpi/KpiApplyBizBo.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -@Data -public class KpiApplyBizBo extends KpiApplyBiz { - private KpiPeriodInstance periodInstance; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiDimension.java b/src/com/sipai/entity/kpi/KpiDimension.java deleted file mode 100644 index 9a98b3c1..00000000 --- a/src/com/sipai/entity/kpi/KpiDimension.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -/** - * - * @author liche - */ -@Data -public class KpiDimension extends SQLAdapter { - private String id; - /** - * 维度名称 - */ - private String dimensionName; - /** - * 维度类型 - */ - private int dimensionType; - /** - * 状态 1:启用;0:禁用; - */ - private int status; - private String statusName; - /** - * 备注 - */ - private String remark; - - /** - * 周期类型 - */ - private Integer periodType; - private String periodTypeName; - - /** - * 职位类型 - */ - private Integer jobType; - private String jobTypeName; - - /** - * 排序 - */ - private Integer morder; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDimensionName() { - return dimensionName; - } - - public void setDimensionName(String dimensionName) { - this.dimensionName = dimensionName; - } - - public int getDimensionType() { - return dimensionType; - } - - public void setDimensionType(int dimensionType) { - this.dimensionType = dimensionType; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public Boolean getIsDeleted() { - return isDeleted; - } - - public void setIsDeleted(Boolean deleted) { - isDeleted = deleted; - } - - public String getStatusName() { - return statusName; - } - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public Integer getPeriodType() { - return periodType; - } - - public void setPeriodType(Integer periodType) { - this.periodType = periodType; - } - - public String getPeriodTypeName() { - return periodTypeName; - } - - public void setPeriodTypeName(String periodTypeName) { - this.periodTypeName = periodTypeName; - } - - public Integer getJobType() { - return jobType; - } - - public void setJobType(Integer jobType) { - this.jobType = jobType; - } - - public String getJobTypeName() { - return jobTypeName; - } - - public void setJobTypeName(String jobTypeName) { - this.jobTypeName = jobTypeName; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiIndicatorLib.java b/src/com/sipai/entity/kpi/KpiIndicatorLib.java deleted file mode 100644 index a98d0bd3..00000000 --- a/src/com/sipai/entity/kpi/KpiIndicatorLib.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -//@Data -public class KpiIndicatorLib extends SQLAdapter { - private String id; - - private String dimensionId; - - private String jobId; - - private int periodType; - - private String auditLevelWeight;//废弃 - - private Byte resultWeight;//废弃 - - private Byte processWeight;//废弃 - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - private String infoId; - - private String indicatorName; - - private String contentA; - - private String contentB; - - private String contentC; - - private String contentD; - - private String indicatorDetail; - private BigDecimal indicatorWeight; - - private String morder; - - private String periodTypeName; - - public KpiIndicatorLib() { - } - - - public static KpiIndicatorLib defaultKpiIndicatorLib() { - KpiIndicatorLib lib = new KpiIndicatorLib(); - lib.setId(""); - lib.setDimensionId(""); - lib.setJobId(""); - lib.setPeriodType(0); - lib.setAuditLevelWeight("");//废弃 - lib.setResultWeight((byte) 0);//废弃 - lib.setProcessWeight((byte) 0);//废弃 - lib.setCreateTime(""); - lib.setUpdateTime(""); - lib.setIsDeleted(false); - lib.setInfoId(""); - lib.setIndicatorName(""); - lib.setContentA(""); - lib.setContentB(""); - lib.setContentC(""); - lib.setContentD(""); - lib.setIndicatorDetail(""); - lib.setSql(""); - lib.setWhere(""); - lib.setPeriodTypeName(""); - - return lib; - } - - public String getMorder() { - return morder; - } - - public void setMorder(String morder) { - this.morder = morder; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDimensionId() { - return dimensionId; - } - - public void setDimensionId(String dimensionId) { - this.dimensionId = dimensionId; - } - - public String getJobId() { - return jobId; - } - - public void setJobId(String jobId) { - this.jobId = jobId; - } - - public int getPeriodType() { - return periodType; - } - - public void setPeriodType(int periodType) { - this.periodType = periodType; - } - - public String getAuditLevelWeight() { - return auditLevelWeight; - } - - public void setAuditLevelWeight(String auditLevelWeight) { - this.auditLevelWeight = auditLevelWeight; - } - - public Byte getResultWeight() { - return resultWeight; - } - - public void setResultWeight(Byte resultWeight) { - this.resultWeight = resultWeight; - } - - public Byte getProcessWeight() { - return processWeight; - } - - public void setProcessWeight(Byte processWeight) { - this.processWeight = processWeight; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public Boolean getIsDeleted() { - return isDeleted; - } - - public void setIsDeleted(Boolean deleted) { - isDeleted = deleted; - } - - public String getInfoId() { - return infoId; - } - - public void setInfoId(String infoId) { - this.infoId = infoId; - } - - public String getIndicatorName() { - return indicatorName; - } - - public void setIndicatorName(String indicatorName) { - this.indicatorName = indicatorName; - } - - public String getContentA() { - return contentA; - } - - public void setContentA(String contentA) { - this.contentA = contentA; - } - - public String getContentB() { - return contentB; - } - - public void setContentB(String contentB) { - this.contentB = contentB; - } - - public String getContentC() { - return contentC; - } - - public void setContentC(String contentC) { - this.contentC = contentC; - } - - public String getContentD() { - return contentD; - } - - public void setContentD(String contentD) { - this.contentD = contentD; - } - - public String getIndicatorDetail() { - return indicatorDetail; - } - - public void setIndicatorDetail(String indicatorDetail) { - this.indicatorDetail = indicatorDetail; - } - public String getPeriodTypeName() { - return periodTypeName; - } - public void setPeriodTypeName(String periodTypeName) { - this.periodTypeName = periodTypeName; - } - - public BigDecimal getIndicatorWeight() { - return indicatorWeight; - } - - public void setIndicatorWeight(BigDecimal indicatorWeight) { - this.indicatorWeight = indicatorWeight; - } -} diff --git a/src/com/sipai/entity/kpi/KpiIndicatorLibDetail.java b/src/com/sipai/entity/kpi/KpiIndicatorLibDetail.java deleted file mode 100644 index de1d4762..00000000 --- a/src/com/sipai/entity/kpi/KpiIndicatorLibDetail.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.math.BigDecimal; - -@Data -public class KpiIndicatorLibDetail extends SQLAdapter { - private String id; - - private String infoId; - private String dimensionId; - private String indicatorId; - private String indicatorName; - - private String contentA; - - private String contentB; - - private String contentC; - - private String contentD; - - private String indicatorDetail; - - private String createTime; - - private String updateTime; - private String morder; - - private Boolean isDeleted; - - private BigDecimal indicatorWeight; - -} diff --git a/src/com/sipai/entity/kpi/KpiMarUserList.java b/src/com/sipai/entity/kpi/KpiMarUserList.java deleted file mode 100644 index 9507bd27..00000000 --- a/src/com/sipai/entity/kpi/KpiMarUserList.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.entity.kpi; -import lombok.Data; - -/** - * @author lichen - * - */ - -@Data -public class KpiMarUserList { - - private String auditorId; - - private String createTime; -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiMarkListQuery.java b/src/com/sipai/entity/kpi/KpiMarkListQuery.java deleted file mode 100644 index c0fe4664..00000000 --- a/src/com/sipai/entity/kpi/KpiMarkListQuery.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.entity.kpi; -import lombok.Builder; -import lombok.Data; - -/** - * @author lihongye - * - */ - -@Data -@Builder -public class KpiMarkListQuery { - - private String planStaffId; - - private String autidUserId; - - private String autidUserId1; - - private String autidUserId2; - - private String autidUserId3; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPeriodInstance.java b/src/com/sipai/entity/kpi/KpiPeriodInstance.java deleted file mode 100644 index d74d7dbc..00000000 --- a/src/com/sipai/entity/kpi/KpiPeriodInstance.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.tools.KpiUtils; -import lombok.Data; - -import java.util.Objects; - -/** - * 考核计划 - * - * @Author: lichen - * @Date: 2021/10/11 - **/ -@Data -public class KpiPeriodInstance extends SQLAdapter { - /** - * 主键 - */ - private String id; - /** - * 岗位类型 - */ - private Byte jobType; - /** - * 周期年份 - */ - private String periodYear; - /** - * 周期类型 - */ - private Integer periodType; - /** - * 周期序号 - */ - private Byte periodNo; - /** - * 创建人id - */ - private String createUserId; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - - /** - * 考核周期名称拼接 - * - * @return - * @author lichen - * @date 2021/10/11 19:25 - **/ - public String getPeriodName() { - if (Objects.isNull(periodNo) || Objects.isNull(periodNo) || Objects.isNull(periodNo)) { - return ""; - } else { - return KpiUtils.getPeriodName(periodYear, periodType, periodNo); - } - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPeriodInstanceVo.java b/src/com/sipai/entity/kpi/KpiPeriodInstanceVo.java deleted file mode 100644 index 17185210..00000000 --- a/src/com/sipai/entity/kpi/KpiPeriodInstanceVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 考核计划 - * - * @Author: lichen - * @Date: 2021/10/11 - **/ -@EqualsAndHashCode(callSuper = true) -@Data -public class KpiPeriodInstanceVo extends KpiPeriodInstance { - - /** - * 考核周期拼接结果 - */ - private String periodName; - - /** - * 岗位类型名称 - */ - private String positionTypeName; - - /** - * 考核周期类型名称 - */ - private String periodTypeName; - - /** - * 直接上级创建的计划ID - */ - private String applyBizId; - - private int status; - - private String statusName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlan.java b/src/com/sipai/entity/kpi/KpiPlan.java deleted file mode 100644 index 35731987..00000000 --- a/src/com/sipai/entity/kpi/KpiPlan.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.entity.kpi; -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -/** - * @author lihongye - * - */ - -@Data -public class KpiPlan extends SQLAdapter { - - private String id; - //考核对象主键 - private String objUserId; - //岗位主键 - private String jobId; - // 岗位类型id - private Integer levelType; - // 岗位类型 - private String positionType; - //周期类型id - private Integer periodType; - //周期类型 - private String periodTypeName; - //创建人 - private String createUserId; - - //创建时间 - private String createTime; - //更新时间 - private String updateTime; - //是否删除 - private Boolean isDeleted; - // 更新人 - private String updateUserId; - // 岗位名称 - private String name; - // 考核对象 - private String caption; - // 部门名称 - private String deptName; - // 工号 - private String cardId; - - // 厂区id - private String unitId; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlanDetail.java b/src/com/sipai/entity/kpi/KpiPlanDetail.java deleted file mode 100644 index 343deaca..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanDetail.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.entity.kpi; - -import com.alibaba.excel.annotation.ExcelIgnore; -import com.alibaba.excel.annotation.ExcelProperty; -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.math.BigDecimal; - -public class KpiPlanDetail extends SQLAdapter { - /** - * 考核内容主键 - */ - @ExcelIgnore - private String id; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getDimensionId() { - return dimensionId; - } - - public void setDimensionId(String dimensionId) { - this.dimensionId = dimensionId; - } - - public String getDimensionName() { - return dimensionName; - } - - public void setDimensionName(String dimensionName) { - this.dimensionName = dimensionName; - } - - public String getIndicatorName() { - return indicatorName; - } - - public void setIndicatorName(String indicatorName) { - this.indicatorName = indicatorName; - } - - public String getContentA() { - return contentA; - } - - public void setContentA(String contentA) { - this.contentA = contentA; - } - - public String getContentB() { - return contentB; - } - - public void setContentB(String contentB) { - this.contentB = contentB; - } - - public String getContentC() { - return contentC; - } - - public void setContentC(String contentC) { - this.contentC = contentC; - } - - public String getContentD() { - return contentD; - } - - public void setContentD(String contentD) { - this.contentD = contentD; - } - - public String getMorder() { - return morder; - } - - public void setMorder(String morder) { - this.morder = morder; - } - - public String getIndicatorDetail() { - return indicatorDetail; - } - - public void setIndicatorDetail(String indicatorDetail) { - this.indicatorDetail = indicatorDetail; - } - - public BigDecimal getIndicatorWeight() { - return indicatorWeight; - } - - public void setIndicatorWeight(BigDecimal indicatorWeight) { - this.indicatorWeight = indicatorWeight; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public String getUpStringTime() { - return upStringTime; - } - - public void setUpStringTime(String upStringTime) { - this.upStringTime = upStringTime; - } - - public Boolean getIsDeleted() { - return isDeleted; - } - - public void setIsDeleted(Boolean deleted) { - isDeleted = deleted; - } - - /** - * 绩效方案主键 - */ - @ExcelIgnore - private String planId; - /** - * 维度id - */ - @ExcelIgnore - private String dimensionId; - - @ExcelProperty("维度名称") - private String dimensionName; - - @ExcelProperty("考核指标") - private String indicatorName; - - @ExcelProperty("A级") - private String contentA; - - @ExcelProperty("B级") - private String contentB; - - @ExcelProperty("C级") - private String contentC; - - @ExcelProperty("D级") - private String contentD; - - @ExcelProperty("排序") - private String morder; - - @ExcelProperty("指标解释") - private String indicatorDetail; - - @ExcelProperty("权重") - private BigDecimal indicatorWeight; - //创建时间 - @ExcelIgnore - private String createTime; - //更新时间 - @ExcelIgnore - private String updateTime; - @ExcelIgnore - private String upStringTime; - - - //是否删除 - @ExcelIgnore - private Boolean isDeleted; -} diff --git a/src/com/sipai/entity/kpi/KpiPlanStaff.java b/src/com/sipai/entity/kpi/KpiPlanStaff.java deleted file mode 100644 index b0fb98ef..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanStaff.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/14 - **/ -@Data -public class KpiPlanStaff extends SQLAdapter { - /** - * 主键 - */ - private String id; - /** - * 考核计划主键 - */ - private String periodInstanceId; - /** - * 考核对象主键 - */ - private String objUserId; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - /** - * 考核计划状态 - */ - private int status; - - - /** - * 考核计划制订定人 - */ - private String createUserId; - - - /** - * 考核对象职位id - */ - private String jobId; - - - /** - * 厂区id - */ - private String unitId; - /** - * 驳回意见 - */ - private String rejectionComment; - - /** - * 直接上级制定的计划 - */ - private String applyBizId; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlanStaffBo.java b/src/com/sipai/entity/kpi/KpiPlanStaffBo.java deleted file mode 100644 index 425df303..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanStaffBo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.user.Job; -import com.sipai.entity.user.User; -import lombok.Data; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/14 - **/ -@Data -public class KpiPlanStaffBo extends KpiPlanStaff { - - private KpiPeriodInstance kpiPeriodInstance; - - private User user; - - private Job job; - - private String statusName; - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlanStaffDetail.java b/src/com/sipai/entity/kpi/KpiPlanStaffDetail.java deleted file mode 100644 index 9b22f237..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanStaffDetail.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.io.Serializable; -import java.math.BigDecimal; - -@Data -public class KpiPlanStaffDetail extends SQLAdapter implements Serializable { - /** - * 主键 - */ - private String id; - /** - * 考核计划:考核对象主键 - */ - private String planStaffId; - /** - * 维度主键 - */ - private String dimensionId; - /** - * 维度名称 - */ - private String dimensionName; - /** - * 考核指标 - */ - private String indicatorName; - /** - * A - */ - private String contentA; - /** - * B - */ - private String contentB; - /** - * C - */ - private String contentC; - /** - * D - */ - private String contentD; - /** - * 说明 - */ - private String indicatorDetail; - /** - * 权重 - */ - private BigDecimal indicatorWeight; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - /** - * 结果打分 - */ - private BigDecimal resultPoint= new BigDecimal("0"); - /** - * 21.10.28 新增字段:完成情况 - */ - private String completionStatus; - /** - * 过程打分 - */ - private BigDecimal processPoint = new BigDecimal("0"); - /** - * 最终得分 - */ - private KpiResult kpiResult; - - - private String auditor1; - private BigDecimal processPoint1; - private BigDecimal resultPoint1; - - private String auditor2; - private BigDecimal processPoint2; - private BigDecimal resultPoint2; - - private String auditor3; - private BigDecimal processPoint3; - private BigDecimal resultPoint3; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlanStaffResultAllVo.java b/src/com/sipai/entity/kpi/KpiPlanStaffResultAllVo.java deleted file mode 100644 index 3b74ef77..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanStaffResultAllVo.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/14 - **/ -@Data -public class KpiPlanStaffResultAllVo { - - private String id; - private String userName; - private String userCardId; - private String deptName; - private String jobName; - - private Integer jobLevelType; - private String jobLevelTypeName; - - private String periodYear; - - private Integer periodType; - private String periodTypeName; - - - private Integer levelType; - private BigDecimal resultPoint; - - private Integer status; - private String statusName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlanStaffResultVo.java b/src/com/sipai/entity/kpi/KpiPlanStaffResultVo.java deleted file mode 100644 index dc79f52f..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanStaffResultVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/14 - **/ -@Data -public class KpiPlanStaffResultVo extends KpiPlanStaff { - - private Integer levelType; - private BigDecimal resultPoint; - private String periodYear; - private String periodTypeName; - private String deptName; - private String objUserName; - private String StatusName; - private String cardId; - private Integer jobLevelType; - private String jobLevel; - private String jobName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiPlanStaffVo.java b/src/com/sipai/entity/kpi/KpiPlanStaffVo.java deleted file mode 100644 index d8549ddc..00000000 --- a/src/com/sipai/entity/kpi/KpiPlanStaffVo.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/14 - **/ -@Data -public class KpiPlanStaffVo extends KpiPlanStaff { - - /** - * 考核对象姓名 - */ - private String objUserName; - - /** - * 考核对象职位名称 - */ - private String jobName; - - /** - * 考核计划状态名称 - */ - private String statusName; - - /** - * 考核对象的部门名称 - */ - private String deptName; - /** - * 考核对象工号 - */ - private String cardId; - - - - /** - * 岗位类型 - */ - private int jobLevelType; - /** - * 岗位类型名称 - */ - private String jobLevelTypeName; - /** - * 岗位类型名字 - */ - private String jobLevel; - /** - * 年份 - */ - private String periodYear; - /** - * 周期类型 - */ - private Integer periodType; - - /** - * 周期类型 - */ - private String periodTypeName; - - /** - * 周期类型 - */ - private String periodName; - - /** - * 结果得分 - */ - private BigDecimal resultPoint; - - private String createUserName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResult.java b/src/com/sipai/entity/kpi/KpiResult.java deleted file mode 100644 index fdf28871..00000000 --- a/src/com/sipai/entity/kpi/KpiResult.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; - -import java.io.Serializable; -import java.math.BigDecimal; - -//@Data -public class KpiResult extends SQLAdapter implements Serializable { - private String id; - - private String planStaffId; - - private BigDecimal dimensionPoint; - - private String singleIndicatorName; - - private BigDecimal singleIndicatorPoint; - - private BigDecimal resultPoint; - - private String resultLevel; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPlanStaffId() { - return planStaffId; - } - - public void setPlanStaffId(String planStaffId) { - this.planStaffId = planStaffId; - } - - public BigDecimal getDimensionPoint() { - return dimensionPoint; - } - - public void setDimensionPoint(BigDecimal dimensionPoint) { - this.dimensionPoint = dimensionPoint; - } - - public String getSingleIndicatorName() { - return singleIndicatorName; - } - - public void setSingleIndicatorName(String singleIndicatorName) { - this.singleIndicatorName = singleIndicatorName; - } - - public BigDecimal getSingleIndicatorPoint() { - return singleIndicatorPoint; - } - - public void setSingleIndicatorPoint(BigDecimal singleIndicatorPoint) { - this.singleIndicatorPoint = singleIndicatorPoint; - } - - public BigDecimal getResultPoint() { - return resultPoint; - } - - public void setResultPoint(BigDecimal resultPoint) { - this.resultPoint = resultPoint; - } - - public String getResultLevel() { - return resultLevel; - } - - public void setResultLevel(String resultLevel) { - this.resultLevel = resultLevel; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public Boolean getIsDeleted() { - return isDeleted; - } - - public void setIsDeleted(Boolean deleted) { - isDeleted = deleted; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultDetailInfo.java b/src/com/sipai/entity/kpi/KpiResultDetailInfo.java deleted file mode 100644 index 24b096f2..00000000 --- a/src/com/sipai/entity/kpi/KpiResultDetailInfo.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 考核结果详情, 考核项目列表以外的字段 - * - * @Author: lichen - * @Date: 2021/10/25 - **/ -//@Data -public class KpiResultDetailInfo extends KpiResult { - /** - * 姓名 - */ - private String objUserName; - - /** - * 工号 - */ - private String cardId; - - /** - * 岗位 - */ - private String jobName; - - /** - * 部门名称 - */ - private String deptName; - - /** - * 考核周期 - */ - private String periodName; - - /** - * 打分层级和权重 - */ - private int[] markLevelWeight; - /** - * 结果得分和过程得分的权重 - */ - private int[] resultProcessWeight; - - /** - * 考核周期类型(判断年度和非年度) - */ - private int periodType; - - /** - * 计划制定和审定信息 - */ - private List planMakeInfo; - /** - * 打分信息 - */ - private List markInfo; - - - @Data - public static class KpiResultDetailAuditInfo { - private String taskName; - private String userName; - private String date; - - public String getTaskName() { - return taskName; - } - - public void setTaskName(String taskName) { - this.taskName = taskName; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - } - - /** - * 计划状态 - */ - private Integer planStaffStatus; - /** - * 本年度考核的平均得分 - */ - private BigDecimal avgPoint; - - public String getObjUserName() { - return objUserName; - } - - public void setObjUserName(String objUserName) { - this.objUserName = objUserName; - } - - public String getCardId() { - return cardId; - } - - public void setCardId(String cardId) { - this.cardId = cardId; - } - - public String getJobName() { - return jobName; - } - - public void setJobName(String jobName) { - this.jobName = jobName; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public String getPeriodName() { - return periodName; - } - - public void setPeriodName(String periodName) { - this.periodName = periodName; - } - - public int[] getMarkLevelWeight() { - return markLevelWeight; - } - - public void setMarkLevelWeight(int[] markLevelWeight) { - this.markLevelWeight = markLevelWeight; - } - - public int[] getResultProcessWeight() { - return resultProcessWeight; - } - - public void setResultProcessWeight(int[] resultProcessWeight) { - this.resultProcessWeight = resultProcessWeight; - } - - public int getPeriodType() { - return periodType; - } - - public void setPeriodType(int periodType) { - this.periodType = periodType; - } - - public List getPlanMakeInfo() { - return planMakeInfo; - } - - public void setPlanMakeInfo(List planMakeInfo) { - this.planMakeInfo = planMakeInfo; - } - - public List getMarkInfo() { - return markInfo; - } - - public void setMarkInfo(List markInfo) { - this.markInfo = markInfo; - } - - public Integer getPlanStaffStatus() { - return planStaffStatus; - } - - public void setPlanStaffStatus(Integer planStaffStatus) { - this.planStaffStatus = planStaffStatus; - } - - public BigDecimal getAvgPoint() { - return avgPoint; - } - - public void setAvgPoint(BigDecimal avgPoint) { - this.avgPoint = avgPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultDetailListBean.java b/src/com/sipai/entity/kpi/KpiResultDetailListBean.java deleted file mode 100644 index 359a706c..00000000 --- a/src/com/sipai/entity/kpi/KpiResultDetailListBean.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.entity.kpi; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 考核结果详情, 考核项目列表字段 - * - * @Author: lichen - * @Date: 2021/10/25 - **/ -//@Data -public class KpiResultDetailListBean extends KpiPlanStaffDetail { - - /** - * 完成结果得分 - */ - private List resultPointList; - /** - * 过程表现 - */ - private List processPointList; - - /** - * 过程结果合计得分 - */ - private BigDecimal indicatorWeightPoint; - - public List getResultPointList() { - return resultPointList; - } - - public void setResultPointList(List resultPointList) { - this.resultPointList = resultPointList; - } - - public List getProcessPointList() { - return processPointList; - } - - public void setProcessPointList(List processPointList) { - this.processPointList = processPointList; - } - - public BigDecimal getIndicatorWeightPoint() { - return indicatorWeightPoint; - } - - public void setIndicatorWeightPoint(BigDecimal indicatorWeightPoint) { - this.indicatorWeightPoint = indicatorWeightPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultIndicator.java b/src/com/sipai/entity/kpi/KpiResultIndicator.java deleted file mode 100644 index 5d823ecb..00000000 --- a/src/com/sipai/entity/kpi/KpiResultIndicator.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -//@Data -public class KpiResultIndicator extends SQLAdapter { - private String id; - - private String planStaffDetailId; - - private int auditLevel; - - private String auditorId; - - private BigDecimal resultPoint; - - private BigDecimal processPoint; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - - /** - * 21.10.28 新增字段:完成情况 - */ - private String completionStatus; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPlanStaffDetailId() { - return planStaffDetailId; - } - - public void setPlanStaffDetailId(String planStaffDetailId) { - this.planStaffDetailId = planStaffDetailId; - } - - public int getAuditLevel() { - return auditLevel; - } - - public void setAuditLevel(int auditLevel) { - this.auditLevel = auditLevel; - } - - public String getAuditorId() { - return auditorId; - } - - public void setAuditorId(String auditorId) { - this.auditorId = auditorId; - } - - public BigDecimal getResultPoint() { - return resultPoint; - } - - public void setResultPoint(BigDecimal resultPoint) { - this.resultPoint = resultPoint; - } - - public BigDecimal getProcessPoint() { - return processPoint; - } - - public void setProcessPoint(BigDecimal processPoint) { - this.processPoint = processPoint; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public Boolean getIsDeleted() { - return isDeleted; - } - - public void setIsDeleted(Boolean deleted) { - isDeleted = deleted; - } - - public String getCompletionStatus() { - return completionStatus; - } - - public void setCompletionStatus(String completionStatus) { - this.completionStatus = completionStatus; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultIndicatorWeight.java b/src/com/sipai/entity/kpi/KpiResultIndicatorWeight.java deleted file mode 100644 index 0b4c412a..00000000 --- a/src/com/sipai/entity/kpi/KpiResultIndicatorWeight.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.sipai.entity.kpi; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -//@Data -public class KpiResultIndicatorWeight extends SQLAdapter { - private String id; - - private String planStaffDetailId; - - private BigDecimal weightPoint; - - private String remark; - - private String createTime; - - private String updateTime; - - private Boolean isDeleted; - /** - * 21.10.27 新增字段:完成情况 - */ - private String completionStatus; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPlanStaffDetailId() { - return planStaffDetailId; - } - - public void setPlanStaffDetailId(String planStaffDetailId) { - this.planStaffDetailId = planStaffDetailId; - } - - public BigDecimal getWeightPoint() { - return weightPoint; - } - - public void setWeightPoint(BigDecimal weightPoint) { - this.weightPoint = weightPoint; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - - public Boolean getIsDeleted() { - return isDeleted; - } - - public void setIsDeleted(Boolean deleted) { - isDeleted = deleted; - } - - public String getCompletionStatus() { - return completionStatus; - } - - public void setCompletionStatus(String completionStatus) { - this.completionStatus = completionStatus; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultQuery.java b/src/com/sipai/entity/kpi/KpiResultQuery.java deleted file mode 100644 index 22c7efd2..00000000 --- a/src/com/sipai/entity/kpi/KpiResultQuery.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -import java.io.Serializable; - -@Data -public class KpiResultQuery implements Serializable { - /** - * 是否全员查询 - */ - private Boolean isAllSearch =false; - - /** - * 姓名、工号、职位名称 - */ - private String userInfoLike; - /** - * 岗位类型 - */ - private Integer jobType; - /** - * 部门 - */ - private String deptId; - private String childrenDeptIdIn; -/** - * 考核年份 - */ - private String periodYear; - /** - * 考核类型 - */ - private Integer periodType; - /** - * 第几嫉妒,上下半年,全年 - */ - private Integer periodNo; - - /** - * 登录用户id - */ - private String loginUserId; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultStatisticsInfo.java b/src/com/sipai/entity/kpi/KpiResultStatisticsInfo.java deleted file mode 100644 index 8e5258a0..00000000 --- a/src/com/sipai/entity/kpi/KpiResultStatisticsInfo.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -/** - * 统计报表详情字段 - * @Author: lichen - * @Date: 2021/10/25 - **/ -@Data -public class KpiResultStatisticsInfo { - - /** - * 部门名称 - */ - private String deptName; - /** - * 考核周期 - */ - private String periodName; - /** - * 人员总数 - */ - private Integer userNumber; - /** - * 各个绩效等级人数 - */ - private Integer pointLevel1Number; - private Integer pointLevel2Number; - private Integer pointLevel3Number; - private Integer pointLevel4Number; - private Integer pointLevel5Number; - private Integer pointLevel6Number; - /** - * 各个绩效等级人数占比 - */ - private String pointLevel1Percent; - private String pointLevel2Percent; - private String pointLevel3Percent; - private String pointLevel4Percent; - private String pointLevel5Percent; - private String pointLevel6Percent; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultStatisticsListBean.java b/src/com/sipai/entity/kpi/KpiResultStatisticsListBean.java deleted file mode 100644 index 205f2697..00000000 --- a/src/com/sipai/entity/kpi/KpiResultStatisticsListBean.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.entity.kpi; - -import com.alibaba.excel.annotation.write.style.ContentStyle; -import com.alibaba.excel.enums.poi.BorderStyleEnum; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 统计报表list对象 - * - * @Author: lichen - * @Date: 2021/10/25 - **/ -@Data -public class KpiResultStatisticsListBean { - /** - * 序号 - */ - private Integer rowNo; - /** - * 部门 - */ - private String deptName; - /** - * 岗位 - */ - private String jobName; - /** - * 姓名 - */ - private String userName; - /** - * 考核得分 - */ - private BigDecimal resultPoint; - /** - * 绩效等级 - */ - private String resultLevel; - /** - * 绩效工资考核系数 - */ - private String resultLevelCoefficient; - - @ContentStyle( - borderBottom = BorderStyleEnum.THIN, - borderTop = BorderStyleEnum.THIN, - borderLeft = BorderStyleEnum.THIN, - borderRight = BorderStyleEnum.THIN) - private String remark = ""; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiResultStatisticsListRequest.java b/src/com/sipai/entity/kpi/KpiResultStatisticsListRequest.java deleted file mode 100644 index e82a1c2a..00000000 --- a/src/com/sipai/entity/kpi/KpiResultStatisticsListRequest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.entity.kpi; - -import lombok.Data; - -/** - * 部门统计信息请求类 - * - * @Author: lichen - * @Date: 2021/10/26 - **/ -@Data -public class KpiResultStatisticsListRequest { - /** - * 部门id - */ - private String deptId; - /** - * 用户id字符串(给sql语句的in用) - */ - private String users; - - /** - * 周期年份 - */ - private String periodYear; - /** - * 周期类型 - */ - private int periodType; - /** - * 周期序号 - */ - private int periodNo; - - private int jobType; - - -} diff --git a/src/com/sipai/entity/kpi/KpiTaskListVO.java b/src/com/sipai/entity/kpi/KpiTaskListVO.java deleted file mode 100644 index 419d7bc1..00000000 --- a/src/com/sipai/entity/kpi/KpiTaskListVO.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.sipai.entity.kpi; - -/** - * 绩效考核待办列表 - * - * @Author: lichen - * @Date: 2021/10/16 - **/ -//@Data -public class KpiTaskListVO { - - /** - * taskId - */ - private String taskId; - /**1 - * taskId - */ - private String planStaffId; - /** - * 任务类型 - */ - private String processTypeId; - /** - * 任务类型 - */ - private String processTypeName; - /** - * 考核对象姓名 - */ - private String objUserName; - /** - * 考核对象工号 - */ - private String cardId; - /** - * 考核对象的部门名称 - */ - private String deptName; - /** - * 考核对象职位名称 - */ - private String jobName; - - /** - * 岗位类型 - */ - private String jobLevelTypeName; - /** - * 考核周期 - */ - private String periodName; - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getPlanStaffId() { - return planStaffId; - } - - public void setPlanStaffId(String planStaffId) { - this.planStaffId = planStaffId; - } - - public String getProcessTypeId() { - return processTypeId; - } - - public void setProcessTypeId(String processTypeId) { - this.processTypeId = processTypeId; - } - - public String getProcessTypeName() { - return processTypeName; - } - - public void setProcessTypeName(String processTypeName) { - this.processTypeName = processTypeName; - } - - public String getObjUserName() { - return objUserName; - } - - public void setObjUserName(String objUserName) { - this.objUserName = objUserName; - } - - public String getCardId() { - return cardId; - } - - public void setCardId(String cardId) { - this.cardId = cardId; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public String getJobName() { - return jobName; - } - - public void setJobName(String jobName) { - this.jobName = jobName; - } - - public String getJobLevelTypeName() { - return jobLevelTypeName; - } - - public void setJobLevelTypeName(String jobLevelTypeName) { - this.jobLevelTypeName = jobLevelTypeName; - } - - public String getPeriodName() { - return periodName; - } - - public void setPeriodName(String periodName) { - this.periodName = periodName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/kpi/KpiYearAvgRequest.java b/src/com/sipai/entity/kpi/KpiYearAvgRequest.java deleted file mode 100644 index 8d24d908..00000000 --- a/src/com/sipai/entity/kpi/KpiYearAvgRequest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.entity.kpi; - -//@Data -public class KpiYearAvgRequest { - - private String objUserId; - private String periodYear; - - public String getObjUserId() { - return objUserId; - } - - public void setObjUserId(String objUserId) { - this.objUserId = objUserId; - } - - public String getPeriodYear() { - return periodYear; - } - - public void setPeriodYear(String periodYear) { - this.periodYear = periodYear; - } -} diff --git a/src/com/sipai/entity/kpi/KpiYearAvgResponse.java b/src/com/sipai/entity/kpi/KpiYearAvgResponse.java deleted file mode 100644 index 60044a56..00000000 --- a/src/com/sipai/entity/kpi/KpiYearAvgResponse.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.entity.kpi; - -import java.math.BigDecimal; - -//@Data -public class KpiYearAvgResponse { - - private BigDecimal avgPoint; - - public BigDecimal getAvgPoint() { - return avgPoint; - } - - public void setAvgPoint(BigDecimal avgPoint) { - this.avgPoint = avgPoint; - } -} diff --git a/src/com/sipai/entity/maintenance/Abnormity.java b/src/com/sipai/entity/maintenance/Abnormity.java deleted file mode 100644 index 8f675f0f..00000000 --- a/src/com/sipai/entity/maintenance/Abnormity.java +++ /dev/null @@ -1,329 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; - -public class Abnormity extends BusinessUnitAdapter { - - public final static String Status_Start = "start";//待处理 - public final static String Status_Processing = "processing";//处理中 - public final static String Status_Finish = "finish";//完成 - public final static String Status_Clear = "clear";//已销单 - - public static final String Type_Run = "run";//运行异常 - public static final String Type_Equipment = "equipment";//设备异常 - public static final String Type_Facilities = "facilities";//设施异常 - - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String type; - - private String equipmentIds;//之前为ids多台设备 目前改为单台 - - private String processSectionId; - - private String status; - - private String statusText; - - private String sumitMan; - - private String defectLevel; - - private String libraryId;//库id - - private String patrolRecordId;//巡检记录Id - - private String patrolPointId;//巡检点Id - - private String abnormityDescription;//故障描述 - - private String remark; - - private String equipmentNames;//设备名称 - - private String equipmentCardId;//设备编号 - - private User insertUser; - - private String processid; - - private String processdefid; - - private String receiveUserId; - - // 接收人 - private User receiveUser; - private String _receiveUserName; - - /* - 之前的写法 但暂时不能删除 有些地方用到了 - */ - private Company company; - private ProcessSection processSection; - private MaintenanceDetail maintenanceDetail; - private PatrolRecord patrolRecord; - private PatrolPoint patrolPoint; - - private String _num;//仅用于统计查询中as 2020-04-27 sj - private String _date; - - public String get_receiveUserName() { - return _receiveUserName; - } - - public void set_receiveUserName(String _receiveUserName) { - this._receiveUserName = _receiveUserName; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getLibraryId() { - return libraryId; - } - - public void setLibraryId(String libraryId) { - this.libraryId = libraryId; - } - - public String get_num() { - return _num; - } - - public void set_num(String _num) { - this._num = _num; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getEquipmentIds() { - return equipmentIds; - } - - public void setEquipmentIds(String equipmentIds) { - this.equipmentIds = equipmentIds; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getSumitMan() { - return sumitMan; - } - - public void setSumitMan(String sumitMan) { - this.sumitMan = sumitMan; - } - - public String getDefectLevel() { - return defectLevel; - } - - public void setDefectLevel(String defectLevel) { - this.defectLevel = defectLevel; - } - - public String getAbnormityDescription() { - return abnormityDescription; - } - - public void setAbnormityDescription(String abnormityDescription) { - this.abnormityDescription = abnormityDescription; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getEquipmentNames() { - return equipmentNames; - } - - public void setEquipmentNames(String equipmentNames) { - this.equipmentNames = equipmentNames; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public User getInsertUser() { - return insertUser; - } - - public void setInsertUser(User insertUser) { - this.insertUser = insertUser; - } - - public MaintenanceDetail getMaintenanceDetail() { - return maintenanceDetail; - } - - public void setMaintenanceDetail(MaintenanceDetail maintenanceDetail) { - this.maintenanceDetail = maintenanceDetail; - } - - public PatrolRecord getPatrolRecord() { - return patrolRecord; - } - - public void setPatrolRecord(PatrolRecord patrolRecord) { - this.patrolRecord = patrolRecord; - } - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public String getStatusText() { - return statusText; - } - - public void setStatusText(String statusText) { - this.statusText = statusText; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/AnticorrosiveLibrary.java b/src/com/sipai/entity/maintenance/AnticorrosiveLibrary.java deleted file mode 100644 index 6e0508c9..00000000 --- a/src/com/sipai/entity/maintenance/AnticorrosiveLibrary.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; -/** - * 设备防腐库 - * @author SJ - * - */ -public class AnticorrosiveLibrary extends SQLAdapter{ - - private String id; - - private String projectNumber;//项目编号 - - private String projectName;//项目名称 - - private Integer num;//数量 - - private String contents;//内容 - - private String area;//面积 - - private String cycle;//周期 - - private String mode;//方式:自行或委外 - - private String reason;//委外原因 - - private String qualityRequirement;//质量要求 - - private String warrantyTime;//质保期 - - private float times;//工时定额 - - private float cost;//人工费 - - private float totalCost;//总费用 - - private String memo;//备注 - - private String unitId; - - private String insdt; - - private String insuser; - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getProjectNumber() { - return projectNumber; - } - - public void setProjectNumber(String projectNumber) { - this.projectNumber = projectNumber; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public String getQualityRequirement() { - return qualityRequirement; - } - - public void setQualityRequirement(String qualityRequirement) { - this.qualityRequirement = qualityRequirement; - } - - public String getWarrantyTime() { - return warrantyTime; - } - - public void setWarrantyTime(String warrantyTime) { - this.warrantyTime = warrantyTime; - } - - public float getTimes() { - return times; - } - - public void setTimes(float times) { - this.times = times; - } - - public float getCost() { - return cost; - } - - public void setCost(float cost) { - this.cost = cost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/AnticorrosiveLibraryEquipment.java b/src/com/sipai/entity/maintenance/AnticorrosiveLibraryEquipment.java deleted file mode 100644 index 65e0e501..00000000 --- a/src/com/sipai/entity/maintenance/AnticorrosiveLibraryEquipment.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -/** - * 防腐库 中关联的设备 - * @author SJ - * - */ -public class AnticorrosiveLibraryEquipment extends SQLAdapter{ - private String id; - - private String equid; - - private String pid; - - private EquipmentCard equipmentCard; - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEquid() { - return equid; - } - - public void setEquid(String equid) { - this.equid = equid; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/AnticorrosiveLibraryMaterial.java b/src/com/sipai/entity/maintenance/AnticorrosiveLibraryMaterial.java deleted file mode 100644 index 42e0358a..00000000 --- a/src/com/sipai/entity/maintenance/AnticorrosiveLibraryMaterial.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 防腐库内关联的材料 - * @author SJ - * - */ -public class AnticorrosiveLibraryMaterial extends SQLAdapter{ - private String id; - - private String materialId;//材料库id - - private String pid;//防腐库主表id - - private float num;//材料数量 - - private String insuser; - - private String insdt; - - private AnticorrosiveMaterial anticorrosiveMaterial; - - public float getNum() { - return num; - } - - public void setNum(float num) { - this.num = num; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMaterialId() { - return materialId; - } - - public void setMaterialId(String materialId) { - this.materialId = materialId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public AnticorrosiveMaterial getAnticorrosiveMaterial() { - return anticorrosiveMaterial; - } - - public void setAnticorrosiveMaterial(AnticorrosiveMaterial anticorrosiveMaterial) { - this.anticorrosiveMaterial = anticorrosiveMaterial; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/AnticorrosiveMaterial.java b/src/com/sipai/entity/maintenance/AnticorrosiveMaterial.java deleted file mode 100644 index c903b9fb..00000000 --- a/src/com/sipai/entity/maintenance/AnticorrosiveMaterial.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 防腐库 中材料配置 - * @author SJ - * - */ -public class AnticorrosiveMaterial extends SQLAdapter{ - - private String id; - - private String name; - - private String cost; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCost() { - return cost; - } - - public void setCost(String cost) { - this.cost = cost; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/CompanyMaintenanceResult.java b/src/com/sipai/entity/maintenance/CompanyMaintenanceResult.java deleted file mode 100644 index 550bc243..00000000 --- a/src/com/sipai/entity/maintenance/CompanyMaintenanceResult.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.SpringContextUtil; - -public class CompanyMaintenanceResult { - - private String companyId; - private Company company; - private long totalNum; - private long maintenanceNum;//发单数目 - private long maintenanceNumAll;//发单总数 - private long taskNum;//任务数目 - private long taskNumAll;//任务总数 - private long supplementNum;//补录数目 - private long supplementNumAll;//补录总数 - private long maintainNum;//保养数目 - private long maintainNumAll;//保养总数 - private float judgeStaff;//员工评价 - - public long getMaintenanceNumAll() { - return maintenanceNumAll; - } - public void setMaintenanceNumAll(long maintenanceNumAll) { - this.maintenanceNumAll = maintenanceNumAll; - } - public long getTaskNumAll() { - return taskNumAll; - } - public void setTaskNumAll(long taskNumAll) { - this.taskNumAll = taskNumAll; - } - public long getSupplementNumAll() { - return supplementNumAll; - } - public void setSupplementNumAll(long supplementNumAll) { - this.supplementNumAll = supplementNumAll; - } - public long getMaintainNumAll() { - return maintainNumAll; - } - public void setMaintainNumAll(long maintainNumAll) { - this.maintainNumAll = maintainNumAll; - } - public String getCompanyId() { - return companyId; - } - public void setCompanyId(String companyId) { - this.companyId = companyId; - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitServiceImpl"); - Company company =unitService.getCompById(companyId); - this.setCompany(company); - } - public Company getCompany() { - return company; - } - public void setCompany(Company company) { - this.company = company; - } - public long getTotalNum() { - return totalNum; - } - public void setTotalNum(long totalNum) { - this.totalNum = totalNum; - } - public long getMaintenanceNum() { - return maintenanceNum; - } - public void setMaintenanceNum(long maintenanceNum) { - this.maintenanceNum = maintenanceNum; - } - public long getTaskNum() { - return taskNum; - } - public void setTaskNum(long taskNum) { - this.taskNum = taskNum; - } - public long getSupplementNum() { - return supplementNum; - } - public void setSupplementNum(long supplementNum) { - this.supplementNum = supplementNum; - } - public long getMaintainNum() { - return maintainNum; - } - public void setMaintainNum(long maintainNum) { - this.maintainNum = maintainNum; - } - public float getJudgeStaff() { - return judgeStaff; - } - public void setJudgeStaff(float judgeStaff) { - this.judgeStaff = judgeStaff; - } - - -} diff --git a/src/com/sipai/entity/maintenance/EquipmentPlan.java b/src/com/sipai/entity/maintenance/EquipmentPlan.java deleted file mode 100644 index 5a7b844a..00000000 --- a/src/com/sipai/entity/maintenance/EquipmentPlan.java +++ /dev/null @@ -1,300 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -import java.util.List; - -/** - * 设备维修及保养计划 通过 planType 区分 - * - * @author SJ - */ -public class EquipmentPlan extends BusinessUnitAdapter { - - public final static String Status_NoStart = "noStart";//未开始 - public final static String Status_Start = "start";//开始 - public final static String Status_Finish = "finish";//完成 - public final static String Status_Issued = "issued";//已下发 - - private String id; - - private String planNumber;//计划单号 - - private String planTypeBig;//计划类型 (大类 如:维修、大修、保养) - - private String planTypeSmall;//计划类型 (小类 如:小修、中修) - - private String planDate;//计划日期 - - private float planMoney;//计划费用 - - private String planContents;//计划内容 - - private String status;//状态 - - private String cycle;//周期 - - private String auditId;//审核人 - - private String processdefid; - - private String processid; - - private String unitId; - - private String insdt; - - private String insuser; - private String processStatus; - private String overhaulId; - - private Company company; - - private EquipmentPlanType equipmentPlanType; - - private EquipmentPlanEqu equipmentPlanEqu; - - /** - * 审核意见 - */ - private String auditComment; - /** - * 审核结果(1:通过;0:驳回) - */ - private String pass; - - private int equipmentNum;//用于查询设备数量 总数量 - private int equipmentNumSignfor;//用于查询设备数量 签收数 - private int equipmentNumFinish;//用于查询设备数量 完成数 - - private String groupTypeId;//班组类型id (如运行班,设备班,化验班) - private String groupDetailId;//任务班组id(如运行1班,运行2班) - - public int getEquipmentNumSignfor() { - return equipmentNumSignfor; - } - - public void setEquipmentNumSignfor(int equipmentNumSignfor) { - this.equipmentNumSignfor = equipmentNumSignfor; - } - - public int getEquipmentNumFinish() { - return equipmentNumFinish; - } - - public void setEquipmentNumFinish(int equipmentNumFinish) { - this.equipmentNumFinish = equipmentNumFinish; - } - - public String getGroupTypeId() { - return groupTypeId; - } - - public void setGroupTypeId(String groupTypeId) { - this.groupTypeId = groupTypeId; - } - - public String getGroupDetailId() { - return groupDetailId; - } - - public void setGroupDetailId(String groupDetailId) { - this.groupDetailId = groupDetailId; - } - - private List equipmentPlanEquList; - - public int getEquipmentNum() { - return equipmentNum; - } - - public void setEquipmentNum(int equipmentNum) { - this.equipmentNum = equipmentNum; - } - - public List getEquipmentPlanEquList() { - return equipmentPlanEquList; - } - - public void setEquipmentPlanEquList(List equipmentPlanEquList) { - this.equipmentPlanEquList = equipmentPlanEquList; - } - - public EquipmentPlanEqu getEquipmentPlanEqu() { - return equipmentPlanEqu; - } - - public void setEquipmentPlanEqu(EquipmentPlanEqu equipmentPlanEqu) { - this.equipmentPlanEqu = equipmentPlanEqu; - } - - public String getOverhaulId() { - return overhaulId; - } - - public void setOverhaulId(String overhaulId) { - this.overhaulId = overhaulId; - } - - public String getAuditComment() { - return auditComment; - } - - public void setAuditComment(String auditComment) { - this.auditComment = auditComment; - } - - public String getPass() { - return pass; - } - - public void setPass(String pass) { - this.pass = pass; - } - - public EquipmentPlanType getEquipmentPlanType() { - return equipmentPlanType; - } - - public void setEquipmentPlanType(EquipmentPlanType equipmentPlanType) { - this.equipmentPlanType = equipmentPlanType; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPlanNumber() { - return planNumber; - } - - public void setPlanNumber(String planNumber) { - this.planNumber = planNumber; - } - - public String getPlanTypeBig() { - return planTypeBig; - } - - public void setPlanTypeBig(String planTypeBig) { - this.planTypeBig = planTypeBig; - } - - public String getPlanTypeSmall() { - return planTypeSmall; - } - - public void setPlanTypeSmall(String planTypeSmall) { - this.planTypeSmall = planTypeSmall; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public float getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(float planMoney) { - this.planMoney = planMoney; - } - - public String getPlanContents() { - return planContents; - } - - public void setPlanContents(String planContents) { - this.planContents = planContents; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } -} diff --git a/src/com/sipai/entity/maintenance/EquipmentPlanEqu.java b/src/com/sipai/entity/maintenance/EquipmentPlanEqu.java deleted file mode 100644 index 7f8e3a66..00000000 --- a/src/com/sipai/entity/maintenance/EquipmentPlanEqu.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.User; - -import java.util.List; - -/** - * 维修计划--挂设备 - * @author SJ - * - */ -public class EquipmentPlanEqu extends SQLAdapter{ - - private String id; - - private String equipmentId; - - private String contents; - - private float planMoney; - - private String planDate; - - private String pid; - - private String status; - - private EquipmentCard equipmentCard; - - private EquipmentPlan equipmentPlan; - - private User user; - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public EquipmentPlan getEquipmentPlan() { - return equipmentPlan; - } - - public void setEquipmentPlan(EquipmentPlan equipmentPlan) { - this.equipmentPlan = equipmentPlan; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public float getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(float planMoney) { - this.planMoney = planMoney; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } -} diff --git a/src/com/sipai/entity/maintenance/EquipmentPlanMainYear.java b/src/com/sipai/entity/maintenance/EquipmentPlanMainYear.java deleted file mode 100644 index 5202c5d0..00000000 --- a/src/com/sipai/entity/maintenance/EquipmentPlanMainYear.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.User; - -public class EquipmentPlanMainYear extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String unitId; - - private String equipmentId; - - private BigDecimal planMoney; - - private String particularYear; - - private String remark; - - private String planType;//计划类型 如:维修计划(wx) 保养计划(by) - - private String type;//计划小类型 如:通用保养、润滑保养 - - private String contents; - - private String receiveUserId;//接收人员/保养人员 - - private EquipmentCard equipmentCard; - private EquipmentPlanType equipmentPlanType; - private User receiveUser; - - public String getPlanType() { - return planType; - } - - public void setPlanType(String planType) { - this.planType = planType; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public EquipmentPlanType getEquipmentPlanType() { - return equipmentPlanType; - } - - public void setEquipmentPlanType(EquipmentPlanType equipmentPlanType) { - this.equipmentPlanType = equipmentPlanType; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public BigDecimal getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(BigDecimal planMoney) { - this.planMoney = planMoney; - } - - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getParticularYear() { - return particularYear; - } - - public void setParticularYear(String particularYear) { - this.particularYear = particularYear; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/EquipmentPlanMainYearDetail.java b/src/com/sipai/entity/maintenance/EquipmentPlanMainYearDetail.java deleted file mode 100644 index 3aa6b83f..00000000 --- a/src/com/sipai/entity/maintenance/EquipmentPlanMainYearDetail.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentPlanMainYearDetail extends SQLAdapter{ - private String id; - - private String mainType; - - private String pid; - - private String month; - - - public String getMonth() { - return month; - } - - public void setMonth(String month) { - this.month = month; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMainType() { - return mainType; - } - - public void setMainType(String mainType) { - this.mainType = mainType; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/EquipmentPlanType.java b/src/com/sipai/entity/maintenance/EquipmentPlanType.java deleted file mode 100644 index 559bfc65..00000000 --- a/src/com/sipai/entity/maintenance/EquipmentPlanType.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 维护不同项目设备计划类型 - * - * @author SJ - */ -public class EquipmentPlanType extends SQLAdapter { - - public final static String Type_Wx = "0";//设备维修 - public final static String Type_Ty = "1";//通用保养 - public final static String Type_Rh = "2";//润滑保养 - public final static String Type_Ff = "3";//防腐保养 - public final static String Type_Yb = "4";//仪表保养 - public final static String Type_Dx = "5";//大修改造 - public final static String Type_Xz = "6";//新增重置 - - /* - * 下面用于开发获取对应的下拉框 - */ - public final static String Code_Type_Wx = "wx";//设备维修 - public final static String Code_Type_By = "by";//设备保养 - public final static String Code_Type_Dx = "dx";//设备大修 - - /* - * 下面用于开发获取对应的下拉框 - */ - public final static String Code_Cycle_Month = "month";//月度 - public final static String Code_Cycle_Quarter = "quarter";//季度 - public final static String Code_Cycle_HalfYear = "halfyear";//半年度 - public final static String Code_Cycle_Year = "year";//年度 - - private String id; - - private String name; - - private String type; - - private String libraryActive;//各类库的启用状态 - - private String pid; - - private Integer morder; - - private String code; - - private String isCompete;//是否开放抢单 0禁用 1启用 - - public String getLibraryActive() { - return libraryActive; - } - - public void setLibraryActive(String libraryActive) { - this.libraryActive = libraryActive; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getIsCompete() { - return isCompete; - } - - public void setIsCompete(String isCompete) { - this.isCompete = isCompete; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/FaultLibrary.java b/src/com/sipai/entity/maintenance/FaultLibrary.java deleted file mode 100644 index 61408d14..00000000 --- a/src/com/sipai/entity/maintenance/FaultLibrary.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class FaultLibrary extends SQLAdapter{ - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private String active; - - private Integer morder; - - private String _pname; - - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryAddResetProject.java b/src/com/sipai/entity/maintenance/LibraryAddResetProject.java deleted file mode 100644 index 21ad712e..00000000 --- a/src/com/sipai/entity/maintenance/LibraryAddResetProject.java +++ /dev/null @@ -1,257 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -/** - * 大修库(包括新增重置) 2020-10-10 - * @author SJ - * - */ -public class LibraryAddResetProject extends SQLAdapter{ - - private String id; - - private String code;//项目编号 - - private String name;//项目名称 - - private String type;//新增/重置 - - private String repairPartyType;//自行/委外 - - private String condition;//大修条件 - - private String cycle;//周期 - - private String remark; - - private Integer morder; - - private String modelId;//型号id - - private String unitId; - - private String pid; - - private String insdt; - - private String insuser; - - private LibraryAddResetProjectBloc libraryAddResetProjectBloc; - private LibraryAddResetProjectBiz libraryAddResetProjectBiz; - - /* - * 用于查询 - */ - private float dismantle;//原设备拆除 - private float install;//新设备本体安装 - private float debugging;//新设备调试 - private float accessory;//附属物及安装、土建 - private float transport;//运输费 - private float materialCost;//物资费 - - private String m_id; - private String m_name; - private String m_code; - - public String getM_id() { - return m_id; - } - - public void setM_id(String m_id) { - this.m_id = m_id; - } - - public String getM_name() { - return m_name; - } - - public void setM_name(String m_name) { - this.m_name = m_name; - } - - public String getM_code() { - return m_code; - } - - public void setM_code(String m_code) { - this.m_code = m_code; - } - - public LibraryAddResetProjectBiz getLibraryAddResetProjectBiz() { - return libraryAddResetProjectBiz; - } - - public void setLibraryAddResetProjectBiz( - LibraryAddResetProjectBiz libraryAddResetProjectBiz) { - this.libraryAddResetProjectBiz = libraryAddResetProjectBiz; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getDismantle() { - return dismantle; - } - - public void setDismantle(float dismantle) { - this.dismantle = dismantle; - } - - public float getInstall() { - return install; - } - - public void setInstall(float install) { - this.install = install; - } - - public float getDebugging() { - return debugging; - } - - public void setDebugging(float debugging) { - this.debugging = debugging; - } - - public float getAccessory() { - return accessory; - } - - public void setAccessory(float accessory) { - this.accessory = accessory; - } - - public float getTransport() { - return transport; - } - - public void setTransport(float transport) { - this.transport = transport; - } - - public LibraryAddResetProjectBloc getLibraryAddResetProjectBloc() { - return libraryAddResetProjectBloc; - } - - public void setLibraryAddResetProjectBloc( - LibraryAddResetProjectBloc libraryAddResetProjectBloc) { - this.libraryAddResetProjectBloc = libraryAddResetProjectBloc; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getRepairPartyType() { - return repairPartyType; - } - - public void setRepairPartyType(String repairPartyType) { - this.repairPartyType = repairPartyType; - } - - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryAddResetProjectBiz.java b/src/com/sipai/entity/maintenance/LibraryAddResetProjectBiz.java deleted file mode 100644 index f4e35062..00000000 --- a/src/com/sipai/entity/maintenance/LibraryAddResetProjectBiz.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 大修库(包括新增重置)---水厂定额 2020-10-10 - * @author SJ - * - */ -public class LibraryAddResetProjectBiz extends SQLAdapter{ - - private String id; - - private float dismantle;//原设备拆除 - - private float install;//新设备本体安装 - - private float debugging;//新设备调试 - - private float accessory;//附属物及安装、土建 - - private float transport;//运输费 - - private float outsideRepairCost;//委外工时费定额 - - private float insideRepairTime;//自主实施工时定额 - - private float materialCost;//物资定额费 - - private String projectId;//项目id - - private String equipmentId;//设备id - - private String unitId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getDismantle() { - return dismantle; - } - - public void setDismantle(float dismantle) { - this.dismantle = dismantle; - } - - public float getInstall() { - return install; - } - - public void setInstall(float install) { - this.install = install; - } - - public float getDebugging() { - return debugging; - } - - public void setDebugging(float debugging) { - this.debugging = debugging; - } - - public float getAccessory() { - return accessory; - } - - public void setAccessory(float accessory) { - this.accessory = accessory; - } - - public float getTransport() { - return transport; - } - - public void setTransport(float transport) { - this.transport = transport; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryAddResetProjectBloc.java b/src/com/sipai/entity/maintenance/LibraryAddResetProjectBloc.java deleted file mode 100644 index e863ebc4..00000000 --- a/src/com/sipai/entity/maintenance/LibraryAddResetProjectBloc.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 大修库(包括新增重置)---集团层定额 2020-10-10 - * @author SJ - * - */ -public class LibraryAddResetProjectBloc extends SQLAdapter{ - - private String id; - - private float dismantle;//原设备拆除 - - private float install;//新设备本体安装 - - private float debugging;//新设备调试 - - private float accessory;//附属物及安装、土建 - - private float transport;//运输费 - - private float outsideRepairCost;//委外工时费定额 - - private float insideRepairTime;//自主实施工时定额 - - private float materialCost;//物资定额费 - - private String projectId;//项目id - - private String modelId;//型号id - - private String unitId; - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getDismantle() { - return dismantle; - } - - public void setDismantle(float dismantle) { - this.dismantle = dismantle; - } - - public float getInstall() { - return install; - } - - public void setInstall(float install) { - this.install = install; - } - - public float getDebugging() { - return debugging; - } - - public void setDebugging(float debugging) { - this.debugging = debugging; - } - - public float getAccessory() { - return accessory; - } - - public void setAccessory(float accessory) { - this.accessory = accessory; - } - - public float getTransport() { - return transport; - } - - public void setTransport(float transport) { - this.transport = transport; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryBase.java b/src/com/sipai/entity/maintenance/LibraryBase.java deleted file mode 100644 index b012426a..00000000 --- a/src/com/sipai/entity/maintenance/LibraryBase.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -import java.util.Date; - -public class LibraryBase extends SQLAdapter { - private String id; - - private String libraryType; - - private String placeStatus; - - private Date updt; - - private String upuser; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getLibraryType() { - return libraryType; - } - - public void setLibraryType(String libraryType) { - this.libraryType = libraryType == null ? null : libraryType.trim(); - } - - public String getPlaceStatus() { - return placeStatus; - } - - public void setPlaceStatus(String placeStatus) { - this.placeStatus = placeStatus == null ? null : placeStatus.trim(); - } - - public Date getUpdt() { - return updt; - } - - public void setUpdt(Date updt) { - this.updt = updt; - } - - public String getUpuser() { - return upuser; - } - - public void setUpuser(String upuser) { - this.upuser = upuser == null ? null : upuser.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryFaultBloc.java b/src/com/sipai/entity/maintenance/LibraryFaultBloc.java deleted file mode 100644 index 583dcbd7..00000000 --- a/src/com/sipai/entity/maintenance/LibraryFaultBloc.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentClass; - -/** - * 故障库 (主库) 用于集团使用 专人修改名称编号等 形成一个标准化的库 - */ -public class LibraryFaultBloc extends SQLAdapter{ - - private String id; - - private String faultName;//故障名称 - - private String faultNumber;//故障编号 - - private String faultDescribe;//描述 - - private String pid; - - private String insdt; - - private String insuser; - - private String active; - - private Integer morder; - - private String unitId; - - private String _pname; - - private EquipmentClass equipmentClass; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getFaultName() { - return faultName; - } - - public void setFaultName(String faultName) { - this.faultName = faultName; - } - - public String getFaultNumber() { - return faultNumber; - } - - public void setFaultNumber(String faultNumber) { - this.faultNumber = faultNumber; - } - - public String getFaultDescribe() { - return faultDescribe; - } - - public void setFaultDescribe(String faultDescribe) { - this.faultDescribe = faultDescribe; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public EquipmentClass getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(EquipmentClass equipmentClass) { - this.equipmentClass = equipmentClass; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryMaintainCar.java b/src/com/sipai/entity/maintenance/LibraryMaintainCar.java deleted file mode 100644 index 02c06442..00000000 --- a/src/com/sipai/entity/maintenance/LibraryMaintainCar.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryMaintainCar extends SQLAdapter { - private String id; - - private String name; - - private String model; - - private Double fuelConsumptionPer100km; - - private String unitId; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private String memo; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public Double getFuelConsumptionPer100km() { - return fuelConsumptionPer100km; - } - - public void setFuelConsumptionPer100km(Double fuelConsumptionPer100km) { - this.fuelConsumptionPer100km = fuelConsumptionPer100km; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryMaintainCarDetail.java b/src/com/sipai/entity/maintenance/LibraryMaintainCarDetail.java deleted file mode 100644 index 67b54664..00000000 --- a/src/com/sipai/entity/maintenance/LibraryMaintainCarDetail.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryMaintainCarDetail extends SQLAdapter { - - public final static Double KM5000=0.5; - public final static Double KM10000=1.0; - public final static Double KM15000=1.5; - public final static Double KM20000=2.0; - public final static Double KM25000=2.5; - public final static Double KM30000=3.0; - public final static Double KM35000=3.5; - public final static Double KM40000=4.0; - public final static Double KM45000=4.5; - public final static Double KM50000=5.0; - public final static Double KM55000=5.5; - public final static Double KM60000=6.0; - public final static Double KM65000=6.5; - public final static Double KM70000=7.0; - public final static Double KM75000=7.5; - public final static Double KM80000=8.0; - public final static Double KM85000=8.5; - public final static Double KM90000=9.0; - public final static Double KM95000=9.5; - public final static Double KM100000=10.0; - - private String id; - - private String maintainCarId; - - private Double num10thousandKm; - - private BigDecimal money; - - private Double workingHours; - - private String memo; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMaintainCarId() { - return maintainCarId; - } - - public void setMaintainCarId(String maintainCarId) { - this.maintainCarId = maintainCarId; - } - - public Double getNum10thousandKm() { - return num10thousandKm; - } - - public void setNum10thousandKm(Double num10thousandKm) { - this.num10thousandKm = num10thousandKm; - } - - public BigDecimal getMoney() { - return money; - } - - public void setMoney(BigDecimal money) { - this.money = money; - } - - public Double getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(Double workingHours) { - this.workingHours = workingHours; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryMaintenanceCommon.java b/src/com/sipai/entity/maintenance/LibraryMaintenanceCommon.java deleted file mode 100644 index ae69ac1d..00000000 --- a/src/com/sipai/entity/maintenance/LibraryMaintenanceCommon.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentClass; - - -/** - * 保养库 (通用、仪表) - * @author SJ - * - */ -public class LibraryMaintenanceCommon extends SQLAdapter{ - - public static final String type_Common = "1";//通用 - public static final String type_Meter = "4";//仪表 - - private String id; - - private String code; - - private String name; - - private String cycle; - - private float insideRepairTime; - - private float cost; - - private String pid; - - private String type; - - private String unitId; - - private String insdt; - - private String insuser; - - private Integer morder; - - private EquipmentClass equipmentClass; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getCost() { - return cost; - } - - public void setCost(float cost) { - this.cost = cost; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public EquipmentClass getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(EquipmentClass equipmentClass) { - this.equipmentClass = equipmentClass; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryMaintenanceCommonContent.java b/src/com/sipai/entity/maintenance/LibraryMaintenanceCommonContent.java deleted file mode 100644 index f40f9c8e..00000000 --- a/src/com/sipai/entity/maintenance/LibraryMaintenanceCommonContent.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 维保库 (通用、仪表) 附表 - * @author SJ - * - */ -public class LibraryMaintenanceCommonContent extends SQLAdapter{ - - private String id; - - private String code; - - private String contents; - - private String tools; - - private String security; - - private String commonId; - - //用于导出查询 - private String m_id;//设备小类id - private String m_name; - private String m_code; - private String ec_id;//部位id - private String ec_name; - private String ec_code; - private String p_id;//项目id - private String p_name; - private String p_code; - private String p_cycle; - private String p_time; - private String p_cost; - - public String getP_time() { - return p_time; - } - - public void setP_time(String p_time) { - this.p_time = p_time; - } - - public String getP_cost() { - return p_cost; - } - - public void setP_cost(String p_cost) { - this.p_cost = p_cost; - } - - public String getM_id() { - return m_id; - } - - public void setM_id(String m_id) { - this.m_id = m_id; - } - - public String getM_name() { - return m_name; - } - - public void setM_name(String m_name) { - this.m_name = m_name; - } - - public String getM_code() { - return m_code; - } - - public void setM_code(String m_code) { - this.m_code = m_code; - } - - public String getEc_id() { - return ec_id; - } - - public void setEc_id(String ec_id) { - this.ec_id = ec_id; - } - - public String getEc_name() { - return ec_name; - } - - public void setEc_name(String ec_name) { - this.ec_name = ec_name; - } - - public String getEc_code() { - return ec_code; - } - - public void setEc_code(String ec_code) { - this.ec_code = ec_code; - } - - public String getP_id() { - return p_id; - } - - public void setP_id(String p_id) { - this.p_id = p_id; - } - - public String getP_name() { - return p_name; - } - - public void setP_name(String p_name) { - this.p_name = p_name; - } - - public String getP_code() { - return p_code; - } - - public void setP_code(String p_code) { - this.p_code = p_code; - } - - public String getP_cycle() { - return p_cycle; - } - - public void setP_cycle(String p_cycle) { - this.p_cycle = p_cycle; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getTools() { - return tools; - } - - public void setTools(String tools) { - this.tools = tools; - } - - public String getSecurity() { - return security; - } - - public void setSecurity(String security) { - this.security = security; - } - - public String getCommonId() { - return commonId; - } - - public void setCommonId(String commonId) { - this.commonId = commonId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryMaintenanceLubrication.java b/src/com/sipai/entity/maintenance/LibraryMaintenanceLubrication.java deleted file mode 100644 index 2cb43a0d..00000000 --- a/src/com/sipai/entity/maintenance/LibraryMaintenanceLubrication.java +++ /dev/null @@ -1,249 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.user.User; - -/** - * 设备润滑库 - * @author SJ - * - */ -public class LibraryMaintenanceLubrication extends SQLAdapter{ - - private String id; - - private String code; - - private String name; - - private String contents; - - private String cycle; - - private float standard;//油量标准 - - private String unit; - - private String model; - - private float insideRepairTime; - - private String lubricationuid; - - private float cost; - - private String pid; - - private String unitId; - - private String insdt; - - private String insuser; - - private Integer morder; - - private User user; - - private String s_id; - private String s_name; - private String s_code; - private String p_id; - private String p_name; - private String p_code; - - private EquipmentClass equipmentClass; - - public String getS_id() { - return s_id; - } - - public void setS_id(String s_id) { - this.s_id = s_id; - } - - public String getS_name() { - return s_name; - } - - public void setS_name(String s_name) { - this.s_name = s_name; - } - - public String getS_code() { - return s_code; - } - - public void setS_code(String s_code) { - this.s_code = s_code; - } - - public String getP_id() { - return p_id; - } - - public void setP_id(String p_id) { - this.p_id = p_id; - } - - public String getP_name() { - return p_name; - } - - public void setP_name(String p_name) { - this.p_name = p_name; - } - - public String getP_code() { - return p_code; - } - - public void setP_code(String p_code) { - this.p_code = p_code; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public float getStandard() { - return standard; - } - - public void setStandard(float standard) { - this.standard = standard; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public String getLubricationuid() { - return lubricationuid; - } - - public void setLubricationuid(String lubricationuid) { - this.lubricationuid = lubricationuid; - } - - public float getCost() { - return cost; - } - - public void setCost(float cost) { - this.cost = cost; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public EquipmentClass getEquipmentClass() { - return equipmentClass; - } - - public void setEquipmentClass(EquipmentClass equipmentClass) { - this.equipmentClass = equipmentClass; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryMaterialQuota.java b/src/com/sipai/entity/maintenance/LibraryMaterialQuota.java deleted file mode 100644 index 7b7ce934..00000000 --- a/src/com/sipai/entity/maintenance/LibraryMaterialQuota.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.sparepart.Goods; - -/** - * 设备各类的 物资定额库 - * @author SJ - * - */ -public class LibraryMaterialQuota extends SQLAdapter{ - - private String id; - - private String materialId;//物资id - - private float materialNum;//数量 - - private float materialCost;//物资单价 - - private float totalCost;//总价 - - private String pid; - - private Goods goods; - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMaterialId() { - return materialId; - } - - public void setMaterialId(String materialId) { - this.materialId = materialId; - } - - public float getMaterialNum() { - return materialNum; - } - - public void setMaterialNum(float materialNum) { - this.materialNum = materialNum; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryOverhaulContentBloc.java b/src/com/sipai/entity/maintenance/LibraryOverhaulContentBloc.java deleted file mode 100644 index 5481f18f..00000000 --- a/src/com/sipai/entity/maintenance/LibraryOverhaulContentBloc.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 设备大修库--大修内容 (集团) - * @author SJ - * - */ -public class LibraryOverhaulContentBloc extends SQLAdapter{ - - private String id; - - private String contentNumber;//大修内容编号 - - private String repairContent;//大修内容 - - private String repairPartyType;//维修方式 自修或委外 - - private float insideRepairTime;//自修工时定额 - - private float materialCost;//物资费定额 - - private float outsideRepairCost;//委外工时费定额 - - private float totalCost;//总大修定额费 - - private String pid; - - private Integer morder; - - private LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc; - private LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz; - - public LibraryOverhaulContentEquBiz getLibraryOverhaulContentEquBiz() { - return libraryOverhaulContentEquBiz; - } - public void setLibraryOverhaulContentEquBiz( - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz) { - this.libraryOverhaulContentEquBiz = libraryOverhaulContentEquBiz; - } - //用于导出查询 - private String m_id;//设备小类id - private String m_name; - private String m_code; - private String ec_id;//部位id - private String ec_name; - private String ec_code; - private String p_id;//大修项目id - private String p_name; - private String p_code; - private String _condition;//大修条件 - private String _cycle;//大修周期 - - - public LibraryOverhaulContentModelBloc getLibraryOverhaulContentModelBloc() { - return libraryOverhaulContentModelBloc; - } - public void setLibraryOverhaulContentModelBloc( - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc) { - this.libraryOverhaulContentModelBloc = libraryOverhaulContentModelBloc; - } - public String get_condition() { - return _condition; - } - public void set_condition(String _condition) { - this._condition = _condition; - } - public String get_cycle() { - return _cycle; - } - public void set_cycle(String _cycle) { - this._cycle = _cycle; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getContentNumber() { - return contentNumber; - } - public void setContentNumber(String contentNumber) { - this.contentNumber = contentNumber; - } - public String getRepairContent() { - return repairContent; - } - public void setRepairContent(String repairContent) { - this.repairContent = repairContent; - } - public String getRepairPartyType() { - return repairPartyType; - } - public void setRepairPartyType(String repairPartyType) { - this.repairPartyType = repairPartyType; - } - public float getInsideRepairTime() { - return insideRepairTime; - } - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - public float getMaterialCost() { - return materialCost; - } - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - public float getOutsideRepairCost() { - return outsideRepairCost; - } - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - public float getTotalCost() { - return totalCost; - } - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - public String getPid() { - return pid; - } - public void setPid(String pid) { - this.pid = pid; - } - public Integer getMorder() { - return morder; - } - public void setMorder(Integer morder) { - this.morder = morder; - } - public String getM_id() { - return m_id; - } - public void setM_id(String m_id) { - this.m_id = m_id; - } - public String getM_name() { - return m_name; - } - public void setM_name(String m_name) { - this.m_name = m_name; - } - public String getM_code() { - return m_code; - } - public void setM_code(String m_code) { - this.m_code = m_code; - } - public String getEc_id() { - return ec_id; - } - public void setEc_id(String ec_id) { - this.ec_id = ec_id; - } - public String getEc_name() { - return ec_name; - } - public void setEc_name(String ec_name) { - this.ec_name = ec_name; - } - public String getEc_code() { - return ec_code; - } - public void setEc_code(String ec_code) { - this.ec_code = ec_code; - } - public String getP_id() { - return p_id; - } - public void setP_id(String p_id) { - this.p_id = p_id; - } - public String getP_name() { - return p_name; - } - public void setP_name(String p_name) { - this.p_name = p_name; - } - public String getP_code() { - return p_code; - } - public void setP_code(String p_code) { - this.p_code = p_code; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryOverhaulContentEquBiz.java b/src/com/sipai/entity/maintenance/LibraryOverhaulContentEquBiz.java deleted file mode 100644 index 0adb655b..00000000 --- a/src/com/sipai/entity/maintenance/LibraryOverhaulContentEquBiz.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; - -public class LibraryOverhaulContentEquBiz extends SQLAdapter{ - private String id; - - private float insideRepairTime; - - private float outsideRepairCost; - - private float materialCost; - - private float totalCost; - - private String adjustmentReason; - - private String contentId; - - private String equipmentId; - - private String unitId; - - private Company company; - private EquipmentCard equipmentCard; - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getAdjustmentReason() { - return adjustmentReason; - } - - public void setAdjustmentReason(String adjustmentReason) { - this.adjustmentReason = adjustmentReason; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryOverhaulContentModelBloc.java b/src/com/sipai/entity/maintenance/LibraryOverhaulContentModelBloc.java deleted file mode 100644 index 798d9121..00000000 --- a/src/com/sipai/entity/maintenance/LibraryOverhaulContentModelBloc.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 设备大修库内容--不同设备型号对应的定额附表 (集团) - * @author SJ - * - */ -public class LibraryOverhaulContentModelBloc extends SQLAdapter{ - - private String id; - - private float insideRepairTime; - - private float outsideRepairCost; - - private float materialCost; - - private float totalCost; - - private String contentId;//内容id - - private String modelId;//型号id - - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryOverhaulProjectBloc.java b/src/com/sipai/entity/maintenance/LibraryOverhaulProjectBloc.java deleted file mode 100644 index 962136cc..00000000 --- a/src/com/sipai/entity/maintenance/LibraryOverhaulProjectBloc.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 设备大修库--大修项目 (业务区) - * @author SJ - * - */ -public class LibraryOverhaulProjectBloc extends SQLAdapter{ - - private String id; - - private String projectNumber;//项目编号 - - private String projectName;//项目名称 - - private String condition;//大修条件 - - private String pid;//关联设备分类id - - private String modelId;//关联设备型号id - - private String cycle;//周期 - - private String insdt; - - private String insuser; - - private String active; - - private Integer morder; - - private String unitId; - - - /* - * 用于查询 - */ - private LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc; - private LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz; - private float insideRepairTime;//自修工时定额 - private float materialCost;//物资费定额 - private float outsideRepairCost;//委外工时费定额 - private float totalCost;//总大修定额费 - - public LibraryOverhaulProjectEquBiz getLibraryOverhaulProjectEquBiz() { - return libraryOverhaulProjectEquBiz; - } - - public void setLibraryOverhaulProjectEquBiz( - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz) { - this.libraryOverhaulProjectEquBiz = libraryOverhaulProjectEquBiz; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public LibraryOverhaulProjectModelBloc getLibraryOverhaulProjectModelBloc() { - return libraryOverhaulProjectModelBloc; - } - - public void setLibraryOverhaulProjectModelBloc( - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc) { - this.libraryOverhaulProjectModelBloc = libraryOverhaulProjectModelBloc; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getProjectNumber() { - return projectNumber; - } - - public void setProjectNumber(String projectNumber) { - this.projectNumber = projectNumber; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryOverhaulProjectEquBiz.java b/src/com/sipai/entity/maintenance/LibraryOverhaulProjectEquBiz.java deleted file mode 100644 index fc724c8e..00000000 --- a/src/com/sipai/entity/maintenance/LibraryOverhaulProjectEquBiz.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; - -public class LibraryOverhaulProjectEquBiz extends SQLAdapter{ - private String id; - - private float insideRepairTime; - - private float outsideRepairCost; - - private float materialCost; - - private float totalCost; - - private String projectId; - - private String equipmentId; - - private String unitId; - - private Company company; - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public float getInsideRepairTime() { - return insideRepairTime; - } - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - public float getOutsideRepairCost() { - return outsideRepairCost; - } - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - public float getMaterialCost() { - return materialCost; - } - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - public float getTotalCost() { - return totalCost; - } - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - public String getProjectId() { - return projectId; - } - public void setProjectId(String projectId) { - this.projectId = projectId; - } - public String getEquipmentId() { - return equipmentId; - } - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - public String getUnitId() { - return unitId; - } - public void setUnitId(String unitId) { - this.unitId = unitId; - } - public Company getCompany() { - return company; - } - public void setCompany(Company company) { - this.company = company; - } - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryOverhaulProjectModelBloc.java b/src/com/sipai/entity/maintenance/LibraryOverhaulProjectModelBloc.java deleted file mode 100644 index 7b17b521..00000000 --- a/src/com/sipai/entity/maintenance/LibraryOverhaulProjectModelBloc.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 设备大修库项目--不同设备型号对应的定额附表 (集团) - * @author SJ - * - */ -public class LibraryOverhaulProjectModelBloc extends SQLAdapter{ - - private String id; - - private float insideRepairTime; - - private float outsideRepairCost; - - private float materialCost; - - private float totalCost; - - private String projectId; - - private String modelId; - - private String unitId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryRepairBloc.java b/src/com/sipai/entity/maintenance/LibraryRepairBloc.java deleted file mode 100644 index e179335c..00000000 --- a/src/com/sipai/entity/maintenance/LibraryRepairBloc.java +++ /dev/null @@ -1,293 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 维修库(集团层) - * @author SJ - * - */ -public class LibraryRepairBloc extends SQLAdapter{ - - private String id; - - private String repairName; - - private String repairNumber;//维修编号 - - private String repairContent;//维修内容 - - private String pid;//关联设备类别或部位等 - - private String insdt; - - private String insuser; - - private String repairPartyType;//维修方式 自修或委外 - - private String repairType;//维修类型 小修 中修等 - - private float insideRepairTime;//自修工时定额 - - private float materialCost;//物资费定额 - - private float outsideRepairCost;//委外工时费定额 - - private float totalCost;//总大修定额费 - - private String active; - - private Integer morder; - - private LibraryRepairModelBloc libraryRepairModelBloc; - private LibraryRepairEquBiz libraryRepairEquBiz; - private LibraryFaultBloc libraryFaultBloc; - - //用于导出查询 - private String m_id;//设备小类id - private String m_name; - private String m_code; - private String ec_id;//部位id - private String ec_name; - private String ec_code; - private String p_id;//大修项目id - private String p_name; - private String p_code; - private String p_describe;//大修条件 - - // 用于初始化 - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getM_id() { - return m_id; - } - - public void setM_id(String m_id) { - this.m_id = m_id; - } - - public String getM_name() { - return m_name; - } - - public void setM_name(String m_name) { - this.m_name = m_name; - } - - public String getM_code() { - return m_code; - } - - public void setM_code(String m_code) { - this.m_code = m_code; - } - - public String getEc_id() { - return ec_id; - } - - public void setEc_id(String ec_id) { - this.ec_id = ec_id; - } - - public String getEc_name() { - return ec_name; - } - - public void setEc_name(String ec_name) { - this.ec_name = ec_name; - } - - public String getEc_code() { - return ec_code; - } - - public void setEc_code(String ec_code) { - this.ec_code = ec_code; - } - - public String getP_id() { - return p_id; - } - - public void setP_id(String p_id) { - this.p_id = p_id; - } - - public String getP_name() { - return p_name; - } - - public void setP_name(String p_name) { - this.p_name = p_name; - } - - public String getP_code() { - return p_code; - } - - public void setP_code(String p_code) { - this.p_code = p_code; - } - - public String getP_describe() { - return p_describe; - } - - public void setP_describe(String p_describe) { - this.p_describe = p_describe; - } - - public LibraryRepairModelBloc getLibraryRepairModelBloc() { - return libraryRepairModelBloc; - } - - public void setLibraryRepairModelBloc( - LibraryRepairModelBloc libraryRepairModelBloc) { - this.libraryRepairModelBloc = libraryRepairModelBloc; - } - - public LibraryRepairEquBiz getLibraryRepairEquBiz() { - return libraryRepairEquBiz; - } - - public void setLibraryRepairEquBiz(LibraryRepairEquBiz libraryRepairEquBiz) { - this.libraryRepairEquBiz = libraryRepairEquBiz; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRepairName() { - return repairName; - } - - public void setRepairName(String repairName) { - this.repairName = repairName; - } - - public String getRepairNumber() { - return repairNumber; - } - - public void setRepairNumber(String repairNumber) { - this.repairNumber = repairNumber; - } - - public String getRepairContent() { - return repairContent; - } - - public void setRepairContent(String repairContent) { - this.repairContent = repairContent; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getRepairPartyType() { - return repairPartyType; - } - - public void setRepairPartyType(String repairPartyType) { - this.repairPartyType = repairPartyType; - } - - public String getRepairType() { - return repairType; - } - - public void setRepairType(String repairType) { - this.repairType = repairType; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public LibraryFaultBloc getLibraryFaultBloc() { - return libraryFaultBloc; - } - - public void setLibraryFaultBloc(LibraryFaultBloc libraryFaultBloc) { - this.libraryFaultBloc = libraryFaultBloc; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryRepairEquBiz.java b/src/com/sipai/entity/maintenance/LibraryRepairEquBiz.java deleted file mode 100644 index 20227088..00000000 --- a/src/com/sipai/entity/maintenance/LibraryRepairEquBiz.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; - -public class LibraryRepairEquBiz extends SQLAdapter{ - - private String id; - - private float insideRepairTime; - - private float outsideRepairCost; - - private float materialCost; - - private float totalCost; - - private String adjustmentReason; - - private String contentId; - - private String equipmentId; - - private String unitId; - - private Company company; - private EquipmentCard equipmentCard; - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getAdjustmentReason() { - return adjustmentReason; - } - - public void setAdjustmentReason(String adjustmentReason) { - this.adjustmentReason = adjustmentReason; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/LibraryRepairModelBloc.java b/src/com/sipai/entity/maintenance/LibraryRepairModelBloc.java deleted file mode 100644 index f6e7581f..00000000 --- a/src/com/sipai/entity/maintenance/LibraryRepairModelBloc.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryRepairModelBloc extends SQLAdapter{ - - private String id; - - private float insideRepairTime; - - private float outsideRepairCost; - - private float materialCost; - - private float totalCost; - - private String contentId;//内容id - - private String modelId;//型号id - - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public float getInsideRepairTime() { - return insideRepairTime; - } - - public void setInsideRepairTime(float insideRepairTime) { - this.insideRepairTime = insideRepairTime; - } - - public float getOutsideRepairCost() { - return outsideRepairCost; - } - - public void setOutsideRepairCost(float outsideRepairCost) { - this.outsideRepairCost = outsideRepairCost; - } - - public float getMaterialCost() { - return materialCost; - } - - public void setMaterialCost(float materialCost) { - this.materialCost = materialCost; - } - - public float getTotalCost() { - return totalCost; - } - - public void setTotalCost(float totalCost) { - this.totalCost = totalCost; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/Maintain.java b/src/com/sipai/entity/maintenance/Maintain.java deleted file mode 100644 index 23f6584c..00000000 --- a/src/com/sipai/entity/maintenance/Maintain.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -/** - * 维保工单-主表 - * @author SJ 2020-10-30 - * - */ -public class Maintain extends BusinessUnitAdapter{ - public final static String Status_Start="start";//开始 - public final static String Status_Finish="finish";//完成 - private Company company; - private EquipmentCard equipmentCard; - private User receiveUser; - private EquipmentPlanType equipmentPlanType; - public final static String Status_11="11"; - public final static String Status_21="21"; - public final static String Status_22="22"; - public final static String Status_31="31"; - public final static String Status_41="41"; - public final static String Status_42="42"; - public final static String Status_51="51"; - private String id; - - private String insdt; - - private String insuser; - - private String jobNumber;//工单号 - - private String completeDate;//完成日期 - - private String cycle;//周期 - - private String receiveUserId;//接收人id - - private String receiveUserIds;//接收人ids - - private String planDate;//计划日期 - - private String planType;//计划类型 (计划内、计划外) - - private String maintainType;//保养类型 (通用、润滑、仪表、防腐等) - - private String equipmentId;//设备id - - private String processStatus;//流程状态 - - private String unitId;//部门id - - private String processdefid; - - private String processid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getCompleteDate() { - return completeDate; - } - - public void setCompleteDate(String completeDate) { - this.completeDate = completeDate; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getPlanType() { - return planType; - } - - public void setPlanType(String planType) { - this.planType = planType; - } - - public String getMaintainType() { - return maintainType; - } - - public void setMaintainType(String maintainType) { - this.maintainType = maintainType; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public EquipmentPlanType getEquipmentPlanType() { - return equipmentPlanType; - } - - public void setEquipmentPlanType(EquipmentPlanType equipmentPlanType) { - this.equipmentPlanType = equipmentPlanType; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintainCar.java b/src/com/sipai/entity/maintenance/MaintainCar.java deleted file mode 100644 index 9410b58f..00000000 --- a/src/com/sipai/entity/maintenance/MaintainCar.java +++ /dev/null @@ -1,267 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.math.BigDecimal; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; - -public class MaintainCar extends BusinessUnitAdapter { - private String id; - - private String detailNumber; - - private String maintainWorkUnitName; - - private String solver; - - private String carNumber; - - private String maintainCarId; - - private String maintainCarDetailId; - - private String lastMaintainTime; - - private Integer odograph; - - private String maintainReason; - - private BigDecimal actualMoney; - - private Double actualWorkingHours; - - private String memo; - - private String qualityOpinion; - - private Double calWorkingHours; - - private Double finalWorkingHours; - - private String unitId; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private String status; - - private String processdefid; - - private String processid; - - private LibraryMaintainCar libraryMaintainCar; - private LibraryMaintainCarDetail libraryMaintainCarDetail; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDetailNumber() { - return detailNumber; - } - - public void setDetailNumber(String detailNumber) { - this.detailNumber = detailNumber; - } - - public String getMaintainWorkUnitName() { - return maintainWorkUnitName; - } - - public void setMaintainWorkUnitName(String maintainWorkUnitName) { - this.maintainWorkUnitName = maintainWorkUnitName; - } - - public String getCarNumber() { - return carNumber; - } - - public void setCarNumber(String carNumber) { - this.carNumber = carNumber; - } - - public String getMaintainCarId() { - return maintainCarId; - } - - public void setMaintainCarId(String maintainCarId) { - this.maintainCarId = maintainCarId; - } - - public String getLastMaintainTime() { - return lastMaintainTime; - } - - public void setLastMaintainTime(String lastMaintainTime) { - this.lastMaintainTime = lastMaintainTime; - } - - public Integer getOdograph() { - return odograph; - } - - public void setOdograph(Integer odograph) { - this.odograph = odograph; - } - - public String getMaintainReason() { - return maintainReason; - } - - public void setMaintainReason(String maintainReason) { - this.maintainReason = maintainReason; - } - - public BigDecimal getActualMoney() { - return actualMoney; - } - - public void setActualMoney(BigDecimal actualMoney) { - this.actualMoney = actualMoney; - } - - public Double getActualWorkingHours() { - return actualWorkingHours; - } - - public void setActualWorkingHours(Double actualWorkingHours) { - this.actualWorkingHours = actualWorkingHours; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getQualityOpinion() { - return qualityOpinion; - } - - public void setQualityOpinion(String qualityOpinion) { - this.qualityOpinion = qualityOpinion; - } - - public Double getCalWorkingHours() { - return calWorkingHours; - } - - public void setCalWorkingHours(Double calWorkingHours) { - this.calWorkingHours = calWorkingHours; - } - - public Double getFinalWorkingHours() { - return finalWorkingHours; - } - - public void setFinalWorkingHours(Double finalWorkingHours) { - this.finalWorkingHours = finalWorkingHours; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getMaintainCarDetailId() { - return maintainCarDetailId; - } - - public void setMaintainCarDetailId(String maintainCarDetailId) { - this.maintainCarDetailId = maintainCarDetailId; - } - - public LibraryMaintainCar getLibraryMaintainCar() { - return libraryMaintainCar; - } - - public void setLibraryMaintainCar(LibraryMaintainCar libraryMaintainCar) { - this.libraryMaintainCar = libraryMaintainCar; - } - - public LibraryMaintainCarDetail getLibraryMaintainCarDetail() { - return libraryMaintainCarDetail; - } - - public void setLibraryMaintainCarDetail(LibraryMaintainCarDetail libraryMaintainCarDetail) { - this.libraryMaintainCarDetail = libraryMaintainCarDetail; - } - - public String getSolver() { - return solver; - } - - public void setSolver(String solver) { - this.solver = solver; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintainCommStr.java b/src/com/sipai/entity/maintenance/MaintainCommStr.java deleted file mode 100644 index e76c727b..00000000 --- a/src/com/sipai/entity/maintenance/MaintainCommStr.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.entity.maintenance; - -public class MaintainCommStr { - public static final String Maintain_IN = "in";//自行维护维修 - public static final String Maintain_OUT = "out";//委外 - - public static final String Maintain_Week = "week";//周 - public static final String Maintain_TenDays = "tenDays";//旬 - public static final String Maintain_Month = "month";//月 - public static final String Maintain_Quarter = "quarter";//季度 - public static final String Maintain_HalfYear = "halfYear";//半年度 - public static final String Maintain_Year = "year";//年度 - - public static final String Maintain_RepairType_Small = "small";//小修 - public static final String Maintain_RepairType_Medium = "medium";//中修 - - public static final String Maintain_OverhaulType_overhaul = "overhaul";//大修 - public static final String Maintain_OverhaulType_reform = "reform";//改造 - public static final String Maintain_OverhaulType_add = "add";//新增 - public static final String Maintain_OverhaulType_reset = "reset";//重置 -} diff --git a/src/com/sipai/entity/maintenance/MaintainPlan.java b/src/com/sipai/entity/maintenance/MaintainPlan.java deleted file mode 100644 index 608bdf9b..00000000 --- a/src/com/sipai/entity/maintenance/MaintainPlan.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.maintenance; - - -import java.util.HashMap; -import java.util.Map; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class MaintainPlan extends SQLAdapter{ - public final static String PlanType_Year ="0"; - public final static String PlanType_Quarter ="1"; - public final static String PlanType_Month ="2"; - public final static String PlanType_Week ="3"; - - public static String getPlanTypeName(String key){ - String name =""; - switch (key) { - case PlanType_Year: - name="年度"; - break; - case PlanType_Quarter: - name="季度"; - break; - case PlanType_Month: - name="月度"; - break; - case PlanType_Week: - name="周度"; - break; - - default: - break; - } - return name; - } - - private String id; - - private String insdt; - - private String insuser; - - private String maintainerid; - - private String companyid; - - private String sdt; - - private String edt; - - private String type; - - private String maintaincontent; - - private Company company; - - private Maintainer maintainer; - - private String typeName; - - - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public Maintainer getMaintainer() { - return maintainer; - } - - public void setMaintainer(Maintainer maintainer) { - this.maintainer = maintainer; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMaintainerid() { - return maintainerid; - } - - public void setMaintainerid(String maintainerid) { - this.maintainerid = maintainerid; - } - - public String getCompanyid() { - return companyid; - } - - public void setCompanyid(String companyid) { - this.companyid = companyid; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMaintaincontent() { - return maintaincontent; - } - - public void setMaintaincontent(String maintaincontent) { - this.maintaincontent = maintaincontent; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/Maintainer.java b/src/com/sipai/entity/maintenance/Maintainer.java deleted file mode 100644 index 0a640038..00000000 --- a/src/com/sipai/entity/maintenance/Maintainer.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -import java.util.Date; -import java.util.List; - -public class Maintainer extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String type; - - private String fullName; - - private String shortName; - - private String address; - - private String fax; - - private String contactsName; - - private String contactsMobilephone; - - private String telephone; - - private String remark; - - private String pid; - - private String active; - - private Integer morder; - - private String syncflag; - - private List maintainerTypes; - - - public List getMaintainerTypes() { - return maintainerTypes; - } - - public void setMaintainerTypes(List maintainerTypes) { - this.maintainerTypes = maintainerTypes; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getFax() { - return fax; - } - - public void setFax(String fax) { - this.fax = fax; - } - - public String getContactsName() { - return contactsName; - } - - public void setContactsName(String contactsName) { - this.contactsName = contactsName; - } - - public String getContactsMobilephone() { - return contactsMobilephone; - } - - public void setContactsMobilephone(String contactsMobilephone) { - this.contactsMobilephone = contactsMobilephone; - } - - public String getTelephone() { - return telephone; - } - - public void setTelephone(String telephone) { - this.telephone = telephone; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSyncflag() { - return syncflag; - } - - public void setSyncflag(String syncflag) { - this.syncflag = syncflag; - } - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintainerCompany.java b/src/com/sipai/entity/maintenance/MaintainerCompany.java deleted file mode 100644 index d05fbf41..00000000 --- a/src/com/sipai/entity/maintenance/MaintainerCompany.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MaintainerCompany extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String maintainerid; - - private String companyid; - - private String startdate; - - private String enddate; - - private String maintainerleader; - - private String factorycontacter; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMaintainerid() { - return maintainerid; - } - - public void setMaintainerid(String maintainerid) { - this.maintainerid = maintainerid; - } - - public String getCompanyid() { - return companyid; - } - - public void setCompanyid(String companyid) { - this.companyid = companyid; - } - - public String getStartdate() { - return startdate; - } - - public void setStartdate(String startdate) { - this.startdate = startdate; - } - - public String getEnddate() { - return enddate; - } - - public void setEnddate(String enddate) { - this.enddate = enddate; - } - - public String getMaintainerleader() { - return maintainerleader; - } - - public void setMaintainerleader(String maintainerleader) { - this.maintainerleader = maintainerleader; - } - - public String getFactorycontacter() { - return factorycontacter; - } - - public void setFactorycontacter(String factorycontacter) { - this.factorycontacter = factorycontacter; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintainerSelectType.java b/src/com/sipai/entity/maintenance/MaintainerSelectType.java deleted file mode 100644 index 469d1a8e..00000000 --- a/src/com/sipai/entity/maintenance/MaintainerSelectType.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MaintainerSelectType extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String maintainerTypeid; - - private String maintainerid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMaintainerTypeid() { - return maintainerTypeid; - } - - public void setMaintainerTypeid(String maintainerTypeid) { - this.maintainerTypeid = maintainerTypeid; - } - - public String getMaintainerid() { - return maintainerid; - } - - public void setMaintainerid(String maintainerid) { - this.maintainerid = maintainerid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintainerType.java b/src/com/sipai/entity/maintenance/MaintainerType.java deleted file mode 100644 index a3d69fb0..00000000 --- a/src/com/sipai/entity/maintenance/MaintainerType.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MaintainerType extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/Maintenance.java b/src/com/sipai/entity/maintenance/Maintenance.java deleted file mode 100644 index 2eccc500..00000000 --- a/src/com/sipai/entity/maintenance/Maintenance.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class Maintenance extends SQLAdapter{ - public final static String Status_Edit="0"; //问题编辑 - public final static String Status_Launch="1"; //问题发起 - public final static String Status_Submit_Problem="2";//厂区负责人确认问�? - //厂区负责人退回发起问题 - public final static String Status_Cancel_Problem="3"; - public final static String Status_Confirm_Maintainer="4";//运维商确�? - public final static String Status_Submit_Maintainer="5";//运维商提�? - public final static String Status_Cancel_Maintainer="6";//供应商�?�? - public final static String Status_CancelTOMaintainer="8";//厂区负责人驳回完成情�? - public final static String Status_Finish="7";//完成 - public final static String Status_Supplementing="10";//补录中 - //废弃整个运维单 - public final static String Status_Cancel="9"; - - public final static String TYPE_SUPPLEMENT="0";// 补录 - public final static String TYPE_MAINTENANCE="1";// 运维主流�? - public final static String TYPE_MAINTAIN="2";// 运维保养 - - public final static int Target_Pass=1;// 通过 - public final static int Target_Cancel=-1;// 废弃 - public final static int Target_Reject=0;//退回 - private String id; - private String insuser; - private String insdt; - private String problem; - private String companyid; - private String expectenddt; - private String applicantid; - private String confirmdt; - private String submitproblemdt; - private String maintenancemethod; - private String maintenancedt; - private String type; - private String status; - private String cancelreason; - private String maintainertypeid; - private String maintainerid; - private String managerid; - private String maintainerconfirmdt; - private String contractno; - private String maintainerfinishidt; - private String result; - private String enddt; - private String remark; - private Integer judgemaintainer; - private Integer judgemaintainerstaff; - private Integer judgeresult; - private String processid; - - private Company company; - private String equipmentIds; - - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getEquipmentIds() { - return equipmentIds; - } - - public void setEquipmentIds(String equipmentIds) { - this.equipmentIds = equipmentIds; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getProblem() { - return problem; - } - - public void setProblem(String problem) { - this.problem = problem; - } - - public String getCompanyid() { - return companyid; - } - - public void setCompanyid(String companyid) { - this.companyid = companyid; - } - - public String getExpectenddt() { - return expectenddt; - } - - public void setExpectenddt(String expectenddt) { - this.expectenddt = expectenddt; - } - - public String getApplicantid() { - return applicantid; - } - - public void setApplicantid(String applicantid) { - this.applicantid = applicantid; - } - - public String getConfirmdt() { - return confirmdt; - } - - public void setConfirmdt(String confirmdt) { - this.confirmdt = confirmdt; - } - - public String getSubmitproblemdt() { - return submitproblemdt; - } - - public void setSubmitproblemdt(String submitproblemdt) { - this.submitproblemdt = submitproblemdt; - } - - public String getMaintenancemethod() { - return maintenancemethod; - } - - public void setMaintenancemethod(String maintenancemethod) { - this.maintenancemethod = maintenancemethod; - } - - public String getMaintenancedt() { - return maintenancedt; - } - - public void setMaintenancedt(String maintenancedt) { - this.maintenancedt = maintenancedt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getCancelreason() { - return cancelreason; - } - - public void setCancelreason(String cancelreason) { - this.cancelreason = cancelreason; - } - - public String getMaintainertypeid() { - return maintainertypeid; - } - - public void setMaintainertypeid(String maintainertypeid) { - this.maintainertypeid = maintainertypeid; - } - - public String getMaintainerid() { - return maintainerid; - } - - public void setMaintainerid(String maintainerid) { - this.maintainerid = maintainerid; - } - - public String getManagerid() { - return managerid; - } - - public void setManagerid(String managerid) { - this.managerid = managerid; - } - - public String getMaintainerconfirmdt() { - return maintainerconfirmdt; - } - - public void setMaintainerconfirmdt(String maintainerconfirmdt) { - this.maintainerconfirmdt = maintainerconfirmdt; - } - - public String getContractno() { - return contractno; - } - - public void setContractno(String contractno) { - this.contractno = contractno; - } - - public String getMaintainerfinishidt() { - return maintainerfinishidt; - } - - public void setMaintainerfinishidt(String maintainerfinishidt) { - this.maintainerfinishidt = maintainerfinishidt; - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result; - } - - public String getEnddt() { - return enddt; - } - - public void setEnddt(String enddt) { - this.enddt = enddt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getJudgemaintainer() { - return judgemaintainer; - } - - public void setJudgemaintainer(Integer judgemaintainer) { - this.judgemaintainer = judgemaintainer; - } - - public Integer getJudgemaintainerstaff() { - return judgemaintainerstaff; - } - - public void setJudgemaintainerstaff(Integer judgemaintainerstaff) { - this.judgemaintainerstaff = judgemaintainerstaff; - } - - public Integer getJudgeresult() { - return judgeresult; - } - - public void setJudgeresult(Integer judgeresult) { - this.judgeresult = judgeresult; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintenanceCommString.java b/src/com/sipai/entity/maintenance/MaintenanceCommString.java deleted file mode 100644 index 03b0c7cb..00000000 --- a/src/com/sipai/entity/maintenance/MaintenanceCommString.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.entity.maintenance; - -public class MaintenanceCommString { - - //保养,检修,维修记录单的类型 - public static final String MAINTENANCE_TYPE_OVERHAUL = "0";//表示检修 - public static final String MAINTENANCE_TYPE_MAINTAIN = "1";//表示维护保养 - public static final String MAINTENANCE_TYPE_REPAIR = "2";//表示维修 - public static final String MAINTENANCE_TYPE_DEFECT = "3";//表示缺陷 - //保养计划的类型 - public static final String MAINTAIN_YEAR = "0";//年保养计划 - public static final String MAINTAIN_MONTH = "1";//月保养计划 - public static final String MAINTAIN_HALFYEAR = "2";//半年保养计划 - - //保养、检修方式 - public static final String INTER_MAINTENANCE = "0";//内部人员保养或检修或维修 - public static final String EXTERANL_MAINTENANCE = "1";//外部人员保养或检修或维修 - public static final String COMMON_MAINTENANCE = "2";//内部外部人员配合保养或检修或维修 - - //保养计划审核状态 - public static final String PLAN_START = "0";//未提交审核 - public static final String PLAN_SUBMIT = "1";//已提交审核 - public static final String PLAN_FINISH = "2";//审核通过 - - //保养人员权限 - //public final static String RoleSerial_Maintain ="MaintainGroup"; - - - public final static int Response_StartProcess_NoProcessDef =2;//未定义流程 - public final static int Response_StartProcess_NoUser =3;//无任务接收用户 - public final static int Response_StartProcess_PlanIssued =4;//计划已下发 - - //APP所需异常、缺陷执行中、缺陷已完成三者分类标识 - //public static final String APP_Abnormity = "1";//异常 - //public static final String APP_Maintenance_Start = "2";//缺陷执行中 - //public static final String APP_Maintenance_Finish = "3";//缺陷已完成 - - public static final String Maintenance_Type_In = "in";//自修 - public static final String Maintenance_Type_Out = "out";//委外 -} diff --git a/src/com/sipai/entity/maintenance/MaintenanceDetail.java b/src/com/sipai/entity/maintenance/MaintenanceDetail.java deleted file mode 100644 index 77db2fcc..00000000 --- a/src/com/sipai/entity/maintenance/MaintenanceDetail.java +++ /dev/null @@ -1,673 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.math.BigDecimal; -import java.util.Date; - -import net.sf.json.JSONArray; - -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; - -public class MaintenanceDetail extends BusinessUnitAdapter{ - public final static String Status_Start="0";//开始 - public final static String Status_Finish="1";//完成 - public final static String Status_Wait="2";//待处理,异常中的状态 - private Maintenance maintenance; - private Company company; - private ProcessSection processSection; - private EquipmentCard equipmentCard; - private User insertUser; - private JSONArray todoTask; - - private MaintenancePlan maintenancePlan; - - private String id; - - private String insdt; - - private BigDecimal totalMoney; - - private String insuser; - - private String detailNumber; - - private String problemcontent; - - private String companyid; - - private String equipmentId; - - private String contactids; - - private String plannedenddt;//计划完成日期 - - private String submittime;//提交时间 - - private String solvetime;//解决时间 - - private String maintenanceid; - - private String maintainplanid; - - private String maintenanceMan; - - private String problemtypeid; - - private String status; - - private BigDecimal planMoney; - - private BigDecimal actualMoney; - - private String defectLevel; - - private String startDate; - - private String actualFinishDate; - - private String processSectionId; - - private String maintenanceWay; - - private Integer planConsumeTime; - - private String delayReason; - - private String changeParts; - - private String solver; - - private String assistantedid; - - private String problemresult; - - private String processdefid; - - private String processid; - - private String maintainerid; - - private String type; - - private Integer judgemaintainerstaff; - - private Integer judgeresult; - - private String problemTypeNames;//故障类型名称,多个故障类型 - - private String equipmentNames;//故障设备名称,维修中可以有多个设备 - - private String equipmentCardIds;//设备编号 - - private String equipmentOpinion; - - private String baseOpinion; - - private String productOpinion; - - private String middleOpinion; - - private String qualityOpinion; - - private String materialOpinion; - - private String manualInputEquipment;//手动输入的设备 - - private String planType;//保养计划类型; - - private String library_id;//故障库id - - private float workinghours;//工时 - - private String plan_id;//故障库id - - private String abnormityId; //异常上报id - - //用于查询 - private String _num;//仅用于统计查询中as sj 2020-04-27 - private String _date; - - private String _repaircount;//故障次数 - private String _classname;//设备类型名称 - private String _eqcardname;//设备名称 - private String _eqcardid;//设备编号 - private String _equipmentId;//设备id - - private String _solverName;//处理人 - - public String get_num() { - return _num; - } - - public void set_num(String _num) { - this._num = _num; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public JSONArray getTodoTask() { - return todoTask; - } - - public void setTodoTask(JSONArray todoTask) { - this.todoTask = todoTask; - } - - public String get_solverName() { - return _solverName; - } - - public void set_solverName(String _solverName) { - this._solverName = _solverName; - } - - public float getWorkinghours() { - return workinghours; - } - - public void setWorkinghours(float workinghours) { - this.workinghours = workinghours; - } - - public String get_equipmentId() { - return _equipmentId; - } - - public void set_equipmentId(String _equipmentId) { - this._equipmentId = _equipmentId; - } - - public String get_eqcardname() { - return _eqcardname; - } - - public void set_eqcardname(String _eqcardname) { - this._eqcardname = _eqcardname; - } - - public String get_eqcardid() { - return _eqcardid; - } - - public void set_eqcardid(String _eqcardid) { - this._eqcardid = _eqcardid; - } - - public String get_repaircount() { - return _repaircount; - } - - public void set_repaircount(String _repaircount) { - this._repaircount = _repaircount; - } - - public String get_classname() { - return _classname; - } - - public void set_classname(String _classname) { - this._classname = _classname; - } - - public String getLibrary_id() { - return library_id; - } - - public void setLibrary_id(String library_id) { - this.library_id = library_id; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getDetailNumber() { - return detailNumber; - } - - public void setDetailNumber(String detailNumber) { - this.detailNumber = detailNumber; - } - - public String getProblemcontent() { - return problemcontent; - } - - public void setProblemcontent(String problemcontent) { - this.problemcontent = problemcontent; - } - - public String getCompanyid() { - return companyid; - } - - public void setCompanyid(String companyid) { - this.companyid = companyid; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getContactids() { - return contactids; - } - - public void setContactids(String contactids) { - this.contactids = contactids; - } - - public String getPlannedenddt() { - return plannedenddt; - } - - public void setPlannedenddt(String plannedenddt) { - this.plannedenddt = plannedenddt; - } - - public String getMaintenanceid() { - return maintenanceid; - } - - public void setMaintenanceid(String maintenanceid) { - this.maintenanceid = maintenanceid; - } - - public String getMaintainplanid() { - return maintainplanid; - } - - public void setMaintainplanid(String maintainplanid) { - this.maintainplanid = maintainplanid; - } - - public String getMaintenanceMan() { - return maintenanceMan; - } - - public void setMaintenanceMan(String maintenanceMan) { - this.maintenanceMan = maintenanceMan; - } - - public String getProblemtypeid() { - return problemtypeid; - } - - public void setProblemtypeid(String problemtypeid) { - this.problemtypeid = problemtypeid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public BigDecimal getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(BigDecimal planMoney) { - this.planMoney = planMoney; - } - - public BigDecimal getActualMoney() { - return actualMoney; - } - - public void setActualMoney(BigDecimal actualMoney) { - this.actualMoney = actualMoney; - } - - public String getSubmittime() { - return submittime; - } - - public void setSubmittime(String submittime) { - this.submittime = submittime; - } - - public String getDefectLevel() { - return defectLevel; - } - - public void setDefectLevel(String defectLevel) { - this.defectLevel = defectLevel; - } - - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getActualFinishDate() { - return actualFinishDate; - } - - public void setActualFinishDate(String actualFinishDate) { - this.actualFinishDate = actualFinishDate; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getMaintenanceWay() { - return maintenanceWay; - } - - public void setMaintenanceWay(String maintenanceWay) { - this.maintenanceWay = maintenanceWay; - } - - public Integer getPlanConsumeTime() { - return planConsumeTime; - } - - public void setPlanConsumeTime(Integer planConsumeTime) { - this.planConsumeTime = planConsumeTime; - } - - public String getDelayReason() { - return delayReason; - } - - public void setDelayReason(String delayReason) { - this.delayReason = delayReason; - } - - public String getChangeParts() { - return changeParts; - } - - public void setChangeParts(String changeParts) { - this.changeParts = changeParts; - } - - public String getSolvetime() { - return solvetime; - } - - public void setSolvetime(String solvetime) { - this.solvetime = solvetime; - } - - public String getSolver() { - return solver; - } - - public void setSolver(String solver) { - this.solver = solver; - } - - public String getAssistantedid() { - return assistantedid; - } - - public void setAssistantedid(String assistantedid) { - this.assistantedid = assistantedid; - } - - public String getProblemresult() { - return problemresult; - } - - public void setProblemresult(String problemresult) { - this.problemresult = problemresult; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getMaintainerid() { - return maintainerid; - } - - public void setMaintainerid(String maintainerid) { - this.maintainerid = maintainerid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getJudgemaintainerstaff() { - return judgemaintainerstaff; - } - - public void setJudgemaintainerstaff(Integer judgemaintainerstaff) { - this.judgemaintainerstaff = judgemaintainerstaff; - } - - public Integer getJudgeresult() { - return judgeresult; - } - - public void setJudgeresult(Integer judgeresult) { - this.judgeresult = judgeresult; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - - public Maintenance getMaintenance() { - return maintenance; - } - - public void setMaintenance(Maintenance maintenance) { - this.maintenance = maintenance; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public User getInsertUser() { - return insertUser; - } - - public void setInsertUser(User insertUser) { - this.insertUser = insertUser; - } - - public String getProblemTypeNames() { - return problemTypeNames; - } - - public void setProblemTypeNames(String problemTypeNames) { - this.problemTypeNames = problemTypeNames; - } - - public String getEquipmentNames() { - return equipmentNames; - } - - public void setEquipmentNames(String equipmentNames) { - this.equipmentNames = equipmentNames; - } - - public String getEquipmentCardIds() { - return equipmentCardIds; - } - - public void setEquipmentCardIds(String equipmentCardIds) { - this.equipmentCardIds = equipmentCardIds; - } - - public String getEquipmentOpinion() { - return equipmentOpinion; - } - - public void setEquipmentOpinion(String equipmentOpinion) { - this.equipmentOpinion = equipmentOpinion; - } - - public String getBaseOpinion() { - return baseOpinion; - } - - public void setBaseOpinion(String baseOpinion) { - this.baseOpinion = baseOpinion; - } - - public String getProductOpinion() { - return productOpinion; - } - - public void setProductOpinion(String productOpinion) { - this.productOpinion = productOpinion; - } - - public String getMiddleOpinion() { - return middleOpinion; - } - - public void setMiddleOpinion(String middleOpinion) { - this.middleOpinion = middleOpinion; - } - - public String getQualityOpinion() { - return qualityOpinion; - } - - public void setQualityOpinion(String qualityOpinion) { - this.qualityOpinion = qualityOpinion; - } - - public String getMaterialOpinion() { - return materialOpinion; - } - - public void setMaterialOpinion(String materialOpinion) { - this.materialOpinion = materialOpinion; - } - - public String getManualInputEquipment() { - return manualInputEquipment; - } - - public void setManualInputEquipment(String manualInputEquipment) { - this.manualInputEquipment = manualInputEquipment; - } - - public String getPlanType() { - return planType; - } - - public void setPlanType(String planType) { - this.planType = planType; - } - - public String getPlan_id() { - return plan_id; - } - - public void setPlan_id(String plan_id) { - this.plan_id = plan_id; - } - - public MaintenancePlan getMaintenancePlan() { - return maintenancePlan; - } - - public void setMaintenancePlan(MaintenancePlan maintenancePlan) { - this.maintenancePlan = maintenancePlan; - } - - public String getAbnormityId() { - return abnormityId; - } - - public void setAbnormityId(String abnormityId) { - this.abnormityId = abnormityId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintenanceEquipment.java b/src/com/sipai/entity/maintenance/MaintenanceEquipment.java deleted file mode 100644 index f6d7ddcf..00000000 --- a/src/com/sipai/entity/maintenance/MaintenanceEquipment.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MaintenanceEquipment extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String maintenanceid; - - private String equipmentid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMaintenanceid() { - return maintenanceid; - } - - public void setMaintenanceid(String maintenanceid) { - this.maintenanceid = maintenanceid; - } - - public String getEquipmentid() { - return equipmentid; - } - - public void setEquipmentid(String equipmentid) { - this.equipmentid = equipmentid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintenanceEquipmentConfig.java b/src/com/sipai/entity/maintenance/MaintenanceEquipmentConfig.java deleted file mode 100644 index d039a44a..00000000 --- a/src/com/sipai/entity/maintenance/MaintenanceEquipmentConfig.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 简易版的保养配置 (在设备台账中配置这台设备的起始月份及保养周期,然后定时自动生成保养月度计划) sj 2024-03-20 - */ -public class MaintenanceEquipmentConfig extends SQLAdapter { - private String id; - - private String contents;//保养内容 - - private Integer cycle;//周期 - - private String remark; - - private String equipmentId; - - private String lastTime;//上次保养日期 - - private String title;//保养名称/标题 - private String mainType;//类型 - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getMainType() { - return mainType; - } - - public void setMainType(String mainType) { - this.mainType = mainType; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents == null ? null : contents.trim(); - } - - public Integer getCycle() { - return cycle; - } - - public void setCycle(Integer cycle) { - this.cycle = cycle; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId == null ? null : equipmentId.trim(); - } - - public String getLastTime() { - return lastTime; - } - - public void setLastTime(String lastTime) { - this.lastTime = lastTime; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintenanceFile.java b/src/com/sipai/entity/maintenance/MaintenanceFile.java deleted file mode 100644 index 46f94e8c..00000000 --- a/src/com/sipai/entity/maintenance/MaintenanceFile.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MaintenanceFile extends SQLAdapter{ - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private String insdt; - - private String insuser; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/MaintenanceRecord.java b/src/com/sipai/entity/maintenance/MaintenanceRecord.java deleted file mode 100644 index ae93e44d..00000000 --- a/src/com/sipai/entity/maintenance/MaintenanceRecord.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; - -public class MaintenanceRecord extends SQLAdapter{ - private String id; - - private String maintenanceid; - - private String unitid; - - private String insuser; - - private String insdt; - - private String record; - - private Unit unit; - - private User user; - - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMaintenanceid() { - return maintenanceid; - } - - public void setMaintenanceid(String maintenanceid) { - this.maintenanceid = maintenanceid; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRecord() { - return record; - } - - public void setRecord(String record) { - this.record = record; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/PlanRecordAbnormity.java b/src/com/sipai/entity/maintenance/PlanRecordAbnormity.java deleted file mode 100644 index b3d95a5c..00000000 --- a/src/com/sipai/entity/maintenance/PlanRecordAbnormity.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PlanRecordAbnormity extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String fatherId; - - private String sonId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getFatherId() { - return fatherId; - } - - public void setFatherId(String fatherId) { - this.fatherId = fatherId; - } - - public String getSonId() { - return sonId; - } - - public void setSonId(String sonId) { - this.sonId = sonId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/Repair.java b/src/com/sipai/entity/maintenance/Repair.java deleted file mode 100644 index 19317aa0..00000000 --- a/src/com/sipai/entity/maintenance/Repair.java +++ /dev/null @@ -1,279 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.User; - -public class Repair extends BusinessUnitAdapter{ - //计划类型 - public static final String PlanType_IN = "in";//计划内 - public static final String PlanType_OUT = "out";//计划外 - - public final static String Status_Start="start";//开始 - public final static String Status_Handle="repair_handle";//维修执行 - public final static String Status_ProductionAudit="repair_productionAudit";//生产部审核 - public final static String Status_EqAudit="repair_eqAudit";//设备部审核 - public final static String Status_Finish="finish";//完成 - - private String id; - - private String jobNumber;//工单编号 - - private String jobName;//工单名称 - - private String planType;//计划类型 计划外/计划内 - - private String repairType;//维修类型 小修/大修 - - private String receiveUserId;//接收人 - - private String receiveUserIds;//下发时接收人们 - - private String equipmentId;//设备id - - private String completeDate;//完成时间 - - private String planDate;//计划完成时间 - - private String outsourcingSt;//委外状态 - - private String safeoperationSt;//安全作业状态 - - private String faultDescribe;//故障现象描述 - - private String schemeDescription;//维修方案及要求简述 - - private String planId;//计划id - - private String planMoney;//计划费用 - - private String processStatus;//流程是否被启用 - - private String processdefid; - - private String processid; - - private String insdt; - - private String insuser; - - private String unitId; - - private String receiveUserName; - - private String receiveUsersName; - - private EquipmentCard equipmentCard; - - private String repairTypeName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getJobName() { - return jobName; - } - - public void setJobName(String jobName) { - this.jobName = jobName; - } - - public String getPlanType() { - return planType; - } - - public void setPlanType(String planType) { - this.planType = planType; - } - - public String getRepairType() { - return repairType; - } - - public void setRepairType(String repairType) { - this.repairType = repairType; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getOutsourcingSt() { - return outsourcingSt; - } - - public void setOutsourcingSt(String outsourcingSt) { - this.outsourcingSt = outsourcingSt; - } - - public String getSafeoperationSt() { - return safeoperationSt; - } - - public void setSafeoperationSt(String safeoperationSt) { - this.safeoperationSt = safeoperationSt; - } - - public String getFaultDescribe() { - return faultDescribe; - } - - public void setFaultDescribe(String faultDescribe) { - this.faultDescribe = faultDescribe; - } - - public String getSchemeDescription() { - return schemeDescription; - } - - public void setSchemeDescription(String schemeDescription) { - this.schemeDescription = schemeDescription; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getCompleteDate() { - return completeDate; - } - - public void setCompleteDate(String completeDate) { - this.completeDate = completeDate; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getPlanMoney() { - return planMoney; - } - - public void setPlanMoney(String planMoney) { - this.planMoney = planMoney; - } - - public String getReceiveUserName() { - return receiveUserName; - } - - public void setReceiveUserName(String receiveUserName) { - this.receiveUserName = receiveUserName; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getRepairTypeName() { - return repairTypeName; - } - - public void setRepairTypeName(String repairTypeName) { - this.repairTypeName = repairTypeName; - } - - public String getReceiveUsersName() { - return receiveUsersName; - } - - public void setReceiveUsersName(String receiveUsersName) { - this.receiveUsersName = receiveUsersName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/RepairCar.java b/src/com/sipai/entity/maintenance/RepairCar.java deleted file mode 100644 index 4079b018..00000000 --- a/src/com/sipai/entity/maintenance/RepairCar.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.sipai.entity.maintenance; - -import java.math.BigDecimal; - -import com.sipai.entity.base.BusinessUnitAdapter; - -public class RepairCar extends BusinessUnitAdapter { - private String id; - - private String detailNumber; - - private String repairType; - - private String maintainWorkUnitName; - - private String solver; - - private String carNumber; - - private String maintainCarId; - - private BigDecimal insuranceCompensationMoney; - - private String repairReason; - - private String insuranceCompensationSituation; - - private BigDecimal actualRepairMoney; - - private String exceedCompensationReason; - - private Double workingHours; - - private Double actualWorkingHours; - - private String memo; - - private String qualityOpinion; - - private Double calWorkingHours; - - private Double finalWorkingHours; - - private BigDecimal punishAwardMoney; - - private String unitId; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private String status; - - private String processdefid; - - private String processid; - - private LibraryMaintainCar libraryMaintainCar; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDetailNumber() { - return detailNumber; - } - - public void setDetailNumber(String detailNumber) { - this.detailNumber = detailNumber; - } - - public String getRepairType() { - return repairType; - } - - public void setRepairType(String repairType) { - this.repairType = repairType; - } - - public String getMaintainWorkUnitName() { - return maintainWorkUnitName; - } - - public void setMaintainWorkUnitName(String maintainWorkUnitName) { - this.maintainWorkUnitName = maintainWorkUnitName; - } - - public String getSolver() { - return solver; - } - - public void setSolver(String solver) { - this.solver = solver; - } - - public String getCarNumber() { - return carNumber; - } - - public void setCarNumber(String carNumber) { - this.carNumber = carNumber; - } - - public String getMaintainCarId() { - return maintainCarId; - } - - public void setMaintainCarId(String maintainCarId) { - this.maintainCarId = maintainCarId; - } - - public BigDecimal getInsuranceCompensationMoney() { - return insuranceCompensationMoney; - } - - public void setInsuranceCompensationMoney(BigDecimal insuranceCompensationMoney) { - this.insuranceCompensationMoney = insuranceCompensationMoney; - } - - public String getRepairReason() { - return repairReason; - } - - public void setRepairReason(String repairReason) { - this.repairReason = repairReason; - } - - public String getInsuranceCompensationSituation() { - return insuranceCompensationSituation; - } - - public void setInsuranceCompensationSituation(String insuranceCompensationSituation) { - this.insuranceCompensationSituation = insuranceCompensationSituation; - } - - public BigDecimal getActualRepairMoney() { - return actualRepairMoney; - } - - public void setActualRepairMoney(BigDecimal actualRepairMoney) { - this.actualRepairMoney = actualRepairMoney; - } - - public String getExceedCompensationReason() { - return exceedCompensationReason; - } - - public void setExceedCompensationReason(String exceedCompensationReason) { - this.exceedCompensationReason = exceedCompensationReason; - } - - public Double getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(Double workingHours) { - this.workingHours = workingHours; - } - - public Double getActualWorkingHours() { - return actualWorkingHours; - } - - public void setActualWorkingHours(Double actualWorkingHours) { - this.actualWorkingHours = actualWorkingHours; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getQualityOpinion() { - return qualityOpinion; - } - - public void setQualityOpinion(String qualityOpinion) { - this.qualityOpinion = qualityOpinion; - } - - public Double getCalWorkingHours() { - return calWorkingHours; - } - - public void setCalWorkingHours(Double calWorkingHours) { - this.calWorkingHours = calWorkingHours; - } - - public Double getFinalWorkingHours() { - return finalWorkingHours; - } - - public void setFinalWorkingHours(Double finalWorkingHours) { - this.finalWorkingHours = finalWorkingHours; - } - - public BigDecimal getPunishAwardMoney() { - return punishAwardMoney; - } - - public void setPunishAwardMoney(BigDecimal punishAwardMoney) { - this.punishAwardMoney = punishAwardMoney; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public LibraryMaintainCar getLibraryMaintainCar() { - return libraryMaintainCar; - } - - public void setLibraryMaintainCar(LibraryMaintainCar libraryMaintainCar) { - this.libraryMaintainCar = libraryMaintainCar; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/maintenance/StaffMaintenanceResult.java b/src/com/sipai/entity/maintenance/StaffMaintenanceResult.java deleted file mode 100644 index c81d09b7..00000000 --- a/src/com/sipai/entity/maintenance/StaffMaintenanceResult.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserDetail; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.tools.SpringContextUtil; - -public class StaffMaintenanceResult { - - private String userId; - private User user; - private long totalNum; - private long maintenanceNum;//发单数目 - private long taskNum;//任务数目 - private long supplementNum;//补录数目 - private long maintainNum;//保养数目 - private float judgeStaff;//员工评价 - public String getUserId() { - return userId; - } - public void setUserId(String userId) { - this.userId = userId; - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User user =userService.getUserById(userId); - UserDetailService userDetailService = (UserDetailService) SpringContextUtil.getBean("userDetailService"); - UserDetail userDetail=userDetailService.selectByUserId(userId); - user.setUserDetail(userDetail); - this.setUser(user); - } - public User getUser() { - return user; - } - public void setUser(User user) { - this.user = user; - } - public long getTotalNum() { - return totalNum; - } - public void setTotalNum(long totalNum) { - this.totalNum = totalNum; - } - public long getMaintenanceNum() { - return maintenanceNum; - } - public void setMaintenanceNum(long maintenanceNum) { - this.maintenanceNum = maintenanceNum; - } - public long getTaskNum() { - return taskNum; - } - public void setTaskNum(long taskNum) { - this.taskNum = taskNum; - } - public long getSupplementNum() { - return supplementNum; - } - public void setSupplementNum(long supplementNum) { - this.supplementNum = supplementNum; - } - public long getMaintainNum() { - return maintainNum; - } - public void setMaintainNum(long maintainNum) { - this.maintainNum = maintainNum; - } - public float getJudgeStaff() { - return judgeStaff; - } - public void setJudgeStaff(float judgeStaff) { - this.judgeStaff = judgeStaff; - } - - -} diff --git a/src/com/sipai/entity/maintenance/WorkorderLibraryMaintain.java b/src/com/sipai/entity/maintenance/WorkorderLibraryMaintain.java deleted file mode 100644 index 1d023948..00000000 --- a/src/com/sipai/entity/maintenance/WorkorderLibraryMaintain.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.sipai.entity.maintenance; - -import com.sipai.entity.base.SQLAdapter; -/** - * 维保工单内容 附表 - * @author SJ - * - */ -public class WorkorderLibraryMaintain extends SQLAdapter{ - - private String id; - - private String libraryId; - - private float actualWorkTime; - - private String differences; - - private String type; - - private String pid; - - private LibraryMaintenanceCommon libraryMaintenanceCommon;//保养库---通用、仪表 - private LibraryMaintenanceLubrication libraryMaintenanceLubrication;//保养库---润滑 - private LibraryRepairBloc libraryRepairBloc;//维修库 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLibraryId() { - return libraryId; - } - - public void setLibraryId(String libraryId) { - this.libraryId = libraryId; - } - - public float getActualWorkTime() { - return actualWorkTime; - } - - public void setActualWorkTime(float actualWorkTime) { - this.actualWorkTime = actualWorkTime; - } - - public String getDifferences() { - return differences; - } - - public void setDifferences(String differences) { - this.differences = differences; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public LibraryMaintenanceCommon getLibraryMaintenanceCommon() { - return libraryMaintenanceCommon; - } - - public void setLibraryMaintenanceCommon( - LibraryMaintenanceCommon libraryMaintenanceCommon) { - this.libraryMaintenanceCommon = libraryMaintenanceCommon; - } - - public LibraryMaintenanceLubrication getLibraryMaintenanceLubrication() { - return libraryMaintenanceLubrication; - } - - public void setLibraryMaintenanceLubrication( - LibraryMaintenanceLubrication libraryMaintenanceLubrication) { - this.libraryMaintenanceLubrication = libraryMaintenanceLubrication; - } - - public LibraryRepairBloc getLibraryRepairBloc() { - return libraryRepairBloc; - } - - public void setLibraryRepairBloc(LibraryRepairBloc libraryRepairBloc) { - this.libraryRepairBloc = libraryRepairBloc; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/model/ModelSetValue.java b/src/com/sipai/entity/model/ModelSetValue.java deleted file mode 100644 index dcd41636..00000000 --- a/src/com/sipai/entity/model/ModelSetValue.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.entity.model; - -import com.sipai.entity.base.BusinessUnitAdapter; - -/** - * 模型数据表映射查询 (如潮汐表和压力表) - */ -public class ModelSetValue extends BusinessUnitAdapter { - private String id; - - private String dt; - - private Double maxVal; - - private Double minVal; - - private Double controlVal; - - private Double val; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getDt() { - return dt; - } - - public void setDt(String dt) { - this.dt = dt; - } - - public Double getMaxVal() { - return maxVal; - } - - public void setMaxVal(Double maxVal) { - this.maxVal = maxVal; - } - - public Double getMinVal() { - return minVal; - } - - public void setMinVal(Double minVal) { - this.minVal = minVal; - } - - public Double getControlVal() { - return controlVal; - } - - public void setControlVal(Double controlVal) { - this.controlVal = controlVal; - } - - public Double getVal() { - return val; - } - - public void setVal(Double val) { - this.val = val; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/EmppAdmin.java b/src/com/sipai/entity/msg/EmppAdmin.java deleted file mode 100644 index 4bceb361..00000000 --- a/src/com/sipai/entity/msg/EmppAdmin.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EmppAdmin extends SQLAdapter{ - private String id; - - private String emppname; - - private String host; - - private Integer port; - - private String accountid; - - private String accname; - - private String password; - - private String serviceid; - - private String insertuserid; - - private Date insertdate; - - private String updateuserid; - - private Date updatedate; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEmppname() { - return emppname; - } - - public void setEmppname(String emppname) { - this.emppname = emppname; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public Integer getPort() { - return port; - } - - public void setPort(Integer port) { - this.port = port; - } - - public String getAccountid() { - return accountid; - } - - public void setAccountid(String accountid) { - this.accountid = accountid; - } - - public String getAccname() { - return accname; - } - - public void setAccname(String accname) { - this.accname = accname; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getServiceid() { - return serviceid; - } - - public void setServiceid(String serviceid) { - this.serviceid = serviceid; - } - - public String getInsertuserid() { - return insertuserid; - } - - public void setInsertuserid(String insertuserid) { - this.insertuserid = insertuserid; - } - - public Date getInsertdate() { - return insertdate; - } - - public void setInsertdate(Date insertdate) { - this.insertdate = insertdate; - } - - public String getUpdateuserid() { - return updateuserid; - } - - public void setUpdateuserid(String updateuserid) { - this.updateuserid = updateuserid; - } - - public Date getUpdatedate() { - return updatedate; - } - - public void setUpdatedate(Date updatedate) { - this.updatedate = updatedate; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/EmppSend.java b/src/com/sipai/entity/msg/EmppSend.java deleted file mode 100644 index 3e8cf16f..00000000 --- a/src/com/sipai/entity/msg/EmppSend.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EmppSend extends SQLAdapter{ - private String id; - - private String emppadminid; - - private String senduserid; - - private Date senddate; - - private String insertuserid; - - private Date insertdate; - - private String updateuserid; - - private Date updatedate; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEmppadminid() { - return emppadminid; - } - - public void setEmppadminid(String emppadminid) { - this.emppadminid = emppadminid; - } - - public String getSenduserid() { - return senduserid; - } - - public void setSenduserid(String senduserid) { - this.senduserid = senduserid; - } - - public Date getSenddate() { - return senddate; - } - - public void setSenddate(Date senddate) { - this.senddate = senddate; - } - - public String getInsertuserid() { - return insertuserid; - } - - public void setInsertuserid(String insertuserid) { - this.insertuserid = insertuserid; - } - - public Date getInsertdate() { - return insertdate; - } - - public void setInsertdate(Date insertdate) { - this.insertdate = insertdate; - } - - public String getUpdateuserid() { - return updateuserid; - } - - public void setUpdateuserid(String updateuserid) { - this.updateuserid = updateuserid; - } - - public Date getUpdatedate() { - return updatedate; - } - - public void setUpdatedate(Date updatedate) { - this.updatedate = updatedate; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/EmppSendUser.java b/src/com/sipai/entity/msg/EmppSendUser.java deleted file mode 100644 index b8642b5f..00000000 --- a/src/com/sipai/entity/msg/EmppSendUser.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EmppSendUser extends SQLAdapter{ - private String id; - - private String emppsendid; - - private String senduserid; - - private Date senddate; - - private String recuserid; - - private String mobile; - - private Date backdate; - - private String insertuserid; - - private Date insertdate; - - private String updateuserid; - - private Date updatedate; - - private String msgid; - - - private String recusername; - - private String sendtitle; - - - public String getRecusername() { - return recusername; - } - - public void setRecusername(String recusername) { - this.recusername = recusername; - } - - public String getSendtitle() { - return sendtitle; - } - - public void setSendtitle(String sendtitle) { - this.sendtitle = sendtitle; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getEmppsendid() { - return emppsendid; - } - - public void setEmppsendid(String emppsendid) { - this.emppsendid = emppsendid; - } - - public String getSenduserid() { - return senduserid; - } - - public void setSenduserid(String senduserid) { - this.senduserid = senduserid; - } - - public Date getSenddate() { - return senddate; - } - - public void setSenddate(Date senddate) { - this.senddate = senddate; - } - - public String getRecuserid() { - return recuserid; - } - - public void setRecuserid(String recuserid) { - this.recuserid = recuserid; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public Date getBackdate() { - return backdate; - } - - public void setBackdate(Date backdate) { - this.backdate = backdate; - } - - public String getInsertuserid() { - return insertuserid; - } - - public void setInsertuserid(String insertuserid) { - this.insertuserid = insertuserid; - } - - public Date getInsertdate() { - return insertdate; - } - - public void setInsertdate(Date insertdate) { - this.insertdate = insertdate; - } - - public String getUpdateuserid() { - return updateuserid; - } - - public void setUpdateuserid(String updateuserid) { - this.updateuserid = updateuserid; - } - - public Date getUpdatedate() { - return updatedate; - } - - public void setUpdatedate(Date updatedate) { - this.updatedate = updatedate; - } - - public String getMsgid() { - return msgid; - } - - public void setMsgid(String msgid) { - this.msgid = msgid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/FrequentContacts.java b/src/com/sipai/entity/msg/FrequentContacts.java deleted file mode 100644 index 1a827b31..00000000 --- a/src/com/sipai/entity/msg/FrequentContacts.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.msg; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 常用联系人 (用于短信发送模块) - */ -public class FrequentContacts extends SQLAdapter { - private String id; - - private String userId; - - private String unitId; - - private String userName;//人名 - private String mobile;//手机号 - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId == null ? null : userId.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/Msg.java b/src/com/sipai/entity/msg/Msg.java deleted file mode 100644 index b4f2ffa1..00000000 --- a/src/com/sipai/entity/msg/Msg.java +++ /dev/null @@ -1,270 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class Msg extends SQLAdapter { - public static String ReadFlag = "1"; //已读 - - public static String UnReadFlag = "0";//未读 - - private String id; - - private String pid; - - private String suserid; - - private String sdt; - - private String url; - - private String readflag; - - private String content; - - private String backid; - - private String typeid; - - private String plansdt; - - private String plansdate; - - private String sendflag; - - private String delflag; - - private String alerturl; - - private String insuser; - - private String insdt; - - private String bizid; - - private String redflag; - - private String sendview; - - private String issms; - private User susername;//发送人,一对一 - private MsgType typename;//一对一 - private List mrecv;//接收人,一对多 - private Integer newsNum; - - private String recvUserName;//显示短信接收人(多人) - private String recvUserMobile;//显示短信接收号码(多人) - - public String getRecvUserName() { - return recvUserName; - } - - public void setRecvUserName(String recvUserName) { - this.recvUserName = recvUserName; - } - - public String getRecvUserMobile() { - return recvUserMobile; - } - - public void setRecvUserMobile(String recvUserMobile) { - this.recvUserMobile = recvUserMobile; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getSuserid() { - return suserid; - } - - public void setSuserid(String suserid) { - this.suserid = suserid; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getReadflag() { - return readflag; - } - - public void setReadflag(String readflag) { - this.readflag = readflag; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getBackid() { - return backid; - } - - public void setBackid(String backid) { - this.backid = backid; - } - - public String getTypeid() { - return typeid; - } - - public void setTypeid(String typeid) { - this.typeid = typeid; - } - - public String getPlansdt() { - return plansdt; - } - - public void setPlansdt(String plansdt) { - this.plansdt = plansdt; - } - - public String getPlansdate() { - return plansdate; - } - - public void setPlansdate(String plansdate) { - this.plansdate = plansdate; - } - - public String getSendflag() { - return sendflag; - } - - public void setSendflag(String sendflag) { - this.sendflag = sendflag; - } - - public String getDelflag() { - return delflag; - } - - public void setDelflag(String delflag) { - this.delflag = delflag; - } - - public String getAlerturl() { - return alerturl; - } - - public void setAlerturl(String alerturl) { - this.alerturl = alerturl; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public User getSusername() { - return susername; - } - - public void setSusername(User susername) { - this.susername = susername; - } - - public MsgType getTypename() { - return typename; - } - - public void setTypename(MsgType typename) { - this.typename = typename; - } - - public List getMrecv() { - return mrecv; - } - - public void setMrecv(List mrecv) { - this.mrecv = mrecv; - } - - public String getIssms() { - return issms; - } - - public void setIssms(String issms) { - this.issms = issms; - } - - public String getRedflag() { - return redflag; - } - - public void setRedflag(String redflag) { - this.redflag = redflag; - } - - public String getSendview() { - return sendview; - } - - public void setSendview(String sendview) { - this.sendview = sendview; - } - - public Integer getNewsNum() { - return newsNum; - } - - public void setNewsNum(Integer newsNum) { - this.newsNum = newsNum; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/MsgAlarmlevel.java b/src/com/sipai/entity/msg/MsgAlarmlevel.java deleted file mode 100644 index ddda6300..00000000 --- a/src/com/sipai/entity/msg/MsgAlarmlevel.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class MsgAlarmlevel extends SQLAdapter{ - private String id; - - private String alarmLevel; - - private String msgsend; - - private String smssend; - - private String sendway; - - private String remark; - - private String state; - - private String insuser; - - private String insdt; - - private String msgrole; - - private List msgusers; - - private List smsusers; - - - public List getMsgusers() { - return msgusers; - } - - public void setMsgusers(List msgusers) { - this.msgusers = msgusers; - } - - public List getSmsusers() { - return smsusers; - } - - public void setSmsusers(List smsusers) { - this.smsusers = smsusers; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getAlarmLevel() { - return alarmLevel; - } - - public void setAlarmLevel(String alarmLevel) { - this.alarmLevel = alarmLevel; - } - - public String getMsgsend() { - return msgsend; - } - - public void setMsgsend(String msgsend) { - this.msgsend = msgsend; - } - - public String getSmssend() { - return smssend; - } - - public void setSmssend(String smssend) { - this.smssend = smssend; - } - - public String getSendway() { - return sendway; - } - - public void setSendway(String sendway) { - this.sendway = sendway; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMsgrole() { - return msgrole; - } - - public void setMsgrole(String msgrole) { - this.msgrole = msgrole; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/MsgRecv.java b/src/com/sipai/entity/msg/MsgRecv.java deleted file mode 100644 index f649549b..00000000 --- a/src/com/sipai/entity/msg/MsgRecv.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MsgRecv extends SQLAdapter{ - - private String id; - - private String masterid; - - private String unitid; - - private Date readtime; - - private String status; - - private String delflag; - - private String redflag; - - private String insuser; - - private Date insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public Date getReadtime() { - return readtime; - } - - public void setReadtime(Date readtime) { - this.readtime = readtime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getDelflag() { - return delflag; - } - - public void setDelflag(String delflag) { - this.delflag = delflag; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getRedflag() { - return redflag; - } - - public void setRedflag(String redflag) { - this.redflag = redflag; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/MsgRole.java b/src/com/sipai/entity/msg/MsgRole.java deleted file mode 100644 index 27698a87..00000000 --- a/src/com/sipai/entity/msg/MsgRole.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MsgRole extends SQLAdapter{ - private String id; - - private String masterid; - - private String roleid; - - private String insuser; - - private Date insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getRoleid() { - return roleid; - } - - public void setRoleid(String roleid) { - this.roleid = roleid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/MsgType.java b/src/com/sipai/entity/msg/MsgType.java deleted file mode 100644 index d3b3462e..00000000 --- a/src/com/sipai/entity/msg/MsgType.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class MsgType extends SQLAdapter{ - private String id; - - private String name; - - private String insuser; - - private Date insdt; - - private String pid; - - private String remark; - - private String status; - - private String sendway; - - private List _roleid; - private List _msguserid; - private List _smsuserid; - - private List role;//接收人,一对多 - private List msguser;//接收人,一对多 - private List smsuser;//接收人,一对多 - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public List getRole() { - return role; - } - - public void setRole(List role) { - this.role = role; - } - - public List getMsguser() { - return msguser; - } - - public void setMsguser(List msguser) { - this.msguser = msguser; - } - - public List getSmsuser() { - return smsuser; - } - - public void setSmsuser(List smsuser) { - this.smsuser = smsuser; - } - - public String getSendway() { - return sendway; - } - - public void setSendway(String sendway) { - this.sendway = sendway; - } - - public List get_roleid() { - return _roleid; - } - - public void set_roleid(List _roleid) { - this._roleid = _roleid; - } - - public List get_msguserid() { - return _msguserid; - } - - public void set_msguserid(List _msguserid) { - this._msguserid = _msguserid; - } - - public List get_smsuserid() { - return _smsuserid; - } - - public void set_smsuserid(List _smsuserid) { - this._smsuserid = _smsuserid; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/Msguser.java b/src/com/sipai/entity/msg/Msguser.java deleted file mode 100644 index 19b04a55..00000000 --- a/src/com/sipai/entity/msg/Msguser.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class Msguser extends SQLAdapter{ - private String id; - - private String masterid; - - private String userid; - - private String insuser; - - private Date insdt; - private User user; - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/msg/Sms.java b/src/com/sipai/entity/msg/Sms.java deleted file mode 100644 index b7cc265e..00000000 --- a/src/com/sipai/entity/msg/Sms.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.entity.msg; - -public class Sms { - private int state; - private String content; - private String date; - private String number; - private String flag; - private String userid; - - public Sms(int state, String content, String date, String flag,String number,String userid) { - super(); - this.state = state; - this.content = content; - this.date = date; - this.number = number; - this.flag=flag; - this.userid=userid; - } - -} diff --git a/src/com/sipai/entity/msg/Smsuser.java b/src/com/sipai/entity/msg/Smsuser.java deleted file mode 100644 index cc44f7b6..00000000 --- a/src/com/sipai/entity/msg/Smsuser.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.entity.msg; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class Smsuser extends SQLAdapter{ - private String id; - - private String masterid; - - private String userid; - - private String insuser; - - private Date insdt; - - private User user; - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataPatrol.java b/src/com/sipai/entity/process/DataPatrol.java deleted file mode 100644 index 41aad400..00000000 --- a/src/com/sipai/entity/process/DataPatrol.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataPatrol extends SQLAdapter { - - private String id; - - private String mpid; - - private String name; - - private String pid; - - private String unitId; - - private Integer morder; - - private Integer type; - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataPatrolResultData.java b/src/com/sipai/entity/process/DataPatrolResultData.java deleted file mode 100644 index ecbcb31e..00000000 --- a/src/com/sipai/entity/process/DataPatrolResultData.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -public class DataPatrolResultData extends SQLAdapter { - public final static String Result_0 = "0"; - public final static String Result_0_Color = "#00FF80"; - public final static String Result_1 = "1";//数据中断 - public final static String Result_1_Color = "#F7FF00"; - public final static String Result_2 = "2";//数据停滞 - public final static String Result_2_Color = "#00B9FF"; - public final static String Result_3 = "3";//上限 - public final static String Result_3_Color = "#FF0000"; - public final static String Result_4 = "4";//下限 - public final static String Result_4_Color = "#F700FF"; - public final static String Result_5 = "5";//异常趋势 - public final static String Result_5_Color = "#00FFFF"; - - private String id; - - private String result; - - private String unitId; - - private String mpcode; - - private BigDecimal parmvalue; - - private String sdt; - - private String edt; - - private String lastdatast; - - private int num; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result == null ? null : result.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode == null ? null : mpcode.trim(); - } - - public BigDecimal getParmvalue() { - return parmvalue; - } - - public void setParmvalue(BigDecimal parmvalue) { - this.parmvalue = parmvalue; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getLastdatast() { - return lastdatast; - } - - public void setLastdatast(String lastdatast) { - this.lastdatast = lastdatast == null ? null : lastdatast.trim(); - } - - public int getNum() { - return num; - } - - public void setNum(int num) { - this.num = num; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualBarChart.java b/src/com/sipai/entity/process/DataVisualBarChart.java deleted file mode 100644 index 854446e3..00000000 --- a/src/com/sipai/entity/process/DataVisualBarChart.java +++ /dev/null @@ -1,286 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualBarChart extends SQLAdapter { - - private String id; - - private String pid; - - private String type; - - private String colors; - - private String background; - - private String titleText; - - private String titleColor; - - private String titleFontSize; - - private String titleFontWeight; - - private String titlePosition; - - private String subtitleText; - - private String subtitleColor; - - private String subtitleFontSize; - - private String subtitleFontWeight; - - private String legendPosition; - - private String legendTextFontsize; - - private String xaxistype; - - private String xaxisdata; - - private String xaxislineshow; - - private String xaxislinecolor; - - private String xaxisaxistickshow; - - private String xaxissplitlineshow; - - private String xaxisaxislabelshow; - - private String xaxisaxislabelcolor; - - private String xaxisaxislabelfontsize; - - private String datazoomst; - - private String xsubstring; - - private String direction; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getColors() { - return colors; - } - - public void setColors(String colors) { - this.colors = colors == null ? null : colors.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getTitleText() { - return titleText; - } - - public void setTitleText(String titleText) { - this.titleText = titleText == null ? null : titleText.trim(); - } - - public String getTitleColor() { - return titleColor; - } - - public void setTitleColor(String titleColor) { - this.titleColor = titleColor == null ? null : titleColor.trim(); - } - - public String getTitleFontSize() { - return titleFontSize; - } - - public void setTitleFontSize(String titleFontSize) { - this.titleFontSize = titleFontSize == null ? null : titleFontSize.trim(); - } - - public String getTitleFontWeight() { - return titleFontWeight; - } - - public void setTitleFontWeight(String titleFontWeight) { - this.titleFontWeight = titleFontWeight == null ? null : titleFontWeight.trim(); - } - - public String getTitlePosition() { - return titlePosition; - } - - public void setTitlePosition(String titlePosition) { - this.titlePosition = titlePosition == null ? null : titlePosition.trim(); - } - - public String getSubtitleText() { - return subtitleText; - } - - public void setSubtitleText(String subtitleText) { - this.subtitleText = subtitleText == null ? null : subtitleText.trim(); - } - - public String getSubtitleColor() { - return subtitleColor; - } - - public void setSubtitleColor(String subtitleColor) { - this.subtitleColor = subtitleColor == null ? null : subtitleColor.trim(); - } - - public String getSubtitleFontSize() { - return subtitleFontSize; - } - - public void setSubtitleFontSize(String subtitleFontSize) { - this.subtitleFontSize = subtitleFontSize == null ? null : subtitleFontSize.trim(); - } - - public String getSubtitleFontWeight() { - return subtitleFontWeight; - } - - public void setSubtitleFontWeight(String subtitleFontWeight) { - this.subtitleFontWeight = subtitleFontWeight == null ? null : subtitleFontWeight.trim(); - } - - public String getLegendPosition() { - return legendPosition; - } - - public void setLegendPosition(String legendPosition) { - this.legendPosition = legendPosition == null ? null : legendPosition.trim(); - } - - public String getLegendTextFontsize() { - return legendTextFontsize; - } - - public void setLegendTextFontsize(String legendTextFontsize) { - this.legendTextFontsize = legendTextFontsize == null ? null : legendTextFontsize.trim(); - } - - public String getXaxistype() { - return xaxistype; - } - - public void setXaxistype(String xaxistype) { - this.xaxistype = xaxistype == null ? null : xaxistype.trim(); - } - - public String getXaxisdata() { - return xaxisdata; - } - - public void setXaxisdata(String xaxisdata) { - this.xaxisdata = xaxisdata == null ? null : xaxisdata.trim(); - } - - public String getXaxislineshow() { - return xaxislineshow; - } - - public void setXaxislineshow(String xaxislineshow) { - this.xaxislineshow = xaxislineshow == null ? null : xaxislineshow.trim(); - } - - public String getXaxislinecolor() { - return xaxislinecolor; - } - - public void setXaxislinecolor(String xaxislinecolor) { - this.xaxislinecolor = xaxislinecolor == null ? null : xaxislinecolor.trim(); - } - - public String getXaxisaxistickshow() { - return xaxisaxistickshow; - } - - public void setXaxisaxistickshow(String xaxisaxistickshow) { - this.xaxisaxistickshow = xaxisaxistickshow == null ? null : xaxisaxistickshow.trim(); - } - - public String getXaxissplitlineshow() { - return xaxissplitlineshow; - } - - public void setXaxissplitlineshow(String xaxissplitlineshow) { - this.xaxissplitlineshow = xaxissplitlineshow == null ? null : xaxissplitlineshow.trim(); - } - - public String getXaxisaxislabelshow() { - return xaxisaxislabelshow; - } - - public void setXaxisaxislabelshow(String xaxisaxislabelshow) { - this.xaxisaxislabelshow = xaxisaxislabelshow == null ? null : xaxisaxislabelshow.trim(); - } - - public String getXaxisaxislabelcolor() { - return xaxisaxislabelcolor; - } - - public void setXaxisaxislabelcolor(String xaxisaxislabelcolor) { - this.xaxisaxislabelcolor = xaxisaxislabelcolor == null ? null : xaxisaxislabelcolor.trim(); - } - - public String getXaxisaxislabelfontsize() { - return xaxisaxislabelfontsize; - } - - public void setXaxisaxislabelfontsize(String xaxisaxislabelfontsize) { - this.xaxisaxislabelfontsize = xaxisaxislabelfontsize == null ? null : xaxisaxislabelfontsize.trim(); - } - - public String getDatazoomst() { - return datazoomst; - } - - public void setDatazoomst(String datazoomst) { - this.datazoomst = datazoomst == null ? null : datazoomst.trim(); - } - - public String getXsubstring() { - return xsubstring; - } - - public void setXsubstring(String xsubstring) { - this.xsubstring = xsubstring == null ? null : xsubstring.trim(); - } - - public String getDirection() { - return direction; - } - - public void setDirection(String direction) { - this.direction = direction; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualBarChartSeries.java b/src/com/sipai/entity/process/DataVisualBarChartSeries.java deleted file mode 100644 index 86898896..00000000 --- a/src/com/sipai/entity/process/DataVisualBarChartSeries.java +++ /dev/null @@ -1,282 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualBarChartSeries extends SQLAdapter{ - public final static String TimeRange_dateSelect="dateSelect";//关联日期选中控件 - public final static String TimeRange_hour = "hour";//小时 - public final static String TimeRange_day = "day";//天 - public final static String TimeRange_week = "week";//周 - public final static String TimeRange_month = "month";//月 - public final static String TimeRange_year = "year";//年 - - private String id; - - private String pid; - - private String type; - - private Integer morder; - - private String name; - - private Integer yaxisindex; - - private String stackst; - - private String mpid; - - private String fixedvalue; - - private String maxshow; - - private String minshow; - - private String avgshow; - - private String ishistorydata; - - private String timerange; - - private String markerline; - - private String barwidth; - - private String borderradius; - - private String bkstylecolor; - - private String bkstyleborderradius; - - private String mpmethod; - - private String labelposition; - - private String labelpositionunit; - - private String labelpositioncolor; - - private String labelpositionfontsize; - - private String bargap; - - private String selectst; - - private String urldata; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getYaxisindex() { - return yaxisindex; - } - - public void setYaxisindex(Integer yaxisindex) { - this.yaxisindex = yaxisindex; - } - - public String getStackst() { - return stackst; - } - - public void setStackst(String stackst) { - this.stackst = stackst == null ? null : stackst.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue == null ? null : fixedvalue.trim(); - } - - public String getMaxshow() { - return maxshow; - } - - public void setMaxshow(String maxshow) { - this.maxshow = maxshow == null ? null : maxshow.trim(); - } - - public String getMinshow() { - return minshow; - } - - public void setMinshow(String minshow) { - this.minshow = minshow == null ? null : minshow.trim(); - } - - public String getAvgshow() { - return avgshow; - } - - public void setAvgshow(String avgshow) { - this.avgshow = avgshow == null ? null : avgshow.trim(); - } - - public String getIshistorydata() { - return ishistorydata; - } - - public void setIshistorydata(String ishistorydata) { - this.ishistorydata = ishistorydata == null ? null : ishistorydata.trim(); - } - - public String getTimerange() { - return timerange; - } - - public void setTimerange(String timerange) { - this.timerange = timerange == null ? null : timerange.trim(); - } - - public String getMarkerline() { - return markerline; - } - - public void setMarkerline(String markerline) { - this.markerline = markerline == null ? null : markerline.trim(); - } - - public String getBarwidth() { - return barwidth; - } - - public void setBarwidth(String barwidth) { - this.barwidth = barwidth == null ? null : barwidth.trim(); - } - - public String getBorderradius() { - return borderradius; - } - - public void setBorderradius(String borderradius) { - this.borderradius = borderradius == null ? null : borderradius.trim(); - } - - public String getBkstylecolor() { - return bkstylecolor; - } - - public void setBkstylecolor(String bkstylecolor) { - this.bkstylecolor = bkstylecolor == null ? null : bkstylecolor.trim(); - } - - public String getBkstyleborderradius() { - return bkstyleborderradius; - } - - public void setBkstyleborderradius(String bkstyleborderradius) { - this.bkstyleborderradius = bkstyleborderradius == null ? null : bkstyleborderradius.trim(); - } - - public String getMpmethod() { - return mpmethod; - } - - public void setMpmethod(String mpmethod) { - this.mpmethod = mpmethod == null ? null : mpmethod.trim(); - } - - public String getLabelposition() { - return labelposition; - } - - public void setLabelposition(String labelposition) { - this.labelposition = labelposition == null ? null : labelposition.trim(); - } - - public String getLabelpositionunit() { - return labelpositionunit; - } - - public void setLabelpositionunit(String labelpositionunit) { - this.labelpositionunit = labelpositionunit == null ? null : labelpositionunit.trim(); - } - - public String getLabelpositioncolor() { - return labelpositioncolor; - } - - public void setLabelpositioncolor(String labelpositioncolor) { - this.labelpositioncolor = labelpositioncolor == null ? null : labelpositioncolor.trim(); - } - - public String getLabelpositionfontsize() { - return labelpositionfontsize; - } - - public void setLabelpositionfontsize(String labelpositionfontsize) { - this.labelpositionfontsize = labelpositionfontsize == null ? null : labelpositionfontsize.trim(); - } - - public String getBargap() { - return bargap; - } - - public void setBargap(String bargap) { - this.bargap = bargap == null ? null : bargap.trim(); - } - - public String getSelectst() { - return selectst; - } - - public void setSelectst(String selectst) { - this.selectst = selectst == null ? null : selectst.trim(); - } - - public String getUrldata() { - return urldata; - } - - public void setUrldata(String urldata) { - this.urldata = urldata == null ? null : urldata.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualBarChartYAxis.java b/src/com/sipai/entity/process/DataVisualBarChartYAxis.java deleted file mode 100644 index c0787047..00000000 --- a/src/com/sipai/entity/process/DataVisualBarChartYAxis.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualBarChartYAxis extends SQLAdapter { - - private String id; - - private String pid; - - private Integer morder; - - private String name; - - private String unit; - - private String lineshow; - - private String linecolor; - - private String axistickshow; - - private String scale; - - private String splitlineshow; - - private String axislabelshow; - - private String axislabelcolor; - - private String axislabelfontsize; - - private String position; - - private String max; - - private String min; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } - - public String getLineshow() { - return lineshow; - } - - public void setLineshow(String lineshow) { - this.lineshow = lineshow == null ? null : lineshow.trim(); - } - - public String getLinecolor() { - return linecolor; - } - - public void setLinecolor(String linecolor) { - this.linecolor = linecolor == null ? null : linecolor.trim(); - } - - public String getAxistickshow() { - return axistickshow; - } - - public void setAxistickshow(String axistickshow) { - this.axistickshow = axistickshow == null ? null : axistickshow.trim(); - } - - public String getScale() { - return scale; - } - - public void setScale(String scale) { - this.scale = scale == null ? null : scale.trim(); - } - - public String getSplitlineshow() { - return splitlineshow; - } - - public void setSplitlineshow(String splitlineshow) { - this.splitlineshow = splitlineshow == null ? null : splitlineshow.trim(); - } - - public String getAxislabelshow() { - return axislabelshow; - } - - public void setAxislabelshow(String axislabelshow) { - this.axislabelshow = axislabelshow == null ? null : axislabelshow.trim(); - } - - public String getAxislabelcolor() { - return axislabelcolor; - } - - public void setAxislabelcolor(String axislabelcolor) { - this.axislabelcolor = axislabelcolor == null ? null : axislabelcolor.trim(); - } - - public String getAxislabelfontsize() { - return axislabelfontsize; - } - - public void setAxislabelfontsize(String axislabelfontsize) { - this.axislabelfontsize = axislabelfontsize == null ? null : axislabelfontsize.trim(); - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position == null ? null : position.trim(); - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max == null ? null : max.trim(); - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min == null ? null : min.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualCamera.java b/src/com/sipai/entity/process/DataVisualCamera.java deleted file mode 100644 index c030606d..00000000 --- a/src/com/sipai/entity/process/DataVisualCamera.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.Camera; - -public class DataVisualCamera extends SQLAdapter { - private String id; - - private String pid; - - private String cameraid; - - private String color; - - private String mqTheme; - - private Camera camera; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getCameraid() { - return cameraid; - } - - public void setCameraid(String cameraid) { - this.cameraid = cameraid; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getMqTheme() { - return mqTheme; - } - - public void setMqTheme(String mqTheme) { - this.mqTheme = mqTheme; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualCameraAlarm.java b/src/com/sipai/entity/process/DataVisualCameraAlarm.java deleted file mode 100644 index aac8ad15..00000000 --- a/src/com/sipai/entity/process/DataVisualCameraAlarm.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualCameraAlarm extends SQLAdapter { - private String id; - - private String pid; - - private Double jsvalue; - - private String jsmethod; - - private String color; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Double getJsvalue() { - return jsvalue; - } - - public void setJsvalue(Double jsvalue) { - this.jsvalue = jsvalue; - } - - public String getJsmethod() { - return jsmethod; - } - - public void setJsmethod(String jsmethod) { - this.jsmethod = jsmethod == null ? null : jsmethod.trim(); - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color == null ? null : color.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualContent.java b/src/com/sipai/entity/process/DataVisualContent.java deleted file mode 100644 index 1e2f3f69..00000000 --- a/src/com/sipai/entity/process/DataVisualContent.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class DataVisualContent extends SQLAdapter { - public final static String Type_SignalPoint = "DI";//信号点 - public final static String Type_DataPoint = "AI";//数据点 - public final static String Type_Text = "Text";//文本框 - public final static String Type_Camera = "Camera";//摄像头 - public final static String Type_Form = "Form";//表格 - public final static String Type_BarChart = "BarChart";//柱状图 - public final static String Type_LineChart = "LineChart";//折线图 - public final static String Type_PieChart = "PieChart";//饼图 - public final static String Type_PercentChart = "PercentChart";//百分比环图 - public final static String Type_RadarChart = "RadarChart";//雷达图 - public final static String Type_GaugeChart = "GaugeChart";//仪表盘 - public final static String Type_Picture = "Picture";//图片 - public final static String Type_Date = "Date";//日期 - public final static String Type_Iframe = "Iframe";//Iframe - public final static String Type_Tab = "Tab";//标签页 - public final static String Type_MpView = "MpView";//测量点映射 - public final static String Type_ProgressBar = "ProgressBar";//进度条 - public final static String Type_Line = "Line";//线条 - public final static String Type_DateSelect = "AADateSelect";//日期选择 aa为了排序第一个 - public final static String Type_SuspensionFrame = "SuspensionFrame";//悬浮框 - public final static String Type_PolarCoordinates = "PolarCoordinates";//极坐标 - public final static String Type_Weather = "Weather";//天气 - public final static String Type_Switch = "11Switch";//开关 11为了排序 - public final static String Type_PersonnelPositioning = "personnelPositioning";//人员定位 - public final static String Type_Svg = "svg";//svg - public final static String Type_TaskPoints = "TaskPoints";//任务点 - public final static String Type_EqPoints = "EqPoints";//设备点 - public final static String Type_SelectJump = "SelectJump";//下拉跳转 - - public final static String Isfull_True = "true";//自适应铺满 - public final static String Isfull_False = "false";//不自适应铺满 - - private String id; - - private String pid; - - private String name; - - private String type; - - private String style; - - private String postx; - - private String posty; - - private String width; - - private String height; - - private String background; - - private String isfull; - - private String refreshtime; - - private String zIndex; - - private String src; - - private String istab; - - private String tabtype; - - private String isvoiceknow; - - private String voicetext; - - private String voicemethod; - - private String isfixed; - - private String roundtimecontent; - - private String opacityst; - - private String containerId; - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getPostx() { - return postx; - } - - public void setPostx(String postx) { - this.postx = postx == null ? null : postx.trim(); - } - - public String getPosty() { - return posty; - } - - public void setPosty(String posty) { - this.posty = posty == null ? null : posty.trim(); - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width == null ? null : width.trim(); - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height == null ? null : height.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getIsfull() { - return isfull; - } - - public void setIsfull(String isfull) { - this.isfull = isfull == null ? null : isfull.trim(); - } - - public String getRefreshtime() { - return refreshtime; - } - - public void setRefreshtime(String refreshtime) { - this.refreshtime = refreshtime == null ? null : refreshtime.trim(); - } - - public String getzIndex() { - return zIndex; - } - - public void setzIndex(String zIndex) { - this.zIndex = zIndex == null ? null : zIndex.trim(); - } - - public String getSrc() { - return src; - } - - public void setSrc(String src) { - this.src = src == null ? null : src.trim(); - } - - public String getIstab() { - return istab; - } - - public void setIstab(String istab) { - this.istab = istab == null ? null : istab.trim(); - } - - public String getTabtype() { - return tabtype; - } - - public void setTabtype(String tabtype) { - this.tabtype = tabtype == null ? null : tabtype.trim(); - } - - public String getIsvoiceknow() { - return isvoiceknow; - } - - public void setIsvoiceknow(String isvoiceknow) { - this.isvoiceknow = isvoiceknow == null ? null : isvoiceknow.trim(); - } - - public String getVoicetext() { - return voicetext; - } - - public void setVoicetext(String voicetext) { - this.voicetext = voicetext == null ? null : voicetext.trim(); - } - - public String getVoicemethod() { - return voicemethod; - } - - public void setVoicemethod(String voicemethod) { - this.voicemethod = voicemethod == null ? null : voicemethod.trim(); - } - - public String getIsfixed() { - return isfixed; - } - - public void setIsfixed(String isfixed) { - this.isfixed = isfixed == null ? null : isfixed.trim(); - } - - public String getRoundtimecontent() { - return roundtimecontent; - } - - public void setRoundtimecontent(String roundtimecontent) { - this.roundtimecontent = roundtimecontent == null ? null : roundtimecontent.trim(); - } - - public String getOpacityst() { - return opacityst; - } - - public void setOpacityst(String opacityst) { - this.opacityst = opacityst == null ? null : opacityst.trim(); - } - - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualDate.java b/src/com/sipai/entity/process/DataVisualDate.java deleted file mode 100644 index 9f685203..00000000 --- a/src/com/sipai/entity/process/DataVisualDate.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualDate extends SQLAdapter { - public final static String Types_Date_Year = "year";//年 - public final static String Types_Date_Month = "month";//月 - public final static String Types_Date_Day = "day";//月 - public final static String Types_Date_Hour = "hour";//时 - public final static String Types_Date_Min = "min";//时 - public final static String Types_Date_Sec = "sec";//秒 - public final static String Types_Date_Week = "week";//周几 - - private String id; - - private String pid; - - private String types; - - private String background; - - private String fontsize; - - private String fontcolor; - - private String fontweight; - - private String styletype; - - private String textAlign; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getTypes() { - return types; - } - - public void setTypes(String types) { - this.types = types == null ? null : types.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight == null ? null : fontweight.trim(); - } - - public String getStyletype() { - return styletype; - } - - public void setStyletype(String styletype) { - this.styletype = styletype == null ? null : styletype.trim(); - } - - public String getTextAlign() { - return textAlign; - } - - public void setTextAlign(String textAlign) { - this.textAlign = textAlign == null ? null : textAlign.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualDateSelect.java b/src/com/sipai/entity/process/DataVisualDateSelect.java deleted file mode 100644 index 436e1adf..00000000 --- a/src/com/sipai/entity/process/DataVisualDateSelect.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualDateSelect extends SQLAdapter{ - - private String id; - - private String pid; - - private String type; - - private String background; - - private String fontsize; - - private String fontcolor; - - private String fontweight; - - private String style; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor; - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualEqPoints.java b/src/com/sipai/entity/process/DataVisualEqPoints.java deleted file mode 100644 index 87450512..00000000 --- a/src/com/sipai/entity/process/DataVisualEqPoints.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualEqPoints extends SQLAdapter { - private String id; - - private String eqid; - - private String pid; - - private String eqName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getEqid() { - return eqid; - } - - public void setEqid(String eqid) { - this.eqid = eqid == null ? null : eqid.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getEqName() { - return eqName; - } - - public void setEqName(String eqName) { - this.eqName = eqName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualForm.java b/src/com/sipai/entity/process/DataVisualForm.java deleted file mode 100644 index 17001320..00000000 --- a/src/com/sipai/entity/process/DataVisualForm.java +++ /dev/null @@ -1,338 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualForm extends SQLAdapter { - public final static String Type_row = "row";//行 - public final static String Type_column = "column";//列 - - private String id; - - private String pid; - - private Integer insertrow; - - private Integer insertcolumn; - - private Integer columns; - - private Integer rows; - - private String type; - - private String width; - - private String height; - - private String background; - - private String frameid; - - private String mpid; - - private String unitst; - - private String textcontent; - - private String fontsize; - - private String fontweight; - - private String fontcolor; - - private String textalign; - - private String verticalalign; - - private String border; - - private String padding; - - private String borderradius; - - private String style; - - private String valuemethod; - - private String timeframe; - - private String rate; - - private String urldata; - - private String numtail; - - private String timest; - - private String timestnum; - - private String sqlst; - - private String sqlcontent; - - private String rowst; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getInsertrow() { - return insertrow; - } - - public void setInsertrow(Integer insertrow) { - this.insertrow = insertrow; - } - - public Integer getInsertcolumn() { - return insertcolumn; - } - - public void setInsertcolumn(Integer insertcolumn) { - this.insertcolumn = insertcolumn; - } - - public Integer getColumns() { - return columns; - } - - public void setColumns(Integer columns) { - this.columns = columns; - } - - public Integer getRows() { - return rows; - } - - public void setRows(Integer rows) { - this.rows = rows; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width == null ? null : width.trim(); - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height == null ? null : height.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getFrameid() { - return frameid; - } - - public void setFrameid(String frameid) { - this.frameid = frameid == null ? null : frameid.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getUnitst() { - return unitst; - } - - public void setUnitst(String unitst) { - this.unitst = unitst == null ? null : unitst.trim(); - } - - public String getTextcontent() { - return textcontent; - } - - public void setTextcontent(String textcontent) { - this.textcontent = textcontent == null ? null : textcontent.trim(); - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight == null ? null : fontweight.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public String getTextalign() { - return textalign; - } - - public void setTextalign(String textalign) { - this.textalign = textalign == null ? null : textalign.trim(); - } - - public String getVerticalalign() { - return verticalalign; - } - - public void setVerticalalign(String verticalalign) { - this.verticalalign = verticalalign == null ? null : verticalalign.trim(); - } - - public String getBorder() { - return border; - } - - public void setBorder(String border) { - this.border = border == null ? null : border.trim(); - } - - public String getPadding() { - return padding; - } - - public void setPadding(String padding) { - this.padding = padding == null ? null : padding.trim(); - } - - public String getBorderradius() { - return borderradius; - } - - public void setBorderradius(String borderradius) { - this.borderradius = borderradius == null ? null : borderradius.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod == null ? null : valuemethod.trim(); - } - - public String getTimeframe() { - return timeframe; - } - - public void setTimeframe(String timeframe) { - this.timeframe = timeframe == null ? null : timeframe.trim(); - } - - public String getRate() { - return rate; - } - - public void setRate(String rate) { - this.rate = rate == null ? null : rate.trim(); - } - - public String getUrldata() { - return urldata; - } - - public void setUrldata(String urldata) { - this.urldata = urldata == null ? null : urldata.trim(); - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail == null ? null : numtail.trim(); - } - - public String getTimest() { - return timest; - } - - public void setTimest(String timest) { - this.timest = timest == null ? null : timest.trim(); - } - - public String getTimestnum() { - return timestnum; - } - - public void setTimestnum(String timestnum) { - this.timestnum = timestnum == null ? null : timestnum.trim(); - } - - public String getSqlst() { - return sqlst; - } - - public void setSqlst(String sqlst) { - this.sqlst = sqlst == null ? null : sqlst.trim(); - } - - public String getSqlcontent() { - return sqlcontent; - } - - public void setSqlcontent(String sqlcontent) { - this.sqlcontent = sqlcontent == null ? null : sqlcontent.trim(); - } - - public String getRowst() { - return rowst; - } - - public void setRowst(String rowst) { - this.rowst = rowst; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualFormShowStyle.java b/src/com/sipai/entity/process/DataVisualFormShowStyle.java deleted file mode 100644 index 27c70df4..00000000 --- a/src/com/sipai/entity/process/DataVisualFormShowStyle.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualFormShowStyle extends SQLAdapter { - private String id; - - private String pid; - - private String ckcontent; - - private String ckmethod; - - private Integer morder; - - private String fontsize; - - private String fontcolor; - - private String fontweight; - - private String background; - - private String showst; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getCkcontent() { - return ckcontent; - } - - public void setCkcontent(String ckcontent) { - this.ckcontent = ckcontent == null ? null : ckcontent.trim(); - } - - public String getCkmethod() { - return ckmethod; - } - - public void setCkmethod(String ckmethod) { - this.ckmethod = ckmethod == null ? null : ckmethod.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight == null ? null : fontweight.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getShowst() { - return showst; - } - - public void setShowst(String showst) { - this.showst = showst == null ? null : showst.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualFormSqlPoint.java b/src/com/sipai/entity/process/DataVisualFormSqlPoint.java deleted file mode 100644 index 818dbcf3..00000000 --- a/src/com/sipai/entity/process/DataVisualFormSqlPoint.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualFormSqlPoint extends SQLAdapter { - private String id; - - private String pid; - - private String name; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualFrame.java b/src/com/sipai/entity/process/DataVisualFrame.java deleted file mode 100644 index 59bd5f10..00000000 --- a/src/com/sipai/entity/process/DataVisualFrame.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualFrame extends SQLAdapter { - public final static String MenuType_ProVisual = "proVisual";//工艺可视化 - - public final static String Type_structure = "structure";//结构 - public final static String Type_frame = "frame";//画面 - - public final static String Active_0 = "0";//禁用 - public final static String Active_1 = "1";//启用 - - - private String id; - - private String name; - - private String insdt; - - private String insuser; - - private Integer morder; - - private String pid; - - private String active; - - private String code; - - private String background; - - private String height; - - private String width; - - private String type; - - private String unitid; - - private String menutype; - - private String style; - - private String rolepeople; - - private String rolepeopleName; - private String pname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active == null ? null : active.trim(); - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code == null ? null : code.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height == null ? null : height.trim(); - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width == null ? null : width.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getMenutype() { - return menutype; - } - - public void setMenutype(String menutype) { - this.menutype = menutype == null ? null : menutype.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getRolepeople() { - return rolepeople; - } - - public void setRolepeople(String rolepeople) { - this.rolepeople = rolepeople == null ? null : rolepeople.trim(); - } - - public String getRolepeopleName() { - return rolepeopleName; - } - - public void setRolepeopleName(String rolepeopleName) { - this.rolepeopleName = rolepeopleName; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualFrameContainer.java b/src/com/sipai/entity/process/DataVisualFrameContainer.java deleted file mode 100644 index 2438b995..00000000 --- a/src/com/sipai/entity/process/DataVisualFrameContainer.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualFrameContainer extends SQLAdapter{ - public final static String Type_row="row";//行 - public final static String Type_column="column";//列 - - private String id; - private String pid; - private Integer insertrow; - private Integer insertcolumn; - private Integer columns; - private Integer rows; - private String type; - private String width; - private String height; - private String background; - private String frameid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getInsertrow() { - return insertrow; - } - - public void setInsertrow(Integer insertrow) { - this.insertrow = insertrow; - } - - public Integer getInsertcolumn() { - return insertcolumn; - } - - public void setInsertcolumn(Integer insertcolumn) { - this.insertcolumn = insertcolumn; - } - - public Integer getColumns() { - return columns; - } - - public void setColumns(Integer columns) { - this.columns = columns; - } - - public Integer getRows() { - return rows; - } - - public void setRows(Integer rows) { - this.rows = rows; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getFrameid() { - return frameid; - } - - public void setFrameid(String frameid) { - this.frameid = frameid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualGaugeChart.java b/src/com/sipai/entity/process/DataVisualGaugeChart.java deleted file mode 100644 index a0e488d3..00000000 --- a/src/com/sipai/entity/process/DataVisualGaugeChart.java +++ /dev/null @@ -1,476 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualGaugeChart extends SQLAdapter { - - private String id; - - private String pid; - - private String background; - - private String max; - - private String min; - - private String mpid; - - private String fixedvalue; - - private String titlest; - - private String titleText; - - private String titleColor; - - private String titleFontSize; - - private String titleFontWeight; - - private String titleXPosition; - - private String titleYPosition; - - private String datast; - - private String dataColor; - - private String dataFontSize; - - private String dataFontWeight; - - private String dataXPosition; - - private String dataYPosition; - - private String startangle; - - private String endangle; - - private String radius; - - private String pointerst; - - private String pointerLength; - - private String pointerWidth; - - private String pointerColor; - - private String splitlinest; - - private String splitlineLength; - - private String splitlineDistance; - - private String splitlineColor; - - private String splitlineWidth; - - private String axislinest; - - private String axislineWidth; - - private String axislineColor; - - private String axistickst; - - private String axistickSplitnumber; - - private String axistickDistance; - - private String axistickLength; - - private String axistickColor; - - private String axistickWidth; - - private String axislabelst; - - private String axislabelDistance; - - private String axislabelColor; - - private String axislabelFontSize; - - private String axislabelFontWeight; - - private String valuemethod; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue; - } - - public String getTitlest() { - return titlest; - } - - public void setTitlest(String titlest) { - this.titlest = titlest; - } - - public String getTitleText() { - return titleText; - } - - public void setTitleText(String titleText) { - this.titleText = titleText; - } - - public String getTitleColor() { - return titleColor; - } - - public void setTitleColor(String titleColor) { - this.titleColor = titleColor; - } - - public String getTitleFontSize() { - return titleFontSize; - } - - public void setTitleFontSize(String titleFontSize) { - this.titleFontSize = titleFontSize; - } - - public String getTitleFontWeight() { - return titleFontWeight; - } - - public void setTitleFontWeight(String titleFontWeight) { - this.titleFontWeight = titleFontWeight; - } - - public String getTitleXPosition() { - return titleXPosition; - } - - public void setTitleXPosition(String titleXPosition) { - this.titleXPosition = titleXPosition; - } - - public String getTitleYPosition() { - return titleYPosition; - } - - public void setTitleYPosition(String titleYPosition) { - this.titleYPosition = titleYPosition; - } - - public String getDatast() { - return datast; - } - - public void setDatast(String datast) { - this.datast = datast; - } - - public String getDataColor() { - return dataColor; - } - - public void setDataColor(String dataColor) { - this.dataColor = dataColor; - } - - public String getDataFontSize() { - return dataFontSize; - } - - public void setDataFontSize(String dataFontSize) { - this.dataFontSize = dataFontSize; - } - - public String getDataFontWeight() { - return dataFontWeight; - } - - public void setDataFontWeight(String dataFontWeight) { - this.dataFontWeight = dataFontWeight; - } - - public String getDataXPosition() { - return dataXPosition; - } - - public void setDataXPosition(String dataXPosition) { - this.dataXPosition = dataXPosition; - } - - public String getDataYPosition() { - return dataYPosition; - } - - public void setDataYPosition(String dataYPosition) { - this.dataYPosition = dataYPosition; - } - - public String getStartangle() { - return startangle; - } - - public void setStartangle(String startangle) { - this.startangle = startangle; - } - - public String getEndangle() { - return endangle; - } - - public void setEndangle(String endangle) { - this.endangle = endangle; - } - - public String getRadius() { - return radius; - } - - public void setRadius(String radius) { - this.radius = radius; - } - - public String getPointerst() { - return pointerst; - } - - public void setPointerst(String pointerst) { - this.pointerst = pointerst; - } - - public String getPointerLength() { - return pointerLength; - } - - public void setPointerLength(String pointerLength) { - this.pointerLength = pointerLength; - } - - public String getPointerWidth() { - return pointerWidth; - } - - public void setPointerWidth(String pointerWidth) { - this.pointerWidth = pointerWidth; - } - - public String getPointerColor() { - return pointerColor; - } - - public void setPointerColor(String pointerColor) { - this.pointerColor = pointerColor; - } - - public String getSplitlinest() { - return splitlinest; - } - - public void setSplitlinest(String splitlinest) { - this.splitlinest = splitlinest; - } - - public String getSplitlineLength() { - return splitlineLength; - } - - public void setSplitlineLength(String splitlineLength) { - this.splitlineLength = splitlineLength; - } - - public String getSplitlineDistance() { - return splitlineDistance; - } - - public void setSplitlineDistance(String splitlineDistance) { - this.splitlineDistance = splitlineDistance; - } - - public String getSplitlineColor() { - return splitlineColor; - } - - public void setSplitlineColor(String splitlineColor) { - this.splitlineColor = splitlineColor; - } - - public String getSplitlineWidth() { - return splitlineWidth; - } - - public void setSplitlineWidth(String splitlineWidth) { - this.splitlineWidth = splitlineWidth; - } - - public String getAxislinest() { - return axislinest; - } - - public void setAxislinest(String axislinest) { - this.axislinest = axislinest; - } - - public String getAxislineWidth() { - return axislineWidth; - } - - public void setAxislineWidth(String axislineWidth) { - this.axislineWidth = axislineWidth; - } - - public String getAxislineColor() { - return axislineColor; - } - - public void setAxislineColor(String axislineColor) { - this.axislineColor = axislineColor; - } - - public String getAxistickst() { - return axistickst; - } - - public void setAxistickst(String axistickst) { - this.axistickst = axistickst; - } - - public String getAxistickSplitnumber() { - return axistickSplitnumber; - } - - public void setAxistickSplitnumber(String axistickSplitnumber) { - this.axistickSplitnumber = axistickSplitnumber; - } - - public String getAxistickDistance() { - return axistickDistance; - } - - public void setAxistickDistance(String axistickDistance) { - this.axistickDistance = axistickDistance; - } - - public String getAxistickLength() { - return axistickLength; - } - - public void setAxistickLength(String axistickLength) { - this.axistickLength = axistickLength; - } - - public String getAxistickColor() { - return axistickColor; - } - - public void setAxistickColor(String axistickColor) { - this.axistickColor = axistickColor; - } - - public String getAxistickWidth() { - return axistickWidth; - } - - public void setAxistickWidth(String axistickWidth) { - this.axistickWidth = axistickWidth; - } - - public String getAxislabelst() { - return axislabelst; - } - - public void setAxislabelst(String axislabelst) { - this.axislabelst = axislabelst; - } - - public String getAxislabelDistance() { - return axislabelDistance; - } - - public void setAxislabelDistance(String axislabelDistance) { - this.axislabelDistance = axislabelDistance; - } - - public String getAxislabelColor() { - return axislabelColor; - } - - public void setAxislabelColor(String axislabelColor) { - this.axislabelColor = axislabelColor; - } - - public String getAxislabelFontSize() { - return axislabelFontSize; - } - - public void setAxislabelFontSize(String axislabelFontSize) { - this.axislabelFontSize = axislabelFontSize; - } - - public String getAxislabelFontWeight() { - return axislabelFontWeight; - } - - public void setAxislabelFontWeight(String axislabelFontWeight) { - this.axislabelFontWeight = axislabelFontWeight; - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualLineChart.java b/src/com/sipai/entity/process/DataVisualLineChart.java deleted file mode 100644 index b9759544..00000000 --- a/src/com/sipai/entity/process/DataVisualLineChart.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualLineChart extends SQLAdapter { - private String id; - - private String pid; - - private String type; - - private String colors; - - private String background; - - private String titleText; - - private String titleColor; - - private String titleFontSize; - - private String titleFontWeight; - - private String titlePosition; - - private String subtitleText; - - private String subtitleColor; - - private String subtitleFontSize; - - private String subtitleFontWeight; - - private String legendPosition; - - private String legendTextFontsize; - - private String xaxistype; - - private String xaxisdata; - - private String xaxislineshow; - - private String xaxislinecolor; - - private String xaxisaxistickshow; - - private String xaxissplitlineshow; - - private String xaxisaxislabelshow; - - private String xaxisaxislabelcolor; - - private String xaxisaxislabelfontsize; - - private String datazoomst; - - private String xsubstring; - - private String xaxissplitlinecolor; - - private String xaxissplitlinetype; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getColors() { - return colors; - } - - public void setColors(String colors) { - this.colors = colors == null ? null : colors.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getTitleText() { - return titleText; - } - - public void setTitleText(String titleText) { - this.titleText = titleText == null ? null : titleText.trim(); - } - - public String getTitleColor() { - return titleColor; - } - - public void setTitleColor(String titleColor) { - this.titleColor = titleColor == null ? null : titleColor.trim(); - } - - public String getTitleFontSize() { - return titleFontSize; - } - - public void setTitleFontSize(String titleFontSize) { - this.titleFontSize = titleFontSize == null ? null : titleFontSize.trim(); - } - - public String getTitleFontWeight() { - return titleFontWeight; - } - - public void setTitleFontWeight(String titleFontWeight) { - this.titleFontWeight = titleFontWeight == null ? null : titleFontWeight.trim(); - } - - public String getTitlePosition() { - return titlePosition; - } - - public void setTitlePosition(String titlePosition) { - this.titlePosition = titlePosition == null ? null : titlePosition.trim(); - } - - public String getSubtitleText() { - return subtitleText; - } - - public void setSubtitleText(String subtitleText) { - this.subtitleText = subtitleText == null ? null : subtitleText.trim(); - } - - public String getSubtitleColor() { - return subtitleColor; - } - - public void setSubtitleColor(String subtitleColor) { - this.subtitleColor = subtitleColor == null ? null : subtitleColor.trim(); - } - - public String getSubtitleFontSize() { - return subtitleFontSize; - } - - public void setSubtitleFontSize(String subtitleFontSize) { - this.subtitleFontSize = subtitleFontSize == null ? null : subtitleFontSize.trim(); - } - - public String getSubtitleFontWeight() { - return subtitleFontWeight; - } - - public void setSubtitleFontWeight(String subtitleFontWeight) { - this.subtitleFontWeight = subtitleFontWeight == null ? null : subtitleFontWeight.trim(); - } - - public String getLegendPosition() { - return legendPosition; - } - - public void setLegendPosition(String legendPosition) { - this.legendPosition = legendPosition == null ? null : legendPosition.trim(); - } - - public String getLegendTextFontsize() { - return legendTextFontsize; - } - - public void setLegendTextFontsize(String legendTextFontsize) { - this.legendTextFontsize = legendTextFontsize == null ? null : legendTextFontsize.trim(); - } - - public String getXaxistype() { - return xaxistype; - } - - public void setXaxistype(String xaxistype) { - this.xaxistype = xaxistype == null ? null : xaxistype.trim(); - } - - public String getXaxisdata() { - return xaxisdata; - } - - public void setXaxisdata(String xaxisdata) { - this.xaxisdata = xaxisdata == null ? null : xaxisdata.trim(); - } - - public String getXaxislineshow() { - return xaxislineshow; - } - - public void setXaxislineshow(String xaxislineshow) { - this.xaxislineshow = xaxislineshow == null ? null : xaxislineshow.trim(); - } - - public String getXaxislinecolor() { - return xaxislinecolor; - } - - public void setXaxislinecolor(String xaxislinecolor) { - this.xaxislinecolor = xaxislinecolor == null ? null : xaxislinecolor.trim(); - } - - public String getXaxisaxistickshow() { - return xaxisaxistickshow; - } - - public void setXaxisaxistickshow(String xaxisaxistickshow) { - this.xaxisaxistickshow = xaxisaxistickshow == null ? null : xaxisaxistickshow.trim(); - } - - public String getXaxissplitlineshow() { - return xaxissplitlineshow; - } - - public void setXaxissplitlineshow(String xaxissplitlineshow) { - this.xaxissplitlineshow = xaxissplitlineshow == null ? null : xaxissplitlineshow.trim(); - } - - public String getXaxisaxislabelshow() { - return xaxisaxislabelshow; - } - - public void setXaxisaxislabelshow(String xaxisaxislabelshow) { - this.xaxisaxislabelshow = xaxisaxislabelshow == null ? null : xaxisaxislabelshow.trim(); - } - - public String getXaxisaxislabelcolor() { - return xaxisaxislabelcolor; - } - - public void setXaxisaxislabelcolor(String xaxisaxislabelcolor) { - this.xaxisaxislabelcolor = xaxisaxislabelcolor == null ? null : xaxisaxislabelcolor.trim(); - } - - public String getXaxisaxislabelfontsize() { - return xaxisaxislabelfontsize; - } - - public void setXaxisaxislabelfontsize(String xaxisaxislabelfontsize) { - this.xaxisaxislabelfontsize = xaxisaxislabelfontsize == null ? null : xaxisaxislabelfontsize.trim(); - } - - public String getDatazoomst() { - return datazoomst; - } - - public void setDatazoomst(String datazoomst) { - this.datazoomst = datazoomst == null ? null : datazoomst.trim(); - } - - public String getXsubstring() { - return xsubstring; - } - - public void setXsubstring(String xsubstring) { - this.xsubstring = xsubstring == null ? null : xsubstring.trim(); - } - - public String getXaxissplitlinecolor() { - return xaxissplitlinecolor; - } - - public void setXaxissplitlinecolor(String xaxissplitlinecolor) { - this.xaxissplitlinecolor = xaxissplitlinecolor == null ? null : xaxissplitlinecolor.trim(); - } - - public String getXaxissplitlinetype() { - return xaxissplitlinetype; - } - - public void setXaxissplitlinetype(String xaxissplitlinetype) { - this.xaxissplitlinetype = xaxissplitlinetype == null ? null : xaxissplitlinetype.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualLineChartSeries.java b/src/com/sipai/entity/process/DataVisualLineChartSeries.java deleted file mode 100644 index dee43337..00000000 --- a/src/com/sipai/entity/process/DataVisualLineChartSeries.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualLineChartSeries extends SQLAdapter { - public final static String TimeRange_dateSelect="dateSelect";//关联日期选中控件 - public final static String TimeRange_hour="hour";//小时 - public final static String TimeRange_day="day";//天 - public final static String TimeRange_week="week";//周 - public final static String TimeRange_month="month";//月 - public final static String TimeRange_year="year";//年 - - private String id; - - private String pid; - - private Integer morder; - - private String name; - - private Integer yaxisindex; - - private String stackst; - - private String mpid; - - private String fixedvalue; - - private String maxshow; - - private String minshow; - - private String avgshow; - - private String areastyle; - - private String symbolst; - - private String ishistorydata; - - private String timerange; - - private String markerline; - - private String selectst; - - private String urldata; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getYaxisindex() { - return yaxisindex; - } - - public void setYaxisindex(Integer yaxisindex) { - this.yaxisindex = yaxisindex; - } - - public String getStackst() { - return stackst; - } - - public void setStackst(String stackst) { - this.stackst = stackst == null ? null : stackst.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue == null ? null : fixedvalue.trim(); - } - - public String getMaxshow() { - return maxshow; - } - - public void setMaxshow(String maxshow) { - this.maxshow = maxshow == null ? null : maxshow.trim(); - } - - public String getMinshow() { - return minshow; - } - - public void setMinshow(String minshow) { - this.minshow = minshow == null ? null : minshow.trim(); - } - - public String getAvgshow() { - return avgshow; - } - - public void setAvgshow(String avgshow) { - this.avgshow = avgshow == null ? null : avgshow.trim(); - } - - public String getAreastyle() { - return areastyle; - } - - public void setAreastyle(String areastyle) { - this.areastyle = areastyle == null ? null : areastyle.trim(); - } - - public String getSymbolst() { - return symbolst; - } - - public void setSymbolst(String symbolst) { - this.symbolst = symbolst == null ? null : symbolst.trim(); - } - - public String getIshistorydata() { - return ishistorydata; - } - - public void setIshistorydata(String ishistorydata) { - this.ishistorydata = ishistorydata == null ? null : ishistorydata.trim(); - } - - public String getTimerange() { - return timerange; - } - - public void setTimerange(String timerange) { - this.timerange = timerange == null ? null : timerange.trim(); - } - - public String getMarkerline() { - return markerline; - } - - public void setMarkerline(String markerline) { - this.markerline = markerline == null ? null : markerline.trim(); - } - - public String getSelectst() { - return selectst; - } - - public void setSelectst(String selectst) { - this.selectst = selectst == null ? null : selectst.trim(); - } - - public String getUrldata() { - return urldata; - } - - public void setUrldata(String urldata) { - this.urldata = urldata == null ? null : urldata.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualLineChartYAxis.java b/src/com/sipai/entity/process/DataVisualLineChartYAxis.java deleted file mode 100644 index cf5c33fe..00000000 --- a/src/com/sipai/entity/process/DataVisualLineChartYAxis.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualLineChartYAxis extends SQLAdapter { - private String id; - - private String pid; - - private Integer morder; - - private String name; - - private String unit; - - private String lineshow; - - private String linecolor; - - private String axistickshow; - - private String scale; - - private String splitlineshow; - - private String splitlinetype; - - private String splitlinecolor; - - private String position; - - private String axislabelshow; - - private String axislabelcolor; - - private String axislabelfontsize; - - private String max; - - private String min; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } - - public String getLineshow() { - return lineshow; - } - - public void setLineshow(String lineshow) { - this.lineshow = lineshow == null ? null : lineshow.trim(); - } - - public String getLinecolor() { - return linecolor; - } - - public void setLinecolor(String linecolor) { - this.linecolor = linecolor == null ? null : linecolor.trim(); - } - - public String getAxistickshow() { - return axistickshow; - } - - public void setAxistickshow(String axistickshow) { - this.axistickshow = axistickshow == null ? null : axistickshow.trim(); - } - - public String getScale() { - return scale; - } - - public void setScale(String scale) { - this.scale = scale == null ? null : scale.trim(); - } - - public String getSplitlineshow() { - return splitlineshow; - } - - public void setSplitlineshow(String splitlineshow) { - this.splitlineshow = splitlineshow == null ? null : splitlineshow.trim(); - } - - public String getSplitlinetype() { - return splitlinetype; - } - - public void setSplitlinetype(String splitlinetype) { - this.splitlinetype = splitlinetype == null ? null : splitlinetype.trim(); - } - - public String getSplitlinecolor() { - return splitlinecolor; - } - - public void setSplitlinecolor(String splitlinecolor) { - this.splitlinecolor = splitlinecolor == null ? null : splitlinecolor.trim(); - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position == null ? null : position.trim(); - } - - public String getAxislabelshow() { - return axislabelshow; - } - - public void setAxislabelshow(String axislabelshow) { - this.axislabelshow = axislabelshow == null ? null : axislabelshow.trim(); - } - - public String getAxislabelcolor() { - return axislabelcolor; - } - - public void setAxislabelcolor(String axislabelcolor) { - this.axislabelcolor = axislabelcolor == null ? null : axislabelcolor.trim(); - } - - public String getAxislabelfontsize() { - return axislabelfontsize; - } - - public void setAxislabelfontsize(String axislabelfontsize) { - this.axislabelfontsize = axislabelfontsize == null ? null : axislabelfontsize.trim(); - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max == null ? null : max.trim(); - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min == null ? null : min.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualMPoint.java b/src/com/sipai/entity/process/DataVisualMPoint.java deleted file mode 100644 index 55bc8875..00000000 --- a/src/com/sipai/entity/process/DataVisualMPoint.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class DataVisualMPoint extends SQLAdapter { - private String id; - - private String pid; - - private String mpid; - - private String name; - - private Integer fontsize; - - private String fontcolor; - - private Integer fontweight; - - private String background; - - private String style; - - private String unitid; - - private String showStyle; - - private String titleSwitch; - - private String unitSwitch; - - private MPoint mPoint; - - private String eqid; - - private String textColor; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getFontsize() { - return fontsize; - } - - public void setFontsize(Integer fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public Integer getFontweight() { - return fontweight; - } - - public void setFontweight(Integer fontweight) { - this.fontweight = fontweight; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getShowStyle() { - return showStyle; - } - - public void setShowStyle(String showStyle) { - this.showStyle = showStyle == null ? null : showStyle.trim(); - } - - public String getTitleSwitch() { - return titleSwitch; - } - - public void setTitleSwitch(String titleSwitch) { - this.titleSwitch = titleSwitch == null ? null : titleSwitch.trim(); - } - - public String getUnitSwitch() { - return unitSwitch; - } - - public void setUnitSwitch(String unitSwitch) { - this.unitSwitch = unitSwitch == null ? null : unitSwitch.trim(); - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getEqid() { - return eqid; - } - - public void setEqid(String eqid) { - this.eqid = eqid; - } - - public String getTextColor() { - return textColor; - } - - public void setTextColor(String textColor) { - this.textColor = textColor; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualMPointWarehouse.java b/src/com/sipai/entity/process/DataVisualMPointWarehouse.java deleted file mode 100644 index e6426304..00000000 --- a/src/com/sipai/entity/process/DataVisualMPointWarehouse.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualMPointWarehouse extends SQLAdapter{ - - private String id; - private String name; - private String width; - private String height; - private Integer fontsize; - private String fontcolor; - private Integer fontweight; - private String background; - private String style; - private Integer morder; - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public Integer getFontsize() { - return fontsize; - } - - public void setFontsize(Integer fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor; - } - - public Integer getFontweight() { - return fontweight; - } - - public void setFontweight(Integer fontweight) { - this.fontweight = fontweight; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualMpView.java b/src/com/sipai/entity/process/DataVisualMpView.java deleted file mode 100644 index bc8b1fe3..00000000 --- a/src/com/sipai/entity/process/DataVisualMpView.java +++ /dev/null @@ -1,281 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualMpView extends SQLAdapter { - public final static String JsMethod_0 = "0";//> - public final static String JsMethod_1 = "1";//>= - public final static String JsMethod_2 = "2";//= - public final static String JsMethod_3 = "3";//< - public final static String JsMethod_4 = "4";//<= - - private String id; - - private String pid; - - private String mpid; - - private String url; - - private String background; - - private Double jsvalue; - - private String jsmpid; - - private String jsmethod; - - private Integer morder; - - private String valuemethod; - - private String textshow; - - private String fontsize; - - private String fontcolor; - - private String fontweight; - - private String textAlign; - - private String filest; - - private String opacity; - - private String style; - - private String outValueType; - - private String autoBkSt; - - private String autoBkTextSt; - - private String autoBkTextWz; - - private Double autoBkStMaxvalue; - - private String autoBkTextType; - - private String autoBkBackground; - - private String mpValue; - - private String jsmpValue; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public Double getJsvalue() { - return jsvalue; - } - - public void setJsvalue(Double jsvalue) { - this.jsvalue = jsvalue; - } - - public String getJsmpid() { - return jsmpid; - } - - public void setJsmpid(String jsmpid) { - this.jsmpid = jsmpid == null ? null : jsmpid.trim(); - } - - public String getJsmethod() { - return jsmethod; - } - - public void setJsmethod(String jsmethod) { - this.jsmethod = jsmethod == null ? null : jsmethod.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod == null ? null : valuemethod.trim(); - } - - public String getTextshow() { - return textshow; - } - - public void setTextshow(String textshow) { - this.textshow = textshow == null ? null : textshow.trim(); - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight == null ? null : fontweight.trim(); - } - - public String getTextAlign() { - return textAlign; - } - - public void setTextAlign(String textAlign) { - this.textAlign = textAlign == null ? null : textAlign.trim(); - } - - public String getFilest() { - return filest; - } - - public void setFilest(String filest) { - this.filest = filest == null ? null : filest.trim(); - } - - public String getOpacity() { - return opacity; - } - - public void setOpacity(String opacity) { - this.opacity = opacity == null ? null : opacity.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getOutValueType() { - return outValueType; - } - - public void setOutValueType(String outValueType) { - this.outValueType = outValueType == null ? null : outValueType.trim(); - } - - public String getAutoBkSt() { - return autoBkSt; - } - - public void setAutoBkSt(String autoBkSt) { - this.autoBkSt = autoBkSt == null ? null : autoBkSt.trim(); - } - - public String getAutoBkTextSt() { - return autoBkTextSt; - } - - public void setAutoBkTextSt(String autoBkTextSt) { - this.autoBkTextSt = autoBkTextSt == null ? null : autoBkTextSt.trim(); - } - - public String getAutoBkTextWz() { - return autoBkTextWz; - } - - public void setAutoBkTextWz(String autoBkTextWz) { - this.autoBkTextWz = autoBkTextWz == null ? null : autoBkTextWz.trim(); - } - - public Double getAutoBkStMaxvalue() { - return autoBkStMaxvalue; - } - - public void setAutoBkStMaxvalue(Double autoBkStMaxvalue) { - this.autoBkStMaxvalue = autoBkStMaxvalue; - } - - public String getAutoBkTextType() { - return autoBkTextType; - } - - public void setAutoBkTextType(String autoBkTextType) { - this.autoBkTextType = autoBkTextType == null ? null : autoBkTextType.trim(); - } - - public String getAutoBkBackground() { - return autoBkBackground; - } - - public void setAutoBkBackground(String autoBkBackground) { - this.autoBkBackground = autoBkBackground == null ? null : autoBkBackground.trim(); - } - - public String getMpValue() { - return mpValue; - } - - public void setMpValue(String mpValue) { - this.mpValue = mpValue; - } - - public String getJsmpValue() { - return jsmpValue; - } - - public void setJsmpValue(String jsmpValue) { - this.jsmpValue = jsmpValue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualPercentChart.java b/src/com/sipai/entity/process/DataVisualPercentChart.java deleted file mode 100644 index 3091c7ff..00000000 --- a/src/com/sipai/entity/process/DataVisualPercentChart.java +++ /dev/null @@ -1,347 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualPercentChart extends SQLAdapter { - - private String id; - - private String pid; - - private String background; - - private String titleText; - - private String titleColor; - - private String titleFontSize; - - private String titleFontWeight; - - private String titleLeftPosition; - - private String titleTopPosition; - - private String subtitleText; - - private String subtitleColor; - - private String subtitleFontSize; - - private String subtitleFontWeight; - - private String subtitlePosition; - - private String unittitleText; - - private String unittitleColor; - - private String unittitleFontSize; - - private String unittitleFontWeight; - - private String unitisneedbr; - - private String mpid; - - private String clockwise; - - private String radius; - - private String scoreringwidth; - - private String scoreringcolor; - - private String bgringwidth; - - private String bgringcolor; - - private String bgringposition; - - private String angleaxismax; - - private String startangle; - - private String valuemethod; - - private String urldata; - - private String numtail; - - private String rate; - - private String showData; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getTitleText() { - return titleText; - } - - public void setTitleText(String titleText) { - this.titleText = titleText == null ? null : titleText.trim(); - } - - public String getTitleColor() { - return titleColor; - } - - public void setTitleColor(String titleColor) { - this.titleColor = titleColor == null ? null : titleColor.trim(); - } - - public String getTitleFontSize() { - return titleFontSize; - } - - public void setTitleFontSize(String titleFontSize) { - this.titleFontSize = titleFontSize == null ? null : titleFontSize.trim(); - } - - public String getTitleFontWeight() { - return titleFontWeight; - } - - public void setTitleFontWeight(String titleFontWeight) { - this.titleFontWeight = titleFontWeight == null ? null : titleFontWeight.trim(); - } - - public String getTitleLeftPosition() { - return titleLeftPosition; - } - - public void setTitleLeftPosition(String titleLeftPosition) { - this.titleLeftPosition = titleLeftPosition == null ? null : titleLeftPosition.trim(); - } - - public String getTitleTopPosition() { - return titleTopPosition; - } - - public void setTitleTopPosition(String titleTopPosition) { - this.titleTopPosition = titleTopPosition == null ? null : titleTopPosition.trim(); - } - - public String getSubtitleText() { - return subtitleText; - } - - public void setSubtitleText(String subtitleText) { - this.subtitleText = subtitleText == null ? null : subtitleText.trim(); - } - - public String getSubtitleColor() { - return subtitleColor; - } - - public void setSubtitleColor(String subtitleColor) { - this.subtitleColor = subtitleColor == null ? null : subtitleColor.trim(); - } - - public String getSubtitleFontSize() { - return subtitleFontSize; - } - - public void setSubtitleFontSize(String subtitleFontSize) { - this.subtitleFontSize = subtitleFontSize == null ? null : subtitleFontSize.trim(); - } - - public String getSubtitleFontWeight() { - return subtitleFontWeight; - } - - public void setSubtitleFontWeight(String subtitleFontWeight) { - this.subtitleFontWeight = subtitleFontWeight == null ? null : subtitleFontWeight.trim(); - } - - public String getSubtitlePosition() { - return subtitlePosition; - } - - public void setSubtitlePosition(String subtitlePosition) { - this.subtitlePosition = subtitlePosition == null ? null : subtitlePosition.trim(); - } - - public String getUnittitleText() { - return unittitleText; - } - - public void setUnittitleText(String unittitleText) { - this.unittitleText = unittitleText == null ? null : unittitleText.trim(); - } - - public String getUnittitleColor() { - return unittitleColor; - } - - public void setUnittitleColor(String unittitleColor) { - this.unittitleColor = unittitleColor == null ? null : unittitleColor.trim(); - } - - public String getUnittitleFontSize() { - return unittitleFontSize; - } - - public void setUnittitleFontSize(String unittitleFontSize) { - this.unittitleFontSize = unittitleFontSize == null ? null : unittitleFontSize.trim(); - } - - public String getUnittitleFontWeight() { - return unittitleFontWeight; - } - - public void setUnittitleFontWeight(String unittitleFontWeight) { - this.unittitleFontWeight = unittitleFontWeight == null ? null : unittitleFontWeight.trim(); - } - - public String getUnitisneedbr() { - return unitisneedbr; - } - - public void setUnitisneedbr(String unitisneedbr) { - this.unitisneedbr = unitisneedbr == null ? null : unitisneedbr.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getClockwise() { - return clockwise; - } - - public void setClockwise(String clockwise) { - this.clockwise = clockwise == null ? null : clockwise.trim(); - } - - public String getRadius() { - return radius; - } - - public void setRadius(String radius) { - this.radius = radius == null ? null : radius.trim(); - } - - public String getScoreringwidth() { - return scoreringwidth; - } - - public void setScoreringwidth(String scoreringwidth) { - this.scoreringwidth = scoreringwidth == null ? null : scoreringwidth.trim(); - } - - public String getScoreringcolor() { - return scoreringcolor; - } - - public void setScoreringcolor(String scoreringcolor) { - this.scoreringcolor = scoreringcolor == null ? null : scoreringcolor.trim(); - } - - public String getBgringwidth() { - return bgringwidth; - } - - public void setBgringwidth(String bgringwidth) { - this.bgringwidth = bgringwidth == null ? null : bgringwidth.trim(); - } - - public String getBgringcolor() { - return bgringcolor; - } - - public void setBgringcolor(String bgringcolor) { - this.bgringcolor = bgringcolor == null ? null : bgringcolor.trim(); - } - - public String getBgringposition() { - return bgringposition; - } - - public void setBgringposition(String bgringposition) { - this.bgringposition = bgringposition == null ? null : bgringposition.trim(); - } - - public String getAngleaxismax() { - return angleaxismax; - } - - public void setAngleaxismax(String angleaxismax) { - this.angleaxismax = angleaxismax == null ? null : angleaxismax.trim(); - } - - public String getStartangle() { - return startangle; - } - - public void setStartangle(String startangle) { - this.startangle = startangle == null ? null : startangle.trim(); - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod == null ? null : valuemethod.trim(); - } - - public String getUrldata() { - return urldata; - } - - public void setUrldata(String urldata) { - this.urldata = urldata == null ? null : urldata.trim(); - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail == null ? null : numtail.trim(); - } - - public String getRate() { - return rate; - } - - public void setRate(String rate) { - this.rate = rate; - } - - public String getShowData() { - return showData; - } - - public void setShowData(String showData) { - this.showData = showData; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualPersonnelPositioning.java b/src/com/sipai/entity/process/DataVisualPersonnelPositioning.java deleted file mode 100644 index 671cc383..00000000 --- a/src/com/sipai/entity/process/DataVisualPersonnelPositioning.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualPersonnelPositioning extends SQLAdapter { - - private String id; - - private String pid; - - private Double shiftingLeft; - - private Double shiftingTop; - - private String showicon; - - private String color; - - private String mqTheme; - - private String fontsize; - - private String fontcolor; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Double getShiftingLeft() { - return shiftingLeft; - } - - public void setShiftingLeft(Double shiftingLeft) { - this.shiftingLeft = shiftingLeft; - } - - public Double getShiftingTop() { - return shiftingTop; - } - - public void setShiftingTop(Double shiftingTop) { - this.shiftingTop = shiftingTop; - } - - public String getShowicon() { - return showicon; - } - - public void setShowicon(String showicon) { - this.showicon = showicon == null ? null : showicon.trim(); - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color == null ? null : color.trim(); - } - - public String getMqTheme() { - return mqTheme; - } - - public void setMqTheme(String mqTheme) { - this.mqTheme = mqTheme == null ? null : mqTheme.trim(); - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualPieChart.java b/src/com/sipai/entity/process/DataVisualPieChart.java deleted file mode 100644 index 41e326da..00000000 --- a/src/com/sipai/entity/process/DataVisualPieChart.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualPieChart extends SQLAdapter { - - private String id; - - private String pid; - - private String type; - - private String colors; - - private String background; - - private String titleText; - - private String titleColor; - - private String titleFontSize; - - private String titleFontWeight; - - private String titlePositionX; - - private String titlePositionY; - - private String subtitleText; - - private String subtitleColor; - - private String subtitleFontSize; - - private String subtitleFontWeight; - - private String legendPosition; - - private String lableShow; - - private String lablePosition; - - private String lableFontsize; - - private String lableColor; - - private String lableFontweight; - - private String radius; - - private Integer borderradius; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getColors() { - return colors; - } - - public void setColors(String colors) { - this.colors = colors == null ? null : colors.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getTitleText() { - return titleText; - } - - public void setTitleText(String titleText) { - this.titleText = titleText == null ? null : titleText.trim(); - } - - public String getTitleColor() { - return titleColor; - } - - public void setTitleColor(String titleColor) { - this.titleColor = titleColor == null ? null : titleColor.trim(); - } - - public String getTitleFontSize() { - return titleFontSize; - } - - public void setTitleFontSize(String titleFontSize) { - this.titleFontSize = titleFontSize == null ? null : titleFontSize.trim(); - } - - public String getTitleFontWeight() { - return titleFontWeight; - } - - public void setTitleFontWeight(String titleFontWeight) { - this.titleFontWeight = titleFontWeight == null ? null : titleFontWeight.trim(); - } - - public String getTitlePositionX() { - return titlePositionX; - } - - public void setTitlePositionX(String titlePositionX) { - this.titlePositionX = titlePositionX == null ? null : titlePositionX.trim(); - } - - public String getTitlePositionY() { - return titlePositionY; - } - - public void setTitlePositionY(String titlePositionY) { - this.titlePositionY = titlePositionY == null ? null : titlePositionY.trim(); - } - - public String getSubtitleText() { - return subtitleText; - } - - public void setSubtitleText(String subtitleText) { - this.subtitleText = subtitleText == null ? null : subtitleText.trim(); - } - - public String getSubtitleColor() { - return subtitleColor; - } - - public void setSubtitleColor(String subtitleColor) { - this.subtitleColor = subtitleColor == null ? null : subtitleColor.trim(); - } - - public String getSubtitleFontSize() { - return subtitleFontSize; - } - - public void setSubtitleFontSize(String subtitleFontSize) { - this.subtitleFontSize = subtitleFontSize == null ? null : subtitleFontSize.trim(); - } - - public String getSubtitleFontWeight() { - return subtitleFontWeight; - } - - public void setSubtitleFontWeight(String subtitleFontWeight) { - this.subtitleFontWeight = subtitleFontWeight == null ? null : subtitleFontWeight.trim(); - } - - public String getLegendPosition() { - return legendPosition; - } - - public void setLegendPosition(String legendPosition) { - this.legendPosition = legendPosition == null ? null : legendPosition.trim(); - } - - public String getLableShow() { - return lableShow; - } - - public void setLableShow(String lableShow) { - this.lableShow = lableShow == null ? null : lableShow.trim(); - } - - public String getLablePosition() { - return lablePosition; - } - - public void setLablePosition(String lablePosition) { - this.lablePosition = lablePosition == null ? null : lablePosition.trim(); - } - - public String getLableFontsize() { - return lableFontsize; - } - - public void setLableFontsize(String lableFontsize) { - this.lableFontsize = lableFontsize == null ? null : lableFontsize.trim(); - } - - public String getLableColor() { - return lableColor; - } - - public void setLableColor(String lableColor) { - this.lableColor = lableColor == null ? null : lableColor.trim(); - } - - public String getLableFontweight() { - return lableFontweight; - } - - public void setLableFontweight(String lableFontweight) { - this.lableFontweight = lableFontweight == null ? null : lableFontweight.trim(); - } - - public String getRadius() { - return radius; - } - - public void setRadius(String radius) { - this.radius = radius == null ? null : radius.trim(); - } - - public Integer getBorderradius() { - return borderradius; - } - - public void setBorderradius(Integer borderradius) { - this.borderradius = borderradius; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualPieChartSeries.java b/src/com/sipai/entity/process/DataVisualPieChartSeries.java deleted file mode 100644 index 30f1c91b..00000000 --- a/src/com/sipai/entity/process/DataVisualPieChartSeries.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualPieChartSeries extends SQLAdapter { - - private String id; - - private String pid; - - private Integer morder; - - private String name; - - private String mpid; - - private String fixedvalue; - - private String valuemethod; - - private String rate; - - private String numtail; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue == null ? null : fixedvalue.trim(); - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod == null ? null : valuemethod.trim(); - } - - public String getRate() { - return rate; - } - - public void setRate(String rate) { - this.rate = rate == null ? null : rate.trim(); - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail == null ? null : numtail.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualPolarCoordinates.java b/src/com/sipai/entity/process/DataVisualPolarCoordinates.java deleted file mode 100644 index 9b52d304..00000000 --- a/src/com/sipai/entity/process/DataVisualPolarCoordinates.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualPolarCoordinates extends SQLAdapter{ - private String id; - - private String pid; - - private String colors; - - private String background; - - private String legendPosition; - - private String max; - - private String radius; - - private String legendFontsize; - - private String backgroundst; - - private String backgroundcolor; - - private String roundcapst; - - private String barwidth; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getColors() { - return colors; - } - - public void setColors(String colors) { - this.colors = colors; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getLegendPosition() { - return legendPosition; - } - - public void setLegendPosition(String legendPosition) { - this.legendPosition = legendPosition; - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } - - public String getRadius() { - return radius; - } - - public void setRadius(String radius) { - this.radius = radius; - } - - public String getLegendFontsize() { - return legendFontsize; - } - - public void setLegendFontsize(String legendFontsize) { - this.legendFontsize = legendFontsize; - } - - public String getBackgroundst() { - return backgroundst; - } - - public void setBackgroundst(String backgroundst) { - this.backgroundst = backgroundst; - } - - public String getBackgroundcolor() { - return backgroundcolor; - } - - public void setBackgroundcolor(String backgroundcolor) { - this.backgroundcolor = backgroundcolor; - } - - public String getRoundcapst() { - return roundcapst; - } - - public void setRoundcapst(String roundcapst) { - this.roundcapst = roundcapst; - } - - public String getBarwidth() { - return barwidth; - } - - public void setBarwidth(String barwidth) { - this.barwidth = barwidth; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualPolarCoordinatesSeries.java b/src/com/sipai/entity/process/DataVisualPolarCoordinatesSeries.java deleted file mode 100644 index 22d35ad1..00000000 --- a/src/com/sipai/entity/process/DataVisualPolarCoordinatesSeries.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualPolarCoordinatesSeries extends SQLAdapter{ - private String id; - - private String pid; - - private String name; - - private Integer morder; - - private String mpid; - - private String fixedvalue; - - private String valuemethod; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue; - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualProgressBarChart.java b/src/com/sipai/entity/process/DataVisualProgressBarChart.java deleted file mode 100644 index 0a01a507..00000000 --- a/src/com/sipai/entity/process/DataVisualProgressBarChart.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualProgressBarChart extends SQLAdapter{ - - private String id; - - private String pid; - - private String background; - - private String mpid; - - private String text; - - private String datacolors; - - private String dataradius; - - private String databarwidth; - - private String textPosition; - - private String textColor; - - private String textFontsize; - - private String textFontweight; - - private String bktext; - - private String bkmptext; - - private String bkcolors; - - private String bkradius; - - private String bkbarwidth; - - private String valuemethod; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getDatacolors() { - return datacolors; - } - - public void setDatacolors(String datacolors) { - this.datacolors = datacolors; - } - - public String getDataradius() { - return dataradius; - } - - public void setDataradius(String dataradius) { - this.dataradius = dataradius; - } - - public String getDatabarwidth() { - return databarwidth; - } - - public void setDatabarwidth(String databarwidth) { - this.databarwidth = databarwidth; - } - - public String getTextPosition() { - return textPosition; - } - - public void setTextPosition(String textPosition) { - this.textPosition = textPosition; - } - - public String getTextColor() { - return textColor; - } - - public void setTextColor(String textColor) { - this.textColor = textColor; - } - - public String getTextFontsize() { - return textFontsize; - } - - public void setTextFontsize(String textFontsize) { - this.textFontsize = textFontsize; - } - - public String getTextFontweight() { - return textFontweight; - } - - public void setTextFontweight(String textFontweight) { - this.textFontweight = textFontweight; - } - - public String getBktext() { - return bktext; - } - - public void setBktext(String bktext) { - this.bktext = bktext; - } - - public String getBkmptext() { - return bkmptext; - } - - public void setBkmptext(String bkmptext) { - this.bkmptext = bkmptext; - } - - public String getBkcolors() { - return bkcolors; - } - - public void setBkcolors(String bkcolors) { - this.bkcolors = bkcolors; - } - - public String getBkradius() { - return bkradius; - } - - public void setBkradius(String bkradius) { - this.bkradius = bkradius; - } - - public String getBkbarwidth() { - return bkbarwidth; - } - - public void setBkbarwidth(String bkbarwidth) { - this.bkbarwidth = bkbarwidth; - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualRadarChart.java b/src/com/sipai/entity/process/DataVisualRadarChart.java deleted file mode 100644 index 84075c97..00000000 --- a/src/com/sipai/entity/process/DataVisualRadarChart.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualRadarChart extends SQLAdapter{ - - private String id; - - private String pid; - - private String colors; - - private String background; - - private String titleText; - - private String titleColor; - - private String titleFontSize; - - private String titleFontWeight; - - private String titlePosition; - - private String legendPosition; - - private Integer radius; - - private Integer splitnumber; - - private String shape; - - private String axisnameformatter; - - private String axisnamefontSize; - - private String axisnamecolor; - - private String axisnamefontWeight; - - private String splitareacolors; - - private String axislinecolor; - - private String splitlinecolor; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getColors() { - return colors; - } - - public void setColors(String colors) { - this.colors = colors; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getTitleText() { - return titleText; - } - - public void setTitleText(String titleText) { - this.titleText = titleText; - } - - public String getTitleColor() { - return titleColor; - } - - public void setTitleColor(String titleColor) { - this.titleColor = titleColor; - } - - public String getTitleFontSize() { - return titleFontSize; - } - - public void setTitleFontSize(String titleFontSize) { - this.titleFontSize = titleFontSize; - } - - public String getTitleFontWeight() { - return titleFontWeight; - } - - public void setTitleFontWeight(String titleFontWeight) { - this.titleFontWeight = titleFontWeight; - } - - public String getTitlePosition() { - return titlePosition; - } - - public void setTitlePosition(String titlePosition) { - this.titlePosition = titlePosition; - } - - public String getLegendPosition() { - return legendPosition; - } - - public void setLegendPosition(String legendPosition) { - this.legendPosition = legendPosition; - } - - public Integer getRadius() { - return radius; - } - - public void setRadius(Integer radius) { - this.radius = radius; - } - - public Integer getSplitnumber() { - return splitnumber; - } - - public void setSplitnumber(Integer splitnumber) { - this.splitnumber = splitnumber; - } - - public String getShape() { - return shape; - } - - public void setShape(String shape) { - this.shape = shape; - } - - public String getAxisnameformatter() { - return axisnameformatter; - } - - public void setAxisnameformatter(String axisnameformatter) { - this.axisnameformatter = axisnameformatter; - } - - public String getAxisnamefontSize() { - return axisnamefontSize; - } - - public void setAxisnamefontSize(String axisnamefontSize) { - this.axisnamefontSize = axisnamefontSize; - } - - public String getAxisnamecolor() { - return axisnamecolor; - } - - public void setAxisnamecolor(String axisnamecolor) { - this.axisnamecolor = axisnamecolor; - } - - public String getAxisnamefontWeight() { - return axisnamefontWeight; - } - - public void setAxisnamefontWeight(String axisnamefontWeight) { - this.axisnamefontWeight = axisnamefontWeight; - } - - public String getSplitareacolors() { - return splitareacolors; - } - - public void setSplitareacolors(String splitareacolors) { - this.splitareacolors = splitareacolors; - } - - public String getAxislinecolor() { - return axislinecolor; - } - - public void setAxislinecolor(String axislinecolor) { - this.axislinecolor = axislinecolor; - } - - public String getSplitlinecolor() { - return splitlinecolor; - } - - public void setSplitlinecolor(String splitlinecolor) { - this.splitlinecolor = splitlinecolor; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualRadarChartAxis.java b/src/com/sipai/entity/process/DataVisualRadarChartAxis.java deleted file mode 100644 index b4925555..00000000 --- a/src/com/sipai/entity/process/DataVisualRadarChartAxis.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualRadarChartAxis extends SQLAdapter { - private String id; - - private String pid; - - private Integer morder; - - private String name; - - private Integer max; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getMax() { - return max; - } - - public void setMax(Integer max) { - this.max = max; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualRadarChartSeries.java b/src/com/sipai/entity/process/DataVisualRadarChartSeries.java deleted file mode 100644 index 30c8b7a7..00000000 --- a/src/com/sipai/entity/process/DataVisualRadarChartSeries.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualRadarChartSeries extends SQLAdapter{ - - private String id; - - private String pid; - - private Integer morder; - - private String name; - - private String axisname; - - private String mpid; - - private String fixedvalue; - - private String areastyle; - - private String areastylecolor; - - private String valuemethod; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAxisname() { - return axisname; - } - - public void setAxisname(String axisname) { - this.axisname = axisname; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue; - } - - public String getAreastyle() { - return areastyle; - } - - public void setAreastyle(String areastyle) { - this.areastyle = areastyle; - } - - public String getAreastylecolor() { - return areastylecolor; - } - - public void setAreastylecolor(String areastylecolor) { - this.areastylecolor = areastylecolor; - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualSelect.java b/src/com/sipai/entity/process/DataVisualSelect.java deleted file mode 100644 index c3ee4c27..00000000 --- a/src/com/sipai/entity/process/DataVisualSelect.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualSelect extends SQLAdapter { - - private String id; - - private String pid; - - private String textcontent; - - private String height; - - private String background; - - private Integer fontsize; - - private String fontcolor; - - private Integer fontweight; - - private String urlstring; - - private String style; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getTextcontent() { - return textcontent; - } - - public void setTextcontent(String textcontent) { - this.textcontent = textcontent == null ? null : textcontent.trim(); - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height == null ? null : height.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public Integer getFontsize() { - return fontsize; - } - - public void setFontsize(Integer fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public Integer getFontweight() { - return fontweight; - } - - public void setFontweight(Integer fontweight) { - this.fontweight = fontweight; - } - - public String getUrlstring() { - return urlstring; - } - - public void setUrlstring(String urlstring) { - this.urlstring = urlstring == null ? null : urlstring.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualSuspensionFrame.java b/src/com/sipai/entity/process/DataVisualSuspensionFrame.java deleted file mode 100644 index 78a80c32..00000000 --- a/src/com/sipai/entity/process/DataVisualSuspensionFrame.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualSuspensionFrame extends SQLAdapter{ - - private String id; - - private String pid; - - private String textcontent; - - private Integer fontsize; - - private String fontcolor; - - private Integer fontweight; - - private String background; - - private String style; - - private String textheight; - - private String textalign; - - private String valuemethod; - - private String display; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getTextcontent() { - return textcontent; - } - - public void setTextcontent(String textcontent) { - this.textcontent = textcontent; - } - - public Integer getFontsize() { - return fontsize; - } - - public void setFontsize(Integer fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor; - } - - public Integer getFontweight() { - return fontweight; - } - - public void setFontweight(Integer fontweight) { - this.fontweight = fontweight; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getTextheight() { - return textheight; - } - - public void setTextheight(String textheight) { - this.textheight = textheight; - } - - public String getTextalign() { - return textalign; - } - - public void setTextalign(String textalign) { - this.textalign = textalign; - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod; - } - - public String getDisplay() { - return display; - } - - public void setDisplay(String display) { - this.display = display; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualSvg.java b/src/com/sipai/entity/process/DataVisualSvg.java deleted file mode 100644 index acfd05d6..00000000 --- a/src/com/sipai/entity/process/DataVisualSvg.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualSvg extends SQLAdapter { - - public final static String Type_Polyline = "polyline";//多段线 - public final static String Type_Polygon = "polygon";//多边形 - - private String id; - - private String points; - - private String fill; - - private String stroke; - - private Double strokeWidth; - - private String pid; - - private String mqTheme; - - private String type; - - private String dashedlinetype; - - private Double dashedline1; - - private Double dashedline2; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPoints() { - return points; - } - - public void setPoints(String points) { - this.points = points == null ? null : points.trim(); - } - - public String getFill() { - return fill; - } - - public void setFill(String fill) { - this.fill = fill == null ? null : fill.trim(); - } - - public String getStroke() { - return stroke; - } - - public void setStroke(String stroke) { - this.stroke = stroke == null ? null : stroke.trim(); - } - - public Double getStrokeWidth() { - return strokeWidth; - } - - public void setStrokeWidth(Double strokeWidth) { - this.strokeWidth = strokeWidth; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getMqTheme() { - return mqTheme; - } - - public void setMqTheme(String mqTheme) { - this.mqTheme = mqTheme == null ? null : mqTheme.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getDashedlinetype() { - return dashedlinetype; - } - - public void setDashedlinetype(String dashedlinetype) { - this.dashedlinetype = dashedlinetype == null ? null : dashedlinetype.trim(); - } - - public Double getDashedline1() { - return dashedline1; - } - - public void setDashedline1(Double dashedline1) { - this.dashedline1 = dashedline1; - } - - public Double getDashedline2() { - return dashedline2; - } - - public void setDashedline2(Double dashedline2) { - this.dashedline2 = dashedline2; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualSvgAlarm.java b/src/com/sipai/entity/process/DataVisualSvgAlarm.java deleted file mode 100644 index 96de891d..00000000 --- a/src/com/sipai/entity/process/DataVisualSvgAlarm.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualSvgAlarm extends SQLAdapter { - private String id; - - private String pid; - - private String jsvalue; - - private String jsmethod; - - private String stroke; - - private String fill; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getJsvalue() { - return jsvalue; - } - - public void setJsvalue(String jsvalue) { - this.jsvalue = jsvalue; - } - - public String getJsmethod() { - return jsmethod; - } - - public void setJsmethod(String jsmethod) { - this.jsmethod = jsmethod == null ? null : jsmethod.trim(); - } - - public String getStroke() { - return stroke; - } - - public void setStroke(String stroke) { - this.stroke = stroke == null ? null : stroke.trim(); - } - - public String getFill() { - return fill; - } - - public void setFill(String fill) { - this.fill = fill == null ? null : fill.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualSwitch.java b/src/com/sipai/entity/process/DataVisualSwitch.java deleted file mode 100644 index ff9d2dc1..00000000 --- a/src/com/sipai/entity/process/DataVisualSwitch.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualSwitch extends SQLAdapter { - - private String id; - - private String pid; - - private String showStyle; - - private String openst; - - private String type; - - private String url; - - private String urlType; - - private String urlWidth; - - private String urlHeight; - - private String submodalName; - - private String background; - - private String ckColor; - - private String ckSize; - - private String ckStyle; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getShowStyle() { - return showStyle; - } - - public void setShowStyle(String showStyle) { - this.showStyle = showStyle == null ? null : showStyle.trim(); - } - - public String getOpenst() { - return openst; - } - - public void setOpenst(String openst) { - this.openst = openst == null ? null : openst.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url == null ? null : url.trim(); - } - - public String getUrlType() { - return urlType; - } - - public void setUrlType(String urlType) { - this.urlType = urlType == null ? null : urlType.trim(); - } - - public String getUrlWidth() { - return urlWidth; - } - - public void setUrlWidth(String urlWidth) { - this.urlWidth = urlWidth == null ? null : urlWidth.trim(); - } - - public String getUrlHeight() { - return urlHeight; - } - - public void setUrlHeight(String urlHeight) { - this.urlHeight = urlHeight == null ? null : urlHeight.trim(); - } - - public String getSubmodalName() { - return submodalName; - } - - public void setSubmodalName(String submodalName) { - this.submodalName = submodalName == null ? null : submodalName.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getCkColor() { - return ckColor; - } - - public void setCkColor(String ckColor) { - this.ckColor = ckColor == null ? null : ckColor.trim(); - } - - public String getCkSize() { - return ckSize; - } - - public void setCkSize(String ckSize) { - this.ckSize = ckSize == null ? null : ckSize.trim(); - } - - public String getCkStyle() { - return ckStyle; - } - - public void setCkStyle(String ckStyle) { - this.ckStyle = ckStyle == null ? null : ckStyle.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualSwitchPoint.java b/src/com/sipai/entity/process/DataVisualSwitchPoint.java deleted file mode 100644 index 7527fc50..00000000 --- a/src/com/sipai/entity/process/DataVisualSwitchPoint.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualSwitchPoint extends SQLAdapter { - private String id; - - private String pid; - - private String contentid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getContentid() { - return contentid; - } - - public void setContentid(String contentid) { - this.contentid = contentid == null ? null : contentid.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualTab.java b/src/com/sipai/entity/process/DataVisualTab.java deleted file mode 100644 index 62d59b6d..00000000 --- a/src/com/sipai/entity/process/DataVisualTab.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualTab extends SQLAdapter { - public final static String TabType_Sheet = "sheet";//标签页 - public final static String TabType_Select = "se";//下拉框 - public final static String TabType_Radio = "radio";//单选球 - - private String id; - - private String pid; - - private String text; - - private String ckbackground; - - private String ckfontsize; - - private String ckfontcolor; - - private String ckfontweight; - - private String cktextAlign; - - private String ckstyle; - - private String unckbackground; - - private String unckfontsize; - - private String unckfontcolor; - - private String unckfontweight; - - private String uncktextAlign; - - private String unckstyle; - - private String firstck; - - private String width; - - private String height; - - private Integer morder; - - private String radioBackground; - - private String radioCkBackground; - - private String radioSize; - - private String radioCkSize; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text == null ? null : text.trim(); - } - - public String getCkbackground() { - return ckbackground; - } - - public void setCkbackground(String ckbackground) { - this.ckbackground = ckbackground == null ? null : ckbackground.trim(); - } - - public String getCkfontsize() { - return ckfontsize; - } - - public void setCkfontsize(String ckfontsize) { - this.ckfontsize = ckfontsize == null ? null : ckfontsize.trim(); - } - - public String getCkfontcolor() { - return ckfontcolor; - } - - public void setCkfontcolor(String ckfontcolor) { - this.ckfontcolor = ckfontcolor == null ? null : ckfontcolor.trim(); - } - - public String getCkfontweight() { - return ckfontweight; - } - - public void setCkfontweight(String ckfontweight) { - this.ckfontweight = ckfontweight == null ? null : ckfontweight.trim(); - } - - public String getCktextAlign() { - return cktextAlign; - } - - public void setCktextAlign(String cktextAlign) { - this.cktextAlign = cktextAlign == null ? null : cktextAlign.trim(); - } - - public String getCkstyle() { - return ckstyle; - } - - public void setCkstyle(String ckstyle) { - this.ckstyle = ckstyle == null ? null : ckstyle.trim(); - } - - public String getUnckbackground() { - return unckbackground; - } - - public void setUnckbackground(String unckbackground) { - this.unckbackground = unckbackground == null ? null : unckbackground.trim(); - } - - public String getUnckfontsize() { - return unckfontsize; - } - - public void setUnckfontsize(String unckfontsize) { - this.unckfontsize = unckfontsize == null ? null : unckfontsize.trim(); - } - - public String getUnckfontcolor() { - return unckfontcolor; - } - - public void setUnckfontcolor(String unckfontcolor) { - this.unckfontcolor = unckfontcolor == null ? null : unckfontcolor.trim(); - } - - public String getUnckfontweight() { - return unckfontweight; - } - - public void setUnckfontweight(String unckfontweight) { - this.unckfontweight = unckfontweight == null ? null : unckfontweight.trim(); - } - - public String getUncktextAlign() { - return uncktextAlign; - } - - public void setUncktextAlign(String uncktextAlign) { - this.uncktextAlign = uncktextAlign == null ? null : uncktextAlign.trim(); - } - - public String getUnckstyle() { - return unckstyle; - } - - public void setUnckstyle(String unckstyle) { - this.unckstyle = unckstyle == null ? null : unckstyle.trim(); - } - - public String getFirstck() { - return firstck; - } - - public void setFirstck(String firstck) { - this.firstck = firstck == null ? null : firstck.trim(); - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width == null ? null : width.trim(); - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height == null ? null : height.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getRadioBackground() { - return radioBackground; - } - - public void setRadioBackground(String radioBackground) { - this.radioBackground = radioBackground == null ? null : radioBackground.trim(); - } - - public String getRadioCkBackground() { - return radioCkBackground; - } - - public void setRadioCkBackground(String radioCkBackground) { - this.radioCkBackground = radioCkBackground == null ? null : radioCkBackground.trim(); - } - - public String getRadioSize() { - return radioSize; - } - - public void setRadioSize(String radioSize) { - this.radioSize = radioSize == null ? null : radioSize.trim(); - } - - public String getRadioCkSize() { - return radioCkSize; - } - - public void setRadioCkSize(String radioCkSize) { - this.radioCkSize = radioCkSize == null ? null : radioCkSize.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualTaskPoints.java b/src/com/sipai/entity/process/DataVisualTaskPoints.java deleted file mode 100644 index 1769b10b..00000000 --- a/src/com/sipai/entity/process/DataVisualTaskPoints.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualTaskPoints extends SQLAdapter { - private String id; - - private String taskid; - - private String pid; - - private String mqTheme; - - private String task_pointCode; - - private String task_name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid == null ? null : taskid.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getMqTheme() { - return mqTheme; - } - - public void setMqTheme(String mqTheme) { - this.mqTheme = mqTheme == null ? null : mqTheme.trim(); - } - - public String getTask_pointCode() { - return task_pointCode; - } - - public void setTask_pointCode(String task_pointCode) { - this.task_pointCode = task_pointCode; - } - - public String getTask_name() { - return task_name; - } - - public void setTask_name(String task_name) { - this.task_name = task_name; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualText.java b/src/com/sipai/entity/process/DataVisualText.java deleted file mode 100644 index 898fbf11..00000000 --- a/src/com/sipai/entity/process/DataVisualText.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class DataVisualText extends SQLAdapter { - public final static String Click_ShowFrame = "showFrame";//显示画面 - public final static String Click_OpenFrame = "openFrame";//打开画面 - public final static String Click_TabFrame = "tabFrame";//打开tab画面 - public final static String Click_OpenLine = "openLine";//打开曲线 - public final static String Click_RoundTime = "roundTime";//时间轮巡下的表格内容展示 - - private String id; - - private String pid; - - private String textcontent; - - private String mpid; - - private String unitst; - - private Integer fontsize; - - private String fontcolor; - - private Integer fontweight; - - private String background; - - private String style; - - private String clickname; - - private String clickparameter; - - private String textheight; - - private String textalign; - - private String valuemethod; - - private String rate; - - private String urldata; - - private String numtail; - - private String chartmpids; - - private String roundtimeid; - - private String urlstring; - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getTextcontent() { - return textcontent; - } - - public void setTextcontent(String textcontent) { - this.textcontent = textcontent == null ? null : textcontent.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getUnitst() { - return unitst; - } - - public void setUnitst(String unitst) { - this.unitst = unitst == null ? null : unitst.trim(); - } - - public Integer getFontsize() { - return fontsize; - } - - public void setFontsize(Integer fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public Integer getFontweight() { - return fontweight; - } - - public void setFontweight(Integer fontweight) { - this.fontweight = fontweight; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getClickname() { - return clickname; - } - - public void setClickname(String clickname) { - this.clickname = clickname == null ? null : clickname.trim(); - } - - public String getClickparameter() { - return clickparameter; - } - - public void setClickparameter(String clickparameter) { - this.clickparameter = clickparameter == null ? null : clickparameter.trim(); - } - - public String getTextheight() { - return textheight; - } - - public void setTextheight(String textheight) { - this.textheight = textheight == null ? null : textheight.trim(); - } - - public String getTextalign() { - return textalign; - } - - public void setTextalign(String textalign) { - this.textalign = textalign == null ? null : textalign.trim(); - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod == null ? null : valuemethod.trim(); - } - - public String getRate() { - return rate; - } - - public void setRate(String rate) { - this.rate = rate == null ? null : rate.trim(); - } - - public String getUrldata() { - return urldata; - } - - public void setUrldata(String urldata) { - this.urldata = urldata == null ? null : urldata.trim(); - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail == null ? null : numtail.trim(); - } - - public String getChartmpids() { - return chartmpids; - } - - public void setChartmpids(String chartmpids) { - this.chartmpids = chartmpids == null ? null : chartmpids.trim(); - } - - public String getRoundtimeid() { - return roundtimeid; - } - - public void setRoundtimeid(String roundtimeid) { - this.roundtimeid = roundtimeid == null ? null : roundtimeid.trim(); - } - - public String getUrlstring() { - return urlstring; - } - - public void setUrlstring(String urlstring) { - this.urlstring = urlstring == null ? null : urlstring.trim(); - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualTextWarehouse.java b/src/com/sipai/entity/process/DataVisualTextWarehouse.java deleted file mode 100644 index 22b3eb61..00000000 --- a/src/com/sipai/entity/process/DataVisualTextWarehouse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualTextWarehouse extends SQLAdapter{ - private String id; - - private String name; - - private Integer fontsize; - - private String fontcolor; - - private Integer fontweight; - - private String background; - - private String width; - - private String height; - - private String style; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getFontsize() { - return fontsize; - } - - public void setFontsize(Integer fontsize) { - this.fontsize = fontsize; - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor; - } - - public Integer getFontweight() { - return fontweight; - } - - public void setFontweight(Integer fontweight) { - this.fontweight = fontweight; - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualVoice.java b/src/com/sipai/entity/process/DataVisualVoice.java deleted file mode 100644 index aab71f4a..00000000 --- a/src/com/sipai/entity/process/DataVisualVoice.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualVoice extends SQLAdapter { - private String id; - - private String pid; - - private String text; - - private String method; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DataVisualWeather.java b/src/com/sipai/entity/process/DataVisualWeather.java deleted file mode 100644 index b1ee04d5..00000000 --- a/src/com/sipai/entity/process/DataVisualWeather.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DataVisualWeather extends SQLAdapter { - public final static String Type_Weather = "weather";//晴阴天等 - public final static String Type_Temp = "temp";//当前温度 - public final static String Type_Wind = "wind";//风向 - public final static String Type_WindPower = "windPower";//风力 - public final static String Type_Humidity = "humidity";//湿度 - - private String id; - - private String pid; - - private String type; - - private String background; - - private String fontsize; - - private String fontcolor; - - private String fontweight; - - private String styletype; - - private String textAlign; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getBackground() { - return background; - } - - public void setBackground(String background) { - this.background = background == null ? null : background.trim(); - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight == null ? null : fontweight.trim(); - } - - public String getStyletype() { - return styletype; - } - - public void setStyletype(String styletype) { - this.styletype = styletype == null ? null : styletype.trim(); - } - - public String getTextAlign() { - return textAlign; - } - - public void setTextAlign(String textAlign) { - this.textAlign = textAlign == null ? null : textAlign.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DecisionExpertBase.java b/src/com/sipai/entity/process/DecisionExpertBase.java deleted file mode 100644 index 04c7df7b..00000000 --- a/src/com/sipai/entity/process/DecisionExpertBase.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DecisionExpertBase extends SQLAdapter { - - public final static String Type_structure = "structure";//结构 - public final static String Type_content = "content";//内容 - - private String id; - - private String pid; - - private String name; - - private Integer morder; - - private String type; - - private String unitid; - - private String mpid; - - private String mainrole; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid == null ? null : unitid.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getMainrole() { - return mainrole; - } - - public void setMainrole(String mainrole) { - this.mainrole = mainrole == null ? null : mainrole.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/DecisionExpertBaseText.java b/src/com/sipai/entity/process/DecisionExpertBaseText.java deleted file mode 100644 index c091d05c..00000000 --- a/src/com/sipai/entity/process/DecisionExpertBaseText.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class DecisionExpertBaseText extends SQLAdapter { - public final static String Type_alarmmax = "0"; - public final static String Type_alarmmin = "1"; - public final static String Type_halarmmax = "2"; - public final static String Type_lalarmmin = "3"; - - private String id; - - private String pid; - - private String text; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text == null ? null : text.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/EquipmentAdjustment.java b/src/com/sipai/entity/process/EquipmentAdjustment.java deleted file mode 100644 index a91c1572..00000000 --- a/src/com/sipai/entity/process/EquipmentAdjustment.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - - -public class EquipmentAdjustment extends SQLAdapter { - - public final static String Status_NotStart="notstart";//开始 - public final static String Status_Start="start";//开始 - public final static String Status_Finish="finish";//完成 - - private String id; - - private String insuser; - - private String insdt; - - private String unitId; - - private String applyUser; - - private String applyTime; - - private String applyContent; - - private String feedbackUser; - - private String feedbackTime; - - private String feedbackContent; - - private String status; - - private String processid; - - private String processdefid; - - private EquipmentAdjustmentDetail equipmentAdjustmentDetail; - - private User user;//申请人对象 - - private User userF;//反馈人对象 - - private Company company; - - public User getUserF() { - return userF; - } - - public void setUserF(User userF) { - this.userF = userF; - } - - public String getFeedbackUser() { - return feedbackUser; - } - - public void setFeedbackUser(String feedbackUser) { - this.feedbackUser = feedbackUser; - } - - public String getFeedbackTime() { - return feedbackTime; - } - - public void setFeedbackTime(String feedbackTime) { - this.feedbackTime = feedbackTime; - } - - public String getFeedbackContent() { - return feedbackContent; - } - - public void setFeedbackContent(String feedbackContent) { - this.feedbackContent = feedbackContent; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getApplyUser() { - return applyUser; - } - - public void setApplyUser(String applyUser) { - this.applyUser = applyUser; - } - - public String getApplyTime() { - return applyTime; - } - - public void setApplyTime(String applyTime) { - this.applyTime = applyTime; - } - - public String getApplyContent() { - return applyContent; - } - - public void setApplyContent(String applyContent) { - this.applyContent = applyContent; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public EquipmentAdjustmentDetail getEquipmentAdjustmentDetail() { - return equipmentAdjustmentDetail; - } - - public void setEquipmentAdjustmentDetail(EquipmentAdjustmentDetail equipmentAdjustmentDetail) { - this.equipmentAdjustmentDetail = equipmentAdjustmentDetail; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/EquipmentAdjustmentDetail.java b/src/com/sipai/entity/process/EquipmentAdjustmentDetail.java deleted file mode 100644 index 1669a259..00000000 --- a/src/com/sipai/entity/process/EquipmentAdjustmentDetail.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -public class EquipmentAdjustmentDetail extends SQLAdapter { - private String id; - - private String insuser; - - private String insdt; - - private String equipmentId; - - private String adjustMode; - - private String adjustValue; - - private String pid; - - private String status; - - private EquipmentCard equipmentCard; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getAdjustMode() { - return adjustMode; - } - - public void setAdjustMode(String adjustMode) { - this.adjustMode = adjustMode; - } - - public String getAdjustValue() { - return adjustValue; - } - - public void setAdjustValue(String adjustValue) { - this.adjustValue = adjustValue; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryProcessAbnormal.java b/src/com/sipai/entity/process/LibraryProcessAbnormal.java deleted file mode 100644 index 447e771e..00000000 --- a/src/com/sipai/entity/process/LibraryProcessAbnormal.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 异常库(目前关联在工艺调整下) - * sj 2021-06-09 - */ -public class LibraryProcessAbnormal extends SQLAdapter { - - private ProcessAdjustmentType processAdjustmentType;//工艺调整类型表 - - private String id; - - private String abnormalCode; - - private String abnormalName; - - private String abnormalAnalysis; - - private String insdt; - - private String insuser; - - private String unitId; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getAbnormalCode() { - return abnormalCode; - } - - public void setAbnormalCode(String abnormalCode) { - this.abnormalCode = abnormalCode; - } - - public String getAbnormalName() { - return abnormalName; - } - - public void setAbnormalName(String abnormalName) { - this.abnormalName = abnormalName; - } - - public String getAbnormalAnalysis() { - return abnormalAnalysis; - } - - public void setAbnormalAnalysis(String abnormalAnalysis) { - this.abnormalAnalysis = abnormalAnalysis; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public ProcessAdjustmentType getProcessAdjustmentType() { - return processAdjustmentType; - } - - public void setProcessAdjustmentType(ProcessAdjustmentType processAdjustmentType) { - this.processAdjustmentType = processAdjustmentType; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryProcessAdjustment.java b/src/com/sipai/entity/process/LibraryProcessAdjustment.java deleted file mode 100644 index 895f4d48..00000000 --- a/src/com/sipai/entity/process/LibraryProcessAdjustment.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 工艺调整库 - * @author sj - * - */ -public class LibraryProcessAdjustment extends SQLAdapter { - - private ProcessAdjustmentType processAdjustmentType;//工艺调整类型表 - private LibraryProcessAbnormal libraryProcessAbnormal;//工艺异常表 - - private String id; - - private String pid; - - private String abnormalCode;//异常编号 - - private String abnormalName;//异常名称 - - private String abnormalAnalysis;//异常现象分析 - - private String proCode;//工艺调整代码 - - private String proName;//工艺调整名称 - - private String proMeasuresCode;//工艺调整措施代码 - - private String proMeasures;//工艺调整措施 - - private String monitorTarget;//监控指标 - - private String checkStandard;//验收标准 - - private float receiveRatedTime;//接单额定工时 - - private String insdt; - - private String insuser; - - private String unitId; - - public ProcessAdjustmentType getProcessAdjustmentType() { - return processAdjustmentType; - } - - public void setProcessAdjustmentType(ProcessAdjustmentType processAdjustmentType) { - this.processAdjustmentType = processAdjustmentType; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getAbnormalCode() { - return abnormalCode; - } - - public void setAbnormalCode(String abnormalCode) { - this.abnormalCode = abnormalCode; - } - - public String getAbnormalName() { - return abnormalName; - } - - public void setAbnormalName(String abnormalName) { - this.abnormalName = abnormalName; - } - - public String getAbnormalAnalysis() { - return abnormalAnalysis; - } - - public void setAbnormalAnalysis(String abnormalAnalysis) { - this.abnormalAnalysis = abnormalAnalysis; - } - - public String getProCode() { - return proCode; - } - - public void setProCode(String proCode) { - this.proCode = proCode; - } - - public String getProName() { - return proName; - } - - public void setProName(String proName) { - this.proName = proName; - } - - public String getProMeasuresCode() { - return proMeasuresCode; - } - - public void setProMeasuresCode(String proMeasuresCode) { - this.proMeasuresCode = proMeasuresCode; - } - - public String getProMeasures() { - return proMeasures; - } - - public void setProMeasures(String proMeasures) { - this.proMeasures = proMeasures; - } - - public String getMonitorTarget() { - return monitorTarget; - } - - public void setMonitorTarget(String monitorTarget) { - this.monitorTarget = monitorTarget; - } - - public String getCheckStandard() { - return checkStandard; - } - - public void setCheckStandard(String checkStandard) { - this.checkStandard = checkStandard; - } - - public float getReceiveRatedTime() { - return receiveRatedTime; - } - - public void setReceiveRatedTime(float receiveRatedTime) { - this.receiveRatedTime = receiveRatedTime; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public LibraryProcessAbnormal getLibraryProcessAbnormal() { - return libraryProcessAbnormal; - } - - public void setLibraryProcessAbnormal(LibraryProcessAbnormal libraryProcessAbnormal) { - this.libraryProcessAbnormal = libraryProcessAbnormal; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryProcessManage.java b/src/com/sipai/entity/process/LibraryProcessManage.java deleted file mode 100644 index a8d99899..00000000 --- a/src/com/sipai/entity/process/LibraryProcessManage.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryProcessManage extends SQLAdapter{ - - public static final String ControlLogic_H="H";//高于 - public static final String ControlLogic_L="L";//低于 - public static final String ControlLogic_I="I";//区间内 - - public static final String Cycle_Day="day";//天 - public static final String Cycle_Month="month";//月 - - private String id; - private String cycle; - private String code; - private String name; - private String area; - private String unit; - private String mpid; - private Double maxValue; - private Double minValue; - private Double targetValue; - private String controlLogic; - private Double baseHours; - private String remarks; - private String unitId; - private String status; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public Double getMaxValue() { - return maxValue; - } - - public void setMaxValue(Double maxValue) { - this.maxValue = maxValue; - } - - public Double getMinValue() { - return minValue; - } - - public void setMinValue(Double minValue) { - this.minValue = minValue; - } - - public Double getTargetValue() { - return targetValue; - } - - public void setTargetValue(Double targetValue) { - this.targetValue = targetValue; - } - - public String getControlLogic() { - return controlLogic; - } - - public void setControlLogic(String controlLogic) { - this.controlLogic = controlLogic; - } - - public Double getBaseHours() { - return baseHours; - } - - public void setBaseHours(Double baseHours) { - this.baseHours = baseHours; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryProcessManageDetail.java b/src/com/sipai/entity/process/LibraryProcessManageDetail.java deleted file mode 100644 index a3e41844..00000000 --- a/src/com/sipai/entity/process/LibraryProcessManageDetail.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class LibraryProcessManageDetail extends SQLAdapter { - - private MPoint mPoint; - - private String id; - - private String code; - - private String pid; - - private String measurePointId; - - private String evaluationRules; - - private String selectionMethod; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMeasurePointId() { - return measurePointId; - } - - public void setMeasurePointId(String measurePointId) { - this.measurePointId = measurePointId; - } - - public String getEvaluationRules() { - return evaluationRules; - } - - public void setEvaluationRules(String evaluationRules) { - this.evaluationRules = evaluationRules; - } - - public String getSelectionMethod() { - return selectionMethod; - } - - public void setSelectionMethod(String selectionMethod) { - this.selectionMethod = selectionMethod; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryProcessManageType.java b/src/com/sipai/entity/process/LibraryProcessManageType.java deleted file mode 100644 index 6c890b28..00000000 --- a/src/com/sipai/entity/process/LibraryProcessManageType.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.sipai.entity.process; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 过程控制类型 - * @author chengpj - * - */ -public class LibraryProcessManageType extends SQLAdapter{ - - private String id; - - private String name; - - private String status; - - private String code; - - private String unitId; - - private Integer morder; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryProcessManageWorkOrder.java b/src/com/sipai/entity/process/LibraryProcessManageWorkOrder.java deleted file mode 100644 index 6eaee3d9..00000000 --- a/src/com/sipai/entity/process/LibraryProcessManageWorkOrder.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryProcessManageWorkOrder extends SQLAdapter{ - - public static final String Status_0="0";//待实施 - public static final String Status_1="1";//待审核 - public static final String Status_2="2";//已完成 - - private String id; - - private String warehouseId;//库id - - private String insdt; - - private String insuser; - - private String unitId; - - private String status; - - private String issuedtime;//实施时间 - - private String issueder;//实施人 - private String _issueder;//实施人 - - private String reviewtime;//审核时间 - - private String reviewer;//审核人 - private String _reviewer;//审核人 - - private Double trueValue; - - private String controlMeasures; - - private Double trueHours; - - private LibraryProcessManage libraryProcessManage; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getIssuedtime() { - return issuedtime; - } - - public void setIssuedtime(String issuedtime) { - this.issuedtime = issuedtime; - } - - public String getIssueder() { - return issueder; - } - - public void setIssueder(String issueder) { - this.issueder = issueder; - } - - public String getReviewtime() { - return reviewtime; - } - - public void setReviewtime(String reviewtime) { - this.reviewtime = reviewtime; - } - - public String getReviewer() { - return reviewer; - } - - public void setReviewer(String reviewer) { - this.reviewer = reviewer; - } - - public Double getTrueValue() { - return trueValue; - } - - public void setTrueValue(Double trueValue) { - this.trueValue = trueValue; - } - - public String getControlMeasures() { - return controlMeasures; - } - - public void setControlMeasures(String controlMeasures) { - this.controlMeasures = controlMeasures; - } - - public Double getTrueHours() { - return trueHours; - } - - public void setTrueHours(Double trueHours) { - this.trueHours = trueHours; - } - - public LibraryProcessManage getLibraryProcessManage() { - return libraryProcessManage; - } - - public void setLibraryProcessManage(LibraryProcessManage libraryProcessManage) { - this.libraryProcessManage = libraryProcessManage; - } - - public String get_issueder() { - return _issueder; - } - - public void set_issueder(String _issueder) { - this._issueder = _issueder; - } - - public String get_reviewer() { - return _reviewer; - } - - public void set_reviewer(String _reviewer) { - this._reviewer = _reviewer; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryRoutineWork.java b/src/com/sipai/entity/process/LibraryRoutineWork.java deleted file mode 100644 index cd35f1de..00000000 --- a/src/com/sipai/entity/process/LibraryRoutineWork.java +++ /dev/null @@ -1,293 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import java.math.BigDecimal; - -/** - * 周期常规工作库 - * sj 2020-11-26 - */ -public class LibraryRoutineWork extends SQLAdapter { - - public final static String Frequency_Type_Day = "day";//每日 - public final static String Frequency_Type_Week = "week";//每周 - public final static String Frequency_Type_Month = "month";//每月 - public final static String Frequency_Type_Year = "year";//每年 - - public final static String Type_Run = "run";//行政 - public final static String Type_Manage = "manage";//运行 - - public final static String LastDay = "-1";//月最后天 - - private String id; - private String insdt; - private String insuser; - private String unitId; - private Integer morder; - private String positionTypeCode; - private String positionType; - private String workTypeCode; - private String workTypeName; - private String workCode; - private String workName; - private String workContent; - private String evaluationCriterion; - private String workFrequencyType; - private String workStartTime; - private Float baseHours; - private Float baseCost; - private Integer needPeople; - private String skillLevel; - private String robWorkorder; - private String remarks; - private String type; - private String dayRegister; - private String weekRegister; - private Integer weekInterval; - private String monthRegister; - - private String ppositionType; - private String pworkTypeName; - private String ppositionTypeCode; - private String pworkTypeNameCode; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getPositionTypeCode() { - return positionTypeCode; - } - - public void setPositionTypeCode(String positionTypeCode) { - this.positionTypeCode = positionTypeCode; - } - - public String getPositionType() { - return positionType; - } - - public void setPositionType(String positionType) { - this.positionType = positionType; - } - - public String getWorkTypeCode() { - return workTypeCode; - } - - public void setWorkTypeCode(String workTypeCode) { - this.workTypeCode = workTypeCode; - } - - public String getWorkTypeName() { - return workTypeName; - } - - public void setWorkTypeName(String workTypeName) { - this.workTypeName = workTypeName; - } - - public String getWorkCode() { - return workCode; - } - - public void setWorkCode(String workCode) { - this.workCode = workCode; - } - - public String getWorkName() { - return workName; - } - - public void setWorkName(String workName) { - this.workName = workName; - } - - public String getWorkContent() { - return workContent; - } - - public void setWorkContent(String workContent) { - this.workContent = workContent; - } - - public String getEvaluationCriterion() { - return evaluationCriterion; - } - - public void setEvaluationCriterion(String evaluationCriterion) { - this.evaluationCriterion = evaluationCriterion; - } - - public String getWorkFrequencyType() { - return workFrequencyType; - } - - public void setWorkFrequencyType(String workFrequencyType) { - this.workFrequencyType = workFrequencyType; - } - - public String getWorkStartTime() { - return workStartTime; - } - - public void setWorkStartTime(String workStartTime) { - this.workStartTime = workStartTime; - } - - public Integer getNeedPeople() { - return needPeople; - } - - public void setNeedPeople(Integer needPeople) { - this.needPeople = needPeople; - } - - public String getSkillLevel() { - return skillLevel; - } - - public void setSkillLevel(String skillLevel) { - this.skillLevel = skillLevel; - } - - public String getRobWorkorder() { - return robWorkorder; - } - - public void setRobWorkorder(String robWorkorder) { - this.robWorkorder = robWorkorder; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDayRegister() { - return dayRegister; - } - - public void setDayRegister(String dayRegister) { - this.dayRegister = dayRegister; - } - - public String getWeekRegister() { - return weekRegister; - } - - public void setWeekRegister(String weekRegister) { - this.weekRegister = weekRegister; - } - - public Integer getWeekInterval() { - return weekInterval; - } - - public void setWeekInterval(Integer weekInterval) { - this.weekInterval = weekInterval; - } - - public String getMonthRegister() { - return monthRegister; - } - - public void setMonthRegister(String monthRegister) { - this.monthRegister = monthRegister; - } - - public Float getBaseHours() { - return baseHours; - } - - public void setBaseHours(Float baseHours) { - this.baseHours = baseHours; - } - - public Float getBaseCost() { - return baseCost; - } - - public void setBaseCost(Float baseCost) { - this.baseCost = baseCost; - } - - public String getPpositionType() { - return ppositionType; - } - - public void setPpositionType(String ppositionType) { - this.ppositionType = ppositionType; - } - - public String getPworkTypeName() { - return pworkTypeName; - } - - public void setPworkTypeName(String pworkTypeName) { - this.pworkTypeName = pworkTypeName; - } - - public String getPpositionTypeCode() { - return ppositionTypeCode; - } - - public void setPpositionTypeCode(String ppositionTypeCode) { - this.ppositionTypeCode = ppositionTypeCode; - } - - public String getPworkTypeNameCode() { - return pworkTypeNameCode; - } - - public void setPworkTypeNameCode(String pworkTypeNameCode) { - this.pworkTypeNameCode = pworkTypeNameCode; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/LibraryWaterTest.java b/src/com/sipai/entity/process/LibraryWaterTest.java deleted file mode 100644 index c33e0500..00000000 --- a/src/com/sipai/entity/process/LibraryWaterTest.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -/** - * 水质化验库 - * sj 2020-11-28 - */ -public class LibraryWaterTest extends SQLAdapter { - private MPoint mPoint; - - private String id; - - private String insdt; - - private String insuser; - - private String unitId; - - private Integer morder; - - private String code; - - private String name; - - private String measurePointId; - - private String method; - - private float baseHours; - - private float baseCost; - - private String safeCareful; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMeasurePointId() { - return measurePointId; - } - - public void setMeasurePointId(String measurePointId) { - this.measurePointId = measurePointId; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public float getBaseHours() { - return baseHours; - } - - public void setBaseHours(float baseHours) { - this.baseHours = baseHours; - } - - public float getBaseCost() { - return baseCost; - } - - public void setBaseCost(float baseCost) { - this.baseCost = baseCost; - } - - public String getSafeCareful() { - return safeCareful; - } - - public void setSafeCareful(String safeCareful) { - this.safeCareful = safeCareful; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/MeterCheck.java b/src/com/sipai/entity/process/MeterCheck.java deleted file mode 100644 index 6031d1cb..00000000 --- a/src/com/sipai/entity/process/MeterCheck.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class MeterCheck extends SQLAdapter { - private String id; - - private String libraryId; - - private String xjId; - - private String inputUser; - - private Double inputValue; - - private String inputTime; - - private Double mpValue; - - private String unitId; - - private String libraryName; - - private String inputUserName; - - private String xjName; - - private String _targetValue; - private String _targetValue2; - private String _targetValueType; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getLibraryId() { - return libraryId; - } - - public void setLibraryId(String libraryId) { - this.libraryId = libraryId == null ? null : libraryId.trim(); - } - - public String getXjId() { - return xjId; - } - - public void setXjId(String xjId) { - this.xjId = xjId == null ? null : xjId.trim(); - } - - public String getInputUser() { - return inputUser; - } - - public void setInputUser(String inputUser) { - this.inputUser = inputUser == null ? null : inputUser.trim(); - } - - public Double getInputValue() { - return inputValue; - } - - public void setInputValue(Double inputValue) { - this.inputValue = inputValue; - } - - public String getInputTime() { - return inputTime; - } - - public void setInputTime(String inputTime) { - this.inputTime = inputTime; - } - - public Double getMpValue() { - return mpValue; - } - - public void setMpValue(Double mpValue) { - this.mpValue = mpValue; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getLibraryName() { - return libraryName; - } - - public void setLibraryName(String libraryName) { - this.libraryName = libraryName; - } - - public String getInputUserName() { - return inputUserName; - } - - public void setInputUserName(String inputUserName) { - this.inputUserName = inputUserName; - } - - public String getXjName() { - return xjName; - } - - public void setXjName(String xjName) { - this.xjName = xjName; - } - - public String get_targetValue() { - return _targetValue; - } - - public void set_targetValue(String _targetValue) { - this._targetValue = _targetValue; - } - - public String get_targetValue2() { - return _targetValue2; - } - - public void set_targetValue2(String _targetValue2) { - this._targetValue2 = _targetValue2; - } - - public String get_targetValueType() { - return _targetValueType; - } - - public void set_targetValueType(String _targetValueType) { - this._targetValueType = _targetValueType; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/MeterCheckLibrary.java b/src/com/sipai/entity/process/MeterCheckLibrary.java deleted file mode 100644 index 06b47c50..00000000 --- a/src/com/sipai/entity/process/MeterCheckLibrary.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class MeterCheckLibrary extends SQLAdapter { - - public final static String Targetvalue_Type_Percent = "percent";//百分比 - public final static String Targetvalue_Type_Value = "value";//值 - - private String id; - - private String name; - - private String mpid; - - private String mpidRg; - - private String unitId; - - private Integer morder; - - private String targetvalue; - - private String targetvalue2; - - private String targetvaluetype; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getMpidRg() { - return mpidRg; - } - - public void setMpidRg(String mpidRg) { - this.mpidRg = mpidRg == null ? null : mpidRg.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getTargetvalue() { - return targetvalue; - } - - public void setTargetvalue(String targetvalue) { - this.targetvalue = targetvalue == null ? null : targetvalue.trim(); - } - - public String getTargetvalue2() { - return targetvalue2; - } - - public void setTargetvalue2(String targetvalue2) { - this.targetvalue2 = targetvalue2 == null ? null : targetvalue2.trim(); - } - - public String getTargetvaluetype() { - return targetvaluetype; - } - - public void setTargetvaluetype(String targetvaluetype) { - this.targetvaluetype = targetvaluetype == null ? null : targetvaluetype.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/ProcessAdjustment.java b/src/com/sipai/entity/process/ProcessAdjustment.java deleted file mode 100644 index 0150e3b5..00000000 --- a/src/com/sipai/entity/process/ProcessAdjustment.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -public class ProcessAdjustment extends BusinessUnitAdapter{ - public final static String Status_Start="start";//开始 - public final static String Status_Finish="finish";//完成 - - private Company company; - private ProcessAdjustmentType processAdjustmentType; - private User user; - - private String id; - - private String insdt; - - private String insuser; - - private String contents; - - private String jobNumber; - - private String abnormalCode; - - private String abnormalName; - - private String abnormalAnalysis; - - private String remarks; - - private String targetUserId; - - private String targetUserIds; - - private float evaluateScore; - - private float evaluateWeight; - - private float coordinationScore; - - private float coordinationWeight; - - private float totalScore; - - private float baseHours; - - private float workingHours; - - private String checkExplain; - - private String typeId; - - private String unitId; - - private String status; - - private String processid; - - private String processdefid; - - private String targetUser;//用于查询审核人 - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public ProcessAdjustmentType getProcessAdjustmentType() { - return processAdjustmentType; - } - - public void setProcessAdjustmentType(ProcessAdjustmentType processAdjustmentType) { - this.processAdjustmentType = processAdjustmentType; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - @Override - public String getInsuser() { - return insuser; - } - - @Override - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getAbnormalCode() { - return abnormalCode; - } - - public void setAbnormalCode(String abnormalCode) { - this.abnormalCode = abnormalCode; - } - - public String getAbnormalName() { - return abnormalName; - } - - public void setAbnormalName(String abnormalName) { - this.abnormalName = abnormalName; - } - - public String getAbnormalAnalysis() { - return abnormalAnalysis; - } - - public void setAbnormalAnalysis(String abnormalAnalysis) { - this.abnormalAnalysis = abnormalAnalysis; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getTargetUserId() { - return targetUserId; - } - - public void setTargetUserId(String targetUserId) { - this.targetUserId = targetUserId; - } - - public String getTargetUserIds() { - return targetUserIds; - } - - public void setTargetUserIds(String targetUserIds) { - this.targetUserIds = targetUserIds; - } - - public String getTypeId() { - return typeId; - } - - public void setTypeId(String typeId) { - this.typeId = typeId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - @Override - public String getProcessid() { - return processid; - } - - @Override - public void setProcessid(String processid) { - this.processid = processid; - } - - @Override - public String getProcessdefid() { - return processdefid; - } - - @Override - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getTargetUser() { - return targetUser; - } - - public void setTargetUser(String targetUser) { - this.targetUser = targetUser; - } - - public float getEvaluateScore() { - return evaluateScore; - } - - public void setEvaluateScore(float evaluateScore) { - this.evaluateScore = evaluateScore; - } - - public float getEvaluateWeight() { - return evaluateWeight; - } - - public void setEvaluateWeight(float evaluateWeight) { - this.evaluateWeight = evaluateWeight; - } - - public float getCoordinationScore() { - return coordinationScore; - } - - public void setCoordinationScore(float coordinationScore) { - this.coordinationScore = coordinationScore; - } - - public float getCoordinationWeight() { - return coordinationWeight; - } - - public void setCoordinationWeight(float coordinationWeight) { - this.coordinationWeight = coordinationWeight; - } - - public float getTotalScore() { - return totalScore; - } - - public void setTotalScore(float totalScore) { - this.totalScore = totalScore; - } - - public float getBaseHours() { - return baseHours; - } - - public void setBaseHours(float baseHours) { - this.baseHours = baseHours; - } - - public float getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(float workingHours) { - this.workingHours = workingHours; - } - - public String getCheckExplain() { - return checkExplain; - } - - public void setCheckExplain(String checkExplain) { - this.checkExplain = checkExplain; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/ProcessAdjustmentContent.java b/src/com/sipai/entity/process/ProcessAdjustmentContent.java deleted file mode 100644 index a7837c91..00000000 --- a/src/com/sipai/entity/process/ProcessAdjustmentContent.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.document.DocFileRelation; - - -/** - * 工艺调整内容 - * sj 2021-09-26 - */ -public class ProcessAdjustmentContent extends SQLAdapter { - - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String libraryId; - - private String abnormalCode; - - private String abnormalName; - - private String proCode; - - private String proName; - - private String proMeasures; - - private float receiveRatedTime; - - private String remark; - - private DocFileRelation docFileRelation; - private LibraryProcessAdjustment libraryProcessAdjustment; - - public DocFileRelation getDocFileRelation() { - return docFileRelation; - } - - public void setDocFileRelation(DocFileRelation docFileRelation) { - this.docFileRelation = docFileRelation; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getLibraryId() { - return libraryId; - } - - public void setLibraryId(String libraryId) { - this.libraryId = libraryId; - } - - public String getAbnormalCode() { - return abnormalCode; - } - - public void setAbnormalCode(String abnormalCode) { - this.abnormalCode = abnormalCode; - } - - public String getAbnormalName() { - return abnormalName; - } - - public void setAbnormalName(String abnormalName) { - this.abnormalName = abnormalName; - } - - public String getProCode() { - return proCode; - } - - public void setProCode(String proCode) { - this.proCode = proCode; - } - - public String getProName() { - return proName; - } - - public void setProName(String proName) { - this.proName = proName; - } - - public String getProMeasures() { - return proMeasures; - } - - public void setProMeasures(String proMeasures) { - this.proMeasures = proMeasures; - } - - public float getReceiveRatedTime() { - return receiveRatedTime; - } - - public void setReceiveRatedTime(float receiveRatedTime) { - this.receiveRatedTime = receiveRatedTime; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public LibraryProcessAdjustment getLibraryProcessAdjustment() { - return libraryProcessAdjustment; - } - - public void setLibraryProcessAdjustment(LibraryProcessAdjustment libraryProcessAdjustment) { - this.libraryProcessAdjustment = libraryProcessAdjustment; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/ProcessAdjustmentType.java b/src/com/sipai/entity/process/ProcessAdjustmentType.java deleted file mode 100644 index 290f1f17..00000000 --- a/src/com/sipai/entity/process/ProcessAdjustmentType.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 工艺调整类型 - * @author sj - * - */ -public class ProcessAdjustmentType extends SQLAdapter{ - - private String id; - - private String insuser; - - private String insdt; - - private String uptuser; - - private String uptdt; - - private String name; - - private String status; - - private String code; - - private String unitId; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUptuser() { - return uptuser; - } - - public void setUptuser(String uptuser) { - this.uptuser = uptuser; - } - - public String getUptdt() { - return uptdt; - } - - public void setUptdt(String uptdt) { - this.uptdt = uptdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/ProcessSectionInformation.java b/src/com/sipai/entity/process/ProcessSectionInformation.java deleted file mode 100644 index b897975e..00000000 --- a/src/com/sipai/entity/process/ProcessSectionInformation.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.ProcessSection; - -public class ProcessSectionInformation extends SQLAdapter { - private String id; - - private String processSectionId; - - private String content; - - private String insuser; - - private String insdt; - - private String bizid; - - private String audioPath; - - private Integer morder; - - private Integer state; - - private ProcessSection processSection; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getAudioPath() { - return audioPath; - } - - public void setAudioPath(String audioPath) { - this.audioPath = audioPath; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getState() { - return state; - } - - public void setState(Integer state) { - this.state = state; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/ProcessWebsite.java b/src/com/sipai/entity/process/ProcessWebsite.java deleted file mode 100644 index 86b15039..00000000 --- a/src/com/sipai/entity/process/ProcessWebsite.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.process; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ProcessWebsite extends SQLAdapter{ - private String id; - - private String name; - - private String website; - - private Integer ord; - - private String insuser; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getWebsite() { - return website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/RoutineWork.java b/src/com/sipai/entity/process/RoutineWork.java deleted file mode 100644 index cc4f2af5..00000000 --- a/src/com/sipai/entity/process/RoutineWork.java +++ /dev/null @@ -1,282 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.User; - -/** - * 周期常规工作工单 - * sj 2020-11-26 - */ -public class RoutineWork extends BusinessUnitAdapter { - private LibraryRoutineWork libraryRoutineWork; - private User sendUser; - private User receiveUser; - public final static String Status_NotStart="notStart";//开始 - public final static String Status_Start="start";//开始 - public final static String Status_Receive="receive";//已接单 - public final static String Status_Finish="finish";//完成 - - private String id; - - private String insdt; - - private String insuser; - - private String unitId; - - private String morder; - - private String jobNumber; - - private String libraryId; - - private String planStartDate; - - private float actualCost; - - private String sendUserId; - - private String receiveUserIds; - - private String receiveUserId; - - private float actualTime; - - private String rewardTime; - - private float workingHours; - - private String comments; - - private String checkTime; - - private String remarks; - - private String status; - - private String processdefid; - - private String processid; - - private String receiveUsersName; - - private String type; - - private Integer listSize; - - public String getReceiveUsersName() { - return receiveUsersName; - } - - public void setReceiveUsersName(String receiveUsersName) { - this.receiveUsersName = receiveUsersName; - } - - public LibraryRoutineWork getLibraryRoutineWork() { - return libraryRoutineWork; - } - - public void setLibraryRoutineWork(LibraryRoutineWork libraryRoutineWork) { - this.libraryRoutineWork = libraryRoutineWork; - } - - public User getSendUser() { - return sendUser; - } - - public void setSendUser(User sendUser) { - this.sendUser = sendUser; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getMorder() { - return morder; - } - - public void setMorder(String morder) { - this.morder = morder; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getLibraryId() { - return libraryId; - } - - public void setLibraryId(String libraryId) { - this.libraryId = libraryId; - } - - public String getPlanStartDate() { - return planStartDate; - } - - public void setPlanStartDate(String planStartDate) { - this.planStartDate = planStartDate; - } - - public float getActualCost() { - return actualCost; - } - - public void setActualCost(float actualCost) { - this.actualCost = actualCost; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public float getActualTime() { - return actualTime; - } - - public void setActualTime(float actualTime) { - this.actualTime = actualTime; - } - - public String getRewardTime() { - return rewardTime; - } - - public void setRewardTime(String rewardTime) { - this.rewardTime = rewardTime; - } - - public float getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(float workingHours) { - this.workingHours = workingHours; - } - - public String getComments() { - return comments; - } - - public void setComments(String comments) { - this.comments = comments; - } - - public String getCheckTime() { - return checkTime; - } - - public void setCheckTime(String checkTime) { - this.checkTime = checkTime; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getListSize() { - return listSize; - } - - public void setListSize(Integer listSize) { - this.listSize = listSize; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/TestIndexManage.java b/src/com/sipai/entity/process/TestIndexManage.java deleted file mode 100644 index b08fb63e..00000000 --- a/src/com/sipai/entity/process/TestIndexManage.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.entity.process; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class TestIndexManage extends SQLAdapter{ - //启用状态 - public final static String Active_true="1";//启用 - public final static String Active_false="0";//禁用 - - //周期类别 - public final static String CycleType_hour="hour";//小时 - public final static String CycleType_day="day";//天 - - private String id; - private String insdt; - private String insuser; - private String updt; - private String upuser; - private String name; - private Integer cycle; - private String cycletype; - private String method; - private String instrument; - private String medicament; - private String matters; - private String referencerange; - private String active; - private String unitid; - - private String methodname; - private List testMethodsList; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpdt() { - return updt; - } - - public void setUpdt(String updt) { - this.updt = updt; - } - - public String getUpuser() { - return upuser; - } - - public void setUpuser(String upuser) { - this.upuser = upuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getCycle() { - return cycle; - } - - public void setCycle(Integer cycle) { - this.cycle = cycle; - } - - public String getCycletype() { - return cycletype; - } - - public void setCycletype(String cycletype) { - this.cycletype = cycletype; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getInstrument() { - return instrument; - } - - public void setInstrument(String instrument) { - this.instrument = instrument; - } - - public String getMedicament() { - return medicament; - } - - public void setMedicament(String medicament) { - this.medicament = medicament; - } - - public String getMatters() { - return matters; - } - - public void setMatters(String matters) { - this.matters = matters; - } - - public String getReferencerange() { - return referencerange; - } - - public void setReferencerange(String referencerange) { - this.referencerange = referencerange; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public List getTestMethodsList() { - return testMethodsList; - } - - public void setTestMethodsList(List testMethodsList) { - this.testMethodsList = testMethodsList; - } - - public String getMethodname() { - return methodname; - } - - public void setMethodname(String methodname) { - this.methodname = methodname; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/TestMethods.java b/src/com/sipai/entity/process/TestMethods.java deleted file mode 100644 index a50972c5..00000000 --- a/src/com/sipai/entity/process/TestMethods.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class TestMethods extends SQLAdapter{ - //启用状态 - public final static String Active_true="1";//启用 - public final static String Active_false="0";//禁用 - - private String id; - - private String name; - - private String describe; - - private String indexitem; - - private String steps; - - private String matters; - - private String active; - - private String insdt; - - private String insuser; - - private String updt; - - private String upuser; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public String getIndexitem() { - return indexitem; - } - - public void setIndexitem(String indexitem) { - this.indexitem = indexitem; - } - - public String getSteps() { - return steps; - } - - public void setSteps(String steps) { - this.steps = steps; - } - - public String getMatters() { - return matters; - } - - public void setMatters(String matters) { - this.matters = matters; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpdt() { - return updt; - } - - public void setUpdt(String updt) { - this.updt = updt; - } - - public String getUpuser() { - return upuser; - } - - public void setUpuser(String upuser) { - this.upuser = upuser; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/TestTask.java b/src/com/sipai/entity/process/TestTask.java deleted file mode 100644 index f9d01a78..00000000 --- a/src/com/sipai/entity/process/TestTask.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; - -public class TestTask extends SQLAdapter{ - //流程状态 - public final static String Status_0="0";//新增未下发 - public final static String Status_1="1";//已下发或者被领用 - public final static String Status_2="2";//完成化验任务单 - - //计划 - public final static String PlanType_0="0";//常规 - public final static String PlanType_1="1";//临时 - - private String id; - private String insdt; - private String insuser; - private String plantype; - private String status; - private String sender; - private String senddt; - private String receiver; - private String receivdt; - private String reviewer; - private String reviewedt; - private String unitid; - private String testindexmanageid; - private Double resultvalue; - private String resultremarks; - private String sendname; - private String receivname; - private String reviewname; - private TestIndexManage testIndexManage; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPlantype() { - return plantype; - } - - public void setPlantype(String plantype) { - this.plantype = plantype; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getSender() { - return sender; - } - - public void setSender(String sender) { - this.sender = sender; - } - - public String getSenddt() { - return senddt; - } - - public void setSenddt(String senddt) { - this.senddt = senddt; - } - - public String getReceiver() { - return receiver; - } - - public void setReceiver(String receiver) { - this.receiver = receiver; - } - - public String getReceivdt() { - return receivdt; - } - - public void setReceivdt(String receivdt) { - this.receivdt = receivdt; - } - - public String getReviewer() { - return reviewer; - } - - public void setReviewer(String reviewer) { - this.reviewer = reviewer; - } - - public String getReviewedt() { - return reviewedt; - } - - public void setReviewedt(String reviewedt) { - this.reviewedt = reviewedt; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getTestindexmanageid() { - return testindexmanageid; - } - - public void setTestindexmanageid(String testindexmanageid) { - this.testindexmanageid = testindexmanageid; - } - - public Double getResultvalue() { - return resultvalue; - } - - public void setResultvalue(Double resultvalue) { - this.resultvalue = resultvalue; - } - - public String getResultremarks() { - return resultremarks; - } - - public void setResultremarks(String resultremarks) { - this.resultremarks = resultremarks; - } - - public String getSendname() { - return sendname; - } - - public void setSendname(String sendname) { - this.sendname = sendname; - } - - public String getReceivname() { - return receivname; - } - - public void setReceivname(String receivname) { - this.receivname = receivname; - } - - public String getReviewname() { - return reviewname; - } - - public void setReviewname(String reviewname) { - this.reviewname = reviewname; - } - - public TestIndexManage getTestIndexManage() { - return testIndexManage; - } - - public void setTestIndexManage(TestIndexManage testIndexManage) { - this.testIndexManage = testIndexManage; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/WaterTest.java b/src/com/sipai/entity/process/WaterTest.java deleted file mode 100644 index b73292a3..00000000 --- a/src/com/sipai/entity/process/WaterTest.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.User; - -/** - * 水质化验工单 - * sj 2020-11-28 - */ -public class WaterTest extends BusinessUnitAdapter { - - public final static String Job_Type_Huanbao = "huanbao";//环保 - public final static String Job_Type_Linshi = "linshi";//临时 - public final static String Job_Type_Richang = "richang";//日常 - - public final static String Status_Start="start";//开始 - public final static String Status_Receive="receive";//已接单 - public final static String Status_Finish="finish";//完成 - - private String id; - - private String insdt; - - private String insuser; - - private String unitId; - - private Integer morder; - - private String jobNumber;//工单号 - - private String jobType;//工单类型 - - private String sendUserId; - - private String sendTime; - - private String receiveUserIds; - - private String receiveUserId; - - private String receiveDt; - - private String actualTime; - - private float actualCost; - - private float workingHours; - - private String processdefid; - - private String processid; - - private String status; - - private String receiveUsersName; - - private User sendUser;//发单人 - private User receiveUser;//接单人 - - public User getSendUser() { - return sendUser; - } - - public void setSendUser(User sendUser) { - this.sendUser = sendUser; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getReceiveUsersName() { - return receiveUsersName; - } - - public void setReceiveUsersName(String receiveUsersName) { - this.receiveUsersName = receiveUsersName; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getJobType() { - return jobType; - } - - public void setJobType(String jobType) { - this.jobType = jobType; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getSendTime() { - return sendTime; - } - - public void setSendTime(String sendTime) { - this.sendTime = sendTime; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getReceiveDt() { - return receiveDt; - } - - public void setReceiveDt(String receiveDt) { - this.receiveDt = receiveDt; - } - - public String getActualTime() { - return actualTime; - } - - public void setActualTime(String actualTime) { - this.actualTime = actualTime; - } - - public float getActualCost() { - return actualCost; - } - - public void setActualCost(float actualCost) { - this.actualCost = actualCost; - } - - public float getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(float workingHours) { - this.workingHours = workingHours; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/process/WaterTestDetail.java b/src/com/sipai/entity/process/WaterTestDetail.java deleted file mode 100644 index f83dd86c..00000000 --- a/src/com/sipai/entity/process/WaterTestDetail.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.sipai.entity.process; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.document.DocFileRelation; - -/** - * 水质化验工单(附表) - * sj 2020-11-28 - */ -public class WaterTestDetail extends SQLAdapter { - - private LibraryWaterTest libraryWaterTest; - - private String id; - - private String insdt; - - private String insuser; - - private Integer morder; - - private String libraryId;//库id - - private float actualTime; - - private float actualCost; - - private String implementUserId;//实施人id - - private String implementUserName; - - private String pid; - - private DocFileRelation docFileRelation; - - public String getImplementUserName() { - return implementUserName; - } - - public void setImplementUserName(String implementUserName) { - this.implementUserName = implementUserName; - } - - public String getId() { - return id; - } - - public LibraryWaterTest getLibraryWaterTest() { - return libraryWaterTest; - } - - public void setLibraryWaterTest(LibraryWaterTest libraryWaterTest) { - this.libraryWaterTest = libraryWaterTest; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getLibraryId() { - return libraryId; - } - - public void setLibraryId(String libraryId) { - this.libraryId = libraryId; - } - - public float getActualTime() { - return actualTime; - } - - public void setActualTime(float actualTime) { - this.actualTime = actualTime; - } - - public float getActualCost() { - return actualCost; - } - - public void setActualCost(float actualCost) { - this.actualCost = actualCost; - } - - public String getImplementUserId() { - return implementUserId; - } - - public void setImplementUserId(String implementUserId) { - this.implementUserId = implementUserId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public DocFileRelation getDocFileRelation() { - return docFileRelation; - } - - public void setDocFileRelation(DocFileRelation docFileRelation) { - this.docFileRelation = docFileRelation; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/question/QuesOption.java b/src/com/sipai/entity/question/QuesOption.java deleted file mode 100644 index c996d6d5..00000000 --- a/src/com/sipai/entity/question/QuesOption.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.question; - -import com.sipai.entity.base.SQLAdapter; - -public class QuesOption extends SQLAdapter { - private String id; - - private String optioncontent; - - private String status; - - private Integer ord; - - private String questitleid; - - private String optionvalue; - - private String optionnumber; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getOptioncontent() { - return optioncontent; - } - - public void setOptioncontent(String optioncontent) { - this.optioncontent = optioncontent; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getQuestitleid() { - return questitleid; - } - - public void setQuestitleid(String questitleid) { - this.questitleid = questitleid; - } - - public String getOptionvalue() { - return optionvalue; - } - - public void setOptionvalue(String optionvalue) { - this.optionvalue = optionvalue; - } - - public String getOptionnumber() { - return optionnumber; - } - - public void setOptionnumber(String optionnumber) { - this.optionnumber = optionnumber; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/question/QuesTitle.java b/src/com/sipai/entity/question/QuesTitle.java deleted file mode 100644 index 60489b01..00000000 --- a/src/com/sipai/entity/question/QuesTitle.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.entity.question; - -import com.sipai.entity.base.SQLAdapter; - - -public class QuesTitle extends SQLAdapter { - private String id; - - private String quesdescript; - - private String status; - - private Integer ord; - - private String subjecttypeid; - private String _subjectTypeName; - - private String ranktypeid; - private String _rankTypeName; - - private String questtypeid; - private String _questTypeName; - - private String code; - - private String insuser; - private String _insusername; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String testpoint; - - private String analysis; - - private int num; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getQuesdescript() { - return quesdescript; - } - - public void setQuesdescript(String quesdescript) { - this.quesdescript = quesdescript; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getSubjecttypeid() { - return subjecttypeid; - } - - public void setSubjecttypeid(String subjecttypeid) { - this.subjecttypeid = subjecttypeid; - } - - public String getRanktypeid() { - return ranktypeid; - } - - public void setRanktypeid(String ranktypeid) { - this.ranktypeid = ranktypeid; - } - - public String getQuesttypeid() { - return questtypeid; - } - - public void setQuesttypeid(String questtypeid) { - this.questtypeid = questtypeid; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String get_subjectTypeName() { - return _subjectTypeName; - } - - public void set_subjectTypeName(String _subjectTypeName) { - this._subjectTypeName = _subjectTypeName; - } - - public String get_rankTypeName() { - return _rankTypeName; - } - - public void set_rankTypeName(String _rankTypeName) { - this._rankTypeName = _rankTypeName; - } - - public String get_questTypeName() { - return _questTypeName; - } - - public void set_questTypeName(String _questTypeName) { - this._questTypeName = _questTypeName; - } - - public String get_insusername() { - return _insusername; - } - - public void set_insusername(String _insusername) { - this._insusername = _insusername; - } - - public String getAnalysis() { - return analysis; - } - - public void setAnalysis(String analysis) { - this.analysis = analysis; - } - - public String getTestpoint() { - return testpoint; - } - - public void setTestpoint(String testpoint) { - this.testpoint = testpoint; - } - - public int getNum() { - return num; - } - - public void setNum(int num) { - this.num = num; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/question/QuestType.java b/src/com/sipai/entity/question/QuestType.java deleted file mode 100644 index a9c3ccf2..00000000 --- a/src/com/sipai/entity/question/QuestType.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.sipai.entity.question; - -import com.sipai.entity.base.SQLAdapter; - -public class QuestType extends SQLAdapter { - private String id; - - private String code; - - private String name; - - private String memo; - - private String status; - - private Integer ord; - - private String insertuserid; - - private String insertdate; - - private String updateuserid; - - private String updatedate; - - private String answertype; - -// private Integer choosenum; -// -// private Integer choosequest; -// -// private Integer haveundernum; -// -// private String valuetype; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsertuserid() { - return insertuserid; - } - - public void setInsertuserid(String insertuserid) { - this.insertuserid = insertuserid; - } - - public String getInsertdate() { - return insertdate; - } - - public void setInsertdate(String insertdate) { - this.insertdate = insertdate; - } - - public String getUpdateuserid() { - return updateuserid; - } - - public void setUpdateuserid(String updateuserid) { - this.updateuserid = updateuserid; - } - - public String getUpdatedate() { - return updatedate; - } - - public void setUpdatedate(String updatedate) { - this.updatedate = updatedate; - } - - public String getAnswertype() { - return answertype; - } - - public void setAnswertype(String answertype) { - this.answertype = answertype; - } - -// public Integer getChoosenum() { -// return choosenum; -// } -// -// public void setChoosenum(Integer choosenum) { -// this.choosenum = choosenum; -// } -// -// public Integer getChoosequest() { -// return choosequest; -// } -// -// public void setChoosequest(Integer choosequest) { -// this.choosequest = choosequest; -// } -// -// public Integer getHaveundernum() { -// return haveundernum; -// } -// -// public void setHaveundernum(Integer haveundernum) { -// this.haveundernum = haveundernum; -// } -// -// public String getValuetype() { -// return valuetype; -// } -// -// public void setValuetype(String valuetype) { -// this.valuetype = valuetype; -// } -} \ No newline at end of file diff --git a/src/com/sipai/entity/question/RankType.java b/src/com/sipai/entity/question/RankType.java deleted file mode 100644 index 10f3854e..00000000 --- a/src/com/sipai/entity/question/RankType.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.question; - -import com.sipai.entity.base.SQLAdapter; - - -public class RankType extends SQLAdapter { - private String id; - - private String code; - - private String name; - - private String memo; - - private String status; - - private Integer ord; - - private String insertuserid; - - private String insertdate; - - private String updateuserid; - - private String updatedate; - - private String difficultyrank; - - private String _insertusername; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsertuserid() { - return insertuserid; - } - - public void setInsertuserid(String insertuserid) { - this.insertuserid = insertuserid; - } - - public String getInsertdate() { - return insertdate; - } - - public void setInsertdate(String insertdate) { - this.insertdate = insertdate; - } - - public String getUpdateuserid() { - return updateuserid; - } - - public void setUpdateuserid(String updateuserid) { - this.updateuserid = updateuserid; - } - - public String getUpdatedate() { - return updatedate; - } - - public void setUpdatedate(String updatedate) { - this.updatedate = updatedate; - } - - public String get_insertusername() { - return _insertusername; - } - - public void set_insertusername(String _insertusername) { - this._insertusername = _insertusername; - } - - public String getDifficultyrank() { - return difficultyrank; - } - - public void setDifficultyrank(String difficultyrank) { - this.difficultyrank = difficultyrank; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/question/Subjecttype.java b/src/com/sipai/entity/question/Subjecttype.java deleted file mode 100644 index 31b601dd..00000000 --- a/src/com/sipai/entity/question/Subjecttype.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.entity.question; - -import com.sipai.entity.base.SQLAdapter; - -public class Subjecttype extends SQLAdapter{ - private String id; - - private String name; - - private String pid; - - private String st; - - private Integer ord; - - private String memo; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String code; - - private String pname; - - private String _pname; - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getSt() { - return st; - } - - public void setSt(String st) { - this.st = st; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/CustomReport.java b/src/com/sipai/entity/report/CustomReport.java deleted file mode 100644 index bcab68df..00000000 --- a/src/com/sipai/entity/report/CustomReport.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - -public class CustomReport extends SQLAdapter{ - - public final static String Type_group="0";//结构 - public final static String Type_sys="1";//系统方案 - public final static String Type_user="2";//个人方案 - - //频率类型 - public final static String frequencyType_min="0";//分钟 - public final static String frequencyType_hour="1";//小时 - public final static String frequencyType_day="2";//天 - public final static String frequencyType_month="3";//月 - - private String id; - - - private String insdt; - - private String insuser; - - private String unitId; - - private String name; - - private Integer frequency;//频率 - - private String frequencytype;//频率类型 分、小时、天等 - - private String pid; - - private String type;// 0结构 1系统方案 2个人方案 - - private String calculation;//计算方式 first,avg,max,min,diff - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getFrequency() { - return frequency; - } - - public void setFrequency(Integer frequency) { - this.frequency = frequency; - } - - public String getFrequencytype() { - return frequencytype; - } - - public void setFrequencytype(String frequencytype) { - this.frequencytype = frequencytype; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getCalculation() { - return calculation; - } - - public void setCalculation(String calculation) { - this.calculation = calculation; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/CustomReportMPoint.java b/src/com/sipai/entity/report/CustomReportMPoint.java deleted file mode 100644 index 0c081da9..00000000 --- a/src/com/sipai/entity/report/CustomReportMPoint.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Unit; - -public class CustomReportMPoint extends SQLAdapter{ - private String id; - - private String pid; - - private String insdt; - - private String insuser; - - private String mpointId; - - private String unitId; - - private Integer morder; - - private MPoint mPoint; - - private Unit unit; - - private String unitText; - - private String eName; - - public String getUnitText() { - return unitText; - } - - public void setUnitText(String unitText) { - this.unitText = unitText; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMpointId() { - return mpointId; - } - - public void setMpointId(String mpointId) { - this.mpointId = mpointId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public String geteName() { - return eName; - } - - public void seteName(String eName) { - this.eName = eName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/DrainageDataomprehensiveTable.java b/src/com/sipai/entity/report/DrainageDataomprehensiveTable.java deleted file mode 100644 index 370e4810..00000000 --- a/src/com/sipai/entity/report/DrainageDataomprehensiveTable.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - - -public class DrainageDataomprehensiveTable extends SQLAdapter{ - private String id; - - private String insdt; - - private String unitId; - - private String valueid; - - private Double turevalue; - - private Double lastyearvalue; - - private Double lastyeardiffvalue; - - private Double targetdiffvalue; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getValueid() { - return valueid; - } - - public void setValueid(String valueid) { - this.valueid = valueid; - } - - public Double getTurevalue() { - return turevalue; - } - - public void setTurevalue(Double turevalue) { - this.turevalue = turevalue; - } - - public Double getLastyearvalue() { - return lastyearvalue; - } - - public void setLastyearvalue(Double lastyearvalue) { - this.lastyearvalue = lastyearvalue; - } - - public Double getLastyeardiffvalue() { - return lastyeardiffvalue; - } - - public void setLastyeardiffvalue(Double lastyeardiffvalue) { - this.lastyeardiffvalue = lastyeardiffvalue; - } - - public Double getTargetdiffvalue() { - return targetdiffvalue; - } - - public void setTargetdiffvalue(Double targetdiffvalue) { - this.targetdiffvalue = targetdiffvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/DrainageDataomprehensiveTableConfigure.java b/src/com/sipai/entity/report/DrainageDataomprehensiveTableConfigure.java deleted file mode 100644 index e4dd8dd1..00000000 --- a/src/com/sipai/entity/report/DrainageDataomprehensiveTableConfigure.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - -public class DrainageDataomprehensiveTableConfigure extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizid; - - private String pid; - - private String name;//名称 - private String _pname;//名称 - - private String active;//是否启用 - - private Integer morder;//排序 - - private String mpid;//关联测量点 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/DrainageDataomprehensiveTableMainconfigure.java b/src/com/sipai/entity/report/DrainageDataomprehensiveTableMainconfigure.java deleted file mode 100644 index 951f85a9..00000000 --- a/src/com/sipai/entity/report/DrainageDataomprehensiveTableMainconfigure.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - -public class DrainageDataomprehensiveTableMainconfigure extends SQLAdapter{ - private String id; - - private String insuser; - private String _insuser; - - private String insdt; - - private String remark; - - private String name; - - private Integer morder; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String get_insuser() { - return _insuser; - } - - public void set_insuser(String _insuser) { - this._insuser = _insuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/DrainageDataomprehensiveTableMainconfigureDetail.java b/src/com/sipai/entity/report/DrainageDataomprehensiveTableMainconfigureDetail.java deleted file mode 100644 index c9b28391..00000000 --- a/src/com/sipai/entity/report/DrainageDataomprehensiveTableMainconfigureDetail.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - -public class DrainageDataomprehensiveTableMainconfigureDetail extends SQLAdapter{ - - private String id; - - private String insdt; - - private String insuser; - private String _insuser; - - private String pid; - - private String name; - - private Double targetValue; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String get_insuser() { - return _insuser; - } - - public void set_insuser(String _insuser) { - this._insuser = _insuser; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Double getTargetValue() { - return targetValue; - } - - public void setTargetValue(Double targetValue) { - this.targetValue = targetValue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportEnergy10KVDay.java b/src/com/sipai/entity/report/ReportEnergy10KVDay.java deleted file mode 100644 index 57fc0836..00000000 --- a/src/com/sipai/entity/report/ReportEnergy10KVDay.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ReportEnergy10KVDay extends SQLAdapter{ - private String time; - private ReportEnergyPumpParam pump1;//1#泵房 - private ReportEnergyPumpParam pump2;//2#泵房 - private ReportEnergyPumpParam pump3;//3#泵房 - private ReportEnergyPumpParam pump4;//4#泵房 - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public ReportEnergyPumpParam getPump1() { - return pump1; - } - public void setPump1(ReportEnergyPumpParam pump1) { - this.pump1 = pump1; - } - public ReportEnergyPumpParam getPump2() { - return pump2; - } - public void setPump2(ReportEnergyPumpParam pump2) { - this.pump2 = pump2; - } - public ReportEnergyPumpParam getPump3() { - return pump3; - } - public void setPump3(ReportEnergyPumpParam pump3) { - this.pump3 = pump3; - } - public ReportEnergyPumpParam getPump4() { - return pump4; - } - public void setPump4(ReportEnergyPumpParam pump4) { - this.pump4 = pump4; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportEnergyPump.java b/src/com/sipai/entity/report/ReportEnergyPump.java deleted file mode 100644 index 51235d2e..00000000 --- a/src/com/sipai/entity/report/ReportEnergyPump.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -/** - * - * @author 12235 - * - */ -public class ReportEnergyPump extends SQLAdapter{ - private String time; - private ReportEnergyPumpParam pump1;//1#泵房 - private ReportEnergyPumpParam pump2;//2#泵房 - private ReportEnergyPumpParam pump3;//3#泵房 - private ReportEnergyPumpParam pump4;//4#泵房 - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public ReportEnergyPumpParam getPump1() { - return pump1; - } - public void setPump1(ReportEnergyPumpParam pump1) { - this.pump1 = pump1; - } - public ReportEnergyPumpParam getPump2() { - return pump2; - } - public void setPump2(ReportEnergyPumpParam pump2) { - this.pump2 = pump2; - } - public ReportEnergyPumpParam getPump3() { - return pump3; - } - public void setPump3(ReportEnergyPumpParam pump3) { - this.pump3 = pump3; - } - public ReportEnergyPumpParam getPump4() { - return pump4; - } - public void setPump4(ReportEnergyPumpParam pump4) { - this.pump4 = pump4; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportEnergyPumpParam.java b/src/com/sipai/entity/report/ReportEnergyPumpParam.java deleted file mode 100644 index 4940a5ae..00000000 --- a/src/com/sipai/entity/report/ReportEnergyPumpParam.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ReportEnergyPumpParam extends SQLAdapter{ - private String t; - private String i; - private String p; - private String e; - public String getT() { - return t; - } - public void setT(String t) { - this.t = t; - } - public String getI() { - return i; - } - public void setI(String i) { - this.i = i; - } - public String getP() { - return p; - } - public void setP(String p) { - this.p = p; - } - public String getE() { - return e; - } - public void setE(String e) { - this.e = e; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportResult.java b/src/com/sipai/entity/report/ReportResult.java deleted file mode 100644 index 2d496be8..00000000 --- a/src/com/sipai/entity/report/ReportResult.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.entity.report; - -public class ReportResult { - public boolean merged; - public int startRow; - public int endRow; - public int startCol; - public int endCol; - public ReportResult(boolean merged,int startRow,int endRow - ,int startCol,int endCol){ - this.merged = merged; - this.startRow = startRow; - this.endRow = endRow; - this.startCol = startCol; - this.endCol = endCol; - } -} diff --git a/src/com/sipai/entity/report/ReportTemplate.java b/src/com/sipai/entity/report/ReportTemplate.java deleted file mode 100644 index 7a247f35..00000000 --- a/src/com/sipai/entity/report/ReportTemplate.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ReportTemplate extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String typeId; - - private String name; - - private String remark; - - private String bizId; - - private TemplateType templateType; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getTypeId() { - return typeId; - } - - public void setTypeId(String typeId) { - this.typeId = typeId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public TemplateType getTemplateType() { - return templateType; - } - - public void setTemplateType(TemplateType templateType) { - this.templateType = templateType; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportWaterBackWashEquipment.java b/src/com/sipai/entity/report/ReportWaterBackWashEquipment.java deleted file mode 100644 index 81da7dc2..00000000 --- a/src/com/sipai/entity/report/ReportWaterBackWashEquipment.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.sipai.entity.report; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ReportWaterBackWashEquipment extends SQLAdapter{ - - private String time;//时间点 - - //1#罗茨风机参数 - private String statusA; - private BigDecimal rateA; - private BigDecimal runTimeA; - private BigDecimal currentA; - private BigDecimal pressureA; - //2#罗茨风机参数 - private String statusB; - private BigDecimal rateB; - private BigDecimal runTimeB; - private BigDecimal currentB; - private BigDecimal pressureB; - - private BigDecimal generalFlow;//气冲总管流量 - private BigDecimal generalPressure;//气冲总管压力 - //1#反冲洗水泵参数 - private String statusC; - private BigDecimal rateC; - private BigDecimal runTimeC; - private BigDecimal currentC; - private BigDecimal pressureC; - //2#反冲洗水泵参数 - private String statusD; - private BigDecimal rateD; - private BigDecimal runTimeD; - private BigDecimal currentD; - private BigDecimal pressureD; - - private BigDecimal flowRate;//瞬时流量 - private BigDecimal totalFlow;//累计流量 - - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - - public BigDecimal getRateA() { - return rateA; - } - public void setRateA(BigDecimal rateA) { - this.rateA = rateA; - } - public BigDecimal getRunTimeA() { - return runTimeA; - } - public void setRunTimeA(BigDecimal runTimeA) { - this.runTimeA = runTimeA; - } - public BigDecimal getCurrentA() { - return currentA; - } - public void setCurrentA(BigDecimal currentA) { - this.currentA = currentA; - } - public BigDecimal getPressureA() { - return pressureA; - } - public void setPressureA(BigDecimal pressureA) { - this.pressureA = pressureA; - } - public BigDecimal getRateB() { - return rateB; - } - public void setRateB(BigDecimal rateB) { - this.rateB = rateB; - } - public BigDecimal getRunTimeB() { - return runTimeB; - } - public void setRunTimeB(BigDecimal runTimeB) { - this.runTimeB = runTimeB; - } - public BigDecimal getCurrentB() { - return currentB; - } - public void setCurrentB(BigDecimal currentB) { - this.currentB = currentB; - } - public BigDecimal getPressureB() { - return pressureB; - } - public void setPressureB(BigDecimal pressureB) { - this.pressureB = pressureB; - } - public BigDecimal getGeneralFlow() { - return generalFlow; - } - public void setGeneralFlow(BigDecimal generalFlow) { - this.generalFlow = generalFlow; - } - public BigDecimal getGeneralPressure() { - return generalPressure; - } - public void setGeneralPressure(BigDecimal generalPressure) { - this.generalPressure = generalPressure; - } - public BigDecimal getRateC() { - return rateC; - } - public void setRateC(BigDecimal rateC) { - this.rateC = rateC; - } - public BigDecimal getRunTimeC() { - return runTimeC; - } - public void setRunTimeC(BigDecimal runTimeC) { - this.runTimeC = runTimeC; - } - public BigDecimal getCurrentC() { - return currentC; - } - public void setCurrentC(BigDecimal currentC) { - this.currentC = currentC; - } - public BigDecimal getPressureC() { - return pressureC; - } - public void setPressureC(BigDecimal pressureC) { - this.pressureC = pressureC; - } - public BigDecimal getRateD() { - return rateD; - } - public void setRateD(BigDecimal rateD) { - this.rateD = rateD; - } - public BigDecimal getRunTimeD() { - return runTimeD; - } - public void setRunTimeD(BigDecimal runTimeD) { - this.runTimeD = runTimeD; - } - public BigDecimal getCurrentD() { - return currentD; - } - public void setCurrentD(BigDecimal currentD) { - this.currentD = currentD; - } - public BigDecimal getPressureD() { - return pressureD; - } - public void setPressureD(BigDecimal pressureD) { - this.pressureD = pressureD; - } - public BigDecimal getTotalFlow() { - return totalFlow; - } - public void setTotalFlow(BigDecimal totalFlow) { - this.totalFlow = totalFlow; - } - public String getStatusA() { - return statusA; - } - public void setStatusA(String statusA) { - this.statusA = statusA; - } - public String getStatusB() { - return statusB; - } - public void setStatusB(String statusB) { - this.statusB = statusB; - } - public String getStatusC() { - return statusC; - } - public void setStatusC(String statusC) { - this.statusC = statusC; - } - public String getStatusD() { - return statusD; - } - public void setStatusD(String statusD) { - this.statusD = statusD; - } - public BigDecimal getFlowRate() { - return flowRate; - } - public void setFlowRate(BigDecimal flowRate) { - this.flowRate = flowRate; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportWaterInAndOutFlow.java b/src/com/sipai/entity/report/ReportWaterInAndOutFlow.java deleted file mode 100644 index 4cd8f48f..00000000 --- a/src/com/sipai/entity/report/ReportWaterInAndOutFlow.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.sipai.entity.report; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ReportWaterInAndOutFlow extends SQLAdapter{ - - private String time;//时间点 - //1#气浮池进水流量 - private BigDecimal flowRateA; - private BigDecimal totalFlowA; - //2#气浮池进水流量 - private BigDecimal flowRateB; - private BigDecimal totalFlowB; - //3#气浮池进水流量 - private BigDecimal flowRateC; - private BigDecimal totalFlowC; - //4#气浮池进水流量 - private BigDecimal flowRateD; - private BigDecimal totalFlowD; - //5#气浮池进水流量 - private BigDecimal flowRateE; - private BigDecimal totalFlowE; - //6#气浮池进水流量 - private BigDecimal flowRateF; - private BigDecimal totalFlowF; - //总进水流量 - private BigDecimal flowRateG; - private BigDecimal totalFlowG; - //回流至气浮池流量 - private BigDecimal flowRateH; - private BigDecimal totalFlowH; - //回流至臭氧接触池 - private BigDecimal flowRateI; - private BigDecimal totalFlowI; - //出水至南郊水厂 - private BigDecimal flowRateJ; - private BigDecimal totalFlowJ; - //1#出厂总管流量及压力 - private BigDecimal flowRateK; - private BigDecimal totalFlowK; - private BigDecimal pressureK; - //2#出厂总管流量及压力 - private BigDecimal flowRateL; - private BigDecimal totalFlowL; - private BigDecimal pressureL; - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public BigDecimal getFlowRateA() { - return flowRateA; - } - public void setFlowRateA(BigDecimal flowRateA) { - this.flowRateA = flowRateA; - } - public BigDecimal getTotalFlowA() { - return totalFlowA; - } - public void setTotalFlowA(BigDecimal totalFlowA) { - this.totalFlowA = totalFlowA; - } - public BigDecimal getFlowRateB() { - return flowRateB; - } - public void setFlowRateB(BigDecimal flowRateB) { - this.flowRateB = flowRateB; - } - public BigDecimal getTotalFlowB() { - return totalFlowB; - } - public void setTotalFlowB(BigDecimal totalFlowB) { - this.totalFlowB = totalFlowB; - } - public BigDecimal getFlowRateC() { - return flowRateC; - } - public void setFlowRateC(BigDecimal flowRateC) { - this.flowRateC = flowRateC; - } - public BigDecimal getTotalFlowC() { - return totalFlowC; - } - public void setTotalFlowC(BigDecimal totalFlowC) { - this.totalFlowC = totalFlowC; - } - public BigDecimal getFlowRateD() { - return flowRateD; - } - public void setFlowRateD(BigDecimal flowRateD) { - this.flowRateD = flowRateD; - } - public BigDecimal getTotalFlowD() { - return totalFlowD; - } - public void setTotalFlowD(BigDecimal totalFlowD) { - this.totalFlowD = totalFlowD; - } - public BigDecimal getFlowRateE() { - return flowRateE; - } - public void setFlowRateE(BigDecimal flowRateE) { - this.flowRateE = flowRateE; - } - public BigDecimal getTotalFlowE() { - return totalFlowE; - } - public void setTotalFlowE(BigDecimal totalFlowE) { - this.totalFlowE = totalFlowE; - } - public BigDecimal getFlowRateF() { - return flowRateF; - } - public void setFlowRateF(BigDecimal flowRateF) { - this.flowRateF = flowRateF; - } - public BigDecimal getTotalFlowF() { - return totalFlowF; - } - public void setTotalFlowF(BigDecimal totalFlowF) { - this.totalFlowF = totalFlowF; - } - public BigDecimal getFlowRateG() { - return flowRateG; - } - public void setFlowRateG(BigDecimal flowRateG) { - this.flowRateG = flowRateG; - } - public BigDecimal getTotalFlowG() { - return totalFlowG; - } - public void setTotalFlowG(BigDecimal totalFlowG) { - this.totalFlowG = totalFlowG; - } - public BigDecimal getFlowRateH() { - return flowRateH; - } - public void setFlowRateH(BigDecimal flowRateH) { - this.flowRateH = flowRateH; - } - public BigDecimal getTotalFlowH() { - return totalFlowH; - } - public void setTotalFlowH(BigDecimal totalFlowH) { - this.totalFlowH = totalFlowH; - } - public BigDecimal getFlowRateI() { - return flowRateI; - } - public void setFlowRateI(BigDecimal flowRateI) { - this.flowRateI = flowRateI; - } - public BigDecimal getTotalFlowI() { - return totalFlowI; - } - public void setTotalFlowI(BigDecimal totalFlowI) { - this.totalFlowI = totalFlowI; - } - public BigDecimal getFlowRateJ() { - return flowRateJ; - } - public void setFlowRateJ(BigDecimal flowRateJ) { - this.flowRateJ = flowRateJ; - } - public BigDecimal getTotalFlowJ() { - return totalFlowJ; - } - public void setTotalFlowJ(BigDecimal totalFlowJ) { - this.totalFlowJ = totalFlowJ; - } - public BigDecimal getFlowRateK() { - return flowRateK; - } - public void setFlowRateK(BigDecimal flowRateK) { - this.flowRateK = flowRateK; - } - public BigDecimal getTotalFlowK() { - return totalFlowK; - } - public void setTotalFlowK(BigDecimal totalFlowK) { - this.totalFlowK = totalFlowK; - } - public BigDecimal getPressureK() { - return pressureK; - } - public void setPressureK(BigDecimal pressureK) { - this.pressureK = pressureK; - } - public BigDecimal getFlowRateL() { - return flowRateL; - } - public void setFlowRateL(BigDecimal flowRateL) { - this.flowRateL = flowRateL; - } - public BigDecimal getTotalFlowL() { - return totalFlowL; - } - public void setTotalFlowL(BigDecimal totalFlowL) { - this.totalFlowL = totalFlowL; - } - public BigDecimal getPressureL() { - return pressureL; - } - public void setPressureL(BigDecimal pressureL) { - this.pressureL = pressureL; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportWaterOutletPump.java b/src/com/sipai/entity/report/ReportWaterOutletPump.java deleted file mode 100644 index 934701c3..00000000 --- a/src/com/sipai/entity/report/ReportWaterOutletPump.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.sipai.entity.report; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ReportWaterOutletPump extends SQLAdapter{ - - private String time;//时间点 - //1#泵 - private String statusA; - private BigDecimal rateA; - private BigDecimal runTimeA; - private BigDecimal currentA; - private BigDecimal flowRateA; - private BigDecimal totalFlowA; - private BigDecimal pressureA; - //2#泵 - private String statusB; - private BigDecimal rateB; - private BigDecimal runTimeB; - private BigDecimal currentB; - private BigDecimal flowRateB; - private BigDecimal totalFlowB; - private BigDecimal pressureB; - //3#泵 - private String statusC; - private BigDecimal rateC; - private BigDecimal runTimeC; - private BigDecimal currentC; - private BigDecimal flowRateC; - private BigDecimal totalFlowC; - private BigDecimal pressureC; - //4#泵 - private String statusD; - private BigDecimal rateD; - private BigDecimal runTimeD; - private BigDecimal currentD; - private BigDecimal flowRateD; - private BigDecimal totalFlowD; - private BigDecimal pressureD; - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public String getStatusA() { - return statusA; - } - public void setStatusA(String statusA) { - this.statusA = statusA; - } - public BigDecimal getRateA() { - return rateA; - } - public void setRateA(BigDecimal rateA) { - this.rateA = rateA; - } - public BigDecimal getRunTimeA() { - return runTimeA; - } - public void setRunTimeA(BigDecimal runTimeA) { - this.runTimeA = runTimeA; - } - public BigDecimal getCurrentA() { - return currentA; - } - public void setCurrentA(BigDecimal currentA) { - this.currentA = currentA; - } - public BigDecimal getFlowRateA() { - return flowRateA; - } - public void setFlowRateA(BigDecimal flowRateA) { - this.flowRateA = flowRateA; - } - public BigDecimal getTotalFlowA() { - return totalFlowA; - } - public void setTotalFlowA(BigDecimal totalFlowA) { - this.totalFlowA = totalFlowA; - } - public BigDecimal getPressureA() { - return pressureA; - } - public void setPressureA(BigDecimal pressureA) { - this.pressureA = pressureA; - } - public String getStatusB() { - return statusB; - } - public void setStatusB(String statusB) { - this.statusB = statusB; - } - public BigDecimal getRateB() { - return rateB; - } - public void setRateB(BigDecimal rateB) { - this.rateB = rateB; - } - public BigDecimal getRunTimeB() { - return runTimeB; - } - public void setRunTimeB(BigDecimal runTimeB) { - this.runTimeB = runTimeB; - } - public BigDecimal getCurrentB() { - return currentB; - } - public void setCurrentB(BigDecimal currentB) { - this.currentB = currentB; - } - public BigDecimal getFlowRateB() { - return flowRateB; - } - public void setFlowRateB(BigDecimal flowRateB) { - this.flowRateB = flowRateB; - } - public BigDecimal getTotalFlowB() { - return totalFlowB; - } - public void setTotalFlowB(BigDecimal totalFlowB) { - this.totalFlowB = totalFlowB; - } - public BigDecimal getPressureB() { - return pressureB; - } - public void setPressureB(BigDecimal pressureB) { - this.pressureB = pressureB; - } - public String getStatusC() { - return statusC; - } - public void setStatusC(String statusC) { - this.statusC = statusC; - } - public BigDecimal getRateC() { - return rateC; - } - public void setRateC(BigDecimal rateC) { - this.rateC = rateC; - } - public BigDecimal getRunTimeC() { - return runTimeC; - } - public void setRunTimeC(BigDecimal runTimeC) { - this.runTimeC = runTimeC; - } - public BigDecimal getCurrentC() { - return currentC; - } - public void setCurrentC(BigDecimal currentC) { - this.currentC = currentC; - } - public BigDecimal getFlowRateC() { - return flowRateC; - } - public void setFlowRateC(BigDecimal flowRateC) { - this.flowRateC = flowRateC; - } - public BigDecimal getTotalFlowC() { - return totalFlowC; - } - public void setTotalFlowC(BigDecimal totalFlowC) { - this.totalFlowC = totalFlowC; - } - public BigDecimal getPressureC() { - return pressureC; - } - public void setPressureC(BigDecimal pressureC) { - this.pressureC = pressureC; - } - public String getStatusD() { - return statusD; - } - public void setStatusD(String statusD) { - this.statusD = statusD; - } - public BigDecimal getRateD() { - return rateD; - } - public void setRateD(BigDecimal rateD) { - this.rateD = rateD; - } - public BigDecimal getRunTimeD() { - return runTimeD; - } - public void setRunTimeD(BigDecimal runTimeD) { - this.runTimeD = runTimeD; - } - public BigDecimal getCurrentD() { - return currentD; - } - public void setCurrentD(BigDecimal currentD) { - this.currentD = currentD; - } - public BigDecimal getFlowRateD() { - return flowRateD; - } - public void setFlowRateD(BigDecimal flowRateD) { - this.flowRateD = flowRateD; - } - public BigDecimal getTotalFlowD() { - return totalFlowD; - } - public void setTotalFlowD(BigDecimal totalFlowD) { - this.totalFlowD = totalFlowD; - } - public BigDecimal getPressureD() { - return pressureD; - } - public void setPressureD(BigDecimal pressureD) { - this.pressureD = pressureD; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/ReportWaterTlc.java b/src/com/sipai/entity/report/ReportWaterTlc.java deleted file mode 100644 index 9284a2a1..00000000 --- a/src/com/sipai/entity/report/ReportWaterTlc.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.entity.report; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -/** - * 工艺参数日/月报表 - 炭滤池,17个测量点 - * @author 12235 - * - */ -public class ReportWaterTlc extends SQLAdapter{ - private String time; - private BigDecimal param1; - private BigDecimal param2; - private BigDecimal param3; - private BigDecimal param4; - private BigDecimal param5; - private BigDecimal param6; - private BigDecimal param7; - private BigDecimal param8; - private BigDecimal param9; - private BigDecimal param10; - private BigDecimal param11; - private BigDecimal param12; - private BigDecimal param13; - private BigDecimal param14; - private BigDecimal param15; - private BigDecimal param16; - private BigDecimal param17; - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public BigDecimal getParam1() { - return param1; - } - public void setParam1(BigDecimal param1) { - this.param1 = param1; - } - public BigDecimal getParam2() { - return param2; - } - public void setParam2(BigDecimal param2) { - this.param2 = param2; - } - public BigDecimal getParam3() { - return param3; - } - public void setParam3(BigDecimal param3) { - this.param3 = param3; - } - public BigDecimal getParam4() { - return param4; - } - public void setParam4(BigDecimal param4) { - this.param4 = param4; - } - public BigDecimal getParam5() { - return param5; - } - public void setParam5(BigDecimal param5) { - this.param5 = param5; - } - public BigDecimal getParam6() { - return param6; - } - public void setParam6(BigDecimal param6) { - this.param6 = param6; - } - public BigDecimal getParam7() { - return param7; - } - public void setParam7(BigDecimal param7) { - this.param7 = param7; - } - public BigDecimal getParam8() { - return param8; - } - public void setParam8(BigDecimal param8) { - this.param8 = param8; - } - public BigDecimal getParam9() { - return param9; - } - public void setParam9(BigDecimal param9) { - this.param9 = param9; - } - public BigDecimal getParam10() { - return param10; - } - public void setParam10(BigDecimal param10) { - this.param10 = param10; - } - public BigDecimal getParam11() { - return param11; - } - public void setParam11(BigDecimal param11) { - this.param11 = param11; - } - public BigDecimal getParam12() { - return param12; - } - public void setParam12(BigDecimal param12) { - this.param12 = param12; - } - public BigDecimal getParam13() { - return param13; - } - public void setParam13(BigDecimal param13) { - this.param13 = param13; - } - public BigDecimal getParam14() { - return param14; - } - public void setParam14(BigDecimal param14) { - this.param14 = param14; - } - public BigDecimal getParam15() { - return param15; - } - public void setParam15(BigDecimal param15) { - this.param15 = param15; - } - public BigDecimal getParam16() { - return param16; - } - public void setParam16(BigDecimal param16) { - this.param16 = param16; - } - public BigDecimal getParam17() { - return param17; - } - public void setParam17(BigDecimal param17) { - this.param17 = param17; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptCollectMode.java b/src/com/sipai/entity/report/RptCollectMode.java deleted file mode 100644 index 881199b5..00000000 --- a/src/com/sipai/entity/report/RptCollectMode.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class RptCollectMode extends SQLAdapter{ - private String id; - - private String name; - - private String content; - - private String insdt; - - private String insuser; - - private String remark; - - private String status; - - private String bizId; - - private String code; - - private String pid; - - private Long morder; - - private String unitId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Long getMorder() { - return morder; - } - - public void setMorder(Long morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptCreate.java b/src/com/sipai/entity/report/RptCreate.java deleted file mode 100644 index 28bbc0c2..00000000 --- a/src/com/sipai/entity/report/RptCreate.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -/** - * 报表生成记录 - * - * @author sj - */ -public class RptCreate extends BusinessUnitAdapter { - - public static final String Type_Temp = "temp";//生成类型为临时报表,用于报表模板预览 - public static final String nameSpace = "RptInfoSetFile"; - public static final String BaseFolderName = "UploadFile"; - - -// public static final String RptCreate_Status_Apply = "0";//未审核 -// public static final String RptCreate_MemoType_Apply = "未审核";//未审核历史表状态 -// -// public static final String RptCreate_Status_Success = "1";//审核通过 -// public static final String RptCreate_MemoType_Success = "审核通过";//审核通过历史表状态,包含自审(非审核报表)或者领导审核(审核报表) -// -// /** -// * 正在审核 -// */ -// public static final String RPTCREATE_STATUS_REVIEWING = "2";//正在审核 -// public static final String RPTCREATE_MEMOTYPE_REVIEWING = "正在审核中";//正在审核中 -// /** -// * 待申请审核 -// */ -// public static final String RptCreate_STATUS_WAIT = "3";//待申请审核 -// public static final String RPTCREATE_MEMOTYPE_WAIT = "submit_report_handle";//待申请审核 -// /** -// * 审核人员审核中 -// */ -// public static final String RPTCREATE_STATUS_AUDITORS = "4";//审核人员审核中 -// public static final String RPTCREATE_MEMOTYPE_AUDITORS = "report_personnel_audit";//审核人员审核中 -// /** -// * 厂长审核中 -// */ -// public static final String RPTCREATE_STATUS_FACTORY_DIRECTOR = "5";//厂长审核中 -// public static final String RPTCREATE_MEMOTYPE_FACTORY_DIRECTOR = "factory_manager_audit";//厂长审核中 -// /** -// * 生产部审核中 -// */ -// public static final String RPTCREATE_STATUS_PRODUCTION_DEPARTMENT = "6";//生产部审核中 -// public static final String RPTCREATE_MEMOTYPE_PRODUCTION_DEPARTMENT = "production_department_audit";//生产部审核中 - - public final static String Status_Start = "start";//开始 - public final static String Status_Finish = "finish";//完成 - - public static final String RptCreate_Color_Success = "#409EFF";//审核通过,蓝色 - - - private static final long serialVersionUID = -6011822015502496287L; - - private String id; - - //报表模板ID - private String rptsetId; - - //生成报表的名称 - private String rptname; - - //报表时间 - private String rptdt; - - private String insuser; - - private String insdt; - - //修改人ID - private String upsuser; - - //修改时间 - private String upsdt; - - //备注 - private String memo; - - //工厂 - private String bizId; - - private String unitId; - - //负责人ID - private String inputuser; - private String inputusername; - - private String status; - - //审核人ID - private String checkuser; - private String checkusername; - - //审核时间 - private String checkdt; - - private String processdefid; - - private String processid; - - //报表文件路径 - private String abspath; - - private String type; - - private RptInfoSet rptInfoSet; - - public String getCheckusername() { - return checkusername; - } - - public void setCheckusername(String checkusername) { - this.checkusername = checkusername; - } - - public RptInfoSet getRptInfoSet() { - return rptInfoSet; - } - - public void setRptInfoSet(RptInfoSet rptInfoSet) { - this.rptInfoSet = rptInfoSet; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRptsetId() { - return rptsetId; - } - - public void setRptsetId(String rptsetId) { - this.rptsetId = rptsetId; - } - - public String getRptname() { - return rptname; - } - - public void setRptname(String rptname) { - this.rptname = rptname; - } - - public String getRptdt() { - return rptdt; - } - - public void setRptdt(String rptdt) { - this.rptdt = rptdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getInputuser() { - return inputuser; - } - - public void setInputuser(String inputuser) { - this.inputuser = inputuser; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getCheckuser() { - return checkuser; - } - - public void setCheckuser(String checkuser) { - this.checkuser = checkuser; - } - - public String getCheckdt() { - return checkdt; - } - - public void setCheckdt(String checkdt) { - this.checkdt = checkdt; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInputusername() { - return inputusername; - } - - public void setInputusername(String inputusername) { - this.inputusername = inputusername; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptDayLog.java b/src/com/sipai/entity/report/RptDayLog.java deleted file mode 100644 index 65649517..00000000 --- a/src/com/sipai/entity/report/RptDayLog.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.sipai.entity.report; - -import java.io.Serializable; -import java.util.ArrayList; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; - -public class RptDayLog extends SQLAdapter implements Serializable { - - - public final static String Status_Start = "通过";//通过 - public final static String Status_Finish = "未审�?";//未审�? - - private static final long serialVersionUID = 1886432837612284637L; - - private String id; - - private String rptdeptId; - - private String rptdt; - - private String bizId; - - private String unitId; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String checkuser; - - private String checkdt; - - private String status; - - private String memo; - - private RptDeptSet rptDeptSet; - private ArrayList mPointList; - private ArrayList mPointHistoryList; - - private User user; - - private User _checkuser; - - private String reviewComments; - private String others; - - public String getReviewComments() { - return reviewComments; - } - - public void setReviewComments(String reviewComments) { - this.reviewComments = reviewComments; - } - - public String getOthers() { - return others; - } - - public void setOthers(String others) { - this.others = others; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRptdeptId() { - return rptdeptId; - } - - public void setRptdeptId(String rptdeptId) { - this.rptdeptId = rptdeptId; - } - - public String getRptdt() { - return rptdt; - } - - public void setRptdt(String rptdt) { - this.rptdt = rptdt; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getCheckuser() { - return checkuser; - } - - public void setCheckuser(String checkuser) { - this.checkuser = checkuser; - } - - public String getCheckdt() { - return checkdt; - } - - public void setCheckdt(String checkdt) { - this.checkdt = checkdt; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public ArrayList getmPointList() { - return mPointList; - } - - public void setmPointList(ArrayList mPointList) { - this.mPointList = mPointList; - } - - public ArrayList getmPointHistoryList() { - return mPointHistoryList; - } - - public void setmPointHistoryList(ArrayList mPointHistoryList) { - this.mPointHistoryList = mPointHistoryList; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public RptDeptSet getRptDeptSet() { - return rptDeptSet; - } - - public void setRptDeptSet(RptDeptSet rptDeptSet) { - this.rptDeptSet = rptDeptSet; - } - - public User get_checkuser() { - return _checkuser; - } - - public void set_checkuser(User _checkuser) { - this._checkuser = _checkuser; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptDayValSet.java b/src/com/sipai/entity/report/RptDayValSet.java deleted file mode 100644 index 6b0285f8..00000000 --- a/src/com/sipai/entity/report/RptDayValSet.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -import java.io.Serializable; - -public class RptDayValSet extends SQLAdapter implements Serializable { - private static final long serialVersionUID = 6533631341711206925L; - - private String id; - - private String pid; - - private String mpid; - - private String bizId; - - private String unitId; - - private String insuser; - - private String insdt; - - private Integer morder; - - private String mpid2; - - private String timeType; - - private Integer offset; - - private MPoint mPoint; - - private MPoint mPoint2; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId == null ? null : bizId.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getMpid2() { - return mpid2; - } - - public void setMpid2(String mpid2) { - this.mpid2 = mpid2 == null ? null : mpid2.trim(); - } - - public String getTimeType() { - return timeType; - } - - public void setTimeType(String timeType) { - this.timeType = timeType == null ? null : timeType.trim(); - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public MPoint getmPoint2() { - return mPoint2; - } - - public void setmPoint2(MPoint mPoint2) { - this.mPoint2 = mPoint2; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptDeptSet.java b/src/com/sipai/entity/report/RptDeptSet.java deleted file mode 100644 index afa47543..00000000 --- a/src/com/sipai/entity/report/RptDeptSet.java +++ /dev/null @@ -1,250 +0,0 @@ -package com.sipai.entity.report; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class RptDeptSet extends SQLAdapter implements Serializable { - - private Integer morder; - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - private String pid; - - private String type; - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - private static final long serialVersionUID = 4710368393782250158L; - - private String id; - - private String name; - - private String bizId; - - private String unitId; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String dateType; - - private String remindTime; - - private String memo; - - private String inputuser; - - private String viewuser; - - private String checkuser; - - private String checkst; - - private String remindStatus; - - private String lastRptdt; - - private String messageType; - - private Integer roleType; - - private String inputjob; - -// private String[][] userId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getDateType() { - return dateType; - } - - public void setDateType(String dateType) { - this.dateType = dateType; - } - - public String getRemindTime() { - return remindTime; - } - - public void setRemindTime(String remindTime) { - this.remindTime = remindTime; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInputuser() { - return inputuser; - } - - public void setInputuser(String inputuser) { - this.inputuser = inputuser; - } - - public String getViewuser() { - return viewuser; - } - - public void setViewuser(String viewuser) { - this.viewuser = viewuser; - } - - public String getCheckuser() { - return checkuser; - } - - public void setCheckuser(String checkuser) { - this.checkuser = checkuser; - } - - public String getCheckst() { - return checkst; - } - - public void setCheckst(String checkst) { - this.checkst = checkst; - } - -// public String[][] getUserId() { -// return userId; -// } -// -// public void setUserId(String[][] userId) { -// this.userId = userId; -// } - - public String getRemindStatus() { - return remindStatus; - } - - public void setRemindStatus(String remindStatus) { - this.remindStatus = remindStatus; - } - - public String getLastRptdt() { - return lastRptdt; - } - - public void setLastRptdt(String lastRptdt) { - this.lastRptdt = lastRptdt; - } - - public String getMessageType() { - return messageType; - } - - public void setMessageType(String messageType) { - this.messageType = messageType; - } - - public Integer getRoleType() { - return roleType; - } - - public void setRoleType(Integer roleType) { - this.roleType = roleType; - } - - public String getInputjob() { - return inputjob; - } - - public void setInputjob(String inputjob) { - this.inputjob = inputjob; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptDeptSetUser.java b/src/com/sipai/entity/report/RptDeptSetUser.java deleted file mode 100644 index 0f930be5..00000000 --- a/src/com/sipai/entity/report/RptDeptSetUser.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.entity.report; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class RptDeptSetUser extends SQLAdapter implements Serializable { - - private static final long serialVersionUID = 3454020177122517211L; - - private String id; - - private String userId; - - private String rptdeptId; - - private String insuser; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getRptdeptId() { - return rptdeptId; - } - - public void setRptdeptId(String rptdeptId) { - this.rptdeptId = rptdeptId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptInfoSet.java b/src/com/sipai/entity/report/RptInfoSet.java deleted file mode 100644 index 05a72d6c..00000000 --- a/src/com/sipai/entity/report/RptInfoSet.java +++ /dev/null @@ -1,514 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.SQLAdapter; - -/** - * 报表信息设置 - * - * @author s123 - */ -public class RptInfoSet extends SQLAdapter { - - private String generateJurisdiction; - private String browseJurisdiction; - private String generatePosition; - private String browsePosition; - private String generatePositionName; - private String browsePositionName; - - public String getGenerateJurisdiction() { - return generateJurisdiction; - } - - public void setGenerateJurisdiction(String generateJurisdiction) { - this.generateJurisdiction = generateJurisdiction; - } - - public String getBrowseJurisdiction() { - return browseJurisdiction; - } - - public void setBrowseJurisdiction(String browseJurisdiction) { - this.browseJurisdiction = browseJurisdiction; - } - - public String getGeneratePosition() { - return generatePosition; - } - - public void setGeneratePosition(String generatePosition) { - this.generatePosition = generatePosition; - } - - public String getBrowsePosition() { - return browsePosition; - } - - public void setBrowsePosition(String browsePosition) { - this.browsePosition = browsePosition; - } - - public String getGeneratePositionName() { - return generatePositionName; - } - - public void setGeneratePositionName(String generatePositionName) { - this.generatePositionName = generatePositionName; - } - - public String getBrowsePositionName() { - return browsePositionName; - } - - public void setBrowsePositionName(String browsePositionName) { - this.browsePositionName = browsePositionName; - } - - public CommonFile getCommonFile() { - return commonFile; - } - - public void setCommonFile(CommonFile commonFile) { - this.commonFile = commonFile; - } - -// public static final String RptType_Day="0";//日报 -// public static final String RptType_Week="1";//周报 -// public static final String RptType_Tenday="2";//旬报 -// public static final String RptType_Month="3";//月报 -// public static final String RptType_Quarterly="4";//季报 -// public static final String RptType_Year="5";//年报 - - public static final String RptType_Day = "sp_report_day_01";//日报 - public static final String RptType_Week = "sp_report_week_01";//周报 - public static final String RptType_Tenday = "sp_report_tenDay_01";//旬报 - public static final String RptType_Month = "sp_report_mth_01";//月报 - public static final String RptType_Quarterly = "sp_report_qua_01";//季报 - public static final String RptType_HalfYear = "sp_report_halfYear_01";//半年报 - public static final String RptType_Year = "sp_report_year_01";//年报 - - public static final String TYPE_CATALOGUE = "catalogue";//目录 - public static final String TYPE_SETTING = "setting";//设置 - - public static final String FileTableName = "TB_Report_RptInfoSetFile";//审核通过,蓝�? - - //是否�?要审核报�? - public static final String Checkst_Yes = "是"; - public static final String Checkst_No = "否"; - - public static final String Role_Generate = "generate"; - public static final String Role_Check = "check"; - public static final String Role_View = "view"; - - private String id; - - private String pid; - - private String name; - - private String version; - - private String rpttypeId; - - private String rpttype; - - private String modelname; - - private String repname; - - private String dtposx; - - private String dtposy; - - private String insuser; - - private String insdt; - - private String memo; - - private String bizId; - - private String unitId; - - private String inputposx; - - private String inputposy; - - private String checkposx; - - private String checkposy; - - private String remkposx; - - private String remkposy; - - private String checkst; - - private String autost; - - private String cyclest; - - private String timest; - - private String upsuser; - - private String upsdt; - - private Integer morder; - - private String daystartdt; - - private String mthstartdt; - - private String type; - - private String _insuser; - - private String _upsuser; - - private CommonFile commonFile; - - private String createauto; - - private String checkuser;//可审核报表用�? - private String createusers;//可生成报表用�? - private String browseusers;//可浏览报表用�? - - private String checkuserName;//可审核报表用�? - private String createuserName;//可生成报表用�? - private String browseuserName;//可浏览报表用�? - - public String getCheckuserName() { - return checkuserName; - } - - public void setCheckuserName(String checkuserName) { - this.checkuserName = checkuserName; - } - - public String getCreateuserName() { - return createuserName; - } - - public void setCreateuserName(String createuserName) { - this.createuserName = createuserName; - } - - public String getBrowseuserName() { - return browseuserName; - } - - public void setBrowseuserName(String browseuserName) { - this.browseuserName = browseuserName; - } - - public String getCreateauto() { - return createauto; - } - - public void setCreateauto(String createauto) { - this.createauto = createauto; - } - - public String getCreateusers() { - return createusers; - } - - public void setCreateusers(String createusers) { - this.createusers = createusers; - } - - public String getBrowseusers() { - return browseusers; - } - - public void setBrowseusers(String browseusers) { - this.browseusers = browseusers; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getRpttypeId() { - return rpttypeId; - } - - public void setRpttypeId(String rpttypeId) { - this.rpttypeId = rpttypeId; - } - - public String getRpttype() { - return rpttype; - } - - public void setRpttype(String rpttype) { - this.rpttype = rpttype; - } - - public String getModelname() { - return modelname; - } - - public void setModelname(String modelname) { - this.modelname = modelname; - } - - public String getRepname() { - return repname; - } - - public void setRepname(String repname) { - this.repname = repname; - } - - public String getDtposx() { - return dtposx; - } - - public void setDtposx(String dtposx) { - this.dtposx = dtposx; - } - - public String getDtposy() { - return dtposy; - } - - public void setDtposy(String dtposy) { - this.dtposy = dtposy; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getCheckuser() { - return checkuser; - } - - public void setCheckuser(String checkuser) { - this.checkuser = checkuser; - } - - public String getInputposx() { - return inputposx; - } - - public void setInputposx(String inputposx) { - this.inputposx = inputposx; - } - - public String getInputposy() { - return inputposy; - } - - public void setInputposy(String inputposy) { - this.inputposy = inputposy; - } - - public String getCheckposx() { - return checkposx; - } - - public void setCheckposx(String checkposx) { - this.checkposx = checkposx; - } - - public String getCheckposy() { - return checkposy; - } - - public void setCheckposy(String checkposy) { - this.checkposy = checkposy; - } - - public String getRemkposx() { - return remkposx; - } - - public void setRemkposx(String remkposx) { - this.remkposx = remkposx; - } - - public String getRemkposy() { - return remkposy; - } - - public void setRemkposy(String remkposy) { - this.remkposy = remkposy; - } - - public String getCheckst() { - return checkst; - } - - public void setCheckst(String checkst) { - this.checkst = checkst; - } - - public String getAutost() { - return autost; - } - - public void setAutost(String autost) { - this.autost = autost; - } - - public String getCyclest() { - return cyclest; - } - - public void setCyclest(String cyclest) { - this.cyclest = cyclest; - } - - public String getTimest() { - return timest; - } - - public void setTimest(String timest) { - this.timest = timest; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getDaystartdt() { - return daystartdt; - } - - public void setDaystartdt(String daystartdt) { - this.daystartdt = daystartdt; - } - - public String getMthstartdt() { - return mthstartdt; - } - - public void setMthstartdt(String mthstartdt) { - this.mthstartdt = mthstartdt; - } - - public String get_insuser() { - return _insuser; - } - - public void set_insuser(String _insuser) { - this._insuser = _insuser; - } - - public String get_upsuser() { - return _upsuser; - } - - public void set_upsuser(String _upsuser) { - this._upsuser = _upsuser; - } - - - // YYJ 202-09-22 重写equals �? hashCode 用于set除重 id - @Override - public boolean equals(Object obj) { - RptInfoSet rptInfoSet = (RptInfoSet) obj; - return this.getId().equals(rptInfoSet.getId()); - } - - @Override - public int hashCode() { - return this.getId().hashCode(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptInfoSetFile.java b/src/com/sipai/entity/report/RptInfoSetFile.java deleted file mode 100644 index 5507c1b1..00000000 --- a/src/com/sipai/entity/report/RptInfoSetFile.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 报表信息设置附件表 - * @author s123 - * - */ -public class RptInfoSetFile extends SQLAdapter { - - public static final String bucketName = "RptInfoSetFile"; - - private String id; - - private String insdt; - - private String insuser; - - private String masterid; - - private String filename; - - private String abspath; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptInfoSetSheet.java b/src/com/sipai/entity/report/RptInfoSetSheet.java deleted file mode 100644 index 6d4a8088..00000000 --- a/src/com/sipai/entity/report/RptInfoSetSheet.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; - -public class RptInfoSetSheet extends SQLAdapter { - private String id; - - private String sheetName; - - private String rptinfosetId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getSheetName() { - return sheetName; - } - - public void setSheetName(String sheetName) { - this.sheetName = sheetName == null ? null : sheetName.trim(); - } - - public String getRptinfosetId() { - return rptinfosetId; - } - - public void setRptinfosetId(String rptinfosetId) { - this.rptinfosetId = rptinfosetId == null ? null : rptinfosetId.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptLog.java b/src/com/sipai/entity/report/RptLog.java deleted file mode 100644 index 829552b8..00000000 --- a/src/com/sipai/entity/report/RptLog.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -/** - * 报表日志 - * - * @author sj - */ -public class RptLog extends SQLAdapter { -// public static final String RptLog_Type_Data = "data";//数据修改 -// public static final String RptLog_Type_Confirm = "confirm";//数据确认 - - public static final int RptLog_Status_0 = 0; - public static final int RptLog_Status_1 = 1;//完成修改或确认 - - private String id; - - private String insdt; - - private String insuser; - - /** - * 在table中的位置 - */ - private String posx;//-x - private String posy;//-y - - /** - * 在excel中的位置 - */ - private String posxE;//-x - private String posyE;//-y - - private String remark; - - private int status; - - private String creatId;//报表生成id - - private String sheet;//sheet名 - - private String type;//类型 如 数据修订、数据确认 - - private String beforeValue;//修改前值 - - private String afterValue;//修改后值 - - private User user; - - private String rptTempJson; - - public String getPosxE() { - return posxE; - } - - public void setPosxE(String posxE) { - this.posxE = posxE; - } - - public String getPosyE() { - return posyE; - } - - public void setPosyE(String posyE) { - this.posyE = posyE; - } - - public String getRptTempJson() { - return rptTempJson; - } - - public void setRptTempJson(String rptTempJson) { - this.rptTempJson = rptTempJson; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getBeforeValue() { - return beforeValue; - } - - public void setBeforeValue(String beforeValue) { - this.beforeValue = beforeValue; - } - - public String getAfterValue() { - return afterValue; - } - - public void setAfterValue(String afterValue) { - this.afterValue = afterValue; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPosx() { - return posx; - } - - public void setPosx(String posx) { - this.posx = posx; - } - - public String getPosy() { - return posy; - } - - public void setPosy(String posy) { - this.posy = posy; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getCreatId() { - return creatId; - } - - public void setCreatId(String creatId) { - this.creatId = creatId; - } - - public String getSheet() { - return sheet; - } - - public void setSheet(String sheet) { - this.sheet = sheet; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptMpSet.java b/src/com/sipai/entity/report/RptMpSet.java deleted file mode 100644 index 2728b5f6..00000000 --- a/src/com/sipai/entity/report/RptMpSet.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.entity.report; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -/** - * 报表信息设置--附表--附表 - * @author s123 - * - */ -public class RptMpSet extends SQLAdapter implements Serializable { - - private static final long serialVersionUID = -3374936565766281516L; - - public final static String rog = "-"; - public final static String dt = "date"; - - private String id; - - private String pid; - - private String mpid; - - private String dataType; - - private String collectMode; - - private String bizId; - - private String unitId; - - private String insuser; - - private String insdt; - - private int morder; - - private MPoint mPoint; - private RptCollectMode rptCollectMode; - - public RptCollectMode getRptCollectMode() { - return rptCollectMode; - } - - public void setRptCollectMode(RptCollectMode rptCollectMode) { - this.rptCollectMode = rptCollectMode; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getCollectMode() { - return collectMode; - } - - public void setCollectMode(String collectMode) { - this.collectMode = collectMode; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptSpSet.java b/src/com/sipai/entity/report/RptSpSet.java deleted file mode 100644 index 0f1ab122..00000000 --- a/src/com/sipai/entity/report/RptSpSet.java +++ /dev/null @@ -1,342 +0,0 @@ -package com.sipai.entity.report; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.GroupTime; -import com.sipai.entity.work.GroupType; - -/** - * 报表信息设置--附表 - * - * @author s123 - */ -public class RptSpSet extends SQLAdapter { - public static final String RptSpSet_Business_Business = "业务报表"; - /* - 计算点 - */ - public static final String RptSpSet_Type_Cal = "cal";//计算点sp - /* - 其他 - */ - public static final String RptSpSet_Type_Insuser = "insuser";//记录人sp - public static final String RptSpSet_Type_Confirm = "confirm";//确认人sp - public static final String RptSpSet_Type_Checkuser = "checkuser";//审核人sp - public static final String RptSpSet_Type_Rptdt = "rptdt";//报表日期sp - public static final String RptSpSet_Type_BanZhang = "banzhang";//值班班长 - public static final String RptSpSet_Type_ZuYuan = "zuyuan";//值班组员 - - public static final String RptSpSet_Writermode_Horizontal = "横向"; - public static final String RptSpSet_Writermode_Vertical = "纵向"; - - /** - * 时间间隔类型 - */ - public static final String RptSpSet_IntvType_Hour = "hour"; - public static final String RptSpSet_IntvType_Day = "day"; - public static final String RptSpSet_IntvType_Month = "month"; - - /* - * 单元格区域类型 - */ -// public static final String Cell_Type_Confirm = "确认"; -// public static final String Cell_Type_Date = "日期"; - - private String id; - - private String pid; - - private String spname;//sp名 - - private String rownum;//行数 - - private String colnum;//列数 - - private String sheet;//sheet名 - - private String posx;//单元格X值 - - private String posy;//单元格Y值 - - private String type; - - private String intv;//时间间隔 - - private String intvType;//时间间隔类型 2023-02-24 sj - - private String starthour;//日开始时间 - - private String endhour;//日结束时间 - - private String bizId; - - private String unitId; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private Integer morder; - - private String rptsdt;//开始日期 - - private String rptedt;//结束日期 - - private String writermode;//插入方式 - - private String _mpstr; - - private String business; - - //2022-01-21 新加字段 sj - private String grouptypeId;//班组类型id 如:运行班、集控班 - private String grouptimeId;//班次类型id 如:早班、中班 - private GroupType groupType; - private GroupTime groupTime; - - // 0禁用 1启用 - private String active; - - public String getIntvType() { - return intvType; - } - - public void setIntvType(String intvType) { - this.intvType = intvType; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public GroupType getGroupType() { - return groupType; - } - - public void setGroupType(GroupType groupType) { - this.groupType = groupType; - } - - public GroupTime getGroupTime() { - return groupTime; - } - - public void setGroupTime(GroupTime groupTime) { - this.groupTime = groupTime; - } - - public String getGrouptypeId() { - return grouptypeId; - } - - public void setGrouptypeId(String grouptypeId) { - this.grouptypeId = grouptypeId; - } - - public String getGrouptimeId() { - return grouptimeId; - } - - public void setGrouptimeId(String grouptimeId) { - this.grouptimeId = grouptimeId; - } - - public String getBusiness() { - return business; - } - - public String getEndhour() { - return endhour; - } - - public void setEndhour(String endhour) { - this.endhour = endhour; - } - - public void setBusiness(String business) { - this.business = business; - } - - public String get_mpstr() { - return _mpstr; - } - - public void set_mpstr(String _mpstr) { - this._mpstr = _mpstr; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getSpname() { - return spname; - } - - public void setSpname(String spname) { - this.spname = spname; - } - - public String getRownum() { - return rownum; - } - - public void setRownum(String rownum) { - this.rownum = rownum; - } - - public String getColnum() { - return colnum; - } - - public void setColnum(String colnum) { - this.colnum = colnum; - } - - public String getSheet() { - return sheet; - } - - public void setSheet(String sheet) { - this.sheet = sheet; - } - - public String getPosx() { - return posx; - } - - public void setPosx(String posx) { - this.posx = posx; - } - - public String getPosy() { - return posy; - } - - public void setPosy(String posy) { - this.posy = posy; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIntv() { - return intv; - } - - public void setIntv(String intv) { - this.intv = intv; - } - - public String getStarthour() { - return starthour; - } - - public void setStarthour(String starthour) { - this.starthour = starthour; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getRptsdt() { - return rptsdt; - } - - public void setRptsdt(String rptsdt) { - this.rptsdt = rptsdt; - } - - public String getRptedt() { - return rptedt; - } - - public void setRptedt(String rptedt) { - this.rptedt = rptedt; - } - - public String getWritermode() { - return writermode; - } - - public void setWritermode(String writermode) { - this.writermode = writermode; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/RptTemp.java b/src/com/sipai/entity/report/RptTemp.java deleted file mode 100644 index c07ef92e..00000000 --- a/src/com/sipai/entity/report/RptTemp.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.report; - -public class RptTemp { - private int itemid; - private String parmvalue; - private String measuredt; - private String FormatType; - private int colposx; - private int colposy; - private int decimal;// 小数位 - private String mpcode; - - public int getDecimal() { - return decimal; - } - - public void setDecimal(int decimal) { - this.decimal = decimal; - } - - public int getColposx() { - return colposx; - } - public void setColposx(int colposx) { - this.colposx = colposx; - } - public int getColposy() { - return colposy; - } - public void setColposy(int colposy) { - this.colposy = colposy; - } - public int getItemid() { - return itemid; - } - public void setItemid(int itemid) { - this.itemid = itemid; - } - public String getParmvalue() { - return parmvalue; - } - public void setParmvalue(String parmvalue) { - this.parmvalue = parmvalue; - } - public String getMeasuredt() { - return measuredt; - } - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - public String getFormatType() { - return FormatType; - } - public void setFormatType(String formatType) { - FormatType = formatType; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } -} diff --git a/src/com/sipai/entity/report/RptTypeSet.java b/src/com/sipai/entity/report/RptTypeSet.java deleted file mode 100644 index b5a13df1..00000000 --- a/src/com/sipai/entity/report/RptTypeSet.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.sipai.entity.report; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 报表信息类型设置表 - * @author s123 - * - */ -public class RptTypeSet extends SQLAdapter implements Serializable { - - - /** - * - */ - private static final long serialVersionUID = -3071378416872898755L; - public static final String RptType_Type_Day="day";//日报 - public static final String RptType_Type_Month="month";//月报 - public static final String RptType_Type_Year="year";//年报 - private String id; - - private String pid; - - private String name; - - private String type; - - private String bizId; - - private String unitId; - - private String insuser; - - private String insdt; - - private Integer morder; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - // YYJ 202-09-22 重写equals 和 hashCode 用于set除重 id - @Override - public boolean equals(Object obj) { - RptTypeSet rptTypeSet = (RptTypeSet) obj; - return this.getId().equals(rptTypeSet.getId()); - } - @Override - public int hashCode() { - return this.getId().hashCode(); - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/TemplateFile.java b/src/com/sipai/entity/report/TemplateFile.java deleted file mode 100644 index 9e43a818..00000000 --- a/src/com/sipai/entity/report/TemplateFile.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class TemplateFile extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String masterid; - - private String filename; - - private String abspath; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/report/TemplateType.java b/src/com/sipai/entity/report/TemplateType.java deleted file mode 100644 index 02c841db..00000000 --- a/src/com/sipai/entity/report/TemplateType.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.entity.report; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.service.report.BaseService; -import com.sipai.tools.SpringContextUtil; - -public class TemplateType extends SQLAdapter { - - public static final String REPORT_MONTH= "month";//月报 - public static final String REPORT_DAY = "day";//日报 - - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String pid; - - private String remark; - - private String serviceName; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyCertificate.java b/src/com/sipai/entity/safety/SafetyCertificate.java deleted file mode 100644 index 8d5fa009..00000000 --- a/src/com/sipai/entity/safety/SafetyCertificate.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.entity.safety; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 人员证书 - */ -@Data -public class SafetyCertificate extends SQLAdapter { - - /** - * 证书主键 - */ - private String id; - /** - * 所属人员 - */ - private String userid; - /** - * 证书名称 - */ - private String certificateName; - /** - * 证书编号 - */ - private String certificateNo; - /** - * 作业代码 - */ - private String jobCode; - /** - * 作业种类 - */ - private String jobType; - /** - * 发证机构 - */ - private String issuingAuthority; - /** - * 领证时间 - */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String issueDate; - /** - * 有效期至 - */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String expirationDate; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private String createTime; - - /** - * 数据标志 1内部证书 2外部证书 - */ - private String flag; - -} diff --git a/src/com/sipai/entity/safety/SafetyCheckComprehensive.java b/src/com/sipai/entity/safety/SafetyCheckComprehensive.java deleted file mode 100644 index fc911621..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckComprehensive.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -@Data -public class SafetyCheckComprehensive { - /** - * 主键 - */ - private String id; - /** - * 安全检查编号 - */ - private String checkCode; - /** - * 检查类型 - */ - private String checkType; - /** - * 检查日期 - */ - private String checkDate; - /** - * 检查地点 - */ - private String checkPlace; - /** - * 检查人员id - */ - private String checkerId; - /** - * 检查人员姓名 - */ - private String checkerName; - /** - * 记录人员id - */ - private String recorderId; - /** - * 记录人员姓名 - */ - private String recorderName; - /** - * 检查结果 - */ - private Integer checkResult; - /** - * 不相符内容 - */ - private String checkResultDetail; - /** - * 附加说明 - */ - private String checkRemark; - /** - * 整改负责部门id - */ - private String dutyDeptId; - /** - * 整改负责部门名称 - */ - private String dutyDeptName; - /** - * 整改负责人id - */ - private String dutyUserId; - /** - * 整改负责人名称 - */ - private String dutyUserName; - /** - * 抄送人员id - */ - private String copyUserId; - /** - * 发起人id - */ - private String createUserId; - /** - * 发起人姓名 - */ - private String createUserName; - /** - * 抄送人员姓名 - */ - private String copyUserName; - /** - * 整改措施 - */ - private String correctiveAction; - /** - * 验证人id - */ - private String confirmUserId; - /** - * 验证人姓名 - */ - private String confirmUserName; - /** - * 状态 - */ - private Integer status; -} diff --git a/src/com/sipai/entity/safety/SafetyCheckComprehensiveExcel.java b/src/com/sipai/entity/safety/SafetyCheckComprehensiveExcel.java deleted file mode 100644 index 6b3145e3..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckComprehensiveExcel.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.sipai.entity.safety; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import lombok.Data; - -/** - * @author LiTao - * @date 2022-10-17 11:51:43 - * @description: 综合安全检查excel实体 - */ -@Data -@ColumnWidth(20) -public class SafetyCheckComprehensiveExcel { - /** - * 安全检查编号 - */ - @ExcelProperty(value = "安全检查编号", index = 0) - private String checkCode; - /** - * 检查类型 - */ - @ExcelProperty(value = "检查类型", index = 1) - private String checkType; - /** - * 检查日期 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查日期", index = 2) - private String checkDate; - /** - * 检查地点 - */ - @ExcelProperty(value = "检查地点", index = 3) - private String checkPlace; - /** - * 检查人员姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查人员", index = 4) - private String checkerName; - /** - * 检查结果 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查结果", index = 5) - //private Integer checkResult; - private String checkResultName; - /** - * 不相符内容 - */ - @ExcelProperty(value = "不相符内容", index = 6) - private String checkResultDetail; - /** - * 附加说明 - */ - @ExcelProperty(value = "附加说明", index = 7) - private String checkRemark; - /** - * 整改负责部门名称 - */ - @ColumnWidth(25) - @ExcelProperty(value = "整改负责部门", index = 8) - private String dutyDeptName; - /** - * 整改负责人名称 - */ - @ExcelProperty(value = "整改负责人", index = 9) - private String dutyUserName; - /** - * 整改措施 - */ - @ExcelProperty(value = "整改措施", index = 10) - private String correctiveAction; - /** - * 验证人姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "验证人", index = 11) - private String confirmUserName; - /** - * 记录人员姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "记录人", index = 12) - private String recorderName; - /** - * 状态 - */ - @ColumnWidth(15) - @ExcelProperty(value = "状态", index = 13) - //private Integer status; - private String statusName; -} diff --git a/src/com/sipai/entity/safety/SafetyCheckComprehensiveQuery.java b/src/com/sipai/entity/safety/SafetyCheckComprehensiveQuery.java deleted file mode 100644 index e5492e82..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckComprehensiveQuery.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyCheckComprehensiveQuery extends SafetyCommonQuery { - - private String status; - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyCheckComprehensiveVo.java b/src/com/sipai/entity/safety/SafetyCheckComprehensiveVo.java deleted file mode 100644 index 84a5bc1d..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckComprehensiveVo.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 综合检查 - * @author lt - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyCheckComprehensiveVo extends SafetyCheckComprehensive { - - - private String checkResultName; - - - private String statusName; - -} diff --git a/src/com/sipai/entity/safety/SafetyCheckDayly.java b/src/com/sipai/entity/safety/SafetyCheckDayly.java deleted file mode 100644 index dd6429f2..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckDayly.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -@Data -public class SafetyCheckDayly { - private String id; - /** - * 安全检查编号 - */ - private String checkCode; - /** - * 检查日期 - */ - private String checkDate; - /** - * 检查人员id - */ - private String checkerId; - /** - * 检察人员姓名 - */ - private String checkerName; - /** - * 检查结果 - */ - private Integer checkResult; - /** - * 不相符内容 - */ - private String checkResultDetail; - /** - * 附加说明 - */ - private String checkRemark; - /** - * 整改负责部门id - */ - private String dutyDeptId; - /** - * 整改负责部门名称 - */ - private String dutyDeptName; - /** - * 整改负责人id - */ - private String dutyUserId; - /** - * 整改负责人名称 - */ - private String dutyUserName; - /** - * 抄送人员id - */ - private String copyUserId; - /** - * 整改措施 - */ - private String correctiveAction; - /** - * 验证人id - */ - private String confirmUserId; - /** - * 验证人姓名 - */ - private String confirmUserName; - /** - * 状态 - */ - private Integer status; - /** - * 发起人id - */ - private String createUserId; - /** - * 发起人姓名 - */ - private String createUserName; - /** - * 抄送人员姓名 - */ - private String copyUserName; - -} diff --git a/src/com/sipai/entity/safety/SafetyCheckDaylyExcel.java b/src/com/sipai/entity/safety/SafetyCheckDaylyExcel.java deleted file mode 100644 index e858e7c4..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckDaylyExcel.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.entity.safety; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import lombok.Data; - -/** - * @author LiTao - * @date 2022-10-17 14:05:39 - * @description: 日常检查excel实体 - */ -@Data -@ColumnWidth(20) -public class SafetyCheckDaylyExcel { - /** - * 安全检查编号 - */ - @ExcelProperty(value = "安全检查编号", index = 0) - private String checkCode; - /** - * 检查日期 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查日期", index = 1) - private String checkDate; - /** - * 检察人员姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查人员", index = 2) - private String checkerName; - /** - * 检查结果 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查结果", index = 3) - //private Integer checkResult; - private String checkResultName; - /** - * 不相符内容 - */ - @ExcelProperty(value = "不相符内容", index = 4) - private String checkResultDetail; - /** - * 附加说明 - */ - @ExcelProperty(value = "附加说明", index = 5) - private String checkRemark; - /** - * 整改负责部门名称 - */ - @ColumnWidth(25) - @ExcelProperty(value = "整改负责部门", index = 6) - private String dutyDeptName; - /** - * 整改负责人名称 - */ - @ExcelProperty(value = "整改负责人", index = 7) - private String dutyUserName; - /** - * 整改措施 - */ - @ExcelProperty(value = "整改措施", index = 8) - private String correctiveAction; - /** - * 验证人姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "验证人", index = 9) - private String confirmUserName; - /** - * 状态 - */ - @ColumnWidth(15) - @ExcelProperty(value = "状态", index = 10) - //private Integer status; - private String statusName; - -} diff --git a/src/com/sipai/entity/safety/SafetyCheckDaylyQuery.java b/src/com/sipai/entity/safety/SafetyCheckDaylyQuery.java deleted file mode 100644 index 415935cf..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckDaylyQuery.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyCheckDaylyQuery extends SafetyCommonQuery { - - private String status; - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyCheckDaylyVo.java b/src/com/sipai/entity/safety/SafetyCheckDaylyVo.java deleted file mode 100644 index 8f4c6b15..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckDaylyVo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyCheckDaylyVo extends SafetyCheckDayly { - - - private String checkResultName; - - - private String statusName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyCheckSpecial.java b/src/com/sipai/entity/safety/SafetyCheckSpecial.java deleted file mode 100644 index 71124ca7..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckSpecial.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -/** - * 专项安全检查 - */ -@Data -public class SafetyCheckSpecial { - /** - * 主键 - */ - private String id; - /** - * 安全检查编号 - */ - private String checkCode; - /** - * 专项检查 - */ - private Integer checkItem; - /** - * 检查日期 - */ - private String checkDate; - /** - * 检查地点 - */ - private String checkPlace; - /** - * 检查人员id - */ - private String checkerId; - /** - * 检查人员姓名 - */ - private String checkerName; - /** - * 记录人员id - */ - private String recorderId; - /** - * 记录人员姓名 - */ - private String recorderName; - /** - * 检查结果 - */ - private Integer checkResult; - /** - * 不相符内容 - */ - private String checkResultDetail; - /** - * 附加说明 - */ - private String checkRemark; - /** - * 整改负责部门id - */ - private String dutyDeptId; - /** - * 整改负责部门名称 - */ - private String dutyDeptName; - /** - * 整改负责人id - */ - private String dutyUserId; - /** - * 整改负责人名称 - */ - private String dutyUserName; - /** - * 抄送人员id - */ - private String copyUserId; - /** - * 抄送人员姓名 - */ - private String copyUserName; - /** - * 发起人id - */ - private String createUserId; - /** - * 发起人姓名 - */ - private String createUserName; - /** - * 整改措施 - */ - private String correctiveAction; - /** - * 验证人id - */ - private String confirmUserId; - /** - * 验证人姓名 - */ - private String confirmUserName; - /** - * 状态 - */ - private Integer status; - - -} diff --git a/src/com/sipai/entity/safety/SafetyCheckSpecialExcel.java b/src/com/sipai/entity/safety/SafetyCheckSpecialExcel.java deleted file mode 100644 index dda54fce..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckSpecialExcel.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.safety; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import lombok.Data; - -/** - * @author LiTao - * @date 2022-10-17 09:53:34 - * @description: 专项检查excel实体 - */ -@Data -@ColumnWidth(20) -public class SafetyCheckSpecialExcel { - /** - * 安全检查编号 - */ - @ExcelProperty(value = "安全检查编号", index = 0) - private String checkCode; - /** - * 专项检查 - */ - @ExcelProperty(value = "专项检查", index = 1) - //private Integer checkItem; - private String checkItemName; - /** - * 检查日期 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查日期", index = 2) - private String checkDate; - /** - * 检查地点 - */ - @ExcelProperty(value = "检查地点", index = 3) - private String checkPlace; - /** - * 检查人员姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查人员", index = 4) - private String checkerName; - /** - * 检查结果 - */ - @ColumnWidth(15) - @ExcelProperty(value = "检查结果", index = 5) - //private Integer checkResult; - private String checkResultName; - /** - * 不相符内容 - */ - @ExcelProperty(value = "不相符内容", index = 6) - private String checkResultDetail; - /** - * 附加说明 - */ - @ExcelProperty(value = "附加说明", index = 7) - private String checkRemark; - /** - * 整改负责部门名称 - */ - @ColumnWidth(25) - @ExcelProperty(value = "整改负责部门", index = 8) - private String dutyDeptName; - /** - * 整改负责人名称 - */ - @ExcelProperty(value = "整改负责人", index = 9) - private String dutyUserName; - /** - * 整改措施 - */ - @ExcelProperty(value = "整改措施", index = 10) - private String correctiveAction; - /** - * 验证人姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "验证人", index = 11) - private String confirmUserName; - /** - * 记录人员姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "记录人", index = 12) - private String recorderName; - /** - * 状态 - */ - @ColumnWidth(15) - @ExcelProperty(value = "状态", index = 13) - //private Integer status; - private String statusName; -} diff --git a/src/com/sipai/entity/safety/SafetyCheckSpecialQuery.java b/src/com/sipai/entity/safety/SafetyCheckSpecialQuery.java deleted file mode 100644 index 53680ccb..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckSpecialQuery.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyCheckSpecialQuery extends SafetyCommonQuery { - - private String status; - - private Integer checkItem; - -} diff --git a/src/com/sipai/entity/safety/SafetyCheckSpecialVo.java b/src/com/sipai/entity/safety/SafetyCheckSpecialVo.java deleted file mode 100644 index 2579fbca..00000000 --- a/src/com/sipai/entity/safety/SafetyCheckSpecialVo.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * @author LiTao - * @date 2022-10-15 09:22:39 - * @description: 专项安全检查 - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyCheckSpecialVo extends SafetyCheckSpecial { - - private String checkItemName; - - private String checkResultName; - - private String statusName; -} diff --git a/src/com/sipai/entity/safety/SafetyCommonQuery.java b/src/com/sipai/entity/safety/SafetyCommonQuery.java deleted file mode 100644 index 80983d2d..00000000 --- a/src/com/sipai/entity/safety/SafetyCommonQuery.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.entity.safety; - -import com.sipai.entity.base.SQLAdapter; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; - -@EqualsAndHashCode(callSuper = true) -public class SafetyCommonQuery extends SQLAdapter { - - @Setter - @Getter - private String timeRangeBegin; - - @Setter - @Getter - private String timeRangeEnd; - - - - - @Getter - private String timeRange; - public void setTimeRange(String timeRange) { - this.timeRange = timeRange; - this.timeRangeBegin = this.timeRange.split(" ~ ")[0]; - this.timeRangeEnd = this.timeRange.split(" ~ ")[1]; - } - - @Setter - @Getter - private String likeString; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationBuilder.java b/src/com/sipai/entity/safety/SafetyEducationBuilder.java deleted file mode 100644 index 5c2c6f20..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -import java.util.Date; - -@Data -public class SafetyEducationBuilder { - private String id; - - private String educationCode; - - private String educationDate; - - private String gender; - - private String name; - - private String company; - - private String deadline; - - private String fileId; - - private String safetyJobId; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationBuilderQuery.java b/src/com/sipai/entity/safety/SafetyEducationBuilderQuery.java deleted file mode 100644 index 69ea4646..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationBuilderQuery.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyEducationBuilderQuery extends SafetyCommonQuery { - - private String company; - - private String safetyJobId; -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationInsider.java b/src/com/sipai/entity/safety/SafetyEducationInsider.java deleted file mode 100644 index 171e5b67..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationInsider.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -@Data -public class SafetyEducationInsider { - private String id; - - private Integer educationType; - - private String educationCode; - - private String userid; - - private String idcard; - - private String birthday; - - private String workTime; - - private String hiredate; - - private String post; - - private String duty; - - private String jobTitle; - - private BigDecimal point; - - private String gender; - - private String fileId; - - private String userCardId; - - private String deptName; - private String deptId; - - private String userName; - - private String jobInsideId; -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationInsiderQuery.java b/src/com/sipai/entity/safety/SafetyEducationInsiderQuery.java deleted file mode 100644 index 3b2cbf2f..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationInsiderQuery.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyEducationInsiderQuery extends SafetyCommonQuery { - - private Integer educationType; - - private String deptId; - - private String childrenDeptIdIn; - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationInsiderVo.java b/src/com/sipai/entity/safety/SafetyEducationInsiderVo.java deleted file mode 100644 index da0dc466..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationInsiderVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyEducationInsiderVo extends SafetyEducationInsider { - - private String educationTypeName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationTrainee.java b/src/com/sipai/entity/safety/SafetyEducationTrainee.java deleted file mode 100644 index 66685880..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationTrainee.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -import java.util.Date; - -@Data -public class SafetyEducationTrainee { - private String id; - - private String educationCode; - - private String educationDate; - - private String gender; - - private String name; - - private String company; - - private String deptName; - - private String post; - - private String deadline; - - private String fileId; - - private String deptId; -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationTraineeQuery.java b/src/com/sipai/entity/safety/SafetyEducationTraineeQuery.java deleted file mode 100644 index 043ce0ca..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationTraineeQuery.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyEducationTraineeQuery extends SafetyCommonQuery { - - private String deptId; - - private String childrenDeptIdIn; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyEducationVisitor.java b/src/com/sipai/entity/safety/SafetyEducationVisitor.java deleted file mode 100644 index 1f800728..00000000 --- a/src/com/sipai/entity/safety/SafetyEducationVisitor.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -import java.util.Date; -@Data -public class SafetyEducationVisitor { - private String id; - - private String educationCode; - - private String educationDate; - - private String usherId; - - private String usherName; - - private String visitorCompany; - - private Integer vistorNum; - - private String accessTime; - - private String leaveTime; - - private String fileId; - - private String contact; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyExternalCertificateExcel.java b/src/com/sipai/entity/safety/SafetyExternalCertificateExcel.java deleted file mode 100644 index 993712f5..00000000 --- a/src/com/sipai/entity/safety/SafetyExternalCertificateExcel.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.sipai.entity.safety; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -@Data -@ColumnWidth(20) -public class SafetyExternalCertificateExcel { - /** - * 姓名 - */ - @ExcelProperty(value = "姓名", index = 0) - private String username; - - /** - * 外部人员性别 - */ - @ColumnWidth(10) - @ExcelProperty(value = "性别", index = 1) - private String sexText; - - @ColumnWidth(25) - @ExcelProperty(value = "身份证号", index = 2) - private String idcard; - - /** - * 施工单位名称 - */ - @ExcelProperty(value = "施工单位名称", index = 3) - private String company; - - @ColumnWidth(15) - @ExcelProperty(value = "出生日期", index = 4) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String birthday; - - @ColumnWidth(30) - @ExcelProperty(value = "负责部门", index = 5) - private String usherDept; - - @ExcelProperty(value = "负责人", index = 6) - private String usherName; - - @ExcelProperty(value = "职务", index = 7) - private String duty; - - @ExcelProperty(value = "职称", index = 8) - private String jobTitle; - - /** - * 证书名称 - */ - @ExcelProperty(value = "证书名称", index = 9) - private String certificateName; - - @ExcelProperty(value = "证书编号", index = 10) - private String certificateNo; - - @ExcelProperty(value = "作业项目代码", index = 11) - private String jobCode; - - @ExcelProperty(value = "作业类型", index = 12) - private String jobType; - - @ExcelProperty(value = "发证部门", index = 13) - private String issuingAuthority; - - /** - * 领证时间 - */ - @ColumnWidth(15) - @ExcelProperty(value = "领证时间", index = 14) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String issueDate; - - /** - * 有效期至 - */ - @ColumnWidth(15) - @ExcelProperty(value = "有效期至", index = 15) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String expirationDate; - -} diff --git a/src/com/sipai/entity/safety/SafetyExternalCertificateVo.java b/src/com/sipai/entity/safety/SafetyExternalCertificateVo.java deleted file mode 100644 index 32eab497..00000000 --- a/src/com/sipai/entity/safety/SafetyExternalCertificateVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.safety; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -/** - * 外部人员证书 - */ -@Data -public class SafetyExternalCertificateVo extends SafetyCertificate { - - // 外部人员ID - private String staffId; - // 外部人员名称 - private String username; - - // 外部人员性别 - private String sex; - private String sexText; - - //所属公司单位 - private String company; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String birthday; - - // 接洽人 - private String usherId; - private String usherName; - - // 接洽人部门 - private String usherDept; - - private String duty; - - private String jobTitle; - - private String idcard; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private String ctime; - - /** - * 文件实体 - */ - private SafetyFiles safetyFiles; - - /** - * 文件ID - */ - private String fileId; -} diff --git a/src/com/sipai/entity/safety/SafetyExternalStaff.java b/src/com/sipai/entity/safety/SafetyExternalStaff.java deleted file mode 100644 index f1735866..00000000 --- a/src/com/sipai/entity/safety/SafetyExternalStaff.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.entity.safety; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -@Data -public class SafetyExternalStaff extends SQLAdapter { - private String id; - - private String name; - - private String sex; - - private String company; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String birthday; - - private String usherId; - - private String usherDept; - - private String duty; - - private String jobTitle; - - private String idcard; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private String createTime; - - - private String _usherName; -} diff --git a/src/com/sipai/entity/safety/SafetyFiles.java b/src/com/sipai/entity/safety/SafetyFiles.java deleted file mode 100644 index 1d079c5f..00000000 --- a/src/com/sipai/entity/safety/SafetyFiles.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.entity.safety; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyFiles extends SQLAdapter { - - private String id; - - private String fileName; - - private String originalFileName; - - private Date uploadTime; - - private String absolutePath; - - private String accessUrl; - - private Integer functionCode; - - private Integer statusCode; - - private String bizId; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyFilesVo.java b/src/com/sipai/entity/safety/SafetyFilesVo.java deleted file mode 100644 index 8ddca860..00000000 --- a/src/com/sipai/entity/safety/SafetyFilesVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -import java.util.List; - - /** - * 文件列表对象 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ -@Data -public class SafetyFilesVo { - /** - * 文件列表标题 - */ - private String fileListTitle; - /** - * 是否可编辑 - */ - private Boolean isEditable; - /** - * 文件列表标题 - */ - private List fileList; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyFlowTask.java b/src/com/sipai/entity/safety/SafetyFlowTask.java deleted file mode 100644 index 85b5bdfe..00000000 --- a/src/com/sipai/entity/safety/SafetyFlowTask.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.safety; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyFlowTask extends SQLAdapter { - private String id; - - private String bizId; - - private String taskName; - - private Boolean isDone; - - private String doneTime; - - private String auditor; - - private String copy; - - private String createTime; -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyFlowTaskDetail.java b/src/com/sipai/entity/safety/SafetyFlowTaskDetail.java deleted file mode 100644 index 69324a8c..00000000 --- a/src/com/sipai/entity/safety/SafetyFlowTaskDetail.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.entity.safety; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyFlowTaskDetail extends SQLAdapter { - private String id; - - private String flowTaskId; - - private String record; - - private String createTime; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyFlowTaskVo.java b/src/com/sipai/entity/safety/SafetyFlowTaskVo.java deleted file mode 100644 index 59a43419..00000000 --- a/src/com/sipai/entity/safety/SafetyFlowTaskVo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyFlowTaskVo extends SafetyFlowTask { - - private List recordList = new ArrayList<>(); - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyInternalCertificateExcel.java b/src/com/sipai/entity/safety/SafetyInternalCertificateExcel.java deleted file mode 100644 index 1949c2f5..00000000 --- a/src/com/sipai/entity/safety/SafetyInternalCertificateExcel.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.entity.safety; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -@Data -@ColumnWidth(20) -public class SafetyInternalCertificateExcel { - /** - * 工号 - */ - @ExcelProperty(value = "工号", index = 0) - private String userCardId; - /** - * 所属部门 - */ - @ColumnWidth(25) - @ExcelProperty(value = "所属部门", index = 1) - private String deptName; - /** - * 姓名 - */ - @ColumnWidth(15) - @ExcelProperty(value = "姓名", index = 2) - private String caption; - /** - * 证书名称 - */ - @ExcelProperty(value = "证书名称", index = 3) - private String certificateName; - @ExcelProperty(value = "证书编号", index = 4) - private String certificateNo; - - @ExcelProperty(value = "作业项目代码", index = 5) - private String jobCode; - - @ExcelProperty(value = "作业类型", index = 6) - private String jobType; - - @ExcelProperty(value = "发证机构", index = 7) - private String issuingAuthority; - - /** - * 领证时间 - */ - @ColumnWidth(15) - @ExcelProperty(value = "领证时间", index = 8) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String issueDate; - - /** - * 有效期至 - */ - @ColumnWidth(15) - @ExcelProperty(value = "有效期至", index = 9) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String expirationDate; - -} diff --git a/src/com/sipai/entity/safety/SafetyInternalCertificateVo.java b/src/com/sipai/entity/safety/SafetyInternalCertificateVo.java deleted file mode 100644 index 0b462cd7..00000000 --- a/src/com/sipai/entity/safety/SafetyInternalCertificateVo.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.entity.safety; - -/** - * 内部人员证书 - */ -public class SafetyInternalCertificateVo extends SafetyCertificate { - - /** - * 翻译 人员名称 - */ - private String caption; - /** - * 翻译 人员工号 - */ - private String userCardId; - /** - * 翻译 人员所属部门 - */ - private String deptName; - /** - * 翻译 人员所属ID - */ - private String deptId; - - /** - * 文件实体 - */ - private SafetyFiles safetyFiles; - - /** - * 文件ID - */ - private String fileId; - - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getUserCardId() { - return userCardId; - } - - public void setUserCardId(String userCardId) { - this.userCardId = userCardId; - } - - public String getDeptName() { - return deptName; - } - - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public SafetyFiles getSafetyFiles() { - return safetyFiles; - } - - public void setSafetyFiles(SafetyFiles safetyFiles) { - this.safetyFiles = safetyFiles; - } - - - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId; - } -} diff --git a/src/com/sipai/entity/safety/SafetyJobCommonQuery.java b/src/com/sipai/entity/safety/SafetyJobCommonQuery.java deleted file mode 100644 index cc62f405..00000000 --- a/src/com/sipai/entity/safety/SafetyJobCommonQuery.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyJobCommonQuery extends SafetyCommonQuery { - - private Integer jobType; - - private String jobCompany; - - private String competentDeptId; - - private Integer jobStatus; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyJobInside.java b/src/com/sipai/entity/safety/SafetyJobInside.java deleted file mode 100644 index f19d4a0c..00000000 --- a/src/com/sipai/entity/safety/SafetyJobInside.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.entity.safety; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyJobInside extends SQLAdapter { - private String id; - - private String createUserId; - - private String createUserName; - - private String jobCode; - - private String jobType; - - private String jobLocation; - - private String jobCompany; - - private String competentDeptId; - - private String competentDeptName; - - private String competentAdvice; - - private String projectBeginDate; - - private String projectEndDate; - - private String dutyUserId; - - private String dutyUserName; - - private String contact; - - private String jobContent; - - private String countersignUserId; - - private String countersignUserName; - - private String copyUserId; - - private String copyUserName; - - private Integer countersignStatus; - - private String countersignDetail; - - private Integer jobStatus; - - private String processInstanceId; -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyJobInsideSignInfo.java b/src/com/sipai/entity/safety/SafetyJobInsideSignInfo.java deleted file mode 100644 index 8d911bf7..00000000 --- a/src/com/sipai/entity/safety/SafetyJobInsideSignInfo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; - -@Data -public class SafetyJobInsideSignInfo { - private String deptName; - private String userName; - private String pass; - private String time; - private String remark; - -} - diff --git a/src/com/sipai/entity/safety/SafetyJobInsideVo.java b/src/com/sipai/entity/safety/SafetyJobInsideVo.java deleted file mode 100644 index 65161100..00000000 --- a/src/com/sipai/entity/safety/SafetyJobInsideVo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyJobInsideVo extends SafetyJobInside { - - - private String jobTypeName; - - - private String jobStatusName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/safety/SafetyJobOutside.java b/src/com/sipai/entity/safety/SafetyJobOutside.java deleted file mode 100644 index c5384cc3..00000000 --- a/src/com/sipai/entity/safety/SafetyJobOutside.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.safety; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyJobOutside extends SQLAdapter { - private String id; - /** - * 发起人id - */ - private String createUserId; - /** - * 发起人name - */ - private String createUserName; - /** - * 作业编号 - */ - private String jobCode; - /** - * 作业类型 - */ - private String jobType; - /** - * 作业地点 - */ - private String jobLocation; - /** - * 作业单位 - */ - private String jobCompany; - /** - * 主管部门id - */ - private String competentDeptId; - /** - * 主管部门name - */ - private String competentDeptName; - /** - * 主管部门意见 - */ - private String competentAdvice; - /** - * 项目开始日期 - */ - private String projectBeginDate; - /** - * 项目结束日期 - */ - private String projectEndDate; - /** - * 作业负责人id - */ - private String dutyUserId; - /** - * 作业负责人name - */ - private String dutyUserName; - /** - * 联系方式 - */ - private String contact; - /** - * 作业内容 - */ - private String jobContent; - /** - * 状态 - */ - private Integer jobStatus; - -} - diff --git a/src/com/sipai/entity/safety/SafetyJobOutsideVo.java b/src/com/sipai/entity/safety/SafetyJobOutsideVo.java deleted file mode 100644 index d08bcfa6..00000000 --- a/src/com/sipai/entity/safety/SafetyJobOutsideVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.safety; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class SafetyJobOutsideVo extends SafetyJobOutside { - - private String jobTypeName; - - private String jobStatusName; - -} diff --git a/src/com/sipai/entity/safety/SafetyStaffArchives.java b/src/com/sipai/entity/safety/SafetyStaffArchives.java deleted file mode 100644 index 5d861869..00000000 --- a/src/com/sipai/entity/safety/SafetyStaffArchives.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.entity.safety; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -@Data -public class SafetyStaffArchives extends SQLAdapter { - private String userid; - - private String idcard; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String birthday; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String workTime; - - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") - private String hiredate; - - private String post; - - private String duty; - - private String jobTitle; - - private String createTime; - -} diff --git a/src/com/sipai/entity/safety/SafetyStaffArchivesExcel.java b/src/com/sipai/entity/safety/SafetyStaffArchivesExcel.java deleted file mode 100644 index dfa23ab5..00000000 --- a/src/com/sipai/entity/safety/SafetyStaffArchivesExcel.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.entity.safety; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -@Data -@ColumnWidth(20) -public class SafetyStaffArchivesExcel{ - /** - * 工号 - */ - @ExcelProperty(value = "工号", index = 0) - private String userCardId; - /** - * 所属部门 - */ - @ExcelProperty(value = "所属部门", index = 1) - private String deptName; - /** - * 姓名 - */ - @ExcelProperty(value = "姓名", index = 2) - private String caption; - /** - * 性别翻译 - */ - @ExcelProperty(value = "性别", index = 3) - private String sexText; - - @ExcelProperty(value = "身份证号", index = 4) - private String idcard; - - @ExcelProperty(value = "出生日期", index = 5) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String birthday; - - @ExcelProperty(value = "参加工作时间", index = 6) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern = "yyyy-MM-dd") - private String workTime; - - @ExcelProperty(value = "入职本司时间", index = 7) - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") - private String hiredate; - - @ExcelProperty(value = "从事岗位", index = 8) - private String post; - - @ExcelProperty(value = "职务", index = 9) - private String duty; - - @ExcelProperty(value = "职称", index = 10) - private String jobTitle; - -} diff --git a/src/com/sipai/entity/safety/SafetyStaffArchivesVo.java b/src/com/sipai/entity/safety/SafetyStaffArchivesVo.java deleted file mode 100644 index 024a23cf..00000000 --- a/src/com/sipai/entity/safety/SafetyStaffArchivesVo.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.entity.safety; - - -import lombok.Data; - -@Data -public class SafetyStaffArchivesVo extends SafetyStaffArchives { - - /** - * 工号 - */ - private String userCardId; - /** - * 姓名 - */ - private String caption; - /** - * 性别 - */ - private String sex; - /** - * 性别翻译 - */ - private String sexText; - /** - * 所属部门 - */ - private String deptName; - - -} diff --git a/src/com/sipai/entity/scada/DataSummary.java b/src/com/sipai/entity/scada/DataSummary.java deleted file mode 100644 index ea343803..00000000 --- a/src/com/sipai/entity/scada/DataSummary.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class DataSummary extends SQLAdapter{ - private String id; - - private String insdt; - - private String parmvalue; - - private String uploaddt; - - private String display; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getParmvalue() { - return parmvalue; - } - - public void setParmvalue(String parmvalue) { - this.parmvalue = parmvalue; - } - - public String getUploaddt() { - return uploaddt; - } - - public void setUploaddt(String uploaddt) { - this.uploaddt = uploaddt; - } - - public String getDisplay() { - return display; - } - - public void setDisplay(String display) { - this.display = display; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPoint.java b/src/com/sipai/entity/scada/MPoint.java deleted file mode 100644 index 07b14709..00000000 --- a/src/com/sipai/entity/scada/MPoint.java +++ /dev/null @@ -1,821 +0,0 @@ -package com.sipai.entity.scada; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -import net.sf.json.JSONArray; -import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.annotations.*; -import org.springframework.stereotype.Component; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.List; - -@Mapping(mappingPath = "mpoint_search_mapping.json") -@Setting(settingPath = "mpoint_search_setting.json") -@Document(indexName = "es_measurepoint", type = "esmeasurepoint") -@Component -public class MPoint extends SQLAdapter implements Serializable { - //所有项目都使用启用、禁用 如用的是0和1需要从数据库改掉 sj 2021-02-07 - public static String Flag_Enable="启用"; - public static String Flag_Disable="禁用"; - - public static String Flag_Sql="sql"; - public static String Flag_Modbus="modbus"; - public static String Flag_LinkData="link"; - - public static String Flag_Type_KPI="KPI"; - public static String Flag_Type_Hand="hand"; - public static String Flag_Type_Data="auto"; - public static String Flag_Type_CAL="CAL";//单元格计算测量点 - public static String Flag_Type_Model="model"; - - public static String Flag_BizType_Hand="Manual"; - public static String Flag_BizType_Auto="auto";//自动转发 - - private String id; - private String mpointid; - private String mpointcode; - // @Field(name="parmname") - private String parmname; - private String unit; - private BigDecimal alarmmax; - private BigDecimal alarmmin; - private BigDecimal halarmmax; - private BigDecimal lalarmmin; - private BigDecimal parmvalue; - private String parmvalueStr; - @Field(type = FieldType.Date) - private String measuredt; - private BigDecimal rate; - private Integer freq; - private String frequnit; - private String signaltype; - @JsonProperty("signaltag") - private String signaltag; - private String ledtype; - private String ledcolor; - private String directtype; - private String bizid; - private String biztype; - private String numtail; - private String prochour; - private String procday; - private String procmonth; - private String showname; - private String exp; - private BigDecimal forcemin; - private BigDecimal forcemax; - private BigDecimal avgmax; - private BigDecimal avgmin; - private String remoteup; - private Integer morder; - private String triggeralarm; - private String confirmalarm; - private BigDecimal flowset; - private String triggercycle; - private BigDecimal cyclemax; - private BigDecimal cyclemin; - private String triggermutation; - private BigDecimal mutationset; - private BigDecimal causeset; - private BigDecimal operateset; - private BigDecimal resultset; - private String triggerequoff; - private String mathop; - private String valuetype; - private String valuemeaning; - private String active; - private String soundalarm; - private String scdtype; - private BigDecimal spanrange; - private String modbusfigid; - private String register; - private String processsectioncode; - private String equipmentid; - @JsonProperty("source_type") - private String sourceType; - @JsonProperty("patrol_type") - private String patrolType; - private String remark; - private Integer alarmLevel; - private String structureId; - - private String bizname; - private String disname; - - private int subscriptionStatus; - - private String text;//用于树形显示 sj 2020-07-18 - - private List mPointHistory; - private EquipmentCard equipmentCard;//设备 - private ProcessSection processSection;//工艺段 - private Company company;//工艺段 - - //用于app接口使用,无需添加字段 - private JSONArray valuemeaningArray; - private Boolean valuemeaningFlag; - - //用于数据填报,无需添加字段 - private String timeType; - private Integer offset; - - - private List mPointFormulalist; - - - private List mPointPropSource; - - private MPointProp mPointProp; - - - public MPointProp getmPointProp() { - return mPointProp; - } - - public void setmPointProp(MPointProp mPointProp) { - this.mPointProp = mPointProp; - } - - public List getmPointPropSource() { - return mPointPropSource; - } - - public void setmPointPropSource(List mPointPropSource) { - this.mPointPropSource = mPointPropSource; - } - - - - public List getmPointFormulalist() { - return mPointFormulalist; - } - - public void setmPointFormulalist(List mPointFormulalist) { - this.mPointFormulalist = mPointFormulalist; - } - - public String getTimeType() { - return timeType; - } - - public void setTimeType(String timeType) { - this.timeType = timeType; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public JSONArray getValuemeaningArray() { - return valuemeaningArray; - } - - public void setValuemeaningArray(JSONArray valuemeaningArray) { - this.valuemeaningArray = valuemeaningArray; - } - - public Boolean getValuemeaningFlag() { - return valuemeaningFlag; - } - - public void setValuemeaningFlag(Boolean valuemeaningFlag) { - this.valuemeaningFlag = valuemeaningFlag; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpointid() { - return mpointid; - } - - public void setMpointid(String mpointid) { - this.mpointid = mpointid; - } - - public String getMpointcode() { - return mpointcode; - } - - public void setMpointcode(String mpointcode) { - this.mpointcode = mpointcode; - } - - public String getParmname() { - return parmname; - } - - public void setParmname(String parmname) { - this.parmname = parmname; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public BigDecimal getAlarmmax() { - return alarmmax; - } - - public void setAlarmmax(BigDecimal alarmmax) { - this.alarmmax = alarmmax; - } - - public BigDecimal getAlarmmin() { - return alarmmin; - } - - public void setAlarmmin(BigDecimal alarmmin) { - this.alarmmin = alarmmin; - } - - public BigDecimal getHalarmmax() { - return halarmmax; - } - - public void setHalarmmax(BigDecimal halarmmax) { - this.halarmmax = halarmmax; - } - - public BigDecimal getLalarmmin() { - return lalarmmin; - } - - public void setLalarmmin(BigDecimal lalarmmin) { - this.lalarmmin = lalarmmin; - } - - public BigDecimal getParmvalue() { - return parmvalue; - } - - public void setParmvalue(BigDecimal parmvalue) { - this.parmvalue = parmvalue; - } - - public String getParmvalueStr() { - return parmvalueStr; - } - - public void setParmvalueStr(String parmvalueStr) { - this.parmvalueStr = parmvalueStr; - } - - public String getMeasuredt() { - return measuredt; - } - - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - - public BigDecimal getRate() { - return rate; - } - - public void setRate(BigDecimal rate) { - this.rate = rate; - } - - public Integer getFreq() { - return freq; - } - - public void setFreq(Integer freq) { - this.freq = freq; - } - - public String getFrequnit() { - return frequnit; - } - - public void setFrequnit(String frequnit) { - this.frequnit = frequnit; - } - - public String getSignaltype() { - return signaltype; - } - - public void setSignaltype(String signaltype) { - this.signaltype = signaltype; - } - - public String getSignaltag() { - return signaltag; - } - - public void setSignaltag(String signaltag) { - this.signaltag = signaltag; - } - - public String getLedtype() { - return ledtype; - } - - public void setLedtype(String ledtype) { - this.ledtype = ledtype; - } - - public String getLedcolor() { - return ledcolor; - } - - public void setLedcolor(String ledcolor) { - this.ledcolor = ledcolor; - } - - public String getDirecttype() { - return directtype; - } - - public void setDirecttype(String directtype) { - this.directtype = directtype; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getBiztype() { - return biztype; - } - - public void setBiztype(String biztype) { - this.biztype = biztype; - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail; - } - - public String getProchour() { - return prochour; - } - - public void setProchour(String prochour) { - this.prochour = prochour; - } - - public String getProcday() { - return procday; - } - - public void setProcday(String procday) { - this.procday = procday; - } - - public String getProcmonth() { - return procmonth; - } - - public void setProcmonth(String procmonth) { - this.procmonth = procmonth; - } - - public String getShowname() { - return showname; - } - - public void setShowname(String showname) { - this.showname = showname; - } - - public String getExp() { - return exp; - } - - public void setExp(String exp) { - this.exp = exp; - } - - public BigDecimal getForcemin() { - return forcemin; - } - - public void setForcemin(BigDecimal forcemin) { - this.forcemin = forcemin; - } - - public BigDecimal getForcemax() { - return forcemax; - } - - public void setForcemax(BigDecimal forcemax) { - this.forcemax = forcemax; - } - - public BigDecimal getAvgmax() { - return avgmax; - } - - public void setAvgmax(BigDecimal avgmax) { - this.avgmax = avgmax; - } - - public BigDecimal getAvgmin() { - return avgmin; - } - - public void setAvgmin(BigDecimal avgmin) { - this.avgmin = avgmin; - } - - public String getRemoteup() { - return remoteup; - } - - public void setRemoteup(String remoteup) { - this.remoteup = remoteup; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getTriggeralarm() { - return triggeralarm; - } - - public void setTriggeralarm(String triggeralarm) { - this.triggeralarm = triggeralarm; - } - - public String getConfirmalarm() { - return confirmalarm; - } - - public void setConfirmalarm(String confirmalarm) { - this.confirmalarm = confirmalarm; - } - - public BigDecimal getFlowset() { - return flowset; - } - - public void setFlowset(BigDecimal flowset) { - this.flowset = flowset; - } - - public String getTriggercycle() { - return triggercycle; - } - - public void setTriggercycle(String triggercycle) { - this.triggercycle = triggercycle; - } - - public BigDecimal getCyclemax() { - return cyclemax; - } - - public void setCyclemax(BigDecimal cyclemax) { - this.cyclemax = cyclemax; - } - - public BigDecimal getCyclemin() { - return cyclemin; - } - - public void setCyclemin(BigDecimal cyclemin) { - this.cyclemin = cyclemin; - } - - public String getTriggermutation() { - return triggermutation; - } - - public void setTriggermutation(String triggermutation) { - this.triggermutation = triggermutation; - } - - public BigDecimal getMutationset() { - return mutationset; - } - - public void setMutationset(BigDecimal mutationset) { - this.mutationset = mutationset; - } - - public BigDecimal getCauseset() { - return causeset; - } - - public void setCauseset(BigDecimal causeset) { - this.causeset = causeset; - } - - public BigDecimal getOperateset() { - return operateset; - } - - public void setOperateset(BigDecimal operateset) { - this.operateset = operateset; - } - - public BigDecimal getResultset() { - return resultset; - } - - public void setResultset(BigDecimal resultset) { - this.resultset = resultset; - } - - public String getTriggerequoff() { - return triggerequoff; - } - - public void setTriggerequoff(String triggerequoff) { - this.triggerequoff = triggerequoff; - } - - public String getMathop() { - return mathop; - } - - public void setMathop(String mathop) { - this.mathop = mathop; - } - - public String getValuetype() { - return valuetype; - } - - public void setValuetype(String valuetype) { - this.valuetype = valuetype; - } - - public String getValuemeaning() { - return valuemeaning; - } - - public void setValuemeaning(String valuemeaning) { - this.valuemeaning = valuemeaning; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getSoundalarm() { - return soundalarm; - } - - public void setSoundalarm(String soundalarm) { - this.soundalarm = soundalarm; - } - - public String getScdtype() { - return scdtype; - } - - public void setScdtype(String scdtype) { - this.scdtype = scdtype; - } - - public BigDecimal getSpanrange() { - return spanrange; - } - - public void setSpanrange(BigDecimal spanrange) { - this.spanrange = spanrange; - } - - public String getModbusfigid() { - return modbusfigid; - } - - public void setModbusfigid(String modbusfigid) { - this.modbusfigid = modbusfigid; - } - - public String getRegister() { - return register; - } - - public void setRegister(String register) { - this.register = register; - } - - public String getProcesssectioncode() { - return processsectioncode; - } - - public void setProcesssectioncode(String processsectioncode) { - this.processsectioncode = processsectioncode; - } - - public String getEquipmentid() { - return equipmentid; - } - - public void setEquipmentid(String equipmentid) { - this.equipmentid = equipmentid; - } - - public String getSourceType() { - return sourceType; - } - - public void setSourceType(String sourceType) { - this.sourceType = sourceType; - } - - public String getPatrolType() { - return patrolType; - } - - public void setPatrolType(String patrolType) { - this.patrolType = patrolType; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getAlarmLevel() { - return alarmLevel; - } - - public void setAlarmLevel(Integer alarmLevel) { - this.alarmLevel = alarmLevel; - } - - public String getBizname() { - return bizname; - } - - public void setBizname(String bizname) { - this.bizname = bizname; - } - - public String getDisname() { - return disname; - } - - public void setDisname(String disname) { - this.disname = disname; - } - - public int getSubscriptionStatus() { - return subscriptionStatus; - } - - public void setSubscriptionStatus(int subscriptionStatus) { - this.subscriptionStatus = subscriptionStatus; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public List getmPointHistory() { - return mPointHistory; - } - - public void setmPointHistory(List mPointHistory) { - this.mPointHistory = mPointHistory; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public String getStructureId() { - return structureId; - } - - public void setStructureId(String structureId) { - this.structureId = structureId; - } - - @Override - public String toString() { - return "MPoint{" + - "id='" + id + '\'' + - ", mpointid='" + mpointid + '\'' + - ", mpointcode='" + mpointcode + '\'' + - ", parmname='" + parmname + '\'' + - ", unit='" + unit + '\'' + - ", alarmmax=" + alarmmax + - ", alarmmin=" + alarmmin + - ", parmvalue=" + parmvalue + - ", measuredt='" + measuredt + '\'' + - ", rate=" + rate + - ", freq=" + freq + - ", frequnit='" + frequnit + '\'' + - ", signaltype='" + signaltype + '\'' + - ", ledtype='" + ledtype + '\'' + - ", ledcolor='" + ledcolor + '\'' + - ", directtype='" + directtype + '\'' + - ", bizid='" + bizid + '\'' + - ", biztype='" + biztype + '\'' + - ", numtail='" + numtail + '\'' + - ", prochour='" + prochour + '\'' + - ", procday='" + procday + '\'' + - ", procmonth='" + procmonth + '\'' + - ", showname='" + showname + '\'' + - ", exp='" + exp + '\'' + - ", forcemin=" + forcemin + - ", forcemax=" + forcemax + - ", avgmax=" + avgmax + - ", avgmin=" + avgmin + - ", remoteup='" + remoteup + '\'' + - ", morder=" + morder + - ", triggeralarm='" + triggeralarm + '\'' + - ", confirmalarm='" + confirmalarm + '\'' + - ", flowset=" + flowset + - ", triggercycle='" + triggercycle + '\'' + - ", cyclemax=" + cyclemax + - ", cyclemin=" + cyclemin + - ", triggermutation='" + triggermutation + '\'' + - ", mutationset=" + mutationset + - ", causeset=" + causeset + - ", operateset=" + operateset + - ", resultset=" + resultset + - ", triggerequoff='" + triggerequoff + '\'' + - ", mathop='" + mathop + '\'' + - ", valuetype='" + valuetype + '\'' + - ", valuemeaning='" + valuemeaning + '\'' + - ", active='" + active + '\'' + - ", soundalarm='" + soundalarm + '\'' + - ", scdtype='" + scdtype + '\'' + - ", spanrange=" + spanrange + - ", modbusfigid='" + modbusfigid + '\'' + - ", register='" + register + '\'' + - ", processsectioncode='" + processsectioncode + '\'' + - ", equipmentid='" + equipmentid + '\'' + - ", source_type='" + sourceType + '\'' + - ", patrolType='" + patrolType + '\'' + - ", remark='" + remark + '\'' + - ", alarmLevel=" + alarmLevel + - ", bizname='" + bizname + '\'' + - ", disname='" + disname + '\'' + - ", structureId='" + structureId + '\'' + - '}'; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } -} diff --git a/src/com/sipai/entity/scada/MPoint4APP.java b/src/com/sipai/entity/scada/MPoint4APP.java deleted file mode 100644 index ac57910a..00000000 --- a/src/com/sipai/entity/scada/MPoint4APP.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.entity.scada; - -import java.io.Serializable; -import java.math.BigDecimal; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; - -@Component -public class MPoint4APP extends SQLAdapter implements Serializable{ - - /** - * - */ - private static final long serialVersionUID = 5778434157441261738L; - private String id; - private String parmname; - private String mpointcode; - private String mpointid; - private String unit; - private BigDecimal alarmmax; - private BigDecimal alarmmin; - private BigDecimal parmvalue; - private String measuredt; - private String signalType; - private String biztype; - private String bizid; - private String valuemeaning; - private String disname; - private String numtail; - private BigDecimal rate; - private BigDecimal forcemin; - private BigDecimal forcemax; - private String userid; - private String structureId; - - public String getMpointid() { - return mpointid; - } - - public void setMpointid(String mpointid) { - this.mpointid = mpointid; - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail; - } - - public BigDecimal getRate() { - return rate; - } - - public void setRate(BigDecimal rate) { - this.rate = rate; - } - - public BigDecimal getForcemin() { - return forcemin; - } - - public void setForcemin(BigDecimal forcemin) { - this.forcemin = forcemin; - } - - public BigDecimal getForcemax() { - return forcemax; - } - - public void setForcemax(BigDecimal forcemax) { - this.forcemax = forcemax; - } - - public String getDisname() { - return disname; - } - - public void setDisname(String disname) { - this.disname = disname; - } - - public String getValuemeaning() { - return valuemeaning; - } - public void setValuemeaning(String valuemeaning) { - this.valuemeaning = valuemeaning; - } - public String getBiztype() { - return biztype; - } - public void setBiztype(String biztype) { - this.biztype = biztype; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getParmname() { - return parmname; - } - public void setParmname(String parmname) { - this.parmname = parmname; - } - public String getUnit() { - return unit; - } - public void setUnit(String unit) { - this.unit = unit; - } - public BigDecimal getAlarmmax() { - return alarmmax; - } - public void setAlarmmax(BigDecimal alarmmax) { - this.alarmmax = alarmmax; - } - public BigDecimal getAlarmmin() { - return alarmmin; - } - public void setAlarmmin(BigDecimal alarmmin) { - this.alarmmin = alarmmin; - } - public BigDecimal getParmvalue() { - return parmvalue; - } - public void setParmvalue(BigDecimal parmvalue) { - this.parmvalue = parmvalue; - } - public String getMeasuredt() { - return measuredt; - } - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - public String getSignalType() { - return signalType; - } - public void setSignalType(String signalType) { - this.signalType = signalType; - } - public String getMpointcode() { - return mpointcode; - } - public void setMpointcode(String mpointcode) { - this.mpointcode = mpointcode; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getStructureId() { - return structureId; - } - - public void setStructureId(String structureId) { - this.structureId = structureId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointExpand.java b/src/com/sipai/entity/scada/MPointExpand.java deleted file mode 100644 index 53a15245..00000000 --- a/src/com/sipai/entity/scada/MPointExpand.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.entity.scada; - - -import com.sipai.entity.base.SQLAdapter; - -/** - * 测量点拓展字段 - */ -public class MPointExpand extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String measurePointId; - - private String explain; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getMeasurePointId() { - return measurePointId; - } - - public void setMeasurePointId(String measurePointId) { - this.measurePointId = measurePointId == null ? null : measurePointId.trim(); - } - - public String getExplain() { - return explain; - } - - public void setExplain(String explain) { - this.explain = explain == null ? null : explain.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointFormula.java b/src/com/sipai/entity/scada/MPointFormula.java deleted file mode 100644 index 0f25eafa..00000000 --- a/src/com/sipai/entity/scada/MPointFormula.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointFormula extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String mode;//采集方式 - - private String mpid; - - private String pmpid; - - private String formulaname; - - private Integer starthour;//计算开始时间 - - private String constant;//绑定常量,暂未用 - - private String datatype;//时间类型 - - private String collectiontype;//采集类型 同比、环比 - - private String numeratorcontent;//动态分母数 - - private MPoint mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getPmpid() { - return pmpid; - } - - public void setPmpid(String pmpid) { - this.pmpid = pmpid; - } - - public String getFormulaname() { - return formulaname; - } - - public void setFormulaname(String formulaname) { - this.formulaname = formulaname; - } - - public Integer getStarthour() { - return starthour; - } - - public void setStarthour(Integer starthour) { - this.starthour = starthour; - } - - public String getConstant() { - return constant; - } - - public void setConstant(String constant) { - this.constant = constant; - } - - public String getDatatype() { - return datatype; - } - - public void setDatatype(String datatype) { - this.datatype = datatype; - } - - public String getCollectiontype() { - return collectiontype; - } - - public void setCollectiontype(String collectiontype) { - this.collectiontype = collectiontype; - } - - public String getNumeratorcontent() { - return numeratorcontent; - } - - public void setNumeratorcontent(String numeratorcontent) { - this.numeratorcontent = numeratorcontent; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointFormulaAutoHour.java b/src/com/sipai/entity/scada/MPointFormulaAutoHour.java deleted file mode 100644 index 9a859bb9..00000000 --- a/src/com/sipai/entity/scada/MPointFormulaAutoHour.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointFormulaAutoHour extends SQLAdapter { - private String id; - - private String pid; - - private String sdt; - - private String edt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt == null ? null : sdt.trim(); - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt == null ? null : edt.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointFormulaDenominator.java b/src/com/sipai/entity/scada/MPointFormulaDenominator.java deleted file mode 100644 index 6cdf6665..00000000 --- a/src/com/sipai/entity/scada/MPointFormulaDenominator.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointFormulaDenominator extends SQLAdapter{ - private String id; - - private String pmpid; - - private String denominatorname; - - private String moleculename; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPmpid() { - return pmpid; - } - - public void setPmpid(String pmpid) { - this.pmpid = pmpid; - } - - public String getDenominatorname() { - return denominatorname; - } - - public void setDenominatorname(String denominatorname) { - this.denominatorname = denominatorname; - } - - public String getMoleculename() { - return moleculename; - } - - public void setMoleculename(String moleculename) { - this.moleculename = moleculename; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointHistory.java b/src/com/sipai/entity/scada/MPointHistory.java deleted file mode 100644 index ebe361cc..00000000 --- a/src/com/sipai/entity/scada/MPointHistory.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.sipai.entity.scada; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class MPointHistory extends SQLAdapter implements Serializable { - - - /** - * - */ - private static final long serialVersionUID = 4552977217414444717L; - - private Long itemid; - - private BigDecimal parmvalue; - - private String measuredt; - - private String memotype; - - private String memo; - - private String userid; - - private String insdt; - - private String tbName; - - //为报表展示使用 SIPAIIS_WMS - private String year; - private String month; - private String day; - private String hour; - private String min; - private BigDecimal oldData; - - // 展示用户 - private User user; - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public Long getItemid() { - return itemid; - } - - public void setItemid(Long itemid) { - this.itemid = itemid; - } - - public BigDecimal getParmvalue() { - return parmvalue; - } - - public void setParmvalue(BigDecimal parmvalue) { - this.parmvalue = parmvalue; - } - - public String getMeasuredt() { - return measuredt; - } - - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - - public String getMemotype() { - return memotype; - } - - public void setMemotype(String memotype) { - this.memotype = memotype; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getTbName() { - return tbName; - } - - public void setTbName(String tbName) { - this.tbName = tbName; - } - - public String getYear() { - return year; - } - - public void setYear(String year) { - this.year = year; - } - - public String getMonth() { - return month; - } - - public void setMonth(String month) { - this.month = month; - } - - public String getDay() { - return day; - } - - public void setDay(String day) { - this.day = day; - } - - public String getHour() { - return hour; - } - - public void setHour(String hour) { - this.hour = hour; - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min; - } - - public static long getSerialversionuid() { - return serialVersionUID; - } - - public BigDecimal getOldData() { - return oldData; - } - - public void setOldData(BigDecimal oldData) { - this.oldData = oldData; - } -} diff --git a/src/com/sipai/entity/scada/MPointProgramme.java b/src/com/sipai/entity/scada/MPointProgramme.java deleted file mode 100644 index 2636aa70..00000000 --- a/src/com/sipai/entity/scada/MPointProgramme.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.entity.scada; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointProgramme extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 3592251693054728880L; - - private String id; - - private String name; - - private String hismin; - - private String hishour; - - private String hisday; - - private String active; - - private Integer morder; - - private String owneruserid; - - private String ownerdate; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getHismin() { - return hismin; - } - - public void setHismin(String hismin) { - this.hismin = hismin; - } - - public String getHishour() { - return hishour; - } - - public void setHishour(String hishour) { - this.hishour = hishour; - } - - public String getHisday() { - return hisday; - } - - public void setHisday(String hisday) { - this.hisday = hisday; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getOwneruserid() { - return owneruserid; - } - - public void setOwneruserid(String owneruserid) { - this.owneruserid = owneruserid; - } - - public String getOwnerdate() { - return ownerdate; - } - - public void setOwnerdate(String ownerdate) { - this.ownerdate = ownerdate; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointProgrammeDetail.java b/src/com/sipai/entity/scada/MPointProgrammeDetail.java deleted file mode 100644 index 08a2ef60..00000000 --- a/src/com/sipai/entity/scada/MPointProgrammeDetail.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.sipai.entity.scada; - -import java.io.Serializable; -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointProgrammeDetail extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 3592251693054728880L; - private String id; - - private String faid; - - private String mps; - - private String func; - - private String axesorder; - - private String disname; - - private BigDecimal avgmin; - - private BigDecimal avgmax; - - private BigDecimal forcemin; - - private BigDecimal forcemax; - - private String color; - - private BigDecimal morder; - - private String fmt; - - private BigDecimal axismax; - - private BigDecimal axismin; - - private BigDecimal spanrange; - - private String numtail; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getFaid() { - return faid; - } - - public void setFaid(String faid) { - this.faid = faid; - } - - public String getMps() { - return mps; - } - - public void setMps(String mps) { - this.mps = mps; - } - - public String getFunc() { - return func; - } - - public void setFunc(String func) { - this.func = func; - } - - public String getAxesorder() { - return axesorder; - } - - public void setAxesorder(String axesorder) { - this.axesorder = axesorder; - } - - public String getDisname() { - return disname; - } - - public void setDisname(String disname) { - this.disname = disname; - } - - public BigDecimal getAvgmin() { - return avgmin; - } - - public void setAvgmin(BigDecimal avgmin) { - this.avgmin = avgmin; - } - - public BigDecimal getAvgmax() { - return avgmax; - } - - public void setAvgmax(BigDecimal avgmax) { - this.avgmax = avgmax; - } - - public BigDecimal getForcemin() { - return forcemin; - } - - public void setForcemin(BigDecimal forcemin) { - this.forcemin = forcemin; - } - - public BigDecimal getForcemax() { - return forcemax; - } - - public void setForcemax(BigDecimal forcemax) { - this.forcemax = forcemax; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public BigDecimal getMorder() { - return morder; - } - - public void setMorder(BigDecimal morder) { - this.morder = morder; - } - - public String getFmt() { - return fmt; - } - - public void setFmt(String fmt) { - this.fmt = fmt; - } - - public BigDecimal getAxismax() { - return axismax; - } - - public void setAxismax(BigDecimal axismax) { - this.axismax = axismax; - } - - public BigDecimal getAxismin() { - return axismin; - } - - public void setAxismin(BigDecimal axismin) { - this.axismin = axismin; - } - - public BigDecimal getSpanrange() { - return spanrange; - } - - public void setSpanrange(BigDecimal spanrange) { - this.spanrange = spanrange; - } - - public String getNumtail() { - return numtail; - } - - public void setNumtail(String numtail) { - this.numtail = numtail; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointProp.java b/src/com/sipai/entity/scada/MPointProp.java deleted file mode 100644 index 52c208b2..00000000 --- a/src/com/sipai/entity/scada/MPointProp.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.scada; - -import java.util.Date; - -import javax.management.loading.PrivateClassLoader; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class MPointProp extends SQLAdapter{ - //计算范围 - public static String Flag_Cal_Range_Hour_1="1h"; - public static String Flag_Cal_Range_Hour_8="8h"; - public static String Flag_Cal_Range_Day_1="1d"; - public static String Flag_Cal_Range_Month_1="1m"; - public static String Flag_Cal_Range_Year_1="1y"; - public static String Flag_Cal_Range_Day_7="7d"; - private String id; - - private String insdt; - - private String insuser; - - private String project; - - private String indexEvaluation; - - private String evaluationFormula; - - private String bizId; - - private Company company; - - private MPoint mpoint; - - private String pid; - private String calFreq; - private String calRange; - - private String starthour; - private String startday; - private String reserveMethod; - private String saveType; - private String saveTimeShifting; - - public String getCalFreq() { - return calFreq; - } - - public void setCalFreq(String calFreq) { - this.calFreq = calFreq; - } - - public String getCalRange() { - return calRange; - } - - public void setCalRange(String calRange) { - this.calRange = calRange; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public MPoint getMpoint() { - return mpoint; - } - - public void setMpoint(MPoint mpoint) { - this.mpoint = mpoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public String getIndexEvaluation() { - return indexEvaluation; - } - - public void setIndexEvaluation(String indexEvaluation) { - this.indexEvaluation = indexEvaluation; - } - - public String getEvaluationFormula() { - return evaluationFormula; - } - - public void setEvaluationFormula(String evaluationFormula) { - this.evaluationFormula = evaluationFormula; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getStarthour() { - return starthour; - } - - public void setStarthour(String starthour) { - this.starthour = starthour; - } - - public String getStartday() { - return startday; - } - - public void setStartday(String startday) { - this.startday = startday; - } - - public String getReserveMethod() { - return reserveMethod; - } - - public void setReserveMethod(String reserveMethod) { - this.reserveMethod = reserveMethod; - } - - public String getSaveType() { - return saveType; - } - - public void setSaveType(String saveType) { - this.saveType = saveType; - } - - public String getSaveTimeShifting() { - return saveTimeShifting; - } - - public void setSaveTimeShifting(String saveTimeShifting) { - this.saveTimeShifting = saveTimeShifting; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointPropSource.java b/src/com/sipai/entity/scada/MPointPropSource.java deleted file mode 100644 index b90ef802..00000000 --- a/src/com/sipai/entity/scada/MPointPropSource.java +++ /dev/null @@ -1,272 +0,0 @@ -package com.sipai.entity.scada; - -import java.io.Serializable; -import java.util.Date; - -import org.springframework.data.elasticsearch.annotations.Document; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.sipai.entity.base.SQLAdapter; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldType; - -@Document(indexName = "es_mpointpropsource", type = "esmpointpropsource") -public class MPointPropSource extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 3572693135756625832L; - - private MPoint mPoint; - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - /** - * 评价规则 - */ - public static String Type_evaluationRules_none=""; - public static String Type_evaluationRules_above=">"; - public static String Type_evaluationRules_above1=">="; - public static String Type_evaluationRules_below="<"; - public static String Type_evaluationRules_below1="<="; - public static String Type_evaluationRules_equal="="; - /** - * 取�?方式 - */ - public static String Type_valuetype_first="first"; - public static String Type_valuetype_avg="avg"; - public static String Type_valuetype_sum="sum"; - public static String Type_valuetype_max="max"; - public static String Type_valuetype_min="min"; - public static String Type_valuetype_top="count"; - public static String Type_valuetype_last="last"; - public static String Type_valuetype_bool="bool"; - //中位�? - public static String Type_valuetype_median="median"; - /** - * 计算方式 - */ - public static String Type_calculationtype_0="无"; - public static String Type_calculationtype_1="按比例得分"; - public static String Type_calculationtype_2="按固定值扣分"; - public static String Type_calculationtype_3="取数据行数"; - private String id; - @Field(type = FieldType.Date) - private String insdt; - - private String insuser; -// @ApiModelProperty(value="父测量点Id") - private String pid; - @JsonProperty("index_details") - private String indexDetails; - - private Double value; - - private String evaluationRules; - @JsonProperty("cal_range") -// @ApiModelProperty(value="计算频率") - private Integer calRange; - @JsonProperty("cal_range_unit") -// @ApiModelProperty(value="计算频率单位,TimeUnitEnum枚举型获取") - private String calRangeUnit; - - private Double targetValue; -// @ApiModelProperty(value="子测量点Id") - private String mpid; - - private String mpname; - @JsonProperty("value_type") -// @ApiModelProperty(value="取值类型,MPointPropValueTypeEnum枚举型获取") - private String valueType; - @JsonProperty("calculation_type") - private String calculationType; - - private Double score; - - private Double fixedDeductionValue; - - private String tbName; - - private String tbWhere; - - private String tbKeyName; - - private String deadline; - - private Integer morder; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getIndexDetails() { - return indexDetails; - } - - public void setIndexDetails(String indexDetails) { - this.indexDetails = indexDetails; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getEvaluationRules() { - return evaluationRules; - } - - public void setEvaluationRules(String evaluationRules) { - this.evaluationRules = evaluationRules; - } - - public Integer getCalRange() { - return calRange; - } - - public void setCalRange(Integer calRange) { - this.calRange = calRange; - } - - public String getCalRangeUnit() { - return calRangeUnit; - } - - public void setCalRangeUnit(String calRangeUnit) { - this.calRangeUnit = calRangeUnit; - } - - public Double getTargetValue() { - return targetValue; - } - - public void setTargetValue(Double targetValue) { - this.targetValue = targetValue; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public String getValueType() { - return valueType; - } - - public void setValueType(String valueType) { - this.valueType = valueType; - } - - public String getCalculationType() { - return calculationType; - } - - public void setCalculationType(String calculationType) { - this.calculationType = calculationType; - } - - public Double getScore() { - return score; - } - - public void setScore(Double score) { - this.score = score; - } - - public Double getFixedDeductionValue() { - return fixedDeductionValue; - } - - public void setFixedDeductionValue(Double fixedDeductionValue) { - this.fixedDeductionValue = fixedDeductionValue; - } - - public String getTbName() { - return tbName; - } - - public void setTbName(String tbName) { - this.tbName = tbName; - } - - public String getTbWhere() { - return tbWhere; - } - - public void setTbWhere(String tbWhere) { - this.tbWhere = tbWhere; - } - - public String getTbKeyName() { - return tbKeyName; - } - - public void setTbKeyName(String tbKeyName) { - this.tbKeyName = tbKeyName; - } - - public String getDeadline() { - return deadline; - } - - public void setDeadline(String deadline) { - this.deadline = deadline; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointPropSourceES.java b/src/com/sipai/entity/scada/MPointPropSourceES.java deleted file mode 100644 index b32a10f7..00000000 --- a/src/com/sipai/entity/scada/MPointPropSourceES.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.scada; - - -import com.alibaba.fastjson.JSON; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - - -public class MPointPropSourceES extends MPointPropSource{ - - private static final long serialVersionUID = -4204417542848415757L; - private String index_details; - private Integer cal_range; - private String cal_range_unit; - private String value_type; - private String calculation_type; - - public String getCalculation_type() { - return calculation_type; - } - - public void setCalculation_type(String calculation_type) { - this.calculation_type = calculation_type; - } - - public String getIndex_details() { - return index_details; - } - - public void setIndex_details(String index_details) { - this.index_details = index_details; - } - - public Integer getCal_range() { - return cal_range; - } - - public void setCal_range(Integer cal_range) { - this.cal_range = cal_range; - } - - public String getCal_range_unit() { - return cal_range_unit; - } - - public void setCal_range_unit(String cal_range_unit) { - this.cal_range_unit = cal_range_unit; - } - - public String getValue_type() { - return value_type; - } - - public void setValue_type(String value_type) { - this.value_type = value_type; - } - - public static MPointPropSourceES format(MPointPropSource mPointPropSource){ - String str = JSON.toJSONString(mPointPropSource); - MPointPropSourceES mPointES = JSON.parseObject(str, MPointPropSourceES.class); - //时间格式处理 - DateTimeFormatter dfES = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'"); - DateTimeFormatter dfSQL = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - if(mPointPropSource.getInsdt()!=null) { - try { - LocalDateTime insdt = LocalDateTime.parse(mPointPropSource.getInsdt().substring(0,19),dfSQL); - String insdtStr = dfES.format(insdt); - mPointES.setInsdt(insdtStr); - }catch(Exception e){ - - } - } - mPointES.setIndex_details(mPointPropSource.getIndexDetails()); - mPointES.setCal_range(mPointPropSource.getCalRange()); - mPointES.setCal_range_unit(mPointPropSource.getCalRangeUnit()); - mPointES.setValue_type(mPointPropSource.getValueType()); - return mPointES; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointPropTarget.java b/src/com/sipai/entity/scada/MPointPropTarget.java deleted file mode 100644 index 47338d17..00000000 --- a/src/com/sipai/entity/scada/MPointPropTarget.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.scada; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointPropTarget extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String mpid; - - private String mpname; - - private String time; - /** - * 统计时间范围 - */ - public static String Type_time_hour_1="1小时"; - public static String Type_time_hour_8="8小时"; - public static String Type_time_day="1天"; - public static String Type_time_month="1月"; - public static String Type_time_year="1年"; - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/MPointVectorValue.java b/src/com/sipai/entity/scada/MPointVectorValue.java deleted file mode 100644 index cc34c10d..00000000 --- a/src/com/sipai/entity/scada/MPointVectorValue.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.entity.scada; - -/** - * @Auther: wxp - * @Date: 2021/6/29 11:26 - * @Description: 测量点存储矩阵结果 - */ -public class MPointVectorValue extends MPoint{ - private static final long serialVersionUID = -3271890047144942278L; - private Double[] vectorValue; - - public Double[] getVectorValue() { - return vectorValue; - } - - public void setVectorValue(Double[] vectorValue) { - this.vectorValue = vectorValue; - } -} diff --git a/src/com/sipai/entity/scada/PersonalMpCollection.java b/src/com/sipai/entity/scada/PersonalMpCollection.java deleted file mode 100644 index 3ce95919..00000000 --- a/src/com/sipai/entity/scada/PersonalMpCollection.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class PersonalMpCollection extends SQLAdapter{ - private String id; - - private String userid; - - private String mpids; - - private String unitId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getMpids() { - return mpids; - } - - public void setMpids(String mpids) { - this.mpids = mpids; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/ProAlarm.java b/src/com/sipai/entity/scada/ProAlarm.java deleted file mode 100644 index 3a894ac8..00000000 --- a/src/com/sipai/entity/scada/ProAlarm.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -import java.math.BigDecimal; - -public class ProAlarm extends SQLAdapter { - //报警 - public static final String STATUS_ALARM = "0"; - //报警确认 - public static final String STATUS_ALARM_CONFIRM = "1"; - //报警恢复 - public static final String STATUS_ALARM_RECOVER = "2"; - - //报警数量 加 - public static final String C_type_add = "add"; - //报警数量 减 - public static final String C_type_reduce = "reduce"; - - private String id; - private String insdt; - private String alarmTime; - private String lastAlarmTime; - private String confirmTime; - - private String confirmContent;//确认内容 2024-03-04 sj 长岗项目开始新增 - private String recoverTime; - private String confirmerid; - private String confirmerName; - private BigDecimal recoverValue; - private String pointCode; - private String pointName; - private String status; - private String alarmLevel; - private String processSectionCode; - private String processSectionName; - private String patrolPointId; - private String bizId; - private String describe; - private String alarmType; - private String originalStatus;//报警记录值 - - private Integer num; - private String alarmTypeName; - private String alarmLevelName; - private String _date; - private MPoint mPoint; - private String duration;//持续时间 - private String alarmLine;//报警线 - - public String getConfirmContent() { - return confirmContent; - } - - public void setConfirmContent(String confirmContent) { - this.confirmContent = confirmContent; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getAlarmTime() { - return alarmTime; - } - - public void setAlarmTime(String alarmTime) { - this.alarmTime = alarmTime; - } - - public String getLastAlarmTime() { - return lastAlarmTime; - } - - public void setLastAlarmTime(String lastAlarmTime) { - this.lastAlarmTime = lastAlarmTime; - } - - public String getConfirmTime() { - return confirmTime; - } - - public void setConfirmTime(String confirmTime) { - this.confirmTime = confirmTime; - } - - public String getConfirmerid() { - return confirmerid; - } - - public void setConfirmerid(String confirmerid) { - this.confirmerid = confirmerid; - } - - public String getRecoverTime() { - return recoverTime; - } - - public void setRecoverTime(String recoverTime) { - this.recoverTime = recoverTime; - } - - public BigDecimal getRecoverValue() { - return recoverValue; - } - - public void setRecoverValue(BigDecimal recoverValue) { - this.recoverValue = recoverValue; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getProcessSectionCode() { - return processSectionCode; - } - - public void setProcessSectionCode(String processSectionCode) { - this.processSectionCode = processSectionCode; - } - - public String getProcessSectionName() { - return processSectionName; - } - - public void setProcessSectionName(String processSectionName) { - this.processSectionName = processSectionName; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public String getOriginalStatus() { - return originalStatus; - } - - public void setOriginalStatus(String originalStatus) { - this.originalStatus = originalStatus; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - - public String getPointCode() { - return pointCode; - } - - public void setPointCode(String pointCode) { - this.pointCode = pointCode; - } - - public String getPointName() { - return pointName; - } - - public void setPointName(String pointName) { - this.pointName = pointName; - } - - public String getAlarmType() { - return alarmType; - } - - public void setAlarmType(String alarmType) { - this.alarmType = alarmType; - } - - public String getAlarmLevel() { - return alarmLevel; - } - - public void setAlarmLevel(String alarmLevel) { - this.alarmLevel = alarmLevel; - } - - public String getAlarmTypeName() { - return alarmTypeName; - } - - public void setAlarmTypeName(String alarmTypeName) { - this.alarmTypeName = alarmTypeName; - } - - public String getAlarmLevelName() { - return alarmLevelName; - } - - public void setAlarmLevelName(String alarmLevelName) { - this.alarmLevelName = alarmLevelName; - } - - public String getConfirmerName() { - return confirmerName; - } - - public void setConfirmerName(String confirmerName) { - this.confirmerName = confirmerName; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public String getAlarmLine() { - return alarmLine; - } - - public void setAlarmLine(String alarmLine) { - this.alarmLine = alarmLine; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/ProAlarmBaseText.java b/src/com/sipai/entity/scada/ProAlarmBaseText.java deleted file mode 100644 index 355cc2ab..00000000 --- a/src/com/sipai/entity/scada/ProAlarmBaseText.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class ProAlarmBaseText extends SQLAdapter { - - public final static String AdoptSt_True = "1";//采纳 - public final static String AdoptSt_False = "0";//未采纳 - - private String id; - - private String insdt; - - private String decisionexpertbasetext; - - private String alarmId; - - private String adopter; - - private String adoptionTime; - - private String adoptSt; - - private String unitId; - - private String decisionexpertbaseId; - - private String decisionexpertbasePid; - - private String zdTypeName; - - private ProAlarm proAlarm; - private int num; - private String _date; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDecisionexpertbasetext() { - return decisionexpertbasetext; - } - - public void setDecisionexpertbasetext(String decisionexpertbasetext) { - this.decisionexpertbasetext = decisionexpertbasetext == null ? null : decisionexpertbasetext.trim(); - } - - public String getAlarmId() { - return alarmId; - } - - public void setAlarmId(String alarmId) { - this.alarmId = alarmId == null ? null : alarmId.trim(); - } - - public String getAdopter() { - return adopter; - } - - public void setAdopter(String adopter) { - this.adopter = adopter == null ? null : adopter.trim(); - } - - public String getAdoptionTime() { - return adoptionTime; - } - - public void setAdoptionTime(String adoptionTime) { - this.adoptionTime = adoptionTime == null ? null : adoptionTime.trim(); - } - - public String getAdoptSt() { - return adoptSt; - } - - public void setAdoptSt(String adoptSt) { - this.adoptSt = adoptSt == null ? null : adoptSt.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getDecisionexpertbaseId() { - return decisionexpertbaseId; - } - - public void setDecisionexpertbaseId(String decisionexpertbaseId) { - this.decisionexpertbaseId = decisionexpertbaseId == null ? null : decisionexpertbaseId.trim(); - } - - public String getDecisionexpertbasePid() { - return decisionexpertbasePid; - } - - public void setDecisionexpertbasePid(String decisionexpertbasePid) { - this.decisionexpertbasePid = decisionexpertbasePid == null ? null : decisionexpertbasePid.trim(); - } - - public String getZdTypeName() { - return zdTypeName; - } - - public void setZdTypeName(String zdTypeName) { - this.zdTypeName = zdTypeName; - } - - public ProAlarm getProAlarm() { - return proAlarm; - } - - public void setProAlarm(ProAlarm proAlarm) { - this.proAlarm = proAlarm; - } - - public int getNum() { - return num; - } - - public void setNum(int num) { - this.num = num; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/ProAlarmDataStopHisPoint.java b/src/com/sipai/entity/scada/ProAlarmDataStopHisPoint.java deleted file mode 100644 index 5a7f76d8..00000000 --- a/src/com/sipai/entity/scada/ProAlarmDataStopHisPoint.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; - -public class ProAlarmDataStopHisPoint extends SQLAdapter { - private String id; - - private String alarmId; - - private String pointId; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getAlarmId() { - return alarmId; - } - - public void setAlarmId(String alarmId) { - this.alarmId = alarmId == null ? null : alarmId.trim(); - } - - public String getPointId() { - return pointId; - } - - public void setPointId(String pointId) { - this.pointId = pointId == null ? null : pointId.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/ScadaAlarm.java b/src/com/sipai/entity/scada/ScadaAlarm.java deleted file mode 100644 index ff276fe5..00000000 --- a/src/com/sipai/entity/scada/ScadaAlarm.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.sipai.entity.scada; - -import com.sipai.entity.base.SQLAdapter; -import java.math.BigDecimal; - -public class ScadaAlarm extends SQLAdapter{ - //报警 - public static final String STATUS_ALARM="0"; - //报警确认 - public static final String STATUS_ALARM_CONFIRM="1"; - //报警恢复 - public static final String STATUS_ALARM_RECOVER="2"; - - //超限报警 - public static final String AlarmTypeLv1_PRO="pro"; - //设备故障报警 - public static final String AlarmTypeLv1_EQU="equ"; - //逢变则报报警 - public static final String AlarmTypeLv1_Change="change"; - - //上限 - public static final String AlarmTypeLv2_H="H"; - //上极限 - public static final String AlarmTypeLv2_HH="HH"; - //下限 - public static final String AlarmTypeLv2_L="L"; - //下极限 - public static final String AlarmTypeLv2_LL="LL"; - - private Long id; - private String insdt; - private String alarmTime; - private String confirmTime; - private String recoverTime; - private BigDecimal recoverValue; - private String mpointCode; - private String mpointName; - private String status; - private Integer alarmLevel; - private String processSectionCode; - private String processSectionName; - private String patrolPointId; - private String bizId; - private String describe; - private String alarmTypeLv1; - private String alarmTypeLv2; - private String originalStatus; - - private Integer num; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getAlarmTime() { - return alarmTime; - } - - public void setAlarmTime(String alarmTime) { - this.alarmTime = alarmTime; - } - - public String getConfirmTime() { - return confirmTime; - } - - public void setConfirmTime(String confirmTime) { - this.confirmTime = confirmTime; - } - - public String getRecoverTime() { - return recoverTime; - } - - public void setRecoverTime(String recoverTime) { - this.recoverTime = recoverTime; - } - - public BigDecimal getRecoverValue() { - return recoverValue; - } - - public void setRecoverValue(BigDecimal recoverValue) { - this.recoverValue = recoverValue; - } - - public String getMpointCode() { - return mpointCode; - } - - public void setMpointCode(String mpointCode) { - this.mpointCode = mpointCode; - } - - public String getMpointName() { - return mpointName; - } - - public void setMpointName(String mpointName) { - this.mpointName = mpointName; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getAlarmLevel() { - return alarmLevel; - } - - public void setAlarmLevel(Integer alarmLevel) { - this.alarmLevel = alarmLevel; - } - - public String getProcessSectionCode() { - return processSectionCode; - } - - public void setProcessSectionCode(String processSectionCode) { - this.processSectionCode = processSectionCode; - } - - public String getProcessSectionName() { - return processSectionName; - } - - public void setProcessSectionName(String processSectionName) { - this.processSectionName = processSectionName; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public String getAlarmTypeLv1() { - return alarmTypeLv1; - } - - public void setAlarmTypeLv1(String alarmTypeLv1) { - this.alarmTypeLv1 = alarmTypeLv1; - } - - public String getAlarmTypeLv2() { - return alarmTypeLv2; - } - - public void setAlarmTypeLv2(String alarmTypeLv2) { - this.alarmTypeLv2 = alarmTypeLv2; - } - - public String getOriginalStatus() { - return originalStatus; - } - - public void setOriginalStatus(String originalStatus) { - this.originalStatus = originalStatus; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/SimpleMPoint.java b/src/com/sipai/entity/scada/SimpleMPoint.java deleted file mode 100644 index 2a600f8e..00000000 --- a/src/com/sipai/entity/scada/SimpleMPoint.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.entity.scada; - - -import java.math.BigDecimal; - -public class SimpleMPoint { - private String mpointcode; - private String parmname; - private BigDecimal parmvalue; - private String measuredt; - private String unit; - - public String getMpointcode() { - return mpointcode; - } - - public void setMpointcode(String mpointcode) { - this.mpointcode = mpointcode; - } - - public String getParmname() { - return parmname; - } - - public void setParmname(String parmname) { - this.parmname = parmname; - } - - public BigDecimal getParmvalue() { - return parmvalue; - } - - public void setParmvalue(BigDecimal parmvalue) { - this.parmvalue = parmvalue; - } - - public String getMeasuredt() { - return measuredt; - } - - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/scada/TempReport.java b/src/com/sipai/entity/scada/TempReport.java deleted file mode 100644 index 6000b888..00000000 --- a/src/com/sipai/entity/scada/TempReport.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.entity.scada; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class TempReport extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 8937650739430596443L; - - private Long itemid; - - private String parmvalue; - - private String measuredt; - - private String formattype; - - private int decimal;// 小数位 - - private String mpcode; - - public int getDecimal() { - return decimal; - } - - public void setDecimal(int decimal) { - this.decimal = decimal; - } - - public Long getItemid() { - return itemid; - } - - public void setItemid(Long itemid) { - this.itemid = itemid; - } - - public String getParmvalue() { - return parmvalue; - } - - public void setParmvalue(String parmvalue) { - this.parmvalue = parmvalue; - } - - public String getMeasuredt() { - return measuredt; - } - - public void setMeasuredt(String measuredt) { - this.measuredt = measuredt; - } - - public String getFormattype() { - return formattype; - } - - public void setFormattype(String formattype) { - this.formattype = formattype; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/schedule/ScheduleJob.java b/src/com/sipai/entity/schedule/ScheduleJob.java deleted file mode 100644 index 674bc717..00000000 --- a/src/com/sipai/entity/schedule/ScheduleJob.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.sipai.entity.schedule; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ScheduleJob extends SQLAdapter{ - private String id; - - private String jobName; - - private String jobGroup; - - private String methodName; - - private String beanClass; - - private Integer status; - - private String cronExpression; - - private String params; - - private String remark; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private ScheduleJobType scheduleJobType; - - private String unitId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getJobName() { - return jobName; - } - - public void setJobName(String jobName) { - this.jobName = jobName; - } - - public String getJobGroup() { - return jobGroup; - } - - public void setJobGroup(String jobGroup) { - this.jobGroup = jobGroup; - } - - public String getMethodName() { - return methodName; - } - - public void setMethodName(String methodName) { - this.methodName = methodName; - } - - public String getBeanClass() { - return beanClass; - } - - public void setBeanClass(String beanClass) { - this.beanClass = beanClass; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getCronExpression() { - return cronExpression; - } - - public void setCronExpression(String cronExpression) { - this.cronExpression = cronExpression; - } - - public String getParams() { - return params; - } - - public void setParams(String params) { - this.params = params; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public ScheduleJobType getScheduleJobType() { - return scheduleJobType; - } - - public void setScheduleJobType(ScheduleJobType scheduleJobType) { - this.scheduleJobType = scheduleJobType; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/schedule/ScheduleJobDetail.java b/src/com/sipai/entity/schedule/ScheduleJobDetail.java deleted file mode 100644 index 322473b7..00000000 --- a/src/com/sipai/entity/schedule/ScheduleJobDetail.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.entity.schedule; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ScheduleJobDetail extends SQLAdapter{ - private String id; - - private String pid; - - private String taskname; - - private String taskid; - - private String paramname; - - private String paramvalue; - - private String unitid; - - private Integer ord; - - private String memo; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getTaskname() { - return taskname; - } - - public void setTaskname(String taskname) { - this.taskname = taskname; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getParamname() { - return paramname; - } - - public void setParamname(String paramname) { - this.paramname = paramname; - } - - public String getParamvalue() { - return paramvalue; - } - - public void setParamvalue(String paramvalue) { - this.paramvalue = paramvalue; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/schedule/ScheduleJobType.java b/src/com/sipai/entity/schedule/ScheduleJobType.java deleted file mode 100644 index b8860ac1..00000000 --- a/src/com/sipai/entity/schedule/ScheduleJobType.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.schedule; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ScheduleJobType extends SQLAdapter{ - private String id; - - private String name; - - private String interfaceurl; - - private String unitid; - - private String memo; - - private Integer ord; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getInterfaceurl() { - return interfaceurl; - } - - public void setInterfaceurl(String interfaceurl) { - this.interfaceurl = interfaceurl; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/score/LibraryMPoint.java b/src/com/sipai/entity/score/LibraryMPoint.java deleted file mode 100644 index 0741d0e0..00000000 --- a/src/com/sipai/entity/score/LibraryMPoint.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.entity.score; - -import java.util.List; - -public class LibraryMPoint { - private List libraryMPointProp; - - private List libraryMPointPropSource; - - public List getLibraryMPointProp() { - return libraryMPointProp; - } - - public void setLibraryMPointProp(List libraryMPointProp) { - this.libraryMPointProp = libraryMPointProp; - } - - public List getLibraryMPointPropSource() { - return libraryMPointPropSource; - } - - public void setLibraryMPointPropSource(List libraryMPointPropSource) { - this.libraryMPointPropSource = libraryMPointPropSource; - } -} diff --git a/src/com/sipai/entity/score/LibraryMPointProp.java b/src/com/sipai/entity/score/LibraryMPointProp.java deleted file mode 100644 index 1bf1b61e..00000000 --- a/src/com/sipai/entity/score/LibraryMPointProp.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.score; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryMPointProp extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String evaluationFormula; - - private String pid; - - private String calfreq; - - private String calrange; - - private String name; - - private String type; - - private String signaltag; - - private String unit; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getEvaluationFormula() { - return evaluationFormula; - } - - public void setEvaluationFormula(String evaluationFormula) { - this.evaluationFormula = evaluationFormula == null ? null : evaluationFormula.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getCalfreq() { - return calfreq; - } - - public void setCalfreq(String calfreq) { - this.calfreq = calfreq == null ? null : calfreq.trim(); - } - - public String getCalrange() { - return calrange; - } - - public void setCalrange(String calrange) { - this.calrange = calrange == null ? null : calrange.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getSignaltag() { - return signaltag; - } - - public void setSignaltag(String signaltag) { - this.signaltag = signaltag == null ? null : signaltag.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/score/LibraryMPointPropSource.java b/src/com/sipai/entity/score/LibraryMPointPropSource.java deleted file mode 100644 index de7b2549..00000000 --- a/src/com/sipai/entity/score/LibraryMPointPropSource.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.score; - -import com.sipai.entity.base.SQLAdapter; - -public class LibraryMPointPropSource extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String indexDetails; - - private Integer calRange; - - private String calRangeUnit; - - private String mpid; - - private String valueType; - - private String calculationType; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getIndexDetails() { - return indexDetails; - } - - public void setIndexDetails(String indexDetails) { - this.indexDetails = indexDetails == null ? null : indexDetails.trim(); - } - - public Integer getCalRange() { - return calRange; - } - - public void setCalRange(Integer calRange) { - this.calRange = calRange; - } - - public String getCalRangeUnit() { - return calRangeUnit; - } - - public void setCalRangeUnit(String calRangeUnit) { - this.calRangeUnit = calRangeUnit == null ? null : calRangeUnit.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getValueType() { - return valueType; - } - - public void setValueType(String valueType) { - this.valueType = valueType == null ? null : valueType.trim(); - } - - public String getCalculationType() { - return calculationType; - } - - public void setCalculationType(String calculationType) { - this.calculationType = calculationType == null ? null : calculationType.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ApplyPurchasePlan.java b/src/com/sipai/entity/sparepart/ApplyPurchasePlan.java deleted file mode 100644 index e83e348f..00000000 --- a/src/com/sipai/entity/sparepart/ApplyPurchasePlan.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Unit; - -public class ApplyPurchasePlan extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String bizId; - - private String applicant; - - private Integer planApplyPurchaseStartdate; - - private Integer planApplyPurchaseEnddate; - - private String departmentId; - - private String type; - - private String status; - - private String remark; - - private Unit unit; - - private String applicantName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getApplicant() { - return applicant; - } - - public void setApplicant(String applicant) { - this.applicant = applicant; - } - - public Integer getPlanApplyPurchaseStartdate() { - return planApplyPurchaseStartdate; - } - - public void setPlanApplyPurchaseStartdate(Integer planApplyPurchaseStartdate) { - this.planApplyPurchaseStartdate = planApplyPurchaseStartdate; - } - - public Integer getPlanApplyPurchaseEnddate() { - return planApplyPurchaseEnddate; - } - - public void setPlanApplyPurchaseEnddate(Integer planApplyPurchaseEnddate) { - this.planApplyPurchaseEnddate = planApplyPurchaseEnddate; - } - - public String getDepartmentId() { - return departmentId; - } - - public void setDepartmentId(String departmentId) { - this.departmentId = departmentId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public String getApplicantName() { - return applicantName; - } - - public void setApplicantName(String applicantName) { - this.applicantName = applicantName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Channels.java b/src/com/sipai/entity/sparepart/Channels.java deleted file mode 100644 index 5ee4600f..00000000 --- a/src/com/sipai/entity/sparepart/Channels.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class Channels extends SQLAdapter{ - - private Integer source; - - public Integer getSource() { - return source; - } - - public void setSource(Integer source) { - this.source = source; - } - - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String pname; - - private Integer morder; - - private Boolean active; - - private String pid; - - private String describe; - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - - private List contractList; - - public List getContractList() { - return contractList; - } - - public void setContractList(List contractList) { - this.contractList = contractList; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ConsumeDetail.java b/src/com/sipai/entity/sparepart/ConsumeDetail.java deleted file mode 100644 index c54f0edc..00000000 --- a/src/com/sipai/entity/sparepart/ConsumeDetail.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ConsumeDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String outstockRecordDetailId; - - private String goodsId; - - private BigDecimal consumeNumber; - - private String workOrderId; - - private String _allnumber; - - private BigDecimal _nownumber; - - private Goods goods; - - private String _price; - - public String get_price() { - return _price; - } - - public void set_price(String _price) { - this._price = _price; - } - - public String get_allnumber() { - return _allnumber; - } - - public void set_allnumber(String _allnumber) { - this._allnumber = _allnumber; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - - - public BigDecimal get_nownumber() { - return _nownumber; - } - - public void set_nownumber(BigDecimal _nownumber) { - this._nownumber = _nownumber; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getOutstockRecordDetailId() { - return outstockRecordDetailId; - } - - public void setOutstockRecordDetailId(String outstockRecordDetailId) { - this.outstockRecordDetailId = outstockRecordDetailId; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getConsumeNumber() { - return consumeNumber; - } - - public void setConsumeNumber(BigDecimal consumeNumber) { - this.consumeNumber = consumeNumber; - } - - public String getWorkOrderId() { - return workOrderId; - } - - public void setWorkOrderId(String workOrderId) { - this.workOrderId = workOrderId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Contract.java b/src/com/sipai/entity/sparepart/Contract.java deleted file mode 100644 index ad59f2dd..00000000 --- a/src/com/sipai/entity/sparepart/Contract.java +++ /dev/null @@ -1,687 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AutoAlert; -import java.util.Date; - -public class Contract extends BusinessUnitAdapter{ - - private BigDecimal performancebond; - - private String supplyplanstartdate; - - private String supplyplanenddate; - - private String supplyactualstartdate; - - private String supplyactualenddate; - - private BigDecimal warrantydeposit; - - public BigDecimal getPerformancebond() { - return performancebond; - } - - public void setPerformancebond(BigDecimal performancebond) { - this.performancebond = performancebond; - } - - public String getSupplyplanstartdate() { - return supplyplanstartdate; - } - - public void setSupplyplanstartdate(String supplyplanstartdate) { - this.supplyplanstartdate = supplyplanstartdate; - } - - public String getSupplyplanenddate() { - return supplyplanenddate; - } - - public void setSupplyplanenddate(String supplyplanenddate) { - this.supplyplanenddate = supplyplanenddate; - } - - public String getSupplyactualstartdate() { - return supplyactualstartdate; - } - - public void setSupplyactualstartdate(String supplyactualstartdate) { - this.supplyactualstartdate = supplyactualstartdate; - } - - public String getSupplyactualenddate() { - return supplyactualenddate; - } - - public void setSupplyactualenddate(String supplyactualenddate) { - this.supplyactualenddate = supplyactualenddate; - } - - public BigDecimal getWarrantydeposit() { - return warrantydeposit; - } - - public void setWarrantydeposit(BigDecimal warrantydeposit) { - this.warrantydeposit = warrantydeposit; - } - private String id; - - private String insdt; - - private String insuser; - - private String contractnumber; - - private String contractname; - - private String contractclassid; - - private String contracttaxrateid; - - private String purchasemethodsid; - - private String channelsid; - - private String supplierid; - - private String agentid; - - private User agent; - - private BigDecimal contractamount; - - private BigDecimal qualitydeposit; - - private String warrantyperiodid; - - private String contractstartdate; - - private String contractenddate; - - private String performanceid; - - private String remark; - - private String purchaseid; - - private String status; - - private String bizId; - - private String deptId; - - private String contractAuditId; - - private String countersignAuditId; - - private String rejectReason; - - private String processdefid; - - private String processid; - - private String firstparty; - - private String helpers; - - - private String helpersLog; - //付款金额 - private BigDecimal _totalpayment; - //未付款金额 - private BigDecimal _nototalpayment; - //开票金额 - private BigDecimal _totalinvoice; - - public BigDecimal get_totalpayment() { - return _totalpayment; - } - - public BigDecimal get_nototalpayment() { - return _nototalpayment; - } - - public void set_nototalpayment(BigDecimal _nototalpayment) { - this._nototalpayment = _nototalpayment; - } - - public void set_totalpayment(BigDecimal _totalpayment) { - this._totalpayment = _totalpayment; - } - - public BigDecimal get_totalinvoice() { - return _totalinvoice; - } - - public void set_totalinvoice(BigDecimal _totalinvoice) { - this._totalinvoice = _totalinvoice; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public User getAgent() { - return agent; - } - - public void setAgent(User agent) { - this.agent = agent; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getContractnumber() { - return contractnumber; - } - - public void setContractnumber(String contractnumber) { - this.contractnumber = contractnumber; - } - - public String getContractname() { - return contractname; - } - - public void setContractname(String contractname) { - this.contractname = contractname; - } - - public String getContractclassid() { - return contractclassid; - } - - public void setContractclassid(String contractclassid) { - this.contractclassid = contractclassid; - } - - public String getContracttaxrateid() { - return contracttaxrateid; - } - - public void setContracttaxrateid(String contracttaxrateid) { - this.contracttaxrateid = contracttaxrateid; - } - - public String getPurchasemethodsid() { - return purchasemethodsid; - } - - public void setPurchasemethodsid(String purchasemethodsid) { - this.purchasemethodsid = purchasemethodsid; - } - - public String getChannelsid() { - return channelsid; - } - - public void setChannelsid(String channelsid) { - this.channelsid = channelsid; - } - - public String getSupplierid() { - return supplierid; - } - - public void setSupplierid(String supplierid) { - this.supplierid = supplierid; - } - - public String getAgentid() { - return agentid; - } - - public void setAgentid(String agentid) { - this.agentid = agentid; - } - - public BigDecimal getContractamount() { - return contractamount; - } - - public void setContractamount(BigDecimal contractamount) { - this.contractamount = contractamount; - } - - public BigDecimal getQualitydeposit() { - return qualitydeposit; - } - - public void setQualitydeposit(BigDecimal qualitydeposit) { - this.qualitydeposit = qualitydeposit; - } - - public String getWarrantyperiodid() { - return warrantyperiodid; - } - - public void setWarrantyperiodid(String warrantyperiodid) { - this.warrantyperiodid = warrantyperiodid; - } - - public String getContractstartdate() { - return contractstartdate; - } - - public void setContractstartdate(String contractstartdate) { - this.contractstartdate = contractstartdate; - } - - public String getContractenddate() { - return contractenddate; - } - - public void setContractenddate(String contractenddate) { - this.contractenddate = contractenddate; - } - - public String getPerformanceid() { - return performanceid; - } - - public void setPerformanceid(String performanceid) { - this.performanceid = performanceid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPurchaseid() { - return purchaseid; - } - - public void setPurchaseid(String purchaseid) { - this.purchaseid = purchaseid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getContractAuditId() { - return contractAuditId; - } - - public void setContractAuditId(String contractAuditId) { - this.contractAuditId = contractAuditId; - } - - public String getCountersignAuditId() { - return countersignAuditId; - } - - public void setCountersignAuditId(String countersignAuditId) { - this.countersignAuditId = countersignAuditId; - } - - public String getRejectReason() { - return rejectReason; - } - - public void setRejectReason(String rejectReason) { - this.rejectReason = rejectReason; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getFirstparty() { - return firstparty; - } - - public void setFirstparty(String firstparty) { - this.firstparty = firstparty; - } - - public String getHelpers() { - return helpers; - } - - public void setHelpers(String helpers) { - this.helpers = helpers; - } - - public String getHelpersLog() { - return helpersLog; - } - - public void setHelpersLog(String helpersLog) { - this.helpersLog = helpersLog; - } - private String helpersMan; - - public String getHelpersMan() { - return helpersMan; - } - - public void setHelpersMan(String helpersMan) { - this.helpersMan = helpersMan; - } - - private ContractClass contractclass; - - private String contractclassName; - - private Double contracttaxrateName; - - private String purchaseName; - - private String purchasemethodsName; - - private String channelsName; - - private String supplierName; - - private String agentName; - - private Dept dept; - - private Company company; - - private String contractAuditName; - - private String countersignAuditName; - - private String performanceName; - - private Integer warrantyperiod; - - private List paymentList; - - private List invoiceList; - - private List autoAlertList; - - List subscribeDetailList; - - //合同数量 - private Integer contractcount; - //合同总金�?? - private BigDecimal contractamounttotle; - //已付总金�?? - private BigDecimal paymentamounttotle; - //在签数量 - private Integer sign; - //在支付数量 - private Integer implement; - //完成率 - private Double completionrate; - //支付率 - private Double paymentrate; - //结算金额 - private String settlementAmount; - - - - public String getSettlementAmount() { - return settlementAmount; - } - - public void setSettlementAmount(String settlementAmount) { - this.settlementAmount = settlementAmount; - } - - public Integer getSign() { - return sign; - } - - public void setSign(Integer sign) { - this.sign = sign; - } - - public Integer getImplement() { - return implement; - } - - public void setImplement(Integer implement) { - this.implement = implement; - } - - public Double getCompletionrate() { - return completionrate; - } - - public void setCompletionrate(Double completionrate) { - this.completionrate = completionrate; - } - - public Double getPaymentrate() { - return paymentrate; - } - - public void setPaymentrate(Double paymentrate) { - this.paymentrate = paymentrate; - } - - public ContractClass getContractclass() { - return contractclass; - } - - public void setContractclass(ContractClass contractclass) { - this.contractclass = contractclass; - } - - public List getSubscribeDetailList() { - return subscribeDetailList; - } - - public void setSubscribeDetailList(List subscribeDetailList) { - this.subscribeDetailList = subscribeDetailList; - } - - public Integer getContractcount() { - return contractcount; - } - - public void setContractcount(Integer contractcount) { - this.contractcount = contractcount; - } - - public BigDecimal getContractamounttotle() { - return contractamounttotle; - } - - public void setContractamounttotle(BigDecimal contractamounttotle) { - this.contractamounttotle = contractamounttotle; - } - - public BigDecimal getPaymentamounttotle() { - return paymentamounttotle; - } - - public void setPaymentamounttotle(BigDecimal paymentamounttotle) { - this.paymentamounttotle = paymentamounttotle; - } - - public List getAutoAlertList() { - return autoAlertList; - } - - public void setAutoAlertList(List autoAlertList) { - this.autoAlertList = autoAlertList; - } - - public List getPaymentList() { - return paymentList; - } - - public void setPaymentList(List paymentList) { - this.paymentList = paymentList; - } - - public List getInvoiceList() { - return invoiceList; - } - - public void setInvoiceList(List invoiceList) { - this.invoiceList = invoiceList; - } - - public Double getContracttaxrateName() { - return contracttaxrateName; - } - - public void setContracttaxrateName(Double contracttaxrateName) { - this.contracttaxrateName = contracttaxrateName; - } - - public String getPerformanceName() { - return performanceName; - } - - public void setPerformanceName(String performanceName) { - this.performanceName = performanceName; - } - - public Integer getWarrantyperiod() { - return warrantyperiod; - } - - public void setWarrantyperiod(Integer warrantyperiod) { - this.warrantyperiod = warrantyperiod; - } - - public String getContractclassName() { - return contractclassName; - } - - public void setContractclassName(String contractclassName) { - this.contractclassName = contractclassName; - } - - public String getPurchaseName() { - return purchaseName; - } - - public void setPurchaseName(String purchaseName) { - this.purchaseName = purchaseName; - } - - public String getPurchasemethodsName() { - return purchasemethodsName; - } - - public void setPurchasemethodsName(String purchasemethodsName) { - this.purchasemethodsName = purchasemethodsName; - } - - public String getChannelsName() { - return channelsName; - } - - public void setChannelsName(String channelsName) { - this.channelsName = channelsName; - } - - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } - - public String getAgentName() { - return agentName; - } - - public void setAgentName(String agentName) { - this.agentName = agentName; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getContractAuditName() { - return contractAuditName; - } - - public void setContractAuditName(String contractAuditName) { - this.contractAuditName = contractAuditName; - } - - public String getCountersignAuditName() { - return countersignAuditName; - } - - public void setCountersignAuditName(String countersignAuditName) { - this.countersignAuditName = countersignAuditName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractChangeFile.java b/src/com/sipai/entity/sparepart/ContractChangeFile.java deleted file mode 100644 index df832783..00000000 --- a/src/com/sipai/entity/sparepart/ContractChangeFile.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractChangeFile extends SQLAdapter{ - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private String insdt; - - private String insuser; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractClass.java b/src/com/sipai/entity/sparepart/ContractClass.java deleted file mode 100644 index e7acdd05..00000000 --- a/src/com/sipai/entity/sparepart/ContractClass.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractClass extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String number; - - private Integer morder; - - private Boolean active; - - private String pid; - - private String pname; - - private ContractClass pClass; - - private String describe; - - private List contractList; - - public List getContractList() { - return contractList; - } - - public ContractClass getpClass() { - return pClass; - } - - public void setpClass(ContractClass pClass) { - this.pClass = pClass; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - - public void setContractList(List contractList) { - this.contractList = contractList; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractDetail.java b/src/com/sipai/entity/sparepart/ContractDetail.java deleted file mode 100644 index dbad9f1f..00000000 --- a/src/com/sipai/entity/sparepart/ContractDetail.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String goodsId; - - private String supplierId; - - private BigDecimal number; - - private BigDecimal price; - - private BigDecimal totalMoney; - - private String deptId; - - private String purpose; - - private String contractId; - - private String subscribeDetailId; - - private String remark; - - private Contract contract; - - private Goods goods; - - public Contract getContract() { - return contract; - } - - public void setContract(Contract contract) { - this.contract = contract; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getContractId() { - return contractId; - } - - public void setContractId(String contractId) { - this.contractId = contractId; - } - - public String getSubscribeDetailId() { - return subscribeDetailId; - } - - public void setSubscribeDetailId(String subscribeDetailId) { - this.subscribeDetailId = subscribeDetailId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractDetailInvoice.java b/src/com/sipai/entity/sparepart/ContractDetailInvoice.java deleted file mode 100644 index efa0cb26..00000000 --- a/src/com/sipai/entity/sparepart/ContractDetailInvoice.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractDetailInvoice extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private BigDecimal amountinvoice; - - private String invoicedate; - - private Integer morder; - - private String contractId; - - private String number; - - private String invoiceStatus; - - - public String getInvoiceStatus() { - return invoiceStatus; - } - - public void setInvoiceStatus(String invoiceStatus) { - this.invoiceStatus = invoiceStatus; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public BigDecimal getAmountinvoice() { - return amountinvoice; - } - - public void setAmountinvoice(BigDecimal amountinvoice) { - this.amountinvoice = amountinvoice; - } - - public String getInvoicedate() { - return invoicedate; - } - - public void setInvoicedate(String invoicedate) { - this.invoicedate = invoicedate; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getContractId() { - return contractId; - } - - public void setContractId(String contractId) { - this.contractId = contractId; - } - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractDetailInvoiceFile.java b/src/com/sipai/entity/sparepart/ContractDetailInvoiceFile.java deleted file mode 100644 index eec243ee..00000000 --- a/src/com/sipai/entity/sparepart/ContractDetailInvoiceFile.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractDetailInvoiceFile extends SQLAdapter { - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private String insdt; - - private String insuser; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractDetailPayment.java b/src/com/sipai/entity/sparepart/ContractDetailPayment.java deleted file mode 100644 index 8a60b044..00000000 --- a/src/com/sipai/entity/sparepart/ContractDetailPayment.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractDetailPayment extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private BigDecimal amountpaid; - - private String paymentdate; - - private BigDecimal amountoutstanding; - - private Integer morder; - - private String contractId; - - private String applicationTime; - - private String applicationAmount; - - private String paymentTime; - - private String paymentAmount; - - private String paymentStatus; - - private String invoiceIds; - - - - public String getInvoiceIds() { - return invoiceIds; - } - - public void setInvoiceIds(String invoiceIds) { - this.invoiceIds = invoiceIds; - } - - public String getPaymentStatus() { - return paymentStatus; - } - - public void setPaymentStatus(String paymentStatus) { - this.paymentStatus = paymentStatus; - } - - public String getApplicationTime() { - return applicationTime; - } - - public void setApplicationTime(String applicationTime) { - this.applicationTime = applicationTime; - } - - public String getApplicationAmount() { - return applicationAmount; - } - - public void setApplicationAmount(String applicationAmount) { - this.applicationAmount = applicationAmount; - } - - public String getPaymentTime() { - return paymentTime; - } - - public void setPaymentTime(String paymentTime) { - this.paymentTime = paymentTime; - } - - public String getPaymentAmount() { - return paymentAmount; - } - - public void setPaymentAmount(String paymentAmount) { - this.paymentAmount = paymentAmount; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public BigDecimal getAmountpaid() { - return amountpaid; - } - - public void setAmountpaid(BigDecimal amountpaid) { - this.amountpaid = amountpaid; - } - - public String getPaymentdate() { - return paymentdate; - } - - public void setPaymentdate(String paymentdate) { - this.paymentdate = paymentdate; - } - - public BigDecimal getAmountoutstanding() { - return amountoutstanding; - } - - public void setAmountoutstanding(BigDecimal amountoutstanding) { - this.amountoutstanding = amountoutstanding; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getContractId() { - return contractId; - } - - public void setContractId(String contractId) { - this.contractId = contractId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractFile.java b/src/com/sipai/entity/sparepart/ContractFile.java deleted file mode 100644 index 2b3e6dcc..00000000 --- a/src/com/sipai/entity/sparepart/ContractFile.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractFile extends SQLAdapter { - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private String insdt; - - private String insuser; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ContractTaxRate.java b/src/com/sipai/entity/sparepart/ContractTaxRate.java deleted file mode 100644 index 0ac727f4..00000000 --- a/src/com/sipai/entity/sparepart/ContractTaxRate.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ContractTaxRate extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private Double taxrate; - - private Integer morder; - - private Boolean active; - - private String pid; - - private String describe; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Double getTaxrate() { - return taxrate; - } - - public void setTaxrate(Double taxrate) { - this.taxrate = taxrate; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Goods.java b/src/com/sipai/entity/sparepart/Goods.java deleted file mode 100644 index 705f81f0..00000000 --- a/src/com/sipai/entity/sparepart/Goods.java +++ /dev/null @@ -1,360 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Goods extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String brand; - - private String model; - - private String classId; - - private String unit; - - private Double maxReserve; - - private Double minReserve; - - private String remark; - - private String equipmentIds; - - private String equipmentNames;//显示设备的名称 - - private String number;//编号 - - private GoodsClass goodsClass; - - private String _outid; - - private String _outname; - - private String _outnumber; - - private String _outprice; - - private String _outtotalmoney; - - private String _inid; - - private String _inname; - - private String _innumber; - - private String _inprice; - - private String _intotalmoney; - - private String _csid; - - private String _csname; - - private String _csnumber; - - private String _csprice; - - private String _cstotalmoney; - - private String _lsid; - - private String _lsname; - - private String _lsnumber; - - private String _lsprice; - - private String _lstotalmoney; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBrand() { - return brand; - } - - public void setBrand(String brand) { - this.brand = brand; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public Double getMaxReserve() { - return maxReserve; - } - - public void setMaxReserve(Double maxReserve) { - this.maxReserve = maxReserve; - } - - public Double getMinReserve() { - return minReserve; - } - - public void setMinReserve(Double minReserve) { - this.minReserve = minReserve; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getEquipmentIds() { - return equipmentIds; - } - - public void setEquipmentIds(String equipmentIds) { - this.equipmentIds = equipmentIds; - } - - public String getEquipmentNames() { - return equipmentNames; - } - - public void setEquipmentNames(String equipmentNames) { - this.equipmentNames = equipmentNames; - } - - public GoodsClass getGoodsClass() { - return goodsClass; - } - - public void setGoodsClass(GoodsClass goodsClass) { - this.goodsClass = goodsClass; - } - - public String get_outid() { - return _outid; - } - - public void set_outid(String _outid) { - this._outid = _outid; - } - - public String get_outname() { - return _outname; - } - - public void set_outname(String _outname) { - this._outname = _outname; - } - - public String get_outnumber() { - return _outnumber; - } - - public void set_outnumber(String _outnumber) { - this._outnumber = _outnumber; - } - - public String get_outprice() { - return _outprice; - } - - public void set_outprice(String _outprice) { - this._outprice = _outprice; - } - - public String get_outtotalmoney() { - return _outtotalmoney; - } - - public void set_outtotalmoney(String _outtotalmoney) { - this._outtotalmoney = _outtotalmoney; - } - - public String get_inid() { - return _inid; - } - - public void set_inid(String _inid) { - this._inid = _inid; - } - - public String get_inname() { - return _inname; - } - - public void set_inname(String _inname) { - this._inname = _inname; - } - - public String get_innumber() { - return _innumber; - } - - public void set_innumber(String _innumber) { - this._innumber = _innumber; - } - - public String get_inprice() { - return _inprice; - } - - public void set_inprice(String _inprice) { - this._inprice = _inprice; - } - - public String get_intotalmoney() { - return _intotalmoney; - } - - public void set_intotalmoney(String _intotalmoney) { - this._intotalmoney = _intotalmoney; - } - - public String get_csid() { - return _csid; - } - - public void set_csid(String _csid) { - this._csid = _csid; - } - - public String get_csname() { - return _csname; - } - - public void set_csname(String _csname) { - this._csname = _csname; - } - - public String get_csnumber() { - return _csnumber; - } - - public void set_csnumber(String _csnumber) { - this._csnumber = _csnumber; - } - - public String get_csprice() { - return _csprice; - } - - public void set_csprice(String _csprice) { - this._csprice = _csprice; - } - - public String get_cstotalmoney() { - return _cstotalmoney; - } - - public void set_cstotalmoney(String _cstotalmoney) { - this._cstotalmoney = _cstotalmoney; - } - - public String get_lsid() { - return _lsid; - } - - public void set_lsid(String _lsid) { - this._lsid = _lsid; - } - - public String get_lsname() { - return _lsname; - } - - public void set_lsname(String _lsname) { - this._lsname = _lsname; - } - - public String get_lsnumber() { - return _lsnumber; - } - - public void set_lsnumber(String _lsnumber) { - this._lsnumber = _lsnumber; - } - - public String get_lsprice() { - return _lsprice; - } - - public void set_lsprice(String _lsprice) { - this._lsprice = _lsprice; - } - - public String get_lstotalmoney() { - return _lstotalmoney; - } - - public void set_lstotalmoney(String _lstotalmoney) { - this._lstotalmoney = _lstotalmoney; - } - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/GoodsAcceptanceApplyDetail.java b/src/com/sipai/entity/sparepart/GoodsAcceptanceApplyDetail.java deleted file mode 100644 index ce7fc16c..00000000 --- a/src/com/sipai/entity/sparepart/GoodsAcceptanceApplyDetail.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class GoodsAcceptanceApplyDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String acceptanceApplyNumber; - - private String goodsId; - - private Goods goods; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getAcceptanceApplyNumber() { - return acceptanceApplyNumber; - } - - public void setAcceptanceApplyNumber(String acceptanceApplyNumber) { - this.acceptanceApplyNumber = acceptanceApplyNumber; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/GoodsApply.java b/src/com/sipai/entity/sparepart/GoodsApply.java deleted file mode 100644 index 033d2435..00000000 --- a/src/com/sipai/entity/sparepart/GoodsApply.java +++ /dev/null @@ -1,368 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class GoodsApply extends SQLAdapter { - private String id; - - private Date insdt; - - private String insuser; - - private String name; - - private String brand; - - private String model; - - private String classId; - - private String unit; - - private String remark; - - private String status; - - private String examineid; - - private Date examinedt; - - private Date examineexplain; - - private String processdefid; - - private String processid; - - private GoodsClass goodsClass; - - private String _outid; - - private String _outname; - - private String _outnumber; - - private String _outprice; - - private String _outtotalmoney; - - private String _inid; - - private String _inname; - - private String _innumber; - - private String _inprice; - - private String _intotalmoney; - - private String _csid; - - private String _csname; - - private String _csnumber; - - private String _csprice; - - private String _cstotalmoney; - - private String _lsid; - - private String _lsname; - - private String _lsnumber; - - private String _lsprice; - - private String _lstotalmoney; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBrand() { - return brand; - } - - public void setBrand(String brand) { - this.brand = brand; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getExamineid() { - return examineid; - } - - public void setExamineid(String examineid) { - this.examineid = examineid; - } - - public Date getExaminedt() { - return examinedt; - } - - public void setExaminedt(Date examinedt) { - this.examinedt = examinedt; - } - - public Date getExamineexplain() { - return examineexplain; - } - - public void setExamineexplain(Date examineexplain) { - this.examineexplain = examineexplain; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public GoodsClass getGoodsClass() { - return goodsClass; - } - - public void setGoodsClass(GoodsClass goodsClass) { - this.goodsClass = goodsClass; - } - - public String get_outid() { - return _outid; - } - - public void set_outid(String _outid) { - this._outid = _outid; - } - - public String get_outname() { - return _outname; - } - - public void set_outname(String _outname) { - this._outname = _outname; - } - - public String get_outnumber() { - return _outnumber; - } - - public void set_outnumber(String _outnumber) { - this._outnumber = _outnumber; - } - - public String get_outprice() { - return _outprice; - } - - public void set_outprice(String _outprice) { - this._outprice = _outprice; - } - - public String get_outtotalmoney() { - return _outtotalmoney; - } - - public void set_outtotalmoney(String _outtotalmoney) { - this._outtotalmoney = _outtotalmoney; - } - - public String get_inid() { - return _inid; - } - - public void set_inid(String _inid) { - this._inid = _inid; - } - - public String get_inname() { - return _inname; - } - - public void set_inname(String _inname) { - this._inname = _inname; - } - - public String get_innumber() { - return _innumber; - } - - public void set_innumber(String _innumber) { - this._innumber = _innumber; - } - - public String get_inprice() { - return _inprice; - } - - public void set_inprice(String _inprice) { - this._inprice = _inprice; - } - - public String get_intotalmoney() { - return _intotalmoney; - } - - public void set_intotalmoney(String _intotalmoney) { - this._intotalmoney = _intotalmoney; - } - - public String get_csid() { - return _csid; - } - - public void set_csid(String _csid) { - this._csid = _csid; - } - - public String get_csname() { - return _csname; - } - - public void set_csname(String _csname) { - this._csname = _csname; - } - - public String get_csnumber() { - return _csnumber; - } - - public void set_csnumber(String _csnumber) { - this._csnumber = _csnumber; - } - - public String get_csprice() { - return _csprice; - } - - public void set_csprice(String _csprice) { - this._csprice = _csprice; - } - - public String get_cstotalmoney() { - return _cstotalmoney; - } - - public void set_cstotalmoney(String _cstotalmoney) { - this._cstotalmoney = _cstotalmoney; - } - - public String get_lsid() { - return _lsid; - } - - public void set_lsid(String _lsid) { - this._lsid = _lsid; - } - - public String get_lsname() { - return _lsname; - } - - public void set_lsname(String _lsname) { - this._lsname = _lsname; - } - - public String get_lsnumber() { - return _lsnumber; - } - - public void set_lsnumber(String _lsnumber) { - this._lsnumber = _lsnumber; - } - - public String get_lsprice() { - return _lsprice; - } - - public void set_lsprice(String _lsprice) { - this._lsprice = _lsprice; - } - - public String get_lstotalmoney() { - return _lstotalmoney; - } - - public void set_lstotalmoney(String _lstotalmoney) { - this._lstotalmoney = _lstotalmoney; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/GoodsClass.java b/src/com/sipai/entity/sparepart/GoodsClass.java deleted file mode 100644 index d1f52399..00000000 --- a/src/com/sipai/entity/sparepart/GoodsClass.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class GoodsClass extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Boolean active; - - private String pid; - - private String describe; - - private Integer morder; - - private String pname; - - /** - * 类别编号 - */ - private String goodsClassCode; - - public String getGoodsClassCode() { - return goodsClassCode; - } - - public void setGoodsClassCode(String goodsClassCode) { - this.goodsClassCode = goodsClassCode; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/GoodsReserve.java b/src/com/sipai/entity/sparepart/GoodsReserve.java deleted file mode 100644 index 796dc17b..00000000 --- a/src/com/sipai/entity/sparepart/GoodsReserve.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.user.Company; - -public class GoodsReserve { - private String id; - - private Long max; - - private Long min; - - private String bizId; - - private String pid; - - private Integer maxStatus; - - private Integer minStatus; - - private String where; - - private Company company; - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public Long getMax() { - return max; - } - - public void setMax(Long max) { - this.max = max; - } - - public Long getMin() { - return min; - } - - public void setMin(Long min) { - this.min = min; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMaxStatus() { - return maxStatus; - } - - public void setMaxStatus(Integer maxStatus) { - this.maxStatus = maxStatus; - } - - public Integer getMinStatus() { - return minStatus; - } - - public void setMinStatus(Integer minStatus) { - this.minStatus = minStatus; - } -} diff --git a/src/com/sipai/entity/sparepart/HazardousChemicals.java b/src/com/sipai/entity/sparepart/HazardousChemicals.java deleted file mode 100644 index a5678c25..00000000 --- a/src/com/sipai/entity/sparepart/HazardousChemicals.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.entity.sparepart; - -/** - * 危化品记录及出入库记录 - * sj 20231023 - * (南市水厂项目定制) - */ -public class HazardousChemicals { - private String pushid; - - private String clientid; - - private String type; - - private String operation; - - private String records; - - public String getPushid() { - return pushid; - } - - public void setPushid(String pushid) { - this.pushid = pushid == null ? null : pushid.trim(); - } - - public String getClientid() { - return clientid; - } - - public void setClientid(String clientid) { - this.clientid = clientid == null ? null : clientid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getOperation() { - return operation; - } - - public void setOperation(String operation) { - this.operation = operation == null ? null : operation.trim(); - } - - public String getRecords() { - return records; - } - - public void setRecords(String records) { - this.records = records == null ? null : records.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/InOutDeatil.java b/src/com/sipai/entity/sparepart/InOutDeatil.java deleted file mode 100644 index 8aac1bb0..00000000 --- a/src/com/sipai/entity/sparepart/InOutDeatil.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; - -public class InOutDeatil { - private Integer id; - - private String inid; - - private String outid; - - private BigDecimal num; - - private String where; - - private String insdt; - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - private InStockRecordDetail inStockRecordDetail; - - private OutStockRecordDetail outStockRecordDetail; - - public InStockRecordDetail getInStockRecordDetail() { - return inStockRecordDetail; - } - - public void setInStockRecordDetail(InStockRecordDetail inStockRecordDetail) { - this.inStockRecordDetail = inStockRecordDetail; - } - - public OutStockRecordDetail getOutStockRecordDetail() { - return outStockRecordDetail; - } - - public void setOutStockRecordDetail(OutStockRecordDetail outStockRecordDetail) { - this.outStockRecordDetail = outStockRecordDetail; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getInid() { - return inid; - } - - public void setInid(String inid) { - this.inid = inid == null ? null : inid.trim(); - } - - public String getOutid() { - return outid; - } - - public void setOutid(String outid) { - this.outid = outid == null ? null : outid.trim(); - } - - public BigDecimal getNum() { - return num; - } - - public void setNum(BigDecimal num) { - this.num = num; - } -} diff --git a/src/com/sipai/entity/sparepart/InStockRecord.java b/src/com/sipai/entity/sparepart/InStockRecord.java deleted file mode 100644 index ecbcdf00..00000000 --- a/src/com/sipai/entity/sparepart/InStockRecord.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class InStockRecord extends BusinessUnitAdapter{ - - private String billNumber; - - private String invoiceNumber; - - public String getBillNumber() { - return billNumber; - } - - public void setBillNumber(String billNumber) { - this.billNumber = billNumber; - } - - public String getInvoiceNumber() { - return invoiceNumber; - } - - public void setInvoiceNumber(String invoiceNumber) { - this.invoiceNumber = invoiceNumber; - } - - private String id; - - private String insdt; - - private String insuser; - - private String warehouseId; - - private String goodsClassId; - - private String instockManId; - - private String auditManId; - - private String instockDate; - - private String bizId; - - private BigDecimal totalMoney; - - private String status; - - private String remark; - - private String auditOpinion; - - private BigDecimal taxrate; - - private String processdefid; - - private String processid; - - private Warehouse warehouse;//仓库 - - private GoodsClass goodsClass;//物品类型 - - private Company company; - - private String instockManName;//入库人名�? - - private String auditManName;//审核人名�? - - /** - * 是否后期补票 0否 1是 - */ - private Integer fareAdjustment; - - /** - * 是否专票 0否 1是 - */ - private Integer vatInvoice; - - private String fareAdjustmentText; - - private String vatInvoiceText; - - public String getFareAdjustmentText() { - return fareAdjustmentText; - } - - public void setFareAdjustmentText(String fareAdjustmentText) { - this.fareAdjustmentText = fareAdjustmentText; - } - - public String getVatInvoiceText() { - return vatInvoiceText; - } - - public void setVatInvoiceText(String vatInvoiceText) { - this.vatInvoiceText = vatInvoiceText; - } - - public Integer getFareAdjustment() { - return fareAdjustment; - } - - public void setFareAdjustment(Integer fareAdjustment) { - this.fareAdjustment = fareAdjustment; - } - - public Integer getVatInvoice() { - return vatInvoice; - } - - public void setVatInvoice(Integer vatInvoice) { - this.vatInvoice = vatInvoice; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getGoodsClassId() { - return goodsClassId; - } - - public void setGoodsClassId(String goodsClassId) { - this.goodsClassId = goodsClassId; - } - - public String getInstockManId() { - return instockManId; - } - - public void setInstockManId(String instockManId) { - this.instockManId = instockManId; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getInstockDate() { - return instockDate; - } - - public void setInstockDate(String instockDate) { - this.instockDate = instockDate; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getAuditOpinion() { - return auditOpinion; - } - - public void setAuditOpinion(String auditOpinion) { - this.auditOpinion = auditOpinion; - } - - public BigDecimal getTaxrate() { - return taxrate; - } - - public void setTaxrate(BigDecimal taxrate) { - this.taxrate = taxrate; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public Warehouse getWarehouse() { - return warehouse; - } - - public void setWarehouse(Warehouse warehouse) { - this.warehouse = warehouse; - } - - public GoodsClass getGoodsClass() { - return goodsClass; - } - - public void setGoodsClass(GoodsClass goodsClass) { - this.goodsClass = goodsClass; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getInstockManName() { - return instockManName; - } - - public void setInstockManName(String instockManName) { - this.instockManName = instockManName; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } -} diff --git a/src/com/sipai/entity/sparepart/InStockRecordDetail.java b/src/com/sipai/entity/sparepart/InStockRecordDetail.java deleted file mode 100644 index b2704880..00000000 --- a/src/com/sipai/entity/sparepart/InStockRecordDetail.java +++ /dev/null @@ -1,202 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; - -public class InStockRecordDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String goodsId; - - private BigDecimal instockNumber; - - private String instockRecordId; - - private BigDecimal price; - - private String supplierId; - - private String deptId; - - private BigDecimal totalMoney; - - private BigDecimal includeTaxratePrice; - - private BigDecimal includeTaxrateTotalMoney; - - private String purchaseRecordDetailId; - - private String type; - - private Goods goods; - - private Dept dept; - - private BigDecimal nowNumber; - - private BigDecimal taxrate; - - /** - * 判断是否可以计算 - */ - private Integer v; - - public Integer getV() { - return v; - } - - public void setV(Integer v) { - this.v = v; - } - - public BigDecimal getTaxrate() { - return taxrate; - } - - public void setTaxrate(BigDecimal taxrate) { - this.taxrate = taxrate; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getInstockNumber() { - return instockNumber; - } - - public void setInstockNumber(BigDecimal instockNumber) { - this.instockNumber = instockNumber; - } - - public String getInstockRecordId() { - return instockRecordId; - } - - public void setInstockRecordId(String instockRecordId) { - this.instockRecordId = instockRecordId; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public BigDecimal getIncludeTaxratePrice() { - return includeTaxratePrice; - } - - public void setIncludeTaxratePrice(BigDecimal includeTaxratePrice) { - this.includeTaxratePrice = includeTaxratePrice; - } - - public BigDecimal getIncludeTaxrateTotalMoney() { - return includeTaxrateTotalMoney; - } - - public void setIncludeTaxrateTotalMoney(BigDecimal includeTaxrateTotalMoney) { - this.includeTaxrateTotalMoney = includeTaxrateTotalMoney; - } - - public String getPurchaseRecordDetailId() { - return purchaseRecordDetailId; - } - - public void setPurchaseRecordDetailId(String purchaseRecordDetailId) { - this.purchaseRecordDetailId = purchaseRecordDetailId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public BigDecimal getNowNumber() { - return nowNumber; - } - - public void setNowNumber(BigDecimal nowNumber) { - this.nowNumber = nowNumber; - } -} diff --git a/src/com/sipai/entity/sparepart/InStockRecordUpdateMoney.java b/src/com/sipai/entity/sparepart/InStockRecordUpdateMoney.java deleted file mode 100644 index ac3f7611..00000000 --- a/src/com/sipai/entity/sparepart/InStockRecordUpdateMoney.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.entity.sparepart; - -public class InStockRecordUpdateMoney { - private String id; - - private String inDetailId; - - private Integer status; - - private String insdt; - - private String where; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInDetailId() { - return inDetailId; - } - - public void setInDetailId(String inDetailId) { - this.inDetailId = inDetailId == null ? null : inDetailId.trim(); - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } -} diff --git a/src/com/sipai/entity/sparepart/OutStockRecord.java b/src/com/sipai/entity/sparepart/OutStockRecord.java deleted file mode 100644 index 0db3d213..00000000 --- a/src/com/sipai/entity/sparepart/OutStockRecord.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; - -public class OutStockRecord extends BusinessUnitAdapter{ - - private String billNumber; - - public String getBillNumber() { - return billNumber; - } - - public void setBillNumber(String billNumber) { - this.billNumber = billNumber; - } - - private String id; - - private String insuser; - - private String insdt; - - private String warehouseId; - - private String deptId; - - private String userId; - - private String auditManId; - - private BigDecimal totalMoney; - - private String status; - - private String remark; - - private String outDate; - - private String goodsClassId; - - private String warehouseKeeperId; - - private String bizId; - - private String auditOpinion; - - private String processdefid; - - private String processid; - - private Warehouse warehouse; - - private Warehouse inhouse; - - private Dept dept; - - private GoodsClass goodsClass; - - private Company company; - - private String userName;//领用人名�? - - private String auditManName;//审核人名�? - - private String stockType; - - private String inhouseId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getOutDate() { - return outDate; - } - - public void setOutDate(String outDate) { - this.outDate = outDate; - } - - public String getGoodsClassId() { - return goodsClassId; - } - - public void setGoodsClassId(String goodsClassId) { - this.goodsClassId = goodsClassId; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getWarehouseKeeperId() { - return warehouseKeeperId; - } - - public void setWarehouseKeeperId(String warehouseKeeperId) { - this.warehouseKeeperId = warehouseKeeperId; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getAuditOpinion() { - return auditOpinion; - } - - public void setAuditOpinion(String auditOpinion) { - this.auditOpinion = auditOpinion; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public Warehouse getWarehouse() { - return warehouse; - } - - public void setWarehouse(Warehouse warehouse) { - this.warehouse = warehouse; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public GoodsClass getGoodsClass() { - return goodsClass; - } - - public void setGoodsClass(GoodsClass goodsClass) { - this.goodsClass = goodsClass; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } - - public String getStockType() { - return stockType; - } - - public void setStockType(String stockType) { - this.stockType = stockType; - } - - public String getInhouseId() { - return inhouseId; - } - - public void setInhouseId(String inhouseId) { - this.inhouseId = inhouseId; - } - - public Warehouse getInhouse() { - return inhouse; - } - - public void setInhouse(Warehouse inhouse) { - this.inhouse = inhouse; - } - -} diff --git a/src/com/sipai/entity/sparepart/OutStockRecordDetail.java b/src/com/sipai/entity/sparepart/OutStockRecordDetail.java deleted file mode 100644 index c86f61df..00000000 --- a/src/com/sipai/entity/sparepart/OutStockRecordDetail.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; - -public class OutStockRecordDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String outstockRecordId; - - private String goodsId; - - private BigDecimal outNumber; - - private BigDecimal price; - - private BigDecimal totalMoney; - - private String purpose; - - private String deptId; - - private String stockId; - - private BigDecimal consumeNumber; - - private Goods goods; - - private Dept dept; - - private BigDecimal includedTaxCostPrice; - - private BigDecimal includedTaxTotalMoney; - - - - public BigDecimal getIncludedTaxCostPrice() { - return includedTaxCostPrice; - } - - public void setIncludedTaxCostPrice(BigDecimal includedTaxCostPrice) { - this.includedTaxCostPrice = includedTaxCostPrice; - } - - public BigDecimal getIncludedTaxTotalMoney() { - return includedTaxTotalMoney; - } - - public void setIncludedTaxTotalMoney(BigDecimal includedTaxTotalMoney) { - this.includedTaxTotalMoney = includedTaxTotalMoney; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getOutstockRecordId() { - return outstockRecordId; - } - - public void setOutstockRecordId(String outstockRecordId) { - this.outstockRecordId = outstockRecordId; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getOutNumber() { - return outNumber; - } - - public void setOutNumber(BigDecimal outNumber) { - this.outNumber = outNumber; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getStockId() { - return stockId; - } - - public void setStockId(String stockId) { - this.stockId = stockId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public BigDecimal getConsumeNumber() { - return consumeNumber; - } - - public void setConsumeNumber(BigDecimal consumeNumber) { - this.consumeNumber = consumeNumber; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Performance.java b/src/com/sipai/entity/sparepart/Performance.java deleted file mode 100644 index 814abc0d..00000000 --- a/src/com/sipai/entity/sparepart/Performance.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Performance extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Integer morder; - - private Boolean active; - - private String pid; - - private String describe; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/PurchaseDetail.java b/src/com/sipai/entity/sparepart/PurchaseDetail.java deleted file mode 100644 index 6a1cf761..00000000 --- a/src/com/sipai/entity/sparepart/PurchaseDetail.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PurchaseDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String goodsId; - - private String supplierId; - - private BigDecimal number; - - private BigDecimal price; - - private BigDecimal totalMoney; - - private String departmentId; - - private String purpose; - - private String remark; - - private Goods goods; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getDepartmentId() { - return departmentId; - } - - public void setDepartmentId(String departmentId) { - this.departmentId = departmentId; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/PurchaseMethods.java b/src/com/sipai/entity/sparepart/PurchaseMethods.java deleted file mode 100644 index 17db533a..00000000 --- a/src/com/sipai/entity/sparepart/PurchaseMethods.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PurchaseMethods extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Integer morder; - - private Boolean active; - - private String pid; - - private String describe; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/PurchasePlan.java b/src/com/sipai/entity/sparepart/PurchasePlan.java deleted file mode 100644 index 6822cc10..00000000 --- a/src/com/sipai/entity/sparepart/PurchasePlan.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; - -public class PurchasePlan extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private String bizId; - - private String applicant; - - private String planPurchaseDate; - - private String departmentId; - - private BigDecimal totalMoney; - - private String checkMan; - - private String type; - - private String status; - - private String checkOpinion; - - private String remark; - - private Dept dept; - - private String userNames; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getApplicant() { - return applicant; - } - - public void setApplicant(String applicant) { - this.applicant = applicant; - } - - public String getPlanPurchaseDate() { - return planPurchaseDate; - } - - public void setPlanPurchaseDate(String planPurchaseDate) { - this.planPurchaseDate = planPurchaseDate; - } - - public String getDepartmentId() { - return departmentId; - } - - public void setDepartmentId(String departmentId) { - this.departmentId = departmentId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getCheckMan() { - return checkMan; - } - - public void setCheckMan(String checkMan) { - this.checkMan = checkMan; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getCheckOpinion() { - return checkOpinion; - } - - public void setCheckOpinion(String checkOpinion) { - this.checkOpinion = checkOpinion; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public String getUserNames() { - return userNames; - } - - public void setUserNames(String userNames) { - this.userNames = userNames; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/PurchaseRecord.java b/src/com/sipai/entity/sparepart/PurchaseRecord.java deleted file mode 100644 index 826d3a1f..00000000 --- a/src/com/sipai/entity/sparepart/PurchaseRecord.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class PurchaseRecord extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String purchaseManId; - - private String purchaseDate; - - private BigDecimal totalMoney; - - private String auditManId; - - private String status; - - private String remark; - - private Company company; - - private String purchaseManName;//采购负责人名称 - - private String auditManName;//采购验收人 - - private String sUserId; // 库管id - - private String sUserName; // 库管名称 - - public String getsUserName() { - return sUserName; - } - - public void setsUserName(String sUserName) { - this.sUserName = sUserName; - } - - private Integer sendMessageType; // 是否通知库管 0是 1否 - - public Integer getSendMessageType() { - return sendMessageType; - } - - public void setSendMessageType(Integer sendMessageType) { - this.sendMessageType = sendMessageType; - } - - public String getsUserId() { - return sUserId; - } - - public void setsUserId(String sUserId) { - this.sUserId = sUserId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getPurchaseManId() { - return purchaseManId; - } - - public void setPurchaseManId(String purchaseManId) { - this.purchaseManId = purchaseManId; - } - - public String getPurchaseDate() { - return purchaseDate; - } - - public void setPurchaseDate(String purchaseDate) { - this.purchaseDate = purchaseDate; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getPurchaseManName() { - return purchaseManName; - } - - public void setPurchaseManName(String purchaseManName) { - this.purchaseManName = purchaseManName; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } -} diff --git a/src/com/sipai/entity/sparepart/PurchaseRecordDetail.java b/src/com/sipai/entity/sparepart/PurchaseRecordDetail.java deleted file mode 100644 index 556d127b..00000000 --- a/src/com/sipai/entity/sparepart/PurchaseRecordDetail.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; - -public class PurchaseRecordDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String goodsId; - - private String supplierId; - - private BigDecimal number; - - private BigDecimal price; - - private BigDecimal totalMoney; - - private String deptId; - - private String purpose; - - private String recordId; - - private String subscribeDetailId; - - private String remark; - - private Goods goods; - - private Dept dept; - - private BigDecimal usableNumber;//可用于采购的数量 - - private SubscribeDetail subscribeDetail; - - public SubscribeDetail getSubscribeDetail() { - return subscribeDetail; - } - - public void setSubscribeDetail(SubscribeDetail subscribeDetail) { - this.subscribeDetail = subscribeDetail; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getRecordId() { - return recordId; - } - - public void setRecordId(String recordId) { - this.recordId = recordId; - } - - public String getSubscribeDetailId() { - return subscribeDetailId; - } - - public void setSubscribeDetailId(String subscribeDetailId) { - this.subscribeDetailId = subscribeDetailId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public BigDecimal getUsableNumber() { - return usableNumber; - } - - public void setUsableNumber(BigDecimal usableNumber) { - this.usableNumber = usableNumber; - } - -} diff --git a/src/com/sipai/entity/sparepart/Purpose.java b/src/com/sipai/entity/sparepart/Purpose.java deleted file mode 100644 index 388b848d..00000000 --- a/src/com/sipai/entity/sparepart/Purpose.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Purpose extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String status; - - private String pid; - - private String remark; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/QualificationType.java b/src/com/sipai/entity/sparepart/QualificationType.java deleted file mode 100644 index 4145a387..00000000 --- a/src/com/sipai/entity/sparepart/QualificationType.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.base.SQLAdapter; - -public class QualificationType extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String typeName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/QualificationType_copy.java b/src/com/sipai/entity/sparepart/QualificationType_copy.java deleted file mode 100644 index 2fd2a943..00000000 --- a/src/com/sipai/entity/sparepart/QualificationType_copy.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class QualificationType_copy extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String typeName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/RawMaterial.java b/src/com/sipai/entity/sparepart/RawMaterial.java deleted file mode 100644 index 8984d707..00000000 --- a/src/com/sipai/entity/sparepart/RawMaterial.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.user.Company; - -public class RawMaterial extends BusinessUnitAdapter { - - private String planSpotCheckCompleteTime; - - public String getPlanSpotCheckCompleteTime() { - return planSpotCheckCompleteTime; - } - - public void setPlanSpotCheckCompleteTime(String planSpotCheckCompleteTime) { - this.planSpotCheckCompleteTime = planSpotCheckCompleteTime; - } - - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - private String id; - - private String insdt; - - private String insuser; - - private String goodsClassId; - - private String registerManId; - - private String auditManId; - - private String registerDate; - - private String acceptanceResults; - - private String sampling; - - private String bizId; - - private String status; - - private String remark; - - private String auditOpinion; - - private String processdefid; - - private String processid; - - private GoodsClass goodsClass;//物品类型 - - private Company company; - - private String registerManName;//入库人名�??? - - private String auditManName;//审核人名�??? - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getGoodsClassId() { - return goodsClassId; - } - - public void setGoodsClassId(String goodsClassId) { - this.goodsClassId = goodsClassId; - } - - public String getRegisterManId() { - return registerManId; - } - - public void setRegisterManId(String registerManId) { - this.registerManId = registerManId; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getRegisterDate() { - return registerDate; - } - - public void setRegisterDate(String registerDate) { - this.registerDate = registerDate; - } - - public String getAcceptanceResults() { - return acceptanceResults; - } - - public void setAcceptanceResults(String acceptanceResults) { - this.acceptanceResults = acceptanceResults; - } - - public String getSampling() { - return sampling; - } - - public void setSampling(String sampling) { - this.sampling = sampling; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getAuditOpinion() { - return auditOpinion; - } - - public void setAuditOpinion(String auditOpinion) { - this.auditOpinion = auditOpinion; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public GoodsClass getGoodsClass() { - return goodsClass; - } - - public void setGoodsClass(GoodsClass goodsClass) { - this.goodsClass = goodsClass; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getRegisterManName() { - return registerManName; - } - - public void setRegisterManName(String registerManName) { - this.registerManName = registerManName; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/RawMaterialDetail.java b/src/com/sipai/entity/sparepart/RawMaterialDetail.java deleted file mode 100644 index b74cbb02..00000000 --- a/src/com/sipai/entity/sparepart/RawMaterialDetail.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; - -public class RawMaterialDetail extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String goodsId; - - private BigDecimal rawmaterialNumber; - - private String rawmaterialId; - - private BigDecimal price; - - private String supplierId; - - private String deptId; - - private BigDecimal totalMoney; - - private BigDecimal includeTaxratePrice; - - private BigDecimal includeTaxrateTotalMoney; - - private String type; - - private BigDecimal taxAmount; - - private Goods goods; - - private Dept dept; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getRawmaterialNumber() { - return rawmaterialNumber; - } - - public void setRawmaterialNumber(BigDecimal rawmaterialNumber) { - this.rawmaterialNumber = rawmaterialNumber; - } - - public String getRawmaterialId() { - return rawmaterialId; - } - - public void setRawmaterialId(String rawmaterialId) { - this.rawmaterialId = rawmaterialId; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public BigDecimal getIncludeTaxratePrice() { - return includeTaxratePrice; - } - - public void setIncludeTaxratePrice(BigDecimal includeTaxratePrice) { - this.includeTaxratePrice = includeTaxratePrice; - } - - public BigDecimal getIncludeTaxrateTotalMoney() { - return includeTaxrateTotalMoney; - } - - public void setIncludeTaxrateTotalMoney(BigDecimal includeTaxrateTotalMoney) { - this.includeTaxrateTotalMoney = includeTaxrateTotalMoney; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public BigDecimal getTaxAmount() { - return taxAmount; - } - - public void setTaxAmount(BigDecimal taxAmount) { - this.taxAmount = taxAmount; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ReturnStockRecord.java b/src/com/sipai/entity/sparepart/ReturnStockRecord.java deleted file mode 100644 index 04b1dfc0..00000000 --- a/src/com/sipai/entity/sparepart/ReturnStockRecord.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class ReturnStockRecord extends SQLAdapter{ - - private String id; - - private String insdt; - - private String insuser; - - private String warehouseId; - - private String goodsClassId; - - private String instockManId; - - private String auditManId; - - private String instockDate; - - private String bizId; - - private BigDecimal totalMoney; - - private String status; - - private String remark; - - private String auditOpinion; - - private BigDecimal taxrate; - - private String processdefid; - - private String processid; - - private Warehouse warehouse;//仓库 - - private GoodsClass goodsClass;//物品类型 - - private Company company; - - private String instockManName;//入库人名�? - - private String auditManName;//审核人名�? - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getGoodsClassId() { - return goodsClassId; - } - - public void setGoodsClassId(String goodsClassId) { - this.goodsClassId = goodsClassId; - } - - public String getInstockManId() { - return instockManId; - } - - public void setInstockManId(String instockManId) { - this.instockManId = instockManId; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getInstockDate() { - return instockDate; - } - - public void setInstockDate(String instockDate) { - this.instockDate = instockDate; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getAuditOpinion() { - return auditOpinion; - } - - public void setAuditOpinion(String auditOpinion) { - this.auditOpinion = auditOpinion; - } - - public BigDecimal getTaxrate() { - return taxrate; - } - - public void setTaxrate(BigDecimal taxrate) { - this.taxrate = taxrate; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public Warehouse getWarehouse() { - return warehouse; - } - - public void setWarehouse(Warehouse warehouse) { - this.warehouse = warehouse; - } - - public GoodsClass getGoodsClass() { - return goodsClass; - } - - public void setGoodsClass(GoodsClass goodsClass) { - this.goodsClass = goodsClass; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getInstockManName() { - return instockManName; - } - - public void setInstockManName(String instockManName) { - this.instockManName = instockManName; - } - - public String getAuditManName() { - return auditManName; - } - - public void setAuditManName(String auditManName) { - this.auditManName = auditManName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/ReturnStockRecordDetail.java b/src/com/sipai/entity/sparepart/ReturnStockRecordDetail.java deleted file mode 100644 index 0f2b1a34..00000000 --- a/src/com/sipai/entity/sparepart/ReturnStockRecordDetail.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; - -public class ReturnStockRecordDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String goodsId; - - private BigDecimal instockNumber; - - private String instockRecordId; - - private BigDecimal price; - - private String supplierId; - - private String deptId; - - private BigDecimal totalMoney; - - private BigDecimal includeTaxratePrice; - - private BigDecimal includeTaxrateTotalMoney; - - private String purchaseRecordDetailId; - - private String type; - - private Goods goods; - - private Dept dept; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getInstockNumber() { - return instockNumber; - } - - public void setInstockNumber(BigDecimal instockNumber) { - this.instockNumber = instockNumber; - } - - public String getInstockRecordId() { - return instockRecordId; - } - - public void setInstockRecordId(String instockRecordId) { - this.instockRecordId = instockRecordId; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public BigDecimal getIncludeTaxratePrice() { - return includeTaxratePrice; - } - - public void setIncludeTaxratePrice(BigDecimal includeTaxratePrice) { - this.includeTaxratePrice = includeTaxratePrice; - } - - public BigDecimal getIncludeTaxrateTotalMoney() { - return includeTaxrateTotalMoney; - } - - public void setIncludeTaxrateTotalMoney(BigDecimal includeTaxrateTotalMoney) { - this.includeTaxrateTotalMoney = includeTaxrateTotalMoney; - } - - public String getPurchaseRecordDetailId() { - return purchaseRecordDetailId; - } - - public void setPurchaseRecordDetailId(String purchaseRecordDetailId) { - this.purchaseRecordDetailId = purchaseRecordDetailId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Score.java b/src/com/sipai/entity/sparepart/Score.java deleted file mode 100644 index 9033ffe4..00000000 --- a/src/com/sipai/entity/sparepart/Score.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.base.SQLAdapter; - -public class Score extends SQLAdapter{ - private String id; - - private Double total; - - private String userId; - //价格打分 - private Double priceScore; - //品质打分 - private Double qualityScore; - //交货期打分 - private Double deliveryTimeScore; - //服务水平打分 - private Double serviceLevelScore; - //信用度打分 - private Double creditScore; - //配合度打分 - private Double matchingScore; - //供应商ID - private String supplierId; - //供应商 - private String supplierName; - //供应商类型 - private String supplierType; - //联系人 - private String linkMan; - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } - - public String getSupplierType() { - return supplierType; - } - - public void setSupplierType(String supplierType) { - this.supplierType = supplierType; - } - - public String getLinkMan() { - return linkMan; - } - - public void setLinkMan(String linkMan) { - this.linkMan = linkMan; - } - - private String creationTime; - - private String years; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Double getTotal() { - return total; - } - - public void setTotal(Double total) { - this.total = total; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public Double getPriceScore() { - return priceScore; - } - - public void setPriceScore(Double priceScore) { - this.priceScore = priceScore; - } - - public Double getQualityScore() { - return qualityScore; - } - - public void setQualityScore(Double qualityScore) { - this.qualityScore = qualityScore; - } - - public Double getDeliveryTimeScore() { - return deliveryTimeScore; - } - - public void setDeliveryTimeScore(Double deliveryTimeScore) { - this.deliveryTimeScore = deliveryTimeScore; - } - - public Double getServiceLevelScore() { - return serviceLevelScore; - } - - public void setServiceLevelScore(Double serviceLevelScore) { - this.serviceLevelScore = serviceLevelScore; - } - - public Double getCreditScore() { - return creditScore; - } - - public void setCreditScore(Double creditScore) { - this.creditScore = creditScore; - } - - public Double getMatchingScore() { - return matchingScore; - } - - public void setMatchingScore(Double matchingScore) { - this.matchingScore = matchingScore; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getCreationTime() { - return creationTime; - } - - public void setCreationTime(String creationTime) { - this.creationTime = creationTime; - } - - public String getYears() { - return years; - } - - public void setYears(String years) { - this.years = years; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Score_copy.java b/src/com/sipai/entity/sparepart/Score_copy.java deleted file mode 100644 index e9036f2a..00000000 --- a/src/com/sipai/entity/sparepart/Score_copy.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Score_copy extends SQLAdapter{ - private String id; - - private Double total; - - private String userId; - //价格打分 - private Double priceScore; - //品质打分 - private Double qualityScore; - //交货期打分 - private Double deliveryTimeScore; - //服务水平打分 - private Double serviceLevelScore; - //信用度打分 - private Double creditScore; - //配合度打分 - private Double matchingScore; - //供应商ID - private String supplierId; - //供应商 - private String supplierName; - //供应商类型 - private String supplierType; - //联系人 - private String linkMan; - public String getSupplierName() { - return supplierName; - } - - public void setSupplierName(String supplierName) { - this.supplierName = supplierName; - } - - public String getSupplierType() { - return supplierType; - } - - public void setSupplierType(String supplierType) { - this.supplierType = supplierType; - } - - public String getLinkMan() { - return linkMan; - } - - public void setLinkMan(String linkMan) { - this.linkMan = linkMan; - } - - private String creationTime; - - private String years; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Double getTotal() { - return total; - } - - public void setTotal(Double total) { - this.total = total; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public Double getPriceScore() { - return priceScore; - } - - public void setPriceScore(Double priceScore) { - this.priceScore = priceScore; - } - - public Double getQualityScore() { - return qualityScore; - } - - public void setQualityScore(Double qualityScore) { - this.qualityScore = qualityScore; - } - - public Double getDeliveryTimeScore() { - return deliveryTimeScore; - } - - public void setDeliveryTimeScore(Double deliveryTimeScore) { - this.deliveryTimeScore = deliveryTimeScore; - } - - public Double getServiceLevelScore() { - return serviceLevelScore; - } - - public void setServiceLevelScore(Double serviceLevelScore) { - this.serviceLevelScore = serviceLevelScore; - } - - public Double getCreditScore() { - return creditScore; - } - - public void setCreditScore(Double creditScore) { - this.creditScore = creditScore; - } - - public Double getMatchingScore() { - return matchingScore; - } - - public void setMatchingScore(Double matchingScore) { - this.matchingScore = matchingScore; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getCreationTime() { - return creationTime; - } - - public void setCreationTime(String creationTime) { - this.creationTime = creationTime; - } - - public String getYears() { - return years; - } - - public void setYears(String years) { - this.years = years; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Sewage.java b/src/com/sipai/entity/sparepart/Sewage.java deleted file mode 100644 index 5969446f..00000000 --- a/src/com/sipai/entity/sparepart/Sewage.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -public class Sewage extends SQLAdapter { - private String id; - - private String contractNumber; - - private Integer contractOrder; - - private String name; - - private String address; - - private String contractDate; - - private String username; - - private String phone; - - private String processSectionId; - - private String unitId; - - private String ventNum; - - private String permitNum; - - private String planeNum; - - private String environmentNum; - - private String trade; - - private String permit; - - private Integer displacement; - - private String standard; - - private String city; - - private String societyNumber; - - private String longitudeLatitude; - - private String attribute; - - private String remark; - - private Company company; - - private ProcessSection processSection; - - private boolean _point; - - private boolean _input; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContractNumber() { - return contractNumber; - } - - public void setContractNumber(String contractNumber) { - this.contractNumber = contractNumber; - } - - public Integer getContractOrder() { - return contractOrder; - } - - public void setContractOrder(Integer contractOrder) { - this.contractOrder = contractOrder; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getContractDate() { - return contractDate; - } - - public void setContractDate(String contractDate) { - this.contractDate = contractDate; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getVentNum() { - return ventNum; - } - - public void setVentNum(String ventNum) { - this.ventNum = ventNum; - } - - public String getPermitNum() { - return permitNum; - } - - public void setPermitNum(String permitNum) { - this.permitNum = permitNum; - } - - public String getPlaneNum() { - return planeNum; - } - - public void setPlaneNum(String planeNum) { - this.planeNum = planeNum; - } - - public String getEnvironmentNum() { - return environmentNum; - } - - public void setEnvironmentNum(String environmentNum) { - this.environmentNum = environmentNum; - } - - public String getTrade() { - return trade; - } - - public void setTrade(String trade) { - this.trade = trade; - } - - public String getPermit() { - return permit; - } - - public void setPermit(String permit) { - this.permit = permit; - } - - public Integer getDisplacement() { - return displacement; - } - - public void setDisplacement(Integer displacement) { - this.displacement = displacement; - } - - public String getStandard() { - return standard; - } - - public void setStandard(String standard) { - this.standard = standard; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getSocietyNumber() { - return societyNumber; - } - - public void setSocietyNumber(String societyNumber) { - this.societyNumber = societyNumber; - } - - public String getLongitudeLatitude() { - return longitudeLatitude; - } - - public void setLongitudeLatitude(String longitudeLatitude) { - this.longitudeLatitude = longitudeLatitude; - } - - public String getAttribute() { - return attribute; - } - - public void setAttribute(String attribute) { - this.attribute = attribute; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public boolean is_point() { - return _point; - } - - public void set_point(boolean _point) { - this._point = _point; - } - - public boolean is_input() { - return _input; - } - - public void set_input(boolean _input) { - this._input = _input; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SewageInput.java b/src/com/sipai/entity/sparepart/SewageInput.java deleted file mode 100644 index 7bf2cd62..00000000 --- a/src/com/sipai/entity/sparepart/SewageInput.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class SewageInput extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String sewageId; - - private String inputCod; - - private String inputPh; - - private String inputAmmoniaNitrogen; - - private String inputPhosphorus; - - private String inputNitrogen; - - private String remarks; - - private String inputDt; - - private String inputSs; - - private String inputBod; - - private String inputChroma; - - private String inputUserid; - - private User inputUser; - - private Sewage sewage; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSewageId() { - return sewageId; - } - - public void setSewageId(String sewageId) { - this.sewageId = sewageId; - } - - public String getInputCod() { - return inputCod; - } - - public void setInputCod(String inputCod) { - this.inputCod = inputCod; - } - - public String getInputPh() { - return inputPh; - } - - public void setInputPh(String inputPh) { - this.inputPh = inputPh; - } - - public String getInputAmmoniaNitrogen() { - return inputAmmoniaNitrogen; - } - - public void setInputAmmoniaNitrogen(String inputAmmoniaNitrogen) { - this.inputAmmoniaNitrogen = inputAmmoniaNitrogen; - } - - public String getInputPhosphorus() { - return inputPhosphorus; - } - - public void setInputPhosphorus(String inputPhosphorus) { - this.inputPhosphorus = inputPhosphorus; - } - - public String getInputNitrogen() { - return inputNitrogen; - } - - public void setInputNitrogen(String inputNitrogen) { - this.inputNitrogen = inputNitrogen; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getInputDt() { - return inputDt; - } - - public void setInputDt(String inputDt) { - this.inputDt = inputDt; - } - - public String getInputSs() { - return inputSs; - } - - public void setInputSs(String inputSs) { - this.inputSs = inputSs; - } - - public String getInputBod() { - return inputBod; - } - - public void setInputBod(String inputBod) { - this.inputBod = inputBod; - } - - public String getInputChroma() { - return inputChroma; - } - - public void setInputChroma(String inputChroma) { - this.inputChroma = inputChroma; - } - - public String getInputUserid() { - return inputUserid; - } - - public void setInputUserid(String inputUserid) { - this.inputUserid = inputUserid; - } - - public User getInputUser() { - return inputUser; - } - - public void setInputUser(User inputUser) { - this.inputUser = inputUser; - } - - public Sewage getSewage() { - return sewage; - } - - public void setSewage(Sewage sewage) { - this.sewage = sewage; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SparePartCommString.java b/src/com/sipai/entity/sparepart/SparePartCommString.java deleted file mode 100644 index ea2dcdaf..00000000 --- a/src/com/sipai/entity/sparepart/SparePartCommString.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.LinkedBlockingQueue; - -public class SparePartCommString { - - //仓库状态 - public static final String WAREHOUSE_START = "1";//表示启用 - public static final String WAREHOUSE_STOP = "0";//表示停用 - public static final String WAREHOUSE_CHECK = "2";//表示盘点中 - - //采购计划分类 - public static final String PURCHASE_DEPARTMENT = "0";//部门申购 - public static final String PURCHASE_PLAN = "1";//申购计划 - - /** - * 仓库出库方式 - */ - public static final Integer F_IN_OUT = 0; //先入先出 - public static final Integer W_AVG = 1; //平均 - - //申购 - public static final String department= "department";//部门申购 - public static final String personal= "personal";//个人申购 - public static final String temporary= "temporary";//临时申购 - - //部门申购状态 - public static final String STATUS_START= "0";//发起 - public static final String STATUS_DEPT_AUDIT = "1";//部门审核 - public static final String STATUS_DEPT_REJECT = "2";//部门审核驳回 - public static final String STATUS_PURCHASE_INQUIRY = "3";//采购询价 - public static final String STATUS_INQUIRY_AUDIT = "4";//采购询价审核 - public static final String STATUS_INQUIRY_REJECT = "5";//采购询价驳回 - public static final String STATUS_FINISH = "6";//申购完成 - - //个人申购状态 - public static final String STATUS_PERSONAL_START = "10";//未提交 - public static final String STATUS_PERSONAL_AUDIT = "11";//已提交 - public static final String STATUS_PERSONAL_REJECT = "12";//已退回 - public static final String STATUS_PERSONAL_FINISH = "13";//已使用 - - //合同状态 - public static final String STATUS_CONTRACT_START= "1";//起草合同 - public static final String STATUS_CONTRACT_DEPT_AUDIT = "2";//部门审核 - public static final String STATUS_CONTRACT_DEPT_REJECT = "3";//部门审核驳回 - public static final String STATUS_CONTRACT_AUDIT = "4";//领导审核 - public static final String STATUS_CONTRACT_REJECT = "5";//领导审核驳回 - public static final String STATUS_CONTRACT_EXECUTE = "6";//合同执行 - public static final String STATUS_CONTRACT_FINISH = "7";//合同完成 - - public static String[][] ContractCheckStatusArr={ - {"1","发起合同"},{"2","部门审核"},{"3","部门审核驳回"},{"4","领导审核"},{"5","领导审核驳回"},{"6","合同执行"},{"7","合同完成"} - }; - - //采购记录状态 - public static final String STATUS_ACCEPT = "0";//采购验收 - public static final String STATUS_COMEIN = "1";//验收入库 - //库存管理中审核的状态 - public static final String STATUS_STOCK_START = "0";//入库记录未提交 - public static final String STATUS_STOCK_AUDIT = "1";//入库记录提交审核 - public static final String STATUS_STOCK_FINISH = "2";//审核完成 - public static final String STATUS_STOCK_FAIL = "3";//审核不合格 - // 设备报废中审核的状态 - public static final String STATUS_SCRAP_START = "0";//入库记录未提交 - public static final String STATUS_SCRAP_AUDIT = "1";//入库记录提交审核 - public static final String STATUS_SCRAP_FINISH = "2";//审核完成 - public static final String STATUS_SCRAP_FAIL = "3";//审核不合格 - //盘点状态 - public static final String STATUS_CHECK_START = "0";//开始盘点 - public static final String STATUS_CHECK_FINISH = "1";//盘点结束 - //库存状态 - public static final String STATUS_STOCK_NORMAL = "0";//库存正常 - public static final String STATUS_STOCK_ALARM = "1";//库存报警 - //入库明细的类型 - public static final String INSTOCK_PURCHASE = "0";//采购入库 - public static final String INSTOCK_OTHER = "1";//其他入库 - public static final String INSTOCK_SECTION = "2";//处级入库 - -} diff --git a/src/com/sipai/entity/sparepart/Stock.java b/src/com/sipai/entity/sparepart/Stock.java deleted file mode 100644 index 74e9b6d8..00000000 --- a/src/com/sipai/entity/sparepart/Stock.java +++ /dev/null @@ -1,309 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class Stock extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String goodsId; - - private String warehouseId; - - private String accountId; - - private BigDecimal initNumber; - - private BigDecimal inNumber; - - private BigDecimal outNumber; - - private BigDecimal costPrice; - - private BigDecimal nowNumber; - - private BigDecimal availableNumber; - - private String accountDate; - - private BigDecimal realNumber; - - private BigDecimal shiftNumber; - - private String shiftMemo; - - private BigDecimal totalMoney; - - private String alarmStatus; - - private Company company; - - private Goods goods; - - private Warehouse warehouse; - - private String _fprice; - - private String _fnum; - - private String _fid; - - private BigDecimal includedTaxCostPrice; - - private BigDecimal includedTaxTotalMoney; - - private String date; - - private String max; - - private String min; - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public BigDecimal getAvailableNumber() { - return availableNumber; - } - - public void setAvailableNumber(BigDecimal availableNumber) { - this.availableNumber = availableNumber; - } - - public BigDecimal getIncludedTaxCostPrice() { - return includedTaxCostPrice; - } - - public void setIncludedTaxCostPrice(BigDecimal includedTaxCostPrice) { - this.includedTaxCostPrice = includedTaxCostPrice; - } - - public BigDecimal getIncludedTaxTotalMoney() { - return includedTaxTotalMoney; - } - - public void setIncludedTaxTotalMoney(BigDecimal includedTaxTotalMoney) { - this.includedTaxTotalMoney = includedTaxTotalMoney; - } - - public String get_fprice() { - return _fprice; - } - - public void set_fprice(String _fprice) { - this._fprice = _fprice; - } - - public String get_fnum() { - return _fnum; - } - - public void set_fnum(String _fnum) { - this._fnum = _fnum; - } - - public String get_fid() { - return _fid; - } - - public void set_fid(String _fid) { - this._fid = _fid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getAccountId() { - return accountId; - } - - public void setAccountId(String accountId) { - this.accountId = accountId; - } - - public BigDecimal getInitNumber() { - return initNumber; - } - - public void setInitNumber(BigDecimal initNumber) { - this.initNumber = initNumber; - } - - public BigDecimal getInNumber() { - return inNumber; - } - - public void setInNumber(BigDecimal inNumber) { - this.inNumber = inNumber; - } - - public BigDecimal getOutNumber() { - return outNumber; - } - - public void setOutNumber(BigDecimal outNumber) { - this.outNumber = outNumber; - } - - public BigDecimal getCostPrice() { - return costPrice; - } - - public void setCostPrice(BigDecimal costPrice) { - this.costPrice = costPrice; - } - - public BigDecimal getNowNumber() { - return nowNumber; - } - - public void setNowNumber(BigDecimal nowNumber) { - this.nowNumber = nowNumber; - } - - public String getAccountDate() { - return accountDate; - } - - public void setAccountDate(String accountDate) { - this.accountDate = accountDate; - } - - public BigDecimal getRealNumber() { - return realNumber; - } - - public void setRealNumber(BigDecimal realNumber) { - this.realNumber = realNumber; - } - - public BigDecimal getShiftNumber() { - return shiftNumber; - } - - public void setShiftNumber(BigDecimal shiftNumber) { - this.shiftNumber = shiftNumber; - } - - public String getShiftMemo() { - return shiftMemo; - } - - public void setShiftMemo(String shiftMemo) { - this.shiftMemo = shiftMemo; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getAlarmStatus() { - return alarmStatus; - } - - public void setAlarmStatus(String alarmStatus) { - this.alarmStatus = alarmStatus; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Warehouse getWarehouse() { - return warehouse; - } - - public void setWarehouse(Warehouse warehouse) { - this.warehouse = warehouse; - } -} diff --git a/src/com/sipai/entity/sparepart/StockCheck.java b/src/com/sipai/entity/sparepart/StockCheck.java deleted file mode 100644 index 116708a6..00000000 --- a/src/com/sipai/entity/sparepart/StockCheck.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class StockCheck extends BusinessUnitAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String bizId; - - private String warehouseId; - - private String startdt; - - private String enddt; - - private String lastTime; - - private String nowTime; - - private String accountId; - - private String status; - - private String handlerId; - - private String auditId; - - private String remark; - - private String processdefid; - - private String processid; - - private Company company; - - private Warehouse warehouse; - - private String handlerName;//盘点人名称 - - private String auditName;//审核人名称 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getStartdt() { - return startdt; - } - - public void setStartdt(String startdt) { - this.startdt = startdt; - } - - public String getEnddt() { - return enddt; - } - - public void setEnddt(String enddt) { - this.enddt = enddt; - } - - public String getLastTime() { - return lastTime; - } - - public void setLastTime(String lastTime) { - this.lastTime = lastTime; - } - - public String getNowTime() { - return nowTime; - } - - public void setNowTime(String nowTime) { - this.nowTime = nowTime; - } - - public String getAccountId() { - return accountId; - } - - public void setAccountId(String accountId) { - this.accountId = accountId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getHandlerId() { - return handlerId; - } - - public void setHandlerId(String handlerId) { - this.handlerId = handlerId; - } - - public String getAuditId() { - return auditId; - } - - public void setAuditId(String auditId) { - this.auditId = auditId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public Warehouse getWarehouse() { - return warehouse; - } - - public void setWarehouse(Warehouse warehouse) { - this.warehouse = warehouse; - } - - public String getHandlerName() { - return handlerName; - } - - public String getAuditName() { - return auditName; - } - - public void setAuditName(String auditName) { - this.auditName = auditName; - } - - public void setHandlerName(String handlerName) { - this.handlerName = handlerName; - } -} diff --git a/src/com/sipai/entity/sparepart/StockCheckDetail.java b/src/com/sipai/entity/sparepart/StockCheckDetail.java deleted file mode 100644 index 23b6ac1f..00000000 --- a/src/com/sipai/entity/sparepart/StockCheckDetail.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class StockCheckDetail extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String checkId; - - private String goodsId; - - private BigDecimal realNumber; - - private BigDecimal accountNumber; - - private BigDecimal price; - - private BigDecimal differenceNumber; - - private String status; - - private String warehouseId; - - private String remark; - - private Goods goods; - - private String sort; - - public String getSort() { - return sort; - } - - public void setSort(String sort) { - this.sort = sort; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getCheckId() { - return checkId; - } - - public void setCheckId(String checkId) { - this.checkId = checkId; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getRealNumber() { - return realNumber; - } - - public void setRealNumber(BigDecimal realNumber) { - this.realNumber = realNumber; - } - - public BigDecimal getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(BigDecimal accountNumber) { - this.accountNumber = accountNumber; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getDifferenceNumber() { - return differenceNumber; - } - - public void setDifferenceNumber(BigDecimal differenceNumber) { - this.differenceNumber = differenceNumber; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getWarehouseId() { - return warehouseId; - } - - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } -} diff --git a/src/com/sipai/entity/sparepart/StockTransfersApplyDetail.java b/src/com/sipai/entity/sparepart/StockTransfersApplyDetail.java deleted file mode 100644 index 3d3fa390..00000000 --- a/src/com/sipai/entity/sparepart/StockTransfersApplyDetail.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class StockTransfersApplyDetail extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private BigDecimal number; - - private String unit; - - private BigDecimal price; - - private BigDecimal totalMoney; - - private String transfersApplyNumber; - - private String stockId; - - private Stock stock; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getTransfersApplyNumber() { - return transfersApplyNumber; - } - - public void setTransfersApplyNumber(String transfersApplyNumber) { - this.transfersApplyNumber = transfersApplyNumber; - } - - public String getStockId() { - return stockId; - } - - public void setStockId(String stockId) { - this.stockId = stockId; - } - - public Stock getStock() { - return stock; - } - - public void setStock(Stock stock) { - this.stock = stock; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Subscribe.java b/src/com/sipai/entity/sparepart/Subscribe.java deleted file mode 100644 index ed7bb357..00000000 --- a/src/com/sipai/entity/sparepart/Subscribe.java +++ /dev/null @@ -1,272 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; - -public class Subscribe extends BusinessUnitAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizId; - - private String deptId; - - private String subscribeManId; - - private String subscribeDate; - - private String subscribeAuditId; - - private String inquiryAuditId; - - private String inquiryManId; - - private String status; - - private BigDecimal totalMoney; - - private String rejectReason; - - private String pid; - - private String remark; - - private String processdefid; - - private String processid; - - private Dept dept; - - private Company company; - - private String subscribeManName;//用于显示申购人名称 - - private String subscribeAuditName;//显示审核人名称 - - private String purchasemethodsid; - - private String channelsid; - - private String purchasemethodsName; - - private String channelsName; - - private String type; - - public String getPurchasemethodsid() { - return purchasemethodsid; - } - - public void setPurchasemethodsid(String purchasemethodsid) { - this.purchasemethodsid = purchasemethodsid; - } - - public String getChannelsid() { - return channelsid; - } - - public void setChannelsid(String channelsid) { - this.channelsid = channelsid; - } - - public String getPurchasemethodsName() { - return purchasemethodsName; - } - - public void setPurchasemethodsName(String purchasemethodsName) { - this.purchasemethodsName = purchasemethodsName; - } - - public String getChannelsName() { - return channelsName; - } - - public void setChannelsName(String channelsName) { - this.channelsName = channelsName; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getSubscribeManId() { - return subscribeManId; - } - - public void setSubscribeManId(String subscribeManId) { - this.subscribeManId = subscribeManId; - } - - public String getSubscribeDate() { - return subscribeDate; - } - - public void setSubscribeDate(String subscribeDate) { - this.subscribeDate = subscribeDate; - } - - public String getSubscribeAuditId() { - return subscribeAuditId; - } - - public void setSubscribeAuditId(String subscribeAuditId) { - this.subscribeAuditId = subscribeAuditId; - } - - public String getInquiryAuditId() { - return inquiryAuditId; - } - - public void setInquiryAuditId(String inquiryAuditId) { - this.inquiryAuditId = inquiryAuditId; - } - - public String getInquiryManId() { - return inquiryManId; - } - - public void setInquiryManId(String inquiryManId) { - this.inquiryManId = inquiryManId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getRejectReason() { - return rejectReason; - } - - public void setRejectReason(String rejectReason) { - this.rejectReason = rejectReason; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getSubscribeManName() { - return subscribeManName; - } - - public void setSubscribeManName(String subscribeManName) { - this.subscribeManName = subscribeManName; - } - - public String getSubscribeAuditName() { - return subscribeAuditName; - } - - public void setSubscribeAuditName(String subscribeAuditName) { - this.subscribeAuditName = subscribeAuditName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SubscribeDetail.java b/src/com/sipai/entity/sparepart/SubscribeDetail.java deleted file mode 100644 index bc20f5dd..00000000 --- a/src/com/sipai/entity/sparepart/SubscribeDetail.java +++ /dev/null @@ -1,318 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class SubscribeDetail extends SQLAdapter{ - private String planArrivalTime; - - private String planArrivalPlace; - - public String getPlanArrivalTime() { - return planArrivalTime; - } - - public void setPlanArrivalTime(String planArrivalTime) { - this.planArrivalTime = planArrivalTime; - } - - public String getPlanArrivalPlace() { - return planArrivalPlace; - } - - public void setPlanArrivalPlace(String planArrivalPlace) { - this.planArrivalPlace = planArrivalPlace; - } - - private String memo; - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - private String processsectionid; - - private String equipmentBigClassId; - - private String equipmentclassid; - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid; - } - - public String getEquipmentBigClassId() { - return equipmentBigClassId; - } - - public void setEquipmentBigClassId(String equipmentBigClassId) { - this.equipmentBigClassId = equipmentBigClassId; - } - - public String getEquipmentclassid() { - return equipmentclassid; - } - - public void setEquipmentclassid(String equipmentclassid) { - this.equipmentclassid = equipmentclassid; - } - - private String id; - - private String insdt; - - private String insuser; - - private String subscribeId; - - private String pid; - - private String goodsId; - - private String supplierId; - - private BigDecimal number; - - private BigDecimal price; - - private BigDecimal totalMoney; - - private String deptId; - - private String purpose; - - private String channelsid; - - private String install; - - private String design; - - private String manufacturer; - - private String brand; - - private String contractId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSubscribeId() { - return subscribeId; - } - - public void setSubscribeId(String subscribeId) { - this.subscribeId = subscribeId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalMoney() { - return totalMoney; - } - - public void setTotalMoney(BigDecimal totalMoney) { - this.totalMoney = totalMoney; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getChannelsid() { - return channelsid; - } - - public void setChannelsid(String channelsid) { - this.channelsid = channelsid; - } - - public String getInstall() { - return install; - } - - public void setInstall(String install) { - this.install = install; - } - - public String getDesign() { - return design; - } - - public void setDesign(String design) { - this.design = design; - } - - public String getManufacturer() { - return manufacturer; - } - - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - public String getBrand() { - return brand; - } - - public void setBrand(String brand) { - this.brand = brand; - } - - public String getContractId() { - return contractId; - } - - public void setContractId(String contractId) { - this.contractId = contractId; - } - - private Goods goods; - - private Subscribe subscribe; - - private BigDecimal usableNumber;//可用于采购的数量 - - private String channelsName; - - public String getChannelsName() { - return channelsName; - } - - public void setChannelsName(String channelsName) { - this.channelsName = channelsName; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } - - public Subscribe getSubscribe() { - return subscribe; - } - - public void setSubscribe(Subscribe subscribe) { - this.subscribe = subscribe; - } - - public BigDecimal getUsableNumber() { - return usableNumber; - } - - public void setUsableNumber(BigDecimal usableNumber) { - this.usableNumber = usableNumber; - } - - private String detailGoodsName; - - private String detailGoodsSpecifications; - - private String detailGoodsModel; - - public String getDetailGoodsName() { - return detailGoodsName; - } - - public void setDetailGoodsName(String detailGoodsName) { - this.detailGoodsName = detailGoodsName; - } - - public String getDetailGoodsSpecifications() { - return detailGoodsSpecifications; - } - - public void setDetailGoodsSpecifications(String detailGoodsSpecifications) { - this.detailGoodsSpecifications = detailGoodsSpecifications; - } - - public String getDetailGoodsModel() { - return detailGoodsModel; - } - - public void setDetailGoodsModel(String detailGoodsModel) { - this.detailGoodsModel = detailGoodsModel; - } -} diff --git a/src/com/sipai/entity/sparepart/SubscribeMessage.java b/src/com/sipai/entity/sparepart/SubscribeMessage.java deleted file mode 100644 index 6674732e..00000000 --- a/src/com/sipai/entity/sparepart/SubscribeMessage.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.entity.sparepart; - -public class SubscribeMessage { - private String id; - - private String insdt; - - private String insuser; - - private String sendMan; - - private String sendManId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSendMan() { - return sendMan; - } - - public void setSendMan(String sendMan) { - this.sendMan = sendMan; - } - - public String getSendManId() { - return sendManId; - } - - public void setSendManId(String sendManId) { - this.sendManId = sendManId; - } -} diff --git a/src/com/sipai/entity/sparepart/Supplier.java b/src/com/sipai/entity/sparepart/Supplier.java deleted file mode 100644 index e0ba5d3f..00000000 --- a/src/com/sipai/entity/sparepart/Supplier.java +++ /dev/null @@ -1,260 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Supplier extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String address; - - private String linkMan; - - private String telephone; - - private String fax; - - private String mobile; - - private String existStatus; - - private String classId; - - private String mainBusiness; - - private String website; - - private String evaluate; - - private String remark; - - private String typeStatus; - - private String type; - - private String abbreviation; - - private String legalPerson; - - private String bankInformation; - - private SupplierClass supplierClass; - - private String userTelephone; - - private String userName; - - private String taxNumber; - - private String bankNumber; - - - - public String getUserTelephone() { - return userTelephone; - } - - public void setUserTelephone(String userTelephone) { - this.userTelephone = userTelephone; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getTaxNumber() { - return taxNumber; - } - - public void setTaxNumber(String taxNumber) { - this.taxNumber = taxNumber; - } - - public String getBankNumber() { - return bankNumber; - } - - public void setBankNumber(String bankNumber) { - this.bankNumber = bankNumber; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getLinkMan() { - return linkMan; - } - - public void setLinkMan(String linkMan) { - this.linkMan = linkMan; - } - - public String getTelephone() { - return telephone; - } - - public void setTelephone(String telephone) { - this.telephone = telephone; - } - - public String getFax() { - return fax; - } - - public void setFax(String fax) { - this.fax = fax; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getExistStatus() { - return existStatus; - } - - public void setExistStatus(String existStatus) { - this.existStatus = existStatus; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getMainBusiness() { - return mainBusiness; - } - - public void setMainBusiness(String mainBusiness) { - this.mainBusiness = mainBusiness; - } - - public String getWebsite() { - return website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public String getEvaluate() { - return evaluate; - } - - public void setEvaluate(String evaluate) { - this.evaluate = evaluate; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getTypeStatus() { - return typeStatus; - } - - public void setTypeStatus(String typeStatus) { - this.typeStatus = typeStatus; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getAbbreviation() { - return abbreviation; - } - - public void setAbbreviation(String abbreviation) { - this.abbreviation = abbreviation; - } - - public String getLegalPerson() { - return legalPerson; - } - - public void setLegalPerson(String legalPerson) { - this.legalPerson = legalPerson; - } - - public String getBankInformation() { - return bankInformation; - } - - public void setBankInformation(String bankInformation) { - this.bankInformation = bankInformation; - } - - - public SupplierClass getSupplierClass() { - return supplierClass; - } - - public void setSupplierClass(SupplierClass supplierClass) { - this.supplierClass = supplierClass; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SupplierClass.java b/src/com/sipai/entity/sparepart/SupplierClass.java deleted file mode 100644 index 99767955..00000000 --- a/src/com/sipai/entity/sparepart/SupplierClass.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class SupplierClass extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Boolean active; - - private String pid; - - private String describe; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SupplierClass_copy.java b/src/com/sipai/entity/sparepart/SupplierClass_copy.java deleted file mode 100644 index 90a70e87..00000000 --- a/src/com/sipai/entity/sparepart/SupplierClass_copy.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class SupplierClass_copy extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Boolean active; - - private String pid; - - private String describe; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SupplierQualification.java b/src/com/sipai/entity/sparepart/SupplierQualification.java deleted file mode 100644 index d202020b..00000000 --- a/src/com/sipai/entity/sparepart/SupplierQualification.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.base.SQLAdapter; - -public class SupplierQualification extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String supplierId; - - private String qualificationType; - - - private String qualificationTypeName; - - private String qualificationValidityTime; - - private String qualificationState; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getQualificationType() { - return qualificationType; - } - - public void setQualificationType(String qualificationType) { - this.qualificationType = qualificationType; - } - - public String getQualificationValidityTime() { - return qualificationValidityTime; - } - - public void setQualificationValidityTime(String qualificationValidityTime) { - this.qualificationValidityTime = qualificationValidityTime; - } - - public String getQualificationState() { - return qualificationState; - } - - public void setQualificationState(String qualificationState) { - this.qualificationState = qualificationState; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public String getQualificationTypeName() { - return qualificationTypeName; - } - - public void setQualificationTypeName(String qualificationTypeName) { - this.qualificationTypeName = qualificationTypeName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SupplierQualification_copy.java b/src/com/sipai/entity/sparepart/SupplierQualification_copy.java deleted file mode 100644 index ec2b955a..00000000 --- a/src/com/sipai/entity/sparepart/SupplierQualification_copy.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class SupplierQualification_copy extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String supplierId; - - private String qualificationType; - - - private String qualificationTypeName; - - public String getQualificationTypeName() { - return qualificationTypeName; - } - - public void setQualificationTypeName(String qualificationTypeName) { - this.qualificationTypeName = qualificationTypeName; - } - - private String qualificationValidityTime; - - private String qualificationState; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSupplierId() { - return supplierId; - } - - public void setSupplierId(String supplierId) { - this.supplierId = supplierId; - } - - public String getQualificationType() { - return qualificationType; - } - - public void setQualificationType(String qualificationType) { - this.qualificationType = qualificationType; - } - - public String getQualificationValidityTime() { - return qualificationValidityTime; - } - - public void setQualificationValidityTime(String qualificationValidityTime) { - this.qualificationValidityTime = qualificationValidityTime; - } - - public String getQualificationState() { - return qualificationState; - } - - public void setQualificationState(String qualificationState) { - this.qualificationState = qualificationState; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/SupplierQualification_file.java b/src/com/sipai/entity/sparepart/SupplierQualification_file.java deleted file mode 100644 index b5be7808..00000000 --- a/src/com/sipai/entity/sparepart/SupplierQualification_file.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.sparepart; - -import com.sipai.entity.base.SQLAdapter; - -public class SupplierQualification_file extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String masterid; - - private String filename; - - private String abspath; - - private String filepath; - - private String type; - - private String size; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Supplier_copy.java b/src/com/sipai/entity/sparepart/Supplier_copy.java deleted file mode 100644 index 050e3190..00000000 --- a/src/com/sipai/entity/sparepart/Supplier_copy.java +++ /dev/null @@ -1,251 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Supplier_copy extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String address; - - private String linkMan; - - private String telephone; - - private String fax; - - private String mobile; - - private String existStatus; - - private String classId; - - private String mainBusiness; - - private String website; - - private String evaluate; - - private String remark; - - private String type; - - private String abbreviation; - - private String legalPerson; - - private String bankInformation; - - private SupplierClass_copy supplierClass_copy; - - private String userTelephone; - - private String userName; - - private String taxNumber; - - private String bankNumber; - - - - public String getTaxNumber() { - return taxNumber; - } - - public void setTaxNumber(String taxNumber) { - this.taxNumber = taxNumber; - } - - public String getBankNumber() { - return bankNumber; - } - - public void setBankNumber(String bankNumber) { - this.bankNumber = bankNumber; - } - - public String getUserTelephone() { - return userTelephone; - } - - public void setUserTelephone(String userTelephone) { - this.userTelephone = userTelephone; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public SupplierClass_copy getSupplierClass_copy() { - return supplierClass_copy; - } - - public void setSupplierClass_copy(SupplierClass_copy supplierClass_copy) { - this.supplierClass_copy = supplierClass_copy; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getLinkMan() { - return linkMan; - } - - public void setLinkMan(String linkMan) { - this.linkMan = linkMan; - } - - public String getTelephone() { - return telephone; - } - - public void setTelephone(String telephone) { - this.telephone = telephone; - } - - public String getFax() { - return fax; - } - - public void setFax(String fax) { - this.fax = fax; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getExistStatus() { - return existStatus; - } - - public void setExistStatus(String existStatus) { - this.existStatus = existStatus; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getMainBusiness() { - return mainBusiness; - } - - public void setMainBusiness(String mainBusiness) { - this.mainBusiness = mainBusiness; - } - - public String getWebsite() { - return website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public String getEvaluate() { - return evaluate; - } - - public void setEvaluate(String evaluate) { - this.evaluate = evaluate; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getAbbreviation() { - return abbreviation; - } - - public void setAbbreviation(String abbreviation) { - this.abbreviation = abbreviation; - } - - public String getLegalPerson() { - return legalPerson; - } - - public void setLegalPerson(String legalPerson) { - this.legalPerson = legalPerson; - } - - public String getBankInformation() { - return bankInformation; - } - - public void setBankInformation(String bankInformation) { - this.bankInformation = bankInformation; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/sparepart/Warehouse.java b/src/com/sipai/entity/sparepart/Warehouse.java deleted file mode 100644 index e9d644cc..00000000 --- a/src/com/sipai/entity/sparepart/Warehouse.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class Warehouse extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String department; - - private String bizId; - - private String telephone; - - private String address; - - private Double area; - - private String useDate; - - private String status; - - private String remark; - - private Company company; - - private String warehouseParent; - - private Integer outboundType; - - - public Integer getOutboundType() { - return outboundType; - } - - public void setOutboundType(Integer outboundType) { - this.outboundType = outboundType; - } - - public String getWarehouseParent() { - return warehouseParent; - } - - public void setWarehouseParent(String warehouseParent) { - this.warehouseParent = warehouseParent; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDepartment() { - return department; - } - - public void setDepartment(String department) { - this.department = department; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getTelephone() { - return telephone; - } - - public void setTelephone(String telephone) { - this.telephone = telephone; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public Double getArea() { - return area; - } - - public void setArea(Double area) { - this.area = area; - } - - public String getUseDate() { - return useDate; - } - - public void setUseDate(String useDate) { - this.useDate = useDate; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } -} diff --git a/src/com/sipai/entity/sparepart/WarrantyPeriod.java b/src/com/sipai/entity/sparepart/WarrantyPeriod.java deleted file mode 100644 index a34e1722..00000000 --- a/src/com/sipai/entity/sparepart/WarrantyPeriod.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.sparepart; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class WarrantyPeriod extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private Integer period; - - private Integer morder; - - private Boolean active; - - private String pid; - - private String describe; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getPeriod() { - return period; - } - - public void setPeriod(Integer period) { - this.period = period; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/Structure.java b/src/com/sipai/entity/structure/Structure.java deleted file mode 100644 index 007ce421..00000000 --- a/src/com/sipai/entity/structure/Structure.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.entity.structure; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -public class Structure extends SQLAdapter{ - - private String id; - - private String pid; - - private String name; - - private Integer type; - - private Boolean active; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/StructureCard.java b/src/com/sipai/entity/structure/StructureCard.java deleted file mode 100644 index 8b704d10..00000000 --- a/src/com/sipai/entity/structure/StructureCard.java +++ /dev/null @@ -1,251 +0,0 @@ -package com.sipai.entity.structure; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -public class StructureCard extends SQLAdapter{ - public static String design="'最大设计能力";//'最大设计能力 - public static String adjustable="可调能力";//可调能力 - public static String current="当前能力";//当前能力 - public static String load="当前负荷率";//当前负荷率 - - private String id; - - private String insuser; - - private String insdt; - - private String remark; - - private String pid; - - private String name; - - private Integer morder; - - private Integer type; - - private Double longitude; - - private Double latitude; - - private String classId; - - private Boolean active; - - private String unitId; - - private String sname; - - private String _pname; - - private String designCode; - - private String adjustableCode; - - private String currentCode; - - private String loadCode; - //能力与负荷 - private BigDecimal _design; - private BigDecimal _adjustable; - private BigDecimal _current; - private BigDecimal _load; - - private List equipmentCards; - - public BigDecimal get_design() { - return _design; - } - - public void set_design(BigDecimal _design) { - this._design = _design; - } - - public BigDecimal get_adjustable() { - return _adjustable; - } - - public void set_adjustable(BigDecimal _adjustable) { - this._adjustable = _adjustable; - } - - public BigDecimal get_current() { - return _current; - } - - public void set_current(BigDecimal _current) { - this._current = _current; - } - - public BigDecimal get_load() { - return _load; - } - - public void set_load(BigDecimal _load) { - this._load = _load; - } - - public String getDesignCode() { - return designCode; - } - - public void setDesignCode(String designCode) { - this.designCode = designCode; - } - - public String getAdjustableCode() { - return adjustableCode; - } - - public void setAdjustableCode(String adjustableCode) { - this.adjustableCode = adjustableCode; - } - - public String getCurrentCode() { - return currentCode; - } - - public void setCurrentCode(String currentCode) { - this.currentCode = currentCode; - } - - public String getLoadCode() { - return loadCode; - } - - public void setLoadCode(String loadCode) { - this.loadCode = loadCode; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public Double getLongitude() { - return longitude; - } - - public void setLongitude(Double longitude) { - this.longitude = longitude; - } - - public Double getLatitude() { - return latitude; - } - - public void setLatitude(Double latitude) { - this.latitude = latitude; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public List getEquipmentCards() { - return equipmentCards; - } - - public void setEquipmentCards(List equipmentCards) { - this.equipmentCards = equipmentCards; - } - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/StructureCardPicture.java b/src/com/sipai/entity/structure/StructureCardPicture.java deleted file mode 100644 index e2b430dc..00000000 --- a/src/com/sipai/entity/structure/StructureCardPicture.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.sipai.entity.structure; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class StructureCardPicture extends SQLAdapter{ - private String id; - - private String structureId; - - private String name; - - private String floor; - - private Integer morder; - - private String unitId; - - private String insuser; - - private String insdt; - - private Company company; - - private String type; - - private String safeLevel; - - private String safeContent; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getStructureId() { - return structureId; - } - - public void setStructureId(String structureId) { - this.structureId = structureId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getFloor() { - return floor; - } - - public void setFloor(String floor) { - this.floor = floor; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSafeLevel() { - return safeLevel; - } - - public void setSafeLevel(String safeLevel) { - this.safeLevel = safeLevel; - } - - public String getSafeContent() { - return safeContent; - } - - public void setSafeContent(String safeContent) { - this.safeContent = safeContent; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/StructureCardPictureRoute.java b/src/com/sipai/entity/structure/StructureCardPictureRoute.java deleted file mode 100644 index 474ff616..00000000 --- a/src/com/sipai/entity/structure/StructureCardPictureRoute.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.sipai.entity.structure; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.timeefficiency.PatrolPoint; - -public class StructureCardPictureRoute extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String patrolPlanId; - - private String structureCardId; - - private String structureCardPictureId; - - private String previousId; - - private String nextId; - - private String type; - - private String patrolPointId; - - private BigDecimal posx; - - private BigDecimal posy; - - private BigDecimal containerWidth; - - private BigDecimal containerHeight; - - private Integer morder; - - private StructureCardPicture structureCardPicture; - - private PatrolPoint patrolPoint; - - private String patrolContent; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getStructureCardId() { - return structureCardId; - } - - public void setStructureCardId(String structureCardId) { - this.structureCardId = structureCardId; - } - - public String getStructureCardPictureId() { - return structureCardPictureId; - } - - public void setStructureCardPictureId(String structureCardPictureId) { - this.structureCardPictureId = structureCardPictureId; - } - - public String getPreviousId() { - return previousId; - } - - public void setPreviousId(String previousId) { - this.previousId = previousId; - } - - public String getNextId() { - return nextId; - } - - public void setNextId(String nextId) { - this.nextId = nextId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public BigDecimal getPosx() { - return posx; - } - - public void setPosx(BigDecimal posx) { - this.posx = posx; - } - - public BigDecimal getPosy() { - return posy; - } - - public void setPosy(BigDecimal posy) { - this.posy = posy; - } - - public BigDecimal getContainerWidth() { - return containerWidth; - } - - public void setContainerWidth(BigDecimal containerWidth) { - this.containerWidth = containerWidth; - } - - public BigDecimal getContainerHeight() { - return containerHeight; - } - - public void setContainerHeight(BigDecimal containerHeight) { - this.containerHeight = containerHeight; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public StructureCardPicture getStructureCardPicture() { - return structureCardPicture; - } - - public void setStructureCardPicture(StructureCardPicture structureCardPicture) { - this.structureCardPicture = structureCardPicture; - } - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public String getPatrolContent() { - return patrolContent; - } - - public void setPatrolContent(String patrolContent) { - this.patrolContent = patrolContent; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/StructureCardPictureRoutePointdetail.java b/src/com/sipai/entity/structure/StructureCardPictureRoutePointdetail.java deleted file mode 100644 index 9bb4a961..00000000 --- a/src/com/sipai/entity/structure/StructureCardPictureRoutePointdetail.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.structure; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class StructureCardPictureRoutePointdetail extends SQLAdapter{ - private String id; - - private String pid; - - private String contents; - - private String requirement; - - private Integer num; - - private Integer ord; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getRequirement() { - return requirement; - } - - public void setRequirement(String requirement) { - this.requirement = requirement; - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/StructureCardType.java b/src/com/sipai/entity/structure/StructureCardType.java deleted file mode 100644 index 0842d4a6..00000000 --- a/src/com/sipai/entity/structure/StructureCardType.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.sipai.entity.structure; - -/** - * 构筑物: - */ -public enum StructureCardType { - StructureCard("0","构筑物"), SingleProcess( "1","工艺单体"); - private String id; - private String name; - - private StructureCardType(String id,String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (StructureCardType item :StructureCardType.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllType4JSON() { - String json = ""; - for (StructureCardType item :StructureCardType.values()) { - if(json.equals("")){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/structure/StructureClass.java b/src/com/sipai/entity/structure/StructureClass.java deleted file mode 100644 index 380d6316..00000000 --- a/src/com/sipai/entity/structure/StructureClass.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.entity.structure; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -//设备类型 -public class StructureClass extends SQLAdapter { - private String id; - - private String name; - - private String insdt; - - private String insuser; - - private String remark; - - private String active; - - private String pid; - - private String bizid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/structure/StructureCommStr.java b/src/com/sipai/entity/structure/StructureCommStr.java deleted file mode 100644 index ff18b00f..00000000 --- a/src/com/sipai/entity/structure/StructureCommStr.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.structure; - -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -public class StructureCommStr { - public static final String iconLevel0 = "fa fa-industry";//构筑物 - public static final String iconLevel1 = "fa fa-cogs";//工艺单体 - public static final String iconLevel2 = "fa fa-television";//设备小类 - -} \ No newline at end of file diff --git a/src/com/sipai/entity/teacher/TeacherFile.java b/src/com/sipai/entity/teacher/TeacherFile.java deleted file mode 100644 index 97ad3c97..00000000 --- a/src/com/sipai/entity/teacher/TeacherFile.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.teacher; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class TeacherFile extends SQLAdapter { - private String id; - - private String masterid; - - private String filename; - - private String abspath; - - private Double size; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String type; - - private Integer ord; - - private String urlpath; - - private String memo; - - private String filefolder; - - private String _filenature; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath; - } - - public Double getSize() { - return size; - } - - public void setSize(Double size) { - this.size = size; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getOrd() { - return ord; - } - - public void setOrd(Integer ord) { - this.ord = ord; - } - - public String getUrlpath() { - return urlpath; - } - - public void setUrlpath(String urlpath) { - this.urlpath = urlpath; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getFilefolder() { - return filefolder; - } - - public void setFilefolder(String filefolder) { - this.filefolder = filefolder; - } - - public String get_filenature() { - return _filenature; - } - - public void set_filenature(String _filenature) { - this._filenature = _filenature; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/teacher/Teachertype.java b/src/com/sipai/entity/teacher/Teachertype.java deleted file mode 100644 index d61c87e7..00000000 --- a/src/com/sipai/entity/teacher/Teachertype.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.sipai.entity.teacher; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class Teachertype extends SQLAdapter { - private String id; - - private String name; - - private String pid; - - private String state; - - private int ord; - - private String memo; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String _pname; - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public int getOrd() { - return ord; - } - - public void setOrd(int ord) { - this.ord = ord; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/third/Common.java b/src/com/sipai/entity/third/Common.java deleted file mode 100644 index 93741db2..00000000 --- a/src/com/sipai/entity/third/Common.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.entity.third; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -public class Common { - - - -} diff --git a/src/com/sipai/entity/third/CommonDataConvertor.java b/src/com/sipai/entity/third/CommonDataConvertor.java deleted file mode 100644 index c44b50f8..00000000 --- a/src/com/sipai/entity/third/CommonDataConvertor.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sipai.entity.third; - -import lombok.Data; - -@Data -public class CommonDataConvertor { - - private String notifyType; - - private Service service; - - private String deviceId; - - private String gatewayId; -} diff --git a/src/com/sipai/entity/third/Data.java b/src/com/sipai/entity/third/Data.java deleted file mode 100644 index 155c292a..00000000 --- a/src/com/sipai/entity/third/Data.java +++ /dev/null @@ -1,9 +0,0 @@ - -package com.sipai.entity.third; - -@lombok.Data -public class Data { - - private ServiceDatas serviceDatas; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/third/Service.java b/src/com/sipai/entity/third/Service.java deleted file mode 100644 index 0284f512..00000000 --- a/src/com/sipai/entity/third/Service.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.entity.third; - -/** - * - */ -@lombok.Data -public class Service { - - private String serviceType; - - private Data data; - - private String eventTime; - - private String serviceId; - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/third/ServiceDatas.java b/src/com/sipai/entity/third/ServiceDatas.java deleted file mode 100644 index ed8ac514..00000000 --- a/src/com/sipai/entity/third/ServiceDatas.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.entity.third; - -import lombok.Data; - -/** - * - */ -@Data -public class ServiceDatas { - - private String data8; - - private String data6; - - private String data4; - - private String eventTime; - - private String data10; - - private String data12; - - private String imsi; - - private String data14; - - private String data16; -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/ClockinCollection.java b/src/com/sipai/entity/timeefficiency/ClockinCollection.java deleted file mode 100644 index c1518c48..00000000 --- a/src/com/sipai/entity/timeefficiency/ClockinCollection.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.entity.timeefficiency; - -//巡检记录汇总 -public class ClockinCollection{ - private String imgPath;//水厂图片路径 - - private Integer userTotalNum;//总人数 - - private Integer clockinNum;//已打卡数 - - private Integer unClockinNum;//未打卡数 - - - public String getImgPath() { - return imgPath; - } - - public void setImgPath(String imgPath) { - this.imgPath = imgPath; - } - - public Integer getUserTotalNum() { - return userTotalNum; - } - - public void setUserTotalNum(Integer userTotalNum) { - this.userTotalNum = userTotalNum; - } - - public Integer getClockinNum() { - return clockinNum; - } - - public void setClockinNum(Integer clockinNum) { - this.clockinNum = clockinNum; - } - - public Integer getUnClockinNum() { - return unClockinNum; - } - - public void setUnClockinNum(Integer unClockinNum) { - this.unClockinNum = unClockinNum; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/ClockinRecord.java b/src/com/sipai/entity/timeefficiency/ClockinRecord.java deleted file mode 100644 index 097c0fcb..00000000 --- a/src/com/sipai/entity/timeefficiency/ClockinRecord.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 工时 - * - */ -public class ClockinRecord extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private Integer isOnTime; - - private String status; - - private String recordType; - - private String bizId; - - private String location; - - private String username; - - private String companyName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt( String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getIsOnTime() { - return isOnTime; - } - - public void setIsOnTime(Integer isOnTime) { - this.isOnTime = isOnTime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRecordType() { - return recordType; - } - - public void setRecordType(String recordType) { - this.recordType = recordType; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/EfficiencyProcess.java b/src/com/sipai/entity/timeefficiency/EfficiencyProcess.java deleted file mode 100644 index 0cbb382c..00000000 --- a/src/com/sipai/entity/timeefficiency/EfficiencyProcess.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class EfficiencyProcess extends SQLAdapter{ - private String id; - - private Date insdt; - - private String insuser; - - private String code; - - private String name; - - private String status; - - private String remark; - - private Integer morder; - - private String bizid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/ElectricityPrice.java b/src/com/sipai/entity/timeefficiency/ElectricityPrice.java deleted file mode 100644 index e8dc745f..00000000 --- a/src/com/sipai/entity/timeefficiency/ElectricityPrice.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; - -public class ElectricityPrice extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String bizid; - - private String company; - - private String diantype; - - private String voltagelevel; - - private Double dianduprice; - - private Double peakprice; - - private Double heightprice; - - private Double sectionprice; - - private Double troughprice; - - private Double basicprice; - - private Double transformerjfcapacity; - - private Double transformernumber; - - private Double transformerallcapacity; - - private Double basictariff; - - private String adjustmentcontent; - - private String remark; - - private String purpose; - - private String stopTime; - - private Company companys; - - - - public Company getCompanys() { - return companys; - } - - public void setCompanys(Company companys) { - this.companys = companys; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String string) { - this.insdt = string; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getCompany() { - return company; - } - - public void setCompany(String company) { - this.company = company; - } - - public String getDiantype() { - return diantype; - } - - public void setDiantype(String diantype) { - this.diantype = diantype; - } - - public String getVoltagelevel() { - return voltagelevel; - } - - public void setVoltagelevel(String voltagelevel) { - this.voltagelevel = voltagelevel; - } - - public Double getDianduprice() { - return dianduprice; - } - - public void setDianduprice(Double dianduprice) { - this.dianduprice = dianduprice; - } - - public Double getPeakprice() { - return peakprice; - } - - public void setPeakprice(Double peakprice) { - this.peakprice = peakprice; - } - - public Double getHeightprice() { - return heightprice; - } - - public void setHeightprice(Double heightprice) { - this.heightprice = heightprice; - } - - public Double getSectionprice() { - return sectionprice; - } - - public void setSectionprice(Double sectionprice) { - this.sectionprice = sectionprice; - } - - public Double getTroughprice() { - return troughprice; - } - - public void setTroughprice(Double troughprice) { - this.troughprice = troughprice; - } - - public Double getBasicprice() { - return basicprice; - } - - public void setBasicprice(Double basicprice) { - this.basicprice = basicprice; - } - - public Double getTransformerjfcapacity() { - return transformerjfcapacity; - } - - public void setTransformerjfcapacity(Double transformerjfcapacity) { - this.transformerjfcapacity = transformerjfcapacity; - } - - public Double getTransformernumber() { - return transformernumber; - } - - public void setTransformernumber(Double transformernumber) { - this.transformernumber = transformernumber; - } - - public Double getTransformerallcapacity() { - return transformerallcapacity; - } - - public void setTransformerallcapacity(Double transformerallcapacity) { - this.transformerallcapacity = transformerallcapacity; - } - - public Double getBasictariff() { - return basictariff; - } - - public void setBasictariff(Double basictariff) { - this.basictariff = basictariff; - } - - public String getAdjustmentcontent() { - return adjustmentcontent; - } - - public void setAdjustmentcontent(String adjustmentcontent) { - this.adjustmentcontent = adjustmentcontent; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getStopTime() { - return stopTime; - } - - public void setStopTime(String stopTime) { - this.stopTime = stopTime; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/ElectricityPriceDetail.java b/src/com/sipai/entity/timeefficiency/ElectricityPriceDetail.java deleted file mode 100644 index eecf268c..00000000 --- a/src/com/sipai/entity/timeefficiency/ElectricityPriceDetail.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ElectricityPriceDetail extends SQLAdapter{ - private String id; - - private Date insdt; - - private String insuser; - - private String bizid; - - private String company; - - private String diantype; - - private String voltagelevel; - - private String adjustmentcontent; - - private String remark; - - private String startTime; - - private String endTime; - - private String pid; - - private Double dianduprice; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getCompany() { - return company; - } - - public void setCompany(String company) { - this.company = company; - } - - public String getDiantype() { - return diantype; - } - - public void setDiantype(String diantype) { - this.diantype = diantype; - } - - public String getVoltagelevel() { - return voltagelevel; - } - - public void setVoltagelevel(String voltagelevel) { - this.voltagelevel = voltagelevel; - } - - public String getAdjustmentcontent() { - return adjustmentcontent; - } - - public void setAdjustmentcontent(String adjustmentcontent) { - this.adjustmentcontent = adjustmentcontent; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Double getDianduprice() { - return dianduprice; - } - - public void setDianduprice(Double dianduprice) { - this.dianduprice = dianduprice; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolArea.java b/src/com/sipai/entity/timeefficiency/PatrolArea.java deleted file mode 100644 index 8fd8d2dd..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolArea.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; - -public class PatrolArea extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -2262016301767460311L; - - private String id; - - private String insuser; - - private String insdt; - - private String remark; - - private String name; - - private String bizId; - - private Unit unit;//关联的厂 - - private ProcessSection processSection;//关联的工艺段 - - private String processSectionName;//工艺段名称 - - private List processSections; - - private Company company; - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public List getProcessSections() { - return processSections; - } - - public void setProcessSections(List processSections) { - this.processSections = processSections; - } - - public String getProcessSectionName() { - return processSectionName; - } - - public void setProcessSectionName(String processSectionName) { - this.processSectionName = processSectionName; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolAreaFloor.java b/src/com/sipai/entity/timeefficiency/PatrolAreaFloor.java deleted file mode 100644 index 01b0d0ef..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolAreaFloor.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; - -public class PatrolAreaFloor extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -5356603703701694048L; - - private String id; - - private String patrolAreaId; - - private String insdt; - - private String insuser; - - private String name; - - private Integer floor; - - private Integer morder; - - private String unitId; - - private Unit unit; - - private byte[] pic; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPatrolAreaId() { - return patrolAreaId; - } - - public void setPatrolAreaId(String patrolAreaId) { - this.patrolAreaId = patrolAreaId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getFloor() { - return floor; - } - - public void setFloor(Integer floor) { - this.floor = floor; - } - - public byte[] getPic() { - return pic; - } - - public void setPic(byte[] pic) { - this.pic = pic; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolAreaProcessSection.java b/src/com/sipai/entity/timeefficiency/PatrolAreaProcessSection.java deleted file mode 100644 index e5521280..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolAreaProcessSection.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -public class PatrolAreaProcessSection extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 3126715074602642145L; - - private String id; - - private String insuser; - - private String insdt; - - private String processSectionId; - - private String patrolAreaId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getPatrolAreaId() { - return patrolAreaId; - } - - public void setPatrolAreaId(String patrolAreaId) { - this.patrolAreaId = patrolAreaId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolAreaUser.java b/src/com/sipai/entity/timeefficiency/PatrolAreaUser.java deleted file mode 100644 index df9aeeef..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolAreaUser.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -/** - * 巡检区域下关联人员 - */ -public class PatrolAreaUser extends SQLAdapter { - private String id; - - private String insuser; - - private String insdt; - - private String patrolAreaId; - - private Integer morder; - - private String userId;//关联人员id - - private User user; - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getPatrolAreaId() { - return patrolAreaId; - } - - public void setPatrolAreaId(String patrolAreaId) { - this.patrolAreaId = patrolAreaId == null ? null : patrolAreaId.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolContents.java b/src/com/sipai/entity/timeefficiency/PatrolContents.java deleted file mode 100644 index 79a55750..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolContents.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import com.sipai.entity.base.SQLAdapter; -/** - * 巡检内容--配置 - * @author SJ - * - */ -public class PatrolContents extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -2568318465346778203L; - - private String id; - - private String code;//巡检代号 - - private String contents;//巡检内容 - - private String contentsDetail;//巡检内容详情 - - private String pid;//关联 巡检点Id 或 设备Id等 - - private String memo; - - private Integer rank; - - private String insuser; - - private String insdt; - - private String bizId; - - private String unitId; - - private String relationType;//关联类型 设备/巡检点 等 - - private String patrolContentsType;//巡检内容类型 运行/设备/集控 巡检等 - - private String patrolRank;//巡检等级 如 :一级巡检/二级巡检/三级巡检 - - private String tool;//所需工具 - - private String method;//巡检方法 - - private String safeNote;//安全注意事项 - - private Integer morder; - - private String text;//用于树形 - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getTool() { - return tool; - } - - public void setTool(String tool) { - this.tool = tool; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getSafeNote() { - return safeNote; - } - - public void setSafeNote(String safeNote) { - this.safeNote = safeNote; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getContentsDetail() { - return contentsDetail; - } - - public void setContentsDetail(String contentsDetail) { - this.contentsDetail = contentsDetail; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public Integer getRank() { - return rank; - } - - public void setRank(Integer rank) { - this.rank = rank; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getRelationType() { - return relationType; - } - - public void setRelationType(String relationType) { - this.relationType = relationType; - } - - public String getPatrolContentsType() { - return patrolContentsType; - } - - public void setPatrolContentsType(String patrolContentsType) { - this.patrolContentsType = patrolContentsType; - } - - public String getPatrolRank() { - return patrolRank; - } - - public void setPatrolRank(String patrolRank) { - this.patrolRank = patrolRank; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolContentsPlan.java b/src/com/sipai/entity/timeefficiency/PatrolContentsPlan.java deleted file mode 100644 index 7bce5f8e..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolContentsPlan.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -/** - * 巡检内容--计划 2020-05-22 - * @author SJ - * - */ -public class PatrolContentsPlan extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 7755451780245110493L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolPlanId;//巡检计划id - - private String patrolContentsId;//巡检内容配置id - - private String patrolPointId;//巡检点id - - private String equipmentId;//关联设备id - - private String planPointId;//巡检计划下关联的巡检点Id(巡检路线id) 暂时没用到 - - private String type;//区分是关联设备的还是关联巡检点 - - private String contents; - - private String contentsDetail; - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getContentsDetail() { - return contentsDetail; - } - - public void setContentsDetail(String contentsDetail) { - this.contentsDetail = contentsDetail; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getPatrolContentsId() { - return patrolContentsId; - } - - public void setPatrolContentsId(String patrolContentsId) { - this.patrolContentsId = patrolContentsId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getPlanPointId() { - return planPointId; - } - - public void setPlanPointId(String planPointId) { - this.planPointId = planPointId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolContentsRecord.java b/src/com/sipai/entity/timeefficiency/PatrolContentsRecord.java deleted file mode 100644 index 0437b4fe..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolContentsRecord.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; -/** - * 巡检内容--记录 2020-05-22 - * @author SJ - * - */ -public class PatrolContentsRecord extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -1829954704391272680L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolPointId;//巡检点Id - - private String patrolRecordId;//巡检记录Id - - private String equipmentId;//设备Id - - private String pid; - - private String completeuser; - - private String completedt; - - private String status; - - private String contents; - - private String contentsdetail; - - private String type;//区分是关联设备的还是关联巡检点 - - private User user; - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getCompleteuser() { - return completeuser; - } - - public void setCompleteuser(String completeuser) { - this.completeuser = completeuser; - } - - public String getCompletedt() { - return completedt; - } - - public void setCompletedt(String completedt) { - this.completedt = completedt; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getContentsDetail() { - return contentsdetail; - } - - public void setContentsDetail(String contentsdetail) { - this.contentsdetail = contentsdetail; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolContentsStandard.java b/src/com/sipai/entity/timeefficiency/PatrolContentsStandard.java deleted file mode 100644 index 50b62915..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolContentsStandard.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 巡检内容标准库--目前只用于设备 - * (定义一套库的标准,如集团层可以定义一类设备的巡检内容,厂内可同步内容) - * @author SJ - * - */ -public class PatrolContentsStandard extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 7809730224658310113L; - - private String id; - - private String code;//巡检代号 - - private String name;//巡检名称 - - private String contents;//巡检内容/详情/方法 - - private String pid; - - private String tool;//所需工具 - - private String method;//巡检方法 - - private String safeNote;//安全注意事项 - - private String patrolRank;//巡检等级 如 :一级巡检 二级巡检 三级巡检 - - private String unitId; - - private String memo; - - private Integer morder; - - private String upduser; - - private String upddt; - - private String s_id; - private String s_name; - private String s_code; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getS_id() { - return s_id; - } - - public void setS_id(String s_id) { - this.s_id = s_id; - } - - public String getS_name() { - return s_name; - } - - public void setS_name(String s_name) { - this.s_name = s_name; - } - - public String getS_code() { - return s_code; - } - - public void setS_code(String s_code) { - this.s_code = s_code; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUpduser() { - return upduser; - } - - public void setUpduser(String upduser) { - this.upduser = upduser; - } - - public String getUpddt() { - return upddt; - } - - public void setUpddt(String upddt) { - this.upddt = upddt; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getTool() { - return tool; - } - - public void setTool(String tool) { - this.tool = tool; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getSafeNote() { - return safeNote; - } - - public void setSafeNote(String safeNote) { - this.safeNote = safeNote; - } - - public String getPatrolRank() { - return patrolRank; - } - - public void setPatrolRank(String patrolRank) { - this.patrolRank = patrolRank; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolMeasurePointPlan.java b/src/com/sipai/entity/timeefficiency/PatrolMeasurePointPlan.java deleted file mode 100644 index 56036cf8..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolMeasurePointPlan.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class PatrolMeasurePointPlan extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 4286303261416980503L; - - private String id; - - private String insuser; - - private String insdt; - - private String measurePointId;//测量点id - - private String patrolPlanId;//巡检计划id - - private String patrolPointId;//巡检点id - - private String equipmentId;//关联设备id - - private String pid;//巡检计划下关联的巡检点表id(巡检路线id) - - private MPoint mPoint;//关联测量点 - - //private String reservedfields2; - - //private String reservedfields3; - - private String type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMeasurePointId() { - return measurePointId; - } - - public void setMeasurePointId(String measurePointId) { - this.measurePointId = measurePointId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolMeasurePointRecord.java b/src/com/sipai/entity/timeefficiency/PatrolMeasurePointRecord.java deleted file mode 100644 index f8893622..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolMeasurePointRecord.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -/** - * 巡检记录下每个巡检点内的填报记录 - * @author SJ - * - */ -public class PatrolMeasurePointRecord extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -3383861389834818681L; - - private String id; - - private String insuser; - - private String insdt; - - private String measurePointId;//测量点id - - private String patrolPointId;//巡检点id - - private String patrolRecordId;//巡检记录id - - private String pid;//巡检记录下关联的巡检点表id(巡检计划的巡检路线id) - - private String status;//完成状态 - - private MPoint mPoint;//关联测量点 - - private String equipmentId; - - private String reservedfields3; - - private String mpvalue; - - private String type; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMeasurePointId() { - return measurePointId; - } - - public void setMeasurePointId(String measurePointId) { - this.measurePointId = measurePointId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getReservedfields3() { - return reservedfields3; - } - - public void setReservedfields3(String reservedfields3) { - this.reservedfields3 = reservedfields3; - } - - public String getMpvalue() { - return mpvalue; - } - - public void setMpvalue(String mpvalue) { - this.mpvalue = mpvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolModel.java b/src/com/sipai/entity/timeefficiency/PatrolModel.java deleted file mode 100644 index ea33440d..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolModel.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Unit; - -public class PatrolModel extends SQLAdapter implements Serializable{ - private static final long serialVersionUID = 8192722452777264874L; - private String id; - - private String name; - - private String bizId; - - private String unitId; - - private String type; - - private Boolean defaultFlag; - - private String insdt; - - private String insuser; - - private String active; - - private Unit unit; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Boolean getDefaultFlag() { - return defaultFlag; - } - - public void setDefaultFlag(Boolean defaultFlag) { - this.defaultFlag = defaultFlag; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlan.java b/src/com/sipai/entity/timeefficiency/PatrolPlan.java deleted file mode 100644 index 4fa3668a..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlan.java +++ /dev/null @@ -1,364 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.ProcessSection; - -public class PatrolPlan extends SQLAdapter implements Serializable { - /** - * - */ - private static final long serialVersionUID = -564405044446731345L; - public final static String Last_Day = "99";//设置99的任务为每月最后一天下发 - - private String id; - - private String bizId; - - private String unitId; - - private String patrolAreaId;//关联巡检区域 - - private String groupTypeId;//关联班组Id (如:运行班,维修班) - - private String name; - - private String patrolContent; - - private String insdt; - - private String insuser; - - private String sdt; - - private String edt; - - private Integer duration; - - private Integer timeInterval; - - private Integer morder; - - private Boolean active; - - private String type; - - private String patrolModelId; - - private String color; - - private String releaseModal; - - private String taskType;//任务类型(目前暂时仅用户安全内容) - private Integer advanceDay;//提前下发天数 - private String isHoliday;//去除节假日 (0为不去除 1为去除) - private String isPictures;//是否必须上传图片(0为非必须 1为必须) - private String activeDate;//启用日期 - - private Integer weekInterval;//周间隔 - private Integer monthInterval;//月间隔 - private Integer yearInterval;//年间隔 - private String weekRegister;//周下发寄存器 - private String monthRegister;//月下发寄存器 - private String yearRegister;//年下发寄存器 - - private String lastIssuanceDate;//最近下发日期 - private String planIssuanceDate;//计划下发日期 - - public String getActiveDate() { - return activeDate; - } - - public void setActiveDate(String activeDate) { - this.activeDate = activeDate; - } - - private PatrolPlanType patrolPlanType; - - public PatrolPlanType getPatrolPlanType() { - return patrolPlanType; - } - - public void setPatrolPlanType(PatrolPlanType patrolPlanType) { - this.patrolPlanType = patrolPlanType; - } - - public String getLastIssuanceDate() { - return lastIssuanceDate; - } - - public void setLastIssuanceDate(String lastIssuanceDate) { - this.lastIssuanceDate = lastIssuanceDate; - } - - public String getPlanIssuanceDate() { - return planIssuanceDate; - } - - public void setPlanIssuanceDate(String planIssuanceDate) { - this.planIssuanceDate = planIssuanceDate; - } - - public String getTaskType() { - return taskType; - } - - public void setTaskType(String taskType) { - this.taskType = taskType; - } - - public Integer getAdvanceDay() { - return advanceDay; - } - - public void setAdvanceDay(Integer advanceDay) { - this.advanceDay = advanceDay; - } - - public String getIsHoliday() { - return isHoliday; - } - - public void setIsHoliday(String isHoliday) { - this.isHoliday = isHoliday; - } - - public String getIsPictures() { - return isPictures; - } - - public void setIsPictures(String isPictures) { - this.isPictures = isPictures; - } - - private PatrolArea patrolArea; - private List processSections; - private List depts; - - public List getDepts() { - return depts; - } - - public void setDepts(List depts) { - this.depts = depts; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getPatrolAreaId() { - return patrolAreaId; - } - - public void setPatrolAreaId(String patrolAreaId) { - this.patrolAreaId = patrolAreaId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPatrolContent() { - return patrolContent; - } - - public void setPatrolContent(String patrolContent) { - this.patrolContent = patrolContent; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public Integer getDuration() { - return duration; - } - - public void setDuration(Integer duration) { - this.duration = duration; - } - - public Integer getTimeInterval() { - return timeInterval; - } - - public void setTimeInterval(Integer timeInterval) { - this.timeInterval = timeInterval; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPatrolModelId() { - return patrolModelId; - } - - public void setPatrolModelId(String patrolModelId) { - this.patrolModelId = patrolModelId; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public String getReleaseModal() { - return releaseModal; - } - - public void setReleaseModal(String releaseModal) { - this.releaseModal = releaseModal; - } - - public String getWeekRegister() { - return weekRegister; - } - - public void setWeekRegister(String weekRegister) { - this.weekRegister = weekRegister; - } - - public Integer getWeekInterval() { - return weekInterval; - } - - public void setWeekInterval(Integer weekInterval) { - this.weekInterval = weekInterval; - } - - public String getMonthRegister() { - return monthRegister; - } - - public void setMonthRegister(String monthRegister) { - this.monthRegister = monthRegister; - } - - public PatrolArea getPatrolArea() { - return patrolArea; - } - - public void setPatrolArea(PatrolArea patrolArea) { - this.patrolArea = patrolArea; - } - - public List getProcessSections() { - return processSections; - } - - public void setProcessSections(List processSections) { - this.processSections = processSections; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getGroupTypeId() { - return groupTypeId; - } - - public void setGroupTypeId(String groupTypeId) { - this.groupTypeId = groupTypeId; - } - - public Integer getMonthInterval() { - return monthInterval; - } - - public void setMonthInterval(Integer monthInterval) { - this.monthInterval = monthInterval; - } - - public Integer getYearInterval() { - return yearInterval; - } - - public void setYearInterval(Integer yearInterval) { - this.yearInterval = yearInterval; - } - - public String getYearRegister() { - return yearRegister; - } - - public void setYearRegister(String yearRegister) { - this.yearRegister = yearRegister; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanCollection.java b/src/com/sipai/entity/timeefficiency/PatrolPlanCollection.java deleted file mode 100644 index 042f4441..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanCollection.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -//巡检记录汇总 -public class PatrolPlanCollection implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 7748605786574157829L; - - private String imgPath;//水厂图片路径 - - private Integer totalPatrolRecordNum;//巡检记录总数 - - private Integer commPatrolRecordNum;//常规记录总数 - - private Integer tempPatrolRecordNum;//临时记录总数 - - private Integer issuedPatrolRecordNum;//未巡检记录总数 - - private Integer finishedPatrolRecordNum;//未完成记录总数 - - private Double finishedPatrolRecordRate;//完成率 - - public String getImgPath() { - return imgPath; - } - - public void setImgPath(String imgPath) { - this.imgPath = imgPath; - } - - public Integer getTotalPatrolRecordNum() { - return totalPatrolRecordNum; - } - - public void setTotalPatrolRecordNum(Integer totalPatrolRecordNum) { - this.totalPatrolRecordNum = totalPatrolRecordNum; - } - - public Integer getCommPatrolRecordNum() { - return commPatrolRecordNum; - } - - public void setCommPatrolRecordNum(Integer commPatrolRecordNum) { - this.commPatrolRecordNum = commPatrolRecordNum; - } - - public Integer getTempPatrolRecordNum() { - return tempPatrolRecordNum; - } - - public void setTempPatrolRecordNum(Integer tempPatrolRecordNum) { - this.tempPatrolRecordNum = tempPatrolRecordNum; - } - - public Integer getIssuedPatrolRecordNum() { - return issuedPatrolRecordNum; - } - - public void setIssuedPatrolRecordNum(Integer issuedPatrolRecordNum) { - this.issuedPatrolRecordNum = issuedPatrolRecordNum; - } - - public Integer getFinishedPatrolRecordNum() { - return finishedPatrolRecordNum; - } - - public void setFinishedPatrolRecordNum(Integer finishedPatrolRecordNum) { - this.finishedPatrolRecordNum = finishedPatrolRecordNum; - } - - public Double getFinishedPatrolRecordRate() { - return finishedPatrolRecordRate; - } - - public void setFinishedPatrolRecordRate(Double finishedPatrolRecordRate) { - this.finishedPatrolRecordRate = finishedPatrolRecordRate; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanDept.java b/src/com/sipai/entity/timeefficiency/PatrolPlanDept.java deleted file mode 100644 index 74bec202..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanDept.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.entity.timeefficiency; - - -import java.io.Serializable; -import com.sipai.entity.base.SQLAdapter; - -/** - * 巡检计划关联任务班组 - */ -public class PatrolPlanDept extends SQLAdapter implements Serializable{ - - private static final long serialVersionUID = 2711616231712560243L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolPlanId; - - private String deptId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolCamera.java b/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolCamera.java deleted file mode 100644 index 6cc46c6b..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolCamera.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.Camera; - -public class PatrolPlanPatrolCamera extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String patrolPlanId; - - private String patrolpointid; - - private String cameraid; - - private Integer morder; - - private String type; - - private Camera camera; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getPatrolpointid() { - return patrolpointid; - } - - public void setPatrolpointid(String patrolpointid) { - this.patrolpointid = patrolpointid; - } - - public String getCameraid() { - return cameraid; - } - - public void setCameraid(String cameraid) { - this.cameraid = cameraid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolEquipment.java b/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolEquipment.java deleted file mode 100644 index a4873753..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolEquipment.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -/** - * 巡检设备--计划 - * - */ -public class PatrolPlanPatrolEquipment extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -8901150177160151147L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolPlanId;//巡检计划Id - - private String patrolPointId;//巡检点Id - - private String equipmentId;//设备Id - - private int morder; - - private String type;//区分是关联设备的还是关联巡检点 - - private EquipmentCard equipmentCard; - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolPoint.java b/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolPoint.java deleted file mode 100644 index 46551358..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanPatrolPoint.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PatrolPlanPatrolPoint extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 5144828309989633161L; - - private String id; - - private String insdt; - - private String insuser; - - private String planId; - - private String patrolPointId; - - private Integer morder; - - private PatrolPoint patrolPoint; - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanRiskLevel.java b/src/com/sipai/entity/timeefficiency/PatrolPlanRiskLevel.java deleted file mode 100644 index 0372231d..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanRiskLevel.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.hqconfig.RiskLevel; - -import java.io.Serializable; - -public class PatrolPlanRiskLevel extends SQLAdapter implements Serializable{ - - private static final long serialVersionUID = 5144828309989663111L; - - private String id; - - private String insdt; - - private String insuser; - - private String planId; - - private String riskLevelId; - - private Integer morder; - -/**************************************************************/ - // 为了 新建/编辑 安全任务计划的时候,选择完关联的 风险等级评估项,展示riskLevel的其他信息用的 - private RiskLevel riskLevel; - - public RiskLevel getRiskLevel() { - return riskLevel; - } - - public void setRiskLevel(RiskLevel riskLevel) { - this.riskLevel = riskLevel; - } -/**************************************************************/ - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getRiskLevelId() { - return riskLevelId; - } - - public void setRiskLevelId(String riskLevelId) { - this.riskLevelId = riskLevelId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPlanType.java b/src/com/sipai/entity/timeefficiency/PatrolPlanType.java deleted file mode 100644 index cde78462..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPlanType.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.SQLAdapter; - -import java.io.Serializable; -import java.util.List; - -public class PatrolPlanType extends SQLAdapter implements Serializable { - - public final static String Register_Type_Year = "0";//年 - public final static String Register_Type_Month = "1";//月 - public final static String Register_Type_Week = "2";//周 - public final static String Register_Type_Day = "3";//天 - - private String id; - - private String insuser; - - private String insdt; - - private String remark; - - private String name; - - private String bizId; - - private String active; - - private String morder; - - /** - * 任务提前下发单位 - * 数据库中 - * 年=0 - * 月=1 - * 周=2 - * 天=3 - */ - private String register; - - private String unitId; - - private String pid; - - private String patrolTypeContent; - - private List files; - - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getMorder() { - return morder; - } - - public void setMorder(String morder) { - this.morder = morder; - } - - public String getRegister() { - return register; - } - - public void setRegister(String register) { - this.register = register; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getPatrolTypeContent() { - return patrolTypeContent; - } - - public void setPatrolTypeContent(String patrolTypeContent) { - this.patrolTypeContent = patrolTypeContent; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPoint.java b/src/com/sipai/entity/timeefficiency/PatrolPoint.java deleted file mode 100644 index 3e28e7ab..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPoint.java +++ /dev/null @@ -1,316 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.List; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.entity.work.AreaManage; -import com.sipai.entity.work.ModbusFig; - -public class PatrolPoint extends SQLAdapter implements Serializable { - /** - * - */ - private static final long serialVersionUID = 69553621185779183L; - - private String id; - - private String insuser; - - private String insdt; - - private String remark; - - private String name; - - private String bizId; - - private String unitId; - - private String processSectionId; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private String active; - - private String morder; - - private String modbusFigId; - - private String readOrWrite; - - private String register; - - private String type; - - private String floorId; - - private String pointCode;//区域点:0 安全用具:1 消防器具:2 - - private String patrolContent; - - private Integer personNum; - - private Unit unit;//关联的厂 - - private ProcessSection processSection;//关联的工艺段 - - private ModbusFig modbusFig;//关联的modbus - - private String status;//巡检中状态 - - private String areaId;//区域Id - private AreaManage areaManage1;//一级区域 - private AreaManage areaManage2;//二级区域 - private List files; - - //巡检内容联合查询as字段 - private String equipmentId; - private String equipmentName; - - public AreaManage getAreaManage1() { - return areaManage1; - } - - public void setAreaManage1(AreaManage areaManage1) { - this.areaManage1 = areaManage1; - } - - public AreaManage getAreaManage2() { - return areaManage2; - } - - public void setAreaManage2(AreaManage areaManage2) { - this.areaManage2 = areaManage2; - } - - public String getAreaId() { - return areaId; - } - - public void setAreaId(String areaId) { - this.areaId = areaId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public ModbusFig getModbusFig() { - return modbusFig; - } - - public void setModbusFig(ModbusFig modbusFig) { - this.modbusFig = modbusFig; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getMorder() { - return morder; - } - - public void setMorder(String morder) { - this.morder = morder; - } - - public String getRegister() { - return register; - } - - public void setRegister(String register) { - this.register = register; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getModbusFigId() { - return modbusFigId; - } - - public void setModbusFigId(String modbusFigId) { - this.modbusFigId = modbusFigId; - } - - public String getReadOrWrite() { - return readOrWrite; - } - - public void setReadOrWrite(String readOrWrite) { - this.readOrWrite = readOrWrite; - } - - public String getPatrolContent() { - return patrolContent; - } - - public void setPatrolContent(String patrolContent) { - this.patrolContent = patrolContent; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getPersonNum() { - return personNum; - } - - public void setPersonNum(Integer personNum) { - this.personNum = personNum; - } - - public String getFloorId() { - return floorId; - } - - public void setFloorId(String floorId) { - this.floorId = floorId; - } - - public String getPointCode() { - return pointCode; - } - - public void setPointCode(String pointCode) { - this.pointCode = pointCode; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPointCamera.java b/src/com/sipai/entity/timeefficiency/PatrolPointCamera.java deleted file mode 100644 index 01f896c2..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPointCamera.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.Camera; - -public class PatrolPointCamera extends SQLAdapter implements Serializable{ - - /** - * - */ - private static final long serialVersionUID = -6177140517870566041L; - - private String id; - - private String insuser; - - private Date insdt; - - private String cameraId; - - private String patrolPointId; - - private String patrolStatus;//是否巡检,暂存字段 - - private Camera camera; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getCameraId() { - return cameraId; - } - - public void setCameraId(String cameraId) { - this.cameraId = cameraId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - - public String getPatrolStatus() { - return patrolStatus; - } - - public void setPatrolStatus(String patrolStatus) { - this.patrolStatus = patrolStatus; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPointEquipmentCard.java b/src/com/sipai/entity/timeefficiency/PatrolPointEquipmentCard.java deleted file mode 100644 index 076ed70a..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPointEquipmentCard.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -public class PatrolPointEquipmentCard extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 4665661379013198618L; - - private String id; - - private String insuser; - - private String insdt; - - private String equipmentCardId; - - private String patrolPointId; - - private String patrolStatus;//是否巡检,暂存字段 - - private EquipmentCard equipmentCard;//关联设备 - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getEquipmentCardId() { - return equipmentCardId; - } - - public void setEquipmentCardId(String equipmentCardId) { - this.equipmentCardId = equipmentCardId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getPatrolStatus() { - return patrolStatus; - } - - public void setPatrolStatus(String patrolStatus) { - this.patrolStatus = patrolStatus; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPointFile.java b/src/com/sipai/entity/timeefficiency/PatrolPointFile.java deleted file mode 100644 index 7eb3abad..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPointFile.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.base.SQLAdapter; - -public class PatrolPointFile extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -1540888989597828635L; - - - private String id; - - private String insdt; - - private String insuser; - - private String patrolPointId; - - private String fileId; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolPointMeasurePoint.java b/src/com/sipai/entity/timeefficiency/PatrolPointMeasurePoint.java deleted file mode 100644 index b4c9ec34..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolPointMeasurePoint.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class PatrolPointMeasurePoint extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 2026145331079697549L; - - private String id; - - private String insuser; - - private String insdt; - - private String measurePointId; - - private String patrolPointId; - - private MPoint mPoint;//关联测量点 - - private int morder;//排序 用于app上排序显示 2022-05-25 sj - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMeasurePointId() { - return measurePointId; - } - - public void setMeasurePointId(String measurePointId) { - this.measurePointId = measurePointId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecord.java b/src/com/sipai/entity/timeefficiency/PatrolRecord.java deleted file mode 100644 index 39f7e5c9..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecord.java +++ /dev/null @@ -1,432 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; - -public class PatrolRecord extends BusinessUnitAdapter implements Serializable { - /** - * - */ - private static final long serialVersionUID = 2541519894319948230L; - - public final static String Status_Issue = "1";//已下发 - public final static String Status_Start = "2";//进行中 - public final static String Status_Finish = "3";//已完成 - public final static String Status_PartFinish = "4";//部分完成 - public final static String Status_Undo = "5";//不处理 - - private String id; - private String insdt; - private String insuser; - private String bizId; - private String patrolAreaId;//暂时没用到 直接读取计划中的区域 - private String patrolAreaName;//用于app显示区域名称 可能为多个 - private String name; - private String content; - private String startTime; - private String endTime; - private String actFinishTime; - private String patrolPlanId; - private String workerId; - private String workResult; - private String status; - private String type; - private String patrolModelId; - private String unitId; - private String color; - private int duration;//持续时间/工时 - private int pointNumAll;//任务下_打卡点位总数 - private int pointNumFinish;//任务下_打卡点位完成数 - private Unit unit; - private String processid; - private String processdefid; - private String receiveUserId; - - private String isPictures;//是否必须上传图片(0为非必须 1为必须) - private String groupTypeId;//关联班组Id (如:运行班,维修班) - - private Integer advanceDay;//提前下发天数 - private String taskType;//任务类型(目前暂时仅用于安全内容) - private String releaseModal; - - private PatrolPlanType patrolPlanType; - - public String getIsPictures() { - return isPictures; - } - - public void setIsPictures(String isPictures) { - this.isPictures = isPictures; - } - - public String getGroupTypeId() { - return groupTypeId; - } - - public void setGroupTypeId(String groupTypeId) { - this.groupTypeId = groupTypeId; - } - - public PatrolPlanType getPatrolPlanType() { - return patrolPlanType; - } - - public void setPatrolPlanType(PatrolPlanType patrolPlanType) { - this.patrolPlanType = patrolPlanType; - } - - public String getTaskType() { - return taskType; - } - - public void setTaskType(String taskType) { - this.taskType = taskType; - } - - public Integer getAdvanceDay() { - return advanceDay; - } - - public void setAdvanceDay(Integer advanceDay) { - this.advanceDay = advanceDay; - } - - public String getReleaseModal() { - return releaseModal; - } - - public void setReleaseModal(String releaseModal) { - this.releaseModal = releaseModal; - } - - @Override - public String getProcessid() { - return processid; - } - - @Override - public void setProcessid(String processid) { - this.processid = processid; - } - - @Override - public String getProcessdefid() { - return processdefid; - } - - @Override - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - private PatrolArea patrolArea; - - private User worker; - - private User sendUser; - - private String aSum; - - private PatrolModel patrolModel; - - private List patrolPoint; - - private List equipmentCards; - - private List patrolRecordPatrolRoutes; - - private String _num;//仅用于统计查询中as sj 2020-04-27 - private String _date; - - private String _resultName;//用于虹桥安全显示 任务是否合格 sj 2023-08-01 - - - public String get_resultName() { - return _resultName; - } - - public void set_resultName(String _resultName) { - this._resultName = _resultName; - } - - public String getaSum() { - return aSum; - } - - public void setaSum(String aSum) { - this.aSum = aSum; - } - - public List getPatrolRecordPatrolRoutes() { - return patrolRecordPatrolRoutes; - } - - public int getPointNumAll() { - return pointNumAll; - } - - public void setPointNumAll(int pointNumAll) { - this.pointNumAll = pointNumAll; - } - - public int getPointNumFinish() { - return pointNumFinish; - } - - public void setPointNumFinish(int pointNumFinish) { - this.pointNumFinish = pointNumFinish; - } - - public void setPatrolRecordPatrolRoutes(List patrolRecordPatrolRoutes) { - this.patrolRecordPatrolRoutes = patrolRecordPatrolRoutes; - } - - public User getSendUser() { - return sendUser; - } - - public void setSendUser(User sendUser) { - this.sendUser = sendUser; - } - - public int getDuration() { - return duration; - } - - public void setDuration(int duration) { - this.duration = duration; - } - - public String get_num() { - return _num; - } - - public void set_num(String _num) { - this._num = _num; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } - - public List getEquipmentCards() { - return equipmentCards; - } - - public void setEquipmentCards(List equipmentCards) { - this.equipmentCards = equipmentCards; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - public PatrolArea getPatrolArea() { - return patrolArea; - } - - public void setPatrolArea(PatrolArea patrolArea) { - this.patrolArea = patrolArea; - } - - public User getWorker() { - return worker; - } - - public void setWorker(User worker) { - this.worker = worker; - } - - public PatrolModel getPatrolModel() { - return patrolModel; - } - - public void setPatrolModel(PatrolModel patrolModel) { - this.patrolModel = patrolModel; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getPatrolAreaId() { - return patrolAreaId; - } - - public void setPatrolAreaId(String patrolAreaId) { - this.patrolAreaId = patrolAreaId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public String getActFinishTime() { - return actFinishTime; - } - - public void setActFinishTime(String actFinishTime) { - this.actFinishTime = actFinishTime; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getWorkerId() { - return workerId; - } - - public void setWorkerId(String workerId) { - this.workerId = workerId; - } - - public String getWorkResult() { - return workResult; - } - - public void setWorkResult(String workResult) { - this.workResult = workResult; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPatrolModelId() { - return patrolModelId; - } - - public void setPatrolModelId(String patrolModelId) { - this.patrolModelId = patrolModelId; - } - - public List getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(List patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public String getPatrolAreaName() { - return patrolAreaName; - } - - public void setPatrolAreaName(String patrolAreaName) { - this.patrolAreaName = patrolAreaName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordCollection.java b/src/com/sipai/entity/timeefficiency/PatrolRecordCollection.java deleted file mode 100644 index 45c5363f..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordCollection.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PatrolRecordCollection extends SQLAdapter{ - private String id; - - private String insdt; - - private String upsdt; - - private String bizId; - - private Integer totalNum; - - private Integer commNum; - - private Integer issuedNum; - - private Integer finishedNum; - - private Integer tempNum; - - private Double finishedRate; - - private String companyName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public Integer getTotalNum() { - return totalNum; - } - - public void setTotalNum(Integer totalNum) { - this.totalNum = totalNum; - } - - public Integer getCommNum() { - return commNum; - } - - public void setCommNum(Integer commNum) { - this.commNum = commNum; - } - - public Integer getIssuedNum() { - return issuedNum; - } - - public void setIssuedNum(Integer issuedNum) { - this.issuedNum = issuedNum; - } - - public Integer getFinishedNum() { - return finishedNum; - } - - public void setFinishedNum(Integer finishedNum) { - this.finishedNum = finishedNum; - } - - public Integer getTempNum() { - return tempNum; - } - - public void setTempNum(Integer tempNum) { - this.tempNum = tempNum; - } - - public Double getFinishedRate() { - return finishedRate; - } - - public void setFinishedRate(Double finishedRate) { - this.finishedRate = finishedRate; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordDept.java b/src/com/sipai/entity/timeefficiency/PatrolRecordDept.java deleted file mode 100644 index ee9c7451..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordDept.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.entity.timeefficiency; - - -import com.sipai.entity.base.SQLAdapter; - -import java.io.Serializable; - -/** - * 巡检记录关联任务班组 - */ -public class PatrolRecordDept extends SQLAdapter implements Serializable{ - - private static final long serialVersionUID = 2711616231712560243L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolRecordId; - - private String deptId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordDetailStatistics.java b/src/com/sipai/entity/timeefficiency/PatrolRecordDetailStatistics.java deleted file mode 100644 index 142f3c08..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordDetailStatistics.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -public class PatrolRecordDetailStatistics implements Serializable{ - /** - * - */ - private static final long serialVersionUID = -1909700619360510862L; - private String patrolPointId; - private long mpointNum; - private long mpointFinishNum; - - private long mpointNum_Equ; - private long mpointFinishNum_Equ; - private long abnormalityNum; - - //设备巡检统计数据 - private long totalEquipmentNum; - private long finishEquipmentNum; - - private PatrolPoint patrolPoint; - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - public String getPatrolPointId() { - return patrolPointId; - } - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - public long getMpointNum() { - return mpointNum; - } - public void setMpointNum(long mpointNum) { - this.mpointNum = mpointNum; - } - public long getMpointFinishNum() { - return mpointFinishNum; - } - public void setMpointFinishNum(long mpointFinishNum) { - this.mpointFinishNum = mpointFinishNum; - } - public long getMpointNum_Equ() { - return mpointNum_Equ; - } - public void setMpointNum_Equ(long mpointNum_Equ) { - this.mpointNum_Equ = mpointNum_Equ; - } - public long getMpointFinishNum_Equ() { - return mpointFinishNum_Equ; - } - public void setMpointFinishNum_Equ(long mpointFinishNum_Equ) { - this.mpointFinishNum_Equ = mpointFinishNum_Equ; - } - public long getAbnormalityNum() { - return abnormalityNum; - } - public void setAbnormalityNum(long abnormalityNum) { - this.abnormalityNum = abnormalityNum; - } - public long getTotalEquipmentNum() { - return totalEquipmentNum; - } - public void setTotalEquipmentNum(long totalEquipmentNum) { - this.totalEquipmentNum = totalEquipmentNum; - } - public long getFinishEquipmentNum() { - return finishEquipmentNum; - } - public void setFinishEquipmentNum(long finishEquipmentNum) { - this.finishEquipmentNum = finishEquipmentNum; - } - - -} diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolCamera.java b/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolCamera.java deleted file mode 100644 index dd99fc44..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolCamera.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Camera; - -public class PatrolRecordPatrolCamera extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - public String getInsdt() { - return insdt; - } - - public String getUpdatedt() { - return updatedt; - } - - private String patrolrecordid; - - private String cameraid; - - private String updateuser; - - private String updateuserName; - - private String updatedt; - - private String status; - - private String remark; - - private String type; - - private Integer morder; - - private Integer allnumcontent; - - private Integer allnummeasurepoint; - - private Integer finishnumcontent; - - private Integer finishnummeasurepoint; - - private Integer abnormitynum; - - private Camera camera; - - private User user; - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public void setUpdatedt(String updatedt) { - this.updatedt = updatedt; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolrecordid() { - return patrolrecordid; - } - - public void setPatrolrecordid(String patrolrecordid) { - this.patrolrecordid = patrolrecordid; - } - - public String getCameraid() { - return cameraid; - } - - public void setCameraid(String cameraid) { - this.cameraid = cameraid; - } - - public String getUpdateuser() { - return updateuser; - } - - public void setUpdateuser(String updateuser) { - this.updateuser = updateuser; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getAllnumcontent() { - return allnumcontent; - } - - public void setAllnumcontent(Integer allnumcontent) { - this.allnumcontent = allnumcontent; - } - - public Integer getAllnummeasurepoint() { - return allnummeasurepoint; - } - - public void setAllnummeasurepoint(Integer allnummeasurepoint) { - this.allnummeasurepoint = allnummeasurepoint; - } - - public Integer getFinishnumcontent() { - return finishnumcontent; - } - - public void setFinishnumcontent(Integer finishnumcontent) { - this.finishnumcontent = finishnumcontent; - } - - public Integer getFinishnummeasurepoint() { - return finishnummeasurepoint; - } - - public void setFinishnummeasurepoint(Integer finishnummeasurepoint) { - this.finishnummeasurepoint = finishnummeasurepoint; - } - - public Integer getAbnormitynum() { - return abnormitynum; - } - - public void setAbnormitynum(Integer abnormitynum) { - this.abnormitynum = abnormitynum; - } - - public String getUpdateuserName() { - return updateuserName; - } - - public void setUpdateuserName(String updateuserName) { - this.updateuserName = updateuserName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolEquipment.java b/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolEquipment.java deleted file mode 100644 index f620e18f..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolEquipment.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.User; - -public class PatrolRecordPatrolEquipment extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 5124346247158427161L; - public static String RunningStatus_Normal = "0";//正常 - public static String RunningStatus_Abormal = "1";//不正常 - - private String id; - - private String insdt; - - private String insuser; - - private String patrolRecordId;//巡检记录Id - - private String patrolPointId;//巡检点Id - - private String equipmentId;//设备Id - - private String updateuser; - - private String updatedt; - - private String status; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private String runningStatus; - - private String equipmentStatus; - - private String remark; - - private String type;//区分是关联设备的还是关联巡检点 - - private int morder; - - private Integer allNumContent; - - private Integer allNumMeasurePoint; - - private Integer finishNumContent; - - private Integer finishNumMeasurePoint; - - private Integer abnormityNum; - - private EquipmentCard equipmentCard; - - private User user; - - private List patrolContentsRecords; - private List patrolMeasurePointRecords; - - public List getPatrolMeasurePointRecords() { - return patrolMeasurePointRecords; - } - - public void setPatrolMeasurePointRecords(List patrolMeasurePointRecords) { - this.patrolMeasurePointRecords = patrolMeasurePointRecords; - } - - public List getPatrolContentsRecords() { - return patrolContentsRecords; - } - - public void setPatrolContentsRecords(List patrolContentsRecords) { - this.patrolContentsRecords = patrolContentsRecords; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getUpdateuser() { - return updateuser; - } - - public void setUpdateuser(String updateuser) { - this.updateuser = updateuser; - } - - public String getUpdatedt() { - return updatedt; - } - - public void setUpdatedt(String updatedt) { - this.updatedt = updatedt; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public String getRunningStatus() { - return runningStatus; - } - - public void setRunningStatus(String runningStatus) { - this.runningStatus = runningStatus; - } - - public String getEquipmentStatus() { - return equipmentStatus; - } - - public void setEquipmentStatus(String equipmentStatus) { - this.equipmentStatus = equipmentStatus; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public Integer getAllNumContent() { - return allNumContent; - } - - public void setAllNumContent(Integer allNumContent) { - this.allNumContent = allNumContent; - } - - public Integer getAllNumMeasurePoint() { - return allNumMeasurePoint; - } - - public void setAllNumMeasurePoint(Integer allNumMeasurePoint) { - this.allNumMeasurePoint = allNumMeasurePoint; - } - - public Integer getFinishNumContent() { - return finishNumContent; - } - - public void setFinishNumContent(Integer finishNumContent) { - this.finishNumContent = finishNumContent; - } - - public Integer getFinishNumMeasurePoint() { - return finishNumMeasurePoint; - } - - public void setFinishNumMeasurePoint(Integer finishNumMeasurePoint) { - this.finishNumMeasurePoint = finishNumMeasurePoint; - } - - public Integer getAbnormityNum() { - return abnormityNum; - } - - public void setAbnormityNum(Integer abnormityNum) { - this.abnormityNum = abnormityNum; - } - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolPoint.java b/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolPoint.java deleted file mode 100644 index bb27e953..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolPoint.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PatrolRecordPatrolPoint extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 9124246373213278388L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolRecordId; - - private String patrolPointId; - - private String workerId; - - private String finishdt; - - private String status; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private PatrolPoint patrolPoint; - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getWorkerId() { - return workerId; - } - - public void setWorkerId(String workerId) { - this.workerId = workerId; - } - - public String getFinishdt() { - return finishdt; - } - - public void setFinishdt(String finishdt) { - this.finishdt = finishdt; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolRoute.java b/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolRoute.java deleted file mode 100644 index 53bbf4cd..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordPatrolRoute.java +++ /dev/null @@ -1,385 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class PatrolRecordPatrolRoute extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 6766415147121791948L; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolRecordId; - - private String floorId; - - private String patrolRouteId; - - private String type; - - private String patrolPointId; - - private BigDecimal posx; - - private BigDecimal posy; - - private BigDecimal containerWidth; - - private BigDecimal containerHeight; - - private String workerId; - - private String workerName; - - private String finishdt; - - /** - * 使用 PatrolRecord 中的常量 - * 在通用巡检中为执行状态: 1为未执行 3为已执行 - * 在安全任务中为检查结果: 1为未执行 3正常 4异常 - */ - private String status; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private PatrolPoint patrolPoint; - - private User worker; - - private int morder; - - private String remark; - - //计划链表结构 - private String previousId; - private String nextId; - //实际链表结构 - private String previousIdActual; - private String nextIdActual; - - /* - * 下发的时候赋值2个总数 提交巡检点时候计算完成数 - */ - private int finishNumContent;//巡检内容完成数 - private int allNumContent;//巡检内容总数 - private int finishNumMeasurePoint;//填报内容完成数 - private int allNumMeasurePoint;//填报内容总数 - private int abnormityNum;//上报异常数 - private int equipmentNum;//用于计划中显示设备数 - private int fileNumPic;//附件数(图片) - private int fileNumVideo;//附件数(视频) - - private List patrolContentsRecords; - private List patrolMeasurePointRecords; - private List patrolRecordPatrolEquipments; - - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public int getEquipmentNum() { - return equipmentNum; - } - - public void setEquipmentNum(int equipmentNum) { - this.equipmentNum = equipmentNum; - } - - public List getPatrolMeasurePointRecords() { - return patrolMeasurePointRecords; - } - - public void setPatrolMeasurePointRecords(List patrolMeasurePointRecords) { - this.patrolMeasurePointRecords = patrolMeasurePointRecords; - } - - public List getPatrolRecordPatrolEquipments() { - return patrolRecordPatrolEquipments; - } - - public void setPatrolRecordPatrolEquipments(List patrolRecordPatrolEquipments) { - this.patrolRecordPatrolEquipments = patrolRecordPatrolEquipments; - } - - public List getPatrolContentsRecords() { - return patrolContentsRecords; - } - - public void setPatrolContentsRecords(List patrolContentsRecords) { - this.patrolContentsRecords = patrolContentsRecords; - } - - public String getPreviousIdActual() { - return previousIdActual; - } - - public void setPreviousIdActual(String previousIdActual) { - this.previousIdActual = previousIdActual; - } - - public String getNextIdActual() { - return nextIdActual; - } - - public void setNextIdActual(String nextIdActual) { - this.nextIdActual = nextIdActual; - } - - public int getAbnormityNum() { - return abnormityNum; - } - - public void setAbnormityNum(int abnormityNum) { - this.abnormityNum = abnormityNum; - } - - public int getFinishNumContent() { - return finishNumContent; - } - - public void setFinishNumContent(int finishNumContent) { - this.finishNumContent = finishNumContent; - } - - public int getAllNumContent() { - return allNumContent; - } - - public void setAllNumContent(int allNumContent) { - this.allNumContent = allNumContent; - } - - public int getFinishNumMeasurePoint() { - return finishNumMeasurePoint; - } - - public void setFinishNumMeasurePoint(int finishNumMeasurePoint) { - this.finishNumMeasurePoint = finishNumMeasurePoint; - } - - public int getAllNumMeasurePoint() { - return allNumMeasurePoint; - } - - public void setAllNumMeasurePoint(int allNumMeasurePoint) { - this.allNumMeasurePoint = allNumMeasurePoint; - } - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - - public User getWorker() { - return worker; - } - - public void setWorker(User worker) { - this.worker = worker; - } - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getFloorId() { - return floorId; - } - - public void setFloorId(String floorId) { - this.floorId = floorId; - } - - public String getPatrolRouteId() { - return patrolRouteId; - } - - public void setPatrolRouteId(String patrolRouteId) { - this.patrolRouteId = patrolRouteId; - } - - public String getPreviousId() { - return previousId; - } - - public void setPreviousId(String previousId) { - this.previousId = previousId; - } - - public String getNextId() { - return nextId; - } - - public void setNextId(String nextId) { - this.nextId = nextId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public BigDecimal getPosx() { - return posx; - } - - public void setPosx(BigDecimal posx) { - this.posx = posx; - } - - public BigDecimal getPosy() { - return posy; - } - - public void setPosy(BigDecimal posy) { - this.posy = posy; - } - - public BigDecimal getContainerWidth() { - return containerWidth; - } - - public void setContainerWidth(BigDecimal containerWidth) { - this.containerWidth = containerWidth; - } - - public BigDecimal getContainerHeight() { - return containerHeight; - } - - public void setContainerHeight(BigDecimal containerHeight) { - this.containerHeight = containerHeight; - } - - public String getWorkerId() { - return workerId; - } - - public void setWorkerId(String workerId) { - this.workerId = workerId; - } - - public String getFinishdt() { - return finishdt; - } - - public void setFinishdt(String finishdt) { - this.finishdt = finishdt; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public String getWorkerName() { - return workerName; - } - - public void setWorkerName(String workerName) { - this.workerName = workerName; - } - - public int getFileNumPic() { - return fileNumPic; - } - - public void setFileNumPic(int fileNumPic) { - this.fileNumPic = fileNumPic; - } - - public int getFileNumVideo() { - return fileNumVideo; - } - - public void setFileNumVideo(int fileNumVideo) { - this.fileNumVideo = fileNumVideo; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRecordViolationRecord.java b/src/com/sipai/entity/timeefficiency/PatrolRecordViolationRecord.java deleted file mode 100644 index 6ab7d03a..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRecordViolationRecord.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; - -public class PatrolRecordViolationRecord extends SQLAdapter{ - - private String id; - private String insdt; - private String insuser; - private String bizId; - private String patrolAreaId; - private String name; - private String content; - private String startTime; - private String endTime; - private String actFinishTime; - private String patrolPlanId; - private String deptId; - private String workerId; - private String workResult; - private String status; - private String type; - private String patrolModelId; - - private String color; - - - private Company company; - - private PatrolArea patrolArea; - - private User worker; - - private Dept dept; - - private PatrolModel patrolModel; - - private List patrolPoint; - - private String reason; - - private String cycle; - - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - - public PatrolArea getPatrolArea() { - return patrolArea; - } - - public void setPatrolArea(PatrolArea patrolArea) { - this.patrolArea = patrolArea; - } - - public User getWorker() { - return worker; - } - - public void setWorker(User worker) { - this.worker = worker; - } - - public PatrolModel getPatrolModel() { - return patrolModel; - } - - public void setPatrolModel(PatrolModel patrolModel) { - this.patrolModel = patrolModel; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getPatrolAreaId() { - return patrolAreaId; - } - - public void setPatrolAreaId(String patrolAreaId) { - this.patrolAreaId = patrolAreaId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public String getActFinishTime() { - return actFinishTime; - } - - public void setActFinishTime(String actFinishTime) { - this.actFinishTime = actFinishTime; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getWorkerId() { - return workerId; - } - - public void setWorkerId(String workerId) { - this.workerId = workerId; - } - - public String getWorkResult() { - return workResult; - } - - public void setWorkResult(String workResult) { - this.workResult = workResult; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPatrolModelId() { - return patrolModelId; - } - - public void setPatrolModelId(String patrolModelId) { - this.patrolModelId = patrolModelId; - } - - public List getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(List patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolRoute.java b/src/com/sipai/entity/timeefficiency/PatrolRoute.java deleted file mode 100644 index 7efcd6dc..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolRoute.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class PatrolRoute extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 8133095574494190452L; - - /** - * 实际巡检点 - */ - public final static String Point_0 = "0"; - /** - * 虚拟拐点 - */ - public final static String Point_1 = "1"; - - private String id; - - private String insdt; - - private String insuser; - - private String patrolPlanId; - - private String floorId; - - private String previousId; - - private String nextId; - - private String type; - - private String patrolPointId; - - private BigDecimal posx; - - private BigDecimal posy; - - private BigDecimal containerWidth; - - private BigDecimal containerHeight; - - private PatrolPoint patrolPoint; - - private PatrolRecordPatrolPoint patrolRecordPatrolPoint; - private PatrolAreaFloor patrolAreaFloor;//巡检楼层 - - private int morder; - - //用于计划显示数量 2020-06-10 sj - - private String equipmentNum;//用于计划中显示“巡检内容”数 - private String patrolContentNum;//用于计划中显示“巡检内容”数 - private String measurePointContentNum;//用于计划中显示“填报内容”数 - - public String getEquipmentNum() { - return equipmentNum; - } - - public void setEquipmentNum(String equipmentNum) { - this.equipmentNum = equipmentNum; - } - - public PatrolAreaFloor getPatrolAreaFloor() { - return patrolAreaFloor; - } - - public void setPatrolAreaFloor(PatrolAreaFloor patrolAreaFloor) { - this.patrolAreaFloor = patrolAreaFloor; - } - - public String getPatrolContentNum() { - return patrolContentNum; - } - - public void setPatrolContentNum(String patrolContentNum) { - this.patrolContentNum = patrolContentNum; - } - - public String getMeasurePointContentNum() { - return measurePointContentNum; - } - - public void setMeasurePointContentNum(String measurePointContentNum) { - this.measurePointContentNum = measurePointContentNum; - } - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - - public PatrolPoint getPatrolPoint() { - return patrolPoint; - } - - public void setPatrolPoint(PatrolPoint patrolPoint) { - this.patrolPoint = patrolPoint; - } - - public PatrolRecordPatrolPoint getPatrolRecordPatrolPoint() { - return patrolRecordPatrolPoint; - } - - public void setPatrolRecordPatrolPoint( - PatrolRecordPatrolPoint patrolRecordPatrolPoint) { - this.patrolRecordPatrolPoint = patrolRecordPatrolPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPatrolPlanId() { - return patrolPlanId; - } - - public void setPatrolPlanId(String patrolPlanId) { - this.patrolPlanId = patrolPlanId; - } - - public String getFloorId() { - return floorId; - } - - public void setFloorId(String floorId) { - this.floorId = floorId; - } - - public String getPreviousId() { - return previousId; - } - - public void setPreviousId(String previousId) { - this.previousId = previousId; - } - - public String getNextId() { - return nextId; - } - - public void setNextId(String nextId) { - this.nextId = nextId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public BigDecimal getPosx() { - return posx; - } - - public void setPosx(BigDecimal posx) { - this.posx = posx; - } - - public BigDecimal getPosy() { - return posy; - } - - public void setPosy(BigDecimal posy) { - this.posy = posy; - } - - public BigDecimal getContainerWidth() { - return containerWidth; - } - - public void setContainerWidth(BigDecimal containerWidth) { - this.containerWidth = containerWidth; - } - - public BigDecimal getContainerHeight() { - return containerHeight; - } - - public void setContainerHeight(BigDecimal containerHeight) { - this.containerHeight = containerHeight; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/PatrolType.java b/src/com/sipai/entity/timeefficiency/PatrolType.java deleted file mode 100644 index 9f03e2cb..00000000 --- a/src/com/sipai/entity/timeefficiency/PatrolType.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.timeefficiency; - -/** - * 巡检区域: - */ -public enum PatrolType { - Product("P","生产巡检"), Equipment( "E","设备巡检"), Administrator("A","管理组"), - Maintenance("M","运维组"); - private String id; - private String name; - - private PatrolType(String id,String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (PatrolType item :PatrolType.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllPatrolType4JSON() { - String json = ""; - for (PatrolType item :PatrolType.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/timeefficiency/TimeEfficiencyCommStr.java b/src/com/sipai/entity/timeefficiency/TimeEfficiencyCommStr.java deleted file mode 100644 index 22091f91..00000000 --- a/src/com/sipai/entity/timeefficiency/TimeEfficiencyCommStr.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.entity.timeefficiency; - -public class TimeEfficiencyCommStr { - - //巡检类型 - public static final String PatrolType_Product = "P";//生产巡检 - public static final String PatrolType_Equipment = "E";//设备巡检 - public static final String PatrolType_Camera = "C";//视频巡检 - - public static final String PatrolType_Safe = "S";//安全巡检 - public static final String PatrolType_Alarm = "A";//预警巡检 - public static final String PatrolType_GuangWang = "G";//官网巡检 - - //巡检路线中巡检点和拐点类型 - public static final String PatrolRoutType_PatrolPoint = "0";//巡检点 - public static final String PatrolRoutType_InflexionPoint = "1";//拐点 - - //临时任务巡检模式 - public static final String PatrolModel_TempTask = "temp";// - - //巡检计划自动下发记录模式 - public static final String PatrolPlan_Weekly = "weekly";//每周下发 - public static final String PatrolPlan_Daily = "daily";//每日下发 - public static final String PatrolPlan_Monthly = "monthly";//每月下发 - public static final String PatrolPlan_Yearly = "yearly";//每年下发 - - //默认违规原因(超时) - public final static String REASON = "timeOut"; - //默认违规周期 - public final static String CYCLE = "1"; - - public static final String PatrolEquipment_Point = "point";//巡检点设备 - public static final String PatrolEquipment_Equipment = "equipment";//设备巡检设备 - public static final String PatrolEquipment_Camera = "camera";//视频巡检设备 - -// public static final String ProcessSection = "fa fa-train";//工艺段 -// public static final String PatrolPoint = "fa fa-circle";//巡检点 -// public static final String PatrolEquipment = "fa fa-gears";//设备 -// public static final String PatrolContents = "fa fa-tasks";//巡检内容 -// public static final String PatrolMeasurePoint = "fa fa-edit";//填报内容 - - public static final String ProcessSection = "fa fa-train";//工艺段 - public static final String PatrolPoint = "iconfont icon-patrolPoint";//巡检点 - public static final String PatrolEquipment = "iconfont icon-equipment";//设备 - public static final String PatrolContents = "iconfont icon-content";//巡检内容 - public static final String PatrolMeasurePoint = "iconfont icon-data";//填报内容 - - public static final String EquipmentClassLevel1 = "iconfont icon-shebeifenlei1";//设备大类 - public static final String EquipmentClassLevel2 = "iconfont icon-shebeifenlei2";//设备小类 - public static final String EquipmentClassPlace = "iconfont icon-buwei";//设备小类 - public static final String EquipmentClassEquipment = "iconfont icon-equipment";//设备 - - //巡检总览---巡检情况 - public static final String Patrol_Type_Plan = "0";//巡检总览—计划 - public static final String Patrol_Type_Temp = "1";//巡检总览—临时 - public static final String Patrol_Type_Unstart = "2";//巡检总览—未开始 - public static final String Patrol_Type_Progress = "3";//巡检总览—进行中 - public static final String Patrol_Type_Finish = "4";//巡检总览—完成 - - //巡检等级 - public static final String Patrol_Rank1 = "1"; - public static final String Patrol_Rank2 = "2"; - public static final String Patrol_Rank3 = "3"; -} diff --git a/src/com/sipai/entity/timeefficiency/ViolationRecordCount.java b/src/com/sipai/entity/timeefficiency/ViolationRecordCount.java deleted file mode 100644 index f1de9475..00000000 --- a/src/com/sipai/entity/timeefficiency/ViolationRecordCount.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.entity.timeefficiency; - -/** - * 违规统计 - * - */ -public class ViolationRecordCount { - private String id; - private String deptId; - private String sdt; - private String edt; - private String bizId; - private String companyName; - private String deptName; - private String violationPerson; - private String cycle; - private String violationTime; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getDeptId() { - return deptId; - } - public void setDeptId(String deptId) { - this.deptId = deptId; - } - public String getSdt() { - return sdt; - } - public void setSdt(String sdt) { - this.sdt = sdt; - } - public String getEdt() { - return edt; - } - public void setEdt(String edt) { - this.edt = edt; - } - - public String getBizId() { - return bizId; - } - public void setBizId(String bizId) { - this.bizId = bizId; - } - public String getCompanyName() { - return companyName; - } - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - public String getDeptName() { - return deptName; - } - public void setDeptName(String deptName) { - this.deptName = deptName; - } - - public String getViolationPerson() { - return violationPerson; - } - public void setViolationPerson(String violationPerson) { - this.violationPerson = violationPerson; - } - public String getCycle() { - return cycle; - } - public void setCycle(String cycle) { - this.cycle = cycle; - } - public String getViolationTime() { - return violationTime; - } - public void setViolationTime(String violationTime) { - this.violationTime = violationTime; - } - - - -} diff --git a/src/com/sipai/entity/timeefficiency/WorkRecord.java b/src/com/sipai/entity/timeefficiency/WorkRecord.java deleted file mode 100644 index 4ac140ff..00000000 --- a/src/com/sipai/entity/timeefficiency/WorkRecord.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -/** - * 工作记录 2020-03-13 - * @author SJ - * - */ -public class WorkRecord extends SQLAdapter implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 5270470330450074759L; - - private String id; - - private String insdt; - - private String insuser; - - private Integer status; - - private String contents;//内容 - - private String reportperson;//上报人员id - - private String reporttime;//上报时间 - - private String startTime;//开始时间 - - private String endTime;//结束时间 - - private Double workingHours;//工作时间/工时 - - private String patrolPointId;//巡检点Id - - private String patrolRecordId;//巡检任务Id - - private String bizId;//公司id - - private String workshopId;//车间id unitId - - private String reservedfields1;//备用字段1 - - private String reservedfields2;//备用字段2 - - private User user;//查询上报人name - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public String getReportperson() { - return reportperson; - } - - public void setReportperson(String reportperson) { - this.reportperson = reportperson; - } - - public String getReporttime() { - return reporttime; - } - - public void setReporttime(String reporttime) { - this.reporttime = reporttime; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public Double getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(Double workingHours) { - this.workingHours = workingHours; - } - - public String getPatrolPointId() { - return patrolPointId; - } - - public void setPatrolPointId(String patrolPointId) { - this.patrolPointId = patrolPointId; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getWorkshopId() { - return workshopId; - } - - public void setWorkshopId(String workshopId) { - this.workshopId = workshopId; - } - - public String getReservedfields1() { - return reservedfields1; - } - - public void setReservedfields1(String reservedfields1) { - this.reservedfields1 = reservedfields1; - } - - public String getReservedfields2() { - return reservedfields2; - } - - public void setReservedfields2(String reservedfields2) { - this.reservedfields2 = reservedfields2; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/timeefficiency/WorkerPosition.java b/src/com/sipai/entity/timeefficiency/WorkerPosition.java deleted file mode 100644 index acd1452f..00000000 --- a/src/com/sipai/entity/timeefficiency/WorkerPosition.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.timeefficiency; - -import java.io.Serializable; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -/** - * 巡检轨迹 - * - */ -public class WorkerPosition extends SQLAdapter implements Serializable { - /** - * - */ - private static final long serialVersionUID = -7376088651056200205L; - - private String id; - - private String insdt; - - private String insuser; - - private String latitude; - - private String longitude; - - private String bizId; - - private String patrolRecordId; - - private Integer type; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getPatrolRecordId() { - return patrolRecordId; - } - - public void setPatrolRecordId(String patrolRecordId) { - this.patrolRecordId = patrolRecordId; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/BonusPoint.java b/src/com/sipai/entity/user/BonusPoint.java deleted file mode 100644 index 60e202ac..00000000 --- a/src/com/sipai/entity/user/BonusPoint.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BonusPoint extends SQLAdapter{ - //问题发起分数 - public static int Type_Problem_Launch =10; - //问题发布 - public static int Type_Problem_Submit =10; - //运维单接单负责 - public static int Type_Maintenance_Manager =15; - //维护单处理 - public static int Type_Maintenance_Handle =10; - //评价处理 - public static int Type_DoJudge =5; - //一般评价 - public static int Type_Judge =5; - //五星好评 - public static int Type_5Star =10; - //维护负责人直接下发任务 - public static int Type_TaskDetail =2; - //补录 - public static int Type_Maintenance_Supplement =5; - //保养 - public static int Type_Maintenance_Maintain =5; - - private String id; - - private String insuser; - - private String insdt; - - private String userid; - - private Integer point; - - private String edt; - - private String type; - - /** - * 获取类型解释 - * */ - public String getPointTypeDescription(){ - String resp="其它"; - if (this.type!=null) { - switch (type) { - case "Type_Problem_Launch": - resp="问题发起"; - break; - case "Type_Problem_Submit": - resp="问题发布"; - break; - case "Type_Maintenance_Manager": - resp="运维/保养管理"; - break; - case "Type_Maintenance_Handle": - resp="运维处理"; - break; - case "Type_DoJudge": - resp="处理评价"; - break; - case "Type_5Star": - resp="获得五星好评"; - break; - case "Type_TaskDetail": - resp="任务处理"; - break; - case "Type_Maintenance_Supplement": - resp="补录"; - break; - case "Type_Maintenance_Maintain": - resp="保养"; - break; - - default: - break; - } - } - - return resp; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public Integer getPoint() { - return point; - } - - public void setPoint(Integer point) { - this.point = point; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/BonusPointRecord.java b/src/com/sipai/entity/user/BonusPointRecord.java deleted file mode 100644 index b4011e42..00000000 --- a/src/com/sipai/entity/user/BonusPointRecord.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class BonusPointRecord extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String userid; - - private Long point; - - private String reason; - - private String goodsid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public Long getPoint() { - return point; - } - - public void setPoint(Long point) { - this.point = point; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - public String getGoodsid() { - return goodsid; - } - - public void setGoodsid(String goodsid) { - this.goodsid = goodsid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/Company.java b/src/com/sipai/entity/user/Company.java deleted file mode 100644 index 5f95417d..00000000 --- a/src/com/sipai/entity/user/Company.java +++ /dev/null @@ -1,275 +0,0 @@ -package com.sipai.entity.user; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.timeefficiency.ClockinCollection; -import com.sipai.entity.timeefficiency.PatrolPlanCollection; - -import java.math.BigDecimal; -import java.util.Date; - -public class Company extends SQLAdapter{ - - private String id; - - private String name; - - private String pid; - - private String address; - - private String tel; - - private String website; - - private String taskid; - - private String post; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String sname; - - private String active; - - private String type; - - private String ename; - - private BigDecimal longitude; - - private BigDecimal latitude; - - private String isCount; - - private MaintainerCompany maintainerCompany;//显示运维商配置厂区使�? - - private List roles;//部门的权�? - - private List processSection;//部门的工艺段 - - private PatrolPlanCollection patrolPlanCollection; - - private ClockinCollection clockinCollection;//打卡统计 - - private String libraryBizid;//用来区分该厂属于哪个标准库层级管理 - - private String city; - - public String getLibraryBizid() { - return libraryBizid; - } - - public void setLibraryBizid(String libraryBizid) { - this.libraryBizid = libraryBizid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getTel() { - return tel; - } - - public void setTel(String tel) { - this.tel = tel; - } - - public String getWebsite() { - return website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getPost() { - return post; - } - - public void setPost(String post) { - this.post = post; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public MaintainerCompany getMaintainerCompany() { - return maintainerCompany; - } - - public void setMaintainerCompany(MaintainerCompany maintainerCompany) { - this.maintainerCompany = maintainerCompany; - } - - public List getRoles() { - return roles; - } - - public void setRoles(List roles) { - this.roles = roles; - } - - public List getProcessSection() { - return processSection; - } - - public void setProcessSection(List processSection) { - this.processSection = processSection; - } - - public PatrolPlanCollection getPatrolPlanCollection() { - return patrolPlanCollection; - } - - public void setPatrolPlanCollection(PatrolPlanCollection patrolPlanCollection) { - this.patrolPlanCollection = patrolPlanCollection; - } - - public ClockinCollection getClockinCollection() { - return clockinCollection; - } - - public void setClockinCollection(ClockinCollection clockinCollection) { - this.clockinCollection = clockinCollection; - } - - public String getEname() { - return ename; - } - - public void setEname(String ename) { - this.ename = ename; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public String getIsCount() { - return isCount; - } - - public void setIsCount(String isCount) { - this.isCount = isCount; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/Dept.java b/src/com/sipai/entity/user/Dept.java deleted file mode 100644 index d2740242..00000000 --- a/src/com/sipai/entity/user/Dept.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.timeefficiency.PatrolArea; - -public class Dept extends SQLAdapter{ - - private String code; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - private String id; - - private String name; - - private String pid; - - private String roleid; - - private String offtel; - - private String telout; - - private String telin; - - private String fax; - - private String office; - - private String logopic; - - private String taskid; - - private Date insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String sname; - - private String active; - - private List patrolAreaList; - - private List roleList; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRoleid() { - return roleid; - } - - public void setRoleid(String roleid) { - this.roleid = roleid; - } - - public String getOfftel() { - return offtel; - } - - public void setOfftel(String offtel) { - this.offtel = offtel; - } - - public String getTelout() { - return telout; - } - - public void setTelout(String telout) { - this.telout = telout; - } - - public String getTelin() { - return telin; - } - - public void setTelin(String telin) { - this.telin = telin; - } - - public String getFax() { - return fax; - } - - public void setFax(String fax) { - this.fax = fax; - } - - public String getOffice() { - return office; - } - - public void setOffice(String office) { - this.office = office; - } - - public String getLogopic() { - return logopic; - } - - public void setLogopic(String logopic) { - this.logopic = logopic; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public List getPatrolAreaList() { - return patrolAreaList; - } - - public void setPatrolAreaList(List patrolAreaList) { - this.patrolAreaList = patrolAreaList; - } - - public List getRoleList() { - return roleList; - } - - public void setRoleList(List roleList) { - this.roleList = roleList; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/DeptArea.java b/src/com/sipai/entity/user/DeptArea.java deleted file mode 100644 index 7967d2e2..00000000 --- a/src/com/sipai/entity/user/DeptArea.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class DeptArea extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String deptid; - - private String areaid; - - private String flag; - - private String status; - - private String sequence; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDeptid() { - return deptid; - } - - public void setDeptid(String deptid) { - this.deptid = deptid; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getSequence() { - return sequence; - } - - public void setSequence(String sequence) { - this.sequence = sequence; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/DeptProcess.java b/src/com/sipai/entity/user/DeptProcess.java deleted file mode 100644 index 1056be1b..00000000 --- a/src/com/sipai/entity/user/DeptProcess.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class DeptProcess extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String deptid; - - private String processid; - - private String flag; - - private String status; - - private String sequence; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDeptid() { - return deptid; - } - - public void setDeptid(String deptid) { - this.deptid = deptid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getSequence() { - return sequence; - } - - public void setSequence(String sequence) { - this.sequence = sequence; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/DeptRole.java b/src/com/sipai/entity/user/DeptRole.java deleted file mode 100644 index 848f0fbe..00000000 --- a/src/com/sipai/entity/user/DeptRole.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class DeptRole extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String deptid; - - private String roleid; - - private String status; - - private String flag; - - private Integer sequence; - - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getDeptid() { - return deptid; - } - - public void setDeptid(String deptid) { - this.deptid = deptid; - } - - public String getRoleid() { - return roleid; - } - - public void setRoleid(String roleid) { - this.roleid = roleid; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public Integer getSequence() { - return sequence; - } - - public void setSequence(Integer sequence) { - this.sequence = sequence; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/ExtSystem.java b/src/com/sipai/entity/user/ExtSystem.java deleted file mode 100644 index a11b2c25..00000000 --- a/src/com/sipai/entity/user/ExtSystem.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ExtSystem extends SQLAdapter{ - //请求方式 - public static final String Mode_WebService="WebService"; - public static final String Mode_HTTP="HTTP"; - public static final String[] RequestMode={Mode_WebService,Mode_HTTP}; - //系统类型 - public static final String Type_miniMES="miniMes"; - public static final String Type_DataManage="DataManage"; - public static final String Type_Other="other"; - public static final String Type_GIS="GISCoordinate";//GIS系统 - public static final String Type_model="model"; - public static final String[] SystemType={Type_miniMES,Type_DataManage,Type_Other,Type_GIS}; - - private String id; - - private String insdt; - - private String insuser; - - private String type; - - private Boolean status; - - private String mode; - - private String name; - - private String url; - - private String namespace; - - private String workshopid; - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Boolean getStatus() { - return status; - } - - public void setStatus(Boolean status) { - this.status = status; - } - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - public String getWorkshopid() { - return workshopid; - } - - public void setWorkshopid(String workshopid) { - this.workshopid = workshopid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/Job.java b/src/com/sipai/entity/user/Job.java deleted file mode 100644 index b5890240..00000000 --- a/src/com/sipai/entity/user/Job.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.entity.user; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class Job extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String taskid; - - private Integer pri; - - private String pid; - - private String bizId; - - private String deptId; - - private List user; - - private String serial; - - private int levelType; - private String levelTypeName; - - - public int getLevelType() { - return levelType; - } - - public void setLevelType(int levelType) { - this.levelType = levelType; - } - - public String getSerial() { - return serial; - } - - public void setSerial(String serial) { - this.serial = serial; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public Integer getPri() { - return pri; - } - - public void setPri(Integer pri) { - this.pri = pri; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public List getUser() { - return user; - } - - public void setUser(List user) { - this.user = user; - } - - public String getlevelTypeName() { - return levelTypeName; - } - public void setlevelTypeName(String levelTypeName) { - this.levelTypeName = levelTypeName; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/Menu.java b/src/com/sipai/entity/user/Menu.java deleted file mode 100644 index 95a2d318..00000000 --- a/src/com/sipai/entity/user/Menu.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class Menu extends SQLAdapter{ - private String id; - - private String pid; - - private String powerid; - - private String caption; - - private String name; - - private String description; - - private String location; - - private String target; - - private String onclick; - - private String onmouseover; - - private String onmouseout; - - private String image; - - private String altimage; - - private String tooltip; - - private String roles; - - private String page; - - private String width; - - private String height; - - private String forward; - - private String action; - - private Integer morder; - - private String lvl; - - private String active; - - private String type; - - private String mainpage; - - private Integer count; - - private String _name; - - private String _checked; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getPowerid() { - return powerid; - } - - public void setPowerid(String powerid) { - this.powerid = powerid; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public String getOnclick() { - return onclick; - } - - public void setOnclick(String onclick) { - this.onclick = onclick; - } - - public String getOnmouseover() { - return onmouseover; - } - - public void setOnmouseover(String onmouseover) { - this.onmouseover = onmouseover; - } - - public String getOnmouseout() { - return onmouseout; - } - - public void setOnmouseout(String onmouseout) { - this.onmouseout = onmouseout; - } - - public String getImage() { - return image; - } - - public void setImage(String image) { - this.image = image; - } - - public String getAltimage() { - return altimage; - } - - public void setAltimage(String altimage) { - this.altimage = altimage; - } - - public String getTooltip() { - return tooltip; - } - - public void setTooltip(String tooltip) { - this.tooltip = tooltip; - } - - public String getRoles() { - return roles; - } - - public void setRoles(String roles) { - this.roles = roles; - } - - public String getPage() { - return page; - } - - public void setPage(String page) { - this.page = page; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public String getForward() { - return forward; - } - - public void setForward(String forward) { - this.forward = forward; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getLvl() { - return lvl; - } - - public void setLvl(String lvl) { - this.lvl = lvl; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMainpage() { - return mainpage; - } - - public void setMainpage(String mainpage) { - this.mainpage = mainpage; - } - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - private String _pname; - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String get_name() { - return _name; - } - - public void set_name(String _name) { - this._name = _name; - } - - public String get_checked() { - return _checked; - } - - public void set_checked(String _checked) { - this._checked = _checked; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/MobileManagement.java b/src/com/sipai/entity/user/MobileManagement.java deleted file mode 100644 index 73f82be1..00000000 --- a/src/com/sipai/entity/user/MobileManagement.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class MobileManagement extends SQLAdapter{ - private String id; - - private String name; - - private String deviceid; - - private String unitId; - - private String status; - - private String remark; - - private String bizid; - - private String type; - - private String userId; - - private String auditMan; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDeviceid() { - return deviceid; - } - - public void setDeviceid(String deviceid) { - this.deviceid = deviceid; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/MobileValidation.java b/src/com/sipai/entity/user/MobileValidation.java deleted file mode 100644 index 4e5eaaf7..00000000 --- a/src/com/sipai/entity/user/MobileValidation.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class MobileValidation extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String mobile; - - private String verificationcode; - - private String senddate; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getVerificationcode() { - return verificationcode; - } - - public void setVerificationcode(String verificationcode) { - this.verificationcode = verificationcode; - } - - public String getSenddate() { - return senddate; - } - - public void setSenddate(String senddate) { - this.senddate = senddate; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/ProcessSection.java b/src/com/sipai/entity/user/ProcessSection.java deleted file mode 100644 index 0119d27d..00000000 --- a/src/com/sipai/entity/user/ProcessSection.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.process.ProcessSectionInformation; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -public class ProcessSection extends SQLAdapter { - public final static String UnitId_Sys="sys";//系统默认内容 - - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String code; - - private String pid; - - private Integer morder; - - private String sname; - - private Boolean active; - - private String processSectionTypeId; - - private ProcessSectionType processSectionType; - - private String unitId;//2021-08-02 sj 用于工艺段区分厂 unitId = system为通用工艺段(后面拓展为按照行业) - - private Integer _score; - - private String _alarmcontent; - - private String companySname;//厂简称 - //工艺段介绍 - private ProcessSectionInformation information; - - public ProcessSectionInformation getInformation() { - return information; - } - - public void setInformation(ProcessSectionInformation information) { - this.information = information; - } - - public ProcessSectionType getProcessSectionType() { - return processSectionType; - } - - public void setProcessSectionType(ProcessSectionType processSectionType) { - this.processSectionType = processSectionType; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getProcessSectionTypeId() { - return processSectionTypeId; - } - - public void setProcessSectionTypeId(String processSectionTypeId) { - this.processSectionTypeId = processSectionTypeId; - } - - private List> equipmentCardMapList; - - public List> getEquipmentCardMapList() { - return equipmentCardMapList; - } - - public void setEquipmentCardMapList( - List> equipmentCardMapList) { - this.equipmentCardMapList = equipmentCardMapList; - } - - public Integer get_score() { - return _score; - } - - public void set_score(Integer _score) { - this._score = _score; - } - - public String get_alarmcontent() { - return _alarmcontent; - } - - public void set_alarmcontent(String _alarmcontent) { - this._alarmcontent = _alarmcontent; - } - - - public String getCompanySname() { - return companySname; - } - - public void setCompanySname(String companySname) { - this.companySname = companySname; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/ProcessSectionScore.java b/src/com/sipai/entity/user/ProcessSectionScore.java deleted file mode 100644 index 0245b051..00000000 --- a/src/com/sipai/entity/user/ProcessSectionScore.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ProcessSectionScore extends SQLAdapter{ - private String id; - - private String name; - - private String alarmcontent; - - private Integer lower; - - private Integer upper; - - private String insuser; - - private String insdt; - - private String upsuser; - - private String upsdt; - - private String bizid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAlarmcontent() { - return alarmcontent; - } - - public void setAlarmcontent(String alarmcontent) { - this.alarmcontent = alarmcontent; - } - - public Integer getLower() { - return lower; - } - - public void setLower(Integer lower) { - this.lower = lower; - } - - public Integer getUpper() { - return upper; - } - - public void setUpper(Integer upper) { - this.upper = upper; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/ProcessSectionType.java b/src/com/sipai/entity/user/ProcessSectionType.java deleted file mode 100644 index 78b62717..00000000 --- a/src/com/sipai/entity/user/ProcessSectionType.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ProcessSectionType extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String bizId; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/Role.java b/src/com/sipai/entity/user/Role.java deleted file mode 100644 index ad8bc4d8..00000000 --- a/src/com/sipai/entity/user/Role.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class Role extends SQLAdapter{ - private String id; - - private String name; - - private String serial; - - private String description; - - private Integer morder; - - private String bizid; - - private String bizname; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSerial() { - return serial; - } - - public void setSerial(String serial) { - this.serial = serial; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getBizname() { - return bizname; - } - - public void setBizname(String bizname) { - this.bizname = bizname; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/RoleMenu.java b/src/com/sipai/entity/user/RoleMenu.java deleted file mode 100644 index ce00b54f..00000000 --- a/src/com/sipai/entity/user/RoleMenu.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class RoleMenu extends SQLAdapter { - private String roleid; - - private String menuid; - - private Menu menu; - - public String getRoleid() { - return roleid; - } - - public void setRoleid(String roleid) { - this.roleid = roleid; - } - - public String getMenuid() { - return menuid; - } - - public void setMenuid(String menuid) { - this.menuid = menuid; - } - - public Menu getMenu() { - return menu; - } - - public void setMenu(Menu menu) { - this.menu = menu; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/Unit.java b/src/com/sipai/entity/user/Unit.java deleted file mode 100644 index dd442381..00000000 --- a/src/com/sipai/entity/user/Unit.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class Unit extends SQLAdapter { - private String id; - - private String name; - - private String sname; - - private String pid; - - private String taskid; - - private String type; - - private String active; - - private Integer morder; - - private String syncflag; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Unit unit = (Unit) o; - - if (!id.equals(unit.id)) return false; - return true; - - } - @Override - public int hashCode() { - int result = id.hashCode(); - result = 31 * result + name.hashCode(); - return result; - } - public String getSyncflag() { - return syncflag; - } - - public void setSyncflag(String syncflag) { - this.syncflag = syncflag; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getTaskid() { - return taskid; - } - - public void setTaskid(String taskid) { - this.taskid = taskid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UnitRespDto.java b/src/com/sipai/entity/user/UnitRespDto.java deleted file mode 100644 index 292e57ba..00000000 --- a/src/com/sipai/entity/user/UnitRespDto.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.user; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class UnitRespDto { - - String id; - - String text; - -} diff --git a/src/com/sipai/entity/user/User.java b/src/com/sipai/entity/user/User.java deleted file mode 100644 index 752e97f4..00000000 --- a/src/com/sipai/entity/user/User.java +++ /dev/null @@ -1,375 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -import java.util.List; - -public class User extends SQLAdapter{ - private String id; - - private String name; - - private String password; - - private String active; - - private String caption; - - private String sex; - - private String officeroom; - - private String officephone; - - private String useremail; - - private String pid; - - private Integer lgnum; - - private Double totaltime; - - private Integer morder; - - private String serial; - - private String userCardId; - - private String cardid; - - private String insuser; - - private String insdt; - - private String mobile; - - private String jobid; - - private Integer pri; - - private String syncflag; - - private String wechatid; - - private String themeclass; - - private Integer qq; - - private String _pname; - - private UserDetail userDetail; - private List jobs; - private List roles; - private String currentip; - private Dept dept; - /*上传登录时长*/ - private Double lastloginduration; - /*上传登录时间*/ - private String lastlogintime; - /*上传登录方式*/ - private String source; - /*最近一周登录时长*/ - private Double weekloginduration; - - /*锁定时间*/ - private String locktime; - - public String getLocktime() { - return locktime; - } - - public void setLocktime(String locktime) { - this.locktime = locktime; - } - - private String _workhours;//用于查询工时 - - public String get_workhours() { - return _workhours; - } - - public void set_workhours(String _workhours) { - this._workhours = _workhours; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - } - - public String getOfficeroom() { - return officeroom; - } - - public void setOfficeroom(String officeroom) { - this.officeroom = officeroom; - } - - public String getOfficephone() { - return officephone; - } - - public void setOfficephone(String officephone) { - this.officephone = officephone; - } - - public String getUseremail() { - return useremail; - } - - public void setUseremail(String useremail) { - this.useremail = useremail; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getLgnum() { - return lgnum; - } - - public void setLgnum(Integer lgnum) { - this.lgnum = lgnum; - } - - public Double getTotaltime() { - return totaltime; - } - - public void setTotaltime(Double totaltime) { - this.totaltime = totaltime; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSerial() { - return serial; - } - - public void setSerial(String serial) { - this.serial = serial; - } - - public String getUserCardId() { - return userCardId; - } - - public void setUserCardId(String userCardId) { - this.userCardId = userCardId; - } - - public String getCardid() { - return cardid; - } - - public void setCardid(String cardid) { - this.cardid = cardid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getJobid() { - return jobid; - } - - public void setJobid(String jobid) { - this.jobid = jobid; - } - - public Integer getPri() { - return pri; - } - - public void setPri(Integer pri) { - this.pri = pri; - } - - public String getSyncflag() { - return syncflag; - } - - public void setSyncflag(String syncflag) { - this.syncflag = syncflag; - } - - public String getWechatid() { - return wechatid; - } - - public void setWechatid(String wechatid) { - this.wechatid = wechatid; - } - - public String getThemeclass() { - return themeclass; - } - - public void setThemeclass(String themeclass) { - this.themeclass = themeclass; - } - - public Integer getQq() { - return qq; - } - - public void setQq(Integer qq) { - this.qq = qq; - } - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public List getJobs() { - return jobs; - } - - public void setJobs(List jobs) { - this.jobs = jobs; - } - - public List getRoles() { - return roles; - } - - public void setRoles(List roles) { - this.roles = roles; - } - - public String getCurrentip() { - return currentip; - } - - public void setCurrentip(String currentip) { - this.currentip = currentip; - } - - public String getLastlogintime() { - return lastlogintime; - } - - public void setLastlogintime(String lastlogintime) { - this.lastlogintime = lastlogintime; - } - - public UserDetail getUserDetail() { - return userDetail; - } - - public void setUserDetail(UserDetail userDetail) { - this.userDetail = userDetail; - } - - public Dept getDept() { - return dept; - } - - public void setDept(Dept dept) { - this.dept = dept; - } - - public Double getLastloginduration() { - return lastloginduration; - } - - public void setLastloginduration(Double lastloginduration) { - this.lastloginduration = lastloginduration; - } - - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public Double getWeekloginduration() { - return weekloginduration; - } - - public void setWeekloginduration(Double weekloginduration) { - this.weekloginduration = weekloginduration; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UserCommStr.java b/src/com/sipai/entity/user/UserCommStr.java deleted file mode 100644 index acf543fe..00000000 --- a/src/com/sipai/entity/user/UserCommStr.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.user; - -public class UserCommStr { - - //水厂图片数据库表格 - public static final String Biz_Img_DataBase = "tb_company_file"; - - //公司水厂是否进行设备统计判定字符串 - public static final String Company_Is_Count = "1"; - - //默认密码 - public static final String default_password = "123456"; - //重庆白洋滩默认密码 - //public static final String default_password = "CQbyt@123456"; - -} diff --git a/src/com/sipai/entity/user/UserDetail.java b/src/com/sipai/entity/user/UserDetail.java deleted file mode 100644 index 3d4898d4..00000000 --- a/src/com/sipai/entity/user/UserDetail.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.sipai.entity.user; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class UserDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String userid; - - private String empid; - - private String lastlogintime; - - private String offtel; - - private String iconopen; - - private String opened; - - private String target; - - private String title; - - private String url; - - private String dirline; - - private String fax; - - private String officeroom; - - private String mobil; - - private String politics; - - private String webmail; - - private String icon; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getEmpid() { - return empid; - } - - public void setEmpid(String empid) { - this.empid = empid; - } - - public String getLastlogintime() { - return lastlogintime; - } - - public void setLastlogintime(String lastlogintime) { - this.lastlogintime = lastlogintime; - } - - public String getOfftel() { - return offtel; - } - - public void setOfftel(String offtel) { - this.offtel = offtel; - } - - public String getIconopen() { - return iconopen; - } - - public void setIconopen(String iconopen) { - this.iconopen = iconopen; - } - - public String getOpened() { - return opened; - } - - public void setOpened(String opened) { - this.opened = opened; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getDirline() { - return dirline; - } - - public void setDirline(String dirline) { - this.dirline = dirline; - } - - public String getFax() { - return fax; - } - - public void setFax(String fax) { - this.fax = fax; - } - - public String getOfficeroom() { - return officeroom; - } - - public void setOfficeroom(String officeroom) { - this.officeroom = officeroom; - } - - public String getMobil() { - return mobil; - } - - public void setMobil(String mobil) { - this.mobil = mobil; - } - - public String getPolitics() { - return politics; - } - - public void setPolitics(String politics) { - this.politics = politics; - } - - public String getWebmail() { - return webmail; - } - - public void setWebmail(String webmail) { - this.webmail = webmail; - } - - public String getIcon() { - return icon; - } - - public void setIcon(String icon) { - this.icon = icon; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UserJob.java b/src/com/sipai/entity/user/UserJob.java deleted file mode 100644 index 5053bf56..00000000 --- a/src/com/sipai/entity/user/UserJob.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.entity.user; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -@Component -public class UserJob extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String userid; - - private String jobid; - - private String unitid; - - private String serial; - - - public String getSerial() { - return serial; - } - - public void setSerial(String serial) { - this.serial = serial; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getJobid() { - return jobid; - } - - public void setJobid(String jobid) { - this.jobid = jobid; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UserOutsiders.java b/src/com/sipai/entity/user/UserOutsiders.java deleted file mode 100644 index cd8b5248..00000000 --- a/src/com/sipai/entity/user/UserOutsiders.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class UserOutsiders extends SQLAdapter { - private String id; - - private String name; - - private String caption; - - private String sex; - - private String pid; - - private Integer morder; - - private String cardid; - - private String insuser; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption == null ? null : caption.trim(); - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex == null ? null : sex.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getCardid() { - return cardid; - } - - public void setCardid(String cardid) { - this.cardid = cardid == null ? null : cardid.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UserPower.java b/src/com/sipai/entity/user/UserPower.java deleted file mode 100644 index b9a58ff1..00000000 --- a/src/com/sipai/entity/user/UserPower.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class UserPower extends SQLAdapter{ - private String empid; - - private String id; - - private String name; - - private String pid; - - private String caption; - - private String location; - - private String target; - - private String type; - - private String active; - - private String lvl; - - private Integer morder; - - public String getEmpid() { - return empid; - } - - public void setEmpid(String empid) { - this.empid = empid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getLvl() { - return lvl; - } - - public void setLvl(String lvl) { - this.lvl = lvl; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UserRole.java b/src/com/sipai/entity/user/UserRole.java deleted file mode 100644 index 70ff33f1..00000000 --- a/src/com/sipai/entity/user/UserRole.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class UserRole extends SQLAdapter{ - private String empid; - - private String roleid; - - public String getEmpid() { - return empid; - } - - public void setEmpid(String empid) { - this.empid = empid; - } - - public String getRoleid() { - return roleid; - } - - public void setRoleid(String roleid) { - this.roleid = roleid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/user/UserTime.java b/src/com/sipai/entity/user/UserTime.java deleted file mode 100644 index feccb489..00000000 --- a/src/com/sipai/entity/user/UserTime.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.user; - -import com.sipai.entity.base.SQLAdapter; - -public class UserTime extends SQLAdapter{ - //登录类型,平台端platform或手持端handheld或其他unknown - public static final String platform = "platform";//平台端 - public static final String handheld = "handheld";//手持端 - public static final String unknown = "unknown";//其他 - - public static String[][] STATUS_VISIT={ - {"platform","平台端"},{"handheld","手持端"},{"unknown","其他"} - }; - - private String id; - - private String userid; - - private String ip; - - private String sdate; - - private String edate; - - private Double logintime; - - private String insuser; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getSdate() { - return sdate; - } - - public void setSdate(String sdate) { - this.sdate = sdate; - } - - public String getEdate() { - return edate; - } - - public void setEdate(String edate) { - this.edate = edate; - } - - public Double getLogintime() { - return logintime; - } - - public void setLogintime(Double logintime) { - this.logintime = logintime; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/valueEngineering/EquipmentDepreciation.java b/src/com/sipai/entity/valueEngineering/EquipmentDepreciation.java deleted file mode 100644 index 81eda4f8..00000000 --- a/src/com/sipai/entity/valueEngineering/EquipmentDepreciation.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.valueEngineering; - -import java.math.BigDecimal; -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; - -public class EquipmentDepreciation extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String equipmentId; - - private BigDecimal monthDepreciationRate; - - private BigDecimal yearDepreciationRate; - - private BigDecimal monthDepreciation; - - private BigDecimal yearDepreciation; - - private BigDecimal totalDepreciation; - - private BigDecimal currentValue; - - private BigDecimal residualValue; - - private String bizId; - - private String processSectionId; - - private BigDecimal increaseValue; - - private EquipmentCard equipmentCard; - - private ProcessSection processSection; - - private Company company; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public BigDecimal getMonthDepreciationRate() { - return monthDepreciationRate; - } - - public void setMonthDepreciationRate(BigDecimal monthDepreciationRate) { - this.monthDepreciationRate = monthDepreciationRate; - } - - public BigDecimal getYearDepreciationRate() { - return yearDepreciationRate; - } - - public void setYearDepreciationRate(BigDecimal yearDepreciationRate) { - this.yearDepreciationRate = yearDepreciationRate; - } - - public BigDecimal getMonthDepreciation() { - return monthDepreciation; - } - - public void setMonthDepreciation(BigDecimal monthDepreciation) { - this.monthDepreciation = monthDepreciation; - } - - public BigDecimal getYearDepreciation() { - return yearDepreciation; - } - - public void setYearDepreciation(BigDecimal yearDepreciation) { - this.yearDepreciation = yearDepreciation; - } - - public BigDecimal getTotalDepreciation() { - return totalDepreciation; - } - - public void setTotalDepreciation(BigDecimal totalDepreciation) { - this.totalDepreciation = totalDepreciation; - } - - public BigDecimal getCurrentValue() { - return currentValue; - } - - public void setCurrentValue(BigDecimal currentValue) { - this.currentValue = currentValue; - } - - public BigDecimal getIncreaseValue() { - return increaseValue; - } - - public void setIncreaseValue(BigDecimal increaseValue) { - this.increaseValue = increaseValue; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public BigDecimal getResidualValue() { - return residualValue; - } - - public void setResidualValue(BigDecimal residualValue) { - this.residualValue = residualValue; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/valueEngineering/EquipmentEvaluate.java b/src/com/sipai/entity/valueEngineering/EquipmentEvaluate.java deleted file mode 100644 index a80e7510..00000000 --- a/src/com/sipai/entity/valueEngineering/EquipmentEvaluate.java +++ /dev/null @@ -1,281 +0,0 @@ -package com.sipai.entity.valueEngineering; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.equipment.EquipmentUseAge; - -public class EquipmentEvaluate extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String classId;//设备类型id - - private String specification;//规格 - - private String model;//型号 - - private Double totalScore;//综合得分 - - private Double economicScore;//经济得分 - - private Double en;//单位产出成本 - - private Double efficiencyScore;//效率得分 - - private String power;//额定功率 - - private Double qualityScore;//质量得分 - - private Double faultRate;//故障率 - - private Double intactRate;//完好率 - - private Double useRate;//利用率 - - private Double womScore;//口碑得分 - - private String commentLabel;//点评标签 - - private Double userComment;//用户点评得分 - - private String useTime;//使用年限 - - private String ecomomicKpi;//经济评分kpi排名 - - private String efficiencyKpi;//效率评分kpi排名 - - private String qualityKpi;//质量评分kpi排名 - - private String totalKpi;//综合评分kpi排名 - - private String className;//设备类型名称 - - private EquipmentSpecification equipmentSpecification; - - private EquipmentUseAge equipmentUseAge; - - private EquipmentTypeNumber equipmentTypeNumber; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getSpecification() { - return specification; - } - - public void setSpecification(String specification) { - this.specification = specification; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public Double getTotalScore() { - return totalScore; - } - - public void setTotalScore(Double totalScore) { - this.totalScore = totalScore; - } - - public Double getEconomicScore() { - return economicScore; - } - - public void setEconomicScore(Double economicScore) { - this.economicScore = economicScore; - } - - public Double getEn() { - return en; - } - - public void setEn(Double en) { - this.en = en; - } - - public Double getEfficiencyScore() { - return efficiencyScore; - } - - public void setEfficiencyScore(Double efficiencyScore) { - this.efficiencyScore = efficiencyScore; - } - - public String getPower() { - return power; - } - - public void setPower(String power) { - this.power = power; - } - - public Double getQualityScore() { - return qualityScore; - } - - public void setQualityScore(Double qualityScore) { - this.qualityScore = qualityScore; - } - - public Double getFaultRate() { - return faultRate; - } - - public void setFaultRate(Double faultRate) { - this.faultRate = faultRate; - } - - public Double getIntactRate() { - return intactRate; - } - - public void setIntactRate(Double intactRate) { - this.intactRate = intactRate; - } - - public Double getUseRate() { - return useRate; - } - - public void setUseRate(Double useRate) { - this.useRate = useRate; - } - - public Double getWomScore() { - return womScore; - } - - public void setWomScore(Double womScore) { - this.womScore = womScore; - } - - public String getCommentLabel() { - return commentLabel; - } - - public void setCommentLabel(String commentLabel) { - this.commentLabel = commentLabel; - } - - public Double getUserComment() { - return userComment; - } - - public void setUserComment(Double userComment) { - this.userComment = userComment; - } - - public String getUseTime() { - return useTime; - } - - public void setUseTime(String useTime) { - this.useTime = useTime; - } - - public String getEcomomicKpi() { - return ecomomicKpi; - } - - public void setEcomomicKpi(String ecomomicKpi) { - this.ecomomicKpi = ecomomicKpi; - } - - public String getEfficiencyKpi() { - return efficiencyKpi; - } - - public void setEfficiencyKpi(String efficiencyKpi) { - this.efficiencyKpi = efficiencyKpi; - } - - public String getQualityKpi() { - return qualityKpi; - } - - public void setQualityKpi(String qualityKpi) { - this.qualityKpi = qualityKpi; - } - - public String getTotalKpi() { - return totalKpi; - } - - public void setTotalKpi(String totalKpi) { - this.totalKpi = totalKpi; - } - - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public EquipmentSpecification getEquipmentSpecification() { - return equipmentSpecification; - } - - public void setEquipmentSpecification( - EquipmentSpecification equipmentSpecification) { - this.equipmentSpecification = equipmentSpecification; - } - - public EquipmentUseAge getEquipmentUseAge() { - return equipmentUseAge; - } - - public void setEquipmentUseAge(EquipmentUseAge equipmentUseAge) { - this.equipmentUseAge = equipmentUseAge; - } - - public EquipmentTypeNumber getEquipmentTypeNumber() { - return equipmentTypeNumber; - } - - public void setEquipmentTypeNumber(EquipmentTypeNumber equipmentTypeNumber) { - this.equipmentTypeNumber = equipmentTypeNumber; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/valueEngineering/EquipmentEvaluateCommStr.java b/src/com/sipai/entity/valueEngineering/EquipmentEvaluateCommStr.java deleted file mode 100644 index 0ce76102..00000000 --- a/src/com/sipai/entity/valueEngineering/EquipmentEvaluateCommStr.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.entity.valueEngineering; - -public class EquipmentEvaluateCommStr { - - //KPI测量点bizid - //public static final String KPI_BizId = "0756ZH"; - public static final String KPI_BizId = "0519CZPS"; - - //KPI测量点线图显示记录数 - public static final String KPI_topNum_String = " top 12 "; - public static final int KPI_topNum_Integer = 12; - public static final String KPI_top1_String = " top 1 "; - -} diff --git a/src/com/sipai/entity/valueEngineering/EquipmentModel.java b/src/com/sipai/entity/valueEngineering/EquipmentModel.java deleted file mode 100644 index 6dc93db3..00000000 --- a/src/com/sipai/entity/valueEngineering/EquipmentModel.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.entity.valueEngineering; - -import com.sipai.entity.base.SQLAdapter; - -public class EquipmentModel extends SQLAdapter{ - private String id; - - private String gama; - - private String lamda; - - private String x1; - - private String x2; - - private String x3; - - private String status; - - private String param1; - - private String param2; - - private String param3; - - private String param4; - public static String Flag_Reset_Param1="1"; - public static String Flag_Reset_Param2="2"; - public static String Flag_Reset_Param3="3"; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getGama() { - return gama; - } - - public void setGama(String gama) { - this.gama = gama; - } - - public String getLamda() { - return lamda; - } - - public void setLamda(String lamda) { - this.lamda = lamda; - } - - public String getX1() { - return x1; - } - - public void setX1(String x1) { - this.x1 = x1; - } - - public String getX2() { - return x2; - } - - public void setX2(String x2) { - this.x2 = x2; - } - - public String getX3() { - return x3; - } - - public void setX3(String x3) { - this.x3 = x3; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getParam1() { - return param1; - } - - public void setParam1(String param1) { - this.param1 = param1; - } - - public String getParam2() { - return param2; - } - - public void setParam2(String param2) { - this.param2 = param2; - } - - public String getParam3() { - return param3; - } - - public void setParam3(String param3) { - this.param3 = param3; - } - - public String getParam4() { - return param4; - } - - public void setParam4(String param4) { - this.param4 = param4; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/SafeArea.java b/src/com/sipai/entity/visit/SafeArea.java deleted file mode 100644 index f26e15cf..00000000 --- a/src/com/sipai/entity/visit/SafeArea.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.BusinessUnitAdapter; -import io.swagger.annotations.ApiModel; - -import java.math.BigDecimal; -@ApiModel("安全区域信息表") -public class SafeArea extends BusinessUnitAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Integer securityLevel; - - private String bizId; - - private String state; - - private String type; - - private Integer morder; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private String remark; - - private String processdefid; - - private String processid; - - private String auditManId; - - private String stateName; - private String auditMan; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getSecurityLevel() { - return securityLevel; - } - - public void setSecurityLevel(Integer securityLevel) { - this.securityLevel = securityLevel; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId == null ? null : bizId.trim(); - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid == null ? null : processdefid.trim(); - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid == null ? null : processid.trim(); - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId == null ? null : auditManId.trim(); - } - - public String getStateName() { - return stateName; - } - - public void setStateName(String stateName) { - this.stateName = stateName; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/SafeAreaPosition.java b/src/com/sipai/entity/visit/SafeAreaPosition.java deleted file mode 100644 index 5bb1f0a3..00000000 --- a/src/com/sipai/entity/visit/SafeAreaPosition.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.SQLAdapter; -import io.swagger.annotations.ApiModel; - -import java.math.BigDecimal; - -@ApiModel("安全区域信息表坐标") -public class SafeAreaPosition extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private String bizId; - - private String safeareaId; - - private Integer state; - - private String type; - - private String morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId == null ? null : bizId.trim(); - } - - public String getSafeareaId() { - return safeareaId; - } - - public void setSafeareaId(String safeareaId) { - this.safeareaId = safeareaId == null ? null : safeareaId.trim(); - } - - public Integer getState() { - return state; - } - - public void setState(Integer state) { - this.state = state; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getMorder() { - return morder; - } - - public void setMorder(String morder) { - this.morder = morder == null ? null : morder.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/VisitApply.java b/src/com/sipai/entity/visit/VisitApply.java deleted file mode 100644 index d85c3acd..00000000 --- a/src/com/sipai/entity/visit/VisitApply.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.BusinessUnitAdapter; - -import io.swagger.annotations.ApiModel; - -@ApiModel("参观申请表") -public class VisitApply extends BusinessUnitAdapter { - - private String id; - private String visitUnits; - private String leadUnits; - private String insuser; - private String insdt; - private String remark; - private String number; - private String organizationalUnit; - private String leaderName; - private String leaderPosition; - private String contactInformation; - private String visitTime; - private Integer visitorsNumber; - private String purposeContent; - private String comments; - private String sealImgPath; - private Integer morder; - private String state; - private String processdefid; - private String processid; - private String auditManId; - private String submissionTime; - private String unitId; - private String stateName; - private String auditMan; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getVisitUnits() { - return visitUnits; - } - - public void setVisitUnits(String visitUnits) { - this.visitUnits = visitUnits; - } - - public String getLeadUnits() { - return leadUnits; - } - - public void setLeadUnits(String leadUnits) { - this.leadUnits = leadUnits; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } - - public String getOrganizationalUnit() { - return organizationalUnit; - } - - public void setOrganizationalUnit(String organizationalUnit) { - this.organizationalUnit = organizationalUnit; - } - - public String getLeaderName() { - return leaderName; - } - - public void setLeaderName(String leaderName) { - this.leaderName = leaderName; - } - - public String getLeaderPosition() { - return leaderPosition; - } - - public void setLeaderPosition(String leaderPosition) { - this.leaderPosition = leaderPosition; - } - - public String getContactInformation() { - return contactInformation; - } - - public void setContactInformation(String contactInformation) { - this.contactInformation = contactInformation; - } - - public String getVisitTime() { - return visitTime; - } - - public void setVisitTime(String visitTime) { - this.visitTime = visitTime; - } - - public Integer getVisitorsNumber() { - return visitorsNumber; - } - - public void setVisitorsNumber(Integer visitorsNumber) { - this.visitorsNumber = visitorsNumber; - } - - public String getPurposeContent() { - return purposeContent; - } - - public void setPurposeContent(String purposeContent) { - this.purposeContent = purposeContent; - } - - public String getComments() { - return comments; - } - - public void setComments(String comments) { - this.comments = comments; - } - - public String getSealImgPath() { - return sealImgPath; - } - - public void setSealImgPath(String sealImgPath) { - this.sealImgPath = sealImgPath; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getSubmissionTime() { - return submissionTime; - } - - public void setSubmissionTime(String submissionTime) { - this.submissionTime = submissionTime; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getStateName() { - return stateName; - } - - public void setStateName(String stateName) { - this.stateName = stateName; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/VisitCommString.java b/src/com/sipai/entity/visit/VisitCommString.java deleted file mode 100644 index ed05cc3e..00000000 --- a/src/com/sipai/entity/visit/VisitCommString.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.entity.visit; - -public class VisitCommString { - - //通用状态 - public static final String STATUS_VISIT_START= "1";//未提交 - public static final String STATUS_VISIT_AUDIT = "2";//提交审核 - public static final String STATUS_VISIT_REJECT = "3";//审核驳回 - public static final String STATUS_VISIT_EXECUTE = "4";//审核通过,未登记/未参观 - public static final String STATUS_VISIT_FINISH = "5";//已参观/已登记 - public static final String STATUS_VISIT_REVOKE = "6";//已取消 - - public static String[][] STATUS_VISIT={ - {"1","未提交"},{"2","提交审核"},{"3","审核驳回"},{"4","审核通过"},{"5","已参观"},{"6","已取消"} - }; -} diff --git a/src/com/sipai/entity/visit/VisitPosition.java b/src/com/sipai/entity/visit/VisitPosition.java deleted file mode 100644 index 95e76f06..00000000 --- a/src/com/sipai/entity/visit/VisitPosition.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.visit; - -import java.math.BigDecimal; -import com.sipai.entity.base.SQLAdapter; - -public class VisitPosition extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private BigDecimal latitude; - - private BigDecimal longitude; - - private String bizId; - - private String visitorsId; - - private String dttime; - - private Integer state; - - private String type; - - private String imei; - - private String worker; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public BigDecimal getLatitude() { - return latitude; - } - - public void setLatitude(BigDecimal latitude) { - this.latitude = latitude; - } - - public BigDecimal getLongitude() { - return longitude; - } - - public void setLongitude(BigDecimal longitude) { - this.longitude = longitude; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getVisitorsId() { - return visitorsId; - } - - public void setVisitorsId(String visitorsId) { - this.visitorsId = visitorsId; - } - - public String getDttime() { - return dttime; - } - - public void setDttime(String dttime) { - this.dttime = dttime; - } - - public Integer getState() { - return state; - } - - public void setState(Integer state) { - this.state = state; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getImei() { - return imei; - } - - public void setImei(String imei) { - this.imei = imei; - } - - public String getWorker() { - return worker; - } - - public void setWorker(String worker) { - this.worker = worker; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/VisitRegister.java b/src/com/sipai/entity/visit/VisitRegister.java deleted file mode 100644 index e8eb7947..00000000 --- a/src/com/sipai/entity/visit/VisitRegister.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.BusinessUnitAdapter; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -@ApiModel("参观登记表") -public class VisitRegister extends BusinessUnitAdapter { - - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - private String applyId; - - public String getApplyId() { - return applyId; - } - - public void setApplyId(String applyId) { - this.applyId = applyId; - } - - private String id; - - private String visitUnits; - - private Double visitDuration; - - private String insuser; - - private String insdt; - - private String remark; - - private String number; - - private String contactAddress; - - private String leaderName; - - private String receptionist; - - private String contactInformation; - - private String visitTime; - - private Integer visitorsNumber; - - private String purposeContent; - - private String commentsSuggestions; - - private String commentator; - - private Integer morder; - - private String state; - - private String processdefid; - - private String processid; - - private String auditManId; - - private String submissionTime; - - private String stateName; - private String auditMan; - private String receptionistName; - private String commentatorName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getVisitUnits() { - return visitUnits; - } - - public void setVisitUnits(String visitUnits) { - this.visitUnits = visitUnits; - } - - public Double getVisitDuration() { - return visitDuration; - } - - public void setVisitDuration(Double visitDuration) { - this.visitDuration = visitDuration; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } - - public String getContactAddress() { - return contactAddress; - } - - public void setContactAddress(String contactAddress) { - this.contactAddress = contactAddress; - } - - public String getLeaderName() { - return leaderName; - } - - public void setLeaderName(String leaderName) { - this.leaderName = leaderName; - } - - public String getReceptionist() { - return receptionist; - } - - public void setReceptionist(String receptionist) { - this.receptionist = receptionist; - } - - public String getContactInformation() { - return contactInformation; - } - - public void setContactInformation(String contactInformation) { - this.contactInformation = contactInformation; - } - - public String getVisitTime() { - return visitTime; - } - - public void setVisitTime(String visitTime) { - this.visitTime = visitTime; - } - - public Integer getVisitorsNumber() { - return visitorsNumber; - } - - public void setVisitorsNumber(Integer visitorsNumber) { - this.visitorsNumber = visitorsNumber; - } - - public String getPurposeContent() { - return purposeContent; - } - - public void setPurposeContent(String purposeContent) { - this.purposeContent = purposeContent; - } - - public String getCommentsSuggestions() { - return commentsSuggestions; - } - - public void setCommentsSuggestions(String commentsSuggestions) { - this.commentsSuggestions = commentsSuggestions; - } - - public String getCommentator() { - return commentator; - } - - public void setCommentator(String commentator) { - this.commentator = commentator; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getAuditManId() { - return auditManId; - } - - public void setAuditManId(String auditManId) { - this.auditManId = auditManId; - } - - public String getSubmissionTime() { - return submissionTime; - } - - public void setSubmissionTime(String submissionTime) { - this.submissionTime = submissionTime; - } - - public String getStateName() { - return stateName; - } - - public void setStateName(String stateName) { - this.stateName = stateName; - } - - public String getAuditMan() { - return auditMan; - } - - public void setAuditMan(String auditMan) { - this.auditMan = auditMan; - } - - public String getReceptionistName() { - return receptionistName; - } - - public void setReceptionistName(String receptionistName) { - this.receptionistName = receptionistName; - } - - public String getCommentatorName() { - return commentatorName; - } - - public void setCommentatorName(String commentatorName) { - this.commentatorName = commentatorName; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/VisitSafetyCommitment.java b/src/com/sipai/entity/visit/VisitSafetyCommitment.java deleted file mode 100644 index fb2ce255..00000000 --- a/src/com/sipai/entity/visit/VisitSafetyCommitment.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.SQLAdapter; - -public class VisitSafetyCommitment extends SQLAdapter { - public final static String ADULT = "adult"; //成人 - public final static String CHILDREN = "children"; // 青少年 - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - private String id; - - private String insuser; - - private String insdt; - - private String remark; - - private Integer morder; - - private Integer state; - - private String content; - - private String edition; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getState() { - return state; - } - - public void setState(Integer state) { - this.state = state; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getEdition() { - return edition; - } - - public void setEdition(String edition) { - this.edition = edition; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/VisitSafetyCommitmentRecord.java b/src/com/sipai/entity/visit/VisitSafetyCommitmentRecord.java deleted file mode 100644 index 6c296f5b..00000000 --- a/src/com/sipai/entity/visit/VisitSafetyCommitmentRecord.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.SQLAdapter; - -public class VisitSafetyCommitmentRecord extends SQLAdapter { - private String id; - - private String insuser; - - private String insdt; - - private String remark; - - private Integer morder; - - private Integer state; - - private String content; - - private String promisor; - - private String commitmentTime; - - private String signImgPath; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getState() { - return state; - } - - public void setState(Integer state) { - this.state = state; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPromisor() { - return promisor; - } - - public void setPromisor(String promisor) { - this.promisor = promisor; - } - - public String getCommitmentTime() { - return commitmentTime; - } - - public void setCommitmentTime(String commitmentTime) { - this.commitmentTime = commitmentTime; - } - - public String getSignImgPath() { - return signImgPath; - } - - public void setSignImgPath(String signImgPath) { - this.signImgPath = signImgPath; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visit/VisitVisitors.java b/src/com/sipai/entity/visit/VisitVisitors.java deleted file mode 100644 index 7a9e4cd1..00000000 --- a/src/com/sipai/entity/visit/VisitVisitors.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.entity.visit; - -import com.sipai.entity.base.SQLAdapter; - -public class VisitVisitors extends SQLAdapter { - - private String contactInformation; - - public String getContactInformation() { - return contactInformation; - } - - public void setContactInformation(String contactInformation) { - this.contactInformation = contactInformation; - } - - private String id; - - private String fullName; - - private String insuser; - - private String insdt; - - private String remark; - - private Integer morder; - - private String gender; - - private Integer age; - - private String applyId; - - private Integer state; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public Integer getAge() { - return age; - } - - public void setAge(Integer age) { - this.age = age; - } - - public String getApplyId() { - return applyId; - } - - public void setApplyId(String applyId) { - this.applyId = applyId; - } - - public Integer getState() { - return state; - } - - public void setState(Integer state) { - this.state = state; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/CacheData.java b/src/com/sipai/entity/visual/CacheData.java deleted file mode 100644 index f5cd2227..00000000 --- a/src/com/sipai/entity/visual/CacheData.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; - -public class CacheData extends SQLAdapter{ - //启用状态 - public final static String Active_true="1";//启用,读实际数据 - public final static String Active_false="0";//禁用,读预设数据 - - //画面数据 - public final static String Type_DataSummary_0="区域运营汇总"; - public final static String Type_DataSummary_1="集团运营汇总"; - public final static String Type_DataSummary_2="厂级运营汇总"; - public final static String Type_DataSummary_3="生产运行统计"; - public final static String Type_DataSummary_4="巡检管理统计"; - public final static String Type_DataSummary_5="设备管理统计"; - public final static String Type_App_0="app昨日关键数据"; - public final static String Type_App_1="app首页数据"; - public final static String Type_App_2="app首页历史数据"; - public final static String Type_App_3="app台账数据"; - public final static String Type_App_4="app台账历史数据"; - - private String id; - - private String dataname; - - private String mpcode; - - private Double value; - - private Double inivalue; - - private String active; - - private String insdt; - - private String unitid; - - private String bizname; - - private String type; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataname() { - return dataname; - } - - public void setDataname(String dataname) { - this.dataname = dataname; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public Double getInivalue() { - return inivalue; - } - - public void setInivalue(Double inivalue) { - this.inivalue = inivalue; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getBizname() { - return bizname; - } - - public void setBizname(String bizname) { - this.bizname = bizname; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/DataType.java b/src/com/sipai/entity/visual/DataType.java deleted file mode 100644 index ac405797..00000000 --- a/src/com/sipai/entity/visual/DataType.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.entity.visual; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class DataType extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String dataTypeName; - - private Integer morder; - - private String remark; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getDataTypeName() { - return dataTypeName; - } - - public void setDataTypeName(String dataTypeName) { - this.dataTypeName = dataTypeName; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/GetValueType.java b/src/com/sipai/entity/visual/GetValueType.java deleted file mode 100644 index a7711326..00000000 --- a/src/com/sipai/entity/visual/GetValueType.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.entity.visual; - -public enum GetValueType { - Type_GetValue("getValue","获取测量点值"), Type_GetHistory( "getHistory","获取历史值"), - Type_GetModbus( "getModbus","获取ModBus"), Type_GetHttp( "getHttp","获取HTTP请求"), - Type_None( "none","不获取"); - private String id; - private String name; - - private GetValueType(String id,String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (GetValueType item :GetValueType.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (GetValueType item :GetValueType.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/visual/Interaction.java b/src/com/sipai/entity/visual/Interaction.java deleted file mode 100644 index 0987340b..00000000 --- a/src/com/sipai/entity/visual/Interaction.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; - -public class Interaction extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Integer morder; - - private String methodcode; - - private String parameter; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getMethodcode() { - return methodcode; - } - - public void setMethodcode(String methodcode) { - this.methodcode = methodcode; - } - - public String getParameter() { - return parameter; - } - - public void setParameter(String parameter) { - this.parameter = parameter; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/InteractionMethod.java b/src/com/sipai/entity/visual/InteractionMethod.java deleted file mode 100644 index f3a285cc..00000000 --- a/src/com/sipai/entity/visual/InteractionMethod.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.visual; - -public enum InteractionMethod { - Line("lineInteraction","柱线图"), camera( "cameraInteraction","摄像头"); - private String id; - private String name; - - private InteractionMethod(String id,String name){ - this.id=id; - this.name=name; - } - - public static String getName(String id) { - for (InteractionMethod item :InteractionMethod.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAll4JSON() { - String json = ""; - for (InteractionMethod item :InteractionMethod.values()) { - if(json == ""){ - json += "{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - }else{ - json += ",{\"id\":\""+item.getId()+"\",\"text\":\""+item.getName()+"\"}"; - } - } - json = "[" + json + "]"; - return json; - } - -} diff --git a/src/com/sipai/entity/visual/JspConfigure.java b/src/com/sipai/entity/visual/JspConfigure.java deleted file mode 100644 index b9ab1cd0..00000000 --- a/src/com/sipai/entity/visual/JspConfigure.java +++ /dev/null @@ -1,202 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.Unit; -import com.sipai.entity.work.Camera; - -import java.util.List; - -public class JspConfigure extends SQLAdapter { - - private Double windowsHeight; - - private Double windowsWidth; - - public Double getWindowsHeight() { - return windowsHeight; - } - - public void setWindowsHeight(Double windowsHeight) { - this.windowsHeight = windowsHeight; - } - - public Double getWindowsWidth() { - return windowsWidth; - } - - public void setWindowsWidth(Double windowsWidth) { - this.windowsWidth = windowsWidth; - } - - private String selectUnitId; - - private Unit unit; - - private String id; - - private String insuser; - - private String insdt; - - private String name; - - private String pid; - - private Integer morder; - - private String dataType;//1水厂,2泵站,3工艺 - - private String active; - - private String proDatavisualFrameId; - - private Camera camera; - - private Double elementLeft; - - private Double elementTop; - - private String unitId; - - private DataVisualFrame dataVisualFrame; - - private List detailList; - - public String getSelectUnitId() { - return selectUnitId; - } - - public void setSelectUnitId(String selectUnitId) { - this.selectUnitId = selectUnitId; - } - - public Unit getUnit() { - return unit; - } - - public void setUnit(Unit unit) { - this.unit = unit; - } - - public DataVisualFrame getDataVisualFrame() { - return dataVisualFrame; - } - - public void setDataVisualFrame(DataVisualFrame dataVisualFrame) { - this.dataVisualFrame = dataVisualFrame; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getProDatavisualFrameId() { - return proDatavisualFrameId; - } - - public void setProDatavisualFrameId(String proDatavisualFrameId) { - this.proDatavisualFrameId = proDatavisualFrameId; - } - - public Double getElementLeft() { - return elementLeft; - } - - public void setElementLeft(Double elementLeft) { - this.elementLeft = elementLeft; - } - - public Double getElementTop() { - return elementTop; - } - - public void setElementTop(Double elementTop) { - this.elementTop = elementTop; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public List getDetailList() { - return detailList; - } - - public void setDetailList(List detailList) { - this.detailList = detailList; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/JspConfigureDetail.java b/src/com/sipai/entity/visual/JspConfigureDetail.java deleted file mode 100644 index 5e79dffe..00000000 --- a/src/com/sipai/entity/visual/JspConfigureDetail.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.visual; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class JspConfigureDetail extends SQLAdapter { - private String id; - - private String dataName; - - private String mpcode; - - private Double value; - - private String insdt; - - private String configureId; - - private Integer morder; - - private Integer numtail; - - private String active; - - private String dataType; - - private String timeType; - - private String unit; - - private Double rate; - - private MPoint mPoint; - - private JSONArray mPointHistory; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataName() { - return dataName; - } - - public void setDataName(String dataName) { - this.dataName = dataName; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getConfigureId() { - return configureId; - } - - public void setConfigureId(String configureId) { - this.configureId = configureId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getNumtail() { - return numtail; - } - - public void setNumtail(Integer numtail) { - this.numtail = numtail; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getTimeType() { - return timeType; - } - - public void setTimeType(String timeType) { - this.timeType = timeType; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public Double getRate() { - return rate; - } - - public void setRate(Double rate) { - this.rate = rate; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public JSONArray getmPointHistory() { - return mPointHistory; - } - - public void setmPointHistory(JSONArray mPointHistory) { - this.mPointHistory = mPointHistory; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/JspElement.java b/src/com/sipai/entity/visual/JspElement.java deleted file mode 100644 index 927158ed..00000000 --- a/src/com/sipai/entity/visual/JspElement.java +++ /dev/null @@ -1,358 +0,0 @@ -package com.sipai.entity.visual; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.Weather; - -import java.util.List; - -public class JspElement extends SQLAdapter { - public static String MPointHistory_ValueNum = " top 24 ";//测量点历史表前24条 - public static String Type_GetValue = "getValue"; - public static String Type_GetMpMainValue = "getMpMainValue"; - public static String Type_GetDayHistory = "getDayHistory"; - public static String Type_GetTodayHistory = "getTodayHistory"; - public static String Type_GetMonthHistory = "getMonthHistory"; - public static String Type_GetYesterdayHistory = "getYesterdayHistory"; - public static String Type_GetHisSumValue = "getHisSumValue"; - public static String Type_GetHisAvgValue = "getHisAvgValue"; - public static String Type_GetHisMaxValue = "getHisMaxValue"; - public static String Type_GetHisMinValue = "getHisMinValue"; - public static String Type_GetHourHistory = "getHourHistory"; - public static String Type_GetTodayFirstValue = "getTodayFirstValue"; - public static String Type_GetYesterdayFirstValue = "getYesterdayFirstValue"; - public static String Type_GetYesterdayLastValue = "getYesterdayLastValue"; - public static String Type_GetNowHourFirst = "getNowHourFirst"; - public static String Type_GetLastHourFirst = "getLastHourFirst"; - public static String Type_GetTodaySumValue = "getTodaySumValue"; - public static String Type_GetYesterdaySumValue = "getYesterdaySumValue"; - public static String Type_GetYesterdayAvgValue = "getYesterdayAvgValue"; - public static String Type_GetYesterdayMaxValue = "getYesterdayMaxValue"; - public static String Type_GetYesterdayMinValue = "getYesterdayMinValue"; - public static String Type_Get7daySumValue = "get7SumValue"; - public static String Type_Get7dayAvgValue = "get7dayAvgValue"; - public static String Type_Get7dayMaxValue = "get7dayMaxValue"; - public static String Type_Get7dayMinValue = "get7dayMinValue"; - public static String Type_Get7dayHistory = "get7dayHistory"; - public static String Type_Get10dayHistory = "get10dayHistory"; - public static String Type_Get5YearHistory = "get5YeartHistory"; - public static String Type_GetYearSum = "getYearSum"; - public static String Type_GetModbus = "getModbus"; - public static String Type_GetHttp = "getHttp"; - public static String Type_GetWeather = "getWeather"; - public static String Type_GetCacheData = "getCacheData"; - public static String Type_GetHistoryAllMAX = "getHistoryAllMAX"; - public static String Type_GetHistoryAllAVG = "getHistoryAllAVG"; - public static String Type_GetHistoryYearMAX = "getHistoryYearMAX"; - public static String Type_GetHistoryYearAVG = "getHistoryYearAVG"; - public static String Type_GetYesterdayNowHourFirstValue = "getYesterdayNowHourFirstValue"; - public static String Type_GetYesterdayHisHourSumValue = "getYesterdayHisHourSumValue"; - public static String Type_Get10dayHistory4TwoCodes = "get10dayHistory4TwoCodes"; - public static String Type_Get10dayHistory4MultipleCodes = "get10dayHistory4MultipleCodes"; - public static String Type_GetHistoryAllMAX4TwoCodes = "getHistoryAllMAX4TwoCodes"; - public static String Type_GetHistoryAllAVG4TwoCodes = "getHistoryAllAVG4TwoCodes"; - public static String Type_GetYesterdayHistory4TwoCodes = "getYesterdayHistory4TwoCodes"; - public static String Type_GetInternalMethod = "getInternalMethod"; - public static String Type_GetLastMonthFinalValue = "getLastMonthFinalValue"; - - public static String Type_GetRedisData = "getRedisData"; - public static String Type_GetHisData = "getHisData"; - - //为泰和模型 - public static String Type_GetTHMonthHistory = "getTHMonthHistory"; - public static String Type_GetTHMonthHistory2 = "getTHMonthHistory2"; - public static String Type_GetTHDayHistory = "getTHDayHistory"; - public static String Type_GetTHDayHistory2 = "getTHDayHistory2"; - public static String Type_GetTHMonthHistory4Predicted = "getTHMonthHistory4Predicted"; - public static String Type_GetTHDayHistory4Predicted = "getTHDayHistory4Predicted"; - public static String Type_GetTHMonthHistoryAndRedisData = "getTHMonthHistoryAndRedisData"; - public static String Type_GetMpMainValue4Avg = "getMpMainValue4Avg"; - - public static String Type_GetMpcode = "getMpcode"; - public static String Type_GetMpcodeLimitingValue = "getMpcodeLimitingValue"; - - public static String Type_GetTop1DayHis = "getTop1DayHis"; - - public static String Batch_Code = "batchNo"; - - public static String Type_Get2HourHistory = "get2HourHistory"; - public static String Type_Get24HourHistory = "get24HourHistory"; - - public static String Type_Get30dayHistory = "get30dayHistory"; - public static String Type_Get12MonthHistory = "get12MonthHistory"; - - - private String id; - - private String insuser; - - private String insdt; - - private String name; - - private String elementCode; - - private String style; - - private String getValueType; - - private String valueUrl; - - private String httpUrl; - - private String pid; - - private Integer morder; - - private String dataType; - - private String dataTypeName; - - private String active; - - private String unitId; - - private String unitId2; - - private MPoint mPoint; - - private Weather weather; - - private VisualCacheData visualCacheData; - - private VisualCacheConfig visualCacheConfig; - - private List visualCacheDataList; - - private List mPointHistory; - - private String value; - - private String CameraId; - - private Camera camera; - - private JSONArray jsonArray; - - private Integer numtail; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public String getUnitId2() { - return unitId2; - } - - public void setUnitId2(String unitId2) { - this.unitId2 = unitId2; - } - - public void setName(String name) { - this.name = name; - } - - public String getElementCode() { - return elementCode; - } - - public void setElementCode(String elementCode) { - this.elementCode = elementCode; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getGetValueType() { - return getValueType; - } - - public void setGetValueType(String getValueType) { - this.getValueType = getValueType; - } - - public String getValueUrl() { - return valueUrl; - } - - public void setValueUrl(String valueUrl) { - this.valueUrl = valueUrl; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public List getmPointHistory() { - return mPointHistory; - } - - public void setmPointHistory(List mPointHistory) { - this.mPointHistory = mPointHistory; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getCameraId() { - return CameraId; - } - - public void setCameraId(String cameraId) { - CameraId = cameraId; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - - public String getDataTypeName() { - return dataTypeName; - } - - public void setDataTypeName(String dataTypeName) { - this.dataTypeName = dataTypeName; - } - - public String getHttpUrl() { - return httpUrl; - } - - public void setHttpUrl(String httpUrl) { - this.httpUrl = httpUrl; - } - - public Weather getWeather() { - return weather; - } - - public void setWeather(Weather weather) { - this.weather = weather; - } - - public VisualCacheData getVisualCacheData() { - return visualCacheData; - } - - public void setVisualCacheData(VisualCacheData visualCacheData) { - this.visualCacheData = visualCacheData; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public JSONArray getJsonArray() { - return jsonArray; - } - - public void setJsonArray(JSONArray jsonArray) { - this.jsonArray = jsonArray; - } - - public List getVisualCacheDataList() { - return visualCacheDataList; - } - - public void setVisualCacheDataList(List visualCacheDataList) { - this.visualCacheDataList = visualCacheDataList; - } - - public VisualCacheConfig getVisualCacheConfig() { - return visualCacheConfig; - } - - public void setVisualCacheConfig(VisualCacheConfig visualCacheConfig) { - this.visualCacheConfig = visualCacheConfig; - } - - public Integer getNumtail() { - return numtail; - } - - public void setNumtail(Integer numtail) { - this.numtail = numtail; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/Layout.java b/src/com/sipai/entity/visual/Layout.java deleted file mode 100644 index bf7942a5..00000000 --- a/src/com/sipai/entity/visual/Layout.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; - -public class Layout extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String style; - - private String divId; - - private String divClass; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getDivId() { - return divId; - } - - public void setDivId(String divId) { - this.divId = divId; - } - - public String getDivClass() { - return divClass; - } - - public void setDivClass(String divClass) { - this.divClass = divClass; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/LayoutDetail.java b/src/com/sipai/entity/visual/LayoutDetail.java deleted file mode 100644 index 284a8dd8..00000000 --- a/src/com/sipai/entity/visual/LayoutDetail.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; - -public class LayoutDetail extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String height; - - private String width; - - private Integer morder; - - private Integer rowno; - - private Integer colspan; - - private Integer rowspan; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getRowno() { - return rowno; - } - - public void setRowno(Integer rowno) { - this.rowno = rowno; - } - - public Integer getColspan() { - return colspan; - } - - public void setColspan(Integer colspan) { - this.colspan = colspan; - } - - public Integer getRowspan() { - return rowspan; - } - - public void setRowspan(Integer rowspan) { - this.rowspan = rowspan; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/Plan.java b/src/com/sipai/entity/visual/Plan.java deleted file mode 100644 index 22736e81..00000000 --- a/src/com/sipai/entity/visual/Plan.java +++ /dev/null @@ -1,308 +0,0 @@ -package com.sipai.entity.visual; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class Plan extends SQLAdapter{ - private String id; - - private String pid; - - private String powerid; - - private String caption; - - private String name; - - private String description; - - private String location; - - private String target; - - private String onclick; - - private String onmouseover; - - private String onmouseout; - - private String image; - - private String altimage; - - private String tooltip; - - private String roles; - - private String page; - - private String width; - - private String height; - - private String layoutId; - - private String layoutName; - - private String backgroundColor; - - private Integer morder; - - private String lvl; - - private String active; - - private String type; - - private String mainpage; - - private Integer count; - - private String _pname; - - private List planLayout; - - private List planInteraction; - - public String get_pname() { - return _pname; - } - - public void set_pname(String _pname) { - this._pname = _pname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getPowerid() { - return powerid; - } - - public void setPowerid(String powerid) { - this.powerid = powerid; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public String getOnclick() { - return onclick; - } - - public void setOnclick(String onclick) { - this.onclick = onclick; - } - - public String getOnmouseover() { - return onmouseover; - } - - public void setOnmouseover(String onmouseover) { - this.onmouseover = onmouseover; - } - - public String getOnmouseout() { - return onmouseout; - } - - public void setOnmouseout(String onmouseout) { - this.onmouseout = onmouseout; - } - - public String getImage() { - return image; - } - - public void setImage(String image) { - this.image = image; - } - - public String getAltimage() { - return altimage; - } - - public void setAltimage(String altimage) { - this.altimage = altimage; - } - - public String getTooltip() { - return tooltip; - } - - public void setTooltip(String tooltip) { - this.tooltip = tooltip; - } - - public String getRoles() { - return roles; - } - - public void setRoles(String roles) { - this.roles = roles; - } - - public String getPage() { - return page; - } - - public void setPage(String page) { - this.page = page; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public String getLayoutId() { - return layoutId; - } - - public void setLayoutId(String layoutId) { - this.layoutId = layoutId; - } - - public String getBackgroundColor() { - return backgroundColor; - } - - public void setBackgroundColor(String backgroundColor) { - this.backgroundColor = backgroundColor; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getLvl() { - return lvl; - } - - public void setLvl(String lvl) { - this.lvl = lvl; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMainpage() { - return mainpage; - } - - public void setMainpage(String mainpage) { - this.mainpage = mainpage; - } - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - public String getLayoutName() { - return layoutName; - } - - public void setLayoutName(String layoutName) { - this.layoutName = layoutName; - } - - public List getPlanLayout() { - return planLayout; - } - - public void setPlanLayout(List planLayout) { - this.planLayout = planLayout; - } - - public List getPlanInteraction() { - return planInteraction; - } - - public void setPlanInteraction(List planInteraction) { - this.planInteraction = planInteraction; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/PlanInteraction.java b/src/com/sipai/entity/visual/PlanInteraction.java deleted file mode 100644 index d7014eec..00000000 --- a/src/com/sipai/entity/visual/PlanInteraction.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.sipai.entity.visual; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.Camera; - -public class PlanInteraction extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String planId; - - private String interactionId; - - private String parameter; - - private Integer morder; - - private String btnclass; - - private String btnstyle; - - private String name; - - private String cameraId; - - private Interaction interaction; - - private Camera camera; - - private String parameterNames; - - private String methodCode; - - private List mPoint; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getInteractionId() { - return interactionId; - } - - public void setInteractionId(String interactionId) { - this.interactionId = interactionId; - } - - public String getParameter() { - return parameter; - } - - public void setParameter(String parameter) { - this.parameter = parameter; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getBtnclass() { - return btnclass; - } - - public void setBtnclass(String btnclass) { - this.btnclass = btnclass; - } - - public String getBtnstyle() { - return btnstyle; - } - - public void setBtnstyle(String btnstyle) { - this.btnstyle = btnstyle; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Interaction getInteraction() { - return interaction; - } - - public void setInteraction(Interaction interaction) { - this.interaction = interaction; - } - - public String getParameterNames() { - return parameterNames; - } - - public void setParameterNames(String parameterNames) { - this.parameterNames = parameterNames; - } - - public String getMethodCode() { - return methodCode; - } - - public void setMethodCode(String methodCode) { - this.methodCode = methodCode; - } - - public List getmPoint() { - return mPoint; - } - - public void setmPoint(List mPoint) { - this.mPoint = mPoint; - } - - public String getCameraId() { - return cameraId; - } - - public void setCameraId(String cameraId) { - this.cameraId = cameraId; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/PlanLayout.java b/src/com/sipai/entity/visual/PlanLayout.java deleted file mode 100644 index a321fb4b..00000000 --- a/src/com/sipai/entity/visual/PlanLayout.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.sipai.entity.visual; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.work.Camera; - - -public class PlanLayout extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String pid; - - private Integer morder; - - private String jspCode; - - private String jspName; - - private String height; - - private String width; - - private String planId; - - private String layoutId; - - private String dataType;//该方案布局元素所用哪个产线的数据 - - private String dataTypeName; - - private LayoutDetail layoutDetail; - - private List jspElement; - - private String CameraId; - - private Camera camera; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getJspCode() { - return jspCode; - } - - public void setJspCode(String jspCode) { - this.jspCode = jspCode; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getLayoutId() { - return layoutId; - } - - public void setLayoutId(String layoutId) { - this.layoutId = layoutId; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getJspName() { - return jspName; - } - - public void setJspName(String jspName) { - this.jspName = jspName; - } - - public LayoutDetail getLayoutDetail() { - return layoutDetail; - } - - public void setLayoutDetail(LayoutDetail layoutDetail) { - this.layoutDetail = layoutDetail; - } - - public List getJspElement() { - return jspElement; - } - - public void setJspElement(List jspElement) { - this.jspElement = jspElement; - } - - public String getCameraId() { - return CameraId; - } - - public void setCameraId(String cameraId) { - CameraId = cameraId; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - - public String getDataTypeName() { - return dataTypeName; - } - - public void setDataTypeName(String dataTypeName) { - this.dataTypeName = dataTypeName; - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height; - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/ProcessOperation.java b/src/com/sipai/entity/visual/ProcessOperation.java deleted file mode 100644 index 6fc751fa..00000000 --- a/src/com/sipai/entity/visual/ProcessOperation.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.visual; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ProcessOperation extends SQLAdapter { - - private String unitId; - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - private String id; - - private String dataModel; - - private String processUnit; - - private String manageProject; - - private Double manageActual; - - private Double manageTarget; - - private String manageUnit; - - private String manageEvaluate; - - private String costProject; - - private Double costActual; - - private Double costTarget; - - private String costUnit; - - private String costEvaluate; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataModel() { - return dataModel; - } - - public void setDataModel(String dataModel) { - this.dataModel = dataModel; - } - - public String getProcessUnit() { - return processUnit; - } - - public void setProcessUnit(String processUnit) { - this.processUnit = processUnit; - } - - public String getManageProject() { - return manageProject; - } - - public void setManageProject(String manageProject) { - this.manageProject = manageProject; - } - - public Double getManageActual() { - return manageActual; - } - - public void setManageActual(Double manageActual) { - this.manageActual = manageActual; - } - - public Double getManageTarget() { - return manageTarget; - } - - public void setManageTarget(Double manageTarget) { - this.manageTarget = manageTarget; - } - - public String getManageUnit() { - return manageUnit; - } - - public void setManageUnit(String manageUnit) { - this.manageUnit = manageUnit; - } - - public String getManageEvaluate() { - return manageEvaluate; - } - - public void setManageEvaluate(String manageEvaluate) { - this.manageEvaluate = manageEvaluate; - } - - public String getCostProject() { - return costProject; - } - - public void setCostProject(String costProject) { - this.costProject = costProject; - } - - public Double getCostActual() { - return costActual; - } - - public void setCostActual(Double costActual) { - this.costActual = costActual; - } - - public Double getCostTarget() { - return costTarget; - } - - public void setCostTarget(Double costTarget) { - this.costTarget = costTarget; - } - - public String getCostUnit() { - return costUnit; - } - - public void setCostUnit(String costUnit) { - this.costUnit = costUnit; - } - - public String getCostEvaluate() { - return costEvaluate; - } - - public void setCostEvaluate(String costEvaluate) { - this.costEvaluate = costEvaluate; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/VisualCacheConfig.java b/src/com/sipai/entity/visual/VisualCacheConfig.java deleted file mode 100644 index a711334b..00000000 --- a/src/com/sipai/entity/visual/VisualCacheConfig.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; - -public class VisualCacheConfig extends SQLAdapter{ - private String id; - - private String dataname; - - private String mpcode; - - private Double inivalue; - - private String active; - - private String unitid; - - private String bizname; - - private String type; - - private Integer morder; - - private String datatype; - - private String collectmode; - - private Integer numtail; - - private String unit; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataname() { - return dataname; - } - - public void setDataname(String dataname) { - this.dataname = dataname; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public Double getInivalue() { - return inivalue; - } - - public void setInivalue(Double inivalue) { - this.inivalue = inivalue; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getBizname() { - return bizname; - } - - public void setBizname(String bizname) { - this.bizname = bizname; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getDatatype() { - return datatype; - } - - public void setDatatype(String datatype) { - this.datatype = datatype; - } - - public String getCollectmode() { - return collectmode; - } - - public void setCollectmode(String collectmode) { - this.collectmode = collectmode; - } - - public Integer getNumtail() { - return numtail; - } - - public void setNumtail(Integer numtail) { - this.numtail = numtail; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/VisualCacheData.java b/src/com/sipai/entity/visual/VisualCacheData.java deleted file mode 100644 index ca6ba9d3..00000000 --- a/src/com/sipai/entity/visual/VisualCacheData.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.entity.visual; - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class VisualCacheData extends SQLAdapter{ - - private Double rate; - - public Double getRate() { - return rate; - } - - public void setRate(Double rate) { - this.rate = rate; - } - - private String datatype; - - private String timetype; - - private Integer numtail; - - private String unit; - - public String getDatatype() { - return datatype; - } - - public void setDatatype(String datatype) { - this.datatype = datatype; - } - - public String getTimetype() { - return timetype; - } - - public void setTimetype(String timetype) { - this.timetype = timetype; - } - - public Integer getNumtail() { - return numtail; - } - - public void setNumtail(Integer numtail) { - this.numtail = numtail; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - private String id; - - private String dataname; - - private String mpcode; - - private String emptyvalue;//空数据时赋�??- - - private Double value; - - private Double inivalue; - - private String active; - - private String insdt; - - private String unitid; - - private String bizname; - - private String type; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDataname() { - return dataname; - } - - public void setDataname(String dataname) { - this.dataname = dataname; - } - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public Double getInivalue() { - return inivalue; - } - - public void setInivalue(Double inivalue) { - this.inivalue = inivalue; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getBizname() { - return bizname; - } - - public void setBizname(String bizname) { - this.bizname = bizname; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getEmptyvalue() { - return emptyvalue; - } - - public void setEmptyvalue(String emptyvalue) { - this.emptyvalue = emptyvalue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/visual/VisualJsp.java b/src/com/sipai/entity/visual/VisualJsp.java deleted file mode 100644 index 0f1bfcd8..00000000 --- a/src/com/sipai/entity/visual/VisualJsp.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.entity.visual; - - -import com.sipai.entity.base.SQLAdapter; - -public class VisualJsp extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String jspCode; - - private String style; - - private String name; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getJspCode() { - return jspCode; - } - - public void setJspCode(String jspCode) { - this.jspCode = jspCode; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpEquipment.java b/src/com/sipai/entity/whp/baseinfo/WhpEquipment.java deleted file mode 100644 index d8c1b20d..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpEquipment.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; - -/** - * 设备信息 - * - * @Author: 李晨 - * @Date: 2023/1/8 - **/ -@EqualsAndHashCode(callSuper = true) -@Data -public class WhpEquipment extends SQLAdapter implements Serializable { - /** - * 主键 - */ - private String id; - /** - * 仪器名称 - */ - private String name; - /** - * 唯一标识码 - */ - private String code; - /** - * 存放地点 - */ - private String address; - /** - * 状态 - */ - private Integer status; - /** - * 厂家 - */ - private String manufacturer; - /** - * 型号 - */ - private String model; - /** - * 规格 - */ - private String specification; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpEquipmentQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpEquipmentQuery.java deleted file mode 100644 index 4c50f990..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpEquipmentQuery.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - - -import lombok.Data; - -/** - * 采样类型查询条件 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpEquipmentQuery { - - /** - * 存放地点 - */ - private String address; - /** - * 状态 - */ - private Integer status; - /** - * 模糊查询 - */ - private String likeString; -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpEquipmentVo.java b/src/com/sipai/entity/whp/baseinfo/WhpEquipmentVo.java deleted file mode 100644 index 8e3398ef..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpEquipmentVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 设备 页面展示 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ -@EqualsAndHashCode(callSuper = true) -@Data -public class WhpEquipmentVo extends WhpEquipment { - - /** - * 状态名称 - */ - private String statusName; - -} \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrg.java b/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrg.java deleted file mode 100644 index f297dd13..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrg.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.io.Serializable; - -@Data -public class WhpLiquidWasteDisposeOrg extends SQLAdapter implements Serializable { - - /** - * 主键 - */ - private String id; - /** - * 机构名称 - */ - private String name; - /** - * 机构地址 - */ - private String address; - /** - * 机构联系人 - */ - private String contactPerson; - /** - * 机构电话 - */ - private String contactPhone; - /** - * 状态 - */ - private Integer status; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrgQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrgQuery.java deleted file mode 100644 index e13e7fe1..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrgQuery.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -@Data -public class WhpLiquidWasteDisposeOrgQuery { - - private Integer status; - - private String likeString; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrgVo.java b/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrgVo.java deleted file mode 100644 index 9bba2c34..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpLiquidWasteDisposeOrgVo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -@Data -public class WhpLiquidWasteDisposeOrgVo extends WhpLiquidWasteDisposeOrg { - - private String statusName; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeType.java b/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeType.java deleted file mode 100644 index 299f8ac0..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeType.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.io.Serializable; - -/** - * 余样处置方式 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ -@Data -public class WhpResidualSampleDisposeType extends SQLAdapter implements Serializable { - - /** - * 主键 - */ - private String id; - /** - * 处置方式名称 - */ - private String name; - /** - * 备注 - */ - private String remark; - /** - * 状态 - */ - private Integer status; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeTypeQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeTypeQuery.java deleted file mode 100644 index e01821ee..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeTypeQuery.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - - -import lombok.Data; - -/** - * 余样处置方式查询条件 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ -@Data -public class WhpResidualSampleDisposeTypeQuery { - - /** - * 状态 - */ - private Integer status; - /** - * 模糊查询 - */ - private String likeString; -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeTypeVo.java b/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeTypeVo.java deleted file mode 100644 index eb4fa1a0..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpResidualSampleDisposeTypeVo.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -/** - * 余样处置方式 - * - * @Author: 李晨 - * @Date: 2022/12/19 - **/ -@Data -public class WhpResidualSampleDisposeTypeVo extends WhpResidualSampleDisposeType { - - /** - * 状态名称 - */ - private String statusName; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpSampleCode.java b/src/com/sipai/entity/whp/baseinfo/WhpSampleCode.java deleted file mode 100644 index 51cb19cb..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpSampleCode.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import afu.org.checkerframework.checker.oigj.qual.O; -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.enums.EnumJsonObject; -import lombok.Data; - -import java.io.Serializable; - -/** - * 采样编码 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpSampleCode extends SQLAdapter implements Serializable { - - /** - * 主键 - */ - private String id; - /** - * 样品类型id - */ - private String typeId; - /** - * 前缀 - */ - private String prefix; - /** - * 地点 - */ - private String address; - /** - * 地点编号(顺序号) - */ - private String addressCode; - /** - * 检测项目ids - */ - private String testItemIds; - - /** - * 部门ids - */ - private String deptIds; - - /** - * 部门名称s - */ - private String deptNames; - - /** - * 状态 - */ - private Integer status; - - /** - * 是否检测 - */ - private Boolean isTest; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpSampleCodeQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpSampleCodeQuery.java deleted file mode 100644 index bab902f9..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpSampleCodeQuery.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - - -import lombok.Data; - -/** - * 采样编码查询条件 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpSampleCodeQuery { - - /** - * 样品类型id - */ - private String typeId; - /** - * 状态 - */ - private Integer status; - /** - * 模糊查询 - */ - private String likeString; -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpSampleCodeVo.java b/src/com/sipai/entity/whp/baseinfo/WhpSampleCodeVo.java deleted file mode 100644 index eff969e7..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpSampleCodeVo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -/** - * 页面展示 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpSampleCodeVo extends WhpSampleCode { - /** - * 检测项目名称 - */ - private String testItemNames; - /** - * 样品类型名称 - */ - private String sampleTypeName; - - /** - * 状态名称 - */ - private String statusName; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpSampleType.java b/src/com/sipai/entity/whp/baseinfo/WhpSampleType.java deleted file mode 100644 index b2f29856..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpSampleType.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import org.checkerframework.checker.units.qual.Length; -import org.springframework.validation.annotation.Validated; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 采样类型 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpSampleType extends SQLAdapter implements Serializable { - - /** - * 主键 - */ - private String id; - /** - * 采样类型名称 - */ - private String name; - /** - * 编码简称 - */ - private String code; - /** - * 采样车间ids - */ - private String deptIds; - /** - * 采样车间名称 - */ - private String deptNames; - /** - * 状态 - */ - private Integer status; - - /** - * 采样周期 - */ - private Integer amplingPeriod; - - /** - * 间隔天 - */ - private String intervalDay; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpSampleTypeQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpSampleTypeQuery.java deleted file mode 100644 index ca174669..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpSampleTypeQuery.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - - -import lombok.Data; - -/** - * 采样类型查询条件 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpSampleTypeQuery { - - /** - * 状态 - */ - private Integer status; - - /** - * 模糊查询 - */ - private String likeString; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpSampleTypeVo.java b/src/com/sipai/entity/whp/baseinfo/WhpSampleTypeVo.java deleted file mode 100644 index d85d5489..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpSampleTypeVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - - -import lombok.Data; - -/** - * 页面展示 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpSampleTypeVo extends WhpSampleType { - /** - * 状态名称 - */ - private String statusName; - - - /** - * 采样周期描述 - */ - private String amplingPeriodName; -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestItem.java b/src/com/sipai/entity/whp/baseinfo/WhpTestItem.java deleted file mode 100644 index 15be49d8..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestItem.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; - -/** - * 检测项目 - * - * @Author: 李晨 - * @Date: 2023/1/5 - **/ -@EqualsAndHashCode(callSuper = true) -@Data -public class WhpTestItem extends SQLAdapter implements Serializable { - /** - * 主键 - */ - private String id; - /** - * 检测项目名称 - */ - private String name; - /** - * 仪器设备ids - */ - private String equipmentId; - /** - * 检测部门ids - */ - private String deptIds; - /** - * 状态 - */ - private Integer status; - /** - * 检测部门names - */ - private String deptNames; - /** - * 检测复核人id - */ - private String confirmUserId; - /** - * 检测复核人姓名 - */ - private String confirmUserName; - /** - * 测定地点 - */ - private String testAddress; - - /** - * 使用试剂 - */ - private String reagent; - - private String bizId; - - private Company company; - - // 保存检测任务的时候 暂用 - private String samplingDate; - - private String assayItemId; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestItemQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpTestItemQuery.java deleted file mode 100644 index c80ac62f..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestItemQuery.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - - -import lombok.Data; -import org.apache.commons.lang3.StringUtils; - -/** - * 检测项目查询条件 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpTestItemQuery { - - /** - * 检测部门ids - */ - private String deptIds; - - /** - * 处理检测部门 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ - public void setDeptIdsCondition() { - if (deptIds == null || deptIds.length() == 0) { - this.deptIdsCondition = StringUtils.EMPTY; - } else { - String condition = StringUtils.EMPTY; - for (String deptId : deptIds.split(",")) { - condition += " dept_ids like '%" + deptId + "%' or"; - } - condition = condition.substring(0, condition.length() - 2); - condition = " (" + condition + ")"; - this.deptIdsCondition = condition; - } - } - - private String deptIdsCondition; - - /** - * 状态 - */ - private Integer status; - /** - * 模糊查询 - */ - private String likeString; -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestItemVo.java b/src/com/sipai/entity/whp/baseinfo/WhpTestItemVo.java deleted file mode 100644 index 55ae51b5..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestItemVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -import java.util.List; - -/** - * 页面展示 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Data -public class WhpTestItemVo extends WhpTestItem { - /** - * 工作曲线 - */ - private String workingCurveStr; - /** - * 设备名称 - */ - private String equipmentName; - /** - * 状态名称 - */ - private String statusName; - - /** - * 项目组下的 曲线及常量 基础描述 - */ - private List testItemWorkingCurveList; - - - - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurve.java b/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurve.java deleted file mode 100644 index 42c4da7e..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurve.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.baseinfo; import com.fasterxml.jackson.annotation.JsonFormat; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import org.codehaus.jackson.map.annotate.JsonSerialize; import org.codehaus.jackson.map.ser.std.ToStringSerializer; import java.io.Serializable; import java.math.BigDecimal; /** * 方法依据 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTestItemWorkingCurve extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 检测项目id */ private String test_item_id; /** * 监测点id */ private String kpi_id; /** * 公式类型 0 基础描述 1 常量 2 过程公式 3 结果公式 */ private String formulatype; /** * 计算顺序 */ private String sort; /** * 默认值 */ // @JsonFormat(shape = JsonFormat.Shape.STRING) private String default_value; /** * 名称(基础描述) */ private String name; /** * 单位(基础描述 选填) */ private String unit; private String bizId; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurveQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurveQuery.java deleted file mode 100644 index 3fd9f315..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurveQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.baseinfo; import lombok.Data; import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; /** * 方法依据查询条件 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTestItemWorkingCurveQuery { /** * 主键 */ private String id; /** * 检测项目id */ private String test_item_id; /** * 监测点id */ private String kpi_id; /** * 公式类型 0 基础描述 1 常量 2 过程公式 3 结果公式 */ private String formulatype; /** * 计算顺序 */ private String sort; /** * 默认值 */ private BigDecimal default_value; /** * 名称(基础描述) */ private String name; /** * 单位(基础描述 选填) */ private String unit; /** * 模糊查询 */ private String likeString; private String bizId; /** * 处理检测部门 * * @Author: lichen * @Date: 2022/12/16 **/ public void setformulatype() { if (formulatype == null || formulatype.length() == 0) { this.formulatype = StringUtils.EMPTY; } else { String condition = StringUtils.EMPTY; for (String ftype : formulatype.split(",")) { condition += " formulatype like '%" + ftype + "%' or"; } condition = condition.substring(0, condition.length() - 2); condition = " (" + condition + ")"; this.formulatype = condition; } } } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurveVo.java b/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurveVo.java deleted file mode 100644 index 4b845970..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestItemWorkingCurveVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.baseinfo; import com.sipai.entity.scada.MPoint; import lombok.Data; /** * 页面展示 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTestItemWorkingCurveVo extends WhpTestItemWorkingCurve { private MPoint mPoint; public MPoint getMPoint() { return mPoint; } public void setMPoint(MPoint mPoint) { this.mPoint = mPoint; } private String FormulaName; private String taskitemCureid; private String defaultValue; private String workingCurveId; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestMethod.java b/src/com/sipai/entity/whp/baseinfo/WhpTestMethod.java deleted file mode 100644 index f3dfb3b3..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestMethod.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.baseinfo; import com.sipai.entity.base.SQLAdapter; import com.sipai.entity.user.Company; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; /** * 方法依据 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTestMethod extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 检测项目id */ private String testItem_id; /** * 方法依据 */ private String methodBasis; /** * 启用时间 */ private String startDate; /** * 状态 */ private Integer status; /** * 顺序 */ private Integer sortNum; /** * 工厂id */ private String bizId; private Company company; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestMethodQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpTestMethodQuery.java deleted file mode 100644 index 9bb047ad..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestMethodQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.baseinfo; import lombok.Data; import org.apache.commons.lang3.StringUtils; /** * 方法依据查询条件 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTestMethodQuery { /** * 主键 */ private String id; /** * 检测项目id */ private String testItem_id; /** * 方法依据 */ private String methodBasis; /** * 启用时间 */ private String startDate; /** * 状态 */ private Integer status; /** * 顺序 */ private Integer sortNum; /** * 模糊查询 */ private String likeString; /** * 厂 id */ private String bizId; // public void setTestItem_id(String testItem_id) { // if (testItem_id == null || testItem_id.length() == 0) { // this.testItem_id = StringUtils.EMPTY; // } else { // String condition = StringUtils.EMPTY; // for (String deptId : testItem_id.split(",")) { // condition += " test_Item_id like '%" + deptId + "%' or"; // } // condition = condition.substring(0, condition.length() - 2); // condition = " (" + condition + ")"; // this.testItem_id = condition; // } // } } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestMethodVo.java b/src/com/sipai/entity/whp/baseinfo/WhpTestMethodVo.java deleted file mode 100644 index 44a3efa9..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestMethodVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.baseinfo; import lombok.Data; /** * 页面展示 * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTestMethodVo extends WhpTestMethod { /** * 状态名称 */ private String statusName; /** * 项目名称 */ private String testItemNames; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestOrg.java b/src/com/sipai/entity/whp/baseinfo/WhpTestOrg.java deleted file mode 100644 index f3a27af0..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestOrg.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.io.Serializable; - -@Data -public class WhpTestOrg extends SQLAdapter implements Serializable { - - /** - * 主键 - */ - private String id; - /** - * 机构名称 - */ - private String name; - /** - * 机构地址 - */ - private String address; - /** - * 机构联系人 - */ - private String contactPerson; - /** - * 机构电话 - */ - private String contactPhone; - /** - * 状态 - */ - private Integer status; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestOrgQuery.java b/src/com/sipai/entity/whp/baseinfo/WhpTestOrgQuery.java deleted file mode 100644 index 97987f48..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestOrgQuery.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -@Data -public class WhpTestOrgQuery { - - private Integer status; - - private String likeString; - -} diff --git a/src/com/sipai/entity/whp/baseinfo/WhpTestOrgVo.java b/src/com/sipai/entity/whp/baseinfo/WhpTestOrgVo.java deleted file mode 100644 index 14e86d07..00000000 --- a/src/com/sipai/entity/whp/baseinfo/WhpTestOrgVo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.sipai.entity.whp.baseinfo; - -import lombok.Data; - -@Data -public class WhpTestOrgVo extends WhpLiquidWasteDisposeOrg { - - private String statusName; - -} diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDispose.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDispose.java deleted file mode 100644 index a33c3fa8..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDispose.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import org.apache.axis2.databinding.types.soapencoding.Decimal; import java.io.Serializable; import java.math.BigDecimal; /** * 余样处置方式 * * @Author: 李晨 * @Date: 2022/12/20 **/ @Data public class WhpLiquidWasteDispose extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 废液代码及名称 */ private Integer liquidWasteType; /** * 入库日期 */ private String inputTime; /** * 废物来源 */ private String source; /** * 数量 */ private BigDecimal number; /** * 容器材质 */ private String containerType; /** * 容量 */ private String capacity; /** * 废物存放位置 */ private String location; /** * 废物运送经办人id */ private String transportUserId; /** * 登记人id */ private String createUserId; /** * 登记人姓名 */ private String createUserName; /** * 废物运送经办人名称 */ private String transportUserName; /** * 废物贮存经办人id */ private String repositionUserId; /** * 废物贮存经办人名称 */ private String repositionUserName; /** * 状态 */ private Integer status; /** * 转移日期 */ private String ouputDate; /** * 废物转移经办人id */ private String outputUserId; /** * 废物转移经办人名称 */ private String outputUserName; /** * 登记时间 */ private String createTime; /** * 废物贮存经办人id */ private String outputRepositionUserId; /** * 废物贮存经办人名称 */ private String outputRepositionUserName; /** * 废物去向 */ private String outputLocation; /** * 目前登记容量 */ private BigDecimal currentNumber; /** * 上次 登记容量 */ private BigDecimal lastNumber; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeExportDetail.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeExportDetail.java deleted file mode 100644 index 993bb93c..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeExportDetail.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import java.io.Serializable; /** * 余样处置方式 * * @Author: 李晨 * @Date: 2022/12/20 **/ @Data public class WhpLiquidWasteDisposeExportDetail { /** * 废液代码及名称 */ private String liquidWasteTypeName; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLog.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLog.java deleted file mode 100644 index 068b5d7e..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLog.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; /** * 方法依据 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpLiquidWasteDisposeLog extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 登记人id */ private String createUserId; /** * 登记人姓名 */ private String createUserName; /** * 登记时间 */ private String createTime; /** * 目前登记容量 */ private Integer currentNumber; /** * 上次登记容量 */ private Integer lastNumber; /** * 登记处置id */ private String disposeId; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogQuery.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogQuery.java deleted file mode 100644 index 8a5cd749..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import lombok.Data; /** * 方法依据查询条件 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpLiquidWasteDisposeLogQuery { /** * 主键 */ private String id; /** * 登记人id */ private String createUserId; /** * 登记人姓名 */ private String createUserName; /** * 登记时间 */ private String createTime; /** * 目前登记容量 */ private Integer currentNumber; /** * 上次登记容量 */ private Integer lastNumber; /** * 登记处置id */ private String disposeId; /** * 模糊查询 */ private String likeString; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogVo.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogVo.java deleted file mode 100644 index 31b78068..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import lombok.Data; /** * 页面展示 * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpLiquidWasteDisposeLogVo extends WhpLiquidWasteDisposeLog { } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeQuery.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeQuery.java deleted file mode 100644 index f6e731e3..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import lombok.Data; import lombok.Getter; import lombok.Setter; /** * 余样处置方式查询条件 * * @Author: 李晨 * @Date: 2022/12/20 **/ @Data public class WhpLiquidWasteDisposeQuery { private String timeRangeBegin; private String timeRangeEnd; @Getter private String timeRange; public void setTimeRange(String timeRange) { this.timeRange = timeRange; this.timeRangeBegin = this.timeRange.split(" ~ ")[0]; this.timeRangeEnd = this.timeRange.split(" ~ ")[1]; } /** * 废液代码及名称 */ private Integer liquidWasteType; /** * 状态 */ private Integer status; /** * 模糊查询 */ private String likeString; private String ids; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeVo.java b/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeVo.java deleted file mode 100644 index e2771815..00000000 --- a/src/com/sipai/entity/whp/liquidWasteDispose/WhpLiquidWasteDisposeVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.liquidWasteDispose; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** * 页面展示 * * @Author: 李晨 * @Date: 2022/12/20 **/ @EqualsAndHashCode(callSuper = true) @Data public class WhpLiquidWasteDisposeVo extends WhpLiquidWasteDispose { /** * 废液代码及名称 */ private String liquidWasteTypeName; /** * 状态名称 */ private String statusName; /** * 转移数量 */ private BigDecimal outputNumber; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/plan/WhpSamplingPlan.java b/src/com/sipai/entity/whp/plan/WhpSamplingPlan.java deleted file mode 100644 index 0c0242b6..00000000 --- a/src/com/sipai/entity/whp/plan/WhpSamplingPlan.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.entity.whp.plan; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.activiti.engine.impl.event.logger.DatabaseEventFlusher; - -import java.io.Serializable; -import java.util.List; - -/** - * 采样计划 - * - * @Author: 李晨 - * @Date: 2023/1/8 - **/ -@EqualsAndHashCode(callSuper = true) -@Data -public class WhpSamplingPlan extends SQLAdapter implements Serializable { - /** - * 主键 - */ - private String id; - /** - * 采样单编号 - */ - private String code; - /** - * 计划采样时间 - */ - private String date; - /** - * 采样类型id - */ - private String sampleTypeId; - /** - * 要求报告日期 - */ - private String reportDate; - /** - * 计划状态 - */ - private Integer status; - /** - * 采样车间id - */ - private String deptIds; - /** - * 采样车间名称 - */ - private String deptNames; - /** - * 采样类型名称 - */ - private String sampleTypeName; - /** - * 检验审核人id - */ - private String auditUserId; - /** - * 检验审核人name - */ - private String auditUserName; - /** - * 收样人id - */ - private String acceptUserId; - /** - * 收样人name - */ - private String acceptUserName; - /** - * 收样日期 - */ - private String acceptDate; - /** - * 审核时间 - */ - private String auditTime; - /** - * 审核意见 - */ - private String auditAdvice; - /** - * 外送样机构id - */ - private String testOrgId; - - /** - * 是否 自动 下发采样计划 - */ - private Integer isAutoPlan; - - /** - * 自动下发截止日期 - */ - private String autoplanEndDate; - - - /** - * 计划类型 - */ - private Integer playType; - - /** - * 创建人 - */ - private String createUserId; - - /** - * 是否同步 - */ - private String isSync; - - /** - * 同步数据PlanTask - */ - private List plantask; - -} - diff --git a/src/com/sipai/entity/whp/plan/WhpSamplingPlanQuery.java b/src/com/sipai/entity/whp/plan/WhpSamplingPlanQuery.java deleted file mode 100644 index 5972b4ba..00000000 --- a/src/com/sipai/entity/whp/plan/WhpSamplingPlanQuery.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.entity.whp.plan; - -import lombok.Data; - -/** - * 采样计划 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ -@Data -public class WhpSamplingPlanQuery { - - /** - * 采样类型 - */ - private String sampleTypeId; - /** - * 计划状态 - */ - private Integer status; - /** - * 要求报告日期开始 - */ - private String reportDateBegin; - /** - * 要求报告日期结束 - */ - private String reportDateEnd; - - /** - * 计划采样时间开始 - */ - private String dateBegin; - - /** - * 计划采样时间结束 - */ - private String dateEnd; - - private String userId; - - /** - * 是否自动下发 0否1是 - */ - private String isAutoPlan; - - - /** - * 排序方式 - */ - private String sortOrder; - /** - * 排序名称 - */ - private String sortName; - - /** - * 计划类型 - */ - private Integer playType; - - /** - * 创建人 - */ - private String createUserId; - - - -} - diff --git a/src/com/sipai/entity/whp/plan/WhpSamplingPlanTask.java b/src/com/sipai/entity/whp/plan/WhpSamplingPlanTask.java deleted file mode 100644 index e483cda7..00000000 --- a/src/com/sipai/entity/whp/plan/WhpSamplingPlanTask.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.plan; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.math.BigDecimal; /** * 采样任务 * * @Author: 李晨 * @Date: 2023/1/8 **/ @EqualsAndHashCode(callSuper = true) @Data public class WhpSamplingPlanTask extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 采样计划id */ private String planId; /** * 采样单编号 */ private String planCode; /** * 地址 */ private String sampleAddress; /** * 是否检测 */ private Boolean isTest; /** * 检测项目 */ private String testItemIds; /** * 状态 */ private Integer status; /** * 样品编号 */ private String sampleCode; /** * 采样时间 */ private String samplingTime; /** * 采样人id */ private String samplingUserId; /** * 采样人姓名 */ private String samplingUserName; /** * 检测项目备选项 */ private String testItemJson; /** * 计划采样日期 */ private String planDate; /** * 采样类型id */ private String sampleTypeId; /** * 采样类型名称 */ private String sampleTypeName; /** * 要求报告日期 */ private String reportDate; /** * 采样现场情况 */ private Integer samplingEnv; /** * 样品外观 */ private Integer sampleAppearance; /** * 样品状态 */ private Integer sampleState; /** * 样品数量 */ private Integer sampleAmount; /** * 剩余样品数量 */ private BigDecimal residualSampleAmount; /** * 余样单位 */ private String unit; /** * 登记人id */ private String recordUserId; /** * 登记人姓名 */ private String recordUserName; /** * 处置方式id */ private String disposeTypeId; /** * 处置方式名称 */ private String disposeTypeName; /** * 处置时间 */ private String disposeTime; /** * 余样审核人id */ private String auditUserId; /** * 余样审核人姓名 */ private String auditUserName; /** * 余样状态 */ private Integer disposeStatus; /** * 余样审核时间 */ private String auditTime; /** * 接单人 */ private String receiverUserId; /** * 样品上清液 */ private Integer sampleSupernatant; /** * 样品性质 */ private Integer sampleNature; private Integer isSample; private String notes; /** * 平行飞样状态 */ private String pxfySt; private String assayItemIdarr; /** * testItem表name */ private String itemname; private String ord; /** * 采样车间ids */ private String deptIds; /** * 采样车间名称s */ private String deptNames; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/plan/WhpSamplingPlanTaskQuery.java b/src/com/sipai/entity/whp/plan/WhpSamplingPlanTaskQuery.java deleted file mode 100644 index f3096479..00000000 --- a/src/com/sipai/entity/whp/plan/WhpSamplingPlanTaskQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.plan; import lombok.Data; /** * 采样任务查询条件 * * @Author: 李晨 * @Date: 2022/12/30 **/ @Data public class WhpSamplingPlanTaskQuery { /** * 状态 */ private Integer status; /** * 地址 */ private String sampleAddress; /** * 采样人id */ private String samplingUserId; /** * 计划采样日期 */ private String planDateBegin; /** * 计划采样日期 */ private String planDateEnd; /** * 采样计划id */ private String planId; /** * 采样单编号 */ private String planCode; /** * 采样类型id */ private String sampleTypeId; /** * 采样时间 */ private String samplingTimeBegin; /** * 采样时间 */ private String samplingTimeEnd; /** * 要求报告日期 */ private String reportDateBegin; /** * 要求报告日期 */ private String reportDateEnd; /** * 处置时间 */ private String disposeTimeBegin; /** * 处置时间 */ private String disposeTimeEnd; /** * 余样处置状态 */ private Integer disposeStatus; /** * 样品状态 */ private Integer sampleState; /** * 处置类型id */ private String disposeTypeId; /** * 模糊查询 */ private String likeString; /** * 接单人 */ private String receiverUserId; /** * 检测部门 */ private String deptId; private String planType; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/plan/WhpSamplingPlanTaskVo.java b/src/com/sipai/entity/whp/plan/WhpSamplingPlanTaskVo.java deleted file mode 100644 index 0ba9f72d..00000000 --- a/src/com/sipai/entity/whp/plan/WhpSamplingPlanTaskVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.plan; import lombok.Data; /** * 页面展示 * * @Author: 李晨 * @Date: 2022/12/30 **/ @Data public class WhpSamplingPlanTaskVo extends WhpSamplingPlanTask { /** * 状态名称 */ private String statusName; /** * 外观名称 */ private String sampleAppearanceName; /** * 状态名称 */ private String sampleStateName; /** * 现场采样情况 */ private String samplingCondition; /** * 样品处置状态名称 */ private String disposeStatusName; /** * 检测项目名称 */ private String testItemNames; /** * 样品性质 */ private String sampleNatureName; /** * 上清液 */ private String smpleSupernatantName; /** * 采样车间 */ private String deptNames; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/plan/WhpSamplingPlanVo.java b/src/com/sipai/entity/whp/plan/WhpSamplingPlanVo.java deleted file mode 100644 index d6930573..00000000 --- a/src/com/sipai/entity/whp/plan/WhpSamplingPlanVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.entity.whp.plan; - -import lombok.Data; - -/** - * 页面展示 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ -@Data -public class WhpSamplingPlanVo extends WhpSamplingPlan { - /** - * 状态名称 - */ - private String statusName; - /** - * 采样任务数 - */ - private Integer taskNumber; - - /** - * 间隔 名称 - */ - private String samplingPeriodName; - /** - * 间隔 编码 - */ - private Integer samplingPeriodCode; - - /** - * 间隔时间 - */ - private String intervalDay; -} - diff --git a/src/com/sipai/entity/whp/test/Intorecord.java b/src/com/sipai/entity/whp/test/Intorecord.java deleted file mode 100644 index bccbb5c7..00000000 --- a/src/com/sipai/entity/whp/test/Intorecord.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.whp.test; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Intorecord { - private String id;//为主键 - private String type;//为检测类型,需要区分 - private String place;//为测定地点 - private String temperature;//为室温 - private String assaydt;//为测定日期 - private String average;//为平均值 - private String diff;//相对偏差,目前都为null - private String formula;//工作曲线 - private String instrument;//仪器编号 - private String methods;//方法依据 - private String assayuser;//测定人员中文名字 - private String checkuser;//复核人员中文名字 - private String chargeuser;//负责人中文名字 - private String remark;//备注 - private String insuser;//新增人 - private String insdt;//新增日期 - private String sampdt;//采样日期 - private String status;//状态,默认是0 - private String m1;//“2”有数据 - private String v0h;//“2”有数据 - private String v1;//“2”有数据 - private String vh;//“2”有数据 - private String cEDTA;//“30”有数据 - private String v0;//“30”有数据 - private String htemp;//干燥温度 - private float vaccinate;// - private String blank;//空白值,”16”有数据 - private String molL;//CNaOH(mol/L) - private String blankval;//空白V1(mL) - private String average1;// - private String diff1; - private String average2;// - private String average3;// - private String average4;// - private String diff2;// - private String diff3;// - private String diff4;// - private String avg1;// - private String avg2;// - private String avg3;// - private String liquid;//溶液名称 - private ArrayList intorecordchild;//为子表 - private ArrayList recorddetcl;//为常量 -} diff --git a/src/com/sipai/entity/whp/test/Intorecordchild.java b/src/com/sipai/entity/whp/test/Intorecordchild.java deleted file mode 100644 index 97a5eb02..00000000 --- a/src/com/sipai/entity/whp/test/Intorecordchild.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.entity.whp.test; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Intorecordchild { - - private String serial;//为编号, - private String dt;//为测量点日期 - private float ord;//为顺序号,-后面去除数值标识的那部分 - private ArrayList recorddet;//为数据子表对象(非常量) - private ArrayList recorddetcl;//为数据子表对象(常量部分) - -} diff --git a/src/com/sipai/entity/whp/test/Recorddet.java b/src/com/sipai/entity/whp/test/Recorddet.java deleted file mode 100644 index 0f42358e..00000000 --- a/src/com/sipai/entity/whp/test/Recorddet.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.entity.whp.test; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Recorddet { - - private String mpointid;//类型为变量为测量点id,如果为基础描述,为'' - private String parmvalue;//为测量点数值,要求新系统根据精确要求传String类型 - private String fieldname;//如果类型为基础描述,为基础描述名字,否则为'' - private String variabletype;//分基础描述和变量 - -} diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirm.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirm.java deleted file mode 100644 index d1f9d396..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirm.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.List; /** * 计划单检测项目记录 * * @Author: 李晨 * @Date: 2023/1/5 **/ @EqualsAndHashCode(callSuper = true) @Data public class WhpSamplingPlanTaskTestConfirm extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 采样单id */ private String planId; /** * 采样单编号 */ private String planCode; /** * 采样类型id */ private String sampleTypeId; /** * 采样类型名称 */ private String sampleTypeName; /** * 复核人id */ private String confirmUserId; /** * 复核人姓名 */ private String confirmUserName; /** * 复核日期 */ private String confirmDate; /** * 复核状态 */ private Integer status; /** * 检测人员id */ private String testUserId; /** * 检测人员姓名 */ private String testUserName; /** * 检测项目id */ private String testItemId; /** * 检测项目名称 */ private String testItemName; /** * 室温 */ private Integer temperature; /** * 使用试剂 */ private String reagent; /** * 测定日期 */ private String testDate; /** * 仪器id */ private String equipmentId; /** * 仪器名称 */ private String equipmentName; /** * 仪器编号 */ private String equipmentCode; /** * 测定地点 */ private String testAddress; /** * 方法依据 */ private String method; /** * 工作曲线id */ private String workCurveId; /** * 工作曲线名称 */ private String workCurveName; /** * 采样日期 */ private String samplingDate; /** * 要求报告日期 */ private String reportDate; /** * 计划采样日期 */ private String planDate; /** * 复核意见 */ private String confirmAdvice; /** * 是否同步 */ private String isSync; /** * 采样任务类型常量 样品 */ private List intorecordchild; /** * 采样任务类型其他 样品 */ private List other; /** * 样品信息(常量) */ private List recorddetcl; /** * type */ private String type; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmListVo.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmListVo.java deleted file mode 100644 index 78c90c27..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmListVo.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.entity.whp.test; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class WhpSamplingPlanTaskTestConfirmListVo { - - private String planCode; - - private List whpSamplingPlanTaskTestConfirmList; - -} diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmQuery.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmQuery.java deleted file mode 100644 index 80f5c390..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import lombok.Data; /** * 计划单检测项目分组信息查询条件 * * @Author: 李晨 * @Date: 2023/1/5 **/ @Data public class WhpSamplingPlanTaskTestConfirmQuery { /** * 部门id用于检测项目树的权限查询 */ private String deptId; /** * 采样类型id */ private String sampleTypeId; /** * 采样时间 */ private String planDateBegin; /** * 采样时间 */ private String planDateEnd; /** * 要求报告日期 */ private String reportDateBegin; /** * 要求报告日期 */ private String reportDateEnd; /** * 状态 */ private Integer status; /** * 检测人员 */ private String testUserId; /** * 复核人id */ private String confirmUserId; /** * 检测项目名称 */ private String testItemName; /** * 检测项目id */ private String testItemId; /** * 模糊查询 */ private String likeString; /** * 是否预警 */ private String Iswarning; /** * 状态类型 1 复核列表 */ private Integer statustype; /** * 部门刷选 */ private String testItemIds; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmVo.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmVo.java deleted file mode 100644 index f596e069..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestConfirmVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveVo; import lombok.Data; import java.util.List; /** * 页面展示 * * @Author: 李晨 * @Date: 2023/1/5 **/ @Data public class WhpSamplingPlanTaskTestConfirmVo extends WhpSamplingPlanTaskTestConfirm { /** * 状态名称 */ private String statusName; /** * 样品任务数量 */ private Integer samplingTaskNumber; private List contantworkingCurveVoslist; private List contantCurvelist; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItem.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItem.java deleted file mode 100644 index 723550d7..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItem.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; /** * 计划单检测项目记录 * * @Author: 李晨 * @Date: 2023/1/5 **/ @EqualsAndHashCode(callSuper = true) @Data public class WhpSamplingPlanTaskTestItem extends SQLAdapter implements Serializable { /** * 主键 */ private String id; /** * 采样单id */ private String planId; /** * 采样单编号 */ private String planCode; /** * 采样类型id */ private String sampleTypeId; /** * 采样类型名称 */ private String sampleTypeName; /** * 计划采样日期 */ private String planDate; /** * 要求报告日期 */ private String reportDate; /** * 采样日期 */ private String sampingDate; /** * 检测任务状态 */ private Integer status; /** * 复核结果id */ private String testConfirmId; /** * 样品编号 */ private String sampleCode; /** * 取样数量 */ private Integer useAmount; /** * 取样单位 */ private String unit; /** * 容器编号 */ private String containerCode; /** * 容器重量第一次 */ private BigDecimal containerWeightFirst; /** * 容器重量第二次 */ private BigDecimal containerWeightSecond; /** * 容器重量最终 */ private BigDecimal containerWeightFinal; /** * 容器+被测物重量第一次 */ private BigDecimal allWeightFirst; /** * 容器+被测物重量第二次 */ private BigDecimal allWeightSecond; /** * 容器+被测物重量最终 */ private BigDecimal allWeightFinal; /** * 差值 */ private BigDecimal diffValue; /** * 结果 */ private BigDecimal resultValue; /** * 检测项目id */ private String testItemId; /** * 检测项目名称 */ private String testItemName; /** * 是否已检测完 2023/8/3 */ private int detected; /** * 平行飞样状态 */ private String pxfySt; /** * 样品信息(非常量) */ private List recorddetel; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItemQuery.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItemQuery.java deleted file mode 100644 index 5ab6e789..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItemQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import lombok.Data; /** * 计划单检测项目记录查询条件 * * @Author: 李晨 * @Date: 2023/1/5 **/ @Data public class WhpSamplingPlanTaskTestItemQuery { /** * 样品类型id */ private String sampleTypeId; /** * 采样单id */ private String planId; /** * 检测任务状态 */ private Integer status; /** * 复核结果id */ private String testConfirmId; /** * 采样时间 */ private String planDateBegin; /** * 采样时间 */ private String planDateEnd; /** * 要求报告日期 */ private String reportDateBegin; /** * 要求报告日期 */ private String reportDateEnd; /** * 模糊查询 */ private String likeString; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItemVo.java b/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItemVo.java deleted file mode 100644 index 4142a519..00000000 --- a/src/com/sipai/entity/whp/test/WhpSamplingPlanTaskTestItemVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import com.sipai.entity.scada.MPoint; import lombok.Data; import lombok.EqualsAndHashCode; import java.util.List; /** * 页面展示 * * @Author: 李晨 * @Date: 2023/1/5 **/ @EqualsAndHashCode(callSuper = true) @Data public class WhpSamplingPlanTaskTestItemVo extends WhpSamplingPlanTaskTestItem { /** * 状态名称 */ private String statusName; /** * 样品-地点 */ private String sampleAddress; /** * 样品-状态 */ private String sampleState; /** * 样品-外观 */ private String sampleAppearance; /** * 样品-数量 */ private Integer sampleAmount; /** * 检测人 */ private String testUserName; /** * 检测日期 */ private String testDate; /** * 复核人 */ private String confirmUserName; /** * 复核日期 */ private String confirmDate; /** * 工作曲线名称 */ private String workCurveName; /** * 常量 */ private List contantCurvelist; /** * 结果公式 */ private List curves; /** * 基础描述 */ private List basicCurvelist; /** * 过程公式 */ private List processCurveslist; // private Integer processLengh; /** * 样品上清液 */ private String sampleSupernatant; /** * 样品性质 */ private String sampleNature; private String istestid; private String taskitemCureid; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpTaskItemCurve.java b/src/com/sipai/entity/whp/test/WhpTaskItemCurve.java deleted file mode 100644 index bbef7132..00000000 --- a/src/com/sipai/entity/whp/test/WhpTaskItemCurve.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import com.sipai.entity.base.SQLAdapter; import lombok.Data; import javax.persistence.Table; import java.io.Serializable; import java.math.BigDecimal; /** * 方法依据 * * @Author: zxq * @Date: 2023/05/15 **/ @Data @Table(name="TH_WHP_TASK_ITEM_CURVE") public class WhpTaskItemCurve extends SQLAdapter implements Serializable { /** * 主键id */ private String id; /** * 我的任务 检测表id */ private String task_test_item_id; /** * 基础描述名称 */ private String name; /** * 基础描述单位 */ private String unit; /** * 项目曲线 基础描述表id */ private String working_curve_id; /** * 值 */ private String calculated_value; /** * 样品编号 */ private String sample_code; /** * 采样点编号 */ private String plan_code; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpTaskItemCurveQuery.java b/src/com/sipai/entity/whp/test/WhpTaskItemCurveQuery.java deleted file mode 100644 index 54e831d4..00000000 --- a/src/com/sipai/entity/whp/test/WhpTaskItemCurveQuery.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import lombok.Data; import java.math.BigDecimal; /** * 方法依据查询条件 * * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTaskItemCurveQuery { /** * 主键id */ private String id; /** * 我的任务 检测表id */ private String task_test_item_id; /** * 基础描述名称 */ private String name; /** * 基础描述单位 */ private String unit; /** * 项目曲线 基础描述表id */ private String working_curve_id; /** * 值 */ private BigDecimal calculated_value; /** * 模糊查询 */ private String likeString; /** * 样品编号 */ private String sample_code; /** * 采样点编号 */ private String plan_code; } \ No newline at end of file diff --git a/src/com/sipai/entity/whp/test/WhpTaskItemCurveVo.java b/src/com/sipai/entity/whp/test/WhpTaskItemCurveVo.java deleted file mode 100644 index 120fe021..00000000 --- a/src/com/sipai/entity/whp/test/WhpTaskItemCurveVo.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.entity.whp.test; import com.sipai.entity.scada.MPoint; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurve; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveVo; import lombok.Data; /** * 页面展示 * @Author: zxq * @Date: 2023/05/15 **/ @Data public class WhpTaskItemCurveVo extends WhpTaskItemCurve { private WhpTestItemWorkingCurveVo whpTestItemWorkingCurveVo; private MPoint mPoint; } \ No newline at end of file diff --git a/src/com/sipai/entity/work/AlarmTypes.java b/src/com/sipai/entity/work/AlarmTypes.java deleted file mode 100644 index bd79fb83..00000000 --- a/src/com/sipai/entity/work/AlarmTypes.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.entity.work; - -public class AlarmTypes { - private String id; - - private String name; - - private String pid; - - private String pName; - - public String getpName() { - return pName; - } - - public void setpName(String pName) { - this.pName = pName; - } - - private String where; - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } -} diff --git a/src/com/sipai/entity/work/AreaManage.java b/src/com/sipai/entity/work/AreaManage.java deleted file mode 100644 index fdcee4f9..00000000 --- a/src/com/sipai/entity/work/AreaManage.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.process.DataVisualFrame; - -public class AreaManage extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String fid;//关联画面id - - private String pid;//父级区域 - - private String pname;//父级区域名称 - - private String name;//区域名称 - - private String coordinatesPic;//各顶点坐标(画面上) - - private String coordinatesPosition;//各顶点坐标(定位系统) - - private String powerids;//关联权限人员id - - private String alarmtypeid;//关联报警类型id - - private String remark; - - private Boolean entrancestatus;//是否有门禁 - - private String modelid;//管理模型id - - /** - * 是否开启人员进出记录 0关闭 1开启 - */ - private String recordStatus; - - /** - * 图层类型 0无 1上层 2下层 3全部 - */ - private String layer; - - private String turn; - - private Double enlargement; - - private DataVisualFrame dataVisualFrame; - - private String _powers; - - public String getTurn() { - return turn; - } - - public void setTurn(String turn) { - this.turn = turn; - } - - public Double getEnlargement() { - return enlargement; - } - - public void setEnlargement(Double enlargement) { - this.enlargement = enlargement; - } - - public String getLayer() { - return layer; - } - - public void setLayer(String layer) { - this.layer = layer; - } - - public String getRecordStatus() { - return recordStatus; - } - - public void setRecordStatus(String recordStatus) { - this.recordStatus = recordStatus; - } - - public DataVisualFrame getDataVisualFrame() { - return dataVisualFrame; - } - - public void setDataVisualFrame(DataVisualFrame dataVisualFrame) { - this.dataVisualFrame = dataVisualFrame; - } - - public String get_powers() { - return _powers; - } - - public void set_powers(String _powers) { - this._powers = _powers; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getFid() { - return fid; - } - - public void setFid(String fid) { - this.fid = fid; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCoordinatesPic() { - return coordinatesPic; - } - - public void setCoordinatesPic(String coordinatesPic) { - this.coordinatesPic = coordinatesPic; - } - - public String getCoordinatesPosition() { - return coordinatesPosition; - } - - public void setCoordinatesPosition(String coordinatesPosition) { - this.coordinatesPosition = coordinatesPosition; - } - - public String getPowerids() { - return powerids; - } - - public void setPowerids(String powerids) { - this.powerids = powerids; - } - - public String getAlarmtypeid() { - return alarmtypeid; - } - - public void setAlarmtypeid(String alarmtypeid) { - this.alarmtypeid = alarmtypeid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Boolean getEntrancestatus() { - return entrancestatus; - } - - public void setEntrancestatus(Boolean entrancestatus) { - this.entrancestatus = entrancestatus; - } - - public String getModelid() { - return modelid; - } - - public void setModelid(String modelid) { - this.modelid = modelid; - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname; - } - - private Double enlargementleft; - - public Double getEnlargementleft() { - return enlargementleft; - } - - public void setEnlargementleft(Double enlargementleft) { - this.enlargementleft = enlargementleft; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/AutoAlert.java b/src/com/sipai/entity/work/AutoAlert.java deleted file mode 100644 index c3ac13ff..00000000 --- a/src/com/sipai/entity/work/AutoAlert.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.entity.work; - - -import com.sipai.entity.base.SQLAdapter; -import java.util.Date; - -public class AutoAlert extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private Boolean active; - - private String alertType; - - private String describe; - - private Integer morder; - - private Integer alertDate; - - private String bizId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public String getAlertType() { - return alertType; - } - - public void setAlertType(String alertType) { - this.alertType = alertType; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getAlertDate() { - return alertDate; - } - - public void setAlertDate(Integer alertDate) { - this.alertDate = alertDate; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/Camera.java b/src/com/sipai/entity/work/Camera.java deleted file mode 100644 index e18b50cb..00000000 --- a/src/com/sipai/entity/work/Camera.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class Camera extends SQLAdapter { - private String id; - - private String bizid;//水厂id - - private String url;//摄像机ip+端口,默认取流端口554 - - private String neturl;//外网ip+端口 - - private String phoneurl;//手持段ip+端口 - - private String insuser;//创建人 - - private String insdt;//创建时间 - - private String name;//名称 - - private String type;//摄像机类型 - - private String channel;//通道 - - private String style;//摄像机外形(球机、枪机) - - private String username;//用户名 - - private String password;//密码 - - private String active;//启用/禁用 - - private String viewscopes;//用途 - - private String processsectionid;//工艺段id - - private String configid; // 关联构筑物或设备的id - - private String configtype; // 标注是关联的是构筑物表还是设备表 - - private String issavepic; - - private String savepicnum; - - private String savepicst; - - private String isneedalarm; - - private Integer morder; - - private boolean isOnline; - - private String modelNames; - - private CameraNVR cameraNVR; - - public CameraNVR getCameraNVR() { - return cameraNVR; - } - - public void setCameraNVR(CameraNVR cameraNVR) { - this.cameraNVR = cameraNVR; - } - - public String getModelNames() { - return modelNames; - } - - public void setModelNames(String modelNames) { - this.modelNames = modelNames; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid == null ? null : bizid.trim(); - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url == null ? null : url.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getChannel() { - return channel; - } - - public void setChannel(String channel) { - this.channel = channel == null ? null : channel.trim(); - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style == null ? null : style.trim(); - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username == null ? null : username.trim(); - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password == null ? null : password.trim(); - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active == null ? null : active.trim(); - } - - public String getViewscopes() { - return viewscopes; - } - - public void setViewscopes(String viewscopes) { - this.viewscopes = viewscopes == null ? null : viewscopes.trim(); - } - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid == null ? null : processsectionid.trim(); - } - - public String getNeturl() { - return neturl; - } - - public void setNeturl(String neturl) { - this.neturl = neturl == null ? null : neturl.trim(); - } - - public String getPhoneurl() { - return phoneurl; - } - - public void setPhoneurl(String phoneurl) { - this.phoneurl = phoneurl == null ? null : phoneurl.trim(); - } - - public String getConfigid() { - return configid; - } - - public void setConfigid(String configid) { - this.configid = configid == null ? null : configid.trim(); - } - - public String getConfigtype() { - return configtype; - } - - public void setConfigtype(String configtype) { - this.configtype = configtype == null ? null : configtype.trim(); - } - - public String getIssavepic() { - return issavepic; - } - - public void setIssavepic(String issavepic) { - this.issavepic = issavepic == null ? null : issavepic.trim(); - } - - public String getSavepicnum() { - return savepicnum; - } - - public void setSavepicnum(String savepicnum) { - this.savepicnum = savepicnum == null ? null : savepicnum.trim(); - } - - public String getSavepicst() { - return savepicst; - } - - public void setSavepicst(String savepicst) { - this.savepicst = savepicst == null ? null : savepicst.trim(); - } - - public String getIsneedalarm() { - return isneedalarm; - } - - public void setIsneedalarm(String isneedalarm) { - this.isneedalarm = isneedalarm == null ? null : isneedalarm.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public boolean isOnline() { - return isOnline; - } - - public void setOnline(boolean online) { - isOnline = online; - } -} diff --git a/src/com/sipai/entity/work/CameraDetail.java b/src/com/sipai/entity/work/CameraDetail.java deleted file mode 100644 index 2ad3df6a..00000000 --- a/src/com/sipai/entity/work/CameraDetail.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.hqconfig.WorkModel; -import com.sipai.entity.scada.MPoint; - -public class CameraDetail { - private String id; - - private String cameraid; - - private String algorithmid; - - private String modelid; - - private String status; - - private String identifyAreas; - - private String pointid; - - private String visionAreas; - - private String areasType; - - private Camera camera; - - private WorkModel workModel; - - private MPoint mPoint; - - private CameraNVR cameraNVR; - - private String where; - - private String vAreasType; - - private String iAreasType; - - public String getiAreasType() { - return iAreasType; - } - - public void setiAreasType(String iAreasType) { - this.iAreasType = iAreasType; - } - - public String getvAreasType() { - return vAreasType; - } - - public void setvAreasType(String vAreasType) { - this.vAreasType = vAreasType; - } - - public CameraNVR getCameraNVR() { - return cameraNVR; - } - - public void setCameraNVR(CameraNVR cameraNVR) { - this.cameraNVR = cameraNVR; - } - - public Camera getCamera() { - return camera; - } - - public void setCamera(Camera camera) { - this.camera = camera; - } - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public WorkModel getWorkModel() { - return workModel; - } - - public void setWorkModel(WorkModel workModel) { - this.workModel = workModel; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getCameraid() { - return cameraid; - } - - public void setCameraid(String cameraid) { - this.cameraid = cameraid == null ? null : cameraid.trim(); - } - - public String getAlgorithmid() { - return algorithmid; - } - - public void setAlgorithmid(String algorithmid) { - this.algorithmid = algorithmid == null ? null : algorithmid.trim(); - } - - public String getModelid() { - return modelid; - } - - public void setModelid(String modelid) { - this.modelid = modelid == null ? null : modelid.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getIdentifyAreas() { - return identifyAreas; - } - - public void setIdentifyAreas(String identifyAreas) { - this.identifyAreas = identifyAreas == null ? null : identifyAreas.trim(); - } - - public String getPointid() { - return pointid; - } - - public void setPointid(String pointid) { - this.pointid = pointid; - } - - public String getVisionAreas() { - return visionAreas; - } - - public void setVisionAreas(String visionAreas) { - this.visionAreas = visionAreas == null ? null : visionAreas.trim(); - } - - public String getAreasType() { - return areasType; - } - - public void setAreasType(String areasType) { - this.areasType = areasType; - } -} diff --git a/src/com/sipai/entity/work/CameraFile.java b/src/com/sipai/entity/work/CameraFile.java deleted file mode 100644 index bcd4b142..00000000 --- a/src/com/sipai/entity/work/CameraFile.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class CameraFile extends SQLAdapter { - private String id; - - private String insdt; - - private String insuser; - - private String masterid; - - private String filename; - - private String abspath; - - private String filepath; - - private String type; - - private Integer size; - - private String pointId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getMasterid() { - return masterid; - } - - public void setMasterid(String masterid) { - this.masterid = masterid == null ? null : masterid.trim(); - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename == null ? null : filename.trim(); - } - - public String getAbspath() { - return abspath; - } - - public void setAbspath(String abspath) { - this.abspath = abspath == null ? null : abspath.trim(); - } - - public String getFilepath() { - return filepath; - } - - public void setFilepath(String filepath) { - this.filepath = filepath == null ? null : filepath.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getSize() { - return size; - } - - public void setSize(Integer size) { - this.size = size; - } - - public String getPointId() { - return pointId; - } - - public void setPointId(String pointId) { - this.pointId = pointId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/CameraNVR.java b/src/com/sipai/entity/work/CameraNVR.java deleted file mode 100644 index 091fd05a..00000000 --- a/src/com/sipai/entity/work/CameraNVR.java +++ /dev/null @@ -1,425 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -public class CameraNVR { - private String id; - - private Date insdt; - - private String insuser; - - private String name; - - private String ip; - - private String brand; - - private String type; - - private String model; - - private String picpath; - - private String state; - - private Boolean motiondetection; - - private Boolean disasteralarm; - - private String waibusuanfa; - - private String processes; - - private String username; - - private String password; - - private Integer cron; - - private Integer mcron; - - private Integer hcron; - - private Integer dcron; - - private Boolean takephotocron; - - private String picsource; - - private Integer screenshotscron; - - private Integer mscreenshotscron; - - private Integer hscreenshotscron; - - private Integer dscreenshotscron; - - private Boolean screenshotscronstate; - - private String diskid; - - private String modbusfigid; - - private String readregister; - - private String writeregister; - - private Integer channel; - - private Integer port; - - private String areamanageid; - - private String ipNvr; - - private String usernameNvr; - - private String passwordNvr; - - private String channelNvr; - - private String areaid; - - private AreaManage areaManage; - - private String areaText; - - private String where; - - public String getAreaText() { - return areaText; - } - - public void setAreaText(String areaText) { - this.areaText = areaText; - } - - public AreaManage getAreaManage() { - return areaManage; - } - - public void setAreaManage(AreaManage areaManage) { - this.areaManage = areaManage; - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public Date getInsdt() { - return insdt; - } - - public void setInsdt(Date insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip == null ? null : ip.trim(); - } - - public String getBrand() { - return brand; - } - - public void setBrand(String brand) { - this.brand = brand == null ? null : brand.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model == null ? null : model.trim(); - } - - public String getPicpath() { - return picpath; - } - - public void setPicpath(String picpath) { - this.picpath = picpath == null ? null : picpath.trim(); - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state == null ? null : state.trim(); - } - - public Boolean getMotiondetection() { - return motiondetection; - } - - public void setMotiondetection(Boolean motiondetection) { - this.motiondetection = motiondetection; - } - - public Boolean getDisasteralarm() { - return disasteralarm; - } - - public void setDisasteralarm(Boolean disasteralarm) { - this.disasteralarm = disasteralarm; - } - - public String getWaibusuanfa() { - return waibusuanfa; - } - - public void setWaibusuanfa(String waibusuanfa) { - this.waibusuanfa = waibusuanfa == null ? null : waibusuanfa.trim(); - } - - public String getProcesses() { - return processes; - } - - public void setProcesses(String processes) { - this.processes = processes == null ? null : processes.trim(); - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username == null ? null : username.trim(); - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password == null ? null : password.trim(); - } - - public Integer getCron() { - return cron; - } - - public void setCron(Integer cron) { - this.cron = cron; - } - - public Integer getMcron() { - return mcron; - } - - public void setMcron(Integer mcron) { - this.mcron = mcron; - } - - public Integer getHcron() { - return hcron; - } - - public void setHcron(Integer hcron) { - this.hcron = hcron; - } - - public Integer getDcron() { - return dcron; - } - - public void setDcron(Integer dcron) { - this.dcron = dcron; - } - - public Boolean getTakephotocron() { - return takephotocron; - } - - public void setTakephotocron(Boolean takephotocron) { - this.takephotocron = takephotocron; - } - - public String getPicsource() { - return picsource; - } - - public void setPicsource(String picsource) { - this.picsource = picsource == null ? null : picsource.trim(); - } - - public Integer getScreenshotscron() { - return screenshotscron; - } - - public void setScreenshotscron(Integer screenshotscron) { - this.screenshotscron = screenshotscron; - } - - public Integer getMscreenshotscron() { - return mscreenshotscron; - } - - public void setMscreenshotscron(Integer mscreenshotscron) { - this.mscreenshotscron = mscreenshotscron; - } - - public Integer getHscreenshotscron() { - return hscreenshotscron; - } - - public void setHscreenshotscron(Integer hscreenshotscron) { - this.hscreenshotscron = hscreenshotscron; - } - - public Integer getDscreenshotscron() { - return dscreenshotscron; - } - - public void setDscreenshotscron(Integer dscreenshotscron) { - this.dscreenshotscron = dscreenshotscron; - } - - public Boolean getScreenshotscronstate() { - return screenshotscronstate; - } - - public void setScreenshotscronstate(Boolean screenshotscronstate) { - this.screenshotscronstate = screenshotscronstate; - } - - public String getDiskid() { - return diskid; - } - - public void setDiskid(String diskid) { - this.diskid = diskid == null ? null : diskid.trim(); - } - - public String getModbusfigid() { - return modbusfigid; - } - - public void setModbusfigid(String modbusfigid) { - this.modbusfigid = modbusfigid == null ? null : modbusfigid.trim(); - } - - public String getReadregister() { - return readregister; - } - - public void setReadregister(String readregister) { - this.readregister = readregister == null ? null : readregister.trim(); - } - - public String getWriteregister() { - return writeregister; - } - - public void setWriteregister(String writeregister) { - this.writeregister = writeregister == null ? null : writeregister.trim(); - } - - public Integer getChannel() { - return channel; - } - - public void setChannel(Integer channel) { - this.channel = channel; - } - - public Integer getPort() { - return port; - } - - public void setPort(Integer port) { - this.port = port; - } - - public String getAreamanageid() { - return areamanageid; - } - - public void setAreamanageid(String areamanageid) { - this.areamanageid = areamanageid == null ? null : areamanageid.trim(); - } - - public String getIpNvr() { - return ipNvr; - } - - public void setIpNvr(String ipNvr) { - this.ipNvr = ipNvr == null ? null : ipNvr.trim(); - } - - public String getUsernameNvr() { - return usernameNvr; - } - - public void setUsernameNvr(String usernameNvr) { - this.usernameNvr = usernameNvr == null ? null : usernameNvr.trim(); - } - - public String getPasswordNvr() { - return passwordNvr; - } - - public void setPasswordNvr(String passwordNvr) { - this.passwordNvr = passwordNvr == null ? null : passwordNvr.trim(); - } - - public String getChannelNvr() { - return channelNvr; - } - - public void setChannelNvr(String channelNvr) { - this.channelNvr = channelNvr == null ? null : channelNvr.trim(); - } -} diff --git a/src/com/sipai/entity/work/ChannelPortConfig.java b/src/com/sipai/entity/work/ChannelPortConfig.java deleted file mode 100644 index 823fa362..00000000 --- a/src/com/sipai/entity/work/ChannelPortConfig.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -public class ChannelPortConfig { - private String id; - - private String name; - - private String address; - - private String type; - - private Boolean status; - - private String describe; - - private String remarks; - - private String unitid; - - private String processid; - - private String insuser; - - private String insdt; - - private String where; - - private Long sort; - - private AreaManage area; - - public Long getSort() { - return sort; - } - - public void setSort(Long sort) { - this.sort = sort; - } - - public AreaManage getArea() { - return area; - } - - public void setArea(AreaManage area) { - this.area = area; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Boolean getStatus() { - return status; - } - - public void setStatus(Boolean status) { - this.status = status; - } - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } -} diff --git a/src/com/sipai/entity/work/ElectricityMeter.java b/src/com/sipai/entity/work/ElectricityMeter.java deleted file mode 100644 index 1f47569b..00000000 --- a/src/com/sipai/entity/work/ElectricityMeter.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ElectricityMeter extends SQLAdapter { - private String id; - - private String name; - - private String pid; - - private String insdt; - - private String insuser; - - private Integer version; - - private Integer morder; - - private String sname; - - private String active; - - private String type; - - private String bizid; - - private String prefix; - - private String suffix; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getSname() { - return sname; - } - - public void setSname(String sname) { - this.sname = sname; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public String getSuffix() { - return suffix; - } - - public void setSuffix(String suffix) { - this.suffix = suffix; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/Group.java b/src/com/sipai/entity/work/Group.java deleted file mode 100644 index cb5901ff..00000000 --- a/src/com/sipai/entity/work/Group.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.entity.work; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; - -public class Group extends SQLAdapter{ - private String id; - - private String name; - - private String deptid; - - private String deptname; - - private String insuser; - - private String insdt; - - private String remark; - - private List groupmembers; - private String schedulingflag;//标记group是否被排班 - - - public String getSchedulingflag() { - return schedulingflag; - } - - public void setSchedulingflag(String schedulingflag) { - this.schedulingflag = schedulingflag; - } - - public List getGroupmembers() { - return groupmembers; - } - - public void setGroupmembers(List groupmembers) { - this.groupmembers = groupmembers; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDeptid() { - return deptid; - } - - public void setDeptid(String deptid) { - this.deptid = deptid; - } - - public String getDeptname() { - return deptname; - } - - public void setDeptname(String deptname) { - this.deptname = deptname; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupContent.java b/src/com/sipai/entity/work/GroupContent.java deleted file mode 100644 index 082a35ed..00000000 --- a/src/com/sipai/entity/work/GroupContent.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class GroupContent extends SQLAdapter { - public final static String Type_Point="1";//节点 - public final static String Type_Content="2";//内容 - - private String id; - - private String name; - - private String unitId; - - private String grouptypeid; - - private String pid; - - private String type; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getGrouptypeid() { - return grouptypeid; - } - - public void setGrouptypeid(String grouptypeid) { - this.grouptypeid = grouptypeid == null ? null : grouptypeid.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupContentForm.java b/src/com/sipai/entity/work/GroupContentForm.java deleted file mode 100644 index e28cdeea..00000000 --- a/src/com/sipai/entity/work/GroupContentForm.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class GroupContentForm extends SQLAdapter { - public final static String Type_row = "row";//行 - public final static String Type_column = "column";//列 - - public final static String Showtextst_TRUE = "1";//可输入单元格 - public final static String Showtextst_FALSE = "0";//不可输入单元格 - - public final static String Mpst_1 = "1";//输入(存到测量点内) - public final static String Mpst_2 = "2";//输出 (取测量点最新数据) - - private String id; - - private String pid; - - private Integer insertrow; - - private Integer insertcolumn; - - private Integer columns; - - private Integer rows; - - private String showtext; - - private String showtextst; - - private String width; - - private String height; - - private String mpid; - - private String mpst; - - private String calculationmethod; - - private String type; - - private String valuerange; - - private String unitconversion; - - private String fontsize; - - private String fontweight; - - private String fontcolor; - - private String backgroundcolor; - - private String textalign; - - private String datampid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public Integer getInsertrow() { - return insertrow; - } - - public void setInsertrow(Integer insertrow) { - this.insertrow = insertrow; - } - - public Integer getInsertcolumn() { - return insertcolumn; - } - - public void setInsertcolumn(Integer insertcolumn) { - this.insertcolumn = insertcolumn; - } - - public Integer getColumns() { - return columns; - } - - public void setColumns(Integer columns) { - this.columns = columns; - } - - public Integer getRows() { - return rows; - } - - public void setRows(Integer rows) { - this.rows = rows; - } - - public String getShowtext() { - return showtext; - } - - public void setShowtext(String showtext) { - this.showtext = showtext == null ? null : showtext.trim(); - } - - public String getShowtextst() { - return showtextst; - } - - public void setShowtextst(String showtextst) { - this.showtextst = showtextst == null ? null : showtextst.trim(); - } - - public String getWidth() { - return width; - } - - public void setWidth(String width) { - this.width = width == null ? null : width.trim(); - } - - public String getHeight() { - return height; - } - - public void setHeight(String height) { - this.height = height == null ? null : height.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getMpst() { - return mpst; - } - - public void setMpst(String mpst) { - this.mpst = mpst == null ? null : mpst.trim(); - } - - public String getCalculationmethod() { - return calculationmethod; - } - - public void setCalculationmethod(String calculationmethod) { - this.calculationmethod = calculationmethod == null ? null : calculationmethod.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getValuerange() { - return valuerange; - } - - public void setValuerange(String valuerange) { - this.valuerange = valuerange == null ? null : valuerange.trim(); - } - - public String getUnitconversion() { - return unitconversion; - } - - public void setUnitconversion(String unitconversion) { - this.unitconversion = unitconversion == null ? null : unitconversion.trim(); - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize == null ? null : fontsize.trim(); - } - - public String getFontweight() { - return fontweight; - } - - public void setFontweight(String fontweight) { - this.fontweight = fontweight == null ? null : fontweight.trim(); - } - - public String getFontcolor() { - return fontcolor; - } - - public void setFontcolor(String fontcolor) { - this.fontcolor = fontcolor == null ? null : fontcolor.trim(); - } - - public String getBackgroundcolor() { - return backgroundcolor; - } - - public void setBackgroundcolor(String backgroundcolor) { - this.backgroundcolor = backgroundcolor == null ? null : backgroundcolor.trim(); - } - - public String getTextalign() { - return textalign; - } - - public void setTextalign(String textalign) { - this.textalign = textalign == null ? null : textalign.trim(); - } - - public String getDatampid() { - return datampid; - } - - public void setDatampid(String datampid) { - this.datampid = datampid == null ? null : datampid.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupContentFormData.java b/src/com/sipai/entity/work/GroupContentFormData.java deleted file mode 100644 index 1a392a88..00000000 --- a/src/com/sipai/entity/work/GroupContentFormData.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class GroupContentFormData extends SQLAdapter { - private String id; - - private String formid; - - private String schedulingid; - - private String insdt; - - private String value; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getFormid() { - return formid; - } - - public void setFormid(String formid) { - this.formid = formid == null ? null : formid.trim(); - } - - public String getSchedulingid() { - return schedulingid; - } - - public void setSchedulingid(String schedulingid) { - this.schedulingid = schedulingid == null ? null : schedulingid.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value == null ? null : value.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupDetail.java b/src/com/sipai/entity/work/GroupDetail.java deleted file mode 100644 index 213be14d..00000000 --- a/src/com/sipai/entity/work/GroupDetail.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -public class GroupDetail extends SQLAdapter { - private String id; - - private String name; - - private String unitId; - - private String grouptypeId; - - private String insuser; - - private String insdt; - - private String leader; - - private String members; - - private String remark; - - private GroupType groupType; - - private User user; - - private Company company; - - private String _leader; - - private String _members; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getGrouptypeId() { - return grouptypeId; - } - - public void setGrouptypeId(String grouptypeId) { - this.grouptypeId = grouptypeId; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getLeader() { - return leader; - } - - public void setLeader(String leader) { - this.leader = leader; - } - - public String getMembers() { - return members; - } - - public void setMembers(String members) { - this.members = members; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public GroupType getGroupType() { - return groupType; - } - - public void setGroupType(GroupType groupType) { - this.groupType = groupType; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public String get_leader() { - return _leader; - } - - public void set_leader(String _leader) { - this._leader = _leader; - } - - public String get_members() { - return _members; - } - - public void set_members(String _members) { - this._members = _members; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupManage.java b/src/com/sipai/entity/work/GroupManage.java deleted file mode 100644 index 8230749a..00000000 --- a/src/com/sipai/entity/work/GroupManage.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.work; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; - - -/** - * 班组管理 (可维护各班组的 开始及结束时间) - * 之前为 GroupType 修改为 GroupManage - * sj 2021-08-04 - */ -@Component -public class GroupManage extends SQLAdapter { - private String id; - - private String sdt; - - private String edt; - - private String insuser; - - private String insdt; - - private String name; - - private String remark; - - private Boolean delflag; - - private String bizId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Boolean getDelflag() { - return delflag; - } - - public void setDelflag(Boolean delflag) { - this.delflag = delflag; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupMember.java b/src/com/sipai/entity/work/GroupMember.java deleted file mode 100644 index 352c0e78..00000000 --- a/src/com/sipai/entity/work/GroupMember.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.sipai.entity.work; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -@Component -public class GroupMember extends SQLAdapter{ - private String id; - - private String groupid; - - private String groupname; - - private String userid; - - private String username; - - private String usertype; - - private String insuser; - - private String insdt; - - private String remark; - private String _workstationid; - private String _workstationname; - private String _checkflag; - - private String pid;//生成tree的键 - - public String get_checkflag() { - return _checkflag; - } - - public void set_checkflag(String _checkflag) { - this._checkflag = _checkflag; - } - - public String getWorkstationid() { - return _workstationid; - } - - public void setWorkstationid(String workstationid) { - this._workstationid = workstationid; - } - - public String getWorkstationname() { - return _workstationname; - } - - public void setWorkstationname(String workstationname) { - this._workstationname = workstationname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getGroupid() { - return groupid; - } - - public void setGroupname(String groupname) { - this.groupname = groupname; - } - - public String getGroupname() { - return groupname; - } - - public void setGroupid(String groupid) { - this.groupid = groupid; - } - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getUsertype() { - return usertype; - } - - public void setUsertype(String usertype) { - this.usertype = usertype; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupTime.java b/src/com/sipai/entity/work/GroupTime.java deleted file mode 100644 index 21665127..00000000 --- a/src/com/sipai/entity/work/GroupTime.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -public class GroupTime extends SQLAdapter { - private String id; - - private String grouptypeId; - - private String name; - - private String sdt; - - private String edt; - - private Integer edtadd; - - private String insuser; - - private String insdt; - - private String unitId; - - private Integer timeexpand; - - private GroupType groupType; - - private User user; - - private Company company; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getGrouptypeId() { - return grouptypeId; - } - - public void setGrouptypeId(String grouptypeId) { - this.grouptypeId = grouptypeId == null ? null : grouptypeId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public Integer getEdtadd() { - return edtadd; - } - - public void setEdtadd(Integer edtadd) { - this.edtadd = edtadd; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public Integer getTimeexpand() { - return timeexpand; - } - - public void setTimeexpand(Integer timeexpand) { - this.timeexpand = timeexpand; - } - - public GroupType getGroupType() { - return groupType; - } - - public void setGroupType(GroupType groupType) { - this.groupType = groupType; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/GroupType.java b/src/com/sipai/entity/work/GroupType.java deleted file mode 100644 index 6e6f437d..00000000 --- a/src/com/sipai/entity/work/GroupType.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -public class GroupType extends SQLAdapter { - private String id; - - private String name; - - private String code; - - private String insuser; - - private String insdt; - - private String remark; - - private Integer morder; - - private String patroltype; - - private User user; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getPatroltype() { - return patroltype; - } - - public void setPatroltype(String patroltype) { - this.patroltype = patroltype == null ? null : patroltype.trim(); - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/KPIPoint.java b/src/com/sipai/entity/work/KPIPoint.java deleted file mode 100644 index 522d0da7..00000000 --- a/src/com/sipai/entity/work/KPIPoint.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.ProcessSection; - -public class KPIPoint extends SQLAdapter{ - private String id; - - private String bizid; - - private String processsectionid; - - private String mpointid; - - private String grade; - - private String insuser; - - private String insdt; - - private String processectionname; - - private String mpointname; - - private MPoint mpoint; - - private MPoint4APP mPoint4APP; - - private String flag; - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public MPoint4APP getmPoint4APP() { - return mPoint4APP; - } - - public void setmPoint4APP(MPoint4APP mPoint4APP) { - this.mPoint4APP = mPoint4APP; - } - - public MPoint getMpoint() { - return mpoint; - } - - public void setMpoint(MPoint mpoint) { - this.mpoint = mpoint; - } - - public String getMpointname() { - return mpointname; - } - - public void setMpointname(String mpointname) { - this.mpointname = mpointname; - } - - public String getProcessectionname() { - return processectionname; - } - - public void setProcessectionname(String processectionname) { - this.processectionname = processectionname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid; - } - - public String getMpointid() { - return mpointid; - } - - public void setMpointid(String mpointid) { - this.mpointid = mpointid; - } - - public String getGrade() { - return grade; - } - - public void setGrade(String grade) { - this.grade = grade; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/KPIPointProfessor.java b/src/com/sipai/entity/work/KPIPointProfessor.java deleted file mode 100644 index 69c2ca76..00000000 --- a/src/com/sipai/entity/work/KPIPointProfessor.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class KPIPointProfessor extends SQLAdapter{ - private String id; - - private String mpid; - - private String bizId; - - private String processSectionId; - - private String flag; - - private String text; - - private String mark; - - private String insdt; - - private String aid; - - public String getAid() { - return aid; - } - - public void setAid(String aid) { - this.aid = aid; - } - - public static String Flag_Yes="1";//有建议 - public static String Flag_No="0";//没有建议 - public static String Flag_Recover="2";//恢复建议 - private KPIPointProfessorParam kPIPointProfessorParam; - - private String processSectionName; - - public String getProcessSectionName() { - return processSectionName; - } - - public void setProcessSectionName(String processSectionName) { - this.processSectionName = processSectionName; - } - - public KPIPointProfessorParam getkPIPointProfessorParam() { - return kPIPointProfessorParam; - } - - public void setkPIPointProfessorParam( - KPIPointProfessorParam kPIPointProfessorParam) { - this.kPIPointProfessorParam = kPIPointProfessorParam; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getProcessSectionId() { - return processSectionId; - } - - public void setProcessSectionId(String processSectionId) { - this.processSectionId = processSectionId; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getMark() { - return mark; - } - - public void setMark(String mark) { - this.mark = mark; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/KPIPointProfessorParam.java b/src/com/sipai/entity/work/KPIPointProfessorParam.java deleted file mode 100644 index 7f8fd2f8..00000000 --- a/src/com/sipai/entity/work/KPIPointProfessorParam.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class KPIPointProfessorParam extends SQLAdapter{ - private String id; - - private String pid; - - private String chartType; - - private String sdt; - - private String edt; - - private MPoint mpoint; - - private String mpcode; - - public String getMpcode() { - return mpcode; - } - - public void setMpcode(String mpcode) { - this.mpcode = mpcode; - } - - public MPoint getMpoint() { - return mpoint; - } - - public void setMpoint(MPoint mpoint) { - this.mpoint = mpoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getChartType() { - return chartType; - } - - public void setChartType(String chartType) { - this.chartType = chartType; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/LagerScreenConfigure.java b/src/com/sipai/entity/work/LagerScreenConfigure.java deleted file mode 100644 index 1647fd65..00000000 --- a/src/com/sipai/entity/work/LagerScreenConfigure.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class LagerScreenConfigure extends SQLAdapter{ - private String id; - - private String name; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/LagerScreenConfigureDetail.java b/src/com/sipai/entity/work/LagerScreenConfigureDetail.java deleted file mode 100644 index 6eb1b018..00000000 --- a/src/com/sipai/entity/work/LagerScreenConfigureDetail.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class LagerScreenConfigureDetail extends SQLAdapter{ - private String id; - - private String pid; - - private String mpname; - - private String mpid; - - private Integer columnNum; - - private Integer morder; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public Integer getColumnNum() { - return columnNum; - } - - public void setColumnNum(Integer columnNum) { - this.columnNum = columnNum; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/LagerScreenData.java b/src/com/sipai/entity/work/LagerScreenData.java deleted file mode 100644 index 7ae8321c..00000000 --- a/src/com/sipai/entity/work/LagerScreenData.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class LagerScreenData extends SQLAdapter{ - private String id; - - private Double eqtotalnum; - - private Double eqanum; - - private Double eqbnum; - - private Double eqcnum; - - private Double eqintactrate; - - private Double xjintactrate; - - private Double xjnum; - - private Double xjworkhour; - - private Double wxintactrate; - - private Double wxnum; - - private Double wxworkhour; - - private Double byintactrate; - - private Double bynum; - - private Double byworkhour; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Double getEqtotalnum() { - return eqtotalnum; - } - - public void setEqtotalnum(Double eqtotalnum) { - this.eqtotalnum = eqtotalnum; - } - - public Double getEqanum() { - return eqanum; - } - - public void setEqanum(Double eqanum) { - this.eqanum = eqanum; - } - - public Double getEqbnum() { - return eqbnum; - } - - public void setEqbnum(Double eqbnum) { - this.eqbnum = eqbnum; - } - - public Double getEqcnum() { - return eqcnum; - } - - public void setEqcnum(Double eqcnum) { - this.eqcnum = eqcnum; - } - - public Double getEqintactrate() { - return eqintactrate; - } - - public void setEqintactrate(Double eqintactrate) { - this.eqintactrate = eqintactrate; - } - - public Double getXjintactrate() { - return xjintactrate; - } - - public void setXjintactrate(Double xjintactrate) { - this.xjintactrate = xjintactrate; - } - - public Double getXjnum() { - return xjnum; - } - - public void setXjnum(Double xjnum) { - this.xjnum = xjnum; - } - - public Double getXjworkhour() { - return xjworkhour; - } - - public void setXjworkhour(Double xjworkhour) { - this.xjworkhour = xjworkhour; - } - - public Double getWxintactrate() { - return wxintactrate; - } - - public void setWxintactrate(Double wxintactrate) { - this.wxintactrate = wxintactrate; - } - - public Double getWxnum() { - return wxnum; - } - - public void setWxnum(Double wxnum) { - this.wxnum = wxnum; - } - - public Double getWxworkhour() { - return wxworkhour; - } - - public void setWxworkhour(Double wxworkhour) { - this.wxworkhour = wxworkhour; - } - - public Double getByintactrate() { - return byintactrate; - } - - public void setByintactrate(Double byintactrate) { - this.byintactrate = byintactrate; - } - - public Double getBynum() { - return bynum; - } - - public void setBynum(Double bynum) { - this.bynum = bynum; - } - - public Double getByworkhour() { - return byworkhour; - } - - public void setByworkhour(Double byworkhour) { - this.byworkhour = byworkhour; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/MPointES.java b/src/com/sipai/entity/work/MPointES.java deleted file mode 100644 index 217c37d9..00000000 --- a/src/com/sipai/entity/work/MPointES.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.entity.work; - - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.scada.MPoint; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - - -public class MPointES extends MPoint { - - private static final long serialVersionUID = -4222932639259909065L; - private String source_type; - - public String getSource_type() { - return source_type; - } - - public void setSource_type(String source_type) { - this.source_type = source_type; - } - - public static MPointES format(MPoint mPoint){ - String str = JSON.toJSONString(mPoint); - MPointES mPointES = JSON.parseObject(str,MPointES.class); - - if(mPoint.getMeasuredt()!=null && !mPoint.getMeasuredt().isEmpty()) { - if(!mPoint.getMeasuredt().isEmpty() && mPoint.getMeasuredt().indexOf("T") == -1) {//没T和Z - //时间格式处理 - DateTimeFormatter dfES = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'"); - DateTimeFormatter dfSQL = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - try { - LocalDateTime measureDt = LocalDateTime.parse(mPoint.getMeasuredt().substring(0,19), dfSQL); - String measureDtStr = dfES.format(measureDt); - mPointES.setMeasuredt(measureDtStr); - } catch (Exception e) { - - } - }else{ - //若存储measuredt为空或者格式问题,则测量点置为空 - mPointES.setMeasuredt(null); - } - } - mPointES.setSource_type(mPoint.getSourceType()); - return mPointES; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/MPointHisChangeData.java b/src/com/sipai/entity/work/MPointHisChangeData.java deleted file mode 100644 index 4d143c13..00000000 --- a/src/com/sipai/entity/work/MPointHisChangeData.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class MPointHisChangeData extends SQLAdapter { - //类型 - public static final String Change_Delete = "del"; - public static final String Change_Edit = "edit"; - public static final String Change_Add = "add"; - public static final String Change_Cleaning = "cleaning"; - - private String id; - - private String mpid; - - private String changepeople; - - private String changetime; - - private Double changedata; - - private Double olddata; - - private String valuetime; - - private String _changepeopleName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getChangepeople() { - return changepeople; - } - - public void setChangepeople(String changepeople) { - this.changepeople = changepeople == null ? null : changepeople.trim(); - } - - public String getChangetime() { - return changetime; - } - - public void setChangetime(String changetime) { - this.changetime = changetime; - } - - public Double getChangedata() { - return changedata; - } - - public void setChangedata(Double changedata) { - this.changedata = changedata; - } - - public Double getOlddata() { - return olddata; - } - - public void setOlddata(Double olddata) { - this.olddata = olddata; - } - - public String getValuetime() { - return valuetime; - } - - public void setValuetime(String valuetime) { - this.valuetime = valuetime; - } - - public String get_changepeopleName() { - return _changepeopleName; - } - - public void set_changepeopleName(String _changepeopleName) { - this._changepeopleName = _changepeopleName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/MeasurePoint_DATA.java b/src/com/sipai/entity/work/MeasurePoint_DATA.java deleted file mode 100644 index 564caecc..00000000 --- a/src/com/sipai/entity/work/MeasurePoint_DATA.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.sipai.entity.work; - -import java.util.List; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPointHistory; - -public class MeasurePoint_DATA extends SQLAdapter{ - - private String id; - - private String insdt; - - private String insuser; - - private String dataNumber; - - private String bizId; - - private String mpointcode; - - private String type1; - - private String type2; - - private String pageNub; - - private List mPointHistories; - - public List getmPointHistories() { - return mPointHistories; - } - - public void setmPointHistories(List mPointHistories) { - this.mPointHistories = mPointHistories; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getDataNumber() { - return dataNumber; - } - - public void setDataNumber(String dataNumber) { - this.dataNumber = dataNumber; - } - - public String getBizId() { - return bizId; - } - - public void setBizId(String bizId) { - this.bizId = bizId; - } - - public String getMpointcode() { - return mpointcode; - } - - public void setMpointcode(String mpointcode) { - this.mpointcode = mpointcode; - } - - public String getType1() { - return type1; - } - - public void setType1(String type1) { - this.type1 = type1; - } - - public String getType2() { - return type2; - } - - public void setType2(String type2) { - this.type2 = type2; - } - - public String getPageNub() { - return pageNub; - } - - public void setPageNub(String pageNub) { - this.pageNub = pageNub; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ModbusConfig.java b/src/com/sipai/entity/work/ModbusConfig.java deleted file mode 100644 index 26d391ed..00000000 --- a/src/com/sipai/entity/work/ModbusConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.entity.work; - -public class ModbusConfig { - private String id; - - private String pId; - - private Integer type; - - private Integer dataType; - - private String where; - - private String typeText; - - private String dataTypeText; - - public String getTypeText() { - return typeText; - } - - public void setTypeText(String typeText) { - this.typeText = typeText; - } - - public String getDataTypeText() { - return dataTypeText; - } - - public void setDataTypeText(String dataTypeText) { - this.dataTypeText = dataTypeText; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getpId() { - return pId; - } - - public void setpId(String pId) { - this.pId = pId == null ? null : pId.trim(); - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public Integer getDataType() { - return dataType; - } - - public void setDataType(Integer dataType) { - this.dataType = dataType; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ModbusFig.java b/src/com/sipai/entity/work/ModbusFig.java deleted file mode 100644 index 23088de9..00000000 --- a/src/com/sipai/entity/work/ModbusFig.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.entity.work; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -@Component -public class ModbusFig extends SQLAdapter{ - private String id; - - private String ipsever; - - private String port; - - private String slaveid; - - private String order32; - - private String name; - - private String remarks; - - private String flag; - - private String insuser; - - private String insdt; - - private String companyId; - - private int max; - private int min; - - public int getMax() { - return max; - } - - public void setMax(int max) { - this.max = max; - } - - public int getMin() { - return min; - } - - public void setMin(int min) { - this.min = min; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getIpsever() { - return ipsever; - } - - public void setIpsever(String ipsever) { - this.ipsever = ipsever; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } - - public String getSlaveid() { - return slaveid; - } - - public void setSlaveid(String slaveid) { - this.slaveid = slaveid; - } - - public String getOrder32() { - return order32; - } - - public void setOrder32(String order32) { - this.order32 = order32; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getFlag() { - return flag; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getCompanyId() { - return companyId; - } - - public void setCompanyId(String companyId) { - this.companyId = companyId; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ModbusInterface.java b/src/com/sipai/entity/work/ModbusInterface.java deleted file mode 100644 index d4a9652a..00000000 --- a/src/com/sipai/entity/work/ModbusInterface.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.entity.work; - -import com.serotonin.modbus4j.ModbusMaster; -import com.serotonin.modbus4j.ip.tcp.TcpMaster; - -import java.util.HashMap; - -public class ModbusInterface { - private String id; - - private String name; - - private String ip; - - private Integer port; - - private Integer status; - - private String unitId; - - private Integer offset; - - private String where; - - private ModbusMaster tcpMaster; - - public HashMap modbusConfigMap; - - public HashMap getModbusConfigMap() { - return modbusConfigMap; - } - - public void setModbusConfigMap(HashMap modbusConfigMap) { - this.modbusConfigMap = modbusConfigMap; - } - - public ModbusMaster getTcpMaster() { - return tcpMaster; - } - - public void setTcpMaster(ModbusMaster tcpMaster) { - this.tcpMaster = tcpMaster; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public Integer getPort() { - return port; - } - - public void setPort(Integer port) { - this.port = port; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ModbusPoint.java b/src/com/sipai/entity/work/ModbusPoint.java deleted file mode 100644 index 3262b7c7..00000000 --- a/src/com/sipai/entity/work/ModbusPoint.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.sipai.entity.work; - -public class ModbusPoint { - private String id; - - private String name; - - private Integer address; - - private Integer regusterType; - - private Integer slaveId; - - private Integer pointType; - - private Integer status; - - private String pId; - - private String code; - - private String where; - - // 寄存器类型文本展示 - private String resgusterTypeText; - - // 点位数据类型文本展示 - private String pointTypeText; - - // 启用或禁用文本展示 - private String statusText; - - public String getResgusterTypeText() { - return resgusterTypeText; - } - - public void setResgusterTypeText(String resgusterTypeText) { - this.resgusterTypeText = resgusterTypeText; - } - - public String getPointTypeText() { - return pointTypeText; - } - - public void setPointTypeText(String pointTypeText) { - this.pointTypeText = pointTypeText; - } - - public String getStatusText() { - return statusText; - } - - public void setStatusText(String statusText) { - this.statusText = statusText; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getAddress() { - return address; - } - - public void setAddress(Integer address) { - this.address = address; - } - - public Integer getRegusterType() { - return regusterType; - } - - public void setRegusterType(Integer regusterType) { - this.regusterType = regusterType; - } - - public Integer getSlaveId() { - return slaveId; - } - - public void setSlaveId(Integer slaveId) { - this.slaveId = slaveId; - } - - public Integer getPointType() { - return pointType; - } - - public void setPointType(Integer pointType) { - this.pointType = pointType; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getpId() { - return pId; - } - - public void setpId(String pId) { - this.pId = pId == null ? null : pId.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ModbusRecord.java b/src/com/sipai/entity/work/ModbusRecord.java deleted file mode 100644 index d8f75115..00000000 --- a/src/com/sipai/entity/work/ModbusRecord.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.work; - -import org.springframework.stereotype.Component; - -import com.sipai.entity.base.SQLAdapter; -@Component -public class ModbusRecord extends SQLAdapter{ - private String id; - - private String lastdate; - - private String record; - - private String insuser; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLastdate() { - return lastdate; - } - - public void setLastdate(String lastdate) { - this.lastdate = lastdate; - } - - public String getRecord() { - return record; - } - - public void setRecord(String record) { - this.record = record; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/OverviewProduce.java b/src/com/sipai/entity/work/OverviewProduce.java deleted file mode 100644 index 94011013..00000000 --- a/src/com/sipai/entity/work/OverviewProduce.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.sipai.entity.work; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPointHistory; - - -//主页数据类 -public class OverviewProduce { - private String equipmentTotal; - private String equipmentTotalA; - private String equipmentTotalB; - private String equipmentTotalC; - private int data22; - private int data21; - private int data20; - private int data19; - private String data18; - private String data17; - private String data16; - private String data15; - private String data14; - private String data13; - private String data12; - private String data11; - private String data10; - private String data9; - private String data8; - private String data7; - private String data6; - private String data5; - private String data4; - private String data3; - private String data2; - private String data1; - private String data; - - //投运设备数 - private String equipmentTotalRun; - //设备完好率 - private int equipmentIntactRate; - //大修完成率 - private int equipmentRepair; - //巡检完成率 - private int equipmentInspection; - //保养完成率 - private int equipmentMaintain; - //总异常数量 - private int equipmentAnomaliesTotal; - //运行异常数量 - private int equipmentRunAnomalies; - //设备异常数量 - private int equipmentToAnomalies; - - //污水处理量 - private List wscll; - //污泥外运量 - private List wnwyl; - //深度脱水处理量 - private List sdtscll; - //剩余污泥量 - private List sywnl; - //用药量 - private List yyl; - //用电量 - private List ydl; - - - public List getSdtscll() { - return sdtscll; - } - public void setSdtscll(List sdtscll) { - this.sdtscll = sdtscll; - } - public List getSywnl() { - return sywnl; - } - public void setSywnl(List sywnl) { - this.sywnl = sywnl; - } - public List getYyl() { - return yyl; - } - public void setYyl(List yyl) { - this.yyl = yyl; - } - public List getYdl() { - return ydl; - } - public void setYdl(List ydl) { - this.ydl = ydl; - } - public List getWscll() { - return wscll; - } - public void setWscll(List wscll) { - this.wscll = wscll; - } - - - public List getWnwyl() { - return wnwyl; - } - public void setWnwyl(List wnwyl) { - this.wnwyl = wnwyl; - } - public String getEquipmentTotal() { - return equipmentTotal; - } - public void setEquipmentTotal(String equipmentTotal) { - this.equipmentTotal = equipmentTotal; - } - public String getEquipmentTotalA() { - return equipmentTotalA; - } - public void setEquipmentTotalA(String equipmentTotalA) { - this.equipmentTotalA = equipmentTotalA; - } - public String getEquipmentTotalB() { - return equipmentTotalB; - } - public void setEquipmentTotalB(String equipmentTotalB) { - this.equipmentTotalB = equipmentTotalB; - } - public String getEquipmentTotalC() { - return equipmentTotalC; - } - public void setEquipmentTotalC(String equipmentTotalC) { - this.equipmentTotalC = equipmentTotalC; - } - public String getEquipmentTotalRun() { - return equipmentTotalRun; - } - public void setEquipmentTotalRun(String equipmentTotalRun) { - this.equipmentTotalRun = equipmentTotalRun; - } - public int getEquipmentIntactRate() { - return equipmentIntactRate; - } - public void setEquipmentIntactRate(int equipmentIntactRate) { - this.equipmentIntactRate = equipmentIntactRate; - } - public int getEquipmentRepair() { - return equipmentRepair; - } - public void setEquipmentRepair(int equipmentRepair) { - this.equipmentRepair = equipmentRepair; - } - public int getEquipmentMaintain() { - return equipmentMaintain; - } - public void setEquipmentMaintain(int equipmentMaintain) { - this.equipmentMaintain = equipmentMaintain; - } - public int getEquipmentAnomaliesTotal() { - return equipmentAnomaliesTotal; - } - public void setEquipmentAnomaliesTotal(int equipmentAnomaliesTotal) { - this.equipmentAnomaliesTotal = equipmentAnomaliesTotal; - } - public int getEquipmentRunAnomalies() { - return equipmentRunAnomalies; - } - public void setEquipmentRunAnomalies(int equipmentRunAnomalies) { - this.equipmentRunAnomalies = equipmentRunAnomalies; - } - public int getEquipmentToAnomalies() { - return equipmentToAnomalies; - } - public void setEquipmentToAnomalies(int equipmentToAnomalies) { - this.equipmentToAnomalies = equipmentToAnomalies; - } - public int getEquipmentInspection() { - return equipmentInspection; - } - public void setEquipmentInspection(int equipmentInspection) { - this.equipmentInspection = equipmentInspection; - } - public String getData18() { - return data18; - } - public void setData18(String data18) { - this.data18 = data18; - } - public String getData17() { - return data17; - } - public void setData17(String data17) { - this.data17 = data17; - } - public String getData16() { - return data16; - } - public void setData16(String data16) { - this.data16 = data16; - } - public String getData15() { - return data15; - } - public void setData15(String data15) { - this.data15 = data15; - } - public String getData14() { - return data14; - } - public void setData14(String data14) { - this.data14 = data14; - } - public String getData13() { - return data13; - } - public void setData13(String data13) { - this.data13 = data13; - } - public String getData12() { - return data12; - } - public void setData12(String data12) { - this.data12 = data12; - } - public String getData10() { - return data10; - } - public void setData10(String data10) { - this.data10 = data10; - } - public String getData9() { - return data9; - } - public void setData9(String data9) { - this.data9 = data9; - } - public String getData8() { - return data8; - } - public void setData8(String data8) { - this.data8 = data8; - } - public String getData7() { - return data7; - } - public void setData7(String data7) { - this.data7 = data7; - } - public String getData6() { - return data6; - } - public void setData6(String data6) { - this.data6 = data6; - } - public String getData5() { - return data5; - } - public void setData5(String data5) { - this.data5 = data5; - } - public String getData4() { - return data4; - } - public void setData4(String data4) { - this.data4 = data4; - } - public String getData3() { - return data3; - } - public void setData3(String data3) { - this.data3 = data3; - } - public String getData2() { - return data2; - } - public void setData2(String data2) { - this.data2 = data2; - } - public String getData1() { - return data1; - } - public void setData1(String data1) { - this.data1 = data1; - } - public String getData11() { - return data11; - } - public void setData11(String data11) { - this.data11 = data11; - } - public String getData() { - return data; - } - public void setData(String data) { - this.data = data; - } - public int getData22() { - return data22; - } - public void setData22(int data22) { - this.data22 = data22; - } - public int getData21() { - return data21; - } - public void setData21(int data21) { - this.data21 = data21; - } - public int getData20() { - return data20; - } - public void setData20(int data20) { - this.data20 = data20; - } - public int getData19() { - return data19; - } - public void setData19(int data19) { - this.data19 = data19; - } - - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/OverviewProduceBlot.java b/src/com/sipai/entity/work/OverviewProduceBlot.java deleted file mode 100644 index 26bba924..00000000 --- a/src/com/sipai/entity/work/OverviewProduceBlot.java +++ /dev/null @@ -1,373 +0,0 @@ -package com.sipai.entity.work; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPointHistory; - - -//主页数据类 -public class OverviewProduceBlot { - private String equipmentTotal; - private String equipmentTotalA; - private String equipmentTotalB; - private String equipmentTotalC; - private int data30; - private int data29; - private int data28; - private int data27; - private int data26; - private int data25; - private int data24; - private int data23; - private int data22; - private int data21; - private String data20; - private String data19; - private String data18; - private String data17; - private String data16; - private List data15; - private List data14; - private List data13; - private List data12; - private List data11; - private List data10; - private List data9; - private List data8; - private List data7; - private List data6; - private List data5; - private List data4; - private List data3; - private List data2; - private List data1; - private List data; - - private String fwmj; - private String fwrk; - private String zxyyclnl; - private String jnljclsl; - - //投运设备数 - private String equipmentTotalRun; - //设备完好率 - private int equipmentIntactRate; - //大修完成率 - private int equipmentRepair; - //巡检完成率 - private int equipmentInspection; - //保养完成率 - private int equipmentMaintain; - //总异常数量 - private int equipmentAnomaliesTotal; - //运行异常数量 - private int equipmentRunAnomalies; - //设备异常数量 - private int equipmentToAnomalies; - //运行巡检 - private int yxxj; - //设备巡检 - private int sbxj; - - - public String getFwmj() { - return fwmj; - } - public void setFwmj(String fwmj) { - this.fwmj = fwmj; - } - public String getFwrk() { - return fwrk; - } - public void setFwrk(String fwrk) { - this.fwrk = fwrk; - } - public String getZxyyclnl() { - return zxyyclnl; - } - public void setZxyyclnl(String zxyyclnl) { - this.zxyyclnl = zxyyclnl; - } - public String getJnljclsl() { - return jnljclsl; - } - public void setJnljclsl(String jnljclsl) { - this.jnljclsl = jnljclsl; - } - public int getYxxj() { - return yxxj; - } - public void setYxxj(int yxxj) { - this.yxxj = yxxj; - } - public int getSbxj() { - return sbxj; - } - public void setSbxj(int sbxj) { - this.sbxj = sbxj; - } - public String getEquipmentTotal() { - return equipmentTotal; - } - public void setEquipmentTotal(String equipmentTotal) { - this.equipmentTotal = equipmentTotal; - } - public String getEquipmentTotalA() { - return equipmentTotalA; - } - public void setEquipmentTotalA(String equipmentTotalA) { - this.equipmentTotalA = equipmentTotalA; - } - public String getEquipmentTotalB() { - return equipmentTotalB; - } - public void setEquipmentTotalB(String equipmentTotalB) { - this.equipmentTotalB = equipmentTotalB; - } - public String getEquipmentTotalC() { - return equipmentTotalC; - } - public void setEquipmentTotalC(String equipmentTotalC) { - this.equipmentTotalC = equipmentTotalC; - } - public String getEquipmentTotalRun() { - return equipmentTotalRun; - } - public void setEquipmentTotalRun(String equipmentTotalRun) { - this.equipmentTotalRun = equipmentTotalRun; - } - public int getEquipmentIntactRate() { - return equipmentIntactRate; - } - public void setEquipmentIntactRate(int equipmentIntactRate) { - this.equipmentIntactRate = equipmentIntactRate; - } - public int getEquipmentRepair() { - return equipmentRepair; - } - public void setEquipmentRepair(int equipmentRepair) { - this.equipmentRepair = equipmentRepair; - } - public int getEquipmentMaintain() { - return equipmentMaintain; - } - public void setEquipmentMaintain(int equipmentMaintain) { - this.equipmentMaintain = equipmentMaintain; - } - public int getEquipmentAnomaliesTotal() { - return equipmentAnomaliesTotal; - } - public void setEquipmentAnomaliesTotal(int equipmentAnomaliesTotal) { - this.equipmentAnomaliesTotal = equipmentAnomaliesTotal; - } - public int getEquipmentRunAnomalies() { - return equipmentRunAnomalies; - } - public void setEquipmentRunAnomalies(int equipmentRunAnomalies) { - this.equipmentRunAnomalies = equipmentRunAnomalies; - } - public int getEquipmentToAnomalies() { - return equipmentToAnomalies; - } - public void setEquipmentToAnomalies(int equipmentToAnomalies) { - this.equipmentToAnomalies = equipmentToAnomalies; - } - public int getEquipmentInspection() { - return equipmentInspection; - } - public void setEquipmentInspection(int equipmentInspection) { - this.equipmentInspection = equipmentInspection; - } - public String getData18() { - return data18; - } - public void setData18(String data18) { - this.data18 = data18; - } - public String getData17() { - return data17; - } - public void setData17(String data17) { - this.data17 = data17; - } - public String getData16() { - return data16; - } - public void setData16(String data16) { - this.data16 = data16; - } - public List getData15() { - return data15; - } - public void setData15(List data15) { - this.data15 = data15; - } - public List getData14() { - return data14; - } - public void setData14(List data14) { - this.data14 = data14; - } - public List getData13() { - return data13; - } - public void setData13(List data13) { - this.data13 = data13; - } - public List getData12() { - return data12; - } - public void setData12(List data12) { - this.data12 = data12; - } - public List getData11() { - return data11; - } - public void setData11(List data11) { - this.data11 = data11; - } - public List getData10() { - return data10; - } - public void setData10(List data10) { - this.data10 = data10; - } - public List getData9() { - return data9; - } - public void setData9(List data9) { - this.data9 = data9; - } - public List getData8() { - return data8; - } - public void setData8(List data8) { - this.data8 = data8; - } - public List getData3() { - return data3; - } - public void setData3(List data3) { - this.data3 = data3; - } - public List getData2() { - return data2; - } - public void setData2(List data2) { - this.data2 = data2; - } - public List getData1() { - return data1; - } - public void setData1(List data1) { - this.data1 = data1; - } - public List getData() { - return data; - } - public void setData(List data) { - this.data = data; - } - public List getData7() { - return data7; - } - public void setData7(List data7) { - this.data7 = data7; - } - public List getData6() { - return data6; - } - public void setData6(List data6) { - this.data6 = data6; - } - public List getData5() { - return data5; - } - public void setData5(List data5) { - this.data5 = data5; - } - public List getData4() { - return data4; - } - public void setData4(List data4) { - this.data4 = data4; - } - public String getData20() { - return data20; - } - public void setData20(String data20) { - this.data20 = data20; - } - public String getData19() { - return data19; - } - public void setData19(String data19) { - this.data19 = data19; - } - public int getData25() { - return data25; - } - public void setData25(int data25) { - this.data25 = data25; - } - public int getData24() { - return data24; - } - public void setData24(int data24) { - this.data24 = data24; - } - public int getData23() { - return data23; - } - public void setData23(int data23) { - this.data23 = data23; - } - public int getData22() { - return data22; - } - public void setData22(int data22) { - this.data22 = data22; - } - public int getData21() { - return data21; - } - public void setData21(int data21) { - this.data21 = data21; - } - public int getData28() { - return data28; - } - public void setData28(int data28) { - this.data28 = data28; - } - public int getData27() { - return data27; - } - public void setData27(int data27) { - this.data27 = data27; - } - public int getData26() { - return data26; - } - public void setData26(int data26) { - this.data26 = data26; - } - public int getData30() { - return data30; - } - public void setData30(int data30) { - this.data30 = data30; - } - public int getData29() { - return data29; - } - public void setData29(int data29) { - this.data29 = data29; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ProcedWorkstation.java b/src/com/sipai/entity/work/ProcedWorkstation.java deleted file mode 100644 index cbe29a25..00000000 --- a/src/com/sipai/entity/work/ProcedWorkstation.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class ProcedWorkstation extends SQLAdapter{ - private String id; - - private String insuser; - - private String insdt; - - private String procedureid; - - private String workstationid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getProcedureid() { - return procedureid; - } - - public void setProcedureid(String procedureid) { - this.procedureid = procedureid; - } - - public String getWorkstationid() { - return workstationid; - } - - public void setWorkstationid(String workstationid) { - this.workstationid = workstationid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ProductionIndexData.java b/src/com/sipai/entity/work/ProductionIndexData.java deleted file mode 100644 index 9d3a3773..00000000 --- a/src/com/sipai/entity/work/ProductionIndexData.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class ProductionIndexData extends SQLAdapter{ - private String id; - - private String configureid; - - private Double value; - - private String plandate; - - private String type; - - private String unitId; - - private ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getConfigureid() { - return configureid; - } - - public void setConfigureid(String configureid) { - this.configureid = configureid; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getPlandate() { - return plandate; - } - - public void setPlandate(String plandate) { - this.plandate = plandate; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public ProductionIndexPlanNameConfigure getProductionIndexPlanNameConfigure() { - return productionIndexPlanNameConfigure; - } - - public void setProductionIndexPlanNameConfigure( - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure) { - this.productionIndexPlanNameConfigure = productionIndexPlanNameConfigure; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ProductionIndexPlanNameConfigure.java b/src/com/sipai/entity/work/ProductionIndexPlanNameConfigure.java deleted file mode 100644 index cb0f8042..00000000 --- a/src/com/sipai/entity/work/ProductionIndexPlanNameConfigure.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class ProductionIndexPlanNameConfigure extends SQLAdapter { - //类型 - public static final String Type_0 = "0";//指标类型 - public static final String Type_1 = "1";//指标名称 - - private String id; - - private String pid; - - private String name; - - private String type; - - private String mpid; - - private String mpidPlan; - - private String unitId; - - private Integer morder; - - private String insuser; - - private String insdt; - - private Double value; - - private String mpname; - - private String mpPlanname; - - private String dayValue; - - private Double targetValue; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getMpidPlan() { - return mpidPlan; - } - - public void setMpidPlan(String mpidPlan) { - this.mpidPlan = mpidPlan; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getMpname() { - return mpname; - } - - public void setMpname(String mpname) { - this.mpname = mpname; - } - - public String getMpPlanname() { - return mpPlanname; - } - - public void setMpPlanname(String mpPlanname) { - this.mpPlanname = mpPlanname; - } - - public String getDayValue() { - return dayValue; - } - - public void setDayValue(String dayValue) { - this.dayValue = dayValue; - } - - public Double getTargetValue() { - return targetValue; - } - - public void setTargetValue(Double targetValue) { - this.targetValue = targetValue; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ProductionIndexPlanNameData.java b/src/com/sipai/entity/work/ProductionIndexPlanNameData.java deleted file mode 100644 index 0a42dd4b..00000000 --- a/src/com/sipai/entity/work/ProductionIndexPlanNameData.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class ProductionIndexPlanNameData extends SQLAdapter{ - //年度指标/月度指标 - public static final String Type_Year = "Year";//年度指标 - public static final String Type_Month = "Month";//月度指标 - public static final String Type_Day = "Day";//月度指标 - - private String id; - - private String configureid; - - private Double value; - - private String plandate; - - private String type; - - private Integer morder; - - private String unitId; - - private ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getConfigureid() { - return configureid; - } - - public void setConfigureid(String configureid) { - this.configureid = configureid; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getPlandate() { - return plandate; - } - - public void setPlandate(String plandate) { - this.plandate = plandate; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public ProductionIndexPlanNameConfigure getProductionIndexPlanNameConfigure() { - return productionIndexPlanNameConfigure; - } - - public void setProductionIndexPlanNameConfigure( - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure) { - this.productionIndexPlanNameConfigure = productionIndexPlanNameConfigure; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ProductionIndexPlanNameDataHis.java b/src/com/sipai/entity/work/ProductionIndexPlanNameDataHis.java deleted file mode 100644 index 203bfefb..00000000 --- a/src/com/sipai/entity/work/ProductionIndexPlanNameDataHis.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class ProductionIndexPlanNameDataHis extends SQLAdapter{ - private String id; - - private String insdt; - - private String insuser; - - private Double value; - - private String remark; - - private String pid; - - private String insuserName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getInsuserName() { - return insuserName; - } - - public void setInsuserName(String insuserName) { - this.insuserName = insuserName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ProductionIndexWorkOrder.java b/src/com/sipai/entity/work/ProductionIndexWorkOrder.java deleted file mode 100644 index af36801b..00000000 --- a/src/com/sipai/entity/work/ProductionIndexWorkOrder.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class ProductionIndexWorkOrder extends SQLAdapter{ - private String id; - - private String insdt; - - private String writeperson; - - private String writepersonname; - - private String datacontent; - - private String writedate; - - private String submitdate; - - private String unitId; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getWriteperson() { - return writeperson; - } - - public void setWriteperson(String writeperson) { - this.writeperson = writeperson; - } - - public String getDatacontent() { - return datacontent; - } - - public void setDatacontent(String datacontent) { - this.datacontent = datacontent; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getWritedate() { - return writedate; - } - - public void setWritedate(String writedate) { - this.writedate = writedate; - } - - public String getSubmitdate() { - return submitdate; - } - - public void setSubmitdate(String submitdate) { - this.submitdate = submitdate; - } - - public String getWritepersonname() { - return writepersonname; - } - - public void setWritepersonname(String writepersonname) { - this.writepersonname = writepersonname; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ScadaPic.java b/src/com/sipai/entity/work/ScadaPic.java deleted file mode 100644 index 38a91a17..00000000 --- a/src/com/sipai/entity/work/ScadaPic.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ScadaPic extends SQLAdapter{ - public static String Type_scadapic_detail="1";//总工艺详图 - public static String Type_scadapic_brief="0";//总工艺简图 - public static String Type_scadapic_ps="2";//工艺段图 - - public static String Type_scadapic_detail_name="总工艺详图";//总工艺详图 - public static String Type_scadapic_brief_name="总工艺简图";//总工艺简图 - public static String Type_scadapic_ps_name="工艺段图";//工艺段图 - private String id; - - private String bizid; - - private String processsectionid; - - private String type; - - private String text; - - private String picpath; - - private String insuser; - - private String insdt; - - private String processectionname; - - public String getProcessectionname() { - return processectionname; - } - - public void setProcessectionname(String processectionname) { - this.processectionname = processectionname; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid; - } - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPicpath() { - return picpath; - } - - public void setPicpath(String picpath) { - this.picpath = picpath; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ScadaPic_EM.java b/src/com/sipai/entity/work/ScadaPic_EM.java deleted file mode 100644 index 75d96a9a..00000000 --- a/src/com/sipai/entity/work/ScadaPic_EM.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.equipment.EquipmentCard; - -public class ScadaPic_EM extends SQLAdapter{ - private String id; - - private String pid; - - private String equipid; - - private Double posx; - - private Double posy; - - private Double containerwidth; - - private Double containerheight; - - private String insuser; - - private String insdt; - - private String ownerid; - - private String txt; - - private Double width; - - private Double height; - - private EquipmentCard equipmentCard; - - - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getEquipid() { - return equipid; - } - - public void setEquipid(String equipid) { - this.equipid = equipid; - } - - public Double getPosx() { - return posx; - } - - public void setPosx(Double posx) { - this.posx = posx; - } - - public Double getPosy() { - return posy; - } - - public void setPosy(Double posy) { - this.posy = posy; - } - - public Double getContainerwidth() { - return containerwidth; - } - - public void setContainerwidth(Double containerwidth) { - this.containerwidth = containerwidth; - } - - public Double getContainerheight() { - return containerheight; - } - - public void setContainerheight(Double containerheight) { - this.containerheight = containerheight; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getOwnerid() { - return ownerid; - } - - public void setOwnerid(String ownerid) { - this.ownerid = ownerid; - } - - public String getTxt() { - return txt; - } - - public void setTxt(String txt) { - this.txt = txt; - } - - public Double getWidth() { - return width; - } - - public void setWidth(Double width) { - this.width = width; - } - - public Double getHeight() { - return height; - } - - public void setHeight(Double height) { - this.height = height; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ScadaPic_MPoint.java b/src/com/sipai/entity/work/ScadaPic_MPoint.java deleted file mode 100644 index e3f0299b..00000000 --- a/src/com/sipai/entity/work/ScadaPic_MPoint.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.scada.MPoint; - -public class ScadaPic_MPoint extends SQLAdapter{ - public static String ExpressFlag_On="1"; //表达式启用标示 - - private String id; - - private String pid; - - private String mpid; - - private Double posx; - - private Double posy; - - private Double containerwidth; - - private Double containerheight; - - private String insuser; - - private String insdt; - - private String ownerid; - - private String txt; - - private String fsize; - - private Integer accuracy; - - private String expressionflag; - private MPoint mPoint; - - - public MPoint getmPoint() { - return mPoint; - } - - public void setmPoint(MPoint mPoint) { - this.mPoint = mPoint; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public Double getPosx() { - return posx; - } - - public void setPosx(Double posx) { - this.posx = posx; - } - - public Double getPosy() { - return posy; - } - - public void setPosy(Double posy) { - this.posy = posy; - } - - public Double getContainerwidth() { - return containerwidth; - } - - public void setContainerwidth(Double containerwidth) { - this.containerwidth = containerwidth; - } - - public Double getContainerheight() { - return containerheight; - } - - public void setContainerheight(Double containerheight) { - this.containerheight = containerheight; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getOwnerid() { - return ownerid; - } - - public void setOwnerid(String ownerid) { - this.ownerid = ownerid; - } - - public String getTxt() { - return txt; - } - - public void setTxt(String txt) { - this.txt = txt; - } - - public String getFsize() { - return fsize; - } - - public void setFsize(String fsize) { - this.fsize = fsize; - } - - public Integer getAccuracy() { - return accuracy; - } - - public void setAccuracy(Integer accuracy) { - this.accuracy = accuracy; - } - - public String getExpressionflag() { - return expressionflag; - } - - public void setExpressionflag(String expressionflag) { - this.expressionflag = expressionflag; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ScadaPic_MPoint_Expression.java b/src/com/sipai/entity/work/ScadaPic_MPoint_Expression.java deleted file mode 100644 index 010f301e..00000000 --- a/src/com/sipai/entity/work/ScadaPic_MPoint_Expression.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ScadaPic_MPoint_Expression extends SQLAdapter{ - private String id; - - private String mpid; - - private String expression; - - private String expressionway; - - private String insdt; - - private String insuser; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getExpression() { - return expression; - } - - public void setExpression(String expression) { - this.expression = expression; - } - - public String getExpressionway() { - return expressionway; - } - - public void setExpressionway(String expressionway) { - this.expressionway = expressionway; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ScadaPic_ProcessSection.java b/src/com/sipai/entity/work/ScadaPic_ProcessSection.java deleted file mode 100644 index afe8d6e2..00000000 --- a/src/com/sipai/entity/work/ScadaPic_ProcessSection.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.ProcessSection; - -public class ScadaPic_ProcessSection extends SQLAdapter{ - private String id; - - private String pid; - - private String processsectionid; - - private Double posx; - - private Double posy; - - private Double containerwidth; - - private Double containerheight; - - private Double width; - - private Double height; - - private String picurl; - - private String ownerid; - - private String txt; - - private String insuser; - - private String insdt; - - private int alarmNumber;//报警数量 - - private int problemNumber;//缺陷数量 - - private int professorNumber;//专家建议数量 - - public int getProfessorNumber() { - return professorNumber; - } - - public void setProfessorNumber(int professorNumber) { - this.professorNumber = professorNumber; - } - - public int getProblemNumber() { - return problemNumber; - } - - public void setProblemNumber(int problemNumber) { - this.problemNumber = problemNumber; - } - - public int getAlarmNumber() { - return alarmNumber; - } - - public void setAlarmNumber(int alarmNumber) { - this.alarmNumber = alarmNumber; - } - private ProcessSection processSection; - private String processSectionName; - - public String getProcessSectionName() { - return processSectionName; - } - - public void setProcessSectionName(String processSectionName) { - this.processSectionName = processSectionName; - } - - public ProcessSection getProcessSection() { - return processSection; - } - - public void setProcessSection(ProcessSection processSection) { - this.processSection = processSection; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getProcesssectionid() { - return processsectionid; - } - - public void setProcesssectionid(String processsectionid) { - this.processsectionid = processsectionid; - } - - public Double getPosx() { - return posx; - } - - public void setPosx(Double posx) { - this.posx = posx; - } - - public Double getPosy() { - return posy; - } - - public void setPosy(Double posy) { - this.posy = posy; - } - - public Double getContainerwidth() { - return containerwidth; - } - - public void setContainerwidth(Double containerwidth) { - this.containerwidth = containerwidth; - } - - public Double getContainerheight() { - return containerheight; - } - - public void setContainerheight(Double containerheight) { - this.containerheight = containerheight; - } - - public Double getWidth() { - return width; - } - - public void setWidth(Double width) { - this.width = width; - } - - public Double getHeight() { - return height; - } - - public void setHeight(Double height) { - this.height = height; - } - - public String getPicurl() { - return picurl; - } - - public void setPicurl(String picurl) { - this.picurl = picurl; - } - - public String getOwnerid() { - return ownerid; - } - - public void setOwnerid(String ownerid) { - this.ownerid = ownerid; - } - - public String getTxt() { - return txt; - } - - public void setTxt(String txt) { - this.txt = txt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ScadaPic_Txt.java b/src/com/sipai/entity/work/ScadaPic_Txt.java deleted file mode 100644 index d75d1327..00000000 --- a/src/com/sipai/entity/work/ScadaPic_Txt.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ScadaPic_Txt extends SQLAdapter{ - public final static String Flag_Txt="1";//可视化文本 - public final static String Flag_MPoint="2";//可视化测量点 - public final static String Flag_EM="3";//可视化设备 - public final static String Flag_PS="4";//可视化工艺段 - - public final static String Type_Prime="1";//总工艺图 - public final static String Type_Detail="2";//工艺段图 - private String id; - - private String pid; - - private Double posx; - - private Double posy; - - private Double containerwidth; - - private Double containerheight; - - private String insuser; - - private String insdt; - - private String content; - - private String ownerid; - - private String fsize; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Double getPosx() { - return posx; - } - - public void setPosx(Double posx) { - this.posx = posx; - } - - public Double getPosy() { - return posy; - } - - public void setPosy(Double posy) { - this.posy = posy; - } - - public Double getContainerwidth() { - return containerwidth; - } - - public void setContainerwidth(Double containerwidth) { - this.containerwidth = containerwidth; - } - - public Double getContainerheight() { - return containerheight; - } - - public void setContainerheight(Double containerheight) { - this.containerheight = containerheight; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getOwnerid() { - return ownerid; - } - - public void setOwnerid(String ownerid) { - this.ownerid = ownerid; - } - - public String getFsize() { - return fsize; - } - - public void setFsize(String fsize) { - this.fsize = fsize; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/Scheduling.java b/src/com/sipai/entity/work/Scheduling.java deleted file mode 100644 index 3d18f7f1..00000000 --- a/src/com/sipai/entity/work/Scheduling.java +++ /dev/null @@ -1,343 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class Scheduling extends SQLAdapter { -// public static Integer Status_Unarranged = 0;//未排班 -// public static Integer Status_Arranged = 1;//已排班 - public static Integer Status_UnSucceeded = 1;//未接班 - public static Integer Status_Succeeded = 2;//已接班 - public static Integer Status_Handovered = 3;//已交班 - - public static Integer IsTypeSetting_False = 0;//未排班 - public static Integer IsTypeSetting_True = 1;//排班 - - private String id; - - private String insdt; - - private String insuser; - - private String grouptypeid; - - private String bizid; - - private String userids; - - private String groupdetailId; - - private String groupmanageid; - - private String schedulingtype; - - private String patrolmode; - - private String areaid; - - private String stdt; - - private String eddt; - - private Integer status; - - private Integer istypesetting; - - private String succeeduser; - - private String succeeddt; - - private String succeedremark; - - private String handoveruser; - - private String handoverdt; - - private String workpeople; - - /* 连表查询 */ - private String _groupTimename; - - private String _groupDetailName; - - private String _groupTypeName; - - private String _succeeduser; - private String _handoveruser; - private String _workpeopleName; - - private String patroltypeName;//巡逻类型 - private String patrolmodeName;//巡逻模式 - - //确认排班日期 - private String date; - - private boolean repeat;//是否重复标识 - - private Integer repeatInterval;//重复间隔 - - private String repeatEddt;//重复截至日期 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getGrouptypeid() { - return grouptypeid; - } - - public void setGrouptypeid(String grouptypeid) { - this.grouptypeid = grouptypeid == null ? null : grouptypeid.trim(); - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid == null ? null : bizid.trim(); - } - - public String getUserids() { - return userids; - } - - public void setUserids(String userids) { - this.userids = userids == null ? null : userids.trim(); - } - - public String getGroupdetailId() { - return groupdetailId; - } - - public void setGroupdetailId(String groupdetailId) { - this.groupdetailId = groupdetailId == null ? null : groupdetailId.trim(); - } - - public String getSchedulingtype() { - return schedulingtype; - } - - public void setSchedulingtype(String schedulingtype) { - this.schedulingtype = schedulingtype == null ? null : schedulingtype.trim(); - } - - public String getPatrolmode() { - return patrolmode; - } - - public void setPatrolmode(String patrolmode) { - this.patrolmode = patrolmode == null ? null : patrolmode.trim(); - } - - public String getAreaid() { - return areaid; - } - - public void setAreaid(String areaid) { - this.areaid = areaid == null ? null : areaid.trim(); - } - - public String getStdt() { - return stdt; - } - - public void setStdt(String stdt) { - this.stdt = stdt; - } - - public String getEddt() { - return eddt; - } - - public void setEddt(String eddt) { - this.eddt = eddt; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Integer getIstypesetting() { - return istypesetting; - } - - public void setIstypesetting(Integer istypesetting) { - this.istypesetting = istypesetting; - } - - public String getSucceeduser() { - return succeeduser; - } - - public void setSucceeduser(String succeeduser) { - this.succeeduser = succeeduser == null ? null : succeeduser.trim(); - } - - public String getSucceeddt() { - return succeeddt; - } - - public void setSucceeddt(String succeeddt) { - this.succeeddt = succeeddt; - } - - public String getSucceedremark() { - return succeedremark; - } - - public void setSucceedremark(String succeedremark) { - this.succeedremark = succeedremark == null ? null : succeedremark.trim(); - } - - public String getHandoveruser() { - return handoveruser; - } - - public void setHandoveruser(String handoveruser) { - this.handoveruser = handoveruser == null ? null : handoveruser.trim(); - } - - public String getHandoverdt() { - return handoverdt; - } - - public void setHandoverdt(String handoverdt) { - this.handoverdt = handoverdt; - } - - public String getWorkpeople() { - return workpeople; - } - - public void setWorkpeople(String workpeople) { - this.workpeople = workpeople; - } - - public String get_groupTimename() { - return _groupTimename; - } - - public void set_groupTimename(String _groupTimename) { - this._groupTimename = _groupTimename; - } - - public String get_groupDetailName() { - return _groupDetailName; - } - - public void set_groupDetailName(String _groupDetailName) { - this._groupDetailName = _groupDetailName; - } - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public boolean getRepeat() { - return repeat; - } - - public void setRepeat(boolean repeat) { - this.repeat = repeat; - } - - public Integer getRepeatInterval() { - return repeatInterval; - } - - public void setRepeatInterval(Integer repeatInterval) { - this.repeatInterval = repeatInterval; - } - - public String getRepeatEddt() { - return repeatEddt; - } - - public void setRepeatEddt(String repeatEddt) { - this.repeatEddt = repeatEddt; - } - - public String getGroupmanageid() { - return groupmanageid; - } - - public void setGroupmanageid(String groupmanageid) { - this.groupmanageid = groupmanageid; - } - - public String get_groupTypeName() { - return _groupTypeName; - } - - public void set_groupTypeName(String _groupTypeName) { - this._groupTypeName = _groupTypeName; - } - - public String get_succeeduser() { - return _succeeduser; - } - - public void set_succeeduser(String _succeeduser) { - this._succeeduser = _succeeduser; - } - - public String get_handoveruser() { - return _handoveruser; - } - - public void set_handoveruser(String _handoveruser) { - this._handoveruser = _handoveruser; - } - - public String get_workpeopleName() { - return _workpeopleName; - } - - public void set_workpeopleName(String _workpeopleName) { - this._workpeopleName = _workpeopleName; - } - - public String getPatrolmodeName() { - return patrolmodeName; - } - - public void setPatrolmodeName(String patrolmodeName) { - this.patrolmodeName = patrolmodeName; - } - - public String getPatroltypeName() { - return patroltypeName; - } - - public void setPatroltypeName(String patroltypeName) { - this.patroltypeName = patroltypeName; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/SchedulingReplaceJob.java b/src/com/sipai/entity/work/SchedulingReplaceJob.java deleted file mode 100644 index b13bb514..00000000 --- a/src/com/sipai/entity/work/SchedulingReplaceJob.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class SchedulingReplaceJob extends SQLAdapter { - - private String id; - - private String replacetime; - - private String oldpeople; - - private String replacepeople; - - private String schedulingid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getReplacetime() { - return replacetime; - } - - public void setReplacetime(String replacetime) { - this.replacetime = replacetime; - } - - public String getOldpeople() { - return oldpeople; - } - - public void setOldpeople(String oldpeople) { - this.oldpeople = oldpeople; - } - - public String getReplacepeople() { - return replacepeople; - } - - public void setReplacepeople(String replacepeople) { - this.replacepeople = replacepeople; - } - - public String getSchedulingid() { - return schedulingid; - } - - public void setSchedulingid(String schedulingid) { - this.schedulingid = schedulingid; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/ShiftRecord.java b/src/com/sipai/entity/work/ShiftRecord.java deleted file mode 100644 index bba5ee96..00000000 --- a/src/com/sipai/entity/work/ShiftRecord.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.entity.work; - -import java.util.Date; - -import com.sipai.entity.base.SQLAdapter; - -public class ShiftRecord extends SQLAdapter{ - public static final String Flag_Incomming="0"; - public static final String Flag_GoodProducts="1"; - public static final String Flag_Rejects="2"; - public static final String Flag_Scrap="3"; - public static final String[] VernierTypes_CompleteInspect={"1","2","3"}; //全检type集合 - public static final String[] VernierTypes_ChangeShift={"1"}; //换架type集合 - - private String id; - private String shiftno; - private String workorderno; - private String procedureno; - private String insdt; - private Integer amount; - private String insuser; - private String keyStoveno; - private String keyPrintinglineno; - private String pid; - private String remark; - private String workstationno; - private String type; - private String status; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getShiftno() { - return shiftno; - } - - public void setShiftno(String shiftno) { - this.shiftno = shiftno; - } - - public String getWorkorderno() { - return workorderno; - } - - public void setWorkorderno(String workorderno) { - this.workorderno = workorderno; - } - - public String getProcedureno() { - return procedureno; - } - - public void setProcedureno(String procedureno) { - this.procedureno = procedureno; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public Integer getAmount() { - return amount; - } - - public void setAmount(Integer amount) { - this.amount = amount; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getKeyStoveno() { - return keyStoveno; - } - - public void setKeyStoveno(String keyStoveno) { - this.keyStoveno = keyStoveno; - } - - public String getKeyPrintinglineno() { - return keyPrintinglineno; - } - - public void setKeyPrintinglineno(String keyPrintinglineno) { - this.keyPrintinglineno = keyPrintinglineno; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getWorkstationno() { - return workstationno; - } - - public void setWorkstationno(String workstationno) { - this.workstationno = workstationno; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/SpeechRecognition.java b/src/com/sipai/entity/work/SpeechRecognition.java deleted file mode 100644 index 8d20b757..00000000 --- a/src/com/sipai/entity/work/SpeechRecognition.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class SpeechRecognition extends SQLAdapter { - public final static String SpeakType_One = "one"; - public final static String SpeakType_AnyNumber = "anynumber"; - public final static String SpeakType_All = "all"; - - private String id; - private String text; - private Integer textlength; - private String type; - private String systype; - private String method; - private String respondvoice; - private String remark; - private String unitid; - private String code; - - private Integer cknum;//二次check时用 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public Integer getTextlength() { - return textlength; - } - - public void setTextlength(Integer textlength) { - this.textlength = textlength; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSystype() { - return systype; - } - - public void setSystype(String systype) { - this.systype = systype; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public String getRespondvoice() { - return respondvoice; - } - - public void setRespondvoice(String respondvoice) { - this.respondvoice = respondvoice; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Integer getCknum() { - return cknum; - } - - public void setCknum(Integer cknum) { - this.cknum = cknum; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/SpeechRecognitionMpRespond.java b/src/com/sipai/entity/work/SpeechRecognitionMpRespond.java deleted file mode 100644 index 07c3a21c..00000000 --- a/src/com/sipai/entity/work/SpeechRecognitionMpRespond.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class SpeechRecognitionMpRespond extends SQLAdapter { - - private String id; - - private String pid; - - private String pname; - - private String mpid; - - private Double jsvalue; - - private String jsmethod; - - private String valuemethod; - - private Integer morder; - - private String respondtextTrue; - - private String respondtextFalse; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getPname() { - return pname; - } - - public void setPname(String pname) { - this.pname = pname == null ? null : pname.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public Double getJsvalue() { - return jsvalue; - } - - public void setJsvalue(Double jsvalue) { - this.jsvalue = jsvalue; - } - - public String getJsmethod() { - return jsmethod; - } - - public void setJsmethod(String jsmethod) { - this.jsmethod = jsmethod == null ? null : jsmethod.trim(); - } - - public String getValuemethod() { - return valuemethod; - } - - public void setValuemethod(String valuemethod) { - this.valuemethod = valuemethod == null ? null : valuemethod.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getRespondtextTrue() { - return respondtextTrue; - } - - public void setRespondtextTrue(String respondtextTrue) { - this.respondtextTrue = respondtextTrue == null ? null : respondtextTrue.trim(); - } - - public String getRespondtextFalse() { - return respondtextFalse; - } - - public void setRespondtextFalse(String respondtextFalse) { - this.respondtextFalse = respondtextFalse == null ? null : respondtextFalse.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/UserWorkStation.java b/src/com/sipai/entity/work/UserWorkStation.java deleted file mode 100644 index 6944d417..00000000 --- a/src/com/sipai/entity/work/UserWorkStation.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class UserWorkStation extends SQLAdapter{ - private String id; - - private String userid; - - private String workstationid; - - private String insuser; - - private String insdt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getUserid() { - return userid; - } - - public void setUserid(String userid) { - this.userid = userid; - } - - public String getWorkstationid() { - return workstationid; - } - - public void setWorkstationid(String workstationid) { - this.workstationid = workstationid; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/Weather.java b/src/com/sipai/entity/work/Weather.java deleted file mode 100644 index a4b6c359..00000000 --- a/src/com/sipai/entity/work/Weather.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class Weather extends SQLAdapter{ - private String temperature; - - private String weather; - - private String temprange; - - private String airquality; - - private String humidity; - - private String realfeel; - - private String ultraviolet; - - private String pressure; - - private String airspeed; - - private String winddirection; - - private String datetime; - - public String getTemperature() { - return temperature; - } - - public void setTemperature(String temperature) { - this.temperature = temperature; - } - - public String getWeather() { - return weather; - } - - public void setWeather(String weather) { - this.weather = weather; - } - - public String getTemprange() { - return temprange; - } - - public void setTemprange(String temprange) { - this.temprange = temprange; - } - - public String getAirquality() { - return airquality; - } - - public void setAirquality(String airquality) { - this.airquality = airquality; - } - - public String getHumidity() { - return humidity; - } - - public void setHumidity(String humidity) { - this.humidity = humidity; - } - - public String getRealfeel() { - return realfeel; - } - - public void setRealfeel(String realfeel) { - this.realfeel = realfeel; - } - - public String getUltraviolet() { - return ultraviolet; - } - - public void setUltraviolet(String ultraviolet) { - this.ultraviolet = ultraviolet; - } - - public String getPressure() { - return pressure; - } - - public void setPressure(String pressure) { - this.pressure = pressure; - } - - public String getAirspeed() { - return airspeed; - } - - public void setAirspeed(String airspeed) { - this.airspeed = airspeed; - } - - public String getWinddirection() { - return winddirection; - } - - public void setWinddirection(String winddirection) { - this.winddirection = winddirection; - } - - public String getStringtime() { - return datetime; - } - - public void setStringtime(String datetime) { - this.datetime = datetime; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WeatherNew.java b/src/com/sipai/entity/work/WeatherNew.java deleted file mode 100644 index 66e2e1b7..00000000 --- a/src/com/sipai/entity/work/WeatherNew.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WeatherNew extends SQLAdapter { - private String id; - - private String time; - - private String city; - - private String weather; - - private String temp; - - private String wind; - - private String humidity; - - private String bizid; - - private String highTemp; - - private String lowTemp; - - private String windPower; - - private String precip; - - private String feelslike; - - private String pressure; - - private String vis; - - private String windspeed; - - private Integer type; - - private String tide; - - private String sort; - - private String companyName; - - public String getTide() { - return tide; - } - - public void setTide(String tide) { - this.tide = tide; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getSort() { - return sort; - } - - public void setSort(String sort) { - this.sort = sort; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city == null ? null : city.trim(); - } - - public String getWeather() { - return weather; - } - - public void setWeather(String weather) { - this.weather = weather == null ? null : weather.trim(); - } - - public String getTemp() { - return temp; - } - - public void setTemp(String temp) { - this.temp = temp == null ? null : temp.trim(); - } - - public String getWind() { - return wind; - } - - public void setWind(String wind) { - this.wind = wind == null ? null : wind.trim(); - } - - public String getHumidity() { - return humidity; - } - - public void setHumidity(String humidity) { - this.humidity = humidity == null ? null : humidity.trim(); - } - - public String getBizid() { - return bizid; - } - - public void setBizid(String bizid) { - this.bizid = bizid == null ? null : bizid.trim(); - } - - public String getHighTemp() { - return highTemp; - } - - public void setHighTemp(String highTemp) { - this.highTemp = highTemp == null ? null : highTemp.trim(); - } - - public String getLowTemp() { - return lowTemp; - } - - public void setLowTemp(String lowTemp) { - this.lowTemp = lowTemp == null ? null : lowTemp.trim(); - } - - public String getWindPower() { - return windPower; - } - - public void setWindPower(String windPower) { - this.windPower = windPower == null ? null : windPower.trim(); - } - - public String getPrecip() { - return precip; - } - - public void setPrecip(String precip) { - this.precip = precip == null ? null : precip.trim(); - } - - public String getFeelslike() { - return feelslike; - } - - public void setFeelslike(String feelslike) { - this.feelslike = feelslike == null ? null : feelslike.trim(); - } - - public String getPressure() { - return pressure; - } - - public void setPressure(String pressure) { - this.pressure = pressure == null ? null : pressure.trim(); - } - - public String getVis() { - return vis; - } - - public void setVis(String vis) { - this.vis = vis == null ? null : vis.trim(); - } - - public String getWindspeed() { - return windspeed; - } - - public void setWindspeed(String windspeed) { - this.windspeed = windspeed == null ? null : windspeed.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WeatherSaveName.java b/src/com/sipai/entity/work/WeatherSaveName.java deleted file mode 100644 index b43b1402..00000000 --- a/src/com/sipai/entity/work/WeatherSaveName.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.sipai.entity.work; - - -public class WeatherSaveName { - private Integer id; - - private String tbWeatherName; - - private String tbWeatherSaveName; - - private String where; - - private Integer type; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getTbWeatherName() { - return tbWeatherName; - } - - public void setTbWeatherName(String tbWeatherName) { - this.tbWeatherName = tbWeatherName; - } - - public String getTbWeatherSaveName() { - return tbWeatherSaveName; - } - - public void setTbWeatherSaveName(String tbWeatherSaveName) { - this.tbWeatherSaveName = tbWeatherSaveName; - } - - public String getWhere() { - return where; - } - - public void setWhere(String where) { - this.where = where; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportContent.java b/src/com/sipai/entity/work/WordAnalysisReportContent.java deleted file mode 100644 index c74b4cd6..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportContent.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportContent extends SQLAdapter{ - public final static String Type_form="0";//表格 - public final static String Type_curve="1";//曲线 - public final static String Type_text="2";//文本 - - public final static String CurveType_line="line";//折线图 - public final static String CurveType_bar="bar";//柱状图 - public final static String CurveType_pie="pie";//饼图 - - public final static String Axis_single="单轴";//单轴 - public final static String Axis_multi="多轴";//多轴 - - private String id; - - private String pid; - - private String insuser; - - private String insdt; - - private String name; - - private String type; - - private String curvetype; - - private String axis; - - private String textcontent; - - private Integer morder; - - private String curvewidth; - - private String curveheight; - - private String curveunit; - - private String curvescalest; - - private String curvemaxvalue; - - private String curveminvalue; - - private String curveinterval; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getCurvetype() { - return curvetype; - } - - public void setCurvetype(String curvetype) { - this.curvetype = curvetype == null ? null : curvetype.trim(); - } - - public String getAxis() { - return axis; - } - - public void setAxis(String axis) { - this.axis = axis == null ? null : axis.trim(); - } - - public String getTextcontent() { - return textcontent; - } - - public void setTextcontent(String textcontent) { - this.textcontent = textcontent == null ? null : textcontent.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getCurvewidth() { - return curvewidth; - } - - public void setCurvewidth(String curvewidth) { - this.curvewidth = curvewidth == null ? null : curvewidth.trim(); - } - - public String getCurveheight() { - return curveheight; - } - - public void setCurveheight(String curveheight) { - this.curveheight = curveheight == null ? null : curveheight.trim(); - } - - public String getCurveunit() { - return curveunit; - } - - public void setCurveunit(String curveunit) { - this.curveunit = curveunit == null ? null : curveunit.trim(); - } - - public String getCurvescalest() { - return curvescalest; - } - - public void setCurvescalest(String curvescalest) { - this.curvescalest = curvescalest == null ? null : curvescalest.trim(); - } - - public String getCurvemaxvalue() { - return curvemaxvalue; - } - - public void setCurvemaxvalue(String curvemaxvalue) { - this.curvemaxvalue = curvemaxvalue == null ? null : curvemaxvalue.trim(); - } - - public String getCurveminvalue() { - return curveminvalue; - } - - public void setCurveminvalue(String curveminvalue) { - this.curveminvalue = curveminvalue == null ? null : curveminvalue.trim(); - } - - public String getCurveinterval() { - return curveinterval; - } - - public void setCurveinterval(String curveinterval) { - this.curveinterval = curveinterval == null ? null : curveinterval.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportContentCurve.java b/src/com/sipai/entity/work/WordAnalysisReportContentCurve.java deleted file mode 100644 index b31f1f44..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportContentCurve.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportContentCurve extends SQLAdapter { - public final static String ValueRange_hisData = "hisData";//历史数据 - public final static String ValueRange_nowMonth = "nowMonth";//本月数据 - public final static String ValueRange_lastMonth = "lastMonth";//上月数据 - public final static String ValueRange_formData = "formData";//表格数据 - - public final static String Legendshape_0 = "none";//无图例形状 - public final static String Legendshape_1 = "circle";//圆形 - public final static String Legendshape_2 = "roundRect";//正方形 - public final static String Legendshape_3 = "triangle";//三角形 - public final static String Legendshape_4 = "diamond";//菱形 - public final static String Legendshape_5 = "path://M512 5.339429l16.7936 13.897142C800.416914 245.467429 936.228571 435.390171 936.228571 589.0048c0 235.1104-189.937371 425.706057-424.228571 425.706057S87.771429 824.1152 87.771429 589.0048C87.771429 432.259657 229.185829 237.714286 512 5.339429z m0 57.066057l-4.608 3.8912C255.707429 278.849829 131.657143 454.948571 131.657143 589.0048c0 210.914743 170.320457 381.820343 380.342857 381.820343s380.342857-170.9056 380.342857-381.820343C892.342857 456.382171 770.925714 282.624 524.682971 73.142857L512 62.405486z";//水滴 - public final static String Legendshape_6 = "path://M509.867 189.867L608 411.733l243.2 25.6-181.333 162.134 51.2 238.933-211.2-121.6-211.2 121.6 51.2-238.933L168.533 435.2l243.2-25.6 98.134-219.733z";//五角星 - - private String id; - - private String name; - - private String pid; - - private String mpid; - - private String fixedvalue; - - private Integer axisnum; - - private String calculationmethod; - - private String valuerange; - - private String unitconversion; - - private Integer morder; - - private String legendshape; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid == null ? null : mpid.trim(); - } - - public String getFixedvalue() { - return fixedvalue; - } - - public void setFixedvalue(String fixedvalue) { - this.fixedvalue = fixedvalue == null ? null : fixedvalue.trim(); - } - - public Integer getAxisnum() { - return axisnum; - } - - public void setAxisnum(Integer axisnum) { - this.axisnum = axisnum; - } - - public String getCalculationmethod() { - return calculationmethod; - } - - public void setCalculationmethod(String calculationmethod) { - this.calculationmethod = calculationmethod == null ? null : calculationmethod.trim(); - } - - public String getValuerange() { - return valuerange; - } - - public void setValuerange(String valuerange) { - this.valuerange = valuerange == null ? null : valuerange.trim(); - } - - public String getUnitconversion() { - return unitconversion; - } - - public void setUnitconversion(String unitconversion) { - this.unitconversion = unitconversion == null ? null : unitconversion.trim(); - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getLegendshape() { - return legendshape; - } - - public void setLegendshape(String legendshape) { - this.legendshape = legendshape == null ? null : legendshape.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportContentCurveAxis.java b/src/com/sipai/entity/work/WordAnalysisReportContentCurveAxis.java deleted file mode 100644 index 74143c79..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportContentCurveAxis.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportContentCurveAxis extends SQLAdapter { - private String id; - - private Integer num; - - private String position; - - private String unit; - - private String pid; - - private String curvemaxvalue; - - private String curveminvalue; - - private String curveinterval; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public Integer getNum() { - return num; - } - - public void setNum(Integer num) { - this.num = num; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position == null ? null : position.trim(); - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit == null ? null : unit.trim(); - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getCurvemaxvalue() { - return curvemaxvalue; - } - - public void setCurvemaxvalue(String curvemaxvalue) { - this.curvemaxvalue = curvemaxvalue == null ? null : curvemaxvalue.trim(); - } - - public String getCurveminvalue() { - return curveminvalue; - } - - public void setCurveminvalue(String curveminvalue) { - this.curveminvalue = curveminvalue == null ? null : curveminvalue.trim(); - } - - public String getCurveinterval() { - return curveinterval; - } - - public void setCurveinterval(String curveinterval) { - this.curveinterval = curveinterval == null ? null : curveinterval.trim(); - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportContentForm.java b/src/com/sipai/entity/work/WordAnalysisReportContentForm.java deleted file mode 100644 index be55a18f..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportContentForm.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportContentForm extends SQLAdapter{ - public final static String Type_row="row";//行 - public final static String Type_column="column";//列 - - public final static String ValueRange_nowMonth="nowMonth";//本月数据 - public final static String ValueRange_lastMonth="lastMonth";//上月数据 - public final static String ValueRange_nowYear="nowYear";//本年数据 - public final static String ValueRange_lastYear="lastYear";//去年数据 - public final static String ValueRange_chainComparison="chainComparison";//环比 - public final static String ValueRange_yearOnYear="yearOnYear";//月同比 - public final static String ValueRange_yearOnYear_year="yearOnYear_year";//年同比 - public final static String ValueRange_lastYearToMonth="lastYearToMonth";//去年月同期 - - public final static String Showtextst_TRUE="1";//添加缓存 - public final static String Showtextst_FALSE="0";//不添加缓存 - - private String id; - private String name; - private String pid; - private Integer insertrow; - private Integer insertcolumn; - private Integer columns; - private Integer rows; - private String showtext; - private String showtextst; - private String mpid; - private String calculationmethod; - private String type; - private String valuerange; - private String unitconversion; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Integer getInsertrow() { - return insertrow; - } - - public void setInsertrow(Integer insertrow) { - this.insertrow = insertrow; - } - - public Integer getInsertcolumn() { - return insertcolumn; - } - - public void setInsertcolumn(Integer insertcolumn) { - this.insertcolumn = insertcolumn; - } - - public Integer getColumns() { - return columns; - } - - public void setColumns(Integer columns) { - this.columns = columns; - } - - public Integer getRows() { - return rows; - } - - public void setRows(Integer rows) { - this.rows = rows; - } - - public String getShowtext() { - return showtext; - } - - public void setShowtext(String showtext) { - this.showtext = showtext; - } - - public String getShowtextst() { - return showtextst; - } - - public void setShowtextst(String showtextst) { - this.showtextst = showtextst; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public String getCalculationmethod() { - return calculationmethod; - } - - public void setCalculationmethod(String calculationmethod) { - this.calculationmethod = calculationmethod; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValuerange() { - return valuerange; - } - - public void setValuerange(String valuerange) { - this.valuerange = valuerange; - } - - public String getUnitconversion() { - return unitconversion; - } - - public void setUnitconversion(String unitconversion) { - this.unitconversion = unitconversion; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportFormData.java b/src/com/sipai/entity/work/WordAnalysisReportFormData.java deleted file mode 100644 index 2f77d361..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportFormData.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportFormData extends SQLAdapter{ - - private String id; - - private String mpid; - - private Double value; - - private String pid; - - private String modeformld; - - private String showtext; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getMpid() { - return mpid; - } - - public void setMpid(String mpid) { - this.mpid = mpid; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getModeformld() { - return modeformld; - } - - public void setModeformld(String modeformld) { - this.modeformld = modeformld; - } - - public String getShowtext() { - return showtext; - } - - public void setShowtext(String showtext) { - this.showtext = showtext; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportRecord.java b/src/com/sipai/entity/work/WordAnalysisReportRecord.java deleted file mode 100644 index 8d4d562f..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportRecord.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportRecord extends SQLAdapter{ - - private String id; - - private String name; - - private String sdt; - - private String edt; - - private String pid; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSdt() { - return sdt; - } - - public void setSdt(String sdt) { - this.sdt = sdt; - } - - public String getEdt() { - return edt; - } - - public void setEdt(String edt) { - this.edt = edt; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportStructure.java b/src/com/sipai/entity/work/WordAnalysisReportStructure.java deleted file mode 100644 index fa5012a9..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportStructure.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportStructure extends SQLAdapter{ - public final static String Type_word="-1";//报告 - public final static String Type_title="0";//标题 - public final static String Type_paragraph="1";//正文 - - private String id; - private String name; - private String unitid; - private Integer morder; - private String insuser; - private String insdt; - private String starthour; - private String startday; - private String endday; - private String pid; - private String type; - private String fontsize; - private String boldfont; - private String color; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUnitid() { - return unitid; - } - - public void setUnitid(String unitid) { - this.unitid = unitid; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getStarthour() { - return starthour; - } - - public void setStarthour(String starthour) { - this.starthour = starthour; - } - - public String getStartday() { - return startday; - } - - public void setStartday(String startday) { - this.startday = startday; - } - - public String getEndday() { - return endday; - } - - public void setEndday(String endday) { - this.endday = endday; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getFontsize() { - return fontsize; - } - - public void setFontsize(String fontsize) { - this.fontsize = fontsize; - } - - public String getBoldfont() { - return boldfont; - } - - public void setBoldfont(String boldfont) { - this.boldfont = boldfont; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WordAnalysisReportText.java b/src/com/sipai/entity/work/WordAnalysisReportText.java deleted file mode 100644 index c28c9702..00000000 --- a/src/com/sipai/entity/work/WordAnalysisReportText.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.entity.work; - -import com.sipai.entity.base.SQLAdapter; - -public class WordAnalysisReportText extends SQLAdapter{ - private String id; - - private String text; - - private String pid; - - private String modeformld; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public String getModeformld() { - return modeformld; - } - - public void setModeformld(String modeformld) { - this.modeformld = modeformld; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/work/WorkCommStr.java b/src/com/sipai/entity/work/WorkCommStr.java deleted file mode 100644 index df20a376..00000000 --- a/src/com/sipai/entity/work/WorkCommStr.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sipai.entity.work; - -public class WorkCommStr { - - //接班浮动时间 - public static final Integer Succeed_Minute_Delay = 10;//接班允许延迟时间 - public static final Integer Succeed_Minute_Early = 120;//接班允许提早时间 -} diff --git a/src/com/sipai/entity/workorder/Overhaul.java b/src/com/sipai/entity/workorder/Overhaul.java deleted file mode 100644 index a9f32c6f..00000000 --- a/src/com/sipai/entity/workorder/Overhaul.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -/** - * 设备大修 sj 2020-11-13 - */ -public class Overhaul extends BusinessUnitAdapter { - //计划类型 - public static final String PlanType_IN = "in";//计划内 - public static final String PlanType_OUT = "out";//计划外 - public static final String budgetType_IN = "in"; - public static final String budgetType_OUT = "out"; - - - private String id; - - private String insdt; - - private String insuser; - - private String unitId; - - private String processdefid; - - private String processid; - - private String jobNumber;//工单号 - - private String outsourcingType;//委外状态 - - private String cycleQuota;//大修周期定额 - - private String cycleActual;//大修实际定额 - - private String projectType;//项目类型 -非正常项目类型 - - private String projectName;//项目名称 - - private String budgetType;//预算内/外 - - private float budgetCost;//预算金额(元) - - private String planDate;//计划完成时间 - - private String planId;//关联计划id - - private String equipmentId;//设备id - //11计划中 21审核中 22 审核驳回 31实施中 41验收中 42验收未通过 51已完成 - private String processStatus;//流程状态 - - private String sendUserId;//派单人id/项目负责人 - - private String receiveUserId;//接收人id - private String status; - - private String receiveUserIds;//接受人ids 下发时可以下发多人,一旦有一人签收 receiveUserId 只有一个签收人的Id - private String projectDescribe; - private EquipmentCard equipmentCard; - private User sendUser; - private User receiveUser; - private Company company; - private EquipmentPlanType equipmentPlanType; - - public User getSendUser() { - return sendUser; - } - - public void setSendUser(User sendUser) { - this.sendUser = sendUser; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getOutsourcingType() { - return outsourcingType; - } - - public void setOutsourcingType(String outsourcingType) { - this.outsourcingType = outsourcingType; - } - - public String getCycleQuota() { - return cycleQuota; - } - - public void setCycleQuota(String cycleQuota) { - this.cycleQuota = cycleQuota; - } - - public String getCycleActual() { - return cycleActual; - } - - public void setCycleActual(String cycleActual) { - this.cycleActual = cycleActual; - } - - public String getProjectType() { - return projectType; - } - - public void setProjectType(String projectType) { - this.projectType = projectType; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getBudgetType() { - return budgetType; - } - - public void setBudgetType(String budgetType) { - this.budgetType = budgetType; - } - - public float getBudgetCost() { - return budgetCost; - } - - public void setBudgetCost(float budgetCost) { - this.budgetCost = budgetCost; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentPlanType getEquipmentPlanType() { - return equipmentPlanType; - } - - public void setEquipmentPlanType(EquipmentPlanType equipmentPlanType) { - this.equipmentPlanType = equipmentPlanType; - } - - public String getProjectDescribe() { - return projectDescribe; - } - - public void setProjectDescribe(String projectDescribe) { - this.projectDescribe = projectDescribe; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/OverhaulItemContent.java b/src/com/sipai/entity/workorder/OverhaulItemContent.java deleted file mode 100644 index bff3c4d6..00000000 --- a/src/com/sipai/entity/workorder/OverhaulItemContent.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 设备大修分项内容 sj 2020-11-17 - */ -public class OverhaulItemContent extends SQLAdapter { - - private String id; - - private String insdt; - - private String insuser; - - private String contents;//分项内容 - - private float progress;//分项进度 - - private float baseHours;//分项定额工时 - - private float workingHours;//分项实际工时 - - private String startDate;//分项开始时间 - - private String finishDate;//分项完成时间 - - private String itemId;//分项模块id - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - public float getProgress() { - return progress; - } - - public void setProgress(float progress) { - this.progress = progress; - } - - public float getBaseHours() { - return baseHours; - } - - public void setBaseHours(float baseHours) { - this.baseHours = baseHours; - } - - public float getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(float workingHours) { - this.workingHours = workingHours; - } - - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getFinishDate() { - return finishDate; - } - - public void setFinishDate(String finishDate) { - this.finishDate = finishDate; - } - - public String getItemId() { - return itemId; - } - - public void setItemId(String itemId) { - this.itemId = itemId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/OverhaulItemEquipment.java b/src/com/sipai/entity/workorder/OverhaulItemEquipment.java deleted file mode 100644 index ad018640..00000000 --- a/src/com/sipai/entity/workorder/OverhaulItemEquipment.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.SQLAdapter; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -public class OverhaulItemEquipment extends SQLAdapter { - private String id; - - private String equipmentId; - - private String quotaHour; - - private String actualHour; - - private String quotaFee; - - private String actualFee; - - private String pid; - - private String insdt; - - private String insuser; - - private String planEndDate; - private String planStartDate; - private String equipmentValue; - private String equipmentName; - - - - - - public String getEquipmentValue() { - return equipmentValue; - } - - public void setEquipmentValue(String equipmentValue) { - this.equipmentValue = equipmentValue; - } - - public String getEquipmentName() { - return equipmentName; - } - - public void setEquipmentName(String equipmentName) { - this.equipmentName = equipmentName; - } - - public String getPlanEndDate() { - return planEndDate; - } - - public void setPlanEndDate(String planEndDate) { - this.planEndDate = planEndDate; - } - - public String getPlanStartDate() { - return planStartDate; - } - - public void setPlanStartDate(String planStartDate) { - this.planStartDate = planStartDate; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId == null ? null : equipmentId.trim(); - } - - public String getQuotaHour() { - return quotaHour; - } - - public void setQuotaHour(String quotaHour) { - this.quotaHour = quotaHour; - } - - public String getActualHour() { - return actualHour; - } - - public void setActualHour(String actualHour) { - this.actualHour = actualHour; - } - - public String getQuotaFee() { - return quotaFee; - } - - public void setQuotaFee(String quotaFee) { - this.quotaFee = quotaFee; - } - - public String getActualFee() { - return actualFee; - } - - public void setActualFee(String actualFee) { - this.actualFee = actualFee; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid == null ? null : pid.trim(); - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser == null ? null : insuser.trim(); - } -} diff --git a/src/com/sipai/entity/workorder/OverhaulItemProject.java b/src/com/sipai/entity/workorder/OverhaulItemProject.java deleted file mode 100644 index 854468b2..00000000 --- a/src/com/sipai/entity/workorder/OverhaulItemProject.java +++ /dev/null @@ -1,342 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.SQLAdapter; - -/** - * 设备大修分项项目 sj 2020-11-17 - */ -public class OverhaulItemProject extends BusinessUnitAdapter { - public final static String Status_Start="start";//开始 - public final static String Status_Finish="finish";//完成 - - private OverhaulType overhaulType;//大修分项配置表 - - private String id; - - private String insdt; - - private String insuser; - - private String processStatus;//流程状态 - - private String processdefid; - - private String processid; - - private String unitId; - - private String jobNumber;//工单号 - - private String projectTypeId;//项目名Id - - private String sendUserId;//发单人id - - private String receiveUserId;//接单人id - - private String receiveUserIds; - - private String receiveUserName; - - private String receiveUsersName; - - private String receiveDt;//接单时间 - - private String planStartDate;//计划开始时间 - - private String planFinishDate;//计划结束时间 - - private String projectId;//大修项目id tb_maintenance_overhaul表id - - private String finishExplain;//工单完成情况说明 - - private float difficultyDegree;//难度系数 - - private float workEvaluateScore;//工单评价得分 - - private float workingHours;//working_hours - - private String evaluateExplain;//评价说明 - - private String outsourcingType;//委外类型 - - private String safeOperationType;//工作票类型 - - private float checkScore;//验收得分 - - private float installEvaluateScore;//安装验收得分 - - private String installProblems;//安装存在问题 - - private float debugEvaluateScore;//调试评价得分 - - private String debugProblems;//调试存在问题 - - private int morder;//排序 - - private int annex; - - public OverhaulType getOverhaulType() { - return overhaulType; - } - - public void setOverhaulType(OverhaulType overhaulType) { - this.overhaulType = overhaulType; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getProcessStatus() { - return processStatus; - } - - public void setProcessStatus(String processStatus) { - this.processStatus = processStatus; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getProjectTypeId() { - return projectTypeId; - } - - public void setProjectTypeId(String projectTypeId) { - this.projectTypeId = projectTypeId; - } - - public String getSendUserId() { - return sendUserId; - } - - public void setSendUserId(String sendUserId) { - this.sendUserId = sendUserId; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getReceiveDt() { - return receiveDt; - } - - public void setReceiveDt(String receiveDt) { - this.receiveDt = receiveDt; - } - - public String getPlanStartDate() { - return planStartDate; - } - - public void setPlanStartDate(String planStartDate) { - this.planStartDate = planStartDate; - } - - public String getPlanFinishDate() { - return planFinishDate; - } - - public void setPlanFinishDate(String planFinishDate) { - this.planFinishDate = planFinishDate; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getFinishExplain() { - return finishExplain; - } - - public void setFinishExplain(String finishExplain) { - this.finishExplain = finishExplain; - } - - public float getDifficultyDegree() { - return difficultyDegree; - } - - public void setDifficultyDegree(float difficultyDegree) { - this.difficultyDegree = difficultyDegree; - } - - public float getWorkEvaluateScore() { - return workEvaluateScore; - } - - public void setWorkEvaluateScore(float workEvaluateScore) { - this.workEvaluateScore = workEvaluateScore; - } - - public float getWorkingHours() { - return workingHours; - } - - public void setWorkingHours(float workingHours) { - this.workingHours = workingHours; - } - - public String getEvaluateExplain() { - return evaluateExplain; - } - - public void setEvaluateExplain(String evaluateExplain) { - this.evaluateExplain = evaluateExplain; - } - - public String getOutsourcingType() { - return outsourcingType; - } - - public void setOutsourcingType(String outsourcingType) { - this.outsourcingType = outsourcingType; - } - - public String getSafeOperationType() { - return safeOperationType; - } - - public void setSafeOperationType(String safeOperationType) { - this.safeOperationType = safeOperationType; - } - - public float getCheckScore() { - return checkScore; - } - - public void setCheckScore(float checkScore) { - this.checkScore = checkScore; - } - - public float getInstallEvaluateScore() { - return installEvaluateScore; - } - - public void setInstallEvaluateScore(float installEvaluateScore) { - this.installEvaluateScore = installEvaluateScore; - } - - public String getInstallProblems() { - return installProblems; - } - - public void setInstallProblems(String installProblems) { - this.installProblems = installProblems; - } - - public float getDebugEvaluateScore() { - return debugEvaluateScore; - } - - public void setDebugEvaluateScore(float debugEvaluateScore) { - this.debugEvaluateScore = debugEvaluateScore; - } - - public String getDebugProblems() { - return debugProblems; - } - - public void setDebugProblems(String debugProblems) { - this.debugProblems = debugProblems; - } - - public int getMorder() { - return morder; - } - - public void setMorder(int morder) { - this.morder = morder; - } - - public String getReceiveUserName() { - return receiveUserName; - } - - public void setReceiveUserName(String receiveUserName) { - this.receiveUserName = receiveUserName; - } - - public String getReceiveUsersName() { - return receiveUsersName; - } - - public void setReceiveUsersName(String receiveUsersName) { - this.receiveUsersName = receiveUsersName; - } - - public int getAnnex() { - return annex; - } - - public void setAnnex(int annex) { - this.annex = annex; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/OverhaulStatistics.java b/src/com/sipai/entity/workorder/OverhaulStatistics.java deleted file mode 100644 index c9c3be2d..00000000 --- a/src/com/sipai/entity/workorder/OverhaulStatistics.java +++ /dev/null @@ -1,880 +0,0 @@ -package com.sipai.entity.workorder; - -import java.math.BigDecimal; -import java.util.Date; - -public class OverhaulStatistics { - - private String id; - - - private String overhaulId; - - - private String subOrderHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.award_punishment_hours - * - * @mbggenerated - */ - private String awardPunishmentHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.worker_num - * - * @mbggenerated - */ - private Integer workerNum; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.self_repair_hours - * - * @mbggenerated - */ - private String selfRepairHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.material_cost - * - * @mbggenerated - */ - private String materialCost; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.total_overhaul_cost - * - * @mbggenerated - */ - private String totalOverhaulCost; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.out_repair_hours - * - * @mbggenerated - */ - private String outRepairHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.actual_self_hours - * - * @mbggenerated - */ - private String actualSelfHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.actual_material_cost - * - * @mbggenerated - */ - private String actualMaterialCost; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.actual_out_hour_cost - * - * @mbggenerated - */ - private String actualOutHourCost; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.actual_total_cost - * - * @mbggenerated - */ - private String actualTotalCost; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.is_normal - * - * @mbggenerated - */ - private String isNormal; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.difference_des - * - * @mbggenerated - */ - private String differenceDes; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.cheak_point - * - * @mbggenerated - */ - private BigDecimal cheakPoint; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.quality_cheak_weight - * - * @mbggenerated - */ - private Byte qualityCheakWeight; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.satisfaction_point - * - * @mbggenerated - */ - private BigDecimal satisfactionPoint; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.coordination_weight - * - * @mbggenerated - */ - private Byte coordinationWeight; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.total_point - * - * @mbggenerated - */ - private BigDecimal totalPoint; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.pro_total_hours - * - * @mbggenerated - */ - private String proTotalHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.level - * - * @mbggenerated - */ - private String level; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.total_hours - * - * @mbggenerated - */ - private String totalHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.description - * - * @mbggenerated - */ - private String description; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.total_quota_hours - * - * @mbggenerated - */ - private String totalQuotaHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.sub_actual_hours - * - * @mbggenerated - */ - private String subActualHours; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.create_time - * - * @mbggenerated - */ - private String createTime; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column tb_overhaul_statistics.update_time - * - * @mbggenerated - */ - private String updateTime; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.id - * - * @return the value of tb_overhaul_statistics.id - * - * @mbggenerated - */ - public String getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.id - * - * @param id the value for tb_overhaul_statistics.id - * - * @mbggenerated - */ - public void setId(String id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.overhaul_id - * - * @return the value of tb_overhaul_statistics.overhaul_id - * - * @mbggenerated - */ - public String getOverhaulId() { - return overhaulId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.overhaul_id - * - * @param overhaulId the value for tb_overhaul_statistics.overhaul_id - * - * @mbggenerated - */ - public void setOverhaulId(String overhaulId) { - this.overhaulId = overhaulId == null ? null : overhaulId.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.sub_order_hours - * - * @return the value of tb_overhaul_statistics.sub_order_hours - * - * @mbggenerated - */ - public String getSubOrderHours() { - return subOrderHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.sub_order_hours - * - * @param subOrderHours the value for tb_overhaul_statistics.sub_order_hours - * - * @mbggenerated - */ - public void setSubOrderHours(String subOrderHours) { - this.subOrderHours = subOrderHours == null ? null : subOrderHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.award_punishment_hours - * - * @return the value of tb_overhaul_statistics.award_punishment_hours - * - * @mbggenerated - */ - public String getAwardPunishmentHours() { - return awardPunishmentHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.award_punishment_hours - * - * @param awardPunishmentHours the value for tb_overhaul_statistics.award_punishment_hours - * - * @mbggenerated - */ - public void setAwardPunishmentHours(String awardPunishmentHours) { - this.awardPunishmentHours = awardPunishmentHours == null ? null : awardPunishmentHours.trim(); - } - - - public Integer getWorkerNum() { - return workerNum; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.worker_num - * - * @param workerNum the value for tb_overhaul_statistics.worker_num - * - * @mbggenerated - */ - public void setWorkerNum(Integer workerNum) { - this.workerNum = workerNum; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.self_repair_hours - * - * @return the value of tb_overhaul_statistics.self_repair_hours - * - * @mbggenerated - */ - public String getSelfRepairHours() { - return selfRepairHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.self_repair_hours - * - * @param selfRepairHours the value for tb_overhaul_statistics.self_repair_hours - * - * @mbggenerated - */ - public void setSelfRepairHours(String selfRepairHours) { - this.selfRepairHours = selfRepairHours == null ? null : selfRepairHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.material_cost - * - * @return the value of tb_overhaul_statistics.material_cost - * - * @mbggenerated - */ - public String getMaterialCost() { - return materialCost; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.material_cost - * - * @param materialCost the value for tb_overhaul_statistics.material_cost - * - * @mbggenerated - */ - public void setMaterialCost(String materialCost) { - this.materialCost = materialCost == null ? null : materialCost.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.total_overhaul_cost - * - * @return the value of tb_overhaul_statistics.total_overhaul_cost - * - * @mbggenerated - */ - public String getTotalOverhaulCost() { - return totalOverhaulCost; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.total_overhaul_cost - * - * @param totalOverhaulCost the value for tb_overhaul_statistics.total_overhaul_cost - * - * @mbggenerated - */ - public void setTotalOverhaulCost(String totalOverhaulCost) { - this.totalOverhaulCost = totalOverhaulCost == null ? null : totalOverhaulCost.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.out_repair_hours - * - * @return the value of tb_overhaul_statistics.out_repair_hours - * - * @mbggenerated - */ - public String getOutRepairHours() { - return outRepairHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.out_repair_hours - * - * @param outRepairHours the value for tb_overhaul_statistics.out_repair_hours - * - * @mbggenerated - */ - public void setOutRepairHours(String outRepairHours) { - this.outRepairHours = outRepairHours == null ? null : outRepairHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.actual_self_hours - * - * @return the value of tb_overhaul_statistics.actual_self_hours - * - * @mbggenerated - */ - public String getActualSelfHours() { - return actualSelfHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.actual_self_hours - * - * @param actualSelfHours the value for tb_overhaul_statistics.actual_self_hours - * - * @mbggenerated - */ - public void setActualSelfHours(String actualSelfHours) { - this.actualSelfHours = actualSelfHours == null ? null : actualSelfHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.actual_material_cost - * - * @return the value of tb_overhaul_statistics.actual_material_cost - * - * @mbggenerated - */ - public String getActualMaterialCost() { - return actualMaterialCost; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.actual_material_cost - * - * @param actualMaterialCost the value for tb_overhaul_statistics.actual_material_cost - * - * @mbggenerated - */ - public void setActualMaterialCost(String actualMaterialCost) { - this.actualMaterialCost = actualMaterialCost == null ? null : actualMaterialCost.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.actual_out_hour_cost - * - * @return the value of tb_overhaul_statistics.actual_out_hour_cost - * - * @mbggenerated - */ - public String getActualOutHourCost() { - return actualOutHourCost; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.actual_out_hour_cost - * - * @param actualOutHourCost the value for tb_overhaul_statistics.actual_out_hour_cost - * - * @mbggenerated - */ - public void setActualOutHourCost(String actualOutHourCost) { - this.actualOutHourCost = actualOutHourCost == null ? null : actualOutHourCost.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.actual_total_cost - * - * @return the value of tb_overhaul_statistics.actual_total_cost - * - * @mbggenerated - */ - public String getActualTotalCost() { - return actualTotalCost; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.actual_total_cost - * - * @param actualTotalCost the value for tb_overhaul_statistics.actual_total_cost - * - * @mbggenerated - */ - public void setActualTotalCost(String actualTotalCost) { - this.actualTotalCost = actualTotalCost == null ? null : actualTotalCost.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.is_normal - * - * @return the value of tb_overhaul_statistics.is_normal - * - * @mbggenerated - */ - public String getIsNormal() { - return isNormal; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.is_normal - * - * @param isNormal the value for tb_overhaul_statistics.is_normal - * - * @mbggenerated - */ - public void setIsNormal(String isNormal) { - this.isNormal = isNormal == null ? null : isNormal.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.difference_des - * - * @return the value of tb_overhaul_statistics.difference_des - * - * @mbggenerated - */ - public String getDifferenceDes() { - return differenceDes; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.difference_des - * - * @param differenceDes the value for tb_overhaul_statistics.difference_des - * - * @mbggenerated - */ - public void setDifferenceDes(String differenceDes) { - this.differenceDes = differenceDes == null ? null : differenceDes.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.cheak_point - * - * @return the value of tb_overhaul_statistics.cheak_point - * - * @mbggenerated - */ - public BigDecimal getCheakPoint() { - return cheakPoint; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.cheak_point - * - * @param cheakPoint the value for tb_overhaul_statistics.cheak_point - * - * @mbggenerated - */ - public void setCheakPoint(BigDecimal cheakPoint) { - this.cheakPoint = cheakPoint; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.quality_cheak_weight - * - * @return the value of tb_overhaul_statistics.quality_cheak_weight - * - * @mbggenerated - */ - public Byte getQualityCheakWeight() { - return qualityCheakWeight; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.quality_cheak_weight - * - * @param qualityCheakWeight the value for tb_overhaul_statistics.quality_cheak_weight - * - * @mbggenerated - */ - public void setQualityCheakWeight(Byte qualityCheakWeight) { - this.qualityCheakWeight = qualityCheakWeight; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.satisfaction_point - * - * @return the value of tb_overhaul_statistics.satisfaction_point - * - * @mbggenerated - */ - public BigDecimal getSatisfactionPoint() { - return satisfactionPoint; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.satisfaction_point - * - * @param satisfactionPoint the value for tb_overhaul_statistics.satisfaction_point - * - * @mbggenerated - */ - public void setSatisfactionPoint(BigDecimal satisfactionPoint) { - this.satisfactionPoint = satisfactionPoint; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.coordination_weight - * - * @return the value of tb_overhaul_statistics.coordination_weight - * - * @mbggenerated - */ - public Byte getCoordinationWeight() { - return coordinationWeight; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.coordination_weight - * - * @param coordinationWeight the value for tb_overhaul_statistics.coordination_weight - * - * @mbggenerated - */ - public void setCoordinationWeight(Byte coordinationWeight) { - this.coordinationWeight = coordinationWeight; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.total_point - * - * @return the value of tb_overhaul_statistics.total_point - * - * @mbggenerated - */ - public BigDecimal getTotalPoint() { - return totalPoint; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.total_point - * - * @param totalPoint the value for tb_overhaul_statistics.total_point - * - * @mbggenerated - */ - public void setTotalPoint(BigDecimal totalPoint) { - this.totalPoint = totalPoint; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.pro_total_hours - * - * @return the value of tb_overhaul_statistics.pro_total_hours - * - * @mbggenerated - */ - public String getProTotalHours() { - return proTotalHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.pro_total_hours - * - * @param proTotalHours the value for tb_overhaul_statistics.pro_total_hours - * - * @mbggenerated - */ - public void setProTotalHours(String proTotalHours) { - this.proTotalHours = proTotalHours == null ? null : proTotalHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.level - * - * @return the value of tb_overhaul_statistics.level - * - * @mbggenerated - */ - public String getLevel() { - return level; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.level - * - * @param level the value for tb_overhaul_statistics.level - * - * @mbggenerated - */ - public void setLevel(String level) { - this.level = level == null ? null : level.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.total_hours - * - * @return the value of tb_overhaul_statistics.total_hours - * - * @mbggenerated - */ - public String getTotalHours() { - return totalHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.total_hours - * - * @param totalHours the value for tb_overhaul_statistics.total_hours - * - * @mbggenerated - */ - public void setTotalHours(String totalHours) { - this.totalHours = totalHours == null ? null : totalHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.description - * - * @return the value of tb_overhaul_statistics.description - * - * @mbggenerated - */ - public String getDescription() { - return description; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.description - * - * @param description the value for tb_overhaul_statistics.description - * - * @mbggenerated - */ - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.total_quota_hours - * - * @return the value of tb_overhaul_statistics.total_quota_hours - * - * @mbggenerated - */ - public String getTotalQuotaHours() { - return totalQuotaHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.total_quota_hours - * - * @param totalQuotaHours the value for tb_overhaul_statistics.total_quota_hours - * - * @mbggenerated - */ - public void setTotalQuotaHours(String totalQuotaHours) { - this.totalQuotaHours = totalQuotaHours == null ? null : totalQuotaHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.sub_actual_hours - * - * @return the value of tb_overhaul_statistics.sub_actual_hours - * - * @mbggenerated - */ - public String getSubActualHours() { - return subActualHours; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.sub_actual_hours - * - * @param subActualHours the value for tb_overhaul_statistics.sub_actual_hours - * - * @mbggenerated - */ - public void setSubActualHours(String subActualHours) { - this.subActualHours = subActualHours == null ? null : subActualHours.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.create_time - * - * @return the value of tb_overhaul_statistics.create_time - * - * @mbggenerated - */ - public String getCreateTime() { - return createTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.create_time - * - * @param createTime the value for tb_overhaul_statistics.create_time - * - * @mbggenerated - */ - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column tb_overhaul_statistics.update_time - * - * @return the value of tb_overhaul_statistics.update_time - * - * @mbggenerated - */ - public String getUpdateTime() { - return updateTime; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column tb_overhaul_statistics.update_time - * - * @param updateTime the value for tb_overhaul_statistics.update_time - * - * @mbggenerated - */ - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } -} diff --git a/src/com/sipai/entity/workorder/OverhaulType.java b/src/com/sipai/entity/workorder/OverhaulType.java deleted file mode 100644 index d56a9d70..00000000 --- a/src/com/sipai/entity/workorder/OverhaulType.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.SQLAdapter; - -/** - * 大修分项-配置 - */ -public class OverhaulType extends SQLAdapter { - - private String id; - - private String name; - - private Integer morder; - - private String active;//启用 - - private String activitiId;//关联流程id - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getMorder() { - return morder; - } - - public void setMorder(Integer morder) { - this.morder = morder; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getActivitiId() { - return activitiId; - } - - public void setActivitiId(String activitiId) { - this.activitiId = activitiId; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/WorkTimeRespDto.java b/src/com/sipai/entity/workorder/WorkTimeRespDto.java deleted file mode 100644 index 36835d8e..00000000 --- a/src/com/sipai/entity/workorder/WorkTimeRespDto.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.entity.workorder; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class WorkTimeRespDto { - - private String id; - - // 人员名称 - private String caption; - - // 维修工时(小时) - private BigDecimal repairTime; - - // 保养工单(小时) - private BigDecimal maintainTime; - - // 运行巡检(小时) - private BigDecimal pTime; - - // 设备巡检(小时) - private BigDecimal eTime; - - // 总工时 - private BigDecimal sumTime; - -} diff --git a/src/com/sipai/entity/workorder/WorkUserTimeRespDto.java b/src/com/sipai/entity/workorder/WorkUserTimeRespDto.java deleted file mode 100644 index 031b1527..00000000 --- a/src/com/sipai/entity/workorder/WorkUserTimeRespDto.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.sipai.entity.workorder; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -public class WorkUserTimeRespDto { - - private String id; - - // 人员名称 - private String caption; - - // 维修工时(小时) - private BigDecimal repairTime; - - // 维修工单(数量) - private BigDecimal repairCount; - - // 保养工单(小时) - private BigDecimal maintainTime; - - // 保养工单(数量) - private BigDecimal maintainCount; - - // 运行巡检(小时) - private BigDecimal pTime; - - // 运行巡检(数量) - private BigDecimal pCount; - - // 设备巡检(小时) - private BigDecimal eTime; - - // 设备巡检(数量) - private BigDecimal eCount; - - // 总工时 - private BigDecimal sumTime; - - // 总工单 - private BigDecimal sumCount; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public BigDecimal getRepairTime() { - return repairTime; - } - - public void setRepairTime(BigDecimal repairTime) { - this.repairTime = repairTime; - } - - public BigDecimal getRepairCount() { - return repairCount; - } - - public void setRepairCount(BigDecimal repairCount) { - this.repairCount = repairCount; - } - - public BigDecimal getMaintainTime() { - return maintainTime; - } - - public void setMaintainTime(BigDecimal maintainTime) { - this.maintainTime = maintainTime; - } - - public BigDecimal getMaintainCount() { - return maintainCount; - } - - public void setMaintainCount(BigDecimal maintainCount) { - this.maintainCount = maintainCount; - } - - public BigDecimal getpTime() { - return pTime; - } - - public void setpTime(BigDecimal pTime) { - this.pTime = pTime; - } - - public BigDecimal getpCount() { - return pCount; - } - - public void setpCount(BigDecimal pCount) { - this.pCount = pCount; - } - - public BigDecimal geteTime() { - return eTime; - } - - public void seteTime(BigDecimal eTime) { - this.eTime = eTime; - } - - public BigDecimal geteCount() { - return eCount; - } - - public void seteCount(BigDecimal eCount) { - this.eCount = eCount; - } - - public BigDecimal getSumTime() { - return sumTime; - } - - public void setSumTime(BigDecimal sumTime) { - this.sumTime = sumTime; - } - - public BigDecimal getSumCount() { - return sumCount; - } - - public void setSumCount(BigDecimal sumCount) { - this.sumCount = sumCount; - } -} diff --git a/src/com/sipai/entity/workorder/WorkorderAchievement.java b/src/com/sipai/entity/workorder/WorkorderAchievement.java deleted file mode 100644 index b084b839..00000000 --- a/src/com/sipai/entity/workorder/WorkorderAchievement.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.user.User; - -/** - * 工单绩效 - * - * @author sj - */ -public class WorkorderAchievement extends SQLAdapter { - public final static String Type_Repair = "repair";//维修 - public final static String Type_Maintain = "maintain";//保养 - public final static String Type_Overhaul = "overhaul";//大修 - public final static String Type_ProcessAdjustment = "processadjustment";//工艺调整单 - public final static String Type_PatrolRecord = "patrolRecord";//巡检 - - private String id; - - private String userId;//人员id - - private String participateContent;//参与内容 - - private String projectRole;//项目角色 - - private float workTime;//工单工时 - - private float evaluateScore;//评价得分 - - private float skillWeight;//技能等级权重 - - private float actualWorkTime;//个人绩效工时 - - private String explain;//说明 - - private String type;//类型 区分维修保养等 - - private String pid;//工单id - - private String tableType; - - private User user; - - private String _num; - - public String getTableType() { - return tableType; - } - - public void setTableType(String tableType) { - this.tableType = tableType; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getParticipateContent() { - return participateContent; - } - - public void setParticipateContent(String participateContent) { - this.participateContent = participateContent; - } - - public String getProjectRole() { - return projectRole; - } - - public void setProjectRole(String projectRole) { - this.projectRole = projectRole; - } - - public float getWorkTime() { - return workTime; - } - - public void setWorkTime(float workTime) { - this.workTime = workTime; - } - - public float getEvaluateScore() { - return evaluateScore; - } - - public void setEvaluateScore(float evaluateScore) { - this.evaluateScore = evaluateScore; - } - - public float getSkillWeight() { - return skillWeight; - } - - public void setSkillWeight(float skillWeight) { - this.skillWeight = skillWeight; - } - - public float getActualWorkTime() { - return actualWorkTime; - } - - public void setActualWorkTime(float actualWorkTime) { - this.actualWorkTime = actualWorkTime; - } - - public String getExplain() { - return explain; - } - - public void setExplain(String explain) { - this.explain = explain; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String get_num() { - return _num; - } - - public void set_num(String _num) { - this._num = _num; - } - -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/WorkorderAchievementOrder.java b/src/com/sipai/entity/workorder/WorkorderAchievementOrder.java deleted file mode 100644 index 9911a7bc..00000000 --- a/src/com/sipai/entity/workorder/WorkorderAchievementOrder.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.SQLAdapter; - -public class WorkorderAchievementOrder extends SQLAdapter { - public static final String TbType_P = "patrolRecord_P";//运行巡检 - public static final String TbType_E = "patrolRecord_E";//设备巡检 - public static final String TbType_R = "workorderRepair";//维修 - public static final String TbType_M = "workorderMaintain";//保养 - public static final String TbType_RM = "repairAndMaintain";//维修保养 - - private String id; - - private String insdt; - - private String insuser; - - private String name; - - private String tbType; - - private String stuType; - - private String type1; - - private String type2; - - - public String getType1() { - return type1; - } - - public void setType1(String type1) { - this.type1 = type1; - } - - public String getType2() { - return type2; - } - - public void setType2(String type2) { - this.type2 = type2; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getTbType() { - return tbType; - } - - public void setTbType(String tbType) { - this.tbType = tbType; - } - - public String getStuType() { - return stuType; - } - - public void setStuType(String stuType) { - this.stuType = stuType; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/WorkorderConsume.java b/src/com/sipai/entity/workorder/WorkorderConsume.java deleted file mode 100644 index 6472d47d..00000000 --- a/src/com/sipai/entity/workorder/WorkorderConsume.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.sipai.entity.workorder; - -import java.math.BigDecimal; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.sparepart.Goods; - -public class WorkorderConsume extends SQLAdapter { - private String id; - - private String goodsId; - - private String repairItemNumber; - - private String insdt; - - private String insuser; - - private String upsdt; - - private String upsuser; - - private Integer libraryNumber; - - private BigDecimal libraryPrice; - - private BigDecimal libraryTotalPrice; - - private String stockType; - - private Integer number; - - private BigDecimal price; - - private BigDecimal totalPrice; - - private String memo; - - private String pid; - - private Goods goods; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getGoodsId() { - return goodsId; - } - - public void setGoodsId(String goodsId) { - this.goodsId = goodsId; - } - - public String getRepairItemNumber() { - return repairItemNumber; - } - - public void setRepairItemNumber(String repairItemNumber) { - this.repairItemNumber = repairItemNumber; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public Integer getLibraryNumber() { - return libraryNumber; - } - - public void setLibraryNumber(Integer libraryNumber) { - this.libraryNumber = libraryNumber; - } - - public BigDecimal getLibraryPrice() { - return libraryPrice; - } - - public void setLibraryPrice(BigDecimal libraryPrice) { - this.libraryPrice = libraryPrice; - } - - public BigDecimal getLibraryTotalPrice() { - return libraryTotalPrice; - } - - public void setLibraryTotalPrice(BigDecimal libraryTotalPrice) { - this.libraryTotalPrice = libraryTotalPrice; - } - - public String getStockType() { - return stockType; - } - - public void setStockType(String stockType) { - this.stockType = stockType; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getTotalPrice() { - return totalPrice; - } - - public void setTotalPrice(BigDecimal totalPrice) { - this.totalPrice = totalPrice; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getPid() { - return pid; - } - - public void setPid(String pid) { - this.pid = pid; - } - - public Goods getGoods() { - return goods; - } - - public void setGoods(Goods goods) { - this.goods = goods; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/WorkorderDetail.java b/src/com/sipai/entity/workorder/WorkorderDetail.java deleted file mode 100644 index 77103875..00000000 --- a/src/com/sipai/entity/workorder/WorkorderDetail.java +++ /dev/null @@ -1,446 +0,0 @@ -package com.sipai.entity.workorder; - -import java.math.BigDecimal; - -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; - -/** - * 工单管理-主表(新) 维修保养共用 - * 2021-07-01 - */ -public class WorkorderDetail extends BusinessUnitAdapter { - - public final static String Status_Start = "start";//开始 - public final static String Status_Compete = "compete";//待抢单 - public final static String Status_Cancel = "cancel";//取消 - public final static String Status_Finish = "finish";//完成 - - /** - * 工单类型 - */ - public static final String REPAIR = "repair";//维修工单 - public static final String MAINTAIN = "maintain";//通用保养 - public static final String ANTISEPTIC = "antiseptic";//防腐保养 - public static final String LUBRICATION = "lubrication";//润滑保养 - public static final String INSTRUMENT = "instrument";//仪表保养 - - public static final String planIn = "planIn";//计划内 - public static final String planOut = "planOut";//计划外 - - public static final String smallRepair = "smallRepair";//小修 - public static final String middleRepair = "middleRepair";//中修 - - private String id; - - private String insdt; - - private String insuser; - - private String unitId; - - private String jobNumber; - - private String jobName; - - private String type; - - private String repairPlanType; - - private String repairType; - - private String receiveUserIds;//暂时没有用到 用receiveUserId - - private String equipmentId;//实际维修设备 - - private String equipmentId2;//异常上报设备 - - private String planDate; - - private String receiveUserId;//维修人员、接单人员 - private String repairDate;//维修时间 - private String completeDate;//完成时间(最终完成验收时间,用于完好率的计算) - private String cycle; - private String processid; - private String processdefid; - private String outsource; - private String faultDescription;//故障现象 - private String schemeResume;//维修方案 年度保养计划内容也用该字段 - private BigDecimal achievementsHour; - private String status; - private String isCompete;//是否抢单 抢单:CommString.Active_True=1 非抢单:CommString.Active_False=0 - private String competeTeamIds;//允许抢单班组 - private String abnormityId;//关联异常单 - private String equPlanId;//关联维修计划 - private String eName; - - private int _num; - private String _date; - private int workTime; - private Integer saveType; - - private String competeDate; - - private Company company; - private EquipmentCard equipmentCard; - private EquipmentCard equipmentCard2; - private User user; - private User receiveUser;//接收人员对象 - private User issueUser;//下发人员对象 - private Abnormity abnormity; - - /** - * sj 2023-05-18 - */ - private float abnormityTime;//故障时长 (从异常上报到工单确认的时间、从工单下发到工单确认的时间) - private String abnormityDate;//故障时间 - - private String abnormityTimeString;//故障时间查询的时候显示 - - public String getAbnormityDate() { - return abnormityDate; - } - - public void setAbnormityDate(String abnormityDate) { - this.abnormityDate = abnormityDate; - } - - public String getAbnormityTimeString() { - return abnormityTimeString; - } - - public void setAbnormityTimeString(String abnormityTimeString) { - this.abnormityTimeString = abnormityTimeString; - } - - public float getAbnormityTime() { - return abnormityTime; - } - - public void setAbnormityTime(float abnormityTime) { - this.abnormityTime = abnormityTime; - } - - public String getEquPlanId() { - return equPlanId; - } - - public void setEquPlanId(String equPlanId) { - this.equPlanId = equPlanId; - } - - public String get_date() { - return _date; - } - - public void set_date(String _date) { - this._date = _date; - } - - public String getCompeteDate() { - return competeDate; - } - - public void setCompeteDate(String competeDate) { - this.competeDate = competeDate; - } - - public Integer getSaveType() { - return saveType; - } - - public void setSaveType(Integer saveType) { - this.saveType = saveType; - } - - public EquipmentCard getEquipmentCard2() { - return equipmentCard2; - } - - public void setEquipmentCard2(EquipmentCard equipmentCard2) { - this.equipmentCard2 = equipmentCard2; - } - - public String getEquipmentId2() { - return equipmentId2; - } - - public void setEquipmentId2(String equipmentId2) { - this.equipmentId2 = equipmentId2; - } - - public String getRepairDate() { - return repairDate; - } - - public void setRepairDate(String repairDate) { - this.repairDate = repairDate; - } - - public User getReceiveUser() { - return receiveUser; - } - - public void setReceiveUser(User receiveUser) { - this.receiveUser = receiveUser; - } - - public User getIssueUser() { - return issueUser; - } - - public void setIssueUser(User issueUser) { - this.issueUser = issueUser; - } - - public Abnormity getAbnormity() { - return abnormity; - } - - public void setAbnormity(Abnormity abnormity) { - this.abnormity = abnormity; - } - - public String getAbnormityId() { - return abnormityId; - } - - public void setAbnormityId(String abnormityId) { - this.abnormityId = abnormityId; - } - - public String getCompeteTeamIds() { - return competeTeamIds; - } - - public void setCompeteTeamIds(String competeTeamIds) { - this.competeTeamIds = competeTeamIds; - } - - public String getIsCompete() { - return isCompete; - } - - public void setIsCompete(String isCompete) { - this.isCompete = isCompete; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getJobNumber() { - return jobNumber; - } - - public void setJobNumber(String jobNumber) { - this.jobNumber = jobNumber; - } - - public String getJobName() { - return jobName; - } - - public void setJobName(String jobName) { - this.jobName = jobName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getRepairPlanType() { - return repairPlanType; - } - - public void setRepairPlanType(String repairPlanType) { - this.repairPlanType = repairPlanType; - } - - public String getRepairType() { - return repairType; - } - - public void setRepairType(String repairType) { - this.repairType = repairType; - } - - public String getReceiveUserId() { - return receiveUserId; - } - - public void setReceiveUserId(String receiveUserId) { - this.receiveUserId = receiveUserId; - } - - public String getReceiveUserIds() { - return receiveUserIds; - } - - public void setReceiveUserIds(String receiveUserIds) { - this.receiveUserIds = receiveUserIds; - } - - public String getEquipmentId() { - return equipmentId; - } - - public void setEquipmentId(String equipmentId) { - this.equipmentId = equipmentId; - } - - public String getPlanDate() { - return planDate; - } - - public void setPlanDate(String planDate) { - this.planDate = planDate; - } - - public String getCompleteDate() { - return completeDate; - } - - public void setCompleteDate(String completeDate) { - this.completeDate = completeDate; - } - - public String getCycle() { - return cycle; - } - - public void setCycle(String cycle) { - this.cycle = cycle; - } - - public String getProcessid() { - return processid; - } - - public void setProcessid(String processid) { - this.processid = processid; - } - - public String getProcessdefid() { - return processdefid; - } - - public void setProcessdefid(String processdefid) { - this.processdefid = processdefid; - } - - public String getOutsource() { - return outsource; - } - - public void setOutsource(String outsource) { - this.outsource = outsource; - } - - public String getFaultDescription() { - return faultDescription; - } - - public void setFaultDescription(String faultDescription) { - this.faultDescription = faultDescription; - } - - public String getSchemeResume() { - return schemeResume; - } - - public void setSchemeResume(String schemeResume) { - this.schemeResume = schemeResume; - } - - public BigDecimal getAchievementsHour() { - return achievementsHour; - } - - public void setAchievementsHour(BigDecimal achievementsHour) { - this.achievementsHour = achievementsHour; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Company getCompany() { - return company; - } - - public void setCompany(Company company) { - this.company = company; - } - - public EquipmentCard getEquipmentCard() { - return equipmentCard; - } - - public void setEquipmentCard(EquipmentCard equipmentCard) { - this.equipmentCard = equipmentCard; - } - - public int get_num() { - return _num; - } - - public void set_num(int _num) { - this._num = _num; - } - - public int getWorkTime() { - return workTime; - } - - public void setWorkTime(int workTime) { - this.workTime = workTime; - } -} \ No newline at end of file diff --git a/src/com/sipai/entity/workorder/WorkorderRepairContent.java b/src/com/sipai/entity/workorder/WorkorderRepairContent.java deleted file mode 100644 index 79537fe0..00000000 --- a/src/com/sipai/entity/workorder/WorkorderRepairContent.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.entity.workorder; - -import com.sipai.entity.base.SQLAdapter; -import com.sipai.entity.maintenance.LibraryRepairBloc; - -/** - * 工单中 维修内容、保养内容附表 (共用一张表) - */ -public class WorkorderRepairContent extends SQLAdapter { - private String id; - - private String detailId;//上级表单id - - private String repairContentId;//维修库内容Id、保养库内容Id - - private String repairName;//维修名称、保养名称 - - private float selfQuotaHour;//自修工时 - 定额 - - private float selfActualHour;//自修工时 - 实际 - - private float outsourceQuotaFee;//委外工时费 - 定额 - - private float outsourceActualFee;//委外工时费 - 实际 - - private String memo;//备注 - - private String unitId; - - private String insdt; - - private String insuser; - - private String upsuser; - - private String upsdt; - - private LibraryRepairBloc libraryRepairBloc; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getDetailId() { - return detailId; - } - - public void setDetailId(String detailId) { - this.detailId = detailId; - } - - public String getRepairContentId() { - return repairContentId; - } - - public void setRepairContentId(String repairContentId) { - this.repairContentId = repairContentId; - } - - public float getSelfQuotaHour() { - return selfQuotaHour; - } - - public void setSelfQuotaHour(float selfQuotaHour) { - this.selfQuotaHour = selfQuotaHour; - } - - public float getSelfActualHour() { - return selfActualHour; - } - - public void setSelfActualHour(float selfActualHour) { - this.selfActualHour = selfActualHour; - } - - public float getOutsourceQuotaFee() { - return outsourceQuotaFee; - } - - public void setOutsourceQuotaFee(float outsourceQuotaFee) { - this.outsourceQuotaFee = outsourceQuotaFee; - } - - public float getOutsourceActualFee() { - return outsourceActualFee; - } - - public void setOutsourceActualFee(float outsourceActualFee) { - this.outsourceActualFee = outsourceActualFee; - } - - public String getMemo() { - return memo; - } - - public void setMemo(String memo) { - this.memo = memo; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId; - } - - public String getInsdt() { - return insdt; - } - - public void setInsdt(String insdt) { - this.insdt = insdt; - } - - public String getInsuser() { - return insuser; - } - - public void setInsuser(String insuser) { - this.insuser = insuser; - } - - public String getUpsuser() { - return upsuser; - } - - public void setUpsuser(String upsuser) { - this.upsuser = upsuser; - } - - public String getUpsdt() { - return upsdt; - } - - public void setUpsdt(String upsdt) { - this.upsdt = upsdt; - } - - public LibraryRepairBloc getLibraryRepairBloc() { - return libraryRepairBloc; - } - - public void setLibraryRepairBloc(LibraryRepairBloc libraryRepairBloc) { - this.libraryRepairBloc = libraryRepairBloc; - } - - public String getRepairName() { - return repairName; - } - - public void setRepairName(String repairName) { - this.repairName = repairName; - } -} \ No newline at end of file diff --git a/src/com/sipai/mapper/Listener/ListenerHis.xml b/src/com/sipai/mapper/Listener/ListenerHis.xml deleted file mode 100644 index a3998500..00000000 --- a/src/com/sipai/mapper/Listener/ListenerHis.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - id, pointid, value, type, insdt - - - - delete - from Listener_His - where id = #{id,jdbcType=VARCHAR} - - - insert into Listener_His (id, pointid, value, type, insdt) - values (#{id,jdbcType=VARCHAR}, #{pointid,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}) - - - insert into Listener_His - - - id, - - - pointid, - - - value, - - - type, - - - insdt - - - - - #{id,jdbcType=VARCHAR}, - - - #{pointid,jdbcType=VARCHAR}, - - - #{value,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR} - - - - - update Listener_His - - - id = #{id,jdbcType=VARCHAR}, - - - pointid = #{pointid,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=VARCHAR} - - - where id = #{id,jdbcType=VARCHAR} - - - update Listener_His - set id = #{id,jdbcType=VARCHAR}, - pointid = #{pointid,jdbcType=VARCHAR}, - value = #{value,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from Listener_His - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/Listener/ListenerInterfaceMapper.xml b/src/com/sipai/mapper/Listener/ListenerInterfaceMapper.xml deleted file mode 100644 index 00b7a950..00000000 --- a/src/com/sipai/mapper/Listener/ListenerInterfaceMapper.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - id, name, type, url, port - - - - delete - from Listener_Interface - where id = #{id,jdbcType=VARCHAR} - - - insert into Listener_interface (id, name, type, url, port) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{url,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}) - - - insert into Listener_Interface - - - id, - - - name, - - - type, - - - url, - - - port - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{port,jdbcType=VARCHAR} - - - - - update Listener_Interface - - - id = #{id,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - port = #{port,jdbcType=VARCHAR} - - - where id = #{id,jdbcType=VARCHAR} - - - update Listener_Interface - set id = #{id,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - port = #{port,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from Listener_Interface - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/Listener/ListenerMessageMapper.xml b/src/com/sipai/mapper/Listener/ListenerMessageMapper.xml deleted file mode 100644 index 738dcaa8..00000000 --- a/src/com/sipai/mapper/Listener/ListenerMessageMapper.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - id, Cmdtype, Objid, Action, insdt - - - - delete - from listener_message - where id = #{id, jdbcType=VARCHAR} - - - insert into listener_message (id, Cmdtype, Objid, Action, insdt) - values (#{id,jdbcType=VARCHAR}, #{Cmdtype,jdbcType=VARCHAR}, #{Objid,jdbcType=VARCHAR}, - #{Action,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}) - - - insert into listener_message - - - id, - - - Cmdtype, - - - Objid, - - - Action, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{Cmdtype,jdbcType=VARCHAR}, - - - #{Objid,jdbcType=VARCHAR}, - - - #{Action,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - - - update listener_message - - - id = #{id,jdbcType=VARCHAR}, - - - Cmdtype = #{Cmdtype,jdbcType=VARCHAR}, - - - Objid = #{Objid,jdbcType=VARCHAR}, - - - Action = #{Action,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update listener_message - set id = #{id,jdbcType=VARCHAR}, - Cmdtype = #{Cmdtype,jdbcType=VARCHAR}, - Objid = #{Objid,jdbcType=VARCHAR}, - Action = #{Action,jdbcType=VARCHAR}} - insdt = #{insdt,jdbcType=VARCHAR}} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from listener_message - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/Listener/ListenerPointMapper.xml b/src/com/sipai/mapper/Listener/ListenerPointMapper.xml deleted file mode 100644 index 9d4e1a51..00000000 --- a/src/com/sipai/mapper/Listener/ListenerPointMapper.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - id, intid, name, address, type, mpcode, datatype, unitid,logi,logi_val,action - - - - delete - from Listener_Point - where id = #{id,jdbcType=VARCHAR} - - - insert into Listener_Point (id, intid, name, address, type, mpcode, datatype, unitid) - values (#{id,jdbcType=VARCHAR}, #{intid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{address,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{mpcode,jdbcType=VARCHAR}, - #{datatype,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}) - - - insert into Listener_Point - - - id, - - - intid, - - - name, - - - address, - - - type, - - - mpcode, - - - datatype - - - unitid - - - - - #{id,jdbcType=VARCHAR}, - - - #{intid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - #{datatype,jdbcType=VARCHAR} - - - #{unitid,jdbcType=VARCHAR} - - - - - update Listener_Point - - - id = #{id,jdbcType=VARCHAR}, - - - intid = #{intid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - datatype = #{datatype,jdbcType=VARCHAR} - - - unitid = #{unitid,jdbcType=VARCHAR} - - - where id = #{id,jdbcType=VARCHAR} - - - update Listener_Point - set id = #{id,jdbcType=VARCHAR}, - intid = #{intid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR}, - datatype = #{datatype,jdbcType=VARCHAR} - unitid = #{unitid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from Listener_Point - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/access/AccessAlarmHistoryMapper.xml b/src/com/sipai/mapper/access/AccessAlarmHistoryMapper.xml deleted file mode 100644 index 27c3ffd1..00000000 --- a/src/com/sipai/mapper/access/AccessAlarmHistoryMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - ID, nPumpID, nSensorID, nEvent, strEvent, fTemperature, fPTP_X, fPTP_Y, fPTP_Z, fRMS_X, - fRMS_Y, fRMS_Z, fPeak_X, fPeak_Y, fPeak_Z, fVVE_X, fVVE_Y, fVVE_Z, tmValue - - - - delete from tblAlarmHistory - where ID = #{id,jdbcType=VARCHAR} - - - insert into tblAlarmHistory (ID, nPumpID, nSensorID, - nEvent, strEvent, fTemperature, - fPTP_X, fPTP_Y, fPTP_Z, fRMS_X, - fRMS_Y, fRMS_Z, fPeak_X, fPeak_Y, - fPeak_Z, fVVE_X, fVVE_Y, fVVE_Z, - tmValue) - values (#{id,jdbcType=VARCHAR}, #{npumpid,jdbcType=INTEGER}, #{nsensorid,jdbcType=INTEGER}, - #{nevent,jdbcType=INTEGER}, #{strevent,jdbcType=NVARCHAR}, #{ftemperature,jdbcType=INTEGER}, - #{fptpX,jdbcType=REAL}, #{fptpY,jdbcType=REAL}, #{fptpZ,jdbcType=REAL}, #{frmsX,jdbcType=REAL}, - #{frmsY,jdbcType=REAL}, #{frmsZ,jdbcType=REAL}, #{fpeakX,jdbcType=REAL}, #{fpeakY,jdbcType=REAL}, - #{fpeakZ,jdbcType=REAL}, #{fvveX,jdbcType=REAL}, #{fvveY,jdbcType=REAL}, #{fvveZ,jdbcType=REAL}, - #{tmvalue,jdbcType=TIMESTAMP}) - - - insert into tblAlarmHistory - - - ID, - - - nPumpID, - - - nSensorID, - - - nEvent, - - - strEvent, - - - fTemperature, - - - fPTP_X, - - - fPTP_Y, - - - fPTP_Z, - - - fRMS_X, - - - fRMS_Y, - - - fRMS_Z, - - - fPeak_X, - - - fPeak_Y, - - - fPeak_Z, - - - fVVE_X, - - - fVVE_Y, - - - fVVE_Z, - - - tmValue, - - - - - #{id,jdbcType=VARCHAR}, - - - #{npumpid,jdbcType=INTEGER}, - - - #{nsensorid,jdbcType=INTEGER}, - - - #{nevent,jdbcType=INTEGER}, - - - #{strevent,jdbcType=NVARCHAR}, - - - #{ftemperature,jdbcType=INTEGER}, - - - #{fptpX,jdbcType=REAL}, - - - #{fptpY,jdbcType=REAL}, - - - #{fptpZ,jdbcType=REAL}, - - - #{frmsX,jdbcType=REAL}, - - - #{frmsY,jdbcType=REAL}, - - - #{frmsZ,jdbcType=REAL}, - - - #{fpeakX,jdbcType=REAL}, - - - #{fpeakY,jdbcType=REAL}, - - - #{fpeakZ,jdbcType=REAL}, - - - #{fvveX,jdbcType=REAL}, - - - #{fvveY,jdbcType=REAL}, - - - #{fvveZ,jdbcType=REAL}, - - - #{tmvalue,jdbcType=TIMESTAMP}, - - - - - update tblAlarmHistory - - - nPumpID = #{npumpid,jdbcType=INTEGER}, - - - nSensorID = #{nsensorid,jdbcType=INTEGER}, - - - nEvent = #{nevent,jdbcType=INTEGER}, - - - strEvent = #{strevent,jdbcType=NVARCHAR}, - - - fTemperature = #{ftemperature,jdbcType=INTEGER}, - - - fPTP_X = #{fptpX,jdbcType=REAL}, - - - fPTP_Y = #{fptpY,jdbcType=REAL}, - - - fPTP_Z = #{fptpZ,jdbcType=REAL}, - - - fRMS_X = #{frmsX,jdbcType=REAL}, - - - fRMS_Y = #{frmsY,jdbcType=REAL}, - - - fRMS_Z = #{frmsZ,jdbcType=REAL}, - - - fPeak_X = #{fpeakX,jdbcType=REAL}, - - - fPeak_Y = #{fpeakY,jdbcType=REAL}, - - - fPeak_Z = #{fpeakZ,jdbcType=REAL}, - - - fVVE_X = #{fvveX,jdbcType=REAL}, - - - fVVE_Y = #{fvveY,jdbcType=REAL}, - - - fVVE_Z = #{fvveZ,jdbcType=REAL}, - - - tmValue = #{tmvalue,jdbcType=TIMESTAMP}, - - - where ID = #{id,jdbcType=DECIMAL} - - - update tblAlarmHistory - set nPumpID = #{npumpid,jdbcType=INTEGER}, - nSensorID = #{nsensorid,jdbcType=INTEGER}, - nEvent = #{nevent,jdbcType=INTEGER}, - strEvent = #{strevent,jdbcType=NVARCHAR}, - fTemperature = #{ftemperature,jdbcType=INTEGER}, - fPTP_X = #{fptpX,jdbcType=REAL}, - fPTP_Y = #{fptpY,jdbcType=REAL}, - fPTP_Z = #{fptpZ,jdbcType=REAL}, - fRMS_X = #{frmsX,jdbcType=REAL}, - fRMS_Y = #{frmsY,jdbcType=REAL}, - fRMS_Z = #{frmsZ,jdbcType=REAL}, - fPeak_X = #{fpeakX,jdbcType=REAL}, - fPeak_Y = #{fpeakY,jdbcType=REAL}, - fPeak_Z = #{fpeakZ,jdbcType=REAL}, - fVVE_X = #{fvveX,jdbcType=REAL}, - fVVE_Y = #{fvveY,jdbcType=REAL}, - fVVE_Z = #{fvveZ,jdbcType=REAL}, - tmValue = #{tmvalue,jdbcType=TIMESTAMP} - where ID = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/access/AccessAlarmSettingMapper.xml b/src/com/sipai/mapper/access/AccessAlarmSettingMapper.xml deleted file mode 100644 index 4d07dc06..00000000 --- a/src/com/sipai/mapper/access/AccessAlarmSettingMapper.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - ID, nPumpID, nSensorID, fTempAlarmLo, fTempAlarmHi, fPTPAlarmHi, fRMSAlarmHi, fPeakAlarmHi, - fVVEAlarmHi, tmModify - - - - delete from tblAlarmSetting - where ID = #{id,jdbcType=VARCHAR} - - - insert into tblAlarmSetting (ID, nPumpID, nSensorID, - fTempAlarmLo, fTempAlarmHi, fPTPAlarmHi, - fRMSAlarmHi, fPeakAlarmHi, fVVEAlarmHi, - tmModify) - values (#{id,jdbcType=VARCHAR}, #{npumpid,jdbcType=INTEGER}, #{nsensorid,jdbcType=INTEGER}, - #{ftempalarmlo,jdbcType=REAL}, #{ftempalarmhi,jdbcType=REAL}, #{fptpalarmhi,jdbcType=REAL}, - #{frmsalarmhi,jdbcType=REAL}, #{fpeakalarmhi,jdbcType=REAL}, #{fvvealarmhi,jdbcType=REAL}, - #{tmmodify,jdbcType=TIMESTAMP}) - - - insert into tblAlarmSetting - - - ID, - - - nPumpID, - - - nSensorID, - - - fTempAlarmLo, - - - fTempAlarmHi, - - - fPTPAlarmHi, - - - fRMSAlarmHi, - - - fPeakAlarmHi, - - - fVVEAlarmHi, - - - tmModify, - - - - - #{id,jdbcType=VARCHAR}, - - - #{npumpid,jdbcType=INTEGER}, - - - #{nsensorid,jdbcType=INTEGER}, - - - #{ftempalarmlo,jdbcType=REAL}, - - - #{ftempalarmhi,jdbcType=REAL}, - - - #{fptpalarmhi,jdbcType=REAL}, - - - #{frmsalarmhi,jdbcType=REAL}, - - - #{fpeakalarmhi,jdbcType=REAL}, - - - #{fvvealarmhi,jdbcType=REAL}, - - - #{tmmodify,jdbcType=TIMESTAMP}, - - - - - update tblAlarmSetting - - - nPumpID = #{npumpid,jdbcType=INTEGER}, - - - nSensorID = #{nsensorid,jdbcType=INTEGER}, - - - fTempAlarmLo = #{ftempalarmlo,jdbcType=REAL}, - - - fTempAlarmHi = #{ftempalarmhi,jdbcType=REAL}, - - - fPTPAlarmHi = #{fptpalarmhi,jdbcType=REAL}, - - - fRMSAlarmHi = #{frmsalarmhi,jdbcType=REAL}, - - - fPeakAlarmHi = #{fpeakalarmhi,jdbcType=REAL}, - - - fVVEAlarmHi = #{fvvealarmhi,jdbcType=REAL}, - - - tmModify = #{tmmodify,jdbcType=TIMESTAMP}, - - - where ID = #{id,jdbcType=VARCHAR} - - - update tblAlarmSetting - set nPumpID = #{npumpid,jdbcType=INTEGER}, - nSensorID = #{nsensorid,jdbcType=INTEGER}, - fTempAlarmLo = #{ftempalarmlo,jdbcType=REAL}, - fTempAlarmHi = #{ftempalarmhi,jdbcType=REAL}, - fPTPAlarmHi = #{fptpalarmhi,jdbcType=REAL}, - fRMSAlarmHi = #{frmsalarmhi,jdbcType=REAL}, - fPeakAlarmHi = #{fpeakalarmhi,jdbcType=REAL}, - fVVEAlarmHi = #{fvvealarmhi,jdbcType=REAL}, - tmModify = #{tmmodify,jdbcType=TIMESTAMP} - where ID = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/access/AccessEigenHistoryMapper.xml b/src/com/sipai/mapper/access/AccessEigenHistoryMapper.xml deleted file mode 100644 index 0c671f16..00000000 --- a/src/com/sipai/mapper/access/AccessEigenHistoryMapper.xml +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - ID, nPumpID, nSensorID, fTemperature, fPTP_X, fPTP_Y, fPTP_Z, fRMS_X, fRMS_Y, fRMS_Z, - fPeak_X, fPeak_Y, fPeak_Z, fVVE_X, fVVE_Y, fVVE_Z, tmValue - - - - delete from tblEigenHistory - where ID = #{id,jdbcType=VARCHAR} - - - insert into tblEigenHistory (ID, nPumpID, nSensorID, - fTemperature, fPTP_X, fPTP_Y, - fPTP_Z, fRMS_X, fRMS_Y, fRMS_Z, - fPeak_X, fPeak_Y, fPeak_Z, fVVE_X, - fVVE_Y, fVVE_Z, tmValue) - values (#{id,jdbcType=VARCHAR}, #{npumpid,jdbcType=INTEGER}, #{nsensorid,jdbcType=INTEGER}, - #{ftemperature,jdbcType=INTEGER}, #{fptpX,jdbcType=REAL}, #{fptpY,jdbcType=REAL}, - #{fptpZ,jdbcType=REAL}, #{frmsX,jdbcType=REAL}, #{frmsY,jdbcType=REAL}, #{frmsZ,jdbcType=REAL}, - #{fpeakX,jdbcType=REAL}, #{fpeakY,jdbcType=REAL}, #{fpeakZ,jdbcType=REAL}, #{fvveX,jdbcType=REAL}, - #{fvveY,jdbcType=REAL}, #{fvveZ,jdbcType=REAL}, #{tmvalue,jdbcType=TIMESTAMP}) - - - insert into tblEigenHistory - - - ID, - - - nPumpID, - - - nSensorID, - - - fTemperature, - - - fPTP_X, - - - fPTP_Y, - - - fPTP_Z, - - - fRMS_X, - - - fRMS_Y, - - - fRMS_Z, - - - fPeak_X, - - - fPeak_Y, - - - fPeak_Z, - - - fVVE_X, - - - fVVE_Y, - - - fVVE_Z, - - - tmValue, - - - - - #{id,jdbcType=VARCHAR}, - - - #{npumpid,jdbcType=INTEGER}, - - - #{nsensorid,jdbcType=INTEGER}, - - - #{ftemperature,jdbcType=INTEGER}, - - - #{fptpX,jdbcType=REAL}, - - - #{fptpY,jdbcType=REAL}, - - - #{fptpZ,jdbcType=REAL}, - - - #{frmsX,jdbcType=REAL}, - - - #{frmsY,jdbcType=REAL}, - - - #{frmsZ,jdbcType=REAL}, - - - #{fpeakX,jdbcType=REAL}, - - - #{fpeakY,jdbcType=REAL}, - - - #{fpeakZ,jdbcType=REAL}, - - - #{fvveX,jdbcType=REAL}, - - - #{fvveY,jdbcType=REAL}, - - - #{fvveZ,jdbcType=REAL}, - - - #{tmvalue,jdbcType=TIMESTAMP}, - - - - - update tblEigenHistory - - - nPumpID = #{npumpid,jdbcType=INTEGER}, - - - nSensorID = #{nsensorid,jdbcType=INTEGER}, - - - fTemperature = #{ftemperature,jdbcType=INTEGER}, - - - fPTP_X = #{fptpX,jdbcType=REAL}, - - - fPTP_Y = #{fptpY,jdbcType=REAL}, - - - fPTP_Z = #{fptpZ,jdbcType=REAL}, - - - fRMS_X = #{frmsX,jdbcType=REAL}, - - - fRMS_Y = #{frmsY,jdbcType=REAL}, - - - fRMS_Z = #{frmsZ,jdbcType=REAL}, - - - fPeak_X = #{fpeakX,jdbcType=REAL}, - - - fPeak_Y = #{fpeakY,jdbcType=REAL}, - - - fPeak_Z = #{fpeakZ,jdbcType=REAL}, - - - fVVE_X = #{fvveX,jdbcType=REAL}, - - - fVVE_Y = #{fvveY,jdbcType=REAL}, - - - fVVE_Z = #{fvveZ,jdbcType=REAL}, - - - tmValue = #{tmvalue,jdbcType=TIMESTAMP}, - - - where ID = #{id,jdbcType=VARCHAR} - - - update tblEigenHistory - set nPumpID = #{npumpid,jdbcType=INTEGER}, - nSensorID = #{nsensorid,jdbcType=INTEGER}, - fTemperature = #{ftemperature,jdbcType=INTEGER}, - fPTP_X = #{fptpX,jdbcType=REAL}, - fPTP_Y = #{fptpY,jdbcType=REAL}, - fPTP_Z = #{fptpZ,jdbcType=REAL}, - fRMS_X = #{frmsX,jdbcType=REAL}, - fRMS_Y = #{frmsY,jdbcType=REAL}, - fRMS_Z = #{frmsZ,jdbcType=REAL}, - fPeak_X = #{fpeakX,jdbcType=REAL}, - fPeak_Y = #{fpeakY,jdbcType=REAL}, - fPeak_Z = #{fpeakZ,jdbcType=REAL}, - fVVE_X = #{fvveX,jdbcType=REAL}, - fVVE_Y = #{fvveY,jdbcType=REAL}, - fVVE_Z = #{fvveZ,jdbcType=REAL}, - tmValue = #{tmvalue,jdbcType=TIMESTAMP} - where ID = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/access/AccessRealDataMapper.xml b/src/com/sipai/mapper/access/AccessRealDataMapper.xml deleted file mode 100644 index 82addf00..00000000 --- a/src/com/sipai/mapper/access/AccessRealDataMapper.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - insert into tblRealData (nPumpID, nSensorID, fTemperature, - fPTP_X, fPTP_Y, fPTP_Z, fRMS_X, - fRMS_Y, fRMS_Z, fPeak_X, fPeak_Y, - fPeak_Z, fVVE_X, fVVE_Y, fVVE_Z, - tmValue) - values (#{npumpid,jdbcType=INTEGER}, #{nsensorid,jdbcType=INTEGER}, #{ftemperature,jdbcType=INTEGER}, - #{fptpX,jdbcType=REAL}, #{fptpY,jdbcType=REAL}, #{fptpZ,jdbcType=REAL}, #{frmsX,jdbcType=REAL}, - #{frmsY,jdbcType=REAL}, #{frmsZ,jdbcType=REAL}, #{fpeakX,jdbcType=REAL}, #{fpeakY,jdbcType=REAL}, - #{fpeakZ,jdbcType=REAL}, #{fvveX,jdbcType=REAL}, #{fvveY,jdbcType=REAL}, #{fvveZ,jdbcType=REAL}, - #{tmvalue,jdbcType=TIMESTAMP}) - - - insert into tblRealData - - - nPumpID, - - - nSensorID, - - - fTemperature, - - - fPTP_X, - - - fPTP_Y, - - - fPTP_Z, - - - fRMS_X, - - - fRMS_Y, - - - fRMS_Z, - - - fPeak_X, - - - fPeak_Y, - - - fPeak_Z, - - - fVVE_X, - - - fVVE_Y, - - - fVVE_Z, - - - tmValue, - - - - - #{npumpid,jdbcType=INTEGER}, - - - #{nsensorid,jdbcType=INTEGER}, - - - #{ftemperature,jdbcType=INTEGER}, - - - #{fptpX,jdbcType=REAL}, - - - #{fptpY,jdbcType=REAL}, - - - #{fptpZ,jdbcType=REAL}, - - - #{frmsX,jdbcType=REAL}, - - - #{frmsY,jdbcType=REAL}, - - - #{frmsZ,jdbcType=REAL}, - - - #{fpeakX,jdbcType=REAL}, - - - #{fpeakY,jdbcType=REAL}, - - - #{fpeakZ,jdbcType=REAL}, - - - #{fvveX,jdbcType=REAL}, - - - #{fvveY,jdbcType=REAL}, - - - #{fvveZ,jdbcType=REAL}, - - - #{tmvalue,jdbcType=TIMESTAMP}, - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/accident/AccidentMapper.xml b/src/com/sipai/mapper/accident/AccidentMapper.xml deleted file mode 100644 index d7097647..00000000 --- a/src/com/sipai/mapper/accident/AccidentMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, happen_date, happen_place, accident_type_id, accident_description, emergency_plan_true, - emergency_plan_id, handle_result, insuser, insdt, unit_id - - - - delete from tb_accident - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_accident (id, happen_date, happen_place, - accident_type_id, accident_description, emergency_plan_true, - emergency_plan_id, handle_result, insuser, - insdt, unit_id) - values (#{id,jdbcType=VARCHAR}, #{happenDate,jdbcType=TIMESTAMP}, #{happenPlace,jdbcType=VARCHAR}, - #{accidentTypeId,jdbcType=VARCHAR}, #{accidentDescription,jdbcType=VARCHAR}, #{emergencyPlanTrue,jdbcType=INTEGER}, - #{emergencyPlanId,jdbcType=VARCHAR}, #{handleResult,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_accident - - - id, - - - happen_date, - - - happen_place, - - - accident_type_id, - - - accident_description, - - - emergency_plan_true, - - - emergency_plan_id, - - - handle_result, - - - insuser, - - - insdt, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{happenDate,jdbcType=TIMESTAMP}, - - - #{happenPlace,jdbcType=VARCHAR}, - - - #{accidentTypeId,jdbcType=VARCHAR}, - - - #{accidentDescription,jdbcType=VARCHAR}, - - - #{emergencyPlanTrue,jdbcType=INTEGER}, - - - #{emergencyPlanId,jdbcType=VARCHAR}, - - - #{handleResult,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=TIMESTAMP}, - - - - - update tb_accident - - - happen_date = #{happenDate,jdbcType=TIMESTAMP}, - - - happen_place = #{happenPlace,jdbcType=VARCHAR}, - - - accident_type_id = #{accidentTypeId,jdbcType=VARCHAR}, - - - accident_description = #{accidentDescription,jdbcType=VARCHAR}, - - - emergency_plan_true = #{emergencyPlanTrue,jdbcType=INTEGER}, - - - emergency_plan_id = #{emergencyPlanId,jdbcType=VARCHAR}, - - - handle_result = #{handleResult,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_accident - set happen_date = #{happenDate,jdbcType=TIMESTAMP}, - happen_place = #{happenPlace,jdbcType=VARCHAR}, - accident_type_id = #{accidentTypeId,jdbcType=VARCHAR}, - accident_description = #{accidentDescription,jdbcType=VARCHAR}, - emergency_plan_true = #{emergencyPlanTrue,jdbcType=INTEGER}, - emergency_plan_id = #{emergencyPlanId,jdbcType=VARCHAR}, - handle_result = #{handleResult,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_accident - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/accident/AccidentTypeMapper.xml b/src/com/sipai/mapper/accident/AccidentTypeMapper.xml deleted file mode 100644 index 339c98bb..00000000 --- a/src/com/sipai/mapper/accident/AccidentTypeMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, pid, name, harm_description, note, active, memo, morder - - - - delete from tb_accident_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_accident_type (id, pid, name, - harm_description, note, active, - memo, morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{harmDescription,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_accident_type - - - id, - - - pid, - - - name, - - - harm_description, - - - note, - - - active, - - - memo, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{harmDescription,jdbcType=VARCHAR}, - - - #{note,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_accident_type - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - harm_description = #{harmDescription,jdbcType=VARCHAR}, - - - note = #{note,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_accident_type - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - harm_description = #{harmDescription,jdbcType=VARCHAR}, - note = #{note,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_accident_type - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/accident/ReasonableAdviceMapper.xml b/src/com/sipai/mapper/accident/ReasonableAdviceMapper.xml deleted file mode 100644 index 22bfe213..00000000 --- a/src/com/sipai/mapper/accident/ReasonableAdviceMapper.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, name, content, unit_id, insdt, user_lead, users_help, take_flag, audit_content, - advice_type, processDefId, processId, audit_man_id - - - - delete from tb_reasonable_advice - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_reasonable_advice (id, name, content, - unit_id, insdt, user_lead, - users_help, take_flag, audit_content, - advice_type, processDefId, processId, - audit_man_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{userLead,jdbcType=VARCHAR}, - #{usersHelp,jdbcType=VARCHAR}, #{takeFlag,jdbcType=VARCHAR}, #{auditContent,jdbcType=VARCHAR}, - #{adviceType,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{auditManId,jdbcType=VARCHAR}) - - - insert into tb_reasonable_advice - - - id, - - - name, - - - content, - - - unit_id, - - - insdt, - - - user_lead, - - - users_help, - - - take_flag, - - - audit_content, - - - advice_type, - - - processDefId, - - - processId, - - - audit_man_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{userLead,jdbcType=VARCHAR}, - - - #{usersHelp,jdbcType=VARCHAR}, - - - #{takeFlag,jdbcType=VARCHAR}, - - - #{auditContent,jdbcType=VARCHAR}, - - - #{adviceType,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - - - update tb_reasonable_advice - - - name = #{name,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - user_lead = #{userLead,jdbcType=VARCHAR}, - - - users_help = #{usersHelp,jdbcType=VARCHAR}, - - - take_flag = #{takeFlag,jdbcType=VARCHAR}, - - - audit_content = #{auditContent,jdbcType=VARCHAR}, - - - advice_type = #{adviceType,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_reasonable_advice - set name = #{name,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - user_lead = #{userLead,jdbcType=VARCHAR}, - users_help = #{usersHelp,jdbcType=VARCHAR}, - take_flag = #{takeFlag,jdbcType=VARCHAR}, - audit_content = #{auditContent,jdbcType=VARCHAR}, - advice_type = #{adviceType,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_reasonable_advice - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/accident/RoastMapper.xml b/src/com/sipai/mapper/accident/RoastMapper.xml deleted file mode 100644 index 60d180f8..00000000 --- a/src/com/sipai/mapper/accident/RoastMapper.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, name, content, unit_id, insdt, insuser, user_lead, users_help, take_flag, audit_content, - advice_type, processDefId, processId, audit_man_id, anonymous - - - - delete from tb_roast - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_roast (id, name, content, - unit_id, insdt, insuser, user_lead, - users_help, take_flag, audit_content, - advice_type, processDefId, processId, - audit_man_id, anonymous) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{userLead,jdbcType=VARCHAR}, - #{usersHelp,jdbcType=VARCHAR}, #{takeFlag,jdbcType=VARCHAR}, #{auditContent,jdbcType=VARCHAR}, - #{adviceType,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{auditManId,jdbcType=VARCHAR}, #{anonymous,jdbcType=VARCHAR}) - - - insert into tb_roast - - - id, - - - name, - - - content, - - - unit_id, - - - insdt, - - - insuser, - - - user_lead, - - - users_help, - - - take_flag, - - - audit_content, - - - advice_type, - - - processDefId, - - - processId, - - - audit_man_id, - - - anonymous, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{userLead,jdbcType=VARCHAR}, - - - #{usersHelp,jdbcType=VARCHAR}, - - - #{takeFlag,jdbcType=VARCHAR}, - - - #{auditContent,jdbcType=VARCHAR}, - - - #{adviceType,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{anonymous,jdbcType=VARCHAR}, - - - - - update tb_roast - - - name = #{name,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - user_lead = #{userLead,jdbcType=VARCHAR}, - - - users_help = #{usersHelp,jdbcType=VARCHAR}, - - - take_flag = #{takeFlag,jdbcType=VARCHAR}, - - - audit_content = #{auditContent,jdbcType=VARCHAR}, - - - advice_type = #{adviceType,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - anonymous = #{anonymous,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_roast - set name = #{name,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - user_lead = #{userLead,jdbcType=VARCHAR}, - users_help = #{usersHelp,jdbcType=VARCHAR}, - take_flag = #{takeFlag,jdbcType=VARCHAR}, - audit_content = #{auditContent,jdbcType=VARCHAR}, - advice_type = #{adviceType,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - anonymous = #{anonymous,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_roast - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelDataMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelDataMapper.xml deleted file mode 100644 index cb66b5e0..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelDataMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, mpid, value, pid, modeMPld - - - - delete from TB_Achievement_AcceptanceModelData - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModelData (id, mpid, value, - pid, modeMPld) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, - #{pid,jdbcType=VARCHAR}, #{modeMPld,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModelData - - - id, - - - mpid, - - - value, - - - pid, - - - modeMPld, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{pid,jdbcType=VARCHAR}, - - - #{modeMPld,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModelData - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - modeMPld = #{modeMPld,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModelData - set mpid = #{mpid,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - pid = #{pid,jdbcType=VARCHAR}, - modeMPld = #{modeMPld,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModelData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelMPointMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelMPointMapper.xml deleted file mode 100644 index e46f2121..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelMPointMapper.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, acceptance_model_id, mpoint_id, mpoint_name, unitConversion, insuser, insdt, - morder, pos_x, pos_y, sheet_name, value_type, moveData, monthRange - - - - delete from TB_Achievement_AcceptanceModel_MPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModel_MPoint (id, acceptance_model_id, mpoint_id, - mpoint_name, unitConversion, insuser, - insdt, morder, pos_x, - pos_y, sheet_name, value_type, - moveData, monthRange) - values (#{id,jdbcType=VARCHAR}, #{acceptanceModelId,jdbcType=VARCHAR}, #{mpointId,jdbcType=VARCHAR}, - #{mpointName,jdbcType=VARCHAR}, #{unitconversion,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, #{posX,jdbcType=VARCHAR}, - #{posY,jdbcType=VARCHAR}, #{sheetName,jdbcType=VARCHAR}, #{valueType,jdbcType=VARCHAR}, - #{movedata,jdbcType=INTEGER}, #{monthrange,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModel_MPoint - - - id, - - - acceptance_model_id, - - - mpoint_id, - - - mpoint_name, - - - unitConversion, - - - insuser, - - - insdt, - - - morder, - - - pos_x, - - - pos_y, - - - sheet_name, - - - value_type, - - - moveData, - - - monthRange, - - - - - #{id,jdbcType=VARCHAR}, - - - #{acceptanceModelId,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - #{mpointName,jdbcType=VARCHAR}, - - - #{unitconversion,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{posX,jdbcType=VARCHAR}, - - - #{posY,jdbcType=VARCHAR}, - - - #{sheetName,jdbcType=VARCHAR}, - - - #{valueType,jdbcType=VARCHAR}, - - - #{movedata,jdbcType=INTEGER}, - - - #{monthrange,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModel_MPoint - - - acceptance_model_id = #{acceptanceModelId,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - mpoint_name = #{mpointName,jdbcType=VARCHAR}, - - - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - pos_x = #{posX,jdbcType=VARCHAR}, - - - pos_y = #{posY,jdbcType=VARCHAR}, - - - sheet_name = #{sheetName,jdbcType=VARCHAR}, - - - value_type = #{valueType,jdbcType=VARCHAR}, - - - moveData = #{movedata,jdbcType=INTEGER}, - - - monthRange = #{monthrange,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModel_MPoint - set acceptance_model_id = #{acceptanceModelId,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - mpoint_name = #{mpointName,jdbcType=VARCHAR}, - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - pos_x = #{posX,jdbcType=VARCHAR}, - pos_y = #{posY,jdbcType=VARCHAR}, - sheet_name = #{sheetName,jdbcType=VARCHAR}, - value_type = #{valueType,jdbcType=VARCHAR}, - moveData = #{movedata,jdbcType=INTEGER}, - monthRange = #{monthrange,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModel_MPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelMapper.xml deleted file mode 100644 index e25f05eb..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelMapper.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, pid, name, active, type, remark, insuser, insdt, morder, unit_id,checkstandard,modelgoal,requirement,userid - - - - delete from TB_Achievement_AcceptanceModel - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModel (id, pid, name, - active, type, remark, - insuser, insdt, morder, - unit_id,checkstandard,modelgoal,requirement,userid) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{active,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, - #{unitId,jdbcType=VARCHAR},#{checkstandard,jdbcType=VARCHAR},#{modelgoal,jdbcType=VARCHAR}, - #{requirement,jdbcType=VARCHAR},#{userid,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModel - - - id, - - - pid, - - - name, - - - active, - - - type, - - - remark, - - - insuser, - - - insdt, - - - morder, - - - unit_id, - - - checkstandard, - - - modelgoal, - - - requirement, - - - userid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{checkstandard,jdbcType=VARCHAR}, - - - #{modelgoal,jdbcType=VARCHAR}, - - - #{requirement,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModel - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - checkstandard = #{checkstandard,jdbcType=VARCHAR}, - - - modelgoal = #{modelgoal,jdbcType=VARCHAR}, - - - requirement = #{requirement,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModel - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR}, - checkstandard = #{checkstandard,jdbcType=VARCHAR}, - modelgoal = #{modelgoal,jdbcType=VARCHAR}, - requirement = #{requirement,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModel - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelOutputDataMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelOutputDataMapper.xml deleted file mode 100644 index a9dcb1cb..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelOutputDataMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, value, pid, modeOutputld, status - - - - delete from TB_Achievement_AcceptanceModelOutputData - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModelOutputData (id, value, pid, - modeOutputld, status) - values (#{id,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, #{pid,jdbcType=VARCHAR}, - #{modeoutputld,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModelOutputData - - - id, - - - value, - - - pid, - - - modeOutputld, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{pid,jdbcType=VARCHAR}, - - - #{modeoutputld,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModelOutputData - - - value = #{value,jdbcType=DOUBLE}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - modeOutputld = #{modeoutputld,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModelOutputData - set value = #{value,jdbcType=DOUBLE}, - pid = #{pid,jdbcType=VARCHAR}, - modeOutputld = #{modeoutputld,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModelOutputData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelOutputMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelOutputMapper.xml deleted file mode 100644 index 191a31c7..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelOutputMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, acceptance_model_id, name, mpoint_id, sheet_name, base_id, pos_x, pos_y, morder, - insdt, insuser - - - - delete from TB_Achievement_AcceptanceModel_Output - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModel_Output (id, acceptance_model_id, name, - mpoint_id, sheet_name, base_id, - pos_x, pos_y, morder, - insdt, insuser) - values (#{id,jdbcType=VARCHAR}, #{acceptanceModelId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{mpointId,jdbcType=VARCHAR}, #{sheetName,jdbcType=VARCHAR}, #{baseId,jdbcType=VARCHAR}, - #{posX,jdbcType=VARCHAR}, #{posY,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModel_Output - - - id, - - - acceptance_model_id, - - - name, - - - mpoint_id, - - - sheet_name, - - - base_id, - - - pos_x, - - - pos_y, - - - morder, - - - insdt, - - - insuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{acceptanceModelId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - #{sheetName,jdbcType=VARCHAR}, - - - #{baseId,jdbcType=VARCHAR}, - - - #{posX,jdbcType=VARCHAR}, - - - #{posY,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModel_Output - - - acceptance_model_id = #{acceptanceModelId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - sheet_name = #{sheetName,jdbcType=VARCHAR}, - - - base_id = #{baseId,jdbcType=VARCHAR}, - - - pos_x = #{posX,jdbcType=VARCHAR}, - - - pos_y = #{posY,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModel_Output - set acceptance_model_id = #{acceptanceModelId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - sheet_name = #{sheetName,jdbcType=VARCHAR}, - base_id = #{baseId,jdbcType=VARCHAR}, - pos_x = #{posX,jdbcType=VARCHAR}, - pos_y = #{posY,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModel_Output - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelRecordMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelRecordMapper.xml deleted file mode 100644 index dad79940..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelRecordMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, name, sdt, edt, insdt, insuser, pid - - - - delete from TB_Achievement_AcceptanceModelRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModelRecord (id, name, sdt, - edt, insdt, insuser, pid - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sdt,jdbcType=TIMESTAMP}, - #{edt,jdbcType=TIMESTAMP}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModelRecord - - - id, - - - name, - - - sdt, - - - edt, - - - insdt, - - - insuser, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModelRecord - - - name = #{name,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModelRecord - set name = #{name,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModelRecord - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelTextDataMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelTextDataMapper.xml deleted file mode 100644 index 900c7fce..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelTextDataMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, text, pid, modeTextld - - - - delete from TB_Achievement_AcceptanceModelTextData - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModelTextData (id, text, pid, - modeTextld) - values (#{id,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{modetextld,jdbcType=VARCHAR}) - - - insert into TB_Achievement_AcceptanceModelTextData - - - id, - - - text, - - - pid, - - - modeTextld, - - - - - #{id,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{modetextld,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModelTextData - - - text = #{text,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - modeTextld = #{modetextld,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModelTextData - set text = #{text,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - modeTextld = #{modetextld,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModelTextData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/AcceptanceModelTextMapper.xml b/src/com/sipai/mapper/achievement/AcceptanceModelTextMapper.xml deleted file mode 100644 index 0860a616..00000000 --- a/src/com/sipai/mapper/achievement/AcceptanceModelTextMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, acceptance_model_id, name, insuser, insdt, morder, pos_x, pos_y, sheet_name - - - - delete from TB_Achievement_AcceptanceModel_Text - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_AcceptanceModel_Text (id, acceptance_model_id, name, - insuser, insdt, morder, - pos_x, pos_y, sheet_name - ) - values (#{id,jdbcType=VARCHAR}, #{acceptanceModelId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, - #{posX,jdbcType=INTEGER}, #{posY,jdbcType=INTEGER}, #{sheetName,jdbcType=VARCHAR} - ) - - - insert into TB_Achievement_AcceptanceModel_Text - - - id, - - - acceptance_model_id, - - - name, - - - insuser, - - - insdt, - - - morder, - - - pos_x, - - - pos_y, - - - sheet_name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{acceptanceModelId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{posX,jdbcType=INTEGER}, - - - #{posY,jdbcType=INTEGER}, - - - #{sheetName,jdbcType=VARCHAR}, - - - - - update TB_Achievement_AcceptanceModel_Text - - - acceptance_model_id = #{acceptanceModelId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - pos_x = #{posX,jdbcType=INTEGER}, - - - pos_y = #{posY,jdbcType=INTEGER}, - - - sheet_name = #{sheetName,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_AcceptanceModel_Text - set acceptance_model_id = #{acceptanceModelId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - pos_x = #{posX,jdbcType=INTEGER}, - pos_y = #{posY,jdbcType=INTEGER}, - sheet_name = #{sheetName,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_AcceptanceModel_Text - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/achievement/ModelLibraryMapper.xml b/src/com/sipai/mapper/achievement/ModelLibraryMapper.xml deleted file mode 100644 index cee0b72a..00000000 --- a/src/com/sipai/mapper/achievement/ModelLibraryMapper.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, unit_id, type, morder, param_name, param_code, reference_high_value, - reference_low_value, reference_value, reference_type, unit, explain, remark, project_type - - - - delete from TB_Achievement_ModelLibrary - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Achievement_ModelLibrary (id, insdt, insuser, - pid, unit_id, type, - morder, param_name, param_code, - reference_high_value, reference_low_value, - reference_value, reference_type, unit, - explain, remark, project_type - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{paramName,jdbcType=VARCHAR}, #{paramCode,jdbcType=VARCHAR}, - #{referenceHighValue,jdbcType=VARCHAR}, #{referenceLowValue,jdbcType=VARCHAR}, - #{referenceValue,jdbcType=VARCHAR}, #{referenceType,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, - #{explain,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{projectType,jdbcType=VARCHAR} - ) - - - insert into TB_Achievement_ModelLibrary - - - id, - - - insdt, - - - insuser, - - - pid, - - - unit_id, - - - type, - - - morder, - - - param_name, - - - param_code, - - - reference_high_value, - - - reference_low_value, - - - reference_value, - - - reference_type, - - - unit, - - - explain, - - - remark, - - - project_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{paramName,jdbcType=VARCHAR}, - - - #{paramCode,jdbcType=VARCHAR}, - - - #{referenceHighValue,jdbcType=VARCHAR}, - - - #{referenceLowValue,jdbcType=VARCHAR}, - - - #{referenceValue,jdbcType=VARCHAR}, - - - #{referenceType,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{explain,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{projectType,jdbcType=VARCHAR}, - - - - - update TB_Achievement_ModelLibrary - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - param_name = #{paramName,jdbcType=VARCHAR}, - - - param_code = #{paramCode,jdbcType=VARCHAR}, - - - reference_high_value = #{referenceHighValue,jdbcType=VARCHAR}, - - - reference_low_value = #{referenceLowValue,jdbcType=VARCHAR}, - - - reference_value = #{referenceValue,jdbcType=VARCHAR}, - - - reference_type = #{referenceType,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - explain = #{explain,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - project_type = #{projectType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Achievement_ModelLibrary - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - param_name = #{paramName,jdbcType=VARCHAR}, - param_code = #{paramCode,jdbcType=VARCHAR}, - reference_high_value = #{referenceHighValue,jdbcType=VARCHAR}, - reference_low_value = #{referenceLowValue,jdbcType=VARCHAR}, - reference_value = #{referenceValue,jdbcType=VARCHAR}, - reference_type = #{referenceType,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - explain = #{explain,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - project_type = #{projectType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Achievement_ModelLibrary - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/activiti/LeaveMapper.xml b/src/com/sipai/mapper/activiti/LeaveMapper.xml deleted file mode 100644 index 90249983..00000000 --- a/src/com/sipai/mapper/activiti/LeaveMapper.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - id, apply_time, end_time, leave_type, process_instance_id, reality_end_time, reality_start_time, - reason, start_time, user_id - - - - - delete from oa_leave - where id = #{id,jdbcType=NUMERIC} - - - insert into oa_leave (id, apply_time, end_time, - leave_type, process_instance_id, reality_end_time, - reality_start_time, reason, start_time, - user_id) - values (#{id,jdbcType=NUMERIC}, #{applyTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, - #{leaveType,jdbcType=VARCHAR}, #{processInstanceId,jdbcType=VARCHAR}, #{realityEndTime,jdbcType=TIMESTAMP}, - #{realityStartTime,jdbcType=TIMESTAMP}, #{reason,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, - #{userId,jdbcType=VARCHAR}) - - - insert into oa_leave - - - id, - - - apply_time, - - - end_time, - - - leave_type, - - - process_instance_id, - - - reality_end_time, - - - reality_start_time, - - - reason, - - - start_time, - - - user_id, - - - - - #{id,jdbcType=NUMERIC}, - - - #{applyTime,jdbcType=TIMESTAMP}, - - - #{endTime,jdbcType=TIMESTAMP}, - - - #{leaveType,jdbcType=VARCHAR}, - - - #{processInstanceId,jdbcType=VARCHAR}, - - - #{realityEndTime,jdbcType=TIMESTAMP}, - - - #{realityStartTime,jdbcType=TIMESTAMP}, - - - #{reason,jdbcType=VARCHAR}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{userId,jdbcType=VARCHAR}, - - - - - update oa_leave - - - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - - - end_time = #{endTime,jdbcType=TIMESTAMP}, - - - leave_type = #{leaveType,jdbcType=VARCHAR}, - - - process_instance_id = #{processInstanceId,jdbcType=VARCHAR}, - - - reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP}, - - - reality_start_time = #{realityStartTime,jdbcType=TIMESTAMP}, - - - reason = #{reason,jdbcType=VARCHAR}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=NUMERIC} - - - update oa_leave - set apply_time = #{applyTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - leave_type = #{leaveType,jdbcType=VARCHAR}, - process_instance_id = #{processInstanceId,jdbcType=VARCHAR}, - reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP}, - reality_start_time = #{realityStartTime,jdbcType=TIMESTAMP}, - reason = #{reason,jdbcType=VARCHAR}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - user_id = #{userId,jdbcType=VARCHAR} - where id = #{id,jdbcType=NUMERIC} - - - - delete from oa_leave - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/activiti/ModelNodeJobMapper.xml b/src/com/sipai/mapper/activiti/ModelNodeJobMapper.xml deleted file mode 100644 index cc3ec4d2..00000000 --- a/src/com/sipai/mapper/activiti/ModelNodeJobMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - id, resource_id, job_id,model_id - - - - delete from tb_model_node_job - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_model_node_job (id, resource_id, job_id,model_id - ) - values (#{id,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, #{modelId,jdbcType=VARCHAR} - ) - - - insert into tb_model_node_job - - - id, - - - resource_id, - - - job_id, - - - model_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{resourceId,jdbcType=VARCHAR}, - - - #{jobId,jdbcType=VARCHAR}, - - - #{modelId,jdbcType=VARCHAR}, - - - - - update tb_model_node_job - - - resource_id = #{resourceId,jdbcType=VARCHAR}, - - - job_id = #{jobId,jdbcType=VARCHAR}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_model_node_job - set resource_id = #{resourceId,jdbcType=VARCHAR}, - job_id = #{jobId,jdbcType=VARCHAR}, - model_id = #{modelId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_model_node_job - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/activiti/OEProcessMapper.xml b/src/com/sipai/mapper/activiti/OEProcessMapper.xml deleted file mode 100644 index 4c63d683..00000000 --- a/src/com/sipai/mapper/activiti/OEProcessMapper.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - id, Processnum, Username, Meno, URL, ywlb - - - - delete from [OA_ELM].[dbo].TB_OE_PROCESS - where id = #{id,jdbcType=VARCHAR} - - - insert into [OA_ELM].[dbo].TB_OE_PROCESS (id, Processnum, Username, - Meno, URL, ywlb) - values (#{id,jdbcType=VARCHAR}, #{processnum,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, - #{meno,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{ywlb,jdbcType=VARCHAR}) - - - insert into [OA_ELM].[dbo].TB_OE_PROCESS - - - id, - - - Processnum, - - - Username, - - - Meno, - - - URL, - - - ywlb, - - - - - #{id,jdbcType=VARCHAR}, - - - #{processnum,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{meno,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{ywlb,jdbcType=VARCHAR}, - - - - - update [OA_ELM].[dbo].TB_OE_PROCESS - - - Processnum = #{processnum,jdbcType=VARCHAR}, - - - Username = #{username,jdbcType=VARCHAR}, - - - Meno = #{meno,jdbcType=VARCHAR}, - - - URL = #{url,jdbcType=VARCHAR}, - - - ywlb = #{ywlb,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update [OA_ELM].[dbo].TB_OE_PROCESS - set Processnum = #{processnum,jdbcType=VARCHAR}, - Username = #{username,jdbcType=VARCHAR}, - Meno = #{meno,jdbcType=VARCHAR}, - URL = #{url,jdbcType=VARCHAR}, - ywlb = #{ywlb,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from [OA_ELM].[dbo].TB_OE_PROCESS ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/IndexClassMapper.xml b/src/com/sipai/mapper/administration/IndexClassMapper.xml deleted file mode 100644 index da2cef77..00000000 --- a/src/com/sipai/mapper/administration/IndexClassMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, version, morder, sname, active, code, remarks, unit_id - - - - delete from tb_administration_index_class - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_index_class (id, name, pid, - insdt, insuser, version, - morder, sname, active, - code, remarks, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{sname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_administration_index_class - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - sname, - - - active, - - - code, - - - remarks, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_administration_index_class - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_index_class - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_index_class - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/IndexCycleMapper.xml b/src/com/sipai/mapper/administration/IndexCycleMapper.xml deleted file mode 100644 index 00dd1f1a..00000000 --- a/src/com/sipai/mapper/administration/IndexCycleMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, version, morder, active, money, memo - - - - delete from tb_administration_index_cycle - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_index_cycle (id, name, pid, - insdt, insuser, version, - morder, active, money, - memo) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{active,jdbcType=VARCHAR}, #{money,jdbcType=DECIMAL}, - #{memo,jdbcType=VARCHAR}) - - - insert into tb_administration_index_cycle - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - active, - - - money, - - - memo, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{money,jdbcType=DECIMAL}, - - - #{memo,jdbcType=VARCHAR}, - - - - - update tb_administration_index_cycle - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - money = #{money,jdbcType=DECIMAL}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_index_cycle - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - money = #{money,jdbcType=DECIMAL}, - memo = #{memo,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_index_cycle - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/IndexMapper.xml b/src/com/sipai/mapper/administration/IndexMapper.xml deleted file mode 100644 index 97faef6e..00000000 --- a/src/com/sipai/mapper/administration/IndexMapper.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, version, morder, sname, active, code, deptid, userid, - budget, classid, remarks, unit_id, date_year - - - - delete from tb_administration_index - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_index (id, name, pid, - insdt, insuser, version, - morder, sname, active, - code, deptid, userid, - budget, classid, remarks, - unit_id, date_year) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{sname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{deptid,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, - #{budget,jdbcType=DECIMAL}, #{classid,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{dateYear,jdbcType=TIMESTAMP}) - - - insert into tb_administration_index - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - sname, - - - active, - - - code, - - - deptid, - - - userid, - - - budget, - - - classid, - - - remarks, - - - unit_id, - - - date_year, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{deptid,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{budget,jdbcType=DECIMAL}, - - - #{classid,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{dateYear,jdbcType=TIMESTAMP}, - - - - - update tb_administration_index - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - deptid = #{deptid,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - budget = #{budget,jdbcType=DECIMAL}, - - - classid = #{classid,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - date_year = #{dateYear,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_index - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - deptid = #{deptid,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR}, - budget = #{budget,jdbcType=DECIMAL}, - classid = #{classid,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - date_year = #{dateYear,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_index - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/IndexWorkMapper.xml b/src/com/sipai/mapper/administration/IndexWorkMapper.xml deleted file mode 100644 index 805cd6ce..00000000 --- a/src/com/sipai/mapper/administration/IndexWorkMapper.xml +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, indexid, insdt, insuser, version, morder, active, cycle, unit, min, max, actual, - complete, standard, measures, receive_user_id, quota_hours, bonus_penalty, enclosure, - remarks, unit_id, job_number, finish_date, send_user_id, receive_user_ids, receive_dt, - working_hours, processId, processDefId, process_status, evaluate_user_id - - - - delete from tb_administration_index_work - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_index_work (id, indexid, insdt, - insuser, version, morder, - active, cycle, unit, - min, max, actual, complete, - standard, measures, receive_user_id, - quota_hours, bonus_penalty, enclosure, - remarks, unit_id, job_number, - finish_date, send_user_id, receive_user_ids, - receive_dt, working_hours, processId, - processDefId, process_status, evaluate_user_id - ) - values (#{id,jdbcType=VARCHAR}, #{indexid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=VARCHAR}, #{cycle,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, - #{min,jdbcType=DECIMAL}, #{max,jdbcType=DECIMAL}, #{actual,jdbcType=DECIMAL}, #{complete,jdbcType=DECIMAL}, - #{standard,jdbcType=VARCHAR}, #{measures,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, - #{quotaHours,jdbcType=DECIMAL}, #{bonusPenalty,jdbcType=DECIMAL}, #{enclosure,jdbcType=VARCHAR}, - #{remarks,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, - #{finishDate,jdbcType=TIMESTAMP}, #{sendUserId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, - #{receiveDt,jdbcType=VARCHAR}, #{workingHours,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processStatus,jdbcType=VARCHAR}, #{evaluateUserId,jdbcType=VARCHAR} - ) - - - insert into tb_administration_index_work - - - id, - - - indexid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - active, - - - cycle, - - - unit, - - - min, - - - max, - - - actual, - - - complete, - - - standard, - - - measures, - - - receive_user_id, - - - quota_hours, - - - bonus_penalty, - - - enclosure, - - - remarks, - - - unit_id, - - - job_number, - - - finish_date, - - - send_user_id, - - - receive_user_ids, - - - receive_dt, - - - working_hours, - - - processId, - - - processDefId, - - - process_status, - - - evaluate_user_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{indexid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{min,jdbcType=DECIMAL}, - - - #{max,jdbcType=DECIMAL}, - - - #{actual,jdbcType=DECIMAL}, - - - #{complete,jdbcType=DECIMAL}, - - - #{standard,jdbcType=VARCHAR}, - - - #{measures,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{quotaHours,jdbcType=DECIMAL}, - - - #{bonusPenalty,jdbcType=DECIMAL}, - - - #{enclosure,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{finishDate,jdbcType=TIMESTAMP}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{receiveDt,jdbcType=VARCHAR}, - - - #{workingHours,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processStatus,jdbcType=VARCHAR}, - - - #{evaluateUserId,jdbcType=VARCHAR}, - - - - - update tb_administration_index_work - - - indexid = #{indexid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - min = #{min,jdbcType=DECIMAL}, - - - max = #{max,jdbcType=DECIMAL}, - - - actual = #{actual,jdbcType=DECIMAL}, - - - complete = #{complete,jdbcType=DECIMAL}, - - - standard = #{standard,jdbcType=VARCHAR}, - - - measures = #{measures,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - quota_hours = #{quotaHours,jdbcType=DECIMAL}, - - - bonus_penalty = #{bonusPenalty,jdbcType=DECIMAL}, - - - enclosure = #{enclosure,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - receive_dt = #{receiveDt,jdbcType=VARCHAR}, - - - working_hours = #{workingHours,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - process_status = #{processStatus,jdbcType=VARCHAR}, - - - evaluate_user_id = #{evaluateUserId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_index_work - set indexid = #{indexid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - min = #{min,jdbcType=DECIMAL}, - max = #{max,jdbcType=DECIMAL}, - actual = #{actual,jdbcType=DECIMAL}, - complete = #{complete,jdbcType=DECIMAL}, - standard = #{standard,jdbcType=VARCHAR}, - measures = #{measures,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - quota_hours = #{quotaHours,jdbcType=DECIMAL}, - bonus_penalty = #{bonusPenalty,jdbcType=DECIMAL}, - enclosure = #{enclosure,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - receive_dt = #{receiveDt,jdbcType=VARCHAR}, - working_hours = #{workingHours,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - process_status = #{processStatus,jdbcType=VARCHAR}, - evaluate_user_id = #{evaluateUserId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_index_work - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/OrganizationClassMapper.xml b/src/com/sipai/mapper/administration/OrganizationClassMapper.xml deleted file mode 100644 index bf8684b5..00000000 --- a/src/com/sipai/mapper/administration/OrganizationClassMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, version, morder, sname, active, code, remarks, unit_id, - type, attribute - - - - delete from tb_administration_organization_class - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_organization_class (id, name, pid, - insdt, insuser, version, - morder, sname, active, - code, remarks, unit_id, - type, attribute) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{sname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{attribute,jdbcType=VARCHAR}) - - - insert into tb_administration_organization_class - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - sname, - - - active, - - - code, - - - remarks, - - - unit_id, - - - type, - - - attribute, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{attribute,jdbcType=VARCHAR}, - - - - - update tb_administration_organization_class - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - attribute = #{attribute,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_organization_class - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - attribute = #{attribute,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_organization_class - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/OrganizationMapper.xml b/src/com/sipai/mapper/administration/OrganizationMapper.xml deleted file mode 100644 index fccc6fd1..00000000 --- a/src/com/sipai/mapper/administration/OrganizationMapper.xml +++ /dev/null @@ -1,436 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, typeid, insdt, insuser, version, morder, active, receive_user_id, quota_hours, - bonus_penalty, enclosure, remarks, unit_id, job_number, finish_date, send_user_id, - receive_user_ids, receive_dt, working_hours, processId, processDefId, process_status, - project_name, plan_start_date, plan_finish_date, classid, actual_cost, quota_cost, - evaluate_user_id, evaluate_opinion, check_date, code, project_cont - - - - delete from tb_administration_organization - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_organization (id, typeid, insdt, - insuser, version, morder, - active, receive_user_id, quota_hours, - bonus_penalty, enclosure, remarks, - unit_id, job_number, finish_date, - send_user_id, receive_user_ids, receive_dt, - working_hours, processId, processDefId, - process_status, project_name, plan_start_date, - plan_finish_date, classid, actual_cost, - quota_cost, evaluate_user_id, evaluate_opinion, - check_date, code, project_cont - ) - values (#{id,jdbcType=VARCHAR}, #{typeid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, #{quotaHours,jdbcType=DECIMAL}, - #{bonusPenalty,jdbcType=DECIMAL}, #{enclosure,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{finishDate,jdbcType=TIMESTAMP}, - #{sendUserId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, #{receiveDt,jdbcType=VARCHAR}, - #{workingHours,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, - #{processStatus,jdbcType=VARCHAR}, #{projectName,jdbcType=VARCHAR}, #{planStartDate,jdbcType=TIMESTAMP}, - #{planFinishDate,jdbcType=VARCHAR}, #{classid,jdbcType=VARCHAR}, #{actualCost,jdbcType=DECIMAL}, - #{quotaCost,jdbcType=DECIMAL}, #{evaluateUserId,jdbcType=VARCHAR}, #{evaluateOpinion,jdbcType=VARCHAR}, - #{checkDate,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{projectCont,jdbcType=VARCHAR} - ) - - - insert into tb_administration_organization - - - id, - - - typeid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - active, - - - receive_user_id, - - - quota_hours, - - - bonus_penalty, - - - enclosure, - - - remarks, - - - unit_id, - - - job_number, - - - finish_date, - - - send_user_id, - - - receive_user_ids, - - - receive_dt, - - - working_hours, - - - processId, - - - processDefId, - - - process_status, - - - project_name, - - - plan_start_date, - - - plan_finish_date, - - - classid, - - - actual_cost, - - - quota_cost, - - - evaluate_user_id, - - - evaluate_opinion, - - - check_date, - - - code, - - - project_cont, - - - - - #{id,jdbcType=VARCHAR}, - - - #{typeid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{quotaHours,jdbcType=DECIMAL}, - - - #{bonusPenalty,jdbcType=DECIMAL}, - - - #{enclosure,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{finishDate,jdbcType=TIMESTAMP}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{receiveDt,jdbcType=VARCHAR}, - - - #{workingHours,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processStatus,jdbcType=VARCHAR}, - - - #{projectName,jdbcType=VARCHAR}, - - - #{planStartDate,jdbcType=TIMESTAMP}, - - - #{planFinishDate,jdbcType=VARCHAR}, - - - #{classid,jdbcType=VARCHAR}, - - - #{actualCost,jdbcType=DECIMAL}, - - - #{quotaCost,jdbcType=DECIMAL}, - - - #{evaluateUserId,jdbcType=VARCHAR}, - - - #{evaluateOpinion,jdbcType=VARCHAR}, - - - #{checkDate,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{projectCont,jdbcType=VARCHAR}, - - - - - update tb_administration_organization - - - typeid = #{typeid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - quota_hours = #{quotaHours,jdbcType=DECIMAL}, - - - bonus_penalty = #{bonusPenalty,jdbcType=DECIMAL}, - - - enclosure = #{enclosure,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - receive_dt = #{receiveDt,jdbcType=VARCHAR}, - - - working_hours = #{workingHours,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - process_status = #{processStatus,jdbcType=VARCHAR}, - - - project_name = #{projectName,jdbcType=VARCHAR}, - - - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - - - plan_finish_date = #{planFinishDate,jdbcType=VARCHAR}, - - - classid = #{classid,jdbcType=VARCHAR}, - - - actual_cost = #{actualCost,jdbcType=DECIMAL}, - - - quota_cost = #{quotaCost,jdbcType=DECIMAL}, - - - evaluate_user_id = #{evaluateUserId,jdbcType=VARCHAR}, - - - evaluate_opinion = #{evaluateOpinion,jdbcType=VARCHAR}, - - - check_date = #{checkDate,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - project_cont = #{projectCont,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_organization - set typeid = #{typeid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - quota_hours = #{quotaHours,jdbcType=DECIMAL}, - bonus_penalty = #{bonusPenalty,jdbcType=DECIMAL}, - enclosure = #{enclosure,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - receive_dt = #{receiveDt,jdbcType=VARCHAR}, - working_hours = #{workingHours,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - process_status = #{processStatus,jdbcType=VARCHAR}, - project_name = #{projectName,jdbcType=VARCHAR}, - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - plan_finish_date = #{planFinishDate,jdbcType=VARCHAR}, - classid = #{classid,jdbcType=VARCHAR}, - actual_cost = #{actualCost,jdbcType=DECIMAL}, - quota_cost = #{quotaCost,jdbcType=DECIMAL}, - evaluate_user_id = #{evaluateUserId,jdbcType=VARCHAR}, - evaluate_opinion = #{evaluateOpinion,jdbcType=VARCHAR}, - check_date = #{checkDate,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - project_cont = #{projectCont,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_organization - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/administration/TemporaryMapper.xml b/src/com/sipai/mapper/administration/TemporaryMapper.xml deleted file mode 100644 index 6a110ae4..00000000 --- a/src/com/sipai/mapper/administration/TemporaryMapper.xml +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, version, morder, active, receive_user_id, bonus_penalty, remarks, - unit_id, job_number, finish_date, send_user_id, receive_user_ids, receive_dt, working_hours, - processId, processDefId, process_status, project_name, plan_start_date, plan_finish_date, - classid, check_date, code, project_cont - - - - delete from tb_administration_temporary - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_administration_temporary (id, insdt, insuser, - version, morder, active, - receive_user_id, bonus_penalty, remarks, - unit_id, job_number, finish_date, - send_user_id, receive_user_ids, receive_dt, - working_hours, processId, processDefId, - process_status, project_name, plan_start_date, - plan_finish_date, classid, check_date, - code, project_cont) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{version,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=VARCHAR}, - #{receiveUserId,jdbcType=VARCHAR}, #{bonusPenalty,jdbcType=DECIMAL}, #{remarks,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{finishDate,jdbcType=TIMESTAMP}, - #{sendUserId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, #{receiveDt,jdbcType=VARCHAR}, - #{workingHours,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, - #{processStatus,jdbcType=VARCHAR}, #{projectName,jdbcType=VARCHAR}, #{planStartDate,jdbcType=TIMESTAMP}, - #{planFinishDate,jdbcType=VARCHAR}, #{classid,jdbcType=VARCHAR}, #{checkDate,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{projectCont,jdbcType=VARCHAR}) - - - insert into tb_administration_temporary - - - id, - - - insdt, - - - insuser, - - - version, - - - morder, - - - active, - - - receive_user_id, - - - bonus_penalty, - - - remarks, - - - unit_id, - - - job_number, - - - finish_date, - - - send_user_id, - - - receive_user_ids, - - - receive_dt, - - - working_hours, - - - processId, - - - processDefId, - - - process_status, - - - project_name, - - - plan_start_date, - - - plan_finish_date, - - - classid, - - - check_date, - - - code, - - - project_cont, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{bonusPenalty,jdbcType=DECIMAL}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{finishDate,jdbcType=TIMESTAMP}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{receiveDt,jdbcType=VARCHAR}, - - - #{workingHours,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processStatus,jdbcType=VARCHAR}, - - - #{projectName,jdbcType=VARCHAR}, - - - #{planStartDate,jdbcType=TIMESTAMP}, - - - #{planFinishDate,jdbcType=VARCHAR}, - - - #{classid,jdbcType=VARCHAR}, - - - #{checkDate,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{projectCont,jdbcType=VARCHAR}, - - - - - update tb_administration_temporary - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - bonus_penalty = #{bonusPenalty,jdbcType=DECIMAL}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - receive_dt = #{receiveDt,jdbcType=VARCHAR}, - - - working_hours = #{workingHours,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - process_status = #{processStatus,jdbcType=VARCHAR}, - - - project_name = #{projectName,jdbcType=VARCHAR}, - - - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - - - plan_finish_date = #{planFinishDate,jdbcType=VARCHAR}, - - - classid = #{classid,jdbcType=VARCHAR}, - - - check_date = #{checkDate,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - project_cont = #{projectCont,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_administration_temporary - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - bonus_penalty = #{bonusPenalty,jdbcType=DECIMAL}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - receive_dt = #{receiveDt,jdbcType=VARCHAR}, - working_hours = #{workingHours,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - process_status = #{processStatus,jdbcType=VARCHAR}, - project_name = #{projectName,jdbcType=VARCHAR}, - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - plan_finish_date = #{planFinishDate,jdbcType=VARCHAR}, - classid = #{classid,jdbcType=VARCHAR}, - check_date = #{checkDate,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - project_cont = #{projectCont,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_administration_temporary - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmConditionMapper.xml b/src/com/sipai/mapper/alarm/AlarmConditionMapper.xml deleted file mode 100644 index 9a58c56b..00000000 --- a/src/com/sipai/mapper/alarm/AlarmConditionMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, alarmTypeId, mpointid, compare, val, upperLimit, lowerLimit - - - - - delete from tb_alarm_condition - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_alarm_condition - ${where} - - - insert into tb_alarm_condition (id, insdt, insuser, - alarmTypeId, mpointid, compare, - val, upperLimit, lowerLimit - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{alarmtypeid,jdbcType=VARCHAR}, #{mpointid,jdbcType=VARCHAR}, #{compare,jdbcType=VARCHAR}, - #{val,jdbcType=DOUBLE}, #{upperlimit,jdbcType=DOUBLE}, #{lowerlimit,jdbcType=DOUBLE} - ) - - - insert into tb_alarm_condition - - - id, - - - insdt, - - - insuser, - - - alarmTypeId, - - - mpointid, - - - compare, - - - val, - - - upperLimit, - - - lowerLimit, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{alarmtypeid,jdbcType=VARCHAR}, - - - #{mpointid,jdbcType=VARCHAR}, - - - #{compare,jdbcType=VARCHAR}, - - - #{val,jdbcType=DOUBLE}, - - - #{upperlimit,jdbcType=DOUBLE}, - - - #{lowerlimit,jdbcType=DOUBLE}, - - - - - update tb_alarm_condition - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - alarmTypeId = #{alarmtypeid,jdbcType=VARCHAR}, - - - mpointid = #{mpointid,jdbcType=VARCHAR}, - - - compare = #{compare,jdbcType=VARCHAR}, - - - val = #{val,jdbcType=DOUBLE}, - - - upperLimit = #{upperlimit,jdbcType=DOUBLE}, - - - lowerLimit = #{lowerlimit,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_condition - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - alarmTypeId = #{alarmtypeid,jdbcType=VARCHAR}, - mpointid = #{mpointid,jdbcType=VARCHAR}, - compare = #{compare,jdbcType=VARCHAR}, - val = #{val,jdbcType=DOUBLE}, - upperLimit = #{upperlimit,jdbcType=DOUBLE}, - lowerLimit = #{lowerlimit,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmInformationMapper.xml b/src/com/sipai/mapper/alarm/AlarmInformationMapper.xml deleted file mode 100644 index 0a170421..00000000 --- a/src/com/sipai/mapper/alarm/AlarmInformationMapper.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insuser, insdt, updater, updatetime, name, code, unit_id, level_code, mold_code, - alarm_mode, alarm_receivers - - - - delete from tb_alarm_information - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_alarm_information (id, insuser, insdt, - updater, updatetime, name, - code, unit_id, level_code, - mold_code, alarm_mode, alarm_receivers - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{updater,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{levelCode,jdbcType=VARCHAR}, - #{moldCode,jdbcType=VARCHAR}, #{alarmMode,jdbcType=VARCHAR}, #{alarmReceivers,jdbcType=VARCHAR} - ) - - - insert into tb_alarm_information - - - id, - - - insuser, - - - insdt, - - - updater, - - - updatetime, - - - name, - - - code, - - - unit_id, - - - level_code, - - - mold_code, - - - alarm_mode, - - - alarm_receivers, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{updater,jdbcType=VARCHAR}, - - - #{updatetime,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{levelCode,jdbcType=VARCHAR}, - - - #{moldCode,jdbcType=VARCHAR}, - - - #{alarmMode,jdbcType=VARCHAR}, - - - #{alarmReceivers,jdbcType=VARCHAR}, - - - - - update tb_alarm_information - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - updater = #{updater,jdbcType=VARCHAR}, - - - updatetime = #{updatetime,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - level_code = #{levelCode,jdbcType=VARCHAR}, - - - mold_code = #{moldCode,jdbcType=VARCHAR}, - - - alarm_mode = #{alarmMode,jdbcType=VARCHAR}, - - - alarm_receivers = #{alarmReceivers,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_information - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - updater = #{updater,jdbcType=VARCHAR}, - updatetime = #{updatetime,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - level_code = #{levelCode,jdbcType=VARCHAR}, - mold_code = #{moldCode,jdbcType=VARCHAR}, - alarm_mode = #{alarmMode,jdbcType=VARCHAR}, - alarm_receivers = #{alarmReceivers,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_alarm_information - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmLevelsConfigMapper.xml b/src/com/sipai/mapper/alarm/AlarmLevelsConfigMapper.xml deleted file mode 100644 index ca8798fa..00000000 --- a/src/com/sipai/mapper/alarm/AlarmLevelsConfigMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, upper_limit, lower_limit, level, color, fraction, remark, code - - - - delete from tb_alarm_levels_config - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_alarm_levels_config (id, upper_limit, lower_limit, - level, color, fraction, - remark) - values (#{id,jdbcType=VARCHAR}, #{upperLimit,jdbcType=INTEGER}, #{lowerLimit,jdbcType=INTEGER}, - #{level,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{fraction,jdbcType=INTEGER}, - #{remark,jdbcType=VARCHAR}, #{code,jdbcType=INTEGER}) - - - insert into tb_alarm_levels_config - - - id, - - - upper_limit, - - - lower_limit, - - - level, - - - color, - - - fraction, - - - remark, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{upperLimit,jdbcType=INTEGER}, - - - #{lowerLimit,jdbcType=INTEGER}, - - - #{level,jdbcType=VARCHAR}, - - - #{color,jdbcType=VARCHAR}, - - - #{fraction,jdbcType=INTEGER}, - - - #{remark,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_alarm_levels_config - - - upper_limit = #{upperLimit,jdbcType=INTEGER}, - - - lower_limit = #{lowerLimit,jdbcType=INTEGER}, - - - level = #{level,jdbcType=VARCHAR}, - - - color = #{color,jdbcType=VARCHAR}, - - - fraction = #{fraction,jdbcType=INTEGER}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_levels_config - set upper_limit = #{upperLimit,jdbcType=INTEGER}, - lower_limit = #{lowerLimit,jdbcType=INTEGER}, - level = #{level,jdbcType=VARCHAR}, - color = #{color,jdbcType=VARCHAR}, - fraction = #{fraction,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR}, - code = #{code,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_alarm_levels_config - ${where} - - diff --git a/src/com/sipai/mapper/alarm/AlarmLevelsMapper.xml b/src/com/sipai/mapper/alarm/AlarmLevelsMapper.xml deleted file mode 100644 index a1b7d57a..00000000 --- a/src/com/sipai/mapper/alarm/AlarmLevelsMapper.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - id, name, code, morder - - - - delete from tb_alarm_levels - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_alarm_levels (id, name, code, - morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_alarm_levels - - - id, - - - name, - - - code, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_alarm_levels - - - name = #{name,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_levels - set name = #{name,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_alarm_levels - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmMoldMapper.xml b/src/com/sipai/mapper/alarm/AlarmMoldMapper.xml deleted file mode 100644 index d08cf81c..00000000 --- a/src/com/sipai/mapper/alarm/AlarmMoldMapper.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - id, name, code, morder - - - - delete from tb_alarm_mold - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_alarm_mold (id, name, code, - morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_alarm_mold - - - id, - - - name, - - - code, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_alarm_mold - - - name = #{name,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_mold - set name = #{name,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_alarm_mold - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmPointMapper.xml b/src/com/sipai/mapper/alarm/AlarmPointMapper.xml deleted file mode 100644 index 57c27722..00000000 --- a/src/com/sipai/mapper/alarm/AlarmPointMapper.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - id, insuser, insdt, updater, updatetime, alarm_point, base_value, information_code, - type, unit_id - - - - delete from tb_alarm_point - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_alarm_point (id, insuser, insdt, - updater, updatetime, alarm_point, - base_value, information_code, type, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{updater,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{alarmPoint,jdbcType=VARCHAR}, - #{baseValue,jdbcType=VARCHAR}, #{informationCode,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_alarm_point - - - id, - - - insuser, - - - insdt, - - - updater, - - - updatetime, - - - alarm_point, - - - base_value, - - - information_code, - - - type, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{updater,jdbcType=VARCHAR}, - - - #{updatetime,jdbcType=TIMESTAMP}, - - - #{alarmPoint,jdbcType=VARCHAR}, - - - #{baseValue,jdbcType=VARCHAR}, - - - #{informationCode,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_alarm_point - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - updater = #{updater,jdbcType=VARCHAR}, - - - updatetime = #{updatetime,jdbcType=TIMESTAMP}, - - - alarm_point = #{alarmPoint,jdbcType=VARCHAR}, - - - base_value = #{baseValue,jdbcType=VARCHAR}, - - - information_code = #{informationCode,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_point - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - updater = #{updater,jdbcType=VARCHAR}, - updatetime = #{updatetime,jdbcType=TIMESTAMP}, - alarm_point = #{alarmPoint,jdbcType=VARCHAR}, - base_value = #{baseValue,jdbcType=VARCHAR}, - information_code = #{informationCode,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_alarm_point - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmPointRiskLevelMapper.xml b/src/com/sipai/mapper/alarm/AlarmPointRiskLevelMapper.xml deleted file mode 100644 index 3a9b0434..00000000 --- a/src/com/sipai/mapper/alarm/AlarmPointRiskLevelMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, area_id, risk_level_id, morder, alarmPoint_id - - - - delete from TB_AlarmPoint_RiskLevel - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_AlarmPoint_RiskLevel (id, insdt, insuser, - area_id, risk_level_id, morder, - alarmPoint_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{areaId,jdbcType=VARCHAR}, #{riskLevelId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{alarmpointId,jdbcType=VARCHAR}) - - - insert into TB_AlarmPoint_RiskLevel - - - id, - - - insdt, - - - insuser, - - - area_id, - - - risk_level_id, - - - morder, - - - alarmPoint_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{areaId,jdbcType=VARCHAR}, - - - #{riskLevelId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{alarmpointId,jdbcType=VARCHAR}, - - - - - update TB_AlarmPoint_RiskLevel - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - area_id = #{areaId,jdbcType=VARCHAR}, - - - risk_level_id = #{riskLevelId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - alarmPoint_id = #{alarmpointId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_AlarmPoint_RiskLevel - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - area_id = #{areaId,jdbcType=VARCHAR}, - risk_level_id = #{riskLevelId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - alarmPoint_id = #{alarmpointId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_AlarmPoint_RiskLevel ${where} - - diff --git a/src/com/sipai/mapper/alarm/AlarmRecordMapper.xml b/src/com/sipai/mapper/alarm/AlarmRecordMapper.xml deleted file mode 100644 index 7cac3938..00000000 --- a/src/com/sipai/mapper/alarm/AlarmRecordMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, insdt, alarmTypeId, state - - - - - delete from tb_alarm_record - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_alarm_record - ${where} - - - insert into tb_alarm_record (id, insdt, alarmTypeId, - state) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{alarmtypeid,jdbcType=VARCHAR}, - #{state,jdbcType=VARCHAR}) - - - insert into tb_alarm_record - - - id, - - - insdt, - - - alarmTypeId, - - - state, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{alarmtypeid,jdbcType=VARCHAR}, - - - #{state,jdbcType=VARCHAR}, - - - - - update tb_alarm_record - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - alarmTypeId = #{alarmtypeid,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_record - set insdt = #{insdt,jdbcType=TIMESTAMP}, - alarmTypeId = #{alarmtypeid,jdbcType=VARCHAR}, - state = #{state,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmSolutionMapper.xml b/src/com/sipai/mapper/alarm/AlarmSolutionMapper.xml deleted file mode 100644 index 64d26389..00000000 --- a/src/com/sipai/mapper/alarm/AlarmSolutionMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - id, alarmTypeId, insdt, insuser, solution, result, isIssueOrder, orderType, orderDescribe, - deptIds - - - - - delete from tb_alarm_solution - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_alarm_solution - ${where} - - - insert into tb_alarm_solution (id, alarmTypeId, insdt, - insuser, solution, result, - isIssueOrder, orderType, orderDescribe, - deptIds) - values (#{id,jdbcType=VARCHAR}, #{alarmtypeid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{solution,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, - #{isissueorder,jdbcType=BIT}, #{ordertype,jdbcType=VARCHAR}, #{orderdescribe,jdbcType=VARCHAR}, - #{deptids,jdbcType=VARCHAR}) - - - insert into tb_alarm_solution - - - id, - - - alarmTypeId, - - - insdt, - - - insuser, - - - solution, - - - result, - - - isIssueOrder, - - - orderType, - - - orderDescribe, - - - deptIds, - - - - - #{id,jdbcType=VARCHAR}, - - - #{alarmtypeid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{solution,jdbcType=VARCHAR}, - - - #{result,jdbcType=VARCHAR}, - - - #{isissueorder,jdbcType=BIT}, - - - #{ordertype,jdbcType=VARCHAR}, - - - #{orderdescribe,jdbcType=VARCHAR}, - - - #{deptids,jdbcType=VARCHAR}, - - - - - update tb_alarm_solution - - - alarmTypeId = #{alarmtypeid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - solution = #{solution,jdbcType=VARCHAR}, - - - result = #{result,jdbcType=VARCHAR}, - - - isIssueOrder = #{isissueorder,jdbcType=BIT}, - - - orderType = #{ordertype,jdbcType=VARCHAR}, - - - orderDescribe = #{orderdescribe,jdbcType=VARCHAR}, - - - deptIds = #{deptids,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_solution - set alarmTypeId = #{alarmtypeid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - solution = #{solution,jdbcType=VARCHAR}, - result = #{result,jdbcType=VARCHAR}, - isIssueOrder = #{isissueorder,jdbcType=BIT}, - orderType = #{ordertype,jdbcType=VARCHAR}, - orderDescribe = #{orderdescribe,jdbcType=VARCHAR}, - deptIds = #{deptids,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmSubscribeMapper.xml b/src/com/sipai/mapper/alarm/AlarmSubscribeMapper.xml deleted file mode 100644 index fcc9e39d..00000000 --- a/src/com/sipai/mapper/alarm/AlarmSubscribeMapper.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - id, unit_id, alarm_point_id, userid - - - - delete from tb_alarm_subscribe - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_alarm_subscribe (id, unit_id, alarm_point_id, - userid) - values (#{id,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{alarmPointId,jdbcType=VARCHAR}, - #{userid,jdbcType=VARCHAR}) - - - insert into tb_alarm_subscribe - - - id, - - - unit_id, - - - alarm_point_id, - - - userid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{alarmPointId,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - - - update tb_alarm_subscribe - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - alarm_point_id = #{alarmPointId,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarm_subscribe - set unit_id = #{unitId,jdbcType=VARCHAR}, - alarm_point_id = #{alarmPointId,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_alarm_subscribe - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/AlarmTypeMapper.xml b/src/com/sipai/mapper/alarm/AlarmTypeMapper.xml deleted file mode 100644 index b3fdd21b..00000000 --- a/src/com/sipai/mapper/alarm/AlarmTypeMapper.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, type, pid, insdt, insuser,describe,noticeType,no,operaterId,state,autoIssue,unitid - - - - - delete from tb_alarmType - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_alarmType - ${where} - - - insert into tb_alarmType (id, type, pid, - insdt, insuser,describe,noticeType,no,operaterId,state,autoIssue,unitid) - values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{describe,jdbcType=VARCHAR},#{noticeType,jdbcType=VARCHAR}, - #{no,jdbcType=VARCHAR},#{operaterId,jdbcType=VARCHAR}, - #{state,jdbcType=BIT},#{autoIssue,jdbcType=BIT},#{unitid,jdbcType=VARCHAR}) - - - insert into tb_alarmType - - - id, - - - type, - - - pid, - - - insdt, - - - insuser, - - - describe, - - - noticeType, - - - no, - - - operaterId, - - - state, - - - autoIssue, - - - unitid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{noticeType,jdbcType=VARCHAR}, - - - #{no,jdbcType=VARCHAR}, - - - #{operaterId,jdbcType=VARCHAR}, - - - #{state,jdbcType=BIT}, - - - #{autoIssue,jdbcType=BIT}, - - - #{unitid,jdbcType=VARCHAR}, - - - - - update tb_alarmType - - - type = #{type,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - noticeType = #{noticeType,jdbcType=VARCHAR}, - - - no = #{no,jdbcType=VARCHAR}, - - - operaterId = #{operaterId,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=BIT}, - - - autoIssue = #{autoIssue,jdbcType=BIT}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_alarmType - set type = #{type,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - noticeType = #{noticeType,jdbcType=VARCHAR}, - no = #{no,jdbcType=VARCHAR}, - operaterId = #{operaterId,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - state = #{state,jdbcType=BIT}, - autoIssue = #{autoIssue,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/alarm/RiskPMapper.xml b/src/com/sipai/mapper/alarm/RiskPMapper.xml deleted file mode 100644 index 0acf572d..00000000 --- a/src/com/sipai/mapper/alarm/RiskPMapper.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - id, p_id, r_id, place - - - - delete from tb_risk_p - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_risk_p (id, p_id, r_id, place) - values (#{id,jdbcType=VARCHAR}, #{pId,jdbcType=VARCHAR}, #{rId,jdbcType=VARCHAR}, #{place,jdbcType=VARCHAR}) - - - insert into tb_risk_p - - - id, - - - p_id, - - - r_id, - - - place, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pId,jdbcType=VARCHAR}, - - - #{rId,jdbcType=VARCHAR}, - - - #{place,jdbcType=VARCHAR}, - - - - - update tb_risk_p - - - p_id = #{pId,jdbcType=VARCHAR}, - - - r_id = #{rId,jdbcType=VARCHAR}, - - - place = #{place,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_risk_p - set p_id = #{pId,jdbcType=VARCHAR}, - r_id = #{rId,jdbcType=VARCHAR}, - place = #{place,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - diff --git a/src/com/sipai/mapper/app/AppDataConfigureMapper.xml b/src/com/sipai/mapper/app/AppDataConfigureMapper.xml deleted file mode 100644 index 4f6baefe..00000000 --- a/src/com/sipai/mapper/app/AppDataConfigureMapper.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - id, dataName, showName, unitId, type, datatype, morder - - - - delete from tb_appData_configure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_appData_configure (id, dataName, showName, - unitId, type, datatype, - morder) - values (#{id,jdbcType=VARCHAR}, #{dataname,jdbcType=VARCHAR}, #{showname,jdbcType=VARCHAR}, - #{unitid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{datatype,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_appData_configure - - - id, - - - dataName, - - - showName, - - - unitId, - - - type, - - - datatype, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataname,jdbcType=VARCHAR}, - - - #{showname,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{datatype,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_appData_configure - - - dataName = #{dataname,jdbcType=VARCHAR}, - - - showName = #{showname,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - datatype = #{datatype,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_appData_configure - set dataName = #{dataname,jdbcType=VARCHAR}, - showName = #{showname,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - datatype = #{datatype,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_appData_configure - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/app/AppHomePageDataMapper.xml b/src/com/sipai/mapper/app/AppHomePageDataMapper.xml deleted file mode 100644 index 1b91692b..00000000 --- a/src/com/sipai/mapper/app/AppHomePageDataMapper.xml +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, todayYearWater, onlineWater, waterQuantity, waterRate, mudVolume, mudRate, totalEqNum, - usingEqNum, AEq, BEq, CEq, EqRate, OverhaulRate, MaintainRate, abnormalNum, abnormalAddNum, - workingAbnormalNum, eqAbnormalNum, insdt - - - - delete from tb_app_homePageData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_app_homePageData (id, todayYearWater, onlineWater, - waterQuantity, waterRate, mudVolume, - mudRate, totalEqNum, usingEqNum, - AEq, BEq, CEq, EqRate, - OverhaulRate, MaintainRate, abnormalNum, - abnormalAddNum, workingAbnormalNum, eqAbnormalNum, - insdt) - values (#{id,jdbcType=VARCHAR}, #{todayyearwater,jdbcType=DOUBLE}, #{onlinewater,jdbcType=DOUBLE}, - #{waterquantity,jdbcType=DOUBLE}, #{waterrate,jdbcType=DOUBLE}, #{mudvolume,jdbcType=DOUBLE}, - #{mudrate,jdbcType=DOUBLE}, #{totaleqnum,jdbcType=INTEGER}, #{usingeqnum,jdbcType=INTEGER}, - #{aeq,jdbcType=INTEGER}, #{beq,jdbcType=INTEGER}, #{ceq,jdbcType=INTEGER}, #{eqrate,jdbcType=DOUBLE}, - #{overhaulrate,jdbcType=DOUBLE}, #{maintainrate,jdbcType=DOUBLE}, #{abnormalnum,jdbcType=INTEGER}, - #{abnormaladdnum,jdbcType=INTEGER}, #{workingabnormalnum,jdbcType=INTEGER}, #{eqabnormalnum,jdbcType=INTEGER}, - #{insdt,jdbcType=TIMESTAMP}) - - - insert into tb_app_homePageData - - - id, - - - todayYearWater, - - - onlineWater, - - - waterQuantity, - - - waterRate, - - - mudVolume, - - - mudRate, - - - totalEqNum, - - - usingEqNum, - - - AEq, - - - BEq, - - - CEq, - - - EqRate, - - - OverhaulRate, - - - MaintainRate, - - - abnormalNum, - - - abnormalAddNum, - - - workingAbnormalNum, - - - eqAbnormalNum, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{todayyearwater,jdbcType=DOUBLE}, - - - #{onlinewater,jdbcType=DOUBLE}, - - - #{waterquantity,jdbcType=DOUBLE}, - - - #{waterrate,jdbcType=DOUBLE}, - - - #{mudvolume,jdbcType=DOUBLE}, - - - #{mudrate,jdbcType=DOUBLE}, - - - #{totaleqnum,jdbcType=INTEGER}, - - - #{usingeqnum,jdbcType=INTEGER}, - - - #{aeq,jdbcType=INTEGER}, - - - #{beq,jdbcType=INTEGER}, - - - #{ceq,jdbcType=INTEGER}, - - - #{eqrate,jdbcType=DOUBLE}, - - - #{overhaulrate,jdbcType=DOUBLE}, - - - #{maintainrate,jdbcType=DOUBLE}, - - - #{abnormalnum,jdbcType=INTEGER}, - - - #{abnormaladdnum,jdbcType=INTEGER}, - - - #{workingabnormalnum,jdbcType=INTEGER}, - - - #{eqabnormalnum,jdbcType=INTEGER}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update tb_app_homePageData - - - todayYearWater = #{todayyearwater,jdbcType=DOUBLE}, - - - onlineWater = #{onlinewater,jdbcType=DOUBLE}, - - - waterQuantity = #{waterquantity,jdbcType=DOUBLE}, - - - waterRate = #{waterrate,jdbcType=DOUBLE}, - - - mudVolume = #{mudvolume,jdbcType=DOUBLE}, - - - mudRate = #{mudrate,jdbcType=DOUBLE}, - - - totalEqNum = #{totaleqnum,jdbcType=INTEGER}, - - - usingEqNum = #{usingeqnum,jdbcType=INTEGER}, - - - AEq = #{aeq,jdbcType=INTEGER}, - - - BEq = #{beq,jdbcType=INTEGER}, - - - CEq = #{ceq,jdbcType=INTEGER}, - - - EqRate = #{eqrate,jdbcType=DOUBLE}, - - - OverhaulRate = #{overhaulrate,jdbcType=DOUBLE}, - - - MaintainRate = #{maintainrate,jdbcType=DOUBLE}, - - - abnormalNum = #{abnormalnum,jdbcType=INTEGER}, - - - abnormalAddNum = #{abnormaladdnum,jdbcType=INTEGER}, - - - workingAbnormalNum = #{workingabnormalnum,jdbcType=INTEGER}, - - - eqAbnormalNum = #{eqabnormalnum,jdbcType=INTEGER}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_app_homePageData - set todayYearWater = #{todayyearwater,jdbcType=DOUBLE}, - onlineWater = #{onlinewater,jdbcType=DOUBLE}, - waterQuantity = #{waterquantity,jdbcType=DOUBLE}, - waterRate = #{waterrate,jdbcType=DOUBLE}, - mudVolume = #{mudvolume,jdbcType=DOUBLE}, - mudRate = #{mudrate,jdbcType=DOUBLE}, - totalEqNum = #{totaleqnum,jdbcType=INTEGER}, - usingEqNum = #{usingeqnum,jdbcType=INTEGER}, - AEq = #{aeq,jdbcType=INTEGER}, - BEq = #{beq,jdbcType=INTEGER}, - CEq = #{ceq,jdbcType=INTEGER}, - EqRate = #{eqrate,jdbcType=DOUBLE}, - OverhaulRate = #{overhaulrate,jdbcType=DOUBLE}, - MaintainRate = #{maintainrate,jdbcType=DOUBLE}, - abnormalNum = #{abnormalnum,jdbcType=INTEGER}, - abnormalAddNum = #{abnormaladdnum,jdbcType=INTEGER}, - workingAbnormalNum = #{workingabnormalnum,jdbcType=INTEGER}, - eqAbnormalNum = #{eqabnormalnum,jdbcType=INTEGER}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_app_homePageData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/app/AppMenuitemMapper.xml b/src/com/sipai/mapper/app/AppMenuitemMapper.xml deleted file mode 100644 index 59a3df32..00000000 --- a/src/com/sipai/mapper/app/AppMenuitemMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id - , pid, name, description, location, morder, active, type - - - - delete - from tb_app_menuitem - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_app_menuitem (id, pid, name, - description, location, morder, - active, type) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{description,jdbcType=VARCHAR}, #{location,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) - - - insert into tb_app_menuitem - - - id, - - - pid, - - - name, - - - description, - - - location, - - - morder, - - - active, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{location,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_app_menuitem - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - location = #{location,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_app_menuitem - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - location = #{location,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_app_menuitem ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/app/AppProductMonitorMapper.xml b/src/com/sipai/mapper/app/AppProductMonitorMapper.xml deleted file mode 100644 index 01983d53..00000000 --- a/src/com/sipai/mapper/app/AppProductMonitorMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, run_mpid, fault_mpid, current_mpid, memo, morder, type, insdt, insuser, - unit_id, sname - - - - delete from tb_app_productMonitor - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_app_productMonitor (id, name, run_mpid, - fault_mpid, current_mpid, memo, - morder, type, insdt, - insuser, unit_id, sname - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{runMpid,jdbcType=VARCHAR}, - #{faultMpid,jdbcType=VARCHAR}, #{currentMpid,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{sname,jdbcType=VARCHAR} - ) - - - insert into tb_app_productMonitor - - - id, - - - name, - - - run_mpid, - - - fault_mpid, - - - current_mpid, - - - memo, - - - morder, - - - type, - - - insdt, - - - insuser, - - - unit_id, - - - sname, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{runMpid,jdbcType=VARCHAR}, - - - #{faultMpid,jdbcType=VARCHAR}, - - - #{currentMpid,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{sname,jdbcType=VARCHAR}, - - - - - update tb_app_productMonitor - - - name = #{name,jdbcType=VARCHAR}, - - - run_mpid = #{runMpid,jdbcType=VARCHAR}, - - - fault_mpid = #{faultMpid,jdbcType=VARCHAR}, - - - current_mpid = #{currentMpid,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_app_productMonitor - set name = #{name,jdbcType=VARCHAR}, - run_mpid = #{runMpid,jdbcType=VARCHAR}, - fault_mpid = #{faultMpid,jdbcType=VARCHAR}, - current_mpid = #{currentMpid,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - sname = #{sname,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_app_productMonitor - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/app/AppProductMonitorMpMapper.xml b/src/com/sipai/mapper/app/AppProductMonitorMpMapper.xml deleted file mode 100644 index 81429898..00000000 --- a/src/com/sipai/mapper/app/AppProductMonitorMpMapper.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, pid, mpid, posx, posy, insdt, insuser, owner_id, txt, fsize, accuracy, morder, - unit_id - - - - delete from tb_app_productMonitorMp - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_app_productMonitorMp (id, pid, mpid, - posx, posy, insdt, - insuser, owner_id, txt, - fsize, accuracy, morder, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{posx,jdbcType=VARCHAR}, #{posy,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{ownerId,jdbcType=VARCHAR}, #{txt,jdbcType=VARCHAR}, - #{fsize,jdbcType=VARCHAR}, #{accuracy,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_app_productMonitorMp - - - id, - - - pid, - - - mpid, - - - posx, - - - posy, - - - insdt, - - - insuser, - - - owner_id, - - - txt, - - - fsize, - - - accuracy, - - - morder, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{posx,jdbcType=VARCHAR}, - - - #{posy,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{ownerId,jdbcType=VARCHAR}, - - - #{txt,jdbcType=VARCHAR}, - - - #{fsize,jdbcType=VARCHAR}, - - - #{accuracy,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_app_productMonitorMp - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=VARCHAR}, - - - posy = #{posy,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - owner_id = #{ownerId,jdbcType=VARCHAR}, - - - txt = #{txt,jdbcType=VARCHAR}, - - - fsize = #{fsize,jdbcType=VARCHAR}, - - - accuracy = #{accuracy,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_app_productMonitorMp - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=VARCHAR}, - posy = #{posy,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - owner_id = #{ownerId,jdbcType=VARCHAR}, - txt = #{txt,jdbcType=VARCHAR}, - fsize = #{fsize,jdbcType=VARCHAR}, - accuracy = #{accuracy,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_app_productMonitorMp - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/app/AppRoleMenuMapper.xml b/src/com/sipai/mapper/app/AppRoleMenuMapper.xml deleted file mode 100644 index 963fc70f..00000000 --- a/src/com/sipai/mapper/app/AppRoleMenuMapper.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - insert into tb_app_role_menu (roleID, menuID) - values (#{roleid,jdbcType=VARCHAR}, #{menuid,jdbcType=VARCHAR}) - - - insert into tb_app_role_menu - - - roleID, - - - menuID, - - - - - #{roleid,jdbcType=VARCHAR}, - - - #{menuid,jdbcType=VARCHAR}, - - - - - - - - delete - from tb_app_role_menu - where roleID = #{roleid,jdbcType=VARCHAR} - - - delete - from tb_app_role_menu ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/BasicComponentsMapper.xml b/src/com/sipai/mapper/base/BasicComponentsMapper.xml deleted file mode 100644 index 85c52e08..00000000 --- a/src/com/sipai/mapper/base/BasicComponentsMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, morder, active, remark, code - - - - delete from tb_basic_components - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_basic_components (id, name, pid, - insdt, insuser, morder, - active, remark, code - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR} - ) - - - insert into tb_basic_components - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - morder, - - - active, - - - remark, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_basic_components - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_basic_components - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_basic_components - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/BasicConfigureMapper.xml b/src/com/sipai/mapper/base/BasicConfigureMapper.xml deleted file mode 100644 index 26bb9e85..00000000 --- a/src/com/sipai/mapper/base/BasicConfigureMapper.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, version, morder, active, remark, type, url, abspath - - - - delete from tb_basic_configure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_basic_configure (id, name, pid, - insdt, insuser, version, - morder, active, remark, - type, url, abspath) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{active,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}) - - - insert into tb_basic_configure - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - active, - - - remark, - - - type, - - - url, - - - abspath, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - - - update tb_basic_configure - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_basic_configure - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_basic_configure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/BasicHomePageMapper.xml b/src/com/sipai/mapper/base/BasicHomePageMapper.xml deleted file mode 100644 index 2ae9a873..00000000 --- a/src/com/sipai/mapper/base/BasicHomePageMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id - , userid, unitId, type, active, url, rolePeople, unRolePeople - - - - delete - from tb_basic_homePage - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_basic_homePage (id, userid, unitId, - type, active, url, - rolePeople, unRolePeople) - values (#{id,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{rolepeople,jdbcType=VARCHAR}, #{unrolepeople,jdbcType=VARCHAR}) - - - insert into tb_basic_homePage - - - id, - - - userid, - - - unitId, - - - type, - - - active, - - - url, - - - rolePeople, - - - unRolePeople, - - - - - #{id,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{rolepeople,jdbcType=VARCHAR}, - - - #{unrolepeople,jdbcType=VARCHAR}, - - - - - update tb_basic_homePage - - - userid = #{userid,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - rolePeople = #{rolepeople,jdbcType=VARCHAR}, - - - unRolePeople = #{unrolepeople,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_basic_homePage - set userid = #{userid,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - rolePeople = #{rolepeople,jdbcType=VARCHAR}, - unRolePeople = #{unrolepeople,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_basic_homePage ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/CommonFileMapper.xml b/src/com/sipai/mapper/base/CommonFileMapper.xml deleted file mode 100644 index 3f26717b..00000000 --- a/src/com/sipai/mapper/base/CommonFileMapper.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - id - , masterid, filename, abspath, size, insuser, insdt, type - - - - delete - from tb_common_file - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_common_file - where masterid = #{masterid,jdbcType=VARCHAR} - - - - insert into tb_common_file (id, masterid, filename, - abspath, size, insuser, - insdt, type) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{size,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}) - - - insert into tb_common_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - size, - - - insuser, - - - insdt, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{size,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_common_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_common_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - size = #{size,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete - from ${table} ${where} - - - insert into ${table} (id, masterid, filename, - abspath, size, insuser, - insdt, type) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{size,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}) - - - - insert into ${table} (id, masterid, filename, - abspath, size, insuser, - insdt, type, pointId) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{size,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{pointId,jdbcType=VARCHAR}) - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/MainConfigMapper.xml b/src/com/sipai/mapper/base/MainConfigMapper.xml deleted file mode 100644 index d33e0c98..00000000 --- a/src/com/sipai/mapper/base/MainConfigMapper.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - id - , memo, mpoint_id, type, fun_name, div_id, test_id, morder, unit_id - - - - delete - from tb_main_config - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_main_config (id, memo, mpoint_id, - type, fun_name, div_id, - test_id, morder,unit_id) - values (#{id,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{mpointId,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{funName,jdbcType=VARCHAR}, #{divId,jdbcType=VARCHAR}, - #{testId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_main_config - - - id, - - - memo, - - - mpoint_id, - - - type, - - - fun_name, - - - div_id, - - - test_id, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{funName,jdbcType=VARCHAR}, - - - #{divId,jdbcType=VARCHAR}, - - - #{testId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_main_config - - - memo = #{memo,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - fun_name = #{funName,jdbcType=VARCHAR}, - - - div_id = #{divId,jdbcType=VARCHAR}, - - - test_id = #{testId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_main_config - set memo = #{memo,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - fun_name = #{funName,jdbcType=VARCHAR}, - div_id = #{divId,jdbcType=VARCHAR}, - test_id = #{testId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_main_config ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/MainPageMapper.xml b/src/com/sipai/mapper/base/MainPageMapper.xml deleted file mode 100644 index 9cfe188f..00000000 --- a/src/com/sipai/mapper/base/MainPageMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, mpoint_id, type, show_way, morder - - - - - delete from tb_mainpage - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_mainpage (id, insdt, insuser, - biz_id, mpoint_id, type, - show_way, morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{mpointId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{showWay,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_mainpage - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - mpoint_id, - - - type, - - - show_way, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{showWay,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_mainpage - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - show_way = #{showWay,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_mainpage - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - show_way = #{showWay,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_mainpage - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/MainPageTypeMapper.xml b/src/com/sipai/mapper/base/MainPageTypeMapper.xml deleted file mode 100644 index e452f652..00000000 --- a/src/com/sipai/mapper/base/MainPageTypeMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, title, morder, height, classlg, active, style - - - - delete from tb_mainpage_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_mainpage_type (id, insdt, insuser, - biz_id, title, morder, - height, classlg, active, - style) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{height,jdbcType=INTEGER}, #{classlg,jdbcType=INTEGER}, #{active,jdbcType=BIT}, - #{style,jdbcType=VARCHAR}) - - - insert into tb_mainpage_type - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - title, - - - morder, - - - height, - - - classlg, - - - active, - - - style, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{title,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{height,jdbcType=INTEGER}, - - - #{classlg,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{style,jdbcType=VARCHAR}, - - - - - update tb_mainpage_type - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - title = #{title,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - height = #{height,jdbcType=INTEGER}, - - - classlg = #{classlg,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - style = #{style,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_mainpage_type - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - title = #{title,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - height = #{height,jdbcType=INTEGER}, - classlg = #{classlg,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - style = #{style,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_mainpage_type - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/base/MainPageTypeUserMapper.xml b/src/com/sipai/mapper/base/MainPageTypeUserMapper.xml deleted file mode 100644 index 0980c6a5..00000000 --- a/src/com/sipai/mapper/base/MainPageTypeUserMapper.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, type, morder, active - - - - delete from tb_mainpage_type_user - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_mainpage_type_user (id, insuser, insdt, - type, morder, active) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=BIT}) - - - insert into tb_mainpage_type_user - - - id, - - - insuser, - - - insdt, - - - type, - - - morder, - - - active, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - - - update tb_mainpage_type_user - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_mainpage_type_user - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_mainpage_type_user - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/BIMAlarmThresholdMapper.xml b/src/com/sipai/mapper/bim/BIMAlarmThresholdMapper.xml deleted file mode 100644 index 605b356e..00000000 --- a/src/com/sipai/mapper/bim/BIMAlarmThresholdMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, st, ct, place_id, place_name, tag_name, foreshow_max_val, foreshow_min_val, max_val, - min_val, pk_id - - - - delete from tb_BIM_alarm_threshold - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_BIM_alarm_threshold (id, st, ct, - place_id, place_name, tag_name, - foreshow_max_val, foreshow_min_val, max_val, - min_val, pk_id) - values (#{id,jdbcType=VARCHAR}, #{st,jdbcType=TIMESTAMP}, #{ct,jdbcType=TIMESTAMP}, - #{placeId,jdbcType=VARCHAR}, #{placeName,jdbcType=VARCHAR}, #{tagName,jdbcType=VARCHAR}, - #{foreshowMaxVal,jdbcType=DECIMAL}, #{foreshowMinVal,jdbcType=DECIMAL}, #{maxVal,jdbcType=DECIMAL}, - #{minVal,jdbcType=DECIMAL}, #{pkId,jdbcType=VARCHAR}) - - - insert into tb_BIM_alarm_threshold - - - id, - - - st, - - - ct, - - - place_id, - - - place_name, - - - tag_name, - - - foreshow_max_val, - - - foreshow_min_val, - - - max_val, - - - min_val, - - - pk_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{st,jdbcType=TIMESTAMP}, - - - #{ct,jdbcType=TIMESTAMP}, - - - #{placeId,jdbcType=VARCHAR}, - - - #{placeName,jdbcType=VARCHAR}, - - - #{tagName,jdbcType=VARCHAR}, - - - #{foreshowMaxVal,jdbcType=DECIMAL}, - - - #{foreshowMinVal,jdbcType=DECIMAL}, - - - #{maxVal,jdbcType=DECIMAL}, - - - #{minVal,jdbcType=DECIMAL}, - - - #{pkId,jdbcType=VARCHAR}, - - - - - update tb_BIM_alarm_threshold - - - st = #{st,jdbcType=TIMESTAMP}, - - - ct = #{ct,jdbcType=TIMESTAMP}, - - - place_id = #{placeId,jdbcType=VARCHAR}, - - - place_name = #{placeName,jdbcType=VARCHAR}, - - - tag_name = #{tagName,jdbcType=VARCHAR}, - - - foreshow_max_val = #{foreshowMaxVal,jdbcType=DECIMAL}, - - - foreshow_min_val = #{foreshowMinVal,jdbcType=DECIMAL}, - - - max_val = #{maxVal,jdbcType=DECIMAL}, - - - min_val = #{minVal,jdbcType=DECIMAL}, - - - pk_id = #{pkId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_BIM_alarm_threshold - set st = #{st,jdbcType=TIMESTAMP}, - ct = #{ct,jdbcType=TIMESTAMP}, - place_id = #{placeId,jdbcType=VARCHAR}, - place_name = #{placeName,jdbcType=VARCHAR}, - tag_name = #{tagName,jdbcType=VARCHAR}, - foreshow_max_val = #{foreshowMaxVal,jdbcType=DECIMAL}, - foreshow_min_val = #{foreshowMinVal,jdbcType=DECIMAL}, - max_val = #{maxVal,jdbcType=DECIMAL}, - min_val = #{minVal,jdbcType=DECIMAL}, - pk_id = #{pkId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_BIM_alarm_threshold - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/BIMCDHomePageTreeMapper.xml b/src/com/sipai/mapper/bim/BIMCDHomePageTreeMapper.xml deleted file mode 100644 index e65edaa5..00000000 --- a/src/com/sipai/mapper/bim/BIMCDHomePageTreeMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, pid, name, type, morder - - - - delete from tb_BIM_CD_homePage_tree - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_BIM_CD_homePage_tree (id, pid, name, - type, morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_BIM_CD_homePage_tree - - - id, - - - pid, - - - name, - - - type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_BIM_CD_homePage_tree - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_BIM_CD_homePage_tree - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_BIM_CD_homePage_tree - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/BIMCameraMapper.xml b/src/com/sipai/mapper/bim/BIMCameraMapper.xml deleted file mode 100644 index 155c1d82..00000000 --- a/src/com/sipai/mapper/bim/BIMCameraMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, st, ct, name, device_pass, lon, lat, interfaces - - - - delete from tb_BIM_camera - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_BIM_camera (id, st, ct, - name, device_pass, lon, - lat, interfaces) - values (#{id,jdbcType=VARCHAR}, #{st,jdbcType=TIMESTAMP}, #{ct,jdbcType=TIMESTAMP}, - #{name,jdbcType=VARCHAR}, #{devicePass,jdbcType=VARCHAR}, #{lon,jdbcType=VARCHAR}, - #{lat,jdbcType=VARCHAR}, #{interfaces,jdbcType=VARCHAR}) - - - insert into tb_BIM_camera - - - id, - - - st, - - - ct, - - - name, - - - device_pass, - - - lon, - - - lat, - - - interfaces, - - - - - #{id,jdbcType=VARCHAR}, - - - #{st,jdbcType=TIMESTAMP}, - - - #{ct,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{devicePass,jdbcType=VARCHAR}, - - - #{lon,jdbcType=VARCHAR}, - - - #{lat,jdbcType=VARCHAR}, - - - #{interfaces,jdbcType=VARCHAR}, - - - - - update tb_BIM_camera - - - st = #{st,jdbcType=TIMESTAMP}, - - - ct = #{ct,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - device_pass = #{devicePass,jdbcType=VARCHAR}, - - - lon = #{lon,jdbcType=VARCHAR}, - - - lat = #{lat,jdbcType=VARCHAR}, - - - interfaces = #{interfaces,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_BIM_camera - set st = #{st,jdbcType=TIMESTAMP}, - ct = #{ct,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - device_pass = #{devicePass,jdbcType=VARCHAR}, - lon = #{lon,jdbcType=VARCHAR}, - lat = #{lat,jdbcType=VARCHAR}, - interfaces = #{interfaces,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_BIM_camera - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/BIMCurrencyMapper.xml b/src/com/sipai/mapper/bim/BIMCurrencyMapper.xml deleted file mode 100644 index 1d105ef8..00000000 --- a/src/com/sipai/mapper/bim/BIMCurrencyMapper.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, st, ct, value, name, location_id, location_details, lon, lat, tag_id, tag_name, - mpoint_code, server_id - - - - delete from tb_BIM_currency - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_BIM_currency (id, st, ct, - value, name, location_id, - location_details, lon, lat, - tag_id, tag_name, mpoint_code, - server_id) - values (#{id,jdbcType=VARCHAR}, #{st,jdbcType=TIMESTAMP}, #{ct,jdbcType=TIMESTAMP}, - #{value,jdbcType=DECIMAL}, #{name,jdbcType=VARCHAR}, #{locationId,jdbcType=VARCHAR}, - #{locationDetails,jdbcType=VARCHAR}, #{lon,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, - #{tagId,jdbcType=VARCHAR}, #{tagName,jdbcType=VARCHAR}, #{mpointCode,jdbcType=VARCHAR}, - #{serverId,jdbcType=VARCHAR}) - - - insert into tb_BIM_currency - - - id, - - - st, - - - ct, - - - value, - - - name, - - - location_id, - - - location_details, - - - lon, - - - lat, - - - tag_id, - - - tag_name, - - - mpoint_code, - - - server_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{st,jdbcType=TIMESTAMP}, - - - #{ct,jdbcType=TIMESTAMP}, - - - #{value,jdbcType=DECIMAL}, - - - #{name,jdbcType=VARCHAR}, - - - #{locationId,jdbcType=VARCHAR}, - - - #{locationDetails,jdbcType=VARCHAR}, - - - #{lon,jdbcType=VARCHAR}, - - - #{lat,jdbcType=VARCHAR}, - - - #{tagId,jdbcType=VARCHAR}, - - - #{tagName,jdbcType=VARCHAR}, - - - #{mpointCode,jdbcType=VARCHAR}, - - - #{serverId,jdbcType=VARCHAR}, - - - - - update tb_BIM_currency - - - st = #{st,jdbcType=TIMESTAMP}, - - - ct = #{ct,jdbcType=TIMESTAMP}, - - - value = #{value,jdbcType=DECIMAL}, - - - name = #{name,jdbcType=VARCHAR}, - - - location_id = #{locationId,jdbcType=VARCHAR}, - - - location_details = #{locationDetails,jdbcType=VARCHAR}, - - - lon = #{lon,jdbcType=VARCHAR}, - - - lat = #{lat,jdbcType=VARCHAR}, - - - tag_id = #{tagId,jdbcType=VARCHAR}, - - - tag_name = #{tagName,jdbcType=VARCHAR}, - - - mpoint_code = #{mpointCode,jdbcType=VARCHAR}, - - - server_id = #{serverId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_BIM_currency - set st = #{st,jdbcType=TIMESTAMP}, - ct = #{ct,jdbcType=TIMESTAMP}, - value = #{value,jdbcType=DECIMAL}, - name = #{name,jdbcType=VARCHAR}, - location_id = #{locationId,jdbcType=VARCHAR}, - location_details = #{locationDetails,jdbcType=VARCHAR}, - lon = #{lon,jdbcType=VARCHAR}, - lat = #{lat,jdbcType=VARCHAR}, - tag_id = #{tagId,jdbcType=VARCHAR}, - tag_name = #{tagName,jdbcType=VARCHAR}, - mpoint_code = #{mpointCode,jdbcType=VARCHAR}, - server_id = #{serverId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_BIM_currency - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/BimRouteDataMapper.xml b/src/com/sipai/mapper/bim/BimRouteDataMapper.xml deleted file mode 100644 index 3b704328..00000000 --- a/src/com/sipai/mapper/bim/BimRouteDataMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, eqName, mpid, mpname, alarmContent, alarmValue, code, unitId, type - - - - delete from tb_bimRoute_data - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_bimRoute_data (id, name, eqName, - mpid, mpname, alarmContent, - alarmValue, code, unitId, - type) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{eqname,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, #{alarmcontent,jdbcType=VARCHAR}, - #{alarmvalue,jdbcType=DOUBLE}, #{code,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_bimRoute_data - - - id, - - - name, - - - eqName, - - - mpid, - - - mpname, - - - alarmContent, - - - alarmValue, - - - code, - - - unitId, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{eqname,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{alarmcontent,jdbcType=VARCHAR}, - - - #{alarmvalue,jdbcType=DOUBLE}, - - - #{code,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_bimRoute_data - - - name = #{name,jdbcType=VARCHAR}, - - - eqName = #{eqname,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - alarmContent = #{alarmcontent,jdbcType=VARCHAR}, - - - alarmValue = #{alarmvalue,jdbcType=DOUBLE}, - - - code = #{code,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_bimRoute_data - set name = #{name,jdbcType=VARCHAR}, - eqName = #{eqname,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - alarmContent = #{alarmcontent,jdbcType=VARCHAR}, - alarmValue = #{alarmvalue,jdbcType=DOUBLE}, - code = #{code,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_bimRoute_data - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/BimRouteEqDataMapper.xml b/src/com/sipai/mapper/bim/BimRouteEqDataMapper.xml deleted file mode 100644 index c1b2198d..00000000 --- a/src/com/sipai/mapper/bim/BimRouteEqDataMapper.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - id - , eq_num, point_num, abnormal_point_num, abnormal_eq_num, normal_eq_num, unitId, - code - - - - delete - from tb_bimRoute_eqdata - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_bimRoute_eqdata (id, eq_num, point_num, - abnormal_point_num, abnormal_eq_num, normal_eq_num, - unitId, code) - values (#{id,jdbcType=VARCHAR}, #{eqNum,jdbcType=INTEGER}, #{pointNum,jdbcType=INTEGER}, - #{abnormalPointNum,jdbcType=INTEGER}, #{abnormalEqNum,jdbcType=INTEGER}, - #{normalEqNum,jdbcType=INTEGER}, - #{unitid,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}) - - - insert into tb_bimRoute_eqdata - - - id, - - - eq_num, - - - point_num, - - - abnormal_point_num, - - - abnormal_eq_num, - - - normal_eq_num, - - - unitId, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{eqNum,jdbcType=INTEGER}, - - - #{pointNum,jdbcType=INTEGER}, - - - #{abnormalPointNum,jdbcType=INTEGER}, - - - #{abnormalEqNum,jdbcType=INTEGER}, - - - #{normalEqNum,jdbcType=INTEGER}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_bimRoute_eqdata - - - eq_num = #{eqNum,jdbcType=INTEGER}, - - - point_num = #{pointNum,jdbcType=INTEGER}, - - - abnormal_point_num = #{abnormalPointNum,jdbcType=INTEGER}, - - - abnormal_eq_num = #{abnormalEqNum,jdbcType=INTEGER}, - - - normal_eq_num = #{normalEqNum,jdbcType=INTEGER}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_bimRoute_eqdata - set eq_num = #{eqNum,jdbcType=INTEGER}, - point_num = #{pointNum,jdbcType=INTEGER}, - abnormal_point_num = #{abnormalPointNum,jdbcType=INTEGER}, - abnormal_eq_num = #{abnormalEqNum,jdbcType=INTEGER}, - normal_eq_num = #{normalEqNum,jdbcType=INTEGER}, - unitId = #{unitid,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_bimRoute_eqdata ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bim/YsAlarmRecordMapper.xml b/src/com/sipai/mapper/bim/YsAlarmRecordMapper.xml deleted file mode 100644 index e79348fc..00000000 --- a/src/com/sipai/mapper/bim/YsAlarmRecordMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, record_id, record_type, record_val, record_val_old, record_time, insdt, status - - - - delete from tb_ys_alarm_record - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_ys_alarm_record (id, record_id, record_type, - record_val, record_val_old, record_time, - insdt, status) - values (#{id,jdbcType=VARCHAR}, #{recordId,jdbcType=VARCHAR}, #{recordType,jdbcType=VARCHAR}, - #{recordVal,jdbcType=VARCHAR}, #{recordValOld,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP}, - #{insdt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}) - - - insert into tb_ys_alarm_record - - - id, - - - record_id, - - - record_type, - - - record_val, - - - record_val_old, - - - record_time, - - - insdt, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{recordId,jdbcType=VARCHAR}, - - - #{recordType,jdbcType=VARCHAR}, - - - #{recordVal,jdbcType=VARCHAR}, - - - #{recordValOld,jdbcType=VARCHAR}, - - - #{recordTime,jdbcType=TIMESTAMP}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - - - update tb_ys_alarm_record - - - record_id = #{recordId,jdbcType=VARCHAR}, - - - record_type = #{recordType,jdbcType=VARCHAR}, - - - record_val = #{recordVal,jdbcType=VARCHAR}, - - - record_val_old = #{recordValOld,jdbcType=VARCHAR}, - - - record_time = #{recordTime,jdbcType=TIMESTAMP}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_ys_alarm_record - set record_id = #{recordId,jdbcType=VARCHAR}, - record_type = #{recordType,jdbcType=VARCHAR}, - record_val = #{recordVal,jdbcType=VARCHAR}, - record_val_old = #{recordValOld,jdbcType=VARCHAR}, - record_time = #{recordTime,jdbcType=TIMESTAMP}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_ys_alarm_record ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/bot/BotMapper.xml b/src/com/sipai/mapper/bot/BotMapper.xml deleted file mode 100644 index 27b36967..00000000 --- a/src/com/sipai/mapper/bot/BotMapper.xml +++ /dev/null @@ -1,471 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, bizid, design_scale, dsnum, emission, influent_index, effluent_index, process, - price, calculation, signdate, franchise_period, type, service_area, service_population, - insuser, insdt, upsuser, upsdt, address, lgtd, lttd, line_map_url, point_map_url, - linetotal, pointnum, click_state, default_load, legal_person_code, outlet_id, outlet_name, - entrance_id, entrance_name, town_num, village_num, pump_num - - - - delete from tb_bot - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_bot (id, bizid, design_scale, - dsnum, emission, influent_index, - effluent_index, process, price, - calculation, signdate, franchise_period, - type, service_area, service_population, - insuser, insdt, upsuser, - upsdt, address, lgtd, - lttd, line_map_url, point_map_url, - linetotal, pointnum, click_state, - default_load, legal_person_code, outlet_id, - outlet_name, entrance_id, entrance_name, - town_num, village_num, pump_num - ) - values (#{id,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{designScale,jdbcType=VARCHAR}, - #{dsnum,jdbcType=BIGINT}, #{emission,jdbcType=VARCHAR}, #{influentIndex,jdbcType=VARCHAR}, - #{effluentIndex,jdbcType=VARCHAR}, #{process,jdbcType=VARCHAR}, #{price,jdbcType=VARCHAR}, - #{calculation,jdbcType=VARCHAR}, #{signdate,jdbcType=VARCHAR}, #{franchisePeriod,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{serviceArea,jdbcType=VARCHAR}, #{servicePopulation,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}, #{address,jdbcType=VARCHAR}, #{lgtd,jdbcType=DECIMAL}, - #{lttd,jdbcType=DECIMAL}, #{lineMapUrl,jdbcType=VARCHAR}, #{pointMapUrl,jdbcType=VARCHAR}, - #{linetotal,jdbcType=NUMERIC}, #{pointnum,jdbcType=NUMERIC}, #{clickState,jdbcType=VARCHAR}, - #{defaultLoad,jdbcType=VARCHAR}, #{legalPersonCode,jdbcType=VARCHAR}, #{outletId,jdbcType=VARCHAR}, - #{outletName,jdbcType=VARCHAR}, #{entranceId,jdbcType=VARCHAR}, #{entranceName,jdbcType=VARCHAR}, - #{townNum,jdbcType=INTEGER}, #{villageNum,jdbcType=INTEGER}, #{pumpNum,jdbcType=INTEGER} - ) - - - insert into tb_bot - - - id, - - - bizid, - - - design_scale, - - - dsnum, - - - emission, - - - influent_index, - - - effluent_index, - - - process, - - - price, - - - calculation, - - - signdate, - - - franchise_period, - - - type, - - - service_area, - - - service_population, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - address, - - - lgtd, - - - lttd, - - - line_map_url, - - - point_map_url, - - - linetotal, - - - pointnum, - - - click_state, - - - default_load, - - - legal_person_code, - - - outlet_id, - - - outlet_name, - - - entrance_id, - - - entrance_name, - - - town_num, - - - village_num, - - - pump_num, - - - - - #{id,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{designScale,jdbcType=VARCHAR}, - - - #{dsnum,jdbcType=BIGINT}, - - - #{emission,jdbcType=VARCHAR}, - - - #{influentIndex,jdbcType=VARCHAR}, - - - #{effluentIndex,jdbcType=VARCHAR}, - - - #{process,jdbcType=VARCHAR}, - - - #{price,jdbcType=VARCHAR}, - - - #{calculation,jdbcType=VARCHAR}, - - - #{signdate,jdbcType=VARCHAR}, - - - #{franchisePeriod,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{serviceArea,jdbcType=VARCHAR}, - - - #{servicePopulation,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{address,jdbcType=VARCHAR}, - - - #{lgtd,jdbcType=DECIMAL}, - - - #{lttd,jdbcType=DECIMAL}, - - - #{lineMapUrl,jdbcType=VARCHAR}, - - - #{pointMapUrl,jdbcType=VARCHAR}, - - - #{linetotal,jdbcType=NUMERIC}, - - - #{pointnum,jdbcType=NUMERIC}, - - - #{clickState,jdbcType=VARCHAR}, - - - #{defaultLoad,jdbcType=VARCHAR}, - - - #{legalPersonCode,jdbcType=VARCHAR}, - - - #{outletId,jdbcType=VARCHAR}, - - - #{outletName,jdbcType=VARCHAR}, - - - #{entranceId,jdbcType=VARCHAR}, - - - #{entranceName,jdbcType=VARCHAR}, - - - #{townNum,jdbcType=INTEGER}, - - - #{villageNum,jdbcType=INTEGER}, - - - #{pumpNum,jdbcType=INTEGER}, - - - - - update tb_bot - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - design_scale = #{designScale,jdbcType=VARCHAR}, - - - dsnum = #{dsnum,jdbcType=BIGINT}, - - - emission = #{emission,jdbcType=VARCHAR}, - - - influent_index = #{influentIndex,jdbcType=VARCHAR}, - - - effluent_index = #{effluentIndex,jdbcType=VARCHAR}, - - - process = #{process,jdbcType=VARCHAR}, - - - price = #{price,jdbcType=VARCHAR}, - - - calculation = #{calculation,jdbcType=VARCHAR}, - - - signdate = #{signdate,jdbcType=VARCHAR}, - - - franchise_period = #{franchisePeriod,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - service_area = #{serviceArea,jdbcType=VARCHAR}, - - - service_population = #{servicePopulation,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - address = #{address,jdbcType=VARCHAR}, - - - lgtd = #{lgtd,jdbcType=DECIMAL}, - - - lttd = #{lttd,jdbcType=DECIMAL}, - - - line_map_url = #{lineMapUrl,jdbcType=VARCHAR}, - - - point_map_url = #{pointMapUrl,jdbcType=VARCHAR}, - - - linetotal = #{linetotal,jdbcType=NUMERIC}, - - - pointnum = #{pointnum,jdbcType=NUMERIC}, - - - click_state = #{clickState,jdbcType=VARCHAR}, - - - default_load = #{defaultLoad,jdbcType=VARCHAR}, - - - legal_person_code = #{legalPersonCode,jdbcType=VARCHAR}, - - - outlet_id = #{outletId,jdbcType=VARCHAR}, - - - outlet_name = #{outletName,jdbcType=VARCHAR}, - - - entrance_id = #{entranceId,jdbcType=VARCHAR}, - - - entrance_name = #{entranceName,jdbcType=VARCHAR}, - - - town_num = #{townNum,jdbcType=INTEGER}, - - - village_num = #{villageNum,jdbcType=INTEGER}, - - - pump_num = #{pumpNum,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_bot - set bizid = #{bizid,jdbcType=VARCHAR}, - design_scale = #{designScale,jdbcType=VARCHAR}, - dsnum = #{dsnum,jdbcType=BIGINT}, - emission = #{emission,jdbcType=VARCHAR}, - influent_index = #{influentIndex,jdbcType=VARCHAR}, - effluent_index = #{effluentIndex,jdbcType=VARCHAR}, - process = #{process,jdbcType=VARCHAR}, - price = #{price,jdbcType=VARCHAR}, - calculation = #{calculation,jdbcType=VARCHAR}, - signdate = #{signdate,jdbcType=VARCHAR}, - franchise_period = #{franchisePeriod,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - service_area = #{serviceArea,jdbcType=VARCHAR}, - service_population = #{servicePopulation,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - address = #{address,jdbcType=VARCHAR}, - lgtd = #{lgtd,jdbcType=DECIMAL}, - lttd = #{lttd,jdbcType=DECIMAL}, - line_map_url = #{lineMapUrl,jdbcType=VARCHAR}, - point_map_url = #{pointMapUrl,jdbcType=VARCHAR}, - linetotal = #{linetotal,jdbcType=NUMERIC}, - pointnum = #{pointnum,jdbcType=NUMERIC}, - click_state = #{clickState,jdbcType=VARCHAR}, - default_load = #{defaultLoad,jdbcType=VARCHAR}, - legal_person_code = #{legalPersonCode,jdbcType=VARCHAR}, - outlet_id = #{outletId,jdbcType=VARCHAR}, - outlet_name = #{outletName,jdbcType=VARCHAR}, - entrance_id = #{entranceId,jdbcType=VARCHAR}, - entrance_name = #{entranceName,jdbcType=VARCHAR}, - town_num = #{townNum,jdbcType=INTEGER}, - village_num = #{villageNum,jdbcType=INTEGER}, - pump_num = #{pumpNum,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_bot - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitAuditMapper.xml b/src/com/sipai/mapper/business/BusinessUnitAuditMapper.xml deleted file mode 100644 index c32c85d0..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitAuditMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, businessId, taskDefinitionKey, processId, taskId, auditOpinion, - targetUsers, passStatus, unitId - - - - delete from tb_business_unit_audit - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit_audit (id, insdt, insuser, - businessId, taskDefinitionKey, processId, - taskId, auditOpinion, targetUsers, - passStatus, unitId) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{businessid,jdbcType=VARCHAR}, #{taskdefinitionkey,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{taskid,jdbcType=VARCHAR}, #{auditopinion,jdbcType=VARCHAR}, #{targetusers,jdbcType=VARCHAR}, - #{passstatus,jdbcType=BIT}, #{unitid,jdbcType=VARCHAR}) - - - insert into tb_business_unit_audit - - - id, - - - insdt, - - - insuser, - - - businessId, - - - taskDefinitionKey, - - - processId, - - - taskId, - - - auditOpinion, - - - targetUsers, - - - passStatus, - - - unitId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{businessid,jdbcType=VARCHAR}, - - - #{taskdefinitionkey,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{auditopinion,jdbcType=VARCHAR}, - - - #{targetusers,jdbcType=VARCHAR}, - - - #{passstatus,jdbcType=BIT}, - - - #{unitid,jdbcType=VARCHAR}, - - - - - update tb_business_unit_audit - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - businessId = #{businessid,jdbcType=VARCHAR}, - - - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - taskId = #{taskid,jdbcType=VARCHAR}, - - - auditOpinion = #{auditopinion,jdbcType=VARCHAR}, - - - targetUsers = #{targetusers,jdbcType=VARCHAR}, - - - passStatus = #{passstatus,jdbcType=BIT}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit_audit - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - businessId = #{businessid,jdbcType=VARCHAR}, - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - taskId = #{taskid,jdbcType=VARCHAR}, - auditOpinion = #{auditopinion,jdbcType=VARCHAR}, - targetUsers = #{targetusers,jdbcType=VARCHAR}, - passStatus = #{passstatus,jdbcType=BIT}, - unitId = #{unitid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_business_unit_audit - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitDeptApplyMapper.xml b/src/com/sipai/mapper/business/BusinessUnitDeptApplyMapper.xml deleted file mode 100644 index b76d6ba1..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitDeptApplyMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, subscribe_id, taskDefinitionKey, processId, taskId, targetUsers, - handleDetail, status, remark - - - - delete from tb_business_unit_dept_apply - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit_dept_apply (id, insdt, insuser, - subscribe_id, taskDefinitionKey, processId, - taskId, targetUsers, handleDetail, - status, remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{subscribeId,jdbcType=VARCHAR}, #{taskdefinitionkey,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{taskid,jdbcType=VARCHAR}, #{targetusers,jdbcType=VARCHAR}, #{handledetail,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}) - - - insert into tb_business_unit_dept_apply - - - id, - - - insdt, - - - insuser, - - - subscribe_id, - - - taskDefinitionKey, - - - processId, - - - taskId, - - - targetUsers, - - - handleDetail, - - - status, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{subscribeId,jdbcType=VARCHAR}, - - - #{taskdefinitionkey,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{targetusers,jdbcType=VARCHAR}, - - - #{handledetail,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_business_unit_dept_apply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - subscribe_id = #{subscribeId,jdbcType=VARCHAR}, - - - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - taskId = #{taskid,jdbcType=VARCHAR}, - - - targetUsers = #{targetusers,jdbcType=VARCHAR}, - - - handleDetail = #{handledetail,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit_dept_apply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - subscribe_id = #{subscribeId,jdbcType=VARCHAR}, - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - taskId = #{taskid,jdbcType=VARCHAR}, - targetUsers = #{targetusers,jdbcType=VARCHAR}, - handleDetail = #{handledetail,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_business_unit_dept_apply - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitHandleDetailMapper.xml b/src/com/sipai/mapper/business/BusinessUnitHandleDetailMapper.xml deleted file mode 100644 index 4e760f64..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitHandleDetailMapper.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, maintenanceDetailId, taskDefinitionKey, problem, handleDetail, - detailSupplement, handleDt, processSectionId, equipmentIds, faultLibraryId - - - - delete from tb_business_unit_handle_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit_handle_detail (id, insdt, insuser, - maintenanceDetailId, taskDefinitionKey, - problem, handleDetail, detailSupplement, - handleDt, processSectionId, equipmentIds, - faultLibraryId) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{maintenancedetailid,jdbcType=VARCHAR}, #{taskdefinitionkey,jdbcType=VARCHAR}, - #{problem,jdbcType=VARCHAR}, #{handledetail,jdbcType=VARCHAR}, #{detailsupplement,jdbcType=VARCHAR}, - #{handledt,jdbcType=TIMESTAMP}, #{processsectionid,jdbcType=VARCHAR}, #{equipmentids,jdbcType=VARCHAR}, - #{faultlibraryid,jdbcType=VARCHAR}) - - - insert into tb_business_unit_handle_detail - - - id, - - - insdt, - - - insuser, - - - maintenanceDetailId, - - - taskDefinitionKey, - - - problem, - - - handleDetail, - - - detailSupplement, - - - handleDt, - - - processSectionId, - - - equipmentIds, - - - faultLibraryId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{maintenancedetailid,jdbcType=VARCHAR}, - - - #{taskdefinitionkey,jdbcType=VARCHAR}, - - - #{problem,jdbcType=VARCHAR}, - - - #{handledetail,jdbcType=VARCHAR}, - - - #{detailsupplement,jdbcType=VARCHAR}, - - - #{handledt,jdbcType=TIMESTAMP}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{equipmentids,jdbcType=VARCHAR}, - - - #{faultlibraryid,jdbcType=VARCHAR}, - - - - - update tb_business_unit_handle_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - maintenanceDetailId = #{maintenancedetailid,jdbcType=VARCHAR}, - - - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - - - problem = #{problem,jdbcType=VARCHAR}, - - - handleDetail = #{handledetail,jdbcType=VARCHAR}, - - - detailSupplement = #{detailsupplement,jdbcType=VARCHAR}, - - - handleDt = #{handledt,jdbcType=TIMESTAMP}, - - - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - - - equipmentIds = #{equipmentids,jdbcType=VARCHAR}, - - - faultLibraryId = #{faultlibraryid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit_handle_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - maintenanceDetailId = #{maintenancedetailid,jdbcType=VARCHAR}, - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - problem = #{problem,jdbcType=VARCHAR}, - handleDetail = #{handledetail,jdbcType=VARCHAR}, - detailSupplement = #{detailsupplement,jdbcType=VARCHAR}, - handleDt = #{handledt,jdbcType=TIMESTAMP}, - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - equipmentIds = #{equipmentids,jdbcType=VARCHAR}, - faultLibraryId = #{faultlibraryid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_business_unit_handle_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitHandleMapper.xml b/src/com/sipai/mapper/business/BusinessUnitHandleMapper.xml deleted file mode 100644 index 74c2e22b..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitHandleMapper.xml +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, businessId, taskDefinitionKey, processId, taskId, handleDetail, - handledt, targetUsers, status, unitId - - - - delete from tb_business_unit_handle - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit_handle (id, insdt, insuser, - businessId, taskDefinitionKey, processId, - taskId, handleDetail, handledt, - targetUsers, status, unitId - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{businessid,jdbcType=VARCHAR}, #{taskdefinitionkey,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{taskid,jdbcType=VARCHAR}, #{handledetail,jdbcType=VARCHAR}, #{handledt,jdbcType=TIMESTAMP}, - #{targetusers,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR} - ) - - - insert into tb_business_unit_handle - - - id, - - - insdt, - - - insuser, - - - businessId, - - - taskDefinitionKey, - - - processId, - - - taskId, - - - handleDetail, - - - handledt, - - - targetUsers, - - - status, - - - unitId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{businessid,jdbcType=VARCHAR}, - - - #{taskdefinitionkey,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{handledetail,jdbcType=VARCHAR}, - - - #{handledt,jdbcType=TIMESTAMP}, - - - #{targetusers,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - - - update tb_business_unit_handle - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - businessId = #{businessid,jdbcType=VARCHAR}, - - - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - taskId = #{taskid,jdbcType=VARCHAR}, - - - handleDetail = #{handledetail,jdbcType=VARCHAR}, - - - handledt = #{handledt,jdbcType=TIMESTAMP}, - - - targetUsers = #{targetusers,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit_handle - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - businessId = #{businessid,jdbcType=VARCHAR}, - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - taskId = #{taskid,jdbcType=VARCHAR}, - handleDetail = #{handledetail,jdbcType=VARCHAR}, - handledt = #{handledt,jdbcType=TIMESTAMP}, - targetUsers = #{targetusers,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_business_unit_handle - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitInquiryMapper.xml b/src/com/sipai/mapper/business/BusinessUnitInquiryMapper.xml deleted file mode 100644 index 4c136d35..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitInquiryMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, subscribe_id, taskDefinitionKey, processId, taskId, targetUsers, - handleDetail, status, remark - - - - delete from tb_business_unit_inquiry - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit_inquiry (id, insdt, insuser, - subscribe_id, taskDefinitionKey, processId, - taskId, targetUsers, handleDetail, - status, remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{subscribeId,jdbcType=VARCHAR}, #{taskdefinitionkey,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{taskid,jdbcType=VARCHAR}, #{targetusers,jdbcType=VARCHAR}, #{handledetail,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}) - - - insert into tb_business_unit_inquiry - - - id, - - - insdt, - - - insuser, - - - subscribe_id, - - - taskDefinitionKey, - - - processId, - - - taskId, - - - targetUsers, - - - handleDetail, - - - status, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{subscribeId,jdbcType=VARCHAR}, - - - #{taskdefinitionkey,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{targetusers,jdbcType=VARCHAR}, - - - #{handledetail,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_business_unit_inquiry - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - subscribe_id = #{subscribeId,jdbcType=VARCHAR}, - - - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - taskId = #{taskid,jdbcType=VARCHAR}, - - - targetUsers = #{targetusers,jdbcType=VARCHAR}, - - - handleDetail = #{handledetail,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit_inquiry - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - subscribe_id = #{subscribeId,jdbcType=VARCHAR}, - taskDefinitionKey = #{taskdefinitionkey,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - taskId = #{taskid,jdbcType=VARCHAR}, - targetUsers = #{targetusers,jdbcType=VARCHAR}, - handleDetail = #{handledetail,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_business_unit_inquiry - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitIssueMapper.xml b/src/com/sipai/mapper/business/BusinessUnitIssueMapper.xml deleted file mode 100644 index 601c0ccf..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitIssueMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, maintenanceDetailId, processId, userTaskId, auditOpinion - - - - delete from tb_business_unit_issue - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit_issue (id, insdt, insuser, - maintenanceDetailId, processId, userTaskId, - auditOpinion) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{maintenancedetailid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{usertaskid,jdbcType=VARCHAR}, - #{auditopinion,jdbcType=VARCHAR}) - - - insert into tb_business_unit_issue - - - id, - - - insdt, - - - insuser, - - - maintenanceDetailId, - - - processId, - - - userTaskId, - - - auditOpinion, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{maintenancedetailid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{usertaskid,jdbcType=VARCHAR}, - - - #{auditopinion,jdbcType=VARCHAR}, - - - - - update tb_business_unit_issue - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - maintenanceDetailId = #{maintenancedetailid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - userTaskId = #{usertaskid,jdbcType=VARCHAR}, - - - auditOpinion = #{auditopinion,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit_issue - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - maintenanceDetailId = #{maintenancedetailid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - userTaskId = #{usertaskid,jdbcType=VARCHAR}, - auditOpinion = #{auditopinion,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_business_unit_issue - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/business/BusinessUnitMapper.xml b/src/com/sipai/mapper/business/BusinessUnitMapper.xml deleted file mode 100644 index 4123e75b..00000000 --- a/src/com/sipai/mapper/business/BusinessUnitMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, name, process_type_id, insdt, insuser, active, url, modal_id - - - - delete from tb_business_unit - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_business_unit (id, name, process_type_id, - insdt, insuser, active, - url, modal_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{processTypeId,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{url,jdbcType=VARCHAR}, #{modalId,jdbcType=VARCHAR}) - - - insert into tb_business_unit - - - id, - - - name, - - - process_type_id, - - - insdt, - - - insuser, - - - active, - - - url, - - - modal_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{processTypeId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{modalId,jdbcType=VARCHAR}, - - - - - update tb_business_unit - - - name = #{name,jdbcType=VARCHAR}, - - - process_type_id = #{processTypeId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - modal_id = #{modalId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_business_unit - set name = #{name,jdbcType=VARCHAR}, - process_type_id = #{processTypeId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - modal_id = #{modalId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_business_unit - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyConfigureDetailMapper.xml b/src/com/sipai/mapper/command/EmergencyConfigureDetailMapper.xml deleted file mode 100644 index 42d08c0b..00000000 --- a/src/com/sipai/mapper/command/EmergencyConfigureDetailMapper.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, pid, insuser, insdt, triggerType, triggerNumber, mpid, mpname, type - - - - delete from tb_Repair_EmergencyConfigureDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_Repair_EmergencyConfigureDetail (id, name, pid, - insuser, insdt, triggerType, - triggerNumber, mpid, mpname, - type) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{triggertype,jdbcType=VARCHAR}, - #{triggernumber,jdbcType=DECIMAL}, #{mpid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_Repair_EmergencyConfigureDetail - - - id, - - - name, - - - pid, - - - insuser, - - - insdt, - - - triggerType, - - - triggerNumber, - - - mpid, - - - mpname, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{triggertype,jdbcType=VARCHAR}, - - - #{triggernumber,jdbcType=DECIMAL}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_Repair_EmergencyConfigureDetail - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - triggerType = #{triggertype,jdbcType=VARCHAR}, - - - triggerNumber = #{triggernumber,jdbcType=DECIMAL}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_Repair_EmergencyConfigureDetail - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - triggerType = #{triggertype,jdbcType=VARCHAR}, - triggerNumber = #{triggernumber,jdbcType=DECIMAL}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyConfigureInfoMapper.xml b/src/com/sipai/mapper/command/EmergencyConfigureInfoMapper.xml deleted file mode 100644 index f6d959e1..00000000 --- a/src/com/sipai/mapper/command/EmergencyConfigureInfoMapper.xml +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, st, ord, memo, insuser, insdt, bizid, contents, grade, roles, personLiableid, - personLiablename, contentsdetail, itemnumber, startupcondition, corresponding, issuer, - rank, planTime, visualization - - - - delete from tb_Repair_EmergencyConfigureInfo - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_Repair_EmergencyConfigureInfo (id, pid, st, - ord, memo, insuser, - insdt, bizid, contents, - grade, roles, personLiableid, - personLiablename, contentsdetail, itemnumber, - startupcondition, corresponding, issuer, - rank, planTime, visualization - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{st,jdbcType=VARCHAR}, - #{ord,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{bizid,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, - #{grade,jdbcType=INTEGER}, #{roles,jdbcType=VARCHAR}, #{personliableid,jdbcType=VARCHAR}, - #{personliablename,jdbcType=VARCHAR}, #{contentsdetail,jdbcType=VARCHAR}, #{itemnumber,jdbcType=VARCHAR}, - #{startupcondition,jdbcType=VARCHAR}, #{corresponding,jdbcType=VARCHAR}, #{issuer,jdbcType=VARCHAR}, - #{rank,jdbcType=INTEGER}, #{planTime,jdbcType=VARCHAR}, #{visualization,jdbcType=VARCHAR} - ) - - - insert into tb_Repair_EmergencyConfigureInfo - - - id, - - - pid, - - - st, - - - ord, - - - memo, - - - insuser, - - - insdt, - - - bizid, - - - contents, - - - grade, - - - roles, - - - personLiableid, - - - personLiablename, - - - contentsdetail, - - - itemnumber, - - - startupcondition, - - - corresponding, - - - issuer, - - - rank, - - - planTime, - - - visualization, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{st,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{memo,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{grade,jdbcType=INTEGER}, - - - #{roles,jdbcType=VARCHAR}, - - - #{personliableid,jdbcType=VARCHAR}, - - - #{personliablename,jdbcType=VARCHAR}, - - - #{contentsdetail,jdbcType=VARCHAR}, - - - #{itemnumber,jdbcType=VARCHAR}, - - - #{startupcondition,jdbcType=VARCHAR}, - - - #{corresponding,jdbcType=VARCHAR}, - - - #{issuer,jdbcType=VARCHAR}, - - - #{rank,jdbcType=INTEGER}, - - - #{planTime,jdbcType=VARCHAR}, - - - #{visualization,jdbcType=VARCHAR}, - - - - - update tb_Repair_EmergencyConfigureInfo - - - pid = #{pid,jdbcType=VARCHAR}, - - - st = #{st,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - grade = #{grade,jdbcType=INTEGER}, - - - roles = #{roles,jdbcType=VARCHAR}, - - - personLiableid = #{personliableid,jdbcType=VARCHAR}, - - - personLiablename = #{personliablename,jdbcType=VARCHAR}, - - - contentsdetail = #{contentsdetail,jdbcType=VARCHAR}, - - - itemnumber = #{itemnumber,jdbcType=VARCHAR}, - - - startupcondition = #{startupcondition,jdbcType=VARCHAR}, - - - corresponding = #{corresponding,jdbcType=VARCHAR}, - - - issuer = #{issuer,jdbcType=VARCHAR}, - - - rank = #{rank,jdbcType=INTEGER}, - - - planTime = #{planTime,jdbcType=VARCHAR}, - - - visualization = #{visualization,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_Repair_EmergencyConfigureInfo - set pid = #{pid,jdbcType=VARCHAR}, - st = #{st,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - memo = #{memo,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - bizid = #{bizid,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - grade = #{grade,jdbcType=INTEGER}, - roles = #{roles,jdbcType=VARCHAR}, - personLiableid = #{personliableid,jdbcType=VARCHAR}, - personLiablename = #{personliablename,jdbcType=VARCHAR}, - contentsdetail = #{contentsdetail,jdbcType=VARCHAR}, - itemnumber = #{itemnumber,jdbcType=VARCHAR}, - startupcondition = #{startupcondition,jdbcType=VARCHAR}, - corresponding = #{corresponding,jdbcType=VARCHAR}, - issuer = #{issuer,jdbcType=VARCHAR}, - rank = #{rank,jdbcType=INTEGER}, - planTime = #{planTime,jdbcType=VARCHAR}, - visualization = #{visualization,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyConfigureMapper.xml b/src/com/sipai/mapper/command/EmergencyConfigureMapper.xml deleted file mode 100644 index 97b8ca24..00000000 --- a/src/com/sipai/mapper/command/EmergencyConfigureMapper.xml +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, name, pid, pname, st, ord, memo, insuser, insdt, bizid, num,grade,firstperson,firstpersonid,startingcondition,type,mpointcodes,nodes,description,alarm_st - - - - delete from tb_Repair_EmergencyConfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_Repair_EmergencyConfigure (id, name, pid, - pname, st, ord, memo, - insuser, insdt, bizid, - num,grade,firstperson,firstpersonid,startingcondition,type,mpointcodes,nodes,description,alarm_st) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{pname,jdbcType=VARCHAR}, #{st,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{bizid,jdbcType=VARCHAR}, - #{num,jdbcType=VARCHAR},#{grade,jdbcType=INTEGER},#{firstperson,jdbcType=VARCHAR},#{firstpersonid,jdbcType=VARCHAR}, - #{startingcondition,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{mpointcodes,jdbcType=VARCHAR},#{nodes,jdbcType=VARCHAR}, - #{description,jdbcType=VARCHAR},#{alarmSt,jdbcType=INTEGER}) - - - insert into tb_Repair_EmergencyConfigure - - - id, - - - name, - - - pid, - - - pname, - - - st, - - - ord, - - - memo, - - - insuser, - - - insdt, - - - bizid, - - - num, - - - grade, - - - firstperson, - - - firstpersonid, - - - startingcondition, - - - type, - - - mpointcodes, - - - nodes, - - - description, - - - alarm_st, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{pname,jdbcType=VARCHAR}, - - - #{st,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{memo,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{num,jdbcType=VARCHAR}, - - - #{grade,jdbcType=INTEGER}, - - - #{firstperson,jdbcType=VARCHAR}, - - - #{firstpersonid,jdbcType=VARCHAR}, - - - #{startingcondition,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{mpointcodes,jdbcType=VARCHAR}, - - - #{nodes,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{alarmSt,jdbcType=INTEGER}, - - - - - update tb_Repair_EmergencyConfigure - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - pname = #{pname,jdbcType=VARCHAR}, - - - st = #{st,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - num = #{num,jdbcType=VARCHAR}, - - - grade = #{grade,jdbcType=INTEGER}, - - - firstperson = #{firstperson,jdbcType=VARCHAR}, - - - firstpersonid = #{firstpersonid,jdbcType=VARCHAR}, - - - startingcondition = #{startingcondition,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - mpointcodes = #{mpointcodes,jdbcType=VARCHAR}, - - - nodes = #{nodes,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - alarm_st = #{alarmSt,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_Repair_EmergencyConfigure - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - pname = #{pname,jdbcType=VARCHAR}, - st = #{st,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - memo = #{memo,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - bizid = #{bizid,jdbcType=VARCHAR}, - num = #{num,jdbcType=VARCHAR}, - grade = #{grade,jdbcType=INTEGER}, - firstperson = #{firstperson,jdbcType=VARCHAR}, - firstpersonid = #{firstpersonid,jdbcType=VARCHAR}, - startingcondition = #{startingcondition,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - mpointcodes = #{mpointcodes,jdbcType=VARCHAR}, - nodes = #{nodes,jdbcType=VARCHAR}, - alarm_st = #{alarmSt,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_Repair_EmergencyConfigure - ${where} - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyConfigureWorkOrderMapper.xml b/src/com/sipai/mapper/command/EmergencyConfigureWorkOrderMapper.xml deleted file mode 100644 index c99193f4..00000000 --- a/src/com/sipai/mapper/command/EmergencyConfigureWorkOrderMapper.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, bizid, worksenduser, workreceiveuser, workcontent,worksenddt,workfinishdt, status, nodeid, - recordid,workreceivedt,workreceivecontent - - - insert into TB_Repair_EmergencyConfigureWorkOrder (id, insdt, insuser, - bizid, worksenduser, workreceiveuser, - workcontent, worksenddt, workfinishdt, - status, nodeid, recordid, - workreceivedt, workreceivecontent) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{worksenduser,jdbcType=VARCHAR}, #{workreceiveuser,jdbcType=VARCHAR}, - #{workcontent,jdbcType=VARCHAR}, #{worksenddt,jdbcType=TIMESTAMP}, #{workfinishdt,jdbcType=TIMESTAMP}, - #{status,jdbcType=INTEGER}, #{nodeid,jdbcType=VARCHAR}, #{recordid,jdbcType=VARCHAR}, - #{workreceivedt,jdbcType=TIMESTAMP}, #{workreceivecontent,jdbcType=VARCHAR}) - - - insert into TB_Repair_EmergencyConfigureWorkOrder - - - id, - - - insdt, - - - insuser, - - - bizid, - - - worksenduser, - - - workreceiveuser, - - - workcontent, - - - worksenddt, - - - workfinishdt, - - - status, - - - nodeid, - - - recordid, - - - workreceivedt, - - - workreceivecontent, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{worksenduser,jdbcType=VARCHAR}, - - - #{workreceiveuser,jdbcType=VARCHAR}, - - - #{workcontent,jdbcType=VARCHAR}, - - - #{worksenddt,jdbcType=TIMESTAMP}, - - - #{workfinishdt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=INTEGER}, - - - #{nodeid,jdbcType=VARCHAR}, - - - #{recordid,jdbcType=VARCHAR}, - - - #{workreceivedt,jdbcType=TIMESTAMP}, - - - #{workreceivecontent,jdbcType=VARCHAR}, - - - - - update TB_Repair_EmergencyConfigureWorkOrder - - - id = #{id,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - worksenduser = #{worksenduser,jdbcType=VARCHAR}, - - - workreceiveuser = #{workreceiveuser,jdbcType=VARCHAR}, - - - workcontent = #{workcontent,jdbcType=VARCHAR}, - - - worksenddt = #{worksenddt,jdbcType=TIMESTAMP}, - - - workfinishdt = #{workfinishdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=INTEGER}, - - - nodeid = #{nodeid,jdbcType=VARCHAR}, - - - recordid = #{recordid,jdbcType=VARCHAR}, - - - workreceivedt = #{workreceivedt,jdbcType=TIMESTAMP}, - - - workreceivecontent = #{workreceivecontent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Repair_EmergencyConfigureWorkOrder - where id = #{id,jdbcType=VARCHAR} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyConfigurefileMapper.xml b/src/com/sipai/mapper/command/EmergencyConfigurefileMapper.xml deleted file mode 100644 index f0dc42f5..00000000 --- a/src/com/sipai/mapper/command/EmergencyConfigurefileMapper.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - id, masterid, filename, abspath, size, insuser, insdt, insuser, type - - - insert into tb_Repair_EmergencyConfigure_file (id, masterid, filename, - abspath, size, insuser, - insdt, type) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{size,jdbcType=DOUBLE}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}) - - - insert into tb_Repair_EmergencyConfigure_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - size, - - - insuser, - - - insdt, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{size,jdbcType=DOUBLE}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyPlanMapper.xml b/src/com/sipai/mapper/command/EmergencyPlanMapper.xml deleted file mode 100644 index ba6fdb94..00000000 --- a/src/com/sipai/mapper/command/EmergencyPlanMapper.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, status, plan_date, unit_id, emergency_configure_id, emergency_record_id - - - - delete from TB_Repair_EmergencyPlan - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Repair_EmergencyPlan (id, insdt, insuser, - status, plan_date, unit_id, - emergency_configure_id, emergency_record_id - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{planDate,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR}, - #{emergencyConfigureId,jdbcType=VARCHAR}, #{emergencyRecordId,jdbcType=VARCHAR} - ) - - - insert into TB_Repair_EmergencyPlan - - - id, - - - insdt, - - - insuser, - - - status, - - - plan_date, - - - unit_id, - - - emergency_configure_id, - - - emergency_record_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{emergencyConfigureId,jdbcType=VARCHAR}, - - - #{emergencyRecordId,jdbcType=VARCHAR}, - - - - - update TB_Repair_EmergencyPlan - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - emergency_configure_id = #{emergencyConfigureId,jdbcType=VARCHAR}, - - - emergency_record_id = #{emergencyRecordId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Repair_EmergencyPlan - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR}, - emergency_configure_id = #{emergencyConfigureId,jdbcType=VARCHAR}, - emergency_record_id = #{emergencyRecordId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_Repair_EmergencyPlan ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyRecordsDetailMapper.xml b/src/com/sipai/mapper/command/EmergencyRecordsDetailMapper.xml deleted file mode 100644 index 3d2eacb4..00000000 --- a/src/com/sipai/mapper/command/EmergencyRecordsDetailMapper.xml +++ /dev/null @@ -1,380 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, bizid, ord, pid, ecDetailId, status, rank, personLiableid, personLiablename, - contents, contentDetail, itemNumber, startupCondition, corresponding, issuer, starter, - startdt, submitter, submitdt, closer, closedt, planTime, visualization, memo - - - - delete from TB_Repair_EmergencyRecordsDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Repair_EmergencyRecordsDetail (id, insdt, insuser, - bizid, ord, pid, ecDetailId, - status, rank, personLiableid, - personLiablename, contents, contentDetail, - itemNumber, startupCondition, corresponding, - issuer, starter, startdt, - submitter, submitdt, closer, - closedt, planTime, visualization, memo - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, #{ecdetailid,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{rank,jdbcType=INTEGER}, #{personliableid,jdbcType=VARCHAR}, - #{personliablename,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, #{contentdetail,jdbcType=VARCHAR}, - #{itemnumber,jdbcType=VARCHAR}, #{startupcondition,jdbcType=VARCHAR}, #{corresponding,jdbcType=VARCHAR}, - #{issuer,jdbcType=VARCHAR}, #{starter,jdbcType=VARCHAR}, #{startdt,jdbcType=TIMESTAMP}, - #{submitter,jdbcType=VARCHAR}, #{submitdt,jdbcType=TIMESTAMP}, #{closer,jdbcType=VARCHAR}, - #{closedt,jdbcType=TIMESTAMP}, #{planTime,jdbcType=VARCHAR}, #{visualization,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR} - ) - - - insert into TB_Repair_EmergencyRecordsDetail - - - id, - - - insdt, - - - insuser, - - - bizid, - - - ord, - - - pid, - - - ecDetailId, - - - status, - - - rank, - - - personLiableid, - - - personLiablename, - - - contents, - - - contentDetail, - - - itemNumber, - - - startupCondition, - - - corresponding, - - - issuer, - - - starter, - - - startdt, - - - submitter, - - - submitdt, - - - closer, - - - closedt, - - - planTime, - - - visualization, - - - memo, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - #{ecdetailid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{rank,jdbcType=INTEGER}, - - - #{personliableid,jdbcType=VARCHAR}, - - - #{personliablename,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{contentdetail,jdbcType=VARCHAR}, - - - #{itemnumber,jdbcType=VARCHAR}, - - - #{startupcondition,jdbcType=VARCHAR}, - - - #{corresponding,jdbcType=VARCHAR}, - - - #{issuer,jdbcType=VARCHAR}, - - - #{starter,jdbcType=VARCHAR}, - - - #{startdt,jdbcType=TIMESTAMP}, - - - #{submitter,jdbcType=VARCHAR}, - - - #{submitdt,jdbcType=TIMESTAMP}, - - - #{closer,jdbcType=VARCHAR}, - - - #{closedt,jdbcType=TIMESTAMP}, - - - #{planTime,jdbcType=VARCHAR}, - - - #{visualization,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - - - update TB_Repair_EmergencyRecordsDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - ecDetailId = #{ecdetailid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - rank = #{rank,jdbcType=INTEGER}, - - - personLiableid = #{personliableid,jdbcType=VARCHAR}, - - - personLiablename = #{personliablename,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - contentDetail = #{contentdetail,jdbcType=VARCHAR}, - - - itemNumber = #{itemnumber,jdbcType=VARCHAR}, - - - startupCondition = #{startupcondition,jdbcType=VARCHAR}, - - - corresponding = #{corresponding,jdbcType=VARCHAR}, - - - issuer = #{issuer,jdbcType=VARCHAR}, - - - starter = #{starter,jdbcType=VARCHAR}, - - - startdt = #{startdt,jdbcType=TIMESTAMP}, - - - submitter = #{submitter,jdbcType=VARCHAR}, - - - submitdt = #{submitdt,jdbcType=TIMESTAMP}, - - - closer = #{closer,jdbcType=VARCHAR}, - - - closedt = #{closedt,jdbcType=TIMESTAMP}, - - - planTime = #{planTime,jdbcType=VARCHAR}, - - - visualization = #{visualization,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Repair_EmergencyRecordsDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - ecDetailId = #{ecdetailid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - rank = #{rank,jdbcType=INTEGER}, - personLiableid = #{personliableid,jdbcType=VARCHAR}, - personLiablename = #{personliablename,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - contentDetail = #{contentdetail,jdbcType=VARCHAR}, - itemNumber = #{itemnumber,jdbcType=VARCHAR}, - startupCondition = #{startupcondition,jdbcType=VARCHAR}, - corresponding = #{corresponding,jdbcType=VARCHAR}, - issuer = #{issuer,jdbcType=VARCHAR}, - starter = #{starter,jdbcType=VARCHAR}, - startdt = #{startdt,jdbcType=TIMESTAMP}, - submitter = #{submitter,jdbcType=VARCHAR}, - submitdt = #{submitdt,jdbcType=TIMESTAMP}, - closer = #{closer,jdbcType=VARCHAR}, - closedt = #{closedt,jdbcType=TIMESTAMP}, - planTime = #{planTime,jdbcType=VARCHAR}, - visualization = #{visualization,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - - - delete from TB_Repair_EmergencyRecordsDetail - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/command/EmergencyRecordsMapper.xml b/src/com/sipai/mapper/command/EmergencyRecordsMapper.xml deleted file mode 100644 index 762f8b4c..00000000 --- a/src/com/sipai/mapper/command/EmergencyRecordsMapper.xml +++ /dev/null @@ -1,467 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, bizid, starter, starttime, endtime, urgentreason, remarks, status, - personLiableid, personLiablename, grade, firstmenu, secondmenu, thirdmenu, reportperson, - firstPerson, reporttime, type, name, ender, biztype, memo, startingcondition, emergencytype, - status_plan,mpointcodes,nodes - - - - delete from TB_Repair_EmergencyRecords - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Repair_EmergencyRecords (id, insdt, insuser, - bizid, starter, starttime, - endtime, urgentreason, remarks, - status, personLiableid, personLiablename, - grade, firstmenu, secondmenu, - thirdmenu, reportperson, firstPerson, - reporttime, type, name, - ender, biztype, memo, - startingcondition, emergencytype, status_plan,mpointcodes,nodes - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{starter,jdbcType=VARCHAR}, #{starttime,jdbcType=TIMESTAMP}, - #{endtime,jdbcType=TIMESTAMP}, #{urgentreason,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{personliableid,jdbcType=VARCHAR}, #{personliablename,jdbcType=VARCHAR}, - #{grade,jdbcType=INTEGER}, #{firstmenu,jdbcType=VARCHAR}, #{secondmenu,jdbcType=VARCHAR}, - #{thirdmenu,jdbcType=VARCHAR}, #{reportperson,jdbcType=VARCHAR}, #{firstperson,jdbcType=VARCHAR}, - #{reporttime,jdbcType=TIMESTAMP}, #{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, - #{ender,jdbcType=VARCHAR}, #{biztype,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR}, - #{startingcondition,jdbcType=VARCHAR}, #{emergencytype,jdbcType=VARCHAR}, #{statusPlan,jdbcType=VARCHAR}, - #{mpointcodes,jdbcType=VARCHAR}, #{nodes,jdbcType=VARCHAR} - ) - - - insert into TB_Repair_EmergencyRecords - - - id, - - - insdt, - - - insuser, - - - bizid, - - - starter, - - - starttime, - - - endtime, - - - urgentreason, - - - remarks, - - - status, - - - personLiableid, - - - personLiablename, - - - grade, - - - firstmenu, - - - secondmenu, - - - thirdmenu, - - - reportperson, - - - firstPerson, - - - reporttime, - - - type, - - - name, - - - ender, - - - biztype, - - - memo, - - - startingcondition, - - - emergencytype, - - - status_plan, - - - mpointcodes, - - - nodes, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{starter,jdbcType=VARCHAR}, - - - #{starttime,jdbcType=TIMESTAMP}, - - - #{endtime,jdbcType=TIMESTAMP}, - - - #{urgentreason,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{personliableid,jdbcType=VARCHAR}, - - - #{personliablename,jdbcType=VARCHAR}, - - - #{grade,jdbcType=INTEGER}, - - - #{firstmenu,jdbcType=VARCHAR}, - - - #{secondmenu,jdbcType=VARCHAR}, - - - #{thirdmenu,jdbcType=VARCHAR}, - - - #{reportperson,jdbcType=VARCHAR}, - - - #{firstperson,jdbcType=VARCHAR}, - - - #{reporttime,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{ender,jdbcType=VARCHAR}, - - - #{biztype,jdbcType=INTEGER}, - - - #{memo,jdbcType=VARCHAR}, - - - #{startingcondition,jdbcType=VARCHAR}, - - - #{emergencytype,jdbcType=VARCHAR}, - - - #{statusPlan,jdbcType=VARCHAR}, - - - #{mpointcodes,jdbcType=VARCHAR}, - - - #{nodes,jdbcType=VARCHAR}, - - - - - update TB_Repair_EmergencyRecords - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - starter = #{starter,jdbcType=VARCHAR}, - - - starttime = #{starttime,jdbcType=TIMESTAMP}, - - - endtime = #{endtime,jdbcType=TIMESTAMP}, - - - urgentreason = #{urgentreason,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - personLiableid = #{personliableid,jdbcType=VARCHAR}, - - - personLiablename = #{personliablename,jdbcType=VARCHAR}, - - - grade = #{grade,jdbcType=INTEGER}, - - - firstmenu = #{firstmenu,jdbcType=VARCHAR}, - - - secondmenu = #{secondmenu,jdbcType=VARCHAR}, - - - thirdmenu = #{thirdmenu,jdbcType=VARCHAR}, - - - reportperson = #{reportperson,jdbcType=VARCHAR}, - - - firstPerson = #{firstperson,jdbcType=VARCHAR}, - - - reporttime = #{reporttime,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - ender = #{ender,jdbcType=VARCHAR}, - - - biztype = #{biztype,jdbcType=INTEGER}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - startingcondition = #{startingcondition,jdbcType=VARCHAR}, - - - emergencytype = #{emergencytype,jdbcType=VARCHAR}, - - - status_plan = #{statusPlan,jdbcType=VARCHAR}, - - - mpointcodes = #{mpointcodes,jdbcType=VARCHAR}, - - - nodes = #{nodes,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Repair_EmergencyRecords - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - starter = #{starter,jdbcType=VARCHAR}, - starttime = #{starttime,jdbcType=TIMESTAMP}, - endtime = #{endtime,jdbcType=TIMESTAMP}, - urgentreason = #{urgentreason,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - personLiableid = #{personliableid,jdbcType=VARCHAR}, - personLiablename = #{personliablename,jdbcType=VARCHAR}, - grade = #{grade,jdbcType=INTEGER}, - firstmenu = #{firstmenu,jdbcType=VARCHAR}, - secondmenu = #{secondmenu,jdbcType=VARCHAR}, - thirdmenu = #{thirdmenu,jdbcType=VARCHAR}, - reportperson = #{reportperson,jdbcType=VARCHAR}, - firstPerson = #{firstperson,jdbcType=VARCHAR}, - reporttime = #{reporttime,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - ender = #{ender,jdbcType=VARCHAR}, - biztype = #{biztype,jdbcType=INTEGER}, - memo = #{memo,jdbcType=VARCHAR}, - startingcondition = #{startingcondition,jdbcType=VARCHAR}, - emergencytype = #{emergencytype,jdbcType=VARCHAR}, - status_plan = #{statusPlan,jdbcType=VARCHAR}, - mpointcodes = #{mpointcodes,jdbcType=VARCHAR}, - nodes = #{nodes,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/com/sipai/mapper/command/EmergencyRecordsWorkOrderMapper.xml b/src/com/sipai/mapper/command/EmergencyRecordsWorkOrderMapper.xml deleted file mode 100644 index 4ee94efc..00000000 --- a/src/com/sipai/mapper/command/EmergencyRecordsWorkOrderMapper.xml +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, bizid, worksenduser, workreceiveuser, workreceiveuserid, workcontent, worksenddt, - workfinishdt, status, nodeid, recordid, workreceivedt, workreceivecontent,worksendusername, workreceiveusername,patrol_record_id - - - - delete - from TB_Repair_EmergencyRecordsWorkOrder - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Repair_EmergencyRecordsWorkOrder (id, insdt, insuser, - bizid, worksenduser, workreceiveuser, workreceiveuserid, - workcontent, worksenddt, workfinishdt, - status, nodeid, recordid, workreceivedt, workreceivecontent, worksendusername, - workreceiveusername, patrol_record_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{worksenduser,jdbcType=VARCHAR}, #{workreceiveuser,jdbcType=VARCHAR}, - #{workreceiveuserid,jdbcType=VARCHAR}, - #{workcontent,jdbcType=VARCHAR}, #{worksenddt,jdbcType=TIMESTAMP}, #{workfinishdt,jdbcType=TIMESTAMP}, - #{status,jdbcType=INTEGER}, #{nodeid,jdbcType=VARCHAR}, #{recordid,jdbcType=VARCHAR}, #{workreceivedt,jdbcType=TIMESTAMP}, - #{workreceivecontent,jdbcType=VARCHAR}, #{worksendusername,jdbcType=VARCHAR}, #{workreceiveusername,jdbcType=VARCHAR}, - #{patrolRecordId,jdbcType=VARCHAR}) - - - insert into TB_Repair_EmergencyRecordsWorkOrder - - - id, - - - insdt, - - - insuser, - - - bizid, - - - worksenduser, - - - workreceiveuser, - - - workreceiveuserid, - - - workcontent, - - - worksenddt, - - - workfinishdt, - - - status, - - - nodeid, - - - recordid, - - - workreceivedt, - - - workreceivecontent, - - - worksendusername, - - - workreceiveusername, - - - patrol_record_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{worksenduser,jdbcType=VARCHAR}, - - - #{workreceiveuser,jdbcType=VARCHAR}, - - - #{workreceiveuserid,jdbcType=VARCHAR}, - - - #{workcontent,jdbcType=VARCHAR}, - - - #{worksenddt,jdbcType=TIMESTAMP}, - - - #{workfinishdt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=INTEGER}, - - - #{nodeid,jdbcType=VARCHAR}, - - - #{recordid,jdbcType=VARCHAR}, - - - #{workreceivedt,jdbcType=TIMESTAMP}, - - - #{workreceivecontent,jdbcType=VARCHAR}, - - - #{worksendusername,jdbcType=VARCHAR}, - - - #{workreceiveusername,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - - - update TB_Repair_EmergencyRecordsWorkOrder - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - worksenduser = #{worksenduser,jdbcType=VARCHAR}, - - - workreceiveuser = #{workreceiveuser,jdbcType=VARCHAR}, - - - workreceiveuserid = #{workreceiveuserid,jdbcType=VARCHAR}, - - - workcontent = #{workcontent,jdbcType=VARCHAR}, - - - worksenddt = #{worksenddt,jdbcType=TIMESTAMP}, - - - workfinishdt = #{workfinishdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=INTEGER}, - - - nodeid = #{nodeid,jdbcType=VARCHAR}, - - - recordid = #{recordid,jdbcType=VARCHAR}, - - - workreceivedt = #{workreceivedt,jdbcType=TIMESTAMP}, - - - workreceivecontent = #{workreceivecontent,jdbcType=VARCHAR}, - - - worksendusername = #{worksendusername,jdbcType=VARCHAR}, - - - workreceiveusername = #{workreceiveusername,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Repair_EmergencyRecordsWorkOrder - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - worksenduser = #{worksenduser,jdbcType=VARCHAR}, - workreceiveuser = #{workreceiveuser,jdbcType=VARCHAR}, - workreceiveuserid = #{workreceiveuserid,jdbcType=VARCHAR}, - workcontent = #{workcontent,jdbcType=VARCHAR}, - worksenddt = #{worksenddt,jdbcType=TIMESTAMP}, - workfinishdt = #{workfinishdt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=INTEGER}, - nodeid = #{nodeid,jdbcType=VARCHAR}, - recordid = #{recordid,jdbcType=VARCHAR}, - workreceivedt = #{workreceivedt,jdbcType=TIMESTAMP}, - workreceivecontent = #{workreceivecontent,jdbcType=VARCHAR}, - worksendusername = #{worksendusername,jdbcType=VARCHAR}, - workreceiveusername = #{workreceiveusername,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/cqbyt/CqbytSampleValueMapper.xml b/src/com/sipai/mapper/cqbyt/CqbytSampleValueMapper.xml deleted file mode 100644 index 3e5acf53..00000000 --- a/src/com/sipai/mapper/cqbyt/CqbytSampleValueMapper.xml +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - id, sampleCode, itemCode, itemName, itemUnit, checkStandardCode, checkStandardName, - itemLimit, originalValue, tempProcessValue, value, specialValue, strategy, logicValue, - companyCode, reserve1, reserve2, reserve3, reserve4 - - - - delete from TB_CQBYT_SampleValue - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_CQBYT_SampleValue (id, sampleCode, itemCode, - itemName, itemUnit, checkStandardCode, - checkStandardName, itemLimit, originalValue, - tempProcessValue, value, specialValue, - strategy, logicValue, companyCode, - reserve1, reserve2, reserve3, - reserve4) - values (#{id,jdbcType=VARCHAR}, #{samplecode,jdbcType=VARCHAR}, #{itemcode,jdbcType=VARCHAR}, - #{itemname,jdbcType=VARCHAR}, #{itemunit,jdbcType=VARCHAR}, #{checkstandardcode,jdbcType=VARCHAR}, - #{checkstandardname,jdbcType=VARCHAR}, #{itemlimit,jdbcType=VARCHAR}, #{originalvalue,jdbcType=VARCHAR}, - #{tempprocessvalue,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, #{specialvalue,jdbcType=VARCHAR}, - #{strategy,jdbcType=VARCHAR}, #{logicvalue,jdbcType=VARCHAR}, #{companycode,jdbcType=VARCHAR}, - #{reserve1,jdbcType=VARCHAR}, #{reserve2,jdbcType=VARCHAR}, #{reserve3,jdbcType=VARCHAR}, - #{reserve4,jdbcType=VARCHAR}) - - - insert into TB_CQBYT_SampleValue - - - id, - - - sampleCode, - - - itemCode, - - - itemName, - - - itemUnit, - - - checkStandardCode, - - - checkStandardName, - - - itemLimit, - - - originalValue, - - - tempProcessValue, - - - value, - - - specialValue, - - - strategy, - - - logicValue, - - - companyCode, - - - reserve1, - - - reserve2, - - - reserve3, - - - reserve4, - - - - - #{id,jdbcType=VARCHAR}, - - - #{samplecode,jdbcType=VARCHAR}, - - - #{itemcode,jdbcType=VARCHAR}, - - - #{itemname,jdbcType=VARCHAR}, - - - #{itemunit,jdbcType=VARCHAR}, - - - #{checkstandardcode,jdbcType=VARCHAR}, - - - #{checkstandardname,jdbcType=VARCHAR}, - - - #{itemlimit,jdbcType=VARCHAR}, - - - #{originalvalue,jdbcType=VARCHAR}, - - - #{tempprocessvalue,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{specialvalue,jdbcType=VARCHAR}, - - - #{strategy,jdbcType=VARCHAR}, - - - #{logicvalue,jdbcType=VARCHAR}, - - - #{companycode,jdbcType=VARCHAR}, - - - #{reserve1,jdbcType=VARCHAR}, - - - #{reserve2,jdbcType=VARCHAR}, - - - #{reserve3,jdbcType=VARCHAR}, - - - #{reserve4,jdbcType=VARCHAR}, - - - - - update TB_CQBYT_SampleValue - - - sampleCode = #{samplecode,jdbcType=VARCHAR}, - - - itemCode = #{itemcode,jdbcType=VARCHAR}, - - - itemName = #{itemname,jdbcType=VARCHAR}, - - - itemUnit = #{itemunit,jdbcType=VARCHAR}, - - - checkStandardCode = #{checkstandardcode,jdbcType=VARCHAR}, - - - checkStandardName = #{checkstandardname,jdbcType=VARCHAR}, - - - itemLimit = #{itemlimit,jdbcType=VARCHAR}, - - - originalValue = #{originalvalue,jdbcType=VARCHAR}, - - - tempProcessValue = #{tempprocessvalue,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - specialValue = #{specialvalue,jdbcType=VARCHAR}, - - - strategy = #{strategy,jdbcType=VARCHAR}, - - - logicValue = #{logicvalue,jdbcType=VARCHAR}, - - - companyCode = #{companycode,jdbcType=VARCHAR}, - - - reserve1 = #{reserve1,jdbcType=VARCHAR}, - - - reserve2 = #{reserve2,jdbcType=VARCHAR}, - - - reserve3 = #{reserve3,jdbcType=VARCHAR}, - - - reserve4 = #{reserve4,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_CQBYT_SampleValue - set sampleCode = #{samplecode,jdbcType=VARCHAR}, - itemCode = #{itemcode,jdbcType=VARCHAR}, - itemName = #{itemname,jdbcType=VARCHAR}, - itemUnit = #{itemunit,jdbcType=VARCHAR}, - checkStandardCode = #{checkstandardcode,jdbcType=VARCHAR}, - checkStandardName = #{checkstandardname,jdbcType=VARCHAR}, - itemLimit = #{itemlimit,jdbcType=VARCHAR}, - originalValue = #{originalvalue,jdbcType=VARCHAR}, - tempProcessValue = #{tempprocessvalue,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - specialValue = #{specialvalue,jdbcType=VARCHAR}, - strategy = #{strategy,jdbcType=VARCHAR}, - logicValue = #{logicvalue,jdbcType=VARCHAR}, - companyCode = #{companycode,jdbcType=VARCHAR}, - reserve1 = #{reserve1,jdbcType=VARCHAR}, - reserve2 = #{reserve2,jdbcType=VARCHAR}, - reserve3 = #{reserve3,jdbcType=VARCHAR}, - reserve4 = #{reserve4,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_CQBYT_SampleValue - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/cqbyt/CqbytVISITOUTINDATAMapper.xml b/src/com/sipai/mapper/cqbyt/CqbytVISITOUTINDATAMapper.xml deleted file mode 100644 index ca6fac45..00000000 --- a/src/com/sipai/mapper/cqbyt/CqbytVISITOUTINDATAMapper.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - NAME, GENDER, CARDID, IMAGES, PHONE, CARNUM, VISITORTYPE, OUTINTYPE, DEVICETYPE, - V_TOTALPEOPLE, V_REASON, V_REMARK, STAFFNAME, INTERVIEWEENAME, CREATETIME - - - - delete from TB_CQBYT_VISITOUTINDATA - where id = #{id,jdbcType=INTEGER} - - - insert into TB_CQBYT_VISITOUTINDATA (id, NAME, GENDER, - CARDID, IMAGES, PHONE, - CARNUM, VISITORTYPE, OUTINTYPE, - DEVICETYPE, V_TOTALPEOPLE, V_REASON, - V_REMARK, STAFFNAME, INTERVIEWEENAME, - CREATETIME) - values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, - #{cardid,jdbcType=VARCHAR}, #{images,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, - #{carnum,jdbcType=VARCHAR}, #{visitortype,jdbcType=INTEGER}, #{outintype,jdbcType=INTEGER}, - #{devicetype,jdbcType=INTEGER}, #{vTotalpeople,jdbcType=INTEGER}, #{vReason,jdbcType=VARCHAR}, - #{vRemark,jdbcType=VARCHAR}, #{staffname,jdbcType=VARCHAR}, #{intervieweename,jdbcType=VARCHAR}, - #{createtime,jdbcType=TIMESTAMP}) - - - insert into TB_CQBYT_VISITOUTINDATA - - - id, - - - NAME, - - - GENDER, - - - CARDID, - - - IMAGES, - - - PHONE, - - - CARNUM, - - - VISITORTYPE, - - - OUTINTYPE, - - - DEVICETYPE, - - - V_TOTALPEOPLE, - - - V_REASON, - - - V_REMARK, - - - STAFFNAME, - - - INTERVIEWEENAME, - - - CREATETIME, - - - - - #{id,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{gender,jdbcType=VARCHAR}, - - - #{cardid,jdbcType=VARCHAR}, - - - #{images,jdbcType=VARCHAR}, - - - #{phone,jdbcType=VARCHAR}, - - - #{carnum,jdbcType=VARCHAR}, - - - #{visitortype,jdbcType=INTEGER}, - - - #{outintype,jdbcType=INTEGER}, - - - #{devicetype,jdbcType=INTEGER}, - - - #{vTotalpeople,jdbcType=INTEGER}, - - - #{vReason,jdbcType=VARCHAR}, - - - #{vRemark,jdbcType=VARCHAR}, - - - #{staffname,jdbcType=VARCHAR}, - - - #{intervieweename,jdbcType=VARCHAR}, - - - #{createtime,jdbcType=TIMESTAMP}, - - - - - update TB_CQBYT_VISITOUTINDATA - - - NAME = #{name,jdbcType=VARCHAR}, - - - GENDER = #{gender,jdbcType=VARCHAR}, - - - CARDID = #{cardid,jdbcType=VARCHAR}, - - - IMAGES = #{images,jdbcType=VARCHAR}, - - - PHONE = #{phone,jdbcType=VARCHAR}, - - - CARNUM = #{carnum,jdbcType=VARCHAR}, - - - VISITORTYPE = #{visitortype,jdbcType=INTEGER}, - - - OUTINTYPE = #{outintype,jdbcType=INTEGER}, - - - DEVICETYPE = #{devicetype,jdbcType=INTEGER}, - - - V_TOTALPEOPLE = #{vTotalpeople,jdbcType=INTEGER}, - - - V_REASON = #{vReason,jdbcType=VARCHAR}, - - - V_REMARK = #{vRemark,jdbcType=VARCHAR}, - - - STAFFNAME = #{staffname,jdbcType=VARCHAR}, - - - INTERVIEWEENAME = #{intervieweename,jdbcType=VARCHAR}, - - - CREATETIME = #{createtime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=INTEGER} - - - update TB_CQBYT_VISITOUTINDATA - set NAME = #{name,jdbcType=VARCHAR}, - GENDER = #{gender,jdbcType=VARCHAR}, - CARDID = #{cardid,jdbcType=VARCHAR}, - IMAGES = #{images,jdbcType=VARCHAR}, - PHONE = #{phone,jdbcType=VARCHAR}, - CARNUM = #{carnum,jdbcType=VARCHAR}, - VISITORTYPE = #{visitortype,jdbcType=INTEGER}, - OUTINTYPE = #{outintype,jdbcType=INTEGER}, - DEVICETYPE = #{devicetype,jdbcType=INTEGER}, - V_TOTALPEOPLE = #{vTotalpeople,jdbcType=INTEGER}, - V_REASON = #{vReason,jdbcType=VARCHAR}, - V_REMARK = #{vRemark,jdbcType=VARCHAR}, - STAFFNAME = #{staffname,jdbcType=VARCHAR}, - INTERVIEWEENAME = #{intervieweename,jdbcType=VARCHAR}, - CREATETIME = #{createtime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=INTEGER} - - - - delete from TB_CQBYT_VISITOUTINDATA - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/cqbyt/KpiAnalysisMapper.xml b/src/com/sipai/mapper/cqbyt/KpiAnalysisMapper.xml deleted file mode 100644 index a1ed4ca5..00000000 --- a/src/com/sipai/mapper/cqbyt/KpiAnalysisMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, MPointCode, F_CALCULATIONID, F_ORGID, F_REMARK, F_SOURCEID, unit_id - - - - delete from TB_CQBYT_KPI_Analysis - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_CQBYT_KPI_Analysis (id, MPointCode, F_CALCULATIONID, - F_ORGID, F_REMARK, F_SOURCEID, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{mpointcode,jdbcType=VARCHAR}, #{fCalculationid,jdbcType=VARCHAR}, - #{fOrgid,jdbcType=VARCHAR}, #{fRemark,jdbcType=VARCHAR}, #{fSourceid,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}) - - - insert into TB_CQBYT_KPI_Analysis - - - id, - - - MPointCode, - - - F_CALCULATIONID, - - - F_ORGID, - - - F_REMARK, - - - F_SOURCEID, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpointcode,jdbcType=VARCHAR}, - - - #{fCalculationid,jdbcType=VARCHAR}, - - - #{fOrgid,jdbcType=VARCHAR}, - - - #{fRemark,jdbcType=VARCHAR}, - - - #{fSourceid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update TB_CQBYT_KPI_Analysis - - - MPointCode = #{mpointcode,jdbcType=VARCHAR}, - - - F_CALCULATIONID = #{fCalculationid,jdbcType=VARCHAR}, - - - F_ORGID = #{fOrgid,jdbcType=VARCHAR}, - - - F_REMARK = #{fRemark,jdbcType=VARCHAR}, - - - F_SOURCEID = #{fSourceid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_CQBYT_KPI_Analysis - set MPointCode = #{mpointcode,jdbcType=VARCHAR}, - F_CALCULATIONID = #{fCalculationid,jdbcType=VARCHAR}, - F_ORGID = #{fOrgid,jdbcType=VARCHAR}, - F_REMARK = #{fRemark,jdbcType=VARCHAR}, - F_SOURCEID = #{fSourceid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_CQBYT_KPI_Analysis - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/cqbyt/TestReportDetailsMapper.xml b/src/com/sipai/mapper/cqbyt/TestReportDetailsMapper.xml deleted file mode 100644 index df6e90f1..00000000 --- a/src/com/sipai/mapper/cqbyt/TestReportDetailsMapper.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, sampleCode, itemCode, itemName, itemUnit, dataSource, checkStandardCode, checkStandardName, - itemLimit, originalValue, tempProcessValue, value, specialValue, strategy, logicValue, - companyCode, reserve1, reserve2, reserve3, reserve4 - - - - delete from tb_CQBYT_TestReport_Details - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_CQBYT_TestReport_Details (id, sampleCode, itemCode, - itemName, itemUnit, dataSource, - checkStandardCode, checkStandardName, itemLimit, - originalValue, tempProcessValue, value, - specialValue, strategy, logicValue, - companyCode, reserve1, reserve2, - reserve3, reserve4) - values (#{id,jdbcType=VARCHAR}, #{samplecode,jdbcType=VARCHAR}, #{itemcode,jdbcType=VARCHAR}, - #{itemname,jdbcType=VARCHAR}, #{itemunit,jdbcType=VARCHAR}, #{datasource,jdbcType=INTEGER}, - #{checkstandardcode,jdbcType=VARCHAR}, #{checkstandardname,jdbcType=VARCHAR}, #{itemlimit,jdbcType=VARCHAR}, - #{originalvalue,jdbcType=VARCHAR}, #{tempprocessvalue,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, - #{specialvalue,jdbcType=VARCHAR}, #{strategy,jdbcType=VARCHAR}, #{logicvalue,jdbcType=INTEGER}, - #{companycode,jdbcType=VARCHAR}, #{reserve1,jdbcType=VARCHAR}, #{reserve2,jdbcType=VARCHAR}, - #{reserve3,jdbcType=VARCHAR}, #{reserve4,jdbcType=VARCHAR}) - - - insert into tb_CQBYT_TestReport_Details - - - id, - - - sampleCode, - - - itemCode, - - - itemName, - - - itemUnit, - - - dataSource, - - - checkStandardCode, - - - checkStandardName, - - - itemLimit, - - - originalValue, - - - tempProcessValue, - - - value, - - - specialValue, - - - strategy, - - - logicValue, - - - companyCode, - - - reserve1, - - - reserve2, - - - reserve3, - - - reserve4, - - - - - #{id,jdbcType=VARCHAR}, - - - #{samplecode,jdbcType=VARCHAR}, - - - #{itemcode,jdbcType=VARCHAR}, - - - #{itemname,jdbcType=VARCHAR}, - - - #{itemunit,jdbcType=VARCHAR}, - - - #{datasource,jdbcType=INTEGER}, - - - #{checkstandardcode,jdbcType=VARCHAR}, - - - #{checkstandardname,jdbcType=VARCHAR}, - - - #{itemlimit,jdbcType=VARCHAR}, - - - #{originalvalue,jdbcType=VARCHAR}, - - - #{tempprocessvalue,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{specialvalue,jdbcType=VARCHAR}, - - - #{strategy,jdbcType=VARCHAR}, - - - #{logicvalue,jdbcType=INTEGER}, - - - #{companycode,jdbcType=VARCHAR}, - - - #{reserve1,jdbcType=VARCHAR}, - - - #{reserve2,jdbcType=VARCHAR}, - - - #{reserve3,jdbcType=VARCHAR}, - - - #{reserve4,jdbcType=VARCHAR}, - - - - - update tb_CQBYT_TestReport_Details - - - sampleCode = #{samplecode,jdbcType=VARCHAR}, - - - itemCode = #{itemcode,jdbcType=VARCHAR}, - - - itemName = #{itemname,jdbcType=VARCHAR}, - - - itemUnit = #{itemunit,jdbcType=VARCHAR}, - - - dataSource = #{datasource,jdbcType=INTEGER}, - - - checkStandardCode = #{checkstandardcode,jdbcType=VARCHAR}, - - - checkStandardName = #{checkstandardname,jdbcType=VARCHAR}, - - - itemLimit = #{itemlimit,jdbcType=VARCHAR}, - - - originalValue = #{originalvalue,jdbcType=VARCHAR}, - - - tempProcessValue = #{tempprocessvalue,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - specialValue = #{specialvalue,jdbcType=VARCHAR}, - - - strategy = #{strategy,jdbcType=VARCHAR}, - - - logicValue = #{logicvalue,jdbcType=INTEGER}, - - - companyCode = #{companycode,jdbcType=VARCHAR}, - - - reserve1 = #{reserve1,jdbcType=VARCHAR}, - - - reserve2 = #{reserve2,jdbcType=VARCHAR}, - - - reserve3 = #{reserve3,jdbcType=VARCHAR}, - - - reserve4 = #{reserve4,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_CQBYT_TestReport_Details - set sampleCode = #{samplecode,jdbcType=VARCHAR}, - itemCode = #{itemcode,jdbcType=VARCHAR}, - itemName = #{itemname,jdbcType=VARCHAR}, - itemUnit = #{itemunit,jdbcType=VARCHAR}, - dataSource = #{datasource,jdbcType=INTEGER}, - checkStandardCode = #{checkstandardcode,jdbcType=VARCHAR}, - checkStandardName = #{checkstandardname,jdbcType=VARCHAR}, - itemLimit = #{itemlimit,jdbcType=VARCHAR}, - originalValue = #{originalvalue,jdbcType=VARCHAR}, - tempProcessValue = #{tempprocessvalue,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - specialValue = #{specialvalue,jdbcType=VARCHAR}, - strategy = #{strategy,jdbcType=VARCHAR}, - logicValue = #{logicvalue,jdbcType=INTEGER}, - companyCode = #{companycode,jdbcType=VARCHAR}, - reserve1 = #{reserve1,jdbcType=VARCHAR}, - reserve2 = #{reserve2,jdbcType=VARCHAR}, - reserve3 = #{reserve3,jdbcType=VARCHAR}, - reserve4 = #{reserve4,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_CQBYT_TestReport_Details - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/cqbyt/TestReportMapper.xml b/src/com/sipai/mapper/cqbyt/TestReportMapper.xml deleted file mode 100644 index 37df2438..00000000 --- a/src/com/sipai/mapper/cqbyt/TestReportMapper.xml +++ /dev/null @@ -1,567 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, reportCode, code, name, dataSource, sampleSource, checkPropertyCode, checkPropertyName, - classifyCode, classifyName, evaluateStandardCode, evaluateStandardName, samplePlanCode, - samplePlanName, beCheckedUnitCode, beCheckedUnitName, sampleInstitutionCode, sampleInstitutionName, - sampleAddress, sampleDate, sampleState, sampler, receivingDate, checkDate, checkItems, - checkConclusion, longitude, latitude, companyCode, waterPointCode, waterPointName, - createTime, createMan, tsiStatus, tsiTime, des, reserved1, reserved2, reserved3, - sampleDateStart, sampleDateEnd, tsiTimeStart, tsiTimeEnd, companyName - - - - delete from tb_CQBYT_TestReport - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_CQBYT_TestReport (id, reportCode, code, - name, dataSource, sampleSource, - checkPropertyCode, checkPropertyName, classifyCode, - classifyName, evaluateStandardCode, evaluateStandardName, - samplePlanCode, samplePlanName, beCheckedUnitCode, - beCheckedUnitName, sampleInstitutionCode, - sampleInstitutionName, sampleAddress, sampleDate, - sampleState, sampler, receivingDate, - checkDate, checkItems, checkConclusion, - longitude, latitude, companyCode, - waterPointCode, waterPointName, createTime, - createMan, tsiStatus, tsiTime, - des, reserved1, reserved2, - reserved3, sampleDateStart, sampleDateEnd, - tsiTimeStart, tsiTimeEnd, companyName - ) - values (#{id,jdbcType=VARCHAR}, #{reportcode,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{datasource,jdbcType=INTEGER}, #{samplesource,jdbcType=VARCHAR}, - #{checkpropertycode,jdbcType=VARCHAR}, #{checkpropertyname,jdbcType=VARCHAR}, #{classifycode,jdbcType=VARCHAR}, - #{classifyname,jdbcType=VARCHAR}, #{evaluatestandardcode,jdbcType=VARCHAR}, #{evaluatestandardname,jdbcType=VARCHAR}, - #{sampleplancode,jdbcType=VARCHAR}, #{sampleplanname,jdbcType=VARCHAR}, #{becheckedunitcode,jdbcType=VARCHAR}, - #{becheckedunitname,jdbcType=VARCHAR}, #{sampleinstitutioncode,jdbcType=VARCHAR}, - #{sampleinstitutionname,jdbcType=VARCHAR}, #{sampleaddress,jdbcType=VARCHAR}, #{sampledate,jdbcType=TIMESTAMP}, - #{samplestate,jdbcType=VARCHAR}, #{sampler,jdbcType=VARCHAR}, #{receivingdate,jdbcType=TIMESTAMP}, - #{checkdate,jdbcType=TIMESTAMP}, #{checkitems,jdbcType=VARCHAR}, #{checkconclusion,jdbcType=VARCHAR}, - #{longitude,jdbcType=DOUBLE}, #{latitude,jdbcType=DOUBLE}, #{companycode,jdbcType=VARCHAR}, - #{waterpointcode,jdbcType=VARCHAR}, #{waterpointname,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, - #{createman,jdbcType=VARCHAR}, #{tsistatus,jdbcType=INTEGER}, #{tsitime,jdbcType=TIMESTAMP}, - #{des,jdbcType=VARCHAR}, #{reserved1,jdbcType=VARCHAR}, #{reserved2,jdbcType=VARCHAR}, - #{reserved3,jdbcType=VARCHAR}, #{sampledatestart,jdbcType=VARCHAR}, #{sampledateend,jdbcType=VARCHAR}, - #{tsitimestart,jdbcType=VARCHAR}, #{tsitimeend,jdbcType=VARCHAR}, #{companyname,jdbcType=VARCHAR} - ) - - - insert into tb_CQBYT_TestReport - - - id, - - - reportCode, - - - code, - - - name, - - - dataSource, - - - sampleSource, - - - checkPropertyCode, - - - checkPropertyName, - - - classifyCode, - - - classifyName, - - - evaluateStandardCode, - - - evaluateStandardName, - - - samplePlanCode, - - - samplePlanName, - - - beCheckedUnitCode, - - - beCheckedUnitName, - - - sampleInstitutionCode, - - - sampleInstitutionName, - - - sampleAddress, - - - sampleDate, - - - sampleState, - - - sampler, - - - receivingDate, - - - checkDate, - - - checkItems, - - - checkConclusion, - - - longitude, - - - latitude, - - - companyCode, - - - waterPointCode, - - - waterPointName, - - - createTime, - - - createMan, - - - tsiStatus, - - - tsiTime, - - - des, - - - reserved1, - - - reserved2, - - - reserved3, - - - sampleDateStart, - - - sampleDateEnd, - - - tsiTimeStart, - - - tsiTimeEnd, - - - companyName, - - - - - #{id,jdbcType=VARCHAR}, - - - #{reportcode,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{datasource,jdbcType=INTEGER}, - - - #{samplesource,jdbcType=VARCHAR}, - - - #{checkpropertycode,jdbcType=VARCHAR}, - - - #{checkpropertyname,jdbcType=VARCHAR}, - - - #{classifycode,jdbcType=VARCHAR}, - - - #{classifyname,jdbcType=VARCHAR}, - - - #{evaluatestandardcode,jdbcType=VARCHAR}, - - - #{evaluatestandardname,jdbcType=VARCHAR}, - - - #{sampleplancode,jdbcType=VARCHAR}, - - - #{sampleplanname,jdbcType=VARCHAR}, - - - #{becheckedunitcode,jdbcType=VARCHAR}, - - - #{becheckedunitname,jdbcType=VARCHAR}, - - - #{sampleinstitutioncode,jdbcType=VARCHAR}, - - - #{sampleinstitutionname,jdbcType=VARCHAR}, - - - #{sampleaddress,jdbcType=VARCHAR}, - - - #{sampledate,jdbcType=TIMESTAMP}, - - - #{samplestate,jdbcType=VARCHAR}, - - - #{sampler,jdbcType=VARCHAR}, - - - #{receivingdate,jdbcType=TIMESTAMP}, - - - #{checkdate,jdbcType=TIMESTAMP}, - - - #{checkitems,jdbcType=VARCHAR}, - - - #{checkconclusion,jdbcType=VARCHAR}, - - - #{longitude,jdbcType=DOUBLE}, - - - #{latitude,jdbcType=DOUBLE}, - - - #{companycode,jdbcType=VARCHAR}, - - - #{waterpointcode,jdbcType=VARCHAR}, - - - #{waterpointname,jdbcType=VARCHAR}, - - - #{createtime,jdbcType=TIMESTAMP}, - - - #{createman,jdbcType=VARCHAR}, - - - #{tsistatus,jdbcType=INTEGER}, - - - #{tsitime,jdbcType=TIMESTAMP}, - - - #{des,jdbcType=VARCHAR}, - - - #{reserved1,jdbcType=VARCHAR}, - - - #{reserved2,jdbcType=VARCHAR}, - - - #{reserved3,jdbcType=VARCHAR}, - - - #{sampledatestart,jdbcType=VARCHAR}, - - - #{sampledateend,jdbcType=VARCHAR}, - - - #{tsitimestart,jdbcType=VARCHAR}, - - - #{tsitimeend,jdbcType=VARCHAR}, - - - #{companyname,jdbcType=VARCHAR}, - - - - - update tb_CQBYT_TestReport - - - reportCode = #{reportcode,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - dataSource = #{datasource,jdbcType=INTEGER}, - - - sampleSource = #{samplesource,jdbcType=VARCHAR}, - - - checkPropertyCode = #{checkpropertycode,jdbcType=VARCHAR}, - - - checkPropertyName = #{checkpropertyname,jdbcType=VARCHAR}, - - - classifyCode = #{classifycode,jdbcType=VARCHAR}, - - - classifyName = #{classifyname,jdbcType=VARCHAR}, - - - evaluateStandardCode = #{evaluatestandardcode,jdbcType=VARCHAR}, - - - evaluateStandardName = #{evaluatestandardname,jdbcType=VARCHAR}, - - - samplePlanCode = #{sampleplancode,jdbcType=VARCHAR}, - - - samplePlanName = #{sampleplanname,jdbcType=VARCHAR}, - - - beCheckedUnitCode = #{becheckedunitcode,jdbcType=VARCHAR}, - - - beCheckedUnitName = #{becheckedunitname,jdbcType=VARCHAR}, - - - sampleInstitutionCode = #{sampleinstitutioncode,jdbcType=VARCHAR}, - - - sampleInstitutionName = #{sampleinstitutionname,jdbcType=VARCHAR}, - - - sampleAddress = #{sampleaddress,jdbcType=VARCHAR}, - - - sampleDate = #{sampledate,jdbcType=TIMESTAMP}, - - - sampleState = #{samplestate,jdbcType=VARCHAR}, - - - sampler = #{sampler,jdbcType=VARCHAR}, - - - receivingDate = #{receivingdate,jdbcType=TIMESTAMP}, - - - checkDate = #{checkdate,jdbcType=TIMESTAMP}, - - - checkItems = #{checkitems,jdbcType=VARCHAR}, - - - checkConclusion = #{checkconclusion,jdbcType=VARCHAR}, - - - longitude = #{longitude,jdbcType=DOUBLE}, - - - latitude = #{latitude,jdbcType=DOUBLE}, - - - companyCode = #{companycode,jdbcType=VARCHAR}, - - - waterPointCode = #{waterpointcode,jdbcType=VARCHAR}, - - - waterPointName = #{waterpointname,jdbcType=VARCHAR}, - - - createTime = #{createtime,jdbcType=TIMESTAMP}, - - - createMan = #{createman,jdbcType=VARCHAR}, - - - tsiStatus = #{tsistatus,jdbcType=INTEGER}, - - - tsiTime = #{tsitime,jdbcType=TIMESTAMP}, - - - des = #{des,jdbcType=VARCHAR}, - - - reserved1 = #{reserved1,jdbcType=VARCHAR}, - - - reserved2 = #{reserved2,jdbcType=VARCHAR}, - - - reserved3 = #{reserved3,jdbcType=VARCHAR}, - - - sampleDateStart = #{sampledatestart,jdbcType=VARCHAR}, - - - sampleDateEnd = #{sampledateend,jdbcType=VARCHAR}, - - - tsiTimeStart = #{tsitimestart,jdbcType=VARCHAR}, - - - tsiTimeEnd = #{tsitimeend,jdbcType=VARCHAR}, - - - companyName = #{companyname,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_CQBYT_TestReport - set reportCode = #{reportcode,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - dataSource = #{datasource,jdbcType=INTEGER}, - sampleSource = #{samplesource,jdbcType=VARCHAR}, - checkPropertyCode = #{checkpropertycode,jdbcType=VARCHAR}, - checkPropertyName = #{checkpropertyname,jdbcType=VARCHAR}, - classifyCode = #{classifycode,jdbcType=VARCHAR}, - classifyName = #{classifyname,jdbcType=VARCHAR}, - evaluateStandardCode = #{evaluatestandardcode,jdbcType=VARCHAR}, - evaluateStandardName = #{evaluatestandardname,jdbcType=VARCHAR}, - samplePlanCode = #{sampleplancode,jdbcType=VARCHAR}, - samplePlanName = #{sampleplanname,jdbcType=VARCHAR}, - beCheckedUnitCode = #{becheckedunitcode,jdbcType=VARCHAR}, - beCheckedUnitName = #{becheckedunitname,jdbcType=VARCHAR}, - sampleInstitutionCode = #{sampleinstitutioncode,jdbcType=VARCHAR}, - sampleInstitutionName = #{sampleinstitutionname,jdbcType=VARCHAR}, - sampleAddress = #{sampleaddress,jdbcType=VARCHAR}, - sampleDate = #{sampledate,jdbcType=TIMESTAMP}, - sampleState = #{samplestate,jdbcType=VARCHAR}, - sampler = #{sampler,jdbcType=VARCHAR}, - receivingDate = #{receivingdate,jdbcType=TIMESTAMP}, - checkDate = #{checkdate,jdbcType=TIMESTAMP}, - checkItems = #{checkitems,jdbcType=VARCHAR}, - checkConclusion = #{checkconclusion,jdbcType=VARCHAR}, - longitude = #{longitude,jdbcType=DOUBLE}, - latitude = #{latitude,jdbcType=DOUBLE}, - companyCode = #{companycode,jdbcType=VARCHAR}, - waterPointCode = #{waterpointcode,jdbcType=VARCHAR}, - waterPointName = #{waterpointname,jdbcType=VARCHAR}, - createTime = #{createtime,jdbcType=TIMESTAMP}, - createMan = #{createman,jdbcType=VARCHAR}, - tsiStatus = #{tsistatus,jdbcType=INTEGER}, - tsiTime = #{tsitime,jdbcType=TIMESTAMP}, - des = #{des,jdbcType=VARCHAR}, - reserved1 = #{reserved1,jdbcType=VARCHAR}, - reserved2 = #{reserved2,jdbcType=VARCHAR}, - reserved3 = #{reserved3,jdbcType=VARCHAR}, - sampleDateStart = #{sampledatestart,jdbcType=VARCHAR}, - sampleDateEnd = #{sampledateend,jdbcType=VARCHAR}, - tsiTimeStart = #{tsitimestart,jdbcType=VARCHAR}, - tsiTimeEnd = #{tsitimeend,jdbcType=VARCHAR}, - companyName = #{companyname,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_CQBYT_TestReport - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/cqbyt/YtsjMapper.xml b/src/com/sipai/mapper/cqbyt/YtsjMapper.xml deleted file mode 100644 index 64bc3780..00000000 --- a/src/com/sipai/mapper/cqbyt/YtsjMapper.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into tb_ytsj (Expr1, Expr2, Expr3, - id, insdt, insuser, - account_number, account_name, abbreviation, - address, area, important_level, - remarks, contract_number, contract_order, - name, contract_date, username, - phone, process_section_id, unit_id, - vent_num, permit_num, plane_num, - environment_num, trade, permit, - displacement, standard, city, - society_number, longitude_latitude, attribute, - remark, tstamp, pollutantvalue, - outputname, factorname, valuetype - ) - values (#{expr1,jdbcType=VARCHAR}, #{expr2,jdbcType=INTEGER}, #{expr3,jdbcType=VARCHAR}, - #{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{accountNumber,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, #{abbreviation,jdbcType=VARCHAR}, - #{address,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{importantLevel,jdbcType=VARCHAR}, - #{remarks,jdbcType=VARCHAR}, #{contractNumber,jdbcType=VARCHAR}, #{contractOrder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{contractDate,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, - #{phone,jdbcType=VARCHAR}, #{processSectionId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{ventNum,jdbcType=VARCHAR}, #{permitNum,jdbcType=VARCHAR}, #{planeNum,jdbcType=VARCHAR}, - #{environmentNum,jdbcType=VARCHAR}, #{trade,jdbcType=VARCHAR}, #{permit,jdbcType=VARCHAR}, - #{displacement,jdbcType=INTEGER}, #{standard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, - #{societyNumber,jdbcType=VARCHAR}, #{longitudeLatitude,jdbcType=VARCHAR}, #{attribute,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{tstamp,jdbcType=TIMESTAMP}, #{pollutantvalue,jdbcType=DECIMAL}, - #{outputname,jdbcType=VARCHAR}, #{factorname,jdbcType=VARCHAR}, #{valuetype,jdbcType=VARCHAR} - ) - - - insert into tb_ytsj - - - Expr1, - - - Expr2, - - - Expr3, - - - id, - - - insdt, - - - insuser, - - - account_number, - - - account_name, - - - abbreviation, - - - address, - - - area, - - - important_level, - - - remarks, - - - contract_number, - - - contract_order, - - - name, - - - contract_date, - - - username, - - - phone, - - - process_section_id, - - - unit_id, - - - vent_num, - - - permit_num, - - - plane_num, - - - environment_num, - - - trade, - - - permit, - - - displacement, - - - standard, - - - city, - - - society_number, - - - longitude_latitude, - - - attribute, - - - remark, - - - tstamp, - - - pollutantvalue, - - - outputname, - - - factorname, - - - valuetype, - - - - - #{expr1,jdbcType=VARCHAR}, - - - #{expr2,jdbcType=INTEGER}, - - - #{expr3,jdbcType=VARCHAR}, - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{accountNumber,jdbcType=VARCHAR}, - - - #{accountName,jdbcType=VARCHAR}, - - - #{abbreviation,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{area,jdbcType=VARCHAR}, - - - #{importantLevel,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{contractNumber,jdbcType=VARCHAR}, - - - #{contractOrder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{contractDate,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{phone,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{ventNum,jdbcType=VARCHAR}, - - - #{permitNum,jdbcType=VARCHAR}, - - - #{planeNum,jdbcType=VARCHAR}, - - - #{environmentNum,jdbcType=VARCHAR}, - - - #{trade,jdbcType=VARCHAR}, - - - #{permit,jdbcType=VARCHAR}, - - - #{displacement,jdbcType=INTEGER}, - - - #{standard,jdbcType=VARCHAR}, - - - #{city,jdbcType=VARCHAR}, - - - #{societyNumber,jdbcType=VARCHAR}, - - - #{longitudeLatitude,jdbcType=VARCHAR}, - - - #{attribute,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{tstamp,jdbcType=TIMESTAMP}, - - - #{pollutantvalue,jdbcType=DECIMAL}, - - - #{outputname,jdbcType=VARCHAR}, - - - #{factorname,jdbcType=VARCHAR}, - - - #{valuetype,jdbcType=VARCHAR}, - - - - - - - delete from tb_ytsj - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/CurveMpointMapper.xml b/src/com/sipai/mapper/data/CurveMpointMapper.xml deleted file mode 100644 index e6038ff7..00000000 --- a/src/com/sipai/mapper/data/CurveMpointMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, data_curve_id, mpoint_id, disname, insuser, insdt, morder,func,unit_id - - - - delete from TB_Data_Curve_MPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Data_Curve_MPoint (id, data_curve_id, disname, mpoint_id, - insuser, insdt, morder,func,unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{dataCurveId,jdbcType=VARCHAR}, #{disname,jdbcType=VARCHAR},#{mpointId,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, #{func,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR} - ) - - - insert into TB_Data_Curve_MPoint - - - id, - - - data_curve_id, - - - mpoint_id, - - - disname, - - - insuser, - - - insdt, - - - morder, - - - func, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataCurveId,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - #{disname,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{func,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update TB_Data_Curve_MPoint - - - data_curve_id = #{dataCurveId,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - disname = #{disname,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - func = #{func,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Data_Curve_MPoint - set data_curve_id = #{dataCurveId,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - disname = #{disname,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - func = #{func,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_Data_Curve_MPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/CurveRemarkFileMapper.xml b/src/com/sipai/mapper/data/CurveRemarkFileMapper.xml deleted file mode 100644 index 4ab228d7..00000000 --- a/src/com/sipai/mapper/data/CurveRemarkFileMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, masterid, filename, abspath, filepath, type, size - - - - delete from TB_Data_Curve_Remark_File - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Data_Curve_Remark_File (id, insdt, insuser, - masterid, filename, abspath, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=INTEGER} - ) - - - insert into TB_Data_Curve_Remark_File - - - id, - - - insdt, - - - insuser, - - - masterid, - - - filename, - - - abspath, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=INTEGER}, - - - - - update TB_Data_Curve_Remark_File - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Data_Curve_Remark_File - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_Data_Curve_Remark_File - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/CurveRemarkMapper.xml b/src/com/sipai/mapper/data/CurveRemarkMapper.xml deleted file mode 100644 index 01cc7b18..00000000 --- a/src/com/sipai/mapper/data/CurveRemarkMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, sdt, edt, insuser, insdt, content, mpoint_id - - - - delete from TB_Data_Curve_Remark - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Data_Curve_Remark (id, sdt, edt, - insuser, insdt, content, - mpoint_id) - values (#{id,jdbcType=VARCHAR}, #{sdt,jdbcType=TIMESTAMP}, #{edt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{content,jdbcType=VARCHAR}, - #{mpointId,jdbcType=VARCHAR}) - - - insert into TB_Data_Curve_Remark - - - id, - - - sdt, - - - edt, - - - insuser, - - - insdt, - - - content, - - - mpoint_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{content,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - - - update TB_Data_Curve_Remark - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - content = #{content,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Data_Curve_Remark - set sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - content = #{content,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_Data_Curve_Remark - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataCleaningConditionMapper.xml b/src/com/sipai/mapper/data/DataCleaningConditionMapper.xml deleted file mode 100644 index ac752ba0..00000000 --- a/src/com/sipai/mapper/data/DataCleaningConditionMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - id - , pid, jsType, jsValue, morder - - - - delete - from tb_data_cleaning_condition - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_data_cleaning_condition (id, pid, jsType, - jsValue, morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{jstype,jdbcType=VARCHAR}, - #{jsvalue,jdbcType=DOUBLE}, #{morder,jdbcType=INTEGER}) - - - insert into tb_data_cleaning_condition - - - id, - - - pid, - - - jsType, - - - jsValue, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{jstype,jdbcType=VARCHAR}, - - - #{jsvalue,jdbcType=DOUBLE}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_data_cleaning_condition - - - pid = #{pid,jdbcType=VARCHAR}, - - - jsType = #{jstype,jdbcType=VARCHAR}, - - - jsValue = #{jsvalue,jdbcType=DOUBLE}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_data_cleaning_condition - set pid = #{pid,jdbcType=VARCHAR}, - jsType = #{jstype,jdbcType=VARCHAR}, - jsValue = #{jsvalue,jdbcType=DOUBLE}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_data_cleaning_condition ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataCleaningConfigureMapper.xml b/src/com/sipai/mapper/data/DataCleaningConfigureMapper.xml deleted file mode 100644 index f2f3affb..00000000 --- a/src/com/sipai/mapper/data/DataCleaningConfigureMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - id - , timeRange, replaceType - - - - delete - from tb_data_cleaning_configure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_data_cleaning_configure (id, timeRange, replaceType) - values (#{id,jdbcType=VARCHAR}, #{timerange,jdbcType=VARCHAR}, #{replacetype,jdbcType=VARCHAR}) - - - insert into tb_data_cleaning_configure - - - id, - - - timeRange, - - - replaceType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{timerange,jdbcType=VARCHAR}, - - - #{replacetype,jdbcType=VARCHAR}, - - - - - update tb_data_cleaning_configure - - - timeRange = #{timerange,jdbcType=VARCHAR}, - - - replaceType = #{replacetype,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_data_cleaning_configure - set timeRange = #{timerange,jdbcType=VARCHAR}, - replaceType = #{replacetype,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_data_cleaning_configure ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataCleaningHistoryMapper.xml b/src/com/sipai/mapper/data/DataCleaningHistoryMapper.xml deleted file mode 100644 index 3b72aa57..00000000 --- a/src/com/sipai/mapper/data/DataCleaningHistoryMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, mpid, ParmValue, MeasureDT, ReplaceParmValue, cleaningDt, unitId, type - - - - delete from tb_data_cleaning_history - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_data_cleaning_history (id, mpid, ParmValue, - MeasureDT, ReplaceParmValue, cleaningDt, - unitId, type) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{parmvalue,jdbcType=DECIMAL}, - #{measuredt,jdbcType=TIMESTAMP}, #{replaceparmvalue,jdbcType=DECIMAL}, #{cleaningdt,jdbcType=TIMESTAMP}, - #{unitid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) - - - insert into tb_data_cleaning_history - - - id, - - - mpid, - - - ParmValue, - - - MeasureDT, - - - ReplaceParmValue, - - - cleaningDt, - - - unitId, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{parmvalue,jdbcType=DECIMAL}, - - - #{measuredt,jdbcType=TIMESTAMP}, - - - #{replaceparmvalue,jdbcType=DECIMAL}, - - - #{cleaningdt,jdbcType=TIMESTAMP}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_data_cleaning_history - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - ParmValue = #{parmvalue,jdbcType=DECIMAL}, - - - MeasureDT = #{measuredt,jdbcType=TIMESTAMP}, - - - ReplaceParmValue = #{replaceparmvalue,jdbcType=DECIMAL}, - - - cleaningDt = #{cleaningdt,jdbcType=TIMESTAMP}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_data_cleaning_history - set mpid = #{mpid,jdbcType=VARCHAR}, - ParmValue = #{parmvalue,jdbcType=DECIMAL}, - MeasureDT = #{measuredt,jdbcType=TIMESTAMP}, - ReplaceParmValue = #{replaceparmvalue,jdbcType=DECIMAL}, - cleaningDt = #{cleaningdt,jdbcType=TIMESTAMP}, - unitId = #{unitid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_data_cleaning_history ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataCleaningPointMapper.xml b/src/com/sipai/mapper/data/DataCleaningPointMapper.xml deleted file mode 100644 index e4d9f370..00000000 --- a/src/com/sipai/mapper/data/DataCleaningPointMapper.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - id - , unitId, point, insdt, insuser, timeRange, replaceType - - - - delete - from tb_data_cleaning_point - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_data_cleaning_point (id, unitId, point, - insdt, insuser, timeRange, - replaceType) - values (#{id,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{point,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{timerange,jdbcType=VARCHAR}, - #{replacetype,jdbcType=VARCHAR}) - - - insert into tb_data_cleaning_point - - - id, - - - unitId, - - - point, - - - insdt, - - - insuser, - - - timeRange, - - - replaceType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{point,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{timerange,jdbcType=VARCHAR}, - - - #{replacetype,jdbcType=VARCHAR}, - - - - - update tb_data_cleaning_point - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - point = #{point,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - timeRange = #{timerange,jdbcType=VARCHAR}, - - - replaceType = #{replacetype,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_data_cleaning_point - set unitId = #{unitid,jdbcType=VARCHAR}, - point = #{point,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - timeRange = #{timerange,jdbcType=VARCHAR}, - replaceType = #{replacetype,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_data_cleaning_point ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataCurveMapper.xml b/src/com/sipai/mapper/data/DataCurveMapper.xml deleted file mode 100644 index be604ed7..00000000 --- a/src/com/sipai/mapper/data/DataCurveMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, pid, name, active, type, remark, insuser, insdt, morder, unit_id, curveType, - axisType - - - - delete from TB_Data_Curve - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Data_Curve (id, pid, name, - active, type, remark, - insuser, insdt, morder, - unit_id, curveType, axisType - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{active,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, - #{unitId,jdbcType=VARCHAR}, #{curvetype,jdbcType=VARCHAR}, #{axistype,jdbcType=VARCHAR} - ) - - - insert into TB_Data_Curve - - - id, - - - pid, - - - name, - - - active, - - - type, - - - remark, - - - insuser, - - - insdt, - - - morder, - - - unit_id, - - - curveType, - - - axisType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{curvetype,jdbcType=VARCHAR}, - - - #{axistype,jdbcType=VARCHAR}, - - - - - update TB_Data_Curve - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - curveType = #{curvetype,jdbcType=VARCHAR}, - - - axisType = #{axistype,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Data_Curve - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR}, - curveType = #{curvetype,jdbcType=VARCHAR}, - axisType = #{axistype,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_Data_Curve - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataSourceMapper.xml b/src/com/sipai/mapper/data/DataSourceMapper.xml deleted file mode 100644 index debc6d1b..00000000 --- a/src/com/sipai/mapper/data/DataSourceMapper.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, name, server_type, ip_address, port, username, password, database_name, database_type, - unit_id, scheduled_scan_status, scheduled_scan_minutes, connection_status, last_scan_time, - active - - - - delete from tb_data_source - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_data_source (id ,name, server_type, ip_address, - port, username, password, - database_name, database_type, unit_id, - scheduled_scan_status, scheduled_scan_minutes, - connection_status, last_scan_time, active - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{serverType,jdbcType=VARCHAR}, #{ipAddress,jdbcType=VARCHAR}, - #{port,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, - #{databaseName,jdbcType=VARCHAR}, #{databaseType,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{scheduledScanStatus,jdbcType=INTEGER}, #{scheduledScanMinutes,jdbcType=INTEGER}, - #{connectionStatus,jdbcType=VARCHAR}, #{lastScanTime,jdbcType=TIMESTAMP}, #{active,jdbcType=VARCHAR} - ) - - - insert into tb_data_source - - - id, - - - name, - - - server_type, - - - ip_address, - - - port, - - - username, - - - password, - - - database_name, - - - database_type, - - - unit_id, - - - scheduled_scan_status, - - - scheduled_scan_minutes, - - - connection_status, - - - last_scan_time, - - - active, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{serverType,jdbcType=VARCHAR}, - - - #{ipAddress,jdbcType=VARCHAR}, - - - #{port,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{password,jdbcType=VARCHAR}, - - - #{databaseName,jdbcType=VARCHAR}, - - - #{databaseType,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{scheduledScanStatus,jdbcType=INTEGER}, - - - #{scheduledScanMinutes,jdbcType=INTEGER}, - - - #{connectionStatus,jdbcType=VARCHAR}, - - - #{lastScanTime,jdbcType=TIMESTAMP}, - - - #{active,jdbcType=VARCHAR}, - - - - - update tb_data_source - - - server_type = #{serverType,jdbcType=VARCHAR}, - - - ip_address = #{ipAddress,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - port = #{port,jdbcType=VARCHAR}, - - - username = #{username,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - database_name = #{databaseName,jdbcType=VARCHAR}, - - - database_type = #{databaseType,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - scheduled_scan_status = #{scheduledScanStatus,jdbcType=INTEGER}, - - - scheduled_scan_minutes = #{scheduledScanMinutes,jdbcType=INTEGER}, - - - connection_status = #{connectionStatus,jdbcType=VARCHAR}, - - - last_scan_time = #{lastScanTime,jdbcType=TIMESTAMP}, - - - active = #{active,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_data_source - set name = #{name,jdbcType=VARCHAR}, - server_type = #{serverType,jdbcType=VARCHAR}, - ip_address = #{ipAddress,jdbcType=VARCHAR}, - port = #{port,jdbcType=VARCHAR}, - username = #{username,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - database_name = #{databaseName,jdbcType=VARCHAR}, - database_type = #{databaseType,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - scheduled_scan_status = #{scheduledScanStatus,jdbcType=INTEGER}, - scheduled_scan_minutes = #{scheduledScanMinutes,jdbcType=INTEGER}, - connection_status = #{connectionStatus,jdbcType=VARCHAR}, - last_scan_time = #{lastScanTime,jdbcType=TIMESTAMP}, - active = #{active,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_data_source - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/DataTransConfigMapper.xml b/src/com/sipai/mapper/data/DataTransConfigMapper.xml deleted file mode 100644 index 3006f252..00000000 --- a/src/com/sipai/mapper/data/DataTransConfigMapper.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - id - , modbus_url, register, mpcode - - - insert into TB_data_trans_config (id, modbus_url, register, - mpcode) - values (#{id,jdbcType=VARCHAR}, #{modbusUrl,jdbcType=VARCHAR}, #{register,jdbcType=VARCHAR}, - #{mpcode,jdbcType=VARCHAR}) - - - insert into TB_data_trans_config - - - id, - - - modbus_url, - - - register, - - - mpcode, - - - - - #{id,jdbcType=VARCHAR}, - - - #{modbusUrl,jdbcType=VARCHAR}, - - - #{register,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - - - - - delete from TB_data_trans_config - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/data/XServerMapper.xml b/src/com/sipai/mapper/data/XServerMapper.xml deleted file mode 100644 index d209cd7b..00000000 --- a/src/com/sipai/mapper/data/XServerMapper.xml +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, name, ipaddress, loginname, password, domain, typeid, memo, dbname, dbtype, port, - clsid, bizid, status, startup, driver, lastdate, enddate, flag, timespan, connection_status - - - - delete from TB_PRO_XSERVER - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_PRO_XSERVER (id, name, ipaddress, - loginname, password, domain, - typeid, memo, dbname, - dbtype, port, clsid, - bizid, status, startup, - driver, lastdate, enddate, - flag, timespan, connection_status) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{ipaddress,jdbcType=VARCHAR}, - #{loginname,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{domain,jdbcType=VARCHAR}, - #{typeid,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{dbname,jdbcType=VARCHAR}, - #{dbtype,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}, #{clsid,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{startup,jdbcType=VARCHAR}, - #{driver,jdbcType=VARCHAR}, #{lastdate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP}, - #{flag,jdbcType=VARCHAR}, #{timespan,jdbcType=INTEGER}, #{connectionStatus,jdbcType=VARCHAR}) - - - insert into TB_PRO_XSERVER - - - id, - - - name, - - - ipaddress, - - - loginname, - - - password, - - - domain, - - - typeid, - - - memo, - - - dbname, - - - dbtype, - - - port, - - - clsid, - - - bizid, - - - status, - - - startup, - - - driver, - - - lastdate, - - - enddate, - - - flag, - - - timespan, - - - connection_status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{ipaddress,jdbcType=VARCHAR}, - - - #{loginname,jdbcType=VARCHAR}, - - - #{password,jdbcType=VARCHAR}, - - - #{domain,jdbcType=VARCHAR}, - - - #{typeid,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{dbname,jdbcType=VARCHAR}, - - - #{dbtype,jdbcType=VARCHAR}, - - - #{port,jdbcType=VARCHAR}, - - - #{clsid,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{startup,jdbcType=VARCHAR}, - - - #{driver,jdbcType=VARCHAR}, - - - #{lastdate,jdbcType=TIMESTAMP}, - - - #{enddate,jdbcType=TIMESTAMP}, - - - #{flag,jdbcType=VARCHAR}, - - - #{timespan,jdbcType=INTEGER}, - - - #{connectionStatus,jdbcType=VARCHAR}, - - - - - update TB_PRO_XSERVER - - - name = #{name,jdbcType=VARCHAR}, - - - ipaddress = #{ipaddress,jdbcType=VARCHAR}, - - - loginname = #{loginname,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - domain = #{domain,jdbcType=VARCHAR}, - - - typeid = #{typeid,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - dbname = #{dbname,jdbcType=VARCHAR}, - - - dbtype = #{dbtype,jdbcType=VARCHAR}, - - - port = #{port,jdbcType=VARCHAR}, - - - clsid = #{clsid,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - startup = #{startup,jdbcType=VARCHAR}, - - - driver = #{driver,jdbcType=VARCHAR}, - - - lastdate = #{lastdate,jdbcType=TIMESTAMP}, - - - enddate = #{enddate,jdbcType=TIMESTAMP}, - - - flag = #{flag,jdbcType=VARCHAR}, - - - timespan = #{timespan,jdbcType=INTEGER}, - - - connection_status = #{connectionStatus,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_PRO_XSERVER - set name = #{name,jdbcType=VARCHAR}, - ipaddress = #{ipaddress,jdbcType=VARCHAR}, - loginname = #{loginname,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - domain = #{domain,jdbcType=VARCHAR}, - typeid = #{typeid,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - dbname = #{dbname,jdbcType=VARCHAR}, - dbtype = #{dbtype,jdbcType=VARCHAR}, - port = #{port,jdbcType=VARCHAR}, - clsid = #{clsid,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - startup = #{startup,jdbcType=VARCHAR}, - driver = #{driver,jdbcType=VARCHAR}, - lastdate = #{lastdate,jdbcType=TIMESTAMP}, - enddate = #{enddate,jdbcType=TIMESTAMP}, - flag = #{flag,jdbcType=VARCHAR}, - timespan = #{timespan,jdbcType=INTEGER}, - connection_status = #{connectionStatus,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_PRO_XSERVER - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/digitalProcess/DispatchSheetEntryMapper.xml b/src/com/sipai/mapper/digitalProcess/DispatchSheetEntryMapper.xml deleted file mode 100644 index 811433ae..00000000 --- a/src/com/sipai/mapper/digitalProcess/DispatchSheetEntryMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, recorddt, startdt, enddt, dispatchclass, output, throughput, - remark, exitremark - - - - delete from tb_dispatch_sheet_entry - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_dispatch_sheet_entry (id, insdt, insuser, - recorddt, startdt, enddt, - dispatchclass, output, throughput, - remark, exitremark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{recorddt,jdbcType=TIMESTAMP}, #{startdt,jdbcType=TIMESTAMP}, #{enddt,jdbcType=TIMESTAMP}, - #{dispatchclass,jdbcType=VARCHAR}, #{output,jdbcType=DOUBLE}, #{throughput,jdbcType=DOUBLE}, - #{remark,jdbcType=VARCHAR}, #{exitremark,jdbcType=VARCHAR}) - - - insert into tb_dispatch_sheet_entry - - - id, - - - insdt, - - - insuser, - - - recorddt, - - - startdt, - - - enddt, - - - dispatchclass, - - - output, - - - throughput, - - - remark, - - - exitremark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{recorddt,jdbcType=TIMESTAMP}, - - - #{startdt,jdbcType=TIMESTAMP}, - - - #{enddt,jdbcType=TIMESTAMP}, - - - #{dispatchclass,jdbcType=VARCHAR}, - - - #{output,jdbcType=DOUBLE}, - - - #{throughput,jdbcType=DOUBLE}, - - - #{remark,jdbcType=VARCHAR}, - - - #{exitremark,jdbcType=VARCHAR}, - - - - - update tb_dispatch_sheet_entry - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - recorddt = #{recorddt,jdbcType=TIMESTAMP}, - - - startdt = #{startdt,jdbcType=TIMESTAMP}, - - - enddt = #{enddt,jdbcType=TIMESTAMP}, - - - dispatchclass = #{dispatchclass,jdbcType=VARCHAR}, - - - output = #{output,jdbcType=DOUBLE}, - - - throughput = #{throughput,jdbcType=DOUBLE}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - exitremark = #{exitremark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_dispatch_sheet_entry - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - recorddt = #{recorddt,jdbcType=TIMESTAMP}, - startdt = #{startdt,jdbcType=TIMESTAMP}, - enddt = #{enddt,jdbcType=TIMESTAMP}, - dispatchclass = #{dispatchclass,jdbcType=VARCHAR}, - output = #{output,jdbcType=DOUBLE}, - throughput = #{throughput,jdbcType=DOUBLE}, - remark = #{remark,jdbcType=VARCHAR}, - exitremark = #{exitremark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_dispatch_sheet_entry - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/document/DataMapper.xml b/src/com/sipai/mapper/document/DataMapper.xml deleted file mode 100644 index 159de85a..00000000 --- a/src/com/sipai/mapper/document/DataMapper.xml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, doctype, docname, number, details, insuser, insdt, updateuser, updatedt, memo, path, st, pid, biz_id - - - details - - - - - - - delete from tb_doc_data - ${where} - - - delete from tb_doc_data - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_doc_data (id, doctype, docname, - number, insuser, insdt, - updateuser, updatedt, memo, - path, st, level, pid, biz_id, - details) - values (#{id,jdbcType=VARCHAR}, #{doctype,jdbcType=VARCHAR}, #{docname,jdbcType=VARCHAR}, - #{number,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{updateuser,jdbcType=VARCHAR}, #{updatedt,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}, - #{path,jdbcType=VARCHAR}, #{st,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{details,jdbcType=CLOB}) - - - insert into tb_doc_data - - - id, - - - doctype, - - - docname, - - - number, - - - insuser, - - - insdt, - - - updateuser, - - - updatedt, - - - memo, - - - path, - - - st, - - - level, - - - pid, - - - details, - - - bizId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{doctype,jdbcType=VARCHAR}, - - - #{docname,jdbcType=VARCHAR}, - - - #{number,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{updateuser,jdbcType=VARCHAR}, - - - #{updatedt,jdbcType=TIMESTAMP}, - - - #{memo,jdbcType=VARCHAR}, - - - #{path,jdbcType=VARCHAR}, - - - #{st,jdbcType=VARCHAR}, - - - #{level,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - #{details,jdbcType=CLOB}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update tb_doc_data - - - doctype = #{doctype,jdbcType=VARCHAR}, - - - docname = #{docname,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - updateuser = #{updateuser,jdbcType=VARCHAR}, - - - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - path = #{path,jdbcType=VARCHAR}, - - - st = #{st,jdbcType=VARCHAR}, - - - level = #{level,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - details = #{details,jdbcType=CLOB}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_doc_data - set doctype = #{doctype,jdbcType=VARCHAR}, - docname = #{docname,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - updateuser = #{updateuser,jdbcType=VARCHAR}, - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - memo = #{memo,jdbcType=VARCHAR}, - path = #{path,jdbcType=VARCHAR}, - st = #{st,jdbcType=VARCHAR}, - level = #{level,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - details = #{details,jdbcType=CLOB} - where id = #{id,jdbcType=VARCHAR} - - - update tb_doc_data - set doctype = #{doctype,jdbcType=VARCHAR}, - docname = #{docname,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - updateuser = #{updateuser,jdbcType=VARCHAR}, - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - memo = #{memo,jdbcType=VARCHAR}, - path = #{path,jdbcType=VARCHAR}, - st = #{st,jdbcType=VARCHAR}, - level = #{level,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/document/DocFileMapper.xml b/src/com/sipai/mapper/document/DocFileMapper.xml deleted file mode 100644 index 7996eb98..00000000 --- a/src/com/sipai/mapper/document/DocFileMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id, masterid, filename, abspath, size, insuser, insdt, type - - - - delete from tb_doc_file - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_doc_file - where masterid = #{masterid,jdbcType=VARCHAR} - - - - insert into tb_doc_file (id, masterid, filename, - abspath, size, insuser, - insdt, type) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{size,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}) - - - insert into tb_doc_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - size, - - - insuser, - - - insdt, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{size,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_doc_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_doc_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - size = #{size,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/document/DocFileRelationMapper.xml b/src/com/sipai/mapper/document/DocFileRelationMapper.xml deleted file mode 100644 index 41f45a77..00000000 --- a/src/com/sipai/mapper/document/DocFileRelationMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, doc_id, masterid, type - - - - delete from tb_doc_file_relation - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_doc_file_relation (id, doc_id, masterid, - type) - values (#{id,jdbcType=VARCHAR}, #{docId,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_doc_file_relation - - - id, - - - doc_id, - - - masterid, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{docId,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_doc_file_relation - - - doc_id = #{docId,jdbcType=VARCHAR}, - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_doc_file_relation - set doc_id = #{docId,jdbcType=VARCHAR}, - masterid = #{masterid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_doc_file_relation - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/document/DoctypeMapper.xml b/src/com/sipai/mapper/document/DoctypeMapper.xml deleted file mode 100644 index 504e07f7..00000000 --- a/src/com/sipai/mapper/document/DoctypeMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - id, name, pid, level, insuser, insdt, updateuser, updatedt - - - - delete from tb_doc_doctype - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_doc_doctype (id, name, pid, - level, insuser, insdt, - updateuser, updatedt) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{level,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{updateuser,jdbcType=VARCHAR}, #{updatedt,jdbcType=TIMESTAMP}) - - - insert into tb_doc_doctype - - - id, - - - name, - - - pid, - - - level, - - - insuser, - - - insdt, - - - updateuser, - - - updatedt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{level,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{updateuser,jdbcType=VARCHAR}, - - - #{updatedt,jdbcType=TIMESTAMP}, - - - - - update tb_doc_doctype - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - level = #{level,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - updateuser = #{updateuser,jdbcType=VARCHAR}, - - - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_doc_doctype - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - level = #{level,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - updateuser = #{updateuser,jdbcType=VARCHAR}, - updatedt = #{updatedt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/document/DocumentMapper.xml b/src/com/sipai/mapper/document/DocumentMapper.xml deleted file mode 100644 index a6d4ae79..00000000 --- a/src/com/sipai/mapper/document/DocumentMapper.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - id, w_name, w_content, master_id, insert_user_id, insert_time - - - - delete from tb_document - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_document (id, w_name, w_content, - master_id, insert_user_id, insert_time - ) - values (#{id,jdbcType=VARCHAR}, #{wName,jdbcType=VARCHAR}, #{wContent,jdbcType=VARCHAR}, - #{masterId,jdbcType=VARCHAR}, #{insertUserId,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP} - ) - - - insert into tb_document - - - id, - - - w_name, - - - w_content, - - - master_id, - - - insert_user_id, - - - insert_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{wName,jdbcType=VARCHAR}, - - - #{wContent,jdbcType=VARCHAR}, - - - #{master_id,jdbcType=VARCHAR}, - - - #{insertUserId,jdbcType=VARCHAR}, - - - #{insertTime,jdbcType=TIMESTAMP}, - - - - - update tb_document - - - w_name = #{wName,jdbcType=VARCHAR}, - - - w_content = #{wContent,jdbcType=VARCHAR}, - - - master_id = #{masterId,jdbcType=VARCHAR}, - - - insert_user_id = #{insertUserId,jdbcType=VARCHAR}, - - - insert_time = #{insertTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_document - set w_name = #{wName,jdbcType=VARCHAR}, - w_content = #{wContent,jdbcType=VARCHAR}, - master_id = #{masterId,jdbcType=VARCHAR}, - insert_user_id = #{insertUserId,jdbcType=VARCHAR}, - insert_time = #{insertTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/ConstituteConfigureDetailMapper.xml b/src/com/sipai/mapper/efficiency/ConstituteConfigureDetailMapper.xml deleted file mode 100644 index a70807d1..00000000 --- a/src/com/sipai/mapper/efficiency/ConstituteConfigureDetailMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, pid, mpid, mpname, morder, dsmpid, xlmpid, type - - - - delete from tb_efficiency_constituteConfigureDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_constituteConfigureDetail (id, pid, mpid, - mpname, morder, dsmpid, - xlmpid, type) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{mpname,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{dsmpid,jdbcType=VARCHAR}, - #{xlmpid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) - - - insert into tb_efficiency_constituteConfigureDetail - - - id, - - - pid, - - - mpid, - - - mpname, - - - morder, - - - dsmpid, - - - xlmpid, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{dsmpid,jdbcType=VARCHAR}, - - - #{xlmpid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_efficiency_constituteConfigureDetail - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - dsmpid = #{dsmpid,jdbcType=VARCHAR}, - - - xlmpid = #{xlmpid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_constituteConfigureDetail - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - dsmpid = #{dsmpid,jdbcType=VARCHAR}, - xlmpid = #{xlmpid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_efficiency_constituteConfigureDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/ConstituteConfigureMapper.xml b/src/com/sipai/mapper/efficiency/ConstituteConfigureMapper.xml deleted file mode 100644 index efe7182c..00000000 --- a/src/com/sipai/mapper/efficiency/ConstituteConfigureMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, pid, name, remark, morder, unitId, scheme_id, unit - - - - delete from tb_efficiency_constituteConfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_constituteConfigure (id, pid, name, - remark, morder, unitId, - scheme_id, unit) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{unitid,jdbcType=VARCHAR}, - #{schemeId,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}) - - - insert into tb_efficiency_constituteConfigure - - - id, - - - pid, - - - name, - - - remark, - - - morder, - - - unitId, - - - scheme_id, - - - unit, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{schemeId,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - - - update tb_efficiency_constituteConfigure - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - scheme_id = #{schemeId,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_constituteConfigure - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - unitId = #{unitid,jdbcType=VARCHAR}, - scheme_id = #{schemeId,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_efficiency_constituteConfigure ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/ConstituteConfigureSchemeMapper.xml b/src/com/sipai/mapper/efficiency/ConstituteConfigureSchemeMapper.xml deleted file mode 100644 index 97814b67..00000000 --- a/src/com/sipai/mapper/efficiency/ConstituteConfigureSchemeMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - id, name, morder, unitId - - - - delete from tb_efficiency_constituteConfigure_scheme - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_constituteConfigure_scheme (id, name, morder, - unitId) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{unitid,jdbcType=VARCHAR}) - - - insert into tb_efficiency_constituteConfigure_scheme - - - id, - - - name, - - - morder, - - - unitId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitid,jdbcType=VARCHAR}, - - - - - update tb_efficiency_constituteConfigure_scheme - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_constituteConfigure_scheme - set name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - unitId = #{unitid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_efficiency_constituteConfigure_scheme - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/EfficiencyOverviewConfigureAssemblyMapper.xml b/src/com/sipai/mapper/efficiency/EfficiencyOverviewConfigureAssemblyMapper.xml deleted file mode 100644 index faf737a5..00000000 --- a/src/com/sipai/mapper/efficiency/EfficiencyOverviewConfigureAssemblyMapper.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, unitId, name, morder, type, active, pid, width, height, txtSize, - textcolor, bkcolor, x, y - - - - delete from tb_efficiency_overviewConfigure_assembly - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_overviewConfigure_assembly (id, insuser, insdt, - unitId, name, morder, - type, active, pid, - width, height, txtSize, - textcolor, bkcolor, x, - y) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{unitid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{type,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{width,jdbcType=DOUBLE}, #{height,jdbcType=DOUBLE}, #{txtsize,jdbcType=DOUBLE}, - #{textcolor,jdbcType=VARCHAR}, #{bkcolor,jdbcType=VARCHAR}, #{x,jdbcType=DOUBLE}, - #{y,jdbcType=DOUBLE}) - - - insert into tb_efficiency_overviewConfigure_assembly - - - id, - - - insuser, - - - insdt, - - - unitId, - - - name, - - - morder, - - - type, - - - active, - - - pid, - - - width, - - - height, - - - txtSize, - - - textcolor, - - - bkcolor, - - - x, - - - y, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{width,jdbcType=DOUBLE}, - - - #{height,jdbcType=DOUBLE}, - - - #{txtsize,jdbcType=DOUBLE}, - - - #{textcolor,jdbcType=VARCHAR}, - - - #{bkcolor,jdbcType=VARCHAR}, - - - #{x,jdbcType=DOUBLE}, - - - #{y,jdbcType=DOUBLE}, - - - - - update tb_efficiency_overviewConfigure_assembly - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=DOUBLE}, - - - height = #{height,jdbcType=DOUBLE}, - - - txtSize = #{txtsize,jdbcType=DOUBLE}, - - - textcolor = #{textcolor,jdbcType=VARCHAR}, - - - bkcolor = #{bkcolor,jdbcType=VARCHAR}, - - - x = #{x,jdbcType=DOUBLE}, - - - y = #{y,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_overviewConfigure_assembly - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unitId = #{unitid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - width = #{width,jdbcType=DOUBLE}, - height = #{height,jdbcType=DOUBLE}, - txtSize = #{txtsize,jdbcType=DOUBLE}, - textcolor = #{textcolor,jdbcType=VARCHAR}, - bkcolor = #{bkcolor,jdbcType=VARCHAR}, - x = #{x,jdbcType=DOUBLE}, - y = #{y,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_efficiency_overviewConfigure_assembly - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/EfficiencyOverviewConfigureMapper.xml b/src/com/sipai/mapper/efficiency/EfficiencyOverviewConfigureMapper.xml deleted file mode 100644 index 2d1386cf..00000000 --- a/src/com/sipai/mapper/efficiency/EfficiencyOverviewConfigureMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insuser, insdt, unitId, name, picurl, morder, type, upperLimit, lowerLimit, grade, - colorGroup - - - - delete from tb_efficiency_overviewConfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_overviewConfigure (id, insuser, insdt, - unitId, name, picurl, - morder, type, upperLimit, - lowerLimit, grade, colorGroup - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{unitid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{picurl,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{upperlimit,jdbcType=INTEGER}, - #{lowerlimit,jdbcType=INTEGER}, #{grade,jdbcType=INTEGER}, #{colorgroup,jdbcType=VARCHAR} - ) - - - insert into tb_efficiency_overviewConfigure - - - id, - - - insuser, - - - insdt, - - - unitId, - - - name, - - - picurl, - - - morder, - - - type, - - - upperLimit, - - - lowerLimit, - - - grade, - - - colorGroup, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{picurl,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{upperlimit,jdbcType=INTEGER}, - - - #{lowerlimit,jdbcType=INTEGER}, - - - #{grade,jdbcType=INTEGER}, - - - #{colorgroup,jdbcType=VARCHAR}, - - - - - update tb_efficiency_overviewConfigure - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - picurl = #{picurl,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - upperLimit = #{upperlimit,jdbcType=INTEGER}, - - - lowerLimit = #{lowerlimit,jdbcType=INTEGER}, - - - grade = #{grade,jdbcType=INTEGER}, - - - colorGroup = #{colorgroup,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_overviewConfigure - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unitId = #{unitid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - picurl = #{picurl,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - upperLimit = #{upperlimit,jdbcType=INTEGER}, - lowerLimit = #{lowerlimit,jdbcType=INTEGER}, - grade = #{grade,jdbcType=INTEGER}, - colorGroup = #{colorgroup,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_efficiency_overviewConfigure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/EfficiencyOverviewMpConfigureMapper.xml b/src/com/sipai/mapper/efficiency/EfficiencyOverviewMpConfigureMapper.xml deleted file mode 100644 index b6a52b9e..00000000 --- a/src/com/sipai/mapper/efficiency/EfficiencyOverviewMpConfigureMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, mpid, mpname, x, y, txtSize, textcolor, width, height, bkcolor, picId, morder, - lnglats, assembly, upperLimit, lowerLimit, grade, colorGroup - - - - delete from tb_efficiency_overviewMpConfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_overviewMpConfigure (id, mpid, mpname, - x, y, txtSize, textcolor, - width, height, bkcolor, - picId, morder, lnglats, - assembly, upperLimit, lowerLimit, - grade, colorGroup) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, - #{x,jdbcType=DOUBLE}, #{y,jdbcType=DOUBLE}, #{txtsize,jdbcType=INTEGER}, #{textcolor,jdbcType=VARCHAR}, - #{width,jdbcType=DOUBLE}, #{height,jdbcType=DOUBLE}, #{bkcolor,jdbcType=VARCHAR}, - #{picid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{lnglats,jdbcType=VARCHAR}, - #{assembly,jdbcType=VARCHAR}, #{upperlimit,jdbcType=INTEGER}, #{lowerlimit,jdbcType=INTEGER}, - #{grade,jdbcType=INTEGER}, #{colorgroup,jdbcType=VARCHAR}) - - - insert into tb_efficiency_overviewMpConfigure - - - id, - - - mpid, - - - mpname, - - - x, - - - y, - - - txtSize, - - - textcolor, - - - width, - - - height, - - - bkcolor, - - - picId, - - - morder, - - - lnglats, - - - assembly, - - - upperLimit, - - - lowerLimit, - - - grade, - - - colorGroup, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{x,jdbcType=DOUBLE}, - - - #{y,jdbcType=DOUBLE}, - - - #{txtsize,jdbcType=INTEGER}, - - - #{textcolor,jdbcType=VARCHAR}, - - - #{width,jdbcType=DOUBLE}, - - - #{height,jdbcType=DOUBLE}, - - - #{bkcolor,jdbcType=VARCHAR}, - - - #{picid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{lnglats,jdbcType=VARCHAR}, - - - #{assembly,jdbcType=VARCHAR}, - - - #{upperlimit,jdbcType=INTEGER}, - - - #{lowerlimit,jdbcType=INTEGER}, - - - #{grade,jdbcType=INTEGER}, - - - #{colorgroup,jdbcType=VARCHAR}, - - - - - update tb_efficiency_overviewMpConfigure - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - x = #{x,jdbcType=DOUBLE}, - - - y = #{y,jdbcType=DOUBLE}, - - - txtSize = #{txtsize,jdbcType=INTEGER}, - - - textcolor = #{textcolor,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=DOUBLE}, - - - height = #{height,jdbcType=DOUBLE}, - - - bkcolor = #{bkcolor,jdbcType=VARCHAR}, - - - picId = #{picid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - lnglats = #{lnglats,jdbcType=VARCHAR}, - - - assembly = #{assembly,jdbcType=VARCHAR}, - - - upperLimit = #{upperlimit,jdbcType=INTEGER}, - - - lowerLimit = #{lowerlimit,jdbcType=INTEGER}, - - - grade = #{grade,jdbcType=INTEGER}, - - - colorGroup = #{colorgroup,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_overviewMpConfigure - set mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - x = #{x,jdbcType=DOUBLE}, - y = #{y,jdbcType=DOUBLE}, - txtSize = #{txtsize,jdbcType=INTEGER}, - textcolor = #{textcolor,jdbcType=VARCHAR}, - width = #{width,jdbcType=DOUBLE}, - height = #{height,jdbcType=DOUBLE}, - bkcolor = #{bkcolor,jdbcType=VARCHAR}, - picId = #{picid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - lnglats = #{lnglats,jdbcType=VARCHAR}, - assembly = #{assembly,jdbcType=VARCHAR}, - upperLimit = #{upperlimit,jdbcType=INTEGER}, - lowerLimit = #{lowerlimit,jdbcType=INTEGER}, - grade = #{grade,jdbcType=INTEGER}, - colorGroup = #{colorgroup,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_efficiency_overviewMpConfigure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/EfficiencyStatisticsMapper.xml b/src/com/sipai/mapper/efficiency/EfficiencyStatisticsMapper.xml deleted file mode 100644 index 51c14868..00000000 --- a/src/com/sipai/mapper/efficiency/EfficiencyStatisticsMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, pid, unit_id, insdt, insuser, upsdt, upsuser, morder, mpoint_id - - - - delete from tb_efficiency_statistics - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_statistics (id, name, pid, - unit_id, insdt, insuser, - upsdt, upsuser, morder, - mpoint_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{mpointId,jdbcType=VARCHAR}) - - - insert into tb_efficiency_statistics - - - id, - - - name, - - - pid, - - - unit_id, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - morder, - - - mpoint_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{mpointId,jdbcType=VARCHAR}, - - - - - update tb_efficiency_statistics - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_statistics - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - mpoint_id = #{mpointId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_efficiency_statistics - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/efficiency/WaterSpreadDataConfigureMapper.xml b/src/com/sipai/mapper/efficiency/WaterSpreadDataConfigureMapper.xml deleted file mode 100644 index fa6cd325..00000000 --- a/src/com/sipai/mapper/efficiency/WaterSpreadDataConfigureMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, mpid, mpname, unit_id, morder - - - - delete from tb_efficiency_waterSpreadDataConfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_efficiency_waterSpreadDataConfigure (id, mpid, mpname, - unit_id, morder) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_efficiency_waterSpreadDataConfigure - - - id, - - - mpid, - - - mpname, - - - unit_id, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_efficiency_waterSpreadDataConfigure - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_efficiency_waterSpreadDataConfigure - set mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_efficiency_waterSpreadDataConfigure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/AssetClassMapper.xml b/src/com/sipai/mapper/equipment/AssetClassMapper.xml deleted file mode 100644 index ba30cabb..00000000 --- a/src/com/sipai/mapper/equipment/AssetClassMapper.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, assetClassNumber, assetClassName, depreciableLife, yearDepreciation, - netSalvageRatio, active, remark, belong_code, pid, equipment_belong_id, class_id - - - - delete from TB_AssetClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_AssetClass (id, insdt, insuser, - assetClassNumber, assetClassName, depreciableLife, - yearDepreciation, netSalvageRatio, active, - remark, belong_code, pid, - equipment_belong_id, class_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{assetclassnumber,jdbcType=VARCHAR}, #{assetclassname,jdbcType=VARCHAR}, #{depreciablelife,jdbcType=DOUBLE}, - #{yeardepreciation,jdbcType=DOUBLE}, #{netsalvageratio,jdbcType=DOUBLE}, #{active,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{belongCode,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{equipmentBelongId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}) - - - insert into TB_AssetClass - - - id, - - - insdt, - - - insuser, - - - assetClassNumber, - - - assetClassName, - - - depreciableLife, - - - yearDepreciation, - - - netSalvageRatio, - - - active, - - - remark, - - - belong_code, - - - pid, - - - equipment_belong_id, - - - class_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{assetclassnumber,jdbcType=VARCHAR}, - - - #{assetclassname,jdbcType=VARCHAR}, - - - #{depreciablelife,jdbcType=DOUBLE}, - - - #{yeardepreciation,jdbcType=DOUBLE}, - - - #{netsalvageratio,jdbcType=DOUBLE}, - - - #{active,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{belongCode,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{equipmentBelongId,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - - - update TB_AssetClass - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - assetClassNumber = #{assetclassnumber,jdbcType=VARCHAR}, - - - assetClassName = #{assetclassname,jdbcType=VARCHAR}, - - - depreciableLife = #{depreciablelife,jdbcType=DOUBLE}, - - - yearDepreciation = #{yeardepreciation,jdbcType=DOUBLE}, - - - netSalvageRatio = #{netsalvageratio,jdbcType=DOUBLE}, - - - active = #{active,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - belong_code = #{belongCode,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - equipment_belong_id = #{equipmentBelongId,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_AssetClass - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - assetClassNumber = #{assetclassnumber,jdbcType=VARCHAR}, - assetClassName = #{assetclassname,jdbcType=VARCHAR}, - depreciableLife = #{depreciablelife,jdbcType=DOUBLE}, - yearDepreciation = #{yeardepreciation,jdbcType=DOUBLE}, - netSalvageRatio = #{netsalvageratio,jdbcType=DOUBLE}, - active = #{active,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - belong_code = #{belongCode,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - equipment_belong_id = #{equipmentBelongId,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_AssetClass - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/CharacteristicMapper.xml b/src/com/sipai/mapper/equipment/CharacteristicMapper.xml deleted file mode 100644 index dd4f1b02..00000000 --- a/src/com/sipai/mapper/equipment/CharacteristicMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, equipment_id, characteristic, c_type, memo - - - - delete from TB_EM_Equipment_characteristic - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_characteristic (id, insdt, insuser, - equipment_id, characteristic, c_type, - memo) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{equipmentId,jdbcType=VARCHAR}, #{characteristic,jdbcType=VARCHAR}, #{cType,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_characteristic - - - id, - - - insdt, - - - insuser, - - - equipment_id, - - - characteristic, - - - c_type, - - - memo, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{characteristic,jdbcType=VARCHAR}, - - - #{cType,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_characteristic - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - characteristic = #{characteristic,jdbcType=VARCHAR}, - - - c_type = #{cType,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_characteristic - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - characteristic = #{characteristic,jdbcType=VARCHAR}, - c_type = #{cType,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_Equipment_characteristic - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentAcceptanceApplyDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentAcceptanceApplyDetailMapper.xml deleted file mode 100644 index 05181a29..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentAcceptanceApplyDetailMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, acceptance_apply_number, acceptance_purchase_record_detail_id - - - - delete from TB_EM_Equipment_AcceptanceApplyDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_AcceptanceApplyDetail (id, insdt, insuser, - acceptance_apply_number, acceptance_purchase_record_detail_id - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{acceptanceApplyNumber,jdbcType=VARCHAR}, #{acceptancePurchaseRecordDetailId,jdbcType=VARCHAR} - ) - - - insert into TB_EM_Equipment_AcceptanceApplyDetail - - - id, - - - insdt, - - - insuser, - - - acceptance_apply_number, - - - acceptance_purchase_record_detail_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{acceptanceApplyNumber,jdbcType=VARCHAR}, - - - #{acceptancePurchaseRecordDetailId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_AcceptanceApplyDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - acceptance_apply_number = #{acceptanceApplyNumber,jdbcType=VARCHAR}, - - - acceptance_purchase_record_detail_id = #{acceptancePurchaseRecordDetailId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_AcceptanceApplyDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - acceptance_apply_number = #{acceptanceApplyNumber,jdbcType=VARCHAR}, - acceptance_purchase_record_detail_id = #{acceptancePurchaseRecordDetailId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from TB_EM_Equipment_AcceptanceApplyDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentAcceptanceApplyMapper.xml b/src/com/sipai/mapper/equipment/EquipmentAcceptanceApplyMapper.xml deleted file mode 100644 index ae07b59c..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentAcceptanceApplyMapper.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, warehouse_id, warehouse_name, apply_people_Id, apply_people_name, - apply_time, acceptance_apply_number, processDefId, processId, audit_id, audit_man, - status, remark - - - - delete from TB_EM_Equipment_AcceptanceApply - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_AcceptanceApply (id, insdt, insuser, - biz_id, warehouse_id, warehouse_name, - apply_people_Id, apply_people_name, apply_time, - acceptance_apply_number, processDefId, processId, - audit_id, audit_man, status, - remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, #{warehouseName,jdbcType=VARCHAR}, - #{applyPeopleId,jdbcType=VARCHAR}, #{applyPeopleName,jdbcType=VARCHAR}, #{applyTime,jdbcType=TIMESTAMP}, - #{acceptanceApplyNumber,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{auditId,jdbcType=VARCHAR}, #{auditMan,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_AcceptanceApply - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - warehouse_id, - - - warehouse_name, - - - apply_people_Id, - - - apply_people_name, - - - apply_time, - - - acceptance_apply_number, - - - processDefId, - - - processId, - - - audit_id, - - - audit_man, - - - status, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{warehouseName,jdbcType=VARCHAR}, - - - #{applyPeopleId,jdbcType=VARCHAR}, - - - #{applyPeopleName,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=TIMESTAMP}, - - - #{acceptanceApplyNumber,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - #{auditMan,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_AcceptanceApply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - warehouse_name = #{warehouseName,jdbcType=VARCHAR}, - - - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - - - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - - - acceptance_apply_number = #{acceptanceApplyNumber,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - audit_man = #{auditMan,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_AcceptanceApply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - warehouse_name = #{warehouseName,jdbcType=VARCHAR}, - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - acceptance_apply_number = #{acceptanceApplyNumber,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR}, - audit_man = #{auditMan,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from TB_EM_Equipment_AcceptanceApply - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentAccidentDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentAccidentDetailMapper.xml deleted file mode 100644 index 33d95b2b..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentAccidentDetailMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, insuser, insdt, accident_number, equipment_card_id - - - - delete from TB_EM_Equipment_AccidentDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_AccidentDetail (id, insuser, insdt, - accident_number, equipment_card_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{accidentNumber,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_AccidentDetail - - - id, - - - insuser, - - - insdt, - - - accident_number, - - - equipment_card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{accidentNumber,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_AccidentDetail - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - accident_number = #{accidentNumber,jdbcType=VARCHAR}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_AccidentDetail - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - accident_number = #{accidentNumber,jdbcType=VARCHAR}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete TB_EM_Equipment_AccidentDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentAccidentMapper.xml b/src/com/sipai/mapper/equipment/EquipmentAccidentMapper.xml deleted file mode 100644 index 516eca6f..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentAccidentMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insuser, insdt, biz_id, accident_number, accident_time, accident_place, worker_id, - worker_name, accident_describe, accident_reason - - - - delete from TB_EM_Equipment_Accident - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_Accident (id, insuser, insdt, - biz_id, accident_number, accident_time, - accident_place, worker_id, worker_name, - accident_describe, accident_reason) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{bizId,jdbcType=VARCHAR}, #{accidentNumber,jdbcType=VARCHAR}, #{accidentTime,jdbcType=TIMESTAMP}, - #{accidentPlace,jdbcType=VARCHAR}, #{workerId,jdbcType=VARCHAR}, #{workerName,jdbcType=VARCHAR}, - #{accidentDescribe,jdbcType=VARCHAR}, #{accidentReason,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_Accident - - - id, - - - insuser, - - - insdt, - - - biz_id, - - - accident_number, - - - accident_time, - - - accident_place, - - - worker_id, - - - worker_name, - - - accident_describe, - - - accident_reason, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{accidentNumber,jdbcType=VARCHAR}, - - - #{accidentTime,jdbcType=TIMESTAMP}, - - - #{accidentPlace,jdbcType=VARCHAR}, - - - #{workerId,jdbcType=VARCHAR}, - - - #{workerName,jdbcType=VARCHAR}, - - - #{accidentDescribe,jdbcType=VARCHAR}, - - - #{accidentReason,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_Accident - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - accident_number = #{accidentNumber,jdbcType=VARCHAR}, - - - accident_time = #{accidentTime,jdbcType=TIMESTAMP}, - - - accident_place = #{accidentPlace,jdbcType=VARCHAR}, - - - worker_id = #{workerId,jdbcType=VARCHAR}, - - - worker_name = #{workerName,jdbcType=VARCHAR}, - - - accident_describe = #{accidentDescribe,jdbcType=VARCHAR}, - - - accident_reason = #{accidentReason,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_Accident - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - accident_number = #{accidentNumber,jdbcType=VARCHAR}, - accident_time = #{accidentTime,jdbcType=TIMESTAMP}, - accident_place = #{accidentPlace,jdbcType=VARCHAR}, - worker_id = #{workerId,jdbcType=VARCHAR}, - worker_name = #{workerName,jdbcType=VARCHAR}, - accident_describe = #{accidentDescribe,jdbcType=VARCHAR}, - accident_reason = #{accidentReason,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete TB_EM_Equipment_Accident - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentArrangementMapper.xml b/src/com/sipai/mapper/equipment/EquipmentArrangementMapper.xml deleted file mode 100644 index ee3e37b0..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentArrangementMapper.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - id, workorderid, taskcode, insdt, insuser, equipmentid, arrangementdate, groupManageid, - stdt, enddt - - - - delete from TB_EM_Arrangement - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Arrangement (id, workorderid, taskcode, - insdt, insuser, equipmentid, - arrangementdate, groupManageid, stdt, - enddt) - values (#{id,jdbcType=VARCHAR}, #{workorderid,jdbcType=VARCHAR}, #{taskcode,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{equipmentid,jdbcType=VARCHAR}, - #{arrangementdate,jdbcType=TIMESTAMP}, #{groupManageid,jdbcType=CHAR}, #{stdt,jdbcType=TIMESTAMP}, - #{enddt,jdbcType=TIMESTAMP}) - - - insert into TB_EM_Arrangement - - - id, - - - workorderid, - - - taskcode, - - - insdt, - - - insuser, - - - equipmentid, - - - arrangementdate, - - - groupManageid, - - - stdt, - - - enddt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{workorderid,jdbcType=VARCHAR}, - - - #{taskcode,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{equipmentid,jdbcType=VARCHAR}, - - - #{arrangementdate,jdbcType=TIMESTAMP}, - - - #{groupManageid,jdbcType=CHAR}, - - - #{stdt,jdbcType=TIMESTAMP}, - - - #{enddt,jdbcType=TIMESTAMP}, - - - - - update TB_EM_Arrangement - - - workorderid = #{workorderid,jdbcType=VARCHAR}, - - - taskcode = #{taskcode,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - equipmentid = #{equipmentid,jdbcType=VARCHAR}, - - - arrangementdate = #{arrangementdate,jdbcType=TIMESTAMP}, - - - groupManageid = #{groupManageid,jdbcType=CHAR}, - - - stdt = #{stdt,jdbcType=TIMESTAMP}, - - - enddt = #{enddt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Arrangement - set workorderid = #{workorderid,jdbcType=VARCHAR}, - taskcode = #{taskcode,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - equipmentid = #{equipmentid,jdbcType=VARCHAR}, - arrangementdate = #{arrangementdate,jdbcType=TIMESTAMP}, - groupManageid = #{groupManageid,jdbcType=CHAR}, - stdt = #{stdt,jdbcType=TIMESTAMP}, - enddt = #{enddt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from TB_EM_Arrangement - ${where} - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentBelongMapper.xml b/src/com/sipai/mapper/equipment/EquipmentBelongMapper.xml deleted file mode 100644 index 30b9c53e..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentBelongMapper.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, belong_name, belong_code, remark - - - - delete from tb_em_equipment_belong - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_em_equipment_belong (id, insuser, insdt, - belong_name, belong_code, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{belongName,jdbcType=VARCHAR}, #{belongCode,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into tb_em_equipment_belong - - - id, - - - insuser, - - - insdt, - - - belong_name, - - - belong_code, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{belongName,jdbcType=VARCHAR}, - - - #{belongCode,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_em_equipment_belong - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - belong_name = #{belongName,jdbcType=VARCHAR}, - - - belong_code = #{belongCode,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_em_equipment_belong - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - belong_name = #{belongName,jdbcType=VARCHAR}, - belong_code = #{belongCode,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_em_equipment_belong ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCardCameraMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCardCameraMapper.xml deleted file mode 100644 index a8e2910f..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCardCameraMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, eqId, cameraId, morder - - - - delete from TB_EM_EquipmentCard_Camera - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentCard_Camera (id, eqId, cameraId, - morder) - values (#{id,jdbcType=VARCHAR}, #{eqid,jdbcType=VARCHAR}, #{cameraid,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into TB_EM_EquipmentCard_Camera - - - id, - - - eqId, - - - cameraId, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{eqid,jdbcType=VARCHAR}, - - - #{cameraid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_EM_EquipmentCard_Camera - - - eqId = #{eqid,jdbcType=VARCHAR}, - - - cameraId = #{cameraid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentCard_Camera - set eqId = #{eqid,jdbcType=VARCHAR}, - cameraId = #{cameraid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_EquipmentCard_Camera - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCardLinksMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCardLinksMapper.xml deleted file mode 100644 index 21b4bc49..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCardLinksMapper.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, link_url, link_name, link_type, link_return, remarks, version, - morder, active, bizId, link_ip_intranet, link_ip_extranet, equipment_id - - - - delete from TB_EM_EquipmentCard_Links - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentCard_Links (id, insuser, insdt, - link_url, link_name, link_type, - link_return, remarks, version, - morder, active, bizId, - link_ip_intranet, link_ip_extranet, equipment_id - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{linkUrl,jdbcType=VARCHAR}, #{linkName,jdbcType=VARCHAR}, #{linkType,jdbcType=VARCHAR}, - #{linkReturn,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{active,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, - #{linkIpIntranet,jdbcType=VARCHAR}, #{linkIpExtranet,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR} - ) - - - insert into TB_EM_EquipmentCard_Links - - - id, - - - insuser, - - - insdt, - - - link_url, - - - link_name, - - - link_type, - - - link_return, - - - remarks, - - - version, - - - morder, - - - active, - - - bizId, - - - link_ip_intranet, - - - link_ip_extranet, - - - equipment_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{linkUrl,jdbcType=VARCHAR}, - - - #{linkName,jdbcType=VARCHAR}, - - - #{linkType,jdbcType=VARCHAR}, - - - #{linkReturn,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{linkIpIntranet,jdbcType=VARCHAR}, - - - #{linkIpExtranet,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentCard_Links - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - link_url = #{linkUrl,jdbcType=VARCHAR}, - - - link_name = #{linkName,jdbcType=VARCHAR}, - - - link_type = #{linkType,jdbcType=VARCHAR}, - - - link_return = #{linkReturn,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - bizId = #{bizid,jdbcType=VARCHAR}, - - - link_ip_intranet = #{linkIpIntranet,jdbcType=VARCHAR}, - - - link_ip_extranet = #{linkIpExtranet,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentCard_Links - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - link_url = #{linkUrl,jdbcType=VARCHAR}, - link_name = #{linkName,jdbcType=VARCHAR}, - link_type = #{linkType,jdbcType=VARCHAR}, - link_return = #{linkReturn,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - bizId = #{bizid,jdbcType=VARCHAR}, - link_ip_intranet = #{linkIpIntranet,jdbcType=VARCHAR}, - link_ip_extranet = #{linkIpExtranet,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_EM_EquipmentCard_Links - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCardLinksParameterMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCardLinksParameterMapper.xml deleted file mode 100644 index 9777c257..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCardLinksParameterMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, link_id, parameter, parameter_value, parameter_type, remarks, - version, morder, active, equipment_id, parameter_value_type, dynamic - - - - delete from TB_EM_EquipmentCard_Links_Parameter - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentCard_Links_Parameter (id, insdt, insuser, - link_id, parameter, parameter_value, - parameter_type, remarks, version, - morder, active, equipment_id, - parameter_value_type, dynamic) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{linkId,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR}, #{parameterValue,jdbcType=VARCHAR}, - #{parameterType,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{active,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{parameterValueType,jdbcType=VARCHAR}, #{dynamic,jdbcType=VARCHAR}) - - - insert into TB_EM_EquipmentCard_Links_Parameter - - - id, - - - insdt, - - - insuser, - - - link_id, - - - parameter, - - - parameter_value, - - - parameter_type, - - - remarks, - - - version, - - - morder, - - - active, - - - equipment_id, - - - parameter_value_type, - - - dynamic, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{linkId,jdbcType=VARCHAR}, - - - #{parameter,jdbcType=VARCHAR}, - - - #{parameterValue,jdbcType=VARCHAR}, - - - #{parameterType,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{parameterValueType,jdbcType=VARCHAR}, - - - #{dynamic,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentCard_Links_Parameter - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - link_id = #{linkId,jdbcType=VARCHAR}, - - - parameter = #{parameter,jdbcType=VARCHAR}, - - - parameter_value = #{parameterValue,jdbcType=VARCHAR}, - - - parameter_type = #{parameterType,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - parameter_value_type = #{parameterValueType,jdbcType=VARCHAR}, - - - dynamic = #{dynamic,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentCard_Links_Parameter - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - link_id = #{linkId,jdbcType=VARCHAR}, - parameter = #{parameter,jdbcType=VARCHAR}, - parameter_value = #{parameterValue,jdbcType=VARCHAR}, - parameter_type = #{parameterType,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - parameter_value_type = #{parameterValueType,jdbcType=VARCHAR}, - dynamic = #{dynamic,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_EM_EquipmentCard_Links_Parameter - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCardMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCardMapper.xml deleted file mode 100644 index fa99c3f0..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCardMapper.xml +++ /dev/null @@ -1,1439 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insuser, insdt, equipmentCardID, equipmentName, equipmentClassID, equipmentModel, - areaID, currentManageFlag, processSectionId, assetClassId, assetNumber, equipmentLevelId, - bizId, responsibleDepartment, ratedPower, ratedCurrent, ratedVoltage, supplierId, - equipmentManufacturer, leaveFactoryNumber, productionDate, servicePhone, useDate, - useAge, equipmentValue, residualValue, nowTotalDepreciation, purchaseDate, majorParameter, - maintenanceCondition, pid, totalTime, equipmentStatus, remark, specification, lng, - lat, x_coord, y_coord, water_num_long, water_num_short, equipment_code_id, equipment_belong_id, - equipment_big_class_id, equipment_small_class_id, equipment_level_code, equipment_card_type, - first_time, next_time, check_cycle, cycle_unit, unit, code, in_stock_time, receive_time, - is_single_asset, equipment_dialin_num, add_way, ABC_type, tech_parameters, factory_number, - open_date, service_life, is_compulsory_inspection, compulsory_inspection_type, asset_type, - buy_time, equip_worth, depreciation_life, residual_value_rate, equipment_status_memo, - install_date, equipmentModelName, equipment_out_ids, equipment_set_time, equipment_clear_time, - purchase_value,if_fixed_assets,equ_entry_type, in_code, controlId, powerId, structure_id - - - - - delete - from TB_EM_EquipmentCard - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentCard (id, insuser, insdt, - equipmentCardID, equipmentName, equipmentClassID, - equipmentModel, areaID, currentManageFlag, - processSectionId, assetClassId, assetNumber, - equipmentLevelId, bizId, responsibleDepartment, - ratedPower, ratedCurrent, ratedVoltage, - supplierId, equipmentManufacturer, leaveFactoryNumber, - productionDate, servicePhone, useDate, - useAge, equipmentValue, residualValue, - nowTotalDepreciation, purchaseDate, majorParameter, - maintenanceCondition, pid, totalTime, - equipmentStatus, remark, specification, - lng, lat, x_coord, y_coord, - water_num_long, water_num_short, equipment_code_id, - equipment_belong_id, equipment_big_class_id, - equipment_small_class_id, equipment_level_code, - equipment_card_type, first_time, next_time, - check_cycle, cycle_unit, unit, - code, in_stock_time, receive_time, - is_single_asset, equipment_dialin_num, add_way, - ABC_type, tech_parameters, factory_number, - open_date, service_life, is_compulsory_inspection, - compulsory_inspection_type, asset_type, buy_time, - equip_worth, depreciation_life, residual_value_rate, - equipment_status_memo, install_date, equipmentModelName, - equipment_out_ids, equipment_set_time, equipment_clear_time, - purchase_value, if_fixed_assets, equ_entry_type, in_code,controlId,powerId) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{equipmentcardid,jdbcType=VARCHAR}, #{equipmentname,jdbcType=VARCHAR}, - #{equipmentclassid,jdbcType=VARCHAR}, - #{equipmentmodel,jdbcType=VARCHAR}, #{areaid,jdbcType=VARCHAR}, #{currentmanageflag,jdbcType=VARCHAR}, - #{processsectionid,jdbcType=VARCHAR}, #{assetclassid,jdbcType=VARCHAR}, #{assetnumber,jdbcType=VARCHAR}, - #{equipmentlevelid,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, - #{responsibledepartment,jdbcType=VARCHAR}, - #{ratedpower,jdbcType=DOUBLE}, #{ratedcurrent,jdbcType=DOUBLE}, #{ratedvoltage,jdbcType=DOUBLE}, - #{supplierid,jdbcType=VARCHAR}, #{equipmentmanufacturer,jdbcType=VARCHAR}, - #{leavefactorynumber,jdbcType=VARCHAR}, - #{productiondate,jdbcType=TIMESTAMP}, #{servicephone,jdbcType=VARCHAR}, #{usedate,jdbcType=TIMESTAMP}, - #{useage,jdbcType=DOUBLE}, #{equipmentvalue,jdbcType=DECIMAL}, #{residualvalue,jdbcType=DECIMAL}, - #{nowtotaldepreciation,jdbcType=DECIMAL}, #{purchasedate,jdbcType=TIMESTAMP}, - #{majorparameter,jdbcType=VARCHAR}, - #{maintenancecondition,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{totaltime,jdbcType=DOUBLE}, - #{equipmentstatus,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{specification,jdbcType=VARCHAR}, - #{lng,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, #{xCoord,jdbcType=VARCHAR}, - #{yCoord,jdbcType=VARCHAR}, - #{waterNumLong,jdbcType=VARCHAR}, #{waterNumShort,jdbcType=INTEGER}, - #{equipmentCodeId,jdbcType=VARCHAR}, - #{equipmentBelongId,jdbcType=VARCHAR}, #{equipmentBigClassId,jdbcType=VARCHAR}, - #{equipmentSmallClassId,jdbcType=VARCHAR}, #{equipmentLevelCode,jdbcType=VARCHAR}, - #{equipmentCardType,jdbcType=VARCHAR}, #{firstTime,jdbcType=VARCHAR}, #{nextTime,jdbcType=VARCHAR}, - #{checkCycle,jdbcType=INTEGER}, #{cycleUnit,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{inStockTime,jdbcType=VARCHAR}, #{receiveTime,jdbcType=VARCHAR}, - #{isSingleAsset,jdbcType=INTEGER}, #{equipmentDialinNum,jdbcType=VARCHAR}, #{addWay,jdbcType=VARCHAR}, - #{abcType,jdbcType=VARCHAR}, #{techParameters,jdbcType=VARCHAR}, #{factoryNumber,jdbcType=VARCHAR}, - #{openDate,jdbcType=TIMESTAMP}, #{serviceLife,jdbcType=DOUBLE}, - #{isCompulsoryInspection,jdbcType=INTEGER}, - #{compulsoryInspectionType,jdbcType=VARCHAR}, #{assetType,jdbcType=VARCHAR}, - #{buyTime,jdbcType=TIMESTAMP}, - #{equipWorth,jdbcType=DECIMAL}, #{depreciationLife,jdbcType=DOUBLE}, - #{residualValueRate,jdbcType=DOUBLE}, - #{equipmentStatusMemo,jdbcType=VARCHAR}, #{installDate,jdbcType=TIMESTAMP}, - #{equipmentmodelname,jdbcType=VARCHAR}, - #{equipmentOutIds,jdbcType=VARCHAR}, #{equipmentSetTime,jdbcType=DOUBLE}, - #{equipmentClearTime,jdbcType=DOUBLE}, #{purchaseValue,jdbcType=DECIMAL}, - #{ifFixedAssets,jdbcType=VARCHAR}, #{equEntryType,jdbcType=VARCHAR}, #{inCode,jdbcType=VARCHAR}, - #{controlId,jdbcType=VARCHAR},#{powerId,jdbcType=VARCHAR}) - - - insert into TB_EM_EquipmentCard - - - id, - - - insuser, - - - insdt, - - - equipmentCardID, - - - equipmentName, - - - equipmentClassID, - - - equipmentModel, - - - areaID, - - - currentManageFlag, - - - processSectionId, - - - assetClassId, - - - assetNumber, - - - equipmentLevelId, - - - bizId, - - - responsibleDepartment, - - - ratedPower, - - - ratedCurrent, - - - ratedVoltage, - - - supplierId, - - - equipmentManufacturer, - - - leaveFactoryNumber, - - - productionDate, - - - servicePhone, - - - useDate, - - - useAge, - - - equipmentValue, - - - residualValue, - - - nowTotalDepreciation, - - - purchaseDate, - - - majorParameter, - - - maintenanceCondition, - - - pid, - - - totalTime, - - - equipmentStatus, - - - remark, - - - specification, - - - lng, - - - lat, - - - x_coord, - - - y_coord, - - - water_num_long, - - - water_num_short, - - - equipment_code_id, - - - equipment_belong_id, - - - equipment_big_class_id, - - - equipment_small_class_id, - - - equipment_level_code, - - - equipment_card_type, - - - first_time, - - - next_time, - - - check_cycle, - - - cycle_unit, - - - unit, - - - code, - - - in_stock_time, - - - receive_time, - - - is_single_asset, - - - equipment_dialin_num, - - - add_way, - - - ABC_type, - - - tech_parameters, - - - factory_number, - - - open_date, - - - service_life, - - - is_compulsory_inspection, - - - compulsory_inspection_type, - - - asset_type, - - - buy_time, - - - equip_worth, - - - depreciation_life, - - - residual_value_rate, - - - equipment_status_memo, - - - install_date, - - - equipmentModelName, - - - equipment_out_ids, - - - equipment_set_time, - - - equipment_clear_time, - - - purchase_value, - - - if_fixed_assets, - - - equ_entry_type, - - - in_code, - - - controlId, - - - powerId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{equipmentcardid,jdbcType=VARCHAR}, - - - #{equipmentname,jdbcType=VARCHAR}, - - - #{equipmentclassid,jdbcType=VARCHAR}, - - - #{equipmentmodel,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{currentmanageflag,jdbcType=VARCHAR}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{assetclassid,jdbcType=VARCHAR}, - - - #{assetnumber,jdbcType=VARCHAR}, - - - #{equipmentlevelid,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{responsibledepartment,jdbcType=VARCHAR}, - - - #{ratedpower,jdbcType=DOUBLE}, - - - #{ratedcurrent,jdbcType=DOUBLE}, - - - #{ratedvoltage,jdbcType=DOUBLE}, - - - #{supplierid,jdbcType=VARCHAR}, - - - #{equipmentmanufacturer,jdbcType=VARCHAR}, - - - #{leavefactorynumber,jdbcType=VARCHAR}, - - - #{productiondate,jdbcType=TIMESTAMP}, - - - #{servicephone,jdbcType=VARCHAR}, - - - #{usedate,jdbcType=TIMESTAMP}, - - - #{useage,jdbcType=DOUBLE}, - - - #{equipmentvalue,jdbcType=DECIMAL}, - - - #{residualvalue,jdbcType=DECIMAL}, - - - #{nowtotaldepreciation,jdbcType=DECIMAL}, - - - #{purchasedate,jdbcType=TIMESTAMP}, - - - #{majorparameter,jdbcType=VARCHAR}, - - - #{maintenancecondition,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{totaltime,jdbcType=DOUBLE}, - - - #{equipmentstatus,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{specification,jdbcType=VARCHAR}, - - - #{lng,jdbcType=VARCHAR}, - - - #{lat,jdbcType=VARCHAR}, - - - #{xCoord,jdbcType=VARCHAR}, - - - #{yCoord,jdbcType=VARCHAR}, - - - #{waterNumLong,jdbcType=VARCHAR}, - - - #{waterNumShort,jdbcType=INTEGER}, - - - #{equipmentCodeId,jdbcType=VARCHAR}, - - - #{equipmentBelongId,jdbcType=VARCHAR}, - - - #{equipmentBigClassId,jdbcType=VARCHAR}, - - - #{equipmentSmallClassId,jdbcType=VARCHAR}, - - - #{equipmentLevelCode,jdbcType=VARCHAR}, - - - #{equipmentCardType,jdbcType=VARCHAR}, - - - #{firstTime,jdbcType=VARCHAR}, - - - #{nextTime,jdbcType=VARCHAR}, - - - #{checkCycle,jdbcType=INTEGER}, - - - #{cycleUnit,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{inStockTime,jdbcType=VARCHAR}, - - - #{receiveTime,jdbcType=VARCHAR}, - - - #{isSingleAsset,jdbcType=INTEGER}, - - - #{equipmentDialinNum,jdbcType=VARCHAR}, - - - #{addWay,jdbcType=VARCHAR}, - - - #{abcType,jdbcType=VARCHAR}, - - - #{techParameters,jdbcType=VARCHAR}, - - - #{factoryNumber,jdbcType=VARCHAR}, - - - #{openDate,jdbcType=TIMESTAMP}, - - - #{serviceLife,jdbcType=DOUBLE}, - - - #{isCompulsoryInspection,jdbcType=INTEGER}, - - - #{compulsoryInspectionType,jdbcType=VARCHAR}, - - - #{assetType,jdbcType=VARCHAR}, - - - #{buyTime,jdbcType=TIMESTAMP}, - - - #{equipWorth,jdbcType=DECIMAL}, - - - #{depreciationLife,jdbcType=DOUBLE}, - - - #{residualValueRate,jdbcType=DOUBLE}, - - - #{equipmentStatusMemo,jdbcType=VARCHAR}, - - - #{installDate,jdbcType=TIMESTAMP}, - - - #{equipmentmodelname,jdbcType=VARCHAR}, - - - #{equipmentOutIds,jdbcType=VARCHAR}, - - - #{equipmentSetTime,jdbcType=DOUBLE}, - - - #{equipmentClearTime,jdbcType=DOUBLE}, - - - #{purchaseValue,jdbcType=DECIMAL}, - - - #{ifFixedAssets,jdbcType=VARCHAR}, - - - #{equEntryType,jdbcType=VARCHAR}, - - - #{in_code,jdbcType=VARCHAR}, - - - #{controlId,jdbcType=VARCHAR}, - - - #{powerId,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentCard - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - equipmentCardID = #{equipmentcardid,jdbcType=VARCHAR}, - - - equipmentName = #{equipmentname,jdbcType=VARCHAR}, - - - equipmentClassID = #{equipmentclassid,jdbcType=VARCHAR}, - - - equipmentModel = #{equipmentmodel,jdbcType=VARCHAR}, - - - areaID = #{areaid,jdbcType=VARCHAR}, - - - currentManageFlag = #{currentmanageflag,jdbcType=VARCHAR}, - - - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - - - assetClassId = #{assetclassid,jdbcType=VARCHAR}, - - - assetNumber = #{assetnumber,jdbcType=VARCHAR}, - - - equipmentLevelId = #{equipmentlevelid,jdbcType=VARCHAR}, - - - bizId = #{bizid,jdbcType=VARCHAR}, - - - responsibleDepartment = #{responsibledepartment,jdbcType=VARCHAR}, - - - ratedPower = #{ratedpower,jdbcType=DOUBLE}, - - - ratedCurrent = #{ratedcurrent,jdbcType=DOUBLE}, - - - ratedVoltage = #{ratedvoltage,jdbcType=DOUBLE}, - - - supplierId = #{supplierid,jdbcType=VARCHAR}, - - - equipmentManufacturer = #{equipmentmanufacturer,jdbcType=VARCHAR}, - - - leaveFactoryNumber = #{leavefactorynumber,jdbcType=VARCHAR}, - - - productionDate = #{productiondate,jdbcType=TIMESTAMP}, - - - servicePhone = #{servicephone,jdbcType=VARCHAR}, - - - useDate = #{usedate,jdbcType=TIMESTAMP}, - - - useAge = #{useage,jdbcType=DOUBLE}, - - - equipmentValue = #{equipmentvalue,jdbcType=DECIMAL}, - - - residualValue = #{residualvalue,jdbcType=DECIMAL}, - - - nowTotalDepreciation = #{nowtotaldepreciation,jdbcType=DECIMAL}, - - - purchaseDate = #{purchasedate,jdbcType=TIMESTAMP}, - - - majorParameter = #{majorparameter,jdbcType=VARCHAR}, - - - maintenanceCondition = #{maintenancecondition,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - totalTime = #{totaltime,jdbcType=DOUBLE}, - - - equipmentStatus = #{equipmentstatus,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - specification = #{specification,jdbcType=VARCHAR}, - - - lng = #{lng,jdbcType=VARCHAR}, - - - lat = #{lat,jdbcType=VARCHAR}, - - - x_coord = #{xCoord,jdbcType=VARCHAR}, - - - y_coord = #{yCoord,jdbcType=VARCHAR}, - - - water_num_long = #{waterNumLong,jdbcType=VARCHAR}, - - - water_num_short = #{waterNumShort,jdbcType=INTEGER}, - - - equipment_code_id = #{equipmentCodeId,jdbcType=VARCHAR}, - - - equipment_belong_id = #{equipmentBelongId,jdbcType=VARCHAR}, - - - equipment_big_class_id = #{equipmentBigClassId,jdbcType=VARCHAR}, - - - equipment_small_class_id = #{equipmentSmallClassId,jdbcType=VARCHAR}, - - - equipment_level_code = #{equipmentLevelCode,jdbcType=VARCHAR}, - - - equipment_card_type = #{equipmentCardType,jdbcType=VARCHAR}, - - - first_time = #{firstTime,jdbcType=VARCHAR}, - - - next_time = #{nextTime,jdbcType=VARCHAR}, - - - check_cycle = #{checkCycle,jdbcType=INTEGER}, - - - cycle_unit = #{cycleUnit,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - in_stock_time = #{inStockTime,jdbcType=VARCHAR}, - - - receive_time = #{receiveTime,jdbcType=VARCHAR}, - - - is_single_asset = #{isSingleAsset,jdbcType=INTEGER}, - - - equipment_dialin_num = #{equipmentDialinNum,jdbcType=VARCHAR}, - - - add_way = #{addWay,jdbcType=VARCHAR}, - - - ABC_type = #{abcType,jdbcType=VARCHAR}, - - - tech_parameters = #{techParameters,jdbcType=VARCHAR}, - - - factory_number = #{factoryNumber,jdbcType=VARCHAR}, - - - open_date = #{openDate,jdbcType=TIMESTAMP}, - - - service_life = #{serviceLife,jdbcType=DOUBLE}, - - - is_compulsory_inspection = #{isCompulsoryInspection,jdbcType=INTEGER}, - - - compulsory_inspection_type = #{compulsoryInspectionType,jdbcType=VARCHAR}, - - - asset_type = #{assetType,jdbcType=VARCHAR}, - - - buy_time = #{buyTime,jdbcType=TIMESTAMP}, - - - equip_worth = #{equipWorth,jdbcType=DECIMAL}, - - - depreciation_life = #{depreciationLife,jdbcType=DOUBLE}, - - - residual_value_rate = #{residualValueRate,jdbcType=DOUBLE}, - - - equipment_status_memo = #{equipmentStatusMemo,jdbcType=VARCHAR}, - - - install_date = #{installDate,jdbcType=TIMESTAMP}, - - - equipmentModelName = #{equipmentmodelname,jdbcType=VARCHAR}, - - - equipment_out_ids = #{equipmentOutIds,jdbcType=VARCHAR}, - - - equipment_set_time = #{equipmentSetTime,jdbcType=DOUBLE}, - - - equipment_clear_time = #{equipmentClearTime,jdbcType=DOUBLE}, - - - purchase_value = #{purchaseValue,jdbcType=DECIMAL}, - - - if_fixed_assets = #{ifFixedAssets,jdbcType=VARCHAR}, - - - equ_entry_type = #{equEntryType,jdbcType=VARCHAR}, - - - in_code = #{inCode,jdbcType=VARCHAR}, - - - controlId = #{controlId,jdbcType=VARCHAR}, - - - powerId = #{powerId,jdbcType=VARCHAR}, - - - structure_id = #{structureId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentCard - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - equipmentCardID = #{equipmentcardid,jdbcType=VARCHAR}, - equipmentName = #{equipmentname,jdbcType=VARCHAR}, - equipmentClassID = #{equipmentclassid,jdbcType=VARCHAR}, - equipmentModel = #{equipmentmodel,jdbcType=VARCHAR}, - areaID = #{areaid,jdbcType=VARCHAR}, - currentManageFlag = #{currentmanageflag,jdbcType=VARCHAR}, - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - assetClassId = #{assetclassid,jdbcType=VARCHAR}, - assetNumber = #{assetnumber,jdbcType=VARCHAR}, - equipmentLevelId = #{equipmentlevelid,jdbcType=VARCHAR}, - bizId = #{bizid,jdbcType=VARCHAR}, - responsibleDepartment = #{responsibledepartment,jdbcType=VARCHAR}, - ratedPower = #{ratedpower,jdbcType=DOUBLE}, - ratedCurrent = #{ratedcurrent,jdbcType=DOUBLE}, - ratedVoltage = #{ratedvoltage,jdbcType=DOUBLE}, - supplierId = #{supplierid,jdbcType=VARCHAR}, - equipmentManufacturer = #{equipmentmanufacturer,jdbcType=VARCHAR}, - leaveFactoryNumber = #{leavefactorynumber,jdbcType=VARCHAR}, - productionDate = #{productiondate,jdbcType=TIMESTAMP}, - servicePhone = #{servicephone,jdbcType=VARCHAR}, - useDate = #{usedate,jdbcType=TIMESTAMP}, - useAge = #{useage,jdbcType=DOUBLE}, - equipmentValue = #{equipmentvalue,jdbcType=DECIMAL}, - residualValue = #{residualvalue,jdbcType=DECIMAL}, - nowTotalDepreciation = #{nowtotaldepreciation,jdbcType=DECIMAL}, - purchaseDate = #{purchasedate,jdbcType=TIMESTAMP}, - majorParameter = #{majorparameter,jdbcType=VARCHAR}, - maintenanceCondition = #{maintenancecondition,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - totalTime = #{totaltime,jdbcType=DOUBLE}, - equipmentStatus = #{equipmentstatus,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - specification = #{specification,jdbcType=VARCHAR}, - lng = #{lng,jdbcType=VARCHAR}, - lat = #{lat,jdbcType=VARCHAR}, - x_coord = #{xCoord,jdbcType=VARCHAR}, - y_coord = #{yCoord,jdbcType=VARCHAR}, - water_num_long = #{waterNumLong,jdbcType=VARCHAR}, - water_num_short = #{waterNumShort,jdbcType=INTEGER}, - equipment_code_id = #{equipmentCodeId,jdbcType=VARCHAR}, - equipment_belong_id = #{equipmentBelongId,jdbcType=VARCHAR}, - equipment_big_class_id = #{equipmentBigClassId,jdbcType=VARCHAR}, - equipment_small_class_id = #{equipmentSmallClassId,jdbcType=VARCHAR}, - equipment_level_code = #{equipmentLevelCode,jdbcType=VARCHAR}, - equipment_card_type = #{equipmentCardType,jdbcType=VARCHAR}, - first_time = #{firstTime,jdbcType=VARCHAR}, - next_time = #{nextTime,jdbcType=VARCHAR}, - check_cycle = #{checkCycle,jdbcType=INTEGER}, - cycle_unit = #{cycleUnit,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - in_stock_time = #{inStockTime,jdbcType=VARCHAR}, - receive_time = #{receiveTime,jdbcType=VARCHAR}, - is_single_asset = #{isSingleAsset,jdbcType=INTEGER}, - equipment_dialin_num = #{equipmentDialinNum,jdbcType=VARCHAR}, - add_way = #{addWay,jdbcType=VARCHAR}, - ABC_type = #{abcType,jdbcType=VARCHAR}, - tech_parameters = #{techParameters,jdbcType=VARCHAR}, - factory_number = #{factoryNumber,jdbcType=VARCHAR}, - open_date = #{openDate,jdbcType=TIMESTAMP}, - service_life = #{serviceLife,jdbcType=DOUBLE}, - is_compulsory_inspection = #{isCompulsoryInspection,jdbcType=INTEGER}, - compulsory_inspection_type = #{compulsoryInspectionType,jdbcType=VARCHAR}, - asset_type = #{assetType,jdbcType=VARCHAR}, - buy_time = #{buyTime,jdbcType=TIMESTAMP}, - equip_worth = #{equipWorth,jdbcType=DECIMAL}, - depreciation_life = #{depreciationLife,jdbcType=DOUBLE}, - residual_value_rate = #{residualValueRate,jdbcType=DOUBLE}, - equipment_status_memo = #{equipmentStatusMemo,jdbcType=VARCHAR}, - install_date = #{installDate,jdbcType=TIMESTAMP}, - equipmentModelName = #{equipmentmodelname,jdbcType=VARCHAR}, - equipment_out_ids = #{equipmentOutIds,jdbcType=VARCHAR}, - equipment_set_time = #{equipmentSetTime,jdbcType=DOUBLE}, - equipment_clear_time = #{equipmentClearTime,jdbcType=DOUBLE}, - if_fixed_assets = #{ifFixedAssets,jdbcType=VARCHAR}, - equ_entry_type = #{equEntryType,jdbcType=VARCHAR}, - purchase_value = #{purchaseValue,jdbcType=DECIMAL}, - in_code = #{inCode,jdbcType=DECIMAL}, - controlId = #{controlId,jdbcType=VARCHAR}, - powerId = #{powerId,jdbcType=VARCHAR}, - structure_id = #{structureId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - - - delete - from TB_EM_EquipmentCard ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/com/sipai/mapper/equipment/EquipmentCardPropMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCardPropMapper.xml deleted file mode 100644 index 1498992d..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCardPropMapper.xml +++ /dev/null @@ -1,633 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, equipment_id, energy_money, repair_money, maintain_money, labor_money, - purchase_money, residual_value_rate, use_time, fault_stop_time, install_date, run_time, - repair_number, fault_number, intact_rate, instant_flow, En, output_flow, physical_life, - technical_life, economic_life, maintain_increment, increase_value, residual_value, - month_depreciation_rate, year_depreciation_rate, month_depreciation, year_depreciation, - total_depreciation, current_value, net_salvage_value, is_backup, keynum, specification, - contract_id, estimated_life, card_type_id, bookkeep_voucher, equ_logout_date, if_fixed_assets, - equ_user_department, tax_amount - - - - delete from TB_EM_EquipmentCard_Prop - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentCard_Prop (id, insuser, insdt, - equipment_id, energy_money, repair_money, - maintain_money, labor_money, purchase_money, - residual_value_rate, use_time, fault_stop_time, - install_date, run_time, repair_number, - fault_number, intact_rate, instant_flow, - En, output_flow, physical_life, - technical_life, economic_life, maintain_increment, - increase_value, residual_value, month_depreciation_rate, - year_depreciation_rate, month_depreciation, - year_depreciation, total_depreciation, current_value, - net_salvage_value, is_backup, keynum, - specification, contract_id, estimated_life, - card_type_id, bookkeep_voucher, equ_logout_date, - if_fixed_assets, equ_user_department, tax_amount - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{equipmentId,jdbcType=VARCHAR}, #{energyMoney,jdbcType=DECIMAL}, #{repairMoney,jdbcType=DECIMAL}, - #{maintainMoney,jdbcType=DECIMAL}, #{laborMoney,jdbcType=DECIMAL}, #{purchaseMoney,jdbcType=DECIMAL}, - #{residualValueRate,jdbcType=DOUBLE}, #{useTime,jdbcType=DOUBLE}, #{faultStopTime,jdbcType=DOUBLE}, - #{installDate,jdbcType=TIMESTAMP}, #{runTime,jdbcType=DOUBLE}, #{repairNumber,jdbcType=DOUBLE}, - #{faultNumber,jdbcType=DOUBLE}, #{intactRate,jdbcType=DOUBLE}, #{instantFlow,jdbcType=DOUBLE}, - #{en,jdbcType=DOUBLE}, #{outputFlow,jdbcType=DOUBLE}, #{physicalLife,jdbcType=DOUBLE}, - #{technicalLife,jdbcType=DOUBLE}, #{economicLife,jdbcType=DOUBLE}, #{maintainIncrement,jdbcType=DECIMAL}, - #{increaseValue,jdbcType=DECIMAL}, #{residualValue,jdbcType=DECIMAL}, #{monthDepreciationRate,jdbcType=DOUBLE}, - #{yearDepreciationRate,jdbcType=DOUBLE}, #{monthDepreciation,jdbcType=DECIMAL}, - #{yearDepreciation,jdbcType=DECIMAL}, #{totalDepreciation,jdbcType=DECIMAL}, #{currentValue,jdbcType=DECIMAL}, - #{netSalvageValue,jdbcType=DECIMAL}, #{isBackup,jdbcType=VARCHAR}, #{keynum,jdbcType=INTEGER}, - #{specification,jdbcType=VARCHAR}, #{contractId,jdbcType=VARCHAR}, #{estimatedLife,jdbcType=VARCHAR}, - #{cardTypeId,jdbcType=VARCHAR}, #{bookkeepVoucher,jdbcType=VARCHAR}, #{equLogoutDate,jdbcType=TIMESTAMP}, - #{ifFixedAssets,jdbcType=VARCHAR}, #{equUserDepartment,jdbcType=VARCHAR}, #{taxAmount,jdbcType=VARCHAR} - ) - - - insert into TB_EM_EquipmentCard_Prop - - - id, - - - insuser, - - - insdt, - - - equipment_id, - - - energy_money, - - - repair_money, - - - maintain_money, - - - labor_money, - - - purchase_money, - - - residual_value_rate, - - - use_time, - - - fault_stop_time, - - - install_date, - - - run_time, - - - repair_number, - - - fault_number, - - - intact_rate, - - - instant_flow, - - - En, - - - output_flow, - - - physical_life, - - - technical_life, - - - economic_life, - - - maintain_increment, - - - increase_value, - - - residual_value, - - - month_depreciation_rate, - - - year_depreciation_rate, - - - month_depreciation, - - - year_depreciation, - - - total_depreciation, - - - current_value, - - - net_salvage_value, - - - is_backup, - - - keynum, - - - specification, - - - contract_id, - - - estimated_life, - - - card_type_id, - - - bookkeep_voucher, - - - equ_logout_date, - - - if_fixed_assets, - - - equ_user_department, - - - tax_amount, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{energyMoney,jdbcType=DECIMAL}, - - - #{repairMoney,jdbcType=DECIMAL}, - - - #{maintainMoney,jdbcType=DECIMAL}, - - - #{laborMoney,jdbcType=DECIMAL}, - - - #{purchaseMoney,jdbcType=DECIMAL}, - - - #{residualValueRate,jdbcType=DOUBLE}, - - - #{useTime,jdbcType=DOUBLE}, - - - #{faultStopTime,jdbcType=DOUBLE}, - - - #{installDate,jdbcType=TIMESTAMP}, - - - #{runTime,jdbcType=DOUBLE}, - - - #{repairNumber,jdbcType=DOUBLE}, - - - #{faultNumber,jdbcType=DOUBLE}, - - - #{intactRate,jdbcType=DOUBLE}, - - - #{instantFlow,jdbcType=DOUBLE}, - - - #{en,jdbcType=DOUBLE}, - - - #{outputFlow,jdbcType=DOUBLE}, - - - #{physicalLife,jdbcType=DOUBLE}, - - - #{technicalLife,jdbcType=DOUBLE}, - - - #{economicLife,jdbcType=DOUBLE}, - - - #{maintainIncrement,jdbcType=DECIMAL}, - - - #{increaseValue,jdbcType=DECIMAL}, - - - #{residualValue,jdbcType=DECIMAL}, - - - #{monthDepreciationRate,jdbcType=DOUBLE}, - - - #{yearDepreciationRate,jdbcType=DOUBLE}, - - - #{monthDepreciation,jdbcType=DECIMAL}, - - - #{yearDepreciation,jdbcType=DECIMAL}, - - - #{totalDepreciation,jdbcType=DECIMAL}, - - - #{currentValue,jdbcType=DECIMAL}, - - - #{netSalvageValue,jdbcType=DECIMAL}, - - - #{isBackup,jdbcType=VARCHAR}, - - - #{keynum,jdbcType=INTEGER}, - - - #{specification,jdbcType=VARCHAR}, - - - #{contractId,jdbcType=VARCHAR}, - - - #{estimatedLife,jdbcType=VARCHAR}, - - - #{cardTypeId,jdbcType=VARCHAR}, - - - #{bookkeepVoucher,jdbcType=VARCHAR}, - - - #{equLogoutDate,jdbcType=TIMESTAMP}, - - - #{ifFixedAssets,jdbcType=VARCHAR}, - - - #{equUserDepartment,jdbcType=VARCHAR}, - - - #{taxAmount,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentCard_Prop - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - energy_money = #{energyMoney,jdbcType=DECIMAL}, - - - repair_money = #{repairMoney,jdbcType=DECIMAL}, - - - maintain_money = #{maintainMoney,jdbcType=DECIMAL}, - - - labor_money = #{laborMoney,jdbcType=DECIMAL}, - - - purchase_money = #{purchaseMoney,jdbcType=DECIMAL}, - - - residual_value_rate = #{residualValueRate,jdbcType=DOUBLE}, - - - use_time = #{useTime,jdbcType=DOUBLE}, - - - fault_stop_time = #{faultStopTime,jdbcType=DOUBLE}, - - - install_date = #{installDate,jdbcType=TIMESTAMP}, - - - run_time = #{runTime,jdbcType=DOUBLE}, - - - repair_number = #{repairNumber,jdbcType=DOUBLE}, - - - fault_number = #{faultNumber,jdbcType=DOUBLE}, - - - intact_rate = #{intactRate,jdbcType=DOUBLE}, - - - instant_flow = #{instantFlow,jdbcType=DOUBLE}, - - - En = #{en,jdbcType=DOUBLE}, - - - output_flow = #{outputFlow,jdbcType=DOUBLE}, - - - physical_life = #{physicalLife,jdbcType=DOUBLE}, - - - technical_life = #{technicalLife,jdbcType=DOUBLE}, - - - economic_life = #{economicLife,jdbcType=DOUBLE}, - - - maintain_increment = #{maintainIncrement,jdbcType=DECIMAL}, - - - increase_value = #{increaseValue,jdbcType=DECIMAL}, - - - residual_value = #{residualValue,jdbcType=DECIMAL}, - - - month_depreciation_rate = #{monthDepreciationRate,jdbcType=DOUBLE}, - - - year_depreciation_rate = #{yearDepreciationRate,jdbcType=DOUBLE}, - - - month_depreciation = #{monthDepreciation,jdbcType=DECIMAL}, - - - year_depreciation = #{yearDepreciation,jdbcType=DECIMAL}, - - - total_depreciation = #{totalDepreciation,jdbcType=DECIMAL}, - - - current_value = #{currentValue,jdbcType=DECIMAL}, - - - net_salvage_value = #{netSalvageValue,jdbcType=DECIMAL}, - - - is_backup = #{isBackup,jdbcType=VARCHAR}, - - - keynum = #{keynum,jdbcType=INTEGER}, - - - specification = #{specification,jdbcType=VARCHAR}, - - - contract_id = #{contractId,jdbcType=VARCHAR}, - - - estimated_life = #{estimatedLife,jdbcType=VARCHAR}, - - - card_type_id = #{cardTypeId,jdbcType=VARCHAR}, - - - bookkeep_voucher = #{bookkeepVoucher,jdbcType=VARCHAR}, - - - equ_logout_date = #{equLogoutDate,jdbcType=TIMESTAMP}, - - - if_fixed_assets = #{ifFixedAssets,jdbcType=VARCHAR}, - - - equ_user_department = #{equUserDepartment,jdbcType=VARCHAR}, - - - tax_amount = #{taxAmount,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentCard_Prop - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - energy_money = #{energyMoney,jdbcType=DECIMAL}, - repair_money = #{repairMoney,jdbcType=DECIMAL}, - maintain_money = #{maintainMoney,jdbcType=DECIMAL}, - labor_money = #{laborMoney,jdbcType=DECIMAL}, - purchase_money = #{purchaseMoney,jdbcType=DECIMAL}, - residual_value_rate = #{residualValueRate,jdbcType=DOUBLE}, - use_time = #{useTime,jdbcType=DOUBLE}, - fault_stop_time = #{faultStopTime,jdbcType=DOUBLE}, - install_date = #{installDate,jdbcType=TIMESTAMP}, - run_time = #{runTime,jdbcType=DOUBLE}, - repair_number = #{repairNumber,jdbcType=DOUBLE}, - fault_number = #{faultNumber,jdbcType=DOUBLE}, - intact_rate = #{intactRate,jdbcType=DOUBLE}, - instant_flow = #{instantFlow,jdbcType=DOUBLE}, - En = #{en,jdbcType=DOUBLE}, - output_flow = #{outputFlow,jdbcType=DOUBLE}, - physical_life = #{physicalLife,jdbcType=DOUBLE}, - technical_life = #{technicalLife,jdbcType=DOUBLE}, - economic_life = #{economicLife,jdbcType=DOUBLE}, - maintain_increment = #{maintainIncrement,jdbcType=DECIMAL}, - increase_value = #{increaseValue,jdbcType=DECIMAL}, - residual_value = #{residualValue,jdbcType=DECIMAL}, - month_depreciation_rate = #{monthDepreciationRate,jdbcType=DOUBLE}, - year_depreciation_rate = #{yearDepreciationRate,jdbcType=DOUBLE}, - month_depreciation = #{monthDepreciation,jdbcType=DECIMAL}, - year_depreciation = #{yearDepreciation,jdbcType=DECIMAL}, - total_depreciation = #{totalDepreciation,jdbcType=DECIMAL}, - current_value = #{currentValue,jdbcType=DECIMAL}, - net_salvage_value = #{netSalvageValue,jdbcType=DECIMAL}, - is_backup = #{isBackup,jdbcType=VARCHAR}, - keynum = #{keynum,jdbcType=INTEGER}, - specification = #{specification,jdbcType=VARCHAR}, - contract_id = #{contractId,jdbcType=VARCHAR}, - estimated_life = #{estimatedLife,jdbcType=VARCHAR}, - card_type_id = #{cardTypeId,jdbcType=VARCHAR}, - bookkeep_voucher = #{bookkeepVoucher,jdbcType=VARCHAR}, - equ_logout_date = #{equLogoutDate,jdbcType=TIMESTAMP}, - if_fixed_assets = #{ifFixedAssets,jdbcType=VARCHAR}, - equ_user_department = #{equUserDepartment,jdbcType=VARCHAR}, - tax_amount = #{taxAmount,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_EquipmentCard_Prop - ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCardRemarkMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCardRemarkMapper.xml deleted file mode 100644 index 401acffd..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCardRemarkMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - id, name, content, ins_user, insdt, card_id - - - - - delete from TB_EM_EquipmentCard_Remark - ${where} - - - delete from TB_EM_EquipmentCard_Remark - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentCard_Remark (id, name, content, - ins_user, insdt, card_id - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, - #{insUser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{cardId,jdbcType=VARCHAR} - ) - - - insert into TB_EM_EquipmentCard_Remark - - - id, - - - name, - - - content, - - - ins_user, - - - insdt, - - - card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{insUser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{cardId,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentCard_Remark - - - name = #{name,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - ins_user = #{insUser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - card_id = #{cardId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentCard_Remark - set name = #{name,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - ins_user = #{insUser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - card_id = #{cardId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentClassMapper.xml b/src/com/sipai/mapper/equipment/EquipmentClassMapper.xml deleted file mode 100644 index 0039ee6f..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentClassMapper.xml +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, name, insdt, insuser, remark, unit, active, pid, bizid_id, unit_id, equipment_level_id, - morder, equipment_class_code, equipment_class_code_full, type, asset_class_id - - - - delete from TB_EM_EquipmentClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentClass (id, name, insdt, - insuser, remark, unit, - active, pid, bizid_id, - unit_id, equipment_level_id, morder, - equipment_class_code, equipment_class_code_full, - type, asset_class_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, - #{active,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{bizidId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{equipmentLevelId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{equipmentClassCode,jdbcType=VARCHAR}, #{equipmentClassCodeFull,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{assetClassId,jdbcType=VARCHAR}) - - - insert into TB_EM_EquipmentClass - - - id, - - - name, - - - insdt, - - - insuser, - - - remark, - - - unit, - - - active, - - - pid, - - - bizid_id, - - - unit_id, - - - equipment_level_id, - - - morder, - - - equipment_class_code, - - - equipment_class_code_full, - - - type, - - - asset_class_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{bizidId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{equipmentLevelId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{equipmentClassCode,jdbcType=VARCHAR}, - - - #{equipmentClassCodeFull,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{assetClassId,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentClass - - - name = #{name,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - bizid_id = #{bizidId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - equipment_level_id = #{equipmentLevelId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - equipment_class_code = #{equipmentClassCode,jdbcType=VARCHAR}, - - - equipment_class_code_full = #{equipmentClassCodeFull,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - asset_class_id = #{assetClassId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentClass - set name = #{name,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - bizid_id = #{bizidId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - equipment_level_id = #{equipmentLevelId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - equipment_class_code = #{equipmentClassCode,jdbcType=VARCHAR}, - equipment_class_code_full = #{equipmentClassCodeFull,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - asset_class_id = #{assetClassId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_EM_EquipmentClass - ${where} - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentClassPropMapper.xml b/src/com/sipai/mapper/equipment/EquipmentClassPropMapper.xml deleted file mode 100644 index 1c3a9d6e..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentClassPropMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, equipment_class_id, eco_life_set, eco_life_set_res, maintaince_fee_set, - maintaince_fee_set_res, remark - - - - delete from TB_EM_EquipmentClass_Prop - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentClass_Prop (id, insdt, insuser, - equipment_class_id, eco_life_set, eco_life_set_res, - maintaince_fee_set, maintaince_fee_set_res, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{equipmentClassId,jdbcType=VARCHAR}, #{ecoLifeSet,jdbcType=DOUBLE}, #{ecoLifeSetRes,jdbcType=VARCHAR}, - #{maintainceFeeSet,jdbcType=DOUBLE}, #{maintainceFeeSetRes,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into TB_EM_EquipmentClass_Prop - - - id, - - - insdt, - - - insuser, - - - equipment_class_id, - - - eco_life_set, - - - eco_life_set_res, - - - maintaince_fee_set, - - - maintaince_fee_set_res, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{equipmentClassId,jdbcType=VARCHAR}, - - - #{ecoLifeSet,jdbcType=DOUBLE}, - - - #{ecoLifeSetRes,jdbcType=VARCHAR}, - - - #{maintainceFeeSet,jdbcType=DOUBLE}, - - - #{maintainceFeeSetRes,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentClass_Prop - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - equipment_class_id = #{equipmentClassId,jdbcType=VARCHAR}, - - - eco_life_set = #{ecoLifeSet,jdbcType=DOUBLE}, - - - eco_life_set_res = #{ecoLifeSetRes,jdbcType=VARCHAR}, - - - maintaince_fee_set = #{maintainceFeeSet,jdbcType=DOUBLE}, - - - maintaince_fee_set_res = #{maintainceFeeSetRes,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentClass_Prop - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - equipment_class_id = #{equipmentClassId,jdbcType=VARCHAR}, - eco_life_set = #{ecoLifeSet,jdbcType=DOUBLE}, - eco_life_set_res = #{ecoLifeSetRes,jdbcType=VARCHAR}, - maintaince_fee_set = #{maintainceFeeSet,jdbcType=DOUBLE}, - maintaince_fee_set_res = #{maintainceFeeSetRes,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_EquipmentClass_Prop - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCodeLibraryMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCodeLibraryMapper.xml deleted file mode 100644 index 8ddc9ae4..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCodeLibraryMapper.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, table_name,table_column,field, remark, active - - - - delete from tb_equipment_code_library - where id = #{id,jdbcType=INTEGER} - - - insert into tb_equipment_code_library (id, insdt, insuser, table_name,table_column, - field, remark, active - ) - values (#{id,jdbcType=INTEGER}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{tableName,jdbcType=VARCHAR},#{tableColumn,jdbcType=VARCHAR},#{field,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{active,jdbcType=INTEGER} - ) - - - insert into tb_equipment_code_library - - - id, - - - insdt, - - - insuser, - - - - table_name, - - - - table_column, - - - - field, - - - - remark, - - - active, - - - - - #{id,jdbcType=INTEGER}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - #{tableName,jdbcType=VARCHAR}, - - - - #{tableColumn,jdbcType=VARCHAR}, - - - - #{field,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{active,jdbcType=INTEGER}, - - - - - update tb_equipment_code_library - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - - table_name = #{tableName,jdbcType=VARCHAR}, - - - - table_column = #{tableColumn,jdbcType=VARCHAR}, - - - - field = #{field,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=INTEGER} - - - update tb_equipment_code_library - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - table_name = #{tableName,jdbcType=VARCHAR}, - table_column = #{tableColumn,jdbcType=VARCHAR}, - field = #{field,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - active = #{active,jdbcType=INTEGER} - where id = #{id,jdbcType=INTEGER} - - - - - - - delete from tb_equipment_code_library ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCodeMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCodeMapper.xml deleted file mode 100644 index f0e33501..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCodeMapper.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - id, insdt, insuser, code_rule,water_num_len,active - - - - delete from tb_em_equipment_code - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_em_equipment_code (id, insdt, insuser, - code_rule, water_num_len,active) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{codeRule,jdbcType=VARCHAR},#{waterNumLen,jdbcType=INTEGER}, #{active,jdbcType=INTEGER}) - - - insert into tb_em_equipment_code - - - id, - - - insdt, - - - insuser, - - - code_rule, - - - water_num_len, - - - active, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{codeRule,jdbcType=VARCHAR}, - - - #{waterNumLen,jdbcType=VARCHAR}, - - - #{active,jdbcType=INTEGER}, - - - - - update tb_em_equipment_code - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - code_rule = #{codeRule,jdbcType=VARCHAR}, - - - water_num_len = #{waterNumLen,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_em_equipment_code - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - code_rule = #{codeRule,jdbcType=VARCHAR}, - water_num_len = #{waterNumLen,jdbcType=VARCHAR}, - active = #{active,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_em_equipment_code ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentCodeRuleMapper.xml b/src/com/sipai/mapper/equipment/EquipmentCodeRuleMapper.xml deleted file mode 100644 index f26d93ba..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentCodeRuleMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser,alias_name ,code_name,table_name,table_column ,code_field, code_num, morder,type - - - - delete from tb_equipment_code_rule - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_code_rule (id, insdt, insuser, alias_name, - code_name, table_name,table_column,code_field, code_num, - morder,type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{aliasName,jdbcType=VARCHAR},#{codeName,jdbcType=VARCHAR},#{tableName,jdbcType=VARCHAR}, - #{tableColumn,jdbcType=VARCHAR},#{codeField,jdbcType=VARCHAR}, - #{codeNum,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER},#{type,jdbcType=INTEGER}) - - - insert into tb_equipment_code_rule - - - id, - - - insdt, - - - insuser, - - - - alias_name, - - - - code_name, - - - - table_name, - - - - table_column, - - - - code_field, - - - - code_num, - - - morder, - - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - #{aliasName,jdbcType=VARCHAR}, - - - - #{codeName,jdbcType=VARCHAR}, - - - - #{tableName,jdbcType=VARCHAR}, - - - - #{tableColumn,jdbcType=VARCHAR}, - - - - #{codeField,jdbcType=VARCHAR}, - - - - #{codeNum,jdbcType=INTEGER}, - - - - #{morder,jdbcType=INTEGER}, - - - - #{type,jdbcType=INTEGER}, - - - - - - update tb_equipment_code_rule - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - - alias_name=#{aliasName,jdbcType=VARCHAR}, - - - - code_name = #{codeName,jdbcType=VARCHAR}, - - - - table_name = #{tableName,jdbcType=VARCHAR}, - - - - table_column = #{tableColumn,jdbcType=VARCHAR}, - - - - code_field = #{codeField,jdbcType=VARCHAR}, - - - code_num = #{codeNum,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - - type = #{type,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_code_rule - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - alias_name = #{aliasName,jdbcType=VARCHAR}, - code_name = #{codeName,jdbcType=VARCHAR}, - table_name = #{tableName,jdbcType=VARCHAR}, - table_column = #{tableColumn,jdbcType=VARCHAR}, - code_field = #{codeField,jdbcType=VARCHAR}, - code_num = #{codeNum,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=INTEGER}, - where id = #{id,jdbcType=VARCHAR} - - - - - - - delete from tb_equipment_code_rule ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentDialinMapper.xml b/src/com/sipai/mapper/equipment/EquipmentDialinMapper.xml deleted file mode 100644 index fed82260..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentDialinMapper.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, dialin_com_id, apply_time, dialin_id, accept_id, remark, doc_path,warehouse_id - - - - delete from tb_em_equipment_dialin - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_em_equipment_dialin (id, insdt, insuser, - dialin_com_id, apply_time, dialin_id, - accept_id, remark, doc_path, doc_path,warehouse_id - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{dialinComId,jdbcType=VARCHAR}, #{applyTime,jdbcType=VARCHAR}, #{dialinId,jdbcType=VARCHAR}, - #{acceptId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{docPath,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR} - ) - - - insert into tb_em_equipment_dialin - - - id, - - - insdt, - - - insuser, - - - dialin_com_id, - - - apply_time, - - - dialin_id, - - - accept_id, - - - remark, - - - doc_path, - - - - warehouse_id, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{dialinComId,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=VARCHAR}, - - - #{dialinId,jdbcType=VARCHAR}, - - - #{acceptId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{docPath,jdbcType=VARCHAR}, - - - - #{warehouseId,jdbcType=VARCHAR}, - - - - - update tb_em_equipment_dialin - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - dialin_com_id = #{dialinComId,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=VARCHAR}, - - - dialin_id = #{dialinId,jdbcType=VARCHAR}, - - - accept_id = #{acceptId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - doc_path = #{docPath,jdbcType=VARCHAR}, - - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_em_equipment_dialin - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - dialin_com_id = #{dialinComId,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=VARCHAR}, - dialin_id = #{dialinId,jdbcType=VARCHAR}, - accept_id = #{acceptId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - doc_path = #{docPath,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete tb_em_equipment_dialin ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentFileMapper.xml b/src/com/sipai/mapper/equipment/EquipmentFileMapper.xml deleted file mode 100644 index 2035001f..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentFileMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - id, insdt, insuser, equipment_id, file_id, remark - - - - delete from TB_Equipment_File - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Equipment_File (id, insdt, insuser, - equipment_id, file_id, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{equipmentId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into TB_Equipment_File - - - id, - - - insdt, - - - insuser, - - - equipment_id, - - - file_id, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{fileId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_Equipment_File - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - file_id = #{fileId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Equipment_File - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - file_id = #{fileId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Equipment_File - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentFittingsMapper.xml b/src/com/sipai/mapper/equipment/EquipmentFittingsMapper.xml deleted file mode 100644 index d046b9a6..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentFittingsMapper.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, equipment_id, goods_id, type, pid, insdt, insuser, upsdt, upsuser,equipment_or_facility - - - - delete from TB_Equipment_Fittings - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Equipment_Fittings (id, equipment_id, goods_id, type, pid, - insdt, insuser, upsdt, - upsuser,equipment_or_facility) - values (#{id,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=VARCHAR}, - #{upsuser,jdbcType=VARCHAR}, #{equipmentOrFacility,jdbcType=VARCHAR}) - - - insert into TB_Equipment_Fittings - - - id, - - - equipment_id, - - - goods_id, - - - type, - - - pid, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - equipment_or_facility, - - - - - #{id,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=VARCHAR}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{equipmentOrFacility,jdbcType=VARCHAR}, - - - - - update TB_Equipment_Fittings - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=VARCHAR}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - equipment_or_facility = #{equipmentOrFacility,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Equipment_Fittings - set equipment_id = #{equipmentId,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=VARCHAR}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - equipment_or_facility = #{equipmentOrFacility,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Equipment_Fittings - ${where} - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentIncreaseValueMapper.xml b/src/com/sipai/mapper/equipment/EquipmentIncreaseValueMapper.xml deleted file mode 100644 index fff78ed6..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentIncreaseValueMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, equipment_id, increase_value, insdt, insuser, remark, biz_id - - - - delete from TB_EM_Equipment_IncreaseValue - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_IncreaseValue (id, equipment_id, increase_value, - insdt, insuser, remark, - biz_id) - values (#{id,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{increaseValue,jdbcType=DECIMAL}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_IncreaseValue - - - id, - - - equipment_id, - - - increase_value, - - - insdt, - - - insuser, - - - remark, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{increaseValue,jdbcType=DECIMAL}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_IncreaseValue - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - increase_value = #{increaseValue,jdbcType=DECIMAL}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_IncreaseValue - set equipment_id = #{equipmentId,jdbcType=VARCHAR}, - increase_value = #{increaseValue,jdbcType=DECIMAL}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_Equipment_IncreaseValue - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentLevelMapper.xml b/src/com/sipai/mapper/equipment/EquipmentLevelMapper.xml deleted file mode 100644 index 5a760534..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentLevelMapper.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, levelName, active, remark,equipment_level_code - - - - delete from TB_EM_EquipmentLevel - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentLevel (id, insdt, insuser, - levelName, active, remark,equipment_level_code - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{levelname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{equipmentLevelCode,jdbcType=VARCHAR} - ) - - - insert into TB_EM_EquipmentLevel - - - id, - - - insdt, - - - insuser, - - - levelName, - - - active, - - - remark, - - - equipment_level_code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{levelname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{equipmentLevelCode,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentLevel - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - levelName = #{levelname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - equipment_level_code = #{equipmentLevelCode,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentLevel - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - levelName = #{levelname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - equipment_level_code = #{equipmentLevelCode,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_EquipmentLevel - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentLoseApplyDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentLoseApplyDetailMapper.xml deleted file mode 100644 index 84524f7b..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentLoseApplyDetailMapper.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, lose_apply_number, equipment_card_id - - - - delete from TB_EM_Equipment_LoseApplyDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_LoseApplyDetail (id, insdt, insuser, - lose_apply_number, equipment_card_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{loseApplyNumber,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_LoseApplyDetail - - - id, - - - insdt, - - - insuser, - - - lose_apply_number, - - - equipment_card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{loseApplyNumber,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_LoseApplyDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - lose_apply_number = #{loseApplyNumber,jdbcType=VARCHAR}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_LoseApplyDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - lose_apply_number = #{loseApplyNumber,jdbcType=VARCHAR}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from TB_EM_Equipment_LoseApplyDetail - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentLoseApplyMapper.xml b/src/com/sipai/mapper/equipment/EquipmentLoseApplyMapper.xml deleted file mode 100644 index ac7d73b9..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentLoseApplyMapper.xml +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, work_process_name, send_to_biz_id, send_to_biz_name, - equipment_id, equipment_name, equipment_model, equipment_model_name, assets_code, - dept_id, dept_name, number, unit, apply_people_Id, apply_people_name, remark, file_path, - lose_instr, apply_time,lose_apply_number,audit_man,audit_id,processDefId,processId,total_money, status - - - - delete from TB_EM_Equipment_LoseApply - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_LoseApply (id, insdt, insuser, - biz_id, work_process_name, send_to_biz_id, - send_to_biz_name, equipment_id, equipment_name, - equipment_model, equipment_model_name, assets_code, - dept_id, dept_name, number, - unit, apply_people_Id, apply_people_name, - remark, file_path, lose_instr, - apply_time,lose_apply_number,audit_man,audit_id,processDefId,processId,total_money, status) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{workProcessName,jdbcType=VARCHAR}, #{sendToBizId,jdbcType=VARCHAR}, - #{sendToBizName,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{equipmentName,jdbcType=VARCHAR}, - #{equipmentModel,jdbcType=VARCHAR}, #{equipmentModelName,jdbcType=VARCHAR}, #{assetsCode,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, #{deptName,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER}, - #{unit,jdbcType=VARCHAR}, #{applyPeopleId,jdbcType=VARCHAR}, #{applyPeopleName,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{loseInstr,jdbcType=VARCHAR}, - #{applyTime,jdbcType=TIMESTAMP}, - #{loseApplyNumber,jdbcType=VARCHAR}, - #{auditMan,jdbcType=VARCHAR}, - #{auditId,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=DECIMAL}, - #{status,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_LoseApply - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - work_process_name, - - - send_to_biz_id, - - - send_to_biz_name, - - - equipment_id, - - - equipment_name, - - - equipment_model, - - - equipment_model_name, - - - assets_code, - - - dept_id, - - - dept_name, - - - number, - - - unit, - - - apply_people_Id, - - - apply_people_name, - - - remark, - - - file_path, - - - lose_instr, - - - apply_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{workProcessName,jdbcType=VARCHAR}, - - - #{sendToBizId,jdbcType=VARCHAR}, - - - #{sendToBizName,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{equipmentName,jdbcType=VARCHAR}, - - - #{equipmentModel,jdbcType=VARCHAR}, - - - #{equipmentModelName,jdbcType=VARCHAR}, - - - #{assetsCode,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{deptName,jdbcType=VARCHAR}, - - - #{number,jdbcType=INTEGER}, - - - #{unit,jdbcType=VARCHAR}, - - - #{applyPeopleId,jdbcType=VARCHAR}, - - - #{applyPeopleName,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{filePath,jdbcType=VARCHAR}, - - - #{loseInstr,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=TIMESTAMP}, - - - - - update TB_EM_Equipment_LoseApply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - - - send_to_biz_id = #{sendToBizId,jdbcType=VARCHAR}, - - - send_to_biz_name = #{sendToBizName,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - - - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - - - equipment_model_name = #{equipmentModelName,jdbcType=VARCHAR}, - - - assets_code = #{assetsCode,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - dept_name = #{deptName,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=INTEGER}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - - - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - file_path = #{filePath,jdbcType=VARCHAR}, - - - lose_instr = #{loseInstr,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_LoseApply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - send_to_biz_id = #{sendToBizId,jdbcType=VARCHAR}, - send_to_biz_name = #{sendToBizName,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - equipment_model_name = #{equipmentModelName,jdbcType=VARCHAR}, - assets_code = #{assetsCode,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, - number = #{number,jdbcType=INTEGER}, - unit = #{unit,jdbcType=VARCHAR}, - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - file_path = #{filePath,jdbcType=VARCHAR}, - lose_instr = #{loseInstr,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - audit_man = #{auditMan,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - update TB_EM_Equipment_LoseApply - - insdt=#{insdt}, - insuser=#{insuser}, - biz_id=#{bizId}, - work_process_name=#{workProcessName}, - send_to_biz_id=#{sendToBizId}, - send_to_biz_name=#{sendToBizName}, - equipment_id=#{equipmentId}, - equipment_name=#{equipmentName}, - equipment_model=#{equipmentModel}, - equipment_model_name=#{equipmentModelName}, - assets_code=#{assetsCode}, - dept_id=#{deptId}, - dept_name=#{deptName}, - number=#{number}, - unit=#{unit}, - apply_people_Id=#{applyPeopleId}, - apply_people_name=#{applyPeopleName}, - remark=#{remark}, - file_path=#{filePath}, - lose_instr=#{loseInstr}, - apply_time=#{applyTime}, - lose_apply_number=#{loseApplyNumber}, - audit_man=#{auditMan}, - audit_id=#{auditId}, - processDefId=#{processdefid}, - processId=#{processid}, - total_money=#{totalMoney}, - status=#{status}, - -where id=#{id} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentMaintainMapper.xml b/src/com/sipai/mapper/equipment/EquipmentMaintainMapper.xml deleted file mode 100644 index a0464803..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentMaintainMapper.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, equipmentCardID, equipmentName, equipmentClassID, equipmentModel, - areaID, currentManageFlag, describe, maintenanceman, time - - - - delete from TB_EM_EquipmentMaintain - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentMaintain (id, insuser, insdt, - equipmentCardID, equipmentName, equipmentClassID, - equipmentModel, areaID, currentManageFlag, - describe, maintenanceman, time - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{equipmentcardid,jdbcType=VARCHAR}, #{equipmentname,jdbcType=VARCHAR}, #{equipmentclassid,jdbcType=VARCHAR}, - #{equipmentmodel,jdbcType=VARCHAR}, #{areaid,jdbcType=VARCHAR}, #{currentmanageflag,jdbcType=VARCHAR}, - #{describe,jdbcType=VARCHAR}, #{maintenanceman,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP} - ) - - - insert into TB_EM_EquipmentMaintain - - - id, - - - insuser, - - - insdt, - - - equipmentCardID, - - - equipmentName, - - - equipmentClassID, - - - equipmentModel, - - - areaID, - - - currentManageFlag, - - - describe, - - - maintenanceman, - - - time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{equipmentcardid,jdbcType=VARCHAR}, - - - #{equipmentname,jdbcType=VARCHAR}, - - - #{equipmentclassid,jdbcType=VARCHAR}, - - - #{equipmentmodel,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{currentmanageflag,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{maintenanceman,jdbcType=VARCHAR}, - - - #{time,jdbcType=TIMESTAMP}, - - - - - update TB_EM_EquipmentMaintain - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - equipmentCardID = #{equipmentcardid,jdbcType=VARCHAR}, - - - equipmentName = #{equipmentname,jdbcType=VARCHAR}, - - - equipmentClassID = #{equipmentclassid,jdbcType=VARCHAR}, - - - equipmentModel = #{equipmentmodel,jdbcType=VARCHAR}, - - - areaID = #{areaid,jdbcType=VARCHAR}, - - - currentManageFlag = #{currentmanageflag,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - maintenanceman = #{maintenanceman,jdbcType=VARCHAR}, - - - time = #{time,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentMaintain - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - equipmentCardID = #{equipmentcardid,jdbcType=VARCHAR}, - equipmentName = #{equipmentname,jdbcType=VARCHAR}, - equipmentClassID = #{equipmentclassid,jdbcType=VARCHAR}, - equipmentModel = #{equipmentmodel,jdbcType=VARCHAR}, - areaID = #{areaid,jdbcType=VARCHAR}, - currentManageFlag = #{currentmanageflag,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - maintenanceman = #{maintenanceman,jdbcType=VARCHAR}, - time = #{time,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_EM_EquipmentMaintain - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentParamsetDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentParamsetDetailMapper.xml deleted file mode 100644 index 2770fed6..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentParamsetDetailMapper.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, param_id, name, equipment_class_id, alarm_output_level_1, alarm_output_level_2, - alarm_output_level_3, status_evaluation_project_id, allowable_datum_deviation, weight, - evaluation_criteria_and_decision, evaluation_method, library_bizid - - - - delete from tb_equipment_paramset_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_paramset_detail (id, insdt, insuser, - param_id, name, equipment_class_id, - alarm_output_level_1, alarm_output_level_2, alarm_output_level_3, - status_evaluation_project_id, allowable_datum_deviation, - weight, evaluation_criteria_and_decision, - evaluation_method, library_bizid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{paramId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{equipmentClassId,jdbcType=VARCHAR}, - #{alarmOutputLevel1,jdbcType=VARCHAR}, #{alarmOutputLevel2,jdbcType=VARCHAR}, #{alarmOutputLevel3,jdbcType=VARCHAR}, - #{statusEvaluationProjectId,jdbcType=VARCHAR}, #{allowableDatumDeviation,jdbcType=INTEGER}, - #{weight,jdbcType=INTEGER}, #{evaluationCriteriaAndDecision,jdbcType=VARCHAR}, - #{evaluationMethod,jdbcType=VARCHAR}, #{libraryBizid,jdbcType=VARCHAR}) - - - insert into tb_equipment_paramset_detail - - - id, - - - insdt, - - - insuser, - - - param_id, - - - name, - - - equipment_class_id, - - - alarm_output_level_1, - - - alarm_output_level_2, - - - alarm_output_level_3, - - - status_evaluation_project_id, - - - allowable_datum_deviation, - - - weight, - - - evaluation_criteria_and_decision, - - - evaluation_method, - - - library_bizid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{paramId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{equipmentClassId,jdbcType=VARCHAR}, - - - #{alarmOutputLevel1,jdbcType=VARCHAR}, - - - #{alarmOutputLevel2,jdbcType=VARCHAR}, - - - #{alarmOutputLevel3,jdbcType=VARCHAR}, - - - #{statusEvaluationProjectId,jdbcType=VARCHAR}, - - - #{allowableDatumDeviation,jdbcType=INTEGER}, - - - #{weight,jdbcType=INTEGER}, - - - #{evaluationCriteriaAndDecision,jdbcType=VARCHAR}, - - - #{evaluationMethod,jdbcType=VARCHAR}, - - - #{libraryBizid,jdbcType=VARCHAR}, - - - - - update tb_equipment_paramset_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - param_id = #{paramId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - equipment_class_id = #{equipmentClassId,jdbcType=VARCHAR}, - - - alarm_output_level_1 = #{alarmOutputLevel1,jdbcType=VARCHAR}, - - - alarm_output_level_2 = #{alarmOutputLevel2,jdbcType=VARCHAR}, - - - alarm_output_level_3 = #{alarmOutputLevel3,jdbcType=VARCHAR}, - - - status_evaluation_project_id = #{statusEvaluationProjectId,jdbcType=VARCHAR}, - - - allowable_datum_deviation = #{allowableDatumDeviation,jdbcType=INTEGER}, - - - weight = #{weight,jdbcType=INTEGER}, - - - evaluation_criteria_and_decision = #{evaluationCriteriaAndDecision,jdbcType=VARCHAR}, - - - evaluation_method = #{evaluationMethod,jdbcType=VARCHAR}, - - - library_bizid = #{libraryBizid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_paramset_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - param_id = #{paramId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - equipment_class_id = #{equipmentClassId,jdbcType=VARCHAR}, - alarm_output_level_1 = #{alarmOutputLevel1,jdbcType=VARCHAR}, - alarm_output_level_2 = #{alarmOutputLevel2,jdbcType=VARCHAR}, - alarm_output_level_3 = #{alarmOutputLevel3,jdbcType=VARCHAR}, - status_evaluation_project_id = #{statusEvaluationProjectId,jdbcType=VARCHAR}, - allowable_datum_deviation = #{allowableDatumDeviation,jdbcType=INTEGER}, - weight = #{weight,jdbcType=INTEGER}, - evaluation_criteria_and_decision = #{evaluationCriteriaAndDecision,jdbcType=VARCHAR}, - evaluation_method = #{evaluationMethod,jdbcType=VARCHAR}, - library_bizid = #{libraryBizid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_paramset_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentParamsetMapper.xml b/src/com/sipai/mapper/equipment/EquipmentParamsetMapper.xml deleted file mode 100644 index 8301ed36..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentParamsetMapper.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, name, pid, active, morder - - - - delete from tb_equipment_paramset - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_paramset (id, insdt, insuser, - name, pid, active, - morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{active,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_equipment_paramset - - - id, - - - insdt, - - - insuser, - - - name, - - - pid, - - - active, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{active,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_equipment_paramset - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_paramset - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - active = #{active,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete tb_equipment_paramset ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentParamsetStatusEvaluationMapper.xml b/src/com/sipai/mapper/equipment/EquipmentParamsetStatusEvaluationMapper.xml deleted file mode 100644 index 6a843be2..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentParamsetStatusEvaluationMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, name, score - - - - delete from tb_equipment_paramset_status_evaluation - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_paramset_status_evaluation (id, insdt, insuser, - name, score) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{score,jdbcType=INTEGER}) - - - insert into tb_equipment_paramset_status_evaluation - - - id, - - - insdt, - - - insuser, - - - name, - - - score, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{score,jdbcType=INTEGER}, - - - - - update tb_equipment_paramset_status_evaluation - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - score = #{score,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_paramset_status_evaluation - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - score = #{score,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_paramset_status_evaluation - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentParamsetValueMapper.xml b/src/com/sipai/mapper/equipment/EquipmentParamsetValueMapper.xml deleted file mode 100644 index 17990d92..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentParamsetValueMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, equipment_id, equipment_class_id, detail_id, insdt, insuser, value, alarm_limit_1, - alarm_limit_2, alarm_limit_3, actual_source, base_value - - - - delete from tb_equipment_paramset_value - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_paramset_value (id, equipment_id, equipment_class_id, - detail_id, insdt, insuser, - value, alarm_limit_1, alarm_limit_2, - alarm_limit_3, actual_source, base_value - ) - values (#{id,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{equipmentClassId,jdbcType=VARCHAR}, - #{detailId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{value,jdbcType=DOUBLE}, #{alarmLimit1,jdbcType=DOUBLE}, #{alarmLimit2,jdbcType=DOUBLE}, - #{alarmLimit3,jdbcType=DOUBLE}, #{actualSource,jdbcType=VARCHAR}, #{baseValue,jdbcType=DOUBLE} - ) - - - insert into tb_equipment_paramset_value - - - id, - - - equipment_id, - - - equipment_class_id, - - - detail_id, - - - insdt, - - - insuser, - - - value, - - - alarm_limit_1, - - - alarm_limit_2, - - - alarm_limit_3, - - - actual_source, - - - base_value, - - - - - #{id,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{equipmentClassId,jdbcType=VARCHAR}, - - - #{detailId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{alarmLimit1,jdbcType=DOUBLE}, - - - #{alarmLimit2,jdbcType=DOUBLE}, - - - #{alarmLimit3,jdbcType=DOUBLE}, - - - #{actualSource,jdbcType=VARCHAR}, - - - #{baseValue,jdbcType=DOUBLE}, - - - - - update tb_equipment_paramset_value - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - equipment_class_id = #{equipmentClassId,jdbcType=VARCHAR}, - - - detail_id = #{detailId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - alarm_limit_1 = #{alarmLimit1,jdbcType=DOUBLE}, - - - alarm_limit_2 = #{alarmLimit2,jdbcType=DOUBLE}, - - - alarm_limit_3 = #{alarmLimit3,jdbcType=DOUBLE}, - - - actual_source = #{actualSource,jdbcType=VARCHAR}, - - - base_value = #{baseValue,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_paramset_value - set equipment_id = #{equipmentId,jdbcType=VARCHAR}, - equipment_class_id = #{equipmentClassId,jdbcType=VARCHAR}, - detail_id = #{detailId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - alarm_limit_1 = #{alarmLimit1,jdbcType=DOUBLE}, - alarm_limit_2 = #{alarmLimit2,jdbcType=DOUBLE}, - alarm_limit_3 = #{alarmLimit3,jdbcType=DOUBLE}, - actual_source = #{actualSource,jdbcType=VARCHAR}, - base_value = #{baseValue,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_paramset_value - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentPointMapper.xml b/src/com/sipai/mapper/equipment/EquipmentPointMapper.xml deleted file mode 100644 index 3d205324..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentPointMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, equipmentCardid, pointId, equipmentCardName, pointName - - - - delete from TB_EM_EquipmentPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentPoint (id, insdt, insuser, - equipmentCardid, pointId, equipmentCardName, - pointName) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{equipmentcardid,jdbcType=VARCHAR}, #{pointid,jdbcType=VARCHAR}, #{equipmentcardname,jdbcType=VARCHAR}, - #{pointname,jdbcType=VARCHAR}) - - - insert into TB_EM_EquipmentPoint - - - id, - - - insdt, - - - insuser, - - - equipmentCardid, - - - pointId, - - - equipmentCardName, - - - pointName, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{equipmentcardid,jdbcType=VARCHAR}, - - - #{pointid,jdbcType=VARCHAR}, - - - #{equipmentcardname,jdbcType=VARCHAR}, - - - #{pointname,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentPoint - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - equipmentCardid = #{equipmentcardid,jdbcType=VARCHAR}, - - - pointId = #{pointid,jdbcType=VARCHAR}, - - - equipmentCardName = #{equipmentcardname,jdbcType=VARCHAR}, - - - pointName = #{pointname,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentPoint - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - equipmentCardid = #{equipmentcardid,jdbcType=VARCHAR}, - pointId = #{pointid,jdbcType=VARCHAR}, - equipmentCardName = #{equipmentcardname,jdbcType=VARCHAR}, - pointName = #{pointname,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_EquipmentPoint - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentRepairPlanMapper.xml b/src/com/sipai/mapper/equipment/EquipmentRepairPlanMapper.xml deleted file mode 100644 index b5d2d1fa..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentRepairPlanMapper.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, plan_number, biz_id, equipment_id, process_section_id, plan_type, - maintenance_man, initial_date, interval_period, plan_consume_time, plan_date, maintenance_way, - plan_money, content, active, remark, processDefId, processId, audit_id - - - - delete from TB_Equipment_RepairPlan - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Equipment_RepairPlan (id, insdt, insuser, - plan_number, biz_id, equipment_id, - process_section_id, plan_type, maintenance_man, - initial_date, interval_period, plan_consume_time, - plan_date, maintenance_way, plan_money, - content, active, remark, - processDefId, processId, audit_id - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{planNumber,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{processSectionId,jdbcType=VARCHAR}, #{planType,jdbcType=VARCHAR}, #{maintenanceMan,jdbcType=VARCHAR}, - #{initialDate,jdbcType=TIMESTAMP}, #{intervalPeriod,jdbcType=INTEGER}, #{planConsumeTime,jdbcType=INTEGER}, - #{planDate,jdbcType=VARCHAR}, #{maintenanceWay,jdbcType=VARCHAR}, #{planMoney,jdbcType=DECIMAL}, - #{content,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{auditId,jdbcType=VARCHAR} - ) - - - insert into TB_Equipment_RepairPlan - - - id, - - - insdt, - - - insuser, - - - plan_number, - - - biz_id, - - - equipment_id, - - - process_section_id, - - - plan_type, - - - maintenance_man, - - - initial_date, - - - interval_period, - - - plan_consume_time, - - - plan_date, - - - maintenance_way, - - - plan_money, - - - content, - - - active, - - - remark, - - - processDefId, - - - processId, - - - audit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{planNumber,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{planType,jdbcType=VARCHAR}, - - - #{maintenanceMan,jdbcType=VARCHAR}, - - - #{initialDate,jdbcType=TIMESTAMP}, - - - #{intervalPeriod,jdbcType=INTEGER}, - - - #{planConsumeTime,jdbcType=INTEGER}, - - - #{planDate,jdbcType=VARCHAR}, - - - #{maintenanceWay,jdbcType=VARCHAR}, - - - #{planMoney,jdbcType=DECIMAL}, - - - #{content,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - - - update TB_Equipment_RepairPlan - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - plan_number = #{planNumber,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - plan_type = #{planType,jdbcType=VARCHAR}, - - - maintenance_man = #{maintenanceMan,jdbcType=VARCHAR}, - - - initial_date = #{initialDate,jdbcType=TIMESTAMP}, - - - interval_period = #{intervalPeriod,jdbcType=INTEGER}, - - - plan_consume_time = #{planConsumeTime,jdbcType=INTEGER}, - - - plan_date = #{planDate,jdbcType=VARCHAR}, - - - maintenance_way = #{maintenanceWay,jdbcType=VARCHAR}, - - - plan_money = #{planMoney,jdbcType=DECIMAL}, - - - content = #{content,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Equipment_RepairPlan - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - plan_number = #{planNumber,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - plan_type = #{planType,jdbcType=VARCHAR}, - maintenance_man = #{maintenanceMan,jdbcType=VARCHAR}, - initial_date = #{initialDate,jdbcType=TIMESTAMP}, - interval_period = #{intervalPeriod,jdbcType=INTEGER}, - plan_consume_time = #{planConsumeTime,jdbcType=INTEGER}, - plan_date = #{planDate,jdbcType=VARCHAR}, - maintenance_way = #{maintenanceWay,jdbcType=VARCHAR}, - plan_money = #{planMoney,jdbcType=DECIMAL}, - content = #{content,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Equipment_RepairPlan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentSaleApplyDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentSaleApplyDetailMapper.xml deleted file mode 100644 index 06469106..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentSaleApplyDetailMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, sale_apply_number, equipment_card_id - - - - delete from TB_EM_Equipment_SaleApplyDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_SaleApplyDetail (id, insdt, insuser, - sale_apply_number, equipment_card_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{saleApplyNumber,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_SaleApplyDetail - - - id, - - - insdt, - - - insuser, - - - sale_apply_number, - - - equipment_card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{saleApplyNumber,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_SaleApplyDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - sale_apply_number = #{saleApplyNumber,jdbcType=VARCHAR}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_SaleApplyDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - sale_apply_number = #{saleApplyNumber,jdbcType=VARCHAR}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - delete from TB_EM_Equipment_SaleApplyDetail - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentSaleApplyMapper.xml b/src/com/sipai/mapper/equipment/EquipmentSaleApplyMapper.xml deleted file mode 100644 index d7bdb39a..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentSaleApplyMapper.xml +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, work_process_name, send_to_biz_id, send_to_biz_name, - equipment_id, equipment_name, equipment_model, equipment_model_name, assets_code, - dept_id, dept_name, number, unit, apply_people_Id, apply_people_name, remark, file_path, - sale_instr, apply_time,audit_id,audit_man,sale_apply_number,status,total_money,processDefId,processId - - - - delete from TB_EM_Equipment_SaleApply - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_SaleApply (id, insdt, insuser, - biz_id, work_process_name, send_to_biz_id, - send_to_biz_name, equipment_id, equipment_name, - equipment_model, equipment_model_name, assets_code, - dept_id, dept_name, number, - unit, apply_people_Id, apply_people_name, - remark, file_path, sale_instr, - apply_time,audit_id,audit_man,sale_apply_number,status,total_money,processDefId,processId) - values - (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{workProcessName,jdbcType=VARCHAR}, #{sendToBizId,jdbcType=VARCHAR}, - #{sendToBizName,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{equipmentName,jdbcType=VARCHAR}, - #{equipmentModel,jdbcType=VARCHAR}, #{equipmentModelName,jdbcType=VARCHAR}, #{assetsCode,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, #{deptName,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER}, - #{unit,jdbcType=VARCHAR}, #{applyPeopleId,jdbcType=VARCHAR}, #{applyPeopleName,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{saleInstr,jdbcType=VARCHAR}, - #{applyTime,jdbcType=TIMESTAMP}, - #{auditId,jdbcType=VARCHAR},#{auditMan,jdbcType=VARCHAR}, - #{saleApplyNumber,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=VARCHAR},#{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_SaleApply - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - work_process_name, - - - send_to_biz_id, - - - send_to_biz_name, - - - equipment_id, - - - equipment_name, - - - equipment_model, - - - equipment_model_name, - - - assets_code, - - - dept_id, - - - dept_name, - - - number, - - - unit, - - - apply_people_Id, - - - apply_people_name, - - - remark, - - - file_path, - - - sale_instr, - - - apply_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{workProcessName,jdbcType=VARCHAR}, - - - #{sendToBizId,jdbcType=VARCHAR}, - - - #{sendToBizName,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{equipmentName,jdbcType=VARCHAR}, - - - #{equipmentModel,jdbcType=VARCHAR}, - - - #{equipmentModelName,jdbcType=VARCHAR}, - - - #{assetsCode,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{deptName,jdbcType=VARCHAR}, - - - #{number,jdbcType=INTEGER}, - - - #{unit,jdbcType=VARCHAR}, - - - #{applyPeopleId,jdbcType=VARCHAR}, - - - #{applyPeopleName,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{filePath,jdbcType=VARCHAR}, - - - #{saleInstr,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=TIMESTAMP}, - - - - - update TB_EM_Equipment_SaleApply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - - - send_to_biz_id = #{sendToBizId,jdbcType=VARCHAR}, - - - send_to_biz_name = #{sendToBizName,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - - - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - - - equipment_model_name = #{equipmentModelName,jdbcType=VARCHAR}, - - - assets_code = #{assetsCode,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - dept_name = #{deptName,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=INTEGER}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - - - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - file_path = #{filePath,jdbcType=VARCHAR}, - - - sale_instr = #{saleInstr,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_SaleApply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - send_to_biz_id = #{sendToBizId,jdbcType=VARCHAR}, - send_to_biz_name = #{sendToBizName,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - equipment_model_name = #{equipmentModelName,jdbcType=VARCHAR}, - assets_code = #{assetsCode,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, - number = #{number,jdbcType=INTEGER}, - unit = #{unit,jdbcType=VARCHAR}, - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - file_path = #{filePath,jdbcType=VARCHAR}, - sale_instr = #{saleInstr,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - update TB_EM_Equipment_SaleApply - - insdt=#{insdt}, - insuser=#{insuser}, - biz_id=#{bizId}, - work_process_name=#{workProcessName}, - send_to_biz_id=#{sendToBizId}, - send_to_biz_name=#{sendToBizName}, - equipment_id=#{equipmentId}, - equipment_name=#{equipmentName}, - equipment_model=#{equipmentModel}, - equipment_model_name=#{equipmentModelName}, - assets_code=#{assetsCode}, - dept_id=#{deptId}, - dept_name=#{deptName}, - number=#{number}, - unit=#{unit}, - apply_people_Id=#{applyPeopleId}, - apply_people_name=#{applyPeopleName}, - remark=#{remark}, - file_path=#{filePath}, - sale_instr=#{saleInstr}, - apply_time=#{applyTime}, - - audit_id=#{auditId}, - audit_man=#{auditMan}, - sale_apply_number=#{saleApplyNumber}, - status=#{status}, - total_money=#{totalMoney}, - processDefId=#{processdefid}, - processId=#{processid}, - - - -where id=#{id} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentScrapApplyDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentScrapApplyDetailMapper.xml deleted file mode 100644 index 55fa4267..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentScrapApplyDetailMapper.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, scrap_apply_number, equipment_card_id - - - - delete from TB_EM_Equipment_ScrapApplyDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_ScrapApplyDetail (id, insdt, insuser, - scrap_apply_number, equipment_card_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{scrapApplyNumber,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_ScrapApplyDetail - - - id, - - - insdt, - - - insuser, - - - scrap_apply_number, - - - equipment_card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{scrapApplyNumber,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_ScrapApplyDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - scrap_apply_number = #{scrapApplyNumber,jdbcType=VARCHAR}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - - update TB_EM_Equipment_ScrapApplyDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - scrap_apply_number = #{scrapApplyNumber,jdbcType=VARCHAR}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - delete from TB_EM_Equipment_ScrapApplyDetail - ${where} - - - diff --git a/src/com/sipai/mapper/equipment/EquipmentScrapApplyMapper.xml b/src/com/sipai/mapper/equipment/EquipmentScrapApplyMapper.xml deleted file mode 100644 index cb35a990..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentScrapApplyMapper.xml +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, work_process_name, equipment_id, equipment_name, equipment_model, - equipment_model_name,assets_code, dept_id, dept_name, number, unit, apply_people_Id, apply_people_name, - remark, file_path, scrap_instr,apply_time,send_to_biz_id,send_to_biz_name, - audit_id,audit_man,scrap_apply_number,status,total_money,processDefId,processId - - - - delete from TB_EM_Equipment_ScrapApply - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_ScrapApply (id, insdt, insuser, - biz_id, work_process_name, equipment_id, - equipment_name, equipment_model, assets_code, - dept_id, dept_name, number, - unit, apply_people_Id, apply_people_name, - remark, file_path, scrap_instr,equipment_model_name,apply_time,send_to_biz_id,send_to_biz_name, - audit_id,audit_man,scrap_apply_number,status,total_money,processDefId,processId - ) - values - (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{workProcessName,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{equipmentName,jdbcType=VARCHAR}, #{equipmentModel,jdbcType=VARCHAR}, #{assetsCode,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, #{deptName,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER}, - #{unit,jdbcType=VARCHAR}, #{applyPeopleId,jdbcType=VARCHAR}, #{applyPeopleName,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{scrapInstr,jdbcType=VARCHAR}, - #{equipmentModelName,jdbcType=VARCHAR},#{applyTime,jdbcType=VARCHAR}, - #{sendToBizId,jdbcType=VARCHAR},#{sendToBizName,jdbcType=VARCHAR}, - #{auditId,jdbcType=VARCHAR},#{auditMan,jdbcType=VARCHAR}, - #{scrapApplyNumber,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=VARCHAR},#{processdefid,jdbcType=VARCHAR},#{processid,jdbcType=VARCHAR} - ) - - - insert into TB_EM_Equipment_ScrapApply - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - work_process_name, - - - equipment_id, - - - equipment_name, - - - equipment_model, - - - assets_code, - - - dept_id, - - - dept_name, - - - number, - - - unit, - - - apply_people_Id, - - - apply_people_name, - - - remark, - - - file_path, - - - scrap_instr, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{workProcessName,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{equipmentName,jdbcType=VARCHAR}, - - - #{equipmentModel,jdbcType=VARCHAR}, - - - #{assetsCode,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{deptName,jdbcType=VARCHAR}, - - - #{number,jdbcType=INTEGER}, - - - #{unit,jdbcType=VARCHAR}, - - - #{applyPeopleId,jdbcType=VARCHAR}, - - - #{applyPeopleName,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{filePath,jdbcType=VARCHAR}, - - - #{scrapInstr,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_ScrapApply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - - - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - - - assets_code = #{assetsCode,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - dept_name = #{deptName,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=INTEGER}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - - - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - file_path = #{filePath,jdbcType=VARCHAR}, - - - scrap_instr = #{scrapInstr,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_ScrapApply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - assets_code = #{assetsCode,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, - number = #{number,jdbcType=INTEGER}, - unit = #{unit,jdbcType=VARCHAR}, - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - file_path = #{filePath,jdbcType=VARCHAR}, - scrap_instr = #{scrapInstr,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - update TB_EM_Equipment_ScrapApply - - insdt=#{insdt}, - insuser=#{insuser}, - biz_id=#{bizId}, - work_process_name=#{workProcessName}, - send_to_biz_id=#{sendToBizId}, - send_to_biz_name=#{sendToBizName}, - equipment_id=#{equipmentId}, - equipment_name=#{equipmentName}, - equipment_model=#{equipmentModel}, - equipment_model_name=#{equipmentModelName}, - assets_code=#{assetsCode}, - dept_id=#{deptId}, - dept_name=#{deptName}, - number=#{number}, - unit=#{unit}, - apply_people_Id=#{applyPeopleId}, - apply_people_name=#{applyPeopleName}, - remark=#{remark}, - file_path=#{filePath}, - scrap_instr=#{scrapInstr}, - apply_time=#{applyTime}, - - audit_id=#{auditId}, - audit_man=#{auditMan}, - scrap_apply_number=#{scrapApplyNumber}, - status=#{status}, - total_money=#{totalMoney}, - processDefId=#{processdefid}, - processId=#{processid}, - - where id=#{id} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentSpecificationMapper.xml b/src/com/sipai/mapper/equipment/EquipmentSpecificationMapper.xml deleted file mode 100644 index bfc828e1..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentSpecificationMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, insuser, insdt, name, active, pid, biz_id, remark - - - - delete from TB_EM_Equipment_Specification - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_Specification (id, insuser, insdt, - name, active, pid, - biz_id, remark) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{name,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_Specification - - - id, - - - insuser, - - - insdt, - - - name, - - - active, - - - pid, - - - biz_id, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_Specification - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_Specification - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_Equipment_Specification - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentStatisticsMapper.xml b/src/com/sipai/mapper/equipment/EquipmentStatisticsMapper.xml deleted file mode 100644 index e685a99d..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentStatisticsMapper.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, equipment_level_id, company_id, total_equip_num, intact_equip_num, - fault_equip_num, intact_rate - - - - delete from TB_EM_Equipment_Statistics - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_Statistics (id, insuser, insdt, - equipment_level_id, company_id, total_equip_num, - intact_equip_num, fault_equip_num, intact_rate - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{equipmentLevelId,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{totalEquipNum,jdbcType=INTEGER}, - #{intactEquipNum,jdbcType=INTEGER}, #{faultEquipNum,jdbcType=INTEGER}, #{intactRate,jdbcType=DOUBLE} - ) - - - insert into TB_EM_Equipment_Statistics - - - id, - - - insuser, - - - insdt, - - - equipment_level_id, - - - company_id, - - - total_equip_num, - - - intact_equip_num, - - - fault_equip_num, - - - intact_rate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{equipmentLevelId,jdbcType=VARCHAR}, - - - #{companyId,jdbcType=VARCHAR}, - - - #{totalEquipNum,jdbcType=INTEGER}, - - - #{intactEquipNum,jdbcType=INTEGER}, - - - #{faultEquipNum,jdbcType=INTEGER}, - - - #{intactRate,jdbcType=DOUBLE}, - - - - - update TB_EM_Equipment_Statistics - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - equipment_level_id = #{equipmentLevelId,jdbcType=VARCHAR}, - - - company_id = #{companyId,jdbcType=VARCHAR}, - - - total_equip_num = #{totalEquipNum,jdbcType=INTEGER}, - - - intact_equip_num = #{intactEquipNum,jdbcType=INTEGER}, - - - fault_equip_num = #{faultEquipNum,jdbcType=INTEGER}, - - - intact_rate = #{intactRate,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_Statistics - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - equipment_level_id = #{equipmentLevelId,jdbcType=VARCHAR}, - company_id = #{companyId,jdbcType=VARCHAR}, - total_equip_num = #{totalEquipNum,jdbcType=INTEGER}, - intact_equip_num = #{intactEquipNum,jdbcType=INTEGER}, - fault_equip_num = #{faultEquipNum,jdbcType=INTEGER}, - intact_rate = #{intactRate,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_Equipment_Statistics - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentStatusManagementMapper.xml b/src/com/sipai/mapper/equipment/EquipmentStatusManagementMapper.xml deleted file mode 100644 index ccd78fa1..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentStatusManagementMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, name, active, workOrderSt, insdt, insuser, morder - - - - delete from TB_Equipment_StatusManagement - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Equipment_StatusManagement (id, name, active, - workOrderSt, insdt, insuser, morder - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{workorderst,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into TB_Equipment_StatusManagement - - - id, - - - name, - - - active, - - - workOrderSt, - - - insdt, - - - insuser, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{workorderst,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_Equipment_StatusManagement - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - workOrderSt = #{workorderst,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Equipment_StatusManagement - set name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - workOrderSt = #{workorderst,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_Equipment_StatusManagement - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentStopRecordDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentStopRecordDetailMapper.xml deleted file mode 100644 index 18a819ab..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentStopRecordDetailMapper.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, stop_apply_number, equipment_card_id - - - - delete from tb_equipment_stop_record_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_stop_record_detail (id, insdt, insuser, - stop_apply_number, equipment_card_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{stopApplyNumber,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}) - - - insert into tb_equipment_stop_record_detail - - - id, - - - insdt, - - - insuser, - - - stop_apply_number, - - - equipment_card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{stopApplyNumber,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - - - update tb_equipment_stop_record_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - stop_apply_number = #{stopApplyNumber,jdbcType=VARCHAR}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_stop_record_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - stop_apply_number = #{stopApplyNumber,jdbcType=VARCHAR}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_equipment_stop_record_detail ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentStopRecordMapper.xml b/src/com/sipai/mapper/equipment/EquipmentStopRecordMapper.xml deleted file mode 100644 index e97de6be..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentStopRecordMapper.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, apply_people, stop_reson, apply_time, stop_apply_number, biz_id, - processDefId, processId, audit_id, audit_man, status, stop_time, start_time, type - - - - delete from tb_equipment_stop_record - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_stop_record (id, insdt, insuser, - apply_people, stop_reson, apply_time, - stop_apply_number, biz_id, processDefId, - processId, audit_id, audit_man, - status, stop_time, start_time, - type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{applyPeople,jdbcType=VARCHAR}, #{stopReson,jdbcType=VARCHAR}, #{applyTime,jdbcType=TIMESTAMP}, - #{stopApplyNumber,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}, #{auditId,jdbcType=VARCHAR}, #{auditMan,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{stopTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_equipment_stop_record - - - id, - - - insdt, - - - insuser, - - - apply_people, - - - stop_reson, - - - apply_time, - - - stop_apply_number, - - - biz_id, - - - processDefId, - - - processId, - - - audit_id, - - - audit_man, - - - status, - - - stop_time, - - - start_time, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{applyPeople,jdbcType=VARCHAR}, - - - #{stopReson,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=TIMESTAMP}, - - - #{stopApplyNumber,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - #{auditMan,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{stopTime,jdbcType=TIMESTAMP}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_equipment_stop_record - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - apply_people = #{applyPeople,jdbcType=VARCHAR}, - - - stop_reson = #{stopReson,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - - - stop_apply_number = #{stopApplyNumber,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - audit_man = #{auditMan,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - stop_time = #{stopTime,jdbcType=TIMESTAMP}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_stop_record - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - apply_people = #{applyPeople,jdbcType=VARCHAR}, - stop_reson = #{stopReson,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - stop_apply_number = #{stopApplyNumber,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR}, - audit_man = #{auditMan,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - stop_time = #{stopTime,jdbcType=TIMESTAMP}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_equipment_stop_record ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentTransfersApplyDetailMapper.xml b/src/com/sipai/mapper/equipment/EquipmentTransfersApplyDetailMapper.xml deleted file mode 100644 index c9caf5ef..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentTransfersApplyDetailMapper.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - insert into TB_Equipment_TransfersApplyDetail (id, insdt, insuser, - transfers_apply_number, equipment_card_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{transfersApplyNumber,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}) - - - insert into TB_Equipment_TransfersApplyDetail - - - id, - - - insdt, - - - insuser, - - - transfers_apply_number, - - - equipment_card_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{transfersApplyNumber,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - - - - delete TB_Equipment_TransfersApplyDetail where id=#{id} - - - - delete TB_Equipment_TransfersApplyDetail - ${where} - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentTransfersApplyMapper.xml b/src/com/sipai/mapper/equipment/EquipmentTransfersApplyMapper.xml deleted file mode 100644 index d062687f..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentTransfersApplyMapper.xml +++ /dev/null @@ -1,430 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, company_name, work_process_name, send_to_biz_id, send_to_biz_name, - equipment_id, equipment_name, equipment_model, assets_code, dept_id, dept_name, unit, - number, apply_people_Id, apply_people_name, remark, file_path, transfers_instr, apply_time, - processDefId, processId, audit_id, audit_man, transfers_apply_number, status, total_money, - dept_opinion - - - - delete from TB_Equipment_TransfersApply - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Equipment_TransfersApply (id, insdt, insuser, - biz_id, company_name, work_process_name, - send_to_biz_id, send_to_biz_name, equipment_id, - equipment_name, equipment_model, assets_code, - dept_id, dept_name, unit, - number, apply_people_Id, apply_people_name, - remark, file_path, transfers_instr, - apply_time, processDefId, processId, - audit_id, audit_man, transfers_apply_number, - status, total_money,dept_opinion) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{workProcessName,jdbcType=VARCHAR}, - #{sendToBizId,jdbcType=VARCHAR}, #{sendToBizName,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{equipmentName,jdbcType=VARCHAR}, #{equipmentModel,jdbcType=VARCHAR}, #{assetsCode,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, #{deptName,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, - #{number,jdbcType=INTEGER}, #{applyPeopleId,jdbcType=VARCHAR}, #{applyPeopleName,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{transfersInstr,jdbcType=VARCHAR}, - #{applyTime,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{auditId,jdbcType=VARCHAR}, #{auditMan,jdbcType=VARCHAR}, #{transfersApplyNumber,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{totalMoney,jdbcType=DECIMAL}, #{deptOpinion,jdbcType=VARCHAR}) - - - insert into TB_Equipment_TransfersApply - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - company_name, - - - work_process_name, - - - send_to_biz_id, - - - send_to_biz_name, - - - equipment_id, - - - equipment_name, - - - equipment_model, - - - assets_code, - - - dept_id, - - - dept_name, - - - unit, - - - number, - - - apply_people_Id, - - - apply_people_name, - - - remark, - - - file_path, - - - transfers_instr, - - - apply_time, - - - processDefId, - - - processId, - - - audit_id, - - - audit_man, - - - transfers_apply_number, - - - status, - - - total_money, - - - - dept_opinion, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{companyName,jdbcType=VARCHAR}, - - - #{workProcessName,jdbcType=VARCHAR}, - - - #{sendToBizId,jdbcType=VARCHAR}, - - - #{sendToBizName,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{equipmentName,jdbcType=VARCHAR}, - - - #{equipmentModel,jdbcType=VARCHAR}, - - - #{assetsCode,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{deptName,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{number,jdbcType=INTEGER}, - - - #{applyPeopleId,jdbcType=VARCHAR}, - - - #{applyPeopleName,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{filePath,jdbcType=VARCHAR}, - - - #{transfersInstr,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - #{auditMan,jdbcType=VARCHAR}, - - - #{transfersApplyNumber,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - - #{deptOpinion,jdbcType=VARCHAR}, - - - - - - update TB_Equipment_TransfersApply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - company_name = #{companyName,jdbcType=VARCHAR}, - - - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - - - send_to_biz_id = #{sendToBizId,jdbcType=VARCHAR}, - - - send_to_biz_name = #{sendToBizName,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - - - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - - - assets_code = #{assetsCode,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - dept_name = #{deptName,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=INTEGER}, - - - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - - - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - file_path = #{filePath,jdbcType=VARCHAR}, - - - transfers_instr = #{transfersInstr,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - audit_man = #{auditMan,jdbcType=VARCHAR}, - - - transfers_apply_number = #{transfersApplyNumber,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - - dept_opinion = #{deptOpinion,jdbcType=VARCHAR}, - - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Equipment_TransfersApply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - company_name = #{companyName,jdbcType=VARCHAR}, - work_process_name = #{workProcessName,jdbcType=VARCHAR}, - send_to_biz_id = #{sendToBizId,jdbcType=VARCHAR}, - send_to_biz_name = #{sendToBizName,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - equipment_name = #{equipmentName,jdbcType=VARCHAR}, - equipment_model = #{equipmentModel,jdbcType=VARCHAR}, - assets_code = #{assetsCode,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - number = #{number,jdbcType=INTEGER}, - apply_people_Id = #{applyPeopleId,jdbcType=VARCHAR}, - apply_people_name = #{applyPeopleName,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - file_path = #{filePath,jdbcType=VARCHAR}, - transfers_instr = #{transfersInstr,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR}, - audit_man = #{auditMan,jdbcType=VARCHAR}, - transfers_apply_number = #{transfersApplyNumber,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - dept_opinion = #{deptOpinion,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete TB_Equipment_TransfersApply - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentTypeNumberMapper.xml b/src/com/sipai/mapper/equipment/EquipmentTypeNumberMapper.xml deleted file mode 100644 index c2502125..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentTypeNumberMapper.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, name, active, pid, remark, biz_id - - - - - delete from TB_EM_Equipment_TypeNumber - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_TypeNumber (id, insdt, insuser, - name, active, pid, - remark, biz_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_TypeNumber - - - id, - - - insdt, - - - insuser, - - - name, - - - active, - - - pid, - - - remark, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_TypeNumber - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_TypeNumber - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - delete from TB_EM_Equipment_TypeNumber - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/EquipmentUseAgeMapper.xml b/src/com/sipai/mapper/equipment/EquipmentUseAgeMapper.xml deleted file mode 100644 index 50d06f8d..00000000 --- a/src/com/sipai/mapper/equipment/EquipmentUseAgeMapper.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - id, insuser, insdt, value_min, name, value_max, pid, remark, biz_id - - - - delete from TB_EM_Equipment_UseAge - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_UseAge (id, insuser, insdt, - value_min, name, value_max, - pid, remark, biz_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{valueMin,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{valueMax,jdbcType=INTEGER}, - #{pid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}) - - - insert into TB_EM_Equipment_UseAge - - - id, - - - insuser, - - - insdt, - - - value_min, - - - name, - - - value_max, - - - pid, - - - remark, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{valueMin,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{valueMax,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update TB_EM_Equipment_UseAge - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - value_min = #{valueMin,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - value_max = #{valueMax,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_UseAge - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - value_min = #{valueMin,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - value_max = #{valueMax,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_Equipment_UseAge - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/FacilitiesCardMapper.xml b/src/com/sipai/mapper/equipment/FacilitiesCardMapper.xml deleted file mode 100644 index ea10a701..00000000 --- a/src/com/sipai/mapper/equipment/FacilitiesCardMapper.xml +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, position, asset_class_id, asset_class_code, code, name, facilities_class_id, - structure, completed_time, use_years_limit, main_params, built_area, number, depreciation_years_limit, - original_value, now_value, design_unit, construction_unit, asset_status, asset_evaluate, - remarks, model, material_quality, measure_unit, length, type, unitId - - - - delete from TB_EM_FacilitiesCard - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_FacilitiesCard (id, insuser, insdt, - position, asset_class_id, asset_class_code, - code, name, facilities_class_id, - structure, completed_time, use_years_limit, - main_params, built_area, number, - depreciation_years_limit, original_value, - now_value, design_unit, construction_unit, - asset_status, asset_evaluate, remarks, - model, material_quality, measure_unit, - length, type, unitId) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{position,jdbcType=VARCHAR}, #{assetClassId,jdbcType=VARCHAR}, #{assetClassCode,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{facilitiesClassId,jdbcType=VARCHAR}, - #{structure,jdbcType=VARCHAR}, #{completedTime,jdbcType=TIMESTAMP}, #{useYearsLimit,jdbcType=DECIMAL}, - #{mainParams,jdbcType=VARCHAR}, #{builtArea,jdbcType=VARCHAR}, #{number,jdbcType=DECIMAL}, - #{depreciationYearsLimit,jdbcType=DECIMAL}, #{originalValue,jdbcType=DECIMAL}, - #{nowValue,jdbcType=DECIMAL}, #{designUnit,jdbcType=VARCHAR}, #{constructionUnit,jdbcType=VARCHAR}, - #{assetStatus,jdbcType=VARCHAR}, #{assetEvaluate,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, - #{model,jdbcType=VARCHAR}, #{materialQuality,jdbcType=VARCHAR}, #{measureUnit,jdbcType=VARCHAR}, - #{length,jdbcType=DECIMAL}, #{type,jdbcType=CHAR}, #{unitId,jdbcType=VARCHAR}) - - - insert into TB_EM_FacilitiesCard - - - id, - - - insuser, - - - insdt, - - - position, - - - asset_class_id, - - - asset_class_code, - - - code, - - - name, - - - facilities_class_id, - - - structure, - - - completed_time, - - - use_years_limit, - - - main_params, - - - built_area, - - - number, - - - depreciation_years_limit, - - - original_value, - - - now_value, - - - design_unit, - - - construction_unit, - - - asset_status, - - - asset_evaluate, - - - remarks, - - - model, - - - material_quality, - - - measure_unit, - - - length, - - - type, - - - unitId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{position,jdbcType=VARCHAR}, - - - #{assetClassId,jdbcType=VARCHAR}, - - - #{assetClassCode,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{facilitiesClassId,jdbcType=VARCHAR}, - - - #{structure,jdbcType=VARCHAR}, - - - #{completedTime,jdbcType=TIMESTAMP}, - - - #{useYearsLimit,jdbcType=DECIMAL}, - - - #{mainParams,jdbcType=VARCHAR}, - - - #{builtArea,jdbcType=VARCHAR}, - - - #{number,jdbcType=DECIMAL}, - - - #{depreciationYearsLimit,jdbcType=DECIMAL}, - - - #{originalValue,jdbcType=DECIMAL}, - - - #{nowValue,jdbcType=DECIMAL}, - - - #{designUnit,jdbcType=VARCHAR}, - - - #{constructionUnit,jdbcType=VARCHAR}, - - - #{assetStatus,jdbcType=VARCHAR}, - - - #{assetEvaluate,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{materialQuality,jdbcType=VARCHAR}, - - - #{measureUnit,jdbcType=VARCHAR}, - - - #{length,jdbcType=DECIMAL}, - - - #{type,jdbcType=CHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update TB_EM_FacilitiesCard - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - position = #{position,jdbcType=VARCHAR}, - - - asset_class_id = #{assetClassId,jdbcType=VARCHAR}, - - - asset_class_code = #{assetClassCode,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - facilities_class_id = #{facilitiesClassId,jdbcType=VARCHAR}, - - - structure = #{structure,jdbcType=VARCHAR}, - - - completed_time = #{completedTime,jdbcType=TIMESTAMP}, - - - use_years_limit = #{useYearsLimit,jdbcType=DECIMAL}, - - - main_params = #{mainParams,jdbcType=VARCHAR}, - - - built_area = #{builtArea,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=DECIMAL}, - - - depreciation_years_limit = #{depreciationYearsLimit,jdbcType=DECIMAL}, - - - original_value = #{originalValue,jdbcType=DECIMAL}, - - - now_value = #{nowValue,jdbcType=DECIMAL}, - - - design_unit = #{designUnit,jdbcType=VARCHAR}, - - - construction_unit = #{constructionUnit,jdbcType=VARCHAR}, - - - asset_status = #{assetStatus,jdbcType=VARCHAR}, - - - asset_evaluate = #{assetEvaluate,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - material_quality = #{materialQuality,jdbcType=VARCHAR}, - - - measure_unit = #{measureUnit,jdbcType=VARCHAR}, - - - length = #{length,jdbcType=DECIMAL}, - - - type = #{type,jdbcType=CHAR}, - - - unitId = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_FacilitiesCard - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - position = #{position,jdbcType=VARCHAR}, - asset_class_id = #{assetClassId,jdbcType=VARCHAR}, - asset_class_code = #{assetClassCode,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - facilities_class_id = #{facilitiesClassId,jdbcType=VARCHAR}, - structure = #{structure,jdbcType=VARCHAR}, - completed_time = #{completedTime,jdbcType=TIMESTAMP}, - use_years_limit = #{useYearsLimit,jdbcType=DECIMAL}, - main_params = #{mainParams,jdbcType=VARCHAR}, - built_area = #{builtArea,jdbcType=VARCHAR}, - number = #{number,jdbcType=DECIMAL}, - depreciation_years_limit = #{depreciationYearsLimit,jdbcType=DECIMAL}, - original_value = #{originalValue,jdbcType=DECIMAL}, - now_value = #{nowValue,jdbcType=DECIMAL}, - design_unit = #{designUnit,jdbcType=VARCHAR}, - construction_unit = #{constructionUnit,jdbcType=VARCHAR}, - asset_status = #{assetStatus,jdbcType=VARCHAR}, - asset_evaluate = #{assetEvaluate,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - material_quality = #{materialQuality,jdbcType=VARCHAR}, - measure_unit = #{measureUnit,jdbcType=VARCHAR}, - length = #{length,jdbcType=DECIMAL}, - type = #{type,jdbcType=CHAR}, - unitId = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_FacilitiesCard - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/FacilitiesClassMapper.xml b/src/com/sipai/mapper/equipment/FacilitiesClassMapper.xml deleted file mode 100644 index 7246ff01..00000000 --- a/src/com/sipai/mapper/equipment/FacilitiesClassMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, code, name, remark, unit_id, type, pid, morder, insuser, insdt - - - - delete from TB_EM_FacilitiesClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_FacilitiesClass (id, code, name, - remark, unit_id, type, - pid, morder, insuser, - insdt) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_EM_FacilitiesClass - - - id, - - - code, - - - name, - - - remark, - - - unit_id, - - - type, - - - pid, - - - morder, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_EM_FacilitiesClass - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_FacilitiesClass - set code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_FacilitiesClass - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/GeographyAreaMapper.xml b/src/com/sipai/mapper/equipment/GeographyAreaMapper.xml deleted file mode 100644 index b1b9d878..00000000 --- a/src/com/sipai/mapper/equipment/GeographyAreaMapper.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - id, name, insdt, insuser, remark, status, bizid, code, pid - - - - delete from TB_EM_GeographyArea - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_GeographyArea (id, name, insdt, - insuser, remark, status, - bizid, code, pid) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}) - - - insert into TB_EM_GeographyArea - - - id, - - - name, - - - insdt, - - - insuser, - - - remark, - - - status, - - - bizid, - - - code, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update TB_EM_GeographyArea - - - name = #{name,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_GeographyArea - set name = #{name,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from TB_EM_GeographyArea - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/MaintenancePlanMapper.xml b/src/com/sipai/mapper/equipment/MaintenancePlanMapper.xml deleted file mode 100644 index b1be5c19..00000000 --- a/src/com/sipai/mapper/equipment/MaintenancePlanMapper.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, plan_number, biz_id, equipment_id, process_section_id, plan_type, - maintenance_man, initial_date, interval_period, plan_consume_time, plan_date, maintenance_way, - plan_money, content, active, remark, processDefId, processId, audit_id - - - - delete from TB_EM_MaintenancePlan - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_MaintenancePlan (id, insdt, insuser, - plan_number, biz_id, equipment_id, - process_section_id, plan_type, maintenance_man, - initial_date, interval_period, plan_consume_time, - plan_date, maintenance_way, plan_money, - content, active, remark, - processDefId, processId, audit_id - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{planNumber,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{processSectionId,jdbcType=VARCHAR}, #{planType,jdbcType=VARCHAR}, #{maintenanceMan,jdbcType=VARCHAR}, - #{initialDate,jdbcType=TIMESTAMP}, #{intervalPeriod,jdbcType=INTEGER}, #{planConsumeTime,jdbcType=INTEGER}, - #{planDate,jdbcType=VARCHAR}, #{maintenanceWay,jdbcType=VARCHAR}, #{planMoney,jdbcType=DECIMAL}, - #{content,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{auditId,jdbcType=VARCHAR} - ) - - - insert into TB_EM_MaintenancePlan - - - id, - - - insdt, - - - insuser, - - - plan_number, - - - biz_id, - - - equipment_id, - - - process_section_id, - - - plan_type, - - - maintenance_man, - - - initial_date, - - - interval_period, - - - plan_consume_time, - - - plan_date, - - - maintenance_way, - - - plan_money, - - - content, - - - active, - - - remark, - - - processDefId, - - - processId, - - - audit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{planNumber,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{planType,jdbcType=VARCHAR}, - - - #{maintenanceMan,jdbcType=VARCHAR}, - - - #{initialDate,jdbcType=TIMESTAMP}, - - - #{intervalPeriod,jdbcType=INTEGER}, - - - #{planConsumeTime,jdbcType=INTEGER}, - - - #{planDate,jdbcType=VARCHAR}, - - - #{maintenanceWay,jdbcType=VARCHAR}, - - - #{planMoney,jdbcType=DECIMAL}, - - - #{content,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - - - update TB_EM_MaintenancePlan - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - plan_number = #{planNumber,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - plan_type = #{planType,jdbcType=VARCHAR}, - - - maintenance_man = #{maintenanceMan,jdbcType=VARCHAR}, - - - initial_date = #{initialDate,jdbcType=TIMESTAMP}, - - - interval_period = #{intervalPeriod,jdbcType=INTEGER}, - - - plan_consume_time = #{planConsumeTime,jdbcType=INTEGER}, - - - plan_date = #{planDate,jdbcType=VARCHAR}, - - - maintenance_way = #{maintenanceWay,jdbcType=VARCHAR}, - - - plan_money = #{planMoney,jdbcType=DECIMAL}, - - - content = #{content,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_MaintenancePlan - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - plan_number = #{planNumber,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - plan_type = #{planType,jdbcType=VARCHAR}, - maintenance_man = #{maintenanceMan,jdbcType=VARCHAR}, - initial_date = #{initialDate,jdbcType=TIMESTAMP}, - interval_period = #{intervalPeriod,jdbcType=INTEGER}, - plan_consume_time = #{planConsumeTime,jdbcType=INTEGER}, - plan_date = #{planDate,jdbcType=VARCHAR}, - maintenance_way = #{maintenanceWay,jdbcType=VARCHAR}, - plan_money = #{planMoney,jdbcType=DECIMAL}, - content = #{content,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_MaintenancePlan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/equipment/SpecialEquipmentMapper.xml b/src/com/sipai/mapper/equipment/SpecialEquipmentMapper.xml deleted file mode 100644 index ee32b44c..00000000 --- a/src/com/sipai/mapper/equipment/SpecialEquipmentMapper.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, equipment_card_id, next_record_time, equipment_class,status,recent_time, - deal_desc,act_finish_time - - - - - delete from tb_special_equipment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_special_equipment (id, insdt, insuser, - biz_id, equipment_card_id, next_record_time, - equipment_class, status,recent_time,deal_desc,act_finish_time) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{equipmentCardId,jdbcType=VARCHAR}, #{nextRecordTime,jdbcType=VARCHAR}, - #{equipmentClass,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{recentTime,jdbcType=VARCHAR}, - #{dealDesc,jdbcType=VARCHAR},#{actFinishTime,jdbcType=TIMESTAMP}) - - - insert into tb_special_equipment - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - equipment_card_id, - - - next_record_time, - - - equipment_class, - - - status, - - - - recent_time, - - - - deal_desc, - - - - act_finish_time, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - #{nextRecordTime,jdbcType=VARCHAR}, - - - #{equipmentClass,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - - #{recentTime,jdbcType=VARCHAR}, - - - - #{dealDesc,jdbcType=VARCHAR}, - - - - #{actFinishTime,jdbcType=TIMESTAMP}, - - - - - update tb_special_equipment - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - next_record_time = #{nextRecordTime,jdbcType=VARCHAR}, - - - equipment_class = #{equipmentClass,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - - recent_time = #{recentTime,jdbcType=VARCHAR}, - - - - deal_desc = #{dealDesc,jdbcType=VARCHAR}, - - - - act_finish_time = #{actFinishTime,jdbcType=TIMESTAMP}, - - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_special_equipment - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - next_record_time = #{nextRecordTime,jdbcType=VARCHAR}, - equipment_class = #{equipmentClass,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - recent_time = #{recentTime,jdbcType=VARCHAR}, - deal_desc=#{dealDesc,jdbcType=VARCHAR}, - act_finish_time=#{actFinishTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_special_equipment ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationCriterionMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationCriterionMapper.xml deleted file mode 100644 index 7b8213fb..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationCriterionMapper.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, criterion_name, nation_criterion_value, nation_criterion_min, - nation_criterion_max, area_criterion_value, area_criterion_min, area_criterion_max, - company_criterion_value, company_criterion_max, company_criterion_min, condition, - remark,detectionLimit,isSeries - - - - - delete from tb_evaluation_criterion - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_criterion - ${where} - - - insert into tb_evaluation_criterion (id, insdt, insuser, - criterion_name, nation_criterion_value, nation_criterion_min, - nation_criterion_max, area_criterion_value, area_criterion_min, - area_criterion_max, company_criterion_value, - company_criterion_max, company_criterion_min, - condition, remark, detectionLimit,isSeries) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{criterionName,jdbcType=VARCHAR}, #{nationCriterionValue,jdbcType=DOUBLE}, #{nationCriterionMin,jdbcType=DOUBLE}, - #{nationCriterionMax,jdbcType=DOUBLE}, #{areaCriterionValue,jdbcType=DOUBLE}, #{areaCriterionMin,jdbcType=DOUBLE}, - #{areaCriterionMax,jdbcType=DOUBLE}, #{companyCriterionValue,jdbcType=DOUBLE}, - #{companyCriterionMax,jdbcType=DOUBLE}, #{companyCriterionMin,jdbcType=DOUBLE}, - #{condition,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{detectionLimit,jdbcType=DOUBLE},#{isSeries,jdbcType=BIT}) - - - insert into tb_evaluation_criterion - - - id, - - - insdt, - - - insuser, - - - criterion_name, - - - nation_criterion_value, - - - nation_criterion_min, - - - nation_criterion_max, - - - area_criterion_value, - - - area_criterion_min, - - - area_criterion_max, - - - company_criterion_value, - - - company_criterion_max, - - - company_criterion_min, - - - detectionLimit, - - - condition, - - - remark, - - - isSeries, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{criterionName,jdbcType=VARCHAR}, - - - #{nationCriterionValue,jdbcType=DOUBLE}, - - - #{nationCriterionMin,jdbcType=DOUBLE}, - - - #{nationCriterionMax,jdbcType=DOUBLE}, - - - #{areaCriterionValue,jdbcType=DOUBLE}, - - - #{areaCriterionMin,jdbcType=DOUBLE}, - - - #{areaCriterionMax,jdbcType=DOUBLE}, - - - #{companyCriterionValue,jdbcType=DOUBLE}, - - - #{companyCriterionMax,jdbcType=DOUBLE}, - - - #{companyCriterionMin,jdbcType=DOUBLE}, - - - #{detectionLimit,jdbcType=DOUBLE}, - - - #{condition,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{isSeries,jdbcType=BIT}, - - - - - update tb_evaluation_criterion - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - criterion_name = #{criterionName,jdbcType=VARCHAR}, - - - nation_criterion_value = #{nationCriterionValue,jdbcType=DOUBLE}, - - - nation_criterion_min = #{nationCriterionMin,jdbcType=DOUBLE}, - - - nation_criterion_max = #{nationCriterionMax,jdbcType=DOUBLE}, - - - area_criterion_value = #{areaCriterionValue,jdbcType=DOUBLE}, - - - area_criterion_min = #{areaCriterionMin,jdbcType=DOUBLE}, - - - area_criterion_max = #{areaCriterionMax,jdbcType=DOUBLE}, - - - company_criterion_value = #{companyCriterionValue,jdbcType=DOUBLE}, - - - company_criterion_max = #{companyCriterionMax,jdbcType=DOUBLE}, - - - company_criterion_min = #{companyCriterionMin,jdbcType=DOUBLE}, - - - detectionLimit = #{detectionLimit,jdbcType=DOUBLE}, - - - condition = #{condition,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - isSeries = #{isSeries,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_criterion - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - criterion_name = #{criterionName,jdbcType=VARCHAR}, - nation_criterion_value = #{nationCriterionValue,jdbcType=DOUBLE}, - nation_criterion_min = #{nationCriterionMin,jdbcType=DOUBLE}, - nation_criterion_max = #{nationCriterionMax,jdbcType=DOUBLE}, - area_criterion_value = #{areaCriterionValue,jdbcType=DOUBLE}, - area_criterion_min = #{areaCriterionMin,jdbcType=DOUBLE}, - area_criterion_max = #{areaCriterionMax,jdbcType=DOUBLE}, - company_criterion_value = #{companyCriterionValue,jdbcType=DOUBLE}, - company_criterion_max = #{companyCriterionMax,jdbcType=DOUBLE}, - company_criterion_min = #{companyCriterionMin,jdbcType=DOUBLE}, - detectionLimit = #{detectionLimit,jdbcType=DOUBLE}, - condition = #{condition,jdbcType=VARCHAR}, - isSeries = #{isSeries,jdbcType=BIT}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationIndexDayMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationIndexDayMapper.xml deleted file mode 100644 index d7140bed..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationIndexDayMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, date, criterion_value, sub_index_nation, sub_index_area, sub_index_company, - wqi_day_nation, wqi_day_area, wqi_day_company - - - - - delete from tb_evaluation_index_day - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_index_day - ${where} - - - insert into tb_evaluation_index_day (id, insdt, date, - criterion_value, sub_index_nation, sub_index_area, - sub_index_company, wqi_day_nation, wqi_day_area, wqi_day_company) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{date,jdbcType=TIMESTAMP}, - #{criterionValue,jdbcType=VARCHAR}, #{subIndexNation,jdbcType=VARCHAR}, #{subIndexArea,jdbcType=VARCHAR}, - #{subIndexCompany,jdbcType=VARCHAR}, #{wqi_day_nation,jdbcType=DOUBLE}, - #{wqi_day_area,jdbcType=VARCHAR}, #{wqi_day_company,jdbcType=DOUBLE}) - - - insert into tb_evaluation_index_day - - - id, - - - insdt, - - - date, - - - criterion_value, - - - sub_index_nation, - - - sub_index_area, - - - sub_index_company, - - - wqi_day_nation, - - - wqi_day_area, - - - wqi_day_company, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{date,jdbcType=TIMESTAMP}, - - - #{criterionValue,jdbcType=VARCHAR}, - - - #{subIndexNation,jdbcType=VARCHAR}, - - - #{subIndexArea,jdbcType=VARCHAR}, - - - #{subIndexCompany,jdbcType=VARCHAR}, - - - #{wqiDayNation,jdbcType=DOUBLE}, - - - #{wqiDayArea,jdbcType=DOUBLE}, - - - #{wqiDayCompany,jdbcType=DOUBLE}, - - - - - update tb_evaluation_index_day - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - date = #{date,jdbcType=TIMESTAMP}, - - - criterion_value = #{criterionValue,jdbcType=VARCHAR}, - - - sub_index_nation = #{subIndexNation,jdbcType=VARCHAR}, - - - sub_index_area = #{subIndexArea,jdbcType=VARCHAR}, - - - sub_index_company = #{subIndexCompany,jdbcType=VARCHAR}, - - - wqi_day_nation = #{wqiDayNation,jdbcType=DOUBLE}, - - - wqi_day_area = #{wqiDayArea,jdbcType=DOUBLE}, - - - wqi_day_company = #{wqiDayCompany,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_index_day - set insdt = #{insdt,jdbcType=TIMESTAMP}, - date = #{date,jdbcType=TIMESTAMP}, - criterion_value = #{criterionValue,jdbcType=VARCHAR}, - sub_index_nation = #{subIndexNation,jdbcType=VARCHAR}, - sub_index_area = #{subIndexArea,jdbcType=VARCHAR}, - sub_index_company = #{subIndexCompany,jdbcType=VARCHAR}, - wqi_day_nation = #{wqiDayNation,jdbcType=DOUBLE}, - wqi_day_area = #{wqiDayArea,jdbcType=DOUBLE}, - wqi_day_company = #{wqiDayCompany,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationIndexMMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationIndexMMapper.xml deleted file mode 100644 index b3a02900..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationIndexMMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, index_name, index_definition, index_frequency, index_function, - remark, evaluationCriterion_bacteriology_Ids, evaluationCriterion_disinfectant_Ids, - evaluationCriterion_sensoryorgans_Ids, evaluationCriterion_toxicology_Ids, type - - - - - delete from tb_evaluation_index_m - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_index_m - ${where} - - - insert into tb_evaluation_index_m (id, insdt, insuser, - index_name, index_definition, index_frequency, - index_function, remark, evaluationCriterion_bacteriology_Ids, - evaluationCriterion_disinfectant_Ids, evaluationCriterion_sensoryorgans_Ids, - evaluationCriterion_toxicology_Ids, type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{indexName,jdbcType=VARCHAR}, #{indexDefinition,jdbcType=VARCHAR}, #{indexFrequency,jdbcType=VARCHAR}, - #{indexFunction,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) - - - insert into tb_evaluation_index_m - - - id, - - - insdt, - - - insuser, - - - index_name, - - - index_definition, - - - index_frequency, - - - index_function, - - - remark, - - - evaluationCriterion_bacteriology_Ids, - - - evaluationCriterion_disinfectant_Ids, - - - evaluationCriterion_sensoryorgans_Ids, - - - evaluationCriterion_toxicology_Ids, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{indexName,jdbcType=VARCHAR}, - - - #{indexDefinition,jdbcType=VARCHAR}, - - - #{indexFrequency,jdbcType=VARCHAR}, - - - #{indexFunction,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_evaluation_index_m - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - index_name = #{indexName,jdbcType=VARCHAR}, - - - index_definition = #{indexDefinition,jdbcType=VARCHAR}, - - - index_frequency = #{indexFrequency,jdbcType=VARCHAR}, - - - index_function = #{indexFunction,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - evaluationCriterion_bacteriology_Ids = #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - - - evaluationCriterion_disinfectant_Ids = #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, - - - evaluationCriterion_sensoryorgans_Ids = #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - - - evaluationCriterion_toxicology_Ids = #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_index_m - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - index_name = #{indexName,jdbcType=VARCHAR}, - index_definition = #{indexDefinition,jdbcType=VARCHAR}, - index_frequency = #{indexFrequency,jdbcType=VARCHAR}, - index_function = #{indexFunction,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - evaluationCriterion_bacteriology_Ids = #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - evaluationCriterion_disinfectant_Ids = #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, - evaluationCriterion_sensoryorgans_Ids = #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - evaluationCriterion_toxicology_Ids = #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationIndexMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationIndexMapper.xml deleted file mode 100644 index d5fdb064..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationIndexMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, index_name, index_definition, index_frequency, index_function, - remark, evaluationCriterionIds,type - - - - - delete from tb_evaluation_index - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_index - ${where} - - - insert into tb_evaluation_index (id, insdt, insuser, - index_name, index_definition, index_frequency, - index_function, remark, evaluationCriterionIds,type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{indexName,jdbcType=VARCHAR}, #{indexDefinition,jdbcType=VARCHAR}, #{indexFrequency,jdbcType=VARCHAR}, - #{indexFunction,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{evaluationCriterionIds,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR}) - - - insert into tb_evaluation_index - - - id, - - - insdt, - - - insuser, - - - index_name, - - - index_definition, - - - index_frequency, - - - index_function, - - - remark, - - - evaluationCriterionIds, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{indexName,jdbcType=VARCHAR}, - - - #{indexDefinition,jdbcType=VARCHAR}, - - - #{indexFrequency,jdbcType=VARCHAR}, - - - #{indexFunction,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{evaluationCriterionIds,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_evaluation_index - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - index_name = #{indexName,jdbcType=VARCHAR}, - - - index_definition = #{indexDefinition,jdbcType=VARCHAR}, - - - index_frequency = #{indexFrequency,jdbcType=VARCHAR}, - - - index_function = #{indexFunction,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - evaluationCriterionIds = #{evaluationCriterionIds,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_index - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - index_name = #{indexName,jdbcType=VARCHAR}, - index_definition = #{indexDefinition,jdbcType=VARCHAR}, - index_frequency = #{indexFrequency,jdbcType=VARCHAR}, - index_function = #{indexFunction,jdbcType=VARCHAR}, - evaluationCriterionIds = #{evaluationCriterionIds,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationIndexMonthMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationIndexMonthMapper.xml deleted file mode 100644 index 2100e8fa..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationIndexMonthMapper.xml +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, date, criterion_bacteriology_value, criterion_disinfectant_value, criterion_sensoryorgan_value, - criterion_toxicology_value, sub_index_nation, sub_index_area, sub_index_company, - wqi_bacteriology_month_nation, wqi_bacteriology_month_area, wqi_bacteriology_month_company, - wqi_disinfectant_month_nation, wqi_disinfectant_month_area, wqi_disinfectant_month_company, - wqi_sensoryorgan_month_nation, wqi_sensoryorgan_month_area, wqi_sensoryorgan_month_company, - wqi_toxicology_month_nation, wqi_toxicology_month_area, wqi_toxicology_month_company, - wqi_month_nation, wqi_month_area, wqi_month_company - - - - - delete from tb_evaluation_index_month - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_index_month - ${where} - - - insert into tb_evaluation_index_month (id, insdt, date, - criterion_bacteriology_value, criterion_disinfectant_value, - criterion_sensoryorgan_value, criterion_toxicology_value, - sub_index_nation, sub_index_area, sub_index_company, - wqi_bacteriology_month_nation, wqi_bacteriology_month_area, - wqi_bacteriology_month_company, wqi_disinfectant_month_nation, - wqi_disinfectant_month_area, wqi_disinfectant_month_company, - wqi_sensoryorgan_month_nation, wqi_sensoryorgan_month_area, - wqi_sensoryorgan_month_company, wqi_toxicology_month_nation, - wqi_toxicology_month_area, wqi_toxicology_month_company, - wqi_month_nation, wqi_month_area, wqi_month_company - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{date,jdbcType=TIMESTAMP}, - #{criterionBacteriologyValue,jdbcType=VARCHAR}, #{criterionDisinfectantValue,jdbcType=VARCHAR}, - #{criterionSensoryorganValue,jdbcType=VARCHAR}, #{criterionToxicologyValue,jdbcType=VARCHAR}, - #{subIndexNation,jdbcType=VARCHAR}, #{subIndexArea,jdbcType=VARCHAR}, #{subIndexCompany,jdbcType=VARCHAR}, - #{wqiBacteriologyMonthNation,jdbcType=DOUBLE}, #{wqiBacteriologyMonthArea,jdbcType=DOUBLE}, - #{wqiBacteriologyMonthCompany,jdbcType=DOUBLE}, #{wqiDisinfectantMonthNation,jdbcType=DOUBLE}, - #{wqiDisinfectantMonthArea,jdbcType=DOUBLE}, #{wqiDisinfectantMonthCompany,jdbcType=DOUBLE}, - #{wqiSensoryorganMonthNation,jdbcType=DOUBLE}, #{wqiSensoryorganMonthArea,jdbcType=DOUBLE}, - #{wqiSensoryorganMonthCompany,jdbcType=DOUBLE}, #{wqiToxicologyMonthNation,jdbcType=DOUBLE}, - #{wqiToxicologyMonthArea,jdbcType=DOUBLE}, #{wqiToxicologyMonthCompany,jdbcType=DOUBLE}, - #{wqiMonthNation,jdbcType=DOUBLE}, #{wqiMonthArea,jdbcType=DOUBLE}, #{wqiMonthCompany,jdbcType=DOUBLE} - ) - - - insert into tb_evaluation_index_month - - - id, - - - insdt, - - - date, - - - criterion_bacteriology_value, - - - criterion_disinfectant_value, - - - criterion_sensoryorgan_value, - - - criterion_toxicology_value, - - - sub_index_nation, - - - sub_index_area, - - - sub_index_company, - - - wqi_bacteriology_month_nation, - - - wqi_bacteriology_month_area, - - - wqi_bacteriology_month_company, - - - wqi_disinfectant_month_nation, - - - wqi_disinfectant_month_area, - - - wqi_disinfectant_month_company, - - - wqi_sensoryorgan_month_nation, - - - wqi_sensoryorgan_month_area, - - - wqi_sensoryorgan_month_company, - - - wqi_toxicology_month_nation, - - - wqi_toxicology_month_area, - - - wqi_toxicology_month_company, - - - wqi_month_nation, - - - wqi_month_area, - - - wqi_month_company, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{date,jdbcType=TIMESTAMP}, - - - #{criterionBacteriologyValue,jdbcType=VARCHAR}, - - - #{criterionDisinfectantValue,jdbcType=VARCHAR}, - - - #{criterionSensoryorganValue,jdbcType=VARCHAR}, - - - #{criterionToxicologyValue,jdbcType=VARCHAR}, - - - #{subIndexNation,jdbcType=VARCHAR}, - - - #{subIndexArea,jdbcType=VARCHAR}, - - - #{subIndexCompany,jdbcType=VARCHAR}, - - - #{wqiBacteriologyMonthNation,jdbcType=DOUBLE}, - - - #{wqiBacteriologyMonthArea,jdbcType=DOUBLE}, - - - #{wqiBacteriologyMonthCompany,jdbcType=DOUBLE}, - - - #{wqiDisinfectantMonthNation,jdbcType=DOUBLE}, - - - #{wqiDisinfectantMonthArea,jdbcType=DOUBLE}, - - - #{wqiDisinfectantMonthCompany,jdbcType=DOUBLE}, - - - #{wqiSensoryorganMonthNation,jdbcType=DOUBLE}, - - - #{wqiSensoryorganMonthArea,jdbcType=DOUBLE}, - - - #{wqiSensoryorganMonthCompany,jdbcType=DOUBLE}, - - - #{wqiToxicologyMonthNation,jdbcType=DOUBLE}, - - - #{wqiToxicologyMonthArea,jdbcType=DOUBLE}, - - - #{wqiToxicologyMonthCompany,jdbcType=DOUBLE}, - - - #{wqiMonthNation,jdbcType=DOUBLE}, - - - #{wqiMonthArea,jdbcType=DOUBLE}, - - - #{wqiMonthCompany,jdbcType=DOUBLE}, - - - - - update tb_evaluation_index_month - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - date = #{date,jdbcType=TIMESTAMP}, - - - criterion_bacteriology_value = #{criterionBacteriologyValue,jdbcType=VARCHAR}, - - - criterion_disinfectant_value = #{criterionDisinfectantValue,jdbcType=VARCHAR}, - - - criterion_sensoryorgan_value = #{criterionSensoryorganValue,jdbcType=VARCHAR}, - - - criterion_toxicology_value = #{criterionToxicologyValue,jdbcType=VARCHAR}, - - - sub_index_nation = #{subIndexNation,jdbcType=VARCHAR}, - - - sub_index_area = #{subIndexArea,jdbcType=VARCHAR}, - - - sub_index_company = #{subIndexCompany,jdbcType=VARCHAR}, - - - wqi_bacteriology_month_nation = #{wqiBacteriologyMonthNation,jdbcType=DOUBLE}, - - - wqi_bacteriology_month_area = #{wqiBacteriologyMonthArea,jdbcType=DOUBLE}, - - - wqi_bacteriology_month_company = #{wqiBacteriologyMonthCompany,jdbcType=DOUBLE}, - - - wqi_disinfectant_month_nation = #{wqiDisinfectantMonthNation,jdbcType=DOUBLE}, - - - wqi_disinfectant_month_area = #{wqiDisinfectantMonthArea,jdbcType=DOUBLE}, - - - wqi_disinfectant_month_company = #{wqiDisinfectantMonthCompany,jdbcType=DOUBLE}, - - - wqi_sensoryorgan_month_nation = #{wqiSensoryorganMonthNation,jdbcType=DOUBLE}, - - - wqi_sensoryorgan_month_area = #{wqiSensoryorganMonthArea,jdbcType=DOUBLE}, - - - wqi_sensoryorgan_month_company = #{wqiSensoryorganMonthCompany,jdbcType=DOUBLE}, - - - wqi_toxicology_month_nation = #{wqiToxicologyMonthNation,jdbcType=DOUBLE}, - - - wqi_toxicology_month_area = #{wqiToxicologyMonthArea,jdbcType=DOUBLE}, - - - wqi_toxicology_month_company = #{wqiToxicologyMonthCompany,jdbcType=DOUBLE}, - - - wqi_month_nation = #{wqiMonthNation,jdbcType=DOUBLE}, - - - wqi_month_area = #{wqiMonthArea,jdbcType=DOUBLE}, - - - wqi_month_company = #{wqiMonthCompany,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_index_month - set insdt = #{insdt,jdbcType=TIMESTAMP}, - date = #{date,jdbcType=TIMESTAMP}, - criterion_bacteriology_value = #{criterionBacteriologyValue,jdbcType=VARCHAR}, - criterion_disinfectant_value = #{criterionDisinfectantValue,jdbcType=VARCHAR}, - criterion_sensoryorgan_value = #{criterionSensoryorganValue,jdbcType=VARCHAR}, - criterion_toxicology_value = #{criterionToxicologyValue,jdbcType=VARCHAR}, - sub_index_nation = #{subIndexNation,jdbcType=VARCHAR}, - sub_index_area = #{subIndexArea,jdbcType=VARCHAR}, - sub_index_company = #{subIndexCompany,jdbcType=VARCHAR}, - wqi_bacteriology_month_nation = #{wqiBacteriologyMonthNation,jdbcType=DOUBLE}, - wqi_bacteriology_month_area = #{wqiBacteriologyMonthArea,jdbcType=DOUBLE}, - wqi_bacteriology_month_company = #{wqiBacteriologyMonthCompany,jdbcType=DOUBLE}, - wqi_disinfectant_month_nation = #{wqiDisinfectantMonthNation,jdbcType=DOUBLE}, - wqi_disinfectant_month_area = #{wqiDisinfectantMonthArea,jdbcType=DOUBLE}, - wqi_disinfectant_month_company = #{wqiDisinfectantMonthCompany,jdbcType=DOUBLE}, - wqi_sensoryorgan_month_nation = #{wqiSensoryorganMonthNation,jdbcType=DOUBLE}, - wqi_sensoryorgan_month_area = #{wqiSensoryorganMonthArea,jdbcType=DOUBLE}, - wqi_sensoryorgan_month_company = #{wqiSensoryorganMonthCompany,jdbcType=DOUBLE}, - wqi_toxicology_month_nation = #{wqiToxicologyMonthNation,jdbcType=DOUBLE}, - wqi_toxicology_month_area = #{wqiToxicologyMonthArea,jdbcType=DOUBLE}, - wqi_toxicology_month_company = #{wqiToxicologyMonthCompany,jdbcType=DOUBLE}, - wqi_month_nation = #{wqiMonthNation,jdbcType=DOUBLE}, - wqi_month_area = #{wqiMonthArea,jdbcType=DOUBLE}, - wqi_month_company = #{wqiMonthCompany,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationIndexYMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationIndexYMapper.xml deleted file mode 100644 index 14d441fa..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationIndexYMapper.xml +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, index_name, index_definition, index_frequency, index_function, - remark, evaluationCriterion_bacteriology_Ids, evaluationCriterion_disinfectant_Ids, - evaluationCriterion_sensoryorgans_Ids, evaluationCriterion_toxicology_Ids, evaluationCriterion_organic_Ids, - evaluationCriterion_smell_Ids, evaluationCriterion_dbps_Ids, type - - - - - delete from tb_evaluation_index_y - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_index_y - ${where} - - - insert into tb_evaluation_index_y (id, insdt, insuser, - index_name, index_definition, index_frequency, - index_function, remark, evaluationCriterion_bacteriology_Ids, - evaluationCriterion_disinfectant_Ids, evaluationCriterion_sensoryorgans_Ids, - evaluationCriterion_toxicology_Ids, evaluationCriterion_organic_Ids, - evaluationCriterion_smell_Ids, evaluationCriterion_dbps_Ids, - type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{indexName,jdbcType=VARCHAR}, #{indexDefinition,jdbcType=VARCHAR}, #{indexFrequency,jdbcType=VARCHAR}, - #{indexFunction,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, #{evaluationcriterionOrganicIds,jdbcType=VARCHAR}, - #{evaluationcriterionSmellIds,jdbcType=VARCHAR}, #{evaluationcriterionDbpsIds,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_evaluation_index_y - - - id, - - - insdt, - - - insuser, - - - index_name, - - - index_definition, - - - index_frequency, - - - index_function, - - - remark, - - - evaluationCriterion_bacteriology_Ids, - - - evaluationCriterion_disinfectant_Ids, - - - evaluationCriterion_sensoryorgans_Ids, - - - evaluationCriterion_toxicology_Ids, - - - evaluationCriterion_organic_Ids, - - - evaluationCriterion_smell_Ids, - - - evaluationCriterion_dbps_Ids, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{indexName,jdbcType=VARCHAR}, - - - #{indexDefinition,jdbcType=VARCHAR}, - - - #{indexFrequency,jdbcType=VARCHAR}, - - - #{indexFunction,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionOrganicIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionSmellIds,jdbcType=VARCHAR}, - - - #{evaluationcriterionDbpsIds,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_evaluation_index_y - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - index_name = #{indexName,jdbcType=VARCHAR}, - - - index_definition = #{indexDefinition,jdbcType=VARCHAR}, - - - index_frequency = #{indexFrequency,jdbcType=VARCHAR}, - - - index_function = #{indexFunction,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - evaluationCriterion_bacteriology_Ids = #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - - - evaluationCriterion_disinfectant_Ids = #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, - - - evaluationCriterion_sensoryorgans_Ids = #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - - - evaluationCriterion_toxicology_Ids = #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, - - - evaluationCriterion_organic_Ids = #{evaluationcriterionOrganicIds,jdbcType=VARCHAR}, - - - evaluationCriterion_smell_Ids = #{evaluationcriterionSmellIds,jdbcType=VARCHAR}, - - - evaluationCriterion_dbps_Ids = #{evaluationcriterionDbpsIds,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_index_y - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - index_name = #{indexName,jdbcType=VARCHAR}, - index_definition = #{indexDefinition,jdbcType=VARCHAR}, - index_frequency = #{indexFrequency,jdbcType=VARCHAR}, - index_function = #{indexFunction,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - evaluationCriterion_bacteriology_Ids = #{evaluationcriterionBacteriologyIds,jdbcType=VARCHAR}, - evaluationCriterion_disinfectant_Ids = #{evaluationcriterionDisinfectantIds,jdbcType=VARCHAR}, - evaluationCriterion_sensoryorgans_Ids = #{evaluationcriterionSensoryorgansIds,jdbcType=VARCHAR}, - evaluationCriterion_toxicology_Ids = #{evaluationcriterionToxicologyIds,jdbcType=VARCHAR}, - evaluationCriterion_organic_Ids = #{evaluationcriterionOrganicIds,jdbcType=VARCHAR}, - evaluationCriterion_smell_Ids = #{evaluationcriterionSmellIds,jdbcType=VARCHAR}, - evaluationCriterion_dbps_Ids = #{evaluationcriterionDbpsIds,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/evaluation/EvaluationIndexYearMapper.xml b/src/com/sipai/mapper/evaluation/EvaluationIndexYearMapper.xml deleted file mode 100644 index 944dc944..00000000 --- a/src/com/sipai/mapper/evaluation/EvaluationIndexYearMapper.xml +++ /dev/null @@ -1,530 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, date, criterion_bacteriology_value, criterion_disinfectant_value, criterion_sensoryorgan_value, - criterion_toxicology_value, criterion_organic_value, criterion_smell_value, criterion_dbps_value, - wqi_bacteriology_year_nation, wqi_bacteriology_year_area, wqi_bacteriology_year_company, - wqi_disinfectant_year_nation, wqi_disinfectant_year_area, wqi_disinfectant_year_company, - wqi_sensoryorgan_year_nation, wqi_sensoryorgan_year_area, wqi_sensoryorgan_year_company, - wqi_toxicology_year_nation, wqi_toxicology_year_area, wqi_toxicology_year_company, - wqi_organic_year_nation, wqi_organic_year_area, wqi_organic_year_company, wqi_smell_year_nation, - wqi_smell_year_area, wqi_smell_year_company, wqi_dbps_year_nation, wqi_dbps_year_area, - wqi_dbps_year_company, wqi_basic_year_nation, wqi_basic_year_area, wqi_basic_year_company, - wqi_features_year_nation, wqi_features_year_area, wqi_features_year_company, wqi_year_nation, - wqi_year_area, wqi_year_company - - - - - delete from tb_evaluation_index_year - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_evaluation_index_year - ${where} - - - insert into tb_evaluation_index_year (id, insdt, date, - criterion_bacteriology_value, criterion_disinfectant_value, - criterion_sensoryorgan_value, criterion_toxicology_value, - criterion_organic_value, criterion_smell_value, - criterion_dbps_value, wqi_bacteriology_year_nation, - wqi_bacteriology_year_area, wqi_bacteriology_year_company, - wqi_disinfectant_year_nation, wqi_disinfectant_year_area, - wqi_disinfectant_year_company, wqi_sensoryorgan_year_nation, - wqi_sensoryorgan_year_area, wqi_sensoryorgan_year_company, - wqi_toxicology_year_nation, wqi_toxicology_year_area, - wqi_toxicology_year_company, wqi_organic_year_nation, - wqi_organic_year_area, wqi_organic_year_company, - wqi_smell_year_nation, wqi_smell_year_area, wqi_smell_year_company, - wqi_dbps_year_nation, wqi_dbps_year_area, wqi_dbps_year_company, - wqi_basic_year_nation, wqi_basic_year_area, wqi_basic_year_company, - wqi_features_year_nation, wqi_features_year_area, - wqi_features_year_company, wqi_year_nation, wqi_year_area, - wqi_year_company) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{date,jdbcType=VARCHAR}, - #{criterionBacteriologyValue,jdbcType=VARCHAR}, #{criterionDisinfectantValue,jdbcType=VARCHAR}, - #{criterionSensoryorganValue,jdbcType=VARCHAR}, #{criterionToxicologyValue,jdbcType=VARCHAR}, - #{criterionOrganicValue,jdbcType=VARCHAR}, #{criterionSmellValue,jdbcType=VARCHAR}, - #{criterionDbpsValue,jdbcType=VARCHAR}, #{wqiBacteriologyYearNation,jdbcType=DOUBLE}, - #{wqiBacteriologyYearArea,jdbcType=DOUBLE}, #{wqiBacteriologyYearCompany,jdbcType=DOUBLE}, - #{wqiDisinfectantYearNation,jdbcType=DOUBLE}, #{wqiDisinfectantYearArea,jdbcType=DOUBLE}, - #{wqiDisinfectantYearCompany,jdbcType=DOUBLE}, #{wqiSensoryorganYearNation,jdbcType=DOUBLE}, - #{wqiSensoryorganYearArea,jdbcType=DOUBLE}, #{wqiSensoryorganYearCompany,jdbcType=DOUBLE}, - #{wqiToxicologyYearNation,jdbcType=DOUBLE}, #{wqiToxicologyYearArea,jdbcType=DOUBLE}, - #{wqiToxicologyYearCompany,jdbcType=DOUBLE}, #{wqiOrganicYearNation,jdbcType=DOUBLE}, - #{wqiOrganicYearArea,jdbcType=DOUBLE}, #{wqiOrganicYearCompany,jdbcType=DOUBLE}, - #{wqiSmellYearNation,jdbcType=DOUBLE}, #{wqiSmellYearArea,jdbcType=DOUBLE}, #{wqiSmellYearCompany,jdbcType=DOUBLE}, - #{wqiDbpsYearNation,jdbcType=DOUBLE}, #{wqiDbpsYearArea,jdbcType=DOUBLE}, #{wqiDbpsYearCompany,jdbcType=DOUBLE}, - #{wqiBasicYearNation,jdbcType=DOUBLE}, #{wqiBasicYearArea,jdbcType=DOUBLE}, #{wqiBasicYearCompany,jdbcType=DOUBLE}, - #{wqiFeaturesYearNation,jdbcType=DOUBLE}, #{wqiFeaturesYearArea,jdbcType=DOUBLE}, - #{wqiFeaturesYearCompany,jdbcType=DOUBLE}, #{wqiYearNation,jdbcType=DOUBLE}, #{wqiYearArea,jdbcType=DOUBLE}, - #{wqiYearCompany,jdbcType=DOUBLE}) - - - insert into tb_evaluation_index_year - - - id, - - - insdt, - - - date, - - - criterion_bacteriology_value, - - - criterion_disinfectant_value, - - - criterion_sensoryorgan_value, - - - criterion_toxicology_value, - - - criterion_organic_value, - - - criterion_smell_value, - - - criterion_dbps_value, - - - wqi_bacteriology_year_nation, - - - wqi_bacteriology_year_area, - - - wqi_bacteriology_year_company, - - - wqi_disinfectant_year_nation, - - - wqi_disinfectant_year_area, - - - wqi_disinfectant_year_company, - - - wqi_sensoryorgan_year_nation, - - - wqi_sensoryorgan_year_area, - - - wqi_sensoryorgan_year_company, - - - wqi_toxicology_year_nation, - - - wqi_toxicology_year_area, - - - wqi_toxicology_year_company, - - - wqi_organic_year_nation, - - - wqi_organic_year_area, - - - wqi_organic_year_company, - - - wqi_smell_year_nation, - - - wqi_smell_year_area, - - - wqi_smell_year_company, - - - wqi_dbps_year_nation, - - - wqi_dbps_year_area, - - - wqi_dbps_year_company, - - - wqi_basic_year_nation, - - - wqi_basic_year_area, - - - wqi_basic_year_company, - - - wqi_features_year_nation, - - - wqi_features_year_area, - - - wqi_features_year_company, - - - wqi_year_nation, - - - wqi_year_area, - - - wqi_year_company, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{date,jdbcType=VARCHAR}, - - - #{criterionBacteriologyValue,jdbcType=VARCHAR}, - - - #{criterionDisinfectantValue,jdbcType=VARCHAR}, - - - #{criterionSensoryorganValue,jdbcType=VARCHAR}, - - - #{criterionToxicologyValue,jdbcType=VARCHAR}, - - - #{criterionOrganicValue,jdbcType=VARCHAR}, - - - #{criterionSmellValue,jdbcType=VARCHAR}, - - - #{criterionDbpsValue,jdbcType=VARCHAR}, - - - #{wqiBacteriologyYearNation,jdbcType=DOUBLE}, - - - #{wqiBacteriologyYearArea,jdbcType=DOUBLE}, - - - #{wqiBacteriologyYearCompany,jdbcType=DOUBLE}, - - - #{wqiDisinfectantYearNation,jdbcType=DOUBLE}, - - - #{wqiDisinfectantYearArea,jdbcType=DOUBLE}, - - - #{wqiDisinfectantYearCompany,jdbcType=DOUBLE}, - - - #{wqiSensoryorganYearNation,jdbcType=DOUBLE}, - - - #{wqiSensoryorganYearArea,jdbcType=DOUBLE}, - - - #{wqiSensoryorganYearCompany,jdbcType=DOUBLE}, - - - #{wqiToxicologyYearNation,jdbcType=DOUBLE}, - - - #{wqiToxicologyYearArea,jdbcType=DOUBLE}, - - - #{wqiToxicologyYearCompany,jdbcType=DOUBLE}, - - - #{wqiOrganicYearNation,jdbcType=DOUBLE}, - - - #{wqiOrganicYearArea,jdbcType=DOUBLE}, - - - #{wqiOrganicYearCompany,jdbcType=DOUBLE}, - - - #{wqiSmellYearNation,jdbcType=DOUBLE}, - - - #{wqiSmellYearArea,jdbcType=DOUBLE}, - - - #{wqiSmellYearCompany,jdbcType=DOUBLE}, - - - #{wqiDbpsYearNation,jdbcType=DOUBLE}, - - - #{wqiDbpsYearArea,jdbcType=DOUBLE}, - - - #{wqiDbpsYearCompany,jdbcType=DOUBLE}, - - - #{wqiBasicYearNation,jdbcType=DOUBLE}, - - - #{wqiBasicYearArea,jdbcType=DOUBLE}, - - - #{wqiBasicYearCompany,jdbcType=DOUBLE}, - - - #{wqiFeaturesYearNation,jdbcType=DOUBLE}, - - - #{wqiFeaturesYearArea,jdbcType=DOUBLE}, - - - #{wqiFeaturesYearCompany,jdbcType=DOUBLE}, - - - #{wqiYearNation,jdbcType=DOUBLE}, - - - #{wqiYearArea,jdbcType=DOUBLE}, - - - #{wqiYearCompany,jdbcType=DOUBLE}, - - - - - update tb_evaluation_index_year - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - date = #{date,jdbcType=VARCHAR}, - - - criterion_bacteriology_value = #{criterionBacteriologyValue,jdbcType=VARCHAR}, - - - criterion_disinfectant_value = #{criterionDisinfectantValue,jdbcType=VARCHAR}, - - - criterion_sensoryorgan_value = #{criterionSensoryorganValue,jdbcType=VARCHAR}, - - - criterion_toxicology_value = #{criterionToxicologyValue,jdbcType=VARCHAR}, - - - criterion_organic_value = #{criterionOrganicValue,jdbcType=VARCHAR}, - - - criterion_smell_value = #{criterionSmellValue,jdbcType=VARCHAR}, - - - criterion_dbps_value = #{criterionDbpsValue,jdbcType=VARCHAR}, - - - wqi_bacteriology_year_nation = #{wqiBacteriologyYearNation,jdbcType=DOUBLE}, - - - wqi_bacteriology_year_area = #{wqiBacteriologyYearArea,jdbcType=DOUBLE}, - - - wqi_bacteriology_year_company = #{wqiBacteriologyYearCompany,jdbcType=DOUBLE}, - - - wqi_disinfectant_year_nation = #{wqiDisinfectantYearNation,jdbcType=DOUBLE}, - - - wqi_disinfectant_year_area = #{wqiDisinfectantYearArea,jdbcType=DOUBLE}, - - - wqi_disinfectant_year_company = #{wqiDisinfectantYearCompany,jdbcType=DOUBLE}, - - - wqi_sensoryorgan_year_nation = #{wqiSensoryorganYearNation,jdbcType=DOUBLE}, - - - wqi_sensoryorgan_year_area = #{wqiSensoryorganYearArea,jdbcType=DOUBLE}, - - - wqi_sensoryorgan_year_company = #{wqiSensoryorganYearCompany,jdbcType=DOUBLE}, - - - wqi_toxicology_year_nation = #{wqiToxicologyYearNation,jdbcType=DOUBLE}, - - - wqi_toxicology_year_area = #{wqiToxicologyYearArea,jdbcType=DOUBLE}, - - - wqi_toxicology_year_company = #{wqiToxicologyYearCompany,jdbcType=DOUBLE}, - - - wqi_organic_year_nation = #{wqiOrganicYearNation,jdbcType=DOUBLE}, - - - wqi_organic_year_area = #{wqiOrganicYearArea,jdbcType=DOUBLE}, - - - wqi_organic_year_company = #{wqiOrganicYearCompany,jdbcType=DOUBLE}, - - - wqi_smell_year_nation = #{wqiSmellYearNation,jdbcType=DOUBLE}, - - - wqi_smell_year_area = #{wqiSmellYearArea,jdbcType=DOUBLE}, - - - wqi_smell_year_company = #{wqiSmellYearCompany,jdbcType=DOUBLE}, - - - wqi_dbps_year_nation = #{wqiDbpsYearNation,jdbcType=DOUBLE}, - - - wqi_dbps_year_area = #{wqiDbpsYearArea,jdbcType=DOUBLE}, - - - wqi_dbps_year_company = #{wqiDbpsYearCompany,jdbcType=DOUBLE}, - - - wqi_basic_year_nation = #{wqiBasicYearNation,jdbcType=DOUBLE}, - - - wqi_basic_year_area = #{wqiBasicYearArea,jdbcType=DOUBLE}, - - - wqi_basic_year_company = #{wqiBasicYearCompany,jdbcType=DOUBLE}, - - - wqi_features_year_nation = #{wqiFeaturesYearNation,jdbcType=DOUBLE}, - - - wqi_features_year_area = #{wqiFeaturesYearArea,jdbcType=DOUBLE}, - - - wqi_features_year_company = #{wqiFeaturesYearCompany,jdbcType=DOUBLE}, - - - wqi_year_nation = #{wqiYearNation,jdbcType=DOUBLE}, - - - wqi_year_area = #{wqiYearArea,jdbcType=DOUBLE}, - - - wqi_year_company = #{wqiYearCompany,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_evaluation_index_year - set insdt = #{insdt,jdbcType=TIMESTAMP}, - date = #{date,jdbcType=VARCHAR}, - criterion_bacteriology_value = #{criterionBacteriologyValue,jdbcType=VARCHAR}, - criterion_disinfectant_value = #{criterionDisinfectantValue,jdbcType=VARCHAR}, - criterion_sensoryorgan_value = #{criterionSensoryorganValue,jdbcType=VARCHAR}, - criterion_toxicology_value = #{criterionToxicologyValue,jdbcType=VARCHAR}, - criterion_organic_value = #{criterionOrganicValue,jdbcType=VARCHAR}, - criterion_smell_value = #{criterionSmellValue,jdbcType=VARCHAR}, - criterion_dbps_value = #{criterionDbpsValue,jdbcType=VARCHAR}, - wqi_bacteriology_year_nation = #{wqiBacteriologyYearNation,jdbcType=DOUBLE}, - wqi_bacteriology_year_area = #{wqiBacteriologyYearArea,jdbcType=DOUBLE}, - wqi_bacteriology_year_company = #{wqiBacteriologyYearCompany,jdbcType=DOUBLE}, - wqi_disinfectant_year_nation = #{wqiDisinfectantYearNation,jdbcType=DOUBLE}, - wqi_disinfectant_year_area = #{wqiDisinfectantYearArea,jdbcType=DOUBLE}, - wqi_disinfectant_year_company = #{wqiDisinfectantYearCompany,jdbcType=DOUBLE}, - wqi_sensoryorgan_year_nation = #{wqiSensoryorganYearNation,jdbcType=DOUBLE}, - wqi_sensoryorgan_year_area = #{wqiSensoryorganYearArea,jdbcType=DOUBLE}, - wqi_sensoryorgan_year_company = #{wqiSensoryorganYearCompany,jdbcType=DOUBLE}, - wqi_toxicology_year_nation = #{wqiToxicologyYearNation,jdbcType=DOUBLE}, - wqi_toxicology_year_area = #{wqiToxicologyYearArea,jdbcType=DOUBLE}, - wqi_toxicology_year_company = #{wqiToxicologyYearCompany,jdbcType=DOUBLE}, - wqi_organic_year_nation = #{wqiOrganicYearNation,jdbcType=DOUBLE}, - wqi_organic_year_area = #{wqiOrganicYearArea,jdbcType=DOUBLE}, - wqi_organic_year_company = #{wqiOrganicYearCompany,jdbcType=DOUBLE}, - wqi_smell_year_nation = #{wqiSmellYearNation,jdbcType=DOUBLE}, - wqi_smell_year_area = #{wqiSmellYearArea,jdbcType=DOUBLE}, - wqi_smell_year_company = #{wqiSmellYearCompany,jdbcType=DOUBLE}, - wqi_dbps_year_nation = #{wqiDbpsYearNation,jdbcType=DOUBLE}, - wqi_dbps_year_area = #{wqiDbpsYearArea,jdbcType=DOUBLE}, - wqi_dbps_year_company = #{wqiDbpsYearCompany,jdbcType=DOUBLE}, - wqi_basic_year_nation = #{wqiBasicYearNation,jdbcType=DOUBLE}, - wqi_basic_year_area = #{wqiBasicYearArea,jdbcType=DOUBLE}, - wqi_basic_year_company = #{wqiBasicYearCompany,jdbcType=DOUBLE}, - wqi_features_year_nation = #{wqiFeaturesYearNation,jdbcType=DOUBLE}, - wqi_features_year_area = #{wqiFeaturesYearArea,jdbcType=DOUBLE}, - wqi_features_year_company = #{wqiFeaturesYearCompany,jdbcType=DOUBLE}, - wqi_year_nation = #{wqiYearNation,jdbcType=DOUBLE}, - wqi_year_area = #{wqiYearArea,jdbcType=DOUBLE}, - wqi_year_company = #{wqiYearCompany,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/DaytestPaperMapper.xml b/src/com/sipai/mapper/exam/DaytestPaperMapper.xml deleted file mode 100644 index 9983af97..00000000 --- a/src/com/sipai/mapper/exam/DaytestPaperMapper.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, daytestrecordid, questitleid, answervalue, status, mark, ord, insuser, insdt, - upsuser, upsdt, questypeid, useranswer - - - - delete from tb_test_daytestpaper - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_daytestpaper (id, daytestrecordid, questitleid, - answervalue, status, mark, - ord, insuser, insdt, questypeid, - upsuser, upsdt) - values (#{id,jdbcType=VARCHAR}, #{daytestrecordid,jdbcType=VARCHAR}, #{questitleid,jdbcType=VARCHAR}, - #{answervalue,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{mark,jdbcType=VARCHAR}, - #{ord,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{questypeid,jdbcType=VARCHAR}, #{useranswer,jdbcType=VARCHAR}) - - - insert into tb_test_daytestpaper - - - id, - - - daytestrecordid, - - - questitleid, - - - answervalue, - - - status, - - - mark, - - - ord, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - questypeid, - - - useranswer, - - - - - #{id,jdbcType=VARCHAR}, - - - #{daytestrecordid,jdbcType=VARCHAR}, - - - #{questitleid,jdbcType=VARCHAR}, - - - #{answervalue,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{mark,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{questypeid,jdbcType=VARCHAR}, - - - #{useranswer,jdbcType=VARCHAR}, - - - - - update tb_test_daytestpaper - - - daytestrecordid = #{daytestrecordid,jdbcType=VARCHAR}, - - - questitleid = #{questitleid,jdbcType=VARCHAR}, - - - answervalue = #{answervalue,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - mark = #{mark,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - questypeid = #{questypeid,jdbcType=VARCHAR}, - - - useranswer = #{useranswer,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_daytestpaper - set daytestrecordid = #{daytestrecordid,jdbcType=VARCHAR}, - questitleid = #{questitleid,jdbcType=VARCHAR}, - answervalue = #{answervalue,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - mark = #{mark,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - questypeid = #{questypeid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_daytestpaper - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/DaytestQuesOptionMapper.xml b/src/com/sipai/mapper/exam/DaytestQuesOptionMapper.xml deleted file mode 100644 index bf22aaaa..00000000 --- a/src/com/sipai/mapper/exam/DaytestQuesOptionMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, daytestpaperid, quesoptionid, optionnumber, ord, insuser, insdt, upsuser, upsdt - - - - delete from tb_test_daytestQuesOption - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_daytestQuesOption (id, daytestpaperid, quesoptionid, - optionnumber, ord, insuser, - insdt, upsuser, upsdt - ) - values (#{id,jdbcType=VARCHAR}, #{daytestpaperid,jdbcType=VARCHAR}, #{quesoptionid,jdbcType=VARCHAR}, - #{optionnumber,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP} - ) - - - insert into tb_test_daytestQuesOption - - - id, - - - daytestpaperid, - - - quesoptionid, - - - optionnumber, - - - ord, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{daytestpaperid,jdbcType=VARCHAR}, - - - #{quesoptionid,jdbcType=VARCHAR}, - - - #{optionnumber,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_test_daytestQuesOption - - - daytestpaperid = #{daytestpaperid,jdbcType=VARCHAR}, - - - quesoptionid = #{quesoptionid,jdbcType=VARCHAR}, - - - optionnumber = #{optionnumber,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_daytestQuesOption - set daytestpaperid = #{daytestpaperid,jdbcType=VARCHAR}, - quesoptionid = #{quesoptionid,jdbcType=VARCHAR}, - optionnumber = #{optionnumber,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_daytestQuesOption - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/DaytestRecordMapper.xml b/src/com/sipai/mapper/exam/DaytestRecordMapper.xml deleted file mode 100644 index 424caa82..00000000 --- a/src/com/sipai/mapper/exam/DaytestRecordMapper.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - id, examuserid, examstarttime, examendtime, status, insuser, insdt, memo, subjecttypeids, type - - - - delete from tb_test_daytestrecord - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_daytestrecord (id, examuserid, examstarttime, - examendtime, status, insuser, - insdt, memo, subjecttypeids) - values (#{id,jdbcType=VARCHAR}, #{examuserid,jdbcType=VARCHAR}, #{examstarttime,jdbcType=TIMESTAMP}, - #{examendtime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}, #{subjecttypeids,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR}) - - - insert into tb_test_daytestrecord - - - id, - - - examuserid, - - - examstarttime, - - - examendtime, - - - status, - - - insuser, - - - insdt, - - - memo, - - - subjecttypeids, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{examuserid,jdbcType=VARCHAR}, - - - #{examstarttime,jdbcType=TIMESTAMP}, - - - #{examendtime,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{memo,jdbcType=VARCHAR}, - - - #{subjecttypeids,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_test_daytestrecord - - - examuserid = #{examuserid,jdbcType=VARCHAR}, - - - examstarttime = #{examstarttime,jdbcType=TIMESTAMP}, - - - examendtime = #{examendtime,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - subjecttypeids = #{subjecttypeids,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_daytestrecord - set examuserid = #{examuserid,jdbcType=VARCHAR}, - examstarttime = #{examstarttime,jdbcType=TIMESTAMP}, - examendtime = #{examendtime,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - memo = #{memo,jdbcType=VARCHAR}, - subjecttypeids = #{subjecttypeids,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_daytestrecord - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/ExamPlanMapper.xml b/src/com/sipai/mapper/exam/ExamPlanMapper.xml deleted file mode 100644 index b8a7a036..00000000 --- a/src/com/sipai/mapper/exam/ExamPlanMapper.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, examhallid, examtype, passscore, exammethod, examnum, releasetime, status, insuser, - insdt, upsuser, upsdt, startdate, enddate, computescore, frequency, examminutes, - examuserids, memo, examname - - - - delete from tb_test_ExamPlan - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_ExamPlan (id, examhallid, examtype, - passscore, exammethod, examnum, - releasetime, status, insuser, - insdt, upsuser, upsdt, - startdate, enddate, computescore, - frequency, examminutes, examuserids, - memo, examname) - values (#{id,jdbcType=VARCHAR}, #{examhallid,jdbcType=VARCHAR}, #{examtype,jdbcType=VARCHAR}, - #{passscore,jdbcType=DOUBLE}, #{exammethod,jdbcType=VARCHAR}, #{examnum,jdbcType=INTEGER}, - #{releasetime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{startdate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP}, #{computescore,jdbcType=VARCHAR}, - #{frequency,jdbcType=VARCHAR}, #{examminutes,jdbcType=INTEGER}, #{examuserids,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{examname,jdbcType=VARCHAR}) - - - insert into tb_test_ExamPlan - - - id, - - - examhallid, - - - examtype, - - - passscore, - - - exammethod, - - - examnum, - - - releasetime, - - - status, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - startdate, - - - enddate, - - - computescore, - - - frequency, - - - examminutes, - - - examuserids, - - - memo, - - - examname, - - - - - #{id,jdbcType=VARCHAR}, - - - #{examhallid,jdbcType=VARCHAR}, - - - #{examtype,jdbcType=VARCHAR}, - - - #{passscore,jdbcType=DOUBLE}, - - - #{exammethod,jdbcType=VARCHAR}, - - - #{examnum,jdbcType=INTEGER}, - - - #{releasetime,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{startdate,jdbcType=TIMESTAMP}, - - - #{enddate,jdbcType=TIMESTAMP}, - - - #{computescore,jdbcType=VARCHAR}, - - - #{frequency,jdbcType=VARCHAR}, - - - #{examminutes,jdbcType=INTEGER}, - - - #{examuserids,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{examname,jdbcType=VARCHAR}, - - - - - update tb_test_ExamPlan - - - examhallid = #{examhallid,jdbcType=VARCHAR}, - - - examtype = #{examtype,jdbcType=VARCHAR}, - - - passscore = #{passscore,jdbcType=DOUBLE}, - - - exammethod = #{exammethod,jdbcType=VARCHAR}, - - - examnum = #{examnum,jdbcType=INTEGER}, - - - releasetime = #{releasetime,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - startdate = #{startdate,jdbcType=TIMESTAMP}, - - - enddate = #{enddate,jdbcType=TIMESTAMP}, - - - computescore = #{computescore,jdbcType=VARCHAR}, - - - frequency = #{frequency,jdbcType=VARCHAR}, - - - examminutes = #{examminutes,jdbcType=INTEGER}, - - - examuserids = #{examuserids,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - examname = #{examname,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_ExamPlan - set examhallid = #{examhallid,jdbcType=VARCHAR}, - examtype = #{examtype,jdbcType=VARCHAR}, - passscore = #{passscore,jdbcType=DOUBLE}, - exammethod = #{exammethod,jdbcType=VARCHAR}, - examnum = #{examnum,jdbcType=INTEGER}, - releasetime = #{releasetime,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - startdate = #{startdate,jdbcType=TIMESTAMP}, - enddate = #{enddate,jdbcType=TIMESTAMP}, - computescore = #{computescore,jdbcType=VARCHAR}, - frequency = #{frequency,jdbcType=VARCHAR}, - examminutes = #{examminutes,jdbcType=INTEGER}, - examuserids = #{examuserids,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - examname = #{examname,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_ExamPlan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/ExamRecordMapper.xml b/src/com/sipai/mapper/exam/ExamRecordMapper.xml deleted file mode 100644 index c7cbed2a..00000000 --- a/src/com/sipai/mapper/exam/ExamRecordMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, examplanid, examhallid, examcount, startdate, enddate, examuserid, examusernumber, - examdate, examstarttime, examendtime, examscore, status, insuser, insdt, passstatus - - - - delete from tb_test_ExamRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_ExamRecord (id, examplanid, examhallid, - examcount, startdate, enddate, - examuserid, examusernumber, examdate, - examstarttime, examendtime, examscore, - status, insuser, insdt, - passstatus) - values (#{id,jdbcType=VARCHAR}, #{examplanid,jdbcType=VARCHAR}, #{examhallid,jdbcType=VARCHAR}, - #{examcount,jdbcType=INTEGER}, #{startdate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP}, - #{examuserid,jdbcType=VARCHAR}, #{examusernumber,jdbcType=VARCHAR}, #{examdate,jdbcType=TIMESTAMP}, - #{examstarttime,jdbcType=TIMESTAMP}, #{examendtime,jdbcType=TIMESTAMP}, #{examscore,jdbcType=DOUBLE}, - #{status,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{passstatus,jdbcType=VARCHAR}) - - - insert into tb_test_ExamRecord - - - id, - - - examplanid, - - - examhallid, - - - examcount, - - - startdate, - - - enddate, - - - examuserid, - - - examusernumber, - - - examdate, - - - examstarttime, - - - examendtime, - - - examscore, - - - status, - - - insuser, - - - insdt, - - - passstatus, - - - - - #{id,jdbcType=VARCHAR}, - - - #{examplanid,jdbcType=VARCHAR}, - - - #{examhallid,jdbcType=VARCHAR}, - - - #{examcount,jdbcType=INTEGER}, - - - #{startdate,jdbcType=TIMESTAMP}, - - - #{enddate,jdbcType=TIMESTAMP}, - - - #{examuserid,jdbcType=VARCHAR}, - - - #{examusernumber,jdbcType=VARCHAR}, - - - #{examdate,jdbcType=TIMESTAMP}, - - - #{examstarttime,jdbcType=TIMESTAMP}, - - - #{examendtime,jdbcType=TIMESTAMP}, - - - #{examscore,jdbcType=DOUBLE}, - - - #{status,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{passstatus,jdbcType=VARCHAR}, - - - - - update tb_test_ExamRecord - - - examplanid = #{examplanid,jdbcType=VARCHAR}, - - - examhallid = #{examhallid,jdbcType=VARCHAR}, - - - examcount = #{examcount,jdbcType=INTEGER}, - - - startdate = #{startdate,jdbcType=TIMESTAMP}, - - - enddate = #{enddate,jdbcType=TIMESTAMP}, - - - examuserid = #{examuserid,jdbcType=VARCHAR}, - - - examusernumber = #{examusernumber,jdbcType=VARCHAR}, - - - examdate = #{examdate,jdbcType=TIMESTAMP}, - - - examstarttime = #{examstarttime,jdbcType=TIMESTAMP}, - - - examendtime = #{examendtime,jdbcType=TIMESTAMP}, - - - examscore = #{examscore,jdbcType=DOUBLE}, - - - status = #{status,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - passstatus = #{passstatus,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_ExamRecord - set examplanid = #{examplanid,jdbcType=VARCHAR}, - examhallid = #{examhallid,jdbcType=VARCHAR}, - examcount = #{examcount,jdbcType=INTEGER}, - startdate = #{startdate,jdbcType=TIMESTAMP}, - enddate = #{enddate,jdbcType=TIMESTAMP}, - examuserid = #{examuserid,jdbcType=VARCHAR}, - examusernumber = #{examusernumber,jdbcType=VARCHAR}, - examdate = #{examdate,jdbcType=TIMESTAMP}, - examstarttime = #{examstarttime,jdbcType=TIMESTAMP}, - examendtime = #{examendtime,jdbcType=TIMESTAMP}, - examscore = #{examscore,jdbcType=DOUBLE}, - status = #{status,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - passstatus = #{passstatus,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - delete from - tb_test_ExamRecord - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/ExamTitleRangeMapper.xml b/src/com/sipai/mapper/exam/ExamTitleRangeMapper.xml deleted file mode 100644 index bb72fe61..00000000 --- a/src/com/sipai/mapper/exam/ExamTitleRangeMapper.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, pid, subjecttypeids, ranktypeids, questtypeid, singlyscore, titlenum, insuser, - insdt, upsuser, upsdt, ord - - - - delete from tb_test_ExamTitleRange - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_ExamTitleRange (id, pid, subjecttypeids, - ranktypeids, questtypeid, singlyscore, - titlenum, insuser, insdt, - upsuser, upsdt, ord) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{subjecttypeids,jdbcType=VARCHAR}, - #{ranktypeids,jdbcType=VARCHAR}, #{questtypeid,jdbcType=VARCHAR}, #{singlyscore,jdbcType=INTEGER}, - #{titlenum,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{ord,jdbcType=INTEGER}) - - - insert into tb_test_ExamTitleRange - - - id, - - - pid, - - - subjecttypeids, - - - ranktypeids, - - - questtypeid, - - - singlyscore, - - - titlenum, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - ord, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{subjecttypeids,jdbcType=VARCHAR}, - - - #{ranktypeids,jdbcType=VARCHAR}, - - - #{questtypeid,jdbcType=VARCHAR}, - - - #{singlyscore,jdbcType=INTEGER}, - - - #{titlenum,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{ord,jdbcType=INTEGER}, - - - - - update tb_test_ExamTitleRange - - - pid = #{pid,jdbcType=VARCHAR}, - - - subjecttypeids = #{subjecttypeids,jdbcType=VARCHAR}, - - - ranktypeids = #{ranktypeids,jdbcType=VARCHAR}, - - - questtypeid = #{questtypeid,jdbcType=VARCHAR}, - - - singlyscore = #{singlyscore,jdbcType=INTEGER}, - - - titlenum = #{titlenum,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - ord = #{ord,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_ExamTitleRange - set pid = #{pid,jdbcType=VARCHAR}, - subjecttypeids = #{subjecttypeids,jdbcType=VARCHAR}, - ranktypeids = #{ranktypeids,jdbcType=VARCHAR}, - questtypeid = #{questtypeid,jdbcType=VARCHAR}, - singlyscore = #{singlyscore,jdbcType=INTEGER}, - titlenum = #{titlenum,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - ord = #{ord,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_ExamTitleRange - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/TestPaperMapper.xml b/src/com/sipai/mapper/exam/TestPaperMapper.xml deleted file mode 100644 index d3e129d5..00000000 --- a/src/com/sipai/mapper/exam/TestPaperMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, examrecordid, questitleid, answervalue, useranswer, status, ord, insuser, insdt, - upsuser, upsdt, mark, questtypeid - - - - delete from tb_test_testpaper - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_testpaper (id, examrecordid, questitleid, - answervalue, useranswer, status, - ord, insuser, insdt, - upsuser, upsdt, mark, questtypeid - ) - values (#{id,jdbcType=VARCHAR}, #{examrecordid,jdbcType=VARCHAR}, #{questitleid,jdbcType=VARCHAR}, - #{answervalue,jdbcType=VARCHAR}, #{useranswer,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{ord,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{mark,jdbcType=VARCHAR}, #{questtypeid,jdbcType=VARCHAR} - ) - - - insert into tb_test_testpaper - - - id, - - - examrecordid, - - - questitleid, - - - answervalue, - - - useranswer, - - - status, - - - ord, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - mark, - - - questtypeid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{examrecordid,jdbcType=VARCHAR}, - - - #{questitleid,jdbcType=VARCHAR}, - - - #{answervalue,jdbcType=VARCHAR}, - - - #{useranswer,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{mark,jdbcType=VARCHAR}, - - - #{questtypeid,jdbcType=VARCHAR}, - - - - - update tb_test_testpaper - - - examrecordid = #{examrecordid,jdbcType=VARCHAR}, - - - questitleid = #{questitleid,jdbcType=VARCHAR}, - - - answervalue = #{answervalue,jdbcType=VARCHAR}, - - - useranswer = #{useranswer,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - mark = #{mark,jdbcType=VARCHAR}, - - - questtypeid = #{questtypeid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_testpaper - set examrecordid = #{examrecordid,jdbcType=VARCHAR}, - questitleid = #{questitleid,jdbcType=VARCHAR}, - answervalue = #{answervalue,jdbcType=VARCHAR}, - useranswer = #{useranswer,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - mark = #{mark,jdbcType=VARCHAR}, - questtypeid = #{questtypeid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_testpaper - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/exam/TestQuesOptionMapper.xml b/src/com/sipai/mapper/exam/TestQuesOptionMapper.xml deleted file mode 100644 index 4f091690..00000000 --- a/src/com/sipai/mapper/exam/TestQuesOptionMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, testpaperid, quesoptionid, optionnumber, ord, insuser, insdt, upsuser, upsdt - - - - delete from tb_test_QuesOption - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_test_QuesOption (id, testpaperid, quesoptionid, - optionnumber, ord, insuser, - insdt, upsuser, upsdt - ) - values (#{id,jdbcType=VARCHAR}, #{testpaperid,jdbcType=VARCHAR}, #{quesoptionid,jdbcType=VARCHAR}, - #{optionnumber,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP} - ) - - - insert into tb_test_QuesOption - - - id, - - - testpaperid, - - - quesoptionid, - - - optionnumber, - - - ord, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{testpaperid,jdbcType=VARCHAR}, - - - #{quesoptionid,jdbcType=VARCHAR}, - - - #{optionnumber,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_test_QuesOption - - - testpaperid = #{testpaperid,jdbcType=VARCHAR}, - - - quesoptionid = #{quesoptionid,jdbcType=VARCHAR}, - - - optionnumber = #{optionnumber,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_test_QuesOption - set testpaperid = #{testpaperid,jdbcType=VARCHAR}, - quesoptionid = #{quesoptionid,jdbcType=VARCHAR}, - optionnumber = #{optionnumber,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_test_QuesOption - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenBalanceMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenBalanceMapper.xml deleted file mode 100644 index 0da25460..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenBalanceMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - Name, StayTime, FlowSignal, - LeftSignal, LodSignal, LevelSignal, - Mode, WaterQualitySignal - - - insert into FangZhen_Balance (Name, StayTime, FlowSignal, - LeftSignal, LodSignal, LevelSignal, - Mode, WaterQualitySignal) - values (#{name,jdbcType=VARCHAR}, #{staytime,jdbcType=VARCHAR}, #{flowsignal,jdbcType=VARCHAR}, - #{leftsignal,jdbcType=VARCHAR}, #{lodsignal,jdbcType=VARCHAR}, #{levelsignal,jdbcType=VARCHAR}, - #{mode,jdbcType=INTEGER}, #{waterqualitysignal,jdbcType=VARCHAR}) - - - insert into FangZhen_Balance - - - Name, - - - StayTime, - - - FlowSignal, - - - LeftSignal, - - - LodSignal, - - - LevelSignal, - - - Mode, - - - WaterQualitySignal, - - - - - #{name,jdbcType=VARCHAR}, - - - #{staytime,jdbcType=VARCHAR}, - - - #{flowsignal,jdbcType=VARCHAR}, - - - #{leftsignal,jdbcType=VARCHAR}, - - - #{lodsignal,jdbcType=VARCHAR}, - - - #{levelsignal,jdbcType=VARCHAR}, - - - #{mode,jdbcType=INTEGER}, - - - #{waterqualitysignal,jdbcType=VARCHAR}, - - - - - - - - delete - from FangZhen_Balance ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenBrowserMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenBrowserMapper.xml deleted file mode 100644 index 4b368a82..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenBrowserMapper.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - BrowserName, X, Y, Width, Height, url, StationID, SceneModeIndex - - - - delete from FangZhen_Browser - where BrowserName = #{browsername,jdbcType=VARCHAR} - - - insert into FangZhen_Browser (BrowserName, X, Y, - Width, Height, url, StationID, - SceneModeIndex) - values (#{browsername,jdbcType=VARCHAR}, #{x,jdbcType=DOUBLE}, #{y,jdbcType=DOUBLE}, - #{width,jdbcType=DOUBLE}, #{height,jdbcType=DOUBLE}, #{url,jdbcType=VARCHAR}, #{stationid,jdbcType=VARCHAR}, - #{scenemodeindex,jdbcType=INTEGER}) - - - insert into FangZhen_Browser - - - BrowserName, - - - X, - - - Y, - - - Width, - - - Height, - - - url, - - - StationID, - - - SceneModeIndex, - - - - - #{browsername,jdbcType=VARCHAR}, - - - #{x,jdbcType=DOUBLE}, - - - #{y,jdbcType=DOUBLE}, - - - #{width,jdbcType=DOUBLE}, - - - #{height,jdbcType=DOUBLE}, - - - #{url,jdbcType=VARCHAR}, - - - #{stationid,jdbcType=VARCHAR}, - - - #{scenemodeindex,jdbcType=INTEGER}, - - - - - update FangZhen_Browser - - - X = #{x,jdbcType=DOUBLE}, - - - Y = #{y,jdbcType=DOUBLE}, - - - Width = #{width,jdbcType=DOUBLE}, - - - Height = #{height,jdbcType=DOUBLE}, - - - url = #{url,jdbcType=VARCHAR}, - - - StationID = #{stationid,jdbcType=VARCHAR}, - - - SceneModeIndex = #{scenemodeindex,jdbcType=INTEGER}, - - - where BrowserName = #{browsername,jdbcType=VARCHAR} - - - update FangZhen_Browser - set X = #{x,jdbcType=DOUBLE}, - Y = #{y,jdbcType=DOUBLE}, - Width = #{width,jdbcType=DOUBLE}, - Height = #{height,jdbcType=DOUBLE}, - url = #{url,jdbcType=VARCHAR}, - StationID = #{stationid,jdbcType=VARCHAR}, - SceneModeIndex = #{scenemodeindex,jdbcType=INTEGER} - where BrowserName = #{browsername,jdbcType=VARCHAR} - - - - - - delete - from FangZhen_Browser ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenEquipmentMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenEquipmentMapper.xml deleted file mode 100644 index 5794b4c0..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenEquipmentMapper.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - equipObjName, equipID, equipUIName, - equipType, runsignal, stationID - - - insert into FangZhen_equipment (equipObjName, equipID, equipUIName, - equipType, runsignal, stationID - ) - values (#{equipobjname,jdbcType=NVARCHAR}, #{equipid,jdbcType=NVARCHAR}, #{equipuiname,jdbcType=NVARCHAR}, - #{equiptype,jdbcType=NVARCHAR}, #{runsignal,jdbcType=NVARCHAR}, #{stationid,jdbcType=NVARCHAR} - ) - - - insert into FangZhen_equipment - - - equipObjName, - - - equipID, - - - equipUIName, - - - equipType, - - - runsignal, - - - stationID, - - - - - #{equipobjname,jdbcType=NVARCHAR}, - - - #{equipid,jdbcType=NVARCHAR}, - - - #{equipuiname,jdbcType=NVARCHAR}, - - - #{equiptype,jdbcType=NVARCHAR}, - - - #{runsignal,jdbcType=NVARCHAR}, - - - #{stationid,jdbcType=NVARCHAR}, - - - - - - - - delete - from FangZhen_equipment ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenHeadUIMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenHeadUIMapper.xml deleted file mode 100644 index 3338cae0..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenHeadUIMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - signalName, unit, rowIndex, - colIndex, tableType, tableIndex, - rowName, colName - - - insert into FangZhen_HeadUI (signalName, unit, rowIndex, - colIndex, tableType, tableIndex, - rowName, colName) - values (#{signalname,jdbcType=NVARCHAR}, #{unit,jdbcType=NVARCHAR}, #{rowindex,jdbcType=NVARCHAR}, - #{colindex,jdbcType=NVARCHAR}, #{tabletype,jdbcType=NVARCHAR}, #{tableindex,jdbcType=NVARCHAR}, - #{rowname,jdbcType=NVARCHAR}, #{colname,jdbcType=NVARCHAR}) - - - insert into FangZhen_HeadUI - - - signalName, - - - unit, - - - rowIndex, - - - colIndex, - - - tableType, - - - tableIndex, - - - rowName, - - - colName, - - - - - #{signalname,jdbcType=NVARCHAR}, - - - #{unit,jdbcType=NVARCHAR}, - - - #{rowindex,jdbcType=NVARCHAR}, - - - #{colindex,jdbcType=NVARCHAR}, - - - #{tabletype,jdbcType=NVARCHAR}, - - - #{tableindex,jdbcType=NVARCHAR}, - - - #{rowname,jdbcType=NVARCHAR}, - - - #{colname,jdbcType=NVARCHAR}, - - - - - - - - delete - from FangZhen_HeadUI ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenPipeMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenPipeMapper.xml deleted file mode 100644 index 493d2201..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenPipeMapper.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - Name, ID, StationID - - - insert into FangZhen_Pipe (Name, ID, StationID - ) - values (#{name,jdbcType=NVARCHAR}, #{id,jdbcType=VARCHAR}, #{stationid,jdbcType=VARCHAR} - ) - - - insert into FangZhen_Pipe - - - Name, - - - ID, - - - StationID, - - - - - #{name,jdbcType=NVARCHAR}, - - - #{id,jdbcType=VARCHAR}, - - - #{stationid,jdbcType=VARCHAR}, - - - - - - - - delete - from FangZhen_Pipe ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenStationMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenStationMapper.xml deleted file mode 100644 index 083ec7a6..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenStationMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - stationName, stationID, structuresID, - LeftSignal, LODSignal, FlowSignal, - WaterQualitySignal, LevelSignal - - - insert into FangZhen_Station (stationName, stationID, structuresID, - LeftSignal, LODSignal, FlowSignal, - WaterQualitySignal, LevelSignal) - values (#{stationname,jdbcType=NVARCHAR}, #{stationid,jdbcType=NVARCHAR}, #{structuresid,jdbcType=NVARCHAR}, - #{leftsignal,jdbcType=VARCHAR}, #{lodsignal,jdbcType=VARCHAR}, #{flowsignal,jdbcType=VARCHAR}, - #{waterqualitysignal,jdbcType=VARCHAR}, #{levelsignal,jdbcType=VARCHAR}) - - - insert into FangZhen_Station - - - stationName, - - - stationID, - - - structuresID, - - - LeftSignal, - - - LODSignal, - - - FlowSignal, - - - WaterQualitySignal, - - - LevelSignal, - - - - - #{stationname,jdbcType=NVARCHAR}, - - - #{stationid,jdbcType=NVARCHAR}, - - - #{structuresid,jdbcType=NVARCHAR}, - - - #{leftsignal,jdbcType=VARCHAR}, - - - #{lodsignal,jdbcType=VARCHAR}, - - - #{flowsignal,jdbcType=VARCHAR}, - - - #{waterqualitysignal,jdbcType=VARCHAR}, - - - #{levelsignal,jdbcType=VARCHAR}, - - - - - - - - delete - from FangZhen_Station ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenWaterMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenWaterMapper.xml deleted file mode 100644 index c8814905..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenWaterMapper.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - Name, RunSignal, StopSignal, - BackflushSignal, FiltrationSignal, MainTainSignal, - LevelSignal, ID, NTU, - HCIO - - - insert into FangZhen_Water (Name, RunSignal, StopSignal, - BackflushSignal, FiltrationSignal, MainTainSignal, - LevelSignal, ID, NTU, - HCIO) - values (#{name,jdbcType=VARCHAR}, #{runsignal,jdbcType=VARCHAR}, #{stopsignal,jdbcType=VARCHAR}, - #{backflushsignal,jdbcType=VARCHAR}, #{filtrationsignal,jdbcType=VARCHAR}, #{maintainsignal,jdbcType=VARCHAR}, - #{levelsignal,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR}, #{ntu,jdbcType=VARCHAR}, - #{hcio,jdbcType=VARCHAR}) - - - insert into FangZhen_Water - - - Name, - - - RunSignal, - - - StopSignal, - - - BackflushSignal, - - - FiltrationSignal, - - - MainTainSignal, - - - LevelSignal, - - - ID, - - - NTU, - - - HCIO, - - - - - #{name,jdbcType=VARCHAR}, - - - #{runsignal,jdbcType=VARCHAR}, - - - #{stopsignal,jdbcType=VARCHAR}, - - - #{backflushsignal,jdbcType=VARCHAR}, - - - #{filtrationsignal,jdbcType=VARCHAR}, - - - #{maintainsignal,jdbcType=VARCHAR}, - - - #{levelsignal,jdbcType=VARCHAR}, - - - #{id,jdbcType=VARCHAR}, - - - #{ntu,jdbcType=VARCHAR}, - - - #{hcio,jdbcType=VARCHAR}, - - - - - - - - delete - from FangZhen_Water ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fangzhen/FangZhenXeomaMapper.xml b/src/com/sipai/mapper/fangzhen/FangZhenXeomaMapper.xml deleted file mode 100644 index c6aecbe9..00000000 --- a/src/com/sipai/mapper/fangzhen/FangZhenXeomaMapper.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - name, ID, station, - ip, channel - - - insert into FangZhen_Xeoma (name, ID, station, - ip, channel) - values (#{name,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR}, #{station,jdbcType=VARCHAR}, - #{ip,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}) - - - insert into FangZhen_Xeoma - - - name, - - - ID, - - - station, - - - ip, - - - channel, - - - - - #{name,jdbcType=VARCHAR}, - - - #{id,jdbcType=VARCHAR}, - - - #{station,jdbcType=VARCHAR}, - - - #{ip,jdbcType=VARCHAR}, - - - #{channel,jdbcType=VARCHAR}, - - - - - - - - delete - from FangZhen_Xeoma ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/finance/FinanceEquipmentDeptInfoMapper.xml b/src/com/sipai/mapper/finance/FinanceEquipmentDeptInfoMapper.xml deleted file mode 100644 index e58bf8f1..00000000 --- a/src/com/sipai/mapper/finance/FinanceEquipmentDeptInfoMapper.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - id, insdt, insuser, name, code, belong_code - - - - delete from tb_finance_equipment_dept_info - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_finance_equipment_dept_info (id, insdt, insuser, - name, code, belong_code - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{belongCode,jdbcType=VARCHAR} - ) - - - insert into tb_finance_equipment_dept_info - - - id, - - - insdt, - - - insuser, - - - name, - - - code, - - - belong_code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{belongCode,jdbcType=VARCHAR}, - - - - - update tb_finance_equipment_dept_info - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - belong_code = #{belongCode,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_finance_equipment_dept_info - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - belong_code = #{belongCode,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_finance_equipment_dept_info ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fwk/MenunumberMapper.xml b/src/com/sipai/mapper/fwk/MenunumberMapper.xml deleted file mode 100644 index 16d517e0..00000000 --- a/src/com/sipai/mapper/fwk/MenunumberMapper.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - id, menuitemid, onclickdatetime, userid - - - - delete from tb_fwk_menunumber - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_fwk_menunumber (id, menuitemid, onclickdatetime, - userid) - values (#{id,jdbcType=VARCHAR}, #{menuitemid,jdbcType=VARCHAR}, #{onclickdatetime,jdbcType=TIMESTAMP}, - #{userid,jdbcType=VARCHAR}) - - - insert into tb_fwk_menunumber - - - id, - - - menuitemid, - - - onclickdatetime, - - - userid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{menuitemid,jdbcType=VARCHAR}, - - - #{onclickdatetime,jdbcType=TIMESTAMP}, - - - #{userid,jdbcType=VARCHAR}, - - - - - update tb_fwk_menunumber - - - menuitemid = #{menuitemid,jdbcType=VARCHAR}, - - - onclickdatetime = #{onclickdatetime,jdbcType=TIMESTAMP}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_fwk_menunumber - set menuitemid = #{menuitemid,jdbcType=VARCHAR}, - onclickdatetime = #{onclickdatetime,jdbcType=TIMESTAMP}, - userid = #{userid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_fwk_menunumber - ${where} - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fwk/UserToMenuMapper.xml b/src/com/sipai/mapper/fwk/UserToMenuMapper.xml deleted file mode 100644 index 4d32538b..00000000 --- a/src/com/sipai/mapper/fwk/UserToMenuMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, touserid, menuitemname, menuitemid, menuitemurl, pid, morder, insertuserid, insertdate - - - - delete from tb_fwk_usertomenu - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_fwk_usertomenu (id, touserid, menuitemname, - menuitemid, menuitemurl, pid, - morder, insertuserid, insertdate - ) - values (#{id,jdbcType=VARCHAR}, #{touserid,jdbcType=VARCHAR}, #{menuitemname,jdbcType=VARCHAR}, - #{menuitemid,jdbcType=VARCHAR}, #{menuitemurl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{insertuserid,jdbcType=VARCHAR}, #{insertdate,jdbcType=TIMESTAMP} - ) - - - insert into tb_fwk_usertomenu - - - id, - - - touserid, - - - menuitemname, - - - menuitemid, - - - menuitemurl, - - - pid, - - - morder, - - - insertuserid, - - - insertdate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{touserid,jdbcType=VARCHAR}, - - - #{menuitemname,jdbcType=VARCHAR}, - - - #{menuitemid,jdbcType=VARCHAR}, - - - #{menuitemurl,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{insertuserid,jdbcType=VARCHAR}, - - - #{insertdate,jdbcType=TIMESTAMP}, - - - - - update tb_fwk_usertomenu - - - touserid = #{touserid,jdbcType=VARCHAR}, - - - menuitemname = #{menuitemname,jdbcType=VARCHAR}, - - - menuitemid = #{menuitemid,jdbcType=VARCHAR}, - - - menuitemurl = #{menuitemurl,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - - - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_fwk_usertomenu - set touserid = #{touserid,jdbcType=VARCHAR}, - menuitemname = #{menuitemname,jdbcType=VARCHAR}, - menuitemid = #{menuitemid,jdbcType=VARCHAR}, - menuitemurl = #{menuitemurl,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - insertdate = #{insertdate,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_fwk_usertomenu - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/fwk/WeatherHistoryMapper.xml b/src/com/sipai/mapper/fwk/WeatherHistoryMapper.xml deleted file mode 100644 index 2023831f..00000000 --- a/src/com/sipai/mapper/fwk/WeatherHistoryMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id, now_temp, high_temp, low_temp, wind, weather, insdt, insuser - - - - delete from tb_fwk_weatherHistory - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_fwk_weatherHistory (id, now_temp, high_temp, - low_temp, wind, weather, - insdt, insuser) - values (#{id,jdbcType=VARCHAR}, #{nowTemp,jdbcType=VARCHAR}, #{highTemp,jdbcType=VARCHAR}, - #{lowTemp,jdbcType=VARCHAR}, #{wind,jdbcType=VARCHAR}, #{weather,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}) - - - insert into tb_fwk_weatherHistory - - - id, - - - now_temp, - - - high_temp, - - - low_temp, - - - wind, - - - weather, - - - insdt, - - - insuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{nowTemp,jdbcType=VARCHAR}, - - - #{highTemp,jdbcType=VARCHAR}, - - - #{lowTemp,jdbcType=VARCHAR}, - - - #{wind,jdbcType=VARCHAR}, - - - #{weather,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - - update tb_fwk_weatherHistory - - - now_temp = #{nowTemp,jdbcType=VARCHAR}, - - - high_temp = #{highTemp,jdbcType=VARCHAR}, - - - low_temp = #{lowTemp,jdbcType=VARCHAR}, - - - wind = #{wind,jdbcType=VARCHAR}, - - - weather = #{weather,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_fwk_weatherHistory - set now_temp = #{nowTemp,jdbcType=VARCHAR}, - high_temp = #{highTemp,jdbcType=VARCHAR}, - low_temp = #{lowTemp,jdbcType=VARCHAR}, - wind = #{wind,jdbcType=VARCHAR}, - weather = #{weather,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_fwk_weatherHistory - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/hqconfig/EnterRecordMapper.xml b/src/com/sipai/mapper/hqconfig/EnterRecordMapper.xml deleted file mode 100644 index d74fa563..00000000 --- a/src/com/sipai/mapper/hqconfig/EnterRecordMapper.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - id, inTime, enterid, areaid, state, duration, fid, outTime - - - - delete from tb_work_enterRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_enterRecord (id, inTime, enterid, - areaid, state, duration, - fid, outTime) - values (#{id,jdbcType=VARCHAR}, #{intime,jdbcType=TIMESTAMP}, #{enterid,jdbcType=VARCHAR}, - #{areaid,jdbcType=VARCHAR}, #{state,jdbcType=BIT}, #{duration,jdbcType=DOUBLE}, - #{fid,jdbcType=VARCHAR}, #{outtime,jdbcType=TIMESTAMP}) - - - insert into tb_work_enterRecord - - - id, - - - inTime, - - - enterid, - - - areaid, - - - state, - - - duration, - - - fid, - - - outTime, - - - - - #{id,jdbcType=VARCHAR}, - - - #{intime,jdbcType=TIMESTAMP}, - - - #{enterid,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{state,jdbcType=BIT}, - - - #{duration,jdbcType=DOUBLE}, - - - #{fid,jdbcType=VARCHAR}, - - - #{outtime,jdbcType=TIMESTAMP}, - - - - - update tb_work_enterRecord - - - inTime = #{intime,jdbcType=TIMESTAMP}, - - - enterid = #{enterid,jdbcType=VARCHAR}, - - - areaid = #{areaid,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=BIT}, - - - duration = #{duration,jdbcType=DOUBLE}, - - - fid = #{fid,jdbcType=VARCHAR}, - - - outTime = #{outtime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_enterRecord - set inTime = #{intime,jdbcType=TIMESTAMP}, - enterid = #{enterid,jdbcType=VARCHAR}, - areaid = #{areaid,jdbcType=VARCHAR}, - state = #{state,jdbcType=BIT}, - duration = #{duration,jdbcType=DOUBLE}, - fid = #{fid,jdbcType=VARCHAR}, - outTime = #{outtime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_work_enterRecord - ${where} - - - - diff --git a/src/com/sipai/mapper/hqconfig/HQAlarmRecordMapper.xml b/src/com/sipai/mapper/hqconfig/HQAlarmRecordMapper.xml deleted file mode 100644 index 8e45c49b..00000000 --- a/src/com/sipai/mapper/hqconfig/HQAlarmRecordMapper.xml +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, areaid, cameraid, alarmTypeid, state, eliminatedt, confirmerid, confirmdt, - remark, name,targetid, cameraDetailId, unitId, riskLevel, mpcode - - - - - - delete from tb_work_alarmRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_alarmRecord (id, insdt, areaid, - cameraid, alarmTypeid, state, - eliminatedt, confirmerid, confirmdt, - remark, name, targetid, cameraDetailId, unitId, riskLevel,mpcode) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{areaid,jdbcType=VARCHAR}, - #{cameraid,jdbcType=VARCHAR}, #{alarmtypeid,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, - #{eliminatedt,jdbcType=TIMESTAMP}, #{confirmerid,jdbcType=VARCHAR}, #{confirmdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{targetid,jdbcType=VARCHAR}, #{cameraDetailId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{riskLevel,jdbcType=VARCHAR}, #{mpcode,jdbcType=VARCHAR}) - - - insert into tb_work_alarmRecord - - - id, - - - insdt, - - - areaid, - - - cameraid, - - - alarmTypeid, - - - state, - - - eliminatedt, - - - confirmerid, - - - confirmdt, - - - remark, - - - name, - - - targetid, - - - cameraDetailId, - - - unitId, - - - riskLevel, - - - mpcode, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{cameraid,jdbcType=VARCHAR}, - - - #{alarmtypeid,jdbcType=VARCHAR}, - - - #{state,jdbcType=VARCHAR}, - - - #{eliminatedt,jdbcType=TIMESTAMP}, - - - #{confirmerid,jdbcType=VARCHAR}, - - - #{confirmdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{targetid,jdbcType=VARCHAR}, - - - #{cameraDetailId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{riskLevel,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - - - update tb_work_alarmRecord - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - areaid = #{areaid,jdbcType=VARCHAR}, - - - cameraid = #{cameraid,jdbcType=VARCHAR}, - - - alarmTypeid = #{alarmtypeid,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=VARCHAR}, - - - eliminatedt = #{eliminatedt,jdbcType=TIMESTAMP}, - - - confirmerid = #{confirmerid,jdbcType=VARCHAR}, - - - confirmdt = #{confirmdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - targetid = #{targetid,jdbcType=VARCHAR}, - - - cameraDetailId = #{cameraDetailId,jdbcType=VARCHAR}, - - - unitId = #{unitId,jdbcType=VARCHAR}, - - - riskLevel = #{riskLevel,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_alarmRecord - set insdt = #{insdt,jdbcType=TIMESTAMP}, - areaid = #{areaid,jdbcType=VARCHAR}, - cameraid = #{cameraid,jdbcType=VARCHAR}, - alarmTypeid = #{alarmtypeid,jdbcType=VARCHAR}, - state = #{state,jdbcType=VARCHAR}, - eliminatedt = #{eliminatedt,jdbcType=TIMESTAMP}, - confirmerid = #{confirmerid,jdbcType=VARCHAR}, - confirmdt = #{confirmdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - targetid = #{targetid,jdbcType=VARCHAR}, - cameraDetailId = #{cameraDetailId,jdbcType=VARCHAR}, - unitId = #{unitId,jdbcType=VARCHAR}, - riskLevel = #{riskLevel,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_work_alarmRecord - ${where} - - - - - - - - - - - diff --git a/src/com/sipai/mapper/hqconfig/PositionsCasualMapper.xml b/src/com/sipai/mapper/hqconfig/PositionsCasualMapper.xml deleted file mode 100644 index 51b5abde..00000000 --- a/src/com/sipai/mapper/hqconfig/PositionsCasualMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, name, x, y, floor, morder, cardid, insuser, insdt, locationTime, inDoor - - - - delete from tb_positions_casual - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_positions_casual (id, name, x, - y, floor, morder, cardid, - insuser, insdt, locationTime, - inDoor) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{x,jdbcType=VARCHAR}, - #{y,jdbcType=VARCHAR}, #{floor,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{cardid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{locationtime,jdbcType=VARCHAR}, - #{indoor,jdbcType=VARCHAR}) - - - insert into tb_positions_casual - - - id, - - - name, - - - x, - - - y, - - - floor, - - - morder, - - - cardid, - - - insuser, - - - insdt, - - - locationTime, - - - inDoor, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{x,jdbcType=VARCHAR}, - - - #{y,jdbcType=VARCHAR}, - - - #{floor,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{cardid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{locationtime,jdbcType=VARCHAR}, - - - #{indoor,jdbcType=VARCHAR}, - - - - - update tb_positions_casual - - - name = #{name,jdbcType=VARCHAR}, - - - x = #{x,jdbcType=VARCHAR}, - - - y = #{y,jdbcType=VARCHAR}, - - - floor = #{floor,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - cardid = #{cardid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - locationTime = #{locationtime,jdbcType=VARCHAR}, - - - inDoor = #{indoor,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_positions_casual - set name = #{name,jdbcType=VARCHAR}, - x = #{x,jdbcType=VARCHAR}, - y = #{y,jdbcType=VARCHAR}, - floor = #{floor,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - cardid = #{cardid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - locationTime = #{locationtime,jdbcType=VARCHAR}, - inDoor = #{indoor,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_positions_casual - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/hqconfig/RiskLevelMapper.xml b/src/com/sipai/mapper/hqconfig/RiskLevelMapper.xml deleted file mode 100644 index e8ee5a30..00000000 --- a/src/com/sipai/mapper/hqconfig/RiskLevelMapper.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, securityContent, safetyInspection, place, accidentCategory, consequences, - LValue, SValue, RValue, riskLevel, areaId, actionsTaken - - - - delete from tb_risk_level - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_risk_level (id, insuser, insdt, - securityContent, safetyInspection, place, - accidentCategory, consequences, LValue, - SValue, RValue, riskLevel, - areaId, actionsTaken) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{securitycontent,jdbcType=VARCHAR}, #{safetyinspection,jdbcType=VARCHAR}, #{place,jdbcType=VARCHAR}, - #{accidentcategory,jdbcType=VARCHAR}, #{consequences,jdbcType=VARCHAR}, #{lvalue,jdbcType=VARCHAR}, - #{svalue,jdbcType=VARCHAR}, #{rvalue,jdbcType=VARCHAR}, #{risklevel,jdbcType=VARCHAR}, - #{areaid,jdbcType=VARCHAR}, #{actionstaken,jdbcType=VARCHAR}) - - - insert into tb_risk_level - - - id, - - - insuser, - - - insdt, - - - securityContent, - - - safetyInspection, - - - place, - - - accidentCategory, - - - consequences, - - - LValue, - - - SValue, - - - RValue, - - - riskLevel, - - - areaId, - - - actionsTaken, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{securitycontent,jdbcType=VARCHAR}, - - - #{safetyinspection,jdbcType=VARCHAR}, - - - #{place,jdbcType=VARCHAR}, - - - #{accidentcategory,jdbcType=VARCHAR}, - - - #{consequences,jdbcType=VARCHAR}, - - - #{lvalue,jdbcType=VARCHAR}, - - - #{svalue,jdbcType=VARCHAR}, - - - #{rvalue,jdbcType=VARCHAR}, - - - #{risklevel,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{actionstaken,jdbcType=VARCHAR}, - - - - - update tb_risk_level - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - securityContent = #{securitycontent,jdbcType=VARCHAR}, - - - safetyInspection = #{safetyinspection,jdbcType=VARCHAR}, - - - place = #{place,jdbcType=VARCHAR}, - - - accidentCategory = #{accidentcategory,jdbcType=VARCHAR}, - - - consequences = #{consequences,jdbcType=VARCHAR}, - - - LValue = #{lvalue,jdbcType=VARCHAR}, - - - SValue = #{svalue,jdbcType=VARCHAR}, - - - RValue = #{rvalue,jdbcType=VARCHAR}, - - - riskLevel = #{risklevel,jdbcType=VARCHAR}, - - - areaId = #{areaid,jdbcType=VARCHAR}, - - - actionsTaken = #{actionstaken,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_risk_level - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - securityContent = #{securitycontent,jdbcType=VARCHAR}, - safetyInspection = #{safetyinspection,jdbcType=VARCHAR}, - place = #{place,jdbcType=VARCHAR}, - accidentCategory = #{accidentcategory,jdbcType=VARCHAR}, - consequences = #{consequences,jdbcType=VARCHAR}, - LValue = #{lvalue,jdbcType=VARCHAR}, - SValue = #{svalue,jdbcType=VARCHAR}, - RValue = #{rvalue,jdbcType=VARCHAR}, - riskLevel = #{risklevel,jdbcType=VARCHAR}, - areaId = #{areaid,jdbcType=VARCHAR}, - actionsTaken = #{actionstaken,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_risk_level - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/hqconfig/WorkModelMapper.xml b/src/com/sipai/mapper/hqconfig/WorkModelMapper.xml deleted file mode 100644 index d2bcb3ab..00000000 --- a/src/com/sipai/mapper/hqconfig/WorkModelMapper.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, model_name, name, output, isAlarm, remark, status, riskLevelId - - - - delete from tb_work_model - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_model (id, insdt, insuser, - model_name, name, output, - isAlarm, remark, status, riskLevelId) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{modelName,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{output,jdbcType=VARCHAR}, - #{isalarm,jdbcType=BIT}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, - #{riskLevelId,jdbcType=VARCHAR}) - - - insert into tb_work_model - - - id, - - - insdt, - - - insuser, - - - model_name, - - - name, - - - output, - - - isAlarm, - - - remark, - - - riskLevelId, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{modelName,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{output,jdbcType=VARCHAR}, - - - #{isalarm,jdbcType=BIT}, - - - #{remark,jdbcType=VARCHAR}, - - - #{riskLevelId,jdbcType=VARCHAR}, - - - #{status,jdbcType=BIT}, - - - - - update tb_work_model - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - model_name = #{modelName,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - output = #{output,jdbcType=VARCHAR}, - - - isAlarm = #{isalarm,jdbcType=BIT}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - riskLevelId = #{riskLevelId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_model - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - model_name = #{modelName,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - output = #{output,jdbcType=VARCHAR}, - isAlarm = #{isalarm,jdbcType=BIT}, - remark = #{remark,jdbcType=VARCHAR}, - riskLevelId = #{riskLevelId,jdbcType=VARCHAR}, - status = #{status,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_work_model - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/info/InfoMapper.xml b/src/com/sipai/mapper/info/InfoMapper.xml deleted file mode 100644 index 720babfb..00000000 --- a/src/com/sipai/mapper/info/InfoMapper.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - id, title, matter, typeid, recvid, publishtime1, publishtime2, insuser, insdt, modifydt - - - - delete from tb_info - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_info (id, title, matter, - typeid, recvid,publishtime1, publishtime2, - insuser, insdt, modifydt - ) - values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{matter,jdbcType=VARCHAR}, - #{typeid,jdbcType=VARCHAR},#{recvid,jdbcType=VARCHAR}, #{publishtime1,jdbcType=TIMESTAMP}, #{publishtime2,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{modifydt,jdbcType=TIMESTAMP} - ) - - - insert into tb_info - - - id, - - - title, - - - matter, - - - typeid, - - - recvid, - - - publishtime1, - - - publishtime2, - - - insuser, - - - insdt, - - - modifydt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{title,jdbcType=VARCHAR}, - - - #{matter,jdbcType=VARCHAR}, - - - #{typeid,jdbcType=VARCHAR}, - - - #{recvid,jdbcType=VARCHAR}, - - - #{publishtime1,jdbcType=TIMESTAMP}, - - - #{publishtime2,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{modifydt,jdbcType=TIMESTAMP}, - - - - - update tb_info - - - title = #{title,jdbcType=VARCHAR}, - - - matter = #{matter,jdbcType=VARCHAR}, - - - typeid = #{typeid,jdbcType=VARCHAR}, - - - recvid = #{recvid,jdbcType=VARCHAR}, - - - publishtime1 = #{publishtime1,jdbcType=TIMESTAMP}, - - - publishtime2 = #{publishtime2,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - modifydt = #{modifydt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_info - set title = #{title,jdbcType=VARCHAR}, - matter = #{matter,jdbcType=VARCHAR}, - typeid = #{typeid,jdbcType=VARCHAR}, - recvid = #{recvid,jdbcType=VARCHAR}, - publishtime1 = #{publishtime1,jdbcType=TIMESTAMP}, - publishtime2 = #{publishtime2,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - modifydt = #{modifydt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - - delete from - tb_info - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/info/InfoRecvMapper.xml b/src/com/sipai/mapper/info/InfoRecvMapper.xml deleted file mode 100644 index f2540727..00000000 --- a/src/com/sipai/mapper/info/InfoRecvMapper.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - id, masterid, recvid - - - - delete from tb_info_recv - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_info_recv (id, masterid, recvid - ) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{recvid,jdbcType=VARCHAR} - ) - - - insert into tb_info_recv - - - id, - - - masterid, - - - recvid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{recvid,jdbcType=VARCHAR}, - - - - - update tb_info_recv - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - recvid = #{recvid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_info_recv - set masterid = #{masterid,jdbcType=VARCHAR}, - recvid = #{recvid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_info_recv - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/info/LogInfoMapper.xml b/src/com/sipai/mapper/info/LogInfoMapper.xml deleted file mode 100644 index 656d759a..00000000 --- a/src/com/sipai/mapper/info/LogInfoMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, controller, method, user_id, ip, insdt, operate_content, type, ex_msg, user_caption, - param, result, remote_port, user_method - - - - delete from tb_log_info - where id = #{id,jdbcType=BIGINT} - - - insert into tb_log_info (controller, method, - user_id, ip, insdt, - operate_content, type, ex_msg, - user_caption, param, result, - remote_port, user_method) - values ( #{controller,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, - #{userId,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{operateContent,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{exMsg,jdbcType=VARCHAR}, - #{userCaption,jdbcType=VARCHAR}, #{param,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, - #{remotePort,jdbcType=VARCHAR}, #{userMethod,jdbcType=VARCHAR}) - - - insert into tb_log_info - - - id, - - - controller, - - - method, - - - user_id, - - - ip, - - - insdt, - - - operate_content, - - - type, - - - ex_msg, - - - user_caption, - - - param, - - - result, - - - remote_port, - - - user_method, - - - - - #{id,jdbcType=BIGINT}, - - - #{controller,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{ip,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{operateContent,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{exMsg,jdbcType=VARCHAR}, - - - #{userCaption,jdbcType=VARCHAR}, - - - #{param,jdbcType=VARCHAR}, - - - #{result,jdbcType=VARCHAR}, - - - #{remotePort,jdbcType=VARCHAR}, - - - #{userMethod,jdbcType=VARCHAR}, - - - - - update tb_log_info - - - controller = #{controller,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - ip = #{ip,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - operate_content = #{operateContent,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - ex_msg = #{exMsg,jdbcType=VARCHAR}, - - - user_caption = #{userCaption,jdbcType=VARCHAR}, - - - param = #{param,jdbcType=VARCHAR}, - - - result = #{result,jdbcType=VARCHAR}, - - - remote_port = #{remotePort,jdbcType=VARCHAR}, - - - user_method = #{userMethod,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update tb_log_info - set controller = #{controller,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR}, - user_id = #{userId,jdbcType=VARCHAR}, - ip = #{ip,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - operate_content = #{operateContent,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - ex_msg = #{exMsg,jdbcType=VARCHAR}, - user_caption = #{userCaption,jdbcType=VARCHAR}, - param = #{param,jdbcType=VARCHAR}, - result = #{result,jdbcType=VARCHAR}, - remote_port = #{remotePort,jdbcType=VARCHAR}, - user_method = #{userMethod,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - - - delete from - tb_log_info - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/jsyw/JsywCompanyMapper.xml b/src/com/sipai/mapper/jsyw/JsywCompanyMapper.xml deleted file mode 100644 index 7428c140..00000000 --- a/src/com/sipai/mapper/jsyw/JsywCompanyMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, wrylb_text, xzqh, create_time, year, dwmc, itemids, scdz, latitude, longitude - - - - delete from TB_JSYW_Company - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_JSYW_Company (id, wrylb_text, xzqh, - create_time, year, dwmc, - itemids, scdz, latitude, - longitude) - values (#{id,jdbcType=VARCHAR}, #{wrylbText,jdbcType=VARCHAR}, #{xzqh,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, #{year,jdbcType=INTEGER}, #{dwmc,jdbcType=VARCHAR}, - #{itemids,jdbcType=VARCHAR}, #{scdz,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, - #{longitude,jdbcType=VARCHAR}) - - - insert into TB_JSYW_Company - - - id, - - - wrylb_text, - - - xzqh, - - - create_time, - - - year, - - - dwmc, - - - itemids, - - - scdz, - - - latitude, - - - longitude, - - - - - #{id,jdbcType=VARCHAR}, - - - #{wrylbText,jdbcType=VARCHAR}, - - - #{xzqh,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{year,jdbcType=INTEGER}, - - - #{dwmc,jdbcType=VARCHAR}, - - - #{itemids,jdbcType=VARCHAR}, - - - #{scdz,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=VARCHAR}, - - - #{longitude,jdbcType=VARCHAR}, - - - - - update TB_JSYW_Company - - - wrylb_text = #{wrylbText,jdbcType=VARCHAR}, - - - xzqh = #{xzqh,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - year = #{year,jdbcType=INTEGER}, - - - dwmc = #{dwmc,jdbcType=VARCHAR}, - - - itemids = #{itemids,jdbcType=VARCHAR}, - - - scdz = #{scdz,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=VARCHAR}, - - - longitude = #{longitude,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_JSYW_Company - set wrylb_text = #{wrylbText,jdbcType=VARCHAR}, - xzqh = #{xzqh,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - year = #{year,jdbcType=INTEGER}, - dwmc = #{dwmc,jdbcType=VARCHAR}, - itemids = #{itemids,jdbcType=VARCHAR}, - scdz = #{scdz,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=VARCHAR}, - longitude = #{longitude,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_JSYW_Company - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/jsyw/JsywPointMapper.xml b/src/com/sipai/mapper/jsyw/JsywPointMapper.xml deleted file mode 100644 index 55e40fe4..00000000 --- a/src/com/sipai/mapper/jsyw/JsywPointMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, factorname, psname, update_date, update_time, outputname, tstamp, pollutantvalue, - valuetype - - - - delete from TB_JSYW_Point - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_JSYW_Point (id, factorname, psname, - update_date, update_time, outputname, - tstamp, pollutantvalue, valuetype - ) - values (#{id,jdbcType=VARCHAR}, #{factorname,jdbcType=VARCHAR}, #{psname,jdbcType=VARCHAR}, - #{updateDate,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{outputname,jdbcType=VARCHAR}, - #{tstamp,jdbcType=TIMESTAMP}, #{pollutantvalue,jdbcType=DECIMAL}, #{valuetype,jdbcType=VARCHAR} - ) - - - insert into TB_JSYW_Point - - - id, - - - factorname, - - - psname, - - - update_date, - - - update_time, - - - outputname, - - - tstamp, - - - pollutantvalue, - - - valuetype, - - - - - #{id,jdbcType=VARCHAR}, - - - #{factorname,jdbcType=VARCHAR}, - - - #{psname,jdbcType=VARCHAR}, - - - #{updateDate,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{outputname,jdbcType=VARCHAR}, - - - #{tstamp,jdbcType=TIMESTAMP}, - - - #{pollutantvalue,jdbcType=DECIMAL}, - - - #{valuetype,jdbcType=VARCHAR}, - - - - - update TB_JSYW_Point - - - factorname = #{factorname,jdbcType=VARCHAR}, - - - psname = #{psname,jdbcType=VARCHAR}, - - - update_date = #{updateDate,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - outputname = #{outputname,jdbcType=VARCHAR}, - - - tstamp = #{tstamp,jdbcType=TIMESTAMP}, - - - pollutantvalue = #{pollutantvalue,jdbcType=DECIMAL}, - - - valuetype = #{valuetype,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_JSYW_Point - set factorname = #{factorname,jdbcType=VARCHAR}, - psname = #{psname,jdbcType=VARCHAR}, - update_date = #{updateDate,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - outputname = #{outputname,jdbcType=VARCHAR}, - tstamp = #{tstamp,jdbcType=TIMESTAMP}, - pollutantvalue = #{pollutantvalue,jdbcType=DECIMAL}, - valuetype = #{valuetype,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_JSYW_Point - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiApplyBizMapper.xml b/src/com/sipai/mapper/kpi/KpiApplyBizMapper.xml deleted file mode 100644 index 4e659175..00000000 --- a/src/com/sipai/mapper/kpi/KpiApplyBizMapper.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - id, period_instance_id, status, create_user_id, create_time, update_time, is_deleted, - auditors, unit_id,rejection_comment,marker - - - - delete - from tb_kpi_apply_biz - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_apply_biz (id, period_instance_id, status, - create_user_id, create_time, update_time, - is_deleted, auditors, unit_id, rejection_comment, marker) - values (#{id,jdbcType=VARCHAR}, #{periodInstanceId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, - #{createUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{isDeleted,jdbcType=BIT}, #{auditors,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{rejectionComment,jdbcType=VARCHAR}, - #{marker,jdbcType=VARCHAR}) - - - insert into tb_kpi_apply_biz - - - id, - - - period_instance_id, - - - status, - - - create_user_id, - - - create_time, - - - update_time, - - - is_deleted, - - - auditors, - - - unit_id, - - - rejection_comment, - - - marker, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{periodInstanceId,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{auditors,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{rejectionComment,jdbcType=VARCHAR}, - - - #{marker,jdbcType=VARCHAR}, - - - - - update tb_kpi_apply_biz - - - period_instance_id = #{periodInstanceId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - auditors = #{auditors,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - rejection_comment = #{rejectionComment,jdbcType=VARCHAR}, - - - - marker = #{marker,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_apply_biz - set period_instance_id = #{periodInstanceId,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT}, - auditors = #{auditors,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - rejection_comment = #{rejectionComment,jdbcType=VARCHAR}, - marker = #{marker,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete - from tb_kpi_apply_biz ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiDimensionMapper.xml b/src/com/sipai/mapper/kpi/KpiDimensionMapper.xml deleted file mode 100644 index e0f58fd3..00000000 --- a/src/com/sipai/mapper/kpi/KpiDimensionMapper.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - id, dimension_name, dimension_type, status, remark, create_time, update_time, is_deleted,period_type,job_type,morder - - - - delete - from tb_kpi_dimension - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_dimension (id, dimension_name, dimension_type, - status, remark, create_time, - update_time, is_deleted, period_type, job_type, morder) - values ( #{id,jdbcType=VARCHAR}, #{dimensionName,jdbcType=VARCHAR}, #{dimensionType,jdbcType=TINYINT}, - #{status,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT} - , #{periodType,jdbcType=TINYINT} - , #{jobType,jdbcType=TINYINT} - , #{morder,jdbcType=TINYINT}) - - - insert into tb_kpi_dimension - - - id, - - - dimension_name, - - - dimension_type, - - - status, - - - remark, - - - create_time, - - - update_time, - - - is_deleted, - - - period_type, - - - job_type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dimensionName,jdbcType=VARCHAR}, - - - #{dimensionType,jdbcType=TINYINT}, - - - #{status,jdbcType=TINYINT}, - - - #{remark,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{periodType,jdbcType=TINYINT}, - - - #{jobType,jdbcType=TINYINT}, - - - #{morder,jdbcType=TINYINT}, - - - - - update tb_kpi_dimension - - - dimension_name = #{dimensionName,jdbcType=VARCHAR}, - - - dimension_type = #{dimensionType,jdbcType=TINYINT}, - - - status = #{status,jdbcType=TINYINT}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - period_type= #{periodType,jdbcType=TINYINT}, - - - job_type= #{jobType,jdbcType=TINYINT}, - - - morder= #{morder,jdbcType=TINYINT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_dimension - set dimension_name = #{dimensionName,jdbcType=VARCHAR}, - dimension_type = #{dimensionType,jdbcType=TINYINT}, - status = #{status,jdbcType=TINYINT}, - remark = #{remark,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT}, - period_type = #{periodType,jdbcType=TINYINT}, - job_type = #{jobType,jdbcType=TINYINT}, - morder = #{morder,jdbcType=TINYINT} - where id = #{id,jdbcType=VARCHAR} - - - - - - - delete - from tb_kpi_dimension ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiIndicatorLibDetailMapper.xml b/src/com/sipai/mapper/kpi/KpiIndicatorLibDetailMapper.xml deleted file mode 100644 index 78371f3a..00000000 --- a/src/com/sipai/mapper/kpi/KpiIndicatorLibDetailMapper.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, dimension_id, indicator_name, content_a, content_b, content_c, content_d, indicator_detail, - create_time, update_time, is_deleted,morder, indicator_id,indicator_weight - - - - delete from tb_kpi_indicator_lib_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_indicator_lib_detail (id, dimension_id, indicator_name, - content_a, content_b, content_c, - content_d, indicator_detail, create_time, - update_time, is_deleted,morder,indicator_id,indicator_weight) - values (#{id,jdbcType=VARCHAR}, #{dimensionId,jdbcType=VARCHAR}, #{indicatorName,jdbcType=VARCHAR}, - #{contentA,jdbcType=VARCHAR}, #{contentB,jdbcType=VARCHAR}, #{contentC,jdbcType=VARCHAR}, - #{contentD,jdbcType=VARCHAR}, #{indicatorDetail,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{morder,jdbcType=VARCHAR}, #{indicatorId,jdbcType=VARCHAR}, #{indicatorWeight,jdbcType=DECIMAL}) - - - insert into tb_kpi_indicator_lib_detail - - - id, - - - dimension_id, - - - indicator_name, - - - content_a, - - - content_b, - - - content_c, - - - content_d, - - - indicator_detail, - - - create_time, - - - update_time, - - - is_deleted, - - - morder, - - - indicator_id, - - - indicator_weight, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{dimensionId,jdbcType=VARCHAR}, - - - #{indicatorName,jdbcType=VARCHAR}, - - - #{contentA,jdbcType=VARCHAR}, - - - #{contentB,jdbcType=VARCHAR}, - - - #{contentC,jdbcType=VARCHAR}, - - - #{contentD,jdbcType=VARCHAR}, - - - #{indicatorDetail,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{morder,jdbcType=VARCHAR}, - - - #{indicatorId,jdbcType=VARCHAR}, - - - #{indicatorWeight,jdbcType=DECIMAL}, - - - - - - - - update tb_kpi_indicator_lib_detail - - - dimension_id = #{dimensionId,jdbcType=VARCHAR}, - - - indicator_name = #{indicatorName,jdbcType=VARCHAR}, - - - content_a = #{contentA,jdbcType=VARCHAR}, - - - content_b = #{contentB,jdbcType=VARCHAR}, - - - content_c = #{contentC,jdbcType=VARCHAR}, - - - content_d = #{contentD,jdbcType=VARCHAR}, - - - indicator_detail = #{indicatorDetail,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - indicator_id = #{indicatorId,jdbcType=VARCHAR}, - - - indicator_weight = #{indicatorWeight,jdbcType=DECIMAL}, - - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_indicator_lib_detail - set dimension_id = #{dimensionId,jdbcType=VARCHAR}, - indicator_name = #{indicatorName,jdbcType=VARCHAR}, - content_a = #{contentA,jdbcType=VARCHAR}, - content_b = #{contentB,jdbcType=VARCHAR}, - content_c = #{contentC,jdbcType=VARCHAR}, - content_d = #{contentD,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=VARCHAR}, - indicator_detail = #{indicatorDetail,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_kpi_indicator_lib_detail - ${where} - - diff --git a/src/com/sipai/mapper/kpi/KpiIndicatorLibMapper.xml b/src/com/sipai/mapper/kpi/KpiIndicatorLibMapper.xml deleted file mode 100644 index 08e1dbeb..00000000 --- a/src/com/sipai/mapper/kpi/KpiIndicatorLibMapper.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id - , dimension_id, job_id, period_type, audit_level_weight, result_weight, process_weight, - create_time, update_time, is_deleted - - - - delete - from tb_kpi_indicator_lib - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_indicator_lib (id, dimension_id, job_id, - period_type, audit_level_weight, result_weight, - process_weight, create_time, update_time, - is_deleted) - values (#{id,jdbcType=VARCHAR}, #{dimensionId,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, - #{periodType,jdbcType=TINYINT}, #{auditLevelWeight,jdbcType=VARCHAR}, #{resultWeight,jdbcType=TINYINT}, - #{processWeight,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{isDeleted,jdbcType=BIT}) - - - insert into tb_kpi_indicator_lib - - - id, - - - dimension_id, - - - job_id, - - - period_type, - - - audit_level_weight, - - - result_weight, - - - process_weight, - - - create_time, - - - update_time, - - - is_deleted, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dimensionId,jdbcType=VARCHAR}, - - - #{jobId,jdbcType=VARCHAR}, - - - #{periodType,jdbcType=TINYINT}, - - - #{auditLevelWeight,jdbcType=VARCHAR}, - - - #{resultWeight,jdbcType=TINYINT}, - - - #{processWeight,jdbcType=TINYINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - - - update tb_kpi_indicator_lib - - - dimension_id = #{dimensionId,jdbcType=VARCHAR}, - - - job_id = #{jobId,jdbcType=VARCHAR}, - - - period_type = #{periodType,jdbcType=TINYINT}, - - - audit_level_weight = #{auditLevelWeight,jdbcType=VARCHAR}, - - - result_weight = #{resultWeight,jdbcType=TINYINT}, - - - process_weight = #{processWeight,jdbcType=TINYINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_indicator_lib - set dimension_id = #{dimensionId,jdbcType=VARCHAR}, - job_id = #{jobId,jdbcType=VARCHAR}, - period_type = #{periodType,jdbcType=TINYINT}, - audit_level_weight = #{auditLevelWeight,jdbcType=VARCHAR}, - result_weight = #{resultWeight,jdbcType=TINYINT}, - process_weight = #{processWeight,jdbcType=TINYINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - diff --git a/src/com/sipai/mapper/kpi/KpiPeriodInstanceMapper.xml b/src/com/sipai/mapper/kpi/KpiPeriodInstanceMapper.xml deleted file mode 100644 index 999cf23c..00000000 --- a/src/com/sipai/mapper/kpi/KpiPeriodInstanceMapper.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, job_type, period_year, period_type, period_no, create_user_id, create_time, update_time, - is_deleted - - - - delete - from tb_kpi_period_instance - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_period_instance (id, job_type, period_year, - period_type, period_no, create_user_id, - create_time, update_time, is_deleted) - values (#{id,jdbcType=VARCHAR}, #{jobType,jdbcType=TINYINT}, #{periodYear,jdbcType=CHAR}, - #{periodType,jdbcType=TINYINT}, #{periodNo,jdbcType=TINYINT}, #{createUserId,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}) - - - insert into tb_kpi_period_instance - - - id, - - - job_type, - - - period_year, - - - period_type, - - - period_no, - - - create_user_id, - - - create_time, - - - update_time, - - - is_deleted, - - - - - #{id,jdbcType=VARCHAR}, - - - #{jobType,jdbcType=TINYINT}, - - - #{periodYear,jdbcType=CHAR}, - - - #{periodType,jdbcType=TINYINT}, - - - #{periodNo,jdbcType=TINYINT}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - - - update tb_kpi_period_instance - - - job_type = #{jobType,jdbcType=TINYINT}, - - - period_year = #{periodYear,jdbcType=CHAR}, - - - period_type = #{periodType,jdbcType=TINYINT}, - - - period_no = #{periodNo,jdbcType=TINYINT}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_period_instance - set job_type = #{jobType,jdbcType=TINYINT}, - period_year = #{periodYear,jdbcType=CHAR}, - period_type = #{periodType,jdbcType=TINYINT}, - period_no = #{periodNo,jdbcType=TINYINT}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_kpi_period_instance ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiPlanDetailMapper.xml b/src/com/sipai/mapper/kpi/KpiPlanDetailMapper.xml deleted file mode 100644 index 51e42fa7..00000000 --- a/src/com/sipai/mapper/kpi/KpiPlanDetailMapper.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, plan_id, dimension_id, indicator_name, content_a, content_b, content_c, content_d, - indicator_detail, indicator_weight, create_time, update_time, is_deleted,morder - - - - - delete from tb_kpi_plan_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_plan_detail (id, plan_id, dimension_id, - indicator_name, content_a, content_b, - content_c, content_d, indicator_detail, - indicator_weight, create_time, update_time, - is_deleted,morder) - values (#{id,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{dimensionId,jdbcType=VARCHAR}, - #{indicatorName,jdbcType=VARCHAR}, #{contentA,jdbcType=VARCHAR}, #{contentB,jdbcType=VARCHAR}, - #{contentC,jdbcType=VARCHAR}, #{contentD,jdbcType=VARCHAR}, #{indicatorDetail,jdbcType=VARCHAR}, - #{indicatorWeight,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{isDeleted,jdbcType=BIT},#{morder,jdbcType=VARCHAR}) - - - insert into tb_kpi_plan_detail - - - id, - - - plan_id, - - - dimension_id, - - - indicator_name, - - - content_a, - - - content_b, - - - content_c, - - - content_d, - - - indicator_detail, - - - indicator_weight, - - - create_time, - - - update_time, - - - is_deleted, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{planId,jdbcType=VARCHAR}, - - - #{dimensionId,jdbcType=VARCHAR}, - - - #{indicatorName,jdbcType=VARCHAR}, - - - #{contentA,jdbcType=VARCHAR}, - - - #{contentB,jdbcType=VARCHAR}, - - - #{contentC,jdbcType=VARCHAR}, - - - #{contentD,jdbcType=VARCHAR}, - - - #{indicatorDetail,jdbcType=VARCHAR}, - - - #{indicatorWeight,jdbcType=DECIMAL}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{morder,jdbcType=VARCHAR}, - - - - - update tb_kpi_plan_detail - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - dimension_id = #{dimensionId,jdbcType=VARCHAR}, - - - indicator_name = #{indicatorName,jdbcType=VARCHAR}, - - - content_a = #{contentA,jdbcType=VARCHAR}, - - - content_b = #{contentB,jdbcType=VARCHAR}, - - - content_c = #{contentC,jdbcType=VARCHAR}, - - - content_d = #{contentD,jdbcType=VARCHAR}, - - - indicator_detail = #{indicatorDetail,jdbcType=VARCHAR}, - - - indicator_weight = #{indicatorWeight,jdbcType=DECIMAL}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_plan_detail - set plan_id = #{planId,jdbcType=VARCHAR}, - dimension_id = #{dimensionId,jdbcType=VARCHAR}, - indicator_name = #{indicatorName,jdbcType=VARCHAR}, - content_a = #{contentA,jdbcType=VARCHAR}, - content_b = #{contentB,jdbcType=VARCHAR}, - content_c = #{contentC,jdbcType=VARCHAR}, - content_d = #{contentD,jdbcType=VARCHAR}, - indicator_detail = #{indicatorDetail,jdbcType=VARCHAR}, - indicator_weight = #{indicatorWeight,jdbcType=DECIMAL}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT}, - morder = #{morder,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_kpi_plan_detail - ${where} - - - - - delete from - tb_kpi_plan_detail - where plan_id =#{planId} - - - - diff --git a/src/com/sipai/mapper/kpi/KpiPlanMapper.xml b/src/com/sipai/mapper/kpi/KpiPlanMapper.xml deleted file mode 100644 index 0a7d3282..00000000 --- a/src/com/sipai/mapper/kpi/KpiPlanMapper.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, obj_user_id, job_id, period_type, create_user_id, update_user_id, create_time, - update_time, is_deleted,unit_id - - - - delete from tb_kpi_plan - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_plan (id, obj_user_id, job_id, - period_type, create_user_id, update_user_id, - create_time, update_time, is_deleted,unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{objUserId,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, - #{periodType,jdbcType=TINYINT}, #{createUserId,jdbcType=VARCHAR}, #{updateUserId,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_kpi_plan - - - id, - - - obj_user_id, - - - job_id, - - - period_type, - - - create_user_id, - - - update_user_id, - - - create_time, - - - update_time, - - - is_deleted, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{objUserId,jdbcType=VARCHAR}, - - - #{jobId,jdbcType=VARCHAR}, - - - #{periodType,jdbcType=TINYINT}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{updateUserId,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_kpi_plan - - - obj_user_id = #{objUserId,jdbcType=VARCHAR}, - - - job_id = #{jobId,jdbcType=VARCHAR}, - - - period_type = #{periodType,jdbcType=TINYINT}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - update_user_id = #{updateUserId,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_plan - set obj_user_id = #{objUserId,jdbcType=VARCHAR}, - job_id = #{jobId,jdbcType=VARCHAR}, - period_type = #{periodType,jdbcType=TINYINT}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - update_user_id = #{updateUserId,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_kpi_plan - ${where} - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiPlanStaffDetailMapper.xml b/src/com/sipai/mapper/kpi/KpiPlanStaffDetailMapper.xml deleted file mode 100644 index d622c2fc..00000000 --- a/src/com/sipai/mapper/kpi/KpiPlanStaffDetailMapper.xml +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, plan_staff_id, dimension_id, indicator_name, content_a, content_b, content_c, - content_d, indicator_detail, indicator_weight, create_time, update_time, is_deleted - - - - delete from tb_kpi_plan_staff_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_plan_staff_detail (id, plan_staff_id, dimension_id, - indicator_name, content_a, content_b, - content_c, content_d, indicator_detail, - indicator_weight, create_time, update_time, - is_deleted) - values (#{id,jdbcType=VARCHAR}, #{planStaffId,jdbcType=VARCHAR}, #{dimensionId,jdbcType=VARCHAR}, - #{indicatorName,jdbcType=VARCHAR}, #{contentA,jdbcType=VARCHAR}, #{contentB,jdbcType=VARCHAR}, - #{contentC,jdbcType=VARCHAR}, #{contentD,jdbcType=VARCHAR}, #{indicatorDetail,jdbcType=VARCHAR}, - #{indicatorWeight,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{isDeleted,jdbcType=BIT}) - - - insert into tb_kpi_plan_staff_detail - - - id, - - - plan_staff_id, - - - dimension_id, - - - indicator_name, - - - content_a, - - - content_b, - - - content_c, - - - content_d, - - - indicator_detail, - - - indicator_weight, - - - create_time, - - - update_time, - - - is_deleted, - - - - - #{id,jdbcType=VARCHAR}, - - - #{planStaffId,jdbcType=VARCHAR}, - - - #{dimensionId,jdbcType=VARCHAR}, - - - #{indicatorName,jdbcType=VARCHAR}, - - - #{contentA,jdbcType=VARCHAR}, - - - #{contentB,jdbcType=VARCHAR}, - - - #{contentC,jdbcType=VARCHAR}, - - - #{contentD,jdbcType=VARCHAR}, - - - #{indicatorDetail,jdbcType=VARCHAR}, - - - #{indicatorWeight,jdbcType=DECIMAL}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - - - update tb_kpi_plan_staff_detail - - - plan_staff_id = #{planStaffId,jdbcType=VARCHAR}, - - - dimension_id = #{dimensionId,jdbcType=VARCHAR}, - - - indicator_name = #{indicatorName,jdbcType=VARCHAR}, - - - content_a = #{contentA,jdbcType=VARCHAR}, - - - content_b = #{contentB,jdbcType=VARCHAR}, - - - content_c = #{contentC,jdbcType=VARCHAR}, - - - content_d = #{contentD,jdbcType=VARCHAR}, - - - indicator_detail = #{indicatorDetail,jdbcType=VARCHAR}, - - - indicator_weight = #{indicatorWeight,jdbcType=DECIMAL}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_plan_staff_detail - set plan_staff_id = #{planStaffId,jdbcType=VARCHAR}, - dimension_id = #{dimensionId,jdbcType=VARCHAR}, - indicator_name = #{indicatorName,jdbcType=VARCHAR}, - content_a = #{contentA,jdbcType=VARCHAR}, - content_b = #{contentB,jdbcType=VARCHAR}, - content_c = #{contentC,jdbcType=VARCHAR}, - content_d = #{contentD,jdbcType=VARCHAR}, - indicator_detail = #{indicatorDetail,jdbcType=VARCHAR}, - indicator_weight = #{indicatorWeight,jdbcType=DECIMAL}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - delete from - tb_kpi_plan_staff_detail - ${where} - - - diff --git a/src/com/sipai/mapper/kpi/KpiPlanStaffMapper.xml b/src/com/sipai/mapper/kpi/KpiPlanStaffMapper.xml deleted file mode 100644 index c7792c96..00000000 --- a/src/com/sipai/mapper/kpi/KpiPlanStaffMapper.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, period_instance_id, obj_user_id, create_time, update_time, is_deleted, status, - create_user_id,job_id,unit_id,rejection_comment,apply_biz_id - - - - delete - from tb_kpi_plan_staff - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_plan_staff (id, period_instance_id, obj_user_id, - create_time, update_time, is_deleted, - status, create_user_id, job_id, unit_id, rejection_comment, apply_biz_id) - values (#{id,jdbcType=VARCHAR}, #{periodInstanceId,jdbcType=VARCHAR}, #{objUserId,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, - #{status,jdbcType=TINYINT}, #{createUserId,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{rejectionComment,jdbcType=VARCHAR}, #{applyBizId,jdbcType=VARCHAR}) - - - insert into tb_kpi_plan_staff - - - id, - - - period_instance_id, - - - obj_user_id, - - - create_time, - - - update_time, - - - is_deleted, - - - status, - - - create_user_id, - - - job_id, - - - unit_id, - - - rejection_comment, - - - apply_biz_id, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{periodInstanceId,jdbcType=VARCHAR}, - - - #{objUserId,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{status,jdbcType=TINYINT}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{jobId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{rejectionComment,jdbcType=VARCHAR}, - - - #{applyBizId,jdbcType=VARCHAR}, - - - - - - update tb_kpi_plan_staff - - - period_instance_id = #{periodInstanceId,jdbcType=VARCHAR}, - - - obj_user_id = #{objUserId,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - status = #{status,jdbcType=TINYINT}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - job_id = #{jobId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - rejection_comment = #{rejectionComment,jdbcType=VARCHAR}, - - - - apply_biz_id = #{applyBizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_plan_staff - set period_instance_id = #{periodInstanceId,jdbcType=VARCHAR}, - obj_user_id = #{objUserId,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT}, - status = #{status,jdbcType=TINYINT}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - job_id = #{jobId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - rejection_comment = #{rejectionComment,jdbcType=VARCHAR}, - apply_biz_id = #{applyBizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete - from tb_kpi_plan_staff ${where} - - - update tb_kpi_plan_staff - set status = #{status,jdbcType=TINYINT} - where apply_biz_id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiResultIndicatorMapper.xml b/src/com/sipai/mapper/kpi/KpiResultIndicatorMapper.xml deleted file mode 100644 index 84e1a8fe..00000000 --- a/src/com/sipai/mapper/kpi/KpiResultIndicatorMapper.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - id, plan_staff_detail_id, audit_level, auditor_id, result_point, create_time, update_time, - is_deleted, process_point - - - - delete from tb_kpi_result_indicator - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_result_indicator (id, plan_staff_detail_id, audit_level, - auditor_id, result_point, create_time, - update_time, is_deleted, process_point - ) - values (#{id,jdbcType=VARCHAR}, #{planStaffDetailId,jdbcType=VARCHAR}, #{auditLevel,jdbcType=TINYINT}, - #{auditorId,jdbcType=VARCHAR}, #{resultPoint,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{processPoint,jdbcType=DECIMAL} - ) - - - insert into tb_kpi_result_indicator - - - id, - - - plan_staff_detail_id, - - - audit_level, - - - auditor_id, - - - result_point, - - - create_time, - - - update_time, - - - is_deleted, - - - process_point, - - - - - #{id,jdbcType=VARCHAR}, - - - #{planStaffDetailId,jdbcType=VARCHAR}, - - - #{auditLevel,jdbcType=TINYINT}, - - - #{auditorId,jdbcType=VARCHAR}, - - - #{resultPoint,jdbcType=DECIMAL}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{processPoint,jdbcType=DECIMAL}, - - - - - update tb_kpi_result_indicator - - - plan_staff_detail_id = #{planStaffDetailId,jdbcType=VARCHAR}, - - - audit_level = #{auditLevel,jdbcType=TINYINT}, - - - auditor_id = #{auditorId,jdbcType=VARCHAR}, - - - result_point = #{resultPoint,jdbcType=DECIMAL}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - process_point = #{processPoint,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_result_indicator - set plan_staff_detail_id = #{planStaffDetailId,jdbcType=VARCHAR}, - audit_level = #{auditLevel,jdbcType=TINYINT}, - auditor_id = #{auditorId,jdbcType=VARCHAR}, - result_point = #{resultPoint,jdbcType=DECIMAL}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT}, - process_point = #{processPoint,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - delete from - tb_kpi_result_indicator - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiResultIndicatorWeightMapper.xml b/src/com/sipai/mapper/kpi/KpiResultIndicatorWeightMapper.xml deleted file mode 100644 index b427e0dd..00000000 --- a/src/com/sipai/mapper/kpi/KpiResultIndicatorWeightMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - id, plan_staff_detail_id, weight_point, remark, create_time, update_time, is_deleted,completion_status - - - - delete from tb_kpi_result_indicator_weight - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_result_indicator_weight (id, plan_staff_detail_id, weight_point, - remark, create_time, update_time, - is_deleted,completion_status) - values (#{id,jdbcType=VARCHAR}, #{planStaffDetailId,jdbcType=VARCHAR}, #{weightPoint,jdbcType=DECIMAL}, - #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{isDeleted,jdbcType=BIT},#{completionStatus,jdbcType=VARCHAR}) - - - insert into tb_kpi_result_indicator_weight - - - id, - - - plan_staff_detail_id, - - - weight_point, - - - remark, - - - create_time, - - - update_time, - - - is_deleted, - - - completion_status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{planStaffDetailId,jdbcType=VARCHAR}, - - - #{weightPoint,jdbcType=DECIMAL}, - - - #{remark,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - #{completionStatus,jdbcType=VARCHAR}, - - - - - update tb_kpi_result_indicator_weight - - - plan_staff_detail_id = #{planStaffDetailId,jdbcType=VARCHAR}, - - - weight_point = #{weightPoint,jdbcType=DECIMAL}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - completion_status = #{completionStatus,jdbcType=VARCHAR}, - - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_result_indicator_weight - set plan_staff_detail_id = #{planStaffDetailId,jdbcType=VARCHAR}, - weight_point = #{weightPoint,jdbcType=DECIMAL}, - remark = #{remark,jdbcType=VARCHAR}, - completion_status = #{completionStatus,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - - - update tb_kpi_result_indicator_weight - - - plan_staff_detail_id = #{planStaffDetailId,jdbcType=VARCHAR}, - - - weight_point = #{weightPoint,jdbcType=DECIMAL}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - completion_status = #{completionStatus,jdbcType=VARCHAR}, - - - ${where} - - - delete from - tb_kpi_result_indicator_weight - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/kpi/KpiResultMapper.xml b/src/com/sipai/mapper/kpi/KpiResultMapper.xml deleted file mode 100644 index 1457ff22..00000000 --- a/src/com/sipai/mapper/kpi/KpiResultMapper.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - id, plan_staff_id, dimension_point, single_indicator_name, single_indicator_point, - result_point, result_level, create_time, update_time, is_deleted - - - - delete - from tb_kpi_result - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_kpi_result (id, plan_staff_id, dimension_point, - single_indicator_name, single_indicator_point, - result_point, result_level, create_time, - update_time, is_deleted) - values (#{id,jdbcType=VARCHAR}, #{planStaffId,jdbcType=VARCHAR}, #{dimensionPoint,jdbcType=DECIMAL}, - #{singleIndicatorName,jdbcType=VARCHAR}, #{singleIndicatorPoint,jdbcType=DECIMAL}, - #{resultPoint,jdbcType=DECIMAL}, #{resultLevel,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}) - - - insert into tb_kpi_result - - - id, - - - plan_staff_id, - - - dimension_point, - - - single_indicator_name, - - - single_indicator_point, - - - result_point, - - - result_level, - - - create_time, - - - update_time, - - - is_deleted, - - - - - #{id,jdbcType=VARCHAR}, - - - #{planStaffId,jdbcType=VARCHAR}, - - - #{dimensionPoint,jdbcType=DECIMAL}, - - - #{singleIndicatorName,jdbcType=VARCHAR}, - - - #{singleIndicatorPoint,jdbcType=DECIMAL}, - - - #{resultPoint,jdbcType=DECIMAL}, - - - #{resultLevel,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{isDeleted,jdbcType=BIT}, - - - - - update tb_kpi_result - - - plan_staff_id = #{planStaffId,jdbcType=VARCHAR}, - - - dimension_point = #{dimensionPoint,jdbcType=DECIMAL}, - - - single_indicator_name = #{singleIndicatorName,jdbcType=VARCHAR}, - - - single_indicator_point = #{singleIndicatorPoint,jdbcType=DECIMAL}, - - - result_point = #{resultPoint,jdbcType=DECIMAL}, - - - result_level = #{resultLevel,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - is_deleted = #{isDeleted,jdbcType=BIT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_kpi_result - set plan_staff_id = #{planStaffId,jdbcType=VARCHAR}, - dimension_point = #{dimensionPoint,jdbcType=DECIMAL}, - single_indicator_name = #{singleIndicatorName,jdbcType=VARCHAR}, - single_indicator_point = #{singleIndicatorPoint,jdbcType=DECIMAL}, - result_point = #{resultPoint,jdbcType=DECIMAL}, - result_level = #{resultLevel,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - is_deleted = #{isDeleted,jdbcType=BIT} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete - from tb_kpi_result ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/AbnormityMapper.xml b/src/com/sipai/mapper/maintenance/AbnormityMapper.xml deleted file mode 100644 index 0d1b0f9e..00000000 --- a/src/com/sipai/mapper/maintenance/AbnormityMapper.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, biz_id, type, equipment_ids, process_section_id, status, sumit_man, - defect_level, abnormity_description, remark, library_id, patrol_record_id, patrol_point_id, processid, processdefid,receive_user_id - - - - delete - from tb_abnormity - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_abnormity (id, insdt, insuser, - biz_id, type, equipment_ids, - process_section_id, status, sumit_man, - defect_level, abnormity_description, remark, library_id, patrol_record_id, - patrol_point_id, processid, processdefid,receive_user_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{equipmentIds,jdbcType=VARCHAR}, - #{processSectionId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{sumitMan,jdbcType=VARCHAR}, - #{defectLevel,jdbcType=VARCHAR}, #{abnormityDescription,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{libraryId,jdbcType=VARCHAR}, #{patrolRecordId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}) - - - insert into tb_abnormity - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - type, - - - equipment_ids, - - - process_section_id, - - - status, - - - sumit_man, - - - defect_level, - - - abnormity_description, - - - remark, - - - library_id, - - - patrol_record_id, - - - patrol_point_id, - - - processid, - - - processdefid, - - - receive_user_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{equipmentIds,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{sumitMan,jdbcType=VARCHAR}, - - - #{defectLevel,jdbcType=VARCHAR}, - - - #{abnormityDescription,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{libraryId,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - - - update tb_abnormity - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - equipment_ids = #{equipmentIds,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - sumit_man = #{sumitMan,jdbcType=VARCHAR}, - - - defect_level = #{defectLevel,jdbcType=VARCHAR}, - - - abnormity_description = #{abnormityDescription,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - library_id = #{libraryId,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolPointId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - processid = #{processid,jdbcType=VARCHAR}, - - - processdefid = #{processdefid,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_abnormity - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - equipment_ids = #{equipmentIds,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - sumit_man = #{sumitMan,jdbcType=VARCHAR}, - defect_level = #{defectLevel,jdbcType=VARCHAR}, - abnormity_description = #{abnormityDescription,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - library_id = #{libraryId,jdbcType=VARCHAR}, - patrol_record_id = #{patrolPointId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - processid = #{processid,jdbcType=VARCHAR}, - processdefid = #{processdefid,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_abnormity ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryEquipmentMapper.xml b/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryEquipmentMapper.xml deleted file mode 100644 index 1e89526c..00000000 --- a/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryEquipmentMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - id, equid, pid - - - - delete from tb_maintenance_anticorrosive_library_equipment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_anticorrosive_library_equipment (id, equid, pid - ) - values (#{id,jdbcType=VARCHAR}, #{equid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_anticorrosive_library_equipment - - - id, - - - equid, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{equid,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_maintenance_anticorrosive_library_equipment - - - equid = #{equid,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_anticorrosive_library_equipment - set equid = #{equid,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_anticorrosive_library_equipment - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryMapper.xml b/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryMapper.xml deleted file mode 100644 index 5f3bf3fc..00000000 --- a/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryMapper.xml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, project_number, project_name, num, contents, area, cycle, mode, reason, quality_requirement, - warranty_time, times, cost, total_cost, memo, unit_id, insdt, insuser - - - - delete from tb_maintenance_anticorrosive_library - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_anticorrosive_library (id, project_number, project_name, - num, contents, area, - cycle, mode, reason, - quality_requirement, warranty_time, times, - cost, total_cost, memo, - unit_id, insdt, insuser) - values (#{id,jdbcType=VARCHAR}, #{projectNumber,jdbcType=VARCHAR}, #{projectName,jdbcType=VARCHAR}, - #{num,jdbcType=INTEGER}, #{contents,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, - #{cycle,jdbcType=VARCHAR}, #{mode,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR}, - #{qualityRequirement,jdbcType=VARCHAR}, #{warrantyTime,jdbcType=VARCHAR}, #{times,jdbcType=DECIMAL}, - #{cost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR},#{insdt,jdbcType=TIMESTAMP},#{insuser,jdbcType=VARCHAR}) - - - insert into tb_maintenance_anticorrosive_library - - - id, - - - project_number, - - - project_name, - - - num, - - - contents, - - - area, - - - cycle, - - - mode, - - - reason, - - - quality_requirement, - - - warranty_time, - - - times, - - - cost, - - - total_cost, - - - memo, - - - unit_id, - - - insdt, - - - insuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{projectNumber,jdbcType=VARCHAR}, - - - #{projectName,jdbcType=VARCHAR}, - - - #{num,jdbcType=INTEGER}, - - - #{contents,jdbcType=VARCHAR}, - - - #{area,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{mode,jdbcType=VARCHAR}, - - - #{reason,jdbcType=VARCHAR}, - - - #{qualityRequirement,jdbcType=VARCHAR}, - - - #{warrantyTime,jdbcType=VARCHAR}, - - - #{times,jdbcType=DECIMAL}, - - - #{cost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{memo,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - - update tb_maintenance_anticorrosive_library - - - project_number = #{projectNumber,jdbcType=VARCHAR}, - - - project_name = #{projectName,jdbcType=VARCHAR}, - - - num = #{num,jdbcType=INTEGER}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - area = #{area,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - mode = #{mode,jdbcType=VARCHAR}, - - - reason = #{reason,jdbcType=VARCHAR}, - - - quality_requirement = #{qualityRequirement,jdbcType=VARCHAR}, - - - warranty_time = #{warrantyTime,jdbcType=VARCHAR}, - - - times = #{times,jdbcType=DECIMAL}, - - - cost = #{cost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_anticorrosive_library - set project_number = #{projectNumber,jdbcType=VARCHAR}, - project_name = #{projectName,jdbcType=VARCHAR}, - num = #{num,jdbcType=INTEGER}, - contents = #{contents,jdbcType=VARCHAR}, - area = #{area,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - mode = #{mode,jdbcType=VARCHAR}, - reason = #{reason,jdbcType=VARCHAR}, - quality_requirement = #{qualityRequirement,jdbcType=VARCHAR}, - warranty_time = #{warrantyTime,jdbcType=VARCHAR}, - times = #{times,jdbcType=DECIMAL}, - cost = #{cost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - memo = #{memo,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_anticorrosive_library - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryMaterialMapper.xml b/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryMaterialMapper.xml deleted file mode 100644 index ec9f6ec4..00000000 --- a/src/com/sipai/mapper/maintenance/AnticorrosiveLibraryMaterialMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - id, material_id, pid, num, insuser, insdt - - - - delete from tb_maintenance_anticorrosive_library_material - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_anticorrosive_library_material (id, material_id, pid, - num, insuser, insdt - ) - values (#{id,jdbcType=VARCHAR}, #{materialId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{num,jdbcType=DECIMAL}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP} - ) - - - insert into tb_maintenance_anticorrosive_library_material - - - id, - - - material_id, - - - pid, - - - num, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{materialId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{num,jdbcType=DECIMAL}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update tb_maintenance_anticorrosive_library_material - - - material_id = #{materialId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - num = #{num,jdbcType=DECIMAL}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_anticorrosive_library_material - set material_id = #{materialId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - num = #{num,jdbcType=DECIMAL}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_anticorrosive_library_material - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/AnticorrosiveMaterialMapper.xml b/src/com/sipai/mapper/maintenance/AnticorrosiveMaterialMapper.xml deleted file mode 100644 index 52ef081f..00000000 --- a/src/com/sipai/mapper/maintenance/AnticorrosiveMaterialMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - id, name, cost - - - - delete from tb_maintenance_anticorrosive_material - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_anticorrosive_material (id, name, cost - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{cost,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_anticorrosive_material - - - id, - - - name, - - - cost, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{cost,jdbcType=VARCHAR}, - - - - - update tb_maintenance_anticorrosive_material - - - name = #{name,jdbcType=VARCHAR}, - - - cost = #{cost,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_anticorrosive_material - set name = #{name,jdbcType=VARCHAR}, - cost = #{cost,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_anticorrosive_material - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/EquipmentPlanEquMapper.xml b/src/com/sipai/mapper/maintenance/EquipmentPlanEquMapper.xml deleted file mode 100644 index bcc9ca22..00000000 --- a/src/com/sipai/mapper/maintenance/EquipmentPlanEquMapper.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - id, equipment_id, contents, plan_money, plan_date, pid, status - - - - delete from tb_equipment_plan_equ - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_plan_equ (id, equipment_id, contents, - plan_money, plan_date, pid, - status) - values (#{id,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, - #{planMoney,jdbcType=DECIMAL}, #{planDate,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}) - - - insert into tb_equipment_plan_equ - - - id, - - - equipment_id, - - - contents, - - - plan_money, - - - plan_date, - - - pid, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{planMoney,jdbcType=DECIMAL}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{pid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - - - update tb_equipment_plan_equ - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - plan_money = #{planMoney,jdbcType=DECIMAL}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_plan_equ - set equipment_id = #{equipmentId,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - plan_money = #{planMoney,jdbcType=DECIMAL}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - pid = #{pid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_plan_equ - ${where} - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/EquipmentPlanMainYearDetailMapper.xml b/src/com/sipai/mapper/maintenance/EquipmentPlanMainYearDetailMapper.xml deleted file mode 100644 index 2e0ad623..00000000 --- a/src/com/sipai/mapper/maintenance/EquipmentPlanMainYearDetailMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, main_type, pid, month - - - - delete from tb_equipment_plan_main_year_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_plan_main_year_detail (id, main_type, pid, - month) - values (#{id,jdbcType=VARCHAR}, #{mainType,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{month,jdbcType=VARCHAR}) - - - insert into tb_equipment_plan_main_year_detail - - - id, - - - main_type, - - - pid, - - - month, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mainType,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{month,jdbcType=VARCHAR}, - - - - - update tb_equipment_plan_main_year_detail - - - main_type = #{mainType,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - month = #{month,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_plan_main_year_detail - set main_type = #{mainType,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - month = #{month,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_plan_main_year_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/EquipmentPlanMainYearMapper.xml b/src/com/sipai/mapper/maintenance/EquipmentPlanMainYearMapper.xml deleted file mode 100644 index 36625dfb..00000000 --- a/src/com/sipai/mapper/maintenance/EquipmentPlanMainYearMapper.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, unit_id, equipment_id, plan_money, particular_year, remark, type,plan_type, - contents,receive_user_id - - - - delete - from tb_equipment_plan_main_year - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_plan_main_year (id, insdt, insuser, - unit_id, equipment_id, plan_money, - particular_year, remark, type, plan_type, - contents, receive_user_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{planMoney,jdbcType=DECIMAL}, - #{particularYear,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{planType,jdbcType=VARCHAR}, - #{contents,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}) - - - insert into tb_equipment_plan_main_year - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - equipment_id, - - - plan_money, - - - particular_year, - - - remark, - - - type, - - - plan_type, - - - contents, - - - receive_user_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{planMoney,jdbcType=DECIMAL}, - - - #{particularYear,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{planType,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - - - update tb_equipment_plan_main_year - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - plan_money = #{planMoney,jdbcType=DECIMAL}, - - - particular_year = #{particularYear,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - plan_type = #{planType,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_plan_main_year - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - plan_money = #{planMoney,jdbcType=DECIMAL}, - particular_year = #{particularYear,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - plan_type = #{planType,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_equipment_plan_main_year ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/EquipmentPlanMapper.xml b/src/com/sipai/mapper/maintenance/EquipmentPlanMapper.xml deleted file mode 100644 index ae85ff30..00000000 --- a/src/com/sipai/mapper/maintenance/EquipmentPlanMapper.xml +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, plan_number, plan_type_big, plan_type_small, plan_date, plan_money, plan_contents, status, cycle, - audit_id, processdefid, processId, unit_id, insdt, insuser, group_type_id, group_detail_id - - - - delete from tb_equipment_plan - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_plan (id, plan_number, plan_type_big, plan_type_small, - plan_date, plan_money, plan_contents, - status, cycle, audit_id, - processdefid, processId, unit_id, - insdt, insuser, group_type_id, group_detail_id) - values (#{id,jdbcType=VARCHAR}, #{planNumber,jdbcType=VARCHAR}, #{planTypeBig,jdbcType=VARCHAR}, - #{planTypeSmall,jdbcType=VARCHAR}, - #{planDate,jdbcType=TIMESTAMP}, #{planMoney,jdbcType=DECIMAL}, #{planContents,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{cycle,jdbcType=VARCHAR}, #{auditId,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{groupTypeId,jdbcType=VARCHAR}, #{groupDetailId,jdbcType=VARCHAR}) - - - insert into tb_equipment_plan - - - id, - - - plan_number, - - - plan_type_big, - - - plan_type_small, - - - plan_date, - - - plan_money, - - - plan_contents, - - - status, - - - cycle, - - - audit_id, - - - processdefid, - - - processId, - - - unit_id, - - - insdt, - - - insuser, - - - group_type_id, - - - group_detail_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{planNumber,jdbcType=VARCHAR}, - - - #{planTypeBig,jdbcType=VARCHAR}, - - - #{planTypeSmall,jdbcType=VARCHAR}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{planMoney,jdbcType=DECIMAL}, - - - #{planContents,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{groupTypeId,jdbcType=VARCHAR}, - - - #{groupDetailId,jdbcType=VARCHAR}, - - - - - update tb_equipment_plan - - - plan_number = #{planNumber,jdbcType=VARCHAR}, - - - plan_type_big = #{planTypeBig,jdbcType=VARCHAR}, - - - plan_type_small = #{planTypeSmall,jdbcType=VARCHAR}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - plan_money = #{planMoney,jdbcType=DECIMAL}, - - - plan_contents = #{planContents,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - processdefid = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - group_type_id = #{groupTypeId,jdbcType=VARCHAR}, - - - group_detail_id = #{groupDetailId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_plan - set plan_number = #{planNumber,jdbcType=VARCHAR}, - plan_type_big = #{planTypeBig,jdbcType=VARCHAR}, - plan_type_small = #{planTypeSmall,jdbcType=VARCHAR}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - plan_money = #{planMoney,jdbcType=DECIMAL}, - plan_contents = #{planContents,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR}, - processdefid = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - group_type_id = #{groupTypeId,jdbcType=VARCHAR}, - group_detail_id = #{groupDetailId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_plan - ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/com/sipai/mapper/maintenance/EquipmentPlanTypeMapper.xml b/src/com/sipai/mapper/maintenance/EquipmentPlanTypeMapper.xml deleted file mode 100644 index 36f9a989..00000000 --- a/src/com/sipai/mapper/maintenance/EquipmentPlanTypeMapper.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - id, library_active, name, type, pid, code, morder, is_compete - - - - - delete from tb_equipment_plan_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_equipment_plan_type (id, library_active, name, - type, pid, code, morder, is_compete) - values (#{id,jdbcType=VARCHAR}, #{libraryActive,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{isCompete,jdbcType=VARCHAR}) - - - insert into tb_equipment_plan_type - - - id, - - - library_active, - - - name, - - - type, - - - pid, - - - code, - - - morder, - - - isCompete, - - - - - #{id,jdbcType=VARCHAR}, - - - #{libraryActive,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{isCompete,jdbcType=VARCHAR}, - - - - - update tb_equipment_plan_type - - - library_active = #{libraryActive,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - is_compete = #{isCompete,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_equipment_plan_type - set library_active = #{libraryActive,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - is_compete = #{isCompete,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_equipment_plan_type - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/FaultLibraryMapper.xml b/src/com/sipai/mapper/maintenance/FaultLibraryMapper.xml deleted file mode 100644 index 15b9aaea..00000000 --- a/src/com/sipai/mapper/maintenance/FaultLibraryMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, name, pid, insdt, insuser, active, morder - - - - delete from tb_maintenance_faultlibrary - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_faultlibrary (id, name, pid, - insdt, insuser, active, - morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_maintenance_faultlibrary - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - active, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_maintenance_faultlibrary - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_faultlibrary - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance_faultlibrary - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryAddResetProjectBizMapper.xml b/src/com/sipai/mapper/maintenance/LibraryAddResetProjectBizMapper.xml deleted file mode 100644 index 92e28833..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryAddResetProjectBizMapper.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, dismantle, install, debugging, accessory, transport, outside_repair_cost, inside_repair_time, - material_cost, project_id, equipment_id, unit_id - - - - delete from tb_library_addreset_project_biz - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_addreset_project_biz (id, dismantle, install, - debugging, accessory, transport, - outside_repair_cost, inside_repair_time, material_cost, - project_id, equipment_id, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{dismantle,jdbcType=DECIMAL}, #{install,jdbcType=DECIMAL}, - #{debugging,jdbcType=DECIMAL}, #{accessory,jdbcType=DECIMAL}, #{transport,jdbcType=DECIMAL}, - #{outsideRepairCost,jdbcType=DECIMAL}, #{insideRepairTime,jdbcType=DECIMAL}, #{materialCost,jdbcType=DECIMAL}, - #{projectId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_library_addreset_project_biz - - - id, - - - dismantle, - - - install, - - - debugging, - - - accessory, - - - transport, - - - outside_repair_cost, - - - inside_repair_time, - - - material_cost, - - - project_id, - - - equipment_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dismantle,jdbcType=DECIMAL}, - - - #{install,jdbcType=DECIMAL}, - - - #{debugging,jdbcType=DECIMAL}, - - - #{accessory,jdbcType=DECIMAL}, - - - #{transport,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{projectId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_addreset_project_biz - - - dismantle = #{dismantle,jdbcType=DECIMAL}, - - - install = #{install,jdbcType=DECIMAL}, - - - debugging = #{debugging,jdbcType=DECIMAL}, - - - accessory = #{accessory,jdbcType=DECIMAL}, - - - transport = #{transport,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - project_id = #{projectId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_addreset_project_biz - set dismantle = #{dismantle,jdbcType=DECIMAL}, - install = #{install,jdbcType=DECIMAL}, - debugging = #{debugging,jdbcType=DECIMAL}, - accessory = #{accessory,jdbcType=DECIMAL}, - transport = #{transport,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - project_id = #{projectId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_addreset_project_biz - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryAddResetProjectBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryAddResetProjectBlocMapper.xml deleted file mode 100644 index 67a9f207..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryAddResetProjectBlocMapper.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, dismantle, install, debugging, accessory, transport, outside_repair_cost, inside_repair_time, - material_cost, project_id, model_id, unit_id - - - - delete from tb_library_addreset_project_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_addreset_project_bloc (id, dismantle, install, - debugging, accessory, transport, - outside_repair_cost, inside_repair_time, material_cost, - project_id, model_id, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{dismantle,jdbcType=DECIMAL}, #{install,jdbcType=DECIMAL}, - #{debugging,jdbcType=DECIMAL}, #{accessory,jdbcType=DECIMAL}, #{transport,jdbcType=DECIMAL}, - #{outsideRepairCost,jdbcType=DECIMAL}, #{insideRepairTime,jdbcType=DECIMAL}, #{materialCost,jdbcType=DECIMAL}, - #{projectId,jdbcType=VARCHAR}, #{modelId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_library_addreset_project_bloc - - - id, - - - dismantle, - - - install, - - - debugging, - - - accessory, - - - transport, - - - outside_repair_cost, - - - inside_repair_time, - - - material_cost, - - - project_id, - - - model_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dismantle,jdbcType=DECIMAL}, - - - #{install,jdbcType=DECIMAL}, - - - #{debugging,jdbcType=DECIMAL}, - - - #{accessory,jdbcType=DECIMAL}, - - - #{transport,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{projectId,jdbcType=VARCHAR}, - - - #{modelId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_addreset_project_bloc - - - dismantle = #{dismantle,jdbcType=DECIMAL}, - - - install = #{install,jdbcType=DECIMAL}, - - - debugging = #{debugging,jdbcType=DECIMAL}, - - - accessory = #{accessory,jdbcType=DECIMAL}, - - - transport = #{transport,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - project_id = #{projectId,jdbcType=VARCHAR}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_addreset_project_bloc - set dismantle = #{dismantle,jdbcType=DECIMAL}, - install = #{install,jdbcType=DECIMAL}, - debugging = #{debugging,jdbcType=DECIMAL}, - accessory = #{accessory,jdbcType=DECIMAL}, - transport = #{transport,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - project_id = #{projectId,jdbcType=VARCHAR}, - model_id = #{modelId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_addreset_project_bloc - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryAddResetProjectMapper.xml b/src/com/sipai/mapper/maintenance/LibraryAddResetProjectMapper.xml deleted file mode 100644 index da2b87d6..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryAddResetProjectMapper.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, code, name, type, repair_party_type, condition, cycle, remark, morder, model_id, - unit_id, pid, insdt, insuser - - - - delete from tb_library_addreset_project - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_addreset_project (id, code, name, - type, repair_party_type, condition, - cycle, remark, morder, - model_id, unit_id, pid, - insdt, insuser) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{repairPartyType,jdbcType=VARCHAR}, #{condition,jdbcType=VARCHAR}, - #{cycle,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{modelId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}) - - - insert into tb_library_addreset_project - - - id, - - - code, - - - name, - - - type, - - - repair_party_type, - - - condition, - - - cycle, - - - remark, - - - morder, - - - model_id, - - - unit_id, - - - pid, - - - insdt, - - - insuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{repairPartyType,jdbcType=VARCHAR}, - - - #{condition,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{modelId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - - update tb_library_addreset_project - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - repair_party_type = #{repairPartyType,jdbcType=VARCHAR}, - - - condition = #{condition,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_addreset_project - set code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - repair_party_type = #{repairPartyType,jdbcType=VARCHAR}, - condition = #{condition,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - model_id = #{modelId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_addreset_project - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryBaseMapper.xml b/src/com/sipai/mapper/maintenance/LibraryBaseMapper.xml deleted file mode 100644 index fc6d49b9..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryBaseMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, library_type, place_status, updt, upuser - - - - delete from tb_library_base - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_base (id, library_type, place_status, - updt, upuser) - values (#{id,jdbcType=VARCHAR}, #{libraryType,jdbcType=VARCHAR}, #{placeStatus,jdbcType=VARCHAR}, - #{updt,jdbcType=TIMESTAMP}, #{upuser,jdbcType=VARCHAR}) - - - insert into tb_library_base - - - id, - - - library_type, - - - place_status, - - - updt, - - - upuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{libraryType,jdbcType=VARCHAR}, - - - #{placeStatus,jdbcType=VARCHAR}, - - - #{updt,jdbcType=TIMESTAMP}, - - - #{upuser,jdbcType=VARCHAR}, - - - - - update tb_library_base - - - library_type = #{libraryType,jdbcType=VARCHAR}, - - - place_status = #{placeStatus,jdbcType=VARCHAR}, - - - updt = #{updt,jdbcType=TIMESTAMP}, - - - upuser = #{upuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_base - set library_type = #{libraryType,jdbcType=VARCHAR}, - place_status = #{placeStatus,jdbcType=VARCHAR}, - updt = #{updt,jdbcType=TIMESTAMP}, - upuser = #{upuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_library_base - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryFaultBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryFaultBlocMapper.xml deleted file mode 100644 index 62a92076..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryFaultBlocMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - id, fault_name, fault_number, fault_describe, pid, insdt, insuser, active, morder,unit_id - - - - delete from tb_library_fault_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_fault_bloc (id, fault_name, fault_number, - fault_describe, pid, insdt, - insuser, active, morder, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{faultName,jdbcType=VARCHAR}, #{faultNumber,jdbcType=VARCHAR}, - #{faultDescribe,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{unitId,jdbcType=INTEGER} - ) - - - insert into tb_library_fault_bloc - - - id, - - - fault_name, - - - fault_number, - - - fault_describe, - - - pid, - - - insdt, - - - insuser, - - - active, - - - morder, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{faultName,jdbcType=VARCHAR}, - - - #{faultNumber,jdbcType=VARCHAR}, - - - #{faultDescribe,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_fault_bloc - - - fault_name = #{faultName,jdbcType=VARCHAR}, - - - fault_number = #{faultNumber,jdbcType=VARCHAR}, - - - fault_describe = #{faultDescribe,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_fault_bloc - set fault_name = #{faultName,jdbcType=VARCHAR}, - fault_number = #{faultNumber,jdbcType=VARCHAR}, - fault_describe = #{faultDescribe,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_library_fault_bloc - ${where} - - - - INSERT INTO tb_library_fault_bloc ( id, fault_name, fault_number, fault_describe, pid, insdt, insuser, active, morder, unit_id ) - SELECT - id + #{unitId}, - fault_name, - fault_number, - fault_describe, - pid, - insdt, - insuser, - active, - morder, - #{unitId} - FROM - tb_library_fault_bloc - WHERE - unit_id = '-1' - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryMaintainCarDetailMapper.xml b/src/com/sipai/mapper/maintenance/LibraryMaintainCarDetailMapper.xml deleted file mode 100644 index 075215d4..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryMaintainCarDetailMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - id, maintain_car_id, num_10thousand_km, money, working_hours, memo, insdt, insuser, - upsdt, upsuser - - - - delete from tb_library_maintain_car_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_maintain_car_detail (id, maintain_car_id, num_10thousand_km, - money, working_hours, memo, - insdt, insuser, upsdt, - upsuser) - values (#{id,jdbcType=VARCHAR}, #{maintainCarId,jdbcType=VARCHAR}, #{num10thousandKm,jdbcType=DOUBLE}, - #{money,jdbcType=DECIMAL}, #{workingHours,jdbcType=DOUBLE}, #{memo,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}) - - - insert into tb_library_maintain_car_detail - - - id, - - - maintain_car_id, - - - num_10thousand_km, - - - money, - - - working_hours, - - - memo, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{maintainCarId,jdbcType=VARCHAR}, - - - #{num10thousandKm,jdbcType=DOUBLE}, - - - #{money,jdbcType=DECIMAL}, - - - #{workingHours,jdbcType=DOUBLE}, - - - #{memo,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - - - update tb_library_maintain_car_detail - - - maintain_car_id = #{maintainCarId,jdbcType=VARCHAR}, - - - num_10thousand_km = #{num10thousandKm,jdbcType=DOUBLE}, - - - money = #{money,jdbcType=DECIMAL}, - - - working_hours = #{workingHours,jdbcType=DOUBLE}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_maintain_car_detail - set maintain_car_id = #{maintainCarId,jdbcType=VARCHAR}, - num_10thousand_km = #{num10thousandKm,jdbcType=DOUBLE}, - money = #{money,jdbcType=DECIMAL}, - working_hours = #{workingHours,jdbcType=DOUBLE}, - memo = #{memo,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_maintain_car_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryMaintainCarMapper.xml b/src/com/sipai/mapper/maintenance/LibraryMaintainCarMapper.xml deleted file mode 100644 index 447e5fc2..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryMaintainCarMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, name, model, fuel_consumption_per100km, unit_id, insdt, insuser, upsdt, upsuser, - memo, morder - - - - delete from tb_library_maintain_car - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_maintain_car (id, name, model, - fuel_consumption_per100km, unit_id, insdt, - insuser, upsdt, upsuser, - memo, morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, - #{fuelConsumptionPer100km,jdbcType=DOUBLE}, #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_library_maintain_car - - - id, - - - name, - - - model, - - - fuel_consumption_per100km, - - - unit_id, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - memo, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{fuelConsumptionPer100km,jdbcType=DOUBLE}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_library_maintain_car - - - name = #{name,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - fuel_consumption_per100km = #{fuelConsumptionPer100km,jdbcType=DOUBLE}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_maintain_car - set name = #{name,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - fuel_consumption_per100km = #{fuelConsumptionPer100km,jdbcType=DOUBLE}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_maintain_car - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryMaintenanceCommonContentMapper.xml b/src/com/sipai/mapper/maintenance/LibraryMaintenanceCommonContentMapper.xml deleted file mode 100644 index 45d31f2e..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryMaintenanceCommonContentMapper.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - id, code, contents, tools, security, common_id - - - - delete from tb_library_maintenance_common_content - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_maintenance_common_content (id, code, contents, - tools, security, common_id - ) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, - #{tools,jdbcType=VARCHAR}, #{security,jdbcType=VARCHAR}, #{commonId,jdbcType=VARCHAR} - ) - - - insert into tb_library_maintenance_common_content - - - id, - - - code, - - - contents, - - - tools, - - - security, - - - common_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{tools,jdbcType=VARCHAR}, - - - #{security,jdbcType=VARCHAR}, - - - #{commonId,jdbcType=VARCHAR}, - - - - - update tb_library_maintenance_common_content - - - code = #{code,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - tools = #{tools,jdbcType=VARCHAR}, - - - security = #{security,jdbcType=VARCHAR}, - - - common_id = #{commonId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_maintenance_common_content - set code = #{code,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - tools = #{tools,jdbcType=VARCHAR}, - security = #{security,jdbcType=VARCHAR}, - common_id = #{commonId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_library_maintenance_common_content - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryMaintenanceCommonMapper.xml b/src/com/sipai/mapper/maintenance/LibraryMaintenanceCommonMapper.xml deleted file mode 100644 index 0b720d69..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryMaintenanceCommonMapper.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, code, name, cycle, inside_repair_time, cost, pid, type, unit_id, insdt, insuser, morder - - - - delete from tb_library_maintenance_common - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_maintenance_common (id, code, name, - cycle, inside_repair_time, cost, - pid, type, unit_id, insdt, - insuser, morder) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{cycle,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{cost,jdbcType=DECIMAL}, - #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_library_maintenance_common - - - id, - - - code, - - - name, - - - cycle, - - - inside_repair_time, - - - cost, - - - pid, - - - type, - - - unit_id, - - - insdt, - - - insuser, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{cost,jdbcType=DECIMAL}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_library_maintenance_common - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - cost = #{cost,jdbcType=DECIMAL}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_maintenance_common - set code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - cost = #{cost,jdbcType=DECIMAL}, - pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_library_maintenance_common - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryMaintenanceLubricationMapper.xml b/src/com/sipai/mapper/maintenance/LibraryMaintenanceLubricationMapper.xml deleted file mode 100644 index 88317309..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryMaintenanceLubricationMapper.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, code, name, contents, cycle, standard, unit, model, inside_repair_time, lubricationuId, - cost, pid, unit_id, insdt, insuser, morder - - - - delete from tb_library_maintenance_lubrication - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_maintenance_lubrication (id, code, name, - contents, cycle, standard, - unit, model, inside_repair_time, - lubricationuId, cost, pid, - unit_id, insdt, insuser, - morder) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{contents,jdbcType=VARCHAR}, #{cycle,jdbcType=VARCHAR}, #{standard,jdbcType=DECIMAL}, - #{unit,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, - #{lubricationuid,jdbcType=VARCHAR}, #{cost,jdbcType=DECIMAL}, #{pid,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_library_maintenance_lubrication - - - id, - - - code, - - - name, - - - contents, - - - cycle, - - - standard, - - - unit, - - - model, - - - inside_repair_time, - - - lubricationuId, - - - cost, - - - pid, - - - unit_id, - - - insdt, - - - insuser, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{standard,jdbcType=DECIMAL}, - - - #{unit,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{lubricationuid,jdbcType=VARCHAR}, - - - #{cost,jdbcType=DECIMAL}, - - - #{pid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_library_maintenance_lubrication - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - standard = #{standard,jdbcType=DECIMAL}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - lubricationuId = #{lubricationuid,jdbcType=VARCHAR}, - - - cost = #{cost,jdbcType=DECIMAL}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_maintenance_lubrication - set code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - standard = #{standard,jdbcType=DECIMAL}, - unit = #{unit,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - lubricationuId = #{lubricationuid,jdbcType=VARCHAR}, - cost = #{cost,jdbcType=DECIMAL}, - pid = #{pid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_library_maintenance_lubrication - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryMaterialQuotaMapper.xml b/src/com/sipai/mapper/maintenance/LibraryMaterialQuotaMapper.xml deleted file mode 100644 index 2363c7d8..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryMaterialQuotaMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - id, material_id, material_num, material_cost, total_cost, pid - - - - delete from tb_library_material_quota - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_material_quota (id, material_id, material_num, - material_cost, total_cost, pid - ) - values (#{id,jdbcType=VARCHAR}, #{materialId,jdbcType=VARCHAR}, #{materialNum,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{pid,jdbcType=VARCHAR} - ) - - - insert into tb_library_material_quota - - - id, - - - material_id, - - - material_num, - - - material_cost, - - - total_cost, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{materialId,jdbcType=VARCHAR}, - - - #{materialNum,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_library_material_quota - - - material_id = #{materialId,jdbcType=VARCHAR}, - - - material_num = #{materialNum,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_material_quota - set material_id = #{materialId,jdbcType=VARCHAR}, - material_num = #{materialNum,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_material_quota - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryOverhaulContentBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryOverhaulContentBlocMapper.xml deleted file mode 100644 index dd409d63..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryOverhaulContentBlocMapper.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - id, content_number, repair_content, repair_party_type, inside_repair_time, outside_repair_cost, - material_cost, total_cost, pid, morder - - - - delete from tb_library_overhaul_content_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_overhaul_content_bloc (id, content_number, repair_content, - repair_party_type, inside_repair_time, outside_repair_cost, - material_cost, total_cost, pid, - morder) - values (#{id,jdbcType=VARCHAR}, #{contentNumber,jdbcType=VARCHAR}, #{repairContent,jdbcType=VARCHAR}, - #{repairPartyType,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{pid,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_library_overhaul_content_bloc - - - id, - - - content_number, - - - repair_content, - - - repair_party_type, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - pid, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{contentNumber,jdbcType=VARCHAR}, - - - #{repairContent,jdbcType=VARCHAR}, - - - #{repairPartyType,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_library_overhaul_content_bloc - - - content_number = #{contentNumber,jdbcType=VARCHAR}, - - - repair_content = #{repairContent,jdbcType=VARCHAR}, - - - repair_party_type = #{repairPartyType,jdbcType=VARCHAR}, - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_overhaul_content_bloc - set content_number = #{contentNumber,jdbcType=VARCHAR}, - repair_content = #{repairContent,jdbcType=VARCHAR}, - repair_party_type = #{repairPartyType,jdbcType=VARCHAR}, - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_overhaul_content_bloc - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryOverhaulContentEquBizMapper.xml b/src/com/sipai/mapper/maintenance/LibraryOverhaulContentEquBizMapper.xml deleted file mode 100644 index b45757c2..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryOverhaulContentEquBizMapper.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - id, inside_repair_time, outside_repair_cost, material_cost, total_cost, adjustment_reason, - content_id, equipment_id, unit_id - - - - delete from tb_library_overhaul_content_equ_biz - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_overhaul_content_equ_biz (id, inside_repair_time, outside_repair_cost, - material_cost, total_cost, adjustment_reason, - content_id, equipment_id, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{adjustmentReason,jdbcType=VARCHAR}, - #{contentId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_library_overhaul_content_equ_biz - - - id, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - adjustment_reason, - - - content_id, - - - equipment_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{adjustmentReason,jdbcType=VARCHAR}, - - - #{contentId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_overhaul_content_equ_biz - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - adjustment_reason = #{adjustmentReason,jdbcType=VARCHAR}, - - - content_id = #{contentId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_overhaul_content_equ_biz - set inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - adjustment_reason = #{adjustmentReason,jdbcType=VARCHAR}, - content_id = #{contentId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_overhaul_content_equ_biz - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryOverhaulContentModelBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryOverhaulContentModelBlocMapper.xml deleted file mode 100644 index 3f7c150e..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryOverhaulContentModelBlocMapper.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - id, inside_repair_time, outside_repair_cost, material_cost, total_cost, content_id, - model_id,unit_id - - - - delete from tb_library_overhaul_content_model_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_overhaul_content_model_bloc (id, inside_repair_time, outside_repair_cost, - material_cost, total_cost, content_id, - model_id,unit_id) - values (#{id,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{contentId,jdbcType=VARCHAR}, - #{modelId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_library_overhaul_content_model_bloc - - - id, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - content_id, - - - model_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{contentId,jdbcType=VARCHAR}, - - - #{modelId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_overhaul_content_model_bloc - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - content_id = #{contentId,jdbcType=VARCHAR}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_overhaul_content_model_bloc - set inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - content_id = #{contentId,jdbcType=VARCHAR}, - model_id = #{modelId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_overhaul_content_model_bloc - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectBlocMapper.xml deleted file mode 100644 index 7e5818cc..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectBlocMapper.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, project_number, project_name, condition, cycle, pid, model_id,insdt, insuser, active, morder, unit_id - - - - delete from tb_library_overhaul_project_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_overhaul_project_bloc (id, project_number, project_name, - condition, cycle, pid, model_id, insdt, - insuser, active, morder, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{projectNumber,jdbcType=VARCHAR}, #{projectName,jdbcType=VARCHAR}, - #{condition,jdbcType=VARCHAR}, #{cycle,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{modelId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{unitId,jdbcType=INTEGER} - ) - - - insert into tb_library_overhaul_project_bloc - - - id, - - - project_number, - - - project_name, - - - condition, - - - cycle, - - - pid, - - - model_id, - - - insdt, - - - insuser, - - - active, - - - morder, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{projectNumber,jdbcType=VARCHAR}, - - - #{projectName,jdbcType=VARCHAR}, - - - #{condition,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{modelId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_overhaul_project_bloc - - - project_number = #{projectNumber,jdbcType=VARCHAR}, - - - project_name = #{projectName,jdbcType=VARCHAR}, - - - condition = #{condition,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_overhaul_project_bloc - set project_number = #{projectNumber,jdbcType=VARCHAR}, - project_name = #{projectName,jdbcType=VARCHAR}, - condition = #{condition,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - model_id = #{modelId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_overhaul_project_bloc - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectEquBizMapper.xml b/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectEquBizMapper.xml deleted file mode 100644 index fd4bd1cf..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectEquBizMapper.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - id, inside_repair_time, outside_repair_cost, material_cost, total_cost, project_id, - equipment_id, unit_id - - - - delete from tb_library_overhaul_project_equ_biz - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_overhaul_project_equ_biz (id, inside_repair_time, outside_repair_cost, - material_cost, total_cost, project_id, - equipment_id, unit_id) - values (#{id,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{projectId,jdbcType=VARCHAR}, - #{equipmentId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_library_overhaul_project_equ_biz - - - id, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - project_id, - - - equipment_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{projectId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_overhaul_project_equ_biz - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - project_id = #{projectId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_overhaul_project_equ_biz - set inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - project_id = #{projectId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_overhaul_project_equ_biz - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectModelBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectModelBlocMapper.xml deleted file mode 100644 index 912f3606..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryOverhaulProjectModelBlocMapper.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - id, inside_repair_time, outside_repair_cost, material_cost, total_cost, project_id, - model_id, unit_id - - - - - delete from tb_library_overhaul_project_model_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_overhaul_project_model_bloc (id, inside_repair_time, outside_repair_cost, - material_cost, total_cost, project_id, - model_id, unit_id) - values (#{id,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{projectId,jdbcType=VARCHAR}, - #{modelId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_library_overhaul_project_model_bloc - - - id, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - project_id, - - - model_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{projectId,jdbcType=VARCHAR}, - - - #{modelId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_overhaul_project_model_bloc - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - project_id = #{projectId,jdbcType=VARCHAR}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_overhaul_project_model_bloc - set inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - project_id = #{projectId,jdbcType=VARCHAR}, - model_id = #{modelId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_overhaul_project_model_bloc - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryRepairBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryRepairBlocMapper.xml deleted file mode 100644 index da2c90d2..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryRepairBlocMapper.xml +++ /dev/null @@ -1,284 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, repair_name, repair_number, repair_content, repair_party_type, repair_type, inside_repair_time, - outside_repair_cost, material_cost, total_cost, morder, pid, insdt, insuser - - - - delete from tb_library_repair_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_repair_bloc (id, repair_name, repair_number, - repair_content, repair_party_type, repair_type, - inside_repair_time, outside_repair_cost, material_cost, - total_cost, morder, pid, - insdt, insuser) - values (#{id,jdbcType=VARCHAR}, #{repairName,jdbcType=VARCHAR}, #{repairNumber,jdbcType=VARCHAR}, - #{repairContent,jdbcType=VARCHAR}, #{repairPartyType,jdbcType=VARCHAR}, #{repairType,jdbcType=VARCHAR}, - #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, #{materialCost,jdbcType=DECIMAL}, - #{totalCost,jdbcType=DECIMAL}, #{morder,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}) - - - insert into tb_library_repair_bloc - - - id, - - - repair_name, - - - repair_number, - - - repair_content, - - - repair_party_type, - - - repair_type, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - morder, - - - pid, - - - insdt, - - - insuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{repairName,jdbcType=VARCHAR}, - - - #{repairNumber,jdbcType=VARCHAR}, - - - #{repairContent,jdbcType=VARCHAR}, - - - #{repairPartyType,jdbcType=VARCHAR}, - - - #{repairType,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{morder,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - - update tb_library_repair_bloc - - - repair_name = #{repairName,jdbcType=VARCHAR}, - - - repair_number = #{repairNumber,jdbcType=VARCHAR}, - - - repair_content = #{repairContent,jdbcType=VARCHAR}, - - - repair_party_type = #{repairPartyType,jdbcType=VARCHAR}, - - - repair_type = #{repairType,jdbcType=VARCHAR}, - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - morder = #{morder,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_repair_bloc - set repair_name = #{repairName,jdbcType=VARCHAR}, - repair_number = #{repairNumber,jdbcType=VARCHAR}, - repair_content = #{repairContent,jdbcType=VARCHAR}, - repair_party_type = #{repairPartyType,jdbcType=VARCHAR}, - repair_type = #{repairType,jdbcType=VARCHAR}, - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - morder = #{morder,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_library_repair_bloc - ${where} - - - - - - INSERT INTO tb_library_repair_bloc ( - id, - repair_name, - repair_number, - repair_content, - repair_party_type, - repair_type, - inside_repair_time, - outside_repair_cost, - material_cost, - total_cost, - morder, - pid, - insdt, - insuser - ) - SELECT - id + #{unitId}, - repair_name, - repair_number, - repair_content, - repair_party_type, - repair_type, - inside_repair_time, - outside_repair_cost, - material_cost, - total_cost, - morder, - pid + #{unitId}, - insdt, - insuser - FROM - tb_library_repair_bloc - - - DELETE - t2 - FROM - tb_library_fault_bloc t1 ,tb_library_repair_bloc t2 - WHERE - t1.id = t2.pid - and t1.unit_id = #{unitId} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryRepairEquBizMapper.xml b/src/com/sipai/mapper/maintenance/LibraryRepairEquBizMapper.xml deleted file mode 100644 index 13e4c23e..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryRepairEquBizMapper.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - id, inside_repair_time, outside_repair_cost, material_cost, total_cost, adjustment_reason, - content_id, equipment_id, unit_id - - - - delete from tb_library_repair_equ_biz - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_repair_equ_biz (id, inside_repair_time, outside_repair_cost, - material_cost, total_cost, adjustment_reason, - content_id, equipment_id, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{adjustmentReason,jdbcType=VARCHAR}, - #{contentId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_library_repair_equ_biz - - - id, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - adjustment_reason, - - - content_id, - - - equipment_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{adjustmentReason,jdbcType=VARCHAR}, - - - #{contentId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_repair_equ_biz - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - adjustment_reason = #{adjustmentReason,jdbcType=VARCHAR}, - - - content_id = #{contentId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_repair_equ_biz - set inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - adjustment_reason = #{adjustmentReason,jdbcType=VARCHAR}, - content_id = #{contentId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_repair_equ_biz - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/LibraryRepairModelBlocMapper.xml b/src/com/sipai/mapper/maintenance/LibraryRepairModelBlocMapper.xml deleted file mode 100644 index 094b4afb..00000000 --- a/src/com/sipai/mapper/maintenance/LibraryRepairModelBlocMapper.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - id, inside_repair_time, outside_repair_cost, material_cost, total_cost, content_id, - model_id, unit_id - - - - delete from tb_library_repair_model_bloc - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_repair_model_bloc (id, inside_repair_time, outside_repair_cost, - material_cost, total_cost, content_id, - model_id, unit_id) - values (#{id,jdbcType=VARCHAR}, #{insideRepairTime,jdbcType=DECIMAL}, #{outsideRepairCost,jdbcType=DECIMAL}, - #{materialCost,jdbcType=DECIMAL}, #{totalCost,jdbcType=DECIMAL}, #{contentId,jdbcType=VARCHAR}, - #{modelId,jdbcType=VARCHAR},#{unitId,jdbcType=VARCHAR}) - - - insert into tb_library_repair_model_bloc - - - id, - - - inside_repair_time, - - - outside_repair_cost, - - - material_cost, - - - total_cost, - - - content_id, - - - model_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insideRepairTime,jdbcType=DECIMAL}, - - - #{outsideRepairCost,jdbcType=DECIMAL}, - - - #{materialCost,jdbcType=DECIMAL}, - - - #{totalCost,jdbcType=DECIMAL}, - - - #{contentId,jdbcType=VARCHAR}, - - - #{modelId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_repair_model_bloc - - - inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - - - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - - - material_cost = #{materialCost,jdbcType=DECIMAL}, - - - total_cost = #{totalCost,jdbcType=DECIMAL}, - - - content_id = #{contentId,jdbcType=VARCHAR}, - - - model_id = #{modelId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_repair_model_bloc - set inside_repair_time = #{insideRepairTime,jdbcType=DECIMAL}, - outside_repair_cost = #{outsideRepairCost,jdbcType=DECIMAL}, - material_cost = #{materialCost,jdbcType=DECIMAL}, - total_cost = #{totalCost,jdbcType=DECIMAL}, - content_id = #{contentId,jdbcType=VARCHAR}, - model_id = #{modelId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_repair_model_bloc - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainCarMapper.xml b/src/com/sipai/mapper/maintenance/MaintainCarMapper.xml deleted file mode 100644 index afca8e06..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainCarMapper.xml +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, detail_number, maintain_work_unit_name, solver, car_number, maintain_car_id, - last_maintain_time, odograph, maintain_reason, actual_money, actual_working_hours, - memo, quality_opinion, cal_working_hours, final_working_hours, unit_id, insdt, insuser, - upsdt, upsuser, status, maintain_car_detail_id, processDefId, processId - - - - delete from tb_maintenance_maintain_car - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintain_car (id, detail_number, maintain_work_unit_name, - solver, car_number, maintain_car_id, - last_maintain_time, odograph, maintain_reason, - actual_money, actual_working_hours, memo, - quality_opinion, cal_working_hours, final_working_hours, - unit_id, insdt, insuser, - upsdt, upsuser, status, maintain_car_detail_id, processDefId, processId) - values (#{id,jdbcType=VARCHAR}, #{detailNumber,jdbcType=VARCHAR}, #{maintainWorkUnitName,jdbcType=VARCHAR}, - #{solver,jdbcType=VARCHAR}, #{carNumber,jdbcType=VARCHAR}, #{maintainCarId,jdbcType=VARCHAR}, - #{lastMaintainTime,jdbcType=TIMESTAMP}, #{odograph,jdbcType=INTEGER}, #{maintainReason,jdbcType=VARCHAR}, - #{actualMoney,jdbcType=DECIMAL}, #{actualWorkingHours,jdbcType=DOUBLE}, #{memo,jdbcType=VARCHAR}, - #{qualityOpinion,jdbcType=VARCHAR}, #{calWorkingHours,jdbcType=DOUBLE}, #{finalWorkingHours,jdbcType=DOUBLE}, - #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{maintainCarDetailId,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}) - - - insert into tb_maintenance_maintain_car - - - id, - - - detail_number, - - - maintain_work_unit_name, - - - solver, - - - car_number, - - - maintain_car_id, - - - last_maintain_time, - - - odograph, - - - maintain_reason, - - - actual_money, - - - actual_working_hours, - - - memo, - - - quality_opinion, - - - cal_working_hours, - - - final_working_hours, - - - unit_id, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - status, - - - maintain_car_detail_id, - - - processDefId, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{detailNumber,jdbcType=VARCHAR}, - - - #{maintainWorkUnitName,jdbcType=VARCHAR}, - - - #{solver,jdbcType=VARCHAR}, - - - #{carNumber,jdbcType=VARCHAR}, - - - #{maintainCarId,jdbcType=VARCHAR}, - - - #{lastMaintainTime,jdbcType=TIMESTAMP}, - - - #{odograph,jdbcType=INTEGER}, - - - #{maintainReason,jdbcType=VARCHAR}, - - - #{actualMoney,jdbcType=DECIMAL}, - - - #{actualWorkingHours,jdbcType=DOUBLE}, - - - #{memo,jdbcType=VARCHAR}, - - - #{qualityOpinion,jdbcType=VARCHAR}, - - - #{calWorkingHours,jdbcType=DOUBLE}, - - - #{finalWorkingHours,jdbcType=DOUBLE}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{maintainCarDetailId,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintain_car - - - detail_number = #{detailNumber,jdbcType=VARCHAR}, - - - maintain_work_unit_name = #{maintainWorkUnitName,jdbcType=VARCHAR}, - - - solver = #{solver,jdbcType=VARCHAR}, - - - car_number = #{carNumber,jdbcType=VARCHAR}, - - - maintain_car_id = #{maintainCarId,jdbcType=VARCHAR}, - - - last_maintain_time = #{lastMaintainTime,jdbcType=TIMESTAMP}, - - - odograph = #{odograph,jdbcType=INTEGER}, - - - maintain_reason = #{maintainReason,jdbcType=VARCHAR}, - - - actual_money = #{actualMoney,jdbcType=DECIMAL}, - - - actual_working_hours = #{actualWorkingHours,jdbcType=DOUBLE}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - quality_opinion = #{qualityOpinion,jdbcType=VARCHAR}, - - - cal_working_hours = #{calWorkingHours,jdbcType=DOUBLE}, - - - final_working_hours = #{finalWorkingHours,jdbcType=DOUBLE}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - maintain_car_detail_id = #{maintainCarDetailId,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintain_car - set detail_number = #{detailNumber,jdbcType=VARCHAR}, - maintain_work_unit_name = #{maintainWorkUnitName,jdbcType=VARCHAR}, - solver = #{solver,jdbcType=VARCHAR}, - car_number = #{carNumber,jdbcType=VARCHAR}, - maintain_car_id = #{maintainCarId,jdbcType=VARCHAR}, - last_maintain_time = #{lastMaintainTime,jdbcType=TIMESTAMP}, - odograph = #{odograph,jdbcType=INTEGER}, - maintain_reason = #{maintainReason,jdbcType=VARCHAR}, - actual_money = #{actualMoney,jdbcType=DECIMAL}, - actual_working_hours = #{actualWorkingHours,jdbcType=DOUBLE}, - memo = #{memo,jdbcType=VARCHAR}, - quality_opinion = #{qualityOpinion,jdbcType=VARCHAR}, - cal_working_hours = #{calWorkingHours,jdbcType=DOUBLE}, - final_working_hours = #{finalWorkingHours,jdbcType=DOUBLE}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - maintain_car_detail_id = #{maintainCarDetailId,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_maintain_car - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainMapper.xml b/src/com/sipai/mapper/maintenance/MaintainMapper.xml deleted file mode 100644 index db5f15f1..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainMapper.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, job_number, complete_date, cycle, receive_user_id, receive_user_ids, - plan_date, plan_type, maintain_type, equipment_id, unit_id, processDefId, processId - - - - delete from tb_maintenance_maintain - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintain (id, insdt, insuser, - job_number, complete_date, cycle, - receive_user_id, receive_user_ids, plan_date, - plan_type, maintain_type, equipment_id, - unit_id, processDefId, processId - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{jobNumber,jdbcType=VARCHAR}, #{completeDate,jdbcType=TIMESTAMP}, #{cycle,jdbcType=VARCHAR}, - #{receiveUserId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, #{planDate,jdbcType=TIMESTAMP}, - #{planType,jdbcType=VARCHAR}, #{maintainType,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_maintain - - - id, - - - insdt, - - - insuser, - - - job_number, - - - complete_date, - - - cycle, - - - receive_user_id, - - - receive_user_ids, - - - plan_date, - - - plan_type, - - - maintain_type, - - - equipment_id, - - - unit_id, - - - processDefId, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{completeDate,jdbcType=TIMESTAMP}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{planType,jdbcType=VARCHAR}, - - - #{maintainType,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintain - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - complete_date = #{completeDate,jdbcType=TIMESTAMP}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - plan_type = #{planType,jdbcType=VARCHAR}, - - - maintain_type = #{maintainType,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintain - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - complete_date = #{completeDate,jdbcType=TIMESTAMP}, - cycle = #{cycle,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - plan_type = #{planType,jdbcType=VARCHAR}, - maintain_type = #{maintainType,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_maintenance_maintain - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainPlanMapper.xml b/src/com/sipai/mapper/maintenance/MaintainPlanMapper.xml deleted file mode 100644 index 48bff0c3..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainPlanMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, maintainerId, companyId, sdt, edt, type, maintainContent - - - - delete from tb_maintenance_maintain_plan - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintain_plan (id, insdt, insuser, - maintainerId, companyId, sdt, - edt, type, maintainContent - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{maintainerid,jdbcType=VARCHAR}, #{companyid,jdbcType=VARCHAR}, #{sdt,jdbcType=TIMESTAMP}, - #{edt,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{maintaincontent,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_maintain_plan - - - id, - - - insdt, - - - insuser, - - - maintainerId, - - - companyId, - - - sdt, - - - edt, - - - type, - - - maintainContent, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{maintainerid,jdbcType=VARCHAR}, - - - #{companyid,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{maintaincontent,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintain_plan - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - maintainerId = #{maintainerid,jdbcType=VARCHAR}, - - - companyId = #{companyid,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - maintainContent = #{maintaincontent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintain_plan - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - maintainerId = #{maintainerid,jdbcType=VARCHAR}, - companyId = #{companyid,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - maintainContent = #{maintaincontent,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance_maintain_plan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainerCompanyMapper.xml b/src/com/sipai/mapper/maintenance/MaintainerCompanyMapper.xml deleted file mode 100644 index 00e6f5c5..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainerCompanyMapper.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, maintainerid, companyid ,startdate, enddate, maintainerleader, factorycontacter - - - - delete from tb_maintenance_maintainer_company - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintainer_company (id, insdt, insuser, - maintainerid, companyid, startdate, enddate, maintainerleader, factorycontacter) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{maintainerid,jdbcType=VARCHAR}, #{companyid,jdbcType=VARCHAR}, #{startdate,jdbcType=TIMESTAMP}, - #{enddate,jdbcType=TIMESTAMP}, #{maintainerleader,jdbcType=VARCHAR}, #{factorycontacter,jdbcType=VARCHAR}) - - - insert into tb_maintenance_maintainer_company - - - id, - - - insdt, - - - insuser, - - - maintainerid, - - - companyid, - - - startdate, - - - enddate, - - - maintainerleader, - - - factorycontacter, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{maintainerid,jdbcType=VARCHAR}, - - - #{companyid,jdbcType=VARCHAR}, - - - #{startdate,jdbcType=TIMESTAMP}, - - - #{enddate,jdbcType=TIMESTAMP}, - - - #{maintainerleader,jdbcType=VARCHAR}, - - - #{factorycontacter,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintainer_company - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - maintainerid = #{maintainerid,jdbcType=VARCHAR}, - - - companyid = #{companyid,jdbcType=VARCHAR}, - - - startdate = #{startdate,jdbcType=TIMESTAMP}, - - - enddate = #{enddate,jdbcType=TIMESTAMP}, - - - maintainerleader = #{maintainerleader,jdbcType=VARCHAR}, - - - factorycontacter = #{factorycontacter,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintainer_company - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - maintainerid = #{maintainerid,jdbcType=VARCHAR}, - companyid = #{companyid,jdbcType=VARCHAR}, - startdate = #{startdate,jdbcType=TIMESTAMP}, - enddate = #{enddate,jdbcType=TIMESTAMP}, - maintainerleader = #{maintainerleader,jdbcType=VARCHAR}, - factorycontacter = #{factorycontacter,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance_maintainer_company - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainerMapper.xml b/src/com/sipai/mapper/maintenance/MaintainerMapper.xml deleted file mode 100644 index e0df4645..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainerMapper.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, type, full_name, short_name, address, fax, contacts_name, contacts_mobilephone, - telephone, remark, pid, active, morder, syncflag - - - - delete from tb_maintenance_maintainer - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintainer (id, insdt, insuser, - type, full_name, short_name, - address, fax, contacts_name, - contacts_mobilephone, telephone, remark, - pid, active, morder, - syncflag) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, #{shortName,jdbcType=VARCHAR}, - #{address,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{contactsName,jdbcType=VARCHAR}, - #{contactsMobilephone,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{syncflag,jdbcType=VARCHAR}) - - - insert into tb_maintenance_maintainer - - - id, - - - insdt, - - - insuser, - - - type, - - - full_name, - - - short_name, - - - address, - - - fax, - - - contacts_name, - - - contacts_mobilephone, - - - telephone, - - - remark, - - - pid, - - - active, - - - morder, - - - syncflag, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{fullName,jdbcType=VARCHAR}, - - - #{shortName,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{fax,jdbcType=VARCHAR}, - - - #{contactsName,jdbcType=VARCHAR}, - - - #{contactsMobilephone,jdbcType=VARCHAR}, - - - #{telephone,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{syncflag,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintainer - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - full_name = #{fullName,jdbcType=VARCHAR}, - - - short_name = #{shortName,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - fax = #{fax,jdbcType=VARCHAR}, - - - contacts_name = #{contactsName,jdbcType=VARCHAR}, - - - contacts_mobilephone = #{contactsMobilephone,jdbcType=VARCHAR}, - - - telephone = #{telephone,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - syncflag = #{syncflag,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintainer - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - full_name = #{fullName,jdbcType=VARCHAR}, - short_name = #{shortName,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - fax = #{fax,jdbcType=VARCHAR}, - contacts_name = #{contactsName,jdbcType=VARCHAR}, - contacts_mobilephone = #{contactsMobilephone,jdbcType=VARCHAR}, - telephone = #{telephone,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - syncflag = #{syncflag,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_maintenance_maintainer - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainerSelectTypeMapper.xml b/src/com/sipai/mapper/maintenance/MaintainerSelectTypeMapper.xml deleted file mode 100644 index 937ce93f..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainerSelectTypeMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, maintainer_typeid, maintainerid - - - - delete from tb_maintenance_maintainer_selecttype - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintainer_selecttype (id, insdt, insuser, - maintainer_typeid, maintainerid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{maintainerTypeid,jdbcType=VARCHAR}, #{maintainerid,jdbcType=VARCHAR}) - - - insert into tb_maintenance_maintainer_selecttype - - - id, - - - insdt, - - - insuser, - - - maintainer_typeid, - - - maintainerid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{maintainerTypeid,jdbcType=VARCHAR}, - - - #{maintainerid,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintainer_selecttype - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - maintainer_typeid = #{maintainerTypeid,jdbcType=VARCHAR}, - - - maintainerid = #{maintainerid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintainer_selecttype - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - maintainer_typeid = #{maintainerTypeid,jdbcType=VARCHAR}, - maintainerid = #{maintainerid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance_maintainer_selecttype - ${where} - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintainerTypeMapper.xml b/src/com/sipai/mapper/maintenance/MaintainerTypeMapper.xml deleted file mode 100644 index 624bb7c0..00000000 --- a/src/com/sipai/mapper/maintenance/MaintainerTypeMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, name, remark - - - - delete from tb_maintenance_maintainer_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_maintainer_type (id, insdt, insuser, - name, remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}) - - - insert into tb_maintenance_maintainer_type - - - id, - - - insdt, - - - insuser, - - - name, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_maintenance_maintainer_type - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_maintainer_type - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_maintenance_maintainer_type - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintenanceDetailMapper.xml b/src/com/sipai/mapper/maintenance/MaintenanceDetailMapper.xml deleted file mode 100644 index 226527c8..00000000 --- a/src/com/sipai/mapper/maintenance/MaintenanceDetailMapper.xml +++ /dev/null @@ -1,632 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, detail_number, problemcontent, companyId, equipment_id, contactIds, - plannedEnddt, maintenanceId, maintainPlanId, maintenance_man, problemtypeId, status, - plan_money, actual_money, submitTime, defect_level, start_date, actual_finish_date, - process_section_id, maintenance_way, plan_consume_time, delay_reason, change_parts, - solveTime, solver, assistantedId, problemresult, processDefId, processId, maintainerId, - type, judgemaintainerstaff, judgeresult,equipment_opinion ,base_opinion ,product_opinion, - middle_opinion, quality_opinion, material_opinion, manual_input_equipment,workinghours,plan_id,abnormity_id - - - - delete from tb_maintenance_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_detail (id, insdt, insuser, - detail_number, problemcontent, companyId, - equipment_id, contactIds, plannedEnddt, - maintenanceId, maintainPlanId, maintenance_man, - problemtypeId, status, plan_money, - actual_money, submitTime, defect_level, - start_date, actual_finish_date, process_section_id, - maintenance_way, plan_consume_time, delay_reason, - change_parts, solveTime, solver, - assistantedId, problemresult, processDefId, - processId, maintainerId, type, - judgemaintainerstaff, judgeresult, equipment_opinion ,base_opinion ,product_opinion, - middle_opinion, quality_opinion, material_opinion, manual_input_equipment, workinghours,plan_id,abnormity_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{detailNumber,jdbcType=VARCHAR}, #{problemcontent,jdbcType=VARCHAR}, #{companyid,jdbcType=VARCHAR}, - #{equipmentId,jdbcType=VARCHAR}, #{contactids,jdbcType=VARCHAR}, #{plannedenddt,jdbcType=TIMESTAMP}, - #{maintenanceid,jdbcType=VARCHAR}, #{maintainplanid,jdbcType=VARCHAR}, #{maintenanceMan,jdbcType=VARCHAR}, - #{problemtypeid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{planMoney,jdbcType=DECIMAL}, - #{actualMoney,jdbcType=DECIMAL}, #{submittime,jdbcType=TIMESTAMP}, #{defectLevel,jdbcType=VARCHAR}, - #{startDate,jdbcType=TIMESTAMP}, #{actualFinishDate,jdbcType=TIMESTAMP}, #{processSectionId,jdbcType=VARCHAR}, - #{maintenanceWay,jdbcType=VARCHAR}, #{planConsumeTime,jdbcType=INTEGER}, #{delayReason,jdbcType=VARCHAR}, - #{changeParts,jdbcType=VARCHAR}, #{solvetime,jdbcType=TIMESTAMP}, #{solver,jdbcType=VARCHAR}, - #{assistantedid,jdbcType=VARCHAR}, #{problemresult,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}, #{maintainerid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{judgemaintainerstaff,jdbcType=INTEGER}, #{judgeresult,jdbcType=INTEGER}, #{equipmentOpinion,jdbcType=VARCHAR}, - #{baseOpinion,jdbcType=VARCHAR}, #{productOpinion,jdbcType=VARCHAR}, #{middleOpinion,jdbcType=VARCHAR}, - #{qualityOpinion,jdbcType=VARCHAR},#{materialOpinion,jdbcType=VARCHAR},#{manualInputEquipment,jdbcType=VARCHAR}, - #{workinghours,jdbcType=DECIMAL},#{plan_id,jdbcType=VARCHAR},#{abnormityId,jdbcType=VARCHAR}) - - - insert into tb_maintenance_detail - - - id, - - - insdt, - - - insuser, - - - detail_number, - - - problemcontent, - - - companyId, - - - equipment_id, - - - contactIds, - - - plannedEnddt, - - - maintenanceId, - - - maintainPlanId, - - - maintenance_man, - - - problemtypeId, - - - status, - - - plan_money, - - - actual_money, - - - submitTime, - - - defect_level, - - - start_date, - - - actual_finish_date, - - - process_section_id, - - - maintenance_way, - - - plan_consume_time, - - - delay_reason, - - - change_parts, - - - solveTime, - - - solver, - - - assistantedId, - - - problemresult, - - - processDefId, - - - processId, - - - maintainerId, - - - type, - - - judgemaintainerstaff, - - - judgeresult, - - - equipment_opinion, - - - base_opinion, - - - product_opinion, - - - middle_opinion, - - - quality_opinion, - - - material_opinion, - - - manual_input_equipment, - - - workinghours, - - - plan_id, - - - abnormity_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{detailNumber,jdbcType=VARCHAR}, - - - #{problemcontent,jdbcType=VARCHAR}, - - - #{companyid,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{contactids,jdbcType=VARCHAR}, - - - #{plannedenddt,jdbcType=TIMESTAMP}, - - - #{maintenanceid,jdbcType=VARCHAR}, - - - #{maintainplanid,jdbcType=VARCHAR}, - - - #{maintenanceMan,jdbcType=VARCHAR}, - - - #{problemtypeid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{planMoney,jdbcType=DECIMAL}, - - - #{actualMoney,jdbcType=DECIMAL}, - - - #{submittime,jdbcType=TIMESTAMP}, - - - #{defectLevel,jdbcType=VARCHAR}, - - - #{startDate,jdbcType=TIMESTAMP}, - - - #{actualFinishDate,jdbcType=TIMESTAMP}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{maintenanceWay,jdbcType=VARCHAR}, - - - #{planConsumeTime,jdbcType=INTEGER}, - - - #{delayReason,jdbcType=VARCHAR}, - - - #{changeParts,jdbcType=VARCHAR}, - - - #{solvetime,jdbcType=TIMESTAMP}, - - - #{solver,jdbcType=VARCHAR}, - - - #{assistantedid,jdbcType=VARCHAR}, - - - #{problemresult,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{maintainerid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{judgemaintainerstaff,jdbcType=INTEGER}, - - - #{judgeresult,jdbcType=INTEGER}, - - - #{equipmentOpinion,jdbcType=VARCHAR}, - - - #{baseOpinion,jdbcType=VARCHAR}, - - - #{productOpinion,jdbcType=VARCHAR}, - - - #{middleOpinion,jdbcType=VARCHAR}, - - - #{qualityOpinion,jdbcType=VARCHAR}, - - - #{materialOpinion,jdbcType=VARCHAR}, - - - #{manualInputEquipment,jdbcType=VARCHAR}, - - - #{workinghours,jdbcType=DECIMAL}, - - - #{plan_id,jdbcType=VARCHAR}, - - - #{abnormityId,jdbcType=VARCHAR}, - - - - - update tb_maintenance_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - detail_number = #{detailNumber,jdbcType=VARCHAR}, - - - problemcontent = #{problemcontent,jdbcType=VARCHAR}, - - - companyId = #{companyid,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - contactIds = #{contactids,jdbcType=VARCHAR}, - - - plannedEnddt = #{plannedenddt,jdbcType=TIMESTAMP}, - - - maintenanceId = #{maintenanceid,jdbcType=VARCHAR}, - - - maintainPlanId = #{maintainplanid,jdbcType=VARCHAR}, - - - maintenance_man = #{maintenanceMan,jdbcType=VARCHAR}, - - - problemtypeId = #{problemtypeid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - plan_money = #{planMoney,jdbcType=DECIMAL}, - - - actual_money = #{actualMoney,jdbcType=DECIMAL}, - - - submitTime = #{submittime,jdbcType=TIMESTAMP}, - - - defect_level = #{defectLevel,jdbcType=VARCHAR}, - - - start_date = #{startDate,jdbcType=TIMESTAMP}, - - - actual_finish_date = #{actualFinishDate,jdbcType=TIMESTAMP}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - maintenance_way = #{maintenanceWay,jdbcType=VARCHAR}, - - - plan_consume_time = #{planConsumeTime,jdbcType=INTEGER}, - - - delay_reason = #{delayReason,jdbcType=VARCHAR}, - - - change_parts = #{changeParts,jdbcType=VARCHAR}, - - - solveTime = #{solvetime,jdbcType=TIMESTAMP}, - - - solver = #{solver,jdbcType=VARCHAR}, - - - assistantedId = #{assistantedid,jdbcType=VARCHAR}, - - - problemresult = #{problemresult,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - maintainerId = #{maintainerid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - judgemaintainerstaff = #{judgemaintainerstaff,jdbcType=INTEGER}, - - - judgeresult = #{judgeresult,jdbcType=INTEGER}, - - - equipment_opinion = #{equipmentOpinion,jdbcType=VARCHAR}, - - - base_opinion = #{baseOpinion,jdbcType=VARCHAR}, - - - product_opinion = #{productOpinion,jdbcType=VARCHAR}, - - - middle_opinion = #{middleOpinion,jdbcType=VARCHAR}, - - - quality_opinion = #{qualityOpinion,jdbcType=VARCHAR}, - - - material_opinion = #{materialOpinion,jdbcType=VARCHAR}, - - - manual_input_equipment = #{manualInputEquipment,jdbcType=VARCHAR}, - - - workinghours = #{workinghours,jdbcType=DECIMAL}, - - - plan_id = #{plan_id,jdbcType=VARCHAR}, - - - abnormity_id = #{abnormityId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - detail_number = #{detailNumber,jdbcType=VARCHAR}, - problemcontent = #{problemcontent,jdbcType=VARCHAR}, - companyId = #{companyid,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - contactIds = #{contactids,jdbcType=VARCHAR}, - plannedEnddt = #{plannedenddt,jdbcType=TIMESTAMP}, - maintenanceId = #{maintenanceid,jdbcType=VARCHAR}, - maintainPlanId = #{maintainplanid,jdbcType=VARCHAR}, - maintenance_man = #{maintenanceMan,jdbcType=VARCHAR}, - problemtypeId = #{problemtypeid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - plan_money = #{planMoney,jdbcType=DECIMAL}, - actual_money = #{actualMoney,jdbcType=DECIMAL}, - submitTime = #{submittime,jdbcType=TIMESTAMP}, - defect_level = #{defectLevel,jdbcType=VARCHAR}, - start_date = #{startDate,jdbcType=TIMESTAMP}, - actual_finish_date = #{actualFinishDate,jdbcType=TIMESTAMP}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - maintenance_way = #{maintenanceWay,jdbcType=VARCHAR}, - plan_consume_time = #{planConsumeTime,jdbcType=INTEGER}, - delay_reason = #{delayReason,jdbcType=VARCHAR}, - change_parts = #{changeParts,jdbcType=VARCHAR}, - solveTime = #{solvetime,jdbcType=TIMESTAMP}, - solver = #{solver,jdbcType=VARCHAR}, - assistantedId = #{assistantedid,jdbcType=VARCHAR}, - problemresult = #{problemresult,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - maintainerId = #{maintainerid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - judgemaintainerstaff = #{judgemaintainerstaff,jdbcType=INTEGER}, - judgeresult = #{judgeresult,jdbcType=INTEGER}, - equipment_opinion = #{equipmentOpinion,jdbcType=VARCHAR}, - base_opinion = #{baseOpinion,jdbcType=VARCHAR}, - product_opinion = #{productOpinion,jdbcType=VARCHAR}, - middle_opinion = #{middleOpinion,jdbcType=VARCHAR}, - quality_opinion = #{qualityOpinion,jdbcType=VARCHAR}, - material_opinion = #{materialOpinion,jdbcType=VARCHAR}, - manual_input_equipment = #{manualInputEquipment,jdbcType=VARCHAR}, - workinghours = #{workinghours,jdbcType=DECIMAL}, - abnormity_id = #{abnormityId,jdbcType=VARCHAR}, - plan_id = #{plan_id,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - delete from - tb_maintenance_detail - ${where} - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintenanceEquipmentConfigMapper.xml b/src/com/sipai/mapper/maintenance/MaintenanceEquipmentConfigMapper.xml deleted file mode 100644 index ddd66227..00000000 --- a/src/com/sipai/mapper/maintenance/MaintenanceEquipmentConfigMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, contents, cycle, remark, equipment_id, last_time, title, mainType - - - - delete from tb_maintenance_equipment_config - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_equipment_config (id, contents, cycle, - remark, equipment_id, last_time, title, mainType - ) - values (#{id,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, #{cycle,jdbcType=INTEGER}, - #{remark,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{lastTime,jdbcType=TIMESTAMP}, - #{title,jdbcType=VARCHAR}, #{mainType,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_equipment_config - - - id, - - - contents, - - - cycle, - - - remark, - - - equipment_id, - - - last_time, - - - title, - - - mainType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=INTEGER}, - - - #{remark,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{lastTime,jdbcType=TIMESTAMP}, - - - #{title,jdbcType=VARCHAR}, - - - #{mainType,jdbcType=VARCHAR}, - - - - - update tb_maintenance_equipment_config - - - contents = #{contents,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=INTEGER}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - last_time = #{lastTime,jdbcType=TIMESTAMP}, - - - title = #{title,jdbcType=VARCHAR}, - - - mainType = #{mainType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_equipment_config - set contents = #{contents,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - last_time = #{lastTime,jdbcType=TIMESTAMP}, - title = #{title,jdbcType=VARCHAR}, - mainType = #{mainType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_equipment_config - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintenanceEquipmentMapper.xml b/src/com/sipai/mapper/maintenance/MaintenanceEquipmentMapper.xml deleted file mode 100644 index ed451194..00000000 --- a/src/com/sipai/mapper/maintenance/MaintenanceEquipmentMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insuser, insdt, maintenanceId, equipmentId - - - - delete from tb_maintenance_equipment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_equipment (id, insuser, insdt, - maintenanceId, equipmentId) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{maintenanceid,jdbcType=VARCHAR}, #{equipmentid,jdbcType=VARCHAR}) - - - insert into tb_maintenance_equipment - - - id, - - - insuser, - - - insdt, - - - maintenanceId, - - - equipmentId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{maintenanceid,jdbcType=VARCHAR}, - - - #{equipmentid,jdbcType=VARCHAR}, - - - - - update tb_maintenance_equipment - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - maintenanceId = #{maintenanceid,jdbcType=VARCHAR}, - - - equipmentId = #{equipmentid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_equipment - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - maintenanceId = #{maintenanceid,jdbcType=VARCHAR}, - equipmentId = #{equipmentid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance_equipment - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintenanceFileMapper.xml b/src/com/sipai/mapper/maintenance/MaintenanceFileMapper.xml deleted file mode 100644 index 6f878fdc..00000000 --- a/src/com/sipai/mapper/maintenance/MaintenanceFileMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, masterid, filename, abspath, insdt, insuser, filepath, type, size - - - - delete from tb_maintenance_file - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_file (id, masterid, filename, - abspath, insdt, insuser, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - insdt, - - - insuser, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update tb_maintenance_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_doc_file - where masterid = #{masterid,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintenanceMapper.xml b/src/com/sipai/mapper/maintenance/MaintenanceMapper.xml deleted file mode 100644 index b199388f..00000000 --- a/src/com/sipai/mapper/maintenance/MaintenanceMapper.xml +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, problem, companyid, expectenddt, applicantId, confirmdt, submitProblemDt, - maintenanceMethod, maintenanceDt, type, status, cancelReason, maintainerTypeId, maintainerId, - managerId, maintainerConfirmDt, contractNo, maintainerFinishiDt, result, enddt, remark, - judgemaintainer, judgemaintainerstaff, judgeresult, processId - - - - delete from tb_maintenance - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance (id, insuser, insdt, - problem, companyid, expectenddt, - applicantId, confirmdt, submitProblemDt, - maintenanceMethod, maintenanceDt, type, - status, cancelReason, maintainerTypeId, - maintainerId, managerId, maintainerConfirmDt, - contractNo, maintainerFinishiDt, result, - enddt, remark, judgemaintainer, - judgemaintainerstaff, judgeresult, processId - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{problem,jdbcType=VARCHAR}, #{companyid,jdbcType=VARCHAR}, #{expectenddt,jdbcType=TIMESTAMP}, - #{applicantid,jdbcType=VARCHAR}, #{confirmdt,jdbcType=TIMESTAMP}, #{submitproblemdt,jdbcType=TIMESTAMP}, - #{maintenancemethod,jdbcType=VARCHAR}, #{maintenancedt,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{cancelreason,jdbcType=VARCHAR}, #{maintainertypeid,jdbcType=VARCHAR}, - #{maintainerid,jdbcType=VARCHAR}, #{managerid,jdbcType=VARCHAR}, #{maintainerconfirmdt,jdbcType=TIMESTAMP}, - #{contractno,jdbcType=VARCHAR}, #{maintainerfinishidt,jdbcType=TIMESTAMP}, #{result,jdbcType=VARCHAR}, - #{enddt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{judgemaintainer,jdbcType=INTEGER}, - #{judgemaintainerstaff,jdbcType=INTEGER}, #{judgeresult,jdbcType=INTEGER}, #{processid,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance - - - id, - - - insuser, - - - insdt, - - - problem, - - - companyid, - - - expectenddt, - - - applicantId, - - - confirmdt, - - - submitProblemDt, - - - maintenanceMethod, - - - maintenanceDt, - - - type, - - - status, - - - cancelReason, - - - maintainerTypeId, - - - maintainerId, - - - managerId, - - - maintainerConfirmDt, - - - contractNo, - - - maintainerFinishiDt, - - - result, - - - enddt, - - - remark, - - - judgemaintainer, - - - judgemaintainerstaff, - - - judgeresult, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{problem,jdbcType=VARCHAR}, - - - #{companyid,jdbcType=VARCHAR}, - - - #{expectenddt,jdbcType=TIMESTAMP}, - - - #{applicantid,jdbcType=VARCHAR}, - - - #{confirmdt,jdbcType=TIMESTAMP}, - - - #{submitproblemdt,jdbcType=TIMESTAMP}, - - - #{maintenancemethod,jdbcType=VARCHAR}, - - - #{maintenancedt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{cancelreason,jdbcType=VARCHAR}, - - - #{maintainertypeid,jdbcType=VARCHAR}, - - - #{maintainerid,jdbcType=VARCHAR}, - - - #{managerid,jdbcType=VARCHAR}, - - - #{maintainerconfirmdt,jdbcType=TIMESTAMP}, - - - #{contractno,jdbcType=VARCHAR}, - - - #{maintainerfinishidt,jdbcType=TIMESTAMP}, - - - #{result,jdbcType=VARCHAR}, - - - #{enddt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{judgemaintainer,jdbcType=INTEGER}, - - - #{judgemaintainerstaff,jdbcType=INTEGER}, - - - #{judgeresult,jdbcType=INTEGER}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update tb_maintenance - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - problem = #{problem,jdbcType=VARCHAR}, - - - companyid = #{companyid,jdbcType=VARCHAR}, - - - expectenddt = #{expectenddt,jdbcType=TIMESTAMP}, - - - applicantId = #{applicantid,jdbcType=VARCHAR}, - - - confirmdt = #{confirmdt,jdbcType=TIMESTAMP}, - - - submitProblemDt = #{submitproblemdt,jdbcType=TIMESTAMP}, - - - maintenanceMethod = #{maintenancemethod,jdbcType=VARCHAR}, - - - maintenanceDt = #{maintenancedt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - cancelReason = #{cancelreason,jdbcType=VARCHAR}, - - - maintainerTypeId = #{maintainertypeid,jdbcType=VARCHAR}, - - - maintainerId = #{maintainerid,jdbcType=VARCHAR}, - - - managerId = #{managerid,jdbcType=VARCHAR}, - - - maintainerConfirmDt = #{maintainerconfirmdt,jdbcType=TIMESTAMP}, - - - contractNo = #{contractno,jdbcType=VARCHAR}, - - - maintainerFinishiDt = #{maintainerfinishidt,jdbcType=TIMESTAMP}, - - - result = #{result,jdbcType=VARCHAR}, - - - enddt = #{enddt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - judgemaintainer = #{judgemaintainer,jdbcType=INTEGER}, - - - judgemaintainerstaff = #{judgemaintainerstaff,jdbcType=INTEGER}, - - - judgeresult = #{judgeresult,jdbcType=INTEGER}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - problem = #{problem,jdbcType=VARCHAR}, - companyid = #{companyid,jdbcType=VARCHAR}, - expectenddt = #{expectenddt,jdbcType=TIMESTAMP}, - applicantId = #{applicantid,jdbcType=VARCHAR}, - confirmdt = #{confirmdt,jdbcType=TIMESTAMP}, - submitProblemDt = #{submitproblemdt,jdbcType=TIMESTAMP}, - maintenanceMethod = #{maintenancemethod,jdbcType=VARCHAR}, - maintenanceDt = #{maintenancedt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - cancelReason = #{cancelreason,jdbcType=VARCHAR}, - maintainerTypeId = #{maintainertypeid,jdbcType=VARCHAR}, - maintainerId = #{maintainerid,jdbcType=VARCHAR}, - managerId = #{managerid,jdbcType=VARCHAR}, - maintainerConfirmDt = #{maintainerconfirmdt,jdbcType=TIMESTAMP}, - contractNo = #{contractno,jdbcType=VARCHAR}, - maintainerFinishiDt = #{maintainerfinishidt,jdbcType=TIMESTAMP}, - result = #{result,jdbcType=VARCHAR}, - enddt = #{enddt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - judgemaintainer = #{judgemaintainer,jdbcType=INTEGER}, - judgemaintainerstaff = #{judgemaintainerstaff,jdbcType=INTEGER}, - judgeresult = #{judgeresult,jdbcType=INTEGER}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/MaintenanceRecordMapper.xml b/src/com/sipai/mapper/maintenance/MaintenanceRecordMapper.xml deleted file mode 100644 index 68dc4633..00000000 --- a/src/com/sipai/mapper/maintenance/MaintenanceRecordMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, maintenanceid, unitid, insuser, insdt, record - - - - delete from tb_maintenance_record - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_record (id, maintenanceid, unitid, - insuser, insdt, record - ) - values (#{id,jdbcType=VARCHAR}, #{maintenanceid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{record,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_record - - - id, - - - maintenanceid, - - - unitid, - - - insuser, - - - insdt, - - - record, - - - - - #{id,jdbcType=VARCHAR}, - - - #{maintenanceid,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{record,jdbcType=VARCHAR}, - - - - - update tb_maintenance_record - - - maintenanceid = #{maintenanceid,jdbcType=VARCHAR}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - record = #{record,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_record - set maintenanceid = #{maintenanceid,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - record = #{record,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_maintenance_record - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/PlanRecordAbnormityMapper.xml b/src/com/sipai/mapper/maintenance/PlanRecordAbnormityMapper.xml deleted file mode 100644 index 97a3603d..00000000 --- a/src/com/sipai/mapper/maintenance/PlanRecordAbnormityMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, father_id, son_id - - - - delete from tb_plan_record_abnormity - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_plan_record_abnormity (id, insdt, insuser, - father_id, son_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{fatherId,jdbcType=VARCHAR}, #{sonId,jdbcType=VARCHAR}) - - - insert into tb_plan_record_abnormity - - - id, - - - insdt, - - - insuser, - - - father_id, - - - son_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{fatherId,jdbcType=VARCHAR}, - - - #{sonId,jdbcType=VARCHAR}, - - - - - update tb_plan_record_abnormity - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - father_id = #{fatherId,jdbcType=VARCHAR}, - - - son_id = #{sonId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_plan_record_abnormity - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - father_id = #{fatherId,jdbcType=VARCHAR}, - son_id = #{sonId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_plan_record_abnormity - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/RepairCarMapper.xml b/src/com/sipai/mapper/maintenance/RepairCarMapper.xml deleted file mode 100644 index 8bdc5bc9..00000000 --- a/src/com/sipai/mapper/maintenance/RepairCarMapper.xml +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, detail_number, repair_type, maintain_work_unit_name, solver, car_number, maintain_car_id, - insurance_compensation_money, repair_reason, insurance_compensation_situation, actual_repair_money, - exceed_compensation_reason, working_hours, actual_working_hours, memo, quality_opinion, - cal_working_hours, final_working_hours, punish_award_money, unit_id, insdt, insuser, - upsdt, upsuser, status, processDefId, processId - - - - delete from tb_maintenance_repair_car - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_repair_car (id, detail_number, repair_type, - maintain_work_unit_name, solver, car_number, - maintain_car_id, insurance_compensation_money, - repair_reason, insurance_compensation_situation, - actual_repair_money, exceed_compensation_reason, - working_hours, actual_working_hours, memo, - quality_opinion, cal_working_hours, final_working_hours, - punish_award_money, unit_id, insdt, - insuser, upsdt, upsuser, - status, processDefId, processId - ) - values (#{id,jdbcType=VARCHAR}, #{detailNumber,jdbcType=VARCHAR}, #{repairType,jdbcType=VARCHAR}, - #{maintainWorkUnitName,jdbcType=VARCHAR}, #{solver,jdbcType=VARCHAR}, #{carNumber,jdbcType=VARCHAR}, - #{maintainCarId,jdbcType=VARCHAR}, #{insuranceCompensationMoney,jdbcType=DECIMAL}, - #{repairReason,jdbcType=VARCHAR}, #{insuranceCompensationSituation,jdbcType=VARCHAR}, - #{actualRepairMoney,jdbcType=DECIMAL}, #{exceedCompensationReason,jdbcType=VARCHAR}, - #{workingHours,jdbcType=DOUBLE}, #{actualWorkingHours,jdbcType=DOUBLE}, #{memo,jdbcType=VARCHAR}, - #{qualityOpinion,jdbcType=VARCHAR}, #{calWorkingHours,jdbcType=DOUBLE}, #{finalWorkingHours,jdbcType=DOUBLE}, - #{punishAwardMoney,jdbcType=DECIMAL}, #{unitId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_repair_car - - - id, - - - detail_number, - - - repair_type, - - - maintain_work_unit_name, - - - solver, - - - car_number, - - - maintain_car_id, - - - insurance_compensation_money, - - - repair_reason, - - - insurance_compensation_situation, - - - actual_repair_money, - - - exceed_compensation_reason, - - - working_hours, - - - actual_working_hours, - - - memo, - - - quality_opinion, - - - cal_working_hours, - - - final_working_hours, - - - punish_award_money, - - - unit_id, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - status, - - - processDefId, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{detailNumber,jdbcType=VARCHAR}, - - - #{repairType,jdbcType=VARCHAR}, - - - #{maintainWorkUnitName,jdbcType=VARCHAR}, - - - #{solver,jdbcType=VARCHAR}, - - - #{carNumber,jdbcType=VARCHAR}, - - - #{maintainCarId,jdbcType=VARCHAR}, - - - #{insuranceCompensationMoney,jdbcType=DECIMAL}, - - - #{repairReason,jdbcType=VARCHAR}, - - - #{insuranceCompensationSituation,jdbcType=VARCHAR}, - - - #{actualRepairMoney,jdbcType=DECIMAL}, - - - #{exceedCompensationReason,jdbcType=VARCHAR}, - - - #{workingHours,jdbcType=DOUBLE}, - - - #{actualWorkingHours,jdbcType=DOUBLE}, - - - #{memo,jdbcType=VARCHAR}, - - - #{qualityOpinion,jdbcType=VARCHAR}, - - - #{calWorkingHours,jdbcType=DOUBLE}, - - - #{finalWorkingHours,jdbcType=DOUBLE}, - - - #{punishAwardMoney,jdbcType=DECIMAL}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update tb_maintenance_repair_car - - - detail_number = #{detailNumber,jdbcType=VARCHAR}, - - - repair_type = #{repairType,jdbcType=VARCHAR}, - - - maintain_work_unit_name = #{maintainWorkUnitName,jdbcType=VARCHAR}, - - - solver = #{solver,jdbcType=VARCHAR}, - - - car_number = #{carNumber,jdbcType=VARCHAR}, - - - maintain_car_id = #{maintainCarId,jdbcType=VARCHAR}, - - - insurance_compensation_money = #{insuranceCompensationMoney,jdbcType=DECIMAL}, - - - repair_reason = #{repairReason,jdbcType=VARCHAR}, - - - insurance_compensation_situation = #{insuranceCompensationSituation,jdbcType=VARCHAR}, - - - actual_repair_money = #{actualRepairMoney,jdbcType=DECIMAL}, - - - exceed_compensation_reason = #{exceedCompensationReason,jdbcType=VARCHAR}, - - - working_hours = #{workingHours,jdbcType=DOUBLE}, - - - actual_working_hours = #{actualWorkingHours,jdbcType=DOUBLE}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - quality_opinion = #{qualityOpinion,jdbcType=VARCHAR}, - - - cal_working_hours = #{calWorkingHours,jdbcType=DOUBLE}, - - - final_working_hours = #{finalWorkingHours,jdbcType=DOUBLE}, - - - punish_award_money = #{punishAwardMoney,jdbcType=DECIMAL}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_repair_car - set detail_number = #{detailNumber,jdbcType=VARCHAR}, - repair_type = #{repairType,jdbcType=VARCHAR}, - maintain_work_unit_name = #{maintainWorkUnitName,jdbcType=VARCHAR}, - solver = #{solver,jdbcType=VARCHAR}, - car_number = #{carNumber,jdbcType=VARCHAR}, - maintain_car_id = #{maintainCarId,jdbcType=VARCHAR}, - insurance_compensation_money = #{insuranceCompensationMoney,jdbcType=DECIMAL}, - repair_reason = #{repairReason,jdbcType=VARCHAR}, - insurance_compensation_situation = #{insuranceCompensationSituation,jdbcType=VARCHAR}, - actual_repair_money = #{actualRepairMoney,jdbcType=DECIMAL}, - exceed_compensation_reason = #{exceedCompensationReason,jdbcType=VARCHAR}, - working_hours = #{workingHours,jdbcType=DOUBLE}, - actual_working_hours = #{actualWorkingHours,jdbcType=DOUBLE}, - memo = #{memo,jdbcType=VARCHAR}, - quality_opinion = #{qualityOpinion,jdbcType=VARCHAR}, - cal_working_hours = #{calWorkingHours,jdbcType=DOUBLE}, - final_working_hours = #{finalWorkingHours,jdbcType=DOUBLE}, - punish_award_money = #{punishAwardMoney,jdbcType=DECIMAL}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_repair_car - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/RepairMapper.xml b/src/com/sipai/mapper/maintenance/RepairMapper.xml deleted file mode 100644 index 8d416009..00000000 --- a/src/com/sipai/mapper/maintenance/RepairMapper.xml +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, job_number, job_name, plan_type, repair_type, receive_user_id, receive_user_ids, - equipment_id, complete_date, plan_date, outsourcing_st, safeOperation_st, fault_describe, - scheme_description, plan_id, plan_money, process_status, processDefId, processId, - insdt, insuser, unit_id - - - - delete from tb_maintenance_repair - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_repair (id, job_number, job_name, - plan_type, repair_type, receive_user_id, - receive_user_ids, equipment_id, complete_date, - plan_date, outsourcing_st, safeOperation_st, - fault_describe, scheme_description, plan_id, - plan_money, process_status, processDefId, - processId, insdt, insuser, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{jobName,jdbcType=VARCHAR}, - #{planType,jdbcType=VARCHAR}, #{repairType,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, - #{receiveUserIds,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{completeDate,jdbcType=TIMESTAMP}, - #{planDate,jdbcType=TIMESTAMP}, #{outsourcingSt,jdbcType=VARCHAR}, #{safeoperationSt,jdbcType=VARCHAR}, - #{faultDescribe,jdbcType=VARCHAR}, #{schemeDescription,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, - #{planMoney,jdbcType=VARCHAR}, #{processStatus,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_maintenance_repair - - - id, - - - job_number, - - - job_name, - - - plan_type, - - - repair_type, - - - receive_user_id, - - - receive_user_ids, - - - equipment_id, - - - complete_date, - - - plan_date, - - - outsourcing_st, - - - safeOperation_st, - - - fault_describe, - - - scheme_description, - - - plan_id, - - - plan_money, - - - process_status, - - - processDefId, - - - processId, - - - insdt, - - - insuser, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{jobName,jdbcType=VARCHAR}, - - - #{planType,jdbcType=VARCHAR}, - - - #{repairType,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{completeDate,jdbcType=TIMESTAMP}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{outsourcingSt,jdbcType=VARCHAR}, - - - #{safeoperationSt,jdbcType=VARCHAR}, - - - #{faultDescribe,jdbcType=VARCHAR}, - - - #{schemeDescription,jdbcType=VARCHAR}, - - - #{planId,jdbcType=VARCHAR}, - - - #{planMoney,jdbcType=VARCHAR}, - - - #{processStatus,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_maintenance_repair - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - job_name = #{jobName,jdbcType=VARCHAR}, - - - plan_type = #{planType,jdbcType=VARCHAR}, - - - repair_type = #{repairType,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - complete_date = #{completeDate,jdbcType=TIMESTAMP}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - outsourcing_st = #{outsourcingSt,jdbcType=VARCHAR}, - - - safeOperation_st = #{safeoperationSt,jdbcType=VARCHAR}, - - - fault_describe = #{faultDescribe,jdbcType=VARCHAR}, - - - scheme_description = #{schemeDescription,jdbcType=VARCHAR}, - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - plan_money = #{planMoney,jdbcType=VARCHAR}, - - - process_status = #{processStatus,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_repair - set job_number = #{jobNumber,jdbcType=VARCHAR}, - job_name = #{jobName,jdbcType=VARCHAR}, - plan_type = #{planType,jdbcType=VARCHAR}, - repair_type = #{repairType,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - complete_date = #{completeDate,jdbcType=TIMESTAMP}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - outsourcing_st = #{outsourcingSt,jdbcType=VARCHAR}, - safeOperation_st = #{safeoperationSt,jdbcType=VARCHAR}, - fault_describe = #{faultDescribe,jdbcType=VARCHAR}, - scheme_description = #{schemeDescription,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR}, - plan_money = #{planMoney,jdbcType=VARCHAR}, - process_status = #{processStatus,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_repair - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/WorkorderAchievementMapper.xml b/src/com/sipai/mapper/maintenance/WorkorderAchievementMapper.xml deleted file mode 100644 index 8796e46b..00000000 --- a/src/com/sipai/mapper/maintenance/WorkorderAchievementMapper.xml +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - - - - - - - - - - - - - - id - , user_id, participate_content, project_role, work_time, evaluate_score, skill_weight, - actual_work_time, explain, type, pid, table_type - - - - delete - from tb_workorder_achievement - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_workorder_achievement (id, user_id, participate_content, - project_role, work_time, evaluate_score, - skill_weight, actual_work_time, explain, - type, pid, table_type) - values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{participateContent,jdbcType=VARCHAR}, - #{projectRole,jdbcType=VARCHAR}, #{workTime,jdbcType=DECIMAL}, #{evaluateScore,jdbcType=DECIMAL}, - #{skillWeight,jdbcType=DECIMAL}, #{actualWorkTime,jdbcType=DECIMAL}, #{explain,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{tableType,jdbcType=VARCHAR}) - - - insert into tb_workorder_achievement - - - id, - - - user_id, - - - participate_content, - - - project_role, - - - work_time, - - - evaluate_score, - - - skill_weight, - - - actual_work_time, - - - explain, - - - type, - - - pid, - - - table_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{participateContent,jdbcType=VARCHAR}, - - - #{projectRole,jdbcType=VARCHAR}, - - - #{workTime,jdbcType=DECIMAL}, - - - #{evaluateScore,jdbcType=DECIMAL}, - - - #{skillWeight,jdbcType=DECIMAL}, - - - #{actualWorkTime,jdbcType=DECIMAL}, - - - #{explain,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{tableType,jdbcType=DECIMAL}, - - - - - update tb_workorder_achievement - - - user_id = #{userId,jdbcType=VARCHAR}, - - - participate_content = #{participateContent,jdbcType=VARCHAR}, - - - project_role = #{projectRole,jdbcType=VARCHAR}, - - - work_time = #{workTime,jdbcType=DECIMAL}, - - - evaluate_score = #{evaluateScore,jdbcType=DECIMAL}, - - - skill_weight = #{skillWeight,jdbcType=DECIMAL}, - - - actual_work_time = #{actualWorkTime,jdbcType=DECIMAL}, - - - explain = #{explain,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - table_type = #{tableType,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_workorder_achievement - set user_id = #{userId,jdbcType=VARCHAR}, - participate_content = #{participateContent,jdbcType=VARCHAR}, - project_role = #{projectRole,jdbcType=VARCHAR}, - work_time = #{workTime,jdbcType=DECIMAL}, - evaluate_score = #{evaluateScore,jdbcType=DECIMAL}, - skill_weight = #{skillWeight,jdbcType=DECIMAL}, - actual_work_time = #{actualWorkTime,jdbcType=DECIMAL}, - explain = #{explain,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - table_type = #{tableType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_workorder_achievement ${where} - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/maintenance/WorkorderLibraryMaintainMapper.xml b/src/com/sipai/mapper/maintenance/WorkorderLibraryMaintainMapper.xml deleted file mode 100644 index f07cfcca..00000000 --- a/src/com/sipai/mapper/maintenance/WorkorderLibraryMaintainMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - id, library_id, actual_work_time, differences, type, pid - - - - delete from tb_workorder_library_maintain - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_workorder_library_maintain (id, library_id, actual_work_time, - differences, type, pid - ) - values (#{id,jdbcType=VARCHAR}, #{libraryId,jdbcType=VARCHAR}, #{actualWorkTime,jdbcType=DECIMAL}, - #{differences,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR} - ) - - - insert into tb_workorder_library_maintain - - - id, - - - library_id, - - - actual_work_time, - - - differences, - - - type, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{libraryId,jdbcType=VARCHAR}, - - - #{actualWorkTime,jdbcType=DECIMAL}, - - - #{differences,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_workorder_library_maintain - - - library_id = #{libraryId,jdbcType=VARCHAR}, - - - actual_work_time = #{actualWorkTime,jdbcType=DECIMAL}, - - - differences = #{differences,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_workorder_library_maintain - set library_id = #{libraryId,jdbcType=VARCHAR}, - actual_work_time = #{actualWorkTime,jdbcType=DECIMAL}, - differences = #{differences,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_workorder_library_maintain - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/model/ModelSetValueMapper.xml b/src/com/sipai/mapper/model/ModelSetValueMapper.xml deleted file mode 100644 index 8207d0cb..00000000 --- a/src/com/sipai/mapper/model/ModelSetValueMapper.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, dt, max_val, min_val, control_val, val - - - - id, dt, val - - - - id, dt, max_val, min_val, control_val - - - - - delete from tb_set_pressure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_set_pressure (id, dt, max_val, - min_val, control_val, val - ) - values (#{id,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{maxVal,jdbcType=DOUBLE}, - #{minVal,jdbcType=DOUBLE}, #{controlVal,jdbcType=DOUBLE}, #{val,jdbcType=DOUBLE} - ) - - - insert into tb_set_pressure - - - id, - - - dt, - - - max_val, - - - min_val, - - - control_val, - - - val, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dt,jdbcType=TIMESTAMP}, - - - #{maxVal,jdbcType=DOUBLE}, - - - #{minVal,jdbcType=DOUBLE}, - - - #{controlVal,jdbcType=DOUBLE}, - - - #{val,jdbcType=DOUBLE}, - - - - - update tb_set_pressure - - - dt = #{dt,jdbcType=TIMESTAMP}, - - - max_val = #{maxVal,jdbcType=DOUBLE}, - - - min_val = #{minVal,jdbcType=DOUBLE}, - - - control_val = #{controlVal,jdbcType=DOUBLE}, - - - val = #{val,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_set_pressure - set dt = #{dt,jdbcType=TIMESTAMP}, - max_val = #{maxVal,jdbcType=DOUBLE}, - min_val = #{minVal,jdbcType=DOUBLE}, - control_val = #{controlVal,jdbcType=DOUBLE}, - val = #{val,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/EmppAdminMapper.xml b/src/com/sipai/mapper/msg/EmppAdminMapper.xml deleted file mode 100644 index 95ef69de..00000000 --- a/src/com/sipai/mapper/msg/EmppAdminMapper.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, emppname, host, port, accountId, accname, password, serviceId, insertuserid, - insertdate, updateuserid, updatedate - - - - delete from tb_EMPP_EmppAdmin - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_EMPP_EmppAdmin (id, emppname, host, - port, accountId, accname, - password, serviceId, insertuserid, - insertdate, updateuserid, updatedate - ) - values (#{id,jdbcType=VARCHAR}, #{emppname,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, - #{port,jdbcType=INTEGER}, #{accountid,jdbcType=VARCHAR}, #{accname,jdbcType=VARCHAR}, - #{password,jdbcType=VARCHAR}, #{serviceid,jdbcType=VARCHAR}, #{insertuserid,jdbcType=VARCHAR}, - #{insertdate,jdbcType=TIMESTAMP}, #{updateuserid,jdbcType=VARCHAR}, #{updatedate,jdbcType=TIMESTAMP} - ) - - - insert into tb_EMPP_EmppAdmin - - - id, - - - emppname, - - - host, - - - port, - - - accountId, - - - accname, - - - password, - - - serviceId, - - - insertuserid, - - - insertdate, - - - updateuserid, - - - updatedate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{emppname,jdbcType=VARCHAR}, - - - #{host,jdbcType=VARCHAR}, - - - #{port,jdbcType=INTEGER}, - - - #{accountid,jdbcType=VARCHAR}, - - - #{accname,jdbcType=VARCHAR}, - - - #{password,jdbcType=VARCHAR}, - - - #{serviceid,jdbcType=VARCHAR}, - - - #{insertuserid,jdbcType=VARCHAR}, - - - #{insertdate,jdbcType=TIMESTAMP}, - - - #{updateuserid,jdbcType=VARCHAR}, - - - #{updatedate,jdbcType=TIMESTAMP}, - - - - - update tb_EMPP_EmppAdmin - - - emppname = #{emppname,jdbcType=VARCHAR}, - - - host = #{host,jdbcType=VARCHAR}, - - - port = #{port,jdbcType=INTEGER}, - - - accountId = #{accountid,jdbcType=VARCHAR}, - - - accname = #{accname,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - serviceId = #{serviceid,jdbcType=VARCHAR}, - - - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - - - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - - - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - - - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_EMPP_EmppAdmin - set emppname = #{emppname,jdbcType=VARCHAR}, - host = #{host,jdbcType=VARCHAR}, - port = #{port,jdbcType=INTEGER}, - accountId = #{accountid,jdbcType=VARCHAR}, - accname = #{accname,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - serviceId = #{serviceid,jdbcType=VARCHAR}, - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - updatedate = #{updatedate,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_EMPP_EmppAdmin - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/EmppSendMapper.xml b/src/com/sipai/mapper/msg/EmppSendMapper.xml deleted file mode 100644 index 29ae2fb8..00000000 --- a/src/com/sipai/mapper/msg/EmppSendMapper.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, emppAdminid, senduserid, senddate, insertuserid, insertdate, updateuserid, updatedate,recuserid, recusername, sendtitle - - - - - delete from tb_EMPP_EmppSend - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_EMPP_EmppSend (id, emppAdminid, senduserid, - senddate, insertuserid, insertdate, - updateuserid, updatedate, recuserid, - recusername, sendtitle) - values (#{id,jdbcType=VARCHAR}, #{emppadminid,jdbcType=VARCHAR}, #{senduserid,jdbcType=VARCHAR}, - #{senddate,jdbcType=TIMESTAMP}, #{insertuserid,jdbcType=VARCHAR}, #{insertdate,jdbcType=TIMESTAMP}, - #{updateuserid,jdbcType=VARCHAR}, #{updatedate,jdbcType=TIMESTAMP}, #{recuserid,jdbcType=CLOB}, - #{recusername,jdbcType=CLOB}, #{sendtitle,jdbcType=CLOB}) - - - insert into tb_EMPP_EmppSend - - - id, - - - emppAdminid, - - - senduserid, - - - senddate, - - - insertuserid, - - - insertdate, - - - updateuserid, - - - updatedate, - - - recuserid, - - - recusername, - - - sendtitle, - - - - - #{id,jdbcType=VARCHAR}, - - - #{emppadminid,jdbcType=VARCHAR}, - - - #{senduserid,jdbcType=VARCHAR}, - - - #{senddate,jdbcType=TIMESTAMP}, - - - #{insertuserid,jdbcType=VARCHAR}, - - - #{insertdate,jdbcType=TIMESTAMP}, - - - #{updateuserid,jdbcType=VARCHAR}, - - - #{updatedate,jdbcType=TIMESTAMP}, - - - #{recuserid,jdbcType=CLOB}, - - - #{recusername,jdbcType=CLOB}, - - - #{sendtitle,jdbcType=CLOB}, - - - - - update tb_EMPP_EmppSend - - - emppAdminid = #{emppadminid,jdbcType=VARCHAR}, - - - senduserid = #{senduserid,jdbcType=VARCHAR}, - - - senddate = #{senddate,jdbcType=TIMESTAMP}, - - - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - - - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - - - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - - - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - - - recuserid = #{recuserid,jdbcType=CLOB}, - - - recusername = #{recusername,jdbcType=CLOB}, - - - sendtitle = #{sendtitle,jdbcType=CLOB}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_EMPP_EmppSend - set emppAdminid = #{emppadminid,jdbcType=VARCHAR}, - senduserid = #{senduserid,jdbcType=VARCHAR}, - senddate = #{senddate,jdbcType=TIMESTAMP}, - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - recuserid = #{recuserid,jdbcType=CLOB}, - recusername = #{recusername,jdbcType=CLOB}, - sendtitle = #{sendtitle,jdbcType=CLOB} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_EMPP_EmppSend - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/EmppSendUserMapper.xml b/src/com/sipai/mapper/msg/EmppSendUserMapper.xml deleted file mode 100644 index 1fb53bfc..00000000 --- a/src/com/sipai/mapper/msg/EmppSendUserMapper.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, emppSendid, senduserid, senddate, recuserid, mobile, backdate, insertuserid, - insertdate, updateuserid, updatedate, msgId - - - - delete from tb_EMPP_EmppSendUser - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_EMPP_EmppSendUser (id, emppSendid, senduserid, - senddate, recuserid, mobile, - backdate, insertuserid, insertdate, - updateuserid, updatedate, msgId - ) - values (#{id,jdbcType=VARCHAR}, #{emppsendid,jdbcType=VARCHAR}, #{senduserid,jdbcType=VARCHAR}, - #{senddate,jdbcType=TIMESTAMP}, #{recuserid,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, - #{backdate,jdbcType=TIMESTAMP}, #{insertuserid,jdbcType=VARCHAR}, #{insertdate,jdbcType=TIMESTAMP}, - #{updateuserid,jdbcType=VARCHAR}, #{updatedate,jdbcType=TIMESTAMP}, #{msgid,jdbcType=VARCHAR} - ) - - - insert into tb_EMPP_EmppSendUser - - - id, - - - emppSendid, - - - senduserid, - - - senddate, - - - recuserid, - - - mobile, - - - backdate, - - - insertuserid, - - - insertdate, - - - updateuserid, - - - updatedate, - - - msgId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{emppsendid,jdbcType=VARCHAR}, - - - #{senduserid,jdbcType=VARCHAR}, - - - #{senddate,jdbcType=TIMESTAMP}, - - - #{recuserid,jdbcType=VARCHAR}, - - - #{mobile,jdbcType=VARCHAR}, - - - #{backdate,jdbcType=TIMESTAMP}, - - - #{insertuserid,jdbcType=VARCHAR}, - - - #{insertdate,jdbcType=TIMESTAMP}, - - - #{updateuserid,jdbcType=VARCHAR}, - - - #{updatedate,jdbcType=TIMESTAMP}, - - - #{msgid,jdbcType=VARCHAR}, - - - - - update tb_EMPP_EmppSendUser - - - emppSendid = #{emppsendid,jdbcType=VARCHAR}, - - - senduserid = #{senduserid,jdbcType=VARCHAR}, - - - senddate = #{senddate,jdbcType=TIMESTAMP}, - - - recuserid = #{recuserid,jdbcType=VARCHAR}, - - - mobile = #{mobile,jdbcType=VARCHAR}, - - - backdate = #{backdate,jdbcType=TIMESTAMP}, - - - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - - - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - - - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - - - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - - - msgId = #{msgid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_EMPP_EmppSendUser - set emppSendid = #{emppsendid,jdbcType=VARCHAR}, - senduserid = #{senduserid,jdbcType=VARCHAR}, - senddate = #{senddate,jdbcType=TIMESTAMP}, - recuserid = #{recuserid,jdbcType=VARCHAR}, - mobile = #{mobile,jdbcType=VARCHAR}, - backdate = #{backdate,jdbcType=TIMESTAMP}, - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - msgId = #{msgid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_EMPP_EmppSendUser - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/FrequentContactsMapper.xml b/src/com/sipai/mapper/msg/FrequentContactsMapper.xml deleted file mode 100644 index 82861043..00000000 --- a/src/com/sipai/mapper/msg/FrequentContactsMapper.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - id, user_id, unit_id - - - - delete from tb_Frequent_Contacts - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_Frequent_Contacts (id, user_id, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_Frequent_Contacts - - - id, - - - user_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_Frequent_Contacts - - - user_id = #{userId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_Frequent_Contacts - set user_id = #{userId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_Frequent_Contacts - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/MsgAlarmlevelMapper.xml b/src/com/sipai/mapper/msg/MsgAlarmlevelMapper.xml deleted file mode 100644 index cc4e4ee3..00000000 --- a/src/com/sipai/mapper/msg/MsgAlarmlevelMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, alarm_level, msgsend, smssend, sendway, remark, state, insuser, insdt, msgrole - - - - delete from TB_MESSAGE_TYPE_alarmlevel - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE_TYPE_alarmlevel (id, alarm_level, msgsend, - smssend, sendway, remark, - state, insuser, insdt, - msgrole) - values (#{id,jdbcType=VARCHAR}, #{alarmLevel,jdbcType=VARCHAR}, #{msgsend,jdbcType=VARCHAR}, - #{smssend,jdbcType=VARCHAR}, #{sendway,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{state,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{msgrole,jdbcType=VARCHAR}) - - - insert into TB_MESSAGE_TYPE_alarmlevel - - - id, - - - alarm_level, - - - msgsend, - - - smssend, - - - sendway, - - - remark, - - - state, - - - insuser, - - - insdt, - - - msgrole, - - - - - #{id,jdbcType=VARCHAR}, - - - #{alarmLevel,jdbcType=VARCHAR}, - - - #{msgsend,jdbcType=VARCHAR}, - - - #{smssend,jdbcType=VARCHAR}, - - - #{sendway,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{state,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{msgrole,jdbcType=VARCHAR}, - - - - - update TB_MESSAGE_TYPE_alarmlevel - - - alarm_level = #{alarmLevel,jdbcType=VARCHAR}, - - - msgsend = #{msgsend,jdbcType=VARCHAR}, - - - smssend = #{smssend,jdbcType=VARCHAR}, - - - sendway = #{sendway,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - msgrole = #{msgrole,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE_TYPE_alarmlevel - set alarm_level = #{alarmLevel,jdbcType=VARCHAR}, - msgsend = #{msgsend,jdbcType=VARCHAR}, - smssend = #{smssend,jdbcType=VARCHAR}, - sendway = #{sendway,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - state = #{state,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - msgrole = #{msgrole,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_MESSAGE_TYPE_alarmlevel - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/MsgMapper.xml b/src/com/sipai/mapper/msg/MsgMapper.xml deleted file mode 100644 index 82efa02a..00000000 --- a/src/com/sipai/mapper/msg/MsgMapper.xml +++ /dev/null @@ -1,485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, suserid, sdt, url, readflag, content, backid, typeid, plansdt, plansdate, - sendflag, delflag, alerturl, insuser, insdt, bizid,issms,redflag,sendview - - - - delete from TB_MESSAGE - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE (id, pid, suserid, - sdt, url, readflag, - content, backid, typeid, - plansdt, plansdate, sendflag, - delflag, alerturl, insuser, - insdt, bizid,issms,redflag,sendview) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{suserid,jdbcType=VARCHAR}, - #{sdt,jdbcType=TIMESTAMP}, #{url,jdbcType=VARCHAR}, #{readflag,jdbcType=VARCHAR}, - #{content,jdbcType=VARCHAR}, #{backid,jdbcType=VARCHAR}, #{typeid,jdbcType=VARCHAR}, - #{plansdt,jdbcType=VARCHAR}, #{plansdate,jdbcType=TIMESTAMP}, #{sendflag,jdbcType=VARCHAR}, - #{delflag,jdbcType=VARCHAR}, #{alerturl,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{bizid,jdbcType=VARCHAR}, #{issms,jdbcType=VARCHAR}, - #{redflag,jdbcType=VARCHAR}, #{sendview,jdbcType=VARCHAR}) - - - insert into TB_MESSAGE - - - id, - - - pid, - - - suserid, - - - sdt, - - - url, - - - readflag, - - - content, - - - backid, - - - typeid, - - - plansdt, - - - plansdate, - - - sendflag, - - - delflag, - - - alerturl, - - - insuser, - - - insdt, - - - bizid, - - - issms, - - - redflag, - - - sendview, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{suserid,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{url,jdbcType=VARCHAR}, - - - #{readflag,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{backid,jdbcType=VARCHAR}, - - - #{typeid,jdbcType=VARCHAR}, - - - #{plansdt,jdbcType=VARCHAR}, - - - #{plansdate,jdbcType=TIMESTAMP}, - - - #{sendflag,jdbcType=VARCHAR}, - - - #{delflag,jdbcType=VARCHAR}, - - - #{alerturl,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{issms,jdbcType=VARCHAR}, - - - #{redflag,jdbcType=VARCHAR}, - - - #{sendview,jdbcType=VARCHAR}, - - - - - update TB_MESSAGE - - - pid = #{pid,jdbcType=VARCHAR}, - - - suserid = #{suserid,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - url = #{url,jdbcType=VARCHAR}, - - - readflag = #{readflag,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - backid = #{backid,jdbcType=VARCHAR}, - - - typeid = #{typeid,jdbcType=VARCHAR}, - - - plansdt = #{plansdt,jdbcType=VARCHAR}, - - - plansdate = #{plansdate,jdbcType=TIMESTAMP}, - - - sendflag = #{sendflag,jdbcType=VARCHAR}, - - - delflag = #{delflag,jdbcType=VARCHAR}, - - - alerturl = #{alerturl,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - issms = #{issms,jdbcType=VARCHAR}, - - - redflag = #{redflag,jdbcType=VARCHAR}, - - - sendview = #{sendview,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE - set pid = #{pid,jdbcType=VARCHAR}, - suserid = #{suserid,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - url = #{url,jdbcType=VARCHAR}, - readflag = #{readflag,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - backid = #{backid,jdbcType=VARCHAR}, - typeid = #{typeid,jdbcType=VARCHAR}, - plansdt = #{plansdt,jdbcType=VARCHAR}, - plansdate = #{plansdate,jdbcType=TIMESTAMP}, - sendflag = #{sendflag,jdbcType=VARCHAR}, - delflag = #{delflag,jdbcType=VARCHAR}, - alerturl = #{alerturl,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - bizid = #{bizid,jdbcType=VARCHAR}, - issms = #{issms,jdbcType=VARCHAR}, - redflag = #{redflag,jdbcType=VARCHAR}, - sendview = #{sendview,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_MESSAGE - ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - update TB_MESSAGE - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/MsgRecvMapper.xml b/src/com/sipai/mapper/msg/MsgRecvMapper.xml deleted file mode 100644 index 3f5f57c2..00000000 --- a/src/com/sipai/mapper/msg/MsgRecvMapper.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - id, masterid, unitid, status, readtime, delflag, insuser, insdt,redflag - - - - delete from TB_MESSAGE_RECV - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE_RECV (id, masterid, unitid, - status, readtime, delflag, - insuser, insdt,redflag) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{readtime,jdbcType=TIMESTAMP}, #{delflag,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{redflag,jdbcType=VARCHAR}) - - - insert into TB_MESSAGE_RECV - - - id, - - - masterid, - - - unitid, - - - status, - - - readtime, - - - delflag, - - - insuser, - - - insdt, - - - redflag, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{readtime,jdbcType=TIMESTAMP}, - - - #{delflag,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{redflag,jdbcType=VARCHAR}, - - - - - update TB_MESSAGE_RECV - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - readtime = #{readtime,jdbcType=TIMESTAMP}, - - - delflag = #{delflag,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - redflag = #{redflag,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE_RECV - set masterid = #{masterid,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - readtime = #{readtime,jdbcType=TIMESTAMP}, - delflag = #{delflag,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - redflag = #{redflag,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_MESSAGE_RECV - ${where} - - - update TB_MESSAGE_RECV - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/MsgRoleMapper.xml b/src/com/sipai/mapper/msg/MsgRoleMapper.xml deleted file mode 100644 index 3fdd6477..00000000 --- a/src/com/sipai/mapper/msg/MsgRoleMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, masterid, roleid, insuser, insdt - - - - delete from TB_MESSAGE_TYPE_role - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE_TYPE_role (id, masterid, roleid, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{roleid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_MESSAGE_TYPE_role - - - id, - - - masterid, - - - roleid, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{roleid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_MESSAGE_TYPE_role - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - roleid = #{roleid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE_TYPE_role - set masterid = #{masterid,jdbcType=VARCHAR}, - roleid = #{roleid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_MESSAGE_TYPE_role - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/MsgTypeMapper.xml b/src/com/sipai/mapper/msg/MsgTypeMapper.xml deleted file mode 100644 index 02e2f965..00000000 --- a/src/com/sipai/mapper/msg/MsgTypeMapper.xml +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, name, insuser, insdt, pid, remark, status,sendway - - - - delete from TB_MESSAGE_TYPE - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE_TYPE (id, name, insuser, - insdt, pid, remark, status,sendway - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP},#{pid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{sendway,jdbcType=VARCHAR} - ) - - - insert into TB_MESSAGE_TYPE - - - id, - - - name, - - - insuser, - - - insdt, - - - pid, - - - remark, - - - status, - - - sendway, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{pid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{sendway,jdbcType=VARCHAR}, - - - - - update TB_MESSAGE_TYPE - - - name = #{name,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - sendway = #{sendway,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE_TYPE - set name = #{name,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - pid = #{pid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - sendway = #{sendway,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_MESSAGE_TYPE - ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/MsguserMapper.xml b/src/com/sipai/mapper/msg/MsguserMapper.xml deleted file mode 100644 index ed0da6b4..00000000 --- a/src/com/sipai/mapper/msg/MsguserMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, masterid, userid, insuser, insdt - - - - delete from TB_MESSAGE_TYPE_msguser - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE_TYPE_msguser (id, masterid, userid, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_MESSAGE_TYPE_msguser - - - id, - - - masterid, - - - userid, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_MESSAGE_TYPE_msguser - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE_TYPE_msguser - set masterid = #{masterid,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_MESSAGE_TYPE_msguser - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/msg/SmsuserMapper.xml b/src/com/sipai/mapper/msg/SmsuserMapper.xml deleted file mode 100644 index c023617b..00000000 --- a/src/com/sipai/mapper/msg/SmsuserMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, masterid, userid, insuser, insdt - - - - delete from TB_MESSAGE_TYPE_smsuser - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MESSAGE_TYPE_smsuser (id, masterid, userid, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_MESSAGE_TYPE_smsuser - - - id, - - - masterid, - - - userid, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_MESSAGE_TYPE_smsuser - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MESSAGE_TYPE_smsuser - set masterid = #{masterid,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_MESSAGE_TYPE_smsuser - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataPatrolMapper.xml b/src/com/sipai/mapper/process/DataPatrolMapper.xml deleted file mode 100644 index dc7da4dc..00000000 --- a/src/com/sipai/mapper/process/DataPatrolMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id - , mpid, name, pid, unit_id, morder, type - - - - delete - from tb_process_dataPatrol - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_dataPatrol (id, mpid, name, - pid, unit_id, morder, type) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}) - - - insert into tb_process_dataPatrol - - - id, - - - mpid, - - - name, - - - pid, - - - unit_id, - - - morder, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=INTEGER}, - - - - - update tb_process_dataPatrol - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_dataPatrol - set mpid = #{mpid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_process_dataPatrol ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataPatrolResultDataMapper.xml b/src/com/sipai/mapper/process/DataPatrolResultDataMapper.xml deleted file mode 100644 index 65f0d0e5..00000000 --- a/src/com/sipai/mapper/process/DataPatrolResultDataMapper.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - id, result, unit_id, mpcode, parmvalue, sdt, edt, lastDataSt - - - - delete from tb_process_dataPatrol_resultData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_dataPatrol_resultData (id, result, unit_id, - mpcode, parmvalue, sdt, - edt, lastDataSt) - values (#{id,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{mpcode,jdbcType=VARCHAR}, #{parmvalue,jdbcType=DECIMAL}, #{sdt,jdbcType=TIMESTAMP}, - #{edt,jdbcType=TIMESTAMP}, #{lastdatast,jdbcType=VARCHAR}) - - - insert into tb_process_dataPatrol_resultData - - - id, - - - result, - - - unit_id, - - - mpcode, - - - parmvalue, - - - sdt, - - - edt, - - - lastDataSt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{result,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - #{parmvalue,jdbcType=DECIMAL}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{lastdatast,jdbcType=VARCHAR}, - - - - - update tb_process_dataPatrol_resultData - - - result = #{result,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - parmvalue = #{parmvalue,jdbcType=DECIMAL}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - lastDataSt = #{lastdatast,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_dataPatrol_resultData - set result = #{result,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR}, - parmvalue = #{parmvalue,jdbcType=DECIMAL}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - lastDataSt = #{lastdatast,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_process_dataPatrol_resultData ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualBarChartMapper.xml b/src/com/sipai/mapper/process/DataVisualBarChartMapper.xml deleted file mode 100644 index add5677b..00000000 --- a/src/com/sipai/mapper/process/DataVisualBarChartMapper.xml +++ /dev/null @@ -1,380 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , pid, type, colors, background, title_text, title_color, title_font_size, title_font_weight, - title_position, subtitle_text, subtitle_color, subtitle_font_size, subtitle_font_weight, - legend_position, legend_text_fontSize, xAxisType, xAxisData, xAxisLineShow, xAxisLineColor, - xAxisaxisTickShow, xAxisSplitLineShow, xAxisAxisLabelShow, xAxisAxisLabelColor, xAxisAxisLabelFontSize, - dataZoomSt, xSubstring, direction - - - - delete - from tb_pro_dataVisual_barChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_barChart (id, pid, type, - colors, background, title_text, - title_color, title_font_size, title_font_weight, - title_position, subtitle_text, subtitle_color, - subtitle_font_size, subtitle_font_weight, legend_position, - legend_text_fontSize, xAxisType, xAxisData, - xAxisLineShow, xAxisLineColor, xAxisaxisTickShow, - xAxisSplitLineShow, xAxisAxisLabelShow, - xAxisAxisLabelColor, xAxisAxisLabelFontSize, - dataZoomSt, xSubstring, direction) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{colors,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, #{titleText,jdbcType=VARCHAR}, - #{titleColor,jdbcType=VARCHAR}, #{titleFontSize,jdbcType=VARCHAR}, #{titleFontWeight,jdbcType=VARCHAR}, - #{titlePosition,jdbcType=VARCHAR}, #{subtitleText,jdbcType=VARCHAR}, #{subtitleColor,jdbcType=VARCHAR}, - #{subtitleFontSize,jdbcType=VARCHAR}, #{subtitleFontWeight,jdbcType=VARCHAR}, - #{legendPosition,jdbcType=VARCHAR}, - #{legendTextFontsize,jdbcType=VARCHAR}, #{xaxistype,jdbcType=VARCHAR}, #{xaxisdata,jdbcType=VARCHAR}, - #{xaxislineshow,jdbcType=VARCHAR}, #{xaxislinecolor,jdbcType=VARCHAR}, - #{xaxisaxistickshow,jdbcType=VARCHAR}, - #{xaxissplitlineshow,jdbcType=VARCHAR}, #{xaxisaxislabelshow,jdbcType=VARCHAR}, - #{xaxisaxislabelcolor,jdbcType=VARCHAR}, #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - #{datazoomst,jdbcType=VARCHAR}, #{xsubstring,jdbcType=VARCHAR}, #{direction,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_barChart - - - id, - - - pid, - - - type, - - - colors, - - - background, - - - title_text, - - - title_color, - - - title_font_size, - - - title_font_weight, - - - title_position, - - - subtitle_text, - - - subtitle_color, - - - subtitle_font_size, - - - subtitle_font_weight, - - - legend_position, - - - legend_text_fontSize, - - - xAxisType, - - - xAxisData, - - - xAxisLineShow, - - - xAxisLineColor, - - - xAxisaxisTickShow, - - - xAxisSplitLineShow, - - - xAxisAxisLabelShow, - - - xAxisAxisLabelColor, - - - xAxisAxisLabelFontSize, - - - dataZoomSt, - - - xSubstring, - - - direction, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{colors,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{titleText,jdbcType=VARCHAR}, - - - #{titleColor,jdbcType=VARCHAR}, - - - #{titleFontSize,jdbcType=VARCHAR}, - - - #{titleFontWeight,jdbcType=VARCHAR}, - - - #{titlePosition,jdbcType=VARCHAR}, - - - #{subtitleText,jdbcType=VARCHAR}, - - - #{subtitleColor,jdbcType=VARCHAR}, - - - #{subtitleFontSize,jdbcType=VARCHAR}, - - - #{subtitleFontWeight,jdbcType=VARCHAR}, - - - #{legendPosition,jdbcType=VARCHAR}, - - - #{legendTextFontsize,jdbcType=VARCHAR}, - - - #{xaxistype,jdbcType=VARCHAR}, - - - #{xaxisdata,jdbcType=VARCHAR}, - - - #{xaxislineshow,jdbcType=VARCHAR}, - - - #{xaxislinecolor,jdbcType=VARCHAR}, - - - #{xaxisaxistickshow,jdbcType=VARCHAR}, - - - #{xaxissplitlineshow,jdbcType=VARCHAR}, - - - #{xaxisaxislabelshow,jdbcType=VARCHAR}, - - - #{xaxisaxislabelcolor,jdbcType=VARCHAR}, - - - #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - - - #{datazoomst,jdbcType=VARCHAR}, - - - #{xsubstring,jdbcType=VARCHAR}, - - - #{direction,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_barChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - colors = #{colors,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - title_text = #{titleText,jdbcType=VARCHAR}, - - - title_color = #{titleColor,jdbcType=VARCHAR}, - - - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - - - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - - - title_position = #{titlePosition,jdbcType=VARCHAR}, - - - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - - - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - - - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - - - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - - - legend_position = #{legendPosition,jdbcType=VARCHAR}, - - - legend_text_fontSize = #{legendTextFontsize,jdbcType=VARCHAR}, - - - xAxisType = #{xaxistype,jdbcType=VARCHAR}, - - - xAxisData = #{xaxisdata,jdbcType=VARCHAR}, - - - xAxisLineShow = #{xaxislineshow,jdbcType=VARCHAR}, - - - xAxisLineColor = #{xaxislinecolor,jdbcType=VARCHAR}, - - - xAxisaxisTickShow = #{xaxisaxistickshow,jdbcType=VARCHAR}, - - - xAxisSplitLineShow = #{xaxissplitlineshow,jdbcType=VARCHAR}, - - - xAxisAxisLabelShow = #{xaxisaxislabelshow,jdbcType=VARCHAR}, - - - xAxisAxisLabelColor = #{xaxisaxislabelcolor,jdbcType=VARCHAR}, - - - xAxisAxisLabelFontSize = #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - - - dataZoomSt = #{datazoomst,jdbcType=VARCHAR}, - - - xSubstring = #{xsubstring,jdbcType=VARCHAR}, - - - direction = #{direction,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_barChart - set pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - colors = #{colors,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - title_text = #{titleText,jdbcType=VARCHAR}, - title_color = #{titleColor,jdbcType=VARCHAR}, - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - title_position = #{titlePosition,jdbcType=VARCHAR}, - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - legend_position = #{legendPosition,jdbcType=VARCHAR}, - legend_text_fontSize = #{legendTextFontsize,jdbcType=VARCHAR}, - xAxisType = #{xaxistype,jdbcType=VARCHAR}, - xAxisData = #{xaxisdata,jdbcType=VARCHAR}, - xAxisLineShow = #{xaxislineshow,jdbcType=VARCHAR}, - xAxisLineColor = #{xaxislinecolor,jdbcType=VARCHAR}, - xAxisaxisTickShow = #{xaxisaxistickshow,jdbcType=VARCHAR}, - xAxisSplitLineShow = #{xaxissplitlineshow,jdbcType=VARCHAR}, - xAxisAxisLabelShow = #{xaxisaxislabelshow,jdbcType=VARCHAR}, - xAxisAxisLabelColor = #{xaxisaxislabelcolor,jdbcType=VARCHAR}, - xAxisAxisLabelFontSize = #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - dataZoomSt = #{datazoomst,jdbcType=VARCHAR}, - xSubstring = #{xsubstring,jdbcType=VARCHAR}, - direction = #{direction,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_barChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualBarChartSeriesMapper.xml b/src/com/sipai/mapper/process/DataVisualBarChartSeriesMapper.xml deleted file mode 100644 index aa4e03f9..00000000 --- a/src/com/sipai/mapper/process/DataVisualBarChartSeriesMapper.xml +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, type, morder, name, yAxisIndex, stackSt, mpid, fixedValue, maxShow, minShow, - avgShow, isHistoryData, timeRange, markerLine, barWidth, borderRadius, bkStyleColor, - bkStyleborderRadius, mpMethod, labelPosition, labelPositionUnit, labelPositionColor, - labelPositionFontSize, barGap, selectSt, urlData - - - - delete from tb_pro_dataVisual_barChart_series - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_barChart_series (id, pid, type, - morder, name, yAxisIndex, - stackSt, mpid, fixedValue, - maxShow, minShow, avgShow, - isHistoryData, timeRange, markerLine, - barWidth, borderRadius, bkStyleColor, - bkStyleborderRadius, mpMethod, labelPosition, - labelPositionUnit, labelPositionColor, - labelPositionFontSize, barGap, selectSt, - urlData) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{yaxisindex,jdbcType=INTEGER}, - #{stackst,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{fixedvalue,jdbcType=VARCHAR}, - #{maxshow,jdbcType=VARCHAR}, #{minshow,jdbcType=VARCHAR}, #{avgshow,jdbcType=VARCHAR}, - #{ishistorydata,jdbcType=VARCHAR}, #{timerange,jdbcType=VARCHAR}, #{markerline,jdbcType=VARCHAR}, - #{barwidth,jdbcType=VARCHAR}, #{borderradius,jdbcType=VARCHAR}, #{bkstylecolor,jdbcType=VARCHAR}, - #{bkstyleborderradius,jdbcType=VARCHAR}, #{mpmethod,jdbcType=VARCHAR}, #{labelposition,jdbcType=VARCHAR}, - #{labelpositionunit,jdbcType=VARCHAR}, #{labelpositioncolor,jdbcType=VARCHAR}, - #{labelpositionfontsize,jdbcType=VARCHAR}, #{bargap,jdbcType=VARCHAR}, #{selectst,jdbcType=VARCHAR}, - #{urldata,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_barChart_series - - - id, - - - pid, - - - type, - - - morder, - - - name, - - - yAxisIndex, - - - stackSt, - - - mpid, - - - fixedValue, - - - maxShow, - - - minShow, - - - avgShow, - - - isHistoryData, - - - timeRange, - - - markerLine, - - - barWidth, - - - borderRadius, - - - bkStyleColor, - - - bkStyleborderRadius, - - - mpMethod, - - - labelPosition, - - - labelPositionUnit, - - - labelPositionColor, - - - labelPositionFontSize, - - - barGap, - - - selectSt, - - - urlData, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{yaxisindex,jdbcType=INTEGER}, - - - #{stackst,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{maxshow,jdbcType=VARCHAR}, - - - #{minshow,jdbcType=VARCHAR}, - - - #{avgshow,jdbcType=VARCHAR}, - - - #{ishistorydata,jdbcType=VARCHAR}, - - - #{timerange,jdbcType=VARCHAR}, - - - #{markerline,jdbcType=VARCHAR}, - - - #{barwidth,jdbcType=VARCHAR}, - - - #{borderradius,jdbcType=VARCHAR}, - - - #{bkstylecolor,jdbcType=VARCHAR}, - - - #{bkstyleborderradius,jdbcType=VARCHAR}, - - - #{mpmethod,jdbcType=VARCHAR}, - - - #{labelposition,jdbcType=VARCHAR}, - - - #{labelpositionunit,jdbcType=VARCHAR}, - - - #{labelpositioncolor,jdbcType=VARCHAR}, - - - #{labelpositionfontsize,jdbcType=VARCHAR}, - - - #{bargap,jdbcType=VARCHAR}, - - - #{selectst,jdbcType=VARCHAR}, - - - #{urldata,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_barChart_series - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - yAxisIndex = #{yaxisindex,jdbcType=INTEGER}, - - - stackSt = #{stackst,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - maxShow = #{maxshow,jdbcType=VARCHAR}, - - - minShow = #{minshow,jdbcType=VARCHAR}, - - - avgShow = #{avgshow,jdbcType=VARCHAR}, - - - isHistoryData = #{ishistorydata,jdbcType=VARCHAR}, - - - timeRange = #{timerange,jdbcType=VARCHAR}, - - - markerLine = #{markerline,jdbcType=VARCHAR}, - - - barWidth = #{barwidth,jdbcType=VARCHAR}, - - - borderRadius = #{borderradius,jdbcType=VARCHAR}, - - - bkStyleColor = #{bkstylecolor,jdbcType=VARCHAR}, - - - bkStyleborderRadius = #{bkstyleborderradius,jdbcType=VARCHAR}, - - - mpMethod = #{mpmethod,jdbcType=VARCHAR}, - - - labelPosition = #{labelposition,jdbcType=VARCHAR}, - - - labelPositionUnit = #{labelpositionunit,jdbcType=VARCHAR}, - - - labelPositionColor = #{labelpositioncolor,jdbcType=VARCHAR}, - - - labelPositionFontSize = #{labelpositionfontsize,jdbcType=VARCHAR}, - - - barGap = #{bargap,jdbcType=VARCHAR}, - - - selectSt = #{selectst,jdbcType=VARCHAR}, - - - urlData = #{urldata,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_barChart_series - set pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - yAxisIndex = #{yaxisindex,jdbcType=INTEGER}, - stackSt = #{stackst,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - maxShow = #{maxshow,jdbcType=VARCHAR}, - minShow = #{minshow,jdbcType=VARCHAR}, - avgShow = #{avgshow,jdbcType=VARCHAR}, - isHistoryData = #{ishistorydata,jdbcType=VARCHAR}, - timeRange = #{timerange,jdbcType=VARCHAR}, - markerLine = #{markerline,jdbcType=VARCHAR}, - barWidth = #{barwidth,jdbcType=VARCHAR}, - borderRadius = #{borderradius,jdbcType=VARCHAR}, - bkStyleColor = #{bkstylecolor,jdbcType=VARCHAR}, - bkStyleborderRadius = #{bkstyleborderradius,jdbcType=VARCHAR}, - mpMethod = #{mpmethod,jdbcType=VARCHAR}, - labelPosition = #{labelposition,jdbcType=VARCHAR}, - labelPositionUnit = #{labelpositionunit,jdbcType=VARCHAR}, - labelPositionColor = #{labelpositioncolor,jdbcType=VARCHAR}, - labelPositionFontSize = #{labelpositionfontsize,jdbcType=VARCHAR}, - barGap = #{bargap,jdbcType=VARCHAR}, - selectSt = #{selectst,jdbcType=VARCHAR}, - urlData = #{urldata,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_barChart_series ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualBarChartYAxisMapper.xml b/src/com/sipai/mapper/process/DataVisualBarChartYAxisMapper.xml deleted file mode 100644 index 1e5f64b8..00000000 --- a/src/com/sipai/mapper/process/DataVisualBarChartYAxisMapper.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, pid, morder, name, unit, lineShow, lineColor, axisTickShow, scale, splitLineShow, - axisLabelShow, axisLabelColor, axisLabelFontSize, position, max, min - - - - delete from tb_pro_dataVisual_barChart_yAxis - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_barChart_yAxis (id, pid, morder, - name, unit, lineShow, - lineColor, axisTickShow, scale, - splitLineShow, axisLabelShow, axisLabelColor, - axisLabelFontSize, position, max, - min) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{lineshow,jdbcType=VARCHAR}, - #{linecolor,jdbcType=VARCHAR}, #{axistickshow,jdbcType=VARCHAR}, #{scale,jdbcType=VARCHAR}, - #{splitlineshow,jdbcType=VARCHAR}, #{axislabelshow,jdbcType=VARCHAR}, #{axislabelcolor,jdbcType=VARCHAR}, - #{axislabelfontsize,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{max,jdbcType=VARCHAR}, - #{min,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_barChart_yAxis - - - id, - - - pid, - - - morder, - - - name, - - - unit, - - - lineShow, - - - lineColor, - - - axisTickShow, - - - scale, - - - splitLineShow, - - - axisLabelShow, - - - axisLabelColor, - - - axisLabelFontSize, - - - position, - - - max, - - - min, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{lineshow,jdbcType=VARCHAR}, - - - #{linecolor,jdbcType=VARCHAR}, - - - #{axistickshow,jdbcType=VARCHAR}, - - - #{scale,jdbcType=VARCHAR}, - - - #{splitlineshow,jdbcType=VARCHAR}, - - - #{axislabelshow,jdbcType=VARCHAR}, - - - #{axislabelcolor,jdbcType=VARCHAR}, - - - #{axislabelfontsize,jdbcType=VARCHAR}, - - - #{position,jdbcType=VARCHAR}, - - - #{max,jdbcType=VARCHAR}, - - - #{min,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_barChart_yAxis - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - lineShow = #{lineshow,jdbcType=VARCHAR}, - - - lineColor = #{linecolor,jdbcType=VARCHAR}, - - - axisTickShow = #{axistickshow,jdbcType=VARCHAR}, - - - scale = #{scale,jdbcType=VARCHAR}, - - - splitLineShow = #{splitlineshow,jdbcType=VARCHAR}, - - - axisLabelShow = #{axislabelshow,jdbcType=VARCHAR}, - - - axisLabelColor = #{axislabelcolor,jdbcType=VARCHAR}, - - - axisLabelFontSize = #{axislabelfontsize,jdbcType=VARCHAR}, - - - position = #{position,jdbcType=VARCHAR}, - - - max = #{max,jdbcType=VARCHAR}, - - - min = #{min,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_barChart_yAxis - set pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - lineShow = #{lineshow,jdbcType=VARCHAR}, - lineColor = #{linecolor,jdbcType=VARCHAR}, - axisTickShow = #{axistickshow,jdbcType=VARCHAR}, - scale = #{scale,jdbcType=VARCHAR}, - splitLineShow = #{splitlineshow,jdbcType=VARCHAR}, - axisLabelShow = #{axislabelshow,jdbcType=VARCHAR}, - axisLabelColor = #{axislabelcolor,jdbcType=VARCHAR}, - axisLabelFontSize = #{axislabelfontsize,jdbcType=VARCHAR}, - position = #{position,jdbcType=VARCHAR}, - max = #{max,jdbcType=VARCHAR}, - min = #{min,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_barChart_yAxis ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualCameraAlarmMapper.xml b/src/com/sipai/mapper/process/DataVisualCameraAlarmMapper.xml deleted file mode 100644 index f1ed61f9..00000000 --- a/src/com/sipai/mapper/process/DataVisualCameraAlarmMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - id - , pid, jsValue, jsMethod, color, morder - - - - delete - from tb_pro_dataVisual_camera_alarm - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_camera_alarm (id, pid, jsValue, - jsMethod, color, morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{jsvalue,jdbcType=DOUBLE}, - #{jsmethod,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_camera_alarm - - - id, - - - pid, - - - jsValue, - - - jsMethod, - - - color, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{jsvalue,jdbcType=DOUBLE}, - - - #{jsmethod,jdbcType=VARCHAR}, - - - #{color,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_camera_alarm - - - pid = #{pid,jdbcType=VARCHAR}, - - - jsValue = #{jsvalue,jdbcType=DOUBLE}, - - - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - - - color = #{color,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_camera_alarm - set pid = #{pid,jdbcType=VARCHAR}, - jsValue = #{jsvalue,jdbcType=DOUBLE}, - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - color = #{color,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_camera_alarm ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualCameraMapper.xml b/src/com/sipai/mapper/process/DataVisualCameraMapper.xml deleted file mode 100644 index d048ccc1..00000000 --- a/src/com/sipai/mapper/process/DataVisualCameraMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - id - , pid, cameraid, color,mq_theme - - - - delete - from tb_pro_dataVisual_camera - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_camera (id, pid, cameraid, - color, mq_theme) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{cameraid,jdbcType=VARCHAR}, - #{color,jdbcType=VARCHAR}, #{mqTheme,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_camera - - - id, - - - pid, - - - cameraid, - - - color, - - - mq_theme, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{cameraid,jdbcType=VARCHAR}, - - - #{color,jdbcType=VARCHAR}, - - - #{mqTheme,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_camera - - - pid = #{pid,jdbcType=VARCHAR}, - - - cameraid = #{cameraid,jdbcType=VARCHAR}, - - - color = #{color,jdbcType=VARCHAR}, - - - mq_theme = #{mqTheme,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_camera - set pid = #{pid,jdbcType=VARCHAR}, - cameraid = #{cameraid,jdbcType=VARCHAR}, - color = #{color,jdbcType=VARCHAR}, - mq_theme = #{mqTheme,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_camera ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualContentMapper.xml b/src/com/sipai/mapper/process/DataVisualContentMapper.xml deleted file mode 100644 index d77a407f..00000000 --- a/src/com/sipai/mapper/process/DataVisualContentMapper.xml +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , pid,name, type, style, postX, postY, width, height, background, isFull, refreshTime, - z_index, src, isTab, tabType, isVoiceKnow, voiceText, voiceMethod, isFixed, roundTimeContent, - opacitySt - - - - delete - from tb_pro_dataVisual_content - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_content (id, pid, name, type, - style, postX, postY, - width, height, background, - isFull, refreshTime, z_index, - src, isTab, tabType, - isVoiceKnow, voiceText, voiceMethod, - isFixed, roundTimeContent, opacitySt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{style,jdbcType=VARCHAR}, #{postx,jdbcType=VARCHAR}, #{posty,jdbcType=VARCHAR}, - #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, - #{isfull,jdbcType=VARCHAR}, #{refreshtime,jdbcType=VARCHAR}, #{zIndex,jdbcType=VARCHAR}, - #{src,jdbcType=VARCHAR}, #{istab,jdbcType=VARCHAR}, #{tabtype,jdbcType=VARCHAR}, - #{isvoiceknow,jdbcType=VARCHAR}, #{voicetext,jdbcType=VARCHAR}, #{voicemethod,jdbcType=VARCHAR}, - #{isfixed,jdbcType=VARCHAR}, #{roundtimecontent,jdbcType=VARCHAR}, #{opacityst,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_content - - - id, - - - pid, - - - name, - - - type, - - - style, - - - postX, - - - postY, - - - width, - - - height, - - - background, - - - isFull, - - - refreshTime, - - - z_index, - - - src, - - - isTab, - - - tabType, - - - isVoiceKnow, - - - voiceText, - - - voiceMethod, - - - isFixed, - - - roundTimeContent, - - - opacitySt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{postx,jdbcType=VARCHAR}, - - - #{posty,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{isfull,jdbcType=VARCHAR}, - - - #{refreshtime,jdbcType=VARCHAR}, - - - #{zIndex,jdbcType=VARCHAR}, - - - #{src,jdbcType=VARCHAR}, - - - #{istab,jdbcType=VARCHAR}, - - - #{tabtype,jdbcType=VARCHAR}, - - - #{isvoiceknow,jdbcType=VARCHAR}, - - - #{voicetext,jdbcType=VARCHAR}, - - - #{voicemethod,jdbcType=VARCHAR}, - - - #{isfixed,jdbcType=VARCHAR}, - - - #{roundtimecontent,jdbcType=VARCHAR}, - - - #{opacityst,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_content - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - postX = #{postx,jdbcType=VARCHAR}, - - - postY = #{posty,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - isFull = #{isfull,jdbcType=VARCHAR}, - - - refreshTime = #{refreshtime,jdbcType=VARCHAR}, - - - z_index = #{zIndex,jdbcType=VARCHAR}, - - - src = #{src,jdbcType=VARCHAR}, - - - isTab = #{istab,jdbcType=VARCHAR}, - - - tabType = #{tabtype,jdbcType=VARCHAR}, - - - isVoiceKnow = #{isvoiceknow,jdbcType=VARCHAR}, - - - voiceText = #{voicetext,jdbcType=VARCHAR}, - - - voiceMethod = #{voicemethod,jdbcType=VARCHAR}, - - - isFixed = #{isfixed,jdbcType=VARCHAR}, - - - roundTimeContent = #{roundtimecontent,jdbcType=VARCHAR}, - - - opacitySt = #{opacityst,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_content - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - postX = #{postx,jdbcType=VARCHAR}, - postY = #{posty,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - isFull = #{isfull,jdbcType=VARCHAR}, - refreshTime = #{refreshtime,jdbcType=VARCHAR}, - z_index = #{zIndex,jdbcType=VARCHAR}, - src = #{src,jdbcType=VARCHAR}, - isTab = #{istab,jdbcType=VARCHAR}, - tabType = #{tabtype,jdbcType=VARCHAR}, - isVoiceKnow = #{isvoiceknow,jdbcType=VARCHAR}, - voiceText = #{voicetext,jdbcType=VARCHAR}, - voiceMethod = #{voicemethod,jdbcType=VARCHAR}, - isFixed = #{isfixed,jdbcType=VARCHAR}, - roundTimeContent = #{roundtimecontent,jdbcType=VARCHAR}, - opacitySt = #{opacityst,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_pro_dataVisual_content ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualDateMapper.xml b/src/com/sipai/mapper/process/DataVisualDateMapper.xml deleted file mode 100644 index 3d7cb668..00000000 --- a/src/com/sipai/mapper/process/DataVisualDateMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id - , pid, types, background, fontSize, fontColor, fontWeight, styleType, text_align - - - - delete - from tb_pro_dataVisual_date - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_date (id, pid, types, - background, fontSize, fontColor, - fontWeight, styleType, text_align) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{types,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, #{fontcolor,jdbcType=VARCHAR}, - #{fontweight,jdbcType=VARCHAR}, #{styletype,jdbcType=VARCHAR}, #{textAlign,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_date - - - id, - - - pid, - - - types, - - - background, - - - fontSize, - - - fontColor, - - - fontWeight, - - - styleType, - - - text_align, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{types,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{styletype,jdbcType=VARCHAR}, - - - #{textAlign,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_date - - - pid = #{pid,jdbcType=VARCHAR}, - - - types = #{types,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - styleType = #{styletype,jdbcType=VARCHAR}, - - - text_align = #{textAlign,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_date - set pid = #{pid,jdbcType=VARCHAR}, - types = #{types,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - styleType = #{styletype,jdbcType=VARCHAR}, - text_align = #{textAlign,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_date ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualDateSelectMapper.xml b/src/com/sipai/mapper/process/DataVisualDateSelectMapper.xml deleted file mode 100644 index 7bc84052..00000000 --- a/src/com/sipai/mapper/process/DataVisualDateSelectMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, pid, type, background, fontSize, fontColor, fontWeight, style - - - - delete from tb_pro_dataVisual_date_select - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_date_select (id, pid, type, - background, fontSize, fontColor, - fontWeight, style) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, #{fontcolor,jdbcType=VARCHAR}, - #{fontweight,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_date_select - - - id, - - - pid, - - - type, - - - background, - - - fontSize, - - - fontColor, - - - fontWeight, - - - style, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_date_select - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_date_select - set pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_date_select ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualEqPointsMapper.xml b/src/com/sipai/mapper/process/DataVisualEqPointsMapper.xml deleted file mode 100644 index 13de0b34..00000000 --- a/src/com/sipai/mapper/process/DataVisualEqPointsMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - id - , eqid, pid - - - - delete - from tb_pro_dataVisual_eqPoints - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_eqPoints (id, eqid, pid) - values (#{id,jdbcType=VARCHAR}, #{eqid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_eqPoints - - - id, - - - eqid, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{eqid,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_eqPoints - - - eqid = #{eqid,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_eqPoints - set eqid = #{eqid,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_eqPoints ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualFormMapper.xml b/src/com/sipai/mapper/process/DataVisualFormMapper.xml deleted file mode 100644 index 0434a5b3..00000000 --- a/src/com/sipai/mapper/process/DataVisualFormMapper.xml +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , pid, insertRow, insertColumn, columns, rows, type, width, height, background, - frameId, mpid, unitSt, textContent, fontSize, fontWeight, fontColor, textAlign, verticalAlign, - border, padding, borderRadius, style, valueMethod, timeFrame, rate, urlData, numTail, - timeSt, timeStNum, sqlSt, sqlContent, rowSt - - - - delete - from tb_pro_dataVisual_form - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_form (id, pid, insertRow, - insertColumn, columns, rows, - type, width, height, - background, frameId, mpid, - unitSt, textContent, fontSize, - fontWeight, fontColor, textAlign, - verticalAlign, border, padding, - borderRadius, style, valueMethod, - timeFrame, rate, urlData, - numTail, timeSt, timeStNum, - sqlSt, sqlContent, rowSt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{insertrow,jdbcType=INTEGER}, - #{insertcolumn,jdbcType=INTEGER}, #{columns,jdbcType=INTEGER}, #{rows,jdbcType=INTEGER}, - #{type,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{frameid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{unitst,jdbcType=VARCHAR}, #{textcontent,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, - #{fontweight,jdbcType=VARCHAR}, #{fontcolor,jdbcType=VARCHAR}, #{textalign,jdbcType=VARCHAR}, - #{verticalalign,jdbcType=VARCHAR}, #{border,jdbcType=VARCHAR}, #{padding,jdbcType=VARCHAR}, - #{borderradius,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{valuemethod,jdbcType=VARCHAR}, - #{timeframe,jdbcType=VARCHAR}, #{rate,jdbcType=VARCHAR}, #{urldata,jdbcType=VARCHAR}, - #{numtail,jdbcType=VARCHAR}, #{timest,jdbcType=VARCHAR}, #{timestnum,jdbcType=VARCHAR}, - #{sqlst,jdbcType=VARCHAR}, #{sqlcontent,jdbcType=VARCHAR}, #{rowst,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_form - - - id, - - - pid, - - - insertRow, - - - insertColumn, - - - columns, - - - rows, - - - type, - - - width, - - - height, - - - background, - - - frameId, - - - mpid, - - - unitSt, - - - textContent, - - - fontSize, - - - fontWeight, - - - fontColor, - - - textAlign, - - - verticalAlign, - - - border, - - - padding, - - - borderRadius, - - - style, - - - valueMethod, - - - timeFrame, - - - rate, - - - urlData, - - - numTail, - - - timeSt, - - - timeStNum, - - - sqlSt, - - - sqlContent, - - - rowSt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insertrow,jdbcType=INTEGER}, - - - #{insertcolumn,jdbcType=INTEGER}, - - - #{columns,jdbcType=INTEGER}, - - - #{rows,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{frameid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{unitst,jdbcType=VARCHAR}, - - - #{textcontent,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{textalign,jdbcType=VARCHAR}, - - - #{verticalalign,jdbcType=VARCHAR}, - - - #{border,jdbcType=VARCHAR}, - - - #{padding,jdbcType=VARCHAR}, - - - #{borderradius,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{timeframe,jdbcType=VARCHAR}, - - - #{rate,jdbcType=VARCHAR}, - - - #{urldata,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=VARCHAR}, - - - #{timest,jdbcType=VARCHAR}, - - - #{timestnum,jdbcType=VARCHAR}, - - - #{sqlst,jdbcType=VARCHAR}, - - - #{sqlcontent,jdbcType=VARCHAR}, - - - #{rowst,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_form - - - pid = #{pid,jdbcType=VARCHAR}, - - - insertRow = #{insertrow,jdbcType=INTEGER}, - - - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - - - columns = #{columns,jdbcType=INTEGER}, - - - rows = #{rows,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - frameId = #{frameid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - unitSt = #{unitst,jdbcType=VARCHAR}, - - - textContent = #{textcontent,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - textAlign = #{textalign,jdbcType=VARCHAR}, - - - verticalAlign = #{verticalalign,jdbcType=VARCHAR}, - - - border = #{border,jdbcType=VARCHAR}, - - - padding = #{padding,jdbcType=VARCHAR}, - - - borderRadius = #{borderradius,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - timeFrame = #{timeframe,jdbcType=VARCHAR}, - - - rate = #{rate,jdbcType=VARCHAR}, - - - urlData = #{urldata,jdbcType=VARCHAR}, - - - numTail = #{numtail,jdbcType=VARCHAR}, - - - timeSt = #{timest,jdbcType=VARCHAR}, - - - timeStNum = #{timestnum,jdbcType=VARCHAR}, - - - sqlSt = #{sqlst,jdbcType=VARCHAR}, - - - sqlContent = #{sqlcontent,jdbcType=VARCHAR}, - - - rowSt = #{rowst,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_form - set pid = #{pid,jdbcType=VARCHAR}, - insertRow = #{insertrow,jdbcType=INTEGER}, - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - columns = #{columns,jdbcType=INTEGER}, - rows = #{rows,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - frameId = #{frameid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - unitSt = #{unitst,jdbcType=VARCHAR}, - textContent = #{textcontent,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - textAlign = #{textalign,jdbcType=VARCHAR}, - verticalAlign = #{verticalalign,jdbcType=VARCHAR}, - border = #{border,jdbcType=VARCHAR}, - padding = #{padding,jdbcType=VARCHAR}, - borderRadius = #{borderradius,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - timeFrame = #{timeframe,jdbcType=VARCHAR}, - rate = #{rate,jdbcType=VARCHAR}, - urlData = #{urldata,jdbcType=VARCHAR}, - numTail = #{numtail,jdbcType=VARCHAR}, - timeSt = #{timest,jdbcType=VARCHAR}, - timeStNum = #{timestnum,jdbcType=VARCHAR}, - sqlSt = #{sqlst,jdbcType=VARCHAR}, - sqlContent = #{sqlcontent,jdbcType=VARCHAR}, - rowSt = #{rowst,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_form ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualFormShowStyleMapper.xml b/src/com/sipai/mapper/process/DataVisualFormShowStyleMapper.xml deleted file mode 100644 index 8cad8045..00000000 --- a/src/com/sipai/mapper/process/DataVisualFormShowStyleMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - id - , pid, ckContent, ckMethod, morder, fontSize, fontColor, fontWeight, background, - showSt - - - - delete - from tb_pro_dataVisual_form_showStyle - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_form_showStyle (id, pid, ckContent, - ckMethod, morder, fontSize, - fontColor, fontWeight, background, - showSt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{ckcontent,jdbcType=VARCHAR}, - #{ckmethod,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{fontsize,jdbcType=VARCHAR}, - #{fontcolor,jdbcType=VARCHAR}, #{fontweight,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, - #{showst,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_form_showStyle - - - id, - - - pid, - - - ckContent, - - - ckMethod, - - - morder, - - - fontSize, - - - fontColor, - - - fontWeight, - - - background, - - - showSt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{ckcontent,jdbcType=VARCHAR}, - - - #{ckmethod,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{showst,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_form_showStyle - - - pid = #{pid,jdbcType=VARCHAR}, - - - ckContent = #{ckcontent,jdbcType=VARCHAR}, - - - ckMethod = #{ckmethod,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - showSt = #{showst,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_form_showStyle - set pid = #{pid,jdbcType=VARCHAR}, - ckContent = #{ckcontent,jdbcType=VARCHAR}, - ckMethod = #{ckmethod,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - showSt = #{showst,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_form_showStyle ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualFormSqlPointMapper.xml b/src/com/sipai/mapper/process/DataVisualFormSqlPointMapper.xml deleted file mode 100644 index 3a939be9..00000000 --- a/src/com/sipai/mapper/process/DataVisualFormSqlPointMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, pid, name, morder - - - - delete from tb_pro_dataVisual_form_sqlPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_form_sqlPoint (id, pid, name, - morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_form_sqlPoint - - - id, - - - pid, - - - name, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_form_sqlPoint - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_form_sqlPoint - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_form_sqlPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualFrameContainerMapper.xml b/src/com/sipai/mapper/process/DataVisualFrameContainerMapper.xml deleted file mode 100644 index a7d1ec3b..00000000 --- a/src/com/sipai/mapper/process/DataVisualFrameContainerMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, pid, insertRow, insertColumn, columns, rows, type, width, height, background, - frameId - - - - delete from tb_pro_dataVisual_frame_container - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_frame_container (id, pid, insertRow, - insertColumn, columns, rows, - type, width, height, - background, frameId) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{insertrow,jdbcType=INTEGER}, - #{insertcolumn,jdbcType=INTEGER}, #{columns,jdbcType=INTEGER}, #{rows,jdbcType=INTEGER}, - #{type,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{frameid,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_frame_container - - - id, - - - pid, - - - insertRow, - - - insertColumn, - - - columns, - - - rows, - - - type, - - - width, - - - height, - - - background, - - - frameId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insertrow,jdbcType=INTEGER}, - - - #{insertcolumn,jdbcType=INTEGER}, - - - #{columns,jdbcType=INTEGER}, - - - #{rows,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{frameid,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_frame_container - - - pid = #{pid,jdbcType=VARCHAR}, - - - insertRow = #{insertrow,jdbcType=INTEGER}, - - - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - - - columns = #{columns,jdbcType=INTEGER}, - - - rows = #{rows,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - frameId = #{frameid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_frame_container - set pid = #{pid,jdbcType=VARCHAR}, - insertRow = #{insertrow,jdbcType=INTEGER}, - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - columns = #{columns,jdbcType=INTEGER}, - rows = #{rows,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - frameId = #{frameid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_frame_container - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualFrameMapper.xml b/src/com/sipai/mapper/process/DataVisualFrameMapper.xml deleted file mode 100644 index ca7a58a3..00000000 --- a/src/com/sipai/mapper/process/DataVisualFrameMapper.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, name, insdt, insuser, morder, pid, active, code, background, height, width, type, - unitId, menuType, style, rolePeople - - - - delete from tb_pro_dataVisual_frame - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_frame (id, name, insdt, - insuser, morder, pid, - active, code, background, - height, width, type, - unitId, menuType, style, - rolePeople) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, - #{active,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, - #{height,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{unitid,jdbcType=VARCHAR}, #{menutype,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, - #{rolepeople,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_frame - - - id, - - - name, - - - insdt, - - - insuser, - - - morder, - - - pid, - - - active, - - - code, - - - background, - - - height, - - - width, - - - type, - - - unitId, - - - menuType, - - - style, - - - rolePeople, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{menutype,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{rolepeople,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_frame - - - name = #{name,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - menuType = #{menutype,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - rolePeople = #{rolepeople,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_frame - set name = #{name,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - menuType = #{menutype,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - rolePeople = #{rolepeople,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_frame - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualGaugeChartMapper.xml b/src/com/sipai/mapper/process/DataVisualGaugeChartMapper.xml deleted file mode 100644 index afbfe799..00000000 --- a/src/com/sipai/mapper/process/DataVisualGaugeChartMapper.xml +++ /dev/null @@ -1,600 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, background, max, min, mpid, fixedValue, titleSt, title_text, title_color, - title_font_size, title_font_weight, title_x_position, title_y_position, dataSt, data_color, - data_font_size, data_font_weight, data_x_position, data_y_position, startAngle, endAngle, - radius, pointerSt, pointer_length, pointer_width, pointer_color, splitLineSt, splitLine_length, - splitLine_distance, splitLine_color, splitLine_width, axisLineSt, axisLine_width, - axisLine_color, axisTickSt, axisTick_splitNumber, axisTick_distance, axisTick_length, - axisTick_color, axisTick_width, axisLabelSt, axisLabel_distance, axisLabel_color, - axisLabel_font_size, axisLabel_font_weight, valueMethod - - - - delete from tb_pro_dataVisual_gaugeChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_gaugeChart (id, pid, background, - max, min, mpid, fixedValue, - titleSt, title_text, title_color, - title_font_size, title_font_weight, title_x_position, - title_y_position, dataSt, data_color, - data_font_size, data_font_weight, data_x_position, - data_y_position, startAngle, endAngle, - radius, pointerSt, pointer_length, - pointer_width, pointer_color, splitLineSt, - splitLine_length, splitLine_distance, splitLine_color, - splitLine_width, axisLineSt, axisLine_width, - axisLine_color, axisTickSt, axisTick_splitNumber, - axisTick_distance, axisTick_length, axisTick_color, - axisTick_width, axisLabelSt, axisLabel_distance, - axisLabel_color, axisLabel_font_size, axisLabel_font_weight, - valueMethod) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, - #{max,jdbcType=VARCHAR}, #{min,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{fixedvalue,jdbcType=VARCHAR}, - #{titlest,jdbcType=VARCHAR}, #{titleText,jdbcType=VARCHAR}, #{titleColor,jdbcType=VARCHAR}, - #{titleFontSize,jdbcType=VARCHAR}, #{titleFontWeight,jdbcType=VARCHAR}, #{titleXPosition,jdbcType=VARCHAR}, - #{titleYPosition,jdbcType=VARCHAR}, #{datast,jdbcType=VARCHAR}, #{dataColor,jdbcType=VARCHAR}, - #{dataFontSize,jdbcType=VARCHAR}, #{dataFontWeight,jdbcType=VARCHAR}, #{dataXPosition,jdbcType=VARCHAR}, - #{dataYPosition,jdbcType=VARCHAR}, #{startangle,jdbcType=VARCHAR}, #{endangle,jdbcType=VARCHAR}, - #{radius,jdbcType=VARCHAR}, #{pointerst,jdbcType=VARCHAR}, #{pointerLength,jdbcType=VARCHAR}, - #{pointerWidth,jdbcType=VARCHAR}, #{pointerColor,jdbcType=VARCHAR}, #{splitlinest,jdbcType=VARCHAR}, - #{splitlineLength,jdbcType=VARCHAR}, #{splitlineDistance,jdbcType=VARCHAR}, #{splitlineColor,jdbcType=VARCHAR}, - #{splitlineWidth,jdbcType=VARCHAR}, #{axislinest,jdbcType=VARCHAR}, #{axislineWidth,jdbcType=VARCHAR}, - #{axislineColor,jdbcType=VARCHAR}, #{axistickst,jdbcType=VARCHAR}, #{axistickSplitnumber,jdbcType=VARCHAR}, - #{axistickDistance,jdbcType=VARCHAR}, #{axistickLength,jdbcType=VARCHAR}, #{axistickColor,jdbcType=VARCHAR}, - #{axistickWidth,jdbcType=VARCHAR}, #{axislabelst,jdbcType=VARCHAR}, #{axislabelDistance,jdbcType=VARCHAR}, - #{axislabelColor,jdbcType=VARCHAR}, #{axislabelFontSize,jdbcType=VARCHAR}, #{axislabelFontWeight,jdbcType=VARCHAR}, - #{valuemethod,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_gaugeChart - - - id, - - - pid, - - - background, - - - max, - - - min, - - - mpid, - - - fixedValue, - - - titleSt, - - - title_text, - - - title_color, - - - title_font_size, - - - title_font_weight, - - - title_x_position, - - - title_y_position, - - - dataSt, - - - data_color, - - - data_font_size, - - - data_font_weight, - - - data_x_position, - - - data_y_position, - - - startAngle, - - - endAngle, - - - radius, - - - pointerSt, - - - pointer_length, - - - pointer_width, - - - pointer_color, - - - splitLineSt, - - - splitLine_length, - - - splitLine_distance, - - - splitLine_color, - - - splitLine_width, - - - axisLineSt, - - - axisLine_width, - - - axisLine_color, - - - axisTickSt, - - - axisTick_splitNumber, - - - axisTick_distance, - - - axisTick_length, - - - axisTick_color, - - - axisTick_width, - - - axisLabelSt, - - - axisLabel_distance, - - - axisLabel_color, - - - axisLabel_font_size, - - - axisLabel_font_weight, - - - valueMethod, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{max,jdbcType=VARCHAR}, - - - #{min,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{titlest,jdbcType=VARCHAR}, - - - #{titleText,jdbcType=VARCHAR}, - - - #{titleColor,jdbcType=VARCHAR}, - - - #{titleFontSize,jdbcType=VARCHAR}, - - - #{titleFontWeight,jdbcType=VARCHAR}, - - - #{titleXPosition,jdbcType=VARCHAR}, - - - #{titleYPosition,jdbcType=VARCHAR}, - - - #{datast,jdbcType=VARCHAR}, - - - #{dataColor,jdbcType=VARCHAR}, - - - #{dataFontSize,jdbcType=VARCHAR}, - - - #{dataFontWeight,jdbcType=VARCHAR}, - - - #{dataXPosition,jdbcType=VARCHAR}, - - - #{dataYPosition,jdbcType=VARCHAR}, - - - #{startangle,jdbcType=VARCHAR}, - - - #{endangle,jdbcType=VARCHAR}, - - - #{radius,jdbcType=VARCHAR}, - - - #{pointerst,jdbcType=VARCHAR}, - - - #{pointerLength,jdbcType=VARCHAR}, - - - #{pointerWidth,jdbcType=VARCHAR}, - - - #{pointerColor,jdbcType=VARCHAR}, - - - #{splitlinest,jdbcType=VARCHAR}, - - - #{splitlineLength,jdbcType=VARCHAR}, - - - #{splitlineDistance,jdbcType=VARCHAR}, - - - #{splitlineColor,jdbcType=VARCHAR}, - - - #{splitlineWidth,jdbcType=VARCHAR}, - - - #{axislinest,jdbcType=VARCHAR}, - - - #{axislineWidth,jdbcType=VARCHAR}, - - - #{axislineColor,jdbcType=VARCHAR}, - - - #{axistickst,jdbcType=VARCHAR}, - - - #{axistickSplitnumber,jdbcType=VARCHAR}, - - - #{axistickDistance,jdbcType=VARCHAR}, - - - #{axistickLength,jdbcType=VARCHAR}, - - - #{axistickColor,jdbcType=VARCHAR}, - - - #{axistickWidth,jdbcType=VARCHAR}, - - - #{axislabelst,jdbcType=VARCHAR}, - - - #{axislabelDistance,jdbcType=VARCHAR}, - - - #{axislabelColor,jdbcType=VARCHAR}, - - - #{axislabelFontSize,jdbcType=VARCHAR}, - - - #{axislabelFontWeight,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_gaugeChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - max = #{max,jdbcType=VARCHAR}, - - - min = #{min,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - titleSt = #{titlest,jdbcType=VARCHAR}, - - - title_text = #{titleText,jdbcType=VARCHAR}, - - - title_color = #{titleColor,jdbcType=VARCHAR}, - - - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - - - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - - - title_x_position = #{titleXPosition,jdbcType=VARCHAR}, - - - title_y_position = #{titleYPosition,jdbcType=VARCHAR}, - - - dataSt = #{datast,jdbcType=VARCHAR}, - - - data_color = #{dataColor,jdbcType=VARCHAR}, - - - data_font_size = #{dataFontSize,jdbcType=VARCHAR}, - - - data_font_weight = #{dataFontWeight,jdbcType=VARCHAR}, - - - data_x_position = #{dataXPosition,jdbcType=VARCHAR}, - - - data_y_position = #{dataYPosition,jdbcType=VARCHAR}, - - - startAngle = #{startangle,jdbcType=VARCHAR}, - - - endAngle = #{endangle,jdbcType=VARCHAR}, - - - radius = #{radius,jdbcType=VARCHAR}, - - - pointerSt = #{pointerst,jdbcType=VARCHAR}, - - - pointer_length = #{pointerLength,jdbcType=VARCHAR}, - - - pointer_width = #{pointerWidth,jdbcType=VARCHAR}, - - - pointer_color = #{pointerColor,jdbcType=VARCHAR}, - - - splitLineSt = #{splitlinest,jdbcType=VARCHAR}, - - - splitLine_length = #{splitlineLength,jdbcType=VARCHAR}, - - - splitLine_distance = #{splitlineDistance,jdbcType=VARCHAR}, - - - splitLine_color = #{splitlineColor,jdbcType=VARCHAR}, - - - splitLine_width = #{splitlineWidth,jdbcType=VARCHAR}, - - - axisLineSt = #{axislinest,jdbcType=VARCHAR}, - - - axisLine_width = #{axislineWidth,jdbcType=VARCHAR}, - - - axisLine_color = #{axislineColor,jdbcType=VARCHAR}, - - - axisTickSt = #{axistickst,jdbcType=VARCHAR}, - - - axisTick_splitNumber = #{axistickSplitnumber,jdbcType=VARCHAR}, - - - axisTick_distance = #{axistickDistance,jdbcType=VARCHAR}, - - - axisTick_length = #{axistickLength,jdbcType=VARCHAR}, - - - axisTick_color = #{axistickColor,jdbcType=VARCHAR}, - - - axisTick_width = #{axistickWidth,jdbcType=VARCHAR}, - - - axisLabelSt = #{axislabelst,jdbcType=VARCHAR}, - - - axisLabel_distance = #{axislabelDistance,jdbcType=VARCHAR}, - - - axisLabel_color = #{axislabelColor,jdbcType=VARCHAR}, - - - axisLabel_font_size = #{axislabelFontSize,jdbcType=VARCHAR}, - - - axisLabel_font_weight = #{axislabelFontWeight,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_gaugeChart - set pid = #{pid,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - max = #{max,jdbcType=VARCHAR}, - min = #{min,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - titleSt = #{titlest,jdbcType=VARCHAR}, - title_text = #{titleText,jdbcType=VARCHAR}, - title_color = #{titleColor,jdbcType=VARCHAR}, - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - title_x_position = #{titleXPosition,jdbcType=VARCHAR}, - title_y_position = #{titleYPosition,jdbcType=VARCHAR}, - dataSt = #{datast,jdbcType=VARCHAR}, - data_color = #{dataColor,jdbcType=VARCHAR}, - data_font_size = #{dataFontSize,jdbcType=VARCHAR}, - data_font_weight = #{dataFontWeight,jdbcType=VARCHAR}, - data_x_position = #{dataXPosition,jdbcType=VARCHAR}, - data_y_position = #{dataYPosition,jdbcType=VARCHAR}, - startAngle = #{startangle,jdbcType=VARCHAR}, - endAngle = #{endangle,jdbcType=VARCHAR}, - radius = #{radius,jdbcType=VARCHAR}, - pointerSt = #{pointerst,jdbcType=VARCHAR}, - pointer_length = #{pointerLength,jdbcType=VARCHAR}, - pointer_width = #{pointerWidth,jdbcType=VARCHAR}, - pointer_color = #{pointerColor,jdbcType=VARCHAR}, - splitLineSt = #{splitlinest,jdbcType=VARCHAR}, - splitLine_length = #{splitlineLength,jdbcType=VARCHAR}, - splitLine_distance = #{splitlineDistance,jdbcType=VARCHAR}, - splitLine_color = #{splitlineColor,jdbcType=VARCHAR}, - splitLine_width = #{splitlineWidth,jdbcType=VARCHAR}, - axisLineSt = #{axislinest,jdbcType=VARCHAR}, - axisLine_width = #{axislineWidth,jdbcType=VARCHAR}, - axisLine_color = #{axislineColor,jdbcType=VARCHAR}, - axisTickSt = #{axistickst,jdbcType=VARCHAR}, - axisTick_splitNumber = #{axistickSplitnumber,jdbcType=VARCHAR}, - axisTick_distance = #{axistickDistance,jdbcType=VARCHAR}, - axisTick_length = #{axistickLength,jdbcType=VARCHAR}, - axisTick_color = #{axistickColor,jdbcType=VARCHAR}, - axisTick_width = #{axistickWidth,jdbcType=VARCHAR}, - axisLabelSt = #{axislabelst,jdbcType=VARCHAR}, - axisLabel_distance = #{axislabelDistance,jdbcType=VARCHAR}, - axisLabel_color = #{axislabelColor,jdbcType=VARCHAR}, - axisLabel_font_size = #{axislabelFontSize,jdbcType=VARCHAR}, - axisLabel_font_weight = #{axislabelFontWeight,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_gaugeChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualLineChartMapper.xml b/src/com/sipai/mapper/process/DataVisualLineChartMapper.xml deleted file mode 100644 index 068c4c66..00000000 --- a/src/com/sipai/mapper/process/DataVisualLineChartMapper.xml +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, type, colors, background, title_text, title_color, title_font_size, title_font_weight, - title_position, subtitle_text, subtitle_color, subtitle_font_size, subtitle_font_weight, - legend_position, legend_text_fontSize, xAxisType, xAxisData, xAxisLineShow, xAxisLineColor, - xAxisaxisTickShow, xAxisSplitLineShow, xAxisAxisLabelShow, xAxisAxisLabelColor, xAxisAxisLabelFontSize, - dataZoomSt, xSubstring, xAxisSplitLineColor, xAxisSplitLineType - - - - delete from tb_pro_dataVisual_lineChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_lineChart (id, pid, type, - colors, background, title_text, - title_color, title_font_size, title_font_weight, - title_position, subtitle_text, subtitle_color, - subtitle_font_size, subtitle_font_weight, legend_position, - legend_text_fontSize, xAxisType, xAxisData, - xAxisLineShow, xAxisLineColor, xAxisaxisTickShow, - xAxisSplitLineShow, xAxisAxisLabelShow, - xAxisAxisLabelColor, xAxisAxisLabelFontSize, - dataZoomSt, xSubstring, xAxisSplitLineColor, - xAxisSplitLineType) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{colors,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, #{titleText,jdbcType=VARCHAR}, - #{titleColor,jdbcType=VARCHAR}, #{titleFontSize,jdbcType=VARCHAR}, #{titleFontWeight,jdbcType=VARCHAR}, - #{titlePosition,jdbcType=VARCHAR}, #{subtitleText,jdbcType=VARCHAR}, #{subtitleColor,jdbcType=VARCHAR}, - #{subtitleFontSize,jdbcType=VARCHAR}, #{subtitleFontWeight,jdbcType=VARCHAR}, #{legendPosition,jdbcType=VARCHAR}, - #{legendTextFontsize,jdbcType=VARCHAR}, #{xaxistype,jdbcType=VARCHAR}, #{xaxisdata,jdbcType=VARCHAR}, - #{xaxislineshow,jdbcType=VARCHAR}, #{xaxislinecolor,jdbcType=VARCHAR}, #{xaxisaxistickshow,jdbcType=VARCHAR}, - #{xaxissplitlineshow,jdbcType=VARCHAR}, #{xaxisaxislabelshow,jdbcType=VARCHAR}, - #{xaxisaxislabelcolor,jdbcType=VARCHAR}, #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - #{datazoomst,jdbcType=VARCHAR}, #{xsubstring,jdbcType=VARCHAR}, #{xaxissplitlinecolor,jdbcType=VARCHAR}, - #{xaxissplitlinetype,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_lineChart - - - id, - - - pid, - - - type, - - - colors, - - - background, - - - title_text, - - - title_color, - - - title_font_size, - - - title_font_weight, - - - title_position, - - - subtitle_text, - - - subtitle_color, - - - subtitle_font_size, - - - subtitle_font_weight, - - - legend_position, - - - legend_text_fontSize, - - - xAxisType, - - - xAxisData, - - - xAxisLineShow, - - - xAxisLineColor, - - - xAxisaxisTickShow, - - - xAxisSplitLineShow, - - - xAxisAxisLabelShow, - - - xAxisAxisLabelColor, - - - xAxisAxisLabelFontSize, - - - dataZoomSt, - - - xSubstring, - - - xAxisSplitLineColor, - - - xAxisSplitLineType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{colors,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{titleText,jdbcType=VARCHAR}, - - - #{titleColor,jdbcType=VARCHAR}, - - - #{titleFontSize,jdbcType=VARCHAR}, - - - #{titleFontWeight,jdbcType=VARCHAR}, - - - #{titlePosition,jdbcType=VARCHAR}, - - - #{subtitleText,jdbcType=VARCHAR}, - - - #{subtitleColor,jdbcType=VARCHAR}, - - - #{subtitleFontSize,jdbcType=VARCHAR}, - - - #{subtitleFontWeight,jdbcType=VARCHAR}, - - - #{legendPosition,jdbcType=VARCHAR}, - - - #{legendTextFontsize,jdbcType=VARCHAR}, - - - #{xaxistype,jdbcType=VARCHAR}, - - - #{xaxisdata,jdbcType=VARCHAR}, - - - #{xaxislineshow,jdbcType=VARCHAR}, - - - #{xaxislinecolor,jdbcType=VARCHAR}, - - - #{xaxisaxistickshow,jdbcType=VARCHAR}, - - - #{xaxissplitlineshow,jdbcType=VARCHAR}, - - - #{xaxisaxislabelshow,jdbcType=VARCHAR}, - - - #{xaxisaxislabelcolor,jdbcType=VARCHAR}, - - - #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - - - #{datazoomst,jdbcType=VARCHAR}, - - - #{xsubstring,jdbcType=VARCHAR}, - - - #{xaxissplitlinecolor,jdbcType=VARCHAR}, - - - #{xaxissplitlinetype,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_lineChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - colors = #{colors,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - title_text = #{titleText,jdbcType=VARCHAR}, - - - title_color = #{titleColor,jdbcType=VARCHAR}, - - - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - - - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - - - title_position = #{titlePosition,jdbcType=VARCHAR}, - - - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - - - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - - - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - - - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - - - legend_position = #{legendPosition,jdbcType=VARCHAR}, - - - legend_text_fontSize = #{legendTextFontsize,jdbcType=VARCHAR}, - - - xAxisType = #{xaxistype,jdbcType=VARCHAR}, - - - xAxisData = #{xaxisdata,jdbcType=VARCHAR}, - - - xAxisLineShow = #{xaxislineshow,jdbcType=VARCHAR}, - - - xAxisLineColor = #{xaxislinecolor,jdbcType=VARCHAR}, - - - xAxisaxisTickShow = #{xaxisaxistickshow,jdbcType=VARCHAR}, - - - xAxisSplitLineShow = #{xaxissplitlineshow,jdbcType=VARCHAR}, - - - xAxisAxisLabelShow = #{xaxisaxislabelshow,jdbcType=VARCHAR}, - - - xAxisAxisLabelColor = #{xaxisaxislabelcolor,jdbcType=VARCHAR}, - - - xAxisAxisLabelFontSize = #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - - - dataZoomSt = #{datazoomst,jdbcType=VARCHAR}, - - - xSubstring = #{xsubstring,jdbcType=VARCHAR}, - - - xAxisSplitLineColor = #{xaxissplitlinecolor,jdbcType=VARCHAR}, - - - xAxisSplitLineType = #{xaxissplitlinetype,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_lineChart - set pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - colors = #{colors,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - title_text = #{titleText,jdbcType=VARCHAR}, - title_color = #{titleColor,jdbcType=VARCHAR}, - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - title_position = #{titlePosition,jdbcType=VARCHAR}, - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - legend_position = #{legendPosition,jdbcType=VARCHAR}, - legend_text_fontSize = #{legendTextFontsize,jdbcType=VARCHAR}, - xAxisType = #{xaxistype,jdbcType=VARCHAR}, - xAxisData = #{xaxisdata,jdbcType=VARCHAR}, - xAxisLineShow = #{xaxislineshow,jdbcType=VARCHAR}, - xAxisLineColor = #{xaxislinecolor,jdbcType=VARCHAR}, - xAxisaxisTickShow = #{xaxisaxistickshow,jdbcType=VARCHAR}, - xAxisSplitLineShow = #{xaxissplitlineshow,jdbcType=VARCHAR}, - xAxisAxisLabelShow = #{xaxisaxislabelshow,jdbcType=VARCHAR}, - xAxisAxisLabelColor = #{xaxisaxislabelcolor,jdbcType=VARCHAR}, - xAxisAxisLabelFontSize = #{xaxisaxislabelfontsize,jdbcType=VARCHAR}, - dataZoomSt = #{datazoomst,jdbcType=VARCHAR}, - xSubstring = #{xsubstring,jdbcType=VARCHAR}, - xAxisSplitLineColor = #{xaxissplitlinecolor,jdbcType=VARCHAR}, - xAxisSplitLineType = #{xaxissplitlinetype,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_lineChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualLineChartSeriesMapper.xml b/src/com/sipai/mapper/process/DataVisualLineChartSeriesMapper.xml deleted file mode 100644 index ddcd8aa3..00000000 --- a/src/com/sipai/mapper/process/DataVisualLineChartSeriesMapper.xml +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, morder, name, yAxisIndex, stackSt, mpid, fixedValue, maxShow, minShow, avgShow, - areaStyle, symbolSt, isHistoryData, timeRange, markerLine, selectSt, urlData - - - - delete from tb_pro_dataVisual_lineChart_series - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_lineChart_series (id, pid, morder, - name, yAxisIndex, stackSt, - mpid, fixedValue, maxShow, - minShow, avgShow, areaStyle, - symbolSt, isHistoryData, timeRange, - markerLine, selectSt, urlData - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{yaxisindex,jdbcType=INTEGER}, #{stackst,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{fixedvalue,jdbcType=VARCHAR}, #{maxshow,jdbcType=VARCHAR}, - #{minshow,jdbcType=VARCHAR}, #{avgshow,jdbcType=VARCHAR}, #{areastyle,jdbcType=VARCHAR}, - #{symbolst,jdbcType=VARCHAR}, #{ishistorydata,jdbcType=VARCHAR}, #{timerange,jdbcType=VARCHAR}, - #{markerline,jdbcType=VARCHAR}, #{selectst,jdbcType=VARCHAR}, #{urldata,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_lineChart_series - - - id, - - - pid, - - - morder, - - - name, - - - yAxisIndex, - - - stackSt, - - - mpid, - - - fixedValue, - - - maxShow, - - - minShow, - - - avgShow, - - - areaStyle, - - - symbolSt, - - - isHistoryData, - - - timeRange, - - - markerLine, - - - selectSt, - - - urlData, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{yaxisindex,jdbcType=INTEGER}, - - - #{stackst,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{maxshow,jdbcType=VARCHAR}, - - - #{minshow,jdbcType=VARCHAR}, - - - #{avgshow,jdbcType=VARCHAR}, - - - #{areastyle,jdbcType=VARCHAR}, - - - #{symbolst,jdbcType=VARCHAR}, - - - #{ishistorydata,jdbcType=VARCHAR}, - - - #{timerange,jdbcType=VARCHAR}, - - - #{markerline,jdbcType=VARCHAR}, - - - #{selectst,jdbcType=VARCHAR}, - - - #{urldata,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_lineChart_series - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - yAxisIndex = #{yaxisindex,jdbcType=INTEGER}, - - - stackSt = #{stackst,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - maxShow = #{maxshow,jdbcType=VARCHAR}, - - - minShow = #{minshow,jdbcType=VARCHAR}, - - - avgShow = #{avgshow,jdbcType=VARCHAR}, - - - areaStyle = #{areastyle,jdbcType=VARCHAR}, - - - symbolSt = #{symbolst,jdbcType=VARCHAR}, - - - isHistoryData = #{ishistorydata,jdbcType=VARCHAR}, - - - timeRange = #{timerange,jdbcType=VARCHAR}, - - - markerLine = #{markerline,jdbcType=VARCHAR}, - - - selectSt = #{selectst,jdbcType=VARCHAR}, - - - urlData = #{urldata,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_lineChart_series - set pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - yAxisIndex = #{yaxisindex,jdbcType=INTEGER}, - stackSt = #{stackst,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - maxShow = #{maxshow,jdbcType=VARCHAR}, - minShow = #{minshow,jdbcType=VARCHAR}, - avgShow = #{avgshow,jdbcType=VARCHAR}, - areaStyle = #{areastyle,jdbcType=VARCHAR}, - symbolSt = #{symbolst,jdbcType=VARCHAR}, - isHistoryData = #{ishistorydata,jdbcType=VARCHAR}, - timeRange = #{timerange,jdbcType=VARCHAR}, - markerLine = #{markerline,jdbcType=VARCHAR}, - selectSt = #{selectst,jdbcType=VARCHAR}, - urlData = #{urldata,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_lineChart_series - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualLineChartYAxisMapper.xml b/src/com/sipai/mapper/process/DataVisualLineChartYAxisMapper.xml deleted file mode 100644 index e2609476..00000000 --- a/src/com/sipai/mapper/process/DataVisualLineChartYAxisMapper.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, morder, name, unit, lineShow, lineColor, axisTickShow, scale, splitLineShow, - splitLineType, splitLineColor, position, axisLabelShow, axisLabelColor, axisLabelFontSize, - max, min - - - - delete from tb_pro_dataVisual_lineChart_yAxis - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_lineChart_yAxis (id, pid, morder, - name, unit, lineShow, - lineColor, axisTickShow, scale, - splitLineShow, splitLineType, splitLineColor, - position, axisLabelShow, axisLabelColor, - axisLabelFontSize, max, min - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{lineshow,jdbcType=VARCHAR}, - #{linecolor,jdbcType=VARCHAR}, #{axistickshow,jdbcType=VARCHAR}, #{scale,jdbcType=VARCHAR}, - #{splitlineshow,jdbcType=VARCHAR}, #{splitlinetype,jdbcType=VARCHAR}, #{splitlinecolor,jdbcType=VARCHAR}, - #{position,jdbcType=VARCHAR}, #{axislabelshow,jdbcType=VARCHAR}, #{axislabelcolor,jdbcType=VARCHAR}, - #{axislabelfontsize,jdbcType=VARCHAR}, #{max,jdbcType=VARCHAR}, #{min,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_lineChart_yAxis - - - id, - - - pid, - - - morder, - - - name, - - - unit, - - - lineShow, - - - lineColor, - - - axisTickShow, - - - scale, - - - splitLineShow, - - - splitLineType, - - - splitLineColor, - - - position, - - - axisLabelShow, - - - axisLabelColor, - - - axisLabelFontSize, - - - max, - - - min, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{lineshow,jdbcType=VARCHAR}, - - - #{linecolor,jdbcType=VARCHAR}, - - - #{axistickshow,jdbcType=VARCHAR}, - - - #{scale,jdbcType=VARCHAR}, - - - #{splitlineshow,jdbcType=VARCHAR}, - - - #{splitlinetype,jdbcType=VARCHAR}, - - - #{splitlinecolor,jdbcType=VARCHAR}, - - - #{position,jdbcType=VARCHAR}, - - - #{axislabelshow,jdbcType=VARCHAR}, - - - #{axislabelcolor,jdbcType=VARCHAR}, - - - #{axislabelfontsize,jdbcType=VARCHAR}, - - - #{max,jdbcType=VARCHAR}, - - - #{min,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_lineChart_yAxis - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - lineShow = #{lineshow,jdbcType=VARCHAR}, - - - lineColor = #{linecolor,jdbcType=VARCHAR}, - - - axisTickShow = #{axistickshow,jdbcType=VARCHAR}, - - - scale = #{scale,jdbcType=VARCHAR}, - - - splitLineShow = #{splitlineshow,jdbcType=VARCHAR}, - - - splitLineType = #{splitlinetype,jdbcType=VARCHAR}, - - - splitLineColor = #{splitlinecolor,jdbcType=VARCHAR}, - - - position = #{position,jdbcType=VARCHAR}, - - - axisLabelShow = #{axislabelshow,jdbcType=VARCHAR}, - - - axisLabelColor = #{axislabelcolor,jdbcType=VARCHAR}, - - - axisLabelFontSize = #{axislabelfontsize,jdbcType=VARCHAR}, - - - max = #{max,jdbcType=VARCHAR}, - - - min = #{min,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_lineChart_yAxis - set pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - lineShow = #{lineshow,jdbcType=VARCHAR}, - lineColor = #{linecolor,jdbcType=VARCHAR}, - axisTickShow = #{axistickshow,jdbcType=VARCHAR}, - scale = #{scale,jdbcType=VARCHAR}, - splitLineShow = #{splitlineshow,jdbcType=VARCHAR}, - splitLineType = #{splitlinetype,jdbcType=VARCHAR}, - splitLineColor = #{splitlinecolor,jdbcType=VARCHAR}, - position = #{position,jdbcType=VARCHAR}, - axisLabelShow = #{axislabelshow,jdbcType=VARCHAR}, - axisLabelColor = #{axislabelcolor,jdbcType=VARCHAR}, - axisLabelFontSize = #{axislabelfontsize,jdbcType=VARCHAR}, - max = #{max,jdbcType=VARCHAR}, - min = #{min,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_lineChart_yAxis - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualMPointMapper.xml b/src/com/sipai/mapper/process/DataVisualMPointMapper.xml deleted file mode 100644 index f4cb1284..00000000 --- a/src/com/sipai/mapper/process/DataVisualMPointMapper.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, pid, mpid, name, fontSize, fontColor, fontWeight, background, style, unitId, - show_style, title_switch, unit_switch - - - - delete from tb_pro_dataVisual_mPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_mPoint (id, pid, mpid, - name, fontSize, fontColor, - fontWeight, background, style, - unitId, show_style, title_switch, - unit_switch) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{fontsize,jdbcType=INTEGER}, #{fontcolor,jdbcType=VARCHAR}, - #{fontweight,jdbcType=INTEGER}, #{background,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, - #{unitid,jdbcType=VARCHAR}, #{showStyle,jdbcType=VARCHAR}, #{titleSwitch,jdbcType=VARCHAR}, - #{unitSwitch,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_mPoint - - - id, - - - pid, - - - mpid, - - - name, - - - fontSize, - - - fontColor, - - - fontWeight, - - - background, - - - style, - - - unitId, - - - show_style, - - - title_switch, - - - unit_switch, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=INTEGER}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=INTEGER}, - - - #{background,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{showStyle,jdbcType=VARCHAR}, - - - #{titleSwitch,jdbcType=VARCHAR}, - - - #{unitSwitch,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_mPoint - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=INTEGER}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=INTEGER}, - - - background = #{background,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - show_style = #{showStyle,jdbcType=VARCHAR}, - - - title_switch = #{titleSwitch,jdbcType=VARCHAR}, - - - unit_switch = #{unitSwitch,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_mPoint - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=INTEGER}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=INTEGER}, - background = #{background,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - show_style = #{showStyle,jdbcType=VARCHAR}, - title_switch = #{titleSwitch,jdbcType=VARCHAR}, - unit_switch = #{unitSwitch,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_mPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualMPointWarehouseMapper.xml b/src/com/sipai/mapper/process/DataVisualMPointWarehouseMapper.xml deleted file mode 100644 index 75e4fc09..00000000 --- a/src/com/sipai/mapper/process/DataVisualMPointWarehouseMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, name, width, height, fontSize, fontColor, fontWeight, background, style, morder, - type - - - - delete from tb_pro_dataVisual_mPoint_warehouse - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_mPoint_warehouse (id, name, width, - height, fontSize, fontColor, - fontWeight, background, style, - morder, type) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, - #{height,jdbcType=VARCHAR}, #{fontsize,jdbcType=INTEGER}, #{fontcolor,jdbcType=VARCHAR}, - #{fontweight,jdbcType=INTEGER}, #{background,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_mPoint_warehouse - - - id, - - - name, - - - width, - - - height, - - - fontSize, - - - fontColor, - - - fontWeight, - - - background, - - - style, - - - morder, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=INTEGER}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=INTEGER}, - - - #{background,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_mPoint_warehouse - - - name = #{name,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=INTEGER}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=INTEGER}, - - - background = #{background,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_mPoint_warehouse - set name = #{name,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=INTEGER}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=INTEGER}, - background = #{background,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_mPoint_warehouse - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualMpViewMapper.xml b/src/com/sipai/mapper/process/DataVisualMpViewMapper.xml deleted file mode 100644 index e8963433..00000000 --- a/src/com/sipai/mapper/process/DataVisualMpViewMapper.xml +++ /dev/null @@ -1,340 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, mpid,url, background, jsValue, jsMpid, jsMethod, morder, valueMethod, textShow, - fontSize, fontColor, fontWeight, text_align, fileSt, opacity, style, out_value_type, - auto_bk_st, auto_bk_text_st, auto_bk_text_wz, auto_bk_st_maxValue, auto_bk_text_type, - auto_bk_background - - - - delete from tb_pro_dataVisual_mpView - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_mpView (id, pid, mpid, url, - background, jsValue, jsMpid, - jsMethod, morder, valueMethod, - textShow, fontSize, fontColor, - fontWeight, text_align, fileSt, - opacity, style, out_value_type, - auto_bk_st, auto_bk_text_st, auto_bk_text_wz, - auto_bk_st_maxValue, auto_bk_text_type, auto_bk_background - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{jsvalue,jdbcType=DOUBLE}, #{jsmpid,jdbcType=VARCHAR}, - #{jsmethod,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{valuemethod,jdbcType=VARCHAR}, - #{textshow,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, #{fontcolor,jdbcType=VARCHAR}, - #{fontweight,jdbcType=VARCHAR}, #{textAlign,jdbcType=VARCHAR}, #{filest,jdbcType=VARCHAR}, - #{opacity,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{outValueType,jdbcType=VARCHAR}, - #{autoBkSt,jdbcType=VARCHAR}, #{autoBkTextSt,jdbcType=VARCHAR}, #{autoBkTextWz,jdbcType=VARCHAR}, - #{autoBkStMaxvalue,jdbcType=DOUBLE}, #{autoBkTextType,jdbcType=VARCHAR}, #{autoBkBackground,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_mpView - - - id, - - - pid, - - - mpid, - - - url, - - - background, - - - jsValue, - - - jsMpid, - - - jsMethod, - - - morder, - - - valueMethod, - - - textShow, - - - fontSize, - - - fontColor, - - - fontWeight, - - - text_align, - - - fileSt, - - - opacity, - - - style, - - - out_value_type, - - - auto_bk_st, - - - auto_bk_text_st, - - - auto_bk_text_wz, - - - auto_bk_st_maxValue, - - - auto_bk_text_type, - - - auto_bk_background, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{jsvalue,jdbcType=DOUBLE}, - - - #{jsmpid,jdbcType=VARCHAR}, - - - #{jsmethod,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{textshow,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{textAlign,jdbcType=VARCHAR}, - - - #{filest,jdbcType=VARCHAR}, - - - #{opacity,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{outValueType,jdbcType=VARCHAR}, - - - #{autoBkSt,jdbcType=VARCHAR}, - - - #{autoBkTextSt,jdbcType=VARCHAR}, - - - #{autoBkTextWz,jdbcType=VARCHAR}, - - - #{autoBkStMaxvalue,jdbcType=DOUBLE}, - - - #{autoBkTextType,jdbcType=VARCHAR}, - - - #{autoBkBackground,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_mpView - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - jsValue = #{jsvalue,jdbcType=DOUBLE}, - - - jsMpid = #{jsmpid,jdbcType=VARCHAR}, - - - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - textShow = #{textshow,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - text_align = #{textAlign,jdbcType=VARCHAR}, - - - fileSt = #{filest,jdbcType=VARCHAR}, - - - opacity = #{opacity,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - out_value_type = #{outValueType,jdbcType=VARCHAR}, - - - auto_bk_st = #{autoBkSt,jdbcType=VARCHAR}, - - - auto_bk_text_st = #{autoBkTextSt,jdbcType=VARCHAR}, - - - auto_bk_text_wz = #{autoBkTextWz,jdbcType=VARCHAR}, - - - auto_bk_st_maxValue = #{autoBkStMaxvalue,jdbcType=DOUBLE}, - - - auto_bk_text_type = #{autoBkTextType,jdbcType=VARCHAR}, - - - auto_bk_background = #{autoBkBackground,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_mpView - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - jsValue = #{jsvalue,jdbcType=DOUBLE}, - jsMpid = #{jsmpid,jdbcType=VARCHAR}, - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - textShow = #{textshow,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - text_align = #{textAlign,jdbcType=VARCHAR}, - fileSt = #{filest,jdbcType=VARCHAR}, - opacity = #{opacity,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - out_value_type = #{outValueType,jdbcType=VARCHAR}, - auto_bk_st = #{autoBkSt,jdbcType=VARCHAR}, - auto_bk_text_st = #{autoBkTextSt,jdbcType=VARCHAR}, - auto_bk_text_wz = #{autoBkTextWz,jdbcType=VARCHAR}, - auto_bk_st_maxValue = #{autoBkStMaxvalue,jdbcType=DOUBLE}, - auto_bk_text_type = #{autoBkTextType,jdbcType=VARCHAR}, - auto_bk_background = #{autoBkBackground,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_mpView ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualPercentChartMapper.xml b/src/com/sipai/mapper/process/DataVisualPercentChartMapper.xml deleted file mode 100644 index 7043741c..00000000 --- a/src/com/sipai/mapper/process/DataVisualPercentChartMapper.xml +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , pid, background, title_text, title_color, title_font_size, title_font_weight, - title_left_position, title_top_position, subtitle_text, subtitle_color, subtitle_font_size, - subtitle_font_weight, subtitle_position, unittitle_text, unittitle_color, unittitle_font_size, - unittitle_font_weight, unitIsNeedBr, mpid, clockwise, radius, scoreRingWidth, scoreRingColor, - bgRingWidth, bgRingColor, bgRingPosition, angleAxisMax, startAngle, valueMethod, - urlData, numTail,rate - - - - delete - from tb_pro_dataVisual_percentChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_percentChart (id, pid, background, - title_text, title_color, title_font_size, - title_font_weight, title_left_position, title_top_position, - subtitle_text, subtitle_color, subtitle_font_size, - subtitle_font_weight, subtitle_position, unittitle_text, - unittitle_color, unittitle_font_size, unittitle_font_weight, - unitIsNeedBr, mpid, clockwise, - radius, scoreRingWidth, scoreRingColor, - bgRingWidth, bgRingColor, bgRingPosition, - angleAxisMax, startAngle, valueMethod, - urlData, numTail, rate) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, - #{titleText,jdbcType=VARCHAR}, #{titleColor,jdbcType=VARCHAR}, #{titleFontSize,jdbcType=VARCHAR}, - #{titleFontWeight,jdbcType=VARCHAR}, #{titleLeftPosition,jdbcType=VARCHAR}, - #{titleTopPosition,jdbcType=VARCHAR}, - #{subtitleText,jdbcType=VARCHAR}, #{subtitleColor,jdbcType=VARCHAR}, - #{subtitleFontSize,jdbcType=VARCHAR}, - #{subtitleFontWeight,jdbcType=VARCHAR}, #{subtitlePosition,jdbcType=VARCHAR}, - #{unittitleText,jdbcType=VARCHAR}, - #{unittitleColor,jdbcType=VARCHAR}, #{unittitleFontSize,jdbcType=VARCHAR}, - #{unittitleFontWeight,jdbcType=VARCHAR}, - #{unitisneedbr,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{clockwise,jdbcType=VARCHAR}, - #{radius,jdbcType=VARCHAR}, #{scoreringwidth,jdbcType=VARCHAR}, #{scoreringcolor,jdbcType=VARCHAR}, - #{bgringwidth,jdbcType=VARCHAR}, #{bgringcolor,jdbcType=VARCHAR}, #{bgringposition,jdbcType=VARCHAR}, - #{angleaxismax,jdbcType=VARCHAR}, #{startangle,jdbcType=VARCHAR}, #{valuemethod,jdbcType=VARCHAR}, - #{urldata,jdbcType=VARCHAR}, #{numtail,jdbcType=VARCHAR}, #{rate,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_percentChart - - - id, - - - pid, - - - background, - - - title_text, - - - title_color, - - - title_font_size, - - - title_font_weight, - - - title_left_position, - - - title_top_position, - - - subtitle_text, - - - subtitle_color, - - - subtitle_font_size, - - - subtitle_font_weight, - - - subtitle_position, - - - unittitle_text, - - - unittitle_color, - - - unittitle_font_size, - - - unittitle_font_weight, - - - unitIsNeedBr, - - - mpid, - - - clockwise, - - - radius, - - - scoreRingWidth, - - - scoreRingColor, - - - bgRingWidth, - - - bgRingColor, - - - bgRingPosition, - - - angleAxisMax, - - - startAngle, - - - valueMethod, - - - urlData, - - - numTail, - - - rate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{titleText,jdbcType=VARCHAR}, - - - #{titleColor,jdbcType=VARCHAR}, - - - #{titleFontSize,jdbcType=VARCHAR}, - - - #{titleFontWeight,jdbcType=VARCHAR}, - - - #{titleLeftPosition,jdbcType=VARCHAR}, - - - #{titleTopPosition,jdbcType=VARCHAR}, - - - #{subtitleText,jdbcType=VARCHAR}, - - - #{subtitleColor,jdbcType=VARCHAR}, - - - #{subtitleFontSize,jdbcType=VARCHAR}, - - - #{subtitleFontWeight,jdbcType=VARCHAR}, - - - #{subtitlePosition,jdbcType=VARCHAR}, - - - #{unittitleText,jdbcType=VARCHAR}, - - - #{unittitleColor,jdbcType=VARCHAR}, - - - #{unittitleFontSize,jdbcType=VARCHAR}, - - - #{unittitleFontWeight,jdbcType=VARCHAR}, - - - #{unitisneedbr,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{clockwise,jdbcType=VARCHAR}, - - - #{radius,jdbcType=VARCHAR}, - - - #{scoreringwidth,jdbcType=VARCHAR}, - - - #{scoreringcolor,jdbcType=VARCHAR}, - - - #{bgringwidth,jdbcType=VARCHAR}, - - - #{bgringcolor,jdbcType=VARCHAR}, - - - #{bgringposition,jdbcType=VARCHAR}, - - - #{angleaxismax,jdbcType=VARCHAR}, - - - #{startangle,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{urldata,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=VARCHAR}, - - - #{rate,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_percentChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - title_text = #{titleText,jdbcType=VARCHAR}, - - - title_color = #{titleColor,jdbcType=VARCHAR}, - - - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - - - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - - - title_left_position = #{titleLeftPosition,jdbcType=VARCHAR}, - - - title_top_position = #{titleTopPosition,jdbcType=VARCHAR}, - - - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - - - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - - - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - - - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - - - subtitle_position = #{subtitlePosition,jdbcType=VARCHAR}, - - - unittitle_text = #{unittitleText,jdbcType=VARCHAR}, - - - unittitle_color = #{unittitleColor,jdbcType=VARCHAR}, - - - unittitle_font_size = #{unittitleFontSize,jdbcType=VARCHAR}, - - - unittitle_font_weight = #{unittitleFontWeight,jdbcType=VARCHAR}, - - - unitIsNeedBr = #{unitisneedbr,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - clockwise = #{clockwise,jdbcType=VARCHAR}, - - - radius = #{radius,jdbcType=VARCHAR}, - - - scoreRingWidth = #{scoreringwidth,jdbcType=VARCHAR}, - - - scoreRingColor = #{scoreringcolor,jdbcType=VARCHAR}, - - - bgRingWidth = #{bgringwidth,jdbcType=VARCHAR}, - - - bgRingColor = #{bgringcolor,jdbcType=VARCHAR}, - - - bgRingPosition = #{bgringposition,jdbcType=VARCHAR}, - - - angleAxisMax = #{angleaxismax,jdbcType=VARCHAR}, - - - startAngle = #{startangle,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - urlData = #{urldata,jdbcType=VARCHAR}, - - - numTail = #{numtail,jdbcType=VARCHAR}, - - - rate = #{rate,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_percentChart - set pid = #{pid,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - title_text = #{titleText,jdbcType=VARCHAR}, - title_color = #{titleColor,jdbcType=VARCHAR}, - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - title_left_position = #{titleLeftPosition,jdbcType=VARCHAR}, - title_top_position = #{titleTopPosition,jdbcType=VARCHAR}, - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - subtitle_position = #{subtitlePosition,jdbcType=VARCHAR}, - unittitle_text = #{unittitleText,jdbcType=VARCHAR}, - unittitle_color = #{unittitleColor,jdbcType=VARCHAR}, - unittitle_font_size = #{unittitleFontSize,jdbcType=VARCHAR}, - unittitle_font_weight = #{unittitleFontWeight,jdbcType=VARCHAR}, - unitIsNeedBr = #{unitisneedbr,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - clockwise = #{clockwise,jdbcType=VARCHAR}, - radius = #{radius,jdbcType=VARCHAR}, - scoreRingWidth = #{scoreringwidth,jdbcType=VARCHAR}, - scoreRingColor = #{scoreringcolor,jdbcType=VARCHAR}, - bgRingWidth = #{bgringwidth,jdbcType=VARCHAR}, - bgRingColor = #{bgringcolor,jdbcType=VARCHAR}, - bgRingPosition = #{bgringposition,jdbcType=VARCHAR}, - angleAxisMax = #{angleaxismax,jdbcType=VARCHAR}, - startAngle = #{startangle,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - urlData = #{urldata,jdbcType=VARCHAR}, - numTail = #{numtail,jdbcType=VARCHAR}, - rate = #{rate,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_percentChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualPersonnelPositioningMapper.xml b/src/com/sipai/mapper/process/DataVisualPersonnelPositioningMapper.xml deleted file mode 100644 index 69db3c51..00000000 --- a/src/com/sipai/mapper/process/DataVisualPersonnelPositioningMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, pid, shifting_left, shifting_top, showIcon, color, mq_theme, fontSize, fontColor - - - - delete from tb_pro_dataVisual_personnel_positioning - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_personnel_positioning (id, pid, shifting_left, - shifting_top, showIcon, color, - mq_theme, fontSize, fontColor - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{shiftingLeft,jdbcType=DOUBLE}, - #{shiftingTop,jdbcType=DOUBLE}, #{showicon,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, - #{mqTheme,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, #{fontcolor,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_personnel_positioning - - - id, - - - pid, - - - shifting_left, - - - shifting_top, - - - showIcon, - - - color, - - - mq_theme, - - - fontSize, - - - fontColor, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{shiftingLeft,jdbcType=DOUBLE}, - - - #{shiftingTop,jdbcType=DOUBLE}, - - - #{showicon,jdbcType=VARCHAR}, - - - #{color,jdbcType=VARCHAR}, - - - #{mqTheme,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_personnel_positioning - - - pid = #{pid,jdbcType=VARCHAR}, - - - shifting_left = #{shiftingLeft,jdbcType=DOUBLE}, - - - shifting_top = #{shiftingTop,jdbcType=DOUBLE}, - - - showIcon = #{showicon,jdbcType=VARCHAR}, - - - color = #{color,jdbcType=VARCHAR}, - - - mq_theme = #{mqTheme,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_personnel_positioning - set pid = #{pid,jdbcType=VARCHAR}, - shifting_left = #{shiftingLeft,jdbcType=DOUBLE}, - shifting_top = #{shiftingTop,jdbcType=DOUBLE}, - showIcon = #{showicon,jdbcType=VARCHAR}, - color = #{color,jdbcType=VARCHAR}, - mq_theme = #{mqTheme,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_personnel_positioning ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualPieChartMapper.xml b/src/com/sipai/mapper/process/DataVisualPieChartMapper.xml deleted file mode 100644 index 9ee4ed96..00000000 --- a/src/com/sipai/mapper/process/DataVisualPieChartMapper.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, type, colors, background, title_text, title_color, title_font_size, title_font_weight, - title_position_x, title_position_y, subtitle_text, subtitle_color, subtitle_font_size, - subtitle_font_weight, legend_position, lable_show, lable_position, lable_fontSize, - lable_color, lable_fontWeight, radius, borderRadius - - - - delete from tb_pro_dataVisual_pieChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_pieChart (id, pid, type, - colors, background, title_text, - title_color, title_font_size, title_font_weight, - title_position_x, title_position_y, subtitle_text, - subtitle_color, subtitle_font_size, subtitle_font_weight, - legend_position, lable_show, lable_position, - lable_fontSize, lable_color, lable_fontWeight, - radius, borderRadius) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{colors,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, #{titleText,jdbcType=VARCHAR}, - #{titleColor,jdbcType=VARCHAR}, #{titleFontSize,jdbcType=VARCHAR}, #{titleFontWeight,jdbcType=VARCHAR}, - #{titlePositionX,jdbcType=VARCHAR}, #{titlePositionY,jdbcType=VARCHAR}, #{subtitleText,jdbcType=VARCHAR}, - #{subtitleColor,jdbcType=VARCHAR}, #{subtitleFontSize,jdbcType=VARCHAR}, #{subtitleFontWeight,jdbcType=VARCHAR}, - #{legendPosition,jdbcType=VARCHAR}, #{lableShow,jdbcType=VARCHAR}, #{lablePosition,jdbcType=VARCHAR}, - #{lableFontsize,jdbcType=VARCHAR}, #{lableColor,jdbcType=VARCHAR}, #{lableFontweight,jdbcType=VARCHAR}, - #{radius,jdbcType=VARCHAR}, #{borderradius,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_pieChart - - - id, - - - pid, - - - type, - - - colors, - - - background, - - - title_text, - - - title_color, - - - title_font_size, - - - title_font_weight, - - - title_position_x, - - - title_position_y, - - - subtitle_text, - - - subtitle_color, - - - subtitle_font_size, - - - subtitle_font_weight, - - - legend_position, - - - lable_show, - - - lable_position, - - - lable_fontSize, - - - lable_color, - - - lable_fontWeight, - - - radius, - - - borderRadius, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{colors,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{titleText,jdbcType=VARCHAR}, - - - #{titleColor,jdbcType=VARCHAR}, - - - #{titleFontSize,jdbcType=VARCHAR}, - - - #{titleFontWeight,jdbcType=VARCHAR}, - - - #{titlePositionX,jdbcType=VARCHAR}, - - - #{titlePositionY,jdbcType=VARCHAR}, - - - #{subtitleText,jdbcType=VARCHAR}, - - - #{subtitleColor,jdbcType=VARCHAR}, - - - #{subtitleFontSize,jdbcType=VARCHAR}, - - - #{subtitleFontWeight,jdbcType=VARCHAR}, - - - #{legendPosition,jdbcType=VARCHAR}, - - - #{lableShow,jdbcType=VARCHAR}, - - - #{lablePosition,jdbcType=VARCHAR}, - - - #{lableFontsize,jdbcType=VARCHAR}, - - - #{lableColor,jdbcType=VARCHAR}, - - - #{lableFontweight,jdbcType=VARCHAR}, - - - #{radius,jdbcType=VARCHAR}, - - - #{borderradius,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_pieChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - colors = #{colors,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - title_text = #{titleText,jdbcType=VARCHAR}, - - - title_color = #{titleColor,jdbcType=VARCHAR}, - - - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - - - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - - - title_position_x = #{titlePositionX,jdbcType=VARCHAR}, - - - title_position_y = #{titlePositionY,jdbcType=VARCHAR}, - - - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - - - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - - - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - - - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - - - legend_position = #{legendPosition,jdbcType=VARCHAR}, - - - lable_show = #{lableShow,jdbcType=VARCHAR}, - - - lable_position = #{lablePosition,jdbcType=VARCHAR}, - - - lable_fontSize = #{lableFontsize,jdbcType=VARCHAR}, - - - lable_color = #{lableColor,jdbcType=VARCHAR}, - - - lable_fontWeight = #{lableFontweight,jdbcType=VARCHAR}, - - - radius = #{radius,jdbcType=VARCHAR}, - - - borderRadius = #{borderradius,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_pieChart - set pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - colors = #{colors,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - title_text = #{titleText,jdbcType=VARCHAR}, - title_color = #{titleColor,jdbcType=VARCHAR}, - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - title_position_x = #{titlePositionX,jdbcType=VARCHAR}, - title_position_y = #{titlePositionY,jdbcType=VARCHAR}, - subtitle_text = #{subtitleText,jdbcType=VARCHAR}, - subtitle_color = #{subtitleColor,jdbcType=VARCHAR}, - subtitle_font_size = #{subtitleFontSize,jdbcType=VARCHAR}, - subtitle_font_weight = #{subtitleFontWeight,jdbcType=VARCHAR}, - legend_position = #{legendPosition,jdbcType=VARCHAR}, - lable_show = #{lableShow,jdbcType=VARCHAR}, - lable_position = #{lablePosition,jdbcType=VARCHAR}, - lable_fontSize = #{lableFontsize,jdbcType=VARCHAR}, - lable_color = #{lableColor,jdbcType=VARCHAR}, - lable_fontWeight = #{lableFontweight,jdbcType=VARCHAR}, - radius = #{radius,jdbcType=VARCHAR}, - borderRadius = #{borderradius,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_pieChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualPieChartSeriesMapper.xml b/src/com/sipai/mapper/process/DataVisualPieChartSeriesMapper.xml deleted file mode 100644 index 8e4f8ce9..00000000 --- a/src/com/sipai/mapper/process/DataVisualPieChartSeriesMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, pid, morder, name, mpid, fixedValue, valueMethod, rate, numTail - - - - delete from tb_pro_dataVisual_pieChart_series - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_pieChart_series (id, pid, morder, - name, mpid, fixedValue, - valueMethod, rate, numTail - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{fixedvalue,jdbcType=VARCHAR}, - #{valuemethod,jdbcType=VARCHAR}, #{rate,jdbcType=VARCHAR}, #{numtail,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_pieChart_series - - - id, - - - pid, - - - morder, - - - name, - - - mpid, - - - fixedValue, - - - valueMethod, - - - rate, - - - numTail, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{rate,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_pieChart_series - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - rate = #{rate,jdbcType=VARCHAR}, - - - numTail = #{numtail,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_pieChart_series - set pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - rate = #{rate,jdbcType=VARCHAR}, - numTail = #{numtail,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_pieChart_series ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualPolarCoordinatesMapper.xml b/src/com/sipai/mapper/process/DataVisualPolarCoordinatesMapper.xml deleted file mode 100644 index d7e9c68e..00000000 --- a/src/com/sipai/mapper/process/DataVisualPolarCoordinatesMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, pid, colors, background, legend_position, max, radius, legend_fontSize, backgroundSt, - backgroundColor, roundCapSt, barWidth - - - - delete from tb_pro_dataVisual_polarCoordinates - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_polarCoordinates (id, pid, colors, - background, legend_position, max, - radius, legend_fontSize, backgroundSt, - backgroundColor, roundCapSt, barWidth - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{colors,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{legendPosition,jdbcType=VARCHAR}, #{max,jdbcType=VARCHAR}, - #{radius,jdbcType=VARCHAR}, #{legendFontsize,jdbcType=VARCHAR}, #{backgroundst,jdbcType=VARCHAR}, - #{backgroundcolor,jdbcType=VARCHAR}, #{roundcapst,jdbcType=VARCHAR}, #{barwidth,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_polarCoordinates - - - id, - - - pid, - - - colors, - - - background, - - - legend_position, - - - max, - - - radius, - - - legend_fontSize, - - - backgroundSt, - - - backgroundColor, - - - roundCapSt, - - - barWidth, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{colors,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{legendPosition,jdbcType=VARCHAR}, - - - #{max,jdbcType=VARCHAR}, - - - #{radius,jdbcType=VARCHAR}, - - - #{legendFontsize,jdbcType=VARCHAR}, - - - #{backgroundst,jdbcType=VARCHAR}, - - - #{backgroundcolor,jdbcType=VARCHAR}, - - - #{roundcapst,jdbcType=VARCHAR}, - - - #{barwidth,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_polarCoordinates - - - pid = #{pid,jdbcType=VARCHAR}, - - - colors = #{colors,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - legend_position = #{legendPosition,jdbcType=VARCHAR}, - - - max = #{max,jdbcType=VARCHAR}, - - - radius = #{radius,jdbcType=VARCHAR}, - - - legend_fontSize = #{legendFontsize,jdbcType=VARCHAR}, - - - backgroundSt = #{backgroundst,jdbcType=VARCHAR}, - - - backgroundColor = #{backgroundcolor,jdbcType=VARCHAR}, - - - roundCapSt = #{roundcapst,jdbcType=VARCHAR}, - - - barWidth = #{barwidth,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_polarCoordinates - set pid = #{pid,jdbcType=VARCHAR}, - colors = #{colors,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - legend_position = #{legendPosition,jdbcType=VARCHAR}, - max = #{max,jdbcType=VARCHAR}, - radius = #{radius,jdbcType=VARCHAR}, - legend_fontSize = #{legendFontsize,jdbcType=VARCHAR}, - backgroundSt = #{backgroundst,jdbcType=VARCHAR}, - backgroundColor = #{backgroundcolor,jdbcType=VARCHAR}, - roundCapSt = #{roundcapst,jdbcType=VARCHAR}, - barWidth = #{barwidth,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_polarCoordinates ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualPolarCoordinatesSeriesMapper.xml b/src/com/sipai/mapper/process/DataVisualPolarCoordinatesSeriesMapper.xml deleted file mode 100644 index b88d0a79..00000000 --- a/src/com/sipai/mapper/process/DataVisualPolarCoordinatesSeriesMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, pid, name, morder, mpid, fixedValue, valueMethod - - - - delete from tb_pro_dataVisual_polarCoordinates_series - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_polarCoordinates_series (id, pid, name, - morder, mpid, fixedValue, - valueMethod) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{mpid,jdbcType=VARCHAR}, #{fixedvalue,jdbcType=VARCHAR}, - #{valuemethod,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_polarCoordinates_series - - - id, - - - pid, - - - name, - - - morder, - - - mpid, - - - fixedValue, - - - valueMethod, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_polarCoordinates_series - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_polarCoordinates_series - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_polarCoordinates_series ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualProgressBarChartMapper.xml b/src/com/sipai/mapper/process/DataVisualProgressBarChartMapper.xml deleted file mode 100644 index ed0c61d6..00000000 --- a/src/com/sipai/mapper/process/DataVisualProgressBarChartMapper.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, background, mpid, text, dataColors, dataRadius, dataBarWidth, text_position, - text_color, text_fontSize, text_fontWeight, bkText, bkMpText, bkcolors, bkRadius, - bkBarWidth, valueMethod - - - - delete from tb_pro_dataVisual_progressBarChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_progressBarChart (id, pid, background, - mpid, text, dataColors, - dataRadius, dataBarWidth, text_position, - text_color, text_fontSize, text_fontWeight, - bkText, bkMpText, bkcolors, - bkRadius, bkBarWidth, valueMethod - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, #{datacolors,jdbcType=VARCHAR}, - #{dataradius,jdbcType=VARCHAR}, #{databarwidth,jdbcType=VARCHAR}, #{textPosition,jdbcType=VARCHAR}, - #{textColor,jdbcType=VARCHAR}, #{textFontsize,jdbcType=VARCHAR}, #{textFontweight,jdbcType=VARCHAR}, - #{bktext,jdbcType=VARCHAR}, #{bkmptext,jdbcType=VARCHAR}, #{bkcolors,jdbcType=VARCHAR}, - #{bkradius,jdbcType=VARCHAR}, #{bkbarwidth,jdbcType=VARCHAR}, #{valuemethod,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_progressBarChart - - - id, - - - pid, - - - background, - - - mpid, - - - text, - - - dataColors, - - - dataRadius, - - - dataBarWidth, - - - text_position, - - - text_color, - - - text_fontSize, - - - text_fontWeight, - - - bkText, - - - bkMpText, - - - bkcolors, - - - bkRadius, - - - bkBarWidth, - - - valueMethod, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{datacolors,jdbcType=VARCHAR}, - - - #{dataradius,jdbcType=VARCHAR}, - - - #{databarwidth,jdbcType=VARCHAR}, - - - #{textPosition,jdbcType=VARCHAR}, - - - #{textColor,jdbcType=VARCHAR}, - - - #{textFontsize,jdbcType=VARCHAR}, - - - #{textFontweight,jdbcType=VARCHAR}, - - - #{bktext,jdbcType=VARCHAR}, - - - #{bkmptext,jdbcType=VARCHAR}, - - - #{bkcolors,jdbcType=VARCHAR}, - - - #{bkradius,jdbcType=VARCHAR}, - - - #{bkbarwidth,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_progressBarChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - text = #{text,jdbcType=VARCHAR}, - - - dataColors = #{datacolors,jdbcType=VARCHAR}, - - - dataRadius = #{dataradius,jdbcType=VARCHAR}, - - - dataBarWidth = #{databarwidth,jdbcType=VARCHAR}, - - - text_position = #{textPosition,jdbcType=VARCHAR}, - - - text_color = #{textColor,jdbcType=VARCHAR}, - - - text_fontSize = #{textFontsize,jdbcType=VARCHAR}, - - - text_fontWeight = #{textFontweight,jdbcType=VARCHAR}, - - - bkText = #{bktext,jdbcType=VARCHAR}, - - - bkMpText = #{bkmptext,jdbcType=VARCHAR}, - - - bkcolors = #{bkcolors,jdbcType=VARCHAR}, - - - bkRadius = #{bkradius,jdbcType=VARCHAR}, - - - bkBarWidth = #{bkbarwidth,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_progressBarChart - set pid = #{pid,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - text = #{text,jdbcType=VARCHAR}, - dataColors = #{datacolors,jdbcType=VARCHAR}, - dataRadius = #{dataradius,jdbcType=VARCHAR}, - dataBarWidth = #{databarwidth,jdbcType=VARCHAR}, - text_position = #{textPosition,jdbcType=VARCHAR}, - text_color = #{textColor,jdbcType=VARCHAR}, - text_fontSize = #{textFontsize,jdbcType=VARCHAR}, - text_fontWeight = #{textFontweight,jdbcType=VARCHAR}, - bkText = #{bktext,jdbcType=VARCHAR}, - bkMpText = #{bkmptext,jdbcType=VARCHAR}, - bkcolors = #{bkcolors,jdbcType=VARCHAR}, - bkRadius = #{bkradius,jdbcType=VARCHAR}, - bkBarWidth = #{bkbarwidth,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_progressBarChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualRadarChartAxisMapper.xml b/src/com/sipai/mapper/process/DataVisualRadarChartAxisMapper.xml deleted file mode 100644 index 60db52c6..00000000 --- a/src/com/sipai/mapper/process/DataVisualRadarChartAxisMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - id - , pid, morder, name, max - - - - delete - from tb_pro_dataVisual_radarChart_axis - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_radarChart_axis (id, pid, morder, - name, max) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{max,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_radarChart_axis - - - id, - - - pid, - - - morder, - - - name, - - - max, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{max,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_radarChart_axis - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - max = #{max,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_radarChart_axis - set pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - max = #{max,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_radarChart_axis ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualRadarChartMapper.xml b/src/com/sipai/mapper/process/DataVisualRadarChartMapper.xml deleted file mode 100644 index c8f79f03..00000000 --- a/src/com/sipai/mapper/process/DataVisualRadarChartMapper.xml +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, colors, background, title_text, title_color, title_font_size, title_font_weight, - title_position, legend_position, radius, splitNumber, shape, axisNameFormatter, axisNameFont_size, - axisNameColor, axisNameFont_weight, splitAreaColors, axisLineColor, splitLineColor - - - - delete from tb_pro_dataVisual_radarChart - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_radarChart (id, pid, colors, - background, title_text, title_color, - title_font_size, title_font_weight, title_position, - legend_position, radius, splitNumber, - shape, axisNameFormatter, axisNameFont_size, - axisNameColor, axisNameFont_weight, splitAreaColors, - axisLineColor, splitLineColor) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{colors,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{titleText,jdbcType=VARCHAR}, #{titleColor,jdbcType=VARCHAR}, - #{titleFontSize,jdbcType=VARCHAR}, #{titleFontWeight,jdbcType=VARCHAR}, #{titlePosition,jdbcType=VARCHAR}, - #{legendPosition,jdbcType=VARCHAR}, #{radius,jdbcType=INTEGER}, #{splitnumber,jdbcType=INTEGER}, - #{shape,jdbcType=VARCHAR}, #{axisnameformatter,jdbcType=VARCHAR}, #{axisnamefontSize,jdbcType=VARCHAR}, - #{axisnamecolor,jdbcType=VARCHAR}, #{axisnamefontWeight,jdbcType=VARCHAR}, #{splitareacolors,jdbcType=VARCHAR}, - #{axislinecolor,jdbcType=VARCHAR}, #{splitlinecolor,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_radarChart - - - id, - - - pid, - - - colors, - - - background, - - - title_text, - - - title_color, - - - title_font_size, - - - title_font_weight, - - - title_position, - - - legend_position, - - - radius, - - - splitNumber, - - - shape, - - - axisNameFormatter, - - - axisNameFont_size, - - - axisNameColor, - - - axisNameFont_weight, - - - splitAreaColors, - - - axisLineColor, - - - splitLineColor, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{colors,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{titleText,jdbcType=VARCHAR}, - - - #{titleColor,jdbcType=VARCHAR}, - - - #{titleFontSize,jdbcType=VARCHAR}, - - - #{titleFontWeight,jdbcType=VARCHAR}, - - - #{titlePosition,jdbcType=VARCHAR}, - - - #{legendPosition,jdbcType=VARCHAR}, - - - #{radius,jdbcType=INTEGER}, - - - #{splitnumber,jdbcType=INTEGER}, - - - #{shape,jdbcType=VARCHAR}, - - - #{axisnameformatter,jdbcType=VARCHAR}, - - - #{axisnamefontSize,jdbcType=VARCHAR}, - - - #{axisnamecolor,jdbcType=VARCHAR}, - - - #{axisnamefontWeight,jdbcType=VARCHAR}, - - - #{splitareacolors,jdbcType=VARCHAR}, - - - #{axislinecolor,jdbcType=VARCHAR}, - - - #{splitlinecolor,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_radarChart - - - pid = #{pid,jdbcType=VARCHAR}, - - - colors = #{colors,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - title_text = #{titleText,jdbcType=VARCHAR}, - - - title_color = #{titleColor,jdbcType=VARCHAR}, - - - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - - - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - - - title_position = #{titlePosition,jdbcType=VARCHAR}, - - - legend_position = #{legendPosition,jdbcType=VARCHAR}, - - - radius = #{radius,jdbcType=INTEGER}, - - - splitNumber = #{splitnumber,jdbcType=INTEGER}, - - - shape = #{shape,jdbcType=VARCHAR}, - - - axisNameFormatter = #{axisnameformatter,jdbcType=VARCHAR}, - - - axisNameFont_size = #{axisnamefontSize,jdbcType=VARCHAR}, - - - axisNameColor = #{axisnamecolor,jdbcType=VARCHAR}, - - - axisNameFont_weight = #{axisnamefontWeight,jdbcType=VARCHAR}, - - - splitAreaColors = #{splitareacolors,jdbcType=VARCHAR}, - - - axisLineColor = #{axislinecolor,jdbcType=VARCHAR}, - - - splitLineColor = #{splitlinecolor,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_radarChart - set pid = #{pid,jdbcType=VARCHAR}, - colors = #{colors,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - title_text = #{titleText,jdbcType=VARCHAR}, - title_color = #{titleColor,jdbcType=VARCHAR}, - title_font_size = #{titleFontSize,jdbcType=VARCHAR}, - title_font_weight = #{titleFontWeight,jdbcType=VARCHAR}, - title_position = #{titlePosition,jdbcType=VARCHAR}, - legend_position = #{legendPosition,jdbcType=VARCHAR}, - radius = #{radius,jdbcType=INTEGER}, - splitNumber = #{splitnumber,jdbcType=INTEGER}, - shape = #{shape,jdbcType=VARCHAR}, - axisNameFormatter = #{axisnameformatter,jdbcType=VARCHAR}, - axisNameFont_size = #{axisnamefontSize,jdbcType=VARCHAR}, - axisNameColor = #{axisnamecolor,jdbcType=VARCHAR}, - axisNameFont_weight = #{axisnamefontWeight,jdbcType=VARCHAR}, - splitAreaColors = #{splitareacolors,jdbcType=VARCHAR}, - axisLineColor = #{axislinecolor,jdbcType=VARCHAR}, - splitLineColor = #{splitlinecolor,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_radarChart ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualRadarChartSeriesMapper.xml b/src/com/sipai/mapper/process/DataVisualRadarChartSeriesMapper.xml deleted file mode 100644 index fc00f1ef..00000000 --- a/src/com/sipai/mapper/process/DataVisualRadarChartSeriesMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, pid, morder, name, axisName, mpid, fixedValue, areaStyle, areaStyleColor, valueMethod - - - - delete from tb_pro_dataVisual_radarChart_series - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_radarChart_series (id, pid, morder, - name, axisName, mpid, - fixedValue, areaStyle, areaStyleColor, - valueMethod) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{axisname,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{fixedvalue,jdbcType=VARCHAR}, #{areastyle,jdbcType=VARCHAR}, #{areastylecolor,jdbcType=VARCHAR}, - #{valuemethod,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_radarChart_series - - - id, - - - pid, - - - morder, - - - name, - - - axisName, - - - mpid, - - - fixedValue, - - - areaStyle, - - - areaStyleColor, - - - valueMethod, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{axisname,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{areastyle,jdbcType=VARCHAR}, - - - #{areastylecolor,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_radarChart_series - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - axisName = #{axisname,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - areaStyle = #{areastyle,jdbcType=VARCHAR}, - - - areaStyleColor = #{areastylecolor,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_radarChart_series - set pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - axisName = #{axisname,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - areaStyle = #{areastyle,jdbcType=VARCHAR}, - areaStyleColor = #{areastylecolor,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_radarChart_series ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualSelectMapper.xml b/src/com/sipai/mapper/process/DataVisualSelectMapper.xml deleted file mode 100644 index 3fe55f2c..00000000 --- a/src/com/sipai/mapper/process/DataVisualSelectMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, pid, textContent, height, background, fontSize, fontColor, fontWeight, urlString, - style, morder - - - - delete from tb_pro_dataVisual_select - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_select (id, pid, textContent, - height, background, fontSize, - fontColor, fontWeight, urlString, - style, morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{textcontent,jdbcType=VARCHAR}, - #{height,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, #{fontsize,jdbcType=INTEGER}, - #{fontcolor,jdbcType=VARCHAR}, #{fontweight,jdbcType=INTEGER}, #{urlstring,jdbcType=VARCHAR}, - #{style,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_select - - - id, - - - pid, - - - textContent, - - - height, - - - background, - - - fontSize, - - - fontColor, - - - fontWeight, - - - urlString, - - - style, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{textcontent,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=INTEGER}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=INTEGER}, - - - #{urlstring,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_select - - - pid = #{pid,jdbcType=VARCHAR}, - - - textContent = #{textcontent,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=INTEGER}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=INTEGER}, - - - urlString = #{urlstring,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_select - set pid = #{pid,jdbcType=VARCHAR}, - textContent = #{textcontent,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=INTEGER}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=INTEGER}, - urlString = #{urlstring,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_select ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualSuspensionFrameMapper.xml b/src/com/sipai/mapper/process/DataVisualSuspensionFrameMapper.xml deleted file mode 100644 index 1c70c7ce..00000000 --- a/src/com/sipai/mapper/process/DataVisualSuspensionFrameMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, pid, textContent, fontSize, fontColor, fontWeight, background, style, textHeight, - textAlign, valueMethod, display - - - - delete from tb_pro_dataVisual_SuspensionFrame - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_SuspensionFrame (id, pid, textContent, - fontSize, fontColor, fontWeight, - background, style, textHeight, - textAlign, valueMethod, display - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{textcontent,jdbcType=VARCHAR}, - #{fontsize,jdbcType=INTEGER}, #{fontcolor,jdbcType=VARCHAR}, #{fontweight,jdbcType=INTEGER}, - #{background,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{textheight,jdbcType=VARCHAR}, - #{textalign,jdbcType=VARCHAR}, #{valuemethod,jdbcType=VARCHAR}, #{display,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_SuspensionFrame - - - id, - - - pid, - - - textContent, - - - fontSize, - - - fontColor, - - - fontWeight, - - - background, - - - style, - - - textHeight, - - - textAlign, - - - valueMethod, - - - display, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{textcontent,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=INTEGER}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=INTEGER}, - - - #{background,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{textheight,jdbcType=VARCHAR}, - - - #{textalign,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{display,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_SuspensionFrame - - - pid = #{pid,jdbcType=VARCHAR}, - - - textContent = #{textcontent,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=INTEGER}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=INTEGER}, - - - background = #{background,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - textHeight = #{textheight,jdbcType=VARCHAR}, - - - textAlign = #{textalign,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - display = #{display,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_SuspensionFrame - set pid = #{pid,jdbcType=VARCHAR}, - textContent = #{textcontent,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=INTEGER}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=INTEGER}, - background = #{background,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - textHeight = #{textheight,jdbcType=VARCHAR}, - textAlign = #{textalign,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - display = #{display,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_SuspensionFrame ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualSvgAlarmMapper.xml b/src/com/sipai/mapper/process/DataVisualSvgAlarmMapper.xml deleted file mode 100644 index 02f4d753..00000000 --- a/src/com/sipai/mapper/process/DataVisualSvgAlarmMapper.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - id - , pid, jsValue, jsMethod, stroke, fill, morder - - - - delete - from tb_pro_dataVisual_svg_alarm - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_svg_alarm (id, pid, jsValue, - jsMethod, stroke, fill, - morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{jsvalue,jdbcType=VARCHAR}, - #{jsmethod,jdbcType=VARCHAR}, #{stroke,jdbcType=VARCHAR}, #{fill,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_svg_alarm - - - id, - - - pid, - - - jsValue, - - - jsMethod, - - - stroke, - - - fill, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{jsvalue,jdbcType=VARCHAR}, - - - #{jsmethod,jdbcType=VARCHAR}, - - - #{stroke,jdbcType=VARCHAR}, - - - #{fill,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_svg_alarm - - - pid = #{pid,jdbcType=VARCHAR}, - - - jsValue = #{jsvalue,jdbcType=VARCHAR}, - - - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - - - stroke = #{stroke,jdbcType=VARCHAR}, - - - fill = #{fill,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_svg_alarm ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualSvgMapper.xml b/src/com/sipai/mapper/process/DataVisualSvgMapper.xml deleted file mode 100644 index f2f6aa42..00000000 --- a/src/com/sipai/mapper/process/DataVisualSvgMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, points, fill, stroke, stroke_width, pid, mq_theme, type, dashedLineType, dashedLine_1, - dashedLine_2 - - - - delete from tb_pro_dataVisual_svg - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_svg (id, points, fill, - stroke, stroke_width, pid, - mq_theme, type, dashedLineType, - dashedLine_1, dashedLine_2) - values (#{id,jdbcType=VARCHAR}, #{points,jdbcType=VARCHAR}, #{fill,jdbcType=VARCHAR}, - #{stroke,jdbcType=VARCHAR}, #{strokeWidth,jdbcType=DOUBLE}, #{pid,jdbcType=VARCHAR}, - #{mqTheme,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{dashedlinetype,jdbcType=VARCHAR}, - #{dashedline1,jdbcType=DOUBLE}, #{dashedline2,jdbcType=DOUBLE}) - - - insert into tb_pro_dataVisual_svg - - - id, - - - points, - - - fill, - - - stroke, - - - stroke_width, - - - pid, - - - mq_theme, - - - type, - - - dashedLineType, - - - dashedLine_1, - - - dashedLine_2, - - - - - #{id,jdbcType=VARCHAR}, - - - #{points,jdbcType=VARCHAR}, - - - #{fill,jdbcType=VARCHAR}, - - - #{stroke,jdbcType=VARCHAR}, - - - #{strokeWidth,jdbcType=DOUBLE}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mqTheme,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{dashedlinetype,jdbcType=VARCHAR}, - - - #{dashedline1,jdbcType=DOUBLE}, - - - #{dashedline2,jdbcType=DOUBLE}, - - - - - update tb_pro_dataVisual_svg - - - points = #{points,jdbcType=VARCHAR}, - - - fill = #{fill,jdbcType=VARCHAR}, - - - stroke = #{stroke,jdbcType=VARCHAR}, - - - stroke_width = #{strokeWidth,jdbcType=DOUBLE}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - mq_theme = #{mqTheme,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - dashedLineType = #{dashedlinetype,jdbcType=VARCHAR}, - - - dashedLine_1 = #{dashedline1,jdbcType=DOUBLE}, - - - dashedLine_2 = #{dashedline2,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_svg - set points = #{points,jdbcType=VARCHAR}, - fill = #{fill,jdbcType=VARCHAR}, - stroke = #{stroke,jdbcType=VARCHAR}, - stroke_width = #{strokeWidth,jdbcType=DOUBLE}, - pid = #{pid,jdbcType=VARCHAR}, - mq_theme = #{mqTheme,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - dashedLineType = #{dashedlinetype,jdbcType=VARCHAR}, - dashedLine_1 = #{dashedline1,jdbcType=DOUBLE}, - dashedLine_2 = #{dashedline2,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_svg ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualSwitchMapper.xml b/src/com/sipai/mapper/process/DataVisualSwitchMapper.xml deleted file mode 100644 index 78a3143d..00000000 --- a/src/com/sipai/mapper/process/DataVisualSwitchMapper.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, pid, show_style, openSt, type, url, url_type, url_width, url_height, subModal_name, - background, ck_color, ck_size, ck_style - - - - delete from tb_pro_dataVisual_switch - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_switch (id, pid, show_style, - openSt, type, url, - url_type, url_width, url_height, - subModal_name, background, ck_color, - ck_size, ck_style) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{showStyle,jdbcType=VARCHAR}, - #{openst,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{urlType,jdbcType=VARCHAR}, #{urlWidth,jdbcType=VARCHAR}, #{urlHeight,jdbcType=VARCHAR}, - #{submodalName,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR}, #{ckColor,jdbcType=VARCHAR}, - #{ckSize,jdbcType=VARCHAR}, #{ckStyle,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_switch - - - id, - - - pid, - - - show_style, - - - openSt, - - - type, - - - url, - - - url_type, - - - url_width, - - - url_height, - - - subModal_name, - - - background, - - - ck_color, - - - ck_size, - - - ck_style, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{showStyle,jdbcType=VARCHAR}, - - - #{openst,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{urlType,jdbcType=VARCHAR}, - - - #{urlWidth,jdbcType=VARCHAR}, - - - #{urlHeight,jdbcType=VARCHAR}, - - - #{submodalName,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{ckColor,jdbcType=VARCHAR}, - - - #{ckSize,jdbcType=VARCHAR}, - - - #{ckStyle,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_switch - - - pid = #{pid,jdbcType=VARCHAR}, - - - show_style = #{showStyle,jdbcType=VARCHAR}, - - - openSt = #{openst,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - url_type = #{urlType,jdbcType=VARCHAR}, - - - url_width = #{urlWidth,jdbcType=VARCHAR}, - - - url_height = #{urlHeight,jdbcType=VARCHAR}, - - - subModal_name = #{submodalName,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - ck_color = #{ckColor,jdbcType=VARCHAR}, - - - ck_size = #{ckSize,jdbcType=VARCHAR}, - - - ck_style = #{ckStyle,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_switch - set pid = #{pid,jdbcType=VARCHAR}, - show_style = #{showStyle,jdbcType=VARCHAR}, - openSt = #{openst,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - url_type = #{urlType,jdbcType=VARCHAR}, - url_width = #{urlWidth,jdbcType=VARCHAR}, - url_height = #{urlHeight,jdbcType=VARCHAR}, - subModal_name = #{submodalName,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - ck_color = #{ckColor,jdbcType=VARCHAR}, - ck_size = #{ckSize,jdbcType=VARCHAR}, - ck_style = #{ckStyle,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_switch ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualSwitchPointMapper.xml b/src/com/sipai/mapper/process/DataVisualSwitchPointMapper.xml deleted file mode 100644 index d0eb2a89..00000000 --- a/src/com/sipai/mapper/process/DataVisualSwitchPointMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - id - , pid, contentId - - - - delete - from tb_pro_dataVisual_switch_point - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_switch_point (id, pid, contentId) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{contentid,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_switch_point - - - id, - - - pid, - - - contentId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{contentid,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_switch_point - - - pid = #{pid,jdbcType=VARCHAR}, - - - contentId = #{contentid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_switch_point - set pid = #{pid,jdbcType=VARCHAR}, - contentId = #{contentid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_switch_point ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualTabMapper.xml b/src/com/sipai/mapper/process/DataVisualTabMapper.xml deleted file mode 100644 index 1245f2d7..00000000 --- a/src/com/sipai/mapper/process/DataVisualTabMapper.xml +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, text, ckbackground, ckfontSize, ckfontColor, ckfontWeight, cktext_align, - ckstyle, unckbackground, unckfontSize, unckfontColor, unckfontWeight, uncktext_align, - unckstyle, firstCk, width, height, morder, radio_background, radio_ck_background, - radio_size, radio_ck_size - - - - delete from tb_pro_dataVisual_tab - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_tab (id, pid, text, - ckbackground, ckfontSize, ckfontColor, - ckfontWeight, cktext_align, ckstyle, - unckbackground, unckfontSize, unckfontColor, - unckfontWeight, uncktext_align, unckstyle, - firstCk, width, height, - morder, radio_background, radio_ck_background, - radio_size, radio_ck_size) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, - #{ckbackground,jdbcType=VARCHAR}, #{ckfontsize,jdbcType=VARCHAR}, #{ckfontcolor,jdbcType=VARCHAR}, - #{ckfontweight,jdbcType=VARCHAR}, #{cktextAlign,jdbcType=VARCHAR}, #{ckstyle,jdbcType=VARCHAR}, - #{unckbackground,jdbcType=VARCHAR}, #{unckfontsize,jdbcType=VARCHAR}, #{unckfontcolor,jdbcType=VARCHAR}, - #{unckfontweight,jdbcType=VARCHAR}, #{uncktextAlign,jdbcType=VARCHAR}, #{unckstyle,jdbcType=VARCHAR}, - #{firstck,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{radioBackground,jdbcType=VARCHAR}, #{radioCkBackground,jdbcType=VARCHAR}, - #{radioSize,jdbcType=VARCHAR}, #{radioCkSize,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_tab - - - id, - - - pid, - - - text, - - - ckbackground, - - - ckfontSize, - - - ckfontColor, - - - ckfontWeight, - - - cktext_align, - - - ckstyle, - - - unckbackground, - - - unckfontSize, - - - unckfontColor, - - - unckfontWeight, - - - uncktext_align, - - - unckstyle, - - - firstCk, - - - width, - - - height, - - - morder, - - - radio_background, - - - radio_ck_background, - - - radio_size, - - - radio_ck_size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{ckbackground,jdbcType=VARCHAR}, - - - #{ckfontsize,jdbcType=VARCHAR}, - - - #{ckfontcolor,jdbcType=VARCHAR}, - - - #{ckfontweight,jdbcType=VARCHAR}, - - - #{cktextAlign,jdbcType=VARCHAR}, - - - #{ckstyle,jdbcType=VARCHAR}, - - - #{unckbackground,jdbcType=VARCHAR}, - - - #{unckfontsize,jdbcType=VARCHAR}, - - - #{unckfontcolor,jdbcType=VARCHAR}, - - - #{unckfontweight,jdbcType=VARCHAR}, - - - #{uncktextAlign,jdbcType=VARCHAR}, - - - #{unckstyle,jdbcType=VARCHAR}, - - - #{firstck,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{radioBackground,jdbcType=VARCHAR}, - - - #{radioCkBackground,jdbcType=VARCHAR}, - - - #{radioSize,jdbcType=VARCHAR}, - - - #{radioCkSize,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_tab - - - pid = #{pid,jdbcType=VARCHAR}, - - - text = #{text,jdbcType=VARCHAR}, - - - ckbackground = #{ckbackground,jdbcType=VARCHAR}, - - - ckfontSize = #{ckfontsize,jdbcType=VARCHAR}, - - - ckfontColor = #{ckfontcolor,jdbcType=VARCHAR}, - - - ckfontWeight = #{ckfontweight,jdbcType=VARCHAR}, - - - cktext_align = #{cktextAlign,jdbcType=VARCHAR}, - - - ckstyle = #{ckstyle,jdbcType=VARCHAR}, - - - unckbackground = #{unckbackground,jdbcType=VARCHAR}, - - - unckfontSize = #{unckfontsize,jdbcType=VARCHAR}, - - - unckfontColor = #{unckfontcolor,jdbcType=VARCHAR}, - - - unckfontWeight = #{unckfontweight,jdbcType=VARCHAR}, - - - uncktext_align = #{uncktextAlign,jdbcType=VARCHAR}, - - - unckstyle = #{unckstyle,jdbcType=VARCHAR}, - - - firstCk = #{firstck,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - radio_background = #{radioBackground,jdbcType=VARCHAR}, - - - radio_ck_background = #{radioCkBackground,jdbcType=VARCHAR}, - - - radio_size = #{radioSize,jdbcType=VARCHAR}, - - - radio_ck_size = #{radioCkSize,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_tab - set pid = #{pid,jdbcType=VARCHAR}, - text = #{text,jdbcType=VARCHAR}, - ckbackground = #{ckbackground,jdbcType=VARCHAR}, - ckfontSize = #{ckfontsize,jdbcType=VARCHAR}, - ckfontColor = #{ckfontcolor,jdbcType=VARCHAR}, - ckfontWeight = #{ckfontweight,jdbcType=VARCHAR}, - cktext_align = #{cktextAlign,jdbcType=VARCHAR}, - ckstyle = #{ckstyle,jdbcType=VARCHAR}, - unckbackground = #{unckbackground,jdbcType=VARCHAR}, - unckfontSize = #{unckfontsize,jdbcType=VARCHAR}, - unckfontColor = #{unckfontcolor,jdbcType=VARCHAR}, - unckfontWeight = #{unckfontweight,jdbcType=VARCHAR}, - uncktext_align = #{uncktextAlign,jdbcType=VARCHAR}, - unckstyle = #{unckstyle,jdbcType=VARCHAR}, - firstCk = #{firstck,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - radio_background = #{radioBackground,jdbcType=VARCHAR}, - radio_ck_background = #{radioCkBackground,jdbcType=VARCHAR}, - radio_size = #{radioSize,jdbcType=VARCHAR}, - radio_ck_size = #{radioCkSize,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_tab ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualTaskPointsMapper.xml b/src/com/sipai/mapper/process/DataVisualTaskPointsMapper.xml deleted file mode 100644 index 7cfcbec4..00000000 --- a/src/com/sipai/mapper/process/DataVisualTaskPointsMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - id - , taskId, pid, mq_theme - - - - delete - from tb_pro_dataVisual_taskPoints - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_taskPoints (id, taskId, pid, - mq_theme) - values (#{id,jdbcType=VARCHAR}, #{taskid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{mqTheme,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_taskPoints - - - id, - - - taskId, - - - pid, - - - mq_theme, - - - - - #{id,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mqTheme,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_taskPoints - - - taskId = #{taskid,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - mq_theme = #{mqTheme,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_taskPoints - set taskId = #{taskid,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - mq_theme = #{mqTheme,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_dataVisual_taskPoints ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualTextMapper.xml b/src/com/sipai/mapper/process/DataVisualTextMapper.xml deleted file mode 100644 index 9168545c..00000000 --- a/src/com/sipai/mapper/process/DataVisualTextMapper.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, textContent, mpid, unitSt, fontSize, fontColor, fontWeight, background, - style, clickName, clickParameter, textHeight, textAlign, valueMethod, rate, urlData, - numTail, chartMpids, roundtimeId, urlString - - - - delete from tb_pro_dataVisual_text - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_text (id, pid, textContent, - mpid, unitSt, fontSize, - fontColor, fontWeight, background, - style, clickName, clickParameter, - textHeight, textAlign, valueMethod, - rate, urlData, numTail, - chartMpids, roundtimeId, urlString - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{textcontent,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{unitst,jdbcType=VARCHAR}, #{fontsize,jdbcType=INTEGER}, - #{fontcolor,jdbcType=VARCHAR}, #{fontweight,jdbcType=INTEGER}, #{background,jdbcType=VARCHAR}, - #{style,jdbcType=VARCHAR}, #{clickname,jdbcType=VARCHAR}, #{clickparameter,jdbcType=VARCHAR}, - #{textheight,jdbcType=VARCHAR}, #{textalign,jdbcType=VARCHAR}, #{valuemethod,jdbcType=VARCHAR}, - #{rate,jdbcType=VARCHAR}, #{urldata,jdbcType=VARCHAR}, #{numtail,jdbcType=VARCHAR}, - #{chartmpids,jdbcType=VARCHAR}, #{roundtimeid,jdbcType=VARCHAR}, #{urlstring,jdbcType=VARCHAR} - ) - - - insert into tb_pro_dataVisual_text - - - id, - - - pid, - - - textContent, - - - mpid, - - - unitSt, - - - fontSize, - - - fontColor, - - - fontWeight, - - - background, - - - style, - - - clickName, - - - clickParameter, - - - textHeight, - - - textAlign, - - - valueMethod, - - - rate, - - - urlData, - - - numTail, - - - chartMpids, - - - roundtimeId, - - - urlString, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{textcontent,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{unitst,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=INTEGER}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=INTEGER}, - - - #{background,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{clickname,jdbcType=VARCHAR}, - - - #{clickparameter,jdbcType=VARCHAR}, - - - #{textheight,jdbcType=VARCHAR}, - - - #{textalign,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{rate,jdbcType=VARCHAR}, - - - #{urldata,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=VARCHAR}, - - - #{chartmpids,jdbcType=VARCHAR}, - - - #{roundtimeid,jdbcType=VARCHAR}, - - - #{urlstring,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_text - - - pid = #{pid,jdbcType=VARCHAR}, - - - textContent = #{textcontent,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - unitSt = #{unitst,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=INTEGER}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=INTEGER}, - - - background = #{background,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - clickName = #{clickname,jdbcType=VARCHAR}, - - - clickParameter = #{clickparameter,jdbcType=VARCHAR}, - - - textHeight = #{textheight,jdbcType=VARCHAR}, - - - textAlign = #{textalign,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - rate = #{rate,jdbcType=VARCHAR}, - - - urlData = #{urldata,jdbcType=VARCHAR}, - - - numTail = #{numtail,jdbcType=VARCHAR}, - - - chartMpids = #{chartmpids,jdbcType=VARCHAR}, - - - roundtimeId = #{roundtimeid,jdbcType=VARCHAR}, - - - urlString = #{urlstring,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_text - set pid = #{pid,jdbcType=VARCHAR}, - textContent = #{textcontent,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - unitSt = #{unitst,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=INTEGER}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=INTEGER}, - background = #{background,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - clickName = #{clickname,jdbcType=VARCHAR}, - clickParameter = #{clickparameter,jdbcType=VARCHAR}, - textHeight = #{textheight,jdbcType=VARCHAR}, - textAlign = #{textalign,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - rate = #{rate,jdbcType=VARCHAR}, - urlData = #{urldata,jdbcType=VARCHAR}, - numTail = #{numtail,jdbcType=VARCHAR}, - chartMpids = #{chartmpids,jdbcType=VARCHAR}, - roundtimeId = #{roundtimeid,jdbcType=VARCHAR}, - urlString = #{urlstring,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_text - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualTextWarehouseMapper.xml b/src/com/sipai/mapper/process/DataVisualTextWarehouseMapper.xml deleted file mode 100644 index 8dd5ce4a..00000000 --- a/src/com/sipai/mapper/process/DataVisualTextWarehouseMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, fontSize, fontColor, fontWeight, background, width, height, style, morder - - - - delete from tb_pro_dataVisual_text_warehouse - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_text_warehouse (id, name, fontSize, - fontColor, fontWeight, background, - width, height, style, - morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{fontsize,jdbcType=INTEGER}, - #{fontcolor,jdbcType=VARCHAR}, #{fontweight,jdbcType=INTEGER}, #{background,jdbcType=VARCHAR}, - #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_pro_dataVisual_text_warehouse - - - id, - - - name, - - - fontSize, - - - fontColor, - - - fontWeight, - - - background, - - - width, - - - height, - - - style, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=INTEGER}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=INTEGER}, - - - #{background,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_pro_dataVisual_text_warehouse - - - name = #{name,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=INTEGER}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=INTEGER}, - - - background = #{background,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_text_warehouse - set name = #{name,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=INTEGER}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=INTEGER}, - background = #{background,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_text_warehouse - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualVoiceMapper.xml b/src/com/sipai/mapper/process/DataVisualVoiceMapper.xml deleted file mode 100644 index 5680209e..00000000 --- a/src/com/sipai/mapper/process/DataVisualVoiceMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, pid, text, method - - - - delete from tb_pro_dataVisual_voice - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_voice (id, pid, text, - method) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, - #{method,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_voice - - - id, - - - pid, - - - text, - - - method, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_voice - - - pid = #{pid,jdbcType=VARCHAR}, - - - text = #{text,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_voice - set pid = #{pid,jdbcType=VARCHAR}, - text = #{text,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_dataVisual_voice - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DataVisualWeatherMapper.xml b/src/com/sipai/mapper/process/DataVisualWeatherMapper.xml deleted file mode 100644 index 221301eb..00000000 --- a/src/com/sipai/mapper/process/DataVisualWeatherMapper.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - id - , pid, type, background, fontSize, fontColor, fontWeight, styleType, text_align - - - - delete - from tb_pro_dataVisual_weather - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_dataVisual_weather (id, pid, type, - background, fontSize, fontColor, - fontWeight, styleType, text_align) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{background,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, #{fontcolor,jdbcType=VARCHAR}, - #{fontweight,jdbcType=VARCHAR}, #{styletype,jdbcType=VARCHAR}, #{textAlign,jdbcType=VARCHAR}) - - - insert into tb_pro_dataVisual_weather - - - id, - - - pid, - - - type, - - - background, - - - fontSize, - - - fontColor, - - - fontWeight, - - - styleType, - - - text_align, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{background,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{styletype,jdbcType=VARCHAR}, - - - #{textAlign,jdbcType=VARCHAR}, - - - - - update tb_pro_dataVisual_weather - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - background = #{background,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - styleType = #{styletype,jdbcType=VARCHAR}, - - - text_align = #{textAlign,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_dataVisual_weather - set pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - background = #{background,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - styleType = #{styletype,jdbcType=VARCHAR}, - text_align = #{textAlign,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_pro_dataVisual_weather ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DecisionExpertBaseMapper.xml b/src/com/sipai/mapper/process/DecisionExpertBaseMapper.xml deleted file mode 100644 index 74a2ff20..00000000 --- a/src/com/sipai/mapper/process/DecisionExpertBaseMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, pid, name, morder, type, unitId, mpid, mainRole - - - - delete from tb_pro_decisionExpertBase - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_decisionExpertBase (id, pid, name, - morder, type, unitId, - mpid, mainRole) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{mainrole,jdbcType=VARCHAR}) - - - insert into tb_pro_decisionExpertBase - - - id, - - - pid, - - - name, - - - morder, - - - type, - - - unitId, - - - mpid, - - - mainRole, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mainrole,jdbcType=VARCHAR}, - - - - - update tb_pro_decisionExpertBase - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mainRole = #{mainrole,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_decisionExpertBase - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mainRole = #{mainrole,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_decisionExpertBase ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/DecisionExpertBaseTextMapper.xml b/src/com/sipai/mapper/process/DecisionExpertBaseTextMapper.xml deleted file mode 100644 index 463daacb..00000000 --- a/src/com/sipai/mapper/process/DecisionExpertBaseTextMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - id - , pid, text, type - - - - delete - from tb_pro_decisionExpertBase_text - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_decisionExpertBase_text (id, pid, text, - type) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_pro_decisionExpertBase_text - - - id, - - - pid, - - - text, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_pro_decisionExpertBase_text - - - pid = #{pid,jdbcType=VARCHAR}, - - - text = #{text,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_decisionExpertBase_text - set pid = #{pid,jdbcType=VARCHAR}, - text = #{text,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_pro_decisionExpertBase_text ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/EquipmentAdjustmentDetailMapper.xml b/src/com/sipai/mapper/process/EquipmentAdjustmentDetailMapper.xml deleted file mode 100644 index 682cf023..00000000 --- a/src/com/sipai/mapper/process/EquipmentAdjustmentDetailMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, insuser, convert(varchar(19),insdt,20) as insdt, equipment_id, adjust_mode, adjust_value, pid, status - - - - delete from tb_process_equipment_adjustment_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_equipment_adjustment_detail (id, insuser, insdt, - equipment_id, adjust_mode, adjust_value, - pid, status) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{equipmentId,jdbcType=VARCHAR}, #{adjustMode,jdbcType=VARCHAR}, #{adjustValue,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}) - - - insert into tb_process_equipment_adjustment_detail - - - id, - - - insuser, - - - insdt, - - - equipment_id, - - - adjust_mode, - - - adjust_value, - - - pid, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{adjustMode,jdbcType=VARCHAR}, - - - #{adjustValue,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - - - update tb_process_equipment_adjustment_detail - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - adjust_mode = #{adjustMode,jdbcType=VARCHAR}, - - - adjust_value = #{adjustValue,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_equipment_adjustment_detail - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - adjust_mode = #{adjustMode,jdbcType=VARCHAR}, - adjust_value = #{adjustValue,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_process_equipment_adjustment_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/EquipmentAdjustmentMapper.xml b/src/com/sipai/mapper/process/EquipmentAdjustmentMapper.xml deleted file mode 100644 index b9a529ff..00000000 --- a/src/com/sipai/mapper/process/EquipmentAdjustmentMapper.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, unit_id, apply_user, apply_time, apply_content, feedback_user, - feedback_time, feedback_content, status, processId, processDefId - - - - delete from tb_process_equipment_adjustment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_equipment_adjustment (id, insuser, insdt, - unit_id, apply_user, apply_time, - apply_content, feedback_user, feedback_time, - feedback_content, status, processId, - processDefId) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{unitId,jdbcType=VARCHAR}, #{applyUser,jdbcType=VARCHAR}, #{applyTime,jdbcType=TIMESTAMP}, - #{applyContent,jdbcType=VARCHAR}, #{feedbackUser,jdbcType=VARCHAR}, #{feedbackTime,jdbcType=TIMESTAMP}, - #{feedbackContent,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}) - - - insert into tb_process_equipment_adjustment - - - id, - - - insuser, - - - insdt, - - - unit_id, - - - apply_user, - - - apply_time, - - - apply_content, - - - feedback_user, - - - feedback_time, - - - feedback_content, - - - status, - - - processId, - - - processDefId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{applyUser,jdbcType=VARCHAR}, - - - #{applyTime,jdbcType=TIMESTAMP}, - - - #{applyContent,jdbcType=VARCHAR}, - - - #{feedbackUser,jdbcType=VARCHAR}, - - - #{feedbackTime,jdbcType=TIMESTAMP}, - - - #{feedbackContent,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - - - update tb_process_equipment_adjustment - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - apply_user = #{applyUser,jdbcType=VARCHAR}, - - - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - - - apply_content = #{applyContent,jdbcType=VARCHAR}, - - - feedback_user = #{feedbackUser,jdbcType=VARCHAR}, - - - feedback_time = #{feedbackTime,jdbcType=TIMESTAMP}, - - - feedback_content = #{feedbackContent,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_equipment_adjustment - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR}, - apply_user = #{applyUser,jdbcType=VARCHAR}, - apply_time = #{applyTime,jdbcType=TIMESTAMP}, - apply_content = #{applyContent,jdbcType=VARCHAR}, - feedback_user = #{feedbackUser,jdbcType=VARCHAR}, - feedback_time = #{feedbackTime,jdbcType=TIMESTAMP}, - feedback_content = #{feedbackContent,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_equipment_adjustment - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryProcessAbnormalMapper.xml b/src/com/sipai/mapper/process/LibraryProcessAbnormalMapper.xml deleted file mode 100644 index 05b312e3..00000000 --- a/src/com/sipai/mapper/process/LibraryProcessAbnormalMapper.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - id, abnormal_code, abnormal_name, abnormal_analysis, insdt, insuser, unit_id, pid - - - - delete from tb_library_process_abnormal - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_process_abnormal (id, abnormal_code, abnormal_name, - abnormal_analysis, insdt, insuser, - unit_id, pid) - values (#{id,jdbcType=VARCHAR}, #{abnormalCode,jdbcType=VARCHAR}, #{abnormalName,jdbcType=VARCHAR}, - #{abnormalAnalysis,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}) - - - insert into tb_library_process_abnormal - - - id, - - - abnormal_code, - - - abnormal_name, - - - abnormal_analysis, - - - insdt, - - - insuser, - - - unit_id, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{abnormalCode,jdbcType=VARCHAR}, - - - #{abnormalName,jdbcType=VARCHAR}, - - - #{abnormalAnalysis,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_library_process_abnormal - - - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - - - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - - - abnormal_analysis = #{abnormalAnalysis,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_process_abnormal - set abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - abnormal_analysis = #{abnormalAnalysis,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_process_abnormal - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryProcessAdjustmentMapper.xml b/src/com/sipai/mapper/process/LibraryProcessAdjustmentMapper.xml deleted file mode 100644 index e9a359ea..00000000 --- a/src/com/sipai/mapper/process/LibraryProcessAdjustmentMapper.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, pid, abnormal_code, abnormal_name, abnormal_analysis, pro_code, pro_name, - pro_measures_code, pro_measures, monitor_target, check_standard, receive_rated_time, - insdt, insuser, unit_id - - - - delete from tb_library_process_adjustment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_process_adjustment (id, pid, abnormal_code, - abnormal_name, abnormal_analysis, pro_code, - pro_name, pro_measures_code, pro_measures, - monitor_target, check_standard, receive_rated_time, - insdt, insuser, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{abnormalCode,jdbcType=VARCHAR}, - #{abnormalName,jdbcType=VARCHAR}, #{abnormalAnalysis,jdbcType=VARCHAR}, #{proCode,jdbcType=VARCHAR}, - #{proName,jdbcType=VARCHAR}, #{proMeasuresCode,jdbcType=VARCHAR}, #{proMeasures,jdbcType=VARCHAR}, - #{monitorTarget,jdbcType=VARCHAR}, #{checkStandard,jdbcType=VARCHAR}, #{receiveRatedTime,jdbcType=DECIMAL}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_library_process_adjustment - - - id, - - - pid, - - - abnormal_code, - - - abnormal_name, - - - abnormal_analysis, - - - pro_code, - - - pro_name, - - - pro_measures_code, - - - pro_measures, - - - monitor_target, - - - check_standard, - - - receive_rated_time, - - - insdt, - - - insuser, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{abnormalCode,jdbcType=VARCHAR}, - - - #{abnormalName,jdbcType=VARCHAR}, - - - #{abnormalAnalysis,jdbcType=VARCHAR}, - - - #{proCode,jdbcType=VARCHAR}, - - - #{proName,jdbcType=VARCHAR}, - - - #{proMeasuresCode,jdbcType=VARCHAR}, - - - #{proMeasures,jdbcType=VARCHAR}, - - - #{monitorTarget,jdbcType=VARCHAR}, - - - #{checkStandard,jdbcType=VARCHAR}, - - - #{receiveRatedTime,jdbcType=DECIMAL}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_library_process_adjustment - - - pid = #{pid,jdbcType=VARCHAR}, - - - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - - - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - - - abnormal_analysis = #{abnormalAnalysis,jdbcType=VARCHAR}, - - - pro_code = #{proCode,jdbcType=VARCHAR}, - - - pro_name = #{proName,jdbcType=VARCHAR}, - - - pro_measures_code = #{proMeasuresCode,jdbcType=VARCHAR}, - - - pro_measures = #{proMeasures,jdbcType=VARCHAR}, - - - monitor_target = #{monitorTarget,jdbcType=VARCHAR}, - - - check_standard = #{checkStandard,jdbcType=VARCHAR}, - - - receive_rated_time = #{receiveRatedTime,jdbcType=DECIMAL}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_process_adjustment - set pid = #{pid,jdbcType=VARCHAR}, - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - abnormal_analysis = #{abnormalAnalysis,jdbcType=VARCHAR}, - pro_code = #{proCode,jdbcType=VARCHAR}, - pro_name = #{proName,jdbcType=VARCHAR}, - pro_measures_code = #{proMeasuresCode,jdbcType=VARCHAR}, - pro_measures = #{proMeasures,jdbcType=VARCHAR}, - monitor_target = #{monitorTarget,jdbcType=VARCHAR}, - check_standard = #{checkStandard,jdbcType=VARCHAR}, - receive_rated_time = #{receiveRatedTime,jdbcType=DECIMAL}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_process_adjustment - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryProcessManageDetailMapper.xml b/src/com/sipai/mapper/process/LibraryProcessManageDetailMapper.xml deleted file mode 100644 index 873316c7..00000000 --- a/src/com/sipai/mapper/process/LibraryProcessManageDetailMapper.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - id, code, pid, measure_point_id, evaluation_rules, selection_method, morder - - - - delete from tb_library_process_manage_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_process_manage_detail (id, code, pid, - measure_point_id, evaluation_rules, selection_method, - morder) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{measurePointId,jdbcType=VARCHAR}, #{evaluationRules,jdbcType=VARCHAR}, #{selectionMethod,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_library_process_manage_detail - - - id, - - - code, - - - pid, - - - measure_point_id, - - - evaluation_rules, - - - selection_method, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{measurePointId,jdbcType=VARCHAR}, - - - #{evaluationRules,jdbcType=VARCHAR}, - - - #{selectionMethod,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_library_process_manage_detail - - - code = #{code,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - - - evaluation_rules = #{evaluationRules,jdbcType=VARCHAR}, - - - selection_method = #{selectionMethod,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_process_manage_detail - set code = #{code,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - evaluation_rules = #{evaluationRules,jdbcType=VARCHAR}, - selection_method = #{selectionMethod,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_process_manage_detail - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryProcessManageMapper.xml b/src/com/sipai/mapper/process/LibraryProcessManageMapper.xml deleted file mode 100644 index b3c63fb9..00000000 --- a/src/com/sipai/mapper/process/LibraryProcessManageMapper.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, cycle, code, name, area, unit, mpid, max_value, min_value, target_value, control_logic, - base_hours, remarks, unit_id, status - - - - delete from tb_library_process_manage - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_process_manage (id, cycle, code, - name, area, unit, mpid, - max_value, min_value, target_value, - control_logic, base_hours, remarks, - unit_id, status) - values (#{id,jdbcType=VARCHAR}, #{cycle,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{maxValue,jdbcType=DOUBLE}, #{minValue,jdbcType=DOUBLE}, #{targetValue,jdbcType=DOUBLE}, - #{controlLogic,jdbcType=VARCHAR}, #{baseHours,jdbcType=DOUBLE}, #{remarks,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}) - - - insert into tb_library_process_manage - - - id, - - - cycle, - - - code, - - - name, - - - area, - - - unit, - - - mpid, - - - max_value, - - - min_value, - - - target_value, - - - control_logic, - - - base_hours, - - - remarks, - - - unit_id, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{area,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{maxValue,jdbcType=DOUBLE}, - - - #{minValue,jdbcType=DOUBLE}, - - - #{targetValue,jdbcType=DOUBLE}, - - - #{controlLogic,jdbcType=VARCHAR}, - - - #{baseHours,jdbcType=DOUBLE}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - - - update tb_library_process_manage - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - area = #{area,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - max_value = #{maxValue,jdbcType=DOUBLE}, - - - min_value = #{minValue,jdbcType=DOUBLE}, - - - target_value = #{targetValue,jdbcType=DOUBLE}, - - - control_logic = #{controlLogic,jdbcType=VARCHAR}, - - - base_hours = #{baseHours,jdbcType=DOUBLE}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_process_manage - set cycle = #{cycle,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - area = #{area,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - max_value = #{maxValue,jdbcType=DOUBLE}, - min_value = #{minValue,jdbcType=DOUBLE}, - target_value = #{targetValue,jdbcType=DOUBLE}, - control_logic = #{controlLogic,jdbcType=VARCHAR}, - base_hours = #{baseHours,jdbcType=DOUBLE}, - remarks = #{remarks,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_process_manage - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryProcessManageTypeMapper.xml b/src/com/sipai/mapper/process/LibraryProcessManageTypeMapper.xml deleted file mode 100644 index 1bc6fe10..00000000 --- a/src/com/sipai/mapper/process/LibraryProcessManageTypeMapper.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, status, code, unit_id, morder, insuser, insdt, upsuser, upsdt - - - - delete from tb_library_process_manage_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_process_manage_type (id, name, status, - code, unit_id, morder, - insuser, insdt, upsuser, - upsdt) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}) - - - insert into tb_library_process_manage_type - - - id, - - - name, - - - status, - - - code, - - - unit_id, - - - morder, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_library_process_manage_type - - - name = #{name,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_process_manage_type - set name = #{name,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_process_manage_type - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryProcessManageWorkOrderMapper.xml b/src/com/sipai/mapper/process/LibraryProcessManageWorkOrderMapper.xml deleted file mode 100644 index facc2011..00000000 --- a/src/com/sipai/mapper/process/LibraryProcessManageWorkOrderMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, warehouse_id, insdt, insuser, unit_id, status, IssuedTime, Issueder, reviewTime, - reviewer, true_value, control_measures, true_hours - - - - delete from tb_library_process_manage_workOrder - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_process_manage_workOrder (id, warehouse_id, insdt, - insuser, unit_id, status, - IssuedTime, Issueder, reviewTime, - reviewer, true_value, control_measures, - true_hours) - values (#{id,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{issuedtime,jdbcType=TIMESTAMP}, #{issueder,jdbcType=VARCHAR}, #{reviewtime,jdbcType=TIMESTAMP}, - #{reviewer,jdbcType=VARCHAR}, #{trueValue,jdbcType=DOUBLE}, #{controlMeasures,jdbcType=VARCHAR}, - #{trueHours,jdbcType=DOUBLE}) - - - insert into tb_library_process_manage_workOrder - - - id, - - - warehouse_id, - - - insdt, - - - insuser, - - - unit_id, - - - status, - - - IssuedTime, - - - Issueder, - - - reviewTime, - - - reviewer, - - - true_value, - - - control_measures, - - - true_hours, - - - - - #{id,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{issuedtime,jdbcType=TIMESTAMP}, - - - #{issueder,jdbcType=VARCHAR}, - - - #{reviewtime,jdbcType=TIMESTAMP}, - - - #{reviewer,jdbcType=VARCHAR}, - - - #{trueValue,jdbcType=DOUBLE}, - - - #{controlMeasures,jdbcType=VARCHAR}, - - - #{trueHours,jdbcType=DOUBLE}, - - - - - update tb_library_process_manage_workOrder - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - IssuedTime = #{issuedtime,jdbcType=TIMESTAMP}, - - - Issueder = #{issueder,jdbcType=VARCHAR}, - - - reviewTime = #{reviewtime,jdbcType=TIMESTAMP}, - - - reviewer = #{reviewer,jdbcType=VARCHAR}, - - - true_value = #{trueValue,jdbcType=DOUBLE}, - - - control_measures = #{controlMeasures,jdbcType=VARCHAR}, - - - true_hours = #{trueHours,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_process_manage_workOrder - set warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - IssuedTime = #{issuedtime,jdbcType=TIMESTAMP}, - Issueder = #{issueder,jdbcType=VARCHAR}, - reviewTime = #{reviewtime,jdbcType=TIMESTAMP}, - reviewer = #{reviewer,jdbcType=VARCHAR}, - true_value = #{trueValue,jdbcType=DOUBLE}, - control_measures = #{controlMeasures,jdbcType=VARCHAR}, - true_hours = #{trueHours,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_library_process_manage_workOrder - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryRoutineWorkMapper.xml b/src/com/sipai/mapper/process/LibraryRoutineWorkMapper.xml deleted file mode 100644 index 945c8c72..00000000 --- a/src/com/sipai/mapper/process/LibraryRoutineWorkMapper.xml +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, unit_id, morder, position_type_code, position_type, work_type_code, - work_type_name, work_code, work_name, work_content, evaluation_criterion, work_frequency_type, - work_start_time, base_hours, base_cost, need_people, skill_level, rob_workorder, - remarks, type, day_register, week_register, week_interval, month_register - - - - delete from tb_library_routine_work - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_routine_work (id, insdt, insuser, - unit_id, morder, position_type_code, - position_type, work_type_code, work_type_name, - work_code, work_name, work_content, - evaluation_criterion, work_frequency_type, - work_start_time, base_hours, base_cost, - need_people, skill_level, rob_workorder, - remarks, type, day_register, - week_register, week_interval, month_register - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{positionTypeCode,jdbcType=VARCHAR}, - #{positionType,jdbcType=VARCHAR}, #{workTypeCode,jdbcType=VARCHAR}, #{workTypeName,jdbcType=VARCHAR}, - #{workCode,jdbcType=VARCHAR}, #{workName,jdbcType=VARCHAR}, #{workContent,jdbcType=VARCHAR}, - #{evaluationCriterion,jdbcType=VARCHAR}, #{workFrequencyType,jdbcType=VARCHAR}, - #{workStartTime,jdbcType=VARCHAR}, #{baseHours,jdbcType=DECIMAL}, #{baseCost,jdbcType=DECIMAL}, - #{needPeople,jdbcType=INTEGER}, #{skillLevel,jdbcType=VARCHAR}, #{robWorkorder,jdbcType=VARCHAR}, - #{remarks,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{dayRegister,jdbcType=VARCHAR}, - #{weekRegister,jdbcType=VARCHAR}, #{weekInterval,jdbcType=INTEGER}, #{monthRegister,jdbcType=VARCHAR} - ) - - - insert into tb_library_routine_work - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - morder, - - - position_type_code, - - - position_type, - - - work_type_code, - - - work_type_name, - - - work_code, - - - work_name, - - - work_content, - - - evaluation_criterion, - - - work_frequency_type, - - - work_start_time, - - - base_hours, - - - base_cost, - - - need_people, - - - skill_level, - - - rob_workorder, - - - remarks, - - - type, - - - day_register, - - - week_register, - - - week_interval, - - - month_register, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{positionTypeCode,jdbcType=VARCHAR}, - - - #{positionType,jdbcType=VARCHAR}, - - - #{workTypeCode,jdbcType=VARCHAR}, - - - #{workTypeName,jdbcType=VARCHAR}, - - - #{workCode,jdbcType=VARCHAR}, - - - #{workName,jdbcType=VARCHAR}, - - - #{workContent,jdbcType=VARCHAR}, - - - #{evaluationCriterion,jdbcType=VARCHAR}, - - - #{workFrequencyType,jdbcType=VARCHAR}, - - - #{workStartTime,jdbcType=VARCHAR}, - - - #{baseHours,jdbcType=DECIMAL}, - - - #{baseCost,jdbcType=DECIMAL}, - - - #{needPeople,jdbcType=INTEGER}, - - - #{skillLevel,jdbcType=VARCHAR}, - - - #{robWorkorder,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{dayRegister,jdbcType=VARCHAR}, - - - #{weekRegister,jdbcType=VARCHAR}, - - - #{weekInterval,jdbcType=INTEGER}, - - - #{monthRegister,jdbcType=VARCHAR}, - - - - - update tb_library_routine_work - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - position_type_code = #{positionTypeCode,jdbcType=VARCHAR}, - - - position_type = #{positionType,jdbcType=VARCHAR}, - - - work_type_code = #{workTypeCode,jdbcType=VARCHAR}, - - - work_type_name = #{workTypeName,jdbcType=VARCHAR}, - - - work_code = #{workCode,jdbcType=VARCHAR}, - - - work_name = #{workName,jdbcType=VARCHAR}, - - - work_content = #{workContent,jdbcType=VARCHAR}, - - - evaluation_criterion = #{evaluationCriterion,jdbcType=VARCHAR}, - - - work_frequency_type = #{workFrequencyType,jdbcType=VARCHAR}, - - - work_start_time = #{workStartTime,jdbcType=VARCHAR}, - - - base_hours = #{baseHours,jdbcType=DECIMAL}, - - - base_cost = #{baseCost,jdbcType=DECIMAL}, - - - need_people = #{needPeople,jdbcType=INTEGER}, - - - skill_level = #{skillLevel,jdbcType=VARCHAR}, - - - rob_workorder = #{robWorkorder,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - day_register = #{dayRegister,jdbcType=VARCHAR}, - - - week_register = #{weekRegister,jdbcType=VARCHAR}, - - - week_interval = #{weekInterval,jdbcType=INTEGER}, - - - month_register = #{monthRegister,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_routine_work - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - position_type_code = #{positionTypeCode,jdbcType=VARCHAR}, - position_type = #{positionType,jdbcType=VARCHAR}, - work_type_code = #{workTypeCode,jdbcType=VARCHAR}, - work_type_name = #{workTypeName,jdbcType=VARCHAR}, - work_code = #{workCode,jdbcType=VARCHAR}, - work_name = #{workName,jdbcType=VARCHAR}, - work_content = #{workContent,jdbcType=VARCHAR}, - evaluation_criterion = #{evaluationCriterion,jdbcType=VARCHAR}, - work_frequency_type = #{workFrequencyType,jdbcType=VARCHAR}, - work_start_time = #{workStartTime,jdbcType=VARCHAR}, - base_hours = #{baseHours,jdbcType=DECIMAL}, - base_cost = #{baseCost,jdbcType=DECIMAL}, - need_people = #{needPeople,jdbcType=INTEGER}, - skill_level = #{skillLevel,jdbcType=VARCHAR}, - rob_workorder = #{robWorkorder,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - day_register = #{dayRegister,jdbcType=VARCHAR}, - week_register = #{weekRegister,jdbcType=VARCHAR}, - week_interval = #{weekInterval,jdbcType=INTEGER}, - month_register = #{monthRegister,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_library_routine_work - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/LibraryWaterTestMapper.xml b/src/com/sipai/mapper/process/LibraryWaterTestMapper.xml deleted file mode 100644 index 8906ebc4..00000000 --- a/src/com/sipai/mapper/process/LibraryWaterTestMapper.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, unit_id, morder, code, name, measure_point_id, method, base_hours, - base_cost, safe_careful - - - - delete from tb_library_water_test - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_water_test (id, insdt, insuser, - unit_id, morder, code, - name, measure_point_id, method, - base_hours, base_cost, safe_careful - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{measurePointId,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, - #{baseHours,jdbcType=DECIMAL}, #{baseCost,jdbcType=DECIMAL}, #{safeCareful,jdbcType=VARCHAR} - ) - - - insert into tb_library_water_test - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - morder, - - - code, - - - name, - - - measure_point_id, - - - method, - - - base_hours, - - - base_cost, - - - safe_careful, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{measurePointId,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - #{baseHours,jdbcType=DECIMAL}, - - - #{baseCost,jdbcType=DECIMAL}, - - - #{safeCareful,jdbcType=VARCHAR}, - - - - - update tb_library_water_test - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - base_hours = #{baseHours,jdbcType=DECIMAL}, - - - base_cost = #{baseCost,jdbcType=DECIMAL}, - - - safe_careful = #{safeCareful,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_water_test - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR}, - base_hours = #{baseHours,jdbcType=DECIMAL}, - base_cost = #{baseCost,jdbcType=DECIMAL}, - safe_careful = #{safeCareful,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_water_test - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/MeterCheckLibraryMapper.xml b/src/com/sipai/mapper/process/MeterCheckLibraryMapper.xml deleted file mode 100644 index f5b0d3a0..00000000 --- a/src/com/sipai/mapper/process/MeterCheckLibraryMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id - , name, mpid, mpid_rg, unit_id, morder, targetValue, targetValue2, targetValueType - - - - delete - from tb_process_meterCheck_library - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_meterCheck_library (id, name, mpid, - mpid_rg, unit_id, morder, - targetValue, targetValue2, targetValueType) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{mpidRg,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{targetvalue,jdbcType=VARCHAR}, #{targetvalue2,jdbcType=VARCHAR}, #{targetvaluetype,jdbcType=VARCHAR}) - - - insert into tb_process_meterCheck_library - - - id, - - - name, - - - mpid, - - - mpid_rg, - - - unit_id, - - - morder, - - - targetValue, - - - targetValue2, - - - targetValueType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpidRg,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{targetvalue,jdbcType=VARCHAR}, - - - #{targetvalue2,jdbcType=VARCHAR}, - - - #{targetvaluetype,jdbcType=VARCHAR}, - - - - - update tb_process_meterCheck_library - - - name = #{name,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpid_rg = #{mpidRg,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - targetValue = #{targetvalue,jdbcType=VARCHAR}, - - - targetValue2 = #{targetvalue2,jdbcType=VARCHAR}, - - - targetValueType = #{targetvaluetype,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_meterCheck_library - set name = #{name,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpid_rg = #{mpidRg,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - targetValue = #{targetvalue,jdbcType=VARCHAR}, - targetValue2 = #{targetvalue2,jdbcType=VARCHAR}, - targetValueType = #{targetvaluetype,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_process_meterCheck_library ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/MeterCheckMapper.xml b/src/com/sipai/mapper/process/MeterCheckMapper.xml deleted file mode 100644 index fcae8246..00000000 --- a/src/com/sipai/mapper/process/MeterCheckMapper.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - id, library_id, xj_id, input_user, input_value, input_time, mp_value, unit_id - - - - delete from tb_process_meterCheck - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_meterCheck (id, library_id, xj_id, - input_user, input_value, input_time, - mp_value, unit_id) - values (#{id,jdbcType=VARCHAR}, #{libraryId,jdbcType=VARCHAR}, #{xjId,jdbcType=VARCHAR}, - #{inputUser,jdbcType=VARCHAR}, #{inputValue,jdbcType=DOUBLE}, #{inputTime,jdbcType=TIMESTAMP}, - #{mpValue,jdbcType=DOUBLE}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_process_meterCheck - - - id, - - - library_id, - - - xj_id, - - - input_user, - - - input_value, - - - input_time, - - - mp_value, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{libraryId,jdbcType=VARCHAR}, - - - #{xjId,jdbcType=VARCHAR}, - - - #{inputUser,jdbcType=VARCHAR}, - - - #{inputValue,jdbcType=DOUBLE}, - - - #{inputTime,jdbcType=TIMESTAMP}, - - - #{mpValue,jdbcType=DOUBLE}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_process_meterCheck - - - library_id = #{libraryId,jdbcType=VARCHAR}, - - - xj_id = #{xjId,jdbcType=VARCHAR}, - - - input_user = #{inputUser,jdbcType=VARCHAR}, - - - input_value = #{inputValue,jdbcType=DOUBLE}, - - - input_time = #{inputTime,jdbcType=TIMESTAMP}, - - - mp_value = #{mpValue,jdbcType=DOUBLE}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_process_meterCheck ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/ProcessAdjustmentContentMapper.xml b/src/com/sipai/mapper/process/ProcessAdjustmentContentMapper.xml deleted file mode 100644 index b0d4a16b..00000000 --- a/src/com/sipai/mapper/process/ProcessAdjustmentContentMapper.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, library_id, abnormal_code, abnormal_name, pro_code, pro_name, - pro_measures, receive_rated_time, remark - - - - delete from tb_process_adjustment_content - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_adjustment_content (id, insdt, insuser, - pid, library_id, abnormal_code, - abnormal_name, pro_code, pro_name, - pro_measures, receive_rated_time, - remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{libraryId,jdbcType=VARCHAR}, #{abnormalCode,jdbcType=VARCHAR}, - #{abnormalName,jdbcType=VARCHAR}, #{proCode,jdbcType=VARCHAR}, #{proName,jdbcType=VARCHAR}, - #{proMeasures,jdbcType=VARCHAR}, #{receiveRatedTime,jdbcType=DECIMAL}, - #{remark,jdbcType=VARCHAR}) - - - insert into tb_process_adjustment_content - - - id, - - - insdt, - - - insuser, - - - pid, - - - library_id, - - - abnormal_code, - - - abnormal_name, - - - pro_code, - - - pro_name, - - - pro_measures, - - - receive_rated_time, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{libraryId,jdbcType=VARCHAR}, - - - #{abnormalCode,jdbcType=VARCHAR}, - - - #{abnormalName,jdbcType=VARCHAR}, - - - #{proCode,jdbcType=VARCHAR}, - - - #{proName,jdbcType=VARCHAR}, - - - #{proMeasures,jdbcType=VARCHAR}, - - - #{receiveRatedTime,jdbcType=DECIMAL}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_process_adjustment_content - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - library_id = #{libraryId,jdbcType=VARCHAR}, - - - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - - - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - - - pro_code = #{proCode,jdbcType=VARCHAR}, - - - pro_name = #{proName,jdbcType=VARCHAR}, - - - pro_measures = #{proMeasures,jdbcType=VARCHAR}, - - - receive_rated_time = #{receiveRatedTime,jdbcType=DECIMAL}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_adjustment_content - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - library_id = #{libraryId,jdbcType=VARCHAR}, - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - pro_code = #{proCode,jdbcType=VARCHAR}, - pro_name = #{proName,jdbcType=VARCHAR}, - pro_measures = #{proMeasures,jdbcType=VARCHAR}, - receive_rated_time = #{receiveRatedTime,jdbcType=DECIMAL}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_adjustment_content - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/ProcessAdjustmentMapper.xml b/src/com/sipai/mapper/process/ProcessAdjustmentMapper.xml deleted file mode 100644 index 242ba542..00000000 --- a/src/com/sipai/mapper/process/ProcessAdjustmentMapper.xml +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, contents, job_number, abnormal_code, abnormal_name, abnormal_analysis, - remarks, target_user_id, target_user_ids, type_id, unit_id, status, processId, processDefId, - evaluate_score, evaluate_weight, coordination_score, coordination_weight, total_score, - base_hours, working_hours, check_explain - - - - delete from tb_process_adjustment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_adjustment (id, insdt, insuser, - contents, job_number, abnormal_code, - abnormal_name, abnormal_analysis, remarks, - target_user_id, target_user_ids, type_id, - unit_id, status, processId, - processDefId, evaluate_score, evaluate_weight, - coordination_score, coordination_weight, - total_score, base_hours, working_hours, - check_explain) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{contents,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{abnormalCode,jdbcType=VARCHAR}, - #{abnormalName,jdbcType=VARCHAR}, #{abnormalAnalysis,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, - #{targetUserId,jdbcType=VARCHAR}, #{targetUserIds,jdbcType=VARCHAR}, #{typeId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{evaluateScore,jdbcType=DECIMAL}, #{evaluateWeight,jdbcType=DECIMAL}, - #{coordinationScore,jdbcType=DECIMAL}, #{coordinationWeight,jdbcType=DECIMAL}, - #{totalScore,jdbcType=DECIMAL}, #{baseHours,jdbcType=DECIMAL}, #{workingHours,jdbcType=DECIMAL}, - #{checkExplain,jdbcType=VARCHAR}) - - - insert into tb_process_adjustment - - - id, - - - insdt, - - - insuser, - - - contents, - - - job_number, - - - abnormal_code, - - - abnormal_name, - - - abnormal_analysis, - - - remarks, - - - target_user_id, - - - target_user_ids, - - - type_id, - - - unit_id, - - - status, - - - processId, - - - processDefId, - - - evaluate_score, - - - evaluate_weight, - - - coordination_score, - - - coordination_weight, - - - total_score, - - - base_hours, - - - working_hours, - - - check_explain, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{abnormalCode,jdbcType=VARCHAR}, - - - #{abnormalName,jdbcType=VARCHAR}, - - - #{abnormalAnalysis,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{targetUserId,jdbcType=VARCHAR}, - - - #{targetUserIds,jdbcType=VARCHAR}, - - - #{typeId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{evaluateScore,jdbcType=DECIMAL}, - - - #{evaluateWeight,jdbcType=DECIMAL}, - - - #{coordinationScore,jdbcType=DECIMAL}, - - - #{coordinationWeight,jdbcType=DECIMAL}, - - - #{totalScore,jdbcType=DECIMAL}, - - - #{baseHours,jdbcType=DECIMAL}, - - - #{workingHours,jdbcType=DECIMAL}, - - - #{checkExplain,jdbcType=VARCHAR}, - - - - - update tb_process_adjustment - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - - - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - - - abnormal_analysis = #{abnormalAnalysis,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - target_user_id = #{targetUserId,jdbcType=VARCHAR}, - - - target_user_ids = #{targetUserIds,jdbcType=VARCHAR}, - - - type_id = #{typeId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - evaluate_score = #{evaluateScore,jdbcType=DECIMAL}, - - - evaluate_weight = #{evaluateWeight,jdbcType=DECIMAL}, - - - coordination_score = #{coordinationScore,jdbcType=DECIMAL}, - - - coordination_weight = #{coordinationWeight,jdbcType=DECIMAL}, - - - total_score = #{totalScore,jdbcType=DECIMAL}, - - - base_hours = #{baseHours,jdbcType=DECIMAL}, - - - working_hours = #{workingHours,jdbcType=DECIMAL}, - - - check_explain = #{checkExplain,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_adjustment - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - abnormal_code = #{abnormalCode,jdbcType=VARCHAR}, - abnormal_name = #{abnormalName,jdbcType=VARCHAR}, - abnormal_analysis = #{abnormalAnalysis,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - target_user_id = #{targetUserId,jdbcType=VARCHAR}, - target_user_ids = #{targetUserIds,jdbcType=VARCHAR}, - type_id = #{typeId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - evaluate_score = #{evaluateScore,jdbcType=DECIMAL}, - evaluate_weight = #{evaluateWeight,jdbcType=DECIMAL}, - coordination_score = #{coordinationScore,jdbcType=DECIMAL}, - coordination_weight = #{coordinationWeight,jdbcType=DECIMAL}, - total_score = #{totalScore,jdbcType=DECIMAL}, - base_hours = #{baseHours,jdbcType=DECIMAL}, - working_hours = #{workingHours,jdbcType=DECIMAL}, - check_explain = #{checkExplain,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_adjustment - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/ProcessAdjustmentTypeMapper.xml b/src/com/sipai/mapper/process/ProcessAdjustmentTypeMapper.xml deleted file mode 100644 index 1acce9bc..00000000 --- a/src/com/sipai/mapper/process/ProcessAdjustmentTypeMapper.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - id, insuser, insdt, name, status, code, unit_id, uptuser, uptdt, morder - - - - delete from tb_process_adjustment_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_adjustment_type (id, insuser, insdt, - name, status, code, - unit_id, uptuser, uptdt, - morder) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{uptuser,jdbcType=VARCHAR}, #{uptdt,jdbcType=TIMESTAMP}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_process_adjustment_type - - - id, - - - insuser, - - - insdt, - - - name, - - - status, - - - code, - - - unit_id, - - - uptuser, - - - uptdt, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{uptuser,jdbcType=VARCHAR}, - - - #{uptdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_process_adjustment_type - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - uptuser = #{uptuser,jdbcType=VARCHAR}, - - - uptdt = #{uptdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_adjustment_type - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - uptuser = #{uptuser,jdbcType=VARCHAR}, - uptdt = #{uptdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_adjustment_type - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/ProcessSectionInformationMapper.xml b/src/com/sipai/mapper/process/ProcessSectionInformationMapper.xml deleted file mode 100644 index 84076c4a..00000000 --- a/src/com/sipai/mapper/process/ProcessSectionInformationMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, process_section_id, content, insuser, insdt, bizid, audio_path, morder, state - - - - delete from tb_process_section_information - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_section_information (id, process_section_id, content, - insuser, insdt, bizid, - audio_path, morder, state - ) - values (#{id,jdbcType=VARCHAR}, #{processSectionId,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{bizid,jdbcType=VARCHAR}, - #{audioPath,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{state,jdbcType=INTEGER} - ) - - - insert into tb_process_section_information - - - id, - - - process_section_id, - - - content, - - - insuser, - - - insdt, - - - bizid, - - - audio_path, - - - morder, - - - state, - - - - - #{id,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{audioPath,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{state,jdbcType=INTEGER}, - - - - - update tb_process_section_information - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - audio_path = #{audioPath,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - state = #{state,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_section_information - set process_section_id = #{processSectionId,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - bizid = #{bizid,jdbcType=VARCHAR}, - audio_path = #{audioPath,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - state = #{state,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_process_section_information - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/ProcessWebsiteMapper.xml b/src/com/sipai/mapper/process/ProcessWebsiteMapper.xml deleted file mode 100644 index a1cea0f1..00000000 --- a/src/com/sipai/mapper/process/ProcessWebsiteMapper.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - id, name, website, ord, insuser, insdt - - - - delete from tb_process_website - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_website (id, name, website, - ord, insuser, insdt - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{website,jdbcType=VARCHAR}, - #{ord,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP} - ) - - - insert into tb_process_website - - - id, - - - name, - - - website, - - - ord, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{website,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update tb_process_website - - - name = #{name,jdbcType=VARCHAR}, - - - website = #{website,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_website - set name = #{name,jdbcType=VARCHAR}, - website = #{website,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_process_website - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/RoutineWorkMapper.xml b/src/com/sipai/mapper/process/RoutineWorkMapper.xml deleted file mode 100644 index 322b4bd6..00000000 --- a/src/com/sipai/mapper/process/RoutineWorkMapper.xml +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, unit_id, morder, job_number, library_id, plan_start_date, actual_cost, - send_user_id, receive_user_ids, receive_user_id, actual_time, reward_time, working_hours, - comments, check_time, remarks, status, processDefId, processId, type - - - - delete from tb_process_routine_work - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_routine_work (id, insdt, insuser, - unit_id, morder, job_number, - library_id, plan_start_date, actual_cost, - send_user_id, receive_user_ids, receive_user_id, - actual_time, reward_time, working_hours, - comments, check_time, remarks, - status, processDefId, processId, type - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, - #{libraryId,jdbcType=VARCHAR}, #{planStartDate,jdbcType=TIMESTAMP}, #{actualCost,jdbcType=DECIMAL}, - #{sendUserId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, - #{actualTime,jdbcType=DECIMAL}, #{rewardTime,jdbcType=VARCHAR}, #{workingHours,jdbcType=DECIMAL}, - #{comments,jdbcType=VARCHAR}, #{checkTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR} - ) - - - insert into tb_process_routine_work - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - morder, - - - job_number, - - - library_id, - - - plan_start_date, - - - actual_cost, - - - send_user_id, - - - receive_user_ids, - - - receive_user_id, - - - actual_time, - - - reward_time, - - - working_hours, - - - comments, - - - check_time, - - - remarks, - - - status, - - - processDefId, - - - processId, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{libraryId,jdbcType=VARCHAR}, - - - #{planStartDate,jdbcType=TIMESTAMP}, - - - #{actualCost,jdbcType=DECIMAL}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{actualTime,jdbcType=DECIMAL}, - - - #{rewardTime,jdbcType=VARCHAR}, - - - #{workingHours,jdbcType=DECIMAL}, - - - #{comments,jdbcType=VARCHAR}, - - - #{checkTime,jdbcType=TIMESTAMP}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_process_routine_work - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - library_id = #{libraryId,jdbcType=VARCHAR}, - - - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - - - actual_cost = #{actualCost,jdbcType=DECIMAL}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - actual_time = #{actualTime,jdbcType=DECIMAL}, - - - reward_time = #{rewardTime,jdbcType=VARCHAR}, - - - working_hours = #{workingHours,jdbcType=DECIMAL}, - - - comments = #{comments,jdbcType=VARCHAR}, - - - check_time = #{checkTime,jdbcType=TIMESTAMP}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_routine_work - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - library_id = #{libraryId,jdbcType=VARCHAR}, - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - actual_cost = #{actualCost,jdbcType=DECIMAL}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - actual_time = #{actualTime,jdbcType=DECIMAL}, - reward_time = #{rewardTime,jdbcType=VARCHAR}, - working_hours = #{workingHours,jdbcType=DECIMAL}, - comments = #{comments,jdbcType=VARCHAR}, - check_time = #{checkTime,jdbcType=TIMESTAMP}, - remarks = #{remarks,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_routine_work - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/TestIndexManageMapper.xml b/src/com/sipai/mapper/process/TestIndexManageMapper.xml deleted file mode 100644 index f829c64c..00000000 --- a/src/com/sipai/mapper/process/TestIndexManageMapper.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, updt, upuser, name, cycle, cycleType, method, instrument, medicament, - matters, referenceRange, active, unitId - - - - delete from tb_pro_testIndexManage - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_testIndexManage (id, insdt, insuser, - updt, upuser, name, - cycle, cycleType, method, - instrument, medicament, matters, - referenceRange, active, unitId - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{updt,jdbcType=TIMESTAMP}, #{upuser,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{cycle,jdbcType=INTEGER}, #{cycletype,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, - #{instrument,jdbcType=VARCHAR}, #{medicament,jdbcType=VARCHAR}, #{matters,jdbcType=VARCHAR}, - #{referencerange,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR} - ) - - - insert into tb_pro_testIndexManage - - - id, - - - insdt, - - - insuser, - - - updt, - - - upuser, - - - name, - - - cycle, - - - cycleType, - - - method, - - - instrument, - - - medicament, - - - matters, - - - referenceRange, - - - active, - - - unitId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{updt,jdbcType=TIMESTAMP}, - - - #{upuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{cycle,jdbcType=INTEGER}, - - - #{cycletype,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - #{instrument,jdbcType=VARCHAR}, - - - #{medicament,jdbcType=VARCHAR}, - - - #{matters,jdbcType=VARCHAR}, - - - #{referencerange,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - - - update tb_pro_testIndexManage - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - updt = #{updt,jdbcType=TIMESTAMP}, - - - upuser = #{upuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - cycle = #{cycle,jdbcType=INTEGER}, - - - cycleType = #{cycletype,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - instrument = #{instrument,jdbcType=VARCHAR}, - - - medicament = #{medicament,jdbcType=VARCHAR}, - - - matters = #{matters,jdbcType=VARCHAR}, - - - referenceRange = #{referencerange,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_testIndexManage - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - updt = #{updt,jdbcType=TIMESTAMP}, - upuser = #{upuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - cycle = #{cycle,jdbcType=INTEGER}, - cycleType = #{cycletype,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR}, - instrument = #{instrument,jdbcType=VARCHAR}, - medicament = #{medicament,jdbcType=VARCHAR}, - matters = #{matters,jdbcType=VARCHAR}, - referenceRange = #{referencerange,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_testIndexManage - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/TestMethodsMapper.xml b/src/com/sipai/mapper/process/TestMethodsMapper.xml deleted file mode 100644 index 8617d052..00000000 --- a/src/com/sipai/mapper/process/TestMethodsMapper.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - id, name, describe, indexItem, steps, matters, active, insdt, insuser, updt, upuser - - - - delete from tb_pro_testMethods - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_testMethods (id, name, describe, - indexItem, steps, matters, - active, insdt, insuser, - updt, upuser) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, - #{indexitem,jdbcType=VARCHAR}, #{steps,jdbcType=VARCHAR}, #{matters,jdbcType=VARCHAR}, - #{active,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{updt,jdbcType=TIMESTAMP}, #{upuser,jdbcType=VARCHAR}) - - - insert into tb_pro_testMethods - - - id, - - - name, - - - describe, - - - indexItem, - - - steps, - - - matters, - - - active, - - - insdt, - - - insuser, - - - updt, - - - upuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{indexitem,jdbcType=VARCHAR}, - - - #{steps,jdbcType=VARCHAR}, - - - #{matters,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{updt,jdbcType=TIMESTAMP}, - - - #{upuser,jdbcType=VARCHAR}, - - - - - update tb_pro_testMethods - - - name = #{name,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - indexItem = #{indexitem,jdbcType=VARCHAR}, - - - steps = #{steps,jdbcType=VARCHAR}, - - - matters = #{matters,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - updt = #{updt,jdbcType=TIMESTAMP}, - - - upuser = #{upuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_testMethods - set name = #{name,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - indexItem = #{indexitem,jdbcType=VARCHAR}, - steps = #{steps,jdbcType=VARCHAR}, - matters = #{matters,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - updt = #{updt,jdbcType=TIMESTAMP}, - upuser = #{upuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_testMethods - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/TestTaskMapper.xml b/src/com/sipai/mapper/process/TestTaskMapper.xml deleted file mode 100644 index 1cf22d9c..00000000 --- a/src/com/sipai/mapper/process/TestTaskMapper.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, planType, status, sender, senddt, receiver, receivdt, reviewer, - reviewedt, unitId, testIndexManageId, resultValue, resultRemarks - - - - delete from tb_pro_testTask - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_testTask (id, insdt, insuser, - planType, status, sender, - senddt, receiver, receivdt, - reviewer, reviewedt, unitId, - testIndexManageId, resultValue, resultRemarks - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{plantype,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{sender,jdbcType=VARCHAR}, - #{senddt,jdbcType=TIMESTAMP}, #{receiver,jdbcType=VARCHAR}, #{receivdt,jdbcType=TIMESTAMP}, - #{reviewer,jdbcType=VARCHAR}, #{reviewedt,jdbcType=TIMESTAMP}, #{unitid,jdbcType=VARCHAR}, - #{testindexmanageid,jdbcType=VARCHAR}, #{resultvalue,jdbcType=DOUBLE}, #{resultremarks,jdbcType=VARCHAR} - ) - - - insert into tb_pro_testTask - - - id, - - - insdt, - - - insuser, - - - planType, - - - status, - - - sender, - - - senddt, - - - receiver, - - - receivdt, - - - reviewer, - - - reviewedt, - - - unitId, - - - testIndexManageId, - - - resultValue, - - - resultRemarks, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{plantype,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{sender,jdbcType=VARCHAR}, - - - #{senddt,jdbcType=TIMESTAMP}, - - - #{receiver,jdbcType=VARCHAR}, - - - #{receivdt,jdbcType=TIMESTAMP}, - - - #{reviewer,jdbcType=VARCHAR}, - - - #{reviewedt,jdbcType=TIMESTAMP}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{testindexmanageid,jdbcType=VARCHAR}, - - - #{resultvalue,jdbcType=DOUBLE}, - - - #{resultremarks,jdbcType=VARCHAR}, - - - - - update tb_pro_testTask - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - planType = #{plantype,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - sender = #{sender,jdbcType=VARCHAR}, - - - senddt = #{senddt,jdbcType=TIMESTAMP}, - - - receiver = #{receiver,jdbcType=VARCHAR}, - - - receivdt = #{receivdt,jdbcType=TIMESTAMP}, - - - reviewer = #{reviewer,jdbcType=VARCHAR}, - - - reviewedt = #{reviewedt,jdbcType=TIMESTAMP}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - testIndexManageId = #{testindexmanageid,jdbcType=VARCHAR}, - - - resultValue = #{resultvalue,jdbcType=DOUBLE}, - - - resultRemarks = #{resultremarks,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_testTask - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - planType = #{plantype,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - sender = #{sender,jdbcType=VARCHAR}, - senddt = #{senddt,jdbcType=TIMESTAMP}, - receiver = #{receiver,jdbcType=VARCHAR}, - receivdt = #{receivdt,jdbcType=TIMESTAMP}, - reviewer = #{reviewer,jdbcType=VARCHAR}, - reviewedt = #{reviewedt,jdbcType=TIMESTAMP}, - unitId = #{unitid,jdbcType=VARCHAR}, - testIndexManageId = #{testindexmanageid,jdbcType=VARCHAR}, - resultValue = #{resultvalue,jdbcType=DOUBLE}, - resultRemarks = #{resultremarks,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_pro_testTask - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/WaterTestDetailMapper.xml b/src/com/sipai/mapper/process/WaterTestDetailMapper.xml deleted file mode 100644 index f056ada6..00000000 --- a/src/com/sipai/mapper/process/WaterTestDetailMapper.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, morder, library_id, actual_time, actual_cost, implement_user_id, - pid - - - - delete from tb_process_water_test_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_water_test_detail (id, insdt, insuser, - morder, library_id, actual_time, - actual_cost, implement_user_id, pid - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{libraryId,jdbcType=VARCHAR}, #{actualTime,jdbcType=DECIMAL}, - #{actualCost,jdbcType=DECIMAL}, #{implementUserId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR} - ) - - - insert into tb_process_water_test_detail - - - id, - - - insdt, - - - insuser, - - - morder, - - - library_id, - - - actual_time, - - - actual_cost, - - - implement_user_id, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{libraryId,jdbcType=VARCHAR}, - - - #{actualTime,jdbcType=DECIMAL}, - - - #{actualCost,jdbcType=DECIMAL}, - - - #{implementUserId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_process_water_test_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - library_id = #{libraryId,jdbcType=VARCHAR}, - - - actual_time = #{actualTime,jdbcType=DECIMAL}, - - - actual_cost = #{actualCost,jdbcType=DECIMAL}, - - - implement_user_id = #{implementUserId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_water_test_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - library_id = #{libraryId,jdbcType=VARCHAR}, - actual_time = #{actualTime,jdbcType=DECIMAL}, - actual_cost = #{actualCost,jdbcType=DECIMAL}, - implement_user_id = #{implementUserId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_water_test_detail - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/process/WaterTestMapper.xml b/src/com/sipai/mapper/process/WaterTestMapper.xml deleted file mode 100644 index 6d3e2d08..00000000 --- a/src/com/sipai/mapper/process/WaterTestMapper.xml +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, unit_id, morder, job_number, job_type, send_user_id, send_time, - receive_user_ids, receive_user_id, receive_dt, actual_time, actual_cost, working_hours, - processDefId, processId, status - - - - delete from tb_process_water_test - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_water_test (id, insdt, insuser, - unit_id, morder, job_number, - job_type, send_user_id, send_time, - receive_user_ids, receive_user_id, receive_dt, - actual_time, actual_cost, working_hours, - processDefId, processId, status - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{jobNumber,jdbcType=VARCHAR}, - #{jobType,jdbcType=VARCHAR}, #{sendUserId,jdbcType=VARCHAR}, #{sendTime,jdbcType=TIMESTAMP}, - #{receiveUserIds,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, #{receiveDt,jdbcType=TIMESTAMP}, - #{actualTime,jdbcType=TIMESTAMP}, #{actualCost,jdbcType=DECIMAL}, #{workingHours,jdbcType=DECIMAL}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR} - ) - - - insert into tb_process_water_test - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - morder, - - - job_number, - - - job_type, - - - send_user_id, - - - send_time, - - - receive_user_ids, - - - receive_user_id, - - - receive_dt, - - - actual_time, - - - actual_cost, - - - working_hours, - - - processDefId, - - - processId, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{jobType,jdbcType=VARCHAR}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{sendTime,jdbcType=TIMESTAMP}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{receiveDt,jdbcType=TIMESTAMP}, - - - #{actualTime,jdbcType=TIMESTAMP}, - - - #{actualCost,jdbcType=DECIMAL}, - - - #{workingHours,jdbcType=DECIMAL}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - - - update tb_process_water_test - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - job_type = #{jobType,jdbcType=VARCHAR}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - send_time = #{sendTime,jdbcType=TIMESTAMP}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - receive_dt = #{receiveDt,jdbcType=TIMESTAMP}, - - - actual_time = #{actualTime,jdbcType=TIMESTAMP}, - - - actual_cost = #{actualCost,jdbcType=DECIMAL}, - - - working_hours = #{workingHours,jdbcType=DECIMAL}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_water_test - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - job_type = #{jobType,jdbcType=VARCHAR}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - send_time = #{sendTime,jdbcType=TIMESTAMP}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - receive_dt = #{receiveDt,jdbcType=TIMESTAMP}, - actual_time = #{actualTime,jdbcType=TIMESTAMP}, - actual_cost = #{actualCost,jdbcType=DECIMAL}, - working_hours = #{workingHours,jdbcType=DECIMAL}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_process_water_test - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/question/QuesOptionMapper.xml b/src/com/sipai/mapper/question/QuesOptionMapper.xml deleted file mode 100644 index a139ed72..00000000 --- a/src/com/sipai/mapper/question/QuesOptionMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, optioncontent, status, ord, questitleid, optionvalue, optionnumber, insuser, - insdt, upsuser, upsdt - - - - delete from tb_question_QuesOption - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_question_QuesOption (id, optioncontent, status, - ord, questitleid, optionvalue, - optionnumber, insuser, insdt, - upsuser, upsdt) - values (#{id,jdbcType=VARCHAR}, #{optioncontent,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{ord,jdbcType=INTEGER}, #{questitleid,jdbcType=VARCHAR}, #{optionvalue,jdbcType=VARCHAR}, - #{optionnumber,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}) - - - insert into tb_question_QuesOption - - - id, - - - optioncontent, - - - status, - - - ord, - - - questitleid, - - - optionvalue, - - - optionnumber, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{optioncontent,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{questitleid,jdbcType=VARCHAR}, - - - #{optionvalue,jdbcType=VARCHAR}, - - - #{optionnumber,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_question_QuesOption - - - optioncontent = #{optioncontent,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - questitleid = #{questitleid,jdbcType=VARCHAR}, - - - optionvalue = #{optionvalue,jdbcType=VARCHAR}, - - - optionnumber = #{optionnumber,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_question_QuesOption - set optioncontent = #{optioncontent,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - questitleid = #{questitleid,jdbcType=VARCHAR}, - optionvalue = #{optionvalue,jdbcType=VARCHAR}, - optionnumber = #{optionnumber,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_question_QuesOption - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/question/QuesTitleMapper.xml b/src/com/sipai/mapper/question/QuesTitleMapper.xml deleted file mode 100644 index 869392d9..00000000 --- a/src/com/sipai/mapper/question/QuesTitleMapper.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, quesdescript, status, ord, subjecttypeid, ranktypeid, questtypeid, code, insuser, - insdt, upsuser, upsdt, testpoint, analysis - - - - delete from tb_question_QuesTitle - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_question_QuesTitle (id, quesdescript, status, - ord, subjecttypeid, ranktypeid, - questtypeid, code, insuser, - insdt, upsuser, upsdt, testpoint, analysis - ) - values (#{id,jdbcType=VARCHAR}, #{quesdescript,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{ord,jdbcType=INTEGER}, #{subjecttypeid,jdbcType=VARCHAR}, #{ranktypeid,jdbcType=VARCHAR}, - #{questtypeid,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{testpoint,jdbcType=VARCHAR}, #{analysis,jdbcType=VARCHAR} - ) - - - insert into tb_question_QuesTitle - - - id, - - - quesdescript, - - - status, - - - ord, - - - subjecttypeid, - - - ranktypeid, - - - questtypeid, - - - code, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - testpoint, - - - analysis, - - - - - #{id,jdbcType=VARCHAR}, - - - #{quesdescript,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{subjecttypeid,jdbcType=VARCHAR}, - - - #{ranktypeid,jdbcType=VARCHAR}, - - - #{questtypeid,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{testpoint,jdbcType=VARCHAR}, - - - #{analysis,jdbcType=VARCHAR}, - - - - - update tb_question_QuesTitle - - - quesdescript = #{quesdescript,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - subjecttypeid = #{subjecttypeid,jdbcType=VARCHAR}, - - - ranktypeid = #{ranktypeid,jdbcType=VARCHAR}, - - - questtypeid = #{questtypeid,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - testpoint = #{testpoint,jdbcType=VARCHAR}, - - - analysis = #{analysis,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_question_QuesTitle - set quesdescript = #{quesdescript,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - subjecttypeid = #{subjecttypeid,jdbcType=VARCHAR}, - ranktypeid = #{ranktypeid,jdbcType=VARCHAR}, - questtypeid = #{questtypeid,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - testpoint = #{testpoint,jdbcType=VARCHAR}, - analysis = #{analysis,jdbcType=VARCHAR}, - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_question_QuesTitle - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/question/QuestTypeMapper.xml b/src/com/sipai/mapper/question/QuestTypeMapper.xml deleted file mode 100644 index 06d3ba5e..00000000 --- a/src/com/sipai/mapper/question/QuestTypeMapper.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, code, name, memo, status, ord, insertuserid, insertdate, updateuserid, updatedate, - answertype - - - - delete from tb_question_QuestType - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_question_QuestType (id, code, name, - memo, status, ord, - insertuserid, insertdate, updateuserid, - updatedate, answertype - ) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, - #{insertuserid,jdbcType=VARCHAR}, #{insertdate,jdbcType=TIMESTAMP}, #{updateuserid,jdbcType=VARCHAR}, - #{updatedate,jdbcType=TIMESTAMP}, #{answertype,jdbcType=CHAR} - ) - - - insert into tb_question_QuestType - - - id, - - - code, - - - name, - - - memo, - - - status, - - - ord, - - - insertuserid, - - - insertdate, - - - updateuserid, - - - updatedate, - - - answertype, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insertuserid,jdbcType=VARCHAR}, - - - #{insertdate,jdbcType=TIMESTAMP}, - - - #{updateuserid,jdbcType=VARCHAR}, - - - #{updatedate,jdbcType=TIMESTAMP}, - - - #{answertype,jdbcType=CHAR}, - - - - - update tb_question_QuestType - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - - - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - - - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - - - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - - - answertype = #{answertype,jdbcType=CHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_question_QuestType - set code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - answertype = #{answertype,jdbcType=CHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_question_QuestType - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/question/RankTypeMapper.xml b/src/com/sipai/mapper/question/RankTypeMapper.xml deleted file mode 100644 index a0f785f6..00000000 --- a/src/com/sipai/mapper/question/RankTypeMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, code, name, memo, status, ord, insertuserid, insertdate, updateuserid, updatedate, difficultyrank - - - - delete from tb_question_RankType - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_question_RankType (id, code, name, - memo, status, ord, - insertuserid, insertdate, updateuserid, - updatedate,difficultyrank) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, - #{insertuserid,jdbcType=VARCHAR}, #{insertdate,jdbcType=TIMESTAMP}, #{updateuserid,jdbcType=VARCHAR}, - #{updatedate,jdbcType=TIMESTAMP}, #{difficultyrank,jdbcType=VARCHAR}) - - - insert into tb_question_RankType - - - id, - - - code, - - - name, - - - memo, - - - status, - - - ord, - - - insertuserid, - - - insertdate, - - - updateuserid, - - - updatedate, - - - difficultyrank, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insertuserid,jdbcType=VARCHAR}, - - - #{insertdate,jdbcType=TIMESTAMP}, - - - #{updateuserid,jdbcType=VARCHAR}, - - - #{updatedate,jdbcType=TIMESTAMP}, - - - #{difficultyrank,jdbcType=VARCHAR}, - - - - - update tb_question_RankType - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - - - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - - - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - - - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - - - difficultyrank = #{difficultyrank,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_question_RankType - set code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insertuserid = #{insertuserid,jdbcType=VARCHAR}, - insertdate = #{insertdate,jdbcType=TIMESTAMP}, - updateuserid = #{updateuserid,jdbcType=VARCHAR}, - updatedate = #{updatedate,jdbcType=TIMESTAMP}, - difficultyrank = #{difficultyrank,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_question_RankType - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/question/SubjecttypeMapper.xml b/src/com/sipai/mapper/question/SubjecttypeMapper.xml deleted file mode 100644 index 0da471fa..00000000 --- a/src/com/sipai/mapper/question/SubjecttypeMapper.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, pid, st, ord, memo, insuser, insdt, upsuser, upsdt, code, pname - - - - delete from tb_question_SubjectType - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_question_SubjectType (id, name, pid, - st, ord, memo, insuser, - insdt, upsuser, upsdt, - code, pname) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{st,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{code,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR}) - - - insert into tb_question_SubjectType - - - id, - - - name, - - - pid, - - - st, - - - ord, - - - memo, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - code, - - - pname, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{st,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{memo,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{code,jdbcType=VARCHAR}, - - - #{pname,jdbcType=VARCHAR}, - - - - - update tb_question_SubjectType - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - st = #{st,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - code = #{code,jdbcType=VARCHAR}, - - - pname = #{pname,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_question_SubjectType - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - st = #{st,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - memo = #{memo,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - code = #{code,jdbcType=VARCHAR}, - pname = #{pname,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/CustomReportMPointMapper.xml b/src/com/sipai/mapper/report/CustomReportMPointMapper.xml deleted file mode 100644 index 11ed76c5..00000000 --- a/src/com/sipai/mapper/report/CustomReportMPointMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, pid, insdt, insuser, mpoint_id, unit_id, morder, e_name - - - - delete from tb_Report_customReport_mPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_Report_customReport_mPoint (id, pid, insdt, - insuser, mpoint_id, unit_id, - morder, e_name) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{mpointId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, - #{eName,jdbcType=VARCHAR}) - - - insert into tb_Report_customReport_mPoint - - - id, - - - pid, - - - insdt, - - - insuser, - - - mpoint_id, - - - unit_id, - - - morder, - - - e_name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{mpointId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{eName,jdbcType=VARCHAR}, - - - - - update tb_Report_customReport_mPoint - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - e_name = #{eName,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_Report_customReport_mPoint - set pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - mpoint_id = #{mpointId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - e_name = #{eName,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_Report_customReport_mPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/CustomReportMapper.xml b/src/com/sipai/mapper/report/CustomReportMapper.xml deleted file mode 100644 index a2512715..00000000 --- a/src/com/sipai/mapper/report/CustomReportMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, unit_id, name, frequency, frequencyType, pid, type, calculation, morder - - - - delete from tb_Report_customReport - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_Report_customReport (id, insdt, insuser, - unit_id, name, frequency, - frequencyType, pid, calculation, type, - morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{frequency,jdbcType=INTEGER}, - #{frequencytype,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{calculation,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR},#{morder,jdbcType=INTEGER}) - - - insert into tb_Report_customReport - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - name, - - - frequency, - - - frequencyType, - - - pid, - - - type, - - - calculation, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{frequency,jdbcType=INTEGER}, - - - #{frequencytype,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{calculation,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_Report_customReport - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - frequency = #{frequency,jdbcType=INTEGER}, - - - frequencyType = #{frequencytype,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - calculation = #{calculation,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_Report_customReport - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - frequency = #{frequency,jdbcType=INTEGER}, - frequencyType = #{frequencytype,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - calculation = #{calculation,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_Report_customReport - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableConfigureMapper.xml b/src/com/sipai/mapper/report/DrainageDataomprehensiveTableConfigureMapper.xml deleted file mode 100644 index 174e55bf..00000000 --- a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableConfigureMapper.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, bizid, pid, name, active, morder,mpid - - - - delete from tb_report_drainageDataomprehensiveTable_configure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_report_drainageDataomprehensiveTable_configure (id, insdt, insuser, - bizid, pid, name, active, - morder,mpid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{mpid,jdbcType=VARCHAR}) - - - insert into tb_report_drainageDataomprehensiveTable_configure - - - id, - - - insdt, - - - insuser, - - - bizid, - - - pid, - - - name, - - - active, - - - morder, - - - mpid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{mpid,jdbcType=VARCHAR}, - - - - - update tb_report_drainageDataomprehensiveTable_configure - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_report_drainageDataomprehensiveTable_configure - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - mpid = #{mpid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_report_drainageDataomprehensiveTable_configure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMainconfigureDetailMapper.xml b/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMainconfigureDetailMapper.xml deleted file mode 100644 index 8f052cc4..00000000 --- a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMainconfigureDetailMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, pid, name, targetValue, morder - - - - delete from tb_report_drainageDataomprehensiveTable_mainconfigure_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_report_drainageDataomprehensiveTable_mainconfigure_detail (id, insdt, insuser, - pid, name, targetValue, morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{targetValue,jdbcType=DOUBLE}, #{morder,jdbcType=INTEGER}) - - - insert into tb_report_drainageDataomprehensiveTable_mainconfigure_detail - - - id, - - - insdt, - - - insuser, - - - pid, - - - name, - - - targetValue, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{targetValue,jdbcType=DOUBLE}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_report_drainageDataomprehensiveTable_mainconfigure_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - targetValue = #{targetValue,jdbcType=DOUBLE}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_report_drainageDataomprehensiveTable_mainconfigure_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - targetValue = #{targetValue,jdbcType=DOUBLE}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_report_drainageDataomprehensiveTable_mainconfigure_detail - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMainconfigureMapper.xml b/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMainconfigureMapper.xml deleted file mode 100644 index ba6a5bbc..00000000 --- a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMainconfigureMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, remark, name, morder - - - - delete from tb_report_drainageDataomprehensiveTable_mainconfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_report_drainageDataomprehensiveTable_mainconfigure (id, insuser, insdt, - remark, name,morder) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_report_drainageDataomprehensiveTable_mainconfigure - - - id, - - - insuser, - - - insdt, - - - remark, - - - name, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_report_drainageDataomprehensiveTable_mainconfigure - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_report_drainageDataomprehensiveTable_mainconfigure - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_report_drainageDataomprehensiveTable_mainconfigure - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMapper.xml b/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMapper.xml deleted file mode 100644 index 997b6262..00000000 --- a/src/com/sipai/mapper/report/DrainageDataomprehensiveTableMapper.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, unit_id, valueId, tureValue, lastYearValue, lastYearDiffValue, targetDiffValue - - - - delete from tb_report_drainageDataomprehensiveTable - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_report_drainageDataomprehensiveTable (id, insdt, unit_id, - valueId, tureValue, lastYearValue, - lastYearDiffValue, targetDiffValue) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR}, - #{valueid,jdbcType=VARCHAR}, #{turevalue,jdbcType=DOUBLE}, #{lastyearvalue,jdbcType=DOUBLE}, - #{lastyeardiffvalue,jdbcType=DOUBLE}, #{targetdiffvalue,jdbcType=DOUBLE}) - - - insert into tb_report_drainageDataomprehensiveTable - - - id, - - - insdt, - - - unit_id, - - - valueId, - - - tureValue, - - - lastYearValue, - - - lastYearDiffValue, - - - targetDiffValue, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{valueid,jdbcType=VARCHAR}, - - - #{turevalue,jdbcType=DOUBLE}, - - - #{lastyearvalue,jdbcType=DOUBLE}, - - - #{lastyeardiffvalue,jdbcType=DOUBLE}, - - - #{targetdiffvalue,jdbcType=DOUBLE}, - - - - - update tb_report_drainageDataomprehensiveTable - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - valueId = #{valueid,jdbcType=VARCHAR}, - - - tureValue = #{turevalue,jdbcType=DOUBLE}, - - - lastYearValue = #{lastyearvalue,jdbcType=DOUBLE}, - - - lastYearDiffValue = #{lastyeardiffvalue,jdbcType=DOUBLE}, - - - targetDiffValue = #{targetdiffvalue,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_report_drainageDataomprehensiveTable - set insdt = #{insdt,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR}, - valueId = #{valueid,jdbcType=VARCHAR}, - tureValue = #{turevalue,jdbcType=DOUBLE}, - lastYearValue = #{lastyearvalue,jdbcType=DOUBLE}, - lastYearDiffValue = #{lastyeardiffvalue,jdbcType=DOUBLE}, - targetDiffValue = #{targetdiffvalue,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_report_drainageDataomprehensiveTable - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/ReportTemplateMapper.xml b/src/com/sipai/mapper/report/ReportTemplateMapper.xml deleted file mode 100644 index fe1a2854..00000000 --- a/src/com/sipai/mapper/report/ReportTemplateMapper.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, type_id, name, remark, biz_id - - - - delete from TB_Report_Template - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_Template (id, insdt, insuser, - type_id, name, remark, biz_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{typeId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR} - ) - - - insert into TB_Report_Template - - - id, - - - insdt, - - - insuser, - - - type_id, - - - name, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{typeId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update TB_Report_Template - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - type_id = #{typeId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_Template - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - type_id = #{typeId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_Template - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptCollectModeMapper.xml b/src/com/sipai/mapper/report/RptCollectModeMapper.xml deleted file mode 100644 index 63e26d8a..00000000 --- a/src/com/sipai/mapper/report/RptCollectModeMapper.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, content, insdt, insuser, remark, status, biz_id, code, pid, morder, unit_id - - - - delete from TB_Report_RptCollectMode - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptCollectMode (id, name, content, - insdt, insuser, remark, - status, biz_id, code, - pid, morder, unit_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=BIGINT}, #{unitId,jdbcType=VARCHAR}) - - - insert into TB_Report_RptCollectMode - - - id, - - - name, - - - content, - - - insdt, - - - insuser, - - - remark, - - - status, - - - biz_id, - - - code, - - - pid, - - - morder, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=BIGINT}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update TB_Report_RptCollectMode - - - name = #{name,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=BIGINT}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptCollectMode - set name = #{name,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=BIGINT}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptCollectMode - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptCreateMapper.xml b/src/com/sipai/mapper/report/RptCreateMapper.xml deleted file mode 100644 index 4320b233..00000000 --- a/src/com/sipai/mapper/report/RptCreateMapper.xml +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - id, rptset_id, rptname, rptdt, insuser, insdt, upsuser, upsdt, memo, biz_id, unit_id, - inputuser, status, checkuser, checkdt, processDefId, processId, abspath,type - - - - delete from TB_Report_RptCreate - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptCreate (id, rptset_id, rptname, - rptdt, insuser, insdt, - upsuser, upsdt, memo, - biz_id, unit_id, inputuser, - status, checkuser, checkdt, - processDefId, processId, abspath,type - ) - values (#{id,jdbcType=VARCHAR}, #{rptsetId,jdbcType=VARCHAR}, #{rptname,jdbcType=VARCHAR}, - #{rptdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{inputuser,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{checkuser,jdbcType=VARCHAR}, #{checkdt,jdbcType=TIMESTAMP}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR} - ) - - - insert into TB_Report_RptCreate - - - id, - - - rptset_id, - - - rptname, - - - rptdt, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - memo, - - - biz_id, - - - unit_id, - - - inputuser, - - - status, - - - checkuser, - - - checkdt, - - - processDefId, - - - processId, - - - abspath, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{rptsetId,jdbcType=VARCHAR}, - - - #{rptname,jdbcType=VARCHAR}, - - - #{rptdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{memo,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{inputuser,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{checkuser,jdbcType=VARCHAR}, - - - #{checkdt,jdbcType=TIMESTAMP}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_Report_RptCreate - - - rptset_id = #{rptsetId,jdbcType=VARCHAR}, - - - rptname = #{rptname,jdbcType=VARCHAR}, - - - rptdt = #{rptdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - inputuser = #{inputuser,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - checkuser = #{checkuser,jdbcType=VARCHAR}, - - - checkdt = #{checkdt,jdbcType=TIMESTAMP}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptCreate - set rptset_id = #{rptsetId,jdbcType=VARCHAR}, - rptname = #{rptname,jdbcType=VARCHAR}, - rptdt = #{rptdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - memo = #{memo,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - inputuser = #{inputuser,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - checkuser = #{checkuser,jdbcType=VARCHAR}, - checkdt = #{checkdt,jdbcType=TIMESTAMP}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptCreate - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptDayLogMapper.xml b/src/com/sipai/mapper/report/RptDayLogMapper.xml deleted file mode 100644 index bbc9726e..00000000 --- a/src/com/sipai/mapper/report/RptDayLogMapper.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, rptdept_id, rptdt, biz_id, unit_id, insuser, insdt, upsuser, upsdt, checkuser, - checkdt, status, memo, review_comments, others - - - - delete from TB_Report_RptDayLog - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptDayLog (id, rptdept_id, rptdt, - biz_id, unit_id, insuser, - insdt, upsuser, upsdt, - checkuser, checkdt, status, - memo, review_comments, others - ) - values (#{id,jdbcType=VARCHAR}, #{rptdeptId,jdbcType=VARCHAR}, #{rptdt,jdbcType=TIMESTAMP}, - #{bizId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{checkuser,jdbcType=VARCHAR}, #{checkdt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{reviewComments,jdbcType=VARCHAR}, #{others,jdbcType=VARCHAR} - ) - - - insert into TB_Report_RptDayLog - - - id, - - - rptdept_id, - - - rptdt, - - - biz_id, - - - unit_id, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - checkuser, - - - checkdt, - - - status, - - - memo, - - - review_comments, - - - others, - - - - - #{id,jdbcType=VARCHAR}, - - - #{rptdeptId,jdbcType=VARCHAR}, - - - #{rptdt,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{checkuser,jdbcType=VARCHAR}, - - - #{checkdt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{reviewComments,jdbcType=VARCHAR}, - - - #{others,jdbcType=VARCHAR}, - - - - - update TB_Report_RptDayLog - - - rptdept_id = #{rptdeptId,jdbcType=VARCHAR}, - - - rptdt = #{rptdt,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - checkuser = #{checkuser,jdbcType=VARCHAR}, - - - checkdt = #{checkdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - review_comments = #{reviewComments,jdbcType=VARCHAR}, - - - others = #{others,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptDayLog - set rptdept_id = #{rptdeptId,jdbcType=VARCHAR}, - rptdt = #{rptdt,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - checkuser = #{checkuser,jdbcType=VARCHAR}, - checkdt = #{checkdt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - review_comments = #{reviewComments,jdbcType=VARCHAR}, - others = #{others,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptDayLog - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptDayValSetMapper.xml b/src/com/sipai/mapper/report/RptDayValSetMapper.xml deleted file mode 100644 index 980f8a13..00000000 --- a/src/com/sipai/mapper/report/RptDayValSetMapper.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - id, pid, mpid, biz_id, unit_id, insuser, insdt, morder, mpid2, time_type, offset - - - - delete from TB_Report_RptDayValSet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptDayValSet (id, pid, mpid, - biz_id, unit_id, insuser, - insdt, morder, mpid2, - time_type, offset) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, #{mpid2,jdbcType=VARCHAR}, - #{timeType,jdbcType=VARCHAR}, #{offset,jdbcType=INTEGER}) - - - insert into TB_Report_RptDayValSet - - - id, - - - pid, - - - mpid, - - - biz_id, - - - unit_id, - - - insuser, - - - insdt, - - - morder, - - - mpid2, - - - time_type, - - - offset, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{mpid2,jdbcType=VARCHAR}, - - - #{timeType,jdbcType=VARCHAR}, - - - #{offset,jdbcType=INTEGER}, - - - - - update TB_Report_RptDayValSet - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - mpid2 = #{mpid2,jdbcType=VARCHAR}, - - - time_type = #{timeType,jdbcType=VARCHAR}, - - - offset = #{offset,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptDayValSet - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - mpid2 = #{mpid2,jdbcType=VARCHAR}, - time_type = #{timeType,jdbcType=VARCHAR}, - offset = #{offset,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptDayValSet - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptDeptSetMapper.xml b/src/com/sipai/mapper/report/RptDeptSetMapper.xml deleted file mode 100644 index 52773d8d..00000000 --- a/src/com/sipai/mapper/report/RptDeptSetMapper.xml +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, name, biz_id, unit_id, insuser, insdt, upsuser, upsdt, date_type, remind_time, - memo, inputuser, viewuser, checkuser, checkst, remind_status, last_rptdt, message_type, - role_type, inputjob, pid, type, morder - - - - delete from TB_Report_RptDeptSet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptDeptSet (id, name, biz_id, - unit_id, insuser, insdt, - upsuser, upsdt, date_type, - remind_time, memo, inputuser, - viewuser, checkuser, checkst, - remind_status, last_rptdt, message_type, - role_type, inputjob, pid, - type, morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{dateType,jdbcType=VARCHAR}, - #{remindTime,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{inputuser,jdbcType=VARCHAR}, - #{viewuser,jdbcType=VARCHAR}, #{checkuser,jdbcType=VARCHAR}, #{checkst,jdbcType=VARCHAR}, - #{remindStatus,jdbcType=VARCHAR}, #{lastRptdt,jdbcType=TIMESTAMP}, #{messageType,jdbcType=VARCHAR}, - #{roleType,jdbcType=INTEGER}, #{inputjob,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into TB_Report_RptDeptSet - - - id, - - - name, - - - biz_id, - - - unit_id, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - date_type, - - - remind_time, - - - memo, - - - inputuser, - - - viewuser, - - - checkuser, - - - checkst, - - - remind_status, - - - last_rptdt, - - - message_type, - - - role_type, - - - inputjob, - - - pid, - - - type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{dateType,jdbcType=VARCHAR}, - - - #{remindTime,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{inputuser,jdbcType=VARCHAR}, - - - #{viewuser,jdbcType=VARCHAR}, - - - #{checkuser,jdbcType=VARCHAR}, - - - #{checkst,jdbcType=VARCHAR}, - - - #{remindStatus,jdbcType=VARCHAR}, - - - #{lastRptdt,jdbcType=TIMESTAMP}, - - - #{messageType,jdbcType=VARCHAR}, - - - #{roleType,jdbcType=INTEGER}, - - - #{inputjob,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_Report_RptDeptSet - - - name = #{name,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - date_type = #{dateType,jdbcType=VARCHAR}, - - - remind_time = #{remindTime,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - inputuser = #{inputuser,jdbcType=VARCHAR}, - - - viewuser = #{viewuser,jdbcType=VARCHAR}, - - - checkuser = #{checkuser,jdbcType=VARCHAR}, - - - checkst = #{checkst,jdbcType=VARCHAR}, - - - remind_status = #{remindStatus,jdbcType=VARCHAR}, - - - last_rptdt = #{lastRptdt,jdbcType=TIMESTAMP}, - - - message_type = #{messageType,jdbcType=VARCHAR}, - - - role_type = #{roleType,jdbcType=INTEGER}, - - - inputjob = #{inputjob,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptDeptSet - set name = #{name,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - date_type = #{dateType,jdbcType=VARCHAR}, - remind_time = #{remindTime,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - inputuser = #{inputuser,jdbcType=VARCHAR}, - viewuser = #{viewuser,jdbcType=VARCHAR}, - checkuser = #{checkuser,jdbcType=VARCHAR}, - checkst = #{checkst,jdbcType=VARCHAR}, - remind_status = #{remindStatus,jdbcType=VARCHAR}, - last_rptdt = #{lastRptdt,jdbcType=TIMESTAMP}, - message_type = #{messageType,jdbcType=VARCHAR}, - role_type = #{roleType,jdbcType=INTEGER}, - inputjob = #{inputjob,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptDeptSet - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptDeptSetUserMapper.xml b/src/com/sipai/mapper/report/RptDeptSetUserMapper.xml deleted file mode 100644 index 636cdd96..00000000 --- a/src/com/sipai/mapper/report/RptDeptSetUserMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, user_id, rptdept_id, insuser, insdt - - - - delete from TB_Report_RptDeptSetUser - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptDeptSetUser (id, user_id, rptdept_id, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{rptdeptId,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_Report_RptDeptSetUser - - - id, - - - user_id, - - - rptdept_id, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{rptdeptId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_Report_RptDeptSetUser - - - user_id = #{userId,jdbcType=VARCHAR}, - - - rptdept_id = #{rptdeptId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptDeptSetUser - set user_id = #{userId,jdbcType=VARCHAR}, - rptdept_id = #{rptdeptId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptDeptSetUser - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptInfoSetFileMapper.xml b/src/com/sipai/mapper/report/RptInfoSetFileMapper.xml deleted file mode 100644 index e6080bd8..00000000 --- a/src/com/sipai/mapper/report/RptInfoSetFileMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, masterid, filename, abspath, filepath, type, size - - - - delete from TB_Report_RptInfoSetFile - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptInfoSetFile (id, insdt, insuser, - masterid, filename, abspath, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into TB_Report_RptInfoSetFile - - - id, - - - insdt, - - - insuser, - - - masterid, - - - filename, - - - abspath, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update TB_Report_RptInfoSetFile - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptInfoSetFile - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptInfoSetFile - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptInfoSetMapper.xml b/src/com/sipai/mapper/report/RptInfoSetMapper.xml deleted file mode 100644 index 2a620326..00000000 --- a/src/com/sipai/mapper/report/RptInfoSetMapper.xml +++ /dev/null @@ -1,505 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, name, version, rpttype_id, rpttype, modelname, repname, dtposx, dtposy, insuser, - insdt, memo, biz_id, unit_id, inputposx, inputposy, checkposx, checkposy, remkposx, - remkposy, checkst, autost, cyclest, timest, upsuser, upsdt, morder, daystartdt, mthstartdt, - pid, createauto, createusers, checkuser, browseusers, type, generate_jurisdiction, - browse_jurisdiction, generate_position, browse_position - - - - delete from TB_Report_RptInfoSet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptInfoSet (id, name, version, - rpttype_id, rpttype, modelname, - repname, dtposx, dtposy, - insuser, insdt, memo, - biz_id, unit_id, inputposx, - inputposy, checkposx, checkposy, - remkposx, remkposy, checkst, - autost, cyclest, timest, - upsuser, upsdt, morder, - daystartdt, mthstartdt, pid, - createauto, createusers, checkuser, - browseusers, type, generate_jurisdiction, - browse_jurisdiction, generate_position, browse_position - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{version,jdbcType=VARCHAR}, - #{rpttypeId,jdbcType=VARCHAR}, #{rpttype,jdbcType=VARCHAR}, #{modelname,jdbcType=VARCHAR}, - #{repname,jdbcType=VARCHAR}, #{dtposx,jdbcType=VARCHAR}, #{dtposy,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{inputposx,jdbcType=VARCHAR}, - #{inputposy,jdbcType=VARCHAR}, #{checkposx,jdbcType=VARCHAR}, #{checkposy,jdbcType=VARCHAR}, - #{remkposx,jdbcType=VARCHAR}, #{remkposy,jdbcType=VARCHAR}, #{checkst,jdbcType=VARCHAR}, - #{autost,jdbcType=VARCHAR}, #{cyclest,jdbcType=VARCHAR}, #{timest,jdbcType=VARCHAR}, - #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, - #{daystartdt,jdbcType=VARCHAR}, #{mthstartdt,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{createauto,jdbcType=VARCHAR}, #{createusers,jdbcType=VARCHAR}, #{checkuser,jdbcType=VARCHAR}, - #{browseusers,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{generateJurisdiction,jdbcType=VARCHAR}, - #{browseJurisdiction,jdbcType=VARCHAR}, #{generatePosition,jdbcType=VARCHAR}, #{browsePosition,jdbcType=VARCHAR} - ) - - - insert into TB_Report_RptInfoSet - - - id, - - - name, - - - version, - - - rpttype_id, - - - rpttype, - - - modelname, - - - repname, - - - dtposx, - - - dtposy, - - - insuser, - - - insdt, - - - memo, - - - biz_id, - - - unit_id, - - - inputposx, - - - inputposy, - - - checkposx, - - - checkposy, - - - remkposx, - - - remkposy, - - - checkst, - - - autost, - - - cyclest, - - - timest, - - - upsuser, - - - upsdt, - - - morder, - - - daystartdt, - - - mthstartdt, - - - pid, - - - createauto, - - - createusers, - - - checkuser, - - - browseusers, - - - type, - - - generate_jurisdiction, - - - browse_jurisdiction, - - - generate_position, - - - browse_position, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{version,jdbcType=VARCHAR}, - - - #{rpttypeId,jdbcType=VARCHAR}, - - - #{rpttype,jdbcType=VARCHAR}, - - - #{modelname,jdbcType=VARCHAR}, - - - #{repname,jdbcType=VARCHAR}, - - - #{dtposx,jdbcType=VARCHAR}, - - - #{dtposy,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{memo,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{inputposx,jdbcType=VARCHAR}, - - - #{inputposy,jdbcType=VARCHAR}, - - - #{checkposx,jdbcType=VARCHAR}, - - - #{checkposy,jdbcType=VARCHAR}, - - - #{remkposx,jdbcType=VARCHAR}, - - - #{remkposy,jdbcType=VARCHAR}, - - - #{checkst,jdbcType=VARCHAR}, - - - #{autost,jdbcType=VARCHAR}, - - - #{cyclest,jdbcType=VARCHAR}, - - - #{timest,jdbcType=VARCHAR}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{daystartdt,jdbcType=VARCHAR}, - - - #{mthstartdt,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{createauto,jdbcType=VARCHAR}, - - - #{createusers,jdbcType=VARCHAR}, - - - #{checkuser,jdbcType=VARCHAR}, - - - #{browseusers,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{generateJurisdiction,jdbcType=VARCHAR}, - - - #{browseJurisdiction,jdbcType=VARCHAR}, - - - #{generatePosition,jdbcType=VARCHAR}, - - - #{browsePosition,jdbcType=VARCHAR}, - - - - - update TB_Report_RptInfoSet - - - name = #{name,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=VARCHAR}, - - - rpttype_id = #{rpttypeId,jdbcType=VARCHAR}, - - - rpttype = #{rpttype,jdbcType=VARCHAR}, - - - modelname = #{modelname,jdbcType=VARCHAR}, - - - repname = #{repname,jdbcType=VARCHAR}, - - - dtposx = #{dtposx,jdbcType=VARCHAR}, - - - dtposy = #{dtposy,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - inputposx = #{inputposx,jdbcType=VARCHAR}, - - - inputposy = #{inputposy,jdbcType=VARCHAR}, - - - checkposx = #{checkposx,jdbcType=VARCHAR}, - - - checkposy = #{checkposy,jdbcType=VARCHAR}, - - - remkposx = #{remkposx,jdbcType=VARCHAR}, - - - remkposy = #{remkposy,jdbcType=VARCHAR}, - - - checkst = #{checkst,jdbcType=VARCHAR}, - - - autost = #{autost,jdbcType=VARCHAR}, - - - cyclest = #{cyclest,jdbcType=VARCHAR}, - - - timest = #{timest,jdbcType=VARCHAR}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - daystartdt = #{daystartdt,jdbcType=VARCHAR}, - - - mthstartdt = #{mthstartdt,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - createauto = #{createauto,jdbcType=VARCHAR}, - - - createusers = #{createusers,jdbcType=VARCHAR}, - - - checkuser = #{checkuser,jdbcType=VARCHAR}, - - - browseusers = #{browseusers,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - generate_jurisdiction = #{generateJurisdiction,jdbcType=VARCHAR}, - - - browse_jurisdiction = #{browseJurisdiction,jdbcType=VARCHAR}, - - - generate_position = #{generatePosition,jdbcType=VARCHAR}, - - - browse_position = #{browsePosition,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptInfoSet - set name = #{name,jdbcType=VARCHAR}, - version = #{version,jdbcType=VARCHAR}, - rpttype_id = #{rpttypeId,jdbcType=VARCHAR}, - rpttype = #{rpttype,jdbcType=VARCHAR}, - modelname = #{modelname,jdbcType=VARCHAR}, - repname = #{repname,jdbcType=VARCHAR}, - dtposx = #{dtposx,jdbcType=VARCHAR}, - dtposy = #{dtposy,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - memo = #{memo,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - inputposx = #{inputposx,jdbcType=VARCHAR}, - inputposy = #{inputposy,jdbcType=VARCHAR}, - checkposx = #{checkposx,jdbcType=VARCHAR}, - checkposy = #{checkposy,jdbcType=VARCHAR}, - remkposx = #{remkposx,jdbcType=VARCHAR}, - remkposy = #{remkposy,jdbcType=VARCHAR}, - checkst = #{checkst,jdbcType=VARCHAR}, - autost = #{autost,jdbcType=VARCHAR}, - cyclest = #{cyclest,jdbcType=VARCHAR}, - timest = #{timest,jdbcType=VARCHAR}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - daystartdt = #{daystartdt,jdbcType=VARCHAR}, - mthstartdt = #{mthstartdt,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - createauto = #{createauto,jdbcType=VARCHAR}, - createusers = #{createusers,jdbcType=VARCHAR}, - checkuser = #{checkuser,jdbcType=VARCHAR}, - browseusers = #{browseusers,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - generate_jurisdiction = #{generateJurisdiction,jdbcType=VARCHAR}, - browse_jurisdiction = #{browseJurisdiction,jdbcType=VARCHAR}, - generate_position = #{generatePosition,jdbcType=VARCHAR}, - browse_position = #{browsePosition,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptInfoSet - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptInfoSetSheetMapper.xml b/src/com/sipai/mapper/report/RptInfoSetSheetMapper.xml deleted file mode 100644 index b4595a8a..00000000 --- a/src/com/sipai/mapper/report/RptInfoSetSheetMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - id, sheet_name, rptInfoSet_id - - - - delete from TB_Report_RptInfoSet_Sheet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptInfoSet_Sheet (id, sheet_name, rptInfoSet_id - ) - values (#{id,jdbcType=VARCHAR}, #{sheetName,jdbcType=VARCHAR}, #{rptinfosetId,jdbcType=VARCHAR} - ) - - - insert into TB_Report_RptInfoSet_Sheet - - - id, - - - sheet_name, - - - rptInfoSet_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{sheetName,jdbcType=VARCHAR}, - - - #{rptinfosetId,jdbcType=VARCHAR}, - - - - - update TB_Report_RptInfoSet_Sheet - - - sheet_name = #{sheetName,jdbcType=VARCHAR}, - - - rptInfoSet_id = #{rptinfosetId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptInfoSet_Sheet - set sheet_name = #{sheetName,jdbcType=VARCHAR}, - rptInfoSet_id = #{rptinfosetId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from TB_Report_RptInfoSet_Sheet - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptLogMapper.xml b/src/com/sipai/mapper/report/RptLogMapper.xml deleted file mode 100644 index 26ce69fa..00000000 --- a/src/com/sipai/mapper/report/RptLogMapper.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, posx, posy,posx_e,posy_e, remark, status, creat_id, sheet, type, before_value,after_value - - - - delete - from TB_Report_RptLog - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptLog (id, insdt, insuser, - posx, posy, posx_e,posy_e,remark, - status, creat_id, sheet, - type, before_value, after_value) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{posx,jdbcType=VARCHAR}, #{posy,jdbcType=VARCHAR}, - #{posxE,jdbcType=VARCHAR}, #{posyE,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, - #{status,jdbcType=INTEGER}, #{creatId,jdbcType=VARCHAR}, #{sheet,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{beforeValue,jdbcType=VARCHAR}, #{afterValue,jdbcType=VARCHAR}) - - - insert into TB_Report_RptLog - - - id, - - - insdt, - - - insuser, - - - posx, - - - posy, - - - posx_e, - - - posy_e, - - - remark, - - - status, - - - creat_id, - - - sheet, - - - type, - - - before_value, - - - after_value, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{posx,jdbcType=VARCHAR}, - - - #{posy,jdbcType=VARCHAR}, - - - #{posxE,jdbcType=VARCHAR}, - - - #{posyE,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - #{creatId,jdbcType=VARCHAR}, - - - #{sheet,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{beforeValue,jdbcType=VARCHAR}, - - - #{afterValue,jdbcType=VARCHAR}, - - - - - update TB_Report_RptLog - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=VARCHAR}, - - - posy = #{posy,jdbcType=VARCHAR}, - - - posx_e = #{posxE,jdbcType=VARCHAR}, - - - posy_e = #{posyE,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=INTEGER}, - - - creat_id = #{creatId,jdbcType=VARCHAR}, - - - sheet = #{sheet,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - before_value = #{beforeValue,jdbcType=VARCHAR}, - - - after_value = #{afterValue,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptLog - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=VARCHAR}, - posy = #{posy,jdbcType=VARCHAR}, - posx_e = #{posxE,jdbcType=VARCHAR}, - posy_e = #{posyE,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - status = #{status,jdbcType=INTEGER}, - creat_id = #{creatId,jdbcType=VARCHAR}, - sheet = #{sheet,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - before_value = #{beforeValue,jdbcType=VARCHAR}, - after_value = #{afterValue,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_Report_RptLog ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptMpSetMapper.xml b/src/com/sipai/mapper/report/RptMpSetMapper.xml deleted file mode 100644 index 6e6c83e1..00000000 --- a/src/com/sipai/mapper/report/RptMpSetMapper.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - id, pid, mpid, datatype, collectmode, biz_id, unit_id, insuser, insdt, morder - - - - delete from TB_Report_RptMpSet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptMpSet (id, pid, mpid, - datatype, collectmode, biz_id, - unit_id, insuser, insdt, - morder) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{dataType,jdbcType=VARCHAR}, #{collectMode,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{morder,jdbcType=INTEGER}) - - - insert into TB_Report_RptMpSet - - - id, - - - pid, - - - mpid, - - - datatype, - - - collectmode, - - - biz_id, - - - unit_id, - - - insuser, - - - insdt, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{dataType,jdbcType=VARCHAR}, - - - #{collectMode,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_Report_RptMpSet - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - datatype = #{dataType,jdbcType=VARCHAR}, - - - collectmode = #{collectMode,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptMpSet - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - datatype = #{dataType,jdbcType=VARCHAR}, - collectmode = #{collectMode,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_RptMpSet - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptSpSetMapper.xml b/src/com/sipai/mapper/report/RptSpSetMapper.xml deleted file mode 100644 index 2851bf10..00000000 --- a/src/com/sipai/mapper/report/RptSpSetMapper.xml +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , pid, spname, rownum, colnum, sheet, posx, posy, type, intv,intv_type, starthour, endhour, biz_id, - unit_id, insuser, insdt, upsuser, upsdt, morder, rptsdt, rptedt, writermode, business,grouptype_id,grouptime_id, active - - - - delete - from TB_Report_RptSpSet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptSpSet (id, pid, spname, - rownum, colnum, sheet, - posx, posy, type, intv,intv_type, - starthour, endhour, biz_id, unit_id, - insuser, insdt, upsuser, - upsdt, morder, rptsdt, - rptedt, writermode, business, grouptype_id, grouptime_id, active) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{spname,jdbcType=VARCHAR}, - #{rownum,jdbcType=VARCHAR}, #{colnum,jdbcType=VARCHAR}, #{sheet,jdbcType=VARCHAR}, - #{posx,jdbcType=VARCHAR}, #{posy,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{intv,jdbcType=VARCHAR},#{intvType,jdbcType=VARCHAR}, - #{starthour,jdbcType=VARCHAR}, #{endhour,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, #{rptsdt,jdbcType=VARCHAR}, - #{rptedt,jdbcType=VARCHAR}, #{writermode,jdbcType=VARCHAR}, #{business,jdbcType=VARCHAR}, - #{grouptypeId,jdbcType=VARCHAR}, #{grouptimeId,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}) - - - insert into TB_Report_RptSpSet - - - id, - - - pid, - - - spname, - - - rownum, - - - colnum, - - - sheet, - - - posx, - - - posy, - - - type, - - - intv, - - - intv_type, - - - starthour, - - - endhour, - - - biz_id, - - - unit_id, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - morder, - - - rptsdt, - - - rptedt, - - - writermode, - - - business, - - - grouptype_id, - - - grouptime_id, - - - active, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{spname,jdbcType=VARCHAR}, - - - #{rownum,jdbcType=VARCHAR}, - - - #{colnum,jdbcType=VARCHAR}, - - - #{sheet,jdbcType=VARCHAR}, - - - #{posx,jdbcType=VARCHAR}, - - - #{posy,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{intv,jdbcType=VARCHAR}, - - - #{intvType,jdbcType=VARCHAR}, - - - #{starthour,jdbcType=VARCHAR}, - - - #{endhour,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{rptsdt,jdbcType=VARCHAR}, - - - #{rptedt,jdbcType=VARCHAR}, - - - #{writermode,jdbcType=VARCHAR}, - - - #{business,jdbcType=VARCHAR}, - - - #{grouptypeId,jdbcType=VARCHAR}, - - - #{grouptimeId,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - - - update TB_Report_RptSpSet - - - pid = #{pid,jdbcType=VARCHAR}, - - - spname = #{spname,jdbcType=VARCHAR}, - - - rownum = #{rownum,jdbcType=VARCHAR}, - - - colnum = #{colnum,jdbcType=VARCHAR}, - - - sheet = #{sheet,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=VARCHAR}, - - - posy = #{posy,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - intv = #{intv,jdbcType=VARCHAR}, - - - intv_type = #{intvType,jdbcType=VARCHAR}, - - - starthour = #{starthour,jdbcType=VARCHAR}, - - - endhour = #{endhour,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - rptsdt = #{rptsdt,jdbcType=VARCHAR}, - - - rptedt = #{rptedt,jdbcType=VARCHAR}, - - - writermode = #{writermode,jdbcType=VARCHAR}, - - - business = #{business,jdbcType=VARCHAR}, - - - grouptype_id = #{grouptypeId,jdbcType=VARCHAR}, - - - grouptime_id = #{grouptimeId,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptSpSet - set pid = #{pid,jdbcType=VARCHAR}, - spname = #{spname,jdbcType=VARCHAR}, - rownum = #{rownum,jdbcType=VARCHAR}, - colnum = #{colnum,jdbcType=VARCHAR}, - sheet = #{sheet,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=VARCHAR}, - posy = #{posy,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - intv = #{intv,jdbcType=VARCHAR}, - intv_type = #{intvType,jdbcType=VARCHAR}, - starthour = #{starthour,jdbcType=VARCHAR}, - endhour = #{endhour,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - rptsdt = #{rptsdt,jdbcType=VARCHAR}, - rptedt = #{rptedt,jdbcType=VARCHAR}, - writermode = #{writermode,jdbcType=VARCHAR}, - business = #{business,jdbcType=VARCHAR}, - grouptype_id = #{grouptypeId,jdbcType=VARCHAR}, - grouptime_id = #{grouptimeId,jdbcType=VARCHAR} active = #{active,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_Report_RptSpSet ${where} - - - update TB_Report_RptSpSet - - rptsdt = '${rptsdt}', - starthour = '${starthour}' - - where pid = '${pid}' - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/RptTypeSetMapper.xml b/src/com/sipai/mapper/report/RptTypeSetMapper.xml deleted file mode 100644 index df4bb333..00000000 --- a/src/com/sipai/mapper/report/RptTypeSetMapper.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - id, pid, name, type, biz_id, unit_id, insuser, insdt, morder, remark - - - - - delete from TB_Report_RptTypeSet - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_RptTypeSet (id, pid, name, - type, biz_id, unit_id, - insuser, insdt, morder, - remark) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, - #{remark,jdbcType=VARCHAR}) - - - insert into TB_Report_RptTypeSet - - - id, - - - pid, - - - name, - - - type, - - - biz_id, - - - unit_id, - - - insuser, - - - insdt, - - - morder, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_Report_RptTypeSet - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_RptTypeSet - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/TemplateFileMapper.xml b/src/com/sipai/mapper/report/TemplateFileMapper.xml deleted file mode 100644 index dacb08c0..00000000 --- a/src/com/sipai/mapper/report/TemplateFileMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, masterid, filename, abspath, filepath, type, size - - - - delete from TB_Report_TemplateFile - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_TemplateFile (id, insdt, insuser, - masterid, filename, abspath, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into TB_Report_TemplateFile - - - id, - - - insdt, - - - insuser, - - - masterid, - - - filename, - - - abspath, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update TB_Report_TemplateFile - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_TemplateFile - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Report_TemplateFile - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/report/TemplateTypeMapper.xml b/src/com/sipai/mapper/report/TemplateTypeMapper.xml deleted file mode 100644 index b32b9abe..00000000 --- a/src/com/sipai/mapper/report/TemplateTypeMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, name, pid, remark, service_name, type - - - - delete from TB_Report_TemplateType - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Report_TemplateType (id, insdt, insuser, - name, pid, remark, - service_name, type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{serviceName,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR}) - - - insert into TB_Report_TemplateType - - - id, - - - insdt, - - - insuser, - - - name, - - - pid, - - - remark, - - - service_name, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{serviceName,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_Report_TemplateType - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - service_name = #{serviceName,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Report_TemplateType - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - service_name = #{serviceName,jdbcType=VARCHAR}, - type = #{serviceName,jdbcType=VARCHAR} - where id = #{type,jdbcType=VARCHAR} - - - - delete from TB_Report_TemplateType - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyCertificateMapper.xml b/src/com/sipai/mapper/safety/SafetyCertificateMapper.xml deleted file mode 100644 index 7c62e7f8..00000000 --- a/src/com/sipai/mapper/safety/SafetyCertificateMapper.xml +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, userid, certificate_name, certificate_no, job_code, job_type, issuing_authority, - issue_date, expiration_date, create_time, flag - - - - sc.id, sc.userid, sc.certificate_name, sc.certificate_no, sc.job_code, sc.job_type, sc.issuing_authority, - sc.issue_date, sc.expiration_date, sc.create_time, sc.flag - - - - - delete from tb_safety_certificate - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_certificate (id, userid, certificate_name, - certificate_no, job_code, job_type, issuing_authority, issue_date, expiration_date, - create_time, flag) - values (#{id,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{certificateName,jdbcType=VARCHAR}, - #{certificateNo,jdbcType=VARCHAR}, #{jobCode,jdbcType=VARCHAR}, #{jobType,jdbcType=VARCHAR}, - #{issuingAuthority,jdbcType=VARCHAR}, #{issueDate,jdbcType=DATE}, #{expirationDate,jdbcType=DATE}, - GETDATE(), #{flag,jdbcType=VARCHAR}) - - - insert into tb_safety_certificate - - - id, - - - userid, - - - certificate_name, - - - certificate_no, - - - job_code, - - - job_type, - - - issuing_authority, - - - issue_date, - - - expiration_date, - - flag, - create_time - - - - #{id,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{certificateName,jdbcType=VARCHAR}, - - - #{certificateNo,jdbcType=VARCHAR}, - - - #{jobCode,jdbcType=VARCHAR}, - - - #{jobType,jdbcType=VARCHAR}, - - - #{issuingAuthority,jdbcType=VARCHAR}, - - - #{issueDate,jdbcType=DATE}, - - - #{expirationDate,jdbcType=DATE}, - - #{flag,jdbcType=VARCHAR}, - GETDATE() - - - - update tb_safety_certificate - - - userid = #{userid,jdbcType=VARCHAR}, - - - certificate_name = #{certificateName,jdbcType=VARCHAR}, - - - certificate_no = #{certificateNo,jdbcType=VARCHAR}, - - - job_code = #{jobCode,jdbcType=VARCHAR}, - - - job_type = #{jobType,jdbcType=VARCHAR}, - - - issuing_authority = #{issuingAuthority,jdbcType=VARCHAR}, - - - issue_date = #{issueDate,jdbcType=DATE}, - - - expiration_date = #{expirationDate,jdbcType=DATE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_certificate - set userid = #{userid,jdbcType=VARCHAR}, - certificate_name = #{certificateName,jdbcType=VARCHAR}, - certificate_no = #{certificateNo,jdbcType=VARCHAR}, - job_code = #{jobCode,jdbcType=VARCHAR}, - job_type = #{jobType,jdbcType=VARCHAR}, - issuing_authority = #{issuingAuthority,jdbcType=VARCHAR}, - issue_date = #{issueDate,jdbcType=DATE}, - expiration_date = #{expirationDate,jdbcType=DATE} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - - - - - - diff --git a/src/com/sipai/mapper/safety/SafetyCheckComprehensiveMapper.xml b/src/com/sipai/mapper/safety/SafetyCheckComprehensiveMapper.xml deleted file mode 100644 index 37799cfd..00000000 --- a/src/com/sipai/mapper/safety/SafetyCheckComprehensiveMapper.xml +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, check_code, check_type, check_date, check_place, checker_id, checker_name, recorder_id, - recorder_name, check_result, check_result_detail, check_remark, duty_dept_id, duty_dept_name, - duty_user_id, duty_user_name, copy_user_id, create_user_id, create_user_name, copy_user_name, - corrective_action, confirm_user_id, confirm_user_name, status - - - - delete from tb_safety_check_comprehensive - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_check_comprehensive (id, check_code, check_type, - check_date, check_place, checker_id, - checker_name, recorder_id, recorder_name, - check_result, check_result_detail, check_remark, - duty_dept_id, duty_dept_name, duty_user_id, - duty_user_name, copy_user_id, create_user_id, - create_user_name, copy_user_name, corrective_action, - confirm_user_id, confirm_user_name, status - ) - values (#{id,jdbcType=VARCHAR}, #{checkCode,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR}, - #{checkDate,jdbcType=TIMESTAMP}, #{checkPlace,jdbcType=VARCHAR}, #{checkerId,jdbcType=VARCHAR}, - #{checkerName,jdbcType=VARCHAR}, #{recorderId,jdbcType=VARCHAR}, #{recorderName,jdbcType=VARCHAR}, - #{checkResult,jdbcType=TINYINT}, #{checkResultDetail,jdbcType=VARCHAR}, #{checkRemark,jdbcType=VARCHAR}, - #{dutyDeptId,jdbcType=VARCHAR}, #{dutyDeptName,jdbcType=VARCHAR}, #{dutyUserId,jdbcType=VARCHAR}, - #{dutyUserName,jdbcType=VARCHAR}, #{copyUserId,jdbcType=VARCHAR}, #{createUserId,jdbcType=VARCHAR}, - #{createUserName,jdbcType=VARCHAR}, #{copyUserName,jdbcType=VARCHAR}, #{correctiveAction,jdbcType=VARCHAR}, - #{confirmUserId,jdbcType=VARCHAR}, #{confirmUserName,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT} - ) - - - insert into tb_safety_check_comprehensive - - - id, - - - check_code, - - - check_type, - - - check_date, - - - check_place, - - - checker_id, - - - checker_name, - - - recorder_id, - - - recorder_name, - - - check_result, - - - check_result_detail, - - - check_remark, - - - duty_dept_id, - - - duty_dept_name, - - - duty_user_id, - - - duty_user_name, - - - copy_user_id, - - - create_user_id, - - - create_user_name, - - - copy_user_name, - - - corrective_action, - - - confirm_user_id, - - - confirm_user_name, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{checkCode,jdbcType=VARCHAR}, - - - #{checkType,jdbcType=VARCHAR}, - - - #{checkDate,jdbcType=TIMESTAMP}, - - - #{checkPlace,jdbcType=VARCHAR}, - - - #{checkerId,jdbcType=VARCHAR}, - - - #{checkerName,jdbcType=VARCHAR}, - - - #{recorderId,jdbcType=VARCHAR}, - - - #{recorderName,jdbcType=VARCHAR}, - - - #{checkResult,jdbcType=TINYINT}, - - - #{checkResultDetail,jdbcType=VARCHAR}, - - - #{checkRemark,jdbcType=VARCHAR}, - - - #{dutyDeptId,jdbcType=VARCHAR}, - - - #{dutyDeptName,jdbcType=VARCHAR}, - - - #{dutyUserId,jdbcType=VARCHAR}, - - - #{dutyUserName,jdbcType=VARCHAR}, - - - #{copyUserId,jdbcType=VARCHAR}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createUserName,jdbcType=VARCHAR}, - - - #{copyUserName,jdbcType=VARCHAR}, - - - #{correctiveAction,jdbcType=VARCHAR}, - - - #{confirmUserId,jdbcType=VARCHAR}, - - - #{confirmUserName,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - - - update tb_safety_check_comprehensive - - - check_code = #{checkCode,jdbcType=VARCHAR}, - - - check_type = #{checkType,jdbcType=VARCHAR}, - - - check_date = #{checkDate,jdbcType=TIMESTAMP}, - - - check_place = #{checkPlace,jdbcType=VARCHAR}, - - - checker_id = #{checkerId,jdbcType=VARCHAR}, - - - checker_name = #{checkerName,jdbcType=VARCHAR}, - - - recorder_id = #{recorderId,jdbcType=VARCHAR}, - - - recorder_name = #{recorderName,jdbcType=VARCHAR}, - - - check_result = #{checkResult,jdbcType=TINYINT}, - - - check_result_detail = #{checkResultDetail,jdbcType=VARCHAR}, - - - check_remark = #{checkRemark,jdbcType=VARCHAR}, - - - duty_dept_id = #{dutyDeptId,jdbcType=VARCHAR}, - - - duty_dept_name = #{dutyDeptName,jdbcType=VARCHAR}, - - - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - - - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - - - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_user_name = #{createUserName,jdbcType=VARCHAR}, - - - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - - - corrective_action = #{correctiveAction,jdbcType=VARCHAR}, - - - confirm_user_id = #{confirmUserId,jdbcType=VARCHAR}, - - - confirm_user_name = #{confirmUserName,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_check_comprehensive - set check_code = #{checkCode,jdbcType=VARCHAR}, - check_type = #{checkType,jdbcType=VARCHAR}, - check_date = #{checkDate,jdbcType=TIMESTAMP}, - check_place = #{checkPlace,jdbcType=VARCHAR}, - checker_id = #{checkerId,jdbcType=VARCHAR}, - checker_name = #{checkerName,jdbcType=VARCHAR}, - recorder_id = #{recorderId,jdbcType=VARCHAR}, - recorder_name = #{recorderName,jdbcType=VARCHAR}, - check_result = #{checkResult,jdbcType=TINYINT}, - check_result_detail = #{checkResultDetail,jdbcType=VARCHAR}, - check_remark = #{checkRemark,jdbcType=VARCHAR}, - duty_dept_id = #{dutyDeptId,jdbcType=VARCHAR}, - duty_dept_name = #{dutyDeptName,jdbcType=VARCHAR}, - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_user_name = #{createUserName,jdbcType=VARCHAR}, - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - corrective_action = #{correctiveAction,jdbcType=VARCHAR}, - confirm_user_id = #{confirmUserId,jdbcType=VARCHAR}, - confirm_user_name = #{confirmUserName,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT} - where id = #{id,jdbcType=VARCHAR} - - - - diff --git a/src/com/sipai/mapper/safety/SafetyCheckDaylyMapper.xml b/src/com/sipai/mapper/safety/SafetyCheckDaylyMapper.xml deleted file mode 100644 index 55493e1a..00000000 --- a/src/com/sipai/mapper/safety/SafetyCheckDaylyMapper.xml +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, check_code, check_date, checker_id, checker_name, check_result, check_result_detail, - check_remark, duty_dept_id, duty_dept_name, duty_user_id, duty_user_name, copy_user_id, - corrective_action, confirm_user_id, confirm_user_name, status, create_user_id, create_user_name, - copy_user_name - - - - delete from tb_safety_check_dayly - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_check_dayly (id, check_code, check_date, - checker_id, checker_name, check_result, - check_result_detail, check_remark, duty_dept_id, - duty_dept_name, duty_user_id, duty_user_name, - copy_user_id, corrective_action, confirm_user_id, - confirm_user_name, status, create_user_id, - create_user_name, copy_user_name) - values (#{id,jdbcType=VARCHAR}, #{checkCode,jdbcType=VARCHAR}, #{checkDate,jdbcType=TIMESTAMP}, - #{checkerId,jdbcType=VARCHAR}, #{checkerName,jdbcType=VARCHAR}, #{checkResult,jdbcType=TINYINT}, - #{checkResultDetail,jdbcType=VARCHAR}, #{checkRemark,jdbcType=VARCHAR}, #{dutyDeptId,jdbcType=VARCHAR}, - #{dutyDeptName,jdbcType=VARCHAR}, #{dutyUserId,jdbcType=VARCHAR}, #{dutyUserName,jdbcType=VARCHAR}, - #{copyUserId,jdbcType=VARCHAR}, #{correctiveAction,jdbcType=VARCHAR}, #{confirmUserId,jdbcType=VARCHAR}, - #{confirmUserName,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{createUserId,jdbcType=VARCHAR}, - #{createUserName,jdbcType=VARCHAR}, #{copyUserName,jdbcType=VARCHAR}) - - - insert into tb_safety_check_dayly - - - id, - - - check_code, - - - check_date, - - - checker_id, - - - checker_name, - - - check_result, - - - check_result_detail, - - - check_remark, - - - duty_dept_id, - - - duty_dept_name, - - - duty_user_id, - - - duty_user_name, - - - copy_user_id, - - - corrective_action, - - - confirm_user_id, - - - confirm_user_name, - - - status, - - - create_user_id, - - - create_user_name, - - - copy_user_name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{checkCode,jdbcType=VARCHAR}, - - - #{checkDate,jdbcType=TIMESTAMP}, - - - #{checkerId,jdbcType=VARCHAR}, - - - #{checkerName,jdbcType=VARCHAR}, - - - #{checkResult,jdbcType=TINYINT}, - - - #{checkResultDetail,jdbcType=VARCHAR}, - - - #{checkRemark,jdbcType=VARCHAR}, - - - #{dutyDeptId,jdbcType=VARCHAR}, - - - #{dutyDeptName,jdbcType=VARCHAR}, - - - #{dutyUserId,jdbcType=VARCHAR}, - - - #{dutyUserName,jdbcType=VARCHAR}, - - - #{copyUserId,jdbcType=VARCHAR}, - - - #{correctiveAction,jdbcType=VARCHAR}, - - - #{confirmUserId,jdbcType=VARCHAR}, - - - #{confirmUserName,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createUserName,jdbcType=VARCHAR}, - - - #{copyUserName,jdbcType=VARCHAR}, - - - - - update tb_safety_check_dayly - - - check_code = #{checkCode,jdbcType=VARCHAR}, - - - check_date = #{checkDate,jdbcType=TIMESTAMP}, - - - checker_id = #{checkerId,jdbcType=VARCHAR}, - - - checker_name = #{checkerName,jdbcType=VARCHAR}, - - - check_result = #{checkResult,jdbcType=TINYINT}, - - - check_result_detail = #{checkResultDetail,jdbcType=VARCHAR}, - - - check_remark = #{checkRemark,jdbcType=VARCHAR}, - - - duty_dept_id = #{dutyDeptId,jdbcType=VARCHAR}, - - - duty_dept_name = #{dutyDeptName,jdbcType=VARCHAR}, - - - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - - - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - - - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - - - corrective_action = #{correctiveAction,jdbcType=VARCHAR}, - - - confirm_user_id = #{confirmUserId,jdbcType=VARCHAR}, - - - confirm_user_name = #{confirmUserName,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_user_name = #{createUserName,jdbcType=VARCHAR}, - - - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_check_dayly - set check_code = #{checkCode,jdbcType=VARCHAR}, - check_date = #{checkDate,jdbcType=TIMESTAMP}, - checker_id = #{checkerId,jdbcType=VARCHAR}, - checker_name = #{checkerName,jdbcType=VARCHAR}, - check_result = #{checkResult,jdbcType=TINYINT}, - check_result_detail = #{checkResultDetail,jdbcType=VARCHAR}, - check_remark = #{checkRemark,jdbcType=VARCHAR}, - duty_dept_id = #{dutyDeptId,jdbcType=VARCHAR}, - duty_dept_name = #{dutyDeptName,jdbcType=VARCHAR}, - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - corrective_action = #{correctiveAction,jdbcType=VARCHAR}, - confirm_user_id = #{confirmUserId,jdbcType=VARCHAR}, - confirm_user_name = #{confirmUserName,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_user_name = #{createUserName,jdbcType=VARCHAR}, - copy_user_name = #{copyUserName,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyCheckSpecialMapper.xml b/src/com/sipai/mapper/safety/SafetyCheckSpecialMapper.xml deleted file mode 100644 index a84273d6..00000000 --- a/src/com/sipai/mapper/safety/SafetyCheckSpecialMapper.xml +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, check_code, check_item, check_date, check_place, checker_id, checker_name, recorder_id, - recorder_name, check_result, check_result_detail, check_remark, duty_dept_id, duty_dept_name, - duty_user_id, duty_user_name, copy_user_id, copy_user_name, create_user_id, create_user_name, - corrective_action, confirm_user_id, confirm_user_name, status - - - - delete from tb_safety_check_special - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_check_special (id, check_code, check_item, - check_date, check_place, checker_id, - checker_name, recorder_id, recorder_name, - check_result, check_result_detail, check_remark, - duty_dept_id, duty_dept_name, duty_user_id, - duty_user_name, copy_user_id, copy_user_name, - create_user_id, create_user_name, corrective_action, - confirm_user_id, confirm_user_name, status - ) - values (#{id,jdbcType=VARCHAR}, #{checkCode,jdbcType=VARCHAR}, #{checkItem,jdbcType=INTEGER}, - #{checkDate,jdbcType=TIMESTAMP}, #{checkPlace,jdbcType=VARCHAR}, #{checkerId,jdbcType=VARCHAR}, - #{checkerName,jdbcType=VARCHAR}, #{recorderId,jdbcType=VARCHAR}, #{recorderName,jdbcType=VARCHAR}, - #{checkResult,jdbcType=TINYINT}, #{checkResultDetail,jdbcType=VARCHAR}, #{checkRemark,jdbcType=VARCHAR}, - #{dutyDeptId,jdbcType=VARCHAR}, #{dutyDeptName,jdbcType=VARCHAR}, #{dutyUserId,jdbcType=VARCHAR}, - #{dutyUserName,jdbcType=VARCHAR}, #{copyUserId,jdbcType=VARCHAR}, #{copyUserName,jdbcType=VARCHAR}, - #{createUserId,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, #{correctiveAction,jdbcType=VARCHAR}, - #{confirmUserId,jdbcType=VARCHAR}, #{confirmUserName,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT} - ) - - - insert into tb_safety_check_special - - - id, - - - check_code, - - - check_item, - - - check_date, - - - check_place, - - - checker_id, - - - checker_name, - - - recorder_id, - - - recorder_name, - - - check_result, - - - check_result_detail, - - - check_remark, - - - duty_dept_id, - - - duty_dept_name, - - - duty_user_id, - - - duty_user_name, - - - copy_user_id, - - - copy_user_name, - - - create_user_id, - - - create_user_name, - - - corrective_action, - - - confirm_user_id, - - - confirm_user_name, - - - status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{checkCode,jdbcType=VARCHAR}, - - - #{checkItem,jdbcType=INTEGER}, - - - #{checkDate,jdbcType=TIMESTAMP}, - - - #{checkPlace,jdbcType=VARCHAR}, - - - #{checkerId,jdbcType=VARCHAR}, - - - #{checkerName,jdbcType=VARCHAR}, - - - #{recorderId,jdbcType=VARCHAR}, - - - #{recorderName,jdbcType=VARCHAR}, - - - #{checkResult,jdbcType=TINYINT}, - - - #{checkResultDetail,jdbcType=VARCHAR}, - - - #{checkRemark,jdbcType=VARCHAR}, - - - #{dutyDeptId,jdbcType=VARCHAR}, - - - #{dutyDeptName,jdbcType=VARCHAR}, - - - #{dutyUserId,jdbcType=VARCHAR}, - - - #{dutyUserName,jdbcType=VARCHAR}, - - - #{copyUserId,jdbcType=VARCHAR}, - - - #{copyUserName,jdbcType=VARCHAR}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createUserName,jdbcType=VARCHAR}, - - - #{correctiveAction,jdbcType=VARCHAR}, - - - #{confirmUserId,jdbcType=VARCHAR}, - - - #{confirmUserName,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - - - update tb_safety_check_special - - - check_code = #{checkCode,jdbcType=VARCHAR}, - - - check_item = #{checkItem,jdbcType=INTEGER}, - - - check_date = #{checkDate,jdbcType=TIMESTAMP}, - - - check_place = #{checkPlace,jdbcType=VARCHAR}, - - - checker_id = #{checkerId,jdbcType=VARCHAR}, - - - checker_name = #{checkerName,jdbcType=VARCHAR}, - - - recorder_id = #{recorderId,jdbcType=VARCHAR}, - - - recorder_name = #{recorderName,jdbcType=VARCHAR}, - - - check_result = #{checkResult,jdbcType=TINYINT}, - - - check_result_detail = #{checkResultDetail,jdbcType=VARCHAR}, - - - check_remark = #{checkRemark,jdbcType=VARCHAR}, - - - duty_dept_id = #{dutyDeptId,jdbcType=VARCHAR}, - - - duty_dept_name = #{dutyDeptName,jdbcType=VARCHAR}, - - - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - - - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - - - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - - - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_user_name = #{createUserName,jdbcType=VARCHAR}, - - - corrective_action = #{correctiveAction,jdbcType=VARCHAR}, - - - confirm_user_id = #{confirmUserId,jdbcType=VARCHAR}, - - - confirm_user_name = #{confirmUserName,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_check_special - set check_code = #{checkCode,jdbcType=VARCHAR}, - check_item = #{checkItem,jdbcType=INTEGER}, - check_date = #{checkDate,jdbcType=TIMESTAMP}, - check_place = #{checkPlace,jdbcType=VARCHAR}, - checker_id = #{checkerId,jdbcType=VARCHAR}, - checker_name = #{checkerName,jdbcType=VARCHAR}, - recorder_id = #{recorderId,jdbcType=VARCHAR}, - recorder_name = #{recorderName,jdbcType=VARCHAR}, - check_result = #{checkResult,jdbcType=TINYINT}, - check_result_detail = #{checkResultDetail,jdbcType=VARCHAR}, - check_remark = #{checkRemark,jdbcType=VARCHAR}, - duty_dept_id = #{dutyDeptId,jdbcType=VARCHAR}, - duty_dept_name = #{dutyDeptName,jdbcType=VARCHAR}, - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_user_name = #{createUserName,jdbcType=VARCHAR}, - corrective_action = #{correctiveAction,jdbcType=VARCHAR}, - confirm_user_id = #{confirmUserId,jdbcType=VARCHAR}, - confirm_user_name = #{confirmUserName,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT} - where id = #{id,jdbcType=VARCHAR} - - - - - diff --git a/src/com/sipai/mapper/safety/SafetyEducationBuilderMapper.xml b/src/com/sipai/mapper/safety/SafetyEducationBuilderMapper.xml deleted file mode 100644 index 28c656c4..00000000 --- a/src/com/sipai/mapper/safety/SafetyEducationBuilderMapper.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - id, education_code, education_date, gender, name, company, deadline, file_id,safety_job_id - - - - delete - from tb_safety_education_builder - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_education_builder (id, education_code, education_date, - gender, name, company, - deadline, file_id,safety_job_id) - values (#{id,jdbcType=VARCHAR}, #{educationCode,jdbcType=VARCHAR}, #{educationDate,jdbcType=TIMESTAMP}, - #{gender,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, - #{deadline,jdbcType=TIMESTAMP}, #{fileId,jdbcType=VARCHAR},#{safetyJobId,jdbcType=VARCHAR} - ) - - - insert into tb_safety_education_builder - - - id, - - - education_code, - - - education_date, - - - gender, - - - name, - - - company, - - - deadline, - - - file_id, - - - safety_job_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{educationCode,jdbcType=VARCHAR}, - - - #{educationDate,jdbcType=TIMESTAMP}, - - - #{gender,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{company,jdbcType=VARCHAR}, - - - #{deadline,jdbcType=TIMESTAMP}, - - - #{fileId,jdbcType=VARCHAR}, - - - #{safetyJobId,jdbcType=VARCHAR}, - - - - - update tb_safety_education_builder - - - education_code = #{educationCode,jdbcType=VARCHAR}, - - - education_date = #{educationDate,jdbcType=TIMESTAMP}, - - - gender = #{gender,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - company = #{company,jdbcType=VARCHAR}, - - - deadline = #{deadline,jdbcType=TIMESTAMP}, - - - file_id = #{fileId,jdbcType=VARCHAR}, - - - safety_job_id = #{safetyJobId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_education_builder - set education_code = #{educationCode,jdbcType=VARCHAR}, - education_date = #{educationDate,jdbcType=TIMESTAMP}, - gender = #{gender,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - company = #{company,jdbcType=VARCHAR}, - deadline = #{deadline,jdbcType=TIMESTAMP}, - file_id = #{fileId,jdbcType=VARCHAR}, - safety_job_id = #{safetyJobId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyEducationInsiderMapper.xml b/src/com/sipai/mapper/safety/SafetyEducationInsiderMapper.xml deleted file mode 100644 index 78a2a72a..00000000 --- a/src/com/sipai/mapper/safety/SafetyEducationInsiderMapper.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, education_type, education_code, userid, idcard, birthday, work_time, hiredate, - post, duty, job_title, point, gender, file_id, user_card_id, dept_name,user_name,dept_id,job_inside_id - - - - delete - from tb_safety_education_insider - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_education_insider (id, education_type, education_code, - userid, idcard, birthday, - work_time, hiredate, post, - duty, job_title, point, - gender, file_id, user_card_id, - dept_name, user_name, dept_id,job_inside_id) - values (#{id,jdbcType=VARCHAR}, #{educationType,jdbcType=TINYINT}, #{educationCode,jdbcType=VARCHAR}, - #{userid,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE}, - #{workTime,jdbcType=DATE}, #{hiredate,jdbcType=DATE}, #{post,jdbcType=VARCHAR}, - #{duty,jdbcType=VARCHAR}, #{jobTitle,jdbcType=VARCHAR}, #{point,jdbcType=DECIMAL}, - #{gender,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}, #{userCardId,jdbcType=VARCHAR}, - #{deptName,jdbcType=VARCHAR}, - #{userName,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, - #{jobInsideId,jdbcType=VARCHAR} - ) - - - insert into tb_safety_education_insider - - - id, - - - education_type, - - - education_code, - - - userid, - - - idcard, - - - birthday, - - - work_time, - - - hiredate, - - - post, - - - duty, - - - job_title, - - - point, - - - gender, - - - file_id, - - - user_card_id, - - - dept_name, - - - user_name, - - - - dept_id, - - - job_inside_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{educationType,jdbcType=TINYINT}, - - - #{educationCode,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{idcard,jdbcType=VARCHAR}, - - - #{birthday,jdbcType=DATE}, - - - #{workTime,jdbcType=DATE}, - - - #{hiredate,jdbcType=DATE}, - - - #{post,jdbcType=VARCHAR}, - - - #{duty,jdbcType=VARCHAR}, - - - #{jobTitle,jdbcType=VARCHAR}, - - - #{point,jdbcType=DECIMAL}, - - - #{gender,jdbcType=VARCHAR}, - - - #{fileId,jdbcType=VARCHAR}, - - - #{userCardId,jdbcType=VARCHAR}, - - - #{deptName,jdbcType=VARCHAR}, - - - #{userName,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{jobInsideId,jdbcType=VARCHAR}, - - - - - update tb_safety_education_insider - - - education_type = #{educationType,jdbcType=TINYINT}, - - - education_code = #{educationCode,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - idcard = #{idcard,jdbcType=VARCHAR}, - - - birthday = #{birthday,jdbcType=DATE}, - - - work_time = #{workTime,jdbcType=DATE}, - - - hiredate = #{hiredate,jdbcType=DATE}, - - - post = #{post,jdbcType=VARCHAR}, - - - duty = #{duty,jdbcType=VARCHAR}, - - - job_title = #{jobTitle,jdbcType=VARCHAR}, - - - point = #{point,jdbcType=DECIMAL}, - - - gender = #{gender,jdbcType=VARCHAR}, - - - file_id = #{fileId,jdbcType=VARCHAR}, - - - user_card_id = #{userCardId,jdbcType=VARCHAR}, - - - dept_name = #{deptName,jdbcType=VARCHAR}, - - - user_name = #{userName,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - job_inside_id = #{jobInsideId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_education_insider - set education_type = #{educationType,jdbcType=TINYINT}, - education_code = #{educationCode,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR}, - idcard = #{idcard,jdbcType=VARCHAR}, - birthday = #{birthday,jdbcType=DATE}, - work_time = #{workTime,jdbcType=DATE}, - hiredate = #{hiredate,jdbcType=DATE}, - post = #{post,jdbcType=VARCHAR}, - duty = #{duty,jdbcType=VARCHAR}, - job_title = #{jobTitle,jdbcType=VARCHAR}, - point = #{point,jdbcType=DECIMAL}, - gender = #{gender,jdbcType=VARCHAR}, - file_id = #{fileId,jdbcType=VARCHAR}, - user_card_id = #{userCardId,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, - user_name = #{userName,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - job_inside_id = #{jobInsideId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyEducationTraineeMapper.xml b/src/com/sipai/mapper/safety/SafetyEducationTraineeMapper.xml deleted file mode 100644 index 7d703424..00000000 --- a/src/com/sipai/mapper/safety/SafetyEducationTraineeMapper.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - id, education_code, education_date, gender, name, company, dept_name, post, deadline, - file_id,dept_id - - - - delete from tb_safety_education_trainee - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_education_trainee (id, education_code, education_date, - gender, name, company, - dept_name, post, deadline, - file_id,dept_id) - values (#{id,jdbcType=VARCHAR}, #{educationCode,jdbcType=VARCHAR}, #{educationDate,jdbcType=TIMESTAMP}, - #{gender,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, - #{deptName,jdbcType=VARCHAR}, #{post,jdbcType=VARCHAR}, #{deadline,jdbcType=TIMESTAMP}, - #{fileId,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}) - - - insert into tb_safety_education_trainee - - - id, - - - education_code, - - - education_date, - - - gender, - - - name, - - - company, - - - dept_name, - - - post, - - - deadline, - - - file_id, - - - dept_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{educationCode,jdbcType=VARCHAR}, - - - #{educationDate,jdbcType=TIMESTAMP}, - - - #{gender,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{company,jdbcType=VARCHAR}, - - - #{deptName,jdbcType=VARCHAR}, - - - #{post,jdbcType=VARCHAR}, - - - #{deadline,jdbcType=TIMESTAMP}, - - - #{fileId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - - - update tb_safety_education_trainee - - - education_code = #{educationCode,jdbcType=VARCHAR}, - - - education_date = #{educationDate,jdbcType=TIMESTAMP}, - - - gender = #{gender,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - company = #{company,jdbcType=VARCHAR}, - - - dept_name = #{deptName,jdbcType=VARCHAR}, - - - post = #{post,jdbcType=VARCHAR}, - - - deadline = #{deadline,jdbcType=TIMESTAMP}, - - - file_id = #{fileId,jdbcType=VARCHAR}, - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_education_trainee - set education_code = #{educationCode,jdbcType=VARCHAR}, - education_date = #{educationDate,jdbcType=TIMESTAMP}, - gender = #{gender,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - company = #{company,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, - post = #{post,jdbcType=VARCHAR}, - deadline = #{deadline,jdbcType=TIMESTAMP}, - file_id = #{fileId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyEducationVisitorMapper.xml b/src/com/sipai/mapper/safety/SafetyEducationVisitorMapper.xml deleted file mode 100644 index addb1bf2..00000000 --- a/src/com/sipai/mapper/safety/SafetyEducationVisitorMapper.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - id, education_code, education_date, usher_id, usher_name, visitor_company, vistor_num, - access_time, leave_time, file_id, contact - - - - delete - from tb_safety_education_visitor - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_education_visitor (id, education_code, education_date, - usher_id, usher_name, visitor_company, - vistor_num, access_time, leave_time, - file_id, contact) - values (#{id,jdbcType=VARCHAR}, #{educationCode,jdbcType=VARCHAR}, #{educationDate,jdbcType=TIMESTAMP}, - #{usherId,jdbcType=VARCHAR}, #{usherName,jdbcType=VARCHAR}, #{visitorCompany,jdbcType=VARCHAR}, - #{vistorNum,jdbcType=INTEGER}, #{accessTime,jdbcType=TIMESTAMP}, #{leaveTime,jdbcType=TIMESTAMP}, - #{fileId,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}) - - - insert into tb_safety_education_visitor - - - id, - - - education_code, - - - education_date, - - - usher_id, - - - usher_name, - - - visitor_company, - - - vistor_num, - - - access_time, - - - leave_time, - - - file_id, - - - contact, - - - - - #{id,jdbcType=VARCHAR}, - - - #{educationCode,jdbcType=VARCHAR}, - - - #{educationDate,jdbcType=TIMESTAMP}, - - - #{usherId,jdbcType=VARCHAR}, - - - #{usherName,jdbcType=VARCHAR}, - - - #{visitorCompany,jdbcType=VARCHAR}, - - - #{vistorNum,jdbcType=INTEGER}, - - - #{accessTime,jdbcType=TIMESTAMP}, - - - #{leaveTime,jdbcType=TIMESTAMP}, - - - #{fileId,jdbcType=VARCHAR}, - - - #{contact,jdbcType=VARCHAR}, - - - - - update tb_safety_education_visitor - - - education_code = #{educationCode,jdbcType=VARCHAR}, - - - education_date = #{educationDate,jdbcType=TIMESTAMP}, - - - usher_id = #{usherId,jdbcType=VARCHAR}, - - - usher_name = #{usherName,jdbcType=VARCHAR}, - - - visitor_company = #{visitorCompany,jdbcType=VARCHAR}, - - - vistor_num = #{vistorNum,jdbcType=INTEGER}, - - - access_time = #{accessTime,jdbcType=TIMESTAMP}, - - - leave_time = #{leaveTime,jdbcType=TIMESTAMP}, - - - file_id = #{fileId,jdbcType=VARCHAR}, - - - contact = #{contact,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_education_visitor - set education_code = #{educationCode,jdbcType=VARCHAR}, - education_date = #{educationDate,jdbcType=TIMESTAMP}, - usher_id = #{usherId,jdbcType=VARCHAR}, - usher_name = #{usherName,jdbcType=VARCHAR}, - visitor_company = #{visitorCompany,jdbcType=VARCHAR}, - vistor_num = #{vistorNum,jdbcType=INTEGER}, - access_time = #{accessTime,jdbcType=TIMESTAMP}, - leave_time = #{leaveTime,jdbcType=TIMESTAMP}, - file_id = #{fileId,jdbcType=VARCHAR}, - contact = #{contact,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyExternalStaffMapper.xml b/src/com/sipai/mapper/safety/SafetyExternalStaffMapper.xml deleted file mode 100644 index 14740743..00000000 --- a/src/com/sipai/mapper/safety/SafetyExternalStaffMapper.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, name, sex, company, birthday, usher_id, usher_dept, duty, job_title, create_time, idcard - - - - delete from tb_safety_external_staff - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_external_staff (id, name, sex, - company, birthday, usher_id, - usher_dept, duty, job_title, - create_time, idcard) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, - #{company,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE}, #{usherId,jdbcType=VARCHAR}, - #{usherDept,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{jobTitle,jdbcType=VARCHAR}, - GETDATE(), #{idcard,jdbcType=VARCHAR}) - - - insert into tb_safety_external_staff - - - id, - - - name, - - - sex, - - - company, - - - birthday, - - - usher_id, - - - usher_dept, - - - duty, - - - job_title, - - - idcard, - - create_time - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{sex,jdbcType=VARCHAR}, - - - #{company,jdbcType=VARCHAR}, - - - #{birthday,jdbcType=DATE}, - - - #{usherId,jdbcType=VARCHAR}, - - - #{usherDept,jdbcType=VARCHAR}, - - - #{duty,jdbcType=VARCHAR}, - - - #{jobTitle,jdbcType=VARCHAR}, - - - #{idcard,jdbcType=VARCHAR}, - - GETDATE() - - - - update tb_safety_external_staff - - - name = #{name,jdbcType=VARCHAR}, - - - sex = #{sex,jdbcType=VARCHAR}, - - - company = #{company,jdbcType=VARCHAR}, - - - birthday = #{birthday,jdbcType=DATE}, - - - usher_id = #{usherId,jdbcType=VARCHAR}, - - - usher_dept = #{usherDept,jdbcType=VARCHAR}, - - - duty = #{duty,jdbcType=VARCHAR}, - - - job_title = #{jobTitle,jdbcType=VARCHAR}, - - - idcard = #{idcard,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_external_staff - set name = #{name,jdbcType=VARCHAR}, - sex = #{sex,jdbcType=VARCHAR}, - company = #{company,jdbcType=VARCHAR}, - birthday = #{birthday,jdbcType=DATE}, - usher_id = #{usherId,jdbcType=VARCHAR}, - usher_dept = #{usherDept,jdbcType=VARCHAR}, - duty = #{duty,jdbcType=VARCHAR}, - job_title = #{jobTitle,jdbcType=VARCHAR} - idcard = #{idcard,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_safety_external_staff - ${where} - - - - - - - - - - - - - - diff --git a/src/com/sipai/mapper/safety/SafetyFilesMapper.xml b/src/com/sipai/mapper/safety/SafetyFilesMapper.xml deleted file mode 100644 index 1f65d512..00000000 --- a/src/com/sipai/mapper/safety/SafetyFilesMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, file_name, original_file_name, upload_time, absolute_path, access_url, function_code, - status_code, biz_id - - - - delete from tb_safety_files - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_files (id, file_name, original_file_name, - upload_time, absolute_path, access_url, - function_code, status_code, biz_id - ) - values (#{id,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{originalFileName,jdbcType=VARCHAR}, - #{uploadTime,jdbcType=TIMESTAMP}, #{absolutePath,jdbcType=VARCHAR}, #{accessUrl,jdbcType=VARCHAR}, - #{functionCode,jdbcType=TINYINT}, #{statusCode,jdbcType=TINYINT}, #{bizId,jdbcType=VARCHAR} - ) - - - insert into tb_safety_files - - - id, - - - file_name, - - - original_file_name, - - - upload_time, - - - absolute_path, - - - access_url, - - - function_code, - - - status_code, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{fileName,jdbcType=VARCHAR}, - - - #{originalFileName,jdbcType=VARCHAR}, - - - #{uploadTime,jdbcType=TIMESTAMP}, - - - #{absolutePath,jdbcType=VARCHAR}, - - - #{accessUrl,jdbcType=VARCHAR}, - - - #{functionCode,jdbcType=TINYINT}, - - - #{statusCode,jdbcType=TINYINT}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update tb_safety_files - - - file_name = #{fileName,jdbcType=VARCHAR}, - - - original_file_name = #{originalFileName,jdbcType=VARCHAR}, - - - upload_time = #{uploadTime,jdbcType=TIMESTAMP}, - - - absolute_path = #{absolutePath,jdbcType=VARCHAR}, - - - access_url = #{accessUrl,jdbcType=VARCHAR}, - - - function_code = #{functionCode,jdbcType=TINYINT}, - - - status_code = #{statusCode,jdbcType=TINYINT}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_files - set file_name = #{fileName,jdbcType=VARCHAR}, - original_file_name = #{originalFileName,jdbcType=VARCHAR}, - upload_time = #{uploadTime,jdbcType=TIMESTAMP}, - absolute_path = #{absolutePath,jdbcType=VARCHAR}, - access_url = #{accessUrl,jdbcType=VARCHAR}, - function_code = #{functionCode,jdbcType=TINYINT}, - status_code = #{statusCode,jdbcType=TINYINT}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_safety_files - where biz_id = #{bizId,jdbcType=VARCHAR} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyFlowTaskDetailMapper.xml b/src/com/sipai/mapper/safety/SafetyFlowTaskDetailMapper.xml deleted file mode 100644 index 45a21438..00000000 --- a/src/com/sipai/mapper/safety/SafetyFlowTaskDetailMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, flow_task_id, record, create_time - - - - delete from tb_safety_flow_task_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_flow_task_detail (id, flow_task_id, record, - create_time) - values (#{id,jdbcType=VARCHAR}, #{flowTaskId,jdbcType=VARCHAR}, #{record,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}) - - - insert into tb_safety_flow_task_detail - - - id, - - - flow_task_id, - - - record, - - - create_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{flowTaskId,jdbcType=VARCHAR}, - - - #{record,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - update tb_safety_flow_task_detail - - - flow_task_id = #{flowTaskId,jdbcType=VARCHAR}, - - - record = #{record,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_flow_task_detail - set flow_task_id = #{flowTaskId,jdbcType=VARCHAR}, - record = #{record,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_safety_flow_task_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyFlowTaskMapper.xml b/src/com/sipai/mapper/safety/SafetyFlowTaskMapper.xml deleted file mode 100644 index 6b8e6cf5..00000000 --- a/src/com/sipai/mapper/safety/SafetyFlowTaskMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, biz_id, task_name, is_done, done_time, auditor, copy,create_time - - - - delete from tb_safety_flow_task - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_flow_task (id, biz_id, task_name, - is_done, done_time, auditor, - copy,create_time) - values (#{id,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{taskName,jdbcType=VARCHAR}, - #{isDone,jdbcType=BIT}, #{doneTime,jdbcType=TIMESTAMP}, #{auditor,jdbcType=VARCHAR}, - #{copy,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}) - - - insert into tb_safety_flow_task - - - id, - - - biz_id, - - - task_name, - - - is_done, - - - done_time, - - - auditor, - - - copy, - - - create_time, - - - - - - #{id,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{taskName,jdbcType=VARCHAR}, - - - #{isDone,jdbcType=BIT}, - - - #{doneTime,jdbcType=TIMESTAMP}, - - - #{auditor,jdbcType=VARCHAR}, - - - #{copy,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - update tb_safety_flow_task - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - task_name = #{taskName,jdbcType=VARCHAR}, - - - is_done = #{isDone,jdbcType=BIT}, - - - done_time = #{doneTime,jdbcType=TIMESTAMP}, - - - auditor = #{auditor,jdbcType=VARCHAR}, - - - copy = #{copy,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_flow_task - set biz_id = #{bizId,jdbcType=VARCHAR}, - task_name = #{taskName,jdbcType=VARCHAR}, - is_done = #{isDone,jdbcType=BIT}, - done_time = #{doneTime,jdbcType=TIMESTAMP}, - auditor = #{auditor,jdbcType=VARCHAR}, - copy = #{copy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_safety_flow_task - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/safety/SafetyJobInsideMapper.xml b/src/com/sipai/mapper/safety/SafetyJobInsideMapper.xml deleted file mode 100644 index d114a09c..00000000 --- a/src/com/sipai/mapper/safety/SafetyJobInsideMapper.xml +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, create_user_id, create_user_name, job_code, job_type, job_location, job_company, - competent_dept_id, competent_dept_name, competent_advice, project_begin_date, project_end_date, - duty_user_id, duty_user_name, contact, job_content, countersign_user_id, countersign_user_name, - copy_user_id, copy_user_name, countersign_status, countersign_detail, job_status,process_instance_id - - - - delete - from tb_safety_job_inside - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_job_inside (id, create_user_id, create_user_name, - job_code, job_type, job_location, - job_company, competent_dept_id, competent_dept_name, - competent_advice, project_begin_date, project_end_date, - duty_user_id, duty_user_name, contact, - job_content, countersign_user_id, countersign_user_name, - copy_user_id, copy_user_name, countersign_status, - countersign_detail, job_status,process_instance_id) - values (#{id,jdbcType=VARCHAR}, #{createUserId,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, - #{jobCode,jdbcType=VARCHAR}, #{jobType,jdbcType=INTEGER}, #{jobLocation,jdbcType=VARCHAR}, - #{jobCompany,jdbcType=VARCHAR}, #{competentDeptId,jdbcType=VARCHAR}, - #{competentDeptName,jdbcType=VARCHAR}, - #{competentAdvice,jdbcType=VARCHAR}, #{projectBeginDate,jdbcType=TIMESTAMP}, - #{projectEndDate,jdbcType=TIMESTAMP}, - #{dutyUserId,jdbcType=VARCHAR}, #{dutyUserName,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, - #{jobContent,jdbcType=VARCHAR}, #{countersignUserId,jdbcType=VARCHAR}, - #{countersignUserName,jdbcType=VARCHAR}, - #{copyUserId,jdbcType=VARCHAR}, #{copyUserName,jdbcType=VARCHAR}, #{countersignStatus,jdbcType=INTEGER}, - #{countersignDetail,jdbcType=VARCHAR}, #{jobStatus,jdbcType=INTEGER},#{processInstanceId,jdbcType=VARCHAR}) - - - insert into tb_safety_job_inside - - - id, - - - create_user_id, - - - create_user_name, - - - job_code, - - - job_type, - - - job_location, - - - job_company, - - - competent_dept_id, - - - competent_dept_name, - - - competent_advice, - - - project_begin_date, - - - project_end_date, - - - duty_user_id, - - - duty_user_name, - - - contact, - - - job_content, - - - countersign_user_id, - - - countersign_user_name, - - - copy_user_id, - - - copy_user_name, - - - countersign_status, - - - countersign_detail, - - - job_status, - - - process_instance_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createUserName,jdbcType=VARCHAR}, - - - #{jobCode,jdbcType=VARCHAR}, - - - #{jobType,jdbcType=INTEGER}, - - - #{jobLocation,jdbcType=VARCHAR}, - - - #{jobCompany,jdbcType=VARCHAR}, - - - #{competentDeptId,jdbcType=VARCHAR}, - - - #{competentDeptName,jdbcType=VARCHAR}, - - - #{competentAdvice,jdbcType=VARCHAR}, - - - #{projectBeginDate,jdbcType=TIMESTAMP}, - - - #{projectEndDate,jdbcType=TIMESTAMP}, - - - #{dutyUserId,jdbcType=VARCHAR}, - - - #{dutyUserName,jdbcType=VARCHAR}, - - - #{contact,jdbcType=VARCHAR}, - - - #{jobContent,jdbcType=VARCHAR}, - - - #{countersignUserId,jdbcType=VARCHAR}, - - - #{countersignUserName,jdbcType=VARCHAR}, - - - #{copyUserId,jdbcType=VARCHAR}, - - - #{copyUserName,jdbcType=VARCHAR}, - - - #{countersignStatus,jdbcType=INTEGER}, - - - #{countersignDetail,jdbcType=VARCHAR}, - - - #{jobStatus,jdbcType=INTEGER}, - - - #{processInstanceId,jdbcType=VARCHAR}, - - - - - update tb_safety_job_inside - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_user_name = #{createUserName,jdbcType=VARCHAR}, - - - job_code = #{jobCode,jdbcType=VARCHAR}, - - - job_type = #{jobType,jdbcType=INTEGER}, - - - job_location = #{jobLocation,jdbcType=VARCHAR}, - - - job_company = #{jobCompany,jdbcType=VARCHAR}, - - - competent_dept_id = #{competentDeptId,jdbcType=VARCHAR}, - - - competent_dept_name = #{competentDeptName,jdbcType=VARCHAR}, - - - competent_advice = #{competentAdvice,jdbcType=VARCHAR}, - - - project_begin_date = #{projectBeginDate,jdbcType=TIMESTAMP}, - - - project_end_date = #{projectEndDate,jdbcType=TIMESTAMP}, - - - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - - - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - - - contact = #{contact,jdbcType=VARCHAR}, - - - job_content = #{jobContent,jdbcType=VARCHAR}, - - - countersign_user_id = #{countersignUserId,jdbcType=VARCHAR}, - - - countersign_user_name = #{countersignUserName,jdbcType=VARCHAR}, - - - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - - - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - - - countersign_status = #{countersignStatus,jdbcType=INTEGER}, - - - countersign_detail = #{countersignDetail,jdbcType=VARCHAR}, - - - job_status = #{jobStatus,jdbcType=INTEGER}, - - - process_instance_id = #{processInstanceId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_job_inside - set create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_user_name = #{createUserName,jdbcType=VARCHAR}, - job_code = #{jobCode,jdbcType=VARCHAR}, - job_type = #{jobType,jdbcType=INTEGER}, - job_location = #{jobLocation,jdbcType=VARCHAR}, - job_company = #{jobCompany,jdbcType=VARCHAR}, - competent_dept_id = #{competentDeptId,jdbcType=VARCHAR}, - competent_dept_name = #{competentDeptName,jdbcType=VARCHAR}, - competent_advice = #{competentAdvice,jdbcType=VARCHAR}, - project_begin_date = #{projectBeginDate,jdbcType=TIMESTAMP}, - project_end_date = #{projectEndDate,jdbcType=TIMESTAMP}, - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - contact = #{contact,jdbcType=VARCHAR}, - job_content = #{jobContent,jdbcType=VARCHAR}, - countersign_user_id = #{countersignUserId,jdbcType=VARCHAR}, - countersign_user_name = #{countersignUserName,jdbcType=VARCHAR}, - copy_user_id = #{copyUserId,jdbcType=VARCHAR}, - copy_user_name = #{copyUserName,jdbcType=VARCHAR}, - countersign_status = #{countersignStatus,jdbcType=INTEGER}, - countersign_detail = #{countersignDetail,jdbcType=VARCHAR}, - job_status = #{jobStatus,jdbcType=INTEGER}, - process_instance_id = #{processInstanceId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - diff --git a/src/com/sipai/mapper/safety/SafetyJobOutsideMapper.xml b/src/com/sipai/mapper/safety/SafetyJobOutsideMapper.xml deleted file mode 100644 index 034b25d9..00000000 --- a/src/com/sipai/mapper/safety/SafetyJobOutsideMapper.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, create_user_id, create_user_name, job_code, job_type, job_location, job_company, - competent_dept_id, competent_dept_name, competent_advice, project_begin_date, project_end_date, - duty_user_id, duty_user_name, contact, job_content, job_status - - - - delete from tb_safety_job_outside - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_safety_job_outside (id, create_user_id, create_user_name, - job_code, job_type, job_location, - job_company, competent_dept_id, competent_dept_name, - competent_advice, project_begin_date, project_end_date, - duty_user_id, duty_user_name, contact, - job_content, job_status) - values (#{id,jdbcType=VARCHAR}, #{createUserId,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, - #{jobCode,jdbcType=VARCHAR}, #{jobType,jdbcType=VARCHAR}, #{jobLocation,jdbcType=VARCHAR}, - #{jobCompany,jdbcType=VARCHAR}, #{competentDeptId,jdbcType=VARCHAR}, #{competentDeptName,jdbcType=VARCHAR}, - #{competentAdvice,jdbcType=VARCHAR}, #{projectBeginDate,jdbcType=TIMESTAMP}, #{projectEndDate,jdbcType=TIMESTAMP}, - #{dutyUserId,jdbcType=VARCHAR}, #{dutyUserName,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, - #{jobContent,jdbcType=VARCHAR}, #{jobStatus,jdbcType=INTEGER}) - - - insert into tb_safety_job_outside - - - id, - - - create_user_id, - - - create_user_name, - - - job_code, - - - job_type, - - - job_location, - - - job_company, - - - competent_dept_id, - - - competent_dept_name, - - - competent_advice, - - - project_begin_date, - - - project_end_date, - - - duty_user_id, - - - duty_user_name, - - - contact, - - - job_content, - - - job_status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{createUserId,jdbcType=VARCHAR}, - - - #{createUserName,jdbcType=VARCHAR}, - - - #{jobCode,jdbcType=VARCHAR}, - - - #{jobType,jdbcType=VARCHAR}, - - - #{jobLocation,jdbcType=VARCHAR}, - - - #{jobCompany,jdbcType=VARCHAR}, - - - #{competentDeptId,jdbcType=VARCHAR}, - - - #{competentDeptName,jdbcType=VARCHAR}, - - - #{competentAdvice,jdbcType=VARCHAR}, - - - #{projectBeginDate,jdbcType=TIMESTAMP}, - - - #{projectEndDate,jdbcType=TIMESTAMP}, - - - #{dutyUserId,jdbcType=VARCHAR}, - - - #{dutyUserName,jdbcType=VARCHAR}, - - - #{contact,jdbcType=VARCHAR}, - - - #{jobContent,jdbcType=VARCHAR}, - - - #{jobStatus,jdbcType=INTEGER}, - - - - - update tb_safety_job_outside - - - create_user_id = #{createUserId,jdbcType=VARCHAR}, - - - create_user_name = #{createUserName,jdbcType=VARCHAR}, - - - job_code = #{jobCode,jdbcType=VARCHAR}, - - - job_type = #{jobType,jdbcType=VARCHAR}, - - - job_location = #{jobLocation,jdbcType=VARCHAR}, - - - job_company = #{jobCompany,jdbcType=VARCHAR}, - - - competent_dept_id = #{competentDeptId,jdbcType=VARCHAR}, - - - competent_dept_name = #{competentDeptName,jdbcType=VARCHAR}, - - - competent_advice = #{competentAdvice,jdbcType=VARCHAR}, - - - project_begin_date = #{projectBeginDate,jdbcType=TIMESTAMP}, - - - project_end_date = #{projectEndDate,jdbcType=TIMESTAMP}, - - - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - - - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - - - contact = #{contact,jdbcType=VARCHAR}, - - - job_content = #{jobContent,jdbcType=VARCHAR}, - - - job_status = #{jobStatus,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_safety_job_outside - set create_user_id = #{createUserId,jdbcType=VARCHAR}, - create_user_name = #{createUserName,jdbcType=VARCHAR}, - job_code = #{jobCode,jdbcType=VARCHAR}, - job_type = #{jobType,jdbcType=VARCHAR}, - job_location = #{jobLocation,jdbcType=VARCHAR}, - job_company = #{jobCompany,jdbcType=VARCHAR}, - competent_dept_id = #{competentDeptId,jdbcType=VARCHAR}, - competent_dept_name = #{competentDeptName,jdbcType=VARCHAR}, - competent_advice = #{competentAdvice,jdbcType=VARCHAR}, - project_begin_date = #{projectBeginDate,jdbcType=TIMESTAMP}, - project_end_date = #{projectEndDate,jdbcType=TIMESTAMP}, - duty_user_id = #{dutyUserId,jdbcType=VARCHAR}, - duty_user_name = #{dutyUserName,jdbcType=VARCHAR}, - contact = #{contact,jdbcType=VARCHAR}, - job_content = #{jobContent,jdbcType=VARCHAR}, - job_status = #{jobStatus,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - diff --git a/src/com/sipai/mapper/safety/SafetyStaffArchivesMapper.xml b/src/com/sipai/mapper/safety/SafetyStaffArchivesMapper.xml deleted file mode 100644 index bf125ba9..00000000 --- a/src/com/sipai/mapper/safety/SafetyStaffArchivesMapper.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - userid, idcard, birthday, work_time, hiredate, post, duty, job_title, create_time - - - ssa.userid, ssa.idcard, ssa.birthday, ssa.work_time, ssa.hiredate, ssa.post, ssa.duty, ssa.job_title, ssa.create_time - - - - delete from tb_safety_staff_archives - where userid = #{userid,jdbcType=VARCHAR} - - - insert into tb_safety_staff_archives (userid, idcard, birthday, - work_time, hiredate, post, duty, job_title, create_time) - values (#{userid,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE}, - #{workTime,jdbcType=TIMESTAMP}, #{hiredate,jdbcType=TIMESTAMP}, #{post,jdbcType=VARCHAR}, - #{duty,jdbcType=VARCHAR}, #{jobTitle,jdbcType=VARCHAR}, GETDATE()) - - - insert into tb_safety_staff_archives - - - userid, - - - idcard, - - - birthday, - - - work_time, - - - hiredate, - - - post, - - - duty, - - - job_title, - - create_time - - - - #{userid,jdbcType=VARCHAR}, - - - #{idcard,jdbcType=VARCHAR}, - - - #{birthday,jdbcType=DATE}, - - - #{workTime,jdbcType=TIMESTAMP}, - - - #{hiredate,jdbcType=TIMESTAMP}, - - - #{post,jdbcType=VARCHAR}, - - - #{duty,jdbcType=VARCHAR}, - - - #{jobTitle,jdbcType=VARCHAR}, - - GETDATE() - - - - update tb_safety_staff_archives - - - idcard = #{idcard,jdbcType=VARCHAR}, - - - birthday = #{birthday,jdbcType=DATE}, - - - work_time = #{workTime,jdbcType=TIMESTAMP}, - - - hiredate = #{hiredate,jdbcType=TIMESTAMP}, - - - post = #{post,jdbcType=VARCHAR}, - - - duty = #{duty,jdbcType=VARCHAR}, - - - job_title = #{jobTitle,jdbcType=VARCHAR}, - - - where userid = #{userid,jdbcType=VARCHAR} - - - update tb_safety_staff_archives - set idcard = #{idcard,jdbcType=VARCHAR}, - birthday = #{birthday,jdbcType=DATE}, - work_time = #{workTime,jdbcType=TIMESTAMP}, - hiredate = #{hiredate,jdbcType=TIMESTAMP}, - post = #{post,jdbcType=VARCHAR}, - duty = #{duty,jdbcType=VARCHAR}, - job_title = #{jobTitle,jdbcType=VARCHAR} - where userid = #{userid,jdbcType=VARCHAR} - - - - - - - - - - delete from - tb_safety_staff_archives - ${where} - - - - - - - - diff --git a/src/com/sipai/mapper/scada/DataSummaryMapper.xml b/src/com/sipai/mapper/scada/DataSummaryMapper.xml deleted file mode 100644 index f9fd602a..00000000 --- a/src/com/sipai/mapper/scada/DataSummaryMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insdt, parmvalue, uploaddt, display - - - - delete from TB_DataSummary - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_DataSummary (id, insdt, parmvalue, - uploaddt, display) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{parmvalue,jdbcType=VARCHAR}, - #{uploaddt,jdbcType=TIMESTAMP}, #{display,jdbcType=CHAR}) - - - insert into TB_DataSummary - - - id, - - - insdt, - - - parmvalue, - - - uploaddt, - - - display, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{parmvalue,jdbcType=VARCHAR}, - - - #{uploaddt,jdbcType=TIMESTAMP}, - - - #{display,jdbcType=CHAR}, - - - - - update TB_DataSummary - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - parmvalue = #{parmvalue,jdbcType=VARCHAR}, - - - uploaddt = #{uploaddt,jdbcType=TIMESTAMP}, - - - display = #{display,jdbcType=CHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_DataSummary - set insdt = #{insdt,jdbcType=VARCHAR}, - parmvalue = #{parmvalue,jdbcType=VARCHAR}, - uploaddt = #{uploaddt,jdbcType=TIMESTAMP}, - display = #{display,jdbcType=CHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_DataSummary - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointExpandMapper.xml b/src/com/sipai/mapper/scada/MPointExpandMapper.xml deleted file mode 100644 index c9cb0be8..00000000 --- a/src/com/sipai/mapper/scada/MPointExpandMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, measure_point_id, explain - - - - delete from TB_MeasurePoint_Expand - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_Expand (id, insdt, insuser, - measure_point_id, explain) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{measurePointId,jdbcType=VARCHAR}, #{explain,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint_Expand - - - id, - - - insdt, - - - insuser, - - - measure_point_id, - - - explain, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{measurePointId,jdbcType=VARCHAR}, - - - #{explain,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_Expand - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - - - explain = #{explain,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_Expand - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - explain = #{explain,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_MeasurePoint_Expand - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointFormulaAutoHourMapper.xml b/src/com/sipai/mapper/scada/MPointFormulaAutoHourMapper.xml deleted file mode 100644 index 56e42e89..00000000 --- a/src/com/sipai/mapper/scada/MPointFormulaAutoHourMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - id, pid, sdt, edt - - - - delete from TB_MeasurePoint_Formula_autoHour - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_Formula_autoHour (id, pid, sdt, - edt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{sdt,jdbcType=VARCHAR}, - #{edt,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint_Formula_autoHour - - - id, - - - pid, - - - sdt, - - - edt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=VARCHAR}, - - - #{edt,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_Formula_autoHour - - - pid = #{pid,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=VARCHAR}, - - - edt = #{edt,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_Formula_autoHour - set pid = #{pid,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=VARCHAR}, - edt = #{edt,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_MeasurePoint_Formula_autoHour - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointFormulaDenominatorMapper.xml b/src/com/sipai/mapper/scada/MPointFormulaDenominatorMapper.xml deleted file mode 100644 index eda6fa16..00000000 --- a/src/com/sipai/mapper/scada/MPointFormulaDenominatorMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - id, pmpid, denominatorName, moleculeName - - - - delete from TB_MeasurePoint_Formula_Denominator - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_Formula_Denominator (id, pmpid, denominatorName, - moleculeName) - values (#{id,jdbcType=VARCHAR}, #{pmpid,jdbcType=VARCHAR}, #{denominatorname,jdbcType=VARCHAR}, - #{moleculename,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint_Formula_Denominator - - - id, - - - pmpid, - - - denominatorName, - - - moleculeName, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pmpid,jdbcType=VARCHAR}, - - - #{denominatorname,jdbcType=VARCHAR}, - - - #{moleculename,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_Formula_Denominator - - - pmpid = #{pmpid,jdbcType=VARCHAR}, - - - denominatorName = #{denominatorname,jdbcType=VARCHAR}, - - - moleculeName = #{moleculename,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_Formula_Denominator - set pmpid = #{pmpid,jdbcType=VARCHAR}, - denominatorName = #{denominatorname,jdbcType=VARCHAR}, - moleculeName = #{moleculename,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_MeasurePoint_Formula_Denominator - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointFormulaMapper.xml b/src/com/sipai/mapper/scada/MPointFormulaMapper.xml deleted file mode 100644 index a09462f0..00000000 --- a/src/com/sipai/mapper/scada/MPointFormulaMapper.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, mode, mpid, pmpid, formulaname, starthour, constant, datatype, - collectiontype, numeratorContent - - - - delete - from TB_MeasurePoint_Formula - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_Formula (id, insdt, insuser, - mode, mpid, pmpid, - formulaname, starthour, constant, - datatype, collectiontype, numeratorContent) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{mode,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{pmpid,jdbcType=VARCHAR}, - #{formulaname,jdbcType=VARCHAR}, #{starthour,jdbcType=INTEGER}, #{constant,jdbcType=VARCHAR}, - #{datatype,jdbcType=VARCHAR}, #{collectiontype,jdbcType=VARCHAR}, #{numeratorcontent,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint_Formula - - - id, - - - insdt, - - - insuser, - - - mode, - - - mpid, - - - pmpid, - - - formulaname, - - - starthour, - - - constant, - - - datatype, - - - collectiontype, - - - numeratorContent, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{mode,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{pmpid,jdbcType=VARCHAR}, - - - #{formulaname,jdbcType=VARCHAR}, - - - #{starthour,jdbcType=INTEGER}, - - - #{constant,jdbcType=VARCHAR}, - - - #{datatype,jdbcType=VARCHAR}, - - - #{collectiontype,jdbcType=VARCHAR}, - - - #{numeratorcontent,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_Formula - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - mode = #{mode,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - pmpid = #{pmpid,jdbcType=VARCHAR}, - - - formulaname = #{formulaname,jdbcType=VARCHAR}, - - - starthour = #{starthour,jdbcType=INTEGER}, - - - constant = #{constant,jdbcType=VARCHAR}, - - - datatype = #{datatype,jdbcType=VARCHAR}, - - - collectiontype = #{collectiontype,jdbcType=VARCHAR}, - - - numeratorContent = #{numeratorcontent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_Formula - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - mode = #{mode,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - pmpid = #{pmpid,jdbcType=VARCHAR}, - formulaname = #{formulaname,jdbcType=VARCHAR}, - starthour = #{starthour,jdbcType=INTEGER}, - constant = #{constant,jdbcType=VARCHAR}, - datatype = #{datatype,jdbcType=VARCHAR}, - collectiontype = #{collectiontype,jdbcType=VARCHAR}, - numeratorContent = #{numeratorcontent,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_MeasurePoint_Formula ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointHistoryMapper.xml b/src/com/sipai/mapper/scada/MPointHistoryMapper.xml deleted file mode 100644 index ffc41299..00000000 --- a/src/com/sipai/mapper/scada/MPointHistoryMapper.xml +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - - - - - ItemID - , ParmValue, MeasureDT, memotype, memo, userid, insdt - - - - - insert into ${tbName} - - - ItemID, - - - ParmValue, - - - MeasureDT, - - - memotype, - - - memo, - - - userid, - - - insdt, - - - - - #{itemid,jdbcType=BIGINT}, - - - #{parmvalue,jdbcType=DECIMAL}, - - - #{measuredt,jdbcType=TIMESTAMP}, - - - #{memotype,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - - - - - - - - - - delete - from ${table} ${where} - - - drop table ${table} - - - - - - - - - - - - - - - update ${tbName} - set ParmValue = #{parmvalue,jdbcType=DECIMAL}, - memotype = #{memotype,jdbcType=VARCHAR} - where MeasureDT = #{measuredt,jdbcType=TIMESTAMP} - - - update ${tbName} - set ${set} ${where} - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointMapper.xml b/src/com/sipai/mapper/scada/MPointMapper.xml deleted file mode 100644 index 2db887ed..00000000 --- a/src/com/sipai/mapper/scada/MPointMapper.xml +++ /dev/null @@ -1,854 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID - , MPointID, MPointCode, ParmName, Unit, alarmmax, alarmmin, halarmmax, lalarmmin, ParmValue, MeasureDT, - Rate, Freq, FreqUnit, SignalType, SignalTag, LEDType, LEDColor, DirectType, BizId, - BizType, NumTail, prochour, procday, procmonth, ShowName, exp, forcemin, forcemax, - avgmax, avgmin, remoteup, morder, TriggerAlarm, ConfirmAlarm, flowset, triggerCycle, - cyclemax, cyclemin, triggerMutation, mutationset, causeset, operateset, resultset, - triggerEquOff, mathop, valuetype, valueMeaning, active, SoundAlarm, scdtype, spanrange, - modbusfigid, register, processSectionCode, equipmentId, source_type, patrol_type, - remark, alarm_level, disname, structureId - - - - delete - from TB_MeasurePoint - where ID = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint (ID, MPointID, MPointCode, - ParmName, Unit, alarmmax, - alarmmin, halarmmax, lalarmmin, ParmValue, MeasureDT, - Rate, Freq, FreqUnit, - SignalType, SignalTag, LEDType, - LEDColor, DirectType, BizId, - BizType, NumTail, prochour, - procday, procmonth, ShowName, - exp, forcemin, forcemax, - avgmax, avgmin, remoteup, - morder, TriggerAlarm, ConfirmAlarm, - flowset, triggerCycle, cyclemax, - cyclemin, triggerMutation, mutationset, - causeset, operateset, resultset, - triggerEquOff, mathop, valuetype, - valueMeaning, active, SoundAlarm, - scdtype, spanrange, modbusfigid, - register, processSectionCode, equipmentId, - source_type, patrol_type, remark, - alarm_level, disname, structureId) - values (#{id,jdbcType=VARCHAR}, #{mpointid,jdbcType=VARCHAR}, #{mpointcode,jdbcType=VARCHAR}, - #{parmname,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{alarmmax,jdbcType=DECIMAL}, - #{alarmmin,jdbcType=DECIMAL}, #{halarmmax,jdbcType=DECIMAL}, - #{lalarmmin,jdbcType=DECIMAL}, #{parmvalue,jdbcType=DECIMAL}, #{measuredt,jdbcType=TIMESTAMP}, - #{rate,jdbcType=DECIMAL}, #{freq,jdbcType=INTEGER}, #{frequnit,jdbcType=VARCHAR}, - #{signaltype,jdbcType=VARCHAR}, #{signaltag,jdbcType=VARCHAR}, #{ledtype,jdbcType=CHAR}, - #{ledcolor,jdbcType=CHAR}, #{directtype,jdbcType=CHAR}, #{bizid,jdbcType=VARCHAR}, - #{biztype,jdbcType=VARCHAR}, #{numtail,jdbcType=VARCHAR}, #{prochour,jdbcType=VARCHAR}, - #{procday,jdbcType=VARCHAR}, #{procmonth,jdbcType=VARCHAR}, #{showname,jdbcType=CHAR}, - #{exp,jdbcType=VARCHAR}, #{forcemin,jdbcType=DECIMAL}, #{forcemax,jdbcType=DECIMAL}, - #{avgmax,jdbcType=DECIMAL}, #{avgmin,jdbcType=DECIMAL}, #{remoteup,jdbcType=CHAR}, - #{morder,jdbcType=INTEGER}, #{triggeralarm,jdbcType=CHAR}, #{confirmalarm,jdbcType=CHAR}, - #{flowset,jdbcType=DECIMAL}, #{triggercycle,jdbcType=CHAR}, #{cyclemax,jdbcType=DECIMAL}, - #{cyclemin,jdbcType=DECIMAL}, #{triggermutation,jdbcType=CHAR}, #{mutationset,jdbcType=DECIMAL}, - #{causeset,jdbcType=DECIMAL}, #{operateset,jdbcType=DECIMAL}, #{resultset,jdbcType=DECIMAL}, - #{triggerequoff,jdbcType=CHAR}, #{mathop,jdbcType=CHAR}, #{valuetype,jdbcType=VARCHAR}, - #{valuemeaning,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{soundalarm,jdbcType=CHAR}, - #{scdtype,jdbcType=VARCHAR}, #{spanrange,jdbcType=DECIMAL}, #{modbusfigid,jdbcType=VARCHAR}, - #{register,jdbcType=VARCHAR}, #{processsectioncode,jdbcType=VARCHAR}, #{equipmentid,jdbcType=VARCHAR}, - #{sourceType,jdbcType=VARCHAR}, #{patrolType,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{alarmLevel,jdbcType=INTEGER}, #{disname,jdbcType=VARCHAR},#{structureId,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint - - - ID, - - - MPointID, - - - MPointCode, - - - ParmName, - - - Unit, - - - alarmmax, - - - alarmmin, - - - halarmmax, - - - lalarmmin, - - - ParmValue, - - - MeasureDT, - - - Rate, - - - Freq, - - - FreqUnit, - - - SignalType, - - - SignalTag, - - - LEDType, - - - LEDColor, - - - DirectType, - - - BizId, - - - BizType, - - - NumTail, - - - prochour, - - - procday, - - - procmonth, - - - ShowName, - - - exp, - - - forcemin, - - - forcemax, - - - avgmax, - - - avgmin, - - - remoteup, - - - morder, - - - TriggerAlarm, - - - ConfirmAlarm, - - - flowset, - - - triggerCycle, - - - cyclemax, - - - cyclemin, - - - triggerMutation, - - - mutationset, - - - causeset, - - - operateset, - - - resultset, - - - triggerEquOff, - - - mathop, - - - valuetype, - - - valueMeaning, - - - active, - - - SoundAlarm, - - - scdtype, - - - spanrange, - - - modbusfigid, - - - register, - - - processSectionCode, - - - equipmentId, - - - source_type, - - - patrol_type, - - - remark, - - - alarm_level, - - - disname, - - - structureId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpointid,jdbcType=VARCHAR}, - - - #{mpointcode,jdbcType=VARCHAR}, - - - #{parmname,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{alarmmax,jdbcType=DECIMAL}, - - - #{halarmmax,jdbcType=DECIMAL}, - - - #{alarmmin,jdbcType=DECIMAL}, - - - #{lalarmmin,jdbcType=DECIMAL}, - - - #{parmvalue,jdbcType=DECIMAL}, - - - #{measuredt,jdbcType=TIMESTAMP}, - - - #{rate,jdbcType=DECIMAL}, - - - #{freq,jdbcType=INTEGER}, - - - #{frequnit,jdbcType=VARCHAR}, - - - #{signaltype,jdbcType=VARCHAR}, - - - #{signaltag,jdbcType=VARCHAR}, - - - #{ledtype,jdbcType=CHAR}, - - - #{ledcolor,jdbcType=CHAR}, - - - #{directtype,jdbcType=CHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{biztype,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=VARCHAR}, - - - #{prochour,jdbcType=VARCHAR}, - - - #{procday,jdbcType=VARCHAR}, - - - #{procmonth,jdbcType=VARCHAR}, - - - #{showname,jdbcType=CHAR}, - - - #{exp,jdbcType=VARCHAR}, - - - #{forcemin,jdbcType=DECIMAL}, - - - #{forcemax,jdbcType=DECIMAL}, - - - #{avgmax,jdbcType=DECIMAL}, - - - #{avgmin,jdbcType=DECIMAL}, - - - #{remoteup,jdbcType=CHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{triggeralarm,jdbcType=CHAR}, - - - #{confirmalarm,jdbcType=CHAR}, - - - #{flowset,jdbcType=DECIMAL}, - - - #{triggercycle,jdbcType=CHAR}, - - - #{cyclemax,jdbcType=DECIMAL}, - - - #{cyclemin,jdbcType=DECIMAL}, - - - #{triggermutation,jdbcType=CHAR}, - - - #{mutationset,jdbcType=DECIMAL}, - - - #{causeset,jdbcType=DECIMAL}, - - - #{operateset,jdbcType=DECIMAL}, - - - #{resultset,jdbcType=DECIMAL}, - - - #{triggerequoff,jdbcType=CHAR}, - - - #{mathop,jdbcType=CHAR}, - - - #{valuetype,jdbcType=VARCHAR}, - - - #{valuemeaning,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{soundalarm,jdbcType=CHAR}, - - - #{scdtype,jdbcType=VARCHAR}, - - - #{spanrange,jdbcType=DECIMAL}, - - - #{modbusfigid,jdbcType=VARCHAR}, - - - #{register,jdbcType=VARCHAR}, - - - #{processsectioncode,jdbcType=VARCHAR}, - - - #{equipmentid,jdbcType=VARCHAR}, - - - #{sourceType,jdbcType=VARCHAR}, - - - #{patrolType,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{alarmLevel,jdbcType=INTEGER}, - - - #{disname,jdbcType=VARCHAR}, - - - #{structureId,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint - - - MPointID = #{mpointid,jdbcType=VARCHAR}, - - - MPointCode = #{mpointcode,jdbcType=VARCHAR}, - - - ParmName = #{parmname,jdbcType=VARCHAR}, - - - Unit = #{unit,jdbcType=VARCHAR}, - - - alarmmax = #{alarmmax,jdbcType=DECIMAL}, - - - alarmmin = #{alarmmin,jdbcType=DECIMAL}, - - - halarmmax = #{halarmmax,jdbcType=DECIMAL}, - - - lalarmmin = #{lalarmmin,jdbcType=DECIMAL}, - - - ParmValue = #{parmvalue,jdbcType=DECIMAL}, - - - MeasureDT = #{measuredt,jdbcType=TIMESTAMP}, - - - Rate = #{rate,jdbcType=DECIMAL}, - - - Freq = #{freq,jdbcType=INTEGER}, - - - FreqUnit = #{frequnit,jdbcType=VARCHAR}, - - - SignalType = #{signaltype,jdbcType=VARCHAR}, - - - SignalTag = #{signaltag,jdbcType=VARCHAR}, - - - LEDType = #{ledtype,jdbcType=CHAR}, - - - LEDColor = #{ledcolor,jdbcType=CHAR}, - - - DirectType = #{directtype,jdbcType=CHAR}, - - - BizId = #{bizid,jdbcType=VARCHAR}, - - - BizType = #{biztype,jdbcType=VARCHAR}, - - - NumTail = #{numtail,jdbcType=VARCHAR}, - - - prochour = #{prochour,jdbcType=VARCHAR}, - - - procday = #{procday,jdbcType=VARCHAR}, - - - procmonth = #{procmonth,jdbcType=VARCHAR}, - - - ShowName = #{showname,jdbcType=CHAR}, - - - exp = #{exp,jdbcType=VARCHAR}, - - - forcemin = #{forcemin,jdbcType=DECIMAL}, - - - forcemax = #{forcemax,jdbcType=DECIMAL}, - - - avgmax = #{avgmax,jdbcType=DECIMAL}, - - - avgmin = #{avgmin,jdbcType=DECIMAL}, - - - remoteup = #{remoteup,jdbcType=CHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - TriggerAlarm = #{triggeralarm,jdbcType=CHAR}, - - - ConfirmAlarm = #{confirmalarm,jdbcType=CHAR}, - - - flowset = #{flowset,jdbcType=DECIMAL}, - - - triggerCycle = #{triggercycle,jdbcType=CHAR}, - - - cyclemax = #{cyclemax,jdbcType=DECIMAL}, - - - cyclemin = #{cyclemin,jdbcType=DECIMAL}, - - - triggerMutation = #{triggermutation,jdbcType=CHAR}, - - - mutationset = #{mutationset,jdbcType=DECIMAL}, - - - causeset = #{causeset,jdbcType=DECIMAL}, - - - operateset = #{operateset,jdbcType=DECIMAL}, - - - resultset = #{resultset,jdbcType=DECIMAL}, - - - triggerEquOff = #{triggerequoff,jdbcType=CHAR}, - - - mathop = #{mathop,jdbcType=CHAR}, - - - valuetype = #{valuetype,jdbcType=VARCHAR}, - - - valueMeaning = #{valuemeaning,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - SoundAlarm = #{soundalarm,jdbcType=CHAR}, - - - scdtype = #{scdtype,jdbcType=VARCHAR}, - - - spanrange = #{spanrange,jdbcType=DECIMAL}, - - - modbusfigid = #{modbusfigid,jdbcType=VARCHAR}, - - - register = #{register,jdbcType=VARCHAR}, - - - processSectionCode = #{processsectioncode,jdbcType=VARCHAR}, - - - equipmentId = #{equipmentid,jdbcType=VARCHAR}, - - - source_type = #{sourceType,jdbcType=VARCHAR}, - - - patrol_type = #{patrolType,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - alarm_level = #{alarmLevel,jdbcType=INTEGER}, - - - disname = #{disname,jdbcType=VARCHAR}, - - - structureId = #{structureId,jdbcType=VARCHAR}, - - - where ID = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint - set MPointID = #{mpointid,jdbcType=VARCHAR}, - MPointCode = #{mpointcode,jdbcType=VARCHAR}, - ParmName = #{parmname,jdbcType=VARCHAR}, - Unit = #{unit,jdbcType=VARCHAR}, - alarmmax = #{alarmmax,jdbcType=DECIMAL}, - alarmmin = #{alarmmin,jdbcType=DECIMAL}, - halarmmax = #{halarmmax,jdbcType=DECIMAL}, - lalarmmin = #{lalarmmin,jdbcType=DECIMAL}, - ParmValue = #{parmvalue,jdbcType=DECIMAL}, - MeasureDT = #{measuredt,jdbcType=TIMESTAMP}, - Rate = #{rate,jdbcType=DECIMAL}, - Freq = #{freq,jdbcType=INTEGER}, - FreqUnit = #{frequnit,jdbcType=VARCHAR}, - SignalType = #{signaltype,jdbcType=VARCHAR}, - SignalTag = #{signaltag,jdbcType=VARCHAR}, - LEDType = #{ledtype,jdbcType=CHAR}, - LEDColor = #{ledcolor,jdbcType=CHAR}, - DirectType = #{directtype,jdbcType=CHAR}, - BizId = #{bizid,jdbcType=VARCHAR}, - BizType = #{biztype,jdbcType=VARCHAR}, - NumTail = #{numtail,jdbcType=VARCHAR}, - prochour = #{prochour,jdbcType=VARCHAR}, - procday = #{procday,jdbcType=VARCHAR}, - procmonth = #{procmonth,jdbcType=VARCHAR}, - ShowName = #{showname,jdbcType=CHAR}, - exp = #{exp,jdbcType=VARCHAR}, - forcemin = #{forcemin,jdbcType=DECIMAL}, - forcemax = #{forcemax,jdbcType=DECIMAL}, - avgmax = #{avgmax,jdbcType=DECIMAL}, - avgmin = #{avgmin,jdbcType=DECIMAL}, - remoteup = #{remoteup,jdbcType=CHAR}, - morder = #{morder,jdbcType=INTEGER}, - TriggerAlarm = #{triggeralarm,jdbcType=CHAR}, - ConfirmAlarm = #{confirmalarm,jdbcType=CHAR}, - flowset = #{flowset,jdbcType=DECIMAL}, - triggerCycle = #{triggercycle,jdbcType=CHAR}, - cyclemax = #{cyclemax,jdbcType=DECIMAL}, - cyclemin = #{cyclemin,jdbcType=DECIMAL}, - triggerMutation = #{triggermutation,jdbcType=CHAR}, - mutationset = #{mutationset,jdbcType=DECIMAL}, - causeset = #{causeset,jdbcType=DECIMAL}, - operateset = #{operateset,jdbcType=DECIMAL}, - resultset = #{resultset,jdbcType=DECIMAL}, - triggerEquOff = #{triggerequoff,jdbcType=CHAR}, - mathop = #{mathop,jdbcType=CHAR}, - valuetype = #{valuetype,jdbcType=VARCHAR}, - valueMeaning = #{valuemeaning,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - SoundAlarm = #{soundalarm,jdbcType=CHAR}, - scdtype = #{scdtype,jdbcType=VARCHAR}, - spanrange = #{spanrange,jdbcType=DECIMAL}, - modbusfigid = #{modbusfigid,jdbcType=VARCHAR}, - register = #{register,jdbcType=VARCHAR}, - processSectionCode = #{processsectioncode,jdbcType=VARCHAR}, - equipmentId = #{equipmentid,jdbcType=VARCHAR}, - source_type = #{sourceType,jdbcType=VARCHAR}, - patrol_type = #{patrolType,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - alarm_level = #{alarmLevel,jdbcType=INTEGER}, - disname = #{disname,jdbcType=VARCHAR} - structureId = #{structureId,jdbcType=VARCHAR} - where ID = #{id,jdbcType=VARCHAR} - - - - delete - from tb_measurepoint ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID - , ParmName, MPointCode, Unit, alarmmax, alarmmin, ParmValue, MeasureDT, SignalType, structureId - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointProgrammeDetailMapper.xml b/src/com/sipai/mapper/scada/MPointProgrammeDetailMapper.xml deleted file mode 100644 index 5b8cdf54..00000000 --- a/src/com/sipai/mapper/scada/MPointProgrammeDetailMapper.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, faid, mps, func, axesorder, disname, avgmin, avgmax, forcemin,forcemax,color,morder,fmt,axismax,axismin,spanrange,numtail - - - insert into TB_FANGANDETAIL (id, faid, mps, - func, axesorder, disname, - avgmin, avgmax, forcemin, - forcemax, color, morder, - fmt, axismax, axismin, - spanrange, numtail) - values (#{id,jdbcType=VARCHAR}, #{faid,jdbcType=VARCHAR}, #{mps,jdbcType=VARCHAR}, - #{func,jdbcType=VARCHAR}, #{axesorder,jdbcType=VARCHAR}, #{disname,jdbcType=VARCHAR}, - #{avgmin,jdbcType=DECIMAL}, #{avgmax,jdbcType=DECIMAL}, #{forcemin,jdbcType=DECIMAL}, - #{forcemax,jdbcType=DECIMAL}, #{color,jdbcType=VARCHAR}, #{morder,jdbcType=DECIMAL}, - #{fmt,jdbcType=VARCHAR}, #{axismax,jdbcType=DECIMAL}, #{axismin,jdbcType=DECIMAL}, - #{spanrange,jdbcType=DECIMAL}, #{numtail,jdbcType=VARCHAR}) - - - insert into TB_FANGANDETAIL - - - id, - - - faid, - - - mps, - - - func, - - - axesorder, - - - disname, - - - avgmin, - - - avgmax, - - - forcemin, - - - forcemax, - - - color, - - - morder, - - - fmt, - - - axismax, - - - axismin, - - - spanrange, - - - numtail, - - - - - #{id,jdbcType=VARCHAR}, - - - #{faid,jdbcType=VARCHAR}, - - - #{mps,jdbcType=VARCHAR}, - - - #{func,jdbcType=VARCHAR}, - - - #{axesorder,jdbcType=VARCHAR}, - - - #{disname,jdbcType=VARCHAR}, - - - #{avgmin,jdbcType=DECIMAL}, - - - #{avgmax,jdbcType=DECIMAL}, - - - #{forcemin,jdbcType=DECIMAL}, - - - #{forcemax,jdbcType=DECIMAL}, - - - #{color,jdbcType=VARCHAR}, - - - #{morder,jdbcType=DECIMAL}, - - - #{fmt,jdbcType=VARCHAR}, - - - #{axismax,jdbcType=DECIMAL}, - - - #{axismin,jdbcType=DECIMAL}, - - - #{spanrange,jdbcType=DECIMAL}, - - - #{numtail,jdbcType=VARCHAR}, - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointProgrammeMapper.xml b/src/com/sipai/mapper/scada/MPointProgrammeMapper.xml deleted file mode 100644 index 00b201de..00000000 --- a/src/com/sipai/mapper/scada/MPointProgrammeMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, name, hismin, hishour, hisday, active, morder, owneruserid, ownerdate - - - - delete from TB_FANGAN - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_FANGAN (id, name, hismin, - hishour, hisday, active, - morder, owneruserid, ownerdate - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{hismin,jdbcType=CHAR}, - #{hishour,jdbcType=CHAR}, #{hisday,jdbcType=CHAR}, #{active,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{owneruserid,jdbcType=VARCHAR}, #{ownerdate,jdbcType=TIMESTAMP} - ) - - - insert into TB_FANGAN - - - id, - - - name, - - - hismin, - - - hishour, - - - hisday, - - - active, - - - morder, - - - owneruserid, - - - ownerdate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{hismin,jdbcType=CHAR}, - - - #{hishour,jdbcType=CHAR}, - - - #{hisday,jdbcType=CHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{owneruserid,jdbcType=VARCHAR}, - - - #{ownerdate,jdbcType=TIMESTAMP}, - - - - - update TB_FANGAN - - - name = #{name,jdbcType=VARCHAR}, - - - hismin = #{hismin,jdbcType=CHAR}, - - - hishour = #{hishour,jdbcType=CHAR}, - - - hisday = #{hisday,jdbcType=CHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - owneruserid = #{owneruserid,jdbcType=VARCHAR}, - - - ownerdate = #{ownerdate,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_FANGAN - set name = #{name,jdbcType=VARCHAR}, - hismin = #{hismin,jdbcType=CHAR}, - hishour = #{hishour,jdbcType=CHAR}, - hisday = #{hisday,jdbcType=CHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - owneruserid = #{owneruserid,jdbcType=VARCHAR}, - ownerdate = #{ownerdate,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_FANGAN - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointPropMapper.xml b/src/com/sipai/mapper/scada/MPointPropMapper.xml deleted file mode 100644 index 78fd563b..00000000 --- a/src/com/sipai/mapper/scada/MPointPropMapper.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, project, index_evaluation, evaluation_formula, biz_id,pid,calFreq, - calRange,starthour,startday,reserveMethod,saveType,save_time_shifting - - - - delete - from TB_MeasurePoint_Prop - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_Prop (id, insdt, insuser, - project, index_evaluation, evaluation_formula, - biz_id, pid, calFreq, calRange, starthour, startday, - reserveMethod, saveType, save_time_shifting) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{project,jdbcType=VARCHAR}, #{indexEvaluation,jdbcType=VARCHAR}, #{evaluationFormula,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{calFreq,jdbcType=VARCHAR}, - #{calRange,jdbcType=VARCHAR}, #{starthour,jdbcType=VARCHAR}, #{startday,jdbcType=VARCHAR}, - #{reserveMethod,jdbcType=VARCHAR}, #{saveType,jdbcType=VARCHAR}, #{saveTimeShifting,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint_Prop - - - id, - - - insdt, - - - insuser, - - - project, - - - index_evaluation, - - - evaluation_formula, - - - biz_id, - - - pid, - - - calFreq, - - - calRange, - - - starthour, - - - startday, - - - reserveMethod, - - - saveType, - - - save_time_shifting, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{project,jdbcType=VARCHAR}, - - - #{indexEvaluation,jdbcType=VARCHAR}, - - - #{evaluationFormula,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{calFreq,jdbcType=VARCHAR}, - - - #{calRange,jdbcType=VARCHAR}, - - - #{starthour,jdbcType=VARCHAR}, - - - #{startday,jdbcType=VARCHAR}, - - - #{reserveMethod,jdbcType=VARCHAR}, - - - #{saveType,jdbcType=VARCHAR}, - - - #{saveTimeShifting,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_Prop - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - project = #{project,jdbcType=VARCHAR}, - - - index_evaluation = #{indexEvaluation,jdbcType=VARCHAR}, - - - evaluation_formula = #{evaluationFormula,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - calFreq = #{ calFreq,jdbcType=VARCHAR}, - - - calRange = #{ calRange,jdbcType=VARCHAR}, - - - starthour = #{ starthour,jdbcType=VARCHAR}, - - - startday = #{ startday,jdbcType=VARCHAR}, - - - reserveMethod = #{ reserveMethod,jdbcType=VARCHAR}, - - - saveType = #{ saveType,jdbcType=VARCHAR}, - - - save_time_shifting = #{ saveTimeShifting,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_Prop - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - project = #{project,jdbcType=VARCHAR}, - index_evaluation = #{indexEvaluation,jdbcType=VARCHAR}, - evaluation_formula = #{evaluationFormula,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - calFreq = #{calFreq,jdbcType=VARCHAR}, - calRange = #{calRange,jdbcType=VARCHAR}, - starthour = #{starthour,jdbcType=VARCHAR}, - startday = #{startday,jdbcType=VARCHAR}, - reserveMethod = #{reserveMethod,jdbcType=VARCHAR}, - saveType = #{saveType,jdbcType=VARCHAR}, - save_time_shifting = #{saveTimeShifting,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_MeasurePoint_Prop ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointPropSourceMapper.xml b/src/com/sipai/mapper/scada/MPointPropSourceMapper.xml deleted file mode 100644 index a8353f82..00000000 --- a/src/com/sipai/mapper/scada/MPointPropSourceMapper.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, pid, index_details, value, evaluation_rules, cal_range, cal_range_unit, - target_value, mpid, mpname, value_type, calculation_type, score, fixed_deduction_value, - tb_name, tb_where, tb_key_name,deadline,morder - - - - delete - from TB_MeasurePoint_PropSource - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_PropSource (id, insdt, insuser, - pid, index_details, value, - evaluation_rules, cal_range, cal_range_unit, - target_value, mpid, mpname, - value_type, calculation_type, score, - fixed_deduction_value, tb_name, tb_where, - tb_key_name, deadline,morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{indexDetails,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, - #{evaluationRules,jdbcType=VARCHAR}, #{calRange,jdbcType=INTEGER}, #{calRangeUnit,jdbcType=VARCHAR}, - #{targetValue,jdbcType=DOUBLE}, #{mpid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, - #{valueType,jdbcType=VARCHAR}, #{calculationType,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, - #{fixedDeductionValue,jdbcType=DOUBLE}, #{tbName,jdbcType=VARCHAR}, #{tbWhere,jdbcType=VARCHAR}, - #{tbKeyName,jdbcType=VARCHAR}, #{deadline,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into TB_MeasurePoint_PropSource - - - id, - - - insdt, - - - insuser, - - - pid, - - - index_details, - - - value, - - - evaluation_rules, - - - cal_range, - - - cal_range_unit, - - - target_value, - - - mpid, - - - mpname, - - - value_type, - - - calculation_type, - - - score, - - - fixed_deduction_value, - - - tb_name, - - - tb_where, - - - tb_key_name, - - - deadline, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{indexDetails,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{evaluationRules,jdbcType=VARCHAR}, - - - #{calRange,jdbcType=INTEGER}, - - - #{calRangeUnit,jdbcType=VARCHAR}, - - - #{targetValue,jdbcType=DOUBLE}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{valueType,jdbcType=VARCHAR}, - - - #{calculationType,jdbcType=VARCHAR}, - - - #{score,jdbcType=DOUBLE}, - - - #{fixedDeductionValue,jdbcType=DOUBLE}, - - - #{tbName,jdbcType=VARCHAR}, - - - #{tbWhere,jdbcType=VARCHAR}, - - - #{tbKeyName,jdbcType=VARCHAR}, - - - #{deadline,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_MeasurePoint_PropSource - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - index_details = #{indexDetails,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - evaluation_rules = #{evaluationRules,jdbcType=VARCHAR}, - - - cal_range = #{calRange,jdbcType=INTEGER}, - - - cal_range_unit = #{calRangeUnit,jdbcType=VARCHAR}, - - - target_value = #{targetValue,jdbcType=DOUBLE}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - value_type = #{valueType,jdbcType=VARCHAR}, - - - calculation_type = #{calculationType,jdbcType=VARCHAR}, - - - score = #{score,jdbcType=DOUBLE}, - - - fixed_deduction_value = #{fixedDeductionValue,jdbcType=DOUBLE}, - - - tb_name = #{tbName,jdbcType=VARCHAR}, - - - tb_where = #{tbWhere,jdbcType=VARCHAR}, - - - tb_key_name = #{tbKeyName,jdbcType=VARCHAR}, - - - deadline = #{deadline,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_PropSource - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - index_details = #{indexDetails,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - evaluation_rules = #{evaluationRules,jdbcType=VARCHAR}, - cal_range = #{calRange,jdbcType=INTEGER}, - cal_range_unit = #{calRangeUnit,jdbcType=VARCHAR}, - target_value = #{targetValue,jdbcType=DOUBLE}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - value_type = #{valueType,jdbcType=VARCHAR}, - calculation_type = #{calculationType,jdbcType=VARCHAR}, - score = #{score,jdbcType=DOUBLE}, - fixed_deduction_value = #{fixedDeductionValue,jdbcType=DOUBLE}, - tb_name = #{tbName,jdbcType=VARCHAR}, - tb_where = #{tbWhere,jdbcType=VARCHAR}, - tb_key_name = #{tbKeyName,jdbcType=VARCHAR}, - deadline = #{deadline,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_MeasurePoint_PropSource ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/MPointPropTargetMapper.xml b/src/com/sipai/mapper/scada/MPointPropTargetMapper.xml deleted file mode 100644 index 2e234d29..00000000 --- a/src/com/sipai/mapper/scada/MPointPropTargetMapper.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, pid, mpid, mpname,time - - - - delete from TB_MeasurePoint_PropTarget - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_PropTarget (id, insdt, insuser, - pid, mpid, mpname,time) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, #{time,jdbcType=VARCHAR}) - - - insert into TB_MeasurePoint_PropTarget - - - id, - - - insdt, - - - insuser, - - - pid, - - - mpid, - - - mpname, - - - time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{time,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_PropTarget - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - time = #{time,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_PropTarget - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - time = #{time,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_MeasurePoint_PropTarget - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/PersonalMpCollectionMapper.xml b/src/com/sipai/mapper/scada/PersonalMpCollectionMapper.xml deleted file mode 100644 index 11156a95..00000000 --- a/src/com/sipai/mapper/scada/PersonalMpCollectionMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - id, userid, mpids, unit_id - - - - delete from tb_PersonalMpCollection - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_PersonalMpCollection (id, userid, mpids, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{mpids,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_PersonalMpCollection - - - id, - - - userid, - - - mpids, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{mpids,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_PersonalMpCollection - - - userid = #{userid,jdbcType=VARCHAR}, - - - mpids = #{mpids,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_PersonalMpCollection - set userid = #{userid,jdbcType=VARCHAR}, - mpids = #{mpids,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_PersonalMpCollection - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/ProAlarmBaseTextMapper.xml b/src/com/sipai/mapper/scada/ProAlarmBaseTextMapper.xml deleted file mode 100644 index 6679d48f..00000000 --- a/src/com/sipai/mapper/scada/ProAlarmBaseTextMapper.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - id - , insdt, decisionExpertBaseText, alarm_id, adopter, adoption_time, adopt_st, unit_id, - decisionExpertBase_id, decisionExpertBase_pid - - - - delete - from TB_PRO_ALARM_BaseText - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_PRO_ALARM_BaseText (id, insdt, decisionExpertBaseText, - alarm_id, adopter, adoption_time, - adopt_st, unit_id, decisionExpertBase_id, - decisionExpertBase_pid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{decisionexpertbasetext,jdbcType=VARCHAR}, - #{alarmId,jdbcType=VARCHAR}, #{adopter,jdbcType=VARCHAR}, #{adoptionTime,jdbcType=VARCHAR}, - #{adoptSt,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{decisionexpertbaseId,jdbcType=VARCHAR}, - #{decisionexpertbasePid,jdbcType=VARCHAR}) - - - insert into TB_PRO_ALARM_BaseText - - - id, - - - insdt, - - - decisionExpertBaseText, - - - alarm_id, - - - adopter, - - - adoption_time, - - - adopt_st, - - - unit_id, - - - decisionExpertBase_id, - - - decisionExpertBase_pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{decisionexpertbasetext,jdbcType=VARCHAR}, - - - #{alarmId,jdbcType=VARCHAR}, - - - #{adopter,jdbcType=VARCHAR}, - - - #{adoptionTime,jdbcType=VARCHAR}, - - - #{adoptSt,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{decisionexpertbaseId,jdbcType=VARCHAR}, - - - #{decisionexpertbasePid,jdbcType=VARCHAR}, - - - - - update TB_PRO_ALARM_BaseText - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - decisionExpertBaseText = #{decisionexpertbasetext,jdbcType=VARCHAR}, - - - alarm_id = #{alarmId,jdbcType=VARCHAR}, - - - adopter = #{adopter,jdbcType=VARCHAR}, - - - adoption_time = #{adoptionTime,jdbcType=VARCHAR}, - - - adopt_st = #{adoptSt,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - decisionExpertBase_id = #{decisionexpertbaseId,jdbcType=VARCHAR}, - - - decisionExpertBase_pid = #{decisionexpertbasePid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_PRO_ALARM_BaseText - set insdt = #{insdt,jdbcType=TIMESTAMP}, - decisionExpertBaseText = #{decisionexpertbasetext,jdbcType=VARCHAR}, - alarm_id = #{alarmId,jdbcType=VARCHAR}, - adopter = #{adopter,jdbcType=VARCHAR}, - adoption_time = #{adoptionTime,jdbcType=VARCHAR}, - adopt_st = #{adoptSt,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - decisionExpertBase_id = #{decisionexpertbaseId,jdbcType=VARCHAR}, - decisionExpertBase_pid = #{decisionexpertbasePid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - delete - from TB_PRO_ALARM_BaseText ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/ProAlarmDataStopHisPointMapper.xml b/src/com/sipai/mapper/scada/ProAlarmDataStopHisPointMapper.xml deleted file mode 100644 index ff88edf8..00000000 --- a/src/com/sipai/mapper/scada/ProAlarmDataStopHisPointMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - id - , alarm_id, point_id, insdt - - - - delete - from TB_PRO_ALARM_Data_Stop_HisPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_PRO_ALARM_Data_Stop_HisPoint (id, alarm_id, point_id, - insdt) - values (#{id,jdbcType=VARCHAR}, #{alarmId,jdbcType=VARCHAR}, #{pointId,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_PRO_ALARM_Data_Stop_HisPoint - - - id, - - - alarm_id, - - - point_id, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{alarmId,jdbcType=VARCHAR}, - - - #{pointId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_PRO_ALARM_Data_Stop_HisPoint - - - alarm_id = #{alarmId,jdbcType=VARCHAR}, - - - point_id = #{pointId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_PRO_ALARM_Data_Stop_HisPoint - set alarm_id = #{alarmId,jdbcType=VARCHAR}, - point_id = #{pointId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_PRO_ALARM_Data_Stop_HisPoint ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/ProAlarmMapper.xml b/src/com/sipai/mapper/scada/ProAlarmMapper.xml deleted file mode 100644 index 8c4fa709..00000000 --- a/src/com/sipai/mapper/scada/ProAlarmMapper.xml +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, alarm_time,last_alarm_time, confirm_time,confirmerid, recover_time, recover_value, point_code, point_name, - status, alarm_level, process_section_code, process_section_name, patrol_point_id, - biz_id, describe, alarm_type, original_status, confirm_content - - - - delete - from tb_pro_alarm - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_alarm (id, insdt, alarm_time, last_alarm_time, - confirm_time, confirmerid, recover_time, recover_value, - point_code, point_name, status, - alarm_level, process_section_code, process_section_name, - patrol_point_id, biz_id, describe, - alarm_type, original_status, confirm_content) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{alarmTime,jdbcType=TIMESTAMP}, - #{lastAlarmTime,jdbcType=TIMESTAMP}, - #{confirmTime,jdbcType=TIMESTAMP}, #{confirmerid,jdbcType=VARCHAR}, #{recoverTime,jdbcType=TIMESTAMP}, - #{recoverValue,jdbcType=DECIMAL}, - #{pointCode,jdbcType=VARCHAR}, #{pointName,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, - #{alarmLevel,jdbcType=VARCHAR}, #{processSectionCode,jdbcType=VARCHAR}, - #{processSectionName,jdbcType=VARCHAR}, - #{patrolPointId,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, - #{alarmType,jdbcType=VARCHAR}, #{originalStatus,jdbcType=VARCHAR}, #{confirmContent,jdbcType=VARCHAR}) - - - insert into tb_pro_alarm - - - id, - - - insdt, - - - alarm_time, - - - last_alarm_time, - - - confirm_time, - - - confirmerid, - - - recover_time, - - - recover_value, - - - point_code, - - - point_name, - - - status, - - - alarm_level, - - - process_section_code, - - - process_section_name, - - - patrol_point_id, - - - biz_id, - - - describe, - - - alarm_type, - - - original_status, - - - confirm_content, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{alarmTime,jdbcType=TIMESTAMP}, - - - #{lastAlarmTime,jdbcType=TIMESTAMP}, - - - #{confirmTime,jdbcType=TIMESTAMP}, - - - #{confirmerid,jdbcType=VARCHAR}, - - - #{recoverTime,jdbcType=TIMESTAMP}, - - - #{recoverValue,jdbcType=DECIMAL}, - - - #{pointCode,jdbcType=VARCHAR}, - - - #{pointName,jdbcType=VARCHAR}, - - - #{status,jdbcType=CHAR}, - - - #{alarmLevel,jdbcType=VARCHAR}, - - - #{processSectionCode,jdbcType=VARCHAR}, - - - #{processSectionName,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{alarmType,jdbcType=VARCHAR}, - - - #{originalStatus,jdbcType=VARCHAR}, - - - #{confirmContent,jdbcType=VARCHAR}, - - - - - update tb_pro_alarm - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - alarm_time = #{alarmTime,jdbcType=TIMESTAMP}, - - - last_alarm_time = #{lastAlarmTime,jdbcType=TIMESTAMP}, - - - confirm_time = #{confirmTime,jdbcType=TIMESTAMP}, - - - confirmerid = #{confirmerid,jdbcType=VARCHAR}, - - - recover_time = #{recoverTime,jdbcType=TIMESTAMP}, - - - recover_value = #{recoverValue,jdbcType=DECIMAL}, - - - point_code = #{pointCode,jdbcType=VARCHAR}, - - - point_name = #{pointName,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=CHAR}, - - - alarm_level = #{alarmLevel,jdbcType=VARCHAR}, - - - process_section_code = #{processSectionCode,jdbcType=VARCHAR}, - - - process_section_name = #{processSectionName,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - alarm_type = #{alarmType,jdbcType=VARCHAR}, - - - original_status = #{originalStatus,jdbcType=VARCHAR}, - - - confirm_content = #{confirmContent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_alarm - set insdt = #{insdt,jdbcType=TIMESTAMP}, - alarm_time = #{alarmTime,jdbcType=TIMESTAMP}, - last_alarm_time = #{lastAlarmTime,jdbcType=TIMESTAMP}, - confirm_time = #{confirmTime,jdbcType=TIMESTAMP}, - confirmerid = #{confirmerid,jdbcType=VARCHAR}, - recover_time = #{recoverTime,jdbcType=TIMESTAMP}, - recover_value = #{recoverValue,jdbcType=DECIMAL}, - point_code = #{pointCode,jdbcType=VARCHAR}, - point_name = #{pointName,jdbcType=VARCHAR}, - status = #{status,jdbcType=CHAR}, - alarm_level = #{alarmLevel,jdbcType=VARCHAR}, - process_section_code = #{processSectionCode,jdbcType=VARCHAR}, - process_section_name = #{processSectionName,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - alarm_type = #{alarmType,jdbcType=VARCHAR}, - original_status = #{originalStatus,jdbcType=VARCHAR}, - confirm_content = #{confirmContent,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - update tb_pro_alarm - set status='2', - recover_time='${recover_time}', - recover_value=${recover_value} ${where} - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/ScadaAlarmMapper.xml b/src/com/sipai/mapper/scada/ScadaAlarmMapper.xml deleted file mode 100644 index 52c2642f..00000000 --- a/src/com/sipai/mapper/scada/ScadaAlarmMapper.xml +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, alarm_time, confirm_time, recover_time, recover_value, mpoint_code, mpoint_name, - status, alarm_level, process_section_code, process_section_name, patrol_point_id, - biz_id, describe, alarm_type_lv1, alarm_type_lv2, original_status - - - - delete from tb_scada_alarm - where id = #{id,jdbcType=BIGINT} - - - insert into tb_scada_alarm (insdt, alarm_time, - confirm_time, recover_time, recover_value, - mpoint_code, mpoint_name, status, - alarm_level, process_section_code, process_section_name, - patrol_point_id, biz_id, describe, - alarm_type_lv1, alarm_type_lv2, original_status - ) - values (#{insdt,jdbcType=TIMESTAMP}, #{alarmTime,jdbcType=TIMESTAMP}, - #{confirmTime,jdbcType=TIMESTAMP}, #{recoverTime,jdbcType=TIMESTAMP}, #{recoverValue,jdbcType=DECIMAL}, - #{mpointCode,jdbcType=VARCHAR}, #{mpointName,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, - #{alarmLevel,jdbcType=INTEGER}, #{processSectionCode,jdbcType=VARCHAR}, #{processSectionName,jdbcType=VARCHAR}, - #{patrolPointId,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, - #{alarmTypeLv1,jdbcType=VARCHAR}, #{alarmTypeLv2,jdbcType=VARCHAR}, #{originalStatus,jdbcType=VARCHAR} - ) - - - insert into tb_scada_alarm - - - - - - insdt, - - - alarm_time, - - - confirm_time, - - - recover_time, - - - recover_value, - - - mpoint_code, - - - mpoint_name, - - - status, - - - alarm_level, - - - process_section_code, - - - process_section_name, - - - patrol_point_id, - - - biz_id, - - - describe, - - - alarm_type_lv1, - - - alarm_type_lv2, - - - original_status, - - - - - - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{alarmTime,jdbcType=TIMESTAMP}, - - - #{confirmTime,jdbcType=TIMESTAMP}, - - - #{recoverTime,jdbcType=TIMESTAMP}, - - - #{recoverValue,jdbcType=DECIMAL}, - - - #{mpointCode,jdbcType=VARCHAR}, - - - #{mpointName,jdbcType=VARCHAR}, - - - #{status,jdbcType=CHAR}, - - - #{alarmLevel,jdbcType=INTEGER}, - - - #{processSectionCode,jdbcType=VARCHAR}, - - - #{processSectionName,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{alarmTypeLv1,jdbcType=VARCHAR}, - - - #{alarmTypeLv2,jdbcType=VARCHAR}, - - - #{originalStatus,jdbcType=VARCHAR}, - - - - - update tb_scada_alarm - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - alarm_time = #{alarmTime,jdbcType=TIMESTAMP}, - - - confirm_time = #{confirmTime,jdbcType=TIMESTAMP}, - - - recover_time = #{recoverTime,jdbcType=TIMESTAMP}, - - - recover_value = #{recoverValue,jdbcType=DECIMAL}, - - - mpoint_code = #{mpointCode,jdbcType=VARCHAR}, - - - mpoint_name = #{mpointName,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=CHAR}, - - - alarm_level = #{alarmLevel,jdbcType=INTEGER}, - - - process_section_code = #{processSectionCode,jdbcType=VARCHAR}, - - - process_section_name = #{processSectionName,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - alarm_type_lv1 = #{alarmTypeLv1,jdbcType=VARCHAR}, - - - alarm_type_lv2 = #{alarmTypeLv2,jdbcType=VARCHAR}, - - - original_status = #{originalStatus,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update tb_scada_alarm - set insdt = #{insdt,jdbcType=TIMESTAMP}, - alarm_time = #{alarmTime,jdbcType=TIMESTAMP}, - confirm_time = #{confirmTime,jdbcType=TIMESTAMP}, - recover_time = #{recoverTime,jdbcType=TIMESTAMP}, - recover_value = #{recoverValue,jdbcType=DECIMAL}, - mpoint_code = #{mpointCode,jdbcType=VARCHAR}, - mpoint_name = #{mpointName,jdbcType=VARCHAR}, - status = #{status,jdbcType=CHAR}, - alarm_level = #{alarmLevel,jdbcType=INTEGER}, - process_section_code = #{processSectionCode,jdbcType=VARCHAR}, - process_section_name = #{processSectionName,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - alarm_type_lv1 = #{alarmTypeLv1,jdbcType=VARCHAR}, - alarm_type_lv2 = #{alarmTypeLv2,jdbcType=VARCHAR}, - original_status = #{originalStatus,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - - - - update tb_scada_alarm set status='${status}' - ${where} - - - update tb_scada_alarm set status='2',recover_time='${recover_time}',recover_value=${recover_value} - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/scada/TempReportMapper.xml b/src/com/sipai/mapper/scada/TempReportMapper.xml deleted file mode 100644 index 0780338c..00000000 --- a/src/com/sipai/mapper/scada/TempReportMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - ItemID, ParmValue, MeasureDT, FormatType, decimal, mpcode - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/schedule/ScheduleJobDetailMapper.xml b/src/com/sipai/mapper/schedule/ScheduleJobDetailMapper.xml deleted file mode 100644 index b759d494..00000000 --- a/src/com/sipai/mapper/schedule/ScheduleJobDetailMapper.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, pid, taskname, taskid, paramname, paramvalue, unitid, ord, memo, insuser, insdt, - upsuser, upsdt - - - - delete from tb_schedule_job_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_schedule_job_detail (id, pid, taskname, - taskid, paramname, paramvalue, - unitid, ord, memo, - insuser, insdt, upsuser, - upsdt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{taskname,jdbcType=VARCHAR}, - #{taskid,jdbcType=VARCHAR}, #{paramname,jdbcType=VARCHAR}, #{paramvalue,jdbcType=VARCHAR}, - #{unitid,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}) - - - insert into tb_schedule_job_detail - - - id, - - - pid, - - - taskname, - - - taskid, - - - paramname, - - - paramvalue, - - - unitid, - - - ord, - - - memo, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{taskname,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{paramname,jdbcType=VARCHAR}, - - - #{paramvalue,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{memo,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_schedule_job_detail - - - pid = #{pid,jdbcType=VARCHAR}, - - - taskname = #{taskname,jdbcType=VARCHAR}, - - - taskid = #{taskid,jdbcType=VARCHAR}, - - - paramname = #{paramname,jdbcType=VARCHAR}, - - - paramvalue = #{paramvalue,jdbcType=VARCHAR}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_schedule_job_detail - set pid = #{pid,jdbcType=VARCHAR}, - taskname = #{taskname,jdbcType=VARCHAR}, - taskid = #{taskid,jdbcType=VARCHAR}, - paramname = #{paramname,jdbcType=VARCHAR}, - paramvalue = #{paramvalue,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - memo = #{memo,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_schedule_job_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/schedule/ScheduleJobMapper.xml b/src/com/sipai/mapper/schedule/ScheduleJobMapper.xml deleted file mode 100644 index 8da991a4..00000000 --- a/src/com/sipai/mapper/schedule/ScheduleJobMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, job_name, job_group, method_name, bean_class, status, cron_expression, params, - remark, insdt, insuser, upsdt, upsuser, unit_id - - - - delete from tb_schedule_job - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_schedule_job (id, job_name, job_group, - method_name, bean_class, status, - cron_expression, params, remark, - insdt, insuser, upsdt, unit_id - upsuser,unit_id) - values (#{id,jdbcType=VARCHAR}, #{jobName,jdbcType=VARCHAR}, #{jobGroup,jdbcType=VARCHAR}, - #{methodName,jdbcType=VARCHAR}, #{beanClass,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, - #{cronExpression,jdbcType=VARCHAR}, #{params,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_schedule_job - - - id, - - - job_name, - - - job_group, - - - method_name, - - - bean_class, - - - status, - - - cron_expression, - - - params, - - - remark, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{jobName,jdbcType=VARCHAR}, - - - #{jobGroup,jdbcType=VARCHAR}, - - - #{methodName,jdbcType=VARCHAR}, - - - #{beanClass,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - #{cronExpression,jdbcType=VARCHAR}, - - - #{params,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_schedule_job - - - job_name = #{jobName,jdbcType=VARCHAR}, - - - job_group = #{jobGroup,jdbcType=VARCHAR}, - - - method_name = #{methodName,jdbcType=VARCHAR}, - - - bean_class = #{beanClass,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=INTEGER}, - - - cron_expression = #{cronExpression,jdbcType=VARCHAR}, - - - params = #{params,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_schedule_job - set job_name = #{jobName,jdbcType=VARCHAR}, - job_group = #{jobGroup,jdbcType=VARCHAR}, - method_name = #{methodName,jdbcType=VARCHAR}, - bean_class = #{beanClass,jdbcType=VARCHAR}, - status = #{status,jdbcType=INTEGER}, - cron_expression = #{cronExpression,jdbcType=VARCHAR}, - params = #{params,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR} - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_schedule_job - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/schedule/ScheduleJobTypeMapper.xml b/src/com/sipai/mapper/schedule/ScheduleJobTypeMapper.xml deleted file mode 100644 index 5b3331e8..00000000 --- a/src/com/sipai/mapper/schedule/ScheduleJobTypeMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, interfaceurl, unitid, memo, ord, insuser, insdt, upsuser, upsdt - - - - delete from tb_schedule_job_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_schedule_job_type (id, name, interfaceurl, - unitid, memo, ord, - insuser, insdt, upsuser, - upsdt) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{interfaceurl,jdbcType=VARCHAR}, - #{unitid,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}) - - - insert into tb_schedule_job_type - - - id, - - - name, - - - interfaceurl, - - - unitid, - - - memo, - - - ord, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{interfaceurl,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_schedule_job_type - - - name = #{name,jdbcType=VARCHAR}, - - - interfaceurl = #{interfaceurl,jdbcType=VARCHAR}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_schedule_job_type - set name = #{name,jdbcType=VARCHAR}, - interfaceurl = #{interfaceurl,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_schedule_job_type - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/score/LibraryMPointPropMapper.xml b/src/com/sipai/mapper/score/LibraryMPointPropMapper.xml deleted file mode 100644 index 010169cb..00000000 --- a/src/com/sipai/mapper/score/LibraryMPointPropMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, evaluation_formula, pid, calFreq, calRange, name, type, signaltag, unit - - - - delete from tb_library_mpoint_prop - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_mpoint_prop (id, insdt, insuser, - evaluation_formula, pid, calFreq, - calRange, name, type, - signaltag, unit) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{evaluationFormula,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{calfreq,jdbcType=VARCHAR}, - #{calrange,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=CHAR}, - #{signaltag,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}) - - - insert into tb_library_mpoint_prop - - - id, - - - insdt, - - - insuser, - - - evaluation_formula, - - - pid, - - - calFreq, - - - calRange, - - - name, - - - type, - - - signaltag, - - - unit, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{evaluationFormula,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{calfreq,jdbcType=VARCHAR}, - - - #{calrange,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=CHAR}, - - - #{signaltag,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - - - update tb_library_mpoint_prop - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - evaluation_formula = #{evaluationFormula,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - calFreq = #{calfreq,jdbcType=VARCHAR}, - - - calRange = #{calrange,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=CHAR}, - - - signaltag = #{signaltag,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_mpoint_prop - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - evaluation_formula = #{evaluationFormula,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - calFreq = #{calfreq,jdbcType=VARCHAR}, - calRange = #{calrange,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=CHAR}, - signaltag = #{signaltag,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_mpoint_prop - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/score/LibraryMPointPropSourceMapper.xml b/src/com/sipai/mapper/score/LibraryMPointPropSourceMapper.xml deleted file mode 100644 index a344a0a4..00000000 --- a/src/com/sipai/mapper/score/LibraryMPointPropSourceMapper.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, index_details, cal_range, cal_range_unit, mpid, value_type, - calculation_type - - - - delete from tb_library_mpoint_propsource - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_library_mpoint_propsource (id, insdt, insuser, - pid, index_details, cal_range, - cal_range_unit, mpid, value_type, - calculation_type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{indexDetails,jdbcType=VARCHAR}, #{calRange,jdbcType=INTEGER}, - #{calRangeUnit,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{valueType,jdbcType=VARCHAR}, - #{calculationType,jdbcType=VARCHAR}) - - - insert into tb_library_mpoint_propsource - - - id, - - - insdt, - - - insuser, - - - pid, - - - index_details, - - - cal_range, - - - cal_range_unit, - - - mpid, - - - value_type, - - - calculation_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{indexDetails,jdbcType=VARCHAR}, - - - #{calRange,jdbcType=INTEGER}, - - - #{calRangeUnit,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{valueType,jdbcType=VARCHAR}, - - - #{calculationType,jdbcType=VARCHAR}, - - - - - update tb_library_mpoint_propsource - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - index_details = #{indexDetails,jdbcType=VARCHAR}, - - - cal_range = #{calRange,jdbcType=INTEGER}, - - - cal_range_unit = #{calRangeUnit,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - value_type = #{valueType,jdbcType=VARCHAR}, - - - calculation_type = #{calculationType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_library_mpoint_propsource - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - index_details = #{indexDetails,jdbcType=VARCHAR}, - cal_range = #{calRange,jdbcType=INTEGER}, - cal_range_unit = #{calRangeUnit,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - value_type = #{valueType,jdbcType=VARCHAR}, - calculation_type = #{calculationType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_library_mpoint_propsource - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ApplyPurchasePlanMapper.xml b/src/com/sipai/mapper/sparepart/ApplyPurchasePlanMapper.xml deleted file mode 100644 index 13157f90..00000000 --- a/src/com/sipai/mapper/sparepart/ApplyPurchasePlanMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, biz_id, applicant, plan_apply_purchase_startdate, plan_apply_purchase_enddate, - department_id, type, status, remark - - - - delete from TB_SparePart_ApplyPurchasePlan - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ApplyPurchasePlan (id, insdt, insuser, - pid, biz_id, applicant, - plan_apply_purchase_startdate, plan_apply_purchase_enddate, - department_id, type, status, - remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{applicant,jdbcType=VARCHAR}, - #{planApplyPurchaseStartdate,jdbcType=INTEGER}, #{planApplyPurchaseEnddate,jdbcType=INTEGER}, - #{departmentId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ApplyPurchasePlan - - - id, - - - insdt, - - - insuser, - - - pid, - - - biz_id, - - - applicant, - - - plan_apply_purchase_startdate, - - - plan_apply_purchase_enddate, - - - department_id, - - - type, - - - status, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{applicant,jdbcType=VARCHAR}, - - - #{planApplyPurchaseStartdate,jdbcType=INTEGER}, - - - #{planApplyPurchaseEnddate,jdbcType=INTEGER}, - - - #{departmentId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ApplyPurchasePlan - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - applicant = #{applicant,jdbcType=VARCHAR}, - - - plan_apply_purchase_startdate = #{planApplyPurchaseStartdate,jdbcType=INTEGER}, - - - plan_apply_purchase_enddate = #{planApplyPurchaseEnddate,jdbcType=INTEGER}, - - - department_id = #{departmentId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ApplyPurchasePlan - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - applicant = #{applicant,jdbcType=VARCHAR}, - plan_apply_purchase_startdate = #{planApplyPurchaseStartdate,jdbcType=INTEGER}, - plan_apply_purchase_enddate = #{planApplyPurchaseEnddate,jdbcType=INTEGER}, - department_id = #{departmentId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ApplyPurchasePlan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ChannelsMapper.xml b/src/com/sipai/mapper/sparepart/ChannelsMapper.xml deleted file mode 100644 index 39b2b905..00000000 --- a/src/com/sipai/mapper/sparepart/ChannelsMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, name, morder, active, pid, describe, source - - - - delete from TB_SparePart_Channels - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Channels (id, insdt, insuser, - name, morder, active, pid, - describe, source) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, - #{describe,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}) - - - insert into TB_SparePart_Channels - - - id, - - - insdt, - - - insuser, - - - name, - - - morder, - - - active, - - - pid, - - - describe, - - - source, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{source,jdbcType=INTEGER}, - - - - - update TB_SparePart_Channels - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - source = #{source,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Channels - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - source = #{source,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Channels - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ConsumeDetailMapper.xml b/src/com/sipai/mapper/sparepart/ConsumeDetailMapper.xml deleted file mode 100644 index 60029372..00000000 --- a/src/com/sipai/mapper/sparepart/ConsumeDetailMapper.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, outstock_record_detail_id, goods_id, consume_number, work_order_id - - - - delete from TB_SparePart_ConsumeDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ConsumeDetail (id, insdt, insuser, - outstock_record_detail_id, goods_id, consume_number, - work_order_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{outstockRecordDetailId,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{consumeNumber,jdbcType=DECIMAL}, - #{workOrderId,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ConsumeDetail - - - id, - - - insdt, - - - insuser, - - - outstock_record_detail_id, - - - goods_id, - - - consume_number, - - - work_order_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{outstockRecordDetailId,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{consumeNumber,jdbcType=DECIMAL}, - - - #{workOrderId,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ConsumeDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - outstock_record_detail_id = #{outstockRecordDetailId,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - consume_number = #{consumeNumber,jdbcType=DECIMAL}, - - - work_order_id = #{workOrderId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ConsumeDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - outstock_record_detail_id = #{outstockRecordDetailId,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - consume_number = #{consumeNumber,jdbcType=DECIMAL}, - work_order_id = #{workOrderId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_SparePart_ConsumeDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractChangeFileMapper.xml b/src/com/sipai/mapper/sparepart/ContractChangeFileMapper.xml deleted file mode 100644 index 7e47f380..00000000 --- a/src/com/sipai/mapper/sparepart/ContractChangeFileMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, masterid, filename, abspath, insdt, insuser, filepath, type, size - - - - delete from TB_SparePart_ContractChange_file - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractChange_file (id, masterid, filename, - abspath, insdt, insuser, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_ContractChange_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - insdt, - - - insuser, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractChange_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractChange_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractChange_file - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractClassMapper.xml b/src/com/sipai/mapper/sparepart/ContractClassMapper.xml deleted file mode 100644 index 68708d9a..00000000 --- a/src/com/sipai/mapper/sparepart/ContractClassMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, name, number, morder, active, pid, describe - - - - delete from TB_SparePart_ContractClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractClass (id, insdt, insuser, - name, number, morder, - active, pid, describe) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ContractClass - - - id, - - - insdt, - - - insuser, - - - name, - - - number, - - - morder, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{number,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractClass - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractClass - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractClass - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractDetailInvoiceFileMapper.xml b/src/com/sipai/mapper/sparepart/ContractDetailInvoiceFileMapper.xml deleted file mode 100644 index f030d308..00000000 --- a/src/com/sipai/mapper/sparepart/ContractDetailInvoiceFileMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, masterid, filename, abspath, insdt, insuser, filepath, type, size - - - - delete from TB_SparePart_ContractDetail_Invoice_file - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractDetail_Invoice_file (id, masterid, filename, - abspath, insdt, insuser, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_ContractDetail_Invoice_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - insdt, - - - insuser, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractDetail_Invoice_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractDetail_Invoice_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractDetail_Invoice_file - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractDetailInvoiceMapper.xml b/src/com/sipai/mapper/sparepart/ContractDetailInvoiceMapper.xml deleted file mode 100644 index 7b7277e8..00000000 --- a/src/com/sipai/mapper/sparepart/ContractDetailInvoiceMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, amountInvoice, invoiceDate, morder, contract_id, number, invoice_status - - - - delete from TB_SparePart_ContractDetail_Invoice - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractDetail_Invoice (id, insdt, insuser, - amountInvoice, invoiceDate, morder, - contract_id, number, invoice_status - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{amountinvoice,jdbcType=DECIMAL}, #{invoicedate,jdbcType=TIMESTAMP}, #{morder,jdbcType=INTEGER}, - #{contractId,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{invoiceStatus,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_ContractDetail_Invoice - - - id, - - - insdt, - - - insuser, - - - amountInvoice, - - - invoiceDate, - - - morder, - - - contract_id, - - - number, - - - invoice_status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{amountinvoice,jdbcType=DECIMAL}, - - - #{invoicedate,jdbcType=TIMESTAMP}, - - - #{morder,jdbcType=INTEGER}, - - - #{contractId,jdbcType=VARCHAR}, - - - #{number,jdbcType=VARCHAR}, - - - #{invoiceStatus,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractDetail_Invoice - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - amountInvoice = #{amountinvoice,jdbcType=DECIMAL}, - - - invoiceDate = #{invoicedate,jdbcType=TIMESTAMP}, - - - morder = #{morder,jdbcType=INTEGER}, - - - contract_id = #{contractId,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=VARCHAR}, - - - invoice_status = #{invoiceStatus,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractDetail_Invoice - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - amountInvoice = #{amountinvoice,jdbcType=DECIMAL}, - invoiceDate = #{invoicedate,jdbcType=TIMESTAMP}, - morder = #{morder,jdbcType=INTEGER}, - contract_id = #{contractId,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR}, - invoice_status = #{invoiceStatus,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractDetail_Invoice - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractDetailMapper.xml b/src/com/sipai/mapper/sparepart/ContractDetailMapper.xml deleted file mode 100644 index a8d2b618..00000000 --- a/src/com/sipai/mapper/sparepart/ContractDetailMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, goods_id, supplier_id, number, price, total_money, dept_id, purpose, - contract_id, subscribe_detail_id, remark - - - - delete from TB_SparePart_ContractDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractDetail (id, insdt, insuser, - goods_id, supplier_id, number, - price, total_money, dept_id, - purpose, contract_id, subscribe_detail_id, - remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{goodsId,jdbcType=VARCHAR}, #{supplierId,jdbcType=VARCHAR}, #{number,jdbcType=DECIMAL}, - #{price,jdbcType=DECIMAL}, #{totalMoney,jdbcType=DECIMAL}, #{deptId,jdbcType=VARCHAR}, - #{purpose,jdbcType=VARCHAR}, #{contractId,jdbcType=VARCHAR}, #{subscribeDetailId,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ContractDetail - - - id, - - - insdt, - - - insuser, - - - goods_id, - - - supplier_id, - - - number, - - - price, - - - total_money, - - - dept_id, - - - purpose, - - - contract_id, - - - subscribe_detail_id, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{number,jdbcType=DECIMAL}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{purpose,jdbcType=VARCHAR}, - - - #{contractId,jdbcType=VARCHAR}, - - - #{subscribeDetailId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=DECIMAL}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - purpose = #{purpose,jdbcType=VARCHAR}, - - - contract_id = #{contractId,jdbcType=VARCHAR}, - - - subscribe_detail_id = #{subscribeDetailId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - number = #{number,jdbcType=DECIMAL}, - price = #{price,jdbcType=DECIMAL}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - dept_id = #{deptId,jdbcType=VARCHAR}, - purpose = #{purpose,jdbcType=VARCHAR}, - contract_id = #{contractId,jdbcType=VARCHAR}, - subscribe_detail_id = #{subscribeDetailId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractDetailPaymentMapper.xml b/src/com/sipai/mapper/sparepart/ContractDetailPaymentMapper.xml deleted file mode 100644 index 302e127c..00000000 --- a/src/com/sipai/mapper/sparepart/ContractDetailPaymentMapper.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, amountPaid, paymentDate, amountOutstanding, morder, contract_id, - application_time, application_amount, payment_time, payment_amount, payment_status, - invoice_ids - - - - delete from TB_SparePart_ContractDetail_Payment - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractDetail_Payment (id, insdt, insuser, - amountPaid, paymentDate, amountOutstanding, - morder, contract_id, application_time, - application_amount, payment_time, payment_amount, - payment_status, invoice_ids) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{amountpaid,jdbcType=DECIMAL}, #{paymentdate,jdbcType=TIMESTAMP}, #{amountoutstanding,jdbcType=DECIMAL}, - #{morder,jdbcType=INTEGER}, #{contractId,jdbcType=VARCHAR}, #{applicationTime,jdbcType=VARCHAR}, - #{applicationAmount,jdbcType=VARCHAR}, #{paymentTime,jdbcType=VARCHAR}, #{paymentAmount,jdbcType=VARCHAR}, - #{paymentStatus,jdbcType=VARCHAR}, #{invoiceIds,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ContractDetail_Payment - - - id, - - - insdt, - - - insuser, - - - amountPaid, - - - paymentDate, - - - amountOutstanding, - - - morder, - - - contract_id, - - - application_time, - - - application_amount, - - - payment_time, - - - payment_amount, - - - payment_status, - - - invoice_ids, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{amountpaid,jdbcType=DECIMAL}, - - - #{paymentdate,jdbcType=TIMESTAMP}, - - - #{amountoutstanding,jdbcType=DECIMAL}, - - - #{morder,jdbcType=INTEGER}, - - - #{contractId,jdbcType=VARCHAR}, - - - #{applicationTime,jdbcType=VARCHAR}, - - - #{applicationAmount,jdbcType=VARCHAR}, - - - #{paymentTime,jdbcType=VARCHAR}, - - - #{paymentAmount,jdbcType=VARCHAR}, - - - #{paymentStatus,jdbcType=VARCHAR}, - - - #{invoiceIds,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractDetail_Payment - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - amountPaid = #{amountpaid,jdbcType=DECIMAL}, - - - paymentDate = #{paymentdate,jdbcType=TIMESTAMP}, - - - amountOutstanding = #{amountoutstanding,jdbcType=DECIMAL}, - - - morder = #{morder,jdbcType=INTEGER}, - - - contract_id = #{contractId,jdbcType=VARCHAR}, - - - application_time = #{applicationTime,jdbcType=VARCHAR}, - - - application_amount = #{applicationAmount,jdbcType=VARCHAR}, - - - payment_time = #{paymentTime,jdbcType=VARCHAR}, - - - payment_amount = #{paymentAmount,jdbcType=VARCHAR}, - - - payment_status = #{paymentStatus,jdbcType=VARCHAR}, - - - invoice_ids = #{invoiceIds,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractDetail_Payment - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - amountPaid = #{amountpaid,jdbcType=DECIMAL}, - paymentDate = #{paymentdate,jdbcType=TIMESTAMP}, - amountOutstanding = #{amountoutstanding,jdbcType=DECIMAL}, - morder = #{morder,jdbcType=INTEGER}, - contract_id = #{contractId,jdbcType=VARCHAR}, - application_time = #{applicationTime,jdbcType=VARCHAR}, - application_amount = #{applicationAmount,jdbcType=VARCHAR}, - payment_time = #{paymentTime,jdbcType=VARCHAR}, - payment_amount = #{paymentAmount,jdbcType=VARCHAR}, - payment_status = #{paymentStatus,jdbcType=VARCHAR}, - invoice_ids = #{invoiceIds,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractDetail_Payment - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractFileMapper.xml b/src/com/sipai/mapper/sparepart/ContractFileMapper.xml deleted file mode 100644 index fd453dc8..00000000 --- a/src/com/sipai/mapper/sparepart/ContractFileMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, masterid, filename, abspath, insdt, insuser, filepath, type, size - - - - delete from TB_SparePart_Contract_file - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Contract_file (id, masterid, filename, - abspath, insdt, insuser, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_Contract_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - insdt, - - - insuser, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Contract_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Contract_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Contract_file - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractMapper.xml b/src/com/sipai/mapper/sparepart/ContractMapper.xml deleted file mode 100644 index 55ec2feb..00000000 --- a/src/com/sipai/mapper/sparepart/ContractMapper.xml +++ /dev/null @@ -1,499 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, contractNumber, contractName, contractClassId, contractTaxRateId, - purchaseMethodsId, channelsId, supplierId, agentId, contractAmount, qualityDeposit, - warrantyPeriodId, contractStartDate, contractEndDate, PerformanceId, remark, purchaseId, - status, biz_id, dept_id, contract_audit_id, countersign_audit_id, reject_reason, - processDefId, processId, firstparty, helpers, helpers_log, performanceBond, supplyPlanStartDate, - supplyPlanEndDate, supplyActualStartDate, supplyActualEndDate, warrantyDeposit, settlement_amount - - - - delete from TB_SparePart_Contract - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Contract (id, insdt, insuser, - contractNumber, contractName, contractClassId, - contractTaxRateId, purchaseMethodsId, channelsId, - supplierId, agentId, contractAmount, - qualityDeposit, warrantyPeriodId, contractStartDate, - contractEndDate, PerformanceId, remark, - purchaseId, status, biz_id, - dept_id, contract_audit_id, countersign_audit_id, - reject_reason, processDefId, processId, - firstparty, helpers, helpers_log, - performanceBond, supplyPlanStartDate, - supplyPlanEndDate, supplyActualStartDate, - supplyActualEndDate, warrantyDeposit, - settlement_amount) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{contractnumber,jdbcType=VARCHAR}, #{contractname,jdbcType=VARCHAR}, #{contractclassid,jdbcType=VARCHAR}, - #{contracttaxrateid,jdbcType=VARCHAR}, #{purchasemethodsid,jdbcType=VARCHAR}, #{channelsid,jdbcType=VARCHAR}, - #{supplierid,jdbcType=VARCHAR}, #{agentid,jdbcType=VARCHAR}, #{contractamount,jdbcType=DECIMAL}, - #{qualitydeposit,jdbcType=DECIMAL}, #{warrantyperiodid,jdbcType=VARCHAR}, #{contractstartdate,jdbcType=TIMESTAMP}, - #{contractenddate,jdbcType=TIMESTAMP}, #{performanceid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{purchaseid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, #{contractAuditId,jdbcType=VARCHAR}, #{countersignAuditId,jdbcType=VARCHAR}, - #{rejectReason,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{firstparty,jdbcType=VARCHAR}, #{helpers,jdbcType=VARCHAR}, #{helpersLog,jdbcType=VARCHAR}, - #{performancebond,jdbcType=DECIMAL}, #{supplyplanstartdate,jdbcType=TIMESTAMP}, - #{supplyplanenddate,jdbcType=TIMESTAMP}, #{supplyactualstartdate,jdbcType=TIMESTAMP}, - #{supplyactualenddate,jdbcType=TIMESTAMP}, #{warrantydeposit,jdbcType=DECIMAL}, - #{settlementAmount,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Contract - - - id, - - - insdt, - - - insuser, - - - contractNumber, - - - contractName, - - - contractClassId, - - - contractTaxRateId, - - - purchaseMethodsId, - - - channelsId, - - - supplierId, - - - agentId, - - - contractAmount, - - - qualityDeposit, - - - warrantyPeriodId, - - - contractStartDate, - - - contractEndDate, - - - PerformanceId, - - - remark, - - - purchaseId, - - - status, - - - biz_id, - - - dept_id, - - - contract_audit_id, - - - countersign_audit_id, - - - reject_reason, - - - processDefId, - - - processId, - - - firstparty, - - - helpers, - - - helpers_log, - - - performanceBond, - - - supplyPlanStartDate, - - - supplyPlanEndDate, - - - supplyActualStartDate, - - - supplyActualEndDate, - - - warrantyDeposit, - - - settlement_amount, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{contractnumber,jdbcType=VARCHAR}, - - - #{contractname,jdbcType=VARCHAR}, - - - #{contractclassid,jdbcType=VARCHAR}, - - - #{contracttaxrateid,jdbcType=VARCHAR}, - - - #{purchasemethodsid,jdbcType=VARCHAR}, - - - #{channelsid,jdbcType=VARCHAR}, - - - #{supplierid,jdbcType=VARCHAR}, - - - #{agentid,jdbcType=VARCHAR}, - - - #{contractamount,jdbcType=DECIMAL}, - - - #{qualitydeposit,jdbcType=DECIMAL}, - - - #{warrantyperiodid,jdbcType=VARCHAR}, - - - #{contractstartdate,jdbcType=TIMESTAMP}, - - - #{contractenddate,jdbcType=TIMESTAMP}, - - - #{performanceid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{purchaseid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{contractAuditId,jdbcType=VARCHAR}, - - - #{countersignAuditId,jdbcType=VARCHAR}, - - - #{rejectReason,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{firstparty,jdbcType=VARCHAR}, - - - #{helpers,jdbcType=VARCHAR}, - - - #{helpersLog,jdbcType=VARCHAR}, - - - #{performancebond,jdbcType=DECIMAL}, - - - #{supplyplanstartdate,jdbcType=TIMESTAMP}, - - - #{supplyplanenddate,jdbcType=TIMESTAMP}, - - - #{supplyactualstartdate,jdbcType=TIMESTAMP}, - - - #{supplyactualenddate,jdbcType=TIMESTAMP}, - - - #{warrantydeposit,jdbcType=DECIMAL}, - - - #{settlementAmount,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Contract - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - contractNumber = #{contractnumber,jdbcType=VARCHAR}, - - - contractName = #{contractname,jdbcType=VARCHAR}, - - - contractClassId = #{contractclassid,jdbcType=VARCHAR}, - - - contractTaxRateId = #{contracttaxrateid,jdbcType=VARCHAR}, - - - purchaseMethodsId = #{purchasemethodsid,jdbcType=VARCHAR}, - - - channelsId = #{channelsid,jdbcType=VARCHAR}, - - - supplierId = #{supplierid,jdbcType=VARCHAR}, - - - agentId = #{agentid,jdbcType=VARCHAR}, - - - contractAmount = #{contractamount,jdbcType=DECIMAL}, - - - qualityDeposit = #{qualitydeposit,jdbcType=DECIMAL}, - - - warrantyPeriodId = #{warrantyperiodid,jdbcType=VARCHAR}, - - - contractStartDate = #{contractstartdate,jdbcType=TIMESTAMP}, - - - contractEndDate = #{contractenddate,jdbcType=TIMESTAMP}, - - - PerformanceId = #{performanceid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - purchaseId = #{purchaseid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - contract_audit_id = #{contractAuditId,jdbcType=VARCHAR}, - - - countersign_audit_id = #{countersignAuditId,jdbcType=VARCHAR}, - - - reject_reason = #{rejectReason,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - firstparty = #{firstparty,jdbcType=VARCHAR}, - - - helpers = #{helpers,jdbcType=VARCHAR}, - - - helpers_log = #{helpersLog,jdbcType=VARCHAR}, - - - performanceBond = #{performancebond,jdbcType=DECIMAL}, - - - supplyPlanStartDate = #{supplyplanstartdate,jdbcType=TIMESTAMP}, - - - supplyPlanEndDate = #{supplyplanenddate,jdbcType=TIMESTAMP}, - - - supplyActualStartDate = #{supplyactualstartdate,jdbcType=TIMESTAMP}, - - - supplyActualEndDate = #{supplyactualenddate,jdbcType=TIMESTAMP}, - - - warrantyDeposit = #{warrantydeposit,jdbcType=DECIMAL}, - - - settlement_amount = #{settlementAmount,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Contract - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - contractNumber = #{contractnumber,jdbcType=VARCHAR}, - contractName = #{contractname,jdbcType=VARCHAR}, - contractClassId = #{contractclassid,jdbcType=VARCHAR}, - contractTaxRateId = #{contracttaxrateid,jdbcType=VARCHAR}, - purchaseMethodsId = #{purchasemethodsid,jdbcType=VARCHAR}, - channelsId = #{channelsid,jdbcType=VARCHAR}, - supplierId = #{supplierid,jdbcType=VARCHAR}, - agentId = #{agentid,jdbcType=VARCHAR}, - contractAmount = #{contractamount,jdbcType=DECIMAL}, - qualityDeposit = #{qualitydeposit,jdbcType=DECIMAL}, - warrantyPeriodId = #{warrantyperiodid,jdbcType=VARCHAR}, - contractStartDate = #{contractstartdate,jdbcType=TIMESTAMP}, - contractEndDate = #{contractenddate,jdbcType=TIMESTAMP}, - PerformanceId = #{performanceid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - purchaseId = #{purchaseid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - contract_audit_id = #{contractAuditId,jdbcType=VARCHAR}, - countersign_audit_id = #{countersignAuditId,jdbcType=VARCHAR}, - reject_reason = #{rejectReason,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - firstparty = #{firstparty,jdbcType=VARCHAR}, - helpers = #{helpers,jdbcType=VARCHAR}, - helpers_log = #{helpersLog,jdbcType=VARCHAR}, - performanceBond = #{performancebond,jdbcType=DECIMAL}, - supplyPlanStartDate = #{supplyplanstartdate,jdbcType=TIMESTAMP}, - supplyPlanEndDate = #{supplyplanenddate,jdbcType=TIMESTAMP}, - supplyActualStartDate = #{supplyactualstartdate,jdbcType=TIMESTAMP}, - supplyActualEndDate = #{supplyactualenddate,jdbcType=TIMESTAMP}, - warrantyDeposit = #{warrantydeposit,jdbcType=DECIMAL}, - settlement_amount = #{settlementAmount,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Contract - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ContractTaxRateMapper.xml b/src/com/sipai/mapper/sparepart/ContractTaxRateMapper.xml deleted file mode 100644 index 9332b8dd..00000000 --- a/src/com/sipai/mapper/sparepart/ContractTaxRateMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, taxRate, morder, active, pid, describe - - - - delete from TB_SparePart_ContractTaxRate - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ContractTaxRate (id, insdt, insuser, - taxRate, morder, active, - pid, describe) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{taxrate,jdbcType=DOUBLE}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=BIT}, - #{pid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ContractTaxRate - - - id, - - - insdt, - - - insuser, - - - taxRate, - - - morder, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{taxrate,jdbcType=DOUBLE}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ContractTaxRate - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - taxRate = #{taxrate,jdbcType=DOUBLE}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ContractTaxRate - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - taxRate = #{taxrate,jdbcType=DOUBLE}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ContractTaxRate - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/GoodsAcceptanceApplyDetailMapper.xml b/src/com/sipai/mapper/sparepart/GoodsAcceptanceApplyDetailMapper.xml deleted file mode 100644 index 47bf2478..00000000 --- a/src/com/sipai/mapper/sparepart/GoodsAcceptanceApplyDetailMapper.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, acceptance_apply_number, goods_id - - - - delete from TB_SparePart_Goods_AcceptanceApplyDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Goods_AcceptanceApplyDetail (id, insdt, insuser, - acceptance_apply_number, goods_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{acceptanceApplyNumber,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Goods_AcceptanceApplyDetail - - - id, - - - insdt, - - - insuser, - - - acceptance_apply_number, - - - goods_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{acceptanceApplyNumber,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Goods_AcceptanceApplyDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - acceptance_apply_number = #{acceptanceApplyNumber,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Goods_AcceptanceApplyDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - acceptance_apply_number = #{acceptanceApplyNumber,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete TB_SparePart_Goods_AcceptanceApplyDetail - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/GoodsApplyMapper.xml b/src/com/sipai/mapper/sparepart/GoodsApplyMapper.xml deleted file mode 100644 index 629a1fa8..00000000 --- a/src/com/sipai/mapper/sparepart/GoodsApplyMapper.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, brand, model, class_id, unit, remark, status, examineId, - examineDt, examineExplain, processDefId, processId - - - - delete from TB_SparePart_Goods_Apply - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Goods_Apply (id, insdt, insuser, - name, brand, model, - class_id, unit, remark, - status, examineId, examineDt, - examineExplain, processDefId, processId - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{brand,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, - #{classId,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{examineid,jdbcType=VARCHAR}, #{examinedt,jdbcType=TIMESTAMP}, - #{examineexplain,jdbcType=TIMESTAMP}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_Goods_Apply - - - id, - - - insdt, - - - insuser, - - - name, - - - brand, - - - model, - - - class_id, - - - unit, - - - remark, - - - status, - - - examineId, - - - examineDt, - - - examineExplain, - - - processDefId, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{brand,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{examineid,jdbcType=VARCHAR}, - - - #{examinedt,jdbcType=TIMESTAMP}, - - - #{examineexplain,jdbcType=TIMESTAMP}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Goods_Apply - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - brand = #{brand,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - examineId = #{examineid,jdbcType=VARCHAR}, - - - examineDt = #{examinedt,jdbcType=TIMESTAMP}, - - - examineExplain = #{examineexplain,jdbcType=TIMESTAMP}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Goods_Apply - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - brand = #{brand,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - examineId = #{examineid,jdbcType=VARCHAR}, - examineDt = #{examinedt,jdbcType=TIMESTAMP}, - examineExplain = #{examineexplain,jdbcType=TIMESTAMP}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Goods_Apply - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/GoodsClassMapper.xml b/src/com/sipai/mapper/sparepart/GoodsClassMapper.xml deleted file mode 100644 index 7f88f893..00000000 --- a/src/com/sipai/mapper/sparepart/GoodsClassMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, name, active, pid, describe, morder,goods_class_code - - - - delete from TB_SparePart_GoodsClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_GoodsClass (id, insdt, insuser, - name, active, pid, describe, - morder,goods_class_code) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{goodsClassCode,jdbcType=VARCHAR}) - - - insert into TB_SparePart_GoodsClass - - - id, - - - insdt, - - - insuser, - - - name, - - - active, - - - pid, - - - describe, - - - morder, - - - goods_class_code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{goodsClassCode,jdbcType=VARCHAR}, - - - - - update TB_SparePart_GoodsClass - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - goods_class_code = #{goodsClassCode,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_GoodsClass - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - goods_class_code = #{goodsClassCode,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_GoodsClass - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/GoodsMapper.xml b/src/com/sipai/mapper/sparepart/GoodsMapper.xml deleted file mode 100644 index 92d1e440..00000000 --- a/src/com/sipai/mapper/sparepart/GoodsMapper.xml +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, brand, model, class_id, unit, max_reserve, min_reserve, - remark, equipment_ids,number - - - - delete from TB_SparePart_Goods - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Goods (id, insdt, insuser, - name, brand, model, - class_id, unit, max_reserve, - min_reserve, remark, equipment_ids,number) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{brand,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, - #{classId,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{maxReserve,jdbcType=DOUBLE}, - #{minReserve,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{equipmentIds,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Goods - - - id, - - - insdt, - - - insuser, - - - name, - - - brand, - - - model, - - - class_id, - - - unit, - - - max_reserve, - - - min_reserve, - - - remark, - - - equipment_ids, - - - number, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{brand,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{maxReserve,jdbcType=DOUBLE}, - - - #{minReserve,jdbcType=DOUBLE}, - - - #{remark,jdbcType=VARCHAR}, - - - #{equipmentIds,jdbcType=VARCHAR}, - - - #{number,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Goods - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - brand = #{brand,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - max_reserve = #{maxReserve,jdbcType=DOUBLE}, - - - min_reserve = #{minReserve,jdbcType=DOUBLE}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - equipment_ids = #{equipmentIds,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Goods - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - brand = #{brand,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - max_reserve = #{maxReserve,jdbcType=DOUBLE}, - min_reserve = #{minReserve,jdbcType=DOUBLE}, - remark = #{remark,jdbcType=VARCHAR}, - equipment_ids = #{equipmentIds,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Goods - ${where} - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/GoodsReserveMapper.xml b/src/com/sipai/mapper/sparepart/GoodsReserveMapper.xml deleted file mode 100644 index 0c7a5dcd..00000000 --- a/src/com/sipai/mapper/sparepart/GoodsReserveMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, max, min, biz_id, pid, max_status, min_status - - - - delete from TB_SparePart_Goods_Reserve - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Goods_Reserve (id, max, min, biz_id, - pid, max_status, min_status - ) - values (#{id,jdbcType=VARCHAR}, #{max,jdbcType=BIGINT}, #{min,jdbcType=BIGINT}, #{bizId,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{maxStatus,jdbcType=INTEGER}, #{minStatus,jdbcType=INTEGER} - ) - - - insert into TB_SparePart_Goods_Reserve - - - id, - - - max, - - - min, - - - biz_id, - - - pid, - - - max_status, - - - min_status, - - - - - #{id,jdbcType=VARCHAR}, - - - #{max,jdbcType=BIGINT}, - - - #{min,jdbcType=BIGINT}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{maxStatus,jdbcType=INTEGER}, - - - #{minStatus,jdbcType=INTEGER}, - - - - - update TB_SparePart_Goods_Reserve - - - max = #{max,jdbcType=BIGINT}, - - - min = #{min,jdbcType=BIGINT}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - max_status = #{maxStatus,jdbcType=INTEGER}, - - - min_status = #{minStatus,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Goods_Reserve - set max = #{max,jdbcType=BIGINT}, - min = #{min,jdbcType=BIGINT}, - biz_id = #{bizId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - max_status = #{maxStatus,jdbcType=INTEGER}, - min_status = #{minStatus,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Goods_Reserve - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/HazardousChemicalsMapper.xml b/src/com/sipai/mapper/sparepart/HazardousChemicalsMapper.xml deleted file mode 100644 index 25b1e117..00000000 --- a/src/com/sipai/mapper/sparepart/HazardousChemicalsMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - pushId, clientId, type, operation, records - - - - delete from tb_mp_hazardous_chemicals - where pushId = #{pushid,jdbcType=VARCHAR} - - - insert into tb_mp_hazardous_chemicals (pushId, clientId, type, - operation, records) - values (#{pushid,jdbcType=VARCHAR}, #{clientid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{operation,jdbcType=VARCHAR}, #{records,jdbcType=VARCHAR}) - - - insert into tb_mp_hazardous_chemicals - - - pushId, - - - clientId, - - - type, - - - operation, - - - records, - - - - - #{pushid,jdbcType=VARCHAR}, - - - #{clientid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{operation,jdbcType=VARCHAR}, - - - #{records,jdbcType=VARCHAR}, - - - - - update tb_mp_hazardous_chemicals - - - clientId = #{clientid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - operation = #{operation,jdbcType=VARCHAR}, - - - records = #{records,jdbcType=VARCHAR}, - - - where pushId = #{pushid,jdbcType=VARCHAR} - - - update tb_mp_hazardous_chemicals - set clientId = #{clientid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - operation = #{operation,jdbcType=VARCHAR}, - records = #{records,jdbcType=VARCHAR} - where pushId = #{pushid,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/InOutDeatilMapper.xml b/src/com/sipai/mapper/sparepart/InOutDeatilMapper.xml deleted file mode 100644 index 33c3db66..00000000 --- a/src/com/sipai/mapper/sparepart/InOutDeatilMapper.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - id, inId, outId, num, insdt - - - - delete from tb_in_out_detail - where id = #{id,jdbcType=INTEGER} - - - insert into tb_in_out_detail (inId, outId, - num) - values (#{inid,jdbcType=VARCHAR}, #{outid,jdbcType=VARCHAR}, - #{num,jdbcType=DECIMAL}) - - - insert into tb_in_out_detail - - - inId, - - - outId, - - - num, - - - insdt, - - - - - #{inid,jdbcType=VARCHAR}, - - - #{outid,jdbcType=VARCHAR}, - - - #{num,jdbcType=DECIMAL}, - - - #{insdt}, - - - - - update tb_in_out_detail - - - inId = #{inid,jdbcType=VARCHAR}, - - - outId = #{outid,jdbcType=VARCHAR}, - - - num = #{num,jdbcType=DECIMAL}, - - - insdt = #{insdt}, - - - where id = #{id,jdbcType=INTEGER} - - - update tb_in_out_detail - set inId = #{inid,jdbcType=VARCHAR}, - outId = #{outid,jdbcType=VARCHAR}, - num = #{num,jdbcType=DECIMAL}, - insdt = #{insdt} - where id = #{id,jdbcType=INTEGER} - - - - - delete from tb_in_out_detail - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/InStockRecordDetailMapper.xml b/src/com/sipai/mapper/sparepart/InStockRecordDetailMapper.xml deleted file mode 100644 index 1f7d4e60..00000000 --- a/src/com/sipai/mapper/sparepart/InStockRecordDetailMapper.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, goods_id, instock_number, instock_record_id, price, supplier_id, - dept_id, total_money, include_taxrate_price, include_taxrate_total_money,purchase_record_detail_id,type, now_number - - - - delete from TB_SparePart_InStockRecordDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_InStockRecordDetail (id, insdt, insuser, - goods_id, instock_number, instock_record_id, - price, supplier_id, dept_id, - total_money, include_taxrate_price, include_taxrate_total_money, - purchase_record_detail_id,type, now_number) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{goodsId,jdbcType=VARCHAR}, #{instockNumber,jdbcType=DECIMAL}, #{instockRecordId,jdbcType=VARCHAR}, - #{price,jdbcType=DECIMAL}, #{supplierId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=DECIMAL}, #{includeTaxratePrice,jdbcType=DECIMAL}, #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - #{purchaseRecordDetailId,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{nowNumber}) - - - insert into TB_SparePart_InStockRecordDetail - - - id, - - - insdt, - - - insuser, - - - goods_id, - - - instock_number, - - - instock_record_id, - - - price, - - - supplier_id, - - - dept_id, - - - total_money, - - - include_taxrate_price, - - - include_taxrate_total_money, - - - purchase_record_detail_id, - - - type, - - - now_number, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{instockNumber,jdbcType=DECIMAL}, - - - #{instockRecordId,jdbcType=VARCHAR}, - - - #{price,jdbcType=DECIMAL}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{includeTaxratePrice,jdbcType=DECIMAL}, - - - #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - - - #{purchaseRecordDetailId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{nowNumber}, - - - - - update TB_SparePart_InStockRecordDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - instock_number = #{instockNumber,jdbcType=DECIMAL}, - - - instock_record_id = #{instockRecordId,jdbcType=VARCHAR}, - - - price = #{price,jdbcType=DECIMAL}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - include_taxrate_price = #{includeTaxratePrice,jdbcType=DECIMAL}, - - - include_taxrate_total_money = #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - - - type = #{type,jdbcType=VARCHAR}, - - - now_number = #{nowNumber}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_InStockRecordDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - instock_number = #{instockNumber,jdbcType=DECIMAL}, - instock_record_id = #{instockRecordId,jdbcType=VARCHAR}, - price = #{price,jdbcType=DECIMAL}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - include_taxrate_price = #{includeTaxratePrice,jdbcType=DECIMAL}, - include_taxrate_total_money = #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - purchase_record_detail_id = #{purchaseRecordDetailId,jdbcType=VARCHAR}, - now_number = #{nowNumber}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - TB_SparePart_InStockRecordDetail - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/InStockRecordMapper.xml b/src/com/sipai/mapper/sparepart/InStockRecordMapper.xml deleted file mode 100644 index e05f3496..00000000 --- a/src/com/sipai/mapper/sparepart/InStockRecordMapper.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, warehouse_id, goods_class_id, instock_man_id, audit_man_id, instock_date, - biz_id, total_money, status, remark, audit_opinion, taxrate, processDefId, processId, - bill_number, invoice_number, fare_adjustment, vat_invoice - - - - delete from TB_SparePart_InStockRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_InStockRecord (id, insdt, insuser, - warehouse_id, goods_class_id, instock_man_id, - audit_man_id, instock_date, biz_id, - total_money, status, remark, - audit_opinion, taxrate, processDefId, - processId, bill_number, invoice_number, fare_adjustment, vat_invoice - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{warehouseId,jdbcType=VARCHAR}, #{goodsClassId,jdbcType=VARCHAR}, #{instockManId,jdbcType=VARCHAR}, - #{auditManId,jdbcType=VARCHAR}, #{instockDate,jdbcType=TIMESTAMP}, #{bizId,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{auditOpinion,jdbcType=VARCHAR}, #{taxrate,jdbcType=DECIMAL}, #{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}, #{billNumber,jdbcType=VARCHAR}, #{invoiceNumber,jdbcType=VARCHAR}, - #{fareAdjustment}, #{vatInvoice} - ) - - - insert into TB_SparePart_InStockRecord - - - id, - - - insdt, - - - insuser, - - - warehouse_id, - - - goods_class_id, - - - instock_man_id, - - - audit_man_id, - - - instock_date, - - - biz_id, - - - total_money, - - - status, - - - remark, - - - audit_opinion, - - - taxrate, - - - processDefId, - - - processId, - - - bill_number, - - - invoice_number, - - - fare_adjustment, - - - vat_invoice, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{goodsClassId,jdbcType=VARCHAR}, - - - #{instockManId,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{instockDate,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{auditOpinion,jdbcType=VARCHAR}, - - - #{taxrate,jdbcType=DECIMAL}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{billNumber,jdbcType=VARCHAR}, - - - #{invoiceNumber,jdbcType=VARCHAR}, - - - #{fareAdjustment}, - - - #{vatInvoice}, - - - - - update TB_SparePart_InStockRecord - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - - - instock_man_id = #{instockManId,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - instock_date = #{instockDate,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - - - taxrate = #{taxrate,jdbcType=DECIMAL}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - bill_number = #{billNumber,jdbcType=VARCHAR}, - - - invoice_number = #{invoiceNumber,jdbcType=VARCHAR}, - - - fare_adjustment = #{fareAdjustment}, - - - vat_invoice = #{vatInvoice}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_InStockRecord - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - instock_man_id = #{instockManId,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - instock_date = #{instockDate,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - taxrate = #{taxrate,jdbcType=DECIMAL}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - bill_number = #{billNumber,jdbcType=VARCHAR}, - invoice_number = #{invoiceNumber,jdbcType=VARCHAR}, - fare_adjustment = #{fareAdjustment}, - vat_invoice = #{vatInvoice} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_InStockRecord - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/InStockRecordUpdateMoneyMapper.xml b/src/com/sipai/mapper/sparepart/InStockRecordUpdateMoneyMapper.xml deleted file mode 100644 index 8300438d..00000000 --- a/src/com/sipai/mapper/sparepart/InStockRecordUpdateMoneyMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - id, in_detail_id, status, insdt - - - - delete from tb_sparepart_instockRecord_updateMoney - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_sparepart_instockRecord_updateMoney (id, in_detail_id, status, insdt - ) - values (#{id,jdbcType=VARCHAR}, #{inDetailId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, - #{insdt,jdbcType=TIMESTAMP} - ) - - - insert into tb_sparepart_instockRecord_updateMoney - - - id, - - - in_detail_id, - - - status, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{inDetailId,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update tb_sparepart_instockRecord_updateMoney - - - in_detail_id = #{inDetailId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=INTEGER}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_sparepart_instockRecord_updateMoney - set in_detail_id = #{inDetailId,jdbcType=VARCHAR}, - status = #{status,jdbcType=INTEGER}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_sparepart_instockRecord_updateMoney - ${where} - - - diff --git a/src/com/sipai/mapper/sparepart/OutStockRecordDetailMapper.xml b/src/com/sipai/mapper/sparepart/OutStockRecordDetailMapper.xml deleted file mode 100644 index 7c3ecc61..00000000 --- a/src/com/sipai/mapper/sparepart/OutStockRecordDetailMapper.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, outstock_record_id, goods_id, out_number, price, total_money, - purpose, dept_id, stock_id, consume_number, included_tax_cost_price, included_tax_total_money - - - - delete from TB_SparePart_OutStockRecordDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_OutStockRecordDetail (id, insdt, insuser, - outstock_record_id, goods_id, out_number, - price, total_money, purpose, - dept_id, stock_id, consume_number, - included_tax_cost_price, included_tax_total_money - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{outstockRecordId,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{outNumber,jdbcType=DECIMAL}, - #{price,jdbcType=DECIMAL}, #{totalMoney,jdbcType=DECIMAL}, #{purpose,jdbcType=VARCHAR}, - #{deptId,jdbcType=VARCHAR}, #{stockId,jdbcType=VARCHAR}, #{consumeNumber,jdbcType=DECIMAL}, - #{includedTaxCostPrice,jdbcType=VARCHAR}, #{includedTaxTotalMoney,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_OutStockRecordDetail - - - id, - - - insdt, - - - insuser, - - - outstock_record_id, - - - goods_id, - - - out_number, - - - price, - - - total_money, - - - purpose, - - - dept_id, - - - stock_id, - - - consume_number, - - - included_tax_cost_price, - - - included_tax_total_money, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{outstockRecordId,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{outNumber,jdbcType=DECIMAL}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{purpose,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{stockId,jdbcType=VARCHAR}, - - - #{consumeNumber,jdbcType=DECIMAL}, - - - #{includedTaxCostPrice,jdbcType=VARCHAR}, - - - #{includedTaxTotalMoney,jdbcType=VARCHAR}, - - - - - update TB_SparePart_OutStockRecordDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - outstock_record_id = #{outstockRecordId,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - out_number = #{outNumber,jdbcType=DECIMAL}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - purpose = #{purpose,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - stock_id = #{stockId,jdbcType=VARCHAR}, - - - consume_number = #{consumeNumber,jdbcType=DECIMAL}, - - - included_tax_cost_price = #{includedTaxCostPrice,jdbcType=DECIMAL}, - - - included_tax_total_money = #{includedTaxTotalMoney,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_OutStockRecordDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - outstock_record_id = #{outstockRecordId,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - out_number = #{outNumber,jdbcType=DECIMAL}, - price = #{price,jdbcType=DECIMAL}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - purpose = #{purpose,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - stock_id = #{stockId,jdbcType=VARCHAR}, - consume_number = #{consumeNumber,jdbcType=DECIMAL}, - included_tax_cost_price = #{includedTaxCostPrice,jdbcType=DECIMAL}, - included_tax_total_money = #{includedTaxTotalMoney,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_SparePart_OutStockRecordDetail - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/OutStockRecordMapper.xml b/src/com/sipai/mapper/sparepart/OutStockRecordMapper.xml deleted file mode 100644 index d55c5138..00000000 --- a/src/com/sipai/mapper/sparepart/OutStockRecordMapper.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, warehouse_id, dept_id, user_id, audit_man_id, total_money, status, - remark, out_date, goods_class_id, warehouse_keeper_id, biz_id, audit_opinion, processDefId, - processId, stock_type, inhouse_id, bill_number - - - - delete from TB_SparePart_OutStockRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_OutStockRecord (id, insuser, insdt, - warehouse_id, dept_id, user_id, - audit_man_id, total_money, status, - remark, out_date, goods_class_id, - warehouse_keeper_id, biz_id, audit_opinion, - processDefId, processId, stock_type, - inhouse_id, bill_number) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{warehouseId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, - #{auditManId,jdbcType=VARCHAR}, #{totalMoney,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{outDate,jdbcType=TIMESTAMP}, #{goodsClassId,jdbcType=VARCHAR}, - #{warehouseKeeperId,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{auditOpinion,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{stockType,jdbcType=VARCHAR}, - #{inhouseId,jdbcType=VARCHAR}, #{billNumber,jdbcType=INTEGER}) - - - insert into TB_SparePart_OutStockRecord - - - id, - - - insuser, - - - insdt, - - - warehouse_id, - - - dept_id, - - - user_id, - - - audit_man_id, - - - total_money, - - - status, - - - remark, - - - out_date, - - - goods_class_id, - - - warehouse_keeper_id, - - - biz_id, - - - audit_opinion, - - - processDefId, - - - processId, - - - stock_type, - - - inhouse_id, - - - bill_number, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{outDate,jdbcType=TIMESTAMP}, - - - #{goodsClassId,jdbcType=VARCHAR}, - - - #{warehouseKeeperId,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{auditOpinion,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{stockType,jdbcType=VARCHAR}, - - - #{inhouseId,jdbcType=VARCHAR}, - - - #{billNumber,jdbcType=INTEGER}, - - - - - update TB_SparePart_OutStockRecord - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - out_date = #{outDate,jdbcType=TIMESTAMP}, - - - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - - - warehouse_keeper_id = #{warehouseKeeperId,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - stock_type = #{stockType,jdbcType=VARCHAR}, - - - inhouse_id = #{inhouseId,jdbcType=VARCHAR}, - - - bill_number = #{billNumber,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_OutStockRecord - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - user_id = #{userId,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - out_date = #{outDate,jdbcType=TIMESTAMP}, - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - warehouse_keeper_id = #{warehouseKeeperId,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - stock_type = #{stockType,jdbcType=VARCHAR}, - inhouse_id = #{inhouseId,jdbcType=VARCHAR}, - bill_number = #{billNumber,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_OutStockRecord - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/PerformanceMapper.xml b/src/com/sipai/mapper/sparepart/PerformanceMapper.xml deleted file mode 100644 index c4521292..00000000 --- a/src/com/sipai/mapper/sparepart/PerformanceMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, name, morder, active, pid, describe - - - - delete from TB_SparePart_Performance - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Performance (id, insdt, insuser, - name, morder, active, pid, - describe) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, - #{describe,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Performance - - - id, - - - insdt, - - - insuser, - - - name, - - - morder, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Performance - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Performance - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Performance - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/PurchaseDetailMapper.xml b/src/com/sipai/mapper/sparepart/PurchaseDetailMapper.xml deleted file mode 100644 index 3bf30f93..00000000 --- a/src/com/sipai/mapper/sparepart/PurchaseDetailMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, goods_id, supplier_id, number, price, total_money, department_id, - purpose, remark - - - - delete from TB_SparePart_PurchaseDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_PurchaseDetail (id, insdt, insuser, - pid, goods_id, supplier_id, - number, price, total_money, - department_id, purpose, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{supplierId,jdbcType=VARCHAR}, - #{number,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, #{totalMoney,jdbcType=DECIMAL}, - #{departmentId,jdbcType=VARCHAR}, #{purpose,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_PurchaseDetail - - - id, - - - insdt, - - - insuser, - - - pid, - - - goods_id, - - - supplier_id, - - - number, - - - price, - - - total_money, - - - department_id, - - - purpose, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{number,jdbcType=DECIMAL}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{departmentId,jdbcType=VARCHAR}, - - - #{purpose,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_SparePart_PurchaseDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=DECIMAL}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - department_id = #{departmentId,jdbcType=VARCHAR}, - - - purpose = #{purpose,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_PurchaseDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - number = #{number,jdbcType=DECIMAL}, - price = #{price,jdbcType=DECIMAL}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - department_id = #{departmentId,jdbcType=VARCHAR}, - purpose = #{purpose,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_PurchaseDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/PurchaseMethodsMapper.xml b/src/com/sipai/mapper/sparepart/PurchaseMethodsMapper.xml deleted file mode 100644 index 9d1616e7..00000000 --- a/src/com/sipai/mapper/sparepart/PurchaseMethodsMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, name, morder, active, pid, describe - - - - delete from TB_SparePart_PurchaseMethods - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_PurchaseMethods (id, insdt, insuser, - name, morder, active, pid, - describe) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, - #{describe,jdbcType=VARCHAR}) - - - insert into TB_SparePart_PurchaseMethods - - - id, - - - insdt, - - - insuser, - - - name, - - - morder, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_PurchaseMethods - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_PurchaseMethods - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_PurchaseMethods - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/PurchasePlanMapper.xml b/src/com/sipai/mapper/sparepart/PurchasePlanMapper.xml deleted file mode 100644 index 9ac0d7e5..00000000 --- a/src/com/sipai/mapper/sparepart/PurchasePlanMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, biz_id, applicant, plan_purchase_date, department_id, total_money, - check_man, type, status, check_opinion, remark - - - - delete from TB_SparePart_PurchasePlan - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_PurchasePlan (id, insdt, insuser, - pid, biz_id, applicant, - plan_purchase_date, department_id, total_money, - check_man, type, status, - check_opinion, remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{applicant,jdbcType=VARCHAR}, - #{planPurchaseDate,jdbcType=TIMESTAMP}, #{departmentId,jdbcType=VARCHAR}, #{totalMoney,jdbcType=DECIMAL}, - #{checkMan,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{checkOpinion,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}) - - - insert into TB_SparePart_PurchasePlan - - - id, - - - insdt, - - - insuser, - - - pid, - - - biz_id, - - - applicant, - - - plan_purchase_date, - - - department_id, - - - total_money, - - - check_man, - - - type, - - - status, - - - check_opinion, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{applicant,jdbcType=VARCHAR}, - - - #{planPurchaseDate,jdbcType=TIMESTAMP}, - - - #{departmentId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{checkMan,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{checkOpinion,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_SparePart_PurchasePlan - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - applicant = #{applicant,jdbcType=VARCHAR}, - - - plan_purchase_date = #{planPurchaseDate,jdbcType=TIMESTAMP}, - - - department_id = #{departmentId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - check_man = #{checkMan,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - check_opinion = #{checkOpinion,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_PurchasePlan - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - applicant = #{applicant,jdbcType=VARCHAR}, - plan_purchase_date = #{planPurchaseDate,jdbcType=TIMESTAMP}, - department_id = #{departmentId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - check_man = #{checkMan,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - check_opinion = #{checkOpinion,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_PurchasePlan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/PurchaseRecordDetailMapper.xml b/src/com/sipai/mapper/sparepart/PurchaseRecordDetailMapper.xml deleted file mode 100644 index 8dd6552e..00000000 --- a/src/com/sipai/mapper/sparepart/PurchaseRecordDetailMapper.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, goods_id, supplier_id, number, price, total_money, dept_id, purpose, - record_id, subscribe_detail_id, remark - - - - delete from TB_SparePart_PurchaseRecordDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_PurchaseRecordDetail (id, insdt, insuser, - goods_id, supplier_id, number, - price, total_money, dept_id, - purpose, record_id, subscribe_detail_id, - remark) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{goodsId,jdbcType=VARCHAR}, #{supplierId,jdbcType=VARCHAR}, #{number,jdbcType=DECIMAL}, - #{price,jdbcType=DECIMAL}, #{totalMoney,jdbcType=DECIMAL}, #{deptId,jdbcType=VARCHAR}, - #{purpose,jdbcType=VARCHAR}, #{recordId,jdbcType=VARCHAR}, #{subscribeDetailId,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}) - - - insert into TB_SparePart_PurchaseRecordDetail - - - id, - - - insdt, - - - insuser, - - - goods_id, - - - supplier_id, - - - number, - - - price, - - - total_money, - - - dept_id, - - - purpose, - - - record_id, - - - subscribe_detail_id, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{number,jdbcType=DECIMAL}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{purpose,jdbcType=VARCHAR}, - - - #{recordId,jdbcType=VARCHAR}, - - - #{subscribeDetailId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_SparePart_PurchaseRecordDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=DECIMAL}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - purpose = #{purpose,jdbcType=VARCHAR}, - - - record_id = #{recordId,jdbcType=VARCHAR}, - - - subscribe_detail_id = #{subscribeDetailId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_PurchaseRecordDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - number = #{number,jdbcType=DECIMAL}, - price = #{price,jdbcType=DECIMAL}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - dept_id = #{deptId,jdbcType=VARCHAR}, - purpose = #{purpose,jdbcType=VARCHAR}, - record_id = #{recordId,jdbcType=VARCHAR}, - subscribe_detail_id = #{subscribeDetailId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_SparePart_PurchaseRecordDetail - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/PurchaseRecordMapper.xml b/src/com/sipai/mapper/sparepart/PurchaseRecordMapper.xml deleted file mode 100644 index b9c0f188..00000000 --- a/src/com/sipai/mapper/sparepart/PurchaseRecordMapper.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, purchase_man_id, purchase_date, total_money, audit_man_id, - status, remark, sUserId, sendMessageType - - - - delete from TB_SparePart_PurchaseRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_PurchaseRecord (id, insdt, insuser, - biz_id, purchase_man_id, purchase_date, - total_money, audit_man_id, status, remark, sUserId, sendMessageType - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{purchaseManId,jdbcType=VARCHAR}, #{purchaseDate,jdbcType=TIMESTAMP}, - #{totalMoney,jdbcType=DECIMAL}, #{auditManId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{sUserId,jdbcType=VARCHAR},#{sendMessageType} - ) - - - insert into TB_SparePart_PurchaseRecord - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - purchase_man_id, - - - purchase_date, - - - total_money, - - - audit_man_id, - - - status, - - - remark, - - - sUserId, - - - sendMessageType, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{purchaseManId,jdbcType=VARCHAR}, - - - #{purchaseDate,jdbcType=TIMESTAMP}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{sUserId,jdbcType=VARCHAR}, - - - #{sendMessageType}, - - - - - update TB_SparePart_PurchaseRecord - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - purchase_man_id = #{purchaseManId,jdbcType=VARCHAR}, - - - purchase_date = #{purchaseDate,jdbcType=TIMESTAMP}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - sUserId = #{sUserId,jdbcType=VARCHAR}, - - - sendMessageType = #{sendMessageType}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_PurchaseRecord - set insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - purchase_man_id = #{purchaseManId,jdbcType=VARCHAR}, - purchase_date = #{purchaseDate,jdbcType=TIMESTAMP}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - sUserId = #{sUserId,jdbcType=VARCHAR}, - sendMessageType = #{sendMessageType} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_PurchaseRecord - ${where} - - - diff --git a/src/com/sipai/mapper/sparepart/PurposeMapper.xml b/src/com/sipai/mapper/sparepart/PurposeMapper.xml deleted file mode 100644 index b9f8e817..00000000 --- a/src/com/sipai/mapper/sparepart/PurposeMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, status, pid, remark, name - - - - delete from TB_SparePart_Purpose - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Purpose (id, insdt, insuser, - biz_id, status, pid, - remark, name) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Purpose - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - status, - - - pid, - - - remark, - - - name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Purpose - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Purpose - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Purpose - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/QualificationTypeMapper.xml b/src/com/sipai/mapper/sparepart/QualificationTypeMapper.xml deleted file mode 100644 index d17ee5c4..00000000 --- a/src/com/sipai/mapper/sparepart/QualificationTypeMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - id, insdt, insuser, type_name - - - - delete from TB_SparePart_QualificationType - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_QualificationType (id, insdt, insuser, - type_name) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{typeName,jdbcType=VARCHAR}) - - - insert into TB_SparePart_QualificationType - - - id, - - - insdt, - - - insuser, - - - type_name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{typeName,jdbcType=VARCHAR}, - - - - - update TB_SparePart_QualificationType - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - type_name = #{typeName,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_QualificationType - set insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - type_name = #{typeName,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_QualificationType - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/QualificationType_copyMapper.xml b/src/com/sipai/mapper/sparepart/QualificationType_copyMapper.xml deleted file mode 100644 index 74917012..00000000 --- a/src/com/sipai/mapper/sparepart/QualificationType_copyMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - id, insdt, insuser, type_name - - - - delete from TB_SparePart_QualificationType_copy - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_QualificationType_copy (id, insdt, insuser, - type_name) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{typeName,jdbcType=VARCHAR}) - - - insert into TB_SparePart_QualificationType_copy - - - id, - - - insdt, - - - insuser, - - - type_name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{typeName,jdbcType=VARCHAR}, - - - - - update TB_SparePart_QualificationType_copy - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - type_name = #{typeName,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_QualificationType_copy - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - type_name = #{typeName,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_QualificationType_copy - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/RawMaterialDetailMapper.xml b/src/com/sipai/mapper/sparepart/RawMaterialDetailMapper.xml deleted file mode 100644 index 953bbf7d..00000000 --- a/src/com/sipai/mapper/sparepart/RawMaterialDetailMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, goods_id, rawmaterial_number, rawmaterial_id, price, supplier_id, - dept_id, total_money, include_taxrate_price, include_taxrate_total_money, type, tax_amount - - - - delete from TB_SparePart_RawMaterialDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_RawMaterialDetail (id, insdt, insuser, - goods_id, rawmaterial_number, rawmaterial_id, - price, supplier_id, dept_id, - total_money, include_taxrate_price, include_taxrate_total_money, - type, tax_amount) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{goodsId,jdbcType=VARCHAR}, #{rawmaterialNumber,jdbcType=DECIMAL}, #{rawmaterialId,jdbcType=VARCHAR}, - #{price,jdbcType=DECIMAL}, #{supplierId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=DECIMAL}, #{includeTaxratePrice,jdbcType=DECIMAL}, #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - #{type,jdbcType=VARCHAR}, #{taxAmount,jdbcType=DECIMAL}) - - - insert into TB_SparePart_RawMaterialDetail - - - id, - - - insdt, - - - insuser, - - - goods_id, - - - rawmaterial_number, - - - rawmaterial_id, - - - price, - - - supplier_id, - - - dept_id, - - - total_money, - - - include_taxrate_price, - - - include_taxrate_total_money, - - - type, - - - tax_amount, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{rawmaterialNumber,jdbcType=DECIMAL}, - - - #{rawmaterialId,jdbcType=VARCHAR}, - - - #{price,jdbcType=DECIMAL}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{includeTaxratePrice,jdbcType=DECIMAL}, - - - #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - - - #{type,jdbcType=VARCHAR}, - - - #{taxAmount,jdbcType=DECIMAL}, - - - - - update TB_SparePart_RawMaterialDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - rawmaterial_number = #{rawmaterialNumber,jdbcType=DECIMAL}, - - - rawmaterial_id = #{rawmaterialId,jdbcType=VARCHAR}, - - - price = #{price,jdbcType=DECIMAL}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - include_taxrate_price = #{includeTaxratePrice,jdbcType=DECIMAL}, - - - include_taxrate_total_money = #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - - - type = #{type,jdbcType=VARCHAR}, - - - tax_amount = #{taxAmount,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_RawMaterialDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - rawmaterial_number = #{rawmaterialNumber,jdbcType=DECIMAL}, - rawmaterial_id = #{rawmaterialId,jdbcType=VARCHAR}, - price = #{price,jdbcType=DECIMAL}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - include_taxrate_price = #{includeTaxratePrice,jdbcType=DECIMAL}, - include_taxrate_total_money = #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - type = #{type,jdbcType=VARCHAR}, - tax_amount = #{taxAmount,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_RawMaterialDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/RawMaterialMapper.xml b/src/com/sipai/mapper/sparepart/RawMaterialMapper.xml deleted file mode 100644 index 2e56f1c2..00000000 --- a/src/com/sipai/mapper/sparepart/RawMaterialMapper.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, goods_class_id, register_man_id, audit_man_id, register_date, - acceptance_results, sampling, biz_id, status, remark, audit_opinion, processDefId, - processId, name, plan_spot_check_complete_time - - - - delete from TB_SparePart_RawMaterial - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_RawMaterial (id, insdt, insuser, - goods_class_id, register_man_id, audit_man_id, - register_date, acceptance_results, sampling, - biz_id, status, remark, - audit_opinion, processDefId, processId, - name, plan_spot_check_complete_time) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{goodsClassId,jdbcType=VARCHAR}, #{registerManId,jdbcType=VARCHAR}, #{auditManId,jdbcType=VARCHAR}, - #{registerDate,jdbcType=TIMESTAMP}, #{acceptanceResults,jdbcType=VARCHAR}, #{sampling,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{auditOpinion,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{planSpotCheckCompleteTime,jdbcType=TIMESTAMP}) - - - insert into TB_SparePart_RawMaterial - - - id, - - - insdt, - - - insuser, - - - goods_class_id, - - - register_man_id, - - - audit_man_id, - - - register_date, - - - acceptance_results, - - - sampling, - - - biz_id, - - - status, - - - remark, - - - audit_opinion, - - - processDefId, - - - processId, - - - name, - - - plan_spot_check_complete_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{goodsClassId,jdbcType=VARCHAR}, - - - #{registerManId,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{registerDate,jdbcType=TIMESTAMP}, - - - #{acceptanceResults,jdbcType=VARCHAR}, - - - #{sampling,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{auditOpinion,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{planSpotCheckCompleteTime,jdbcType=TIMESTAMP}, - - - - - update TB_SparePart_RawMaterial - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - - - register_man_id = #{registerManId,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - register_date = #{registerDate,jdbcType=TIMESTAMP}, - - - acceptance_results = #{acceptanceResults,jdbcType=VARCHAR}, - - - sampling = #{sampling,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - plan_spot_check_complete_time = #{planSpotCheckCompleteTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_RawMaterial - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - register_man_id = #{registerManId,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - register_date = #{registerDate,jdbcType=TIMESTAMP}, - acceptance_results = #{acceptanceResults,jdbcType=VARCHAR}, - sampling = #{sampling,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - plan_spot_check_complete_time = #{planSpotCheckCompleteTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_RawMaterial - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ReturnStockRecordDetailMapper.xml b/src/com/sipai/mapper/sparepart/ReturnStockRecordDetailMapper.xml deleted file mode 100644 index eb97465c..00000000 --- a/src/com/sipai/mapper/sparepart/ReturnStockRecordDetailMapper.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, goods_id, instock_number, instock_record_id, price, supplier_id, - dept_id, total_money, include_taxrate_price, include_taxrate_total_money,purchase_record_detail_id,type - - - - delete from TB_SparePart_ReturnStockRecordDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ReturnStockRecordDetail (id, insdt, insuser, - goods_id, instock_number, instock_record_id, - price, supplier_id, dept_id, - total_money, include_taxrate_price, include_taxrate_total_money, - purchase_record_detail_id,type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{goodsId,jdbcType=VARCHAR}, #{instockNumber,jdbcType=DECIMAL}, #{instockRecordId,jdbcType=VARCHAR}, - #{price,jdbcType=DECIMAL}, #{supplierId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=DECIMAL}, #{includeTaxratePrice,jdbcType=DECIMAL}, #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - #{purchaseRecordDetailId,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ReturnStockRecordDetail - - - id, - - - insdt, - - - insuser, - - - goods_id, - - - instock_number, - - - instock_record_id, - - - price, - - - supplier_id, - - - dept_id, - - - total_money, - - - include_taxrate_price, - - - include_taxrate_total_money, - - - purchase_record_detail_id, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{instockNumber,jdbcType=DECIMAL}, - - - #{instockRecordId,jdbcType=VARCHAR}, - - - #{price,jdbcType=DECIMAL}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{includeTaxratePrice,jdbcType=DECIMAL}, - - - #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - - - #{purchaseRecordDetailId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ReturnStockRecordDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - instock_number = #{instockNumber,jdbcType=DECIMAL}, - - - instock_record_id = #{instockRecordId,jdbcType=VARCHAR}, - - - price = #{price,jdbcType=DECIMAL}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - include_taxrate_price = #{includeTaxratePrice,jdbcType=DECIMAL}, - - - include_taxrate_total_money = #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ReturnStockRecordDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - instock_number = #{instockNumber,jdbcType=DECIMAL}, - instock_record_id = #{instockRecordId,jdbcType=VARCHAR}, - price = #{price,jdbcType=DECIMAL}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - include_taxrate_price = #{includeTaxratePrice,jdbcType=DECIMAL}, - include_taxrate_total_money = #{includeTaxrateTotalMoney,jdbcType=DECIMAL}, - purchase_record_detail_id = #{purchaseRecordDetailId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ReturnStockRecordDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ReturnStockRecordMapper.xml b/src/com/sipai/mapper/sparepart/ReturnStockRecordMapper.xml deleted file mode 100644 index c6761d03..00000000 --- a/src/com/sipai/mapper/sparepart/ReturnStockRecordMapper.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, warehouse_id, goods_class_id, instock_man_id, audit_man_id, instock_date, - biz_id, total_money, status, remark, audit_opinion, taxrate, processDefId, processId - - - - delete from TB_SparePart_ReturnStockRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_ReturnStockRecord (id, insdt, insuser, - warehouse_id, goods_class_id, instock_man_id, - audit_man_id, instock_date, biz_id, - total_money, status, remark, - audit_opinion, taxrate, processDefId, - processId) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{warehouseId,jdbcType=VARCHAR}, #{goodsClassId,jdbcType=VARCHAR}, #{instockManId,jdbcType=VARCHAR}, - #{auditManId,jdbcType=VARCHAR}, #{instockDate,jdbcType=TIMESTAMP}, #{bizId,jdbcType=VARCHAR}, - #{totalMoney,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{auditOpinion,jdbcType=VARCHAR}, #{taxrate,jdbcType=DECIMAL}, #{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}) - - - insert into TB_SparePart_ReturnStockRecord - - - id, - - - insdt, - - - insuser, - - - warehouse_id, - - - goods_class_id, - - - instock_man_id, - - - audit_man_id, - - - instock_date, - - - biz_id, - - - total_money, - - - status, - - - remark, - - - audit_opinion, - - - taxrate, - - - processDefId, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{goodsClassId,jdbcType=VARCHAR}, - - - #{instockManId,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{instockDate,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{auditOpinion,jdbcType=VARCHAR}, - - - #{taxrate,jdbcType=DECIMAL}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update TB_SparePart_ReturnStockRecord - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - - - instock_man_id = #{instockManId,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - instock_date = #{instockDate,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - - - taxrate = #{taxrate,jdbcType=DECIMAL}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_ReturnStockRecord - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - goods_class_id = #{goodsClassId,jdbcType=VARCHAR}, - instock_man_id = #{instockManId,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - instock_date = #{instockDate,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, - taxrate = #{taxrate,jdbcType=DECIMAL}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_ReturnStockRecord - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/ScoreMapper.xml b/src/com/sipai/mapper/sparepart/ScoreMapper.xml deleted file mode 100644 index 853f329d..00000000 --- a/src/com/sipai/mapper/sparepart/ScoreMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, total, user_id, price_score, quality_score, delivery_time_score, service_level_score, - credit_score, matching_score, supplier_id, creation_time, years - - - - delete from TB_SparePart_Score - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Score (id, total, user_id, - price_score, quality_score, delivery_time_score, - service_level_score, credit_score, matching_score, - supplier_id, creation_time, years - ) - values (#{id,jdbcType=VARCHAR}, #{total,jdbcType=DOUBLE}, #{userId,jdbcType=VARCHAR}, - #{priceScore,jdbcType=DOUBLE}, #{qualityScore,jdbcType=DOUBLE}, #{deliveryTimeScore,jdbcType=DOUBLE}, - #{serviceLevelScore,jdbcType=DOUBLE}, #{creditScore,jdbcType=DOUBLE}, #{matchingScore,jdbcType=DOUBLE}, - #{supplierId,jdbcType=VARCHAR}, #{creationTime,jdbcType=TIMESTAMP}, #{years,jdbcType=TIMESTAMP} - ) - - - insert into TB_SparePart_Score - - - id, - - - total, - - - user_id, - - - price_score, - - - quality_score, - - - delivery_time_score, - - - service_level_score, - - - credit_score, - - - matching_score, - - - supplier_id, - - - creation_time, - - - years, - - - - - #{id,jdbcType=VARCHAR}, - - - #{total,jdbcType=DOUBLE}, - - - #{userId,jdbcType=VARCHAR}, - - - #{priceScore,jdbcType=DOUBLE}, - - - #{qualityScore,jdbcType=DOUBLE}, - - - #{deliveryTimeScore,jdbcType=DOUBLE}, - - - #{serviceLevelScore,jdbcType=DOUBLE}, - - - #{creditScore,jdbcType=DOUBLE}, - - - #{matchingScore,jdbcType=DOUBLE}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{creationTime,jdbcType=TIMESTAMP}, - - - #{years,jdbcType=TIMESTAMP}, - - - - - update TB_SparePart_Score - - - total = #{total,jdbcType=DOUBLE}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - price_score = #{priceScore,jdbcType=DOUBLE}, - - - quality_score = #{qualityScore,jdbcType=DOUBLE}, - - - delivery_time_score = #{deliveryTimeScore,jdbcType=DOUBLE}, - - - service_level_score = #{serviceLevelScore,jdbcType=DOUBLE}, - - - credit_score = #{creditScore,jdbcType=DOUBLE}, - - - matching_score = #{matchingScore,jdbcType=DOUBLE}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - creation_time = #{creationTime,jdbcType=TIMESTAMP}, - - - years = #{years,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Score - set total = #{total,jdbcType=DOUBLE}, - user_id = #{userId,jdbcType=VARCHAR}, - price_score = #{priceScore,jdbcType=DOUBLE}, - quality_score = #{qualityScore,jdbcType=DOUBLE}, - delivery_time_score = #{deliveryTimeScore,jdbcType=DOUBLE}, - service_level_score = #{serviceLevelScore,jdbcType=DOUBLE}, - credit_score = #{creditScore,jdbcType=DOUBLE}, - matching_score = #{matchingScore,jdbcType=DOUBLE}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - creation_time = #{creationTime,jdbcType=TIMESTAMP}, - years = #{years,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Score - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/Score_copyMapper.xml b/src/com/sipai/mapper/sparepart/Score_copyMapper.xml deleted file mode 100644 index a9cf2e0f..00000000 --- a/src/com/sipai/mapper/sparepart/Score_copyMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, total, user_id, price_score, quality_score, delivery_time_score, service_level_score, - credit_score, matching_score, supplier_id, creation_time, years - - - - delete from TB_SparePart_Score_copy - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Score_copy (id, total, user_id, - price_score, quality_score, delivery_time_score, - service_level_score, credit_score, matching_score, - supplier_id, creation_time, years - ) - values (#{id,jdbcType=VARCHAR}, #{total,jdbcType=DOUBLE}, #{userId,jdbcType=VARCHAR}, - #{priceScore,jdbcType=DOUBLE}, #{qualityScore,jdbcType=DOUBLE}, #{deliveryTimeScore,jdbcType=DOUBLE}, - #{serviceLevelScore,jdbcType=DOUBLE}, #{creditScore,jdbcType=DOUBLE}, #{matchingScore,jdbcType=DOUBLE}, - #{supplierId,jdbcType=VARCHAR}, #{creationTime,jdbcType=TIMESTAMP}, #{years,jdbcType=TIMESTAMP} - ) - - - insert into TB_SparePart_Score_copy - - - id, - - - total, - - - user_id, - - - price_score, - - - quality_score, - - - delivery_time_score, - - - service_level_score, - - - credit_score, - - - matching_score, - - - supplier_id, - - - creation_time, - - - years, - - - - - #{id,jdbcType=VARCHAR}, - - - #{total,jdbcType=DOUBLE}, - - - #{userId,jdbcType=VARCHAR}, - - - #{priceScore,jdbcType=DOUBLE}, - - - #{qualityScore,jdbcType=DOUBLE}, - - - #{deliveryTimeScore,jdbcType=DOUBLE}, - - - #{serviceLevelScore,jdbcType=DOUBLE}, - - - #{creditScore,jdbcType=DOUBLE}, - - - #{matchingScore,jdbcType=DOUBLE}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{creationTime,jdbcType=TIMESTAMP}, - - - #{years,jdbcType=TIMESTAMP}, - - - - - update TB_SparePart_Score_copy - - - total = #{total,jdbcType=DOUBLE}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - price_score = #{priceScore,jdbcType=DOUBLE}, - - - quality_score = #{qualityScore,jdbcType=DOUBLE}, - - - delivery_time_score = #{deliveryTimeScore,jdbcType=DOUBLE}, - - - service_level_score = #{serviceLevelScore,jdbcType=DOUBLE}, - - - credit_score = #{creditScore,jdbcType=DOUBLE}, - - - matching_score = #{matchingScore,jdbcType=DOUBLE}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - creation_time = #{creationTime,jdbcType=TIMESTAMP}, - - - years = #{years,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Score_copy - set total = #{total,jdbcType=DOUBLE}, - user_id = #{userId,jdbcType=VARCHAR}, - price_score = #{priceScore,jdbcType=DOUBLE}, - quality_score = #{qualityScore,jdbcType=DOUBLE}, - delivery_time_score = #{deliveryTimeScore,jdbcType=DOUBLE}, - service_level_score = #{serviceLevelScore,jdbcType=DOUBLE}, - credit_score = #{creditScore,jdbcType=DOUBLE}, - matching_score = #{matchingScore,jdbcType=DOUBLE}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - creation_time = #{creationTime,jdbcType=TIMESTAMP}, - years = #{years,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Score_copy - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SewageInputMapper.xml b/src/com/sipai/mapper/sparepart/SewageInputMapper.xml deleted file mode 100644 index 808a3300..00000000 --- a/src/com/sipai/mapper/sparepart/SewageInputMapper.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, sewage_id, input_cod, input_ph, input_ammonia_nitrogen, input_phosphorus, - input_nitrogen, remarks, input_dt, input_ss, input_bod, input_chroma, input_userid - - - - delete from TB_Sewage_Input - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Sewage_Input (id, insdt, insuser, - sewage_id, input_cod, input_ph, - input_ammonia_nitrogen, input_phosphorus, - input_nitrogen, remarks, input_dt, - input_ss, input_bod, input_chroma, - input_userid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{sewageId,jdbcType=VARCHAR}, #{inputCod,jdbcType=VARCHAR}, #{inputPh,jdbcType=VARCHAR}, - #{inputAmmoniaNitrogen,jdbcType=VARCHAR}, #{inputPhosphorus,jdbcType=VARCHAR}, - #{inputNitrogen,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{inputDt,jdbcType=TIMESTAMP}, - #{inputSs,jdbcType=VARCHAR}, #{inputBod,jdbcType=VARCHAR}, #{inputChroma,jdbcType=VARCHAR}, - #{inputUserid,jdbcType=VARCHAR}) - - - insert into TB_Sewage_Input - - - id, - - - insdt, - - - insuser, - - - sewage_id, - - - input_cod, - - - input_ph, - - - input_ammonia_nitrogen, - - - input_phosphorus, - - - input_nitrogen, - - - remarks, - - - input_dt, - - - input_ss, - - - input_bod, - - - input_chroma, - - - input_userid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{sewageId,jdbcType=VARCHAR}, - - - #{inputCod,jdbcType=VARCHAR}, - - - #{inputPh,jdbcType=VARCHAR}, - - - #{inputAmmoniaNitrogen,jdbcType=VARCHAR}, - - - #{inputPhosphorus,jdbcType=VARCHAR}, - - - #{inputNitrogen,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{inputDt,jdbcType=TIMESTAMP}, - - - #{inputSs,jdbcType=VARCHAR}, - - - #{inputBod,jdbcType=VARCHAR}, - - - #{inputChroma,jdbcType=VARCHAR}, - - - #{inputUserid,jdbcType=VARCHAR}, - - - - - update TB_Sewage_Input - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - sewage_id = #{sewageId,jdbcType=VARCHAR}, - - - input_cod = #{inputCod,jdbcType=VARCHAR}, - - - input_ph = #{inputPh,jdbcType=VARCHAR}, - - - input_ammonia_nitrogen = #{inputAmmoniaNitrogen,jdbcType=VARCHAR}, - - - input_phosphorus = #{inputPhosphorus,jdbcType=VARCHAR}, - - - input_nitrogen = #{inputNitrogen,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - input_dt = #{inputDt,jdbcType=TIMESTAMP}, - - - input_ss = #{inputSs,jdbcType=VARCHAR}, - - - input_bod = #{inputBod,jdbcType=VARCHAR}, - - - input_chroma = #{inputChroma,jdbcType=VARCHAR}, - - - input_userid = #{inputUserid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Sewage_Input - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - sewage_id = #{sewageId,jdbcType=VARCHAR}, - input_cod = #{inputCod,jdbcType=VARCHAR}, - input_ph = #{inputPh,jdbcType=VARCHAR}, - input_ammonia_nitrogen = #{inputAmmoniaNitrogen,jdbcType=VARCHAR}, - input_phosphorus = #{inputPhosphorus,jdbcType=VARCHAR}, - input_nitrogen = #{inputNitrogen,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - input_dt = #{inputDt,jdbcType=TIMESTAMP}, - input_ss = #{inputSs,jdbcType=VARCHAR}, - input_bod = #{inputBod,jdbcType=VARCHAR}, - input_chroma = #{inputChroma,jdbcType=VARCHAR}, - input_userid = #{inputUserid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Sewage_Input - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SewageMapper.xml b/src/com/sipai/mapper/sparepart/SewageMapper.xml deleted file mode 100644 index 873248a1..00000000 --- a/src/com/sipai/mapper/sparepart/SewageMapper.xml +++ /dev/null @@ -1,320 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, contract_number, contract_order, name, address, contract_date, username, phone, process_section_id, - unit_id, vent_num, permit_num, plane_num, environment_num, trade, permit, displacement, - standard, city, society_number, longitude_latitude, attribute, remark - - - - delete from TB_Sewage_Source - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Sewage_Source (id, contract_number, contract_order, - name, address, contract_date, - username, phone, process_section_id, - unit_id, vent_num, permit_num, - plane_num, environment_num, trade, - permit, displacement, standard, - city, society_number, longitude_latitude, - attribute, remark) - values (#{id,jdbcType=VARCHAR}, #{contractNumber,jdbcType=VARCHAR}, #{contractOrder,jdbcType=INTEGER}, - #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{contractDate,jdbcType=VARCHAR}, - #{username,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{processSectionId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{ventNum,jdbcType=VARCHAR}, #{permitNum,jdbcType=VARCHAR}, - #{planeNum,jdbcType=VARCHAR}, #{environmentNum,jdbcType=VARCHAR}, #{trade,jdbcType=VARCHAR}, - #{permit,jdbcType=VARCHAR}, #{displacement,jdbcType=INTEGER}, #{standard,jdbcType=VARCHAR}, - #{city,jdbcType=VARCHAR}, #{societyNumber,jdbcType=VARCHAR}, #{longitudeLatitude,jdbcType=VARCHAR}, - #{attribute,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}) - - - insert into TB_Sewage_Source - - - id, - - - contract_number, - - - contract_order, - - - name, - - - address, - - - contract_date, - - - username, - - - phone, - - - process_section_id, - - - unit_id, - - - vent_num, - - - permit_num, - - - plane_num, - - - environment_num, - - - trade, - - - permit, - - - displacement, - - - standard, - - - city, - - - society_number, - - - longitude_latitude, - - - attribute, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{contractNumber,jdbcType=VARCHAR}, - - - #{contractOrder,jdbcType=INTEGER}, - - - #{name,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{contractDate,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{phone,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{ventNum,jdbcType=VARCHAR}, - - - #{permitNum,jdbcType=VARCHAR}, - - - #{planeNum,jdbcType=VARCHAR}, - - - #{environmentNum,jdbcType=VARCHAR}, - - - #{trade,jdbcType=VARCHAR}, - - - #{permit,jdbcType=VARCHAR}, - - - #{displacement,jdbcType=INTEGER}, - - - #{standard,jdbcType=VARCHAR}, - - - #{city,jdbcType=VARCHAR}, - - - #{societyNumber,jdbcType=VARCHAR}, - - - #{longitudeLatitude,jdbcType=VARCHAR}, - - - #{attribute,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_Sewage_Source - - - contract_number = #{contractNumber,jdbcType=VARCHAR}, - - - contract_order = #{contractOrder,jdbcType=INTEGER}, - - - name = #{name,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - contract_date = #{contractDate,jdbcType=VARCHAR}, - - - username = #{username,jdbcType=VARCHAR}, - - - phone = #{phone,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - vent_num = #{ventNum,jdbcType=VARCHAR}, - - - permit_num = #{permitNum,jdbcType=VARCHAR}, - - - plane_num = #{planeNum,jdbcType=VARCHAR}, - - - environment_num = #{environmentNum,jdbcType=VARCHAR}, - - - trade = #{trade,jdbcType=VARCHAR}, - - - permit = #{permit,jdbcType=VARCHAR}, - - - displacement = #{displacement,jdbcType=INTEGER}, - - - standard = #{standard,jdbcType=VARCHAR}, - - - city = #{city,jdbcType=VARCHAR}, - - - society_number = #{societyNumber,jdbcType=VARCHAR}, - - - longitude_latitude = #{longitudeLatitude,jdbcType=VARCHAR}, - - - attribute = #{attribute,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Sewage_Source - set contract_number = #{contractNumber,jdbcType=VARCHAR}, - contract_order = #{contractOrder,jdbcType=INTEGER}, - name = #{name,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - contract_date = #{contractDate,jdbcType=VARCHAR}, - username = #{username,jdbcType=VARCHAR}, - phone = #{phone,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - vent_num = #{ventNum,jdbcType=VARCHAR}, - permit_num = #{permitNum,jdbcType=VARCHAR}, - plane_num = #{planeNum,jdbcType=VARCHAR}, - environment_num = #{environmentNum,jdbcType=VARCHAR}, - trade = #{trade,jdbcType=VARCHAR}, - permit = #{permit,jdbcType=VARCHAR}, - displacement = #{displacement,jdbcType=INTEGER}, - standard = #{standard,jdbcType=VARCHAR}, - city = #{city,jdbcType=VARCHAR}, - society_number = #{societyNumber,jdbcType=VARCHAR}, - longitude_latitude = #{longitudeLatitude,jdbcType=VARCHAR}, - attribute = #{attribute,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_Sewage_Source - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/StockCheckDetailMapper.xml b/src/com/sipai/mapper/sparepart/StockCheckDetailMapper.xml deleted file mode 100644 index 92042cf0..00000000 --- a/src/com/sipai/mapper/sparepart/StockCheckDetailMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insuser, insdt, check_id, goods_id, real_number, account_number, price, difference_number, - status, warehouse_id, remark - - - - delete from TB_SparePart_StockCheckDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_StockCheckDetail (id, insuser, insdt, - check_id, goods_id, real_number, - account_number, price, difference_number, - status, warehouse_id, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{checkId,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{realNumber,jdbcType=DECIMAL}, - #{accountNumber,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, #{differenceNumber,jdbcType=DECIMAL}, - #{status,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_StockCheckDetail - - - id, - - - insuser, - - - insdt, - - - check_id, - - - goods_id, - - - real_number, - - - account_number, - - - price, - - - difference_number, - - - status, - - - warehouse_id, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{checkId,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{realNumber,jdbcType=DECIMAL}, - - - #{accountNumber,jdbcType=DECIMAL}, - - - #{price,jdbcType=DECIMAL}, - - - #{differenceNumber,jdbcType=DECIMAL}, - - - #{status,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update TB_SparePart_StockCheckDetail - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - check_id = #{checkId,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - real_number = #{realNumber,jdbcType=DECIMAL}, - - - account_number = #{accountNumber,jdbcType=DECIMAL}, - - - price = #{price,jdbcType=DECIMAL}, - - - difference_number = #{differenceNumber,jdbcType=DECIMAL}, - - - status = #{status,jdbcType=VARCHAR}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_StockCheckDetail - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - check_id = #{checkId,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - real_number = #{realNumber,jdbcType=DECIMAL}, - account_number = #{accountNumber,jdbcType=DECIMAL}, - price = #{price,jdbcType=DECIMAL}, - difference_number = #{differenceNumber,jdbcType=DECIMAL}, - status = #{status,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_StockCheckDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/StockCheckMapper.xml b/src/com/sipai/mapper/sparepart/StockCheckMapper.xml deleted file mode 100644 index 011553ad..00000000 --- a/src/com/sipai/mapper/sparepart/StockCheckMapper.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, biz_id, warehouse_id, startdt, enddt, last_time, now_time, account_id, - status, handler_id, audit_id, remark, processDefId, processId - - - - delete from TB_SparePart_StockCheck - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_StockCheck (id, insuser, insdt, - biz_id, warehouse_id, startdt, - enddt, last_time, now_time, - account_id, status, handler_id, - audit_id, remark, processDefId, processId) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{bizId,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, #{startdt,jdbcType=TIMESTAMP}, - #{enddt,jdbcType=TIMESTAMP}, #{lastTime,jdbcType=TIMESTAMP}, #{nowTime,jdbcType=TIMESTAMP}, - #{accountId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{handlerId,jdbcType=VARCHAR}, - #{auditId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},#{processdefid,jdbcType=VARCHAR}, - #{processid,jdbcType=VARCHAR}) - - - insert into TB_SparePart_StockCheck - - - id, - - - insuser, - - - insdt, - - - biz_id, - - - warehouse_id, - - - startdt, - - - enddt, - - - last_time, - - - now_time, - - - account_id, - - - status, - - - handler_id, - - - audit_id, - - - remark, - - - processDefId, - - - processId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{startdt,jdbcType=TIMESTAMP}, - - - #{enddt,jdbcType=TIMESTAMP}, - - - #{lastTime,jdbcType=TIMESTAMP}, - - - #{nowTime,jdbcType=TIMESTAMP}, - - - #{accountId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{handlerId,jdbcType=VARCHAR}, - - - #{auditId,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - - - update TB_SparePart_StockCheck - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - startdt = #{startdt,jdbcType=TIMESTAMP}, - - - enddt = #{enddt,jdbcType=TIMESTAMP}, - - - last_time = #{lastTime,jdbcType=TIMESTAMP}, - - - now_time = #{nowTime,jdbcType=TIMESTAMP}, - - - account_id = #{accountId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - handler_id = #{handlerId,jdbcType=VARCHAR}, - - - audit_id = #{auditId,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_StockCheck - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - startdt = #{startdt,jdbcType=TIMESTAMP}, - enddt = #{enddt,jdbcType=TIMESTAMP}, - last_time = #{lastTime,jdbcType=TIMESTAMP}, - now_time = #{nowTime,jdbcType=TIMESTAMP}, - account_id = #{accountId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - handler_id = #{handlerId,jdbcType=VARCHAR}, - audit_id = #{auditId,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_StockCheck - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/StockMapper.xml b/src/com/sipai/mapper/sparepart/StockMapper.xml deleted file mode 100644 index fd652213..00000000 --- a/src/com/sipai/mapper/sparepart/StockMapper.xml +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, goods_id, warehouse_id, account_id, init_number, in_number, - out_number, cost_price, now_number, account_date, real_number, shift_number, shift_memo, - total_money, alarm_status, included_tax_cost_price, included_tax_total_money, available_number - - - - delete from TB_SparePart_Stock - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Stock (id, insdt, insuser, - biz_id, goods_id, warehouse_id, - account_id, init_number, in_number, - out_number, cost_price, now_number, - account_date, real_number, shift_number, - shift_memo, total_money, alarm_status, - included_tax_cost_price, included_tax_total_money, available_number - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, - #{accountId,jdbcType=VARCHAR}, #{initNumber,jdbcType=DECIMAL}, #{inNumber,jdbcType=DECIMAL}, - #{outNumber,jdbcType=DECIMAL}, #{costPrice,jdbcType=DECIMAL}, #{nowNumber,jdbcType=DECIMAL}, - #{accountDate,jdbcType=TIMESTAMP}, #{realNumber,jdbcType=DECIMAL}, #{shiftNumber,jdbcType=DECIMAL}, - #{shiftMemo,jdbcType=VARCHAR}, #{totalMoney,jdbcType=DECIMAL}, #{alarmStatus,jdbcType=VARCHAR}, - #{includedTaxCostPrice,jdbcType=VARCHAR}, #{includedTaxTotalMoney,jdbcType=VARCHAR}, - #{availableNumber,jdbcType=DECIMAL} - ) - - - insert into TB_SparePart_Stock - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - goods_id, - - - warehouse_id, - - - account_id, - - - init_number, - - - in_number, - - - out_number, - - - cost_price, - - - now_number, - - - account_date, - - - real_number, - - - shift_number, - - - shift_memo, - - - total_money, - - - alarm_status, - - - included_tax_cost_price, - - - included_tax_total_money, - - - available_number, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{warehouseId,jdbcType=VARCHAR}, - - - #{accountId,jdbcType=VARCHAR}, - - - #{initNumber,jdbcType=DECIMAL}, - - - #{inNumber,jdbcType=DECIMAL}, - - - #{outNumber,jdbcType=DECIMAL}, - - - #{costPrice,jdbcType=DECIMAL}, - - - #{nowNumber,jdbcType=DECIMAL}, - - - #{accountDate,jdbcType=TIMESTAMP}, - - - #{realNumber,jdbcType=DECIMAL}, - - - #{shiftNumber,jdbcType=DECIMAL}, - - - #{shiftMemo,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{alarmStatus,jdbcType=VARCHAR}, - - - #{includedTaxCostPrice,jdbcType=VARCHAR}, - - - #{includedTaxTotalMoney,jdbcType=VARCHAR}, - - - #{availableNumber}, - - - - - update TB_SparePart_Stock - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - - - account_id = #{accountId,jdbcType=VARCHAR}, - - - init_number = #{initNumber,jdbcType=DECIMAL}, - - - in_number = #{inNumber,jdbcType=DECIMAL}, - - - out_number = #{outNumber,jdbcType=DECIMAL}, - - - cost_price = #{costPrice,jdbcType=DECIMAL}, - - - now_number = #{nowNumber,jdbcType=DECIMAL}, - - - account_date = #{accountDate,jdbcType=TIMESTAMP}, - - - real_number = #{realNumber,jdbcType=DECIMAL}, - - - shift_number = #{shiftNumber,jdbcType=DECIMAL}, - - - shift_memo = #{shiftMemo,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - alarm_status = #{alarmStatus,jdbcType=VARCHAR}, - - - included_tax_cost_price = #{includedTaxCostPrice,jdbcType=DECIMAL}, - - - included_tax_total_money = #{includedTaxTotalMoney,jdbcType=DECIMAL}, - - - available_number = #{availableNumber,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Stock - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - warehouse_id = #{warehouseId,jdbcType=VARCHAR}, - account_id = #{accountId,jdbcType=VARCHAR}, - init_number = #{initNumber,jdbcType=DECIMAL}, - in_number = #{inNumber,jdbcType=DECIMAL}, - out_number = #{outNumber,jdbcType=DECIMAL}, - cost_price = #{costPrice,jdbcType=DECIMAL}, - now_number = #{nowNumber,jdbcType=DECIMAL}, - account_date = #{accountDate,jdbcType=TIMESTAMP}, - real_number = #{realNumber,jdbcType=DECIMAL}, - shift_number = #{shiftNumber,jdbcType=DECIMAL}, - shift_memo = #{shiftMemo,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - alarm_status = #{alarmStatus,jdbcType=VARCHAR}, - included_tax_cost_price = #{includedTaxCostPrice,jdbcType=DECIMAL}, - included_tax_total_money = #{includedTaxTotalMoney,jdbcType=DECIMAL}, - available_number = #{availableNumber,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Stock - ${where} - - - - - - - - - diff --git a/src/com/sipai/mapper/sparepart/StockTransfersApplyDetailMapper.xml b/src/com/sipai/mapper/sparepart/StockTransfersApplyDetailMapper.xml deleted file mode 100644 index b7a7b620..00000000 --- a/src/com/sipai/mapper/sparepart/StockTransfersApplyDetailMapper.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - id, insuser, insdt, number, unit, price, total_money, transfers_apply_number, stock_id - - - - delete from TB_SparePart_Stock_TransfersApplyDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Stock_TransfersApplyDetail (id, insuser, insdt, - number, unit, price, - total_money, transfers_apply_number, stock_id - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{number,jdbcType=INTEGER}, #{unit,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, - #{totalMoney,jdbcType=DECIMAL}, #{transfersApplyNumber,jdbcType=VARCHAR}, #{stockId,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_Stock_TransfersApplyDetail - - - id, - - - insuser, - - - insdt, - - - number, - - - unit, - - - price, - - - total_money, - - - transfers_apply_number, - - - stock_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{number,jdbcType=INTEGER}, - - - #{unit,jdbcType=VARCHAR}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{transfersApplyNumber,jdbcType=VARCHAR}, - - - #{stockId,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Stock_TransfersApplyDetail - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - number = #{number,jdbcType=INTEGER}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - transfers_apply_number = #{transfersApplyNumber,jdbcType=VARCHAR}, - - - stock_id = #{stockId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Stock_TransfersApplyDetail - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - number = #{number,jdbcType=INTEGER}, - unit = #{unit,jdbcType=VARCHAR}, - price = #{price,jdbcType=DECIMAL}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - transfers_apply_number = #{transfersApplyNumber,jdbcType=VARCHAR}, - stock_id = #{stockId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from TB_SparePart_Stock_TransfersApplyDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SubscribeDetailMapper.xml b/src/com/sipai/mapper/sparepart/SubscribeDetailMapper.xml deleted file mode 100644 index 21c09970..00000000 --- a/src/com/sipai/mapper/sparepart/SubscribeDetailMapper.xml +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, subscribe_id, pid, goods_id, supplier_id, number, price, total_money, - dept_id, purpose, channelsId, install, design, manufacturer, brand, contract_id, - processSectionId, equipment_big_class_id, equipmentClassID, memo, plan_arrival_time, - plan_arrival_place, detail_goods_name, detail_goods_specifications, detail_goods_model - - - - delete from TB_SparePart_SubscribeDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_SubscribeDetail (id, insdt, insuser, - subscribe_id, pid, goods_id, - supplier_id, number, price, - total_money, dept_id, purpose, - channelsId, install, design, - manufacturer, brand, contract_id, - processSectionId, equipment_big_class_id, - equipmentClassID, memo, plan_arrival_time, - plan_arrival_place, detail_goods_name, - detail_goods_specifications, detail_goods_model) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{subscribeId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, - #{supplierId,jdbcType=VARCHAR}, #{number,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, - #{totalMoney,jdbcType=DECIMAL}, #{deptId,jdbcType=VARCHAR}, #{purpose,jdbcType=VARCHAR}, - #{channelsid,jdbcType=VARCHAR}, #{install,jdbcType=VARCHAR}, #{design,jdbcType=VARCHAR}, - #{manufacturer,jdbcType=VARCHAR}, #{brand,jdbcType=VARCHAR}, #{contractId,jdbcType=VARCHAR}, - #{processsectionid,jdbcType=VARCHAR}, #{equipmentBigClassId,jdbcType=VARCHAR}, - #{equipmentclassid,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{planArrivalTime,jdbcType=VARCHAR}, - #{planArrivalPlace,jdbcType=VARCHAR}, #{detailGoodsName,jdbcType=VARCHAR}, - #{detailGoodsSpecifications,jdbcType=VARCHAR}, #{detailGoodsModel,jdbcType=VARCHAR}) - - - insert into TB_SparePart_SubscribeDetail - - - id, - - - insdt, - - - insuser, - - - subscribe_id, - - - pid, - - - goods_id, - - - supplier_id, - - - number, - - - price, - - - total_money, - - - dept_id, - - - purpose, - - - channelsId, - - - install, - - - design, - - - manufacturer, - - - brand, - - - contract_id, - - - processSectionId, - - - equipment_big_class_id, - - - equipmentClassID, - - - memo, - - - plan_arrival_time, - - - plan_arrival_place, - - - detail_goods_name, - - - detail_goods_specifications, - - - detail_goods_model, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{subscribeId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{number,jdbcType=DECIMAL}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{purpose,jdbcType=VARCHAR}, - - - #{channelsid,jdbcType=VARCHAR}, - - - #{install,jdbcType=VARCHAR}, - - - #{design,jdbcType=VARCHAR}, - - - #{manufacturer,jdbcType=VARCHAR}, - - - #{brand,jdbcType=VARCHAR}, - - - #{contractId,jdbcType=VARCHAR}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{equipmentBigClassId,jdbcType=VARCHAR}, - - - #{equipmentclassid,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{planArrivalTime,jdbcType=VARCHAR}, - - - #{planArrivalPlace,jdbcType=VARCHAR}, - - - #{detailGoodsName,jdbcType=VARCHAR}, - - - #{detailGoodsSpecifications,jdbcType=VARCHAR}, - - - #{detailGoodsModel,jdbcType=VARCHAR}, - - - - - update TB_SparePart_SubscribeDetail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - subscribe_id = #{subscribeId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=DECIMAL}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - purpose = #{purpose,jdbcType=VARCHAR}, - - - channelsId = #{channelsid,jdbcType=VARCHAR}, - - - install = #{install,jdbcType=VARCHAR}, - - - design = #{design,jdbcType=VARCHAR}, - - - manufacturer = #{manufacturer,jdbcType=VARCHAR}, - - - brand = #{brand,jdbcType=VARCHAR}, - - - contract_id = #{contractId,jdbcType=VARCHAR}, - - - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - - - equipment_big_class_id = #{equipmentBigClassId,jdbcType=VARCHAR}, - - - equipmentClassID = #{equipmentclassid,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - plan_arrival_time = #{planArrivalTime,jdbcType=VARCHAR}, - - - plan_arrival_place = #{planArrivalPlace,jdbcType=VARCHAR}, - - - detail_goods_name = #{detailGoodsName,jdbcType=VARCHAR}, - - - detail_goods_specifications = #{detailGoodsSpecifications,jdbcType=VARCHAR}, - - - detail_goods_model = #{detailGoodsModel,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_SubscribeDetail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - subscribe_id = #{subscribeId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - goods_id = #{goodsId,jdbcType=VARCHAR}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - number = #{number,jdbcType=DECIMAL}, - price = #{price,jdbcType=DECIMAL}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - dept_id = #{deptId,jdbcType=VARCHAR}, - purpose = #{purpose,jdbcType=VARCHAR}, - channelsId = #{channelsid,jdbcType=VARCHAR}, - install = #{install,jdbcType=VARCHAR}, - design = #{design,jdbcType=VARCHAR}, - manufacturer = #{manufacturer,jdbcType=VARCHAR}, - brand = #{brand,jdbcType=VARCHAR}, - contract_id = #{contractId,jdbcType=VARCHAR}, - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - equipment_big_class_id = #{equipmentBigClassId,jdbcType=VARCHAR}, - equipmentClassID = #{equipmentclassid,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - plan_arrival_time = #{planArrivalTime,jdbcType=VARCHAR}, - plan_arrival_place = #{planArrivalPlace,jdbcType=VARCHAR}, - detail_goods_name = #{detailGoodsName,jdbcType=VARCHAR}, - detail_goods_specifications = #{detailGoodsSpecifications,jdbcType=VARCHAR}, - detail_goods_model = #{detailGoodsModel,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_SparePart_SubscribeDetail - ${where} - - - update TB_SparePart_SubscribeDetail - set goods_id = #{goodsId} - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/SubscribeMapper.xml b/src/com/sipai/mapper/sparepart/SubscribeMapper.xml deleted file mode 100644 index 6681ef7e..00000000 --- a/src/com/sipai/mapper/sparepart/SubscribeMapper.xml +++ /dev/null @@ -1,284 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, biz_id, dept_id, subscribe_man_id, subscribe_date, subscribe_audit_id, - inquiry_audit_id, inquiry_man_id, status, total_money, reject_reason, pid, remark, purchaseMethodsId, channelsId, - processDefId, processId, type - - - - delete from TB_SparePart_Subscribe - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Subscribe (id, insdt, insuser, - biz_id, dept_id, subscribe_man_id, - subscribe_date, subscribe_audit_id, inquiry_audit_id, - inquiry_man_id, status, total_money, - reject_reason, pid, remark, purchaseMethodsId, channelsId, - processDefId, processId, type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}, #{subscribeManId,jdbcType=VARCHAR}, - #{subscribeDate,jdbcType=TIMESTAMP}, #{subscribeAuditId,jdbcType=VARCHAR}, #{inquiryAuditId,jdbcType=VARCHAR}, - #{inquiryManId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{totalMoney,jdbcType=DECIMAL}, - #{rejectReason,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{purchasemethodsid,jdbcType=VARCHAR}, - #{channelsid,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Subscribe - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - dept_id, - - - subscribe_man_id, - - - subscribe_date, - - - subscribe_audit_id, - - - inquiry_audit_id, - - - inquiry_man_id, - - - status, - - - total_money, - - - reject_reason, - - - pid, - - - remark, - - - processDefId, - - - processId, - - - purchaseMethodsId, - - - channelsId, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{subscribeManId,jdbcType=VARCHAR}, - - - #{subscribeDate,jdbcType=TIMESTAMP}, - - - #{subscribeAuditId,jdbcType=VARCHAR}, - - - #{inquiryAuditId,jdbcType=VARCHAR}, - - - #{inquiryManId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{totalMoney,jdbcType=DECIMAL}, - - - #{rejectReason,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{purchasemethodsid,jdbcType=VARCHAR}, - - - #{channelsid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Subscribe - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - subscribe_man_id = #{subscribeManId,jdbcType=VARCHAR}, - - - subscribe_date = #{subscribeDate,jdbcType=TIMESTAMP}, - - - subscribe_audit_id = #{subscribeAuditId,jdbcType=VARCHAR}, - - - inquiry_audit_id = #{inquiryAuditId,jdbcType=VARCHAR}, - - - inquiry_man_id = #{inquiryManId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - total_money = #{totalMoney,jdbcType=DECIMAL}, - - - reject_reason = #{rejectReason,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - purchaseMethodsId = #{purchasemethodsid,jdbcType=VARCHAR}, - - - channelsId = #{channelsid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Subscribe - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - subscribe_man_id = #{subscribeManId,jdbcType=VARCHAR}, - subscribe_date = #{subscribeDate,jdbcType=TIMESTAMP}, - subscribe_audit_id = #{subscribeAuditId,jdbcType=VARCHAR}, - inquiry_audit_id = #{inquiryAuditId,jdbcType=VARCHAR}, - inquiry_man_id = #{inquiryManId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - total_money = #{totalMoney,jdbcType=DECIMAL}, - reject_reason = #{rejectReason,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - purchaseMethodsId = #{purchasemethodsid,jdbcType=VARCHAR}, - channelsId = #{channelsid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Subscribe - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SupplierClassMapper.xml b/src/com/sipai/mapper/sparepart/SupplierClassMapper.xml deleted file mode 100644 index 6e77842b..00000000 --- a/src/com/sipai/mapper/sparepart/SupplierClassMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, name, active, pid, describe - - - - delete from TB_SparePart_SupplierClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_SupplierClass (id, insdt, insuser, - name, active, pid, describe - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_SupplierClass - - - id, - - - insdt, - - - insuser, - - - name, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_SupplierClass - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_SupplierClass - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_SupplierClass - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SupplierClass_copyMapper.xml b/src/com/sipai/mapper/sparepart/SupplierClass_copyMapper.xml deleted file mode 100644 index 7b9c8c77..00000000 --- a/src/com/sipai/mapper/sparepart/SupplierClass_copyMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, name, active, pid, describe - - - - delete from TB_SparePart_SupplierClass_copy - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_SupplierClass_copy (id, insdt, insuser, - name, active, pid, describe - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, #{pid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_SupplierClass_copy - - - id, - - - insdt, - - - insuser, - - - name, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_SupplierClass_copy - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_SupplierClass_copy - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_SupplierClass_copy - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SupplierMapper.xml b/src/com/sipai/mapper/sparepart/SupplierMapper.xml deleted file mode 100644 index e5daaecf..00000000 --- a/src/com/sipai/mapper/sparepart/SupplierMapper.xml +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, address, link_man, telephone, fax, mobile, exist_status, - class_id, main_business, website, evaluate, remark, type_status, type, abbreviation, - legal_person, bank_information, user_telephone, user_name, tax_number, bank_number - - - - delete from TB_SparePart_Supplier - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Supplier (id, insdt, insuser, - name, address, link_man, - telephone, fax, mobile, - exist_status, class_id, main_business, - website, evaluate, remark, - type_status, type, abbreviation, - legal_person, bank_information, user_telephone, - user_name, tax_number, bank_number - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{linkMan,jdbcType=VARCHAR}, - #{telephone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, - #{existStatus,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, #{mainBusiness,jdbcType=VARCHAR}, - #{website,jdbcType=VARCHAR}, #{evaluate,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{typeStatus,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{abbreviation,jdbcType=VARCHAR}, - #{legalPerson,jdbcType=VARCHAR}, #{bankInformation,jdbcType=VARCHAR}, #{userTelephone,jdbcType=VARCHAR}, - #{userName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR}, #{bankNumber,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_Supplier - - - id, - - - insdt, - - - insuser, - - - name, - - - address, - - - link_man, - - - telephone, - - - fax, - - - mobile, - - - exist_status, - - - class_id, - - - main_business, - - - website, - - - evaluate, - - - remark, - - - type_status, - - - type, - - - abbreviation, - - - legal_person, - - - bank_information, - - - user_telephone, - - - user_name, - - - tax_number, - - - bank_number, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{linkMan,jdbcType=VARCHAR}, - - - #{telephone,jdbcType=VARCHAR}, - - - #{fax,jdbcType=VARCHAR}, - - - #{mobile,jdbcType=VARCHAR}, - - - #{existStatus,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{mainBusiness,jdbcType=VARCHAR}, - - - #{website,jdbcType=VARCHAR}, - - - #{evaluate,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{typeStatus,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{abbreviation,jdbcType=VARCHAR}, - - - #{legalPerson,jdbcType=VARCHAR}, - - - #{bankInformation,jdbcType=VARCHAR}, - - - #{userTelephone,jdbcType=VARCHAR}, - - - #{userName,jdbcType=VARCHAR}, - - - #{taxNumber,jdbcType=VARCHAR}, - - - #{bankNumber,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Supplier - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - link_man = #{linkMan,jdbcType=VARCHAR}, - - - telephone = #{telephone,jdbcType=VARCHAR}, - - - fax = #{fax,jdbcType=VARCHAR}, - - - mobile = #{mobile,jdbcType=VARCHAR}, - - - exist_status = #{existStatus,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - main_business = #{mainBusiness,jdbcType=VARCHAR}, - - - website = #{website,jdbcType=VARCHAR}, - - - evaluate = #{evaluate,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - type_status = #{typeStatus,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - abbreviation = #{abbreviation,jdbcType=VARCHAR}, - - - legal_person = #{legalPerson,jdbcType=VARCHAR}, - - - bank_information = #{bankInformation,jdbcType=VARCHAR}, - - - user_telephone = #{userTelephone,jdbcType=VARCHAR}, - - - user_name = #{userName,jdbcType=VARCHAR}, - - - tax_number = #{taxNumber,jdbcType=VARCHAR}, - - - bank_number = #{bankNumber,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Supplier - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - link_man = #{linkMan,jdbcType=VARCHAR}, - telephone = #{telephone,jdbcType=VARCHAR}, - fax = #{fax,jdbcType=VARCHAR}, - mobile = #{mobile,jdbcType=VARCHAR}, - exist_status = #{existStatus,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - main_business = #{mainBusiness,jdbcType=VARCHAR}, - website = #{website,jdbcType=VARCHAR}, - evaluate = #{evaluate,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - type_status = #{typeStatus,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - abbreviation = #{abbreviation,jdbcType=VARCHAR}, - legal_person = #{legalPerson,jdbcType=VARCHAR}, - bank_information = #{bankInformation,jdbcType=VARCHAR}, - user_telephone = #{userTelephone,jdbcType=VARCHAR}, - user_name = #{userName,jdbcType=VARCHAR}, - tax_number = #{taxNumber,jdbcType=VARCHAR}, - bank_number = #{bankNumber,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Supplier - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SupplierQualificationMapper.xml b/src/com/sipai/mapper/sparepart/SupplierQualificationMapper.xml deleted file mode 100644 index ceb7131b..00000000 --- a/src/com/sipai/mapper/sparepart/SupplierQualificationMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, supplier_id, qualification_type, qualification_validity_time, - qualification_state, name - - - - delete from TB_SparePart_SupplierQualification - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_SupplierQualification (id, insdt, insuser, - supplier_id, qualification_type, qualification_validity_time, - qualification_state, name) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{supplierId,jdbcType=VARCHAR}, #{qualificationType,jdbcType=VARCHAR}, #{qualificationValidityTime,jdbcType=VARCHAR}, - #{qualificationState,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}) - - - insert into TB_SparePart_SupplierQualification - - - id, - - - insdt, - - - insuser, - - - supplier_id, - - - qualification_type, - - - qualification_validity_time, - - - qualification_state, - - - name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{qualificationType,jdbcType=VARCHAR}, - - - #{qualificationValidityTime,jdbcType=VARCHAR}, - - - #{qualificationState,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - - - update TB_SparePart_SupplierQualification - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - qualification_type = #{qualificationType,jdbcType=VARCHAR}, - - - qualification_validity_time = #{qualificationValidityTime,jdbcType=VARCHAR}, - - - qualification_state = #{qualificationState,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_SupplierQualification - set insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - qualification_type = #{qualificationType,jdbcType=VARCHAR}, - qualification_validity_time = #{qualificationValidityTime,jdbcType=VARCHAR}, - qualification_state = #{qualificationState,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_SupplierQualification - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SupplierQualification_copyMapper.xml b/src/com/sipai/mapper/sparepart/SupplierQualification_copyMapper.xml deleted file mode 100644 index b7690046..00000000 --- a/src/com/sipai/mapper/sparepart/SupplierQualification_copyMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, supplier_id, qualification_type, qualification_validity_time, - qualification_state, name - - - - delete from TB_SparePart_SupplierQualification_copy - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_SupplierQualification_copy (id, insdt, insuser, - supplier_id, qualification_type, qualification_validity_time, - qualification_state, name) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{supplierId,jdbcType=VARCHAR}, #{qualificationType,jdbcType=VARCHAR}, #{qualificationValidityTime,jdbcType=TIMESTAMP}, - #{qualificationState,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}) - - - insert into TB_SparePart_SupplierQualification_copy - - - id, - - - insdt, - - - insuser, - - - supplier_id, - - - qualification_type, - - - qualification_validity_time, - - - qualification_state, - - - name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{supplierId,jdbcType=VARCHAR}, - - - #{qualificationType,jdbcType=VARCHAR}, - - - #{qualificationValidityTime,jdbcType=TIMESTAMP}, - - - #{qualificationState,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - - - update TB_SparePart_SupplierQualification_copy - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - supplier_id = #{supplierId,jdbcType=VARCHAR}, - - - qualification_type = #{qualificationType,jdbcType=VARCHAR}, - - - qualification_validity_time = #{qualificationValidityTime,jdbcType=TIMESTAMP}, - - - qualification_state = #{qualificationState,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_SupplierQualification_copy - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - supplier_id = #{supplierId,jdbcType=VARCHAR}, - qualification_type = #{qualificationType,jdbcType=VARCHAR}, - qualification_validity_time = #{qualificationValidityTime,jdbcType=TIMESTAMP}, - qualification_state = #{qualificationState,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_SupplierQualification_copy - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/SupplierQualification_fileMapper.xml b/src/com/sipai/mapper/sparepart/SupplierQualification_fileMapper.xml deleted file mode 100644 index ee8f4f4a..00000000 --- a/src/com/sipai/mapper/sparepart/SupplierQualification_fileMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, masterid, filename, abspath, filepath, type, size - - - - delete from TB_SparePart_SupplierQualification_file - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_SupplierQualification_file (id, insdt, insuser, - masterid, filename, abspath, - filepath, type, size - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR} - ) - - - insert into TB_SparePart_SupplierQualification_file - - - id, - - - insdt, - - - insuser, - - - masterid, - - - filename, - - - abspath, - - - filepath, - - - type, - - - size, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=VARCHAR}, - - - - - update TB_SparePart_SupplierQualification_file - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_SupplierQualification_file - set insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - filepath = #{filepath,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - size = #{size,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_SupplierQualification_file - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/Supplier_copyMapper.xml b/src/com/sipai/mapper/sparepart/Supplier_copyMapper.xml deleted file mode 100644 index e389a32e..00000000 --- a/src/com/sipai/mapper/sparepart/Supplier_copyMapper.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, address, link_man, telephone, fax, mobile, exist_status, - class_id, main_business, website, evaluate, remark, abbreviation, legal_person, bank_information, - type, user_telephone, user_name, tax_number, bank_number - - - - delete from TB_SparePart_Supplier_copy - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Supplier_copy (id, insdt, insuser, - name, address, link_man, - telephone, fax, mobile, - exist_status, class_id, main_business, - website, evaluate, remark, - abbreviation, legal_person, bank_information, - type, user_telephone, user_name, - tax_number, bank_number) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{linkMan,jdbcType=VARCHAR}, - #{telephone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, - #{existStatus,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, #{mainBusiness,jdbcType=VARCHAR}, - #{website,jdbcType=VARCHAR}, #{evaluate,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{abbreviation,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR}, #{bankInformation,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{userTelephone,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, - #{taxNumber,jdbcType=VARCHAR}, #{bankNumber,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Supplier_copy - - - id, - - - insdt, - - - insuser, - - - name, - - - address, - - - link_man, - - - telephone, - - - fax, - - - mobile, - - - exist_status, - - - class_id, - - - main_business, - - - website, - - - evaluate, - - - remark, - - - abbreviation, - - - legal_person, - - - bank_information, - - - type, - - - user_telephone, - - - user_name, - - - tax_number, - - - bank_number, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{linkMan,jdbcType=VARCHAR}, - - - #{telephone,jdbcType=VARCHAR}, - - - #{fax,jdbcType=VARCHAR}, - - - #{mobile,jdbcType=VARCHAR}, - - - #{existStatus,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{mainBusiness,jdbcType=VARCHAR}, - - - #{website,jdbcType=VARCHAR}, - - - #{evaluate,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{abbreviation,jdbcType=VARCHAR}, - - - #{legalPerson,jdbcType=VARCHAR}, - - - #{bankInformation,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{userTelephone,jdbcType=VARCHAR}, - - - #{userName,jdbcType=VARCHAR}, - - - #{taxNumber,jdbcType=VARCHAR}, - - - #{bankNumber,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Supplier_copy - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - link_man = #{linkMan,jdbcType=VARCHAR}, - - - telephone = #{telephone,jdbcType=VARCHAR}, - - - fax = #{fax,jdbcType=VARCHAR}, - - - mobile = #{mobile,jdbcType=VARCHAR}, - - - exist_status = #{existStatus,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - main_business = #{mainBusiness,jdbcType=VARCHAR}, - - - website = #{website,jdbcType=VARCHAR}, - - - evaluate = #{evaluate,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - abbreviation = #{abbreviation,jdbcType=VARCHAR}, - - - legal_person = #{legalPerson,jdbcType=VARCHAR}, - - - bank_information = #{bankInformation,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - user_telephone = #{userTelephone,jdbcType=VARCHAR}, - - - user_name = #{userName,jdbcType=VARCHAR}, - - - tax_number = #{taxNumber,jdbcType=VARCHAR}, - - - bank_number = #{bankNumber,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Supplier_copy - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - link_man = #{linkMan,jdbcType=VARCHAR}, - telephone = #{telephone,jdbcType=VARCHAR}, - fax = #{fax,jdbcType=VARCHAR}, - mobile = #{mobile,jdbcType=VARCHAR}, - exist_status = #{existStatus,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - main_business = #{mainBusiness,jdbcType=VARCHAR}, - website = #{website,jdbcType=VARCHAR}, - evaluate = #{evaluate,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - abbreviation = #{abbreviation,jdbcType=VARCHAR}, - legal_person = #{legalPerson,jdbcType=VARCHAR}, - bank_information = #{bankInformation,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - user_telephone = #{userTelephone,jdbcType=VARCHAR}, - user_name = #{userName,jdbcType=VARCHAR}, - tax_number = #{taxNumber,jdbcType=VARCHAR}, - bank_number = #{bankNumber,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_Supplier_copy - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/sparepart/WarehouseMapper.xml b/src/com/sipai/mapper/sparepart/WarehouseMapper.xml deleted file mode 100644 index 9076fb47..00000000 --- a/src/com/sipai/mapper/sparepart/WarehouseMapper.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, department, biz_id, telephone, address, area, use_date, - status, remark, warehouse_parent, outbound_type - - - - delete from TB_SparePart_Warehouse - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_Warehouse (id, insdt, insuser, - name, department, biz_id, - telephone, address, area, - use_date, status, remark, - warehouse_parent, outbound_type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{area,jdbcType=DOUBLE}, - #{useDate,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{warehouseParent,jdbcType=VARCHAR},#{outboundType,jdbcType=VARCHAR}) - - - insert into TB_SparePart_Warehouse - - - id, - - - insdt, - - - insuser, - - - name, - - - department, - - - biz_id, - - - telephone, - - - address, - - - area, - - - use_date, - - - status, - - - remark, - - - warehouse_parent, - - - outbound_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{department,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{telephone,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{area,jdbcType=DOUBLE}, - - - #{useDate,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{warehouseParent,jdbcType=VARCHAR}, - - - #{outboundType,jdbcType=VARCHAR}, - - - - - update TB_SparePart_Warehouse - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - department = #{department,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - telephone = #{telephone,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - area = #{area,jdbcType=DOUBLE}, - - - use_date = #{useDate,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - warehouse_parent = #{warehouseParent,jdbcType=VARCHAR}, - - - outbound_type = #{outboundType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_Warehouse - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - department = #{department,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - telephone = #{telephone,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - area = #{area,jdbcType=DOUBLE}, - use_date = #{useDate,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - warehouse_parent = #{warehouseParent,jdbcType=VARCHAR}, - outbound_type = #{outboundType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_SparePart_Warehouse - ${where} - - diff --git a/src/com/sipai/mapper/sparepart/WarrantyPeriodMapper.xml b/src/com/sipai/mapper/sparepart/WarrantyPeriodMapper.xml deleted file mode 100644 index 02e44d10..00000000 --- a/src/com/sipai/mapper/sparepart/WarrantyPeriodMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, period, morder, active, pid, describe - - - - delete from TB_SparePart_warrantyPeriod - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SparePart_warrantyPeriod (id, insdt, insuser, - period, morder, active, - pid, describe) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{period,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, #{active,jdbcType=BIT}, - #{pid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}) - - - insert into TB_SparePart_warrantyPeriod - - - id, - - - insdt, - - - insuser, - - - period, - - - morder, - - - active, - - - pid, - - - describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{period,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{pid,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - - - update TB_SparePart_warrantyPeriod - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - period = #{period,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SparePart_warrantyPeriod - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - period = #{period,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - pid = #{pid,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SparePart_warrantyPeriod - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/structure/StructureCardMapper.xml b/src/com/sipai/mapper/structure/StructureCardMapper.xml deleted file mode 100644 index 1fb6bfad..00000000 --- a/src/com/sipai/mapper/structure/StructureCardMapper.xml +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, remark, pid, name, morder, type, longitude, latitude, class_id, - active, unit_id, sname, design_code, adjustable_code, current_code, load_code - - - - delete from TB_EM_StructureCard - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_StructureCard (id, insuser, insdt, - remark, pid, name, - morder, type, longitude, - latitude, class_id, active, - unit_id, sname, design_code, - adjustable_code, current_code, load_code - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{longitude,jdbcType=DOUBLE}, - #{latitude,jdbcType=DOUBLE}, #{classId,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, - #{unitId,jdbcType=VARCHAR}, #{sname,jdbcType=VARCHAR}, #{designCode,jdbcType=VARCHAR}, - #{adjustableCode,jdbcType=VARCHAR}, #{currentCode,jdbcType=VARCHAR}, #{loadCode,jdbcType=VARCHAR} - ) - - - insert into TB_EM_StructureCard - - - id, - - - insuser, - - - insdt, - - - remark, - - - pid, - - - name, - - - morder, - - - type, - - - longitude, - - - latitude, - - - class_id, - - - active, - - - unit_id, - - - sname, - - - design_code, - - - adjustable_code, - - - current_code, - - - load_code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=INTEGER}, - - - #{longitude,jdbcType=DOUBLE}, - - - #{latitude,jdbcType=DOUBLE}, - - - #{classId,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{sname,jdbcType=VARCHAR}, - - - #{designCode,jdbcType=VARCHAR}, - - - #{adjustableCode,jdbcType=VARCHAR}, - - - #{currentCode,jdbcType=VARCHAR}, - - - #{loadCode,jdbcType=VARCHAR}, - - - - - update TB_EM_StructureCard - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=INTEGER}, - - - longitude = #{longitude,jdbcType=DOUBLE}, - - - latitude = #{latitude,jdbcType=DOUBLE}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - design_code = #{designCode,jdbcType=VARCHAR}, - - - adjustable_code = #{adjustableCode,jdbcType=VARCHAR}, - - - current_code = #{currentCode,jdbcType=VARCHAR}, - - - load_code = #{loadCode,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_StructureCard - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=INTEGER}, - longitude = #{longitude,jdbcType=DOUBLE}, - latitude = #{latitude,jdbcType=DOUBLE}, - class_id = #{classId,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - unit_id = #{unitId,jdbcType=VARCHAR}, - sname = #{sname,jdbcType=VARCHAR}, - design_code = #{designCode,jdbcType=VARCHAR}, - adjustable_code = #{adjustableCode,jdbcType=VARCHAR}, - current_code = #{currentCode,jdbcType=VARCHAR}, - load_code = #{loadCode,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_StructureCard - ${where} - - - - - - - - - - - id, pid, name, type, active - - - diff --git a/src/com/sipai/mapper/structure/StructureCardPictureMapper.xml b/src/com/sipai/mapper/structure/StructureCardPictureMapper.xml deleted file mode 100644 index b89a5b8c..00000000 --- a/src/com/sipai/mapper/structure/StructureCardPictureMapper.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - id, structure_id, name, floor, morder, unit_id, insuser, insdt, type, safe_level, safe_content - - - - delete from TB_EM_StructureCard_picture - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_StructureCard_picture (id, structure_id, name, - floor, morder, unit_id, - insuser, insdt, type, safe_level, safe_content) - values (#{id,jdbcType=VARCHAR}, #{structureId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{floor,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{unitId,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP},#{type,jdbcType=VARCHAR},#{safeLevel,jdbcType=VARCHAR},#{safeContent,jdbcType=VARCHAR}) - - - insert into TB_EM_StructureCard_picture - - - id, - - - structure_id, - - - name, - - - floor, - - - morder, - - - unit_id, - - - insuser, - - - insdt, - - - type, - - - safe_level, - - - safeContent, - - - - - #{id,jdbcType=VARCHAR}, - - - #{structureId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{floor,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - #{safeLevel,jdbcType=VARCHAR}, - - - #{safeContent,jdbcType=VARCHAR}, - - - - - update TB_EM_StructureCard_picture - - - structure_id = #{structureId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - floor = #{floor,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - safe_level = #{safeLevel,jdbcType=VARCHAR}, - - - safe_content = #{safeContent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_StructureCard_picture - set structure_id = #{structureId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - floor = #{floor,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR}, - safe_level = #{safeLevel,jdbcType=VARCHAR}, - safe_content = #{safeContent,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_StructureCard_picture - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/structure/StructureCardPictureRouteMapper.xml b/src/com/sipai/mapper/structure/StructureCardPictureRouteMapper.xml deleted file mode 100644 index bf4df761..00000000 --- a/src/com/sipai/mapper/structure/StructureCardPictureRouteMapper.xml +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_plan_id, structure_card_id, structure_card_picture_id, - previous_id, next_id, type, patrol_point_id, posx, posy, container_width, container_height, - morder,patrol_content - - - - delete from TB_EM_StructureCard_picture_route - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_StructureCard_picture_route (id, insdt, insuser, - patrol_plan_id, structure_card_id, structure_card_picture_id, - previous_id, next_id, type, - patrol_point_id, posx, posy,patrol_content, - container_width, container_height, morder - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPlanId,jdbcType=VARCHAR}, #{structureCardId,jdbcType=VARCHAR}, #{structureCardPictureId,jdbcType=VARCHAR}, - #{previousId,jdbcType=VARCHAR}, #{nextId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{patrolPointId,jdbcType=VARCHAR}, #{posx,jdbcType=DECIMAL}, #{posy,jdbcType=DECIMAL}, - #{containerWidth,jdbcType=DECIMAL}, #{containerHeight,jdbcType=DECIMAL}, #{morder,jdbcType=INTEGER},#{patrolContent,jdbcType=VARCHAR} - ) - - - insert into TB_EM_StructureCard_picture_route - - - id, - - - insdt, - - - insuser, - - - patrol_plan_id, - - - structure_card_id, - - - structure_card_picture_id, - - - previous_id, - - - next_id, - - - type, - - - patrol_point_id, - - - posx, - - - posy, - - - container_width, - - - container_height, - - - morder, - - - patrol_content, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{structureCardId,jdbcType=VARCHAR}, - - - #{structureCardPictureId,jdbcType=VARCHAR}, - - - #{previousId,jdbcType=VARCHAR}, - - - #{nextId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DECIMAL}, - - - #{posy,jdbcType=DECIMAL}, - - - #{containerWidth,jdbcType=DECIMAL}, - - - #{containerHeight,jdbcType=DECIMAL}, - - - #{morder,jdbcType=INTEGER}, - - - #{patrolContent,jdbcType=VARCHAR}, - - - - - update TB_EM_StructureCard_picture_route - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - structure_card_id = #{structureCardId,jdbcType=VARCHAR}, - - - structure_card_picture_id = #{structureCardPictureId,jdbcType=VARCHAR}, - - - previous_id = #{previousId,jdbcType=VARCHAR}, - - - next_id = #{nextId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DECIMAL}, - - - posy = #{posy,jdbcType=DECIMAL}, - - - container_width = #{containerWidth,jdbcType=DECIMAL}, - - - container_height = #{containerHeight,jdbcType=DECIMAL}, - - - morder = #{morder,jdbcType=INTEGER}, - - - patrol_content = #{patrolContent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_StructureCard_picture_route - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - structure_card_id = #{structureCardId,jdbcType=VARCHAR}, - structure_card_picture_id = #{structureCardPictureId,jdbcType=VARCHAR}, - previous_id = #{previousId,jdbcType=VARCHAR}, - next_id = #{nextId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DECIMAL}, - posy = #{posy,jdbcType=DECIMAL}, - container_width = #{containerWidth,jdbcType=DECIMAL}, - container_height = #{containerHeight,jdbcType=DECIMAL}, - morder = #{morder,jdbcType=INTEGER}, - patrol_content = #{patrolContent,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_EM_StructureCard_picture_route - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/structure/StructureCardPictureRoutePointdetailMapper.xml b/src/com/sipai/mapper/structure/StructureCardPictureRoutePointdetailMapper.xml deleted file mode 100644 index 78abb050..00000000 --- a/src/com/sipai/mapper/structure/StructureCardPictureRoutePointdetailMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - id, pid, contents, requirement, num, ord, insuser, insdt, upsuser, upsdt - - - - delete from TB_EM_StructureCard_picture_route_pointdetail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_StructureCard_picture_route_pointdetail (id, pid, contents, - requirement, num, ord, - insuser, insdt, upsuser, - upsdt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, - #{requirement,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{ord,jdbcType=INTEGER}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}) - - - insert into TB_EM_StructureCard_picture_route_pointdetail - - - id, - - - pid, - - - contents, - - - requirement, - - - num, - - - ord, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{requirement,jdbcType=VARCHAR}, - - - #{num,jdbcType=INTEGER}, - - - #{ord,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update TB_EM_StructureCard_picture_route_pointdetail - - - pid = #{pid,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - requirement = #{requirement,jdbcType=VARCHAR}, - - - num = #{num,jdbcType=INTEGER}, - - - ord = #{ord,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_StructureCard_picture_route_pointdetail - set pid = #{pid,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - requirement = #{requirement,jdbcType=VARCHAR}, - num = #{num,jdbcType=INTEGER}, - ord = #{ord,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_EM_StructureCard_picture_route_pointdetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/structure/StructureClassMapper.xml b/src/com/sipai/mapper/structure/StructureClassMapper.xml deleted file mode 100644 index a7611995..00000000 --- a/src/com/sipai/mapper/structure/StructureClassMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, name, insdt, insuser, remark, active, pid, bizId - - - - delete from TB_EM_StructureClass - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_StructureClass (id, name, insdt, - insuser, remark, active, - pid, bizId) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}) - - - insert into TB_EM_StructureClass - - - id, - - - name, - - - insdt, - - - insuser, - - - remark, - - - active, - - - pid, - - - bizId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - - - update TB_EM_StructureClass - - - name = #{name,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - bizId = #{bizid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_StructureClass - set name = #{name,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - bizId = #{bizid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_StructureClass - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/teacher/TeacherFileMapper.xml b/src/com/sipai/mapper/teacher/TeacherFileMapper.xml deleted file mode 100644 index 9d9a19b6..00000000 --- a/src/com/sipai/mapper/teacher/TeacherFileMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, masterid, filename, abspath, size, insuser, insdt, upsuser, upsdt, type, ord, - urlpath, memo, filefolder - - - - delete from tb_teacher_file - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_teacher_file (id, masterid, filename, - abspath, size, insuser, - insdt, upsuser, upsdt, - type, ord, urlpath, - memo, filefolder) - values (#{id,jdbcType=VARCHAR}, #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, - #{abspath,jdbcType=VARCHAR}, #{size,jdbcType=DOUBLE}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{type,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{urlpath,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{filefolder,jdbcType=VARCHAR}) - - - insert into tb_teacher_file - - - id, - - - masterid, - - - filename, - - - abspath, - - - size, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - type, - - - ord, - - - urlpath, - - - memo, - - - filefolder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{size,jdbcType=DOUBLE}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{urlpath,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{filefolder,jdbcType=VARCHAR}, - - - - - update tb_teacher_file - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=DOUBLE}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - urlpath = #{urlpath,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - filefolder = #{filefolder,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_teacher_file - set masterid = #{masterid,jdbcType=VARCHAR}, - filename = #{filename,jdbcType=VARCHAR}, - abspath = #{abspath,jdbcType=VARCHAR}, - size = #{size,jdbcType=DOUBLE}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - urlpath = #{urlpath,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - filefolder = #{filefolder,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_teacher_file - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/teacher/TeachertypeMapper.xml b/src/com/sipai/mapper/teacher/TeachertypeMapper.xml deleted file mode 100644 index 6349eb61..00000000 --- a/src/com/sipai/mapper/teacher/TeachertypeMapper.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, pid, state, ord, memo, insuser, insdt, upsuser, upsdt - - - - delete from tb_teacher_coursewaretype - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_teacher_coursewaretype (id, name, pid, - state, ord, memo, insuser, - insdt, upsuser, upsdt - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{state,jdbcType=VARCHAR}, #{ord,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP} - ) - - - insert into tb_teacher_coursewaretype - - - id, - - - name, - - - pid, - - - state, - - - ord, - - - memo, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{state,jdbcType=VARCHAR}, - - - #{ord,jdbcType=INTEGER}, - - - #{memo,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_teacher_coursewaretype - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=VARCHAR}, - - - ord = #{ord,jdbcType=INTEGER}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_teacher_coursewaretype - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - state = #{state,jdbcType=VARCHAR}, - ord = #{ord,jdbcType=INTEGER}, - memo = #{memo,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - delete from - tb_teacher_coursewaretype - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/ClockinRecordMapper.xml b/src/com/sipai/mapper/timeefficiency/ClockinRecordMapper.xml deleted file mode 100644 index f2ba5c6d..00000000 --- a/src/com/sipai/mapper/timeefficiency/ClockinRecordMapper.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, is_on_time, status, record_type, biz_id, location - - - - delete from TB_TimeEfficiency_Clockin_Record - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_Clockin_Record (id, insdt, insuser, - is_on_time, status, record_type, - biz_id, location) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{isOnTime,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR}, #{recordType,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{location,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_Clockin_Record - - - id, - - - insdt, - - - insuser, - - - is_on_time, - - - status, - - - record_type, - - - biz_id, - - - location, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{isOnTime,jdbcType=INTEGER}, - - - #{status,jdbcType=VARCHAR}, - - - #{recordType,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{location,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_Clockin_Record - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - is_on_time = #{isOnTime,jdbcType=INTEGER}, - - - status = #{status,jdbcType=VARCHAR}, - - - record_type = #{recordType,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - location = #{location,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_Clockin_Record - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - is_on_time = #{isOnTime,jdbcType=INTEGER}, - status = #{status,jdbcType=VARCHAR}, - record_type = #{recordType,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - location = #{location,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_TimeEfficiency_Clockin_Record - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/EfficiencyProcessMapper.xml b/src/com/sipai/mapper/timeefficiency/EfficiencyProcessMapper.xml deleted file mode 100644 index bfe2e320..00000000 --- a/src/com/sipai/mapper/timeefficiency/EfficiencyProcessMapper.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, code, name, status, remark, morder, bizid - - - - delete from TB_efficiency_efficiencyProcess - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_efficiency_efficiencyProcess (id, insdt, insuser, - code, name, status, - remark, morder, bizid - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{bizid,jdbcType=VARCHAR} - ) - - - insert into TB_efficiency_efficiencyProcess - - - id, - - - insdt, - - - insuser, - - - code, - - - name, - - - status, - - - remark, - - - morder, - - - bizid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{bizid,jdbcType=VARCHAR}, - - - - - update TB_efficiency_efficiencyProcess - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_efficiency_efficiencyProcess - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - bizid = #{bizid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_efficiency_efficiencyProcess - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/ElectricityPriceDetailMapper.xml b/src/com/sipai/mapper/timeefficiency/ElectricityPriceDetailMapper.xml deleted file mode 100644 index 079db55c..00000000 --- a/src/com/sipai/mapper/timeefficiency/ElectricityPriceDetailMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, bizid, company, diantype, voltagelevel, adjustmentcontent, remark, - start_time, end_time, pid, dianduprice - - - - delete from TB_energyEfficiency_electricityPrice_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_energyEfficiency_electricityPrice_detail (id, insdt, insuser, - bizid, company, diantype, - voltagelevel, adjustmentcontent, remark, - start_time, end_time, pid, - dianduprice) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{diantype,jdbcType=VARCHAR}, - #{voltagelevel,jdbcType=VARCHAR}, #{adjustmentcontent,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{dianduprice,jdbcType=DOUBLE}) - - - insert into TB_energyEfficiency_electricityPrice_detail - - - id, - - - insdt, - - - insuser, - - - bizid, - - - company, - - - diantype, - - - voltagelevel, - - - adjustmentcontent, - - - remark, - - - start_time, - - - end_time, - - - pid, - - - dianduprice, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{company,jdbcType=VARCHAR}, - - - #{diantype,jdbcType=VARCHAR}, - - - #{voltagelevel,jdbcType=VARCHAR}, - - - #{adjustmentcontent,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{startTime,jdbcType=VARCHAR}, - - - #{endTime,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{dianduprice,jdbcType=DOUBLE}, - - - - - update TB_energyEfficiency_electricityPrice_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - company = #{company,jdbcType=VARCHAR}, - - - diantype = #{diantype,jdbcType=VARCHAR}, - - - voltagelevel = #{voltagelevel,jdbcType=VARCHAR}, - - - adjustmentcontent = #{adjustmentcontent,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - start_time = #{startTime,jdbcType=VARCHAR}, - - - end_time = #{endTime,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - dianduprice = #{dianduprice,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_energyEfficiency_electricityPrice_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - company = #{company,jdbcType=VARCHAR}, - diantype = #{diantype,jdbcType=VARCHAR}, - voltagelevel = #{voltagelevel,jdbcType=VARCHAR}, - adjustmentcontent = #{adjustmentcontent,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - start_time = #{startTime,jdbcType=VARCHAR}, - end_time = #{endTime,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - dianduprice = #{dianduprice,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_energyEfficiency_electricityPrice_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/ElectricityPriceMapper.xml b/src/com/sipai/mapper/timeefficiency/ElectricityPriceMapper.xml deleted file mode 100644 index 0272adfa..00000000 --- a/src/com/sipai/mapper/timeefficiency/ElectricityPriceMapper.xml +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, bizid, company, diantype, voltagelevel, dianduprice, peakprice, - heightprice, sectionprice, troughprice, basicprice, transformerJFcapacity, transformernumber, - transformerALLcapacity, basictariff, adjustmentcontent, remark, purpose, stop_time - - - - delete from TB_energyEfficiency_electricityPrice - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_energyEfficiency_electricityPrice (id, insdt, insuser, - bizid, company, diantype, - voltagelevel, dianduprice, peakprice, - heightprice, sectionprice, troughprice, - basicprice, transformerJFcapacity, transformernumber, - transformerALLcapacity, basictariff, adjustmentcontent, - remark, purpose, stop_time - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{diantype,jdbcType=VARCHAR}, - #{voltagelevel,jdbcType=VARCHAR}, #{dianduprice,jdbcType=DOUBLE}, #{peakprice,jdbcType=DOUBLE}, - #{heightprice,jdbcType=DOUBLE}, #{sectionprice,jdbcType=DOUBLE}, #{troughprice,jdbcType=DOUBLE}, - #{basicprice,jdbcType=DOUBLE}, #{transformerjfcapacity,jdbcType=DOUBLE}, #{transformernumber,jdbcType=DOUBLE}, - #{transformerallcapacity,jdbcType=DOUBLE}, #{basictariff,jdbcType=DOUBLE}, #{adjustmentcontent,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{purpose,jdbcType=VARCHAR}, #{stopTime,jdbcType=TIMESTAMP} - ) - - - insert into TB_energyEfficiency_electricityPrice - - - id, - - - insdt, - - - insuser, - - - bizid, - - - company, - - - diantype, - - - voltagelevel, - - - dianduprice, - - - peakprice, - - - heightprice, - - - sectionprice, - - - troughprice, - - - basicprice, - - - transformerJFcapacity, - - - transformernumber, - - - transformerALLcapacity, - - - basictariff, - - - adjustmentcontent, - - - remark, - - - purpose, - - - stop_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{company,jdbcType=VARCHAR}, - - - #{diantype,jdbcType=VARCHAR}, - - - #{voltagelevel,jdbcType=VARCHAR}, - - - #{dianduprice,jdbcType=DOUBLE}, - - - #{peakprice,jdbcType=DOUBLE}, - - - #{heightprice,jdbcType=DOUBLE}, - - - #{sectionprice,jdbcType=DOUBLE}, - - - #{troughprice,jdbcType=DOUBLE}, - - - #{basicprice,jdbcType=DOUBLE}, - - - #{transformerjfcapacity,jdbcType=DOUBLE}, - - - #{transformernumber,jdbcType=DOUBLE}, - - - #{transformerallcapacity,jdbcType=DOUBLE}, - - - #{basictariff,jdbcType=DOUBLE}, - - - #{adjustmentcontent,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{purpose,jdbcType=VARCHAR}, - - - #{stopTime,jdbcType=TIMESTAMP}, - - - - - update TB_energyEfficiency_electricityPrice - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - company = #{company,jdbcType=VARCHAR}, - - - diantype = #{diantype,jdbcType=VARCHAR}, - - - voltagelevel = #{voltagelevel,jdbcType=VARCHAR}, - - - dianduprice = #{dianduprice,jdbcType=DOUBLE}, - - - peakprice = #{peakprice,jdbcType=DOUBLE}, - - - heightprice = #{heightprice,jdbcType=DOUBLE}, - - - sectionprice = #{sectionprice,jdbcType=DOUBLE}, - - - troughprice = #{troughprice,jdbcType=DOUBLE}, - - - basicprice = #{basicprice,jdbcType=DOUBLE}, - - - transformerJFcapacity = #{transformerjfcapacity,jdbcType=DOUBLE}, - - - transformernumber = #{transformernumber,jdbcType=DOUBLE}, - - - transformerALLcapacity = #{transformerallcapacity,jdbcType=DOUBLE}, - - - basictariff = #{basictariff,jdbcType=DOUBLE}, - - - adjustmentcontent = #{adjustmentcontent,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - purpose = #{purpose,jdbcType=VARCHAR}, - - - stop_time = #{stopTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_energyEfficiency_electricityPrice - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - company = #{company,jdbcType=VARCHAR}, - diantype = #{diantype,jdbcType=VARCHAR}, - voltagelevel = #{voltagelevel,jdbcType=VARCHAR}, - dianduprice = #{dianduprice,jdbcType=DOUBLE}, - peakprice = #{peakprice,jdbcType=DOUBLE}, - heightprice = #{heightprice,jdbcType=DOUBLE}, - sectionprice = #{sectionprice,jdbcType=DOUBLE}, - troughprice = #{troughprice,jdbcType=DOUBLE}, - basicprice = #{basicprice,jdbcType=DOUBLE}, - transformerJFcapacity = #{transformerjfcapacity,jdbcType=DOUBLE}, - transformernumber = #{transformernumber,jdbcType=DOUBLE}, - transformerALLcapacity = #{transformerallcapacity,jdbcType=DOUBLE}, - basictariff = #{basictariff,jdbcType=DOUBLE}, - adjustmentcontent = #{adjustmentcontent,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - purpose = #{purpose,jdbcType=VARCHAR}, - stop_time = #{stopTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_energyEfficiency_electricityPrice - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolAreaFloorMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolAreaFloorMapper.xml deleted file mode 100644 index 47576918..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolAreaFloorMapper.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - id, patrol_area_id,unit_id, insdt, insuser, name, floor,morder - - - pic - - - - delete from TB_TimeEfficiency_PatrolArea_Floor - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolArea_Floor (id, patrol_area_id,unit_id, insdt, - insuser, name, floor, morder, - pic) - values (#{id,jdbcType=VARCHAR}, #{patrolAreaId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR},#{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{floor,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{pic,jdbcType=BLOB}) - - - insert into TB_TimeEfficiency_PatrolArea_Floor - - - id, - - - patrol_area_id, - - - unit_id, - - - insdt, - - - insuser, - - - name, - - - floor, - - - morder, - - - pic, - - - - - #{id,jdbcType=VARCHAR}, - - - #{patrolAreaId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{floor,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{pic,jdbcType=BLOB}, - - - - - update TB_TimeEfficiency_PatrolArea_Floor - - - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - floor = #{floor,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - pic = #{pic,jdbcType=BLOB}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolArea_Floor - set patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - floor = #{floor,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - pic = #{pic,jdbcType=BLOB} - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolArea_Floor - set patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - floor = #{floor,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolArea_Floor - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolAreaMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolAreaMapper.xml deleted file mode 100644 index a20df645..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolAreaMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, remark, name, biz_id - - - - delete from TB_TimeEfficiency_PatrolArea - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolArea (id, insuser, insdt, - remark, name, biz_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolArea - - - id, - - - insuser, - - - insdt, - - - remark, - - - name, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolArea - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolArea - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolArea - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolAreaProcessSectionMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolAreaProcessSectionMapper.xml deleted file mode 100644 index d5b8c9b6..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolAreaProcessSectionMapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - id, insuser, insdt, process_section_id, patrol_area_id - - - - delete from TB_TimeEfficiency_PatrolArea_ProcessSection - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolArea_ProcessSection (id, insuser, insdt, - process_section_id, patrol_area_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{processSectionId,jdbcType=VARCHAR}, #{patrolAreaId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolArea_ProcessSection - - - id, - - - insuser, - - - insdt, - - - process_section_id, - - - patrol_area_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{patrolAreaId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolArea_ProcessSection - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolArea_ProcessSection - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolArea_ProcessSection - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolAreaUserMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolAreaUserMapper.xml deleted file mode 100644 index fe852411..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolAreaUserMapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, patrol_area_id, morder ,user_id - - - - delete from TB_TimeEfficiency_PatrolArea_User - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolArea_User (id, insuser, insdt, - patrol_area_id, morder, user_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{patrolAreaId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolArea_User - - - id, - - - insuser, - - - insdt, - - - patrol_area_id, - - - morder, - - - user_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{patrolAreaId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{userId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolArea_User - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolArea_User - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - user_id = #{userId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolArea_User - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolContentsMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolContentsMapper.xml deleted file mode 100644 index 9c637dcb..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolContentsMapper.xml +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, code, contents, contentsDetail, pid, memo, rank, insuser, insdt, biz_id, unit_id, relation_type, - patrol_contents_type, patrol_rank, tool, method, safe_note, morder - - - - delete from TB_TimeEfficiency_PatrolContents - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolContents (id, code, contents, contentsDetail, - pid, memo, rank, insuser, - insdt, biz_id, unit_id, - relation_type, patrol_contents_type, patrol_rank, - tool, method, safe_note, - morder) - values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},#{contents,jdbcType=VARCHAR}, #{contentsDetail,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, #{rank,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{bizId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{relationType,jdbcType=VARCHAR}, #{patrolContentsType,jdbcType=VARCHAR}, #{patrolRank,jdbcType=VARCHAR}, - #{tool,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{safeNote,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into TB_TimeEfficiency_PatrolContents - - - id, - - - code, - - - contents, - - - contentsDetail, - - - pid, - - - memo, - - - rank, - - - insuser, - - - insdt, - - - biz_id, - - - unit_id, - - - relation_type, - - - patrol_contents_type, - - - patrol_rank, - - - tool, - - - method, - - - safe_note, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{contentsDetail,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{rank,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{relationType,jdbcType=VARCHAR}, - - - #{patrolContentsType,jdbcType=VARCHAR}, - - - #{patrolRank,jdbcType=VARCHAR}, - - - #{tool,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - #{safeNote,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolContents - - - code = #{code,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - contentsDetail = #{contentsDetail,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - rank = #{rank,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - relation_type = #{relationType,jdbcType=VARCHAR}, - - - patrol_contents_type = #{patrolContentsType,jdbcType=VARCHAR}, - - - patrol_rank = #{patrolRank,jdbcType=VARCHAR}, - - - tool = #{tool,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - safe_note = #{safeNote,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolContents - set code = #{code,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - contentsDetail = #{contentsDetail,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - rank = #{rank,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - relation_type = #{relationType,jdbcType=VARCHAR}, - patrol_contents_type = #{patrolContentsType,jdbcType=VARCHAR}, - patrol_rank = #{patrolRank,jdbcType=VARCHAR}, - tool = #{tool,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR}, - safe_note = #{safeNote,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_TimeEfficiency_PatrolContents - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolContentsPlanMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolContentsPlanMapper.xml deleted file mode 100644 index cbab5500..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolContentsPlanMapper.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_plan_id, patrol_contents_id, patrol_point_id, plan_point_id, - equipment_id, type - - - - delete from TB_TimeEfficiency_PatrolPlan_PatrolContents - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolContents (id, insdt, insuser, - patrol_plan_id, patrol_contents_id, patrol_point_id, - plan_point_id, equipment_id, type - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPlanId,jdbcType=VARCHAR}, #{patrolContentsId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, - #{planPointId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR} - ) - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolContents - - - id, - - - insdt, - - - insuser, - - - patrol_plan_id, - - - patrol_contents_id, - - - patrol_point_id, - - - plan_point_id, - - - equipment_id, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{patrolContentsId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{planPointId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlan_PatrolContents - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - patrol_contents_id = #{patrolContentsId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - plan_point_id = #{planPointId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_PatrolContents - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - patrol_contents_id = #{patrolContentsId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - plan_point_id = #{planPointId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_PatrolContents - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolContentsRecordMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolContentsRecordMapper.xml deleted file mode 100644 index 7aa68365..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolContentsRecordMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_point_id, patrol_record_id, equipment_id, pid, completeuser, - completedt, status, contents, contentsDetail, type - - - - delete from TB_TimeEfficiency_PatrolRecord_PatrolContents - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolContents (id, insdt, insuser, - patrol_point_id, patrol_record_id, equipment_id, - pid, completeuser, completedt, - status, contents, contentsDetail, - type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPointId,jdbcType=VARCHAR}, #{patrolRecordId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{completeuser,jdbcType=VARCHAR}, #{completedt,jdbcType=TIMESTAMP}, - #{status,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, #{contentsdetail,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolContents - - - id, - - - insdt, - - - insuser, - - - patrol_point_id, - - - patrol_record_id, - - - equipment_id, - - - pid, - - - completeuser, - - - completedt, - - - status, - - - contents, - - - contentsDetail, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{completeuser,jdbcType=VARCHAR}, - - - #{completedt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{contentsdetail,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolRecord_PatrolContents - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - completeuser = #{completeuser,jdbcType=VARCHAR}, - - - completedt = #{completedt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - contentsDetail = #{contentsdetail,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_PatrolContents - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - completeuser = #{completeuser,jdbcType=VARCHAR}, - completedt = #{completedt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - contentsDetail = #{contentsdetail,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_PatrolContents - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolContentsStandardMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolContentsStandardMapper.xml deleted file mode 100644 index 008ffe18..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolContentsStandardMapper.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, code, contents, name, pid, tool, method, safe_note, patrol_rank, unit_id, - memo, morder, upduser, upddt - - - - delete from TB_TimeEfficiency_PatrolContents_Standard - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolContents_Standard (id, contents,code, name, - pid, tool, method, - safe_note, patrol_rank, unit_id, - memo, morder, upduser, - upddt) - values (#{id,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{tool,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, - #{safeNote,jdbcType=VARCHAR}, #{patrolRank,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{memo,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{upduser,jdbcType=VARCHAR}, - #{upddt,jdbcType=TIMESTAMP}) - - - insert into TB_TimeEfficiency_PatrolContents_Standard - - - id, - - - contents, - - - code, - - - name, - - - pid, - - - tool, - - - method, - - - safe_note, - - - patrol_rank, - - - unit_id, - - - memo, - - - morder, - - - upduser, - - - upddt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{tool,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - #{safeNote,jdbcType=VARCHAR}, - - - #{patrolRank,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{memo,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{upduser,jdbcType=VARCHAR}, - - - #{upddt,jdbcType=TIMESTAMP}, - - - - - update TB_TimeEfficiency_PatrolContents_Standard - - - contents = #{contents,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - tool = #{tool,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - safe_note = #{safeNote,jdbcType=VARCHAR}, - - - patrol_rank = #{patrolRank,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - upduser = #{upduser,jdbcType=VARCHAR}, - - - upddt = #{upddt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolContents_Standard - set contents = #{contents,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - tool = #{tool,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR}, - safe_note = #{safeNote,jdbcType=VARCHAR}, - patrol_rank = #{patrolRank,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - memo = #{memo,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - upduser = #{upduser,jdbcType=VARCHAR}, - upddt = #{upddt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolContents_Standard - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolMeasurePointPlanMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolMeasurePointPlanMapper.xml deleted file mode 100644 index 542ef7e6..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolMeasurePointPlanMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, insuser, insdt, measure_point_id, patrol_point_id, patrol_plan_id, pid, equipment_id, - type - - - - delete from TB_TimeEfficiency_PatrolPlan_MeasurePoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_MeasurePoint (id, insuser, insdt, - measure_point_id, patrol_point_id, patrol_plan_id, - pid, equipment_id, type) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{measurePointId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, #{patrolPlanId,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPlan_MeasurePoint - - - id, - - - insuser, - - - insdt, - - - measure_point_id, - - - patrol_point_id, - - - patrol_plan_id, - - - pid, - - - equipment_id, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{measurePointId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlan_MeasurePoint - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_MeasurePoint - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_MeasurePoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolMeasurePointRecordMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolMeasurePointRecordMapper.xml deleted file mode 100644 index b5ba2f5e..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolMeasurePointRecordMapper.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insuser, insdt, measure_point_id, patrol_point_id, patrol_record_id, pid, status, - equipment_id, type, reservedfields3, mpvalue - - - - delete from TB_TimeEfficiency_PatrolRecord_MeasurePoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_MeasurePoint (id, insuser, insdt, - measure_point_id, patrol_point_id, patrol_record_id, - pid, status, equipment_id, - type, reservedfields3, mpvalue - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{measurePointId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, #{patrolRecordId,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{reservedfields3,jdbcType=VARCHAR}, #{mpvalue,jdbcType=VARCHAR} - ) - - - insert into TB_TimeEfficiency_PatrolRecord_MeasurePoint - - - id, - - - insuser, - - - insdt, - - - measure_point_id, - - - patrol_point_id, - - - patrol_record_id, - - - pid, - - - status, - - - equipment_id, - - - type, - - - reservedfields3, - - - mpvalue, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{measurePointId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{reservedfields3,jdbcType=VARCHAR}, - - - #{mpvalue,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolRecord_MeasurePoint - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - reservedfields3 = #{reservedfields3,jdbcType=VARCHAR}, - - - mpvalue = #{mpvalue,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_MeasurePoint - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - reservedfields3 = #{reservedfields3,jdbcType=VARCHAR}, - mpvalue = #{mpvalue,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_MeasurePoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolModelMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolModelMapper.xml deleted file mode 100644 index 76bf638a..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolModelMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, name, biz_id, type, default_flag, insdt, insuser, active, unit_id - - - - delete from TB_TimeEfficiency_PatrolModel - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolModel (id, name, biz_id, - type, default_flag, insdt, - insuser, active,unit_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{defaultFlag,jdbcType=BIT}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolModel - - - id, - - - name, - - - biz_id, - - - type, - - - default_flag, - - - insdt, - - - insuser, - - - active, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{defaultFlag,jdbcType=BIT}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolModel - - - name = #{name,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - default_flag = #{defaultFlag,jdbcType=BIT}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolModel - set name = #{name,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - default_flag = #{defaultFlag,jdbcType=BIT}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolModel - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPlanDeptMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPlanDeptMapper.xml deleted file mode 100644 index 46b7376e..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPlanDeptMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, patrol_plan_id, dept_id - - - - delete from TB_TimeEfficiency_PatrolPlan_Dept - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_Dept (id, insdt, insuser, - patrol_plan_id, dept_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPlanId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPlan_Dept - - - id, - - - insdt, - - - insuser, - - - patrol_plan_id, - - - dept_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlan_Dept - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_Dept - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_Dept - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPlanMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPlanMapper.xml deleted file mode 100644 index b3730085..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPlanMapper.xml +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, biz_id, patrol_area_id, name, patrol_content, insdt, insuser, sdt, edt, duration, - time_interval, morder, active, type, patrol_model_id, color, release_modal, unit_id, - group_type_id, advance_day, is_holiday, is_pictures, week_interval, month_interval, - year_interval, week_register, month_register, year_register, task_type, last_issuance_date, plan_issuance_date, active_date - - - - delete from TB_TimeEfficiency_PatrolPlan - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan (id, biz_id, patrol_area_id, - name, patrol_content, insdt, - insuser, sdt, edt, - duration, time_interval, morder, - active, type, patrol_model_id, - color, release_modal, unit_id, - group_type_id, advance_day, is_holiday, - is_pictures, week_interval, month_interval, - year_interval, week_register, month_register, - year_register, task_type, last_issuance_date, plan_issuance_date,active_date) - values (#{id,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{patrolAreaId,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{patrolContent,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{sdt,jdbcType=TIMESTAMP}, #{edt,jdbcType=TIMESTAMP}, - #{duration,jdbcType=INTEGER}, #{timeInterval,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{patrolModelId,jdbcType=VARCHAR}, - #{color,jdbcType=VARCHAR}, #{releaseModal,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{groupTypeId,jdbcType=VARCHAR}, #{advanceDay,jdbcType=INTEGER}, #{isHoliday,jdbcType=CHAR}, - #{isPictures,jdbcType=CHAR}, #{weekInterval,jdbcType=INTEGER}, #{monthInterval,jdbcType=INTEGER}, - #{yearInterval,jdbcType=INTEGER}, #{weekRegister,jdbcType=VARCHAR}, #{monthRegister,jdbcType=VARCHAR}, - #{yearRegister,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, #{lastIssuanceDate,jdbcType=VARCHAR}, #{planIssuanceDate,jdbcType=VARCHAR}, #{activeDate,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPlan - - - id, - - - biz_id, - - - patrol_area_id, - - - name, - - - patrol_content, - - - insdt, - - - insuser, - - - sdt, - - - edt, - - - duration, - - - time_interval, - - - morder, - - - active, - - - type, - - - patrol_model_id, - - - color, - - - release_modal, - - - unit_id, - - - group_type_id, - - - advance_day, - - - is_holiday, - - - is_pictures, - - - week_interval, - - - month_interval, - - - year_interval, - - - week_register, - - - month_register, - - - year_register, - - - task_type, - - - last_issuance_date, - - - plan_issuance_date, - - - active_date, - - - - - #{id,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{patrolAreaId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{patrolContent,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{duration,jdbcType=INTEGER}, - - - #{timeInterval,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=BIT}, - - - #{type,jdbcType=VARCHAR}, - - - #{patrolModelId,jdbcType=VARCHAR}, - - - #{color,jdbcType=VARCHAR}, - - - #{releaseModal,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{groupTypeId,jdbcType=VARCHAR}, - - - #{advanceDay,jdbcType=INTEGER}, - - - #{isHoliday,jdbcType=CHAR}, - - - #{isPictures,jdbcType=CHAR}, - - - #{weekInterval,jdbcType=INTEGER}, - - - #{monthInterval,jdbcType=INTEGER}, - - - #{yearInterval,jdbcType=INTEGER}, - - - #{weekRegister,jdbcType=VARCHAR}, - - - #{monthRegister,jdbcType=VARCHAR}, - - - #{yearRegister,jdbcType=VARCHAR}, - - - #{taskType,jdbcType=VARCHAR}, - - - #{lastIssuanceDate,jdbcType=VARCHAR}, - - - #{planIssuanceDate,jdbcType=VARCHAR}, - - - #{activeDate,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlan - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - patrol_content = #{patrolContent,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - duration = #{duration,jdbcType=INTEGER}, - - - time_interval = #{timeInterval,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=BIT}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_model_id = #{patrolModelId,jdbcType=VARCHAR}, - - - color = #{color,jdbcType=VARCHAR}, - - - release_modal = #{releaseModal,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - group_type_id = #{groupTypeId,jdbcType=VARCHAR}, - - - advance_day = #{advanceDay,jdbcType=INTEGER}, - - - is_holiday = #{isHoliday,jdbcType=CHAR}, - - - is_pictures = #{isPictures,jdbcType=CHAR}, - - - week_interval = #{weekInterval,jdbcType=INTEGER}, - - - month_interval = #{monthInterval,jdbcType=INTEGER}, - - - year_interval = #{yearInterval,jdbcType=INTEGER}, - - - week_register = #{weekRegister,jdbcType=VARCHAR}, - - - month_register = #{monthRegister,jdbcType=VARCHAR}, - - - year_register = #{yearRegister,jdbcType=VARCHAR}, - - - task_type = #{taskType,jdbcType=VARCHAR}, - - - last_issuance_date = #{lastIssuanceDate,jdbcType=VARCHAR}, - - - plan_issuance_date = #{planIssuanceDate,jdbcType=VARCHAR}, - - - active_date = #{activeDate,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan - set biz_id = #{bizId,jdbcType=VARCHAR}, - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - patrol_content = #{patrolContent,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - duration = #{duration,jdbcType=INTEGER}, - time_interval = #{timeInterval,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=BIT}, - type = #{type,jdbcType=VARCHAR}, - patrol_model_id = #{patrolModelId,jdbcType=VARCHAR}, - color = #{color,jdbcType=VARCHAR}, - release_modal = #{releaseModal,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - group_type_id = #{groupTypeId,jdbcType=VARCHAR}, - advance_day = #{advanceDay,jdbcType=INTEGER}, - is_holiday = #{isHoliday,jdbcType=CHAR}, - is_pictures = #{isPictures,jdbcType=CHAR}, - week_interval = #{weekInterval,jdbcType=INTEGER}, - month_interval = #{monthInterval,jdbcType=INTEGER}, - year_interval = #{yearInterval,jdbcType=INTEGER}, - week_register = #{weekRegister,jdbcType=VARCHAR}, - month_register = #{monthRegister,jdbcType=VARCHAR}, - year_register = #{yearRegister,jdbcType=VARCHAR}, - task_type = #{taskType,jdbcType=VARCHAR}, - last_issuance_date = #{lastIssuanceDate,jdbcType=VARCHAR}, - plan_issuance_date = #{planIssuanceDate,jdbcType=VARCHAR}, - active_date = #{activeDate,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolCameraMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolCameraMapper.xml deleted file mode 100644 index c024df48..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolCameraMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, patrol_plan_id, patrolPointId, cameraId, morder, type - - - - delete from TB_TimeEfficiency_PatrolPlan_PatrolCamera - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolCamera (id, insdt, insuser, - patrol_plan_id, patrolPointId, cameraId, - morder, type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPlanId,jdbcType=VARCHAR}, #{patrolpointid,jdbcType=VARCHAR}, #{cameraid,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolCamera - - - id, - - - insdt, - - - insuser, - - - patrol_plan_id, - - - patrolPointId, - - - cameraId, - - - morder, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{patrolpointid,jdbcType=VARCHAR}, - - - #{cameraid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlan_PatrolCamera - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - patrolPointId = #{patrolpointid,jdbcType=VARCHAR}, - - - cameraId = #{cameraid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_PatrolCamera - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - patrolPointId = #{patrolpointid,jdbcType=VARCHAR}, - cameraId = #{cameraid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_PatrolCamera - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolEquipmentMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolEquipmentMapper.xml deleted file mode 100644 index cb6b85ec..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolEquipmentMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, patrol_plan_id, equipment_id, patrol_point_id, morder, type - - - - delete from TB_TimeEfficiency_PatrolPlan_PatrolEquipment - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolEquipment (id, insdt, insuser, - patrol_plan_id, equipment_id, patrol_point_id, - morder, type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPlanId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolEquipment - - - id, - - - insdt, - - - insuser, - - - patrol_plan_id, - - - equipment_id, - - - patrol_point_id, - - - morder, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlan_PatrolEquipment - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_PatrolEquipment - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_PatrolEquipment - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolPointMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolPointMapper.xml deleted file mode 100644 index 5112fad4..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPlanPatrolPointMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, insdt, insuser, plan_id, patrol_point_id, morder - - - - delete from TB_TimeEfficiency_PatrolPlan_PatrolPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolPoint (id, insdt, insuser, - plan_id, patrol_point_id, morder - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{planId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER} - ) - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolPoint - - - id, - - - insdt, - - - insuser, - - - plan_id, - - - patrol_point_id, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{planId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolPlan_PatrolPoint - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_PatrolPoint - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_PatrolPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPlanRiskLevelMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPlanRiskLevelMapper.xml deleted file mode 100644 index 7c5544d4..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPlanRiskLevelMapper.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - id, insdt, insuser, plan_id, risk_level_id, morder - - - - delete from TB_TimeEfficiency_PatrolPlan_RiskLevel - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_RiskLevel (id, insdt, insuser, - plan_id, risk_level_id, morder - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{planId,jdbcType=VARCHAR}, #{riskLevelId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER} - ) - - - insert into TB_TimeEfficiency_PatrolPlan_RiskLevel - - - id, - - - insdt, - - - insuser, - - - plan_id, - - - risk_level_id, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{planId,jdbcType=VARCHAR}, - - - #{riskLevelId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolPlan_RiskLevel - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - risk_level_id = #{riskLevelId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_RiskLevel - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR}, - risk_level_id = #{riskLevelId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_RiskLevel - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPointCameraMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPointCameraMapper.xml deleted file mode 100644 index 4d047e91..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPointCameraMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insuser, insdt, camera_id, patrol_point_id - - - - delete from TB_TimeEfficiency_PatrolPoint_Camera - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPoint_Camera (id, insuser, insdt, - camera_id, patrol_point_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{cameraId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPoint_Camera - - - id, - - - insuser, - - - insdt, - - - camera_id, - - - patrol_point_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{cameraId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPoint_Camera - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - camera_id = #{cameraId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPoint_Camera - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - camera_id = #{cameraId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPoint_Camera - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPointEquipmentCardMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPointEquipmentCardMapper.xml deleted file mode 100644 index 30c5b671..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPointEquipmentCardMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, insuser, insdt, equipment_card_id, patrol_point_id - - - - delete from TB_TimeEfficiency_PatrolPoint_EquipmentCard - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPoint_EquipmentCard (id, insuser, insdt, - equipment_card_id, patrol_point_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{equipmentCardId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPoint_EquipmentCard - - - id, - - - insuser, - - - insdt, - - - equipment_card_id, - - - patrol_point_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{equipmentCardId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPoint_EquipmentCard - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPoint_EquipmentCard - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - equipment_card_id = #{equipmentCardId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPoint_EquipmentCard - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPointFileMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPointFileMapper.xml deleted file mode 100644 index 4d5233ab..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPointFileMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, patrol_point_id, file_id - - - - delete from TB_TimeEfficiency_PatrolPoint_File - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPoint_File (id, insdt, insuser, - patrol_point_id, file_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPointId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolPoint_File - - - id, - - - insdt, - - - insuser, - - - patrol_point_id, - - - file_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{fileId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPoint_File - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - file_id = #{fileId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPoint_File - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - file_id = #{fileId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPoint_File - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPointMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPointMapper.xml deleted file mode 100644 index 5cb1ad58..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPointMapper.xml +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insuser, insdt, remark, name, biz_id, process_section_id, latitude, longitude, - active, morder, modbus_fig_id, read_or_write, register, type, patrol_content,unit_id,person_num,floor_id,point_code,area_id - - - - delete - from TB_TimeEfficency_PatrolPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficency_PatrolPoint (id, insuser, insdt, - remark, name, biz_id, - process_section_id, latitude, longitude, - active, morder, modbus_fig_id, - read_or_write, register, type, - patrol_content, unit_id, person_num, floor_id,point_code,area_id) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{processSectionId,jdbcType=VARCHAR}, #{latitude,jdbcType=DECIMAL}, #{longitude,jdbcType=DECIMAL}, - #{active,jdbcType=VARCHAR}, #{morder,jdbcType=VARCHAR}, #{modbusFigId,jdbcType=VARCHAR}, - #{readOrWrite,jdbcType=VARCHAR}, #{register,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{patrolContent,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{personNum,jdbcType=INTEGER}, - #{floorId,jdbcType=VARCHAR},#{pointCode,jdbcType=VARCHAR},#{areaId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficency_PatrolPoint - - - id, - - - insuser, - - - insdt, - - - remark, - - - name, - - - biz_id, - - - process_section_id, - - - latitude, - - - longitude, - - - active, - - - morder, - - - modbus_fig_id, - - - read_or_write, - - - register, - - - type, - - - patrol_content, - - - unit_id, - - - person_num, - - - floor_id, - - - point_code, - - - area_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=VARCHAR}, - - - #{modbusFigId,jdbcType=VARCHAR}, - - - #{readOrWrite,jdbcType=VARCHAR}, - - - #{register,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{patrolContent,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{personNum,jdbcType=INTEGER}, - - - #{floorId,jdbcType=VARCHAR}, - - - #{pointCode,jdbcType=VARCHAR}, - - - #{areaId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficency_PatrolPoint - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - modbus_fig_id = #{modbusFigId,jdbcType=VARCHAR}, - - - read_or_write = #{readOrWrite,jdbcType=VARCHAR}, - - - register = #{register,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_content = #{patrolContent,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - person_num = #{personNum,jdbcType=INTEGER}, - - - floor_id = #{floorId,jdbcType=VARCHAR}, - - - point_code = #{pointCode,jdbcType=VARCHAR}, - - - area_id = #{areaId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficency_PatrolPoint - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=VARCHAR}, - modbus_fig_id = #{modbusFigId,jdbcType=VARCHAR}, - read_or_write = #{readOrWrite,jdbcType=VARCHAR}, - register = #{register,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - patrol_content = #{patrolContent,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - person_num = #{personNum,jdbcType=INTEGER}, - floor_id = #{floorId,jdbcType=VARCHAR}, - point_code = #{pointCode,jdbcType=VARCHAR}, - area_id = #{areaId,jdbcType=VARCHAR}, - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_TimeEfficency_PatrolPoint ${where} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolPointMeasurePointMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolPointMeasurePointMapper.xml deleted file mode 100644 index f69607c7..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolPointMeasurePointMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - id - , insuser, insdt, measure_point_id, patrol_point_id - - - - delete - from TB_TimeEfficency_PatrolPoint_MeasurePoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficency_PatrolPoint_MeasurePoint (id, insuser, insdt, - measure_point_id, patrol_point_id,morder) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{measurePointId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into TB_TimeEfficency_PatrolPoint_MeasurePoint - - - id, - - - insuser, - - - insdt, - - - measure_point_id, - - - patrol_point_id, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{measurePointId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficency_PatrolPoint_MeasurePoint - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficency_PatrolPoint_MeasurePoint - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - measure_point_id = #{measurePointId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_TimeEfficency_PatrolPoint_MeasurePoint ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordCollectionMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordCollectionMapper.xml deleted file mode 100644 index 7ab4c4b1..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordCollectionMapper.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, upsdt, biz_id, total_num, comm_num, issued_num, finished_num, temp_num, - finished_rate - - - - delete from tb_TimeEfficency_PatrolRecord_Collection - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_TimeEfficency_PatrolRecord_Collection (id, insdt, upsdt, - biz_id, total_num, comm_num, - issued_num, finished_num, temp_num, - finished_rate) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{upsdt,jdbcType=TIMESTAMP}, - #{bizId,jdbcType=VARCHAR}, #{totalNum,jdbcType=INTEGER}, #{commNum,jdbcType=INTEGER}, - #{issuedNum,jdbcType=INTEGER}, #{finishedNum,jdbcType=INTEGER}, #{tempNum,jdbcType=INTEGER}, - #{finishedRate,jdbcType=VARCHAR}) - - - insert into tb_TimeEfficency_PatrolRecord_Collection - - - id, - - - insdt, - - - upsdt, - - - biz_id, - - - total_num, - - - comm_num, - - - issued_num, - - - finished_num, - - - temp_num, - - - finished_rate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{totalNum,jdbcType=INTEGER}, - - - #{commNum,jdbcType=INTEGER}, - - - #{issuedNum,jdbcType=INTEGER}, - - - #{finishedNum,jdbcType=INTEGER}, - - - #{tempNum,jdbcType=INTEGER}, - - - #{finishedRate,jdbcType=VARCHAR}, - - - - - update tb_TimeEfficency_PatrolRecord_Collection - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - total_num = #{totalNum,jdbcType=INTEGER}, - - - comm_num = #{commNum,jdbcType=INTEGER}, - - - issued_num = #{issuedNum,jdbcType=INTEGER}, - - - finished_num = #{finishedNum,jdbcType=INTEGER}, - - - temp_num = #{tempNum,jdbcType=INTEGER}, - - - finished_rate = #{finishedRate,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_TimeEfficency_PatrolRecord_Collection - set insdt = #{insdt,jdbcType=TIMESTAMP}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - total_num = #{totalNum,jdbcType=INTEGER}, - comm_num = #{commNum,jdbcType=INTEGER}, - issued_num = #{issuedNum,jdbcType=INTEGER}, - finished_num = #{finishedNum,jdbcType=INTEGER}, - temp_num = #{tempNum,jdbcType=INTEGER}, - finished_rate = #{finishedRate,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_TimeEfficency_PatrolRecord_Collection - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordDeptMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordDeptMapper.xml deleted file mode 100644 index cf064371..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordDeptMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insdt, insuser, patrol_record_id, dept_id - - - - delete from TB_TimeEfficiency_PatrolRecord_Dept - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_Dept (id, insdt, insuser, - patrol_record_id, dept_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolRecordId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolRecord_Dept - - - id, - - - insdt, - - - insuser, - - - patrol_record_id, - - - dept_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolRecord_Dept - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_Dept - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_Dept - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordMapper.xml deleted file mode 100644 index 7ebfbdee..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordMapper.xml +++ /dev/null @@ -1,399 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, biz_id, patrol_area_id, name, content, start_time, end_time, - act_finish_time, patrol_plan_id, worker_id, work_result, status, type, patrol_model_id, unit_id,duration,point_num_all,point_num_finish,processDefId,processId,receive_user_id, - advance_day,task_type,release_modal,is_pictures,group_type_id - - - - delete - from TB_TimeEfficiency_PatrolRecord - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord (id, insdt, insuser, - biz_id, patrol_area_id, name, - content, start_time, end_time, - act_finish_time, patrol_plan_id, worker_id, - work_result, status, type, - patrol_model_id, unit_id, duration, point_num_all, - point_num_finish,processDefId,processId,receive_user_id, - advance_day,task_type,release_modal,is_pictures,group_type_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{patrolAreaId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{content,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, - #{actFinishTime,jdbcType=TIMESTAMP}, #{patrolPlanId,jdbcType=VARCHAR}, #{workerId,jdbcType=VARCHAR}, - #{workResult,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{patrolModelId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{duration,jdbcType=INTEGER}, - #{pointNumAll,jdbcType=INTEGER}, #{pointNumFinish,jdbcType=INTEGER}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, - #{advanceDay,jdbcType=INTEGER}, #{taskType,jdbcType=VARCHAR}, #{releaseModal,jdbcType=VARCHAR}, - #{isPictures,jdbcType=CHAR},#{groupTypeId,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_PatrolRecord - - - id, - - - insdt, - - - insuser, - - - biz_id, - - - patrol_area_id, - - - name, - - - content, - - - start_time, - - - end_time, - - - act_finish_time, - - - patrol_plan_id, - - - worker_id, - - - work_result, - - - status, - - - type, - - - patrol_model_id, - - - unit_id, - - - duration, - - - point_num_all, - - - point_num_finish, - - - processDefId, - - - processId, - - - receive_user_id, - - - is_pictures, - - - group_type_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{patrolAreaId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{content,jdbcType=VARCHAR}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{endTime,jdbcType=TIMESTAMP}, - - - #{actFinishTime,jdbcType=TIMESTAMP}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{workerId,jdbcType=VARCHAR}, - - - #{workResult,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{patrolModelId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{duration,jdbcType=INTEGER}, - - - #{pointNumAll,jdbcType=INTEGER}, - - - #{pointNumAll,jdbcType=INTEGER}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{isPictures,jdbcType=CHAR}, - - - #{groupTypeId,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolRecord - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=VARCHAR}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - end_time = #{endTime,jdbcType=TIMESTAMP}, - - - act_finish_time = #{actFinishTime,jdbcType=TIMESTAMP}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - worker_id = #{workerId,jdbcType=VARCHAR}, - - - work_result = #{workResult,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_model_id = #{patrolModelId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - duration = #{duration,jdbcType=INTEGER}, - - - point_num_all = #{pointNumAll,jdbcType=INTEGER}, - - - point_num_finish = #{pointNumFinish,jdbcType=INTEGER}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - is_pictures = #{isPictures,jdbcType=CHAR}, - - - group_type_id = #{groupTypeId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - patrol_area_id = #{patrolAreaId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - content = #{content,jdbcType=VARCHAR}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - act_finish_time = #{actFinishTime,jdbcType=TIMESTAMP}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - worker_id = #{workerId,jdbcType=VARCHAR}, - work_result = #{workResult,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - patrol_model_id = #{patrolModelId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - duration = #{duration,jdbcType=INTEGER}, - point_num_all = #{pointNumAll,jdbcType=INTEGER}, - point_num_finish = #{pointNumFinish,jdbcType=INTEGER} - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - is_pictures = #{isPictures,jdbcType=CHAR}, - group_type_id = #{groupTypeId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from TB_TimeEfficiency_PatrolRecord ${where} - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolCameraMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolCameraMapper.xml deleted file mode 100644 index f395d9c8..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolCameraMapper.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, patrolRecordId, cameraId, updateuser, updatedt, status, remark, - type, morder, allNumContent, allNumMeasurePoint, finishNumContent, finishNumMeasurePoint, - abnormityNum - - - - delete from TB_TimeEfficiency_PatrolRecord_PatrolCamera - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolCamera (id, insdt, insuser, - patrolRecordId, cameraId, updateuser, - updatedt, status, remark, - type, morder, allNumContent, - allNumMeasurePoint, finishNumContent, finishNumMeasurePoint, - abnormityNum) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolrecordid,jdbcType=VARCHAR}, #{cameraid,jdbcType=VARCHAR}, #{updateuser,jdbcType=VARCHAR}, - #{updatedt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{allnumcontent,jdbcType=INTEGER}, - #{allnummeasurepoint,jdbcType=INTEGER}, #{finishnumcontent,jdbcType=INTEGER}, #{finishnummeasurepoint,jdbcType=INTEGER}, - #{abnormitynum,jdbcType=INTEGER}) - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolCamera - - - id, - - - insdt, - - - insuser, - - - patrolRecordId, - - - cameraId, - - - updateuser, - - - updatedt, - - - status, - - - remark, - - - type, - - - morder, - - - allNumContent, - - - allNumMeasurePoint, - - - finishNumContent, - - - finishNumMeasurePoint, - - - abnormityNum, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolrecordid,jdbcType=VARCHAR}, - - - #{cameraid,jdbcType=VARCHAR}, - - - #{updateuser,jdbcType=VARCHAR}, - - - #{updatedt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{allnumcontent,jdbcType=INTEGER}, - - - #{allnummeasurepoint,jdbcType=INTEGER}, - - - #{finishnumcontent,jdbcType=INTEGER}, - - - #{finishnummeasurepoint,jdbcType=INTEGER}, - - - #{abnormitynum,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolRecord_PatrolCamera - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrolRecordId = #{patrolrecordid,jdbcType=VARCHAR}, - - - cameraId = #{cameraid,jdbcType=VARCHAR}, - - - updateuser = #{updateuser,jdbcType=VARCHAR}, - - - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - allNumContent = #{allnumcontent,jdbcType=INTEGER}, - - - allNumMeasurePoint = #{allnummeasurepoint,jdbcType=INTEGER}, - - - finishNumContent = #{finishnumcontent,jdbcType=INTEGER}, - - - finishNumMeasurePoint = #{finishnummeasurepoint,jdbcType=INTEGER}, - - - abnormityNum = #{abnormitynum,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_PatrolCamera - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrolRecordId = #{patrolrecordid,jdbcType=VARCHAR}, - cameraId = #{cameraid,jdbcType=VARCHAR}, - updateuser = #{updateuser,jdbcType=VARCHAR}, - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - allNumContent = #{allnumcontent,jdbcType=INTEGER}, - allNumMeasurePoint = #{allnummeasurepoint,jdbcType=INTEGER}, - finishNumContent = #{finishnumcontent,jdbcType=INTEGER}, - finishNumMeasurePoint = #{finishnummeasurepoint,jdbcType=INTEGER}, - abnormityNum = #{abnormitynum,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_PatrolCamera - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolEquipmentMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolEquipmentMapper.xml deleted file mode 100644 index db6d11c3..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolEquipmentMapper.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_record_id, patrol_point_id, equipment_id, updateuser, - updatedt, status, latitude, longitude, running_status, equipment_status, remark, - type,morder - - - - delete from TB_TimeEfficiency_PatrolRecord_PatrolEquipment - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolEquipment (id, insdt, insuser, - patrol_record_id, patrol_point_id, equipment_id, - updateuser, updatedt, status, - latitude, longitude, running_status, - equipment_status, remark, type,morder - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolRecordId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, - #{updateuser,jdbcType=VARCHAR}, #{updatedt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, - #{latitude,jdbcType=DECIMAL}, #{longitude,jdbcType=DECIMAL}, #{runningStatus,jdbcType=VARCHAR}, - #{equipmentStatus,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER} - ) - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolEquipment - - - id, - - - insdt, - - - insuser, - - - patrol_record_id, - - - patrol_point_id, - - - equipment_id, - - - updateuser, - - - updatedt, - - - status, - - - latitude, - - - longitude, - - - running_status, - - - equipment_status, - - - remark, - - - type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{updateuser,jdbcType=VARCHAR}, - - - #{updatedt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{runningStatus,jdbcType=VARCHAR}, - - - #{equipmentStatus,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolRecord_PatrolEquipment - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - updateuser = #{updateuser,jdbcType=VARCHAR}, - - - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - running_status = #{runningStatus,jdbcType=VARCHAR}, - - - equipment_status = #{equipmentStatus,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_PatrolEquipment - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - updateuser = #{updateuser,jdbcType=VARCHAR}, - updatedt = #{updatedt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL}, - running_status = #{runningStatus,jdbcType=VARCHAR}, - equipment_status = #{equipmentStatus,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_PatrolEquipment - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolPointMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolPointMapper.xml deleted file mode 100644 index fc08ad9f..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolPointMapper.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_record_id, patrol_point_id, worker_id, finishdt, status, - latitude, longitude - - - - delete from TB_TimeEfficiency_PatrolRecord_PatrolPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolPoint (id, insdt, insuser, - patrol_record_id, patrol_point_id, worker_id, - finishdt, status, latitude, - longitude) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolRecordId,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, #{workerId,jdbcType=VARCHAR}, - #{finishdt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{latitude,jdbcType=DECIMAL}, - #{longitude,jdbcType=DECIMAL}) - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolPoint - - - id, - - - insdt, - - - insuser, - - - patrol_record_id, - - - patrol_point_id, - - - worker_id, - - - finishdt, - - - status, - - - latitude, - - - longitude, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{workerId,jdbcType=VARCHAR}, - - - #{finishdt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - - - update TB_TimeEfficiency_PatrolRecord_PatrolPoint - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - worker_id = #{workerId,jdbcType=VARCHAR}, - - - finishdt = #{finishdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_PatrolPoint - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - worker_id = #{workerId,jdbcType=VARCHAR}, - finishdt = #{finishdt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_PatrolPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolRouteMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolRouteMapper.xml deleted file mode 100644 index 7272df55..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordPatrolRouteMapper.xml +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_record_id, floor_id, patrol_route_id, previous_id, next_id, previous_id_actual, next_id_actual, - type, patrol_point_id, posx, posy, container_width, container_height, worker_id, - finishdt, status, remark, latitude, longitude, morder ,finish_num_content,all_num_content, - finish_num_measurePoint,all_num_measurePoint - - - - - delete from TB_TimeEfficiency_PatrolRecord_PatrolRoute - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolRoute (id, insdt, insuser, - patrol_record_id, floor_id, patrol_route_id, - previous_id, next_id, type, - patrol_point_id, posx, posy, - container_width, container_height, worker_id, - finishdt, status, remark, latitude, - longitude, morder ,finish_num_content, all_num_content, - finish_num_measurePoint, all_num_measurePoint) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolRecordId,jdbcType=VARCHAR}, #{floorId,jdbcType=VARCHAR}, #{patrolRouteId,jdbcType=VARCHAR}, - #{previousId,jdbcType=VARCHAR}, #{nextId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{patrolPointId,jdbcType=VARCHAR}, #{posx,jdbcType=DECIMAL}, #{posy,jdbcType=DECIMAL}, - #{containerWidth,jdbcType=DECIMAL}, #{containerHeight,jdbcType=DECIMAL}, #{workerId,jdbcType=VARCHAR}, - #{finishdt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{latitude,jdbcType=DECIMAL}, - #{longitude,jdbcType=DECIMAL},#{morder,jdbcType=INTEGER},#{finishNumContent,jdbcType=INTEGER}, - #{allNumContent,jdbcType=INTEGER},#{finishNumMeasurePoint,jdbcType=INTEGER},#{allNumMeasurePoint,jdbcType=INTEGER}) - - - insert into TB_TimeEfficiency_PatrolRecord_PatrolRoute - - - id, - - - insdt, - - - insuser, - - - patrol_record_id, - - - floor_id, - - - patrol_route_id, - - - previous_id, - - - next_id, - - - type, - - - patrol_point_id, - - - posx, - - - posy, - - - container_width, - - - container_height, - - - worker_id, - - - finishdt, - - - status, - - - remark, - - - latitude, - - - longitude, - - - morder, - - - finish_num_content, - - - all_num_content, - - - finish_num_measurePoint, - - - all_num_measurePoint, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{floorId,jdbcType=VARCHAR}, - - - #{patrolRouteId,jdbcType=VARCHAR}, - - - #{previousId,jdbcType=VARCHAR}, - - - #{nextId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DECIMAL}, - - - #{posy,jdbcType=DECIMAL}, - - - #{containerWidth,jdbcType=DECIMAL}, - - - #{containerHeight,jdbcType=DECIMAL}, - - - #{workerId,jdbcType=VARCHAR}, - - - #{finishdt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{morder,jdbcType=INTEGER}, - - - #{finishNumContent,jdbcType=INTEGER}, - - - #{allNumContent,jdbcType=INTEGER}, - - - #{finishNumMeasurePoint,jdbcType=INTEGER}, - - - #{allNumMeasurePoint,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolRecord_PatrolRoute - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - floor_id = #{floorId,jdbcType=VARCHAR}, - - - patrol_route_id = #{patrolRouteId,jdbcType=VARCHAR}, - - - previous_id = #{previousId,jdbcType=VARCHAR}, - - - next_id = #{nextId,jdbcType=VARCHAR}, - - - previous_id_actual = #{previousIdActual,jdbcType=VARCHAR}, - - - next_id_actual = #{nextIdActual,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DECIMAL}, - - - posy = #{posy,jdbcType=DECIMAL}, - - - container_width = #{containerWidth,jdbcType=DECIMAL}, - - - container_height = #{containerHeight,jdbcType=DECIMAL}, - - - worker_id = #{workerId,jdbcType=VARCHAR}, - - - finishdt = #{finishdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - morder = #{morder,jdbcType=INTEGER}, - - - finish_num_content = #{finishNumContent,jdbcType=INTEGER}, - - - all_num_content = #{allNumContent,jdbcType=INTEGER}, - - - finish_num_measurePoint = #{finishNumMeasurePoint,jdbcType=INTEGER}, - - - all_num_measurePoint = #{allNumMeasurePoint,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolRecord_PatrolRoute - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - floor_id = #{floorId,jdbcType=VARCHAR}, - patrol_route_id = #{patrolRouteId,jdbcType=VARCHAR}, - previous_id = #{previousId,jdbcType=VARCHAR}, - next_id = #{nextId,jdbcType=VARCHAR}, - previous_id_actual = #{previousIdActual,jdbcType=VARCHAR}, - next_id_actual = #{nextIdActual,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DECIMAL}, - posy = #{posy,jdbcType=DECIMAL}, - container_width = #{containerWidth,jdbcType=DECIMAL}, - container_height = #{containerHeight,jdbcType=DECIMAL}, - worker_id = #{workerId,jdbcType=VARCHAR}, - finishdt = #{finishdt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL}, - morder = #{morder,jdbcType=INTEGER}, - finish_num_content = #{finishNumContent,jdbcType=INTEGER}, - all_num_content = #{allNumContent,jdbcType=INTEGER}, - finish_num_measurePoint = #{finishNumMeasurePoint,jdbcType=INTEGER}, - all_num_measurePoint = #{allNumMeasurePoint,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolRecord_PatrolRoute - ${where} - - - update TB_TimeEfficiency_PatrolRecord_PatrolRoute - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - floor_id = #{floorId,jdbcType=VARCHAR}, - - - patrol_route_id = #{patrolRouteId,jdbcType=VARCHAR}, - - - previous_id = #{previousId,jdbcType=VARCHAR}, - - - next_id = #{nextId,jdbcType=VARCHAR}, - - - previous_id_actual = #{previousIdActual,jdbcType=VARCHAR}, - - - next_id_actual = #{nextIdActual,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DECIMAL}, - - - posy = #{posy,jdbcType=DECIMAL}, - - - container_width = #{containerWidth,jdbcType=DECIMAL}, - - - container_height = #{containerHeight,jdbcType=DECIMAL}, - - - worker_id = #{workerId,jdbcType=VARCHAR}, - - - finishdt = #{finishdt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - morder = #{morder,jdbcType=INTEGER}, - - - finish_num_content = #{finishNumContent,jdbcType=INTEGER}, - - - all_num_content = #{allNumContent,jdbcType=INTEGER}, - - - finish_num_measurePoint = #{finishNumMeasurePoint,jdbcType=INTEGER}, - - - all_num_measurePoint = #{allNumMeasurePoint,jdbcType=INTEGER}, - - - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRecordViolationRecordMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRecordViolationRecordMapper.xml deleted file mode 100644 index 0e61bc7d..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRecordViolationRecordMapper.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, -insdt, -insuser, -biz_id, -patrol_area_id, -name, -content, -start_time, -end_time, -act_finish_time, -patrol_plan_id, -worker_id, -work_result, -status, -type, -patrol_model_id, -color, -reason, -cycle, -dept_id - - - - - -insert into TB_TimeEfficiency_PatrolRecord_ViolationRecord -( -id, -insdt, -insuser, -biz_id, -patrol_area_id, -name, -content, -start_time, -end_time, -act_finish_time, -patrol_plan_id, -worker_id, -work_result, -status, -type, -patrol_model_id, -color, -reason, -cycle, -dept_id -) -values -( -#{id}, -#{insdt}, -#{insuser}, -#{bizId}, -#{patrolAreaId}, -#{name}, -#{content}, -#{startTime}, -#{endTime}, -#{actFinishTime}, -#{patrolPlanId}, -#{workerId}, -#{workResult}, -#{status}, -#{type}, -#{patrolModelId}, -#{color}, -#{reason}, -#{cycle}, -#{deptId} -) - - - -delete TB_TimeEfficiency_PatrolRecord_ViolationRecord where id=#{id} - - - - -update TB_TimeEfficiency_PatrolRecord_ViolationRecord - - insdt=#{insdt}, - insuser=#{insuser}, - biz_id=#{bizId}, - name=#{name}, - content=#{content}, - act_finish_time=#{actFinishTime}, - patrol_plan_id=#{patrolPlanId}, - patrol_area_id=#{patrolAreaId}, - dept_id=#{deptId}, - worker_id=#{workerId}, - patrol_model_id=#{patrolModelId}, - cycle=#{cycle}, - reason=#{reason}, - -where id=#{id} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/PatrolRouteMapper.xml b/src/com/sipai/mapper/timeefficiency/PatrolRouteMapper.xml deleted file mode 100644 index 7d041076..00000000 --- a/src/com/sipai/mapper/timeefficiency/PatrolRouteMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, patrol_plan_id, floor_id, previous_id, next_id, type, patrol_point_id, - posx, posy, container_width, container_height,morder - - - - delete from TB_TimeEfficiency_PatrolPlan_PatrolRoute - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolRoute (id, insdt, insuser, - patrol_plan_id, floor_id, previous_id, - next_id, type, patrol_point_id, - posx, posy, container_width, - container_height,morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{patrolPlanId,jdbcType=VARCHAR}, #{floorId,jdbcType=VARCHAR}, #{previousId,jdbcType=VARCHAR}, - #{nextId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{patrolPointId,jdbcType=VARCHAR}, - #{posx,jdbcType=DECIMAL}, #{posy,jdbcType=DECIMAL}, #{containerWidth,jdbcType=DECIMAL}, - #{containerHeight,jdbcType=DECIMAL},#{morder,jdbcType=INTEGER}) - - - insert into TB_TimeEfficiency_PatrolPlan_PatrolRoute - - - id, - - - insdt, - - - insuser, - - - patrol_plan_id, - - - floor_id, - - - previous_id, - - - next_id, - - - type, - - - patrol_point_id, - - - posx, - - - posy, - - - container_width, - - - container_height, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{patrolPlanId,jdbcType=VARCHAR}, - - - #{floorId,jdbcType=VARCHAR}, - - - #{previousId,jdbcType=VARCHAR}, - - - #{nextId,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DECIMAL}, - - - #{posy,jdbcType=DECIMAL}, - - - #{containerWidth,jdbcType=DECIMAL}, - - - #{containerHeight,jdbcType=DECIMAL}, - - - #{morder,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_PatrolPlan_PatrolRoute - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - - - floor_id = #{floorId,jdbcType=VARCHAR}, - - - previous_id = #{previousId,jdbcType=VARCHAR}, - - - next_id = #{nextId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DECIMAL}, - - - posy = #{posy,jdbcType=DECIMAL}, - - - container_width = #{containerWidth,jdbcType=DECIMAL}, - - - container_height = #{containerHeight,jdbcType=DECIMAL}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlan_PatrolRoute - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - patrol_plan_id = #{patrolPlanId,jdbcType=VARCHAR}, - floor_id = #{floorId,jdbcType=VARCHAR}, - previous_id = #{previousId,jdbcType=VARCHAR}, - next_id = #{nextId,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DECIMAL}, - posy = #{posy,jdbcType=DECIMAL}, - container_width = #{containerWidth,jdbcType=DECIMAL}, - container_height = #{containerHeight,jdbcType=DECIMAL}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_PatrolPlan_PatrolRoute - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/ViolationRecordCountMapper.xml b/src/com/sipai/mapper/timeefficiency/ViolationRecordCountMapper.xml deleted file mode 100644 index 050beae9..00000000 --- a/src/com/sipai/mapper/timeefficiency/ViolationRecordCountMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - id, -insdt, -insuser, -biz_id, -patrol_area_id, -name, -content, -start_time, -end_time, -act_finish_time, -patrol_plan_id, -worker_id, -work_result, -status, -type, -patrol_model_id, -color, -reason, -cycle, -dept_id - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/WorkRecordMapper.xml b/src/com/sipai/mapper/timeefficiency/WorkRecordMapper.xml deleted file mode 100644 index d19f0336..00000000 --- a/src/com/sipai/mapper/timeefficiency/WorkRecordMapper.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, status, contents, reportperson, reporttime, start_time, end_time, - working_hours, patrol_point_id, patrol_record_id, biz_id, workshop_id, reservedfields1, - reservedfields2 - - - - delete from TB_TimeEfficiency_Work_Record - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_Work_Record (id, insdt, insuser, - status, contents, reportperson, - reporttime, start_time, end_time, - working_hours, patrol_point_id, patrol_record_id, - biz_id, workshop_id, reservedfields1, - reservedfields2) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{status,jdbcType=INTEGER}, #{contents,jdbcType=VARCHAR}, #{reportperson,jdbcType=VARCHAR}, - #{reporttime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, - #{workingHours,jdbcType=DOUBLE}, #{patrolPointId,jdbcType=VARCHAR}, #{patrolRecordId,jdbcType=VARCHAR}, - #{bizId,jdbcType=VARCHAR}, #{workshopId,jdbcType=VARCHAR}, #{reservedfields1,jdbcType=VARCHAR}, - #{reservedfields2,jdbcType=VARCHAR}) - - - insert into TB_TimeEfficiency_Work_Record - - - id, - - - insdt, - - - insuser, - - - status, - - - contents, - - - reportperson, - - - reporttime, - - - start_time, - - - end_time, - - - working_hours, - - - patrol_point_id, - - - patrol_record_id, - - - biz_id, - - - workshop_id, - - - reservedfields1, - - - reservedfields2, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - #{contents,jdbcType=VARCHAR}, - - - #{reportperson,jdbcType=VARCHAR}, - - - #{reporttime,jdbcType=TIMESTAMP}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{endTime,jdbcType=TIMESTAMP}, - - - #{workingHours,jdbcType=DOUBLE}, - - - #{patrolPointId,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{workshopId,jdbcType=VARCHAR}, - - - #{reservedfields1,jdbcType=VARCHAR}, - - - #{reservedfields2,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_Work_Record - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=INTEGER}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - reportperson = #{reportperson,jdbcType=VARCHAR}, - - - reporttime = #{reporttime,jdbcType=TIMESTAMP}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - end_time = #{endTime,jdbcType=TIMESTAMP}, - - - working_hours = #{workingHours,jdbcType=DOUBLE}, - - - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - workshop_id = #{workshopId,jdbcType=VARCHAR}, - - - reservedfields1 = #{reservedfields1,jdbcType=VARCHAR}, - - - reservedfields2 = #{reservedfields2,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_Work_Record - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - status = #{status,jdbcType=INTEGER}, - contents = #{contents,jdbcType=VARCHAR}, - reportperson = #{reportperson,jdbcType=VARCHAR}, - reporttime = #{reporttime,jdbcType=TIMESTAMP}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - working_hours = #{workingHours,jdbcType=DOUBLE}, - patrol_point_id = #{patrolPointId,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - workshop_id = #{workshopId,jdbcType=VARCHAR}, - reservedfields1 = #{reservedfields1,jdbcType=VARCHAR}, - reservedfields2 = #{reservedfields2,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_TimeEfficiency_Work_Record - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/WorkerPositionMapper.xml b/src/com/sipai/mapper/timeefficiency/WorkerPositionMapper.xml deleted file mode 100644 index 1805b763..00000000 --- a/src/com/sipai/mapper/timeefficiency/WorkerPositionMapper.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, latitude, longitude, biz_id, patrol_record_id, type - - - - delete from TB_TimeEfficiency_Worker_Position - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_Worker_Position (id, insdt, insuser, - latitude, longitude, biz_id, - patrol_record_id, type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{latitude,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{patrolRecordId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}) - - - insert into TB_TimeEfficiency_Worker_Position - - - id, - - - insdt, - - - insuser, - - - latitude, - - - longitude, - - - biz_id, - - - patrol_record_id, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=VARCHAR}, - - - #{longitude,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{patrolRecordId,jdbcType=VARCHAR}, - - - #{type,jdbcType=INTEGER}, - - - - - update TB_TimeEfficiency_Worker_Position - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=VARCHAR}, - - - longitude = #{longitude,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_Worker_Position - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=VARCHAR}, - longitude = #{longitude,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - patrol_record_id = #{patrolRecordId,jdbcType=VARCHAR}, - type = #{type,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_TimeEfficiency_Worker_Position - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/timeefficiency/patrolPlanTypeMapper.xml b/src/com/sipai/mapper/timeefficiency/patrolPlanTypeMapper.xml deleted file mode 100644 index b9a67c0c..00000000 --- a/src/com/sipai/mapper/timeefficiency/patrolPlanTypeMapper.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insuser, insdt, remark, name, biz_id, active, morder, register, unit_id, pid, - patrol_type_content - - - - delete from TB_TimeEfficiency_PatrolPlanType - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_TimeEfficiency_PatrolPlanType (id, insuser, insdt, - remark, name, biz_id, - active, morder, register, - unit_id, pid, patrol_type_content - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{active,jdbcType=VARCHAR}, #{morder,jdbcType=VARCHAR}, #{register,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{patrolTypeContent,jdbcType=VARCHAR} - ) - - - insert into TB_TimeEfficiency_PatrolPlanType - - - id, - - - insuser, - - - insdt, - - - remark, - - - name, - - - biz_id, - - - active, - - - morder, - - - register, - - - unit_id, - - - pid, - - - patrol_type_content, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{morder,jdbcType=VARCHAR}, - - - #{register,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{patrolTypeContent,jdbcType=VARCHAR}, - - - - - update TB_TimeEfficiency_PatrolPlanType - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - register = #{register,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - patrol_type_content = #{patrolTypeContent,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_TimeEfficiency_PatrolPlanType - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=VARCHAR}, - register = #{register,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - patrol_type_content = #{patrolTypeContent,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_TimeEfficiency_PatrolPlanType - ${where} - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/BonusPointMapper.xml b/src/com/sipai/mapper/user/BonusPointMapper.xml deleted file mode 100644 index e2557694..00000000 --- a/src/com/sipai/mapper/user/BonusPointMapper.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - id, insuser, insdt, userId, point, edt, type - - - - delete from tb_bonuspoint - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_bonuspoint (id, insuser, insdt, - userId, point, edt, - type) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{userid,jdbcType=VARCHAR}, #{point,jdbcType=INTEGER}, #{edt,jdbcType=TIMESTAMP}, - #{type,jdbcType=VARCHAR}) - - - insert into tb_bonuspoint - - - id, - - - insuser, - - - insdt, - - - userId, - - - point, - - - edt, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{userid,jdbcType=VARCHAR}, - - - #{point,jdbcType=INTEGER}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - - - update tb_bonuspoint - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - userId = #{userid,jdbcType=VARCHAR}, - - - point = #{point,jdbcType=INTEGER}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_bonuspoint - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - userId = #{userid,jdbcType=VARCHAR}, - point = #{point,jdbcType=INTEGER}, - edt = #{edt,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_bonuspoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/BonusPointRecordMapper.xml b/src/com/sipai/mapper/user/BonusPointRecordMapper.xml deleted file mode 100644 index 011ffac2..00000000 --- a/src/com/sipai/mapper/user/BonusPointRecordMapper.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, userId, point, reason, goodsId - - - - delete from tb_bonuspoint_record - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_bonuspoint_record (id, insdt, insuser, - userId, point, reason, - goodsId) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{userid,jdbcType=VARCHAR}, #{point,jdbcType=BIGINT}, #{reason,jdbcType=VARCHAR}, - #{goodsid,jdbcType=VARCHAR}) - - - insert into tb_bonuspoint_record - - - id, - - - insdt, - - - insuser, - - - userId, - - - point, - - - reason, - - - goodsId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{point,jdbcType=BIGINT}, - - - #{reason,jdbcType=VARCHAR}, - - - #{goodsid,jdbcType=VARCHAR}, - - - - - update tb_bonuspoint_record - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - userId = #{userid,jdbcType=VARCHAR}, - - - point = #{point,jdbcType=BIGINT}, - - - reason = #{reason,jdbcType=VARCHAR}, - - - goodsId = #{goodsid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_bonuspoint_record - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - userId = #{userid,jdbcType=VARCHAR}, - point = #{point,jdbcType=BIGINT}, - reason = #{reason,jdbcType=VARCHAR}, - goodsId = #{goodsid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_bonuspoint_record - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/CompanyMapper.xml b/src/com/sipai/mapper/user/CompanyMapper.xml deleted file mode 100644 index e301a404..00000000 --- a/src/com/sipai/mapper/user/CompanyMapper.xml +++ /dev/null @@ -1,320 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, name, pid, address, tel, website, taskid, post, insdt, insuser, version, morder, - sname, active, type, ename, longitude, latitude,is_count,library_bizid,city - - - - delete from tb_company - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_company (id, name, pid, - address, tel, website, - taskid, post, insdt, - insuser, version, morder, - sname, active, type, - ename, longitude, latitude,is_count,library_bizid,city - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{address,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR}, #{website,jdbcType=VARCHAR}, - #{taskid,jdbcType=VARCHAR}, #{post,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{sname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{ename,jdbcType=VARCHAR}, #{longitude,jdbcType=DECIMAL}, #{latitude,jdbcType=DECIMAL}, - #{isCount,jdbcType=VARCHAR},#{libraryBizid,jdbcType=VARCHAR}, - #{city,jdbcType=VARCHAR} - ) - - - insert into tb_company - - - id, - - - name, - - - pid, - - - address, - - - tel, - - - website, - - - taskid, - - - post, - - - insdt, - - - insuser, - - - version, - - - morder, - - - sname, - - - active, - - - type, - - - ename, - - - longitude, - - - latitude, - - - is_count, - - - library_bizid, - - - city, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{tel,jdbcType=VARCHAR}, - - - #{website,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{post,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{ename,jdbcType=VARCHAR}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{isCount,jdbcType=VARCHAR}, - - - #{libraryBizid,jdbcType=VARCHAR}, - - - #{city,jdbcType=VARCHAR}, - - - - - update tb_company - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - tel = #{tel,jdbcType=VARCHAR}, - - - website = #{website,jdbcType=VARCHAR}, - - - taskid = #{taskid,jdbcType=VARCHAR}, - - - post = #{post,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - ename = #{ename,jdbcType=VARCHAR}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - is_count = #{isCount,jdbcType=VARCHAR}, - - - library_bizid = #{libraryBizid,jdbcType=VARCHAR}, - - - city = #{city,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_company - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - tel = #{tel,jdbcType=VARCHAR}, - website = #{website,jdbcType=VARCHAR}, - taskid = #{taskid,jdbcType=VARCHAR}, - post = #{post,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - ename = #{ename,jdbcType=VARCHAR}, - longitude = #{longitude,jdbcType=DECIMAL}, - latitude = #{latitude,jdbcType=DECIMAL}, - is_count = #{isCount,jdbcType=VARCHAR}, - library_bizid = #{libraryBizid,jdbcType=VARCHAR}, - city = #{city,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/DeptAreaMapper.xml b/src/com/sipai/mapper/user/DeptAreaMapper.xml deleted file mode 100644 index ab4681c4..00000000 --- a/src/com/sipai/mapper/user/DeptAreaMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, insuser, insdt, deptid, areaid, flag, status, sequence, remark - - - - delete from tb_dept_area - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_dept_area (id, insuser, insdt, - deptid, areaid, flag, - status, sequence, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{deptid,jdbcType=VARCHAR}, #{areaid,jdbcType=VARCHAR}, #{flag,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{sequence,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into tb_dept_area - - - id, - - - insuser, - - - insdt, - - - deptid, - - - areaid, - - - flag, - - - status, - - - sequence, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{deptid,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{flag,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{sequence,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_dept_area - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - deptid = #{deptid,jdbcType=VARCHAR}, - - - areaid = #{areaid,jdbcType=VARCHAR}, - - - flag = #{flag,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - sequence = #{sequence,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_dept_area - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - deptid = #{deptid,jdbcType=VARCHAR}, - areaid = #{areaid,jdbcType=VARCHAR}, - flag = #{flag,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - sequence = #{sequence,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_dept_area - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/DeptMapper.xml b/src/com/sipai/mapper/user/DeptMapper.xml deleted file mode 100644 index 0cac5c95..00000000 --- a/src/com/sipai/mapper/user/DeptMapper.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, name, pid, RoleID, offtel, telout, telin, fax, office, logopic, taskid, insdt, - insuser, version, morder, sname, active, code - - - - delete from tb_dept - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_dept (id, name, pid, - RoleID, offtel, telout, - telin, fax, office, - logopic, taskid, insdt, - insuser, version, morder, - sname, active, code - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{roleid,jdbcType=VARCHAR}, #{offtel,jdbcType=VARCHAR}, #{telout,jdbcType=VARCHAR}, - #{telin,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{office,jdbcType=VARCHAR}, - #{logopic,jdbcType=VARCHAR}, #{taskid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER}, - #{sname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR} - ) - - - insert into tb_dept - - - id, - - - name, - - - pid, - - - RoleID, - - - offtel, - - - telout, - - - telin, - - - fax, - - - office, - - - logopic, - - - taskid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - sname, - - - active, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{roleid,jdbcType=VARCHAR}, - - - #{offtel,jdbcType=VARCHAR}, - - - #{telout,jdbcType=VARCHAR}, - - - #{telin,jdbcType=VARCHAR}, - - - #{fax,jdbcType=VARCHAR}, - - - #{office,jdbcType=VARCHAR}, - - - #{logopic,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_dept - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - RoleID = #{roleid,jdbcType=VARCHAR}, - - - offtel = #{offtel,jdbcType=VARCHAR}, - - - telout = #{telout,jdbcType=VARCHAR}, - - - telin = #{telin,jdbcType=VARCHAR}, - - - fax = #{fax,jdbcType=VARCHAR}, - - - office = #{office,jdbcType=VARCHAR}, - - - logopic = #{logopic,jdbcType=VARCHAR}, - - - taskid = #{taskid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_dept - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - RoleID = #{roleid,jdbcType=VARCHAR}, - offtel = #{offtel,jdbcType=VARCHAR}, - telout = #{telout,jdbcType=VARCHAR}, - telin = #{telin,jdbcType=VARCHAR}, - fax = #{fax,jdbcType=VARCHAR}, - office = #{office,jdbcType=VARCHAR}, - logopic = #{logopic,jdbcType=VARCHAR}, - taskid = #{taskid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_dept - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/DeptProcessMapper.xml b/src/com/sipai/mapper/user/DeptProcessMapper.xml deleted file mode 100644 index 3c56ebf3..00000000 --- a/src/com/sipai/mapper/user/DeptProcessMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, insuser, insdt, deptid, processid, flag, status, sequence, remark - - - - delete from tb_dept_process - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_dept_process (id, insuser, insdt, - deptid, processid, flag, - status, sequence, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{deptid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{flag,jdbcType=VARCHAR}, - #{status,jdbcType=VARCHAR}, #{sequence,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into tb_dept_process - - - id, - - - insuser, - - - insdt, - - - deptid, - - - processid, - - - flag, - - - status, - - - sequence, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{deptid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{flag,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{sequence,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_dept_process - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - deptid = #{deptid,jdbcType=VARCHAR}, - - - processid = #{processid,jdbcType=VARCHAR}, - - - flag = #{flag,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - sequence = #{sequence,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_dept_process - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - deptid = #{deptid,jdbcType=VARCHAR}, - processid = #{processid,jdbcType=VARCHAR}, - flag = #{flag,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - sequence = #{sequence,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_dept_process - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/DeptRoleMapper.xml b/src/com/sipai/mapper/user/DeptRoleMapper.xml deleted file mode 100644 index fc2113f2..00000000 --- a/src/com/sipai/mapper/user/DeptRoleMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, deptid, roleid, status, flag, sequence, remark - - - - delete from tb_dept_role - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_dept_role (id, insdt, insuser, - deptid, roleid, status, - flag, sequence, remark - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{deptid,jdbcType=VARCHAR}, #{roleid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, - #{flag,jdbcType=VARCHAR}, #{sequence,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR} - ) - - - insert into tb_dept_role - - - id, - - - insdt, - - - insuser, - - - deptid, - - - roleid, - - - status, - - - flag, - - - sequence, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{deptid,jdbcType=VARCHAR}, - - - #{roleid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{flag,jdbcType=VARCHAR}, - - - #{sequence,jdbcType=INTEGER}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_dept_role - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - deptid = #{deptid,jdbcType=VARCHAR}, - - - roleid = #{roleid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - flag = #{flag,jdbcType=VARCHAR}, - - - sequence = #{sequence,jdbcType=INTEGER}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_dept_role - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - deptid = #{deptid,jdbcType=VARCHAR}, - roleid = #{roleid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - flag = #{flag,jdbcType=VARCHAR}, - sequence = #{sequence,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_dept_role - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/ExtSystemMapper.xml b/src/com/sipai/mapper/user/ExtSystemMapper.xml deleted file mode 100644 index b63b9b5e..00000000 --- a/src/com/sipai/mapper/user/ExtSystemMapper.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, type, status, mode, name, url, namespace, workShopId - - - - delete from tb_extsystem - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_extsystem (id, insdt, insuser, - type, status, mode, name, - url, namespace, workShopId - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{mode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{url,jdbcType=VARCHAR}, #{namespace,jdbcType=VARCHAR}, #{workshopid,jdbcType=VARCHAR} - ) - - - insert into tb_extsystem - - - id, - - - insdt, - - - insuser, - - - type, - - - status, - - - mode, - - - name, - - - url, - - - namespace, - - - workShopId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{status,jdbcType=BIT}, - - - #{mode,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{namespace,jdbcType=VARCHAR}, - - - #{workshopid,jdbcType=VARCHAR}, - - - - - update tb_extsystem - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=BIT}, - - - mode = #{mode,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - namespace = #{namespace,jdbcType=VARCHAR}, - - - workShopId = #{workshopid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_extsystem - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=BIT}, - mode = #{mode,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - namespace = #{namespace,jdbcType=VARCHAR}, - workShopId = #{workshopid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_extsystem - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/JobMapper.xml b/src/com/sipai/mapper/user/JobMapper.xml deleted file mode 100644 index c517b019..00000000 --- a/src/com/sipai/mapper/user/JobMapper.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, taskid, pri, pid, biz_id, dept_id,serial,level_type - - - - delete - from tb_job - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_job (id, insdt, insuser, - name, taskid, pri, - pid, biz_id, dept_id, serial, level_type) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{taskid,jdbcType=VARCHAR}, #{pri,jdbcType=INTEGER}, - #{pid,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR}, - #{serial,jdbcType=VARCHAR}, #{levelType,jdbcType=VARCHAR}) - - - insert into tb_job - - - id, - - - insdt, - - - insuser, - - - name, - - - taskid, - - - pri, - - - pid, - - - biz_id, - - - dept_id, - - - serial, - - - level_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{taskid,jdbcType=VARCHAR}, - - - #{pri,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{deptId,jdbcType=VARCHAR}, - - - #{serial,jdbcType=VARCHAR}, - - - #{levelType,jdbcType=VARCHAR}, - - - - - update tb_job - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - taskid = #{taskid,jdbcType=VARCHAR}, - - - pri = #{pri,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - dept_id = #{deptId,jdbcType=VARCHAR}, - - - serial = #{serial,jdbcType=VARCHAR}, - - - level_type = #{levelType,jdbcType=TINYINT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_job - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - taskid = #{taskid,jdbcType=VARCHAR}, - pri = #{pri,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - serial = #{serial,jdbcType=VARCHAR}, - level_type = #{levelType,jdbcType=TINYINT}, - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/MenuMapper.xml b/src/com/sipai/mapper/user/MenuMapper.xml deleted file mode 100644 index bb7a42ba..00000000 --- a/src/com/sipai/mapper/user/MenuMapper.xml +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, PowerID, caption, name, description, location, target, onclick, onmouseover, - onmouseout, image, altImage, tooltip, roles, page, width, height, forward, action, - morder, lvl, active, type, mainpage, count - - - - delete from tb_menuitem - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_menuitem (id,pid, PowerID, - caption, name, description, - location, target, onclick, - onmouseover, onmouseout, image, - altImage, tooltip, roles, - page, width, height, - forward, action, morder, - lvl, active, type, - mainpage, count) - values (#{id,jdbcType=VARCHAR},#{pid,jdbcType=VARCHAR}, #{powerid,jdbcType=VARCHAR}, - #{caption,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{location,jdbcType=VARCHAR}, #{target,jdbcType=VARCHAR}, #{onclick,jdbcType=VARCHAR}, - #{onmouseover,jdbcType=VARCHAR}, #{onmouseout,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, - #{altimage,jdbcType=VARCHAR}, #{tooltip,jdbcType=VARCHAR}, #{roles,jdbcType=VARCHAR}, - #{page,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, - #{forward,jdbcType=VARCHAR}, #{action,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{lvl,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{mainpage,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER}) - - - insert into tb_menuitem - - - id, - - - pid, - - - PowerID, - - - caption, - - - name, - - - description, - - - location, - - - target, - - - onclick, - - - onmouseover, - - - onmouseout, - - - image, - - - altImage, - - - tooltip, - - - roles, - - - page, - - - width, - - - height, - - - forward, - - - action, - - - morder, - - - lvl, - - - active, - - - type, - - - mainpage, - - - count, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{powerid,jdbcType=VARCHAR}, - - - #{caption,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{location,jdbcType=VARCHAR}, - - - #{target,jdbcType=VARCHAR}, - - - #{onclick,jdbcType=VARCHAR}, - - - #{onmouseover,jdbcType=VARCHAR}, - - - #{onmouseout,jdbcType=VARCHAR}, - - - #{image,jdbcType=VARCHAR}, - - - #{altimage,jdbcType=VARCHAR}, - - - #{tooltip,jdbcType=VARCHAR}, - - - #{roles,jdbcType=VARCHAR}, - - - #{page,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{forward,jdbcType=VARCHAR}, - - - #{action,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{lvl,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{mainpage,jdbcType=VARCHAR}, - - - #{count,jdbcType=INTEGER}, - - - - - update tb_menuitem - - - pid = #{pid,jdbcType=VARCHAR}, - - - PowerID = #{powerid,jdbcType=VARCHAR}, - - - caption = #{caption,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - location = #{location,jdbcType=VARCHAR}, - - - target = #{target,jdbcType=VARCHAR}, - - - onclick = #{onclick,jdbcType=VARCHAR}, - - - onmouseover = #{onmouseover,jdbcType=VARCHAR}, - - - onmouseout = #{onmouseout,jdbcType=VARCHAR}, - - - image = #{image,jdbcType=VARCHAR}, - - - altImage = #{altimage,jdbcType=VARCHAR}, - - - tooltip = #{tooltip,jdbcType=VARCHAR}, - - - roles = #{roles,jdbcType=VARCHAR}, - - - page = #{page,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - forward = #{forward,jdbcType=VARCHAR}, - - - action = #{action,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - lvl = #{lvl,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - mainpage = #{mainpage,jdbcType=VARCHAR}, - - - count = #{count,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_menuitem - set pid = #{pid,jdbcType=VARCHAR}, - PowerID = #{powerid,jdbcType=VARCHAR}, - caption = #{caption,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - location = #{location,jdbcType=VARCHAR}, - target = #{target,jdbcType=VARCHAR}, - onclick = #{onclick,jdbcType=VARCHAR}, - onmouseover = #{onmouseover,jdbcType=VARCHAR}, - onmouseout = #{onmouseout,jdbcType=VARCHAR}, - image = #{image,jdbcType=VARCHAR}, - altImage = #{altimage,jdbcType=VARCHAR}, - tooltip = #{tooltip,jdbcType=VARCHAR}, - roles = #{roles,jdbcType=VARCHAR}, - page = #{page,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - forward = #{forward,jdbcType=VARCHAR}, - action = #{action,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - lvl = #{lvl,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - mainpage = #{mainpage,jdbcType=VARCHAR}, - count = #{count,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_menuitem - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/MobileManagementMapper.xml b/src/com/sipai/mapper/user/MobileManagementMapper.xml deleted file mode 100644 index a0d4640a..00000000 --- a/src/com/sipai/mapper/user/MobileManagementMapper.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - id, name, deviceid, unit_id, status, remark, bizid, type - - - user_id - - - - delete from tb_EM_MobileManagement - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_EM_MobileManagement (id, name, deviceid, - unit_id, status, remark, - bizid, type, user_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{deviceid,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{bizid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{userId,jdbcType=CLOB}) - - - insert into tb_EM_MobileManagement - - - id, - - - name, - - - deviceid, - - - unit_id, - - - status, - - - remark, - - - bizid, - - - type, - - - user_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{deviceid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{userId,jdbcType=CLOB}, - - - - - update tb_EM_MobileManagement - - - name = #{name,jdbcType=VARCHAR}, - - - deviceid = #{deviceid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - user_id = #{userId,jdbcType=CLOB}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_EM_MobileManagement - set name = #{name,jdbcType=VARCHAR}, - deviceid = #{deviceid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - user_id = #{userId,jdbcType=CLOB} - where id = #{id,jdbcType=VARCHAR} - - - update tb_EM_MobileManagement - set name = #{name,jdbcType=VARCHAR}, - deviceid = #{deviceid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_EM_MobileManagement - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/MobileValidationMapper.xml b/src/com/sipai/mapper/user/MobileValidationMapper.xml deleted file mode 100644 index 4e1b30bc..00000000 --- a/src/com/sipai/mapper/user/MobileValidationMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, mobile, verificationcode, senddate - - - - delete from tb_mobile_validation - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_mobile_validation (id, insuser, insdt, - mobile, verificationcode, senddate - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{mobile,jdbcType=VARCHAR}, #{verificationcode,jdbcType=VARCHAR}, #{senddate,jdbcType=TIMESTAMP} - ) - - - insert into tb_mobile_validation - - - id, - - - insuser, - - - insdt, - - - mobile, - - - verificationcode, - - - senddate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{mobile,jdbcType=VARCHAR}, - - - #{verificationcode,jdbcType=VARCHAR}, - - - #{senddate,jdbcType=TIMESTAMP}, - - - - - update tb_mobile_validation - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - mobile = #{mobile,jdbcType=VARCHAR}, - - - verificationcode = #{verificationcode,jdbcType=VARCHAR}, - - - senddate = #{senddate,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_mobile_validation - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - mobile = #{mobile,jdbcType=VARCHAR}, - verificationcode = #{verificationcode,jdbcType=VARCHAR}, - senddate = #{senddate,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_mobile_validation - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/ProcessSectionMapper.xml b/src/com/sipai/mapper/user/ProcessSectionMapper.xml deleted file mode 100644 index 75c7f1a2..00000000 --- a/src/com/sipai/mapper/user/ProcessSectionMapper.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - id - , insdt, insuser, name, code, pid, morder, sname, active, process_section_type_id,unit_id - - - - delete - from tb_process_section - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_section (id, insdt, insuser, - name, code, pid, morder, - sname, active, process_section_type_id, unit_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{sname,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, #{processSectionTypeId,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_process_section - - - id, - - - insdt, - - - insuser, - - - name, - - - code, - - - pid, - - - morder, - - - sname, - - - active, - - - process_section_type_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{processSectionTypeId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_process_section - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - process_section_type_id = #{processSectionTypeId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_section - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - process_section_type_id = #{processSectionTypeId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - delete - from tb_process_section ${where} - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/ProcessSectionScoreMapper.xml b/src/com/sipai/mapper/user/ProcessSectionScoreMapper.xml deleted file mode 100644 index 871b2fe9..00000000 --- a/src/com/sipai/mapper/user/ProcessSectionScoreMapper.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - id, name, alarmcontent, lower, upper, insuser, insdt, upsuser, upsdt, bizid - - - - delete from tb_process_section_score - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_section_score (id, name, alarmcontent, - lower, upper, insuser, - insdt, upsuser, upsdt, - bizid) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{alarmcontent,jdbcType=VARCHAR}, - #{lower,jdbcType=INTEGER}, #{upper,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{upsuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{bizid,jdbcType=VARCHAR}) - - - insert into tb_process_section_score - - - id, - - - name, - - - alarmcontent, - - - lower, - - - upper, - - - insuser, - - - insdt, - - - upsuser, - - - upsdt, - - - bizid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{alarmcontent,jdbcType=VARCHAR}, - - - #{lower,jdbcType=INTEGER}, - - - #{upper,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{bizid,jdbcType=VARCHAR}, - - - - - update tb_process_section_score - - - name = #{name,jdbcType=VARCHAR}, - - - alarmcontent = #{alarmcontent,jdbcType=VARCHAR}, - - - lower = #{lower,jdbcType=INTEGER}, - - - upper = #{upper,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_section_score - set name = #{name,jdbcType=VARCHAR}, - alarmcontent = #{alarmcontent,jdbcType=VARCHAR}, - lower = #{lower,jdbcType=INTEGER}, - upper = #{upper,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - bizid = #{bizid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_process_section_score - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/ProcessSectionTypeMapper.xml b/src/com/sipai/mapper/user/ProcessSectionTypeMapper.xml deleted file mode 100644 index 64155b02..00000000 --- a/src/com/sipai/mapper/user/ProcessSectionTypeMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, insuser, insdt, biz_id, name - - - - delete from tb_process_section_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_process_section_type (id, insuser, insdt, - biz_id, name) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{bizId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}) - - - insert into tb_process_section_type - - - id, - - - insuser, - - - insdt, - - - biz_id, - - - name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - - - update tb_process_section_type - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_process_section_type - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - biz_id = #{bizId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_process_section_type - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/RoleMapper.xml b/src/com/sipai/mapper/user/RoleMapper.xml deleted file mode 100644 index 142accb9..00000000 --- a/src/com/sipai/mapper/user/RoleMapper.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - id, name, serial, description, morder,bizid - - - - delete from tb_role - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_role (id, name, serial, - description, morder,bizid) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{serial,jdbcType=VARCHAR}, - #{description,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER},#{bizid,jdbcType=VARCHAR}) - - - insert into tb_role - - - id, - - - name, - - - serial, - - - description, - - - morder, - - - bizid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{serial,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{bizid,jdbcType=INTEGER}, - - - - - update tb_role - - - name = #{name,jdbcType=VARCHAR}, - - - serial = #{serial,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_role - set name = #{name,jdbcType=VARCHAR}, - serial = #{serial,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - bizid = #{bizid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/RoleMenuMapper.xml b/src/com/sipai/mapper/user/RoleMenuMapper.xml deleted file mode 100644 index 96558fb1..00000000 --- a/src/com/sipai/mapper/user/RoleMenuMapper.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - insert into tb_role_menu (roleID, menuID) - values (#{roleid,jdbcType=VARCHAR}, #{menuid,jdbcType=VARCHAR}) - - - insert into tb_role_menu - - - roleID, - - - menuID, - - - - - #{roleid,jdbcType=VARCHAR}, - - - #{menuid,jdbcType=VARCHAR}, - - - - - - - - delete from tb_role_menu - where roleID = #{roleid,jdbcType=VARCHAR} - - - delete tb_role_menu from tb_role_menu - left join tb_menuitem on tb_role_menu.menuid= tb_menuitem.id - where roleID = #{roleid,jdbcType=VARCHAR} and tb_menuitem.type='menu' - - - delete tb_role_menu from tb_role_menu - left join tb_menuitem on tb_role_menu.menuid= tb_menuitem.id - where roleID = #{roleid,jdbcType=VARCHAR} and tb_menuitem.type='func' - - - delete tb_role_menu from tb_role_menu - left join tb_menuitem on tb_role_menu.menuid= tb_menuitem.id - where roleID = #{roleid1} and tb_menuitem.pid= #{menuid1} and tb_menuitem.type='func' - - - delete from tb_role_menu - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UnitMapper.xml b/src/com/sipai/mapper/user/UnitMapper.xml deleted file mode 100644 index 48f956d9..00000000 --- a/src/com/sipai/mapper/user/UnitMapper.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserDetailMapper.xml b/src/com/sipai/mapper/user/UserDetailMapper.xml deleted file mode 100644 index 786ddc8b..00000000 --- a/src/com/sipai/mapper/user/UserDetailMapper.xml +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, userid, EmpID, LastLoginTime, Offtel,icon, iconopen, opened, target, - title, url, dirline, fax, officeroom, mobil, politics, webmail - - - - delete from tb_user_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_user_detail (id, insdt, insuser, - userid, EmpID, LastLoginTime, - Offtel, iconopen, opened, - target, title, url, - dirline, fax, officeroom, - mobil, politics, webmail, - icon) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{userid,jdbcType=VARCHAR}, #{empid,jdbcType=VARCHAR}, #{lastlogintime,jdbcType=VARCHAR}, - #{offtel,jdbcType=VARCHAR}, #{iconopen,jdbcType=VARCHAR}, #{opened,jdbcType=VARCHAR}, - #{target,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{dirline,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{officeroom,jdbcType=VARCHAR}, - #{mobil,jdbcType=VARCHAR}, #{politics,jdbcType=VARCHAR}, #{webmail,jdbcType=VARCHAR}, - #{icon,jdbcType=VARCHAR}) - - - insert into tb_user_detail - - - id, - - - insdt, - - - insuser, - - - userid, - - - EmpID, - - - LastLoginTime, - - - Offtel, - - - iconopen, - - - opened, - - - target, - - - title, - - - url, - - - dirline, - - - fax, - - - officeroom, - - - mobil, - - - politics, - - - webmail, - - - icon, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{empid,jdbcType=VARCHAR}, - - - #{lastlogintime,jdbcType=VARCHAR}, - - - #{offtel,jdbcType=VARCHAR}, - - - #{iconopen,jdbcType=VARCHAR}, - - - #{opened,jdbcType=VARCHAR}, - - - #{target,jdbcType=VARCHAR}, - - - #{title,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{dirline,jdbcType=VARCHAR}, - - - #{fax,jdbcType=VARCHAR}, - - - #{officeroom,jdbcType=VARCHAR}, - - - #{mobil,jdbcType=VARCHAR}, - - - #{politics,jdbcType=VARCHAR}, - - - #{webmail,jdbcType=VARCHAR}, - - - #{icon,jdbcType=VARCHAR}, - - - - - update tb_user_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - EmpID = #{empid,jdbcType=VARCHAR}, - - - LastLoginTime = #{lastlogintime,jdbcType=VARCHAR}, - - - Offtel = #{offtel,jdbcType=VARCHAR}, - - - iconopen = #{iconopen,jdbcType=VARCHAR}, - - - opened = #{opened,jdbcType=VARCHAR}, - - - target = #{target,jdbcType=VARCHAR}, - - - title = #{title,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - dirline = #{dirline,jdbcType=VARCHAR}, - - - fax = #{fax,jdbcType=VARCHAR}, - - - officeroom = #{officeroom,jdbcType=VARCHAR}, - - - mobil = #{mobil,jdbcType=VARCHAR}, - - - politics = #{politics,jdbcType=VARCHAR}, - - - webmail = #{webmail,jdbcType=VARCHAR}, - - - icon = #{icon,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_user_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR}, - EmpID = #{empid,jdbcType=VARCHAR}, - LastLoginTime = #{lastlogintime,jdbcType=VARCHAR}, - Offtel = #{offtel,jdbcType=VARCHAR}, - icon = #{icon,jdbcType=VARCHAR}, - iconopen = #{iconopen,jdbcType=VARCHAR}, - opened = #{opened,jdbcType=VARCHAR}, - target = #{target,jdbcType=VARCHAR}, - title = #{title,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - dirline = #{dirline,jdbcType=VARCHAR}, - fax = #{fax,jdbcType=VARCHAR}, - officeroom = #{officeroom,jdbcType=VARCHAR}, - mobil = #{mobil,jdbcType=VARCHAR}, - politics = #{politics,jdbcType=VARCHAR}, - webmail = #{webmail,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_user_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserJobMapper.xml b/src/com/sipai/mapper/user/UserJobMapper.xml deleted file mode 100644 index d961d16a..00000000 --- a/src/com/sipai/mapper/user/UserJobMapper.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, userid, jobid, unitid,serial - - - - delete from tb_user_job - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_user_job (id, insdt, insuser, - userid, jobid, unitid,serial - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{userid,jdbcType=VARCHAR}, #{jobid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{serial,jdbcType=VARCHAR} - ) - - - insert into tb_user_job - - - id, - - - insdt, - - - insuser, - - - userid, - - - jobid, - - - unitid, - - - serial, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{jobid,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{serial,jdbcType=VARCHAR}, - - - - - update tb_user_job - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - jobid = #{jobid,jdbcType=VARCHAR}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - serial = #{serial,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_user_job - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - userid = #{userid,jdbcType=VARCHAR}, - jobid = #{jobid,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - serial = #{serial,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_user_job - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserMapper.xml b/src/com/sipai/mapper/user/UserMapper.xml deleted file mode 100644 index d4ae1cca..00000000 --- a/src/com/sipai/mapper/user/UserMapper.xml +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, name, password, active, caption, sex, officeroom, officephone, useremail, pid, - lgnum, totaltime, morder, serial, userCardId,cardid, insuser, insdt, mobile, jobid, pri, syncflag, - wechatid, themeClass, qq, lockTime - - - - delete from tb_user - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_user (id, name, password, - active, caption, sex, - officeroom, officephone, useremail, - pid, lgnum, totaltime, - morder, serial, userCardId,cardid, - insuser, insdt, mobile, - jobid, pri, syncflag, - wechatid, themeClass, - qq,lockTime) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, - #{active,jdbcType=CHAR}, #{caption,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, - #{officeroom,jdbcType=VARCHAR}, #{officephone,jdbcType=VARCHAR}, #{useremail,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{lgnum,jdbcType=INTEGER}, #{totaltime,jdbcType=DOUBLE}, - #{morder,jdbcType=INTEGER}, #{serial,jdbcType=VARCHAR}, #{userCardId,jdbcType=VARCHAR},#{cardid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{mobile,jdbcType=VARCHAR}, - #{jobid,jdbcType=VARCHAR}, #{pri,jdbcType=INTEGER}, #{syncflag,jdbcType=VARCHAR}, - #{wechatid,jdbcType=VARCHAR}, #{themeclass,jdbcType=VARCHAR}, #{qq,jdbcType=INTEGER}, - #{locktime,jdbcType=TIMESTAMP}) - - - insert into tb_user - - - id, - - - name, - - - password, - - - active, - - - caption, - - - sex, - - - officeroom, - - - officephone, - - - useremail, - - - pid, - - - lgnum, - - - totaltime, - - - morder, - - - serial, - - - userCardId, - - - cardid, - - - insuser, - - - insdt, - - - mobile, - - - jobid, - - - pri, - - - syncflag, - - - wechatid, - - - themeClass, - - - qq, - - - lockTime, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{password,jdbcType=VARCHAR}, - - - #{active,jdbcType=CHAR}, - - - #{caption,jdbcType=VARCHAR}, - - - #{sex,jdbcType=VARCHAR}, - - - #{officeroom,jdbcType=VARCHAR}, - - - #{officephone,jdbcType=VARCHAR}, - - - #{useremail,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{lgnum,jdbcType=INTEGER}, - - - #{totaltime,jdbcType=DOUBLE}, - - - #{morder,jdbcType=INTEGER}, - - - #{serial,jdbcType=VARCHAR}, - - - #{userCardId,jdbcType=VARCHAR}, - - - #{cardid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{mobile,jdbcType=VARCHAR}, - - - #{jobid,jdbcType=VARCHAR}, - - - #{pri,jdbcType=INTEGER}, - - - #{syncflag,jdbcType=VARCHAR}, - - - #{wechatid,jdbcType=VARCHAR}, - - - #{themeclass,jdbcType=VARCHAR}, - - - #{qq,jdbcType=INTEGER}, - - - #{locktime,jdbcType=TIMESTAMP}, - - - - - update tb_user - - - name = #{name,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=CHAR}, - - - caption = #{caption,jdbcType=VARCHAR}, - - - sex = #{sex,jdbcType=VARCHAR}, - - - officeroom = #{officeroom,jdbcType=VARCHAR}, - - - officephone = #{officephone,jdbcType=VARCHAR}, - - - useremail = #{useremail,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - lgnum = #{lgnum,jdbcType=INTEGER}, - - - totaltime = #{totaltime,jdbcType=DOUBLE}, - - - morder = #{morder,jdbcType=INTEGER}, - - - serial = #{serial,jdbcType=VARCHAR}, - - - userCardId = #{userCardId,jdbcType=VARCHAR}, - - - cardid = #{cardid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - mobile = #{mobile,jdbcType=VARCHAR}, - - - jobid = #{jobid,jdbcType=VARCHAR}, - - - pri = #{pri,jdbcType=INTEGER}, - - - syncflag = #{syncflag,jdbcType=VARCHAR}, - - - wechatid = #{wechatid,jdbcType=VARCHAR}, - - - themeClass = #{themeclass,jdbcType=VARCHAR}, - - - qq = #{qq,jdbcType=INTEGER}, - - - locktime = #{locktime,jdbcType=TIMESTAMP}, - - where id = #{id,jdbcType=VARCHAR} - - - update tb_user - set name = #{name,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - active = #{active,jdbcType=CHAR}, - caption = #{caption,jdbcType=VARCHAR}, - sex = #{sex,jdbcType=VARCHAR}, - officeroom = #{officeroom,jdbcType=VARCHAR}, - officephone = #{officephone,jdbcType=VARCHAR}, - useremail = #{useremail,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - lgnum = #{lgnum,jdbcType=INTEGER}, - totaltime = #{totaltime,jdbcType=DOUBLE}, - morder = #{morder,jdbcType=INTEGER}, - serial = #{serial,jdbcType=VARCHAR}, - userCardId = #{userCardId,jdbcType=VARCHAR}, - cardid = #{cardid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - mobile = #{mobile,jdbcType=VARCHAR}, - jobid = #{jobid,jdbcType=VARCHAR}, - pri = #{pri,jdbcType=INTEGER}, - syncflag = #{syncflag,jdbcType=VARCHAR}, - wechatid = #{wechatid,jdbcType=VARCHAR}, - themeClass = #{themeclass,jdbcType=VARCHAR}, - qq = #{qq,jdbcType=INTEGER}, - locktime = #{locktime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - - - - - - - delete from tb_user - ${where} and id !='emp01' - - - - - update tb_user - set lgnum = 0, - locktime = null - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserOutsidersMapper.xml b/src/com/sipai/mapper/user/UserOutsidersMapper.xml deleted file mode 100644 index f95167ff..00000000 --- a/src/com/sipai/mapper/user/UserOutsidersMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, name, caption, sex, pid, morder, cardid, insuser, insdt - - - - delete from tb_user_outsiders - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_user_outsiders (id, name, caption, - sex, pid, morder, cardid, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{caption,jdbcType=VARCHAR}, - #{sex,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{cardid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into tb_user_outsiders - - - id, - - - name, - - - caption, - - - sex, - - - pid, - - - morder, - - - cardid, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{caption,jdbcType=VARCHAR}, - - - #{sex,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{cardid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update tb_user_outsiders - - - name = #{name,jdbcType=VARCHAR}, - - - caption = #{caption,jdbcType=VARCHAR}, - - - sex = #{sex,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - cardid = #{cardid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_user_outsiders - set name = #{name,jdbcType=VARCHAR}, - caption = #{caption,jdbcType=VARCHAR}, - sex = #{sex,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - cardid = #{cardid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_user_outsiders - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserPowerMapper.xml b/src/com/sipai/mapper/user/UserPowerMapper.xml deleted file mode 100644 index dc5e4fe8..00000000 --- a/src/com/sipai/mapper/user/UserPowerMapper.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserRoleMapper.xml b/src/com/sipai/mapper/user/UserRoleMapper.xml deleted file mode 100644 index 4a2f2971..00000000 --- a/src/com/sipai/mapper/user/UserRoleMapper.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - EmpID, RoleID - - - insert into tb_user_role (EmpID, RoleID) - values (#{empid,jdbcType=VARCHAR}, #{roleid,jdbcType=VARCHAR}) - - - insert into tb_user_role - - - EmpID, - - - RoleID, - - - - - #{empid,jdbcType=VARCHAR}, - - - #{roleid,jdbcType=VARCHAR}, - - - - - - delete from tb_user_role where roleID = #{roleid,jdbcType=VARCHAR} - - - delete from tb_user_role where EmpID = #{EmpID,jdbcType=VARCHAR} - - - - delete from - tb_user_role - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/user/UserTimeMapper.xml b/src/com/sipai/mapper/user/UserTimeMapper.xml deleted file mode 100644 index 4e98e753..00000000 --- a/src/com/sipai/mapper/user/UserTimeMapper.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - id, userid, ip, sdate, edate, logintime - - - - delete from tb_user_time - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_user_time (id, userid, ip, - sdate, edate, logintime - ) - values (#{id,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, - #{sdate,jdbcType=TIMESTAMP}, #{edate,jdbcType=TIMESTAMP}, #{logintime,jdbcType=DOUBLE} - ) - - - insert into tb_user_time - - - id, - - - userid, - - - ip, - - - sdate, - - - edate, - - - logintime, - - - - - #{id,jdbcType=VARCHAR}, - - - #{userid,jdbcType=VARCHAR}, - - - #{ip,jdbcType=VARCHAR}, - - - #{sdate,jdbcType=TIMESTAMP}, - - - #{edate,jdbcType=TIMESTAMP}, - - - #{logintime,jdbcType=DOUBLE}, - - - - - update tb_user_time - - - userid = #{userid,jdbcType=VARCHAR}, - - - ip = #{ip,jdbcType=VARCHAR}, - - - sdate = #{sdate,jdbcType=TIMESTAMP}, - - - edate = #{edate,jdbcType=TIMESTAMP}, - - - logintime = #{logintime,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_user_time - set userid = #{userid,jdbcType=VARCHAR}, - ip = #{ip,jdbcType=VARCHAR}, - sdate = #{sdate,jdbcType=TIMESTAMP}, - edate = #{edate,jdbcType=TIMESTAMP}, - logintime = #{logintime,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/valueEngineering/EquipmentDepreciationMapper.xml b/src/com/sipai/mapper/valueEngineering/EquipmentDepreciationMapper.xml deleted file mode 100644 index 6ff52069..00000000 --- a/src/com/sipai/mapper/valueEngineering/EquipmentDepreciationMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, equipment_id, month_depreciation_rate, year_depreciation_rate, - month_depreciation, year_depreciation, total_depreciation, current_value, increase_value, - biz_id, process_section_id, residual_value - - - - delete from TB_EM_EquipmentDepreciation - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentDepreciation (id, insdt, insuser, - equipment_id, month_depreciation_rate, year_depreciation_rate, - month_depreciation, year_depreciation, total_depreciation, - current_value, increase_value, biz_id, - process_section_id, residual_value) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{equipmentId,jdbcType=VARCHAR}, #{monthDepreciationRate,jdbcType=DECIMAL}, #{yearDepreciationRate,jdbcType=DECIMAL}, - #{monthDepreciation,jdbcType=DECIMAL}, #{yearDepreciation,jdbcType=DECIMAL}, #{totalDepreciation,jdbcType=DECIMAL}, - #{currentValue,jdbcType=DECIMAL}, #{increaseValue,jdbcType=DECIMAL}, #{bizId,jdbcType=VARCHAR}, - #{processSectionId,jdbcType=VARCHAR}, #{residualValue,jdbcType=DECIMAL}) - - - insert into TB_EM_EquipmentDepreciation - - - id, - - - insdt, - - - insuser, - - - equipment_id, - - - month_depreciation_rate, - - - year_depreciation_rate, - - - month_depreciation, - - - year_depreciation, - - - total_depreciation, - - - current_value, - - - increase_value, - - - biz_id, - - - process_section_id, - - - residual_value, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{monthDepreciationRate,jdbcType=DECIMAL}, - - - #{yearDepreciationRate,jdbcType=DECIMAL}, - - - #{monthDepreciation,jdbcType=DECIMAL}, - - - #{yearDepreciation,jdbcType=DECIMAL}, - - - #{totalDepreciation,jdbcType=DECIMAL}, - - - #{currentValue,jdbcType=DECIMAL}, - - - #{increaseValue,jdbcType=DECIMAL}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{residualValue,jdbcType=DECIMAL}, - - - - - update TB_EM_EquipmentDepreciation - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - month_depreciation_rate = #{monthDepreciationRate,jdbcType=DECIMAL}, - - - year_depreciation_rate = #{yearDepreciationRate,jdbcType=DECIMAL}, - - - month_depreciation = #{monthDepreciation,jdbcType=DECIMAL}, - - - year_depreciation = #{yearDepreciation,jdbcType=DECIMAL}, - - - total_depreciation = #{totalDepreciation,jdbcType=DECIMAL}, - - - current_value = #{currentValue,jdbcType=DECIMAL}, - - - increase_value = #{increaseValue,jdbcType=DECIMAL}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - residual_value = #{residualValue,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentDepreciation - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - month_depreciation_rate = #{monthDepreciationRate,jdbcType=DECIMAL}, - year_depreciation_rate = #{yearDepreciationRate,jdbcType=DECIMAL}, - month_depreciation = #{monthDepreciation,jdbcType=DECIMAL}, - year_depreciation = #{yearDepreciation,jdbcType=DECIMAL}, - total_depreciation = #{totalDepreciation,jdbcType=DECIMAL}, - current_value = #{currentValue,jdbcType=DECIMAL}, - increase_value = #{increaseValue,jdbcType=DECIMAL}, - biz_id = #{bizId,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - residual_value = #{residualValue,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_EM_EquipmentDepreciation - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/valueEngineering/EquipmentEvaluateMapper.xml b/src/com/sipai/mapper/valueEngineering/EquipmentEvaluateMapper.xml deleted file mode 100644 index 4fe9551a..00000000 --- a/src/com/sipai/mapper/valueEngineering/EquipmentEvaluateMapper.xml +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, class_id, specification, model, total_score, economic_score, - En, efficiency_score, power, quality_score, fault_rate, intact_rate, use_rate, WOM_score, - comment_label, user_comment, use_time, ecomomic_kpi, efficiency_kpi, quality_kpi, - total_kpi - - - - delete from TB_EM_EquipmentEvaluate - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_EquipmentEvaluate (id, insdt, insuser, - class_id, specification, model, - total_score, economic_score, En, - efficiency_score, power, quality_score, - fault_rate, intact_rate, use_rate, - WOM_score, comment_label, user_comment, - use_time, ecomomic_kpi, efficiency_kpi, - quality_kpi, total_kpi) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{classId,jdbcType=VARCHAR}, #{specification,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, - #{totalScore,jdbcType=DOUBLE}, #{economicScore,jdbcType=DOUBLE}, #{en,jdbcType=DOUBLE}, - #{efficiencyScore,jdbcType=DOUBLE}, #{power,jdbcType=VARCHAR}, #{qualityScore,jdbcType=DOUBLE}, - #{faultRate,jdbcType=DOUBLE}, #{intactRate,jdbcType=DOUBLE}, #{useRate,jdbcType=DOUBLE}, - #{womScore,jdbcType=DOUBLE}, #{commentLabel,jdbcType=VARCHAR}, #{userComment,jdbcType=DOUBLE}, - #{useTime,jdbcType=VARCHAR}, #{ecomomicKpi,jdbcType=VARCHAR}, #{efficiencyKpi,jdbcType=VARCHAR}, - #{qualityKpi,jdbcType=VARCHAR}, #{totalKpi,jdbcType=VARCHAR}) - - - insert into TB_EM_EquipmentEvaluate - - - id, - - - insdt, - - - insuser, - - - class_id, - - - specification, - - - model, - - - total_score, - - - economic_score, - - - En, - - - efficiency_score, - - - power, - - - quality_score, - - - fault_rate, - - - intact_rate, - - - use_rate, - - - WOM_score, - - - comment_label, - - - user_comment, - - - use_time, - - - ecomomic_kpi, - - - efficiency_kpi, - - - quality_kpi, - - - total_kpi, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{classId,jdbcType=VARCHAR}, - - - #{specification,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{totalScore,jdbcType=DOUBLE}, - - - #{economicScore,jdbcType=DOUBLE}, - - - #{en,jdbcType=DOUBLE}, - - - #{efficiencyScore,jdbcType=DOUBLE}, - - - #{power,jdbcType=VARCHAR}, - - - #{qualityScore,jdbcType=DOUBLE}, - - - #{faultRate,jdbcType=DOUBLE}, - - - #{intactRate,jdbcType=DOUBLE}, - - - #{useRate,jdbcType=DOUBLE}, - - - #{womScore,jdbcType=DOUBLE}, - - - #{commentLabel,jdbcType=VARCHAR}, - - - #{userComment,jdbcType=DOUBLE}, - - - #{useTime,jdbcType=VARCHAR}, - - - #{ecomomicKpi,jdbcType=VARCHAR}, - - - #{efficiencyKpi,jdbcType=VARCHAR}, - - - #{qualityKpi,jdbcType=VARCHAR}, - - - #{totalKpi,jdbcType=VARCHAR}, - - - - - update TB_EM_EquipmentEvaluate - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - class_id = #{classId,jdbcType=VARCHAR}, - - - specification = #{specification,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - total_score = #{totalScore,jdbcType=DOUBLE}, - - - economic_score = #{economicScore,jdbcType=DOUBLE}, - - - En = #{en,jdbcType=DOUBLE}, - - - efficiency_score = #{efficiencyScore,jdbcType=DOUBLE}, - - - power = #{power,jdbcType=VARCHAR}, - - - quality_score = #{qualityScore,jdbcType=DOUBLE}, - - - fault_rate = #{faultRate,jdbcType=DOUBLE}, - - - intact_rate = #{intactRate,jdbcType=DOUBLE}, - - - use_rate = #{useRate,jdbcType=DOUBLE}, - - - WOM_score = #{womScore,jdbcType=DOUBLE}, - - - comment_label = #{commentLabel,jdbcType=VARCHAR}, - - - user_comment = #{userComment,jdbcType=DOUBLE}, - - - use_time = #{useTime,jdbcType=VARCHAR}, - - - ecomomic_kpi = #{ecomomicKpi,jdbcType=VARCHAR}, - - - efficiency_kpi = #{efficiencyKpi,jdbcType=VARCHAR}, - - - quality_kpi = #{qualityKpi,jdbcType=VARCHAR}, - - - total_kpi = #{totalKpi,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_EquipmentEvaluate - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - class_id = #{classId,jdbcType=VARCHAR}, - specification = #{specification,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - total_score = #{totalScore,jdbcType=DOUBLE}, - economic_score = #{economicScore,jdbcType=DOUBLE}, - En = #{en,jdbcType=DOUBLE}, - efficiency_score = #{efficiencyScore,jdbcType=DOUBLE}, - power = #{power,jdbcType=VARCHAR}, - quality_score = #{qualityScore,jdbcType=DOUBLE}, - fault_rate = #{faultRate,jdbcType=DOUBLE}, - intact_rate = #{intactRate,jdbcType=DOUBLE}, - use_rate = #{useRate,jdbcType=DOUBLE}, - WOM_score = #{womScore,jdbcType=DOUBLE}, - comment_label = #{commentLabel,jdbcType=VARCHAR}, - user_comment = #{userComment,jdbcType=DOUBLE}, - use_time = #{useTime,jdbcType=VARCHAR}, - ecomomic_kpi = #{ecomomicKpi,jdbcType=VARCHAR}, - efficiency_kpi = #{efficiencyKpi,jdbcType=VARCHAR}, - quality_kpi = #{qualityKpi,jdbcType=VARCHAR}, - total_kpi = #{totalKpi,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_EM_EquipmentEvaluate - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/valueEngineering/EquipmentModelMapper.xml b/src/com/sipai/mapper/valueEngineering/EquipmentModelMapper.xml deleted file mode 100644 index dd720c8a..00000000 --- a/src/com/sipai/mapper/valueEngineering/EquipmentModelMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, gama, lamda, x1, x2, x3, status, param1, param2, param3, param4 - - - - delete from TB_EM_Equipment_Model - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_EM_Equipment_Model (id, gama, lamda, - x1, x2, x3, status, - param1, param2, param3, - param4) - values (#{id,jdbcType=VARCHAR}, #{gama,jdbcType=DECIMAL}, #{lamda,jdbcType=DECIMAL}, - #{x1,jdbcType=DECIMAL}, #{x2,jdbcType=DECIMAL}, #{x3,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, - #{param1,jdbcType=DECIMAL}, #{param2,jdbcType=DECIMAL}, #{param3,jdbcType=DECIMAL}, - #{param4,jdbcType=DECIMAL}) - - - insert into TB_EM_Equipment_Model - - - id, - - - gama, - - - lamda, - - - x1, - - - x2, - - - x3, - - - status, - - - param1, - - - param2, - - - param3, - - - param4, - - - - - #{id,jdbcType=VARCHAR}, - - - #{gama,jdbcType=DECIMAL}, - - - #{lamda,jdbcType=DECIMAL}, - - - #{x1,jdbcType=DECIMAL}, - - - #{x2,jdbcType=DECIMAL}, - - - #{x3,jdbcType=DECIMAL}, - - - #{status,jdbcType=VARCHAR}, - - - #{param1,jdbcType=DECIMAL}, - - - #{param2,jdbcType=DECIMAL}, - - - #{param3,jdbcType=DECIMAL}, - - - #{param4,jdbcType=DECIMAL}, - - - - - update TB_EM_Equipment_Model - - - gama = #{gama,jdbcType=DECIMAL}, - - - lamda = #{lamda,jdbcType=DECIMAL}, - - - x1 = #{x1,jdbcType=DECIMAL}, - - - x2 = #{x2,jdbcType=DECIMAL}, - - - x3 = #{x3,jdbcType=DECIMAL}, - - - status = #{status,jdbcType=VARCHAR}, - - - param1 = #{param1,jdbcType=DECIMAL}, - - - param2 = #{param2,jdbcType=DECIMAL}, - - - param3 = #{param3,jdbcType=DECIMAL}, - - - param4 = #{param4,jdbcType=DECIMAL}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_EM_Equipment_Model - set gama = #{gama,jdbcType=DECIMAL}, - lamda = #{lamda,jdbcType=DECIMAL}, - x1 = #{x1,jdbcType=DECIMAL}, - x2 = #{x2,jdbcType=DECIMAL}, - x3 = #{x3,jdbcType=DECIMAL}, - status = #{status,jdbcType=VARCHAR}, - param1 = #{param1,jdbcType=DECIMAL}, - param2 = #{param2,jdbcType=DECIMAL}, - param3 = #{param3,jdbcType=DECIMAL}, - param4 = #{param4,jdbcType=DECIMAL} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_EM_Equipment_Model - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/SafeAreaMapper.xml b/src/com/sipai/mapper/visit/SafeAreaMapper.xml deleted file mode 100644 index 4c4ce672..00000000 --- a/src/com/sipai/mapper/visit/SafeAreaMapper.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, security_level, biz_id, state, type, morder, latitude, - longitude, remark, processDefId, processId, audit_man_id - - - - delete from tb_visit_safeArea - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_safeArea (id, insdt, insuser, - name, security_level, biz_id, - state, type, morder, - latitude, longitude, remark, - processDefId, processId, audit_man_id - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{securityLevel,jdbcType=INTEGER}, #{bizId,jdbcType=VARCHAR}, - #{state,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{latitude,jdbcType=DECIMAL}, #{longitude,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{auditManId,jdbcType=VARCHAR} - ) - - - insert into tb_visit_safeArea - - - id, - - - insdt, - - - insuser, - - - name, - - - security_level, - - - biz_id, - - - state, - - - type, - - - morder, - - - latitude, - - - longitude, - - - remark, - - - processDefId, - - - processId, - - - audit_man_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{securityLevel,jdbcType=INTEGER}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{state,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{remark,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - - - update tb_visit_safeArea - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - security_level = #{securityLevel,jdbcType=INTEGER}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_safeArea - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - security_level = #{securityLevel,jdbcType=INTEGER}, - biz_id = #{bizId,jdbcType=VARCHAR}, - state = #{state,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL}, - remark = #{remark,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_safeArea - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/SafeAreaPositionMapper.xml b/src/com/sipai/mapper/visit/SafeAreaPositionMapper.xml deleted file mode 100644 index 34021011..00000000 --- a/src/com/sipai/mapper/visit/SafeAreaPositionMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, latitude, longitude, biz_id, safeArea_id, state, type, morder - - - - delete from tb_visit_safeArea_position - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_safeArea_position (id, insdt, insuser, - latitude, longitude, biz_id, - safeArea_id, state, type, - morder) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{latitude,jdbcType=DECIMAL}, #{longitude,jdbcType=DECIMAL}, #{bizId,jdbcType=VARCHAR}, - #{safeareaId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, - #{morder,jdbcType=VARCHAR}) - - - insert into tb_visit_safeArea_position - - - id, - - - insdt, - - - insuser, - - - latitude, - - - longitude, - - - biz_id, - - - safeArea_id, - - - state, - - - type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{safeareaId,jdbcType=VARCHAR}, - - - #{state,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=VARCHAR}, - - - - - update tb_visit_safeArea_position - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - safeArea_id = #{safeareaId,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_safeArea_position - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL}, - biz_id = #{bizId,jdbcType=VARCHAR}, - safeArea_id = #{safeareaId,jdbcType=VARCHAR}, - state = #{state,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_safeArea_position - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/VisitApplyMapper.xml b/src/com/sipai/mapper/visit/VisitApplyMapper.xml deleted file mode 100644 index ea5195d9..00000000 --- a/src/com/sipai/mapper/visit/VisitApplyMapper.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, visit_units, lead_units, insuser, insdt, remark, number, organizational_unit, - leader_name, leader_position, contact_information, visit_time, visitors_number, purpose_content, - comments, seal_img_path, morder, state, processDefId, processId, audit_man_id, submission_time, - unit_id - - - - delete from tb_visit_apply - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_apply (id, visit_units, lead_units, - insuser, insdt, remark, - number, organizational_unit, leader_name, - leader_position, contact_information, visit_time, - visitors_number, purpose_content, comments, - seal_img_path, morder, state, - processDefId, processId, audit_man_id, - submission_time, unit_id) - values (#{id,jdbcType=VARCHAR}, #{visitUnits,jdbcType=VARCHAR}, #{leadUnits,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, - #{number,jdbcType=VARCHAR}, #{organizationalUnit,jdbcType=VARCHAR}, #{leaderName,jdbcType=VARCHAR}, - #{leaderPosition,jdbcType=VARCHAR}, #{contactInformation,jdbcType=VARCHAR}, #{visitTime,jdbcType=TIMESTAMP}, - #{visitorsNumber,jdbcType=INTEGER}, #{purposeContent,jdbcType=VARCHAR}, #{comments,jdbcType=VARCHAR}, - #{sealImgPath,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{state,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{auditManId,jdbcType=VARCHAR}, - #{submissionTime,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR}) - - - insert into tb_visit_apply - - - id, - - - visit_units, - - - lead_units, - - - insuser, - - - insdt, - - - remark, - - - number, - - - organizational_unit, - - - leader_name, - - - leader_position, - - - contact_information, - - - visit_time, - - - visitors_number, - - - purpose_content, - - - comments, - - - seal_img_path, - - - morder, - - - state, - - - processDefId, - - - processId, - - - audit_man_id, - - - submission_time, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{visitUnits,jdbcType=VARCHAR}, - - - #{leadUnits,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{number,jdbcType=VARCHAR}, - - - #{organizationalUnit,jdbcType=VARCHAR}, - - - #{leaderName,jdbcType=VARCHAR}, - - - #{leaderPosition,jdbcType=VARCHAR}, - - - #{contactInformation,jdbcType=VARCHAR}, - - - #{visitTime,jdbcType=TIMESTAMP}, - - - #{visitorsNumber,jdbcType=INTEGER}, - - - #{purposeContent,jdbcType=VARCHAR}, - - - #{comments,jdbcType=VARCHAR}, - - - #{sealImgPath,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{state,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{submissionTime,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_visit_apply - - - visit_units = #{visitUnits,jdbcType=VARCHAR}, - - - lead_units = #{leadUnits,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=VARCHAR}, - - - organizational_unit = #{organizationalUnit,jdbcType=VARCHAR}, - - - leader_name = #{leaderName,jdbcType=VARCHAR}, - - - leader_position = #{leaderPosition,jdbcType=VARCHAR}, - - - contact_information = #{contactInformation,jdbcType=VARCHAR}, - - - visit_time = #{visitTime,jdbcType=TIMESTAMP}, - - - visitors_number = #{visitorsNumber,jdbcType=INTEGER}, - - - purpose_content = #{purposeContent,jdbcType=VARCHAR}, - - - comments = #{comments,jdbcType=VARCHAR}, - - - seal_img_path = #{sealImgPath,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - state = #{state,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - submission_time = #{submissionTime,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_apply - set visit_units = #{visitUnits,jdbcType=VARCHAR}, - lead_units = #{leadUnits,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR}, - organizational_unit = #{organizationalUnit,jdbcType=VARCHAR}, - leader_name = #{leaderName,jdbcType=VARCHAR}, - leader_position = #{leaderPosition,jdbcType=VARCHAR}, - contact_information = #{contactInformation,jdbcType=VARCHAR}, - visit_time = #{visitTime,jdbcType=TIMESTAMP}, - visitors_number = #{visitorsNumber,jdbcType=INTEGER}, - purpose_content = #{purposeContent,jdbcType=VARCHAR}, - comments = #{comments,jdbcType=VARCHAR}, - seal_img_path = #{sealImgPath,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - state = #{state,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - submission_time = #{submissionTime,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_apply - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/VisitPositionMapper.xml b/src/com/sipai/mapper/visit/VisitPositionMapper.xml deleted file mode 100644 index f95c2e0d..00000000 --- a/src/com/sipai/mapper/visit/VisitPositionMapper.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, latitude, longitude, biz_id, visitors_id, dttime, state, type, - imei, worker - - - - delete from tb_visit_position - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_position (id, insdt, insuser, - latitude, longitude, biz_id, - visitors_id, dttime, state, - type, imei, worker) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{latitude,jdbcType=DECIMAL}, #{longitude,jdbcType=DECIMAL}, #{bizId,jdbcType=VARCHAR}, - #{visitorsId,jdbcType=VARCHAR}, #{dttime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER}, - #{type,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{worker,jdbcType=VARCHAR}) - - - insert into tb_visit_position - - - id, - - - insdt, - - - insuser, - - - latitude, - - - longitude, - - - biz_id, - - - visitors_id, - - - dttime, - - - state, - - - type, - - - imei, - - - worker, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{latitude,jdbcType=DECIMAL}, - - - #{longitude,jdbcType=DECIMAL}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{visitorsId,jdbcType=VARCHAR}, - - - #{dttime,jdbcType=TIMESTAMP}, - - - #{state,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{imei,jdbcType=VARCHAR}, - - - #{worker,jdbcType=VARCHAR}, - - - - - update tb_visit_position - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - latitude = #{latitude,jdbcType=DECIMAL}, - - - longitude = #{longitude,jdbcType=DECIMAL}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - visitors_id = #{visitorsId,jdbcType=VARCHAR}, - - - dttime = #{dttime,jdbcType=TIMESTAMP}, - - - state = #{state,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - imei = #{imei,jdbcType=VARCHAR}, - - - worker = #{worker,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_position - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - latitude = #{latitude,jdbcType=DECIMAL}, - longitude = #{longitude,jdbcType=DECIMAL}, - biz_id = #{bizId,jdbcType=VARCHAR}, - visitors_id = #{visitorsId,jdbcType=VARCHAR}, - dttime = #{dttime,jdbcType=TIMESTAMP}, - state = #{state,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - imei = #{imei,jdbcType=VARCHAR}, - worker = #{worker,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_position - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/VisitRegisterMapper.xml b/src/com/sipai/mapper/visit/VisitRegisterMapper.xml deleted file mode 100644 index 9b944942..00000000 --- a/src/com/sipai/mapper/visit/VisitRegisterMapper.xml +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, visit_units, visit_duration, insuser, insdt, remark, number, contact_address, - leader_name, receptionist, contact_information, visit_time, visitors_number, purpose_content, - comments_suggestions, commentator, morder, state, processDefId, processId, audit_man_id, - submission_time, apply_id, unit_id - - - - delete from tb_visit_register - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_register (id, visit_units, visit_duration, - insuser, insdt, remark, - number, contact_address, leader_name, - receptionist, contact_information, visit_time, - visitors_number, purpose_content, comments_suggestions, - commentator, morder, state, - processDefId, processId, audit_man_id, - submission_time, apply_id, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{visitUnits,jdbcType=VARCHAR}, #{visitDuration,jdbcType=DOUBLE}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, - #{number,jdbcType=VARCHAR}, #{contactAddress,jdbcType=VARCHAR}, #{leaderName,jdbcType=VARCHAR}, - #{receptionist,jdbcType=VARCHAR}, #{contactInformation,jdbcType=VARCHAR}, #{visitTime,jdbcType=TIMESTAMP}, - #{visitorsNumber,jdbcType=INTEGER}, #{purposeContent,jdbcType=VARCHAR}, #{commentsSuggestions,jdbcType=VARCHAR}, - #{commentator,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{state,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, #{auditManId,jdbcType=VARCHAR}, - #{submissionTime,jdbcType=TIMESTAMP}, #{applyId,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_visit_register - - - id, - - - visit_units, - - - visit_duration, - - - insuser, - - - insdt, - - - remark, - - - number, - - - contact_address, - - - leader_name, - - - receptionist, - - - contact_information, - - - visit_time, - - - visitors_number, - - - purpose_content, - - - comments_suggestions, - - - commentator, - - - morder, - - - state, - - - processDefId, - - - processId, - - - audit_man_id, - - - submission_time, - - - apply_id, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{visitUnits,jdbcType=VARCHAR}, - - - #{visitDuration,jdbcType=DOUBLE}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{number,jdbcType=VARCHAR}, - - - #{contactAddress,jdbcType=VARCHAR}, - - - #{leaderName,jdbcType=VARCHAR}, - - - #{receptionist,jdbcType=VARCHAR}, - - - #{contactInformation,jdbcType=VARCHAR}, - - - #{visitTime,jdbcType=TIMESTAMP}, - - - #{visitorsNumber,jdbcType=INTEGER}, - - - #{purposeContent,jdbcType=VARCHAR}, - - - #{commentsSuggestions,jdbcType=VARCHAR}, - - - #{commentator,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{state,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{auditManId,jdbcType=VARCHAR}, - - - #{submissionTime,jdbcType=TIMESTAMP}, - - - #{applyId,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_visit_register - - - visit_units = #{visitUnits,jdbcType=VARCHAR}, - - - visit_duration = #{visitDuration,jdbcType=DOUBLE}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=VARCHAR}, - - - contact_address = #{contactAddress,jdbcType=VARCHAR}, - - - leader_name = #{leaderName,jdbcType=VARCHAR}, - - - receptionist = #{receptionist,jdbcType=VARCHAR}, - - - contact_information = #{contactInformation,jdbcType=VARCHAR}, - - - visit_time = #{visitTime,jdbcType=TIMESTAMP}, - - - visitors_number = #{visitorsNumber,jdbcType=INTEGER}, - - - purpose_content = #{purposeContent,jdbcType=VARCHAR}, - - - comments_suggestions = #{commentsSuggestions,jdbcType=VARCHAR}, - - - commentator = #{commentator,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - state = #{state,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - - - submission_time = #{submissionTime,jdbcType=TIMESTAMP}, - - - apply_id = #{applyId,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_register - set visit_units = #{visitUnits,jdbcType=VARCHAR}, - visit_duration = #{visitDuration,jdbcType=DOUBLE}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - number = #{number,jdbcType=VARCHAR}, - contact_address = #{contactAddress,jdbcType=VARCHAR}, - leader_name = #{leaderName,jdbcType=VARCHAR}, - receptionist = #{receptionist,jdbcType=VARCHAR}, - contact_information = #{contactInformation,jdbcType=VARCHAR}, - visit_time = #{visitTime,jdbcType=TIMESTAMP}, - visitors_number = #{visitorsNumber,jdbcType=INTEGER}, - purpose_content = #{purposeContent,jdbcType=VARCHAR}, - comments_suggestions = #{commentsSuggestions,jdbcType=VARCHAR}, - commentator = #{commentator,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - state = #{state,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - audit_man_id = #{auditManId,jdbcType=VARCHAR}, - submission_time = #{submissionTime,jdbcType=TIMESTAMP}, - apply_id = #{applyId,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_register - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/VisitSafetyCommitmentMapper.xml b/src/com/sipai/mapper/visit/VisitSafetyCommitmentMapper.xml deleted file mode 100644 index abb14dd3..00000000 --- a/src/com/sipai/mapper/visit/VisitSafetyCommitmentMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, insuser, insdt, remark, morder, state, content, edition, unit_id - - - - delete from tb_visit_safety_commitment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_safety_commitment (id, insuser, insdt, - remark, morder, state, - content, edition, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, - #{content,jdbcType=VARCHAR}, #{edition,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_visit_safety_commitment - - - id, - - - insuser, - - - insdt, - - - remark, - - - morder, - - - state, - - - content, - - - edition, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{state,jdbcType=INTEGER}, - - - #{content,jdbcType=VARCHAR}, - - - #{edition,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_visit_safety_commitment - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - state = #{state,jdbcType=INTEGER}, - - - content = #{content,jdbcType=VARCHAR}, - - - edition = #{edition,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_safety_commitment - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - state = #{state,jdbcType=INTEGER}, - content = #{content,jdbcType=VARCHAR}, - edition = #{edition,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_safety_commitment - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/VisitSafetyCommitmentRecordMapper.xml b/src/com/sipai/mapper/visit/VisitSafetyCommitmentRecordMapper.xml deleted file mode 100644 index a42982f4..00000000 --- a/src/com/sipai/mapper/visit/VisitSafetyCommitmentRecordMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, insuser, insdt, remark, morder, state, content, promisor, commitment_time, sign_img_path - - - - delete from tb_visit_safety_commitment_record - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_safety_commitment_record (id, insuser, insdt, - remark, morder, state, - content, promisor, commitment_time, - sign_img_path) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, - #{content,jdbcType=VARCHAR}, #{promisor,jdbcType=VARCHAR}, #{commitmentTime,jdbcType=TIMESTAMP}, - #{signImgPath,jdbcType=VARCHAR}) - - - insert into tb_visit_safety_commitment_record - - - id, - - - insuser, - - - insdt, - - - remark, - - - morder, - - - state, - - - content, - - - promisor, - - - commitment_time, - - - sign_img_path, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{state,jdbcType=INTEGER}, - - - #{content,jdbcType=VARCHAR}, - - - #{promisor,jdbcType=VARCHAR}, - - - #{commitmentTime,jdbcType=TIMESTAMP}, - - - #{signImgPath,jdbcType=VARCHAR}, - - - - - update tb_visit_safety_commitment_record - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - state = #{state,jdbcType=INTEGER}, - - - content = #{content,jdbcType=VARCHAR}, - - - promisor = #{promisor,jdbcType=VARCHAR}, - - - commitment_time = #{commitmentTime,jdbcType=TIMESTAMP}, - - - sign_img_path = #{signImgPath,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_safety_commitment_record - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - state = #{state,jdbcType=INTEGER}, - content = #{content,jdbcType=VARCHAR}, - promisor = #{promisor,jdbcType=VARCHAR}, - commitment_time = #{commitmentTime,jdbcType=TIMESTAMP}, - sign_img_path = #{signImgPath,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_safety_commitment_record - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visit/VisitVisitorsMapper.xml b/src/com/sipai/mapper/visit/VisitVisitorsMapper.xml deleted file mode 100644 index 3cb5048a..00000000 --- a/src/com/sipai/mapper/visit/VisitVisitorsMapper.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - id, full_name, insuser, insdt, remark, morder, gender, age, apply_id, state, contact_information - - - - delete from tb_visit_visitors - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visit_visitors (id, full_name, insuser, - insdt, remark, morder, - gender, age, apply_id, - state, contact_information) - values (#{id,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{gender,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{applyId,jdbcType=VARCHAR}, - #{state,jdbcType=INTEGER}, #{contactInformation,jdbcType=VARCHAR}) - - - insert into tb_visit_visitors - - - id, - - - full_name, - - - insuser, - - - insdt, - - - remark, - - - morder, - - - gender, - - - age, - - - apply_id, - - - state, - - - contact_information, - - - - - #{id,jdbcType=VARCHAR}, - - - #{fullName,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{gender,jdbcType=VARCHAR}, - - - #{age,jdbcType=INTEGER}, - - - #{applyId,jdbcType=VARCHAR}, - - - #{state,jdbcType=INTEGER}, - - - #{contactInformation,jdbcType=VARCHAR}, - - - - - update tb_visit_visitors - - - full_name = #{fullName,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - gender = #{gender,jdbcType=VARCHAR}, - - - age = #{age,jdbcType=INTEGER}, - - - apply_id = #{applyId,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=INTEGER}, - - - contact_information = #{contactInformation,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visit_visitors - set full_name = #{fullName,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - gender = #{gender,jdbcType=VARCHAR}, - age = #{age,jdbcType=INTEGER}, - apply_id = #{applyId,jdbcType=VARCHAR}, - state = #{state,jdbcType=INTEGER}, - contact_information = #{contactInformation,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_visit_visitors - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/CacheDataMapper.xml b/src/com/sipai/mapper/visual/CacheDataMapper.xml deleted file mode 100644 index 577f006b..00000000 --- a/src/com/sipai/mapper/visual/CacheDataMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, dataName, mpcode, value, inivalue, active, insdt, unitId, bizname, type, morder - - - - delete from tb_visual_cacheData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_cacheData (id, dataName, mpcode, - value, inivalue, active, - insdt, unitId, bizname, - type, morder) - values (#{id,jdbcType=VARCHAR}, #{dataname,jdbcType=VARCHAR}, #{mpcode,jdbcType=VARCHAR}, - #{value,jdbcType=DOUBLE}, #{inivalue,jdbcType=DOUBLE}, #{active,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{unitid,jdbcType=VARCHAR}, #{bizname,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}) - - - insert into tb_visual_cacheData - - - id, - - - dataName, - - - mpcode, - - - value, - - - inivalue, - - - active, - - - insdt, - - - unitId, - - - bizname, - - - type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataname,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{inivalue,jdbcType=DOUBLE}, - - - #{active,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{bizname,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_visual_cacheData - - - dataName = #{dataname,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - inivalue = #{inivalue,jdbcType=DOUBLE}, - - - active = #{active,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - bizname = #{bizname,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_cacheData - set dataName = #{dataname,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - inivalue = #{inivalue,jdbcType=DOUBLE}, - active = #{active,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unitId = #{unitid,jdbcType=VARCHAR}, - bizname = #{bizname,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_cacheData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/DataTypeMapper.xml b/src/com/sipai/mapper/visual/DataTypeMapper.xml deleted file mode 100644 index d1c0ce85..00000000 --- a/src/com/sipai/mapper/visual/DataTypeMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insuser, insdt, data_type_name, morder, remark, pid - - - - delete from tb_visual_datatype - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_datatype (id, insuser, insdt, - data_type_name, morder, remark, - pid) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{dataTypeName,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}) - - - insert into tb_visual_datatype - - - id, - - - insuser, - - - insdt, - - - data_type_name, - - - morder, - - - remark, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{dataTypeName,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{remark,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_visual_datatype - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - data_type_name = #{dataTypeName,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_datatype - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - data_type_name = #{dataTypeName,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_datatype - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/InteractionMapper.xml b/src/com/sipai/mapper/visual/InteractionMapper.xml deleted file mode 100644 index d38bf0ab..00000000 --- a/src/com/sipai/mapper/visual/InteractionMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, name, morder, methodCode, parameter - - - - delete from tb_visual_interaction - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_interaction (id, insdt, insuser, - name, morder, methodCode, - parameter) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{methodcode,jdbcType=VARCHAR}, - #{parameter,jdbcType=VARCHAR}) - - - insert into tb_visual_interaction - - - id, - - - insdt, - - - insuser, - - - name, - - - morder, - - - methodCode, - - - parameter, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{methodcode,jdbcType=VARCHAR}, - - - #{parameter,jdbcType=VARCHAR}, - - - - - update tb_visual_interaction - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - methodCode = #{methodcode,jdbcType=VARCHAR}, - - - parameter = #{parameter,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_interaction - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - methodCode = #{methodcode,jdbcType=VARCHAR}, - parameter = #{parameter,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_interaction - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/JspConfigureDetailMapper.xml b/src/com/sipai/mapper/visual/JspConfigureDetailMapper.xml deleted file mode 100644 index 9414de9c..00000000 --- a/src/com/sipai/mapper/visual/JspConfigureDetailMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, data_name, mpcode, value, insdt, configure_id, morder, numTail, active, data_type, - time_type, unit, rate - - - - delete from tb_visual_jsp_configure_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_jsp_configure_detail (id, data_name, mpcode, - value, insdt, configure_id, - morder, numTail, active, - data_type, time_type, unit, - rate) - values (#{id,jdbcType=VARCHAR}, #{dataName,jdbcType=VARCHAR}, #{mpcode,jdbcType=VARCHAR}, - #{value,jdbcType=DOUBLE}, #{insdt,jdbcType=TIMESTAMP}, #{configureId,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{numtail,jdbcType=INTEGER}, #{active,jdbcType=VARCHAR}, - #{dataType,jdbcType=VARCHAR}, #{timeType,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, - #{rate,jdbcType=DOUBLE}) - - - insert into tb_visual_jsp_configure_detail - - - id, - - - data_name, - - - mpcode, - - - value, - - - insdt, - - - configure_id, - - - morder, - - - numTail, - - - active, - - - data_type, - - - time_type, - - - unit, - - - rate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataName,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{configureId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{numtail,jdbcType=INTEGER}, - - - #{active,jdbcType=VARCHAR}, - - - #{dataType,jdbcType=VARCHAR}, - - - #{timeType,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{rate,jdbcType=DOUBLE}, - - - - - update tb_visual_jsp_configure_detail - - - data_name = #{dataName,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - configure_id = #{configureId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - numTail = #{numtail,jdbcType=INTEGER}, - - - active = #{active,jdbcType=VARCHAR}, - - - data_type = #{dataType,jdbcType=VARCHAR}, - - - time_type = #{timeType,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - rate = #{rate,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_jsp_configure_detail - set data_name = #{dataName,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - configure_id = #{configureId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - numTail = #{numtail,jdbcType=INTEGER}, - active = #{active,jdbcType=VARCHAR}, - data_type = #{dataType,jdbcType=VARCHAR}, - time_type = #{timeType,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - rate = #{rate,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_jsp_configure_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/JspConfigureMapper.xml b/src/com/sipai/mapper/visual/JspConfigureMapper.xml deleted file mode 100644 index 6604837c..00000000 --- a/src/com/sipai/mapper/visual/JspConfigureMapper.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, name, pid, morder, data_type, active, pro_dataVisual_frame_id, - element_left, element_top, unit_id, select_unit_id, windows_height, windows_width - - - - delete from tb_visual_jsp_configure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_jsp_configure (id, insuser, insdt, - name, pid, morder, - data_type, active, pro_dataVisual_frame_id, - element_left, element_top, unit_id, - select_unit_id, windows_height, windows_width - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{dataType,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{proDatavisualFrameId,jdbcType=VARCHAR}, - #{elementLeft,jdbcType=DOUBLE}, #{elementTop,jdbcType=DOUBLE}, #{unitId,jdbcType=VARCHAR}, - #{selectUnitId,jdbcType=VARCHAR}, #{windowsHeight,jdbcType=DOUBLE}, #{windowsWidth,jdbcType=DOUBLE} - ) - - - insert into tb_visual_jsp_configure - - - id, - - - insuser, - - - insdt, - - - name, - - - pid, - - - morder, - - - data_type, - - - active, - - - pro_dataVisual_frame_id, - - - element_left, - - - element_top, - - - unit_id, - - - select_unit_id, - - - windows_height, - - - windows_width, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{dataType,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{proDatavisualFrameId,jdbcType=VARCHAR}, - - - #{elementLeft,jdbcType=DOUBLE}, - - - #{elementTop,jdbcType=DOUBLE}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{selectUnitId,jdbcType=VARCHAR}, - - - #{windowsHeight,jdbcType=DOUBLE}, - - - #{windowsWidth,jdbcType=DOUBLE}, - - - - - update tb_visual_jsp_configure - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - data_type = #{dataType,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - pro_dataVisual_frame_id = #{proDatavisualFrameId,jdbcType=VARCHAR}, - - - element_left = #{elementLeft,jdbcType=DOUBLE}, - - - element_top = #{elementTop,jdbcType=DOUBLE}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - select_unit_id = #{selectUnitId,jdbcType=VARCHAR}, - - - windows_height = #{windowsHeight,jdbcType=DOUBLE}, - - - windows_width = #{windowsWidth,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_jsp_configure - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - data_type = #{dataType,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - pro_dataVisual_frame_id = #{proDatavisualFrameId,jdbcType=VARCHAR}, - element_left = #{elementLeft,jdbcType=DOUBLE}, - element_top = #{elementTop,jdbcType=DOUBLE}, - unit_id = #{unitId,jdbcType=VARCHAR}, - select_unit_id = #{selectUnitId,jdbcType=VARCHAR}, - windows_height = #{windowsHeight,jdbcType=DOUBLE}, - windows_width = #{windowsWidth,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_jsp_configure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/JspElementMapper.xml b/src/com/sipai/mapper/visual/JspElementMapper.xml deleted file mode 100644 index 42748f6d..00000000 --- a/src/com/sipai/mapper/visual/JspElementMapper.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, insuser, insdt, name, element_code, style, get_value_type, value_url, pid, morder, - data_type, camera_id, active, http_url, unit_id, unit_id2, numtail - - - - delete from tb_visual_jsp_element - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_jsp_element (id, insuser, insdt, - name, element_code, style, - get_value_type, value_url, pid, - morder, data_type, camera_id, - active, http_url, unit_id,unit_id2, numtail - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{name,jdbcType=VARCHAR}, #{elementCode,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, - #{getValueType,jdbcType=VARCHAR}, #{valueUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{dataType,jdbcType=VARCHAR}, #{cameraId,jdbcType=VARCHAR}, - #{active,jdbcType=INTEGER}, #{httpUrl,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, #{unitId2,jdbcType=VARCHAR}, - #{numtail,jdbcType=INTEGER} - ) - - - insert into tb_visual_jsp_element - - - id, - - - insuser, - - - insdt, - - - name, - - - element_code, - - - style, - - - get_value_type, - - - value_url, - - - pid, - - - morder, - - - data_type, - - - camera_id, - - - active, - - - http_url, - - - unit_id, - - - unit_id2, - - - numtail, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{elementCode,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{getValueType,jdbcType=VARCHAR}, - - - #{valueUrl,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{dataType,jdbcType=VARCHAR}, - - - #{cameraId,jdbcType=VARCHAR}, - - - #{active,jdbcType=INTEGER}, - - - #{httpUrl,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{unitId2,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=INTEGER}, - - - - - update tb_visual_jsp_element - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - element_code = #{elementCode,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - get_value_type = #{getValueType,jdbcType=VARCHAR}, - - - value_url = #{valueUrl,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - data_type = #{dataType,jdbcType=VARCHAR}, - - - camera_id = #{cameraId,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=INTEGER}, - - - http_url = #{httpUrl,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - unit_id2 = #{unitId2,jdbcType=VARCHAR}, - - - numtail = #{numtail,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_jsp_element - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - element_code = #{elementCode,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - get_value_type = #{getValueType,jdbcType=VARCHAR}, - value_url = #{valueUrl,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - data_type = #{dataType,jdbcType=VARCHAR}, - camera_id = #{cameraId,jdbcType=VARCHAR}, - active = #{active,jdbcType=INTEGER}, - http_url = #{httpUrl,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - unit_id2 = #{unitId2,jdbcType=VARCHAR}, - numtail = #{numtail,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_jsp_element - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/LayoutDetailMapper.xml b/src/com/sipai/mapper/visual/LayoutDetailMapper.xml deleted file mode 100644 index 1fd95cf3..00000000 --- a/src/com/sipai/mapper/visual/LayoutDetailMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, height, width, morder, rowno, colspan, rowspan, pid - - - - delete from tb_visual_layout_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_layout_detail (id, insdt, insuser, - name, height, width, - morder, rowno, colspan, - rowspan, pid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{rowno,jdbcType=INTEGER}, #{colspan,jdbcType=INTEGER}, - #{rowspan,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}) - - - insert into tb_visual_layout_detail - - - id, - - - insdt, - - - insuser, - - - name, - - - height, - - - width, - - - morder, - - - rowno, - - - colspan, - - - rowspan, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{rowno,jdbcType=INTEGER}, - - - #{colspan,jdbcType=INTEGER}, - - - #{rowspan,jdbcType=INTEGER}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_visual_layout_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - rowno = #{rowno,jdbcType=INTEGER}, - - - colspan = #{colspan,jdbcType=INTEGER}, - - - rowspan = #{rowspan,jdbcType=INTEGER}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_layout_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - rowno = #{rowno,jdbcType=INTEGER}, - colspan = #{colspan,jdbcType=INTEGER}, - rowspan = #{rowspan,jdbcType=INTEGER}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_layout_detail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/LayoutMapper.xml b/src/com/sipai/mapper/visual/LayoutMapper.xml deleted file mode 100644 index adbe8a92..00000000 --- a/src/com/sipai/mapper/visual/LayoutMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, insuser, name, style, div_id, div_class - - - - delete from tb_visual_layout - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_layout (id, insdt, insuser, - name, style, div_id, - div_class) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{divId,jdbcType=VARCHAR}, - #{divClass,jdbcType=VARCHAR}) - - - insert into tb_visual_layout - - - id, - - - insdt, - - - insuser, - - - name, - - - style, - - - div_id, - - - div_class, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{divId,jdbcType=VARCHAR}, - - - #{divClass,jdbcType=VARCHAR}, - - - - - update tb_visual_layout - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - div_id = #{divId,jdbcType=VARCHAR}, - - - div_class = #{divClass,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_layout - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - div_id = #{divId,jdbcType=VARCHAR}, - div_class = #{divClass,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_layout - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/PlanInteractionMapper.xml b/src/com/sipai/mapper/visual/PlanInteractionMapper.xml deleted file mode 100644 index 5156dff0..00000000 --- a/src/com/sipai/mapper/visual/PlanInteractionMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, insdt, insuser, plan_id, interaction_id, parameter, morder, btnClass, btnStyle, - name,camera_id - - - - delete from tb_visual_plan_interaction - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_plan_interaction (id, insdt, insuser, - plan_id, interaction_id, parameter, - morder, btnClass, btnStyle, - name,camera_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{planId,jdbcType=VARCHAR}, #{interactionId,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{btnclass,jdbcType=VARCHAR}, #{btnstyle,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR},#{cameraId,jdbcType=VARCHAR}) - - - insert into tb_visual_plan_interaction - - - id, - - - insdt, - - - insuser, - - - plan_id, - - - interaction_id, - - - parameter, - - - morder, - - - btnClass, - - - btnStyle, - - - name, - - - camera_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{planId,jdbcType=VARCHAR}, - - - #{interactionId,jdbcType=VARCHAR}, - - - #{parameter,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{btnclass,jdbcType=VARCHAR}, - - - #{btnstyle,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{cameraId,jdbcType=VARCHAR}, - - - - - update tb_visual_plan_interaction - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - interaction_id = #{interactionId,jdbcType=VARCHAR}, - - - parameter = #{parameter,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - btnClass = #{btnclass,jdbcType=VARCHAR}, - - - btnStyle = #{btnstyle,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - camera_id = #{cameraId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_plan_interaction - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR}, - interaction_id = #{interactionId,jdbcType=VARCHAR}, - parameter = #{parameter,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - btnClass = #{btnclass,jdbcType=VARCHAR}, - btnStyle = #{btnstyle,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - camera_id = #{cameraId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_plan_interaction - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/PlanLayoutMapper.xml b/src/com/sipai/mapper/visual/PlanLayoutMapper.xml deleted file mode 100644 index fa650ac8..00000000 --- a/src/com/sipai/mapper/visual/PlanLayoutMapper.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, insdt, insuser, pid, morder, jsp_code, height, width, plan_id, layout_id, data_type,camera_id - - - - delete from tb_plan_layout - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_plan_layout (id, insdt, insuser, - pid, morder, jsp_code, - height, width, plan_id, - layout_id, data_type,camera_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{jspCode,jdbcType=VARCHAR}, - #{height,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, - #{layoutId,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR},#{cameraId,jdbcType=VARCHAR}) - - - insert into tb_plan_layout - - - id, - - - insdt, - - - insuser, - - - pid, - - - morder, - - - jsp_code, - - - height, - - - width, - - - plan_id, - - - layout_id, - - - data_type, - - - camera_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{jspCode,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{planId,jdbcType=VARCHAR}, - - - #{layoutId,jdbcType=VARCHAR}, - - - #{dataType,jdbcType=VARCHAR}, - - - #{cameraId,jdbcType=VARCHAR}, - - - - - update tb_plan_layout - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - jsp_code = #{jspCode,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - layout_id = #{layoutId,jdbcType=VARCHAR}, - - - data_type = #{dataType,jdbcType=VARCHAR}, - - - camera_id = #{cameraId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_plan_layout - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - jsp_code = #{jspCode,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR}, - layout_id = #{layoutId,jdbcType=VARCHAR}, - data_type = #{dataType,jdbcType=VARCHAR}, - camera_id = #{cameraId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_plan_layout - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/PlanMapper.xml b/src/com/sipai/mapper/visual/PlanMapper.xml deleted file mode 100644 index 00b6a21c..00000000 --- a/src/com/sipai/mapper/visual/PlanMapper.xml +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, PowerID, caption, name, description, location, target, onclick, onmouseover, - onmouseout, image, altImage, tooltip, roles, page, width, height, layout_id, background_color, - morder, lvl, active, type, mainpage, count - - - - delete from tb_plan - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_plan (id, pid, PowerID, - caption, name, description, - location, target, onclick, - onmouseover, onmouseout, image, - altImage, tooltip, roles, - page, width, height, - layout_id, background_color, morder, - lvl, active, type, - mainpage, count) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{powerid,jdbcType=VARCHAR}, - #{caption,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{location,jdbcType=VARCHAR}, #{target,jdbcType=VARCHAR}, #{onclick,jdbcType=VARCHAR}, - #{onmouseover,jdbcType=VARCHAR}, #{onmouseout,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, - #{altimage,jdbcType=VARCHAR}, #{tooltip,jdbcType=VARCHAR}, #{roles,jdbcType=VARCHAR}, - #{page,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, #{height,jdbcType=VARCHAR}, - #{layoutId,jdbcType=VARCHAR}, #{backgroundColor,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{lvl,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{mainpage,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER}) - - - insert into tb_plan - - - id, - - - pid, - - - PowerID, - - - caption, - - - name, - - - description, - - - location, - - - target, - - - onclick, - - - onmouseover, - - - onmouseout, - - - image, - - - altImage, - - - tooltip, - - - roles, - - - page, - - - width, - - - height, - - - layout_id, - - - background_color, - - - morder, - - - lvl, - - - active, - - - type, - - - mainpage, - - - count, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{powerid,jdbcType=VARCHAR}, - - - #{caption,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{location,jdbcType=VARCHAR}, - - - #{target,jdbcType=VARCHAR}, - - - #{onclick,jdbcType=VARCHAR}, - - - #{onmouseover,jdbcType=VARCHAR}, - - - #{onmouseout,jdbcType=VARCHAR}, - - - #{image,jdbcType=VARCHAR}, - - - #{altimage,jdbcType=VARCHAR}, - - - #{tooltip,jdbcType=VARCHAR}, - - - #{roles,jdbcType=VARCHAR}, - - - #{page,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{layoutId,jdbcType=VARCHAR}, - - - #{backgroundColor,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{lvl,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{mainpage,jdbcType=VARCHAR}, - - - #{count,jdbcType=INTEGER}, - - - - - update tb_plan - - - pid = #{pid,jdbcType=VARCHAR}, - - - PowerID = #{powerid,jdbcType=VARCHAR}, - - - caption = #{caption,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - location = #{location,jdbcType=VARCHAR}, - - - target = #{target,jdbcType=VARCHAR}, - - - onclick = #{onclick,jdbcType=VARCHAR}, - - - onmouseover = #{onmouseover,jdbcType=VARCHAR}, - - - onmouseout = #{onmouseout,jdbcType=VARCHAR}, - - - image = #{image,jdbcType=VARCHAR}, - - - altImage = #{altimage,jdbcType=VARCHAR}, - - - tooltip = #{tooltip,jdbcType=VARCHAR}, - - - roles = #{roles,jdbcType=VARCHAR}, - - - page = #{page,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - layout_id = #{layoutId,jdbcType=VARCHAR}, - - - background_color = #{backgroundColor,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - lvl = #{lvl,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - mainpage = #{mainpage,jdbcType=VARCHAR}, - - - count = #{count,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_plan - set pid = #{pid,jdbcType=VARCHAR}, - PowerID = #{powerid,jdbcType=VARCHAR}, - caption = #{caption,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - location = #{location,jdbcType=VARCHAR}, - target = #{target,jdbcType=VARCHAR}, - onclick = #{onclick,jdbcType=VARCHAR}, - onmouseover = #{onmouseover,jdbcType=VARCHAR}, - onmouseout = #{onmouseout,jdbcType=VARCHAR}, - image = #{image,jdbcType=VARCHAR}, - altImage = #{altimage,jdbcType=VARCHAR}, - tooltip = #{tooltip,jdbcType=VARCHAR}, - roles = #{roles,jdbcType=VARCHAR}, - page = #{page,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - layout_id = #{layoutId,jdbcType=VARCHAR}, - background_color = #{backgroundColor,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - lvl = #{lvl,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - mainpage = #{mainpage,jdbcType=VARCHAR}, - count = #{count,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_plan - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/ProcessOperationMapper.xml b/src/com/sipai/mapper/visual/ProcessOperationMapper.xml deleted file mode 100644 index 8acb7868..00000000 --- a/src/com/sipai/mapper/visual/ProcessOperationMapper.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id, data_model, process_unit, manage_project, manage_actual, manage_target, manage_unit, - manage_evaluate, cost_project, cost_actual, cost_target, cost_unit, cost_evaluate, - insdt, unit_id - - - - delete from tb_visual_processOperation - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_processOperation (id, data_model, process_unit, - manage_project, manage_actual, manage_target, - manage_unit, manage_evaluate, cost_project, - cost_actual, cost_target, cost_unit, - cost_evaluate, insdt, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{dataModel,jdbcType=VARCHAR}, #{processUnit,jdbcType=VARCHAR}, - #{manageProject,jdbcType=VARCHAR}, #{manageActual,jdbcType=DOUBLE}, #{manageTarget,jdbcType=DOUBLE}, - #{manageUnit,jdbcType=VARCHAR}, #{manageEvaluate,jdbcType=VARCHAR}, #{costProject,jdbcType=VARCHAR}, - #{costActual,jdbcType=DOUBLE}, #{costTarget,jdbcType=DOUBLE}, #{costUnit,jdbcType=VARCHAR}, - #{costEvaluate,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_visual_processOperation - - - id, - - - data_model, - - - process_unit, - - - manage_project, - - - manage_actual, - - - manage_target, - - - manage_unit, - - - manage_evaluate, - - - cost_project, - - - cost_actual, - - - cost_target, - - - cost_unit, - - - cost_evaluate, - - - insdt, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataModel,jdbcType=VARCHAR}, - - - #{processUnit,jdbcType=VARCHAR}, - - - #{manageProject,jdbcType=VARCHAR}, - - - #{manageActual,jdbcType=DOUBLE}, - - - #{manageTarget,jdbcType=DOUBLE}, - - - #{manageUnit,jdbcType=VARCHAR}, - - - #{manageEvaluate,jdbcType=VARCHAR}, - - - #{costProject,jdbcType=VARCHAR}, - - - #{costActual,jdbcType=DOUBLE}, - - - #{costTarget,jdbcType=DOUBLE}, - - - #{costUnit,jdbcType=VARCHAR}, - - - #{costEvaluate,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_visual_processOperation - - - data_model = #{dataModel,jdbcType=VARCHAR}, - - - process_unit = #{processUnit,jdbcType=VARCHAR}, - - - manage_project = #{manageProject,jdbcType=VARCHAR}, - - - manage_actual = #{manageActual,jdbcType=DOUBLE}, - - - manage_target = #{manageTarget,jdbcType=DOUBLE}, - - - manage_unit = #{manageUnit,jdbcType=VARCHAR}, - - - manage_evaluate = #{manageEvaluate,jdbcType=VARCHAR}, - - - cost_project = #{costProject,jdbcType=VARCHAR}, - - - cost_actual = #{costActual,jdbcType=DOUBLE}, - - - cost_target = #{costTarget,jdbcType=DOUBLE}, - - - cost_unit = #{costUnit,jdbcType=VARCHAR}, - - - cost_evaluate = #{costEvaluate,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_processOperation - set data_model = #{dataModel,jdbcType=VARCHAR}, - process_unit = #{processUnit,jdbcType=VARCHAR}, - manage_project = #{manageProject,jdbcType=VARCHAR}, - manage_actual = #{manageActual,jdbcType=DOUBLE}, - manage_target = #{manageTarget,jdbcType=DOUBLE}, - manage_unit = #{manageUnit,jdbcType=VARCHAR}, - manage_evaluate = #{manageEvaluate,jdbcType=VARCHAR}, - cost_project = #{costProject,jdbcType=VARCHAR}, - cost_actual = #{costActual,jdbcType=DOUBLE}, - cost_target = #{costTarget,jdbcType=DOUBLE}, - cost_unit = #{costUnit,jdbcType=VARCHAR}, - cost_evaluate = #{costEvaluate,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_processOperation - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/VisualCacheConfigMapper.xml b/src/com/sipai/mapper/visual/VisualCacheConfigMapper.xml deleted file mode 100644 index fb058e6e..00000000 --- a/src/com/sipai/mapper/visual/VisualCacheConfigMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, dataName, mpcode, inivalue, active, unitId, bizname, type, morder, dataType, - collectMode, NumTail, unit - - - - delete from tb_visual_cacheConfig - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_cacheConfig (id, dataName, mpcode, - inivalue, active, unitId, - bizname, type, morder, - dataType, collectMode, NumTail, - unit) - values (#{id,jdbcType=VARCHAR}, #{dataname,jdbcType=VARCHAR}, #{mpcode,jdbcType=VARCHAR}, - #{inivalue,jdbcType=DOUBLE}, #{active,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{bizname,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{datatype,jdbcType=VARCHAR}, #{collectmode,jdbcType=VARCHAR}, #{numtail,jdbcType=INTEGER}, - #{unit,jdbcType=VARCHAR}) - - - insert into tb_visual_cacheConfig - - - id, - - - dataName, - - - mpcode, - - - inivalue, - - - active, - - - unitId, - - - bizname, - - - type, - - - morder, - - - dataType, - - - collectMode, - - - NumTail, - - - unit, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataname,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - #{inivalue,jdbcType=DOUBLE}, - - - #{active,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{bizname,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{datatype,jdbcType=VARCHAR}, - - - #{collectmode,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=INTEGER}, - - - #{unit,jdbcType=VARCHAR}, - - - - - update tb_visual_cacheConfig - - - dataName = #{dataname,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - inivalue = #{inivalue,jdbcType=DOUBLE}, - - - active = #{active,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - bizname = #{bizname,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - dataType = #{datatype,jdbcType=VARCHAR}, - - - collectMode = #{collectmode,jdbcType=VARCHAR}, - - - NumTail = #{numtail,jdbcType=INTEGER}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_cacheConfig - set dataName = #{dataname,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR}, - inivalue = #{inivalue,jdbcType=DOUBLE}, - active = #{active,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - bizname = #{bizname,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - dataType = #{datatype,jdbcType=VARCHAR}, - collectMode = #{collectmode,jdbcType=VARCHAR}, - NumTail = #{numtail,jdbcType=INTEGER}, - unit = #{unit,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_cacheConfig - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/VisualCacheDataMapper.xml b/src/com/sipai/mapper/visual/VisualCacheDataMapper.xml deleted file mode 100644 index d31715a9..00000000 --- a/src/com/sipai/mapper/visual/VisualCacheDataMapper.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, dataName, mpcode, value, inivalue, active, insdt, unitId, bizname, type, morder, - dataType, timeType, NumTail, unit, rate - - - - delete from tb_visual_cacheData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_cacheData (id, dataName, mpcode, - value, inivalue, active, - insdt, unitId, bizname, - type, morder, dataType, - timeType, NumTail, unit, - rate) - values (#{id,jdbcType=VARCHAR}, #{dataname,jdbcType=VARCHAR}, #{mpcode,jdbcType=VARCHAR}, - #{value,jdbcType=DOUBLE}, #{inivalue,jdbcType=DOUBLE}, #{active,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{unitid,jdbcType=VARCHAR}, #{bizname,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{datatype,jdbcType=VARCHAR}, - #{timetype,jdbcType=VARCHAR}, #{numtail,jdbcType=INTEGER}, #{unit,jdbcType=VARCHAR}, - #{rate,jdbcType=DOUBLE}) - - - insert into tb_visual_cacheData - - - id, - - - dataName, - - - mpcode, - - - value, - - - inivalue, - - - active, - - - insdt, - - - unitId, - - - bizname, - - - type, - - - morder, - - - dataType, - - - timeType, - - - NumTail, - - - unit, - - - rate, - - - - - #{id,jdbcType=VARCHAR}, - - - #{dataname,jdbcType=VARCHAR}, - - - #{mpcode,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{inivalue,jdbcType=DOUBLE}, - - - #{active,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{bizname,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{datatype,jdbcType=VARCHAR}, - - - #{timetype,jdbcType=VARCHAR}, - - - #{numtail,jdbcType=INTEGER}, - - - #{unit,jdbcType=VARCHAR}, - - - #{rate,jdbcType=DOUBLE}, - - - - - update tb_visual_cacheData - - - dataName = #{dataname,jdbcType=VARCHAR}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - inivalue = #{inivalue,jdbcType=DOUBLE}, - - - active = #{active,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - bizname = #{bizname,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - dataType = #{datatype,jdbcType=VARCHAR}, - - - timeType = #{timetype,jdbcType=VARCHAR}, - - - NumTail = #{numtail,jdbcType=INTEGER}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - rate = #{rate,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_cacheData - set dataName = #{dataname,jdbcType=VARCHAR}, - mpcode = #{mpcode,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - inivalue = #{inivalue,jdbcType=DOUBLE}, - active = #{active,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unitId = #{unitid,jdbcType=VARCHAR}, - bizname = #{bizname,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - dataType = #{datatype,jdbcType=VARCHAR}, - timeType = #{timetype,jdbcType=VARCHAR}, - NumTail = #{numtail,jdbcType=INTEGER}, - unit = #{unit,jdbcType=VARCHAR}, - rate = #{rate,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - tb_visual_cacheData - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/visual/VisualJspMapper.xml b/src/com/sipai/mapper/visual/VisualJspMapper.xml deleted file mode 100644 index 15090e75..00000000 --- a/src/com/sipai/mapper/visual/VisualJspMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, insuser, insdt, jsp_code, style, name - - - - delete from tb_visual_jsp - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_visual_jsp (id, insuser, insdt, - jsp_code, style, name - ) - values (#{id,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{jspCode,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR} - ) - - - insert into tb_visual_jsp - - - id, - - - insuser, - - - insdt, - - - jsp_code, - - - style, - - - name, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{jspCode,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - - - update tb_visual_jsp - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - jsp_code = #{jspCode,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_visual_jsp - set insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - jsp_code = #{jspCode,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_visual_jsp - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpEquipmentMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpEquipmentMapper.xml deleted file mode 100644 index 1c4a0508..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpEquipmentMapper.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - id,name,code,address,status,manufacturer,model,specification - - - - - - delete - from TB_WHP_EQUIPMENT - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_EQUIPMENT ( - - ) - values ( - #{id},#{name},#{code},#{address},#{status},#{manufacturer},#{model},#{specification} - ) - - - update TB_WHP_EQUIPMENT - - name = #{name}, - code = #{code}, - address = #{address}, - status = #{status}, - manufacturer = #{manufacturer}, - model = #{model}, - specification = #{specification}, - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_EQUIPMENT ${where} - - - - - - - - diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpLiquidWasteDisposeOrgMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpLiquidWasteDisposeOrgMapper.xml deleted file mode 100644 index 299cb233..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpLiquidWasteDisposeOrgMapper.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - id,name,address,contact_person,contact_phone,status - - - - - - delete - from TB_WHP_liquid_waste_dispose_org - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_liquid_waste_dispose_org ( - - - ) - values ( - #{id},#{name},#{address},#{contactPerson},#{contactPhone},#{status} - ) - - - update TB_WHP_liquid_waste_dispose_org - - name = #{name}, - address = #{address}, - contact_person = #{contactPerson}, - contact_phone = #{contactPhone}, - status = #{status}, - - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_liquid_waste_dispose_org ${where} - - - - - diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpResidualSampleDisposeTypeMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpResidualSampleDisposeTypeMapper.xml deleted file mode 100644 index ffeb8895..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpResidualSampleDisposeTypeMapper.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - id,name,remark,status - - - - - - delete - from TB_WHP_RESIDUAL_SAMPLE_DISPOSE_TYPE - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_RESIDUAL_SAMPLE_DISPOSE_TYPE ( - - ) - values ( - #{id},#{name},#{remark},#{status} - ) - - - update TB_WHP_RESIDUAL_SAMPLE_DISPOSE_TYPE - - name = #{name}, - remark = #{remark}, - status = #{status}, - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_RESIDUAL_SAMPLE_DISPOSE_TYPE ${where} - - - - diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpSampleCodeMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpSampleCodeMapper.xml deleted file mode 100644 index b3b99104..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpSampleCodeMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id,type_id,prefix,address,address_code,test_item_ids,status,is_test,dept_ids,dept_names - - - - - - delete - from TB_WHP_SAMPLE_CODE - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_SAMPLE_CODE ( - - ) - values ( - #{id},#{typeId},#{prefix},#{address},#{addressCode},#{testItemIds},#{status},#{isTest},#{deptIds},#{deptNames} - ) - - - update TB_WHP_SAMPLE_CODE - - type_id = #{typeId}, - prefix = #{prefix}, - address = #{address}, - address_code = #{addressCode}, - test_item_ids = #{testItemIds}, - status = #{status}, - is_test = #{isTest}, - dept_ids = #{deptIds}, - dept_names = #{deptNames}, - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_SAMPLE_CODE ${where} - - - diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpSampleTypeMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpSampleTypeMapper.xml deleted file mode 100644 index 8a2db921..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpSampleTypeMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - id,name,code,dept_ids,dept_names,status,ampling_period,interval_day - - - - - - delete - from TB_WHP_SAMPLE_TYPE - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_SAMPLE_TYPE ( - - ) - values ( - #{id},#{name},#{code},#{deptIds},#{deptNames},#{status},#{amplingPeriod},#{intervalDay} - ) - - - update TB_WHP_SAMPLE_TYPE - - name = #{name}, - code = #{code}, - dept_ids = #{deptIds}, - dept_names = #{deptNames}, - status = #{status}, - ampling_period = #{amplingPeriod}, - interval_day = #{intervalDay}, - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_SAMPLE_TYPE ${where} - - - - diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpTestItemMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpTestItemMapper.xml deleted file mode 100644 index 6157d647..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpTestItemMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - id,name,equipment_id,dept_ids,status,dept_names,confirm_user_id,confirm_user_name,test_address,biz_id,assay_item_id,reagent - - - - - - delete - from TH_WHP_TEST_ITEM - where id = #{id,jdbcType=VARCHAR} - - - insert into TH_WHP_TEST_ITEM ( - - ) - values ( - #{id},#{name},#{equipmentId},#{deptIds},#{status},#{deptNames},#{confirmUserId},#{confirmUserName},#{testAddress},#{bizId},#{assayItemId},#{reagent} - ) - - - update TH_WHP_TEST_ITEM - - name = #{name}, - equipment_id = #{equipmentId}, - dept_ids = #{deptIds}, - status = #{status}, - dept_names = #{deptNames}, - confirm_user_id = #{confirmUserId}, - confirm_user_name = #{confirmUserName}, - test_address = #{testAddress}, - biz_id = #{bizId}, - assay_item_id = #{assayItemId}, - reagent = #{reagent}, - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TH_WHP_TEST_ITEM ${where} - - - - - - - - - - diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpTestItemWorkingCurveMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpTestItemWorkingCurveMapper.xml deleted file mode 100644 index 65c77154..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpTestItemWorkingCurveMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,test_item_id,kpi_id,formulatype,sort,default_value,name,unit,biz_id delete from TH_WHP_TEST_ITEM_WORKING_CURVE where id = #{id,jdbcType=VARCHAR} insert into TH_WHP_TEST_ITEM_WORKING_CURVE ( ) values ( #{id},#{test_item_id},#{kpi_id},#{formulatype},#{sort},#{default_value},#{name},#{unit},#{bizId} ) update TH_WHP_TEST_ITEM_WORKING_CURVE test_item_id = #{test_item_id}, kpi_id = #{kpi_id}, formulatype = #{formulatype}, sort = #{sort}, default_value = #{default_value}, name = #{name}, unit = #{unit}, where id = #{id,jdbcType=VARCHAR} delete from TH_WHP_TEST_ITEM_WORKING_CURVE ${where} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpTestMethodMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpTestMethodMapper.xml deleted file mode 100644 index 532778f8..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpTestMethodMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,test_item_id,method_basis,start_date,status,sort_num,biz_id delete from TH_WHP_TEST_METHOD where id = #{id,jdbcType=VARCHAR} insert into TH_WHP_TEST_METHOD ( ) values ( #{id},#{testItem_id},#{methodBasis},#{startDate},#{status},#{sortNum},#{bizId} ) update TH_WHP_TEST_METHOD test_item_id = #{testItem_id}, method_basis = #{methodBasis}, start_date = #{startDate}, status = #{status}, sort_num = #{sortNum}, where id = #{id,jdbcType=VARCHAR} delete from TH_WHP_TEST_METHOD ${where} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/baseinfo/WhpTestOrgMapper.xml b/src/com/sipai/mapper/whp/baseinfo/WhpTestOrgMapper.xml deleted file mode 100644 index 35b8ed2a..00000000 --- a/src/com/sipai/mapper/whp/baseinfo/WhpTestOrgMapper.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - id,name,address,contact_person,contact_phone,status - - - - - - delete - from TB_WHP_test_org - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_test_org ( - - - ) - values ( - #{id},#{name},#{address},#{contactPerson},#{contactPhone},#{status} - ) - - - update TB_WHP_test_org - - name = #{name}, - address = #{address}, - contact_person = #{contactPerson}, - contact_phone = #{contactPhone}, - status = #{status}, - - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_test_org ${where} - - - - - - diff --git a/src/com/sipai/mapper/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogMapper.xml b/src/com/sipai/mapper/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogMapper.xml deleted file mode 100644 index 7660c2d8..00000000 --- a/src/com/sipai/mapper/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,create_user_id,create_user_name,create_time,current_number ,last_number,dispose_id delete from TB_WHP_LIQUID_WASTE_DISPOSE_LOG where id = #{id,jdbcType=VARCHAR} insert into TB_WHP_LIQUID_WASTE_DISPOSE_LOG ( ) values ( #{id},#{createUserId},#{createUserName},#{createTime},#{currentNumber },#{lastNumber},#{disposeId} ) update TB_WHP_LIQUID_WASTE_DISPOSE_LOG create_user_id = #{createUserId}, create_user_name = #{createUserName}, create_time = #{createTime}, current_number = #{currentNumber}, last_number = #{lastNumber}, dispose_id = #{disposeId}, where id = #{id,jdbcType=VARCHAR} delete from TB_WHP_LIQUID_WASTE_DISPOSE_LOG ${where} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/liquidWasteDispose/WhpLiquidWasteDisposeMapper.xml b/src/com/sipai/mapper/whp/liquidWasteDispose/WhpLiquidWasteDisposeMapper.xml deleted file mode 100644 index 38dc0436..00000000 --- a/src/com/sipai/mapper/whp/liquidWasteDispose/WhpLiquidWasteDisposeMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,liquid_waste_type,input_time,source,number,container_type,capacity,location,transport_user_id,create_user_id,create_user_name,transport_user_name,reposition_user_id,reposition_user_name,status,ouput_date,output_user_id,output_user_name,create_time,output_reposition_user_id,output_reposition_user_name,output_location,current_number delete from TB_WHP_LIQUID_WASTE_DISPOSE where id = #{id,jdbcType=VARCHAR} insert into TB_WHP_LIQUID_WASTE_DISPOSE ( ) values ( #{id},#{liquidWasteType},#{inputTime},#{source},#{number},#{containerType},#{capacity},#{location},#{transportUserId},#{createUserId},#{createUserName},#{transportUserName},#{repositionUserId},#{repositionUserName},#{status},#{ouputDate},#{outputUserId},#{outputUserName},#{createTime},#{outputRepositionUserId},#{outputRepositionUserName},#{outputLocation},#{currentNumber} ) update TB_WHP_LIQUID_WASTE_DISPOSE liquid_waste_type = #{liquidWasteType}, input_time = #{inputTime}, source = #{source}, number = #{number}, container_type = #{containerType}, capacity = #{capacity}, location = #{location}, transport_user_id = #{transportUserId}, create_user_id = #{createUserId}, create_user_name = #{createUserName}, transport_user_name = #{transportUserName}, reposition_user_id = #{repositionUserId}, reposition_user_name = #{repositionUserName}, status = #{status}, ouput_date = #{ouputDate}, output_user_id = #{outputUserId}, output_user_name = #{outputUserName}, create_time = #{createTime}, output_reposition_user_id = #{outputRepositionUserId}, output_reposition_user_name = #{outputRepositionUserName}, output_location = #{outputLocation}, current_number = #{currentNumber}, where id = #{id,jdbcType=VARCHAR} delete from TB_WHP_LIQUID_WASTE_DISPOSE ${where} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/plan/WhpSamplingPlanMapper.xml b/src/com/sipai/mapper/whp/plan/WhpSamplingPlanMapper.xml deleted file mode 100644 index ea12e55b..00000000 --- a/src/com/sipai/mapper/whp/plan/WhpSamplingPlanMapper.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id,code,date,sample_type_id,report_date,status,dept_ids,dept_names,sample_type_name,audit_user_id,audit_user_name,accept_user_id,accept_user_name,accept_date,audit_time,audit_advice,test_org_id,is_autoPlan,autoplan_enddate,play_type,create_user_id,isSync - - - - - - delete - from TB_WHP_SAMPLING_PLAN - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_WHP_SAMPLING_PLAN ( - - ) - values ( - #{id},#{code},#{date},#{sampleTypeId},#{reportDate},#{status},#{deptIds},#{deptNames},#{sampleTypeName},#{auditUserId},#{auditUserName},#{acceptUserId},#{acceptUserName},#{acceptDate},#{auditTime},#{auditAdvice},#{testOrgId},#{isAutoPlan},#{autoplanEndDate},#{playType},#{createUserId},#{isSync} - ) - - - update TB_WHP_SAMPLING_PLAN - - code = #{code}, - date = #{date}, - sample_type_id = #{sampleTypeId}, - report_date = #{reportDate}, - status = #{status}, - dept_ids = #{deptIds}, - dept_names = #{deptNames}, - sample_type_name = #{sampleTypeName}, - audit_user_id = #{auditUserId}, - audit_user_name = #{auditUserName}, - accept_user_id = #{acceptUserId}, - accept_user_name = #{acceptUserName}, - accept_date = #{acceptDate}, - audit_time = #{auditTime}, - audit_advice = #{auditAdvice}, - test_org_id = #{testOrgId}, - is_autoPlan = #{isAutoPlan}, - autoplan_enddate = #{autoplanEndDate}, - play_type = #{playType}, - create_user_id = #{createUserId}, - isSync = #{isSync}, - - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from TB_WHP_SAMPLING_PLAN ${where} - - - - - diff --git a/src/com/sipai/mapper/whp/plan/WhpSamplingPlanTaskMapper.xml b/src/com/sipai/mapper/whp/plan/WhpSamplingPlanTaskMapper.xml deleted file mode 100644 index c8625ea9..00000000 --- a/src/com/sipai/mapper/whp/plan/WhpSamplingPlanTaskMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,plan_id,plan_code,sample_address,is_test,test_item_ids,status,sample_code,sampling_time,sampling_user_id,sampling_user_name, test_item_json,plan_date,sample_type_id,sample_type_name,report_date,sampling_env,sample_appearance,sample_state,sample_amount, residual_sample_amount,unit,record_user_id,record_user_name,dispose_type_id,dispose_type_name,dispose_time,audit_user_id, audit_user_name,dispose_status,audit_time,receiver_user_id,sample_supernatant,sample_nature,is_sample,notes,pxfySt,dept_ids,dept_names delete from TB_WHP_SAMPLING_PLAN_TASK where id = #{id,jdbcType=VARCHAR} insert into TB_WHP_SAMPLING_PLAN_TASK ( ) values ( #{id},#{planId},#{planCode},#{sampleAddress},#{isTest},#{testItemIds},#{status},#{sampleCode},#{samplingTime},#{samplingUserId},#{samplingUserName},#{testItemJson},#{planDate},#{sampleTypeId},#{sampleTypeName},#{reportDate},#{samplingEnv},#{sampleAppearance},#{sampleState},#{sampleAmount},#{residualSampleAmount},#{unit},#{recordUserId},#{recordUserName},#{disposeTypeId}, #{disposeTypeName},#{disposeTime},#{auditUserId},#{auditUserName},#{disposeStatus},#{auditTime},#{receiverUserId},#{sampleSupernatant},#{sampleNature},#{isSample},#{notes},#{pxfySt}, #{deptIds}, #{deptNames} ) update TB_WHP_SAMPLING_PLAN_TASK plan_id = #{planId}, plan_code = #{planCode}, sample_address = #{sampleAddress}, is_test = #{isTest}, test_item_ids = #{testItemIds}, status = #{status}, sample_code = #{sampleCode}, sampling_time = #{samplingTime}, sampling_user_id = #{samplingUserId}, sampling_user_name = #{samplingUserName}, test_item_json = #{testItemJson}, plan_date = #{planDate}, sample_type_id = #{sampleTypeId}, sample_type_name = #{sampleTypeName}, report_date = #{reportDate}, sampling_env = #{samplingEnv}, sample_appearance = #{sampleAppearance}, sample_state = #{sampleState}, sample_amount = #{sampleAmount}, residual_sample_amount = #{residualSampleAmount}, unit = #{unit}, record_user_id = #{recordUserId}, record_user_name = #{recordUserName}, dispose_type_id = #{disposeTypeId}, dispose_type_name = #{disposeTypeName}, dispose_time = #{disposeTime}, audit_user_id = #{auditUserId}, audit_user_name = #{auditUserName}, dispose_status = #{disposeStatus}, audit_time = #{auditTime}, receiver_user_id = #{receiverUserId}, sample_nature = #{sampleNature}, sample_supernatant = #{sampleSupernatant}, is_sample = #{isSample}, notes = #{notes}, notes = #{pxfySt}, dept_ids = #{deptIds}, dept_names = #{deptNames}, where id = #{id,jdbcType=VARCHAR} delete from TB_WHP_SAMPLING_PLAN_TASK ${where} update TB_WHP_SAMPLING_PLAN_TASK set status = #{status} where plan_id = #{planId} and plan_code =#{plan_code} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/test/WhpSamplingPlanTaskTestConfirmMapper.xml b/src/com/sipai/mapper/whp/test/WhpSamplingPlanTaskTestConfirmMapper.xml deleted file mode 100644 index c1f4741e..00000000 --- a/src/com/sipai/mapper/whp/test/WhpSamplingPlanTaskTestConfirmMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id ,plan_id,plan_code,sample_type_id,sample_type_name,confirm_user_id,confirm_user_name,confirm_date,status,test_user_id,test_user_name,test_item_id,test_item_name,temperature,reagent,test_date,equipment_id,equipment_name,equipment_code,test_address,method,work_curve_id,work_curve_name,sampling_date,report_date,confirm_advice,plan_date,isSync delete from TB_WHP_SAMPLING_PLAN_TASK_TEST_CONFIRM where id = #{id,jdbcType=VARCHAR} insert into TB_WHP_SAMPLING_PLAN_TASK_TEST_CONFIRM ( ) values ( #{id},#{planId},#{planCode},#{sampleTypeId},#{sampleTypeName},#{confirmUserId},#{confirmUserName},#{confirmDate},#{status},#{testUserId},#{testUserName},#{testItemId},#{testItemName},#{temperature},#{reagent},#{testDate},#{equipmentId},#{equipmentName},#{equipmentCode},#{testAddress},#{method},#{workCurveId},#{workCurveName},#{samplingDate},#{reportDate},#{confirmAdvice},#{planDate},#{isSync} ) update TB_WHP_SAMPLING_PLAN_TASK_TEST_CONFIRM plan_id = #{planId}, plan_code = #{planCode}, sample_type_id = #{sampleTypeId}, sample_type_name = #{sampleTypeName}, confirm_user_id = #{confirmUserId}, confirm_user_name = #{confirmUserName}, confirm_date = #{confirmDate}, status = #{status}, test_user_id = #{testUserId}, test_user_name = #{testUserName}, test_item_id = #{testItemId}, test_item_name = #{testItemName}, temperature = #{temperature}, reagent = #{reagent}, test_date = #{testDate}, equipment_id = #{equipmentId}, equipment_name = #{equipmentName}, equipment_code = #{equipmentCode}, test_address = #{testAddress}, method = #{method}, work_curve_id = #{workCurveId}, work_curve_name = #{workCurveName}, sampling_date = #{samplingDate}, report_date = #{reportDate}, confirm_advice = #{confirmAdvice}, plan_date = #{planDate}, plan_date = #{isSync}, where id = #{id,jdbcType=VARCHAR} delete from TB_WHP_SAMPLING_PLAN_TASK_TEST_CONFIRM ${where} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/test/WhpSamplingPlanTaskTestItemMapper.xml b/src/com/sipai/mapper/whp/test/WhpSamplingPlanTaskTestItemMapper.xml deleted file mode 100644 index 23a92bf0..00000000 --- a/src/com/sipai/mapper/whp/test/WhpSamplingPlanTaskTestItemMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,plan_id,plan_code,sample_type_id,sample_type_name, plan_date,report_date,samping_date,status,test_confirm_id, sample_code,use_amount,container_code,container_weight_first, container_weight_second,container_weight_final,all_weight_first, all_weight_second,all_weight_final,diff_value,result_value, test_item_id,test_item_name,unit,detected,pxfySt delete from TB_WHP_SAMPLING_PLAN_TASK_TEST_ITEM where id = #{id,jdbcType=VARCHAR} insert into TB_WHP_SAMPLING_PLAN_TASK_TEST_ITEM ( ) values ( #{id},#{planId},#{planCode},#{sampleTypeId},#{sampleTypeName},#{planDate}, #{reportDate},#{sampingDate},#{status},#{testConfirmId},#{sampleCode},#{useAmount}, #{containerCode},#{containerWeightFirst},#{containerWeightSecond},#{containerWeightFinal}, #{allWeightFirst},#{allWeightSecond},#{allWeightFinal},#{diffValue}, #{resultValue},#{testItemId},#{testItemName},#{unit},#{detected},#{pxfySt} ) update TB_WHP_SAMPLING_PLAN_TASK_TEST_ITEM plan_id = #{planId}, plan_code = #{planCode}, sample_type_id = #{sampleTypeId}, sample_type_name = #{sampleTypeName}, plan_date = #{planDate}, report_date = #{reportDate}, samping_date = #{sampingDate}, status = #{status}, test_confirm_id = #{testConfirmId}, sample_code = #{sampleCode}, use_amount = #{useAmount}, container_code = #{containerCode}, container_weight_first = #{containerWeightFirst}, container_weight_second = #{containerWeightSecond}, container_weight_final = #{containerWeightFinal}, all_weight_first = #{allWeightFirst}, all_weight_second = #{allWeightSecond}, all_weight_final = #{allWeightFinal}, diff_value = #{diffValue}, result_value = #{resultValue}, test_item_id = #{testItemId}, test_item_name = #{testItemName}, unit = #{unit}, detected = #{detected}, pxfySt = #{pxfySt}, where id = #{id,jdbcType=VARCHAR} delete from TB_WHP_SAMPLING_PLAN_TASK_TEST_ITEM ${where} update TB_WHP_SAMPLING_PLAN_TASK_TEST_ITEM set test_confirm_id = #{id} where plan_id = #{planId} and test_item_id = #{testItemId} update TB_WHP_SAMPLING_PLAN_TASK_TEST_ITEM set status = #{status} where test_confirm_id = #{testConfirmId} \ No newline at end of file diff --git a/src/com/sipai/mapper/whp/test/WhpTaskItemCurveMapper.xml b/src/com/sipai/mapper/whp/test/WhpTaskItemCurveMapper.xml deleted file mode 100644 index a3bbb5f7..00000000 --- a/src/com/sipai/mapper/whp/test/WhpTaskItemCurveMapper.xml +++ /dev/null @@ -1 +0,0 @@ - id,task_test_item_id,name,unit,working_curve_id,calculated_value,sample_code,plan_code delete from TH_WHP_TASK_ITEM_CURVE where id = #{id,jdbcType=VARCHAR} insert into TH_WHP_TASK_ITEM_CURVE ( ) values ( #{id},#{task_test_item_id},#{name},#{unit},#{working_curve_id},#{calculated_value},#{sample_code},#{plan_code} ) update TH_WHP_TASK_ITEM_CURVE task_test_item_id = #{task_test_item_id}, name = #{name}, unit = #{unit}, working_curve_id = #{working_curve_id}, calculated_value = #{calculated_value}, where id = #{id,jdbcType=VARCHAR} delete from TH_WHP_TASK_ITEM_CURVE ${where} \ No newline at end of file diff --git a/src/com/sipai/mapper/work/AlarmTypesMapper.xml b/src/com/sipai/mapper/work/AlarmTypesMapper.xml deleted file mode 100644 index 902d80a9..00000000 --- a/src/com/sipai/mapper/work/AlarmTypesMapper.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - id, name, pid - - - - delete from tb_work_alarm_types - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_alarm_types (id, name, pid - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR} - ) - - - insert into tb_work_alarm_types - - - id, - - - name, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_work_alarm_types - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_alarm_types - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_alarm_types - ${where} - - - diff --git a/src/com/sipai/mapper/work/AreaManageMapper.xml b/src/com/sipai/mapper/work/AreaManageMapper.xml deleted file mode 100644 index e0879cc1..00000000 --- a/src/com/sipai/mapper/work/AreaManageMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, fid, pid, name, coordinates_pic, coordinates_position, powerids, - alarmTypeid, remark, entranceStatus, modelId, record_status, layer, turn, enlargement, - enlargementLeft - - - - delete from tb_work_areaManage - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_areaManage (id, insdt, insuser, - fid, pid, name, coordinates_pic, - coordinates_position, powerids, alarmTypeid, - remark, entranceStatus, modelId, - record_status, layer, turn, - enlargement, enlargementLeft) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{fid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{coordinatesPic,jdbcType=VARCHAR}, - #{coordinatesPosition,jdbcType=VARCHAR}, #{powerids,jdbcType=VARCHAR}, #{alarmtypeid,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{entrancestatus,jdbcType=BIT}, #{modelid,jdbcType=VARCHAR}, - #{recordStatus,jdbcType=VARCHAR}, #{layer,jdbcType=VARCHAR}, #{turn,jdbcType=VARCHAR}, - #{enlargement,jdbcType=DOUBLE}, #{enlargementleft,jdbcType=DOUBLE}) - - - insert into tb_work_areaManage - - - id, - - - insdt, - - - insuser, - - - fid, - - - pid, - - - name, - - - coordinates_pic, - - - coordinates_position, - - - powerids, - - - alarmTypeid, - - - remark, - - - entranceStatus, - - - modelId, - - - record_status, - - - layer, - - - turn, - - - enlargement, - - - enlargementLeft, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{fid,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{coordinatesPic,jdbcType=VARCHAR}, - - - #{coordinatesPosition,jdbcType=VARCHAR}, - - - #{powerids,jdbcType=VARCHAR}, - - - #{alarmtypeid,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{entrancestatus,jdbcType=BIT}, - - - #{modelid,jdbcType=VARCHAR}, - - - #{recordStatus,jdbcType=VARCHAR}, - - - #{layer,jdbcType=VARCHAR}, - - - #{turn,jdbcType=VARCHAR}, - - - #{enlargement,jdbcType=DOUBLE}, - - - #{enlargementleft,jdbcType=DOUBLE}, - - - - - update tb_work_areaManage - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - fid = #{fid,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - coordinates_pic = #{coordinatesPic,jdbcType=VARCHAR}, - - - coordinates_position = #{coordinatesPosition,jdbcType=VARCHAR}, - - - powerids = #{powerids,jdbcType=VARCHAR}, - - - alarmTypeid = #{alarmtypeid,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - entranceStatus = #{entrancestatus,jdbcType=BIT}, - - - modelId = #{modelid,jdbcType=VARCHAR}, - - - record_status = #{recordStatus,jdbcType=VARCHAR}, - - - layer = #{layer,jdbcType=VARCHAR}, - - - turn = #{turn,jdbcType=VARCHAR}, - - - enlargement = #{enlargement,jdbcType=DOUBLE}, - - - enlargementLeft = #{enlargementleft,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_areaManage - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - fid = #{fid,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - coordinates_pic = #{coordinatesPic,jdbcType=VARCHAR}, - coordinates_position = #{coordinatesPosition,jdbcType=VARCHAR}, - powerids = #{powerids,jdbcType=VARCHAR}, - alarmTypeid = #{alarmtypeid,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - entranceStatus = #{entrancestatus,jdbcType=BIT}, - modelId = #{modelid,jdbcType=VARCHAR}, - record_status = #{recordStatus,jdbcType=VARCHAR}, - layer = #{layer,jdbcType=VARCHAR}, - turn = #{turn,jdbcType=VARCHAR}, - enlargement = #{enlargement,jdbcType=DOUBLE}, - enlargementLeft = #{enlargementleft,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_areaManage - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/AutoAlertMapper.xml b/src/com/sipai/mapper/work/AutoAlertMapper.xml deleted file mode 100644 index 778af174..00000000 --- a/src/com/sipai/mapper/work/AutoAlertMapper.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, name, active, alert_type, describe, morder, alert_date, biz_id - - - - delete from TB_Auto_Alert - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_Auto_Alert (id, insdt, insuser, - name, active, alert_type, - describe, morder, alert_date, - biz_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{active,jdbcType=BIT}, #{alertType,jdbcType=VARCHAR}, - #{describe,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{alertDate,jdbcType=INTEGER}, - #{bizId,jdbcType=VARCHAR}) - - - insert into TB_Auto_Alert - - - id, - - - insdt, - - - insuser, - - - name, - - - active, - - - alert_type, - - - describe, - - - morder, - - - alert_date, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{active,jdbcType=BIT}, - - - #{alertType,jdbcType=VARCHAR}, - - - #{describe,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{alertDate,jdbcType=INTEGER}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update TB_Auto_Alert - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=BIT}, - - - alert_type = #{alertType,jdbcType=VARCHAR}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - alert_date = #{alertDate,jdbcType=INTEGER}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_Auto_Alert - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - active = #{active,jdbcType=BIT}, - alert_type = #{alertType,jdbcType=VARCHAR}, - describe = #{describe,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - alert_date = #{alertDate,jdbcType=INTEGER}, - biz_id = #{bizId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from - TB_Auto_Alert - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/CameraDetailMapper.xml b/src/com/sipai/mapper/work/CameraDetailMapper.xml deleted file mode 100644 index 43a4455e..00000000 --- a/src/com/sipai/mapper/work/CameraDetailMapper.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - - - id, cameraid, algorithmid, modelid, status, Identify_areas, pointid, vision_areas, - v_areas_type, i_areas_type - - - - delete from tb_work_camera_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_camera_detail (id, cameraid, algorithmid, - modelid, status, Identify_areas, - pointid, vision_areas, v_areas_type, i_areas_type - ) - values (#{id,jdbcType=VARCHAR}, #{cameraid,jdbcType=VARCHAR}, #{algorithmid,jdbcType=VARCHAR}, - #{modelid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{identifyAreas,jdbcType=VARCHAR}, - #{pointid,jdbcType=VARCHAR}, #{visionAreas,jdbcType=VARCHAR}, #{vAreasType,jdbcType=VARCHAR}, - #{iAreasType,jdbcType=VARCHAR} - ) - - - insert into tb_work_camera_detail - - - id, - - - cameraid, - - - algorithmid, - - - modelid, - - - status, - - - Identify_areas, - - - pointid, - - - vision_areas, - - - v_areas_type, - - - i_areas_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{cameraid,jdbcType=VARCHAR}, - - - #{algorithmid,jdbcType=VARCHAR}, - - - #{modelid,jdbcType=VARCHAR}, - - - #{status,jdbcType=VARCHAR}, - - - #{identifyAreas,jdbcType=VARCHAR}, - - - #{pointid,jdbcType=VARCHAR}, - - - #{visionAreas,jdbcType=VARCHAR}, - - - #{vAreasType,jdbcType=VARCHAR}, - - - #{iAreasType,jdbcType=VARCHAR}, - - - - - update tb_work_camera_detail - - - cameraid = #{cameraid,jdbcType=VARCHAR}, - - - algorithmid = #{algorithmid,jdbcType=VARCHAR}, - - - modelid = #{modelid,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=VARCHAR}, - - - Identify_areas = #{identifyAreas,jdbcType=VARCHAR}, - - - pointid = #{pointid,jdbcType=VARCHAR}, - - - vision_areas = #{visionAreas,jdbcType=VARCHAR}, - - - v_areas_type = #{vAreasType,jdbcType=VARCHAR}, - - - i_areas_type = #{iAreasType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_camera_detail - set cameraid = #{cameraid,jdbcType=VARCHAR}, - algorithmid = #{algorithmid,jdbcType=VARCHAR}, - modelid = #{modelid,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, - Identify_areas = #{identifyAreas,jdbcType=VARCHAR}, - pointid = #{pointid,jdbcType=VARCHAR}, - vision_areas = #{visionAreas,jdbcType=VARCHAR}, - v_areas_type = #{vAreasType,jdbcType=VARCHAR} - i_areas_type = #{iAreasType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from - tb_work_camera_detail - ${where} - - diff --git a/src/com/sipai/mapper/work/CameraFileMapper.xml b/src/com/sipai/mapper/work/CameraFileMapper.xml deleted file mode 100644 index 78c35e15..00000000 --- a/src/com/sipai/mapper/work/CameraFileMapper.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, masterid, filename, abspath, filepath, type, size, pointId - - - - delete from tb_work_camera_File - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_camera_File (id, insdt, insuser, - masterid, filename, abspath, - filepath, type, size, - pointId) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{masterid,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{abspath,jdbcType=VARCHAR}, - #{filepath,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{size,jdbcType=INTEGER}, - #{pointId,jdbcType=VARCHAR}) - - - insert into tb_work_camera_File - - - id, - - - insdt, - - - insuser, - - - masterid, - - - filename, - - - abspath, - - - filepath, - - - type, - - - size, - - - pointId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{masterid,jdbcType=VARCHAR}, - - - #{filename,jdbcType=VARCHAR}, - - - #{abspath,jdbcType=VARCHAR}, - - - #{filepath,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{size,jdbcType=INTEGER}, - - - #{pointId,jdbcType=VARCHAR}, - - - - - update tb_work_camera_File - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - masterid = #{masterid,jdbcType=VARCHAR}, - - - filename = #{filename,jdbcType=VARCHAR}, - - - abspath = #{abspath,jdbcType=VARCHAR}, - - - filepath = #{filepath,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - size = #{size,jdbcType=INTEGER}, - - - pointId = #{pointId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_work_camera_File ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/CameraMapper.xml b/src/com/sipai/mapper/work/CameraMapper.xml deleted file mode 100644 index 6672cf93..00000000 --- a/src/com/sipai/mapper/work/CameraMapper.xml +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , bizid, url, insuser, insdt, name, type, channel, style, username, password, active, - viewscopes, processsectionid, netUrl, phoneUrl, configid, configtype, isSavePic, - savePicNum, savePicSt, isNeedAlarm,morder - - - - delete - from tb_work_camera - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_camera (id, bizid, url, - insuser, insdt, name, - type, channel, style, - username, password, active, - viewscopes, processsectionid, netUrl, - phoneUrl, configid, configtype, - isSavePic, savePicNum, savePicSt, - isNeedAlarm, morder) - values (#{id,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, - #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{viewscopes,jdbcType=VARCHAR}, #{processsectionid,jdbcType=VARCHAR}, #{neturl,jdbcType=VARCHAR}, - #{phoneurl,jdbcType=VARCHAR}, #{configid,jdbcType=VARCHAR}, #{configtype,jdbcType=VARCHAR}, - #{issavepic,jdbcType=VARCHAR}, #{savepicnum,jdbcType=VARCHAR}, #{savepicst,jdbcType=VARCHAR}, - #{isneedalarm,jdbcType=VARCHAR}, #{isneedalarm,jdbcType=INTEGER}) - - - insert into tb_work_camera - - - id, - - - bizid, - - - url, - - - insuser, - - - insdt, - - - name, - - - type, - - - channel, - - - style, - - - username, - - - password, - - - active, - - - viewscopes, - - - processsectionid, - - - netUrl, - - - phoneUrl, - - - configid, - - - configtype, - - - isSavePic, - - - savePicNum, - - - savePicSt, - - - isNeedAlarm, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{channel,jdbcType=VARCHAR}, - - - #{style,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{password,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{viewscopes,jdbcType=VARCHAR}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{neturl,jdbcType=VARCHAR}, - - - #{phoneurl,jdbcType=VARCHAR}, - - - #{configid,jdbcType=VARCHAR}, - - - #{configtype,jdbcType=VARCHAR}, - - - #{issavepic,jdbcType=VARCHAR}, - - - #{savepicnum,jdbcType=VARCHAR}, - - - #{savepicst,jdbcType=VARCHAR}, - - - #{isneedalarm,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - - update tb_work_camera - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - channel = #{channel,jdbcType=VARCHAR}, - - - style = #{style,jdbcType=VARCHAR}, - - - username = #{username,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - viewscopes = #{viewscopes,jdbcType=VARCHAR}, - - - processsectionid = #{processsectionid,jdbcType=VARCHAR}, - - - netUrl = #{neturl,jdbcType=VARCHAR}, - - - phoneUrl = #{phoneurl,jdbcType=VARCHAR}, - - - configid = #{configid,jdbcType=VARCHAR}, - - - configtype = #{configtype,jdbcType=VARCHAR}, - - - isSavePic = #{issavepic,jdbcType=VARCHAR}, - - - savePicNum = #{savepicnum,jdbcType=VARCHAR}, - - - savePicSt = #{savepicst,jdbcType=VARCHAR}, - - - isNeedAlarm = #{isneedalarm,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_camera - set bizid = #{bizid,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - channel = #{channel,jdbcType=VARCHAR}, - style = #{style,jdbcType=VARCHAR}, - username = #{username,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - viewscopes = #{viewscopes,jdbcType=VARCHAR}, - processsectionid = #{processsectionid,jdbcType=VARCHAR}, - netUrl = #{neturl,jdbcType=VARCHAR}, - phoneUrl = #{phoneurl,jdbcType=VARCHAR}, - configid = #{configid,jdbcType=VARCHAR}, - configtype = #{configtype,jdbcType=VARCHAR}, - isSavePic = #{issavepic,jdbcType=VARCHAR}, - savePicNum = #{savepicnum,jdbcType=VARCHAR}, - savePicSt = #{savepicst,jdbcType=VARCHAR}, - isNeedAlarm = #{isneedalarm,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_work_camera ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/CameraNVRMapper.xml b/src/com/sipai/mapper/work/CameraNVRMapper.xml deleted file mode 100644 index 0c60c3b4..00000000 --- a/src/com/sipai/mapper/work/CameraNVRMapper.xml +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, name, ip, brand, type, model, picpath, state, motionDetection, - disasterAlarm, waibusuanfa, processes, username, password, cron, mcron, hcron, dcron, - takePhotoCron, picsource, screenshotscron, mscreenshotscron, hscreenshotscron, dscreenshotscron, - screenshotscronstate, diskid, modbusfigid, readRegister, writeRegister, channel, - port, areaManageId, ip_nvr, username_nvr, password_nvr, channel_nvr, areaid - - - - delete from tb_work_camera_nvr - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_camera_nvr (id, insdt, insuser, - name, ip, brand, type, - model, picpath, state, - motionDetection, disasterAlarm, waibusuanfa, - processes, username, password, - cron, mcron, hcron, - dcron, takePhotoCron, picsource, - screenshotscron, mscreenshotscron, hscreenshotscron, - dscreenshotscron, screenshotscronstate, diskid, - modbusfigid, readRegister, writeRegister, - channel, port, areaManageId, - ip_nvr, username_nvr, password_nvr, - channel_nvr, areaid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{brand,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{model,jdbcType=VARCHAR}, #{picpath,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, - #{motiondetection,jdbcType=BIT}, #{disasteralarm,jdbcType=BIT}, #{waibusuanfa,jdbcType=VARCHAR}, - #{processes,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, - #{cron,jdbcType=INTEGER}, #{mcron,jdbcType=INTEGER}, #{hcron,jdbcType=INTEGER}, - #{dcron,jdbcType=INTEGER}, #{takephotocron,jdbcType=BIT}, #{picsource,jdbcType=VARCHAR}, - #{screenshotscron,jdbcType=INTEGER}, #{mscreenshotscron,jdbcType=INTEGER}, #{hscreenshotscron,jdbcType=INTEGER}, - #{dscreenshotscron,jdbcType=INTEGER}, #{screenshotscronstate,jdbcType=BIT}, #{diskid,jdbcType=VARCHAR}, - #{modbusfigid,jdbcType=VARCHAR}, #{readregister,jdbcType=VARCHAR}, #{writeregister,jdbcType=VARCHAR}, - #{channel,jdbcType=INTEGER}, #{port,jdbcType=INTEGER}, #{areamanageid,jdbcType=VARCHAR}, - #{ipNvr,jdbcType=VARCHAR}, #{usernameNvr,jdbcType=VARCHAR}, #{passwordNvr,jdbcType=VARCHAR}, - #{channelNvr,jdbcType=VARCHAR}, #{areaid,jdbcType=VARCHAR}) - - - insert into tb_work_camera_nvr - - - id, - - - insdt, - - - insuser, - - - name, - - - ip, - - - brand, - - - type, - - - model, - - - picpath, - - - state, - - - motionDetection, - - - disasterAlarm, - - - waibusuanfa, - - - processes, - - - username, - - - password, - - - cron, - - - mcron, - - - hcron, - - - dcron, - - - takePhotoCron, - - - picsource, - - - screenshotscron, - - - mscreenshotscron, - - - hscreenshotscron, - - - dscreenshotscron, - - - screenshotscronstate, - - - diskid, - - - modbusfigid, - - - readRegister, - - - writeRegister, - - - channel, - - - port, - - - areaManageId, - - - ip_nvr, - - - username_nvr, - - - password_nvr, - - - channel_nvr, - - - areaid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{ip,jdbcType=VARCHAR}, - - - #{brand,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{model,jdbcType=VARCHAR}, - - - #{picpath,jdbcType=VARCHAR}, - - - #{state,jdbcType=VARCHAR}, - - - #{motiondetection,jdbcType=BIT}, - - - #{disasteralarm,jdbcType=BIT}, - - - #{waibusuanfa,jdbcType=VARCHAR}, - - - #{processes,jdbcType=VARCHAR}, - - - #{username,jdbcType=VARCHAR}, - - - #{password,jdbcType=VARCHAR}, - - - #{cron,jdbcType=INTEGER}, - - - #{mcron,jdbcType=INTEGER}, - - - #{hcron,jdbcType=INTEGER}, - - - #{dcron,jdbcType=INTEGER}, - - - #{takephotocron,jdbcType=BIT}, - - - #{picsource,jdbcType=VARCHAR}, - - - #{screenshotscron,jdbcType=INTEGER}, - - - #{mscreenshotscron,jdbcType=INTEGER}, - - - #{hscreenshotscron,jdbcType=INTEGER}, - - - #{dscreenshotscron,jdbcType=INTEGER}, - - - #{screenshotscronstate,jdbcType=BIT}, - - - #{diskid,jdbcType=VARCHAR}, - - - #{modbusfigid,jdbcType=VARCHAR}, - - - #{readregister,jdbcType=VARCHAR}, - - - #{writeregister,jdbcType=VARCHAR}, - - - #{channel,jdbcType=INTEGER}, - - - #{port,jdbcType=INTEGER}, - - - #{areamanageid,jdbcType=VARCHAR}, - - - #{ipNvr,jdbcType=VARCHAR}, - - - #{usernameNvr,jdbcType=VARCHAR}, - - - #{passwordNvr,jdbcType=VARCHAR}, - - - #{channelNvr,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - - - update tb_work_camera_nvr - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - ip = #{ip,jdbcType=VARCHAR}, - - - brand = #{brand,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - model = #{model,jdbcType=VARCHAR}, - - - picpath = #{picpath,jdbcType=VARCHAR}, - - - state = #{state,jdbcType=VARCHAR}, - - - motionDetection = #{motiondetection,jdbcType=BIT}, - - - disasterAlarm = #{disasteralarm,jdbcType=BIT}, - - - waibusuanfa = #{waibusuanfa,jdbcType=VARCHAR}, - - - processes = #{processes,jdbcType=VARCHAR}, - - - username = #{username,jdbcType=VARCHAR}, - - - password = #{password,jdbcType=VARCHAR}, - - - cron = #{cron,jdbcType=INTEGER}, - - - mcron = #{mcron,jdbcType=INTEGER}, - - - hcron = #{hcron,jdbcType=INTEGER}, - - - dcron = #{dcron,jdbcType=INTEGER}, - - - takePhotoCron = #{takephotocron,jdbcType=BIT}, - - - picsource = #{picsource,jdbcType=VARCHAR}, - - - screenshotscron = #{screenshotscron,jdbcType=INTEGER}, - - - mscreenshotscron = #{mscreenshotscron,jdbcType=INTEGER}, - - - hscreenshotscron = #{hscreenshotscron,jdbcType=INTEGER}, - - - dscreenshotscron = #{dscreenshotscron,jdbcType=INTEGER}, - - - screenshotscronstate = #{screenshotscronstate,jdbcType=BIT}, - - - diskid = #{diskid,jdbcType=VARCHAR}, - - - modbusfigid = #{modbusfigid,jdbcType=VARCHAR}, - - - readRegister = #{readregister,jdbcType=VARCHAR}, - - - writeRegister = #{writeregister,jdbcType=VARCHAR}, - - - channel = #{channel,jdbcType=INTEGER}, - - - port = #{port,jdbcType=INTEGER}, - - - areaManageId = #{areamanageid,jdbcType=VARCHAR}, - - - ip_nvr = #{ipNvr,jdbcType=VARCHAR}, - - - username_nvr = #{usernameNvr,jdbcType=VARCHAR}, - - - password_nvr = #{passwordNvr,jdbcType=VARCHAR}, - - - channel_nvr = #{channelNvr,jdbcType=VARCHAR}, - - - areaid = #{areaid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_camera_nvr - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - ip = #{ip,jdbcType=VARCHAR}, - brand = #{brand,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - model = #{model,jdbcType=VARCHAR}, - picpath = #{picpath,jdbcType=VARCHAR}, - state = #{state,jdbcType=VARCHAR}, - motionDetection = #{motiondetection,jdbcType=BIT}, - disasterAlarm = #{disasteralarm,jdbcType=BIT}, - waibusuanfa = #{waibusuanfa,jdbcType=VARCHAR}, - processes = #{processes,jdbcType=VARCHAR}, - username = #{username,jdbcType=VARCHAR}, - password = #{password,jdbcType=VARCHAR}, - cron = #{cron,jdbcType=INTEGER}, - mcron = #{mcron,jdbcType=INTEGER}, - hcron = #{hcron,jdbcType=INTEGER}, - dcron = #{dcron,jdbcType=INTEGER}, - takePhotoCron = #{takephotocron,jdbcType=BIT}, - picsource = #{picsource,jdbcType=VARCHAR}, - screenshotscron = #{screenshotscron,jdbcType=INTEGER}, - mscreenshotscron = #{mscreenshotscron,jdbcType=INTEGER}, - hscreenshotscron = #{hscreenshotscron,jdbcType=INTEGER}, - dscreenshotscron = #{dscreenshotscron,jdbcType=INTEGER}, - screenshotscronstate = #{screenshotscronstate,jdbcType=BIT}, - diskid = #{diskid,jdbcType=VARCHAR}, - modbusfigid = #{modbusfigid,jdbcType=VARCHAR}, - readRegister = #{readregister,jdbcType=VARCHAR}, - writeRegister = #{writeregister,jdbcType=VARCHAR}, - channel = #{channel,jdbcType=INTEGER}, - port = #{port,jdbcType=INTEGER}, - areaManageId = #{areamanageid,jdbcType=VARCHAR}, - ip_nvr = #{ipNvr,jdbcType=VARCHAR}, - username_nvr = #{usernameNvr,jdbcType=VARCHAR}, - password_nvr = #{passwordNvr,jdbcType=VARCHAR}, - channel_nvr = #{channelNvr,jdbcType=VARCHAR}, - areaid = #{areaid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_camera_nvr - ${where} - - diff --git a/src/com/sipai/mapper/work/ChannelPortConfigMapper.xml b/src/com/sipai/mapper/work/ChannelPortConfigMapper.xml deleted file mode 100644 index 72ae3204..00000000 --- a/src/com/sipai/mapper/work/ChannelPortConfigMapper.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, address, type, status, describe, remarks, unitid, processid, insuser, insdt, sort - - - - delete from tb_channel_port_config - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_channel_port_config (id, name, address, - type, status, describe, - remarks, unitid, processid, - insuser, insdt, sort) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{describe,jdbcType=VARCHAR}, - #{remarks,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{sort,jdbcType=BIGINT}) - - - insert into tb_channel_port_config - - - id, - - - name, - - - address, - - - type, - - - status, - - - describe, - - - remarks, - - - unitid, - - - processid, - - - insuser, - - - insdt, - - - sort, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{address,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{describe,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{sort,jdbcType=BIGINT}, - - - - - update tb_channel_port_config - - - name = #{name,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - describe = #{describe,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - unitid = #{unitid,jdbcType=VARCHAR}, - - - processid = #{processid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - sort = #{sort,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_channel_port_config - set name = #{name,jdbcType=VARCHAR}, - address = #{address,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - describe = #{describe,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - unitid = #{unitid,jdbcType=VARCHAR}, - processid = #{processid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - sort = #{sort,jdbcType=BIGINT} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_channel_port_config ${where} - - diff --git a/src/com/sipai/mapper/work/ElectricityMeterMapper.xml b/src/com/sipai/mapper/work/ElectricityMeterMapper.xml deleted file mode 100644 index deed6dfd..00000000 --- a/src/com/sipai/mapper/work/ElectricityMeterMapper.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, name, pid, insdt, insuser, version, morder, sname, active, type, bizid, prefix, - suffix - - - - delete from tb_electricity_meter - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_electricity_meter (id, name, pid, - insdt, insuser, version, - morder, sname, active, - type, bizid, prefix, - suffix) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, - #{morder,jdbcType=INTEGER}, #{sname,jdbcType=VARCHAR}, #{active,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{prefix,jdbcType=VARCHAR}, - #{suffix,jdbcType=VARCHAR}) - - - insert into tb_electricity_meter - - - id, - - - name, - - - pid, - - - insdt, - - - insuser, - - - version, - - - morder, - - - sname, - - - active, - - - type, - - - bizid, - - - prefix, - - - suffix, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{version,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - #{sname,jdbcType=VARCHAR}, - - - #{active,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{prefix,jdbcType=VARCHAR}, - - - #{suffix,jdbcType=VARCHAR}, - - - - - update tb_electricity_meter - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - sname = #{sname,jdbcType=VARCHAR}, - - - active = #{active,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - prefix = #{prefix,jdbcType=VARCHAR}, - - - suffix = #{suffix,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_electricity_meter - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - version = #{version,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER}, - sname = #{sname,jdbcType=VARCHAR}, - active = #{active,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - prefix = #{prefix,jdbcType=VARCHAR}, - suffix = #{suffix,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_electricity_meter - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupContentFormDataMapper.xml b/src/com/sipai/mapper/work/GroupContentFormDataMapper.xml deleted file mode 100644 index 4635d21a..00000000 --- a/src/com/sipai/mapper/work/GroupContentFormDataMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, formId, schedulingId, insdt, value - - - - delete from tb_work_groupContentFormData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_groupContentFormData (id, formId, schedulingId, - insdt, value) - values (#{id,jdbcType=VARCHAR}, #{formid,jdbcType=VARCHAR}, #{schedulingid,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{value,jdbcType=VARCHAR}) - - - insert into tb_work_groupContentFormData - - - id, - - - formId, - - - schedulingId, - - - insdt, - - - value, - - - - - #{id,jdbcType=VARCHAR}, - - - #{formid,jdbcType=VARCHAR}, - - - #{schedulingid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{value,jdbcType=VARCHAR}, - - - - - update tb_work_groupContentFormData - - - formId = #{formid,jdbcType=VARCHAR}, - - - schedulingId = #{schedulingid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - value = #{value,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_groupContentFormData - set formId = #{formid,jdbcType=VARCHAR}, - schedulingId = #{schedulingid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - value = #{value,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_groupContentFormData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupContentFormMapper.xml b/src/com/sipai/mapper/work/GroupContentFormMapper.xml deleted file mode 100644 index 115556b2..00000000 --- a/src/com/sipai/mapper/work/GroupContentFormMapper.xml +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, pid, insertRow, insertColumn, columns, rows, showText, showTextSt, width, height, - mpid, mpst, calculationMethod, type, valueRange, unitConversion, fontSize, fontWeight, - fontColor, backgroundColor, textAlign, dataMpId - - - - delete from tb_work_groupContentForm - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_groupContentForm (id, pid, insertRow, - insertColumn, columns, rows, - showText, showTextSt, width, - height, mpid, mpst, - calculationMethod, type, valueRange, - unitConversion, fontSize, fontWeight, - fontColor, backgroundColor, textAlign, - dataMpId) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{insertrow,jdbcType=INTEGER}, - #{insertcolumn,jdbcType=INTEGER}, #{columns,jdbcType=INTEGER}, #{rows,jdbcType=INTEGER}, - #{showtext,jdbcType=VARCHAR}, #{showtextst,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR}, - #{height,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{mpst,jdbcType=VARCHAR}, - #{calculationmethod,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{valuerange,jdbcType=VARCHAR}, - #{unitconversion,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, #{fontweight,jdbcType=VARCHAR}, - #{fontcolor,jdbcType=VARCHAR}, #{backgroundcolor,jdbcType=VARCHAR}, #{textalign,jdbcType=VARCHAR}, - #{datampid,jdbcType=VARCHAR}) - - - insert into tb_work_groupContentForm - - - id, - - - pid, - - - insertRow, - - - insertColumn, - - - columns, - - - rows, - - - showText, - - - showTextSt, - - - width, - - - height, - - - mpid, - - - mpst, - - - calculationMethod, - - - type, - - - valueRange, - - - unitConversion, - - - fontSize, - - - fontWeight, - - - fontColor, - - - backgroundColor, - - - textAlign, - - - dataMpId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insertrow,jdbcType=INTEGER}, - - - #{insertcolumn,jdbcType=INTEGER}, - - - #{columns,jdbcType=INTEGER}, - - - #{rows,jdbcType=INTEGER}, - - - #{showtext,jdbcType=VARCHAR}, - - - #{showtextst,jdbcType=VARCHAR}, - - - #{width,jdbcType=VARCHAR}, - - - #{height,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpst,jdbcType=VARCHAR}, - - - #{calculationmethod,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{valuerange,jdbcType=VARCHAR}, - - - #{unitconversion,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{fontweight,jdbcType=VARCHAR}, - - - #{fontcolor,jdbcType=VARCHAR}, - - - #{backgroundcolor,jdbcType=VARCHAR}, - - - #{textalign,jdbcType=VARCHAR}, - - - #{datampid,jdbcType=VARCHAR}, - - - - - update tb_work_groupContentForm - - - pid = #{pid,jdbcType=VARCHAR}, - - - insertRow = #{insertrow,jdbcType=INTEGER}, - - - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - - - columns = #{columns,jdbcType=INTEGER}, - - - rows = #{rows,jdbcType=INTEGER}, - - - showText = #{showtext,jdbcType=VARCHAR}, - - - showTextSt = #{showtextst,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=VARCHAR}, - - - height = #{height,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpst = #{mpst,jdbcType=VARCHAR}, - - - calculationMethod = #{calculationmethod,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - valueRange = #{valuerange,jdbcType=VARCHAR}, - - - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - fontWeight = #{fontweight,jdbcType=VARCHAR}, - - - fontColor = #{fontcolor,jdbcType=VARCHAR}, - - - backgroundColor = #{backgroundcolor,jdbcType=VARCHAR}, - - - textAlign = #{textalign,jdbcType=VARCHAR}, - - - dataMpId = #{datampid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_groupContentForm - set pid = #{pid,jdbcType=VARCHAR}, - insertRow = #{insertrow,jdbcType=INTEGER}, - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - columns = #{columns,jdbcType=INTEGER}, - rows = #{rows,jdbcType=INTEGER}, - showText = #{showtext,jdbcType=VARCHAR}, - showTextSt = #{showtextst,jdbcType=VARCHAR}, - width = #{width,jdbcType=VARCHAR}, - height = #{height,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpst = #{mpst,jdbcType=VARCHAR}, - calculationMethod = #{calculationmethod,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - valueRange = #{valuerange,jdbcType=VARCHAR}, - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - fontWeight = #{fontweight,jdbcType=VARCHAR}, - fontColor = #{fontcolor,jdbcType=VARCHAR}, - backgroundColor = #{backgroundcolor,jdbcType=VARCHAR}, - textAlign = #{textalign,jdbcType=VARCHAR}, - dataMpId = #{datampid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_groupContentForm - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupContentMapper.xml b/src/com/sipai/mapper/work/GroupContentMapper.xml deleted file mode 100644 index 8b2d9453..00000000 --- a/src/com/sipai/mapper/work/GroupContentMapper.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - id, name, unit_id, groupTypeId, pid, type, morder - - - - delete from tb_work_groupContent - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_groupContent (id, name, unit_id, - groupTypeId, pid, type, - morder) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{grouptypeid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}) - - - insert into tb_work_groupContent - - - id, - - - name, - - - unit_id, - - - groupTypeId, - - - pid, - - - type, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{grouptypeid,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_work_groupContent - - - name = #{name,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - groupTypeId = #{grouptypeid,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_groupContent - set name = #{name,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - groupTypeId = #{grouptypeid,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_groupContent - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupDetailMapper.xml b/src/com/sipai/mapper/work/GroupDetailMapper.xml deleted file mode 100644 index 34c5b390..00000000 --- a/src/com/sipai/mapper/work/GroupDetailMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, name, unit_id, grouptype_id, insuser, convert(varchar(19),insdt,20) as insdt, leader, members, remark - - - - delete from tb_work_groupdetail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_groupdetail (id, name, unit_id, - grouptype_id, insuser, insdt, - leader, members, remark - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{grouptypeId,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{leader,jdbcType=VARCHAR}, #{members,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} - ) - - - insert into tb_work_groupdetail - - - id, - - - name, - - - unit_id, - - - grouptype_id, - - - insuser, - - - insdt, - - - leader, - - - members, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{grouptypeId,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{leader,jdbcType=VARCHAR}, - - - #{members,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_work_groupdetail - - - name = #{name,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - grouptype_id = #{grouptypeId,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - leader = #{leader,jdbcType=VARCHAR}, - - - members = #{members,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_groupdetail - set name = #{name,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - grouptype_id = #{grouptypeId,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - leader = #{leader,jdbcType=VARCHAR}, - members = #{members,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_groupdetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupManageMapper.xml b/src/com/sipai/mapper/work/GroupManageMapper.xml deleted file mode 100644 index e2d8b49a..00000000 --- a/src/com/sipai/mapper/work/GroupManageMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - id, convert(varchar(12),sdt,8) as sdt, convert(varchar(12),edt,8) as edt, insuser, insdt, name, remark, delflag, biz_id - - - - delete from tb_work_groupManage - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_groupManage (id, sdt, edt, - insuser, insdt, name, - remark, delflag,biz_id) - values (#{id,jdbcType=VARCHAR}, #{sdt,jdbcType=TIMESTAMP}, #{edt,jdbcType=TIMESTAMP}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, - #{remark,jdbcType=VARCHAR}, #{delflag,jdbcType=BIT},#{bizId,jdbcType=VARCHAR}) - - - insert into tb_work_groupManage - - - id, - - - sdt, - - - edt, - - - insuser, - - - insdt, - - - name, - - - remark, - - - delflag, - - - biz_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{delflag,jdbcType=BIT}, - - - #{bizId,jdbcType=VARCHAR}, - - - - - update tb_work_groupManage - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - delflag = #{delflag,jdbcType=BIT}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_groupManage - set sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - delflag = #{delflag,jdbcType=BIT}, - biz_id = #{bizId,jdbcType=VARCHAR}, - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_groupManage - ${where} - - - update tb_work_groupManage - set delflag = '1' - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupMapper.xml b/src/com/sipai/mapper/work/GroupMapper.xml deleted file mode 100644 index 660a6427..00000000 --- a/src/com/sipai/mapper/work/GroupMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, name, deptid, insuser, insdt, remark - - - - delete from tb_work_group - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_group (id, name, deptid, - insuser, insdt, remark - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{deptid,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR} - ) - - - insert into tb_work_group - - - id, - - - name, - - - deptid, - - - insuser, - - - insdt, - - - remark, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{deptid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - - - update tb_work_group - - - name = #{name,jdbcType=VARCHAR}, - - - deptid = #{deptid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_group - set name = #{name,jdbcType=VARCHAR}, - deptid = #{deptid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_group - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupMemberMapper.xml b/src/com/sipai/mapper/work/GroupMemberMapper.xml deleted file mode 100644 index 49f9ff4d..00000000 --- a/src/com/sipai/mapper/work/GroupMemberMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, groupid, userid, usertype, insuser, insdt, remark - - - - delete from tb_work_group_member - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_group_member (id, groupid, userid, - usertype, insuser, insdt, - remark) - values (#{id,jdbcType=VARCHAR}, #{groupid,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, - #{usertype,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}) - - - update tb_work_group_member - - - groupid = #{groupid,jdbcType=VARCHAR}, - - - userid = #{userid,jdbcType=VARCHAR}, - - - usertype = #{usertype,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_group_member - where groupid = #{groupid,jdbcType=VARCHAR} - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupTimeMapper.xml b/src/com/sipai/mapper/work/GroupTimeMapper.xml deleted file mode 100644 index 5c78ef80..00000000 --- a/src/com/sipai/mapper/work/GroupTimeMapper.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - id, grouptype_id, name, sdt, edt, edtAdd, insuser, insdt, unit_id, timeExpand - - - - delete from tb_work_grouptime - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_grouptime (id, grouptype_id, name, - sdt, edt, edtAdd, insuser, - insdt, unit_id, timeExpand - ) - values (#{id,jdbcType=VARCHAR}, #{grouptypeId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{sdt,jdbcType=TIME}, #{edt,jdbcType=TIME}, #{edtadd,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{unitId,jdbcType=VARCHAR}, #{timeexpand,jdbcType=INTEGER} - ) - - - insert into tb_work_grouptime - - - id, - - - grouptype_id, - - - name, - - - sdt, - - - edt, - - - edtAdd, - - - insuser, - - - insdt, - - - unit_id, - - - timeExpand, - - - - - #{id,jdbcType=VARCHAR}, - - - #{grouptypeId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIME}, - - - #{edt,jdbcType=TIME}, - - - #{edtadd,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{timeexpand,jdbcType=INTEGER}, - - - - - update tb_work_grouptime - - - grouptype_id = #{grouptypeId,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIME}, - - - edt = #{edt,jdbcType=TIME}, - - - edtAdd = #{edtadd,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - timeExpand = #{timeexpand,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_grouptime - set grouptype_id = #{grouptypeId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIME}, - edt = #{edt,jdbcType=TIME}, - edtAdd = #{edtadd,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR}, - timeExpand = #{timeexpand,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_grouptime - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/GroupTypeMapper.xml b/src/com/sipai/mapper/work/GroupTypeMapper.xml deleted file mode 100644 index ac391d78..00000000 --- a/src/com/sipai/mapper/work/GroupTypeMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, name, insuser, insdt, remark, morder, patrolType,code - - - - delete from tb_work_grouptype - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_grouptype (id, name, insuser, - insdt, remark, morder, - patrolType,code) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{patroltype,jdbcType=VARCHAR},#{code,jdbcType=VARCHAR}) - - - insert into tb_work_grouptype - - - id, - - - name, - - - insuser, - - - insdt, - - - remark, - - - morder, - - - patrolType, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{patroltype,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_work_grouptype - - - name = #{name,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - patrolType = #{patroltype,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_grouptype - set name = #{name,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - patrolType = #{patroltype,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_grouptype - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/KPIPointMapper.xml b/src/com/sipai/mapper/work/KPIPointMapper.xml deleted file mode 100644 index 96d01aa1..00000000 --- a/src/com/sipai/mapper/work/KPIPointMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, bizId, processSectionId, mpointId, grade, insuser, insdt - - - - delete from TB_KPIPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_KPIPoint (id, bizId, processSectionId, - mpointId, grade, insuser, - insdt) - values (#{id,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{processsectionid,jdbcType=VARCHAR}, - #{mpointid,jdbcType=VARCHAR}, #{grade,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_KPIPoint - - - id, - - - bizId, - - - processSectionId, - - - mpointId, - - - grade, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{mpointid,jdbcType=VARCHAR}, - - - #{grade,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_KPIPoint - - - bizId = #{bizid,jdbcType=VARCHAR}, - - - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - - - mpointId = #{mpointid,jdbcType=VARCHAR}, - - - grade = #{grade,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_KPIPoint - set bizId = #{bizid,jdbcType=VARCHAR}, - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - mpointId = #{mpointid,jdbcType=VARCHAR}, - grade = #{grade,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_KPIPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/KPIPointProfessorMapper.xml b/src/com/sipai/mapper/work/KPIPointProfessorMapper.xml deleted file mode 100644 index 14e6b44d..00000000 --- a/src/com/sipai/mapper/work/KPIPointProfessorMapper.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - id, mpid, biz_id, process_section_id, flag, text, mark, insdt,aid - - - - delete from TB_KPIPoint_Professor - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_KPIPoint_Professor (id, mpid, biz_id, - process_section_id, flag, text, - mark, insdt,aid) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, - #{processSectionId,jdbcType=VARCHAR}, #{flag,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, - #{mark,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP},#{aid,jdbcType=VARCHAR}) - - - insert into TB_KPIPoint_Professor - - - id, - - - mpid, - - - biz_id, - - - process_section_id, - - - flag, - - - text, - - - mark, - - - insdt, - - - aid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{processSectionId,jdbcType=VARCHAR}, - - - #{flag,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{mark,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{aid,jdbcType=VARCHAR}, - - - - - update TB_KPIPoint_Professor - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - - - flag = #{flag,jdbcType=VARCHAR}, - - - text = #{text,jdbcType=VARCHAR}, - - - mark = #{mark,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - aid = #{aid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_KPIPoint_Professor - set mpid = #{mpid,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - process_section_id = #{processSectionId,jdbcType=VARCHAR}, - flag = #{flag,jdbcType=VARCHAR}, - text = #{text,jdbcType=VARCHAR}, - mark = #{mark,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - aid = #{aid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_KPIPoint_Professor - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/KPIPointProfessorParamMapper.xml b/src/com/sipai/mapper/work/KPIPointProfessorParamMapper.xml deleted file mode 100644 index db11fe4c..00000000 --- a/src/com/sipai/mapper/work/KPIPointProfessorParamMapper.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - id, pid, chart_type, sdt, edt,mpcode - - - - delete from TB_KPIPoint_Professor_Param - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_KPIPoint_Professor_Param (id, pid, chart_type, sdt, edt,mpcode) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, - #{sdt,jdbcType=TIMESTAMP}, #{edt,jdbcType=TIMESTAMP}, #{mpcode,jdbcType=VARCHAR}) - - - insert into TB_KPIPoint_Professor_Param - - - id, - - - pid, - - - chart_type, - - - sdt, - - - edt, - - - mpcode, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{chartType,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{mpcode,jdbcType=VARCHAR}, - - - - - update TB_KPIPoint_Professor_Param - - - pid = #{pid,jdbcType=VARCHAR}, - - - chart_type = #{chartType,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - mpcode = #{mpcode,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_KPIPoint_Professor_Param - set pid = #{pid,jdbcType=VARCHAR}, - chart_type = #{chartType,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - mpcode = #{mpcode,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_KPIPoint_Professor_Param - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/LagerScreenConfigureDetailMapper.xml b/src/com/sipai/mapper/work/LagerScreenConfigureDetailMapper.xml deleted file mode 100644 index 8d1d1004..00000000 --- a/src/com/sipai/mapper/work/LagerScreenConfigureDetailMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - id, pid, mpname, mpid, columnNum, morder - - - - delete from tb_lagerScreen_ConfigureDetail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_lagerScreen_ConfigureDetail (id, pid, mpname, - mpid, columnNum, morder - ) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpname,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{columnNum,jdbcType=INTEGER}, #{morder,jdbcType=INTEGER} - ) - - - insert into tb_lagerScreen_ConfigureDetail - - - id, - - - pid, - - - mpname, - - - mpid, - - - columnNum, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpname,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{columnNum,jdbcType=INTEGER}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_lagerScreen_ConfigureDetail - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpname = #{mpname,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - columnNum = #{columnNum,jdbcType=INTEGER}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_lagerScreen_ConfigureDetail - set pid = #{pid,jdbcType=VARCHAR}, - mpname = #{mpname,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - columnNum = #{columnNum,jdbcType=INTEGER}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_lagerScreen_ConfigureDetail - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/LagerScreenConfigureMapper.xml b/src/com/sipai/mapper/work/LagerScreenConfigureMapper.xml deleted file mode 100644 index 9834d74f..00000000 --- a/src/com/sipai/mapper/work/LagerScreenConfigureMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - id, name, morder - - - - delete from tb_lagerScreen_Configure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_lagerScreen_Configure (id, name, morder - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER} - ) - - - insert into tb_lagerScreen_Configure - - - id, - - - name, - - - morder, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - - - update tb_lagerScreen_Configure - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_lagerScreen_Configure - set name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_lagerScreen_Configure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/LagerScreenDataMapper.xml b/src/com/sipai/mapper/work/LagerScreenDataMapper.xml deleted file mode 100644 index 43193b80..00000000 --- a/src/com/sipai/mapper/work/LagerScreenDataMapper.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id,eqtotalnum,eqAnum,eqBnum,eqCnum,eqIntactRate,xjIntactRate,xjNum,xjWorkHour, - wxIntactRate,wxNum,wxWorkHour,byIntactRate,byNum,byWorkHour,insdt - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/MPointHisChangeDataMapper.xml b/src/com/sipai/mapper/work/MPointHisChangeDataMapper.xml deleted file mode 100644 index 476d4195..00000000 --- a/src/com/sipai/mapper/work/MPointHisChangeDataMapper.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - id - , mpid, changePeople, changeTime, changeData, oldData, valueTime - - - - delete - from tb_work_mPointHisChangeData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_mPointHisChangeData (id, mpid, changePeople, - changeTime, changeData, oldData, - valueTime) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{changepeople,jdbcType=VARCHAR}, - #{changetime,jdbcType=TIMESTAMP}, #{changedata,jdbcType=DOUBLE}, #{olddata,jdbcType=DOUBLE}, - #{valuetime,jdbcType=TIMESTAMP}) - - - insert into tb_work_mPointHisChangeData - - - id, - - - mpid, - - - changePeople, - - - changeTime, - - - changeData, - - - oldData, - - - valueTime, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{changepeople,jdbcType=VARCHAR}, - - - #{changetime,jdbcType=TIMESTAMP}, - - - #{changedata,jdbcType=DOUBLE}, - - - #{olddata,jdbcType=DOUBLE}, - - - #{valuetime,jdbcType=TIMESTAMP}, - - - - - update tb_work_mPointHisChangeData - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - changePeople = #{changepeople,jdbcType=VARCHAR}, - - - changeTime = #{changetime,jdbcType=TIMESTAMP}, - - - changeData = #{changedata,jdbcType=DOUBLE}, - - - oldData = #{olddata,jdbcType=DOUBLE}, - - - valueTime = #{valuetime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_mPointHisChangeData - set mpid = #{mpid,jdbcType=VARCHAR}, - changePeople = #{changepeople,jdbcType=VARCHAR}, - changeTime = #{changetime,jdbcType=TIMESTAMP}, - changeData = #{changedata,jdbcType=DOUBLE}, - oldData = #{olddata,jdbcType=DOUBLE}, - valueTime = #{valuetime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_work_mPointHisChangeData ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/MeasurePoint_DATAMapper.xml b/src/com/sipai/mapper/work/MeasurePoint_DATAMapper.xml deleted file mode 100644 index 40f62e71..00000000 --- a/src/com/sipai/mapper/work/MeasurePoint_DATAMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, insdt, insuser, data_number, biz_id, MPointCode, type_1, type_2, page_nub - - - - delete from TB_MeasurePoint_DATA - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_MeasurePoint_DATA (id, insdt, insuser, - data_number, biz_id, MPointCode, - type_1, type_2, page_nub - ) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{dataNumber,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, #{mpointcode,jdbcType=VARCHAR}, - #{type1,jdbcType=VARCHAR}, #{type2,jdbcType=VARCHAR}, #{pageNub,jdbcType=VARCHAR} - ) - - - insert into TB_MeasurePoint_DATA - - - id, - - - insdt, - - - insuser, - - - data_number, - - - biz_id, - - - MPointCode, - - - type_1, - - - type_2, - - - page_nub, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{dataNumber,jdbcType=VARCHAR}, - - - #{bizId,jdbcType=VARCHAR}, - - - #{mpointcode,jdbcType=VARCHAR}, - - - #{type1,jdbcType=VARCHAR}, - - - #{type2,jdbcType=VARCHAR}, - - - #{pageNub,jdbcType=VARCHAR}, - - - - - update TB_MeasurePoint_DATA - - - insdt = #{insdt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - data_number = #{dataNumber,jdbcType=VARCHAR}, - - - biz_id = #{bizId,jdbcType=VARCHAR}, - - - MPointCode = #{mpointcode,jdbcType=VARCHAR}, - - - type_1 = #{type1,jdbcType=VARCHAR}, - - - type_2 = #{type2,jdbcType=VARCHAR}, - - - page_nub = #{pageNub,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_MeasurePoint_DATA - set insdt = #{insdt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - data_number = #{dataNumber,jdbcType=VARCHAR}, - biz_id = #{bizId,jdbcType=VARCHAR}, - MPointCode = #{mpointcode,jdbcType=VARCHAR}, - type_1 = #{type1,jdbcType=VARCHAR}, - type_2 = #{type2,jdbcType=VARCHAR}, - page_nub = #{pageNub,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from TB_MeasurePoint_DATA - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ModbusConfigMapper.xml b/src/com/sipai/mapper/work/ModbusConfigMapper.xml deleted file mode 100644 index a5b37b50..00000000 --- a/src/com/sipai/mapper/work/ModbusConfigMapper.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - id, p_id, type, data_type - - - - delete from tb_work_modbus_config - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_modbus_config (id, p_id, - type, data_type) - values (#{id,jdbcType=VARCHAR}, #{pId,jdbcType=VARCHAR}, - #{type,jdbcType=INTEGER}, #{dataType,jdbcType=INTEGER}) - - - insert into tb_work_modbus_config - - - id, - - - p_id, - - - type, - - - data_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pId,jdbcType=VARCHAR}, - - - #{type,jdbcType=INTEGER}, - - - #{dataType,jdbcType=INTEGER}, - - - - - update tb_work_modbus_config - - - p_id = #{pId,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=INTEGER}, - - - data_type = #{dataType,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_modbus_config - set p_id = #{pId,jdbcType=VARCHAR}, - type = #{type,jdbcType=INTEGER}, - data_type = #{dataType,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_work_modbus_config - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ModbusFigMapper.xml b/src/com/sipai/mapper/work/ModbusFigMapper.xml deleted file mode 100644 index 958848cc..00000000 --- a/src/com/sipai/mapper/work/ModbusFigMapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - id, ipsever, port, slaveid, order32, name, remarks, flag, insuser, insdt, company_id - - - - delete from tb_work_modbusfig - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_modbusfig (id, ipsever, port, - slaveid, order32, name, - remarks, flag, insuser, - insdt, company_id) - values (#{id,jdbcType=VARCHAR}, #{ipsever,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}, - #{slaveid,jdbcType=VARCHAR}, #{order32,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{remarks,jdbcType=VARCHAR}, #{flag,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{companyId,jdbcType=VARCHAR}) - - - insert into tb_work_modbusfig - - - id, - - - ipsever, - - - port, - - - slaveid, - - - order32, - - - name, - - - remarks, - - - flag, - - - insuser, - - - insdt, - - - company_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{ipsever,jdbcType=VARCHAR}, - - - #{port,jdbcType=VARCHAR}, - - - #{slaveid,jdbcType=VARCHAR}, - - - #{order32,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{remarks,jdbcType=VARCHAR}, - - - #{flag,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{companyId,jdbcType=VARCHAR}, - - - - - update tb_work_modbusfig - - - ipsever = #{ipsever,jdbcType=VARCHAR}, - - - port = #{port,jdbcType=VARCHAR}, - - - slaveid = #{slaveid,jdbcType=VARCHAR}, - - - order32 = #{order32,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - remarks = #{remarks,jdbcType=VARCHAR}, - - - flag = #{flag,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - company_id = #{companyId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_modbusfig - set ipsever = #{ipsever,jdbcType=VARCHAR}, - port = #{port,jdbcType=VARCHAR}, - slaveid = #{slaveid,jdbcType=VARCHAR}, - order32 = #{order32,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - remarks = #{remarks,jdbcType=VARCHAR}, - flag = #{flag,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - company_id = #{companyId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_work_modbusfig - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ModbusInterfaceMapper.xml b/src/com/sipai/mapper/work/ModbusInterfaceMapper.xml deleted file mode 100644 index 3d5f19d3..00000000 --- a/src/com/sipai/mapper/work/ModbusInterfaceMapper.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - id, name, ip, port, status, unit_id, offset - - - - - delete from tb_work_modbus_interface - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_work_modbus_interface - ${where} - - - insert into tb_work_modbus_interface (id, name, ip, - port, status, unit_id, offset) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, - #{port,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, #{unitId,jdbcType=VARCHAR}, #{offset,jdbcType=INTEGER}) - - - insert into tb_work_modbus_interface - - - id, - - - name, - - - ip, - - - port, - - - status, - - - unit_id, - - - offset, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{ip,jdbcType=VARCHAR}, - - - #{port,jdbcType=INTEGER}, - - - #{status,jdbcType=TINYINT}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{offset,jdbcType=INTEGER}, - - - - - update tb_work_modbus_interface - - - name = #{name,jdbcType=VARCHAR}, - - - ip = #{ip,jdbcType=VARCHAR}, - - - port = #{port,jdbcType=INTEGER}, - - - status = #{status,jdbcType=TINYINT}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - offset = #{offset,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_modbus_interface - set name = #{name,jdbcType=VARCHAR}, - ip = #{ip,jdbcType=VARCHAR}, - port = #{port,jdbcType=INTEGER}, - status = #{status,jdbcType=TINYINT}, - unit_id = #{unitId,jdbcType=VARCHAR}, - offset = #{offset,jdbcType=TINYINT} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ModbusPointMapper.xml b/src/com/sipai/mapper/work/ModbusPointMapper.xml deleted file mode 100644 index 290f3494..00000000 --- a/src/com/sipai/mapper/work/ModbusPointMapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - id, name, address, reguster_type, slave_id, point_type, status, p_id, code - - - - delete from tb_work_modbus_point - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_modbus_point (id, name, address, - reguster_type, slave_id, - point_type, status, p_id, code - ) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=INTEGER}, - #{regusterType,jdbcType=INTEGER}, #{slaveId,jdbcType=INTEGER}, - #{pointType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{pId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR} - ) - - - insert into tb_work_modbus_point - - - id, - - - name, - - - address, - - - reguster_type, - - - slave_id, - - - point_type, - - - status, - - - p_id, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{address,jdbcType=INTEGER}, - - - #{regusterType,jdbcType=INTEGER}, - - - #{slaveId,jdbcType=INTEGER}, - - - #{pointType,jdbcType=INTEGER}, - - - #{status,jdbcType=INTEGER}, - - - #{pId,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_work_modbus_point - - - name = #{name,jdbcType=VARCHAR}, - - - address = #{address,jdbcType=INTEGER}, - - - reguster_type = #{regusterType,jdbcType=INTEGER}, - - - slave_id = #{slaveId,jdbcType=INTEGER}, - - - point_type = #{pointType,jdbcType=INTEGER}, - - - status = #{status,jdbcType=INTEGER}, - - - p_id = #{pId,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_modbus_point - set name = #{name,jdbcType=VARCHAR}, - address = #{address,jdbcType=INTEGER}, - reguster_type = #{regusterType,jdbcType=INTEGER}, - slave_id = #{slaveId,jdbcType=INTEGER}, - point_type = #{pointType,jdbcType=INTEGER}, - status = #{status,jdbcType=INTEGER}, - p_id = #{pId,jdbcType=VARCHAR} - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - delete from tb_work_modbus_point - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ModbusRecordMapper.xml b/src/com/sipai/mapper/work/ModbusRecordMapper.xml deleted file mode 100644 index 40a5a500..00000000 --- a/src/com/sipai/mapper/work/ModbusRecordMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, lastdate, record, insuser, insdt - - - - delete from tb_work_modbusrecord - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_modbusrecord (id, lastdate, record, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{lastdate,jdbcType=TIMESTAMP}, #{record,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into tb_work_modbusrecord - - - id, - - - lastdate, - - - record, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{lastdate,jdbcType=TIMESTAMP}, - - - #{record,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update tb_work_modbusrecord - - - lastdate = #{lastdate,jdbcType=TIMESTAMP}, - - - record = #{record,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_modbusrecord - set lastdate = #{lastdate,jdbcType=TIMESTAMP}, - record = #{record,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_work_modbusrecord - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ProductionIndexDataMapper.xml b/src/com/sipai/mapper/work/ProductionIndexDataMapper.xml deleted file mode 100644 index a4b33107..00000000 --- a/src/com/sipai/mapper/work/ProductionIndexDataMapper.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - id, configureId, value, planDate, type, unit_id - - - - delete from tb_pro_productionIndexData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_productionIndexData (id, configureId, value, - planDate, type, unit_id - ) - values (#{id,jdbcType=VARCHAR}, #{configureid,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, - #{plandate,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR} - ) - - - insert into tb_pro_productionIndexData - - - id, - - - configureId, - - - value, - - - planDate, - - - type, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{configureid,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{plandate,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_pro_productionIndexData - - - configureId = #{configureid,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - planDate = #{plandate,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_productionIndexData - set configureId = #{configureid,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - planDate = #{plandate,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_pro_productionIndexData - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ProductionIndexPlanNameConfigureMapper.xml b/src/com/sipai/mapper/work/ProductionIndexPlanNameConfigureMapper.xml deleted file mode 100644 index 88e57428..00000000 --- a/src/com/sipai/mapper/work/ProductionIndexPlanNameConfigureMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, pid, name, type, mpid, mpid_plan, unit_id, morder, insuser, insdt, day_value - - - - delete from tb_pro_productionIndexPlanNameConfigure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_productionIndexPlanNameConfigure (id, pid, name, - type, mpid, mpid_plan, - unit_id, morder, insuser, - insdt, day_value) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{mpidPlan,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{dayValue,jdbcType=VARCHAR}) - - - insert into tb_pro_productionIndexPlanNameConfigure - - - id, - - - pid, - - - name, - - - type, - - - mpid, - - - mpid_plan, - - - unit_id, - - - morder, - - - insuser, - - - insdt, - - - day_value, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{mpidPlan,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{dayValue,jdbcType=VARCHAR}, - - - - - update tb_pro_productionIndexPlanNameConfigure - - - pid = #{pid,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - mpid_plan = #{mpidPlan,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - day_value = #{dayValue,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_productionIndexPlanNameConfigure - set pid = #{pid,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - mpid_plan = #{mpidPlan,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - day_value = #{dayValue,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_pro_productionIndexPlanNameConfigure - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ProductionIndexPlanNameDataHisMapper.xml b/src/com/sipai/mapper/work/ProductionIndexPlanNameDataHisMapper.xml deleted file mode 100644 index 94cb5ef1..00000000 --- a/src/com/sipai/mapper/work/ProductionIndexPlanNameDataHisMapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - id, insdt, insuser, value, remark, pid - - - - delete from tb_pro_productionIndexPlanNameDataHis - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_productionIndexPlanNameDataHis (id, insdt, insuser, - value, remark, pid) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{value,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}) - - - insert into tb_pro_productionIndexPlanNameDataHis - - - id, - - - insdt, - - - insuser, - - - value, - - - remark, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{remark,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_pro_productionIndexPlanNameDataHis - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_productionIndexPlanNameDataHis - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - remark = #{remark,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_pro_productionIndexPlanNameDataHis - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ProductionIndexPlanNameDataMapper.xml b/src/com/sipai/mapper/work/ProductionIndexPlanNameDataMapper.xml deleted file mode 100644 index 68a5c6bb..00000000 --- a/src/com/sipai/mapper/work/ProductionIndexPlanNameDataMapper.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - id, configureId, value, planDate, type, morder, unit_id - - - - delete from tb_pro_productionIndexPlanNameData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_productionIndexPlanNameData (id, configureId, value, - planDate, type, morder, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{configureid,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, - #{plandate,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_pro_productionIndexPlanNameData - - - id, - - - configureId, - - - value, - - - planDate, - - - type, - - - morder, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{configureid,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{plandate,jdbcType=TIMESTAMP}, - - - #{type,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_pro_productionIndexPlanNameData - - - configureId = #{configureid,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - planDate = #{plandate,jdbcType=TIMESTAMP}, - - - type = #{type,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_productionIndexPlanNameData - set configureId = #{configureid,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - planDate = #{plandate,jdbcType=TIMESTAMP}, - type = #{type,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_pro_productionIndexPlanNameData - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ProductionIndexWorkOrderMapper.xml b/src/com/sipai/mapper/work/ProductionIndexWorkOrderMapper.xml deleted file mode 100644 index 9a0413c6..00000000 --- a/src/com/sipai/mapper/work/ProductionIndexWorkOrderMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - id, insdt, writePerson, dataContent, writeDate, submitDate, unit_id - - - - delete from tb_pro_productionIndexWorkOrder - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_pro_productionIndexWorkOrder (id, insdt, writePerson, - dataContent, writeDate, submitDate, - unit_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{writeperson,jdbcType=VARCHAR}, - #{datacontent,jdbcType=VARCHAR}, #{writedate,jdbcType=TIMESTAMP}, #{submitdate,jdbcType=TIMESTAMP}, - #{unitId,jdbcType=VARCHAR}) - - - insert into tb_pro_productionIndexWorkOrder - - - id, - - - insdt, - - - writePerson, - - - dataContent, - - - writeDate, - - - submitDate, - - - unit_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{writeperson,jdbcType=VARCHAR}, - - - #{datacontent,jdbcType=VARCHAR}, - - - #{writedate,jdbcType=TIMESTAMP}, - - - #{submitdate,jdbcType=TIMESTAMP}, - - - #{unitId,jdbcType=VARCHAR}, - - - - - update tb_pro_productionIndexWorkOrder - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - writePerson = #{writeperson,jdbcType=VARCHAR}, - - - dataContent = #{datacontent,jdbcType=VARCHAR}, - - - writeDate = #{writedate,jdbcType=TIMESTAMP}, - - - submitDate = #{submitdate,jdbcType=TIMESTAMP}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_pro_productionIndexWorkOrder - set insdt = #{insdt,jdbcType=TIMESTAMP}, - writePerson = #{writeperson,jdbcType=VARCHAR}, - dataContent = #{datacontent,jdbcType=VARCHAR}, - writeDate = #{writedate,jdbcType=TIMESTAMP}, - submitDate = #{submitdate,jdbcType=TIMESTAMP}, - unit_id = #{unitId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_pro_productionIndexWorkOrder - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ScadaPicMapper.xml b/src/com/sipai/mapper/work/ScadaPicMapper.xml deleted file mode 100644 index 897de73d..00000000 --- a/src/com/sipai/mapper/work/ScadaPicMapper.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - id, bizId, processSectionId, type, text, picPath, insuser, insdt - - - - delete from TB_SCADAPIC - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SCADAPIC (id, bizId, processSectionId, - type, text,picPath, insuser, - insdt) - values (#{id,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{processsectionid,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, #{picpath,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_SCADAPIC - - - id, - - - bizId, - - - processSectionId, - - - type, - - - text, - - - picPath, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{picpath,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_SCADAPIC - - - bizId = #{bizid,jdbcType=VARCHAR}, - - - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - text = #{text,jdbcType=VARCHAR}, - - - picPath = #{picpath,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SCADAPIC - set bizId = #{bizid,jdbcType=VARCHAR}, - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - text = #{text,jdbcType=VARCHAR}, - picPath = #{picpath,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SCADAPIC - ${where} - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ScadaPic_EMMapper.xml b/src/com/sipai/mapper/work/ScadaPic_EMMapper.xml deleted file mode 100644 index 3987acdc..00000000 --- a/src/com/sipai/mapper/work/ScadaPic_EMMapper.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, pid, equipid, posx, posy, containerWidth, containerHeight, insuser, insdt, ownerid, - txt, width, height - - - - delete from TB_SCADAPIC_EM - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SCADAPIC_EM (id, pid, equipid, - posx, posy, containerWidth, - containerHeight, insuser, insdt, - ownerid, txt, width, - height) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{equipid,jdbcType=VARCHAR}, - #{posx,jdbcType=DOUBLE}, #{posy,jdbcType=DOUBLE}, #{containerwidth,jdbcType=DOUBLE}, - #{containerheight,jdbcType=DOUBLE}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{ownerid,jdbcType=VARCHAR}, #{txt,jdbcType=VARCHAR}, #{width,jdbcType=DOUBLE}, - #{height,jdbcType=DOUBLE}) - - - insert into TB_SCADAPIC_EM - - - id, - - - pid, - - - equipid, - - - posx, - - - posy, - - - containerWidth, - - - containerHeight, - - - insuser, - - - insdt, - - - ownerid, - - - txt, - - - width, - - - height, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{equipid,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DOUBLE}, - - - #{posy,jdbcType=DOUBLE}, - - - #{containerwidth,jdbcType=DOUBLE}, - - - #{containerheight,jdbcType=DOUBLE}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{ownerid,jdbcType=VARCHAR}, - - - #{txt,jdbcType=VARCHAR}, - - - #{width,jdbcType=DOUBLE}, - - - #{height,jdbcType=DOUBLE}, - - - - - update TB_SCADAPIC_EM - - - pid = #{pid,jdbcType=VARCHAR}, - - - equipid = #{equipid,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DOUBLE}, - - - posy = #{posy,jdbcType=DOUBLE}, - - - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - - - containerHeight = #{containerheight,jdbcType=DOUBLE}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - ownerid = #{ownerid,jdbcType=VARCHAR}, - - - txt = #{txt,jdbcType=VARCHAR}, - - - width = #{width,jdbcType=DOUBLE}, - - - height = #{height,jdbcType=DOUBLE}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SCADAPIC_EM - set pid = #{pid,jdbcType=VARCHAR}, - equipid = #{equipid,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DOUBLE}, - posy = #{posy,jdbcType=DOUBLE}, - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - containerHeight = #{containerheight,jdbcType=DOUBLE}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - ownerid = #{ownerid,jdbcType=VARCHAR}, - txt = #{txt,jdbcType=VARCHAR}, - width = #{width,jdbcType=DOUBLE}, - height = #{height,jdbcType=DOUBLE} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SCADAPIC_EM - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ScadaPic_MPointMapper.xml b/src/com/sipai/mapper/work/ScadaPic_MPointMapper.xml deleted file mode 100644 index 95cfbf1a..00000000 --- a/src/com/sipai/mapper/work/ScadaPic_MPointMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, pid, mpid, posx, posy, containerWidth, containerHeight, insuser, insdt, ownerid, - txt, fsize, accuracy, expressionFlag - - - - delete from TB_SCADAPIC_MPoint - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SCADAPIC_MPoint (id, pid, mpid, - posx, posy, containerWidth, - containerHeight, insuser, insdt, - ownerid, txt, fsize, - accuracy, expressionFlag) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, - #{posx,jdbcType=DOUBLE}, #{posy,jdbcType=DOUBLE}, #{containerwidth,jdbcType=DOUBLE}, - #{containerheight,jdbcType=DOUBLE}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{ownerid,jdbcType=VARCHAR}, #{txt,jdbcType=VARCHAR}, #{fsize,jdbcType=VARCHAR}, - #{accuracy,jdbcType=INTEGER}, #{expressionflag,jdbcType=VARCHAR}) - - - insert into TB_SCADAPIC_MPoint - - - id, - - - pid, - - - mpid, - - - posx, - - - posy, - - - containerWidth, - - - containerHeight, - - - insuser, - - - insdt, - - - ownerid, - - - txt, - - - fsize, - - - accuracy, - - - expressionFlag, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DOUBLE}, - - - #{posy,jdbcType=DOUBLE}, - - - #{containerwidth,jdbcType=DOUBLE}, - - - #{containerheight,jdbcType=DOUBLE}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{ownerid,jdbcType=VARCHAR}, - - - #{txt,jdbcType=VARCHAR}, - - - #{fsize,jdbcType=VARCHAR}, - - - #{accuracy,jdbcType=INTEGER}, - - - #{expressionflag,jdbcType=VARCHAR}, - - - - - update TB_SCADAPIC_MPoint - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DOUBLE}, - - - posy = #{posy,jdbcType=DOUBLE}, - - - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - - - containerHeight = #{containerheight,jdbcType=DOUBLE}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - ownerid = #{ownerid,jdbcType=VARCHAR}, - - - txt = #{txt,jdbcType=VARCHAR}, - - - fsize = #{fsize,jdbcType=VARCHAR}, - - - accuracy = #{accuracy,jdbcType=INTEGER}, - - - expressionFlag = #{expressionflag,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SCADAPIC_MPoint - set pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DOUBLE}, - posy = #{posy,jdbcType=DOUBLE}, - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - containerHeight = #{containerheight,jdbcType=DOUBLE}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - ownerid = #{ownerid,jdbcType=VARCHAR}, - txt = #{txt,jdbcType=VARCHAR}, - fsize = #{fsize,jdbcType=VARCHAR}, - accuracy = #{accuracy,jdbcType=INTEGER}, - expressionFlag = #{expressionflag,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SCADAPIC_MPoint - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ScadaPic_MPoint_ExpressionMapper.xml b/src/com/sipai/mapper/work/ScadaPic_MPoint_ExpressionMapper.xml deleted file mode 100644 index 69f32085..00000000 --- a/src/com/sipai/mapper/work/ScadaPic_MPoint_ExpressionMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, mpid, expression, expressionWay, insdt, insuser - - - - delete from TB_SCADAPIC_MPoint_Expression - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SCADAPIC_MPoint_Expression (id, mpid, expression, - expressionWay, insdt, insuser - ) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{expression,jdbcType=VARCHAR}, - #{expressionway,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR} - ) - - - insert into TB_SCADAPIC_MPoint_Expression - - - id, - - - mpid, - - - expression, - - - expressionWay, - - - insdt, - - - insuser, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{expression,jdbcType=VARCHAR}, - - - #{expressionway,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - - - update TB_SCADAPIC_MPoint_Expression - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - expression = #{expression,jdbcType=VARCHAR}, - - - expressionWay = #{expressionway,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SCADAPIC_MPoint_Expression - set mpid = #{mpid,jdbcType=VARCHAR}, - expression = #{expression,jdbcType=VARCHAR}, - expressionWay = #{expressionway,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SCADAPIC_MPoint_Expression - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ScadaPic_ProcessSectionMapper.xml b/src/com/sipai/mapper/work/ScadaPic_ProcessSectionMapper.xml deleted file mode 100644 index a9d5c638..00000000 --- a/src/com/sipai/mapper/work/ScadaPic_ProcessSectionMapper.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, pid, processSectionId, posx, posy, containerWidth, containerHeight, width, height, - picUrl, ownerid, txt, insuser, insdt - - - - delete from TB_SCADAPIC_ProcessSection - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SCADAPIC_ProcessSection (id, pid, processSectionId, - posx, posy, containerWidth, - containerHeight, width, height, - picUrl, ownerid, txt, - insuser, insdt) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{processsectionid,jdbcType=VARCHAR}, - #{posx,jdbcType=DOUBLE}, #{posy,jdbcType=DOUBLE}, #{containerwidth,jdbcType=DOUBLE}, - #{containerheight,jdbcType=DOUBLE}, #{width,jdbcType=DOUBLE}, #{height,jdbcType=DOUBLE}, - #{picurl,jdbcType=VARCHAR}, #{ownerid,jdbcType=VARCHAR}, #{txt,jdbcType=VARCHAR}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}) - - - insert into TB_SCADAPIC_ProcessSection - - - id, - - - pid, - - - processSectionId, - - - posx, - - - posy, - - - containerWidth, - - - containerHeight, - - - width, - - - height, - - - picUrl, - - - ownerid, - - - txt, - - - insuser, - - - insdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{processsectionid,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DOUBLE}, - - - #{posy,jdbcType=DOUBLE}, - - - #{containerwidth,jdbcType=DOUBLE}, - - - #{containerheight,jdbcType=DOUBLE}, - - - #{width,jdbcType=DOUBLE}, - - - #{height,jdbcType=DOUBLE}, - - - #{picurl,jdbcType=VARCHAR}, - - - #{ownerid,jdbcType=VARCHAR}, - - - #{txt,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - - - update TB_SCADAPIC_ProcessSection - - - pid = #{pid,jdbcType=VARCHAR}, - - - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DOUBLE}, - - - posy = #{posy,jdbcType=DOUBLE}, - - - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - - - containerHeight = #{containerheight,jdbcType=DOUBLE}, - - - width = #{width,jdbcType=DOUBLE}, - - - height = #{height,jdbcType=DOUBLE}, - - - picUrl = #{picurl,jdbcType=VARCHAR}, - - - ownerid = #{ownerid,jdbcType=VARCHAR}, - - - txt = #{txt,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SCADAPIC_ProcessSection - set pid = #{pid,jdbcType=VARCHAR}, - processSectionId = #{processsectionid,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DOUBLE}, - posy = #{posy,jdbcType=DOUBLE}, - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - containerHeight = #{containerheight,jdbcType=DOUBLE}, - width = #{width,jdbcType=DOUBLE}, - height = #{height,jdbcType=DOUBLE}, - picUrl = #{picurl,jdbcType=VARCHAR}, - ownerid = #{ownerid,jdbcType=VARCHAR}, - txt = #{txt,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SCADAPIC_ProcessSection - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/ScadaPic_TxtMapper.xml b/src/com/sipai/mapper/work/ScadaPic_TxtMapper.xml deleted file mode 100644 index af1d6142..00000000 --- a/src/com/sipai/mapper/work/ScadaPic_TxtMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, pid, posx, posy, containerWidth, containerHeight, insuser, insdt, content, - ownerid, fsize - - - - delete from TB_SCADAPIC_TXT - where id = #{id,jdbcType=VARCHAR} - - - insert into TB_SCADAPIC_TXT (id, pid, posx, - posy, containerWidth, containerHeight, - insuser, insdt, content, - ownerid, fsize) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{posx,jdbcType=DOUBLE}, - #{posy,jdbcType=DOUBLE}, #{containerwidth,jdbcType=DOUBLE}, #{containerheight,jdbcType=DOUBLE}, - #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{content,jdbcType=VARCHAR}, - #{ownerid,jdbcType=VARCHAR}, #{fsize,jdbcType=VARCHAR}) - - - insert into TB_SCADAPIC_TXT - - - id, - - - pid, - - - posx, - - - posy, - - - containerWidth, - - - containerHeight, - - - insuser, - - - insdt, - - - content, - - - ownerid, - - - fsize, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{posx,jdbcType=DOUBLE}, - - - #{posy,jdbcType=DOUBLE}, - - - #{containerwidth,jdbcType=DOUBLE}, - - - #{containerheight,jdbcType=DOUBLE}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{content,jdbcType=VARCHAR}, - - - #{ownerid,jdbcType=VARCHAR}, - - - #{fsize,jdbcType=VARCHAR}, - - - - - update TB_SCADAPIC_TXT - - - pid = #{pid,jdbcType=VARCHAR}, - - - posx = #{posx,jdbcType=DOUBLE}, - - - posy = #{posy,jdbcType=DOUBLE}, - - - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - - - containerHeight = #{containerheight,jdbcType=DOUBLE}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - content = #{content,jdbcType=VARCHAR}, - - - ownerid = #{ownerid,jdbcType=VARCHAR}, - - - fsize = #{fsize,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update TB_SCADAPIC_TXT - set pid = #{pid,jdbcType=VARCHAR}, - posx = #{posx,jdbcType=DOUBLE}, - posy = #{posy,jdbcType=DOUBLE}, - containerWidth = #{containerwidth,jdbcType=DOUBLE}, - containerHeight = #{containerheight,jdbcType=DOUBLE}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - content = #{content,jdbcType=VARCHAR}, - ownerid = #{ownerid,jdbcType=VARCHAR}, - fsize = #{fsize,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - TB_SCADAPIC_TXT - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/SchedulingMapper.xml b/src/com/sipai/mapper/work/SchedulingMapper.xml deleted file mode 100644 index 02bc326d..00000000 --- a/src/com/sipai/mapper/work/SchedulingMapper.xml +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, grouptypeid, bizid, userids, groupDetail_id, groupManageid, schedulingtype, - patrolmode, areaid, stdt, eddt, status, isTypeSetting, succeeduser, succeeddt, succeedRemark, handoveruser, - handoverdt, workPeople - - - - delete - from tb_work_scheduling - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_scheduling (id, insdt, insuser, - grouptypeid, bizid, userids, - groupDetail_id, groupManageid, schedulingtype, - patrolmode, areaid, stdt, - eddt, status, isTypeSetting, succeeduser, - succeeddt, succeedRemark, handoveruser, - handoverdt, workPeople) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{grouptypeid,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{userids,jdbcType=VARCHAR}, - #{groupdetailId,jdbcType=VARCHAR}, #{groupmanageid,jdbcType=VARCHAR}, - #{schedulingtype,jdbcType=VARCHAR}, - #{patrolmode,jdbcType=VARCHAR}, #{areaid,jdbcType=VARCHAR}, #{stdt,jdbcType=TIMESTAMP}, - #{eddt,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{istypesetting,jdbcType=INTEGER}, #{succeeduser,jdbcType=VARCHAR}, - #{succeeddt,jdbcType=TIMESTAMP}, #{succeedremark,jdbcType=VARCHAR}, #{handoveruser,jdbcType=VARCHAR}, - #{handoverdt,jdbcType=TIMESTAMP}, #{workpeople,jdbcType=VARCHAR}) - - - insert into tb_work_scheduling - - - id, - - - insdt, - - - insuser, - - - grouptypeid, - - - bizid, - - - userids, - - - groupDetail_id, - - - groupManageid, - - - schedulingtype, - - - patrolmode, - - - areaid, - - - stdt, - - - eddt, - - - status, - - - istypesetting, - - - succeeduser, - - - succeeddt, - - - succeedRemark, - - - handoveruser, - - - handoverdt, - - - workPeople, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{grouptypeid,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{userids,jdbcType=VARCHAR}, - - - #{groupdetailId,jdbcType=VARCHAR}, - - - #{groupmanageid,jdbcType=VARCHAR}, - - - #{schedulingtype,jdbcType=VARCHAR}, - - - #{patrolmode,jdbcType=VARCHAR}, - - - #{areaid,jdbcType=VARCHAR}, - - - #{stdt,jdbcType=TIMESTAMP}, - - - #{eddt,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=INTEGER}, - - - #{istypesetting,jdbcType=INTEGER}, - - - #{succeeduser,jdbcType=VARCHAR}, - - - #{succeeddt,jdbcType=TIMESTAMP}, - - - #{succeedremark,jdbcType=VARCHAR}, - - - #{handoveruser,jdbcType=VARCHAR}, - - - #{handoverdt,jdbcType=TIMESTAMP}, - - - #{workpeople,jdbcType=VARCHAR}, - - - - - update tb_work_scheduling - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - grouptypeid = #{grouptypeid,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - userids = #{userids,jdbcType=VARCHAR}, - - - groupDetail_id = #{groupdetailId,jdbcType=VARCHAR}, - - - groupManageid = #{groupmanageid,jdbcType=VARCHAR}, - - - schedulingtype = #{schedulingtype,jdbcType=VARCHAR}, - - - patrolmode = #{patrolmode,jdbcType=VARCHAR}, - - - areaid = #{areaid,jdbcType=VARCHAR}, - - - stdt = #{stdt,jdbcType=TIMESTAMP}, - - - eddt = #{eddt,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=INTEGER}, - - - isTypeSetting = #{istypesetting,jdbcType=INTEGER}, - - - succeeduser = #{succeeduser,jdbcType=VARCHAR}, - - - succeeddt = #{succeeddt,jdbcType=TIMESTAMP}, - - - succeedRemark = #{succeedremark,jdbcType=VARCHAR}, - - - handoveruser = #{handoveruser,jdbcType=VARCHAR}, - - - handoverdt = #{handoverdt,jdbcType=TIMESTAMP}, - - - workPeople = #{workpeople,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_scheduling - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - grouptypeid = #{grouptypeid,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - userids = #{userids,jdbcType=VARCHAR}, - groupDetail_id = #{groupdetailId,jdbcType=VARCHAR}, - groupManageid = #{groupmanageid,jdbcType=VARCHAR}, - schedulingtype = #{schedulingtype,jdbcType=VARCHAR}, - patrolmode = #{patrolmode,jdbcType=VARCHAR}, - areaid = #{areaid,jdbcType=VARCHAR}, - stdt = #{stdt,jdbcType=TIMESTAMP}, - eddt = #{eddt,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=INTEGER}, - isTypeSetting = #{istypesetting,jdbcType=INTEGER}, - succeeduser = #{succeeduser,jdbcType=VARCHAR}, - succeeddt = #{succeeddt,jdbcType=TIMESTAMP}, - succeedRemark = #{succeedremark,jdbcType=VARCHAR}, - handoveruser = #{handoveruser,jdbcType=VARCHAR}, - handoverdt = #{handoverdt,jdbcType=TIMESTAMP}, - workPeople = #{workpeople,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_work_scheduling ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/SchedulingReplaceJobMapper.xml b/src/com/sipai/mapper/work/SchedulingReplaceJobMapper.xml deleted file mode 100644 index 32b3cabc..00000000 --- a/src/com/sipai/mapper/work/SchedulingReplaceJobMapper.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - id, replaceTime, oldPeople, replacePeople, schedulingId - - - - delete from tb_work_scheduling_replaceJob - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_scheduling_replaceJob (id, replaceTime, oldPeople, - replacePeople, schedulingId) - values (#{id,jdbcType=VARCHAR}, #{replacetime,jdbcType=TIMESTAMP}, #{oldpeople,jdbcType=VARCHAR}, - #{replacepeople,jdbcType=VARCHAR}, #{schedulingid,jdbcType=VARCHAR}) - - - insert into tb_work_scheduling_replaceJob - - - id, - - - replaceTime, - - - oldPeople, - - - replacePeople, - - - schedulingId, - - - - - #{id,jdbcType=VARCHAR}, - - - #{replacetime,jdbcType=TIMESTAMP}, - - - #{oldpeople,jdbcType=VARCHAR}, - - - #{replacepeople,jdbcType=VARCHAR}, - - - #{schedulingid,jdbcType=VARCHAR}, - - - - - update tb_work_scheduling_replaceJob - - - replaceTime = #{replacetime,jdbcType=TIMESTAMP}, - - - oldPeople = #{oldpeople,jdbcType=VARCHAR}, - - - replacePeople = #{replacepeople,jdbcType=VARCHAR}, - - - schedulingId = #{schedulingid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_scheduling_replaceJob - set replaceTime = #{replacetime,jdbcType=TIMESTAMP}, - oldPeople = #{oldpeople,jdbcType=VARCHAR}, - replacePeople = #{replacepeople,jdbcType=VARCHAR}, - schedulingId = #{schedulingid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_work_scheduling_replaceJob ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/SpeechRecognitionMapper.xml b/src/com/sipai/mapper/work/SpeechRecognitionMapper.xml deleted file mode 100644 index 0785858e..00000000 --- a/src/com/sipai/mapper/work/SpeechRecognitionMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, text, textLength, type, sysType, method, respondVoice, remark, unitId, code - - - - delete from tb_SpeechRecognition - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_SpeechRecognition (id, text, textLength, - type, sysType, method, - respondVoice, remark, unitId, - code) - values (#{id,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, #{textlength,jdbcType=INTEGER}, - #{type,jdbcType=VARCHAR}, #{systype,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, - #{respondvoice,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{code,jdbcType=VARCHAR}) - - - insert into tb_SpeechRecognition - - - id, - - - text, - - - textLength, - - - type, - - - sysType, - - - method, - - - respondVoice, - - - remark, - - - unitId, - - - code, - - - - - #{id,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{textlength,jdbcType=INTEGER}, - - - #{type,jdbcType=VARCHAR}, - - - #{systype,jdbcType=VARCHAR}, - - - #{method,jdbcType=VARCHAR}, - - - #{respondvoice,jdbcType=VARCHAR}, - - - #{remark,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - - - update tb_SpeechRecognition - - - text = #{text,jdbcType=VARCHAR}, - - - textLength = #{textlength,jdbcType=INTEGER}, - - - type = #{type,jdbcType=VARCHAR}, - - - sysType = #{systype,jdbcType=VARCHAR}, - - - method = #{method,jdbcType=VARCHAR}, - - - respondVoice = #{respondvoice,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - code = #{code,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_SpeechRecognition - set text = #{text,jdbcType=VARCHAR}, - textLength = #{textlength,jdbcType=INTEGER}, - type = #{type,jdbcType=VARCHAR}, - sysType = #{systype,jdbcType=VARCHAR}, - method = #{method,jdbcType=VARCHAR}, - respondVoice = #{respondvoice,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - code = #{code,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_SpeechRecognition ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/SpeechRecognitionMpRespondMapper.xml b/src/com/sipai/mapper/work/SpeechRecognitionMpRespondMapper.xml deleted file mode 100644 index 40fb5c96..00000000 --- a/src/com/sipai/mapper/work/SpeechRecognitionMpRespondMapper.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - id, pid, pname, mpid, jsValue, jsMethod, valueMethod, morder, respondText_True, respondText_False - - - - delete from tb_SpeechRecognition_MpRespond - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_SpeechRecognition_MpRespond (id, pid, pname, - mpid, jsValue, jsMethod, - valueMethod, morder, respondText_True, - respondText_False) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{jsvalue,jdbcType=DOUBLE}, #{jsmethod,jdbcType=VARCHAR}, - #{valuemethod,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{respondtextTrue,jdbcType=VARCHAR}, - #{respondtextFalse,jdbcType=VARCHAR}) - - - insert into tb_SpeechRecognition_MpRespond - - - id, - - - pid, - - - pname, - - - mpid, - - - jsValue, - - - jsMethod, - - - valueMethod, - - - morder, - - - respondText_True, - - - respondText_False, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{pname,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{jsvalue,jdbcType=DOUBLE}, - - - #{jsmethod,jdbcType=VARCHAR}, - - - #{valuemethod,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{respondtextTrue,jdbcType=VARCHAR}, - - - #{respondtextFalse,jdbcType=VARCHAR}, - - - - - update tb_SpeechRecognition_MpRespond - - - pid = #{pid,jdbcType=VARCHAR}, - - - pname = #{pname,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - jsValue = #{jsvalue,jdbcType=DOUBLE}, - - - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - - - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - respondText_True = #{respondtextTrue,jdbcType=VARCHAR}, - - - respondText_False = #{respondtextFalse,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_SpeechRecognition_MpRespond - set pid = #{pid,jdbcType=VARCHAR}, - pname = #{pname,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - jsValue = #{jsvalue,jdbcType=DOUBLE}, - jsMethod = #{jsmethod,jdbcType=VARCHAR}, - valueMethod = #{valuemethod,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - respondText_True = #{respondtextTrue,jdbcType=VARCHAR}, - respondText_False = #{respondtextFalse,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_SpeechRecognition_MpRespond ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WeatherMapper.xml b/src/com/sipai/mapper/work/WeatherMapper.xml deleted file mode 100644 index 5e059644..00000000 --- a/src/com/sipai/mapper/work/WeatherMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - [temperature] - ,[weather] - ,[temprange] - ,[airquality] - ,[humidity] - ,[realfeel] - ,[ultraviolet] - ,[pressure] - ,[airspeed] - ,[winddirection] - ,[datetime] - - - insert into tb_weather (temperature, weather, temprange, - airquality, humidity, realfeel, - ultraviolet, pressure, airspeed, - winddirection, datetime) - values (#{temperature,jdbcType=VARCHAR}, #{weather,jdbcType=VARCHAR}, #{temprange,jdbcType=VARCHAR}, - #{airquality,jdbcType=VARCHAR}, #{humidity,jdbcType=VARCHAR}, #{realfeel,jdbcType=VARCHAR}, - #{ultraviolet,jdbcType=VARCHAR}, #{pressure,jdbcType=VARCHAR}, #{airspeed,jdbcType=VARCHAR}, - #{winddirection,jdbcType=VARCHAR}, #{datetime,jdbcType=TIMESTAMP}) - - - insert into tb_weather - - - temperature, - - - weather, - - - temprange, - - - airquality, - - - humidity, - - - realfeel, - - - ultraviolet, - - - pressure, - - - airspeed, - - - winddirection, - - - datetime, - - - - - #{temperature,jdbcType=VARCHAR}, - - - #{weather,jdbcType=VARCHAR}, - - - #{temprange,jdbcType=VARCHAR}, - - - #{airquality,jdbcType=VARCHAR}, - - - #{humidity,jdbcType=VARCHAR}, - - - #{realfeel,jdbcType=VARCHAR}, - - - #{ultraviolet,jdbcType=VARCHAR}, - - - #{pressure,jdbcType=VARCHAR}, - - - #{airspeed,jdbcType=VARCHAR}, - - - #{winddirection,jdbcType=VARCHAR}, - - - #{datetime,jdbcType=TIMESTAMP}, - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WeatherNewMapper.xml b/src/com/sipai/mapper/work/WeatherNewMapper.xml deleted file mode 100644 index 21f82070..00000000 --- a/src/com/sipai/mapper/work/WeatherNewMapper.xml +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - id, time, city, weather, temp, wind, humidity, bizid, high_temp, low_temp, wind_power, - precip, feelsLike, pressure, vis, windSpeed,tide , type - - - - delete from tb_weather - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_weather (id, time, city, - weather, temp, wind, - humidity, bizid, high_temp, - low_temp, wind_power, precip, - feelsLike, pressure, vis, - windSpeed, tide, type) - values (#{id,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP}, #{city,jdbcType=VARCHAR}, - #{weather,jdbcType=VARCHAR}, #{temp,jdbcType=VARCHAR}, #{wind,jdbcType=VARCHAR}, - #{humidity,jdbcType=VARCHAR}, #{bizid,jdbcType=VARCHAR}, #{highTemp,jdbcType=VARCHAR}, - #{lowTemp,jdbcType=VARCHAR}, #{windPower,jdbcType=VARCHAR}, #{precip,jdbcType=VARCHAR}, - #{feelslike,jdbcType=VARCHAR}, #{pressure,jdbcType=VARCHAR}, #{vis,jdbcType=VARCHAR}, - #{windspeed,jdbcType=VARCHAR}, #{tide}, #{type}) - - - insert into tb_weather - - - id, - - - time, - - - city, - - - weather, - - - temp, - - - wind, - - - humidity, - - - bizid, - - - high_temp, - - - low_temp, - - - wind_power, - - - precip, - - - feelsLike, - - - pressure, - - - vis, - - - windSpeed, - - - #{tide}, - - - type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{time,jdbcType=TIMESTAMP}, - - - #{city,jdbcType=VARCHAR}, - - - #{weather,jdbcType=VARCHAR}, - - - #{temp,jdbcType=VARCHAR}, - - - #{wind,jdbcType=VARCHAR}, - - - #{humidity,jdbcType=VARCHAR}, - - - #{bizid,jdbcType=VARCHAR}, - - - #{highTemp,jdbcType=VARCHAR}, - - - #{lowTemp,jdbcType=VARCHAR}, - - - #{windPower,jdbcType=VARCHAR}, - - - #{precip,jdbcType=VARCHAR}, - - - #{feelslike,jdbcType=VARCHAR}, - - - #{pressure,jdbcType=VARCHAR}, - - - #{vis,jdbcType=VARCHAR}, - - - #{windspeed,jdbcType=VARCHAR}, - - - #{tide,jdbcType=VARCHAR}, - - - #{type}, - - - - - update tb_weather - - - time = #{time,jdbcType=TIMESTAMP}, - - - city = #{city,jdbcType=VARCHAR}, - - - weather = #{weather,jdbcType=VARCHAR}, - - - temp = #{temp,jdbcType=VARCHAR}, - - - wind = #{wind,jdbcType=VARCHAR}, - - - humidity = #{humidity,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - high_temp = #{highTemp,jdbcType=VARCHAR}, - - - low_temp = #{lowTemp,jdbcType=VARCHAR}, - - - wind_power = #{windPower,jdbcType=VARCHAR}, - - - precip = #{precip,jdbcType=VARCHAR}, - - - feelsLike = #{feelslike,jdbcType=VARCHAR}, - - - pressure = #{pressure,jdbcType=VARCHAR}, - - - vis = #{vis,jdbcType=VARCHAR}, - - - windSpeed = #{windspeed,jdbcType=VARCHAR}, - - - tide = #{tide,jdbcType=VARCHAR}, - - - type = #{type}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_weather - - - time = #{time,jdbcType=TIMESTAMP}, - - - city = #{city,jdbcType=VARCHAR}, - - - weather = #{weather,jdbcType=VARCHAR}, - - - temp = #{temp,jdbcType=VARCHAR}, - - - wind = #{wind,jdbcType=VARCHAR}, - - - humidity = #{humidity,jdbcType=VARCHAR}, - - - bizid = #{bizid,jdbcType=VARCHAR}, - - - high_temp = #{highTemp,jdbcType=VARCHAR}, - - - low_temp = #{lowTemp,jdbcType=VARCHAR}, - - - wind_power = #{windPower,jdbcType=VARCHAR}, - - - precip = #{precip,jdbcType=VARCHAR}, - - - feelsLike = #{feelslike,jdbcType=VARCHAR}, - - - pressure = #{pressure,jdbcType=VARCHAR}, - - - vis = #{vis,jdbcType=VARCHAR}, - - - windSpeed = #{windspeed,jdbcType=VARCHAR}, - - - tide = #{tide,jdbcType=VARCHAR}, - - - type = #{type}, - - - where time = #{time} and bizid = #{bizid} - - and type = #{type} - - - - update tb_weather - set time = #{time,jdbcType=TIMESTAMP}, - city = #{city,jdbcType=VARCHAR}, - weather = #{weather,jdbcType=VARCHAR}, - temp = #{temp,jdbcType=VARCHAR}, - wind = #{wind,jdbcType=VARCHAR}, - humidity = #{humidity,jdbcType=VARCHAR}, - bizid = #{bizid,jdbcType=VARCHAR}, - high_temp = #{highTemp,jdbcType=VARCHAR}, - low_temp = #{lowTemp,jdbcType=VARCHAR}, - wind_power = #{windPower,jdbcType=VARCHAR}, - precip = #{precip,jdbcType=VARCHAR}, - feelsLike = #{feelslike,jdbcType=VARCHAR}, - pressure = #{pressure,jdbcType=VARCHAR}, - vis = #{vis,jdbcType=VARCHAR}, - tide = #{tide,jdbcType=VARCHAR}, - windSpeed = #{windspeed,jdbcType=VARCHAR}, - type = #{type} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_weather ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WeatherSaveNameMapper.xml b/src/com/sipai/mapper/work/WeatherSaveNameMapper.xml deleted file mode 100644 index 2de38e3d..00000000 --- a/src/com/sipai/mapper/work/WeatherSaveNameMapper.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - id, tb_weather_name, tb_weather_save_name, type - - - - - delete from tb_weather_save_name - where id = #{id,jdbcType=INTEGER} - - - insert into tb_weather_save_name (id, tb_weather_name, tb_weather_save_name, type - ) - values (#{id,jdbcType=INTEGER}, #{tbWeatherName,jdbcType=VARCHAR}, #{tbWeatherSaveName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER} - ) - - - insert into tb_weather_save_name - - - id, - - - tb_weather_name, - - - tb_weather_save_name, - - - type, - - - - - #{id,jdbcType=INTEGER}, - - - #{tbWeatherName,jdbcType=VARCHAR}, - - - #{tbWeatherSaveName,jdbcType=VARCHAR}, - - - #{type,jdbcType=INTEGER}, - - - - - update tb_weather_save_name - - - tb_weather_name = #{tbWeatherName,jdbcType=VARCHAR}, - - - tb_weather_save_name = #{tbWeatherSaveName,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=INTEGER} - - - update tb_weather_save_name - set tb_weather_name = #{tbWeatherName,jdbcType=VARCHAR}, - tb_weather_save_name = #{tbWeatherSaveName,jdbcType=VARCHAR} - type = #{type,jdbcType=INTEGER} - where id = #{id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportContentCurveAxisMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportContentCurveAxisMapper.xml deleted file mode 100644 index 37b48996..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportContentCurveAxisMapper.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - id - , num, position, unit, pid, curveMaxValue, curveMinValue, curveInterval - - - - delete - from tb_work_wordAnalysisReport_content_curve_axis - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_content_curve_axis (id, num, position, - unit, pid, curveMaxValue, - curveMinValue, curveInterval) - values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{position,jdbcType=VARCHAR}, - #{unit,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{curvemaxvalue,jdbcType=VARCHAR}, - #{curveminvalue,jdbcType=VARCHAR}, #{curveinterval,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_content_curve_axis - - - id, - - - num, - - - position, - - - unit, - - - pid, - - - curveMaxValue, - - - curveMinValue, - - - curveInterval, - - - - - #{id,jdbcType=VARCHAR}, - - - #{num,jdbcType=INTEGER}, - - - #{position,jdbcType=VARCHAR}, - - - #{unit,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{curvemaxvalue,jdbcType=VARCHAR}, - - - #{curveminvalue,jdbcType=VARCHAR}, - - - #{curveinterval,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_content_curve_axis - - - num = #{num,jdbcType=INTEGER}, - - - position = #{position,jdbcType=VARCHAR}, - - - unit = #{unit,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - curveMaxValue = #{curvemaxvalue,jdbcType=VARCHAR}, - - - curveMinValue = #{curveminvalue,jdbcType=VARCHAR}, - - - curveInterval = #{curveinterval,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_content_curve_axis - set num = #{num,jdbcType=INTEGER}, - position = #{position,jdbcType=VARCHAR}, - unit = #{unit,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - curveMaxValue = #{curvemaxvalue,jdbcType=VARCHAR}, - curveMinValue = #{curveminvalue,jdbcType=VARCHAR}, - curveInterval = #{curveinterval,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_work_wordAnalysisReport_content_curve_axis ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportContentCurveMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportContentCurveMapper.xml deleted file mode 100644 index 3ae36688..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportContentCurveMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - id, name, pid, mpid, fixedValue, axisNum, calculationMethod, valueRange, unitConversion, - morder, legendShape - - - - delete from tb_work_wordAnalysisReport_content_curve - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_content_curve (id, name, pid, - mpid, fixedValue, axisNum, - calculationMethod, valueRange, unitConversion, - morder, legendShape) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{fixedvalue,jdbcType=VARCHAR}, #{axisnum,jdbcType=INTEGER}, - #{calculationmethod,jdbcType=VARCHAR}, #{valuerange,jdbcType=VARCHAR}, #{unitconversion,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{legendshape,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_content_curve - - - id, - - - name, - - - pid, - - - mpid, - - - fixedValue, - - - axisNum, - - - calculationMethod, - - - valueRange, - - - unitConversion, - - - morder, - - - legendShape, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{fixedvalue,jdbcType=VARCHAR}, - - - #{axisnum,jdbcType=INTEGER}, - - - #{calculationmethod,jdbcType=VARCHAR}, - - - #{valuerange,jdbcType=VARCHAR}, - - - #{unitconversion,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{legendshape,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_content_curve - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - - - axisNum = #{axisnum,jdbcType=INTEGER}, - - - calculationMethod = #{calculationmethod,jdbcType=VARCHAR}, - - - valueRange = #{valuerange,jdbcType=VARCHAR}, - - - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - legendShape = #{legendshape,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_content_curve - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - fixedValue = #{fixedvalue,jdbcType=VARCHAR}, - axisNum = #{axisnum,jdbcType=INTEGER}, - calculationMethod = #{calculationmethod,jdbcType=VARCHAR}, - valueRange = #{valuerange,jdbcType=VARCHAR}, - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - legendShape = #{legendshape,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_wordAnalysisReport_content_curve - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportContentFormMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportContentFormMapper.xml deleted file mode 100644 index f70c56d4..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportContentFormMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, name, pid, insertRow, insertColumn, columns, rows, showText, showTextSt, mpid, - calculationMethod, type, valueRange, unitConversion - - - - delete from tb_work_wordAnalysisReport_content_form - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_content_form (id, name, pid, - insertRow, insertColumn, columns, - rows, showText, showTextSt, - mpid, calculationMethod, type, - valueRange, unitConversion) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{insertrow,jdbcType=INTEGER}, #{insertcolumn,jdbcType=INTEGER}, #{columns,jdbcType=INTEGER}, - #{rows,jdbcType=INTEGER}, #{showtext,jdbcType=VARCHAR}, #{showtextst,jdbcType=VARCHAR}, - #{mpid,jdbcType=VARCHAR}, #{calculationmethod,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{valuerange,jdbcType=VARCHAR}, #{unitconversion,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_content_form - - - id, - - - name, - - - pid, - - - insertRow, - - - insertColumn, - - - columns, - - - rows, - - - showText, - - - showTextSt, - - - mpid, - - - calculationMethod, - - - type, - - - valueRange, - - - unitConversion, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insertrow,jdbcType=INTEGER}, - - - #{insertcolumn,jdbcType=INTEGER}, - - - #{columns,jdbcType=INTEGER}, - - - #{rows,jdbcType=INTEGER}, - - - #{showtext,jdbcType=VARCHAR}, - - - #{showtextst,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{calculationmethod,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{valuerange,jdbcType=VARCHAR}, - - - #{unitconversion,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_content_form - - - name = #{name,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insertRow = #{insertrow,jdbcType=INTEGER}, - - - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - - - columns = #{columns,jdbcType=INTEGER}, - - - rows = #{rows,jdbcType=INTEGER}, - - - showText = #{showtext,jdbcType=VARCHAR}, - - - showTextSt = #{showtextst,jdbcType=VARCHAR}, - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - calculationMethod = #{calculationmethod,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - valueRange = #{valuerange,jdbcType=VARCHAR}, - - - unitConversion = #{unitconversion,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_content_form - set name = #{name,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - insertRow = #{insertrow,jdbcType=INTEGER}, - insertColumn = #{insertcolumn,jdbcType=INTEGER}, - columns = #{columns,jdbcType=INTEGER}, - rows = #{rows,jdbcType=INTEGER}, - showText = #{showtext,jdbcType=VARCHAR}, - showTextSt = #{showtextst,jdbcType=VARCHAR}, - mpid = #{mpid,jdbcType=VARCHAR}, - calculationMethod = #{calculationmethod,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - valueRange = #{valuerange,jdbcType=VARCHAR}, - unitConversion = #{unitconversion,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_wordAnalysisReport_content_form - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportContentMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportContentMapper.xml deleted file mode 100644 index ed9ea27f..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportContentMapper.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - id, pid, insuser, insdt, name, type, curveType, axis, textContent, morder, curveWidth, - curveHeight, curveUnit, curveScaleSt, curveMaxValue, curveMinValue, curveInterval - - - - delete from tb_work_wordAnalysisReport_content - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_content (id, pid, insuser, - insdt, name, type, - curveType, axis, textContent, - morder, curveWidth, curveHeight, - curveUnit, curveScaleSt, curveMaxValue, - curveMinValue, curveInterval) - values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{insuser,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, - #{curvetype,jdbcType=VARCHAR}, #{axis,jdbcType=VARCHAR}, #{textcontent,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{curvewidth,jdbcType=VARCHAR}, #{curveheight,jdbcType=VARCHAR}, - #{curveunit,jdbcType=VARCHAR}, #{curvescalest,jdbcType=VARCHAR}, #{curvemaxvalue,jdbcType=VARCHAR}, - #{curveminvalue,jdbcType=VARCHAR}, #{curveinterval,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_content - - - id, - - - pid, - - - insuser, - - - insdt, - - - name, - - - type, - - - curveType, - - - axis, - - - textContent, - - - morder, - - - curveWidth, - - - curveHeight, - - - curveUnit, - - - curveScaleSt, - - - curveMaxValue, - - - curveMinValue, - - - curveInterval, - - - - - #{id,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{curvetype,jdbcType=VARCHAR}, - - - #{axis,jdbcType=VARCHAR}, - - - #{textcontent,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{curvewidth,jdbcType=VARCHAR}, - - - #{curveheight,jdbcType=VARCHAR}, - - - #{curveunit,jdbcType=VARCHAR}, - - - #{curvescalest,jdbcType=VARCHAR}, - - - #{curvemaxvalue,jdbcType=VARCHAR}, - - - #{curveminvalue,jdbcType=VARCHAR}, - - - #{curveinterval,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_content - - - pid = #{pid,jdbcType=VARCHAR}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - curveType = #{curvetype,jdbcType=VARCHAR}, - - - axis = #{axis,jdbcType=VARCHAR}, - - - textContent = #{textcontent,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - curveWidth = #{curvewidth,jdbcType=VARCHAR}, - - - curveHeight = #{curveheight,jdbcType=VARCHAR}, - - - curveUnit = #{curveunit,jdbcType=VARCHAR}, - - - curveScaleSt = #{curvescalest,jdbcType=VARCHAR}, - - - curveMaxValue = #{curvemaxvalue,jdbcType=VARCHAR}, - - - curveMinValue = #{curveminvalue,jdbcType=VARCHAR}, - - - curveInterval = #{curveinterval,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_content - set pid = #{pid,jdbcType=VARCHAR}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - curveType = #{curvetype,jdbcType=VARCHAR}, - axis = #{axis,jdbcType=VARCHAR}, - textContent = #{textcontent,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - curveWidth = #{curvewidth,jdbcType=VARCHAR}, - curveHeight = #{curveheight,jdbcType=VARCHAR}, - curveUnit = #{curveunit,jdbcType=VARCHAR}, - curveScaleSt = #{curvescalest,jdbcType=VARCHAR}, - curveMaxValue = #{curvemaxvalue,jdbcType=VARCHAR}, - curveMinValue = #{curveminvalue,jdbcType=VARCHAR}, - curveInterval = #{curveinterval,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete - from tb_work_wordAnalysisReport_content ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportFormDataMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportFormDataMapper.xml deleted file mode 100644 index 1e4953db..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportFormDataMapper.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - id, mpid, value, pid, modeFormld, showText - - - - delete from tb_work_wordAnalysisReport_formData - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_formData (id, mpid, value, - pid, modeFormld, showText - ) - values (#{id,jdbcType=VARCHAR}, #{mpid,jdbcType=VARCHAR}, #{value,jdbcType=DOUBLE}, - #{pid,jdbcType=VARCHAR}, #{modeformld,jdbcType=VARCHAR}, #{showtext,jdbcType=VARCHAR} - ) - - - insert into tb_work_wordAnalysisReport_formData - - - id, - - - mpid, - - - value, - - - pid, - - - modeFormld, - - - showText, - - - - - #{id,jdbcType=VARCHAR}, - - - #{mpid,jdbcType=VARCHAR}, - - - #{value,jdbcType=DOUBLE}, - - - #{pid,jdbcType=VARCHAR}, - - - #{modeformld,jdbcType=VARCHAR}, - - - #{showtext,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_formData - - - mpid = #{mpid,jdbcType=VARCHAR}, - - - value = #{value,jdbcType=DOUBLE}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - modeFormld = #{modeformld,jdbcType=VARCHAR}, - - - showText = #{showtext,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_formData - set mpid = #{mpid,jdbcType=VARCHAR}, - value = #{value,jdbcType=DOUBLE}, - pid = #{pid,jdbcType=VARCHAR}, - modeFormld = #{modeformld,jdbcType=VARCHAR}, - showText = #{showtext,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_wordAnalysisReport_formData - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportRecordMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportRecordMapper.xml deleted file mode 100644 index e6245f67..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportRecordMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - id, name, sdt, edt, pid - - - - delete from tb_work_wordAnalysisReport_record - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_record (id, name, sdt, - edt, pid) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sdt,jdbcType=TIMESTAMP}, - #{edt,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_record - - - id, - - - name, - - - sdt, - - - edt, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{sdt,jdbcType=TIMESTAMP}, - - - #{edt,jdbcType=TIMESTAMP}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_record - - - name = #{name,jdbcType=VARCHAR}, - - - sdt = #{sdt,jdbcType=TIMESTAMP}, - - - edt = #{edt,jdbcType=TIMESTAMP}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_record - set name = #{name,jdbcType=VARCHAR}, - sdt = #{sdt,jdbcType=TIMESTAMP}, - edt = #{edt,jdbcType=TIMESTAMP}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_wordAnalysisReport_record - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportStructureMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportStructureMapper.xml deleted file mode 100644 index bb9262b9..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportStructureMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, name, unitId, morder, insuser, insdt, startHour, startDay, endDay, pid, type, - fontSize, boldFont, color - - - - delete from tb_work_wordAnalysisReport_structure - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_structure (id, name, unitId, - morder, insuser, insdt, - startHour, startDay, endDay, - pid, type, fontSize, - boldFont, color) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, - #{morder,jdbcType=INTEGER}, #{insuser,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, - #{starthour,jdbcType=VARCHAR}, #{startday,jdbcType=VARCHAR}, #{endday,jdbcType=VARCHAR}, - #{pid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{fontsize,jdbcType=VARCHAR}, - #{boldfont,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_structure - - - id, - - - name, - - - unitId, - - - morder, - - - insuser, - - - insdt, - - - startHour, - - - startDay, - - - endDay, - - - pid, - - - type, - - - fontSize, - - - boldFont, - - - color, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{unitid,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{starthour,jdbcType=VARCHAR}, - - - #{startday,jdbcType=VARCHAR}, - - - #{endday,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{fontsize,jdbcType=VARCHAR}, - - - #{boldfont,jdbcType=VARCHAR}, - - - #{color,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_structure - - - name = #{name,jdbcType=VARCHAR}, - - - unitId = #{unitid,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - startHour = #{starthour,jdbcType=VARCHAR}, - - - startDay = #{startday,jdbcType=VARCHAR}, - - - endDay = #{endday,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - fontSize = #{fontsize,jdbcType=VARCHAR}, - - - boldFont = #{boldfont,jdbcType=VARCHAR}, - - - color = #{color,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_structure - set name = #{name,jdbcType=VARCHAR}, - unitId = #{unitid,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - insuser = #{insuser,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - startHour = #{starthour,jdbcType=VARCHAR}, - startDay = #{startday,jdbcType=VARCHAR}, - endDay = #{endday,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - fontSize = #{fontsize,jdbcType=VARCHAR}, - boldFont = #{boldfont,jdbcType=VARCHAR}, - color = #{color,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_wordAnalysisReport_structure - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/work/WordAnalysisReportTextMapper.xml b/src/com/sipai/mapper/work/WordAnalysisReportTextMapper.xml deleted file mode 100644 index 8392bea7..00000000 --- a/src/com/sipai/mapper/work/WordAnalysisReportTextMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - id, text, pid, modeFormld - - - - delete from tb_work_wordAnalysisReport_text - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_work_wordAnalysisReport_text (id, text, pid, - modeFormld) - values (#{id,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, - #{modeformld,jdbcType=VARCHAR}) - - - insert into tb_work_wordAnalysisReport_text - - - id, - - - text, - - - pid, - - - modeFormld, - - - - - #{id,jdbcType=VARCHAR}, - - - #{text,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - #{modeformld,jdbcType=VARCHAR}, - - - - - update tb_work_wordAnalysisReport_text - - - text = #{text,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - modeFormld = #{modeformld,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_work_wordAnalysisReport_text - set text = #{text,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR}, - modeFormld = #{modeformld,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from - tb_work_wordAnalysisReport_text - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/OverhaulItemContentMapper.xml b/src/com/sipai/mapper/workorder/OverhaulItemContentMapper.xml deleted file mode 100644 index b68fb1db..00000000 --- a/src/com/sipai/mapper/workorder/OverhaulItemContentMapper.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - id, insdt, insuser, contents, progress, base_hours, working_hours, start_date, finish_date, item_id - - - - delete from tb_maintenance_overhaul_item_content - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_overhaul_item_content (id, insdt, insuser, contents, progress, - base_hours, working_hours, start_date, - finish_date, item_id) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{contents,jdbcType=VARCHAR}, #{progress,jdbcType=DECIMAL}, - #{baseHours,jdbcType=DECIMAL}, #{workingHours,jdbcType=DECIMAL}, #{startDate,jdbcType=TIMESTAMP}, - #{finishDate,jdbcType=TIMESTAMP}, #{itemId,jdbcType=VARCHAR}) - - - insert into tb_maintenance_overhaul_item_content - - - id, - - - insdt, - - - insuser, - - - contents, - - - progress, - - - base_hours, - - - working_hours, - - - start_date, - - - finish_date, - - - item_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{contents,jdbcType=VARCHAR}, - - - #{progress,jdbcType=DECIMAL}, - - - #{baseHours,jdbcType=DECIMAL}, - - - #{workingHours,jdbcType=DECIMAL}, - - - #{startDate,jdbcType=TIMESTAMP}, - - - #{finishDate,jdbcType=TIMESTAMP}, - - - #{itemId,jdbcType=VARCHAR}, - - - - - update tb_maintenance_overhaul_item_content - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - contents = #{contents,jdbcType=VARCHAR}, - - - progress = #{progress,jdbcType=DECIMAL}, - - - base_hours = #{baseHours,jdbcType=DECIMAL}, - - - working_hours = #{workingHours,jdbcType=DECIMAL}, - - - start_date = #{startDate,jdbcType=TIMESTAMP}, - - - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - - - item_id = #{itemId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_overhaul_item_content - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - contents = #{contents,jdbcType=VARCHAR}, - progress = #{progress,jdbcType=DECIMAL}, - base_hours = #{baseHours,jdbcType=DECIMAL}, - working_hours = #{workingHours,jdbcType=DECIMAL}, - start_date = #{startDate,jdbcType=TIMESTAMP}, - finish_date = #{finishDate,jdbcType=TIMESTAMP}, - item_id = #{itemId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_maintenance_overhaul_item_content - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/OverhaulItemEquipmentMapper.xml b/src/com/sipai/mapper/workorder/OverhaulItemEquipmentMapper.xml deleted file mode 100644 index 4af8251f..00000000 --- a/src/com/sipai/mapper/workorder/OverhaulItemEquipmentMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - id, equipment_id, quota_hour, actual_hour, quota_fee, actual_fee, pid, insdt, insuser,plan_start_date,plan_end_date - - - - delete from tb_maintenance_overhaul_item_equipment - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_overhaul_item_equipment (id, equipment_id, quota_hour, - actual_hour, quota_fee, actual_fee, - pid, insdt, insuser,plan_start_date,plan_end_date - ) - values (#{id,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{quotaHour,jdbcType=DECIMAL}, - #{actualHour,jdbcType=DECIMAL}, #{quotaFee,jdbcType=DECIMAL}, #{actualFee,jdbcType=DECIMAL}, - #{pid,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR} ,#{planStartDate,jdbcType=VARCHAR} ,#{planEndDate,jdbcType=VARCHAR} - ) - - - insert into tb_maintenance_overhaul_item_equipment - - - id, - - - equipment_id, - - - quota_hour, - - - actual_hour, - - - quota_fee, - - - actual_fee, - - - pid, - - - insdt, - - - insuser, - - - plan_start_date, - - - plan_end_date, - - - - - #{id,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{quotaHour,jdbcType=DECIMAL}, - - - #{actualHour,jdbcType=DECIMAL}, - - - #{quotaFee,jdbcType=DECIMAL}, - - - #{actualFee,jdbcType=DECIMAL}, - - - #{pid,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{planStartDate,jdbcType=VARCHAR}, - - - #{planEndDate,jdbcType=VARCHAR}, - - - - - update tb_maintenance_overhaul_item_equipment - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - quota_hour = #{quotaHour,jdbcType=DECIMAL}, - - - actual_hour = #{actualHour,jdbcType=DECIMAL}, - - - quota_fee = #{quotaFee,jdbcType=DECIMAL}, - - - actual_fee = #{actualFee,jdbcType=DECIMAL}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - plan_start_date = #{planStartDate,jdbcType=VARCHAR}, - - - plan_end_date = #{planEndDate,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_overhaul_item_equipment - set equipment_id = #{equipmentId,jdbcType=VARCHAR}, - quota_hour = #{quotaHour,jdbcType=DECIMAL}, - actual_hour = #{actualHour,jdbcType=DECIMAL}, - quota_fee = #{quotaFee,jdbcType=DECIMAL}, - actual_fee = #{actualFee,jdbcType=DECIMAL}, - pid = #{pid,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - plan_start_date = #{planStartDate,jdbcType=VARCHAR}, - plan_end_date = #{planEndDate,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_overhaul_item_equipment - ${where} - - - diff --git a/src/com/sipai/mapper/workorder/OverhaulItemProjectMapper.xml b/src/com/sipai/mapper/workorder/OverhaulItemProjectMapper.xml deleted file mode 100644 index 723c8e92..00000000 --- a/src/com/sipai/mapper/workorder/OverhaulItemProjectMapper.xml +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, process_status, processDefId, processId, unit_id, job_number, - project_type_id, send_user_id, receive_user_id, receive_user_ids, receive_dt, plan_start_date, - plan_finish_date, project_id, finish_explain, difficulty_degree, work_evaluate_score, - working_hours, evaluate_explain, outsourcing_type, safe_operation_type, check_score, - install_evaluate_score, install_problems, debug_evaluate_score, debug_problems, morder,annex - - - - delete - from tb_maintenance_overhaul_item_project - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_overhaul_item_project (id, insdt, insuser, - process_status, processDefId, processId, - unit_id, job_number, project_type_id, - send_user_id, receive_user_id, receive_user_ids, - receive_dt, plan_start_date, plan_finish_date, - project_id, finish_explain, difficulty_degree, - work_evaluate_score, working_hours, evaluate_explain, - outsourcing_type, safe_operation_type, check_score, - install_evaluate_score, install_problems, - debug_evaluate_score, - debug_problems, morder, annex) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{processStatus,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{projectTypeId,jdbcType=VARCHAR}, - #{sendUserId,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, - #{receiveDt,jdbcType=TIMESTAMP}, #{planStartDate,jdbcType=TIMESTAMP}, - #{planFinishDate,jdbcType=TIMESTAMP}, - #{projectId,jdbcType=VARCHAR}, #{finishExplain,jdbcType=VARCHAR}, #{difficultyDegree,jdbcType=DECIMAL}, - #{workEvaluateScore,jdbcType=DECIMAL}, #{workingHours,jdbcType=DECIMAL}, - #{evaluateExplain,jdbcType=VARCHAR}, - #{outsourcingType,jdbcType=VARCHAR}, #{safeOperationType,jdbcType=VARCHAR}, - #{checkScore,jdbcType=DECIMAL}, - #{installEvaluateScore,jdbcType=DECIMAL}, #{installProblems,jdbcType=VARCHAR}, - #{debugEvaluateScore,jdbcType=DECIMAL}, - #{debugProblems,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, #{annex,jdbcType=INTEGER}) - - - insert into tb_maintenance_overhaul_item_project - - - id, - - - insdt, - - - insuser, - - - process_status, - - - processDefId, - - - processId, - - - unit_id, - - - job_number, - - - project_type_id, - - - send_user_id, - - - receive_user_id, - - - receive_user_ids, - - - receive_dt, - - - plan_start_date, - - - plan_finish_date, - - - project_id, - - - finish_explain, - - - difficulty_degree, - - - work_evaluate_score, - - - working_hours, - - - evaluate_explain, - - - outsourcing_type, - - - safe_operation_type, - - - check_score, - - - install_evaluate_score, - - - install_problems, - - - debug_evaluate_score, - - - debug_problems, - - - morder, - - - annex, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{processStatus,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{projectTypeId,jdbcType=VARCHAR}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{receiveDt,jdbcType=TIMESTAMP}, - - - #{planStartDate,jdbcType=TIMESTAMP}, - - - #{planFinishDate,jdbcType=TIMESTAMP}, - - - #{projectId,jdbcType=VARCHAR}, - - - #{finishExplain,jdbcType=VARCHAR}, - - - #{difficultyDegree,jdbcType=DECIMAL}, - - - #{workEvaluateScore,jdbcType=DECIMAL}, - - - #{workingHours,jdbcType=DECIMAL}, - - - #{evaluateExplain,jdbcType=VARCHAR}, - - - #{outsourcingType,jdbcType=VARCHAR}, - - - #{safeOperationType,jdbcType=VARCHAR}, - - - #{checkScore,jdbcType=DECIMAL}, - - - #{installEvaluateScore,jdbcType=DECIMAL}, - - - #{installProblems,jdbcType=VARCHAR}, - - - #{debugEvaluateScore,jdbcType=DECIMAL}, - - - #{debugProblems,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{annex,jdbcType=INTEGER}, - - - - - update tb_maintenance_overhaul_item_project - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - process_status = #{processStatus,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - project_type_id = #{projectTypeId,jdbcType=VARCHAR}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - receive_dt = #{receiveDt,jdbcType=TIMESTAMP}, - - - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - - - plan_finish_date = #{planFinishDate,jdbcType=TIMESTAMP}, - - - project_id = #{projectId,jdbcType=VARCHAR}, - - - finish_explain = #{finishExplain,jdbcType=VARCHAR}, - - - difficulty_degree = #{difficultyDegree,jdbcType=DECIMAL}, - - - work_evaluate_score = #{workEvaluateScore,jdbcType=DECIMAL}, - - - working_hours = #{workingHours,jdbcType=DECIMAL}, - - - evaluate_explain = #{evaluateExplain,jdbcType=VARCHAR}, - - - outsourcing_type = #{outsourcingType,jdbcType=VARCHAR}, - - - safe_operation_type = #{safeOperationType,jdbcType=VARCHAR}, - - - check_score = #{checkScore,jdbcType=DECIMAL}, - - - install_evaluate_score = #{installEvaluateScore,jdbcType=DECIMAL}, - - - install_problems = #{installProblems,jdbcType=VARCHAR}, - - - debug_evaluate_score = #{debugEvaluateScore,jdbcType=DECIMAL}, - - - debug_problems = #{debugProblems,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - annex = #{annex,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_overhaul_item_project - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - process_status = #{processStatus,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - project_type_id = #{projectTypeId,jdbcType=VARCHAR}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - receive_dt = #{receiveDt,jdbcType=TIMESTAMP}, - plan_start_date = #{planStartDate,jdbcType=TIMESTAMP}, - plan_finish_date = #{planFinishDate,jdbcType=TIMESTAMP}, - project_id = #{projectId,jdbcType=VARCHAR}, - finish_explain = #{finishExplain,jdbcType=VARCHAR}, - difficulty_degree = #{difficultyDegree,jdbcType=DECIMAL}, - work_evaluate_score = #{workEvaluateScore,jdbcType=DECIMAL}, - working_hours = #{workingHours,jdbcType=DECIMAL}, - evaluate_explain = #{evaluateExplain,jdbcType=VARCHAR}, - outsourcing_type = #{outsourcingType,jdbcType=VARCHAR}, - safe_operation_type = #{safeOperationType,jdbcType=VARCHAR}, - check_score = #{checkScore,jdbcType=DECIMAL}, - install_evaluate_score = #{installEvaluateScore,jdbcType=DECIMAL}, - install_problems = #{installProblems,jdbcType=VARCHAR}, - debug_evaluate_score = #{debugEvaluateScore,jdbcType=DECIMAL}, - debug_problems = #{debugProblems,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER} annex = #{annex,jdbcType=INTEGER} - where id = #{id,jdbcType=VARCHAR} - - - - - delete - from tb_maintenance_overhaul_item_project ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/OverhaulMapper.xml b/src/com/sipai/mapper/workorder/OverhaulMapper.xml deleted file mode 100644 index be71f284..00000000 --- a/src/com/sipai/mapper/workorder/OverhaulMapper.xml +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, insdt, insuser, unit_id, processDefId, processId, job_number, outsourcing_type, - cycle_quota, cycle_actual, project_type, project_name, budget_type, budget_cost, - plan_date, plan_id, send_user_id, equipment_id, process_status, receive_user_id, - receive_user_ids,project_describe - - - - delete from tb_maintenance_overhaul - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_overhaul (id, insdt, insuser, - unit_id, processDefId, processId, - job_number, outsourcing_type, cycle_quota, - cycle_actual, project_type, project_name, - budget_type, budget_cost, plan_date, - plan_id, send_user_id, - equipment_id, process_status, receive_user_id, - receive_user_ids,project_describe) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{processdefid,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{jobNumber,jdbcType=VARCHAR}, #{outsourcingType,jdbcType=VARCHAR}, #{cycleQuota,jdbcType=VARCHAR}, - #{cycleActual,jdbcType=VARCHAR}, #{projectType,jdbcType=VARCHAR}, #{projectName,jdbcType=VARCHAR}, - #{budgetType,jdbcType=VARCHAR}, #{budgetCost,jdbcType=DECIMAL}, #{planDate,jdbcType=TIMESTAMP}, - #{planId,jdbcType=VARCHAR}, #{sendUserId,jdbcType=VARCHAR}, - #{equipmentId,jdbcType=VARCHAR}, #{processStatus,jdbcType=VARCHAR}, #{receiveUserId,jdbcType=VARCHAR}, - #{receiveUserIds,jdbcType=VARCHAR},#{projectDescribe,jdbcType=VARCHAR}) - - - insert into tb_maintenance_overhaul - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - processDefId, - - - processId, - - - job_number, - - - outsourcing_type, - - - cycle_quota, - - - cycle_actual, - - - project_type, - - - project_name, - - - budget_type, - - - budget_cost, - - - plan_date, - - - plan_id, - - - send_user_id, - - - equipment_id, - - - process_status, - - - receive_user_id, - - - receive_user_ids, - - - project_describe, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{outsourcingType,jdbcType=VARCHAR}, - - - #{cycleQuota,jdbcType=VARCHAR}, - - - #{cycleActual,jdbcType=VARCHAR}, - - - #{projectType,jdbcType=VARCHAR}, - - - #{projectName,jdbcType=VARCHAR}, - - - #{budgetType,jdbcType=VARCHAR}, - - - #{budgetCost,jdbcType=DECIMAL}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{planId,jdbcType=VARCHAR}, - - - #{sendUserId,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{processStatus,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{projectDescribe,jdbcType=VARCHAR}, - - - - - update tb_maintenance_overhaul - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - outsourcing_type = #{outsourcingType,jdbcType=VARCHAR}, - - - cycle_quota = #{cycleQuota,jdbcType=VARCHAR}, - - - cycle_actual = #{cycleActual,jdbcType=VARCHAR}, - - - project_type = #{projectType,jdbcType=VARCHAR}, - - - project_name = #{projectName,jdbcType=VARCHAR}, - - - budget_type = #{budgetType,jdbcType=VARCHAR}, - - - budget_cost = #{budgetCost,jdbcType=DECIMAL}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - plan_id = #{planId,jdbcType=VARCHAR}, - - - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - process_status = #{processStatus,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - project_describe = #{projectDescribe,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_overhaul - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - outsourcing_type = #{outsourcingType,jdbcType=VARCHAR}, - cycle_quota = #{cycleQuota,jdbcType=VARCHAR}, - cycle_actual = #{cycleActual,jdbcType=VARCHAR}, - project_type = #{projectType,jdbcType=VARCHAR}, - project_name = #{projectName,jdbcType=VARCHAR}, - budget_type = #{budgetType,jdbcType=VARCHAR}, - budget_cost = #{budgetCost,jdbcType=DECIMAL}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - plan_id = #{planId,jdbcType=VARCHAR}, - send_user_id = #{sendUserId,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - process_status = #{processStatus,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR} - project_describe = #{projectDescribe,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - - delete from tb_maintenance_overhaul - ${where} - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/OverhaulStatisticsMapper.xml b/src/com/sipai/mapper/workorder/OverhaulStatisticsMapper.xml deleted file mode 100644 index fbb3061e..00000000 --- a/src/com/sipai/mapper/workorder/OverhaulStatisticsMapper.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, overhaul_id, sub_order_hours, award_punishment_hours, worker_num, self_repair_hours, - material_cost, total_overhaul_cost, out_repair_hours, actual_self_hours, actual_material_cost, - actual_out_hour_cost, actual_total_cost, is_normal, difference_des, cheak_point, - quality_cheak_weight, satisfaction_point, coordination_weight, total_point, pro_total_hours, - level, total_hours, description, total_quota_hours, sub_actual_hours, create_time, - update_time - - - - - delete from tb_overhaul_statistics - where id = #{id,jdbcType=VARCHAR} - - - - insert into tb_overhaul_statistics (id, overhaul_id, sub_order_hours, - award_punishment_hours, worker_num, self_repair_hours, - material_cost, total_overhaul_cost, out_repair_hours, - actual_self_hours, actual_material_cost, actual_out_hour_cost, - actual_total_cost, is_normal, difference_des, - cheak_point, quality_cheak_weight, satisfaction_point, - coordination_weight, total_point, pro_total_hours, - level, total_hours, description, - total_quota_hours, sub_actual_hours, create_time, - update_time) - values (#{id,jdbcType=VARCHAR}, #{overhaulId,jdbcType=VARCHAR}, #{subOrderHours,jdbcType=VARCHAR}, - #{awardPunishmentHours,jdbcType=VARCHAR}, #{workerNum,jdbcType=INTEGER}, #{selfRepairHours,jdbcType=VARCHAR}, - #{materialCost,jdbcType=VARCHAR}, #{totalOverhaulCost,jdbcType=VARCHAR}, #{outRepairHours,jdbcType=VARCHAR}, - #{actualSelfHours,jdbcType=VARCHAR}, #{actualMaterialCost,jdbcType=VARCHAR}, #{actualOutHourCost,jdbcType=VARCHAR}, - #{actualTotalCost,jdbcType=VARCHAR}, #{isNormal,jdbcType=VARCHAR}, #{differenceDes,jdbcType=VARCHAR}, - #{cheakPoint,jdbcType=DECIMAL}, #{qualityCheakWeight,jdbcType=TINYINT}, #{satisfactionPoint,jdbcType=DECIMAL}, - #{coordinationWeight,jdbcType=TINYINT}, #{totalPoint,jdbcType=DECIMAL}, #{proTotalHours,jdbcType=VARCHAR}, - #{level,jdbcType=VARCHAR}, #{totalHours,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{totalQuotaHours,jdbcType=VARCHAR}, #{subActualHours,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) - - - - insert into tb_overhaul_statistics - - - id, - - - overhaul_id, - - - sub_order_hours, - - - award_punishment_hours, - - - worker_num, - - - self_repair_hours, - - - material_cost, - - - total_overhaul_cost, - - - out_repair_hours, - - - actual_self_hours, - - - actual_material_cost, - - - actual_out_hour_cost, - - - actual_total_cost, - - - is_normal, - - - difference_des, - - - cheak_point, - - - quality_cheak_weight, - - - satisfaction_point, - - - coordination_weight, - - - total_point, - - - pro_total_hours, - - - level, - - - total_hours, - - - description, - - - total_quota_hours, - - - sub_actual_hours, - - - create_time, - - - update_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{overhaulId,jdbcType=VARCHAR}, - - - #{subOrderHours,jdbcType=VARCHAR}, - - - #{awardPunishmentHours,jdbcType=VARCHAR}, - - - #{workerNum,jdbcType=INTEGER}, - - - #{selfRepairHours,jdbcType=VARCHAR}, - - - #{materialCost,jdbcType=VARCHAR}, - - - #{totalOverhaulCost,jdbcType=VARCHAR}, - - - #{outRepairHours,jdbcType=VARCHAR}, - - - #{actualSelfHours,jdbcType=VARCHAR}, - - - #{actualMaterialCost,jdbcType=VARCHAR}, - - - #{actualOutHourCost,jdbcType=VARCHAR}, - - - #{actualTotalCost,jdbcType=VARCHAR}, - - - #{isNormal,jdbcType=VARCHAR}, - - - #{differenceDes,jdbcType=VARCHAR}, - - - #{cheakPoint,jdbcType=DECIMAL}, - - - #{qualityCheakWeight,jdbcType=TINYINT}, - - - #{satisfactionPoint,jdbcType=DECIMAL}, - - - #{coordinationWeight,jdbcType=TINYINT}, - - - #{totalPoint,jdbcType=DECIMAL}, - - - #{proTotalHours,jdbcType=VARCHAR}, - - - #{level,jdbcType=VARCHAR}, - - - #{totalHours,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{totalQuotaHours,jdbcType=VARCHAR}, - - - #{subActualHours,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update tb_overhaul_statistics - - - overhaul_id = #{overhaulId,jdbcType=VARCHAR}, - - - sub_order_hours = #{subOrderHours,jdbcType=VARCHAR}, - - - award_punishment_hours = #{awardPunishmentHours,jdbcType=VARCHAR}, - - - worker_num = #{workerNum,jdbcType=INTEGER}, - - - self_repair_hours = #{selfRepairHours,jdbcType=VARCHAR}, - - - material_cost = #{materialCost,jdbcType=VARCHAR}, - - - total_overhaul_cost = #{totalOverhaulCost,jdbcType=VARCHAR}, - - - out_repair_hours = #{outRepairHours,jdbcType=VARCHAR}, - - - actual_self_hours = #{actualSelfHours,jdbcType=VARCHAR}, - - - actual_material_cost = #{actualMaterialCost,jdbcType=VARCHAR}, - - - actual_out_hour_cost = #{actualOutHourCost,jdbcType=VARCHAR}, - - - actual_total_cost = #{actualTotalCost,jdbcType=VARCHAR}, - - - is_normal = #{isNormal,jdbcType=VARCHAR}, - - - difference_des = #{differenceDes,jdbcType=VARCHAR}, - - - cheak_point = #{cheakPoint,jdbcType=DECIMAL}, - - - quality_cheak_weight = #{qualityCheakWeight,jdbcType=TINYINT}, - - - satisfaction_point = #{satisfactionPoint,jdbcType=DECIMAL}, - - - coordination_weight = #{coordinationWeight,jdbcType=TINYINT}, - - - total_point = #{totalPoint,jdbcType=DECIMAL}, - - - pro_total_hours = #{proTotalHours,jdbcType=VARCHAR}, - - - level = #{level,jdbcType=VARCHAR}, - - - total_hours = #{totalHours,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - total_quota_hours = #{totalQuotaHours,jdbcType=VARCHAR}, - - - sub_actual_hours = #{subActualHours,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - - update tb_overhaul_statistics - set overhaul_id = #{overhaulId,jdbcType=VARCHAR}, - sub_order_hours = #{subOrderHours,jdbcType=VARCHAR}, - award_punishment_hours = #{awardPunishmentHours,jdbcType=VARCHAR}, - worker_num = #{workerNum,jdbcType=INTEGER}, - self_repair_hours = #{selfRepairHours,jdbcType=VARCHAR}, - material_cost = #{materialCost,jdbcType=VARCHAR}, - total_overhaul_cost = #{totalOverhaulCost,jdbcType=VARCHAR}, - out_repair_hours = #{outRepairHours,jdbcType=VARCHAR}, - actual_self_hours = #{actualSelfHours,jdbcType=VARCHAR}, - actual_material_cost = #{actualMaterialCost,jdbcType=VARCHAR}, - actual_out_hour_cost = #{actualOutHourCost,jdbcType=VARCHAR}, - actual_total_cost = #{actualTotalCost,jdbcType=VARCHAR}, - is_normal = #{isNormal,jdbcType=VARCHAR}, - difference_des = #{differenceDes,jdbcType=VARCHAR}, - cheak_point = #{cheakPoint,jdbcType=DECIMAL}, - quality_cheak_weight = #{qualityCheakWeight,jdbcType=TINYINT}, - satisfaction_point = #{satisfactionPoint,jdbcType=DECIMAL}, - coordination_weight = #{coordinationWeight,jdbcType=TINYINT}, - total_point = #{totalPoint,jdbcType=DECIMAL}, - pro_total_hours = #{proTotalHours,jdbcType=VARCHAR}, - level = #{level,jdbcType=VARCHAR}, - total_hours = #{totalHours,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - total_quota_hours = #{totalQuotaHours,jdbcType=VARCHAR}, - sub_actual_hours = #{subActualHours,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - diff --git a/src/com/sipai/mapper/workorder/OverhaulTypeMapper.xml b/src/com/sipai/mapper/workorder/OverhaulTypeMapper.xml deleted file mode 100644 index cfd21a7b..00000000 --- a/src/com/sipai/mapper/workorder/OverhaulTypeMapper.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - id, name, morder, active, activiti_id - - - - delete from tb_maintenance_overhaul_type - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_maintenance_overhaul_type (id, name, morder, - active, activiti_id) - values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{morder,jdbcType=INTEGER}, - #{active,jdbcType=CHAR}, #{activitiId,jdbcType=VARCHAR}) - - - insert into tb_maintenance_overhaul_type - - - id, - - - name, - - - morder, - - - active, - - - activiti_id, - - - - - #{id,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{morder,jdbcType=INTEGER}, - - - #{active,jdbcType=CHAR}, - - - #{activitiId,jdbcType=VARCHAR}, - - - - - update tb_maintenance_overhaul_type - - - name = #{name,jdbcType=VARCHAR}, - - - morder = #{morder,jdbcType=INTEGER}, - - - active = #{active,jdbcType=CHAR}, - - - activiti_id = #{activitiId,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_maintenance_overhaul_type - set name = #{name,jdbcType=VARCHAR}, - morder = #{morder,jdbcType=INTEGER}, - active = #{active,jdbcType=CHAR}, - activiti_id = #{activitiId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_maintenance_overhaul_type - ${where} - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/WorkorderAchievementOrderMapper.xml b/src/com/sipai/mapper/workorder/WorkorderAchievementOrderMapper.xml deleted file mode 100644 index 22de707c..00000000 --- a/src/com/sipai/mapper/workorder/WorkorderAchievementOrderMapper.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - id, insdt, insuser, name, tb_type, stu_type, type1, type2 - - - - delete from tb_workorder_achievement_order - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_workorder_achievement_order (id, insdt, insuser, - name, tb_type, stu_type, - type1, type2) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{name,jdbcType=VARCHAR}, #{tbType,jdbcType=VARCHAR}, #{stuType,jdbcType=VARCHAR}, - #{type1,jdbcType=VARCHAR}, #{type2,jdbcType=VARCHAR}) - - - insert into tb_workorder_achievement_order - - - id, - - - insdt, - - - insuser, - - - name, - - - tb_type, - - - stu_type, - - - type1, - - - type2, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{tbType,jdbcType=VARCHAR}, - - - #{stuType,jdbcType=VARCHAR}, - - - #{type1,jdbcType=VARCHAR}, - - - #{type2,jdbcType=VARCHAR}, - - - - - update tb_workorder_achievement_order - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - name = #{name,jdbcType=VARCHAR}, - - - tb_type = #{tbType,jdbcType=VARCHAR}, - - - stu_type = #{stuType,jdbcType=VARCHAR}, - - - type1 = #{type1,jdbcType=VARCHAR}, - - - type2 = #{type2,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_workorder_achievement_order - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - tb_type = #{tbType,jdbcType=VARCHAR}, - stu_type = #{stuType,jdbcType=VARCHAR}, - type1 = #{type1,jdbcType=VARCHAR}, - type2 = #{type2,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_workorder_achievement_order - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/WorkorderConsumeMapper.xml b/src/com/sipai/mapper/workorder/WorkorderConsumeMapper.xml deleted file mode 100644 index 630042d5..00000000 --- a/src/com/sipai/mapper/workorder/WorkorderConsumeMapper.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - id, goods_id, repair_item_number, insdt, insuser, upsdt, upsuser, library_number, - library_price, library_total_price, stock_type, number, price, total_price, memo, pid - - - - delete from tb_workorder_consume - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_workorder_consume (id, goods_id, repair_item_number, - insdt, insuser, upsdt, - upsuser, library_number, library_price, - library_total_price, stock_type, number, - price, total_price, memo, pid - ) - values (#{id,jdbcType=VARCHAR}, #{goodsId,jdbcType=VARCHAR}, #{repairItemNumber,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upsdt,jdbcType=TIMESTAMP}, - #{upsuser,jdbcType=VARCHAR}, #{libraryNumber,jdbcType=INTEGER}, #{libraryPrice,jdbcType=DECIMAL}, - #{libraryTotalPrice,jdbcType=DECIMAL}, #{stockType,jdbcType=VARCHAR}, #{number,jdbcType=INTEGER}, - #{price,jdbcType=DECIMAL}, #{totalPrice,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR} - ) - - - insert into tb_workorder_consume - - - id, - - - goods_id, - - - repair_item_number, - - - insdt, - - - insuser, - - - upsdt, - - - upsuser, - - - library_number, - - - library_price, - - - library_total_price, - - - stock_type, - - - number, - - - price, - - - total_price, - - - memo, - - - pid, - - - - - #{id,jdbcType=VARCHAR}, - - - #{goodsId,jdbcType=VARCHAR}, - - - #{repairItemNumber,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{libraryNumber,jdbcType=INTEGER}, - - - #{libraryPrice,jdbcType=DECIMAL}, - - - #{libraryTotalPrice,jdbcType=DECIMAL}, - - - #{stockType,jdbcType=VARCHAR}, - - - #{number,jdbcType=INTEGER}, - - - #{price,jdbcType=DECIMAL}, - - - #{totalPrice,jdbcType=DECIMAL}, - - - #{memo,jdbcType=VARCHAR}, - - - #{pid,jdbcType=VARCHAR}, - - - - - update tb_workorder_consume - - - goods_id = #{goodsId,jdbcType=VARCHAR}, - - - repair_item_number = #{repairItemNumber,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - library_number = #{libraryNumber,jdbcType=INTEGER}, - - - library_price = #{libraryPrice,jdbcType=DECIMAL}, - - - library_total_price = #{libraryTotalPrice,jdbcType=DECIMAL}, - - - stock_type = #{stockType,jdbcType=VARCHAR}, - - - number = #{number,jdbcType=INTEGER}, - - - price = #{price,jdbcType=DECIMAL}, - - - total_price = #{totalPrice,jdbcType=DECIMAL}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - pid = #{pid,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_workorder_consume - set goods_id = #{goodsId,jdbcType=VARCHAR}, - repair_item_number = #{repairItemNumber,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - library_number = #{libraryNumber,jdbcType=INTEGER}, - library_price = #{libraryPrice,jdbcType=DECIMAL}, - library_total_price = #{libraryTotalPrice,jdbcType=DECIMAL}, - stock_type = #{stockType,jdbcType=VARCHAR}, - number = #{number,jdbcType=INTEGER}, - price = #{price,jdbcType=DECIMAL}, - total_price = #{totalPrice,jdbcType=DECIMAL}, - memo = #{memo,jdbcType=VARCHAR}, - pid = #{pid,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - - - - delete from tb_workorder_consume - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/WorkorderDetailMapper.xml b/src/com/sipai/mapper/workorder/WorkorderDetailMapper.xml deleted file mode 100644 index 06a30fed..00000000 --- a/src/com/sipai/mapper/workorder/WorkorderDetailMapper.xml +++ /dev/null @@ -1,458 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - , insdt, insuser, unit_id, job_number, job_name, type, repair_plan_type, repair_type, receive_user_id, - receive_user_ids, equipment_id,equipment_id2, plan_date, complete_date, cycle, processId, processDefId, - outsource, fault_description, scheme_resume, achievements_hour, status, is_compete, compete_team_ids,abnormity_id,repair_date,save_type, compete_date, equ_plan_id, abnormity_date - - - - delete - from tb_workorder_detail - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_workorder_detail (id, insdt, insuser, - unit_id, job_number, job_name, - type, repair_plan_type, repair_type, receive_user_id, - receive_user_ids, equipment_id, equipment_id2, plan_date, - complete_date, cycle, processId, - processDefId, outsource, fault_description, - scheme_resume, achievements_hour, status, is_compete, compete_team_ids, - abnormity_id, repair_date, save_type, compete_date, equ_plan_id, abnormity_date) - values (#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, - #{unitId,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{jobName,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{repairPlanType,jdbcType=VARCHAR}, #{repairType,jdbcType=VARCHAR}, - #{receiveUserId,jdbcType=VARCHAR}, - #{receiveUserIds,jdbcType=VARCHAR}, #{equipmentId,jdbcType=VARCHAR}, #{equipmentId2,jdbcType=VARCHAR}, - #{planDate,jdbcType=TIMESTAMP}, - #{completeDate,jdbcType=TIMESTAMP}, #{cycle,jdbcType=VARCHAR}, #{processid,jdbcType=VARCHAR}, - #{processdefid,jdbcType=VARCHAR}, #{outsource,jdbcType=VARCHAR}, #{faultDescription,jdbcType=VARCHAR}, - #{schemeResume,jdbcType=VARCHAR}, #{achievementsHour,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, - #{isCompete,jdbcType=VARCHAR}, #{competeTeamIds,jdbcType=VARCHAR}, #{abnormityId,jdbcType=VARCHAR}, - #{repairDate,jdbcType=VARCHAR}, #{saveType,jdbcType=TINYINT}, #{competeDate,jdbcType=TIMESTAMP}, #{equPlanId,jdbcType=VARCHAR}, - #{abnormityDate,jdbcType=TIMESTAMP}) - - - insert into tb_workorder_detail - - - id, - - - insdt, - - - insuser, - - - unit_id, - - - job_number, - - - job_name, - - - type, - - - repair_plan_type, - - - repair_type, - - - receive_user_id, - - - receive_user_ids, - - - equipment_id, - - - equipment_id2, - - - plan_date, - - - complete_date, - - - cycle, - - - processId, - - - processDefId, - - - outsource, - - - fault_description, - - - scheme_resume, - - - achievements_hour, - - - status, - - - is_compete, - - - compete_team_ids, - - - abnormity_id, - - - repair_date, - - - save_type, - - - compete_date, - - - equ_plan_id, - - - abnormity_date, - - - - - #{id,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{jobNumber,jdbcType=VARCHAR}, - - - #{jobName,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{repairPlanType,jdbcType=VARCHAR}, - - - #{repairType,jdbcType=VARCHAR}, - - - #{receiveUserId,jdbcType=VARCHAR}, - - - #{receiveUserIds,jdbcType=VARCHAR}, - - - #{equipmentId,jdbcType=VARCHAR}, - - - #{equipmentId2,jdbcType=VARCHAR}, - - - #{planDate,jdbcType=TIMESTAMP}, - - - #{completeDate,jdbcType=TIMESTAMP}, - - - #{cycle,jdbcType=VARCHAR}, - - - #{processid,jdbcType=VARCHAR}, - - - #{processdefid,jdbcType=VARCHAR}, - - - #{outsource,jdbcType=VARCHAR}, - - - #{faultDescription,jdbcType=VARCHAR}, - - - #{schemeResume,jdbcType=VARCHAR}, - - - #{achievementsHour,jdbcType=DECIMAL}, - - - #{status,jdbcType=VARCHAR}, - - - #{isCompete,jdbcType=VARCHAR}, - - - #{competeTeamIds,jdbcType=VARCHAR}, - - - #{abnormityId,jdbcType=VARCHAR}, - - - #{repairDate,jdbcType=VARCHAR}, - - - #{saveType,jdbcType=TINYINT}, - - - #{compete_date,jdbcType=TIMESTAMP}, - - - #{equPlanId,jdbcType=VARCHAR}, - - - #{abnormityDate,jdbcType=TIMESTAMP}, - - - - - update tb_workorder_detail - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - job_number = #{jobNumber,jdbcType=VARCHAR}, - - - job_name = #{jobName,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=VARCHAR}, - - - repair_plan_type = #{repairPlanType,jdbcType=VARCHAR}, - - - repair_type = #{repairType,jdbcType=VARCHAR}, - - - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - - - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - - - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - - - equipment_id2 = #{equipmentId2,jdbcType=VARCHAR}, - - - plan_date = #{planDate,jdbcType=TIMESTAMP}, - - - complete_date = #{completeDate,jdbcType=TIMESTAMP}, - - - cycle = #{cycle,jdbcType=VARCHAR}, - - - processId = #{processid,jdbcType=VARCHAR}, - - - processDefId = #{processdefid,jdbcType=VARCHAR}, - - - outsource = #{outsource,jdbcType=VARCHAR}, - - - fault_description = #{faultDescription,jdbcType=VARCHAR}, - - - scheme_resume = #{schemeResume,jdbcType=VARCHAR}, - - - achievements_hour = #{achievementsHour,jdbcType=DECIMAL}, - - - status = #{status,jdbcType=VARCHAR}, - - - is_compete = #{isCompete,jdbcType=VARCHAR}, - - - compete_team_ids = #{competeTeamIds,jdbcType=VARCHAR}, - - - abnormity_id = #{abnormityId,jdbcType=VARCHAR}, - - - repair_date = #{repairDate,jdbcType=VARCHAR}, - - - save_type = #{saveType,jdbcType=TINYINT}, - - - compete_date = #{competeDate,jdbcType=TIMESTAMP}, - - - equ_plan_id = #{equPlanId,jdbcType=VARCHAR}, - - - abnormity_date = #{abnormityDate,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_workorder_detail - set insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - job_number = #{jobNumber,jdbcType=VARCHAR}, - job_name = #{jobName,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - repair_plan_type = #{repairPlanType,jdbcType=VARCHAR}, - repair_type = #{repairType,jdbcType=VARCHAR}, - receive_user_id = #{receiveUserId,jdbcType=VARCHAR}, - receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR}, - equipment_id = #{equipmentId,jdbcType=VARCHAR}, - equipment_id2 = #{equipmentId2,jdbcType=VARCHAR}, - plan_date = #{planDate,jdbcType=TIMESTAMP}, - complete_date = #{completeDate,jdbcType=TIMESTAMP}, - cycle = #{cycle,jdbcType=VARCHAR}, - processId = #{processid,jdbcType=VARCHAR}, - processDefId = #{processdefid,jdbcType=VARCHAR}, - outsource = #{outsource,jdbcType=VARCHAR}, - fault_description = #{faultDescription,jdbcType=VARCHAR}, - scheme_resume = #{schemeResume,jdbcType=VARCHAR}, - achievements_hour = #{achievementsHour,jdbcType=DECIMAL}, - status = #{status,jdbcType=VARCHAR}, - is_compete = #{isCompete,jdbcType=VARCHAR}, - compete_team_ids = #{competeTeamIds,jdbcType=VARCHAR}, - abnormity_id = #{abnormityId,jdbcType=VARCHAR}, - repair_date = #{repairDate,jdbcType=VARCHAR}, - save_type = #{saveType,jdbcType=TINYINT} - compete_date = #{competeDate,jdbcType=TIMESTAMP}, - equ_plan_id = #{equPlanId,jdbcType=TIMESTAMP}, - abnormity_date = #{abnormityDate,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - - delete - from tb_workorder_detail ${where} - - - - - - - - - - - \ No newline at end of file diff --git a/src/com/sipai/mapper/workorder/WorkorderRepairContentMapper.xml b/src/com/sipai/mapper/workorder/WorkorderRepairContentMapper.xml deleted file mode 100644 index bf6bc214..00000000 --- a/src/com/sipai/mapper/workorder/WorkorderRepairContentMapper.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id, detail_id, repair_content_id, repair_name, self_quota_hour, self_actual_hour, outsource_quota_fee, - outsource_actual_fee, memo, unit_id, insdt, insuser, upsuser, upsdt - - - - delete from tb_workorder_repair_content - where id = #{id,jdbcType=VARCHAR} - - - insert into tb_workorder_repair_content (id, detail_id, repair_content_id, repair_name, - self_quota_hour, self_actual_hour, outsource_quota_fee, - outsource_actual_fee, memo, unit_id, - insdt, insuser, upsuser, - upsdt) - values (#{id,jdbcType=VARCHAR}, #{detailId,jdbcType=VARCHAR}, #{repairContentId,jdbcType=VARCHAR}, #{repairName,jdbcType=VARCHAR}, - #{selfQuotaHour,jdbcType=DECIMAL}, #{selfActualHour,jdbcType=DECIMAL}, #{outsourceQuotaFee,jdbcType=DECIMAL}, - #{outsourceActualFee,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, #{unitId,jdbcType=VARCHAR}, - #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upsuser,jdbcType=VARCHAR}, - #{upsdt,jdbcType=TIMESTAMP}) - - - insert into tb_workorder_repair_content - - - id, - - - detail_id, - - - repair_content_id, - - - repair_name, - - - self_quota_hour, - - - self_actual_hour, - - - outsource_quota_fee, - - - outsource_actual_fee, - - - memo, - - - unit_id, - - - insdt, - - - insuser, - - - upsuser, - - - upsdt, - - - - - #{id,jdbcType=VARCHAR}, - - - #{detailId,jdbcType=VARCHAR}, - - - #{repairContentId,jdbcType=VARCHAR}, - - - #{repairName,jdbcType=VARCHAR}, - - - #{selfQuotaHour,jdbcType=DECIMAL}, - - - #{selfActualHour,jdbcType=DECIMAL}, - - - #{outsourceQuotaFee,jdbcType=DECIMAL}, - - - #{outsourceActualFee,jdbcType=DECIMAL}, - - - #{memo,jdbcType=VARCHAR}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{insdt,jdbcType=TIMESTAMP}, - - - #{insuser,jdbcType=VARCHAR}, - - - #{upsuser,jdbcType=VARCHAR}, - - - #{upsdt,jdbcType=TIMESTAMP}, - - - - - update tb_workorder_repair_content - - - detail_id = #{detailId,jdbcType=VARCHAR}, - - - repair_content_id = #{repairContentId,jdbcType=VARCHAR}, - - - repair_name = #{repairName,jdbcType=VARCHAR}, - - - self_quota_hour = #{selfQuotaHour,jdbcType=DECIMAL}, - - - self_actual_hour = #{selfActualHour,jdbcType=DECIMAL}, - - - outsource_quota_fee = #{outsourceQuotaFee,jdbcType=DECIMAL}, - - - outsource_actual_fee = #{outsourceActualFee,jdbcType=DECIMAL}, - - - memo = #{memo,jdbcType=VARCHAR}, - - - unit_id = #{unitId,jdbcType=VARCHAR}, - - - insdt = #{insdt,jdbcType=TIMESTAMP}, - - - insuser = #{insuser,jdbcType=VARCHAR}, - - - upsuser = #{upsuser,jdbcType=VARCHAR}, - - - upsdt = #{upsdt,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update tb_workorder_repair_content - set detail_id = #{detailId,jdbcType=VARCHAR}, - repair_content_id = #{repairContentId,jdbcType=VARCHAR}, - repair_name = #{repairName,jdbcType=VARCHAR}, - self_quota_hour = #{selfQuotaHour,jdbcType=DECIMAL}, - self_actual_hour = #{selfActualHour,jdbcType=DECIMAL}, - outsource_quota_fee = #{outsourceQuotaFee,jdbcType=DECIMAL}, - outsource_actual_fee = #{outsourceActualFee,jdbcType=DECIMAL}, - memo = #{memo,jdbcType=VARCHAR}, - unit_id = #{unitId,jdbcType=VARCHAR}, - insdt = #{insdt,jdbcType=TIMESTAMP}, - insuser = #{insuser,jdbcType=VARCHAR}, - upsuser = #{upsuser,jdbcType=VARCHAR}, - upsdt = #{upsdt,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - - - - - delete from tb_workorder_repair_content - ${where} - - \ No newline at end of file diff --git a/src/com/sipai/netty/NettyClient.java b/src/com/sipai/netty/NettyClient.java deleted file mode 100644 index 27c10c8c..00000000 --- a/src/com/sipai/netty/NettyClient.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.sipai.netty; - -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioSocketChannel; - -public class NettyClient extends Thread { - private int port; - private String host = "183.24.103.146";//现场外网 - //private String host = "116.236.176.248";//公司外网 - //private String host = "132.120.132.74";//公司内网 - - private Channel channel; - - public NettyClient(int port){ - this.port = port; - } - - /** - * 客户端运行方法 - * @throws InterruptedException - */ - public void run() { - /** - * 负责装客户端的事件处理线程池 - */ - EventLoopGroup clientWorker = new NioEventLoopGroup(); - try { - /** - * netty客户端引导启动器 - */ - Bootstrap bootstrap = new Bootstrap(); - bootstrap - .group(clientWorker)//把事件处理线程池添加进启动引导器 - .channel(NioSocketChannel.class)//设置通道的建立方式,这里采用Nio的通道方式来建立请求连接 - //.option(ChannelOption.SO_KEEPALIVE, true) - .handler(new ChannelInitializer() { - @Override - protected void initChannel(SocketChannel socketChannel) throws Exception { - /** - * 此处添加客户端的通道处理器 - */ - socketChannel.pipeline().addLast(new NettyClientHandler()); - } - }); - /** - * 客户端绑定端口并且开始发起连接请求 - */ - ChannelFuture future = null; - try { - future = bootstrap.connect(host, port).sync(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (future.isSuccess()){ - System.out.println("客户端连接服务器成功!"); - } - /** - * 将通道设置好, 以便外面获取 - */ - this.channel = future.channel(); - /** - * 关闭客户端 - */ - try { - future.channel().closeFuture().sync(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.out.println("客户端即将关闭!"); - } finally { - /** - * 关闭事件处理组 - */ - clientWorker.shutdownGracefully(); - System.out.println("客户端已关闭!"); - } - } - - public Channel getChannel(){ - return this.channel; - } -} diff --git a/src/com/sipai/netty/NettyClientHandler.java b/src/com/sipai/netty/NettyClientHandler.java deleted file mode 100644 index f71afbcf..00000000 --- a/src/com/sipai/netty/NettyClientHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.netty; - -import java.nio.charset.Charset; -import java.util.Date; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; - -public class NettyClientHandler extends ChannelInboundHandlerAdapter { - /** - * 通道信息读取处理 - * @param ctx - * @param msg - */ - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) { - ByteBuf m = (ByteBuf) msg; // 将消息转化成bytebuf - try { - System.out.println("客户端直接打印接收到的消息: " + m.toString(Charset.defaultCharset())); - long currentTimeMillis = (m.readUnsignedInt() - 2208988800L) * 1000L; - System.out.println(new Date(currentTimeMillis)); - /** - * 给服务端回复消息 - */ - ctx.writeAndFlush("客户端收到! 消息为: " + m.toString(Charset.defaultCharset())); - } finally { - m.release(); - } - } - - /** - * 连接成功后,自动执行该方法 - * @param ctx - * @throws Exception - */ - @Override - public void channelActive(ChannelHandlerContext ctx) throws Exception { - /** - * 往服务端发送消息 - * 消息格式必须是ByteBuf才行!!!!! - * 如果是其他格式服务端是接收不到的!!!! - */ - String helo = "你好呀!"; - ByteBuf byteBuf = Unpooled.wrappedBuffer(helo.getBytes()); - ctx.channel().writeAndFlush(byteBuf); - System.out.println("首次连接完成!"); - } - - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { - cause.printStackTrace(); - ctx.close(); - } -} diff --git a/src/com/sipai/netty/NettyClientLoader.java b/src/com/sipai/netty/NettyClientLoader.java deleted file mode 100644 index 47680fde..00000000 --- a/src/com/sipai/netty/NettyClientLoader.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.netty; - -import java.util.Scanner; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.springframework.web.context.ContextLoader; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.Channel; - -/** - * 将socket service随tomcat启动 - * - * @author huajian - */ -public class NettyClientLoader extends ContextLoader implements ServletContextListener { - - - @Override - public void contextDestroyed(ServletContextEvent arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void contextInitialized(ServletContextEvent arg0) { - // TODO Auto-generated method stub - /** - * 创建netty客户端 - */ - NettyClient client = new NettyClient(10000); - /** - * 新建一个线程让它单独去跑,我们可以main方法测试一下发送消息和接受消息 - */ - Thread clientThread = new Thread(new Runnable() { - @Override - public void run() { - client.run(); - } - }); - clientThread.start(); - /** - * 如果不新建一个线程去跑客户端的话, 以下的代码就执行不到 - * 这里用while是因为客户端的channel并不能立马生成, 会在client启动后一段时间才生成获取到 - * 所以需要延迟一点获取channel, 否则channel为null - */ - Channel channel = null; - boolean isStart = false; - while (!isStart) { - if (null != client.getChannel()) { - channel = client.getChannel(); - isStart = true; - } - } - String helo = "你好呀!我这里是客户端, 收到请回答"; - ByteBuf byteBuf = Unpooled.wrappedBuffer(helo.getBytes()); - channel.writeAndFlush(byteBuf); - /** - * 我们通过控制台输入来给服务端发送消息 - * 此处只做模拟使用 - */ - for (int i = 0; i < 10 ; i++) { - Scanner scanner = new Scanner(System.in); - String text = scanner.nextLine(); - channel.writeAndFlush(Unpooled.wrappedBuffer(text.getBytes())); - } - } -} diff --git a/src/com/sipai/netty/NettyServer.java b/src/com/sipai/netty/NettyServer.java deleted file mode 100644 index 03b76ced..00000000 --- a/src/com/sipai/netty/NettyServer.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.netty; - -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioServerSocketChannel; - -public class NettyServer extends Thread { - /** - * 端口 - */ - private static final int port = 10000; - //分配用于处理业务的线程组数量 - protected static final int BisGroupSize = Runtime.getRuntime().availableProcessors() * 2; - //每个线程组中线程的数量 - protected static final int worGroupSize = 4; - - /** - * Netty 负责装领导的事件处理线程池 - */ - private static final EventLoopGroup bossGroup = new NioEventLoopGroup(BisGroupSize); - /** - * Netty 负责装码农的事件处理线程池 - */ - private static final EventLoopGroup workerGroup = new NioEventLoopGroup(worGroupSize); - - public void run(){ - try { - /** - * Netty服务端启动引导器 - */ - ServerBootstrap server = new ServerBootstrap(); - - server - .group(bossGroup, workerGroup)//把事件处理线程池添加进启动引导器 - .channel(NioServerSocketChannel.class)//设置通道的建立方式,这里采用Nio的通道方式来建立请求连接 - .childHandler(new ChannelInitializer() { - //构造一个由通道处理器构成的通道管道流水线 - @Override - protected void initChannel(SocketChannel socketChannel) throws Exception { - /** - * 此处添加Netty服务端的通道处理器 - */ - socketChannel.pipeline().addLast(new NettyServerHandler()); - } - }) - /** - * 用来配置一些channel的参数,配置的参数会被ChannelConfig使用 - * BACKLOG用于构造Netty服务端套接字ServerSocket对象, - * 标识当服务器请求处理线程全满时, - * 用于临时存放已完成三次握手的请求的队列的最大长度。 - * 如果未设置或所设置的值小于1,Java将使用默认值50 - */ - .option(ChannelOption.SO_BACKLOG, 128) - /** - * 是否启用心跳保活机制。在双方TCP套接字建立连接后(即都进入ESTABLISHED状态) - * 并且在两个小时左右上层没有任何数据传输的情况下,这套机制才会被激活。 - */ - .childOption(ChannelOption.SO_KEEPALIVE, true); - /** - * Netty服务端绑定端口并且开始接收进来的连接请求 - */ - ChannelFuture channelFuture = null; - try { - channelFuture = server.bind(port).sync(); - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - /** - * 查看一下操作是不是成功结束了 - */ - if (channelFuture.isSuccess()){ - //如果没有成功结束就处理一些事情,结束了就执行关闭Netty服务端等操作 - System.out.println("Netty服务端启动成功!"); - } - /** - * 关闭Netty服务端 - */ - /*try { - channelFuture.channel().closeFuture().sync(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.out.println("Netty服务端即将关闭!");*/ - } finally { - /** - * 关闭事件处理组 - */ - /*bossGroup.shutdownGracefully(); - workerGroup.shutdownGracefully(); - System.out.println("Netty服务端已关闭!");*/ - } - - } - public void shutdown() { - bossGroup.shutdownGracefully(); - workerGroup.shutdownGracefully(); - } -} diff --git a/src/com/sipai/netty/NettyServerHandler.java b/src/com/sipai/netty/NettyServerHandler.java deleted file mode 100644 index 7c342cc4..00000000 --- a/src/com/sipai/netty/NettyServerHandler.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.netty; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map.Entry; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.ElectricityMeter; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.ElectricityMeterService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.CharsetUtil; - -public class NettyServerHandler extends ChannelInboundHandlerAdapter { - - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { - ByteBuf buf = (ByteBuf) msg; - //String jsonStr = JSONObject.toJSONString(buf); - System.out.println("Netty服务端接收信息(" +CommUtil.nowDate()+"):"+ buf.toString(CharsetUtil.UTF_8)); - JSONObject jsonObject = null; - try { - //当数据不是json格式时,捕获异常,设为空 - jsonObject = JSONObject.parseObject(buf.toString(CharsetUtil.UTF_8)); - } catch (Exception e) { - jsonObject = null; - } - if(null != jsonObject){ - ElectricityMeterService electricityMeterService = (ElectricityMeterService) SpringContextUtil.getBean("electricityMeterService"); - //获取电表ID - String ID = (String) jsonObject.get("ID"); - ElectricityMeter electricityMeter = electricityMeterService.selectById(ID); - if(electricityMeter!=null){ - String bizId = electricityMeter.getBizid(); - if(null != bizId && !"".equals(bizId)){ - MPoint mPointEntity = null; - MPointHistory mPointHistory = null; - BigDecimal parmvalue = new BigDecimal("0"); - String measuredt = ""; - int num = 0; - int numHistory = 0; - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - String prefix = ""; - String suffix = ""; - if(electricityMeter.getPrefix()!=null && !"".equals(electricityMeter.getPrefix())){ - prefix = electricityMeter.getPrefix()+"_"; - } - if(electricityMeter.getSuffix()!=null && !"".equals(electricityMeter.getSuffix())){ - suffix = "_"+electricityMeter.getSuffix(); - } - for (Entry entry : jsonObject.entrySet()) { - if(!"ID".equals(entry.getKey())){ - if(isNumber(entry.getValue().toString())){ - //点位: 前缀_key_后缀 - mPointEntity = mPointService.selectById(bizId, prefix+entry.getKey()+suffix); - if(mPointEntity!=null){ - parmvalue = new BigDecimal(entry.getValue().toString()); - measuredt = CommUtil.nowDate(); - mPointEntity.setParmvalue(parmvalue); - mPointEntity.setMeasuredt(measuredt); - int res = mPointService.update(bizId, mPointEntity); - if(res>0){ - num++; - mPointHistory=new MPointHistory(); - mPointHistory.setParmvalue(parmvalue); - mPointHistory.setMeasuredt(measuredt); - mPointHistory.setTbName("TB_MP_"+mPointEntity.getMpointcode()); - res = mPointHistoryService.save(bizId, mPointHistory); - if(res>0){ - numHistory++; - } - } - } - } - } - } - System.out.println("Netty服务端处理信息(" +CommUtil.nowDate()+"):成功更新主表"+ num+"条数据,成功更新子表"+ numHistory+"个;"); - } - } - } - ByteBuf res = Unpooled.wrappedBuffer(new String("收到!信息如下, 请确认:" + buf.toString(CharsetUtil.UTF_8)).getBytes()); - /** - * 给客户端回复消息 - */ - ctx.writeAndFlush(res); - } - - /** - * 连接成功后,自动执行该方法 - * @param ctx - * @throws Exception - */ - @Override - public void channelActive(ChannelHandlerContext ctx) throws Exception { - System.out.println("服务器首次处理!"); - ByteBuf res = Unpooled.wrappedBuffer(new String("true").getBytes()); - ctx.writeAndFlush(res); - } - - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - super.exceptionCaught(ctx, cause); - /** - * 异常捕获 - */ - cause.printStackTrace(); - ctx.close(); - } - public static boolean isNumber(String str){ - String reg = "^[0-9]+(.[0-9]+)?$"; - return str.matches(reg); - } -} diff --git a/src/com/sipai/netty/NettyServerLoader.java b/src/com/sipai/netty/NettyServerLoader.java deleted file mode 100644 index 66a6b8bf..00000000 --- a/src/com/sipai/netty/NettyServerLoader.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.netty; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.springframework.web.context.ContextLoader; - -/** - * 将socket service随tomcat启动 - * - * @author huajian - */ -public class NettyServerLoader extends ContextLoader implements ServletContextListener { - - private NettyServer nettyServer; - - @Override - public void contextDestroyed(ServletContextEvent arg0) { - if (null != nettyServer && !nettyServer.isInterrupted()) { - nettyServer.shutdown(); - nettyServer.interrupt(); - } - } - - @Override - public void contextInitialized(ServletContextEvent arg0) { - // TODO Auto-generated method stub - - if(null == nettyServer){ - nettyServer = new NettyServer(); - nettyServer.start(); - } - } -} diff --git a/src/com/sipai/quartz/job/AccessJob.java b/src/com/sipai/quartz/job/AccessJob.java deleted file mode 100644 index 6ba7492b..00000000 --- a/src/com/sipai/quartz/job/AccessJob.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.access.AccessAlarmHistory; -import com.sipai.entity.access.AccessAlarmSetting; -import com.sipai.entity.access.AccessEigenHistory; -import com.sipai.entity.access.AccessRealData; -import com.sipai.service.access.AccessAlarmHistoryService; -import com.sipai.service.access.AccessAlarmSettingService; -import com.sipai.service.access.AccessEigenHistoryService; -import com.sipai.service.access.AccessRealDataService; - -import javax.annotation.Resource; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -public class AccessJob { - // @Resource -// private static AccessAlarmHistoryService accessAlarmHistoryService; - @Resource - private AccessAlarmHistoryService accessAlarmHistoryService; - @Resource - private AccessAlarmSettingService accessAlarmSettingService; - @Resource - private AccessEigenHistoryService accessEigenHistoryService; - @Resource - private AccessRealDataService accessRealDataService; - - static String accessFile = "E:/数据库备份/数据库备份_北控/DB_ACCESS.MDB"; //本地的Access数据库地址 - - - public void excute() { - tblAlarmHistory(); - tblAlarmSetting(); - tblEigenHistory(); - tblRealData(); - } - - public void tblAlarmHistory() { - Connection conn = null; - String sql = "select * from tblAlarmHistory"; - ResultSet rs = null; - List list = new ArrayList(); - try { - conn = getConntection(); - rs = conn.createStatement().executeQuery(sql); - while (rs.next()) { - AccessAlarmHistory accessAlarmHistory = accessAlarmHistoryService.selectById(rs.getString("id").toString()); - if (accessAlarmHistory != null) { - //System.out.println("已存在"); - } else { - AccessAlarmHistory entity = new AccessAlarmHistory(); - entity.setId(rs.getString("id") + ""); - entity.setNpumpid(Integer.parseInt(rs.getString("nPumpID"))); - entity.setNsensorid(Integer.parseInt(rs.getString("nSensorID"))); - entity.setNevent(Integer.parseInt(rs.getString("nEvent"))); - entity.setStrevent(rs.getString("strEvent")); - entity.setFtemperature(Integer.parseInt(rs.getString("fTemperature"))); - entity.setFptpX(Float.parseFloat(rs.getString("fPTP_X"))); - entity.setFptpY(Float.parseFloat(rs.getString("fPTP_Y"))); - entity.setFptpZ(Float.parseFloat(rs.getString("fPTP_Z"))); - entity.setFrmsX(Float.parseFloat(rs.getString("fRMS_X"))); - entity.setFrmsY(Float.parseFloat(rs.getString("fRMS_Y"))); - entity.setFrmsZ(Float.parseFloat(rs.getString("fRMS_Z"))); - entity.setFpeakX(Float.parseFloat(rs.getString("fPeak_X"))); - entity.setFpeakY(Float.parseFloat(rs.getString("fPeak_Y"))); - entity.setFpeakZ(Float.parseFloat(rs.getString("fPeak_Z"))); - entity.setFvveX(Float.parseFloat(rs.getString("fVVE_X"))); - entity.setFvveY(Float.parseFloat(rs.getString("fVVE_Y"))); - entity.setFvveZ(Float.parseFloat(rs.getString("fVVE_Z"))); - entity.setTmvalue(rs.getString("tmValue").substring(0, 19)); - int res = accessAlarmHistoryService.save(entity); - } - } - } catch (SQLException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - public void tblAlarmSetting() { - Connection conn = null; - String sql = "select * from tblAlarmSetting"; - ResultSet rs = null; - List list = new ArrayList(); - try { - conn = getConntection(); - rs = conn.createStatement().executeQuery(sql); - while (rs.next()) { - AccessAlarmSetting accessAlarmSetting = accessAlarmSettingService.selectById(rs.getString("id")); - if (accessAlarmSetting != null) { - //System.out.println("已存在"); - } else { - AccessAlarmSetting entity = new AccessAlarmSetting(); - entity.setId(rs.getString("id")); - entity.setNpumpid(Integer.parseInt(rs.getString("nPumpID"))); - entity.setNsensorid(Integer.parseInt(rs.getString("nSensorID"))); - entity.setFtempalarmlo(Float.parseFloat(rs.getString("fTempAlarmLo"))); - entity.setFtempalarmhi(Float.parseFloat(rs.getString("fTempAlarmHi"))); - entity.setFptpalarmhi(Float.parseFloat(rs.getString("fPTPAlarmHi"))); - entity.setFrmsalarmhi(Float.parseFloat(rs.getString("fRMSAlarmHi"))); - entity.setFpeakalarmhi(Float.parseFloat(rs.getString("fPeakAlarmHi"))); - entity.setFvvealarmhi(Float.parseFloat(rs.getString("fVVEAlarmHi"))); - entity.setTmmodify(rs.getString("tmModify").substring(0, 19)); - int res = accessAlarmSettingService.save(entity); - } - } - } catch (SQLException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - public void tblEigenHistory() { - Connection conn = null; - String sql = "select * from tblEigenHistory"; - ResultSet rs = null; - List list = new ArrayList(); - try { - conn = getConntection(); - rs = conn.createStatement().executeQuery(sql); - while (rs.next()) { - AccessEigenHistory accessEigenHistory = accessEigenHistoryService.selectById(rs.getString("id")); - if (accessEigenHistory != null) { - //System.out.println("已存在"); - } else { - AccessEigenHistory entity = new AccessEigenHistory(); - entity.setId(rs.getString("id")); - entity.setNpumpid(Integer.parseInt(rs.getString("nPumpID"))); - entity.setNsensorid(Integer.parseInt(rs.getString("nSensorID"))); - entity.setFtemperature(Integer.parseInt(rs.getString("fTemperature"))); - entity.setFptpX(Float.parseFloat(rs.getString("fPTP_X"))); - entity.setFptpY(Float.parseFloat(rs.getString("fPTP_Y"))); - entity.setFptpZ(Float.parseFloat(rs.getString("fPTP_Z"))); - entity.setFrmsX(Float.parseFloat(rs.getString("fRMS_X"))); - entity.setFrmsY(Float.parseFloat(rs.getString("fRMS_Y"))); - entity.setFrmsZ(Float.parseFloat(rs.getString("fRMS_Z"))); - entity.setFpeakX(Float.parseFloat(rs.getString("fPeak_X"))); - entity.setFpeakY(Float.parseFloat(rs.getString("fPeak_Y"))); - entity.setFpeakZ(Float.parseFloat(rs.getString("fPeak_Z"))); - entity.setFvveX(Float.parseFloat(rs.getString("fVVE_X"))); - entity.setFvveY(Float.parseFloat(rs.getString("fVVE_Y"))); - entity.setFvveZ(Float.parseFloat(rs.getString("fVVE_Z"))); - entity.setTmvalue(rs.getString("tmValue").substring(0, 19)); - int res = accessEigenHistoryService.save(entity); - } - } - } catch (SQLException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - public void tblRealData() { - Connection conn = null; - String sql = "select * from tblRealData"; - ResultSet rs = null; - List list = new ArrayList(); - try { - conn = getConntection(); - rs = conn.createStatement().executeQuery(sql); - while (rs.next()) { - AccessRealData entity = new AccessRealData(); - entity.setNpumpid(Integer.parseInt(rs.getString("nPumpID"))); - entity.setNsensorid(Integer.parseInt(rs.getString("nSensorID"))); - entity.setFtemperature(Integer.parseInt(rs.getString("fTemperature"))); - entity.setFptpX(Float.parseFloat(rs.getString("fPTP_X"))); - entity.setFptpY(Float.parseFloat(rs.getString("fPTP_Y"))); - entity.setFptpZ(Float.parseFloat(rs.getString("fPTP_Z"))); - entity.setFrmsX(Float.parseFloat(rs.getString("fRMS_X"))); - entity.setFrmsY(Float.parseFloat(rs.getString("fRMS_Y"))); - entity.setFrmsZ(Float.parseFloat(rs.getString("fRMS_Z"))); - entity.setFpeakX(Float.parseFloat(rs.getString("fPeak_X"))); - entity.setFpeakY(Float.parseFloat(rs.getString("fPeak_Y"))); - entity.setFpeakZ(Float.parseFloat(rs.getString("fPeak_Z"))); - entity.setFvveX(Float.parseFloat(rs.getString("fVVE_X"))); - entity.setFvveY(Float.parseFloat(rs.getString("fVVE_Y"))); - entity.setFvveZ(Float.parseFloat(rs.getString("fVVE_Z"))); - entity.setTmvalue(rs.getString("tmValue").substring(0, 19)); - int res = accessRealDataService.save(entity); - } - } catch (SQLException | ClassNotFoundException e) { - e.printStackTrace(); - } - } - - public static Connection getConntection() throws SQLException, ClassNotFoundException { - Properties prop = new Properties(); - Class.forName("net.ucanaccess.jdbc.UcanaccessDriver"); - prop.put("charSet", "gb2312"); //防止乱码 - return DriverManager.getConnection("jdbc:ucanaccess://" + accessFile, prop); - } -} diff --git a/src/com/sipai/quartz/job/AlarmJob.java b/src/com/sipai/quartz/job/AlarmJob.java deleted file mode 100644 index d70b86e6..00000000 --- a/src/com/sipai/quartz/job/AlarmJob.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.sipai.quartz.job; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.alarm.AlarmCondition; -import com.sipai.entity.alarm.AlarmRecord; -import com.sipai.entity.alarm.AlarmType; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.alarm.AlarmConditionService; -import com.sipai.service.alarm.AlarmRecordService; -import com.sipai.service.alarm.AlarmSolutionService; -import com.sipai.service.alarm.AlarmTypeService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -public class AlarmJob { - @Resource - private AlarmTypeService alarmTypeService; - @Resource - private AlarmConditionService alarmConditionService; - @Resource - private AlarmSolutionService alarmSolutionService; - @Resource - private AlarmRecordService alarmRecordService; - @Resource - private MPointService mPointService; - - public void excute(){ - List list = alarmTypeService.selectListByWhere("where pid != '-1' " - + " and pid is not null and state = 1 "); - if(list != null && list.size()>0){ - for(int i=0;i alarmConditions = alarmConditionService. - selectListByWhere("where alarmtypeid ='"+list.get(i).getId() - +"' order by id"); - boolean alarm = false; - if(alarmConditions != null && alarmConditions.size()>0){ - for(int j=0;j alarmCondition.getVal()){ - f = true; - } - break; - case "-1": - if(d < alarmCondition.getVal()){ - f = true; - } - break; - case "0": - if(d == alarmCondition.getVal()){ - f = true; - } - break; - case "2": - if(d >= alarmCondition.getLowerlimit() && d = alarmCondition.getUpperlimit()){ - f = true; - } - break; - - default: - break; - } - if(f){ - AlarmRecord alarmRecord = new AlarmRecord(); - alarmRecord.setId(CommUtil.getUUID()); - alarmRecord.setAlarmtypeid(list.get(i).getId()); - alarmRecord.setInsdt(CommUtil.nowDate()); - alarmRecord.setState("0"); - List alarmRecords = alarmRecordService.selectListByWhere - ("where alarmtypeid = '"+list.get(i).getId()+"' order by insdt desc"); - if(alarmRecords != null && alarmRecords.size()>0){ - if("1".equals(alarmRecords.get(0).getState())){ - alarmRecordService.save(alarmRecord); - } - } - } - } - } - } - } - } -} diff --git a/src/com/sipai/quartz/job/BIMDataJob.java b/src/com/sipai/quartz/job/BIMDataJob.java deleted file mode 100644 index 82e9df88..00000000 --- a/src/com/sipai/quartz/job/BIMDataJob.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.process.DataPatrol; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.process.DataPatrolService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.MsgWebSocket2; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.beans.factory.annotation.Autowired; - -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * websocket推送数据给三维(通用接口) - * sj 2023-04-26 - */ -public class BIMDataJob { - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - CompanyService companyService = (CompanyService) SpringContextUtil.getBean("companyService"); - DataPatrolService dataPatrolService = (DataPatrolService) SpringContextUtil.getBean("dataPatrolService"); - RedissonClient redissonClient = (RedissonClient) SpringContextUtil.getBean("redissonClient"); - - /** - * 实时数据接口 (在定时器模块修改推送的频率,仅推送订阅的数据) - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { -// System.out.println("推送BIM实时数据定时器 ====== " + CommUtil.nowDate()); - - String ids = ""; - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMMpoint); - if (map_list != null && map_list.size() > 0) { - Map all = map_list.getAll(map_list.keySet()); - if (all != null && all.size() > 0) { - Iterator> entries = all.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = entries.next(); - //解析并推送实时数据 - List list = entry.getValue(); - for (String s : list) { - ids += "'" + s + "',"; - } - } - } - } - - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - if (list_company != null && list_company.size() > 0) { - List list = mPointService.selectListByWhere(list_company.get(0).getId(), "where 1=1 and id in (" + ids + ")"); - JSONArray jsonArray = new JSONArray(); - for (MPoint mPoint : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", mPoint.getId()); - jsonObject.put("mpointId", mPoint.getMpointid()); - jsonObject.put("mpointCode", mPoint.getMpointcode()); - jsonObject.put("mpointName", mPoint.getParmname()); - if (mPoint.getNumtail() != null && !mPoint.getNumtail().equals("")) { - jsonObject.put("numtail", mPoint.getNumtail()); - } else { - jsonObject.put("numtail", ""); - } - if (mPoint.getParmvalue() != null && !mPoint.getParmvalue().equals("")) { -// CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()) -// jsonObject.put("paramValue", mPoint.getParmvalue()); - jsonObject.put("paramValue", CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate())); - } else { - jsonObject.put("paramValue", 0); - } - if (mPoint.getUnit() != null && !mPoint.getUnit().equals("")) { - jsonObject.put("unit", mPoint.getUnit()); - } else { - jsonObject.put("unit", ""); - } - jsonObject.put("type", "-"); - jsonArray.add(jsonObject); - } - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dataType", CommString.WebsocketBIMTypeReal); - jsonObject.put("data", jsonArray); - - if (jsonArray != null && jsonArray.size() > 0) { -// MsgWebSocket2 msg = new MsgWebSocket2(); -// msg.onMessageData(jsonObject.toString(), null); - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(jsonObject.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } - } - } - - /** - * 数据巡视 推送 - * - * @param scheduleJob - */ - public void fun2(ScheduleJob scheduleJob) { -// System.out.println("推送BIM数据巡视定时器======" + CommUtil.nowDate()); - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - if (list_company != null && list_company.size() > 0) { - List dataPatrolList = dataPatrolService.selectListByWhere("where unit_id = '" + list_company.get(0).getId() + "'"); - if (dataPatrolList != null && dataPatrolList.size() > 0) { - String mpids = ""; - for (int i = 0; i < dataPatrolList.size(); i++) { - mpids += dataPatrolList.get(i).getMpid() + ","; - } - String json = this.dataPatrolService.getDataPatrolSt(mpids, list_company.get(0).getId()); - - JSONArray array = JSON.parseArray(json); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dataType", CommString.WebsocketBIMTypePatrol); - jsonObject.put("data", array); - - if (json != null && !json.equals("")) { -// MsgWebSocket2 msg = new MsgWebSocket2(); -// msg.onMessageData(jsonObject.toString(), null); - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(jsonObject.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - } - } - } - -} diff --git a/src/com/sipai/quartz/job/BIMDataJob_Equ.java b/src/com/sipai/quartz/job/BIMDataJob_Equ.java deleted file mode 100644 index 616f42a0..00000000 --- a/src/com/sipai/quartz/job/BIMDataJob_Equ.java +++ /dev/null @@ -1,516 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.MsgWebSocket2; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -/** - * websocket推送数据给三维(南市定制接口) - * sj 2023-04-26 - */ -public class BIMDataJob_Equ { - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - CompanyService companyService = (CompanyService) SpringContextUtil.getBean("companyService"); - RedissonClient redissonClient = (RedissonClient) SpringContextUtil.getBean("redissonClient"); - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - - - /** - * 设备实时数据接口 (在定时器模块修改推送的频率,仅推送订阅的数据) - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { - System.out.println("推送BIM单个设备实时数据======" + CommUtil.nowDate()); - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMEquMpoint); - if (map_list != null && map_list.size() > 0) { - String equipmentCardId = map_list.get("BIM"); - //查厂Id - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - - //三维老版本(和三维新版本仅保留一个) - if (list_company != null && list_company.size() > 0) { - //查BIM订阅的设备 - List list_equ = equipmentCardService.selectSimpleListByWhere("where equipmentCardID = '" + equipmentCardId + "'"); - if (list_equ != null && list_equ.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("equipmentId", equipmentCardId); - jsonObject.put("equipmentName", list_equ.get(0).getEquipmentname()); - - JSONArray jsonArray_group = new JSONArray(); - - //查该设备下关联的点位 - List list = mPointService.selectListByWhere(list_company.get(0).getId(), "where equipmentId = '" + list_equ.get(0).getId() + "'"); - if (list != null && list.size() > 0) { - JSONArray jsonArray_1 = new JSONArray(); - JSONArray jsonArray_2 = new JSONArray(); - JSONArray jsonArray_3 = new JSONArray(); - JSONArray jsonArray_4 = new JSONArray(); - JSONArray jsonArray_5 = new JSONArray(); - - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject_mp = new JSONObject(); - jsonObject_mp.put("mpointId", list.get(i).getId()); - jsonObject_mp.put("mpointCode", list.get(i).getMpointcode()); - if (list.get(i).getDisname() != null && !list.get(i).getDisname().equals("")) { - jsonObject_mp.put("mpointName", list.get(i).getDisname()); - } else { - jsonObject_mp.put("mpointName", list.get(i).getParmname()); - } - if (list.get(i).getUnit() != null) { - jsonObject_mp.put("unit", list.get(i).getUnit()); - } else { - jsonObject_mp.put("unit", ""); - } - if (list.get(i).getMeasuredt() != null) { - jsonObject_mp.put("measureDt", list.get(i).getMeasuredt()); - } else { - jsonObject_mp.put("measureDt", ""); - } - - BigDecimal parmValue = CommUtil.formatMPointValue(list.get(i).getParmvalue(), list.get(i).getNumtail(), list.get(i).getRate()); - jsonObject_mp.put("paramValue", parmValue + ""); - - //运行时间 - if (list.get(i).getParmname().contains("累计运行时间") || list.get(i).getParmname().contains("单次运行时间")) { - jsonArray_1.add(jsonObject_mp); - } - //运行信号 - else if (list.get(i).getParmname().contains("运行") || list.get(i).getParmname().contains("停止") - || list.get(i).getParmname().contains("故障") || list.get(i).getParmname().contains("过电流故障") - || list.get(i).getParmname().contains("过载故障")) { - if (list.get(i).getValuemeaning() != null && !list.get(i).getParmname().equals("")) { - try { - // 解析valuemeaning 总表里或页面需要配置为: 运行/停止,1/0 - if (list.get(i).getValuemeaning().contains(",")) { - String[] s = list.get(i).getValuemeaning().split(","); - String lefts = s[0]; - String rights = s[1]; - String[] left = lefts.split("/");//左边中文数组 - String[] right = rights.split("/");//右边数字数组 - if (right != null && right.length > 0) { - for (int j = 0; j < right.length; j++) { - BigDecimal bigDecimal = new BigDecimal(right[j]); - if (bigDecimal.compareTo(list.get(i).getParmvalue()) == 0) { - jsonObject_mp.put("paramValue", left[j]); - break; - } - } - } - } - } catch (Exception e) { - System.out.println(); - } - } - jsonArray_3.add(jsonObject_mp); - } - //关键信号 - else if (list.get(i).getParmname().contains("电流") || list.get(i).getParmname().contains("电压") || list.get(i).getParmname().contains("频率") - || list.get(i).getParmname().contains("流量") || list.get(i).getParmname().contains("进口压力") || list.get(i).getParmname().contains("出口压力") - || list.get(i).getParmname().contains("重量") || list.get(i).getParmname().contains("电量") || list.get(i).getParmname().contains("料位") - || list.get(i).getParmname().contains("浓度") || list.get(i).getParmname().contains("水量") || list.get(i).getParmname().contains("液位") - ) { - jsonArray_2.add(jsonObject_mp); - } - //辅助数据 - else if (list.get(i).getParmname().contains("温度") || list.get(i).getParmname().contains("震动") || list.get(i).getParmname().contains("累计") - || list.get(i).getParmname().contains("累积量") || list.get(i).getParmname().contains("PH值") || list.get(i).getParmname().contains("负压") - || list.get(i).getParmname().contains("硫化氢") || list.get(i).getParmname().contains("投加量") || list.get(i).getParmname().contains("蒸汽量") - || list.get(i).getParmname().contains("投入量") || list.get(i).getParmname().contains("投泥量") || list.get(i).getParmname().contains("空气量") - || list.get(i).getParmname().contains("含量") - ) { - jsonArray_4.add(jsonObject_mp); - } - //关联数据 - else if (list.get(i).getParmname().contains("前后阀门") || list.get(i).getParmname().contains("全关") || list.get(i).getParmname().contains("全开") - || list.get(i).getParmname().contains("阀开") || list.get(i).getParmname().contains("阀关") || list.get(i).getParmname().contains("开度") - || list.get(i).getParmname().contains("开到位") || list.get(i).getParmname().contains("关到位") || list.get(i).getParmname().contains("远程") - || list.get(i).getParmname().contains("阀位反馈") || list.get(i).getParmname().contains("报警") || list.get(i).getParmname().contains("远程")) { - jsonArray_5.add(jsonObject_mp); - } - } - - if (jsonArray_1 != null && jsonArray_1.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "运行时间"); - jsonObject1.put("mpoint", jsonArray_1); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_2 != null && jsonArray_2.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "关键信号"); - jsonObject1.put("mpoint", jsonArray_2); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_3 != null && jsonArray_3.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "运行信号"); - jsonObject1.put("mpoint", jsonArray_3); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_4 != null && jsonArray_4.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "辅助数据"); - jsonObject1.put("mpoint", jsonArray_4); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_5 != null && jsonArray_5.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "关联数据"); - jsonObject1.put("mpoint", jsonArray_5); - jsonArray_group.add(jsonObject1); - } - } - jsonObject.put("group", jsonArray_group); - -// JSONObject json = new JSONObject(); -// json.put("dataType", CommString.WebsocketBIMTypeAutoPatrol); -// json.put("data", jsonObject); - - if (jsonObject != null) { - try { - MsgWebSocket2 msg = new MsgWebSocket2(); -// msg.onMessageData(json.toString(), null); - msg.onMessageData(jsonObject.toString(), null); - } catch (Exception e) { - System.out.println("3-------------------------------------------"); - e.printStackTrace(); - } - } - } - } - - - //三维新版本(和三维老版本仅保留一个) - if (list_company != null && list_company.size() > 0) { - //查BIM订阅的设备 - List list_equ = equipmentCardService.selectSimpleListByWhere("where equipmentCardID = '" + equipmentCardId + "'"); - if (list_equ != null && list_equ.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("equipmentId", equipmentCardId); - jsonObject.put("equipmentName", list_equ.get(0).getEquipmentname()); - - JSONArray jsonArray_group = new JSONArray(); - - //查该设备下关联的点位 - List list = mPointService.selectListByWhere(list_company.get(0).getId(), "where equipmentId = '" + list_equ.get(0).getId() + "'"); - if (list != null && list.size() > 0) { - JSONArray jsonArray_1 = new JSONArray(); - JSONArray jsonArray_2 = new JSONArray(); - JSONArray jsonArray_3 = new JSONArray(); - JSONArray jsonArray_4 = new JSONArray(); - JSONArray jsonArray_5 = new JSONArray(); - - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject_mp = new JSONObject(); - jsonObject_mp.put("mpointId", list.get(i).getId()); - jsonObject_mp.put("mpointCode", list.get(i).getMpointcode()); - if (list.get(i).getDisname() != null && !list.get(i).getDisname().equals("")) { - jsonObject_mp.put("mpointName", list.get(i).getDisname()); - } else { - jsonObject_mp.put("mpointName", list.get(i).getParmname()); - } - if (list.get(i).getUnit() != null) { - jsonObject_mp.put("unit", list.get(i).getUnit()); - } else { - jsonObject_mp.put("unit", ""); - } - if (list.get(i).getMeasuredt() != null) { - jsonObject_mp.put("measureDt", list.get(i).getMeasuredt()); - } else { - jsonObject_mp.put("measureDt", ""); - } - - BigDecimal parmValue = CommUtil.formatMPointValue(list.get(i).getParmvalue(), list.get(i).getNumtail(), list.get(i).getRate()); - jsonObject_mp.put("paramValue", parmValue + ""); - - //运行时间 - if (list.get(i).getParmname().contains("累计运行时间") || list.get(i).getParmname().contains("单次运行时间")) { - jsonArray_1.add(jsonObject_mp); - } - //运行信号 - else if (list.get(i).getParmname().contains("运行") || list.get(i).getParmname().contains("停止") - || list.get(i).getParmname().contains("故障") || list.get(i).getParmname().contains("过电流故障") - || list.get(i).getParmname().contains("过载故障")) { - if (list.get(i).getValuemeaning() != null && !list.get(i).getParmname().equals("")) { - try { - // 解析valuemeaning 总表里或页面需要配置为: 运行/停止,1/0 - if (list.get(i).getValuemeaning().contains(",")) { - String[] s = list.get(i).getValuemeaning().split(","); - String lefts = s[0]; - String rights = s[1]; - String[] left = lefts.split("/");//左边中文数组 - String[] right = rights.split("/");//右边数字数组 - if (right != null && right.length > 0) { - for (int j = 0; j < right.length; j++) { - BigDecimal bigDecimal = new BigDecimal(right[j]); - if (bigDecimal.compareTo(list.get(i).getParmvalue()) == 0) { - jsonObject_mp.put("paramValue", left[j]); - break; - } - } - } - } - } catch (Exception e) { - System.out.println(); - } - } - jsonArray_3.add(jsonObject_mp); - } - //关键信号 - else if (list.get(i).getParmname().contains("电流") || list.get(i).getParmname().contains("电压") || list.get(i).getParmname().contains("频率") - || list.get(i).getParmname().contains("流量") || list.get(i).getParmname().contains("进口压力") || list.get(i).getParmname().contains("出口压力") - || list.get(i).getParmname().contains("重量") || list.get(i).getParmname().contains("电量") || list.get(i).getParmname().contains("料位") - || list.get(i).getParmname().contains("浓度") || list.get(i).getParmname().contains("水量") || list.get(i).getParmname().contains("液位") - ) { - jsonArray_2.add(jsonObject_mp); - } - //辅助数据 - else if (list.get(i).getParmname().contains("温度") || list.get(i).getParmname().contains("震动") || list.get(i).getParmname().contains("累计") - || list.get(i).getParmname().contains("累积量") || list.get(i).getParmname().contains("PH值") || list.get(i).getParmname().contains("负压") - || list.get(i).getParmname().contains("硫化氢") || list.get(i).getParmname().contains("投加量") || list.get(i).getParmname().contains("蒸汽量") - || list.get(i).getParmname().contains("投入量") || list.get(i).getParmname().contains("投泥量") || list.get(i).getParmname().contains("空气量") - || list.get(i).getParmname().contains("含量") - ) { - jsonArray_4.add(jsonObject_mp); - } - //关联数据 - else if (list.get(i).getParmname().contains("前后阀门") || list.get(i).getParmname().contains("全关") || list.get(i).getParmname().contains("全开") - || list.get(i).getParmname().contains("阀开") || list.get(i).getParmname().contains("阀关") || list.get(i).getParmname().contains("开度") - || list.get(i).getParmname().contains("开到位") || list.get(i).getParmname().contains("关到位") || list.get(i).getParmname().contains("远程") - || list.get(i).getParmname().contains("阀位反馈") || list.get(i).getParmname().contains("报警") || list.get(i).getParmname().contains("远程")) { - jsonArray_5.add(jsonObject_mp); - } - } - - if (jsonArray_1 != null && jsonArray_1.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "运行时间"); - jsonObject1.put("mpoint", jsonArray_1); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_2 != null && jsonArray_2.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "关键信号"); - jsonObject1.put("mpoint", jsonArray_2); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_3 != null && jsonArray_3.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "运行信号"); - jsonObject1.put("mpoint", jsonArray_3); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_4 != null && jsonArray_4.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "辅助数据"); - jsonObject1.put("mpoint", jsonArray_4); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_5 != null && jsonArray_5.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "关联数据"); - jsonObject1.put("mpoint", jsonArray_5); - jsonArray_group.add(jsonObject1); - } - } - jsonObject.put("group", jsonArray_group); - - JSONObject json = new JSONObject(); - json.put("dataType", CommString.WebsocketBIMTypeAutoPatrol); - json.put("data", jsonObject); - - if (jsonObject != null) { - try { -// MsgWebSocket2 msg = new MsgWebSocket2(); -// msg.onMessageData(json.toString(), null); - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(json.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } catch (Exception e) { - System.out.println("3-------------------------------------------"); - e.printStackTrace(); - } - } - } - } - - - } - } - - - /** - * 临时推送一次风机的数据用于石洞口演示 (2023-07-10 后可删除) - * - * @param scheduleJob - */ - /*public void fun2(ScheduleJob scheduleJob) { - System.out.println("推送一次风机数据======" + CommUtil.nowDate()); - - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMEquMpoint); - if (map_list != null && map_list.size() > 0) { - String equipmentCardId = map_list.get("BIM"); - //查厂Id - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - if (list_company != null && list_company.size() > 0) { - //查BIM订阅的设备 - List list_equ = equipmentCardService.selectSimpleListByWhere("where equipmentCardID = '" + equipmentCardId + "'"); - if (list_equ != null && list_equ.size() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("equipmentId", equipmentCardId); - jsonObject.put("equipmentName", list_equ.get(0).getEquipmentname()); - - JSONArray jsonArray_group = new JSONArray(); - - //查该设备下关联的点位 - List list = mPointService.selectListByWhere(list_company.get(0).getId(), "where equipmentId = '" + list_equ.get(0).getId() + "'"); - if (list != null && list.size() > 0) { - JSONArray jsonArray_1 = new JSONArray(); - JSONArray jsonArray_2 = new JSONArray(); - JSONArray jsonArray_3 = new JSONArray(); - JSONArray jsonArray_4 = new JSONArray(); - JSONArray jsonArray_5 = new JSONArray(); - - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject_mp = new JSONObject(); - jsonObject_mp.put("mpointId", list.get(i).getId()); - if (list.get(i).getDisname() != null && !list.get(i).getDisname().equals("")) { - jsonObject_mp.put("mpointName", list.get(i).getDisname()); - } else { - jsonObject_mp.put("mpointName", list.get(i).getParmname()); - } - if (list.get(i).getUnit() != null) { - jsonObject_mp.put("unit", list.get(i).getUnit()); - } else { - jsonObject_mp.put("unit", ""); - } - if (list.get(i).getMeasuredt() != null) { - jsonObject_mp.put("measureDt", list.get(i).getMeasuredt()); - } else { - jsonObject_mp.put("measureDt", ""); - } - - BigDecimal parmValue = CommUtil.formatMPointValue(list.get(i).getParmvalue(), list.get(i).getNumtail(), list.get(i).getRate()); - jsonObject_mp.put("paramValue", parmValue + ""); - - //运行时间 - if (list.get(i).getParmname().contains("累计运行时间") || list.get(i).getParmname().contains("单次运行时间")) { - jsonArray_1.add(jsonObject_mp); - } - //关键信号 - else if (list.get(i).getParmname().contains("电流") || list.get(i).getParmname().contains("电压") || list.get(i).getParmname().contains("频率") - || list.get(i).getParmname().contains("流量") || list.get(i).getParmname().contains("进口压力") || list.get(i).getParmname().contains("出口压力")) { - jsonArray_2.add(jsonObject_mp); - } - //运行信号 - else if (list.get(i).getParmname().contains("运行") || list.get(i).getParmname().contains("停止") || list.get(i).getParmname().contains("故障")) { - if (list.get(i).getValuemeaning() != null && !list.get(i).getParmname().equals("")) { - try { - // 解析valuemeaning 总表里或页面需要配置为: 运行/停止,1/0 - if (list.get(i).getValuemeaning().contains(",")) { - String[] s = list.get(i).getValuemeaning().split(","); - String lefts = s[0]; - String rights = s[1]; - String[] left = lefts.split("/");//左边中文数组 - String[] right = rights.split("/");//右边数字数组 - if (right != null && right.length > 0) { - for (int j = 0; j < right.length; j++) { - BigDecimal bigDecimal = new BigDecimal(right[j]); - if (bigDecimal.compareTo(list.get(i).getParmvalue()) == 0) { - jsonObject_mp.put("paramValue", left[j]); - break; - } - } - } - } - } catch (Exception e) { - System.out.println(); - } - } - jsonArray_3.add(jsonObject_mp); - } - //辅助数据 - else if (list.get(i).getParmname().contains("温度") || list.get(i).getParmname().contains("震动")) { - jsonArray_4.add(jsonObject_mp); - } - //关联数据 - else if (list.get(i).getParmname().contains("前后阀门")) { - jsonArray_5.add(jsonObject_mp); - } - } - - if (jsonArray_1 != null && jsonArray_1.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "运行时间"); - jsonObject1.put("mpoint", jsonArray_1); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_2 != null && jsonArray_2.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "关键信号"); - jsonObject1.put("mpoint", jsonArray_2); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_3 != null && jsonArray_3.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "运行信号"); - jsonObject1.put("mpoint", jsonArray_3); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_4 != null && jsonArray_4.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "辅助数据"); - jsonObject1.put("mpoint", jsonArray_4); - jsonArray_group.add(jsonObject1); - } - if (jsonArray_5 != null && jsonArray_5.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("type", "关联数据"); - jsonObject1.put("mpoint", jsonArray_5); - jsonArray_group.add(jsonObject1); - } - } - jsonObject.put("group", jsonArray_group); - if (jsonObject != null) { - try { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessageData(jsonObject.toString(), null); - } catch (Exception e) { - System.out.println("3-------------------------------------------"); - e.printStackTrace(); - } - } - } - } - - } - - }*/ -} diff --git a/src/com/sipai/quartz/job/BIMDataJob_NS.java b/src/com/sipai/quartz/job/BIMDataJob_NS.java deleted file mode 100644 index 8fc70ff0..00000000 --- a/src/com/sipai/quartz/job/BIMDataJob_NS.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.process.DataPatrol; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.process.DataPatrolService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.MsgWebSocket2; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * websocket推送数据给三维(南市接口) - * sj 2023-04-26 - */ -public class BIMDataJob_NS { - @Resource - private MPointService mPointService; - @Resource - private CompanyService companyService; - @Resource - private DataPatrolService dataPatrolService; - @Resource - private RedissonClient redissonClient; - - /** - * 实时数据接口 (在定时器模块修改推送的频率,仅推送订阅的数据) - * - * @param - */ - public void fun1() { - System.out.println("推送BIM实时数据定时器 ====== " + CommUtil.nowDate()); - - String ids = ""; - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMMpoint); - if (map_list != null && map_list.size() > 0) { - Map all = map_list.getAll(map_list.keySet()); - if (all != null && all.size() > 0) { - Iterator> entries = all.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = entries.next(); - //解析并推送实时数据 - List list = entry.getValue(); - for (String s : list) { - ids += "'" + s + "',"; - } - } - } - } - - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - if (list_company != null && list_company.size() > 0) { - List list = mPointService.selectListByWhere(list_company.get(0).getId(), "where 1=1 and id in (" + ids + ")"); - JSONArray jsonArray = new JSONArray(); - for (MPoint mPoint : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", mPoint.getId()); - jsonObject.put("mpointId", mPoint.getMpointid()); - jsonObject.put("mpointCode", mPoint.getMpointcode()); - jsonObject.put("mpointName", mPoint.getParmname()); - if (mPoint.getNumtail() != null && !mPoint.getNumtail().equals("")) { - jsonObject.put("numtail", mPoint.getNumtail()); - } else { - jsonObject.put("numtail", ""); - } - if (mPoint.getParmvalue() != null && !mPoint.getParmvalue().equals("")) { -// jsonObject.put("paramValue", mPoint.getParmvalue()); - jsonObject.put("paramValue", CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate())); - } else { - jsonObject.put("paramValue", 0); - } - if (mPoint.getUnit() != null && !mPoint.getUnit().equals("")) { - jsonObject.put("unit", mPoint.getUnit()); - } else { - jsonObject.put("unit", ""); - } - jsonObject.put("type", "-"); - jsonArray.add(jsonObject); - } - - /*if (jsonArray != null && jsonArray.size() > 0) { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessageData(jsonArray.toString(), null); - }*/ - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dataType", CommString.WebsocketBIMTypeReal); - jsonObject.put("data", jsonArray); - if (jsonArray != null && jsonArray.size() > 0) { -// MsgWebSocket2 msg = new MsgWebSocket2(); -// msg.onMessageData(jsonObject.toString(), null); - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(jsonObject.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - } - } - } - - /** - * 数据巡视 推送 - * - * @param - */ - public void fun2() { - System.out.println("推送BIM数据巡视定时器======" + CommUtil.nowDate()); - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - if (list_company != null && list_company.size() > 0) { - List dataPatrolList = dataPatrolService.selectListByWhere("where unit_id = '" + list_company.get(0).getId() + "'"); - if (dataPatrolList != null && dataPatrolList.size() > 0) { - String mpids = ""; - for (int i = 0; i < dataPatrolList.size(); i++) { - mpids += dataPatrolList.get(i).getMpid() + ","; - } - String jsonObject = this.dataPatrolService.getDataPatrolSt(mpids, list_company.get(0).getId()); - if (jsonObject != null && !jsonObject.equals("")) { -// MsgWebSocket2 msg = new MsgWebSocket2(); -// msg.onMessageData(jsonObject, null); - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(jsonObject.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } - } - } -} diff --git a/src/com/sipai/quartz/job/BIMJob.java b/src/com/sipai/quartz/job/BIMJob.java deleted file mode 100644 index 6a622075..00000000 --- a/src/com/sipai/quartz/job/BIMJob.java +++ /dev/null @@ -1,418 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.bim.BIMAlarmThreshold; -import com.sipai.entity.bim.BIMCamera; -import com.sipai.entity.bim.BIMCurrency; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.service.bim.BIMAlarmThresholdService; -import com.sipai.service.bim.BIMCurrencyService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.service.bim.BIMCameraService; -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * 从别人的接口获取各类数据存到数据表中 - * 用于成都武侯项目--定制 - */ -public class BIMJob { - protected String url = "http://118.122.125.134/interface/getData"; - - @Resource - private BIMCameraService bimCameraService; - @Resource - private BIMAlarmThresholdService bimAlarmThresholdService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private BIMCurrencyService bimCurrencyService; - @Resource - private CompanyService companyService; - - public void excute() { - System.out.println("获取BIM数据定时器"); - String unitId = "028CDBIM";//028CDBIM 成都 - List list = companyService.selectListByWhere("where type = '" + CommString.UNIT_TYPE_BIZ + "'"); - if (list != null && list.size() > 0) { - unitId = list.get(0).getId(); - } - - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//可以方便地修改日期格式 - Date now = new Date(); - - Date now_10 = new Date(now.getTime() - 24000000); //6小时前 - String nowTime_10 = dateFormat.format(now_10); - - Date now_2 = new Date(now.getTime() + 600000); //10分钟后 - String nowTime = dateFormat.format(now_2); - - //发送 POST 请求 - JSONObject json = new JSONObject(); - json.put("key", "acd343a2d14c750fdd3cb433787ae387"); - json.put("security", "3539d7ec64164e32a632a5c958434404"); - json.put("startDate", nowTime_10); - json.put("endDate", nowTime); - - excuteBIMCurrency(json, "3c5b2daae7ad4e5385db03dbc5351437", unitId);//水质监测 3c5b2daae7ad4e5385db03dbc5351437 - excuteBIMCurrency(json, "1f94d50ff6fe47aca472979d58eb6a22", unitId);//流量站 1f94d50ff6fe47aca472979d58eb6a22 - excuteBIMCurrency(json, "2d99af07e0fe4ca4a7dc3bd235c95661", unitId);//雨量站 2d99af07e0fe4ca4a7dc3bd235c95661 - excuteBIMCurrency(json, "ac0f2c5e964a47598119a758e08a0286", unitId);//河长牌 ac0f2c5e964a47598119a758e08a0286 - - json.put("startDate", "2020-01-01 00:00:00"); - json.put("endDate", nowTime); - excuteBIMCamera(json);//获取摄像头 - excuteBIMAlarmThreshold(json, unitId);//获取报警阀值 - - excuteBIMData(unitId); - - excuteBIMMaintain(json, "08d4d76db63f4796b4e1938f682e7511", unitId);//获取维护维修等数据 08d4d76db63f4796b4e1938f682e7511 - System.out.println("完成数据获取"); - } - - /* - 获取摄像头数据 - */ - public void excuteBIMCamera(JSONObject json) { - json.put("serverId", "e66fceec9d00425db694c49b2fcc7b8b"); - String sendPost = sendPost(url, json.toString()); - JSONObject jsonObject = JSONObject.parseObject(sendPost); - JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("data").toString()); - if (jsonArray != null && jsonArray.size() > 0) { - //先删除所有数据 - bimCameraService.deleteByWhere(""); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject2 = jsonArray.getJSONObject(i); - //判断是否存在 - BIMCamera entity = new BIMCamera(); - entity.setId(CommUtil.getUUID()); - if (jsonObject2.get("ct") != null && !jsonObject2.get("ct").equals("")) { - entity.setCt(jsonObject2.get("ct") + ""); - } - if (jsonObject2.get("st") != null && !jsonObject2.get("st").equals("")) { - entity.setSt(jsonObject2.get("st") + ""); - } - entity.setName(jsonObject2.get("name") + ""); - entity.setLat(jsonObject2.get("lat") + ""); - entity.setLon(jsonObject2.get("lon") + ""); - entity.setInterfaces(jsonObject2.get("interfaces") + ""); - entity.setDevicePass(jsonObject2.get("device_pass") + ""); - int res = bimCameraService.save(entity); - } - } - } - - /* - 获取报警阈值数据 - */ - public void excuteBIMAlarmThreshold(JSONObject json, String unitId) { -// System.out.println("获取报警阈值"); - json.put("serverId", "13f53548a9e14f2d907d0549bb86ad71"); - String sendPost = sendPost(url, json.toString()); - JSONObject jsonObject = JSONObject.parseObject(sendPost); - JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("data").toString()); - - if (jsonArray != null && jsonArray.size() > 0) { - //先删除所有数据 - bimAlarmThresholdService.deleteByWhere(""); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject2 = jsonArray.getJSONObject(i); - //判断是否存在 - //BIMAlarmThreshold bimAlarmThreshold = bimAlarmThresholdService.selectById(jsonObject2.get("pk_id").toString()); - BIMAlarmThreshold entity = new BIMAlarmThreshold(); - entity.setId(CommUtil.getUUID()); - if (jsonObject2.get("ct") != null && !jsonObject2.get("ct").equals("")) { - entity.setCt(jsonObject2.get("ct").toString()); - } - if (jsonObject2.get("st") != null && !jsonObject2.get("st").equals("")) { - entity.setSt(jsonObject2.get("st").toString()); - } - entity.setPlaceName(jsonObject2.get("place_name") + ""); - entity.setPlaceId(jsonObject2.get("place_id") + ""); - if (jsonObject2.get("max_val") != null && !jsonObject2.get("max_val").equals("")) { - BigDecimal bd = new BigDecimal(jsonObject2.get("max_val").toString()); - entity.setMaxVal(bd); - } - if (jsonObject2.get("min_val") != null && !jsonObject2.get("min_val").equals("")) { - BigDecimal bd = new BigDecimal(jsonObject2.get("min_val").toString()); - entity.setMaxVal(bd); - } - bimAlarmThresholdService.save(entity); - } - } - } - - /* - 获取通用数据 - */ - public void excuteBIMCurrency(JSONObject json, String serverId, String unitId) { - json.put("serverId", serverId); - String sendPost = sendPost(url, json.toString()); - JSONObject jsonObject = JSONObject.parseObject(sendPost); - JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("data").toString()); - - List list = bimCurrencyService.selectListByWhere("where server_id = '" + serverId + "'"); - Set set = new HashSet<>(); - for (BIMCurrency bimCurrency : list) { - set.add(bimCurrency.getTagId()); - } - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject2 = jsonArray.getJSONObject(i); - for (Map.Entry entry : jsonObject2.entrySet()) { - //抓取需要的元素 如 C14 C20 - boolean contains = set.contains(entry.getKey()); - if (contains) { - String key = entry.getKey(); - BigDecimal value = new BigDecimal(entry.getValue().toString()); - BIMCurrency bimCurrency = bimCurrencyService.selectByWhere("where location_details = '" + jsonObject2.get("location_details") + "' " + - "and name = '" + jsonObject2.get("name") + "' and tag_id = '" + key + "' and server_id = '" + serverId + "'"); - if (bimCurrency != null) { - String mpcode = bimCurrency.getMpointCode(); - MPoint mPoint = mPointService.selectById(unitId, mpcode); - if (mPoint != null) { - //往子表插数据 - MPointHistory mPointHistory = new MPointHistory(); - List listHis = mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + mpcode, "where MeasureDT = '" + jsonObject2.get("st").toString() + "'"); - if (listHis != null && listHis.size() > 0) { - //System.out.println("子表已存在"); - } else { - mPointHistory.setMeasuredt(jsonObject2.get("st").toString()); - mPointHistory.setParmvalue(value); - mPointHistory.setTbName("tb_mp_" + mpcode); - int mHisres = mPointHistoryService.save(unitId, mPointHistory); - //System.out.println("新增子表结果" + mHisres); - } - /*List listHis2 = mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "tb_mp_" + mpcode, "order by MeasureDT desc"); - if (listHis2 != null && listHis2.size() > 0) { - //修改主表值 - mPoint.setId(mPoint.getId()); - mPoint.setMeasuredt(listHis2.get(0).getMeasuredt()); - mPoint.setParmvalue(listHis2.get(0).getParmvalue()); - int mres = mPointService.update2(unitId, mPoint); - //System.out.println(mPoint.getParmname()+"---修改主表结果:" + mres); - } else { - - }*/ - //修改主表值 - mPoint.setId(mPoint.getId()); - mPoint.setMeasuredt(jsonObject2.get("st").toString()); - mPoint.setParmvalue(value); - int mres = mPointService.update2(unitId, mPoint); - } else { -// System.out.println("2222-------------------" + mpcode); - } - } else { - if (serverId.equals("3c5b2daae7ad4e5385db03dbc5351437")) { - System.out.println("where location_details = '" + jsonObject2.get("location_details") + "' " + - "and name = '" + jsonObject2.get("name") + "' and tag_id = '" + key + "' and server_id = '" + serverId + "'"); - } - } - - } - } - - } - } - } - - /* - 获取维修保养等数据 - */ - public void excuteBIMMaintain(JSONObject json, String serverId, String unitId) { - json.put("serverId", serverId); - String sendPost = sendPost(url, json.toString()); - JSONObject jsonObject = JSONObject.parseObject(sendPost); - JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("data").toString()); - - List list = bimCurrencyService.selectListByWhere("where server_id = '" + serverId + "'"); - Set set = new HashSet<>(); - for (BIMCurrency bimCurrency : list) { - set.add(bimCurrency.getTagId()); - } - - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject2 = jsonArray.getJSONObject(i); - String row = jsonObject2.get("row").toString(); - String val = jsonObject2.get("val").toString(); - if (val != null && !val.equals("")) { - BigDecimal value = new BigDecimal(val); - BIMCurrency bimCurrency = bimCurrencyService.selectByWhere("where server_id = '" + serverId + "' and tag_id = '" + row + "'"); - if (bimCurrency != null) { - String mpcode = bimCurrency.getMpointCode(); - MPoint mPoint = mPointService.selectById(unitId, mpcode); - if (mPoint != null) { - //修改主表值 - mPoint.setId(mPoint.getId()); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(value); - mPointService.update2(unitId, mPoint); - } else { -// System.out.println("2222"); - } - } else { -// System.out.println("1111"); - } - } - } - } - } - - /** - * 先获取token 再请求对应点位的数值 - */ - public void excuteBIMData(String unitId) { -// System.out.println("进了12点方法"); - try { - String json = "{\"tenantEname\":\"chengdubeikong\",\"name\":\"admin\",\"password\":\"chengdubeikong\",\"hash\":\"abc\"}"; - String url = "http://cloud.anylink.io:8600/user/getToken"; - HttpClient httpClient = new DefaultHttpClient(); - HttpPost post = new HttpPost(url); - StringEntity postingString = new StringEntity(json); - post.setEntity(postingString); - post.setHeader("Content-type", "application/json"); - HttpResponse response = httpClient.execute(post); - String content = EntityUtils.toString(response.getEntity()); - JSONObject jsonObject1 = JSONObject.parseObject(content); - String token = jsonObject1.get("data").toString(); - - String url2 = "http://cloud.anylink.io:8600/currentdata/pagination"; - //创建httpClient - CloseableHttpClient client = HttpClients.createDefault(); - //2、封装请求参数 - List list = new ArrayList(); - list.add(new BasicNameValuePair("token", token)); - list.add(new BasicNameValuePair("page", "1")); - list.add(new BasicNameValuePair("perPage", "500")); - list.add(new BasicNameValuePair("deviceId", "1651636225")); - //3、转化参数 - String params = EntityUtils.toString(new UrlEncodedFormEntity(list, Consts.UTF_8)); -// System.out.println("params:" + params); - //4、创建HttpGet请求 - HttpGet httpGet = new HttpGet(url2 + "?" + params); - CloseableHttpResponse response2 = client.execute(httpGet); - //5、获取实体 - HttpEntity entity = response2.getEntity(); - //将实体装成字符串 - String string = EntityUtils.toString(entity); - JSONObject jsonObject = JSONObject.parseObject(string); - JSONObject jsonObject2 = JSONObject.parseObject(jsonObject.get("result").toString()); - JSONArray jsonArray = JSONArray.parseArray(jsonObject2.get("data").toString()); - -// unitId = "020ZCYH"; -// System.out.println("unitId没有改回来"); - - List list_str = new ArrayList(); - List list_mp = mPointService.selectListByWhere(unitId, "where 1=1 and biztype = '污水1'"); - if (list_mp != null && list_mp.size() > 0) { - for (int i = 0; i < list_mp.size(); i++) { - list_str.add(list_mp.get(i).getParmname()); - } - } - - //接口返回的所有数据 - for (int i = 0; i < jsonArray.size(); i++) { - //每个点的对象 - JSONObject jsonObject3 = JSONObject.parseObject(jsonArray.get(i).toString()); -// String str = new String(jsonObject3.get("itemname").toString().getBytes("iso8859-1"), "UTF-8"); - String str = jsonObject3.get("itemname").toString(); - - //判断是否是 “污水1” 点 - boolean bool = list_str.contains(str); - if (bool) { - MPoint mPoint = mPointService.selectByWhere(unitId, "where ParmName = '" + str + "'"); - if (mPoint != null) { - String dt = jsonObject3.get("htime").toString().substring(0, 19); - String val = jsonObject3.get("val").toString(); - String mpcode = mPoint.getMpointcode(); - - mPoint.setId(mPoint.getId()); - mPoint.setMeasuredt(dt); - mPoint.setParmvalue(new BigDecimal(val)); - int mres = mPointService.update2(unitId, mPoint); - - //往子表插数据 - MPointHistory mPointHistory = new MPointHistory(); - List listHis = mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + mpcode, "where MeasureDT = '" + dt + "'"); - if (listHis != null && listHis.size() > 0) { -// System.out.println("子表数据已存在:" + mPoint.getParmname()); - } else { - mPointHistory.setMeasuredt(dt); - mPointHistory.setParmvalue(new BigDecimal(val)); - mPointHistory.setTbName("tb_mp_" + mpcode); - int mHisres = mPointHistoryService.save(unitId, mPointHistory); - } - } - - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 向指定 URL 发送POST方法的请求 - * - * @param url 发送请求的 URL - * @param json 请求参数, - * @return 所代表远程资源的响应结果 - */ - public static String sendPost(String url, String json) { - String response = null; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - try { - httpclient = HttpClients.createDefault(); - HttpPost httppost = new HttpPost(url); - StringEntity stringentity = new StringEntity(json, - ContentType.create("application/json", "UTF-8")); - httppost.setEntity(stringentity); - httpresponse = httpclient.execute(httppost); - response = EntityUtils - .toString(httpresponse.getEntity()); - - } finally { - if (httpclient != null) { - httpclient.close(); - } - if (httpresponse != null) { - httpresponse.close(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return response; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/BIMNSBotJob.java b/src/com/sipai/quartz/job/BIMNSBotJob.java deleted file mode 100644 index eef76294..00000000 --- a/src/com/sipai/quartz/job/BIMNSBotJob.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.tools.*; -import com.sipai.websocket.MsgWebSocket2; -import java.util.HashMap; -import java.util.Map; - -/** - * websocket推送数据给三维(南市接口) - * sj 2023-04-26 - */ -public class BIMNSBotJob { - - /** - * 机器人数据 推送 - * - * @param - */ - public void fun3(ScheduleJob scheduleJob) { - System.out.println("推送机器人数据 定时器======" + CommUtil.nowDate()); - String token = ""; - ThirdRequestProp thirdRequestProp = (ThirdRequestProp) SpringContextUtil.getBean("thirdRequestProp"); - String url = thirdRequestProp.getBoturl(); - String tokenURL = thirdRequestProp.getBottoken(); - Map headerMap = new HashMap<>(); - headerMap.put("Authorization", "sipai"); - headerMap.put("Content-Type", "application/json;charset=utf-8"); - token = HttpUtil.sendGet(tokenURL, headerMap); - headerMap.put("Authorization", token); - JSONObject reqJSON = new JSONObject(); - reqJSON.put("is_use", ""); - reqJSON.put("plcid", ""); - reqJSON.put("plcip", ""); - reqJSON.put("plcport", 0); - reqJSON.put("residence_time", 0); - reqJSON.put("robot_ip", ""); - reqJSON.put("robot_port", 0); - reqJSON.put("robotid", "5ad16a4f17d145c4b25ed58804fd21b1"); - reqJSON.put("task_id", ""); - reqJSON.put("valu", ""); - reqJSON.put("video_ip1", ""); - reqJSON.put("video_name1", ""); - reqJSON.put("video_port1", 0); - reqJSON.put("video_pwd1", ""); - try { - String data = HttpUtil.sendPost(url, reqJSON, headerMap); - JSONObject jsonObject = JSON.parseObject(data); - // 数据推送 - JSONObject socketJson = new JSONObject(); - socketJson.put("dataType", CommString.WebsocketBIMType021NS_SLCJQR01_RT); - socketJson.put("data", jsonObject); - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessageData(socketJson.toString(), null); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/src/com/sipai/quartz/job/BLGSyncDataJob.java b/src/com/sipai/quartz/job/BLGSyncDataJob.java deleted file mode 100644 index de69496d..00000000 --- a/src/com/sipai/quartz/job/BLGSyncDataJob.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.enums.whp.SamplingPlanStatusEnum; -import com.sipai.entity.enums.whp.SamplingPlanSyncEnum; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.whp.plan.WhpSamplingPlanService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; -import com.sipai.tools.SpringContextUtil; - -/** - * 白龙港新老平台数据同步 - */ -public class BLGSyncDataJob { - - WhpSamplingPlanService whpSamplingPlanService = (WhpSamplingPlanService) SpringContextUtil.getBean("whpSamplingPlanService"); - - WhpSamplingPlanTaskTestConfirmService whpSamplingPlanTaskTestConfirmService = (WhpSamplingPlanTaskTestConfirmService) SpringContextUtil.getBean("whpSamplingPlanTaskTestConfirmService"); - - /** - * 采样单下发同步 - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { - whpSamplingPlanService.syncSamplingPlan(); - } - - /** - * 原始记录下发同步 - * - * @param scheduleJob - */ - public void fun2(ScheduleJob scheduleJob) { - // 查询复核完成检测项目且未同步 - - // 调用老平台接口同步数据 - // 更新状态为已同步 - } - -} - diff --git a/src/com/sipai/quartz/job/CQBYTJob.java b/src/com/sipai/quartz/job/CQBYTJob.java deleted file mode 100644 index 19767d55..00000000 --- a/src/com/sipai/quartz/job/CQBYTJob.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.sipai.entity.cqbyt.TestReport; -import com.sipai.entity.cqbyt.TestReportDetails; -import com.sipai.service.cqbyt.TestReportDetailsService; -import com.sipai.service.cqbyt.TestReportService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.HttpUtil; - -import java.io.IOException; -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Iterator; -import javax.annotation.Resource; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.ParseException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicHeader; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; - -public class CQBYTJob { - @Resource - private TestReportDetailsService testReportDetailsService; - @Resource - private TestReportService testReportService; - - public CQBYTJob() { - } - - public void execute() { - String json = "{\"username\":\"jiangnanshuichang_jk\",\"password\":\"6c51178e35fd1a35ee71928851aadfba2858aab9\",\"verifyCodeActual\":\"5817\"}"; - String url = "http://10.127.16.70:9100/ieslab-web-system/login?username=jiangnanshuichang_jk&password=6c51178e35fd1a35ee71928851aadfba2858aab9"; - String result = null; - try { - CloseableHttpClient httpclient = HttpClients.createDefault(); - //StringEntity entity = new StringEntity(json); - //entity.setContentType("multipart/form-data; boundary=4585696313564699"); - //entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); - HttpPost httppost = new HttpPost(url); - //httppost.setEntity(entity); - httppost.setHeader("client_identifier", "client_identifier"); - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - System.err.println(e.getMessage()); - } - TestReport testReportSipai = new TestReport(); - testReportSipai.setId(CommUtil.getUUID()); - testReportSipai.setName("SIPAIIS"); - JSONObject jsonObject = JSONObject.parseObject(result); - if(jsonObject!=null){ - JSONObject jsonObject2 = JSONObject.parseObject(jsonObject.get("retData").toString()); - System.out.println("jsonObject:"+jsonObject2); - if(jsonObject2!=null){ - String token = jsonObject2.get("token").toString(); - System.out.println("获取token:"+token); - String sampleDateEnd = CommUtil.nowDate(); - String sampleDateStart = CommUtil.subplus(sampleDateEnd, "-24", "hour"); - //String listUrl = "http://10.127.16.70:9100/water-quality-mis/laboratory/reportSampleInfo/list/data?sampleDateStart="+sampleDateStart.substring(0, 10)+"&sampleDateEnd="+sampleDateEnd.substring(0, 10)+""; - String listUrl = "http://10.127.16.70:9100/water-quality-mis/laboratory/reportSampleInfo/list/data"; - json = "{\"page\": \"1\",\"rows\": \"10\"}"; - result = sendPOST(listUrl, json, "Bearer "+token); - JSONObject listData = JSONObject.parseObject(result); - if(listData!=null){ - JSONArray list = (JSONArray) listData.get("rows"); - if (list != null && list.size()>0) { - ObjectMapper objectMapper = new ObjectMapper(); - ObjectMapper detailsMapper = new ObjectMapper(); - for(Object object:list){ - JSONObject testReportObject = JSONObject.parseObject(object.toString()); - String id = null; - if(testReportObject!=null){ - id = testReportObject.get("id").toString(); - System.out.println("获取报告id:"+id); - //通过convertValue方法将object对象转换为相应实体对象 - objectMapper = new ObjectMapper(); - //序列化的时候序列对象的所有属性 - objectMapper.setSerializationInclusion(Include.ALWAYS); - //反序列化的时候如果多了其他属性,不抛出异常 - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - //如果是空对象的时候,不抛异常 - objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - //大小写脱敏 默认为false 需要改为true - objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,true); - //取消时间的转化格式,默认是时间戳,可以取消,同时需要设置要表现的时间格式 - objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); - TestReport testReport = testReport = objectMapper.convertValue(testReportObject,TestReport.class); - int res = 0; - if (this.testReportService.selectById(id) != null) { - res = this.testReportService.update(testReport); - } else { - res = this.testReportService.save(testReport); - } - if(res==1){ - json = ""; - String detailsUrl = "http://10.127.16.70:9100//water-quality-mis/laboratory/reportSampleInfo/loadReport?id="+id; - result = sendPOST(detailsUrl, json, "Bearer "+token); - JSONObject detailsDatas = JSONObject.parseObject(result); - if(detailsDatas!=null){ - JSONObject detailsData = JSONObject.parseObject(detailsDatas.get("data").toString()); - if(detailsData!=null){ - JSONArray detailsList = (JSONArray) detailsData.get("labReportSampleDetails"); - if (detailsList != null && detailsList.size()>0) { - for(Object detailsObject:detailsList){ - //System.out.println("detailsObject:"+detailsObject.toString()); - JSONObject details = JSONObject.parseObject(detailsObject.toString()); - String detailsId = details.get("id").toString(); - detailsMapper = new ObjectMapper(); - //通过convertValue方法将object对象转换为相应实体对象 - //序列化的时候序列对象的所有属性 - detailsMapper.setSerializationInclusion(Include.ALWAYS); - //反序列化的时候如果多了其他属性,不抛出异常 - detailsMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - //如果是空对象的时候,不抛异常 - detailsMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - //大小写脱敏 默认为false 需要改为true - detailsMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES,true); - //取消时间的转化格式,默认是时间戳,可以取消,同时需要设置要表现的时间格式 - detailsMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - detailsMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); - TestReportDetails testReportDetails = detailsMapper.convertValue(details,TestReportDetails.class); - res = 0; - if (this.testReportDetailsService.selectById(detailsId) != null) { - res = this.testReportDetailsService.update(testReportDetails); - } else { - res = this.testReportDetailsService.save(testReportDetails); - } - System.out.println("获取报告详情id:"+detailsId); - } - } - } - } - } - } - } - } - } - } - - } - System.out.println("获取报告信息完毕!"); - } - - public static String sendGET(String url, String json, String token) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpGet.setHeader("x-access-token", token); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var11) { - var11.printStackTrace(); - } - - return response; - } - public static String getToken(String url, String json) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var10) { - var10.printStackTrace(); - } - - return response; - } - - public static String sendPOST(String url, String json, String token) { - String result = null; - StringEntity postingString = null; - try { - CloseableHttpClient httpclient = HttpClients.createDefault(); - HttpPost httppost = new HttpPost(url); - postingString = new StringEntity(json); - httppost.setEntity(postingString); - httppost.setHeader("Content-type", "application/json"); - httppost.setHeader("x-auth-token", token); - httppost.setHeader("X-Requested-With", "XMLHttpRequest"); - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - //logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - return result; - } -} diff --git a/src/com/sipai/quartz/job/CQBYT_KPI_Job.java b/src/com/sipai/quartz/job/CQBYT_KPI_Job.java deleted file mode 100644 index ea9044da..00000000 --- a/src/com/sipai/quartz/job/CQBYT_KPI_Job.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.quartz.job; - -import java.io.IOException; -import java.math.BigDecimal; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -import javax.annotation.Resource; - -import org.apache.http.HttpEntity; -import org.apache.http.ParseException; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicHeader; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.xmlpull.v1.XmlPullParserException; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.cqbyt.KpiAnalysis; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.cqbyt.KpiAnalysisService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -public class CQBYT_KPI_Job { - - KpiAnalysisService kpiAnalysisService = (KpiAnalysisService) SpringContextUtil.getBean("kpiAnalysisService"); - - public void getKPI(ScheduleJob scheduleJob) { - System.out.println(scheduleJob.getJobName()); - String params = scheduleJob.getParams();//json格式参数 - kpiAnalysisService.getKPIdata(params); - System.out.println("获取KPI完毕!"); - } - - -} diff --git a/src/com/sipai/quartz/job/CQBYT_KPI_Job_test.java b/src/com/sipai/quartz/job/CQBYT_KPI_Job_test.java deleted file mode 100644 index e6c7def1..00000000 --- a/src/com/sipai/quartz/job/CQBYT_KPI_Job_test.java +++ /dev/null @@ -1,344 +0,0 @@ -package com.sipai.quartz.job; - -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -import javax.annotation.Resource; - -import org.apache.http.HttpEntity; -import org.apache.http.ParseException; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicHeader; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.xmlpull.v1.XmlPullParserException; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.cqbyt.KpiAnalysis; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.cqbyt.KpiAnalysisService; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -//@Component -public class CQBYT_KPI_Job_test { - KpiAnalysisService kpiAnalysisService = (KpiAnalysisService) SpringContextUtil.getBean("kpiAnalysisService"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - private static final SimpleDateFormat longDateFormat = new SimpleDateFormat( - "yyyyMMddHHmmss", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat minuteDateFormat = new SimpleDateFormat( - "yyyyMMddHHmm", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat hourDateFormat = new SimpleDateFormat( - "yyyyMMddHH", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat dayDateFormat = new SimpleDateFormat( - "yyyyMMdd", Locale.SIMPLIFIED_CHINESE); - - public void getKPI(ScheduleJob scheduleJob) { - System.out.println(scheduleJob.getJobName()); - List cs = kpiAnalysisService.selectListByWhere("order by id"); - System.out.println("cs:"+cs.size()); - String params = scheduleJob.getParams();//json格式参数 - JSONObject dateType = JSON.parseObject(params); - //时间类型 - String type = null; - //时间差 - String num = "0"; - //用户名 - String account= "13000000000"; - //密码 - String password = "e10adc3949ba59abbe56e057f20f883e"; - //ip地址端口 - String httpUrl = "http://10.127.16.114:2828"; - if(dateType!=null ){ - if(dateType.get("dateType")!=null){ - type = dateType.get("dateType").toString(); - } - if(dateType.get("dateNum")!=null){ - num = dateType.get("dateNum").toString(); - } - if(dateType.get("username")!=null){ - account = dateType.get("username").toString(); - } - if(dateType.get("password")!=null){ - password = dateType.get("password").toString(); - } - if(dateType.get("httpUrl")!=null){ - httpUrl = dateType.get("httpUrl").toString(); - } - } - System.out.println("type:"+type); - String json = "{\"account\":\""+account+"\",\"password\":\""+password+"\"}"; - String url = httpUrl+"/login"; - File file = new File("F:\\kpi.json"); - String jsonString = null; - try { - jsonString = new String(Files.readAllBytes(Paths.get(file.getPath()))); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - String sampleDateEnd = CommUtil.nowDate(); - String sampleDateStart = ""; - Date date = null ; - Date dateStart = null ; - try { - date = longDateFormat.parse(sampleDateEnd); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if(type!=null && num!=null){ - if("day".equals(type)){ - //天 - sampleDateStart = CommUtil.subplus(sampleDateEnd, num, "day"); - try { - dateStart = dayDateFormat.parse(sampleDateStart); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sampleDateEnd = dayDateFormat.format(date); - sampleDateStart = dayDateFormat.format(dateStart); - }else - if("hour".equals(type)){ - //小时 - sampleDateStart = CommUtil.subplus(sampleDateEnd, num, "hour"); - try { - dateStart = hourDateFormat.parse(sampleDateStart); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sampleDateEnd = hourDateFormat.format(date); - sampleDateStart = hourDateFormat.format(dateStart); - }else - if("min".equals(type)){ - // 分钟 - sampleDateStart = CommUtil.subplus(sampleDateEnd, num, "min"); - sampleDateEnd = minuteDateFormat.format(date); - sampleDateStart = minuteDateFormat.format(dateStart); - } - }else{ - sampleDateStart = CommUtil.subplus(sampleDateEnd, "0", "day"); - sampleDateEnd = dayDateFormat.format(date); - sampleDateStart = dayDateFormat.format(dateStart); - } - String listUrl = httpUrl+"/datar/without"; - json = "{\"f_TIME_Start\": \""+sampleDateStart+"\",\"f_TIME_End\": \""+sampleDateEnd+"\",\"limit\":1,\"size\":1000}"; - - JSONObject resultData = JSONObject.parseObject(jsonString); - if(resultData!=null){ - JSONArray list = (JSONArray) resultData.get("Rows"); - System.out.println("list.size:"+list.size()); - if (list != null && list.size()>0) { - List kpiList = null; - KpiAnalysis kpiAnalysis = null; - MPoint mPointEntity = null; - MPointHistory mPointHistory = null; - BigDecimal parmvalue = new BigDecimal("0"); - String measuredt = ""; - for(Object object:list){ - JSONObject KPIObject = JSONObject.parseObject(object.toString()); - String id = null; - if(KPIObject!=null){ - id = KPIObject.get("F_ID").toString();//ID,主键 - String F_CALCULATIONID = KPIObject.get("F_CALCULATIONID").toString();//算法名称 - String F_INPUTTIME = KPIObject.get("F_INPUTTIME").toString();//数据生成时间 - String F_ORGID = KPIObject.get("F_ORGID").toString();//机构名称 - String F_REMARK = null; - if(KPIObject.get("F_REMARK")!=null){ - F_REMARK = KPIObject.get("F_REMARK").toString();//备注 - } - String F_SOURCEID = KPIObject.get("F_SOURCEID").toString();//数据来源名称 - String F_TIME = KPIObject.get("F_TIME").toString();//数据时间 - if(F_TIME!=null && F_TIME.length()==8){ - //day - F_TIME = F_TIME+"000000"; - } - if(F_TIME!=null && F_TIME.length()==10){ - //hour - F_TIME = F_TIME+"0000"; - } - if(F_TIME!=null && F_TIME.length()==12){ - //minute - F_TIME = F_TIME+"00"; - } - try { - date = longDateFormat.parse(F_TIME); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.out.println("date:"+date); - F_TIME = CommUtil.longDate(date); - String F_VALUE = KPIObject.get("F_VALUE").toString();//数据值 - System.out.println("获取数据id:"+id); - String mpCode = ""; - String unitId = ""; - System.out.println("where F_CALCULATIONID='"+F_CALCULATIONID+"' " - + "and F_ORGID='"+F_ORGID+"' and F_SOURCEID='"+F_SOURCEID+"' order by id"); - try { - //判断是否存在 - kpiList = kpiAnalysisService.selectListByWhere("where F_CALCULATIONID='"+F_CALCULATIONID+"' " - + "and F_ORGID='"+F_ORGID+"' and F_SOURCEID='"+F_SOURCEID+"' order by id"); - } catch (Exception e) { - logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - if(kpiList!=null && kpiList.size()>0){ - mpCode = kpiList.get(0).getMpointcode(); - unitId = kpiList.get(0).getUnitId(); - System.out.println("mpCode:"+mpCode); - System.out.println("unitId:"+unitId); - if(mpCode!=null && unitId!=null){ - mPointEntity = mPointService.selectById(unitId, mpCode); - if(mPointEntity!=null){ - parmvalue = new BigDecimal(F_VALUE); - parmvalue = parmvalue.setScale(4,BigDecimal.ROUND_HALF_UP); - System.out.println("parmvalue:"+parmvalue); - System.out.println("measuredt:"+measuredt); - measuredt = F_TIME; - mPointEntity.setParmvalue(parmvalue); - mPointEntity.setMeasuredt(measuredt); - int res = mPointService.update2(unitId, mPointEntity); - if(res>0){ - mPointHistory=new MPointHistory(); - mPointHistory.setParmvalue(parmvalue); - mPointHistory.setMeasuredt(measuredt); - mPointHistory.setTbName("TB_MP_"+mPointEntity.getMpointcode()); - res = mPointHistoryService.save(unitId, mPointHistory); - } - } - } - }else{ - //查找不到直接插入 - kpiAnalysis = new KpiAnalysis(); - kpiAnalysis.setId(id); - kpiAnalysis.setfCalculationid(F_CALCULATIONID); - kpiAnalysis.setfSourceid(F_SOURCEID); - kpiAnalysis.setfOrgid(F_ORGID); - kpiAnalysis.setfRemark(F_REMARK); - try { - kpiAnalysisService.save(kpiAnalysis); - } catch (Exception e) { - logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - } - } - } - } - } - System.out.println("获取报告信息完毕!"); - } - - public static String sendGET(String url, String json, String token) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpGet.setHeader("Authorization", token); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var11) { - var11.printStackTrace(); - } - - return response; - } - public static String getToken(String url, String json) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var10) { - var10.printStackTrace(); - } - - return response; - } - - public static String sendPOST(String url, String json, String token) { - String result = null; - StringEntity postingString = null; - try { - CloseableHttpClient httpclient = HttpClients.createDefault(); - HttpPost httppost = new HttpPost(url); - postingString = new StringEntity(json); - httppost.setEntity(postingString); - httppost.setHeader("Content-type", "application/json;charset=UTF-8"); - httppost.setHeader("x-auth-token", token); - httppost.setHeader("Authorization", token); - httppost.setHeader("X-Requested-With", "XMLHttpRequest"); - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - //logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - return result; - } -} diff --git a/src/com/sipai/quartz/job/CameraPicJob.java b/src/com/sipai/quartz/job/CameraPicJob.java deleted file mode 100644 index 99289bf4..00000000 --- a/src/com/sipai/quartz/job/CameraPicJob.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.quartz.job; - -import java.io.*; -import java.net.HttpURLConnection; -import java.net.URL; -import java.text.ParseException; -import java.util.List; -import java.util.Properties; - -import com.sipai.entity.work.Camera; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommUtil; -import org.springframework.beans.factory.annotation.Autowired; - -public class CameraPicJob { - @Autowired - private CameraService cameraService; - - String url = ""; - - { - try { - url = new CommUtil().getProperties("camera.properties", "url"); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void execute() throws ParseException { - List cameraList = this.cameraService.selectListByWhere(" where active='1' and issavepic='1' "); - - if (cameraList != null && cameraList.size() > 0) { - for (Camera camera : - cameraList) { - if (camera.getIssavepic() != null && camera.getSavepicnum() != null) { - if (!camera.getSavepicnum().equals("")) { - int savePicSt = 1; - if (camera.getSavepicst() != null) { - savePicSt = Integer.valueOf(camera.getSavepicst()); - } - - int savePicNum = Integer.valueOf(camera.getSavepicnum()); - float st = (float) savePicSt / (float) savePicNum; -// System.out.println(st); - if (st >= 1) { - System.out.println(camera.getName() + ":抓拍"); - this.cameraService.savePicFromCameraSys(camera,"","sys"); - - savePicSt = 1; - } else { - savePicSt++; - } -// System.out.println(savePicSt); -// System.out.println("==="); - camera.setSavepicst(String.valueOf(savePicSt)); - this.cameraService.update(camera); -// int nowSavePicSt = - - } - } - } - } - - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/DataCleaningJob.java b/src/com/sipai/quartz/job/DataCleaningJob.java deleted file mode 100644 index dc00fdff..00000000 --- a/src/com/sipai/quartz/job/DataCleaningJob.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.data.DataCleaningCondition; -import com.sipai.entity.data.DataCleaningConfigure; -import com.sipai.entity.data.DataCleaningHistory; -import com.sipai.entity.data.DataCleaningPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.data.DataCleaningConditionService; -import com.sipai.service.data.DataCleaningConfigureService; -import com.sipai.service.data.DataCleaningHistoryService; -import com.sipai.service.data.DataCleaningPointService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.math.BigDecimal; -import java.sql.SQLOutput; -import java.text.ParseException; -import java.util.List; -import javax.annotation.Resource; - -/** - * 数据清洗 - */ -public class DataCleaningJob { - public MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - public DataCleaningConditionService dataCleaningConditionService = (DataCleaningConditionService) SpringContextUtil.getBean("dataCleaningConditionService"); - public DataCleaningConfigureService dataCleaningConfigureService = (DataCleaningConfigureService) SpringContextUtil.getBean("dataCleaningConfigureService"); - public DataCleaningPointService dataCleaningPointService = (DataCleaningPointService) SpringContextUtil.getBean("dataCleaningPointService"); - public DataCleaningHistoryService dataCleaningHistoryService = (DataCleaningHistoryService) SpringContextUtil.getBean("dataCleaningHistoryService"); - - public void save(ScheduleJob scheduleJob) { - System.out.println("数据清洗开始:" + CommUtil.nowDate()); - String nowTime = CommUtil.nowDate(); - -// List configureList = this.dataCleaningConfigureService.selectListByWhere(" where 1=1"); -// if (configureList != null && configureList.size() > 0) { -// String timeRange = configureList.get(0).getTimerange(); -// String replaceType = configureList.get(0).getReplacetype(); - - List pointList = this.dataCleaningPointService.selectListByWhere(" where 1=1 "); - if (pointList != null && pointList.size() > 0) { - for (DataCleaningPoint dataCleaningPoint : - pointList) { - List conditionList = this.dataCleaningConditionService.selectListByWhere(" where pid='" + dataCleaningPoint.getId() + "' "); - if (conditionList != null && conditionList.size() > 0) { - String timeRange = dataCleaningPoint.getTimerange(); - String replaceType = dataCleaningPoint.getReplacetype(); - String point = dataCleaningPoint.getPoint(); - String unitId = dataCleaningPoint.getUnitid(); - String cleaningTime = CommUtil.subplus(nowTime, "-" + timeRange, "day"); - - String wherestr = " where 1=1 and datediff(day,MeasureDT,'" + cleaningTime + "')=0 "; - String reverseWherestr = " where 1=1 and datediff(day,MeasureDT,'" + cleaningTime + "')=0 "; - for (int i = 0; i < conditionList.size(); i++) { - DataCleaningCondition dataCleaningCondition = conditionList.get(i); - if (replaceType.equals(DataCleaningConfigure.ReplaceType_avg) || replaceType.equals(DataCleaningConfigure.ReplaceType_max) || replaceType.equals(DataCleaningConfigure.ReplaceType_min)) {//用于获取均值替换值符合条件的范围 - String jstype = ""; - if (dataCleaningCondition.getJstype().equals(">")) { - jstype = "<="; - } else if (dataCleaningCondition.getJstype().equals(">=")) { - jstype = "<"; - } else if (dataCleaningCondition.getJstype().equals("=")) { - jstype = "!="; - } else if (dataCleaningCondition.getJstype().equals("<")) { - jstype = ">="; - } else if (dataCleaningCondition.getJstype().equals("<=")) { - jstype = ">"; - } - reverseWherestr += " and ParmValue" + jstype + "" + dataCleaningCondition.getJsvalue() + " "; - } - - if (conditionList.size() == 1) { - wherestr += " and ParmValue" + dataCleaningCondition.getJstype() + "" + dataCleaningCondition.getJsvalue() + " "; - } else { - if (i == 0) { - wherestr += " and (ParmValue" + dataCleaningCondition.getJstype() + "" + dataCleaningCondition.getJsvalue() + " "; - } else if (i == (conditionList.size() - 1)) { - wherestr += " or ParmValue" + dataCleaningCondition.getJstype() + "" + dataCleaningCondition.getJsvalue() + ") "; - } else { - wherestr += " or ParmValue" + dataCleaningCondition.getJstype() + "" + dataCleaningCondition.getJsvalue() + " "; - } - } - - } - -// System.out.println(wherestr); - - BigDecimal replaceValue = null; - if (replaceType.equals(DataCleaningConfigure.ReplaceType_previous)) { - List mPointHistoryAvgList = this.mPointHistoryService.selectAggregateList(unitId, "tb_mp_" + point, reverseWherestr + " order by MeasureDT asc ", " top 1 ParmValue "); - if (mPointHistoryAvgList != null && mPointHistoryAvgList.size() > 0) { - if (mPointHistoryAvgList.get(0) != null) { - replaceValue = mPointHistoryAvgList.get(0).getParmvalue(); - - this.mPointHistoryService.updateByWhere(unitId, "tb_mp_" + point, "ParmValue=" + replaceValue + " ", wherestr); - - //添加留存历史记录 - List mPointHistoryList = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + point, wherestr); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - for (MPointHistory mPointHistory : - mPointHistoryList) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setId(CommUtil.getUUID()); - dataCleaningHistory.setMpid(point); - dataCleaningHistory.setParmvalue(mPointHistory.getParmvalue()); - dataCleaningHistory.setMeasuredt(mPointHistory.getMeasuredt()); - dataCleaningHistory.setReplaceparmvalue(replaceValue); - dataCleaningHistory.setCleaningdt(CommUtil.nowDate()); - dataCleaningHistory.setUnitid(unitId); - dataCleaningHistory.setType(replaceType); - - this.dataCleaningHistoryService.save(dataCleaningHistory); - } - } - - } - } - } else if (replaceType.equals(DataCleaningConfigure.ReplaceType_avg)) { - List mPointHistoryAvgList = this.mPointHistoryService.selectAggregateList(unitId, "tb_mp_" + point, reverseWherestr, " avg(ParmValue) as ParmValue "); - if (mPointHistoryAvgList != null && mPointHistoryAvgList.size() > 0) { - if (mPointHistoryAvgList.get(0) != null) { - replaceValue = mPointHistoryAvgList.get(0).getParmvalue(); - System.out.println("清洗avg前"); - this.mPointHistoryService.updateByWhere(unitId, "tb_mp_" + point, "ParmValue=" + replaceValue + " ", wherestr); - System.out.println("清洗avg后"); - //添加留存历史记录 - List mPointHistoryList = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + point, wherestr); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - for (MPointHistory mPointHistory : - mPointHistoryList) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setId(CommUtil.getUUID()); - dataCleaningHistory.setMpid(point); - dataCleaningHistory.setParmvalue(mPointHistory.getParmvalue()); - dataCleaningHistory.setMeasuredt(mPointHistory.getMeasuredt()); - dataCleaningHistory.setReplaceparmvalue(replaceValue); - dataCleaningHistory.setCleaningdt(CommUtil.nowDate()); - dataCleaningHistory.setUnitid(unitId); - dataCleaningHistory.setType(replaceType); - - this.dataCleaningHistoryService.save(dataCleaningHistory); - } - } - - } - } - } else if (replaceType.equals(DataCleaningConfigure.ReplaceType_max)) { - List mPointHistoryAvgList = this.mPointHistoryService.selectAggregateList(unitId, "tb_mp_" + point, reverseWherestr, " max(ParmValue) as ParmValue "); - if (mPointHistoryAvgList != null && mPointHistoryAvgList.size() > 0) { - if (mPointHistoryAvgList.get(0) != null) { - replaceValue = mPointHistoryAvgList.get(0).getParmvalue(); - - this.mPointHistoryService.updateByWhere(unitId, "tb_mp_" + point, "ParmValue=" + replaceValue + " ", wherestr); - - //添加留存历史记录 - List mPointHistoryList = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + point, wherestr); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - for (MPointHistory mPointHistory : - mPointHistoryList) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setId(CommUtil.getUUID()); - dataCleaningHistory.setMpid(point); - dataCleaningHistory.setParmvalue(mPointHistory.getParmvalue()); - dataCleaningHistory.setMeasuredt(mPointHistory.getMeasuredt()); - dataCleaningHistory.setReplaceparmvalue(replaceValue); - dataCleaningHistory.setCleaningdt(CommUtil.nowDate()); - dataCleaningHistory.setUnitid(unitId); - dataCleaningHistory.setType(replaceType); - - this.dataCleaningHistoryService.save(dataCleaningHistory); - } - } - - } - } - } else if (replaceType.equals(DataCleaningConfigure.ReplaceType_min)) { - List mPointHistoryAvgList = this.mPointHistoryService.selectAggregateList(unitId, "tb_mp_" + point, reverseWherestr, " min(ParmValue) as ParmValue "); - if (mPointHistoryAvgList != null && mPointHistoryAvgList.size() > 0) { - if (mPointHistoryAvgList.get(0) != null) { - replaceValue = mPointHistoryAvgList.get(0).getParmvalue(); - - this.mPointHistoryService.updateByWhere(unitId, "tb_mp_" + point, "ParmValue=" + replaceValue + " ", wherestr); - - //添加留存历史记录 - List mPointHistoryList = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + point, wherestr); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - for (MPointHistory mPointHistory : - mPointHistoryList) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setId(CommUtil.getUUID()); - dataCleaningHistory.setMpid(point); - dataCleaningHistory.setParmvalue(mPointHistory.getParmvalue()); - dataCleaningHistory.setMeasuredt(mPointHistory.getMeasuredt()); - dataCleaningHistory.setReplaceparmvalue(replaceValue); - dataCleaningHistory.setCleaningdt(CommUtil.nowDate()); - dataCleaningHistory.setUnitid(unitId); - dataCleaningHistory.setType(replaceType); - - this.dataCleaningHistoryService.save(dataCleaningHistory); - } - } - - } - } - } else if (replaceType.equals(DataCleaningConfigure.ReplaceType_none)) { - //添加留存历史记录 - List mPointHistoryList = this.mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + point, wherestr); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - for (MPointHistory mPointHistory : - mPointHistoryList) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setId(CommUtil.getUUID()); - dataCleaningHistory.setMpid(point); - dataCleaningHistory.setParmvalue(mPointHistory.getParmvalue()); - dataCleaningHistory.setMeasuredt(mPointHistory.getMeasuredt()); - dataCleaningHistory.setReplaceparmvalue(null); - dataCleaningHistory.setCleaningdt(CommUtil.nowDate()); - dataCleaningHistory.setUnitid(unitId); - dataCleaningHistory.setType(replaceType); - - this.dataCleaningHistoryService.save(dataCleaningHistory); - } - } - - this.mPointHistoryService.deleteByTableAWhere(unitId, "tb_mp_" + point, wherestr); - } else if (replaceType.equals(DataCleaningConfigure.ReplaceType_same)) { - //添加留存历史记录 - String sameWhere = wherestr + " and d.rank>1 "; - String tableString = "( SELECT * ,ROW_NUMBER() over (PARTITION BY MeasureDT order BY [ParmValue] desc) as rank FROM tb_mp_" + point + " ) d"; - - List mPointHistoryList = this.mPointHistoryService.selectAggregateList(unitId, tableString, sameWhere, " * "); - String deleteIds = ""; - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - for (MPointHistory mPointHistory : - mPointHistoryList) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setId(CommUtil.getUUID()); - dataCleaningHistory.setMpid(point); - dataCleaningHistory.setParmvalue(mPointHistory.getParmvalue()); - dataCleaningHistory.setMeasuredt(mPointHistory.getMeasuredt()); - dataCleaningHistory.setReplaceparmvalue(null); - dataCleaningHistory.setCleaningdt(CommUtil.nowDate()); - dataCleaningHistory.setUnitid(unitId); - dataCleaningHistory.setType(replaceType); - - this.dataCleaningHistoryService.save(dataCleaningHistory); - - deleteIds += mPointHistory.getItemid() + ","; - } - } - deleteIds = deleteIds.replace(",", "','"); - this.mPointHistoryService.deleteByTableAWhere(unitId, "tb_mp_" + point, " where ItemID in ('" + deleteIds + "') "); - } - - System.out.println(point + "已清洗"); - } - - } - } - -// } - - System.out.println("数据清洗结束:" + CommUtil.nowDate()); - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/DataVisualJob.java b/src/com/sipai/quartz/job/DataVisualJob.java deleted file mode 100644 index efcd3987..00000000 --- a/src/com/sipai/quartz/job/DataVisualJob.java +++ /dev/null @@ -1,488 +0,0 @@ -package com.sipai.quartz.job; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.net.HttpURLConnection; -import java.net.URL; -import java.text.ParseException; -import java.util.List; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.process.*; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.process.*; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.Mqtt; -import com.sipai.tools.MqttUtil; -import org.apache.commons.codec.binary.Base64; -import org.eclipse.paho.client.mqttv3.IMqttClient; -import org.eclipse.paho.client.mqttv3.MqttClient; -import org.eclipse.paho.client.mqttv3.MqttConnectOptions; -import org.eclipse.paho.client.mqttv3.MqttException; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - - -public class DataVisualJob { - @Autowired - private MPointService mPointService; - @Autowired - private DataVisualFrameContainerService dataVisualFrameContainerService; - @Autowired - private DataVisualContentService dataVisualContentService; - @Autowired - private DataVisualTextService dataVisualTextService; - @Autowired - private DataVisualFormService dataVisualFormService; - @Autowired - private DataVisualMPointService dataVisualMPointService; - @Autowired - private DataVisualTabService dataVisualTabService; - @Autowired - private DataVisualPercentChartService dataVisualPercentChartService; - @Autowired - private DataVisualMpViewService dataVisualMpViewService; - - - int num = 0; - - public void execute() throws ParseException { -// System.out.println(num); - if (num == 0) { - try { - Thread.sleep(60000);//1分钟 - System.out.println("InDataVisualJob" + CommUtil.nowDate()); - num++; - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - System.out.println("可视化定时器刷新功能" + CommUtil.nowDate()); - - //1.获取所有like dataVisual_consumer 的数据 (dataVisual_consumer_emp01(人员id)_dp1(大屏id)_uuid(随机数)) - String frameIdss = ""; - try { - String line = null; - String httpUrl = new CommUtil().getProperties("mqtt.properties", "mqtt.host_http"); - String userName = new CommUtil().getProperties("mqtt.properties", "mqtt.username_dashboard"); - String password = new CommUtil().getProperties("mqtt.properties", "mqtt.password_dashboard"); - URL url = new URL(httpUrl + "/api/v4/nodes/emqx@10.25.13.14/clients?_like_clientid=dataVisual_consumer&_=" + CommUtil.getUUID());//模糊查询的api - Base64 b = new Base64(); - String encoding = b.encodeAsString(new String(userName + ":" + password).getBytes()); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setDoOutput(true); - connection.setRequestProperty("Content-Type", "application/json"); - connection.setRequestProperty("Authorization", "Basic " + encoding); - InputStream content = (InputStream) connection.getInputStream(); - BufferedReader in = new BufferedReader(new InputStreamReader(content)); - - while ((line = in.readLine()) != null) { - JSONObject jsonObject = JSONObject.parseObject(line); - if (jsonObject.get("data") != null && jsonObject.get("data") != "") { - if (jsonObject.get("data").toString().equals("[]")) { - //不存在 - } else { - //存在 - net.sf.json.JSONArray cjSONArray = net.sf.json.JSONArray.fromObject(jsonObject.get("data").toString()); -// System.out.println(cjSONArray); - for (int i = 0; i < cjSONArray.size(); i++) { -// System.out.println(cjSONArray.getJSONObject(i).get("clientid")); - String[] clientids = cjSONArray.getJSONObject(i).get("clientid").toString().split("_"); - if (frameIdss.indexOf(clientids[3]) == -1) { - frameIdss += clientids[2] + ","; - } - } - - } - } else { - //不存在 - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - try { -// System.out.println("当前可视化打开ids:"+frameIdss); - if (!frameIdss.equals("")) { - String[] frameIds = frameIdss.split(","); -// System.out.println(frameIds); - for (String frameId : - frameIds) { - //2.通过画面id查询该id下所有数据 - JSONArray jsonArray = new JSONArray(); - - List FList = this.dataVisualFrameContainerService.selectListByWhere(" where frameId='" + frameId + "' and type='" + DataVisualFrameContainer.Type_column + "' "); - if (FList != null && FList.size() > 0) { - for (DataVisualFrameContainer fc : - FList) { - List clist = this.dataVisualContentService.selectListByWhere("where 1=1 and (type='" + DataVisualContent.Type_Text + "' or type='" + DataVisualContent.Type_Form + "'" + - " or type='" + DataVisualContent.Type_SignalPoint + "' or type='" + DataVisualContent.Type_DataPoint + "' or type='" + DataVisualContent.Type_Tab + "' or type='" + DataVisualContent.Type_PercentChart + "' " + - " or type='" + DataVisualContent.Type_DateSelect + "' or type='" + DataVisualContent.Type_MpView + "') " + - "and pid='" + fc.getId() + "' order by type,roundTimeContent "); - if (clist != null && clist.size() > 0) { - for (int i = 0; i < clist.size(); i++) { - DataVisualContent content = clist.get(i); - if (i == 0 && content.getType().equals(DataVisualContent.Type_DateSelect)) {//含日期选择组件的不自动刷新 - - } else { - getData(content, fc.getId(), jsonArray); -// jsonArray = joinJSONArray(jsonArray, getData(content, fc.getId(), jsonArray)); -// jsonArray.add(getData(content, fc.getId())); -// JSONObject jsonObject = new JSONObject(); -// jsonObject = getData(content, fc.getId()); -// if (jsonObject.size() > 0) { -// jsonArray.add(jsonObject); -// } - } - - } - } - - - } - } - -// System.out.println("dataVisualData_" + frameId + ":"+"-time:"+CommUtil.nowDate()+":" + jsonArray); - //3.向dataVisualData_画面id推送数据 - MqttUtil.publish(jsonArray, "dataVisualData_" + frameId); - - } - - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } - - - public JSONArray getData(DataVisualContent content, String topContentId, JSONArray jsonArray) { -// JSONArray jsonArray = new JSONArray(); - - if (content.getType().equals(DataVisualContent.Type_Tab)) { - List dlist = this.dataVisualTabService.selectListByWhere(" where pid='" + content.getId() + "' order by morder "); - if (dlist != null && dlist.size() > 0) { - for (DataVisualTab dataVisualTab : - dlist) { - List clist = this.dataVisualContentService.selectListByWhere("where 1=1 and pid='" + dataVisualTab.getId() + "' order by type,roundTimeContent "); - for (DataVisualContent contentT : - clist) { - getData(contentT, topContentId, jsonArray); -// jsonArray = joinJSONArray(jsonArray, getData(contentT, topContentId, jsonArray)); - } - - } - } - } else if (content.getType().equals(DataVisualContent.Type_Text)) {//文本 - List dlist = this.dataVisualTextService.selectListByWhere(" where pid='" + content.getId() + "'"); - if (dlist.get(0).getMpid() != null && dlist.get(0).getMpid().length() > 0) { - MPoint mPoint = this.mPointService.selectById(dlist.get(0).getMpid()); - if (mPoint != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", content.getId()); - - String sv = ""; - BigDecimal bv = null; - //系数计算 - if (dlist.get(0).getRate() != null && !dlist.get(0).getRate().equals("")) { - String rate = dlist.get(0).getRate(); - if ("+-*/".indexOf(dlist.get(0).getRate().substring(0, 1)) == -1) { - rate = "*" + rate; - } - String v = mPoint.getParmvalue() + rate; - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine SE = manager.getEngineByName("js"); - try { - String sov = SE.eval(v).toString(); - bv = new BigDecimal(sov); - } catch (ScriptException e) { - e.printStackTrace(); - } - - } else { - bv = mPoint.getParmvalue(); - } - //前台配的小数位 - if (dlist.get(0).getNumtail() != null && !dlist.get(0).getNumtail().equals("")) { - bv = CommUtil.formatMPointValue(bv, dlist.get(0).getNumtail(), mPoint.getRate()); - } else { - bv = CommUtil.formatMPointValue(bv, mPoint.getNumtail(), mPoint.getRate()); - } - //是否显示单位 - if (dlist.get(0).getUnitst() != null && dlist.get(0).getUnitst().equals("true")) { - sv = bv + mPoint.getUnit(); - } else { - sv = bv + ""; - } - - jsonObject.put("value", sv); - jsonObject.put("type", DataVisualContent.Type_Text); - jsonArray.add(jsonObject); - } - } - } else if (content.getType().equals(DataVisualContent.Type_Form)) { - List gfrList = this.dataVisualFormService.selectListByWhere(" where pid='" + content.getId() + "' and type='" + DataVisualForm.Type_row + "' order by insertRow"); - for (DataVisualForm gfr : - gfrList) { - List gfcList = this.dataVisualFormService.selectListByWhere(" where pid='" + gfr.getId() + "' and type='" + DataVisualForm.Type_column + "' order by insertColumn"); - for (DataVisualForm gfc : - gfcList) { - if (gfc.getMpid() != null && gfc.getMpid().length() > 0) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", gfc.getId()); - jsonObject.put("type", DataVisualContent.Type_Form); - - String sv = ""; - - String timeframe = "none"; - if (gfc.getTimeframe() != null && gfc.getTimeframe().length() > 0) { - timeframe = gfc.getTimeframe(); - } - if (!timeframe.equals("none")) { - String nowTime = CommUtil.nowDate(); - String lsdt = ""; - String ledt = nowTime; - if (timeframe.equals("hour")) { - lsdt = CommUtil.subplus(nowTime, "-1", "hour"); - } else if (timeframe.equals("nowday")) { - lsdt = nowTime.substring(0, 10) + " 00:00:00"; - } else if (timeframe.equals("yesterday")) { - lsdt = CommUtil.subplus(nowTime, "-1", "day").substring(0, 10) + " 00:00:00"; - ledt = CommUtil.subplus(nowTime, "-1", "day").substring(0, 10) + " 23:59:59"; - } else if (timeframe.equals("week")) { - lsdt = CommUtil.subplus(nowTime, "-7", "day"); - } else if (timeframe.equals("month")) { -// lsdt = CommUtil.subplus(nowTime, "-1", "month"); - lsdt = nowTime.substring(0, 7) + "-01"; - } else if (timeframe.equals("year")) { -// lsdt = CommUtil.subplus(nowTime, "-1", "year"); - lsdt = nowTime.substring(0, 4) + "-01-01"; - } else if (timeframe.equals("3year")) { - lsdt = CommUtil.subplus(nowTime, "-3", "year"); - } - MPoint mPoint = this.dataVisualContentService.getMpointJsonForEXAndDV(gfc.getMpid(), gfc.getValuemethod(), lsdt, ledt); - - if (mPoint != null) { - BigDecimal bv = null; - //系数计算 - if (gfc.getRate() != null && !gfc.getRate().equals("")) { - String rate = gfc.getRate(); - if ("+-*/".indexOf(gfc.getRate().substring(0, 1)) == -1) { - rate = "*" + rate; - } - String v = mPoint.getParmvalue() + rate; - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine SE = manager.getEngineByName("js"); - try { - String sov = SE.eval(v).toString(); - bv = new BigDecimal(sov); - } catch (ScriptException e) { - e.printStackTrace(); - } - - } else { - bv = mPoint.getParmvalue(); - } - //前台配的小数位 - if (gfc.getNumtail() != null && !gfc.getNumtail().equals("")) { - bv = CommUtil.formatMPointValue(bv, gfc.getNumtail(), mPoint.getRate()); - } else { - bv = CommUtil.formatMPointValue(bv, mPoint.getNumtail(), mPoint.getRate()); - } - sv = bv + ""; - } - } else { - MPoint mPoint = this.mPointService.selectById(gfc.getMpid()); - if (mPoint != null) { - if (gfc.getTimest() != null && !gfc.getTimest().equals("") && gfc.getTimest().equals("true")) { - String timestnum = ""; - if (gfc.getTimestnum() != null && !gfc.getTimestnum().equals("")) { - if (gfc.getTimestnum().indexOf(",") >= 0) { - timestnum = gfc.getTimestnum(); - } else { - timestnum = "0," + gfc.getTimestnum(); - } - String[] timestnumS = timestnum.split(","); - sv = mPoint.getMeasuredt().substring(Integer.valueOf(timestnumS[0]), Integer.valueOf(timestnumS[1])); - } - } else { - BigDecimal bv = null; - //系数计算 - if (gfc.getRate() != null && !gfc.getRate().equals("")) { - String rate = gfc.getRate(); - if ("+-*/".indexOf(gfc.getRate().substring(0, 1)) == -1) { - rate = "*" + rate; - } - String v = mPoint.getParmvalue() + rate; - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine SE = manager.getEngineByName("js"); - try { - String sov = SE.eval(v).toString(); - bv = new BigDecimal(sov); - } catch (ScriptException e) { - e.printStackTrace(); - } - - } else { - bv = mPoint.getParmvalue(); - } - //前台配的小数位 - if (gfc.getNumtail() != null && !gfc.getNumtail().equals("")) { - bv = CommUtil.formatMPointValue(bv, gfc.getNumtail(), mPoint.getRate()); - } else { - bv = CommUtil.formatMPointValue(bv, mPoint.getNumtail(), mPoint.getRate()); - } - sv = bv + ""; - } - - } - } - - jsonObject.put("value", sv); - jsonArray.add(jsonObject); - - } - } - } - } else if (content.getType().equals(DataVisualContent.Type_SignalPoint)) { - List dlist = this.dataVisualMPointService.selectListByWhere(" where pid='" + content.getId() + "'"); - if (dlist != null && dlist.size() > 0) { - for (DataVisualMPoint dataVisualMPoint : - dlist) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", content.getId()); - jsonObject.put("cid", topContentId); - jsonObject.put("showData", dlist.get(0)); - jsonObject.put("content", content); -// jsonObject.put("value", dataVisualMPoint.getmPoint().getParmvalue().toString()); - jsonObject.put("type", DataVisualContent.Type_SignalPoint); - jsonArray.add(jsonObject); - } - } - - } else if (content.getType().equals(DataVisualContent.Type_DataPoint)) { - List dlist = this.dataVisualMPointService.selectListByWhere(" where pid='" + content.getId() + "'"); - if (dlist != null && dlist.size() > 0) { - for (DataVisualMPoint dataVisualMPoint : - dlist) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", content.getId()); - jsonObject.put("cid", topContentId); - jsonObject.put("showData", dlist.get(0)); - jsonObject.put("content", content); -// jsonObject.put("value", dataVisualMPoint.getmPoint().getParmvalue().toString()); - jsonObject.put("type", DataVisualContent.Type_DataPoint); - jsonArray.add(jsonObject); - } - } - - } else if (content.getType().equals(DataVisualContent.Type_PercentChart)) { - List dlist = this.dataVisualPercentChartService.selectListByWhere(" where pid='" + content.getId() + "'"); - if (dlist != null && dlist.size() > 0) { - for (DataVisualPercentChart dataVisualPercentChart : - dlist) { - if (dataVisualPercentChart.getMpid() != null && dataVisualPercentChart.getMpid().length() > 0) { - String mpid = dataVisualPercentChart.getMpid(); - MPoint mPoint = this.mPointService.selectById(mpid); - if (mPoint != null) { - BigDecimal bv = null; - if (dataVisualPercentChart.getNumtail() != null && !dataVisualPercentChart.getNumtail().equals("")) { - bv = CommUtil.formatMPointValue(mPoint.getParmvalue(), dataVisualPercentChart.getNumtail(), mPoint.getRate()); - } else { - bv = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - } - dataVisualPercentChart.setShowData(bv + ""); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", content.getId()); - jsonObject.put("cid", topContentId); - jsonObject.put("showData", dataVisualPercentChart); - jsonObject.put("content", content); -// jsonObject.put("value", bv+""); - jsonObject.put("type", DataVisualContent.Type_PercentChart); - jsonArray.add(jsonObject); - } - } - } - } - - } else if (content.getType().equals(DataVisualContent.Type_MpView)) { - List dlist = this.dataVisualMpViewService.selectListByWhere(" where pid='" + content.getId() + "' order by morder "); - if (dlist != null && dlist.size() > 0) { - for (DataVisualMpView dataVisualMpView : - dlist) { - String mpid = dataVisualMpView.getMpid(); - MPoint mPoint = this.mPointService.selectById(mpid); - if (mPoint != null) { - dataVisualMpView.setMpValue(String.valueOf(mPoint.getParmvalue())); - } - - if (dataVisualMpView.getJsmpid() != null && dataVisualMpView.getJsmpid().length() > 0) { - MPoint jmPoint = this.mPointService.selectById(dataVisualMpView.getJsmpid()); - if (jmPoint != null) { - dataVisualMpView.setJsmpValue(String.valueOf(jmPoint.getParmvalue())); - } - } - - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", content.getId()); - jsonObject.put("cid", topContentId); - jsonObject.put("showData", dlist); - jsonObject.put("content", content); -// jsonObject.put("value", bv+""); - jsonObject.put("type", DataVisualContent.Type_MpView); - jsonArray.add(jsonObject); - } - } - - return jsonArray; - } - - - private static JSONArray joinJSONArray(JSONArray array1, JSONArray array2) { - StringBuffer sbf = new StringBuffer(); - JSONArray jSONArray = new JSONArray(); - try { - int len = array1.size(); - for (int i = 0; i < len; i++) { - JSONObject obj1 = (JSONObject) array1.get(i); - if (i == len - 1) - sbf.append(obj1.toString()); - else - sbf.append(obj1.toString()).append(","); - } - len = array2.size(); - if (len > 0) - sbf.append(","); - for (int i = 0; i < len; i++) { - JSONObject obj2 = (JSONObject) array2.get(i); - if (i == len - 1) - sbf.append(obj2.toString()); - else - sbf.append(obj2.toString()).append(","); - } - - sbf.insert(0, "[").append("]"); - jSONArray = jSONArray.parseArray(sbf.toString()); - return jSONArray; - } catch (Exception e) { - } - return null; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/DataVisualTopic_Job.java b/src/com/sipai/quartz/job/DataVisualTopic_Job.java deleted file mode 100644 index c954dd5d..00000000 --- a/src/com/sipai/quartz/job/DataVisualTopic_Job.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.process.DataVisualFrameService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MqttUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.batik.svggen.font.table.GsubTable; -import org.redisson.api.RBatch; -import org.redisson.api.RMapCache; -import org.redisson.api.RedissonClient; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * websocket推送数据给三维(通用接口) - * sj 2023-04-26 - */ -public class DataVisualTopic_Job { - DataVisualFrameService dataVisualFrameService = (DataVisualFrameService) SpringContextUtil.getBean("dataVisualFrameService"); - RedissonClient redissonClient = (RedissonClient) SpringContextUtil.getBean("redissonClient"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - - /** - * 缓存可视化页面和点位的关联关系 - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { -// System.out.println("DataVisualTopic_Job === fun1 === " + CommUtil.nowDate()); - RMapCache map_redis = redissonClient.getMapCache(CommString.REDIS_KEY_TYPE_VisualTipic); - String res = this.dataVisualFrameService.getFrameContentToMqtt("largeScreen", ""); - JSONArray jsonArray = JSONArray.parseArray(res); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = (JSONObject) jsonArray.get(i); - JSONArray jsonArray_data = (JSONArray) jsonObject.get("data"); - map_redis.put(jsonObject.get("frameId").toString(), jsonArray_data); - } - } - } - - /** - * 数据推送 - * - * @param scheduleJob - */ - public void fun2(ScheduleJob scheduleJob) { - String unitId = "021SHSB"; -// System.out.println("DataVisualTopic_Job === fun2 === " + CommUtil.nowDate()); - RMapCache map_redis = redissonClient.getMapCache(CommString.REDIS_KEY_TYPE_VisualTipic); - - String fid = scheduleJob.getParams(); - System.out.println(fid); - - if (map_redis != null && map_redis.size() > 0) { - for (String key : map_redis.keySet()) { -// scheduleJob.getParams(); 这里根据key(画面id判断) -// System.out.println(key); - if(fid.equals(key)){ - - JSONArray jsonArray_topic = new JSONArray(); - - JSONArray jsonArray = map_redis.get(key); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = (JSONObject) jsonArray.get(i); - - if (jsonObject.get("type").equals("MpView")) { - if (jsonObject.get("mpid") != null && !jsonObject.get("mpid").equals("")) { - String[] ids = jsonObject.get("mpid").toString().split(","); - for (String s : ids) { - int hashCode = s.hashCode(); - int num = hashCode % 25; - RMapCache map_redis_data = redissonClient.getMapCache(CommString.RedisMpointFlag + num); - if (map_redis_data.get(s) != null && !map_redis_data.get(s).equals("")) { - String[] str = map_redis_data.get(s).split(";"); - if (str != null && str.length >= 3 && str[1] != null && !str[1].equals("null")) { - jsonObject.put(s, str[1]); - jsonObject.remove("mpid"); - jsonObject.put("st", "true"); -// System.out.println(jsonObject); - }else{ - jsonObject.put("st", "false"); - } -// jsonArray_topic.add(jsonObject); - }else{ - jsonObject.put("st", "false"); - } - } - jsonArray_topic.add(jsonObject); - } - }else if (jsonObject.get("type").equals("AI")) { - String id = jsonObject.get("mpid").toString(); - int hashCode = id.hashCode(); - int num = hashCode % 25; - RMapCache map_redis_data = redissonClient.getMapCache(CommString.RedisMpointFlag + num); - if (map_redis_data.get(id) != null && !map_redis_data.get(id).equals("")) { - String[] str = map_redis_data.get(id).split(";"); - if (str != null && str.length >= 3 && str[0] != null && !str[0].equals("null")) { - jsonObject.put("parmvalue", str[0]); - jsonArray_topic.add(jsonObject); - } - - } - } else { - String id = jsonObject.get("mpid").toString(); - int hashCode = id.hashCode(); - int num = hashCode % 25; - RMapCache map_redis_data = redissonClient.getMapCache(CommString.RedisMpointFlag + num); - if (map_redis_data.get(id) != null && !map_redis_data.get(id).equals("")) { - String[] str = map_redis_data.get(id).split(";"); - if (str != null && str.length >= 3 && str[1] != null && !str[1].equals("null")) { - jsonObject.put("parmvalue", str[1]); - jsonArray_topic.add(jsonObject); - } - - } - } - - } - } - -// System.out.println(unitId +"_"+ key + "_dataVisual" +"~~~~~~~"+ jsonArray_topic); - MqttUtil.publish(jsonArray_topic, unitId + "_" + key + "_dataVisual"); - } - } - } - } - - /** - * 测试(可删除) - * - * @param scheduleJob - */ - public void fun3(ScheduleJob scheduleJob) { - System.out.println("DataVisualTopic_Job === fun3 === " + CommUtil.nowDate()); - List list = mPointService.selectListByWhere("021SHSB", "where 1=1"); - RBatch batch = redissonClient.createBatch(); - for (MPoint mPoint : list) { - int hashCode = mPoint.getId().hashCode(); - int num = hashCode % 25; - String val = ""; - if(mPoint.getParmvalue()!=null){ - if (mPoint.getNumtail() != null && !mPoint.getNumtail().equals("")) { - val = mPoint.getParmvalue().setScale(Integer.parseInt(mPoint.getNumtail()), BigDecimal.ROUND_HALF_UP) + ";" + mPoint.getParmvalue() + ";" + CommUtil.nowDate(); - } else { - val = mPoint.getParmvalue().setScale(0, BigDecimal.ROUND_HALF_UP) + ";" + mPoint.getParmvalue() + ";" + CommUtil.nowDate(); - } - } - batch.getMapCache(CommString.RedisMpointFlag + num).fastPutAsync(mPoint.getId(), val, 1, TimeUnit.DAYS); - } - batch.execute(); - } - -} diff --git a/src/com/sipai/quartz/job/EquipmentPointDataJob.java b/src/com/sipai/quartz/job/EquipmentPointDataJob.java deleted file mode 100644 index 4f200a73..00000000 --- a/src/com/sipai/quartz/job/EquipmentPointDataJob.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 设备类相关点位的定时计算并存表 - */ -public class EquipmentPointDataJob { - - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - CompanyService companyService = (CompanyService) SpringContextUtil.getBean("companyService"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("设备点位数据------s------" + CommUtil.nowDate()); - List list = companyService.selectListByWhere("where 1=1 "); - for (Company company : list) { - - //月度设备完好率(按故障时间) - double rate_all_time_whl = equipmentCardService.getIntactRate4Time(company.getId(), "0", CommUtil.nowDate().substring(0, 7)); - save(company.getId() + "_SBWHL_MONTH", rate_all_time_whl, company.getId()); - save_his(company.getId() + "_SBWHL_MONTH", rate_all_time_whl, company.getId()); - - //月度设备完好率-主要设备(按故障时间) - double rate_finish_time_whl = equipmentCardService.getIntactRate4Time(company.getId(), "1", CommUtil.nowDate().substring(0, 7)); - save(company.getId() + "_ZYSBWHL_MONTH", rate_finish_time_whl, company.getId()); - save_his(company.getId() + "_ZYSBWHL_MONTH", rate_finish_time_whl, company.getId()); - - //月度设备完好率(按故障台数) - double rate_all_ts_whl = equipmentCardService.getIntactRate4TS(company.getId(), "0", CommUtil.nowDate().substring(0, 7)); - save(company.getId() + "_SBWHL_TS_MONTH", rate_all_ts_whl, company.getId()); - save_his(company.getId() + "_SBWHL_TS_MONTH", rate_all_ts_whl, company.getId()); - - //月度设备完好率-主要设备(按故障台数) - double rate_finish_ts_whl = equipmentCardService.getIntactRate4TS(company.getId(), "1", CommUtil.nowDate().substring(0, 7)); - save(company.getId() + "_ZYSBWHL_TS_MONTH", rate_finish_ts_whl, company.getId()); - save_his(company.getId() + "_ZYSBWHL_TS_MONTH", rate_finish_ts_whl, company.getId()); - - //月度保养完成率 - double rate3 = equipmentCardService.getWorkOrderCompletionRate(company.getId(), WorkorderDetail.MAINTAIN); - save(company.getId() + "_BYWCL_MONTH", rate3, company.getId()); - save_his(company.getId() + "_BYWCL_MONTH", rate3, company.getId()); - - //月度维修次数 - double rate4 = equipmentCardService.getRepairCount4Class2(company.getId(), "机械类"); - save(company.getId() + "_JXSBWSCS_MONTH", rate4, company.getId()); - save_his(company.getId() + "_JXSBWSCS_MONTH", rate4, company.getId()); - - //月度维修次数 - double rate5 = equipmentCardService.getRepairCount4Class2(company.getId(), "电气类"); - save(company.getId() + "_DQSBWSCS_MONTH", rate5, company.getId()); - save_his(company.getId() + "_DQSBWSCS_MONTH", rate5, company.getId()); - - //月度维修次数 - double rate6 = equipmentCardService.getRepairCount4Class2(company.getId(), "化验类"); - save(company.getId() + "_HYSBWSCS_MONTH", rate6, company.getId()); - save_his(company.getId() + "_HYSBWSCS_MONTH", rate6, company.getId()); - - //月度维修次数 - double rate7 = equipmentCardService.getRepairCount4Class2(company.getId(), "自动化类"); - save(company.getId() + "_ZDHSBWSCS_MONTH", rate7, company.getId()); - save_his(company.getId() + "_ZDHSBWSCS_MONTH", rate7, company.getId()); - - //月度维修次数 - double rate14 = equipmentCardService.getRepairCount4Class2(company.getId(), "计算机类"); - save(company.getId() + "_JSJSBWSCS_MONTH", rate14, company.getId()); - save_his(company.getId() + "_JSJSBWSCS_MONTH", rate14, company.getId()); - - //月度维修次数 - double rate15 = equipmentCardService.getRepairCount4Class2(company.getId(), "其他"); - save(company.getId() + "_QTSBWSCS_MONTH", rate15, company.getId()); - save_his(company.getId() + "_QTSBWSCS_MONTH", rate15, company.getId()); - - //月度巡检完成率 - double rate8 = equipmentCardService.getPatrolRecordCompletionRate(company.getId(), "P"); - save(company.getId() + "_XJWCL_MONTH", rate8, company.getId()); - save_his(company.getId() + "_XJWCL_MONTH", rate8, company.getId()); - - double rate11 = equipmentCardService.getWorkOrderCompletionRate(company.getId(), WorkorderDetail.REPAIR); - save(company.getId() + "_WXWCL_MONTH", rate11, company.getId()); - save_his(company.getId() + "_WXWCL_MONTH", rate11, company.getId()); - - /** - * 工单总数 - */ - //月度运行巡检 - int rate9 = equipmentCardService.getPatrolRecordCount(company.getId(), "P", "1", "", ""); - save(company.getId() + "_YXGDZS_MONTH", rate9, company.getId()); - save_his(company.getId() + "_YXGDZS_MONTH", rate9, company.getId()); - //月度设备巡检 - int rate9_e = equipmentCardService.getPatrolRecordCount(company.getId(), "E", "1", "", ""); - save(company.getId() + "_SBGDZS_MONTH", rate9_e, company.getId()); - save_his(company.getId() + "_SBGDZS_MONTH", rate9_e, company.getId()); - //月度维修工单 - int rate_all_wx = equipmentCardService.getRepairCount(company.getId(), "1", "", "", WorkorderDetail.REPAIR); - save(company.getId() + "_WXGDZS_MONTH", rate_all_wx, company.getId()); - save_his(company.getId() + "_WXGDZS_MONTH", rate_all_wx, company.getId()); - //月度保养工单 - int rate_all_by = equipmentCardService.getRepairCount(company.getId(), "1", "", "", WorkorderDetail.MAINTAIN); - save(company.getId() + "_BYGDZS_MONTH", rate_all_by, company.getId()); - save_his(company.getId() + "_BYGDZS_MONTH", rate_all_by, company.getId()); - //月度工单(运行+维修+保养) - save(company.getId() + "_GDZS_MONTH", rate9 + rate_all_wx + rate_all_by, company.getId()); - save_his(company.getId() + "_GDZS_MONTH", rate9 + rate_all_wx + rate_all_by, company.getId()); - - - /** - * 工单完成数 - */ - //月度运行巡检 - int rate10 = equipmentCardService.getPatrolRecordCount(company.getId(), "P", "0", "", ""); - save(company.getId() + "_YXGDWCS_MONTH", rate10, company.getId()); - save_his(company.getId() + "_YXGDWCS_MONTH", rate10, company.getId()); - //月度设备巡检 - int rate10_e = equipmentCardService.getPatrolRecordCount(company.getId(), "E", "0", "", ""); - save(company.getId() + "_SBGDWCS_MONTH", rate10_e, company.getId()); - save_his(company.getId() + "_SBGDWCS_MONTH", rate10_e, company.getId()); - //月度维修工单 - int rate_finish_wx = equipmentCardService.getRepairCount(company.getId(), "0", "", "", WorkorderDetail.REPAIR); - save(company.getId() + "_WXGDWCS_MONTH", rate_finish_wx, company.getId()); - save_his(company.getId() + "_WXGDWCS_MONTH", rate_finish_wx, company.getId()); - //月度保养工单 - int rate_finish_by = equipmentCardService.getRepairCount(company.getId(), "0", "", "", WorkorderDetail.MAINTAIN); - save(company.getId() + "_BYGDWCS_MONTH", rate_finish_by, company.getId()); - save_his(company.getId() + "_BYGDWCS_MONTH", rate_finish_by, company.getId()); - //月度工单(运行+维修+保养) - save(company.getId() + "_GDWCS_MONTH", rate10 + rate_finish_wx + rate_finish_by, company.getId()); - save_his(company.getId() + "_GDWCS_MONTH", rate10 + rate_finish_wx + rate_finish_by, company.getId()); - - /** - * 维修工单未完成数 - */ - int rate_ing_wx = rate_all_wx - rate_finish_wx; - save(company.getId() + "_WXGDWWCS_MONTH", rate_ing_wx, company.getId()); - save_his(company.getId() + "_WXGDWWCS_MONTH", rate_ing_wx, company.getId()); - - /** - * 保养工单未完成数 - */ - int rate_ing_by = rate_all_by - rate_finish_by; - save(company.getId() + "_BYGDWWCS_MONTH", rate_ing_by, company.getId()); - save_his(company.getId() + "_BYGDWWCS_MONTH", rate_ing_by, company.getId()); - - /** - * 工单未完成数(运行巡检) - */ - int rate_ing_yxxj = rate9 - rate10; - save(company.getId() + "_YXGDWWCS_MONTH", rate_ing_yxxj, company.getId()); - save_his(company.getId() + "_YXGDWWCS_MONTH", rate_ing_yxxj, company.getId()); - - /** - * 工单未完成数(设备巡检) - */ - int rate_ing_sbxj = rate9_e - rate10_e; - save(company.getId() + "_SBGDWWCS_MONTH", rate_ing_sbxj, company.getId()); - save_his(company.getId() + "_SBGDWWCS_MONTH", rate_ing_sbxj, company.getId()); - - /** - * 工单未完成数(运行+维修+保养) - */ - int i = (rate9 + rate_all_wx + rate_all_by) - (rate10 + rate_finish_wx + rate_finish_by); - save(company.getId() + "_GDWWCS_MONTH", i, company.getId()); - save_his(company.getId() + "_GDWWCS_MONTH", i, company.getId()); - - /** - * 安全运行天数 (暂时从2022-01-01算起) - */ - int days = CommUtil.getDays(CommUtil.nowDate(), "2022-01-01"); - save(company.getId() + "_AQYXTS", days, company.getId()); - save_his(company.getId() + "_AQYXTS", days, company.getId()); - - /** - * 设备各类数量等(ABC类数量、在用数量等) - */ - JSONObject jsonObject = equipmentCardService.getEquipmentNumber(company.getId()); -// System.out.println(jsonObject); - //设备总数 - int equNumAll = (int) jsonObject.get("all_num"); - save(company.getId() + "_SBSL_MINUTE", equNumAll, company.getId()); - save_his(company.getId() + "_SBSL_MINUTE", equNumAll, company.getId()); - //设备数(A类) - int equNumA = (int) jsonObject.get("level_a_num"); - save(company.getId() + "_A_SBSL_MINUTE", equNumA, company.getId()); - save_his(company.getId() + "_A_SBSL_MINUTE", equNumA, company.getId()); - //设备数(B类) - int equNumB = (int) jsonObject.get("level_b_num"); - save(company.getId() + "_B_SBSL_MINUTE", equNumB, company.getId()); - save_his(company.getId() + "_B_SBSL_MINUTE", equNumB, company.getId()); - //设备数(C类) - int equNumC = (int) jsonObject.get("level_c_num"); - save(company.getId() + "_C_SBSL_MINUTE", equNumC, company.getId()); - save_his(company.getId() + "_C_SBSL_MINUTE", equNumC, company.getId()); - //设备数(在用) - int equNumZY = (int) jsonObject.get("zaiyong_num"); - save(company.getId() + "_TYSBSL_MINUTE", equNumZY, company.getId()); - save_his(company.getId() + "_TYSBSL_MINUTE", equNumZY, company.getId()); - - - } - System.out.println("设备点位数据------e------" + CommUtil.nowDate()); - } - - /** - * 更新总表 - */ - public void save(String mpId, double val, String unitId) { - try { - MPoint mPoint = mPointService.selectById(unitId, mpId); - mPoint.setParmvalue(new BigDecimal(val + "")); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(unitId, mPoint); - } catch (Exception e) { - - } - } - - /** - * 保存子表 - */ - public void save_his(String mpId, double val, String unitId) { - try { - String dt = CommUtil.nowDate().substring(0, 7) + "-01 00:00:00"; - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(val + "")); - mPointHistory.setMeasuredt(dt); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - - List list = mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "[tb_mp_" + mpId + "]", "where MeasureDT = '" + dt + "'"); - if (list != null && list.size() > 0) { - mPointHistoryService.updateByWhere(unitId, "[tb_mp_" + mpId + "]", " ParmValue = '" + val + "' ", "where MeasureDT = '" + dt + "'"); - } else { - mPointHistoryService.save(unitId, mPointHistory); - } - - } catch (Exception e) { - - } - } - -} diff --git a/src/com/sipai/quartz/job/EquipmentPointDataJob_SK.java b/src/com/sipai/quartz/job/EquipmentPointDataJob_SK.java deleted file mode 100644 index 9ea6268d..00000000 --- a/src/com/sipai/quartz/job/EquipmentPointDataJob_SK.java +++ /dev/null @@ -1,486 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 设备类相关点位的定时计算并存表(沙口现场定制的一些点位,别的项目暂时用不到) - */ -public class EquipmentPointDataJob_SK { - - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - CompanyService companyService = (CompanyService) SpringContextUtil.getBean("companyService"); - WorkorderDetailService workorderDetailService = (WorkorderDetailService) SpringContextUtil.getBean("workorderDetailService"); - AbnormityService abnormityService = (AbnormityService) SpringContextUtil.getBean("abnormityService"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("沙口特定点位数据:" + CommUtil.nowDate()); - String sdt = CommUtil.nowDate(); - List list = companyService.selectListByWhere("where 1=1 and type = 'B'"); - for (Company company : list) { - String ids = "";//符合条件的设备ids - double num = 100;//任务完成率 - long time = 0;//故障时间 - - /** - * 通用设备 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list1 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '通用设备')"); - if (list1 != null && list1.size() > 0) { - for (int i = 0; i < list1.size(); i++) { - ids += "'" + list1.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("通用设备_任务合格率:" + num); -// System.out.println("通用设备_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_TYSBYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_TYSBYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_TYSBYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_TYSBYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 气动阀、液控阀 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list2 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '气动阀' or remark = '液控阀')"); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - ids += "'" + list2.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("气动阀、液控阀_任务合格率:" + num); -// System.out.println("气动阀、液控阀_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_LCQDFZBFYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_LCQDFZBFYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_LCQDFZBFYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_LCQDFZBFYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 滤阀 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list3 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '滤阀')"); - if (list3 != null && list3.size() > 0) { - for (int i = 0; i < list3.size(); i++) { - ids += "'" + list3.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("滤阀_任务合格率:" + num); -// System.out.println("滤阀_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_TJFYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_TJFYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_TJFYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_TJFYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 水质仪表 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list4 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '水质仪表')"); - if (list4 != null && list4.size() > 0) { - for (int i = 0; i < list4.size(); i++) { - ids += "'" + list4.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } -// System.out.println("水质仪表_任务合格率:" + num); - - save("FSCCSK_KPI_SZYBYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - save_his("FSCCSK_KPI_SZYBYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - } - - /** - * 一二泵机组 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list5 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '一二泵机组')"); - if (list5 != null && list5.size() > 0) { - for (int i = 0; i < list5.size(); i++) { - ids += "'" + list5.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - //完成设备工单数 - List list1_f = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - //所有设备工单数 - List list1_all = workorderDetailService.selectSimpleListByWhere("where type='repair' and datediff(month,[insdt],'" + sdt + "')=0 and unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt.substring(0, 7) + "-01 00:00:00"; - //结束时间 - String edtTime = sdt.substring(0, 7) + "-" + maxday + " 23:59:59"; - - //计算故障时间 - for (WorkorderDetail workorderDetail : list1_all) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, s_dt, "second"); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, s_dt, "second"); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - time += CommUtil.getDays2(e_dt, sdtTime, "second"); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { - time += CommUtil.getDays2(edtTime, sdtTime, "second"); - } - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { - time += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - } - } - - long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - //总设备数 - long all_size = list1.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - time) * 1.0 / all_time * 100); - -// System.out.println("一二泵机组_任务合格率:" + num); -// System.out.println("一二泵机组_故障率:" + (100 - rateD)); - - save("FSCCSK_KPI_JBFJYXDF1A", num, company.getId(), sdtTime); - save("FSCCSK_KPI_JBFJYXDF2A", (100 - rateD), company.getId(), sdtTime); - save_his("FSCCSK_KPI_JBFJYXDF1A", num, company.getId(), sdtTime); - save_his("FSCCSK_KPI_JBFJYXDF2A", (100 - rateD), company.getId(), sdtTime); - } - - /** - * 供配电柜、变压器 - */ - ids = "";//清空 - num = 100;//还原成100 - time = 0; - List list6 = equipmentCardService.selectSimpleListByWhere("where bizid = '" + company.getId() + "' and (remark = '供配电柜、变压器')"); - if (list6 != null && list6.size() > 0) { - for (int i = 0; i < list6.size(); i++) { - ids += "'" + list6.get(i).getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - List list1_f = workorderDetailService.selectSimpleListByWhere("where unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") and (status = '" + WorkorderDetail.Status_Compete + "' or status='" + WorkorderDetail.Status_Finish + "')"); - List list1_all = workorderDetailService.selectSimpleListByWhere("where unit_id = '" + company.getId() + "' and equipment_id in (" + ids + ") "); - if (list1_all != null && list1_all.size() > 0) { - num = (Double.valueOf(list1_f.size())) / (Double.valueOf(list1_all.size())) * 100; - } else { - // 百分之百 - num = 100; - } -// System.out.println("供配电柜、变压器_任务合格率:" + num); - - save("FSCCSK_KPI_GPDGBYQYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - save_his("FSCCSK_KPI_GPDGBYQYXDF1A", num, company.getId(), sdt.substring(0, 7) + "-01 00:00:00"); - } - - } - } - - /** - * 更新总表 - */ - public void save(String mpId, double val, String unitId, String dt) { - try { - MPoint mPoint = mPointService.selectById(unitId, mpId); - mPoint.setParmvalue(new BigDecimal(val + "")); - mPoint.setMeasuredt(dt); - mPointService.update2(unitId, mPoint); - } catch (Exception e) { - - } - } - - /** - * 保存子表 - */ - public void save_his(String mpId, double val, String unitId, String dt) { - try { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(val + "")); - mPointHistory.setMeasuredt(dt); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - - List list = mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "[tb_mp_" + mpId + "]", "where MeasureDT = '" + dt + "'"); - if (list != null && list.size() > 0) { - mPointHistoryService.updateByWhere(unitId, "[tb_mp_" + mpId + "]", " ParmValue = '" + val + "' ", "where MeasureDT = '" + dt + "'"); - } else { - mPointHistoryService.save(unitId, mPointHistory); - } - - } catch (Exception e) { - - } - } - -} diff --git a/src/com/sipai/quartz/job/HJHY_DataReceive2_Job.java b/src/com/sipai/quartz/job/HJHY_DataReceive2_Job.java deleted file mode 100644 index f1f677c4..00000000 --- a/src/com/sipai/quartz/job/HJHY_DataReceive2_Job.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.eclipse.paho.client.mqttv3.*; -import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; - -import java.math.BigDecimal; - -/** - * 皇家花园 指定txt中的数据 mqtt推送出去 - */ -public class HJHY_DataReceive2_Job { - - public static String str = ""; - public static final String HOST = "tcp://61.160.236.180:1883"; - public static final String TOPIC1 = "lynkros/csj/devdata"; - private static final String clientid = "HJHY_DataReceive2_" + CommUtil.getUUID(); - private static MqttClient client; - private MqttConnectOptions options; - private String userName = "sipai"; - private String passWord = "sipai"; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - - /** - * 推送txt中的点位到mqtt - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) throws MqttException { -// System.out.println("HJHY_DataReceive_Job---------------------------------" + CommUtil.nowDate()); - start(); - } - - public void start() { - // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示, - //MemoryPersistence设置clientid的保存形式,默认为以内存保存 - try { - client = new MqttClient(HOST, clientid, new MemoryPersistence()); - // MQTT的连接设置 - options = new MqttConnectOptions(); - // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录, - //设置为true表示每次连接到服务器都以新的身份连接 - options.setCleanSession(true); - // 设置连接的用户名 - options.setUserName(userName); - // 设置连接的密码 - options.setPassword(passWord.toCharArray()); - // 设置超时时间 单位为秒 - options.setConnectionTimeout(10); - // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息 - //判断客户端是否在线,但这个方法并没有重连的机制 - options.setKeepAliveInterval(20); - // 设置回调 - client.setCallback(new MqttCallback() { - public void connectionLost(Throwable cause) { - // 连接丢失后,一般在这里面进行重连, -// System.out.println("连接断开,可以做重连,只是简单处理:10秒后重连"); -// try { -// Thread.sleep(10 * 1000); -// start(); -// } catch (Exception e) { -// e.printStackTrace(); -// } - } - - public void deliveryComplete(IMqttDeliveryToken token) { - System.out.println("deliveryComplete---------" + token.isComplete()); - } - - public void messageArrived(String topic, MqttMessage message) { - try { - str = message.toString(); -// System.out.println("从服务器收到的消息为:" + message.toString()); - - JSONArray jsonArray = JSON.parseArray(message.toString()); - - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject json = jsonArray.getJSONObject(i); - String mpcode = json.get("dev_id") + "_" + json.get("cpn_name").toString().replace("-", "_"); - String mpvalue = json.get("parm_value").toString(); - - System.out.println(mpcode + "~~~" + mpvalue); - - //只需要写主表 子表有转发程序在写 - MPoint mPoint = mPointService.selectById("021HJHY", mpcode); - if (mPoint != null) { - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(mpvalue)); - mPointService.update("021HJHY", mPoint); - } - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - - // MqttTopic topic = client.getTopic(TOPIC1); - // setWill方法,设置最终端口的通知消息:如果项目中需要知道客户端是否掉线可以调用该方法。 - // options.setWill(topic, "close".getBytes(), 2, true); //遗嘱 - client.connect(options); - - // 订阅消息 - int[] Qos = {1}; - String[] topic1 = {TOPIC1}; - client.subscribe(topic1, Qos); - - } catch (MqttException e1) { - e1.printStackTrace(); - } - } - -} - diff --git a/src/com/sipai/quartz/job/HJHY_DataReceive_Job.java b/src/com/sipai/quartz/job/HJHY_DataReceive_Job.java deleted file mode 100644 index c3c98bf9..00000000 --- a/src/com/sipai/quartz/job/HJHY_DataReceive_Job.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.eclipse.paho.client.mqttv3.*; -import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; - -import java.math.BigDecimal; - -/** - * 皇家花园 指定txt中的数据 mqtt推送出去 - */ -public class HJHY_DataReceive_Job { - - public static String str = ""; - public static final String HOST = "tcp://61.160.236.180:1883"; - // 服务器内置主题,用来监测当前服务器上连接的客户端数量($SYS/broker/clients/connected) - // public static final String TOPIC1 = "$SYS/broker/clients/connected"; - public static final String TOPIC1 = "lynkros/csj/updata"; - private static final String clientid = "HJHY_DataReceive_" + CommUtil.getUUID(); - // private MqttClient client; - private static MqttClient client; - private MqttConnectOptions options; - private String userName = "sipai"; - private String passWord = "sipai"; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - - /** - * 推送txt中的点位到mqtt - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) throws MqttException { -// System.out.println("HJHY_DataReceive_Job---------------------------------" + CommUtil.nowDate()); - start(); - } - - public void start() { - // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示, - //MemoryPersistence设置clientid的保存形式,默认为以内存保存 - try { - client = new MqttClient(HOST, clientid, new MemoryPersistence()); - // MQTT的连接设置 - options = new MqttConnectOptions(); - // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录, - //设置为true表示每次连接到服务器都以新的身份连接 - options.setCleanSession(true); - // 设置连接的用户名 - options.setUserName(userName); - // 设置连接的密码 - options.setPassword(passWord.toCharArray()); - // 设置超时时间 单位为秒 - options.setConnectionTimeout(10); - // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息 - //判断客户端是否在线,但这个方法并没有重连的机制 - options.setKeepAliveInterval(20); - // 设置回调 - client.setCallback(new MqttCallback() { - public void connectionLost(Throwable cause) { - // 连接丢失后,一般在这里面进行重连, -// System.out.println("连接断开,可以做重连,只是简单处理:10秒后重连"); -// try { -// Thread.sleep(10 * 1000); -// start(); -// } catch (Exception e) { -// e.printStackTrace(); -// } - } - - public void deliveryComplete(IMqttDeliveryToken token) { - System.out.println("deliveryComplete---------" + token.isComplete()); - } - - public void messageArrived(String topic, MqttMessage message) { - try { - str = message.toString(); -// System.out.println("从服务器收到的消息为:" + message.toString()); - - JSONObject jsonObject = JSON.parseObject(message.toString()); - for (String str : jsonObject.keySet()) { -// System.out.println(str + ":" + jsonObject.get(str)); - JSONObject json = JSON.parseObject(jsonObject.get(str).toString()); -// System.out.println(str + "===" + json.get("values")); - - //只需要写主表 子表有转发程序在写 - MPoint mPoint = mPointService.selectById("021HJHY", str); - if (mPoint != null) { - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(json.get("values").toString())); - mPointService.update("021HJHY", mPoint); - } - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - - // MqttTopic topic = client.getTopic(TOPIC1); - // setWill方法,设置最终端口的通知消息:如果项目中需要知道客户端是否掉线可以调用该方法。 - // options.setWill(topic, "close".getBytes(), 2, true); //遗嘱 - client.connect(options); - - // 订阅消息 - int[] Qos = {1}; - String[] topic1 = {TOPIC1}; - client.subscribe(topic1, Qos); - - } catch (MqttException e1) { - e1.printStackTrace(); - } - } - - /*public static MqttClient connect(String brokeraddress, String clientId, String userName, String password) throws MqttException { - MemoryPersistence persistence = new MemoryPersistence(); - MqttConnectOptions connOpts = new MqttConnectOptions(); - connOpts.setCleanSession(true); - connOpts.setUserName(userName); - connOpts.setPassword(password.toCharArray()); - connOpts.setConnectionTimeout(10); - connOpts.setKeepAliveInterval(20); - mqttClient = new MqttClient(brokeraddress, clientId, persistence); - mqttClient.connect(connOpts); - return mqttClient; - }*/ - -} - diff --git a/src/com/sipai/quartz/job/HJHY_DataSend_Job.java b/src/com/sipai/quartz/job/HJHY_DataSend_Job.java deleted file mode 100644 index 87af8687..00000000 --- a/src/com/sipai/quartz/job/HJHY_DataSend_Job.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.eclipse.paho.client.mqttv3.MqttClient; -import org.eclipse.paho.client.mqttv3.MqttConnectOptions; -import org.eclipse.paho.client.mqttv3.MqttException; -import org.eclipse.paho.client.mqttv3.MqttMessage; -import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; - -import java.io.*; -import java.util.List; - -/** - * 皇家花园 指定txt中的数据 mqtt推送出去 - */ -public class HJHY_DataSend_Job { - - private static MqttClient mqttClient; - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - - /** - * 推送txt中的点位到mqtt - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { - System.out.println("HJHY_DataSend_Job---------------------------------" + CommUtil.nowDate()); - JSONArray jsonArray = new JSONArray(); - /** - * 获取配置文件里面的Json - */ - JSONArray jsonArray_config = JSONArray.parseArray(reloadJsonTxt().toString()); - if (jsonArray_config != null && jsonArray_config.size() > 0) { - String ids = ""; - for (int i = 0; i < jsonArray_config.size(); i++) { -// System.out.println(jsonArray_config.get(i)); - ids += "'" + jsonArray_config.get(i) + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - - List list = mPointService.selectListByWhere("021HJHY", "where id in (" + ids + ")"); - for (MPoint mPoint : list) { - System.out.println(mPoint.getMpointcode() + "===" + mPoint.getParmvalue()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", mPoint.getId()); - jsonObject.put("name", mPoint.getParmname()); - if (mPoint.getParmvalue() != null && !mPoint.getParmvalue().equals("")) { - jsonObject.put("value", mPoint.getParmvalue() + ""); - } else { - jsonObject.put("value", ""); - } - if (mPoint.getUnit() != null && !mPoint.getUnit().equals("")) { - jsonObject.put("unit", mPoint.getUnit() + ""); - } else { - jsonObject.put("unit", ""); - } - jsonArray.add(jsonObject); - } - publish(jsonArray, "lynkros/csj/data"); - } - } - - - } - - public JSONArray reloadJsonTxt() { - JSONArray jsonArray = new JSONArray(); - File file = new File("D:/sipaiis-config/hjhy_sendPoint.txt"); - try { - if (!file.getParentFile().exists()) { - file.getParentFile().mkdir(); - } - FileInputStream fileInputStream = new FileInputStream(file); - InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8"); - BufferedReader bufferedReader = new BufferedReader(inputStreamReader); - String strTmp = ""; - String jsonString = ""; - while ((strTmp = bufferedReader.readLine()) != null) { - jsonString += strTmp; - } -// System.out.println("reloadJsonTxt===" + jsonString); - jsonArray = JSONArray.parseArray(jsonString); - bufferedReader.close(); - } catch (Exception e) { - e.printStackTrace(); - } - return jsonArray; - } - - public static MqttClient connect(String brokeraddress, String clientId, String userName, String password) throws MqttException { - MemoryPersistence persistence = new MemoryPersistence(); - MqttConnectOptions connOpts = new MqttConnectOptions(); - connOpts.setCleanSession(true); - connOpts.setUserName(userName); - connOpts.setPassword(password.toCharArray()); - connOpts.setConnectionTimeout(10); - connOpts.setKeepAliveInterval(20); - mqttClient = new MqttClient(brokeraddress, clientId, persistence); - mqttClient.connect(connOpts); - return mqttClient; - } - - public static void publish(JSONArray jSONArray, String topic) { - System.out.println(jSONArray); - //连接 - try { - MqttMessage message = new MqttMessage(jSONArray.toString().getBytes("UTF-8")); - message.setQos(2); - message.setRetained(false); - - if (mqttClient != null && mqttClient.isConnected()) { -// System.out.println("直接发送======" + CommUtil.nowDate() + "======主题:" + topic); - //发布主题 - mqttClient.publish(topic, message); - } else { - System.out.println("重新连接======" + CommUtil.nowDate() + "======主题:" + topic); - mqttClient = connect("tcp://61.160.236.180:1883", "dataSend_" + CommUtil.getUUID(), "sipai", "64368180"); -// mqttClient = connect("tcp://132.120.136.19:1883", "dataSend_" + CommUtil.getUUID(), "sipai", "64368180"); - //发布主题 - mqttClient.publish(topic, message); - } -// mqttClient.disconnect(); - } catch (MqttException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } - -} - diff --git a/src/com/sipai/quartz/job/HQAQAlarmJob.java b/src/com/sipai/quartz/job/HQAQAlarmJob.java deleted file mode 100644 index 9ed0a134..00000000 --- a/src/com/sipai/quartz/job/HQAQAlarmJob.java +++ /dev/null @@ -1,728 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.enums.PatrolType; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.hqconfig.EnterRecord; -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.entity.work.AreaManage; -import com.sipai.entity.work.Camera; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.hqconfig.EnterRecordService; -import com.sipai.service.hqconfig.HQAlarmRecordService; -import com.sipai.service.timeefficiency.*; -import com.sipai.service.work.*; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MqttUtil; -import com.sipai.tools.SpringContextUtil; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 虹桥报警数据的推送 - */ -public class HQAQAlarmJob { - - HQAlarmRecordService hqAlarmRecordService = (HQAlarmRecordService) SpringContextUtil.getBean("hqAlarmRecordService"); - AlarmTypesService alarmTypesService = (AlarmTypesService) SpringContextUtil.getBean("alarmTypesService"); - AreaManageService areaManageService = (AreaManageService) SpringContextUtil.getBean("areaManageService"); - PatrolRecordService patrolRecordService = (PatrolRecordService) SpringContextUtil.getBean("patrolRecordService"); - PatrolPlanTypeService patrolPlanTypeService = (PatrolPlanTypeService) SpringContextUtil.getBean("patrolPlanTypeService"); - EnterRecordService enterRecordService = (EnterRecordService) SpringContextUtil.getBean("enterRecordService"); - CameraService cameraService = (CameraService) SpringContextUtil.getBean("cameraService"); - CameraDetailService cameraDetailService = (CameraDetailService) SpringContextUtil.getBean("cameraDetailService"); - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - PatrolPointService patrolPointService = (PatrolPointService) SpringContextUtil.getBean("patrolPointService"); - PatrolPlanService patrolPlanService = (PatrolPlanService) SpringContextUtil.getBean("patrolPlanService"); - PatrolRouteService patrolRouteService = (PatrolRouteService) SpringContextUtil.getBean("patrolRouteService"); - - /** - * 报警数量推送 (首页) - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { - - int aqyj = 0;//安全用具 - int xfqj = 0;//消防器具 - int wsdj = 0;//温湿度计 - int ywj = 0;//液位计 - int lhq = 0;//硫化氢 - int jw = 0;//甲烷 - - int all = 0;//本月报警总数 - double bjcll = 0;//报警处理率 - int numA = 0;//a - int numB = 0;//b - int numC = 0;//c - int numD = 0;//d - int numAQRW = 0;//安全任务 - int numAISJ = 0;//AI视觉 - int numWLJS = 0;//物理监视 - - int numIngA = 0;//a - 进行中的数量 - int numIngB = 0;//b - int numIngC = 0;//c - int numIngD = 0;//d - - //安全用具 - List list1 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '11' or alarmTypeid = '12') and state='1' "); - if (list1 != null && list1.size() > 0) { - aqyj = list1.size(); - } - - //消防器具 - List list2 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '13' or alarmTypeid = '14') and state='1' "); - if (list2 != null && list2.size() > 0) { - xfqj = list2.size(); - } - - //温湿度计 - List list3 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '21') and state='1' "); - if (list3 != null && list3.size() > 0) { - wsdj = list3.size(); - } - - //液位计 - List list4 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '22' or alarmTypeid = '24') and state='1' "); - if (list4 != null && list4.size() > 0) { - ywj = list4.size(); - } - - //硫化氢 - List list5 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '23') and state='1' "); - if (list5 != null && list5.size() > 0) { - lhq = list5.size(); - } - - //甲烷 - List list6 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '29') and state='1' "); - if (list6 != null && list6.size() > 0) { - jw = list6.size(); - } - - //本月报警总数 - List list_all = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 "); - if (list_all != null && list_all.size() > 0) { - all = list_all.size(); - } - - //本月报警处理率 - List list_wc = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and state != '1'"); - if (list_wc != null && list_wc.size() > 0) { - BigDecimal divide = new BigDecimal(list_wc.size()).divide(new BigDecimal(list_all.size()), 2, RoundingMode.HALF_UP); -// bjcll = String.valueOf(divide); - bjcll = Double.parseDouble(String.valueOf(divide)); - } - - //A - List list_a = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and riskLevel = 'A'"); - if (list_a != null && list_a.size() > 0) { - numA = list_a.size(); - } - - //B - List list_b = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and riskLevel = 'B'"); - if (list_b != null && list_b.size() > 0) { - numB = list_b.size(); - } - - //C - List list_c = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and riskLevel = 'C'"); - if (list_c != null && list_c.size() > 0) { - numC = list_c.size(); - } - - //D - List list_d = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and riskLevel = 'D'"); - if (list_d != null && list_d.size() > 0) { - numD = list_d.size(); - } - - //A 报警中 - List list_a_ing = hqAlarmRecordService.selectListByWhere(" where riskLevel = 'A' and state='1'"); - if (list_a_ing != null && list_a_ing.size() > 0) { - numIngA = list_a_ing.size(); - } - - //B 报警中 - List list_b_ing = hqAlarmRecordService.selectListByWhere(" where riskLevel = 'B' and state='1'"); - if (list_b_ing != null && list_b_ing.size() > 0) { - numIngB = list_b_ing.size(); - } - - //C 报警中 - List list_c_ing = hqAlarmRecordService.selectListByWhere(" where riskLevel = 'C' and state='1'"); - if (list_c_ing != null && list_c_ing.size() > 0) { - numIngC = list_c_ing.size(); - } - - //D 报警中 - List list_d_ing = hqAlarmRecordService.selectListByWhere(" where riskLevel = 'D' and state='1'"); - if (list_d_ing != null && list_d_ing.size() > 0) { - numIngD = list_d_ing.size(); - } - -// int numAQRW = 0;//安全任务 -// int numAISJ = 0;//AI视觉 -// int numWLJS = 0;//物理监视 - - //安全任务:1 物联监视:2 AI视觉:3 - String idsType1 = "'-',"; - String idsType2 = "'-',"; - String idsType3 = "'-',"; - List listType1 = alarmTypesService.selectListByWhere("where 1=1 "); - for (AlarmTypes alarmTypes : listType1) { - if (alarmTypes.getPid().equals("1")) { - idsType1 += "'" + alarmTypes.getId() + "',"; - } - if (alarmTypes.getPid().equals("2")) { - idsType2 += "'" + alarmTypes.getId() + "',"; - } - if (alarmTypes.getPid().equals("3")) { - idsType3 += "'" + alarmTypes.getId() + "',"; - } - } - - idsType1 = idsType1.substring(0, idsType1.length() - 1); - idsType2 = idsType2.substring(0, idsType2.length() - 1); - idsType3 = idsType3.substring(0, idsType3.length() - 1); - - List aqrwList = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and alarmTypeid in (" + idsType1 + ")"); - if (aqrwList != null && aqrwList.size() > 0) { - numAQRW = aqrwList.size(); - } - List aisjList = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and alarmTypeid in (" + idsType2 + ")"); - if (aisjList != null && aisjList.size() > 0) { - numWLJS = aisjList.size(); - } - List wljsList = hqAlarmRecordService.selectListByWhere(" where DateDiff(mm,insdt,getdate())=0 and alarmTypeid in (" + idsType3 + ")"); - if (wljsList != null && wljsList.size() > 0) { - numAISJ = wljsList.size(); - } - - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("aqyj", aqyj); - jsonObject.put("xfqj", xfqj); - jsonObject.put("wsdj", wsdj); - jsonObject.put("ywj", ywj); - jsonObject.put("lhq", lhq); - jsonObject.put("jw", jw); - jsonObject.put("all", all); - jsonObject.put("bjcll", bjcll); - - jsonObject.put("numA", numA); - jsonObject.put("numB", numB); - jsonObject.put("numC", numC); - jsonObject.put("numD", numD); - - jsonObject.put("numIngA", numIngA); - jsonObject.put("numIngB", numIngB); - jsonObject.put("numIngC", numIngC); - jsonObject.put("numIngD", numIngD); - - jsonObject.put("numAQRW", numAQRW); - jsonObject.put("numAISJ", numAISJ); - jsonObject.put("numWLJS", numWLJS); - - JSONObject json = new JSONObject(); - json.put("datatype", "TypeNumer"); - json.put("data", jsonObject); - - MqttUtil.publish(json, "hq_alarm_num"); - } - - /** - * 周界报警状态推送 (首页) - * - * @param scheduleJob - */ - public void fun2(ScheduleJob scheduleJob) { - JSONArray jsonArray = new JSONArray(); - JSONArray jsonArray2 = new JSONArray(); - /** - * 第一种周界报警:周界围栏报警 - */ - List list1 = hqAlarmRecordService.selectListByWhere(" where alarmTypeid = '25' and state='1' "); - Set set = new HashSet<>(); - if (list1 != null && list1.size() > 0) { - for (int i = 0; i < list1.size(); i++) { - set.add(list1.get(i).getAreaid()); - } - } - //拿到报警点去重的id - Iterator it = set.iterator(); - while (it.hasNext()) { - String str = it.next(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", str); - jsonObject.put("status", "1"); - jsonArray.add(jsonObject); - } - //周界报警推送 - JSONObject json = new JSONObject(); - json.put("datatype", "TypeZhouJie"); - json.put("data", jsonArray); - MqttUtil.publish(json, "hq_alarm_num"); - - /** - * 第二种周界报警:周界围栏未正常工作报警 - */ - List list2 = hqAlarmRecordService.selectListByWhere(" where alarmTypeid = '25_2' and state='1' "); - Set set2 = new HashSet<>(); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - set2.add(list2.get(i).getAreaid()); - } - } - //拿到报警点去重的id - Iterator it2 = set2.iterator(); - while (it2.hasNext()) { - String str = it2.next(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", str); - jsonObject.put("status", "1"); - jsonArray2.add(jsonObject); - } - //周界报警推送 - JSONObject json2 = new JSONObject(); - json2.put("datatype", "TypeZhouJie2"); - json2.put("data", jsonArray2); - MqttUtil.publish(json2, "hq_alarm_num"); - } - - - /** - * 区域报警推送 (首页) - * - * @param scheduleJob - */ - public void fun3(ScheduleJob scheduleJob) { - JSONArray jsonArray = new JSONArray(); - - List list_all = this.areaManageService.selectListByWhere("where pid = '-1'"); - for (AreaManage areaManage : list_all) { - JSONObject jsonObject = new JSONObject(); - - String ids = "'-',"; - List list_ch = this.areaManageService.selectListByWhere("where pid = '" + areaManage.getId() + "'"); - for (AreaManage areaManage1 : list_ch) { - ids += "'" + areaManage1.getId() + "',"; - } - ids += "'" + areaManage.getId() + "',";//包含父节点自己 - ids = ids.substring(0, ids.length() - 1); - - List list1 = hqAlarmRecordService.selectListByWhere(" where areaid in (" + ids + ") and areaid is not null and state='1' "); - if (list1 != null && list1.size() > 0) { - jsonObject.put("id", areaManage.getId()); - jsonObject.put("name", areaManage.getName()); - jsonObject.put("num", list1.size()); - jsonArray.add(jsonObject); - } - } - - //周界报警推送 - JSONObject json = new JSONObject(); - json.put("datatype", "TypeArea"); - json.put("data", jsonArray); - - MqttUtil.publish(json, "hq_alarm_num"); - } - - /** - * 区域报警推送(分页) - * - * @param scheduleJob - */ - public void fun4(ScheduleJob scheduleJob) { - List list_all = this.areaManageService.selectListByWhere("where 1=1 "); - for (AreaManage areaManage : list_all) { - JSONObject jsonObject = new JSONObject(); - //虹桥安全项目不需要 消防器具和安全用具的 区域报警 暂时在sql中去掉 :alarmTypeid!='11' and alarmTypeid!='13' - List list1 = hqAlarmRecordService.selectListByWhere(" where areaid ='" + areaManage.getId() + "' and areaid is not null and state='1' and alarmTypeid!='11' and alarmTypeid!='13'"); - if (list1 != null && list1.size() > 0) { - jsonObject.put("id", areaManage.getId()); - jsonObject.put("name", areaManage.getName()); - jsonObject.put("num", list1.size()); - - //将ABCD进行分组 - Map> userMap = list1.stream().collect(Collectors.groupingBy(HQAlarmRecord::getRiskLevel)); - - Set keys = userMap.keySet(); - //优先按ABCD顺序进行推送 - if (keys.contains("A")) { - jsonObject.put("result", "A"); - } else if (keys.contains("B")) { - jsonObject.put("result", "B"); - } else if (keys.contains("C")) { - jsonObject.put("result", "C"); - } else if (keys.contains("D")) { - jsonObject.put("result", "D"); - } - - } else { - jsonObject.put("id", areaManage.getId()); - jsonObject.put("name", areaManage.getName()); - jsonObject.put("num", 0); - jsonObject.put("result", "0");//代表没有报警变色 - } - try { - MqttUtil.publish(jsonObject, "dataVisualData_svg_" + areaManage.getId()); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * 数据及表格推送(分页) - * - * @param scheduleJob - */ - public void fun5(ScheduleJob scheduleJob) { - - String unitId = "021HQWS"; - List list_all = this.areaManageService.selectSimpleListByWhere("where pid = '-1'"); - for (AreaManage areaManage : list_all) { - JSONObject jsonObject = new JSONObject(); - String ids = "'-',"; - List list_ch = this.areaManageService.selectSimpleListByWhere("where pid = '" + areaManage.getId() + "'"); - for (AreaManage areaManage1 : list_ch) { - ids += "'" + areaManage1.getId() + "',"; - } - ids += "'" + areaManage.getId() + "',";//包含父节点自己 - ids = ids.substring(0, ids.length() - 1); - - //当前报警 - /*List list1 = hqAlarmRecordService.selectListByWhere(" where areaid in (" + ids + ") and areaid is not null and state='1' and unitId = '" + unitId + "' order by insdt desc"); - if (list1 != null && list1.size() > 0) { - jsonObject.put("currentAlarmNum", list1.size()); - //当前报警列表 - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < list1.size(); i++) { - if (i < 5) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("time", list1.get(i).getInsdt().substring(5, 16)); - jsonObject1.put("content", list1.get(i).getName()); - jsonObject1.put("level", list1.get(i).getRiskLevel()); - jsonArray.add(jsonObject1); - } else { - break; - } - } - jsonObject.put("table_alarm", jsonArray); - } else { - jsonObject.put("currentAlarmNum", 0); - }*/ - - //先给四类赋值0 下面分组种再给四类赋值真实数量 - /*jsonObject.put("A_AlarmNum", 0); - jsonObject.put("B_AlarmNum", 0); - jsonObject.put("C_AlarmNum", 0); - jsonObject.put("D_AlarmNum", 0);*/ - - //将ABCD进行分组 - /*Map> userMap = list1.stream().collect(Collectors.groupingBy(HQAlarmRecord::getRiskLevel)); - for (Map.Entry> entry : userMap.entrySet()) { - String key = entry.getKey(); - if (key.equals("A")) { - //A类风险 - jsonObject.put("A_AlarmNum", entry.getValue().size()); - } else if (key.equals("B")) { - //B类风险 - jsonObject.put("B_AlarmNum", entry.getValue().size()); - } else if (key.equals("C")) { - //C类风险 - jsonObject.put("C_AlarmNum", entry.getValue().size()); - } else if (key.equals("D")) { - //D类风险 - jsonObject.put("D_AlarmNum", entry.getValue().size()); - } - }*/ - - //今日报警 - List list2 = hqAlarmRecordService.selectListByWhere(" where areaid in (" + ids + ") and areaid is not null and DateDiff(dd,insdt,getdate())=0 and unitId = '" + unitId + "'"); - if (list2 != null && list2.size() > 0) { - jsonObject.put("todayAlarmNum", list2.size()); - } else { - jsonObject.put("todayAlarmNum", 0); - } - - //本月报警 - List list3 = hqAlarmRecordService.selectListByWhere(" where areaid in (" + ids + ") and areaid is not null and DateDiff(mm,insdt,getdate())=0 and unitId = '" + unitId + "'"); - if (list3 != null && list3.size() > 0) { - jsonObject.put("monthAlarmNum", list3.size()); - } else { - jsonObject.put("monthAlarmNum", 0); - } - - //本月待执行 - List list4 = patrolRecordService.getPatrolRecord4AreaId(" where p.type = 'S' and DateDiff(mm,p.start_time,getdate())=0 and p.status!='3' and po.area_id in (" + ids + ") ", "p.id", ""); - if (list4 != null && list4.size() > 0) { - jsonObject.put("month_toBeExecuted", list4.size()); - } else { - jsonObject.put("month_toBeExecuted", 0); - } - - //本月已完成 - List list5 = patrolRecordService.getPatrolRecord4AreaId(" where p.type = 'S' and DateDiff(mm,p.start_time,getdate())=0 and p.status='3' and po.area_id in (" + ids + ") ", "p.id", ""); - if (list5 != null && list5.size() > 0) { - jsonObject.put("month_completed", list5.size()); - } else { - jsonObject.put("month_completed", 0); - } - - //任务列表 - JSONArray jsonArray_task = new JSONArray(); - List list6 = patrolRecordService.getPatrolRecord4AreaId(" where p.type = 'S' and DateDiff(mm,p.start_time,getdate())=0 and p.status!='3' and po.area_id in (" + ids + ") ", " p.name,p.id,p.task_type,p.status,p.start_time,p.end_time ", "order by p.start_time desc"); - if (list6 != null && list6.size() > 0) { - for (int i = 0; i < list6.size(); i++) { - if (i < 5) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("name", list6.get(i).getName() + ""); - //任务类型 - PatrolPlanType patrolPlanType = patrolPlanTypeService.selectById(list6.get(i).getTaskType()); - if (patrolPlanType != null) { - jsonObject1.put("type", patrolPlanType.getName()); - } else { - jsonObject1.put("type", "无"); - } - //状态 - if (list6.get(i).getStatus().equals("1") || list6.get(i).getStatus().equals("2")) { - jsonObject1.put("status", "待执行"); - } - if (list6.get(i).getStatus().equals("3") || list6.get(i).getStatus().equals("4")) { - jsonObject1.put("status", "已完成"); - } - jsonObject1.put("endTime", list6.get(i).getEndTime().substring(0, 10)); - jsonArray_task.add(jsonObject1); - } else { - break; - } - } - } - jsonObject.put("table_task", jsonArray_task); - - // 人员进出记录最新五条 - Map map = new HashMap(); - map.put("top_n", "5"); - map.put("where", "where DateDiff(dd, inTime ,getdate()) = 0 and areaid in (" + ids + ") order by inTime desc"); - List enterRecords = enterRecordService.selectTopNlistByWhere(map); - - //当前人员数 - int personNum = 0; - List personList = enterRecordService.selectListByWhere("where state = 1 and areaid in (" + ids + ")"); - if (personList != null) { - personNum = personList.size(); - } - // 当天进入 - int personTodayNum = 0; - List personTodayList = enterRecordService.selectListByWhere("where DateDiff(dd, inTime ,getdate()) = 0 and areaid in (" + ids + ")"); - if (personTodayList != null) { - personTodayNum = personTodayList.size(); - } - //当前人员数 - jsonObject.put("now_people", personNum); - //今日进入 - jsonObject.put("today_in_people", personTodayNum); - - // 摄像头总数 - int allCamera = 0; - allCamera = cameraDetailService.selectNumBywhere("where areaManageId in (" + ids + ")"); - // 摄像头 - jsonObject.put("All_Camera", allCamera); - - // 工艺段 - String processsection = cameraDetailService.selectProcesssectionBywhere("where areaManageId in (" + ids + ")"); - jsonObject.put("processsection", processsection); - - // AI 摄像头总数 -// int aiCamera = 0; -// aiCamera = cameraDetailService.selectAINumBywhere("where areaManageId in (" + ids + ")"); - // AI摄像头 -// jsonObject.put("AI_Camera", aiCamera); - - // table_people - jsonObject.put("table_people", enterRecords); - - //table_camera - List cameras = cameraDetailService.selectAIListByWhere("where areaManageId in (" + ids + ")"); - jsonObject.put("table_camera", cameras); - - - // AI摄像头 - if (cameras != null) { - jsonObject.put("AI_Camera", cameras.size()); - } else { - jsonObject.put("AI_Camera", 0); - } - MqttUtil.publish(jsonObject, "dataVisualData_hqfy_" + areaManage.getId()); - } - } - - /** - * 特种设备报警变色推送(首页) - * - * @param scheduleJob - */ - public void fun6(ScheduleJob scheduleJob) { - // d10c0ff7fc0442aeb3692ad07b90d455 是特种设备类型的Id 仅查这个类型 - JSONArray jsonArray = new JSONArray(); - List list = equipmentCardService.selectSimpleListByWhere("where equipment_big_class_id = 'd10c0ff7fc0442aeb3692ad07b90d455' "); - for (EquipmentCard equipmentCard : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", equipmentCard.getEquipmentname()); - jsonObject.put("id", equipmentCard.getId()); - //15=特种设备不合格报警 16=特种设备超时报警 - List list1 = hqAlarmRecordService.selectListByWhere(" where (alarmTypeid = '15' or alarmTypeid = '16') and state='1' and mpcode = '" + equipmentCard.getId() + "'"); - if (list1 != null && list1.size() > 0) { - jsonObject.put("status", 1); - } else { - jsonObject.put("status", 0); - } - jsonArray.add(jsonObject); - } - - JSONObject json = new JSONObject(); - json.put("datatype", "TypeEquipment"); - json.put("data", jsonArray); - - MqttUtil.publish(json, "hq_alarm_num"); - } - - /** - * 安全用具和消防器具的 “报警状态” 和 “下次检定时间” 推送 - * - * @param scheduleJob - */ - public void fun7(ScheduleJob scheduleJob) { -// String unitId = "021HQWS"; - List list_all = this.areaManageService.selectListByWhere("where pid = '-1'"); - for (AreaManage areaManage : list_all) { - String ids = "'-',"; - List list_ch = this.areaManageService.selectListByWhere("where pid = '" + areaManage.getId() + "'"); - for (AreaManage areaManage1 : list_ch) { - ids += "'" + areaManage1.getId() + "',"; - } - ids += "'" + areaManage.getId() + "',";//包含父节点自己 - ids = ids.substring(0, ids.length() - 1); - -// if(areaManage.getId().equals("twam0006")){ -// System.out.println("111111"); -// } - - JSONArray jsonArray = new JSONArray(); - List list_point = patrolPointService.selectListByWhere("where 1=1 and area_id in (" + ids + ") and point_code in ('1','2')"); - for (PatrolPoint patrolPoint : list_point) { - JSONObject json = new JSONObject(); - json.put("id", patrolPoint.getId()); - json.put("name", patrolPoint.getName()); - json.put("type", patrolPoint.getPointCode());//1区域点 2安全用具 3 消防器具 - /** - * 查询 “下次检定时间” - */ - List list_plan = patrolRouteService.selectListByPlanSafe("where patrol_point_id = '" + patrolPoint.getId() + "'"); - if (list_plan != null && list_plan.size() > 0) { - PatrolPlan patrolPlan = patrolPlanService.selectSimpleById(list_plan.get(0).getPatrolPlanId()); - if (patrolPlan != null && patrolPlan.getPlanIssuanceDate() != null && !patrolPlan.getPlanIssuanceDate().equals("")) { - json.put("nextDate", patrolPlan.getPlanIssuanceDate().substring(0, 10)); - } else { - json.put("nextDate", "-"); - } -// System.out.println(areaManage.getId() + "===" + areaManage.getName() + "==="+patrolPoint.getName() + "===" + json.get("nextDate")); - } - /** - * 查询 “该点位是否报警” - */ - List list_alarm = hqAlarmRecordService.selectListByWhere("where state = '1' and targetid = '" + patrolPoint.getId() + "' and areaid in (" + ids + ")"); - if (list_alarm != null && list_alarm.size() > 0) { - json.put("status", "1"); - } else { - json.put("status", "0"); - } - jsonArray.add(json); - } - MqttUtil.publish(jsonArray, "dataVisualData_taskPointsAlarm_" + areaManage.getId()); - } - } - - /** - * 仅推送 当前风险数量和列表 - * @param scheduleJob - */ - public void fun8(ScheduleJob scheduleJob) { - - String unitId = "021HQWS"; - List list_all = this.areaManageService.selectSimpleListByWhere("where pid = '-1'"); - for (AreaManage areaManage : list_all) { - JSONObject jsonObject = new JSONObject(); - String ids = "'-',"; - List list_ch = this.areaManageService.selectSimpleListByWhere("where pid = '" + areaManage.getId() + "'"); - for (AreaManage areaManage1 : list_ch) { - ids += "'" + areaManage1.getId() + "',"; - } - ids += "'" + areaManage.getId() + "',";//包含父节点自己 - ids = ids.substring(0, ids.length() - 1); - - //当前报警 - List list1 = hqAlarmRecordService.selectListByWhere(" where areaid in (" + ids + ") and areaid is not null and state='1' and unitId = '" + unitId + "' order by insdt desc"); - if (list1 != null && list1.size() > 0) { - jsonObject.put("currentAlarmNum", list1.size()); - //当前报警列表 - JSONArray jsonArray = new JSONArray(); - for (int i = 0; i < list1.size(); i++) { - if (i < 5) { - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("time", list1.get(i).getInsdt().substring(5, 16)); - jsonObject1.put("content", list1.get(i).getName()); - jsonObject1.put("level", list1.get(i).getRiskLevel()); - jsonArray.add(jsonObject1); - } else { - break; - } - } - jsonObject.put("table_alarm", jsonArray); - } else { - jsonObject.put("currentAlarmNum", 0); - } - - //先给四类赋值0 下面分组种再给四类赋值真实数量 - jsonObject.put("A_AlarmNum", 0); - jsonObject.put("B_AlarmNum", 0); - jsonObject.put("C_AlarmNum", 0); - jsonObject.put("D_AlarmNum", 0); - - //将ABCD进行分组 - Map> userMap = list1.stream().collect(Collectors.groupingBy(HQAlarmRecord::getRiskLevel)); - for (Map.Entry> entry : userMap.entrySet()) { - String key = entry.getKey(); - if (key.equals("A")) { - //A类风险 - jsonObject.put("A_AlarmNum", entry.getValue().size()); - } else if (key.equals("B")) { - //B类风险 - jsonObject.put("B_AlarmNum", entry.getValue().size()); - } else if (key.equals("C")) { - //C类风险 - jsonObject.put("C_AlarmNum", entry.getValue().size()); - } else if (key.equals("D")) { - //D类风险 - jsonObject.put("D_AlarmNum", entry.getValue().size()); - } - } - MqttUtil.publish(jsonObject, "dataVisualData_hqfy_alarm_" + areaManage.getId()); - } - } -} - diff --git a/src/com/sipai/quartz/job/HQAQModelAlarmJob.java b/src/com/sipai/quartz/job/HQAQModelAlarmJob.java deleted file mode 100644 index a426e5ac..00000000 --- a/src/com/sipai/quartz/job/HQAQModelAlarmJob.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.hqconfig.WorkModel; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.work.CameraDetail; -import com.sipai.service.hqconfig.HQAlarmRecordService; -import com.sipai.service.hqconfig.WorkModelService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.*; -import org.apache.commons.lang3.StringUtils; - -import java.math.BigDecimal; -import java.util.*; - -/** - * 虹桥行车模型报警 - */ -public class HQAQModelAlarmJob { - - WorkModelService workModelService = (WorkModelService) SpringContextUtil.getBean("workModelService"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - HQAlarmRecordService hqAlarmRecordService = (HQAlarmRecordService) SpringContextUtil.getBean("hqAlarmRecordService"); - - /** - * 报警数量推送 (首页) - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { - // 获取模型配置的所有摄像头列表 - WorkModel workModel = workModelService.selectModelAndCameraListByWhere("where model_name = 'crane'"); - if (workModel.getStatus().equals(0)) { - return; - } - // 摄像头配置列表 - List cameraDetailList = workModel.getCameraDetailList(); - for (CameraDetail cameraDetail : cameraDetailList) { - if (cameraDetail.getStatus().equals(0)) { - continue; - } - PythonReceiveData pythonReceiveData = CommString.craneModelMap.get(cameraDetail.getCameraid()); - if (pythonReceiveData != null) { - if (StringUtils.isNotBlank(cameraDetail.getPointid())) { - MPoint mPoint = mPointService.selectById(scheduleJob.getUnitId(), cameraDetail.getPointid()); - cameraDetail.setmPoint(mPoint); - System.out.println("value is " + String.valueOf(mPoint.getParmvalue())); - } - // 如果停止并且获取result为bad 则报警其他情况消除报警 - workModel.setCameraDetail(cameraDetail); - if ("good".equals(pythonReceiveData.getResult()) || new BigDecimal(0).compareTo(cameraDetail.getmPoint().getParmvalue()) == 0) { - hqAlarmRecordService.eliminateAlarm(workModel); - } else if ("bad".equals(pythonReceiveData.getResult()) && new BigDecimal(1).compareTo(cameraDetail.getmPoint().getParmvalue()) == 0) { - hqAlarmRecordService.addAlarm(workModel); - } - } - } - } -} - diff --git a/src/com/sipai/quartz/job/HQAQPositionJob.java b/src/com/sipai/quartz/job/HQAQPositionJob.java deleted file mode 100644 index 673943b9..00000000 --- a/src/com/sipai/quartz/job/HQAQPositionJob.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.service.user.UserOutsidersService; - -import javax.annotation.Resource; -import java.io.IOException; - -/** - * 定时获取定位系统人员数据 - * @author NJP - */ -public class HQAQPositionJob { - @Resource - private UserOutsidersService userOutsidersService; - - public void excute() throws IOException{ - System.out.println("执行获取定位系统人员数据方法"); - userOutsidersService.getPositionApi4User(); - - } - -} diff --git a/src/com/sipai/quartz/job/HQAQscoreJob.java b/src/com/sipai/quartz/job/HQAQscoreJob.java deleted file mode 100644 index 3a707d0b..00000000 --- a/src/com/sipai/quartz/job/HQAQscoreJob.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.service.hqconfig.HQAlarmRecordService; - -import javax.annotation.Resource; -import java.io.IOException; - -/** - * 定时计算安全评分 - * @author NJP - */ -public class HQAQscoreJob { - @Resource - private HQAlarmRecordService hqAlarmRecordService; - - public void excute() throws IOException{ - System.out.println("执行计算安全评分方法"); - hqAlarmRecordService.secureScore(); - System.out.println("执行计算安全评分方法结束"); - } - -} diff --git a/src/com/sipai/quartz/job/JSYWJob.java b/src/com/sipai/quartz/job/JSYWJob.java deleted file mode 100644 index 7640ecb0..00000000 --- a/src/com/sipai/quartz/job/JSYWJob.java +++ /dev/null @@ -1,263 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.jsyw.JsywCompany; -import com.sipai.entity.jsyw.JsywPoint; -import com.sipai.service.jsyw.JsywCompanyService; -import com.sipai.service.jsyw.JsywPointService; -import com.sipai.tools.CommUtil; -import java.math.BigDecimal; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Iterator; -import javax.annotation.Resource; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; - -public class JSYWJob { - @Resource - private JsywPointService jsywPointService; - @Resource - private JsywCompanyService jsywCompanyService; - - public JSYWJob() { - } - - public void execute() { - String r1 = getToken("http://31.8.10.221/com/getToken4Corp?corpid=c7obSila&secret=3Ij9L8lavHQ67Z5b55n5y1mm2i18p1Cf", (String)null); - JSONObject jsonObject = JSONObject.parseObject(r1); - String token = JSONObject.parseObject(jsonObject.get("data").toString()).get("x-access-token").toString(); - int pno = 0; - Calendar cal = Calendar.getInstance(); - cal.add(2, -1); - Date date = cal.getTime(); - DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowDate = format.format(date).substring(0, 10); - int pnogongsi = 0; - System.out.println("开始转发公司"); - - String nowDate2; - JSONArray data; - do { - while(true) { - ++pnogongsi; - System.out.println(pnogongsi); - String url = "http://31.8.10.221/exchange/getData"; - URIBuilder uriBuilder = null; - try { - uriBuilder = new URIBuilder(url); - uriBuilder.addParameter("appid", "f98Fj62e"); - uriBuilder.addParameter("pno", ""+pnogongsi+""); - uriBuilder.addParameter("psize", "100"); - uriBuilder.addParameter("lastdate", nowDate); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - nowDate2 = sendGET(uriBuilder, token); - JSONObject j1 = JSONObject.parseObject(nowDate2); - int code = Integer.parseInt(j1.get("code").toString()); - if (code == 200) { - data = JSONArray.parseArray(j1.get("data").toString()); - Iterator var16 = data.iterator(); - - while(var16.hasNext()) { - Object object = var16.next(); - JSONObject company = JSONObject.parseObject(object.toString()); - String id = company.get("id").toString(); - JsywCompany jsywCompany = new JsywCompany(); - jsywCompany.setId(company.get("id") == null ? null : company.get("id").toString()); - jsywCompany.setWrylbText(company.get("wrylb_text") == null ? null : company.get("wrylb_text").toString()); - jsywCompany.setXzqh(company.get("xzqh") == null ? null : company.get("xzqh").toString()); - jsywCompany.setCreateTime(company.get("create_time") == null ? null : company.get("create_time").toString()); - jsywCompany.setYear(company.get("year") == null ? null : Integer.parseInt(company.get("year").toString())); - jsywCompany.setDwmc(company.get("dwmc") == null ? null : company.get("dwmc").toString()); - jsywCompany.setItemids(company.get("itemids") == null ? null : company.get("itemids").toString()); - jsywCompany.setScdz(company.get("scdz") == null ? null : company.get("scdz").toString()); - jsywCompany.setLatitude(company.get("latitude") == null ? null : company.get("latitude").toString()); - jsywCompany.setLongitude(company.get("longitude") == null ? null : company.get("longitude").toString()); - if (this.jsywCompanyService.selectById(id) == null) { - this.jsywCompanyService.save(jsywCompany); - } else { - this.jsywCompanyService.update(jsywCompany); - } - } - break; - } - - if (code == 40014) { - System.out.println("重新获取tonken!!!!!!!!!!!!!!!!!!!!!"); - r1 = getToken("http://31.8.10.221/com/getToken4Corp?corpid=c7obSila&secret=3Ij9L8lavHQ67Z5b55n5y1mm2i18p1Cf", (String)null); - jsonObject = JSONObject.parseObject(r1); - token = JSONObject.parseObject(jsonObject.get("data").toString()).get("x-access-token").toString(); - --pno; - } - } - } while(data.size() >= 100); - - System.out.println("转发公司完毕!"); - System.out.println("开始转发点位"); - JsywPoint jsywPoint1 = new JsywPoint(); - nowDate2 = CommUtil.nowDate(); - jsywPoint1.setId(CommUtil.getUUID()); - jsywPoint1.setFactorname("xx"); - jsywPoint1.setPsname("西派埃"); - jsywPoint1.setTstamp(nowDate2); - jsywPoint1.setUpdateDate(nowDate2); - jsywPoint1.setUpdateTime(nowDate2); - this.jsywPointService.save(jsywPoint1); - do { - while(true) { - ++pno; - System.out.println(pno); - String url = "http://31.8.10.221/exchange/getData"; - URIBuilder uriBuilder = null; - try { - uriBuilder = new URIBuilder(url); - uriBuilder.addParameter("appid", "122Z365r"); - uriBuilder.addParameter("pno", ""+pno+""); - uriBuilder.addParameter("psize", "100"); - uriBuilder.addParameter("lastdate", nowDate); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - String sendGET = sendGET(uriBuilder, token); - JSONObject j1 = JSONObject.parseObject(sendGET); - int code = Integer.parseInt(j1.get("code").toString()); - if (code == 200) { - data = JSONArray.parseArray(j1.get("data").toString()); - Iterator var29 = data.iterator(); - - while(var29.hasNext()) { - Object object = var29.next(); - JSONObject point = JSONObject.parseObject(object.toString()); - String id = point.get("id").toString(); - JsywPoint jsywPoint = new JsywPoint(); - jsywPoint.setId(point.get("id") == null ? null : point.get("id").toString()); - jsywPoint.setFactorname(point.get("factorname") == null ? null : point.get("factorname").toString()); - jsywPoint.setOutputname(point.get("outputname") == null ? null : point.get("outputname").toString()); - jsywPoint.setPollutantvalue(new BigDecimal(point.get("pollutantvalue") == null ? null : point.get("pollutantvalue").toString())); - jsywPoint.setPsname(point.get("psname") == null ? null : point.get("psname").toString()); - jsywPoint.setTstamp(point.get("tstamp") == null ? null : point.get("tstamp").toString()); - jsywPoint.setUpdateDate(point.get("update_date") == null ? null : point.get("update_date").toString()); - jsywPoint.setUpdateTime(point.get("update_time") == null ? null : point.get("update_time").toString()); - jsywPoint.setValuetype(point.get("valuetype") == null ? null : point.get("valuetype").toString()); - if (this.jsywPointService.selectById(id) == null) { - this.jsywPointService.save(jsywPoint); - } else { - this.jsywPointService.update(jsywPoint); - } - } - break; - } - - if (code == 40014) { - System.out.println("重新获取tonken!!!!!!!!!!!!!!!!!!!!!"); - r1 = getToken("http://31.8.10.221/com/getToken4Corp?corpid=c7obSila&secret=3Ij9L8lavHQ67Z5b55n5y1mm2i18p1Cf", (String)null); - jsonObject = JSONObject.parseObject(r1); - token = JSONObject.parseObject(jsonObject.get("data").toString()).get("x-access-token").toString(); - --pno; - } - } - } while(data.size() >= 100); - - System.out.println("转发完毕!"); - System.out.println("测试2!"); - } - public static String sendGET(URIBuilder uriBuilder, String token) { - String response = null; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(uriBuilder.build()); - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpGet.setHeader("x-access-token", token); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var11) { - var11.printStackTrace(); - } - - return response; - } - public static String sendGET(String url, String json, String token) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpGet.setHeader("x-access-token", token); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var11) { - var11.printStackTrace(); - } - - return response; - } - - public static String getToken(String url, String json) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var10) { - var10.printStackTrace(); - } - - return response; - } -} diff --git a/src/com/sipai/quartz/job/LibraryRoutineWorkJob.java b/src/com/sipai/quartz/job/LibraryRoutineWorkJob.java deleted file mode 100644 index 0400323e..00000000 --- a/src/com/sipai/quartz/job/LibraryRoutineWorkJob.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.util.Calendar; -import java.util.List; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.process.LibraryRoutineWork; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Scheduling; -import com.sipai.service.process.LibraryRoutineWorkService; -import com.sipai.service.process.RoutineWorkService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.SchedulingService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import org.springframework.ui.Model; - -public class LibraryRoutineWorkJob { - @Resource - private UnitService unitService; - @Resource - private LibraryRoutineWorkService libraryRoutineWorkService; - @Resource - private RoutineWorkService routineWorkService; - @Resource - private SchedulingService schedulingService; - - public void execute() throws ParseException { - String nowTime = CommUtil.nowDate(); - System.out.println(nowTime + "====常规工单任务下发开始"); - //当前小时数 - int nowHour = Integer.valueOf(nowTime.substring(11, 13)); - //获取今天周几 - Calendar calendar = Calendar.getInstance(); - int nowWeekDay = calendar.get(Calendar.DAY_OF_WEEK); - //当前月天数 - int nowMonthDay = Integer.valueOf(nowTime.substring(8, 10)); - //当前月最大天数 - int maxMonth = CommUtil.getDaysByYearMonth(Integer.valueOf(nowTime.substring(0, 4)), Integer.valueOf(nowTime.substring(5, 7))); - - List cList = this.unitService.getCompaniesByWhere(" where type='" + CommString.UNIT_TYPE_BIZ + "' "); - - for (Company company : cList) { - String unitId = company.getId(); - List lRoutineWorks = this.libraryRoutineWorkService.selectListByWhere(" where unit_id='" + unitId + "' "); - for (LibraryRoutineWork libraryRoutineWork : lRoutineWorks) { - String id = CommUtil.getUUID(); - String libraryId = libraryRoutineWork.getId(); - String typestr = libraryRoutineWork.getType(); - if (libraryRoutineWork.getDayRegister() != null && libraryRoutineWork.getWorkFrequencyType().equals(LibraryRoutineWork.Frequency_Type_Day)) { - //日下发 - String[] dayRegisters = libraryRoutineWork.getDayRegister().split(","); - for (String dN : dayRegisters) { - if (Integer.valueOf(dN) == nowHour) { - int listSize = this.routineWorkService.selectCountByWhere(" where datediff(hour,insdt,'" + nowTime + "')=0 and library_id='" + libraryId + "' "); - if (listSize == 0) { - String res = this.routineWorkService.doCreate(id, libraryId, unitId, typestr, nowTime); - if (res.equals(CommString.Status_Pass)) { - /* - 自动下发功能 (之前只自动生成不自动下发) - sj 2021-07-23 - */ - System.out.println("存在工单-日"); - String planStartDate = CommUtil.nowDate(); - - //查询当班人员 - System.out.println("where schedulingtype = 'run' and stdt <= '" + planStartDate + "' and eddt >= '" + planStartDate + "'"); - List list = schedulingService.selectListByWhere("where schedulingtype = 'run' and stdt <= '" + planStartDate + "' and eddt >= '" + planStartDate + "'"); - if (list != null && list.size() > 0) { - startProcess2(id, planStartDate, unitId, list.get(0).getUserids()); - } - } - } - } - } - } else if (libraryRoutineWork.getWeekRegister() != null && libraryRoutineWork.getWorkFrequencyType().equals(LibraryRoutineWork.Frequency_Type_Week)) { - //周下发 - String[] weekRegisters = libraryRoutineWork.getWeekRegister().split(","); - int weekInterval = libraryRoutineWork.getWeekInterval(); - for (String wN : weekRegisters) { - if (Integer.valueOf(wN) == nowWeekDay) { - Boolean needDown = false;//是否需要下发 - if (weekInterval == 0) { - needDown = true; - } else { - int moveDays = 7 * (weekInterval + 1); - int weekIntervalListSize = this.routineWorkService.selectCountByWhere(" where datediff(day,insdt,'" + nowTime + "')=" + moveDays + " and library_id='" + libraryId + "' "); - if (weekIntervalListSize > 0) { - needDown = true; - } - } - - //是否第一次触发 - int firstListSize = this.routineWorkService.selectCountByWhere(" where library_id='" + libraryId + "' "); - if (firstListSize == 0) { - needDown = true; - } - - if (needDown) { - int listSize = this.routineWorkService.selectCountByWhere(" where datediff(day,insdt,'" + nowTime + "')=0 and library_id='" + libraryId + "' "); - if (listSize == 0) { - String res = this.routineWorkService.doCreate(id, libraryId, unitId, typestr, nowTime); - if (res.equals(CommString.Status_Pass)) { - /* - 自动下发功能 (之前只自动生成不自动下发) - sj 2021-07-23 - */ - System.out.println("存在工单-周"); - String planStartDate = CommUtil.nowDate(); - - //查询当班人员 - List list = schedulingService.selectListByWhere("where schedulingtype = 'run' and stdt <= '" + planStartDate + "' and eddt >= '" + planStartDate + "'"); - if (list != null && list.size() > 0) { - startProcess2(id, planStartDate, unitId, list.get(0).getUserids()); - } - } - } - } - } - } - } else if (libraryRoutineWork.getMonthRegister() != null && libraryRoutineWork.getWorkFrequencyType().equals(LibraryRoutineWork.Frequency_Type_Month)) { - //月下发 - String[] monthRegisters = libraryRoutineWork.getMonthRegister().split(","); - for (String mN : monthRegisters) { - if (mN.equals(LibraryRoutineWork.LastDay)) { - mN = String.valueOf(maxMonth); - } - if (Integer.valueOf(mN) == nowMonthDay) { - int listSize = this.routineWorkService.selectCountByWhere(" where datediff(month,insdt,'" + nowTime + "')=0 and library_id='" + libraryId + "' "); - if (listSize == 0) { - String res = this.routineWorkService.doCreate(id, libraryId, unitId, typestr, nowTime); - if (res.equals(CommString.Status_Pass)) { - /* - 自动下发功能 (之前只自动生成不自动下发) - sj 2021-07-23 - */ - System.out.println("存在工单-月"); - String planStartDate = CommUtil.nowDate(); - - //查询当班人员 - List list = schedulingService.selectListByWhere("where schedulingtype = 'run' and stdt <= '" + planStartDate + "' and eddt >= '" + planStartDate + "'"); - if (list != null && list.size() > 0) { - startProcess2(id, planStartDate, unitId, list.get(0).getUserids()); - } - } - } - } - } - } - - } - } - System.out.println(CommUtil.nowDate() + "====常规工单任务下发结束"); - } - - /** - * 启动流程 - * - * @param id - * @param planStartDate 计划时间 - * @param unitId 厂id - * @param receiveUserIds 接收人员id - */ - public void startProcess2(String id, String planStartDate, String unitId, String receiveUserIds) { - RoutineWork routineWork = this.routineWorkService.selectById(id); - routineWork.setStatus(RoutineWork.Status_Start); - routineWork.setPlanStartDate(planStartDate); - routineWork.setUnitId(unitId); - routineWork.setReceiveUserIds(receiveUserIds); - int result = 0; - try { - result = this.routineWorkService.startProcess(routineWork); - } catch (Exception e) { - e.printStackTrace(); - } -// String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + routineWork.getId() + "\"}"; -// System.out.println("sj------------------"+resstr); - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/MPointMorderJob.java b/src/com/sipai/quartz/job/MPointMorderJob.java deleted file mode 100644 index b9bac5f1..00000000 --- a/src/com/sipai/quartz/job/MPointMorderJob.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.SpringContextUtil; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 每天将测量点总表按id字段排序一次 (xml配置的写法,南厂目前用不了数据库配置的那种) - */ -public class MPointMorderJob { - - /*@Resource - private MPointService mPointService; - @Resource - private CompanyService companyService;*/ - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - CompanyService companyService = (CompanyService) SpringContextUtil.getBean("companyService"); - - public void run1(ScheduleJob scheduleJob) { - System.out.println("开始同步测量点排序======"); - List list_c = companyService.selectListByWhere("where 1=1 and type='B' "); - for (Company company : list_c) { - String unitId = company.getId(); - try { - List list = mPointService.selectListByWhere(unitId, "where 1=1 order by LEN(id),id asc"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - MPoint mPoint = list.get(i); - mPoint.setMorder(i); - mPointService.update2(unitId, mPoint); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - System.out.println("结束同步测量点排序======"); - } - -} diff --git a/src/com/sipai/quartz/job/MPointPropCalcJob_Day.java b/src/com/sipai/quartz/job/MPointPropCalcJob_Day.java deleted file mode 100644 index ce80d82b..00000000 --- a/src/com/sipai/quartz/job/MPointPropCalcJob_Day.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.sipai.quartz.job; - - -import com.sipai.entity.enums.TimeUnitEnum; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointPropService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import org.apache.log4j.Logger; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.TimeUnit; - -public class MPointPropCalcJob_Day { - private static final Logger logger = Logger.getLogger(MPointPropCalcJob_Day.class); - - @Resource - private MPointPropService mPointPropService; - @Resource - private MPointService mPointService; - - public void execute(){ - //业务方法 - String nowTime =CommUtil.nowDate(); - logger.info("-----------按日计算定时器任务------启动----------"+nowTime); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); - boolQueryBuilder.must(QueryBuilders.matchQuery("frequnit",TimeUnitEnum.DAY.getId())); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - //所有当前频率的KPI计算点--需要计算的 - List mPoints_source= this.mPointService.selectListByWhere(nativeSearchQueryBuilder); - //所有子KPI点,结果包含父KPI--需要按顺序计算的 - List mPoints=mPointPropService.getChildKPIPoints(TimeUnitEnum.DAY.getId()); - //不属于同一时间类型(如天、小时)的点不考虑计算,计算点历史直接生成不需要此过滤 - Iterator iterator =mPoints.iterator(); - while (iterator.hasNext()){ - MPoint mPoint = iterator.next(); - if (!TimeUnitEnum.DAY.getId().equals(mPoint.getFrequnit())){ - iterator.remove(); - } - } - //计算mPoints_source中无需按顺序计算的点 - for (MPoint mPoint_s : mPoints_source) { - int i=0; - //判断mPoint_s在不在 mPoints中,不在则直接异步计算 - for (i=0;i mPoints_source= this.mPointService.selectListByWhere(nativeSearchQueryBuilder); - //所有子KPI点,包含父KPI - List mPoints=mPointPropService.getChildKPIPoints(TimeUnitEnum.HOUR.getId()); - //不属于同一时间类型(如天、小时)的点不考虑计算,计算点历史直接生成不需要此过滤 - Iterator iterator =mPoints.iterator(); - while (iterator.hasNext()){ - MPoint mPoint = iterator.next(); - if (!TimeUnitEnum.HOUR.getId().equals(mPoint.getFrequnit())){ - iterator.remove(); - } - } - for (MPoint mPoint_s : mPoints_source) { - int i=0; - for (i=0;i mPoints_source= this.mPointService.selectListByWhere(nativeSearchQueryBuilder); -// logger.info("-----------获取源测量点----------"+ JSONArray.toJSONString(mPoints_source)); - //所有子KPI点,包含父KPI - List mPoints=mPointPropService.getChildKPIPoints(TimeUnitEnum.MINUTE.getId()); -// logger.info("-----------分钟子KPI测量点----------"+ JSONArray.toJSONString(mPoints)); - //不属于同一时间类型(如天、小时)的点不考虑计算,计算点历史直接生成不需要此过滤 - Iterator iterator =mPoints.iterator(); - while (iterator.hasNext()){ - MPoint mPoint = iterator.next(); - if (!TimeUnitEnum.MINUTE.getId().equals(mPoint.getFrequnit())){ - iterator.remove(); - } - } - List> futures = new ArrayList<>(); - for (MPoint mPoint_s : mPoints_source) { - int i=0; - for (i=0;i item =this.mPointPropService.calculateAndSaveAsync(mPoint_s.getBizid(), mPoint_s,nowDate); - futures.add(item); - } - } - logger.info("级联计算点---"+nowTime+"---"+JSONArray.toJSONString(mPoints)); - for (MPoint mPoint : mPoints) { - - String nowDate = CommUtil.adjustTime(nowTime,mPoint.getFrequnit(),true); - if (mPoint!= null && checkExec(nowDate,mPoint)) { - this.mPointPropService.calculateAndSave(mPoint.getBizid(), mPoint,nowDate); - } - - } - //线程设置超时,防止一直等待 - for (Future future : futures) { - try { - String id =(String)future.get(60,TimeUnit.SECONDS); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - logger.error(e.getMessage()); - e.printStackTrace(); - } catch (ExecutionException | TimeoutException e) { - logger.error(e.getMessage()); - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - } - /** - * 检测测量点频率freq,是否满足执行条件 - * @param mPoint - * @return - */ - public boolean checkExec(String nowTime,MPoint mPoint) { - boolean res = false; - if (mPoint.getFrequnit() == null || mPoint.getFreq()==null) { - return res; - } - Calendar calendar = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date date = sdf.parse(nowTime); - calendar.setTime(date); - TimeUnitEnum timeUnitEnum = TimeUnitEnum.getTypeByValue(mPoint.getFrequnit()); - int pastTime =1; - switch (timeUnitEnum) { - case MINUTE: - pastTime= calendar.get(Calendar.MINUTE); - break; - case HOUR: - pastTime= calendar.get(Calendar.HOUR_OF_DAY); - break; - case DAY: - pastTime= calendar.get(Calendar.DAY_OF_YEAR); - break; - case MONTH: - pastTime= calendar.get(Calendar.MONTH); - break; - case YEAR: - pastTime= calendar.get(Calendar.YEAR); - break; - } - if(pastTime%mPoint.getFreq()==0){ - res= true; - } - logger.info("checkExec---"+mPoint.getId()+"--"+nowTime+"----"+pastTime+"---"+res); - } catch (ParseException e) { - e.printStackTrace(); - } - return res; - } - - /*public boolean checkExec(MPoint mPoint){ - boolean res=true; - if (mPoint!=null && mPoint.getFreq()>1) { - RMap mPoint_Minute=redissonClient.getMap("MPoint_Minute"); - int num =Integer.valueOf(mPoint_Minute.get(mPoint.getId())==null?"1":mPoint_Minute.get(mPoint.getId()).toString()); - if (num>=mPoint.getFreq()) { - mPoint_Minute.put(mPoint.getId(), 1); - }else{ - num++; - mPoint_Minute.put(mPoint.getId(), num); - res=false; - } - - } - return res; - }*/ - -} diff --git a/src/com/sipai/quartz/job/MaintenancePlanJob.java b/src/com/sipai/quartz/job/MaintenancePlanJob.java deleted file mode 100644 index 33e284cc..00000000 --- a/src/com/sipai/quartz/job/MaintenancePlanJob.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.quartz.job; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.dao.maintenance.MaintenanceDetailDao; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.MaintenancePlanService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.sparepart.StockService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -public class MaintenancePlanJob { - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private MaintenanceDetailDao maintenanceDetailDao; - @Resource - private StockService stockService; - - public void execute() throws ParseException{ - Date nowTime = new Date(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - Calendar cal = Calendar.getInstance(); - - //当前日期 - String nowDateStr = sdf.format(nowTime); - //当前日期的天,属于几号 - String nowDay = nowDateStr.substring(8,10); - //当天日期的月和天,几月几号 - String nowMonthDay = nowDateStr.substring(5,10); - nowMonthDay = nowMonthDay.replace("-", ""); - - //定时下发维护保养计划,查询审核通过的保养计划 - List maintenanceList = this.maintenancePlanService.selectListByWhere("where active = '"+MaintenanceCommString.PLAN_FINISH+"'"); - if (null != maintenanceList && maintenanceList.size()>0) { - for (MaintenancePlan maintenancePlan : maintenanceList) { - - if (null != maintenancePlan.getPlanType()&& !maintenancePlan.getPlanType().isEmpty()&& - null != maintenancePlan.getInitialDate() && !maintenancePlan.getInitialDate().isEmpty()) { - - switch (maintenancePlan.getPlanType()) { - - //月度保养计划,根据初始日期的号下发,每月下发一次 - case MaintenanceCommString.MAINTAIN_MONTH: - String initialDay = maintenancePlan.getInitialDate().substring(8,10); - if (nowDay.equals(initialDay)) { - int result=this.maintenancePlanService.issueMaintainPlan(maintenancePlan); - if (result!=1) { - break; - } - } - break; - - //年度保养计划,按照初始日期的月份下发,每年下发一次 - case MaintenanceCommString.MAINTAIN_YEAR: - String initialMonthDay = maintenancePlan.getInitialDate().substring(5,10); - initialMonthDay = initialMonthDay.replace("-", ""); - if (nowMonthDay.equals(initialMonthDay)) { - int result=this.maintenancePlanService.issueMaintainPlan(maintenancePlan); - if (result!=1) { - break; - } - } - break; - - //半年度保养计划,初始日期的月日,加半年后的月日下发 - case MaintenanceCommString.MAINTAIN_HALFYEAR: - //初始日期 - String initialDate = maintenancePlan.getInitialDate(); - Date date_init = sdf.parse(initialDate); - cal.setTime(date_init); - cal.add(Calendar.MONTH, 6); - //六个月后的日期 - String nextDate = sdf.format(cal.getTime()); - - initialDate = initialDate.substring(5,10).replace("-", ""); - nextDate = nextDate.substring(5,10).replace("-", ""); - - if (nowMonthDay.equals(initialDate) || nowMonthDay.equals(nextDate)) { - int result=this.maintenancePlanService.issueMaintainPlan(maintenancePlan); - if (result!=1) { - break; - } - } - break; - - default: - break; - - } - } - } - } - - - //库存报警,每天检查一次 - Liststocks = this.stockService.selectListByWhere("1=1");//mapper的selectListByWhere方法有了where 这里不需要加where - for (Stock stock : stocks) { - stock = this.stockService.stockAlarm(stock); - this.stockService.update(stock); - } - } -} diff --git a/src/com/sipai/quartz/job/ModbusListenerJob.java b/src/com/sipai/quartz/job/ModbusListenerJob.java deleted file mode 100644 index f83c77b0..00000000 --- a/src/com/sipai/quartz/job/ModbusListenerJob.java +++ /dev/null @@ -1,471 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.Listener.ListenerHis; -import com.sipai.entity.Listener.ListenerInterface; -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.Listener.ListenerPoint; -import com.sipai.entity.alarm.*; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.work.Camera; -import com.sipai.service.Listener.ListenerHisService; -import com.sipai.service.Listener.ListenerInterfaceService; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.Listener.ListenerPointService; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.alarm.AlarmSubscribeService; -import com.sipai.service.cmd.CmdService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.*; -import com.alibaba.fastjson.JSONObject; -import com.sipai.websocket.MsgWebSocket2; -import org.apache.commons.lang3.StringUtils; - - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.List; - -/** - * ycy 2021-11-17 - * // rtsp://admin:admin12345@132.120.136.228/h264/ch1/sub/av_stream 海康的 - * // rtsp://admin:zhwld88888@192.168.7.69:554/cam/realmonitor?channel=1&subtype=0 这是大华的视频流格式 - */ -public class ModbusListenerJob { - - ListenerPointService listenerPointService = (ListenerPointService) SpringContextUtil.getBean("listenerPointService"); - ListenerHisService listenerHisService = (ListenerHisService) SpringContextUtil.getBean("listenerHisService"); - // ListenerInterfaceService listenerInterfaceService = (ListenerInterfaceService) SpringContextUtil.getBean("listenerInterfaceService"); - ListenerMessageService listenerMessageSerice = (ListenerMessageService) SpringContextUtil.getBean("listenerMessageService"); - // MPointService mPointService = (MPointService) SpringContextUtil.getBean("MPointService"); - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - CameraService cameraService = (CameraService) SpringContextUtil.getBean("cameraService"); - EquipmentCardCameraService equipmentCardCameraService = (EquipmentCardCameraService) SpringContextUtil.getBean("equipmentCardCameraService"); - AlarmPointService alarmPointService = (AlarmPointService) SpringContextUtil.getBean("alarmPointService"); - AlarmInformationService alarmInformationService = (AlarmInformationService) SpringContextUtil.getBean("alarmInformationService"); - AlarmSubscribeService alarmSubscribeService = (AlarmSubscribeService) SpringContextUtil.getBean("alarmSubscribeService"); - ProAlarmService proAlarmService = (ProAlarmService) SpringContextUtil.getBean("proAlarmService"); - ProcessSectionService processSectionService = (ProcessSectionService) SpringContextUtil.getBean("processSectionService"); - CmdService cmdService = (CmdService) SpringContextUtil.getBean("cmdService"); - - /** - * modbus定时扫描配置的寄存器地址 - * - * @param scheduleJob - */ - public void modbusSend(ScheduleJob scheduleJob) { - System.out.println("进了定时器:" + CommUtil.nowDate()); - List listenerPoints = listenerPointService.selectListByWhere("where address is not null and address <> '' and (intid!='MQTT' or intid!='mqtt') order by address asc "); - for (int x = 0; x < listenerPoints.size(); x++) { - ListenerPoint listenerPoint = listenerPoints.get(x); - String address = listenerPoint.getAddress().substring(1, listenerPoint.getAddress().length() - 1); - try { - Number number = null; - // 格式化modbus查出来之后值的对象 - DecimalFormat df = new DecimalFormat("0.0000"); - int datatype = 0; - - int add = Integer.valueOf(address); - - if (listenerPoint.getUnitid().equals("021HJHY")) { - // 如果点位表的modbus的register地址包含F那么值的类型就是float - if (listenerPoint.getAddress().contains("F")) { - datatype = 8; - } else if (listenerPoint.getAddress().contains("I")) { // 如果点位表的modbus的register地址包含I那么值的类型就是int - datatype = 3; - } - add = add - 1; - } else { - // 如果点位表的modbus的register地址包含F那么值的类型就是float - if (listenerPoint.getAddress().contains("F")) { - datatype = 8; - } else if (listenerPoint.getAddress().contains("I")) { // 如果点位表的modbus的register地址包含I那么值的类型就是int - datatype = 2; - } - } - - if (datatype != 0) { - number = ModbusRAndW.readHoldingRegister(1, add, datatype); - } - -// System.out.println("address======" + address + "======number======" + number); - - float v = Float.parseFloat(df.format(number)); - if (Float.parseFloat(df.format(number)) == Float.parseFloat("1")) { - - //modbus写值(往回写0) - ModbusRAndW.writeHoldingRegister(1, add, 0, datatype); - - if (listenerPoints.get(0).getLogi() != null) { - BigDecimal value_BigDecimal = new BigDecimal(df.format(number)); - BigDecimal logival_bigdecimal = new BigDecimal(listenerPoints.get(0).getLogiVal()); - if (listenerPoints.get(0).getLogi().contains("=")) { - if (value_BigDecimal.compareTo(logival_bigdecimal) == 0) { - - } else { - System.out.println("不符合条件退出循环:="); - continue; - } - } else if (listenerPoints.get(0).getLogi().contains(">")) { - if (value_BigDecimal.compareTo(logival_bigdecimal) > 0) { - - } else { - System.out.println("不符合条件退出循环:>"); - continue; - } - } else if (listenerPoints.get(0).getLogi().contains("<")) { - if (value_BigDecimal.compareTo(logival_bigdecimal) < 0) { - - } else { - System.out.println("不符合条件退出循环:<"); - continue; - } - } else if (listenerPoints.get(0).getLogi().equals("change")) { - if (value_BigDecimal.compareTo(logival_bigdecimal) != 0) { - - } else { - System.out.println("不符合条件退出循环:change"); - continue; - } - } else { - continue; - } - } - - // 存modbus历史表 并且 把modbus的寄存器地址的值清0 - ListenerHis listenerHis = new ListenerHis(); - listenerHis.setId(CommUtil.getUUID()); - listenerHis.setPointid(listenerPoint.getId()); - listenerHis.setType(listenerPoint.getType()); - listenerHis.setValue(number.toString()); - listenerHis.setInsdt(CommUtil.nowDate()); - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - List mPoints = mPointService.selectListByWhere(listenerPoint.getUnitid(), "where MpointCode = '" + listenerPoint.getMpcode() + "'"); - if (mPoints.size() == 1) { - MPoint mPoint = mPoints.get(0); - - String prSectionName = ""; - List prSection = this.processSectionService.selectListByWhere(" where code='" + mPoint.getProcesssectioncode() + "' and unit_id='" + mPoint.getBizid() + "' "); - if (prSection != null && prSection.size() > 0) { - prSectionName = prSection.get(0).getName(); - } - - /** - * 平台弹窗JSON - */ - JSONObject jsonWeb = new JSONObject(); - jsonWeb.put("cmdType", "web"); - jsonWeb.put("objId", mPoint.getId()); - jsonWeb.put("objName", mPoint.getParmname()); - jsonWeb.put("action", "layer"); - - //报警当前值 - jsonWeb.put("alarmValue", new BigDecimal(df.format(number) + "")); - //厂id - jsonWeb.put("unitId", mPoint.getBizid()); - //工艺段code - jsonWeb.put("processsectionCode", mPoint.getProcesssectioncode()); - jsonWeb.put("processsectionName", prSectionName); - -// List list = decisionExpertBaseService.selectListByWhere("where mpid = '" + listenerPoint.getMpcode() + "'"); - - //专家建议 - jsonWeb.put("expert_advice", "无"); - //报警时间 - jsonWeb.put("alarm_time", CommUtil.nowDate().substring(0, 19)); - //报警类型 - jsonWeb.put("alarm_type", AlarmMoldCodeEnum.Type_SCADA.getName()); - //报警类型 - jsonWeb.put("alarm_type_key", AlarmMoldCodeEnum.Type_SCADA.getKey()); - //报警描述 - jsonWeb.put("alarm_description", listenerPoint.getName()); - - /** - * 平台弹窗 - */ - JSONObject jsonAlert = JSONObject.parseObject(MessageEnum.THE_ALERT.toString()); - jsonAlert.put("action", mPoint.getId() + "(" + mPoint.getParmvalue() + "-1)"); - - //如果 datatype不为空 则规则发送指令,如果为空,则所有行为都发送 - if (listenerPoints.get(x).getDatatype() != null && !listenerPoints.get(x).getDatatype().trim().equals("")) { - if (listenerPoints.get(x).getDatatype().contains(MessageEnum.THE_WEB.getCmdtype())) { - // mqtt发布消息 - sendWebAlarmAlert(jsonWeb, mPoint.getId()); - int camera = saveMessage("web", "标识1_" + mPoint.getId(), "layer"); - if (camera != 1) { - System.out.println("存cmd失败"); - } - } - if (listenerPoints.get(x).getDatatype().contains(MessageEnum.THE_ALERT.getCmdtype())) { - //调用指令给BIM发消息(Alert) - /*WebSocketCmdUtil.send(jsonAlert); - int i = saveMessage(jsonAlert.get("cmdType").toString(), "标识2_" + jsonAlert.get("objId").toString(), jsonAlert.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - }*/ - } - } else { - // mqtt发布消息 - sendWebAlarmAlert(jsonWeb, mPoint.getId()); - int camera = saveMessage("web", "标识3_" + mPoint.getId(), "layer"); - if (camera != 1) { - System.out.println("存cmd失败"); - } - //调用指令给BIM发消息(Alert) - /*WebSocketCmdUtil.send(jsonAlert); - int i = saveMessage(jsonAlert.get("cmdType").toString(), "标识4_" + jsonAlert.get("objId").toString(), jsonAlert.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - }*/ - } - - // 构筑物id - String structureId = mPoint.getStructureId(); - //构筑物 - if (StringUtils.isNotBlank(structureId)) { - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_SCREEN.toString()); - jsonObject.put("objId", structureId); - - List cameras = cameraService.selectListByWhere("where configid = '" + structureId + "'"); - if (cameras != null && cameras.size() > 0) { - JSONObject cameraJson = JSONObject.parseObject(MessageEnum.THE_OPENCAM.toString()); - Camera camera01 = cameras.get(0); - if ("dahua".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/cam/realmonitor?channel=" + camera01.getChannel() + "&subtype=0"; - cameraJson.put("objId", came); - cameraJson.put("camId", camera01.getId()); - } else if ("hikvision".equals(cameras.get(0).getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/h264/ch" + camera01.getChannel() + "/main/av_stream"; - cameraJson.put("objId", came); - cameraJson.put("camId", camera01.getId()); - } - - /** - * 是为适配皇家花园 增加 objIds 沙口三维目前还继续用objId单个摄像头 - */ - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("camId", cameraJson.get("camId")); - jsonObject1.put("camurl", cameraJson.get("objId")); - jsonArray.add(jsonObject1); - cameraJson.put("objIds", jsonArray); - - if (listenerPoints.get(x).getDatatype() != null && !listenerPoints.get(x).getDatatype().trim().equals("")) { - if (listenerPoints.get(x).getDatatype().contains(MessageEnum.THE_OPENCAM.getCmdtype())) { -// System.out.println("if--------------------推送类型:" + MessageEnum.THE_OPENCAM.getCmdtype()); - //调用指令给BIM发消息(摄像头) - WebSocketCmdUtil.send(cameraJson); - int camera2 = saveMessage(cameraJson.get("cmdType").toString(), "标识5_" + cameraJson.get("objId").toString(), cameraJson.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - if (listenerPoints.get(x).getDatatype().contains(MessageEnum.THE_SCREEN.getCmdtype())) { -// System.out.println("if--------------------推送类型:" + MessageEnum.THE_SCREEN.getCmdtype()); - //调用指令给BIM发消息(摄像头) - WebSocketCmdUtil.send(jsonObject); - int i = saveMessage(jsonObject.get("cmdType").toString(), "标识6_" + jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - } - } else { -// System.out.println("else--------------------推送类型:" + MessageEnum.THE_OPENCAM.getCmdtype()); - //调用指令给BIM发消息(摄像头) - WebSocketCmdUtil.send(cameraJson); - int camera2 = saveMessage(cameraJson.get("cmdType").toString(), "标识7_" + cameraJson.get("objId").toString(), cameraJson.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - } - } - - //设备 - if (StringUtils.isNotBlank(mPoint.getEquipmentid())) { - //设备id - String equipmentid = mPoint.getEquipmentid(); - List equipmentCardList = equipmentCardService.selectListByWhere("where id = '" + equipmentid + "'"); - if (equipmentCardList.size() > 0) { - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_FINDOBJ.toString()); - jsonObject.put("objId", equipmentCardList.get(0).getEquipmentcardid()); - jsonObject.put("time", System.currentTimeMillis()); - - if (listenerPoints.get(x).getDatatype() != null && !listenerPoints.get(x).getDatatype().trim().equals("")) { - if (listenerPoints.get(x).getDatatype().contains(MessageEnum.THE_FINDOBJ.getCmdtype())) { - //调用指令给BIM发消息(定位) - WebSocketCmdUtil.send(jsonObject); - // 存message表 - int i = saveMessage(jsonObject.get("cmdType").toString(), "标识8_" + jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - } - } else { - //调用指令给BIM发消息(定位) - WebSocketCmdUtil.send(jsonObject); - // 存message表 - int i = saveMessage(jsonObject.get("cmdType").toString(), "标识9_" + jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (i != 1) { - System.out.println("存cmd失败"); - } - } - - // 三维使用websocket发送json并且三维是用equipmentCardID关联 -// List cameras = cameraService.selectListByWhere("where configid = '" + equipmentCardList.get(0).getId() + "'"); - List cameras = equipmentCardCameraService.selectListByWhere("where eqid = '" + equipmentCardList.get(0).getId() + "'"); - if (cameras != null && cameras.size() > 0) { - JSONObject cameraJson = JSONObject.parseObject(MessageEnum.THE_OPENCAM.toString()); - Camera camera01 = cameraService.selectById(cameras.get(0).getCameraid()); - if ("dahua".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/cam/realmonitor?channel=" + camera01.getChannel() + "&subtype=0"; - cameraJson.put("objId", came); - cameraJson.put("camId", camera01.getId()); -// cameraJson.put("action", "play[" + listenerPoint.getName() + "]"); - cameraJson.put("action", listenerPoint.getName()); - } else if ("hikvision".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/h264/ch" + camera01.getChannel() + "/main/av_stream"; - cameraJson.put("objId", came); - cameraJson.put("camId", camera01.getId()); -// cameraJson.put("action", "play[" + listenerPoint.getName() + "]"); - cameraJson.put("action", listenerPoint.getName()); - } - - /** - * 是为适配皇家花园 增加 objIds 沙口三维目前还继续用objId单个摄像头 - */ - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject1 = new JSONObject(); - jsonObject1.put("camId", cameraJson.get("camId")); - jsonObject1.put("camurl", cameraJson.get("objId")); - jsonArray.add(jsonObject1); - cameraJson.put("objIds", jsonArray); - - if (listenerPoints.get(x).getDatatype() != null && !listenerPoints.get(x).getDatatype().trim().equals("")) { - if (listenerPoints.get(x).getDatatype().contains(MessageEnum.THE_OPENCAM.getCmdtype())) { - //调用指令给BIM发消息(摄像头) - WebSocketCmdUtil.send(cameraJson); - int camera2 = saveMessage(cameraJson.get("cmdType").toString(), "标识10_" + cameraJson.get("objId").toString(), cameraJson.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - } else { - //调用指令给BIM发消息(摄像头) - WebSocketCmdUtil.send(cameraJson); - int camera2 = saveMessage(cameraJson.get("cmdType").toString(), "标识11_" + cameraJson.get("objId").toString(), cameraJson.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - } - } - } - } - //监听modbus历史记录 - listenerHisService.save(listenerHis); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - } - - /** - * 发送socket - * - * @param jsonObject - */ - public void sendSocketMessage(JSONObject jsonObject) { - MsgWebSocket2 msg = new MsgWebSocket2(); - msg.onMessage(jsonObject.toString(), null); - } - - /** - * 存收发记录 - * - * @param cmdtype - * @param objid - * @param action - * @return - */ - private int saveMessage(String cmdtype, String objid, String action) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setId(CommUtil.getUUID()); - listenerMessage.setCmdtype(cmdtype); - listenerMessage.setObjid(objid); - listenerMessage.setAction(action); - listenerMessage.setInsdt(CommUtil.nowDate()); - int save = listenerMessageSerice.save(listenerMessage); - return save; - } - - /** - * 给平台推送报警弹窗 - 根据测量点id推送给对应人员 - * - * @param jsonObject - * @param point - * @return - */ - public String sendWebAlarmAlert(JSONObject jsonObject, String point) { - //保存到平台报警表 - int result = this.alarmPointService.insertAlarm(jsonObject.get("unitId").toString(), null, jsonObject.get("alarm_type_key").toString(), jsonObject.get("objId").toString(), jsonObject.get("objName").toString(), jsonObject.get("alarm_time").toString(), AlarmLevelsCodeEnum.level1.toString(), jsonObject.get("alarm_description").toString(), jsonObject.get("alarmValue").toString(), jsonObject.get("processsectionCode").toString(), jsonObject.get("processsectionName").toString()); - - String userIds = ""; - List plist = this.alarmPointService.selectListByWhere2(" where alarm_point='" + point + "' "); - if (plist != null && plist.size() > 0) { - AlarmPoint alarmPoint = plist.get(0); - String informationCode = alarmPoint.getInformationCode(); - String alarmPointId = alarmPoint.getInformationCode(); - - //系统订阅 - List ilist = this.alarmInformationService.selectListByWhere2(" where code='" + informationCode + "' and unit_id='" + alarmPoint.getUnitId() + "' "); - if (ilist != null && ilist.size() > 0) { - userIds += ilist.get(0).getAlarmReceivers() + ","; - } - - AlarmSubscribe alarmSubscribe = this.alarmSubscribeService.selectById(alarmPointId); - if (alarmSubscribe != null) { - userIds += alarmSubscribe.getUserid() + ","; - } - - if (userIds != null && !userIds.equals("")) { - String[] id = userIds.split(","); - for (String s : id) { - //给指定人弹窗 - MqttUtil.publish(jsonObject, Mqtt.Type_Alarm_Popup_Topic + "_" + s); - } - } - - try { - //给三维推送报警信息及专家建议 - if (jsonObject.get("expert_advice") != null && !jsonObject.get("expert_advice").equals("")) { - cmdService.handle4Alarm(jsonObject.get("alarm_description") + "。建议:" + jsonObject.get("expert_advice")); - } else { - cmdService.handle4Alarm(jsonObject.get("alarm_description") + "。暂无专家建议"); - } - } catch (Exception e) { - - } - - } - return userIds; - } - -} diff --git a/src/com/sipai/quartz/job/ModbusListenerJob_NS_JQR.java b/src/com/sipai/quartz/job/ModbusListenerJob_NS_JQR.java deleted file mode 100644 index 8485d3fb..00000000 --- a/src/com/sipai/quartz/job/ModbusListenerJob_NS_JQR.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.Listener.ListenerHis; -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.Listener.ListenerPoint; -import com.sipai.entity.alarm.*; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.work.Camera; -import com.sipai.service.Listener.ListenerHisService; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.Listener.ListenerPointService; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.alarm.AlarmSubscribeService; -import com.sipai.service.bim.RobotService; -import com.sipai.service.cmd.CmdService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.*; -import com.sipai.websocket.MsgWebSocket2; -import org.apache.commons.lang3.StringUtils; -import org.checkerframework.checker.units.qual.A; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.scheduling.annotation.Async; - -import javax.annotation.Resource; -import java.io.IOException; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.List; -import java.util.Map; - -/** - * 南市机器人数据推送给三维 - modbus读取数据处理后websocket推送给三维 - */ -public class ModbusListenerJob_NS_JQR { - - @Resource - private RedissonClient redissonClient; - @Resource - private RobotService robotService; - - /** - * modbus定时扫描配置的寄存器地址 - * - * @param - */ - - int num = 0; - - public void fun1() { - //移到 jqr 项目里了 - } - -} diff --git a/src/com/sipai/quartz/job/ModelJob.java b/src/com/sipai/quartz/job/ModelJob.java deleted file mode 100644 index 2f12e4b5..00000000 --- a/src/com/sipai/quartz/job/ModelJob.java +++ /dev/null @@ -1,393 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * (泵组模型) - * 定期调用市政院webservice模型 保存预测30分钟的值 - * 用于重庆白洋滩项目--定制 - */ -public class ModelJob { - protected static String bizid = "768bfcaf247148a1ba1b3a26c9b9be7a";//厂id - - /** - * 高压出水瞬时流量 - */ - protected static String ll_high = "SS_SMA_SS_SMA_F01"; - /** - * 高压出水压力 - */ -// protected static String yl_high = "SS_SMA_SS_SMA_yl1"; - - /** - * 低压出水瞬时流量 - */ - protected static String ll_low = "SS_SMA_SS_SMA_F02"; - /** - * 低压出水压力 - */ -// protected static String yl_low = "SS_SMA_SS_SMA_yl2"; - - - /** - * 预测高压出水瞬时流量 - */ - protected static String ll_nest_high = "YC_CSGLL"; - /** - * 预测高压出水压力 - */ - protected static String yl_nest_high = "YC_CSGYL"; - /** - * 预测低压出水瞬时流量 - */ - protected static String ll_nest_lowhigh = "YC_CSDLL"; - /** - * 预测低压出水压力 - */ - protected static String yl_nest_low = "YC_CSDYL"; - - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - public void excute() { - System.out.println("执行web方法(泵组)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/Pump_QH"; - try { - sendPost_High_ll(wsUrl); - sendPost_High_yl(wsUrl); - sendPost_Low_ll(wsUrl); - sendPost_Low_yl(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - public String sendPost_High_ll(String postURL) { -// System.out.println("进入高压流量定时器"); - - //最近时间的6个点数值 - String fQ_d = ""; - List list_fq = mPointHistoryService.selectListByTableAWhere(bizid, "tb_mp_" + ll_high, " order by 3 desc"); - if (list_fq != null && list_fq.size() > 6) { - for (int i = 0; i < 6; i++) { - fQ_d += list_fq.get(i).getParmvalue() + ","; - } - fQ_d = fQ_d.substring(0, fQ_d.length() - 1); - } - - String result = ""; - try { - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("idex", "1"),//int型,只能为0或是1,其中0代表预测低区送水水量和压力,1代表预测高区送水量和压力 - new NameValuePair("SL", fQ_d)//字符串型,从当前时刻往前n个时刻(n值不限,建议要大于8比较好)的水量数据,建议时间间隔为5min,格式为:水量1,水量2,水量3,水量4,……,水量n-1,水量n,各水量之间以“,”隔开。 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String fq1 = fx(xml, "fq1", "".length()); - String fq2 = fx(xml, "fq2", "".length()); - String fq3 = fx(xml, "fq3", "".length()); - String fq4 = fx(xml, "fq4", "".length()); - String fq5 = fx(xml, "fq5", "".length()); - String fq6 = fx(xml, "fq6", "".length()); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 - mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + ll_nest_high + "]", "where 1=1 "); - - //更新总表 - save(ll_nest_high, fq1, 5, bizid); - - //新增子表 - save_his(ll_nest_high, fq1, 5); - save_his(ll_nest_high, fq2, 10); - save_his(ll_nest_high, fq3, 15); - save_his(ll_nest_high, fq4, 20); - save_his(ll_nest_high, fq5, 25); - save_his(ll_nest_high, fq6, 30); - - return result; - } - - /** - * 请求数据 -- 高压压力 - * - * @param postURL - * @return - */ - public String sendPost_High_yl(String postURL) { -// System.out.println("进入高压压力定时器"); - - //最近时间的6个点数值 - String fQ_d = ""; - List list_fq = mPointHistoryService.selectListByTableAWhere(bizid, "tb_mp_" + ll_high, " order by 3 desc"); - if (list_fq != null && list_fq.size() > 6) { - for (int i = 0; i < 6; i++) { - fQ_d += list_fq.get(i).getParmvalue() + ","; - } - fQ_d = fQ_d.substring(0, fQ_d.length() - 1); - } - - String result = ""; - try { - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("idex", "1"),//int型,只能为0或是1,其中0代表预测低区送水水量和压力,1代表预测高区送水量和压力 - new NameValuePair("SL", fQ_d)//字符串型,从当前时刻往前n个时刻(n值不限,建议要大于8比较好)的水量数据,建议时间间隔为5min,格式为:水量1,水量2,水量3,水量4,……,水量n-1,水量n,各水量之间以“,”隔开。 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String fq1 = fx(xml, "fh1", "".length()); - String fq2 = fx(xml, "fh2", "".length()); - String fq3 = fx(xml, "fh3", "".length()); - String fq4 = fx(xml, "fh4", "".length()); - String fq5 = fx(xml, "fh5", "".length()); - String fq6 = fx(xml, "fh6", "".length()); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 - mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + yl_nest_high + "]", "where 1=1 "); - - //更新总表 - save(yl_nest_high, fq1, 5, bizid); - - //新增子表 - save_his(yl_nest_high, fq1, 5); - save_his(yl_nest_high, fq2, 10); - save_his(yl_nest_high, fq3, 15); - save_his(yl_nest_high, fq4, 20); - save_his(yl_nest_high, fq5, 25); - save_his(yl_nest_high, fq6, 30); - - return result; - } - - /** - * 请求数据 -- 低压流量 - * - * @param postURL - * @return - */ - public String sendPost_Low_ll(String postURL) { -// System.out.println("进入低压流量定时器"); - - //最近时间的6个点数值 - String fQ_d = ""; - List list_fq = mPointHistoryService.selectListByTableAWhere(bizid, "tb_mp_" + ll_low, " order by 3 desc"); - if (list_fq != null && list_fq.size() > 6) { - for (int i = 0; i < 6; i++) { - fQ_d += list_fq.get(i).getParmvalue() + ","; - } - fQ_d = fQ_d.substring(0, fQ_d.length() - 1); - } - - String result = ""; - try { - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("idex", "0"),//int型,只能为0或是1,其中0代表预测低区送水水量和压力,1代表预测高区送水量和压力 - new NameValuePair("SL", fQ_d)//字符串型,从当前时刻往前n个时刻(n值不限,建议要大于8比较好)的水量数据,建议时间间隔为5min,格式为:水量1,水量2,水量3,水量4,……,水量n-1,水量n,各水量之间以“,”隔开。 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String fq1 = fx(xml, "fq1", "".length()); - String fq2 = fx(xml, "fq2", "".length()); - String fq3 = fx(xml, "fq3", "".length()); - String fq4 = fx(xml, "fq4", "".length()); - String fq5 = fx(xml, "fq5", "".length()); - String fq6 = fx(xml, "fq6", "".length()); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 - mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + ll_nest_lowhigh + "]", "where 1=1 "); - - //更新总表 - save(ll_nest_lowhigh, fq1, 5, bizid); - - //新增子表 - save_his(ll_nest_lowhigh, fq1, 5); - save_his(ll_nest_lowhigh, fq2, 10); - save_his(ll_nest_lowhigh, fq3, 15); - save_his(ll_nest_lowhigh, fq4, 20); - save_his(ll_nest_lowhigh, fq5, 25); - save_his(ll_nest_lowhigh, fq6, 30); - - return result; - } - - /** - * 请求数据 -- 低压压力 - * - * @param postURL - * @return - */ - public String sendPost_Low_yl(String postURL) { -// System.out.println("进入低压压力定时器"); - - //最近时间的6个点数值 - String fQ_d = ""; - List list_fq = mPointHistoryService.selectListByTableAWhere(bizid, "tb_mp_" + ll_low, " order by 3 desc"); - if (list_fq != null && list_fq.size() > 6) { - for (int i = 0; i < 6; i++) { - fQ_d += list_fq.get(i).getParmvalue() + ","; - } - fQ_d = fQ_d.substring(0, fQ_d.length() - 1); - } - - String result = ""; - try { - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("idex", "0"),//int型,只能为0或是1,其中0代表预测低区送水水量和压力,1代表预测高区送水量和压力 - new NameValuePair("SL", fQ_d)//字符串型,从当前时刻往前n个时刻(n值不限,建议要大于8比较好)的水量数据,建议时间间隔为5min,格式为:水量1,水量2,水量3,水量4,……,水量n-1,水量n,各水量之间以“,”隔开。 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String fq1 = fx(xml, "fh1", "".length()); - String fq2 = fx(xml, "fh2", "".length()); - String fq3 = fx(xml, "fh3", "".length()); - String fq4 = fx(xml, "fh4", "".length()); - String fq5 = fx(xml, "fh5", "".length()); - String fq6 = fx(xml, "fh6", "".length()); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 - mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + yl_nest_low + "]", "where 1=1 "); - - //更新总表 - save(yl_nest_low, fq1, 5, bizid); - - //新增子表 - save_his(yl_nest_low, fq1, 5); - save_his(yl_nest_low, fq2, 10); - save_his(yl_nest_low, fq3, 15); - save_his(yl_nest_low, fq4, 20); - save_his(yl_nest_low, fq5, 25); - save_his(yl_nest_low, fq6, 30); - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save(String mpId, String val, int timeStr, String unitId) { - try { - MPoint mPoint = mPointService.selectById(bizid, mpId); - mPoint.setParmvalue(new BigDecimal(val)); - mPoint.setMeasuredt(timeStr(timeStr)); - mPointService.update2(bizid, mPoint); - } catch (Exception e) { -// System.out.println(CommUtil.nowDate() + ":更新主表=" + e); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val, int timeStr) { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(val)); - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { -// System.out.println("----------------------------start----------------------------"); -// System.out.println(xml); -// System.out.println("----------------------------end----------------------------"); - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_BYT_BZNH.java b/src/com/sipai/quartz/job/ModelJob_BYT_BZNH.java deleted file mode 100644 index 061c5d35..00000000 --- a/src/com/sipai/quartz/job/ModelJob_BYT_BZNH.java +++ /dev/null @@ -1,281 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (泵站能耗模型) -- 二泵 - * 定期调用市政院webservice模型 保存预测30分钟的值 - * 用于白羊滩项目--定制 - */ -public class ModelJob_BYT_BZNH { - - - protected static String bizid = "768bfcaf247148a1ba1b3a26c9b9be7a";//厂id - /** - * station 参数 写死1 - */ - protected static int station_01 = 3; - /** - * spumpid 参数 写死1 - */ - protected static String spumpid_01 = "20001,20002,20003,20004"; - /** - * spump1参数 - */ - protected static String spump1_01 = "1,1,1,1"; - /** - * spump2参数 - */ - protected static String spump2_01 = "1"; - - /** - * fh参数 期望-压力 - */ - protected static String fh_01 = "BYT_QW_YL"; - - /** - * fvalue参数 期望-扬程 - */ - protected static String fvalue_01 = "BYT_QW_YC"; - - /** - * fq参数 期望-流量 - */ - protected static String fq_01 = "BYT_QW_LL"; - - /** - * index参数 - */ - protected static int index_01 = 1; - -// MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); -// MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - -// public void dataSave(ScheduleJob scheduleJob) { - public void dataSave() { - System.out.println("执行web方法(泵站能耗模型)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/PumpCalculate"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - - public String sendPost(String postURL) { - String result = ""; - try { - int station = station_01; - String spumpid = spumpid_01; - String spump1 = ""; - String spump2 = spump2_01; - double fh = 0; - double fvalue = 0; - double fq = 0; - int index = index_01; - - /** - * spump1 - */ - for (int i = 1; i <= 4; i++) {//QS1_QS1_P1_Running QS3_QS3_P1_Running - MPoint mPoint1 = mPointService.selectById(bizid, "QS" + i + "_QS" + i + "_P1_Running"); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { -// spump1 += Double.parseDouble(mPoint1.getParmvalue().toString()) + ","; - spump1 += mPoint1.getParmvalue().toString() + ","; - } - } - if (spump1 != null && !spump1.equals("")) { - spump1 = spump1.substring(0, spump1.length() - 1); - } - - /** - * fh - */ - MPoint mPoint1 = mPointService.selectById(bizid, fh_01); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - fh = Double.parseDouble(mPoint1.getParmvalue().toString()); - } - - /** - * fvalue - */ - MPoint mPoint2 = mPointService.selectById(bizid, fvalue_01); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fvalue = Double.parseDouble(mPoint2.getParmvalue().toString()); - } - - /** - * fq - */ - MPoint mPoint3 = mPointService.selectById(bizid, fq_01); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - fq = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - - System.out.println("station: " + station); - System.out.println("spumpid: " + spumpid); - System.out.println("spump1: " + spump1); - System.out.println("spump2: " + spump2); - System.out.println("fh: " + fh); - System.out.println("fvalue: " + fvalue); - System.out.println("fq: " + fq); - System.out.println("index: " + index); - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("station", station + ""), - new NameValuePair("spumpid", spumpid + ""), - new NameValuePair("spump1", spump1 + ""), - new NameValuePair("spump2", spump2 + ""), - new NameValuePair("fh", fh + ""), - new NameValuePair("fvalue", fvalue + ""), - new NameValuePair("fq", fq + ""), - new NameValuePair("index", index + "") - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - -// System.out.println("s----------------------------------------------------" + CommUtil.nowDate()); -// System.out.println(result); -// System.out.println("e----------------------------------------------------" + CommUtil.nowDate()); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("\n", "").replace("\r", ""); - - String val = xml; - -// System.out.println("s1----------------------------------------------------" + CommUtil.nowDate()); -// System.out.println(val); -// System.out.println("e1----------------------------------------------------" + CommUtil.nowDate()); - - if (val != null && !val.trim().equals("")) { - String[] str = val.split(","); - if (str != null && str.length > 0) { - for (int i = 5; i <= 9; i++) { - switch (i) { - case 5: - save("QS1_QS1_P1_Running_YC_1P", str[i], bizid); - save_his("QS1_QS1_P1_Running_YC_1P", str[i], 0); - break; - case 6: - save("QS2_QS2_P1_Running_YC_1P", str[i], bizid); - save_his("QS2_QS2_P1_Running_YC_1P", str[i], 0); - break; - case 7: - save("QS3_QS3_P1_Running_YC_1P", str[i], bizid); - save_his("QS3_QS3_P1_Running_YC_1P", str[i], 0); - break; - case 8: - save("QS4_QS4_P1_Running_YC_1P", str[i], bizid); - save_his("QS4_QS4_P1_Running_YC_1P", str[i], 0); - break; - default: -// System.out.println("执行了default" + CommUtil.nowDate()); - } - } - //出水压力(方案1预测) - save("BYT_CSYL_YC_1P", str[str.length - 2], bizid); - save_his("BYT_CSYL_YC_1P", str[str.length - 2], 0); - - //出水流量(方案1预测) - save("BYT_CSLL_YC_1P", str[str.length - 1], bizid); - save_his("BYT_CSLL_YC_1P", str[str.length - 1], 0); - } - } - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val 测量点的值 - */ - public void save(String mpId, String val, String unitId) { - try { - val = val.replace("\n", "");//去除回车 - MPoint mPoint = mPointService.selectById(bizid, mpId); - //计算小数位 倍率强制为1 - BigDecimal parmValue = CommUtil.formatMPointValue(new BigDecimal(val), mPoint.getNumtail(), new BigDecimal("1")); - mPoint.setParmvalue(parmValue); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } catch (Exception e) { - System.out.println(CommUtil.nowDate() + ":更新主表=" + e); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val, int timeStr) { - val = val.replace("\n", "");//去除回车 - MPoint mPoint = mPointService.selectById(bizid, mpId); - //计算小数位 倍率强制为1 - BigDecimal parmValue = CommUtil.formatMPointValue(new BigDecimal(val), mPoint.getNumtail(), new BigDecimal("1")); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(parmValue); - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_FSSK_BZNH_1.java b/src/com/sipai/quartz/job/ModelJob_FSSK_BZNH_1.java deleted file mode 100644 index 76c1ee39..00000000 --- a/src/com/sipai/quartz/job/ModelJob_FSSK_BZNH_1.java +++ /dev/null @@ -1,328 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (泵站能耗模型) -- 一泵 - * 定期调用市政院webservice模型 保存预测30分钟的值 - * 用于沙口项目--定制 - */ -public class ModelJob_FSSK_BZNH_1 { - - - protected static String bizid = "FS_SK11_C";//厂id - - /** - * station 参数 写死1 - */ - protected static int station_01 = 2; - - /** - * spumpid 参数 写死1 - */ - protected static String spumpid_01 = "11001,11002,11003,11004,11005"; - - /** - * spump1参数 - */ - - /** - * spump2参数 - */ - protected static String spump2_01 = "1"; - - /** - * spump1参数 暂不使用 - */ - protected static String n_01 = "1"; - - /** - * fLvalue 参数 清水池液位(3个平均值) - */ - protected static String fLvalue_01 = ""; - - /** - * fQSvalue 参数 源水泵房流量 - */ - protected static String fQSvalue_01 = "SK_B_FT101_V_PV";//取水泵房_总源水瞬时流量 - - /** - * fGSvalue参数 送水泵房流量 - */ - protected static String fGSvalue_01 = "SK_ME_FT104_V_PV";//送水泵房_出厂水瞬时流量 - - /** - * rate参数 源水与清水流量的变化值 目前写死0.1 - */ - protected static String rate_01 = "0.1"; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("执行定时器(一泵泵组模型)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/QSPumpCalculate"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - - public String sendPost(String postURL) { - String result = ""; - try { - int station = station_01; - String spumpid = spumpid_01; - String spump1 = ""; - String spump2 = spump2_01; - double fLvalue = 0; - double fQSvalue = 0; - double fGSvalue = 0; - String rate = rate_01; - - /** - * spump1 - */ - for (int i = 1; i <= 5; i++) { - MPoint mPoint1 = mPointService.selectById(bizid, "SK_A1_P" + i + "01_S_RUN"); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - spump1 += Double.parseDouble(mPoint1.getParmvalue().toString()) + ","; - } - } - if (spump1 != null && !spump1.equals("")) { - spump1 = spump1.substring(0, spump1.length() - 1); - } - - /** - * fLvalue - */ - double val_yw = 0; - MPoint mPoint1_1 = mPointService.selectById(bizid, "SK_ME_LT201_V_PV"); - if (mPoint1_1 != null && mPoint1_1.getParmvalue() != null) { - val_yw += Double.parseDouble(mPoint1_1.getParmvalue().toString()); - } - MPoint mPoint1_2 = mPointService.selectById(bizid, "SK_ME_LT202_V_PV"); - if (mPoint1_2 != null && mPoint1_2.getParmvalue() != null) { - val_yw += Double.parseDouble(mPoint1_2.getParmvalue().toString()); - } -// MPoint mPoint1_3 = mPointService.selectById(bizid, "SK_ME_LT203_V_PV"); -// if (mPoint1_3 != null && mPoint1_3.getParmvalue() != null) { -// val_yw += Double.parseDouble(mPoint1_3.getParmvalue().toString()); -// } - fLvalue = val_yw / 2; - - /** - * fQSvalue - */ - MPoint mPoint2 = mPointService.selectById(bizid, fQSvalue_01); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQSvalue = Double.parseDouble(mPoint2.getParmvalue().toString()) / 3600; - } - - /** - * fGSvalue - */ - MPoint mPoint3 = mPointService.selectById(bizid, fGSvalue_01); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - fGSvalue = Double.parseDouble(mPoint3.getParmvalue().toString()) / 3600; - } - - System.out.println("station: " + station); - System.out.println("spumpid: " + spumpid); - System.out.println("spump1: " + spump1); - System.out.println("spump2: " + spump2); - System.out.println("fLvalue: " + fLvalue); - System.out.println("fQSvalue: " + fQSvalue); - System.out.println("fGSvalue: " + fGSvalue); - System.out.println("rate: " + rate); - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("station", station + ""), - new NameValuePair("spumpid", spumpid + ""), - new NameValuePair("spump1", spump1 + ""), - new NameValuePair("spump2", spump2 + ""), - new NameValuePair("fLvalue", fLvalue + ""), - new NameValuePair("fQSvalue", fQSvalue + ""), - new NameValuePair("fGSvalue", fGSvalue + ""), - new NameValuePair("rate", rate + "")}; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - -// System.out.println("s----------------------------------------------------" + CommUtil.nowDate()); - System.out.println(result); -// System.out.println("e----------------------------------------------------" + CommUtil.nowDate()); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("\n", "").replace("\r", ""); - - String val = xml; - -// System.out.println("s1----------------------------------------------------" + CommUtil.nowDate()); -// System.out.println(val); -// System.out.println("e1----------------------------------------------------" + CommUtil.nowDate()); - - if (val != null && !val.trim().equals("") && !val.equals("NULL")) { - String[] str = val.split(","); - if (str != null && str.length > 0) { - - int len_fa = Integer.parseInt(str[0]);//方案数量 - int len_bz = 5;//泵组数量 - int c = 0;//用于区分第一个方案和后面几个方案的倍数 - int d = 0;//用于把每个方案最后的 流量和压力 +2 如果后面还有参数 修改 d = 2 * i; 即可 - String p = "1P"; - - for (int i = 0; i < len_fa; i++) { - if (i == 0) { - c = 1; - d = 0; - } else { - c = 2; - } - int j = 0, k = 0, l = 0; - for (j = (len_bz) * (i * c + 1) + 1 + d, k = 0; j < (len_bz) * (i * c + 1) + 1 + len_bz + d; j++, k++) { -// System.out.println("SK_E_TT" + (i + 1) + "0" + (k + 1) + "_YC_RUN_" + p); - save("SK_E_TT" + (i + 1) + "0" + (k + 1) + "_YC_RUN_" + p, str[j], bizid); - save_his("SK_E_TT" + (i + 1) + "0" + (k + 1) + "_YC_RUN_" + p, str[j], 0); - } - for (j = (len_bz * 2) * (i + 1) + 1 + d, l = 0; j < (len_bz * 2) * (i + 1) + 1 + len_bz + d; j++, l++) { -// System.out.println("SK_E_TT" + (i + 1) + "0" + (l + 1) + "_YC_EFF_" + p); - save("SK_E_TT" + (i + 1) + "0" + (l + 1) + "_YC_EFF_" + p, str[j], bizid); - save_his("SK_E_TT" + (i + 1) + "0" + (l + 1) + "_YC_EFF_" + p, str[j], 0); - } - } - - //先将 出口压力 出口流量 运行功率 设置成0 避免页面显示数值 - for (int i = 1; i <= 5; i++) { - save("SK_E_TT" + i + "00_YC_YL_1P", 0 + "", bizid); - save("SK_E_TT" + i + "00_YC_LL_1P", 0 + "", bizid); - save("SK_E_TT" + i + "00_YC_GL_1P", 0 + "", bizid); - } - - //出口压力 - for (int i = str.length - 3 * len_fa - 1, k = 1; i < str.length - 2 * len_fa - 1; i++, k++) { -// System.out.println("SK_E_TT" + k + "00_YC_YL_1P"); - save("SK_E_TT" + k + "00_YC_YL_1P", Double.parseDouble(str[i]) / 100 + "", bizid); - save_his("SK_E_TT" + k + "00_YC_YL_1P", Double.parseDouble(str[i]) / 100 + "", 0); - } - //出口流量 - for (int i = str.length - 2 * len_fa - 1, k = 1; i < str.length - 1 * len_fa - 1; i++, k++) { -// System.out.println("SK_E_TT" + k + "00_YC_LL_1P"); - save("SK_E_TT" + k + "00_YC_LL_1P", Double.parseDouble(str[i]) * 3600 + "", bizid); - save_his("SK_E_TT" + k + "00_YC_LL_1P", Double.parseDouble(str[i]) * 3600 + "", 0); - } - //运行功率 - for (int i = str.length - 1 * len_fa - 1, k = 1; i < str.length - 1; i++, k++) { -// System.out.println("SK_E_TT" + k + "00_YC_GL_1P"); - String num = str[i - len_fa];//对应方案的流量 - save("SK_E_TT" + k + "00_YC_GL_1P", Double.parseDouble(str[i]) / (Double.parseDouble(num) * 3.6) + "", bizid); - save_his("SK_E_TT" + k + "00_YC_GL_1P", Double.parseDouble(str[i]) / (Double.parseDouble(num) * 3.6) + "", 0); - } - - //一泵房_方案1计算出口压力 - /*double v1 = Double.parseDouble(str[str.length - 2]) * 0.01;//除100 - save("SK_E_TT100_YC_YL_1P", v1 + "", bizid); - save_his("SK_E_TT100_YC_YL_1P", v1 + "", 0);*/ - - //一泵房_方案1计算出口流量 - /*double v2 = Double.parseDouble(str[str.length - 1]); - save("SK_E_TT100_YC_LL_1P", v2 + "", bizid); - save_his("SK_E_TT100_YC_LL_1P", v2 + "", 0);*/ - } - } - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param - */ - public void save(String mpId, String val1, String unitId) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - if (val != null && !val.trim().equals("")) { - mPoint.setParmvalue(new BigDecimal(val.trim())); - } else { - mPoint.setParmvalue(new BigDecimal("0")); - } - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param - */ - public void save_his(String mpId, String val1, int timeStr) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - MPointHistory mPointHistory = new MPointHistory(); - if (val != null && !val.trim().equals("")) { - mPointHistory.setParmvalue(new BigDecimal(val.trim())); - } else { - mPointHistory.setParmvalue(new BigDecimal("0")); - } - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_FSSK_BZNH_2.java b/src/com/sipai/quartz/job/ModelJob_FSSK_BZNH_2.java deleted file mode 100644 index 9348950c..00000000 --- a/src/com/sipai/quartz/job/ModelJob_FSSK_BZNH_2.java +++ /dev/null @@ -1,344 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (泵站能耗模型) -- 二泵 - * 定期调用市政院webservice模型 保存预测30分钟的值 - * 用于沙口项目--定制 - */ -public class ModelJob_FSSK_BZNH_2 { - - - protected static String bizid = "FS_SK11_C";//厂id - - /** - * station 参数 写死1 - */ - protected static int station_01 = 1; - - /** - * spumpid 参数 写死1 - */ - protected static String spumpid_01 = "10001,10002,10003,10004,10005,10006,10007,10008"; - - /** - * spump1参数 - */ -// protected static String Spump1_01 = "SK_E_P101_S_RUN"; -// protected static String Spump1_02 = "SK_E_P201_S_RUN"; -// protected static String Spump1_03 = "SK_E_P301_S_RUN"; -// protected static String Spump1_04 = "SK_E_P401_S_RUN"; -// protected static String Spump1_05 = "SK_E_P501_S_RUN"; -// protected static String Spump1_06 = "SK_E_P601_S_RUN"; -// protected static String Spump1_07 = "SK_E_P701_S_RUN"; -// protected static String Spump1_08 = "SK_E_P801_S_RUN"; - - /** - * spump2参数 - */ - protected static String spump2_01 = "1"; - - /** - * spump1参数 - */ - protected static String n_01 = "1"; - - /** - * fh参数 扬程 - */ - protected static String fh_01 = "SK_E_SXYC_2B"; - - /** - * fh参数 fvalue - */ - protected static String fvalue_01 = "SK_E_SXFValue_2B"; - - /** - * fq参数 流量 - */ - protected static String fq_01 = "SK_E_SXGCSL_2B"; - - /** - * index参数 - */ - protected static int index_01 = 1; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("执行定时器(二泵泵组模型)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/PumpCalculate"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - - public String sendPost(String postURL) { - String result = ""; - try { - int station = station_01; - String spumpid = spumpid_01; - String spump1 = ""; - String spump2 = spump2_01; - double fh = 0; - double fvalue = 0; - double fq = 0; - int index = index_01; - - /** - * spump1 - */ - for (int i = 1; i <= 8; i++) { - MPoint mPoint1 = mPointService.selectById(bizid, "SK_E_P" + i + "01_S_RUN"); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - spump1 += Double.parseDouble(mPoint1.getParmvalue().toString()) + ","; - } - } - if (spump1 != null && !spump1.equals("")) { - spump1 = spump1.substring(0, spump1.length() - 1); - } - - /** - * fh - */ - MPoint mPoint1 = mPointService.selectById(bizid, fh_01); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - fh = Double.parseDouble(mPoint1.getParmvalue().toString()) * 100; - } - - /** - * fvalue - */ - MPoint mPoint2 = mPointService.selectById(bizid, fvalue_01); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fvalue = Double.parseDouble(mPoint2.getParmvalue().toString()); - } - - /** - * fq - */ - MPoint mPoint3 = mPointService.selectById(bizid, fq_01); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - fq = Double.parseDouble(mPoint3.getParmvalue().toString()) / 3600; - - //截取2位 - BigDecimal bigDecimal = new BigDecimal(fq).setScale(2, RoundingMode.HALF_UP); - fq = bigDecimal.doubleValue(); - } - - System.out.println("station: " + station); - System.out.println("spumpid: " + spumpid); - System.out.println("spump1: " + spump1); - System.out.println("spump2: " + spump2); - System.out.println("fh: " + fh); - System.out.println("fvalue: " + fvalue); - System.out.println("fq: " + fq); - System.out.println("index: " + index); - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("station", station + ""), - new NameValuePair("spumpid", spumpid + ""), - new NameValuePair("spump1", spump1 + ""), - new NameValuePair("spump2", spump2 + ""), - new NameValuePair("fh", fh + ""), - new NameValuePair("fvalue", fvalue + ""), - new NameValuePair("fq", fq + ""), - new NameValuePair("index", index + "") - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - -// System.out.println("s----------------------------------------------------" + CommUtil.nowDate()); - System.out.println(result); -// System.out.println("e----------------------------------------------------" + CommUtil.nowDate()); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("\n", "").replace("\r", ""); - - String val = xml; - -// System.out.println("s1----------------------------------------------------" + CommUtil.nowDate()); -// System.out.println(val); -// System.out.println("e1----------------------------------------------------" + CommUtil.nowDate()); - - if (val != null && !val.trim().equals("") && !val.equals("NULL")) { - String[] str = val.split(","); - if (str != null && str.length > 0) { - - int len_fa = Integer.parseInt(str[0]);//方案数量 - int len_bz = 8;//泵组数量 - int c = 0;//用于区分第一个方案和后面几个方案的倍数 - int d = 0;//用于把每个方案最后的 流量和压力 +2 如果后面还有参数 修改 d = 2 * i; 即可 - String p = "2P"; - - for (int i = 0; i < len_fa; i++) { - if (i == 0) { - c = 1; - d = 0; - } else { - c = 2; - } - int j = 0, k = 0, l = 0; - for (j = (len_bz) * (i * c + 1) + 1 + d, k = 0; j < (len_bz) * (i * c + 1) + 1 + len_bz + d; j++, k++) { -// System.out.println("SK_E_TT" + (i + 1) + "0" + (k + 1) + "_YC_RUN_" + p); - save("SK_E_TT" + (i + 1) + "0" + (k + 1) + "_YC_RUN_" + p, str[j], bizid); - save_his("SK_E_TT" + (i + 1) + "0" + (k + 1) + "_YC_RUN_" + p, str[j], 0); - } - for (j = (len_bz * 2) * (i + 1) + 1 + d, l = 0; j < (len_bz * 2) * (i + 1) + 1 + len_bz + d; j++, l++) { -// System.out.println("SK_E_TT" + (i + 1) + "0" + (l + 1) + "_YC_EFF_" + p); - save("SK_E_TT" + (i + 1) + "0" + (l + 1) + "_YC_EFF_" + p, str[j], bizid); - save_his("SK_E_TT" + (i + 1) + "0" + (l + 1) + "_YC_EFF_" + p, str[j], 0); - } - //一泵房_出口压力 - /* save("SK_E_TT" + (i + 1) + "00_YC_YL_" + p, str[str.length - 2], bizid); - save_his("SK_E_TT" + (i + 1) + "00_YC_YL_" + p, str[str.length - 2], 0); - j++; - //一泵房_出口流量 - save("SK_E_TT" + (i + 1) + "00_YC_LL_" + p, str[str.length - 1], bizid); - save_his("SK_E_TT" + (i + 1) + "00_YC_LL_" + p, str[str.length - 1], 0); - j++;*/ - } - - //先将 出口压力 出口流量 运行功率 设置成0 避免页面显示数值 - for (int i = 1; i <= 5; i++) { - save("SK_E_TT" + i + "00_YC_YL_2P", 0 + "", bizid); - save("SK_E_TT" + i + "00_YC_LL_2P", 0 + "", bizid); - save("SK_E_TT" + i + "00_YC_GL_2P", 0 + "", bizid); - } - - //出口压力 - for (int i = str.length - 3 * len_fa - 1, k = 1; i < str.length - 2 * len_fa - 1; i++, k++) { -// System.out.println("SK_E_TT" + k + "00_YC_YL_2P"); - save("SK_E_TT" + k + "00_YC_YL_2P", Double.parseDouble(str[i]) / 100 + "", bizid); - save_his("SK_E_TT" + k + "00_YC_YL_2P", Double.parseDouble(str[i]) / 100 + "", 0); - } - - //出口流量 - for (int i = str.length - 2 * len_fa - 1, k = 1; i < str.length - 1 * len_fa - 1; i++, k++) { -// System.out.println("SK_E_TT" + k + "00_YC_LL_2P"); - save("SK_E_TT" + k + "00_YC_LL_2P", Double.parseDouble(str[i]) * 3600 + "", bizid); - save_his("SK_E_TT" + k + "00_YC_LL_2P", Double.parseDouble(str[i]) * 3600 + "", 0); - } - - //运行功率 - for (int i = str.length - 1 * len_fa - 1, k = 1; i < str.length - 1; i++, k++) { -// System.out.println("SK_E_TT" + k + "00_YC_GL_2P"); - String num = str[i - len_fa];//对应方案的流量 - save("SK_E_TT" + k + "00_YC_GL_2P", Double.parseDouble(str[i]) / (Double.parseDouble(num) * 3.6) + "", bizid); - save_his("SK_E_TT" + k + "00_YC_GL_2P", Double.parseDouble(str[i]) / (Double.parseDouble(num) * 3.6) + "", 0); - } - - //二泵房_方案1计算出口压力 - /*double v1 = Double.parseDouble(str[str.length - 2]) * 0.01;//除100 - save("SK_E_TT100_YC_YL_2P", v1 + "", bizid); - save_his("SK_E_TT100_YC_YL_2P", v1 + "", 0);*/ - - //二泵房_方案1计算出口流量 - /*double v2 = Double.parseDouble(str[str.length - 1]); - save("SK_E_TT100_YC_LL_2P", v2 + "", bizid); - save_his("SK_E_TT100_YC_LL_2P", v2 + "", 0);*/ - } - } - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param - */ - public void save(String mpId, String val1, String unitId) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - if (val != null && !val.trim().equals("")) { - mPoint.setParmvalue(new BigDecimal(val.trim())); - } else { - mPoint.setParmvalue(new BigDecimal("0")); - } - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param - */ - public void save_his(String mpId, String val1, int timeStr) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - MPointHistory mPointHistory = new MPointHistory(); - if (val != null && !val.trim().equals("")) { - mPointHistory.setParmvalue(new BigDecimal(val.trim())); - } else { - mPointHistory.setParmvalue(new BigDecimal("0")); - } - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_FSSK_JY1.java b/src/com/sipai/quartz/job/ModelJob_FSSK_JY1.java deleted file mode 100644 index ad90c562..00000000 --- a/src/com/sipai/quartz/job/ModelJob_FSSK_JY1.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (加药模型) --- 沙口 - * 定期调用市政院webservice模型 保存预测30分钟的值 - */ -public class ModelJob_FSSK_JY1 { - protected static String bizid = "FS_SK11_C";//厂id - - /** - * 原水浊度 - */ - protected static String NTU1_Mpoint = "SK_MB1_SS101_V_PV"; - - /** - * 原水流量 - */ - protected static String fQ_Mpoint = "SK_FF_FT101_V_PV"; - - /** - * 原水PH - */ - protected static String pH_Mpoint = "SK_MB1_PH101_V_PV"; - - /** - * 待滤水浊度 - */ - protected static String NTU2_Mpoint = "SK_B1_SS101_V_PV"; - - /** - * 预测加药 - */ - protected static String yc_jyl = "SK_E_YC_JYL"; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("执行定时器(一流程加药)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/Touyao_HG"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - public String sendPost(String postURL) { - String result = ""; - try { - - double NTU1 = 0; - double fQ = 0; - double pH = 8; - double Temp = 23; - double NTU2 = 0; - - //原水浊度 - MPoint mPoint1 = mPointService.selectById(bizid, NTU1_Mpoint); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - NTU1 = Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //原水流量 - MPoint mPoint2 = mPointService.selectById(bizid, fQ_Mpoint); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQ = Double.parseDouble(mPoint2.getParmvalue().toString()); - } - //原水pH值 - MPoint mPoint3 = mPointService.selectById(bizid, pH_Mpoint); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - pH = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - - //待滤水浊度 - MPoint mPoint5 = mPointService.selectById(bizid, NTU2_Mpoint); - if (mPoint5 != null && mPoint5.getParmvalue() != null) { - NTU2 = Double.parseDouble(mPoint5.getParmvalue().toString()); - } - - System.out.println("NTU1: " + NTU1); - System.out.println("fQ: " + fQ); - System.out.println("pH: " + pH); - System.out.println("Temp: " + Temp); - System.out.println("NTU2: " + NTU2); - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("NTU1", NTU1 + ""),//原水浊度 - new NameValuePair("fQ", fQ + ""),//原水流量1 + 原水流量2 - new NameValuePair("pH", pH + ""), - new NameValuePair("Temp", Temp + ""), - new NameValuePair("NTU2", NTU2 + "")//出水浊度 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - - System.out.println("JYMX1=" + result); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - - System.out.println("JYMX2=" + val); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 -// mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + yc_jyl + "]", "where 1=1 "); - - //更新总表 - save(yc_jyl, val, bizid); - - //新增子表 - save_his(yc_jyl, val, 0); - - //新增子表 -// save_his(yc_jyl, fq1, 5); -// save_his(yc_jyl, fq2, 10); -// save_his(yc_jyl, fq3, 15); -// save_his(yc_jyl, fq4, 20); -// save_his(yc_jyl, fq5, 25); -// save_his(yc_jyl, fq6, 30); - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val1 测量点的值 - */ - public void save(String mpId, String val1, String unitId) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - if (val != null && !val.trim().equals("")) { - mPoint.setParmvalue(new BigDecimal(val.trim())); - } else { - mPoint.setParmvalue(new BigDecimal("0")); - } - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val1 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val1, int timeStr) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - MPointHistory mPointHistory = new MPointHistory(); - if (val != null && !val.trim().equals("")) { - mPointHistory.setParmvalue(new BigDecimal(val.trim())); - } else { - mPointHistory.setParmvalue(new BigDecimal("0")); - } - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_FSSK_JY2.java b/src/com/sipai/quartz/job/ModelJob_FSSK_JY2.java deleted file mode 100644 index 796dde0b..00000000 --- a/src/com/sipai/quartz/job/ModelJob_FSSK_JY2.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (加药模型) --- 沙口 - * 定期调用市政院webservice模型 保存预测30分钟的值 - */ -public class ModelJob_FSSK_JY2 { - protected static String bizid = "FS_SK11_C";//厂id - - /** - * 原水浊度 - */ - protected static String NTU1_Mpoint = "SK_MB1_SS101_V_PV"; - - /** - * 原水流量 - */ - protected static String fQ_Mpoint = "SK_FF_FT102_V_PV"; - - /** - * 原水PH - */ - protected static String pH_Mpoint = "SK_MB1_PH101_V_PV"; - - /** - * 待滤水浊度 - */ - protected static String NTU2_Mpoint = "SK_B2_SS101_V_PV"; - - /** - * 预测加药 - */ - protected static String yc_jyl = "SK_E_YC_JYL2"; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("执行定时器(二流程加药)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/Touyao_HG"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - public String sendPost(String postURL) { - String result = ""; - try { - - double NTU1 = 0; - double fQ = 0; - double pH = 8; - double Temp = 23; - double NTU2 = 0; - - //原水浊度 - MPoint mPoint1 = mPointService.selectById(bizid, NTU1_Mpoint); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - NTU1 = Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //原水流量 - MPoint mPoint2 = mPointService.selectById(bizid, fQ_Mpoint); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQ = Double.parseDouble(mPoint2.getParmvalue().toString()); - } - //原水pH值 - MPoint mPoint3 = mPointService.selectById(bizid, pH_Mpoint); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - pH = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - - //待滤水浊度 - MPoint mPoint5 = mPointService.selectById(bizid, NTU2_Mpoint); - if (mPoint5 != null && mPoint5.getParmvalue() != null) { - NTU2 = Double.parseDouble(mPoint5.getParmvalue().toString()); - } - - System.out.println("NTU1: " + NTU1); - System.out.println("fQ: " + fQ); - System.out.println("pH: " + pH); - System.out.println("Temp: " + Temp); - System.out.println("NTU2: " + NTU2); - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("NTU1", NTU1 + ""),//原水浊度 - new NameValuePair("fQ", fQ + ""),//原水流量1 + 原水流量2 - new NameValuePair("pH", pH + ""), - new NameValuePair("Temp", Temp + ""), - new NameValuePair("NTU2", NTU2 + "")//出水浊度 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - - System.out.println("JYMX1=" + result); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - - System.out.println("JYMX2=" + val); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 -// mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + yc_jyl + "]", "where 1=1 "); - - //更新总表 - save(yc_jyl, val, bizid); - - //新增子表 - save_his(yc_jyl, val, 0); - - //新增子表 -// save_his(yc_jyl, fq1, 5); -// save_his(yc_jyl, fq2, 10); -// save_his(yc_jyl, fq3, 15); -// save_his(yc_jyl, fq4, 20); -// save_his(yc_jyl, fq5, 25); -// save_his(yc_jyl, fq6, 30); - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val1 测量点的值 - */ - public void save(String mpId, String val1, String unitId) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - if (val != null && !val.trim().equals("")) { - mPoint.setParmvalue(new BigDecimal(val.trim())); - } else { - mPoint.setParmvalue(new BigDecimal("0")); - } - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val1 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val1, int timeStr) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - MPointHistory mPointHistory = new MPointHistory(); - if (val != null && !val.trim().equals("")) { - mPointHistory.setParmvalue(new BigDecimal(val.trim())); - } else { - mPointHistory.setParmvalue(new BigDecimal("0")); - } - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_FSSK_JY3.java b/src/com/sipai/quartz/job/ModelJob_FSSK_JY3.java deleted file mode 100644 index 6db3d70d..00000000 --- a/src/com/sipai/quartz/job/ModelJob_FSSK_JY3.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (加药模型) --- 沙口 - * 定期调用市政院webservice模型 保存预测30分钟的值 - */ -public class ModelJob_FSSK_JY3 { - protected static String bizid = "FS_SK11_C";//厂id - - /** - * 原水浊度 - */ - protected static String NTU1_Mpoint = "SK_MB1_SS101_V_PV"; - - /** - * 原水流量 - */ - protected static String fQ_Mpoint = "SK_FF_FT103_V_PV"; - - /** - * 原水PH - */ - protected static String pH_Mpoint = "SK_MB1_PH101_V_PV"; - - /** - * 待滤水浊度 - */ - protected static String NTU2_Mpoint = "SK_B3_SS101_V_PV"; - - /** - * 预测加药 - */ - protected static String yc_jyl = "SK_E_YC_JYL3"; - - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - - public void dataSave(ScheduleJob scheduleJob) { - System.out.println("执行定时器(三流程加药)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/Touyao_HG"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - public String sendPost(String postURL) { - String result = ""; - try { - - double NTU1 = 0; - double fQ = 0; - double pH = 8; - double Temp = 23; - double NTU2 = 0; - - //原水浊度 - MPoint mPoint1 = mPointService.selectById(bizid, NTU1_Mpoint); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - NTU1 = Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //原水流量 - MPoint mPoint2 = mPointService.selectById(bizid, fQ_Mpoint); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQ = Double.parseDouble(mPoint2.getParmvalue().toString()); - } - //原水pH值 - MPoint mPoint3 = mPointService.selectById(bizid, pH_Mpoint); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - pH = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - - //待滤水浊度 - MPoint mPoint5 = mPointService.selectById(bizid, NTU2_Mpoint); - if (mPoint5 != null && mPoint5.getParmvalue() != null) { - NTU2 = Double.parseDouble(mPoint5.getParmvalue().toString()); - } - - System.out.println("NTU1: " + NTU1); - System.out.println("fQ: " + fQ); - System.out.println("pH: " + pH); - System.out.println("Temp: " + Temp); - System.out.println("NTU2: " + NTU2); - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("NTU1", NTU1 + ""),//原水浊度 - new NameValuePair("fQ", fQ + ""),//原水流量1 + 原水流量2 - new NameValuePair("pH", pH + ""), - new NameValuePair("Temp", Temp + ""), - new NameValuePair("NTU2", NTU2 + "")//出水浊度 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - - System.out.println("JYMX1=" + result); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - - System.out.println("JYMX2=" + val); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 -// mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + yc_jyl + "]", "where 1=1 "); - - //更新总表 - save(yc_jyl, val, bizid); - - //新增子表 - save_his(yc_jyl, val, 0); - - //新增子表 -// save_his(yc_jyl, fq1, 5); -// save_his(yc_jyl, fq2, 10); -// save_his(yc_jyl, fq3, 15); -// save_his(yc_jyl, fq4, 20); -// save_his(yc_jyl, fq5, 25); -// save_his(yc_jyl, fq6, 30); - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val1 测量点的值 - */ - public void save(String mpId, String val1, String unitId) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - if (val != null && !val.trim().equals("")) { - mPoint.setParmvalue(new BigDecimal(val.trim())); - } else { - mPoint.setParmvalue(new BigDecimal("0")); - } - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val1 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val1, int timeStr) { - String val = CommUtil.replace(val1); - MPoint mPoint = mPointService.selectById(bizid, mpId); - if (mPoint != null) { - MPointHistory mPointHistory = new MPointHistory(); - if (val != null && !val.trim().equals("")) { - mPointHistory.setParmvalue(new BigDecimal(val.trim())); - } else { - mPointHistory.setParmvalue(new BigDecimal("0")); - } - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_JY.java b/src/com/sipai/quartz/job/ModelJob_JY.java deleted file mode 100644 index ebe4640c..00000000 --- a/src/com/sipai/quartz/job/ModelJob_JY.java +++ /dev/null @@ -1,291 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * (加药模型) --- 重庆 - * 定期调用市政院webservice模型 保存预测30分钟的值 - * 用于重庆白洋滩项目--定制 - */ -public class ModelJob_JY { - protected static String bizid = "768bfcaf247148a1ba1b3a26c9b9be7a";//厂id - - /** - * 原水流量1 - */ - protected static String ys_ll1 = "CDC1_CDC1_AI_F1"; - - /** - * 原水流量2 - */ - protected static String ys_ll2 = "CDC1_CDC1_AI_F2"; - - /** - * 原水浊度 - */ - protected static String ys_zd = "CDC1_CDC1_AI_ZD"; - - /** - * 预测加药(一期2#沉砂池前加药量) - */ - protected static String SLC_JYL_YC_FRONT_YQ2 = "SLC_JYL_YC_FRONT_YQ2"; - - /** - * 预测加药(一期1#沉淀池后加药量) - */ - protected static String SLC_JYL_YC_AFTER_YQ1 = "SLC_JYL_YC_AFTER_YQ1"; - - /** - * 预测加药(一期2#沉淀池后加药量) - */ - protected static String SLC_JYL_YC_AFTER_YQ2 = "SLC_JYL_YC_AFTER_YQ2"; - - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - public void excuteJY() { - System.out.println("执行web方法(加药)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/BYT_JIAYAO"; - try { - sendPost1(wsUrl); - sendPost2(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 - * - * @param postURL - * @return - */ - public String sendPost1(String postURL) { -// System.out.println("进入加药定时器"); - String result = ""; - try { - - double NTU1 = 0; - double fQ = 0; - double pH = 8; - double Temp = 26; - - //原水流量1 - MPoint mPoint1 = mPointService.selectById(bizid, ys_ll1); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - fQ = fQ + Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //原水流量2 - MPoint mPoint2 = mPointService.selectById(bizid, ys_ll2); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQ = fQ + Double.parseDouble(mPoint2.getParmvalue().toString()); - } - //原水浊度 - MPoint mPoint3 = mPointService.selectById(bizid, ys_zd); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - NTU1 = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - - System.out.println("加药参数S--------------------------" + CommUtil.nowDate()); - System.out.println("NTU1=" + NTU1); - System.out.println("fQ=" + fQ); - System.out.println("pH=" + pH); - System.out.println("Temp=" + Temp); - System.out.println("加药参数E--------------------------" + CommUtil.nowDate()); - - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("NTU1", NTU1 + ""),//原水浊度 - new NameValuePair("fQ", fQ + ""),//原水流量1 + 原水流量2 - new NameValuePair("pH", pH + ""), - new NameValuePair("Temp", Temp + "") - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - - String xml = ""; - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - - if (val != null && !val.trim().equals("")) { - String[] vals = val.split(","); - if (vals != null && vals.length > 0) { - //更新总表 -- 预测值 - save(SLC_JYL_YC_FRONT_YQ2, vals[0], bizid); - //新增子表 -- 预测值 - save_his(SLC_JYL_YC_FRONT_YQ2, vals[0], 0); - } - } - - - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - - return result; - } - - public String sendPost2(String postURL) { -// System.out.println("进入加药定时器"); - String result = ""; - try { - - double NTU1 = 0; - double fQ = 0; - double pH = 8; - double Temp = 26; - - //原水流量1 - MPoint mPoint1 = mPointService.selectById(bizid, ys_ll1); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - fQ = fQ + Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //原水流量2 - MPoint mPoint2 = mPointService.selectById(bizid, ys_ll2); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQ = fQ + Double.parseDouble(mPoint2.getParmvalue().toString()); - } - //原水浊度 - MPoint mPoint3 = mPointService.selectById(bizid, ys_zd); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - NTU1 = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - - System.out.println("加药参数S--------------------------" + CommUtil.nowDate()); - System.out.println("NTU1=" + NTU1); - System.out.println("fQ=" + (fQ / 4)); - System.out.println("pH=" + pH); - System.out.println("Temp=" + Temp); - System.out.println("加药参数E--------------------------" + CommUtil.nowDate()); - - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("NTU1", NTU1 + ""),//原水浊度 - new NameValuePair("fQ", (fQ / 4) + ""),//原水流量1 + 原水流量2 - new NameValuePair("pH", pH + ""), - new NameValuePair("Temp", Temp + "") - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - - String xml = ""; - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - - if (val != null && !val.trim().equals("")) { - String[] vals = val.split(","); - if (vals != null && vals.length > 0) { - //更新总表 -- 预测值 - save(SLC_JYL_YC_AFTER_YQ1, vals[1], bizid); - //新增子表 -- 预测值 - save_his(SLC_JYL_YC_AFTER_YQ1, vals[1], 0); - - //更新总表 -- 预测值 - save(SLC_JYL_YC_AFTER_YQ2, vals[2], bizid); - //新增子表 -- 预测值 - save_his(SLC_JYL_YC_AFTER_YQ2, vals[2], 0); - } - } - - - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val 测量点的值 - */ - public void save(String mpId, String val, String unitId) { - try { - val = val.replace("\n", "");//去除回车 - java.text.DecimalFormat df = new java.text.DecimalFormat("#.####"); - double d = Double.parseDouble(val); - - MPoint mPoint = mPointService.selectById(bizid, mpId); - mPoint.setParmvalue(new BigDecimal(d)); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } catch (Exception e) { - System.out.println(CommUtil.nowDate() + ":更新主表=" + e); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val, int timeStr) { - val = val.replace("\n", "");//去除回车 - java.text.DecimalFormat df = new java.text.DecimalFormat("#.####"); - double d = Double.parseDouble(val); - - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(d)); - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { -// System.out.println("----------------------------start----------------------------"); -// System.out.println(xml); -// System.out.println("----------------------------end----------------------------"); - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_JY_20221107.java b/src/com/sipai/quartz/job/ModelJob_JY_20221107.java deleted file mode 100644 index d2538f75..00000000 --- a/src/com/sipai/quartz/job/ModelJob_JY_20221107.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * (加药模型) --- 重庆 - * 定期调用市政院webservice模型 保存预测30分钟的值 - * 用于重庆白洋滩项目--定制 - */ -public class ModelJob_JY_20221107 { - protected static String bizid = "768bfcaf247148a1ba1b3a26c9b9be7a";//厂id - - /** - * 原水流量1 - */ - protected static String ys_ll1 = "CDC1_CDC1_AI_F1"; - - /** - * 原水流量2 - */ - protected static String ys_ll2 = "CDC1_CDC1_AI_F2"; - - /** - * 原水浊度 - */ - protected static String ys_zd = "CDC1_CDC1_AI_ZD"; - - /** - * 出水浊度 - */ - protected static String cs_zd = "EQCSC3_EQCSC3_zd1"; - - //下面点位为模型取值后再计算 - /** - * 原药浓度 - */ - protected static String yy_nd = "SG_YL_YYND"; - /** - * 加药溶液密度 - */ - protected static String ry_md = "SG_YL_RYMD"; - /** - * 加药溶液浓度 - */ - protected static String ry_nd = "SG_YL_RYND"; - - /** - * 预测加药(模型计算结果) - */ - protected static String yc_jyl_jsjg = "SG_YL_JYL_JSJG"; - - /** - * 预测加药(预测值) - */ - protected static String yc_jyl_ycz = "SG_YL_JYL"; - - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - public void excuteJY() { - System.out.println("执行web方法(加药)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/Touyao_HG"; - try { - sendPost(wsUrl); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * 请求数据 -- 高压流量 - * - * @param postURL - * @return - */ - public String sendPost(String postURL) { -// System.out.println("进入加药定时器"); - - String result = ""; - try { - - double NTU1 = 0; - double fQ = 0; - double pH = 8; - double Temp = 26; - double NTU2 = 0; - - //原水流量1 - MPoint mPoint1 = mPointService.selectById(bizid, ys_ll1); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - fQ = fQ + Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //原水流量2 - MPoint mPoint2 = mPointService.selectById(bizid, ys_ll2); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - fQ = fQ + Double.parseDouble(mPoint2.getParmvalue().toString()); - } - //原水浊度 - MPoint mPoint3 = mPointService.selectById(bizid, ys_zd); - if (mPoint3 != null && mPoint3.getParmvalue() != null) { - NTU1 = Double.parseDouble(mPoint3.getParmvalue().toString()); - } - //预测加药 - MPoint mPoint4 = mPointService.selectById(bizid, cs_zd); - if (mPoint4 != null && mPoint4.getParmvalue() != null) { - NTU2 = Double.parseDouble(mPoint4.getParmvalue().toString()); - } - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - - System.out.println("加药参数S--------------------------" + CommUtil.nowDate()); - System.out.println("NTU1=" + NTU1); - System.out.println("fQ=" + fQ); - System.out.println("pH=" + pH); - System.out.println("Temp=" + Temp); - System.out.println("NTU2=" + NTU2); - System.out.println("加药参数E--------------------------" + CommUtil.nowDate()); - - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("NTU1", NTU1 + ""),//原水浊度 - new NameValuePair("fQ", fQ + ""),//原水流量1 + 原水流量2 - new NameValuePair("pH", pH + ""), - new NameValuePair("Temp", Temp + ""), - new NameValuePair("NTU2", NTU2 + "")//出水浊度 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - - String xml = ""; - -// System.out.println("resultresultresultresultresultresultresult=" + result); - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - -// System.out.println("xmlxmlxmlxmlxmlxmlxmlxmlxmlxmlxmlxmlxml=" + val); - - //先删除当前时间之后的预测值,然后会插入最新30分钟的预测值 -// mPointHistoryService.deleteByTableAWhere(bizid, "[tb_mp_" + ll_nest_high + "]", "where 1=1 "); - - //总原水流量 fQ 2825+2713 - //原药浓度 SG_YL_RYND 36.27 - //预测加药 val 26.275 - //加药溶液密度 SG_YL_RYMD 36.604 - //加药溶液浓度 SG_YL_RYND 36.27 1,327 - double Qin = fQ; - double Pjz = Double.parseDouble(val); - double yynd = 0.1;//原药浓度 - double d = 1.24;//加药溶液密度 - double c = 4;//加药溶液浓度 - String val_last = "";//最终值 - - //原药浓度 - MPoint mPoint5 = mPointService.selectById(bizid, yy_nd); - if (mPoint5 != null && mPoint5.getParmvalue() != null) { - yynd = Double.parseDouble(mPoint5.getParmvalue().toString()); - } - - //加药溶液密度 - MPoint mPoint6 = mPointService.selectById(bizid, ry_md); - if (mPoint6 != null && mPoint6.getParmvalue() != null) { - d = Double.parseDouble(mPoint6.getParmvalue().toString()); - } - - //加药溶液浓度 - MPoint mPoint7 = mPointService.selectById(bizid, ry_nd); - if (mPoint7 != null && mPoint7.getParmvalue() != null) { - c = Double.parseDouble(mPoint7.getParmvalue().toString()); - } - - // (fQ * 模型返回 * 10 * 原药浓度) / (加药溶液密度 * 加药溶液浓度) -// val_last = (Qin * Pjz * 10 * yynd) / (d * c) + ""; - - val_last = (Pjz / (Qin * 10 / 10000 / 1.24 / 0.0174 * 0.1)) + ""; - - //更新总表 -- 模型计算结果 --- 页面(上) - save(yc_jyl_jsjg, val_last, bizid); - //更新总表 -- 预测值 --- 页面(下) - save(yc_jyl_ycz, val, bizid); - - //新增子表 -- 模型计算结果 - save_his(yc_jyl_jsjg, val_last, 0); - //新增子表 -- 预测值 - save_his(yc_jyl_ycz, val, 0); - - //新增子表 -// save_his(ll_nest_high, fq1, 5); -// save_his(ll_nest_high, fq2, 10); -// save_his(ll_nest_high, fq3, 15); -// save_his(ll_nest_high, fq4, 20); -// save_his(ll_nest_high, fq5, 25); -// save_his(ll_nest_high, fq6, 30); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val 测量点的值 - */ - public void save(String mpId, String val, String unitId) { - try { - val = val.replace("\n", "");//去除回车 - java.text.DecimalFormat df = new java.text.DecimalFormat("#.####"); - double d = Double.parseDouble(val); - - MPoint mPoint = mPointService.selectById(bizid, mpId); - mPoint.setParmvalue(new BigDecimal(d)); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } catch (Exception e) { - System.out.println(CommUtil.nowDate() + ":更新主表=" + e); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val, int timeStr) { - val = val.replace("\n", "");//去除回车 - java.text.DecimalFormat df = new java.text.DecimalFormat("#.####"); - double d = Double.parseDouble(val); - - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(d)); - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { -// System.out.println("----------------------------start----------------------------"); -// System.out.println(xml); -// System.out.println("----------------------------end----------------------------"); - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ModelJob_LC.java b/src/com/sipai/quartz/job/ModelJob_LC.java deleted file mode 100644 index 49fd1365..00000000 --- a/src/com/sipai/quartz/job/ModelJob_LC.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -/** - * (滤池反冲分析模型) - * 定期调用市政院webservice模型 定时去调用,如果返回值是1,就建议该格滤池进行冲洗 - * 用于重庆白洋滩项目--定制 - */ -public class ModelJob_LC { - protected static String bizid = "768bfcaf247148a1ba1b3a26c9b9be7a";//厂id - - /** - * 滤池水位实时值 - */ - protected static String lc_sw_01 = "LC1_LC1_AI_SW"; - protected static String lc_sw_02 = "LC2_LC2_AI_SW"; - protected static String lc_sw_03 = "LC3_LC3_AI_SW"; - protected static String lc_sw_04 = "LC4_LC4_AI_SW"; - protected static String lc_sw_05 = "LC5_LC5_SW"; - protected static String lc_sw_06 = "LC6_LC6_AI_level"; - protected static String lc_sw_07 = "LC7_LC7_AI_level"; - protected static String lc_sw_08 = "LC8_LC8_AI_level"; - protected static String lc_sw_09 = "LC9_LC9_AI_level"; - protected static String lc_sw_10 = "LC10_LC10_AI_level"; - protected static String lc_sw_11 = "LC11_LC11_AI_level"; - /** - * 滤池出水阀开度 - */ - protected static String lc_kd_01 = "LC1_LC1_AI_KD"; - protected static String lc_kd_02 = "LC2_LC2_AI_KD"; - protected static String lc_kd_03 = "LC3_LC3_AI_KD"; - protected static String lc_kd_04 = "LC4_LC4_AI_KD"; - protected static String lc_kd_05 = "LC5_LC5_KD"; - protected static String lc_kd_06 = "LC6_LC6_AI_op"; - protected static String lc_kd_07 = "LC7_LC7_AI_op"; - protected static String lc_kd_08 = "LC8_LC8_AI_op"; - protected static String lc_kd_09 = "LC9_LC9_AI_op"; - protected static String lc_kd_10 = "LC10_LC10_AI_op"; - protected static String lc_kd_11 = "LC11_LC11_AI_op"; - /** - * 滤池冲洗预测 - */ - protected static String lc_yc_01 = "LC1_LC1_YC"; - protected static String lc_yc_02 = "LC2_LC2_YC"; - protected static String lc_yc_03 = "LC3_LC3_YC"; - protected static String lc_yc_04 = "LC4_LC4_YC"; - protected static String lc_yc_05 = "LC5_LC5_YC"; - protected static String lc_yc_06 = "LC6_LC6_YC"; - protected static String lc_yc_07 = "LC7_LC7_YC"; - protected static String lc_yc_08 = "LC8_LC8_YC"; - protected static String lc_yc_09 = "LC9_LC9_YC"; - protected static String lc_yc_10 = "LC10_LC10_YC"; - protected static String lc_yc_11 = "LC11_LC11_YC"; - - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - public void excuteLC() { - System.out.println("执行web方法(滤池)" + CommUtil.nowDate()); - String wsUrl = "http://127.0.0.1:81/App_Start/WebService1.asmx/LCCX_JC"; - try { - sendPost(wsUrl, "1", lc_sw_01, lc_kd_01, lc_yc_01); - sendPost(wsUrl, "2", lc_sw_02, lc_kd_02, lc_yc_02); - sendPost(wsUrl, "3", lc_sw_03, lc_kd_03, lc_yc_03); - sendPost(wsUrl, "4", lc_sw_04, lc_kd_04, lc_yc_04); - sendPost(wsUrl, "5", lc_sw_05, lc_kd_05, lc_yc_05); - sendPost(wsUrl, "6", lc_sw_06, lc_kd_06, lc_yc_06); - sendPost(wsUrl, "7", lc_sw_07, lc_kd_07, lc_yc_07); - sendPost(wsUrl, "8", lc_sw_08, lc_kd_08, lc_yc_08); - sendPost(wsUrl, "9", lc_sw_09, lc_kd_09, lc_yc_09); - sendPost(wsUrl, "10", lc_sw_10, lc_kd_10, lc_yc_10); - sendPost(wsUrl, "11", lc_sw_11, lc_kd_11, lc_yc_11); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * @param postURL - * @return - */ - public String sendPost(String postURL, String nostr, String lc_sw, String lc_kd, String lc_yc) { - String result = ""; - try { - - int no = 0; - double sw = 0; - double kd = 0; - - //滤池水位(实时值) - MPoint mPoint1 = mPointService.selectById(bizid, lc_sw); - if (mPoint1 != null && mPoint1.getParmvalue() != null) { - sw = Double.parseDouble(mPoint1.getParmvalue().toString()); - } - //滤池出水(阀开度) - MPoint mPoint2 = mPointService.selectById(bizid, lc_kd); - if (mPoint2 != null && mPoint2.getParmvalue() != null) { - kd = Double.parseDouble(mPoint2.getParmvalue().toString()); - } - - if (nostr != null && !nostr.equals("")) { - no = Integer.parseInt(nostr); - } - - PostMethod postMethod = null; - postMethod = new PostMethod(postURL); - postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); - //参数设置,需要注意的就是里边不能传NULL,要传空字符串 - NameValuePair[] data = { - new NameValuePair("N0", no + ""),//滤池编号 - new NameValuePair("SW", sw + ""),//水位实时值 - new NameValuePair("KD", kd + "")//当前开度 - }; - postMethod.setRequestBody(data); - org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient(); - int response = httpClient.executeMethod(postMethod); // 执行POST方法 - result = postMethod.getResponseBodyAsString(); - } catch (Exception e) { - throw new RuntimeException(e.getMessage()); - } - - String xml = ""; - - xml = result.replace("", ""); - xml = xml.replace("", ""); - xml = xml.replace("", ""); - - String val = xml; - - //更新总表 - save(lc_yc, val, bizid); - - //新增子表 -// save_his(lc_yc, val, 0); - - return result; - } - - /** - * 更新总表 - * - * @param mpId 测量点id - * @param val 测量点的值 - */ - public void save(String mpId, String val, String unitId) { - try { - val = val.replace("\n", "");//去除回车 - java.text.DecimalFormat df = new java.text.DecimalFormat("#.####"); - double d = Double.parseDouble(val); - - MPoint mPoint = mPointService.selectById(bizid, mpId); - mPoint.setParmvalue(new BigDecimal(d)); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPointService.update2(bizid, mPoint); - } catch (Exception e) { - System.out.println(CommUtil.nowDate() + ":更新主表=" + e); - } - } - - /** - * 保存子表 - * - * @param mpId 测量点id - * @param val 测量点的值 - * @param timeStr 时间延迟 如 5就是5分钟 - */ - public void save_his(String mpId, String val, int timeStr) { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(val)); - mPointHistory.setMeasuredt(timeStr(timeStr)); - mPointHistory.setTbName("[tb_mp_" + mpId + "]"); - mPointHistoryService.save(bizid, mPointHistory); - } - - //计算时间 - public String timeStr(int str) { - Calendar beforeTime = Calendar.getInstance(); - beforeTime.add(Calendar.MINUTE, str);// str分钟之后的时间 负数为之前 - Date beforeD = beforeTime.getTime(); - String before = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(beforeD); // 前五分钟时间 - return before; - } - - //解析获取数据的值 - public String fx(String xml, String str, int lenght) { -// System.out.println("----------------------------start----------------------------"); -// System.out.println(xml); -// System.out.println("----------------------------end----------------------------"); - String val = xml.substring(xml.indexOf("<" + str + ">"), xml.indexOf("")).substring(lenght); - return val; - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/MpDataStopJob.java b/src/com/sipai/quartz/job/MpDataStopJob.java deleted file mode 100644 index e329704b..00000000 --- a/src/com/sipai/quartz/job/MpDataStopJob.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; - -import com.sipai.entity.data.XServer; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.List; - -public class MpDataStopJob { - @Resource - private XServerService xServerService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - public void execute() throws ParseException { - String nowTime = CommUtil.nowDate(); -// System.out.println("数据中断判定:" + nowTime); - - //10分钟 - String ckTime = CommUtil.subplus(nowTime, "-120", "min"); - System.out.println("前置时间:" + ckTime); - if (CommUtil.compare_time(ckTime, nowTime) != 0) { - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - if (xServerList != null && xServerList.size() > 0) { - for (XServer xServer : xServerList) { - String bizid = xServer.getBizid(); - - List stopPint = this.mPointService.selectListByWhere(bizid, " where id like '%DE_DATADISCONNECT%' "); - if (stopPint != null && stopPint.size() > 0) { - String stopPointId = stopPint.get(0).getId(); -// System.out.println(stopPint.get(0).getId()); - MPoint stopPointMPoint = stopPint.get(0); - List mPoints = this.mPointService.selectTopNumListByWhere(bizid, " where source_type = 'auto' and BizType='污水KH2' and MeasureDT is not null order by MeasureDT desc", "1"); - if (mPoints != null && mPoints.size() > 0) { - BigDecimal stopSt = new BigDecimal(1); - - String pointTime = mPoints.get(0).getMeasuredt(); - System.out.println(mPoints.get(0).getParmname() + ":点位时间:" + pointTime); - System.out.println("判断:" + CommUtil.compare_time(pointTime, ckTime)); - if (CommUtil.compare_time(pointTime, ckTime) == -1) { - stopSt = new BigDecimal(0); - System.out.println(xServer.getName() + "数据中断,中断时间:" + nowTime); - stopPointMPoint.setParmvalue(stopSt); - stopPointMPoint.setMeasuredt(nowTime); - this.mPointService.update2(bizid, stopPointMPoint); - } else { - stopSt = new BigDecimal(1); - stopPointMPoint.setParmvalue(stopSt); - stopPointMPoint.setMeasuredt(nowTime); - this.mPointService.update2(bizid, stopPointMPoint); - } - - List mPointHistoryList = this.mPointHistoryService.selectTopNumListByTableAWhere(bizid, "1", "tb_mp_" + stopPointId, " order by MeasureDT desc"); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setTbName("TB_MP_" + stopPointId); - - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - BigDecimal nowValue = mPointHistoryList.get(0).getParmvalue(); - if (nowValue.intValue() != stopSt.intValue()) { - mPointHistory.setParmvalue(stopSt); - this.mPointHistoryService.save(bizid, mPointHistory); - } - } else { - mPointHistory.setParmvalue(stopSt); - this.mPointHistoryService.save(bizid, mPointHistory); - } - - } - } - } - } - } - - } - -} diff --git a/src/com/sipai/quartz/job/NSWeatherJob.java b/src/com/sipai/quartz/job/NSWeatherJob.java deleted file mode 100644 index fc8c07fd..00000000 --- a/src/com/sipai/quartz/job/NSWeatherJob.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import javax.annotation.Resource; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.List; - -/** - * 定时获取”和风天气“接口数据-南市 - * 使用免费key,有请求限制 - * @author NJP - */ -public class NSWeatherJob { - @Resource - private MPointService mPointService; - @Resource - private CompanyService companyService; - @Resource - private MPointHistoryService mPointHistoryService; - - public void excute() throws IOException{ - System.out.println("执行和风天气方法"); - - List list_company = companyService.selectListByWhere("where 1=1 and type = 'B' order by morder asc"); - if (list_company != null && list_company.size() > 0) { - String bizId = list_company.get(0).getId(); - MPoint T_MAX = mPointService.selectById(bizId,"021NS_WF_T_MAX"); - MPoint T_MIN = mPointService.selectById(bizId,"021NS_WF_T_MIN"); - MPoint SD = mPointService.selectById(bizId,"021NS_WF_SD"); - MPoint T = mPointService.selectById(bizId,"021NS_WF_T"); - MPoint RAIN = mPointService.selectById(bizId,"021NS_WF_RAIN"); - if(T_MAX!=null && T_MIN!=null && SD!=null && T!=null && RAIN!=null ){ - // 格点(坐标)天气-天 - //String dayJson = CommUtil.getGridWeatherHTTPByURL("121.50,31.20", "https://devapi.qweather.com/v7/grid-weather/3d?"); - String dayJson = CommUtil.getGridWeatherHTTPByURL("121.50,31.20", "https://devapi.qweather.com/v7/weather/3d?"); - if (StringUtils.isNotBlank(dayJson)) { - JSONObject jsonObject = JSONObject.fromObject(dayJson); - // 获取列表 - List daily = JSONArray.fromObject(jsonObject.get("daily")); - if (daily != null) { - for (int i = 0; i< daily.size(); i++) { - String fxDate = daily.get(i).get("fxDate").toString()+" 00:00:00"; - // 最高温度 - BigDecimal parmvalue = new BigDecimal(daily.get(i).get("tempMax").toString()); - updateMpvalue(bizId,T_MAX,fxDate,parmvalue); - // 最低温度 - parmvalue = new BigDecimal(daily.get(i).get("tempMin").toString()); - updateMpvalue(bizId,T_MIN,fxDate,parmvalue); - } - } - } - // 格点(坐标)天气-小时 - //String hourJson = CommUtil.getGridWeatherHTTPByURL("121.50,31.20", "https://devapi.qweather.com/v7/grid-weather/24h?"); - String hourJson = CommUtil.getGridWeatherHTTPByURL("121.50,31.20", "https://devapi.qweather.com/v7/weather/24h?"); - if (StringUtils.isNotBlank(hourJson)) { - JSONObject jsonObject = JSONObject.fromObject(hourJson); - // 获取列表 - List hourly = JSONArray.fromObject(jsonObject.get("hourly")); - if (hourly != null) { - for (int i = 0; i< hourly.size(); i++) { - String fxTime = hourly.get(i).get("fxTime").toString().substring(0,16)+":00"; - // 湿度 - BigDecimal parmvalue = new BigDecimal(hourly.get(i).get("humidity").toString()); - updateMpvalue(bizId,SD,fxTime,parmvalue); - // 温度 - parmvalue = new BigDecimal(hourly.get(i).get("temp").toString()); - updateMpvalue(bizId,T,fxTime,parmvalue); - // 降水量mm - parmvalue = new BigDecimal(hourly.get(i).get("precip").toString()); - updateMpvalue(bizId,RAIN,fxTime,parmvalue); - } - } - } - - } - } - System.out.println("执行和风天气方法结束"); - } - public void updateMpvalue(String bizId,MPoint mPoint,String measuredt,BigDecimal parmvalue){ - // 预报日期 - mPoint.setMeasuredt(measuredt); - // 最高温度 - mPoint.setParmvalue(parmvalue); - mPointService.update2(bizId,mPoint); - MPointHistory mPointHistory = new MPointHistory(); - List mPointHistorys = mPointHistoryService.selectListByTableAWhere(bizId,"TB_MP_" + mPoint.getMpointcode(), - "where MeasureDT='"+measuredt+"' "); - if(mPointHistorys!=null && mPointHistorys.size()>0){ - mPointHistory = mPointHistorys.get(0); - mPointHistory.setTbName("[TB_MP_" + mPoint.getMpointcode() + "]"); - mPointHistory.setParmvalue(parmvalue); - mPointHistoryService.updateByMeasureDt(bizId, mPointHistory); - }else{ - mPointHistory.setTbName("[TB_MP_" + mPoint.getMpointcode() + "]"); - mPointHistory.setMeasuredt(measuredt); - mPointHistory.setParmvalue(parmvalue); - mPointHistoryService.save(bizId, mPointHistory); - } - } -} diff --git a/src/com/sipai/quartz/job/NewFormulaExec_Day.java b/src/com/sipai/quartz/job/NewFormulaExec_Day.java deleted file mode 100644 index d539b7cd..00000000 --- a/src/com/sipai/quartz/job/NewFormulaExec_Day.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.data.XServer; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import javax.annotation.Resource; - -public class NewFormulaExec_Day { - @Resource - private XServerService xServerService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointFormulaService mPointFormulaService; - - - public void execute() throws ParseException { - String execTime = CommUtil.nowDate().substring(0,16); -// execTime = CommUtil.subplus(execTime,"-1","day"); - - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - if (xServerList != null && xServerList.size() > 0) { - for (XServer xServer : xServerList) { - String bizid = xServer.getBizid(); - this.mPointFormulaService.getSpData(bizid, execTime, "day", "", ""); - } - } - - - } - -} diff --git a/src/com/sipai/quartz/job/NewFormulaExec_Hour.java b/src/com/sipai/quartz/job/NewFormulaExec_Hour.java deleted file mode 100644 index 9f5cc447..00000000 --- a/src/com/sipai/quartz/job/NewFormulaExec_Hour.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.data.XServer; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import javax.annotation.Resource; - -public class NewFormulaExec_Hour { - @Resource - private XServerService xServerService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointFormulaService mPointFormulaService; - - public void execute() throws ParseException { - String execTime = CommUtil.nowDate(); - - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - if (xServerList != null && xServerList.size() > 0) { - for (XServer xServer : xServerList) { - String bizid = xServer.getBizid(); - this.mPointFormulaService.getSpData(bizid, execTime, "hour", "", ""); - } - } - - - } -} diff --git a/src/com/sipai/quartz/job/NewFormulaExec_Month.java b/src/com/sipai/quartz/job/NewFormulaExec_Month.java deleted file mode 100644 index c7d3a9a4..00000000 --- a/src/com/sipai/quartz/job/NewFormulaExec_Month.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.data.XServer; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import javax.annotation.Resource; - -public class NewFormulaExec_Month { - @Resource - private XServerService xServerService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointFormulaService mPointFormulaService; - - public void execute() throws ParseException { - String execTime = CommUtil.nowDate().substring(0, 16); -// execTime = CommUtil.subplus(execTime,"-1","month"); - - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - if (xServerList != null && xServerList.size() > 0) { - for (XServer xServer : xServerList) { - String bizid = xServer.getBizid(); - this.mPointFormulaService.getSpData(bizid, execTime, "month", "", ""); - } - } - - - } -} diff --git a/src/com/sipai/quartz/job/NewFormulaExec_NowTime.java b/src/com/sipai/quartz/job/NewFormulaExec_NowTime.java deleted file mode 100644 index 1158a3bc..00000000 --- a/src/com/sipai/quartz/job/NewFormulaExec_NowTime.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.data.XServer; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import javax.annotation.Resource; - -public class NewFormulaExec_NowTime { - @Resource - private XServerService xServerService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointFormulaService mPointFormulaService; - - - public void execute() throws ParseException { - System.out.println(CommUtil.nowDate()+":公式计算 nowTime"); - String execTime = CommUtil.nowDate(); - - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - if (xServerList != null && xServerList.size() > 0) { - for (XServer xServer : xServerList) { - String bizid = xServer.getBizid(); - List> outList = this.mPointFormulaService.getSpData(bizid, execTime, "nowTime", "", ""); - } - } - - - } - -} diff --git a/src/com/sipai/quartz/job/NewMonthWork.java b/src/com/sipai/quartz/job/NewMonthWork.java deleted file mode 100644 index dbb9e3da..00000000 --- a/src/com/sipai/quartz/job/NewMonthWork.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.maintenance.*; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.maintenance.*; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -/** - * 每月定时从年度计划生成月度计划 (保养) - */ -public class NewMonthWork { - EquipmentPlanMainYearService equipmentPlanMainYearService = (EquipmentPlanMainYearService) SpringContextUtil.getBean("equipmentPlanMainYearService"); - EquipmentPlanMainYearDetailService equipmentPlanMainYearDetailService = (EquipmentPlanMainYearDetailService) SpringContextUtil.getBean("equipmentPlanMainYearDetailService"); - EquipmentPlanService equipmentPlanService = (EquipmentPlanService) SpringContextUtil.getBean("equipmentPlanService"); - EquipmentPlanEquService equipmentPlanEquService = (EquipmentPlanEquService) SpringContextUtil.getBean("equipmentPlanEquService"); - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - EquipmentPlanTypeService equipmentPlanTypeService = (EquipmentPlanTypeService) SpringContextUtil.getBean("equipmentPlanTypeService"); - - // 第二版 - public void addNewMonthWork(ScheduleJob scheduleJob) { - System.out.println("==============================addNewMonthWork_s_" + CommUtil.nowDate()); - String nowYear = CommUtil.nowDate().substring(0, 4); - // 查出所有的维保年度计划表中数据 - List equipmentPlanMainYears = equipmentPlanMainYearService.selectListByWhere("where plan_type = '" + EquipmentPlanType.Code_Type_By + "' and particular_year >= '" + nowYear + "-01-01 00:00:00.000' "); - if (equipmentPlanMainYears != null && equipmentPlanMainYears.size() > 0) { - for (int i = 0; i < equipmentPlanMainYears.size(); i++) { - System.out.println(i); - String monthId = CommUtil.getUUID(); - // 查询维保的类型 - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(equipmentPlanMainYears.get(i).getType()); - // 根据年度计划表中id来查出关联的detail的数据 - List equipmentPlanMainYearDetails = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + equipmentPlanMainYears.get(i).getId() + "'"); - for (int x = 0; x < equipmentPlanMainYearDetails.size(); x++) { - // 获得厂区 - Company company = unitService.getCompById(equipmentPlanMainYears.get(i).getUnitId()); - // 设备编号 - String detailNumber = ""; - // 获取下一个月 是当前时间的下个月 - String nextDate = nextDate(); - if (company != null) { - detailNumber = company.getEname() + "-BYJH-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - } - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail = equipmentPlanMainYearDetails.get(x); - // 当前月 - String month = CommUtil.nowDate().substring(5, 7); - // 下一个月 - String nextMonth = nextDate.substring(5, 7); - // 或可理解为时间线上小于当前时间的不予以新建 - // 此为要求建立月度维保的月份 - String monthPlan = equipmentPlanMainYearDetail.getMonth(); - // 此为要求建立月度维保的年份 - String yearPlan = equipmentPlanMainYears.get(i).getParticularYear().substring(0, 4); - if (monthPlan.length() == 1) { - monthPlan = "0" + monthPlan; - } - // 维保内容 - String planContent = nextDate.substring(0, 4) + "年" + nextDate.substring(5, 7) + "月 " + equipmentPlanType.getName() + "计划"; - // 拼装出计划日期 - String datePlan = yearPlan + "-" + monthPlan + "-01 00:00:00"; - // 根据方法返回的date类型用于比较 - Date planDate = getPlanDate(datePlan); - // 当前时间 - Date nowDate = new Date(); - // 时间线上大于当前时间的 并且 在遍历过程中设置的维保日期等于下一个月 予以新建 - if ((datePlan.substring(0, 7)).equals(nextDate.substring(0, 7))) { - // 若月度id已存在 则只需添加关联设备 查询条件为此类型已经存在并且unitid是year的 - String sql = "where plan_type_small = '" + equipmentPlanType.getId() + "' and unit_id = '" + equipmentPlanMainYears.get(i).getUnitId() + "' and datediff(month,plan_date,'" + nextDate + "')=0 "; - List oldPlan = equipmentPlanService.selectListByWhere(sql); - if (oldPlan.size() >= 1) { - // 查询已绑定设备 - List equipmentPlanEqus = equipmentPlanEquService.selectListByWhere("where pid = '" + oldPlan.get(0).getId() + "'"); - String equIds = " "; - for (int s = 0; s < equipmentPlanEqus.size(); s++) { - // 累加id进行判断 - equIds += equipmentPlanEqus.get(s).getEquipmentId() + ","; - } - // 若累加id中不包含此年度计划中的设备id不予以关联设备 - if (!equIds.contains(equipmentPlanMainYears.get(i).getEquipmentId())) { - // 新建月度计划关联设备 - EquipmentPlanEqu equipmentPlanEqu = new EquipmentPlanEqu(); - equipmentPlanEqu.setId(CommUtil.getUUID()); - equipmentPlanEqu.setEquipmentId(equipmentPlanMainYears.get(i).getEquipmentId()); - equipmentPlanEqu.setPid(oldPlan.get(0).getId()); - equipmentPlanEqu.setPlanDate(nextDate); - equipmentPlanEqu.setStatus("0"); - equipmentPlanEqu.setContents(equipmentPlanMainYears.get(i).getContents()); - equipmentPlanEqu.setPlanMoney(0); - equipmentPlanEquService.save(equipmentPlanEqu); - } - } else { - // 新建月度计划 - EquipmentPlan equipmentPlan = new EquipmentPlan(); - equipmentPlan.setId(monthId); // 月度计划id - equipmentPlan.setInsdt(CommUtil.nowDate()); // 插入时间 - equipmentPlan.setUnitId(equipmentPlanMainYears.get(i).getUnitId()); // 厂区ID - equipmentPlan.setPlanTypeSmall(equipmentPlanMainYears.get(i).getType()); - equipmentPlan.setPlanTypeBig(EquipmentPlanType.Code_Type_By); // 计划类型 - equipmentPlan.setPlanNumber(detailNumber); // 设备编号 - equipmentPlan.setPlanContents(planContent); // 维保内容 - equipmentPlan.setPlanMoney(0); // 维保金额 - equipmentPlan.setPlanDate(nextDate); // 维保日期 - equipmentPlan.setStatus("noStart"); - equipmentPlanService.save(equipmentPlan); - - // 新建月度计划关联设备 - EquipmentPlanEqu equipmentPlanEqu = new EquipmentPlanEqu(); - equipmentPlanEqu.setId(CommUtil.getUUID()); - equipmentPlanEqu.setEquipmentId(equipmentPlanMainYears.get(i).getEquipmentId()); - equipmentPlanEqu.setPid(monthId); - equipmentPlanEqu.setPlanDate(nextDate); - equipmentPlanEqu.setStatus("0"); - equipmentPlanEqu.setContents(equipmentPlanMainYears.get(i).getContents()); - equipmentPlanEqu.setPlanMoney(0); - equipmentPlanEquService.save(equipmentPlanEqu); - } - } - } - } - } - System.out.println("==============================addNewMonthWork_e_" + CommUtil.nowDate()); - } - - // 获取下一个月的时间 - /*public String nextDate() { - String nowDate = CommUtil.nowDate(); - String nowMoth = nowDate.substring(5, 7); - int nextMoth = 0; - String nextDate = ""; - if (nowMoth.substring(0, 1).equals("0")) { - nextMoth = Integer.parseInt(nowMoth.substring(1, 2)) + 1; - if (nextMoth != 10) { - nextDate = nowDate.substring(0, nowDate.indexOf("-") + 2) + nextMoth + "-01 00:00:00"; - return nextDate; - } else { - nextDate = nowDate.substring(0, nowDate.indexOf("-") + 1) + nextMoth + "-01 00:00:00"; - return nextDate; - } - } else if (nowMoth.equals("12")) { - int nextYearInt = Integer.parseInt(nowDate.substring(0, 4)) + 1; - String nextYear = nextYearInt + ""; - nextDate = nextYear + "-01" + "-01 00:00:00"; - return nextDate; - } else { - nextMoth = Integer.parseInt(nowMoth) + 1; - nextDate = nowDate.substring(0, nowDate.indexOf("-") + 1) + nextMoth + "-01 00:00:00"; - return nextDate; - } - }*/ - - public String nextDate() { - String nowDate = CommUtil.nowDate(); - return nowDate; - } - - // 获取传入时间的Date对象 - public Date getPlanDate(String time) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(); - try { - date = simpleDateFormat.parse(time); - } catch (Exception e) { - e.printStackTrace(); - } - return date; - } -} diff --git a/src/com/sipai/quartz/job/NewMonthWork_Repair.java b/src/com/sipai/quartz/job/NewMonthWork_Repair.java deleted file mode 100644 index 9612bc2c..00000000 --- a/src/com/sipai/quartz/job/NewMonthWork_Repair.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.maintenance.*; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.maintenance.*; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -/** - * 每月定时从年度计划生成月度计划 (维修) - */ -public class NewMonthWork_Repair { - EquipmentPlanMainYearService equipmentPlanMainYearService = (EquipmentPlanMainYearService) SpringContextUtil.getBean("equipmentPlanMainYearService"); - EquipmentPlanMainYearDetailService equipmentPlanMainYearDetailService = (EquipmentPlanMainYearDetailService) SpringContextUtil.getBean("equipmentPlanMainYearDetailService"); - EquipmentPlanService equipmentPlanService = (EquipmentPlanService) SpringContextUtil.getBean("equipmentPlanService"); - EquipmentPlanEquService equipmentPlanEquService = (EquipmentPlanEquService) SpringContextUtil.getBean("equipmentPlanEquService"); - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitService"); - EquipmentPlanTypeService equipmentPlanTypeService = (EquipmentPlanTypeService) SpringContextUtil.getBean("equipmentPlanTypeService"); - - // 第二版 - public void addNewMonthWork(ScheduleJob scheduleJob) { - String nowYear = CommUtil.nowDate().substring(0, 4); - // 查出所有的维保年度计划表中数据 - List equipmentPlanMainYears = equipmentPlanMainYearService.selectListByWhere("where plan_type = '" + EquipmentPlanType.Code_Type_Wx + "' and particular_year >= '" + nowYear + "-01-01 00:00:00.000' "); - if (equipmentPlanMainYears != null && equipmentPlanMainYears.size() > 0) { - for (int i = 0; i < equipmentPlanMainYears.size(); i++) { - String monthId = CommUtil.getUUID(); - // 根据年度计划表中id来查出关联的detail的数据 - List equipmentPlanMainYearDetails = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + equipmentPlanMainYears.get(i).getId() + "'"); - for (int x = 0; x < equipmentPlanMainYearDetails.size(); x++) { - // 获得厂区 - Company company = unitService.getCompById(equipmentPlanMainYears.get(i).getUnitId()); - // 设备编号 - String detailNumber = ""; - // 获取下一个月 是当前时间的下个月 - String nextDate = nextDate(); - if (company != null) { - detailNumber = company.getEname() + "-WXJH-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - } - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail = equipmentPlanMainYearDetails.get(x); - // 当前月 - String month = CommUtil.nowDate().substring(5, 7); - // 下一个月 - String nextMonth = nextDate.substring(5, 7); - // 或可理解为时间线上小于当前时间的不予以新建 - // 此为要求建立月度维保的月份 - String monthPlan = equipmentPlanMainYearDetail.getMonth(); - // 此为要求建立月度维保的年份 - String yearPlan = equipmentPlanMainYears.get(i).getParticularYear().substring(0, 4); - if (monthPlan.length() == 1) { - monthPlan = "0" + monthPlan; - } - // 维保内容 - String planContent = nextDate.substring(0, 4) + "年" + nextDate.substring(6, 7) + "月 " + "维修计划"; - // 拼装出计划日期 - String datePlan = yearPlan + "-" + monthPlan + "-01 00:00:00"; - // 根据方法返回的date类型用于比较 - Date planDate = getPlanDate(datePlan); - // 当前时间 - Date nowDate = new Date(); - // 时间线上大于当前时间的 并且 在遍历过程中设置的维保日期等于下一个月 予以新建 - if ((datePlan.substring(0, 7)).equals(nextDate.substring(0, 7))) { - // 若月度id已存在 则只需添加关联设备 查询条件为此类型已经存在并且unitid是year的 - String sql = "where plan_type_big = '" + EquipmentPlanType.Code_Type_Wx + "' and unit_id = '" + equipmentPlanMainYears.get(i).getUnitId() + "' and datediff(month,plan_date,'" + nextDate + "')=0 "; - List oldPlan = equipmentPlanService.selectListByWhere(sql); - if (oldPlan.size() >= 1) { - // 查询已绑定设备 - List equipmentPlanEqus = equipmentPlanEquService.selectListByWhere("where pid = '" + oldPlan.get(0).getId() + "'"); - String equIds = " "; - for (int s = 0; s < equipmentPlanEqus.size(); s++) { - // 累加id进行判断 - equIds += equipmentPlanEqus.get(s).getEquipmentId() + ","; - } - // 若累加id中不包含此年度计划中的设备id不予以关联设备 - if (!equIds.contains(equipmentPlanMainYears.get(i).getEquipmentId())) { - // 新建月度计划关联设备 - EquipmentPlanEqu equipmentPlanEqu = new EquipmentPlanEqu(); - equipmentPlanEqu.setId(CommUtil.getUUID()); - equipmentPlanEqu.setEquipmentId(equipmentPlanMainYears.get(i).getEquipmentId()); - equipmentPlanEqu.setPid(oldPlan.get(0).getId()); - equipmentPlanEqu.setPlanDate(nextDate); - equipmentPlanEqu.setStatus("0"); - equipmentPlanEqu.setContents(equipmentPlanMainYears.get(i).getContents()); - equipmentPlanEqu.setPlanMoney(0); - equipmentPlanEquService.save(equipmentPlanEqu); - } - } else { - // 新建月度计划 - EquipmentPlan equipmentPlan = new EquipmentPlan(); - equipmentPlan.setId(monthId); // 月度计划id - equipmentPlan.setInsdt(CommUtil.nowDate()); // 插入时间 - equipmentPlan.setUnitId(equipmentPlanMainYears.get(i).getUnitId()); // 厂区ID - equipmentPlan.setPlanTypeBig(EquipmentPlanType.Code_Type_Wx); // 计划类型 - equipmentPlan.setPlanNumber(detailNumber); // 设备编号 - equipmentPlan.setPlanContents(planContent); // 维保内容 - equipmentPlan.setPlanMoney(0); // 维保金额 - equipmentPlan.setPlanDate(nextDate); // 维保日期 - equipmentPlan.setStatus("noStart"); - equipmentPlanService.save(equipmentPlan); - - // 新建月度计划关联设备 - EquipmentPlanEqu equipmentPlanEqu = new EquipmentPlanEqu(); - equipmentPlanEqu.setId(CommUtil.getUUID()); - equipmentPlanEqu.setEquipmentId(equipmentPlanMainYears.get(i).getEquipmentId()); - equipmentPlanEqu.setPid(monthId); - equipmentPlanEqu.setPlanDate(nextDate); - equipmentPlanEqu.setStatus("0"); - equipmentPlanEqu.setContents(equipmentPlanMainYears.get(i).getContents()); - equipmentPlanEqu.setPlanMoney(0); - equipmentPlanEquService.save(equipmentPlanEqu); - } - } - } - } - } - } - - public String nextDate() { - String nowDate = CommUtil.nowDate(); - return nowDate; - } - - // 获取传入时间的Date对象 - public Date getPlanDate(String time) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(); - try { - date = simpleDateFormat.parse(time); - } catch (Exception e) { - e.printStackTrace(); - } - return date; - } -} diff --git a/src/com/sipai/quartz/job/OEProcessJob.java b/src/com/sipai/quartz/job/OEProcessJob.java deleted file mode 100644 index 6b34dcd1..00000000 --- a/src/com/sipai/quartz/job/OEProcessJob.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.sipai.quartz.job; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.annotation.Resource; - -import com.sipai.entity.activiti.OEProcess; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.scada.OEProcessService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -public class OEProcessJob { - - @Resource - private OEProcessService oeProcessService; - - @Resource - private UserService userService; - - @Resource - private WorkflowService workflowService; - - - public void execute() throws Exception{ - - System.out.println("========================待办任务定时任务开始=============================="); - - InputStream inputStream=this.getClass().getResourceAsStream("/url.properties"); - Properties properties = new Properties(); - properties.load(new BufferedInputStream(inputStream)); - String url=properties.getProperty("url"); - - OEProcess oePro = new OEProcess(); - // - List userList = userService.selectList(); - //OA已有待办列表 - List oepList=oeProcessService.selectListByWhereOAELM("OA_ELM"," where 1=1 "); - - List eoProcessNameList = new ArrayList<>(); - //2020-10-28 niu 修改为每次全部删除,之后执行新数据插入,没有数据则不插入 - if(oepList.size()>0 && null!=oepList){ - oeProcessService.deleteByWhereOAELM("OA_ELM", " where Meno='设备管理系统' "); - /*for(OEProcess oeProcess:oepList){ - eoProcessNameList.add(oeProcess.getUsername()); - }*/ - } - if(null!=userList && userList.size()>0){ - for(User user:userList){ - String userName = user.getName(); - String userId = user.getId(); - Map resultInfo = new HashMap<>(); - List todoTaskList=workflowService.findTodoTasks(userId,null,resultInfo); - if(todoTaskList.size() >0 && null!=todoTaskList){ - int todoTaskCount=todoTaskList.size(); - oePro.setId(CommUtil.getUUID()); - oePro.setProcessnum("您有[ "+todoTaskCount+" ]件“设备管理系统”审批待办理"); - oePro.setUsername(userName); - oePro.setUrl(url+"&username="+user.getName()+"&password="+user.getPassword()); - oePro.setMeno("设备管理系统"); - oePro.setYwlb("001"); - oeProcessService.saveOAELM("OA_ELM",oePro); - } - /*if(eoProcessNameList.contains(userName)){ - List todoTaskList=workflowService.findTodoTasks(userId,null,resultInfo); - if(todoTaskList.size() >0 && null!=todoTaskList){ - int todoTaskCount=todoTaskList.size(); - oePro.setId(CommUtil.getUUID()); - oePro.setProcessnum("您有[ "+todoTaskCount+" ]件“设备管理系统”审批待办理"); - oePro.setUsername(user.getName()); - oePro.setUrl(url+"&username="+user.getName()+"&password="+user.getPassword()); - oeProcessService.updateOAELM("OA_ELM",oePro); - } - }else{ - List todoTaskList=workflowService.findTodoTasks(userId,null,resultInfo); - if(todoTaskList.size() >0 && null!=todoTaskList){ - int todoTaskCount=todoTaskList.size(); - oePro.setId(CommUtil.getUUID()); - oePro.setProcessnum("您有[ "+todoTaskCount+" ]件“设备管理系统”审批待办理"); - oePro.setUsername(user.getName()); - oePro.setUrl(url+"&username="+user.getName()+"&password="+user.getPassword()); - oeProcessService.saveOAELM("OA_ELM",oePro); - } - }*/ - } - } - System.out.println("========================待办任务定时任务结束=============================="); - } - - /*public void execute() throws Exception{ - - System.out.println("========================待办任务定时任务开始=============================="); - - InputStream inputStream=this.getClass().getResourceAsStream("/url.properties"); - Properties properties = new Properties(); - properties.load(new BufferedInputStream(inputStream)); - String url=properties.getProperty("url"); - - OEProcess oePro= new OEProcess(); - // - List userList=userService.selectList(); - //OA已有待办列表 - List oepList=oeProcessService.selectListByWhereOAELM("OA_ELM"," where 1=1 "); - - List eoProcessNameList = new ArrayList<>(); - for(OEProcess oeProcess:oepList){ - eoProcessNameList.add(oeProcess.getUsername()); - } - - - if(oepList.size()>0 && null!=oepList){ - - for(User user:userList){ - - String userName = user.getName(); - String userId = user.getId(); - Map resultInfo = new HashMap<>(); - - if(!eoProcessNameList.contains(userName)){ - //String userId = user.getId(); - //Map resultInfo = new HashMap<>(); - - List todoTaskList=workflowService.findTodoTasks(userId,null,resultInfo); - if(todoTaskList.size() >0 && null!=todoTaskList){ - int todoTaskCount=todoTaskList.size(); - oePro.setId(CommUtil.getUUID()); - oePro.setProcessnum("您有[ "+todoTaskCount+" ]件“设备管理系统”审批待办理"); - oePro.setUsername(user.getName()); - oePro.setUrl(url+"&username="+user.getName()+"&password="+user.getPassword()); - oeProcessService.saveOAELM("OA_ELM",oePro); - } - }else{ - //String userId = user.getId(); - //Map resultInfo = new HashMap<>(); - List todoTaskList=workflowService.findTodoTasks(userId,null,resultInfo); - if(todoTaskList.size() >0 && null!=todoTaskList){ - int todoTaskCount=todoTaskList.size(); - oePro.setId(CommUtil.getUUID()); - oePro.setProcessnum("您有[ "+todoTaskCount+" ]件“设备管理系统”审批待办理"); - oePro.setUsername(user.getName()); - oePro.setUrl(url+"&username="+user.getName()+"&password="+user.getPassword()); - oeProcessService.updateOAELM("OA_ELM",oePro); - } - } - - } - - }else{ - //首次插入信息 - for(User user:userList){ - - String userId = user.getId(); - Map resultInfo = new HashMap<>(); - - List todoTaskList=workflowService.findTodoTasks(userId,null,resultInfo); - if(todoTaskList.size() >0 && null!=todoTaskList){ - int todoTaskCount=todoTaskList.size(); - oePro.setId(CommUtil.getUUID()); - oePro.setProcessnum("您有[ "+todoTaskCount+" ]件“设备管理系统”审批待办理"); - oePro.setUsername(user.getName()); - oePro.setUrl(url+"&username="+user.getName()+"&password="+user.getPassword()); - oeProcessService.saveOAELM("OA_ELM",oePro); - } - } - } - - System.out.println("========================待办任务定时任务结束=============================="); - }*/ - -} - diff --git a/src/com/sipai/quartz/job/OnLineDataSaveJob.java b/src/com/sipai/quartz/job/OnLineDataSaveJob.java deleted file mode 100644 index 9825bd6c..00000000 --- a/src/com/sipai/quartz/job/OnLineDataSaveJob.java +++ /dev/null @@ -1,297 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.repository.MPointRepo; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointFormula; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.work.MPointES; -import com.sipai.service.scada.MPointFormulaService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.MsgWebSocket2; -import org.apache.commons.httpclient.Cookie; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.redisson.api.RMap; -import org.redisson.api.RMapCache; -import org.redisson.api.RedissonClient; -import org.springframework.beans.factory.BeanIsNotAFactoryException; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.List; - -/** - * 从清研讯科获取在线数据保存在生产库子表 - */ -public class OnLineDataSaveJob { - - public MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - private RedissonClient redissonClient = (RedissonClient) SpringContextUtil.getBean(RedissonClient.class); - private MPointFormulaService mPointFormulaService = (MPointFormulaService) SpringContextUtil.getBean("mPointFormulaService"); - - //沙口项目 - public void save2(ScheduleJob scheduleJob) { - getNum4Http(); - getNum4Redis(); - } - - //南市项目 - public void run2(ScheduleJob scheduleJob) { - updateData_ns(); - } - - /** - * http获取 区域ids - * (沙口) - * - * @param - */ - public void getNum4Http() { -// System.out.println(CommUtil.nowDate() + "----------------------------------------------------------in"); - String unitId = "FS_SK11_C"; - - String ip = "192.168.6.200:8180"; - String username = "admin"; - String password = "aa2f8ccc225493465fe084cf4dc7f535";//Xipai1126 平台登录:admin/Ty123456 - - String url = "http://" + ip + "/localsense/login"; - PostMethod poster = new PostMethod(url); - poster.addParameter("Content-Type", "application/x-www-from-urlencoded;charset=UTF-8 "); - HttpClient httpClient = new HttpClient(); - NameValuePair un = new NameValuePair("username", username); - NameValuePair pwd = new NameValuePair("password", password); - NameValuePair[] msg = {un, pwd}; - poster.setRequestBody(msg); - String result = ""; - Cookie[] cookie = null; - String ids = ""; - try { - httpClient.executeMethod(poster); - result = poster.getResponseBodyAsString(); - - if (poster.getStatusCode() == 200) { - cookie = httpClient.getState().getCookies(); - - //查询所有分组 - String url2 = "http://" + ip + "/localsense/groupmanage/getallbasegroup"; - PostMethod post = new PostMethod(url2); - post.setRequestHeader("Cookie", cookie.toString()); - httpClient.executeMethod(post); - byte[] responseBody = post.getResponseBody(); - String msg2 = new String(responseBody); - JSONObject jsonObject = JSONObject.parseObject(msg2); - JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("rows").toString()); - - String changquId = "DEFAULT";//职工 - String fangkeId = "927854870726180900";//访客 - String yunweiId = "927854921263349800";//物业 - String shigongId = "932729768002977800";//施工 - - String changquCode = "people_online_num_cn";//职工 - String fangkeCode = "people_online_num_fk";//访客 - String yunweiCode = "people_online_num_sgyw";//物业 - String shigongCode = "people_online_num_sgry";//施工 - String allnumCode = "online_num_all";//总数 - - int changqu = 0;//职工 - int fangke = 0;//访客 - int yunwei = 0;//物业 - int shigong = 0;//施工 - int allnum = 0;//总在线数 - - //查询所有区域 - String url3 = "http://" + ip + "/localsense/groupmanage/getguanlianinfo"; - PostMethod post2 = new PostMethod(url3); - post2.setRequestHeader("Cookie", cookie.toString()); - httpClient.executeMethod(post2); - byte[] responseBody2 = post2.getResponseBody(); - String msg3 = new String(responseBody2); - JSONObject jsonObject2 = JSONObject.parseObject(msg3); - JSONArray jsonArray2 = JSONArray.parseArray(jsonObject2.get("rows").toString()); - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject json2 = JSONObject.parseObject(jsonArray2.get(j).toString()); - if (changquId.equals(json2.get("groupid"))) { - //查询单张卡片状态 - String url_online = "http://" + ip + "/localsense/androidApp/isTagLocated?tagid=" + json2.get("tagid"); - PostMethod post_online = new PostMethod(url_online); - post_online.setRequestHeader("Cookie", cookie.toString()); - httpClient.executeMethod(post_online); - byte[] responseBody_online = post_online.getResponseBody(); - String msg_online = new String(responseBody_online); - JSONObject jsonObject_online = JSONObject.parseObject(msg_online); - if (jsonObject_online.get("rows").equals(true)) { - changqu += 1; - allnum += 1;//总人数+1 - } - } - if (fangkeId.equals(json2.get("groupid"))) { - //查询单张卡片状态 - String url_online = "http://" + ip + "/localsense/androidApp/isTagLocated?tagid=" + json2.get("tagid"); - PostMethod post_online = new PostMethod(url_online); - post_online.setRequestHeader("Cookie", cookie.toString()); - httpClient.executeMethod(post_online); - byte[] responseBody_online = post_online.getResponseBody(); - String msg_online = new String(responseBody_online); - JSONObject jsonObject_online = JSONObject.parseObject(msg_online); - if (jsonObject_online.get("rows").equals(true)) { - fangke += 1; - allnum += 1;//总人数+1 - } - } - if (yunweiId.equals(json2.get("groupid"))) { - //查询单张卡片状态 - String url_online = "http://" + ip + "/localsense/androidApp/isTagLocated?tagid=" + json2.get("tagid"); - PostMethod post_online = new PostMethod(url_online); - post_online.setRequestHeader("Cookie", cookie.toString()); - httpClient.executeMethod(post_online); - byte[] responseBody_online = post_online.getResponseBody(); - String msg_online = new String(responseBody_online); - JSONObject jsonObject_online = JSONObject.parseObject(msg_online); - if (jsonObject_online.get("rows").equals(true)) { - yunwei += 1; - allnum += 1;//总人数+1 - } - } - if (shigongId.equals(json2.get("groupid"))) { - //查询单张卡片状态 - String url_online = "http://" + ip + "/localsense/androidApp/isTagLocated?tagid=" + json2.get("tagid"); - PostMethod post_online = new PostMethod(url_online); - post_online.setRequestHeader("Cookie", cookie.toString()); - httpClient.executeMethod(post_online); - byte[] responseBody_online = post_online.getResponseBody(); - String msg_online = new String(responseBody_online); - JSONObject jsonObject_online = JSONObject.parseObject(msg_online); - if (jsonObject_online.get("rows").equals(true)) { - shigong += 1; - allnum += 1;//总人数+1 - } - } - } - - List list = mPointService.selectListByWhere(unitId, "where id = '" + changquCode + "'"); - if (list != null && list.size() > 0) { - MPoint mPoint = list.get(0); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(changqu)); - mPointService.update3(unitId, mPoint); - } - - List list2 = mPointService.selectListByWhere(unitId, "where id = '" + fangkeCode + "'"); - if (list2 != null && list2.size() > 0) { - MPoint mPoint = list2.get(0); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(fangke)); - mPointService.update3(unitId, mPoint); - } - - List list3 = mPointService.selectListByWhere(unitId, "where id = '" + yunweiCode + "'"); - if (list3 != null && list3.size() > 0) { - MPoint mPoint = list3.get(0); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(yunwei)); - mPointService.update3(unitId, mPoint); - } - - List list4 = mPointService.selectListByWhere(unitId, "where id = '" + shigongCode + "'"); - if (list4 != null && list4.size() > 0) { - MPoint mPoint = list4.get(0); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(shigong)); - mPointService.update(unitId, mPoint); - } - - //总数 - List list5 = mPointService.selectListByWhere(unitId, "where id = '" + allnumCode + "'"); - if (list5 != null && list5.size() > 0) { - MPoint mPoint = list5.get(0); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(allnum)); - mPointService.update3(unitId, mPoint); - } - - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * sipaiis_local项目已经将每个卡片的在线数存到redis里中了 WMS直接更新总表和es即可 - * (沙口) - */ - public void getNum4Redis() { - String unitId = "FS_SK11_C"; - try { - RMap map_redis = redissonClient.getMap(CommString.REDIS_KEY_TYPE_LocalNum); - for (String key : map_redis.keySet()) { - MPoint mPoint = mPointService.selectById(key); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(map_redis.get(key))); - mPointService.update3(unitId, mPoint); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 南厂项目 - */ - public void updateData_ns() { - String unitId = "021NS"; - try { - - //先将数据置为0 - List list = mPointService.selectListByWhere(unitId, "where SignalTag = 'LC_COUNT'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - MPoint mPoint = mPointService.selectById(list.get(i).getId()); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal("0")); - mPointService.update(unitId, mPoint); - } - } - - //从redis获取最新在线数 - RMap map_redis = redissonClient.getMap(CommString.REDIS_KEY_TYPE_LocalNum); - for (String key : map_redis.keySet()) { - if (map_redis.get(key) != null && !map_redis.get(key).equals("0")) { - List list_fm = mPointFormulaService.selectListByWhere(unitId, "where pmpid = '" + key + "'"); - if (list_fm != null && list_fm.size() > 0) { - int num = 0; - for (int i = 0; i < list_fm.size(); i++) { - if(map_redis.get(list_fm.get(i).getMpid())!=null && map_redis.get(list_fm.get(i).getMpid()).equals("0")){ - num += map_redis.get(list_fm.get(i).getMpid()); - } - } - MPoint mPoint = mPointService.selectById(key); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(num)); - mPointService.update(unitId, mPoint); - } else { - MPoint mPoint = mPointService.selectById(key); - mPoint.setMeasuredt(CommUtil.nowDate()); - mPoint.setParmvalue(new BigDecimal(map_redis.get(key))); - mPointService.update(unitId, mPoint); - } - } - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - - -} diff --git a/src/com/sipai/quartz/job/PatrolPlanJob.java b/src/com/sipai/quartz/job/PatrolPlanJob.java deleted file mode 100644 index 22260943..00000000 --- a/src/com/sipai/quartz/job/PatrolPlanJob.java +++ /dev/null @@ -1,223 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import javax.annotation.Resource; - -import com.sipai.entity.enums.PatrolType; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.GroupType; -import com.sipai.entity.work.Scheduling; -import com.sipai.service.company.CompanyService; -import com.sipai.service.timeefficiency.PatrolModelService; -import com.sipai.service.timeefficiency.PatrolPlanService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.work.GroupTimeService; -import com.sipai.service.work.GroupTypeService; -import com.sipai.service.work.SchedulingService; -import com.sipai.tools.CommUtil; - -/** - * 巡检自动下发 - */ -public class PatrolPlanJob { - @Resource - private PatrolModelService patrolModelService; - @Resource - private PatrolPlanService patrolPlanService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private SchedulingService schedulingService; - @Resource - private CompanyService companyService; - @Resource - private GroupTypeService groupTypeService; - @Resource - private GroupTimeService groupTimeService; - - /** - * 通用巡检计划自动下发 - * @throws ParseException - */ - public void execute() throws ParseException { - - //1.查出每个厂是否存在排班(无排班则使用改厂的默认模式) - //2.查排班是否关联了模式(存在则用排班的模式,不存在则用默认的模式) - //3.循环查询指定模式的巡检计划表 - - List list = companyService.selectListByWhere("where 1=1 "); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - System.out.println(list.get(i).getSname()); - //String productPatrolType = PatrolType.Product.getId(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String date = sdf.format(new Date()); - System.out.println(date + "巡检任务下发"); - String patrolModelIds = ""; - - String modelId_p = "";//运行班组id - String modelId_e = "";//设备班组id - List groupType_p = groupTypeService.selectListByWhere("where patrolType = '" + com.sipai.entity.enums.PatrolType.Product.getId() + "'"); - List groupType_e = groupTypeService.selectListByWhere("where patrolType = '" + com.sipai.entity.enums.PatrolType.Equipment.getId() + "'"); - if (groupType_p != null && groupType_p.size() > 0) { - modelId_p = groupType_p.get(0).getId(); - } - if (groupType_e != null && groupType_e.size() > 0) { - modelId_e = groupType_e.get(0).getId(); - } - - date = date.substring(0, 10); - String[] dayTime = groupTimeService.getStartAndEndTime(date); -// String[] dayTime = groupTimeService.getGroupTimeStartAndEndTime(modelId_p, date); - - /** - * 运行巡检 - */ - //查询排班 DateDiff(dd,datetime类型字段,getdate())=0 -// List schedulings_p = this.schedulingService.selectListByWhere("where stdt >= '" + dayTime[0] + "' and eddt <='" + dayTime[1] + "' and bizid = '" + list.get(i).getId() + "' and schedulingtype = '" + modelId_p + "'"); - List schedulings_p = this.schedulingService.selectListByWhere("where DateDiff(dd,stdt,getdate())=0 and bizid = '" + list.get(i).getId() + "' and schedulingtype = '" + modelId_p + "'"); - //查询默认模式 - List patrolModels_p = patrolModelService.selectListByWhere("where default_flag='" + true + "' and unit_id = '" + list.get(i).getId() + "' and type = '" + com.sipai.entity.enums.PatrolType.Product.getId() + "'"); - //存在排班使用排班模式 - if (schedulings_p != null && schedulings_p.size() > 0) { - if (schedulings_p.get(0).getPatrolmode() != null && !schedulings_p.get(0).getPatrolmode().equals("")) { - patrolModelIds += "'" + schedulings_p.get(0).getPatrolmode() + "',"; - } else { - if (patrolModels_p != null && patrolModels_p.size() > 0) { - patrolModelIds += "'" + patrolModels_p.get(0).getId() + "',";//默认模式 - } - } - } - //不存在排班使用默认模式 - else { - if (patrolModels_p != null && patrolModels_p.size() > 0) { - patrolModelIds += "'" + patrolModels_p.get(0).getId() + "',";//默认模式 - } - } - - /** - * 设备巡检 - */ - //查询排班 -// List schedulings_e = this.schedulingService.selectListByWhere("where stdt >= '" + dayTime[0] + "' and eddt <='" + dayTime[1] + "' and bizid = '" + list.get(i).getId() + "' and schedulingtype = '" + modelId_e + "'"); - List schedulings_e = this.schedulingService.selectListByWhere("where DateDiff(dd,stdt,getdate())=0 and bizid = '" + list.get(i).getId() + "' and schedulingtype = '" + modelId_e + "'"); - //查询默认模式 - List patrolModels_e = patrolModelService.selectListByWhere("where default_flag='" + true + "' and unit_id = '" + list.get(i).getId() + "' and type = '" + PatrolType.Equipment.getId() + "'"); - //存在排班使用排班模式 - if (schedulings_e != null && schedulings_e.size() > 0) { - if (schedulings_e.get(0).getPatrolmode() != null && !schedulings_e.get(0).getPatrolmode().equals("")) { - patrolModelIds += "'" + schedulings_e.get(0).getPatrolmode() + "',"; - } else { - if (patrolModels_e != null && patrolModels_e.size() > 0) { - patrolModelIds += "'" + patrolModels_e.get(0).getId() + "',";//默认模式 - } - } - } - //不存在排班使用默认模式 - else { - if (patrolModels_e != null && patrolModels_e.size() > 0) { - patrolModelIds += "'" + patrolModels_e.get(0).getId() + "',";//默认模式 - } - } - - //汇总一个厂区的 运行+设备 需要下发的模式 - if (patrolModelIds != null && !patrolModelIds.equals("")) { - patrolModelIds = patrolModelIds.substring(0, patrolModelIds.length() - 1); - } else { - patrolModelIds = "'" + "no" + "'"; - } - - List patrolPlans = this.patrolPlanService.selectListByWhere("where patrol_model_id in (" + patrolModelIds + ")"); - for (PatrolPlan patrolPlan : patrolPlans) { - //添加日模式 周模式 月模式下发判断 - if (patrolPlan.getReleaseModal() != null && patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Weekly)) { - //周下发 - //获取今天周几 - Calendar calendar = Calendar.getInstance(); - String day = String.valueOf(calendar.get(Calendar.DAY_OF_WEEK)); - //String displayName = calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.getDefault()); - if (patrolPlan.getWeekRegister().indexOf(day) != -1) {//今天的星期在寄存器内有 - //System.out.println("含有"); - //判断周间隔之前那天是否有记录,有就下发,没有则判断之间前几周当前星期几是否有记录,全部没有则下发(判断为第一天) - String time = CommUtil.nowDate(); //当前时间 - //非每周都下发 - for (int l = patrolPlan.getWeekInterval() + 1; l > 1; l--) { - int num = l * 7; //加的天数 - Date currdate = sdf.parse(time); - System.out.println("初始的时间是:" + time); - Calendar ca = Calendar.getInstance(); - ca.setTime(currdate); - ca.add(Calendar.DATE, -num); - currdate = ca.getTime(); - String infdate = sdf.format(currdate); - //寻找该巡检计划id 下推算时间当天是否有记录 - List patrolRecords = this - .patrolRecordService.selectListByWhere(" where patrol_plan_id = '" + patrolPlan.getId() - + "' and convert(varchar,insdt,120) like '" + infdate.substring(0, 10) + "%' "); - if (patrolRecords != null && patrolRecords.size() != 0 && l == patrolPlan.getWeekInterval() + 1) { - //周间隔那天有记录 下发 - patrolRecordService.createPatrolRecord(date, patrolPlan.getId(), patrolPlan.getInsuser()); - } else if (patrolRecords != null && patrolRecords.size() != 0 && l != patrolPlan.getWeekInterval() + 1) { - //周间隔内有记录 不下发 跳出循环 - break; - } else { - //没有记录 - //最后一周间隔也没记录,判断为该计划第一天下发 - if (l == 1) { - patrolRecordService.createPatrolRecord(date, patrolPlan.getId(), patrolPlan.getInsuser()); - } - } - } - //若每周都下发 - if (patrolPlan.getWeekInterval() == 0) { - patrolRecordService.createPatrolRecord(date, patrolPlan.getId(), patrolPlan.getInsuser()); - } - } - } else if (patrolPlan.getReleaseModal() != null && patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Daily)) { - //日下发 - patrolRecordService.createPatrolRecord(date, patrolPlan.getId(), patrolPlan.getInsuser()); - } else if (patrolPlan.getReleaseModal() != null && patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Monthly)) { - //月下发 - //如果查到该任务为最后一天的任务 - if (patrolPlan.getMonthRegister().toString().equals(PatrolPlan.Last_Day)) { - //如果当前日为当月的最后一天则进入方法 - if (date.substring(8, 10).toString().equals(getMaxDayOfThisMonth().substring(8, 10).toString())) { - System.out.println("monthly record issued -- lastday"); - patrolRecordService.createPatrolRecord(date, patrolPlan.getId(), patrolPlan.getInsuser()); - } - } else { - String[] monthRegisterArr = patrolPlan.getMonthRegister().split(","); - if (Arrays.asList(monthRegisterArr).contains(String.valueOf(sdf.parse(date).getDate()))) { - System.out.println("monthly record issued"); - patrolRecordService.createPatrolRecord(date, patrolPlan.getId(), patrolPlan.getInsuser()); - } - } - } - } - } - } - } - - /** - * 获取当月最后一天 - * - * @return yyyy-mm-dd - */ - public static String getMaxDayOfThisMonth() { - SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd"); - Calendar cal = Calendar.getInstance(); - cal.set(Calendar.DATE, 1); //主要就是这个roll方法 - cal.roll(Calendar.DATE, -1); - return myFormatter.format(cal.getTime()); - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/PatrolPlanSafeJob.java b/src/com/sipai/quartz/job/PatrolPlanSafeJob.java deleted file mode 100644 index 3d3ad92a..00000000 --- a/src/com/sipai/quartz/job/PatrolPlanSafeJob.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.enums.PatrolType; -import com.sipai.entity.process.DataPatrol; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.timeefficiency.PatrolPlan; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.process.DataPatrolService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolModelService; -import com.sipai.service.timeefficiency.PatrolPlanService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.MsgWebSocket2; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.beans.factory.annotation.Autowired; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * 安全任务自动下发定时器 - * sj 2023-04-26 - */ -public class PatrolPlanSafeJob { - CompanyService companyService = (CompanyService) SpringContextUtil.getBean("companyService"); - PatrolModelService patrolModelService = (PatrolModelService) SpringContextUtil.getBean("patrolModelService"); - PatrolPlanService patrolPlanService = (PatrolPlanService) SpringContextUtil.getBean("patrolPlanService"); - PatrolRecordService patrolRecordService = (PatrolRecordService) SpringContextUtil.getBean("patrolRecordService"); - - public void fun1(ScheduleJob scheduleJob) throws ParseException { -// System.out.println("PatrolPlanSafeJob=================================="+CommUtil.nowDate()); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String date = sdf.format(new Date()); - List list = companyService.selectListByWhere("where 1=1 "); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - /** - * 1.查询该厂的默认模式 - */ - String patrolModelId = "";//默认模式id -// System.out.println("where default_flag='1' and unit_id = '" + list.get(i).getId() + "' and type = '" + PatrolType.Safe.getId() + "' "); - List patrolModels = patrolModelService.selectListByWhere("where default_flag='" + true + "' and unit_id = '" + list.get(i).getId() + "' and type = '" + PatrolType.Safe.getId() + "' "); - if (patrolModels != null && patrolModels.size() > 0) { - patrolModelId = patrolModels.get(0).getId(); - } - - //and plan_issuance_date = '" + CommUtil.nowDate().substring(0, 10) + "' - List patrolPlans = this.patrolPlanService.selectListByWhere("where patrol_model_id = '" + patrolModelId + "'"); - for (PatrolPlan patrolPlan : patrolPlans) { - String sdt = CommUtil.subplus(patrolPlan.getPlanIssuanceDate(), patrolPlan.getAdvanceDay() * (-1) + "", "day"); -// System.out.println("计划时间:" + patrolPlan.getPlanIssuanceDate().substring(0, 10) + "======提前几天:" + patrolPlan.getAdvanceDay() + "======预计时间:" + sdt.substring(0, 10) + "======现在时间:" + CommUtil.nowDate().substring(0, 10) + "======" + patrolPlan.getName()); - if (sdt.substring(0, 10).equals(CommUtil.nowDate().substring(0, 10))) { - System.out.println("============================Start==============================="); - System.out.println("任务名称:" + patrolPlan.getName()); - System.out.println("类型:" + patrolPlan.getReleaseModal()); - System.out.println("计划下发日期:" + patrolPlan.getPlanIssuanceDate()); - System.out.println("预计时间:" + sdt.substring(0, 10)); - - //每日下发 - if (patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Daily)) { -// System.out.println("直接下发!"); - patrolPlan.setPlanIssuanceDate(CommUtil.differenceDate(1));//计划日期改成明天 - } - //每周下发 - if (patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Weekly)) { -// System.out.println("周间隔:" + patrolPlan.getWeekInterval()); -// System.out.println("周下发日期:" + patrolPlan.getWeekRegister()); - - Calendar calendar = Calendar.getInstance(); - String day = String.valueOf(calendar.get(Calendar.DAY_OF_WEEK)); -// System.out.println("今日星期几:" + day); - - if (patrolPlan.getWeekRegister().contains(day)) { - System.out.println("今日存在任务!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(日)"); - - //下发任务 - patrolRecordService.createPatrolRecord_Safe(sdt, patrolPlan.getPlanIssuanceDate(), patrolPlan.getId(), "emp01"); - - //修改下次计划日期 - String[] time = patrolPlan.getWeekRegister().split(","); - for (String s : time) { - if (Integer.parseInt(day) < Integer.parseInt(s)) { - patrolPlan.setPlanIssuanceDate(CommUtil.differenceDate((Integer.parseInt(s) - Integer.parseInt(day)))); - break; - } else { - patrolPlan.setPlanIssuanceDate(CommUtil.subplus((CommUtil.differenceDate((Integer.parseInt(time[0]) - Integer.parseInt(day)))) + "", "7", "day")); - } - } - - } else { - System.out.println("今日不存在任务"); - } - - } - //每月下发 - if (patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Monthly)) { - System.out.println("月间隔:" + patrolPlan.getMonthInterval()); - System.out.println("月下发日期:" + patrolPlan.getMonthRegister()); - System.out.println("今日日期:" + sdt.substring(8, 10)); - String[] monthRegisterArr = patrolPlan.getMonthRegister().split(","); - //查询最近下发日期 - if (patrolPlan.getMonthRegister() != null && !patrolPlan.getMonthRegister().equals("")) { - int now_dt = Integer.parseInt(patrolPlan.getPlanIssuanceDate().substring(8, 10)); - //下发寄存器数组 - String[] time = patrolPlan.getMonthRegister().split(","); - //下次下发时间 - String next_dt = ""; - //0为当月 1为非当月 - String month_st = "1"; - for (String s : time) { - if (now_dt < Integer.parseInt(s)) { - next_dt = s; - month_st = "0"; - break; - } - } - - //下发任务 - patrolRecordService.createPatrolRecord_Safe(sdt, patrolPlan.getPlanIssuanceDate(), patrolPlan.getId(), "emp01"); - - //修改下次计划日期 - if (month_st.equals("0")) {//当月 - String dt = patrolPlan.getPlanIssuanceDate().substring(0, 7) + "-" + next_dt; - patrolPlan.setPlanIssuanceDate(dt); - } else {//非当月 - String dt = CommUtil.subplus(patrolPlan.getPlanIssuanceDate().substring(0, 7) + "-" + time[0], patrolPlan.getMonthInterval() + "", "month"); - patrolPlan.setPlanIssuanceDate(dt); - } - } - - } - //每年下发 - if (patrolPlan.getReleaseModal().equals(TimeEfficiencyCommStr.PatrolPlan_Yearly)) { -// System.out.println("年间隔:" + patrolPlan.getYearInterval()); -// System.out.println("年下发日期:" + patrolPlan.getYearRegister()); - - if (patrolPlan.getYearRegister() != null && !patrolPlan.getYearRegister().equals("")) { - int now_month = Integer.parseInt(patrolPlan.getPlanIssuanceDate().substring(5, 7)); - //下发寄存器数组 - String[] time = patrolPlan.getYearRegister().split(","); - //下次下发时间 - String next_dt = ""; - //0为当年 1为非当年 - String month_st = "1"; - for (String s : time) { - String[] str = s.split("\\."); - if (now_month < Integer.parseInt(str[0])) { - next_dt = s; - month_st = "0"; - break; - } - } - - //下发任务 - patrolRecordService.createPatrolRecord_Safe(sdt, patrolPlan.getPlanIssuanceDate(), patrolPlan.getId(), "emp01"); - - if (month_st.equals("0")) {//当月 - String dt = patrolPlan.getPlanIssuanceDate().substring(0, 4) + "-" + next_dt.split("\\.")[0] + "-" + next_dt.split("\\.")[1]; - patrolPlan.setPlanIssuanceDate(dt); - } else {//非当月 - String dt = CommUtil.subplus(patrolPlan.getPlanIssuanceDate().substring(0, 4) + "-" + time[0].split("\\.")[0] + "-" + time[0].split("\\.")[1], patrolPlan.getYearInterval() + "", "year"); - patrolPlan.setPlanIssuanceDate(dt); - } - } - } - - //更新最新下发日期 - patrolPlan.setLastIssuanceDate(CommUtil.nowDate()); - patrolPlanService.updateSimple(patrolPlan); - System.out.println("============================End==============================="); - } - } - } - } - - } - - public void fun2(ScheduleJob scheduleJob) throws ParseException { - List patrolPlans = this.patrolPlanService.selectListByWhere("where 1=1"); - for (PatrolPlan patrolPlan : patrolPlans) { - if (patrolPlan.getReleaseModal().equals("daily")) {//间隔 日 - patrolPlan.setPlanIssuanceDate(CommUtil.differenceDate(1)); - } - if (patrolPlan.getReleaseModal().equals("weekly")) {//间隔 周 weekInterval - if (patrolPlan.getWeekRegister() != null && !patrolPlan.getWeekRegister().equals("")) { - Calendar calendar = Calendar.getInstance(); - String day = String.valueOf(calendar.get(Calendar.DAY_OF_WEEK)); -// System.out.println("今日星期几:" + day); - //下发寄存器数组 - String[] time = patrolPlan.getWeekRegister().split(","); - for (String s : time) { - if (Integer.parseInt(day) < Integer.parseInt(s)) { - patrolPlan.setPlanIssuanceDate(CommUtil.differenceDate((Integer.parseInt(s) - Integer.parseInt(day)))); - break; - } else { - patrolPlan.setPlanIssuanceDate(CommUtil.subplus((CommUtil.differenceDate((Integer.parseInt(time[0]) - Integer.parseInt(day)))) + "", "7", "day")); - } - } - } - } - if (patrolPlan.getReleaseModal().equals("monthly")) {//间隔 月 monthInterval - if (patrolPlan.getMonthRegister() != null && !patrolPlan.getMonthRegister().equals("")) { - int now_dt = Integer.parseInt(CommUtil.nowDate().substring(8, 10)); - //下发寄存器数组 - String[] time = patrolPlan.getMonthRegister().split(","); - //下次下发时间 - String next_dt = ""; - //0为当月 1为非当月 - String month_st = "1"; - for (String s : time) { - if (now_dt < Integer.parseInt(s)) { - next_dt = s; - month_st = "0"; - break; - } - } - //monthInterval yearInterval - if (month_st.equals("0")) {//当月 -// System.out.println(patrolPlan.getName() + "======(当月)next_dt======" + CommUtil.nowDate().substring(0, 7) + "-" + next_dt); - String dt = CommUtil.nowDate().substring(0, 7) + "-" + next_dt; - patrolPlan.setPlanIssuanceDate(dt); - } else {//非当月 - String dt = CommUtil.subplus(CommUtil.nowDate().substring(0, 7) + "-" + time[0], patrolPlan.getMonthInterval() + "", "month"); -// System.out.println(patrolPlan.getName() + "======(非当月)next_dt======" + dt); - patrolPlan.setPlanIssuanceDate(dt); - } - } - } - if (patrolPlan.getReleaseModal().equals("yearly")) {//间隔 年 yearInterval - if (patrolPlan.getYearRegister() != null && !patrolPlan.getYearRegister().equals("")) { - int now_month = Integer.parseInt(CommUtil.nowDate().substring(5, 7)); - //下发寄存器数组 - String[] time = patrolPlan.getYearRegister().split(","); - //下次下发时间 - String next_dt = ""; - //0为当年 1为非当年 - String month_st = "1"; - for (String s : time) { - String[] str = s.split("\\."); - if (now_month < Integer.parseInt(str[0])) { - next_dt = s; - month_st = "0"; - break; - } - } - //monthInterval yearInterval - if (month_st.equals("0")) {//当月 -// System.out.println(patrolPlan.getName() + "======(当年)next_dt======" + CommUtil.nowDate().substring(0, 7) + "-" + next_dt); - String dt = CommUtil.nowDate().substring(0, 4) + "-" + next_dt.split("\\.")[0] + "-" + next_dt.split("\\.")[1]; -// System.out.println(dt); - patrolPlan.setPlanIssuanceDate(dt); - } else {//非当月 - String dt = CommUtil.subplus(CommUtil.nowDate().substring(0, 4) + "-" + time[0].split("\\.")[0] + "-" + time[0].split("\\.")[1], patrolPlan.getYearInterval() + "", "year"); -// System.out.println(patrolPlan.getName() + "======(非当年)next_dt======" + dt); -// System.out.println(dt); - patrolPlan.setPlanIssuanceDate(dt); - } - } - } - patrolPlanService.updateSimple(patrolPlan); - } - } - -} diff --git a/src/com/sipai/quartz/job/PatrolRecordAutoCheck.java b/src/com/sipai/quartz/job/PatrolRecordAutoCheck.java deleted file mode 100644 index db08b7ee..00000000 --- a/src/com/sipai/quartz/job/PatrolRecordAutoCheck.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.base.Result; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.work.Scheduling; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.timeefficiency.PatrolRecordPatrolRouteService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.work.SchedulingService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.springframework.web.servlet.ModelAndView; - -import java.util.List; - -/** - * 巡检记录每天自动 检查一遍前一天的记录 - * 1.任务下未提交的 自动设置状态 - * 2.任务下未提交的 自动根据排班的赋值人员 - * 3.检查打卡点的数量 - */ -public class PatrolRecordAutoCheck { - - PatrolRecordService patrolRecordService = (PatrolRecordService) SpringContextUtil.getBean("patrolRecordService"); - PatrolRecordPatrolRouteService patrolRecordPatrolRouteService = (PatrolRecordPatrolRouteService) SpringContextUtil.getBean("patrolRecordPatrolRouteService"); - SchedulingService schedulingService = (SchedulingService) SpringContextUtil.getBean("schedulingService"); - GroupDetailService groupDetailService = (GroupDetailService) SpringContextUtil.getBean("groupDetailService"); - - public void run(ScheduleJob scheduleJob) { - System.out.println("开始:" + scheduleJob.getJobName() + "------" + CommUtil.nowDate()); - String sdt = CommUtil.differenceDate(-1); - String sql = "where 1=1 and datediff(day,'" + sdt + "',start_time)=0"; - List list1 = patrolRecordService.selectListByWhere(sql); - int num = 0; - for (PatrolRecord patrolRecord1 : list1) { - //全部 - List list2 = patrolRecordPatrolRouteService.selectSimpleListByWhere("where patrol_record_id = '" + patrolRecord1.getId() + "'"); - //完成 - List list3 = patrolRecordPatrolRouteService.selectSimpleListByWhere("where patrol_record_id = '" + patrolRecord1.getId() + "' and status = '" + PatrolRecord.Status_Finish + "'"); - - if (list2 != null && list2.size() > 0) { - patrolRecord1.setPointNumAll(list2.size()); - } else { - patrolRecord1.setPointNumAll(0); - } - - if (list3 != null && list3.size() > 0) { - patrolRecord1.setPointNumFinish(list3.size()); - } else { - patrolRecord1.setPointNumFinish(0); - } - - if (patrolRecord1.getWorkerId() == null || patrolRecord1.getWorkerId().equals("")) { - String dt = patrolRecord1.getStartTime(); - String orderstr = " order by stdt asc "; - String wherestr = " where bizid='" + patrolRecord1.getUnitId() + "' and (stdt<='" + dt + "' and eddt>='" + dt + "') "; - List list = this.schedulingService.selectCalenderListByWhere(wherestr + orderstr); - if (list != null && list.size() > 0) { - GroupDetail groupDetail = groupDetailService.selectById(list.get(0).getGroupdetailId()); - if (groupDetail != null) { - patrolRecord1.setWorkerId(groupDetail.getLeader()); - } - } - } - - //自动将未提交的巡检提交 - if (patrolRecord1.getStatus().equals(PatrolRecord.Status_Issue) || patrolRecord1.getStatus().equals(PatrolRecord.Status_Start)) { - //没有关联打卡点位的任务(总打卡点为0) - if (patrolRecord1.getPointNumAll() == 0) { - //状态不变还是未完成 - patrolRecord1.setStatus(patrolRecord1.Status_Issue); - } else { - //关联的打卡点位一个没打 - if (patrolRecord1.getPointNumFinish() == 0) { - //状态不变还是未完成 - patrolRecord1.setStatus(patrolRecord1.Status_Issue); - } else { - if (patrolRecord1.getPointNumAll() == patrolRecord1.getPointNumFinish()) { - patrolRecord1.setStatus(PatrolRecord.Status_Finish); - } else { - patrolRecord1.setStatus(PatrolRecord.Status_PartFinish); - } - } - } - patrolRecord1.setWorkResult("系统自动提交"); - patrolRecord1.setActFinishTime(CommUtil.nowDate()); - } - - int res = patrolRecordService.update(patrolRecord1); - num += res; - } - System.out.println("结束:" + scheduleJob.getJobName() + "------" + CommUtil.nowDate() + "------" + num); - } -} - diff --git a/src/com/sipai/quartz/job/PatrolRecordCollectionJob.java b/src/com/sipai/quartz/job/PatrolRecordCollectionJob.java deleted file mode 100644 index 5980d691..00000000 --- a/src/com/sipai/quartz/job/PatrolRecordCollectionJob.java +++ /dev/null @@ -1,116 +0,0 @@ -//package com.sipai.quartz.job; -// -//import java.text.ParseException; -//import java.util.List; -// -//import javax.annotation.Resource; -// -//import com.sipai.entity.timeefficiency.PatrolRecord; -//import com.sipai.entity.timeefficiency.PatrolRecordCollection; -//import com.sipai.entity.timeefficiency.PatrolType; -//import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -//import com.sipai.entity.user.Company; -//import com.sipai.service.timeefficiency.PatrolRecordCollectionService; -//import com.sipai.service.timeefficiency.PatrolRecordService; -//import com.sipai.service.user.UnitService; -//import com.sipai.tools.CommUtil; -// -//public class PatrolRecordCollectionJob { -// @Resource -// private UnitService unitService; -// @Resource -// private PatrolRecordService patrolRecordService; -// @Resource -// private PatrolRecordCollectionService patrolRecordCollectionService; -// -// public synchronized void execute() throws ParseException{ -// //System.out.println(CommUtil.nowDate()+"==========定时任务开始==========="); -// String whereStr="where type='B'"; -// List companyList=unitService.getCompaniesByWhere(whereStr); -// for(Company company:companyList){ -// String prcWhereStr="where biz_id='"+company.getId()+"'"; -// List prcList=patrolRecordCollectionService.selectListByWhere(prcWhereStr); -// if(prcList.size()>0 && !prcList.isEmpty() && null!=prcList){ -// String prWhereStr = " where biz_id = '"+company.getId()+"' and type = '"+PatrolType.Product.getId()+"' and Convert(varchar,start_time,120) like '" + CommUtil.nowDate().substring(0,7)+"%'"; -// List prList=patrolRecordService.selectListByWhere(prWhereStr); -// -// if(prList.size()>0 && !prList.isEmpty() && null!=prList){ -// int tempNum = 0;//临时 -// int issuedNum = 0;//下发 -// int finishedNum = 0;//完成 -// for(PatrolRecord patrolRecord : prList){ -// if(patrolRecord.getStatus().equals(PatrolRecord.Status_Issue)){ -// //未巡检数量 -// issuedNum++; -// }else if(patrolRecord.getStatus().equals(PatrolRecord.Status_Finish)){ -// //完成数量 -// finishedNum++; -// } -// if(patrolRecord.getPatrolModelId().equals(TimeEfficiencyCommStr.PatrolModel_TempTask)){ -// //临时任务数量 -// tempNum++; -// } -// } -// -// Double finishedNumDouble=Double.valueOf(finishedNum+""); -// Double finishedRate=finishedNumDouble/prList.size(); -// -// prcList.get(0).setUpsdt(CommUtil.nowDate()); -// -// prcList.get(0).setTotalNum(prList.size()); -// prcList.get(0).setCommNum(prList.size()-tempNum); -// prcList.get(0).setIssuedNum(issuedNum); -// prcList.get(0).setFinishedNum(finishedNum); -// prcList.get(0).setTempNum(tempNum); -// prcList.get(0).setFinishedRate(finishedRate); -// -// patrolRecordCollectionService.update(prcList.get(0)); -// } -// -// -// }else{ -// String prWhereStr = " where biz_id = '"+company.getId()+"' and type = '"+PatrolType.Product.getId()+"' and Convert(varchar,start_time,120) like '" + CommUtil.nowDate().substring(0,7)+"%'"; -// List prList=patrolRecordService.selectListByWhere(prWhereStr); -// -// if(prList.size()>0 && !prList.isEmpty() && null!=prList){ -// int tempNum = 0;//临时 -// int issuedNum = 0;//下发 -// int finishedNum = 0;//完成 -// for(PatrolRecord patrolRecord : prList){ -// if(patrolRecord.getStatus().equals(PatrolRecord.Status_Issue)){ -// //未巡检数量 -// issuedNum++; -// }else if(patrolRecord.getStatus().equals(PatrolRecord.Status_Finish)){ -// //完成数量 -// finishedNum++; -// } -// if(patrolRecord.getPatrolModelId().equals(TimeEfficiencyCommStr.PatrolModel_TempTask)){ -// //临时任务数量 -// tempNum++; -// } -// } -// -// Double finishedNumDouble=Double.valueOf(finishedNum+""); -// Double finishedRate=finishedNumDouble/prList.size(); -// -// PatrolRecordCollection prc= new PatrolRecordCollection(); -// -// prc.setId(CommUtil.getUUID()); -// prc.setInsdt(CommUtil.nowDate()); -// prc.setUpsdt(CommUtil.nowDate()); -// prc.setTotalNum(prList.size()); -// prc.setCommNum(prList.size()-tempNum); -// prc.setBizId(company.getId()); -// prc.setIssuedNum(issuedNum); -// prc.setFinishedNum(finishedNum); -// prc.setTempNum(tempNum); -// prc.setFinishedRate(finishedRate); -// -// patrolRecordCollectionService.save(prc); -// } -// -// } -// } -// //System.out.println(CommUtil.nowDate()+"==========定时任务结束==========="); -// } -//} diff --git a/src/com/sipai/quartz/job/PatrolRecordTimeoutAlarm.java b/src/com/sipai/quartz/job/PatrolRecordTimeoutAlarm.java deleted file mode 100644 index 484463ad..00000000 --- a/src/com/sipai/quartz/job/PatrolRecordTimeoutAlarm.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.service.hqconfig.HQAlarmRecordService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.util.List; - -/** - * 巡检超时报警 - */ -public class PatrolRecordTimeoutAlarm { - - PatrolRecordService patrolRecordService = (PatrolRecordService) SpringContextUtil.getBean("patrolRecordService"); - HQAlarmRecordService hqAlarmRecordService = (HQAlarmRecordService) SpringContextUtil.getBean("hqAlarmRecordService"); - - public void fun1(ScheduleJob scheduleJob) { - //报警 - //String sql = "where DateDiff(dd,end_time,getdate())=0 and '" + CommUtil.nowDate() + "'>end_time and status!='3' and status!='4'"; - String sql = "where '" + CommUtil.nowDate() + "'>end_time and status!='3' and status!='4'"; - List list1 = patrolRecordService.selectListByWhere(sql); - for (PatrolRecord patrolRecord1 : list1) { - List list = hqAlarmRecordService.selectListByWhere("where targetid = '" + patrolRecord1.getId() + "'"); - if (list == null || list.size() == 0) { - HQAlarmRecord alarmRecord = new HQAlarmRecord(); - alarmRecord.setId(CommUtil.getUUID()); - alarmRecord.setInsdt(CommUtil.nowDate()); - alarmRecord.setAreaid(""); - alarmRecord.setAlarmtypeid("18");//只能写死id 无法查询 - alarmRecord.setRiskLevel("D"); - alarmRecord.setUnitId(patrolRecord1.getUnitId()); - alarmRecord.setTargetid(patrolRecord1.getId()); - alarmRecord.setState("1"); - alarmRecord.setName("[任务超时报警]" + patrolRecord1.getName()); - this.hqAlarmRecordService.save(alarmRecord); - } else { -// System.out.println("重复报警,已过滤" + patrolRecord1.getName()); - } - } - //报警恢复 - String sql2 = "where (DateDiff(dd,end_time,getdate())=0 or DateDiff(dd,end_time,getdate())=1) and (status='3' or status='4')"; - List list2 = patrolRecordService.selectListByWhere(sql2); - for (PatrolRecord patrolRecord1 : list2) { - System.out.println("where targetid = '" + patrolRecord1.getId() + "'"); - List list = hqAlarmRecordService.selectListByWhere("where targetid = '" + patrolRecord1.getId() + "'"); - if (list != null && list.size() > 0) { - HQAlarmRecord alarmRecord = list.get(0); - alarmRecord.setState("2"); - alarmRecord.setEliminatedt(CommUtil.nowDate()); - this.hqAlarmRecordService.update(alarmRecord); - } else { -// System.out.println("重复报警,已过滤" + patrolRecord1.getName()); - } - } - } -} - diff --git a/src/com/sipai/quartz/job/PatrolRecordViolationRecordJob.java b/src/com/sipai/quartz/job/PatrolRecordViolationRecordJob.java deleted file mode 100644 index e64d3467..00000000 --- a/src/com/sipai/quartz/job/PatrolRecordViolationRecordJob.java +++ /dev/null @@ -1,201 +0,0 @@ -/*package com.sipai.quartz.job; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolRecordViolationRecord; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Dept; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.timeefficiency.PatrolRecordViolationRecordService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommUtil; - - -public class PatrolRecordViolationRecordJob { - - @Resource - private UnitService unitService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private PatrolRecordViolationRecordService patrolRecordViolationRecordService; - - public synchronized void execute() throws ParseException{ - System.out.println("巡检违规记录定时任务开启======================================"); - //当前时间 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - Date date=new Date(); - String nowDate=sdf.format(date); - - - //获取前一天的日期 - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.add(Calendar.DATE, -1); - String yesterDay=sdf.format(calendar.getTime()) ; - String endTime=""; - String actFinishTime=""; - int resultNum=0; - String where=" where 1=1 "; - - - - - List prList=patrolRecordService.selectListByWhere(where); - if(!prList.isEmpty() && prList.size()>0 && null!=prList){ - for(PatrolRecord pr:prList){ - actFinishTime = pr.getActFinishTime(); - endTime = pr.getEndTime(); - if(!"".equals(actFinishTime) && null!=actFinishTime){ - long actFinishTimeLong=sdfTimeMS(actFinishTime); - long endTimeLong=sdfTimeMS(endTime); - boolean mark = actFinishTimeLong > endTimeLong ? true:false; - if(true==mark){ - PatrolRecordViolationRecord prvrRes=patrolRecordViolationRecordService.selectById(pr.getId()); - if("".equals(prvrRes) || null==prvrRes){ - PatrolRecordViolationRecord prvr=new PatrolRecordViolationRecord(); - prvr.setId(pr.getId()); - prvr.setInsdt(CommUtil.nowDate()); - //if(!"".equals(cu.getId()) && null!= cu.getId()) - prvr.setInsuser(pr.getInsuser()); - - if(!"".equals(pr.getBizId()) && null!= pr.getBizId()) - prvr.setBizId(pr.getBizId()); - - if(!"".equals(pr.getPatrolAreaId()) && null!= pr.getPatrolAreaId()) - prvr.setPatrolAreaId(pr.getPatrolAreaId()); - - if(!"".equals(pr.getName()) && null!= pr.getName()) - prvr.setName(pr.getName()); - - if(!"".equals(pr.getContent()) && null!= pr.getContent()) - prvr.setContent(pr.getContent()); - - if(!"".equals(pr.getStartTime()) && null!= pr.getStartTime()) - prvr.setStartTime(pr.getStartTime()); - - if(!"".equals(pr.getEndTime()) && null!= pr.getEndTime()) - prvr.setEndTime(pr.getEndTime()); - - if(!"".equals(pr.getActFinishTime()) && null!= pr.getActFinishTime()) - prvr.setActFinishTime(pr.getActFinishTime()); - - if(!"".equals(pr.getPatrolPlanId()) && null!= pr.getPatrolPlanId()) - prvr.setPatrolPlanId(pr.getPatrolPlanId()); - - if(!"".equals(pr.getWorkerId()) && null!= pr.getWorkerId()) - prvr.setWorkerId(pr.getWorkerId()); - - if(!"".equals(pr.getWorkResult()) && null!= pr.getWorkResult()) - prvr.setWorkResult(pr.getWorkResult()); - - if(!"".equals(pr.getStatus()) && null!= pr.getStatus()) - prvr.setStatus(pr.getStatus()); - - if(!"".equals(pr.getType()) && null!= pr.getType()) - prvr.setType(pr.getType()); - - if(!"".equals(pr.getPatrolModelId()) && null!= pr.getPatrolModelId()) - prvr.setPatrolModelId(pr.getPatrolModelId()); - - if(!"".equals(pr.getColor()) && null!= pr.getColor()) - prvr.setColor(pr.getColor()); - - prvr.setReason(TimeEfficiencyCommStr.REASON); - - prvr.setCycle(TimeEfficiencyCommStr.CYCLE); - //从当前数据库来看tb_user只与tb_company,tb_dept - List depts = unitService.getDeptByPid(pr.getBizId()); - if(!depts.isEmpty() && depts.size()>0) - prvr.setDeptId(depts.get(0).getId()); - resultNum=patrolRecordViolationRecordService.save(prvr); - } - } - }else{ - long nowDateTimeLong=sdfTimeMS(nowDate); - long endTimeLong=sdfTimeMS(endTime); - boolean mark = nowDateTimeLong > endTimeLong ? true:false; - if(true==mark){ - PatrolRecordViolationRecord prvrRes=patrolRecordViolationRecordService.selectById(pr.getId()); - if("".equals(prvrRes) || null==prvrRes){ - PatrolRecordViolationRecord prvr=new PatrolRecordViolationRecord(); - prvr.setId(pr.getId()); - prvr.setInsdt(CommUtil.nowDate()); - //if(!"".equals(cu.getId()) && null!= cu.getId()) - prvr.setInsuser(pr.getInsuser()); - - if(!"".equals(pr.getBizId()) && null!= pr.getBizId()) - prvr.setBizId(pr.getBizId()); - - if(!"".equals(pr.getPatrolAreaId()) && null!= pr.getPatrolAreaId()) - prvr.setPatrolAreaId(pr.getPatrolAreaId()); - - if(!"".equals(pr.getName()) && null!= pr.getName()) - prvr.setName(pr.getName()); - - if(!"".equals(pr.getContent()) && null!= pr.getContent()) - prvr.setContent(pr.getContent()); - - if(!"".equals(pr.getStartTime()) && null!= pr.getStartTime()) - prvr.setStartTime(pr.getStartTime()); - - if(!"".equals(pr.getEndTime()) && null!= pr.getEndTime()) - prvr.setEndTime(pr.getEndTime()); - - if(!"".equals(pr.getActFinishTime()) && null!= pr.getActFinishTime()) - prvr.setActFinishTime(pr.getActFinishTime()); - - if(!"".equals(pr.getPatrolPlanId()) && null!= pr.getPatrolPlanId()) - prvr.setPatrolPlanId(pr.getPatrolPlanId()); - - if(!"".equals(pr.getWorkerId()) && null!= pr.getWorkerId()) - prvr.setWorkerId(pr.getWorkerId()); - - if(!"".equals(pr.getWorkResult()) && null!= pr.getWorkResult()) - prvr.setWorkResult(pr.getWorkResult()); - - if(!"".equals(pr.getStatus()) && null!= pr.getStatus()) - prvr.setStatus(pr.getStatus()); - - if(!"".equals(pr.getType()) && null!= pr.getType()) - prvr.setType(pr.getType()); - - if(!"".equals(pr.getPatrolModelId()) && null!= pr.getPatrolModelId()) - prvr.setPatrolModelId(pr.getPatrolModelId()); - - if(!"".equals(pr.getColor()) && null!= pr.getColor()) - prvr.setColor(pr.getColor()); - - prvr.setReason(TimeEfficiencyCommStr.REASON); - - prvr.setCycle(TimeEfficiencyCommStr.CYCLE); - //从当前数据库来看tb_user只与tb_company,tb_dept - List depts = unitService.getDeptByPid(pr.getBizId()); - if(!depts.isEmpty() && depts.size()>0) - prvr.setDeptId(depts.get(0).getId()); - resultNum=patrolRecordViolationRecordService.save(prvr); - } - } - } - - } - - } - System.out.println("巡检违规记录定时任务关闭======================================"); - } - - public long sdfTimeMS(String date) throws ParseException{ - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");//24小时制 - long time = simpleDateFormat.parse(date).getTime(); - return time; - } - -} -*/ \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ProductionIndexPlanJob.java b/src/com/sipai/quartz/job/ProductionIndexPlanJob.java deleted file mode 100644 index f64f5ae9..00000000 --- a/src/com/sipai/quartz/job/ProductionIndexPlanJob.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.sipai.quartz.job; - -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; - -import com.sipai.entity.enums.DayValueEnum; -import com.sipai.entity.work.ProductionIndexData; -import com.sipai.service.work.ProductionIndexDataService; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.springframework.stereotype.Component; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.enums.DateType; -import com.sipai.entity.jsyw.JsywCompany; -import com.sipai.entity.jsyw.JsywPoint; -import com.sipai.entity.report.RptDeptSet; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexPlanNameData; -import com.sipai.service.jsyw.JsywCompanyService; -import com.sipai.service.jsyw.JsywPointService; -import com.sipai.service.msg.MsgService; -import com.sipai.service.report.RptDeptSetService; -import com.sipai.service.report.RptDeptSetUserService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserJobService; -import com.sipai.service.work.ProductionIndexPlanNameConfigureService; -import com.sipai.service.work.ProductionIndexPlanNameDataService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - - -public class ProductionIndexPlanJob { - @Resource - private ProductionIndexPlanNameDataService productionIndexPlanNameDataService; - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ProductionIndexDataService productionIndexDataService; - - public void execute() { - String nowDate = CommUtil.nowDate().substring(0, 10); - System.out.println(CommUtil.nowDate()+":生产指标控制定时任务"); - - List planNameDatas = this.productionIndexPlanNameDataService.selectListByWhere("where type = 'Month' and DATEDIFF(month, planDate, '" + nowDate + "')=0"); - int i = 0; - for (ProductionIndexPlanNameData productionIndexPlanNameData : planNameDatas) { - if (productionIndexPlanNameData != null) { - String plandate = productionIndexPlanNameData.getPlandate(); - // 计划值 - ProductionIndexPlanNameConfigure configure = this.productionIndexPlanNameConfigureService.selectById(productionIndexPlanNameData.getConfigureid()); - if (configure != null) { - if (StringUtils.isNotBlank(configure.getMpidPlan())) { - MPoint mPoint = this.mPointService.selectById(configure.getMpidPlan()); - BigDecimal value = new BigDecimal(productionIndexPlanNameData.getValue().toString()); - // 均值 - if (DayValueEnum.AVG_VALUE.getId().equals(configure.getDayValue())) { - try { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Date parseDate = simpleDateFormat.parse(plandate); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(parseDate); - int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - Double avg = productionIndexPlanNameData.getValue() / actualMaximum; - String format = new DecimalFormat("#.00").format(avg); - if (avg < 1) { - format = "0" + format; - } - value = new BigDecimal(format); - } catch (Exception e) { - System.out.println("抛出:"+e.toString()); - } - } - mPoint.setParmvalue(value); - mPoint.setMeasuredt(nowDate); - this.mPointService.update2(configure.getUnitId(), mPoint); - - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(nowDate); - mPointHistory.setParmvalue(mPoint.getParmvalue()); - mPointHistory.setTbName("TB_MP_" + configure.getMpidPlan()); - this.mPointHistoryService.save(configure.getUnitId(), mPointHistory); -// System.out.println(i++); - } - - if (StringUtils.isNotBlank(configure.getMpid())) { - // 实际值 - ProductionIndexData productionIndexData = new ProductionIndexData(); - productionIndexData.setId(CommUtil.getUUID()); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.DATE, -1); - productionIndexData.setPlandate(simpleDateFormat.format(cal.getTime())); - // 默认为0 - productionIndexData.setValue(0D); - productionIndexData.setConfigureid(configure.getId()); - productionIndexData.setUnitId(configure.getUnitId()); - productionIndexData.setType(ProductionIndexPlanNameData.Type_Day); - // 昨天的数据 最新的一条 - List mPointHistories = mPointHistoryService.selectTopNumListByTableAWhere(configure.getUnitId(), "top 1", "TB_MP_" + configure.getMpid(), "where DATEDIFF(dd,MeasureDT,GETDATE()-1)=0 order by MeasureDT desc"); - if (mPointHistories != null && mPointHistories.size() > 0) { - MPointHistory mPointHistory1 = mPointHistories.get(0); - BigDecimal parmvalue = mPointHistory1.getParmvalue(); - productionIndexData.setValue(Double.parseDouble(parmvalue.toString())); - } - productionIndexDataService.save(productionIndexData); - } - } - } - - } - } -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/QWeatherJob.java b/src/com/sipai/quartz/job/QWeatherJob.java deleted file mode 100644 index f11513a3..00000000 --- a/src/com/sipai/quartz/job/QWeatherJob.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.quartz.job; - -import com.google.gson.JsonObject; -import com.sipai.entity.enums.WeatherTypeEnum; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.WeatherNew; -import com.sipai.service.company.CompanyService; -import com.sipai.service.work.WeatherNewService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import javax.annotation.Resource; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.List; - -/** - * 定时获取”和风天气“接口数据 - * 使用免费key,有请求限制 - * @author NJP - */ -public class QWeatherJob { - @Autowired - private WeatherNewService weatherNewService; - @Resource - private CompanyService companyService; - - public void excute() throws IOException{ - System.out.println("执行和风天气方法"); - List companies = companyService.selectListByWhere - ("where city is not null and city!='' and [active]='1' order by name"); - if(companies != null && companies.size()>0){ - for(Company company : companies){ - String json = CommUtil.getQWeatherHTTP(company.getCity()); - - if(json!=null && !json.isEmpty()){ - JSONObject jsonObject = JSONObject.fromObject(json); - WeatherNew weatherNew = new WeatherNew(); - weatherNew.setBizid(company.getId()); - weatherNew.setCity(company.getCity()); - weatherNew.setId(CommUtil.getUUID()); - weatherNew.setTime(CommUtil.nowDate()); - weatherNew.setTemp(jsonObject.getString("temp").toString()); - weatherNew.setWind(jsonObject.getString("windDir").toString()); - weatherNew.setWindPower(jsonObject.getString("windScale").toString()); - weatherNew.setWeather(jsonObject.getString("weather").toString()); - weatherNew.setHumidity(jsonObject.getString("humidity").toString()); - weatherNew.setPrecip(jsonObject.getString("precip").toString()); - weatherNew.setFeelslike(jsonObject.getString("feelsLike").toString()); - weatherNew.setPressure(jsonObject.getString("pressure").toString()); - weatherNew.setVis(jsonObject.getString("vis").toString()); - weatherNew.setWindspeed(jsonObject.getString("windSpeed").toString()); - weatherNew.setType(WeatherTypeEnum.WEATHER_TYPE_REALTIME.getId()); - int res = this.weatherNewService.save(weatherNew); - } - - - // 7天未来天气 - String tJson = CommUtil.getQWeatherHTTPByURL(company.getCity(), "https://devapi.qweather.com/v7/weather/7d?"); - if (StringUtils.isNotBlank(tJson)) { - JSONObject jsonObject = JSONObject.fromObject(tJson); - // 获取列表 - List daily = JSONArray.fromObject(jsonObject.get("daily")); - if (daily != null) { - for (int i = 0; i< daily.size(); i++) { - // 天气对象 - WeatherNew weatherNewone = new WeatherNew(); - // 厂id - weatherNewone.setBizid(company.getId()); - // 城市 - weatherNewone.setCity(company.getCity()); - // 预报日期 - weatherNewone.setTime(daily.get(i).get("fxDate").toString()); - // 天气 - weatherNewone.setWeather(daily.get(i).get("textDay").toString()); - // 风向 白天风向 - weatherNewone.setWind(daily.get(i).get("windDirDay").toString()); - // 湿度 - weatherNewone.setHumidity(daily.get(i).get("humidity").toString()); - // 最高温度 - weatherNewone.setHighTemp(daily.get(i).get("tempMax").toString() + "℃"); - // 最低温度 - weatherNewone.setLowTemp(daily.get(i).get("tempMin").toString() + "℃"); - // 风力 白天风力 - weatherNewone.setWindPower(daily.get(i).get("windScaleDay").toString() + "级"); - // 降水量 mm - weatherNewone.setPrecip(daily.get(i).get("precip").toString() + "mm"); - // 大气压强 百帕 hPa - weatherNewone.setPressure(daily.get(i).get("pressure").toString() + "hPa"); - // 能见度公里 - weatherNewone.setVis(daily.get(i).get("vis").toString() + "公里"); - // 风速 公里每小时 - weatherNewone.setWindspeed(daily.get(i).get("windSpeedDay").toString() + "/h"); - // 类型 - weatherNewone.setType(WeatherTypeEnum.WEATHER_TYPE_FUTURE.getId()); - List weatherNews = weatherNewService.selectListByWhere("where time = '" + weatherNewone.getTime() + "' and bizid = '" + weatherNewone.getBizid() + "'"); - if (weatherNewone != null && weatherNews.size() > 0) { - this.weatherNewService.updateByTimeSelective(weatherNewone); - } else { - weatherNewone.setId(CommUtil.getUUID()); - this.weatherNewService.save(weatherNewone); - } - - } - } - } - } - } - } - -} diff --git a/src/com/sipai/quartz/job/QuartzJobFactory.java b/src/com/sipai/quartz/job/QuartzJobFactory.java deleted file mode 100644 index 00a5b16f..00000000 --- a/src/com/sipai/quartz/job/QuartzJobFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.quartz.job; - -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.tools.TaskUtils; - -public class QuartzJobFactory implements Job{ - public Logger log = LoggerFactory.getLogger(this.getClass()); - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { -// System.out.println("定时任务运行中..."); - ScheduleJob scheduleJob = (ScheduleJob) jobExecutionContext.getMergedJobDataMap().get("scheduleJob"); - TaskUtils.invokeMethod(scheduleJob); - } - -} diff --git a/src/com/sipai/quartz/job/ReportJob.java b/src/com/sipai/quartz/job/ReportJob.java deleted file mode 100644 index 95b26af9..00000000 --- a/src/com/sipai/quartz/job/ReportJob.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.controller.report.RptCreateController; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.schedule.ScheduleJobDetail; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.schedule.ScheduleJobDetailService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.xmlpull.v1.XmlPullParserException; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.List; - -/** - * 报表定时生成 - */ -public class ReportJob { - - ScheduleJobDetailService scheduleJobDetailService = (ScheduleJobDetailService) SpringContextUtil.getBean("scheduleJobDetailService"); - RptCreateService rptCreateService = (RptCreateService) SpringContextUtil.getBean("rptCreateService"); - - /** - * 自动生成前一天的报表 - * @param scheduleJob - * @throws XmlPullParserException - * @throws NoSuchAlgorithmException - * @throws InvalidKeyException - * @throws IOException - */ - public void run1(ScheduleJob scheduleJob) throws XmlPullParserException, NoSuchAlgorithmException, InvalidKeyException, IOException { - List scheduleJobDetails = this.scheduleJobDetailService.selectListByWhere("where pid = '" + scheduleJob.getId() + "'"); - if (scheduleJobDetails != null && scheduleJobDetails.size() > 0) { - for (int i = 0; i < scheduleJobDetails.size(); i++) { - String rptdt = CommUtil.differenceDate(-1); - rptCreateService.save4Job(scheduleJobDetails.get(i).getTaskid(), rptdt); - } - } - } - - /** - * 自动生成当天的报表 - * @param scheduleJob - * @throws XmlPullParserException - * @throws NoSuchAlgorithmException - * @throws InvalidKeyException - * @throws IOException - */ - public void run2(ScheduleJob scheduleJob) throws XmlPullParserException, NoSuchAlgorithmException, InvalidKeyException, IOException { - List scheduleJobDetails = this.scheduleJobDetailService.selectListByWhere("where pid = '" + scheduleJob.getId() + "'"); - if (scheduleJobDetails != null && scheduleJobDetails.size() > 0) { - for (int i = 0; i < scheduleJobDetails.size(); i++) { - String rptdt = CommUtil.differenceDate(0); - rptCreateService.save4Job(scheduleJobDetails.get(i).getTaskid(), rptdt); - } - } - } - -} diff --git a/src/com/sipai/quartz/job/ReportMessageJob.java b/src/com/sipai/quartz/job/ReportMessageJob.java deleted file mode 100644 index f3aeb366..00000000 --- a/src/com/sipai/quartz/job/ReportMessageJob.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.enums.DateType; -import com.sipai.entity.report.RptDeptSet; -import com.sipai.entity.report.RptDeptSetUser; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.UserJob; -import com.sipai.service.msg.MsgService; -import com.sipai.service.report.RptDeptSetService; -import com.sipai.service.report.RptDeptSetUserService; -import com.sipai.service.schedule.ScheduleJobDetailService; -import com.sipai.service.user.UserJobService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Component; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -//@Component -public class ReportMessageJob { -// @Resource -// private UserJobService userJobService; -// @Resource -// private RptDeptSetService rptDeptSetService; -// @Resource -// private RptDeptSetUserService rptDeptSetUserService; -// @Resource -// private MsgService msgService; -// @Reference(version= CommString.DUBBO_VERSION_OPERATION,check=false) -// private GroupManageService groupManageService; -// @Reference(version= CommString.DUBBO_VERSION_OPERATION,check=false) -// private SchedulingService schedulingService; -// ScheduleJobDetailService scheduleJobDetailService = (ScheduleJobDetailService) SpringContextUtil.getBean("scheduleJobDetailService"); - UserJobService userJobService = (UserJobService) SpringContextUtil.getBean("userJobService"); - RptDeptSetService rptDeptSetService = (RptDeptSetService) SpringContextUtil.getBean("rptDeptSetServiceImpl"); - RptDeptSetUserService rptDeptSetUserService = (RptDeptSetUserService) SpringContextUtil.getBean("rptDeptSetUserServiceImpl"); - MsgService msgService = (MsgService) SpringContextUtil.getBean("msgService"); - public void run(ScheduleJob scheduleJob) throws ParseException { - System.out.println("11111111111111"); - DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowDateString = format.format(new Date()); -// System.out.println(nowDateString); - - List rptDeptSetsHour = this.rptDeptSetService.selectListByWhere("where date_type ='" + DateType.Hour.getId() + "'"); - List rptDeptSetsDay = this.rptDeptSetService.selectListByWhere("where date_type ='" + DateType.Day.getId() + "'"); - - for (RptDeptSet rptDeptSet : rptDeptSetsHour) {//每小时 - if (rptDeptSet.getRemindTime() != null && !rptDeptSet.getRemindTime().equals("")) { - String[] timeStringsOld = rptDeptSet.getRemindTime().split(","); - HashSet timeStrings = new HashSet<>(Arrays.asList(timeStringsOld));//去重 - for (String timeString : timeStrings) { - if (nowDateString.substring(11, 16).equals(timeString)) { - //午时已到! - String content = "您的数据填报:" + rptDeptSet.getName() + "已到填报时间,请尽快填报!"; - String auditUserStr = this.getAuditUserStr(rptDeptSet); - this.sendMessage(rptDeptSet.getMessageType(), content, auditUserStr); - - } - } - } - } - - if (nowDateString.substring(11,16).equals("08:00")){ - for (RptDeptSet rptDeptSet : rptDeptSetsDay) {//每天 - if (rptDeptSet.getRemindTime() != null && !rptDeptSet.getRemindTime().equals("")) { - String[] timeStringsOld = rptDeptSet.getRemindTime().split(","); - HashSet timeStrings = new HashSet<>(Arrays.asList(timeStringsOld));//去重 - for (String timeString : timeStrings) { - if (nowDateString.substring(8, 10).equals(timeString)) { - //午时已到! - String content = "您的数据填报:" + rptDeptSet.getName() + "已到填报时间,请尽快填报!"; - String auditUserStr = this.getAuditUserStr(rptDeptSet); - this.sendMessage(rptDeptSet.getMessageType(), content, auditUserStr); - } - } - } - } - } - System.out.println("over"); - } - - private String getAuditUserStr(RptDeptSet rptDeptSet) { - String auditUserStr = ""; - if (rptDeptSet.getRoleType() != null && rptDeptSet.getRoleType() == 0) { - List rptDeptSetUsers = this.rptDeptSetUserService.selectListByWhere("where rptdept_id = '" + rptDeptSet.getId() + "'"); - - for (int i1111 = 0; i1111 < rptDeptSetUsers.size(); i1111++) { - if (i1111 == rptDeptSetUsers.size() - 1) { - auditUserStr += rptDeptSetUsers.get(i1111).getUserId(); - } else { - auditUserStr += rptDeptSetUsers.get(i1111).getUserId() + ","; - } - } - } else if (rptDeptSet.getRoleType() != null && rptDeptSet.getRoleType() == 1) { - List rptDeptSetUsers = this.rptDeptSetUserService.selectListByWhere("where rptdept_id = '" + rptDeptSet.getId() + "'"); - - for (int i1111 = 0; i1111 < rptDeptSetUsers.size(); i1111++) { - List userJobs = userJobService.selectListByWhere(" where jobid = '" + rptDeptSetUsers.get(i1111).getUserId() + "' order by insdt"); - - for (int i2222 = 0; i2222 < userJobs.size(); i2222++) { - if (i1111 == (rptDeptSetUsers.size() - 1) && i2222 == (userJobs.size() - 1)) { - auditUserStr += userJobs.get(i2222).getUserid(); - } else { - auditUserStr += userJobs.get(i2222).getUserid() + ","; - } - } - } - } - return auditUserStr; - } - - private void sendMessage(String messageType, String content, String auditUserStr) { -// switch (messageType) { -// case "REPORT_MSG"://消息 -// this.msgService.insertMsgSend("REPORT_MSG", content, auditUserStr, CommString.ID_Admin, "U"); -// break; -// case "REPORT_SMS"://短信 -// this.msgService.insertMsgSend("REPORT_SMS", content, auditUserStr, CommString.ID_Admin, "U"); -// break; -// case "REPORT"://消息和短信 -// this.msgService.insertMsgSend("REPORT", content, auditUserStr, CommString.ID_Admin, "U"); -// break; -// } - } - -} diff --git a/src/com/sipai/quartz/job/ScadaAlarmJob.java b/src/com/sipai/quartz/job/ScadaAlarmJob.java deleted file mode 100644 index 2c60c2b9..00000000 --- a/src/com/sipai/quartz/job/ScadaAlarmJob.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.sipai.quartz.job; - -import static org.hamcrest.CoreMatchers.nullValue; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.List; -import javax.annotation.Resource; - -import org.apache.poi.hssf.record.chart.BeginRecord; - -import com.alibaba.druid.sql.ast.statement.SQLIfStatement.Else; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.scada.ScadaAlarmDao; -import com.sipai.entity.data.XServer; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ScadaAlarm; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ScadaAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -public class ScadaAlarmJob { - @Resource - private UnitService unitService; - @Resource - private XServerService xServerService; - @Resource - private MPointService mPointService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private ScadaAlarmService scadaAlarmService; - - public void execute() throws ParseException { - String nowTime=CommUtil.nowDate(); - System.out.println(nowTime + "====自动报警开始"); - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - if(xServerList!=null&&xServerList.size()>0){ - for (XServer xServer : xServerList) { - String bizid=xServer.getBizid(); - - List mPoints = this.mPointService.selectListByWhere(bizid," where TriggerAlarm is not null and TriggerAlarm!='0' "); - if(mPoints!=null&&mPoints.size()>0){ - for (MPoint mPoint : mPoints) { - String triggerAlarm=mPoint.getTriggeralarm(); - String mpcode=mPoint.getMpointcode(); - BigDecimal parmvalue=mPoint.getParmvalue(); - //以下值为空 不触发任何报警 - if(parmvalue==null){ - continue; - } - - if(triggerAlarm.equals(ScadaAlarm.AlarmTypeLv1_PRO)){ - BigDecimal alarmmax=mPoint.getAlarmmax(); - BigDecimal halarmmax=mPoint.getHalarmmax(); - BigDecimal alarmmin=mPoint.getAlarmmin(); - BigDecimal lalarmmin=mPoint.getLalarmmin(); - //以下上下限均为空 不触发任何报警 - if(alarmmax==null&&alarmmin==null){ - continue; - } - //以下 值属于正常范围,报警恢复 - if(alarmmin==null&&parmvalue.floatValue()<=alarmmax.floatValue()){ - this.scadaAlarmService.recoverAlarm(bizid,mpcode,nowTime,parmvalue.toPlainString()); - continue; - }else if(alarmmax==null&&parmvalue.floatValue()>=alarmmin.floatValue()){ - this.scadaAlarmService.recoverAlarm(bizid,mpcode,nowTime,parmvalue.toPlainString()); - continue; - }else if(alarmmin!=null&&alarmmax!=null){ - if(parmvalue.floatValue()<=alarmmax.floatValue()&&parmvalue.floatValue()>=alarmmin.floatValue()){ - this.scadaAlarmService.recoverAlarm(bizid,mpcode,nowTime,parmvalue.toPlainString()); - continue; - } - } - - //以下监测到报警 - if(halarmmax!=null){ - if(parmvalue.floatValue()>halarmmax.floatValue()){//上极限 - List scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"于"+scadaAlarm.getInsdt().substring(0, 16)+"发生报警。当前"+nowTime.substring(0,16)+"为上极限报警,报警值:"+parmvalue.toPlainString()+",报警线:"+halarmmax.toPlainString()); - scadaAlarm.setAlarmTypeLv2(ScadaAlarm.AlarmTypeLv2_HH); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生上极限报警。报警值:"+parmvalue.toPlainString()+",报警线:"+halarmmax.toPlainString(); - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,ScadaAlarm.AlarmTypeLv2_HH,describe,processSectionName); - continue; - } - }else if(parmvalue.floatValue()>alarmmax.floatValue()&&parmvalue.floatValue()<=halarmmax.floatValue()){//上限 - List scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"于"+scadaAlarm.getInsdt().substring(0, 16)+"发生报警。当前"+nowTime.substring(0,16)+"为上限报警,报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString()); - scadaAlarm.setAlarmTypeLv2(ScadaAlarm.AlarmTypeLv2_H); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生上限报警。报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString(); - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,ScadaAlarm.AlarmTypeLv2_H,describe,processSectionName); - continue; - } - } - } else { - if(alarmmax!=null){ - if(parmvalue.floatValue()>alarmmax.floatValue()){//上限 - List scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"于"+scadaAlarm.getInsdt().substring(0, 16)+"发生报警。当前"+nowTime.substring(0,16)+"为上限报警,报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString()); - scadaAlarm.setAlarmTypeLv2(ScadaAlarm.AlarmTypeLv2_H); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生上限报警。报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString(); - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,ScadaAlarm.AlarmTypeLv2_H,describe,processSectionName); - continue; - } - } - } - - } - - if(lalarmmin!=null){ - if(parmvalue.floatValue() scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"于"+scadaAlarm.getInsdt().substring(0, 16)+"发生报警。当前"+nowTime.substring(0,16)+"为下极限报警,报警值:"+parmvalue.toPlainString()+",报警线:"+lalarmmin.toPlainString()); - scadaAlarm.setAlarmTypeLv2(ScadaAlarm.AlarmTypeLv2_LL); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生下极限报警。报警值:"+parmvalue.toPlainString()+",报警线:"+lalarmmin.toPlainString(); - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,ScadaAlarm.AlarmTypeLv2_LL,describe,processSectionName); - continue; - } - }else if(parmvalue.floatValue()=lalarmmin.floatValue()){//下限 - List scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"于"+scadaAlarm.getInsdt().substring(0, 16)+"发生报警。当前"+nowTime.substring(0,16)+"为下限报警,报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString()); - scadaAlarm.setAlarmTypeLv2(ScadaAlarm.AlarmTypeLv2_L); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生下限报警。报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString(); - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,ScadaAlarm.AlarmTypeLv2_L,describe,processSectionName); - continue; - } - } - } else { - if(alarmmax!=null){ - if(parmvalue.floatValue() scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"于"+scadaAlarm.getInsdt().substring(0, 16)+"发生报警。当前"+nowTime.substring(0,16)+"为下限报警,报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString()); - scadaAlarm.setAlarmTypeLv2(ScadaAlarm.AlarmTypeLv2_L); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生下限报警。报警值:"+parmvalue.toPlainString()+",报警线:"+alarmmax.toPlainString(); - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,ScadaAlarm.AlarmTypeLv2_L,describe,processSectionName); - continue; - } - } - } - - } - - }else if(triggerAlarm.equals(ScadaAlarm.AlarmTypeLv1_EQU)){ - //以下 值属于正常范围,报警恢复 值为0 时正常 - if(parmvalue.floatValue()==0.0){ - this.scadaAlarmService.recoverAlarm(bizid,mpcode,nowTime,parmvalue.toPlainString()); - continue; - } - - if(parmvalue.floatValue()==1.0){ - List scadaAlarms = this.scadaAlarmService.selectListByWhere(bizid, " where status!='2' and mpoint_code='"+mpcode+"' and (alarm_time between '"+nowTime.substring(0,10)+" 00:00' and '"+nowTime+"') "); - if(scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setOriginalStatus(parmvalue.toPlainString()); - scadaAlarm.setDescribe(mPoint.getParmname()+"从"+scadaAlarm.getInsdt().substring(0,16)+"至"+nowTime.substring(0,16)+"发生故障报警"); - scadaAlarm.setAlarmTypeLv2(""); - this.scadaAlarmService.update(bizid, scadaAlarm); - } - continue; - }else{ - String describe=mPoint.getParmname()+"于"+nowTime.substring(0,16)+"发生故障报警"; - String processSectionName=""; - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - ProcessSection prSection=this.processSectionService.selectById(mPoint.getProcesssectioncode()); - if(prSection!=null){ - processSectionName=prSection.getName(); - } - } - this.scadaAlarmService.saveMPAlarm(bizid,mPoint,nowTime,triggerAlarm,"",describe,processSectionName); - continue; - } - } - - } - - - - - } - } - } - } - System.out.println(CommUtil.nowDate() + "====自动报警结束"); - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/ScadaModbusJob.java b/src/com/sipai/quartz/job/ScadaModbusJob.java deleted file mode 100644 index b9756413..00000000 --- a/src/com/sipai/quartz/job/ScadaModbusJob.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.quartz.job; - -import java.util.Date; - -public class ScadaModbusJob { - public void execute(){ - - -// System.out.println("scadaModbus!!!"+(new Date()).toString()); - - } - -} diff --git a/src/com/sipai/quartz/job/SpecialEquipmentJob.java b/src/com/sipai/quartz/job/SpecialEquipmentJob.java deleted file mode 100644 index de5c7aaf..00000000 --- a/src/com/sipai/quartz/job/SpecialEquipmentJob.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - - - - - - - - - - -import org.springframework.util.xml.SimpleSaxErrorHandler; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.SpecialEquipment; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.SpecialEquipmentService; -import com.sipai.tools.CommUtil; - -public class SpecialEquipmentJob { - - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private SpecialEquipmentService specialEquipmentService; - - public void execute() throws ParseException{ - System.out.println("========================检定记录定时任务开始=================================="); - //将当前时间(年月日)转换为毫秒数 - Calendar cal = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date nowDate = new Date(); - String nowTime=sdf.format(nowDate); - Date nowDateSdf=sdf.parse(nowTime); - cal.setTime(nowDateSdf); - long currTimeMillis=cal.getTimeInMillis(); - - List spList=specialEquipmentService.selectListByWhere(" where 1=1 and act_finish_time is null or act_finish_time =''"); - if(spList.size()>0 && null!=spList && !spList.isEmpty()){ - for(SpecialEquipment sp:spList){ - Calendar tempCal = Calendar.getInstance(); - String nextTimeStr=sp.getNextRecordTime(); - Date nextTimeDate=sdf.parse(nextTimeStr); - tempCal.setTime(nextTimeDate); - long currNextTimeTimeMillis=tempCal.getTimeInMillis(); - - //提前一个月提示 - String tipsTime = dealTime(nextTimeStr, 0, -1, 0); - - if(currTimeMillis == currNextTimeTimeMillis){ - - String status = SpecialEquipment.STATUS_EXPIRE; - sp.setStatus(status); - specialEquipmentService.update(sp); - - }else if(currTimeMillis < currNextTimeTimeMillis){ - Calendar tipsCal = Calendar.getInstance(); - tipsCal.setTime(sdf.parse(tipsTime)); - Long tipsTimeInMillis = tipsCal.getTimeInMillis(); - - //是否需要提醒 - if(currTimeMillis >= tipsTimeInMillis){ - - String status = SpecialEquipment.STATUS_WARN; - sp.setStatus(status); - specialEquipmentService.update(sp); - - - }/*else{ - String status = SpecialEquipment.STATUS_NORMAL; - sp.setStatus(status); - specialEquipmentService.update(sp); - - }*/ - }else{ - String status = SpecialEquipment.STATUS_EXPIRED; - sp.setStatus(status); - specialEquipmentService.update(sp); - } - } - } - } - - - - /* - * 获取指定月的前一月(年)或后一月(年) - * @param dateStr - * @param addYear - * @param addMonth - * @param addDate - * @return - * @throws Exception - */ - public String dealTime(String dateStr,int addYear, int addMonth, int addDate) { - try { - SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");; - Date sourceDate = sdf.parse(dateStr); - Calendar cal = Calendar.getInstance(); - cal.setTime(sourceDate); - cal.add(Calendar.YEAR,addYear); - cal.add(Calendar.MONTH, addMonth); - cal.add(Calendar.DATE, addDate); - - String dateTmp = sdf.format(cal.getTime()); - return dateTmp; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - -} diff --git a/src/com/sipai/quartz/job/TaskHandler.java b/src/com/sipai/quartz/job/TaskHandler.java deleted file mode 100644 index 6e095f87..00000000 --- a/src/com/sipai/quartz/job/TaskHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.quartz.job; - - -import com.xxl.job.core.biz.model.ReturnT; -import com.xxl.job.core.handler.annotation.XxlJob; -import com.xxl.job.core.log.XxlJobLogger; -import org.springframework.stereotype.Component; - -import static com.xxl.job.core.biz.model.ReturnT.SUCCESS; - - -@Component -public class TaskHandler { - - @XxlJob("taskDemoHandler") -// @Override - public ReturnT execute(String param) throws Exception { - System.out.println("接受参数" + param + "执行任务"); -// XxlJobLogger.log("接受参数" + param + "\n执行任务"); - return ReturnT.SUCCESS; - } - -} diff --git a/src/com/sipai/quartz/job/TaskTest1.java b/src/com/sipai/quartz/job/TaskTest1.java deleted file mode 100644 index fca654a0..00000000 --- a/src/com/sipai/quartz/job/TaskTest1.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.quartz.job; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.tools.CommUtil; -import com.xxl.job.core.biz.model.ReturnT; -import com.xxl.job.core.handler.annotation.XxlJob; -import org.quartz.JobExecutionContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.schedule.ScheduleJobDetail; -import com.sipai.service.schedule.ScheduleJobDetailService; -import com.sipai.tools.SpringContextUtil; - -@Component -public class TaskTest1 { - -// ScheduleJobDetailService scheduleJobDetailService = (ScheduleJobDetailService) SpringContextUtil.getBean("scheduleJobDetailService"); - - public static final Logger LOGGER = LoggerFactory.getLogger(TaskTest1.class); - - @XxlJob("taskHandler1") - public ReturnT taskHandler1(String param) throws Exception { - System.out.println("taskHandler1===接受参数===(" + param + ")===执行任务===" + CommUtil.nowDate()); - return ReturnT.SUCCESS; - } - - @XxlJob("taskHandler2") - public ReturnT taskHandler2(String param) throws Exception { - System.out.println("taskHandler2===接受参数===(" + param + ")===执行任务===" + CommUtil.nowDate()); - return ReturnT.SUCCESS; - } - - @XxlJob("taskHandler3") - public ReturnT taskHandler3(String param) throws Exception { - System.out.println("taskHandler3===接受参数===(" + param + ")===执行任务===" + CommUtil.nowDate()); - return ReturnT.SUCCESS; - } - -} diff --git a/src/com/sipai/quartz/job/TopAlarmNumJob.java b/src/com/sipai/quartz/job/TopAlarmNumJob.java deleted file mode 100644 index 3eb18153..00000000 --- a/src/com/sipai/quartz/job/TopAlarmNumJob.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.quartz.job; - -import java.text.ParseException; -import java.util.List; -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.data.XServer; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.data.XServerService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MqttUtil; - -public class TopAlarmNumJob { - @Resource - private XServerService xServerService; - @Resource - private ProAlarmService proAlarmService; - - int firstNum = 0; - - public void execute() throws ParseException { - - if (firstNum == 0) { - try { - Thread.sleep(50000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - List xServerList = this.xServerService.selectListByWhere(" where status='启用' "); - - int totalAlarmNum = 0; - String nowTime = CommUtil.nowDate(); - - JSONObject jsonWebmain = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - -// JSONObject jSONObjectApp = new JSONObject(); -// int alarmNumApp = 0; - - if (xServerList != null && xServerList.size() > 0) { - for (XServer xServer : - xServerList) { - JSONObject jsonWeb = new JSONObject(); - - String bizid = xServer.getBizid(); - - String edt = nowTime.substring(0, 10) + " 23:59"; - String sdt = CommUtil.subplus(edt, "-30", "day").substring(0, 10) + " 00:00"; - - jsonWeb.put("bizid", bizid); - - List proAlarmList = this.proAlarmService.selectCountByWhere(bizid, " where status='" + ProAlarm.STATUS_ALARM + "' and alarm_time >= '" + sdt + "' and alarm_time <= '" + edt + "' "); -// System.out.println(bizid+":" +" where status='" + ProAlarm.STATUS_ALARM + "' and alarm_time >= '" + sdt + "' and alarm_time <= '" + edt + "' "); - if (proAlarmList != null && proAlarmList.size() > 0) { - jsonWeb.put("alarmNum", proAlarmList.get(0).getNum()); - totalAlarmNum += proAlarmList.get(0).getNum(); - } else { - jsonWeb.put("alarmNum", 0); - } - jsonArray.add(jsonWeb); - -// //给app发 新的报警数量 -// List proAlarmListApp = this.proAlarmService.selectCountByWhere(bizid, " where status='" + ProAlarm.STATUS_ALARM + "' and alarm_time >= '" + CommUtil.subplus(nowTime, "-3", "sec") + "' and alarm_time <= '" + nowTime + "' "); -// if (proAlarmListApp != null && proAlarmListApp.size() > 0) { -// alarmNumApp += proAlarmListApp.get(0).getNum(); -// } - - } - } - - jsonWebmain.put("conpanyData", jsonArray); - jsonWebmain.put("totalAlarmNum", totalAlarmNum);//暂时未考虑公司挂公司情况 - // mqtt发布消息 -// System.out.println("当前报警数量:" + totalAlarmNum); - MqttUtil.publish(jsonWebmain, "alarm_num_topic"); - -// jSONObjectApp.put("title", "报警提醒"); -// jSONObjectApp.put("content", "您当前有" + alarmNumApp + "条新报警,请关注!"); -// System.out.println("您当前有" + alarmNumApp + "条新报警,请关注!"); -// if (alarmNumApp > 0) { -// MqttUtil.publish(jSONObjectApp, "new_app_alarm"); -// } - - firstNum = 1; - - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/UserCardJob.java b/src/com/sipai/quartz/job/UserCardJob.java deleted file mode 100644 index d255373c..00000000 --- a/src/com/sipai/quartz/job/UserCardJob.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.quartz.job; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.User; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * 定时将人员和卡号缓存到redis里 用于BIM使用 目前仅用于南厂 - */ -public class UserCardJob { - - @Resource - private UserService userService; - @Resource - private RedissonClient redissonClient; - - public void dataSave() { -// RMap map_redis = redissonClient.getMap("userCard"); - RMap map_redis = redissonClient.getMap("local_userCard"); - List list = userService.selectListByWhere("where 1=1 and cardid is not null and cardid!=''"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - map_redis.fastPutAsync(list.get(i).getCardid(), list.get(i).getCaption()); - } - } - } - -} \ No newline at end of file diff --git a/src/com/sipai/quartz/job/WeatherJob.java b/src/com/sipai/quartz/job/WeatherJob.java deleted file mode 100644 index ab655bcb..00000000 --- a/src/com/sipai/quartz/job/WeatherJob.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.quartz.job; - -import java.io.IOException; -import java.util.List; - -import javax.annotation.Resource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.WeatherNew; -import com.sipai.service.company.CompanyService; -import com.sipai.service.schedule.ScheduleJobDetailService; -import com.sipai.service.work.WeatherNewService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import net.sf.json.JSONObject; - -public class WeatherJob { - @Autowired - private WeatherNewService weatherNewService; - @Resource - private CompanyService companyService; - - public void excute() throws IOException{ - System.out.println("执行天气方法"); - List companies = companyService.selectListByWhere - ("where city is not null and city!='' and [active]='1' order by name"); - if(companies != null && companies.size()>0){ - for(Company company : companies){ - System.out.println("获取天气厂区:"+company.getSname()); - String json = CommUtil.getWeatherHTTP(company.getCity()); - System.out.println("获取天气时间:"+CommUtil.nowDate()); - if(json!=null && !json.isEmpty()){ - JSONObject jsonObject = JSONObject.fromObject(json); - WeatherNew weatherNew = new WeatherNew(); - weatherNew.setBizid(company.getId()); - weatherNew.setCity(company.getCity()); - weatherNew.setId(CommUtil.getUUID()); - weatherNew.setTime(CommUtil.nowDate()); - weatherNew.setTemp(jsonObject.getString("nowTemp")); - weatherNew.setHighTemp(jsonObject.getString("highTemp")); - weatherNew.setLowTemp(jsonObject.getString("lowTemp")); - weatherNew.setWind(jsonObject.getString("wind")); - weatherNew.setWindPower(jsonObject.getString("windPower")); - weatherNew.setWeather(jsonObject.getString("weather")); - int res = this.weatherNewService.save(weatherNew); - System.out.println("天气保存:"+res); - } - } - } - } - -} diff --git a/src/com/sipai/quartz/job/WeatherNewJob.java b/src/com/sipai/quartz/job/WeatherNewJob.java deleted file mode 100644 index d6c62892..00000000 --- a/src/com/sipai/quartz/job/WeatherNewJob.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.quartz.job; - -import java.util.List; - -import javax.annotation.Resource; - -import net.sf.json.JSONObject; - -import com.sipai.entity.user.Company; -import com.sipai.entity.work.WeatherNew; -import com.sipai.service.company.CompanyService; -import com.sipai.service.work.WeatherNewService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.WeatherTest; - -/** - * 天气网址异常,停用 - * - */ -public class WeatherNewJob { - @Resource - private WeatherNewService weatherNewService; - @Resource - private CompanyService companyService; - - public void excute(){ - List companies = companyService.selectListByWhere - ("where city is not null and city!='' and [active]='1' order by name"); - if(companies != null){ - for(Company company : companies){ - //System.out.println(company.getCity()); - String json = WeatherTest.getWeatherRes(company.getCity()); - JSONObject jsonObject = JSONObject.fromObject(json); - System.out.println(company.getCity()+jsonObject.toString()); - WeatherNew weatherNew = new WeatherNew(); - weatherNew.setBizid(company.getId()); - weatherNew.setCity(company.getCity()); - weatherNew.setHumidity(jsonObject.optString("humidity")); - weatherNew.setId(CommUtil.getUUID()); - weatherNew.setTemp(jsonObject.optString("temp")); - weatherNew.setTime(CommUtil.nowDate()); - weatherNew.setWeather(jsonObject.optString("weather")); - weatherNew.setWind(jsonObject.optString("wind")); - weatherNewService.save(weatherNew); - try { - Thread.sleep(30000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } - -} diff --git a/src/com/sipai/quartz/job/ZY1C_Job.java b/src/com/sipai/quartz/job/ZY1C_Job.java deleted file mode 100644 index c37d482f..00000000 --- a/src/com/sipai/quartz/job/ZY1C_Job.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.quartz.job; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.serotonin.modbus4j.code.DataType; -import com.serotonin.modbus4j.exception.ErrorResponseException; -import com.serotonin.modbus4j.exception.ModbusInitException; -import com.serotonin.modbus4j.exception.ModbusTransportException; -import com.sipai.entity.data.DataTransConfig; -import com.sipai.entity.process.DataPatrol; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.data.DataTransConfigService; -import com.sipai.service.process.DataPatrolService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.ModbusUtils; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.MsgWebSocket2; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * websocket推送数据给三维(通用接口) - * sj 2023-04-26 - */ -public class ZY1C_Job { - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("mPointHistoryService"); - DataTransConfigService dataTransConfigService = (DataTransConfigService) SpringContextUtil.getBean("dataTransConfigService"); - - /** - * 实时数据接口 (在定时器模块修改推送的频率,仅推送订阅的数据) - * - * @param scheduleJob - */ - public void fun1(ScheduleJob scheduleJob) { - System.out.println("竹一定时器 ====== " + CommUtil.nowDate()); - String unitId = "021ZY1C"; - String nowdate = CommUtil.nowDate().substring(0, 16) + ":00"; - - List list = dataTransConfigService.selectListByWhere("where 1=1"); - for (int i = 0; i < list.size(); i++) { - try { - String reg = list.get(i).getRegister().substring(1, list.get(i).getRegister().length() - 1); - System.out.println(list.get(i).getModbusUrl() + " === " +list.get(i).getRegister()+" === "+reg); - if (ModbusUtils.readHoldingRegister(list.get(i).getModbusUrl(), 1, Integer.parseInt(reg), DataType.FOUR_BYTE_FLOAT) != null) { - System.out.println(list.get(i).getModbusUrl() + " === " + list.get(i).getRegister() + " === " + ModbusUtils.readHoldingRegister(list.get(i).getModbusUrl(), 1, Integer.parseInt(reg), DataType.FOUR_BYTE_FLOAT)); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(ModbusUtils.readHoldingRegister(list.get(i).getModbusUrl(), 1, Integer.parseInt(reg), DataType.FOUR_BYTE_FLOAT).toString())); - mPointHistory.setMeasuredt(nowdate); - mPointHistory.setTbName("[tb_mp_" + list.get(i).getMpcode() + "]"); - mPointHistoryService.save(unitId, mPointHistory); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - -} diff --git a/src/com/sipai/quartz/job/whp/AutoSamplePlanJob.java b/src/com/sipai/quartz/job/whp/AutoSamplePlanJob.java deleted file mode 100644 index e6b53147..00000000 --- a/src/com/sipai/quartz/job/whp/AutoSamplePlanJob.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.sipai.quartz.job.whp; - -import com.sipai.controller.exception.BizCheckException; -import com.sipai.entity.enums.whp.AmplingPeriodEnum; -import com.sipai.entity.enums.whp.SamplingPlanStatusEnum; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.plan.WhpSamplingPlanService; -import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; -import com.sipai.tools.DateUtil; - -import javax.annotation.Resource; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -/** - * 自动下发 采集计划job - */ -public class AutoSamplePlanJob { - - @Resource - private WhpSamplingPlanService whpSamplingPlanService; - - @Resource - private WhpSampleTypeService whpSampleTypeService; - - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - - public AutoSamplePlanJob() { - } - - public void execute() throws BizCheckException, ParseException { - - Date nowTime = new Date(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date date = sdf.parse( sdf.format(nowTime)); - List planlists = whpSamplingPlanService.selectListByWhere(" where is_autoPlan=1 and autoplan_enddate>='" + DateUtil.toStr("yyyy-MM-dd", date) + "'"); - if (planlists != null && planlists.size() > 0) { - for (int i = 0; i < planlists.size(); i++) { - WhpSamplingPlan plan = planlists.get(i); - WhpSampleType whpSampleType = whpSampleTypeService.selectById(plan.getSampleTypeId()); - - if (whpSampleType.getIntervalDay()!=null&&!whpSampleType.getIntervalDay().equals("0")) { - String intervalDay = whpSampleType.getIntervalDay(); - String[] interdays=intervalDay.split(","); - for(String interday:interdays) - { - - if (!interday.equals("")) - { - - int playday=Integer.valueOf(interday); - - // 判断是否有周期下发数据 - if (whpSampleType.getAmplingPeriod() != null ) { - // 天 - if (whpSampleType.getAmplingPeriod() == AmplingPeriodEnum.AMPLDAY.getId()) { - //计算 计划采样时间和 当前时间相差的天数 是否是间隔时间天的整倍数 若是 则创建 采样计划任务 - int days = DateUtil.differentDays(DateUtil.toDate(plan.getDate()), date); - if (days % playday == 0)//若是整倍数 则应当创建 - { - savePlan(whpSampleType, date, plan); - } - } else if (whpSampleType.getAmplingPeriod() == AmplingPeriodEnum.AMPLWEEK.getId())//周 - { - if (playday == DateUtil.getWeekDay(date)) { - savePlan(whpSampleType, date, plan); - } - } else if (whpSampleType.getAmplingPeriod() == AmplingPeriodEnum.AMPLTENDAY.getId())//旬 - { - // 旬的第几天 - Date startTimedate = DateUtil.getTenDayStartTime(date); - Date nextdate = DateUtil.getFetureDate(startTimedate, playday - 1); - if (nextdate.compareTo(date) == 0) { - savePlan(whpSampleType, date, plan); - } - - } else if (whpSampleType.getAmplingPeriod() == AmplingPeriodEnum.AMPLMONTH.getId()) { //月 - Date startTimedate = DateUtil.getMonthStartTime(date); - // 月份的 几号 - Date nextdate = DateUtil.getFetureDate(startTimedate, playday - 1); - if (nextdate.compareTo(date) == 0) { - savePlan(whpSampleType, date, plan); - } - } - } - } - } - - - } - } - - } - } - - /** - * 保存 自动下发采样单 - * @param whpSampleType - * @param date - * @param plan - * @throws BizCheckException - */ - public void savePlan(WhpSampleType whpSampleType, Date date, WhpSamplingPlan plan) throws BizCheckException { - - //判断是否有重复的采样单号 - String nowDateStr = DateUtil.toStr("yyMMdd", date); - String code=whpSampleType.getCode() + nowDateStr; - int num = whpSamplingPlanService.bizBatchCheck(code); - if (num == 0) { - //当前日期 - WhpSamplingPlan batch = new WhpSamplingPlan(); - batch.setCode(whpSampleType.getCode() + nowDateStr); - batch.setDate(DateUtil.toStr(null, date)); - batch.setReportDate(DateUtil.toStr(null, DateUtil.getFetureDate(date, 1))); - batch.setStatus(SamplingPlanStatusEnum.SUBMIT.getId()); - batch.setSampleTypeId(plan.getSampleTypeId()); - batch.setSampleTypeName(plan.getSampleTypeName()); - batch.setDeptIds(plan.getDeptIds()); - batch.setDeptNames(plan.getDeptNames()); - batch.setTestOrgId(plan.getTestOrgId()); - batch.setIsAutoPlan(0); - whpSamplingPlanService.save(batch); - whpSamplingPlanTaskService.submitTask(batch); - } - } -} diff --git a/src/com/sipai/rabbitmq/MessageConsumer.java b/src/com/sipai/rabbitmq/MessageConsumer.java deleted file mode 100644 index 7be559ec..00000000 --- a/src/com/sipai/rabbitmq/MessageConsumer.java +++ /dev/null @@ -1,696 +0,0 @@ -package com.sipai.rabbitmq;/* - @author njp - @date 2023/8/2 16:41 - @discription -*/ - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.rabbitmq.client.Channel; -import com.sipai.entity.hqconfig.EnterRecord; -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.hqconfig.PositionsCasual; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserOutsiders; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.hqconfig.EnterRecordService; -import com.sipai.service.hqconfig.HQAlarmRecordService; -import com.sipai.service.hqconfig.PositionsCasualService; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.service.user.UserOutsidersService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.AlarmTypesService; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.Mqtt; -import com.sipai.tools.MqttUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.PositionsNumWebSocket; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.amqp.core.Message; -import org.springframework.amqp.rabbit.annotation.RabbitHandler; -import org.springframework.amqp.rabbit.annotation.RabbitListener; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -@Component -public class MessageConsumer { - protected Logger logger = LoggerFactory.getLogger(getClass()); - @Resource - UserService userService; - @Resource - UserOutsidersService userOutsidersService; - @Resource - private AreaManageService areaManageService; - @Resource - private EnterRecordService enterRecordService; - @Resource - private RiskLevelService riskLevelService; - @Resource - private HQAlarmRecordService hqAlarmRecordService; - @Resource - private PositionsCasualService positionsCasualService; - @Resource - private AlarmTypesService alarmTypesService; - /** - * 接收定位数据 - */ - @RabbitHandler - @RabbitListener(queues = "tenant_msg_991570A3_sc19120005") - public void process(String msg, Channel channel, Message message) throws IOException { - - String wherestr = "where record_status='1' order by insdt"; - List areaManagelist = areaManageService.selectListByWhere(wherestr); - //logger.info("区域数量 :{}", areaManagelist.size()); - channel.basicAck(message.getMessageProperties().getDeliveryTag(),false); - try{ - JSONObject response = JSON.parseObject(new String(message.getBody())); - if(response!=null){ - logger.info("接收数据时间 :{}", CommUtil.nowDate()); - logger.info("接收数据内容 :{}",response.toString() ); - String method = response.get("method").toString(); - if("position".equals(method)){ - //定位 - JSONObject params = JSON.parseObject(response.get("params").toString()); - //标签id - String tagId = params.get("tagId").toString(); - //是否在大门外 - boolean out = Boolean.parseBoolean(params.get("out").toString()); - //标签类型(staff:人员;car:车辆;contractor:承包商) - String entityType = params.get("entityType").toString(); - //logger.info("tagId :{}", tagId); - if(tagId!=null && !tagId.isEmpty()){ - //当前定位记录 - List positionsCasuals = positionsCasualService.selectListByWhere("where cardid='"+tagId+"' "); - if(positionsCasuals!=null && positionsCasuals.size()>0){ - PositionsCasual positionsCasual = positionsCasuals.get(0); - if(out){ - //出去则清除 - positionsCasualService.deleteById(positionsCasual.getId()); - logger.info(tagId+"定位记录消除时间 :{}", CommUtil.nowDate()); - }else{ - //楼层 - positionsCasual.setFloor(params.get("floor").toString()); - //坐标产生时间 - positionsCasual.setLocationtime(params.get("locationTime").toString()); - positionsCasual.setX(params.get("x").toString()); - positionsCasual.setY(params.get("y").toString()); - positionsCasualService.update(positionsCasual); - } - }else{ - if(!out){ - PositionsCasual positionsCasual = new PositionsCasual(); - //positionsCasual.setId(CommUtil.getUUID()); - positionsCasual.setId(params.get("locationTime").toString()); - positionsCasual.setInsdt(CommUtil.nowDate()); - positionsCasual.setName(params.get("name").toString()); - positionsCasual.setCardid(tagId); - positionsCasual.setIndoor(params.get("inDoor").toString()); - //楼层 - positionsCasual.setFloor(params.get("floor").toString()); - //坐标产生时间 - positionsCasual.setLocationtime(params.get("locationTime").toString()); - positionsCasual.setX(params.get("x").toString()); - positionsCasual.setY(params.get("y").toString()); - positionsCasualService.save(positionsCasual); - } - } - PositionsNumWebSocket positionsNum = new PositionsNumWebSocket(); - JSONObject positionsNumJson= userOutsidersService.getUserNumber(); - positionsNum.onMessage(positionsNumJson.toString(), null); - List users = userService.getUserByCardId(tagId); - User user = null; - UserOutsiders userOutsiders = null; - List userOutsiders_out= userOutsidersService.selectListByWhere("where cardid ='"+tagId+"' order by insdt"); - String userId = ""; - String userCaption = ""; - if(users!=null && users.size()>0){ - user = users.get(0); - userId = user.getId(); - userCaption = user.getCaption(); - //logger.info("内部人员数量 :{}", users.size()); - }else{ - if(userOutsiders_out!=null && userOutsiders_out.size()>0){ - userOutsiders = userOutsiders_out.get(0); - userId = userOutsiders.getId(); - userCaption = userOutsiders.getName(); - //logger.info("外部人员数量 :{}", userOutsiders_out.size()); - } - } - if(userId!=null && !userId.isEmpty() && userCaption!=null && !userCaption.isEmpty()){ - String x = ""; - String y = ""; - double top = 0; - double right = 0; - double left = 0; - double top_region = 0; - double right_region = 0; - double left_region = 0; - double width = 642; - double height = 667.0; - //比例数值 - double v = 0.444; - //一层 - double left_v_1 = 642.0/276.0; - double top_v_1 = 667.0/283.0; - //负一层 - double left_v_0 = 637.0/272.0; - double top_v_0 = 814.0/346.0; - boolean rayCasting = false; - String areaManageId = null; - String areaManagePId = null; - //权限人员 - String areaManageUserId = null; - //翻转方式 - String turn = null; - //放大比例top - double enlargement = 0.0; - //放大比例left - double enlargementLeft = 0.0; - if(out){ - //离开,不在范围内 - String nowTime = CommUtil.nowDate(); - List enterRecordList= enterRecordService.selectListByWhere("where enterid='"+userId+"' and state=1 order by inTime desc"); - if(enterRecordList!=null && enterRecordList.size()>0){ - for(EnterRecord enterRecord : enterRecordList){ - String intime= enterRecord.getIntime(); - int duration = CommUtil.getDays2(nowTime,intime,"second"); - enterRecord.setDuration((double) duration); - enterRecord.setOuttime(nowTime); - enterRecord.setState(false); - enterRecordService.update(enterRecord); - } - } - - List riskLevels = this.riskLevelService.selectListByWhere("where securityContent = '人员进入非授权区域' order by insdt desc"); - if(riskLevels!=null && riskLevels.size()>0) { - RiskLevel riskLevel = riskLevels.get(0); - if (riskLevel.getAlarmLevelsConfig() != null) { - String Level = riskLevel.getAlarmLevelsConfig().getLevel(); - String name = riskLevel.getSecuritycontent()+"("+userCaption+")"; - List hQAlarmRecords= hqAlarmRecordService.selectListByWhere("where targetid='"+userId+"' " + - "and state='1' and name='"+name+"' and riskLevel='"+Level+"' order by insdt desc"); - if(hQAlarmRecords!=null && hQAlarmRecords.size()>0){ - HQAlarmRecord hQAlarmRecord = hQAlarmRecords.get(0); - hQAlarmRecord.setState("2"); - hQAlarmRecord.setEliminatedt(nowTime); - hqAlarmRecordService.update(hQAlarmRecord); - } - } - } - logger.info(tagId+"区域进出记录消除时间 :{}", CommUtil.nowDate()); - }else{ - //在范围内 - if(params.get("x")!=null && params.get("y")!=null){ - logger.info("tagId :{}", tagId); - //楼层 - String floor = params.get("floor").toString(); - x = params.get("x").toString(); - y = params.get("y").toString(); - //logger.info("x :{}", x); - //logger.info("y :{}", y); - //logger.info("floor :{}", floor); - //转化坐标 - String layer = "1"; - if("1".equals(floor)){ - //logger.info("top_v_1 :{}",top_v_1); - //logger.info("left_v_1 :{}", left_v_1); - //logger.info("x2 :{}", Double.parseDouble(x)); - //logger.info("y2 :{}", Double.parseDouble(y)); - top = Double.parseDouble(x)*top_v_1; - left = Double.parseDouble(y)*left_v_1; - width = 642; - height = 667.0; - }else - if("-1".equals(floor)){ - top = Double.parseDouble(x)*top_v_0; - left = Double.parseDouble(y)*left_v_0; - width = 637.0; - height = 814.0; - layer = "2"; - }else{ - top = Double.parseDouble(x)*v; - left = Double.parseDouble(y)*v; - width = 642; - height = 667.0; - } - left = left+5; - logger.info("left :{}", left); - logger.info("top :{}", top); - //left = 640-right; - wherestr = "where record_status='1' and pid='-1' and layer in ('3','"+layer+"') order by id desc"; - areaManagelist = areaManageService.selectListByWhere(wherestr); - if(areaManagelist!=null && areaManagelist.size()>0){ - for(AreaManage areaManage : areaManagelist){ - double[] p= {left,top}; - List poly = new ArrayList(); - String coordinatesPosition = areaManage.getCoordinatesPosition(); - String[] positions = coordinatesPosition.split(";"); - if(positions!=null && positions.length>0){ - /*for(int i=0;i enterRecordList= enterRecordService.selectListByWhere("where enterid='"+userId+"' and areaid='"+areaManageId+"' " + - "and state=1 order by inTime desc"); - EnterRecord enterRecord = new EnterRecord(); - if(enterRecordList!=null && enterRecordList.size()>0){ - enterRecord = enterRecordList.get(0); - String intime= enterRecord.getIntime(); - int duration = CommUtil.getDays2(locationTime2,intime,"second"); - enterRecord.setDuration((double) duration); - enterRecordService.update(enterRecord); - }else{ - String nowTime = CommUtil.nowDate(); - List enterRecordListOld= enterRecordService.selectListByWhere("where enterid='"+userId+"' and state=1 order by inTime desc"); - if(enterRecordListOld!=null && enterRecordListOld.size()>0){ - for(EnterRecord enterRecordOld : enterRecordListOld){ - String intime= enterRecordOld.getIntime(); - int duration = CommUtil.getDays2(nowTime,intime,"second"); - enterRecordOld.setDuration((double) duration); - enterRecordOld.setOuttime(nowTime); - enterRecordOld.setState(false); - enterRecordService.update(enterRecordOld); - String areaManageIdOld = enterRecordOld.getAreaid(); - //发送区域mqtt-离开区域 - if (areaManageIdOld!=null && !areaManageIdOld.isEmpty() && mqtt.getStatus().equals("0")) { - AreaManage areaManageOld = areaManageService.selectById(areaManageIdOld); - String areaManagePIdOld = areaManageOld.getPid(); - if(!areaManagePIdOld.equals("-1")){ - areaManageIdOld = areaManagePIdOld; - } - JSONObject jsonObjectArea = new JSONObject(); - jsonObjectArea.put("date", CommUtil.nowDate()); - //在区内0;不在区域内1 - jsonObjectArea.put("out", 1); - jsonObjectArea.put("top", top_region); - jsonObjectArea.put("left", left_region); - jsonObjectArea.put("floor", floor); - jsonObjectArea.put("name", userCaption); - //logger.info("jsonObjectArea :{}", jsonObjectArea); - MqttUtil.publish(jsonObjectArea, "dataVisualData_personnel_positioning_"+areaManageIdOld); - } - List riskLevels = this.riskLevelService.selectListByWhere("where securityContent = '人员进入非授权区域' order by insdt desc"); - if(riskLevels!=null && riskLevels.size()>0) { - RiskLevel riskLevel = riskLevels.get(0); - if (riskLevel.getAlarmLevelsConfig() != null) { - String Level = riskLevel.getAlarmLevelsConfig().getLevel(); - String name = riskLevel.getSecuritycontent()+"("+userCaption+")"; - List hQAlarmRecords= hqAlarmRecordService.selectListByWhere("where targetid='"+userId+"' " + - "and state='1' and name='"+name+"' and riskLevel='"+Level+"' order by insdt desc"); - if(hQAlarmRecords!=null && hQAlarmRecords.size()>0){ - HQAlarmRecord hQAlarmRecord = hQAlarmRecords.get(0); - hQAlarmRecord.setState("2"); - hQAlarmRecord.setEliminatedt(nowTime); - hqAlarmRecordService.update(hQAlarmRecord); - } - } - } - } - } - String intime= enterRecord.getIntime(); - //enterRecord.setId(CommUtil.getUUID()); - enterRecord.setId(locationTime); - enterRecord.setEnterid(userId); - enterRecord.setAreaid(areaManageId); - enterRecord.setState(true); - enterRecord.setIntime(locationTime2); - enterRecord.setDuration(0.0); - enterRecord.setFid(userCaption+"("+tagId+")"); - enterRecordService.save(enterRecord); - } - //发送区域mqtt - if (mqtt.getStatus().equals("0")) { - if(!areaManagePId.equals("-1")){ - areaManageId = areaManagePId; - } - JSONObject jsonObjectArea = new JSONObject(); - jsonObjectArea.put("date", CommUtil.nowDate()); - //在区内0;不在区域内1 - jsonObjectArea.put("out", 0); - jsonObjectArea.put("top", top_region); - jsonObjectArea.put("left", left_region); - jsonObjectArea.put("floor", floor); - jsonObjectArea.put("name", userCaption); - //logger.info("jsonObjectArea :{}", jsonObjectArea); - MqttUtil.publish(jsonObjectArea, "dataVisualData_personnel_positioning_"+areaManageId); - } - wherestr = "where record_status='1' and pid='"+areaManageId+"' order by id desc"; - areaManagelist = areaManageService.selectListByWhere(wherestr); - if(areaManagelist!=null && areaManagelist.size()>0){ - int rayCastingSonNum=0; - for(AreaManage areaManage : areaManagelist){ - double[] p= {left,top}; - List poly = new ArrayList(); - String coordinatesPosition = areaManage.getCoordinatesPosition(); - String[] positions = coordinatesPosition.split(";"); - if(positions!=null && positions.length>0){ - String position=positions[0]; - rayCasting = CommUtil.rayCasting2(positions,p); - String areaManageIdSon = areaManage.getId(); - if(rayCasting){ - rayCastingSonNum++; - List enterRecordSonList= enterRecordService.selectListByWhere("where enterid='"+userId+"' and areaid='"+areaManageIdSon+"' " + - "and state=1 order by inTime desc"); - EnterRecord enterRecordSon = new EnterRecord(); - if(enterRecordSonList!=null && enterRecordSonList.size()>0){ - enterRecordSon = enterRecordSonList.get(0); - String intime= enterRecordSon.getIntime(); - int duration = CommUtil.getDays2(locationTime2,intime,"second"); - enterRecordSon.setDuration((double) duration); - enterRecordService.update(enterRecordSon); - }else{ - String nowTime = CommUtil.nowDate(); - List enterRecordListOld= enterRecordService.selectListByWhere("where enterid='"+userId+"' and areaid!='"+areaManageId+"' and state=1 order by inTime desc"); - if(enterRecordListOld!=null && enterRecordListOld.size()>0){ - for(EnterRecord enterRecordOld : enterRecordListOld){ - String intime= enterRecordOld.getIntime(); - int duration = CommUtil.getDays2(nowTime,intime,"second"); - enterRecordOld.setDuration((double) duration); - enterRecordOld.setOuttime(nowTime); - enterRecordOld.setState(false); - enterRecordService.update(enterRecordOld); - String areaManageIdOld = enterRecordOld.getAreaid(); - List riskLevels = this.riskLevelService.selectListByWhere("where securityContent = '人员进入非授权区域' order by insdt desc"); - if(riskLevels!=null && riskLevels.size()>0) { - RiskLevel riskLevel = riskLevels.get(0); - if (riskLevel.getAlarmLevelsConfig() != null) { - String Level = riskLevel.getAlarmLevelsConfig().getLevel(); - String name = riskLevel.getSecuritycontent()+"("+userCaption+")"; - List hQAlarmRecords= hqAlarmRecordService.selectListByWhere("where targetid='"+userId+"' " + - "and state='1' and areaid='"+areaManageIdOld+"' and riskLevel='"+Level+"' order by insdt desc"); - if(hQAlarmRecords!=null && hQAlarmRecords.size()>0){ - HQAlarmRecord hQAlarmRecord = hQAlarmRecords.get(0); - hQAlarmRecord.setState("2"); - hQAlarmRecord.setEliminatedt(nowTime); - hqAlarmRecordService.update(hQAlarmRecord); - } - } - } - } - } - String intime= enterRecord.getIntime(); - //enterRecord.setId(CommUtil.getUUID()); - enterRecord.setId(locationTime); - enterRecord.setEnterid(userId); - enterRecord.setAreaid(areaManageIdSon); - enterRecord.setState(true); - enterRecord.setIntime(locationTime2); - enterRecord.setDuration(0.0); - enterRecord.setFid(userCaption+"("+tagId+")"); - enterRecordService.save(enterRecord); - } - String areaManageUserIdSon = areaManage.getPowerids(); - if(areaManageUserIdSon!=null && !areaManageUserIdSon.isEmpty()){ - //"人员进入非授权区域"; - if(!areaManageUserIdSon.contains(userId)){ - List alarmType= this.alarmTypesService.selectListByWhere("where name = '权限空间报警' order by insdt desc"); - String alarmTypeId=null; - if(alarmType!=null && alarmType.size()>0){ - alarmTypeId = alarmType.get(0).getId(); - } - List riskLevels = this.riskLevelService.selectListByWhere("where securityContent = '人员进入非授权区域' order by insdt desc"); - if(riskLevels!=null && riskLevels.size()>0){ - RiskLevel riskLevel = riskLevels.get(0); - if(riskLevel.getAlarmLevelsConfig()!=null){ - String Level = riskLevel.getAlarmLevelsConfig().getLevel(); - String name = riskLevel.getSecuritycontent()+"("+userCaption+")"; - List hQAlarmRecords= hqAlarmRecordService.selectListByWhere("where targetid='"+userId+"' " + - "and state='1' and areaid='"+areaManageIdSon+"' and alarmTypeid='"+alarmTypeId+"' and name='"+name+"' order by insdt desc"); - if(hQAlarmRecords==null || hQAlarmRecords.size()==0){ - HQAlarmRecord alarmRecord = new HQAlarmRecord(); - alarmRecord.setId(CommUtil.nowDate()+areaManageIdSon+userId); - alarmRecord.setInsdt(CommUtil.nowDate()); - alarmRecord.setAreaid(areaManageIdSon); - alarmRecord.setAlarmtypeid(alarmTypeId); - alarmRecord.setRiskLevel(Level); - alarmRecord.setState("1"); - alarmRecord.setName(name); - alarmRecord.setTargetid(userId); - alarmRecord.setUnitId("021HQWS"); - int res = hqAlarmRecordService.save(alarmRecord); - } - } - } - } - } - String[] posit = position.split(","); - if(!position.isEmpty()){ - if(areaManage.getName().contains("廊道")){ - left_region = left; - top_region = top; - }else{ - left_region = left-Double.parseDouble(posit[0]); - top_region = top-Double.parseDouble(posit[1]); - } - } - turn = areaManage.getTurn(); - enlargement = areaManage.getEnlargement(); - enlargementLeft = areaManage.getEnlargementleft(); - if(turn!=null && !turn.isEmpty()){ - if("left".equals(turn)){ - double top_region_old = top_region; - position=positions[positions.length-1]; - if(!position.isEmpty()) { - posit = position.split(","); - left_region = width - left - Double.parseDouble(posit[0]); - double left_region_old = left_region; - left_region = top_region_old; - top_region = left_region_old; - } - } - } - if(areaManage.getEnlargement()!=null){ - left_region = left_region*enlargementLeft-16; - top_region = top_region*enlargement-32; - } - //发送区域mqtt - if (mqtt.getStatus().equals("0")) { - JSONObject jsonObjectArea = new JSONObject(); - jsonObjectArea.put("date", CommUtil.nowDate()); - //在区内0;不在区域内1 - jsonObjectArea.put("out", 0); - jsonObjectArea.put("top", top_region); - jsonObjectArea.put("left", left_region); - jsonObjectArea.put("floor", floor); - jsonObjectArea.put("name", userCaption); - //logger.info("jsonObjectArea :{}", jsonObjectArea); - MqttUtil.publish(jsonObjectArea, "dataVisualData_personnel_positioning_"+areaManageIdSon); - } - break; - }else{ - //发送区域mqtt-离开区域 - if (areaManageIdSon!=null && !areaManageIdSon.isEmpty() && mqtt.getStatus().equals("0")) { - AreaManage areaManageOld = areaManageService.selectById(areaManageIdSon); - String areaManagePIdOld = areaManageOld.getPid(); - JSONObject jsonObjectArea = new JSONObject(); - jsonObjectArea.put("date", CommUtil.nowDate()); - //在区内0;不在区域内1 - jsonObjectArea.put("out", 1); - jsonObjectArea.put("name", userCaption); - //logger.info("jsonObjectArea :{}", jsonObjectArea); - MqttUtil.publish(jsonObjectArea, "dataVisualData_personnel_positioning_"+areaManageIdSon); - } - } - } - } - if(rayCastingSonNum==0){ - //不在所有子区内则,子区全部结束记录 - String nowTime = CommUtil.nowDate(); - List enterRecordListOld= enterRecordService.selectListByWhere("where enterid='"+userId+"' and areaid!='"+areaManageId+"' and state=1 order by inTime desc"); - if(enterRecordListOld!=null && enterRecordListOld.size()>0){ - for(EnterRecord enterRecordOld : enterRecordListOld){ - String intime= enterRecordOld.getIntime(); - int duration = CommUtil.getDays2(nowTime,intime,"second"); - enterRecordOld.setDuration((double) duration); - enterRecordOld.setOuttime(nowTime); - enterRecordOld.setState(false); - enterRecordService.update(enterRecordOld); - String areaManageIdOld = enterRecordOld.getAreaid(); - List riskLevels = this.riskLevelService.selectListByWhere("where securityContent = '人员进入非授权区域' order by insdt desc"); - if(riskLevels!=null && riskLevels.size()>0) { - RiskLevel riskLevel = riskLevels.get(0); - if (riskLevel.getAlarmLevelsConfig() != null) { - String Level = riskLevel.getAlarmLevelsConfig().getLevel(); - String name = riskLevel.getSecuritycontent()+"("+userCaption+")"; - List hQAlarmRecords= hqAlarmRecordService.selectListByWhere("where targetid='"+userId+"' " + - "and state='1' and areaid='"+areaManageIdOld+"' and riskLevel='"+Level+"' order by insdt desc"); - if(hQAlarmRecords!=null && hQAlarmRecords.size()>0){ - HQAlarmRecord hQAlarmRecord = hQAlarmRecords.get(0); - hQAlarmRecord.setState("2"); - hQAlarmRecord.setEliminatedt(nowTime); - hqAlarmRecordService.update(hQAlarmRecord); - } - } - } - } - } - } - } - if(areaManageUserId!=null && !areaManageUserId.isEmpty()){ - //"人员进入非授权区域"; - if(!areaManageUserId.contains(userId)){ - List alarmType= this.alarmTypesService.selectListByWhere("where name = '权限空间报警' order by insdt desc"); - String alarmTypeId=null; - if(alarmType!=null && alarmType.size()>0){ - alarmTypeId = alarmType.get(0).getId(); - } - List riskLevels = this.riskLevelService.selectListByWhere("where securityContent = '人员进入非授权区域' order by insdt desc"); - if(riskLevels!=null && riskLevels.size()>0){ - RiskLevel riskLevel = riskLevels.get(0); - if(riskLevel.getAlarmLevelsConfig()!=null){ - String Level = riskLevel.getAlarmLevelsConfig().getLevel(); - String name = riskLevel.getSecuritycontent()+"("+userCaption+")"; - List hQAlarmRecords= hqAlarmRecordService.selectListByWhere("where targetid='"+userId+"' " + - "and state='1' and areaid='"+areaManageId+"' and alarmTypeid='"+alarmTypeId+"' and name='"+name+"' order by insdt desc"); - if(hQAlarmRecords==null || hQAlarmRecords.size()==0){ - HQAlarmRecord alarmRecord = new HQAlarmRecord(); - alarmRecord.setId(CommUtil.nowDate()+areaManageId+userId); - alarmRecord.setInsdt(CommUtil.nowDate()); - alarmRecord.setAreaid(areaManageId); - alarmRecord.setAlarmtypeid(alarmTypeId); - alarmRecord.setRiskLevel(Level); - alarmRecord.setState("1"); - alarmRecord.setName(name); - alarmRecord.setTargetid(userId); - alarmRecord.setUnitId("021HQWS"); - int res = hqAlarmRecordService.save(alarmRecord); - } - } - } - } - } - } - } - - } - } - - /*{ - "method":"position", - "params":{ - "silent":false,//是否静止 - "locationTime":1691047075956,//坐标产生时间 - "tagId":"UWT0133",//标签id - "entityType":"staff",//标签类型(staff:人员;car:车辆;contractor:承包商) - "inDoor":1691047029332,//大门进入时间 - "speed":0,//时速 - "out":false,//是否在大门外 - "voltUnit":"mV",//电量单位 - "areaId":1,//地图id - "stateTime":1691047075800, - "absolute":true,//是否相对定位 - "volt":4200000,//电量 - "name":"吴佳", - "x":1.49, - "y":225.649, - "z":0, - "floor":1,//楼层 - "rootAreaId":3//总图id - } - }*/ - } - if("warning".equals(method)){ - //报警 - } - } - }catch(Exception e){ - logger.error(e.getMessage(),e); - - } - } -} diff --git a/src/com/sipai/redis/MethodCacheInterceptor.java b/src/com/sipai/redis/MethodCacheInterceptor.java deleted file mode 100644 index 6eb53230..00000000 --- a/src/com/sipai/redis/MethodCacheInterceptor.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.redis; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import org.aopalliance.intercept.MethodInterceptor; -import org.aopalliance.intercept.MethodInvocation; -import org.apache.log4j.Logger; - - -public class MethodCacheInterceptor implements MethodInterceptor { - private Logger logger = Logger.getLogger(MethodCacheInterceptor.class); - private RedisUtil redisUtil; - private List targetNamesList; // 不加入缓存的service名称 - private List methodNamesList; // 不加入缓存的方法名称 - private Long defaultCacheExpireTime; // 缓存默认的过期时间 - private Long xxxRecordManagerTime; // - private Long xxxSetRecordManagerTime; // - - /** - * 初始化读取不需要加入缓存的类名和方法名称 - */ - public MethodCacheInterceptor() { - try { - //File f = new File("D:\\lunaJee-workspace\\msm\\msm_core\\src\\main\\java\\com\\mucfc\\msm\\common\\cacheConf.properties"); - //配置文件位置直接被写死,有需要自己修改下 - // InputStream in = new FileInputStream(f); - InputStream in = getClass().getClassLoader().getResourceAsStream("redis.properties"); - Properties p = new Properties(); - p.load(in); - // 分割字符串 - String[] targetNames = p.getProperty("targetNames").split(","); - String[] methodNames = p.getProperty("methodNames").split(","); - - // 加载过期时间设置 - defaultCacheExpireTime = Long.valueOf(p.getProperty("defaultCacheExpireTime")); - xxxRecordManagerTime = Long.valueOf(p.getProperty("com.service.impl.xxxRecordManager")); - xxxSetRecordManagerTime = Long.valueOf(p.getProperty("com.service.impl.xxxSetRecordManager")); - // 创建list - targetNamesList = new ArrayList(targetNames.length); - methodNamesList = new ArrayList(methodNames.length); - Integer maxLen = targetNames.length > methodNames.length ? targetNames.length - : methodNames.length; - // 将不需要缓存的类名和方法名添加到list中 - for (int i = 0; i < maxLen; i++) { - if (i < targetNames.length) { - targetNamesList.add(targetNames[i]); - } - if (i < methodNames.length) { - methodNamesList.add(methodNames[i]); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public Object invoke(MethodInvocation invocation) throws Throwable { - Object value = null; - - String targetName = invocation.getThis().getClass().getName(); - String methodName = invocation.getMethod().getName(); - // 不需要缓存的内容 - //if (!isAddCache(StringUtil.subStrForLastDot(targetName), methodName)) { - if (!isAddCache(targetName, methodName)) { - // 执行方法返回结果 - return invocation.proceed(); - } - Object[] arguments = invocation.getArguments(); - String key = getCacheKey(targetName, methodName, arguments); - System.out.println(key); - - try { - // 判断是否有缓存 - if (redisUtil.exists(key)) { - return redisUtil.get(key); - } - // 写入缓存 - value = invocation.proceed(); - if (value != null) { - final String tkey = key; - final Object tvalue = value; - new Thread(new Runnable() { - @Override - public void run() { - if (tkey.startsWith("com.service.impl.xxxRecordManager")) { - redisUtil.set(tkey, tvalue, xxxRecordManagerTime); - } else if (tkey.startsWith("com.service.impl.xxxSetRecordManager")) { - redisUtil.set(tkey, tvalue, xxxSetRecordManagerTime); - } else { - redisUtil.set(tkey, tvalue, defaultCacheExpireTime); - } - } - }).start(); - } - } catch (Exception e) { - e.printStackTrace(); - if (value == null) { - return invocation.proceed(); - } - } - return value; - } - - /** - * 是否加入缓存 - * - * @return - */ - private boolean isAddCache(String targetName, String methodName) { - boolean flag = true; - if (targetNamesList.contains(targetName) - || methodNamesList.contains(methodName)) { - flag = false; - } - return flag; - } - - /** - * 创建缓存key - * - * @param targetName - * @param methodName - * @param arguments - */ - private String getCacheKey(String targetName, String methodName, - Object[] arguments) { - StringBuffer sbu = new StringBuffer(); - sbu.append(targetName).append("_").append(methodName); - if ((arguments != null) && (arguments.length != 0)) { - for (int i = 0; i < arguments.length; i++) { - sbu.append("_").append(arguments[i]); - } - } - return sbu.toString(); - } - - public void setRedisUtil(RedisUtil redisUtil) { - this.redisUtil = redisUtil; - } -} diff --git a/src/com/sipai/redis/RedisUtil.java b/src/com/sipai/redis/RedisUtil.java deleted file mode 100644 index 025ba43c..00000000 --- a/src/com/sipai/redis/RedisUtil.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.sipai.redis; - -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.TimeUnit; - - - - -import org.apache.log4j.Logger; -import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; - -/** - * redis cache 工具类 - * - */ -public final class RedisUtil { - private Logger logger = Logger.getLogger(RedisUtil.class); - private RedisTemplate redisTemplate; - - /** - * 批量删除对应的value - * - * @param keys - */ - public void remove(final String... keys) { - for (String key : keys) { - remove(key); - } - } - - /** - * 批量删除key - * - * @param pattern - */ - public void removePattern(final String pattern) { - Set keys = redisTemplate.keys(pattern); - if (keys.size() > 0) - redisTemplate.delete(keys); - } - - /** - * 删除对应的value - * - * @param key - */ - public void remove(final String key) { - if (exists(key)) { - redisTemplate.delete(key); - } - } - - /** - * 判断缓存中是否有对应的value - * - * @param key - * @return - */ - public boolean exists(final String key) { - try { - return redisTemplate.hasKey(key); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - /*InputStream in = getClass().getClassLoader().getResourceAsStream("properties/redis.properties"); - Properties p = new Properties(); - try { - p.load(in); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - //重连 - String host = p.getProperty("redis.host").toString(); - LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(); // 注:这里使用的是Lettuce而非Jedis客户端 - connectionFactory.setHostName(host); - connectionFactory.setPort(6379); - connectionFactory.setValidateConnection(true); - connectionFactory.initConnection();*/ - //redisTemplate.setConnectionFactory(connectionFactory); - return false; - } - - } - - /** - * 读取缓存 - * - * @param key - * @return - */ - public Object get(final String key) { - Object result = null; - ValueOperations operations = redisTemplate - .opsForValue(); - result = operations.get(key); - return result; - } - - /** - * 写入缓存 - * - * @param key - * @param value - * @return - */ - public boolean set(final String key, Object value) { - boolean result = false; - try { - ValueOperations operations = redisTemplate - .opsForValue(); - operations.set(key, value); - result = true; - } catch (Exception e) { - e.printStackTrace(); - } - return result; - } - - /** - * 写入缓存 - * - * @param key - * @param value - * @return - */ - public boolean set(final String key, Object value, Long expireTime) { - boolean result = false; - try { - ValueOperations operations = redisTemplate - .opsForValue(); - operations.set(key, value); - redisTemplate.expire(key, expireTime, TimeUnit.SECONDS); - result = true; - } catch (Exception e) { - e.printStackTrace(); - } - return result; - } - - public void setRedisTemplate( - RedisTemplate redisTemplate) { - this.redisTemplate = redisTemplate; - } -} - diff --git a/src/com/sipai/security/LoginFailureHandler.java b/src/com/sipai/security/LoginFailureHandler.java deleted file mode 100644 index 65b1dc25..00000000 --- a/src/com/sipai/security/LoginFailureHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.security; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.authentication.AuthenticationFailureHandler; - -public class LoginFailureHandler implements AuthenticationFailureHandler{ - - @Override - public void onAuthenticationFailure(HttpServletRequest request, - HttpServletResponse response, AuthenticationException exception) - throws IOException, ServletException { - // TODO Auto-generated method stub -// response.setHeader("Content-type", "text/html;charset=UTF-8"); - response.setCharacterEncoding("UTF-8"); - - response.setHeader("Access-Control-Allow-Origin", "*"); - response.setHeader("Access-Control-Allow-Credentials","true"); //是否支持cookie跨域 - response.setHeader("Access-Control-Allow-Headers", "x-auth-token,Origin,Access_Token,X-Requested-With,Content-Type, Accept"); - response.setHeader("Access-Control-Allow-Methods"," GET, POST, PUT"); - response.setStatus(200); - String messange = new String(exception.getMessage().getBytes()); - - String result ="{\"status\":" + false +",\"res\":\""+ messange +"\"}"; - response.getWriter().println(result); - response.getWriter().flush(); - - } - - -} diff --git a/src/com/sipai/security/LoginSuccessHandler.java b/src/com/sipai/security/LoginSuccessHandler.java deleted file mode 100644 index 0a254b0a..00000000 --- a/src/com/sipai/security/LoginSuccessHandler.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.sipai.security; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserDetail; -import com.sipai.entity.user.UserTime; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserDetailService; -import com.sipai.service.user.UserService; -import com.sipai.tools.*; -import org.redisson.api.RBucket; -import org.redisson.api.RedissonClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.core.Authentication; -import org.springframework.security.web.authentication.AuthenticationSuccessHandler; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; - -//import org.springframework.data.redis.core.RedisTemplate; -public class LoginSuccessHandler implements AuthenticationSuccessHandler{ - Logger logger = LoggerFactory.getLogger(LoginSuccessHandler.class); - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private UserDetailService userDetailService; - // @Resource -// private RedisTemplate redisTemplate; - @Override - public void onAuthenticationSuccess(HttpServletRequest request, - HttpServletResponse response, Authentication authentication) - throws IOException, ServletException { - - // TODO Auto-generated method stub - //response.sendRedirect("/Login/doPass.do"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Access-Control-Allow-Origin", "*"); - response.setHeader("Access-Control-Allow-Credentials","true"); //是否支持cookie跨域 - response.setHeader("Access-Control-Allow-Headers", "x-auth-token,Origin,Access_Token,X-Requested-With,Content-Type, Accept"); - response.setHeader("Access-Control-Allow-Methods"," GET, POST, PUT"); - response.setStatus(200); -// response.sendError(401); - String result=""; - String userName =authentication.getName(); - String password =request.getParameter("j_password"); - User cu = userService.getUserById(userName); - UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); - cu.setUserDetail(userDetail); - String token = JwtUtil.sign(cu.getName(), cu.getId()); - // 将签发的JWT存储到Redis - RedissonClient redissonClient = SpringContextUtil.getBean(RedissonClient.class); - RBucket tokenBucket = redissonClient.getBucket(CommString.JWT_SESSION_HEADER+cu.getId()); - tokenBucket.set(token); - tokenBucket.expire(JwtUtil.EXPIRE_TIME*2, TimeUnit.MILLISECONDS); -// redisTemplate.opsForValue().set(CommString.JWT_SESSION_HEADER+cu.getId(), token,JwtUtil.EXPIRE_TIME*2,TimeUnit.MILLISECONDS); - if(ThreadLocalUtils.getCache("deviceId")!=null){ - String deviceId = ThreadLocalUtils.getCache("deviceId").toString(); - cu.setCurrentip(deviceId); - }else{ - cu.setCurrentip(request.getRemoteAddr()); - } - String source = UserTime.unknown; - //设置登录类型,平台端platform或手持端handheld或未知unknown - String user_Agent = request.getHeader("User-Agent"); - if(CommUtil.checkAgentIsMobile(user_Agent)){ - source = UserTime.handheld; - }else{ - source = UserTime.platform; - } - //String source = obtainSource(request); - //封闭范围内定义的局部变量必须是final或有效的final - String sources = source; - //重新登录则自动更新用户时间 - Thread thread = new Thread(new Runnable() { - @Override - public void run() { - userService.updateUserTime(cu.getId()); - //登录来源 - userService.saveUserTime(cu,sources); - } - }); - thread.start(); - result ="{\"status\":" + true +",\"res\":"+ JSONObject.toJSONString(cu) + - ",\"Access_Token\":\""+ token +"\"}"; - - cu.setLastlogintime(CommUtil.nowDate()); - if (cu.getThemeclass() == null || cu.getThemeclass().isEmpty()) { - cu.setThemeclass(CommString.Default_Theme); - } - String unitId = ""; - Company company = unitService.getCompanyByUserId(cu.getId()); - if (company != null) { - cu.set_pname(company.getSname()); - unitId = company.getId(); - } else { - //cu.set_pname("平台"); - List companies = unitService.getCompaniesByWhere("where pid='-1' and type='C'"); - if (companies != null) { - cu.set_pname(companies.get(0).getSname()); - unitId = companies.get(0).getId(); - } - } - request.getSession().invalidate();//清空session - if(request.getCookies()!=null && request.getCookies().length>0){ - Cookie cookie = request.getCookies()[0];//获取cookie - cookie.setMaxAge(0);//让cookie过期 - } - //设置session - HttpSession newSession = request.getSession(true); - newSession.setAttribute("cu", cu); - newSession.setAttribute("unitId", unitId); - newSession.setAttribute("source", source); - newSession.setAttribute("password", password); - - response.getWriter().println(result); - response.getWriter().flush(); - - } - protected String obtainSource(HttpServletRequest request) { - Object obj = request.getParameter("source"); - return null == obj ? "unknown" : obj.toString(); - } -} diff --git a/src/com/sipai/security/MyAccessDecisionManager.java b/src/com/sipai/security/MyAccessDecisionManager.java deleted file mode 100644 index 28fdf080..00000000 --- a/src/com/sipai/security/MyAccessDecisionManager.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.security; -import java.util.Collection; -import java.util.Iterator; - -import org.springframework.security.access.AccessDecisionManager; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.access.ConfigAttribute; -import org.springframework.security.authentication.InsufficientAuthenticationException; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.stereotype.Component; -/** - * - * - */ -@Component -public class MyAccessDecisionManager implements AccessDecisionManager { - - public void decide(Authentication authentication, Object object, Collection configAttributes) throws AccessDeniedException, InsufficientAuthenticationException { -// if(configAttributes == null) { -// return; -// } -// //所请求的资源拥有的权限(一个资源对多个权限) -// Iterator iterator = configAttributes.iterator(); -// while(iterator.hasNext()) { -// ConfigAttribute configAttribute = iterator.next(); -// //访问所请求资源所需要的权限 -// String needPermission = configAttribute.getAttribute(); -// System.out.println("needPermission is " + needPermission); -// //用户所拥有的权限authentication -// for(GrantedAuthority ga : authentication.getAuthorities()) { -// if(needPermission.equals(ga.getAuthority())) { -// return; -// } -// } -// } - //没有权限 -// throw new AccessDeniedException(" 没有权限访问或未重新登录! "); - } - - public boolean supports(ConfigAttribute attribute) { - // TODO Auto-generated method stub - return true; - } - - public boolean supports(Class clazz) { - // TODO Auto-generated method stub - return true; - } - -} \ No newline at end of file diff --git a/src/com/sipai/security/MyFilterSecurityInterceptor.java b/src/com/sipai/security/MyFilterSecurityInterceptor.java deleted file mode 100644 index db992ac2..00000000 --- a/src/com/sipai/security/MyFilterSecurityInterceptor.java +++ /dev/null @@ -1,383 +0,0 @@ -package com.sipai.security; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.User; -import com.sipai.tools.CommUtil; -import com.sipai.tools.ErrorCodeEnum; -import com.sipai.tools.SessionManager; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.SecurityMetadataSource; -import org.springframework.security.access.intercept.AbstractSecurityInterceptor; -import org.springframework.security.access.intercept.InterceptorStatusToken; -import org.springframework.security.web.FilterInvocation; - -import javax.annotation.PostConstruct; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; - - -//@Component -public class MyFilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter { - @Autowired - private MySecurityMetadataSource securityMetadataSource; -// @Autowired -// private MyAccessDecisionManager accessDecisionManager; -// @Resource(name="myAuthenticationManager") -// private AuthenticationManager authenticationManager; - -// @Resource -// private AuthenticationConfiguration authenticationConfiguration; - -// @Autowired -// public void setAuthenticationConfiguration(AuthenticationConfiguration authenticationConfiguration) { -// this.authenticationConfiguration = authenticationConfiguration; -// } - - @PostConstruct - public void init() throws Exception { -// super.setAccessDecisionManager(accessDecisionManager); -// super.setAuthenticationManager(authenticationConfiguration.getAuthenticationManager()); - } - - @Override - public SecurityMetadataSource obtainSecurityMetadataSource() { - return this.securityMetadataSource; - } - - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - FilterInvocation fi = new FilterInvocation(request, response, chain); - invoke(fi); - } - - private void invoke(FilterInvocation fi) throws IOException, ServletException { - // object为FilterInvocation对象 - //super.beforeInvocation(fi);源码 - //1.获取请求资源的权限 - //执行Collection attributes = SecurityMetadataSource.getAttributes(object); - //2.是否拥有权限 - //this.accessDecisionManager.decide(authenticated, object, attributes); -// System.err.println(" --------------- MySecurityFilter invoke--------------- "); - InterceptorStatusToken token = super.beforeInvocation(fi); - try { - HttpServletRequest req = (HttpServletRequest) fi.getRequest(); - HttpServletResponse resp = (HttpServletResponse) fi.getResponse(); - if (req.getMethod().equals("OPTIONS")) { - return; - } - resp.setHeader("Access-Control-Allow-Origin", "*");//req.getHeader("Origin") - resp.setHeader("Access-Control-Allow-Credentials", "true"); //是否支持cookie跨域 - resp.setHeader("Access-Control-Allow-Headers", "Origin,X-Requested-With,Content-Type,Accept,token"); - resp.setHeader("Access-Control-Expose-Headers", "token"); - resp.setHeader("Access-Control-Allow-Methods", " GET, POST, PUT"); - if (CommUtil.filterRequestParameter(req)) { - //在获取流对象之前告诉浏览器使用什么字符集 - resp.setCharacterEncoding("utf-8"); - //告诉浏览器,服务器发送的消息体的数据的编码 - resp.setHeader("content-type", "text/html;charset=utf-8"); - resp.setContentType("text/html; charset=UTF-8"); - Result result = Result.failed("您发送的请求未通过验证,建议您检查请求参数和内容。"); - resp.getWriter().print(CommUtil.toJson(result)); - return; - //throw new IOException("您发送请求中的参数中含有非法字符"); - } - String url = req.getRequestURI(); - String path = req.getServletPath(); - if (path.length() > 0) { - path = path.substring(1, path.length()); - } - //获得所有请求参数名 - Enumeration params = req.getParameterNames(); - List sql = new ArrayList<>(); - while (params.hasMoreElements()) { - //得到参数名 - String name = params.nextElement().toString(); - //得到参数对应值 - String[] value = req.getParameterValues(name); - for (int i = 0; i < value.length; i++) { - String[] valueItem = value[i].split(" "); - Collections.addAll(sql, valueItem); - } - } - if (CommUtil.sqlValidate(url, sql)) { - //在获取流对象之前告诉浏览器使用什么字符集 - resp.setCharacterEncoding("utf-8"); - //告诉浏览器,服务器发送的消息体的数据的编码 - resp.setHeader("content-type", "text/html;charset=utf-8"); - resp.setContentType("text/html; charset=UTF-8"); - Result result = Result.failed("您发送的请求未通过验证,建议您检查请求参数和内容。"); - resp.getWriter().print(CommUtil.toJson(result)); - return; - //throw new IOException("您发送请求中的参数中含有非法字符"); - } - /*if(url.contains("PlantEngine_RLD")){ - User cu=(User)req.getSession().getAttribute("cu"); - HttpSession session = req.getSession(true); - session.setAttribute("cu", cu); - resp.sendRedirect("/PlantEngine_RLD/?username="+cu.getName()+"&password="+cu.getPassword()); - return; - }*/ - //检测其它外接系统权限 - boolean passFlag = CommUtil.checkExtSystem(req); - if (req.getParameter("ng") == null && //callback angular2前台请求参数 - url.indexOf("/Login/login.do") < 0 && - url.indexOf("/Login/getToken.do") < 0 && - url.indexOf("/Login/register.do") < 0 && - url.indexOf("/Login/showStatisticalInfo.do") < 0 && - url.indexOf("/Login/validate.do") < 0 && - url.indexOf("/Login/doPass.do") < 0 && - url.indexOf("/Login/doLogin4Name.do") < 0 && - url.indexOf("/Login/doLogin4NameIn.do") < 0 && - url.indexOf("/Login/doFail.do") < 0 && - url.indexOf("/vimage") < 0 && - url.indexOf("/showImg") < 0 && - url.indexOf("/equBIM/") < 0 &&//BIM - url.indexOf("/app/") < 0 && - url.indexOf("/doc.html") < 0 &&//swagger - url.indexOf("/swagger-ui.html") < 0 &&//swagger - url.indexOf("/v2") < 0 && // swagger api json - url.indexOf("/editor-app") < 0 && // swagger api json - url.indexOf("/webjars") < 0 && // swagger api json - url.indexOf("/swagger-resources") < 0 && // swagger api json - url.indexOf("/proapp/") < 0 && - url.indexOf("/msgapp/") < 0 && - url.indexOf("/weChatLogin") < 0 && - url.indexOf("/bindingWeChat") < 0 && - url.indexOf("/alarmMsgService") < 0 && - url.indexOf("/equipmentService") < 0 && - url.indexOf("/services/engineeringService/submitChannels") < 0 && - url.indexOf("/services/engineeringService/getChannels") < 0 && - url.indexOf("/services/engineeringService/getDetailsByChannels") < 0 && - url.indexOf("/services/engineeringService/submitContract") < 0 && - url.indexOf("/services/engineeringService/getContracts") < 0 && - url.indexOf("/sendMsgService") < 0 && - url.indexOf("/base/downloadFile.do") < 0 && - url.indexOf("/equipment/getEquipmentUseRate") < 0 && - url.indexOf("/equipment/getFinishDefectNumber") < 0 && - url.indexOf("/equipment/getEquipmentRunTime") < 0 && - url.indexOf("/equipment/getEquipmentStopRate") < 0 && - url.indexOf("/work/scadaAlarm/getAlarmNumber4Visual") < 0 && - url.indexOf("/equipment/showEquipmentCard") < 0 && - url.indexOf("/equipment/doviewForTongji") < 0 && - //泵性能 - url.indexOf("equipment/pumpAnalysisExternal") < 0 && - //泵组 - url.indexOf("equipment/pump/management") < 0 && - //市政院模型 - url.indexOf("equipment/pump/pumpOneManagementSK") < 0 && - url.indexOf("equipment/pump/managementFS") < 0 && - url.indexOf("equipment/pump/dosageModelSK") < 0 && - - url.indexOf("equipment/getIntactRate") < 0 && - url.indexOf("equipment/getWorkOrderCompletionRate") < 0 && - url.indexOf("equipment/getRepairCount") < 0 && - url.indexOf("equipment/getPatrolRecordCount") < 0 && - - //提供给BIM的 webSocket - url.indexOf("msgWebSocket2") < 0 && - - //提供给Model的 webSocket - url.indexOf("websocketModel") < 0 && - - //根据设备编号返回设备台账单台详情json - url.indexOf("equipment/doviewJson") < 0 && - url.indexOf("equipment/doview4Web") < 0 && - url.indexOf("equipment/doTreeView4Web") < 0 && - url.indexOf("equipment/doTreeView4Web2") < 0 && - url.indexOf("equipment/getList4EquipmentCard") < 0 && - url.indexOf("equipment/equipmentClass/getEquipmentClassJson4Root") < 0 && - //设备总览接口 - url.indexOf("equipment/getEquipmentOverview_") < 0 && - - //巡检记录 - url.indexOf("/timeEfficiency/patrolRecord") < 0 && - - //可视化 - url.indexOf("/process/dataVisualFrame/viewList.do") < 0 &&//数据可视化展示界面 - url.indexOf("/process/dataVisualFrame/view.do") < 0 &&//可视化 - url.indexOf("/process") < 0 &&//可视化 - url.indexOf("/base/getInputFileList.do") < 0 &&//可视化 - - url.indexOf("/efficiency/efficiencyOverview/showView.do") < 0 &&//能效总览 - - //给BIM发送指令 - url.indexOf("/cmd/cmdController") < 0 && - //bim - url.indexOf("/bim/page") < 0 && - url.indexOf("/bim/bimFrame") < 0 && - - url.indexOf("/local/localController") < 0 && - //南市水厂调度 - url.indexOf("/evaluate") < 0 && - // 增城北控液位 - url.indexOf("/third") < 0 && - - //测试 data/db - url.indexOf("/data/db") < 0 && - - //报警外部接口 - //报警插入 - url.indexOf("/alarm/alarmPoint/externalSysAlarm.do") < 0 && - //报警恢复 - url.indexOf("" + - "") < 0 && - - //ios - url.indexOf("/valueEngineering/equipmentEvaluate/showList.do") < 0 &&//设备比较评价 - url.indexOf("/equipment/showEquipmentAge.do") < 0 &&//设备经济寿命查询 - url.indexOf("/valueEngineering/equipmentDepreciation/showList.do") < 0 &&//设备折旧查询 - url.indexOf("/equipment/showEquipmentCard.do") < 0 &&//设备台账 - url.indexOf("/maintenance/showMaintenanceDetailList.do") < 0 &&//维修履历 - url.indexOf("/sparepart/stock/showList.do") < 0 &&//库存查询 - url.indexOf("/sparepart/outStockRecord/showList.do") < 0 &&//出库查询 - url.indexOf("/sparepart/inStockRecord/showList.do") < 0 &&//入库查询 - url.indexOf("/work/scadaAlarm/showlist.do") < 0 &&//设备折旧查询 - url.indexOf("/timeEfficiency/patrolPlan/showCollection.do") < 0 &&//日常巡检查询 - url.indexOf("/equipment/EquipmentScrapApply/showList.do") < 0 &&//设备报废查询 - url.indexOf("/equipment/EquipmentLoseApply/showList.do") < 0 &&//设备丢失查询 - url.indexOf("/data/showCurveTreeView.do") < 0 &&//曲线展示 - url.indexOf("/data/showCurveTree.do") < 0 &&//曲线配置 - url.indexOf("/report/customReport/manageView.do") < 0 &&//报表展示 - url.indexOf("/report/rptCreate/showTree.do") < 0 &&//报表树 - url.indexOf("/plan/getJspWholeInfoByPlanLayoutId.do") < 0 &&//大屏展示 - url.indexOf("/work/dataSummary/sendData.do") < 0 &&//数据汇总 - url.indexOf("/services") < 0 &&//webservices - url.indexOf("/getSSOldOPMData") < 0 &&//上实老OMP数据接受接口 - url.indexOf("/data/showOnlyLineForBIM.do") < 0 &&//BIM曲线展示画面 - url.indexOf("/bim/bIMCurrency/getdata.do") < 0 &&//BIM监测指标数据 - url.indexOf("/bim/BIMCamera/cameraView.do") < 0 &&//BIM摄像头 - url.indexOf("/bim/BIMCamera/getListCamera.do") < 0 &&//BIM摄像头列表 - url.indexOf("/work/scadaAlarm/getAlarmJson.do") < 0 &&//报警数据 - url.indexOf("/msg/sendNewsFromAlarm.do") < 0 &&//发送报警消息 - - url.indexOf("/work/camera/saveCameraAlarmNews.do") < 0 &&//报警存摄像头抓拍信息 - - //南市 - url.indexOf("/mqtt/recordAlarm.do") < 0 &&//危化品报警 - url.indexOf("/mqtt/recordAlarm_xmz.do") < 0 &&//西门子报警 - url.indexOf("/mqtt/getWhLocaMessList.do") < 0 &&//获取当前库位信息 - url.indexOf("/mqtt/addBIMEquTopic.do") < 0 &&//添加单个设备动态主题 - url.indexOf("/mqtt/getRobotData.do") < 0 &&//首次获取机器人数据 - url.indexOf("/mqtt/updateEquipmentCardId.do") < 0 &&//批量修改南市和制水的设备编号关系 - url.indexOf("/mqtt/getStructureSafeLevel.do") < 0 &&//获取 构筑物 安全等级接口 给三维使用 - url.indexOf("/bim/ysAlarmRecord/showList.do") < 0 &&//获取 构筑物 安全等级接口 给三维使用 - url.indexOf("/recordData") < 0 &&//接收第三方的数据接口 - - //上位机 - url.indexOf("/process/processAdjustment/showList.do") < 0 && - url.indexOf("/process/equipmentAdjustment/showList.do") < 0 && - url.indexOf("/maintenance/abnormity/showList4ZK.do") < 0 && - url.indexOf("/maintenance/abnormity/showList_new.do") < 0 && - url.indexOf("/whp/test/WhpSamplingPlanTaskAudit") < 0 && - url.indexOf("/whp/test/WhpSamplingPlanTaskTestConfirm") < 0 && - - url.indexOf("/robot") < 0 && - url.indexOf("/torobot.do") < 0 && - - (url.indexOf("/activiti/workflow/taskList") > 0 || url.indexOf("/activiti") < 0) && - (url.indexOf("/evaluation/show") < 0) && - (url.indexOf("/work") < 0) && - //竹一来访参观 - (url.indexOf("/visit") < 0) && - //模型 - (url.indexOf("/digitalProcess") < 0) && - //市厅展示 - (url.indexOf("/cityHallShow") < 0) && - //应急预案报警 - (url.indexOf("/command/emergencyRecords/doAlarmDown.do") < 0) && - - //wms嵌入的一些页面及数据接口 - (url.indexOf("/modelData") < 0) && - - !passFlag) { - if (req.getHeader("token") != null && !req.getHeader("token").isEmpty()) { - if (SessionManager.isOnline(req)) { - HttpSession session = req.getSession(false); - User cu = SessionManager.getCu(session); - if (CommUtil.menuValidate(cu.getId(), path)) { - fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); - } else { - if (null != session) { - session.invalidate(); - return; - } - } - } else { - boolean offTimeFlag = SessionManager.isOffTime(req, resp); - if (offTimeFlag) { - // resp.setStatus(CommString.ERROR_CODE_SERVER); - resp.setHeader("sessionstatus", "timeout");//在响应头设置session状态 - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code", ErrorCodeEnum.Token_Refresh.getCode()); - jsonObject.put("msg", ErrorCodeEnum.Token_Refresh.getDescription()); - resp.setCharacterEncoding("UTF-8"); - resp.getWriter().println(jsonObject.toString()); - resp.getWriter().flush(); - //fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); - } - return; - } - } else { - HttpSession session = req.getSession(false); - if (SessionManager.isOnline(session)) { - User cu = SessionManager.getCu(session); - if (CommUtil.menuValidate(cu.getId(), path)) { - fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); - } else { - if (null != session) { - session.invalidate(); - return; - } - } - } else { - if (req.getHeader("x-requested-with") == null) { - req.getRequestDispatcher("/timeout.jsp").forward(fi.getRequest(), fi.getResponse()); - } else { - if (req.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")) { - resp.setHeader("sessionstatus", "timeout");//在响应头设置session状态 - resp.setCharacterEncoding("UTF-8"); - resp.getWriter().print("请重新登陆!"); - fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); - } - } - } - } - } else { - fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); - } - } finally { - super.afterInvocation(token, null); - } - } - - public void init(FilterConfig arg0) throws ServletException { - } - - public void destroy() { - - } - - @Override - public Class getSecureObjectClass() { - //下面的MyAccessDecisionManager的supports方面必须放回true,否则会提醒类型错误 - return FilterInvocation.class; - } - - public MySecurityMetadataSource getSecurityMetadataSource() { - return securityMetadataSource; - } - - public void setSecurityMetadataSource( - MySecurityMetadataSource securityMetadataSource) { - this.securityMetadataSource = securityMetadataSource; - } - -} diff --git a/src/com/sipai/security/MySecurityMetadataSource.java b/src/com/sipai/security/MySecurityMetadataSource.java deleted file mode 100644 index ace571ba..00000000 --- a/src/com/sipai/security/MySecurityMetadataSource.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.security; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; - -import org.springframework.security.access.ConfigAttribute; -import org.springframework.security.access.SecurityConfig; -import org.springframework.security.web.FilterInvocation; -import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; -import org.springframework.stereotype.Component; - -import com.sipai.entity.user.Menu; -import com.sipai.service.user.MenuService; - -/** - * 加载资源与权限的对应关系 - */ -@Component -public class MySecurityMetadataSource implements FilterInvocationSecurityMetadataSource { - - @Resource - private MenuService menuService; - - - private static Map> resourceMap = null; - - public Collection getAllConfigAttributes() { - return null; - } - - public boolean supports(Class clazz) { - return true; - } - /** - * @PostConstruct是Java EE 5引入的注解, - * Spring允许开发者在受管Bean中使用它。当DI容器实例化当前受管Bean时, - * @PostConstruct注解的方法会被自动触发,从而完成一些初始化工作, - * - * //加载所有资源与权限的关系 - */ - @PostConstruct - private void loadResourceDefine() { - if (resourceMap == null) { - resourceMap = new HashMap>(); - List list = menuService.selectAll(); - for (Menu resources : list) { - Collection configAttributes = new ArrayList(); - // 通过资源名称来表示具体的权限 注意:必须"ROLE_"开头 - ConfigAttribute configAttribute = new SecurityConfig("ROLE_" + resources.getLocation()); - configAttributes.add(configAttribute); - resourceMap.put(resources.getLocation(), configAttributes); - } - } - } - //返回所请求资源所需要的权限 - public Collection getAttributes(Object object) throws IllegalArgumentException { - String requestUrl = ((FilterInvocation) object).getRequestUrl(); - // System.out.println("requestUrl is " + requestUrl); - if(resourceMap == null) { - loadResourceDefine(); - } - //System.err.println("resourceMap.get(requestUrl); "+resourceMap.get(requestUrl)); - if(requestUrl.indexOf("?")>-1){ - requestUrl=requestUrl.substring(0,requestUrl.indexOf("?")); - } - Collection configAttributes = resourceMap.get(requestUrl); - return configAttributes; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/security/MyUserDetailServiceImpl.java b/src/com/sipai/security/MyUserDetailServiceImpl.java deleted file mode 100644 index 96d72366..00000000 --- a/src/com/sipai/security/MyUserDetailServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.security; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.Resource; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Component; - -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserPower; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.UserService; - - -@Component("myUserDetailService") -public class MyUserDetailServiceImpl implements UserDetailsService{ - - @Resource - private UserService userService; - - @Resource - private MenuService resourcesService; - @Override - public UserDetails loadUserByUsername(String username) - throws UsernameNotFoundException { - List users = userService.selectListByWhere("where name='"+username+"'"); - - if(users ==null || users.size()==0) - throw new UsernameNotFoundException(username+" not exist!"); - Set authSet = new HashSet(); - List list = resourcesService.selectListByUserId(users.get(0).getId()); - for (UserPower r : list) { - authSet.add(new SimpleGrantedAuthority("ROLE_" +r.getLocation())); - } - //密码曾经过md5加密后变大写 - return new org.springframework.security.core.userdetails.User(users.get(0).getId(), - users.get(0).getPassword(), - users.get(0).getActive().equals("1")?true:false, - true, - true, - true, - authSet); - } - -} diff --git a/src/com/sipai/security/MyUsernamePasswordAuthenticationFilter.java b/src/com/sipai/security/MyUsernamePasswordAuthenticationFilter.java deleted file mode 100644 index a4a6ee3b..00000000 --- a/src/com/sipai/security/MyUsernamePasswordAuthenticationFilter.java +++ /dev/null @@ -1,326 +0,0 @@ -package com.sipai.security; - -import com.sipai.entity.base.BasicComponents; -import com.sipai.entity.base.BasicConfigure; -import com.sipai.entity.user.MobileManagement; -import com.sipai.entity.user.User; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.MobileManagementService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import lombok.SneakyThrows; -import org.springframework.security.authentication.AuthenticationServiceException; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; - - -/* - * - * UsernamePasswordAuthenticationFilter源码 - attemptAuthentication - this.getAuthenticationManager() - ProviderManager.java - authenticate(UsernamePasswordAuthenticationToken authRequest) - AbstractUserDetailsAuthenticationProvider.java - authenticate(Authentication authentication) - P155 user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication); - DaoAuthenticationProvider.java - P86 loadUserByUsername - */ -public class MyUsernamePasswordAuthenticationFilter extends UsernamePasswordAuthenticationFilter{ - public static final String VALIDATE_CODE = "verCode"; - public static final String VALIDATE_CODE_2 = "code"; - public static final String VALIDATE_CODE_DATE = "verCodeDate"; - public static final String USERNAME = "j_username"; - public static final String PASSWORD = "j_password"; - public static final String WECHATID = "weChatId"; - public static final String USERNAMELOGIN = "namelogin"; - - @Resource - private LoginService loginService; - @Resource - private UserService userService; - @Resource - private MobileManagementService mobileManagementService; - @Resource - private BasicComponentsService basicComponentsService; - @SneakyThrows - @Override - public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { - //获得所有请求参数名 - String url = request.getRequestURI(); - Enumeration params = request.getParameterNames(); - List sql = new ArrayList<>(); - while (params.hasMoreElements()) { - //得到参数名 - String name = params.nextElement().toString(); - //得到参数对应值 - String[] value = request.getParameterValues(name); - for (int i = 0; i < value.length; i++) { - String[] valueItem = value[i].split(" "); - Collections.addAll(sql,valueItem); - } - } - if (CommUtil.sqlValidate(url,sql)) { - throw new AuthenticationServiceException("您发送的请求未通过验证,建议您检查请求参数和内容。"); - } - if (!request.getMethod().equals("POST")) { - //throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()); - } - String weChatId = obtainWeChatId(request); - String username = obtainUsername(request); - String androidId = obtainandroidId(request); - String password = obtainPassword(request); - // - String namelogin = obtainnamelogin(request); - if(weChatId==null || weChatId.isEmpty()){ - if(namelogin==null || namelogin.isEmpty()){ - //错误次数 - int defaultLockNum = 100; - //自动恢复时间 - int defaultLockTime = 30; - //密码输入错误配置项;配置表BasicComponents中code为login-verCode,代表是否检测密码输入错误的配置项,内容表BasicConfigure的type为0则不检测,为1则检测 。 - List loginLock = basicComponentsService.selectListByWhere("where active='1' and code like '%loginLock%' order by morder "); - if(loginLock!=null && loginLock.size()>0){ - BasicComponents basicComponents = loginLock.get(0); - if(basicComponents!=null && basicComponents.getBasicConfigure()!=null ){ - BasicConfigure basicConfigure = basicComponents.getBasicConfigure(); - if(basicConfigure.getType()!=null && !basicConfigure.getType().isEmpty()){ - String[] loginLocks = basicConfigure.getType().split(","); - if(loginLocks!=null && loginLocks.length>1){ - if(CommUtil.isNumeric(loginLocks[0])){ - defaultLockNum = Integer.valueOf(loginLocks[0]); - } - if(CommUtil.isNumeric(loginLocks[1])){ - defaultLockTime = Integer.valueOf(loginLocks[1]); - } - } - } - } - } - //是否检测验证码,默认检测;配置表BasicComponents中code为login-verCode,代表是否检测验证码的配置项,内容表BasicConfigure的type为0则不检测,为1则检测 。 - boolean checkVerCode = true; - List basicComponents_list = basicComponentsService.selectListByWhere("where active='1' and code like '%login-verCode%' order by morder "); - if(basicComponents_list!=null && basicComponents_list.size()>0){ - BasicComponents basicComponents = basicComponents_list.get(0); - if(basicComponents!=null && basicComponents.getBasicConfigure()!=null ){ - BasicConfigure basicConfigure = basicComponents.getBasicConfigure(); - if(basicConfigure.getType()!=null && !basicConfigure.getType().isEmpty()){ - if(basicConfigure.getType().equals("0")){ - checkVerCode = false; - } - } - } - } - if(checkVerCode){ - //检测验证码 - checkValidateCode(request); - } - //验证用户账号与密码是否对应 - username = username.trim(); - - //User user =loginService.Login(username, password); - User user =loginService.NameLogin(username); - //密码加密 - - int locknum = 0; - //判断账户是否锁定 - if(user!=null - && user.getLgnum() != null - && String.valueOf(user.getLgnum()) != null - && !"".equals(String.valueOf(user.getLgnum()))) { - locknum = user.getLgnum(); - if(locknum>defaultLockNum){ - //判断锁定时间和当前时间,时间默认超过30分钟则解锁 - String nowDate = CommUtil.nowDate(); - String lockTime = user.getLocktime(); - int diff = CommUtil.getDays2(nowDate,lockTime,"min"); - if(diffdefaultLockNum){ - user.setLocktime(CommUtil.nowDate()); - userService.updateUserById(user); - throw new AuthenticationServiceException("该用户已被锁定,请等待"+defaultLockTime+"分钟或者联系管理员!"); - }else{ - throw new AuthenticationServiceException("密码错误,错误"+defaultLockNum+"次将被锁定!"); - } - } - throw new AuthenticationServiceException("用户名或者密码错误!"); - }else { - if(androidId!=null&&!androidId.equals("")){ - List mobileManagements = this.mobileManagementService.selectListByWhere("where deviceid = '"+androidId+"'"); - if(mobileManagements!=null&&mobileManagements.size()==1){ - if(mobileManagements.get(0).getUserId().contains(user.getId())){ - - }else { - throw new AuthenticationServiceException("该设备未关联该用户!"); - } - }else { - throw new AuthenticationServiceException("该设备无权限!"); - } - } - //验证通过清零登录验证 - int resLock = userService.updateByPrimaryKey4Lock(user.getId()); - } - } else{ - List users =userService.selectListByWhere("where name='"+namelogin+"'"); - if(users==null || users.size()==0){ - throw new AuthenticationServiceException("用户未找到!"); - }else { - username=users.get(0).getName(); - password=users.get(0).getPassword(); - } - } - } else{ - List users =userService.selectListByWhere("where wechatid='"+weChatId+"'"); - if(users==null || users.size()==0){ - throw new AuthenticationServiceException("用户尚未进行微信授权注册!"); - }else { - username=users.get(0).getName(); - password=users.get(0).getPassword(); - } - } - - - //UsernamePasswordAuthenticationToken实现 Authentication - UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password); - // Place the last username attempted into HttpSession for views - - // 允许子类设置详细属性 - setDetails(request, authRequest); - - // 运行UserDetailsService的loadUserByUsername 再次封装Authentication - return this.getAuthenticationManager().authenticate(authRequest); - } - - protected void checkValidateCode(HttpServletRequest request){ - HttpSession session = request.getSession(); - - String sessionValidateCode = obtainSessionValidateCode(session); - //让上一次的验证码失效 - session.setAttribute(VALIDATE_CODE, null); - String validateCodeParameter = obtainValidateCodeParameter(request); - String validateCodeParameter2 = obtainValidateCodeParameter2(request); - //System.out.println("validateCodeParameter:"+validateCodeParameter); - //System.out.println("validateCodeParameter2:"+validateCodeParameter2); - if(validateCodeParameter!=null && !validateCodeParameter.isEmpty() && validateCodeParameter2!=null && !validateCodeParameter2.isEmpty() - && CommUtil.isBase64Encode(validateCodeParameter) && CommUtil.isBase64Encode(validateCodeParameter2) ){ - String validateCodeAES = CommUtil.decryptAES(validateCodeParameter,"base64"); - String validateCodeAES2 = "64368180"+CommUtil.decryptAES(validateCodeParameter2,"base64"); - //.out.println("validateCodeAES:"+validateCodeAES); - //System.out.println("validateCodeAES2:"+validateCodeAES2); - if (validateCodeAES!=null && validateCodeAES2!=null) { - if(validateCodeAES2.equals(validateCodeAES)){ - return; - } - } - } - //验证码超时,秒级 - List basicComponents_list = basicComponentsService.selectListByWhere("where active='1' and code like '%login-verCode-overtime%' order by morder "); - if(basicComponents_list!=null && basicComponents_list.size()>0){ - BasicComponents basicComponents = basicComponents_list.get(0); - if(basicComponents!=null && basicComponents.getBasicConfigure()!=null ){ - BasicConfigure basicConfigure = basicComponents.getBasicConfigure(); - if(basicConfigure!=null){ - int overtime = 30; - if(basicConfigure.getType()!=null && !basicConfigure.getType().isEmpty() && CommUtil.isNumeric(basicConfigure.getType())){ - overtime = Integer.parseInt(basicConfigure.getType()); - } - String validateCodeDate = obtainSessionValidateCodeDate(session); - if(!validateCodeDate.isEmpty() &&CommUtil.isBase64Encode(validateCodeDate)){ - String validateCodeDateAES = CommUtil.decryptAES(validateCodeDate,"base64"); - if (validateCodeDateAES!=null) { - int dateDiff = CommUtil.getDays2(CommUtil.nowDate(),validateCodeDateAES,"second"); - //验证码超时 - if (dateDiff>=overtime) { - throw new AuthenticationServiceException("验证码超时"); - } - } - } - } - } - } - - if (validateCodeParameter==null || validateCodeParameter.isEmpty() || !sessionValidateCode.equalsIgnoreCase(validateCodeParameter)) { - throw new AuthenticationServiceException("验证码错误"); - } - } - private String obtainSessionValidateCodeDate(HttpSession session) { - Object obj = session.getAttribute(VALIDATE_CODE_DATE); - return null == obj ? "" : obj.toString(); - } - private String obtainValidateCodeParameter(HttpServletRequest request) { - Object obj = request.getParameter(VALIDATE_CODE); - return null == obj ? "" : obj.toString(); - } - private String obtainValidateCodeParameter2(HttpServletRequest request) { - Object obj = request.getParameter(VALIDATE_CODE_2); - return null == obj ? "" : obj.toString(); - } - private String obtainWeChatId(HttpServletRequest request) { - Object obj = request.getParameter(WECHATID); - return null == obj ? "" : obj.toString(); - } - private String obtainnamelogin(HttpServletRequest request) { - Object obj = request.getParameter(USERNAMELOGIN); - return null == obj ? "" : obj.toString(); - } - protected String obtainSessionValidateCode(HttpSession session) { - Object obj = session.getAttribute(VALIDATE_CODE); - return null == obj ? "" : obj.toString(); - } - - @Override - protected String obtainUsername(HttpServletRequest request) { - Object obj = request.getParameter(USERNAME); - return null == obj ? "" : obj.toString(); - } - protected String obtainandroidId(HttpServletRequest request) { - Object obj = request.getParameter("androidId"); - return null == obj ? "" : obj.toString(); - } - @Override - protected String obtainPassword(HttpServletRequest request) { - Object obj = request.getParameter(PASSWORD); - return null == obj ? "" : obj.toString(); - } - - -} - diff --git a/src/com/sipai/security/tag/AuthorizeTag.java b/src/com/sipai/security/tag/AuthorizeTag.java deleted file mode 100644 index cd750e30..00000000 --- a/src/com/sipai/security/tag/AuthorizeTag.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.security.tag; - -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.jsp.tagext.BodyTagSupport; - - -import org.springframework.security.core.context.SecurityContextImpl; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserPower; -import com.sipai.service.user.MenuService; -import com.sipai.tools.SpringContextUtil; -/** - * 自定义标签 用于前台判断按钮权限 - * @author A - * - */ -public class AuthorizeTag extends BodyTagSupport { - private static final long serialVersionUID = 1L; - - private String buttonUrl; - - public String getButtonUrl() { - return buttonUrl; - } - - - public void setButtonUrl(String buttonUrl) { - this.buttonUrl = buttonUrl; - } - - - @SuppressWarnings("static-access") - @Override - public int doStartTag() { - HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); - SecurityContextImpl securityContextImpl = (SecurityContextImpl) request - .getSession().getAttribute("SPRING_SECURITY_CONTEXT"); - try { - //获取当前登录名 - String name = securityContextImpl.getAuthentication().getName(); -// User cu=(User)request.getSession().getAttribute("cu"); - //如果数据库里有该链接,并且该用户的权限拥有该链接,则显示 。如果数据库没有该链接则不显示 - MenuService resourcesService= (MenuService) SpringContextUtil.getBean("menuService"); - //sqlserver的单引号需要转义 - List query = resourcesService.selectListByWhere("where location='"+buttonUrl.replaceAll("'", "''")+"' "); - boolean flag = true; - if(query!=null && query.size()>0){ - flag = false; - } - /*List queryAll = resourcesService.selectAll(); - for (Menu resources : queryAll) { - if(buttonUrl.equals(resources.getLocation())) - flag = false; - }*/ - if(flag) //数据库中没有该链接,直接显示 - return EVAL_BODY_INCLUDE; - else{ - List resourcesList = resourcesService.selectUserPowerListByWhere("where EmpID = '"+name+"' " - + "and type='func' and location='"+buttonUrl.replaceAll("'", "''")+"' "); - if(resourcesList!=null && resourcesList.size()>0){ - return EVAL_BODY_INCLUDE;//数据库中有该链接,并且该用户拥有该角色,显示 - } - /*List resourcesList = resourcesService.selectFuncByUserId(name); - for (UserPower userPower : resourcesList) { - if(userPower.getLocation() != null && userPower.getLocation().equals(buttonUrl)) { - return EVAL_BODY_INCLUDE;//数据库中有该链接,并且该用户拥有该角色,显示 - } - }*/ - - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return this.SKIP_BODY; //不显示 - } -} diff --git a/src/com/sipai/service/Listener/ListenerHisService.java b/src/com/sipai/service/Listener/ListenerHisService.java deleted file mode 100644 index c863d5ea..00000000 --- a/src/com/sipai/service/Listener/ListenerHisService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.Listener; - -import com.sipai.entity.Listener.ListenerHis; - -import java.util.List; - -public interface ListenerHisService { - - public abstract ListenerHis selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ListenerHis entity); - - public abstract int update(ListenerHis entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectTopByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/Listener/ListenerInterfaceService.java b/src/com/sipai/service/Listener/ListenerInterfaceService.java deleted file mode 100644 index cdc2c9a4..00000000 --- a/src/com/sipai/service/Listener/ListenerInterfaceService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.Listener; - - -import com.sipai.entity.Listener.ListenerInterface; - -import java.util.List; - -public interface ListenerInterfaceService { - - public abstract ListenerInterface selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ListenerInterface entity); - - public abstract int update(ListenerInterface entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/Listener/ListenerMessageService.java b/src/com/sipai/service/Listener/ListenerMessageService.java deleted file mode 100644 index 2e731fbe..00000000 --- a/src/com/sipai/service/Listener/ListenerMessageService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.Listener; - -import com.sipai.entity.Listener.ListenerMessage; - -import java.util.List; - -public interface ListenerMessageService { - - public abstract ListenerMessage selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ListenerMessage entity); - - public abstract int update(ListenerMessage entity); - - public abstract List selectListByWhere(String wherestr); - - //带入设备编号查询 - public abstract List selectListByWhere4Equ(String wherestr, String equipmentId); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/Listener/ListenerPointService.java b/src/com/sipai/service/Listener/ListenerPointService.java deleted file mode 100644 index 209c446a..00000000 --- a/src/com/sipai/service/Listener/ListenerPointService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.Listener; - - -import com.sipai.entity.Listener.ListenerPoint; - -import java.util.List; - -public interface ListenerPointService { - - public abstract ListenerPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ListenerPoint entity); - - public abstract int update(ListenerPoint entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/Listener/impl/ListenerHisServiceImpl.java b/src/com/sipai/service/Listener/impl/ListenerHisServiceImpl.java deleted file mode 100644 index ba342808..00000000 --- a/src/com/sipai/service/Listener/impl/ListenerHisServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.Listener.impl; - -import com.sipai.dao.Listener.ListenerHisDao; -import com.sipai.entity.Listener.ListenerHis; -import com.sipai.service.Listener.ListenerHisService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("listenerHisService") -public class ListenerHisServiceImpl implements ListenerHisService { - - @Resource - public ListenerHisDao listenerHisDao; - - @Override - public ListenerHis selectById(String id) { - ListenerHis listenerHis = listenerHisDao.selectByPrimaryKey(id); - return listenerHis; - } - - @Override - public int deleteById(String id) { - int i = listenerHisDao.deleteByPrimaryKey(id); - return i; - } - - @Override - public int save(ListenerHis entity) { - int insert = listenerHisDao.insert(entity); - return insert; - } - - @Override - public int update(ListenerHis entity) { - int i = listenerHisDao.updateByPrimaryKeySelective(entity); - return i; - } - - @Override - public List selectListByWhere(String wherestr) { - ListenerHis listenerHis = new ListenerHis(); - listenerHis.setWhere(wherestr); - List listenerHiss = listenerHisDao.selectListByWhere(listenerHis); - return listenerHiss; - } - - @Override - public int deleteByWhere(String wherestr) { - ListenerHis listenerHis = new ListenerHis(); - listenerHis.setWhere(wherestr); - int i = listenerHisDao.deleteByWhere(listenerHis); - return i; - } - - @Override - public List selectTopByWhere(String wherestr) { - List listenerHis = listenerHisDao.selectTopByWhere(wherestr); - return listenerHis; - } -} diff --git a/src/com/sipai/service/Listener/impl/ListenerInterfaceServiceImpl.java b/src/com/sipai/service/Listener/impl/ListenerInterfaceServiceImpl.java deleted file mode 100644 index 92b823a1..00000000 --- a/src/com/sipai/service/Listener/impl/ListenerInterfaceServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.Listener.impl; - -import com.sipai.dao.Listener.ListenerInterfaceDao; -import com.sipai.entity.Listener.ListenerInterface; -import com.sipai.service.Listener.ListenerInterfaceService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("listenerInterfaceService") -public class ListenerInterfaceServiceImpl implements ListenerInterfaceService { - - @Resource - public ListenerInterfaceDao listenerInterfaceDao; - - @Override - public ListenerInterface selectById(String id) { - ListenerInterface listenerInterface = listenerInterfaceDao.selectByPrimaryKey(id); - return listenerInterface; - } - - @Override - public int deleteById(String id) { - int i = listenerInterfaceDao.deleteByPrimaryKey(id); - return i; - } - - @Override - public int save(ListenerInterface entity) { - int insert = listenerInterfaceDao.insert(entity); - return insert; - } - - @Override - public int update(ListenerInterface entity) { - int i = listenerInterfaceDao.updateByPrimaryKeySelective(entity); - return i; - } - - @Override - public List selectListByWhere(String wherestr) { - ListenerInterface listenerInterface = new ListenerInterface(); - listenerInterface.setWhere(wherestr); - List listenerInterfaces = listenerInterfaceDao.selectListByWhere(listenerInterface); - return listenerInterfaces; - } - - @Override - public int deleteByWhere(String wherestr) { - ListenerInterface listenerInterface = new ListenerInterface(); - listenerInterface.setWhere(wherestr); - int i = listenerInterfaceDao.deleteByWhere(listenerInterface); - return i; - } -} diff --git a/src/com/sipai/service/Listener/impl/ListenerMessageServiceImpl.java b/src/com/sipai/service/Listener/impl/ListenerMessageServiceImpl.java deleted file mode 100644 index a62e2bdb..00000000 --- a/src/com/sipai/service/Listener/impl/ListenerMessageServiceImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.sipai.service.Listener.impl; - -import com.sipai.dao.Listener.ListenerMessageDao; -import com.sipai.dao.user.CompanyDao; -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.ProcessSectionScore; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.ProcessSectionService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -@Service("listenerMessageService") -public class ListenerMessageServiceImpl implements ListenerMessageService { - - @Resource - ListenerMessageDao listenerMessageDao; - @Resource - private CompanyService companyService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private MPointService mPointService; - - @Override - public ListenerMessage selectById(String id) { - ListenerMessage listenerMessage = listenerMessageDao.selectByPrimaryKey(id); - return listenerMessage; - } - - @Override - public int deleteById(String id) { - int i = listenerMessageDao.deleteByPrimaryKey(id); - return i; - } - - @Override - public int save(ListenerMessage entity) { - int insert = listenerMessageDao.insert(entity); - return insert; - } - - @Override - public int update(ListenerMessage entity) { - int i = listenerMessageDao.updateByPrimaryKeySelective(entity); - return i; - } - - @Override - public List selectListByWhere(String wherestr) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setWhere(wherestr); - List listenerMessages = listenerMessageDao.selectListByWhere(listenerMessage); - for (ListenerMessage entity : listenerMessages) { - - MPoint mPoint = mPointService.selectById(entity.getObjid()); - if (mPoint != null) { - entity.setmPoint(mPoint); - Company company = companyService.selectByPrimaryKey(mPoint.getBizid()); - entity.setCompany(company); - } - } - return listenerMessages; - } - - @Override - public List selectListByWhere4Equ(String wherestr, String equipmentId) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setWhere(wherestr); - List listenerMessages = listenerMessageDao.selectListByWhere(listenerMessage); - List listenerMessages2 = new ArrayList<>(); - for (int i = 0; i < listenerMessages.size(); i++) { - MPoint mPoint = mPointService.selectById(listenerMessages.get(i).getObjid()); - if (mPoint != null && mPoint.getEquipmentid().equals(equipmentId)) { - listenerMessages2.add(listenerMessages.get(i)); - } - } - for (ListenerMessage entity : listenerMessages2) { - MPoint mPoint = mPointService.selectById(entity.getObjid()); - if (mPoint != null) { - entity.setmPoint(mPoint); - Company company = companyService.selectByPrimaryKey(mPoint.getBizid()); - entity.setCompany(company); - } - } - return listenerMessages2; - } - - @Override - public int deleteByWhere(String wherestr) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setWhere(wherestr); - int i = listenerMessageDao.deleteByWhere(listenerMessage); - return i; - } -} diff --git a/src/com/sipai/service/Listener/impl/ListenerPointServiceImpl.java b/src/com/sipai/service/Listener/impl/ListenerPointServiceImpl.java deleted file mode 100644 index f2297059..00000000 --- a/src/com/sipai/service/Listener/impl/ListenerPointServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.Listener.impl; - -import com.sipai.dao.Listener.ListenerPointDao; -import com.sipai.entity.Listener.ListenerPoint; -import com.sipai.service.Listener.ListenerPointService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("listenerPointService") -public class ListenerPointServiceImpl implements ListenerPointService { - - @Resource - ListenerPointDao listenerPointDao; - - @Override - public ListenerPoint selectById(String id) { - ListenerPoint listenerPoint = listenerPointDao.selectByPrimaryKey(id); - return listenerPoint; - } - - @Override - public int deleteById(String id) { - int i = listenerPointDao.deleteByPrimaryKey(id); - return i; - } - - @Override - public int save(ListenerPoint entity) { - int insert = listenerPointDao.insert(entity); - return insert; - } - - @Override - public int update(ListenerPoint entity) { - int i = listenerPointDao.updateByPrimaryKeySelective(entity); - return i; - } - - @Override - public List selectListByWhere(String wherestr) { - ListenerPoint listenerPoint = new ListenerPoint(); - listenerPoint.setWhere(wherestr); - List listenerPoints = listenerPointDao.selectListByWhere(listenerPoint); - return listenerPoints; - } - - @Override - public int deleteByWhere(String wherestr) { - ListenerPoint listenerPoint = new ListenerPoint(); - listenerPoint.setWhere(wherestr); - int i = listenerPointDao.deleteByWhere(listenerPoint); - return i; - } -} diff --git a/src/com/sipai/service/access/AccessAlarmHistoryService.java b/src/com/sipai/service/access/AccessAlarmHistoryService.java deleted file mode 100644 index 3350824a..00000000 --- a/src/com/sipai/service/access/AccessAlarmHistoryService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.access; - -import com.sipai.entity.access.AccessAlarmHistory; - -import java.util.List; - -public interface AccessAlarmHistoryService { - - public abstract AccessAlarmHistory selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AccessAlarmHistory entity); - - public abstract int update(AccessAlarmHistory entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/access/AccessAlarmSettingService.java b/src/com/sipai/service/access/AccessAlarmSettingService.java deleted file mode 100644 index c9a81819..00000000 --- a/src/com/sipai/service/access/AccessAlarmSettingService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.access; - -import com.sipai.entity.access.AccessAlarmSetting; - -import java.util.List; - -public interface AccessAlarmSettingService { - - public abstract AccessAlarmSetting selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AccessAlarmSetting entity); - - public abstract int update(AccessAlarmSetting entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/access/AccessEigenHistoryService.java b/src/com/sipai/service/access/AccessEigenHistoryService.java deleted file mode 100644 index 587b8fe2..00000000 --- a/src/com/sipai/service/access/AccessEigenHistoryService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.access; - -import com.sipai.entity.access.AccessEigenHistory; - -import java.util.List; - -public interface AccessEigenHistoryService { - - public abstract AccessEigenHistory selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AccessEigenHistory entity); - - public abstract int update(AccessEigenHistory entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/access/AccessRealDataService.java b/src/com/sipai/service/access/AccessRealDataService.java deleted file mode 100644 index 7767eaf8..00000000 --- a/src/com/sipai/service/access/AccessRealDataService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.access; - -import com.sipai.entity.access.AccessRealData; - -import java.util.List; - -public interface AccessRealDataService { - - public abstract AccessRealData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AccessRealData entity); - - public abstract int update(AccessRealData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/access/impl/AccessAlarmHistoryServiceImpl.java b/src/com/sipai/service/access/impl/AccessAlarmHistoryServiceImpl.java deleted file mode 100644 index d33b6162..00000000 --- a/src/com/sipai/service/access/impl/AccessAlarmHistoryServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.service.access.impl; - -import com.sipai.dao.access.AccessAlarmHistoryDao; -import com.sipai.entity.access.AccessAlarmHistory; -import com.sipai.service.access.AccessAlarmHistoryService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class AccessAlarmHistoryServiceImpl implements AccessAlarmHistoryService { - @Resource - private AccessAlarmHistoryDao accessAlarmHistoryDao; - - @Override - public AccessAlarmHistory selectById(String id) { - return accessAlarmHistoryDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return 0; - } - - @Override - public int save(AccessAlarmHistory entity) { - return accessAlarmHistoryDao.insert(entity); - } - - @Override - public int update(AccessAlarmHistory entity) { - return 0; - } - - @Override - public List selectListByWhere(String wherestr) { - return null; - } - - @Override - public int deleteByWhere(String wherestr) { - return 0; - } -} diff --git a/src/com/sipai/service/access/impl/AccessAlarmSettingServiceImpl.java b/src/com/sipai/service/access/impl/AccessAlarmSettingServiceImpl.java deleted file mode 100644 index 9afbefe9..00000000 --- a/src/com/sipai/service/access/impl/AccessAlarmSettingServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.service.access.impl; - -import com.sipai.dao.access.AccessAlarmSettingDao; -import com.sipai.entity.access.AccessAlarmSetting; -import com.sipai.service.access.AccessAlarmSettingService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class AccessAlarmSettingServiceImpl implements AccessAlarmSettingService { - @Resource - private AccessAlarmSettingDao accessAlarmSettingDao; - - @Override - public AccessAlarmSetting selectById(String id) { - return accessAlarmSettingDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return 0; - } - - @Override - public int save(AccessAlarmSetting entity) { - return accessAlarmSettingDao.insert(entity); - } - - @Override - public int update(AccessAlarmSetting entity) { - return 0; - } - - @Override - public List selectListByWhere(String wherestr) { - return null; - } - - @Override - public int deleteByWhere(String wherestr) { - return 0; - } -} diff --git a/src/com/sipai/service/access/impl/AccessEigenHistoryServiceImpl.java b/src/com/sipai/service/access/impl/AccessEigenHistoryServiceImpl.java deleted file mode 100644 index 470acdd5..00000000 --- a/src/com/sipai/service/access/impl/AccessEigenHistoryServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.service.access.impl; - -import com.sipai.dao.access.AccessEigenHistoryDao; -import com.sipai.entity.access.AccessEigenHistory; -import com.sipai.service.access.AccessEigenHistoryService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class AccessEigenHistoryServiceImpl implements AccessEigenHistoryService { - @Resource - private AccessEigenHistoryDao accessEigenHistoryDao; - - @Override - public AccessEigenHistory selectById(String id) { - return accessEigenHistoryDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return 0; - } - - @Override - public int save(AccessEigenHistory entity) { - return accessEigenHistoryDao.insert(entity); - } - - @Override - public int update(AccessEigenHistory entity) { - return 0; - } - - @Override - public List selectListByWhere(String wherestr) { - return null; - } - - @Override - public int deleteByWhere(String wherestr) { - return 0; - } -} diff --git a/src/com/sipai/service/access/impl/AccessRealDataServiceImpl.java b/src/com/sipai/service/access/impl/AccessRealDataServiceImpl.java deleted file mode 100644 index 3e667884..00000000 --- a/src/com/sipai/service/access/impl/AccessRealDataServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.service.access.impl; - -import com.sipai.dao.access.AccessRealDataDao; -import com.sipai.entity.access.AccessRealData; -import com.sipai.service.access.AccessRealDataService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -@Service -public class AccessRealDataServiceImpl implements AccessRealDataService { - @Resource - private AccessRealDataDao accessRealDataDao; - - @Override - public AccessRealData selectById(String id) { - return accessRealDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return 0; - } - - @Override - public int save(AccessRealData entity) { - return accessRealDataDao.insert(entity); - } - - @Override - public int update(AccessRealData entity) { - return 0; - } - - @Override - public List selectListByWhere(String wherestr) { - return null; - } - - @Override - public int deleteByWhere(String wherestr) { - return 0; - } -} diff --git a/src/com/sipai/service/accident/AccidentService.java b/src/com/sipai/service/accident/AccidentService.java deleted file mode 100644 index 23c5e7ba..00000000 --- a/src/com/sipai/service/accident/AccidentService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.accident; - -import java.util.List; - -import com.sipai.entity.accident.Accident; - -public interface AccidentService { - - public abstract Accident selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(Accident accident); - - public abstract int update(Accident accident); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/accident/AccidentTypeService.java b/src/com/sipai/service/accident/AccidentTypeService.java deleted file mode 100644 index ce5a2d3e..00000000 --- a/src/com/sipai/service/accident/AccidentTypeService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.accident; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.accident.AccidentType; - -public interface AccidentTypeService { - - public abstract AccidentType selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AccidentType accidentType); - - public abstract int update(AccidentType accidentType); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeList(List> list_result, List list); -} diff --git a/src/com/sipai/service/accident/ReasonableAdviceService.java b/src/com/sipai/service/accident/ReasonableAdviceService.java deleted file mode 100644 index fec4d05b..00000000 --- a/src/com/sipai/service/accident/ReasonableAdviceService.java +++ /dev/null @@ -1,375 +0,0 @@ -package com.sipai.service.accident; - -import com.sipai.dao.accident.ReasonableAdviceDao; -import com.sipai.entity.accident.AccidentCommString; -import com.sipai.entity.accident.ReasonableAdvice; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class ReasonableAdviceService implements CommService { - @Resource - private ReasonableAdviceDao reasonableAdviceDao; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - - @Override - public ReasonableAdvice selectById(String id) { - ReasonableAdvice reasonableAdvice = reasonableAdviceDao.selectByPrimaryKey(id); - if (null != reasonableAdvice.getAuditManId() && !reasonableAdvice.getAuditManId().isEmpty()) { - String auditManName = this.userService.getUserNamesByUserIds(reasonableAdvice.getAuditManId()); - reasonableAdvice.setAuditManName(auditManName); - } - return reasonableAdvice; - } - - @Override - public int deleteById(String id) { - return reasonableAdviceDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ReasonableAdvice entity) { - return reasonableAdviceDao.insert(entity); - } - - @Override - public int update(ReasonableAdvice entity) { - return reasonableAdviceDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ReasonableAdvice reasonableAdvice = new ReasonableAdvice(); - reasonableAdvice.setWhere(wherestr); - List list = this.reasonableAdviceDao.selectListByWhere(reasonableAdvice); - for (ReasonableAdvice item : list) { - item.setCaption(this.userService.getUserNamesByUserIds(item.getUserLead())); - item.setCompany(this.unitService.getCompById(item.getUnitId())); - if (null != item.getAuditManId() && !item.getAuditManId().isEmpty()) { - String auditManName = this.userService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ReasonableAdvice reasonableAdvice = new ReasonableAdvice(); - reasonableAdvice.setWhere(wherestr); - return reasonableAdviceDao.deleteByWhere(reasonableAdvice); - } - - public void downloadExcel(HttpServletResponse response, List list) throws IOException { - String fileName = "合理化建议" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "合理化建议"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - sheet.setColumnWidth(9, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 -// String excelTitleStr = this.getExcelStr("ExcelTiele"); -// String[] excelTitle = excelTitleStr.split(","); - String[] excelTitle = {"序号", "部门", "建议类型", "建议名称", "建议人", "建议内容", "辅议人", "日期", "审核意见", "状态"}; - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("合理化建议"); - //遍历集合数据,产生数据行 - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(i + 2);//第二行为插入的数据行 - row.setHeight((short) 600); - ReasonableAdvice reasonableAdvice = list.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - break; - case 1://部门 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - Company company = this.unitService.getCompById(reasonableAdvice.getUnitId()); - if (null != company) { - cell_1.setCellValue(company.getName()); - } else { - cell_1.setCellValue(""); - } - break; - case 2://建议类型 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(reasonableAdvice.getAdvice_type()); - break; - case 3://建议名称 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(reasonableAdvice.getName()); - break; - case 4://建议人 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - String[] userleadid = reasonableAdvice.getUserLead().split(","); - String solvername = ""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user != null) { - solvername += user.getCaption() + ","; - } - } - cell_4.setCellValue(solvername); - break; - case 5://建议内容 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(reasonableAdvice.getContent()); - case 6://建议人 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - String[] usershelpid = reasonableAdvice.getUsersHelp().split(","); - String solvername1 = ""; - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user != null) { - solvername1 += user.getCaption() + ","; - } - } - cell_6.setCellValue(solvername1); - break; - case 7://riqi - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(reasonableAdvice.getInsdt()); - break; - case 8://审核意见 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(reasonableAdvice.getAuditContent()); - break; - case 9://状态 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(reasonableAdvice.getTakeFlag()); - break; - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 根据当前任务节点更新运维详情状态 - */ - public int updateStatus(String id, boolean passstatus) { - ReasonableAdvice reasonableAdvice = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(reasonableAdvice.getProcessid()).list(); - if (task != null && task.size() > 0) { - reasonableAdvice.setTakeFlag(task.get(0).getName()); - } else { - //检验通过 - if (passstatus) { - reasonableAdvice.setTakeFlag(AccidentCommString.STATUS_RA_FINISH); - } - //检验不通过 - else { - reasonableAdvice.setTakeFlag(AccidentCommString.STATUS_RA_FAIL); - } - } - int res = this.update(reasonableAdvice); - return res; - } - - /** - * 启动药剂登记审核流程 - * - * @param - * @return - */ - @Transactional - public int startProcess(ReasonableAdvice reasonableAdvice) { - try { - Map variables = new HashMap(); - if (!reasonableAdvice.getAuditManId().isEmpty()) { - variables.put("userIds", reasonableAdvice.getAuditManId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Reasonable_Advice.getId() + "-" + reasonableAdvice.getUnitId()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(reasonableAdvice.getId(), reasonableAdvice.getUserLead(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - reasonableAdvice.setProcessid(processInstance.getId()); - reasonableAdvice.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = this.update(reasonableAdvice); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(reasonableAdvice); - businessUnitRecord.sendMessage(reasonableAdvice.getAuditManId(), ""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 药剂登记审核 - * - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid(), entity.getPassstatus()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } -} \ No newline at end of file diff --git a/src/com/sipai/service/accident/RoastService.java b/src/com/sipai/service/accident/RoastService.java deleted file mode 100644 index b9f57817..00000000 --- a/src/com/sipai/service/accident/RoastService.java +++ /dev/null @@ -1,421 +0,0 @@ -package com.sipai.service.accident; - -import com.sipai.dao.accident.RoastDao; -import com.sipai.entity.accident.AccidentCommString; -import com.sipai.entity.accident.Roast; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class RoastService implements CommService { - @Resource - private RoastDao roastDao; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - - @Override - public Roast selectById(String id) { - Roast roast = roastDao.selectByPrimaryKey(id); - if (null != roast.getAuditManId() && !roast.getAuditManId().isEmpty()) { - String auditManName = this.userService.getUserNamesByUserIds(roast.getAuditManId()); - roast.setAuditManName(auditManName); - } - return roast; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - Roast roast = roastDao.selectByPrimaryKey(id); - if (roast != null) { - //清除对应的流程 - String pInstancId = roast.getProcessid(); - if (pInstancId != null) { - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + roast.getId() + "'"); - } - } - return roastDao.deleteByPrimaryKey(id); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public int save(Roast entity) { - return roastDao.insert(entity); - } - - @Override - public int update(Roast entity) { - return roastDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Roast roast = new Roast(); - roast.setWhere(wherestr); - List list = this.roastDao.selectListByWhere(roast); - for (Roast item : list) { - item.setCaption(this.userService.getUserNamesByUserIds(item.getUserLead())); - item.setCompany(this.unitService.getCompById(item.getUnitId())); - if (null != item.getAuditManId() && !item.getAuditManId().isEmpty()) { - String auditManName = this.userService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Roast roast = new Roast(); - roast.setWhere(wherestr); - return roastDao.deleteByWhere(roast); - } - - public void downloadExcel(HttpServletResponse response, List list) throws IOException { - String fileName = "合理化建议" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "合理化建议"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - sheet.setColumnWidth(9, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 -// String excelTitleStr = this.getExcelStr("ExcelTiele"); -// String[] excelTitle = excelTitleStr.split(","); - String[] excelTitle = {"序号", "部门", "建议类型", "建议名称", "建议人", "建议内容", "辅议人", "日期", "审核意见", "状态"}; - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("合理化建议"); - //遍历集合数据,产生数据行 - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(i + 2);//第二行为插入的数据行 - row.setHeight((short) 600); - Roast roast = list.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - break; - case 1://部门 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - Company company = this.unitService.getCompById(roast.getUnitId()); - if (null != company) { - cell_1.setCellValue(company.getName()); - } else { - cell_1.setCellValue(""); - } - break; - case 2://建议类型 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(roast.getAdvice_type()); - break; - case 3://建议名称 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(roast.getName()); - break; - case 4://建议人 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - String[] userleadid = roast.getUserLead().split(","); - String solvername = ""; - for (String lid : userleadid) { - User user = this.userService.getUserById(lid); - if (user != null) { - solvername += user.getCaption() + ","; - } - } - cell_4.setCellValue(solvername); - break; - case 5://建议内容 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(roast.getContent()); - case 6://建议人 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - String[] usershelpid = roast.getUsersHelp().split(","); - String solvername1 = ""; - for (String hid : usershelpid) { - User user = this.userService.getUserById(hid); - if (user != null) { - solvername1 += user.getCaption() + ","; - } - } - cell_6.setCellValue(solvername1); - break; - case 7://riqi - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(roast.getInsdt()); - break; - case 8://审核意见 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(roast.getAuditContent()); - break; - case 9://状态 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(roast.getTakeFlag()); - break; - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 根据当前任务节点更新运维详情状态 - */ - public int updateStatus(String id, boolean passstatus) { - Roast roast = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(roast.getProcessid()).list(); - if (task != null && task.size() > 0) { - roast.setTakeFlag(task.get(0).getName()); - } else { - //检验通过 - if (passstatus) { - roast.setTakeFlag(AccidentCommString.STATUS_RA_FINISH); - } - //检验不通过 - else { - roast.setTakeFlag(AccidentCommString.STATUS_RA_FAIL); - } - } - int res = this.update(roast); - return res; - } - - /** - * 启动药剂登记审核流程 - * - * @param - * @return - */ - @Transactional - public int startProcess(Roast roast) { - try { - Map variables = new HashMap(); - if (!roast.getAuditManId().isEmpty()) { - variables.put("userIds", roast.getAuditManId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Roast.getId() + "-" + roast.getUnitId()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } -// ProcessInstance processInstance = workflowService.startWorkflow(roast.getId(), roast.getUserLead(), processDefinitions.get(0).getKey(), variables); - ProcessInstance processInstance = workflowService.startWorkflow(roast.getId(), roast.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - roast.setProcessid(processInstance.getId()); - roast.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = this.update(roast); - if (res == 1) { - - if (roast.getAuditManId() != null && !roast.getAuditManId().equals("")) { - String str = roast.getAuditManId(); - boolean status = str.contains(","); - if (status) { - //选择多人 - String[] userId = str.split(","); - for (int i = 0; i < userId.length; i++) { - //发送消息 - roast.setAuditManId(userId[i]);//选择多人也每次赋值一个人 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(roast); - businessUnitRecord.sendMessage(userId[i], ""); - } - } else { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(roast); - businessUnitRecord.sendMessage(roast.getAuditManId(), ""); - } - } - - //发送消息 -// BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(roast); -// businessUnitRecord.sendMessage(roast.getAuditManId(), ""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 药剂登记审核 - * - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid(), entity.getPassstatus()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } -} \ No newline at end of file diff --git a/src/com/sipai/service/accident/impl/AccidentServiceImpl.java b/src/com/sipai/service/accident/impl/AccidentServiceImpl.java deleted file mode 100644 index 29fceb94..00000000 --- a/src/com/sipai/service/accident/impl/AccidentServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.service.accident.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.accident.AccidentDao; -import com.sipai.entity.accident.Accident; -import com.sipai.service.accident.AccidentService; -import com.sipai.service.accident.AccidentTypeService; -import com.sipai.service.user.UserService; - -@Service -public class AccidentServiceImpl implements AccidentService { - @Resource - private AccidentDao accidentDao; - @Resource - private AccidentTypeService accidentTypeService; - @Resource - private UserService userService; - - @Override - public Accident selectById(String id) { - Accident accident = this.accidentDao.selectByPrimaryKey(id); - accident.setAccidentType(this.accidentTypeService.selectById(accident.getAccidentTypeId())); - return accident; - } - - @Override - public int deleteById(String id) { - int code = this.accidentDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(Accident accident) { - int code = this.accidentDao.insert(accident); - return code; - } - - @Override - public int update(Accident accident) { - int code = this.accidentDao.updateByPrimaryKeySelective(accident); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - Accident accident = new Accident(); - accident.setWhere(wherestr); - List list = this.accidentDao.selectListByWhere(accident); - for (Accident item : list) { - item.setAccidentType(this.accidentTypeService.selectById(item.getAccidentTypeId())); - item.setUser(this.userService.getUserById(item.getInsuser())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Accident accident = new Accident(); - accident.setWhere(wherestr); - int code = this.accidentDao.deleteByWhere(accident); - return code; - } - -} diff --git a/src/com/sipai/service/accident/impl/AccidentTypeServiceImpl.java b/src/com/sipai/service/accident/impl/AccidentTypeServiceImpl.java deleted file mode 100644 index 34e12de9..00000000 --- a/src/com/sipai/service/accident/impl/AccidentTypeServiceImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.service.accident.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.accident.AccidentTypeDao; -import com.sipai.entity.accident.AccidentType; -import com.sipai.service.accident.AccidentTypeService; - -@Service -public class AccidentTypeServiceImpl implements AccidentTypeService { - @Resource - private AccidentTypeDao accidentTypeDao; - - @Override - public AccidentType selectById(String id) { - AccidentType accidentType = this.accidentTypeDao.selectByPrimaryKey(id); - return accidentType; - } - - @Override - public int deleteById(String id) { - int code = this.accidentTypeDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(AccidentType accidentType) { - int code = this.accidentTypeDao.insert(accidentType); - return code; - } - - @Override - public int update(AccidentType accidentType) { - int code = this.accidentTypeDao.updateByPrimaryKeySelective(accidentType); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - AccidentType accidentType = new AccidentType(); - accidentType.setWhere(wherestr); - List list = this.accidentTypeDao.selectListByWhere(accidentType); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AccidentType accidentType = new AccidentType(); - accidentType.setWhere(wherestr); - int code = this.accidentTypeDao.deleteByWhere(accidentType); - return code; - } - - @Override - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (AccidentType k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (AccidentType k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelDataService.java b/src/com/sipai/service/achievement/AcceptanceModelDataService.java deleted file mode 100644 index 40e95a8c..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import com.sipai.entity.achievement.AcceptanceModelData; - -public interface AcceptanceModelDataService { - - public abstract AcceptanceModelData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelData entity); - - public abstract int update(AcceptanceModelData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelMPointService.java b/src/com/sipai/service/achievement/AcceptanceModelMPointService.java deleted file mode 100644 index 1bb35aa5..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelMPointService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; - -import com.sipai.entity.achievement.AcceptanceModelMPoint; - -public interface AcceptanceModelMPointService { - - public abstract AcceptanceModelMPoint selectById(String unitId, String id); - - public abstract AcceptanceModelMPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelMPoint entity); - - public abstract int update(AcceptanceModelMPoint entity); - - public abstract List selectListByWhere(String unitId, String wherestr); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelOutputDataService.java b/src/com/sipai/service/achievement/AcceptanceModelOutputDataService.java deleted file mode 100644 index ff865475..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelOutputDataService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; - -import com.sipai.entity.achievement.AcceptanceModelOutputData; - -public interface AcceptanceModelOutputDataService { - - public abstract AcceptanceModelOutputData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelOutputData entity); - - public abstract int update(AcceptanceModelOutputData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelOutputService.java b/src/com/sipai/service/achievement/AcceptanceModelOutputService.java deleted file mode 100644 index f0841624..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelOutputService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; - -import com.sipai.entity.achievement.AcceptanceModelOutput; - -public interface AcceptanceModelOutputService { - - public abstract AcceptanceModelOutput selectById(String unitId, String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelOutput acceptanceModelOutput); - - public abstract int update(AcceptanceModelOutput acceptanceModelOutput); - - public abstract List selectListByWhere(String unitId, String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelRecordService.java b/src/com/sipai/service/achievement/AcceptanceModelRecordService.java deleted file mode 100644 index d93f68cc..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelRecordService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import com.sipai.entity.achievement.AcceptanceModelRecord; - -public interface AcceptanceModelRecordService { - - public abstract AcceptanceModelRecord selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelRecord entity); - - public abstract int update(AcceptanceModelRecord entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelService.java b/src/com/sipai/service/achievement/AcceptanceModelService.java deleted file mode 100644 index 46f4da0f..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import com.sipai.entity.achievement.AcceptanceModel; - -public interface AcceptanceModelService { - - public abstract AcceptanceModel selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModel entity); - - public abstract int update(AcceptanceModel entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeList(List> list_result, List list); - -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelTextDataService.java b/src/com/sipai/service/achievement/AcceptanceModelTextDataService.java deleted file mode 100644 index e9e2e067..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelTextDataService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; - -import com.sipai.entity.achievement.AcceptanceModelTextData; - -public interface AcceptanceModelTextDataService { - - public abstract AcceptanceModelTextData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelTextData entity); - - public abstract int update(AcceptanceModelTextData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/achievement/AcceptanceModelTextService.java b/src/com/sipai/service/achievement/AcceptanceModelTextService.java deleted file mode 100644 index c6ef3f89..00000000 --- a/src/com/sipai/service/achievement/AcceptanceModelTextService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.achievement; - -import java.util.List; - -import com.sipai.entity.achievement.AcceptanceModelText; - -public interface AcceptanceModelTextService { - - public abstract AcceptanceModelText selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AcceptanceModelText entity); - - public abstract int update(AcceptanceModelText entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/achievement/ModelLibraryService.java b/src/com/sipai/service/achievement/ModelLibraryService.java deleted file mode 100644 index c84d8234..00000000 --- a/src/com/sipai/service/achievement/ModelLibraryService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.achievement; - -import com.sipai.entity.achievement.ModelLibrary; - -import java.util.List; -import java.util.Map; - -public interface ModelLibraryService { - public abstract ModelLibrary selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ModelLibrary entity); - - public abstract int update(ModelLibrary entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTree(List> list_result, List list); -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelDataServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelDataServiceImpl.java deleted file mode 100644 index 54ce7971..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelDataServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelDataDao; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.achievement.AcceptanceModelData; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.achievement.AcceptanceModelRecord; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.achievement.AcceptanceModelDataService; -import com.sipai.service.achievement.AcceptanceModelMPointService; -import com.sipai.service.achievement.AcceptanceModelRecordService; -import com.sipai.service.achievement.AcceptanceModelService; -import com.sipai.service.scada.MPointService; - -@Service -public class AcceptanceModelDataServiceImpl implements AcceptanceModelDataService { - @Resource - private AcceptanceModelDataDao acceptanceModelDataDao; - @Resource - private MPointService mPointService; - @Resource - private AcceptanceModelRecordService acceptanceModelRecordService; - @Resource - private AcceptanceModelService acceptanceModelService; - @Resource - private AcceptanceModelMPointService acceptanceModelMPointService; - - @Override - public AcceptanceModelData selectById(String id) { - return this.acceptanceModelDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModelData entity) { - return this.acceptanceModelDataDao.insert(entity); - } - - @Override - public int update(AcceptanceModelData entity) { - return this.acceptanceModelDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - - AcceptanceModelData acceptanceModelData = new AcceptanceModelData(); - acceptanceModelData.setWhere(wherestr); - List ps=acceptanceModelDataDao.selectListByWhere(acceptanceModelData); - for (AcceptanceModelData item : ps) { - AcceptanceModelRecord acceptanceModelRecord = acceptanceModelRecordService.selectById(item.getPid()); - AcceptanceModel acceptanceModel = acceptanceModelService.selectById(acceptanceModelRecord.getPid()); - MPoint mPoint = mPointService.selectById(acceptanceModel.getUnitId(),item.getMpid()); - if(mPoint!=null){ - item.setmPoint(mPoint); - } - AcceptanceModelMPoint acceptanceModelMPoint = acceptanceModelMPointService.selectById(item.getModeMPld()); - if(acceptanceModelMPoint!=null){ - item.setAcceptanceModelMPoint(acceptanceModelMPoint); - } - } - return ps; -// AcceptanceModelData acceptanceModel = new AcceptanceModelData(); -// acceptanceModel.setWhere(wherestr); -// List list = this.acceptanceModelDataDao.selectListByWhere(acceptanceModel); -// return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelData acceptanceModelData = new AcceptanceModelData(); - acceptanceModelData.setWhere(wherestr); - return this.acceptanceModelDataDao.deleteByWhere(acceptanceModelData); - } -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelMPointServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelMPointServiceImpl.java deleted file mode 100644 index 4d337105..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelMPointServiceImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelMPointDao; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.service.achievement.AcceptanceModelMPointService; -import com.sipai.service.scada.MPointService; - -@Service -public class AcceptanceModelMPointServiceImpl implements AcceptanceModelMPointService { - @Resource - private AcceptanceModelMPointDao acceptanceModelMPointDao; - @Resource - private MPointService mPointService; - - @Override - public AcceptanceModelMPoint selectById(String unitId, String id) { - AcceptanceModelMPoint acceptanceModelMPoint = this.acceptanceModelMPointDao.selectByPrimaryKey(id); - if (acceptanceModelMPoint!=null) { - acceptanceModelMPoint.setmPoint(this.mPointService.selectById(unitId, acceptanceModelMPoint.getMpointId())); - } - return acceptanceModelMPoint; - } - - @Override - public AcceptanceModelMPoint selectById(String id) { - AcceptanceModelMPoint acceptanceModelMPoint = this.acceptanceModelMPointDao.selectByPrimaryKey(id); - return acceptanceModelMPoint; - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelMPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModelMPoint entity) { - return this.acceptanceModelMPointDao.insert(entity); - } - - @Override - public int update(AcceptanceModelMPoint entity) { - return this.acceptanceModelMPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String unitId, String wherestr) { - AcceptanceModelMPoint acceptanceModelMPoint = new AcceptanceModelMPoint(); - acceptanceModelMPoint.setWhere(wherestr); - List list = this.acceptanceModelMPointDao.selectListByWhere(acceptanceModelMPoint); - if (list!=null&&list.size()>0) { - for (AcceptanceModelMPoint item : list) { - item.setmPoint(this.mPointService.selectById(unitId, item.getMpointId())); - } - } - return list; - } - - @Override - public List selectListByWhere(String wherestr) { - AcceptanceModelMPoint acceptanceModelMPoint = new AcceptanceModelMPoint(); - acceptanceModelMPoint.setWhere(wherestr); - List list = this.acceptanceModelMPointDao.selectListByWhere(acceptanceModelMPoint); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelMPoint acceptanceModelMPoint = new AcceptanceModelMPoint(); - acceptanceModelMPoint.setWhere(wherestr); - return this.acceptanceModelMPointDao.deleteByWhere(acceptanceModelMPoint); - } -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelOutputDataServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelOutputDataServiceImpl.java deleted file mode 100644 index 46633041..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelOutputDataServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelOutputDataDao; -import com.sipai.entity.achievement.AcceptanceModelOutputData; -import com.sipai.service.achievement.AcceptanceModelOutputDataService; - -@Service -public class AcceptanceModelOutputDataServiceImpl implements AcceptanceModelOutputDataService { - @Resource - private AcceptanceModelOutputDataDao acceptanceModelOutputDataDao; - - @Override - public AcceptanceModelOutputData selectById(String id) { - AcceptanceModelOutputData acceptanceModelOutputData = this.acceptanceModelOutputDataDao.selectByPrimaryKey(id); - return acceptanceModelOutputData; - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelOutputDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModelOutputData entity) { - return this.acceptanceModelOutputDataDao.insert(entity); - } - - @Override - public int update(AcceptanceModelOutputData entity) { - return this.acceptanceModelOutputDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AcceptanceModelOutputData acceptanceModelOutputData = new AcceptanceModelOutputData(); - acceptanceModelOutputData.setWhere(wherestr); - List list = this.acceptanceModelOutputDataDao.selectListByWhere(acceptanceModelOutputData); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelOutputData acceptanceModelOutputData = new AcceptanceModelOutputData(); - acceptanceModelOutputData.setWhere(wherestr); - return this.acceptanceModelOutputDataDao.deleteByWhere(acceptanceModelOutputData); - } -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelOutputServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelOutputServiceImpl.java deleted file mode 100644 index 67f0508f..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelOutputServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelOutputDao; -import com.sipai.entity.achievement.AcceptanceModelOutput; -import com.sipai.service.achievement.AcceptanceModelOutputService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; - -@Service -public class AcceptanceModelOutputServiceImpl implements AcceptanceModelOutputService { - @Resource - private AcceptanceModelOutputDao acceptanceModelOutputDao; - @Resource - private MPointService mPointService; - @Resource - private UserService userService; - - @Override - public AcceptanceModelOutput selectById(String unitId, String id) { - AcceptanceModelOutput acceptanceModelOutput = this.acceptanceModelOutputDao.selectByPrimaryKey(id); - if (acceptanceModelOutput!=null) { - acceptanceModelOutput.setmPoint(this.mPointService.selectById(unitId, acceptanceModelOutput.getMpointId())); - } - return acceptanceModelOutput; - } - - @Override - public int deleteById(String id) { - int code = this.acceptanceModelOutputDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(AcceptanceModelOutput acceptanceModelOutput) { - int code = this.acceptanceModelOutputDao.insert(acceptanceModelOutput); - return code; - } - - @Override - public int update(AcceptanceModelOutput acceptanceModelOutput) { - int code = this.acceptanceModelOutputDao.updateByPrimaryKeySelective(acceptanceModelOutput); - return code; - } - - @Override - public List selectListByWhere(String unitId, String wherestr) { - AcceptanceModelOutput acceptanceModelOutput = new AcceptanceModelOutput(); - acceptanceModelOutput.setWhere(wherestr); - List list = this.acceptanceModelOutputDao.selectListByWhere(acceptanceModelOutput); - if (list!=null&&list.size()>0) { - for (AcceptanceModelOutput item : list) { - item.setmPoint(this.mPointService.selectById(unitId, item.getMpointId())); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelOutput acceptanceModelOutput = new AcceptanceModelOutput(); - acceptanceModelOutput.setWhere(wherestr); - int code = this.acceptanceModelOutputDao.deleteByWhere(acceptanceModelOutput); - return code; - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelRecordServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelRecordServiceImpl.java deleted file mode 100644 index 9abe6054..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelRecordServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelRecordDao; -import com.sipai.entity.achievement.AcceptanceModelRecord; -import com.sipai.entity.data.DataCurve; -import com.sipai.service.achievement.AcceptanceModelRecordService; - -@Service -public class AcceptanceModelRecordServiceImpl implements AcceptanceModelRecordService { - @Resource - private AcceptanceModelRecordDao acceptanceModelRecordDao; - - @Override - public AcceptanceModelRecord selectById(String id) { - return this.acceptanceModelRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModelRecord entity) { - return this.acceptanceModelRecordDao.insert(entity); - } - - @Override - public int update(AcceptanceModelRecord entity) { - return this.acceptanceModelRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AcceptanceModelRecord acceptanceModel = new AcceptanceModelRecord(); - acceptanceModel.setWhere(wherestr); - List list = this.acceptanceModelRecordDao.selectListByWhere(acceptanceModel); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelRecord acceptanceModel = new AcceptanceModelRecord(); - acceptanceModel.setWhere(wherestr); - return this.acceptanceModelRecordDao.deleteByWhere(acceptanceModel); - } -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelServiceImpl.java deleted file mode 100644 index 386fae75..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelDao; -import com.sipai.entity.achievement.AcceptanceModel; -import com.sipai.entity.data.DataCurve; -import com.sipai.service.achievement.AcceptanceModelService; - -@Service -public class AcceptanceModelServiceImpl implements AcceptanceModelService { - @Resource - private AcceptanceModelDao acceptanceModelDao; - - @Override - public AcceptanceModel selectById(String id) { - return this.acceptanceModelDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModel entity) { - return this.acceptanceModelDao.insert(entity); - } - - @Override - public int update(AcceptanceModel entity) { - return this.acceptanceModelDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AcceptanceModel acceptanceModel = new AcceptanceModel(); - acceptanceModel.setWhere(wherestr); - List list = this.acceptanceModelDao.selectListByWhere(acceptanceModel); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModel acceptanceModel = new AcceptanceModel(); - acceptanceModel.setWhere(wherestr); - return this.acceptanceModelDao.deleteByWhere(acceptanceModel); - } - - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (AcceptanceModel k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (AcceptanceModel k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelTextDataServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelTextDataServiceImpl.java deleted file mode 100644 index 49637ae1..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelTextDataServiceImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelTextDataDao; -import com.sipai.entity.achievement.AcceptanceModelText; -import com.sipai.entity.achievement.AcceptanceModelTextData; -import com.sipai.service.achievement.AcceptanceModelTextDataService; -import com.sipai.service.scada.MPointService; - -@Service -public class AcceptanceModelTextDataServiceImpl implements AcceptanceModelTextDataService { - @Resource - private AcceptanceModelTextDataDao acceptanceModelTextDataDao; - @Resource - private MPointService mPointService; - - @Override - public AcceptanceModelTextData selectById(String id) { - AcceptanceModelTextData acceptanceModelTextData = this.acceptanceModelTextDataDao.selectByPrimaryKey(id); - return acceptanceModelTextData; - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelTextDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModelTextData entity) { - return this.acceptanceModelTextDataDao.insert(entity); - } - - @Override - public int update(AcceptanceModelTextData entity) { - return this.acceptanceModelTextDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AcceptanceModelTextData acceptanceModelTextData = new AcceptanceModelTextData(); - acceptanceModelTextData.setWhere(wherestr); - List list = this.acceptanceModelTextDataDao.selectListByWhere(acceptanceModelTextData); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelTextData acceptanceModelTextData = new AcceptanceModelTextData(); - acceptanceModelTextData.setWhere(wherestr); - return this.acceptanceModelTextDataDao.deleteByWhere(acceptanceModelTextData); - } -} diff --git a/src/com/sipai/service/achievement/impl/AcceptanceModelTextServiceImpl.java b/src/com/sipai/service/achievement/impl/AcceptanceModelTextServiceImpl.java deleted file mode 100644 index 6513d1ed..00000000 --- a/src/com/sipai/service/achievement/impl/AcceptanceModelTextServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.achievement.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.achievement.AcceptanceModelTextDao; -import com.sipai.entity.achievement.AcceptanceModelText; -import com.sipai.service.achievement.AcceptanceModelTextService; -import com.sipai.service.scada.MPointService; - -@Service -public class AcceptanceModelTextServiceImpl implements AcceptanceModelTextService { - @Resource - private AcceptanceModelTextDao acceptanceModelTextDao; - @Resource - private MPointService mPointService; - - @Override - public AcceptanceModelText selectById(String id) { - AcceptanceModelText acceptanceModelText = this.acceptanceModelTextDao.selectByPrimaryKey(id); - return acceptanceModelText; - } - - @Override - public int deleteById(String id) { - return this.acceptanceModelTextDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AcceptanceModelText entity) { - return this.acceptanceModelTextDao.insert(entity); - } - - @Override - public int update(AcceptanceModelText entity) { - return this.acceptanceModelTextDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AcceptanceModelText acceptanceModelText = new AcceptanceModelText(); - acceptanceModelText.setWhere(wherestr); - List list = this.acceptanceModelTextDao.selectListByWhere(acceptanceModelText); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AcceptanceModelText acceptanceModelText = new AcceptanceModelText(); - acceptanceModelText.setWhere(wherestr); - return this.acceptanceModelTextDao.deleteByWhere(acceptanceModelText); - } -} diff --git a/src/com/sipai/service/achievement/impl/ModelLibraryServiceImpl.java b/src/com/sipai/service/achievement/impl/ModelLibraryServiceImpl.java deleted file mode 100644 index 4a9fceb4..00000000 --- a/src/com/sipai/service/achievement/impl/ModelLibraryServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.service.achievement.impl; - -import com.sipai.dao.achievement.ModelLibraryDao; -import com.sipai.entity.achievement.ModelLibrary; -import com.sipai.service.achievement.ModelLibraryService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class ModelLibraryServiceImpl implements ModelLibraryService { - @Resource - private ModelLibraryDao modelLibraryDao; - - @Override - public ModelLibrary selectById(String id) { - return modelLibraryDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return modelLibraryDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ModelLibrary entity) { - return modelLibraryDao.insert(entity); - } - - @Override - public int update(ModelLibrary entity) { - return modelLibraryDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ModelLibrary entity = new ModelLibrary(); - entity.setWhere(wherestr); - return modelLibraryDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - ModelLibrary entity = new ModelLibrary(); - entity.setWhere(wherestr); - return modelLibraryDao.deleteByWhere(entity); - } - - @Override - public String getTree(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - if (list != null) { - for (ModelLibrary k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getParamName()); - map.put("pid", k.getPid()); - map.put("type", k.getType()); - map.put("code", k.getParamCode()); - if ("1".equals(k.getType())) { - map.put("icon", "fa fa-database"); - }else if ("2".equals(k.getType())) { - map.put("icon", "fa fa-book"); - }else if ("3".equals(k.getType())) { - map.put("icon", "fa fa-file-text-o"); - } - /*if(k.getType()!=null && k.getType().equals(CommString.ModelLibrary_Category)){ - map.put("icon", TimeEfficiencyCommStr.ModelLibraryLevel1); - } - if(k.getType()!=null && k.getType().equals(CommString.ModelLibrary_Equipment)){ - map.put("icon", TimeEfficiencyCommStr.ModelLibraryLevel2); - } - if(k.getType()!=null && k.getType().equals(CommString.ModelLibrary_Parts)){ - map.put("icon", TimeEfficiencyCommStr.ModelLibraryPlace); - }*/ - - list_result.add(map); - } - } - getTree(list_result, list); - } - } else if (list_result.size() > 0 && list != null && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - if (list != null) { - for (ModelLibrary k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getParamName()); - m.put("pid", k.getPid()); - m.put("type", k.getType()); - m.put("code", k.getParamCode()); - if ("1".equals(k.getType())) { - m.put("icon", "fa fa-database"); - }else if ("2".equals(k.getType())) { - m.put("icon", "fa fa-book"); - }else if ("3".equals(k.getType())) { - m.put("icon", "fa fa-file-text-o"); - } - /*if (k.getType() != null && k.getType().equals(CommString.ModelLibrary_Category)) { - m.put("icon", TimeEfficiencyCommStr.ModelLibraryLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.ModelLibrary_Equipment)) { - m.put("icon", TimeEfficiencyCommStr.ModelLibraryLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.ModelLibrary_Parts)) { - m.put("icon", TimeEfficiencyCommStr.ModelLibraryPlace); - }*/ - - childlist.add(m); - } - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTree(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/activiti/AfterModifyApplyContentProcessor.java b/src/com/sipai/service/activiti/AfterModifyApplyContentProcessor.java deleted file mode 100644 index 89e4c25b..00000000 --- a/src/com/sipai/service/activiti/AfterModifyApplyContentProcessor.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.service.activiti; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.delegate.DelegateTask; -import org.activiti.engine.delegate.TaskListener; -import org.activiti.engine.runtime.ProcessInstance; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.activiti.Leave; - -import java.util.Date; - -/** - * 调整请假内容处理器 - * - * @author HenryYan - */ -@Component -@Transactional -public class AfterModifyApplyContentProcessor implements TaskListener { - - private static final long serialVersionUID = 1L; - - @Autowired - LeaveManager leaveManager; - - @Autowired - RuntimeService runtimeService; - - /* (non-Javadoc) - * @see org.activiti.engine.delegate.TaskListener#notify(org.activiti.engine.delegate.DelegateTask) - */ - public void notify(DelegateTask delegateTask) { - String processInstanceId = delegateTask.getProcessInstanceId(); - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - Leave leave = leaveManager.getLeave(new Long(processInstance.getBusinessKey())); - - leave.setLeaveType((String) delegateTask.getVariable("leaveType")); - leave.setStartTime((String) delegateTask.getVariable("startTime")); - leave.setEndTime((String) delegateTask.getVariable("endTime")); - leave.setReason((String) delegateTask.getVariable("reason")); - -// leaveManager.updataLeave(leave); - } - -} diff --git a/src/com/sipai/service/activiti/KpiWorkflowService.java b/src/com/sipai/service/activiti/KpiWorkflowService.java deleted file mode 100644 index 38dba8e2..00000000 --- a/src/com/sipai/service/activiti/KpiWorkflowService.java +++ /dev/null @@ -1,412 +0,0 @@ -package com.sipai.service.activiti; - -import com.sipai.entity.kpi.KpiPlanStaff; -import com.sipai.entity.kpi.KpiTaskListVO; -import com.sipai.entity.user.User; -import com.sipai.service.kpi.KpiPlanStaffService; -import org.activiti.engine.HistoryService; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior; -import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; -import org.activiti.engine.impl.javax.el.ExpressionFactory; -import org.activiti.engine.impl.javax.el.ValueExpression; -import org.activiti.engine.impl.juel.ExpressionFactoryImpl; -import org.activiti.engine.impl.juel.SimpleContext; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.PvmActivity; -import org.activiti.engine.impl.pvm.PvmTransition; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.impl.task.TaskDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.activiti.engine.task.TaskQuery; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -@Service -public class KpiWorkflowService { - - @Resource - private WorkflowService workflowService; - @Autowired - protected RuntimeService runtimeService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Autowired - protected RepositoryService repositoryService; - @Autowired - protected HistoryService historyService; - - private Map map; - private Map map2; - - /** - * 获取下一个userTask任务信息 - * - * @param taskId taskId - * @return 下一个用户任务定义信息 - * @throws Exception - */ - - public TaskDefinition getNextTaskInfo(String taskId) throws Exception { - - ProcessDefinitionEntity processDefinitionEntity = null; - String id = null; - - TaskDefinition task = null; - - Task task1 = workflowService.getTaskService().createTaskQuery().taskId(taskId).singleResult(); - map = workflowService.getTaskService().getVariables(taskId); - map2 = task1.getTaskLocalVariables(); - - String processInstanceId = task1.getProcessInstanceId(); - //获取流程发布Id信息 - - String definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult().getProcessDefinitionId(); - - processDefinitionEntity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) - - .getDeployedProcessDefinition(definitionId); - - - List taskQuery = workflowService.getTaskService().createTaskQuery().processInstanceId(processInstanceId).list(); - - //当前流程节点Id信息 - - String activitiId = taskQuery.get(0).getTaskDefinitionKey(); - - //获取流程所有节点信息 - - List activitiList = processDefinitionEntity.getActivities(); - - - //遍历所有节点信息 - - for (ActivityImpl activityImpl : activitiList) { - - id = activityImpl.getId(); - - if (activitiId.equals(id)) { - - //获取下一个节点信息 - - task = nextTaskDefinition(activityImpl, activityImpl.getId(), processInstanceId); - - break; - - } - - } - - return task; - - } - - - /** - * 下一个任务节点信息, - *

- *

- *

- * 如果下一个节点为用户任务则直接返回, - *

- *

- *

- * 如果下一个节点为排他网关, 根据当前的流程变量及排他网关各分支配置的el表达式,判断走哪个分支及下个用户任务 - *

- * 根据变量值分别执行排他网关后线路中的el表达式, 并找到el表达式通过的线路后的用户任务 - * - * @param activityImpl 流程节点信息 - * @param activityId 当前流程节点Id信息 - * @param processInstanceId 流程实例Id信息 - * @return 下一个用户节点任务信息 - */ - - private TaskDefinition nextTaskDefinition(ActivityImpl activityImpl, String activityId, String processInstanceId) { - - PvmActivity ac = null; - - Object s = null; - - // 如果遍历节点为用户任务并且节点不是当前节点信息 - - if ("userTask".equals(activityImpl.getProperty("type")) && !activityId.equals(activityImpl.getId())) { - - // 获取该节点下一个节点信息 - - if (activityImpl.getActivityBehavior() instanceof UserTaskActivityBehavior) { - - UserTaskActivityBehavior aaBehavior = (UserTaskActivityBehavior) activityImpl.getActivityBehavior(); - - return aaBehavior.getTaskDefinition(); - - } else if (activityImpl.getActivityBehavior() instanceof ParallelMultiInstanceBehavior) { - - ParallelMultiInstanceBehavior aaBehavior = (ParallelMultiInstanceBehavior) activityImpl.getActivityBehavior(); - - return ((UserTaskActivityBehavior) aaBehavior.getInnerActivityBehavior()).getTaskDefinition(); - - } - - - } else if ("exclusiveGateway".equals(activityImpl.getProperty("type"))) {// 当前节点为exclusiveGateway - - List outTransitions = activityImpl.getOutgoingTransitions(); - - // 如果排他网关只有一条线路信息 - - if (outTransitions.size() == 1) { - - return nextTaskDefinition((ActivityImpl) outTransitions.get(0).getDestination(), activityId, - - processInstanceId); - - } else if (outTransitions.size() > 1) { // 如果排他网关有多条线路信息 - - for (PvmTransition tr1 : outTransitions) { - - s = tr1.getProperty("conditionText"); // 获取排他网关线路判断条件信息 - - // 判断el表达式是否成立 - - if (isCondition(activityImpl.getId(), StringUtils.trim(s.toString()))) { - - return nextTaskDefinition((ActivityImpl) tr1.getDestination(), activityId, - - processInstanceId); - - } - - } - - } - - } else { - - // 获取节点所有流向线路信息 - - List outTransitions = activityImpl.getOutgoingTransitions(); - - List outTransitionsTemp = null; - - for (PvmTransition tr : outTransitions) { - - ac = tr.getDestination(); // 获取线路的终点节点 - - // 如果流向线路为排他网关 - - if ("exclusiveGateway".equals(ac.getProperty("type"))) { - - outTransitionsTemp = ac.getOutgoingTransitions(); - - // 如果排他网关只有一条线路信息 - - if (outTransitionsTemp.size() == 1) { - - return nextTaskDefinition((ActivityImpl) outTransitionsTemp.get(0).getDestination(), activityId, - - processInstanceId); - - } else if (outTransitionsTemp.size() > 1) { // 如果排他网关有多条线路信息 - - for (PvmTransition tr1 : outTransitionsTemp) { - - s = tr1.getProperty("conditionText"); // 获取排他网关线路判断条件信息 - - // 判断el表达式是否成立 - - if (isCondition(ac.getId(), StringUtils.trim(s.toString()))) { - - return nextTaskDefinition((ActivityImpl) tr1.getDestination(), activityId, - - processInstanceId); - - } - - } - - } - - } else if ("userTask".equals(ac.getProperty("type"))) { - - if (((ActivityImpl) ac).getActivityBehavior() instanceof UserTaskActivityBehavior) { - - UserTaskActivityBehavior aaBehavior = (UserTaskActivityBehavior) ((ActivityImpl) ac).getActivityBehavior(); - - - return aaBehavior.getTaskDefinition(); - - } else if (((ActivityImpl) ac).getActivityBehavior() instanceof ParallelMultiInstanceBehavior) { - - ParallelMultiInstanceBehavior aaBehavior = (ParallelMultiInstanceBehavior) ((ActivityImpl) ac).getActivityBehavior(); - - - return ((UserTaskActivityBehavior) aaBehavior.getInnerActivityBehavior()).getTaskDefinition(); - - } - - } else { - - } - - } - - return null; - - } - - return null; - - } - - - /** - * 根据key和value判断el表达式是否通过信息 - * - * @param key el表达式key信息 - * @param el el表达式信息 - * @return - */ - - private boolean isCondition(String key, String el) { - - ExpressionFactory factory = new ExpressionFactoryImpl(); - - SimpleContext context = new SimpleContext(); - - for (Map.Entry entry : map.entrySet()) { - - - context.setVariable(entry.getKey(), factory.createValueExpression(entry.getValue(), getValueClass(entry.getValue()))); - - } - - ValueExpression e = factory.createValueExpression(context, el, boolean.class); - - return (Boolean) e.getValue(context); - - } - - - /** - * @param obj - * @return Class (这里用一句话描述返回结果说明) - * @Title: getValueClass - * @Description: TODO(根据值获取值类型) - */ - - public Class getValueClass(Object obj) { - - if (obj instanceof Boolean) { - - return Boolean.class; - - } else if (obj instanceof Integer) { - - return Integer.class; - - } else if (obj instanceof String) { - - return String.class; - - } else if (obj instanceof Long) { - - return Long.class; - - } else if (obj instanceof Map) { - - return Map.class; - - } else if (obj instanceof Collection) { - - return Collection.class; - - } else if (obj instanceof java.util.List) { - - return java.util.List.class; - - } else { - - return String.class; - - } - - } - - /** - * 获取待办列表 - * - * @return - * @author lichen - * @date 2021/10/30 15:24 - **/ - public List getTodoList(String processKey, User loginUser, int page, int size) { -// //创建查询对象 -// TaskQuery taskQuery = workflowService.getTaskService().createTaskQuery(); -// //设置查询条件 -// taskQuery.taskAssignee(loginUser.getId()); -// //指定流程定义key,只查询某个流程的任务 -// taskQuery.processDefinitionKeyLikeIgnoreCase("KPI%"); -// //获取查询列表 -// List list = taskQuery.listPage(page, size); -// //返回给页面的List -// List voList = new ArrayList<>(); -// for (Task task : list) { -// //流程实例id -// String processInstanceId = task.getProcessInstanceId(); -// //根据流程实例id找到流程实例对象 -// ProcessInstance processInstance = workflowService.getRuntimeService() -// .createProcessInstanceQuery() -// .processInstanceId(processInstanceId) -// .singleResult(); -// -// KpiPlanStaff kpiPlanStaff = kpiPlanStaffService.selectById(processInstance.getBusinessKey()); -// KpiTaskListVO taskListVO = new KpiTaskListVO(); -// taskListVO.setTaskId(task.getId()); -// taskListVO.setPlanStaffId(kpiPlanStaff.getId()); -// taskListVO.setProcessTypeId(task.getProcessDefinitionId().substring(0, task.getProcessDefinitionId().indexOf("-"))); -//// taskListVO.setProcessTypeName(processInstanceId); -// taskListVO.setObjUserName(kpiPlanStaff.getObjUserName()); -// taskListVO.setCardId(kpiPlanStaff.getCardId()); -// taskListVO.setDeptName(kpiPlanStaff.getDeptName()); -// taskListVO.setJobName(kpiPlanStaff.getJobName()); -// taskListVO.setPeriodName(kpiPlanStaff.getKpiPeriodInstance().getPeriodName()); -// taskListVO.setJobLevelTypeName(kpiPlanStaff.getJobLevelTypeName()); -// voList.add(taskListVO); -// } -// return voList; - return null; - } - - /** - * 获取待办事项的个数 - * - * @return - * @author lichen - * @date 2021/10/30 15:34 - **/ - public int getTodoListRowCount(String processKey, User loginUser) { - //创建查询对象 - TaskQuery taskQuery = workflowService.getTaskService().createTaskQuery(); - //设置查询条件 - taskQuery.taskAssignee(loginUser.getId()); - //指定流程定义key,只查询某个流程的任务 - taskQuery.processDefinitionKeyLike(processKey); - //获取查询列表 - List list = taskQuery.list(); - if (list != null) { - return list.size(); - } else { - return 0; - } - } -} \ No newline at end of file diff --git a/src/com/sipai/service/activiti/LeaveManager.java b/src/com/sipai/service/activiti/LeaveManager.java deleted file mode 100644 index dd88db6f..00000000 --- a/src/com/sipai/service/activiti/LeaveManager.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.activiti; - - -import org.activiti.engine.TaskService; -import org.activiti.engine.task.Task; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.activiti.LeaveDao; -import com.sipai.entity.activiti.Leave; -import com.sipai.tools.CommUtil; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.Map; - -/** - * 请假实体管理 - * - * @author HenryYan - */ -@Component -@Transactional(readOnly = true) -public class LeaveManager { - - private LeaveDao leaveDao; - - public Leave getLeave(Long id) { - return leaveDao.selectByID(new BigDecimal(id)); - } - - @Transactional(readOnly = false) - public void saveLeave(Leave entity) { - if (entity.getId() == null) { - entity.setApplyTime(CommUtil.nowDate()); - } - leaveDao.insertSelective(entity); - } - @Transactional(readOnly = false) - public void updataLeave(Leave entity) { - leaveDao.updateByPrimaryKeySelective(entity); - - } - /* - * 带回滚的更新数据,不能放到controller中 - * - * - * - * */ - @Transactional(readOnly = false) - public void updataLeaveWithRollBack(Leave entity,TaskService taskService,String taskId,Map variables,String comment) { - try { - leaveDao.updateByPrimaryKeySelective(entity); - if(comment!=null && !comment.isEmpty()){ - Task task=taskService.createTaskQuery().taskId(taskId).singleResult(); - //利用任务对象,获取流程实例id - String processInstancesId=task.getProcessInstanceId(); - taskService.addComment(taskId, processInstancesId, comment); - } - taskService.complete(taskId, variables); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - @Autowired - public void setLeaveDao(LeaveDao leaveDao) { - this.leaveDao = leaveDao; - } - -} diff --git a/src/com/sipai/service/activiti/LeaveWorkflowService.java b/src/com/sipai/service/activiti/LeaveWorkflowService.java deleted file mode 100644 index 800b635d..00000000 --- a/src/com/sipai/service/activiti/LeaveWorkflowService.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.sipai.service.activiti; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - - - - - - - - - - - - - -import javax.annotation.Resource; - -import org.activiti.engine.*; -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.history.HistoricProcessInstanceQuery; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.runtime.ProcessInstanceQuery; -import org.activiti.engine.task.Comment; -import org.activiti.engine.task.Task; -import org.activiti.engine.task.TaskQuery; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -/*import org.slf4j.Logger; -import org.slf4j.LoggerFactory;*/ -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.google.gson.Gson; -import com.sipai.activiti.util.Page; -import com.sipai.entity.activiti.Leave; -@Service -@Component -public class LeaveWorkflowService { - - private static Logger logger = LoggerFactory.getLogger(LeaveWorkflowService.class); - - private LeaveManager leaveManager; - - private RuntimeService runtimeService; - - protected TaskService taskService; - - protected HistoryService historyService; - - protected RepositoryService repositoryService; - - @Autowired - private IdentityService identityService; - - - //启动流程 - public ProcessInstance startWorkflow(Leave leave,Map variables,String processDefinitionId){ - leaveManager.saveLeave(leave); - String businessKey = leave.getId().toString(); - ProcessInstance processInstance = null; - try{ - // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中 - identityService.setAuthenticatedUserId(leave.getUserId()); -// processInstance = runtimeService.startProcessInstanceByKey("leavew", businessKey, variables); - processInstance = runtimeService.startProcessInstanceById(processDefinitionId, businessKey, variables); - String processInstanceId = processInstance.getId(); - leave.setProcessInstanceId(processInstanceId); - leaveManager.updataLeave(leave); - logger.debug("start process of {key={}, bkey={}, pid={}, variables={}}", new Object[]{"leave", businessKey, processInstanceId, variables}); - }finally { - identityService.setAuthenticatedUserId(null); - } - return processInstance; - } - - /** - * 读取运行中的流程 - * - * @return - */ - @Transactional(readOnly = true) - public List findRunningProcessInstaces(Page page,int[] pageParams) { - - List results = new ArrayList(); - ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().orderByProcessInstanceId().desc(); - //listPage(arg0,arg1)从arg0开始arg1个 - List list = query.listPage(pageParams[0], pageParams[1]); - - // 关联业务实体 - for (ProcessInstance processInstance : list) { - String businessKey = processInstance.getBusinessKey(); - if (businessKey == null) { - continue; - } - Leave leave = leaveManager.getLeave(new Long(businessKey)); - leave.setProcessInstance(processInstance); - leave.setProcessDefinition(getProcessDefinition(processInstance.getProcessDefinitionId())); - results.add(leave); - - // 设置当前任务信息 - List tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).active().orderByTaskCreateTime().desc().listPage(0, 1); - //流程实例被挂起时,查询不到任务 - if(tasks!=null && tasks.size()>0){ - leave.setTask(tasks.get(0)); - } - } - - page.setTotalCount(query.count());; - page.setResult(results); - return results; - } - - /** - * 读取已结束中的流程 - * - * @return - */ - @Transactional(readOnly = true) - public List findFinishedProcessInstaces(Page page, int[] pageParams) { - List results = new ArrayList(); - HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().processDefinitionKey("leave").finished().orderByProcessInstanceEndTime().desc(); - List list = query.listPage(pageParams[0], pageParams[1]); - - // 关联业务实体 - for (HistoricProcessInstance historicProcessInstance : list) { - String businessKey = historicProcessInstance.getBusinessKey(); - Leave leave = leaveManager.getLeave(new Long(businessKey)); - leave.setProcessDefinition(getProcessDefinition(historicProcessInstance.getProcessDefinitionId())); - leave.setHistoricProcessInstance(historicProcessInstance); - results.add(leave); - } - page.setTotalCount(query.count()); - page.setResult(results); - return results; - } - - /** - * 查询待办任务 - * - * @param userId 用户ID - * @param type 并发时element - * @return - */ - @Transactional(readOnly = true) - public List findTodoTasks(String userId,int[] pageParams,Map type) { - List results = new ArrayList(); - - // 根据当前人的ID查询 - TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId); - List tasks = taskQuery.list(); - - // 根据流程的业务ID查询实体并关联 - for (int i=0;i variables = taskService.getVariables(task.getId()); - if(type!=null ){ - String key =type.get("key").toString(); - String value =type.get("value").toString(); - if(variables.containsKey(key) && !variables.get(key).toString().equals(value)){ - continue; - } - - } - String processInstanceId = task.getProcessInstanceId(); - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).active().singleResult(); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null){ - continue; - } - String businessKey = processInstance.getBusinessKey(); - if (businessKey == null) { - //callactivity调用的流程启动时无businesskey,通过variable中businessKey查找 - if(variables.get("businessKey")!=null){ - businessKey =variables.get("businessKey").toString(); - }else{ - continue; - } - } - Leave leave = leaveManager.getLeave(new Long(businessKey)); - leave.setTask(task); - leave.setProcessInstance(processInstance); - leave.setProcessDefinition(getProcessDefinition(processInstance.getProcessDefinitionId())); - - leave.setVariables(variables); - //默认浅复制,因为在子流程中查询到的leave会发生重复,要改为深复制 - results.add((Leave)leave.clone()); - } - -// page.setTotalCount(taskQuery.count()); -// page.setResult(results); - return results; - } - - /** - * 查询任务comment - * - * @param userId 用户ID - * @return - */ - @Transactional(readOnly = true) - public List findTaskComments(String taskId,String taskDefKey) { - List list = new ArrayList(); - //使用当前的任务ID,查询当前流程对应的历史任务ID - - //使用当前任务ID,获取当前任务对象 - Task task = taskService.createTaskQuery()// - .taskId(taskId)//使用任务ID查询 - .singleResult(); - //获取流程实例ID - String processInstanceId = task.getProcessInstanceId(); - //使用流程实例ID,查询历史任务,获取历史任务对应的每个任务ID - List htiList = historyService.createHistoricTaskInstanceQuery()//历史任务表查询 - .processInstanceId(processInstanceId)//使用流程实例ID查询 - .list(); - //遍历集合,获取每个任务ID - if(htiList!=null && htiList.size()>0){ - for(HistoricTaskInstance hti:htiList){ - //任务ID - String htaskId = hti.getId(); - //获取批注信息 - if(taskDefKey!=null && hti.getTaskDefinitionKey().equals(taskDefKey)){ - list = taskService.getTaskComments(htaskId);//对用历史完成后的任务ID - } - } - } - return list; - - } - - /** - * 查询流程定义对象 - * - * @param processDefinitionId 流程定义ID - * @return - */ - protected ProcessDefinition getProcessDefinition(String processDefinitionId) { - ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); - return processDefinition; - } - - - - @Autowired - public void setLeaveManager(LeaveManager leaveManager) { - this.leaveManager = leaveManager; - } - - @Autowired - public void setRuntimeService(RuntimeService runtimeService) { - this.runtimeService = runtimeService; - } - - @Autowired - public void setTaskService(TaskService taskService) { - this.taskService = taskService; - } - - @Autowired - public void setHistoryService(HistoryService historyService) { - this.historyService = historyService; - } - - @Autowired - public void setRepositoryService(RepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - -} diff --git a/src/com/sipai/service/activiti/ProcessModelService.java b/src/com/sipai/service/activiti/ProcessModelService.java deleted file mode 100644 index 0c0a2284..00000000 --- a/src/com/sipai/service/activiti/ProcessModelService.java +++ /dev/null @@ -1,371 +0,0 @@ -package com.sipai.service.activiti; - - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.bpmn.BpmnAutoLayout; -import org.activiti.bpmn.converter.BpmnXMLConverter; -import org.activiti.bpmn.model.BpmnModel; -import org.activiti.bpmn.model.EndEvent; -import org.activiti.bpmn.model.ExclusiveGateway; -import org.activiti.bpmn.model.Process; -import org.activiti.bpmn.model.SequenceFlow; -import org.activiti.bpmn.model.StartEvent; -import org.activiti.bpmn.model.UserTask; -import org.activiti.editor.constants.ModelDataJsonConstants; -import org.activiti.editor.language.json.converter.BpmnJsonConverter; -import org.activiti.engine.HistoryService; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.PvmActivity; -import org.activiti.engine.impl.pvm.PvmTransition; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.Deployment; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.repository.ProcessDefinitionQuery; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.codehaus.jackson.JsonNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.DefaultResourceLoader; -import org.springframework.core.io.ResourceLoader; -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.sipai.activiti.util.WorkflowUtils; -import com.sipai.entity.activiti.TaskModel; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.user.User; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.zip.ZipInputStream; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * 工作流自定义模型service - * - * @author wxp - */ -@Service -public class ProcessModelService { - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - protected RuntimeService runtimeService; - - @Autowired - protected RepositoryService repositoryService; - - @Autowired - protected HistoryService historyService; - - /** - * 根据Model部署流程 - */ - public String deploy(String modelId) { - int result=0; - String restr=""; - try { - org.activiti.engine.repository.Model modelData = repositoryService.getModel(modelId); - ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId())); - byte[] bpmnBytes = null; - - BpmnModel acmodel = new BpmnJsonConverter().convertToBpmnModel(modelNode); - bpmnBytes = new BpmnXMLConverter().convertToXML(acmodel); - - String processName = modelData.getName() + ".bpmn20.xml"; - Deployment deployment = repositoryService.createDeployment().name(modelData.getName()) - .addString(processName, new String(bpmnBytes, "utf-8")).deploy();//此处设置modeler自动部署编码,防止中文乱码 - if(deployment!=null){ - result=1; - System.out.println("流程发布成功,流程ID为:{}"+deployment.getName()+","+deployment.getId()); - } - } catch (Exception e) { - logger.error("根据模型部署流程失败:modelId={}", modelId, e); - restr=e.getMessage(); - } - - String res="{\"res\":\""+result+"\",\"restr\":\""+restr+"\"}" ; - return res; - } - - /** - * PLM获取的工序处理为标准taskmodel*/ - /*private List getTaskModelFromPLM(String technicsname,List processTechnics){ - - List pt4TaskModel =processTechnics; - - //查询主工序。去重 - ProcessTechnics pt_temp =new ProcessTechnics(); - for (ProcessTechnics old : processTechnics) { - String taskcode = old.getMainprocedurecode(); - if(!taskcode.isEmpty()&& !taskcode.equals(pt_temp.getMainprocedurecode())){ - pt4TaskModel.add(old); - } - pt_temp=old; - } - - List taskModels =new ArrayList<>(); - if(pt4TaskModel.size()>0){ - if(technicsname==null ||technicsname.isEmpty()){ - technicsname="process01"; - } - //添加流程信息和开始节点 - TaskModel processinfo =new TaskModel(); - processinfo.setId(technicsname); - processinfo.setName(technicsname+"工艺"); - taskModels.add(processinfo); - - TaskModel starttask =new TaskModel(); - starttask.setId("startEvent"); - starttask.setTarget_true(pt4TaskModel.get(0).getMainprocedurecode()); - starttask.setType(CommString.TaskType_Start); - taskModels.add(starttask); - - //添加用户任务节点 - int i=0; - for (i=0;i< pt4TaskModel.size()-1;i++) { - ProcessTechnics pt_item =pt4TaskModel.get(i); - String now_taskcode = pt_item.getMainprocedurecode(); - - String next_taskcode = pt4TaskModel.get(i+1).getMainprocedurecode(); - String taskname = pt_item.getMainprocedure(); - String yield = pt_item.getYield(); - if(yield!=null && !yield.isEmpty()){ - yield =yield.replace("%", ""); - double temp =Double.valueOf(yield)/100; - DecimalFormat df = new DecimalFormat("#0.00"); - yield=df.format(temp); - }else{ - yield="1";//documentation用于存储良率 ,默认测试为1,(下面还有一处需要修改) - } - TaskModel taskModel=new TaskModel(); - - taskModel.setId(now_taskcode); - taskModel.setName(taskname); - taskModel.setTarget_true(next_taskcode); - //taskModel.setTarget_false(row.getCell(3)==null?null:row.getCell(3).toString()); - taskModel.setType(CommString.TaskType_UserTask); - taskModel.setDocumentation(yield); - taskModels.add(taskModel); - } - //添加结束节点 - TaskModel taskModel=new TaskModel(); - taskModel.setId(pt4TaskModel.get(i).getMainprocedurecode()); - taskModel.setName(pt4TaskModel.get(i).getMainprocedure()); - taskModel.setTarget_true("endEvent"); - taskModel.setType(CommString.TaskType_UserTask); - String yield = pt4TaskModel.get(i).getYield(); - if(yield!=null && !yield.isEmpty()){ - yield =yield.replace("%", ""); - double temp =Double.valueOf(yield)/100; - DecimalFormat df = new DecimalFormat("#0.00"); - yield=df.format(temp); - }else{ - yield="1";//documentation用于存储良率 ,默认测试为1 - } - taskModel.setDocumentation(yield);//documentation用于存储良率 ,默认测试为1 - taskModels.add(taskModel); - - TaskModel endtask =new TaskModel(); - endtask.setId("endEvent"); - endtask.setType(CommString.TaskType_End); - taskModels.add(endtask); - } - return taskModels; - - }*/ - public String autoImport(List data) { - String description =""; - String result=""; - if(data==null || data.size()<3) - { - return result; - } - final String PROCESSID =data.get(0).getId(); - final String PROCESSNAME =data.get(0).getName(); - - ObjectMapper objectMapper = new ObjectMapper(); - ObjectNode editorNode = objectMapper.createObjectNode(); - editorNode.put("id", "canvas"); - editorNode.put("resourceId", "canvas"); - ObjectNode stencilSetNode = objectMapper.createObjectNode(); - stencilSetNode.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#"); - editorNode.put("stencilset", stencilSetNode); - org.activiti.engine.repository.Model modelData = repositoryService.newModel(); - - ObjectNode modelObjectNode = objectMapper.createObjectNode(); - modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, PROCESSNAME); - modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1); - description = StringUtils.defaultString(description); - modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description); - modelData.setMetaInfo(modelObjectNode.toString()); - modelData.setName(PROCESSNAME); - modelData.setKey(StringUtils.defaultString(PROCESSID)); - repositoryService.saveModel(modelData); - - - // 1. Build up the model from scratch - BpmnModel bModel = new BpmnModel(); - Process process=new Process(); - bModel.addProcess(process); - - if(PROCESSID==null || PROCESSNAME==null){ - return result; - } - process.setId(PROCESSID); - process.setName(PROCESSNAME); - - for (int i = 1; i < data.size(); i++) { - TaskModel taskModel = data.get(i); - switch (taskModel.getType()) { - case "startEvent": - String taskId = taskModel.getId(); - String target_true = taskModel.getTarget_true(); - StartEvent startEvent=createStartEvent(); - SequenceFlow sFlow=createSequenceFlow(taskId, target_true, "", ""); - - List sequenceFlows=new ArrayList(); - sequenceFlows.add(sFlow); - startEvent.setOutgoingFlows(sequenceFlows); - - process.addFlowElement(startEvent); //创建节点 - process.addFlowElement(sFlow);//创建连线 - break; - case "endEvent": - EndEvent endEvent=createEndEvent(); - process.addFlowElement(endEvent); - break; - case "task": - taskId = taskModel.getId(); - String taskName = taskModel.getName(); - target_true = taskModel.getTarget_true(); - UserTask userTask=createUserTask(taskId, taskName, "candidateGroup"+i); - sFlow=createSequenceFlow(taskId, target_true, "", ""); - - sequenceFlows=new ArrayList(); - sequenceFlows.add(sFlow); - userTask.setOutgoingFlows(sequenceFlows); - userTask.setDocumentation(taskModel.getDocumentation()); - process.addFlowElement(userTask); - process.addFlowElement(sFlow); - break; - case "gateway": - taskId = taskModel.getId(); - taskName = taskModel.getName(); - target_true = taskModel.getTarget_true(); - String target_false = taskModel.getTarget_false(); - - ExclusiveGateway exclusiveGateway =createExclusiveGateway(taskId); - SequenceFlow sFlow1=createSequenceFlow(taskId, target_true, "通过", CommString.ACTI_Condition_FAIL); - SequenceFlow sFlow2=createSequenceFlow(taskId, target_false, "不通过", CommString.ACTI_Condition_FAIL); - - sequenceFlows=new ArrayList(); - sequenceFlows.add(sFlow1); - sequenceFlows.add(sFlow2); - exclusiveGateway.setOutgoingFlows(sequenceFlows); - - process.addFlowElement(exclusiveGateway); - process.addFlowElement(sFlow1); - process.addFlowElement(sFlow2); - break; - default: - break; - } - } -// mxGraph mxGraph =new mxGraph(); -// BPMNLayout bpmnLayout =new BPMNLayout(mxGraph); - BpmnAutoLayout vAutoLayout= new BpmnAutoLayout(bModel); - vAutoLayout.execute(); - BpmnJsonConverter converter = new BpmnJsonConverter(); - com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bModel); - - - try { - byte[] bpmnBytes=modelNode.toString().getBytes("utf-8"); - repositoryService.addModelEditorSource(modelData.getId(),bpmnBytes ); - } catch (Exception e) { - // TODO: handle exception - return result; - } - - -// response.sendRedirect(request.getContextPath() + "/work/workstation/showlist.do"); -// response.sendRedirect(request.getContextPath() + "/service/editor?id=" + modelData.getId()); - result=modelData.getId(); - return result; - } - /*任务节点*/ - protected static UserTask createUserTask(String id, String name, String candidateGroup) { - List candidateGroups=new ArrayList(); - candidateGroups.add(candidateGroup); - UserTask userTask = new UserTask(); - userTask.setName(name); - userTask.setId(id); - userTask.setCandidateGroups(candidateGroups); - return userTask; - } - - /*连线*/ - protected static SequenceFlow createSequenceFlow(String from, String to,String name,String conditionExpression) { - SequenceFlow flow = new SequenceFlow(); - flow.setSourceRef(from); - flow.setTargetRef(to); - flow.setName(name); - if(StringUtils.isNotEmpty(conditionExpression)){ - flow.setConditionExpression(conditionExpression); - } - return flow; - } - - /*排他网关*/ - protected static ExclusiveGateway createExclusiveGateway(String id) { - ExclusiveGateway exclusiveGateway = new ExclusiveGateway(); - exclusiveGateway.setId(id); - return exclusiveGateway; - } - - /*开始节点*/ - protected static StartEvent createStartEvent() { - StartEvent startEvent = new StartEvent(); - startEvent.setId("startEvent"); - return startEvent; - } - - /*结束节点*/ - protected static EndEvent createEndEvent() { - EndEvent endEvent = new EndEvent(); - endEvent.setId("endEvent"); - return endEvent; - } -} diff --git a/src/com/sipai/service/activiti/WorkflowProcessDefinitionService.java b/src/com/sipai/service/activiti/WorkflowProcessDefinitionService.java deleted file mode 100644 index feeb3404..00000000 --- a/src/com/sipai/service/activiti/WorkflowProcessDefinitionService.java +++ /dev/null @@ -1,489 +0,0 @@ -package com.sipai.service.activiti; - - -import org.activiti.engine.HistoryService; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.PvmActivity; -import org.activiti.engine.impl.pvm.PvmTransition; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.Deployment; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.repository.ProcessDefinitionQuery; -import org.apache.commons.lang3.ArrayUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.DefaultResourceLoader; -import org.springframework.core.io.Resource; -import org.springframework.core.io.ResourceLoader; -import org.springframework.stereotype.Service; - -import com.sipai.activiti.util.WorkflowUtils; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -import java.io.IOException; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.zip.ZipInputStream; - -import jodd.util.StringUtil; - -/** - * 工作流中流程以及流程实例相关Service - * - * @author HenryYan - */ -@Service -public class WorkflowProcessDefinitionService { - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - protected RuntimeService runtimeService; - - @Autowired - protected RepositoryService repositoryService; - - @Autowired - protected HistoryService historyService; - /** - * 根据流程实例ID查询流程定义对象{@link ProcessDefinition} - * - * @param processInstanceId 流程实例ID - * @return 流程定义对象{@link ProcessDefinition} - */ - public ProcessDefinition findProcessDefinitionByPid(String processInstanceId) { - HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - String processDefinitionId = historicProcessInstance.getProcessDefinitionId(); - ProcessDefinition processDefinition = findProcessDefinition(processDefinitionId); - return processDefinition; - } - - /** - * 根据流程定义ID查询流程定义对象{@link ProcessDefinition} - * - * @param processDefinitionId 流程定义对象ID - * @return 流程定义对象{@link ProcessDefinition} - */ - public ProcessDefinition findProcessDefinition(String processDefinitionId) { - ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); - return processDefinition; - } - - /** - * 部署classpath下面的流程定义 - *

- * 从属性配置文件中获取属性workflow.modules扫描**deployments** - *

- *

- * 然后从每个**deployments/${module}**查找在属性配置文件中的属性**workflow.module.keys.${ - * submodule}** - *

- * 配置实例: - *

- *

-     * #workflow for deploy
-     * workflow.modules=budget,erp,oa
-     * workflow.module.keys.budget=budget
-     * workflow.module.keys.erp=acceptInsurance,billing,effectInsurance,endorsement,payment
-     * workflow.module.keys.oa=caruse,leave,officalstamp,officesupply,out,overtime
-     * 
- *

- *

- * - * @param processKey 流程定义KEY - * @throws Exception - */ - public void deployFromClasspath(String exportDir, String... processKey) throws Exception { - ResourceLoader resourceLoader = new DefaultResourceLoader(); - String[] processKeys = {"leave", "leave-dynamic-from", "leave-formkey", "dispatch"}; - for (String loopProcessKey : processKeys) { - - /* - * 需要过滤指定流程 - */ - if (ArrayUtils.isNotEmpty(processKey)) { - if (ArrayUtils.contains(processKey, loopProcessKey)) { - logger.debug("hit module of {}", (Object[]) processKey); - deploySingleProcess(resourceLoader, loopProcessKey, exportDir); - } else { - logger.debug("module: {} not equals process key: {}, ignore and continue find next.", loopProcessKey, processKey); - } - } else { - /* - * 所有流程 - */ - deploySingleProcess(resourceLoader, loopProcessKey, exportDir); - } - } - } - - /** - * 部署单个流程定义 - * - * @param resourceLoader {@link ResourceLoader} - * @param processKey 模块名称 - * @throws IOException 找不到zip文件时 - */ - private void deploySingleProcess(ResourceLoader resourceLoader, String processKey, String exportDir) throws IOException { - String classpathResourceUrl = "classpath:/deployments/" + processKey + ".bar"; - logger.debug("read workflow from: {}", classpathResourceUrl); - Resource resource = resourceLoader.getResource(classpathResourceUrl); - InputStream inputStream = resource.getInputStream(); - if (inputStream == null) { - logger.warn("ignore deploy workflow module: {}", classpathResourceUrl); - } else { - logger.debug("finded workflow module: {}, deploy it!", classpathResourceUrl); - ZipInputStream zis = new ZipInputStream(inputStream); - Deployment deployment = repositoryService.createDeployment().addZipInputStream(zis).deploy(); - - // export diagram - List list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list(); - for (ProcessDefinition processDefinition : list) { - WorkflowUtils.exportDiagramToFile(repositoryService, processDefinition, exportDir); - } - } - } - - /** - * 重新部署单个流程定义 - * - * @param processKey 流程定义KEY - * @throws Exception - * @see #deployFromClasspath - */ - public void redeploy(String exportDir, String... processKey) throws Exception { - this.deployFromClasspath(exportDir, processKey); - } - - /** - * 重新部署所有流程定义,调用:{@link #deployFromClasspath()}完成功能 - * - * @throws Exception - * @see #deployFromClasspath - */ - public void deployAllFromClasspath(String exportDir) throws Exception { - this.deployFromClasspath(exportDir); - } - /** - * 根据流程定义,获取流程所有工序 - * - *@param order= desc表示逆序,其它都为顺序 - * @return - */ - public List getAllPDTask(String processDefinitionId,String order){ - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefinitionId); - //根据流程定义获得所有的节点: - List activitiList = def.getActivities(); -// List outTransitions = activityImpl.getOutgoingTransitions(); - List usertasks=new ArrayList<>(); - for(ActivityImpl activityImpl:activitiList){ - //ActivityBehavior behavior=activityImpl.getActivityBehavior(); - if(activityImpl.getProperty("type").equals("userTask")){ - //System.out.println("任务:"+activityImpl.getProperty("name")); - usertasks.add(activityImpl); - } - } - List workTasks=ActivitiUtil.activitiImplToWorkTask(usertasks); - if(order.equals("desc")){ - Collections.reverse(workTasks); - } - return workTasks; - } - - - /**获取工单某工序的下一工序,判断当前工序是否属于订单· - * 若不存在当前工序则返回NO_CURRENT_PROCEDURE - * flag= true/false - * */ - public String getNEXTProcedureCode(String processDefId,String taskDefinitionKey,String flag) { - String res=""; - try{ - if(flag==null || !flag.equals(CommString.ACTI_Condition_FAIL)){ - flag=CommString.ACTI_Condition_PASS; - } - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefId); - //根据流程定义获得所有的节点: - List activitiList = def.getActivities(); - String result=""; - for(ActivityImpl activityImpl:activitiList){ - String id = activityImpl.getId(); - if(taskDefinitionKey.toLowerCase().equals(id.toLowerCase())){ - System.out.println("当前执行的任务:"+activityImpl.getProperty("name")); - //ActivityBehavior behavior=activityImpl.getActivityBehavior(); - //获取从某个节点出来的所有子节点-网关 - List outTransitions_gw = activityImpl.getOutgoingTransitions(); - for(PvmTransition tr_gw:outTransitions_gw){ - //获取线路的终点节点-网关 - PvmActivity ac_gw = tr_gw.getDestination(); - if(ac_gw.getProperty("type").equals("userTask")){ - String acid=ac_gw.getId(); - String acname=ac_gw.getProperty("name").toString(); - res= acid;//"{\"id\":\""+acid+"\",\"name\":\""+acname+"\"}"; - return res; - }else{ - List outTransitions =ac_gw.getOutgoingTransitions(); - for(PvmTransition tr:outTransitions){ - // Condition condition1=(Condition)tr.getProperty("condition"); - // if(condition1.evaluate(new ELTestHelper)) - String condition=(String)tr.getProperty("conditionText"); - if(condition!=null && condition.contains(flag)){ - PvmActivity ac = tr.getDestination(); - String acid=ac.getId(); - //String acname=ac.getProperty("name").toString(); - res=acid;// "{\"id\":\""+acid+"\",\"name\":\""+acname+"\"}"; - return res; - } - } - } - } - } - } - res= CommString.NO_CURRENT_PROCEDURE; - }catch(Exception e){ - e.printStackTrace(); - } - return res; - } - /**获取下一节点---不建议继续使用20190709-王贤平 - * 若不存在当前工序则返回NO_CURRENT_PROCEDURE - * flag= true/false - * */ - @Deprecated - public ActivityImpl getNEXTActivityImpl(String processDefId,String taskDefinitionKey,String flag) { - - ActivityImpl activityImpl=null; - String res=this.getNEXTProcedureCode(processDefId, taskDefinitionKey, flag); - try { - activityImpl = this.getActivitiImp(processDefId, res); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return activityImpl; - } - /**获取所有后续节点--20190709-王贤平 - * 若不存在当前工序则返回NO_CURRENT_PROCEDURE - * flag= true/false - * */ - public List getNEXTActivities(String processDefId,String taskDefinitionKey) { - - List activityImpls=new ArrayList<>(); - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefId); - //根据流程定义获得所有的节点: - List activitiList = def.getActivities(); - for(ActivityImpl activityImpl:activitiList){ - String id = activityImpl.getId(); - if(taskDefinitionKey.toLowerCase().equals(id.toLowerCase())){ - System.out.println("当前执行的任务:"+activityImpl.getProperty("name")); - //获取从某个节点出来的所有子节点-网关 - List outTransitions_gw = activityImpl.getOutgoingTransitions(); - for(PvmTransition tr_gw:outTransitions_gw){ - //获取线路的终点节点-网关 - PvmActivity ac_gw = tr_gw.getDestination(); - if(ac_gw.getProperty("type").equals("userTask") || ac_gw.getProperty("type").equals("endEvent")){ - activityImpls.add((ActivityImpl)ac_gw); - }else{ - List outTransitions =ac_gw.getOutgoingTransitions(); - for(PvmTransition tr:outTransitions){ - PvmActivity ac = tr.getDestination(); - ActivityImpl itemActivityImpl =(ActivityImpl)ac; - activityImpls.add(itemActivityImpl); - } - } - } - break; - } - } - return activityImpls; - } - /** - * 获取所有后续节点--20190709-王贤平 - * 若不存在当前工序则返回NO_CURRENT_PROCEDURE - * flag= true/false - */ - public List getNEXTActivities(List activitiList, String taskDefinitionKey) { - - List activityImpls = new ArrayList<>(); - for (ActivityImpl activityImpl : activitiList) { - String id = activityImpl.getId(); - if (taskDefinitionKey.toLowerCase().equals(id.toLowerCase()) || (StringUtil.isBlank(taskDefinitionKey) && - activityImpl.getProperty("type").equals("startEvent"))) { - System.out.println("当前执行的任务:" + activityImpl.getProperty("name")); - //获取从某个节点出来的所有子节点-网关 - List outTransitions_gw = activityImpl.getOutgoingTransitions(); - for (PvmTransition tr_gw : outTransitions_gw) { - //获取线路的终点节点-网关 - PvmActivity ac_gw = tr_gw.getDestination(); - if (ac_gw.getProperty("type").equals("userTask") || ac_gw.getProperty("type").equals("endEvent")) { - activityImpls.add((ActivityImpl) ac_gw); - } else { - List outTransitions = ac_gw.getOutgoingTransitions(); - for (PvmTransition tr : outTransitions) { - PvmActivity ac = tr.getDestination(); - ActivityImpl itemActivityImpl = (ActivityImpl) ac; - activityImpls.add(itemActivityImpl); - } - } - } - break; - } - } - return activityImpls; - } - /** - * 查找含routeNum的workTask - * @param processDefId - * @param taskDefId - * @return - */ - public List getNextWorkTasks(String processDefId,String taskDefId){ - //根据流程定义获得所有的节点: - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefId); - List activitiList = def.getActivities(); - - //List activityImpls=this.getNEXTActivities(processDefId, taskDefId); - List activityImpls = this.getNEXTActivities(activitiList, taskDefId); - List list=ActivitiUtil.activitiImplToWorkTask(activityImpls); - for (ActivityImpl activityImpl : activitiList) { - if ((StringUtil.isBlank(taskDefId) && - activityImpl.getProperty("type").equals("startEvent"))) { - taskDefId = activityImpl.getId(); - } - } - String pvmTransitionId = ""; - for (WorkTask workTask : list) { - PvmTransition item=this.getTransition(processDefId, taskDefId,workTask.getId(),pvmTransitionId); - pvmTransitionId = item.getId(); - String conditionText=String.valueOf(item.getProperty("conditionText")); - if (conditionText!=null && conditionText.contains("!"+CommString.ACTI_KEK_Condition)) { - workTask.setPassFlag(false); - }else{ - workTask.setPassFlag(true); - } - String name=String.valueOf(item.getProperty("name")); - if (name!=null && !name.isEmpty()) { - String regEx="[^0-9]"; - Pattern p = Pattern.compile(regEx); - Matcher m = p.matcher(name); - String num = m.replaceAll("").trim(); - num=num.isEmpty()?"0":num; - workTask.setRouteNum(Integer.valueOf(num)); - } - } - return list; - } - /** - * 获取两节点的路径条件--20190710-王贤平 - * @param sourceTaskDefId - * @param destTaskDefId - * @param processDefId - * @param pvmTransitionId 出现多路径时,避免重复 - * @return - */ - public PvmTransition getTransition(String processDefId,String sourceTaskDefId,String destTaskDefId,String pvmTransitionId) { - - ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefId); - //根据流程定义获得所有的节点: - List activitiList = def.getActivities(); - for(ActivityImpl activityImpl:activitiList){ - String id = activityImpl.getId(); - if(sourceTaskDefId.toLowerCase().equals(id.toLowerCase())){ - //获取从某个节点出来的所有子节点-网关 - List outTransitions_gw = activityImpl.getOutgoingTransitions(); - for(PvmTransition tr_gw:outTransitions_gw){ - //获取线路的终点节点-网关 - PvmActivity ac_gw = tr_gw.getDestination(); - if(ac_gw.getId().equals(destTaskDefId) && !tr_gw.getId().equals(pvmTransitionId)){ - return tr_gw; - }else{ - List outTransitions =ac_gw.getOutgoingTransitions(); - for(PvmTransition tr:outTransitions){ - PvmActivity ac = tr.getDestination(); - if(ac.getId().equals(destTaskDefId) && !tr.getId().equals(pvmTransitionId)){ - return tr; - } - } - } - } - break; - } - } - return null; - } - /** - * - * 根据任务单编号获取流程定义 - * - * */ - public ProcessDefinition getDestProcessDefinitionByTaskOrder(String productNo){ - List list = new ArrayList(); - ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(productNo).orderByDeploymentId().desc(); - //未查询到的话,返回时间最新的流程 - if(processDefinitionQuery==null || processDefinitionQuery.list()==null || processDefinitionQuery.list().size()==0){ - processDefinitionQuery = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc(); - } - - - List processDefinitionList = processDefinitionQuery.list(); - for (ProcessDefinition processDefinition : processDefinitionList) { - String deploymentId = processDefinition.getDeploymentId(); - Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); - list.add(new Object[]{processDefinition, deployment}); - } -// Collections.sort(list,new Comparator(){ -// public int compare(Object[] arg0, Object[] arg1) { -// return ((Deployment)arg1[1]).getDeploymentTime().compareTo(((Deployment)arg0[1]).getDeploymentTime()); -// } -// }); - ProcessDefinition processDefinition=(ProcessDefinition)list.get(0)[0]; - return processDefinition ; - } - /** - * - * 根据任务单编号获取流程定义 - * - * */ - public List getProcessDefsBykey(String key){ - String wherestr="select p.* from ACT_RE_PROCDEF p left join ACT_RE_DEPLOYMENT d on p.DEPLOYMENT_ID_=d.ID_ where key_ like '%"+key+"%' order by d.DEPLOY_TIME_ desc"; - System.out.println("====="+wherestr); - List processDefinitionList = (ArrayList)repositoryService. - createNativeProcessDefinitionQuery().sql(wherestr).list(); - return processDefinitionList; - } - /** - * 获取定义任务节点信息 - **/ - public ActivityImpl getActivitiImp(String processDefinitionId, String taskDefinitionKey){ - ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) - .getDeployedProcessDefinition(processDefinitionId); - /*List activitiList = processDefinition.getActivities(); - boolean b; - Object activityId; - for (ActivityImpl activity : activitiList) - { - activityId = activity.getId(); - b = activityId.toString().equals(taskDefinitionKey); - if (b) - { - return activity; - } - } - return null; */ - return processDefinition.findActivity(taskDefinitionKey); - } -} diff --git a/src/com/sipai/service/activiti/WorkflowService.java b/src/com/sipai/service/activiti/WorkflowService.java deleted file mode 100644 index ce23d7c2..00000000 --- a/src/com/sipai/service/activiti/WorkflowService.java +++ /dev/null @@ -1,1554 +0,0 @@ -package com.sipai.service.activiti; - -import com.alibaba.fastjson.JSON; -import com.sipai.activiti.util.Page; -import com.sipai.entity.accident.ReasonableAdvice; -import com.sipai.entity.accident.Roast; -import com.sipai.entity.activiti.Leave; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.activiti.TodoTask; -import com.sipai.entity.administration.IndexWork; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.administration.Temporary; -import com.sipai.entity.equipment.*; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.sparepart.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.workorder.OverhaulItemProject; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.accident.ReasonableAdviceService; -import com.sipai.service.accident.RoastService; -import com.sipai.service.administration.IndexWorkService; -import com.sipai.service.administration.OrganizationService; -import com.sipai.service.administration.TemporaryService; -import com.sipai.service.equipment.*; -import com.sipai.service.maintenance.*; -import com.sipai.service.process.ProcessAdjustmentService; -import com.sipai.service.process.RoutineWorkService; -import com.sipai.service.process.WaterTestService; -import com.sipai.service.report.RptCreateService; -import com.sipai.service.sparepart.*; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.workorder.OverhaulItemProjectService; -import com.sipai.service.workorder.OverhaulService; -import com.sipai.service.workorder.WorkorderDetailService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.activiti.engine.*; -import org.activiti.engine.history.HistoricProcessInstance; -import org.activiti.engine.history.HistoricProcessInstanceQuery; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.persistence.entity.ExecutionEntity; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.repository.ProcessDefinitionQuery; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.runtime.ProcessInstanceQuery; -import org.activiti.engine.task.Comment; -import org.activiti.engine.task.Task; -import org.activiti.engine.task.TaskQuery; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -@Service -@Component -public class WorkflowService { - - private static Logger logger = LoggerFactory.getLogger(WorkflowService.class); - - - private RuntimeService runtimeService; - - protected TaskService taskService; - - protected HistoryService historyService; - - protected RepositoryService repositoryService; - - @Autowired - private IdentityService identityService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private SubscribeService subscribeService; - @Resource - private ContractService contractService; - @Resource - private ProcessAdjustmentService processAdjustmentService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private StockCheckService stockCheckService; - @Resource - private EquipmentLoseApplyService equipmentLoseApplyService; - @Resource - private EquipmentScrapApplyService equipmentScrapApplyService; - @Resource - private EquipmentSaleApplyService equipmentSaleApplyService; - @Resource - private EquipmentTransfersApplyService equipmentTransfersApplyService; - @Resource - private EquipmentAcceptanceApplyService equipmentAcceptanceApplyService; - @Resource - private EquipmentStopRecordService equipmentStopRecordService; - @Resource - private IndexWorkService indexWorkService; - @Resource - private OrganizationService organizationService; - @Resource - private TemporaryService temporaryService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private AbnormityService abnormityService; - @Resource - private RawMaterialService rawMaterialService; - @Resource - private ReasonableAdviceService reasonableAdviceService; - @Resource - private RoastService roastService; - @Resource - private EquipmentCardService equipmentCardService; - - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private RepairService repairService; - @Resource - private OverhaulItemProjectService overhaulItemProjectService; - @Resource - private MaintainCarService maintainCarService; - @Resource - private RepairCarService repairCarService; - @Resource - private RoutineWorkService routineWorkService; - @Resource - private WaterTestService waterTestService; - @Resource - private RptCreateService rptCreateService; - @Resource - private OverhaulService overhaulService; - - //启动流程 - public ProcessInstance startWorkflow(String businessKey,String userId,String processDefKey, Map variables){ - ProcessInstance processInstance = null; - try{ - ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery() - .processDefinitionKey(processDefKey).orderByProcessDefinitionVersion().desc(); -// ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefID); - List processDefinitionList = processDefinitionQuery.list(); - if(processDefinitionList!=null && processDefinitionList.size()>0){ - // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中 - identityService.setAuthenticatedUserId(userId); - processInstance = runtimeService.startProcessInstanceById(processDefinitionList.get(0).getId(), businessKey, variables); - } - - }finally { - identityService.setAuthenticatedUserId(null); - } - return processInstance; - } - /**删除运行中流程*/ - public void delProcessInstance(String processInstanceId){ - runtimeService.deleteProcessInstance(processInstanceId,""); - } - /**删除历史流程*/ - public void delHistoryInstance(String processInstanceId){ - historyService.deleteHistoricProcessInstance(processInstanceId); - } - /** - * 读取运行中的流程 - * - * @return - */ - @Transactional(readOnly = true) - public List findRunningProcessInstaces(Page page,int[] pageParams,String processDefinitionKey) { - - List results = new ArrayList(); - ProcessInstanceQuery query = null; - if (processDefinitionKey!=null && !processDefinitionKey.isEmpty()) { - query=runtimeService.createProcessInstanceQuery().processDefinitionKey(processDefinitionKey).orderByProcessInstanceId().desc(); - }else{ - query=runtimeService.createProcessInstanceQuery().orderByProcessInstanceId().desc(); - } - //listPage(arg0,arg1)从arg0开始arg1个 - List list = query.listPage(pageParams[0], pageParams[1]); - - // 关联业务实体 - for (ProcessInstance processInstance : list) { - String businessKey = processInstance.getBusinessKey(); - if (businessKey == null) { - continue; - } - TodoTask todoTask = new TodoTask(); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - - // 设置当前任务信息 - List tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).active().orderByTaskCreateTime().desc().list(); - //流程实例被挂起时,查询不到任务 - if(tasks!=null && tasks.size()>0){ - todoTask.setTask(tasks.get(0)); - } - results.add(todoTask); - } - - page.setTotalCount(query.count());; - page.setResult(results); - return results; - } - - /** - * 读取已结束中的流程 - * - * @return - */ - @Transactional(readOnly = true) - public List findFinishedProcessInstaces(Page page, int[] pageParams) { - List results = new ArrayList(); - HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().processDefinitionKey("leave").finished().orderByProcessInstanceEndTime().desc(); - List list = query.listPage(pageParams[0], pageParams[1]); - - // 关联业务实体 - for (HistoricProcessInstance historicProcessInstance : list) { - String businessKey = historicProcessInstance.getBusinessKey(); - /*Leave leave = leaveManager.getLeave(new Long(businessKey)); - leave.setProcessDefinition(getProcessDefinition(historicProcessInstance.getProcessDefinitionId())); - leave.setHistoricProcessInstance(historicProcessInstance); - results.add(leave);*/ - } - page.setTotalCount(query.count()); - page.setResult(results); - return results; - } - - /** - * 根据任务id获取上一个节点的信息 - * - * @param taskId - * @return - */ - public HistoricTaskInstance queryUpOneNode(String taskId) { - //上一个节点 - List list = historyService - .createHistoricTaskInstanceQuery() - .taskId(taskId).orderByHistoricTaskInstanceEndTime() - .desc() - .list(); - HistoricTaskInstance taskInstance = null; - if (!list.isEmpty()) { - if (list.get(0).getEndTime() != null) { - taskInstance = list.get(0); - } - } - - return taskInstance; - } - /** - * 查询待办任务 - * - * @param userId 用户ID - * @param type 并发时element - * @return - */ - @Transactional(readOnly = true) - public JSONObject findTodoTasks(String userId,int[] pageParams,Map type,int pageNo,int pageSize,String modelKey) { - - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - JSONObject results = new JSONObject(); - JSONArray json= new JSONArray(); - // 开始时间 - long stime = System.currentTimeMillis(); - // 根据当前人的ID查询 - //TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId); - //根据当前人的ID和流程key查询 - TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId).processDefinitionKey(modelKey); - - List list = taskQuery.list(); - // 结束时间 - long etime = System.currentTimeMillis(); - // 计算执行时间 - System.out.println("执行时长:"+(etime - stime)/1000); - int total = list.size(); - results.put("total",total ); - //按照时间排序 - list = list.stream().sorted((s1, s2) -> s2.getCreateTime().compareTo(s1.getCreateTime())).collect(Collectors.toList()); - //分页 - List tasks = list.stream().skip((pageNo-1)*pageSize).limit(pageSize). - collect(Collectors.toList()); - // 开始时间 - stime = System.currentTimeMillis(); - // 根据流程的业务ID查询实体并关联 - for (int i=0;i variables = taskService.getVariables(task.getId()); - if(type!=null && type.get("key")!=null ){ - String key =type.get("key").toString(); - String value =type.get("value").toString(); - if(variables.containsKey(key) && !variables.get(key).toString().equals(value)){ - continue; - } - - } - String processInstanceId = task.getProcessInstanceId(); - if(type!=null && type.get("processInstanceId")!=null && !processInstanceId.equals(type.get("processInstanceId").toString())){ - continue; - } - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).active().singleResult(); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null){ - continue; - } - String businessKey = processInstance.getBusinessKey(); - if (businessKey == null) { - //callactivity调用的流程启动时无businesskey,通过variable中businessKey查找 - if(variables.get("businessKey")!=null){ - businessKey =variables.get("businessKey").toString(); - }else{ - continue; - } - }else{ - variables.put("businessKey", businessKey); - } - - TodoTask todoTask = new TodoTask(); - todoTask.setTask(task); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - - todoTask.setVariables(variables); - todoTask.setType(processDefinition.getKey()); - - try { - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - if(todoTask.getName()==null|| todoTask.getName().isEmpty()){ - todoTask.setName(processDefinition.getKey()); - } - try { - businessKey = todoTask.getVariables().get("businessKey").toString(); - Maintenance maintenance=null; - if(todoTask.getType().contains(ProcessType.S_Maintenance.getId())){ - //系统默认主流程 - maintenance= this.maintenanceService.selectById(businessKey); - todoTask.setBusiness(maintenance); - }else if (todoTask.getType().contains(ProcessType.Administration_IndexWork.getId())) { - IndexWork indexWork = this.indexWorkService.selectById(businessKey); - if(indexWork!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(indexWork.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("指标控制工作"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.Administration_Organization.getId())) { - Organization organization = this.organizationService.selectById(businessKey); - if(organization!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(organization.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("组织工作"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.Administration_Reserve.getId())) { - Organization organization = this.organizationService.selectById(businessKey); - if(organization!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(organization.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("预案工作"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.Administration_Temporary.getId())) { - Temporary temporary = this.temporaryService.selectById(businessKey); - if(temporary!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(temporary.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("行政综合临时任务"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.B_Purchase.getId())) { - Subscribe subscribe = this.subscribeService.selectById(businessKey); - if(subscribe!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(subscribe.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资申购审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if (todoTask.getType().contains(ProcessType.B_Contract.getId())) { - Contract contract = this.contractService.selectById(businessKey); - if(contract!=null){ - maintenance=new Maintenance(); - Company company = unitService.getCompById(contract.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("采购合同审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - }else if(todoTask.getType().contains(ProcessType.Process_Adjustment.getId())){ - ProcessAdjustment processAdjustment = this.processAdjustmentService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(processAdjustment.getUnitId()); - maintenance.setCompany(company); - //将问题详情内容复制到中间变量 - maintenance.setProblem(processAdjustment.getContents()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.B_Maintenance.getId())){ - MaintenanceDetail maintenanceDetail = this.maintenanceDetailService.selectById(businessKey); - if (null!=maintenanceDetail.getMaintenanceid() && !maintenanceDetail.getMaintenanceid().isEmpty()) { - maintenance= this.maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - }else{ - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenanceDetail.getCompanyid()); - maintenance.setCompany(company); - } - //将问题详情内容复制到中间变量 - maintenance.setProblem(maintenanceDetail.getProblemcontent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.I_Stock.getId())){ - InStockRecord inStockRecord = this.inStockRecordService.selectById(businessKey); - if (inStockRecord == null) { - continue; - } - maintenance=new Maintenance(); - Company company = unitService.getCompById(inStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资入库审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Raw_Material.getId())){ - RawMaterial rawMaterial = this.rawMaterialService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(rawMaterial.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("药剂检验"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Reasonable_Advice.getId())){ - ReasonableAdvice reasonableAdvice = this.reasonableAdviceService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(reasonableAdvice.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("合理化建议审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Roast.getId())){ - Roast entity = this.roastService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(entity.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("吐槽内容审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintain_Car.getId())){ - MaintainCar maintainCar = this.maintainCarService.selectById(businessKey); - maintenance=new Maintenance(); - if(maintainCar!=null){ - Company company = unitService.getCompById(maintainCar.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("车辆维保审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Repair_Car.getId())){ - RepairCar repairCar = this.repairCarService.selectById(businessKey); - maintenance=new Maintenance(); - if(repairCar!=null){ - Company company = unitService.getCompById(repairCar.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("车辆维修审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.O_Stock.getId())){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(businessKey); - if (outStockRecord == null) { - continue; - } - maintenance=new Maintenance(); - Company company = unitService.getCompById(outStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("物资领用审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Scetion_Stock.getId())){ - OutStockRecord outStockRecord = this.outStockRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(outStockRecord.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("处级物资领用审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Stock_Check.getId())){ - StockCheck stockCheck = this.stockCheckService.selectById(businessKey); - if (stockCheck == null) { - continue; - } - maintenance=new Maintenance(); - Company company = unitService.getCompById(stockCheck.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("库存盘点审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintain_Plan.getId())){ - //之前老的单条计划 - /*MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenancePlan.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem(maintenancePlan.getContent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance);*/ - - //主附表计划 - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(businessKey); - maintenance=new Maintenance(); - if(equipmentPlan!=null){ - if(equipmentPlan.getUnitId()!=null){ - Company company = unitService.getCompById(equipmentPlan.getUnitId()); - maintenance.setCompany(company); - } - if(equipmentPlan.getPlanContents()!=null){ -// equipmentPlan.get - maintenance.setProblem(equipmentPlan.getPlanContents()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - else if(todoTask.getType().contains(ProcessType.Repair_Plan.getId())){ - //之前老的单条计划 - /*EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(maintenancePlan.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem(maintenancePlan.getContent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance);*/ - - //主附表计划 - System.out.println(businessKey); - EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(businessKey); - maintenance=new Maintenance(); - if(equipmentPlan!=null){ - if(equipmentPlan.getUnitId()!=null){ - Company company = unitService.getCompById(equipmentPlan.getUnitId()); - maintenance.setCompany(company); - } - if(equipmentPlan.getPlanContents()!=null){ - maintenance.setProblem(equipmentPlan.getPlanContents()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - else if(todoTask.getType().contains(ProcessType.Lose_Apply.getId())){ - EquipmentLoseApply loseApply = this.equipmentLoseApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(loseApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备丢失申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Sale_Apply.getId())){ - EquipmentSaleApply saleApply = this.equipmentSaleApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(saleApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备出售申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Scrap_Apply.getId())){ - EquipmentScrapApply scrapApply = this.equipmentScrapApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(scrapApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备报废申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Transfers_Apply.getId())){ - EquipmentTransfersApply transfersApply = this.equipmentTransfersApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(transfersApply.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备调拨申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Acceptance_Apply.getId())){ - EquipmentAcceptanceApply eaa = equipmentAcceptanceApplyService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(eaa.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备验收申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.EquipmentStop_Apply.getId())){ - EquipmentStopRecord esr = equipmentStopRecordService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getBizId()); - maintenance.setCompany(company); - maintenance.setProblem("设备启用/停用申请"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Maintenance_Repair.getId())){ - Repair esr = repairService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("维修流程"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Programme_Write.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("方案编制"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Bidding_Price.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - maintenance.setProblem("招标比价"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Install_Debug.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - if (esr != null) { - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("安装调试"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Project_Check.getId())){ - OverhaulItemProject esr = overhaulItemProjectService.selectById(businessKey); - maintenance=new Maintenance(); - if (esr != null) { - Company company = unitService.getCompById(esr.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("项目验收"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Routine_Work.getId())){ - RoutineWork routineWork = routineWorkService.selectById(businessKey); - maintenance=new Maintenance(); - if (routineWork != null) { - Company company = unitService.getCompById(routineWork.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("周期常规工单"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Water_Test.getId())){ - WaterTest waterTest = waterTestService.selectById(businessKey); - maintenance=new Maintenance(); - if (waterTest != null) { - Company company = unitService.getCompById(waterTest.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("水质化验工单"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if (todoTask.getType().contains(ProcessType.Overhaul.getId())){ - Overhaul overhaul = this.overhaulService.selectById(businessKey); - maintenance=new Maintenance(); - if (overhaul != null) { - Company company = unitService.getCompById(overhaul.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem(overhaul.getProjectDescribe()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - } - else if(todoTask.getType().contains(ProcessType.Report_Check.getId())){ - RptCreate rptCreate = rptCreateService.selectById(businessKey); - maintenance=new Maintenance(); - if (rptCreate != null) { - Company company = unitService.getCompById(rptCreate.getUnitId()); - maintenance.setCompany(company); - } - maintenance.setProblem("报表审核"); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Repair.getId())){ - WorkorderDetail entity = this.workorderDetailService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getUnitId()!=null){ - Company company = unitService.getCompById(entity.getUnitId()); - maintenance.setCompany(company); - } - if(entity.getFaultDescription()!=null){ - EquipmentCard equipmentCard = equipmentCardService.selectById(entity.getEquipmentId()); - if(equipmentCard!=null){ - String name = "(" + equipmentCard.getEquipmentname() + ") "; - maintenance.setProblem(name + entity.getFaultDescription()); - } - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Abnormity_Run.getId())){ - //异常上报(运行) - Abnormity entity = this.abnormityService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getBizId()!=null){ - Company company = unitService.getCompById(entity.getBizId()); - maintenance.setCompany(company); - } - if(entity.getAbnormityDescription()!=null){ - maintenance.setProblem(entity.getAbnormityDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Abnormity_Equipment.getId())){ - //异常上报(设备) - Abnormity entity = this.abnormityService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getBizId()!=null){ - Company company = unitService.getCompById(entity.getBizId()); - maintenance.setCompany(company); - } - if(entity.getAbnormityDescription()!=null){ - maintenance.setProblem(entity.getAbnormityDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Abnormity_Facilities.getId())){ - //异常上报(设施) - Abnormity entity = this.abnormityService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getBizId()!=null){ - Company company = unitService.getCompById(entity.getBizId()); - maintenance.setCompany(company); - } - if(entity.getAbnormityDescription()!=null){ - maintenance.setProblem(entity.getAbnormityDescription()); - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else if(todoTask.getType().contains(ProcessType.Workorder_Maintain.getId())){ - //主附表计划 - WorkorderDetail entity = this.workorderDetailService.selectById(businessKey); - maintenance=new Maintenance(); - if(entity!=null){ - if(entity.getUnitId()!=null){ - Company company = unitService.getCompById(entity.getUnitId()); - maintenance.setCompany(company); - } - if(entity.getSchemeResume()!=null){ - EquipmentCard equipmentCard = equipmentCardService.selectById(entity.getEquipmentId()); - if(equipmentCard!=null){ - String name = "(" + equipmentCard.getEquipmentname() + ") "; - maintenance.setProblem(name + entity.getSchemeResume()); - }else{ - maintenance.setProblem(entity.getSchemeResume()); - } - - } - } - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - }else { - //通用 - String str = todoTask.getType(); - //截取-之后字符串 - String str1 = str.substring(0, str.indexOf("-")); - String unitId = str.substring(str1.length()+1, str.length()); - JSONObject obj =new JSONObject(); - Company company = unitService.getCompById(unitId); - obj.put("company", company); - //问题描述,默认为节点名称 - obj.put("problem", todoTask.getTask().getName()); - obj.put("status", todoTask.getTask().getDescription()); - todoTask.setBusiness(obj); - } - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - JSONObject item= new JSONObject(); - TodoTask object= todoTask ; - //leave根属性 - item.put("id", object.getId()); - item.put("name", object.getName()); - item.put("type", object.getType()); - variables = object.getVariables(); - if (variables!=null ) { - item.put("userIds",variables.get("userIds")); - } - - //activiti属性 - ExecutionEntity pInstance=(ExecutionEntity)object.getProcessInstance(); - if(pInstance!=null){ -// System.out.println(pInstance.getProcessVariables().toString()); -// JSONObject jb=JSONObject.fromObject(pInstance.getProcessVariables()); - JSONObject jbpInstance= new JSONObject(); - jbpInstance.put("activityId", pInstance.getActivityId()); - jbpInstance.put("businessKey", pInstance.getBusinessKey()); - jbpInstance.put("id", pInstance.getId()); - //pInstance判断当前任务是否是激活或挂起,1是激活,2是挂起 - jbpInstance.put("suspended", pInstance.getSuspensionState()); - item.put("processInstance", jbpInstance); - } - - ProcessDefinition pd=object.getProcessDefinition(); - if(pd!=null){ - JSONObject jbpDefinition= new JSONObject(); - jbpDefinition.put("deploymentId", pd.getDeploymentId()); - jbpDefinition.put("description", pd.getDescription()); - jbpDefinition.put("id", pd.getId()); - jbpDefinition.put("Key", pd.getKey()); - jbpDefinition.put("name", pd.getName()); - jbpDefinition.put("resourceName", pd.getResourceName()); - jbpDefinition.put("revision", pd.getVersion()); - item.put("processDefinition", jbpDefinition); - } - if(task!=null){ - JSONObject jbpTask= new JSONObject(); - jbpTask.put("createTime", sdf.format(task.getCreateTime())); - jbpTask.put("executionId", task.getExecutionId()); - jbpTask.put("name", task.getName()); - jbpTask.put("id", task.getId()); - jbpTask.put("processDefinitionId", task.getProcessDefinitionId()); - jbpTask.put("processInstanceId", task.getProcessInstanceId()); - jbpTask.put("assignee", task.getAssignee()); - jbpTask.put("taskDefinitionKey",task.getTaskDefinitionKey()); - jbpTask.put("status",task.getDescription()); - //上一个节点执行人 - HistoricTaskInstance historicTaskInstance = queryUpOneNode(task.getId()); - User user = null; - if(historicTaskInstance!=null){ - user = userService.getUserById(historicTaskInstance.getAssignee()); - }else{ - String startUserId = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult().getStartUserId();//获取发起人 - if(startUserId!=null && !startUserId.isEmpty()){ - user = userService.getUserById(startUserId); - } - } - jbpTask.put("prevAssignee",user); - item.put("task", jbpTask); - } - //Maintenance maintenance= (Maintenance)object.getBusiness(); - item.put("business", JSONObject.fromObject(object.getBusiness())); - User user= (User)object.getAssigneeUser(); - item.put("assigneeUser", JSONObject.fromObject(user)); - json.add(item); - //默认浅复制,因为在子流程中查询到的leave会发生重复,要改为深复制 - //results.add((TodoTask)todoTask.clone()); - } - - // 结束时间 - etime = System.currentTimeMillis(); - // 计算执行时间 - System.out.println("执行时长:"+(etime - stime)/1000); -// page.setTotalCount(taskQuery.count()); -// page.setResult(results); - results.put("rows", json); - return results; - } - /** - * 查询待办任务 - * - * @param userId 用户ID - * @param type 并发时element - * @return - */ - @Transactional(readOnly = true) - public List findTodoTasks(String userId,int[] pageParams,Map type) { - List results = new ArrayList(); - - // 根据当前人的ID查询 - TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId); - List tasks = taskQuery.list(); - - // 根据流程的业务ID查询实体并关联 - for (int i=0;i variables = taskService.getVariables(task.getId()); - if(type!=null && type.get("key")!=null ){ - String key =type.get("key").toString(); - String value =type.get("value").toString(); - if(variables.containsKey(key) && !variables.get(key).toString().equals(value)){ - continue; - } - - } - String processInstanceId = task.getProcessInstanceId(); - if(type!=null && type.get("processInstanceId")!=null && !processInstanceId.equals(type.get("processInstanceId").toString())){ - continue; - } - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).active().singleResult(); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null){ - continue; - } - String businessKey = processInstance.getBusinessKey(); - if (businessKey == null) { - //callactivity调用的流程启动时无businesskey,通过variable中businessKey查找 - if(variables.get("businessKey")!=null){ - businessKey =variables.get("businessKey").toString(); - }else{ - continue; - } - }else{ - variables.put("businessKey", businessKey); - } - - TodoTask todoTask = new TodoTask(); - todoTask.setTask(task); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - - todoTask.setVariables(variables); - todoTask.setType(processDefinition.getKey()); - - try { - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - if(todoTask.getName()==null|| todoTask.getName().isEmpty()){ - todoTask.setName(processDefinition.getKey()); - } - //默认浅复制,因为在子流程中查询到的leave会发生重复,要改为深复制 - results.add((TodoTask)todoTask.clone()); - } - -// page.setTotalCount(taskQuery.count()); -// page.setResult(results); - return results; - } - - /** - * 查询待办任务-单个 - * - * @param taskId - * @param processInstanceId - * @return - */ - @Transactional(readOnly = true) - public TodoTask findTodoTask(String taskId,String processInstanceId) { - Map variables = taskService.getVariables(taskId); - //使用当前任务ID,获取当前任务对象 - Task task = taskService.createTaskQuery()// - .taskId(taskId)//使用任务ID查询 - .singleResult(); - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null){ - return null; - } - String businessKey = processInstance.getBusinessKey(); - if (businessKey == null) { - //callactivity调用的流程启动时无businesskey,通过variable中businessKey查找 - if(variables.get("businessKey")!=null){ - businessKey =variables.get("businessKey").toString(); - }else{ - return null; - } - }else{ - variables.put("businessKey", businessKey); - } - - TodoTask todoTask = new TodoTask(); - todoTask.setTask(task); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - todoTask.setVariables(variables); - todoTask.setType(processDefinition.getKey()); - - try { - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - if(todoTask.getName()==null|| todoTask.getName().isEmpty()){ - todoTask.setName(processDefinition.getKey()); - } - return (TodoTask)todoTask.clone(); - } - /** - * - *根据运维单获取流程任务 - * @param - * @param - * @return - */ - @Transactional(readOnly = true) - public TodoTask getTodoTask(Maintenance maintenance) { - - // 根据当前人的ID查询 - String processInstanceId= maintenance.getProcessid(); - - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).active().singleResult(); - Task task =taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult(); - Map variables = taskService.getVariables(task.getId()); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null|| task==null){ - return null; - } - variables.put("businessKey", maintenance.getId()); - - TodoTask todoTask = new TodoTask(); - todoTask.setTask(task); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - - todoTask.setVariables(variables); - todoTask.setType(processDefinition.getKey()); - todoTask.setBusiness(maintenance); - if (task.getAssignee()!=null && !task.getAssignee().isEmpty()) { - User user=userService.getUserById(task.getAssignee()); - todoTask.setAssigneeUser(user); - } - - try { - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - if(todoTask.getName()==null|| todoTask.getName().isEmpty()){ - todoTask.setName(processDefinition.getKey()); - } - - return todoTask; - } - /** - * - *根据运维详情获取流程任务 - * @param - * @param - * @return - */ - @Transactional(readOnly = true) - public TodoTask getTodoTask(MaintenanceDetail maintenanceDetail) { - - // 根据当前人的ID查询 - String processInstanceId= maintenanceDetail.getProcessid(); - - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).active().singleResult(); - Task task =taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult(); - if(task==null){ - return null; - } - Map variables = taskService.getVariables(task.getId()); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null || task==null){ - return null; - } - variables.put("businessKey", maintenanceDetail.getId()); - - TodoTask todoTask = new TodoTask(); - todoTask.setTask(task); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - - todoTask.setVariables(variables); - todoTask.setType(processDefinition.getKey()); - //统一TODOtask的business类型 - Maintenance maintenance =new Maintenance(); - Company company = unitService.getCompById(maintenanceDetail.getCompanyid()); - maintenance.setCompany(company); - //将问题详情内容复制到中间变量 - maintenance.setProblem(maintenanceDetail.getProblemcontent()); - maintenance.setStatus(todoTask.getTask().getDescription()); - todoTask.setBusiness(maintenance); - if (task.getAssignee()!=null && !task.getAssignee().isEmpty()) { - User user=userService.getUserById(task.getAssignee()); - todoTask.setAssigneeUser(user); - } - try { - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - if(todoTask.getName()==null|| todoTask.getName().isEmpty()){ - todoTask.setName(processDefinition.getKey()); - } - - return todoTask; - } - - @Transactional(readOnly = true) - public TodoTask getTodoTask(String processInstanceId,String businessKey,Object business) { - - // 根据当前人的ID查询 - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).active().singleResult(); - Task task =taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult(); - Map variables = taskService.getVariables(task.getId()); - //流程实例挂起时,上获取的active processInstance为null - if(processInstance==null || task==null){ - return null; - } - variables.put("businessKey", businessKey); - - TodoTask todoTask = new TodoTask(); - todoTask.setTask(task); - todoTask.setProcessInstance(processInstance); - ProcessDefinition processDefinition=getProcessDefinition(processInstance.getProcessDefinitionId()); - todoTask.setProcessDefinition(processDefinition); - - todoTask.setVariables(variables); - todoTask.setType(processDefinition.getKey()); - //统一TODOtask的business类型 - todoTask.setBusiness(business); - if (task.getAssignee()!=null && !task.getAssignee().isEmpty()) { - User user=userService.getUserById(task.getAssignee()); - todoTask.setAssigneeUser(user); - } - try { - ProcessType[] types=ProcessType.values(); - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - todoTask.setName(item.getName()); - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - if(todoTask.getName()==null|| todoTask.getName().isEmpty()){ - todoTask.setName(processDefinition.getKey()); - } - - return todoTask; - } - /** - * 查询任务comment - * - * @param taskId - * @param taskDefKey - * @return - */ - @Transactional(readOnly = true) - public List findTaskComments(String taskId,String taskDefKey) { - List list = new ArrayList(); - //使用当前的任务ID,查询当前流程对应的历史任务ID - - //使用当前任务ID,获取当前任务对象 - Task task = taskService.createTaskQuery()// - .taskId(taskId)//使用任务ID查询 - .singleResult(); - //获取流程实例ID - String processInstanceId = task.getProcessInstanceId(); - //使用流程实例ID,查询历史任务,获取历史任务对应的每个任务ID - List htiList = historyService.createHistoricTaskInstanceQuery()//历史任务表查询 - .processInstanceId(processInstanceId)//使用流程实例ID查询 - .list(); - //遍历集合,获取每个任务ID - if(htiList!=null && htiList.size()>0){ - for(HistoricTaskInstance hti:htiList){ - //任务ID - String htaskId = hti.getId(); - //获取批注信息 - if(taskDefKey!=null && hti.getTaskDefinitionKey().equals(taskDefKey)){ - list = taskService.getTaskComments(htaskId);//对用历史完成后的任务ID - } - } - } - return list; - - } - /** - * 查询已处理任务列表。 - * - * @param assignee 用户 - * @return 已处理任务列表 - */ - public List queryDoneTasks(String assignee,String modelKey) { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List taskList = historyService.createHistoricTaskInstanceQuery() - .taskAssignee(assignee) - .finished().processDefinitionKey(modelKey) - .list(); - List leaveTasks = new ArrayList<>(); - for (HistoricTaskInstance task : taskList) { - Leave leaveTask = new Leave(); - - String processInstanceId = task.getProcessInstanceId(); - //根据历史流程实例,获得业务key - HistoricProcessInstance hisProcess= historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - - leaveTask.setHistoricProcessInstance(hisProcess); - ProcessDefinition processDefinition=getProcessDefinition(task.getProcessDefinitionId()); - if(processDefinition!=null){ - leaveTask.setProcessDefinition(processDefinition); - leaveTask.setType(processDefinition.getKey()); - leaveTask.setTaskId(task.getId());//流程实例id - leaveTask.setTaskHis(task);//流程实例id - try { - ProcessType[] types=ProcessType.values(); - Maintenance maintenance=null; - for (ProcessType item : types) { - if(processDefinition.getKey()!=null && processDefinition.getKey().contains(item.getId())){ - leaveTask.setName(item.getName()); - if(leaveTask.getType().contains(item.getId())){ - //系统默认主流程 - maintenance=new Maintenance(); - maintenance.setProblem(item.getName()); - maintenance.setStatus(task.getDescription()); - leaveTask.setBusiness(maintenance); - } - break; - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - } - if(leaveTask.getName()==null){ - leaveTask.setName(task.getName()); - } - leaveTask.setProcessDefinitionId(task.getProcessDefinitionId());//流程实例所属流程定义id - leaveTask.setProcessInstanceId(task.getProcessInstanceId()); - leaveTask.setStartTime(sdf.format(task.getStartTime()));//开始执行时间 - leaveTask.setUserId(task.getAssignee()); - leaveTask.setEndTime(sdf.format(task.getEndTime()));//结束执行时间 - leaveTasks.add(leaveTask); - } - return leaveTasks; - } - public JSONArray todoTasklistToJsonArray(List list){ - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - JSONArray json= new JSONArray(); - if (list!=null) { - for(int i=0;i variables = object.getVariables(); - if (variables!=null ) { - item.put("userIds",variables.get("userIds")); - } - - //activiti属性 - ExecutionEntity pInstance=(ExecutionEntity)object.getProcessInstance(); - if(pInstance!=null){ -// System.out.println(pInstance.getProcessVariables().toString()); -// JSONObject jb=JSONObject.fromObject(pInstance.getProcessVariables()); - JSONObject jbpInstance= new JSONObject(); - jbpInstance.put("activityId", pInstance.getActivityId()); - jbpInstance.put("businessKey", pInstance.getBusinessKey()); - jbpInstance.put("id", pInstance.getId()); - //pInstance判断当前任务是否是激活或挂起,1是激活,2是挂起 - jbpInstance.put("suspended", pInstance.getSuspensionState()); - item.put("processInstance", jbpInstance); - } - - ProcessDefinition pd=object.getProcessDefinition(); - if(pd!=null){ - JSONObject jbpDefinition= new JSONObject(); - jbpDefinition.put("deploymentId", pd.getDeploymentId()); - jbpDefinition.put("description", pd.getDescription()); - jbpDefinition.put("id", pd.getId()); - jbpDefinition.put("Key", pd.getKey()); - jbpDefinition.put("name", pd.getName()); - jbpDefinition.put("resourceName", pd.getResourceName()); - jbpDefinition.put("revision", pd.getVersion()); - item.put("processDefinition", jbpDefinition); - } - - - Task task=object.getTask(); - if(task!=null){ - JSONObject jbpTask= new JSONObject(); - jbpTask.put("createTime", sdf.format(task.getCreateTime())); - jbpTask.put("executionId", task.getExecutionId()); - jbpTask.put("name", task.getName()); - jbpTask.put("id", task.getId()); - jbpTask.put("processDefinitionId", task.getProcessDefinitionId()); - jbpTask.put("processInstanceId", task.getProcessInstanceId()); - jbpTask.put("assignee", task.getAssignee()); - jbpTask.put("taskDefinitionKey",task.getTaskDefinitionKey()); - jbpTask.put("status",task.getDescription()); - item.put("task", jbpTask); - } - //Maintenance maintenance= (Maintenance)object.getBusiness(); - item.put("business", JSONObject.fromObject(object.getBusiness())); - User user= (User)object.getAssigneeUser(); - item.put("assigneeUser", JSONObject.fromObject(user)); - json.add(item); - } - } - sdf=null; - return json; - } - public JSONArray doneTasklistToJsonArray(List list){ - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - JSONArray json= new JSONArray(); - if (list!=null) { - for(int i=0;i variables = object.getVariables(); - if (variables!=null ) { - item.put("userIds",variables.get("userIds")); - } - - //activiti属性 - ExecutionEntity pInstance=(ExecutionEntity)object.getProcessInstance(); - if(pInstance!=null){ - JSONObject jbpInstance= new JSONObject(); - jbpInstance.put("activityId", pInstance.getActivityId()); - jbpInstance.put("businessKey", pInstance.getBusinessKey()); - jbpInstance.put("id", pInstance.getId()); - //pInstance判断当前任务是否是激活或挂起,1是激活,2是挂起 - jbpInstance.put("suspended", pInstance.getSuspensionState()); - item.put("processInstance", jbpInstance); - } - HistoricProcessInstance historicProcessInstance=(HistoricProcessInstance)object.getHistoricProcessInstance(); - if(historicProcessInstance!=null){ - JSONObject jbhistoricProcessInstance= new JSONObject(); - jbhistoricProcessInstance.put("activityId", historicProcessInstance.getStartActivityId()); - jbhistoricProcessInstance.put("businessKey", historicProcessInstance.getBusinessKey()); - jbhistoricProcessInstance.put("id", historicProcessInstance.getId()); - item.put("historicProcessInstance", jbhistoricProcessInstance); - } - - ProcessDefinition pd=object.getProcessDefinition(); - if(pd!=null){ - JSONObject jbpDefinition= new JSONObject(); - jbpDefinition.put("deploymentId", pd.getDeploymentId()); - jbpDefinition.put("description", pd.getDescription()); - jbpDefinition.put("id", pd.getId()); - jbpDefinition.put("Key", pd.getKey()); - jbpDefinition.put("name", pd.getName()); - jbpDefinition.put("resourceName", pd.getResourceName()); - jbpDefinition.put("revision", pd.getVersion()); - item.put("processDefinition", jbpDefinition); - } - - - HistoricTaskInstance task=object.getTaskHis(); - if(task!=null){ - JSONObject jbpTask= new JSONObject(); - jbpTask.put("startTime", sdf.format(task.getStartTime())); - jbpTask.put("endTime", sdf.format(task.getEndTime())); - jbpTask.put("executionId", task.getExecutionId()); - jbpTask.put("name", task.getName()); - jbpTask.put("id", task.getId()); - jbpTask.put("processDefinitionId", task.getProcessDefinitionId()); - jbpTask.put("processInstanceId", task.getProcessInstanceId()); - jbpTask.put("assignee", task.getAssignee()); - jbpTask.put("taskDefinitionKey",task.getTaskDefinitionKey()); - jbpTask.put("status",task.getDescription()); - item.put("task", jbpTask); - } - //Maintenance maintenance= (Maintenance)object.getBusiness(); - item.put("business", JSONObject.fromObject(object.getBusiness())); - User user= (User)object.getAssigneeUser(); - item.put("assigneeUser", JSONObject.fromObject(user)); - json.add(item); - } - } - sdf=null; - return json; - } - /** - * 查询已完成流程。 - * - * @param assignee 用户 - * @return 已完成流程列表 - */ - public com.alibaba.fastjson.JSONArray queryFinishTasks(String assignee) { - - ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); - HistoryService historyService = processEngine.getHistoryService(); - - //创建历史流程实例,查询对象 - HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery(); - - //设置查询条件 - //指定流程定义key,只查询某个业务流程的实例 - ProcessType[] types=ProcessType.values(); - com.alibaba.fastjson.JSONArray result= new com.alibaba.fastjson.JSONArray(); - for (ProcessType item : types) { - String processDefinitionKey = item.getId(); - //System.out.println("processDefinitionKey:"+processDefinitionKey); - historicProcessInstanceQuery.processDefinitionKey(processDefinitionKey). - //设置只查询已完成的 - finished().orderByProcessInstanceStartTime().desc(); - //数据列表 - List list = historicProcessInstanceQuery.list(); - com.alibaba.fastjson.JSONArray json= new com.alibaba.fastjson.JSONArray(); - //System.out.println("size:"+list.size()); - if(list!=null && list.size()>0){ - json = com.alibaba.fastjson.JSONArray.parseArray(JSON.toJSONString(list)); - result.addAll(json); - } - } - return result; - } - /** - * 查询流程定义对象 - * - * @param processDefinitionId 流程定义ID - * @return - */ - protected ProcessDefinition getProcessDefinition(String processDefinitionId) { - ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); - return processDefinition; - } - - - @Autowired - public void setRuntimeService(RuntimeService runtimeService) { - this.runtimeService = runtimeService; - } - - @Autowired - public void setTaskService(TaskService taskService) { - this.taskService = taskService; - } - - @Autowired - public void setHistoryService(HistoryService historyService) { - this.historyService = historyService; - } - - @Autowired - public void setRepositoryService(RepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - public IdentityService getIdentityService() { - return identityService; - } - public void setIdentityService(IdentityService identityService) { - this.identityService = identityService; - } - public RuntimeService getRuntimeService() { - return runtimeService; - } - public TaskService getTaskService() { - return taskService; - } - public HistoryService getHistoryService() { - return historyService; - } - public RepositoryService getRepositoryService() { - return repositoryService; - } - - -} diff --git a/src/com/sipai/service/activiti/WorkflowTraceService.java b/src/com/sipai/service/activiti/WorkflowTraceService.java deleted file mode 100644 index 191a3fb7..00000000 --- a/src/com/sipai/service/activiti/WorkflowTraceService.java +++ /dev/null @@ -1,317 +0,0 @@ -package com.sipai.service.activiti; - - -import org.activiti.engine.IdentityService; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.delegate.Expression; -import org.activiti.engine.identity.User; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.delegate.ActivityBehavior; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.impl.task.TaskDefinition; -import org.activiti.engine.runtime.Execution; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.activiti.engine.task.TaskQuery; -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; - -import com.sipai.activiti.util.WorkflowUtils; - -import java.util.*; - -/** - * 工作流跟踪相关Service - * - * @author HenryYan - */ -@Service -@Component -public class WorkflowTraceService { - protected Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - protected RuntimeService runtimeService; - - @Autowired - protected TaskService taskService; - - @Autowired - protected RepositoryService repositoryService; - - @Autowired - protected IdentityService identityService; - - /** - * 流程跟踪图 - * - * @param processInstanceId 流程实例ID - * @return 封装了各种节点信息 - */ - public List> traceProcess(String processInstanceId,String taskId) throws Exception { -// List executionss = runtimeService.createExecutionQuery().executionId(processInstanceId).list();//执行实例 - Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例 - Object property = PropertyUtils.getProperty(execution, "activityId"); - String activityId = ""; - if (property != null) { - activityId = property.toString(); - } - - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId) - .singleResult(); - ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) - .getDeployedProcessDefinition(processInstance.getProcessDefinitionId()); - List activitiList = processDefinition.getActivities();//获得当前任务的所有节点 - //----获取子流程内的acitiviti - List activitiList_son =new ArrayList<>(); - for (ActivityImpl activityImpl : activitiList) { - if(activityImpl.getActivities().size()>0){ - activitiList_son.addAll(activityImpl.getActivities()); - } - - } - activitiList.addAll(activitiList_son); - //--------------- - if(activityId.isEmpty()){ - // 根据当前人的ID查询 - TaskQuery taskQuery =taskService.createTaskQuery().processInstanceId(processInstanceId); - if(taskId!=null && !taskId.isEmpty()){ - taskQuery.taskId(taskId); - } - List tasks = taskQuery.list(); - if(tasks!=null && tasks.size()>1){ - String son_Id =tasks.get(0).getTaskDefinitionKey(); - for (ActivityImpl activityImpl : activitiList) { - if(activityImpl.getId().equals(son_Id)){ - activityId=activityImpl.getParentActivity().getId(); - break; - } - } - }else if(tasks!=null && tasks.size()==1){ - activityId=tasks.get(0).getTaskDefinitionKey(); - } - } - List> activityInfos = new ArrayList>(); - for (ActivityImpl activity : activitiList) { - - boolean currentActiviti = false; - String id = activity.getId(); - - // 当前节点 - if (id.equals(activityId)) { - currentActiviti = true; - } - - Map activityImageInfo = packageSingleActivitiInfo(activity, processInstance, currentActiviti); - - activityInfos.add(activityImageInfo); - } - - return activityInfos; - } - - /** - * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述 - * - * @param activity - * @param processInstance - * @param currentActiviti - * @return - */ - private Map packageSingleActivitiInfo(ActivityImpl activity, ProcessInstance processInstance, - boolean currentActiviti) throws Exception { - Map vars = new HashMap(); - Map activityInfo = new HashMap(); - activityInfo.put("currentActiviti", currentActiviti); - setPosition(activity, activityInfo); - setWidthAndHeight(activity, activityInfo); - - Map properties = activity.getProperties(); - vars.put("任务类型", WorkflowUtils.parseToZhType(properties.get("type").toString())); - - ActivityBehavior activityBehavior = activity.getActivityBehavior(); - logger.debug("activityBehavior={}", activityBehavior); - if (activityBehavior instanceof UserTaskActivityBehavior) { - - Task currentTask = null; - - /* - * 当前节点的task - */ - if (currentActiviti) { - currentTask = getCurrentTaskInfo(processInstance); - } - - /* - * 当前任务的分配角色 - */ - UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior; - TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition(); - Set candidateGroupIdExpressions = taskDefinition.getCandidateGroupIdExpressions(); - if (!candidateGroupIdExpressions.isEmpty()) { - - // 任务的处理角色 - setTaskGroup(vars, candidateGroupIdExpressions); - - // 当前处理人 - if (currentTask != null) { - setCurrentTaskAssignee(vars, currentTask); - } - } - } - - vars.put("节点说明", properties.get("documentation")); - - String description = activity.getProcessDefinition().getDescription(); - vars.put("描述", description); - - logger.debug("trace variables: {}", vars); - activityInfo.put("vars", vars); - return activityInfo; - } - /** - * 流程跟踪图-流程定义 - * - * @param pdd 流程定义ID - * @return 封装了各种节点信息 - */ - public List> traceProcessByDefinitionId(String pdd) throws Exception { - ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) - .getDeployedProcessDefinition(pdd); - List activitiList = processDefinition.getActivities();//获得当前任务的所有节点 - - List> activityInfos = new ArrayList>(); - for (ActivityImpl activity : activitiList) { - - - Map activityImageInfo = packageSingleActivitiInfo(activity); - - activityInfos.add(activityImageInfo); - } - - return activityInfos; - } - - /** - * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述 - * - * @param activity - * @param processInstance - * @param currentActiviti - * @return - */ - private Map packageSingleActivitiInfo(ActivityImpl activity ) throws Exception { - Map vars = new HashMap(); - Map activityInfo = new HashMap(); - setPosition(activity, activityInfo); - setWidthAndHeight(activity, activityInfo); - - Map properties = activity.getProperties(); - vars.put("任务类型", WorkflowUtils.parseToZhType(properties.get("type").toString())); - vars.put("activityId", activity.getId()); - ActivityBehavior activityBehavior = activity.getActivityBehavior(); - logger.debug("activityBehavior={}", activityBehavior); - if (activityBehavior instanceof UserTaskActivityBehavior) { - - - /* - * 当前任务的分配角色 - */ - UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior; - TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition(); - Set candidateGroupIdExpressions = taskDefinition.getCandidateGroupIdExpressions(); - if (!candidateGroupIdExpressions.isEmpty()) { - - // 任务的处理角色 - // setTaskGroup(vars, candidateGroupIdExpressions); - - } - } - - vars.put("节点说明", properties.get("documentation")); - - String description = activity.getProcessDefinition().getDescription(); - //vars.put("描述", description); - - logger.debug("trace variables: {}", vars); - activityInfo.put("vars", vars); - return activityInfo; - } - private void setTaskGroup(Map vars, Set candidateGroupIdExpressions) { - String roles = ""; - for (Expression expression : candidateGroupIdExpressions) { - String expressionText = expression.getExpressionText(); - String roleName = identityService.createGroupQuery().groupId(expressionText).singleResult().getName(); - roles += roleName; - } - vars.put("任务所属角色", roles); - } - - /** - * 设置当前处理人信息 - * - * @param vars - * @param currentTask - */ - private void setCurrentTaskAssignee(Map vars, Task currentTask) { - String assignee = currentTask.getAssignee(); - if (assignee != null) { - User assigneeUser = identityService.createUserQuery().userId(assignee).singleResult(); - String userInfo = assigneeUser.getFirstName() + " " + assigneeUser.getLastName(); - vars.put("当前处理人", userInfo); - } - } - - /** - * 获取当前节点信息 - * - * @param processInstance - * @return - */ - private Task getCurrentTaskInfo(ProcessInstance processInstance) { - Task currentTask = null; - try { - String activitiId = (String) PropertyUtils.getProperty(processInstance, "activityId"); - logger.debug("current activity id: {}", activitiId); - - currentTask = taskService.createTaskQuery().processInstanceId(processInstance.getId()).taskDefinitionKey(activitiId) - .singleResult(); - logger.debug("current task for processInstance: {}", ToStringBuilder.reflectionToString(currentTask)); - - } catch (Exception e) { - logger.error("can not get property activityId from processInstance: {}", processInstance); - } - return currentTask; - } - - /** - * 设置宽度、高度属性 - * - * @param activity - * @param activityInfo - */ - private void setWidthAndHeight(ActivityImpl activity, Map activityInfo) { - activityInfo.put("width", activity.getWidth()); - activityInfo.put("height", activity.getHeight()); - } - - /** - * 设置坐标位置 - * - * @param activity - * @param activityInfo - */ - private void setPosition(ActivityImpl activity, Map activityInfo) { - activityInfo.put("x", activity.getX()); - activityInfo.put("y", activity.getY()); - } -} diff --git a/src/com/sipai/service/administration/IndexClassService.java b/src/com/sipai/service/administration/IndexClassService.java deleted file mode 100644 index 91e90fda..00000000 --- a/src/com/sipai/service/administration/IndexClassService.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.sipai.service.administration; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.administration.IndexClassDao; -import com.sipai.entity.administration.Index; -import com.sipai.entity.administration.IndexClass; -import com.sipai.tools.CommService; - -import net.sf.json.JSONArray; - -@Service -public class IndexClassService implements CommService{ - - @Resource - private IndexClassDao indexClassDao; - @Resource - private IndexService indexService; - - @Override - public IndexClass selectById(String id) { - IndexClass indexClass = indexClassDao.selectByPrimaryKey(id); - IndexClass goodsC =indexClassDao.selectByPrimaryKey(indexClass.getPid()); - if(goodsC!=null){ - indexClass.setPname(goodsC.getName()); - } - return indexClass; - } - - @Override - public int deleteById(String id) { - return indexClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(IndexClass indexClass) { - return indexClassDao.insert(indexClass); - } - - @Override - public int update(IndexClass indexClass) { - return indexClassDao.updateByPrimaryKeySelective(indexClass); - } - - @Override - public List selectListByWhere(String wherestr) { - IndexClass indexClass = new IndexClass(); - indexClass.setWhere(wherestr); - List list = indexClassDao.selectListByWhere(indexClass); - return list; - } - - public List selectList4IndexByWhere(String wherestr) { - IndexClass indexClass = new IndexClass(); - indexClass.setWhere(wherestr); - List list = indexClassDao.selectListByWhere(indexClass); - if(list!=null && list.size()>0){ - String indexwherestr = ""; - String indexorderstr = " order by insdt desc"; - for(IndexClass indexClasss:list){ - indexwherestr = "where classid='"+indexClasss.getId()+"' "; - List indexList = this.indexService.selectListByWhere(indexwherestr+indexorderstr); - indexClasss.setIndexList(indexList); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - IndexClass indexClass = new IndexClass(); - indexClass.setWhere(wherestr); - return indexClassDao.deleteByWhere(indexClass); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(IndexClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - map.put("code", k.getCode()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(IndexClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("code", k.getCode()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/administration/IndexCycleService.java b/src/com/sipai/service/administration/IndexCycleService.java deleted file mode 100644 index ca9f7962..00000000 --- a/src/com/sipai/service/administration/IndexCycleService.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.sipai.service.administration; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.administration.IndexCycleDao; -import com.sipai.entity.administration.Index; -import com.sipai.entity.administration.IndexCycle; -import com.sipai.entity.app.AppProductMonitor; -import com.sipai.tools.CommService; - -import net.sf.json.JSONArray; - - -@Service -public class IndexCycleService implements CommService{ - - @Resource - private IndexCycleDao indexCycleDao; - @Resource - private IndexService indexService; - - @Override - public IndexCycle selectById(String id) { - IndexCycle indexCycle = indexCycleDao.selectByPrimaryKey(id); - IndexCycle goodsC =indexCycleDao.selectByPrimaryKey(indexCycle.getPid()); - if(goodsC!=null){ - indexCycle.setPname(goodsC.getName()); - } - return indexCycle; - } - - @Override - public int deleteById(String id) { - return indexCycleDao.deleteByPrimaryKey(id); - } - - @Override - public int save(IndexCycle indexCycle) { - return indexCycleDao.insert(indexCycle); - } - - @Override - public int update(IndexCycle indexCycle) { - return indexCycleDao.updateByPrimaryKeySelective(indexCycle); - } - - @Override - public List selectListByWhere(String wherestr) { - IndexCycle indexCycle = new IndexCycle(); - indexCycle.setWhere(wherestr); - List list = indexCycleDao.selectListByWhere(indexCycle); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - IndexCycle indexCycle = new IndexCycle(); - indexCycle.setWhere(wherestr); - return indexCycleDao.deleteByWhere(indexCycle); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(IndexCycle k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(IndexCycle k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/administration/IndexService.java b/src/com/sipai/service/administration/IndexService.java deleted file mode 100644 index 3d9d9188..00000000 --- a/src/com/sipai/service/administration/IndexService.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.service.administration; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.administration.IndexDao; -import com.sipai.entity.administration.Index; -import com.sipai.entity.administration.IndexClass; -import com.sipai.entity.administration.IndexCycle; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -import net.sf.json.JSONArray; - -@Service -public class IndexService implements CommService{ - - @Resource - private IndexDao indexDao; - @Resource - private IndexClassService indexClassService; - @Resource - private IndexCycleService indexCycleService; - - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public Index selectById(String id) { - Index index = indexDao.selectByPrimaryKey(id); - Index goodsC =indexDao.selectByPrimaryKey(index.getPid()); - if(goodsC!=null){ - index.setPname(goodsC.getName()); - } - if (index.getClassid() != null && !index.getClassid().isEmpty()) { - IndexClass indexClass = this.indexClassService.selectById(index.getClassid()); - index.setIndexClass(indexClass); - } - if (index.getDeptid() != null && !index.getDeptid().isEmpty()) { - Dept dept = this.unitService.getDeptById(index.getDeptid()); - index.setDept(dept); - } - if (index.getUserid() != null && !index.getUserid().isEmpty()) { - String userName = this.userService.getUserNamesByUserIds(index.getUserid()); - index.setUserName(userName); - } - if (index.getId() != null && !index.getId().isEmpty()) { - List indexCycleList = this.indexCycleService.selectListByWhere(" where pid='"+index.getId()+"' order by morder"); - index.setIndexCycleList(indexCycleList); - } - - return index; - } - - @Override - public int deleteById(String id) { - return indexDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Index index) { - return indexDao.insert(index); - } - - @Override - public int update(Index index) { - return indexDao.updateByPrimaryKeySelective(index); - } - - @Override - public List selectListByWhere(String wherestr) { - Index index = new Index(); - index.setWhere(wherestr); - List list = indexDao.selectListByWhere(index); - for (Index item: list) { - if (item.getClassid() != null && !item.getClassid().isEmpty()) { - IndexClass indexClass = this.indexClassService.selectById(item.getClassid()); - item.setIndexClass(indexClass); - } - if (item.getDeptid() != null && !item.getDeptid().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptid()); - item.setDept(dept); - } - if (item.getUserid() != null && !item.getUserid().isEmpty()) { - String userName = this.userService.getUserNamesByUserIds(item.getUserid()); - item.setUserName(userName); - } - if (item.getId() != null && !item.getId().isEmpty()) { - List indexCycleList = this.indexCycleService.selectListByWhere(" where pid='"+item.getId()+"' order by morder"); - item.setIndexCycleList(indexCycleList); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Index index = new Index(); - index.setWhere(wherestr); - return indexDao.deleteByWhere(index); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(Index k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - map.put("code", k.getCode()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Index k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("code", k.getCode()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - -} \ No newline at end of file diff --git a/src/com/sipai/service/administration/IndexWorkService.java b/src/com/sipai/service/administration/IndexWorkService.java deleted file mode 100644 index c1a14579..00000000 --- a/src/com/sipai/service/administration/IndexWorkService.java +++ /dev/null @@ -1,266 +0,0 @@ -package com.sipai.service.administration; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.administration.IndexWorkDao; -import com.sipai.entity.activiti.ActivitiCommStr; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.administration.IndexWork; -import com.sipai.entity.administration.Index; -import com.sipai.entity.administration.IndexCycle; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class IndexWorkService implements CommService{ - - @Resource - private IndexWorkDao indexWorkDao; - @Resource - private IndexService indexService; - @Resource - private IndexCycleService indexCycleService; - @Resource - private IndexWorkService indexWorkService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public IndexWork selectById(String id) { - IndexWork indexWork = indexWorkDao.selectByPrimaryKey(id); - if (null != indexWork.getUnitId() && !indexWork.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(indexWork.getUnitId()); - indexWork.setCompany(company); - } - if (null != indexWork.getIndexid() && !indexWork.getIndexid().isEmpty()) { - Index index = this.indexService.selectById(indexWork.getIndexid()); - indexWork.setIndex(index); - } - if (null != indexWork.getCycle() && !indexWork.getCycle().isEmpty()) { - IndexCycle indexCycle = this.indexCycleService.selectById(indexWork.getCycle()); - indexWork.setIndexCycle(indexCycle); - } - if (null != indexWork.getSendUserId() && !indexWork.getSendUserId().isEmpty()) { - String auditManName = this.getUserNamesByUserIds(indexWork.getSendUserId()); - indexWork.setSendUser(auditManName); - } - if (null != indexWork.getReceiveUserId() && !indexWork.getReceiveUserId().isEmpty()) { - String receiveUserName = this.getUserNamesByUserIds(indexWork.getReceiveUserId()); - indexWork.setReceiveUser(receiveUserName); - } - - return indexWork; - } - - /** - * 删除同时关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - IndexWork indexWork = this.selectById(id); - String pInstancId = indexWork.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return indexWorkDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(IndexWork indexWork) { - return indexWorkDao.insert(indexWork); - } - - @Override - public int update(IndexWork indexWork) { - return indexWorkDao.updateByPrimaryKeySelective(indexWork); - } - - @Override - public List selectListByWhere(String wherestr) { - IndexWork indexWork = new IndexWork(); - indexWork.setWhere(wherestr); - List indexWorks = indexWorkDao.selectListByWhere(indexWork); - for (IndexWork item: indexWorks) { - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - if (null != item.getIndexid() && !item.getIndexid().isEmpty()) { - Index index = this.indexService.selectById(item.getIndexid()); - item.setIndex(index); - } - if (null != item.getCycle() && !item.getCycle().isEmpty()) { - IndexCycle indexCycle = this.indexCycleService.selectById(item.getCycle()); - item.setIndexCycle(indexCycle); - } - if (null != item.getSendUserId() && !item.getSendUserId().isEmpty()) { - String auditManName = this.getUserNamesByUserIds(item.getSendUserId()); - item.setSendUser(auditManName); - } - if (null != item.getEvaluateUserId() && !item.getEvaluateUserId().isEmpty()) { - String evaluateUserName = this.getUserNamesByUserIds(item.getEvaluateUserId()); - item.setEvaluateUser(evaluateUserName); - } - if (null != item.getReceiveUserId() && !item.getReceiveUserId().isEmpty()) { - String receiveUserName = this.getUserNamesByUserIds(item.getReceiveUserId()); - item.setReceiveUser(receiveUserName); - } - } - return indexWorks; - } - /** - * 删除同时删除关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - IndexWork indexWork = new IndexWork(); - indexWork.setWhere(wherestr); - List indexWorks = this.selectListByWhere(wherestr); - for (IndexWork item : indexWorks) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return indexWorkDao.deleteByWhere(indexWork); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - IndexWork indexWork = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(indexWork.getProcessid()).list(); - if (task!=null && task.size()>0) { - indexWork.setProcessStatus(task.get(0).getName()); - }else{ - indexWork.setProcessStatus(ActivitiCommStr.Activiti_FINISH); - } - int res =this.update(indexWork); - return res; - } - /** - * 启动审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(IndexWork indexWork) { - try { - Map variables = new HashMap(); - if(!indexWork.getReceiveUserId().isEmpty()){ - variables.put("userIds", indexWork.getReceiveUserId()); - }else{ - //无处理人员则不发起 - return ActivitiCommStr.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Administration_IndexWork.getId()+"-"+indexWork.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return ActivitiCommStr.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(indexWork.getId(), indexWork.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - indexWork.setProcessid(processInstance.getId()); - indexWork.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(indexWork); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(indexWork); - businessUnitRecord.sendMessage(indexWork.getReceiveUserId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } -} \ No newline at end of file diff --git a/src/com/sipai/service/administration/OrganizationClassService.java b/src/com/sipai/service/administration/OrganizationClassService.java deleted file mode 100644 index 0094f7d2..00000000 --- a/src/com/sipai/service/administration/OrganizationClassService.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.service.administration; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.administration.OrganizationClassDao; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.administration.OrganizationClass; -import com.sipai.entity.app.AppProductMonitor; -import com.sipai.entity.data.DataCurve; -import com.sipai.tools.CommService; - -import net.sf.json.JSONArray; - -@Service -public class OrganizationClassService implements CommService{ - - @Resource - private OrganizationClassDao organizationClassDao; - @Resource - private OrganizationService organizationService; - - @Override - public OrganizationClass selectById(String id) { - OrganizationClass organizationClass = organizationClassDao.selectByPrimaryKey(id); - if(organizationClass!=null){ - OrganizationClass goodsC =organizationClassDao.selectByPrimaryKey(organizationClass.getPid()); - if(goodsC!=null){ - organizationClass.setPname(goodsC.getName()); - } - } - return organizationClass; - } - - @Override - public int deleteById(String id) { - return organizationClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(OrganizationClass organizationClass) { - return organizationClassDao.insert(organizationClass); - } - - @Override - public int update(OrganizationClass organizationClass) { - return organizationClassDao.updateByPrimaryKeySelective(organizationClass); - } - - @Override - public List selectListByWhere(String wherestr) { - OrganizationClass organizationClass = new OrganizationClass(); - organizationClass.setWhere(wherestr); - List list = organizationClassDao.selectListByWhere(organizationClass); - if(list!=null && list.size()>0){ - for(OrganizationClass organizationClasss:list){ - List plist = selectListByWhere(" where id='"+organizationClasss.getPid()+"' "); - if(plist!=null&&plist.size()>0){ - organizationClasss.setPname(plist.get(0).getName()); - }else{ - organizationClasss.setPname("-1"); - } - } - } - return list; - } - - public List selectList4OrganizationByWhere(String wherestr) { - OrganizationClass organizationClass = new OrganizationClass(); - organizationClass.setWhere(wherestr); - List list = organizationClassDao.selectListByWhere(organizationClass); - if(list!=null && list.size()>0){ - String organizationwherestr = ""; - String organizationorderstr = " order by insdt desc"; - for(OrganizationClass organizationClasss:list){ - organizationwherestr = "where classid='"+organizationClasss.getId()+"' "; - List organizationList = this.organizationService.selectListByWhere(organizationwherestr+organizationorderstr); - organizationClasss.setOrganizationList(organizationList); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - OrganizationClass organizationClass = new OrganizationClass(); - organizationClass.setWhere(wherestr); - return organizationClassDao.deleteByWhere(organizationClass); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(OrganizationClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - map.put("pname", k.getPname()); - map.put("code", k.getCode()); - map.put("type", k.getType()); - if(k.getType().equals(OrganizationClass.Type_0)){ - map.put("icon", "fa fa-cube"); - }else if(k.getType().equals(OrganizationClass.Type_1)){ - map.put("icon", "fa fa-cubes"); - } - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(OrganizationClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("pname", k.getPname()); - m.put("code", k.getCode()); - m.put("type", k.getType()); - if(k.getType().equals(OrganizationClass.Type_0)){ - m.put("icon", "fa fa-cube"); - }else if(k.getType().equals(OrganizationClass.Type_1)){ - m.put("icon", "fa fa-cubes"); - } - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/administration/OrganizationService.java b/src/com/sipai/service/administration/OrganizationService.java deleted file mode 100644 index 35e098eb..00000000 --- a/src/com/sipai/service/administration/OrganizationService.java +++ /dev/null @@ -1,275 +0,0 @@ -package com.sipai.service.administration; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.administration.OrganizationDao; -import com.sipai.entity.activiti.ActivitiCommStr; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.administration.Organization; -import com.sipai.entity.administration.OrganizationClass; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.sparepart.GoodsClassService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.sparepart.WarehouseService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class OrganizationService implements CommService{ - - @Resource - private OrganizationDao organizationDao; - @Resource - private OrganizationClassService organizationClassService; - @Resource - private OrganizationService organizationService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public Organization selectById(String id) { - Organization organization = organizationDao.selectByPrimaryKey(id); - if (null != organization.getUnitId() && !organization.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(organization.getUnitId()); - organization.setCompany(company); - } - if (null != organization.getClassid() && !organization.getClassid().isEmpty()) { - OrganizationClass organizationClass = this.organizationClassService.selectById(organization.getClassid()); - organization.setOrganizationClass(organizationClass); - } - if (null != organization.getSendUserId() && !organization.getSendUserId().isEmpty()) { - String auditManName = this.getUserNamesByUserIds(organization.getSendUserId()); - organization.setSendUser(auditManName); - } - if (null != organization.getEvaluateUserId() && !organization.getEvaluateUserId().isEmpty()) { - String evaluateUserName = this.getUserNamesByUserIds(organization.getEvaluateUserId()); - organization.setEvaluateUser(evaluateUserName); - } - if (null != organization.getReceiveUserId() && !organization.getReceiveUserId().isEmpty()) { - String receiveUserName = this.getUserNamesByUserIds(organization.getReceiveUserId()); - organization.setReceiveUser(receiveUserName); - } - - return organization; - } - - /** - * 删除同时关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - Organization organization = this.selectById(id); - String pInstancId = organization.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return organizationDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(Organization organization) { - return organizationDao.insert(organization); - } - - @Override - public int update(Organization organization) { - return organizationDao.updateByPrimaryKeySelective(organization); - } - - @Override - public List selectListByWhere(String wherestr) { - Organization organization = new Organization(); - organization.setWhere(wherestr); - List organizations = organizationDao.selectListByWhere(organization); - for (Organization item: organizations) { - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - if (null != item.getClassid() && !item.getClassid().isEmpty()) { - OrganizationClass organizationClass = this.organizationClassService.selectById(item.getClassid()); - item.setOrganizationClass(organizationClass); - } - if (null != item.getSendUserId() && !item.getSendUserId().isEmpty()) { - String auditManName = this.getUserNamesByUserIds(item.getSendUserId()); - item.setSendUser(auditManName); - } - if (null != item.getEvaluateUserId() && !item.getEvaluateUserId().isEmpty()) { - String evaluateUserName = this.getUserNamesByUserIds(item.getEvaluateUserId()); - item.setEvaluateUser(evaluateUserName); - } - if (null != item.getReceiveUserId() && !item.getReceiveUserId().isEmpty()) { - String receiveUserName = this.getUserNamesByUserIds(item.getReceiveUserId()); - item.setReceiveUser(receiveUserName); - } - } - return organizations; - } - /** - * 删除同时删除关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - Organization organization = new Organization(); - organization.setWhere(wherestr); - List organizations = this.selectListByWhere(wherestr); - for (Organization item : organizations) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return organizationDao.deleteByWhere(organization); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - Organization organization = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(organization.getProcessid()).list(); - if (task!=null && task.size()>0) { - organization.setProcessStatus(task.get(0).getName()); - }else{ - organization.setProcessStatus(ActivitiCommStr.Activiti_FINISH); - } - int res =this.update(organization); - return res; - } - /** - * 启动入库审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(Organization organization) { - try { - Map variables = new HashMap(); - if(!organization.getReceiveUserId().isEmpty()){ - variables.put("userIds", organization.getReceiveUserId()); - }else{ - //无处理人员则不发起 - return ActivitiCommStr.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = null; - if("organization".equals(organization.getTypeid())){ - //组织 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Administration_Organization.getId()+"-"+organization.getUnitId()); - }else{ - //预案 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Administration_Reserve.getId()+"-"+organization.getUnitId()); - } - if (processDefinitions==null || processDefinitions.size()==0) { - return ActivitiCommStr.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(organization.getId(), organization.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - organization.setProcessid(processInstance.getId()); - organization.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(organization); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(organization); - businessUnitRecord.sendMessage(organization.getReceiveUserId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } -} \ No newline at end of file diff --git a/src/com/sipai/service/administration/TemporaryService.java b/src/com/sipai/service/administration/TemporaryService.java deleted file mode 100644 index c7a68f57..00000000 --- a/src/com/sipai/service/administration/TemporaryService.java +++ /dev/null @@ -1,249 +0,0 @@ -package com.sipai.service.administration; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.administration.TemporaryDao; -import com.sipai.entity.activiti.ActivitiCommStr; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.administration.Temporary; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.sparepart.GoodsClassService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.sparepart.WarehouseService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class TemporaryService implements CommService{ - - @Resource - private TemporaryDao temporaryDao; - @Resource - private TemporaryService temporaryService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public Temporary selectById(String id) { - Temporary temporary = temporaryDao.selectByPrimaryKey(id); - if (null != temporary.getUnitId() && !temporary.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(temporary.getUnitId()); - temporary.setCompany(company); - } - if (null != temporary.getSendUserId() && !temporary.getSendUserId().isEmpty()) { - String auditManName = this.getUserNamesByUserIds(temporary.getSendUserId()); - temporary.setSendUser(auditManName); - } - if (null != temporary.getReceiveUserId() && !temporary.getReceiveUserId().isEmpty()) { - String receiveUserName = this.getUserNamesByUserIds(temporary.getReceiveUserId()); - temporary.setReceiveUser(receiveUserName); - } - - return temporary; - } - - /** - * 删除同时关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - Temporary temporary = this.selectById(id); - String pInstancId = temporary.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return temporaryDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(Temporary temporary) { - return temporaryDao.insert(temporary); - } - - @Override - public int update(Temporary temporary) { - return temporaryDao.updateByPrimaryKeySelective(temporary); - } - - @Override - public List selectListByWhere(String wherestr) { - Temporary temporary = new Temporary(); - temporary.setWhere(wherestr); - List temporarys = temporaryDao.selectListByWhere(temporary); - for (Temporary item: temporarys) { - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - if (null != item.getSendUserId() && !item.getSendUserId().isEmpty()) { - String auditManName = this.getUserNamesByUserIds(item.getSendUserId()); - item.setSendUser(auditManName); - } - if (null != item.getReceiveUserId() && !item.getReceiveUserId().isEmpty()) { - String receiveUserName = this.getUserNamesByUserIds(item.getReceiveUserId()); - item.setReceiveUser(receiveUserName); - } - } - return temporarys; - } - /** - * 删除同时删除关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - Temporary temporary = new Temporary(); - temporary.setWhere(wherestr); - List temporarys = this.selectListByWhere(wherestr); - for (Temporary item : temporarys) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return temporaryDao.deleteByWhere(temporary); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - Temporary temporary = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(temporary.getProcessid()).list(); - if (task!=null && task.size()>0) { - temporary.setProcessStatus(task.get(0).getName()); - }else{ - temporary.setProcessStatus(ActivitiCommStr.Activiti_FINISH); - } - int res =this.update(temporary); - return res; - } - /** - * 启动入库审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(Temporary temporary) { - try { - Map variables = new HashMap(); - if(!temporary.getReceiveUserId().isEmpty()){ - variables.put("userIds", temporary.getReceiveUserId()); - }else{ - //无处理人员则不发起 - return ActivitiCommStr.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Administration_Temporary.getId()+"-"+temporary.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return ActivitiCommStr.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(temporary.getId(), temporary.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - temporary.setProcessid(processInstance.getId()); - temporary.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(temporary); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(temporary); - businessUnitRecord.sendMessage(temporary.getReceiveUserId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmConditionService.java b/src/com/sipai/service/alarm/AlarmConditionService.java deleted file mode 100644 index 0c02b667..00000000 --- a/src/com/sipai/service/alarm/AlarmConditionService.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.alarm.AlarmConditionDao; -import com.sipai.entity.alarm.AlarmCondition; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -@Service -public class AlarmConditionService implements CommService{ - @Resource - private AlarmConditionDao alarmConditionDao; - @Resource - private MPointService mPointService; - - @Override - public AlarmCondition selectById(String t) { - AlarmCondition alarmCondition = alarmConditionDao.selectByPrimaryKey(t); - if(alarmCondition!=null){ - MPoint mPoint = mPointService.selectById(null, alarmCondition.getMpointid()); - if(mPoint!=null){ - alarmCondition.setmPoint(mPoint); - } - } - return alarmCondition; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return alarmConditionDao.deleteByPrimaryKey(t); - } - - @Override - public int save(AlarmCondition t) { - // TODO Auto-generated method stub - return alarmConditionDao.insertSelective(t); - } - - @Override - public int update(AlarmCondition t) { - // TODO Auto-generated method stub - return alarmConditionDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - AlarmCondition alarmCondition = new AlarmCondition(); - alarmCondition.setWhere(t); - List list = alarmConditionDao.selectListByWhere(alarmCondition); - if(list!=null && list.size()>0){ - for(int i=0;i selectListByWhere(String wherestr); - - public abstract List selectListByWhere2(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract AlarmInformation selectCountByWhere(String wherestr); - - public abstract List getDistinctMold(String wherestr); -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmLevelsService.java b/src/com/sipai/service/alarm/AlarmLevelsService.java deleted file mode 100644 index 91447167..00000000 --- a/src/com/sipai/service/alarm/AlarmLevelsService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.List; - -import com.sipai.entity.alarm.AlarmLevels; - -public interface AlarmLevelsService { - - public abstract AlarmLevels selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AlarmLevels entity); - - public abstract int update(AlarmLevels entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract AlarmLevels selectCountByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmLevesConfigService.java b/src/com/sipai/service/alarm/AlarmLevesConfigService.java deleted file mode 100644 index d3dfa294..00000000 --- a/src/com/sipai/service/alarm/AlarmLevesConfigService.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.sipai.service.alarm; - -import com.sipai.dao.alarm.AlarmLevelsConfigDao; -import com.sipai.dao.hqconfig.RiskLevelDao; -import com.sipai.entity.alarm.AlarmLevelsConfig; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class AlarmLevesConfigService implements CommService { - @Resource - private AlarmLevelsConfigDao alarmLevelsConfigDao; - @Override - public AlarmLevelsConfig selectById(String t) { - // TODO Auto-generated method stub - return alarmLevelsConfigDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return alarmLevelsConfigDao.deleteByPrimaryKey(t); - } - - @Override - public int save(AlarmLevelsConfig t) { - // TODO Auto-generated method stub - return alarmLevelsConfigDao.insertSelective(t); - } - - @Override - public int update(AlarmLevelsConfig t) { - // TODO Auto-generated method stub - return alarmLevelsConfigDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - AlarmLevelsConfig alarmLevelsConfig = new AlarmLevelsConfig(); - alarmLevelsConfig.setWhere(t); - return alarmLevelsConfigDao.selectListByWhere(alarmLevelsConfig); - } - - @Override - public int deleteByWhere(String t) { - AlarmLevelsConfig alarmLevelsConfig = new AlarmLevelsConfig(); - alarmLevelsConfig.setWhere(t); - return alarmLevelsConfigDao.deleteByWhere(alarmLevelsConfig); - } -} diff --git a/src/com/sipai/service/alarm/AlarmMoldService.java b/src/com/sipai/service/alarm/AlarmMoldService.java deleted file mode 100644 index 3d014b85..00000000 --- a/src/com/sipai/service/alarm/AlarmMoldService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.List; - -import com.sipai.entity.alarm.AlarmMold; - -public interface AlarmMoldService { - - public abstract AlarmMold selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AlarmMold entity); - - public abstract int update(AlarmMold entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract AlarmMold selectCountByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmPointRiskLevelService.java b/src/com/sipai/service/alarm/AlarmPointRiskLevelService.java deleted file mode 100644 index 457d36cc..00000000 --- a/src/com/sipai/service/alarm/AlarmPointRiskLevelService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.List; - -import com.sipai.entity.alarm.AlarmPointRiskLevel; -import com.sipai.entity.alarm.AlarmLevels; - -public interface AlarmPointRiskLevelService { - - public abstract AlarmPointRiskLevel selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AlarmPointRiskLevel entity); - - public abstract int update(AlarmPointRiskLevel entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmPointService.java b/src/com/sipai/service/alarm/AlarmPointService.java deleted file mode 100644 index 2f4c4a81..00000000 --- a/src/com/sipai/service/alarm/AlarmPointService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.List; - -import com.sipai.entity.alarm.AlarmPoint; - -import javax.servlet.http.HttpServletRequest; - -public interface AlarmPointService { - - public abstract AlarmPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AlarmPoint entity); - - public abstract int update(AlarmPoint entity); - - public abstract List selectListByWhere(String wherestr, String searchName); - - public abstract List selectListByWhere2(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectListJoinInformationByWhere(String wherestr); - - public abstract int alarmRecover(String bizid, String pointCode, String alarmTime, String recoverValue); - - public abstract int alarmRecover2(String bizid, String pointCode, String recoverValue); - - public abstract int insertAlarm(String unitId, HttpServletRequest request, String alarmType, String pointId, String pointName, String alarmTime, String levelType, String describe, String nowValue, String prSectionCode, String prSectionName); - -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmRecordService.java b/src/com/sipai/service/alarm/AlarmRecordService.java deleted file mode 100644 index 3e78f3f7..00000000 --- a/src/com/sipai/service/alarm/AlarmRecordService.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.alarm.AlarmRecordDao; -import com.sipai.entity.alarm.AlarmRecord; -import com.sipai.entity.alarm.AlarmType; -import com.sipai.tools.CommService; -@Service -public class AlarmRecordService implements CommService{ - @Resource - private AlarmRecordDao alarmRecordDao; - @Resource - private AlarmTypeService alarmTypeService; - - @Override - public AlarmRecord selectById(String t) { - AlarmRecord alarmRecord = alarmRecordDao.selectByPrimaryKey(t); - if(alarmRecord != null && alarmRecord.getAlarmtypeid() != null){ - AlarmType alarmType = alarmTypeService.selectById(alarmRecord.getAlarmtypeid()); - if(alarmType != null){ - alarmRecord.setAlarmType(alarmType); - if(alarmType.getOperaters() != null && alarmType.getOperaters().size()>0){ - String users = ""; - for(int i=0;i selectListByWhere(String t) { - AlarmRecord alarmRecord = new AlarmRecord(); - alarmRecord.setWhere(t); - List list = alarmRecordDao.selectListByWhere(alarmRecord); - if(list != null && list.size()>0){ - for(int i=0;i0){ - String users = ""; - for(int j=0;j{ - @Resource - private AlarmSolutionDao alarmSolutionDao; - @Resource - private UnitService unitService; - - @Override - public AlarmSolution selectById(String t) { - AlarmSolution alarmSolution = alarmSolutionDao.selectByPrimaryKey(t); - String deptIds = alarmSolution.getDeptids(); - if(deptIds != null && !"".equals(deptIds)){ - String[] deptId = deptIds.split(","); - List depts = new ArrayList<>(); - for(int i=0;i selectListByWhere(String t) { - AlarmSolution alarmSolution = new AlarmSolution(); - alarmSolution.setWhere(t); - List alarmSolutions = alarmSolutionDao.selectListByWhere(alarmSolution); - if(alarmSolutions != null && alarmSolutions.size()>0){ - for(int i=0;i depts = new ArrayList<>(); - for(int j=0;j selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectLeftOuterListByWhere(String wherestr); - - public abstract List selectMoldCountByWhere(String wherestr); - - public abstract List selectlevelCountByWhere(String wherestr); -} \ No newline at end of file diff --git a/src/com/sipai/service/alarm/AlarmTypeService.java b/src/com/sipai/service/alarm/AlarmTypeService.java deleted file mode 100644 index 80b8abd8..00000000 --- a/src/com/sipai/service/alarm/AlarmTypeService.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.service.alarm; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.alarm.AlarmTypeDao; -import com.sipai.entity.alarm.AlarmType; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -@Service -public class AlarmTypeService implements CommService{ - @Resource - private AlarmTypeDao alarmTypeDao; - @Resource - private UserService userService; - - @Override - public AlarmType selectById(String t) { - AlarmType alarmType = alarmTypeDao.selectByPrimaryKey(t); - if(alarmType!= null && alarmType.getOperaterId()!=null){ - String operaterId = "('"+alarmType.getOperaterId().replaceAll(",", "','") - +"')"; - List users = userService.selectListByWhere(" where id in "+ - operaterId+" order by name"); - alarmType.setOperaters(users); - } - return alarmType; - } - - @Override - public int deleteById(String t) { - return alarmTypeDao.deleteByPrimaryKey(t); - } - - @Override - public int save(AlarmType t) { - return alarmTypeDao.insertSelective(t); - } - - @Override - public int update(AlarmType t) { - return alarmTypeDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - AlarmType alarmType = new AlarmType(); - alarmType.setWhere(t); - return alarmTypeDao.selectListByWhere(alarmType); - } - - @Override - public int deleteByWhere(String t) { - AlarmType alarmType = new AlarmType(); - alarmType.setWhere(t); - return alarmTypeDao.deleteByWhere(alarmType); - } - - public String getTreeList(List> list_result,List list){ - if(list_result == null ) { - list_result = new ArrayList>(); - for(AlarmType k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getType()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(AlarmType k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getType()); - List tags = new ArrayList(); - tags.add(null); - m.put("tags", tags); - childlist.add(m); - } - } - if(childlist.size()>0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/alarm/RiskPService.java b/src/com/sipai/service/alarm/RiskPService.java deleted file mode 100644 index 90d4ff18..00000000 --- a/src/com/sipai/service/alarm/RiskPService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.alarm; - -import com.sipai.dao.alarm.RiskPDao; -import com.sipai.entity.alarm.RiskP; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class RiskPService implements CommService { - @Resource - private RiskPDao riskPDao; - @Override - public RiskP selectById(String t) { - // TODO Auto-generated method stub - return riskPDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return riskPDao.deleteByPrimaryKey(t); - } - - @Override - public int save(RiskP t) { - // TODO Auto-generated method stub - return riskPDao.insertSelective(t); - } - - @Override - public int update(RiskP t) { - // TODO Auto-generated method stub - return riskPDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - RiskP riskP = new RiskP(); - riskP.setWhere(t); - return riskPDao.selectListByWhere(riskP); - } - - @Override - public int deleteByWhere(String t) { - RiskP riskP = new RiskP(); - riskP.setWhere(t); - return riskPDao.deleteByWhere(riskP); - } -} diff --git a/src/com/sipai/service/alarm/impl/AlarmInformationServiceImpl.java b/src/com/sipai/service/alarm/impl/AlarmInformationServiceImpl.java deleted file mode 100644 index 76fa67e7..00000000 --- a/src/com/sipai/service/alarm/impl/AlarmInformationServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.service.alarm.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.alarm.AlarmInformationDao; -import com.sipai.entity.alarm.AlarmInformation; -import com.sipai.entity.alarm.AlarmInformationAlarmModeEnum; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.user.UserService; - -@Service("alarmInformationService") -public class AlarmInformationServiceImpl implements AlarmInformationService { - @Resource - private AlarmInformationDao alarmInformationDao; - @Resource - private UserService userService; - - public AlarmInformation selectById(String id) { - AlarmInformation alarmInformation=alarmInformationDao.selectByPrimaryKey(id); - String showRNamesString=this.userService.getUserNamesByUserIds(alarmInformation.getAlarmReceivers()); - alarmInformation.setAlarmReceiversName(showRNamesString); - return alarmInformation; - } - - public int deleteById(String id) { - return alarmInformationDao.deleteByPrimaryKey(id); - } - - public int save(AlarmInformation entity) { - return alarmInformationDao.insert(entity); - } - - @Transactional - public int update(AlarmInformation entity) { - try { - int res= alarmInformationDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String wherestr) { - AlarmInformation group = new AlarmInformation(); - group.setWhere(wherestr); - List alarmInformation =alarmInformationDao.selectListByWhere(group); - if(alarmInformation!=null&&alarmInformation.size()>0){ - for (int i = 0; i < alarmInformation.size(); i++) { - alarmInformation.get(i).setAlarmModeName(AlarmInformationAlarmModeEnum.getName(alarmInformation.get(i).getAlarmMode())); - String showRNamesString=this.userService.getUserNamesByUserIds(alarmInformation.get(i).getAlarmReceivers()); - alarmInformation.get(i).setAlarmReceiversName(showRNamesString); - } - } - return alarmInformation; - } - - public List selectListByWhere2(String wherestr) { - AlarmInformation group = new AlarmInformation(); - group.setWhere(wherestr); - List alarmInformation =alarmInformationDao.selectListByWhere(group); - return alarmInformation; - } - - public int deleteByWhere(String wherestr) { - AlarmInformation group = new AlarmInformation(); - group.setWhere(wherestr); - return alarmInformationDao.deleteByWhere(group); - } - - public AlarmInformation selectCountByWhere(String wherestr) { - return alarmInformationDao.selectCountByWhere(wherestr); - } - - public List getDistinctMold(String wherestr) { - AlarmInformation alarmInformation = new AlarmInformation(); - alarmInformation.setWhere(wherestr); - return alarmInformationDao.getDistinctMold(alarmInformation); - } -} diff --git a/src/com/sipai/service/alarm/impl/AlarmLevelsServiceImpl.java b/src/com/sipai/service/alarm/impl/AlarmLevelsServiceImpl.java deleted file mode 100644 index c25bd2ef..00000000 --- a/src/com/sipai/service/alarm/impl/AlarmLevelsServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.alarm.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.alarm.AlarmLevelsDao; -import com.sipai.entity.alarm.AlarmLevels; -import com.sipai.service.alarm.AlarmLevelsService; - -@Service -public class AlarmLevelsServiceImpl implements AlarmLevelsService { - @Resource - private AlarmLevelsDao alarmLevelsDao; - - public AlarmLevels selectById(String id) { - return alarmLevelsDao.selectByPrimaryKey(id); - } - - public int deleteById(String id) { - return alarmLevelsDao.deleteByPrimaryKey(id); - } - - public int save(AlarmLevels entity) { - return alarmLevelsDao.insert(entity); - } - - @Transactional - public int update(AlarmLevels entity) { - try { - int res= alarmLevelsDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String wherestr) { - AlarmLevels group = new AlarmLevels(); - group.setWhere(wherestr); - List alarmLevels =alarmLevelsDao.selectListByWhere(group); - return alarmLevels; - } - - public int deleteByWhere(String wherestr) { - AlarmLevels group = new AlarmLevels(); - group.setWhere(wherestr); - return alarmLevelsDao.deleteByWhere(group); - } - - public AlarmLevels selectCountByWhere(String wherestr) { - return alarmLevelsDao.selectCountByWhere(wherestr); - } - -} diff --git a/src/com/sipai/service/alarm/impl/AlarmMoldServiceImpl.java b/src/com/sipai/service/alarm/impl/AlarmMoldServiceImpl.java deleted file mode 100644 index 269472e3..00000000 --- a/src/com/sipai/service/alarm/impl/AlarmMoldServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.alarm.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.alarm.AlarmMoldDao; -import com.sipai.entity.alarm.AlarmMold; -import com.sipai.service.alarm.AlarmMoldService; - -@Service -public class AlarmMoldServiceImpl implements AlarmMoldService { - @Resource - private AlarmMoldDao alarmMoldDao; - - public AlarmMold selectById(String id) { - return alarmMoldDao.selectByPrimaryKey(id); - } - - public int deleteById(String id) { - return alarmMoldDao.deleteByPrimaryKey(id); - } - - public int save(AlarmMold entity) { - return alarmMoldDao.insert(entity); - } - - @Transactional - public int update(AlarmMold entity) { - try { - int res= alarmMoldDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String wherestr) { - AlarmMold group = new AlarmMold(); - group.setWhere(wherestr); - List alarmMold =alarmMoldDao.selectListByWhere(group); - return alarmMold; - } - - public int deleteByWhere(String wherestr) { - AlarmMold group = new AlarmMold(); - group.setWhere(wherestr); - return alarmMoldDao.deleteByWhere(group); - } - - public AlarmMold selectCountByWhere(String wherestr) { - return alarmMoldDao.selectCountByWhere(wherestr); - } - -} diff --git a/src/com/sipai/service/alarm/impl/AlarmPointRiskLevelServiceImpl.java b/src/com/sipai/service/alarm/impl/AlarmPointRiskLevelServiceImpl.java deleted file mode 100644 index 1353fc54..00000000 --- a/src/com/sipai/service/alarm/impl/AlarmPointRiskLevelServiceImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.alarm.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.work.AreaManage; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.service.work.AreaManageService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.alarm.AlarmPointRiskLevelDao; -import com.sipai.entity.alarm.AlarmPointRiskLevel; -import com.sipai.service.alarm.AlarmPointRiskLevelService; - -@Service -public class AlarmPointRiskLevelServiceImpl implements AlarmPointRiskLevelService { - @Resource - private AlarmPointRiskLevelDao alarmPointRiskLevelDao; - @Resource - private RiskLevelService riskLevelService; - @Resource - private AreaManageService areaManageService; - - public AlarmPointRiskLevel selectById(String id) { - AlarmPointRiskLevel alarmPointRiskLevel = alarmPointRiskLevelDao.selectByPrimaryKey(id); - if(StringUtils.isNotBlank(alarmPointRiskLevel.getAreaId())) { - alarmPointRiskLevel.setAreaManage(areaManageService.selectById(alarmPointRiskLevel.getAreaId())); - } - if(StringUtils.isNotBlank(alarmPointRiskLevel.getRiskLevelId())) { - alarmPointRiskLevel.setRiskLevel(riskLevelService.selectById(alarmPointRiskLevel.getRiskLevelId())); - } - return alarmPointRiskLevel; - } - - public int deleteById(String id) { - return alarmPointRiskLevelDao.deleteByPrimaryKey(id); - } - - public int save(AlarmPointRiskLevel entity) { - return alarmPointRiskLevelDao.insert(entity); - } - - @Transactional - public int update(AlarmPointRiskLevel entity) { - try { - int res = alarmPointRiskLevelDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String wherestr) { - AlarmPointRiskLevel group = new AlarmPointRiskLevel(); - group.setWhere(wherestr); - List alarmPointRiskLevel = alarmPointRiskLevelDao.selectListByWhere(group); - for (AlarmPointRiskLevel item : alarmPointRiskLevel) { - item.setRiskLevel(riskLevelService.selectById(item.getRiskLevelId())); - AreaManage areaManage = areaManageService.selectById(item.getAreaId()); - item.setAreaManage(areaManage); - item.setAreaText(areaManage.getName()); - if (!"-1".equals(areaManage.getPid())) { - AreaManage areaManage1 = areaManageService.selectById(areaManage.getPid()); - item.setAreaText(areaManage1.getName() + "——" + areaManage.getName()); - } - } - return alarmPointRiskLevel; - } - - public int deleteByWhere(String wherestr) { - AlarmPointRiskLevel group = new AlarmPointRiskLevel(); - group.setWhere(wherestr); - return alarmPointRiskLevelDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/alarm/impl/AlarmPointServiceImpl.java b/src/com/sipai/service/alarm/impl/AlarmPointServiceImpl.java deleted file mode 100644 index 28bd0786..00000000 --- a/src/com/sipai/service/alarm/impl/AlarmPointServiceImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.sipai.service.alarm.impl; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.alarm.AlarmPointDao; -import com.sipai.entity.alarm.AlarmInformation; -import com.sipai.entity.alarm.AlarmPoint; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.scada.MPointService; - -@Service("alarmPointService") -public class AlarmPointServiceImpl implements AlarmPointService { - @Resource - private AlarmPointDao alarmPointDao; - @Resource - private MPointService mPointService; - @Resource - private AlarmInformationService alarmInformationService; - @Resource - private ProAlarmService proAlarmService; - - public AlarmPoint selectById(String id) { - AlarmPoint alarmPoint = alarmPointDao.selectByPrimaryKey(id); - if (alarmPoint != null) { - String unitId = alarmPoint.getUnitId(); - if (alarmPoint.getType().equals(AlarmPoint.Type_MPoint)) { - MPoint mPoint = this.mPointService.selectById(unitId, alarmPoint.getAlarmPoint()); - if (mPoint != null) { - alarmPoint.setAlarmPointName(mPoint.getParmname()); - if (alarmPoint.getInformationCode().contains(AlarmMoldCodeEnum.LimitValue_Pro.getKey())) { - alarmPoint.setmPoint(mPoint); - } - } - } - } - return alarmPoint; - } - - public int deleteById(String id) { - return alarmPointDao.deleteByPrimaryKey(id); - } - - public int save(AlarmPoint entity) { - return alarmPointDao.insert(entity); - } - - @Transactional - public int update(AlarmPoint entity) { - try { - int res = alarmPointDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String wherestr, String searchName) { - AlarmPoint group = new AlarmPoint(); - group.setWhere(wherestr); - List alarmPoint = alarmPointDao.selectListByWhere(group); - if (alarmPoint != null && alarmPoint.size() > 0) { - for (int i = 0; i < alarmPoint.size(); i++) { - String unitId = alarmPoint.get(i).getUnitId(); - List alarmInformationlist = this.alarmInformationService.selectListByWhere(" where code='" + alarmPoint.get(i).getInformationCode() + "' and unit_id='" + unitId + "' "); - if (alarmInformationlist != null) { - alarmPoint.get(i).setInformationCodeName(alarmInformationlist.get(0).getName()); - } - - if (alarmPoint.get(i).getType().equals(AlarmPoint.Type_MPoint)) { - if (searchName != null && searchName.length() > 0) { - List mPoints = this.mPointService.selectListByWhere(unitId, " where MPointCode='" + alarmPoint.get(i).getAlarmPoint() + "' and (MPointCode like '%" + searchName + "%' or ParmName like '%" + searchName + "%') "); - if (mPoints.size() == 0) { - alarmPoint.remove(i); - i--; - } else { - MPoint mPoint = this.mPointService.selectById(unitId, alarmPoint.get(i).getAlarmPoint()); - if (mPoint != null) { - alarmPoint.get(i).setAlarmPointName(mPoint.getParmname()); - } else { - alarmPoint.get(i).setAlarmPointName(alarmPoint.get(i).getAlarmPoint()); - } - } - } else { - MPoint mPoint = this.mPointService.selectById(unitId, alarmPoint.get(i).getAlarmPoint()); - if (mPoint != null) { - alarmPoint.get(i).setAlarmPointName(mPoint.getParmname()); - } else { - alarmPoint.get(i).setAlarmPointName(alarmPoint.get(i).getAlarmPoint()); - } - } - } else { - alarmPoint.get(i).setAlarmPointName(alarmPoint.get(i).getAlarmPoint()); - } - - - } - } - return alarmPoint; - } - - public List selectListByWhere2(String wherestr) { - AlarmPoint group = new AlarmPoint(); - group.setWhere(wherestr); - List alarmPoint = alarmPointDao.selectListByWhere(group); - return alarmPoint; - } - - public int deleteByWhere(String wherestr) { - AlarmPoint group = new AlarmPoint(); - group.setWhere(wherestr); - return alarmPointDao.deleteByWhere(group); - } - - public List selectListJoinInformationByWhere(String wherestr) { - List alarmPoint = alarmPointDao.selectListJoinInformationByWhere(wherestr); - if (alarmPoint != null && alarmPoint.size() > 0) { - for (int i = 0; i < alarmPoint.size(); i++) { - String unitId = alarmPoint.get(i).getUnitId(); - List alarmInformationlist = this.alarmInformationService.selectListByWhere(" where code='" + alarmPoint.get(i).getInformationCode() + "' and unit_id='" + unitId + "' "); - if (alarmInformationlist != null) { - alarmPoint.get(i).setInformationCodeName(alarmInformationlist.get(0).getName()); - } - if (alarmPoint.get(i).getType().equals(AlarmPoint.Type_MPoint)) { - MPoint mPoint = this.mPointService.selectById(unitId, alarmPoint.get(i).getAlarmPoint()); - if (mPoint != null) { - alarmPoint.get(i).setAlarmPointName(mPoint.getParmname()); - } -// if(searchName!=null&&searchName.length()>0){ -// List mPoints = this.mPointService.selectListByWhere(unitId, " where MPointCode='"+alarmPoint.get(i).getAlarmPoint()+"' and (MPointCode like '%"+searchName+"%' or ParmName like '%"+searchName+"%') "); -// if(mPoints.size()==0){ -// alarmPoint.remove(i); -// i--; -// }else{ -// MPoint mPoint=this.mPointService.selectById(unitId, alarmPoint.get(i).getAlarmPoint()); -// alarmPoint.get(i).setAlarmPointName(mPoint.getParmname()); -// } -// }else{ -// MPoint mPoint=this.mPointService.selectById(unitId, alarmPoint.get(i).getAlarmPoint()); -// alarmPoint.get(i).setAlarmPointName(mPoint.getParmname()); -// } - } - } - } - return alarmPoint; - } - - public int alarmRecover(String bizid, String pointCode, String alarmTime, String recoverValue) { - List list = this.proAlarmService.selectListByWhere(bizid, " where point_code='" + pointCode + "' and alarm_time='" + alarmTime + "' "); - if (list != null && list.size() > 0) { - ProAlarm proAlarm = list.get(0); - proAlarm.setStatus(ProAlarm.STATUS_ALARM_RECOVER); - proAlarm.setRecoverTime(CommUtil.nowDate()); - BigDecimal bd = new BigDecimal(recoverValue); - proAlarm.setRecoverValue(bd); - - this.proAlarmService.topAlarmNumC(null, proAlarm.getPointCode(), ProAlarm.C_type_reduce); - - return this.proAlarmService.update(bizid, proAlarm); - } else { - return Result.FAILED; - } - } - - public int alarmRecover2(String bizid, String pointCode, String recoverValue) { - List list = this.proAlarmService.selectListByWhere(bizid, " where point_code='" + pointCode + "' and status!='" + ProAlarm.STATUS_ALARM_RECOVER + "' "); - if (list != null && list.size() > 0) { - int result = 0; - for (ProAlarm proAlarm : - list) { - proAlarm.setStatus(ProAlarm.STATUS_ALARM_RECOVER); - proAlarm.setRecoverTime(CommUtil.nowDate()); - BigDecimal bd = new BigDecimal(recoverValue); - proAlarm.setRecoverValue(bd); - result += this.proAlarmService.update(bizid, proAlarm); - } - return result; - } else { - return Result.FAILED; - } - } - - public int insertAlarm(String unitId, HttpServletRequest request, String alarmType, String pointId, String pointName, String alarmTime, String levelType, String describe, String nowValue, String prSectionCode, String prSectionName) { - String nowTime = alarmTime; - - List proAlarms = this.proAlarmService.selectTop1ListByWhere(unitId, " where status!='" + ProAlarm.STATUS_ALARM_RECOVER + "'" + -// " and point_code='" + pointId + "' and (alarm_time between '" + nowTime.substring(0, 10) + " 00:00' and '" + nowTime + "') " + - " and point_code='" + pointId + "' " + - " order by alarm_time desc"); - ProAlarm proAlarm = new ProAlarm(); - if (proAlarms.size() > 0) { - proAlarm.setId(proAlarms.get(0).getId()); - proAlarm.setAlarmTime(nowTime); - proAlarm.setOriginalStatus(nowValue); - proAlarm.setDescribe(describe); - return this.proAlarmService.update(unitId, proAlarm); - } else { - proAlarm.setId(CommUtil.getUUID()); - proAlarm.setInsdt(nowTime); - proAlarm.setAlarmTime(nowTime); - proAlarm.setAlarmType(alarmType); - proAlarm.setPointCode(pointId); - proAlarm.setPointName(pointName); - proAlarm.setStatus(ProAlarm.STATUS_ALARM); - - proAlarm.setProcessSectionCode(prSectionCode); - proAlarm.setProcessSectionName(prSectionName); - - proAlarm.setBizId(unitId); - proAlarm.setDescribe(describe); - proAlarm.setAlarmType(alarmType); - proAlarm.setAlarmLevel(levelType); - proAlarm.setOriginalStatus(nowValue); - - this.proAlarmService.topAlarmNumC(request, proAlarm.getPointCode(), ProAlarm.C_type_add); - - return this.proAlarmService.save(unitId, proAlarm); - } - - } - -} diff --git a/src/com/sipai/service/alarm/impl/AlarmSubscribeServiceImpl.java b/src/com/sipai/service/alarm/impl/AlarmSubscribeServiceImpl.java deleted file mode 100644 index 308a2d46..00000000 --- a/src/com/sipai/service/alarm/impl/AlarmSubscribeServiceImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.alarm.impl; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.alarm.AlarmPoint; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.alarm.AlarmSubscribeDao; -import com.sipai.entity.alarm.AlarmSubscribe; -import com.sipai.service.alarm.AlarmSubscribeService; - -@Service("alarmSubscribeService") -public class AlarmSubscribeServiceImpl implements AlarmSubscribeService { - @Resource - private AlarmSubscribeDao alarmSubscribeDao; - @Resource - private MPointService mPointService; - - public AlarmSubscribe selectById(String id) { - return alarmSubscribeDao.selectByPrimaryKey(id); - } - - public int deleteById(String id) { - return alarmSubscribeDao.deleteByPrimaryKey(id); - } - - public int save(AlarmSubscribe entity) { - return alarmSubscribeDao.insert(entity); - } - - @Transactional - public int update(AlarmSubscribe entity) { - try { - int res= alarmSubscribeDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String wherestr) { - AlarmSubscribe group = new AlarmSubscribe(); - group.setWhere(wherestr); - List alarmSubscribeList =alarmSubscribeDao.selectListByWhere(group); - return alarmSubscribeList; - } - - public int deleteByWhere(String wherestr) { - AlarmSubscribe group = new AlarmSubscribe(); - group.setWhere(wherestr); - return alarmSubscribeDao.deleteByWhere(group); - } - - public List selectLeftOuterListByWhere(String wherestr) { - List alarmSubscribeList =alarmSubscribeDao.selectLeftOuterListByWhere(wherestr); - for (AlarmSubscribe alarmSubscribe: - alarmSubscribeList) { - if(alarmSubscribe.getType().equals(AlarmPoint.Type_MPoint)){ - MPoint mPoint = this.mPointService.selectById(alarmSubscribe.getUnitId(),alarmSubscribe.getAlarmPoint()); - if(mPoint!=null){ - alarmSubscribe.setAlarmPointName(mPoint.getParmname()); - } - } - } - return alarmSubscribeList; - } - - public List selectMoldCountByWhere(String wherestr) { - return alarmSubscribeDao.selectMoldCountByWhere(wherestr); - } - - public List selectlevelCountByWhere(String wherestr) { - return alarmSubscribeDao.selectlevelCountByWhere(wherestr); - } -} diff --git a/src/com/sipai/service/app/AppDataConfigureService.java b/src/com/sipai/service/app/AppDataConfigureService.java deleted file mode 100644 index e9233727..00000000 --- a/src/com/sipai/service/app/AppDataConfigureService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.app; - -import java.util.List; - -import com.sipai.entity.app.AppDataConfigure; - -public interface AppDataConfigureService { - - public abstract AppDataConfigure selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AppDataConfigure entity); - - public abstract int update(AppDataConfigure entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectListByCacheData(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/app/AppHomePageDataService.java b/src/com/sipai/service/app/AppHomePageDataService.java deleted file mode 100644 index 9a3ff348..00000000 --- a/src/com/sipai/service/app/AppHomePageDataService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.app; - -import java.util.List; - -import com.sipai.entity.app.AppHomePageData; - -public interface AppHomePageDataService { - - public abstract AppHomePageData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AppHomePageData entity); - - public abstract int update(AppHomePageData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/app/AppMenuitemService.java b/src/com/sipai/service/app/AppMenuitemService.java deleted file mode 100644 index de9c2969..00000000 --- a/src/com/sipai/service/app/AppMenuitemService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.app; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.app.AppMenuitem; - -public interface AppMenuitemService { - - public abstract AppMenuitem selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AppMenuitem entity); - - public abstract int update(AppMenuitem entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - String getTreeList(List> list_result, List list); - -} \ No newline at end of file diff --git a/src/com/sipai/service/app/AppProductMonitorMpService.java b/src/com/sipai/service/app/AppProductMonitorMpService.java deleted file mode 100644 index 0090b7ec..00000000 --- a/src/com/sipai/service/app/AppProductMonitorMpService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.app; - -import java.util.List; - -import com.sipai.entity.app.AppProductMonitorMp; - -public interface AppProductMonitorMpService { - - public abstract AppProductMonitorMp selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AppProductMonitorMp entity); - - public abstract int update(AppProductMonitorMp entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/app/AppProductMonitorService.java b/src/com/sipai/service/app/AppProductMonitorService.java deleted file mode 100644 index 2caabfd8..00000000 --- a/src/com/sipai/service/app/AppProductMonitorService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.app; - -import java.util.List; - -import com.sipai.entity.app.AppProductMonitor; - -public interface AppProductMonitorService { - - public abstract AppProductMonitor selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AppProductMonitor entity); - - public abstract int update(AppProductMonitor entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/app/AppRoleMenuService.java b/src/com/sipai/service/app/AppRoleMenuService.java deleted file mode 100644 index 1e8013a3..00000000 --- a/src/com/sipai/service/app/AppRoleMenuService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.service.app; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.app.AppRoleMenu; - -public interface AppRoleMenuService { - - public abstract AppRoleMenu selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AppRoleMenu entity); - - public abstract int update(AppRoleMenu entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public List getFinalMenuByRoleId(String roleid); - - /** - * 更新角色和菜单关系表 - * - * @param roleid - * @param menustr - * @return - */ - public int updateRoleMenu(String roleid, String menustr); - - public abstract List selectDistinctMenuIDListByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/app/impl/AppDataConfigureServiceImpl.java b/src/com/sipai/service/app/impl/AppDataConfigureServiceImpl.java deleted file mode 100644 index 15a2b4be..00000000 --- a/src/com/sipai/service/app/impl/AppDataConfigureServiceImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.service.app.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.app.AppDataConfigureDao; -import com.sipai.entity.app.AppDataConfigure; -import com.sipai.service.app.AppDataConfigureService; - -@Service -public class AppDataConfigureServiceImpl implements AppDataConfigureService { - @Resource - private AppDataConfigureDao appDataConfigureDao; - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public AppDataConfigure selectById(String id) { - return appDataConfigureDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String id) { - return appDataConfigureDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#save(com.sipai.entity.app.MPFangAn) - */ - public int save(AppDataConfigure entity) { - return appDataConfigureDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.app.MPFangAn) - */ - @Transactional - public int update(AppDataConfigure entity) { - try { - int res= appDataConfigureDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String wherestr) { - AppDataConfigure group = new AppDataConfigure(); - group.setWhere(wherestr); - List appDataConfigure =appDataConfigureDao.selectListByWhere(group); - return appDataConfigure; - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String wherestr) { - AppDataConfigure group = new AppDataConfigure(); - group.setWhere(wherestr); - return appDataConfigureDao.deleteByWhere(group); - } - - public List selectListByCacheData(String wherestr) { - AppDataConfigure group = new AppDataConfigure(); - group.setWhere(wherestr); - List appDataConfigure =appDataConfigureDao.selectListByCacheData(group); - return appDataConfigure; - } - -} diff --git a/src/com/sipai/service/app/impl/AppHomePageDataServiceImpl.java b/src/com/sipai/service/app/impl/AppHomePageDataServiceImpl.java deleted file mode 100644 index a908cd30..00000000 --- a/src/com/sipai/service/app/impl/AppHomePageDataServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.app.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.app.AppHomePageDataDao; -import com.sipai.entity.app.AppHomePageData; -import com.sipai.service.app.AppHomePageDataService; - -@Service -public class AppHomePageDataServiceImpl implements AppHomePageDataService { - @Resource - private AppHomePageDataDao appHomePageDataDao; - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public AppHomePageData selectById(String id) { - return appHomePageDataDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String id) { - return appHomePageDataDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#save(com.sipai.entity.app.MPFangAn) - */ - public int save(AppHomePageData entity) { - return appHomePageDataDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.app.MPFangAn) - */ - @Transactional - public int update(AppHomePageData entity) { - try { - int res= appHomePageDataDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String wherestr) { - AppHomePageData group = new AppHomePageData(); - group.setWhere(wherestr); - List appHomePageData =appHomePageDataDao.selectListByWhere(group); - return appHomePageData; - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String wherestr) { - AppHomePageData group = new AppHomePageData(); - group.setWhere(wherestr); - return appHomePageDataDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/app/impl/AppMenuitemServiceImpl.java b/src/com/sipai/service/app/impl/AppMenuitemServiceImpl.java deleted file mode 100644 index 47c3efb8..00000000 --- a/src/com/sipai/service/app/impl/AppMenuitemServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.sipai.service.app.impl; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.app.AppMenuitemDao; -import com.sipai.entity.app.AppMenuitem; -import com.sipai.service.app.AppMenuitemService; - -@Service -public class AppMenuitemServiceImpl implements AppMenuitemService { - @Resource - private AppMenuitemDao appMenuitemDao; - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public AppMenuitem selectById(String id) { - return appMenuitemDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String id) { - return appMenuitemDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#save(com.sipai.entity.app.MPFangAn) - */ - public int save(AppMenuitem entity) { - return appMenuitemDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.app.MPFangAn) - */ - @Transactional - public int update(AppMenuitem entity) { - try { - int res= appMenuitemDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String wherestr) { - AppMenuitem group = new AppMenuitem(); - group.setWhere(wherestr); - List appMenuitem =appMenuitemDao.selectListByWhere(group); - return appMenuitem; - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String wherestr) { - AppMenuitem group = new AppMenuitem(); - group.setWhere(wherestr); - return appMenuitemDao.deleteByWhere(group); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - @Override - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (AppMenuitem k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - list_result.add(map); - } - } - getTreeList(list_result, list); - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (AppMenuitem k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/app/impl/AppProductMonitorMpServiceImpl.java b/src/com/sipai/service/app/impl/AppProductMonitorMpServiceImpl.java deleted file mode 100644 index 87efe5da..00000000 --- a/src/com/sipai/service/app/impl/AppProductMonitorMpServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.service.app.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.scada.MPoint; -import org.springframework.stereotype.Service; - -import com.sipai.dao.app.AppProductMonitorMpDao; -import com.sipai.entity.app.AppProductMonitorMp; -import com.sipai.entity.report.RptDayValSet; -import com.sipai.service.app.AppProductMonitorMpService; -import com.sipai.service.scada.MPointService; - -@Service -public class AppProductMonitorMpServiceImpl implements AppProductMonitorMpService { - @Resource - private AppProductMonitorMpDao appProductMonitorMpDao; - @Resource - private MPointService mPointService; - - public AppProductMonitorMp selectById(String id) { - return this.appProductMonitorMpDao.selectByPrimaryKey(id); - } - - public int deleteById(String id) { - return this.appProductMonitorMpDao.deleteByPrimaryKey(id); - } - - public int save(AppProductMonitorMp entity) { - return this.appProductMonitorMpDao.insert(entity); - } - - public int update(AppProductMonitorMp entity) { - int res = this.appProductMonitorMpDao.updateByPrimaryKeySelective(entity); - return res; - } - - public List selectListByWhere(String wherestr) { - AppProductMonitorMp group = new AppProductMonitorMp(); - group.setWhere(wherestr); - List list = this.appProductMonitorMpDao.selectListByWhere(group); - for (AppProductMonitorMp item : list) { - MPoint mPoint = this.mPointService.selectById(item.getUnitId(), item.getMpid()); - if (mPoint != null) { - item.setmPoint(mPoint); - //减少配置 直接使用测量点的排序 - item.setMorder(mPoint.getMorder()); - } - } - return list; - } - - public int deleteByWhere(String wherestr) { - AppProductMonitorMp group = new AppProductMonitorMp(); - group.setWhere(wherestr); - return this.appProductMonitorMpDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/app/impl/AppProductMonitorServiceImpl.java b/src/com/sipai/service/app/impl/AppProductMonitorServiceImpl.java deleted file mode 100644 index eacae78e..00000000 --- a/src/com/sipai/service/app/impl/AppProductMonitorServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.service.app.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.app.AppProductMonitorDao; -import com.sipai.entity.app.AppProductMonitor; -import com.sipai.service.app.AppProductMonitorService; - -@Service -public class AppProductMonitorServiceImpl implements AppProductMonitorService { - @Resource - private AppProductMonitorDao appProductMonitorDao; - - public AppProductMonitor selectById(String id) { - return this.appProductMonitorDao.selectByPrimaryKey(id); - } - - public int deleteById(String id) { - return this.appProductMonitorDao.deleteByPrimaryKey(id); - } - - public int save(AppProductMonitor entity) { - return this.appProductMonitorDao.insert(entity); - } - - public int update(AppProductMonitor entity) { - int res= this.appProductMonitorDao.updateByPrimaryKeySelective(entity); - return res; - } - - public List selectListByWhere(String wherestr) { - AppProductMonitor group = new AppProductMonitor(); - group.setWhere(wherestr); - List appHomePageData =this.appProductMonitorDao.selectListByWhere(group); - return appHomePageData; - } - - public int deleteByWhere(String wherestr) { - AppProductMonitor group = new AppProductMonitor(); - group.setWhere(wherestr); - return this.appProductMonitorDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/app/impl/AppRoleMenuServiceImpl.java b/src/com/sipai/service/app/impl/AppRoleMenuServiceImpl.java deleted file mode 100644 index 4f040fcd..00000000 --- a/src/com/sipai/service/app/impl/AppRoleMenuServiceImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.sipai.service.app.impl; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.app.AppRoleMenuDao; -import com.sipai.entity.app.AppRoleMenu; -import com.sipai.service.app.AppRoleMenuService; - -@Service -public class AppRoleMenuServiceImpl implements AppRoleMenuService { - @Resource - private AppRoleMenuDao appRoleMenuDao; - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public AppRoleMenu selectById(String id) { - return appRoleMenuDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String id) { - return appRoleMenuDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#save(com.sipai.entity.app.MPFangAn) - */ - public int save(AppRoleMenu entity) { - return appRoleMenuDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.app.MPFangAn) - */ - @Transactional - public int update(AppRoleMenu entity) { - try { - int res= appRoleMenuDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String wherestr) { - AppRoleMenu group = new AppRoleMenu(); - group.setWhere(wherestr); - List appRoleMenu =appRoleMenuDao.selectListByWhere(group); - return appRoleMenu; - } - - /* (non-Javadoc) - * @see com.sipai.service.app.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String wherestr) { - AppRoleMenu group = new AppRoleMenu(); - group.setWhere(wherestr); - return appRoleMenuDao.deleteByWhere(group); - } - - @Override - public List getFinalMenuByRoleId(String roleid){ - List listres= new ArrayList(); -// if(list!=null &&list.size()>0){ -// for(int i=0;i0){ -// for(int j=0;j=0 && !menustr.trim().equals("")){ - String[] menuids=menustr.split(","); - for(String menuid:menuids){ - AppRoleMenu roleMenu = new AppRoleMenu(); - roleMenu.setRoleid(roleid); - roleMenu.setMenuid(menuid); - - insres += appRoleMenuDao.insert(roleMenu); - } - } - return insres; - } - - public List selectDistinctMenuIDListByWhere(String wherestr) { - AppRoleMenu group = new AppRoleMenu(); - group.setWhere(wherestr); - List appRoleMenu =appRoleMenuDao.selectDistinctMenuIDListByWhere(group); - return appRoleMenu; - } - -} diff --git a/src/com/sipai/service/base/BasicComponentsService.java b/src/com/sipai/service/base/BasicComponentsService.java deleted file mode 100644 index 6cc08c1c..00000000 --- a/src/com/sipai/service/base/BasicComponentsService.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.service.base; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.base.BasicComponentsDao; -import com.sipai.entity.base.BasicComponents; -import com.sipai.entity.base.BasicConfigure; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class BasicComponentsService implements CommService{ - @Resource - private BasicComponentsDao basicComponentsDao; - @Resource - private MPointService mPointService; - @Resource - private BasicConfigureService basicConfigureService; - - @Override - public BasicComponents selectById(String id) { - BasicComponents basicComponents=basicComponentsDao.selectByPrimaryKey(id); - if (basicComponents.getId() != null && !basicComponents.getId().isEmpty()) { - List basicConfigure = this.basicConfigureService.selectListByWhere("where pid='"+basicComponents.getId()+"' and active='1' order by morder "); - if(basicConfigure!=null && basicConfigure.size()>0){ - basicComponents.setBasicConfigure(basicConfigure.get(0)); - } - } - return basicComponents; - } - - @Override - public int deleteById(String id) { - return basicComponentsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BasicComponents entity) { - return basicComponentsDao.insert(entity); - } - - @Override - public int update(BasicComponents entity) { - return basicComponentsDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BasicComponents basicComponents = new BasicComponents(); - basicComponents.setWhere(wherestr); - List list =basicComponentsDao.selectListByWhere(basicComponents); - for (BasicComponents item : list) { - if (item.getId() != null && !item.getId().isEmpty()) { - List basicConfigure = this.basicConfigureService.selectListByWhere("where pid='"+item.getId()+"' and active='1' order by morder "); - if(basicConfigure!=null && basicConfigure.size()>0){ - item.setBasicConfigure(basicConfigure.get(0)); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BasicComponents basicComponents = new BasicComponents(); - basicComponents.setWhere(wherestr); - return basicComponentsDao.deleteByWhere(basicComponents); - } - public JSONArray selectListByWhereAll(String wherestr){ - JSONArray jsonArray = new JSONArray(); - List basicComponentsList = this.selectListByWhere(wherestr); - if(basicComponentsList!=null && basicComponentsList.size()>0){ - for(BasicComponents basicComponents : basicComponentsList){ - JSONObject jsonObj = new JSONObject(); - jsonObj.put("id", basicComponents.getCode()); - String text=""; - String url=""; - String type=""; - String abspath=""; - - if(basicComponents.getBasicConfigure()!=null){ - if(basicComponents.getBasicConfigure().getName()!=null){ - text = basicComponents.getBasicConfigure().getName(); - } - if(basicComponents.getBasicConfigure().getAbspath()!=null){ - abspath = basicComponents.getBasicConfigure().getAbspath(); - } - if(basicComponents.getBasicConfigure().getType()!=null){ - type = basicComponents.getBasicConfigure().getType(); - } - if(basicComponents.getBasicConfigure().getUrl()!=null){ - url = basicComponents.getBasicConfigure().getUrl(); - } - } - jsonObj.put("text", text); - jsonObj.put("abspath", abspath); - jsonObj.put("url", url); - jsonObj.put("type", type);//file、text - jsonArray.add(jsonObj); - } - } - return jsonArray; - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - //20181212 YYJ 树根节点判断方法为该项的pid不在数组中的id内出现则认为根节点 - if(list_result == null ) { - list_result = new ArrayList>(); - for(BasicComponents k: list) { - Map map = new HashMap(); - Inner:for(int i =0;i0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(BasicComponents k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - List tags = new ArrayList(); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - getTreeList(childlist,list); - } - } - } - return JSON.toJSONString(list_result); - } -} diff --git a/src/com/sipai/service/base/BasicConfigureService.java b/src/com/sipai/service/base/BasicConfigureService.java deleted file mode 100644 index 033fe0eb..00000000 --- a/src/com/sipai/service/base/BasicConfigureService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.base; -import com.sipai.dao.base.BasicConfigureDao; -import com.sipai.entity.base.BasicConfigure; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class BasicConfigureService implements CommService{ - @Resource - private BasicConfigureDao basicConfigureDao; - @Resource - private MPointService mPointService; - @Resource - private CommonFileService commonFileService; - - @Override - public BasicConfigure selectById(String id) { - BasicConfigure basicConfigure=basicConfigureDao.selectByPrimaryKey(id); - return basicConfigure; - } - - @Override - public int deleteById(String id) { - return basicConfigureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BasicConfigure entity) { - return basicConfigureDao.insert(entity); - } - - @Override - public int update(BasicConfigure entity) { - return basicConfigureDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BasicConfigure basicConfigure = new BasicConfigure(); - basicConfigure.setWhere(wherestr); - List list =basicConfigureDao.selectListByWhere(basicConfigure); - /*for (BasicConfigure item : list) { - if (item.getId() != null && !item.getId().isEmpty()) { - String mappernamespace = "document.DocFileMapper"; - List commonFiles= commonFileService.selectByMasterId(item.getId(), mappernamespace); - if(commonFiles!=null && commonFiles.size()>0){ - item.setAbspath(commonFiles.get(0).getAbspath()); - } - } - }*/ - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BasicConfigure basicConfigure = new BasicConfigure(); - basicConfigure.setWhere(wherestr); - return basicConfigureDao.deleteByWhere(basicConfigure); - } - -} diff --git a/src/com/sipai/service/base/BasicHomePageService.java b/src/com/sipai/service/base/BasicHomePageService.java deleted file mode 100644 index 0bf36d08..00000000 --- a/src/com/sipai/service/base/BasicHomePageService.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.sipai.service.base; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.service.user.UserService; -import org.springframework.stereotype.Service; - -import com.sipai.dao.base.BasicHomePageDao; -import com.sipai.entity.base.BasicHomePage; -import com.sipai.tools.CommService; - -@Service -public class BasicHomePageService implements CommService { - @Resource - private BasicHomePageDao basicHomePageDao; - @Resource - private UserService userService; - - @Override - public BasicHomePage selectById(String id) { - BasicHomePage basicHomePage = basicHomePageDao.selectByPrimaryKey(id); - String unrolepeopleName = this.userService.getUserNamesByUserIds(basicHomePage.getUnrolepeople()); - basicHomePage.setUnrolepeopleName(unrolepeopleName); - return basicHomePage; - } - - @Override - public int deleteById(String id) { - return basicHomePageDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BasicHomePage entity) { - return basicHomePageDao.insert(entity); - } - - @Override - public int update(BasicHomePage entity) { - return basicHomePageDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BasicHomePage basicHomePage = new BasicHomePage(); - basicHomePage.setWhere(wherestr); - List list = basicHomePageDao.selectListByWhere(basicHomePage); - if (list != null && list.size() > 0) { - for (BasicHomePage basicHomePage2 : - list) { - String unrolepeopleName = this.userService.getUserNamesByUserIds(basicHomePage2.getUnrolepeople()); - basicHomePage2.setUnrolepeopleName(unrolepeopleName); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BasicHomePage basicHomePage = new BasicHomePage(); - basicHomePage.setWhere(wherestr); - return basicHomePageDao.deleteByWhere(basicHomePage); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - Map pmap = new HashMap(); - pmap.put("id", "all"); - pmap.put("text", "全局页面"); - list_result.add(pmap); - - for (Unit k : list) { - Map map = new HashMap(); - Inner: - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getId() != null && list.get(i).getId().length() != 0) { - if (list.get(i).getId().equals(k.getPid())) { - break Inner; - } - if (i == list.size() - 1 && !list.get(i).getId().equals(k.getPid())) { - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - } - } - getTreeList(list_result, list); - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (Unit k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - List tags = new ArrayList(); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSON.toJSONString(list_result); - } - -} diff --git a/src/com/sipai/service/base/CommonFileService.java b/src/com/sipai/service/base/CommonFileService.java deleted file mode 100644 index 84be5000..00000000 --- a/src/com/sipai/service/base/CommonFileService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.base; - -import java.io.IOException; -import java.util.List; - -import com.sipai.entity.document.FileIn; -import org.springframework.web.multipart.MultipartFile; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.user.User; - -public interface CommonFileService { - public CommonFile selectById(String id, String mappernamespace); - - public List selectByMasterId(String masterid, String mappernamespace); - - public int saveCommonFile(CommonFile commonFile, String mappernamespace); - - public int deleteById(String id, String mappernamespace); - - public int deleteByMasterId(String masterid, String mappernamespace); - - public String uploadFile(String realPath, String mappernamespace, String masterid, User user, MultipartFile[] file) throws IOException; - - public List selectListByTableAWhere(String tablename, String wherestr); - - public List selectListByTableAWhere2(String tablename, String wherestr); - - public List selectListByTableAWhere3(String tablename, String wherestr); - - public List selectListByTableAWhereForEquip(String tablename, String wherestr); - - public List selectListByTableAWhereForEquipOne(String tablename, String wherestr); - - public int deleteByTableAWhere(String tablename, String wherestr); - - public int insertByTable(String tablename, CommonFile commonFile); - - public int insertByTable2(String tablename, CommonFile commonFile); - - public byte[] getInputStreamBytes(String nameSpace, String filePath); - - /** - * 使用minio 上传文件 (通用) - * - * @param masterId - * @param nameSpace - * @param item - * @return - */ - public int updateFile(String masterId, String nameSpace, String tableName, MultipartFile item); - - /** - * 使用minio 上传文件 (报表上传定制功能,其他模板最好不要使用) - * - * @param masterId - * @param nameSpace - * @param item - * @return - */ - public int updateFile_creat(String masterId, String nameSpace, String tableName, MultipartFile item, String uuid); - - public int updateFileForFileIn(String masterId, String nameSpace, String tableName, FileIn item); - -} diff --git a/src/com/sipai/service/base/CommonFileServiceImpl.java b/src/com/sipai/service/base/CommonFileServiceImpl.java deleted file mode 100644 index 809ededf..00000000 --- a/src/com/sipai/service/base/CommonFileServiceImpl.java +++ /dev/null @@ -1,410 +0,0 @@ -package com.sipai.service.base; - -//import io.minio.ObjectStat; - -import com.sipai.dao.base.CommonFileDao; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.document.Document; -import com.sipai.entity.document.FileIn; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentFile; -import com.sipai.entity.user.User; -import com.sipai.service.document.DocumentService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentFileService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import io.minio.ObjectStat; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -@Service -public class CommonFileServiceImpl implements CommonFileService { - @Resource - private CommonFileDao commonFileDao; - @Resource - private UserService userService; - @Resource - private MinioTemplate minioTemplate; - @Resource - private EquipmentFileService equipmentFileService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private DocumentService documentService; - - @Override - public CommonFile selectById(String id, String mappernamespace) { - this.commonFileDao.setMappernamespace(mappernamespace); - return this.commonFileDao.selectByPrimaryKey(id); - } - - @Override - public List selectByMasterId(String masterid, String mappernamespace) { - this.commonFileDao.setMappernamespace(mappernamespace); - return this.commonFileDao.selectByMasterId(masterid); - } - - @Override - public int saveCommonFile(CommonFile commonFile, String mappernamespace) { - this.commonFileDao.setMappernamespace(mappernamespace); - return this.commonFileDao.insert(commonFile); - } - - @Override - public int deleteById(String id, String mappernamespace) { - this.commonFileDao.setMappernamespace(mappernamespace); - return this.commonFileDao.deleteByPrimaryKey(id); - } - - @Override - public int deleteByMasterId(String masterid, String mappernamespace) { - this.commonFileDao.setMappernamespace(mappernamespace); - return this.commonFileDao.deleteByMasterId(masterid); - } - - /** - * 上传文件到服务器并保存到数据库 - * - * @param realPath 服务器保存路径 - * @param masterid 附件归属业务对象id - * @param user 上传者、操作者 - * @param file 文件对象 - * @return CommonFileDao实例 - */ - @Override - public String uploadFile(String realPath, String mappernamespace, String masterid, User user, MultipartFile[] file) throws IOException { - if (masterid.equals("")) { - return "{\"feedback\":\"MasterId不得为空\"}"; - } - String result = ""; - String feedback = ""; - int filecount = 0; - String originalFilename = null; - String serverPath = null; - CommonFile commonFile = new CommonFile(); - for (MultipartFile myfile : file) { - if (myfile.isEmpty()) { - feedback = "请选择文件后上传!"; - } else { - String id = CommUtil.getUUID(); - originalFilename = myfile.getOriginalFilename(); - //兼容linux路径 - serverPath = realPath + System.getProperty("file.separator") + commonFileDao.getMappernamespace() + "\\\\" + id + "_" + originalFilename; - commonFile.setId(id); - commonFile.setMasterid(masterid); - commonFile.setFilename(originalFilename); - serverPath = serverPath.replaceAll("[\u4e00-\u9fa5]+", "");//删除中文字符 - commonFile.setAbspath(serverPath); - commonFile.setSize(Integer.valueOf(String.valueOf(myfile.getSize()))); - if (user != null) { - commonFile.setInsuser(user.getId()); - } - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setType(originalFilename.substring(originalFilename.lastIndexOf("."), originalFilename.length()).toUpperCase()); - int saveResult = this.saveCommonFile(commonFile, mappernamespace); - if (saveResult > 0) { - System.out.println("文件上传中......"); - FileUtil.saveFile(myfile.getInputStream(), serverPath); - System.out.println("文件上传完成!"); - filecount++; - } else { - feedback = "MapperNamespace有误!"; - } - } - } - if (filecount > 0) { - feedback = "成功上传" + filecount + "个文件!"; - } - result = "{\"feedback\":\"" + feedback + "\"}"; - return result; - } - - public List selectListByTableAWhere(String tablename, String wherestr) { - List list = this.commonFileDao.selectListByTableAWhere(tablename, wherestr); - //查询文件上传者的名称 - for (CommonFile commonFile : list) { - if (commonFile.getInsuser() != null) { - User user = this.userService.getUserById(commonFile.getInsuser()); - commonFile.setUser(user); - } - if (commonFile.getId() != null) { - List equipmentFileList = this.equipmentFileService. - selectListByWhere("where file_id='" + commonFile.getId() + "' order by insdt desc"); - String equipmentcardnames = ""; - String equipmentcardids = ""; - for (EquipmentFile equipmentFile : equipmentFileList) { - if (equipmentFile.getEquipmentId() != null) { - EquipmentCard equipmentCard = equipmentCardService.selectById(equipmentFile.getEquipmentId()); - if (equipmentCard != null) { - equipmentcardnames += equipmentCard.getEquipmentname() + ","; - equipmentcardids += equipmentCard.getId() + ","; - } - } - } - List documentList = documentService.selectListByWhere("where master_id = '" + commonFile.getId() + "'"); - for (Document document : documentList) { - commonFile.setDocumentName(document.getwName()); - } - commonFile.setEquipmentcardnames(equipmentcardnames); - commonFile.setEquipmentcardids(equipmentcardids); - } - } - return list; - } - - public List selectListByTableAWhere2(String tablename, String wherestr) { - List list = this.commonFileDao.selectListByTableAWhere(tablename, wherestr); - //查询文件上传者的名称 - for (CommonFile commonFile : list) { - if (commonFile.getInsuser() != null) { - User user = this.userService.getUserById(commonFile.getInsuser()); - commonFile.setUser(user); - } - if (commonFile.getId() != null) { - List documentList = documentService.selectListByWhere("where master_id = '" + commonFile.getId() + "'"); - for (Document document : documentList) { - commonFile.setDocumentName(document.getwName()); - } - } - } - return list; - } - - public List selectListByTableAWhere3(String tablename, String wherestr) { - List list = this.commonFileDao.selectListByTableAWhere(tablename, wherestr); - return list; - } - - public List selectListByTableAWhereForEquip(String tablename, String wherestr) { - List list = this.commonFileDao.selectListByTableAWhereForEquip(tablename, wherestr); - String ids = ""; - String names = ""; - for (CommonFile commonFile : list) { - if (commonFile.getInsuser() != null) { - //查询文件上传者的名称 - User user = this.userService.getUserById(commonFile.getInsuser()); - commonFile.setUser(user); - } - if (commonFile.getId() != null) { - List equipmentFileList = this.equipmentFileService. - selectListByWhere("where file_id='" + commonFile.getId() + "' order by insdt desc"); - String equipmentcardnames = ""; - String equipmentcardids = ""; - for (EquipmentFile equipmentFile : equipmentFileList) { - if (equipmentFile.getEquipmentId() != null) { - EquipmentCard equipmentCard = equipmentCardService.selectById(equipmentFile.getEquipmentId()); - if (equipmentCard != null) { - equipmentcardnames += equipmentCard.getEquipmentname() + ","; - equipmentcardids += equipmentCard.getId() + ","; - } - } - } - commonFile.setEquipmentcardnames(equipmentcardnames); - commonFile.setEquipmentcardids(equipmentcardids); - } - } - return list; - } - - public List selectListByTableAWhereForEquipOne(String tablename, String wherestr) { - List list = this.commonFileDao.selectListByTableAWhereForEquip(tablename, wherestr); - String ids = ""; - String names = ""; - if(list!=null && list.size()>0){ - for (CommonFile commonFile : list) { - if (commonFile.getInsuser() != null) { - //查询文件上传者的名称 - User user = this.userService.getUserById(commonFile.getInsuser()); - commonFile.setUser(user); - } - if(commonFile.getEquipmentId()!=null && !"".equals(commonFile.getEquipmentId())){ - ids += commonFile.getEquipmentId() + ","; - } - if(commonFile.getEquipmentName()!=null && !"".equals(commonFile.getEquipmentName())){ - names += commonFile.getEquipmentName() + ","; - } - } - list.get(0).setEquipmentcardids(ids); - list.get(0).setEquipmentcardnames(names); - } - return list; - } - - public int deleteByTableAWhere(String tablename, String wherestr) { - return this.commonFileDao.deleteByTableAWhere(tablename, wherestr); - } - - public int insertByTable(String tablename, CommonFile commonFile) { - return this.commonFileDao.insertByTable(tablename, commonFile); - } - - public int insertByTable2(String tablename, CommonFile commonFile) { - return this.commonFileDao.insertByTable(tablename, commonFile); - } - - //minio - @Override - public byte[] getInputStreamBytes(String nameSpace, String filePath) { - byte[] buffer = null; - try { - ObjectStat stat = minioTemplate.statObject(nameSpace, filePath); - InputStream in = minioTemplate.getObject(nameSpace, filePath); - in = minioTemplate.getObject(nameSpace, filePath); - ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); - byte[] buff = new byte[(int) stat.length()]; //buff用于存放循环读取的临时数据 - int rc = 0; - while ((rc = in.read(buff, 0, 100)) > 0) { - swapStream.write(buff, 0, rc); - } - buffer = swapStream.toByteArray(); //in_b为转换之后的结果 - in.close(); - } catch (Exception e) { - e.printStackTrace(); - } - return buffer; - } - - - /** - * 使用minio 上传文件 - * - * @param masterId - * @param nameSpace - * @param item - * @return - */ - @Transactional - public int updateFile(String masterId, String nameSpace, String tableName, MultipartFile item) { - String fileName = ""; //文件名称 - String filePath = ""; //文件存储名称,相同名称在minio中会被覆盖掉 - int res = 0; - try { - fileName = item.getOriginalFilename(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - filePath = dateFormat.format(new Date()) + fileName; - InputStream in = item.getInputStream(); - String contentType = item.getContentType(); - minioTemplate.makeBucket(nameSpace); - minioTemplate.putObject(nameSpace, filePath, in, null, null, null, contentType); -// String url = minioTemplate.getObjectURL(nameSpace, fileName); - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - // 20210105 YYJ 用于文件表绑定资料节点用字段 tb_doc_file内和masterId一样 -// commonFile.setPid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(contentType); - //minio用相对路径 -// commonFile.setFilepath(filePath); - commonFile.setAbspath(filePath); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setSize((int) item.getSize()); - res = this.insertByTable(tableName, commonFile); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } - - /** - * 使用minio 上传文件 (报表上传定制功能,其他模板最好不要使用) - * - * @param masterId - * @param nameSpace - * @param item - * @return - */ - @Transactional - public int updateFile_creat(String masterId, String nameSpace, String tableName, MultipartFile item, String uuid) { - String fileName = ""; //文件名称 - String filePath = ""; //文件存储名称,相同名称在minio中会被覆盖掉 - int res = 0; - try { - fileName = item.getOriginalFilename(); -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); -// filePath = dateFormat.format(new Date()) + fileName; - - fileName = fileName.replace(".xls", ""); - fileName = fileName.replace(".xlsx", ""); - - filePath = fileName + uuid + ".xls"; - - InputStream in = item.getInputStream(); - String contentType = item.getContentType(); - minioTemplate.makeBucket(nameSpace); - minioTemplate.putObject(nameSpace, filePath, in, null, null, null, contentType); -// String url = minioTemplate.getObjectURL(nameSpace, fileName); - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - // 20210105 YYJ 用于文件表绑定资料节点用字段 tb_doc_file内和masterId一样 -// commonFile.setPid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(contentType); - //minio用相对路径 -// commonFile.setFilepath(filePath); - commonFile.setAbspath(filePath); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setSize((int) item.getSize()); - res = this.insertByTable(tableName, commonFile); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } - - /** - * 使用minio 上传文件 - * - * @param masterId - * @param nameSpace - * @param item - * @return - */ - @Transactional - public int updateFileForFileIn(String masterId, String nameSpace, String tableName, FileIn item) { - String fileName = ""; //文件名称 - String filePath = ""; //文件存储名称,相同名称在minio中会被覆盖掉 - int res = 0; - try { - fileName = item.getOriginalFilename(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); - filePath = dateFormat.format(new Date()) + fileName; - InputStream in = item.getInputStream(); - String contentType = item.getContentType(); - minioTemplate.makeBucket(nameSpace); - minioTemplate.putObject(nameSpace, filePath, in, null, null, null, contentType); -// String url = minioTemplate.getObjectURL(nameSpace, fileName); - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - // 20210105 YYJ 用于文件表绑定资料节点用字段 tb_doc_file内和masterId一样 -// commonFile.setPid(masterId); - commonFile.setFilename(fileName); - commonFile.setType(contentType); - //minio用相对路径 -// commonFile.setFilepath(filePath); - commonFile.setAbspath(filePath); - commonFile.setInsdt(CommUtil.nowDate()); - commonFile.setSize((int) item.getSize()); - res = this.insertByTable(tableName, commonFile); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } -} diff --git a/src/com/sipai/service/base/LoginService.java b/src/com/sipai/service/base/LoginService.java deleted file mode 100644 index bcedbce0..00000000 --- a/src/com/sipai/service/base/LoginService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.service.base; - -import com.sipai.entity.user.User; - -public interface LoginService { - User Login(String usrName, String psw); - - User NameLogin(String name); - - User CardLogin(String j_cardid); - -} diff --git a/src/com/sipai/service/base/LoginServiceImpl.java b/src/com/sipai/service/base/LoginServiceImpl.java deleted file mode 100644 index 77669766..00000000 --- a/src/com/sipai/service/base/LoginServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.service.base; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.user.UserDao; -import com.sipai.entity.user.User; -import com.sipai.tools.CommUtil; - - -@Service -@Transactional("transactionManager") -public class LoginServiceImpl implements LoginService { - @Resource - UserDao userDao; - - public String getPassword(String usrName) { - if (usrName != null && !usrName.isEmpty()) { - User user1 = new User(); - user1.setWhere(" where name = '"+usrName+"' "); - User user = userDao.selectByWhere(user1); - if (null != user) { - return user.getPassword(); - } - } - return null; - } - - public User Login(String usrName, String psw) { - if (usrName != null && !usrName.isEmpty() && psw != null - && !psw.isEmpty()) { - User user1 = new User(); - user1.setWhere(" where name = '"+usrName+"' "); - User user = userDao.selectByWhere(user1); - if (null != user) { - psw=CommUtil.generatePassword(psw); - if (psw.equals(user.getPassword())) { - return user; - } - } - } - return null; - } - - public User CardLogin(String cardid) { - if (cardid != null && !cardid.isEmpty()) { - User user1 = new User(); - user1.setWhere(" where cardid = '"+cardid+"' "); - User user = userDao.selectByWhere(user1); - if (null != user) { - return user; - } - } - return null; - } - - @Override - public User NameLogin(String name) { - if (name != null && !name.isEmpty()) { - User user1 = new User(); - user1.setWhere(" where name = '"+name+"' "); - User user = userDao.selectByWhere(user1); - if (null != user) { - return user; - } - } - return null; - } - -} diff --git a/src/com/sipai/service/base/MainConfigService.java b/src/com/sipai/service/base/MainConfigService.java deleted file mode 100644 index fedb4f37..00000000 --- a/src/com/sipai/service/base/MainConfigService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.service.base; - -import com.sipai.entity.base.MainConfig; - -import java.util.List; - -public interface MainConfigService { - public abstract MainConfig selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(MainConfig entity); - - public abstract int update(MainConfig patrolArea); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/base/MainPageService.java b/src/com/sipai/service/base/MainPageService.java deleted file mode 100644 index abe37bef..00000000 --- a/src/com/sipai/service/base/MainPageService.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.service.base; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.base.MainPageDao; -import com.sipai.entity.base.MainPage; -import com.sipai.entity.base.MainPageType; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; - -@Service -public class MainPageService implements CommService{ - @Resource - private MainPageDao mainPageDao; - @Resource - private MPointService mPointService; - @Resource - private MainPageTypeService mainPageTypeService; - @Override - public MainPage selectById(String id) { - MainPage mainPage=mainPageDao.selectByPrimaryKey(id); - MPoint mPoint=mPointService.selectById(mainPage.getBizId(),mainPage.getMpointId()); - mainPage.setmPoint(mPoint); - return mainPage; - } - - @Override - public int deleteById(String id) { - return mainPageDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MainPage entity) { - if (entity.getBizId()==null || entity.getBizId().isEmpty()) { - return 0; - } - return mainPageDao.insert(entity); - } - - @Override - public int update(MainPage entity) { - return mainPageDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MainPage mainPage = new MainPage(); - mainPage.setWhere(wherestr); - List mainPages =mainPageDao.selectListByWhere(mainPage); - for (MainPage item : mainPages) { - MPoint mPoint=mPointService.selectById(item.getBizId(),item.getMpointId()); - item.setmPoint(mPoint); - MainPageType mainPageType= mainPageTypeService.selectById(item.getType()); - item.setMainPageType(mainPageType); - } - return mainPages; - } - - @Override - public int deleteByWhere(String wherestr) { - MainPage mainPage = new MainPage(); - mainPage.setWhere(wherestr); - return mainPageDao.deleteByWhere(mainPage); - } - - public List selectListByWhere4App(String wherestr) { - MainPage mainPage = new MainPage(); - mainPage.setWhere(wherestr); - List mPoint = new ArrayList(); - List mainPages =mainPageDao.selectListByWhere(mainPage); - //DataSourceHolder.setDataSources(DataSources.SCADA); - for (MainPage item : mainPages) { - MPoint4APP mPoint4APP=mPointService.selectByWhere4APP(item.getBizId(),item.getMpointId()); - if(mPoint4APP != null){ - mPoint.add(mPoint4APP); - } - } - //DataSourceHolder.setDataSources(DataSources.MASTER); - return mPoint; - } - - -} diff --git a/src/com/sipai/service/base/MainPageTypeService.java b/src/com/sipai/service/base/MainPageTypeService.java deleted file mode 100644 index b4e21680..00000000 --- a/src/com/sipai/service/base/MainPageTypeService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.base; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.base.MainPageTypeDao; -import com.sipai.entity.base.MainPageType; -import com.sipai.tools.CommService; - -@Service -public class MainPageTypeService implements CommService{ - @Resource - private MainPageTypeDao mainPageTypeDao; - @Override - public MainPageType selectById(String id) { - MainPageType mainPageType=mainPageTypeDao.selectByPrimaryKey(id); - return mainPageType; - } - - @Override - public int deleteById(String id) { - return mainPageTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MainPageType entity) { - if (entity.getBizId()==null || entity.getBizId().isEmpty()) { - return 0; - } - return mainPageTypeDao.insert(entity); - } - - @Override - public int update(MainPageType entity) { - return mainPageTypeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MainPageType mainPageType = new MainPageType(); - mainPageType.setWhere(wherestr); - List mainPageTypes =mainPageTypeDao.selectListByWhere(mainPageType); - return mainPageTypes; - } - - @Override - public int deleteByWhere(String wherestr) { - MainPageType mainPageType = new MainPageType(); - mainPageType.setWhere(wherestr); - return mainPageTypeDao.deleteByWhere(mainPageType); - } - - public List selectListByWhere4App(String wherestr) { - MainPageType mainPageType = new MainPageType(); - mainPageType.setWhere(wherestr); - List mainPageTypes =mainPageTypeDao.selectListByWhere(mainPageType); - return mainPageTypes; - } - - - -} diff --git a/src/com/sipai/service/base/MainPageTypeUserService.java b/src/com/sipai/service/base/MainPageTypeUserService.java deleted file mode 100644 index 3cba48a1..00000000 --- a/src/com/sipai/service/base/MainPageTypeUserService.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.service.base; -import com.sipai.dao.base.MainPageTypeUserDao; -import com.sipai.entity.base.MainPageType; -import com.sipai.entity.base.MainPageTypeUser; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class MainPageTypeUserService implements CommService{ - @Resource - private MainPageTypeUserDao mainPageTypeUserDao; - @Resource - private MainPageTypeService mainPageTypeService; - @Override - public MainPageTypeUser selectById(String id) { - MainPageTypeUser mainPageTypeUser=mainPageTypeUserDao.selectByPrimaryKey(id); - return mainPageTypeUser; - } - - @Override - public int deleteById(String id) { - return mainPageTypeUserDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MainPageTypeUser entity) { - return mainPageTypeUserDao.insert(entity); - } - - @Override - public int update(MainPageTypeUser entity) { - return mainPageTypeUserDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MainPageTypeUser mainPageTypeUser = new MainPageTypeUser(); - mainPageTypeUser.setWhere(wherestr); - List mainPageTypeUsers =mainPageTypeUserDao.selectListByWhere(mainPageTypeUser); - for (MainPageTypeUser item : mainPageTypeUsers) { - MainPageType mainPageType = this.mainPageTypeService.selectById(item.getType()); - item.setMainPageType(mainPageType); - } - return mainPageTypeUsers; - } - - @Override - public int deleteByWhere(String wherestr) { - MainPageTypeUser mainPageTypeUser = new MainPageTypeUser(); - mainPageTypeUser.setWhere(wherestr); - return mainPageTypeUserDao.deleteByWhere(mainPageTypeUser); - } - - public List selectListByWhere4App(String wherestr) { - MainPageTypeUser mainPageTypeUser = new MainPageTypeUser(); - mainPageTypeUser.setWhere(wherestr); - List mainPageTypeUsers =mainPageTypeUserDao.selectListByWhere(mainPageTypeUser); - return mainPageTypeUsers; - } - @Transactional - public int saveAndUpdate(String userId,String mainPageTypeIds) { - if (mainPageTypeIds==null || mainPageTypeIds.isEmpty()) { - return 0; - } - try { - this.deleteByWhere("where insuser ='"+userId+"'"); - String[] mainPageTypeId_Array= mainPageTypeIds.split(","); - for (int i=0 ;i getAllBuckets() throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, InvalidResponseException, IOException, XmlPullParserException { - return minioClient.listBuckets(); - } - - /** - * 根据bucketName删除信息 - * @param bucketName bucket名称 - */ - public void removeBucket(String bucketName) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, InvalidResponseException, IOException, XmlPullParserException { - minioClient.removeBucket(bucketName); - } - - /** - * 获取文件外链 - * - * @param bucketName bucket名称 - * @param objectName 文件名称 - * @param expires 过期时间 <=7 - * @return url - */ - public String getObjectURL(String bucketName, String objectName, Integer expires) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, InvalidExpiresRangeException, InvalidResponseException, IOException, XmlPullParserException { - return minioClient.presignedGetObject(bucketName, objectName, expires); - } - - /** - * 获取文件外链 - * - * @param bucketName bucket名称 - * @param objectName 文件名称 - * @return url - */ - public String getObjectURL(String bucketName, String objectName) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, InvalidExpiresRangeException, InvalidResponseException, IOException, XmlPullParserException { - return minioClient.presignedGetObject(bucketName, objectName); - } - - /** - * 获取文件 - * - * @param bucketName bucket名称 - * @param objectName 文件名称 - * @return 二进制流 - */ - public InputStream getObject(String bucketName, String objectName) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, InvalidArgumentException, InvalidResponseException, IOException, XmlPullParserException { - return minioClient.getObject(bucketName, objectName); - } - - /** - * 上传文件 - * - * @param bucketName bucket名称 - * @param objectName 文件名称 - * @param stream 文件流 - * @param size 大小 - * @param contextType 类型 - */ - public void putObject(String bucketName, String objectName, InputStream stream, Long size, - Map headerMap, ServerSideEncryption sse, String contentType) throws Exception { - minioClient.putObject(bucketName,objectName,stream,size, headerMap, sse, contentType); - } - - /** - * 获取文件信息 - * - * @param bucketName bucket名称 - * @param objectName 文件名称 - */ - public ObjectStat statObject(String bucketName, String objectName) throws Exception { - return minioClient.statObject(bucketName, objectName); - } - - /** - * 删除文件 - * - * @param bucketName bucket名称 - * @param objectName 文件名称 - */ - public void removeObject(String bucketName, String objectName) throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InternalException, NoResponseException, InvalidBucketNameException, XmlPullParserException, ErrorResponseException, InvalidArgumentException, InvalidResponseException { - minioClient.removeObject(bucketName, objectName); - } - -} diff --git a/src/com/sipai/service/base/impl/MainConfigServiceImpl.java b/src/com/sipai/service/base/impl/MainConfigServiceImpl.java deleted file mode 100644 index 48ca7ba5..00000000 --- a/src/com/sipai/service/base/impl/MainConfigServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.base.impl; - -import com.sipai.dao.base.MainConfigDao; -import com.sipai.entity.base.MainConfig; -import com.sipai.service.base.MainConfigService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class MainConfigServiceImpl implements MainConfigService { - @Resource - private MainConfigDao mainConfigDao; - - @Override - public MainConfig selectById(String id) { - return mainConfigDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return mainConfigDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MainConfig entity) { - return mainConfigDao.insert(entity); - } - - @Override - public int update(MainConfig entity) { - return mainConfigDao.updateByWhere(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MainConfig entity = new MainConfig(); - entity.setWhere(wherestr); - List list = mainConfigDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - MainConfig entity = new MainConfig(); - entity.setWhere(wherestr); - return mainConfigDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/bim/BIMAlarmThresholdService.java b/src/com/sipai/service/bim/BIMAlarmThresholdService.java deleted file mode 100644 index 3b66d971..00000000 --- a/src/com/sipai/service/bim/BIMAlarmThresholdService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.bim; - -import com.sipai.entity.bim.BIMAlarmThreshold; -import java.util.List; - -public interface BIMAlarmThresholdService { - - public abstract BIMAlarmThreshold selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(BIMAlarmThreshold entity); - - public abstract int update(BIMAlarmThreshold entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/bim/BIMCDHomePageTreeService.java b/src/com/sipai/service/bim/BIMCDHomePageTreeService.java deleted file mode 100644 index eb810448..00000000 --- a/src/com/sipai/service/bim/BIMCDHomePageTreeService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.bim; - -import com.sipai.entity.bim.BIMCDHomePageTree; -import java.util.List; -import java.util.Map; - -public interface BIMCDHomePageTreeService { - - public abstract BIMCDHomePageTree selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(BIMCDHomePageTree entity); - - public abstract int update(BIMCDHomePageTree entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract BIMCDHomePageTree selectByWhere(String wherestr); - - public String getTreeidsBySearch(String name,String type); - - public String getTreeList(List> list_result, List list); - -} diff --git a/src/com/sipai/service/bim/BIMCameraService.java b/src/com/sipai/service/bim/BIMCameraService.java deleted file mode 100644 index 00d58153..00000000 --- a/src/com/sipai/service/bim/BIMCameraService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.bim; - -import com.sipai.entity.bim.BIMCamera; -import java.util.List; - -public interface BIMCameraService { - - public abstract BIMCamera selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(BIMCamera entity); - - public abstract int update(BIMCamera entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/bim/BIMCurrencyService.java b/src/com/sipai/service/bim/BIMCurrencyService.java deleted file mode 100644 index c43784f6..00000000 --- a/src/com/sipai/service/bim/BIMCurrencyService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.bim; - -import java.util.List; - -import com.sipai.entity.bim.BIMCurrency; - -public interface BIMCurrencyService { - - public abstract BIMCurrency selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(BIMCurrency entity); - - public abstract int update(BIMCurrency entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract BIMCurrency selectByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/bim/BimRouteDataService.java b/src/com/sipai/service/bim/BimRouteDataService.java deleted file mode 100644 index b421e9db..00000000 --- a/src/com/sipai/service/bim/BimRouteDataService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.bim; - -import java.util.List; - -import com.sipai.entity.bim.BimRouteData; - -public interface BimRouteDataService { - - public abstract BimRouteData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(BimRouteData entity); - - public abstract int update(BimRouteData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/bim/BimRouteEqDataService.java b/src/com/sipai/service/bim/BimRouteEqDataService.java deleted file mode 100644 index 7b1c7087..00000000 --- a/src/com/sipai/service/bim/BimRouteEqDataService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.bim; - -import java.util.List; - -import com.sipai.entity.bim.BimRouteEqData; - -public interface BimRouteEqDataService { - - public abstract BimRouteEqData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(BimRouteEqData entity); - - public abstract int update(BimRouteEqData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/bim/RobotService.java b/src/com/sipai/service/bim/RobotService.java deleted file mode 100644 index 38787843..00000000 --- a/src/com/sipai/service/bim/RobotService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.service.bim; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -public interface RobotService { - - /** - * 获取第一批机器人数据 - * - * @return - */ - public abstract void getRobotData(); - - /** - * 获取第二批机器人数据 - * - * @return - */ - public abstract void getRobotData2(String isFilter); - - /** - * 获取第三批机器人数据 - * - * @return - */ - public abstract void getRobotData3(String isFilter); - - /** - * 三维http获取最新数据 - * - * @return - */ - public abstract JSONObject getRobot4Http(); - - /** - * 从redis获取值推送给三维 - * - * @return - */ - public abstract JSONObject sendRobotBIM(); - -} diff --git a/src/com/sipai/service/bim/YsAlarmRecordService.java b/src/com/sipai/service/bim/YsAlarmRecordService.java deleted file mode 100644 index 74eaa926..00000000 --- a/src/com/sipai/service/bim/YsAlarmRecordService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.service.bim; - -import com.sipai.entity.bim.YsAlarmRecord; - -import java.util.List; - -public interface YsAlarmRecordService { - public abstract YsAlarmRecord selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(YsAlarmRecord entity); - - public abstract int update(YsAlarmRecord entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/bim/impl/BIMAlarmThresholdServiceImpl.java b/src/com/sipai/service/bim/impl/BIMAlarmThresholdServiceImpl.java deleted file mode 100644 index d6ba123c..00000000 --- a/src/com/sipai/service/bim/impl/BIMAlarmThresholdServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.bim.impl; - -import com.sipai.dao.bim.BIMAlarmThresholdDao; -import com.sipai.entity.bim.BIMAlarmThreshold; -import com.sipai.service.bim.BIMAlarmThresholdService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class BIMAlarmThresholdServiceImpl implements BIMAlarmThresholdService { - @Resource - private BIMAlarmThresholdDao bimAlarmThresholdDao; - - @Override - public BIMAlarmThreshold selectById(String id) { - return bimAlarmThresholdDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return bimAlarmThresholdDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BIMAlarmThreshold entity) { - return bimAlarmThresholdDao.insert(entity); - } - - @Override - public int update(BIMAlarmThreshold entity) { - return bimAlarmThresholdDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BIMAlarmThreshold entity = new BIMAlarmThreshold(); - entity.setWhere(wherestr); - List list = bimAlarmThresholdDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BIMAlarmThreshold entity = new BIMAlarmThreshold(); - entity.setWhere(wherestr); - return bimAlarmThresholdDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/bim/impl/BIMCDHomePageTreeServiceImpl.java b/src/com/sipai/service/bim/impl/BIMCDHomePageTreeServiceImpl.java deleted file mode 100644 index 528b3f89..00000000 --- a/src/com/sipai/service/bim/impl/BIMCDHomePageTreeServiceImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.service.bim.impl; - -import com.sipai.dao.bim.BIMCDHomePageTreeDao; -import com.sipai.entity.bim.BIMCDHomePageTree; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.user.Unit; -import com.sipai.service.bim.BIMCDHomePageTreeService; -import com.sipai.tools.CommString; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class BIMCDHomePageTreeServiceImpl implements BIMCDHomePageTreeService { - @Resource - private BIMCDHomePageTreeDao bimcdHomePageTreeDao; - - @Override - public BIMCDHomePageTree selectById(String id) { - return bimcdHomePageTreeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return bimcdHomePageTreeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BIMCDHomePageTree entity) { - return bimcdHomePageTreeDao.insert(entity); - } - - @Override - public int update(BIMCDHomePageTree entity) { - return bimcdHomePageTreeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BIMCDHomePageTree entity = new BIMCDHomePageTree(); - entity.setWhere(wherestr); - List list = bimcdHomePageTreeDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BIMCDHomePageTree entity = new BIMCDHomePageTree(); - entity.setWhere(wherestr); - return bimcdHomePageTreeDao.deleteByWhere(entity); - } - - @Override - public BIMCDHomePageTree selectByWhere(String wherestr) { - BIMCDHomePageTree entity = new BIMCDHomePageTree(); - entity.setWhere(wherestr); - return bimcdHomePageTreeDao.selectByWhere(entity); - } - @Override - public String getTreeidsBySearch(String name,String type){ - List list = selectListByWhere("where 1=1 and type='"+type+"' and name like '%"+name+"%' "); - String ids=""; - if(list!=null&&list.size()>0){ - for (int i = 0; i < list.size(); i++) { - if(list.get(i).getPid().equals("-1")){ - ids+=list.get(i).getId()+","; - List dlist = selectListByWhere("where 1=1 and pid='"+list.get(i).getId()+"' "); - if(dlist!=null&&dlist.size()>0){ - for (int j = 0; j < dlist.size(); j++) { - ids+=dlist.get(j).getId()+","; - } - } - }else{ - ids+=list.get(i).getPid()+","; - ids+=list.get(i).getId()+","; - } - } - } - return ids; - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - @Override - public String getTreeList(List> list_result,List list) { - if(list_result == null ) { - list_result = new ArrayList>(); - for(BIMCDHomePageTree k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - //map.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(BIMCDHomePageTree k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - //m.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - - - childlist.add(m); - - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/bim/impl/BIMCameraServiceImpl.java b/src/com/sipai/service/bim/impl/BIMCameraServiceImpl.java deleted file mode 100644 index 24062b74..00000000 --- a/src/com/sipai/service/bim/impl/BIMCameraServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.bim.impl; - -import com.sipai.dao.bim.BIMCameraDao; -import com.sipai.entity.bim.BIMCamera; -import com.sipai.service.bim.BIMCameraService; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class BIMCameraServiceImpl implements BIMCameraService { - @Resource - private BIMCameraDao bimCameraDao; - - @Override - public BIMCamera selectById(String id) { - return bimCameraDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return bimCameraDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BIMCamera entity) { - return bimCameraDao.insert(entity); - } - - @Override - public int update(BIMCamera entity) { - return bimCameraDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BIMCamera bimCamera = new BIMCamera(); - bimCamera.setWhere(wherestr); - List list = bimCameraDao.selectListByWhere(bimCamera); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BIMCamera bimCamera = new BIMCamera(); - bimCamera.setWhere(wherestr); - return bimCameraDao.deleteByWhere(bimCamera); - } -} diff --git a/src/com/sipai/service/bim/impl/BIMCurrencyServiceImpl.java b/src/com/sipai/service/bim/impl/BIMCurrencyServiceImpl.java deleted file mode 100644 index dc5d7d95..00000000 --- a/src/com/sipai/service/bim/impl/BIMCurrencyServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.bim.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.bim.BIMCurrencyDao; -import com.sipai.entity.bim.BIMCurrency; -import com.sipai.service.bim.BIMCurrencyService; - -@Service -public class BIMCurrencyServiceImpl implements BIMCurrencyService { - @Resource - private BIMCurrencyDao bIMCurrencyRecordDao; - - @Override - public BIMCurrency selectById(String id) { - return this.bIMCurrencyRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.bIMCurrencyRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BIMCurrency entity) { - return this.bIMCurrencyRecordDao.insert(entity); - } - - @Override - public int update(BIMCurrency entity) { - return this.bIMCurrencyRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BIMCurrency bIMCurrency = new BIMCurrency(); - bIMCurrency.setWhere(wherestr); - List list = this.bIMCurrencyRecordDao.selectListByWhere(bIMCurrency); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BIMCurrency bIMCurrency = new BIMCurrency(); - bIMCurrency.setWhere(wherestr); - return this.bIMCurrencyRecordDao.deleteByWhere(bIMCurrency); - } - - @Override - public BIMCurrency selectByWhere(String wherestr) { - BIMCurrency bIMCurrency = new BIMCurrency(); - bIMCurrency.setWhere(wherestr); - return this.bIMCurrencyRecordDao.selectByWhere(bIMCurrency); - } -} diff --git a/src/com/sipai/service/bim/impl/BimRouteDataServiceImpl.java b/src/com/sipai/service/bim/impl/BimRouteDataServiceImpl.java deleted file mode 100644 index 995681b9..00000000 --- a/src/com/sipai/service/bim/impl/BimRouteDataServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.bim.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.bim.BimRouteDataDao; -import com.sipai.entity.bim.BimRouteData; -import com.sipai.service.bim.BimRouteDataService; - -@Service("bimRouteDataService") -public class BimRouteDataServiceImpl implements BimRouteDataService { - @Resource - private BimRouteDataDao bimRouteDataDao; - - @Override - public BimRouteData selectById(String id) { - return this.bimRouteDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.bimRouteDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BimRouteData entity) { - return this.bimRouteDataDao.insert(entity); - } - - @Override - public int update(BimRouteData entity) { - return this.bimRouteDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BimRouteData bIMCurrency = new BimRouteData(); - bIMCurrency.setWhere(wherestr); - List list = this.bimRouteDataDao.selectListByWhere(bIMCurrency); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BimRouteData bIMCurrency = new BimRouteData(); - bIMCurrency.setWhere(wherestr); - return this.bimRouteDataDao.deleteByWhere(bIMCurrency); - } -} diff --git a/src/com/sipai/service/bim/impl/BimRouteEqDataServiceImpl.java b/src/com/sipai/service/bim/impl/BimRouteEqDataServiceImpl.java deleted file mode 100644 index b20f9561..00000000 --- a/src/com/sipai/service/bim/impl/BimRouteEqDataServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.bim.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.service.scada.ProAlarmService; -import org.springframework.stereotype.Service; - -import com.sipai.dao.bim.BimRouteEqDataDao; -import com.sipai.entity.bim.BimRouteEqData; -import com.sipai.service.bim.BimRouteEqDataService; - -@Service("bimRouteEqDataService") -public class BimRouteEqDataServiceImpl implements BimRouteEqDataService { - @Resource - private BimRouteEqDataDao bimRouteEqDataDao; - - @Override - public BimRouteEqData selectById(String id) { - return this.bimRouteEqDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.bimRouteEqDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BimRouteEqData entity) { - return this.bimRouteEqDataDao.insert(entity); - } - - @Override - public int update(BimRouteEqData entity) { - return this.bimRouteEqDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BimRouteEqData bIMCurrency = new BimRouteEqData(); - bIMCurrency.setWhere(wherestr); - List list = this.bimRouteEqDataDao.selectListByWhere(bIMCurrency); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - BimRouteEqData bIMCurrency = new BimRouteEqData(); - bIMCurrency.setWhere(wherestr); - return this.bimRouteEqDataDao.deleteByWhere(bIMCurrency); - } -} diff --git a/src/com/sipai/service/bim/impl/RobotServiceImpl.java b/src/com/sipai/service/bim/impl/RobotServiceImpl.java deleted file mode 100644 index f825e10d..00000000 --- a/src/com/sipai/service/bim/impl/RobotServiceImpl.java +++ /dev/null @@ -1,414 +0,0 @@ -package com.sipai.service.bim.impl; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.service.bim.RobotService; -import com.sipai.tools.CommString; -import com.sipai.tools.ModbusRAndW; -import com.sipai.websocket.MsgWebSocket2; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.text.DecimalFormat; -import java.util.Map; - -@Service -public class RobotServiceImpl implements RobotService { - @Resource - private RedissonClient redissonClient; - - @Async - @Override - public void getRobotData() { - JSONArray jsonArray = new JSONArray(); - try { - // 格式化modbus查出来之后值的对象 - DecimalFormat df = new DecimalFormat("0.0000"); - /** - * 模拟量 - */ - int[] add_val = new int[6]; - add_val[0] = Integer.valueOf("1501") - 1; - add_val[1] = Integer.valueOf("1502") - 1; - add_val[2] = Integer.valueOf("1503") - 1; - add_val[3] = Integer.valueOf("1504") - 1; - add_val[4] = Integer.valueOf("1505") - 1; - add_val[5] = Integer.valueOf("1506") - 1; - - /** - * 开关量 - */ - int[] add_bl = new int[6]; - add_bl[0] = Integer.valueOf("0225") - 1; - add_bl[1] = Integer.valueOf("0226") - 1; - add_bl[2] = Integer.valueOf("0227") - 1; - add_bl[3] = Integer.valueOf("0228") - 1; - add_bl[4] = Integer.valueOf("0229") - 1; - add_bl[5] = Integer.valueOf("0230") - 1; - - for (int i = 0; i < 6; i++) { - Number number1 = ModbusRAndW.readHoldingRegister(1, add_val[i], 2); - float v1 = Float.parseFloat(df.format(number1)); - v1 = v1 / 100; -// Boolean num_bl_1 = ModbusRAndW.readCoilStatus(1, add_bl[i]); - Boolean num_bl_1 = ModbusRAndW.readInputStatus(1, add_bl[i]); - if (num_bl_1) { - v1 = v1 * (-1); - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", "J" + (i + 1)); - jsonObject.put("paramValue", v1); - jsonArray.add(jsonObject); - } - JSONObject json = new JSONObject(); - json.put("dataType", CommString.WebsocketBIMTypeRobot); - json.put("data", jsonArray); - if (jsonArray != null && jsonArray.size() > 0) { - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(json.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } -// return jsonArray; - } - - @Async - @Override - public void getRobotData2(String isFilter) { - JSONArray jsonArray = new JSONArray(); - try { - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMRobot); - RMap map_list2 = redissonClient.getMap(CommString.REDISWebsocketBIMRobotBoon); - /** - * X 用 readInputStatus - */ - int[] add_val = new int[7]; - add_val[0] = Integer.valueOf("0001") - 1; - add_val[1] = Integer.valueOf("0002") - 1; - add_val[2] = Integer.valueOf("0003") - 1; - add_val[3] = Integer.valueOf("0004") - 1; - add_val[4] = Integer.valueOf("0005") - 1; - add_val[5] = Integer.valueOf("0009") - 1; - add_val[6] = Integer.valueOf("0017") - 1; - - String[] add_val_id = new String[7]; - add_val_id[0] = "X0"; - add_val_id[1] = "X1"; - add_val_id[2] = "X2"; - add_val_id[3] = "X3"; - add_val_id[4] = "X4"; - add_val_id[5] = "X10"; - add_val_id[6] = "X20"; - - /** - * Y - */ - int[] add_bl = new int[21]; - add_bl[0] = Integer.valueOf("0001") - 1; - add_bl[1] = Integer.valueOf("0002") - 1; - add_bl[2] = Integer.valueOf("0003") - 1; - add_bl[3] = Integer.valueOf("0004") - 1; - add_bl[4] = Integer.valueOf("0005") - 1; - add_bl[5] = Integer.valueOf("0006") - 1; - add_bl[6] = Integer.valueOf("0009") - 1; - add_bl[7] = Integer.valueOf("0010") - 1; - add_bl[8] = Integer.valueOf("0011") - 1; - add_bl[9] = Integer.valueOf("0012") - 1; - add_bl[10] = Integer.valueOf("0017") - 1; - add_bl[11] = Integer.valueOf("0018") - 1; - add_bl[12] = Integer.valueOf("0019") - 1; - add_bl[13] = Integer.valueOf("0020") - 1; - add_bl[14] = Integer.valueOf("0025") - 1; - add_bl[15] = Integer.valueOf("0026") - 1; - add_bl[16] = Integer.valueOf("0027") - 1; - add_bl[17] = Integer.valueOf("0029") - 1; - add_bl[18] = Integer.valueOf("0030") - 1; - add_bl[19] = Integer.valueOf("0031") - 1; - add_bl[20] = Integer.valueOf("0032") - 1; - - String[] add_bl_id = new String[21]; - add_bl_id[0] = "Y0"; - add_bl_id[1] = "Y1"; - add_bl_id[2] = "Y2"; - add_bl_id[3] = "Y3"; - add_bl_id[4] = "Y4"; - add_bl_id[5] = "Y5"; - add_bl_id[6] = "Y10"; - add_bl_id[7] = "Y11"; - add_bl_id[8] = "Y12"; - add_bl_id[9] = "Y13"; - add_bl_id[10] = "Y20"; - add_bl_id[11] = "Y21"; - add_bl_id[12] = "Y22"; - add_bl_id[13] = "Y23"; - add_bl_id[14] = "Y30"; - add_bl_id[15] = "Y31"; - add_bl_id[16] = "Y32"; - add_bl_id[17] = "Y34"; - add_bl_id[18] = "Y35"; - add_bl_id[19] = "Y36"; - add_bl_id[20] = "Y37"; - - for (int i = 0; i < 7; i++) { - Boolean val = ModbusRAndW.readInputStatus(1, add_val[i]); - //1.默认给个0 - map_list2.put(add_val_id[i], "0"); - //最新值和上次值不相等 - if (map_list.get(add_val_id[i]) != null && !map_list.get(add_val_id[i]).equals(val.toString())) { - //2.发生变化的时候给个1 说明变化了 - map_list2.put(add_val_id[i], "1"); - } - //更新redis - map_list.put(add_val_id[i], val.toString()); - } - - for (int i = 0; i < 21; i++) { - Boolean val = ModbusRAndW.readCoilStatus(1, add_bl[i]); - //1.默认给个0 - map_list2.put(add_bl_id[i], "0"); - //最新值和上次值不相等 - if (map_list.get(add_bl_id[i]) != null && !map_list.get(add_bl_id[i]).equals(val.toString())) { - //2.发生变化的时候给个1 说明变化了 - map_list2.put(add_bl_id[i], "1"); - } - //更新redis - map_list.put(add_bl_id[i], val.toString()); - } - - /*JSONObject json = new JSONObject(); - json.put("dataType", CommString.WebsocketBIMTypeRobotChange); - json.put("data", jsonArray); - if (jsonArray != null && jsonArray.size() > 0) { - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(json.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - }*/ - } catch (Exception e) { - e.printStackTrace(); - } -// return jsonArray; - } - - @Async - @Override - public void getRobotData3(String isFilter) { - JSONArray jsonArray = new JSONArray(); - try { - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMRobot); - RMap map_list2 = redissonClient.getMap(CommString.REDISWebsocketBIMRobotBoon); - /** - * X 用 readInputStatus - */ - int[] add_val = new int[7]; - add_val[0] = Integer.valueOf("0001") - 1; - add_val[1] = Integer.valueOf("0002") - 1; - add_val[2] = Integer.valueOf("0003") - 1; - add_val[3] = Integer.valueOf("0004") - 1; - add_val[4] = Integer.valueOf("0005") - 1; - add_val[5] = Integer.valueOf("0009") - 1; - add_val[6] = Integer.valueOf("0017") - 1; - - String[] add_val_id = new String[7]; - add_val_id[0] = "X0"; - add_val_id[1] = "X1"; - add_val_id[2] = "X2"; - add_val_id[3] = "X3"; - add_val_id[4] = "X4"; - add_val_id[5] = "X10"; - add_val_id[6] = "X20"; - - /** - * Y - */ - int[] add_bl = new int[21]; - add_bl[0] = Integer.valueOf("0001") - 1; - add_bl[1] = Integer.valueOf("0002") - 1; - add_bl[2] = Integer.valueOf("0003") - 1; - add_bl[3] = Integer.valueOf("0004") - 1; - add_bl[4] = Integer.valueOf("0005") - 1; - add_bl[5] = Integer.valueOf("0006") - 1; - add_bl[6] = Integer.valueOf("0009") - 1; - add_bl[7] = Integer.valueOf("0010") - 1; - add_bl[8] = Integer.valueOf("0011") - 1; - add_bl[9] = Integer.valueOf("0012") - 1; - add_bl[10] = Integer.valueOf("0017") - 1; - add_bl[11] = Integer.valueOf("0018") - 1; - add_bl[12] = Integer.valueOf("0019") - 1; - add_bl[13] = Integer.valueOf("0020") - 1; - add_bl[14] = Integer.valueOf("0025") - 1; - add_bl[15] = Integer.valueOf("0026") - 1; - add_bl[16] = Integer.valueOf("0027") - 1; - add_bl[17] = Integer.valueOf("0029") - 1; - add_bl[18] = Integer.valueOf("0030") - 1; - add_bl[19] = Integer.valueOf("0031") - 1; - add_bl[20] = Integer.valueOf("0032") - 1; - - String[] add_bl_id = new String[21]; - add_bl_id[0] = "Y0"; - add_bl_id[1] = "Y1"; - add_bl_id[2] = "Y2"; - add_bl_id[3] = "Y3"; - add_bl_id[4] = "Y4"; - add_bl_id[5] = "Y5"; - add_bl_id[6] = "Y10"; - add_bl_id[7] = "Y11"; - add_bl_id[8] = "Y12"; - add_bl_id[9] = "Y13"; - add_bl_id[10] = "Y20"; - add_bl_id[11] = "Y21"; - add_bl_id[12] = "Y22"; - add_bl_id[13] = "Y23"; - add_bl_id[14] = "Y30"; - add_bl_id[15] = "Y31"; - add_bl_id[16] = "Y32"; - add_bl_id[17] = "Y34"; - add_bl_id[18] = "Y35"; - add_bl_id[19] = "Y36"; - add_bl_id[20] = "Y37"; - - for (int i = 0; i < 7; i++) { - Boolean val = ModbusRAndW.readInputStatus(1, add_val[i]); - //1.默认给个0 - map_list2.put(add_val_id[i], "0"); - //最新值和上次值不相等 - if (map_list.get(add_val_id[i]) != null && !map_list.get(add_val_id[i]).equals(val.toString())) { - //2.发生变化的时候给个1 说明变化了 - map_list2.put(add_val_id[i], "1"); - } - //更新redis - map_list.put(add_val_id[i], val.toString()); - } - - for (int i = 0; i < 21; i++) { - Boolean val = ModbusRAndW.readCoilStatus(1, add_bl[i]); - //1.默认给个0 - map_list2.put(add_bl_id[i], "0"); - //最新值和上次值不相等 - if (map_list.get(add_bl_id[i]) != null && !map_list.get(add_bl_id[i]).equals(val.toString())) { - //2.发生变化的时候给个1 说明变化了 - map_list2.put(add_bl_id[i], "1"); - } - //更新redis - map_list.put(add_bl_id[i], val.toString()); - } - - /*JSONObject json = new JSONObject(); - json.put("dataType", CommString.WebsocketBIMTypeRobotChange); - json.put("data", jsonArray); - if (jsonArray != null && jsonArray.size() > 0) { - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(json.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - }*/ - } catch (Exception e) { - e.printStackTrace(); - } -// return jsonArray; - } - - // @Async - @Override - public JSONObject getRobot4Http() { - JSONObject json = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMRobot); - for (String key : map_list.keySet()) { - String val = map_list.get(key); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", key); - - String[] str = val.split(";"); - jsonObject.put("paramValue", str[0]); - jsonArray.add(jsonObject); - } - try { - json.put("dataType", CommString.WebsocketBIMTypeRobotChange); - json.put("data", jsonArray); - } catch (Exception e) { - e.printStackTrace(); - } - return json; - } - - @Async - @Override - public JSONObject sendRobotBIM() { - JSONObject json = new JSONObject(); - JSONArray jsonArray = new JSONArray(); - //存实际值的 - RMap map_list = redissonClient.getMap(CommString.REDISWebsocketBIMRobot); - //存是否发生变化的 - RMap map_list2 = redissonClient.getMap(CommString.REDISWebsocketBIMRobotBoon); - for (String key : map_list.keySet()) { - String val = map_list.get(key); - -// System.out.println(map_list.get(key) + " ====== " + val + " ====== " + map_list.get(key).equals(val.toString())); - //变化才推送 - if (map_list2.get(key) != null && map_list2.get(key).equals("1")) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", key); - jsonObject.put("paramValue", val); - jsonArray.add(jsonObject); - - //恢复成0 - map_list2.put(key, "0"); - } - - } - try { - json.put("dataType", CommString.WebsocketBIMTypeRobotChange); - json.put("data", jsonArray); - if (jsonArray != null && jsonArray.size() > 0) { - for (Map item : MsgWebSocket2.webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(json.toString()); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return json; - } -} diff --git a/src/com/sipai/service/bim/impl/YsAlarmRecordServiceImpl.java b/src/com/sipai/service/bim/impl/YsAlarmRecordServiceImpl.java deleted file mode 100644 index cd845a79..00000000 --- a/src/com/sipai/service/bim/impl/YsAlarmRecordServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.bim.impl; - -import com.sipai.dao.bim.YsAlarmRecordDao; -import com.sipai.entity.bim.BimRouteData; -import com.sipai.entity.bim.YsAlarmRecord; -import com.sipai.service.bim.YsAlarmRecordService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class YsAlarmRecordServiceImpl implements YsAlarmRecordService { - @Resource - private YsAlarmRecordDao ysAlarmRecordDao; - - @Override - public YsAlarmRecord selectById(String id) { - return ysAlarmRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return ysAlarmRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(YsAlarmRecord entity) { - return ysAlarmRecordDao.insert(entity); - } - - @Override - public int update(YsAlarmRecord entity) { - return ysAlarmRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - YsAlarmRecord entity = new YsAlarmRecord(); - entity.setWhere(wherestr); - List list = this.ysAlarmRecordDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - YsAlarmRecord entity = new YsAlarmRecord(); - entity.setWhere(wherestr); - return ysAlarmRecordDao.deleteByWhere(entity); - } -} diff --git a/src/com/sipai/service/bot/Botservice.java b/src/com/sipai/service/bot/Botservice.java deleted file mode 100644 index 84c5ca48..00000000 --- a/src/com/sipai/service/bot/Botservice.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.bot; - -import java.util.List; - -import com.sipai.entity.bot.Bot; - -public interface Botservice { - public Bot selectById(String t); - - public int deleteById(String t); - - public int save(Bot t); - - public int update(Bot t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/bot/BotserviceImpl.java b/src/com/sipai/service/bot/BotserviceImpl.java deleted file mode 100644 index 1d3fa553..00000000 --- a/src/com/sipai/service/bot/BotserviceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.bot; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.bot.BotDao; -import com.sipai.entity.bot.Bot; - -@Service("botService") -public class BotserviceImpl implements Botservice{ - @Resource - private BotDao botDao; - - @Override - public Bot selectById(String t) { - // TODO Auto-generated method stub - return botDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return botDao.deleteByPrimaryKey(t); - } - - @Override - public int save(Bot t) { - // TODO Auto-generated method stub - return botDao.insertSelective(t); - } - - @Override - public int update(Bot t) { - // TODO Auto-generated method stub - return botDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - Bot bot = new Bot(); - bot.setWhere(t); - return botDao.selectListByWhere(bot); - } - - - @Override - public int deleteByWhere(String t) { - Bot bot = new Bot(); - bot.setWhere(t); - return botDao.deleteByWhere(bot); - } - -} diff --git a/src/com/sipai/service/business/BusinessUnitAuditService.java b/src/com/sipai/service/business/BusinessUnitAuditService.java deleted file mode 100644 index 9b0a4733..00000000 --- a/src/com/sipai/service/business/BusinessUnitAuditService.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.sipai.service.business; -import com.sipai.dao.business.BusinessUnitAuditDao; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.tools.ActivitiUtil; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import org.activiti.engine.HistoryService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricActivityInstance; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class BusinessUnitAuditService implements CommService{ - @Resource - private BusinessUnitAuditDao businessUnitAuditDao; - @Resource - private TaskService taskService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private SubscribeService subscribeService; - @Resource - private HistoryService historyService; - @Override - public BusinessUnitAudit selectById(String id) { - BusinessUnitAudit businessUnitAudit =businessUnitAuditDao.selectByPrimaryKey(id); - return businessUnitAudit; - } - - @Override - public int deleteById(String id) { - return businessUnitAuditDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnitAudit businessUnitAudit) { - return businessUnitAuditDao.insert(businessUnitAudit); - } - /** - * 审核流程中单元节点执行 - * @param entity 审核单元 - * @param businessUnitAdapter 业务实体 - * @return - */ - @Transactional(rollbackFor = Exception.class) - public int doAudit(BusinessUnitAudit entity,BusinessUnitAdapter businessUnitAdapter) { - try { - Map variables = new HashMap(); - - variables =ActivitiUtil.fixVariableWithRoute(variables,entity.getPassstatus() ,String.valueOf(entity.getRouteNum())); - //ActivityImpl activityImpl =null; - if(entity.getPassstatus()){ - //通过 - //activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(businessUnitAdapter.getProcessdefid(), entity.getTaskdefinitionkey(), CommString.ACTI_Condition_PASS); - //若下级任务为userTask,必须确保有接收人 - List list=workflowProcessDefinitionService.getNextWorkTasks(businessUnitAdapter.getProcessdefid(), entity.getTaskdefinitionkey()); - //提交一下级必须有任务接收人员 - //2020.08.22 当下一级存在通过/不通过分支时,要判断是否通过状态分支 - boolean multiInstance = false; - for (WorkTask workTask : list) { - if (workTask.getRouteNum()==entity.getRouteNum() && "userTask".equals(workTask.getType()) - && (entity.getTargetusers()==null || entity.getTargetusers().isEmpty()) - && entity.getPassstatus()==workTask.isPassFlag()) { - throw new RuntimeException(); - } - if(workTask.getMultiInstance()!=null ) { // 串行任务){ - if(workTask.getMultiInstance().equals("sequential")){ - multiInstance=true; - }else{ - // 并行任务 - if(workTask.getMultiInstance().equals("parallel")){ - multiInstance=true; - } - } - } - } - - variables.put(CommString.ACTI_KEK_Assignee, null); - if(multiInstance){ - List userids = Arrays.asList(entity.getTargetusers().split(",")); - variables.put(CommString.ACTI_KEK_AssigneeList, userids); - }else{ - variables.put(CommString.ACTI_KEK_Candidate_Users, entity.getTargetusers()); - } - if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){ - taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion()); - } - }else{ - //不通过 - //activityImpl=workflowProcessDefinitionService.getNEXTActivityImpl(businessUnitAdapter.getProcessdefid(), entity.getTaskdefinitionkey(), CommString.ACTI_Condition_FAIL); - List list_wt=workflowProcessDefinitionService.getNextWorkTasks(businessUnitAdapter.getProcessdefid(), entity.getTaskdefinitionkey()); - String wortTaskId=""; - for (WorkTask workTask : list_wt) { - if (false==workTask.isPassFlag() && workTask.getRouteNum()==entity.getRouteNum()) { - wortTaskId=workTask.getId(); - break; - } - } - List list=historyService.createHistoricActivityInstanceQuery().processInstanceId(entity.getProcessid()).activityId(wortTaskId) - .orderByHistoricActivityInstanceStartTime().desc().list(); - if (list != null && list.size()>0) { - variables.put(CommString.ACTI_KEK_Assignee, list.get(0).getAssignee()); - if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){ - taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion()); - } - }else { - variables.put(CommString.ACTI_KEK_Assignee, businessUnitAdapter.getInsuser()); - if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){ - taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion()); - } - } - } - //int res=0; - taskService.complete(entity.getTaskid(), variables); - int res; - BusinessUnitAudit businessUnitAudit = businessUnitAuditDao.selectByPrimaryKey(entity.getId()); - if (businessUnitAudit!=null&&!businessUnitAdapter.equals("")){ - res = this.update(entity); - }else { - res =this.save(entity); - } - - if (res==0) { - throw new RuntimeException(); - }else{ - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - if(entity.getPassstatus()){ - //通过 - if(variables.get(CommString.ACTI_KEK_Candidate_Users)!=null){ - businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Candidate_Users).toString(),""); - }else{ - //会签 - if(variables.get(CommString.ACTI_KEK_AssigneeList)!=null){ - businessUnitRecord.sendMessage(entity.getTargetusers(),""); - } - } - }else{ - if(variables.get(CommString.ACTI_KEK_Assignee)!=null){ - businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(),""); - } - } - - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - @Override - public int update(BusinessUnitAudit businessUnitAudit) { - int result=businessUnitAuditDao.updateByPrimaryKeySelective(businessUnitAudit); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - businessUnitAudit.setWhere(wherestr); - List businessUnits =businessUnitAuditDao.selectListByWhere(businessUnitAudit); - return businessUnits; - } - - @Override - public int deleteByWhere(String wherestr) { - BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit(); - businessUnitAudit.setWhere(wherestr); - return businessUnitAuditDao.deleteByWhere(businessUnitAudit); - } - - -} diff --git a/src/com/sipai/service/business/BusinessUnitDeptApplyService.java b/src/com/sipai/service/business/BusinessUnitDeptApplyService.java deleted file mode 100644 index f9a00e1a..00000000 --- a/src/com/sipai/service/business/BusinessUnitDeptApplyService.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.service.business; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.business.BusinessUnitDao; -import com.sipai.dao.business.BusinessUnitDeptApplyDao; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.entity.business.BusinessUnitDeptApply; -import com.sipai.tools.CommService; - -@Service -public class BusinessUnitDeptApplyService implements CommService{ - @Resource - private BusinessUnitDeptApplyDao businessUnitDeptApplyDao; - - @Override - public BusinessUnitDeptApply selectById(String id) { - BusinessUnitDeptApply businessUnitDeptApply =businessUnitDeptApplyDao.selectByPrimaryKey(id); - return businessUnitDeptApply; - } - - @Override - public int deleteById(String id) { - return businessUnitDeptApplyDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnitDeptApply entity) { - int res =this.businessUnitDeptApplyDao.insert(entity); - return res; - } - @Override - public int update(BusinessUnitDeptApply businessUnitDeptApply) { - int result=businessUnitDeptApplyDao.updateByPrimaryKeySelective(businessUnitDeptApply); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnitDeptApply businessUnitDeptApply = new BusinessUnitDeptApply(); - businessUnitDeptApply.setWhere(wherestr); - List businessUnits =businessUnitDeptApplyDao.selectListByWhere(businessUnitDeptApply); - return businessUnits; - } - - @Override - public int deleteByWhere(String wherestr) { - BusinessUnitDeptApply businessUnitDeptApply = new BusinessUnitDeptApply(); - businessUnitDeptApply.setWhere(wherestr); - return businessUnitDeptApplyDao.deleteByWhere(businessUnitDeptApply); - } - /** - * 检测存在 - * 存在返回true - * */ - public boolean checkExit(BusinessUnitDeptApply businessUnitDeptApply) { - BusinessUnitDeptApply bUnitDeptApply =businessUnitDeptApplyDao.selectByPrimaryKey(businessUnitDeptApply.getId()); - if(bUnitDeptApply==null){ - return false; - }else{ - return true; - } - - } -} diff --git a/src/com/sipai/service/business/BusinessUnitHandleDetailService.java b/src/com/sipai/service/business/BusinessUnitHandleDetailService.java deleted file mode 100644 index f307a2cd..00000000 --- a/src/com/sipai/service/business/BusinessUnitHandleDetailService.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.sipai.service.business; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.business.BusinessUnitDao; -import com.sipai.dao.business.BusinessUnitHandleDao; -import com.sipai.dao.business.BusinessUnitHandleDetailDao; -import com.sipai.dao.maintenance.MaintenanceDetailDao; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.business.BusinessUnitHandleDetail; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class BusinessUnitHandleDetailService implements CommService{ - @Resource - private BusinessUnitHandleDetailDao businessUnitHandleDetailDao; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private ExtSystemService extSystemService; - @Resource - private UserService userService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private ProcessSectionService processSectionService; - @Override - public BusinessUnitHandleDetail selectById(String id) { - BusinessUnitHandleDetail handleDetail =businessUnitHandleDetailDao.selectByPrimaryKey(id); - if (handleDetail !=null && handleDetail.getInsuser() !=null && !handleDetail.getInsuser().isEmpty()) { - User user =userService.getUserById(handleDetail.getInsuser()); - handleDetail.setInsuserName(user.getCaption()); - } - return handleDetail; - } - - @Override - public int deleteById(String id) { - return businessUnitHandleDetailDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnitHandleDetail entity) { - int res =this.businessUnitHandleDetailDao.insert(entity); - return res; - } - @Override - public int update(BusinessUnitHandleDetail businessUnitHandleDetail) { - int result=businessUnitHandleDetailDao.updateByPrimaryKeySelective(businessUnitHandleDetail); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnitHandleDetail businessUnitHandleDetail = new BusinessUnitHandleDetail(); - businessUnitHandleDetail.setWhere(wherestr); - List businessUnits =businessUnitHandleDetailDao.selectListByWhere(businessUnitHandleDetail); - for (BusinessUnitHandleDetail item : businessUnits) { - //设备 - if(item.getEquipmentids()!=null && !item.getEquipmentids().isEmpty()){ - String ids = item.getEquipmentids().replace(",", "','"); - List equipmentCards = this.equipmentCardService.selectListByWhere(" where id in ('"+ids+"') order by id"); - for (EquipmentCard equipmentCard : equipmentCards) { - if(item.getEquipmentNames() == null||item.getEquipmentNames().isEmpty()){ - item.setEquipmentNames(equipmentCard.getEquipmentname()); - }else{ - item.setEquipmentNames("," + equipmentCard.getEquipmentname()); - } - } - } - - //缺陷 - MaintenanceDetail maintenanceDetail = maintenanceDetailService.selectById(item.getMaintenancedetailid()); - //测试时发现有些detail追寻不到 - if (maintenanceDetail==null) { - continue; - } - item.setMaintenanceDetail(maintenanceDetail); - String companyId =maintenanceDetail.getCompanyid(); - if (companyId==null || companyId.isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(maintenanceDetail.getMaintenanceid()); - companyId=maintenance.getCompanyid(); - } - - User user =userService.getUserById(item.getInsuser()); - item.setInsuserName(user.getCaption()); - - //工艺段 - if(item.getProcesssectionid()!=null && !item.getProcesssectionid().isEmpty()){ - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSectionName(processSection.getName()); - } - - //故障类型 - if(item.getFaultlibraryid()!=null && !item.getFaultlibraryid().isEmpty()){ - LibraryFaultBloc faultLibrary = libraryFaultBlocService.selectById(item.getFaultlibraryid()); - item.setFaultLibraryName(faultLibrary.getFaultName()); - } - } - return businessUnits; - } - - @Override - public int deleteByWhere(String wherestr) { - BusinessUnitHandleDetail businessUnitHandleDetail = new BusinessUnitHandleDetail(); - businessUnitHandleDetail.setWhere(wherestr); - return businessUnitHandleDetailDao.deleteByWhere(businessUnitHandleDetail); - } - /** - * 检测存在 - * 存在返回true - * */ - public boolean checkExit(BusinessUnitHandleDetail businessUnitHandleDetail) { - BusinessUnitHandleDetail b =businessUnitHandleDetailDao.selectByPrimaryKey(businessUnitHandleDetail.getId()); - if(b==null){ - return false; - }else{ - return true; - } - - } -} diff --git a/src/com/sipai/service/business/BusinessUnitHandleService.java b/src/com/sipai/service/business/BusinessUnitHandleService.java deleted file mode 100644 index e806e93a..00000000 --- a/src/com/sipai/service/business/BusinessUnitHandleService.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.business; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.business.BusinessUnitDao; -import com.sipai.dao.business.BusinessUnitHandleDao; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.tools.CommService; - -@Service -public class BusinessUnitHandleService implements CommService{ - @Resource - private BusinessUnitHandleDao businessUnitHandleDao; - - @Override - public BusinessUnitHandle selectById(String id) { - BusinessUnitHandle businessUnitHandle =businessUnitHandleDao.selectByPrimaryKey(id); - return businessUnitHandle; - } - - @Override - public int deleteById(String id) { - return businessUnitHandleDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnitHandle entity) { - int res =this.businessUnitHandleDao.insert(entity); - return res; - } - @Override - public int update(BusinessUnitHandle businessUnitHandle) { - int result=businessUnitHandleDao.updateByPrimaryKeySelective(businessUnitHandle); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - businessUnitHandle.setWhere(wherestr); - List businessUnits =businessUnitHandleDao.selectListByWhere(businessUnitHandle); - return businessUnits; - } - - public List selectdoneworkList(String wherestr) { - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - businessUnitHandle.setWhere(wherestr); - List businessUnits =businessUnitHandleDao.selectdoneworkList(businessUnitHandle); - return businessUnits; - } - @Override - public int deleteByWhere(String wherestr) { - BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle(); - businessUnitHandle.setWhere(wherestr); - return businessUnitHandleDao.deleteByWhere(businessUnitHandle); - } - /** - * 检测存在 - * 存在返回true - * */ - public boolean checkExit(BusinessUnitHandle businessUnitHandle) { - BusinessUnitHandle b =businessUnitHandleDao.selectByPrimaryKey(businessUnitHandle.getId()); - if(b==null){ - return false; - }else{ - return true; - } - - } -} diff --git a/src/com/sipai/service/business/BusinessUnitInquiryService.java b/src/com/sipai/service/business/BusinessUnitInquiryService.java deleted file mode 100644 index c3c6f2e4..00000000 --- a/src/com/sipai/service/business/BusinessUnitInquiryService.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.service.business; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.business.BusinessUnitDao; -import com.sipai.dao.business.BusinessUnitInquiryDao; -import com.sipai.dao.business.BusinessUnitInquiryDao; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitInquiry; -import com.sipai.entity.business.BusinessUnitInquiry; -import com.sipai.tools.CommService; - -@Service -public class BusinessUnitInquiryService implements CommService{ - @Resource - private BusinessUnitInquiryDao businessUnitInquiryDao; - - @Override - public BusinessUnitInquiry selectById(String id) { - BusinessUnitInquiry businessUnitInquiry =businessUnitInquiryDao.selectByPrimaryKey(id); - return businessUnitInquiry; - } - - @Override - public int deleteById(String id) { - return businessUnitInquiryDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnitInquiry entity) { - int res =this.businessUnitInquiryDao.insert(entity); - return res; - } - @Override - public int update(BusinessUnitInquiry businessUnitInquiry) { - int result=businessUnitInquiryDao.updateByPrimaryKeySelective(businessUnitInquiry); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnitInquiry businessUnitInquiry = new BusinessUnitInquiry(); - businessUnitInquiry.setWhere(wherestr); - List businessUnits =businessUnitInquiryDao.selectListByWhere(businessUnitInquiry); - return businessUnits; - } - - @Override - public int deleteByWhere(String wherestr) { - BusinessUnitInquiry businessUnitInquiry = new BusinessUnitInquiry(); - businessUnitInquiry.setWhere(wherestr); - return businessUnitInquiryDao.deleteByWhere(businessUnitInquiry); - } - /** - * 检测存在 - * 存在返回true - * */ - public boolean checkExit(BusinessUnitInquiry businessUnitInquiry) { - BusinessUnitInquiry bUnitInquiry =businessUnitInquiryDao.selectByPrimaryKey(businessUnitInquiry.getId()); - if(bUnitInquiry==null){ - return false; - }else{ - return true; - } - - } -} diff --git a/src/com/sipai/service/business/BusinessUnitIssueService.java b/src/com/sipai/service/business/BusinessUnitIssueService.java deleted file mode 100644 index f8fcaccc..00000000 --- a/src/com/sipai/service/business/BusinessUnitIssueService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.business; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.business.BusinessUnitDao; -import com.sipai.dao.business.BusinessUnitIssueDao; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitIssue; -import com.sipai.tools.CommService; - -@Service -public class BusinessUnitIssueService implements CommService{ - @Resource - private BusinessUnitIssueDao businessUnitIssueDao; - - @Override - public BusinessUnitIssue selectById(String id) { - BusinessUnitIssue businessUnitIssue =businessUnitIssueDao.selectByPrimaryKey(id); - return businessUnitIssue; - } - - @Override - public int deleteById(String id) { - return businessUnitIssueDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnitIssue entity) { - int res =this.businessUnitIssueDao.insert(entity); - return res; - } - @Override - public int update(BusinessUnitIssue businessUnitIssue) { - int result=businessUnitIssueDao.updateByPrimaryKeySelective(businessUnitIssue); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnitIssue businessUnitIssue = new BusinessUnitIssue(); - businessUnitIssue.setWhere(wherestr); - List businessUnits =businessUnitIssueDao.selectListByWhere(businessUnitIssue); - return businessUnits; - } - - @Override - public int deleteByWhere(String wherestr) { - BusinessUnitIssue businessUnitIssue = new BusinessUnitIssue(); - businessUnitIssue.setWhere(wherestr); - return businessUnitIssueDao.deleteByWhere(businessUnitIssue); - } - - -} diff --git a/src/com/sipai/service/business/BusinessUnitService.java b/src/com/sipai/service/business/BusinessUnitService.java deleted file mode 100644 index 51078b3d..00000000 --- a/src/com/sipai/service/business/BusinessUnitService.java +++ /dev/null @@ -1,623 +0,0 @@ -package com.sipai.service.business; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.HistoryService; -import org.activiti.engine.RepositoryService; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.history.HistoricActivityInstance; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.RepositoryServiceImpl; -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.persistence.entity.TaskEntity; -import org.activiti.engine.impl.pvm.PvmTransition; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl; -import org.activiti.engine.impl.pvm.process.TransitionImpl; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; - -import com.sipai.dao.business.BusinessUnitDao; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.tools.CommService; - -@Service -public class BusinessUnitService implements CommService{ - @Resource - private BusinessUnitDao businessUnitDao; - @Resource - private TaskService taskService; - @Resource - private HistoryService historyService; - @Resource - private RepositoryService repositoryService; - @Resource - private RuntimeService runtimeService; - - @Override - public BusinessUnit selectById(String id) { - BusinessUnit businessUnit =businessUnitDao.selectByPrimaryKey(id); - return businessUnit; - } - - @Override - public int deleteById(String id) { - return businessUnitDao.deleteByPrimaryKey(id); - } - @Override - public int save(BusinessUnit entity) { - int res =this.businessUnitDao.insert(entity); - return res; - } - @Override - public int update(BusinessUnit businessUnit) { - int result=businessUnitDao.updateByPrimaryKeySelective(businessUnit); - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - BusinessUnit businessUnit = new BusinessUnit(); - businessUnit.setWhere(wherestr); - List businessUnits =businessUnitDao.selectListByWhere(businessUnit); - return businessUnits; - } - - @Override - public int deleteByWhere(String wherestr) { - BusinessUnit businessUnit = new BusinessUnit(); - businessUnit.setWhere(wherestr); - return businessUnitDao.deleteByWhere(businessUnit); - } - /** - * 流程撤回操作 - * @param taskId - * @return - */ - @Transactional - public int doWithdraw(Task taskout) { - int res =0; - try { - - runtimeService.deleteProcessInstance(taskout.getId(), "canceled-测试"); - // 取得当前任务 - HistoricTaskInstance currTask = historyService - .createHistoricTaskInstanceQuery().taskId(taskout.getId()) - .singleResult(); - //根据流程id查询代办任务中流程信息 - Task task = taskService.createTaskQuery().processInstanceId(currTask.getProcessInstanceId()).singleResult(); - //取回流程接点 当前任务id 取回任务id - callBackProcess(task.getId(),currTask.getId()); - //删除历史流程走向记录 - historyService.deleteHistoricTaskInstance(currTask.getId()); - historyService.deleteHistoricTaskInstance(task.getId()); - res=1; - System.out.println("流程撤回成功"); - return res; - } catch (Exception e) { - System.out.println("流程撤回失败"); - return res; - } - } - /** - * 驳回流程 - * - * @param taskId - * 当前任务ID - * @param activityId - * 驳回节点ID - * @param variables - * 流程存储参数 - * @throws Exception - */ - public void backProcess(String taskId, String activityId, - Map variables) throws Exception { - if (StringUtils.isEmpty(activityId)) { - throw new Exception("驳回目标节点ID为空!"); - } - - // 查找所有并行任务节点,同时驳回 - List taskList = findTaskListByKey(findProcessInstanceByTaskId( - taskId).getId(), findTaskById(taskId).getTaskDefinitionKey()); - for (Task task : taskList) { - commitProcess(task.getId(), variables, activityId); - } - } - - - /** - * 取回流程 - * - * @param taskId - * 当前任务ID - * @param activityId - * 取回节点ID - * @throws Exception - */ - public void callBackProcess(String taskId, String activityId) - throws Exception { - if (StringUtils.isEmpty(activityId)) { - throw new Exception("目标节点ID为空!"); - } - - // 查找所有并行任务节点,同时取回 - List taskList = findTaskListByKey(findProcessInstanceByTaskId( - taskId).getId(), findTaskById(taskId).getTaskDefinitionKey()); - for (Task task : taskList) { - commitProcess(task.getId(), null, activityId); - } - } - - - /** - * 清空指定活动节点流向 - * - * @param activityImpl - * 活动节点 - * @return 节点流向集合 - */ - private List clearTransition(ActivityImpl activityImpl) { - // 存储当前节点所有流向临时变量 - List oriPvmTransitionList = new ArrayList(); - // 获取当前节点所有流向,存储到临时变量,然后清空 - List pvmTransitionList = activityImpl - .getOutgoingTransitions(); - for (PvmTransition pvmTransition : pvmTransitionList) { - oriPvmTransitionList.add(pvmTransition); - } - pvmTransitionList.clear(); - - return oriPvmTransitionList; - } - - - /** - * 提交流程/流程转向 - * @param taskId - * 当前任务ID - * @param variables - * 流程变量 - * @param activityId - * 流程转向执行任务节点ID
- * 此参数为空,默认为提交操作 - * @throws Exception - */ - private void commitProcess(String taskId, Map variables, - String activityId) throws Exception { - if (variables == null) { - variables = new HashMap(); - } - // 跳转节点为空,默认提交操作 - if (StringUtils.isEmpty(activityId)) { - taskService.complete(taskId, variables); - } else {// 流程转向操作 - turnTransition(taskId, activityId, variables); - } - } - - - /** - * 中止流程(特权人直接审批通过等) - * - * @param taskId - */ - public void endProcess(String taskId) throws Exception { - ActivityImpl endActivity = findActivitiImpl(taskId, "end"); - commitProcess(taskId, null, endActivity.getId()); - } - - - /** - * 根据流入任务集合,查询最近一次的流入任务节点 - * - * @param processInstance - * 流程实例 - * @param tempList - * 流入任务集合 - * @return - */ - private ActivityImpl filterNewestActivity(ProcessInstance processInstance, - List tempList) { - while (tempList.size() > 0) { - ActivityImpl activity_1 = tempList.get(0); - HistoricActivityInstance activityInstance_1 = findHistoricUserTask( - processInstance, activity_1.getId()); - if (activityInstance_1 == null) { - tempList.remove(activity_1); - continue; - } - - if (tempList.size() > 1) { - ActivityImpl activity_2 = tempList.get(1); - HistoricActivityInstance activityInstance_2 = findHistoricUserTask( - processInstance, activity_2.getId()); - if (activityInstance_2 == null) { - tempList.remove(activity_2); - continue; - } - - if (activityInstance_1.getEndTime().before( - activityInstance_2.getEndTime())) { - tempList.remove(activity_1); - } else { - tempList.remove(activity_2); - } - } else { - break; - } - } - if (tempList.size() > 0) { - return tempList.get(0); - } - return null; - } - - - /** - * 根据任务ID和节点ID获取活动节点
- * - * @param taskId - * 任务ID - * @param activityId - * 活动节点ID
- * 如果为null或"",则默认查询当前活动节点
- * 如果为"end",则查询结束节点
- * - * @return - * @throws Exception - */ - private ActivityImpl findActivitiImpl(String taskId, String activityId) - throws Exception { - // 取得流程定义 - ProcessDefinitionEntity processDefinition = findProcessDefinitionEntityByTaskId(taskId); - - // 获取当前活动节点ID - if (StringUtils.isEmpty(activityId)) { - activityId = findTaskById(taskId).getTaskDefinitionKey(); - }else{ - HistoricTaskInstance currTask = historyService - .createHistoricTaskInstanceQuery().taskId(activityId) - .singleResult(); - activityId = currTask.getTaskDefinitionKey(); - } - - // 根据流程定义,获取该流程实例的结束节点 - if (activityId.toUpperCase().equals("END")) { - for (ActivityImpl activityImpl : processDefinition.getActivities()) { - List pvmTransitionList = activityImpl - .getOutgoingTransitions(); - if (pvmTransitionList.isEmpty()) { - return activityImpl; - } - } - } - - // 根据节点ID,获取对应的活动节点 - ActivityImpl activityImpl = ((ProcessDefinitionImpl) processDefinition) - .findActivity(activityId); - - return activityImpl; - } - - - /** - * 根据当前任务ID,查询可以驳回的任务节点 - * - * @param taskId - * 当前任务ID - */ - public List findBackAvtivity(String taskId) throws Exception { - List rtnList = iteratorBackActivity(taskId, findActivitiImpl(taskId, - null), new ArrayList(), - new ArrayList()); - return reverList(rtnList); - } - - /** - * 查询指定任务节点的最新记录 - * - * @param processInstance - * 流程实例 - * @param activityId - * @return - */ - private HistoricActivityInstance findHistoricUserTask( - ProcessInstance processInstance, String activityId) { - HistoricActivityInstance rtnVal = null; - // 查询当前流程实例审批结束的历史节点 - List historicActivityInstances = historyService - .createHistoricActivityInstanceQuery().activityType("userTask") - .processInstanceId(processInstance.getId()).activityId( - activityId).finished() - .orderByHistoricActivityInstanceEndTime().desc().list(); - if (historicActivityInstances.size() > 0) { - rtnVal = historicActivityInstances.get(0); - } - - return rtnVal; - } - - /** - * 根据当前节点,查询输出流向是否为并行终点,如果为并行终点,则拼装对应的并行起点ID - * - * @param activityImpl - * 当前节点 - * @return - */ - private String findParallelGatewayId(ActivityImpl activityImpl) { - List incomingTransitions = activityImpl - .getOutgoingTransitions(); - for (PvmTransition pvmTransition : incomingTransitions) { - TransitionImpl transitionImpl = (TransitionImpl) pvmTransition; - activityImpl = transitionImpl.getDestination(); - String type = (String) activityImpl.getProperty("type"); - if ("parallelGateway".equals(type)) {// 并行路线 - String gatewayId = activityImpl.getId(); - String gatewayType = gatewayId.substring(gatewayId - .lastIndexOf("_") + 1); - if ("END".equals(gatewayType.toUpperCase())) { - return gatewayId.substring(0, gatewayId.lastIndexOf("_")) - + "_start"; - } - } - } - return null; - } - - /** - * 根据任务ID获取流程定义 - * - * @param taskId - * 任务ID - * @return - * @throws Exception - */ - public ProcessDefinitionEntity findProcessDefinitionEntityByTaskId( - String taskId) throws Exception { - // 取得流程定义 - ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) - .getDeployedProcessDefinition(findTaskById(taskId) - .getProcessDefinitionId()); - - if (processDefinition == null) { - throw new Exception("流程定义未找到!"); - } - - return processDefinition; - } - - /** - * 根据任务ID获取对应的流程实例 - * - * @param taskId - * 任务ID - * @return - * @throws Exception - */ - public ProcessInstance findProcessInstanceByTaskId(String taskId) - throws Exception { - // 找到流程实例 - ProcessInstance processInstance = runtimeService - .createProcessInstanceQuery().processInstanceId( - findTaskById(taskId).getProcessInstanceId()) - .singleResult(); - if (processInstance == null) { - throw new Exception("流程实例未找到!"); - } - return processInstance; - } - - /** - * 根据任务ID获得任务实例 - * - * @param taskId - * 任务ID - * @return - * @throws Exception - */ - private TaskEntity findTaskById(String taskId) throws Exception { - TaskEntity task = (TaskEntity) taskService.createTaskQuery().taskId( - taskId).singleResult(); - if (task == null) { - throw new Exception("任务实例未找到!"); - } - return task; - } - - - /** - * 根据流程实例ID和任务key值查询所有同级任务集合 - * - * @param processInstanceId - * @param key - * @return - */ - private List findTaskListByKey(String processInstanceId, String key) { - return taskService.createTaskQuery().processInstanceId( - processInstanceId).taskDefinitionKey(key).list(); - } - - - /** - * 迭代循环流程树结构,查询当前节点可驳回的任务节点 - * - * @param taskId - * 当前任务ID - * @param currActivity - * 当前活动节点 - * @param rtnList - * 存储回退节点集合 - * @param tempList - * 临时存储节点集合(存储一次迭代过程中的同级userTask节点) - * @return 回退节点集合 - */ - private List iteratorBackActivity(String taskId, - ActivityImpl currActivity, List rtnList, - List tempList) throws Exception { - // 查询流程定义,生成流程树结构 - ProcessInstance processInstance = findProcessInstanceByTaskId(taskId); - - // 当前节点的流入来源 - List incomingTransitions = currActivity - .getIncomingTransitions(); - // 条件分支节点集合,userTask节点遍历完毕,迭代遍历此集合,查询条件分支对应的userTask节点 - List exclusiveGateways = new ArrayList(); - // 并行节点集合,userTask节点遍历完毕,迭代遍历此集合,查询并行节点对应的userTask节点 - List parallelGateways = new ArrayList(); - // 遍历当前节点所有流入路径 - for (PvmTransition pvmTransition : incomingTransitions) { - TransitionImpl transitionImpl = (TransitionImpl) pvmTransition; - ActivityImpl activityImpl = transitionImpl.getSource(); - String type = (String) activityImpl.getProperty("type"); - /** - * 并行节点配置要求:
- * 必须成对出现,且要求分别配置节点ID为:XXX_start(开始),XXX_end(结束) - */ - if ("parallelGateway".equals(type)) {// 并行路线 - String gatewayId = activityImpl.getId(); - String gatewayType = gatewayId.substring(gatewayId - .lastIndexOf("_") + 1); - if ("START".equals(gatewayType.toUpperCase())) {// 并行起点,停止递归 - return rtnList; - } else {// 并行终点,临时存储此节点,本次循环结束,迭代集合,查询对应的userTask节点 - parallelGateways.add(activityImpl); - } - } else if ("startEvent".equals(type)) {// 开始节点,停止递归 - return rtnList; - } else if ("userTask".equals(type)) {// 用户任务 - tempList.add(activityImpl); - } else if ("exclusiveGateway".equals(type)) {// 分支路线,临时存储此节点,本次循环结束,迭代集合,查询对应的userTask节点 - currActivity = transitionImpl.getSource(); - exclusiveGateways.add(currActivity); - } - } - - /** - * 迭代条件分支集合,查询对应的userTask节点 - */ - for (ActivityImpl activityImpl : exclusiveGateways) { - iteratorBackActivity(taskId, activityImpl, rtnList, tempList); - } - - /** - * 迭代并行集合,查询对应的userTask节点 - */ - for (ActivityImpl activityImpl : parallelGateways) { - iteratorBackActivity(taskId, activityImpl, rtnList, tempList); - } - - /** - * 根据同级userTask集合,过滤最近发生的节点 - */ - currActivity = filterNewestActivity(processInstance, tempList); - if (currActivity != null) { - // 查询当前节点的流向是否为并行终点,并获取并行起点ID - String id = findParallelGatewayId(currActivity); - if (StringUtils.isEmpty(id)) {// 并行起点ID为空,此节点流向不是并行终点,符合驳回条件,存储此节点 - rtnList.add(currActivity); - } else {// 根据并行起点ID查询当前节点,然后迭代查询其对应的userTask任务节点 - currActivity = findActivitiImpl(taskId, id); - } - - // 清空本次迭代临时集合 - tempList.clear(); - // 执行下次迭代 - iteratorBackActivity(taskId, currActivity, rtnList, tempList); - } - return rtnList; - } - - - /** - * 还原指定活动节点流向 - * - * @param activityImpl - * 活动节点 - * @param oriPvmTransitionList - * 原有节点流向集合 - */ - private void restoreTransition(ActivityImpl activityImpl, - List oriPvmTransitionList) { - // 清空现有流向 - List pvmTransitionList = activityImpl - .getOutgoingTransitions(); - pvmTransitionList.clear(); - // 还原以前流向 - for (PvmTransition pvmTransition : oriPvmTransitionList) { - pvmTransitionList.add(pvmTransition); - } - } - - /** - * 反向排序list集合,便于驳回节点按顺序显示 - * - * @param list - * @return - */ - private List reverList(List list) { - List rtnList = new ArrayList(); - // 由于迭代出现重复数据,排除重复 - for (int i = list.size(); i > 0; i--) { - if (!rtnList.contains(list.get(i - 1))) - rtnList.add(list.get(i - 1)); - } - return rtnList; - } - - /** - * 转办流程 - * - * @param taskId - * 当前任务节点ID - * @param userCode - * 被转办人Code - */ - public void transferAssignee(String taskId, String userCode) { - taskService.setAssignee(taskId, userCode); - } - - /** - * 流程转向操作 - * - * @param taskId - * 当前任务ID - * @param activityId - * 目标节点任务ID - * @param variables - * 流程变量 - * @throws Exception - */ - private void turnTransition(String taskId, String activityId, - Map variables) throws Exception { - // 当前节点 - ActivityImpl currActivity = findActivitiImpl(taskId, null); - // 清空当前流向 - List oriPvmTransitionList = clearTransition(currActivity); - - // 创建新流向 - TransitionImpl newTransition = currActivity.createOutgoingTransition(); - // 目标节点 - ActivityImpl pointActivity = findActivitiImpl(taskId, activityId); - // 设置新流向的目标节点 - newTransition.setDestination(pointActivity); - - // 执行转向任务 - taskService.complete(taskId, variables); - // 删除目标节点新流入 - pointActivity.getIncomingTransitions().remove(newTransition); - - // 还原以前流向 - restoreTransition(currActivity, oriPvmTransitionList); - } -} diff --git a/src/com/sipai/service/cmd/CmdService.java b/src/com/sipai/service/cmd/CmdService.java deleted file mode 100644 index 950473a4..00000000 --- a/src/com/sipai/service/cmd/CmdService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.cmd; - -public interface CmdService { - - public String locationEquipment(String id); - - public String locationUser(String id); - - public String locationCameraOpen(String id); - - public String locationCameraClose(String id); - - public String locationCameraOpenMore(String ids); - - public String locationCameraOpenMore2(String ids); - - /** - * 从mqtt客户端接收指令 通过wms发给BIM - * - * @param measurepointId - * @param dataType - * @param value - * @param listenerName - * @return - */ - public String handleOtherSystem(String measurepointId, String dataType, String value, String listenerName); - - /** - * 从沙口上位机接收语音 通过wms发给BIM - * - * @param value - * @return - */ - public String handle4Speech(String value); - - /** - * 将报警信息推送给上位机 - * - * @param value - * @return - */ - public String handle4Alarm(String value); - - /** - * 调用模型 - * - * @param value - * @return - */ - public String handle4Model(String value); -} diff --git a/src/com/sipai/service/cmd/impl/CmdServiceImpl.java b/src/com/sipai/service/cmd/impl/CmdServiceImpl.java deleted file mode 100644 index 478c1aed..00000000 --- a/src/com/sipai/service/cmd/impl/CmdServiceImpl.java +++ /dev/null @@ -1,561 +0,0 @@ -package com.sipai.service.cmd.impl; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.google.api.client.json.Json; -import com.sipai.entity.Listener.ListenerHis; -import com.sipai.entity.Listener.ListenerMessage; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Camera; -import com.sipai.quartz.job.*; -import com.sipai.service.Listener.ListenerHisService; -import com.sipai.service.Listener.ListenerMessageService; -import com.sipai.service.cmd.CmdService; -import com.sipai.service.equipment.EquipmentCardCameraService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.MessageEnum; -import com.sipai.tools.WebSocketCmdUtil; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("cmdService") -public class CmdServiceImpl implements CmdService { - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UserService userService; - @Resource - private CameraService cameraService; - @Resource - private MPointService mPointService; - @Resource - private ListenerHisService listenerHisService; - @Resource - private ListenerMessageService listenerMessageSerice; - @Resource - private EquipmentCardCameraService equipmentCardCameraService; - - /** - * 给BIM发送指令(定位设备) - * - * @param id - * @return - */ - public String locationEquipment(String id) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(id); - if (equipmentCard != null) { - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_FINDOBJ.toString()); - //南厂需要传设备Id 别的项目需要设备编号 - if (equipmentCard.getBizid() != null && equipmentCard.getBizid().equals("021NS")) { - WebSocketCmdUtil.send(jsonObject.get("cmdType").toString(), equipmentCard.getId(), jsonObject.get("action").toString(), System.currentTimeMillis()); - } else { - WebSocketCmdUtil.send(jsonObject.get("cmdType").toString(), equipmentCard.getEquipmentcardid(), jsonObject.get("action").toString(), System.currentTimeMillis()); - } - } - return ""; - } - - /** - * 给BIM发送指令(定位人员) - * - * @param id - * @return - */ - public String locationUser(String id) { - User user = userService.getUserById(id); - if (user != null) { - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_FINDPP.toString()); - WebSocketCmdUtil.send(jsonObject.get("cmdType").toString(), user.getCardid(), jsonObject.get("action").toString(), System.currentTimeMillis()); - } - return ""; - } - - /** - * 给BIM发送指令(打开摄像头--单个) - * - * @param id - * @return - */ - public String locationCameraOpen(String id) { - Camera camera = cameraService.selectById(id); - String came = ""; - if (camera != null) { - if ("dahua".equals(camera.getType())) { - came = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getUrl() + "/cam/realmonitor?channel=" + camera.getChannel() + "&subtype=0"; - } else if ("hikvision".equals(camera.getType())) { - came = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getUrl() + "/h264/ch" + camera.getChannel() + "/main/av_stream"; - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("cmdType", "opencams"); - jsonObject.put("objId", came); - jsonObject.put("action", "play"); - jsonObject.put("time", System.currentTimeMillis()); - WebSocketCmdUtil.send2(jsonObject); - int camera2 = saveMessage(jsonObject.get("cmdType").toString(), "标识_打开摄像头单个_" + jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - return ""; - } - - /** - * 给BIM发送指令(打开摄像头--多个) - * - * @param ids - * @return - */ - @Override - public String locationCameraOpenMore(String ids) { - if (ids != null && !ids.trim().equals("")) { - JSONArray jsonArray = new JSONArray(); - - String[] id = ids.split(","); - - int len = 0; - if (id.length > 2) {//最多弹2个摄像头 - len = 2; - } else { - len = id.length; - } - - for (int i = 0; i < len; i++) { - String came = ""; - Camera camera = cameraService.selectById(id[i]); - if (camera != null) { - if ("dahua".equals(camera.getType())) { - came = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getUrl() + "/cam/realmonitor?channel=" + camera.getChannel() + "&subtype=0"; - } else if ("hikvision".equals(camera.getType())) { - came = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getUrl() + "/h264/ch" + camera.getChannel() + "/main/av_stream"; - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("camurl", came); - jsonArray.add(jsonObject); - } - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("cmdType", "opencams"); - jsonObject.put("objId", jsonArray); - jsonObject.put("action", "play"); - jsonObject.put("time", System.currentTimeMillis()); - WebSocketCmdUtil.send2(jsonObject); - int camera2 = saveMessage(jsonObject.get("cmdType").toString(), "标识_打开摄像头多个_" + jsonObject.get("objId").toString(), jsonObject.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - return ""; - } - - @Override - public String locationCameraOpenMore2(String ids) { - if (ids != null && !ids.trim().equals("")) { - JSONArray jsonArray = new JSONArray(); - - String[] id = ids.split(","); - - int len = 0; - if (id.length > 2) {//最多弹2个摄像头 - len = 2; - } else { - len = id.length; - } - - for (int i = 0; i < len; i++) { - String came = ""; - Camera camera = cameraService.selectById(id[i]); - if (camera != null) { - if ("dahua".equals(camera.getType())) { - came = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getUrl() + "/cam/realmonitor?channel=" + camera.getChannel() + "&subtype=0"; - } else if ("hikvision".equals(camera.getType())) { - came = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getUrl() + "/h264/ch" + camera.getChannel() + "/main/av_stream"; - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("camId", camera.getId()); - jsonObject.put("camurl", came); - jsonArray.add(jsonObject); - } - } - JSONObject jsonObject = new JSONObject(); - jsonObject.put("cmdType", "opencam"); - jsonObject.put("objIds", jsonArray); - jsonObject.put("action", "play"); - jsonObject.put("time", System.currentTimeMillis()); - WebSocketCmdUtil.send2(jsonObject); - int camera2 = saveMessage(jsonObject.get("cmdType").toString(), "标识_打开摄像头多个_" + jsonObject.get("objIds").toString(), jsonObject.get("action").toString()); - if (camera2 != 1) { - System.out.println("存cmd失败"); - } - } - return ""; - } - - /** - * 给BIM发送指令(关闭摄像头) - * - * @param id - * @return - */ - public String locationCameraClose(String id) { - JSONObject jsonObject = JSONObject.parseObject(MessageEnum.THE_CLOSECAM.toString()); - WebSocketCmdUtil.send(jsonObject.get("cmdType").toString(), jsonObject.get("objId").toString(), jsonObject.get("action").toString(), System.currentTimeMillis()); - return ""; - } - - @Override - public String handleOtherSystem(String measurepointId, String dataType, String value, String listenerName) { - MPoint mPoint = mPointService.selectById(measurepointId); - JSONObject equJson = JSONObject.parseObject(MessageEnum.THE_FINDOBJ.toString()); - JSONObject cameraJson = JSONObject.parseObject(MessageEnum.THE_OPENCAM.toString()); - JSONObject screenJson = JSONObject.parseObject(MessageEnum.THE_SCREEN.toString()); - - // 存modbus历史表 - ListenerHis listenerHis = new ListenerHis(); - listenerHis.setId(CommUtil.getUUID()); - listenerHis.setPointid(measurepointId); - listenerHis.setType(dataType); - listenerHis.setValue(value); - listenerHis.setInsdt(CommUtil.nowDate()); - listenerHisService.save(listenerHis); - - if (mPoint != null) { - // 设备id - String equipmentid = mPoint.getEquipmentid(); - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentid); - if (equipmentCard != null) { - equJson.put("objId", equipmentCard.getEquipmentcardid()); - equJson.put("time", System.currentTimeMillis()); - } - - // 构筑物id - String structureId = mPoint.getStructureId(); - screenJson.put("objId", structureId); - screenJson.put("time", System.currentTimeMillis()); - - - /*List cameras = cameraService.selectListByWhere("where configid = '" + equipmentid + "'"); - if (cameras != null && cameras.size() > 0) { - Camera camera01 = cameras.get(0); - if ("dahua".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/cam/realmonitor?channel=" + camera01.getChannel() + "&subtype=0"; - cameraJson.put("objId", came); - } else if ("hikvision".equals(cameras.get(0).getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/h264/ch" + camera01.getChannel() + "/main/av_stream"; - cameraJson.put("objId", came); - } - }*/ - - List equipmentCardCameraList = equipmentCardCameraService.selectListByWhere("where eqid = '" + equipmentid + "'"); - if (equipmentCardCameraList != null && equipmentCardCameraList.size() > 0) { - Camera camera01 = cameraService.selectById(equipmentCardCameraList.get(0).getCameraid()); - if ("dahua".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/cam/realmonitor?channel=" + camera01.getChannel() + "&subtype=0"; - cameraJson.put("objId", came); -// cameraJson.put("action", "play[" + listenerName + "]"); - cameraJson.put("action", listenerName); - } else if ("hikvision".equals(camera01.getType())) { - String came = "rtsp://" + camera01.getUsername() + ":" + camera01.getPassword() + "@" + camera01.getUrl() + "/h264/ch" + camera01.getChannel() + "/main/av_stream"; - cameraJson.put("objId", came); -// cameraJson.put("action", "play[" + listenerName + "]"); - cameraJson.put("action", listenerName); - } - } - - if (dataType != null && !dataType.equals("")) { - /** - * 操作指定的指令 - */ - if (dataType.contains(MessageEnum.THE_FINDOBJ.getCmdtype())) {//设备 - //调用指令给BIM发消息(定位) - WebSocketCmdUtil.send(equJson); - //存收发记录 - saveMessage(MessageEnum.THE_FINDOBJ.getCmdtype(), "标识21_" + mPoint.getId(), equJson.get("action").toString()); - } - if (dataType.contains(MessageEnum.THE_SCREEN.getCmdtype())) {//构筑物 - //调用指令给BIM发消息(定位) - WebSocketCmdUtil.send(screenJson); - //存收发记录 - saveMessage(MessageEnum.THE_SCREEN.getCmdtype(), "标识22_" + mPoint.getId(), screenJson.get("action").toString()); - } - if (dataType.contains(MessageEnum.THE_OPENCAM.getCmdtype())) {//摄像头 - //调用指令给BIM发消息(摄像头) - if (listenerName != null && !listenerName.equals("")) { - WebSocketCmdUtil.send(cameraJson); - //存收发记录 - saveMessage(MessageEnum.THE_OPENCAM.getCmdtype(), "标识23_" + mPoint.getId(), cameraJson.get("action").toString()); - } - } - } else { - /** - * 操作所有的指令 - */ - //调用指令给BIM发消息(设备定位) - if (equipmentid != null && !equipmentid.equals("")) { - WebSocketCmdUtil.send(equJson); - //存收发记录 - saveMessage(MessageEnum.THE_FINDOBJ.getCmdtype(), "标识2_" + mPoint.getId(), MessageEnum.THE_FINDOBJ.getAction()); - } - //调用指令给BIM发消息(构筑物定位) - if (structureId != null && !structureId.equals("")) { - WebSocketCmdUtil.send(equJson); - //存收发记录 - saveMessage(MessageEnum.THE_SCREEN.getCmdtype(), "标识2_" + mPoint.getId(), MessageEnum.THE_SCREEN.getAction()); - } - //调用指令给BIM发消息(摄像头) - if (equipmentCardCameraList != null && equipmentCardCameraList.size() > 0) { - if (listenerName != null && !listenerName.equals("")) { - WebSocketCmdUtil.send(cameraJson); - //存收发记录 - saveMessage(MessageEnum.THE_OPENCAM.getCmdtype(), "标识2_" + mPoint.getId(), MessageEnum.THE_OPENCAM.getAction()); - } - } - } - } - return null; - } - - @Override - public String handle4Speech(String value) { - /** - * 处理语音 - */ - JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", value); - //推送语音播放 - WebSocketCmdUtil.send(readJson); - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - try { - Thread.sleep(1); - } catch (Exception e) { - - } - - /** - * 处理优良中 - */ - JSONObject gifJson = JSONObject.parseObject(MessageEnum.THE_GIF.toString()); - if (value.contains("优")) { - gifJson.put("action", "优"); - //推送GIF - WebSocketCmdUtil.send(gifJson); - } else if (value.contains("优") && value.contains("中")) { - //推送GIF - WebSocketCmdUtil.send(gifJson); - gifJson.put("action", "优"); - } else if (!value.contains("优") && value.contains("中")) { - //推送GIF - WebSocketCmdUtil.send(gifJson); - gifJson.put("action", "中"); - } else { - gifJson.put("action", "中"); - } - - return null; - } - - @Override - public String handle4Alarm(String value) { - /** - * 处理语音 - */ - /*JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", value); - //推送语音播放 - WebSocketCmdUtil.send(readJson);*/ - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - /*try { - Thread.sleep(1); - } catch (Exception e) { - - }*/ - - /** - * 报警直接推 中 - */ - JSONObject gifJson = JSONObject.parseObject(MessageEnum.THE_GIF.toString()); - gifJson.put("action", "中"); - - //推送GIF - WebSocketCmdUtil.send(gifJson); - return null; - } - - /** - * 存收发记录 - * - * @param cmdtype - * @param objid - * @param action - * @return - */ - private int saveMessage(String cmdtype, String objid, String action) { - ListenerMessage listenerMessage = new ListenerMessage(); - listenerMessage.setId(CommUtil.getUUID()); - listenerMessage.setCmdtype(cmdtype); - listenerMessage.setObjid(objid); - listenerMessage.setAction(action); - listenerMessage.setInsdt(CommUtil.nowDate()); - int save = listenerMessageSerice.save(listenerMessage); - return save; - } - - @Async - @Override - public String handle4Model(String value) { - ScheduleJob scheduleJob = null; - if (value != null && value.contains("一泵建议配泵方案")) { - System.out.println("一泵建议配泵方案===============================" + CommUtil.nowDate()); - ModelJob_FSSK_BZNH_1 modelJob_fssk_bznh_1 = new ModelJob_FSSK_BZNH_1(); - modelJob_fssk_bznh_1.dataSave(scheduleJob); - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - try { - Thread.sleep(10000); - } catch (Exception e) { - - } - - String ckyl = "0";//出口压力 - String ckll = "0";//出口流量 - - MPoint mPoint = mPointService.selectById("FS_SK11_C", "SK_E_TT100_YC_YL_1P"); - if (mPoint != null) { - ckyl = mPoint.getParmvalue() + ""; - } - MPoint mPoint2 = mPointService.selectById("FS_SK11_C", "SK_E_TT100_YC_LL_1P"); - if (mPoint2 != null) { - ckll = mPoint2.getParmvalue() + ""; - } - String bzStr = "";//开启x号、x号、x号泵组 - for (int i = 0; i < 8; i++) { - MPoint mPoint3 = mPointService.selectById("FS_SK11_C", "SK_E_TT10" + (i + 1) + "_YC_RUN_1P"); - if (mPoint3 != null) { - if (Double.parseDouble(mPoint3.getParmvalue().toString())==1) { - bzStr += (i + 1) + "号、"; - } - } - } - if (bzStr != null && !bzStr.equals("")) { - bzStr = "一泵建议配泵方案是开启" + bzStr + "泵组。估算的出厂压力为" + ckyl + ",出厂流量为" + ckll; - } else { - bzStr = "一泵目前暂无方案"; - } - - /** - * 处理语音 - */ - JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", bzStr); - //推送语音播放 - WebSocketCmdUtil.send(readJson); - } - if (value != null && value.contains("二泵建议配泵方案")) { - System.out.println("二泵建议配泵方案===============================" + CommUtil.nowDate()); - ModelJob_FSSK_BZNH_2 modelJob_fssk_bznh_2 = new ModelJob_FSSK_BZNH_2(); - modelJob_fssk_bznh_2.dataSave(scheduleJob); - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - try { - Thread.sleep(10000); - } catch (Exception e) { - - } - - String ckyl = "0";//出口压力 - String ckll = "0";//出口流量 - - MPoint mPoint = mPointService.selectById("FS_SK11_C", "SK_E_TT100_YC_YL_2P"); - if (mPoint != null) { - ckyl = mPoint.getParmvalue() + ""; - } - MPoint mPoint2 = mPointService.selectById("FS_SK11_C", "SK_E_TT100_YC_LL_2P"); - if (mPoint2 != null) { - ckll = mPoint2.getParmvalue() + ""; - } - String bzStr = "";//开启x号、x号、x号泵组 - for (int i = 0; i < 8; i++) { - MPoint mPoint3 = mPointService.selectById("FS_SK11_C", "SK_E_TT10" + (i + 1) + "_YC_RUN_2P"); - if (mPoint3 != null) { - if (Double.parseDouble(mPoint3.getParmvalue().toString())==1) { - bzStr += (i + 1) + "号、"; - } - } - } - if (bzStr != null && !bzStr.equals("")) { - bzStr = "二泵建议配泵方案是开启" + bzStr + "泵组。估算的出厂压力为" + ckyl + ",出厂流量为" + ckll; - } else { - bzStr = "二泵目前暂无方案"; - } - - /** - * 处理语音 - */ - JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", bzStr); - //推送语音播放 - WebSocketCmdUtil.send(readJson); - } - if (value != null && value.contains("建议投矾方案")) { - ModelJob_FSSK_JY1 modelJob_fssk_jy1 = new ModelJob_FSSK_JY1(); - ModelJob_FSSK_JY2 modelJob_fssk_jy2 = new ModelJob_FSSK_JY2(); - ModelJob_FSSK_JY3 modelJob_fssk_jy3 = new ModelJob_FSSK_JY3(); - modelJob_fssk_jy1.dataSave(scheduleJob); - modelJob_fssk_jy2.dataSave(scheduleJob); - modelJob_fssk_jy3.dataSave(scheduleJob); - - /** - * 加个延迟1毫秒 错开时间戳 避免BIM无法处理 - */ - try { - Thread.sleep(10000); - } catch (Exception e) { - - } - - String bzStr = "建议投矾方案为"; - - MPoint mPoint = mPointService.selectById("FS_SK11_C", "SK_E_YC_JYL"); - if (mPoint != null) { - bzStr += "一流程建议投矾量为:" + mPoint.getParmvalue(); - } - MPoint mPoint2 = mPointService.selectById("FS_SK11_C", "SK_E_YC_JYL2"); - if (mPoint2 != null) { - bzStr += "二流程建议投矾量为:" + mPoint2.getParmvalue(); - } - MPoint mPoint3 = mPointService.selectById("FS_SK11_C", "SK_E_YC_JYL3"); - if (mPoint3 != null) { - bzStr += "三流程建议投矾量为:" + mPoint3.getParmvalue(); - } - /** - * 处理语音 - */ - JSONObject readJson = JSONObject.parseObject(MessageEnum.THE_READ.toString()); - readJson.put("action", bzStr); - //推送语音播放 - WebSocketCmdUtil.send(readJson); - } - return null; - } - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureDetailService.java b/src/com/sipai/service/command/EmergencyConfigureDetailService.java deleted file mode 100644 index 23435d8a..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureDetailService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import com.sipai.entity.command.EmergencyConfigureDetail; -import com.sipai.entity.command.EmergencyConfigureInfo; - - -public interface EmergencyConfigureDetailService { - - public List selectListByWhere(String where); - - public int saveMenu(EmergencyConfigureDetail emergencyConfigureDetail); - - public EmergencyConfigureDetail getMenuById(String menuId); - - public int updateMenu(EmergencyConfigureDetail emergencyConfigureDetail); - - public int deleteMenuById(String menuId); - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureDetailServiceImpl.java b/src/com/sipai/service/command/EmergencyConfigureDetailServiceImpl.java deleted file mode 100644 index 23cf64c3..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureDetailServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.command.EmergencyConfigureDetailDao; -import com.sipai.entity.command.EmergencyConfigureDetail; -import com.sipai.entity.command.EmergencyConfigureInfo; - - -@Service("emergencyConfigureDetailService") -public class EmergencyConfigureDetailServiceImpl implements EmergencyConfigureDetailService { - - @Resource - private EmergencyConfigureDetailDao emergencyConfigureDetailDao; - - @Override - public List selectListByWhere(String where) { - EmergencyConfigureDetail emergencyConfigureDetail= new EmergencyConfigureDetail(); - emergencyConfigureDetail.setWhere(where); - return this.emergencyConfigureDetailDao.selectListByWhere(emergencyConfigureDetail); - } - - @Override - public int saveMenu(EmergencyConfigureDetail emergencyConfigureDetail) { - return this.emergencyConfigureDetailDao.insert(emergencyConfigureDetail); - } - - @Override - public EmergencyConfigureDetail getMenuById(String menuId) { - return this.emergencyConfigureDetailDao.selectByPrimaryKey(menuId); - } - - @Override - public int updateMenu(EmergencyConfigureDetail emergencyConfigureDetail) { - return this.emergencyConfigureDetailDao.updateByPrimaryKeySelective(emergencyConfigureDetail); - } - - @Override - public int deleteMenuById(String menuId) { - return this.emergencyConfigureDetailDao.deleteByPrimaryKey(menuId); - } - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureInfoService.java b/src/com/sipai/service/command/EmergencyConfigureInfoService.java deleted file mode 100644 index 09a653ea..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureInfoService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import com.sipai.entity.command.EmergencyConfigureInfo; - - - - -public interface EmergencyConfigureInfoService { - - public EmergencyConfigureInfo getMenuById(String menuId); - - public int saveMenu(EmergencyConfigureInfo emergencyConfigureInfo); - - public int updateMenu(EmergencyConfigureInfo emergencyConfigureInfo); - - public int deleteMenuById(String menuId); - - public List selectListByWhere(String where); - - public List selectstartconditionListByWhere(String where); - - public List selectrankListByWhere(String where); - - public List selectcontentsstartListByWhere(String where); - - public List selectcountByWhere(String where); - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureInfoServiceImpl.java b/src/com/sipai/service/command/EmergencyConfigureInfoServiceImpl.java deleted file mode 100644 index 0a6eb0a6..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureInfoServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.command.EmergencyConfigureInfoDao; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.service.command.EmergencyConfigureInfoService; -import org.springframework.transaction.annotation.Transactional;; - -@Service("emergencyConfigureInfoService") -public class EmergencyConfigureInfoServiceImpl implements EmergencyConfigureInfoService { - - @Resource - private EmergencyConfigureInfoDao emergencyConfigureInfoDao; - - @Override - public EmergencyConfigureInfo getMenuById(String menuId) { - return this.emergencyConfigureInfoDao.selectByPrimaryKey(menuId); - } - - @Transactional - @Override - public int saveMenu(EmergencyConfigureInfo entity) { - entity.setWhere("where pid = '"+entity.getPid()+"' order by ord desc"); - List list = emergencyConfigureInfoDao.selectListByWhere(entity); - if (list != null && list.size()>0) { - entity.setOrd(list.get(0).getOrd()+1); - } else { - entity.setOrd(0); - } - int res = this.emergencyConfigureInfoDao.insert(entity); - return res; - } - - @Override - public int updateMenu(EmergencyConfigureInfo emergencyConfigureInfo) { - return this.emergencyConfigureInfoDao.updateByPrimaryKeySelective(emergencyConfigureInfo); - } - - @Override - public int deleteMenuById(String menuId) { - return this.emergencyConfigureInfoDao.deleteByPrimaryKey(menuId); - } - - - @Override - public List selectListByWhere(String where) { - EmergencyConfigureInfo emergencyConfigureInfo= new EmergencyConfigureInfo(); - emergencyConfigureInfo.setWhere(where); - return this.emergencyConfigureInfoDao.selectListByWhere(emergencyConfigureInfo); - } - - @Override - public List selectstartconditionListByWhere(String where) { - EmergencyConfigureInfo emergencyConfigureInfo= new EmergencyConfigureInfo(); - emergencyConfigureInfo.setWhere(where); - return this.emergencyConfigureInfoDao.getListByStartcondition(emergencyConfigureInfo); - } - - @Override - public List selectrankListByWhere(String where) { - EmergencyConfigureInfo emergencyConfigureInfo= new EmergencyConfigureInfo(); - emergencyConfigureInfo.setWhere(where); - return this.emergencyConfigureInfoDao.getListByrank(emergencyConfigureInfo); - } - - @Override - public List selectcontentsstartListByWhere(String where) { - EmergencyConfigureInfo emergencyConfigureInfo= new EmergencyConfigureInfo(); - emergencyConfigureInfo.setWhere(where); - return this.emergencyConfigureInfoDao.getListBycontentsstart(emergencyConfigureInfo); - } - - @Override - public List selectcountByWhere(String where) { - EmergencyConfigureInfo emergencyConfigureInfo= new EmergencyConfigureInfo(); - emergencyConfigureInfo.setWhere(where); - return this.emergencyConfigureInfoDao.getListBycount(emergencyConfigureInfo); - } - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureService.java b/src/com/sipai/service/command/EmergencyConfigureService.java deleted file mode 100644 index a99da349..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.web.multipart.MultipartFile; - -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.entity.user.Menu; - - -public interface EmergencyConfigureService{ - public EmergencyConfigure getMenuById(String menuId); - - public int saveMenu(EmergencyConfigure emergencyConfigure); - - public int updateMenu(EmergencyConfigure emergencyConfigure); - - public int deleteMenuById(String menuId); - - public int deleteByPid(String pid); - - public List selectListByWhere(String where); - - public List selectusernameByWhere(String where); - - /** - * 获取bootstrap-treeview 所需json数据*/ - public String getTreeList(List> list_result,List list); - - /** - * 上传富文本图片 - * @param file - * @param request - * @return - */ - public Map ckEditorUploadImage(MultipartFile file, HttpServletRequest request); - - public EmergencyConfigure selectByWhere(String where); -} diff --git a/src/com/sipai/service/command/EmergencyConfigureServiceImpl.java b/src/com/sipai/service/command/EmergencyConfigureServiceImpl.java deleted file mode 100644 index 337f82e6..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureServiceImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.service.command; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import net.sf.json.JSONArray; - -import com.sipai.dao.command.EmergencyConfigureDao; -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.entity.user.Menu; -import com.sipai.service.command.EmergencyConfigureService; -import com.sipai.entity.base.SQLAdapter; - -@Service("emergencyConfigureService") -public class EmergencyConfigureServiceImpl implements EmergencyConfigureService { - - @Resource - private EmergencyConfigureDao emergencyConfigureDao; - - @Override - public EmergencyConfigure getMenuById(String menuId) { - return this.emergencyConfigureDao.selectByPrimaryKey(menuId); - } - - @Override - public int saveMenu(EmergencyConfigure emergencyConfigure) { - return this.emergencyConfigureDao.insert(emergencyConfigure); - } - - @Override - public int updateMenu(EmergencyConfigure emergencyConfigure) { - return this.emergencyConfigureDao.updateByPrimaryKeySelective(emergencyConfigure); - } - - @Override - public int deleteMenuById(String menuId) { - return this.emergencyConfigureDao.deleteByPrimaryKey(menuId); - } - - @Override - public int deleteByPid(String pid) { - EmergencyConfigure emergencyConfigure= new EmergencyConfigure(); - emergencyConfigure.setWhere(" where pid='"+pid+"' "); - return this.emergencyConfigureDao.deleteByWhere(emergencyConfigure); - } - - @Override - public List selectListByWhere(String where) { - EmergencyConfigure emergencyConfigure= new EmergencyConfigure(); - emergencyConfigure.setWhere(where); - return this.emergencyConfigureDao.selectListByWhere(emergencyConfigure); - } - - @Override - public List selectusernameByWhere(String where) { - EmergencyConfigure emergencyConfigure= new EmergencyConfigure(); - emergencyConfigure.setWhere(where); - return this.emergencyConfigureDao.getListByuser(emergencyConfigure); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(EmergencyConfigure k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(EmergencyConfigure k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - List tags = new ArrayList(); - tags.add(k.getDescription()); - m.put("tags", tags); - m.put("type", k.getType()); - childlist.add(m); - } - } - if(childlist.size()>0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - - private static final String CK_IMAGE_PATH = File.separator + "uploadImage"; - @Override - public Map ckEditorUploadImage(MultipartFile file, - HttpServletRequest request) { - if(file==null || "".equals(file.getOriginalFilename().trim())) { - return generateResult(false, "#"); - } - String originalName = file.getOriginalFilename(); - // generate file name - String localFileName = System.currentTimeMillis() + "-" + originalName; - // get project path - String projectRealPath = request.getSession().getServletContext().getRealPath(""); - // get the real path to store received images - String realPath = projectRealPath + CK_IMAGE_PATH; - File imageDir = new File(realPath); - if(!imageDir.exists()) { - imageDir.mkdirs(); - } - - String localFilePath = realPath + File.separator + localFileName; - try { - file.transferTo(new File(localFilePath)); - } catch (IllegalStateException e) { - e.printStackTrace(); - // log here - } catch (IOException e) { - e.printStackTrace(); - // log here - } - String imageContextPath = request.getContextPath() + "/uploadImage" + "/" + localFileName; - // log here + - System.out.println("received file original name: " + originalName); - System.out.println("stored local file name: " + localFileName); - System.out.println("file stored path: " + localFilePath); - System.out.println("returned url: " + imageContextPath); - // log here - - return generateResult(true, imageContextPath); - } - - @Override - public EmergencyConfigure selectByWhere(String where) { - EmergencyConfigure emergencyConfigure= new EmergencyConfigure(); - emergencyConfigure.setWhere(where); - return this.emergencyConfigureDao.selectByWhere(emergencyConfigure); - } - - private Map generateResult(boolean uploaded, String relativeUrl){ - Map result = new HashMap(); - result.put("uploaded", uploaded + ""); - result.put("url", relativeUrl); - - return result; - } - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureWorkOrderService.java b/src/com/sipai/service/command/EmergencyConfigureWorkOrderService.java deleted file mode 100644 index a9c21985..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureWorkOrderService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import com.sipai.entity.command.EmergencyConfigureWorkOrder; -import com.sipai.entity.command.EmergencyRecords; - -public interface EmergencyConfigureWorkOrderService { - public List selectListByWhere(String where); - - public int update(EmergencyConfigureWorkOrder emergencyConfigureWorkOrder); - - public int save(EmergencyConfigureWorkOrder emergencyConfigureWorkOrder); - - public List selectworkorderrecordslistByWhere(String where); - - public int delete(String id); - -} diff --git a/src/com/sipai/service/command/EmergencyConfigureWorkOrderServiceImpl.java b/src/com/sipai/service/command/EmergencyConfigureWorkOrderServiceImpl.java deleted file mode 100644 index e1b6222d..00000000 --- a/src/com/sipai/service/command/EmergencyConfigureWorkOrderServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.command.EmergencyConfigureWorkOrderDao; -import com.sipai.dao.command.EmergencyRecordsDetailDao; -import com.sipai.entity.command.EmergencyConfigureWorkOrder; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.command.EmergencyRecordsDetail; - -@Service("emergencyConfigureWorkOrderService") -public class EmergencyConfigureWorkOrderServiceImpl implements EmergencyConfigureWorkOrderService{ - @Resource - private EmergencyConfigureWorkOrderDao emergencyConfigureWorkOrderDao; - - @Override - public int save(EmergencyConfigureWorkOrder emergencyConfigureWorkOrder) { - return this.emergencyConfigureWorkOrderDao.insert(emergencyConfigureWorkOrder); - } - - @Override - public List selectListByWhere(String where) { - EmergencyConfigureWorkOrder emergencyConfigureWorkOrder= new EmergencyConfigureWorkOrder(); - emergencyConfigureWorkOrder.setWhere(where); - return this.emergencyConfigureWorkOrderDao.selectListByWhere(emergencyConfigureWorkOrder); - } - - @Override - public int update(EmergencyConfigureWorkOrder emergencyConfigureWorkOrder) { - return this.emergencyConfigureWorkOrderDao.updateByPrimaryKeySelective(emergencyConfigureWorkOrder); - } - - @Override - public List selectworkorderrecordslistByWhere(String where) { - EmergencyConfigureWorkOrder emergencyConfigureWorkOrder= new EmergencyConfigureWorkOrder(); - emergencyConfigureWorkOrder.setWhere(where); - return this.emergencyConfigureWorkOrderDao.getListByrecords(emergencyConfigureWorkOrder); - } - - @Override - public int delete(String id) { - return this.emergencyConfigureWorkOrderDao.deleteByPrimaryKey(id); - } - -} diff --git a/src/com/sipai/service/command/EmergencyConfigurefileService.java b/src/com/sipai/service/command/EmergencyConfigurefileService.java deleted file mode 100644 index fa9fd606..00000000 --- a/src/com/sipai/service/command/EmergencyConfigurefileService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import com.sipai.entity.command.EmergencyConfigurefile; - -public interface EmergencyConfigurefileService { - public List selectListByWhere(String where); - -} diff --git a/src/com/sipai/service/command/EmergencyConfigurefileServiceImpl.java b/src/com/sipai/service/command/EmergencyConfigurefileServiceImpl.java deleted file mode 100644 index b5cf6157..00000000 --- a/src/com/sipai/service/command/EmergencyConfigurefileServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.command.EmergencyConfigurefileDao; -import com.sipai.entity.command.EmergencyConfigurefile; - -@Service("emergencyConfigurefileService") -public class EmergencyConfigurefileServiceImpl implements EmergencyConfigurefileService{ - - @Resource - private EmergencyConfigurefileDao emergencyConfigurefileDao; - @Override - public List selectListByWhere(String where) { - EmergencyConfigurefile emergencyConfigurefile= new EmergencyConfigurefile(); - emergencyConfigurefile.setWhere(where); - return this.emergencyConfigurefileDao.selectListByWhere(emergencyConfigurefile); - } - -} diff --git a/src/com/sipai/service/command/EmergencyPlanService.java b/src/com/sipai/service/command/EmergencyPlanService.java deleted file mode 100644 index d39cd113..00000000 --- a/src/com/sipai/service/command/EmergencyPlanService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.service.command; - - -import com.sipai.entity.command.EmergencyPlan; -import com.sipai.entity.user.User; - -import java.util.List; - -/** - * 应急预案计划 - */ -public interface EmergencyPlanService { - public abstract EmergencyPlan selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EmergencyPlan entity); - - public abstract int update(EmergencyPlan entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int doChoice(String checkedIds, String unitId, User cu); - - public abstract int dodown(String ids, User cu,String statusPlan); - /** - * 报警触发应急预案 - * @param mpid 报警点位 - * @param cu 触发用户,可以为null,默认超级管理员 - * @return 返回触发数量,0为失败,大于0为成功触发数量 - */ - public abstract int alarmDown(String mpid,User cu); -} diff --git a/src/com/sipai/service/command/EmergencyRecordsDetailService.java b/src/com/sipai/service/command/EmergencyRecordsDetailService.java deleted file mode 100644 index 8eab0da4..00000000 --- a/src/com/sipai/service/command/EmergencyRecordsDetailService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - - - - - -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.command.EmergencyRecordsDetail; - -public interface EmergencyRecordsDetailService { - public int save(EmergencyRecordsDetail emergencyRecordsDetail); - - public List selectrankListByWhere(String where); - - public List selectcontentListByWhere(String where); - - public List selectListByWhere(String where); - - public int update(EmergencyRecordsDetail emergencyRecordsDetail); - - public EmergencyRecordsDetail getMenuById(String menuId); - - public EmergencyRecordsDetail selectByWhere(String where); - - //给仿真接口 - public List selectListForJson(String wherestr); - - public int deleteByWhere(String t); -} \ No newline at end of file diff --git a/src/com/sipai/service/command/EmergencyRecordsDetailServiceImpl.java b/src/com/sipai/service/command/EmergencyRecordsDetailServiceImpl.java deleted file mode 100644 index f677d8af..00000000 --- a/src/com/sipai/service/command/EmergencyRecordsDetailServiceImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.command.EmergencyRecordsDao; -import com.sipai.dao.command.EmergencyRecordsDetailDao; -import com.sipai.entity.command.EmergencyConfigureInfo; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.command.EmergencyRecordsDetail; - -@Service("emergencyRecordsDetailService") -public class EmergencyRecordsDetailServiceImpl implements EmergencyRecordsDetailService { - @Resource - private EmergencyRecordsDetailDao emergencyRecordsDetailDao; - - @Override - public int save(EmergencyRecordsDetail emergencyRecordsDetail) { - return this.emergencyRecordsDetailDao.insert(emergencyRecordsDetail); - } - - @Override - public List selectrankListByWhere(String where) { - EmergencyRecordsDetail emergencyRecordsDetail= new EmergencyRecordsDetail(); - emergencyRecordsDetail.setWhere(where); - return this.emergencyRecordsDetailDao.getListByrank(emergencyRecordsDetail); - } - - @Override - public List selectcontentListByWhere(String where) { - EmergencyRecordsDetail emergencyRecordsDetail= new EmergencyRecordsDetail(); - emergencyRecordsDetail.setWhere(where); - return this.emergencyRecordsDetailDao.getListBycontent(emergencyRecordsDetail); - } - - @Override - public List selectListByWhere(String where) { - EmergencyRecordsDetail emergencyRecordsDetail= new EmergencyRecordsDetail(); - emergencyRecordsDetail.setWhere(where); - return this.emergencyRecordsDetailDao.selectListByWhere(emergencyRecordsDetail); - } - - @Override - public int update(EmergencyRecordsDetail emergencyRecordsDetail) { - return this.emergencyRecordsDetailDao.updateByPrimaryKeySelective(emergencyRecordsDetail); - } - - @Override - public EmergencyRecordsDetail getMenuById(String menuId) { - return this.emergencyRecordsDetailDao.selectByPrimaryKey(menuId); - } - - @Override - public EmergencyRecordsDetail selectByWhere(String where) { - EmergencyRecordsDetail emergencyRecordsDetail= new EmergencyRecordsDetail(); - emergencyRecordsDetail.setWhere(where); - return this.emergencyRecordsDetailDao.selectByWhere(emergencyRecordsDetail); - } - - @Override - public List selectListForJson(String wherestr){ - EmergencyRecordsDetail entity = new EmergencyRecordsDetail(); - entity.setWhere(wherestr); - List list = this.emergencyRecordsDetailDao.selectListForJson(entity); - return list; - } - - @Override - public int deleteByWhere(String t) { - EmergencyRecordsDetail entity = new EmergencyRecordsDetail(); - entity.setWhere(t); - return emergencyRecordsDetailDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/command/EmergencyRecordsService.java b/src/com/sipai/service/command/EmergencyRecordsService.java deleted file mode 100644 index 6808697c..00000000 --- a/src/com/sipai/service/command/EmergencyRecordsService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyConfigureDetail; -import com.sipai.entity.command.EmergencyRecords; -import com.sipai.entity.user.User; - -public interface EmergencyRecordsService { - - public int save(EmergencyRecords emergencyRecords); - - public EmergencyRecords getMenuById(String menuId); - - public int updateMenu(EmergencyRecords emergencyRecords); - - public List selectListByWhere(String where); - - public int deleteMenuById(String menuId); - - public List selectrecordslistByWhere(String where); - - public List selectTypeCountByWhere(String where); - - public List selectAllCountByWhere(String where); - - public List selectAllCountByWhereAsc(String where); - - public List selectAllCountByWhereDesc(String where); - - int doChoice(String checkedIds, String unitId, User cu); -} diff --git a/src/com/sipai/service/command/EmergencyRecordsServiceImpl.java b/src/com/sipai/service/command/EmergencyRecordsServiceImpl.java deleted file mode 100644 index 42e42207..00000000 --- a/src/com/sipai/service/command/EmergencyRecordsServiceImpl.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.sipai.service.command; - -import com.sipai.dao.command.EmergencyRecordsDao; -import com.sipai.entity.command.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - - -@Service("emergencyRecordsService") -public class EmergencyRecordsServiceImpl implements EmergencyRecordsService{ - - @Resource - private EmergencyRecordsDao emergencyRecordsDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private EmergencyConfigureService emergencyConfigureService; - @Resource - private EmergencyConfigureInfoService emergencyConfigureInfoService; - @Resource - private EmergencyRecordsDetailService emergencyRecordsDetailService; - @Resource - private EmergencyConfigureWorkOrderService emergencyConfigureWorkOrderService; - @Resource - private EmergencyRecordsWorkOrderService emergencyRecordsWorkOrderService; - - @Override - public int save(EmergencyRecords emergencyRecords) { - return this.emergencyRecordsDao.insert(emergencyRecords); - } - - @Override - public EmergencyRecords getMenuById(String menuId) { - EmergencyRecords item = this.emergencyRecordsDao.selectByPrimaryKey(menuId); - List users = null; - String firstperson = ""; - String _firstperson = ""; - String starter = ""; - String _starter = ""; - if(item!=null){ - if(item.getFirstperson()!=null && !item.getFirstperson().isEmpty()){ - firstperson = item.getFirstperson(); - firstperson = firstperson.replace(",", "','"); - users = this.userService.selectListByWhere("where id in ('"+firstperson+"') order by id"); - if(users!=null && users.size()>0){ - _firstperson = ""; - for(User user: users){ - _firstperson += user.getCaption()+","; - } - _firstperson = _firstperson.substring(0, _firstperson.length()-1); - } - item.set_firstPerson(_firstperson); - } - if(item.getStarter()!=null && !item.getStarter().isEmpty()){ - starter = item.getStarter(); - starter = starter.replace(",", "','"); - users = this.userService.selectListByWhere("where id in ('"+starter+"') order by id"); - if(users!=null && users.size()>0){ - _starter = ""; - for(User user: users){ - _starter += user.getCaption()+","; - } - _starter = _starter.substring(0, _starter.length()-1); - } - item.set_starter(_starter); - } - } - return item; - } - - @Override - public int updateMenu(EmergencyRecords emergencyRecords) { - return this.emergencyRecordsDao.updateByPrimaryKeySelective(emergencyRecords); - } - - @Override - public int deleteMenuById(String menuId) { - return this.emergencyRecordsDao.deleteByPrimaryKey(menuId); - } - - @Override - public List selectListByWhere(String where) { - EmergencyRecords emergencyRecords= new EmergencyRecords(); - emergencyRecords.setWhere(where); - List list = this.emergencyRecordsDao.selectListByWhere(emergencyRecords); - if(list!=null && list.size()>0){ - List users = null; - String firstperson = ""; - String _firstperson = ""; - String starter = ""; - String _starter = ""; - for(EmergencyRecords item : list){ - if(item.getFirstperson()!=null && !item.getFirstperson().isEmpty()){ - firstperson = item.getFirstperson(); - firstperson = firstperson.replace(",", "','"); - users = this.userService.selectListByWhere("where id in ('"+firstperson+"') order by id"); - if(users!=null && users.size()>0){ - _firstperson = ""; - for(User user: users){ - _firstperson += user.getCaption()+","; - } - _firstperson = _firstperson.substring(0, _firstperson.length()-1); - } - item.set_firstPerson(_firstperson); - } - if(item.getStarter()!=null && !item.getStarter().isEmpty()){ - starter = item.getStarter(); - starter = starter.replace(",", "','"); - users = this.userService.selectListByWhere("where id in ('"+starter+"') order by id"); - if(users!=null && users.size()>0){ - _starter = ""; - for(User user: users){ - _starter += user.getCaption()+","; - } - _starter = _starter.substring(0, _starter.length()-1); - } - item.set_starter(_starter); - } - } - } - return list; - } - - @Override - public List selectrecordslistByWhere(String where) { - EmergencyRecords emergencyRecords= new EmergencyRecords(); - emergencyRecords.setWhere(where); - List list = this.emergencyRecordsDao.getListByrecords(emergencyRecords); - return list; - } - - @Override - public List selectTypeCountByWhere(String where) { - EmergencyRecords emergencyRecords= new EmergencyRecords(); - emergencyRecords.setWhere(where); - return this.emergencyRecordsDao.getTypeCountByrecords(emergencyRecords); - } - - @Override - public List selectAllCountByWhere(String where) { - EmergencyRecords emergencyRecords= new EmergencyRecords(); - emergencyRecords.setWhere(where); - return this.emergencyRecordsDao.getAllCountByrecords(emergencyRecords); - } - - @Override - public List selectAllCountByWhereAsc(String where) { - EmergencyRecords emergencyRecords= new EmergencyRecords(); - emergencyRecords.setWhere(where); - return this.emergencyRecordsDao.getAllCountByrecordsAsc(emergencyRecords); - } - - @Override - public List selectAllCountByWhereDesc(String where) { - EmergencyRecords emergencyRecords= new EmergencyRecords(); - emergencyRecords.setWhere(where); - return this.emergencyRecordsDao.getAllCountByrecordsDesc(emergencyRecords); - } - - public int doChoice(String checkedIds, String unitId, User cu) { - int res = 0; - if (checkedIds != null && !checkedIds.equals("")) { - String[] checkedId = checkedIds.split(","); - EmergencyConfigure emergencyConfigure =new EmergencyConfigure(); - EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - String emergencyRecordId = ""; - for (int c = 0; c < checkedId.length; c++) { - emergencyConfigure = this.emergencyConfigureService.getMenuById(checkedId[c]); - if (emergencyConfigure != null) { - Company company = this.unitService.getCompById(emergencyConfigure.getBizid()); - emergencyRecordId = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - /* - * 先对演练记录的主表插入数据 - */ - EmergencyRecords emergencyRecords = new EmergencyRecords(); - emergencyRecords.setId(emergencyRecordId); - emergencyRecords.setInsuser(cu.getId()); - emergencyRecords.setInsdt(CommUtil.nowDate()); - emergencyRecords.setBizid(emergencyConfigure.getBizid()); - emergencyRecords.setStarter(cu.getId());//演练/启动人 - emergencyRecords.setStarttime(CommUtil.nowDate());//启动时间 - emergencyRecords.setStatus(EmergencyRecords.Status_Start); - //计划外 - emergencyRecords.setStatusPlan(EmergencyRecords.Outside); - emergencyRecords.setGrade(emergencyConfigure.getGrade()); -// emergencyRecords.setFirstmenu(firstId); -// emergencyRecords.setSecondmenu(secondId); - emergencyRecords.setThirdmenu(emergencyConfigure.getId()); - emergencyRecords.setType(1);//0为实际预案 1为预案演练 - emergencyRecords.setName(emergencyConfigure.getName()); - emergencyRecords.setFirstperson(emergencyConfigure.getFirstpersonid()); - res += this.save(emergencyRecords); - - /* - * 插入附表记录---从配置的附表插入到记录的附表 - */ - //dosaveDetail - List list = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + emergencyConfigure.getId() + "'"); - if (list != null && list.size() > 0) { - emergencyRecordsDetail = new EmergencyRecordsDetail(); - for (int i = 0; i < list.size(); i++) { - String nodeid = CommUtil.getUUID(); - emergencyRecordsDetail.setId(nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(emergencyRecordId); - emergencyRecordsDetail.setStatus("0"); - emergencyRecordsDetail.setOrd(list.get(i).getOrd()); - emergencyRecordsDetail.setRank(list.get(i).getRank()); - emergencyRecordsDetail.setPersonliableid(list.get(i).getPersonliableid()); - emergencyRecordsDetail.setPersonliablename(list.get(i).getPersonliablename()); - emergencyRecordsDetail.setVisualization(list.get(i).getVisualization()); - emergencyRecordsDetail.setContents(list.get(i).getContents()); - emergencyRecordsDetail.setContentdetail(list.get(i).getContentsdetail()); - emergencyRecordsDetail.setItemnumber(list.get(i).getItemnumber()); - emergencyRecordsDetail.setStartupcondition(list.get(i).getStartupcondition()); - emergencyRecordsDetail.setCorresponding(list.get(i).getCorresponding()); - emergencyRecordsDetail.setIssuer(list.get(i).getIssuer()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); -// //添加节点下面的预设工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + list.get(i).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - for (int j = 0; j < listorder.size(); j++) { - - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(j).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(j).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(j).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(nodeid);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(null);//Plan主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - } - } - } - return res; - } -} diff --git a/src/com/sipai/service/command/EmergencyRecordsWorkOrderService.java b/src/com/sipai/service/command/EmergencyRecordsWorkOrderService.java deleted file mode 100644 index 67cafa16..00000000 --- a/src/com/sipai/service/command/EmergencyRecordsWorkOrderService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.command; - -import java.util.List; - -import com.sipai.entity.command.EmergencyConfigure; -import com.sipai.entity.command.EmergencyRecordsWorkOrder; - -public interface EmergencyRecordsWorkOrderService { - - public int save(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder); - - public int update(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder); - - public List selectusernameByWhere(String where); - - public List selectcompanynameByWhere(String where); - - public List selectlistlayerByWhere(String where); - -} diff --git a/src/com/sipai/service/command/EmergencyRecordsWorkOrderServiceImpl.java b/src/com/sipai/service/command/EmergencyRecordsWorkOrderServiceImpl.java deleted file mode 100644 index 25e7447d..00000000 --- a/src/com/sipai/service/command/EmergencyRecordsWorkOrderServiceImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.service.command; - -import com.sipai.dao.command.EmergencyRecordsWorkOrderDao; -import com.sipai.entity.command.EmergencyRecordsWorkOrder; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.UserService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - - -@Service("emergencyRecordsWorkOrderService") -public class EmergencyRecordsWorkOrderServiceImpl implements EmergencyRecordsWorkOrderService { - @Resource - private EmergencyRecordsWorkOrderDao emergencyRecordsWorkOrderDao; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private UserService userService; - - @Transactional - @Override - public int save(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder) { - /*try { - if(emergencyRecordsWorkOrder.getStatus()!=0){ - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setId(emergencyRecordsWorkOrder.getPatrolRecordId()); - patrolRecord.setInsdt(CommUtil.nowDate()); - patrolRecord.setBizId(""); - patrolRecord.setStartTime(CommUtil.nowDate()); - patrolRecord.setEndTime(CommUtil.getStartTimeByFreq(CommUtil.nowDate(), -1, "hour", true)); - patrolRecord.setName("应急预案临时任务"); - patrolRecord.setContent(emergencyRecordsWorkOrder.getWorkcontent()); - patrolRecord.setStatus(PatrolRecord.Status_Issue); - patrolRecord.setType("P"); - patrolRecord.setPatrolModelId("temp"); - patrolRecord.setWorkerId(emergencyRecordsWorkOrder.getWorkreceiveuserid()); - int res = patrolRecordService.save(patrolRecord); - if (res == 1) { - - } - } - } catch (Exception e) { - System.out.println(e); - }*/ - return this.emergencyRecordsWorkOrderDao.insert(emergencyRecordsWorkOrder); - } - - @Override - public int update(EmergencyRecordsWorkOrder emergencyRecordsWorkOrder) { - /*try { - if(emergencyRecordsWorkOrder.getStatus()!=0){ - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setId(emergencyRecordsWorkOrder.getPatrolRecordId()); - patrolRecord.setInsdt(CommUtil.nowDate()); - patrolRecord.setBizId(""); - patrolRecord.setStartTime(CommUtil.nowDate()); - patrolRecord.setEndTime(CommUtil.getStartTimeByFreq(CommUtil.nowDate(), -1, "hour", true)); - patrolRecord.setName("应急预案临时任务"); - patrolRecord.setContent(emergencyRecordsWorkOrder.getWorkcontent()); - patrolRecord.setStatus(PatrolRecord.Status_Issue); - patrolRecord.setType("P"); - patrolRecord.setPatrolModelId("temp"); - patrolRecord.setWorkerId(emergencyRecordsWorkOrder.getWorkreceiveuserid()); - int res = patrolRecordService.save(patrolRecord); - if (res == 1) { - - } - } - } catch (Exception e) { - System.out.println(e); - }*/ - return this.emergencyRecordsWorkOrderDao.updateByPrimaryKeySelective(emergencyRecordsWorkOrder); - } - - @Override - public List selectusernameByWhere(String where) { - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - emergencyRecordsWorkOrder.setWhere(where); - return this.emergencyRecordsWorkOrderDao.getListByuser(emergencyRecordsWorkOrder); - } - - @Override - public List selectcompanynameByWhere(String where) { - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - emergencyRecordsWorkOrder.setWhere(where); - return this.emergencyRecordsWorkOrderDao.getListBycompany(emergencyRecordsWorkOrder); - } - - @Override - public List selectlistlayerByWhere(String where) { - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - emergencyRecordsWorkOrder.setWhere(where); - List list = this.emergencyRecordsWorkOrderDao.getListBylayer(emergencyRecordsWorkOrder); - for (EmergencyRecordsWorkOrder entity : list) { - PatrolRecord patrolRecord = patrolRecordService.selectById(entity.getPatrolRecordId()); - if (patrolRecord != null) { - entity.setPatrolRecord(patrolRecord); - } - if (StringUtils.isNotBlank(entity.getWorksenduser())) { - entity.set_worksenduser(userService.getUserById(entity.getWorksenduser()).getCaption()); - } - if (StringUtils.isNotBlank(entity.getWorkreceiveuser())) { - try { - entity.set_workreceiveuser(userService.getUserById(entity.getWorkreceiveuser()).getCaption()); - }catch (Exception e){ - entity.set_workreceiveuser(""); - } - } - } - return list; - } - -} diff --git a/src/com/sipai/service/command/impl/EmergencyPlanServiceImpl.java b/src/com/sipai/service/command/impl/EmergencyPlanServiceImpl.java deleted file mode 100644 index 98279fdc..00000000 --- a/src/com/sipai/service/command/impl/EmergencyPlanServiceImpl.java +++ /dev/null @@ -1,356 +0,0 @@ -package com.sipai.service.command.impl; - -import com.sipai.dao.command.EmergencyPlanDao; -import com.sipai.entity.command.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.command.*; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.transaction.Transactional; -import java.util.List; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2021/10/23/10:25 - * @Description: - */ -@Service -public class EmergencyPlanServiceImpl implements EmergencyPlanService { - @Resource - private EmergencyPlanDao emergencyPlanDao; - @Resource - private EmergencyConfigureService emergencyConfigureService; - @Resource - private CompanyService companyService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private EmergencyRecordsService emergencyRecordsService; - @Resource - private EmergencyConfigureInfoService emergencyConfigureInfoService; - @Resource - private EmergencyRecordsDetailService emergencyRecordsDetailService; - @Resource - private EmergencyConfigureWorkOrderService emergencyConfigureWorkOrderService; - @Resource - private EmergencyRecordsWorkOrderService emergencyRecordsWorkOrderService; - - @Override - public EmergencyPlan selectById(String id) { - return emergencyPlanDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return emergencyPlanDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EmergencyPlan entity) { - return emergencyPlanDao.insert(entity); - } - - @Override - public int update(EmergencyPlan entity) { - return emergencyPlanDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EmergencyPlan emergencyPlan = new EmergencyPlan(); - emergencyPlan.setWhere(wherestr); - List list = emergencyPlanDao.selectListByWhere(emergencyPlan); - for (EmergencyPlan entity : list) { - //查询配置 - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(entity.getEmergencyConfigureId()); - entity.setEmergencyConfigure(emergencyConfigure); - Company company = companyService.selectByPrimaryKey(entity.getUnitId()); - entity.setCompany(company); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EmergencyPlan emergencyPlan = new EmergencyPlan(); - emergencyPlan.setWhere(wherestr); - return emergencyPlanDao.deleteByWhere(emergencyPlan); - } - - @Transactional - @Override - public int doChoice(String checkedIds, String unitId, User cu) { - int res = 0; - if (checkedIds != null && !checkedIds.equals("")) { - EmergencyPlan emergencyPlan = new EmergencyPlan(); - String[] checkedId = checkedIds.split(","); - for (int i = 0; i < checkedId.length; i++) { - emergencyPlan.setId(CommUtil.getUUID()); - emergencyPlan.setInsdt(CommUtil.nowDate()); - emergencyPlan.setInsdt(cu.getInsdt()); - emergencyPlan.setStatus(EmergencyPlan.Status_NoStart); - emergencyPlan.setPlanDate(CommUtil.nowDate()); - emergencyPlan.setEmergencyConfigureId(checkedId[i]); - emergencyPlan.setUnitId(unitId); - res += emergencyPlanDao.insert(emergencyPlan); - } - } - return res; - } - - /** - * 报警触发应急预案 - * @param mpid 报警点位 - * @param cu 触发用户,可以为null,默认超级管理员 - * @return 返回触发数量,0为失败,大于0为成功触发数量 - */ - @Transactional - @Override - public int alarmDown(String mpid,User cu) { - if(cu==null){ - cu = userService.getUserById("emp01"); - } - int res = 0; - if (mpid != null && !mpid.equals("")) { - List emergencyRecords = this.emergencyRecordsService.selectListByWhere("where mpointcodes='"+mpid+"' and status='"+EmergencyRecords.Status_Start+"' "); - //进行中的不再次演练 - if(emergencyRecords!=null && emergencyRecords.size()>0){ - res=1; - }else{ - String outside = EmergencyRecords.Outside; - List emergencyConfigures = emergencyConfigureService.selectListByWhere("where mpointcodes='"+mpid+"' and st='启用' and alarm_st=1 "); - if (emergencyConfigures != null && emergencyConfigures.size() > 0) { - for (EmergencyConfigure emergencyConfigure:emergencyConfigures) { - Company company = this.unitService.getCompById(emergencyConfigure.getBizid()); - String emergencyRecordId = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - //计划外 - res = dodown( emergencyConfigure.getId(), emergencyRecordId, cu, outside, null); - } - } - } - } - return res; - } - @Transactional - @Override - public int dodown(String ids, User cu ,String statusPlan) { - String inside = EmergencyRecords.Inside; - String outside = EmergencyRecords.Outside; - int res = 0; - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - if (id != null && id.length > 0) { - for (int a = 0; a < id.length; a++) { - String emergencyRecordId = CommUtil.getUUID(); - if(inside.equals(statusPlan)){ - //计划内 - EmergencyPlan emergencyPlan = emergencyPlanDao.selectByPrimaryKey(id[a]); - if (emergencyPlan != null) { - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyPlan.getEmergencyConfigureId()); - Company company = this.unitService.getCompById(emergencyConfigure.getBizid()); - emergencyRecordId = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - //修改计划的状态 - emergencyPlan.setStatus(EmergencyPlan.Status_Start); - emergencyPlan.setEmergencyRecordId(emergencyRecordId); - emergencyPlanDao.updateByPrimaryKeySelective(emergencyPlan); - res = dodown( emergencyPlan.getEmergencyConfigureId(), emergencyRecordId, cu, statusPlan, id[a]); - } - }else{ - if(outside.equals(statusPlan)){ - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(id[a]); - Company company = this.unitService.getCompById(emergencyConfigure.getBizid()); - emergencyRecordId = company.getEname()+"-YAYL-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - //计划外 - res = dodown( id[a], emergencyRecordId, cu, statusPlan, null); - } - } - } - } - } - return res; - } - public int dodown(String emergencyConfigureId,String emergencyRecordId, User cu,String statusPlan,String planid) { - if(planid==null){ - planid = emergencyRecordId; - } - int res = 0; - EmergencyRecordsDetail emergencyRecordsDetail = new EmergencyRecordsDetail(); - EmergencyRecordsWorkOrder emergencyRecordsWorkOrder = new EmergencyRecordsWorkOrder(); - EmergencyConfigure emergencyConfigure = emergencyConfigureService.getMenuById(emergencyConfigureId); - if (emergencyConfigure != null) { - /* - * 先对演练记录的主表插入数据 - */ - EmergencyRecords emergencyRecords = new EmergencyRecords(); - emergencyRecords.setId(emergencyRecordId); - emergencyRecords.setInsuser(cu.getId()); - emergencyRecords.setInsdt(CommUtil.nowDate()); - emergencyRecords.setBizid(emergencyConfigure.getBizid()); - emergencyRecords.setStarter(cu.getId());//演练/启动人 - emergencyRecords.setStarttime(CommUtil.nowDate());//启动时间 - emergencyRecords.setStatus(EmergencyRecords.Status_Start); - //计划内、计划外 - emergencyRecords.setStatusPlan(statusPlan); - emergencyRecords.setGrade(emergencyConfigure.getGrade()); -// emergencyRecords.setFirstmenu(firstId); -// emergencyRecords.setSecondmenu(secondId); - emergencyRecords.setThirdmenu(emergencyConfigure.getId()); - emergencyRecords.setType(1);//0为实际预案 1为预案演练 - emergencyRecords.setName(emergencyConfigure.getName()); - emergencyRecords.setFirstperson(emergencyConfigure.getFirstpersonid()); - //报警点 - emergencyRecords.setMpointcodes(emergencyConfigure.getMpointcodes()); - //流程节点 - emergencyRecords.setNodes(emergencyConfigure.getNodes()); - res += this.emergencyRecordsService.save(emergencyRecords); - //查询步骤 - List stepList= emergencyConfigureService.selectListByWhere( - "where pid = '"+emergencyConfigure.getId()+"' and type='"+EmergencyConfigure.Type_Step+"' and st='启用' order by ord"); - - if (stepList != null && stepList.size() > 0) { - //如果有步骤,则附表分为两层,第一层为步骤数据,第二层为节点数据,其中节点数据pid为步骤id。 - for (int i = 0; i < stepList.size(); i++) { - EmergencyConfigure step = stepList.get(i); - emergencyRecordsDetail = new EmergencyRecordsDetail(); - //为了改动少,通过id增加后缀区分步骤和节点,带后缀为步骤。 - String nodeid = CommUtil.getUUID()+"-"+EmergencyConfigure.Type_Step; - emergencyRecordsDetail.setId(nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(emergencyRecordId); - if(i==0){ - //状态,0未开始,1进行中,2已完成 - emergencyRecordsDetail.setStatus("1"); - }else{ - emergencyRecordsDetail.setStatus("0"); - } - emergencyRecordsDetail.setOrd(step.getOrd()); - emergencyRecordsDetail.setRank(step.getOrd()); - emergencyRecordsDetail.setPersonliableid(step.getFirstpersonid()); - emergencyRecordsDetail.setPersonliablename(step.getFirstperson()); - emergencyRecordsDetail.setContents(step.getName()); - emergencyRecordsDetail.setContentdetail(step.getMemo()); - emergencyRecordsDetail.setItemnumber(step.getId()); - emergencyRecordsDetail.setStartupcondition(step.getStartingcondition()); - emergencyRecordsDetail.setEcdetailid(step.getId()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); - // 查找步骤下的节点 - List list = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + step.getId() + "'"); - if (list != null && list.size() > 0) { - for(EmergencyConfigureInfo info : list){ - String info_nodeid = CommUtil.getUUID(); - emergencyRecordsDetail.setId(info_nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(nodeid); - emergencyRecordsDetail.setStatus("0"); - emergencyRecordsDetail.setOrd(info.getOrd()); - emergencyRecordsDetail.setRank(info.getRank()); - emergencyRecordsDetail.setPersonliableid(info.getPersonliableid()); - emergencyRecordsDetail.setPersonliablename(info.getPersonliablename()); - emergencyRecordsDetail.setVisualization(info.getVisualization()); - emergencyRecordsDetail.setContents(info.getContents()); - emergencyRecordsDetail.setContentdetail(info.getContentsdetail()); - emergencyRecordsDetail.setItemnumber(info.getItemnumber()); - emergencyRecordsDetail.setStartupcondition(info.getStartupcondition()); - emergencyRecordsDetail.setCorresponding(info.getCorresponding()); - emergencyRecordsDetail.setIssuer(info.getIssuer()); - emergencyRecordsDetail.setEcdetailid(info.getId()); - emergencyRecordsDetail.setMemo(info.getMemo()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); - //添加节点下面的预设工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + info.getId() + "'"); - if (listorder != null && listorder.size() > 0) { - for (int j = 0; j < listorder.size(); j++) { - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(j).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(j).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(j).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(info_nodeid);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(planid);//Plan主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - } - }else{ - /* 没有步骤,直接写入节点,节点pid为预案演练id - * 插入附表记录---从配置的附表插入到记录的附表 - */ - //dosaveDetail - List list = this.emergencyConfigureInfoService - .selectListByWhere("where pid='" + emergencyConfigure.getId() + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - String nodeid = CommUtil.getUUID(); - emergencyRecordsDetail.setId(nodeid); - emergencyRecordsDetail.setInsdt(CommUtil.nowDate()); - emergencyRecordsDetail.setBizid(emergencyConfigure.getBizid()); - emergencyRecordsDetail.setPid(emergencyRecordId); - emergencyRecordsDetail.setStatus("0"); - emergencyRecordsDetail.setOrd(list.get(i).getOrd()); - emergencyRecordsDetail.setRank(list.get(i).getRank()); - emergencyRecordsDetail.setPersonliableid(list.get(i).getPersonliableid()); - emergencyRecordsDetail.setPersonliablename(list.get(i).getPersonliablename()); - emergencyRecordsDetail.setVisualization(list.get(i).getVisualization()); - emergencyRecordsDetail.setContents(list.get(i).getContents()); - emergencyRecordsDetail.setContentdetail(list.get(i).getContentsdetail()); - emergencyRecordsDetail.setItemnumber(list.get(i).getItemnumber()); - emergencyRecordsDetail.setStartupcondition(list.get(i).getStartupcondition()); - emergencyRecordsDetail.setCorresponding(list.get(i).getCorresponding()); - emergencyRecordsDetail.setIssuer(list.get(i).getIssuer()); - emergencyRecordsDetail.setEcdetailid(list.get(i).getId()); - emergencyRecordsDetail.setMemo(list.get(i).getMemo()); - this.emergencyRecordsDetailService.save(emergencyRecordsDetail); -// //添加节点下面的预设工单 - List listorder = this.emergencyConfigureWorkOrderService - .selectListByWhere("where nodeid='" + list.get(i).getId() + "'"); - if (listorder != null && listorder.size() > 0) { - for (int j = 0; j < listorder.size(); j++) { - - emergencyRecordsWorkOrder.setId(CommUtil.getUUID()); - emergencyRecordsWorkOrder.setInsdt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setInsuser(listorder.get(j).getInsuser()); - emergencyRecordsWorkOrder.setBizid(listorder.get(j).getBizid()); - emergencyRecordsWorkOrder.setWorksenduser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkreceiveuser(listorder.get(j).getWorkreceiveuser()); - emergencyRecordsWorkOrder.setWorkcontent(listorder.get(j).getWorkcontent()); - emergencyRecordsWorkOrder.setWorksenddt(CommUtil.nowDate()); - emergencyRecordsWorkOrder.setWorkfinishdt(null); - emergencyRecordsWorkOrder.setStatus(0); - emergencyRecordsWorkOrder.setNodeid(nodeid);//记录节点的id - emergencyRecordsWorkOrder.setRecordid(planid);//Plan主表id - emergencyRecordsWorkOrder.setWorkreceivedt(null); - emergencyRecordsWorkOrder.setWorkreceivecontent(null); - - this.emergencyRecordsWorkOrderService.save(emergencyRecordsWorkOrder); - } - } - } - } - } - } - return res; - } -} diff --git a/src/com/sipai/service/company/CompanyService.java b/src/com/sipai/service/company/CompanyService.java deleted file mode 100644 index 01e32ead..00000000 --- a/src/com/sipai/service/company/CompanyService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.company; - -import java.util.List; -import java.util.Map; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.equipment.EquipmentCardTree; -import com.sipai.entity.user.Company; - -public interface CompanyService { - Company selectByPrimaryKey(String companyId); - - List selectListByWhere(String sqlWhere); - - JSONArray getTreeJsonByCompany(List comapnyInfoList,JSONArray jsonArray); - - public JSONArray initEquipmentCardTree(List comapnyInfoList,JSONArray jsonArray); - - List selectEquipmentCardTree(EquipmentCardTree equipmentCardTree); - - public Map selectEquCardTreeConditionByPId(String pid,Map condition); - - List selectPumpCardTree(EquipmentCardTree equipmentCardTree); - - public Map selectpumpCardTreeConditionByPId(String pid,Map condition); -} diff --git a/src/com/sipai/service/company/CompanyServiceImpl.java b/src/com/sipai/service/company/CompanyServiceImpl.java deleted file mode 100644 index dcb16275..00000000 --- a/src/com/sipai/service/company/CompanyServiceImpl.java +++ /dev/null @@ -1,408 +0,0 @@ -package com.sipai.service.company; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.user.CompanyDao; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardTree; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.equipment.EquipmentBelongService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.user.ProcessSectionService; - -@Service("companyService") -public class CompanyServiceImpl implements CompanyService{ - - @Resource - private CompanyDao companyDao; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentBelongService equipmentBelongService; - - @Override - public Company selectByPrimaryKey(String companyId) { - // TODO Auto-generated method stub - return companyDao.selectByPrimaryKey(companyId); - - } - - @Override - public List selectListByWhere(String sqlWhere) { - // TODO Auto-generated method stub - Company company = new Company(); - company.setWhere(sqlWhere); - return companyDao.selectListByWhere(company); - } - - @Override - public JSONArray initEquipmentCardTree(List comapnyInfoList, - JSONArray jsonArray) { - - for (int i = 0; i < comapnyInfoList.size(); i++) { - JSONObject jsonObject = new JSONObject(); - String companyId=comapnyInfoList.get(i).getId(); - String name=comapnyInfoList.get(i).getSname(); - jsonObject.put("id",companyId); - jsonObject.put("name",name); - -/* JSONObject seaInfo = new JSONObject(); - seaInfo.put("companyId", companyId); - jsonObject.put("searchInfo",seaInfo);*/ - - List companies=selectListByWhere(" where pid ='"+companyId+"'"); - if(companies.size()!=0 ){ - JSONArray jsonArrayTemp = new JSONArray(); - JSONArray sonTreeByPid = initEquipmentCardTree(companies, jsonArrayTemp); - jsonObject.put("children", sonTreeByPid); - } - if(null!=jsonObject){ - jsonArray.add(jsonObject); - } - - } - - return jsonArray; - } -//------------------------------------------------------------------------------------------------------------ - //厂区>>水线(一期二期) - @Override - public JSONArray getTreeJsonByCompany(List comapnyInfoList, - JSONArray jsonArray) { - //JSONArray jsonArrayBToTemp = new JSONArray(); - //TODO Auto-generated method stub - for (int i = 0; i < comapnyInfoList.size(); i++) { - JSONObject jsonObject = new JSONObject(); - String companyId=comapnyInfoList.get(i).getId(); - String name=comapnyInfoList.get(i).getSname(); - jsonObject.put("id",companyId); - jsonObject.put("name",name); - - JSONObject seaInfo = new JSONObject(); - seaInfo.put("companyId", companyId); - jsonObject.put("searchInfo",seaInfo); - - List companies=selectListByWhere(" where pid ='"+companyId+"'"); - if(companies.size()!=0 ){ - JSONArray jsonArrayTemp = new JSONArray(); - JSONArray sonTreeByPid = getTreeJsonByCompany(companies, jsonArrayTemp); - jsonObject.put("children", sonTreeByPid); - }else{ - - List belongToList=equipmentBelongService.selectDistinctBeToByComapnyId(companyId); - if(null!=belongToList && belongToList.size() > 0){ - JSONArray jsonArrayBToTemp = new JSONArray(); - JSONArray jsonArrayBTo =getTreeJsonByBelong(companyId,belongToList,jsonArrayBToTemp); - if(null!=jsonArrayBTo && jsonArrayBTo.size() > 0 ){ - jsonObject.put("children", jsonArrayBTo); - } - } - } - if(null!=jsonObject){ - jsonArray.add(jsonObject); - } - //jsonArray.add(jsonObject); - } - - return jsonArray; - } - - //水线(一期二期)>>工艺段 - public JSONArray getTreeJsonByBelong(String companyId,List belongToList,JSONArray jsonArray) { - EquipmentCard equipmentCard = new EquipmentCard(); - for (int i = 0; i < belongToList.size(); i++) { - JSONObject jsonObject=null; - String sqlWhere = " where bizId='"+companyId+"'"+" and equipment_belong_id='"+belongToList.get(i)+"'"; - List eCardList=equipmentCardService.getEquipmentCardByWhere(sqlWhere);//.selectListByWhere(sqlWhere); - if(null!=eCardList && eCardList.size()>0){ - //去重 - Set pSecSet = new HashSet<>(); - for(EquipmentCard eqCardVar:eCardList){ - if(null!=eqCardVar.getProcesssectionid() && !"".equals(eqCardVar.getProcesssectionid())){ - pSecSet.add(eqCardVar.getProcesssectionid()); - - } - - } - for(String pSec:pSecSet){ - //JSONObject jsonObject = new JSONObject(); - jsonObject = new JSONObject(); - String bToId=belongToList.get(i); - EquipmentBelong bToTemp=equipmentBelongService.selectById(bToId); - String name=bToTemp.getBelongName(); - jsonObject.put("id",bToId); - jsonObject.put("name",name); - - JSONObject seaInfo = new JSONObject(); - seaInfo.put("companyId", companyId); - seaInfo.put("equipmentBelongId", bToId); - jsonObject.put("searchInfo",seaInfo); - - equipmentCard.setBizid(companyId); - equipmentCard.setEquipmentBelongId(bToId); - equipmentCard.setProcesssectionid(pSec); - - List processSectionList=processSectionService.selectDistinctProSecByBTo(equipmentCard); - JSONArray jsonArrayProSecTemp = new JSONArray(); - JSONArray jsonArrayProSec =getTreeJsonByProcessSection(bToId,companyId,processSectionList,jsonArrayProSecTemp); - if(null!=jsonArrayProSec && jsonArrayProSec.size() > 0 ){ - jsonObject.put("children", jsonArrayProSec); - } - - //jsonArray.add(jsonObject); - - } - } - if(null!=jsonObject){ - jsonArray.add(jsonObject); - } - //jsonArray.add(jsonObject); - } - return jsonArray; - } - - //工艺段>>大类 - public JSONArray getTreeJsonByProcessSection(String bToId,String companyId,List processSectionList,JSONArray jsonArray) { - EquipmentCard equipmentCard = new EquipmentCard(); - for (int i = 0; i < processSectionList.size(); i++) { - JSONObject jsonObject=null; - String sqlWhere =" where bizId='"+companyId+"'"+" and equipment_belong_id='"+bToId+"'"+" and processSectionId ='"+processSectionList.get(i)+"'"; - List eCardList=equipmentCardService.getEquipmentCardByWhere(sqlWhere);//.selectListByWhere(sqlWhere); - if(null!=eCardList && eCardList.size()>0){ - //去重 - Set bigClassSet = new HashSet<>(); - for(EquipmentCard eqCardVar:eCardList){ - if(null!=eqCardVar.getEquipmentBigClassId() && !"".equals(eqCardVar.getEquipmentBigClassId())){ - bigClassSet.add(eqCardVar.getEquipmentBigClassId()); - } - } - - for(String bigClass:bigClassSet){ - //JSONObject jsonObject = new JSONObject(); - jsonObject = new JSONObject(); - String proSecId=processSectionList.get(i); - ProcessSection proSecTemp=processSectionService.selectById(proSecId); - String name=proSecTemp.getName(); - jsonObject.put("id",proSecId); - jsonObject.put("name",name); - - JSONObject seaInfo = new JSONObject(); - seaInfo.put("companyId", companyId); - seaInfo.put("equipmentBelongId", bToId); - seaInfo.put("pSectionId", proSecId); - jsonObject.put("searchInfo",seaInfo); - - equipmentCard.setEquipmentBelongId(bToId); - equipmentCard.setBizid(companyId); - equipmentCard.setProcesssectionid(proSecId); - equipmentCard.setEquipmentBigClassId(bigClass); - - List equipmentBigClass=equipmentClassService.selectDistinctEquBigClass(equipmentCard); - - JSONArray equBigClassTemp = new JSONArray(); - JSONArray resultJSONArray=getTreeJsonByEquipmentBigClass(bToId,proSecId, companyId, equipmentBigClass, equBigClassTemp); - if(null!=resultJSONArray && resultJSONArray.size() > 0 ){ - jsonObject.put("children", resultJSONArray); - } - - // jsonArray.add(jsonObject); - } - - } - if(null!=jsonObject){ - jsonArray.add(jsonObject); - } - //jsonArray.add(jsonObject); - } - return jsonArray; - - } - - //大类>>小类 - public JSONArray getTreeJsonByEquipmentBigClass(String bToId,String proSecId,String companyId,List equipmentBigClass,JSONArray jsonArray) { - EquipmentCard equipmentCard = new EquipmentCard(); - for (int i = 0; i < equipmentBigClass.size(); i++) { - JSONObject jsonObject=null; - - String sqlWhere =" where bizId='"+companyId+"'"+" and equipment_belong_id='"+bToId+"'"+" and processSectionId ='"+proSecId+"'"+" and equipment_big_class_id ='"+equipmentBigClass.get(i)+"'"; - List eCardList=equipmentCardService.getEquipmentCardByWhere(sqlWhere);//.selectListByWhere(sqlWhere); - if(null!=eCardList && eCardList.size()>0){ - //去重 - Set smallClassSet = new HashSet<>(); - for(EquipmentCard eqCardVar:eCardList){ - if(null!=eqCardVar.getEquipmentclassid() && !"".equals(eqCardVar.getEquipmentclassid())){ - smallClassSet.add(eqCardVar.getEquipmentclassid()); - } - } - - for(String smallClass:smallClassSet){ - //JSONObject jsonObject = new JSONObject(); - jsonObject = new JSONObject(); - - String id=equipmentBigClass.get(i); - - EquipmentClass ec=equipmentClassService.selectById(id); - String name=ec.getName(); - jsonObject.put("id",id); - jsonObject.put("name",name); - - JSONObject seaInfo = new JSONObject(); - seaInfo.put("companyId", companyId); - seaInfo.put("equipmentBelongId", bToId); - seaInfo.put("pSectionId", proSecId); - seaInfo.put("equipmentBigClassId", id); - jsonObject.put("searchInfo",seaInfo); - - equipmentCard.setEquipmentBelongId(bToId); - equipmentCard.setBizid(companyId); - equipmentCard.setProcesssectionid(proSecId); - equipmentCard.setEquipmentBigClassId(id); - equipmentCard.setEquipmentclassid(smallClass); - List equipmentSmallClassList=equipmentClassService.selectEquSmallClassByBigClass(equipmentCard); - if(null!=equipmentSmallClassList && equipmentSmallClassList.size() > 0 ){ - JSONArray smallEClass=getSmallEClass(equipmentSmallClassList, companyId, bToId, proSecId, id); - jsonObject.put("children", smallEClass); - } - - //jsonArray.add(jsonObject); - } - } - if(null!=jsonObject){ - jsonArray.add(jsonObject); - } - //jsonArray.add(jsonObject); - } - return jsonArray; - - } - - //小类 - public JSONArray getSmallEClass(List equipmentSmallClassList,String companyId,String bToId,String proSecId,String bigEClass){ - JSONArray smallEClass = new JSONArray(); - Map smallClassMap=new HashMap<>(); - for(EquipmentClass eClass:equipmentSmallClassList){ - smallClassMap.put(eClass.getName(), eClass); - } - - for(Map.Entry entry:smallClassMap.entrySet()){ - JSONObject eClassTemp = new JSONObject(); - - String smallEClassId=entry.getValue().getId(); - String smallEClassName=entry.getValue().getName(); - eClassTemp.put("id",smallEClassId); - eClassTemp.put("name",smallEClassName); - - JSONObject seaInfoVar = new JSONObject(); - seaInfoVar.put("companyId", companyId); - seaInfoVar.put("equipmentBelongId", bToId); - seaInfoVar.put("pSectionId", proSecId); - seaInfoVar.put("equipmentBigClassId", bigEClass); - seaInfoVar.put("equipmentClass", smallEClassId); - eClassTemp.put("searchInfo",seaInfoVar); - smallEClass.add(eClassTemp); - } - return smallEClass; - } - - @Override - public List selectEquipmentCardTree(EquipmentCardTree equipmentCardTree) { - List equipmentCardTreeList=companyDao.selectEquipmentCardTree(equipmentCardTree); - return equipmentCardTreeList; - } - - @Override - public Map selectEquCardTreeConditionByPId(String pid, - Map condition) { - - EquipmentCardTree equipmentCardTree=companyDao.selectEquCardTreeConditionByPId(pid); - String idVar = equipmentCardTree.getId(); - String pidVar = equipmentCardTree.getPid(); - String flagVar = equipmentCardTree.getFlag(); - if(!"C".equals(flagVar)){ - switch(flagVar){ - case "B": - condition.put("equipment_belong_id", idVar); - break; - case "P": - condition.put("processSectionId", idVar); - break; - case "E": - condition.put("equipment_big_class_id", idVar); - break; - case "S": - condition.put("equipmentClassID", idVar); - break; - } - selectEquCardTreeConditionByPId(pidVar,condition); - }else{ - condition.put("bizId", idVar); - } - return condition; - - } - @Override - public List selectPumpCardTree(EquipmentCardTree equipmentCardTree) { - List equipmentCardTreeList=companyDao.selectPumpCardTree(equipmentCardTree); - return equipmentCardTreeList; - } - - @Override - public Map selectpumpCardTreeConditionByPId(String pid, - Map condition) { - - EquipmentCardTree equipmentCardTree=companyDao.selectpumpCardTreeConditionByPId(pid); - String idVar = equipmentCardTree.getId(); - String pidVar = equipmentCardTree.getPid(); - String flagVar = equipmentCardTree.getFlag(); - if(!"C".equals(flagVar)){ - switch(flagVar){ - case "B": - condition.put("equipment_belong_id = ", "'"+idVar+"'"); - break; - case "P": - condition.put("processSectionId = ", "'"+idVar+"'"); - break; - case "E": - condition.put("equipment_big_class_id = ", "'"+idVar+"'"); - break; - case "S": - condition.put("equipmentClassID = ", "'"+idVar+"'"); - break; - case "T": - - StringBuilder elIdAllStr = new StringBuilder(); - List processSections = this.processSectionService.selectListByWhere(" where process_section_type_id ='"+idVar+"' "); - for (ProcessSection processSection : processSections) { - elIdAllStr.append("'"+processSection.getId()+"'"+','); - } - - //wherestr += " and processSectionId in ("+ elIdAllStr.substring(0, elIdAllStr.length()-1)+") "; - condition.put("", "processSectionId in ("+ elIdAllStr.substring(0, elIdAllStr.length()-1)+")"); - break; - } - selectpumpCardTreeConditionByPId(pidVar,condition); - }else{ - condition.put("bizId = ", "'"+idVar+"'"); - } - return condition; - - } -} diff --git a/src/com/sipai/service/cqbyt/CqbytSampleValueService.java b/src/com/sipai/service/cqbyt/CqbytSampleValueService.java deleted file mode 100644 index 8862a924..00000000 --- a/src/com/sipai/service/cqbyt/CqbytSampleValueService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.cqbyt; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.cqbyt.CqbytSampleValueDao; -import com.sipai.entity.cqbyt.CqbytSampleValue; -import com.sipai.tools.CommService; - -@Service -public class CqbytSampleValueService implements CommService { - @Resource - private CqbytSampleValueDao cqbytSampleValueDao; - - @Override - public CqbytSampleValue selectById(String id) { - CqbytSampleValue cqbytSampleValue = cqbytSampleValueDao.selectByPrimaryKey(id); - return cqbytSampleValue; - } - - @Override - public int deleteById(String id) { - return cqbytSampleValueDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CqbytSampleValue cqbytSampleValue) { - return cqbytSampleValueDao.insert(cqbytSampleValue); - } - - @Override - public int update(CqbytSampleValue cqbytSampleValue) { - return cqbytSampleValueDao.updateByPrimaryKeySelective(cqbytSampleValue); - } - - @Override - public List selectListByWhere(String wherestr) { - CqbytSampleValue cqbytSampleValue = new CqbytSampleValue(); - cqbytSampleValue.setWhere(wherestr); - List list = cqbytSampleValueDao.selectListByWhere(cqbytSampleValue); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - CqbytSampleValue cqbytSampleValue = new CqbytSampleValue(); - cqbytSampleValue.setWhere(wherestr); - return cqbytSampleValueDao.deleteByWhere(cqbytSampleValue); - } -} diff --git a/src/com/sipai/service/cqbyt/CqbytVISITOUTINDATAService.java b/src/com/sipai/service/cqbyt/CqbytVISITOUTINDATAService.java deleted file mode 100644 index 6a201729..00000000 --- a/src/com/sipai/service/cqbyt/CqbytVISITOUTINDATAService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.cqbyt; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.cqbyt.CqbytVISITOUTINDATADao; -import com.sipai.entity.cqbyt.CqbytVISITOUTINDATA; -import com.sipai.tools.CommService; - -@Service -public class CqbytVISITOUTINDATAService implements CommService { - @Resource - private CqbytVISITOUTINDATADao cqbytVISITOUTINDATADao; - - @Override - public CqbytVISITOUTINDATA selectById(String id) { - CqbytVISITOUTINDATA cqbytVISITOUTINDATA = cqbytVISITOUTINDATADao.selectByPrimaryKey(id); - return cqbytVISITOUTINDATA; - } - - @Override - public int deleteById(String id) { - return cqbytVISITOUTINDATADao.deleteByPrimaryKey(id); - } - - @Override - public int save(CqbytVISITOUTINDATA cqbytVISITOUTINDATA) { - return cqbytVISITOUTINDATADao.insert(cqbytVISITOUTINDATA); - } - - @Override - public int update(CqbytVISITOUTINDATA cqbytVISITOUTINDATA) { - return cqbytVISITOUTINDATADao.updateByPrimaryKeySelective(cqbytVISITOUTINDATA); - } - - @Override - public List selectListByWhere(String wherestr) { - CqbytVISITOUTINDATA cqbytVISITOUTINDATA = new CqbytVISITOUTINDATA(); - cqbytVISITOUTINDATA.setWhere(wherestr); - List list = cqbytVISITOUTINDATADao.selectListByWhere(cqbytVISITOUTINDATA); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - CqbytVISITOUTINDATA cqbytVISITOUTINDATA = new CqbytVISITOUTINDATA(); - cqbytVISITOUTINDATA.setWhere(wherestr); - return cqbytVISITOUTINDATADao.deleteByWhere(cqbytVISITOUTINDATA); - } -} \ No newline at end of file diff --git a/src/com/sipai/service/cqbyt/KpiAnalysisService.java b/src/com/sipai/service/cqbyt/KpiAnalysisService.java deleted file mode 100644 index deb5421d..00000000 --- a/src/com/sipai/service/cqbyt/KpiAnalysisService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.cqbyt; - -import java.util.List; -import com.sipai.entity.cqbyt.KpiAnalysis; - -public interface KpiAnalysisService{ - - public KpiAnalysis selectById(String id); - - public int deleteById(String id); - - public int save(KpiAnalysis entity); - - public int save2(KpiAnalysis entity); - - public int update(KpiAnalysis entity); - - public List selectListByWhere(String wherestr); - - public int deleteByWhere(String wherestr); - - public void getKPIdata(String params); -} diff --git a/src/com/sipai/service/cqbyt/KpiAnalysisServiceImpl.java b/src/com/sipai/service/cqbyt/KpiAnalysisServiceImpl.java deleted file mode 100644 index 2d28c012..00000000 --- a/src/com/sipai/service/cqbyt/KpiAnalysisServiceImpl.java +++ /dev/null @@ -1,432 +0,0 @@ -package com.sipai.service.cqbyt; - -import java.io.IOException; -import java.math.BigDecimal; -import java.net.URISyntaxException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -import javax.annotation.Resource; - -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.ParseException; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicHeader; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.cqbyt.KpiAnalysisDao; -import com.sipai.entity.cqbyt.KpiAnalysis; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -@Service("kpiAnalysisService") -public class KpiAnalysisServiceImpl implements KpiAnalysisService { - @Resource - private KpiAnalysisDao kpiAnalysisDao; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - protected Logger logger = LoggerFactory.getLogger(getClass()); - - private static final SimpleDateFormat longDateFormat = new SimpleDateFormat( - "yyyyMMddHHmmss", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat minuteDateFormat = new SimpleDateFormat( - "yyyyMMddHHmm", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat hourDateFormat = new SimpleDateFormat( - "yyyyMMddHH", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat dayDateFormat = new SimpleDateFormat( - "yyyyMMdd", Locale.SIMPLIFIED_CHINESE); - - private static final SimpleDateFormat longDateFormatHorizontal = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat minuteDateFormatHorizontal = new SimpleDateFormat( - "yyyy-MM-dd HH:mm", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat hourDateFormatHorizontal = new SimpleDateFormat( - "yyyy-MM-dd HH", Locale.SIMPLIFIED_CHINESE); - private static final SimpleDateFormat dayDateFormatHorizontal = new SimpleDateFormat( - "yyyy-MM-dd", Locale.SIMPLIFIED_CHINESE); - - - @Override - public KpiAnalysis selectById(String id) { - KpiAnalysis kpiAnalysis = kpiAnalysisDao.selectByPrimaryKey(id); - return kpiAnalysis; - } - - @Override - public int deleteById(String id) { - return kpiAnalysisDao.deleteByPrimaryKey(id); - } - - @Override - public int save(KpiAnalysis kpiAnalysis) { - return kpiAnalysisDao.insert(kpiAnalysis); - } - - @Override - public int update(KpiAnalysis kpiAnalysis) { - return kpiAnalysisDao.updateByPrimaryKeySelective(kpiAnalysis); - } - - @Override - public List selectListByWhere(String wherestr) { - KpiAnalysis kpiAnalysis = new KpiAnalysis(); - kpiAnalysis.setWhere(wherestr); - List list = kpiAnalysisDao.selectListByWhere(kpiAnalysis); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - KpiAnalysis kpiAnalysis = new KpiAnalysis(); - kpiAnalysis.setWhere(wherestr); - return kpiAnalysisDao.deleteByWhere(kpiAnalysis); - } - - @Override - public int save2(KpiAnalysis entity) { - // TODO Auto-generated method stub - return 0; - } - - public void getKPIdata(String params){ - System.out.println("getKPIdata执行开始时间:"+CommUtil.nowDate()); - JSONObject dateType = JSON.parseObject(params); - //时间类型 - String type = null; - //时间差 - String num = "0"; - //用户名 - String account= "13000000000"; - //密码 - String password = "e10adc3949ba59abbe56e057f20f883e"; - //ip地址端口 - String httpUrl = "http://10.127.16.114:2828"; - if(dateType!=null ){ - if(dateType.get("dateType")!=null){ - type = dateType.get("dateType").toString(); - } - if(dateType.get("dateNum")!=null){ - num = dateType.get("dateNum").toString(); - } - if(dateType.get("username")!=null){ - account = dateType.get("username").toString(); - } - if(dateType.get("password")!=null){ - password = dateType.get("password").toString(); - } - if(dateType.get("httpUrl")!=null){ - httpUrl = dateType.get("httpUrl").toString(); - } - } - System.out.println("type:"+type); - String json = "{\"account\":\""+account+"\",\"password\":\""+password+"\"}"; - String url = httpUrl+"/login"; - String result = null; - try { - CloseableHttpClient httpclient = HttpClients.createDefault(); - StringEntity entity = new StringEntity(json); - entity.setContentType("application/json;charset=UTF-8"); - entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); - HttpPost httppost = new HttpPost(url); - httppost.setEntity(entity); - httppost.setHeader("client_identifier", "client_identifier"); - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - System.err.println(e.getMessage()); - } - JSONObject jsonObject = JSONObject.parseObject(result); - if(jsonObject!=null){ - JSONObject jsonObject2 = JSONObject.parseObject(jsonObject.get("data").toString()); - if(jsonObject2!=null){ - String token = jsonObject2.get("Token").toString(); - System.out.println("获取token:"+token); - String sampleDateEnd = CommUtil.nowDate(); - String sampleDateStart = ""; - Date date = null ; - Date dateStart = null ; - if(type!=null && num!=null){ - if("day".equals(type)){ - //天 - sampleDateStart = CommUtil.subplus(sampleDateEnd, num, "day"); - try { - dateStart = dayDateFormatHorizontal.parse(sampleDateStart); - date = dayDateFormatHorizontal.parse(sampleDateEnd); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sampleDateEnd = dayDateFormat.format(date); - sampleDateStart = dayDateFormat.format(dateStart); - }else - if("hour".equals(type)){ - //小时 - sampleDateStart = CommUtil.subplus(sampleDateEnd, num, "hour"); - try { - dateStart = hourDateFormatHorizontal.parse(sampleDateStart); - date = hourDateFormatHorizontal.parse(sampleDateEnd); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sampleDateEnd = hourDateFormat.format(date); - sampleDateStart = hourDateFormat.format(dateStart); - }else - if("min".equals(type)){ - // 分钟 - sampleDateStart = CommUtil.subplus(sampleDateEnd, num, "min"); - try { - dateStart = minuteDateFormatHorizontal.parse(sampleDateStart); - date = minuteDateFormatHorizontal.parse(sampleDateEnd); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sampleDateEnd = minuteDateFormat.format(date); - sampleDateStart = minuteDateFormat.format(dateStart); - } - }else{ - sampleDateStart = CommUtil.subplus(sampleDateEnd, "0", "day"); - try { - dateStart = dayDateFormatHorizontal.parse(sampleDateStart); - date = dayDateFormatHorizontal.parse(sampleDateEnd); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sampleDateEnd = dayDateFormat.format(date); - sampleDateStart = dayDateFormat.format(dateStart); - } - String listUrl = httpUrl+"/datar/without"; - URIBuilder uriBuilder = null; - try { - uriBuilder = new URIBuilder(listUrl); - uriBuilder.addParameter("f_TIME_Start", sampleDateStart); - uriBuilder.addParameter("f_TIME_End", sampleDateEnd); - uriBuilder.addParameter("limit", "1"); - uriBuilder.addParameter("size", "1000"); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - result = sendGET(uriBuilder, "Bearer "+token); - JSONObject resultData = JSONObject.parseObject(result); - JSONObject listData = (JSONObject) resultData.get("data"); - if(listData!=null){ - JSONArray list = (JSONArray) listData.get("Rows"); - if (list != null && list.size()>0) { - System.out.println("list.size:"+list.size()); - List KpiAnalysisList = null; - KpiAnalysis kpiAnalysis = null; - MPoint mPointEntity = null; - MPointHistory mPointHistory = null; - List mPointHistoryList = null; - BigDecimal parmvalue = new BigDecimal("0"); - String measuredt = ""; - for(Object object:list){ - JSONObject KPIObject = JSONObject.parseObject(object.toString()); - String id = null; - if(KPIObject!=null){ - id = KPIObject.get("F_ID").toString();//ID,主键 - String F_CALCULATIONID = KPIObject.get("F_CALCULATIONID").toString();//算法名称 - String F_INPUTTIME = KPIObject.get("F_INPUTTIME").toString();//数据生成时间 - String F_ORGID = KPIObject.get("F_ORGID").toString();//机构名称 - String F_REMARK = null; - if(KPIObject.get("F_REMARK")!=null){ - F_REMARK = KPIObject.get("F_REMARK").toString();//备注 - } - String F_SOURCEID = KPIObject.get("F_SOURCEID").toString();//数据来源名称 - String F_TIME = KPIObject.get("F_TIME").toString();//数据时间 - if(F_TIME!=null && F_TIME.length()==8){ - //day - F_TIME = F_TIME+"000000"; - } - if(F_TIME!=null && F_TIME.length()==10){ - //hour - F_TIME = F_TIME+"0000"; - } - if(F_TIME!=null && F_TIME.length()==12){ - //minute - F_TIME = F_TIME+"00"; - } - try { - date = longDateFormat.parse(F_TIME); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - F_TIME = CommUtil.longDate(date); - String F_VALUE = KPIObject.get("F_VALUE").toString();//数据值 - System.out.println("获取数据id:"+id); - String mpCode = ""; - String unitId = ""; - try { - //判断是否存在 - KpiAnalysisList = this.selectListByWhere("where F_CALCULATIONID='"+F_CALCULATIONID+"' " - + "and F_ORGID='"+F_ORGID+"' and F_SOURCEID='"+F_SOURCEID+"' order by id"); - } catch (Exception e) { - logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - if(KpiAnalysisList!=null && KpiAnalysisList.size()>0){ - mpCode = KpiAnalysisList.get(0).getMpointcode(); - unitId = KpiAnalysisList.get(0).getUnitId(); - if(mpCode!=null && unitId!=null){ - System.out.println("mpCode:"+mpCode); - mPointEntity = mPointService.selectById(unitId, mpCode); - if(mPointEntity!=null){ - parmvalue = new BigDecimal(F_VALUE); - parmvalue = parmvalue.setScale(4,BigDecimal.ROUND_HALF_UP); - System.out.println("parmvalue:"+parmvalue); - System.out.println("measuredt:"+measuredt); - measuredt = F_TIME; - mPointEntity.setParmvalue(parmvalue); - mPointEntity.setMeasuredt(measuredt); - int res = mPointService.update2(unitId, mPointEntity); - if(res>0){ - mPointHistory=new MPointHistory(); - mPointHistory.setParmvalue(parmvalue); - mPointHistory.setMeasuredt(measuredt); - mPointHistory.setTbName("TB_MP_"+mPointEntity.getMpointcode()); - - mPointHistoryList = mPointHistoryService.selectTopNumListByTableAWhere(unitId,"1", - "TB_MP_"+mPointEntity.getMpointcode(), "where MeasureDT = '"+measuredt+"' order by MeasureDT desc"); - if(mPointHistoryList!=null && mPointHistoryList.size()>0){ - res = mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - }else{ - res = mPointHistoryService.save(unitId, mPointHistory); - } - } - } - } - }else{ - //查找不到直接插入 - kpiAnalysis = new KpiAnalysis(); - kpiAnalysis.setId(id); - kpiAnalysis.setfCalculationid(F_CALCULATIONID); - kpiAnalysis.setfSourceid(F_SOURCEID); - kpiAnalysis.setfOrgid(F_ORGID); - kpiAnalysis.setfRemark(F_REMARK); - try { - this.save(kpiAnalysis); - } catch (Exception e) { - logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - } - } - } - } - } - } - - } - System.out.println("getKPIdata执行结束时间:"+CommUtil.nowDate()); - } - public static String sendGET(URIBuilder uriBuilder, String token) { - String response = null; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(uriBuilder.build()); - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpGet.setHeader("Authorization", token); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var11) { - var11.printStackTrace(); - } - - return response; - } - public static String getToken(String url, String json) { - String response = null; - - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var10) { - var10.printStackTrace(); - } - - return response; - } - - public static String sendPOST(String url, String json, String token) { - String result = null; - StringEntity postingString = null; - try { - CloseableHttpClient httpclient = HttpClients.createDefault(); - HttpPost httppost = new HttpPost(url); - postingString = new StringEntity(json); - httppost.setEntity(postingString); - httppost.setHeader("Content-type", "application/json;charset=UTF-8"); - httppost.setHeader("x-auth-token", token); - httppost.setHeader("Authorization", token); - httppost.setHeader("X-Requested-With", "XMLHttpRequest"); - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - //logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - return result; - } -} diff --git a/src/com/sipai/service/cqbyt/TestReportDetailsService.java b/src/com/sipai/service/cqbyt/TestReportDetailsService.java deleted file mode 100644 index b271f826..00000000 --- a/src/com/sipai/service/cqbyt/TestReportDetailsService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.service.cqbyt; - -import com.sipai.dao.cqbyt.TestReportDetailsDao; -import com.sipai.entity.cqbyt.TestReportDetails; -import com.sipai.tools.CommService; -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class TestReportDetailsService implements CommService { - @Resource - private TestReportDetailsDao testReportDetailsDao; - - public TestReportDetailsService() { - } - - public TestReportDetails selectById(String id) { - TestReportDetails testReportDetails = (TestReportDetails)this.testReportDetailsDao.selectByPrimaryKey(id); - return testReportDetails; - } - - public int deleteById(String id) { - return this.testReportDetailsDao.deleteByPrimaryKey(id); - } - - public int save(TestReportDetails testReportDetails) { - return this.testReportDetailsDao.insert(testReportDetails); - } - - public int update(TestReportDetails testReportDetails) { - return this.testReportDetailsDao.updateByPrimaryKeySelective(testReportDetails); - } - - public List selectListByWhere(String wherestr) { - TestReportDetails testReportDetails = new TestReportDetails(); - testReportDetails.setWhere(wherestr); - List list = this.testReportDetailsDao.selectListByWhere(testReportDetails); - return list; - } - - public int deleteByWhere(String wherestr) { - TestReportDetails testReportDetails = new TestReportDetails(); - testReportDetails.setWhere(wherestr); - return this.testReportDetailsDao.deleteByWhere(testReportDetails); - } -} diff --git a/src/com/sipai/service/cqbyt/TestReportService.java b/src/com/sipai/service/cqbyt/TestReportService.java deleted file mode 100644 index 947ba626..00000000 --- a/src/com/sipai/service/cqbyt/TestReportService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.cqbyt; - -import com.sipai.dao.cqbyt.TestReportDao; -import com.sipai.entity.cqbyt.TestReport; -import com.sipai.entity.cqbyt.TestReportDetails; -import com.sipai.tools.CommService; -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class TestReportService implements CommService { - @Resource - private TestReportDao testReportDao; - - @Resource - private TestReportDetailsService testReportDetailsService; - - public TestReportService() { - } - - public TestReport selectById(String id) { - TestReport testReport = (TestReport)this.testReportDao.selectByPrimaryKey(id); - if(testReport!=null && testReport.getCode()!=null){ - List testReportDetails = this.testReportDetailsService.selectListByWhere("where sampleCode='"+ - testReport.getCode()+"' order by itemCode"); - testReport.setTestReportDetails(testReportDetails); - } - return testReport; - } - - public int deleteById(String id) { - return this.testReportDao.deleteByPrimaryKey(id); - } - - public int save(TestReport testReport) { - return this.testReportDao.insert(testReport); - } - - public int update(TestReport testReport) { - return this.testReportDao.updateByPrimaryKeySelective(testReport); - } - - public List selectListByWhere(String wherestr) { - TestReport testReport = new TestReport(); - testReport.setWhere(wherestr); - List list = this.testReportDao.selectListByWhere(testReport); - return list; - } - - public int deleteByWhere(String wherestr) { - TestReport testReport = new TestReport(); - testReport.setWhere(wherestr); - return this.testReportDao.deleteByWhere(testReport); - } -} diff --git a/src/com/sipai/service/cqbyt/YtsjService.java b/src/com/sipai/service/cqbyt/YtsjService.java deleted file mode 100644 index 6f66f362..00000000 --- a/src/com/sipai/service/cqbyt/YtsjService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.service.cqbyt; - -import com.sipai.dao.cqbyt.YtsjDao; -import com.sipai.entity.cqbyt.Ytsj; -import com.sipai.tools.CommService; -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class YtsjService implements CommService { - @Resource - private YtsjDao ytsjDao; - - public YtsjService() { - } - - public Ytsj selectById(String id) { - Ytsj ytsj = (Ytsj)this.ytsjDao.selectByPrimaryKey(id); - return ytsj; - } - - public int deleteById(String id) { - return this.ytsjDao.deleteByPrimaryKey(id); - } - - public int save(Ytsj ytsj) { - return this.ytsjDao.insert(ytsj); - } - - public int update(Ytsj ytsj) { - return this.ytsjDao.updateByPrimaryKeySelective(ytsj); - } - - public List selectListByWhere(String wherestr) { - Ytsj ytsj = new Ytsj(); - ytsj.setWhere(wherestr); - List list = this.ytsjDao.selectListByWhere(ytsj); - return list; - } - - public int deleteByWhere(String wherestr) { - Ytsj ytsj = new Ytsj(); - ytsj.setWhere(wherestr); - return this.ytsjDao.deleteByWhere(ytsj); - } -} diff --git a/src/com/sipai/service/data/CurveMpointService.java b/src/com/sipai/service/data/CurveMpointService.java deleted file mode 100644 index 9a3c98b7..00000000 --- a/src/com/sipai/service/data/CurveMpointService.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.CurveMpointDao; -import com.sipai.entity.data.CurveMpoint; - -import com.sipai.entity.scada.MPoint; - -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; - -@Service -public class CurveMpointService implements CommService { - @Resource - private CurveMpointDao curveMpointDao; - @Resource - private MPointService mPointService; - - @Override - public CurveMpoint selectById(String id) { - return curveMpointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return curveMpointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CurveMpoint entity) { - return curveMpointDao.insert(entity); - } - - @Override - public int update(CurveMpoint entity) { - return curveMpointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - CurveMpoint group = new CurveMpoint(); - group.setWhere(wherestr); - return curveMpointDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - CurveMpoint group = new CurveMpoint(); - group.setWhere(wherestr); - return curveMpointDao.deleteByWhere(group); - } - - public int deleteByPid(String pid) { - CurveMpoint group = new CurveMpoint(); - group.setWhere(" where pid='" + pid + "' "); - return curveMpointDao.deleteByWhere(group); - } - - public CurveMpoint selectWithNameById(String bizid, String id) { - CurveMpoint ps = curveMpointDao.selectByPrimaryKey(id); - MPoint mPoint = mPointService.selectById(bizid, ps.getMpointId()); - ps.setmPoint(mPoint); - return ps; - } - - public List selectListWithNameByWhere(String wherestr) { - CurveMpoint curveMpoint = new CurveMpoint(); - curveMpoint.setWhere(wherestr); - List ps = curveMpointDao.selectListByWhere(curveMpoint); - try { - for (CurveMpoint item : ps) { - if (item.getMpointId().contains(",")) { - String[] mpidss = item.getMpointId().split(","); - String mpcodes = ""; - String mpnames = ""; - for (int i = 0; i < mpidss.length; i++) { - MPoint mPoint = mPointService.selectById(item.getUnitId(), mpidss[i]); - mpcodes += mPoint.getMpointcode() + ","; - mpnames += mPoint.getParmname() + ","; - } - MPoint mPoint = new MPoint(); - mpcodes = mpcodes.substring(0, mpcodes.length() - 1); - mpnames = mpnames.substring(0, mpnames.length() - 1); - mPoint.setMpointcode(mpcodes); - mPoint.setParmname(mpnames); - item.setmPoint(mPoint); - } else { - MPoint mPoint = mPointService.selectById(item.getUnitId(), item.getMpointId()); - item.setmPoint(mPoint); - } - } - } catch (Exception e) { - System.out.println(e); - } - return ps; - } - - public List selectListWithNameByWhere2(String wherestr,String search_name) { - CurveMpoint curveMpoint = new CurveMpoint(); - curveMpoint.setWhere(wherestr); - List ps = curveMpointDao.selectListByWhere(curveMpoint); - try { - for (CurveMpoint item : ps) { - if (item.getMpointId().contains(",")) { - String[] mpidss = item.getMpointId().split(","); - String mpcodes = ""; - String mpnames = ""; - for (int i = 0; i < mpidss.length; i++) { -// List mPointList = mPointService.selectListByWhere(item.getUnitId()," where parmname like '%"+search_name+"%'"); - MPoint mPoint = mPointService.selectById(item.getUnitId(), mpidss[i]); - mpcodes += mPoint.getMpointcode() + ","; - mpnames += mPoint.getParmname() + ","; - } - MPoint mPoint = new MPoint(); - mpcodes = mpcodes.substring(0, mpcodes.length() - 1); - mpnames = mpnames.substring(0, mpnames.length() - 1); - mPoint.setMpointcode(mpcodes); - mPoint.setParmname(mpnames); - item.setmPoint(mPoint); - } else { - MPoint mPoint = mPointService.selectById(item.getUnitId(), item.getMpointId()); - item.setmPoint(mPoint); - } - } - } catch (Exception e) { - System.out.println(e); - } - return ps; - } - - public List selectListWithNameByWhere(String companyId, String wherestr) { - CurveMpoint curveMpoint = new CurveMpoint(); - curveMpoint.setWhere(wherestr); - List ps = curveMpointDao.selectListByWhere(curveMpoint); - for (CurveMpoint item : ps) { - if (item.getMpointId().contains(",")) { - String[] mpidss = item.getMpointId().split(","); - String mpcodes = ""; - String mpnames = ""; - for (int i = 0; i < mpidss.length; i++) { - MPoint mPoint = mPointService.selectById(item.getUnitId(), mpidss[i]); - mpcodes += mPoint.getMpointcode() + ","; - mpnames += mPoint.getParmname() + ","; - } - MPoint mPoint = new MPoint(); - mpcodes = mpcodes.substring(0, mpcodes.length() - 1); - mpnames = mpnames.substring(0, mpnames.length() - 1); - mPoint.setMpointcode(mpcodes); - mPoint.setParmname(mpnames); - item.setmPoint(mPoint); - } else { - MPoint mPoint = mPointService.selectById(item.getUnitId(), item.getMpointId()); - item.setmPoint(mPoint); - } - } - return ps; - } -} diff --git a/src/com/sipai/service/data/CurveRemarkFileService.java b/src/com/sipai/service/data/CurveRemarkFileService.java deleted file mode 100644 index 97d56b48..00000000 --- a/src/com/sipai/service/data/CurveRemarkFileService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.CurveRemarkFile; - -public interface CurveRemarkFileService { - - public abstract CurveRemarkFile selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(CurveRemarkFile xServer); - - public abstract int update(CurveRemarkFile xServer); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/data/CurveRemarkService.java b/src/com/sipai/service/data/CurveRemarkService.java deleted file mode 100644 index cf637f44..00000000 --- a/src/com/sipai/service/data/CurveRemarkService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.CurveRemark; - -public interface CurveRemarkService { - - public abstract CurveRemark selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(CurveRemark entity); - - public abstract int update(CurveRemark entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - -} \ No newline at end of file diff --git a/src/com/sipai/service/data/DataCleaningConditionService.java b/src/com/sipai/service/data/DataCleaningConditionService.java deleted file mode 100644 index 2a58be2d..00000000 --- a/src/com/sipai/service/data/DataCleaningConditionService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.DataCleaningCondition; - -public interface DataCleaningConditionService { - - public abstract DataCleaningCondition selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataCleaningCondition dataCleaningCondition); - - public abstract int update(DataCleaningCondition dataCleaningCondition); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/data/DataCleaningConfigureService.java b/src/com/sipai/service/data/DataCleaningConfigureService.java deleted file mode 100644 index 2e7210c7..00000000 --- a/src/com/sipai/service/data/DataCleaningConfigureService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.DataCleaningConfigure; - -public interface DataCleaningConfigureService { - - public abstract DataCleaningConfigure selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataCleaningConfigure dataCleaningConfigure); - - public abstract int update(DataCleaningConfigure dataCleaningConfigure); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/data/DataCleaningHistoryService.java b/src/com/sipai/service/data/DataCleaningHistoryService.java deleted file mode 100644 index 18be6396..00000000 --- a/src/com/sipai/service/data/DataCleaningHistoryService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.DataCleaningHistory; - -public interface DataCleaningHistoryService { - - public abstract DataCleaningHistory selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataCleaningHistory dataCleaningHistory); - - public abstract int update(DataCleaningHistory dataCleaningHistory); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/data/DataCleaningPointService.java b/src/com/sipai/service/data/DataCleaningPointService.java deleted file mode 100644 index e6d14dd1..00000000 --- a/src/com/sipai/service/data/DataCleaningPointService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.DataCleaningPoint; - -public interface DataCleaningPointService { - - public abstract DataCleaningPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataCleaningPoint dataCleaningPoint); - - public abstract int update(DataCleaningPoint dataCleaningPoint); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/data/DataCurveService.java b/src/com/sipai/service/data/DataCurveService.java deleted file mode 100644 index b69a1692..00000000 --- a/src/com/sipai/service/data/DataCurveService.java +++ /dev/null @@ -1,671 +0,0 @@ -package com.sipai.service.data; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.DataCurveDao; -import com.sipai.entity.data.CurveMpoint; -import com.sipai.entity.data.DataCurve; -import com.sipai.service.msg.MsgService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Service -public class DataCurveService implements CommService { - @Resource - private DataCurveDao dataCurveDao; - @Resource - private CurveMpointService curveMpointService; - - @Override - public DataCurve selectById(String id) { - return dataCurveDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return dataCurveDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataCurve entity) { - return dataCurveDao.insert(entity); - } - - @Override - public int update(DataCurve entity) { - return dataCurveDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataCurve group = new DataCurve(); - group.setWhere(wherestr); - return dataCurveDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - DataCurve group = new DataCurve(); - group.setWhere(wherestr); - return dataCurveDao.deleteByWhere(group); - } - - public int deleteByPid(String pid) { - DataCurve group = new DataCurve(); - group.setWhere(" where pid='" + pid + "' "); - return dataCurveDao.deleteByWhere(group); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public List> getTreeListResult(List> list_result, List list, String search_name, int index) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (DataCurve k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - map.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DataCurve k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - if (k.getType().equals(DataCurve.Type_user)) { - m.put("id", k.getId().toString() + "GRProgramme");//为个人方案编辑功能识别 - } else { - m.put("id", k.getId().toString()); - } -// m.put("id", k.getId().toString()); - index = index + 1; - list_result.get(0).put("sys_all_index", index); - m.put("index", index); - m.put("text", k.getName()); - m.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - m.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } - - List tags = new ArrayList(); - if (k.getType().equals(DataCurve.Type_user)) { - tags.add(""); - m.put("tags", tags); - } - - // - if (k.getType().equals(DataCurve.Type_sys) || k.getType().equals(DataCurve.Type_user)) { - String where = " where data_curve_id='" + k.getId() + "' "; - List curveMpoints = this.curveMpointService.selectListWithNameByWhere2(where + "order by morder", search_name); - List> childlist2 = new ArrayList>(); - if (curveMpoints != null && curveMpoints.size() > 0) { - for (int i = 0; i < curveMpoints.size(); i++) { - Map m2 = new HashMap(); - if (k.getType().equals(DataCurve.Type_user)) { - m2.put("id", curveMpoints.get(i).getId().toString() + "GRMp");//为个人方案编辑功能识别 - } else { - m2.put("id", curveMpoints.get(i).getId().toString()); - } -// m2.put("id", curveMpoints.get(i).getId().toString()); - index = index + 1; - list_result.get(0).put("sys_all_index", index); - m2.put("index", index); - if (curveMpoints.get(i).getmPoint() != null) { - m2.put("text", curveMpoints.get(i).getmPoint().getParmname().toString()); - } else { - m2.put("text", "-"); - } - m2.put("type", DataCurve.Type_mp); - m2.put("icon", ""); - m2.put("tags", ""); - m2.put("mpid", curveMpoints.get(i).getMpointId()); - m2.put("bizid", curveMpoints.get(i).getUnitId()); - childlist2.add(m2); - } - if (childlist2.size() > 0) { - m.put("nodes", childlist2); - } - } - } - - childlist.add(m); - - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeListResult(childlist, list, search_name, index); - } - } - } - return list_result; - } - - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (DataCurve k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - map.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DataCurve k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - m.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } - List tags = new ArrayList(); - tags.add(k.getRemark()); - m.put("tags", tags); - - // - if (k.getType().equals(DataCurve.Type_sys) || k.getType().equals(DataCurve.Type_user)) { - List curveMpoints = this.curveMpointService.selectListWithNameByWhere("where data_curve_id='" + k.getId() + "' order by morder "); - List> childlist2 = new ArrayList>(); - if (curveMpoints != null && curveMpoints.size() > 0) { - for (int i = 0; i < curveMpoints.size(); i++) { - Map m2 = new HashMap(); - m2.put("id", curveMpoints.get(i).getId().toString()); - m2.put("text", curveMpoints.get(i).getmPoint().getParmname().toString()); - m2.put("type", DataCurve.Type_mp); - m2.put("icon", ""); - m2.put("tags", ""); - m2.put("mpid", curveMpoints.get(i).getMpointId()); - childlist2.add(m2); - } - if (childlist2.size() > 0) { - m.put("nodes", childlist2); - } - } - } - - childlist.add(m); - - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList2(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (DataCurve k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - map.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } - list_result.add(map); - } - } - getTreeList2(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DataCurve k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - if (k.getType().equals(DataCurve.Type_group)) { - m.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } - List tags = new ArrayList(); - tags.add(k.getRemark()); - m.put("tags", tags); - - childlist.add(m); - - } - } - if (childlist.size() > 0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList2(childlist, list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - - @SuppressWarnings("deprecation") - public void downloadExcel(HttpServletResponse response, com.alibaba.fastjson.JSONArray jsonarr) throws IOException { - String fileName = "测量点记录表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "测量点记录表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,日期,"; - for (int i = 0; i < jsonarr.size(); i++) { - com.alibaba.fastjson.JSONObject jsonObject = jsonarr.getJSONObject(i); - if (null != jsonObject.get("measurepointname").toString()) { - excelTitleStr += jsonObject.get("measurepointname").toString() + ","; - } - } - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("测量点记录表"); - - //遍历集合数据,产生数据行 -// for(int i = 0; i < jsonarr.size(); i++){ - int rownum = 0; - //填充列数据,如果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - if (j > 1) { - com.alibaba.fastjson.JSONObject jsonObject = jsonarr.getJSONObject(j - 2); - com.alibaba.fastjson.JSONArray jsonD = new com.alibaba.fastjson.JSONArray(); - jsonD = (com.alibaba.fastjson.JSONArray) jsonObject.getJSONArray("parmList"); - if (jsonD != null) { - if (j == 2) { - rownum = jsonD.size(); - } - for (int m = 0; m < jsonD.size(); m++) { - com.alibaba.fastjson.JSONObject jsonObjectd = jsonD.getJSONObject(m); - if ((j - 2) == 0) { - row = sheet.createRow(m + 3);//行 - row.setHeight((short) 600); - - HSSFCell cell_d1 = row.createCell(j - 2); - cell_d1.setCellStyle(listStyle); - cell_d1.setCellValue(m + 1); - - HSSFCell cell_d2 = row.createCell(j - 1); - cell_d2.setCellStyle(listStyle); - cell_d2.setCellValue(jsonObjectd.get("measuredt").toString()); - - HSSFCell cell_d = row.createCell(j); - cell_d.setCellStyle(listStyle); - cell_d.setCellValue(jsonObjectd.get("parmvalue").toString()); - } else { - if ((m + 3) <= (rownum + 2)) {//防止转发数据行数不一样是无法创建列报错 - row = sheet.getRow(m + 3); - HSSFCell cell_do = row.createCell(j); - cell_do.setCellStyle(listStyle); - cell_do.setCellValue(jsonObjectd.get("parmvalue").toString()); - } - } - - } - } - } - } -// } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - public void downloadExcel(HttpServletResponse response, JSONArray jsonarr) throws IOException { - String fileName = "测量点记录表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "测量点记录表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,日期,"; - for (int i = 0; i < jsonarr.size(); i++) { - JSONObject jsonObject = jsonarr.getJSONObject(i); - if (null != jsonObject.get("measurepointname").toString()) { - excelTitleStr += jsonObject.get("measurepointname").toString() + ","; - } - } - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("测量点记录表"); - - //遍历集合数据,产生数据行 -// for(int i = 0; i < jsonarr.size(); i++){ - int rownum = 0; - //填充列数据,如果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - if (j > 1) { - JSONObject jsonObject = jsonarr.getJSONObject(j - 2); - JSONArray jsonD = new JSONArray(); - jsonD = (JSONArray) jsonObject.get("parmList"); - if (jsonD != null) { - if (j == 2) { - rownum = jsonD.size(); - } - for (int m = 0; m < jsonD.size(); m++) { - JSONObject jsonObjectd = jsonD.getJSONObject(m); - if ((j - 2) == 0) { - row = sheet.createRow(m + 3);//行 - row.setHeight((short) 600); - - HSSFCell cell_d1 = row.createCell(j - 2); - cell_d1.setCellStyle(listStyle); - cell_d1.setCellValue(m + 1); - - HSSFCell cell_d2 = row.createCell(j - 1); - cell_d2.setCellStyle(listStyle); - cell_d2.setCellValue(jsonObjectd.get("measuredt").toString()); - - HSSFCell cell_d = row.createCell(j); - cell_d.setCellStyle(listStyle); - cell_d.setCellValue(jsonObjectd.get("parmvalue").toString()); - } else { - if ((m + 3) <= (rownum + 2)) {//防止转发数据行数不一样是无法创建列报错 - row = sheet.getRow(m + 3); - HSSFCell cell_do = row.createCell(j); - cell_do.setCellStyle(listStyle); - cell_do.setCellValue(jsonObjectd.get("parmvalue").toString()); - } - } - - } - } - } - } -// } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 读取Excel表格的配置文件,中文表头 - * - * @param key - * @return - */ - private String getExcelStr(String key) { - InputStream inStream = MsgService.class.getClassLoader().getResourceAsStream("excelConfig.properties"); - Properties prop = new Properties(); - try { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));//解决读取properties文件中产生中文乱码的问题 - prop.load(bufferedReader); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String str = prop.getProperty(key).replace(" ", "");//去掉空格 - return str; - } - -} diff --git a/src/com/sipai/service/data/DataTransConfigService.java b/src/com/sipai/service/data/DataTransConfigService.java deleted file mode 100644 index 9a46935e..00000000 --- a/src/com/sipai/service/data/DataTransConfigService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.sipai.service.data; - -import com.sipai.entity.data.DataTransConfig; - -import java.util.List; - -public interface DataTransConfigService { - public abstract DataTransConfig selectById(String t); - - public List selectListByWhere(String where); -} diff --git a/src/com/sipai/service/data/XServerService.java b/src/com/sipai/service/data/XServerService.java deleted file mode 100644 index 1c58a4f5..00000000 --- a/src/com/sipai/service/data/XServerService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.data; - -import java.util.List; - -import com.sipai.entity.data.XServer; - -public interface XServerService { - - public abstract XServer selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(XServer xServer); - - public abstract int update(XServer xServer); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/data/impl/CurveRemarkFileServiceImpl.java b/src/com/sipai/service/data/impl/CurveRemarkFileServiceImpl.java deleted file mode 100644 index 5cf5929c..00000000 --- a/src/com/sipai/service/data/impl/CurveRemarkFileServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.CurveRemarkFileDao; -import com.sipai.entity.data.CurveRemarkFile; -import com.sipai.service.data.CurveRemarkFileService; - -@Service -public class CurveRemarkFileServiceImpl implements CurveRemarkFileService { - @Resource - private CurveRemarkFileDao curveRemarkFileDao; - - @Override - public CurveRemarkFile selectById(String id) { - CurveRemarkFile curveRemarkFile = this.curveRemarkFileDao.selectByPrimaryKey(id); - return curveRemarkFile; - } - - @Override - public int deleteById(String id) { - int code = this.curveRemarkFileDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(CurveRemarkFile curveRemarkFile) { - int code = this.curveRemarkFileDao.insert(curveRemarkFile); - return code; - } - - @Override - public int update(CurveRemarkFile curveRemarkFile) { - int code = this.curveRemarkFileDao.updateByPrimaryKeySelective(curveRemarkFile); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - CurveRemarkFile curveRemarkFile = new CurveRemarkFile(); - curveRemarkFile.setWhere(wherestr); - List list = this.curveRemarkFileDao.selectListByWhere(curveRemarkFile); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - CurveRemarkFile curveRemarkFile = new CurveRemarkFile(); - curveRemarkFile.setWhere(wherestr); - int code = this.curveRemarkFileDao.deleteByWhere(curveRemarkFile); - return code; - } - -} diff --git a/src/com/sipai/service/data/impl/CurveRemarkServiceImpl.java b/src/com/sipai/service/data/impl/CurveRemarkServiceImpl.java deleted file mode 100644 index c8e02d8e..00000000 --- a/src/com/sipai/service/data/impl/CurveRemarkServiceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.CurveRemarkDao; -import com.sipai.entity.data.CurveRemark; -import com.sipai.service.data.CurveRemarkService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; - - -@Service -public class CurveRemarkServiceImpl implements CurveRemarkService{ - @Resource - private CurveRemarkDao curveRemarkDao; - @Resource - private MPointService mPointService; - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#selectById(java.lang.String) - */ - @Override - public CurveRemark selectById(String id) { - return curveRemarkDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return curveRemarkDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#save(com.sipai.entity.data.CurveRemark) - */ - @Override - public int save(CurveRemark entity) { - return curveRemarkDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#update(com.sipai.entity.data.CurveRemark) - */ - @Override - public int update(CurveRemark entity) { - return curveRemarkDao.updateByPrimaryKeySelective(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - CurveRemark group = new CurveRemark(); - group.setWhere(wherestr); - return curveRemarkDao.selectListByWhere(group); - } - - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - CurveRemark group = new CurveRemark(); - group.setWhere(wherestr); - return curveRemarkDao.deleteByWhere(group); - } - - /* (non-Javadoc) - * @see com.sipai.service.data.CurveRemarkService#deleteByPid(java.lang.String) - */ - public int deleteByPid(String pid) { - CurveRemark group= new CurveRemark(); - group.setWhere(" where pid='"+pid+"' "); - return curveRemarkDao.deleteByWhere(group); - } -} diff --git a/src/com/sipai/service/data/impl/DataCleaningConditionServiceImpl.java b/src/com/sipai/service/data/impl/DataCleaningConditionServiceImpl.java deleted file mode 100644 index 1083ea19..00000000 --- a/src/com/sipai/service/data/impl/DataCleaningConditionServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.DataCleaningConditionDao; -import com.sipai.entity.data.DataCleaningCondition; -import com.sipai.service.data.DataCleaningConditionService; - -@Service("dataCleaningConditionService") -public class DataCleaningConditionServiceImpl implements DataCleaningConditionService { - @Resource - private DataCleaningConditionDao dataCleaningConditionDao; - - @Override - public DataCleaningCondition selectById(String id) { - DataCleaningCondition dataCleaningCondition = this.dataCleaningConditionDao.selectByPrimaryKey(id); - return dataCleaningCondition; - } - - @Override - public int deleteById(String id) { - int code = this.dataCleaningConditionDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(DataCleaningCondition dataCleaningCondition) { - int code = this.dataCleaningConditionDao.insert(dataCleaningCondition); - return code; - } - - @Override - public int update(DataCleaningCondition dataCleaningCondition) { - int code = this.dataCleaningConditionDao.updateByPrimaryKeySelective(dataCleaningCondition); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - DataCleaningCondition dataCleaningCondition = new DataCleaningCondition(); - dataCleaningCondition.setWhere(wherestr); - List list = this.dataCleaningConditionDao.selectListByWhere(dataCleaningCondition); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataCleaningCondition dataCleaningCondition = new DataCleaningCondition(); - dataCleaningCondition.setWhere(wherestr); - int code = this.dataCleaningConditionDao.deleteByWhere(dataCleaningCondition); - return code; - } - -} diff --git a/src/com/sipai/service/data/impl/DataCleaningConfigureServiceImpl.java b/src/com/sipai/service/data/impl/DataCleaningConfigureServiceImpl.java deleted file mode 100644 index 22d5f544..00000000 --- a/src/com/sipai/service/data/impl/DataCleaningConfigureServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.DataCleaningConfigureDao; -import com.sipai.entity.data.DataCleaningConfigure; -import com.sipai.service.data.DataCleaningConfigureService; - -@Service("dataCleaningConfigureService") -public class DataCleaningConfigureServiceImpl implements DataCleaningConfigureService { - @Resource - private DataCleaningConfigureDao dataCleaningConfigureDao; - - @Override - public DataCleaningConfigure selectById(String id) { - DataCleaningConfigure dataCleaningConfigure = this.dataCleaningConfigureDao.selectByPrimaryKey(id); - return dataCleaningConfigure; - } - - @Override - public int deleteById(String id) { - int code = this.dataCleaningConfigureDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(DataCleaningConfigure dataCleaningConfigure) { - int code = this.dataCleaningConfigureDao.insert(dataCleaningConfigure); - return code; - } - - @Override - public int update(DataCleaningConfigure dataCleaningConfigure) { - int code = this.dataCleaningConfigureDao.updateByPrimaryKeySelective(dataCleaningConfigure); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - DataCleaningConfigure dataCleaningConfigure = new DataCleaningConfigure(); - dataCleaningConfigure.setWhere(wherestr); - List list = this.dataCleaningConfigureDao.selectListByWhere(dataCleaningConfigure); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataCleaningConfigure dataCleaningConfigure = new DataCleaningConfigure(); - dataCleaningConfigure.setWhere(wherestr); - int code = this.dataCleaningConfigureDao.deleteByWhere(dataCleaningConfigure); - return code; - } - -} diff --git a/src/com/sipai/service/data/impl/DataCleaningHistoryServiceImpl.java b/src/com/sipai/service/data/impl/DataCleaningHistoryServiceImpl.java deleted file mode 100644 index 8bacda60..00000000 --- a/src/com/sipai/service/data/impl/DataCleaningHistoryServiceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Unit; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.DataCleaningHistoryDao; -import com.sipai.entity.data.DataCleaningHistory; -import com.sipai.service.data.DataCleaningHistoryService; - -@Service("dataCleaningHistoryService") -public class DataCleaningHistoryServiceImpl implements DataCleaningHistoryService { - @Resource - private DataCleaningHistoryDao dataCleaningHistoryDao; - @Resource - private MPointService mPointService; - @Resource - private UnitService unitService; - - @Override - public DataCleaningHistory selectById(String id) { - DataCleaningHistory dataCleaningHistory = this.dataCleaningHistoryDao.selectByPrimaryKey(id); - return dataCleaningHistory; - } - - @Override - public int deleteById(String id) { - int code = this.dataCleaningHistoryDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(DataCleaningHistory dataCleaningHistory) { - int code = this.dataCleaningHistoryDao.insert(dataCleaningHistory); - return code; - } - - @Override - public int update(DataCleaningHistory dataCleaningHistory) { - int code = this.dataCleaningHistoryDao.updateByPrimaryKeySelective(dataCleaningHistory); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setWhere(wherestr); - List list = this.dataCleaningHistoryDao.selectListByWhere(dataCleaningHistory); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataCleaningHistory dataCleaningHistory = new DataCleaningHistory(); - dataCleaningHistory.setWhere(wherestr); - int code = this.dataCleaningHistoryDao.deleteByWhere(dataCleaningHistory); - return code; - } - -} diff --git a/src/com/sipai/service/data/impl/DataCleaningPointServiceImpl.java b/src/com/sipai/service/data/impl/DataCleaningPointServiceImpl.java deleted file mode 100644 index c2a2bb82..00000000 --- a/src/com/sipai/service/data/impl/DataCleaningPointServiceImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Unit; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.DataCleaningPointDao; -import com.sipai.entity.data.DataCleaningPoint; -import com.sipai.service.data.DataCleaningPointService; - -@Service("dataCleaningPointService") -public class DataCleaningPointServiceImpl implements DataCleaningPointService { - @Resource - private DataCleaningPointDao dataCleaningPointDao; - @Resource - private MPointService mPointService; - @Resource - private UnitService unitService; - - @Override - public DataCleaningPoint selectById(String id) { - DataCleaningPoint dataCleaningPoint = this.dataCleaningPointDao.selectByPrimaryKey(id); - return dataCleaningPoint; - } - - @Override - public int deleteById(String id) { - int code = this.dataCleaningPointDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(DataCleaningPoint dataCleaningPoint) { - int code = this.dataCleaningPointDao.insert(dataCleaningPoint); - return code; - } - - @Override - public int update(DataCleaningPoint dataCleaningPoint) { - int code = this.dataCleaningPointDao.updateByPrimaryKeySelective(dataCleaningPoint); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - DataCleaningPoint dataCleaningPoint = new DataCleaningPoint(); - dataCleaningPoint.setWhere(wherestr); - List list = this.dataCleaningPointDao.selectListByWhere(dataCleaningPoint); - for (DataCleaningPoint dataCleaningPointL : - list) { - if (dataCleaningPointL.getPoint() != null && !dataCleaningPointL.getPoint().equals("")) { - MPoint mPoint = this.mPointService.selectById(dataCleaningPointL.getPoint()); - if (mPoint != null) { - dataCleaningPointL.setPointName(mPoint.getParmname()); - } - } - if (dataCleaningPointL.getInsuser()!=null&&!dataCleaningPointL.getInsuser().equals("")) { - Unit unit = this.unitService.getUnitById(dataCleaningPointL.getInsuser()); - if(unit!=null){ - dataCleaningPointL.setInsuserName(unit.getSname()); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataCleaningPoint dataCleaningPoint = new DataCleaningPoint(); - dataCleaningPoint.setWhere(wherestr); - int code = this.dataCleaningPointDao.deleteByWhere(dataCleaningPoint); - return code; - } - -} diff --git a/src/com/sipai/service/data/impl/DataTransConfigServiceImpl.java b/src/com/sipai/service/data/impl/DataTransConfigServiceImpl.java deleted file mode 100644 index 0f30e532..00000000 --- a/src/com/sipai/service/data/impl/DataTransConfigServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.service.data.impl; - -import com.sipai.dao.data.DataTransConfigDao; -import com.sipai.entity.data.DataTransConfig; -import com.sipai.service.data.DataTransConfigService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("dataTransConfigService") -public class DataTransConfigServiceImpl implements DataTransConfigService { - @Resource - private DataTransConfigDao dataTransConfigDao; - - @Override - public DataTransConfig selectById(String t) { - return dataTransConfigDao.selectByPrimaryKey(t); - } - - @Override - public List selectListByWhere(String where) { - DataTransConfig dataTransConfig = new DataTransConfig(); - dataTransConfig.setWhere(where); - return dataTransConfigDao.selectListByWhere(dataTransConfig); - } - -} diff --git a/src/com/sipai/service/data/impl/XServerServiceImpl.java b/src/com/sipai/service/data/impl/XServerServiceImpl.java deleted file mode 100644 index ebc7516f..00000000 --- a/src/com/sipai/service/data/impl/XServerServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.service.data.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.data.XServerDao; -import com.sipai.entity.data.XServer; -import com.sipai.entity.user.Company; -import com.sipai.service.data.XServerService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; - -@Service -public class XServerServiceImpl implements XServerService { - @Resource - private XServerDao xServerDao; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public XServer selectById(String id) { - XServer xServer = this.xServerDao.selectByPrimaryKey(id); - return xServer; - } - - @Override - public int deleteById(String id) { - int code = this.xServerDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(XServer xServer) { - int code = this.xServerDao.insert(xServer); - return code; - } - - @Override - public int update(XServer xServer) { - int code = this.xServerDao.updateByPrimaryKeySelective(xServer); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - XServer xServer = new XServer(); - xServer.setWhere(wherestr); - List list = this.xServerDao.selectListByWhere(xServer); - for (XServer item : list) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - XServer xServer = new XServer(); - xServer.setWhere(wherestr); - int code = this.xServerDao.deleteByWhere(xServer); - return code; - } - -} diff --git a/src/com/sipai/service/digitalProcess/DispatchSheetEntryService.java b/src/com/sipai/service/digitalProcess/DispatchSheetEntryService.java deleted file mode 100644 index c6a742d8..00000000 --- a/src/com/sipai/service/digitalProcess/DispatchSheetEntryService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.digitalProcess; - -import com.sipai.dao.digitalProcess.DispatchSheetEntryDao; -import com.sipai.entity.digitalProcess.DispatchSheetEntry; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class DispatchSheetEntryService implements CommService{ - @Resource - private DispatchSheetEntryDao dispatchSheetEntryDao; - - @Override - public DispatchSheetEntry selectById(String id) { - DispatchSheetEntry dispatchSheetEntry = dispatchSheetEntryDao.selectByPrimaryKey(id); - return dispatchSheetEntry; - } - - @Override - public int deleteById(String id) { - return dispatchSheetEntryDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DispatchSheetEntry dispatchSheetEntry) { - return dispatchSheetEntryDao.insert(dispatchSheetEntry); - } - - @Override - public int update(DispatchSheetEntry dispatchSheetEntry) { - return dispatchSheetEntryDao.updateByPrimaryKeySelective(dispatchSheetEntry); - } - - @Override - public List selectListByWhere(String wherestr) { - DispatchSheetEntry dispatchSheetEntry = new DispatchSheetEntry(); - dispatchSheetEntry.setWhere(wherestr); - List list = dispatchSheetEntryDao.selectListByWhere(dispatchSheetEntry); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - DispatchSheetEntry dispatchSheetEntry = new DispatchSheetEntry(); - dispatchSheetEntry.setWhere(wherestr); - return dispatchSheetEntryDao.deleteByWhere(dispatchSheetEntry); - } -} diff --git a/src/com/sipai/service/document/DataService.java b/src/com/sipai/service/document/DataService.java deleted file mode 100644 index 155b2ae2..00000000 --- a/src/com/sipai/service/document/DataService.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.sipai.service.document; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.document.DataDao; -import com.sipai.entity.document.Data; -import com.sipai.tools.CommService; - -@Service -public class DataService implements CommService{ - @Resource - private DataDao dataDao; - - - public String getNameById(String id) { - String res=""; - Data data=this.selectById(id); - if(data !=null){ - if(data.getDocname()==null){ - res = "空"; - }else{ - res = data.getDocname(); - } - } - return res; - } - - - public String getPidById(String id) { - String res=""; - Data data=this.selectById(id); - if(data !=null){ - if(data.getPid()==null){ - res = ""; - }else{ - res = data.getPid(); - } - } - return res; - } - - public int getLevelById(String id) { - int res=0; - Data data=this.selectById(id); - if(data !=null){ - if(data.getLevel()==null){ - - }else{ - res = data.getLevel(); - } - } - return res; - } - public List selectList() { - Data data= new Data(); - return this.dataDao.selectList(data); - } - - @Override - public Data selectById(String id) { - Data data = dataDao.selectByPrimaryKey(id); - if (null != data) { - Data pData = dataDao.selectByPrimaryKey(data.getPid()); - if (null != pData) { - data.setPname(pData.getDocname()); - } - } - return data; - } - - @Override - public int deleteById(String id) { - return dataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Data entity) { - return dataDao.insert(entity); - } - - @Override - public int update(Data t) { - return dataDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - Data data = new Data(); - data.setWhere(wherestr); - return dataDao.selectListByWhere(data); - } - - @Override - public int deleteByWhere(String wherestr) { - Data data = new Data(); - data.setWhere(wherestr); - return dataDao.deleteByWhere(data); - } - - - public boolean checkNotOccupied(String id, String number, String doctype) { - List list = this.dataDao.getListByNumberAndType(number,doctype); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(Data data :list){ - if(!id.equals(data.getId())){ - //不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(Data k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getDocname()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Data k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getDocname()); - m.put("pid",k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 递归获取父节点 - * @param pid - * @return - */ - public List getDatas(String pid){ - Listdatas = new ArrayList<>(); - if(!("-1").equals(pid)){ - Data data = this.selectById(pid); - datas.add(data); - datas.addAll(getDatas(data.getPid())); - } - return datas; - } - /** - * 递归获取子节点 - * @param nodeId - * @return - */ - public String getNodeIds(String nodeId){ - String nodeIds = ""; - Listdatas = this.selectListByWhere("where pid ='"+nodeId+"'"); - for(Data data :datas){ - nodeIds+=data.getId()+","; - if (null != data.getId() && !data.getId().isEmpty()) { - nodeIds += getNodeIds(data.getId()); - } - } - return nodeIds; - } - -} diff --git a/src/com/sipai/service/document/DocFileRelationService.java b/src/com/sipai/service/document/DocFileRelationService.java deleted file mode 100644 index af23f3e1..00000000 --- a/src/com/sipai/service/document/DocFileRelationService.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.document; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.document.DocFileRelationDao; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.document.Data; -import com.sipai.entity.document.DocFileRelation; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class DocFileRelationService implements CommService{ - @Resource - private DocFileRelationDao docFileRelationDao; - @Resource - private CommonFileService commonFileService; - @Resource - private UserService userService; - - @Override - public DocFileRelation selectById(String id) { - return docFileRelationDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return docFileRelationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DocFileRelation entity) { - return docFileRelationDao.insert(entity); - } - - @Override - public int update(DocFileRelation entity) { - return docFileRelationDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DocFileRelation docFileRelation = new DocFileRelation(); - docFileRelation.setWhere(wherestr); - List list=docFileRelationDao.selectListByWhere(docFileRelation); - if(list!=null&&list.size()>0){ - for(int i=0;i coFile=this.commonFileService.selectListByTableAWhere("tb_doc_file"," where id='"+list.get(i).getDocId()+"' "); - if(coFile!=null&&coFile.size()>0){ - list.get(i).setCommonFile(coFile.get(0)); - User user=this.userService.getUserById(coFile.get(0).getInsuser()); - if(user!=null){ - list.get(i).setInsuserName(user.getCaption()); - } - - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DocFileRelation docFileRelation = new DocFileRelation(); - docFileRelation.setWhere(wherestr); - return docFileRelationDao.deleteByWhere(docFileRelation); - } -} diff --git a/src/com/sipai/service/document/DocumentService.java b/src/com/sipai/service/document/DocumentService.java deleted file mode 100644 index ef14ba93..00000000 --- a/src/com/sipai/service/document/DocumentService.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.service.document; - -import com.sipai.dao.document.DocumentDao; -import com.sipai.entity.document.Document; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class DocumentService implements CommService{ - @Resource - private DocumentDao documentDao; - @Resource - private UserService userService; - - @Override - public Document selectById(String id) { - return documentDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return documentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Document entity) { - return documentDao.insert(entity); - } - - @Override - public int update(Document entity) { - return documentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Document document = new Document(); - document.setWhere(wherestr); - List documents = documentDao.selectListByWhere(document); - //查询文件上传者的名称 - for (Document doc : documents) { - if (doc.getInsertUserId()!= null) { - User user = this.userService.getUserById(doc.getInsertUserId()); - doc.setUser(user); - } - } - return documents; - } - - public List selectListFileByWhere(String wherestr) { - Document document = new Document(); - document.setWhere(wherestr); - List documents = documentDao.selectListFileByWhere(document); - //查询文件上传者的名称 - for (Document doc : documents) { - if (doc.getInsertUserId()!= null) { - User user = this.userService.getUserById(doc.getInsertUserId()); - doc.setUser(user); - } - } - return documents; - } - - @Override - public int deleteByWhere(String wherestr) { - Document document = new Document(); - document.setWhere(wherestr); - return documentDao.deleteByWhere(document); - } -} diff --git a/src/com/sipai/service/document/document.erm b/src/com/sipai/service/document/document.erm deleted file mode 100644 index c2664f46..00000000 --- a/src/com/sipai/service/document/document.erm +++ /dev/null @@ -1,903 +0,0 @@ - - - - true - 100 - A4 210 x 297 mm - 30 - 30 - 30 - 30 - - 0 - 1.0 - 0 - 0 - - 128 - 128 - 192 - - - 255 - 255 - 255 - - 微软雅黑 - 9 - - SQLServer 2008 - false - - - 0 - true - 1 - 1 - 1 - false - true - false - false - - - src\com\sipai\service\data\document.sql - UTF-8 - CR+LF - true - 0 - null - - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - false - false - false - - - - - null - - - - - - true - true - true - - - - true - true - true - - - - - true - true - - - - - - - false - - - - - 0 - - - - false - false - - - - - false - - - - - - -1 - -1 - 微软雅黑 - 9 - 50 - 50 - - 255 - 255 - 255 - - - - false - 2015-10-23 15:58:14 - 2015-10-30 17:16:05 - - Project Name - - - - Model Name - - - - Version - - - - Company - - - - Author - - - - - - - - - 0 - Default - - - - - - 0 - null - null - false - null - false - false - false - - false - - details - details - ntext - - - 1 - 50 - null - false - null - false - false - false - - false - - docname - docname - varchar(n) - - - 2 - 50 - null - false - null - false - false - false - - false - - doctype - doctype - varchar(n) - - - 3 - 50 - null - false - null - false - false - false - - false - - id - id - varchar(n) - - - 4 - null - null - false - null - false - false - false - - false - - insdt - insdt - timestamp - - - 5 - 50 - null - false - null - false - false - false - - false - - insuser - insuser - varchar(n) - - - 6 - null - null - false - null - false - false - false - - false - - level - level - integer - - - 7 - 500 - null - false - null - false - false - false - - false - - memo - memo - varchar(n) - - - 8 - 100 - null - false - null - false - false - false - - false - - number - number - varchar(n) - - - 9 - 500 - null - false - null - false - false - false - - false - - path - path - varchar(n) - - - 10 - 50 - null - false - null - false - false - false - - false - - pid - pid - varchar(n) - - - 11 - 10 - null - false - null - false - false - false - - false - - st - st - varchar(n) - - - 12 - null - null - false - null - false - false - false - - false - - updatedt - updatedt - timestamp - - - 13 - 50 - null - false - null - false - false - false - - false - - updateuser - updateuser - varchar(n) - - - - - -
- 0 - 321 - 196 - 微软雅黑 - 9 - 48 - 24 - - 128 - 128 - 192 - - - - tb_doc_data - tb_doc_data - - - - - - - 3 - 0 - - - - - varchar(n) - - - false - false - true - true - true - - - - - - - - - - - false - false - false - - - 0 - - - - 10 - 1 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 2 - 2 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 1 - 3 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 8 - 4 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 0 - 5 - - - - - ntext - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 5 - 6 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 4 - 7 - - - - - timestamp - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 13 - 8 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 12 - 9 - - - - - timestamp - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 7 - 10 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 9 - 11 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 11 - 12 - - - - - varchar(n) - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - 6 - 13 - - - - - integer - - - false - false - false - false - false - - - - - - - - - - - false - false - false - - - 0 - - - - - - - - - - -
- - - - - - - - - - - - diff --git a/src/com/sipai/service/efficiency/ConstituteConfigureDetailService.java b/src/com/sipai/service/efficiency/ConstituteConfigureDetailService.java deleted file mode 100644 index 74d8dfe0..00000000 --- a/src/com/sipai/service/efficiency/ConstituteConfigureDetailService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.efficiency; - -import java.util.List; - -import com.sipai.entity.efficiency.ConstituteConfigureDetail; - -public interface ConstituteConfigureDetailService { - - public abstract ConstituteConfigureDetail selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ConstituteConfigureDetail entity); - - public abstract int update(ConstituteConfigureDetail entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/efficiency/ConstituteConfigureSchemeService.java b/src/com/sipai/service/efficiency/ConstituteConfigureSchemeService.java deleted file mode 100644 index 37fc3e6d..00000000 --- a/src/com/sipai/service/efficiency/ConstituteConfigureSchemeService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.efficiency; - -import com.sipai.entity.efficiency.ConstituteConfigureScheme; - -import java.util.List; - -public interface ConstituteConfigureSchemeService { - - public abstract ConstituteConfigureScheme selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ConstituteConfigureScheme entity); - - public abstract int update(ConstituteConfigureScheme entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/efficiency/ConstituteConfigureService.java b/src/com/sipai/service/efficiency/ConstituteConfigureService.java deleted file mode 100644 index 4edc7773..00000000 --- a/src/com/sipai/service/efficiency/ConstituteConfigureService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.efficiency; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.efficiency.ConstituteConfigure; -import net.sf.json.JSONArray; - -public interface ConstituteConfigureService { - - public abstract ConstituteConfigure selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ConstituteConfigure entity); - - public abstract int update(ConstituteConfigure entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract JSONArray getTreeList(List> list_result, List list); - -} diff --git a/src/com/sipai/service/efficiency/EfficiencyOverviewConfigureAssemblyService.java b/src/com/sipai/service/efficiency/EfficiencyOverviewConfigureAssemblyService.java deleted file mode 100644 index 59707eb3..00000000 --- a/src/com/sipai/service/efficiency/EfficiencyOverviewConfigureAssemblyService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.efficiency; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.efficiency.EfficiencyOverviewConfigureAssembly; - -public interface EfficiencyOverviewConfigureAssemblyService { - - public abstract EfficiencyOverviewConfigureAssembly selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EfficiencyOverviewConfigureAssembly entity); - - public abstract int update(EfficiencyOverviewConfigureAssembly entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeList(List> list_result, List list); - -} diff --git a/src/com/sipai/service/efficiency/EfficiencyOverviewConfigureService.java b/src/com/sipai/service/efficiency/EfficiencyOverviewConfigureService.java deleted file mode 100644 index 7d4c99cd..00000000 --- a/src/com/sipai/service/efficiency/EfficiencyOverviewConfigureService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.efficiency; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import com.sipai.entity.efficiency.EfficiencyOverviewConfigure; - -public interface EfficiencyOverviewConfigureService { - - public abstract EfficiencyOverviewConfigure selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EfficiencyOverviewConfigure entity); - - public abstract int update(EfficiencyOverviewConfigure entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/efficiency/EfficiencyOverviewMpConfigureService.java b/src/com/sipai/service/efficiency/EfficiencyOverviewMpConfigureService.java deleted file mode 100644 index 917c05ea..00000000 --- a/src/com/sipai/service/efficiency/EfficiencyOverviewMpConfigureService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.efficiency; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; - -public interface EfficiencyOverviewMpConfigureService { - - public abstract EfficiencyOverviewMpConfigure selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EfficiencyOverviewMpConfigure entity); - - public abstract int update(EfficiencyOverviewMpConfigure entity); - - public abstract List selectListByWhere(String unitId,String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/efficiency/EfficiencyStatisticsService.java b/src/com/sipai/service/efficiency/EfficiencyStatisticsService.java deleted file mode 100644 index fc288ddc..00000000 --- a/src/com/sipai/service/efficiency/EfficiencyStatisticsService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.service.efficiency; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import com.sipai.entity.efficiency.EfficiencyStatistics; - -import javax.servlet.http.HttpServletResponse; - -public interface EfficiencyStatisticsService { - - public abstract EfficiencyStatistics selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EfficiencyStatistics efficiencyStatistics); - - public abstract int update(EfficiencyStatistics efficiencyStatistics); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeList(List> list_result, List list); - - public abstract List getSum(String unitId, String dateType, String date); - - List getSum1(String unitId, String dateType, - String date); - - List getDetail(String id, String unitId, String dateType, - String date); - - /** - * 导出详细信息 - * @param unitId - * @param year - */ - void exportExcel(HttpServletResponse response, String unitId, String year) throws IOException; - - void cleanMap(); -} diff --git a/src/com/sipai/service/efficiency/WaterSpreadDataConfigureService.java b/src/com/sipai/service/efficiency/WaterSpreadDataConfigureService.java deleted file mode 100644 index eba7b97f..00000000 --- a/src/com/sipai/service/efficiency/WaterSpreadDataConfigureService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.efficiency; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import com.sipai.entity.efficiency.WaterSpreadDataConfigure; - -public interface WaterSpreadDataConfigureService { - - public abstract WaterSpreadDataConfigure selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(WaterSpreadDataConfigure entity); - - public abstract int update(WaterSpreadDataConfigure entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/efficiency/impl/ConstituteConfigureDetailServiceImpl.java b/src/com/sipai/service/efficiency/impl/ConstituteConfigureDetailServiceImpl.java deleted file mode 100644 index f1c561be..00000000 --- a/src/com/sipai/service/efficiency/impl/ConstituteConfigureDetailServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.efficiency.ConstituteConfigureDetailDao; -import com.sipai.entity.efficiency.ConstituteConfigureDetail; -import com.sipai.service.efficiency.ConstituteConfigureDetailService; - -@Service -public class ConstituteConfigureDetailServiceImpl implements ConstituteConfigureDetailService { - @Resource - private ConstituteConfigureDetailDao constituteConfigureDetailRecordDao; - - @Override - public ConstituteConfigureDetail selectById(String id) { - return this.constituteConfigureDetailRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.constituteConfigureDetailRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ConstituteConfigureDetail entity) { - return this.constituteConfigureDetailRecordDao.insert(entity); - } - - @Override - public int update(ConstituteConfigureDetail entity) { - return this.constituteConfigureDetailRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ConstituteConfigureDetail constituteConfigureDetail = new ConstituteConfigureDetail(); - constituteConfigureDetail.setWhere(wherestr); - List list = this.constituteConfigureDetailRecordDao.selectListByWhere(constituteConfigureDetail); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ConstituteConfigureDetail constituteConfigureDetail = new ConstituteConfigureDetail(); - constituteConfigureDetail.setWhere(wherestr); - return this.constituteConfigureDetailRecordDao.deleteByWhere(constituteConfigureDetail); - } -} diff --git a/src/com/sipai/service/efficiency/impl/ConstituteConfigureSchemeServiceImpl.java b/src/com/sipai/service/efficiency/impl/ConstituteConfigureSchemeServiceImpl.java deleted file mode 100644 index edc6fbfd..00000000 --- a/src/com/sipai/service/efficiency/impl/ConstituteConfigureSchemeServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.efficiency.ConstituteConfigureScheme; -import org.springframework.stereotype.Service; - -import com.sipai.dao.efficiency.ConstituteConfigureSchemeDao; -import com.sipai.service.efficiency.ConstituteConfigureSchemeService; - -@Service -public class ConstituteConfigureSchemeServiceImpl implements ConstituteConfigureSchemeService { - @Resource - private ConstituteConfigureSchemeDao constituteConfigureSchemeRecordDao; - - @Override - public ConstituteConfigureScheme selectById(String id) { - return this.constituteConfigureSchemeRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.constituteConfigureSchemeRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ConstituteConfigureScheme entity) { - return this.constituteConfigureSchemeRecordDao.insert(entity); - } - - @Override - public int update(ConstituteConfigureScheme entity) { - return this.constituteConfigureSchemeRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ConstituteConfigureScheme constituteConfigureScheme = new ConstituteConfigureScheme(); - constituteConfigureScheme.setWhere(wherestr); - List list = this.constituteConfigureSchemeRecordDao.selectListByWhere(constituteConfigureScheme); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ConstituteConfigureScheme constituteConfigureScheme = new ConstituteConfigureScheme(); - constituteConfigureScheme.setWhere(wherestr); - return this.constituteConfigureSchemeRecordDao.deleteByWhere(constituteConfigureScheme); - } - -} diff --git a/src/com/sipai/service/efficiency/impl/ConstituteConfigureServiceImpl.java b/src/com/sipai/service/efficiency/impl/ConstituteConfigureServiceImpl.java deleted file mode 100644 index c3cb1810..00000000 --- a/src/com/sipai/service/efficiency/impl/ConstituteConfigureServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.efficiency.ConstituteConfigureDao; -import com.sipai.entity.efficiency.ConstituteConfigure; -import com.sipai.service.efficiency.ConstituteConfigureService; - -@Service -public class ConstituteConfigureServiceImpl implements ConstituteConfigureService { - @Resource - private ConstituteConfigureDao constituteConfigureRecordDao; - - @Override - public ConstituteConfigure selectById(String id) { - return this.constituteConfigureRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.constituteConfigureRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ConstituteConfigure entity) { - return this.constituteConfigureRecordDao.insert(entity); - } - - @Override - public int update(ConstituteConfigure entity) { - return this.constituteConfigureRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ConstituteConfigure constituteConfigure = new ConstituteConfigure(); - constituteConfigure.setWhere(wherestr); - List list = this.constituteConfigureRecordDao.selectListByWhere(constituteConfigure); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ConstituteConfigure constituteConfigure = new ConstituteConfigure(); - constituteConfigure.setWhere(wherestr); - return this.constituteConfigureRecordDao.deleteByWhere(constituteConfigure); - } - - public JSONArray getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (ConstituteConfigure k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", "1"); - map.put("schemeId", k.getSchemeId()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (ConstituteConfigure k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", "2"); - m.put("schemeId", k.getSchemeId()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result); - } - -} diff --git a/src/com/sipai/service/efficiency/impl/EfficiencyOverviewConfigureAssemblyServiceImpl.java b/src/com/sipai/service/efficiency/impl/EfficiencyOverviewConfigureAssemblyServiceImpl.java deleted file mode 100644 index a016e5e0..00000000 --- a/src/com/sipai/service/efficiency/impl/EfficiencyOverviewConfigureAssemblyServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.efficiency.EfficiencyOverviewConfigureAssemblyDao; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigureAssembly; -import com.sipai.service.efficiency.EfficiencyOverviewConfigureAssemblyService; - -@Service -public class EfficiencyOverviewConfigureAssemblyServiceImpl implements EfficiencyOverviewConfigureAssemblyService { - @Resource - private EfficiencyOverviewConfigureAssemblyDao efficiencyOverviewConfigureAssemblyRecordDao; - - @Override - public EfficiencyOverviewConfigureAssembly selectById(String id) { - return this.efficiencyOverviewConfigureAssemblyRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.efficiencyOverviewConfigureAssemblyRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EfficiencyOverviewConfigureAssembly entity) { - return this.efficiencyOverviewConfigureAssemblyRecordDao.insert(entity); - } - - @Override - public int update(EfficiencyOverviewConfigureAssembly entity) { - return this.efficiencyOverviewConfigureAssemblyRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly = new EfficiencyOverviewConfigureAssembly(); - efficiencyOverviewConfigureAssembly.setWhere(wherestr); - List list = this.efficiencyOverviewConfigureAssemblyRecordDao.selectListByWhere(efficiencyOverviewConfigureAssembly); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EfficiencyOverviewConfigureAssembly efficiencyOverviewConfigureAssembly = new EfficiencyOverviewConfigureAssembly(); - efficiencyOverviewConfigureAssembly.setWhere(wherestr); - return this.efficiencyOverviewConfigureAssemblyRecordDao.deleteByWhere(efficiencyOverviewConfigureAssembly); - } - - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (EfficiencyOverviewConfigureAssembly k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (EfficiencyOverviewConfigureAssembly k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/efficiency/impl/EfficiencyOverviewConfigureServiceImpl.java b/src/com/sipai/service/efficiency/impl/EfficiencyOverviewConfigureServiceImpl.java deleted file mode 100644 index 51532e81..00000000 --- a/src/com/sipai/service/efficiency/impl/EfficiencyOverviewConfigureServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.efficiency.EfficiencyOverviewConfigureDao; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigure; -import com.sipai.service.efficiency.EfficiencyOverviewConfigureService; - -@Service -public class EfficiencyOverviewConfigureServiceImpl implements EfficiencyOverviewConfigureService { - @Resource - private EfficiencyOverviewConfigureDao efficiencyOverviewConfigureRecordDao; - - @Override - public EfficiencyOverviewConfigure selectById(String id) { - return this.efficiencyOverviewConfigureRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.efficiencyOverviewConfigureRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EfficiencyOverviewConfigure entity) { - return this.efficiencyOverviewConfigureRecordDao.insert(entity); - } - - @Override - public int update(EfficiencyOverviewConfigure entity) { - return this.efficiencyOverviewConfigureRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EfficiencyOverviewConfigure efficiencyOverviewConfigure = new EfficiencyOverviewConfigure(); - efficiencyOverviewConfigure.setWhere(wherestr); - List list = this.efficiencyOverviewConfigureRecordDao.selectListByWhere(efficiencyOverviewConfigure); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EfficiencyOverviewConfigure efficiencyOverviewConfigure = new EfficiencyOverviewConfigure(); - efficiencyOverviewConfigure.setWhere(wherestr); - return this.efficiencyOverviewConfigureRecordDao.deleteByWhere(efficiencyOverviewConfigure); - } -} diff --git a/src/com/sipai/service/efficiency/impl/EfficiencyOverviewMpConfigureServiceImpl.java b/src/com/sipai/service/efficiency/impl/EfficiencyOverviewMpConfigureServiceImpl.java deleted file mode 100644 index b6fe6262..00000000 --- a/src/com/sipai/service/efficiency/impl/EfficiencyOverviewMpConfigureServiceImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.dao.efficiency.EfficiencyOverviewMpConfigureDao; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.data.CurveRemark; -import com.sipai.entity.efficiency.EfficiencyOverviewConfigureAssembly; -import com.sipai.entity.efficiency.EfficiencyOverviewMpConfigure; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.EfficiencyOverviewConfigureAssemblyService; -import com.sipai.service.efficiency.EfficiencyOverviewMpConfigureService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Service -public class EfficiencyOverviewMpConfigureServiceImpl implements EfficiencyOverviewMpConfigureService { - @Resource - private EfficiencyOverviewMpConfigureDao efficiencyOverviewMpConfigureRecordDao; - @Resource - private EfficiencyOverviewConfigureAssemblyService efficiencyOverviewConfigureAssemblyService; - @Resource - private MPointService mPointService; - - @Override - public EfficiencyOverviewMpConfigure selectById(String id) { - return this.efficiencyOverviewMpConfigureRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.efficiencyOverviewMpConfigureRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EfficiencyOverviewMpConfigure entity) { - return this.efficiencyOverviewMpConfigureRecordDao.insert(entity); - } - - @Override - public int update(EfficiencyOverviewMpConfigure entity) { - return this.efficiencyOverviewMpConfigureRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String unitId,String wherestr) { - EfficiencyOverviewMpConfigure efficiencyOverviewMpConfigure = new EfficiencyOverviewMpConfigure(); - efficiencyOverviewMpConfigure.setWhere(wherestr); - List list = this.efficiencyOverviewMpConfigureRecordDao.selectListByWhere(efficiencyOverviewMpConfigure); - if (list!=null&&list.size()>0) { - for (EfficiencyOverviewMpConfigure item : list) { - if(item.getAssembly()!=null){ - EfficiencyOverviewConfigureAssembly assembly = efficiencyOverviewConfigureAssemblyService.selectById(item.getAssembly()); - item.setEfficiencyOverviewConfigureAssembly(assembly); - } - if(item.getMpid()!=null){ - MPoint mPoint=this.mPointService.selectById(unitId, item.getMpid()); - if(mPoint!=null){ - if(mPoint.getSignaltype().equals("AI")){ - double numTail=Double.valueOf(mPoint.getNumtail()); - String nString=""; - for(int n=0;n dlist =selectListByWhere(unitId," where picId='"+item.getId()+"' "); - if(dlist!=null&&dlist.size()>0){ - String mpid=dlist.get(0).getMpid(); - MPoint dmPoint=this.mPointService.selectById(unitId, mpid); - double dpv=dmPoint.getParmvalue().doubleValue(); - if(dpv==1){ - item.setShowParmValue("2"); - }else{ - double dpv2=0; - if(mPoint.getParmvalue()!=null){ - dpv2=mPoint.getParmvalue().doubleValue(); - } - item.setShowParmValue(String.valueOf(dpv2)); - } - }else{ - double dpv2=0; - if(mPoint.getParmvalue()!=null){ - dpv2=mPoint.getParmvalue().doubleValue(); - } - item.setShowParmValue(String.valueOf(dpv2)); - } - }else{ - double dpv2=0; - if(mPoint.getParmvalue()!=null){ - dpv2=mPoint.getParmvalue().doubleValue(); - } - item.setShowParmValue(String.valueOf(dpv2)); - } - } - item.setShowUnit(mPoint.getUnit()); - item.setmPoint(mPoint); - } - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EfficiencyOverviewMpConfigure efficiencyOverviewMpConfigure = new EfficiencyOverviewMpConfigure(); - efficiencyOverviewMpConfigure.setWhere(wherestr); - return this.efficiencyOverviewMpConfigureRecordDao.deleteByWhere(efficiencyOverviewMpConfigure); - } - -} diff --git a/src/com/sipai/service/efficiency/impl/EfficiencyStatisticsServiceImpl.java b/src/com/sipai/service/efficiency/impl/EfficiencyStatisticsServiceImpl.java deleted file mode 100644 index 88f33d1d..00000000 --- a/src/com/sipai/service/efficiency/impl/EfficiencyStatisticsServiceImpl.java +++ /dev/null @@ -1,547 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.efficiency.EfficiencyNumber; -import net.sf.json.JSONArray; - -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; - -import com.sipai.dao.efficiency.EfficiencyStatisticsDao; -import com.sipai.entity.efficiency.EfficiencyStatistics; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.efficiency.EfficiencyStatisticsService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; - -@Service -public class EfficiencyStatisticsServiceImpl implements EfficiencyStatisticsService { - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EfficiencyStatisticsDao efficiencyStatisticsDao; - @Resource - private MPointService mPointService; - - Map> efficiencyStatisticsMap = new HashMap<>(); - - public void cleanMap () { - efficiencyStatisticsMap.clear(); - } - - @Override - public EfficiencyStatistics selectById(String id) { - EfficiencyStatistics efficiencyStatistics = this.efficiencyStatisticsDao.selectByPrimaryKey(id); - if (efficiencyStatistics==null) { - return null; - } - if(efficiencyStatistics.getMpointId()==null){ - return efficiencyStatistics; - } - efficiencyStatistics.setmPoint(this.mPointService.selectById(efficiencyStatistics.getUnitId(), efficiencyStatistics.getMpointId())); - return efficiencyStatistics; - - } - - @Override - public int deleteById(String id) { - int code = this.efficiencyStatisticsDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(EfficiencyStatistics efficiencyStatistics) { - int code = this.efficiencyStatisticsDao.insert(efficiencyStatistics); - return code; - } - - @Override - public int update(EfficiencyStatistics efficiencyStatistics) { - int code = this.efficiencyStatisticsDao.updateByPrimaryKeySelective(efficiencyStatistics); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - EfficiencyStatistics efficiencyStatistics = new EfficiencyStatistics(); - efficiencyStatistics.setWhere(wherestr); - List list = this.efficiencyStatisticsDao.selectListByWhere(efficiencyStatistics); - for (EfficiencyStatistics item : list) { - item.setmPoint(this.mPointService.selectById(item.getUnitId(), item.getMpointId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EfficiencyStatistics efficiencyStatistics = new EfficiencyStatistics(); - efficiencyStatistics.setWhere(wherestr); - int code = this.efficiencyStatisticsDao.deleteByWhere(efficiencyStatistics); - return code; - } - - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (EfficiencyStatistics k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (EfficiencyStatistics k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - @Override - public List getSum(String unitId, String dateType, String date) { - List list = this.selectListByWhere("where pid='-1' and unit_id = '"+unitId+"' order by morder asc"); - - for (EfficiencyStatistics itemBig : list) { - List childList = this.selectListByWhere("where pid='"+itemBig.getId()+"' and unit_id = '"+unitId+"' order by morder asc"); - BigDecimal bigDecimal = new BigDecimal(0); - HashMap numberHashMap = new HashMap<>(); - if (dateType.equals("month")) { - // 是否未存 - if (efficiencyStatisticsMap.get(itemBig.getId()) == null) { - // 不同区域划分 - efficiencyStatisticsMap.put(itemBig.getId(), numberHashMap); - } else { - numberHashMap = efficiencyStatisticsMap.get(itemBig.getId()); - } - } - - for (EfficiencyStatistics itemSmall : childList) { - if (itemSmall.getmPoint()==null) { - itemSmall.setSum(new BigDecimal(0)); - continue; - } - MPointHistory value = this.mPointHistoryService.selectSumValueByTableAWhere(unitId, "TB_MP_"+itemSmall.getmPoint().getMpointcode(), - "where DATEDIFF("+dateType+", MeasureDT, '"+date+"')=0"); - if (value==null) { - itemSmall.setSum(new BigDecimal(0)); - } else { - itemSmall.setSum(value.getParmvalue()); - } - bigDecimal = bigDecimal.add(itemSmall.getSum()); - if (numberHashMap.get(itemSmall.getmPoint().getMpointcode()) == null) { - EfficiencyNumber efficiencyNumber = new EfficiencyNumber(); - efficiencyNumber.setSum(itemSmall.getSum()); - efficiencyNumber.setMax(itemSmall.getSum()); - efficiencyNumber.setMin(itemSmall.getSum()); - numberHashMap.put(itemSmall.getmPoint().getMpointcode(), efficiencyNumber); - } else { - EfficiencyNumber efficiencyNumber = numberHashMap.get(itemSmall.getmPoint().getMpointcode()); - // 最大值 - if (itemSmall.getSum().compareTo(efficiencyNumber.getMax()) == 1) { - efficiencyNumber.setMax(itemSmall.getSum()); - } - // 最小值 - if (itemSmall.getSum().compareTo(efficiencyNumber.getMax()) == -1) { - efficiencyNumber.setMin(itemSmall.getSum()); - } - // 累加值 - efficiencyNumber.setSum(efficiencyNumber.getSum().add(itemSmall.getSum())); - numberHashMap.put(itemSmall.getmPoint().getMpointcode(), efficiencyNumber); - efficiencyStatisticsMap.put(itemBig.getId(), numberHashMap); - } - } - itemBig.setSum(bigDecimal); - itemBig.setChildList(childList); - - } - return list; - } - - /**' - * 最大值 - * @param unitId - * @param year - * @return - */ - private BigDecimal getMax(String unitId, String year, String mpCode) { - List mPointHistories = this.mPointHistoryService.selectTopNumListByTableAWhere(unitId, "top 1", "TB_MP_" + mpCode, - "where YEAR(MeasureDT) = '" + year + "' order by ParmValue desc"); - if (mPointHistories != null && mPointHistories.size() > 0) { - return mPointHistories.get(0).getParmvalue(); - } - return new BigDecimal("0"); - } - - /** - * 最小值 - * @param unitId - * @param year - * @return - */ - private BigDecimal getMin(String unitId, String year, String mpCode) { - List mPointHistories = this.mPointHistoryService.selectTopNumListByTableAWhere(unitId, "top 1", "TB_MP_" + mpCode, - "where YEAR(MeasureDT) = '" + year + "' order by ParmValue asc"); - if (mPointHistories != null && mPointHistories.size() > 0) { - return mPointHistories.get(0).getParmvalue(); - } - return new BigDecimal("0"); - } - - @Override - public List getSum1(String unitId, String dateType, String date) { - List list = this.selectListByWhere("where pid='-1' and unit_id = '"+unitId+"' order by morder asc"); - - for (EfficiencyStatistics efficiencyStatistics : list) { - if (efficiencyStatistics.getmPoint()==null) { - efficiencyStatistics.setSum(new BigDecimal(0)); - continue; - } - MPointHistory value = this.mPointHistoryService.selectSumValueByTableAWhere(unitId, "TB_MP_"+efficiencyStatistics.getmPoint().getMpointcode(), - "where DATEDIFF("+dateType+", MeasureDT, '"+date+"')=0"); - if (value==null) { - efficiencyStatistics.setSum(new BigDecimal(0)); - }else { - efficiencyStatistics.setSum(value.getParmvalue()); - } - } - return list; - } - - @Override - public List getDetail(String id, String unitId, String dateType, String date) { - List list = this.selectListByWhere("where id='"+id+"' and unit_id = '"+unitId+"' order by morder asc"); - - for (EfficiencyStatistics itemBig : list) { - List childList = this.selectListByWhere("where pid='"+itemBig.getId()+"' and unit_id = '"+unitId+"' order by morder asc"); - BigDecimal bigDecimal = new BigDecimal(0); - - for (EfficiencyStatistics itemSmall : childList) { - if (itemSmall.getmPoint()==null) { - itemSmall.setSum(new BigDecimal(0)); - continue; - } - MPointHistory value = this.mPointHistoryService.selectSumValueByTableAWhere(unitId, "TB_MP_"+itemSmall.getmPoint().getMpointcode(), - "where DATEDIFF("+dateType+", MeasureDT, '"+date+"')=0"); - if (value==null) { - itemSmall.setSum(new BigDecimal(0)); - }else { - itemSmall.setSum(value.getParmvalue()); - } - bigDecimal = bigDecimal.add(itemSmall.getSum()); - } - - itemBig.setSum(bigDecimal); - itemBig.setChildList(childList); - - } - return list; - } - - @Override - public void exportExcel(HttpServletResponse response, String unitId, String year) throws IOException { - - String fileName = "能效统计表.xls"; - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(); - // 默认表格宽度 - int width = 8000; - - Boolean child = false; - // 设置表格每列的宽度 - List list = this.getSum(unitId, "year", ""+year+"-01-01"); - int length = 0; - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getChildList().size() > 0) { - child = true; - for (int x = -1; x < list.get(i).getChildList().size(); x++) { - length++; - sheet.setColumnWidth(length, width); - } - } else { - length++; - sheet.setColumnWidth(length, width); - } - } - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 800); - HSSFCell cellDate = row.createCell(0); - cellDate.setCellStyle(titleStyle); - HSSFRichTextString textDate = new HSSFRichTextString("日期"); - if (child) { - //合并列 - CellRangeAddress region=new CellRangeAddress(0, 1, 0, 0); - sheet.addMergedRegion(region); - } - cellDate.setCellValue(textDate); - // 如果有 子list - HSSFRow childRow = sheet.createRow(1); - // 年度第二行 - HSSFRow yearRow = sheet.createRow(1); - // 最大值 - HSSFRow maxValueRow = sheet.createRow(15); - // 最小值 - HSSFRow minValueRow = sheet.createRow(16); - // 平均值 - HSSFRow avgValueRow = sheet.createRow(17); - // 月度第三行 - int mRowNum = 2; - if (child) { - // 年度第三行 - yearRow = sheet.createRow(2); - // 月度第四行 - mRowNum = 3; - } - - // 年份 - HSSFCell yearCell = yearRow.createCell(0); - yearCell.setCellStyle(titleStyle); - yearCell.setCellValue(year); - - // 合并单元格 日期 数据 以及 合计 - int childNum = 0; - for (int i = 0; i < list.size(); i++) { - HSSFCell cell = row.createCell(i + childNum + 1); - HSSFCell yearRowCell = yearRow.createCell(i + 1); - if (list.get(i).getChildList().size() > 0) { - //合并列 size 不减去1 是因为 有合计但不在集合中 - CellRangeAddress region=new CellRangeAddress(0, 0, i + childNum + 1, i + childNum + list.get(i).getChildList().size() + 1); - sheet.addMergedRegion(region); - BigDecimal sum = new BigDecimal("0"); - for (int y = 0; y < list.get(i).getChildList().size(); y++) { - // 第二行 - HSSFCell cellx = childRow.createCell(i + childNum + 1 + y); - cellx.setCellStyle(titleStyle); - cellx.setCellValue(list.get(i).getChildList().get(y).getName()); - // 第三行年度数据 - HSSFCell yearRowCellx = yearRow.createCell(i + childNum + 1 + y); - yearRowCellx.setCellStyle(listStyle); - yearRowCellx.setCellValue(list.get(i).getChildList().get(y).getSum() == null ? "0" : list.get(i).getChildList().get(y).getSum().toString()); - sum = sum.add(list.get(i).getChildList().get(y).getSum()); - - } - // 第三行年度数据 合计 - HSSFCell yearRowCellSumx = yearRow.createCell(i + childNum + list.get(i).getChildList().size() + 1); - yearRowCellSumx.setCellStyle(listStyle); - yearRowCellSumx.setCellValue(sum.toString()); - HSSFCell cellx = childRow.createCell(i + childNum + list.get(i).getChildList().size() + 1); - cellx.setCellStyle(titleStyle); - cellx.setCellValue("合计"); - } - - HSSFRichTextString text = new HSSFRichTextString(list.get(i).getName()); - if (list.get(i).getChildList().size() == 0) { - HSSFCell cells = childRow.createCell(i + childNum + 1); - cells.setCellStyle(titleStyle); - cells.setCellValue("合计"); - yearRowCell.setCellStyle(listStyle); - yearRowCell.setCellValue(list.get(i).getSum() == null ? "0" : list.get(i).getSum().toString()); - } - cell.setCellStyle(titleStyle); - cell.setCellValue(text); - - childNum += list.get(i).getChildList().size(); - } - - // 最大值 - BigDecimal max = new BigDecimal("0"); - // 最小值 - BigDecimal min = new BigDecimal("0"); - // 平均值 - BigDecimal avg = new BigDecimal("0"); - HSSFCell maxValueRowCellName = maxValueRow.createCell(0); - maxValueRowCellName.setCellStyle(titleStyle); - maxValueRowCellName.setCellValue("最大值"); - HSSFCell minValueRowCellName = minValueRow.createCell(0); - minValueRowCellName.setCellStyle(titleStyle); - minValueRowCellName.setCellValue("最小值"); - HSSFCell avgValueRowCellName = avgValueRow.createCell(0); - avgValueRowCellName.setCellStyle(titleStyle); - avgValueRowCellName.setCellValue("平均值"); - - // 月份数据遍历 - for (int i = 1; i <= 12; i++) { - HSSFRow mRow = sheet.createRow(mRowNum); - mRowNum ++; - String date = year+"-0"+i+"-01"; - if (i > 9) { - date = year+"-"+i+"-01"; - } - List listMonth = this.getSum(unitId, "month", date); - // 月份是第一列 - HSSFCell cell = mRow.createCell(0); - cell.setCellStyle(titleStyle); - cell.setCellValue(i + "月份"); - childNum = 0; - for (int s = 0; s < listMonth.size(); s++) { - if (listMonth.get(s).getChildList().size() > 0) { - BigDecimal sum = new BigDecimal("0"); - for (int y = 0; y < listMonth.get(s).getChildList().size(); y++) { - HSSFCell cellx = mRow.createCell(y + childNum + 1 + s); - cellx.setCellStyle(listStyle); - cellx.setCellValue(listMonth.get(s).getChildList().get(y).getSum().toString()); - sum = sum.add(listMonth.get(s).getChildList().get(y).getSum()); - // 平均值 最大值 最小值 - HSSFCell maxValueRowCellY = maxValueRow.createCell(s + childNum + 2 + y); - HSSFCell minValueRowCellY = minValueRow.createCell(s + childNum + 2 + y); - HSSFCell avgValueRowCellY = avgValueRow.createCell(s + childNum + 2 + y); - maxValueRowCellY.setCellStyle(listStyle); - minValueRowCellY.setCellStyle(listStyle); - avgValueRowCellY.setCellStyle(listStyle); - // 合计单独最大值最小值平均值 - BigDecimal allAvg = new BigDecimal("0"); - BigDecimal allMax = new BigDecimal("0"); - BigDecimal allMin = new BigDecimal("0"); - for(EfficiencyNumber efficiencyNumber : efficiencyStatisticsMap.get(listMonth.get(s).getId()).values()) { - allMax = allMax.add(efficiencyNumber.getMax()); - allMin = allMin.add(efficiencyNumber.getMin()); - if (efficiencyNumber.getSum().compareTo(new BigDecimal("0")) == 1) { - allAvg = allAvg.add(efficiencyNumber.getSum().divide(new BigDecimal("12"),0, BigDecimal.ROUND_UP)); - } - } - maxValueRowCellY.setCellValue(allMax.toString()); - minValueRowCellY.setCellValue(allMin.toString()); - avgValueRowCellY.setCellValue(allAvg.toString()); - - // 最大值 - HSSFCell maxValueRowCell = maxValueRow.createCell(s + childNum + 1 + y); - maxValueRowCell.setCellStyle(listStyle); - maxValueRowCell.setCellValue(efficiencyStatisticsMap.get(listMonth.get(s).getId()).get(listMonth.get(s).getChildList().get(y).getmPoint().getMpointcode()).getMax().toString()); - // 最小值 - HSSFCell minValueRowCell = minValueRow.createCell(s + childNum + 1 + y); - minValueRowCell.setCellStyle(listStyle); - minValueRowCell.setCellValue(efficiencyStatisticsMap.get(listMonth.get(s).getId()).get(listMonth.get(s).getChildList().get(y).getmPoint().getMpointcode()).getMin().toString()); - // 平均值 - HSSFCell avgValueRowCell = avgValueRow.createCell(s + childNum + 1 + y); - avgValueRowCell.setCellStyle(listStyle); - avg = efficiencyStatisticsMap.get(listMonth.get(s).getId()).get(listMonth.get(s).getChildList().get(y).getmPoint().getMpointcode()).getSum(); - - if (avg.compareTo(new BigDecimal("0")) == 1) { - avg = avg.divide(new BigDecimal("12"),0, BigDecimal.ROUND_UP); - } - avgValueRowCell.setCellValue(avg.toString()); - } - // 合计 - HSSFCell yearRowCellSumx = mRow.createCell(s + childNum + listMonth.get(s).getChildList().size() + 1); - yearRowCellSumx.setCellStyle(listStyle); - yearRowCellSumx.setCellValue(sum.toString()); - } else { - //月份值 - HSSFCell mRowCell = mRow.createCell(s + childNum + 1); - mRowCell.setCellStyle(listStyle); - mRowCell.setCellValue(new BigDecimal("0").toString()); - // 最大值 - HSSFCell maxValueRowCell = maxValueRow.createCell(s + childNum + 1); - maxValueRowCell.setCellStyle(listStyle); - maxValueRowCell.setCellValue(new BigDecimal("0").toString()); - // 最小值 - HSSFCell minValueRowCell = minValueRow.createCell(s + childNum + 1); - minValueRowCell.setCellStyle(listStyle); - minValueRowCell.setCellValue(new BigDecimal("0").toString()); - // 平均值 - HSSFCell avgValueRowCell = avgValueRow.createCell(s + childNum + 1); - avgValueRowCell.setCellStyle(listStyle); - avgValueRowCell.setCellValue(new BigDecimal("0").toString()); - } - childNum += list.get(s).getChildList().size(); - } - } - - - efficiencyStatisticsMap.clear(); - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } -} diff --git a/src/com/sipai/service/efficiency/impl/WaterSpreadDataConfigureServiceImpl.java b/src/com/sipai/service/efficiency/impl/WaterSpreadDataConfigureServiceImpl.java deleted file mode 100644 index 920fd465..00000000 --- a/src/com/sipai/service/efficiency/impl/WaterSpreadDataConfigureServiceImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.service.efficiency.impl; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.dao.efficiency.WaterSpreadDataConfigureDao; -import com.sipai.entity.achievement.AcceptanceModelMPoint; -import com.sipai.entity.data.CurveRemark; -import com.sipai.entity.efficiency.WaterSpreadDataConfigure; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.efficiency.WaterSpreadDataConfigureService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Service -public class WaterSpreadDataConfigureServiceImpl implements WaterSpreadDataConfigureService { - @Resource - private WaterSpreadDataConfigureDao waterSpreadDataConfigureRecordDao; - @Resource - private MPointService mPointService; - - @Override - public WaterSpreadDataConfigure selectById(String id) { - return this.waterSpreadDataConfigureRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.waterSpreadDataConfigureRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WaterSpreadDataConfigure entity) { - return this.waterSpreadDataConfigureRecordDao.insert(entity); - } - - @Override - public int update(WaterSpreadDataConfigure entity) { - return this.waterSpreadDataConfigureRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WaterSpreadDataConfigure waterSpreadDataConfigure = new WaterSpreadDataConfigure(); - waterSpreadDataConfigure.setWhere(wherestr); - List list = this.waterSpreadDataConfigureRecordDao.selectListByWhere(waterSpreadDataConfigure); - if (list!=null&&list.size()>0) { - for (WaterSpreadDataConfigure item : list) { - MPoint mPoint=this.mPointService.selectById(item.getUnitId(), item.getMpid()); -// double numTail=Double.valueOf(mPoint.getNumtail()); -// String nString=""; -// for(int n=0;n{ - @Resource - private AssetClassDao assetClassDao; - @Resource - private EquipmentBelongService equipmentBelongService; - - @Override - public AssetClass selectById(String id) { - AssetClass assetClass = this.assetClassDao.selectByPrimaryKey(id); - if(assetClass!=null){ - if (null != assetClass.getEquipmentBelongId() && !assetClass.getEquipmentBelongId().isEmpty()) { - EquipmentBelong equipmentBelong = this.equipmentBelongService.selectById(assetClass.getEquipmentBelongId()); - assetClass.setEquipmentBelong(equipmentBelong); - } - } - - return assetClass; - } - - @Override - public int deleteById(String id) { - return this.assetClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AssetClass assetClass) { - return this.assetClassDao.insert(assetClass); - } - - @Override - public int update(AssetClass assetClass) { - return this.assetClassDao.updateByPrimaryKeySelective(assetClass); - } - - @Override - public List selectListByWhere(String wherestr) { - AssetClass assetClass = new AssetClass(); - assetClass.setWhere(wherestr); - return this.assetClassDao.selectListByWhere(assetClass); - } - - @Override - public int deleteByWhere(String wherestr) { - AssetClass assetClass = new AssetClass(); - assetClass.setWhere(wherestr); - return this.assetClassDao.deleteByWhere(assetClass); - } - - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String assetclassnumber) { - List list = this.selectListByWhere(" where assetclassnumber='"+assetclassnumber+"' order by insdt"); - if(id == null){//新增 - if(list!=null && list.size()>0){ - return true; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(AssetClass assetClass :list){ - if(!id.equals(assetClass.getId())){//不是当前编辑的那条记录 - return true; - } - } - } - } - return false; - } - - /** - * 根据list获取树形json - * @param list_result - * @param list - * @return - */ - public String getTreeListtest(List> list_result,List list) { - if(list_result == null ) { - list_result = new ArrayList>(); - for(AssetClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getAssetclassname()); - map.put("num", k.getAssetclassnumber()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeListtest(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(AssetClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getAssetclassname()); - m.put("num", k.getAssetclassnumber()); - m.put("depreciablelife", k.getDepreciablelife()); - m.put("netsalvageratio", k.getNetsalvageratio()); - m.put("pid", k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - getTreeListtest(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - List t = new ArrayList(); - public List getUnitChildrenById(String id){ - t=selectListByWhere(" where 1=1 order by assetClassNumber"); - List listRes = getChildren(id,t); - listRes.add(selectById(id)); - listRes.removeAll(Collections.singleton(null)); - return listRes; - } - - /** - * 递归获取子节点 - * @param list - */ - public List getChildren(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0;i result=getChildren(t.get(i).getId(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(AssetClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getAssetclassname()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(AssetClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getAssetclassname()); -// List tags = new ArrayList(); -// tags.add(k.getDescription()); -// m.put("tags", tags); - childlist.add(m); - } - } - if(childlist.size()>0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/equipment/CharacteristicService.java b/src/com/sipai/service/equipment/CharacteristicService.java deleted file mode 100644 index cf1ccade..00000000 --- a/src/com/sipai/service/equipment/CharacteristicService.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.CharacteristicDao; -import com.sipai.entity.equipment.Characteristic; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Unit; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -@Service -public class CharacteristicService implements CommService{ - @Resource - private CharacteristicDao characteristicDao; - - @Override - public Characteristic selectById(String id) { - Characteristic characteristic = this.characteristicDao.selectByPrimaryKey(id); - - return characteristic; - } - - @Override - public int deleteById(String id) { - return this.characteristicDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Characteristic characteristic) { - return this.characteristicDao.insert(characteristic); - } - - @Override - public int update(Characteristic characteristic) { - return this.characteristicDao.updateByPrimaryKeySelective(characteristic); - } - - @Override - public List selectListByWhere(String wherestr) { - Characteristic characteristic = new Characteristic(); - characteristic.setWhere(wherestr); - return this.characteristicDao.selectListByWhere(characteristic); - } - - @Override - public int deleteByWhere(String wherestr) { - Characteristic characteristic = new Characteristic(); - characteristic.setWhere(wherestr); - return this.characteristicDao.deleteByWhere(characteristic); - } - - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String assetclassnumber) { - List list = this.selectListByWhere(" where assetclassnumber='"+assetclassnumber+"' order by insdt"); - if(id == null){//新增 - if(list!=null && list.size()>0){ - return true; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(Characteristic characteristic :list){ - if(!id.equals(characteristic.getId())){//不是当前编辑的那条记录 - return true; - } - } - } - } - return false; - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentAcceptanceApplyDetailService.java b/src/com/sipai/service/equipment/EquipmentAcceptanceApplyDetailService.java deleted file mode 100644 index 2981830e..00000000 --- a/src/com/sipai/service/equipment/EquipmentAcceptanceApplyDetailService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentAcceptanceApplyDetailDao; -import com.sipai.entity.equipment.EquipmentAcceptanceApplyDetail; -import com.sipai.tools.CommService; - - -@Service -public class EquipmentAcceptanceApplyDetailService implements CommService{ - @Resource - private EquipmentAcceptanceApplyDetailDao equipmentAcceptanceApplyDetailDao; - - @Override - public EquipmentAcceptanceApplyDetail selectById(String t) { - EquipmentAcceptanceApplyDetail eaad= equipmentAcceptanceApplyDetailDao.selectByPrimaryKey(t); - return eaad; - } - - @Override - public int deleteById(String t) { - int resultNum=equipmentAcceptanceApplyDetailDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(EquipmentAcceptanceApplyDetail t) { - int resultNum=equipmentAcceptanceApplyDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentAcceptanceApplyDetail t) { - int resultNum=equipmentAcceptanceApplyDetailDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentAcceptanceApplyDetail eaad=new EquipmentAcceptanceApplyDetail(); - eaad.setWhere(t); - return equipmentAcceptanceApplyDetailDao.selectListByWhere(eaad); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentAcceptanceApplyDetail eaad=new EquipmentAcceptanceApplyDetail(); - eaad.setWhere(t); - int resultNum=equipmentAcceptanceApplyDetailDao.deleteByWhere(eaad); - return resultNum; - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentAcceptanceApplyService.java b/src/com/sipai/service/equipment/EquipmentAcceptanceApplyService.java deleted file mode 100644 index c526131f..00000000 --- a/src/com/sipai/service/equipment/EquipmentAcceptanceApplyService.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentAcceptanceApplyDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentAcceptanceApply; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentAcceptanceApplyService implements CommService{ - @Resource - private EquipmentAcceptanceApplyDao equipmentAcceptanceApplyDao; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private RuntimeService runtimeService; - - @Override - public EquipmentAcceptanceApply selectById(String t) { - EquipmentAcceptanceApply eaa=equipmentAcceptanceApplyDao.selectByPrimaryKey(t); - return eaa; - } - - @Override - public int deleteById(String t) { - EquipmentAcceptanceApply eaa=this.selectById(t); - String pInstancId=eaa.getProcessid(); - if(null!=pInstancId){ - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(pInstancId) - .singleResult(); - if(pInstance!=null){ - workflowService.delProcessInstance(pInstancId); - } - } - - int resultNum=equipmentAcceptanceApplyDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(EquipmentAcceptanceApply t) { - int resultNum=equipmentAcceptanceApplyDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentAcceptanceApply t) { - int resultNum=equipmentAcceptanceApplyDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentAcceptanceApply eaa=new EquipmentAcceptanceApply(); - eaa.setWhere(t); - return equipmentAcceptanceApplyDao.selectListByWhere(eaa); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentAcceptanceApply eaa=new EquipmentAcceptanceApply(); - eaa.setWhere(t); - return equipmentAcceptanceApplyDao.deleteByWhere(eaa); - - } - - - /** - * 启动设备验收审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(EquipmentAcceptanceApply eaa) { - try { - Map variables = new HashMap(); - if(!eaa.getAuditId().isEmpty()){ - variables.put("userIds", eaa.getAuditId()); - variables.put("groupIds", "0AY"); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - variables.put("groupIds", "0AY"); - List processDefinitions - =workflowProcessDefinitionService.getProcessDefsBykey - (ProcessType.Acceptance_Apply.getId()+"-"+eaa.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(eaa.getId(), eaa.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - eaa.setProcessid(processInstance.getId()); - eaa.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(eaa.getProcessid()).singleResult(); - eaa.setStatus(task.getName()); - EquipmentAcceptanceApply eaaApply = this.selectById(eaa.getId()); - int res = 0; - if(null == eaaApply){ - res = this.save(eaa); - }else { - res = this.update(eaa); - } - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(eaa); - businessUnitRecord.sendMessage(eaa.getAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 验收审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - EquipmentAcceptanceApply eaa = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(eaa.getProcessid()).singleResult(); - if (task!=null) { - eaa.setStatus(task.getName()); - }else{ - eaa.setStatus(null); - } - int res =this.update(eaa); - return res; - } -} - - - diff --git a/src/com/sipai/service/equipment/EquipmentAccidentDetailService.java b/src/com/sipai/service/equipment/EquipmentAccidentDetailService.java deleted file mode 100644 index ed93718c..00000000 --- a/src/com/sipai/service/equipment/EquipmentAccidentDetailService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; -import com.sipai.dao.equipment.EquipmentAccidentDetailDao; -import com.sipai.entity.equipment.EquipmentAccidentDetail; -import com.sipai.tools.CommService; - -@Service -public class EquipmentAccidentDetailService implements - CommService { - @Resource - private EquipmentAccidentDetailDao equipmentAccidentDetailDao; - - @Override - public EquipmentAccidentDetail selectById(String t) { - EquipmentAccidentDetail ead=equipmentAccidentDetailDao.selectByPrimaryKey(t); - return ead; - } - - @Override - public int deleteById(String t) { - int resultNum=equipmentAccidentDetailDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(EquipmentAccidentDetail t) { - int resultNum=equipmentAccidentDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentAccidentDetail t) { - int resultNum=equipmentAccidentDetailDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentAccidentDetail ead=new EquipmentAccidentDetail(); - ead.setWhere(t); - return equipmentAccidentDetailDao.selectListByWhere(ead); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentAccidentDetail ead=new EquipmentAccidentDetail(); - ead.setWhere(t); - int resultNum=equipmentAccidentDetailDao.deleteByWhere(ead); - return resultNum; - - } -} diff --git a/src/com/sipai/service/equipment/EquipmentAccidentService.java b/src/com/sipai/service/equipment/EquipmentAccidentService.java deleted file mode 100644 index e8d756de..00000000 --- a/src/com/sipai/service/equipment/EquipmentAccidentService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentAccidentDao; -import com.sipai.entity.equipment.EquipmentAccident; -import com.sipai.tools.CommService; - -@Service -public class EquipmentAccidentService implements CommService{ - @Resource - private EquipmentAccidentDao equipmentAccidentDao; - - @Override - public EquipmentAccident selectById(String t) { - EquipmentAccident ea=equipmentAccidentDao.selectByPrimaryKey(t); - return ea; - } - - @Override - public int deleteById(String t) { - int resultNum=equipmentAccidentDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(EquipmentAccident t) { - int resultNum=equipmentAccidentDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentAccident t) { - int resultNum=equipmentAccidentDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentAccident ea=new EquipmentAccident(); - ea.setWhere(t); - return equipmentAccidentDao.selectListByWhere(ea); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentAccident ea=new EquipmentAccident(); - ea.setWhere(t); - int resultNum=equipmentAccidentDao.deleteByWhere(ea); - return resultNum; - - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentArrangementService.java b/src/com/sipai/service/equipment/EquipmentArrangementService.java deleted file mode 100644 index a60f6af1..00000000 --- a/src/com/sipai/service/equipment/EquipmentArrangementService.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentArrangementDao; -import com.sipai.entity.equipment.EquipmentArrangement; -import com.sipai.entity.work.GroupManage; -import com.sipai.service.work.GroupManageService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentArrangementService implements CommService{ - @Resource - private EquipmentArrangementDao equipmentArrangementDao; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private GroupManageService groupManageService; - - public List selectList() { - // TODO Auto-generated method stub - EquipmentArrangement equipmentclass = new EquipmentArrangement(); - return this.equipmentArrangementDao.selectList(equipmentclass); - } - - - @Override - public EquipmentArrangement selectById(String id) { - return this.equipmentArrangementDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentArrangementDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentArrangement entity) { - entity =CommUtil.getRealTime4EuipArrangement(entity); - return this.equipmentArrangementDao.insert(entity); - } - - @Override - public int update(EquipmentArrangement t) { - t =CommUtil.getRealTime4EuipArrangement(t); - return this.equipmentArrangementDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentArrangement equipmentclass = new EquipmentArrangement(); - equipmentclass.setWhere(wherestr); - List equipmentArrangements=this.equipmentArrangementDao.selectListByWhere(equipmentclass); -// for (EquipmentArrangement equipmentArrangement : equipmentArrangements) { -// equipmentArrangement.setEquipmentCard(equipmentCardService.getEquipmentCardById(equipmentArrangement.getEquipmentid())); -// } - return equipmentArrangements; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentArrangement equipmentclass = new EquipmentArrangement(); - equipmentclass.setWhere(wherestr); - return this.equipmentArrangementDao.deleteByWhere(equipmentclass); - } - /*获取相应设备的清单及安排情况 - * flag,是否是新增状态,false情况下可查看时间安排情况,true默认都未安排过 - * equipmentid,设备id - * arrangementdate 安排日期 - * wherestr除设备id-equipmentid和安排日期arrangement外的查询语句 - * */ - public List selectEquipArrangementByWhere(Boolean flag,String wherestr,String equipmentid,String arrangementdate) { - EquipmentArrangement equipmentArrangement = new EquipmentArrangement(); - if(wherestr==null || wherestr.isEmpty()){ - wherestr =" where 1=1 "; - } - String wstr_arrange=""; - if(arrangementdate!=null && !arrangementdate.isEmpty()){ - wstr_arrange =" and arrangementdate='"+arrangementdate+"' "; - } - wherestr+=" and equipmentid='"+equipmentid+"' "+wstr_arrange+" "; - equipmentArrangement.setWhere(wherestr); - List equipmentArrangements=this.equipmentArrangementDao.selectEquipArrangementByWhere(equipmentArrangement); - //去除多余的groupManage - List groupManages =groupManageService.selectListByDate(arrangementdate); - Iterator iterator =equipmentArrangements.iterator(); - while (iterator.hasNext()) { - EquipmentArrangement eItem = iterator.next(); - boolean flagItem=false; - for (GroupManage groupManage : groupManages) { - if(groupManage.getId().equals(eItem.getGroupManageid())){ - flagItem=true; //发现目标 - break; - } - } - if(!flagItem){ - iterator.remove(); - } - - } - //若无开始时间默认班次开始时间 - for (EquipmentArrangement item : equipmentArrangements) { - if(item.getStdt()==null || item.getStdt().isEmpty()){ - //查找设备当天是否被分配过,若分配过则用最后一次分配的结束时间作为新的开始时间 - List oldlist=this.selectListByWhere("where groupManageid='"+item.getGroupManageid()+"' and equipmentid='"+equipmentid+"' "+wstr_arrange+" order by enddt desc"); - if(oldlist==null ||oldlist.size()==0){ - item.setStdt(item.getGt_sdt()); - }else{ - item.setStdt(oldlist.get(0).getEnddt()); - } - - } - if(item.getEnddt()==null || item.getEnddt().isEmpty()){ - item.setEnddt(item.getGt_enddt()); - if(!flag){ //新增页面默认checkflag都是true,编辑页面则根据情况修改 - item.setCheckFlag(false); - } - } - //若开始时间等于结束时间则不显示 - if(item.getStdt()!=null && item.getEnddt()!=null &&item.getStdt().substring(11,16).equals(item.getEnddt().substring(11,16))){ - item.setCheckFlag(false); - } - } - return equipmentArrangements; - } -} diff --git a/src/com/sipai/service/equipment/EquipmentBelongService.java b/src/com/sipai/service/equipment/EquipmentBelongService.java deleted file mode 100644 index f10ff461..00000000 --- a/src/com/sipai/service/equipment/EquipmentBelongService.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentBelongDao; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.tools.CommService; - - -@Service -public class EquipmentBelongService implements CommService{ - - @Resource - private EquipmentBelongDao equipmentBelongDao; - - @Override - public EquipmentBelong selectById(String t) { - // TODO Auto-generated method stub - return equipmentBelongDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentBelongDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EquipmentBelong t) { - // TODO Auto-generated method stub - return equipmentBelongDao.insert(t); - - } - - @Override - public int update(EquipmentBelong t) { - // TODO Auto-generated method stub - return equipmentBelongDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentBelong equipmentBelong = new EquipmentBelong(); - equipmentBelong.setWhere(t); - return equipmentBelongDao.selectListByWhere(equipmentBelong); - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentBelong equipmentBelong = new EquipmentBelong(); - equipmentBelong.setWhere(t); - return equipmentBelongDao.deleteByWhere(equipmentBelong); - } - - public List selectDistinctBeToByComapnyId(String companyId) { - return equipmentBelongDao.selectDistinctBeToByComapnyId(companyId); - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentCardCameraService.java b/src/com/sipai/service/equipment/EquipmentCardCameraService.java deleted file mode 100644 index 5915f407..00000000 --- a/src/com/sipai/service/equipment/EquipmentCardCameraService.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.equipment.EquipmentCard; -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardCameraDao; -import com.sipai.entity.equipment.EquipmentCardCamera; -import com.sipai.entity.work.Camera; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; - -@Service("equipmentCardCameraService") -public class EquipmentCardCameraService implements CommService { - @Resource - private EquipmentCardCameraDao equipmentCardCameraDao; - @Resource - private CameraService cameraService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public EquipmentCardCamera selectById(String t) { - // TODO Auto-generated method stub - return equipmentCardCameraDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentCardCameraDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EquipmentCardCamera t) { - // TODO Auto-generated method stub - return equipmentCardCameraDao.insert(t); - - } - - @Override - public int update(EquipmentCardCamera t) { - // TODO Auto-generated method stub - return equipmentCardCameraDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCardCamera equipmentCardCamera = new EquipmentCardCamera(); - equipmentCardCamera.setWhere(t); - List list = equipmentCardCameraDao.selectListByWhere(equipmentCardCamera); - if (list != null && list.size() > 0) { - for (EquipmentCardCamera ec : list) { - Camera camera = this.cameraService.selectById(ec.getCameraid()); - if (camera != null) { - ec.setCamera(camera); - } - EquipmentCard equipmentCard = this.equipmentCardService.selectById(ec.getEqid()); - if (equipmentCard != null) { - ec.setEquipmentCard(equipmentCard); - } - } - } - return list; - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCardCamera equipmentCardCamera = new EquipmentCardCamera(); - equipmentCardCamera.setWhere(t); - return equipmentCardCameraDao.deleteByWhere(equipmentCardCamera); - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentCardLinksParameterService.java b/src/com/sipai/service/equipment/EquipmentCardLinksParameterService.java deleted file mode 100644 index 4ceb620a..00000000 --- a/src/com/sipai/service/equipment/EquipmentCardLinksParameterService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardLinksParameterDao; -import com.sipai.entity.equipment.EquipmentCardLinksParameter; -import com.sipai.tools.CommService; - -@Service -public class EquipmentCardLinksParameterService implements CommService{ - - @Resource - private EquipmentCardLinksParameterDao equipmentCardLinksParameterDao; - - @Override - public EquipmentCardLinksParameter selectById(String t) { - // TODO Auto-generated method stub - return equipmentCardLinksParameterDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentCardLinksParameterDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentCardLinksParameter t) { - // TODO Auto-generated method stub - return equipmentCardLinksParameterDao.insert(t); - - } - - @Override - public int update(EquipmentCardLinksParameter t) { - // TODO Auto-generated method stub - return equipmentCardLinksParameterDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCardLinksParameter equipmentCardLinksParameter = new EquipmentCardLinksParameter(); - equipmentCardLinksParameter.setWhere(t); - return equipmentCardLinksParameterDao.selectListByWhere(equipmentCardLinksParameter); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCardLinksParameter equipmentCardLinksParameter = new EquipmentCardLinksParameter(); - equipmentCardLinksParameter.setWhere(t); - return equipmentCardLinksParameterDao.deleteByWhere(equipmentCardLinksParameter); - - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentCardLinksService.java b/src/com/sipai/service/equipment/EquipmentCardLinksService.java deleted file mode 100644 index 1fc8d374..00000000 --- a/src/com/sipai/service/equipment/EquipmentCardLinksService.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.sipai.service.equipment; - -import com.sipai.dao.equipment.EquipmentCardDao; -import com.sipai.dao.equipment.EquipmentCardLinksDao; -import com.sipai.entity.base.BasicComponents; -import com.sipai.entity.equipment.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@Service -public class EquipmentCardLinksService implements CommService{ - - @Resource - private EquipmentCardLinksDao equipmentCardLinksDao; - @Resource - private EquipmentCardLinksParameterService equipmentCardLinksParameterService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private BasicComponentsService basicComponentsService; - @Resource - private EquipmentCardDao equipmentCardDao; - @Resource - private EquipmentLevelService equipmentLevelService; - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - @Resource - private UnitService untiService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - - @Override - public EquipmentCardLinks selectById(String t) { - // TODO Auto-generated method stub - EquipmentCardLinks equipmentCardLinks = equipmentCardLinksDao.selectByPrimaryKey(t); - if (equipmentCardLinks.getId()!= null && !equipmentCardLinks.getId().isEmpty()) { - List linksParameterList = equipmentCardLinksParameterService.selectListByWhere( - "where link_id='"+equipmentCardLinks.getId()+"' and active ='"+CommString.Active_True+"' order by morder"); - equipmentCardLinks.setLinksParameterList(linksParameterList); - } - return equipmentCardLinks; - } - public EquipmentCardLinks selectById(String t,String equipmentCardId) { - // TODO Auto-generated method stub - EquipmentCardLinks equipmentCardLinks = equipmentCardLinksDao.selectByPrimaryKey(t); - EquipmentCard equipmentCard = new EquipmentCard(); - if (equipmentCardId!= null && !equipmentCardId.isEmpty()) { - equipmentCard = this.equipmentCardService.selectById(equipmentCardId); - } - equipmentCardLinks.setEquipmentCard(equipmentCard); - if (equipmentCardLinks.getId()!= null && !equipmentCardLinks.getId().isEmpty()) { - List linksParameterList = equipmentCardLinksParameterService.selectListByWhere( - "where link_id='"+equipmentCardLinks.getId()+"' and active ='"+CommString.Active_True+"' order by morder"); - equipmentCardLinks.setLinksParameterList(linksParameterList); - } - return equipmentCardLinks; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentCardLinksDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentCardLinks t) { - // TODO Auto-generated method stub - return equipmentCardLinksDao.insert(t); - - } - - @Override - public int update(EquipmentCardLinks t) { - // TODO Auto-generated method stub - return equipmentCardLinksDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCardLinks equipmentCardLinks = new EquipmentCardLinks(); - equipmentCardLinks.setWhere(t); - List list = equipmentCardLinksDao.selectListByWhere(equipmentCardLinks); - if(list!=null && list.size()>0){ - for(EquipmentCardLinks item : list){ - if (item.getId()!= null && !item.getId().isEmpty()) { - List linksParameterList = equipmentCardLinksParameterService.selectListByWhere( - "where link_id='"+item.getId()+"' and active ='"+CommString.Active_True+"' order by morder"); - item.setLinksParameterList(linksParameterList); - } - } - } - return list; - } - - public List selectListByWhere(String t,String equipmentCardId,HttpServletRequest request) { - // TODO Auto-generated method stub - String serverName = request.getServerName(); - boolean intranet = true;//默认true为内网地址,false为外网地址 - List basicComponents_list = basicComponentsService.selectListByWhere("where active='1' and code like '%link-ip-extranet%' order by morder "); - if(basicComponents_list!=null && basicComponents_list.size()>0){ - //获取配置的外网ip - BasicComponents basicComponents =basicComponents_list.get(0); - if(basicComponents.getBasicConfigure()!=null){ - if(serverName.equals(basicComponents.getBasicConfigure().getUrl())){ - intranet = false; - } - } - } - EquipmentCardLinks equipmentCardLinks = new EquipmentCardLinks(); - equipmentCardLinks.setWhere(t); - List list = equipmentCardLinksDao.selectListByWhere(equipmentCardLinks); - if(list!=null && list.size()>0){ - EquipmentCard equipmentCard = new EquipmentCard(); - if (equipmentCardId!= null && !equipmentCardId.isEmpty()) { - equipmentCard = this.equipmentCardService.selectById(equipmentCardId); - } - for(EquipmentCardLinks item : list){ - if (item.getId()!= null && !item.getId().isEmpty()) { - List linksParameterList = equipmentCardLinksParameterService.selectListByWhere( - "where link_id='"+item.getId()+"' and active ='"+CommString.Active_True+"' order by morder"); - item.setLinksParameterList(linksParameterList); - } - item.setEquipmentCard(equipmentCard); - if(item.getLinkType()!=null && item.getLinkType().equals("external")){ - //外部系统接口,根据本项目的访问地址判断 - String linkUrl = item.getLinkUrl(); - String linkIpIntranet = item.getLinkIpIntranet(); - String linkIpExtranet = item.getLinkIpExtranet(); - if(intranet){ - //内网地址 - if(linkUrl.startsWith("/")){ - if(linkIpIntranet.endsWith("/")){ - linkUrl = linkIpIntranet.substring(0, linkIpIntranet.length()-1)+linkUrl; - }else{ - linkUrl = linkIpIntranet+linkUrl; - } - }else{ - if(linkIpIntranet.endsWith("/")){ - linkUrl = linkIpIntranet+linkUrl; - }else{ - linkUrl = linkIpIntranet+"/"+linkUrl; - } - } - }else{ - //外网地址 - if(linkUrl.startsWith("/")){ - if(linkIpExtranet.endsWith("/")){ - linkUrl = linkIpExtranet.substring(0, linkIpExtranet.length()-1)+linkUrl; - }else{ - linkUrl = linkIpExtranet+linkUrl; - } - }else{ - if(linkIpExtranet.endsWith("/")){ - linkUrl = linkIpExtranet+linkUrl; - }else{ - linkUrl = linkIpExtranet+"/"+linkUrl; - } - } - } - item.setLinkUrl(linkUrl); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCardLinks equipmentCardLinks = new EquipmentCardLinks(); - equipmentCardLinks.setWhere(t); - return equipmentCardLinksDao.deleteByWhere(equipmentCardLinks); - - } - - /** - * 设备台账获取table数据 增加tab_links数据 - * njp 2022-04-11 - * - * @param wherestr - * @return - */ - public List selectListByEquipmentCard(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getEquipmentlevelid() && !item.getEquipmentlevelid().isEmpty()) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(item.getEquipmentlevelid()); - item.setEquipmentLevel(equipmentLevel); - } - if (null != item.getEquipmentstatus() && !item.getEquipmentstatus().isEmpty()) { - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(item.getEquipmentstatus()); - item.setEquipmentStatusManagement(equipmentStatusManagement); - } - if (null != item.getEquipmentclassid() && !item.getEquipmentclassid().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getEquipmentclassid()); - item.setEquipmentClass(equipmentClass); - } - if (null != item.getBizid() && !item.getBizid().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - if (null != item.getProcesssectionid() && !item.getProcesssectionid().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSection(processSection); - } - if (null != item.getId() && !item.getId().isEmpty()) { - List equipmentCardLinks = this.selectListByWhere("where equipment_id='"+item.getId()+"' order by insdt desc"); - if(equipmentCardLinks!=null && equipmentCardLinks.size()>0){ - item.setEquipmentStatusMemo("已配置"); - }else{ - item.setEquipmentStatusMemo("未配置"); - } - } - } - return equipmentCards; - } -} diff --git a/src/com/sipai/service/equipment/EquipmentCardPropService.java b/src/com/sipai/service/equipment/EquipmentCardPropService.java deleted file mode 100644 index f6bd28da..00000000 --- a/src/com/sipai/service/equipment/EquipmentCardPropService.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardPropDao; -import com.sipai.entity.equipment.EquipmentAge; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.sparepart.Contract; -import com.sipai.service.sparepart.ContractService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentCardPropService implements CommService{ - @Resource - private EquipmentCardPropDao equipmentCardPropDao; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private ContractService contractService; - - @Override - public EquipmentCardProp selectById(String id) { - EquipmentCardProp equipmentCardProp = this.equipmentCardPropDao.selectByPrimaryKey(id); - if(equipmentCardProp!=null && equipmentCardProp.getSpecification() !=null && !equipmentCardProp.getSpecification().equals("")){ - EquipmentSpecification equipmentSpecification= this.equipmentSpecificationService.selectById(equipmentCardProp.getSpecification()); - equipmentCardProp.setEquipmentSpecification(equipmentSpecification); - - } - return equipmentCardProp; - } - - @Override - public int deleteById(String id) { - return this.equipmentCardPropDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentCardProp equipmentCardProp) { - return this.equipmentCardPropDao.insert(equipmentCardProp); - } - - @Override - public int update(EquipmentCardProp equipmentCardProp) { - equipmentCardProp.setInsdt(CommUtil.nowDate()); - return this.equipmentCardPropDao.updateByPrimaryKeySelective(equipmentCardProp); - } - - - @Override - public List selectListByWhere(String wherestr) { - EquipmentCardProp equipmentCardProp = new EquipmentCardProp(); - equipmentCardProp.setWhere(wherestr); - List equipmentCardProps = this.equipmentCardPropDao.selectListByWhere(equipmentCardProp); - for (EquipmentCardProp item: equipmentCardProps) { - if(item!=null && item.getSpecification() !=null && !item.getSpecification().equals("")){ - EquipmentSpecification equipmentSpecification= this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - - } - - return equipmentCardProps; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentCardProp equipmentCardProp = new EquipmentCardProp(); - equipmentCardProp.setWhere(wherestr); - return this.equipmentCardPropDao.deleteByWhere(equipmentCardProp); - } - - public EquipmentCardProp selectByEquipmentId(String equipmentId) { - EquipmentCardProp equipmentCardProp = new EquipmentCardProp(); - equipmentCardProp.setWhere("where equipment_id = '"+equipmentId+"'"); - Listlist = this.equipmentCardPropDao.selectListByWhere(equipmentCardProp); - if (null!= list && list.size()>0) { - equipmentCardProp = list.get(0); - String contractIds =""; - String contractName = ""; - if(equipmentCardProp!=null && equipmentCardProp.getSpecification() !=null && !equipmentCardProp.getSpecification().equals("")){ - EquipmentSpecification equipmentSpecification= this.equipmentSpecificationService.selectById(equipmentCardProp.getSpecification()); - equipmentCardProp.setEquipmentSpecification(equipmentSpecification); - } - if(equipmentCardProp!=null && equipmentCardProp.getContractId() !=null && !equipmentCardProp.getContractId().equals("")){ - contractIds = equipmentCardProp.getContractId().replace(",","','"); - List contractList = this.contractService.selectListByWhere("where id in ('"+contractIds+"')"); - contractName = ""; - for(Contract contract : contractList){ - contractName+=contract.getContractname()+","; - } - equipmentCardProp.set_contractName(contractName); - } - } - return equipmentCardProp; - } - - public List selectAgeListByWhere(String wherestr) { - EquipmentAge equipmentAge = new EquipmentAge(); - equipmentAge.setWhere(wherestr); - Listlist = this.equipmentCardPropDao.selectAgeListByWhere(equipmentAge); - for(EquipmentAge item :list ){ - if (null != item.getEquipmentmodel() && !item.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(item.getEquipmentmodel()); - item.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCard equipmentCard = equipmentCardService.selectById(item.getId()); - if(equipmentCard!=null){ - item.setEquipmentmodelname(equipmentCard.getEquipmentmodelname()); - } - } - - } - return list; - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentCardService.java b/src/com/sipai/service/equipment/EquipmentCardService.java deleted file mode 100644 index e8513cda..00000000 --- a/src/com/sipai/service/equipment/EquipmentCardService.java +++ /dev/null @@ -1,9787 +0,0 @@ -package com.sipai.service.equipment; - -import com.sipai.dao.equipment.EquipmentCardDao; -import com.sipai.dao.equipment.EquipmentCardPropDao; -import com.sipai.entity.enums.PatrolType; -import com.sipai.entity.equipment.*; -import com.sipai.entity.finance.FinanceEquipmentDeptInfo; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.*; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.company.CompanyService; -import com.sipai.service.finance.FinanceEquipmentDeptInfoService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.sparepart.SupplierService; -import com.sipai.service.timeefficiency.PatrolPointEquipmentCardService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.*; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.xssf.usermodel.*; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.RequestMapping; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.lang.reflect.Field; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.text.SimpleDateFormat; -import java.util.*; - -import static org.apache.poi.ss.usermodel.CellType.STRING; - - -@Service("equipmentCardService") -public class EquipmentCardService implements CommService { - @Resource - private EquipmentCardDao equipmentCardDao; - @Resource - private EquipmentCardPropDao equipmentCardPropDao; - @Resource - private GeographyAreaService geographyareaService; - @Resource - private EquipmentPointService equipmentPointService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EquipmentArrangementService equipmentArrangementService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private ExtSystemService extSystemService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentLevelService equipmentLevelService; - @Resource - private AssetClassService assetClassService; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private UnitService untiService; - @Resource - private SupplierService supplierService; - @Resource - private EquipmentCardPropService propService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - @Resource - private EquipmentBelongService equipmentBelongService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private CompanyService companyService; - @Resource - private FinanceEquipmentDeptInfoService financeEquipmentDeptInfoService; - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - @Resource - private EquipmentCodeRuleService equipmentCodeRuleService; - @Resource - private ContractService contractService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private AbnormityService abnormityService; - - //定义全局变量,当前登录人的id,调用表格导入方法时赋值 - private String insuserId = ""; - - public List selectList() { - // TODO Auto-generated method stub - EquipmentCard equipmentCard = new EquipmentCard(); - return this.equipmentCardDao.selectList(equipmentCard); - } - - public EquipmentCard selectSimpleListById(String id) { - EquipmentCard equipmentCard = this.equipmentCardDao.selectSimpleListById(id); - return equipmentCard; - } - - @Override - public EquipmentCard selectById(String id) { - EquipmentCard equipmentCard = this.equipmentCardDao.selectByPrimaryKey(id); - if (equipmentCard != null) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(equipmentCard.getEquipmentlevelid()); - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(equipmentCard.getEquipmentstatus()); - equipmentCard.setEquipmentLevel(equipmentLevel); - equipmentCard.setEquipmentStatusManagement(equipmentStatusManagement); - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - String resultEquipmentClassCode = ""; - if (null != equipmentClass && !"".equals(equipmentClass)) { - String resultEquipmentClassCodeStr = equipmentClassService.selectBelongAllParentId(equipmentClass, equipmentClass.getEquipmentClassCode()); - - String[] resultEquipmentClassCodeArr = resultEquipmentClassCodeStr.split(","); - for (int j = resultEquipmentClassCodeArr.length - 1; j >= 0; j--) { - resultEquipmentClassCode += resultEquipmentClassCodeArr[j]; - } - equipmentClass.setEquipmentClassCode(resultEquipmentClassCode); - } - - equipmentCard.setEquipmentClass(equipmentClass); - Company company = this.unitService.getCompById(equipmentCard.getBizid()); - equipmentCard.setCompany(company); - ProcessSection processSection = this.processSectionService.selectById(equipmentCard.getProcesssectionid()); - equipmentCard.setProcessSection(processSection); - AssetClass assetClass = this.assetClassService.selectById(equipmentCard.getAssetType()); - equipmentCard.setAssetClass(assetClass); - EquipmentCard equipmentPid = this.equipmentCardDao.selectByPrimaryKey(equipmentCard.getPid()); - equipmentCard.setEquipmentPid(equipmentPid); - if (null != equipmentCard.getSpecification() && !equipmentCard.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(equipmentCard.getSpecification()); - equipmentCard.setEquipmentSpecification(equipmentSpecification); - } - if (null != equipmentCard.getEquipmentmodel() && !equipmentCard.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(equipmentCard.getEquipmentmodel()); - equipmentCard.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != equipmentCard.getId() && !equipmentCard.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(equipmentCard.getId()); - equipmentCard.setEquipmentCardProp(cardProp); - } - //2020-07-12 start - if (null != equipmentCard.getEquipmentBelongId() && !equipmentCard.getEquipmentBelongId().isEmpty()) { - EquipmentBelong equipmentBelong = this.equipmentBelongService.selectById(equipmentCard.getEquipmentBelongId()); - equipmentCard.setEquipmentBelong(equipmentBelong); - } - //2020-07-12 end - - //2020-10-12 start - if (null != equipmentCard.getPid() && !equipmentCard.getPid().isEmpty()) { - EquipmentCard equipmentcard = this.selectById(equipmentCard.getBizid(), equipmentCard.getPid()); - equipmentCard.setEquipmentPid(equipmentcard); - } - } - return equipmentCard; - } - - @Override - public int deleteById(String id) { - return this.equipmentCardDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentCard entity) { - String rid = ""; - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getRootId(set, entity.getEquipmentclassid()); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - rid = iterroot.next(); - } - entity.setEquipmentBigClassId(rid); - return this.equipmentCardDao.insert(entity); - } - - @Override - public int update(EquipmentCard equipmentCard) { - String rid = ""; - TreeSet set = new TreeSet(); - TreeSet treeSet = equipmentClassService.getRootId(set, equipmentCard.getEquipmentclassid()); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - rid = iterroot.next(); - } - equipmentCard.setEquipmentBigClassId(rid); - return this.equipmentCardDao.updateByPrimaryKeySelective(equipmentCard); - } - - public List selectPompListByWhere(String SQL) { - List equipmentCards = equipmentCardDao.selectPompListByWhere(SQL); - for (EquipmentCard item : equipmentCards) { - if (null != item.getEquipmentlevelid() && !item.getEquipmentlevelid().isEmpty()) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(item.getEquipmentlevelid()); - item.setEquipmentLevel(equipmentLevel); - } - if (null != item.getAssetType() && !item.getAssetType().isEmpty()) { - AssetClass assetClass = this.assetClassService.selectById(item.getAssetType()); - item.setAssetClass(assetClass); - } - if (null != item.getEquipmentstatus() && !item.getEquipmentstatus().isEmpty()) { - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(item.getEquipmentstatus()); - item.setEquipmentStatusManagement(equipmentStatusManagement); - } - if (null != item.getEquipmentclassid() && !item.getEquipmentclassid().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getEquipmentclassid()); - item.setEquipmentClass(equipmentClass); - } - if (null != item.getBizid() && !item.getBizid().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - if (null != item.getProcesssectionid() && !item.getProcesssectionid().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSection(processSection); - } - if (null != item.getPid() && !item.getPid().isEmpty()) { - EquipmentCard equipmentPid = this.equipmentCardDao.selectByPrimaryKey(item.getPid()); - item.setEquipmentPid(equipmentPid); - } - if (null != item.getSpecification() && !item.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - if (null != item.getEquipmentmodel() && !item.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(item.getEquipmentmodel()); - item.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(item.getId()); - item.setEquipmentCardProp(cardProp); - } - } - return equipmentCards; - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); -// System.out.println("wherestr:"+wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getEquipmentlevelid() && !item.getEquipmentlevelid().isEmpty()) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(item.getEquipmentlevelid()); - item.setEquipmentLevel(equipmentLevel); - } - if (null != item.getAssetType() && !item.getAssetType().isEmpty()) { - AssetClass assetClass = this.assetClassService.selectById(item.getAssetType()); - item.setAssetClass(assetClass); - } - if (null != item.getEquipmentstatus() && !item.getEquipmentstatus().isEmpty()) { - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(item.getEquipmentstatus()); - item.setEquipmentStatusManagement(equipmentStatusManagement); - } - if (null != item.getEquipmentclassid() && !item.getEquipmentclassid().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getEquipmentclassid()); - item.setEquipmentClass(equipmentClass); - } - if (null != item.getBizid() && !item.getBizid().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - if (null != item.getProcesssectionid() && !item.getProcesssectionid().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSection(processSection); - } - if (null != item.getPid() && !item.getPid().isEmpty()) { - EquipmentCard equipmentPid = this.equipmentCardDao.selectByPrimaryKey(item.getPid()); - item.setEquipmentPid(equipmentPid); - } - if (null != item.getSpecification() && !item.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - if (null != item.getEquipmentmodel() && !item.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(item.getEquipmentmodel()); - item.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(item.getId()); -// if (null != cardProp.getSpecification() && !item.getSpecification().isEmpty()) { -// EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); -// item.setEquipmentSpecification(equipmentSpecification); -// } - item.setEquipmentCardProp(cardProp); - //维修次数 - List maintenanceDetailList = this.maintenanceDetailService.selectListByWhere("where equipment_id='' and status='" + Maintenance.Status_Finish + "' "); - if (maintenanceDetailList != null && maintenanceDetailList.size() > 0) { - item.set_equfixnum(maintenanceDetailList.size()); - } - } - //使用年数 - if (item.getOpenDate() != null && !item.getOpenDate().isEmpty()) { - Calendar date = Calendar.getInstance(); - int _useEquipmentAge = date.get(Calendar.YEAR) - Integer.valueOf(item.getOpenDate().substring(0, 4)) + 1; - item.set_useEquipmentAge(_useEquipmentAge); - } - - if (item.getEquipmentBelongId() != null && !item.getEquipmentBelongId().isEmpty()) { - EquipmentBelong equipmentBelong = this.equipmentBelongService.selectById(item.getEquipmentBelongId()); - item.set_equipmentBelongName(equipmentBelong.getBelongName()); - } - } - return equipmentCards; - } - - public List selectListTreeByWhere(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - return equipmentCards; - } - - - public List selectListByWhereForSystem(String bizid, String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(item.getId()); - if (cardProp != null && cardProp.getKeynum() != null) { - item.setEquipmentCardProp(cardProp); - //查找该设备下的测量点,并将故障点为0的状态给equipmentcardprop的_state - List mPoints = this.mPointService.selectListByWhere(bizid, "where equipmentId = '" + item.getId() + "' and parmName like '%故障%' "); - - if (mPoints != null && mPoints.size() > 0) { - if (mPoints.get(0).getParmvalue().compareTo(BigDecimal.ZERO) == 0) { - cardProp.set_state(0); - } else { - cardProp.set_state(1); - } - - } else { - cardProp.set_state(0); - } - - - } - } - } - - Iterator iter = equipmentCards.iterator(); - - while (iter.hasNext()) { - - EquipmentCard tmp = iter.next(); - - if (tmp.getEquipmentCardProp() == null) { - iter.remove(); - } - - } - - return equipmentCards; - } - - - public List selectTop1ListByWhere(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectTop1ListByWhere(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getEquipmentlevelid() && !item.getEquipmentlevelid().isEmpty()) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(item.getEquipmentlevelid()); - item.setEquipmentLevel(equipmentLevel); - } - if (null != item.getAssetType() && !item.getAssetType().isEmpty()) { - AssetClass assetClass = this.assetClassService.selectById(item.getAssetType()); - item.setAssetClass(assetClass); - } - if (null != item.getEquipmentstatus() && !item.getEquipmentstatus().isEmpty()) { - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(item.getEquipmentstatus()); - item.setEquipmentStatusManagement(equipmentStatusManagement); - } - if (null != item.getEquipmentclassid() && !item.getEquipmentclassid().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getEquipmentclassid()); - item.setEquipmentClass(equipmentClass); - } - if (null != item.getBizid() && !item.getBizid().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - if (null != item.getProcesssectionid() && !item.getProcesssectionid().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSection(processSection); - } - if (null != item.getPid() && !item.getPid().isEmpty()) { - EquipmentCard equipmentPid = this.equipmentCardDao.selectByPrimaryKey(item.getPid()); - item.setEquipmentPid(equipmentPid); - } - if (null != item.getSpecification() && !item.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - if (null != item.getEquipmentmodel() && !item.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(item.getEquipmentmodel()); - item.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(item.getId()); - item.setEquipmentCardProp(cardProp); - } - } - return equipmentCards; - } - - public List selectRemindListByWhere(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - List remindequipmentCards = new ArrayList<>(); - for (EquipmentCard item : equipmentCards) { - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(item.getId()); - item.setEquipmentCardProp(cardProp); - if (null == item.getEquipmentClearTime()) { - item.setEquipmentClearTime(0.0); - } - if (cardProp.getRunTime() != null) { - if (item.getEquipmentSetTime() < cardProp.getRunTime() - item.getEquipmentClearTime()) { - remindequipmentCards.add(item); - } - } - } - } - return remindequipmentCards; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - return this.equipmentCardDao.deleteByWhere(equipmentCard); - } - - public List getEquipmentCard(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - return this.equipmentCardDao.getEquipmentCard(equipmentCard); - } - - public List selectSimpleListByWhere(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - return this.equipmentCardDao.selectSimpleListByWhere(equipmentCard); - } - - public EquipmentCard getEquipmentCardById(String equipmentcardid) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(" where E.id='" + equipmentcardid + "' order by E.equipmentcardid"); - return this.equipmentCardDao.getEquipmentCard(equipmentCard).get(0); - } - - public EquipmentCard getEquipmentByEquipmentCardId(String equipmentcardid) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(" where equipmentCardID='" + equipmentcardid + "' order by insdt"); - List list = this.equipmentCardDao.selectListByWhere(equipmentCard); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - - } - - /** - * 是否未被占用 - * - * @param id - * @param equipmentcardid - * @return - */ - public boolean checkNotOccupied(String id, String equipmentcardid) { - List list = this.selectListByWhere("where equipmentcardid ='" + equipmentcardid + "'"); - if (id == null) {//新增 - if (list != null && list.size() > 0) { - return true; - } - } else {//编辑 - if (list != null && list.size() > 0) { - for (EquipmentCard equipmentcard : list) { - if (!id.equals(equipmentcard.getId())) {//不是当前编辑的那条记录 - return false; - } - } - } - } - - return false; - } - - /** - * BigDecimal去逗号 - * - * @param str - * @return - */ - public static BigDecimal strTOBigDecimal(String str) { - DecimalFormat format = new DecimalFormat(); - format.setParseBigDecimal(true); - ParsePosition position = new ParsePosition(0); - BigDecimal parse = (BigDecimal) format.parse(str, position); - - if (str.length() == position.getIndex()) { - return parse; - } - return null; - } - - /** - * 得到测量点的值 - * - * @param list - * @return - */ - public List getEquipStatusByList(List list) { - String[] items = CommString.MPointFunType; - for (EquipmentCard equipmentCard : list) { - List equipmentPoints = this.equipmentPointService.selectListByWhere(" where equipmentcardid='" + equipmentCard.getId() + "' order by insdt"); - if (equipmentPoints != null && equipmentPoints.size() > 0) { - String ids = ""; - for (EquipmentPoint equipmentPoint : equipmentPoints) { - if (!ids.isEmpty()) { - ids += ","; - } - ids += equipmentPoint.getPointid(); - } - List mPoints = this.mPointService.getvaluefunc(equipmentCard.getBizid(), ids); - boolean status_flag = false;//状态测量点存在标示 - boolean status_dj = false; - boolean status_gz = false; - boolean status_qd = false; - for (MPoint mPoint : mPoints) { - /*String exp = mPoint.getPointfunctiondefinition(); - if (exp == null || exp.isEmpty()) { - continue; - } - switch (exp) { - case "故障": - status_flag = true; - boolean res = mPointService.getResByExpression(mPoint.getExp(), mPoint.getParmvalue().doubleValue()); - if (res) { - status_gz = true; - } - break; - case "待机": - status_flag = true; - res = mPointService.getResByExpression(mPoint.getExp(), mPoint.getParmvalue().doubleValue()); - if (res) { - status_dj = true; - } - break; - case "启停": - status_flag = true; - res = mPointService.getResByExpression(mPoint.getExp(), mPoint.getParmvalue().doubleValue()); - if (res) { - status_qd = true; - } - break; - - default: - break; - }*/ - } - if (status_gz) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_Fault); - } else if (status_qd) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_ON); - if (status_dj) { - //equipmentCard.setEquipmentstatus(equipmentCard.Status_StandBy); - } - } else if (status_flag) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_OFF); - } else { - //equipmentCard.setEquipmentstatus(EquipmentCard.Status_UnMatch); - } - - } else { - //equipmentCard.setEquipmentstatus(EquipmentCard.Status_UnMatch); - } - } - return list; - - } - - /** - * 获取设备类型 - * - * @param - * @return - */ - public EquipmentClass getEquipmentClass(String equipmentId) { - EquipmentCard equipmentCard = this.selectById(equipmentId); - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - return equipmentClass; - } - - /** - * Equipmentcardid是否已存在 - * - * @param Equipmentcardid - * @return boolean - */ - public boolean checkNotOccupiedbycode(String Equipmentcardid) { - List list = this.selectListByWhere("where equipmentcardid = '" + Equipmentcardid + "'order by equipmentcardid asc"); - - if (list != null && list.size() > 0) { - return false; - } - - return true; - } - - /** - * 获取设备信息 - * map参数: ids,bizid,page,row,searchName,psectionid - */ - public String getEquipments(Map map) { - String url = ""; - ExtSystem extSystem = this.extSystemService.getActiveDataManage(null); - if (extSystem != null) { - url = extSystem.getUrl(); - } - url += "/proapp.do?method=getEquipments"; - String resp = com.sipai.tools.HttpUtil.sendPost(url, map); - return resp; - } - - public EquipmentCard selectById(String bizId, String id) { - return equipmentCardDao.selectByPrimaryKey(id); - } - - public List selectListByWhere(String bizId, String wherestr) { - EquipmentCard group = new EquipmentCard(); - group.setWhere(wherestr); - List equipmentCards = equipmentCardDao.selectListByWhere(group); - return equipmentCards; - } - - public List selectListByWhere4Count(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - return equipmentCards; - } - - public List getEquipmentValue(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.getEquipmentValue(equipmentCard); - return equipmentCards; - } - - //获取维修大于等于2的设备台账 - public List selectListForScrap(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListForScrap(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getEquipmentlevelid() && !item.getEquipmentlevelid().isEmpty()) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(item.getEquipmentlevelid()); - item.setEquipmentLevel(equipmentLevel); - } - if (null != item.getAssetType() && !item.getAssetType().isEmpty()) { - AssetClass assetClass = this.assetClassService.selectById(item.getAssetType()); - item.setAssetClass(assetClass); - } - if (null != item.getEquipmentstatus() && !item.getEquipmentstatus().isEmpty()) { - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(item.getEquipmentstatus()); - item.setEquipmentStatusManagement(equipmentStatusManagement); - } - if (null != item.getEquipmentclassid() && !item.getEquipmentclassid().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getEquipmentclassid()); - item.setEquipmentClass(equipmentClass); - } - if (null != item.getBizid() && !item.getBizid().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - if (null != item.getProcesssectionid() && !item.getProcesssectionid().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSection(processSection); - } - if (null != item.getPid() && !item.getPid().isEmpty()) { - EquipmentCard equipmentPid = this.equipmentCardDao.selectByPrimaryKey(item.getPid()); - item.setEquipmentPid(equipmentPid); - } - if (null != item.getSpecification() && !item.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - if (null != item.getEquipmentmodel() && !item.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(item.getEquipmentmodel()); - item.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != item.getId() && !item.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(item.getId()); - item.setEquipmentCardProp(cardProp); - } - } - return equipmentCards; - } - - public List selectListByWhereForGIS(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - return this.equipmentCardDao.selectListByWhere(equipmentCard); - } - - //获取不同状态的设备台账 - public List selectListForStatus(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListForStatus(equipmentCard); - return equipmentCards; - } - - /** - * 导出设备表 - * - * @param response - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadEquipmentExcel(HttpServletResponse response, List equipmentCards) throws IOException { - if (equipmentCards.size() == 0) { - EquipmentCard equipmentCard = new EquipmentCard(); - Company company = new Company(); - company.setName(""); - equipmentCard.setCompany(company); - equipmentCards.add(0, equipmentCard); - } - - String fileName = "设备台账表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备台账表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - sheet.setColumnWidth(9, 5000); - sheet.setColumnWidth(10, 5000); - sheet.setColumnWidth(11, 5000); - sheet.setColumnWidth(12, 5000); - sheet.setColumnWidth(13, 5000); - sheet.setColumnWidth(14, 5000); - sheet.setColumnWidth(15, 5000); - sheet.setColumnWidth(16, 5000); - sheet.setColumnWidth(17, 5000); - sheet.setColumnWidth(18, 5000); - sheet.setColumnWidth(19, 5000); - sheet.setColumnWidth(20, 5000); - sheet.setColumnWidth(21, 5000); - sheet.setColumnWidth(22, 5000); - sheet.setColumnWidth(23, 5000); - sheet.setColumnWidth(24, 5000); - sheet.setColumnWidth(25, 5000); - sheet.setColumnWidth(26, 5000); - sheet.setColumnWidth(27, 5000); - sheet.setColumnWidth(28, 5000); - sheet.setColumnWidth(29, 5000); - sheet.setColumnWidth(30, 5000); - sheet.setColumnWidth(31, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - - - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = this.getExcelStr("ExcelTiele"); - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - if (excelTitle[i] != null && excelTitle[i].contains("*")) { - //表头带*的标黄色 - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - } else { - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - } - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(equipmentCards.get(0).getCompany().getName() + "设备台账表"); - // 第二行说明信息 -// sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - HSSFCell twocell = twoRow.createCell(0); - //twocell.setCellStyle(headStyle); - twocell.setCellValue("说明:“黄色”为必填项,如果不填导入时会忽略该条数据;“白色”为选填项。请按照要求填写。"); - //遍历集合数据,产生数据行 - for (int i = 0; i < equipmentCards.size(); i++) { - row = sheet.createRow(i + 3);//第三行为插入的数据行 - row.setHeight((short) 600); - EquipmentCard equip = equipmentCards.get(i); - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(equip.getId()); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - break; - case 1://厂区 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - if (null != equip.getCompany()) { - cell_1.setCellValue(equip.getCompany().getSname()); - } else { - cell_1.setCellValue(""); - } - break; - case 2://设备归属 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - if (null != equip.getEquipmentBelongId()) { - cell_2.setCellValue(getEquipmentBelongName(equip.getEquipmentBelongId())); - } else { - cell_2.setCellValue(""); - } - break; - case 3://工艺段 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - if (null != equip.getProcessSection()) { - cell_3.setCellValue(equip.getProcessSection().getName()); - } else { - cell_3.setCellValue(""); - } - break; - case 4://设备编号 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - if (null != equip.getEquipmentcardid()) { - cell_4.setCellValue(equip.getEquipmentcardid()); - } else { - cell_4.setCellValue(""); - } - break; - case 5://设备名称 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(equip.getEquipmentname()); - break; - case 6://设备大类 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - if (null != equip.getEquipmentBigClassId()) { - cell_6.setCellValue(getEquipmentClassName(equip.getEquipmentBigClassId())); - } else { - cell_6.setCellValue(""); - } - break; - case 7://设备小类 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - if (null != equip.getEquipmentclassid()) { - cell_7.setCellValue(getEquipmentClassName(equip.getEquipmentclassid())); - } else { - cell_7.setCellValue(""); - } - break; - case 8://ABC分类 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - if (null != equip.getEquipmentLevel()) { - cell_8.setCellValue(equip.getEquipmentLevel().getLevelname()); - } else { - cell_8.setCellValue(""); - } - break; - case 9://设备状态 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - if (null != equip.getEquipmentStatusManagement()) { - cell_9.setCellValue(equip.getEquipmentStatusManagement().getName()); - } else { - cell_9.setCellValue(""); - } - break; - case 10://规格型号 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - if (null != equip.getEquipmentTypeNumber()) { - cell_10.setCellValue(equip.getEquipmentTypeNumber().getName()); - } else { - cell_10.setCellValue(equip.getEquipmentmodelname()); - } - break; - case 11://资产编号 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if (null != equip.getAssetnumber()) { - cell_11.setCellValue(equip.getAssetnumber()); - } else { - cell_11.setCellValue(""); - } - break; - case 12://安装地点 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(equip.getAreaid()); - break; - case 13://主要技术参数 - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(equip.getTechParameters()); - break; - case 14://容量(功率) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - if (null != equip.getEquipmentSpecification()) { - cell_14.setCellValue(equip.getEquipmentSpecification().getName()); - } else { - cell_14.setCellValue(""); - } - break; - case 15://制造厂家 - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(equip.getEquipmentmanufacturer()); - break; - case 16://出厂编号 - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(equip.getFactoryNumber()); - break; - case 17://启用日期 - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - if (null != equip.getOpenDate()) { - cell_17.setCellValue(equip.getOpenDate().substring(0, 10)); - } else { - cell_17.setCellValue(""); - } - break; - case 18://安装日期 - HSSFCell cell_18 = row.createCell(18); - cell_18.setCellStyle(listStyle); - if (null != equip.getInstallDate()) { - cell_18.setCellValue(equip.getInstallDate().substring(0, 10)); - } else { - cell_18.setCellValue(""); - } - break; - case 19://是否强检 - HSSFCell cell_19 = row.createCell(19); - cell_19.setCellStyle(listStyle); - String isCompulsoryInspection = String.valueOf(equip.getIsCompulsoryInspection()); - if (null != isCompulsoryInspection && !"".equals(isCompulsoryInspection)) { - switch (isCompulsoryInspection) { - case "1": - cell_19.setCellValue("是"); - break; - case "0": - cell_19.setCellValue("否"); - break; - default: - break; - } - } else { - cell_19.setCellValue(""); - } - break; - case 20://强检类型 - HSSFCell cell_20 = row.createCell(20); - cell_20.setCellStyle(listStyle); - String compulsoryInspectionType = equip.getCompulsoryInspectionType(); - if (null != compulsoryInspectionType) { - switch (compulsoryInspectionType) { - case "0": - cell_20.setCellValue("特种设备"); - break; - case "1": - cell_20.setCellValue("仪器仪表"); - break; - case "2": - cell_20.setCellValue("车辆"); - break; - default: - break; - } - } else { - cell_20.setCellValue(""); - } - break; - - case 21://资产类型 - HSSFCell cell_21 = row.createCell(21); - cell_21.setCellStyle(listStyle); - if (null != equip.getAssetClass()) { - cell_21.setCellValue(equip.getAssetClass().getAssetclassname()); - } else { - cell_21.setCellValue(""); - } - break; - - case 22://购置日期 - HSSFCell cell_22 = row.createCell(22); - cell_22.setCellStyle(listStyle); - if (null != equip.getBuyTime()) { - cell_22.setCellValue(equip.getBuyTime().substring(0, 10)); - } else { - cell_22.setCellValue(""); - } - break; - case 23://入账日期 - HSSFCell cell_23 = row.createCell(23); - cell_23.setCellStyle(listStyle); - if (null != equip.getInStockTime()) { - cell_23.setCellValue(equip.getInStockTime().substring(0, 10)); - } else { - cell_23.setCellValue(""); - } - break; - case 24://账面原值 - HSSFCell cell_24 = row.createCell(24); - cell_24.setCellStyle(listStyle); - if (null != equip.getEquipmentvalue()) { - cell_24.setCellValue((equip.getEquipmentvalue()).doubleValue()); - } else { - cell_24.setCellValue(""); - } - break; - case 25://账面净值 - HSSFCell cell_25 = row.createCell(25); - cell_25.setCellStyle(listStyle); - if (null != equip.getEquipWorth()) { - cell_25.setCellValue((equip.getEquipWorth()).doubleValue()); - } else { - cell_25.setCellValue(""); - } - break; - case 26://折旧年限 - HSSFCell cell_26 = row.createCell(26); - cell_26.setCellStyle(listStyle); - if (null != equip.getDepreciationLife()) { - cell_26.setCellValue(equip.getDepreciationLife()); - } else { - cell_26.setCellValue(""); - } - break; - case 27://残值率 - HSSFCell cell_27 = row.createCell(27); - cell_27.setCellStyle(listStyle); - if (null != equip.getResidualValueRate()) { - cell_27.setCellValue((equip.getResidualValueRate()).doubleValue()); - } else { - cell_27.setCellValue(""); - } - break; - case 28://使用年限 - HSSFCell cell_28 = row.createCell(28); - cell_28.setCellStyle(listStyle); - if (null != equip.getServiceLife()) { - cell_28.setCellValue(equip.getServiceLife()); - } else { - cell_28.setCellValue(""); - } - break; - case 29://设备状况评价 - HSSFCell cell_29 = row.createCell(29); - cell_29.setCellStyle(listStyle); - cell_29.setCellValue(equip.getEquipmentStatusMemo()); - break; - case 30://备注 - HSSFCell cell_30 = row.createCell(30); - cell_30.setCellStyle(listStyle); - cell_30.setCellValue(equip.getInCode()); - break; - case 31://备注 - HSSFCell cell_31 = row.createCell(31); - cell_31.setCellStyle(listStyle); - cell_31.setCellValue(equip.getRemark()); - break; - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 导出设备表 - * - * @param response - * @param - * @param - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadEquipmentExcelTemplate(HttpServletResponse response, int templateNum) throws IOException { - String fileName = "设备台账表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备台账表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - HSSFSheet sheet2 = workbook.createSheet("数据验证"); - - HSSFRow row0 = sheet2.createRow(0); - HSSFCell cell0 = null; - String[] Sheet2title = {"所属厂区", "设备归属", "工艺段", "ABC分类", "设备状态", "是否强检", "强检类型", "设备类型大类"}; - for (int k = 0; k < Sheet2title.length; k++) { - cell0 = row0.createCell(k); - cell0.setCellValue(Sheet2title[k]); - } - Name namedCell0 = workbook.createName(); -// namedCell0.setSheetIndex(1); - namedCell0.setNameName(Sheet2title[0]); - - Name namedCell1 = workbook.createName(); -// namedCell1.setSheetIndex(1); - namedCell1.setNameName(Sheet2title[1]); - - Name namedCell2 = workbook.createName(); -// namedCell2.setSheetIndex(1); - namedCell2.setNameName(Sheet2title[2]); - - Name namedCell3 = workbook.createName(); -// namedCell3.setSheetIndex(1); - namedCell3.setNameName(Sheet2title[3]); - - Name namedCell4 = workbook.createName(); -// namedCell4.setSheetIndex(1); - namedCell4.setNameName(Sheet2title[4]); - - Name namedCell5 = workbook.createName(); -// namedCell5.setSheetIndex(1); - namedCell5.setNameName(Sheet2title[5]); - - Name namedCell6 = workbook.createName(); -// namedCell6.setSheetIndex(1); - namedCell6.setNameName(Sheet2title[6]); - - - int ii = 0; - int length = 0; - String[] companynameStrings = this.getCompanynames(); - for (ii = 0, length = companynameStrings.length; ii < length; ii++) { - String name = companynameStrings[ii]; - HSSFRow row = sheet2.createRow(ii + 1); - HSSFCell cella = row.createCell(0); - cella.setCellValue(name); - } - - String[] equipmentbelongnameStrings = this.getEquipmentBelongNames(); - for (ii = 0, length = equipmentbelongnameStrings.length; ii < length; ii++) { - String name = equipmentbelongnameStrings[ii]; - - if (sheet2.getLastRowNum() < length) { - if (ii < sheet2.getLastRowNum()) { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(1); - cellb.setCellValue(name); - } else { - HSSFRow row = sheet2.createRow(sheet2.getLastRowNum() + 1); - HSSFCell cellb = row.createCell(1); - cellb.setCellValue(name); - } - } else { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(1); - cellb.setCellValue(name); - } - - } - - String[] processsectionnameStrings = this.getProcessSectionNames(); - for (ii = 0, length = processsectionnameStrings.length; ii < length; ii++) { - String name = processsectionnameStrings[ii]; - if (sheet2.getLastRowNum() < length) { - if (ii < sheet2.getLastRowNum()) { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(2); - cellb.setCellValue(name); - } else { - HSSFRow row = sheet2.createRow(sheet2.getLastRowNum() + 1); - HSSFCell cellb = row.createCell(2); - cellb.setCellValue(name); - } - } else { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(2); - cellb.setCellValue(name); - } - } - - String[] equipmentlevelnameStrings = this.getEquipmentLevelNames(); - for (ii = 0, length = equipmentlevelnameStrings.length; ii < length; ii++) { - String name = equipmentlevelnameStrings[ii]; - if (sheet2.getLastRowNum() < length) { - if (ii < sheet2.getLastRowNum()) { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(3); - cellb.setCellValue(name); - } else { - HSSFRow row = sheet2.createRow(sheet2.getLastRowNum() + 1); - HSSFCell cellb = row.createCell(3); - cellb.setCellValue(name); - } - } else { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(3); - cellb.setCellValue(name); - } - } - - String[] equipmentstatusmanagementnamesStrings = this.getEquipmentStatusManagementNames(); - for (ii = 0, length = equipmentstatusmanagementnamesStrings.length; ii < length; ii++) { - String name = equipmentstatusmanagementnamesStrings[ii]; - if (sheet2.getLastRowNum() < length) { - if (ii < sheet2.getLastRowNum()) { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(4); - cellb.setCellValue(name); - } else { - HSSFRow row = sheet2.createRow(sheet2.getLastRowNum() + 1); - HSSFCell cellb = row.createCell(4); - cellb.setCellValue(name); - } - } else { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(4); - cellb.setCellValue(name); - } - } - - String[] isIsCompulsoryNameStrings = this.getIsCompulsoryName(); - for (ii = 0, length = isIsCompulsoryNameStrings.length; ii < length; ii++) { - String name = isIsCompulsoryNameStrings[ii]; - if (sheet2.getLastRowNum() < length) { - if (ii < sheet2.getLastRowNum()) { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(5); - cellb.setCellValue(name); - } else { - HSSFRow row = sheet2.createRow(sheet2.getLastRowNum() + 1); - HSSFCell cellb = row.createCell(5); - cellb.setCellValue(name); - } - } else { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(5); - cellb.setCellValue(name); - } - } - - String[] compulsoryNameStrings = this.getCompulsoryName(); - for (ii = 0, length = compulsoryNameStrings.length; ii < length; ii++) { - String name = compulsoryNameStrings[ii]; - if (sheet2.getLastRowNum() < length) { - if (ii < sheet2.getLastRowNum()) { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(6); - cellb.setCellValue(name); - } else { - HSSFRow row = sheet2.createRow(sheet2.getLastRowNum() + 1); - HSSFCell cellb = row.createCell(6); - cellb.setCellValue(name); - } - } else { - HSSFRow row = sheet2.getRow(ii + 1); - HSSFCell cellb = row.createCell(6); - cellb.setCellValue(name); - } - } - JSONArray equipmentClass = this.getEquipmentBigClassNamesN(); - int equipmentBigClassLen = equipmentClass.size(); - String code = getExcelColumnLabel(equipmentBigClassLen + 7); - createName(workbook, "设备类型大类", "数据验证!$I$1:$" + code + "$1"); - for (ii = 0, length = equipmentClass.size(); ii < length; ii++) { - JSONObject object = (JSONObject) equipmentClass.get(ii); - HSSFRow row = sheet2.getRow(0); - HSSFCell cellb = row.createCell(ii + 8); - cellb.setCellValue(object.getString("name")); - String[] smallClass = getEquipmentSmallClassNames(object.getString("id")); - if (smallClass != null && smallClass.length > 0) { - String codeSmall = getExcelColumnLabel(ii + 8); - createName(workbook, object.getString("name"), "数据验证!$" + codeSmall + "$2:$" + codeSmall + "$" + (smallClass.length + 1)); - for (int a = 0; a < smallClass.length; a++) { - row = sheet2.getRow(a + 1); - cellb = row.createCell(ii + 8); - cellb.setCellValue(smallClass[a]); - } - } - } - -// String[] equipmentsmallclassnameString = this.getEquipmentSmallClassNames(); -// for (ii = 0, length = equipmentsmallclassnameString.length; ii < length; ii++) -// { -// String name = equipmentsmallclassnameString[ii]; -// if(sheet2.getLastRowNum() ruleList = this.equipmentCodeRuleService.selectListByWhere("where 1=1 order by morder desc"); - if (ruleList != null && ruleList.size() > 0 && ruleList.get(0).getCodeField().matches("[0-9]+")) { - //最后3位是流水号 - equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 3))); - } else if (ruleList != null && ruleList.size() > 0 && ruleList.get(1).getCodeField().matches("[0-9]+")) { - //倒数第4位到倒数第二位是流水号 - equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 4, equipmentcardidString.length() - 1))); - } - } - - if (null == equipmentCard.getEquipmentstatus() || equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_ON); - } - try { -// System.out.println(rowNum); - insertNum += this.equipmentCardDao.insert(equipmentCard); - - //同时插入设备台账附表prop - cardProp.setId(CommUtil.getUUID()); - cardProp.setEquipmentId(equipmentCard.getId()); - cardProp.setInstallDate(equipmentCard.getOpenDate()); //附表的安装日期等于主表的启用日期 - cardProp.setPurchaseMoney(equipmentCard.getEquipmentvalue()); // 附表的购置费等于主表的账面原值 - cardProp.setTechnicalLife(equipmentCard.getDepreciationLife()); //附表的技术寿命年份等于主表的使用年限 - cardProp.setResidualValueRate(equipmentCard.getResidualValueRate()); //附表的折旧率等于主表的残值率 - cardProp.setLaborMoney(new BigDecimal(0)); //人工费默认0 - cardProp.setInstantFlow(1000d); //效率值默认1000 - cardProp.setInsdt(CommUtil.nowDate()); - cardProp.setInsuser(insuserId); - this.equipmentCardPropDao.insert(cardProp); - } catch (Exception e) { - e.printStackTrace(); - } - } - if (flag != null && flag.equals("update")) { - equipmentCard.setInsuser(insuserId); - equipmentCard.setInsdt(CommUtil.nowDate()); - //先获得一组新的设备编号,跟老的对比 如果不一致就更新掉 - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - String resultEquipmentClassCode = ""; - if (null != equipmentClass && !"".equals(equipmentClass)) { - String resultEquipmentClassCodeStr = equipmentClassService.selectBelongAllParentId(equipmentClass, equipmentClass.getEquipmentClassCode()); - - String[] resultEquipmentClassCodeArr = resultEquipmentClassCodeStr.split(","); - for (int j = resultEquipmentClassCodeArr.length - 1; j >= 0; j--) { - resultEquipmentClassCode += resultEquipmentClassCodeArr[j]; - } - equipmentCard.setEquipmentClassCode(resultEquipmentClassCode); - } - Map autoMap = autoGenerateEquipmentCodeByCodeRule(equipmentCard); - String newEquipmentcardidString = autoMap.get("equipmentCode").toString(); -// System.out.println("newEquipmentcardidString:" + newEquipmentcardidString); - if (newEquipmentcardidString != null && !newEquipmentcardidString.equals(equipmentcardidString)) { - equipmentcardidString = newEquipmentcardidString; - } - - //equipmentCard.setEquipmentcardid(equipmentcardidString); - //判断设备编码是否为空 - if (equipmentcardidString != null && !equipmentcardidString.equals("")) { - List ruleList = this.equipmentCodeRuleService.selectListByWhere("where 1=1 order by morder desc"); - if (ruleList != null && ruleList.size() > 0 && ruleList.get(0).getCodeField().matches("[0-9]+")) { - //最后3位是流水号 - equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 3))); - } else if (ruleList != null && ruleList.size() > 0 && ruleList.get(1).getCodeField().matches("[0-9]+")) { - //倒数第4位到倒数第二位是流水号 - equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 4, equipmentcardidString.length() - 1))); - } - } - if (null == equipmentCard.getEquipmentstatus() || equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_ON); - } - - try { - updateNum += this.equipmentCardDao.updateByPrimaryKeySelective(equipmentCard); - - //同时更新附表Prop - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectByEquipmentId(equipmentCard.getId()); - if (equipmentCardProp != null && null != equipmentCardProp.getId() && !"".equals(equipmentCard.getId())) { - //更新 - equipmentCardProp.setInstallDate(equipmentCard.getOpenDate()); //附表的安装日期等于主表的启用日期 - equipmentCardProp.setPurchaseMoney(equipmentCard.getEquipmentvalue()); // 附表的购置费等于主表的账面原值 - equipmentCardProp.setTechnicalLife(equipmentCard.getDepreciationLife()); //附表的技术寿命年份等于主表的使用年限 - equipmentCardProp.setResidualValueRate(equipmentCard.getResidualValueRate()); //附表的折旧率等于主表的残值率 - equipmentCardProp.setLaborMoney(new BigDecimal(0)); //人工费默认0 - equipmentCardProp.setInstantFlow(1000d); //效率值默认1000 - equipmentCardProp.setInsdt(CommUtil.nowDate()); - equipmentCardProp.setInsuser(insuserId); - this.equipmentCardPropService.update(equipmentCardProp); - } else { - //新增 - equipmentCardProp.setId(CommUtil.getUUID()); - equipmentCardProp.setEquipmentId(equipmentCard.getId()); - equipmentCardProp.setInstallDate(equipmentCard.getOpenDate()); //附表的安装日期等于主表的启用日期 - equipmentCardProp.setPurchaseMoney(equipmentCard.getEquipmentvalue()); // 附表的购置费等于主表的账面原值 - equipmentCardProp.setTechnicalLife(equipmentCard.getDepreciationLife()); //附表的技术寿命年份等于主表的使用年限 - equipmentCardProp.setResidualValueRate(equipmentCard.getResidualValueRate()); //附表的折旧率等于主表的残值率 - equipmentCardProp.setLaborMoney(new BigDecimal(0)); //人工费默认0 - equipmentCardProp.setInstantFlow(1000d); //效率值默认1000 - equipmentCardProp.setInsdt(CommUtil.nowDate()); - equipmentCardProp.setInsuser(insuserId); - this.equipmentCardPropDao.insert(equipmentCardProp); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - return result; - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input, String companyId, String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - //如果表头小于29列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 29) { - continue; - } - //设备大类 - String equipmentBigClassId = ""; - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - /*if (null == row || null == row.getCell(3) || "".equals(row.getCell(3))) { - continue; - }*/ - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = 1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - EquipmentCard equipmentCard = new EquipmentCard(); - EquipmentCardProp cardProp = new EquipmentCardProp(); - - String flag = ""; - String equipmentcardidString = ""; - String assetTypeNum = ""; - String contractNumber = ""; - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - try { - switch (i) { - case 1://厂区 - //根据excel中的厂区来保存 - String bizidString = getStringVal(cell); - if (null != bizidString && !bizidString.isEmpty()) { - if (getBizId(bizidString).equals("9999")) { - equipmentCard.setBizid(companyId); - } else { -// equipmentCard.setBizid(getBizId(bizidString)); - equipmentCard.setBizid(getCompany(bizidString).getId()); - } - } else { - equipmentCard.setBizid(companyId); - } - //按excel文件中的厂来 - companyId = equipmentCard.getBizid(); - break; - case 2://设备归属 - String equipmentBelongId = getEquipmentBelongId(getStringVal(cell)); - equipmentCard.setEquipmentBelongId(equipmentBelongId); - break; - case 3://工艺段(安装位置) - String pScetionId = this.getProcessSectionId(companyId, getStringVal(cell)); - equipmentCard.setProcesssectionid(pScetionId); - break; - case 4://设备编号 - equipmentcardidString = getStringVal(cell); - equipmentCard.setEquipmentcardid(getStringVal(cell)); - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (null != equipmentC) { - if (getStringVal(cell) == null || getStringVal(cell).equals("")) { - equipmentCard.setId(CommUtil.getUUID()); - flag = "insert"; - } else { - equipmentCard.setId(equipmentC.getId()); - flag = "update"; - } - } else { - equipmentCard.setId(CommUtil.getUUID()); - flag = "insert"; - } - break; - case 5://设备名称 - equipmentCard.setEquipmentname(getStringVal(cell)); - break; - case 6://设备大类 - equipmentBigClassId = getEquipmentBigClassId(getStringVal(cell)); - equipmentCard.setEquipmentBigClassId(equipmentBigClassId); - break; - case 7://设备小类 - String equipmentSmallClassId = getEquipmentSmallClassId(equipmentBigClassId, getStringVal(cell)); - equipmentCard.setEquipmentclassid(equipmentSmallClassId); - break; - case 8://设备等级ABC分类 - String abctype = this.getEquipmentLevelId(getStringVal(cell)); - equipmentCard.setEquipmentlevelid(abctype); - break; - case 9://设备状态 - String equipmentstatus = this.getEquipmentStatusId(getStringVal(cell)); - equipmentCard.setEquipmentstatus(equipmentstatus); - break; - case 10://规格型号 - String equipmentModelId = this.getEquipmentTypeNumberId(getStringVal(cell)); - if (null != equipmentModelId && !"".equals(equipmentModelId)) { - equipmentCard.setEquipmentmodel(equipmentModelId); - equipmentCard.setEquipmentmodelname(getStringVal(cell)); - } else { - equipmentCard.setEquipmentmodelname(getStringVal(cell)); - } - break; - case 11://资产编号 - assetTypeNum = getStringVal(cell); - equipmentCard.setAssetnumber(assetTypeNum); - break; - case 12://安装地点 - equipmentCard.setAreaid(getStringVal(cell)); - break; - case 13://主要技术参数 - equipmentCard.setTechParameters(getStringVal(cell)); - break; - case 14://容量(功率) - String equipmentSpecification = this.getEquipmentSpecificationId(getStringVal(cell)); - equipmentCard.setSpecification(equipmentSpecification); - break; - case 15://制造厂家 - equipmentCard.setEquipmentmanufacturer(getStringVal(cell)); - break; - case 16://出厂编号 - String leavefactorynumber = getStringVal(cell); - if (null != leavefactorynumber && !"".equals(leavefactorynumber)) { - equipmentCard.setFactoryNumber(getStringVal(cell)); - } - break; - case 17://启用日期 - equipmentCard.setOpenDate(getStringVal(cell)); - break; - case 18://安装日期 - equipmentCard.setInstallDate(getStringVal(cell)); - break; - case 19://是否强检 - String isCompulsoryInspection = getStringVal(cell); - if (isCompulsoryInspection != null && !isCompulsoryInspection.equals("")) { - switch (isCompulsoryInspection) { - case "是": - equipmentCard.setIsCompulsoryInspection(1); - ; - break; - case "否": - equipmentCard.setIsCompulsoryInspection(0); - break; - default: - equipmentCard.setIsCompulsoryInspection(1); - break; - } - } - case 20://强检类型 - String compulsoryInspectionTypeString = getStringVal(cell); - if (compulsoryInspectionTypeString != null && !compulsoryInspectionTypeString.equals("")) { - switch (compulsoryInspectionTypeString) { - case "特种设备": - equipmentCard.setCompulsoryInspectionType("0"); - break; - case "仪器仪表": - equipmentCard.setCompulsoryInspectionType("1"); - break; - case "车辆": - equipmentCard.setCompulsoryInspectionType("2"); - break; - default: - equipmentCard.setCompulsoryInspectionType("0"); - break; - } - } - case 21://资产类型 - String assetType = this.getAssetClassId(getStringVal(cell)); - String assetTypeNumString = this.getAssetClassNum(getStringVal(cell)); - equipmentCard.setAssetType(assetType); - if (assetTypeNum != null && !assetTypeNum.equals("")) { - equipmentCard.setAssetnumber(assetTypeNum); - } else { - equipmentCard.setAssetnumber(assetTypeNumString); - } - - break; - - case 22://购置日期 - equipmentCard.setBuyTime(getStringVal(cell)); - break; - case 23://入账日期 - equipmentCard.setInStockTime(getStringVal(cell)); - break; - case 24://账面原值 - String equipmentvalue = getStringVal(cell); - if (null != equipmentvalue && !equipmentvalue.isEmpty()) { - equipmentCard.setEquipmentvalue(new BigDecimal(equipmentvalue)); - } - break; - case 25://账面净值 - String equipWorth = getStringVal(cell); - if (null != equipWorth && !equipWorth.isEmpty()) { - equipmentCard.setEquipWorth(new BigDecimal(equipWorth)); - } - break; - case 26://折旧年限 - String depreciationLife = getStringVal(cell); - if (null != depreciationLife && !depreciationLife.isEmpty()) { - equipmentCard.setDepreciationLife(Double.valueOf(depreciationLife)); - } - break; - case 27://残值率 - String residualValueRate = getStringVal(cell); - if (null != residualValueRate && !residualValueRate.isEmpty()) { - equipmentCard.setResidualValueRate(Double.valueOf(residualValueRate)); - } - break; - - case 28://使用年限 - String useage = getStringVal(cell); - if (null != useage && !useage.isEmpty()) { - equipmentCard.setServiceLife(Double.valueOf(useage)); - } - break; - case 29://设备状况评价 - equipmentCard.setEquipmentStatusMemo(getStringVal(cell)); - break; - case 30://内部编号 - equipmentCard.setInCode(getStringVal(cell)); - break; - case 31://备注 - equipmentCard.setRemark(getStringVal(cell)); - break; - case 32://关联合同 - contractNumber = getStringVal(cell); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - - /*String contractIds = ""; - if (contractNumber != null && !contractNumber.equals("")) { - contractNumber = contractNumber.replace(",", "','"); - List contractList = this.contractService.selectListByWhere("where contractNumber in ('" + contractNumber + "') order by insdt desc"); - for (Contract contract : contractList) { - contractIds += contract.getId() + ","; - } - if (contractIds != null && !contractIds.equals("") && contractIds.length() > 0) { - contractIds = contractIds.substring(0, contractIds.length() - 1); - } - }*/ - - if (equipmentCard != null) { - if (flag != null && flag.equals("insert")) { - equipmentCard.setInsuser(insuserId); - equipmentCard.setInsdt(CommUtil.nowDate()); - //判断设备编码是否为空 - if (equipmentcardidString != null && !equipmentcardidString.equals("")) { - /*List ruleList = this.equipmentCodeRuleService.selectListByWhere("where 1=1 order by morder desc"); - if (ruleList != null && ruleList.size() > 0 && ruleList.get(0).getCodeField().matches("[0-9]+")) { - //最后3位是流水号 - equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 3))); - } else if (ruleList != null && ruleList.size() > 0 && ruleList.get(1).getCodeField().matches("[0-9]+")) { - //倒数第4位到倒数第二位是流水号 - equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 4, equipmentcardidString.length() - 1))); - }*/ - - //注释掉后 即按excel导入保存编号 - //equipmentCard.setEquipmentcardid(equipmentcardidString); - } else { - //TODO - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - String resultEquipmentClassCode = ""; - if (null != equipmentClass && !"".equals(equipmentClass)) { - String resultEquipmentClassCodeStr = equipmentClassService.selectBelongAllParentId(equipmentClass, equipmentClass.getEquipmentClassCode()); - - String[] resultEquipmentClassCodeArr = resultEquipmentClassCodeStr.split(","); - for (int j = resultEquipmentClassCodeArr.length - 1; j >= 0; j--) { - resultEquipmentClassCode += resultEquipmentClassCodeArr[j]; - } - equipmentCard.setEquipmentClassCode(resultEquipmentClassCode); - } - //这里自动生成设备编号 - Map autoMap = autoGenerateEquipmentCodeByCodeRule(equipmentCard); - String equipmentcode = autoMap.get("equipmentCode").toString(); - Integer waternumshort = 1; - if (autoMap.get("waterNumShort").toString() != null && !autoMap.get("waterNumShort").toString().equals("")) { - waternumshort = Integer.valueOf(autoMap.get("waterNumShort").toString()); - } - //注释掉后 即按excel导入保存编号 - //equipmentCard.setEquipmentcardid(equipmentcode); - equipmentCard.setWaterNumShort(waternumshort); - } - if (null == equipmentCard.getEquipmentstatus() || equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_ON); - } - try { - insertNum += this.equipmentCardDao.insert(equipmentCard); - } catch (Exception e) { - e.printStackTrace(); - } - } - if (flag != null && flag.equals("update")) { - equipmentCard.setInsuser(insuserId); - equipmentCard.setInsdt(CommUtil.nowDate()); - - //先获得一组新的设备编号,跟老的对比 如果不一致就更新掉 - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - String resultEquipmentClassCode = ""; - if (null != equipmentClass && !"".equals(equipmentClass)) { - String resultEquipmentClassCodeStr = equipmentClassService.selectBelongAllParentId(equipmentClass, equipmentClass.getEquipmentClassCode()); - - String[] resultEquipmentClassCodeArr = resultEquipmentClassCodeStr.split(","); - for (int j = resultEquipmentClassCodeArr.length - 1; j >= 0; j--) { - resultEquipmentClassCode += resultEquipmentClassCodeArr[j]; - } - equipmentCard.setEquipmentClassCode(resultEquipmentClassCode); - } - -// Map autoMap = autoGenerateEquipmentCodeByCodeRule(equipmentCard); -// String newEquipmentcardidString = autoMap.get("equipmentCode").toString(); -// System.out.println("newEquipmentcardidString:" + newEquipmentcardidString); -// if (newEquipmentcardidString != null && !newEquipmentcardidString.equals(equipmentcardidString)) { -// equipmentcardidString = newEquipmentcardidString; -// } -// equipmentCard.setEquipmentcardid(equipmentcardidString); - //判断设备编码是否为空 -// if (equipmentcardidString != null && !equipmentcardidString.equals("")) { -// List ruleList = this.equipmentCodeRuleService.selectListByWhere("where 1=1 order by morder desc"); -// if (ruleList != null && ruleList.size() > 0 && ruleList.get(0).getCodeField().matches("[0-9]+")) { -// //最后3位是流水号 -// equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 3))); -// } else if (ruleList != null && ruleList.size() > 0 && ruleList.get(1).getCodeField().matches("[0-9]+")) { -// //倒数第4位到倒数第二位是流水号 -// equipmentCard.setWaterNumShort(Integer.valueOf(equipmentcardidString.substring(equipmentcardidString.length() - 4, equipmentcardidString.length() - 1))); -// } -// } else { - //这里自动生成设备编号 -// Integer waternumshort = 1; -// if (autoMap.get("waterNumShort").toString() != null && !autoMap.get("waterNumShort").toString().equals("")) { -// waternumshort = Integer.valueOf(autoMap.get("waterNumShort").toString()); -// } -// equipmentCard.setEquipmentcardid(equipmentcardidString); -// equipmentCard.setWaterNumShort(waternumshort); -// } - - if (null == equipmentCard.getEquipmentstatus() || equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_ON); - } - try { - updateNum += this.equipmentCardDao.updateByPrimaryKeySelective(equipmentCard); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - return result; - } - - /** - * 获取表格中导入的部门id - * @param companyId - * @param cellValue - * @return - */ - /*private String getCompanyId(String cellValue){ - String companyId = ""; - Listcompanies = unitService.getCompaniesByWhere("where sname = '"+cellValue+"'"); - if (companies!=null && companies.size()>0) { - companyId = companies.get(0).getId(); - }else { - Company company = new Company(); - company.setId(CommUtil.getUUID()); - company.setInsuser(insuserId); - company.setInsdt(CommUtil.nowDate()); - company.setName(cellValue); - company.setPid("-1"); - company.setSname(cellValue); - } - return companyId; - }*/ - - /** - * 获取表格中导入的部门id - * - * @param companyId - * @param cellValue - * @return - */ - private String getDeptId(String companyId, String cellValue) { - String deptId = ""; - List depts = unitService.getDeptByPid(companyId); - if (depts != null && depts.size() > 0) { - for (Dept dept : depts) { - if ((dept.getName()).equals(cellValue)) { - deptId = dept.getId(); - break; - } else { - continue; - } - } - } - //如果没有这个部门,新建一个 - if (deptId.equals("")) { - Dept dept = new Dept(); - dept.setId(CommUtil.getUUID()); - dept.setName(cellValue); - dept.setPid(companyId); - this.unitService.saveDept(dept); - deptId = dept.getId(); - } - return deptId; - } - - /** - * 获取表格中导入的工艺段id - * - * @param companyId - * @param cellValue - * @return - */ - private String getProcessSectionId(String companyId, String cellValue) { - String ProcessSectionId = ""; - List pSections = processSectionService.selectListByWhere("where unit_id = '" + companyId + "' and (name = '" + cellValue + "' or sname = '" + cellValue + "' or code = '" + cellValue + "')"); - if (pSections != null && pSections.size() > 0) { - ProcessSectionId = pSections.get(0).getId(); - } else { - - } - return ProcessSectionId; - } - - - /** - * 获取表格中导入的工艺段id(全厂通用,不绑定厂区id) - * - * @param cellValue - * @return - */ - private String getProcessSectionId(String cellValue) { - String ProcessSectionId = ""; - List pSections = processSectionService.selectListByWhere("where (name = '" + cellValue + "' or sname = '" + cellValue + "' or code = '" + cellValue + "')"); - if (pSections != null && pSections.size() > 0) { - ProcessSectionId = pSections.get(0).getId(); - } else { - - } - return ProcessSectionId; - } - - - //2020-07-06 start - - /** - * 获取表格中导入的设备归属id - * - * @param cellValue - * @return - */ - private String getEquipmentBelongId(String cellValue) { - String equipmentBelongId = ""; - String cellString = cellValue.trim(); - if (cellString != null && !cellString.equals("")) { - List equipmentBelongList = equipmentBelongService.selectListByWhere("where belong_code ='" + cellString.substring(cellString.length() - 1, cellString.length()) + "'"); - if (equipmentBelongList != null && equipmentBelongList.size() > 0) { - equipmentBelongId = equipmentBelongList.get(0).getId(); - } else { - - } - } - return equipmentBelongId; - } - - /** - * 获取表格中导入的设备大类id - * - * @param cellValue - * @return - */ - private String getEquipmentBigClassId(String cellValue) { - String equipmentBigClassId = ""; - cellValue = cellValue.replace(" ", ""); - String cellString = cellValue.trim(); - if (cellValue != null && !cellValue.equals("")) { - //名称+code - if (cellValue.contains(";")) { - String[] str = cellString.split(";"); - if (str != null && str.length == 2) { - List equipmentBigClassList = this.equipmentClassService.selectListByWhere("where equipment_class_code = '" + str[1] + "' and type = '" + CommString.EquipmentClass_Category + "'"); - if (equipmentBigClassList != null && equipmentBigClassList.size() > 0) { - equipmentBigClassId = equipmentBigClassList.get(0).getId(); - } - } - //仅名称或code - } else { - //根据名称来找 - List equipmentBigClassList = this.equipmentClassService.selectListByWhere("where equipment_class_code = '" + cellValue + "' and type = '" + CommString.EquipmentClass_Category + "'"); - if (equipmentBigClassList != null && equipmentBigClassList.size() > 0) { - equipmentBigClassId = equipmentBigClassList.get(0).getId(); - } else { - //根据文字来找 - List equipmentBigClassListByName = this.equipmentClassService.selectListByWhere("where name = '" + cellValue + "' and type = '" + CommString.EquipmentClass_Category + "'"); - if (equipmentBigClassListByName != null && equipmentBigClassListByName.size() > 0) { - equipmentBigClassId = equipmentBigClassListByName.get(0).getId(); - } - } - } - - } - return equipmentBigClassId; - } - - /** - * 获取表格中导入的设备小类id - * - * @param cellValue - * @return - */ - private String getEquipmentSmallClassId(String equipmentBigClassId, String cellValue) { - String equipmentSmallClassId = ""; - cellValue = cellValue.replace(" ", ""); - String cellString = cellValue.trim(); - /*if (cellValue != null && !cellValue.equals("") && cellValue.length() >= 2) { - String whereSql = "where equipment_class_code = '" + cellString.substring(cellString.length() - 5, cellString.length()) + "'" + " and pid='" + equipmentBigClassId + "'"; - List equipmentBigClassList = this.equipmentClassService.selectListByWhere(whereSql); - if (equipmentBigClassList != null && equipmentBigClassList.size() > 0) { - equipmentSmallClassId = equipmentBigClassList.get(0).getId(); - } else { - //根据文字来找 - List equipmentSmallClassListByName = this.equipmentClassService.selectListByWhere("where name = '" + cellValue + "' and pid='" + equipmentBigClassId + "'"); - if (equipmentSmallClassListByName != null && equipmentSmallClassListByName.size() > 0) { - equipmentSmallClassId = equipmentSmallClassListByName.get(0).getId(); - } - } - }*/ - if (cellValue != null && !cellValue.equals("")) { - //名称+code - if (cellValue.contains(";")) { - String[] str = cellString.split(";"); - if (str != null && str.length == 2) { - String whereSql = "where equipment_class_code = '" + str[1] + "'" + " and pid='" + equipmentBigClassId + "'"; - List equipmentBigClassList = this.equipmentClassService.selectListByWhere(whereSql); - if (equipmentBigClassList != null && equipmentBigClassList.size() > 0) { - equipmentSmallClassId = equipmentBigClassList.get(0).getId(); - } - } - //仅名称或code - } else { - //根据名称来找 - List equipmentBigClassList = this.equipmentClassService.selectListByWhere("where equipment_class_code = '" + cellValue + "' and type = '" + CommString.EquipmentClass_Category + "' and pid='" + equipmentBigClassId + "'"); - if (equipmentBigClassList != null && equipmentBigClassList.size() > 0) { - equipmentSmallClassId = equipmentBigClassList.get(0).getId(); - } else { - //根据文字来找 - List equipmentBigClassListByName = this.equipmentClassService.selectListByWhere("where name = '" + cellValue + "' and type = '" + CommString.EquipmentClass_Category + "' and pid='" + equipmentBigClassId + "'"); - if (equipmentBigClassListByName != null && equipmentBigClassListByName.size() > 0) { - equipmentSmallClassId = equipmentBigClassListByName.get(0).getId(); - } - } - } - - } - return equipmentSmallClassId; - } - - /** - * 获取表格中导出的设备大类,小类name - * - * @param - * @return - */ - private String getEquipmentClassName(String equipmentClassId) { - String equipmentClassName = ""; - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentClassId); - if (equipmentClass != null) { - equipmentClassName = equipmentClass.getName() + ";" + equipmentClass.getEquipmentClassCode(); - } - return equipmentClassName; - } - - /** - * 获取表格中导出的设备归属name - * - * @param - * @return - */ - private String getEquipmentBelongName(String equipmentBelongId) { - String equipmentBelongName = ""; - EquipmentBelong equipmentBelong = this.equipmentBelongService.selectById(equipmentBelongId); - if (equipmentBelong != null) { - equipmentBelongName = equipmentBelong.getBelongName() + equipmentBelong.getBelongCode(); - } - return equipmentBelongName; - } - - //2020-07-06 end - - /** - * 获取表格中导入的设备类型id - * - * @param cellValue - * @return - */ - private String getEquipmentClassId(String cellValue) { - String equipmentClassId = ""; - List equipmentClasses = this.equipmentClassService.selectListByWhere("where name = '" + cellValue + "'"); - if (equipmentClasses != null && equipmentClasses.size() > 0) { - equipmentClassId = equipmentClasses.get(0).getId(); - } else { - // EquipmentClass eClass = new EquipmentClass(); - // eClass.setId(CommUtil.getUUID()); - // eClass.setInsdt(CommUtil.nowDate()); - // eClass.setInsuser(insuserId); - // eClass.setName(cellValue); - // eClass.setActive("1"); - // this.equipmentClassService.save(eClass); - // equipmentClassId = eClass.getId(); - } - return equipmentClassId; - } - - private String getBizId(String bizName) { - String bizId = ""; - List CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "'"); - if (CompanyList != null && CompanyList.size() > 0) { - bizId = CompanyList.get(0).getId(); - } else { - bizId = "9999"; - } - return bizId; - } - - private Company getCompany(String bizName) { - Company company = new Company(); - List CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "'"); - if (CompanyList != null && CompanyList.size() > 0) { - company = CompanyList.get(0); - } else { - company.setId("9999"); - company.setEname("xxxx"); - } - return company; - } - - /** - * 获取表格中导入的设备规格id - * - * @param cellValue - * @return - */ - private String getEquipmentSpecificationId(String cellValue) { - String equipmentSpecificationId = ""; - List specifications = this.equipmentSpecificationService.selectListByWhere("where name = '" + cellValue + "'"); - if (specifications != null && specifications.size() > 0) { - equipmentSpecificationId = specifications.get(0).getId(); - } else { - EquipmentSpecification eSpecification = new EquipmentSpecification(); - eSpecification.setId(CommUtil.getUUID()); - eSpecification.setInsdt(CommUtil.nowDate()); - eSpecification.setInsuser(insuserId); - eSpecification.setName(cellValue); - eSpecification.setActive("1"); - this.equipmentSpecificationService.save(eSpecification); - equipmentSpecificationId = eSpecification.getId(); - } - return equipmentSpecificationId; - } - - /** - * 获取表格中导入的设备型号id - * - * @param cellValue - * @return - */ - private String getEquipmentTypeNumberId(String cellValue) { - String equipmentTypeNumberId = ""; - List typeNumbers = this.equipmentTypeNumberService.selectListByWhere("where name = '" + cellValue + "'"); - if (typeNumbers != null && typeNumbers.size() > 0) { - equipmentTypeNumberId = typeNumbers.get(0).getId(); - } else { - // EquipmentTypeNumber typeNumber = new EquipmentTypeNumber(); - // typeNumber.setId(CommUtil.getUUID()); - // typeNumber.setInsdt(CommUtil.nowDate()); - // typeNumber.setInsuser(insuserId); - // typeNumber.setName(cellValue); - // typeNumber.setActive("1"); - // this.equipmentTypeNumberService.save(typeNumber); - // equipmentTypeNumberId = typeNumber.getId(); - } - return equipmentTypeNumberId; - } - - /** - * 获取表格中导入资产类型id - * - * @param cellValue - * @return - */ - private String getAssetClassId(String cellValue) { - String assetClassId = ""; - List assetClasses = this.assetClassService.selectListByWhere("where assetClassName = '" + cellValue + "'"); - if (assetClasses != null && assetClasses.size() > 0) { - assetClassId = assetClasses.get(0).getId(); - } else { - // AssetClass assetClass = new AssetClass(); - // assetClass.setId(CommUtil.getUUID()); - // assetClass.setInsdt(CommUtil.nowDate()); - // assetClass.setInsuser(insuserId); - // assetClass.setAssetclassname(cellValue); - // assetClass.setAssetclassnumber(CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); - // assetClass.setActive("1"); - // this.assetClassService.save(assetClass); - // assetClassId = assetClass.getId(); - } - return assetClassId; - } - - /** - * 获取表格中导入资产类型num - * - * @param cellValue - * @return - */ - private String getAssetClassNum(String cellValue) { - String assetClassNum = ""; - List assetClasses = this.assetClassService.selectListByWhere("where assetClassName = '" + cellValue + "'"); - if (assetClasses != null && assetClasses.size() > 0) { - assetClassNum = assetClasses.get(0).getAssetclassnumber(); - } else { - // AssetClass assetClass = new AssetClass(); - // assetClass.setId(CommUtil.getUUID()); - // assetClass.setInsdt(CommUtil.nowDate()); - // assetClass.setInsuser(insuserId); - // assetClass.setAssetclassname(cellValue); - // assetClass.setAssetclassnumber(CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); - // assetClass.setActive("1"); - // assetClass.setAssetclassnumber(""); - // this.assetClassService.save(assetClass); - // assetClassNum = assetClass.getAssetclassnumber(); - } - return assetClassNum; - } - - /** - * 获取表格中导入设备等级id - * - * @param cellValue - * @return - */ - private String getEquipmentLevelId(String cellValue) { - String levelId = ""; - List equipmentLevels = this.equipmentLevelService.selectListByWhere("where levelName = '" + cellValue + "'"); - if (equipmentLevels != null && equipmentLevels.size() > 0) { - levelId = equipmentLevels.get(0).getId(); - } else { - // EquipmentLevel equipmentLevel = new EquipmentLevel(); - // equipmentLevel.setId(CommUtil.getUUID()); - // equipmentLevel.setInsdt(CommUtil.nowDate()); - // equipmentLevel.setInsuser(insuserId); - // equipmentLevel.setLevelname(cellValue); - // equipmentLevel.setActive("1"); - // this.equipmentLevelService.save(equipmentLevel); - // levelId = equipmentLevel.getId(); - } - return levelId; - } - - /** - * 获取表格中导入设备状态id - * - * @param cellValue - * @return - */ - private String getEquipmentStatusId(String cellValue) { - String statusId = ""; - List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where name = '" + cellValue + "'"); - if (equipmentStatusManagements != null && equipmentStatusManagements.size() > 0) { - statusId = equipmentStatusManagements.get(0).getId(); - } else { - // EquipmentStatusManagement equipmentStatusManagement = new EquipmentStatusManagement(); - // equipmentStatusManagement.setId(CommUtil.getUUID()); - // equipmentStatusManagement.setInsdt(CommUtil.nowDate()); - // equipmentStatusManagement.setInsuser(insuserId); - // equipmentStatusManagement.setName(cellValue); - // equipmentStatusManagement.setActive("1"); - // this.equipmentStatusManagementService.save(equipmentStatusManagement); - // statusId = equipmentStatusManagement.getId(); - } - return statusId; - } - - /** - * 获取表格中导入供应商id - * - * @param cellValue - * @return - */ - private String getSupplierId(String cellValue) { - String supplierId = ""; - List suppliers = this.supplierService.selectListByWhere("where name = '" + cellValue + "'"); - if (suppliers != null && suppliers.size() > 0) { - supplierId = suppliers.get(0).getId(); - } else { - // Supplier supplier = new Supplier(); - // supplier.setId(CommUtil.getUUID()); - // supplier.setInsdt(CommUtil.nowDate()); - // supplier.setInsuser(insuserId); - // supplier.setName(cellValue); - // this.supplierService.save(supplier); - // supplierId = supplier.getId(); - } - return supplierId; - } - - /** - * 获取表格中导入设备管理状态 - * - * @param cellValue - * @return - */ - private String getEquipmentStatus(String cellValue) { - String equipmentStatus = ""; - switch (cellValue) { - case "封存": - equipmentStatus = EquipmentCard.Status_OFF; - break; - case "故障异常": - equipmentStatus = EquipmentCard.Status_Fault; - break; - case "在用": - equipmentStatus = EquipmentCard.Status_ON; - break; - case "报废": - equipmentStatus = EquipmentCard.Status_Scrap; - break; - case "调拨": - equipmentStatus = EquipmentCard.Status_Transfer; - break; - case "出售": - equipmentStatus = EquipmentCard.Status_Sale; - break; - case "丢失": - equipmentStatus = EquipmentCard.Status_Lose; - break; - default: - equipmentStatus = EquipmentCard.Status_ON; - break; - } - return equipmentStatus; - } - - /** - * 获取表格中导入瞬时流量数据,瞬时流量测量点命名规则:设备equipmentcardid_instantFlow - * - * @param cellValue - * @return - */ - private void updateInstantFlow(String companyId, EquipmentCard equipmentCard, BigDecimal cellValue) { - MPoint mPoint = this.mPointService.selectById(companyId, equipmentCard.getEquipmentcardid() + "_instantFlow"); - if (null != mPoint) { - mPoint.setParmvalue(cellValue); - mPoint.setEquipmentid(equipmentCard.getId()); - mPoint.setMeasuredt(CommUtil.nowDate()); - this.mPointService.update(companyId, mPoint); - } else { - MPoint point = new MPoint(); - point.setId(equipmentCard.getEquipmentcardid() + "_instantFlow"); - point.setMpointid(equipmentCard.getEquipmentcardid() + "_instantFlow"); - point.setMpointcode(equipmentCard.getEquipmentcardid() + "_instantFlow"); - point.setParmname(equipmentCard.getEquipmentname() + "_瞬时流量"); - point.setParmvalue(cellValue); - point.setSignaltype("AI"); - point.setBiztype(companyId); - point.setValuetype("sql"); - point.setActive("1"); - point.setEquipmentid(equipmentCard.getId()); - point.setSourceType("data"); - this.mPointService.save(companyId, point); - } - } - - /** - * 获取表格中导入能耗(电量),命名规则设备id_energy - * - * @param cellValue - * @return - */ - private void updateEnergy(String companyId, EquipmentCard equipmentCard, BigDecimal cellValue) { - MPoint mPoint = this.mPointService.selectById(companyId, equipmentCard.getEquipmentcardid() + "_energy"); - if (null != mPoint) { - mPoint.setParmvalue(cellValue); - mPoint.setEquipmentid(equipmentCard.getId()); - mPoint.setMeasuredt(CommUtil.nowDate()); - this.mPointService.update(companyId, mPoint); - } else { - MPoint point = new MPoint(); - point.setId(equipmentCard.getEquipmentcardid() + "_energy"); - point.setMpointid(equipmentCard.getEquipmentcardid() + "_energy"); - point.setMpointcode(equipmentCard.getEquipmentcardid() + "_energy"); - point.setParmname(equipmentCard.getEquipmentname() + "_能耗"); - point.setParmvalue(cellValue); - point.setSignaltype("AI"); - point.setBiztype(companyId); - point.setValuetype("sql"); - point.setActive("1"); - point.setEquipmentid(equipmentCard.getId()); - point.setSourceType("data"); - this.mPointService.save(companyId, point); - } - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * 获取设备树形结构 工艺段-巡检点-设备 - * - * @param unitId - * @param type - * @param - * @return - */ - public JSONArray getEquipment4Tree(String unitId, String type) { - JSONArray jsonArray = new JSONArray(); - //获取工艺段 - String whereStr = " where 1=1"; - List list = processSectionService.selectListByWhere(whereStr); - if (list != null && list.size() > 0) { - for (ProcessSection processSection : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", processSection.getId()); - jsonObject.put("name", processSection.getName()); - jsonObject.put("text", processSection.getName()); - jsonObject.put("icon", TimeEfficiencyCommStr.ProcessSection); - //获取巡检点 - String whereStr2 = " where unit_id='" + unitId + "' and process_section_id='" + processSection.getId() + "' and type='" + type + "'"; - List list2 = patrolPointService.selectListByWhere(whereStr2); - - JSONArray jsonArray2 = new JSONArray(); - String equipmentCardIds = ""; - if (list2 != null && list2.size() > 0) { - for (PatrolPoint patrolPoint : list2) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", patrolPoint.getId()); - jsonObject2.put("name", patrolPoint.getName()); - jsonObject2.put("text", patrolPoint.getName()); - jsonObject2.put("icon", TimeEfficiencyCommStr.PatrolPoint); - - //获取设备 - String whereStr3 = " where patrol_point_id='" + patrolPoint.getId() + "'"; - List list3 = patrolPointEquipmentCardService.selectListByWhere(whereStr3); - - JSONArray jsonArray3 = new JSONArray(); - if (list3 != null && list3.size() > 0) { - for (PatrolPointEquipmentCard patrolPointEquipmentCard : list3) { - JSONObject jsonObject3 = new JSONObject(); - if (patrolPointEquipmentCard.getEquipmentCard() != null) { - jsonObject3.put("id", patrolPointEquipmentCard.getEquipmentCard().getId()); - jsonObject3.put("name", patrolPointEquipmentCard.getEquipmentCard().getEquipmentname()); - jsonObject3.put("text", patrolPointEquipmentCard.getEquipmentCard().getEquipmentname()); - jsonObject3.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonArray3.add(jsonObject3); - equipmentCardIds += patrolPointEquipmentCard.getEquipmentCardId() + ","; - } - } - } - // jsonObject2.put("equData", jsonArray3); - jsonObject2.put("data", jsonArray3); - jsonObject2.put("nodes", jsonArray3); - jsonArray2.add(jsonObject2); - } - } - - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", "weiguanlianxunjiandian");//乱填的 不能写成"" - jsonObject2.put("name", "未关联巡检点"); - jsonObject2.put("text", "未关联巡检点"); - jsonObject2.put("icon", TimeEfficiencyCommStr.PatrolPoint); - - //获取设备 - equipmentCardIds = equipmentCardIds.replace(",", "','"); - String whereStr3 = " where processSectionId='" + processSection.getId() + "' and id not in ('" + equipmentCardIds + "') and bizId = '" + unitId + "'"; - List list3 = this.selectListByWhere(whereStr3); - - JSONArray jsonArray3 = new JSONArray(); - if (list3 != null && list3.size() > 0) { - for (EquipmentCard equipmentCard : list3) { - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("id", equipmentCard.getId()); - jsonObject3.put("name", equipmentCard.getEquipmentname()); - jsonObject3.put("text", equipmentCard.getEquipmentname()); - jsonObject3.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonArray3.add(jsonObject3); - } - } - // jsonObject2.put("equData", jsonArray3); - jsonObject2.put("data", jsonArray3); - jsonObject2.put("nodes", jsonArray3); - jsonArray2.add(jsonObject2); - - // jsonObject.put("pointData", jsonArray2); - jsonObject.put("data", jsonArray2); - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - } - return jsonArray; - } - - public List selectEquipmentByWhere(EquipmentCard equipmentcard) { - return equipmentCardDao.selectEquipmentByWhere(equipmentcard); - } - - public List getEquipmentClassIdGroup(String bizId) { - List list = equipmentCardDao.getEquipmentClassIdGroup(bizId); - return list; - } - - public List getEquipmentCardByWhere(String where) { - List list = equipmentCardDao.getEquipmentCardByWhere(where); - return list; - } - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * 导出设备表 - * - * @param response - * @param - * @param - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadPlaceEquipmentExcel(HttpServletResponse response, List equipmentCards, String equipmentBelongId) throws IOException { - Set assetNumber = new HashSet<>(); - //资产编号去重(卡片编号) - for (EquipmentCard equipmentCard : equipmentCards) { - if (null != equipmentCard.getAssetnumber() && !"".equals(equipmentCard.getAssetnumber())) { - assetNumber.add(equipmentCard.getAssetnumber()); - } - } - - Map> assetNumberEquListMap = new HashMap<>(); - for (String assetNumberVar : assetNumber) { - List equipmentList = null; - equipmentList = this.selectListByWhere(" where assetNumber='" + assetNumberVar + "'" + " and equipment_belong_id = '" + equipmentBelongId + "' "); - assetNumberEquListMap.put(assetNumberVar, equipmentList); - } - - String[] excelTitle = EquipmentCard.downloadPlaceEquipmentExcelTitleArr; - String fileName = "处设备台账表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备台账表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - HSSFRow row = sheet.createRow(0); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - - SimpleDateFormat useSdf = new SimpleDateFormat("yyyyMMdd"); - int rowIndex = 1; - for (Map.Entry> entry : assetNumberEquListMap.entrySet()) { - - int columnIndex = 0; - row = sheet.createRow(rowIndex++); - BigDecimal cardnum = new BigDecimal(entry.getValue().size()); - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(entry.getValue().get(0).getEquipmentcardid()); - - - //卡片编码 - String assetnumber = entry.getKey();//equip.getAssetnumber(); - row.createCell(columnIndex++).setCellValue(assetnumber); - /* if(null!=assetnumber){ - row.createCell(columnIndex++).setCellValue(assetnumber); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //资产名称 - String equipmentName = entry.getValue().get(0).getEquipmentname();//equip.getEquipmentname(); - if (null != equipmentName) { - row.createCell(columnIndex++).setCellValue(equipmentName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //资产代码(空着) - row.createCell(columnIndex++).setCellValue(""); - - //设备ID - List equipmentCardVarList = entry.getValue(); - StringBuilder equipmentCardIdSb = new StringBuilder(); - for (EquipmentCard ecVar : equipmentCardVarList) { - String id = ecVar.getId(); - equipmentCardIdSb.append(id + ","); - } - String id = equipmentCardIdSb.substring(0, equipmentCardIdSb.length() - 1); - if (null != id) { - row.createCell(columnIndex++).setCellValue(id); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //设备编码 - StringBuilder equipmentCardCodeSb = new StringBuilder(); - for (EquipmentCard ecVar : equipmentCardVarList) { - String equCardCodeVar = ecVar.getEquipmentcardid(); - equipmentCardCodeSb.append(equCardCodeVar + ","); - } - String equipmentCardCode = equipmentCardCodeSb.substring(0, equipmentCardCodeSb.length() - 1); - if (null != equipmentCardCode) { - row.createCell(columnIndex++).setCellValue(equipmentCardCode); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //类别代码 - String assetClassId = entry.getValue().get(0).getAssetclassid(); - if (null != assetClassId) { - row.createCell(columnIndex++).setCellValue(assetClassId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //类别名称 - if (null != assetClassId) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - String assetClassName = assetClass.getAssetclassname(); - row.createCell(columnIndex++).setCellValue(assetClassName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //原值 - BigDecimal equipmentvalue = entry.getValue().get(0).getEquipmentvalue(); - if (null != equipmentvalue) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equipmentvalue.multiply(cardnum))); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - - //计量单位 - String unit = entry.getValue().get(0).getUnit(); - if (null != unit) { - row.createCell(columnIndex++).setCellValue(unit); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //开始使用日期 - String useDate = entry.getValue().get(0).getUsedate(); - if (null != useDate && !"".equals(useDate)) { - useDate = useDate.substring(0, 10); - row.createCell(columnIndex++).setCellValue(useDate); - } else { - useDate = useSdf.format(new Date()); - row.createCell(columnIndex++).setCellValue(useDate); - } - - //部门代码 - String code = ""; - if (null != entry.getValue().get(0).getCode()) { - code = entry.getValue().get(0).getCode(); - row.createCell(columnIndex++).setCellValue(code); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //部门名称 - String companyName = ""; - String bizId = entry.getValue().get(0).getBizid(); - Company company = companyService.selectByPrimaryKey(bizId); - if (null != company) { - companyName = company.getSname(); - row.createCell(columnIndex++).setCellValue(companyName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //使用部门代码 - row.createCell(columnIndex++).setCellValue(code); - - //使用部门 - row.createCell(columnIndex++).setCellValue(companyName); - - //已用月份 - if (null != useDate && !"".equals(useDate)) { - //yyyyMMdd - String year = useDate.substring(0, 4); - String month = useDate.substring(4, 6); - String day = useDate.substring(6); - String useDateStr = year + "-" + month + "-" + day; - int result = useMonthCount(useDateStr); - row.createCell(columnIndex++).setCellValue(String.valueOf(result)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //资产类型代码 - row.createCell(columnIndex++).setCellValue("01"); - - //资产类型名称 - row.createCell(columnIndex++).setCellValue("固定资产"); - - //使用状况 - String status = entry.getValue().get(0).getEquipmentstatus(); - if (EquipmentCard.Status_OFF.equals(status)) { - row.createCell(columnIndex++).setCellValue("封存"); - } else if (EquipmentCard.Status_Fault.equals(status)) { - row.createCell(columnIndex++).setCellValue("故障异常"); - } else if (EquipmentCard.Status_ON.equals(status)) { - row.createCell(columnIndex++).setCellValue("在用"); - } else if (EquipmentCard.Status_Scrap.equals(status)) { - row.createCell(columnIndex++).setCellValue("报废"); - } else if (EquipmentCard.Status_Transfer.equals(status)) { - row.createCell(columnIndex++).setCellValue("调拨"); - } else if (EquipmentCard.Status_Sale.equals(status)) { - row.createCell(columnIndex++).setCellValue("出售"); - } else if (EquipmentCard.Status_Lose.equals(status)) { - row.createCell(columnIndex++).setCellValue("丢失"); - } else if (EquipmentCard.Status_STOP.equals(status)) { - row.createCell(columnIndex++).setCellValue("停用"); - } else { - row.createCell(columnIndex++).setCellValue("在用"); - } - - //增加方式 - String addWay = entry.getValue().get(0).getAddWay(); - if (null != addWay && !"".equals(addWay)) { - row.createCell(columnIndex++).setCellValue(addWay); - } else { - row.createCell(columnIndex++).setCellValue("直接购入"); - } - - - //数量 - row.createCell(columnIndex++).setCellValue("1"); - - //R9i资产启用日期 - String currDate = useSdf.format(new Date()); - row.createCell(columnIndex++).setCellValue(currDate); - - //公司代码 - row.createCell(columnIndex++).setCellValue("089003"); - - //对应折旧科目 - row.createCell(columnIndex++).setCellValue("1602"); - - //是否已注销 - row.createCell(columnIndex++).setCellValue("0"); - - //型号 - String modelId = entry.getValue().get(0).getEquipmentmodel(); - EquipmentTypeNumber equType = equipmentTypeNumberService.selectById(modelId); - if (null != equType) { - String name = equType.getName(); - row.createCell(columnIndex++).setCellValue(name); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //保存地点 - String areaId = entry.getValue().get(0).getAreaid(); - if (null != areaId && !"".equals(areaId)) { - row.createCell(columnIndex++).setCellValue(areaId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - - //累计工作量 - row.createCell(columnIndex++).setCellValue(""); - - //工作总量 - row.createCell(columnIndex++).setCellValue(""); - - //工作量单位 - row.createCell(columnIndex++).setCellValue(""); - - //等级 - row.createCell(columnIndex++).setCellValue(""); - - //月折旧率 - row.createCell(columnIndex++).setCellValue("0"); - //月折旧率 - /* BigDecimal monthDepreciationRate=cardProp.getMonthDepreciationRate(); - if(null!=monthDepreciationRate){ - row.createCell(columnIndex++).setCellValue(String.valueOf(monthDepreciationRate)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - - }*/ - - //月折旧额 - row.createCell(columnIndex++).setCellValue("0"); - //月折旧额 - /* BigDecimal monthDepreciation =cardProp.getMonthDepreciation(); - if(null!=monthDepreciation){ - row.createCell(columnIndex++).setCellValue(String.valueOf(monthDepreciation)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //净残值 - row.createCell(columnIndex++).setCellValue("0"); - //净残值 - /* BigDecimal netSalvageValue =cardProp.getNetSalvageValue(); - if(null!=netSalvageValue){ - row.createCell(columnIndex++).setCellValue(String.valueOf(netSalvageValue)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //净值 - BigDecimal currentValue = cardProp.getCurrentValue(); - if (null != currentValue) { - row.createCell(columnIndex++).setCellValue(String.valueOf(currentValue.multiply(cardnum))); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //净残值率 - row.createCell(columnIndex++).setCellValue("0"); - //净残值率 - /* Double residualValueRate=cardProp.getResidualValueRate(); - if(null!=residualValueRate){ - row.createCell(columnIndex++).setCellValue(String.valueOf(residualValueRate)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - - //预计清理费 - row.createCell(columnIndex++).setCellValue(""); - - //重估增值 - row.createCell(columnIndex++).setCellValue(""); - - //累计折旧 - row.createCell(columnIndex++).setCellValue("0"); - //累计折旧 - /* BigDecimal totalDepreciation=cardProp.getTotalDepreciation(); - if(null!=totalDepreciation){ - row.createCell(columnIndex++).setCellValue(String.valueOf(totalDepreciation)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //预计使用年限 - Double physicalLife = cardProp.getPhysicalLife(); - if (null != physicalLife) { - row.createCell(columnIndex++).setCellValue(String.valueOf(physicalLife)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - - //折旧方法 - row.createCell(columnIndex++).setCellValue("平均年限法(一)"); - - //已计提月份 - row.createCell(42).setCellValue("0"); - - //取得日期 - row.createCell(121).setCellValue(useDate); - //是否拆分卡片 - row.createCell(130).setCellValue("0"); - } - - int autoAddInt = 0; - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - //assetNumber为空或者为null - List equCardList = this.selectListByWhere(" where (assetNumber is null or assetNumber='') and equipment_belong_id = '" + equipmentBelongId + "' "); - if (equCardList.size() > 0 && null != equCardList) { - for (EquipmentCard equCard : equCardList) { - - int columnIndex = 0; - row = sheet.createRow(rowIndex++); - - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - - //卡片编码 - String assetnumberVar = sdf.format(new Date()) + (autoAddInt++); - row.createCell(columnIndex++).setCellValue(assetnumberVar); - - - //资产名称 - String equipmentName = equCard.getEquipmentname();//equip.getEquipmentname(); - if (null != equipmentName) { - row.createCell(columnIndex++).setCellValue(equipmentName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //资产代码(空着) - row.createCell(columnIndex++).setCellValue(""); - - //设备ID - String id = equCard.getId(); - if (null != id) { - row.createCell(columnIndex++).setCellValue(id); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //设备编码 - String equipmentCardId = equCard.getEquipmentcardid(); - if (null != equipmentCardId) { - row.createCell(columnIndex++).setCellValue(equipmentCardId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - - //类别代码 - String assetClassId = equCard.getAssetclassid(); - if (null != assetClassId) { - row.createCell(columnIndex++).setCellValue(assetClassId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //类别名称 - if (null != assetClassId) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - String assetClassName = assetClass.getAssetclassname(); - row.createCell(columnIndex++).setCellValue(assetClassName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //原值 - BigDecimal equipmentvalue = equCard.getEquipmentvalue(); - if (null != equipmentvalue) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equipmentvalue)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - - //计量单位 - String unit = equCard.getUnit(); - if (null != unit) { - row.createCell(columnIndex++).setCellValue(unit); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null != useDate && !"".equals(useDate)) { - useDate = useDate.substring(0, 10); - row.createCell(columnIndex++).setCellValue(useDate); - } else { - useDate = useSdf.format(new Date()); - row.createCell(columnIndex++).setCellValue(useDate); - } - - //部门代码 - String code = ""; - if (null != equCard.getCode()) { - code = equCard.getCode(); - row.createCell(columnIndex++).setCellValue(code); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //部门名称 - String companyName = ""; - String bizId = equCard.getBizid(); - Company company = companyService.selectByPrimaryKey(bizId); - if (null != company) { - companyName = company.getSname(); - row.createCell(columnIndex++).setCellValue(companyName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //使用部门代码 - row.createCell(columnIndex++).setCellValue(code); - - //使用部门 - row.createCell(columnIndex++).setCellValue(companyName); - - //已用月份 - if (null != useDate && !"".equals(useDate)) { - //yyyyMMdd - String year = useDate.substring(0, 4); - String month = useDate.substring(4, 6); - String day = useDate.substring(6); - String useDateStr = year + "-" + month + "-" + day; - int result = useMonthCount(useDateStr); - row.createCell(columnIndex++).setCellValue(String.valueOf(result)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //资产类型代码 - row.createCell(columnIndex++).setCellValue("01"); - - //资产类型名称 - row.createCell(columnIndex++).setCellValue("固定资产"); - - //使用状况 - String status = equCard.getEquipmentstatus(); - if (EquipmentCard.Status_OFF.equals(status)) { - row.createCell(columnIndex++).setCellValue("封存"); - } else if (EquipmentCard.Status_Fault.equals(status)) { - row.createCell(columnIndex++).setCellValue("故障异常"); - } else if (EquipmentCard.Status_ON.equals(status)) { - row.createCell(columnIndex++).setCellValue("在用"); - } else if (EquipmentCard.Status_Scrap.equals(status)) { - row.createCell(columnIndex++).setCellValue("报废"); - } else if (EquipmentCard.Status_Transfer.equals(status)) { - row.createCell(columnIndex++).setCellValue("调拨"); - } else if (EquipmentCard.Status_Sale.equals(status)) { - row.createCell(columnIndex++).setCellValue("出售"); - } else if (EquipmentCard.Status_Lose.equals(status)) { - row.createCell(columnIndex++).setCellValue("丢失"); - } else if (EquipmentCard.Status_STOP.equals(status)) { - row.createCell(columnIndex++).setCellValue("停用"); - } else { - row.createCell(columnIndex++).setCellValue("在用"); - } - - //增加方式 - String addWay = equCard.getAddWay(); - if (null != addWay && !"".equals(addWay)) { - row.createCell(columnIndex++).setCellValue(addWay); - } else { - row.createCell(columnIndex++).setCellValue("直接购入"); - } - - - //数量 - row.createCell(columnIndex++).setCellValue("1"); - - //R9i资产启用日期 - String currDate = useSdf.format(new Date()); - row.createCell(columnIndex++).setCellValue(currDate); - - //公司代码 - row.createCell(columnIndex++).setCellValue("089003"); - - //对应折旧科目 - row.createCell(columnIndex++).setCellValue("1602"); - - //是否已注销 - row.createCell(columnIndex++).setCellValue("0"); - - //型号 - String modelId = equCard.getEquipmentmodel(); - EquipmentTypeNumber equType = equipmentTypeNumberService.selectById(modelId); - if (null != equType) { - String name = equType.getName(); - row.createCell(columnIndex++).setCellValue(name); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //保存地点 - String areaId = equCard.getAreaid(); - if (null != areaId && !"".equals(areaId)) { - row.createCell(columnIndex++).setCellValue(areaId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //累计工作量 - row.createCell(columnIndex++).setCellValue(""); - - - //工作总量 - row.createCell(columnIndex++).setCellValue(""); - - //工作量单位 - row.createCell(columnIndex++).setCellValue(""); - - //等级 - row.createCell(columnIndex++).setCellValue(""); - - - //月折旧率 - row.createCell(columnIndex++).setCellValue("0"); - //月折旧率 - /* BigDecimal monthDepreciationRate=cardProp.getMonthDepreciationRate(); - if(null!=monthDepreciationRate){ - row.createCell(columnIndex++).setCellValue(String.valueOf(monthDepreciationRate)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //月折旧额 - row.createCell(columnIndex++).setCellValue("0"); - //月折旧额 - /* BigDecimal monthDepreciation =cardProp.getMonthDepreciation(); - if(null!=monthDepreciation){ - row.createCell(columnIndex++).setCellValue(String.valueOf(monthDepreciation)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //净残值 - row.createCell(columnIndex++).setCellValue("0"); - //净残值 - /* BigDecimal netSalvageValue =cardProp.getNetSalvageValue(); - if(null!=netSalvageValue){ - row.createCell(columnIndex++).setCellValue(String.valueOf(netSalvageValue)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //净值 - BigDecimal currentValue = cardProp.getCurrentValue(); - if (null != currentValue) { - row.createCell(columnIndex++).setCellValue(String.valueOf(currentValue)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //净残值率 - row.createCell(columnIndex++).setCellValue("0"); - //净残值率 - /* Double residualValueRate=cardProp.getResidualValueRate(); - if(null!=residualValueRate){ - row.createCell(columnIndex++).setCellValue(String.valueOf(residualValueRate)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - - //预计清理费 - row.createCell(columnIndex++).setCellValue(""); - - //重估增值 - row.createCell(columnIndex++).setCellValue(""); - - //累计折旧 - row.createCell(columnIndex++).setCellValue("0"); - //累计折旧 - /* BigDecimal totalDepreciation=cardProp.getTotalDepreciation(); - if(null!=totalDepreciation){ - row.createCell(columnIndex++).setCellValue(String.valueOf(totalDepreciation)); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //预计使用年限 - Double physicalLife = cardProp.getPhysicalLife(); - if (null != physicalLife) { - row.createCell(columnIndex++).setCellValue(String.valueOf(physicalLife)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - - //折旧方法 - row.createCell(columnIndex++).setCellValue("平均年限法(一)"); - - //已计提月份 - row.createCell(42).setCellValue("0"); - - //取得日期 - row.createCell(121).setCellValue(useDate); - - //是否拆分卡片 - row.createCell(130).setCellValue("0"); - } - } - - try { - //response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - - } finally { - workbook.close(); - } - } - - @SuppressWarnings("deprecation") - public void downloadPlaceEquipmentCompanyExcel(HttpServletResponse response, List equipmentCards, String equipmentBelongId) throws IOException { - Set assetNumber = new HashSet<>(); - String[] excelTitle = EquipmentCard.downloadPlaceEquipmentCompanyExcelTitleArr; - String fileName = "公司设备台账表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "公司备台账表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - HSSFRow row = sheet.createRow(0); - int rowIndex = 1; - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - - SimpleDateFormat useSdf = new SimpleDateFormat("yyyyMMdd"); - int autoAddInt = 0; - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - List equCardList = new ArrayList<>(); - //assetNumber为空或者为null - for (EquipmentCard equipmentCard : equipmentCards) { - if (null == equipmentCard.getAssetnumber() || "".equals(equipmentCard.getAssetnumber())) { - //System.out.println( equipmentCard.getAssetnumber()); - equCardList.add(equipmentCard); - - } - } - -// System.out.println("equCardList.size():" + equCardList.size()); - if (equCardList.size() > 0 && null != equCardList) { - for (EquipmentCard equCard : equCardList) { - - int columnIndex = 0; - row = sheet.createRow(rowIndex++); - - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //固定资产编码(卡片编码) - row.createCell(columnIndex++).setCellValue(""); - /* String assetnumberVar=sdf.format(new Date())+(autoAddInt++); - row.createCell(columnIndex++).setCellValue(assetnumberVar); - */ - /* if(null!=assetnumber){ - row.createCell(columnIndex++).setCellValue(assetnumber); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //固定资产名称(资产名称) - - String equipmentName = equCard.getEquipmentname();//equip.getEquipmentname(); - if (null != equipmentName) { - row.createCell(columnIndex++).setCellValue(equipmentName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //固定资产类型编码(类别代码) - String assetClassId = equCard.getAssetclassid(); - if (null != assetClassId) { - row.createCell(columnIndex++).setCellValue(assetClassId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //部门编码( 部门代码) - - String code = ""; - if (null != equCard.getCode()) { - code = equCard.getCode(); - row.createCell(columnIndex++).setCellValue(code); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //增加方式编码(增加方式) - - String addWay = equCard.getAddWay(); - if (null != addWay && !"".equals(addWay)) { - row.createCell(columnIndex++).setCellValue(addWay); - } else { - row.createCell(columnIndex++).setCellValue("101"); - } - //使用状况编码(使用状况) - /*String status=equCard.getEquipmentstatus(); - if(EquipmentCard.Status_OFF.equals(status)){ - row.createCell(columnIndex++).setCellValue("封存"); - }else if(EquipmentCard.Status_Fault.equals(status)){ - row.createCell(columnIndex++).setCellValue("故障异常"); - }else if(EquipmentCard.Status_ON.equals(status)){ - row.createCell(columnIndex++).setCellValue("1001"); - }else if(EquipmentCard.Status_Scrap.equals(status)){ - row.createCell(columnIndex++).setCellValue("报废"); - }else if(EquipmentCard.Status_Transfer.equals(status)){ - row.createCell(columnIndex++).setCellValue("调拨"); - }else if(EquipmentCard.Status_Sale.equals(status)){ - row.createCell(columnIndex++).setCellValue("出售"); - }else if(EquipmentCard.Status_Lose.equals(status)){ - row.createCell(columnIndex++).setCellValue("丢失"); - }else if(EquipmentCard.Status_STOP.equals(status)){ - row.createCell(columnIndex++).setCellValue("停用"); - }else if(null!=status){ - row.createCell(columnIndex++).setCellValue(status); - }else{ row.createCell(columnIndex++).setCellValue(""); }*/ - row.createCell(columnIndex++).setCellValue("1001"); - // 使用年限(预计使用年限) - - Double physicalLife = cardProp.getPhysicalLife(); - if (null != physicalLife) { - row.createCell(columnIndex++).setCellValue((int) (physicalLife * 12)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //使用比例(固定值) - row.createCell(columnIndex++).setCellValue(1); - // 折旧方法编码(固定值) - row.createCell(columnIndex++).setCellValue("2"); - //开始使用日期(开始使用日期) - - String useDate = equCard.getUsedate(); - if (null != useDate && !"".equals(useDate)) { - useDate = useDate.substring(0, 10); - - - row.createCell(columnIndex++).setCellValue(useDate); - } else { - useDate = useSdf.format(new Date()); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat formatter2 = new SimpleDateFormat("yyyyMMdd"); - Date date; - String dString = " "; - try { - date = formatter2.parse(useDate); - dString = formatter.format(date); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - row.createCell(columnIndex++).setCellValue(dString); - } - //币种(固定值) - row.createCell(columnIndex++).setCellValue("人民币"); - //汇率(固定值) - row.createCell(columnIndex++).setCellValue("1.00"); - //原值(原值) - - BigDecimal equipmentvalue = equCard.getEquipmentvalue(); - if (null != equipmentvalue) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equipmentvalue)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //规格型号(型号) - - String modelId = equCard.getEquipmentmodel(); - EquipmentTypeNumber equType = equipmentTypeNumberService.selectById(modelId); - if (null != equType) { - String name = equType.getName(); - row.createCell(columnIndex++).setCellValue(name); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //存放地点( 保存地点) - - String areaId = equCard.getAreaid(); - if (null != areaId && !"".equals(areaId)) { - row.createCell(columnIndex++).setCellValue(areaId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - //累计折旧(累计折旧) - if (equProp.getTotalDepreciation() != null) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equProp.getTotalDepreciation())); - } else { - row.createCell(columnIndex++).setCellValue("0.00"); - } - // 资产大类() - - row.createCell(columnIndex++).setCellValue(""); - - //工作总量 - row.createCell(columnIndex++).setCellValue("0.000"); - //累计工作量 - row.createCell(columnIndex++).setCellValue(""); - - //工作量单位 - row.createCell(columnIndex++).setCellValue(""); - //已使用月份(已用月份) - - if (null != useDate && !"".equals(useDate)) { - //yyyyMMdd - String year = useDate.substring(0, 4); - String month = useDate.substring(4, 6); - String day = useDate.substring(6); - String useDateStr = year + "-" + month + "-" + day; - int result = useMonthCount(useDateStr); - row.createCell(columnIndex++).setCellValue(String.valueOf(result)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //外币原值(?) - row.createCell(columnIndex++).setCellValue(""); - //净残值率 - - if (equProp.getResidualValueRate() != null) { - row.createCell(columnIndex++).setCellValue(equProp.getResidualValueRate()); - } else { - row.createCell(columnIndex++).setCellValue("0"); - } - //净残值 - if (equProp.getNetSalvageValue() != null) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equProp.getNetSalvageValue())); - } else { - row.createCell(columnIndex++).setCellValue("0"); - } - // 折旧科目编码(对应折旧科目) - row.createCell(columnIndex++).setCellValue("1602"); - //项目编码(资产代码) - row.createCell(columnIndex++).setCellValue(""); - //录入日期(取得日期) - row.createCell(31).setCellValue(CommUtil.nowDate()); - //录入员(默认) - row.createCell(31).setCellValue("demo"); - //数量 - row.createCell(37).setCellValue("1"); - //计量单位 - String unit = equCard.getUnit(); - if (null != unit) { - row.createCell(38).setCellValue(unit); - } else { - row.createCell(38).setCellValue(""); - } - - //设备uuID(设备ID) - String id = equCard.getId(); - if (null != id) { - row.createCell(41).setCellValue(id); - } else { - row.createCell(41).setCellValue(""); - } - - //设备编号(设备编码) - String equipmentCardId = equCard.getEquipmentcardid(); - if (null != equipmentCardId) { - row.createCell(40).setCellValue(equipmentCardId); - } else { - row.createCell(40).setCellValue(""); - } - - - } - } - - //资产编号去重(卡片编号) - for (EquipmentCard equipmentCard : equipmentCards) { - if (null != equipmentCard.getAssetnumber() && !"".equals(equipmentCard.getAssetnumber())) { - assetNumber.add(equipmentCard.getAssetnumber()); - - } - } -// System.out.println("assetNumber.size():" + assetNumber.size()); - Map> assetNumberEquListMap = new HashMap<>(); - for (String assetNumberVar : assetNumber) { - List equipmentList = null; - equipmentList = this.selectListByWhere(" where assetNumber='" + assetNumberVar + "'" + " and equipment_belong_id = '" + equipmentBelongId + "' "); - assetNumberEquListMap.put(assetNumberVar, equipmentList); - - } - - - for (Map.Entry> entry : assetNumberEquListMap.entrySet()) { - - int columnIndex = 0; - row = sheet.createRow(rowIndex++); - - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(entry.getValue().get(0).getEquipmentcardid()); - - BigDecimal cardnum = new BigDecimal(entry.getValue().size()); - //固定资产编码(卡片编码) - String assetnumber = entry.getKey();//equip.getAssetnumber(); - if (assetnumber.length() < 5) { - //String aString = String.format("%05s", assetnumber); - String aString = "00000" + assetnumber; - row.createCell(columnIndex++).setCellValue(aString.substring(aString.length() - 5, aString.length())); - for (EquipmentCard equipmentCard : entry.getValue()) { - equipmentCard.setAssetnumber(aString.substring(aString.length() - 5, aString.length())); - this.update(equipmentCard); - } - } else { - row.createCell(columnIndex++).setCellValue(assetnumber); - } -/* if(null!=assetnumber){ - row.createCell(columnIndex++).setCellValue(assetnumber); - }else{ - row.createCell(columnIndex++).setCellValue(""); - }*/ - - //固定资产名称(资产名称) - String equipmentName = entry.getValue().get(0).getEquipmentname();//equip.getEquipmentname(); - if (null != equipmentName) { - row.createCell(columnIndex++).setCellValue(equipmentName); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //固定资产类型编码(类别代码) - - String assetClassId = entry.getValue().get(0).getAssetclassid(); - if (null != assetClassId) { - row.createCell(columnIndex++).setCellValue(assetClassId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //部门编码( 部门代码) - String code = ""; - if (null != entry.getValue().get(0).getCode()) { - code = entry.getValue().get(0).getCode(); - row.createCell(columnIndex++).setCellValue(code); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - - //增加方式编码(增加方式) - String addWay = entry.getValue().get(0).getAddWay(); - if (null != addWay && !"".equals(addWay)) { - row.createCell(columnIndex++).setCellValue(addWay); - } else { - row.createCell(columnIndex++).setCellValue("101"); - } - //使用状况编码(使用状况) - /*String status=entry.getValue().get(0).getEquipmentstatus(); - if(EquipmentCard.Status_OFF.equals(status)){ - row.createCell(columnIndex++).setCellValue("封存"); - }else if(EquipmentCard.Status_Fault.equals(status)){ - row.createCell(columnIndex++).setCellValue("故障异常"); - }else if(EquipmentCard.Status_ON.equals(status)){ - row.createCell(columnIndex++).setCellValue("1001"); - }else if(EquipmentCard.Status_Scrap.equals(status)){ - row.createCell(columnIndex++).setCellValue("报废"); - }else if(EquipmentCard.Status_Transfer.equals(status)){ - row.createCell(columnIndex++).setCellValue("调拨"); - }else if(EquipmentCard.Status_Sale.equals(status)){ - row.createCell(columnIndex++).setCellValue("出售"); - }else if(EquipmentCard.Status_Lose.equals(status)){ - row.createCell(columnIndex++).setCellValue("丢失"); - }else if(EquipmentCard.Status_STOP.equals(status)){ - row.createCell(columnIndex++).setCellValue("停用"); - } else if(null!=status){ - row.createCell(columnIndex++).setCellValue(status); - }else{ row.createCell(columnIndex++).setCellValue(""); }*/ - row.createCell(columnIndex++).setCellValue("1001"); - // 使用年限(预计使用年限) - Double physicalLife = cardProp.getPhysicalLife(); - if (null != physicalLife) { - row.createCell(columnIndex++).setCellValue((int) (physicalLife * 12)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //使用比例(固定值) - row.createCell(columnIndex++).setCellValue(1); - // 折旧方法编码(固定值) - row.createCell(columnIndex++).setCellValue("2"); - //开始使用日期(开始使用日期) - String useDate = entry.getValue().get(0).getUsedate(); - if (null != useDate && !"".equals(useDate)) { - useDate = useDate.substring(0, 10); - row.createCell(columnIndex++).setCellValue(useDate); - } else { - useDate = useSdf.format(new Date()); - - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat formatter2 = new SimpleDateFormat("yyyyMMdd"); - Date date; - String dString = " "; - try { - date = formatter2.parse(useDate); - dString = formatter.format(date); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - row.createCell(columnIndex++).setCellValue(dString); - - } - //币种(固定值) - row.createCell(columnIndex++).setCellValue("人民币"); - //汇率(固定值) - row.createCell(columnIndex++).setCellValue("1.00"); - //原值(原值) - BigDecimal equipmentvalue = entry.getValue().get(0).getEquipmentvalue(); - if (null != equipmentvalue) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equipmentvalue.multiply(cardnum))); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //规格型号(型号) - String modelId = entry.getValue().get(0).getEquipmentmodel(); - EquipmentTypeNumber equType = equipmentTypeNumberService.selectById(modelId); - if (null != equType) { - String name = equType.getName(); - row.createCell(columnIndex++).setCellValue(name); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //存放地点( 保存地点) - String areaId = entry.getValue().get(0).getAreaid(); - if (null != areaId && !"".equals(areaId)) { - row.createCell(columnIndex++).setCellValue(areaId); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - EquipmentCardProp equProp = propService.selectByEquipmentId(entry.getValue().get(0).getEquipmentcardid()); - //累计折旧(累计折旧) - if (equProp.getTotalDepreciation() != null) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equProp.getTotalDepreciation().multiply(cardnum))); - } else { - row.createCell(columnIndex++).setCellValue("0.00"); - } - // 资产大类() - - row.createCell(columnIndex++).setCellValue(""); - - //工作总量 - row.createCell(columnIndex++).setCellValue("0.000"); - //累计工作量 - row.createCell(columnIndex++).setCellValue(""); - - //工作量单位 - row.createCell(columnIndex++).setCellValue(""); - //已使用月份(已用月份) - if (null != useDate && !"".equals(useDate)) { - //yyyyMMdd - String year = useDate.substring(0, 4); - String month = useDate.substring(4, 6); - String day = useDate.substring(6); - String useDateStr = year + "-" + month + "-" + day; - int result = useMonthCount(useDateStr); - row.createCell(columnIndex++).setCellValue(String.valueOf(result)); - } else { - row.createCell(columnIndex++).setCellValue(""); - } - //外币原值(?) - row.createCell(columnIndex++).setCellValue(""); - //净残值率 - - if (equProp.getResidualValueRate() != null) { - row.createCell(columnIndex++).setCellValue(equProp.getResidualValueRate()); - } else { - row.createCell(columnIndex++).setCellValue("0"); - } - //净残值 - if (equProp.getNetSalvageValue() != null) { - row.createCell(columnIndex++).setCellValue(String.valueOf(equProp.getNetSalvageValue().multiply(cardnum))); - } else { - row.createCell(columnIndex++).setCellValue("0"); - } - // 折旧科目编码(对应折旧科目) - row.createCell(columnIndex++).setCellValue("1602"); - //项目编码(资产代码) - row.createCell(columnIndex++).setCellValue(""); - //录入日期(取得日期) - row.createCell(30).setCellValue(CommUtil.nowDate()); - //录入员(默认) - row.createCell(31).setCellValue("demo"); - - //数量 - row.createCell(37).setCellValue("1"); - //计量单位 - String unit = entry.getValue().get(0).getUnit(); - if (null != unit) { - row.createCell(38).setCellValue(unit); - } else { - row.createCell(38).setCellValue(""); - } - - //设备uuID(设备ID) - List equipmentCardVarList = entry.getValue(); - String equipmentCardId1 = ""; - //StringBuilder equipmentCardIdSb = new StringBuilder(); - EquipmentCard equipmentCard1 = new EquipmentCard(); - String equipmentCardId = "cardid" + CommUtil.getOnlyID(); - equipmentCard1.setEquipmentOutIds(equipmentCardId); - - for (EquipmentCard ecVar : equipmentCardVarList) { - if (null != ecVar.getEquipmentOutIds() && "cardid".equals(ecVar.getEquipmentOutIds().substring(0, 6))) { - equipmentCardId1 = ecVar.getEquipmentOutIds(); - } else { - String id = ecVar.getId(); - equipmentCard1.setId(id); - this.update(equipmentCard1); - //equipmentCardIdSb.append(id+","); - equipmentCardId1 = equipmentCardId; - } - } - //String id=equipmentCardIdSb.substring(0,equipmentCardIdSb.length()-1); - if (null != equipmentCardId1) { - - row.createCell(41).setCellValue(equipmentCardId1); - } else { - row.createCell(41).setCellValue(""); - } - - //设备编号(设备编码) - - StringBuilder equipmentCardCodeSb = new StringBuilder(); - for (EquipmentCard ecVar : equipmentCardVarList) { - String equCardCodeVar = ecVar.getEquipmentcardid(); - equipmentCardCodeSb.append(equCardCodeVar + ","); - } - String equipmentCardCode = equipmentCardCodeSb.substring(0, equipmentCardCodeSb.length() - 1); - if (null != equipmentCardCode) { - row.createCell(40).setCellValue(equipmentCardCode); - } else { - row.createCell(40).setCellValue(""); - } - - } - - - try { - //response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - - } finally { - workbook.close(); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //xxxx-xx-xx - public int useMonthCount(String useDate) { - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date()); - int currYear = cal.get(Calendar.YEAR); - int currMonth = (cal.get(Calendar.MONTH) + 1); - String yearStr = useDate.substring(0, 4); - String monthStr = useDate.substring(5, 7); - int yearInt = Integer.parseInt(yearStr); - int monthInt = Integer.parseInt(monthStr); - int result = (currYear - yearInt) * 12 + (currMonth - monthInt); - return result; - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - public String uploadPlaceEquipmentExcelXlsx(InputStream input, String equipmentBelongId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - //int insertNum = 0; - int updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(0); - if (sheet == null || rowTitle.getLastCellNum() < 131) { - continue; - } - - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - XSSFRow row = sheet.getRow(rowNum); - //int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - //int maxCellNum = row.getLastCellNum();//最后一列 - //EquipmentCard equipmentCard = new EquipmentCard(); - // EquipmentCardProp cardProp = new EquipmentCardProp(); - String assetNumber = ""; - //卡片编号 - XSSFCell assNumCell = row.getCell(0); - if (null != assNumCell && !"".equals(assNumCell)) { - assetNumber = getStringVal(assNumCell); - } - //设备ID() - XSSFCell equIdCell = row.getCell(3); - String equId = ""; - if (null != equIdCell && !"".equals(equIdCell)) { - equId = getStringVal(equIdCell); - } - - - if (null != equId && !"".equals(equId)) { - updateNum = updateEquCardByIdXlsx(equId, row, updateNum); - } else if (null != assetNumber && !"".equals(assetNumber)) { - updateNum = updateEquCardByAssetNumberXlsx(assetNumber, row, updateNum); - } else { - break; - } - - }//row - }//sheet - String result = ""; - result += "更新成功数据" + updateNum + "条;"; - - workbook.close(); - return result; - } - - public String uploadPlaceCompanyEquipmentExcelXlsx(InputStream input, String equipmentBelongId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - //int insertNum = 0; - int updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(0); - if (sheet == null || rowTitle.getLastCellNum() < 131) { - continue; - } - - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - XSSFRow row = sheet.getRow(rowNum); - //int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - //int maxCellNum = row.getLastCellNum();//最后一列 - //EquipmentCard equipmentCard = new EquipmentCard(); - // EquipmentCardProp cardProp = new EquipmentCardProp(); - String assetNumber = ""; - //卡片编号 - XSSFCell assNumCell = row.getCell(0); - if (null != assNumCell && !"".equals(assNumCell)) { - assetNumber = getStringVal(assNumCell); - } - //设备ID() - XSSFCell equIdCell = row.getCell(41); - String equId = ""; - if (null != equIdCell && !"".equals(equIdCell)) { - equId = getStringVal(equIdCell); - } - - - if (null != equId && !"".equals(equId)) { - updateNum = updateEquComPanyCardByIdXlsx(equId, row, updateNum); - } else if (null != assetNumber && !"".equals(assetNumber)) { - updateNum = updateEquComPanyCardByAssetNumberXlsx(assetNumber, row, updateNum); - } else { - break; - } - - }//row - }//sheet - String result = ""; - result += "更新成功数据" + updateNum + "条;"; - - workbook.close(); - return result; - } - - /** - * xls文件导入 - * - * @param input - * @return - * @throws IOException - */ - public String uploadPlaceEquipmentExcelXls(InputStream input, String equipmentBelongId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - //int insertNum = 0; - int updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { -// System.out.println(numSheet); -// System.out.println(workbook.getNumberOfSheets()); - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(0); - if (sheet == null || rowTitle.getLastCellNum() < 131) { - continue; - } - - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - //int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - //int maxCellNum = row.getLastCellNum();//最后一列 - //EquipmentCard equipmentCard = new EquipmentCard(); - // EquipmentCardProp cardProp = new EquipmentCardProp(); - String assetNumber = ""; - //卡片编号 - HSSFCell assNumCell = row.getCell(0); - if (null != assNumCell && !"".equals(assNumCell)) { - assetNumber = getStringVal(assNumCell); - } - //设备ID() - HSSFCell equIdCell = row.getCell(3); - String equId = ""; - if (null != equIdCell && !"".equals(equIdCell)) { - equId = getStringVal(equIdCell); - } - - - if (null != equId && !"".equals(equId)) { - updateNum = updateEquCardByIdXls(equId, row, updateNum); - } else if (null != assetNumber && !"".equals(assetNumber)) { - updateNum = updateEquCardByAssetNumberXls(assetNumber, row, updateNum); - } else { - break; - } - - }//row - }//sheet - String result = ""; - result += "更新成功数据" + updateNum + "条;"; - - workbook.close(); - return result; - } - - public String uploadPlaceConpanyEquipmentExcelXls(InputStream input, String equipmentBelongId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - //int insertNum = 0; - int updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { -// System.out.println(numSheet); -// System.out.println(workbook.getNumberOfSheets()); - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(0); - -// System.out.println(""); - if (sheet == null || rowTitle.getLastCellNum() < 32) { - - continue; - } - - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - //int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - //int maxCellNum = row.getLastCellNum();//最后一列 - //EquipmentCard equipmentCard = new EquipmentCard(); - // EquipmentCardProp cardProp = new EquipmentCardProp(); - String assetNumber = ""; - //卡片编号 - HSSFCell assNumCell = row.getCell(0); - if (null != assNumCell && !"".equals(assNumCell)) { - assetNumber = getStringVal(assNumCell); - } - //设备ID() - HSSFCell equIdCell = row.getCell(41); - String equId = ""; - if (null != equIdCell && !"".equals(equIdCell)) { - equId = getStringVal(equIdCell); - } - - - if (null != equId && !"".equals(equId)) { - updateNum = updateEquComPanyCardByIdXls(equId, row, updateNum); - } else if (null != assetNumber && !"".equals(assetNumber)) { - updateNum = updateEquComPanyCardByAssetNumberXls(assetNumber, row, updateNum); - } else { - break; - } - - }//row - }//sheet - String result = ""; - result += "更新成功数据" + updateNum + "条;"; - - workbook.close(); - return result; - } - - public int updateEquCardByIdXls(String equId, HSSFRow row, int updateNum) { - //类别代码 - HSSFCell cell_5 = row.getCell(5); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - HSSFCell cell_6 = row.getCell(6); - String assetName = getStringVal(cell_6); - if (null != assetName && !"".equals(assetName)) { - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - assetClassService.update(assetClass); - } - } - - - //使用部门代码 - HSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - HSSFCell cell_11 = row.getCell(11); - String cellDeptName = getStringVal(cell_11); - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - - if (-1 != equId.indexOf(",")) { - //有多个设备ID - String[] idArr = equId.split(","); - HSSFCell cell_19s = row.getCell(19); - int cardNub1 = Integer.parseInt(getStringVal(cell_19s)); - if (idArr.length > cardNub1) { - cardNub1 = idArr.length; - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for (String idVar : idArr) { - - EquipmentCard equCard = this.selectById(idVar); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - /* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - HSSFCell cell_7 = row.getCell(7); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位 - HSSFCell cell_8 = row.getCell(8); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - - HSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - String year = cellUseDate.substring(0, 4); - String month = cellUseDate.substring(4, 6); - String day = cellUseDate.substring(6); - String date = year + "-" + month + "-" + day; - if (null != date && !"".equals(date)) { - equCard.setUsedate(date); - } - - } - - //使用部门代码 - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - HSSFCell cell_24 = row.getCell(24); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - - //净残值 - HSSFCell cell_32 = row.getCell(32); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - HSSFCell cell_33 = row.getCell(33); - String currentValue = getStringVal(cell_33); - if (null != currentValue && !"".equals(currentValue)) { - equProp.setCurrentValue(strTOBigDecimal(currentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净残值率 - HSSFCell cell_34 = row.getCell(34); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(37); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //预计使用年限 - HSSFCell cell_38 = row.getCell(38); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //增加方式 - HSSFCell cell_18 = row.getCell(18); - String addway = getStringVal(cell_18); - if (null != addway && !"".equals(addway)) { - equCard.setAddWay(addway); - } - //存放地点 - HSSFCell cell_25 = row.getCell(25); - String areaID = getStringVal(cell_25); - if (null != areaID && !"".equals(areaID)) { - equCard.setAreaid(areaID); - } - //制造厂商 - HSSFCell cell_46 = row.getCell(46); - String equipmentManufacturer = getStringVal(cell_46); - if (null != equipmentManufacturer && !"".equals(equipmentManufacturer)) { - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //出厂日期 - HSSFCell cell_47 = row.getCell(47); - String productionDate = getStringVal(cell_47); - if (null != productionDate && !"".equals(productionDate)) { - equCard.setProductiondate(productionDate); - } - //入账日期 - HSSFCell cell_105 = row.getCell(105); - String purchaseDate = getStringVal(cell_105); - if (null != purchaseDate && !"".equals(purchaseDate)) { - equCard.setPurchasedate(purchaseDate); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - - //break; - } else { - //只有单个设备ID - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - /* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - HSSFCell cell_7 = row.getCell(7); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue)); - } - - //计量单位 - HSSFCell cell_8 = row.getCell(8); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - HSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - String year = cellUseDate.substring(0, 4); - String month = cellUseDate.substring(4, 6); - String day = cellUseDate.substring(6); - String date = year + "-" + month + "-" + day; - if (null != date && !"".equals(date)) { - equCard.setUsedate(date); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - HSSFCell cell_24 = row.getCell(24); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - - - //净残值 - HSSFCell cell_32 = row.getCell(32); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue)); - } - - //净值 - HSSFCell cell_33 = row.getCell(33); - String currentValue = getStringVal(cell_33); - if (null != currentValue && !"".equals(currentValue)) { - equProp.setCurrentValue(strTOBigDecimal(currentValue)); - } - - //净残值率 - HSSFCell cell_34 = row.getCell(34); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(37); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation)); - } - - //预计使用年限 - HSSFCell cell_38 = row.getCell(38); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //增加方式 - HSSFCell cell_18 = row.getCell(18); - String addway = getStringVal(cell_18); - if (null != addway && !"".equals(addway)) { - equCard.setAddWay(addway); - } - //存放地点 - HSSFCell cell_25 = row.getCell(25); - String areaID = getStringVal(cell_25); - if (null != areaID && !"".equals(areaID)) { - equCard.setAreaid(areaID); - } - //制造厂商 - HSSFCell cell_46 = row.getCell(46); - String equipmentManufacturer = getStringVal(cell_46); - if (null != equipmentManufacturer && !"".equals(equipmentManufacturer)) { - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //出厂日期 - HSSFCell cell_47 = row.getCell(47); - String productionDate = getStringVal(cell_47); - if (null != productionDate && !"".equals(productionDate)) { - equCard.setProductiondate(productionDate); - } - //入账日期 - HSSFCell cell_105 = row.getCell(105); - String purchaseDate = getStringVal(cell_105); - if (null != purchaseDate && !"".equals(purchaseDate)) { - equCard.setPurchasedate(purchaseDate); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - return updateNum; - } - - public int updateEquCardByIdXlsx(String equId, XSSFRow row, int updateNum) { - //类别代码 - XSSFCell cell_5 = row.getCell(5); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - XSSFCell cell_6 = row.getCell(6); - String assetName = getStringVal(cell_6); - if (null != assetName && !"".equals(assetName)) { - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - assetClassService.update(assetClass); - } - } - - - //使用部门代码 - XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - XSSFCell cell_11 = row.getCell(11); - String cellDeptName = getStringVal(cell_11); - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - - if (-1 != equId.indexOf(",")) { - //有多个设备ID - String[] idArr = equId.split(","); - XSSFCell cell_19s = row.getCell(19); - int cardNub1 = Integer.parseInt(getStringVal(cell_19s)); - if (idArr.length > cardNub1) { - cardNub1 = idArr.length; - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for (String idVar : idArr) { - - EquipmentCard equCard = this.selectById(idVar); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - /* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - XSSFCell cell_7 = row.getCell(7); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位 - XSSFCell cell_8 = row.getCell(8); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - - XSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - String year = cellUseDate.substring(0, 4); - String month = cellUseDate.substring(4, 6); - String day = cellUseDate.substring(6); - String date = year + "-" + month + "-" + day; - if (null != date && !"".equals(date)) { - equCard.setUsedate(date); - } - - } - - //使用部门代码 - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - XSSFCell cell_24 = row.getCell(24); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - - //净残值 - XSSFCell cell_32 = row.getCell(32); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - XSSFCell cell_33 = row.getCell(33); - String currentValue = getStringVal(cell_33); - if (null != currentValue && !"".equals(currentValue)) { - equProp.setCurrentValue(strTOBigDecimal(currentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净残值率 - XSSFCell cell_34 = row.getCell(34); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - XSSFCell cell_37 = row.getCell(37); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //预计使用年限 - XSSFCell cell_38 = row.getCell(38); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //增加方式 - XSSFCell cell_18 = row.getCell(18); - String addway = getStringVal(cell_18); - if (null != addway && !"".equals(addway)) { - equCard.setAddWay(addway); - } - //存放地点 - XSSFCell cell_25 = row.getCell(25); - String areaID = getStringVal(cell_25); - if (null != areaID && !"".equals(areaID)) { - equCard.setAreaid(areaID); - } - //制造厂商 - XSSFCell cell_46 = row.getCell(46); - String equipmentManufacturer = getStringVal(cell_46); - if (null != equipmentManufacturer && !"".equals(equipmentManufacturer)) { - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //出厂日期 - XSSFCell cell_47 = row.getCell(47); - String productionDate = getStringVal(cell_47); - if (null != productionDate && !"".equals(productionDate)) { - equCard.setProductiondate(productionDate); - } - //入账日期 - XSSFCell cell_105 = row.getCell(105); - String purchaseDate = getStringVal(cell_105); - if (null != purchaseDate && !"".equals(purchaseDate)) { - equCard.setPurchasedate(purchaseDate); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - - //break; - } else { - //只有单个设备ID - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - /* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - XSSFCell cell_7 = row.getCell(7); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue)); - } - - //计量单位 - XSSFCell cell_8 = row.getCell(8); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - XSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - String year = cellUseDate.substring(0, 4); - String month = cellUseDate.substring(4, 6); - String day = cellUseDate.substring(6); - String date = year + "-" + month + "-" + day; - if (null != date && !"".equals(date)) { - equCard.setUsedate(date); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - XSSFCell cell_24 = row.getCell(24); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - - - //净残值 - XSSFCell cell_32 = row.getCell(32); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue)); - } - - //净值 - XSSFCell cell_33 = row.getCell(33); - String currentValue = getStringVal(cell_33); - if (null != currentValue && !"".equals(currentValue)) { - equProp.setCurrentValue(strTOBigDecimal(currentValue)); - } - - //净残值率 - XSSFCell cell_34 = row.getCell(34); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - XSSFCell cell_37 = row.getCell(37); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation)); - } - - //预计使用年限 - XSSFCell cell_38 = row.getCell(38); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //增加方式 - XSSFCell cell_18 = row.getCell(18); - String addway = getStringVal(cell_18); - if (null != addway && !"".equals(addway)) { - equCard.setAddWay(addway); - } - //存放地点 - XSSFCell cell_25 = row.getCell(25); - String areaID = getStringVal(cell_25); - if (null != areaID && !"".equals(areaID)) { - equCard.setAreaid(areaID); - } - //制造厂商 - XSSFCell cell_46 = row.getCell(46); - String equipmentManufacturer = getStringVal(cell_46); - if (null != equipmentManufacturer && !"".equals(equipmentManufacturer)) { - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //出厂日期 - XSSFCell cell_47 = row.getCell(47); - String productionDate = getStringVal(cell_47); - if (null != productionDate && !"".equals(productionDate)) { - equCard.setProductiondate(productionDate); - } - //入账日期 - XSSFCell cell_105 = row.getCell(105); - String purchaseDate = getStringVal(cell_105); - if (null != purchaseDate && !"".equals(purchaseDate)) { - equCard.setPurchasedate(purchaseDate); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - return updateNum; - } - - public int updateEquCardByAssetNumberXls(String assetNumber, HSSFRow row, int updateNum) { - - List equCardList = new ArrayList(); - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - - //类别代码 - HSSFCell cell_5 = row.getCell(5); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - HSSFCell cell_6 = row.getCell(6); - String assetName = getStringVal(cell_6); - if (null != assetName && !"".equals(assetName)) { - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - //类别名称 - /* XSSFCell cell_6 = row.getCell(6); - String assetName=getStringVal(cell_6); - if(null!=assetName && !"".equals(assetName)){ - assetClass.setAssetclassname(assetName); - }*/ - - assetClassService.update(assetClass); - } - } - - //使用部门代码 - HSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - HSSFCell cell_11 = row.getCell(11); - String cellDeptName = getStringVal(cell_11); - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - if (null != assetnumber && !"".equals(assetnumber)) { - equCardList = this.selectListByWhere(" where assetNumber='" + assetnumber + "'"); - } - - - if (equCardList.size() > 0 && null != equCardList) { - HSSFCell cell_19s = row.getCell(18); - int cardNub1 = Integer.parseInt(getStringVal(cell_19s)); - if (equCardList.size() > cardNub1) { - cardNub1 = equCardList.size(); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for (EquipmentCard equipmentCard : equCardList) { - String equId = equipmentCard.getId(); - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - HSSFCell cell_7 = row.getCell(7); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - //System.out.println("######"+equipmentValue+"###"); - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位 - HSSFCell cell_8 = row.getCell(8); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - HSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - String year = cellUseDate.substring(0, 4); - String month = cellUseDate.substring(4, 6); - String day = cellUseDate.substring(6); - String date = year + "-" + month + "-" + day; - if (null != date && !"".equals(date)) { - equCard.setUsedate(date); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - HSSFCell cell_24 = row.getCell(24); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - - //资产代码 -// HSSFCell cell_2 = row.getCell(2); -// String currentValue = getStringVal(cell_2); -// if(null!=currentValue && !"".equals(currentValue) ){ -// equProp.setCurrentValue(strTOBigDecimal(currentValue)); -// } - //净残值 - HSSFCell cell_32 = row.getCell(32); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - HSSFCell cell_33 = row.getCell(33); - String currentValue = getStringVal(cell_33); - if (null != currentValue && !"".equals(currentValue)) { - equProp.setCurrentValue(strTOBigDecimal(currentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净残值率 - HSSFCell cell_34 = row.getCell(34); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(37); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - - DecimalFormat format = new DecimalFormat(); - format.setParseBigDecimal(true); - ParsePosition position = new ParsePosition(0); - BigDecimal parse = (BigDecimal) format.parse(totalDepreciation, position); - // System.out.println("######"+parse+"###"); - equProp.setTotalDepreciation(parse.divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //预计使用年限 - HSSFCell cell_38 = row.getCell(38); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //增加方式 - HSSFCell cell_18 = row.getCell(18); - String addway = getStringVal(cell_18); - if (null != addway && !"".equals(addway)) { - equCard.setAddWay(addway); - } - //存放地点 - HSSFCell cell_25 = row.getCell(25); - String areaID = getStringVal(cell_25); - if (null != areaID && !"".equals(areaID)) { - equCard.setAreaid(areaID); - } - //制造厂商 - HSSFCell cell_46 = row.getCell(46); - String equipmentManufacturer = getStringVal(cell_46); - if (null != equipmentManufacturer && !"".equals(equipmentManufacturer)) { - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //出厂日期 - HSSFCell cell_47 = row.getCell(47); - String productionDate = getStringVal(cell_47); - if (null != productionDate && !"".equals(productionDate)) { - equCard.setProductiondate(productionDate); - } - //入账日期 - HSSFCell cell_105 = row.getCell(105); - String purchaseDate = getStringVal(cell_105); - if (null != purchaseDate && !"".equals(purchaseDate)) { - equCard.setPurchasedate(purchaseDate); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - } - } - //break; - return updateNum; - } - - public int updateEquComPanyCardByAssetNumberXls(String assetNumber, HSSFRow row, int updateNum) { - - List equCardList = new ArrayList(); - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - - //类别代码 - HSSFCell cell_5 = row.getCell(2); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - HSSFCell cell_6 = row.getCell(16); - - if (null != cell_6 && !"".equals(cell_6)) { - String assetName = getStringVal(cell_6); - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - //类别名称 -/* XSSFCell cell_6 = row.getCell(6); - String assetName=getStringVal(cell_6); - if(null!=assetName && !"".equals(assetName)){ - assetClass.setAssetclassname(assetName); - }*/ - - assetClassService.update(assetClass); - } - } - - //使用部门代码 - HSSFCell cell_10 = row.getCell(3); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - String companyName = ""; - String cellDeptName = ""; - Company company = companyService.selectByPrimaryKey(cellCode); - if (null != company) { - companyName = company.getSname(); - cellDeptName = companyName; - } else { - cellDeptName = companyName; - } - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - if (null != assetnumber && !"".equals(assetnumber)) { - equCardList = this.selectListByWhere(" where assetNumber='" + assetnumber + "'"); - } - - - if (equCardList.size() > 0 && null != equCardList) { - HSSFCell cell_34s = row.getCell(37); - //System.out.println(cell_34s); - int cardNub1 = (int) Double.parseDouble(getStringVal(cell_34s)); - if (equCardList.size() > cardNub1) { - cardNub1 = equCardList.size(); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - - for (EquipmentCard equipmentCard : equCardList) { - String equId = equipmentCard.getId(); - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - HSSFCell cell_7 = row.getCell(12); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位 - HSSFCell cell_8 = row.getCell(35); - - if (null != cell_8 && !"".equals(cell_8)) { - String unit = getStringVal(cell_8); - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - HSSFCell cell_9 = row.getCell(9); - if (null == cell_9 || "".equals(cell_9)) { - - String cellUseDate = getStringVal(cell_9); -// System.out.println("cellUseDate####" + cellUseDate); - if (null != cellUseDate && !"".equals(cellUseDate)) { - equCard.setUsedate(cellUseDate); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { -/* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - HSSFCell cell_24 = row.getCell(13); - - if (null != cell_24 && !"".equals(cell_24)) { - String cellSpecName = getStringVal(cell_24); - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId = equCard.getAreaid(); - if (null == areaId) { - - HSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - - } - //增加方式 - HSSFCell cell_4 = row.getCell(4); - - if (null != cell_4 && !"".equals(cell_4)) { - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - } - //净残值 - HSSFCell cell_32 = row.getCell(23); - - if (null != cell_32 && !"".equals(cell_32)) { - String netSalvageValue = getStringVal(cell_32); - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - HSSFCell cell_34 = row.getCell(22); - - if (null != cell_34 && !"".equals(cell_34)) { - String residualValueRate = getStringVal(cell_34); - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(15); - - if (null != cell_37 && !"".equals(cell_37)) { - String totalDepreciation = getStringVal(cell_37); - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - HSSFCell cell_38 = row.getCell(6); - - if (null != cell_38 && !"".equals(cell_38)) { - String physicalLife = getStringVal(cell_38); - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - //System.out.println(equProp.getId()); - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //采购日期 - HSSFCell cell_33 = row.getCell(33); - if (null != cell_33 && !"".equals(cell_33)) { - String buytime = getStringVal(cell_33); - //System.out.println("buytime####"+buytime); - equCard.setBuyTime(buytime); - } - //制造厂商 - HSSFCell cell_36 = row.getCell(36); - if (null != cell_36 && !"".equals(cell_36)) { - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - } - } - //break; - return updateNum; - } - - public int updateEquComPanyCardByAssetNumberXlsx(String assetNumber, XSSFRow row, int updateNum) { - - List equCardList = new ArrayList(); - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - - //类别代码 - XSSFCell cell_5 = row.getCell(2); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - XSSFCell cell_6 = row.getCell(16); - - if (null != cell_6 && !"".equals(cell_6)) { - String assetName = getStringVal(cell_6); - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - //类别名称 -/* XSSFCell cell_6 = row.getCell(6); - String assetName=getStringVal(cell_6); - if(null!=assetName && !"".equals(assetName)){ - assetClass.setAssetclassname(assetName); - }*/ - - assetClassService.update(assetClass); - } - } - - //使用部门代码 - XSSFCell cell_10 = row.getCell(3); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - String companyName = ""; - String cellDeptName = ""; - Company company = companyService.selectByPrimaryKey(cellCode); - if (null != company) { - companyName = company.getSname(); - cellDeptName = companyName; - } else { - cellDeptName = companyName; - } - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - if (null != assetnumber && !"".equals(assetnumber)) { - equCardList = this.selectListByWhere(" where assetNumber='" + assetnumber + "'"); - } - - - if (equCardList.size() > 0 && null != equCardList) { - - XSSFCell cell_34s = row.getCell(37); - int cardNub1 = (int) Double.parseDouble(getStringVal(cell_34s)); - if (equCardList.size() > cardNub1) { - cardNub1 = equCardList.size(); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - - for (EquipmentCard equipmentCard : equCardList) { - String equId = equipmentCard.getId(); - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - XSSFCell cell_7 = row.getCell(12); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位 - XSSFCell cell_8 = row.getCell(35); - - if (null != cell_8 && !"".equals(cell_8)) { - String unit = getStringVal(cell_8); - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - XSSFCell cell_9 = row.getCell(9); - if (null == cell_9 || "".equals(cell_9)) { - - String cellUseDate = getStringVal(cell_9); - - if (null != cellUseDate && !"".equals(cellUseDate)) { - equCard.setUsedate(cellUseDate); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { -/* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - XSSFCell cell_24 = row.getCell(13); - - if (null != cell_24 && !"".equals(cell_24)) { - String cellSpecName = getStringVal(cell_24); - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId = equCard.getAreaid(); - if (null == areaId) { - - XSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - - } - //增加方式 - XSSFCell cell_4 = row.getCell(4); - - if (null != cell_4 && !"".equals(cell_4)) { - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - } - - //净残值 - XSSFCell cell_32 = row.getCell(23); - - - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - XSSFCell cell_34 = row.getCell(22); - - - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - XSSFCell cell_37 = row.getCell(15); - - - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - XSSFCell cell_38 = row.getCell(6); - - if (null != cell_38 && !"".equals(cell_38)) { - String physicalLife = getStringVal(cell_38); - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - //System.out.println(equProp.getId()); - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //采购日期 - XSSFCell cell_33 = row.getCell(33); - if (null != cell_33 && !"".equals(cell_33)) { - String buytime = getStringVal(cell_33); - equCard.setBuyTime(buytime); - } - //制造厂商 - XSSFCell cell_36 = row.getCell(36); - if (null != cell_36 && !"".equals(cell_36)) { - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - } - } - //break; - return updateNum; - } - - //公司设备 - public int updateEquComPanyCardByIdXls(String equId, HSSFRow row, int updateNum) { - //类别代码 - HSSFCell cell_5 = row.getCell(2); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - HSSFCell cell_6 = row.getCell(16); - String assetName = getStringVal(cell_6); - if (null != assetName && !"".equals(assetName)) { - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - assetClassService.update(assetClass); - } - } - - - //使用部门代码 - HSSFCell cell_10 = row.getCell(3); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - String companyName = ""; - String cellDeptName = ""; - Company company = companyService.selectByPrimaryKey(cellCode); - if (null != company) { - companyName = company.getSname(); - cellDeptName = companyName; - } else { - cellDeptName = companyName; - } - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - - if ("cardid".equals(equId.substring(0, 6))) { - //有多个设备ID - - List eList = this.selectListByWhere("where equipment_out_ids = '" + equId + "' "); - //String[] idArr; - HSSFCell cell_34s = row.getCell(37); - int cardNub1 = (int) Double.parseDouble(getStringVal(cell_34s)); - if (eList.size() > cardNub1) { - cardNub1 = eList.size(); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for (EquipmentCard equCard : eList) { - - //EquipmentCard equCard=this.selectById(idVar); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 -/* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - HSSFCell cell_7 = row.getCell(12); - - - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位(?) - HSSFCell cell_8 = row.getCell(35); - - if (null != cell_8 && !"".equals(cell_8)) { - String unit = getStringVal(cell_8); - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - HSSFCell cell_9 = row.getCell(9); - if (null == cell_9 || "".equals(cell_9)) { - - - String cellUseDate = getStringVal(cell_9); - - if (null != cellUseDate && !"".equals(cellUseDate)) { - equCard.setUsedate(cellUseDate); - } - - } - - //使用部门代码 -/* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - HSSFCell cell_24 = row.getCell(13); - - if (null != cell_24 && !"".equals(cell_24)) { - String cellSpecName = getStringVal(cell_24); - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId = equCard.getAreaid(); - if (null == areaId) { - - HSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - - } - //增加方式 - HSSFCell cell_4 = row.getCell(4); - - if (null != cell_4 && !"".equals(cell_4)) { - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - } - //净残值 - HSSFCell cell_32 = row.getCell(23); - - - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - HSSFCell cell_34 = row.getCell(22); - - if (null != cell_34 && !"".equals(cell_34)) { - String residualValueRate = getStringVal(cell_34); - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(15); - - - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - HSSFCell cell_38 = row.getCell(6); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //采购日期 - HSSFCell cell_33 = row.getCell(33); - if (null != cell_33 && !"".equals(cell_33)) { - String buytime = getStringVal(cell_33); - equCard.setBuyTime(buytime); - } - //制造厂商 - HSSFCell cell_36 = row.getCell(36); - if (null != cell_36 && !"".equals(cell_36)) { - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - - - } - - //break; - } else { - //只有单个设备ID - EquipmentCard equCard = this.selectById(equId); - if (null != equCard) { - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - HSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 -/* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - HSSFCell cell_7 = row.getCell(12); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue)); - } - - //计量单位 - HSSFCell cell_8 = row.getCell(35); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - HSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - - if (null != cellUseDate && !"".equals(cellUseDate)) { - equCard.setUsedate(cellUseDate); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { -/* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - HSSFCell cell_24 = row.getCell(13); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId = equCard.getAreaid(); - if (null == areaId) { - - HSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - - } - //增加方式 - HSSFCell cell_4 = row.getCell(4); - - if (null != cell_4 && !"".equals(cell_4)) { - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - } - //净残值 - HSSFCell cell_32 = row.getCell(23); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue)); - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - HSSFCell cell_34 = row.getCell(22); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - HSSFCell cell_37 = row.getCell(15); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation)); - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - HSSFCell cell_38 = row.getCell(6); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //采购日期 - HSSFCell cell_33 = row.getCell(33); - if (null != cell_33 && !"".equals(cell_33)) { - String buytime = getStringVal(cell_33); - equCard.setBuyTime(buytime); - } - //制造厂商 - HSSFCell cell_36 = row.getCell(36); - if (null != cell_36 && !"".equals(cell_36)) { - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - } - return updateNum; - } - - public int updateEquComPanyCardByIdXlsx(String equId, XSSFRow row, int updateNum) { - //类别代码 - XSSFCell cell_5 = row.getCell(2); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - XSSFCell cell_6 = row.getCell(16); - String assetName = getStringVal(cell_6); - if (null != assetName && !"".equals(assetName)) { - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - assetClassService.update(assetClass); - } - } - - - //使用部门代码 - XSSFCell cell_10 = row.getCell(3); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - String companyName = ""; - String cellDeptName = ""; - Company company = companyService.selectByPrimaryKey(cellCode); - if (null != company) { - companyName = company.getSname(); - cellDeptName = companyName; - } else { - cellDeptName = companyName; - } - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - - if ("cardid".equals(equId.substring(0, 6))) { - //有多个设备ID - //String[] idArr=equId.split(","); - List eList = this.selectListByWhere("where equipment_out_ids = '" + equId + "' "); - XSSFCell cell_34s = row.getCell(37); - int cardNub1 = (int) Double.parseDouble(getStringVal(cell_34s)); - if (eList.size() > cardNub1) { - cardNub1 = eList.size(); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for (EquipmentCard equCard : eList) { - - //EquipmentCard equCard=this.selectById(idVar); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 -/* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - XSSFCell cell_7 = row.getCell(12); - - - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位(?) - XSSFCell cell_8 = row.getCell(35); - - if (null != cell_8 && !"".equals(cell_8)) { - String unit = getStringVal(cell_8); - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - XSSFCell cell_9 = row.getCell(9); - if (null == cell_9 || "".equals(cell_9)) { - - - String cellUseDate = getStringVal(cell_9); - - if (null != cellUseDate && !"".equals(cellUseDate)) { - equCard.setUsedate(cellUseDate); - } - - } - - //使用部门代码 -/* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - XSSFCell cell_24 = row.getCell(13); - - if (null != cell_24 && !"".equals(cell_24)) { - String cellSpecName = getStringVal(cell_24); - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId = equCard.getAreaid(); - if (null == areaId) { - - XSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - - } - //增加方式 - XSSFCell cell_4 = row.getCell(4); - - if (null != cell_4 && !"".equals(cell_4)) { - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - } - //净残值 - XSSFCell cell_32 = row.getCell(23); - - - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - XSSFCell cell_34 = row.getCell(22); - - if (null != cell_34 && !"".equals(cell_34)) { - String residualValueRate = getStringVal(cell_34); - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - XSSFCell cell_37 = row.getCell(15); - - - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - XSSFCell cell_38 = row.getCell(6); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //采购日期 - XSSFCell cell_33 = row.getCell(33); - if (null != cell_33 && !"".equals(cell_33)) { - String buytime = getStringVal(cell_33); - equCard.setBuyTime(buytime); - } - //制造厂商 - XSSFCell cell_36 = row.getCell(36); - if (null != cell_36 && !"".equals(cell_36)) { - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - - //break; - } else { - //只有单个设备ID - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - //卡片编码 - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 -/* XSSFCell cell_4 = row.getCell(4); - String assetClassId=getStringVal(cell_4);*/ - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - XSSFCell cell_7 = row.getCell(12); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue)); - } - - //计量单位 - XSSFCell cell_8 = row.getCell(35); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - XSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - - if (null != cellUseDate && !"".equals(cellUseDate)) { - equCard.setUsedate(cellUseDate); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { -/* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - XSSFCell cell_24 = row.getCell(13); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - //存放地点 - String areaId = equCard.getAreaid(); - if (null == areaId) { - - XSSFCell cell_14 = row.getCell(14); - String areaid = getStringVal(cell_14); - equCard.setAreaid(areaid); - - } - //增加方式 - XSSFCell cell_4 = row.getCell(4); - - if (null != cell_4 && !"".equals(cell_4)) { - String addway = getStringVal(cell_4); - equCard.setAddWay(addway); - } - //净残值 - XSSFCell cell_32 = row.getCell(23); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue)); - } - - //净值 - //HSSFCell cell_33 = row.getCell(33); - //String currentValue = getStringVal(cell_33); - //if(null!=currentValue && !"".equals(currentValue) ){ - //equProp.setCurrentValue(strTOBigDecimal(currentValue)); - //} - - //净残值率 - XSSFCell cell_34 = row.getCell(22); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - XSSFCell cell_37 = row.getCell(15); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation)); - } - //录入日期 - equCard.setInsdt(CommUtil.nowDate()); - //预计使用年限 - XSSFCell cell_38 = row.getCell(6); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //采购日期 - XSSFCell cell_33 = row.getCell(33); - if (null != cell_33 && !"".equals(cell_33)) { - String buytime = getStringVal(cell_33); - equCard.setBuyTime(buytime); - } - //制造厂商 - XSSFCell cell_36 = row.getCell(36); - if (null != cell_36 && !"".equals(cell_36)) { - String equipmentManufacturer = getStringVal(cell_36); - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - //break; - } - return updateNum; - } - - public int updateEquCardByAssetNumberXlsx(String assetNumber, XSSFRow row, int updateNum) { - - List equCardList = new ArrayList(); - XSSFCell cell_0 = row.getCell(0); - String assetnumber = getStringVal(cell_0); - - //类别代码 - XSSFCell cell_5 = row.getCell(5); - String assetClassId = getStringVal(cell_5); - if (null != assetClassId && !"".equals(assetClassId)) { - AssetClass assetClass = assetClassService.selectById(assetClassId); - if (null == assetClass) { - AssetClass assClassVar = new AssetClass(); - assClassVar.setId(assetClassId); - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - assClassVar.setAssetclassnumber(assetnumber); - } - - //类别名称 - XSSFCell cell_6 = row.getCell(6); - String assetName = getStringVal(cell_6); - if (null != assetName && !"".equals(assetName)) { - assClassVar.setAssetclassname(assetName); - } - - assetClassService.save(assClassVar); - } else { - if (null != assetnumber && !"".equals(assetnumber)) { - assetClass.setAssetclassnumber(assetnumber); - } - - //类别名称 - /* XSSFCell cell_6 = row.getCell(6); - String assetName=getStringVal(cell_6); - if(null!=assetName && !"".equals(assetName)){ - assetClass.setAssetclassname(assetName); - }*/ - - assetClassService.update(assetClass); - } - } - - //使用部门代码 - XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10); - - //使用部门代码名称 - XSSFCell cell_11 = row.getCell(11); - String cellDeptName = getStringVal(cell_11); - - - String sqlStr = ""; - if (null != cellCode && !"".equals(cellCode)) { - sqlStr = "where code='" + cellCode + "'"; - } - - //------------------------------------------------------------------------------------------------------- - //新增或更新财务系统上的部门信息 - if (null != sqlStr && !"".equals(sqlStr)) { - List financeEquDept = financeEquipmentDeptInfoService.selectListByWhere(sqlStr); - if (financeEquDept.size() > 0 && null != financeEquDept) { - FinanceEquipmentDeptInfo financeEquDeptVar = financeEquDept.get(0); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - - //更新 - financeEquipmentDeptInfoService.update(financeEquDeptVar); - } else { - //新增 - FinanceEquipmentDeptInfo financeEquDeptVar = new FinanceEquipmentDeptInfo(); - financeEquDeptVar.setId(CommUtil.getUUID()); - financeEquDeptVar.setCode(cellCode); - if (!"".equals(cellDeptName) && null != cellDeptName) { - financeEquDeptVar.setName(cellDeptName); - } - financeEquipmentDeptInfoService.save(financeEquDeptVar); - } - } - - //------------------------------------------------------------------------------------------------------- - - if (null != assetnumber && !"".equals(assetnumber)) { - equCardList = this.selectListByWhere(" where assetNumber='" + assetnumber + "'"); - } - - - if (equCardList.size() > 0 && null != equCardList) { - XSSFCell cell_19s = row.getCell(19); - int cardNub1 = Integer.parseInt(getStringVal(cell_19s)); - if (equCardList.size() > cardNub1) { - cardNub1 = equCardList.size(); - } - BigDecimal cardNub = new BigDecimal(cardNub1); - for (EquipmentCard equipmentCard : equCardList) { - String equId = equipmentCard.getId(); - EquipmentCard equCard = this.selectById(equId); - EquipmentCardProp equProp = propService.selectByEquipmentId(equCard.getEquipmentcardid()); - - - //卡片编码 - if (null != assetnumber && !"".equals(assetnumber)) { - equCard.setAssetnumber(assetnumber); - - } - - //类别代码 - if (null != assetClassId && !"".equals(assetClassId)) { - equCard.setAssetclassid(assetClassId); - } - - - //原值 - XSSFCell cell_7 = row.getCell(7); - String equipmentValue = getStringVal(cell_7); - if (null != equipmentValue && !"".equals(equipmentValue)) { - equCard.setEquipmentvalue(strTOBigDecimal(equipmentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //计量单位 - XSSFCell cell_8 = row.getCell(8); - String unit = getStringVal(cell_8); - if (null != unit && !"".equals(unit)) { - equCard.setUnit(unit); - } - - //开始使用日期 - String useDate = equCard.getUsedate(); - if (null == useDate || "".equals(useDate)) { - XSSFCell cell_9 = row.getCell(9); - String cellUseDate = getStringVal(cell_9); - String year = cellUseDate.substring(0, 4); - String month = cellUseDate.substring(4, 6); - String day = cellUseDate.substring(6); - String date = year + "-" + month + "-" + day; - if (null != date && !"".equals(date)) { - equCard.setUsedate(date); - } - - } - - //使用部门代码 - String code = equCard.getCode(); - if (null == code || "".equals(code)) { - /* XSSFCell cell_10 = row.getCell(10); - String cellCode = getStringVal(cell_10);*/ - if (null != cellCode && !"".equals(cellCode)) { - equCard.setCode(cellCode); - } - - } - - - //型号 - EquipmentTypeNumber equipmentTypeNumber = equCard.getEquipmentTypeNumber(); - if (null == equipmentTypeNumber) { - - XSSFCell cell_24 = row.getCell(24); - String cellSpecName = getStringVal(cell_24); - if (null != cellSpecName && !"".equals(cellSpecName)) { - - List equipmentTypeNumberList = equipmentTypeNumberService.selectListByWhere(" where name ='" + cellSpecName + "'"); - - if (equipmentTypeNumberList.size() == 0 || null == equipmentTypeNumberList) { - //TODO 新增型号并更新设备台账型号 - EquipmentTypeNumber equType = new EquipmentTypeNumber(); - - String equTypeId = CommUtil.getUUID(); - equType.setId(equTypeId); - equType.setName(cellSpecName); - equType.setActive("1"); - equipmentTypeNumberService.save(equType); - equCard.setEquipmentmodel(equTypeId); - } - - } - - } - - - //净残值 - XSSFCell cell_32 = row.getCell(32); - String netSalvageValue = getStringVal(cell_32); - if (null != netSalvageValue && !"".equals(netSalvageValue)) { - equProp.setNetSalvageValue(strTOBigDecimal(netSalvageValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净值 - XSSFCell cell_33 = row.getCell(33); - String currentValue = getStringVal(cell_33); - if (null != currentValue && !"".equals(currentValue)) { - equProp.setCurrentValue(strTOBigDecimal(currentValue).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //净残值率 - XSSFCell cell_34 = row.getCell(34); - String residualValueRate = getStringVal(cell_34); - if (null != residualValueRate && !"".equals(residualValueRate)) { - equProp.setResidualValueRate(Double.parseDouble(residualValueRate)); - } - - //累计折旧 - XSSFCell cell_37 = row.getCell(37); - String totalDepreciation = getStringVal(cell_37); - if (null != totalDepreciation && !"".equals(totalDepreciation)) { - equProp.setTotalDepreciation(strTOBigDecimal(totalDepreciation).divide(cardNub, 2, BigDecimal.ROUND_HALF_UP)); - } - - //预计使用年限 - XSSFCell cell_38 = row.getCell(38); - String physicalLife = getStringVal(cell_38); - if (null != physicalLife && !"".equals(physicalLife)) { - if (physicalLife.contains("年")) { - equCard.setServiceLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setUseage(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equCard.setDepreciationLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - equProp.setPhysicalLife(Double.parseDouble(StringUtils.substringBefore(physicalLife, "年"))); - - } else { - equCard.setServiceLife(Double.parseDouble(physicalLife) / 12); - equCard.setUseage(Double.parseDouble(physicalLife) / 12); - equCard.setDepreciationLife(Double.parseDouble(physicalLife) / 12); - equProp.setPhysicalLife(Double.parseDouble(physicalLife) / 12); - } - } - - equProp.setEquipmentId(equCard.getEquipmentcardid()); - if (null == equProp.getId() || "".equals(equProp.getId())) { - equProp.setId(CommUtil.getUUID()); - propService.save(equProp); - } - //增加方式 - XSSFCell cell_18 = row.getCell(18); - String addway = getStringVal(cell_18); - if (null != addway && !"".equals(addway)) { - equCard.setAddWay(addway); - } - //存放地点 - XSSFCell cell_25 = row.getCell(25); - String areaID = getStringVal(cell_25); - if (null != areaID && !"".equals(areaID)) { - equCard.setAreaid(areaID); - } - //制造厂商 - XSSFCell cell_46 = row.getCell(46); - String equipmentManufacturer = getStringVal(cell_46); - if (null != equipmentManufacturer && !"".equals(equipmentManufacturer)) { - equCard.setEquipmentmanufacturer(equipmentManufacturer); - } - //出厂日期 - XSSFCell cell_47 = row.getCell(47); - String productionDate = getStringVal(cell_47); - if (null != productionDate && !"".equals(productionDate)) { - equCard.setProductiondate(productionDate); - } - //入账日期 - XSSFCell cell_105 = row.getCell(105); - String purchaseDate = getStringVal(cell_105); - if (null != purchaseDate && !"".equals(purchaseDate)) { - equCard.setPurchasedate(purchaseDate); - } - //更新设备附表 - propService.update(equProp); - this.update(equCard); - - updateNum++; - } - } - //break; - return updateNum; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - //根据条件获取分组后的设备小类 - public List getEquipmentClassIdGroupByBizId(String where) { - List list = equipmentCardDao.getEquipmentClassIdGroupByBizId(where); - return list; - } - - public EquipmentCard selectById4Model(String id) { - EquipmentCard equipmentCard = this.equipmentCardDao.selectByPrimaryKey(id); - if (equipmentCard != null) { - if (null != equipmentCard.getEquipmentmodel() && !equipmentCard.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(equipmentCard.getEquipmentmodel()); - equipmentCard.setEquipmentTypeNumber(equipmentTypeNumber); - } - } - return equipmentCard; - } - - - /** - * 添加数据有效性检查. 2020-11-14 chengpj - * - * @param sheet 要添加此检查的Sheet - * @param firstRow 开始行 - * @param lastRow 结束行 - * @param firstCol 开始列 - * @param lastCol 结束列 - * @param explicitListValues 有效性检查的下拉列表 - * @throws IllegalArgumentException 如果传入的行或者列小于0(< 0)或者结束行/列比开始行/列小 - */ - public static void setValidationData(Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol, String[] explicitListValues) throws IllegalArgumentException { - if (firstRow < 0 || lastRow < 0 || firstCol < 0 || lastCol < 0 || lastRow < firstRow || lastCol < firstCol) { - throw new IllegalArgumentException("Wrong Row or Column index : " + firstRow + ":" + lastRow + ":" + firstCol + ":" + lastCol); - } - if (sheet instanceof XSSFSheet) { - XSSFDataValidationHelper dvHelper = new XSSFDataValidationHelper((XSSFSheet) sheet); - XSSFDataValidationConstraint dvConstraint = (XSSFDataValidationConstraint) dvHelper.createExplicitListConstraint(explicitListValues); - CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol); - XSSFDataValidation validation = (XSSFDataValidation) dvHelper.createValidation(dvConstraint, addressList); - validation.setSuppressDropDownArrow(true); - validation.setShowErrorBox(true); - validation.setShowPromptBox(true); - sheet.addValidationData(validation); - } else if (sheet instanceof HSSFSheet) { - CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol); - DVConstraint dvConstraint = DVConstraint.createExplicitListConstraint(explicitListValues); - DataValidation validation = new HSSFDataValidation(addressList, dvConstraint); - validation.setSuppressDropDownArrow(true); - validation.setShowErrorBox(true); - validation.setShowPromptBox(true); - sheet.addValidationData(validation); - } - } - - /** - * 添加数据有效性检查. 2020-11-14 chengpj - * - * @param sheet 要添加此检查的Sheet - * @param firstRow 开始行 - * @param endRow 结束行 - * @param firstCol 开始列 - * @param endCol 结束列 - * @param dataArray 有效性检查的下拉列表 - * @param wbCreat workbook - * @param code (A,B,C...) 第几列 - * @param ord(1,2,3...)与code对应 - * @param titlename sheet2的表头 - * @throws IllegalArgumentException 如果传入的行或者列小于0(< 0)或者结束行/列比开始行/列小 - */ - private static HSSFDataValidation getDataValidationList4Col(HSSFSheet sheet, int firstRow, int endRow, int firstCol, int endCol, String[] dataArray, HSSFWorkbook wbCreat, HSSFSheet sheet2, String code, int ord, String titlename, Name namedCell) { -// String[] dataArray = colName.toArray(new String[0]); -// HSSFSheet hidden = wbCreat.createSheet("hidden"); - -// HSSFRow row0 = sheet2.createRow(0); -// HSSFCell cell0 = null; -// String[] Sheet2title = {"所属厂区","设备归属","设备类型-大类","设备类型—小类","工艺段","ABC分类","设备状态","是否强检","强检类型","资产类型"}; -// for(int k=0;k companies = this.companyService.selectListByWhere("where 1=1"); - String companieString = ""; - if (companies != null && companies.size() > 0) { - for (int i = 0; i < companies.size(); i++) { - companieString += companies.get(i).getSname() + ","; - } - } - String[] companynameStrings = companieString.split(","); - return companynameStrings; - } - - /** - * 获得所有设备归属name string[] 用于excel数据验证 - */ - public String[] getEquipmentBelongNames() { - List equipmentBelongs = this.equipmentBelongService.selectListByWhere("where 1=1 order by belong_code"); - String equipmentBelongString = ""; - if (equipmentBelongs != null && equipmentBelongs.size() > 0) { - for (int i = 0; i < equipmentBelongs.size(); i++) { - equipmentBelongString += equipmentBelongs.get(i).getBelongName() + equipmentBelongs.get(i).getBelongCode() + ","; - } - } - String[] equipmentBelongNamesStrings = equipmentBelongString.split(","); - return equipmentBelongNamesStrings; - } - - /** - * 获得所有设备类型大类name string[] 用于excel数据验证 - */ - public String[] getEquipmentBigClassNames() { - List EquipmentBigClasss = this.equipmentClassService.selectListByWhere("where 1=1 and type = '" + CommString.EquipmentClass_Category + "'"); - String EquipmentBigClasssString = ""; - if (EquipmentBigClasss != null && EquipmentBigClasss.size() > 0) { - for (int i = 0; i < EquipmentBigClasss.size(); i++) { - EquipmentBigClasssString += EquipmentBigClasss.get(i).getEquipmentClassCode() + "," + EquipmentBigClasss.get(i).getName() + "," + EquipmentBigClasss.get(i).getEquipmentClassCode() + EquipmentBigClasss.get(i).getName() + ","; - } - } - String[] EquipmentBigClassNamesStrings = EquipmentBigClasssString.split(","); - return EquipmentBigClassNamesStrings; - } - - /** - * 获得所有设备类型小类name string[] 用于excel数据验证 - */ - public String[] getEquipmentSmallClassNames() { - List equipmentSmallClassNames = this.equipmentClassService.selectListByWhere("where 1=1 and type = '" + CommString.EquipmentClass_Equipment + "'"); - String equipmentSmallClassNamesString = ""; - if (equipmentSmallClassNames != null && equipmentSmallClassNames.size() > 0) { - for (int i = 0; i < equipmentSmallClassNames.size(); i++) { - equipmentSmallClassNamesString += equipmentSmallClassNames.get(i).getEquipmentClassCode() + "," + equipmentSmallClassNames.get(i).getName() + "," + equipmentSmallClassNames.get(i).getEquipmentClassCode() + equipmentSmallClassNames.get(i).getName() + ","; - } - } - String[] equipmentSmallClassNamesStrings = equipmentSmallClassNamesString.split(","); - return equipmentSmallClassNamesStrings; - } - - /** - * 获得所有工艺段 string[] 用于excel数据验证 - */ - public String[] getProcessSectionNames() { - List processSections = this.processSectionService.selectListByWhere("where 1=1"); - String processSectionString = ""; - if (processSections != null && processSections.size() > 0) { - for (int i = 0; i < processSections.size(); i++) { - processSectionString += processSections.get(i).getName() + ","; - } - } - String[] processSectionNamesStrings = processSectionString.split(","); - return processSectionNamesStrings; - } - - /** - * 获得所有设备等级name string[] 用于excel数据验证 - */ - public String[] getEquipmentLevelNames() { - List equipmentLevels = this.equipmentLevelService.selectListByWhere("where 1=1"); - String equipmentLevelString = ""; - if (equipmentLevels != null && equipmentLevels.size() > 0) { - for (int i = 0; i < equipmentLevels.size(); i++) { - equipmentLevelString += equipmentLevels.get(i).getLevelname() + ","; - } - } - String[] equipmentLevelNamesStrings = equipmentLevelString.split(","); - return equipmentLevelNamesStrings; - } - - /** - * 获得所有设备状态name string[] 用于excel数据验证 - */ - public String[] getEquipmentStatusManagementNames() { - List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where 1=1"); - String equipmentStatusManagementString = ""; - if (equipmentStatusManagements != null && equipmentStatusManagements.size() > 0) { - for (int i = 0; i < equipmentStatusManagements.size(); i++) { - equipmentStatusManagementString += equipmentStatusManagements.get(i).getName() + ","; - } - } - String[] equipmentStatusManagementStrings = equipmentStatusManagementString.split(","); - return equipmentStatusManagementStrings; - } - - - /** - * 获得是否强检 string[] 用于excel数据验证 - */ - public String[] getIsCompulsoryName() { - String equipmentBelongString = "是,否"; - - String[] equipmentBelongNamesStrings = equipmentBelongString.split(","); - return equipmentBelongNamesStrings; - } - - /** - * 获得强检类型 string[] 用于excel数据验证 - */ - public String[] getCompulsoryName() { - String equipmentBelongString = "特种设备,仪器仪表,车辆"; - - String[] equipmentBelongNamesStrings = equipmentBelongString.split(","); - return equipmentBelongNamesStrings; - } - - /** - * 获得资产类型 string[] 用于excel数据验证 - */ - public String[] getAssetClassNames() { - List assetClasss = this.assetClassService.selectListByWhere("where 1=1"); - String assetClassString = ""; - if (assetClasss != null && assetClasss.size() > 0) { - for (int i = 0; i < assetClasss.size(); i++) { - assetClassString += assetClasss.get(i).getAssetclassname() + ","; - } - } - String[] assetClassStrings = assetClassString.split(","); - return assetClassStrings; - } - - public List> getEquipmentByStructureId(String structureId, List equList) { - List> equMapList = new ArrayList>(); - if (structureId != null && !"".equals(structureId)) { - for (int i = 0; i < equList.size(); i++) { - if (equList.get(i).getStructureId() != null && structureId.equals(equList.get(i).getStructureId())) { - Map m = new HashMap(); - m.put("id", equList.get(i).getId().toString()); - m.put("label", equList.get(i).getEquipmentname()); - m.put("equipmentClass", equList.get(i).getEquipmentclassid()); - m.put("type", CommString.Flag_Equipment); - equMapList.add(m); - } - } - } else { - for (int i = 0; i < equList.size(); i++) { - Map m = new HashMap(); - m.put("id", equList.get(i).getId().toString()); - m.put("label", equList.get(i).getEquipmentname()); - m.put("equipmentClass", equList.get(i).getEquipmentclassid()); - m.put("type", CommString.Flag_Equipment); - equMapList.add(m); - } - } - return equMapList; - } - - public List selectEquipmentIdToMpoint(String bizid, String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectEquipmentIdToMpoint(equipmentCard); - return equipmentCards; - } - - public List selectListByWhereNew(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - - return equipmentCards; - } - - /** - * 创建名称 - * - * @param wb - * @param name - * @param expression - * @return - */ - public static HSSFName createName(HSSFWorkbook wb, String name, String expression) { - HSSFName refer = wb.createName(); - refer.setRefersToFormula(expression); - refer.setNameName(name); - return refer; - } - - /** - * 设置数据有效性(通过名称管理器级联相关) - * - * @param name - * @param firstRow - * @param endRow - * @param firstCol - * @param endCol - * @return - */ - public static HSSFDataValidation setDataValidation(String name, int firstRow, int endRow, int firstCol, int endCol) { - //设置下拉列表的内容 - //log.info("起始行:" + firstRow + "___起始列:" + firstCol + "___终止行:" + endRow + "___终止列:" + endCol); - //加载下拉列表内容 - DVConstraint constraint = DVConstraint.createFormulaListConstraint(name); - // 设置数据有效性加载在哪个单元格上。 - // 四个参数分别是:起始行、终止行、起始列、终止列 - CellRangeAddressList regions = new CellRangeAddressList((short) firstRow, (short) endRow, (short) firstCol, (short) endCol); - // 数据有效性对象 - HSSFDataValidation data_validation = new HSSFDataValidation(regions, constraint); - return data_validation; - } - - /** - * 获得所有设备类型大类name string[] 用于excel数据验证 - */ - public JSONArray getEquipmentBigClassNamesN() { - List EquipmentBigClasss = this.equipmentClassService.selectListByWhere("where 1=1 and type = '" + CommString.EquipmentClass_Category + "' order by morder"); - String[] EquipmentBigClassNamesStrings = null; - JSONArray array = new JSONArray(); - if (EquipmentBigClasss != null && EquipmentBigClasss.size() > 0) { - EquipmentBigClassNamesStrings = new String[EquipmentBigClasss.size()]; - for (int i = 0; i < EquipmentBigClasss.size(); i++) { - JSONObject object = new JSONObject(); - object.put("id", EquipmentBigClasss.get(i).getId()); - object.put("name", EquipmentBigClasss.get(i).getName() + EquipmentBigClasss.get(i).getEquipmentClassCode()); - array.add(object); - } - } - return array; - } - - /** - * 获得所有设备类型小类name string[] 用于excel数据验证 - */ - public String[] getEquipmentSmallClassNames(String pid) { - List equipmentSmallClassNames = this.equipmentClassService.selectListByWhere("where pid = '" + pid + "' order by morder"); - String[] equipmentSmallClassNamesStrings = null; - if (equipmentSmallClassNames != null && equipmentSmallClassNames.size() > 0) { - equipmentSmallClassNamesStrings = new String[equipmentSmallClassNames.size()]; - for (int i = 0; i < equipmentSmallClassNames.size(); i++) { - equipmentSmallClassNamesStrings[i] = equipmentSmallClassNames.get(i).getName() + equipmentSmallClassNames.get(i).getEquipmentClassCode(); - } - } - return equipmentSmallClassNamesStrings; - } - - public static String getExcelColumnLabel(int num) { - String temp = ""; - double i = Math.floor(Math.log(25.0 * (num) / 26.0 + 1) / Math.log(26)) + 1; - if (i > 1) { - double sub = num - 26 * (Math.pow(26, i - 1) - 1) / 25; - for (double j = i; j > 0; j--) { - temp = temp + (char) (sub / Math.pow(26, j - 1) + 65); - sub = sub % Math.pow(26, j - 1); - } - } else { - temp = temp + (char) (num + 65); - } - return temp; - } - - /** - * 添加数据有效性检查. 2020-11-14 chengpj - * - * @param sheet 要添加此检查的Sheet - * @param firstRow 开始行 - * @param endRow 结束行 - * @param firstCol 开始列 - * @param endCol 结束列 - * @param titlename sheet2的表头 - * @throws IllegalArgumentException 如果传入的行或者列小于0(< 0)或者结束行/列比开始行/列小 - */ - private static HSSFDataValidation getDataValidationList4Col_class(HSSFSheet sheet, int firstRow, int endRow, int firstCol, int endCol, String titlename) { - - //加载数据,将名称为hidden的 - DVConstraint constraint = DVConstraint.createFormulaListConstraint(titlename); - - // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 - CellRangeAddressList addressList = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); - HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint); - - if (null != validation) { - sheet.addValidationData(validation); - } - return validation; - } - - /*** - * 用于自动生成设备编码. 2021-01-08 chengpj - * @param equipmentCard - * @return - */ - public Map autoGenerateEquipmentCodeByCodeRule(EquipmentCard equipmentCard) { - // System.out.println(CommUtil.nowDate()); - Map equipmentCodeRes = new HashMap<>(); - StringBuilder zeroSb = new StringBuilder(""); - StringBuilder equipmentCodeSb = new StringBuilder(""); - Integer maxWaterNumShort = 1; - //int codeFieldIsNum=0; - - //List orderByEquipmentCardList=equipmentCardService.selectListByWhere(" where 1=1 order by water_num_short desc"); - DynamicCodeCondition dynamicCodeCondition = new DynamicCodeCondition(); - List equipmentCodeRuleList = equipmentCodeRuleService.selectListByWhere(" where 1=1 and type='0' order by morder asc"); - if (equipmentCodeRuleList.size() > 0 && null != equipmentCodeRuleList && !equipmentCodeRuleList.isEmpty()) { - for (int i = 0; i < equipmentCodeRuleList.size(); i++) { - - String codeField = equipmentCodeRuleList.get(i).getCodeField(); - - try { - if (codeField.matches("[0-9]+")) { - List EquipmentCardList = this.selectTop1ListByWhere(" where equipmentCardID like '" + equipmentCodeSb.toString() + "%' order by water_num_short desc"); - - zeroSb = new StringBuilder(); - int waterNumLength = equipmentCodeRuleList.get(i).getCodeNum(); - - if (null != EquipmentCardList && EquipmentCardList.size() > 0 && !EquipmentCardList.isEmpty()) { - - Integer currMaxWaterNum = 0; - - if (equipmentCard.getEquipmentcardid() != null && !equipmentCard.getEquipmentcardid().equals("")) { - //equipmentcardid 不等于null说明是编辑时修改 - if (!equipmentCard.getEquipmentcardid().contains(equipmentCodeSb)) { - currMaxWaterNum = EquipmentCardList.get(0).getWaterNumShort() + 1; // 目前是根据最大的流水号去加1 - } else { - //如果是手残误点,前边都一样,流水号不变 - currMaxWaterNum = equipmentCard.getWaterNumShort(); - } - } else { - if (EquipmentCardList.get(0).getWaterNumShort() != null) { - //System.out.println("-------:"+equipmentCardList.get(0)); - currMaxWaterNum = EquipmentCardList.get(0).getWaterNumShort() + 1; // 目前是根据最大的流水号去加1 - } else { - currMaxWaterNum = 1; - - } - } - - - String currMaxWaterNumStr = String.valueOf(currMaxWaterNum); - if (waterNumLength > currMaxWaterNumStr.length()) { - int subNum = waterNumLength - currMaxWaterNumStr.length(); - for (int j = 0; j < subNum; j++) { - zeroSb.append("0"); - } - equipmentCodeSb.append(zeroSb.append(currMaxWaterNum)); - } else if (waterNumLength == currMaxWaterNumStr.length()) { - equipmentCodeSb.append(currMaxWaterNum); - } - maxWaterNumShort = currMaxWaterNum; - - } else { - if (waterNumLength > 0) { - for (int j = 1; j < waterNumLength; j++) { - zeroSb.append("0"); - } - zeroSb.append("1"); - } else if (waterNumLength == 0) { - zeroSb.append("0"); - } - equipmentCodeSb.append(zeroSb); - } - - } else if (codeField.matches("[^a-zA-Z0-9]+")) { - equipmentCodeSb.append(codeField); - } else { - - if ("equipmentClassCode".equals(codeField)) { - Field field = equipmentCard.getClass().getDeclaredField(codeField); - field.setAccessible(true); - String equClasssCodeValue = (String) field.get(equipmentCard); - equipmentCodeSb.append(equClasssCodeValue); - } else { - Field field = equipmentCard.getClass().getDeclaredField(codeField); - field.setAccessible(true); - String ecFieldValue = (String) field.get(equipmentCard); - if (null != ecFieldValue && !"".equals(ecFieldValue)) { - String tableName = equipmentCodeRuleList.get(i).getTableName(); - dynamicCodeCondition.setId(ecFieldValue); - dynamicCodeCondition.setTableColumn(equipmentCodeRuleList.get(i).getTableColumn()); - dynamicCodeCondition.setTableName(tableName); - String dynCodeFieidValue = equipmentCodeRuleService.dynameicSelectCodeByDynInfo(dynamicCodeCondition); - equipmentCodeSb.append(dynCodeFieidValue); - } - } - - } - - } catch (Exception e) { - e.printStackTrace(); - } - - } - equipmentCodeRes.put("equipmentCode", equipmentCodeSb.toString()); - - } else { - equipmentCodeRes.put("equipmentCode", CommUtil.getUUID()); - } - equipmentCodeRes.put("waterNumShort", maxWaterNumShort); - return equipmentCodeRes; - } - - public List selectListByWhereEasy(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - - return equipmentCards; - } - - public List selectListByWhereForModelData(String bizid, String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhereForModelData(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getSpecification() && !item.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - } - return equipmentCards; - } - - - /** - * 设备台账获取table数据 去掉一些无用的查询 selectListByWhere速度太慢 - * sj 2021-07-27 - * - * @param wherestr - * @return - */ - public List selectListByEquipmentCard(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhere(equipmentCard); - for (EquipmentCard item : equipmentCards) { - if (null != item.getEquipmentlevelid() && !item.getEquipmentlevelid().isEmpty()) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(item.getEquipmentlevelid()); - item.setEquipmentLevel(equipmentLevel); - } - if (null != item.getEquipmentstatus() && !item.getEquipmentstatus().isEmpty()) { - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(item.getEquipmentstatus()); - item.setEquipmentStatusManagement(equipmentStatusManagement); - } - if (null != item.getEquipmentclassid() && !item.getEquipmentclassid().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getEquipmentclassid()); - item.setEquipmentClass(equipmentClass); - } - if (null != item.getBizid() && !item.getBizid().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizid()); - item.setCompany(company); - } - if (null != item.getProcesssectionid() && !item.getProcesssectionid().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcesssectionid()); - item.setProcessSection(processSection); - } - } - - /*Iterator iterator = equipmentCards.iterator(); - while (iterator.hasNext()) { - EquipmentCard entity = iterator.next(); - if (entity.getEquipmentname().contains("二沉池3#刮泥机")) { - iterator.remove(); - } - }*/ - - return equipmentCards; - } - - /** - * 编辑页面调用 - * - * @param id - * @return - */ - public EquipmentCard selectByEquipmentCard(String id) { - EquipmentCard equipmentCard = this.equipmentCardDao.selectByPrimaryKey(id); - if (equipmentCard != null) { - Company company = this.unitService.getCompById(equipmentCard.getBizid()); - equipmentCard.setCompany(company); - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - equipmentCard.setEquipmentClass(equipmentClass); - } - return equipmentCard; - } - - /** - * 浏览页面调用 - * - * @param id - * @return - */ - public EquipmentCard selectByEquipmentCard4View(String id) { - //EquipmentCard equipmentCard = this.equipmentCardDao.selectByPrimaryKey(id); - EquipmentCard equipmentCard = null; - List list = this.selectListByWhere("where id='" + id + "' or equipmentCardID='" + id + "' order by id "); - if (list != null && list.size() > 0) { - equipmentCard = list.get(0); - } - if (equipmentCard != null) { - EquipmentLevel equipmentLevel = this.equipmentLevelService.selectById(equipmentCard.getEquipmentlevelid()); - EquipmentStatusManagement equipmentStatusManagement = this.equipmentStatusManagementService.selectById(equipmentCard.getEquipmentstatus()); - equipmentCard.setEquipmentLevel(equipmentLevel); - equipmentCard.setEquipmentStatusManagement(equipmentStatusManagement); - - - ProcessSection processSection = this.processSectionService.selectById(equipmentCard.getProcesssectionid()); - equipmentCard.setProcessSection(processSection); - AssetClass assetClass = this.assetClassService.selectById(equipmentCard.getAssetType()); - equipmentCard.setAssetClass(assetClass); - EquipmentCard equipmentPid = this.equipmentCardDao.selectByPrimaryKey(equipmentCard.getPid()); - equipmentCard.setEquipmentPid(equipmentPid); - if (null != equipmentCard.getSpecification() && !equipmentCard.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(equipmentCard.getSpecification()); - equipmentCard.setEquipmentSpecification(equipmentSpecification); - } - if (null != equipmentCard.getEquipmentmodel() && !equipmentCard.getEquipmentmodel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(equipmentCard.getEquipmentmodel()); - equipmentCard.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != equipmentCard.getId() && !equipmentCard.getId().isEmpty()) { - EquipmentCardProp cardProp = this.propService.selectByEquipmentId(equipmentCard.getId()); - equipmentCard.setEquipmentCardProp(cardProp); - } - //2020-07-12 start - if (null != equipmentCard.getEquipmentBelongId() && !equipmentCard.getEquipmentBelongId().isEmpty()) { - EquipmentBelong equipmentBelong = this.equipmentBelongService.selectById(equipmentCard.getEquipmentBelongId()); - equipmentCard.setEquipmentBelong(equipmentBelong); - } - //2020-07-12 end - - //2020-10-12 start - if (null != equipmentCard.getPid() && !equipmentCard.getPid().isEmpty()) { - EquipmentCard equipmentcard = this.selectById(equipmentCard.getBizid(), equipmentCard.getPid()); - equipmentCard.setEquipmentPid(equipmentcard); - } - //厂 - Company company = this.unitService.getCompById(equipmentCard.getBizid()); - equipmentCard.setCompany(company); - //设备类型 - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentCard.getEquipmentclassid()); - equipmentCard.setEquipmentClass(equipmentClass); - } - return equipmentCard; - } - - /** - * 获取厂+工艺段组合 树 - * sj 2021-07-30 - * - * @param list_result - * @param list - * @return - */ - public String getTreeList4ProcessSection(List> list_result, List list) { - if (list_result == null) { - List> childlist = new ArrayList>(); - list_result = new ArrayList>(); - if (list != null) { - Map map = new HashMap(); - map.put("id", list.get(0).getId().toString()); - map.put("text", list.get(0).getName()); - map.put("pid", list.get(0).getPid()); - map.put("type", list.get(0).getType()); - map.put("unitId", list.get(0).getId()); - - /*List tagstr = new ArrayList<>(); - tagstr.add("1"); - map.put("tags", tagstr);*/ - - //后面需要加厂区分 unitId - List processSectionList = processSectionService.selectListByWhere("where 1=1 and unit_id = '" + list.get(0).getId() + "' and active = '" + CommString.Active_True + "'"); - for (ProcessSection ps : processSectionList) { - Map ms = new HashMap(); - ms.put("id", ps.getId()); - ms.put("text", ps.getSname()); - ms.put("pid", ps.getPid()); - ms.put("type", "p"); - ms.put("unitId", list.get(0).getId()); - - /*List tagstr2 = new ArrayList<>(); - tagstr2.add("1"); - ms.put("tags", tagstr2);*/ - - childlist.add(ms); - } - map.put("nodes", childlist); - - list_result.add(map); - getTreeList4ProcessSection(list_result, list); - } - } else if (list_result.size() > 0 && list != null && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - if (list != null) { - for (Unit k : list) { - List> childlist2 = new ArrayList>(); - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("type", k.getType()); - m.put("unitId", k.getId()); - - /*List tagstr = new ArrayList<>(); - tagstr.add("1"); - m.put("tags", tagstr);*/ - -// m.put("code", k.getEquipmentClassCode()); -// m.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - - //后面需要加厂区分 unitId - List processSectionList = processSectionService.selectListByWhere("where 1=1 and unit_id = '" + k.getId() + "' and active = '" + CommString.Active_True + "'"); - for (ProcessSection ps : processSectionList) { - if (id.equals(pid)) { - Map ms = new HashMap(); - ms.put("id", ps.getId()); - ms.put("text", ps.getSname()); - ms.put("pid", ps.getPid()); - ms.put("type", "p"); - ms.put("unitId", k.getId()); - - /*List tagstr2 = new ArrayList<>(); - tagstr2.add("1"); - ms.put("tags", tagstr2);*/ - - childlist2.add(ms); - } - } - m.put("nodes", childlist2); - - childlist.add(m); - } - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList4ProcessSection(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 获取厂+设备类型组合 树 - * sj 2021-07-30 - * - * @param list_result - * @param list - * @return - */ - public String getTreeList4EquipmentClass(List> list_result, List list) { - if (list_result == null) { - List> childlist = new ArrayList>(); - list_result = new ArrayList>(); - if (list != null) { - Map map = new HashMap(); - map.put("id", list.get(0).getId().toString()); - map.put("text", list.get(0).getName()); - map.put("pid", list.get(0).getPid()); - map.put("type", list.get(0).getType()); - map.put("unitId", list.get(0).getId()); - - //查询厂区下面的设备类型 - List equipmentClassList = equipmentClassService.selectListByWhere("where 1=1"); - String json = equipmentClassService.getTreeListtest2(null, equipmentClassList, list.get(0).getId()); - childlist = (List>) com.alibaba.fastjson.JSONArray.parse(json); - - //后面需要加厂区分 unitId - map.put("nodes", childlist); - - list_result.add(map); - getTreeList4EquipmentClass(list_result, list); - } - } else if (list_result.size() > 0 && list != null && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - if (list != null) { - for (Unit k : list) { - List> childlist2 = new ArrayList>(); - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("type", k.getType()); - m.put("unitId", k.getId()); - - //查询厂区下面的设备类型 - List equipmentClassList = equipmentClassService.selectListByWhere("where 1=1"); - String json = equipmentClassService.getTreeListtest2(null, equipmentClassList, k.getId()); - childlist2 = (List>) com.alibaba.fastjson.JSONArray.parse(json); - - //后面需要加厂区分 unitId - m.put("nodes", childlist2); - childlist.add(m); - } - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList4EquipmentClass(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 根据设备编号查询设备的对象 及 下面指定条件的测量点 - * - * @param quipmentCardId - * @returne - */ - public EquipmentCard selectByEquipmentCardId(String quipmentCardId) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere("where equipmentCardID = '" + quipmentCardId + "'"); - List list = equipmentCardDao.selectListByWhere(equipmentCard); - if (list != null && list.size() > 0) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); -// String sql = " WHERE [equipmentId] = '" + list.get(0).getId() + "' AND (signaltag in ('RUN','remote','FAULT','mstatus') or signaltag like 'MP%')"; - //沙口BIM无法显示更多测量点 先取出sql和4条的限制 sj 2022-05-18 - String sql = " WHERE [equipmentId] = '" + list.get(0).getId() + "' "; - //查询设备下面规定条件的点位 - List listMpoint = mPointService.selectListByWhere(list.get(0).getBizid(), sql); - if (listMpoint != null && listMpoint.size() > 0) { - for (int i = 0; i < listMpoint.size(); i++) { - /*if (i < 4) {//只需要4条 - jsonArray.add(listMpoint.get(i)); - }*/ - jsonArray.add(listMpoint.get(i)); - } - list.get(0).setMpointArray(jsonArray); - } - return list.get(0); - } else { - return null; - } - } - - /** - * 根据设备编号查询设备的对象 及 下面指定条件的测量点 (简单查询) - * - * @param quipmentCardId - * @returne - */ - public EquipmentCard selectSimpleByEquipmentCardId(String quipmentCardId) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere("where equipmentCardID = '" + quipmentCardId + "'"); - List list = equipmentCardDao.selectListByWhere(equipmentCard); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - /** - * 设备完好率(根据故障数量计算的) - * - * @param unitId 厂id 会递归至最下面层级 - * @param levelType 需要获取所有 还是重要设备 (所有设备:type=0 ; 重要设备:type=1) - * @return - */ - @RequestMapping("/getIntactRate.do") - public double getIntactRate(String unitId, String levelType) { - - double rate = 100; -// return rate; -// //查询自己和所有子节点 -// String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); -// unitIds = unitIds.replace(",", "','"); -// -// String wherestr = "where 1=1 and type = '" + WorkorderDetail.REPAIR + "' "; -// if (unitId != null && !unitId.isEmpty()) { -// wherestr += " and unit_id in ('" + unitIds + "') "; -// } -// -// String wherestr2 = "where 1=1 "; -// if (unitId != null && !unitId.isEmpty()) { -// wherestr2 += " and bizId in ('" + unitIds + "') "; -// } -// EquipmentCard entity = new EquipmentCard(); -// entity.setWhere(wherestr2); -// -// String a_id = "";//A类设备id -// String b_id = "";//B类设备id -// String c_id = "";//C类设备id -// List equipmentLevels = equipmentLevelService.selectListByWhere(""); -// for (EquipmentLevel equipmentLevel : equipmentLevels) { -// if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("A")) { -// a_id = equipmentLevel.getId(); -// } -// if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("B")) { -// b_id = equipmentLevel.getId(); -// } -// if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("C")) { -// c_id = equipmentLevel.getId(); -// } -// } -// -// List list = null;//维修单list -// List list2 = null;//设备数list -// if (levelType != null && !levelType.isEmpty()) { -// //所有设备 -// if (levelType.equals("0")) { -// //查询ABC类-维修单数 -// list = workorderDetailService.selectListByWhere(wherestr); -// //查询ABC类-设备总数 -// list2 = equipmentCardDao.selectListByWhere(entity); -// } -// //重要设备 -// if (levelType.equals("1")) { -// //查询A类B类-维修单数 -// list = workorderDetailService.selectListByWhere(wherestr); -// Iterator it = list.iterator(); -// while (it.hasNext()) { -// String equipmentId = it.next().getEquipmentId(); -// EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(equipmentId); -// if (equipmentCard != null) { -// if (equipmentCard.getEquipmentlevelid() != null && equipmentCard.getEquipmentlevelid().equals(c_id)) { -// it.remove(); -// } -// } -// } -// -// //查询A类B类-设备总数 -// list2 = equipmentCardDao.selectListByWhere(entity); -// Iterator it2 = list2.iterator(); -// while (it2.hasNext()) { -// String equipmentId = it2.next().getId(); -// EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(equipmentId); -// if (equipmentCard != null) { -// if (equipmentCard.getEquipmentlevelid() != null && equipmentCard.getEquipmentlevelid().equals(c_id)) { -// it2.remove(); -// } -// } -// } -// } -// } -// -// //将维修单去重 留下不重复的数量 -// Set set = new HashSet(); -// for (WorkorderDetail workorderDetail : list) { -// set.add(workorderDetail.getEquipmentId()); -// } -// -// if (list2 != null && list2.size() > 0) { -//// System.out.println("维修数量(去重后):" + set.size()); -//// System.out.println("设备总数量" + list2.size()); -// rate = Double.parseDouble((100 - (Double.parseDouble(set.size() + "") / Double.parseDouble(list2.size() + "") * 100)) + ""); -// } else { -// rate = 100; -// } - return rate; - } - - /** - * 设备完好率(根据故障时间计算的) - * - * @param unitId 厂id 会递归至最下面层级 - * @param levelType 需要获取所有 还是重要设备 (所有设备:type=0 ; 重要设备:type=1) - * @param sdt 查询的月份 格式:2022-04 - * @return - */ - @RequestMapping("/getIntactRate4Time.do") - public double getIntactRate4Time(String unitId, String levelType, String sdt) { - double rate = 100; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String wherestr = "where 1=1 and type = '" + WorkorderDetail.REPAIR + "' "; - if (unitId != null && !unitId.isEmpty()) { - wherestr += " and unit_id in ('" + unitIds + "') "; - } - - String wherestr2 = "where 1=1 "; - if (unitId != null && !unitId.isEmpty()) { - wherestr2 += " and bizId in ('" + unitIds + "') "; - } - - EquipmentCard entity = new EquipmentCard(); - - String a_id = "";//A类设备id - String b_id = "";//B类设备id - String c_id = "";//C类设备id - List equipmentLevels = equipmentLevelService.selectListByWhere(" order by equipment_level_code "); - for (EquipmentLevel equipmentLevel : equipmentLevels) { - if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("A")) { - a_id = equipmentLevel.getId(); - } - if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("B")) { - b_id = equipmentLevel.getId(); - } - if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("C")) { - c_id = equipmentLevel.getId(); - } - } - - List list = null;//维修单list - List list2 = null;//设备数list - if (levelType != null && !levelType.isEmpty()) { - //所有设备 - if (levelType.equals("0")) { - //查询ABC类-维修单数 - list = workorderDetailService.selectSimpleListByWhere(wherestr); - //查询ABC类-设备总数 - entity.setWhere(wherestr2); - list2 = equipmentCardDao.selectListByWhere(entity); - } - //重要设备 - if (levelType.equals("1")) { - //查询A类B类-维修单数 - list = workorderDetailService.selectSimpleListByWhere(wherestr); - Iterator it = list.iterator(); - while (it.hasNext()) { - String equipmentId = it.next().getEquipmentId(); - EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(equipmentId); - if (equipmentCard != null) { - if (equipmentCard.getEquipmentlevelid() != null && equipmentCard.getEquipmentlevelid().equals(c_id)) { - it.remove(); - } - } - } - - //查询A类B类-设备总数 - wherestr2 += " and (equipmentLevelId = '" + a_id + "' or equipmentLevelId = '" + b_id + "')"; - entity.setWhere(wherestr2); - list2 = equipmentCardDao.selectListByWhere(entity); - - /*list2 = equipmentCardDao.selectListByWhere(entity); - Iterator it2 = list2.iterator(); - while (it2.hasNext()) { - String equipmentId = it2.next().getId(); - EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(equipmentId); - if (equipmentCard != null) { - if (equipmentCard.getEquipmentlevelid() != null && equipmentCard.getEquipmentlevelid().equals(c_id)) { - it2.remove(); - } - } - }*/ - } - } - - //计算当月最大数 - int maxday = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //开始时间 - String sdtTime = sdt + "-01 00:00:00"; - //结束时间 - String edtTime = sdt + "-" + maxday + " 23:59:59"; - - long sum = 0; - for (WorkorderDetail workorderDetail : list) { - String s_dt = workorderDetail.getInsdt();//开始时间 有异常单按异常单的上报时间,没有异常单按维修单下发时间 - String e_dt = workorderDetail.getCompleteDate();//结束时间 按验收通过时间 - - if (workorderDetail.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectSimpleById(workorderDetail.getAbnormityId()); - if (abnormity != null) { - s_dt = abnormity.getInsdt();//异常上报时间 - } - } - - //当月下发,当月完成---故障时间=验收时间减去下发时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { -// System.out.println("当月下发,当月完成:" + CommUtil.getDays2(workorderDetail.getCompleteDate(), workorderDetail.getInsdt(), "second")); - sum += CommUtil.getDays2(e_dt, s_dt, "second"); -// System.out.println(workorderDetail.getJobNumber() + "----------" + CommUtil.getDays2(e_dt, s_dt, "second")); - } - //当月下发,当月以后完成---故障时间=下发时间到月底 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { -// System.out.println("当月下发,当月以后完成:" + CommUtil.getDays2(edtTime, workorderDetail.getInsdt(), "second")); - sum += CommUtil.getDays2(edtTime, s_dt, "second"); -// System.out.println(workorderDetail.getJobNumber() + "----------" + CommUtil.getDays2(edtTime, s_dt, "second")); - } - //以前下发,当月完成---故障时间=月初到验收时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && ((e_dt.substring(0, 7)).equals(edtTime.substring(0, 7)))) { - sum += CommUtil.getDays2(e_dt, sdtTime, "second"); -// System.out.println(workorderDetail.getJobNumber() + "----------" + CommUtil.getDays2(e_dt, sdtTime, "second")); - } - //以前下发,当月以后完成---故障时间=当月总时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt != null && CommUtil.compare_time(edtTime, e_dt) == -1) { -// System.out.println("以前下发,当月以后完成:" + CommUtil.getDays2(edtTime, sdtTime, "second")); - sum += CommUtil.getDays2(edtTime, sdtTime, "second"); -// System.out.println(workorderDetail.getJobNumber() + "----------" + CommUtil.getDays2(edtTime, sdtTime, "second")); - } - //当月下发,未完成---故障时间=下发时间到当前时间 - if (CommUtil.compare_time(sdtTime, s_dt) == -1 && e_dt == null) { -// System.out.println("当月下发,未完成:" + CommUtil.getDays2(CommUtil.nowDate(), workorderDetail.getInsdt(), "second")); - sum += CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second"); -// System.out.println(workorderDetail.getJobNumber() + "----------" + CommUtil.getDays2(CommUtil.nowDate(), s_dt, "second")); - } - //以前下发,未完成---故障时间=月初到当前时间 - if (CommUtil.compare_time(s_dt, sdtTime) == -1 && e_dt == null) { -// System.out.println("以前下发,未完成:" + CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second")); - sum += CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); -// System.out.println(workorderDetail.getJobNumber() + "----------" + CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second")); - } - } -// System.out.println("sum:" + sum); - - /** - * 当月总时间(单台) - * 之前为:1号0点到最后一天 - * 现在为:1号0点到当前时间 - */ -// long all_second = CommUtil.getDays2(edtTime, sdtTime, "second"); - long all_second = CommUtil.getDays2(CommUtil.nowDate(), sdtTime, "second"); - //总设备数 - long all_size = list2.size(); - //所有设备总时间 - long all_time = all_second * all_size; - - //计算完好率(到秒) - double rateD = ((all_time - sum) * 1.0 / all_time * 100); - - if (levelType.equals("0")) {//所有设备 -// System.out.println("----------------下面为所有设备" + "-------------" + unitIds); -// System.out.println("设备总台数:" + all_size); -// System.out.println("当月总秒数:" + all_second); -// System.out.println("设备总时间(分子)= 设备总台数 * 当前总秒数:" + (all_time - sum)); -// System.out.println("设备总时间(分母)= 设备总台数 * 当前总秒数:" + all_time); -// System.out.println("完好率:" + rateD); - } - if (levelType.equals("1")) {//重要设备 -// System.out.println("----------------下面为重要设备" + "-------------" + unitIds); -// System.out.println("设备总台数:" + all_size); -// System.out.println("当月总秒数:" + all_second); -// System.out.println("设备总时间(分子)= 设备总台数 * 当前总秒数:" + (all_time - sum)); -// System.out.println("设备总时间(分母)= 设备总台数 * 当前总秒数:" + all_time); -// System.out.println("完好率:" + rateD); - } - - return rateD; - } - - /** - * 设备完好率(根据故障台数计算的) - * - * @param unitId 厂id 会递归至最下面层级 - * @param levelType 需要获取所有 还是重要设备 (所有设备:type=0 ; 重要设备:type=1) - * @param sdt 查询的月份 格式:2022-04 - * @return - */ - @RequestMapping("/getIntactRate4TS.do") - public double getIntactRate4TS(String unitId, String levelType, String sdt) { - double rate = 100; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String wherestr = "where 1=1 and type = '" + WorkorderDetail.REPAIR + "' and status!='" + WorkorderDetail.Status_Finish + "' and status!='" + WorkorderDetail.Status_Cancel + "' "; - if (unitId != null && !unitId.isEmpty()) { - wherestr += " and unit_id in ('" + unitIds + "') "; - } - - String wherestr2 = "where 1=1 "; - if (unitId != null && !unitId.isEmpty()) { - wherestr2 += " and bizId in ('" + unitIds + "') "; - } - - EquipmentCard entity = new EquipmentCard(); - - String a_id = "";//A类设备id - String b_id = "";//B类设备id - String c_id = "";//C类设备id - List equipmentLevels = equipmentLevelService.selectListByWhere(" order by equipment_level_code "); - for (EquipmentLevel equipmentLevel : equipmentLevels) { - if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("A")) { - a_id = equipmentLevel.getId(); - } - if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("B")) { - b_id = equipmentLevel.getId(); - } - if (equipmentLevel.getEquipmentLevelCode() != null && equipmentLevel.getEquipmentLevelCode().equals("C")) { - c_id = equipmentLevel.getId(); - } - } - - List list = null;//维修单list - List list2 = null;//设备数list - if (levelType != null && !levelType.isEmpty()) { - //所有设备 - if (levelType.equals("0")) { - //查询ABC类-维修单数 - list = workorderDetailService.selectSimpleListByWhere(wherestr); - //查询ABC类-设备总数 - entity.setWhere(wherestr2); - list2 = equipmentCardDao.selectListByWhere(entity); - } - //重要设备 - if (levelType.equals("1")) { - //查询A类B类-维修单数 - list = workorderDetailService.selectSimpleListByWhere(wherestr); - Iterator it = list.iterator(); - while (it.hasNext()) { - String equipmentId = it.next().getEquipmentId(); - EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(equipmentId); - if (equipmentCard != null) { - if (equipmentCard.getEquipmentlevelid() != null && equipmentCard.getEquipmentlevelid().equals(c_id)) { - it.remove(); - } - } - } - - //查询A类B类-设备总数 - wherestr2 += " and (equipmentLevelId = '" + a_id + "' or equipmentLevelId = '" + b_id + "')"; - entity.setWhere(wherestr2); - list2 = equipmentCardDao.selectListByWhere(entity); - } - } - - //计算完好率(台数) - double rateD = 100; - - Set set = new HashSet(); - for (WorkorderDetail workorderDetail : list) { - set.add(workorderDetail.getEquipmentId()); - } - - if (levelType.equals("0")) { - //所有设备 - int all_size = list2.size(); - int repair_size = set.size(); - rateD = (all_size - repair_size) / ((double) all_size); // 将其中一个运算数做类型的强制转换 -// System.out.println(unitId + "所有设备总台数:" + all_size + "故障台数:" + set.size() + "完好率(按台数):" + rateD); - } - if (levelType.equals("1")) { - //重要设备 - int all_size = list2.size(); - int repair_size = set.size(); - rateD = (all_size - repair_size) / ((double) all_size); // 将其中一个运算数做类型的强制转换 -// System.out.println(unitId + "重要设备总台数:" + all_size + "故障台数:" + set.size() + "完好率(按台数):" + rateD); - } - rateD = rateD * 100; - return rateD; - } - - /** - * 工单完成率 (可根据type查维修和保养) - * sj 2022-02-21 - * - * @param unitId 厂id 会递归至最下面层级 - * @param type 维修还是保养 (维修:repair 保养:maintain) - * @return - */ - public double getWorkOrderCompletionRate(String unitId, String type) { - double rate = 100; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String where1 = "where 1=1 and DateDiff(mm,insdt,getdate())=0 and type = '" + type + "' and unit_id in ('" + unitIds + "') and status = '" + WorkorderDetail.Status_Finish + "'"; - String where2 = "where 1=1 and DateDiff(mm,insdt,getdate())=0 and type = '" + type + "' and unit_id in ('" + unitIds + "') "; - - List list1 = workorderDetailService.selectListByWhere(where1); - List list2 = workorderDetailService.selectListByWhere(where2); - - if (list2 != null && list2.size() > 0) { - rate = Double.parseDouble(list1.size() + "") / Double.parseDouble(list2.size() + "") * 100; - } else { - rate = 100; - } - - return rate; - } - - /** - * 巡检完成率 (可根据type查运行或设备巡检) - * sj 2022-02-21 - * - * @param unitId 厂id 会递归至最下面层级 - * @param type 运行或设备巡检 (运行巡检:P 设备巡检:E) - * @return - */ - public double getPatrolRecordCompletionRate(String unitId, String type) { - double rate = 100; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String where1 = "where 1=1 and DateDiff(mm,start_time,getdate())=0 and type = '" + type + "' and unit_id in ('" + unitIds + "') and (status = '" + PatrolRecord.Status_Finish + "' or status = '" + PatrolRecord.Status_PartFinish + "' or status = '" + PatrolRecord.Status_Undo + "')"; - String where2 = "where 1=1 and DateDiff(mm,start_time,getdate())=0 and type = '" + type + "' and unit_id in ('" + unitIds + "') "; - - List list1 = patrolRecordService.selectListByWhere(where1); - List list2 = patrolRecordService.selectListByWhere(where2); - - if (list2 != null && list2.size() > 0) { - rate = Double.parseDouble(list1.size() + "") / Double.parseDouble(list2.size() + "") * 100; - } else { - rate = 100; - } - - return rate; - } - - /** - * 获取指定设备类型的 维修次数 如传sdt或edt可查询时间范围内的 不传则只查当月的 - * sj 2022-02-23 - * - * @param unitId 厂id - * @param className 通用设备、电气设备、仪器设备、专业设备 等名称和设备类型要对应起来 - * @return - */ - public com.alibaba.fastjson.JSONArray getRepairCount4Class(String unitId, String className) { - int count = 0; - - //查询接收设备类型中文名对应的id - String classId = ""; - List classList = equipmentClassService.selectListByWhere("where name = '" + className + "' and pid='-1'"); - if (classList != null && classList.size() > 0) { - classId = classList.get(0).getId(); - } - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - String[] months = CommUtil.getLatest12Month(); - for (int i = 0; i < months.length; i++) { - String[] str = new String[2]; - String where = "where 1=1 and unit_id in ('" + unitIds + "')"; - where += "and DateDiff(mm,insdt,'" + months[i] + "-01')=0 and type = '" + WorkorderDetail.REPAIR + "'"; - List list = workorderDetailService.selectListByWhere(where); - Iterator it = list.iterator(); - while (it.hasNext()) { - WorkorderDetail workorderDetail = it.next(); - EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(workorderDetail.getEquipmentId()); - if (equipmentCard != null) { - if (!equipmentCard.getEquipmentBigClassId().equals(classId)) { - it.remove(); - } - } - } - str[0] = months[i]; - str[1] = list.size() + ""; - jsonArray.add(str); - } - return jsonArray; - } - - /** - * 获取指定设备类型的 维修次数 如传sdt或edt可查询时间范围内的 不传则只查当月的 - * sj 2022-02-23 - * - * @param unitId 厂id - * @param className 通用设备、电气设备、仪器设备、专业设备 等名称和设备类型要对应起来 - * @return - */ - public int getRepairCount4Class2(String unitId, String className) { - int count = 0; - - //查询接收设备类型中文名对应的id - String classId = ""; - List classList = equipmentClassService.selectListByWhere("where name = '" + className + "' and pid='-1'"); - if (classList != null && classList.size() > 0) { - classId = classList.get(0).getId(); - } - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - String[] months = CommUtil.getLatest12Month(); - String where = "where 1=1 and unit_id in ('" + unitIds + "')"; - where += "and DateDiff(mm,insdt,'" + CommUtil.nowDate() + "')=0 and type = '" + WorkorderDetail.REPAIR + "'"; - List list = workorderDetailService.selectListByWhere(where); - Iterator it = list.iterator(); - while (it.hasNext()) { - WorkorderDetail workorderDetail = it.next(); - EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(workorderDetail.getEquipmentId()); - if (equipmentCard != null) { - if (!equipmentCard.getEquipmentBigClassId().equals(classId)) { - it.remove(); - } - } - } - count = list.size(); - return count; - } - - public int getRepairCount4Class3(String unitId, String className, String dt) { - int count = 0; - - //查询接收设备类型中文名对应的id - String classId = ""; - List classList = equipmentClassService.selectListByWhere("where name = '" + className + "' and pid='-1'"); - if (classList != null && classList.size() > 0) { - classId = classList.get(0).getId(); - } - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - String where = "where 1=1 and unit_id in ('" + unitIds + "')"; - where += "and DateDiff(mm,insdt,'" + dt + "')=0 and type = '" + WorkorderDetail.REPAIR + "'"; - List list = workorderDetailService.selectSimpleListByWhere(where); - Iterator it = list.iterator(); - while (it.hasNext()) { - WorkorderDetail workorderDetail = it.next(); - EquipmentCard equipmentCard = equipmentCardDao.selectSimpleListById(workorderDetail.getEquipmentId()); - if (equipmentCard != null) { - if (!equipmentCard.getEquipmentBigClassId().equals(classId)) { - it.remove(); - } - } - } - count = list.size(); - return count; - } - - /** - * 获取保养工单数 - * sj 2022-02-28 - * - * @param unitId - * @param status - * @return - */ - public int getRepairCount(String unitId, String status, String sdt, String edt, String type) { - int count = 0; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String where = "where 1=1 and type = '" + type + "' "; - - if (sdt != null && !sdt.equals("") && edt != null && !edt.equals("")) { - //查询时间范围内的 - where += "and insdt BETWEEN '" + sdt + "' AND '" + edt + "' and unit_id in ('" + unitIds + "') "; - } else { - //查询当月的 - where += "and DateDiff(mm,insdt,getdate())=0 and unit_id in ('" + unitIds + "') "; - } - - List list = null; - if (status != null && !status.equals("")) { - //完成数 - if (status.equals("0")) { - list = workorderDetailService.selectListByWhere(where + " and status = '" + WorkorderDetail.Status_Finish + "' "); - } - //总数 - if (status.equals("1")) { - list = workorderDetailService.selectListByWhere(where); - } - count = list.size(); - } - - return count; - } - - /** - * 获取巡检任务数 - * sj 2022-02-28 - * - * @param unitId - * @param type - * @param sdt - * @param edt - * @return - */ - public int getPatrolRecordCount(String unitId, String type, String status, String sdt, String edt) { - int count = 0; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String where = "where 1=1 "; - - if (sdt != null && !sdt.equals("") && edt != null && !edt.equals("")) { - //查询时间范围内的 - where += "and start_time BETWEEN '" + sdt + "' AND '" + edt + "' and unit_id in ('" + unitIds + "') "; - } else { - //查询当月的 - where += "and DateDiff(mm,start_time,getdate())=0 and unit_id in ('" + unitIds + "') "; - } - - if (type != null && !type.equals("")) { - where += " and type='" + type + "'"; - } - - List list = null; - - if (status != null && !status.equals("")) { - //完成数 - if (status.equals("0")) { - list = patrolRecordService.selectListByWhere(where + " and (status = '" + PatrolRecord.Status_Finish + "' or status = '" + PatrolRecord.Status_PartFinish + "' or status = '" + PatrolRecord.Status_Undo + "')"); - } - //总数 - if (status.equals("1")) { - list = patrolRecordService.selectListByWhere(where); - } - count = list.size(); - } - return count; - } - - /** - * 获取异常数 - * sj 2022-02-28 - * - * @param - * @param unitId - * @param type - * @param sdt - * @param edt - * @return - */ - public int getAbnormityCount(String unitId, String type, String sdt, String edt) { - int rate = 0; - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String where = "where 1=1 and DateDiff(mm,insdt,getdate())=0 and type = '" + type + "' and biz_id in ('" + unitIds + "') "; - List list = abnormityService.selectListByWhere(where); - if (list != null && list.size() > 0) { - rate = list.size(); - } - return rate; - } - - public String getEquipmentOverview_Target(String unitId, String date, String equipmentClassId, String processSectionId) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String zaiyong_id = "";//在用-状态id - String kucun_id = "";//库存-状态id - String xianzhi_id = "";//闲置-状态id - String daibaofei_id = "";//待报废-状态id - - List equipmentStatusManagement_zaiyong = equipmentStatusManagementService.selectListByWhere("where name = '在用'"); - List equipmentStatusManagement_kucun = equipmentStatusManagementService.selectListByWhere("where name = '库存'"); - List equipmentStatusManagement_xianzhi = equipmentStatusManagementService.selectListByWhere("where name = '闲置'"); - List equipmentStatusManagement_daibaofei = equipmentStatusManagementService.selectListByWhere("where name = '待报废'"); - if (equipmentStatusManagement_zaiyong != null && equipmentStatusManagement_zaiyong.size() > 0) { - zaiyong_id = equipmentStatusManagement_zaiyong.get(0).getId(); - } - if (equipmentStatusManagement_kucun != null && equipmentStatusManagement_kucun.size() > 0) { - kucun_id = equipmentStatusManagement_kucun.get(0).getId(); - } - if (equipmentStatusManagement_xianzhi != null && equipmentStatusManagement_xianzhi.size() > 0) { - xianzhi_id = equipmentStatusManagement_xianzhi.get(0).getId(); - } - if (equipmentStatusManagement_daibaofei != null && equipmentStatusManagement_daibaofei.size() > 0) { - daibaofei_id = equipmentStatusManagement_daibaofei.get(0).getId(); - } - - String a_id = "";//A类设备_id - String b_id = "";//B类设备_id - String c_id = "";//C类设备_id - - List equipmentLevels_a = equipmentLevelService.selectListByWhere("where equipment_level_code = 'A'"); - List equipmentLevels_b = equipmentLevelService.selectListByWhere("where equipment_level_code = 'B'"); - List equipmentLevels_c = equipmentLevelService.selectListByWhere("where equipment_level_code = 'C'"); - if (equipmentLevels_a != null && equipmentLevels_a.size() > 0) { - a_id = equipmentLevels_a.get(0).getId(); - } - if (equipmentLevels_b != null && equipmentLevels_b.size() > 0) { - b_id = equipmentLevels_b.get(0).getId(); - } - if (equipmentLevels_c != null && equipmentLevels_c.size() > 0) { - c_id = equipmentLevels_c.get(0).getId(); - } - - //查询设备数量 - EquipmentCard equipmentCard = new EquipmentCard(); - - String wherestr = "where 1=1 and bizId in ('" + unitIds + "')"; - if (equipmentClassId != null && !equipmentClassId.equals("")) { - wherestr += " and equipment_big_class_id = '" + equipmentClassId + "'"; - } - if (processSectionId != null && !processSectionId.equals("")) { - //由于之前设备台账存的是id 前段传的是code 需要查询转换下 - List processSections = processSectionService.selectListByWhere("where unit_id in ('" + unitIds + "') and code = '" + processSectionId + "'"); - String ids = ""; - for (ProcessSection s : processSections) { - ids += "'" + s.getId() + "',"; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - wherestr += " and processSectionId in (" + ids + ")"; - } - } - - equipmentCard.setWhere(wherestr); - List list_all = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + zaiyong_id + "'"); - List list_zaiyong = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + kucun_id + "'"); - List list_kucun = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + xianzhi_id + "'"); - List list_xianzhi = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + daibaofei_id + "'"); - List list_daibaofei = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentLevelId = '" + a_id + "'"); - List list_level_a = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentLevelId = '" + b_id + "'"); - List list_level_b = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentLevelId = '" + c_id + "'"); - List list_level_c = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - //查询所有维修中的设备 - List list_work = workorderDetailService.selectSimpleListByWhere("where 1=1 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.REPAIR + "' and status!='" + WorkorderDetail.Status_Finish + "'"); - Set set = new HashSet();//总的 - Set set2 = new HashSet();//总的 - for (WorkorderDetail workorderDetail : list_work) { - set.add(workorderDetail.getEquipmentId()); - } - - //根据工艺段筛选维修工单的设备 - if (processSectionId != null && !processSectionId.equals("")) { - Iterator it = set.iterator(); - while (it.hasNext()) { - Object str = it.next(); - EquipmentCard equipmentCard1 = equipmentCardDao.selectSimpleListById(str); - if (equipmentCard1 != null) { - ProcessSection processSection = processSectionService.selectById(equipmentCard1.getProcesssectionid()); - if (processSection != null) { - if (processSection.getCode().equals(processSectionId)) { - set2.add(str.toString()); - } - } - } - } - } else { - set2 = set; - } - - List list_abnormity = abnormityService.selectListByWhere("where 1=1 and biz_id in ('" + unitIds + "') and type = '" + Abnormity.Type_Equipment + "' and DateDiff(mm,insdt,'" + date + "-01')=0"); - Map map = new HashMap(); - for (int i = 0; i < list_abnormity.size(); i++) { - EquipmentCard equipmentCard1 = equipmentCardDao.selectSimpleListById(list_abnormity.get(i).getEquipmentIds()); - if (equipmentCard1 != null) { - if (processSectionId != null && !processSectionId.equals("")) { - //根据工艺段筛选异常上报的设备 - ProcessSection processSection = processSectionService.selectById(equipmentCard1.getProcesssectionid()); - if (processSection != null) { - if (processSection.getCode().equals(processSectionId)) { - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentCard1.getEquipmentBigClassId()); - if (equipmentClass != null) { - map.put(equipmentClass.getName(), 0); - } - } - } - } else { - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentCard1.getEquipmentBigClassId()); - if (equipmentClass != null) { - map.put(equipmentClass.getName(), 0); - } - } - } - } - for (int i = 0; i < list_abnormity.size(); i++) { - EquipmentCard equipmentCard1 = equipmentCardDao.selectSimpleListById(list_abnormity.get(i).getEquipmentIds()); - if (equipmentCard1 != null) { - if (processSectionId != null && !processSectionId.equals("")) { - //根据工艺段筛选异常上报的设备 - ProcessSection processSection = processSectionService.selectById(equipmentCard1.getProcesssectionid()); - if (processSection != null) { - if (processSection.getCode().equals(processSectionId)) { - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentCard1.getEquipmentBigClassId()); - if (equipmentClass != null) { - int num = map.get(equipmentClass.getName()) + 1; - map.put(equipmentClass.getName(), num); - } - } - } - } else { - EquipmentClass equipmentClass = equipmentClassService.selectById(equipmentCard1.getEquipmentBigClassId()); - if (equipmentClass != null) { - int num = map.get(equipmentClass.getName()) + 1; - map.put(equipmentClass.getName(), num); - } - } - } - } - com.alibaba.fastjson.JSONArray jsonArray1 = new com.alibaba.fastjson.JSONArray(); - for (Map.Entry entry : map.entrySet()) { - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("name", entry.getKey()); - jsonObject1.put("value", entry.getValue()); - jsonArray1.add(jsonObject1); - } - - BigDecimal num1 = new BigDecimal("100"); - BigDecimal num2 = new BigDecimal("100"); - - /** - * 设备完好率 --- 根据故障时间 - */ - - /*MPoint mPoint = mPointService.selectById(unitId, unitId + "_SBWHL_MONTH"); - if (mPoint != null) { - num1 = mPoint.getParmvalue(); - } else { - - }*/ - /** - * 设备完好率 --- 根据故障次数 - */ - /*if (list_all != null && list_all.size() > 0) { - num2 = new BigDecimal("0"); - } else { - if (list_all != null && list_all.size() > 0) { - num2 = new BigDecimal(((double) (list_all.size() - set2.size()) / (double) list_all.size()) * 100); - } else { - num2 = new BigDecimal("0"); - } - }*/ - - /*Work work = (Work) SpringContextUtil.getBean("work"); - if (work != null && "0".equals(work.getIntactRate())) { - BigDecimal setScale = num1.setScale(2, BigDecimal.ROUND_HALF_DOWN); - jsonObject.put("intact_rate", setScale);//设备完好率 --- 故障时间 - } else { - BigDecimal setScale = num2.setScale(2, BigDecimal.ROUND_HALF_DOWN); - jsonObject.put("intact_rate", setScale);//设备完好率 --- 故障次数 - }*/ - - try { - List mPointHistoryList = mPointHistoryService.selectListByTableAWhere(unitId, "tb_mp_" + unitId + "_SBWHL_TS_MONTH", "where MeasureDT='" + date + "-01 00:00:00'"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - BigDecimal bd = new BigDecimal(mPointHistoryList.get(0).getParmvalue() + ""); - double two = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - jsonObject.put("intact_rate", two);//设备完好率 --- 故障次数 - } else { - jsonObject.put("intact_rate", 100);//设备完好率 --- 故障次数 - } - } catch (Exception e) { - e.printStackTrace(); - } - -// Double n_rate = Double.parseDouble((list_all.size() - set2.size()) + "") / Double.parseDouble(list_all.size() + ""); -// BigDecimal bd = new BigDecimal(n_rate * 100); -// double two = bd.setScale(0, BigDecimal.ROUND_HALF_UP).doubleValue(); -// jsonObject.put("intact_rate", two);//设备完好率 --- 故障次数 - - jsonObject.put("all_num", list_all.size());//所有设备-数量 - jsonObject.put("intact_num", list_all.size() - set2.size());//完好设备-数量 - - jsonObject.put("zaiyong_num", list_zaiyong.size());//在用设备-数量 - jsonObject.put("kucun_num", list_kucun.size());//库存设备-数量 - jsonObject.put("xianzhi_num", list_xianzhi.size());//闲置设备-数量 - jsonObject.put("daibaofei_num", list_daibaofei.size());//待报废设备-数量 - jsonObject.put("not_config_status_num", list_all.size() - list_zaiyong.size() - list_kucun.size() - list_xianzhi.size() - list_daibaofei.size());//未配置设备状态-数量 - - jsonObject.put("level_a_num", list_level_a.size());//A类设备-数量 - jsonObject.put("level_b_num", list_level_b.size());//B类设备-数量 - jsonObject.put("level_c_num", list_level_c.size());//C类设备-数量 - jsonObject.put("not_config_level_num", list_all.size() - list_level_a.size() - list_level_b.size() - list_level_c.size());//未配置设备等级-数量 - -// jsonObject.put("abnormity_r_num", list_abnormity_r.size());//异常上报(运行)-数量 -// jsonObject.put("abnormity_e_num", list_abnormity_e.size());//异常上报(设备)-数量 -// jsonObject.put("abnormity_f_num", list_abnormity_f.size());//异常上报(设施)-数量 - jsonObject.put("abnormity_json", jsonArray1); - - return jsonObject.toString(); - } - - public String getEquipmentOverview_Completion(String unitId, String date, String equipmentClassId, String processSectionId) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - //设备巡检完成率 - String wherestr = " where 1=1 and DateDiff(mm,start_time,'" + date + "-01')=0 and unit_id in ('" + unitIds + "') "; - List list_patrol_finish = patrolRecordService.selectSimpleListByWhere(wherestr + " and type = '" + PatrolType.Equipment.getId() + "' and (status = '" + PatrolRecord.Status_Finish + "' or status = '" + PatrolRecord.Status_PartFinish + "' or status = '" + PatrolRecord.Status_Undo + "')"); - List list_patrol_handle = patrolRecordService.selectSimpleListByWhere(wherestr + " and type = '" + PatrolType.Equipment.getId() + "' and (status = '" + PatrolRecord.Status_Issue + "' or status = '" + PatrolRecord.Status_Start + "')"); - - String wherestr2 = " where 1=1 and DateDiff(mm,insdt,'" + date + "-01')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.REPAIR + "'"; - List list_repair_finish = workorderDetailService.selectSimpleListByWhere(wherestr2 + "and status = '" + WorkorderDetail.Status_Finish + "'"); - List list_repair_handle = workorderDetailService.selectSimpleListByWhere(wherestr2 + "and status != '" + WorkorderDetail.Status_Finish + "'"); - - String wherestr3 = " where 1=1 and DateDiff(mm,insdt,'" + date + "-01')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.MAINTAIN + "'"; - List list_main_finish = workorderDetailService.selectSimpleListByWhere(wherestr3 + "and status = '" + WorkorderDetail.Status_Finish + "'"); - List list_main_handle = workorderDetailService.selectSimpleListByWhere(wherestr3 + "and status != '" + WorkorderDetail.Status_Finish + "'"); - - jsonObject.put("finish_patrol_num", list_patrol_finish.size());//设备巡检完成数 - jsonObject.put("handle_patrol_num", list_patrol_handle.size());//设备巡检待处理数 - jsonObject.put("all_patrol_num", list_patrol_finish.size() + list_patrol_handle.size());//设备巡检总数 - - jsonObject.put("finish_repair_num", list_repair_finish.size());//维修工单完成数 - jsonObject.put("handle_repair_num", list_repair_handle.size());//维修工单待处理数 - jsonObject.put("all_repair_num", list_repair_finish.size() + list_repair_handle.size());//维修工单总数 - - jsonObject.put("finish_main_num", list_main_finish.size());//保养工单完成数 - jsonObject.put("handle_main_num", list_main_handle.size());//保养工单待处理数 - jsonObject.put("all_main_num", list_main_finish.size() + list_main_handle.size());//保养工单总数 - - return jsonObject.toString(); - } - - public String getEquipmentOverview_Statistics(String unitId, String date, String equipmentClassId, String processSectionId, String type) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - Integer[] strArr_plan = new Integer[12]; - Integer[] strArr_finish = new Integer[12]; - //设备巡检 - if (type != null && type.equals("0")) { - for (int i = 0; i < 12; i++) { - String datestr = ""; - if (i < 9) { - datestr = date.substring(0, 4) + "-" + "0" + (i + 1) + "-01"; - } else { - datestr = date.substring(0, 4) + "-" + (i + 1) + "-01"; - } - String wherestr = " where 1=1 and DateDiff(mm,start_time,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + PatrolType.Equipment.getId() + "'"; - List list_plan = patrolRecordService.selectSimpleListByWhere(wherestr); - List list_finish = patrolRecordService.selectSimpleListByWhere(wherestr + " and (status = '" + PatrolRecord.Status_Finish + "' or status = '" + PatrolRecord.Status_PartFinish + "' or status = '" + PatrolRecord.Status_Undo + "')"); - strArr_plan[i] = list_plan.size(); - strArr_finish[i] = list_finish.size(); - } - } - - //维修 - if (type != null && type.equals("1")) { - for (int i = 0; i < 12; i++) { - String datestr = ""; - if (i < 9) { - datestr = date.substring(0, 4) + "-" + "0" + (i + 1) + "-01"; - } else { - datestr = date.substring(0, 4) + "-" + (i + 1) + "-01"; - } - String wherestr = " where 1=1 and DateDiff(mm,insdt,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.REPAIR + "'"; - List list_plan = workorderDetailService.selectSimpleListByWhere(wherestr); - List list_finish = workorderDetailService.selectSimpleListByWhere(wherestr + " and status = '" + WorkorderDetail.Status_Finish + "' "); - strArr_plan[i] = list_plan.size(); - strArr_finish[i] = list_finish.size(); - } - } - - //保养 - if (type != null && type.equals("2")) { - for (int i = 0; i < 12; i++) { - String datestr = ""; - if (i < 9) { - datestr = date.substring(0, 4) + "-" + "0" + (i + 1) + "-01"; - } else { - datestr = date.substring(0, 4) + "-" + (i + 1) + "-01"; - } - String wherestr = " where 1=1 and DateDiff(mm,insdt,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.MAINTAIN + "'"; - List list_plan = workorderDetailService.selectSimpleListByWhere(wherestr); - List list_finish = workorderDetailService.selectSimpleListByWhere(wherestr + " and status = '" + WorkorderDetail.Status_Finish + "' "); - strArr_plan[i] = list_plan.size(); - strArr_finish[i] = list_finish.size(); - } - } - - jsonObject.put("plan", strArr_plan);//计划数 - jsonObject.put("finish", strArr_finish);//临时完成数 - return jsonObject.toString(); - } - - public String getEquipmentOverview_WorkPlan(String unitId, String date, String equipmentClassId, String processSectionId) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - int days = CommUtil.getDaysByYearMonth(Integer.parseInt(date.substring(0, 4)), Integer.parseInt(date.substring(5, 7))); - if (days > 0) { - for (int i = 0; i < days; i++) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - String datestr = date.substring(0, 4) + "-" + date.substring(5, 7); - if (i < 9) { - datestr = datestr + "-0" + (i + 1); - } else { - datestr = datestr + "-" + (i + 1); - } - jsonObject.put("sdt", datestr); - - String wherestr = " where 1=1 and DateDiff(dd,start_time,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + PatrolType.Equipment.getId() + "'"; - List list_patrol = patrolRecordService.selectSimpleListByWhere(wherestr); - jsonObject.put("patrol_num", list_patrol.size()); - - String wherestr_finish = " where 1=1 and DateDiff(dd,start_time,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + PatrolType.Equipment.getId() + "' and (status = '" + PatrolRecord.Status_Finish + "' or status = '" + PatrolRecord.Status_PartFinish + "' or status = '" + PatrolRecord.Status_Undo + "')"; - List list_patrol_finish = patrolRecordService.selectSimpleListByWhere(wherestr_finish); - if (list_patrol_finish.size() == 0) { - jsonObject.put("patrol_num_color", 0); - } else if (list_patrol_finish.size() == list_patrol.size()) { - jsonObject.put("patrol_num_color", 2); - } else { - jsonObject.put("patrol_num_color", 1); - } - - String wherestr2 = " where 1=1 and DateDiff(dd,insdt,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.REPAIR + "'"; - List list_repair = workorderDetailService.selectSimpleListByWhere(wherestr2); - jsonObject.put("repair_num", list_repair.size()); - - String wherestr2_finish = " where 1=1 and DateDiff(dd,insdt,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.REPAIR + "' and status = '" + WorkorderDetail.Status_Finish + "'"; - List list_repair_finish = workorderDetailService.selectSimpleListByWhere(wherestr2_finish); - if (list_repair_finish.size() == 0) { - jsonObject.put("repair_num_color", 0); - } else if (list_repair_finish.size() == list_repair.size()) { - jsonObject.put("repair_num_color", 2); - } else { - jsonObject.put("repair_num_color", 1); - } - - String wherestr3 = " where 1=1 and DateDiff(dd,insdt,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.MAINTAIN + "'"; - List list_main = workorderDetailService.selectSimpleListByWhere(wherestr3); - jsonObject.put("main_num", list_main.size()); - - String wherestr3_finish = " where 1=1 and DateDiff(dd,insdt,'" + datestr + "')=0 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.MAINTAIN + "' and status = '" + WorkorderDetail.Status_Finish + "'"; - List list_main_finish = workorderDetailService.selectSimpleListByWhere(wherestr3_finish); - if (list_main_finish.size() == 0) { - jsonObject.put("main_num_color", 0); - } else if (list_main_finish.size() == list_main.size()) { - jsonObject.put("main_num_color", 2); - } else { - jsonObject.put("main_num_color", 1); - } - - if ((list_patrol != null && list_patrol.size() > 0) || (list_repair != null && list_repair.size() > 0) || (list_main != null && list_main.size() > 0)) { - jsonArray.add(jsonObject); - } - } - } - return jsonArray.toString(); - } - - public String getEquipmentOverview_WorkList(String unitId, String date, String equipmentClassId, String processSectionId, String type) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String types = ""; - if (type != null && !type.equals("")) { - String[] str = type.split(","); - for (String s : str) { - types += "'" + s + "',"; - } - types = types.substring(0, types.length() - 1); - } - String wherestr2 = " where 1=1 and DateDiff(dd,insdt,'" + date + "')=0 and unit_id in ('" + unitIds + "') and type in (" + types + ")"; - List list_repair = workorderDetailService.selectSimpleListByWhere(wherestr2); - for (WorkorderDetail workorderDetail : list_repair) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("type", workorderDetail.getType()); - Unit unit = unitService.getUnitById(workorderDetail.getReceiveUserId()); - if (unit != null) { - jsonObject.put("userName", unit.getSname()); - } else { - jsonObject.put("userName", "-"); - } - jsonObject.put("time", workorderDetail.getInsdt().substring(0, 10)); - jsonObject.put("content", workorderDetail.getJobName()); - if (workorderDetail.getStatus().equals(WorkorderDetail.Status_Start)) { - jsonObject.put("status", "已下发"); - } - if (workorderDetail.getStatus().equals(WorkorderDetail.Status_Finish)) { - jsonObject.put("status", "已完成"); - } - if (workorderDetail.getStatus().equals(WorkorderDetail.Status_Compete)) { - jsonObject.put("status", "待抢单"); - } - jsonObject.put("id", workorderDetail.getId()); - jsonArray.add(jsonObject); - } - return jsonArray.toString(); - } - - - public com.alibaba.fastjson.JSONObject getEquipmentNumber(String unitId) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - //查询自己和所有子节点 - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - String zaiyong_id = "";//在用-状态id - String kucun_id = "";//库存-状态id - String xianzhi_id = "";//闲置-状态id - String daibaofei_id = "";//待报废-状态id - - List equipmentStatusManagement_zaiyong = equipmentStatusManagementService.selectListByWhere("where name = '在用'"); - List equipmentStatusManagement_kucun = equipmentStatusManagementService.selectListByWhere("where name = '库存'"); - List equipmentStatusManagement_xianzhi = equipmentStatusManagementService.selectListByWhere("where name = '闲置'"); - List equipmentStatusManagement_daibaofei = equipmentStatusManagementService.selectListByWhere("where name = '待报废'"); - if (equipmentStatusManagement_zaiyong != null && equipmentStatusManagement_zaiyong.size() > 0) { - zaiyong_id = equipmentStatusManagement_zaiyong.get(0).getId(); - } - if (equipmentStatusManagement_kucun != null && equipmentStatusManagement_kucun.size() > 0) { - kucun_id = equipmentStatusManagement_kucun.get(0).getId(); - } - if (equipmentStatusManagement_xianzhi != null && equipmentStatusManagement_xianzhi.size() > 0) { - xianzhi_id = equipmentStatusManagement_xianzhi.get(0).getId(); - } - if (equipmentStatusManagement_daibaofei != null && equipmentStatusManagement_daibaofei.size() > 0) { - daibaofei_id = equipmentStatusManagement_daibaofei.get(0).getId(); - } - - String a_id = "";//A类设备_id - String b_id = "";//B类设备_id - String c_id = "";//C类设备_id - - List equipmentLevels_a = equipmentLevelService.selectListByWhere("where equipment_level_code = 'A'"); - List equipmentLevels_b = equipmentLevelService.selectListByWhere("where equipment_level_code = 'B'"); - List equipmentLevels_c = equipmentLevelService.selectListByWhere("where equipment_level_code = 'C'"); - if (equipmentLevels_a != null && equipmentLevels_a.size() > 0) { - a_id = equipmentLevels_a.get(0).getId(); - } - if (equipmentLevels_b != null && equipmentLevels_b.size() > 0) { - b_id = equipmentLevels_b.get(0).getId(); - } - if (equipmentLevels_c != null && equipmentLevels_c.size() > 0) { - c_id = equipmentLevels_c.get(0).getId(); - } - - //查询设备数量 - EquipmentCard equipmentCard = new EquipmentCard(); - - String wherestr = "where 1=1 and bizId in ('" + unitIds + "')"; - - equipmentCard.setWhere(wherestr); - List list_all = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + zaiyong_id + "'"); - List list_zaiyong = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + kucun_id + "'"); - List list_kucun = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + xianzhi_id + "'"); - List list_xianzhi = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentStatus = '" + daibaofei_id + "'"); - List list_daibaofei = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentLevelId = '" + a_id + "'"); - List list_level_a = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentLevelId = '" + b_id + "'"); - List list_level_b = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - equipmentCard.setWhere(wherestr + " and equipmentLevelId = '" + c_id + "'"); - List list_level_c = equipmentCardDao.selectSimpleListByWhere(equipmentCard); - - //查询所有维修中的设备 - List list_work = workorderDetailService.selectSimpleListByWhere("where 1=1 and unit_id in ('" + unitIds + "') and type = '" + WorkorderDetail.REPAIR + "' and status!='" + WorkorderDetail.Status_Finish + "'"); - Set set = new HashSet();//总的 - Set set2 = new HashSet();//总的 - for (WorkorderDetail workorderDetail : list_work) { - set.add(workorderDetail.getEquipmentId()); - } - - jsonObject.put("all_num", list_all.size());//所有设备-数量 - jsonObject.put("intact_num", list_all.size() - set2.size());//完好设备-数量 - - jsonObject.put("zaiyong_num", list_zaiyong.size());//在用设备-数量 - jsonObject.put("kucun_num", list_kucun.size());//库存设备-数量 - jsonObject.put("xianzhi_num", list_xianzhi.size());//闲置设备-数量 - jsonObject.put("daibaofei_num", list_daibaofei.size());//待报废设备-数量 - jsonObject.put("not_config_status_num", list_all.size() - list_zaiyong.size() - list_kucun.size() - list_xianzhi.size() - list_daibaofei.size());//未配置设备状态-数量 - - jsonObject.put("level_a_num", list_level_a.size());//A类设备-数量 - jsonObject.put("level_b_num", list_level_b.size());//B类设备-数量 - jsonObject.put("level_c_num", list_level_c.size());//C类设备-数量 - jsonObject.put("not_config_level_num", list_all.size() - list_level_a.size() - list_level_b.size() - list_level_c.size());//未配置设备等级-数量 - - return jsonObject; - } - - public List selectListByWhereForMaintenance(String wherestr) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setWhere(wherestr); - List equipmentCards = this.equipmentCardDao.selectListByWhereForMaintenance(equipmentCard); - return equipmentCards; - } -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentClassPropService.java b/src/com/sipai/service/equipment/EquipmentClassPropService.java deleted file mode 100644 index 7ecec873..00000000 --- a/src/com/sipai/service/equipment/EquipmentClassPropService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentClassPropDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClassProp; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentClassPropService implements CommService{ - @Resource - private EquipmentClassPropDao equipmentClassPropDao; - - public List selectList() { - // TODO Auto-generated method stub - EquipmentClassProp equipmentClassProp = new EquipmentClassProp(); - return this.equipmentClassPropDao.selectList(equipmentClassProp); - } - - - @Override - public EquipmentClassProp selectById(String id) { - return this.equipmentClassPropDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentClassPropDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentClassProp equipmentClassProp) { - return this.equipmentClassPropDao.insert(equipmentClassProp); - } - - @Override - public int update(EquipmentClassProp equipmentClassProp) { - return this.equipmentClassPropDao.updateByPrimaryKeySelective(equipmentClassProp); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentClassProp equipmentClassProp = new EquipmentClassProp(); - equipmentClassProp.setWhere(wherestr); - return this.equipmentClassPropDao.selectListByWhere(equipmentClassProp); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentClassProp equipmentClassProp = new EquipmentClassProp(); - equipmentClassProp.setWhere(wherestr); - return this.equipmentClassPropDao.deleteByWhere(equipmentClassProp); - } - - -} diff --git a/src/com/sipai/service/equipment/EquipmentClassService.java b/src/com/sipai/service/equipment/EquipmentClassService.java deleted file mode 100644 index 65ba2d29..00000000 --- a/src/com/sipai/service/equipment/EquipmentClassService.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.service.equipment; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.user.Unit; - -public interface EquipmentClassService { - - public abstract EquipmentClass selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EquipmentClass entity); - - public abstract int update(EquipmentClass entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract boolean checkNotOccupied(String id, String name); - - public abstract List selectTree(String wherestr); - - public abstract String getTreeListtest(List> list_result, List list); - - /** - * 设备台账左边树定制 - * - * @param list_result - * @param list - * @return - */ - public abstract String getTreeListtest2(List> list_result, List list, String unitId); - - public abstract int deleteAllById(String id); - - public String selectBelongAllParentId(EquipmentClass equipmentClass, String equipmentClassCode); - - public abstract TreeSet selectListByIds(String ids); - - //根据子节点向上找到所有的父节点 - public abstract TreeSet selectListByChild(TreeSet classIdList, String pid); - - //保存子节点的编号时候 将所有父节点的编号拼成字符串保存到 equipmentClassCodeFull 字段 - public abstract Map getCodeFull4Tree(Map resultMap, String code, String id, int markInt); - - //public abstract List selectEquBigClassByProSecAndCompanyId(EquipmentCard equipmentCard); - - public abstract List selectEquSmallClassByBigClass(EquipmentCard equipmentCard); - - public abstract List selectDistinctEquBigClass(EquipmentCard equipmentCard); - - //public abstract List selectDistinctEquSmallClass(EquipmentCard equipmentCard); - - public abstract TreeSet getAllChildId(TreeSet classIdList, String id); - - //根据子节点向上找到所有的父节点(仅获取根节点) - public abstract TreeSet getRootId(TreeSet classIdList, String pid); - - //getTreeListtest增加了设备层级 - public abstract String getTreeListtest4Equ(List> list_result, List list, String unitId); - - //getTreeListtest增加了设备型号层级 - public abstract String getTreeListtest4Model(List> list_result, List list, String unitId); - //根据子节点向上找到父节点(仅获取根节点) - //public abstract String getRootIdstr(String id,String pid); - - - public abstract EquipmentClass selectByWhere(String wherestr); - - /* - * 已层级关系读取设备类型表 用于导出 只能在mapper里联合查询较简单 - */ - public abstract List selectList4Tree(String wherestr); - - /* - * 设备类型树导出EXCEL - */ - public abstract void doExportEquipmentClass(HttpServletResponse response, String unitId) throws IOException; - - /* - * 设备类型树读取EXCEL - */ - public abstract String readXls(InputStream input, String userId, String unitId) throws IOException; - - public abstract String readXlsx(InputStream input, String userId, String unitId) throws IOException; - - /** - * 获取bootstrap-treeview 所需json数据 - */ - public String getTreeList(List> list_result, List list); - - public List getUnitChildrenById(String id); - - - /** - * 根据设备unitId查询对应设备台帐存在的设备类型 只获取存在的设备类型Ids(大类+小类) - * - * @return - */ - public abstract String getTreeIdS4Have(String unitId); - - /** - * 根据设备unitId查询对应设备台帐存在的设备类型 只获取存在的设备类型Ids(只获取大类) - * - * @return - */ - public abstract String getTreeIdS4HaveBigId(String unitId); - - /** - * 根据设备unitId查询对应设备台帐存在的设备类型 只获取存在的设备类型Ids(只获取小类) - * - * @return - */ - public abstract String getTreeIdS4HaveSmallId(String unitId); - -} diff --git a/src/com/sipai/service/equipment/EquipmentCodeLibraryService.java b/src/com/sipai/service/equipment/EquipmentCodeLibraryService.java deleted file mode 100644 index 0a86b30f..00000000 --- a/src/com/sipai/service/equipment/EquipmentCodeLibraryService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCodeLibraryDao; -import com.sipai.entity.equipment.EquipmentCodeLibrary; -import com.sipai.tools.CommService; - - -@Service -public class EquipmentCodeLibraryService implements CommService{ - - @Resource - private EquipmentCodeLibraryDao equipmentCodeLibraryDao; - - @Override - public EquipmentCodeLibrary selectById(String t) { - // TODO Auto-generated method stub - return equipmentCodeLibraryDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentCodeLibraryDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EquipmentCodeLibrary t) { - // TODO Auto-generated method stub - return equipmentCodeLibraryDao.insert(t); - } - - @Override - public int update(EquipmentCodeLibrary t) { - // TODO Auto-generated method stub - return equipmentCodeLibraryDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCodeLibrary equipmentCodeLibrary = new EquipmentCodeLibrary(); - equipmentCodeLibrary.setWhere(t); - return equipmentCodeLibraryDao.selectListByWhere(equipmentCodeLibrary); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCodeLibrary equipmentCodeLibrary = new EquipmentCodeLibrary(); - equipmentCodeLibrary.setWhere(t); - return equipmentCodeLibraryDao.deleteByWhere(equipmentCodeLibrary); - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentCodeRuleService.java b/src/com/sipai/service/equipment/EquipmentCodeRuleService.java deleted file mode 100644 index 403e739e..00000000 --- a/src/com/sipai/service/equipment/EquipmentCodeRuleService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCodeRuleDao; -import com.sipai.entity.equipment.DynamicCodeCondition; -import com.sipai.entity.equipment.EquipmentCodeRule; -import com.sipai.tools.CommService; - -@Service -public class EquipmentCodeRuleService implements CommService{ - - @Resource - private EquipmentCodeRuleDao equipmentCodeRuleDao; - - - @Override - public EquipmentCodeRule selectById(String t) { - // TODO Auto-generated method stub - return equipmentCodeRuleDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentCodeRuleDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentCodeRule t) { - // TODO Auto-generated method stub - return equipmentCodeRuleDao.insert(t); - - } - - @Override - public int update(EquipmentCodeRule t) { - // TODO Auto-generated method stub - return equipmentCodeRuleDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCodeRule equipmentCodeRule = new EquipmentCodeRule(); - equipmentCodeRule.setWhere(t); - return equipmentCodeRuleDao.selectListByWhere(equipmentCodeRule); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCodeRule equipmentCodeRule = new EquipmentCodeRule(); - equipmentCodeRule.setWhere(t); - return equipmentCodeRuleDao.deleteByWhere(equipmentCodeRule); - } - - public String dynameicSelectCodeByDynInfo(DynamicCodeCondition dcc) { - return equipmentCodeRuleDao.dynameicSelectCodeByDynInfo(dcc); - } -} diff --git a/src/com/sipai/service/equipment/EquipmentCodeService.java b/src/com/sipai/service/equipment/EquipmentCodeService.java deleted file mode 100644 index 1a42c24b..00000000 --- a/src/com/sipai/service/equipment/EquipmentCodeService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCodeDao; -import com.sipai.entity.equipment.EquipmentCode; -import com.sipai.tools.CommService; - -@Service -public class EquipmentCodeService implements CommService{ - - @Resource - private EquipmentCodeDao equipmentCodeDao; - - @Override - public EquipmentCode selectById(String t) { - // TODO Auto-generated method stub - return equipmentCodeDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentCodeDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentCode t) { - // TODO Auto-generated method stub - return equipmentCodeDao.insert(t); - - } - - @Override - public int update(EquipmentCode t) { - // TODO Auto-generated method stub - return equipmentCodeDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCode equipmentCode = new EquipmentCode(); - equipmentCode.setWhere(t); - return equipmentCodeDao.selectListByWhere(equipmentCode); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentCode equipmentCode = new EquipmentCode(); - equipmentCode.setWhere(t); - return equipmentCodeDao.deleteByWhere(equipmentCode); - - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentDialinService.java b/src/com/sipai/service/equipment/EquipmentDialinService.java deleted file mode 100644 index 3c739843..00000000 --- a/src/com/sipai/service/equipment/EquipmentDialinService.java +++ /dev/null @@ -1,1153 +0,0 @@ -package com.sipai.service.equipment; - -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -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.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardDao; -import com.sipai.dao.equipment.EquipmentDialinDao; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentBelong; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentDialin; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.sparepart.SupplierService; -import com.sipai.service.timeefficiency.PatrolPointEquipmentCardService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class EquipmentDialinService implements CommService{ - @Resource - private EquipmentDialinDao equipmentDialinDao; - - @Resource - private UserService userService; - - @Resource - private UnitService untService; - - @Resource - private EquipmentCardDao equipmentCardDao; - @Resource - private GeographyAreaService geographyareaService; - @Resource - private EquipmentPointService equipmentPointService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EquipmentArrangementService equipmentArrangementService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private ExtSystemService extSystemService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentLevelService equipmentLevelService; - @Resource - private AssetClassService assetClassService; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private SupplierService supplierService; - @Resource - private EquipmentCardPropService propService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - @Resource - private EquipmentBelongService equipmentBelongService; - - @Resource - private CompanyService companyService; - - //定义全局变量,当前登录人的id,调用表格导入方法时赋值 - private String insuserId = ""; - - @Override - public EquipmentDialin selectById(String t) { - // TODO Auto-generated method stub - EquipmentDialin ed=equipmentDialinDao.selectByPrimaryKey(t); - return ed; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentDialinDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EquipmentDialin t) { - // TODO Auto-generated method stub - return equipmentDialinDao.insertSelective(t); - - } - - @Override - public int update(EquipmentDialin t) { - // TODO Auto-generated method stub - return equipmentDialinDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentDialin ed = new EquipmentDialin(); - ed.setWhere(t); - return equipmentDialinDao.selectListByWhere(ed); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentDialin ed = new EquipmentDialin(); - ed.setWhere(t); - return equipmentDialinDao.deleteByWhere(ed); - - } - - public List getEquipmentDialinDetail(String where){ - List equipmentDialinList=selectListByWhere(where); - if(null!=equipmentDialinList && equipmentDialinList.size()>0){ - for(EquipmentDialin equDia:equipmentDialinList){ - Company company=untService.getCompById(equDia.getDialinComId()); - if(null!=company && !"".equals(company)){ - equDia.setDialinComName(company.getName()); - } - User userDialin=userService.getUserById(equDia.getDialinId()); - if(null!=userDialin && !"".equals(userDialin)){ - equDia.setDialinName(userDialin.getCaption()); - } - - User userAccept=userService.getUserById(equDia.getAcceptId()); - if(null!=userAccept && !"".equals(userAccept)){ - equDia.setAcceptName(userAccept.getCaption()); - } - } - } - return equipmentDialinList; - } - - /** - * xlsx文件导入 - * @param input - * @return - * @throws IOException - */ - public String readXlsx(InputStream input,String companyId,String userId,String equDialinNum) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(2); - //如果表头小于45列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 45) { - continue; - } - //设备大类 - String equipmentBigClassId=""; - for (int rowNum = 4; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - XSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - EquipmentCard equipmentCard = new EquipmentCard(); - EquipmentCardProp cardProp = new EquipmentCardProp(); - - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell cell = row.getCell(i); - if (cell == null ||null == getStringVal(cell) ) { - continue; - } - try { - switch (i) { - case 1://厂区 - equipmentCard.setBizid(companyId); - break; - case 2://部门 - //String deptId = this.getDeptId(companyId, getStringVal(cell)); - equipmentCard.setResponsibledepartment(getStringVal(cell)); - break; - case 3://工艺段(安装位置) - //String pScetionId = this.getProcessSectionId(companyId, getStringVal(cell)); - String pScetionId = this.getProcessSectionId(getStringVal(cell)); - equipmentCard.setProcesssectionid(pScetionId); - break; - case 4://资产编号 - equipmentCard.setAssetnumber(getStringVal(cell)); - break; - case 5://设备编号Equipmentcardid -/* String equCardId=getStringVal(cell); - if(null==equCardId || "".equals(equCardId)){ - equipmentCard.setId(CommUtil.getUUID()); - }else{ - equipmentCard.setEquipmentcardid(getStringVal(cell)); - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (null != equipmentC) { - equipmentCard.setId(equipmentC.getId()); - }else { - equipmentCard.setId(CommUtil.getUUID()); - } - }*/ - equipmentCard.setEquipmentcardid(getStringVal(cell)); - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (null != equipmentC) { - equipmentCard.setId(equipmentC.getId()); - }else { - equipmentCard.setId(CommUtil.getUUID()); - } - break; - case 6://设备名称 - equipmentCard.setEquipmentname(getStringVal(cell)); - break; - - case 7://财产归属或项目类别 - String equipmentBelongId = getEquipmentBelongId(getStringVal(cell)); - equipmentCard.setEquipmentBelongId(equipmentBelongId); - break; - - case 8://设备大类 - equipmentBigClassId = getEquipmentBigClassId(getStringVal(cell)); - equipmentCard.setEquipmentBigClassId(equipmentBigClassId); - break; - case 9://设备小类 - String equipmentSmallClassId = getEquipmentSmallClassId(equipmentBigClassId,getStringVal(cell)); - equipmentCard.setEquipmentclassid(equipmentSmallClassId); - break; - case 10://设备规格 - String eSpecificationId= getStringVal(cell); - if(null==eSpecificationId || "".equals(eSpecificationId)){ - break; - }else{ - getEquipmentSpecificationId(getStringVal(cell)); - equipmentCard.setSpecification(eSpecificationId); - break; - } - case 11://设备型号 - String equipmentModelId = this.getEquipmentTypeNumberId(getStringVal(cell)); - equipmentCard.setEquipmentmodel(equipmentModelId); - break; - case 12://设备参数(主要参数) - String majorparameter=getStringVal(cell); - if(null==majorparameter || "".equals(majorparameter)){ - break; - }else{ - equipmentCard.setMajorparameter(getStringVal(cell)); - break; - } - - case 13://安装位置 - equipmentCard.setAreaid(getStringVal(cell)); - break; - case 14://制造厂家 - equipmentCard.setEquipmentmanufacturer(getStringVal(cell)); - break; - case 15://总功率 - String rateP = getStringVal(cell); - if (null != rateP && !rateP.isEmpty()) { - equipmentCard.setRatedpower(Double.valueOf(rateP)); - } - break; - case 16://资产类型(资产分类) - String assetClassId=getStringVal(cell); - if(null==assetClassId || "".equals(assetClassId)){ - break; - }else{ - assetClassId=getAssetClassId(getStringVal(cell)); - equipmentCard.setAssetclassid(assetClassId); - break; - } - - case 17://启用日期 - equipmentCard.setUsedate(getStringVal(cell)); - break; - case 18://使用年限 - String useage = getStringVal(cell); - if (null != useage && !useage.isEmpty()) { - equipmentCard.setUseage(Double.valueOf(useage)); - } - break; - case 19://设备等级 - String levelId = this.getEquipmentLevelId(getStringVal(cell)); - equipmentCard.setEquipmentlevelid(levelId); - break; - case 20://有无备用设备 - //equipmentCard.setEquipmentlevelid(cell.toString()); - break; - case 21://采购费--附属表 - String purchaseMoney = getStringVal(cell); - if (null != purchaseMoney && !purchaseMoney.isEmpty()) { - cardProp.setPurchaseMoney(new BigDecimal(purchaseMoney)); - } - break; - case 22://人工费--附属表 - String laborMoney = getStringVal(cell); - if (null != laborMoney && !laborMoney.isEmpty()) { - cardProp.setLaborMoney(new BigDecimal(laborMoney)); - } - break; - case 23://安装日期--附属表 - String installDate=getStringVal(cell); - if(null!=installDate && !"".equals(installDate)){ - cardProp.setInstallDate(getStringVal(cell)); - } - break; - case 24://出厂编号 - String leavefactorynumber=getStringVal(cell); - if(null!=leavefactorynumber && !"".equals(leavefactorynumber)){ - equipmentCard.setLeavefactorynumber(getStringVal(cell)); - } - break; - case 25://出厂日期 - String productiondate=getStringVal(cell); - if(null!=productiondate && !"".equals(productiondate)){ - equipmentCard.setProductiondate(getStringVal(cell)); - } - break; - case 26://购置日期 - String purchasedate=getStringVal(cell); - if(null!=purchasedate && !"".equals(purchasedate)){ - equipmentCard.setPurchasedate(purchasedate); - } - - break; - case 27://供应商 - String supplierId=getStringVal(cell); - if(null!=supplierId && !"".equals(supplierId)){ - equipmentCard.setSupplierid(supplierId); - } - - break; - case 28://功率因素 - //equipmentCard.setPurchasedate(cell); - break; - case 29://扬程 - //equipmentCard.setPurchasedate(cell); - break; - case 30://效率 - //equipmentCard.setPurchasedate(cell); - break; - case 31://服务电话 - String servicephone = getStringVal(cell); - if(null!=servicephone && !"".equals(servicephone)){ - equipmentCard.setServicephone(getStringVal(cell)); - } - - break; - case 32://资产原值 - String equipmentvalue = getStringVal(cell); - if (null != equipmentvalue && !equipmentvalue.isEmpty()) { - equipmentCard.setEquipmentvalue(new BigDecimal(equipmentvalue)); - } - break; - case 33://资产净值 - String residualvalue = getStringVal(cell); - if (null != residualvalue && !residualvalue.isEmpty()) { - equipmentCard.setResidualvalue(new BigDecimal(residualvalue)); - } - break; - case 34://残值率--附属表 - String residualValueRate = getStringVal(cell); - if (null != residualValueRate && !residualValueRate.isEmpty()) { - cardProp.setResidualValueRate(Double.valueOf(residualValueRate)); - } - break; - case 35://是否强检 - //equipmentCard.setServicephone(servicephone); - break; - case 36://首次检定日期 - //equipmentCard.setServicephone(servicephone); - break; - case 37://检定周期 - //equipmentCard.setServicephone(servicephone); - break; - case 38://管理状态 - String equipmentStatus=getStringVal(cell); - if(null!= equipmentStatus || "".equals(equipmentStatus)){ - equipmentCard.setEquipmentstatus(equipmentStatus); - } - - break; - case 39://运行状态 - //equipmentCard.setServicephone(servicephone); - break; - case 40://维修代号 - //equipmentCard.setServicephone(servicephone); - break; - case 41://是否巡检 - //equipmentCard.setServicephone(servicephone); - break; - case 42://是否投保 - //equipmentCard.setServicephone(servicephone); - break; - case 43://瞬时流量--更新到测量点 - String flow = getStringVal(cell); - if (null != flow && !flow.isEmpty()) { - this.updateInstantFlow(companyId, equipmentCard, new BigDecimal(flow)); - } - break; - case 44://能耗--更新到测量点 - String energy = getStringVal(cell); - if (null != energy && !energy.isEmpty()) { - this.updateEnergy(companyId, equipmentCard, new BigDecimal(energy)); - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - if (equipmentCard != null) { - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (equipmentC == null) { - if(null==equipmentCard.getId() || "".equals(equipmentCard.getId())){ - equipmentCard.setId(CommUtil.getUUID()); - } - equipmentCard.setInsuser(insuserId); - equipmentCard.setInsdt(CommUtil.nowDate()); - equipmentCard.setEquipmentDialinNum(equDialinNum); - - if (null == equipmentCard.getEquipmentstatus()|| equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_IN); - } - try { - insertNum += this.equipmentCardDao.insert(equipmentCard); - cardProp.setId(CommUtil.getUUID()); - cardProp.setInsuser(insuserId); - cardProp.setInsdt(CommUtil.nowDate()); - cardProp.setEquipmentId(equipmentCard.getId()); - this.propService.save(cardProp); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - }else { - try { - if (null == equipmentCard.getEquipmentstatus()|| equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_IN); - } - equipmentCard.setEquipmentDialinNum(equDialinNum); - updateNum += this.equipmentCardDao.updateByPrimaryKeySelective(equipmentCard); - EquipmentCardProp prop = this.propService.selectByEquipmentId(equipmentCard.getId()); - prop.setPurchaseMoney(cardProp.getPurchaseMoney()); - prop.setLaborMoney(cardProp.getLaborMoney()); - prop.setInstallDate(cardProp.getInstallDate()); - prop.setResidualValueRate(cardProp.getResidualValueRate()); - this.propService.update(prop); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - - public String readXls(InputStream input,String companyId,String userId,String equDialinNum) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - //如果表头小于45列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 45) { - continue; - } - //设备大类 - String equipmentBigClassId=""; - for (int rowNum = 4; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - EquipmentCard equipmentCard = new EquipmentCard(); - EquipmentCardProp cardProp = new EquipmentCardProp(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null ||null == getStringVal(cell) ) { - continue; - } - try { - switch (i) { - case 1://厂区 - equipmentCard.setBizid(companyId); - break; - case 2://部门 - //String deptId = this.getDeptId(companyId, getStringVal(cell)); - equipmentCard.setResponsibledepartment(getStringVal(cell)); - break; - case 3://工艺段(安装位置) - //String pScetionId = this.getProcessSectionId(companyId, getStringVal(cell)); - String pScetionId = this.getProcessSectionId(getStringVal(cell)); - equipmentCard.setProcesssectionid(pScetionId); - break; - case 4://资产编号 - equipmentCard.setAssetnumber(getStringVal(cell)); - break; - case 5://设备编号Equipmentcardid - /* String equCardId=getStringVal(cell); - if(null==equCardId || "".equals(equCardId)){ - equipmentCard.setId(CommUtil.getUUID()); - }else{ - equipmentCard.setEquipmentcardid(getStringVal(cell)); - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (null != equipmentC) { - equipmentCard.setId(equipmentC.getId()); - }else { - equipmentCard.setId(CommUtil.getUUID()); - } - }*/ - equipmentCard.setEquipmentcardid(getStringVal(cell)); - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (null != equipmentC) { - equipmentCard.setId(equipmentC.getId()); - }else { - equipmentCard.setId(CommUtil.getUUID()); - } - break; - case 6://设备名称 - equipmentCard.setEquipmentname(getStringVal(cell)); - break; - - case 7://财产归属或项目类别 - String equipmentBelongId = getEquipmentBelongId(getStringVal(cell)); - equipmentCard.setEquipmentBelongId(equipmentBelongId); - break; - - case 8://设备大类 - equipmentBigClassId = getEquipmentBigClassId(getStringVal(cell)); - equipmentCard.setEquipmentBigClassId(equipmentBigClassId); - break; - case 9://设备小类 - String equipmentSmallClassId = getEquipmentSmallClassId(equipmentBigClassId,getStringVal(cell)); - equipmentCard.setEquipmentclassid(equipmentSmallClassId); - break; - case 10://设备规格 - String eSpecificationId= getStringVal(cell); - if(null==eSpecificationId || "".equals(eSpecificationId)){ - break; - }else{ - getEquipmentSpecificationId(getStringVal(cell)); - equipmentCard.setSpecification(eSpecificationId); - break; - } - case 11://设备型号 - String equipmentModelId = this.getEquipmentTypeNumberId(getStringVal(cell)); - equipmentCard.setEquipmentmodel(equipmentModelId); - break; - case 12://设备参数(主要参数) - String majorparameter=getStringVal(cell); - if(null==majorparameter || "".equals(majorparameter)){ - break; - }else{ - equipmentCard.setMajorparameter(getStringVal(cell)); - break; - } - - case 13://安装位置 - equipmentCard.setAreaid(getStringVal(cell)); - break; - case 14://制造厂家 - equipmentCard.setEquipmentmanufacturer(getStringVal(cell)); - break; - case 15://总功率 - String rateP = getStringVal(cell); - if (null != rateP && !rateP.isEmpty()) { - equipmentCard.setRatedpower(Double.valueOf(rateP)); - } - break; - case 16://资产类型(资产分类) - String assetClassId=getStringVal(cell); - if(null==assetClassId || "".equals(assetClassId)){ - break; - }else{ - assetClassId=getAssetClassId(getStringVal(cell)); - equipmentCard.setAssetclassid(assetClassId); - break; - } - - case 17://启用日期 - equipmentCard.setUsedate(getStringVal(cell)); - break; - case 18://使用年限 - String useage = getStringVal(cell); - if (null != useage && !useage.isEmpty()) { - equipmentCard.setUseage(Double.valueOf(useage)); - } - break; - case 19://设备等级 - String levelId = this.getEquipmentLevelId(getStringVal(cell)); - equipmentCard.setEquipmentlevelid(levelId); - break; - case 20://有无备用设备 - //equipmentCard.setEquipmentlevelid(cell.toString()); - break; - case 21://采购费--附属表 - String purchaseMoney = getStringVal(cell); - if (null != purchaseMoney && !purchaseMoney.isEmpty()) { - cardProp.setPurchaseMoney(new BigDecimal(purchaseMoney)); - } - break; - case 22://人工费--附属表 - String laborMoney = getStringVal(cell); - if (null != laborMoney && !laborMoney.isEmpty()) { - cardProp.setLaborMoney(new BigDecimal(laborMoney)); - } - break; - case 23://安装日期--附属表 - String installDate=getStringVal(cell); - if(null!=installDate && !"".equals(installDate)){ - cardProp.setInstallDate(getStringVal(cell)); - } - break; - case 24://出厂编号 - String leavefactorynumber=getStringVal(cell); - if(null!=leavefactorynumber && !"".equals(leavefactorynumber)){ - equipmentCard.setLeavefactorynumber(getStringVal(cell)); - } - break; - case 25://出厂日期 - String productiondate=getStringVal(cell); - if(null!=productiondate && !"".equals(productiondate)){ - equipmentCard.setProductiondate(getStringVal(cell)); - } - break; - case 26://购置日期 - String purchasedate=getStringVal(cell); - if(null!=purchasedate && !"".equals(purchasedate)){ - equipmentCard.setPurchasedate(purchasedate); - } - - break; - case 27://供应商 - String supplierId=getStringVal(cell); - if(null!=supplierId && !"".equals(supplierId)){ - equipmentCard.setSupplierid(supplierId); - } - - break; - case 28://功率因素 - //equipmentCard.setPurchasedate(cell); - break; - case 29://扬程 - //equipmentCard.setPurchasedate(cell); - break; - case 30://效率 - //equipmentCard.setPurchasedate(cell); - break; - case 31://服务电话 - String servicephone = getStringVal(cell); - if(null!=servicephone && !"".equals(servicephone)){ - equipmentCard.setServicephone(getStringVal(cell)); - } - - break; - case 32://资产原值 - String equipmentvalue = getStringVal(cell); - if (null != equipmentvalue && !equipmentvalue.isEmpty()) { - equipmentCard.setEquipmentvalue(new BigDecimal(equipmentvalue)); - } - break; - case 33://资产净值 - String residualvalue = getStringVal(cell); - if (null != residualvalue && !residualvalue.isEmpty()) { - equipmentCard.setResidualvalue(new BigDecimal(residualvalue)); - } - break; - case 34://残值率--附属表 - String residualValueRate = getStringVal(cell); - if (null != residualValueRate && !residualValueRate.isEmpty()) { - cardProp.setResidualValueRate(Double.valueOf(residualValueRate)); - } - break; - case 35://是否强检 - //equipmentCard.setServicephone(servicephone); - break; - case 36://首次检定日期 - //equipmentCard.setServicephone(servicephone); - break; - case 37://检定周期 - //equipmentCard.setServicephone(servicephone); - break; - case 38://管理状态 - String equipmentStatus=getStringVal(cell); - if(null!= equipmentStatus || "".equals(equipmentStatus)){ - equipmentCard.setEquipmentstatus(equipmentStatus); - } - - break; - case 39://运行状态 - //equipmentCard.setServicephone(servicephone); - break; - case 40://维修代号 - //equipmentCard.setServicephone(servicephone); - break; - case 41://是否巡检 - //equipmentCard.setServicephone(servicephone); - break; - case 42://是否投保 - //equipmentCard.setServicephone(servicephone); - break; - case 43://瞬时流量--更新到测量点 - String flow = getStringVal(cell); - if (null != flow && !flow.isEmpty()) { - this.updateInstantFlow(companyId, equipmentCard, new BigDecimal(flow)); - } - break; - case 44://能耗--更新到测量点 - String energy = getStringVal(cell); - if (null != energy && !energy.isEmpty()) { - this.updateEnergy(companyId, equipmentCard, new BigDecimal(energy)); - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - if (equipmentCard != null) { - EquipmentCard equipmentC = this.getEquipmentByEquipmentCardId(equipmentCard.getEquipmentcardid()); - if (equipmentC == null) { - if(null==equipmentCard.getId() || "".equals(equipmentCard.getId())){ - equipmentCard.setId(CommUtil.getUUID()); - } - equipmentCard.setInsuser(insuserId); - equipmentCard.setInsdt(CommUtil.nowDate()); - equipmentCard.setEquipmentDialinNum(equDialinNum); - - if (null == equipmentCard.getEquipmentstatus()|| equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_IN); - } - try { - insertNum += this.equipmentCardDao.insert(equipmentCard); - cardProp.setId(CommUtil.getUUID()); - cardProp.setInsuser(insuserId); - cardProp.setInsdt(CommUtil.nowDate()); - cardProp.setEquipmentId(equipmentCard.getId()); - this.propService.save(cardProp); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - }else { - try { - if (null == equipmentCard.getEquipmentstatus()|| equipmentCard.getEquipmentstatus().isEmpty()) { - equipmentCard.setEquipmentstatus(EquipmentCard.Status_IN); - } - equipmentCard.setEquipmentDialinNum(equDialinNum); - updateNum += this.equipmentCardDao.updateByPrimaryKeySelective(equipmentCard); - EquipmentCardProp prop = this.propService.selectByEquipmentId(equipmentCard.getId()); - prop.setPurchaseMoney(cardProp.getPurchaseMoney()); - prop.setLaborMoney(cardProp.getLaborMoney()); - prop.setInstallDate(cardProp.getInstallDate()); - prop.setResidualValueRate(cardProp.getResidualValueRate()); - this.propService.update(prop); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * xls文件数据转换 - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取表格中导入的工艺段id(全厂通用,不绑定厂区id) - * @param companyId - * @param cellValue - * @return - */ - private String getProcessSectionId(String cellValue){ - String ProcessSectionId = ""; - ListpSections = processSectionService.selectListByWhere("where name = '"+cellValue+"'"); - if (pSections!=null && pSections.size()>0) { - ProcessSectionId = pSections.get(0).getId(); - }else { - ProcessSection pSection = new ProcessSection(); - pSection.setId(CommUtil.getUUID()); - pSection.setInsdt(CommUtil.nowDate()); - pSection.setInsuser(insuserId); - pSection.setName(cellValue); - //pSection.setPid(companyId); - pSection.setSname(cellValue); - pSection.setActive(true); - this.processSectionService.save(pSection); - ProcessSectionId = pSection.getId(); - } - return ProcessSectionId; - } - - public EquipmentCard getEquipmentByEquipmentCardId( String equipmentcardid){ - EquipmentCard equipmentCard=new EquipmentCard(); - equipmentCard.setWhere(" where equipmentCardID='"+equipmentcardid+"' order by insdt"); - List list = this.equipmentCardDao.selectListByWhere(equipmentCard); - if (list!= null && list.size()>0) { - return list.get(0); - }else { - return null ; - } - - } - - //2020-07-06 start - /** - * 获取表格中导入的设备归属id - * @param cellValue - * @return - */ - private String getEquipmentBelongId(String cellValue){ - String equipmentBelongId = ""; - List equipmentBelongList = equipmentBelongService.selectListByWhere("where belong_name = '"+cellValue+"'"); - if (equipmentBelongList!=null && equipmentBelongList.size()>0) { - equipmentBelongId = equipmentBelongList.get(0).getId(); - }else { - EquipmentBelong eb = new EquipmentBelong(); - eb.setId(CommUtil.getUUID()); - eb.setInsdt(CommUtil.nowDate()); - eb.setInsuser(insuserId); - eb.setBelongName(cellValue); - eb.setBelongCode(CommUtil.getUUID()); - equipmentBelongService.save(eb); - equipmentBelongId = eb.getId(); - } - return equipmentBelongId; - } - - /** - * 获取表格中导入的设备大类id - * @param cellValue - * @return - */ - private String getEquipmentBigClassId(String cellValue){ - String equipmentBigClassId = ""; - List equipmentBigClassList = this.equipmentClassService.selectListByWhere("where name = '"+cellValue+"'"); - if (equipmentBigClassList!=null && equipmentBigClassList.size()>0) { - equipmentBigClassId = equipmentBigClassList.get(0).getId(); - }else { - EquipmentClass eClass = new EquipmentClass(); - eClass.setId(CommUtil.getUUID()); - eClass.setInsdt(CommUtil.nowDate()); - eClass.setInsuser(insuserId); - eClass.setName(cellValue); - eClass.setActive("1"); - equipmentClassService.save(eClass); - equipmentBigClassId = eClass.getId(); - } - return equipmentBigClassId; - } - - /** - * 获取表格中导入的设备小类id - * @param cellValue - * @return - */ - private String getEquipmentSmallClassId(String equipmentBigClassId,String cellValue){ - String equipmentSmallClassId = ""; - String whereSql = "where name = '"+cellValue+"'"+" and pid='"+equipmentBigClassId+"'"; - List equipmentBigClassList = this.equipmentClassService.selectListByWhere(whereSql); - if (equipmentBigClassList!=null && equipmentBigClassList.size()>0) { - equipmentSmallClassId = equipmentBigClassList.get(0).getId(); - }else { - EquipmentClass eClass = new EquipmentClass(); - eClass.setId(CommUtil.getUUID()); - eClass.setInsdt(CommUtil.nowDate()); - eClass.setInsuser(insuserId); - eClass.setName(cellValue); - eClass.setActive("1"); - eClass.setPid(equipmentBigClassId); - equipmentClassService.save(eClass); - equipmentSmallClassId = eClass.getId(); - } - return equipmentSmallClassId; - } - - /** - * 获取表格中导入的设备规格id - * @param cellValue - * @return - */ - private String getEquipmentSpecificationId(String cellValue){ - String equipmentSpecificationId = ""; - Listspecifications = this.equipmentSpecificationService.selectListByWhere("where name = '"+cellValue+"'"); - if (specifications!=null && specifications.size()>0) { - equipmentSpecificationId = specifications.get(0).getId(); - }else { - EquipmentSpecification eSpecification = new EquipmentSpecification(); - eSpecification.setId(CommUtil.getUUID()); - eSpecification.setInsdt(CommUtil.nowDate()); - eSpecification.setInsuser(insuserId); - eSpecification.setName(cellValue); - eSpecification.setActive("1"); - this.equipmentSpecificationService.save(eSpecification); - equipmentSpecificationId = eSpecification.getId(); - } - return equipmentSpecificationId; - } - - /** - * 获取表格中导入的设备型号id - * @param cellValue - * @return - */ - private String getEquipmentTypeNumberId(String cellValue){ - String equipmentTypeNumberId = ""; - ListtypeNumbers = this.equipmentTypeNumberService.selectListByWhere("where name = '"+cellValue+"'"); - if (typeNumbers!=null && typeNumbers.size()>0) { - equipmentTypeNumberId = typeNumbers.get(0).getId(); - }else { - EquipmentTypeNumber typeNumber = new EquipmentTypeNumber(); - typeNumber.setId(CommUtil.getUUID()); - typeNumber.setInsdt(CommUtil.nowDate()); - typeNumber.setInsuser(insuserId); - typeNumber.setName(cellValue); - typeNumber.setActive("1"); - this.equipmentTypeNumberService.save(typeNumber); - equipmentTypeNumberId = typeNumber.getId(); - } - return equipmentTypeNumberId; - } - - /** - * 获取表格中导入资产类型id - * @param cellValue - * @return - */ - private String getAssetClassId(String cellValue){ - String assetClassId = ""; - ListassetClasses = this.assetClassService.selectListByWhere("where assetClassName = '"+cellValue+"'"); - if (assetClasses!=null && assetClasses.size()>0) { - assetClassId = assetClasses.get(0).getId(); - }else { - AssetClass assetClass = new AssetClass(); - assetClass.setId(CommUtil.getUUID()); - assetClass.setInsdt(CommUtil.nowDate()); - assetClass.setInsuser(insuserId); - assetClass.setAssetclassname(cellValue); - assetClass.setAssetclassnumber(CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); - assetClass.setActive("1"); - this.assetClassService.save(assetClass); - assetClassId = assetClass.getId(); - } - return assetClassId; - } - - /** - * 获取表格中导入设备等级id - * @param cellValue - * @return - */ - private String getEquipmentLevelId(String cellValue){ - String levelId = ""; - ListequipmentLevels = this.equipmentLevelService.selectListByWhere("where levelName = '"+cellValue+"'"); - if (equipmentLevels!=null && equipmentLevels.size()>0) { - levelId = equipmentLevels.get(0).getId(); - }else { - EquipmentLevel equipmentLevel = new EquipmentLevel(); - equipmentLevel.setId(CommUtil.getUUID()); - equipmentLevel.setInsdt(CommUtil.nowDate()); - equipmentLevel.setInsuser(insuserId); - equipmentLevel.setLevelname(cellValue); - equipmentLevel.setActive("1"); - this.equipmentLevelService.save(equipmentLevel); - levelId = equipmentLevel.getId(); - } - return levelId; - } - - /** - * 获取表格中导入瞬时流量数据,瞬时流量测量点命名规则:设备equipmentcardid_instantFlow - * @param cellValue - * @return - */ - private void updateInstantFlow(String companyId,EquipmentCard equipmentCard,BigDecimal cellValue){ - MPoint mPoint = this.mPointService.selectById(companyId, equipmentCard.getEquipmentcardid()+"_instantFlow"); - if (null != mPoint) { - mPoint.setParmvalue(cellValue); - mPoint.setEquipmentid(equipmentCard.getId()); - mPoint.setMeasuredt(CommUtil.nowDate()); - this.mPointService.update(companyId, mPoint); - }else { - MPoint point = new MPoint(); - point.setId(equipmentCard.getEquipmentcardid()+"_instantFlow"); - point.setMpointid(equipmentCard.getEquipmentcardid()+"_instantFlow"); - point.setMpointcode(equipmentCard.getEquipmentcardid()+"_instantFlow"); - point.setParmname(equipmentCard.getEquipmentname()+"_瞬时流量"); - point.setParmvalue(cellValue); - point.setSignaltype("AI"); - point.setBiztype(companyId); - point.setValuetype("sql"); - point.setActive("1"); - point.setEquipmentid(equipmentCard.getId()); - point.setSourceType("data"); - this.mPointService.save(companyId, point); - } - } - - /** - * 获取表格中导入能耗(电量),命名规则设备id_energy - * @param cellValue - * @return - */ - private void updateEnergy(String companyId,EquipmentCard equipmentCard,BigDecimal cellValue){ - MPoint mPoint = this.mPointService.selectById(companyId, equipmentCard.getEquipmentcardid()+"_energy"); - if (null != mPoint) { - mPoint.setParmvalue(cellValue); - mPoint.setEquipmentid(equipmentCard.getId()); - mPoint.setMeasuredt(CommUtil.nowDate()); - this.mPointService.update(companyId, mPoint); - }else { - MPoint point = new MPoint(); - point.setId(equipmentCard.getEquipmentcardid()+"_energy"); - point.setMpointid(equipmentCard.getEquipmentcardid()+"_energy"); - point.setMpointcode(equipmentCard.getEquipmentcardid()+"_energy"); - point.setParmname(equipmentCard.getEquipmentname()+"_能耗"); - point.setParmvalue(cellValue); - point.setSignaltype("AI"); - point.setBiztype(companyId); - point.setValuetype("sql"); - point.setActive("1"); - point.setEquipmentid(equipmentCard.getId()); - point.setSourceType("data"); - this.mPointService.save(companyId, point); - } - } -} diff --git a/src/com/sipai/service/equipment/EquipmentFileService.java b/src/com/sipai/service/equipment/EquipmentFileService.java deleted file mode 100644 index 386d355d..00000000 --- a/src/com/sipai/service/equipment/EquipmentFileService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentClassDao; -import com.sipai.dao.equipment.EquipmentFileDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentFile; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentFileService implements CommService{ - @Resource - private EquipmentFileDao equipmentFileDao; - - @Override - public EquipmentFile selectById(String id) { - return this.equipmentFileDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentFileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentFile equipmentFile) { - return this.equipmentFileDao.insert(equipmentFile); - } - - @Override - public int update(EquipmentFile equipmentFile) { - return this.equipmentFileDao.updateByPrimaryKeySelective(equipmentFile); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentFile equipmentFile = new EquipmentFile(); - equipmentFile.setWhere(wherestr); - return this.equipmentFileDao.selectListByWhere(equipmentFile); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentFile equipmentFile = new EquipmentFile(); - equipmentFile.setWhere(wherestr); - return this.equipmentFileDao.deleteByWhere(equipmentFile); - } - /** - * 根据设备id查询设备关联的文件id - * @param equipmentId - * @return - */ - public String getFileIds(String equipmentId){ - ListequipmentFiles =this.selectListByWhere("where equipment_id in ('"+equipmentId+"') order by insdt desc"); - String fileIds = ""; - if (null!= equipmentFiles && equipmentFiles.size()>0) { - for (EquipmentFile equipmentFile :equipmentFiles) { - if (fileIds!="") { - fileIds+=","; - } - fileIds+=equipmentFile.getFileId(); - } - } - return fileIds; - } - - -} diff --git a/src/com/sipai/service/equipment/EquipmentFittingsService.java b/src/com/sipai/service/equipment/EquipmentFittingsService.java deleted file mode 100644 index 75fa5168..00000000 --- a/src/com/sipai/service/equipment/EquipmentFittingsService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import com.sipai.entity.equipment.EquipmentFittings; - -public interface EquipmentFittingsService { - - public abstract EquipmentFittings selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EquipmentFittings equipmentFittings); - - public abstract int update(EquipmentFittings equipmentFittings); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectListWithEQByWhere(String wherestr); - - public abstract List selectListWithFaByWhere(String wherestr); -} diff --git a/src/com/sipai/service/equipment/EquipmentIncreaseValueService.java b/src/com/sipai/service/equipment/EquipmentIncreaseValueService.java deleted file mode 100644 index b75fb058..00000000 --- a/src/com/sipai/service/equipment/EquipmentIncreaseValueService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentIncreaseValueDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentIncreaseValue; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentIncreaseValueService implements CommService{ - @Resource - private EquipmentIncreaseValueDao equipmentIncreaseValueDao; - - public List selectList() { - // TODO Auto-generated method stub - EquipmentIncreaseValue equipmentIncreaseValue = new EquipmentIncreaseValue(); - return this.equipmentIncreaseValueDao.selectList(equipmentIncreaseValue); - } - - - @Override - public EquipmentIncreaseValue selectById(String id) { - return this.equipmentIncreaseValueDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentIncreaseValueDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentIncreaseValue equipmentIncreaseValue) { - return this.equipmentIncreaseValueDao.insert(equipmentIncreaseValue); - } - - @Override - public int update(EquipmentIncreaseValue equipmentIncreaseValue) { - return this.equipmentIncreaseValueDao.updateByPrimaryKeySelective(equipmentIncreaseValue); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentIncreaseValue equipmentIncreaseValue = new EquipmentIncreaseValue(); - equipmentIncreaseValue.setWhere(wherestr); - return this.equipmentIncreaseValueDao.selectListByWhere(equipmentIncreaseValue); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentIncreaseValue equipmentIncreaseValue = new EquipmentIncreaseValue(); - equipmentIncreaseValue.setWhere(wherestr); - return this.equipmentIncreaseValueDao.deleteByWhere(equipmentIncreaseValue); - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentLevelService.java b/src/com/sipai/service/equipment/EquipmentLevelService.java deleted file mode 100644 index cf36e899..00000000 --- a/src/com/sipai/service/equipment/EquipmentLevelService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentLevelDao; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.tools.CommService; -@Service -public class EquipmentLevelService implements CommService{ - @Resource - private EquipmentLevelDao equipmentLevelDao; - - @Override - public EquipmentLevel selectById(String id) { - return this.equipmentLevelDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentLevelDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentLevel equipmentLevel) { - return this.equipmentLevelDao.insert(equipmentLevel); - } - - @Override - public int update(EquipmentLevel equipmentLevel) { - return this.equipmentLevelDao.updateByPrimaryKeySelective(equipmentLevel); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentLevel equipmentLevel = new EquipmentLevel(); - equipmentLevel.setWhere(wherestr); - return equipmentLevelDao.selectListByWhere(equipmentLevel); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentLevel equipmentLevel = new EquipmentLevel(); - equipmentLevel.setWhere(wherestr); - return this.equipmentLevelDao.deleteByWhere(equipmentLevel); - } - - -} diff --git a/src/com/sipai/service/equipment/EquipmentLoseApplyDetailService.java b/src/com/sipai/service/equipment/EquipmentLoseApplyDetailService.java deleted file mode 100644 index be59afaf..00000000 --- a/src/com/sipai/service/equipment/EquipmentLoseApplyDetailService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentLoseApplyDetailDao; -import com.sipai.entity.equipment.EquipmentLoseApplyDetail; -import com.sipai.tools.CommService; - -@Service -public class EquipmentLoseApplyDetailService implements CommService{ - @Resource - private EquipmentLoseApplyDetailDao equipmentLoseApplyDetailDao; - - @Override - public EquipmentLoseApplyDetail selectById(String t) { - EquipmentLoseApplyDetail elad=equipmentLoseApplyDetailDao.selectByPrimaryKey(t); - return elad; - } - - @Override - public int deleteById(String t) { - int resultNum=equipmentLoseApplyDetailDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(EquipmentLoseApplyDetail t) { - int resultNum=equipmentLoseApplyDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentLoseApplyDetail t) { - int resultNum=equipmentLoseApplyDetailDao.updateByWhere(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentLoseApplyDetail elad=new EquipmentLoseApplyDetail(); - elad.setWhere(t); - return equipmentLoseApplyDetailDao.selectListByWhere(elad); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentLoseApplyDetail elad=new EquipmentLoseApplyDetail(); - elad.setWhere(t); - return equipmentLoseApplyDetailDao.deleteByWhere(elad); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentLoseApplyService.java b/src/com/sipai/service/equipment/EquipmentLoseApplyService.java deleted file mode 100644 index df12fc41..00000000 --- a/src/com/sipai/service/equipment/EquipmentLoseApplyService.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentLoseApplyDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.StockCheck; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentLoseApplyService implements CommService{ - @Resource - private EquipmentLoseApplyDao equipmentLoseApplyDao; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - - @Override - public EquipmentLoseApply selectById(String t) { - EquipmentLoseApply ela=equipmentLoseApplyDao.selectByPrimaryKey(t); - return ela; - } - - @Transactional - @Override - public int deleteById(String t) { - try { - EquipmentLoseApply loseApply = equipmentLoseApplyDao.selectByPrimaryKey(t); - String pInstancId = loseApply.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - int resultNum =equipmentLoseApplyDao.deleteByPrimaryKey(t); - return resultNum; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(EquipmentLoseApply t) { - int resultNum=equipmentLoseApplyDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentLoseApply t) { - int resultNum=equipmentLoseApplyDao.updateByWhere(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentLoseApply ela=new EquipmentLoseApply(); - ela.setWhere(t); - List elaList=equipmentLoseApplyDao.selectListByWhere(ela); - return elaList; - } - - @Transactional - @Override - public int deleteByWhere(String t) { - try { - EquipmentLoseApply ela=new EquipmentLoseApply(); - ela.setWhere(t); - Listlist = equipmentLoseApplyDao.selectListByWhere(ela); - if (list!=null && list.size()>0) { - for (EquipmentLoseApply item : list) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - int resultNum=equipmentLoseApplyDao.deleteByWhere(ela); - return resultNum; - }catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - public EquipmentLoseApply selectEquipmentOtherInfoById(String id){ - return equipmentLoseApplyDao.selectEquipmentOtherInfoById(id); - } - - /** - * 启动设备丢失审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(EquipmentLoseApply equipmentLoseApply) { - try { - Map variables = new HashMap(); - if(!equipmentLoseApply.getAuditId().isEmpty()){ - variables.put("userIds", equipmentLoseApply.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Lose_Apply.getId()+"-"+equipmentLoseApply.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(equipmentLoseApply.getId(), equipmentLoseApply.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - equipmentLoseApply.setProcessid(processInstance.getId()); - equipmentLoseApply.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentLoseApply.getProcessid()).singleResult(); - equipmentLoseApply.setStatus(task.getName()); - EquipmentLoseApply loseApply = this.selectById(equipmentLoseApply.getId()); - int res = 0; - if(null == loseApply){ - res = this.save(equipmentLoseApply); - }else { - res = this.update(equipmentLoseApply); - } - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentLoseApply); - businessUnitRecord.sendMessage(equipmentLoseApply.getAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - EquipmentLoseApply equipmentLoseApply = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentLoseApply.getProcessid()).singleResult(); - if (task!=null) { - equipmentLoseApply.setStatus(task.getName()); - }else{ - equipmentLoseApply.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - } - int res =this.update(equipmentLoseApply); - return res; - } - /** - * 丢失申请审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } -} diff --git a/src/com/sipai/service/equipment/EquipmentMaintainService.java b/src/com/sipai/service/equipment/EquipmentMaintainService.java deleted file mode 100644 index 85f295ab..00000000 --- a/src/com/sipai/service/equipment/EquipmentMaintainService.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.service.equipment; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.List; -import java.util.Properties; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Service; - - - - - - - -import com.sipai.dao.equipment.EquipmentMaintainDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentMaintain; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentMaintainService implements CommService{ - @Resource - private EquipmentMaintainDao equipmentmaintainDao; - @Override - public EquipmentMaintain selectById(String id) { - return equipmentmaintainDao.selectByPrimaryKey(id); - } - @Override - public int deleteById(String id) { - return equipmentmaintainDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentMaintain equipmentmaintain) { - return equipmentmaintainDao.insert(equipmentmaintain); - } - - @Override - public int update(EquipmentMaintain equipmentmaintain) { - return equipmentmaintainDao.updateByPrimaryKeySelective(equipmentmaintain); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentMaintain equipmentmaintain = new EquipmentMaintain(); - equipmentmaintain.setWhere(wherestr); - return equipmentmaintainDao.selectListByWhere(equipmentmaintain); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentMaintain equipmentmaintain = new EquipmentMaintain(); - equipmentmaintain.setWhere(wherestr); - return equipmentmaintainDao.deleteByWhere(equipmentmaintain); - } - - public List getEquipmentMaintain(String wherestr){ - EquipmentMaintain equipmentmaintain=new EquipmentMaintain(); - equipmentmaintain.setWhere(wherestr); - return this.equipmentmaintainDao.getEquipmentMaintain(equipmentmaintain); - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentParamsetDetailService.java b/src/com/sipai/service/equipment/EquipmentParamsetDetailService.java deleted file mode 100644 index 66215b68..00000000 --- a/src/com/sipai/service/equipment/EquipmentParamsetDetailService.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentParamsetDetailDao; -import com.sipai.entity.equipment.EquipmentParamset; -import com.sipai.entity.equipment.EquipmentParamsetDetail; -import com.sipai.entity.equipment.EquipmentParamsetValue; -import com.sipai.tools.CommService; - -@Service -public class EquipmentParamsetDetailService implements CommService{ - - @Resource - private EquipmentParamsetDetailDao equipmentParamsetDetailDao; - @Resource - private EquipmentParamsetService equipmentParamsetService; - @Resource - private EquipmentParamsetValueService equipmentParamsetValueService; - @Resource - private EquipmentClassService equipmentClassService; - - @Override - public EquipmentParamsetDetail selectById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetDetailDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetDetailDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentParamsetDetail t) { - // TODO Auto-generated method stub - return equipmentParamsetDetailDao.insertSelective(t); - - } - - @Override - public int update(EquipmentParamsetDetail t) { - // TODO Auto-generated method stub - return equipmentParamsetDetailDao.updateByPrimaryKeySelective(t); - - } - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamsetDetail equipmentParamsetDetail = new EquipmentParamsetDetail(); - equipmentParamsetDetail.setWhere(t); - List list = equipmentParamsetDetailDao.selectListByWhere(equipmentParamsetDetail); - for (EquipmentParamsetDetail item : list) { - if(item.getEquipmentClassId()!=null){ - item.setEquipmentClass(this.equipmentClassService.selectById(item.getEquipmentClassId())); - } - if(item.getParamId()!=null){ - item.setEquipmentParamset(this.equipmentParamsetService.selectById(item.getParamId())); - } - } - return list; - - } - - public List selectListByWhere4Eq(String EquipmentId,String t) { - // TODO Auto-generated method stub - EquipmentParamsetDetail equParamsetDetail = new EquipmentParamsetDetail(); - equParamsetDetail.setWhere(t); - List equipmentParamsetDetails = equipmentParamsetDetailDao.selectListByWhere(equParamsetDetail); - if(equipmentParamsetDetails!=null&&equipmentParamsetDetails.size()>0){ - for (EquipmentParamsetDetail item : equipmentParamsetDetails) { - item.setEquipmentParamset(this.equipmentParamsetService.selectById(item.getParamId())); - List valueList = this.equipmentParamsetValueService.selectListByWhere("where detail_id = '"+item.getId()+"' and equipment_id = '"+EquipmentId+"'"); - if(valueList!=null&&valueList.size()==1){ - item.setEquipmentParamsetValue(valueList.get(0)); - } - } - } - return equipmentParamsetDetails; - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamsetDetail equParamsetDetail = new EquipmentParamsetDetail(); - equParamsetDetail.setWhere(t); - return equipmentParamsetDetailDao.deleteByWhere(equParamsetDetail); - - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentParamsetService.java b/src/com/sipai/service/equipment/EquipmentParamsetService.java deleted file mode 100644 index 1a19a157..00000000 --- a/src/com/sipai/service/equipment/EquipmentParamsetService.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.equipment.EquipmentParamsetDao; -import com.sipai.entity.equipment.EquipmentParamSetVO; -import com.sipai.entity.equipment.EquipmentParamset; -import com.sipai.tools.CommService; - -@Service -public class EquipmentParamsetService implements CommService{ - - @Resource - private EquipmentParamsetDao equipmentParamsetDao; - - @Override - public EquipmentParamset selectById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentParamset t) { - // TODO Auto-generated method stub - return equipmentParamsetDao.insertSelective(t); - } - - @Override - public int update(EquipmentParamset t) { - // TODO Auto-generated method stub - return equipmentParamsetDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamset equParamSet = new EquipmentParamset(); - equParamSet.setWhere(t); - return equipmentParamsetDao.selectListByWhere(equParamSet); - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamset equParamSet = new EquipmentParamset(); - equParamSet.setWhere(t); - return equipmentParamsetDao.deleteByWhere(equParamSet); - } - - - public JSONArray getEquipmentParamSetTreeJson(List equParamSetList, - JSONArray jsonArray) { - - - for (int i = 0; i < equParamSetList.size(); i++) { - JSONObject jsonObject = new JSONObject(); - String id=equParamSetList.get(i).getId(); - String name=equParamSetList.get(i).getName(); - jsonObject.put("id",id); - jsonObject.put("text",name); - - List equiParamSets=selectListByWhere(" where pid ='"+id+"'"); - if(equiParamSets.size()!=0 ){ - JSONArray jsonArrayTemp = new JSONArray(); - JSONArray sonTreeByPid = getEquipmentParamSetTreeJson(equiParamSets, jsonArrayTemp); - jsonObject.put("nodes", sonTreeByPid); - } - if(null!=jsonObject){ - jsonArray.add(jsonObject); - } - //jsonArray.add(jsonObject); - } - - return jsonArray; - } - - public List selectEquipmentParamSetDetail(String equipmentClassId){ - return equipmentParamsetDao.selectEquipmentParamSetDetail(equipmentClassId); - } -} - - diff --git a/src/com/sipai/service/equipment/EquipmentParamsetStatusEvaluationService.java b/src/com/sipai/service/equipment/EquipmentParamsetStatusEvaluationService.java deleted file mode 100644 index f497100e..00000000 --- a/src/com/sipai/service/equipment/EquipmentParamsetStatusEvaluationService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentParamsetStatusEvaluationDao; -import com.sipai.entity.equipment.EquipmentParamsetStatusEvaluation; -import com.sipai.tools.CommService; - -@Service -public class EquipmentParamsetStatusEvaluationService implements CommService{ - - @Resource - private EquipmentParamsetStatusEvaluationDao equipmentParamsetStatusEvaluationDao; - - @Override - public EquipmentParamsetStatusEvaluation selectById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetStatusEvaluationDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetStatusEvaluationDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentParamsetStatusEvaluation t) { - // TODO Auto-generated method stub - return equipmentParamsetStatusEvaluationDao.insertSelective(t); - - } - - @Override - public int update(EquipmentParamsetStatusEvaluation t) { - // TODO Auto-generated method stub - return equipmentParamsetStatusEvaluationDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamsetStatusEvaluation equParamsetDetail = new EquipmentParamsetStatusEvaluation(); - equParamsetDetail.setWhere(t); - return equipmentParamsetStatusEvaluationDao.selectListByWhere(equParamsetDetail); - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamsetStatusEvaluation equParamsetDetail = new EquipmentParamsetStatusEvaluation(); - equParamsetDetail.setWhere(t); - return equipmentParamsetStatusEvaluationDao.deleteByWhere(equParamsetDetail); - - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentParamsetValueService.java b/src/com/sipai/service/equipment/EquipmentParamsetValueService.java deleted file mode 100644 index 26d0f3d5..00000000 --- a/src/com/sipai/service/equipment/EquipmentParamsetValueService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentParamsetValueDao; -import com.sipai.entity.equipment.EquipmentParamsetValue; -import com.sipai.tools.CommService; - -@Service -public class EquipmentParamsetValueService implements CommService{ - - @Resource - private EquipmentParamsetValueDao equipmentParamsetValueDao; - - @Override - public EquipmentParamsetValue selectById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetValueDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentParamsetValueDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentParamsetValue t) { - // TODO Auto-generated method stub - return equipmentParamsetValueDao.insertSelective(t); - - } - - @Override - public int update(EquipmentParamsetValue t) { - // TODO Auto-generated method stub - return equipmentParamsetValueDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamsetValue equParamsetValue = new EquipmentParamsetValue(); - equParamsetValue.setWhere(t); - return equipmentParamsetValueDao.selectListByWhere(equParamsetValue); - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentParamsetValue equParamsetValue = new EquipmentParamsetValue(); - equParamsetValue.setWhere(t); - return equipmentParamsetValueDao.deleteByWhere(equParamsetValue); - - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentPointService.java b/src/com/sipai/service/equipment/EquipmentPointService.java deleted file mode 100644 index 286be286..00000000 --- a/src/com/sipai/service/equipment/EquipmentPointService.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - - - - - - - -import com.sipai.dao.equipment.EquipmentPointDao; -import com.sipai.entity.equipment.EquipmentPoint; -import com.sipai.tools.CommService; - -@Service -public class EquipmentPointService implements CommService{ - @Resource - private EquipmentPointDao equipmentPointDao; - - - public List selectList() { - // TODO Auto-generated method stub - EquipmentPoint equipmentPoint = new EquipmentPoint(); - return this.equipmentPointDao.selectList(equipmentPoint); - } - - - @Override - public EquipmentPoint selectById(String id) { - return this.equipmentPointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentPoint entity) { - return this.equipmentPointDao.insert(entity); - } - - @Override - public int update(EquipmentPoint t) { - return this.equipmentPointDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentPoint equipmentPoint = new EquipmentPoint(); - equipmentPoint.setWhere(wherestr); - return this.equipmentPointDao.selectListByWhere(equipmentPoint); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentPoint equipmentPoint = new EquipmentPoint(); - equipmentPoint.setWhere(wherestr); - return this.equipmentPointDao.deleteByWhere(equipmentPoint); - } - /** - * 判断接口是否未被占用 - * @param id - * @param interfacetype - * @return - */ - public boolean checkNotOccupied(String id, String interfacetype) { - List list = this.selectListByWhere(" where interfacetype='"+interfacetype+"' order by insdt"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(EquipmentPoint equipmentPoint :list){ - if(!id.equals(equipmentPoint.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } -} diff --git a/src/com/sipai/service/equipment/EquipmentRemarkService.java b/src/com/sipai/service/equipment/EquipmentRemarkService.java deleted file mode 100644 index 8f4adee0..00000000 --- a/src/com/sipai/service/equipment/EquipmentRemarkService.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.service.equipment; - -import com.sipai.dao.equipment.EquipmentCardRemarkDao; -import com.sipai.entity.equipment.*; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.*; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.*; -import java.util.*; - - -@Service("equipmentRemarkService") -public class EquipmentRemarkService implements CommService { - - @Resource - private EquipmentCardRemarkDao equipmentCardRemarkDao; - - @Resource - private UserService userService; - - @Override - public EquipmentCardRemark selectById(String t) { - EquipmentCardRemark equipmentCardRemark = equipmentCardRemarkDao.selectByPrimaryKey(t); - return equipmentCardRemark; - } - - @Override - public int deleteById(String t) { - int i = equipmentCardRemarkDao.deleteByPrimaryKey(t); - return i; - } - - @Override - public int save(EquipmentCardRemark equipmentCardRemark) { - int insert = equipmentCardRemarkDao.insert(equipmentCardRemark); - return insert; - } - - @Override - public int update(EquipmentCardRemark equipmentCardRemark) { - return equipmentCardRemarkDao.updateByPrimaryKeySelective(equipmentCardRemark); - } - - @Override - public List selectListByWhere(String t) { - EquipmentCardRemark equipmentCardRemark = new EquipmentCardRemark(); - equipmentCardRemark.setWhere(t); - List equipmentCardRemarks = equipmentCardRemarkDao.selectListByWhere(equipmentCardRemark); - for (EquipmentCardRemark equipmentCardRemark1 : equipmentCardRemarks) { - if(StringUtils.isNotBlank(equipmentCardRemark1.getInsUser())) { - User user = userService.getUserById(equipmentCardRemark1.getInsUser()); - equipmentCardRemark1.setUserName(user == null ? "-" : user.getCaption()); - } - } - return equipmentCardRemarks; - } - - @Override - public int deleteByWhere(String t) { - EquipmentCardRemark equipmentCardRemark = new EquipmentCardRemark(); - equipmentCardRemark.setWhere(t); - return equipmentCardRemarkDao.deleteByWhere(equipmentCardRemark); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentRepairPlanService.java b/src/com/sipai/service/equipment/EquipmentRepairPlanService.java deleted file mode 100644 index 60c8fea9..00000000 --- a/src/com/sipai/service/equipment/EquipmentRepairPlanService.java +++ /dev/null @@ -1,401 +0,0 @@ -package com.sipai.service.equipment; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.h2.table.Plan; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.equipment.EquipmentLevelDao; -import com.sipai.dao.equipment.EquipmentRepairPlanDao; -import com.sipai.dao.equipment.MaintenancePlanDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.EquipmentRepairPlan; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.RoleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -@Service -public class EquipmentRepairPlanService implements CommService{ - @Resource - private EquipmentRepairPlanDao equipmentRepairPlanDao; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private RoleService roleService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - - @Override - public EquipmentRepairPlan selectById(String id) { - EquipmentRepairPlan maintenancePlan = this.equipmentRepairPlanDao.selectByPrimaryKey(id); - if (null!= maintenancePlan && null != maintenancePlan.getBizId()&& !maintenancePlan.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(maintenancePlan.getBizId()); - maintenancePlan.setCompany(company); - } - if (null!= maintenancePlan &&null != maintenancePlan.getProcessSectionId()&& !maintenancePlan.getProcessSectionId().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(maintenancePlan.getProcessSectionId()); - maintenancePlan.setProcessSection(processSection); - } - if (null!= maintenancePlan &&null != maintenancePlan.getEquipmentId()&& !maintenancePlan.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(maintenancePlan.getEquipmentId()); - maintenancePlan.setEquipmentCard(equipmentCard); - } - if (null!= maintenancePlan &&null != maintenancePlan.getAuditId()&& !maintenancePlan.getAuditId().isEmpty()) { - User user = this.userService.getUserById(maintenancePlan.getAuditId()); - maintenancePlan.setAuditMan(user.getCaption()); - } - return maintenancePlan; - } - @Transactional - @Override - public int deleteById(String t) { - try { - EquipmentRepairPlan maintenancePlan = equipmentRepairPlanDao.selectByPrimaryKey(t); - String pInstancId = maintenancePlan.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - int resultNum =equipmentRepairPlanDao.deleteByPrimaryKey(t); - return resultNum; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(EquipmentRepairPlan maintenancePlan) { - return this.equipmentRepairPlanDao.insert(maintenancePlan); - } - - @Override - public int update(EquipmentRepairPlan maintenancePlan) { - return this.equipmentRepairPlanDao.updateByPrimaryKeySelective(maintenancePlan); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentRepairPlan maintenancePlan = new EquipmentRepairPlan(); - maintenancePlan.setWhere(wherestr); - List list = this.equipmentRepairPlanDao.selectListByWhere(maintenancePlan); - for (EquipmentRepairPlan item : list) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); - item.setProcessSection(processSection); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - return list; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - EquipmentRepairPlan maintenancePlan = new EquipmentRepairPlan(); - maintenancePlan.setWhere(wherestr); - Listlist = equipmentRepairPlanDao.selectListByWhere(maintenancePlan); - if (list!=null && list.size()>0) { - for (EquipmentRepairPlan item : list) { - String pInstancId = item.getProcessid(); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(pInstancId) - .singleResult(); - if(pInstance != null){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - int resultNum=equipmentRepairPlanDao.deleteByWhere(maintenancePlan); - return resultNum; - }catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 下发保养计划,返回为1为下发成功,其它都为下发失败 - */ - @Transactional - public int issueMaintainPlan(EquipmentRepairPlan maintenancePlan) { - try { -// boolean flag=checkExist(maintenancePlan); -// if (flag) { -// return MaintenanceCommString.Response_StartProcess_PlanIssued; -// } - Date nowTime = new Date(); - //当前时间,加时分秒毫秒 - SimpleDateFormat sdformat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - String dateStr = sdformat.format(nowTime); - //当前日期 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setId(CommUtil.getUUID()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - /*Calendar calendar = Calendar.getInstance(); - calendar.setTime(nowTime); - calendar.add(Calendar.DAY_OF_MONTH, maintenancePlan.getPlanConsumeTime()); - maintenanceDetail.setPlannedenddt(sdf.format(calendar.getTime()));*/ - maintenanceDetail.setInsuser(maintenancePlan.getInsuser()); - maintenanceDetail.setDetailNumber(maintenancePlan.getCompany().getEname()+"-WXJL-"+dateStr); - maintenanceDetail.setCompanyid(maintenancePlan.getBizId()); - maintenanceDetail.setEquipmentId(maintenancePlan.getEquipmentId()); - maintenanceDetail.setPlannedenddt(maintenancePlan.getInitialDate()); - maintenanceDetail.setProcessSectionId(maintenancePlan.getProcessSectionId()); - maintenanceDetail.setType(MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - List users =roleService.getRoleUsers("where serial='"+PatrolType.Maintenance.getId()+"' and bizid='"+maintenancePlan.getBizId()+"'"); - String userIds=""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds+=","; - } - userIds+=user.getId(); - } - maintenanceDetail.setSolver(userIds); - - //maintenanceDetail.setPlanConsumeTime(maintenancePlan.getPlanConsumeTime()); - maintenanceDetail.setMaintenanceWay(maintenancePlan.getMaintenanceWay()); - maintenanceDetail.setPlanMoney(maintenancePlan.getPlanMoney()); - maintenanceDetail.setProblemcontent(maintenancePlan.getContent()); - int result= this.maintenanceDetailService.start(maintenanceDetail); - if (result==1) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setId(CommUtil.getUUID()); - planRecordAbnormity.setInsdt(CommUtil.nowDate()); - planRecordAbnormity.setFatherId(maintenancePlan.getId()); - planRecordAbnormity.setSonId(maintenanceDetail.getId()); - result =planRecordAbnormityService.save(planRecordAbnormity); - if (result==1) { - return result; - }else{ - throw new RuntimeException(); - } - }else{ - return result; - } - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - /** - * 是否已下发,如果是月计划,查询本月有没有记录,如果是年计划,查询本年内有没有记录 - * 月计划每月下发一条,年计划按下发时间,每年下发一条 - * @param id - * @param planNumber - * @return - */ - public boolean checkExist(EquipmentRepairPlan maintenancePlan) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //本月开始时间 - Calendar cal = Calendar.getInstance(); - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); - String monthStart = sdf.format(cal.getTime()); - //本月结束时间 - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); - cal.set(Calendar.HOUR_OF_DAY, 24); - String monthEnd = sdf.format(cal.getTime()); - //本年开始时间 - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); - cal.set(Calendar.MONTH, cal.getActualMinimum(Calendar.JANUARY)); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); - String yearStart = sdf.format(cal.getTime()); - //本年结束时间 - cal.setTime(cal.getTime()); - cal.add(Calendar.YEAR, 1); - String yearEnd = sdf.format(cal.getTime()); - //查询字段的开始时间和结束时间 - String start = ""; - String end = ""; - try { - if (MaintenanceCommString.MAINTAIN_MONTH.equals(maintenancePlan.getPlanType())) { - start = monthStart; - end = monthEnd; - }else { - start = yearStart; - end = yearEnd; - } - List planRecordAbnormities=planRecordAbnormityService.selectListByWhere( - "where father_id='"+maintenancePlan.getId()+"'and insdt > '"+start+"' and insdt < '"+end+"' order by insdt desc"); - if (planRecordAbnormities.size()==0) { - return false; - }else { - return true; - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return false; - } - /** - * 是否未被占用 - * @param id - * @param planNumber - * @return - */ - public boolean checkNotOccupied(String id, String planNumber) { - List list = this.selectListByWhere(" where plan_number ='"+planNumber+"' order by insdt"); - if(id == null){//新增 - if(list!=null && list.size()>0){ - return true; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(EquipmentRepairPlan maintenancePlan :list){ - if(!id.equals(maintenancePlan.getId())){//不是当前编辑的那条记录 - return true; - } - } - } - } - return false; - } - /** - * 发起保养计划审核 - * @param maintenanceDetail - * @return - */ - @Transactional - public int startPlanAudit(EquipmentRepairPlan maintenancePlan) { - try { - Map variables = new HashMap(); - if(!maintenancePlan.getAuditId().isEmpty()){ - variables.put("userIds", maintenancePlan.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = null; - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Repair_Plan.getId()+"-"+maintenancePlan.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(maintenancePlan.getId(), maintenancePlan.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - maintenancePlan.setProcessid(processInstance.getId()); - maintenancePlan.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - EquipmentRepairPlan mPlan = selectById(maintenancePlan.getId()); - int res = 0; - if (null == mPlan) { - res = save(maintenancePlan); - }else { - res = update(maintenancePlan); - } - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenancePlan); - businessUnitRecord.sendMessage(maintenancePlan.getAuditId(),""); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 保养计划审核审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - EquipmentRepairPlan maintenancePlan = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(maintenancePlan.getProcessid()).singleResult(); - if (task!=null) { - maintenancePlan.setActive(task.getName()); - }else{ - maintenancePlan.setActive(MaintenanceCommString.PLAN_FINISH); - } - int res =this.update(maintenancePlan); - return res; - } -} diff --git a/src/com/sipai/service/equipment/EquipmentSaleApplyDetailService.java b/src/com/sipai/service/equipment/EquipmentSaleApplyDetailService.java deleted file mode 100644 index 024ebf0b..00000000 --- a/src/com/sipai/service/equipment/EquipmentSaleApplyDetailService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentSaleApplyDetailDao; -import com.sipai.entity.equipment.EquipmentSaleApplyDetail; -import com.sipai.tools.CommService; - -@Service -public class EquipmentSaleApplyDetailService implements CommService{ - @Resource - private EquipmentSaleApplyDetailDao equipmentSaleApplyDetailDao; - - @Override - public EquipmentSaleApplyDetail selectById(String t) { - EquipmentSaleApplyDetail esad= equipmentSaleApplyDetailDao.selectByPrimaryKey(t); - // TODO Auto-generated method stub - return esad; - } - - @Override - public int deleteById(String t) { - int resultNum= equipmentSaleApplyDetailDao.deleteByPrimaryKey(t); - // TODO Auto-generated method stub - return resultNum; - } - - @Override - public int save(EquipmentSaleApplyDetail t) { - int resultNum=equipmentSaleApplyDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentSaleApplyDetail t) { - // TODO Auto-generated method stub - int resultNum= equipmentSaleApplyDetailDao.updateByWhere(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentSaleApplyDetail esad=new EquipmentSaleApplyDetail(); - esad.setWhere(t); - return equipmentSaleApplyDetailDao.selectListByWhere(esad); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentSaleApplyDetail esad=new EquipmentSaleApplyDetail(); - esad.setWhere(t); - return equipmentSaleApplyDetailDao.deleteByWhere(esad); - - } - - - -} diff --git a/src/com/sipai/service/equipment/EquipmentSaleApplyService.java b/src/com/sipai/service/equipment/EquipmentSaleApplyService.java deleted file mode 100644 index 6f8691fb..00000000 --- a/src/com/sipai/service/equipment/EquipmentSaleApplyService.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentSaleApplyDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.EquipmentSaleApply; -import com.sipai.entity.equipment.EquipmentScrapApply; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.tools.CommService; -@Service -public class EquipmentSaleApplyService implements CommService{ - @Resource - private EquipmentSaleApplyDao equipmentSaleApplyDao; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - - @Override - public EquipmentSaleApply selectById(String t) { - EquipmentSaleApply esa=equipmentSaleApplyDao.selectByPrimaryKey(t); - return esa; - } - - @Transactional - @Override - public int deleteById(String t) { - try { - EquipmentSaleApply saleApply = equipmentSaleApplyDao.selectByPrimaryKey(t); - String pInstancId = saleApply.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - int resultNum=equipmentSaleApplyDao.deleteByPrimaryKey(t); - return resultNum; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(EquipmentSaleApply t) { - int resultNum =equipmentSaleApplyDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentSaleApply t) { - int resultNum=equipmentSaleApplyDao.updateByWhere(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentSaleApply esa=new EquipmentSaleApply(); - esa.setWhere(t); - List esaList=equipmentSaleApplyDao.selectListByWhere(esa); - return esaList; - } - - @Transactional - @Override - public int deleteByWhere(String t) { - try { - EquipmentSaleApply ela=new EquipmentSaleApply(); - ela.setWhere(t); - Listlist = equipmentSaleApplyDao.selectListByWhere(ela); - if (list!=null && list.size()>0) { - for (EquipmentSaleApply item : list) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - int resultNum= equipmentSaleApplyDao.deleteByWhere(ela); - return resultNum; - }catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - public EquipmentSaleApply selectEquipmentOtherInfoById(String id){ - return equipmentSaleApplyDao.selectEquipmentOtherInfoById(id); - } - /** - * 启动设备出售审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(EquipmentSaleApply equipmentSaleApply) { - try { - Map variables = new HashMap(); - if(!equipmentSaleApply.getAuditId().isEmpty()){ - variables.put("userIds", equipmentSaleApply.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Sale_Apply.getId()+"-"+equipmentSaleApply.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(equipmentSaleApply.getId(), equipmentSaleApply.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - equipmentSaleApply.setProcessid(processInstance.getId()); - equipmentSaleApply.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentSaleApply.getProcessid()).singleResult(); - equipmentSaleApply.setStatus(task.getName()); - EquipmentSaleApply saleApply = this.selectById(equipmentSaleApply.getId()); - int res = 0; - if(null == saleApply){ - res = this.save(equipmentSaleApply); - }else { - res = this.update(equipmentSaleApply); - } - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentSaleApply); - businessUnitRecord.sendMessage(equipmentSaleApply.getAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - EquipmentSaleApply equipmentSaleApply = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentSaleApply.getProcessid()).singleResult(); - if (task!=null) { - equipmentSaleApply.setStatus(task.getName()); - }else{ - equipmentSaleApply.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - } - int res =this.update(equipmentSaleApply); - return res; - } - /** - * 出售申请审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentScrapApplyDetailService.java b/src/com/sipai/service/equipment/EquipmentScrapApplyDetailService.java deleted file mode 100644 index 0a34ff19..00000000 --- a/src/com/sipai/service/equipment/EquipmentScrapApplyDetailService.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentScrapApplyDetailDao; -import com.sipai.entity.equipment.EquipmentScrapApplyDetail; -import com.sipai.tools.CommService; - -@Service -public class EquipmentScrapApplyDetailService implements CommService{ - @Resource - private EquipmentScrapApplyDetailDao equipmentScrapApplyDetailDao; - - @Override - public EquipmentScrapApplyDetail selectById(String t) { - EquipmentScrapApplyDetail esad=equipmentScrapApplyDetailDao.selectByPrimaryKey(t); - // TODO Auto-generated method stub - return esad; - } - - @Override - public int deleteById(String t) { - int resultNum=equipmentScrapApplyDetailDao.deleteByPrimaryKey(t); - // TODO Auto-generated method stub - return resultNum; - } - - @Override - public int save(EquipmentScrapApplyDetail t) { - int resultNum=equipmentScrapApplyDetailDao.insert(t); - // TODO Auto-generated method stub - return resultNum; - } - - @Override - public int update(EquipmentScrapApplyDetail t) { - int resultNum=equipmentScrapApplyDetailDao.updateByWhere(t); - // TODO Auto-generated method stub - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentScrapApplyDetail esad=new EquipmentScrapApplyDetail(); - esad.setWhere(t); - return equipmentScrapApplyDetailDao.selectListByWhere(esad); - // TODO Auto-generated method stub - - } - - @Override - public int deleteByWhere(String t) { - EquipmentScrapApplyDetail esad=new EquipmentScrapApplyDetail(); - esad.setWhere(t); - // TODO Auto-generated method stub - return equipmentScrapApplyDetailDao.deleteByWhere(esad); - } - - - public List selectListByWhereAndApplyStatus(String s) { - EquipmentScrapApplyDetail esad=new EquipmentScrapApplyDetail(); - esad.setWhere(s); - return equipmentScrapApplyDetailDao.selectListByWhereAndApplyStatus(esad); - } -} diff --git a/src/com/sipai/service/equipment/EquipmentScrapApplyService.java b/src/com/sipai/service/equipment/EquipmentScrapApplyService.java deleted file mode 100644 index c70c5470..00000000 --- a/src/com/sipai/service/equipment/EquipmentScrapApplyService.java +++ /dev/null @@ -1,487 +0,0 @@ -package com.sipai.service.equipment; - -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.enums.AbnormityStatusEnum; -import com.sipai.entity.enums.AbnormityTypeEnum; -import com.sipai.entity.equipment.*; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import net.sf.json.JSONObject; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentScrapApplyDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentScrapApplyService implements CommService{ - @Resource - EquipmentScrapApplyDao equipmentScrapApplyDao; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private RuntimeService runtimeService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private TaskService taskService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentScrapApplyDetailService equipmentScrapApplyDetailService; - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - - @Override - public EquipmentScrapApply selectById(String t) { - EquipmentScrapApply esa=equipmentScrapApplyDao.selectByPrimaryKey(t); - return esa; - } - - @Transactional - @Override - public int deleteById(String t) { - try { - EquipmentScrapApply scrapApply = equipmentScrapApplyDao.selectByPrimaryKey(t); - String pInstancId = scrapApply.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + scrapApply.getId() + "'"); - } - int resultNum= equipmentScrapApplyDao.deleteByPrimaryKey(t); - return resultNum; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(EquipmentScrapApply t) { - int resultNum=equipmentScrapApplyDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentScrapApply t) { - int reslutNum=equipmentScrapApplyDao.updateByWhere(t); - return reslutNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentScrapApply esa=new EquipmentScrapApply(); - esa.setWhere(t); - return equipmentScrapApplyDao.selectListByWhere(esa); - - } - @Transactional - @Override - public int deleteByWhere(String t) { - try { - EquipmentScrapApply scrapApply=new EquipmentScrapApply(); - scrapApply.setWhere(t); - Listlist = equipmentScrapApplyDao.selectListByWhere(scrapApply); - if (list!=null && list.size()>0) { - for (EquipmentScrapApply item : list) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - int resultNum= equipmentScrapApplyDao.deleteByWhere(scrapApply); - return resultNum; - }catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - public EquipmentScrapApply selectEquipmentOtherInfoById(String id){ - return equipmentScrapApplyDao.selectEquipmentOtherInfoById(id); - } - /** - * 启动设备报废审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(EquipmentScrapApply equipmentScrapApply) { - try { - Map variables = new HashMap(); - if(!equipmentScrapApply.getAuditId().isEmpty()){ - variables.put("userIds", equipmentScrapApply.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Scrap_Apply.getId()+"-"+equipmentScrapApply.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(equipmentScrapApply.getId(), equipmentScrapApply.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - equipmentScrapApply.setProcessid(processInstance.getId()); - equipmentScrapApply.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentScrapApply.getProcessid()).singleResult(); - equipmentScrapApply.setStatus(task.getName()); - EquipmentScrapApply scrapApply = this.selectById(equipmentScrapApply.getId()); - int res = 0; - if(null == scrapApply){ - res = this.save(equipmentScrapApply); - }else { - res = this.update(equipmentScrapApply); - } - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentScrapApply); - businessUnitRecord.sendMessage(equipmentScrapApply.getAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - EquipmentScrapApply equipmentScrapApply = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentScrapApply.getProcessid()).singleResult(); - if (task!=null) { - equipmentScrapApply.setStatus(task.getName()); - }else{ - equipmentScrapApply.setStatus(SparePartCommString.STATUS_SCRAP_FINISH); - List equipmentScrapApplyDetails = equipmentScrapApplyDetailService.selectListByWhere("where scrap_apply_number = '" + equipmentScrapApply.getScrapApplyNumber() + "'"); - for (EquipmentScrapApplyDetail equipmentScrapApplyDetail : equipmentScrapApplyDetails) { - EquipmentCard equipmentCard = new EquipmentCard(); - equipmentCard.setId(equipmentScrapApplyDetail.getEquipmentCardId()); - List equipmentStatusManagements = this.equipmentStatusManagementService.selectListByWhere("where name = '报废'"); - if (equipmentScrapApplyDetails != null && equipmentStatusManagements.size() > 0) { - equipmentCard.setEquipmentstatus(equipmentStatusManagements.get(0).getId()); - } - equipmentCardService.update(equipmentCard); - } - } - int res =this.update(equipmentScrapApply); - return res; - } - /** - * 出售申请审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - // 不通过结束 此处0为前端配置 则后端规定为0 才可进入逻辑 - if (!entity.getPassstatus() && entity.getRouteNum() == 0) { - EquipmentScrapApply equipmentScrapApply = this.selectById(entity.getBusinessid()); - // 审核不合格 - equipmentScrapApply.setStatus(SparePartCommString.STATUS_STOCK_FAIL); - this.update(equipmentScrapApply); - } else { - this.updateStatus(entity.getBusinessid()); - } - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public List findEquScrapCollect(String where){ - return equipmentScrapApplyDao.findEquScrapCollect(where); - } - - /** - * 异常下发导出 - * @param response - * @param unitId - * @throws IOException - */ - public void doExport(String unitId, HttpServletRequest request, - HttpServletResponse response - ) throws IOException { - - String fileName = "报废记录.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "报废记录"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 6000); - sheet.setColumnWidth(1, 10000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 10000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 4000); - sheet.setColumnWidth(6, 4000); - sheet.setColumnWidth(7, 4000); - sheet.setColumnWidth(8, 4000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "设备编号,设备名称,资产编号,报废申请编号,申请时间,公司,申请人,账面原值,账面净值"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("报废记录"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - String idss = request.getParameter("ids"); - Abnormity entity = new Abnormity(); - List list = new ArrayList<>(); - if(org.apache.commons.lang3.StringUtils.isNotBlank(idss)) { - idss = idss.substring(0, idss.length() - 1); - idss = idss.replace(",","','"); - list = this.findEquScrapCollect("where t.scrap_apply_number in ('" + idss + "') order by t.insdt desc"); - } - - if(list!=null && list.size()>0){ - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - BigDecimal value = new BigDecimal("0.0000"); - BigDecimal worth = new BigDecimal("0.0000"); - for (int i = 0; i < list.size(); i++ ) { - if (list.get(i).getEquipmentValue() != null) { - value = value.add(list.get(i).getEquipmentValue()); - } - if (list.get(i).getEquipWorth() != null) { - worth = worth.add(list.get(i).getEquipWorth()); - } - row = sheet.createRow(2+i);//第三行为插入的数据行 - row.setHeight((short) 600); - - //设备编号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getEquipmentCardCode()) ? list.get(i).getEquipmentCardCode() : ""); - //设备名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getEquipmentCardName()) ? list.get(i).getEquipmentCardName() : ""); - //资产编号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).get_equipmentAssetNumber()) ? list.get(i).get_equipmentAssetNumber() : ""); - //报废申请编号 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getScrapApplyNumber()) ? list.get(i).getScrapApplyNumber() : ""); - //申请时间 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getApplyTime()) ? list.get(i).getApplyTime() : ""); - //公司 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getCompanyName()) ? list.get(i).getCompanyName() : ""); - //申请人 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getName()) ? list.get(i).getName() : ""); - //账面原值 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getEquipmentValue() != null ? list.get(i).getEquipmentValue() + "" : ""); - //账面净值 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getEquipWorth() != null ? list.get(i).getEquipWorth() + "" : ""); - } - Row row1=sheet.createRow(2+list.size()); // 创建一个行,0表示第一行 - row1.setHeight((short) 400); - //合计 - Cell cell_0 = row1.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue("合计:"); - //设备名称 - Cell cell_1 = row1.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(""); - //资产编号 - Cell cell_2 = row1.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(""); - //报废申请编号 - Cell cell_3 = row1.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(""); - //申请时间 - Cell cell_4 = row1.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(""); - //公司 - Cell cell_5 = row1.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(""); - //申请人 - Cell cell_6 = row1.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(""); - Cell cell_7 = row1.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(value + ""); - Cell cell_8 = row1.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(worth + ""); - - int rownum = 2;//第2行开始 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - for(Iterator iter = jsonObject2.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } -} diff --git a/src/com/sipai/service/equipment/EquipmentSpecificationService.java b/src/com/sipai/service/equipment/EquipmentSpecificationService.java deleted file mode 100644 index 026f2138..00000000 --- a/src/com/sipai/service/equipment/EquipmentSpecificationService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentSpecificationDao; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.tools.CommService; -@Service -public class EquipmentSpecificationService implements CommService{ - @Resource - private EquipmentSpecificationDao equipmentSpecificationDao; - - @Override - public EquipmentSpecification selectById(String id) { - return this.equipmentSpecificationDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentSpecificationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentSpecification entity) { - return this.equipmentSpecificationDao.insert(entity); - } - - @Override - public int update(EquipmentSpecification entity) { - return this.equipmentSpecificationDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentSpecification entity = new EquipmentSpecification(); - entity.setWhere(wherestr); - return this.equipmentSpecificationDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentSpecification entity = new EquipmentSpecification(); - entity.setWhere(wherestr); - return this.equipmentSpecificationDao.deleteByWhere(entity); - } - - -} diff --git a/src/com/sipai/service/equipment/EquipmentStatisticsService.java b/src/com/sipai/service/equipment/EquipmentStatisticsService.java deleted file mode 100644 index 8df61d00..00000000 --- a/src/com/sipai/service/equipment/EquipmentStatisticsService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentStatisticsDao; -import com.sipai.entity.equipment.EquipmentStatistics; -import com.sipai.tools.CommService; -@Service -public class EquipmentStatisticsService implements CommService{ - @Resource - private EquipmentStatisticsDao equipmentStatisticsDao; - - @Override - public EquipmentStatistics selectById(String id) { - return this.equipmentStatisticsDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentStatisticsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentStatistics equipmentCardProp) { - return this.equipmentStatisticsDao.insert(equipmentCardProp); - } - - @Override - public int update(EquipmentStatistics equipmentCardProp) { - return this.equipmentStatisticsDao.updateByPrimaryKeySelective(equipmentCardProp); - } - - - @Override - public List selectListByWhere(String wherestr) { - EquipmentStatistics equipmentStatistics = new EquipmentStatistics(); - equipmentStatistics.setWhere(wherestr); - return this.equipmentStatisticsDao.selectListByWhere(equipmentStatistics); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentStatistics equipmentStatistics = new EquipmentStatistics(); - equipmentStatistics.setWhere(wherestr); - return this.equipmentStatisticsDao.deleteByWhere(equipmentStatistics); - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentStatusManagementService.java b/src/com/sipai/service/equipment/EquipmentStatusManagementService.java deleted file mode 100644 index 2c83b402..00000000 --- a/src/com/sipai/service/equipment/EquipmentStatusManagementService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentStatusManagementDao; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.tools.CommService; - - -@Service -public class EquipmentStatusManagementService implements CommService{ - - @Resource - private EquipmentStatusManagementDao equipmentStatusManagementDao; - - @Override - public EquipmentStatusManagement selectById(String t) { - // TODO Auto-generated method stub - return equipmentStatusManagementDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentStatusManagementDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentStatusManagement t) { - // TODO Auto-generated method stub - return equipmentStatusManagementDao.insertSelective(t); - - } - - @Override - public int update(EquipmentStatusManagement t) { - // TODO Auto-generated method stub - return equipmentStatusManagementDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentStatusManagement equipmentStatusManagement = new EquipmentStatusManagement(); - equipmentStatusManagement.setWhere(t); - return equipmentStatusManagementDao.selectListByWhere(equipmentStatusManagement); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentStatusManagement equipmentStatusManagement = new EquipmentStatusManagement(); - equipmentStatusManagement.setWhere(t); - return equipmentStatusManagementDao.deleteByWhere(equipmentStatusManagement); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentStopRecordDetailService.java b/src/com/sipai/service/equipment/EquipmentStopRecordDetailService.java deleted file mode 100644 index 699987cb..00000000 --- a/src/com/sipai/service/equipment/EquipmentStopRecordDetailService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentStopRecordDetailDao; -import com.sipai.entity.equipment.EquipmentStopRecordDetail; -import com.sipai.tools.CommService; - - -@Service -public class EquipmentStopRecordDetailService implements CommService{ - - @Resource - private EquipmentStopRecordDetailDao equipmentStopRecordDetail; - - @Override - public EquipmentStopRecordDetail selectById(String t) { - // TODO Auto-generated method stub - return equipmentStopRecordDetail.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentStopRecordDetail.deleteByPrimaryKey(t); - - } - - @Override - public int save(EquipmentStopRecordDetail t) { - // TODO Auto-generated method stub - return equipmentStopRecordDetail.insertSelective(t); - - } - - @Override - public int update(EquipmentStopRecordDetail t) { - // TODO Auto-generated method stub - return equipmentStopRecordDetail.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentStopRecordDetail escd = new EquipmentStopRecordDetail(); - escd.setWhere(t); - return equipmentStopRecordDetail.selectListByWhere(escd); - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentStopRecordDetail escd = new EquipmentStopRecordDetail(); - escd.setWhere(t); - return equipmentStopRecordDetail.deleteByWhere(escd); - - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentStopRecordService.java b/src/com/sipai/service/equipment/EquipmentStopRecordService.java deleted file mode 100644 index 3c79a604..00000000 --- a/src/com/sipai/service/equipment/EquipmentStopRecordService.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentStopRecordDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.EquipmentStopRecord; -import com.sipai.entity.equipment.EquipmentStopRecordDetail; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.tools.CommService; - - -@Service -public class EquipmentStopRecordService implements CommService{ - - @Resource - private EquipmentStopRecordDao equipmentStopRecordDao; - @Resource - private EquipmentStopRecordDetailService equipmentStopRecordDetailService ; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private EquipmentCardService equipmentCardService; - - - -/* public List getEquipmentStopDetailList(String t) { - // TODO Auto-generated method stub - List esrList =null; - Map esdMap = new HashMap<>(); - EquipmentStopRecord esr = new EquipmentStopRecord(); - List esdList=equipmentStopRecordDetailService.selectListByWhere(t); - if(esdList.size() >0 && null!=esdList){ - for(EquipmentStopRecordDetail esd:esdList){ - String ecId =esd.getEquipmentCardId(); - esdMap.put(ecId,esd); - - //List esrList=equipmentStopRecordDao.selectListByWhere(esr); - } - - StringBuilder stopApplyNumberSb = new StringBuilder(); - for(Map.Entry entry :esdMap.entrySet()){ - stopApplyNumberSb.append("'"+entry.getValue().getStopApplyNumber()+"'"+","); - } - - String stopApplyNumber = stopApplyNumberSb.toString(); - - EquipmentStopRecord esrObj = new EquipmentStopRecord(); - esr.setWhere(stopApplyNumber); - esrList = equipmentStopRecordDao.selectListByWhere(esrObj); - - } - - return esrList; - }*/ - - @Override - public EquipmentStopRecord selectById(String t) { - // TODO Auto-generated method stub - return equipmentStopRecordDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return equipmentStopRecordDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EquipmentStopRecord t) { - // TODO Auto-generated method stub - return equipmentStopRecordDao.insertSelective(t); - - } - - @Override - public int update(EquipmentStopRecord t) { - // TODO Auto-generated method stub - return equipmentStopRecordDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EquipmentStopRecord esr = new EquipmentStopRecord(); - esr.setWhere(t); - return equipmentStopRecordDao.selectListByWhere(esr); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - EquipmentStopRecord esr = new EquipmentStopRecord(); - esr.setWhere(t); - return equipmentStopRecordDao.deleteByWhere(esr); - - } - - /** - * 启动设备停用审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(EquipmentStopRecord equipmentStopRecord) { - try { - Map variables = new HashMap(); - if(!equipmentStopRecord.getAuditId().isEmpty()){ - variables.put("userIds", equipmentStopRecord.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.EquipmentStop_Apply.getId()+"-"+equipmentStopRecord.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(equipmentStopRecord.getId(), equipmentStopRecord.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - equipmentStopRecord.setProcessid(processInstance.getId()); - equipmentStopRecord.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentStopRecord.getProcessid()).singleResult(); - equipmentStopRecord.setStatus(task.getName()); - EquipmentStopRecord esrApply = this.selectById(equipmentStopRecord.getId()); - int res = 0; - if(null == esrApply){ - res = this.save(equipmentStopRecord); - }else { - res = this.update(equipmentStopRecord); - } - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentStopRecord); - businessUnitRecord.sendMessage(equipmentStopRecord.getAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 设备停用申请审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - EquipmentStopRecord esr = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(esr.getProcessid()).singleResult(); - if (task!=null) { - esr.setStatus(task.getName()); - }else{ - esr.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - //审核结束后将设备更新为停用状态 - List esrDetailList=equipmentStopRecordDetailService.selectListByWhere(" where stop_apply_number='"+esr.getStopApplyNumber()+"'"); - if(esrDetailList.size()>0 && null!=esrDetailList && !esrDetailList.isEmpty()){ - for(EquipmentStopRecordDetail esrVar:esrDetailList){ - EquipmentCard ec=equipmentCardService.selectById(esrVar.getEquipmentCardId()); - ec.setEquipmentstatus(EquipmentCard.Status_STOP); - equipmentCardService.update(ec); - } - } - - } - int res =this.update(esr); - return res; - } - - //增加了设备类型筛选的selectlistbywhere - public List selectListByEquipClass(String t) { - // TODO Auto-generated method stub - EquipmentStopRecord equipmentStopRecord = new EquipmentStopRecord(); - equipmentStopRecord.setWhere(t); - List list = equipmentStopRecordDao.selectListByEquipClass(equipmentStopRecord); - return list; - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/EquipmentTransfersApplyDetailService.java b/src/com/sipai/service/equipment/EquipmentTransfersApplyDetailService.java deleted file mode 100644 index 1e33ede7..00000000 --- a/src/com/sipai/service/equipment/EquipmentTransfersApplyDetailService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentTransfersApplyDetailDao; -import com.sipai.entity.equipment.EquipmentTransfersApplyDetail; -import com.sipai.tools.CommService; - -@Service -public class EquipmentTransfersApplyDetailService implements CommService{ - @Resource - private EquipmentTransfersApplyDetailDao equipmentTransfersApplyDetailDao; - - @Override - public EquipmentTransfersApplyDetail selectById(String t) { - EquipmentTransfersApplyDetail etad=equipmentTransfersApplyDetailDao.selectByPrimaryKey(t); - return etad; - } - - @Override - public int deleteById(String t) { - int resultNum=equipmentTransfersApplyDetailDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(EquipmentTransfersApplyDetail t) { - int resultNum=equipmentTransfersApplyDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentTransfersApplyDetail t) { - int resultNum=equipmentTransfersApplyDetailDao.updateByWhere(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentTransfersApplyDetail etad=new EquipmentTransfersApplyDetail(); - etad.setWhere(t); - return equipmentTransfersApplyDetailDao.selectListByWhere(etad); - - } - - @Override - public int deleteByWhere(String t) { - EquipmentTransfersApplyDetail etad=new EquipmentTransfersApplyDetail(); - etad.setWhere(t); - return equipmentTransfersApplyDetailDao.deleteByWhere(etad); - - } - -} diff --git a/src/com/sipai/service/equipment/EquipmentTransfersApplyService.java b/src/com/sipai/service/equipment/EquipmentTransfersApplyService.java deleted file mode 100644 index 7cd99b94..00000000 --- a/src/com/sipai/service/equipment/EquipmentTransfersApplyService.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.http.HttpRequest; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import com.sipai.controller.equipment.EquipmentTransfersApplyController; -import com.sipai.dao.equipment.EquipmentTransfersApplyDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentSaleApply; -import com.sipai.entity.equipment.EquipmentScrapApply; -import com.sipai.entity.equipment.EquipmentTransfersApply; -import com.sipai.entity.equipment.EquipmentTransfersApplyCollect; -import com.sipai.entity.equipment.EquipmentTransfersApplyDetail; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class EquipmentTransfersApplyService implements CommService{ - @Resource - private EquipmentTransfersApplyDao equipmentTransfersApplyDao; - @Resource - private EquipmentTransfersApplyDetailService equipmentTransfersApplyDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public EquipmentTransfersApply selectById(String t) { - EquipmentTransfersApply eta=equipmentTransfersApplyDao.selectByPrimaryKey(t); - return eta; - } - - @Transactional - @Override - public int deleteById(String t) { - try { - EquipmentTransfersApply transfersApply = equipmentTransfersApplyDao.selectByPrimaryKey(t); - String pInstancId = transfersApply.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - int resultNum= equipmentTransfersApplyDao.deleteByPrimaryKey(t); - return resultNum; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(EquipmentTransfersApply t) { - int resultNum=equipmentTransfersApplyDao.insert(t); - return resultNum; - } - - @Override - public int update(EquipmentTransfersApply t) { - int resultNum=equipmentTransfersApplyDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - EquipmentTransfersApply eta=new EquipmentTransfersApply(); - eta.setWhere(t); - return equipmentTransfersApplyDao.selectListByWhere(eta); - - - } - - @Transactional - @Override - public int deleteByWhere(String t) { - try { - EquipmentTransfersApply eta=new EquipmentTransfersApply(); - eta.setWhere(t); - Listlist = equipmentTransfersApplyDao.selectListByWhere(eta); - if (list!=null && list.size()>0) { - for (EquipmentTransfersApply item : list) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - int resultNum= equipmentTransfersApplyDao.deleteByWhere(eta); - return resultNum; - }catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /* - public List selectListByWhere(EquipmentTransfersApply eta){ - return equipmentTransfersApplyDao.selectListByWhere(eta); - } - */ - - /** - * 启动设备调拨审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(EquipmentTransfersApply equipmentTransfersApply) { - try { - Map variables = new HashMap(); - if(!equipmentTransfersApply.getAuditId().isEmpty()){ - variables.put("userIds", equipmentTransfersApply.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Transfers_Apply.getId()+"-"+equipmentTransfersApply.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(equipmentTransfersApply.getId(), equipmentTransfersApply.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - equipmentTransfersApply.setProcessid(processInstance.getId()); - equipmentTransfersApply.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentTransfersApply.getProcessid()).singleResult(); - equipmentTransfersApply.setStatus(task.getName()); - EquipmentTransfersApply transfersApply = this.selectById(equipmentTransfersApply.getId()); - int res = 0; - if(null == transfersApply){ - res = this.save(equipmentTransfersApply); - }else { - res = this.update(equipmentTransfersApply); - } - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentTransfersApply); - businessUnitRecord.sendMessage(equipmentTransfersApply.getAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id,User cu) { - EquipmentTransfersApply equipmentTransfersApply = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentTransfersApply.getProcessid()).singleResult(); - if (task!=null) { - equipmentTransfersApply.setStatus(task.getName()); - }else{ - equipmentTransfersApply.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - List etadList=equipmentTransfersApplyDetailService.selectListByWhere("where transfers_apply_number="+"'"+equipmentTransfersApply.getTransfersApplyNumber()+"'"); - for(EquipmentTransfersApplyDetail etad:etadList){ - //审核完成后将设备状态(equipmentStatus改为“调拨”) - EquipmentCard ec=new EquipmentCard(); - ec.setId(etad.getEquipmentCardId()); - ec.setEquipmentstatus(EquipmentCard.Status_Transfer); - equipmentCardService.update(ec); - //审核完成后将调拨的设备添加到TB_EM_EquipmentCard中 - ec=equipmentCardService.selectById(etad.getEquipmentCardId()); - ec.setId(CommUtil.getUUID()); - ec.setInsdt(CommUtil.nowDate()); - ec.setInsuser(cu.getId()); - ec.setEquipmentstatus(EquipmentCard.Status_IN); - ec.setBizid(equipmentTransfersApply.getSendToBizId()); - equipmentCardService.save(ec); - } - - } - int res =this.update(equipmentTransfersApply); - return res; - } - /** - * 调拨申请审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity,User cu) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid(),cu); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public List findEquTraApplyCollect(String where) { - return equipmentTransfersApplyDao.findEquTraApplyCollect(where); - - } -} diff --git a/src/com/sipai/service/equipment/EquipmentTypeNumberService.java b/src/com/sipai/service/equipment/EquipmentTypeNumberService.java deleted file mode 100644 index fcf41e8a..00000000 --- a/src/com/sipai/service/equipment/EquipmentTypeNumberService.java +++ /dev/null @@ -1,465 +0,0 @@ -package com.sipai.service.equipment; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentTypeNumberDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.maintenance.LibraryRepairModelBloc; -import com.sipai.entity.maintenance.MaintainCommStr; -import com.sipai.entity.user.Company; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; -import static org.apache.poi.ss.usermodel.CellType.NUMERIC; - -@Service -public class EquipmentTypeNumberService implements CommService{ - @Resource - private EquipmentTypeNumberDao equipmentTypeNumberDao; - @Resource - private EquipmentClassService equipmentClassService; - - @Override - public EquipmentTypeNumber selectById(String id) { - return this.equipmentTypeNumberDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentTypeNumberDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentTypeNumber entity) { - return this.equipmentTypeNumberDao.insert(entity); - } - - @Override - public int update(EquipmentTypeNumber entity) { - return this.equipmentTypeNumberDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentTypeNumber entity = new EquipmentTypeNumber(); - entity.setWhere(wherestr); - return this.equipmentTypeNumberDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentTypeNumber entity = new EquipmentTypeNumber(); - entity.setWhere(wherestr); - return this.equipmentTypeNumberDao.deleteByWhere(entity); - } - - public void doExport(HttpServletResponse response, - String unitId) throws IOException { - EquipmentClass equipmentClass = new EquipmentClass(); - - String fileName = "设备型号.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "设备型号"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 3000); - sheet.setColumnWidth(2, 5000); - sheet.setColumnWidth(3, 3000); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 6000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "id,大类代码,大类名称,小类代码,小类名称,设备型号,备注"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("设备型号"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - - EquipmentTypeNumber equipmentTypeNumber = new EquipmentTypeNumber(); - equipmentTypeNumber.setWhere("where b.type = '1' order by b.morder,s.morder,t.morder"); - List list = equipmentTypeNumberDao.selectList4Class(equipmentTypeNumber); - if(list!=null && list.size()>0){ - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(2+i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备大类 - if(jsonObject1.has(list.get(i).getB_id())){ - int num = (int) jsonObject1.get(list.get(i).getB_id()); - jsonObject1.put(list.get(i).getB_id(),num+1); - }else { - jsonObject1.put(list.get(i).getB_id(),1); - } - - //设备小类 - if(jsonObject2.has(list.get(i).getS_id())){ - int num = (int) jsonObject2.get(list.get(i).getS_id()); - jsonObject2.put(list.get(i).getS_id(),num+1); - }else { - if(list.get(i).getS_id()!=null){ - jsonObject2.put(list.get(i).getS_id(),1); - }else { - jsonObject2.put("空"+CommUtil.getUUID(),1); - } - } - - //型号id - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getId()); - //大类代码 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getB_code()); - //大类名称 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getB_name()); - //小类代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getS_code()); - //小类名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getS_name()); - //设备型号 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getName()); - //设备型号 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getRemark()); - - } - - int rownum = 2;//第2行开始 - - //设备大类合并单元格 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - //设备小类合并单元格 - for(Iterator iter = jsonObject2.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - @Transactional - public String readXls(InputStream input,String userId, String unitId) throws IOException { - System.out.println("导入设备型号开始============="+CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0 ; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于5列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 5) { - continue; - } - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || getMergedRegionValue(sheet, rowNum, 1) == null - || getMergedRegionValue(sheet, rowNum, 3) == null - || getMergedRegionValue(sheet, rowNum, 5) == null) { - continue; - } - - String cell_id = getMergedRegionValue(sheet, rowNum, 0);//设备大类代码 - String cell_big_class_code = getMergedRegionValue(sheet, rowNum, 1);//设备大类代码 - String cell_small_class_code = getMergedRegionValue(sheet, rowNum, 3);//设备小类代码 - String cell_name = getMergedRegionValue(sheet, rowNum, 5); - String cell_remark = getMergedRegionValue(sheet, rowNum, 6); - - int res = 0; - if(cell_id!=null && !cell_id.equals("")){ - EquipmentTypeNumber eTypeNumber = equipmentTypeNumberDao.selectByPrimaryKey(cell_id); - if(eTypeNumber!=null){ - //修改 - EquipmentTypeNumber equipmentTypeNumber = new EquipmentTypeNumber(); - equipmentTypeNumber.setId(eTypeNumber.getId()); - equipmentTypeNumber.setName(cell_name); - equipmentTypeNumber.setRemark(cell_remark); - res = equipmentTypeNumberDao.updateByPrimaryKeySelective(equipmentTypeNumber); - if(res == 1){ - updateNum += 1; - } - }else { - //一般不会进这里,只有id没找到才会进 - String sqlstr = "where equipment_class_code_full = '"+cell_big_class_code+cell_small_class_code+"' and type = '2' "; - EquipmentClass equipmentClass = equipmentClassService.selectByWhere(sqlstr); - if(equipmentClass!=null){ - //新增 - EquipmentTypeNumber equipmentTypeNumber = new EquipmentTypeNumber(); - equipmentTypeNumber.setWhere("where name = '"+cell_name+"' and pid = '"+equipmentClass.getId()+"'"); - EquipmentTypeNumber entityTypeNumber = equipmentTypeNumberDao.selectByWhere(equipmentTypeNumber); - if(entityTypeNumber!=null){ - //存在 - }else { - equipmentTypeNumber.setId(CommUtil.getUUID()); - equipmentTypeNumber.setName(cell_name); - equipmentTypeNumber.setRemark(cell_remark); - equipmentTypeNumber.setPid(equipmentClass.getId()); - res = equipmentTypeNumberDao.insert(equipmentTypeNumber); - if(res == 1){ - insertNum += 1; - } - } - } - } - }else { - String sqlstr = "where equipment_class_code_full = '"+cell_big_class_code+cell_small_class_code+"' and type = '"+CommString.EquipmentClass_Equipment+"' "; - EquipmentClass equipmentClass = equipmentClassService.selectByWhere(sqlstr); - if(equipmentClass!=null){ - //新增 - EquipmentTypeNumber equipmentTypeNumber = new EquipmentTypeNumber(); - equipmentTypeNumber.setWhere("where name = '"+cell_name+"' and pid = '"+equipmentClass.getId()+"'"); - EquipmentTypeNumber entityTypeNumber = equipmentTypeNumberDao.selectByWhere(equipmentTypeNumber); - if(entityTypeNumber!=null){ - //存在 - }else { - equipmentTypeNumber.setId(CommUtil.getUUID()); - equipmentTypeNumber.setName(cell_name); - equipmentTypeNumber.setRemark(cell_remark); - equipmentTypeNumber.setPid(equipmentClass.getId()); - res = equipmentTypeNumberDao.insert(equipmentTypeNumber); - if(res == 1){ - insertNum += 1; - } - } - } - } - } - } - String result = ""; - result = "" - //+ "新增项目:"+insertProjectNum+"条,修改项目:"+updateProjectNum+"条," - + "新增型号:"+insertNum+"条,修改型号:"+updateNum+"条!"; - System.out.println("导入设备型号结束============="+CommUtil.nowDate()); - return result; - } - - @Transactional - public String readXlsx(InputStream input, String userId, String unitId) - throws IOException { - // TODO Auto-generated method stub - return null; - } - - /** - * xls文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column){ - int sheetMergeCount = sheet.getNumMergedRegions(); - - for(int i = 0 ; i < sheetMergeCount ; i++){ - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if(row >= firstRow && row <= lastRow){ - if(column >= firstColumn && column <= lastColumn){ - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell) ; - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell) ; - } -} diff --git a/src/com/sipai/service/equipment/EquipmentUseAgeService.java b/src/com/sipai/service/equipment/EquipmentUseAgeService.java deleted file mode 100644 index 71ff957d..00000000 --- a/src/com/sipai/service/equipment/EquipmentUseAgeService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentUseAgeDao; -import com.sipai.entity.equipment.EquipmentUseAge; -import com.sipai.tools.CommService; -@Service -public class EquipmentUseAgeService implements CommService{ - @Resource - private EquipmentUseAgeDao equipmentUseAgeDao; - - @Override - public EquipmentUseAge selectById(String id) { - return this.equipmentUseAgeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentUseAgeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentUseAge entity) { - return this.equipmentUseAgeDao.insert(entity); - } - - @Override - public int update(EquipmentUseAge entity) { - return this.equipmentUseAgeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentUseAge entity = new EquipmentUseAge(); - entity.setWhere(wherestr); - return this.equipmentUseAgeDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentUseAge entity = new EquipmentUseAge(); - entity.setWhere(wherestr); - return this.equipmentUseAgeDao.deleteByWhere(entity); - } - - -} diff --git a/src/com/sipai/service/equipment/FacilitiesCardService.java b/src/com/sipai/service/equipment/FacilitiesCardService.java deleted file mode 100644 index a17179b3..00000000 --- a/src/com/sipai/service/equipment/FacilitiesCardService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.service.equipment; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.FacilitiesCard; - -public interface FacilitiesCardService { - - public abstract FacilitiesCard selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(FacilitiesCard entity); - - public abstract int update(FacilitiesCard entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - //public abstract String getTreeListtest(List> list_result,List list); - - - /* - * 设施 - */ - public abstract String readXls4Facilities(InputStream input,String userId,String unitId) throws IOException; - public abstract String readXlsx4Facilities(InputStream input,String userId,String unitId) throws IOException; - public abstract void doExport4Facilities(HttpServletResponse response,String unitId) throws IOException; - - /* - * 管道 - */ - public abstract String readXls4Pipeline(InputStream input,String userId,String unitId) throws IOException; - public abstract String readXlsx4Pipeline(InputStream input,String userId,String unitId) throws IOException; - public abstract void doExport4Pipeline(HttpServletResponse response,String unitId) throws IOException; -} diff --git a/src/com/sipai/service/equipment/FacilitiesClassService.java b/src/com/sipai/service/equipment/FacilitiesClassService.java deleted file mode 100644 index eb51c158..00000000 --- a/src/com/sipai/service/equipment/FacilitiesClassService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import com.sipai.entity.equipment.FacilitiesClass; - -public interface FacilitiesClassService { - - public abstract FacilitiesClass selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(FacilitiesClass entity); - - public abstract int update(FacilitiesClass entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeListtest(List> list_result,List list); - - public abstract TreeSet getAllChildId(TreeSet classIdList,String id); - -} diff --git a/src/com/sipai/service/equipment/GeographyAreaService.java b/src/com/sipai/service/equipment/GeographyAreaService.java deleted file mode 100644 index 8bacf72a..00000000 --- a/src/com/sipai/service/equipment/GeographyAreaService.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.GeographyAreaDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.GeographyArea; -import com.sipai.tools.CommService; - - -@Service -public class GeographyAreaService implements CommService{ - @Resource - private GeographyAreaDao geographyareaDao; - - - public List selectList() { - // TODO Auto-generated method stub - GeographyArea geographyarea = new GeographyArea(); - return this.geographyareaDao.selectList(geographyarea); - } - - - @Override - public GeographyArea selectById(String id) { - return this.geographyareaDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.geographyareaDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GeographyArea entity) { - return this.geographyareaDao.insert(entity); - } - - @Override - public int update(GeographyArea t) { - return this.geographyareaDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - GeographyArea geographyarea = new GeographyArea(); - geographyarea.setWhere(wherestr); - return this.geographyareaDao.selectListByWhere(geographyarea); - } - - @Override - public int deleteByWhere(String wherestr) { - GeographyArea geographyarea = new GeographyArea(); - geographyarea.setWhere(wherestr); - return this.geographyareaDao.deleteByWhere(geographyarea); - } - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name) { - List list = this.selectListByWhere(" where name='"+name+"' order by insdt"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(GeographyArea geographyarea :list){ - if(!id.equals(geographyarea.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } - -} diff --git a/src/com/sipai/service/equipment/HomePageService.java b/src/com/sipai/service/equipment/HomePageService.java deleted file mode 100644 index b640427e..00000000 --- a/src/com/sipai/service/equipment/HomePageService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardDao; -import com.sipai.entity.equipment.EquipmentCard; - -@Service -public class HomePageService { - @Resource - private EquipmentCardDao equipmentCardDao; - - public List selectEquipmentRunTimeTotal(String SQL) { - return equipmentCardDao.selectEquipmentRunTimeTotal(SQL); - } - public EquipmentCard selectEquipmentTotal(String SQL) { - return equipmentCardDao.selectEquipmentTotal(SQL); - } - -} diff --git a/src/com/sipai/service/equipment/MaintenancePlanService.java b/src/com/sipai/service/equipment/MaintenancePlanService.java deleted file mode 100644 index 968788da..00000000 --- a/src/com/sipai/service/equipment/MaintenancePlanService.java +++ /dev/null @@ -1,398 +0,0 @@ -package com.sipai.service.equipment; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.h2.table.Plan; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.equipment.EquipmentLevelDao; -import com.sipai.dao.equipment.MaintenancePlanDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentLevel; -import com.sipai.entity.equipment.EquipmentLoseApply; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.RoleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -@Service -public class MaintenancePlanService implements CommService{ - @Resource - private MaintenancePlanDao maintenancePlanDao; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private RoleService roleService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - - @Override - public MaintenancePlan selectById(String id) { - MaintenancePlan maintenancePlan = this.maintenancePlanDao.selectByPrimaryKey(id); - if (null!= maintenancePlan && null != maintenancePlan.getBizId()&& !maintenancePlan.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(maintenancePlan.getBizId()); - maintenancePlan.setCompany(company); - } - if (null!= maintenancePlan &&null != maintenancePlan.getProcessSectionId()&& !maintenancePlan.getProcessSectionId().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(maintenancePlan.getProcessSectionId()); - maintenancePlan.setProcessSection(processSection); - } - if (null!= maintenancePlan &&null != maintenancePlan.getEquipmentId()&& !maintenancePlan.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(maintenancePlan.getEquipmentId()); - maintenancePlan.setEquipmentCard(equipmentCard); - } - if (null!= maintenancePlan &&null != maintenancePlan.getAuditId()&& !maintenancePlan.getAuditId().isEmpty()) { - User user = this.userService.getUserById(maintenancePlan.getAuditId()); - maintenancePlan.setAuditMan(user.getCaption()); - } - return maintenancePlan; - } - @Transactional - @Override - public int deleteById(String t) { - try { - MaintenancePlan maintenancePlan = maintenancePlanDao.selectByPrimaryKey(t); - String pInstancId = maintenancePlan.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - int resultNum =maintenancePlanDao.deleteByPrimaryKey(t); - return resultNum; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(MaintenancePlan maintenancePlan) { - return this.maintenancePlanDao.insert(maintenancePlan); - } - - @Override - public int update(MaintenancePlan maintenancePlan) { - return this.maintenancePlanDao.updateByPrimaryKeySelective(maintenancePlan); - } - - @Override - public List selectListByWhere(String wherestr) { - MaintenancePlan maintenancePlan = new MaintenancePlan(); - maintenancePlan.setWhere(wherestr); - List list = this.maintenancePlanDao.selectListByWhere(maintenancePlan); - for (MaintenancePlan item : list) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); - item.setProcessSection(processSection); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - return list; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - MaintenancePlan maintenancePlan = new MaintenancePlan(); - maintenancePlan.setWhere(wherestr); - Listlist = maintenancePlanDao.selectListByWhere(maintenancePlan); - if (list!=null && list.size()>0) { - for (MaintenancePlan item : list) { - String pInstancId = item.getProcessid(); - ProcessInstance pInstance=runtimeService.createProcessInstanceQuery() - .processInstanceId(pInstancId) - .singleResult(); - if(pInstance != null){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - int resultNum=maintenancePlanDao.deleteByWhere(maintenancePlan); - return resultNum; - }catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 下发保养计划,返回为1为下发成功,其它都为下发失败 - */ - @Transactional - public int issueMaintainPlan(MaintenancePlan maintenancePlan) { - try { - boolean flag=checkExist(maintenancePlan); - if (flag) { - return MaintenanceCommString.Response_StartProcess_PlanIssued; - } - Date nowTime = new Date(); - //当前时间,加时分秒毫秒 - SimpleDateFormat sdformat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - String dateStr = sdformat.format(nowTime); - //当前日期 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setPlan_id(maintenancePlan.getId()); - maintenanceDetail.setId(CommUtil.getUUID()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - /*Calendar calendar = Calendar.getInstance(); - calendar.setTime(nowTime); - calendar.add(Calendar.DAY_OF_MONTH, maintenancePlan.getPlanConsumeTime()); - maintenanceDetail.setPlannedenddt(sdf.format(calendar.getTime()));*/ - maintenanceDetail.setInsuser(maintenancePlan.getInsuser()); - maintenanceDetail.setDetailNumber(maintenancePlan.getCompany().getEname()+"-WXJL-"+dateStr); - maintenanceDetail.setCompanyid(maintenancePlan.getBizId()); - maintenanceDetail.setEquipmentId(maintenancePlan.getEquipmentId()); - maintenanceDetail.setProcessSectionId(maintenancePlan.getProcessSectionId()); - maintenanceDetail.setType(MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - List users =roleService.getRoleUsers("where serial='"+PatrolType.Maintenance.getId()+"' and bizid='"+maintenancePlan.getBizId()+"'"); - String userIds=""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds+=","; - } - userIds+=user.getId(); - } - maintenanceDetail.setSolver(userIds); - - //maintenanceDetail.setPlanConsumeTime(maintenancePlan.getPlanConsumeTime()); - maintenanceDetail.setMaintenanceWay(maintenancePlan.getMaintenanceWay()); - maintenanceDetail.setPlanMoney(maintenancePlan.getPlanMoney()); - maintenanceDetail.setProblemcontent(maintenancePlan.getContent()); - int result= this.maintenanceDetailService.start(maintenanceDetail); - if (result==1) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setId(CommUtil.getUUID()); - planRecordAbnormity.setInsdt(CommUtil.nowDate()); - planRecordAbnormity.setFatherId(maintenancePlan.getId()); - planRecordAbnormity.setSonId(maintenanceDetail.getId()); - result =planRecordAbnormityService.save(planRecordAbnormity); - if (result==1) { - return result; - }else{ - throw new RuntimeException(); - } - }else{ - return result; - } - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - /** - * 是否已下发,如果是月计划,查询本月有没有记录,如果是年计划,查询本年内有没有记录 - * 月计划每月下发一条,年计划按下发时间,每年下发一条 - * @param id - * @param planNumber - * @return - */ - public boolean checkExist(MaintenancePlan maintenancePlan) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //本月开始时间 - Calendar cal = Calendar.getInstance(); - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); - String monthStart = sdf.format(cal.getTime()); - //本月结束时间 - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); - cal.set(Calendar.HOUR_OF_DAY, 24); - String monthEnd = sdf.format(cal.getTime()); - //本年开始时间 - cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); - cal.set(Calendar.MONTH, cal.getActualMinimum(Calendar.JANUARY)); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH)); - String yearStart = sdf.format(cal.getTime()); - //本年结束时间 - cal.setTime(cal.getTime()); - cal.add(Calendar.YEAR, 1); - String yearEnd = sdf.format(cal.getTime()); - //查询字段的开始时间和结束时间 - String start = ""; - String end = ""; - try { - if (MaintenanceCommString.MAINTAIN_MONTH.equals(maintenancePlan.getPlanType())) { - start = monthStart; - end = monthEnd; - }else { - start = yearStart; - end = yearEnd; - } - List planRecordAbnormities=planRecordAbnormityService.selectListByWhere( - "where father_id='"+maintenancePlan.getId()+"'and insdt > '"+start+"' and insdt < '"+end+"' order by insdt desc"); - if (planRecordAbnormities.size()==0) { - return false; - }else { - return true; - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - return false; - } - /** - * 是否未被占用 - * @param id - * @param planNumber - * @return - */ - public boolean checkNotOccupied(String id, String planNumber) { - List list = this.selectListByWhere(" where plan_number ='"+planNumber+"' order by insdt"); - if(id == null){//新增 - if(list!=null && list.size()>0){ - return true; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(MaintenancePlan maintenancePlan :list){ - if(!id.equals(maintenancePlan.getId())){//不是当前编辑的那条记录 - return true; - } - } - } - } - return false; - } - /** - * 发起保养计划审核 - * @param maintenanceDetail - * @return - */ - @Transactional - public int startPlanAudit(MaintenancePlan maintenancePlan) { - try { - Map variables = new HashMap(); - if(!maintenancePlan.getAuditId().isEmpty()){ - variables.put("userIds", maintenancePlan.getAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Maintain_Plan.getId()+"-"+maintenancePlan.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(maintenancePlan.getId(), maintenancePlan.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - maintenancePlan.setProcessid(processInstance.getId()); - maintenancePlan.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - MaintenancePlan mPlan = selectById(maintenancePlan.getId()); - int res = 0; - if (null == mPlan) { - res = save(maintenancePlan); - }else { - res = update(maintenancePlan); - } - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenancePlan); - businessUnitRecord.sendMessage(maintenancePlan.getAuditId(),""); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 保养计划审核审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - MaintenancePlan maintenancePlan = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(maintenancePlan.getProcessid()).singleResult(); - if (task!=null) { - maintenancePlan.setActive(task.getName()); - }else{ - maintenancePlan.setActive(MaintenanceCommString.PLAN_FINISH); - } - int res =this.update(maintenancePlan); - return res; - } -} diff --git a/src/com/sipai/service/equipment/SpecialEquipmentService.java b/src/com/sipai/service/equipment/SpecialEquipmentService.java deleted file mode 100644 index c0f4a81b..00000000 --- a/src/com/sipai/service/equipment/SpecialEquipmentService.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.service.equipment; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.SpecialEquipmentDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.SpecialEquipment; -import com.sipai.tools.CommService; - -@Service -public class SpecialEquipmentService implements CommService{ - - @Resource - private SpecialEquipmentDao specialEquipmentDao; - @Resource - private EquipmentCardService equipmentCardService; - - - @Override - public SpecialEquipment selectById(String t) { - // TODO Auto-generated method stub - return specialEquipmentDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return specialEquipmentDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(SpecialEquipment t) { - // TODO Auto-generated method stub - return specialEquipmentDao.insertSelective(t); - } - - @Override - public int update(SpecialEquipment t) { - // TODO Auto-generated method stub - return specialEquipmentDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - SpecialEquipment se = new SpecialEquipment(); - se.setWhere(t); - return specialEquipmentDao.selectListByWhere(se); - - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - SpecialEquipment se = new SpecialEquipment(); - se.setWhere(t); - return specialEquipmentDao.deleteByWhere(se); - - } - - public List unitSearchSpecialEquipment(String sqlStr){ - //List esList= null; - SpecialEquipment se = new SpecialEquipment(); - se.setWhere(sqlStr); - List seList=specialEquipmentDao.selectListByWhere(se); - if(seList.size() >0 && null!=seList && !seList.isEmpty()){ - for(SpecialEquipment specialEquipment : seList ){ - if(null!=specialEquipment.getEquipmentCardId() && !"".equals(specialEquipment.getEquipmentCardId())){ - String ecId = specialEquipment.getEquipmentCardId(); - EquipmentCard ec=equipmentCardService.selectById(ecId); - if(null!=ec && !"".equals(ec)){ - - specialEquipment.setEquipmentCard(ec); - } - } - } - } - return seList; - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/equipment/impl/EquipmentClassServiceImpl.java b/src/com/sipai/service/equipment/impl/EquipmentClassServiceImpl.java deleted file mode 100644 index 372774a7..00000000 --- a/src/com/sipai/service/equipment/impl/EquipmentClassServiceImpl.java +++ /dev/null @@ -1,1570 +0,0 @@ -package com.sipai.service.equipment.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.tools.LibraryTool; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.EquipmentClassDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.maintenance.MaintainCommStr; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassPropService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class EquipmentClassServiceImpl implements EquipmentClassService { - @Resource - private EquipmentClassDao equipmentClassDao; - @Resource - private EquipmentClassPropService equipmentClassPropService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private LibraryTool libraryTool; - - public List selectList() { - // TODO Auto-generated method stub - EquipmentClass equipmentClass = new EquipmentClass(); - return this.equipmentClassDao.selectList(equipmentClass); - } - - @Override - public EquipmentClass selectById(String id) { - return this.equipmentClassDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.equipmentClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentClass equipmentClass) { - return this.equipmentClassDao.insert(equipmentClass); - } - - @Override - public int update(EquipmentClass equipmentClass) { - return this.equipmentClassDao.updateByPrimaryKeySelective(equipmentClass); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(wherestr); - return this.equipmentClassDao.selectListByWhere(equipmentClass); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(wherestr); - return this.equipmentClassDao.deleteByWhere(equipmentClass); - } - - /** - * 是否未被占用 - * - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name) { - List list = this.selectListByWhere(" where name='" + name + "' order by insdt"); - if (id == null) {//新增 - if (list != null && list.size() > 0) { - return true; - } - } else {//编辑 - if (list != null && list.size() > 0) { - for (EquipmentClass equipmentclass : list) { - if (!id.equals(equipmentclass.getId())) {//不是当前编辑的那条记录 - return true; - } - } - } - } - return false; - } - - /** - * 暂时不用 sj 2020-07-10 - */ - @SuppressWarnings("unchecked") - @Override - public List selectTree(String wherestr) { - EquipmentClass equipmentClass = new EquipmentClass(); - JSONArray jsonArray = new JSONArray(); - - //一级菜单查询所有pid为-1的数据 - equipmentClass.setWhere("where pid='-1' order by name"); - List list = equipmentClassDao.selectListByWhere(equipmentClass); - for (EquipmentClass equipmentclass : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", equipmentclass.getId()); - jsonObject.put("text", equipmentclass.getName()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - - JSONArray jsonArray2 = new JSONArray(); - equipmentClass.setWhere("where pid='" + equipmentclass.getId() + "' order by name"); - List list2 = equipmentClassDao.selectListByWhere(equipmentClass); - for (EquipmentClass equipmentclass2 : list2) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", equipmentclass2.getId()); - jsonObject2.put("text", equipmentclass2.getName()); - jsonObject2.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - - JSONArray jsonArray3 = new JSONArray(); - equipmentClass.setWhere("where pid='" + equipmentclass2.getId() + "' order by name"); - List list3 = equipmentClassDao.selectListByWhere(equipmentClass); - for (EquipmentClass equipmentclass3 : list3) { - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("id", equipmentclass3.getId()); - jsonObject3.put("text", equipmentclass3.getName()); - jsonObject3.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - jsonArray3.add(jsonObject3); - } - jsonObject2.put("nodes", jsonArray3); - jsonArray2.add(jsonObject2); - } - jsonObject.put("nodes", jsonArray2); - jsonArray.add(jsonObject); - } - return jsonArray; - } - - //2020-07-06 start - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeListtest(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - if (list != null) { - for (EquipmentClass k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - map.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - map.put("text", k.getName()); - } - map.put("pid", k.getPid()); - map.put("type", k.getType()); - map.put("code", k.getEquipmentClassCode()); - - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Category)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Parts)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - } - - // 如果 这条数据是部位 并且 在配置文件是为打开情况下可加入 -// System.out.println(k.getType()); - if (k.getType().equals(CommString.EquipmentClass_Parts) && "y".equals(libraryTool.getRepairPart())) { - list_result.add(map); - } else if (!k.getType().equals(CommString.EquipmentClass_Parts)) { - list_result.add(map); - } - } - } - getTreeListtest(list_result, list); - } - } else if (list_result.size() > 0 && list != null && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - if (list != null) { - for (EquipmentClass k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - m.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - m.put("text", k.getName()); - } - m.put("pid", k.getPid()); - m.put("type", k.getType()); - m.put("code", k.getEquipmentClassCode()); - - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Category)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Parts)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - } - - // 如果 这条数据是部位 并且 在配置文件是为打开情况下可加入 - if (k.getType().equals(CommString.EquipmentClass_Parts) && "y".equals(libraryTool.getRepairPart())) { - childlist.add(m); - } else if (!k.getType().equals(CommString.EquipmentClass_Parts)) { - childlist.add(m); - } - } - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeListtest(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 设备台账左边树定制 - * - * @param list_result - * @param list - * @return - */ - public String getTreeListtest2(List> list_result, List list, String unitId) { - if (list_result == null) { - list_result = new ArrayList>(); - if (list != null) { - for (EquipmentClass k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - map.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - map.put("text", k.getName()); - } - map.put("pid", k.getPid()); - map.put("type", "e"); - map.put("code", k.getEquipmentClassCode()); - - List list_e = equipmentCardService.selectSimpleListByWhere("where bizid = '" + unitId + "' and equipment_big_class_id = '" + k.getId() + "'"); - if (list_e != null && list_e.size() > 0) { - list_result.add(map); - } - - } - } - getTreeListtest2(list_result, list, unitId); - } - } else if (list_result.size() > 0 && list != null && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - if (list != null) { - for (EquipmentClass k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - m.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - m.put("text", k.getName()); - } - m.put("pid", k.getPid()); - m.put("type", "e"); - m.put("code", k.getEquipmentClassCode()); - - List list_e = equipmentCardService.selectSimpleListByWhere("where bizid = '" + unitId + "' and equipmentClassID = '" + k.getId() + "'"); - if (list_e != null && list_e.size() > 0) { - childlist.add(m); - } - - } - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeListtest2(childlist, list, unitId); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 与getTreeListtest接口一样 多插入了一层设备 - */ - public String getTreeListtest4Equ(List> list_result, List list, String unitId) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (EquipmentClass k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - map.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - map.put("text", k.getName()); - } - map.put("pid", k.getPid()); - map.put("type", k.getType()); - - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Category)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Parts)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - } - - list_result.add(map); - } - } - getTreeListtest4Equ(list_result, list, unitId); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (EquipmentClass k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - m.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - m.put("text", k.getName()); - } - m.put("pid", k.getPid()); - m.put("type", k.getType()); - - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Category)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Parts)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - } - - //插入设备 - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere("where type='" + CommString.EquipmentClass_Parts + "' and pid='" + k.getId().toString() + "'"); - - List equipmentlist = equipmentCardService.selectListByWhere("where equipmentClassID = '" + k.getId().toString() + "' and bizId = '" + unitId + "'"); - List> equlist = new ArrayList>(); - - for (EquipmentCard equipmentCard : equipmentlist) { - Map mequ = new HashMap(); - mequ.put("id", equipmentCard.getId()); - mequ.put("text", equipmentCard.getEquipmentname()); - mequ.put("pid", k.getId().toString()); - mequ.put("type", "4"); - mequ.put("icon", TimeEfficiencyCommStr.EquipmentClassEquipment); - - List partlist = equipmentClassDao.selectListByWhere(equipmentClass); - List> partmap = new ArrayList>(); - - for (EquipmentClass equipmentClass2 : partlist) { - Map mpart = new HashMap(); - mpart.put("id", equipmentClass2.getId()); - mpart.put("text", equipmentClass2.getName()); - mpart.put("pid", equipmentCard.getId()); - mpart.put("type", "4"); - mpart.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - mpart.put("nodes", null); - - partmap.add(mpart); - mequ.put("nodes", partmap); - } - equlist.add(mequ); - } - m.put("nodes", equlist); - } - - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeListtest4Equ(childlist, list, unitId); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 与getTreeListtest接口一样 多插入了一层设备型号层 - */ - public String getTreeListtest4Model(List> list_result, List list, String unitId) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (EquipmentClass k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - map.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - map.put("text", k.getName()); - } - map.put("pid", k.getPid()); - map.put("type", k.getType()); - - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Category)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Parts)) { - map.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - } - - list_result.add(map); - } - } - getTreeListtest4Model(list_result, list, unitId); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (EquipmentClass k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - if (k.getEquipmentClassCode() != null && !k.getEquipmentClassCode().equals("")) { - m.put("text", "(" + k.getEquipmentClassCode() + ")" + k.getName()); - } else { - m.put("text", k.getName()); - } - m.put("pid", k.getPid()); - m.put("type", k.getType()); - - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Category)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); - } - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Parts)) { - m.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - } - - //插入设备型号 - if (k.getType() != null && k.getType().equals(CommString.EquipmentClass_Equipment)) { - - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere("where type='" + CommString.EquipmentClass_Parts + "' and pid='" + k.getId().toString() + "'"); - - List equipmentTypeNumbers = equipmentTypeNumberService.selectListByWhere("where pid = '" + k.getId().toString() + "' order by name"); - List> equlist = new ArrayList>(); - - for (EquipmentTypeNumber equipmentTypeNumber : equipmentTypeNumbers) { - Map mequ = new HashMap(); - mequ.put("id", equipmentTypeNumber.getId()); - mequ.put("text", equipmentTypeNumber.getName()); - mequ.put("pid", k.getId().toString()); - mequ.put("type", "4"); - mequ.put("icon", TimeEfficiencyCommStr.EquipmentClassEquipment); - - List partlist = equipmentClassDao.selectListByWhere(equipmentClass); - List> partmap = new ArrayList>(); - - for (EquipmentClass equipmentClass2 : partlist) { - Map mpart = new HashMap(); - mpart.put("id", equipmentClass2.getId()); - mpart.put("text", equipmentClass2.getName()); - mpart.put("pid", equipmentTypeNumber.getId()); - mpart.put("type", "4"); - mpart.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); - mpart.put("nodes", null); - - partmap.add(mpart); - mequ.put("nodes", partmap); - } - equlist.add(mequ); - } - m.put("nodes", equlist); - - childlist.add(m);// - } - - //childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeListtest4Model(childlist, list, unitId); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - public int deleteAllById(String id) { - int result = 0; - deleteById(id); - equipmentClassPropService.deleteByWhere(" where equipment_class_id='" + id + "'"); - List equipmentClasseList = selectListByWhere("where pid = '" + id + "'"); - if (equipmentClasseList.size() > 0 || equipmentClasseList != null || !equipmentClasseList.isEmpty()) { - for (EquipmentClass equipment : equipmentClasseList) { - deleteAllById(equipment.getId()); - } - } - result++; - return result; - } - //2020-07-06 end - - //2020-07-11 start - public String selectBelongAllParentId(EquipmentClass equipmentClass, String equipmentClassCode) { - StringBuilder equipmentClassCodeSb = new StringBuilder(equipmentClassCode + ","); - if (null != equipmentClass && !"".equals(equipmentClass)) { - EquipmentClass equipmentClassVar = selectById(equipmentClass.getPid()); - if (null != equipmentClassVar && !"".equals(equipmentClassVar)) { - String parentEquipmentClassCode = equipmentClassVar.getEquipmentClassCode(); - equipmentClassCodeSb.append(parentEquipmentClassCode); - - selectBelongAllParentId(equipmentClassVar, parentEquipmentClassCode); - } - } - String rsultStr = equipmentClassCodeSb.toString(); - return rsultStr; - } - //2020-07-11 end - - public TreeSet selectListByIds(String ids) { - TreeSet classIdList = new TreeSet(); - if (ids != null) { - String[] id = ids.split(","); - if (id != null) { - for (int i = 0; i < id.length; i++) { - //反向递归找到子节点的所有父节点及根节点 - TreeSet list2 = selectListByChild(classIdList, id[i]); - - Iterator itSet = list2.iterator();//也可以遍历输出 - while (itSet.hasNext()) { - classIdList.add(itSet.next()); - } - } - } - } - return classIdList; - } - - /** - * 反向递归父节点 - */ - public TreeSet selectListByChild(TreeSet classIdList, String pid) { - classIdList.add(pid); - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(" where id='" + pid + "'"); - List classList = equipmentClassDao.selectListByWhere(equipmentClass); - if (classList.size() > 0 && null != classList && !classList.isEmpty()) { - //System.out.println(classList.get(0).getPid()); - if (classList.get(0).getPid() != null && !classList.get(0).getPid().equals("-1")) { - //不是根节点 - classIdList.add(classList.get(0).getId());//保存上一层及id - selectListByChild(classIdList, classList.get(0).getPid()); - } else { - //为根节点 - classIdList.add(classList.get(0).getId());//保存上一层及id - } - } - return classIdList; - } - - /** - * 反向递归父节点 - */ - public TreeSet getRootId(TreeSet classIdList, String pid) { - //classIdList.add(pid); - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(" where id='" + pid + "'"); - List classList = equipmentClassDao.selectListByWhere(equipmentClass); - if (classList.size() > 0 && null != classList && !classList.isEmpty()) { - if (!classList.get(0).getPid().equals("-1")) { - //不是根节点 - //classIdList.add(classList.get(0).getId());//保存上一层及id - selectListByChild(classIdList, classList.get(0).getPid()); - } else { - //为根节点 - classIdList.add(classList.get(0).getId());//保存上一层及id - } - } - return classIdList; - } - - /** - * 反向查取所有父节点的code拼接保存 - */ - public Map getCodeFull4Tree(Map resultMap, String code, String id, int markInt) { - resultMap.put(markInt, code); - markInt++; - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(" where id='" + id + "'"); - List classList = equipmentClassDao.selectListByWhere(equipmentClass); - if (classList != null && classList.size() > 0) { - String pidVar = classList.get(0).getPid(); - String codeVar = classList.get(0).getEquipmentClassCode(); - resultMap.put(markInt, codeVar); - if (!classList.get(0).getPid().equals("-1")) { - //不是根节点 - getCodeFull4Tree(resultMap, codeVar, pidVar, markInt); - } - } - return resultMap; - } - - public TreeSet getAllChildId(TreeSet classIdList, String id) { - classIdList.add(id); - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(" where pid='" + id + "'"); - List classList = equipmentClassDao.selectListByWhere(equipmentClass); - if (classList.size() > 0 && null != classList && !classList.isEmpty()) { - for (EquipmentClass equipmentClassVar : classList) { - classIdList.add(equipmentClassVar.getId()); - getAllChildId(classIdList, equipmentClassVar.getId()); - } - } - return classIdList; - } - - /* @Override - public List selectEquBigClassByProSecAndCompanyId( - EquipmentCard equipmentCard) { - // TODO Auto-generated method stub - return equipmentClassDao.selectEquBigClassByProSecAndCompanyId(equipmentCard); - - }*/ - - @Override - public List selectEquSmallClassByBigClass(EquipmentCard equipmentCard) { - // TODO Auto-generated method stub - return equipmentClassDao.selectEquSmallClassByBigClass(equipmentCard); - } - - @Override - public List selectDistinctEquBigClass(EquipmentCard equipmentCard) { - // TODO Auto-generated method stub - - return equipmentClassDao.selectDistinctEquBigClass(equipmentCard); - } - - @Override - public void doExportEquipmentClass(HttpServletResponse response, - String unitId) throws IOException { - EquipmentClass equipmentClass = new EquipmentClass(); - - String fileName = "设备类型树.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - //if(equipmentClasses!=null && equipmentClasses.size()>0){ - //for (int z = 0; z < equipmentClasses.size(); z++) { - String title = "设备类型树"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000);//大类代码 - sheet.setColumnWidth(1, 3000);//大类名称 - sheet.setColumnWidth(2, 6000);//大类说明 - sheet.setColumnWidth(3, 3000);//小类代码 - sheet.setColumnWidth(4, 3000);//小类名称 - sheet.setColumnWidth(5, 3000); - sheet.setColumnWidth(6, 3000); - sheet.setColumnWidth(7, 6000);//小类说明 - sheet.setColumnWidth(8, 3000); - sheet.setColumnWidth(9, 3000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "大类代码,大类名称,大类说明,小类代码,小类名称,ABC分类,计算单位,小类说明,部位代码,部位名称"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("设备类别树"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - equipmentClass.setWhere("where b.type = '1'"); - List list = equipmentClassDao.selectList4Tree(equipmentClass); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(2 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备大类 - if (jsonObject1.has(list.get(i).getB_id())) { - int num = (int) jsonObject1.get(list.get(i).getB_id()); - jsonObject1.put(list.get(i).getB_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getB_id(), 1); - } - - //设备小类 - if (jsonObject2.has(list.get(i).getS_id())) { - int num = (int) jsonObject2.get(list.get(i).getS_id()); - jsonObject2.put(list.get(i).getS_id(), num + 1); - } else { - if (list.get(i).getS_id() != null) { - jsonObject2.put(list.get(i).getS_id(), 1); - } else { - jsonObject2.put("空" + CommUtil.getUUID(), 1); - } - } - - //设备部位 - if (jsonObject3.has(list.get(i).getP_id())) { - int num = (int) jsonObject3.get(list.get(i).getP_id()); - jsonObject3.put(list.get(i).getP_id(), num + 1); - } else { - if (list.get(i).getP_id() != null) { - jsonObject3.put(list.get(i).getP_id(), 1); - } else { - jsonObject3.put("空" + CommUtil.getUUID(), 1); - } - } - - //大类代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getB_code()); - //大类名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getB_name()); - //大类说明 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getB_remark()); - //小类代号 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getS_code()); - //小类名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getS_name()); - //ABC分类 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getEquipmentLevelId()); - //计量单位 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getUnit()); - //小类说明 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getS_remark()); - //部位代码 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getP_code()); - //部位名称 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getP_name()); - } - - int rownum = 2;//第2行开始 - - //设备大类合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - if (num > 1) { - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - } - rownum = rownum + num; - } - - //第2行开始 - rownum = 2; - - //设备小类合并单元格 - for (Iterator iter = jsonObject2.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - if (num > 1) { - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 7, 7)); - } - rownum = rownum + num; - } - - //第2行开始 - rownum = 2; - - //设备部位合并单元格 - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - if (num > 1) { - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 7, 7)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 8, 8)); - } - rownum = rownum + num; - } - } - //} - //} - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); -// System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Transactional - public String readXls(InputStream input, String userId, String unitId) throws IOException { - System.out.println("导入设备类型开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int res_suc = 0;//成功行数 - int res_fail = 0;//失败行数 - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 10) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+2行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(0)) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - String cell_big_class_code = getMergedRegionValue(sheet, rowNum, 0);//大类代码 - String cell_big_class_name = getMergedRegionValue(sheet, rowNum, 1);//大类名称 - String cell_big_class_remark = getMergedRegionValue(sheet, rowNum, 2);//大类说明 - String cell_small_class_code = getMergedRegionValue(sheet, rowNum, 3);//小类代码 - String cell_small_class_name = getMergedRegionValue(sheet, rowNum, 4);//小类名称 - String cell_ABC = getMergedRegionValue(sheet, rowNum, 5);//ABC - String cell_small_class_unit = getMergedRegionValue(sheet, rowNum, 6);//计量单位 - String cell_small_class_remark = getMergedRegionValue(sheet, rowNum, 7);//小类说明 - String cell_part_class_code = getMergedRegionValue(sheet, rowNum, 8);//部位代码 - String cell_part_class_name = getMergedRegionValue(sheet, rowNum, 9);//部位名称 - - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere("where equipment_class_code = '" + cell_big_class_code + "' and type = '" + CommString.EquipmentClass_Category + "' and pid = '-1' "); - EquipmentClass equipmentClass_big = equipmentClassDao.selectByWhere(equipmentClass); - int big_res = 0;//大类数据库执行情况 - int small_res = 0;//小类数据库执行情况 - int part_res = 0;//部位数据库执行情况 - - String big_id = ""; - String small_id = ""; - - EquipmentClass equipmentClassBig = new EquipmentClass(); - if (equipmentClass_big != null) { - //修改大类 - big_id = equipmentClass_big.getId(); - equipmentClassBig.setId(big_id); - equipmentClassBig.setName(cell_big_class_name); - equipmentClassBig.setRemark(cell_big_class_remark); - big_res = equipmentClassDao.updateByPrimaryKeySelective(equipmentClassBig); - } else { - //新增大类 - big_id = CommUtil.getUUID(); - equipmentClassBig.setId(big_id); - equipmentClassBig.setName(cell_big_class_name); - equipmentClassBig.setRemark(cell_big_class_remark); - equipmentClassBig.setInsdt(CommUtil.nowDate()); - equipmentClassBig.setInsuser(userId); - equipmentClassBig.setActive("启用"); - equipmentClassBig.setPid("-1"); - equipmentClassBig.setMorder(rowNum); - equipmentClassBig.setEquipmentClassCode(cell_big_class_code); - equipmentClassBig.setType(CommString.EquipmentClass_Category); - big_res = equipmentClassDao.insert(equipmentClassBig); - } - - //没有小类代码的不导入 - if (null == row || null == row.getCell(3)) { - continue; - } - - //大类成功才能进行后面字段的处理 - EquipmentClass equipmentClassSmall = new EquipmentClass(); - if (big_res == 1) { - equipmentClass.setWhere("where equipment_class_code = '" + cell_small_class_code + "' and type = '" + CommString.EquipmentClass_Equipment + "' and pid = '" + big_id + "'"); - EquipmentClass equipmentClass_small = equipmentClassDao.selectByWhere(equipmentClass); - if (equipmentClass_small != null) { - //修改小类 - small_id = equipmentClass_small.getId(); - equipmentClassSmall.setId(small_id); - equipmentClassSmall.setName(cell_small_class_name); - equipmentClassSmall.setRemark(cell_small_class_remark); - equipmentClassSmall.setUnit(cell_small_class_unit); - equipmentClassSmall.setEquipmentClassCodeFull(cell_big_class_code + "" + cell_small_class_code); - small_res = equipmentClassDao.updateByPrimaryKeySelective(equipmentClassSmall); - } else { - //新增小类 - small_id = CommUtil.getUUID(); - equipmentClassSmall.setId(small_id); - equipmentClassSmall.setName(cell_small_class_name); - equipmentClassSmall.setRemark(cell_small_class_remark); - equipmentClassSmall.setUnit(cell_small_class_unit); - equipmentClassSmall.setInsdt(CommUtil.nowDate()); - equipmentClassSmall.setInsuser(userId); - equipmentClassSmall.setActive("启用"); - equipmentClassSmall.setPid(big_id);//大类id - equipmentClassSmall.setMorder(rowNum); - equipmentClassSmall.setEquipmentClassCode(cell_small_class_code); - equipmentClassSmall.setEquipmentClassCodeFull(cell_big_class_code + "" + cell_small_class_code); - equipmentClassSmall.setType(CommString.EquipmentClass_Equipment); - small_res = equipmentClassDao.insert(equipmentClassSmall); - } - } - - //没有小类代码的不导入 - if (null == row || null == cell_part_class_code) { - continue; - } - if (small_res == 1) { - EquipmentClass equipmentClassPart = new EquipmentClass(); - equipmentClass.setWhere("where equipment_class_code = '" + cell_part_class_code + "' and type = '" + CommString.EquipmentClass_Parts + "' and pid = '" + small_id + "'"); - EquipmentClass equipmentClass_part = equipmentClassDao.selectByWhere(equipmentClass); - if (equipmentClass_part != null) { - //修改部位 - equipmentClassPart.setId(equipmentClass_part.getId()); - equipmentClassPart.setName(cell_part_class_name); - equipmentClassPart.setEquipmentClassCodeFull(cell_big_class_code + "" + cell_small_class_code + "" + cell_part_class_code); - part_res = equipmentClassDao.updateByPrimaryKeySelective(equipmentClassPart); - } else { - //新增部位 - equipmentClassPart.setId(CommUtil.getUUID()); - equipmentClassPart.setName(cell_part_class_name); - equipmentClassPart.setInsdt(CommUtil.nowDate()); - equipmentClassPart.setInsuser(userId); - equipmentClassPart.setActive("启用"); - equipmentClassPart.setPid(small_id);//小类id - equipmentClassPart.setMorder(rowNum); - equipmentClassPart.setEquipmentClassCode(cell_part_class_code); - equipmentClassPart.setEquipmentClassCodeFull(cell_big_class_code + "" + cell_small_class_code + "" + cell_part_class_code); - equipmentClassPart.setType(CommString.EquipmentClass_Parts); - part_res = equipmentClassDao.insert(equipmentClassPart); - } - } - if (part_res == 1) { - res_suc += 1; - } else { - res_fail += 1; - } - } - } - String result = ""; - result = "" - + "成功处理:" + res_suc + "条,失败处理:" + res_fail + "条!"; - System.out.println("导入大修库结束=============" + CommUtil.nowDate()); - return result; - } - - @Transactional - public String readXlsx(InputStream input, String userId, String unitId) throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public List selectList4Tree(String wherestr) { - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(wherestr); - List list = equipmentClassDao.selectList4Tree(equipmentClass); - return list; - } - - /* @Override - public List selectDistinctEquSmallClass(EquipmentCard equipmentCard) { - // TODO Auto-generated method stub - return equipmentClassDao.selectDistinctEquSmallClass(equipmentCard); - }*/ - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - - for (int i = 0; i < sheetMergeCount; i++) { - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell); - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell); - } - - @Override - public EquipmentClass selectByWhere(String wherestr) { - EquipmentClass equipmentClass = new EquipmentClass(); - equipmentClass.setWhere(wherestr); - return equipmentClassDao.selectByWhere(equipmentClass); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (EquipmentClass k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (EquipmentClass k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - // List tags = new ArrayList(); - // tags.add(k.getDescription()); - // m.put("tags", tags); - childlist.add(m); - } - } - if (childlist.size() > 0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); - // JSONObject jsonObject = new JSONObject(); - // jsonObject.put("text", "sdfsf"); - - getTreeList(childlist, list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - - List t = new ArrayList(); - - @Override - public List getUnitChildrenById(String id) { - t = selectListByWhere(" where 1=1 "); - List listRes = getChildren(id, t); - listRes.add(selectById(id)); - listRes.removeAll(Collections.singleton(null)); - return listRes; - } - - /** - * 递归获取子节点 - * - * @param - */ - public List getChildren(String pid, List t) { - List t2 = new ArrayList(); - for (int i = 0; i < t.size(); i++) { - if (t.get(i).getPid() != null && t.get(i).getPid().equalsIgnoreCase(pid)) { - // t.get(i).setName(t.get(i).getName()); - t2.add(t.get(i)); - List result = getChildren(t.get(i).getId(), t); - if (result != null) { - t2.addAll(result); - } - } - } - return t2; - } - - /* - * 只获取本厂设备台帐有的设备类型Id - * @see com.sipai.service.equipment.EquipmentClassService#getTreeIdS4Have(java.lang.String) - */ - @Override - public String getTreeIdS4Have(String unitId) { - HashSet smallset = new HashSet(); - //获取所有设备台账对应的设备小类去重后id - List list = equipmentCardService.getEquipmentClassIdGroupByBizId(unitId); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - smallset.add(list.get(i).getEquipmentclassid()); - } - } - - //所有根节点id - HashSet rootIds = new HashSet(); - for (Iterator iter = smallset.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - TreeSet set = new TreeSet(); - TreeSet treeSet = this.getRootId(set, sid); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - String rid = iterroot.next(); - rootIds.add(rid); - } - } - - //获取完根节点后再获取设备部位 避免重复获取根节点 - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List listClass = this.selectListByWhere("where pid = '" + list.get(i).getEquipmentclassid() + "'"); - if (listClass != null && listClass.size() > 0) { - for (int j = 0; j < listClass.size(); j++) { - smallset.add(listClass.get(j).getId()); - } - } - } - } - - String bigId = ""; - if (rootIds != null && rootIds.size() > 0) { - for (Iterator iter = rootIds.iterator(); iter.hasNext(); ) { - String id = iter.next(); - bigId += "'" + id + "',"; - } - bigId = bigId.substring(0, bigId.length() - 1); - } - - //所有存在的节点 - List listchild = null; - //查询所有子节点 - - String allId = ""; - String smallId = ""; - - //查询所有的根节点 - JSONArray rootArray = new JSONArray(); - List listroot = this.selectListByWhere(" where id in (" + bigId + ")"); - if (listroot != null && listroot.size() > 0) { - for (int i = 0; i < listroot.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", listroot.get(i).getId()); - jsonObject.put("text", listroot.get(i).getEquipmentClassCode() + "" + listroot.get(i).getName()); - jsonObject.put("pid", listroot.get(i).getPid()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - - - TreeSet set = new TreeSet(); - TreeSet treeSet = this.getAllChildId(set, listroot.get(i).getId()); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - if (smallset.contains(sid) == true) { - smallId += "'" + sid + "',"; - } - } - - rootArray.add(jsonObject); - } - allId = smallId + bigId; - } - - return allId; - } - - @Override - public String getTreeIdS4HaveBigId(String unitId) { - HashSet smallset = new HashSet(); - //获取所有设备台账对应的设备小类去重后id - List list = equipmentCardService.getEquipmentClassIdGroupByBizId(unitId); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - smallset.add(list.get(i).getEquipmentclassid()); - } - } - - //所有根节点id - HashSet rootIds = new HashSet(); - for (Iterator iter = smallset.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - TreeSet set = new TreeSet(); - TreeSet treeSet = this.getRootId(set, sid); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - String rid = iterroot.next(); - rootIds.add(rid); - } - } - - //获取完根节点后再获取设备部位 避免重复获取根节点 - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List listClass = this.selectListByWhere("where pid = '" + list.get(i).getEquipmentclassid() + "'"); - if (listClass != null && listClass.size() > 0) { - for (int j = 0; j < listClass.size(); j++) { - smallset.add(listClass.get(j).getId()); - } - } - } - } - - String bigId = ""; - if (rootIds != null && rootIds.size() > 0) { - for (Iterator iter = rootIds.iterator(); iter.hasNext(); ) { - String id = iter.next(); - bigId += "'" + id + "',"; - } - bigId = bigId.substring(0, bigId.length() - 1); - } - - return bigId; - } - - @Override - public String getTreeIdS4HaveSmallId(String unitId) { - HashSet smallset = new HashSet(); - //获取所有设备台账对应的设备小类去重后id - List list = equipmentCardService.getEquipmentClassIdGroupByBizId(unitId); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - smallset.add(list.get(i).getEquipmentclassid()); - } - } - - //所有根节点id - HashSet rootIds = new HashSet(); - for (Iterator iter = smallset.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - TreeSet set = new TreeSet(); - TreeSet treeSet = this.getRootId(set, sid); - for (Iterator iterroot = treeSet.iterator(); iterroot.hasNext(); ) { - String rid = iterroot.next(); - rootIds.add(rid); - } - } - - //获取完根节点后再获取设备部位 避免重复获取根节点 - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List listClass = this.selectListByWhere("where pid = '" + list.get(i).getEquipmentclassid() + "'"); - if (listClass != null && listClass.size() > 0) { - for (int j = 0; j < listClass.size(); j++) { - smallset.add(listClass.get(j).getId()); - } - } - } - } - - String bigId = ""; - if (rootIds != null && rootIds.size() > 0) { - for (Iterator iter = rootIds.iterator(); iter.hasNext(); ) { - String id = iter.next(); - bigId += "'" + id + "',"; - } - bigId = bigId.substring(0, bigId.length() - 1); - } - - //所有存在的节点 - List listchild = null; - //查询所有子节点 - - String allId = ""; - String smallId = ""; - - //查询所有的根节点 - JSONArray rootArray = new JSONArray(); - List listroot = this.selectListByWhere(" where id in (" + bigId + ")"); - if (listroot != null && listroot.size() > 0) { - for (int i = 0; i < listroot.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", listroot.get(i).getId()); - jsonObject.put("text", listroot.get(i).getEquipmentClassCode() + "" + listroot.get(i).getName()); - jsonObject.put("pid", listroot.get(i).getPid()); - jsonObject.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); - - - TreeSet set = new TreeSet(); - TreeSet treeSet = this.getAllChildId(set, listroot.get(i).getId()); - for (Iterator iter = treeSet.iterator(); iter.hasNext(); ) { - String sid = iter.next(); - if (smallset.contains(sid) == true) { - smallId += "'" + sid + "',"; - } - } - - rootArray.add(jsonObject); - } - if (smallId != null && !smallId.equals("")) { - smallId = smallId.substring(0, smallId.length() - 1); - } - } - - return smallId; - } -} diff --git a/src/com/sipai/service/equipment/impl/EquipmentFittingsServiceImpl.java b/src/com/sipai/service/equipment/impl/EquipmentFittingsServiceImpl.java deleted file mode 100644 index 02c86237..00000000 --- a/src/com/sipai/service/equipment/impl/EquipmentFittingsServiceImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.sipai.service.equipment.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentFittingsDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentFittings; -import com.sipai.entity.sparepart.Stock; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentFittingsService; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.sparepart.StockService; - -@Service -public class EquipmentFittingsServiceImpl implements EquipmentFittingsService{ - @Resource - private EquipmentFittingsDao equipmentFittingsDao; - @Resource - private GoodsService goodsService; - @Resource - private StockService stockService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public EquipmentFittings selectById(String id) { - EquipmentFittings equipmentFittings = this.equipmentFittingsDao.selectByPrimaryKey(id); - return equipmentFittings; - } - - @Override - public int deleteById(String id) { - int code = this.equipmentFittingsDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(EquipmentFittings equipmentFittings) { - int code = this.equipmentFittingsDao.insert(equipmentFittings); - return code; - } - - @Override - public int update(EquipmentFittings equipmentFittings) { - int code = this.equipmentFittingsDao.updateByPrimaryKeySelective(equipmentFittings); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentFittings equipmentFittings = new EquipmentFittings(); - equipmentFittings.setWhere(wherestr); - List list = this.equipmentFittingsDao.selectListByWhere(equipmentFittings); - for (EquipmentFittings item : list) { - item.setGoods(this.goodsService.selectById(item.getGoodsId())); - List stocks = this.stockService.selectListByWhere(" goods_id = '"+item.getGoodsId()+"'"); - if(stocks!=null&&stocks.size()==1){ - item.setStock(stocks.get(0)); - } - - } - return list; - } - - @Override - public List selectListWithEQByWhere(String wherestr) { - EquipmentFittings equipmentFittings = new EquipmentFittings(); - equipmentFittings.setWhere(wherestr); - List list = this.equipmentFittingsDao.selectListWithEqByWhere(equipmentFittings); - for (EquipmentFittings item : list) { -// item.setGoods(this.goodsService.selectById(item.getGoodsId())); - List stocks = this.stockService.selectListByWhere(" goods_id = '"+item.getGoodsId()+"'"); - if(stocks!=null&&stocks.size()==1){ - item.setStock(stocks.get(0)); - } - -// List equipmentCard = this.equipmentCardService.selectListByWhere(" where id='"+item.getEquipmentId()+"' "); -// if(equipmentCard!=null&&equipmentCard.size()>0){ -// item.setEquipmentCard(equipmentCard.get(0)); -// } - - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentFittings equipmentFittings = new EquipmentFittings(); - equipmentFittings.setWhere(wherestr); - int code = this.equipmentFittingsDao.deleteByWhere(equipmentFittings); - return code; - } - - @Override - public List selectListWithFaByWhere(String wherestr) { - EquipmentFittings equipmentFittings = new EquipmentFittings(); - equipmentFittings.setWhere(wherestr); - List list = this.equipmentFittingsDao.selectListWithFaByWhere(equipmentFittings); - for (EquipmentFittings item : list) { -// item.setGoods(this.goodsService.selectById(item.getGoodsId())); - List stocks = this.stockService.selectListByWhere(" goods_id = '"+item.getGoodsId()+"'"); - if(stocks!=null&&stocks.size()==1){ - item.setStock(stocks.get(0)); - } - -// List equipmentCard = this.equipmentCardService.selectListByWhere(" where id='"+item.getEquipmentId()+"' "); -// if(equipmentCard!=null&&equipmentCard.size()>0){ -// item.setEquipmentCard(equipmentCard.get(0)); -// } - - } - return list; - } - -} diff --git a/src/com/sipai/service/equipment/impl/FacilitiesCardServiceImpl.java b/src/com/sipai/service/equipment/impl/FacilitiesCardServiceImpl.java deleted file mode 100644 index 6b7c1bde..00000000 --- a/src/com/sipai/service/equipment/impl/FacilitiesCardServiceImpl.java +++ /dev/null @@ -1,1044 +0,0 @@ -package com.sipai.service.equipment.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.equipment.FacilitiesCardDao; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.equipment.FacilitiesCard; -import com.sipai.entity.equipment.FacilitiesCard; -import com.sipai.entity.equipment.FacilitiesClass; -import com.sipai.entity.timeefficiency.PatrolContentsStandard; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.AssetClassService; -import com.sipai.service.equipment.EquipmentStatusManagementService; -import com.sipai.service.equipment.FacilitiesCardService; -import com.sipai.service.equipment.FacilitiesClassService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class FacilitiesCardServiceImpl implements FacilitiesCardService{ - @Resource - private FacilitiesCardDao facilitiesCardDao; - @Resource - private FacilitiesClassService facilitiesClassService; - @Resource - private EquipmentStatusManagementService equipmentStatusManagementService; - @Resource - private CompanyService companyService; - @Resource - private AssetClassService assetClassService; - - @Override - public FacilitiesCard selectById(String id) { - FacilitiesCard facilitiesCard = facilitiesCardDao.selectByPrimaryKey(id); - if(facilitiesCard!=null){ - FacilitiesClass facilitiesClass = facilitiesClassService.selectById(facilitiesCard.getFacilitiesClassId()); - facilitiesCard.setFacilitiesClass(facilitiesClass);//设施分类 - EquipmentStatusManagement equipmentStatusManagement = equipmentStatusManagementService.selectById(facilitiesCard.getAssetStatus()); - facilitiesCard.setEquipmentStatusManagement(equipmentStatusManagement);//设备设施状态 - Company company = companyService.selectByPrimaryKey(facilitiesCard.getUnitId()); - facilitiesCard.setCompany(company); - } - return facilitiesCard; - } - - @Override - public int deleteById(String id) { - return facilitiesCardDao.deleteByPrimaryKey(id); - } - - @Override - public int save(FacilitiesCard entity) { - return facilitiesCardDao.insert(entity); - } - - @Override - public int update(FacilitiesCard entity) { - return facilitiesCardDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - FacilitiesCard entity = new FacilitiesCard(); - entity.setWhere(wherestr); - List list = facilitiesCardDao.selectListByWhere(entity); - for (FacilitiesCard facilitiesCard : list) { - FacilitiesClass facilitiesClass = facilitiesClassService.selectById(facilitiesCard.getFacilitiesClassId()); - facilitiesCard.setFacilitiesClass(facilitiesClass);//设施分类 - EquipmentStatusManagement equipmentStatusManagement = equipmentStatusManagementService.selectById(facilitiesCard.getAssetStatus()); - facilitiesCard.setEquipmentStatusManagement(equipmentStatusManagement);//设备设施状态 - Company company = companyService.selectByPrimaryKey(facilitiesCard.getUnitId()); - facilitiesCard.setCompany(company); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - FacilitiesCard facilitiesCard = new FacilitiesCard(); - facilitiesCard.setWhere(wherestr); - return facilitiesCardDao.deleteByWhere(facilitiesCard); - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column){ - int sheetMergeCount = sheet.getNumMergedRegions(); - - for(int i = 0 ; i < sheetMergeCount ; i++){ - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if(row >= firstRow && row <= lastRow){ - if(column >= firstColumn && column <= lastColumn){ - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell) ; - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell) ; - } - - @Override - public void doExport4Facilities(HttpServletResponse response, String unitId) - throws IOException { - String fileName = "设施台帐"+CommUtil.nowDate().substring(0, 10)+".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "设施台帐"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 3000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 3000); - sheet.setColumnWidth(6, 3000); - sheet.setColumnWidth(7, 3000); - sheet.setColumnWidth(8, 3000); - sheet.setColumnWidth(9, 6000); - sheet.setColumnWidth(10, 6000); - sheet.setColumnWidth(11, 3000); - sheet.setColumnWidth(12, 3000); - sheet.setColumnWidth(13, 3000); - sheet.setColumnWidth(14, 3000); - sheet.setColumnWidth(15, 3000); - sheet.setColumnWidth(16, 3000); - sheet.setColumnWidth(17, 3000); - sheet.setColumnWidth(18, 3000); - sheet.setColumnWidth(19, 3000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,厂区,位置,资产编号,权证编号,建(构)筑物名称,设施类别,结构,建成年月,使用年限,主要参数(长x宽x高),建筑面积或体积(m2或m3),数量(座)," - + "折旧年限(年),账面原值(元),账面净值(元),设计单位,承建单位,资产状态,资产状况评价,备注"; - String[] excelTitle = excelTitleStr.split(","); - - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("设施台帐"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - - String wherestr = "where 1=1 and type = '"+FacilitiesCard.Type_Facilities+"'"; - if(unitId!=null && !unitId.equals("")){ - wherestr += " and unitId = '"+unitId+"' "; - }else { - wherestr += " and id='无' "; - } - FacilitiesCard facilitiesCard = new FacilitiesCard(); - facilitiesCard.setWhere(wherestr + " order by code asc"); - List list = facilitiesCardDao.selectListByWhere(facilitiesCard); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(2+i); - row.setHeight((short) 400); - - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i+1); - - Company company = companyService.selectByPrimaryKey(list.get(i).getUnitId()); - if(company!=null){ - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(company.getSname()); - } - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getPosition()); - - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getAssetClassCode()); - - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getCode()); - - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getName()); - - FacilitiesClass facilitiesClass = facilitiesClassService.selectById(list.get(i).getFacilitiesClassId()); - if(facilitiesClass!=null){ - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(facilitiesClass.getName()); - } - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getStructure()); - - //建成年月 - String completedTime = list.get(i).getCompletedTime(); - if(completedTime!=null && !completedTime.equals("")){ - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(completedTime.substring(0, 10)); - } - - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getUseYearsLimit()); - - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getMainParams()); - - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(list.get(i).getBuiltArea()); - - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(list.get(i).getNumber()); - - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(list.get(i).getDepreciationYearsLimit()); - - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(list.get(i).getOriginalValue()); - - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(list.get(i).getNowValue()); - - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(list.get(i).getDesignUnit()); - - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(list.get(i).getConstructionUnit()); - - EquipmentStatusManagement equipmentStatusManagement = equipmentStatusManagementService.selectById(list.get(i).getAssetStatus()); - if(equipmentStatusManagement!=null && !equipmentStatusManagement.equals("")){ - HSSFCell cell_18 = row.createCell(18); - cell_18.setCellStyle(listStyle); - cell_18.setCellValue(equipmentStatusManagement.getName()); - } - - HSSFCell cell_19 = row.createCell(19); - cell_19.setCellStyle(listStyle); - cell_19.setCellValue(list.get(i).getAssetEvaluate()); - - HSSFCell cell_20 = row.createCell(20); - cell_20.setCellStyle(listStyle); - cell_20.setCellValue(list.get(i).getRemarks()); - } - - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - @Override - public void doExport4Pipeline(HttpServletResponse response, String unitId) - throws IOException { - String fileName = "管道台帐"+CommUtil.nowDate().substring(0, 10)+".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "管道台帐"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 3000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 3000); - sheet.setColumnWidth(6, 3000); - sheet.setColumnWidth(7, 3000); - sheet.setColumnWidth(8, 3000); - sheet.setColumnWidth(9, 6000); - sheet.setColumnWidth(10, 6000); - sheet.setColumnWidth(11, 3000); - sheet.setColumnWidth(12, 3000); - sheet.setColumnWidth(13, 3000); - sheet.setColumnWidth(14, 3000); - sheet.setColumnWidth(15, 3000); - sheet.setColumnWidth(16, 3000); - sheet.setColumnWidth(17, 3000); - sheet.setColumnWidth(18, 3000); - sheet.setColumnWidth(19, 3000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,厂区,安装位置,资产编号,权证编号,建(构)筑物名称,设施类别,规格型号,材质,计量单位,长度,建成年月,使用年限,折旧年限(年),账面原值(元),账面净值(元)," - + "设计单位,承建单位,资产状态,资产状况评价,备注"; - String[] excelTitle = excelTitleStr.split(","); - - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("管道台账"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - - String wherestr = "where 1=1 and type = '"+FacilitiesCard.Type_Pipeline+"'"; - if(unitId!=null && !unitId.equals("")){ - wherestr += " and unitId = '"+unitId+"' "; - }else { - wherestr += " and id='无' "; - } - FacilitiesCard facilitiesCard = new FacilitiesCard(); - facilitiesCard.setWhere(wherestr + " order by code asc"); - List list = facilitiesCardDao.selectListByWhere(facilitiesCard); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(2+i); - row.setHeight((short) 400); - - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i+1); - - Company company = companyService.selectByPrimaryKey(list.get(i).getUnitId()); - if(company!=null){ - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(company.getSname()); - } - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getPosition()); - - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getAssetClassCode()); - - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getCode()); - - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getName()); - - FacilitiesClass facilitiesClass = facilitiesClassService.selectById(list.get(i).getFacilitiesClassId()); - if(facilitiesClass!=null){ - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(facilitiesClass.getName()); - } - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getModel()); - - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getMaterialQuality()); - - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getMeasureUnit()); - - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getLength()); - - //建成年月 - String completedTime = list.get(i).getCompletedTime(); - if(completedTime!=null && !completedTime.equals("")){ - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(completedTime.substring(0, 10)); - } - - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(list.get(i).getUseYearsLimit()); - - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(list.get(i).getDepreciationYearsLimit()); - - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(list.get(i).getOriginalValue()); - - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(list.get(i).getNowValue()); - - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(list.get(i).getDesignUnit()); - - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(list.get(i).getConstructionUnit()); - - EquipmentStatusManagement equipmentStatusManagement = equipmentStatusManagementService.selectById(list.get(i).getAssetStatus()); - if(equipmentStatusManagement!=null && !equipmentStatusManagement.equals("")){ - HSSFCell cell_18 = row.createCell(18); - cell_18.setCellStyle(listStyle); - cell_18.setCellValue(equipmentStatusManagement.getName()); - } - - HSSFCell cell_19 = row.createCell(19); - cell_19.setCellStyle(listStyle); - cell_19.setCellValue(list.get(i).getAssetEvaluate()); - - HSSFCell cell_20 = row.createCell(20); - cell_20.setCellStyle(listStyle); - cell_20.setCellValue(list.get(i).getRemarks()); - } - - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - @Transactional - public String readXls4Facilities(InputStream input, String userId, - String unitId) throws IOException { - System.out.println("导入设施台帐开始============="+CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0 ; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(1); - - //如果表头小于21列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() != 21) { - continue; - } - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(4)) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - FacilitiesCard facilitiesCard = new FacilitiesCard(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i) ) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - List list = companyService.selectListByWhere("where sname = '"+getStringVal(cell)+"'"); - if(list!=null && list.size()>0){ - facilitiesCard.setUnitId(list.get(0).getId()); - } - break; - case 2: - facilitiesCard.setPosition(getStringVal(cell)); - break; - case 3: - facilitiesCard.setAssetClassCode(getStringVal(cell)); - break; - case 4: - facilitiesCard.setCode(getStringVal(cell)); - break; - case 5: - facilitiesCard.setName(getStringVal(cell)); - break; - case 6: - List facilitiesClasses = facilitiesClassService.selectListByWhere("where (code ='"+getStringVal(cell)+"' or name ='"+getStringVal(cell)+"')"); - if(facilitiesClasses!=null && !facilitiesClasses.equals("")){ - facilitiesCard.setFacilitiesClassId(facilitiesClasses.get(0).getId()); - }else { - facilitiesCard.setFacilitiesClassId(""); - } - break; - case 7: - facilitiesCard.setStructure(getStringVal(cell)); - break; - case 8: - facilitiesCard.setCompletedTime(getStringVal(cell)); - break; - case 9: - String useYearsLimit = getStringVal(cell); - if(useYearsLimit!=null && !useYearsLimit.equals("")){ - facilitiesCard.setUseYearsLimit(Float.parseFloat(useYearsLimit)); - }else { - facilitiesCard.setUseYearsLimit(0); - } - break; - case 10: - facilitiesCard.setMainParams(getStringVal(cell)); - break; - case 11: - facilitiesCard.setBuiltArea(getStringVal(cell)); - break; - case 12: - String number = getStringVal(cell); - if(number!=null && !number.equals("")){ - facilitiesCard.setNumber(Float.parseFloat(number)); - }else { - facilitiesCard.setNumber(0); - } - break; - case 13: - String depreciationYearsLimit = getStringVal(cell); - if(depreciationYearsLimit!=null && !depreciationYearsLimit.equals("")){ - facilitiesCard.setDepreciationYearsLimit(Float.parseFloat(depreciationYearsLimit)); - }else { - facilitiesCard.setDepreciationYearsLimit(0); - } - break; - case 14: - String originalValue = getStringVal(cell); - if(originalValue!=null && !originalValue.equals("")){ - facilitiesCard.setOriginalValue(Float.parseFloat(originalValue)); - }else { - facilitiesCard.setOriginalValue(0); - } - break; - case 15: - String nowValue = getStringVal(cell); - if(nowValue!=null && !nowValue.equals("")){ - facilitiesCard.setNowValue(Float.parseFloat(nowValue)); - }else { - facilitiesCard.setNowValue(0); - } - break; - case 16: - facilitiesCard.setDesignUnit(getStringVal(cell)); - break; - case 17: - facilitiesCard.setConstructionUnit(getStringVal(cell)); - break; - case 18: - String assetStatus = getStringVal(cell); - if(assetStatus!=null && !assetStatus.equals("")){ - List equipmentStatusManagements = equipmentStatusManagementService.selectListByWhere("where name = '"+assetStatus+"'"); - if(equipmentStatusManagements!=null && equipmentStatusManagements.size()>0){ - facilitiesCard.setAssetStatus(equipmentStatusManagements.get(0).getId()); - }else { - facilitiesCard.setAssetStatus(""); - } - } - break; - case 19: - facilitiesCard.setAssetEvaluate(getStringVal(cell)); - break; - case 20: - facilitiesCard.setRemarks(getStringVal(cell)); - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - String sqlstrmodel = "where code = '"+facilitiesCard.getCode()+"' and unitId = '"+unitId+"' and type = '"+FacilitiesCard.Type_Facilities+"' "; - facilitiesCard.setWhere(sqlstrmodel); - facilitiesCard.setType(FacilitiesCard.Type_Facilities); - - List facilitiesCards = facilitiesCardDao.selectListByWhere(facilitiesCard); - if(facilitiesCards!=null && facilitiesCards.size()>0){ - facilitiesCard.setId(facilitiesCards.get(0).getId()); - facilitiesCardDao.updateByPrimaryKeySelective(facilitiesCard); - updateContentNum++; - }else { - facilitiesCard.setId(CommUtil.getUUID()); - facilitiesCardDao.insert(facilitiesCard); - insertContentNum++; - } - } - } - String result = ""; - result = "新增:"+insertContentNum+"条,修改:"+updateContentNum+"条!"; - System.out.println("导入设施台帐结束============="+CommUtil.nowDate()); - return result; - } - - @Transactional - public String readXlsx4Facilities(InputStream input, String userId, - String unitId) throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Transactional - public String readXls4Pipeline(InputStream input, String userId, - String unitId) throws IOException { - System.out.println("导入管道台帐开始============="+CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0 ; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(1); - - //如果表头小于21列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() != 21) { - continue; - } - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(4)) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - FacilitiesCard facilitiesCard = new FacilitiesCard(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i) ) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - List list = companyService.selectListByWhere("where sname = '"+getStringVal(cell)+"'"); - if(list!=null && list.size()>0){ - facilitiesCard.setUnitId(list.get(0).getId()); - } - break; - case 2: - facilitiesCard.setPosition(getStringVal(cell)); - break; - case 3: - facilitiesCard.setAssetClassCode(getStringVal(cell)); - break; - case 4: - facilitiesCard.setCode(getStringVal(cell)); - break; - case 5: - facilitiesCard.setName(getStringVal(cell)); - break; - case 6: - List facilitiesClasses = facilitiesClassService.selectListByWhere("where (code ='"+getStringVal(cell)+"' or name ='"+getStringVal(cell)+"')"); - if(facilitiesClasses!=null && !facilitiesClasses.equals("")){ - facilitiesCard.setFacilitiesClassId(facilitiesClasses.get(0).getId()); - }else { - facilitiesCard.setFacilitiesClassId(""); - } - break; - case 7: - facilitiesCard.setModel(getStringVal(cell)); - break; - case 8: - facilitiesCard.setMaterialQuality(getStringVal(cell)); - break; - case 9: - facilitiesCard.setMeasureUnit(getStringVal(cell)); - break; - case 10: - String length = getStringVal(cell); - if(length!=null && !length.equals("")){ - facilitiesCard.setLength(Float.parseFloat(length)); - }else { - facilitiesCard.setLength(0); - } - break; - case 11: - facilitiesCard.setCompletedTime(getStringVal(cell)); - break; - case 12: - String useYearsLimit = getStringVal(cell); - if(useYearsLimit!=null && !useYearsLimit.equals("")){ - facilitiesCard.setUseYearsLimit(Float.parseFloat(useYearsLimit)); - }else { - facilitiesCard.setUseYearsLimit(0); - } - break; - case 13: - String depreciationYearsLimit = getStringVal(cell); - if(depreciationYearsLimit!=null && !depreciationYearsLimit.equals("")){ - facilitiesCard.setDepreciationYearsLimit(Float.parseFloat(depreciationYearsLimit)); - }else { - facilitiesCard.setDepreciationYearsLimit(0); - } - break; - case 14: - String originalValue = getStringVal(cell); - if(originalValue!=null && !originalValue.equals("")){ - facilitiesCard.setOriginalValue(Float.parseFloat(originalValue)); - }else { - facilitiesCard.setOriginalValue(0); - } - break; - case 15: - String nowValue = getStringVal(cell); - if(nowValue!=null && !nowValue.equals("")){ - facilitiesCard.setNowValue(Float.parseFloat(nowValue)); - }else { - facilitiesCard.setNowValue(0); - } - break; - case 16: - facilitiesCard.setDesignUnit(getStringVal(cell)); - break; - case 17: - facilitiesCard.setConstructionUnit(getStringVal(cell)); - break; - case 18: - String assetStatus = getStringVal(cell); - if(assetStatus!=null && !assetStatus.equals("")){ - List equipmentStatusManagements = equipmentStatusManagementService.selectListByWhere("where name = '"+assetStatus+"'"); - if(equipmentStatusManagements!=null && equipmentStatusManagements.size()>0){ - facilitiesCard.setAssetStatus(equipmentStatusManagements.get(0).getId()); - }else { - facilitiesCard.setAssetStatus(""); - } - } - break; - case 19: - facilitiesCard.setAssetEvaluate(getStringVal(cell)); - break; - case 20: - facilitiesCard.setRemarks(getStringVal(cell)); - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - String sqlstrmodel = "where code = '"+facilitiesCard.getCode()+"' and unitId = '"+unitId+"' and type = '"+FacilitiesCard.Type_Pipeline+"' "; - facilitiesCard.setWhere(sqlstrmodel); - facilitiesCard.setType(FacilitiesCard.Type_Pipeline); - - List facilitiesCards = facilitiesCardDao.selectListByWhere(facilitiesCard); - if(facilitiesCards!=null && facilitiesCards.size()>0){ - facilitiesCard.setId(facilitiesCards.get(0).getId()); - facilitiesCardDao.updateByPrimaryKeySelective(facilitiesCard); - updateContentNum++; - }else { - facilitiesCard.setId(CommUtil.getUUID()); - facilitiesCardDao.insert(facilitiesCard); - insertContentNum++; - } - } - } - String result = ""; - result = "新增:"+insertContentNum+"条,修改:"+updateContentNum+"条!"; - System.out.println("导入管道台帐结束============="+CommUtil.nowDate()); - return result; - } - - @Transactional - public String readXlsx4Pipeline(InputStream input, String userId, - String unitId) throws IOException { - // TODO Auto-generated method stub - return null; - } - - - -} diff --git a/src/com/sipai/service/equipment/impl/FacilitiesClassServiceImpl.java b/src/com/sipai/service/equipment/impl/FacilitiesClassServiceImpl.java deleted file mode 100644 index a3dbd3b8..00000000 --- a/src/com/sipai/service/equipment/impl/FacilitiesClassServiceImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.sipai.service.equipment.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.FacilitiesClassDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.FacilitiesClass; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.equipment.FacilitiesClassService; -import com.sipai.tools.CommString; - -@Service -public class FacilitiesClassServiceImpl implements FacilitiesClassService{ - @Resource - private FacilitiesClassDao facilitiesClassDao; - - @Override - public FacilitiesClass selectById(String id) { - return facilitiesClassDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return facilitiesClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(FacilitiesClass entity) { - return facilitiesClassDao.insert(entity); - } - - @Override - public int update(FacilitiesClass entity) { - return facilitiesClassDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - FacilitiesClass facilitiesClass = new FacilitiesClass(); - facilitiesClass.setWhere(wherestr); - return facilitiesClassDao.selectListByWhere(facilitiesClass); - } - - @Override - public int deleteByWhere(String wherestr) { - FacilitiesClass facilitiesClass = new FacilitiesClass(); - facilitiesClass.setWhere(wherestr); - return facilitiesClassDao.deleteByWhere(facilitiesClass); - } - - @Override - public String getTreeListtest(List> list_result, - List list) { - if(list_result == null ) { - list_result = new ArrayList>(); - if(list!=null){ - for(FacilitiesClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - if(k.getCode()!=null && !k.getCode().equals("")){ - map.put("text", "("+k.getCode()+")"+k.getName()); - }else { - map.put("text", k.getName()); - } - map.put("pid", k.getPid()); -// map.put("type", k.getType()); - map.put("code", k.getCode()); - -// if(k.getType()!=null && k.getType().equals(CommString.EquipmentClass_Category)){ -// map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); -// } -// if(k.getType()!=null && k.getType().equals(CommString.EquipmentClass_Equipment)){ -// map.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); -// } -// if(k.getType()!=null && k.getType().equals(CommString.EquipmentClass_Parts)){ -// map.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); -// } - - list_result.add(map); - } - } - getTreeListtest(list_result,list); - } - } else if(list_result.size()>0 && list!=null && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - if(list!=null){ - for(FacilitiesClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - if(k.getCode()!=null && !k.getCode().equals("")){ - m.put("text", "("+k.getCode()+")"+k.getName()); - }else { - m.put("text", k.getName()); - } - m.put("pid", k.getPid()); -// m.put("type", k.getType()); - m.put("code", k.getCode()); - -// if(k.getType()!=null && k.getType().equals(CommString.EquipmentClass_Category)){ -// m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel1); -// } -// if(k.getType()!=null && k.getType().equals(CommString.EquipmentClass_Equipment)){ -// m.put("icon", TimeEfficiencyCommStr.EquipmentClassLevel2); -// } -// if(k.getType()!=null && k.getType().equals(CommString.EquipmentClass_Parts)){ -// m.put("icon", TimeEfficiencyCommStr.EquipmentClassPlace); -// } - - childlist.add(m); - } - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeListtest(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - public TreeSet getAllChildId(TreeSet classIdList,String id){ - classIdList.add(id); - FacilitiesClass facilitiesClass = new FacilitiesClass(); - facilitiesClass.setWhere(" where pid='"+id+"'"); - List classList=facilitiesClassDao.selectListByWhere(facilitiesClass); - if(classList.size()>0 && null!=classList && !classList.isEmpty()){ - for(FacilitiesClass equipmentClassVar:classList){ - classIdList.add(equipmentClassVar.getId()); - getAllChildId(classIdList,equipmentClassVar.getId()); - } - } - return classIdList; - } - -} diff --git a/src/com/sipai/service/equipment/impl/OverhaulItemContentServiceImpl.java b/src/com/sipai/service/equipment/impl/OverhaulItemContentServiceImpl.java deleted file mode 100644 index 157051ef..00000000 --- a/src/com/sipai/service/equipment/impl/OverhaulItemContentServiceImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.equipment.impl; - -import com.sipai.dao.workorder.OverhaulItemContentDao; -import com.sipai.entity.workorder.OverhaulItemContent; -import com.sipai.service.workorder.OverhaulItemContentService; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class OverhaulItemContentServiceImpl implements OverhaulItemContentService { - @Resource - private OverhaulItemContentDao overhaulItemContentDao; - - @Override - public OverhaulItemContent selectById(String id) { - return overhaulItemContentDao.selectByPrimaryKey(id); - } - - @Override - public OverhaulItemContent selectByWhere(String wherestr) { - OverhaulItemContent overhaulItemContent = new OverhaulItemContent(); - overhaulItemContent.setWhere(wherestr); - return overhaulItemContentDao.selectByWhere(overhaulItemContent); - } - - @Override - public int deleteById(String id) { - return overhaulItemContentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(OverhaulItemContent entity) { - return overhaulItemContentDao.insert(entity); - } - - @Override - public int update(OverhaulItemContent entity) { - return overhaulItemContentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - OverhaulItemContent overhaulItemContent = new OverhaulItemContent(); - overhaulItemContent.setWhere(wherestr); - List list = overhaulItemContentDao.selectListByWhere(overhaulItemContent); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - OverhaulItemContent overhaulItemContent = new OverhaulItemContent(); - overhaulItemContent.setWhere(wherestr); - return overhaulItemContentDao.deleteByWhere(overhaulItemContent); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationCriterionService.java b/src/com/sipai/service/evaluation/EvaluationCriterionService.java deleted file mode 100644 index 229bcf44..00000000 --- a/src/com/sipai/service/evaluation/EvaluationCriterionService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationCriterionDao; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.tools.CommService; - -@Service -public class EvaluationCriterionService implements CommService{ - - @Resource - private EvaluationCriterionDao evaluationCriterionDao; - - @Override - public EvaluationCriterion selectById(String t) { - return evaluationCriterionDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return evaluationCriterionDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationCriterion t) { - return evaluationCriterionDao.insertSelective(t); - } - - @Override - public int update(EvaluationCriterion t) { - return evaluationCriterionDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationCriterion evaluationCriterion = new EvaluationCriterion(); - evaluationCriterion.setWhere(t); - return evaluationCriterionDao.selectListByWhere(evaluationCriterion); - } - - @Override - public int deleteByWhere(String t) { - EvaluationCriterion evaluationCriterion = new EvaluationCriterion(); - evaluationCriterion.setWhere(t); - return evaluationCriterionDao.deleteByWhere(evaluationCriterion); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationIndexDayService.java b/src/com/sipai/service/evaluation/EvaluationIndexDayService.java deleted file mode 100644 index 38683c94..00000000 --- a/src/com/sipai/service/evaluation/EvaluationIndexDayService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationIndexDayDao; -import com.sipai.entity.evaluation.EvaluationIndexDay; -import com.sipai.tools.CommService; - -@Service -public class EvaluationIndexDayService implements CommService{ - @Resource - private EvaluationIndexDayDao evaluationIndexDayDao; - - @Override - public EvaluationIndexDay selectById(String t) { - return evaluationIndexDayDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return evaluationIndexDayDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationIndexDay t) { - return evaluationIndexDayDao.insertSelective(t); - } - - @Override - public int update(EvaluationIndexDay t) { - return evaluationIndexDayDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationIndexDay evaluationIndexDay = new EvaluationIndexDay(); - evaluationIndexDay.setWhere(t); - return evaluationIndexDayDao.selectListByWhere(evaluationIndexDay); - } - - @Override - public int deleteByWhere(String t) { - EvaluationIndexDay evaluationIndexDay = new EvaluationIndexDay(); - evaluationIndexDay.setWhere(t); - return evaluationIndexDayDao.deleteByWhere(evaluationIndexDay); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationIndexMService.java b/src/com/sipai/service/evaluation/EvaluationIndexMService.java deleted file mode 100644 index a6fd49b3..00000000 --- a/src/com/sipai/service/evaluation/EvaluationIndexMService.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationIndexMDao; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndexM; -import com.sipai.tools.CommService; - -@Service -public class EvaluationIndexMService implements CommService{ - - @Resource - private EvaluationIndexMDao evaluationIndexMDao; - @Resource - private EvaluationCriterionService evaluationCriterionService; - - @Override - public EvaluationIndexM selectById(String t) { - EvaluationIndexM evaluationIndexM = evaluationIndexMDao.selectByPrimaryKey(t); - if(null != evaluationIndexM.getEvaluationcriterionBacteriologyIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionBacteriologyIds())){ - String ecbids = evaluationIndexM.getEvaluationcriterionBacteriologyIds(). - replaceAll(",", "','"); - ecbids = "'" + ecbids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecbids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionBacteriologys(list); - String _evaluationCriterionBacteriologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionBacteriologys += (e.getCriterionName() + ","); - } - _evaluationCriterionBacteriologys = _evaluationCriterionBacteriologys.substring(0, _evaluationCriterionBacteriologys.length()-1); - evaluationIndexM.set_evaluationCriterionBacteriologys(_evaluationCriterionBacteriologys); - } - if(null != evaluationIndexM.getEvaluationcriterionDisinfectantIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionDisinfectantIds())){ - String ecdids = evaluationIndexM.getEvaluationcriterionDisinfectantIds(). - replaceAll(",", "','"); - ecdids = "'" + ecdids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecdids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionDisinfectants(list); - String _evaluationCriterionDisinfectants = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionDisinfectants += (e.getCriterionName() + ","); - } - _evaluationCriterionDisinfectants = _evaluationCriterionDisinfectants.substring(0, _evaluationCriterionDisinfectants.length()-1); - evaluationIndexM.set_evaluationCriterionDisinfectants(_evaluationCriterionDisinfectants); - } - if(null != evaluationIndexM.getEvaluationcriterionSensoryorgansIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionSensoryorgansIds())){ - String ecsids = evaluationIndexM.getEvaluationcriterionSensoryorgansIds(). - replaceAll(",", "','"); - ecsids = "'" + ecsids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecsids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionSensoryorgans(list); - String _evaluationCriterionSensoryorgans = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionSensoryorgans += (e.getCriterionName() + ","); - } - _evaluationCriterionSensoryorgans = _evaluationCriterionSensoryorgans.substring(0, _evaluationCriterionSensoryorgans.length()-1); - evaluationIndexM.set_evaluationCriterionSensoryorgans(_evaluationCriterionSensoryorgans); - } - if(null != evaluationIndexM.getEvaluationcriterionToxicologyIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionToxicologyIds())){ - String ectids = evaluationIndexM.getEvaluationcriterionToxicologyIds(). - replaceAll(",", "','"); - ectids = "'" + ectids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ectids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionToxicologys(list); - String _evaluationCriterionToxicologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionToxicologys += (e.getCriterionName() + ","); - } - _evaluationCriterionToxicologys = _evaluationCriterionToxicologys.substring(0, _evaluationCriterionToxicologys.length()-1); - evaluationIndexM.set_evaluationCriterionToxicologys(_evaluationCriterionToxicologys); - } - return evaluationIndexM; - } - - @Override - public int deleteById(String t) { - return evaluationIndexMDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationIndexM t) { - return evaluationIndexMDao.insertSelective(t); - } - - @Override - public int update(EvaluationIndexM t) { - return evaluationIndexMDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationIndexM m = new EvaluationIndexM(); - m.setWhere(t); - List evaluationIndexMs = evaluationIndexMDao.selectListByWhere(m); - for(EvaluationIndexM evaluationIndexM : evaluationIndexMs){ - try { - - } catch (Exception e) { - // TODO: handle exception - } - if(null != evaluationIndexM.getEvaluationcriterionBacteriologyIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionBacteriologyIds())){ - String ecbids = evaluationIndexM.getEvaluationcriterionBacteriologyIds(). - replaceAll(",", "','"); - ecbids = "'" + ecbids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecbids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionBacteriologys(list); - String _evaluationCriterionBacteriologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionBacteriologys += (e.getCriterionName() + ","); - } - _evaluationCriterionBacteriologys = _evaluationCriterionBacteriologys.substring(0, _evaluationCriterionBacteriologys.length()-1); - evaluationIndexM.set_evaluationCriterionBacteriologys(_evaluationCriterionBacteriologys); - } - if(null != evaluationIndexM.getEvaluationcriterionDisinfectantIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionDisinfectantIds())){ - String ecdids = evaluationIndexM.getEvaluationcriterionDisinfectantIds(). - replaceAll(",", "','"); - ecdids = "'" + ecdids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecdids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionDisinfectants(list); - String _evaluationCriterionDisinfectants = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionDisinfectants += (e.getCriterionName() + ","); - } - _evaluationCriterionDisinfectants = _evaluationCriterionDisinfectants.substring(0, _evaluationCriterionDisinfectants.length()-1); - evaluationIndexM.set_evaluationCriterionDisinfectants(_evaluationCriterionDisinfectants); - } - if(null != evaluationIndexM.getEvaluationcriterionSensoryorgansIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionSensoryorgansIds())){ - String ecsids = evaluationIndexM.getEvaluationcriterionSensoryorgansIds(). - replaceAll(",", "','"); - ecsids = "'" + ecsids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecsids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionSensoryorgans(list); - String _evaluationCriterionSensoryorgans = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionSensoryorgans += (e.getCriterionName() + ","); - } - _evaluationCriterionSensoryorgans = _evaluationCriterionSensoryorgans.substring(0, _evaluationCriterionSensoryorgans.length()-1); - evaluationIndexM.set_evaluationCriterionSensoryorgans(_evaluationCriterionSensoryorgans); - } - if(null != evaluationIndexM.getEvaluationcriterionToxicologyIds() && - !"".equals(evaluationIndexM.getEvaluationcriterionToxicologyIds())){ - String ectids = evaluationIndexM.getEvaluationcriterionToxicologyIds(). - replaceAll(",", "','"); - ectids = "'" + ectids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ectids + ") order by criterion_name"); - evaluationIndexM.setEvaluationCriterionToxicologys(list); - String _evaluationCriterionToxicologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionToxicologys += (e.getCriterionName() + ","); - } - _evaluationCriterionToxicologys = _evaluationCriterionToxicologys.substring(0, _evaluationCriterionToxicologys.length()-1); - evaluationIndexM.set_evaluationCriterionToxicologys(_evaluationCriterionToxicologys); - } - } - return evaluationIndexMs; - } - - @Override - public int deleteByWhere(String t) { - EvaluationIndexM m = new EvaluationIndexM(); - m.setWhere(t); - return evaluationIndexMDao.deleteByWhere(m); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationIndexMonthService.java b/src/com/sipai/service/evaluation/EvaluationIndexMonthService.java deleted file mode 100644 index 2bb325e4..00000000 --- a/src/com/sipai/service/evaluation/EvaluationIndexMonthService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationIndexMontDao; -import com.sipai.entity.evaluation.EvaluationIndexMonth; -import com.sipai.tools.CommService; - -@Service -public class EvaluationIndexMonthService implements CommService{ - @Resource - private EvaluationIndexMontDao evaluationIndexMontDao; - - @Override - public EvaluationIndexMonth selectById(String t) { - return evaluationIndexMontDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return evaluationIndexMontDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationIndexMonth t) { - return evaluationIndexMontDao.insertSelective(t); - } - - @Override - public int update(EvaluationIndexMonth t) { - return evaluationIndexMontDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationIndexMonth evaluationIndexMonth = new EvaluationIndexMonth(); - evaluationIndexMonth.setWhere(t); - return evaluationIndexMontDao.selectListByWhere(evaluationIndexMonth); - } - - @Override - public int deleteByWhere(String t) { - EvaluationIndexMonth evaluationIndexMonth = new EvaluationIndexMonth(); - evaluationIndexMonth.setWhere(t); - return evaluationIndexMontDao.deleteByWhere(evaluationIndexMonth); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationIndexService.java b/src/com/sipai/service/evaluation/EvaluationIndexService.java deleted file mode 100644 index 793646bb..00000000 --- a/src/com/sipai/service/evaluation/EvaluationIndexService.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationCriterionDao; -import com.sipai.dao.evaluation.EvaluationIndexDao; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndex; -import com.sipai.tools.CommService; - -@Service -public class EvaluationIndexService implements CommService{ - @Resource - private EvaluationIndexDao evaluationIndexDao; - @Resource - private EvaluationCriterionService evaluationCriterionService; - - @Override - public EvaluationIndex selectById(String t) { - EvaluationIndex evaluationIndex = evaluationIndexDao.selectByPrimaryKey(t); - if(null != evaluationIndex.getEvaluationCriterionIds() && - !"".equals(evaluationIndex.getEvaluationCriterionIds())){ - String ecids = evaluationIndex.getEvaluationCriterionIds(). - replaceAll(",", "','"); - ecids = "'" + ecids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecids + ") order by criterion_name"); - evaluationIndex.setEvaluationCriterions(list); - String _evaluationCriterions = ""; - for(EvaluationCriterion e: list){ - _evaluationCriterions += (e.getCriterionName() + ","); - } - _evaluationCriterions = _evaluationCriterions.substring(0, _evaluationCriterions.length()-1); -// Pattern p = Pattern.compile("\\s*|\t|\r|\n"); -// Matcher m = p.matcher(_evaluationCriterions); -// String dest = m.replaceAll(""); - evaluationIndex.set_evaluationCriterions(_evaluationCriterions); - } - return evaluationIndex; - } - - @Override - public int deleteById(String t) { - return evaluationIndexDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationIndex t) { - return evaluationIndexDao.insertSelective(t); - } - - @Override - public int update(EvaluationIndex t) { - return evaluationIndexDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationIndex evaluationIndex = new EvaluationIndex(); - evaluationIndex.setWhere(t); - List list = evaluationIndexDao.selectListByWhere(evaluationIndex); - for(EvaluationIndex evaluationIndex2 : list){ - String ids = evaluationIndex2.getEvaluationCriterionIds(); - if(ids != null && !evaluationIndex2.getEvaluationCriterionIds().equals("")){ - ids = ids.replaceAll(",", "','"); - ids = "'" + ids + "'"; - List list2 = evaluationCriterionService. - selectListByWhere(" where id in (" + ids + ") order by criterion_name"); - evaluationIndex2.setEvaluationCriterions(list2); - String _evaluationCriterions = ""; - for(EvaluationCriterion e: list2){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterions += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterions += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - } - _evaluationCriterions = _evaluationCriterions.substring(0, _evaluationCriterions.length()-1); - evaluationIndex2.set_evaluationCriterions(_evaluationCriterions); - } - } - return list; - } - - @Override - public int deleteByWhere(String t) { - EvaluationIndex evaluationIndex = new EvaluationIndex(); - evaluationIndex.setWhere(t); - return evaluationIndexDao.deleteByWhere(evaluationIndex); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationIndexYService.java b/src/com/sipai/service/evaluation/EvaluationIndexYService.java deleted file mode 100644 index 35ae277f..00000000 --- a/src/com/sipai/service/evaluation/EvaluationIndexYService.java +++ /dev/null @@ -1,409 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationIndexYDao; -import com.sipai.entity.evaluation.EvaluationCriterion; -import com.sipai.entity.evaluation.EvaluationIndexY; -import com.sipai.tools.CommService; - -@Service -public class EvaluationIndexYService implements CommService{ - @Resource - private EvaluationIndexYDao evaluationIndexYDao; - @Resource - private EvaluationCriterionService evaluationCriterionService; - - @Override - public EvaluationIndexY selectById(String t) { - EvaluationIndexY evaluationIndexY = evaluationIndexYDao.selectByPrimaryKey(t); - if(null != evaluationIndexY.getEvaluationcriterionBacteriologyIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionBacteriologyIds())){ - String ecbids = evaluationIndexY.getEvaluationcriterionBacteriologyIds(). - replaceAll(",", "','"); - ecbids = "'" + ecbids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecbids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionBacteriologys(list); - String _evaluationCriterionBacteriologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionBacteriologys += (e.getCriterionName() + ","); - } - _evaluationCriterionBacteriologys = _evaluationCriterionBacteriologys.substring(0, _evaluationCriterionBacteriologys.length()-1); - evaluationIndexY.set_evaluationCriterionBacteriologys(_evaluationCriterionBacteriologys); - } - if(null != evaluationIndexY.getEvaluationcriterionDisinfectantIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionDisinfectantIds())){ - String ecdids = evaluationIndexY.getEvaluationcriterionDisinfectantIds(). - replaceAll(",", "','"); - ecdids = "'" + ecdids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecdids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionDisinfectants(list); - String _evaluationCriterionDisinfectants = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionDisinfectants += (e.getCriterionName() + ","); - } - _evaluationCriterionDisinfectants = _evaluationCriterionDisinfectants.substring(0, _evaluationCriterionDisinfectants.length()-1); - evaluationIndexY.set_evaluationCriterionDisinfectants(_evaluationCriterionDisinfectants); - } - if(null != evaluationIndexY.getEvaluationcriterionSensoryorgansIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionSensoryorgansIds())){ - String ecsids = evaluationIndexY.getEvaluationcriterionSensoryorgansIds(). - replaceAll(",", "','"); - ecsids = "'" + ecsids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecsids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionSensoryorgans(list); - String _evaluationCriterionSensoryorgans = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionSensoryorgans += (e.getCriterionName() + ","); - } - _evaluationCriterionSensoryorgans = _evaluationCriterionSensoryorgans.substring(0, _evaluationCriterionSensoryorgans.length()-1); - evaluationIndexY.set_evaluationCriterionSensoryorgans(_evaluationCriterionSensoryorgans); - } - if(null != evaluationIndexY.getEvaluationcriterionToxicologyIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionToxicologyIds())){ - String ectids = evaluationIndexY.getEvaluationcriterionToxicologyIds(). - replaceAll(",", "','"); - ectids = "'" + ectids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ectids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionToxicologys(list); - String _evaluationCriterionToxicologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionToxicologys += (e.getCriterionName() + ","); - } - _evaluationCriterionToxicologys = _evaluationCriterionToxicologys.substring(0, _evaluationCriterionToxicologys.length()-1); - evaluationIndexY.set_evaluationCriterionToxicologys(_evaluationCriterionToxicologys); - } - if(null != evaluationIndexY.getEvaluationcriterionDbpsIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionDbpsIds())){ - String ecdpids = evaluationIndexY.getEvaluationcriterionDbpsIds(). - replaceAll(",", "','"); - ecdpids = "'" + ecdpids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecdpids + ") order by criterion_name"); - evaluationIndexY.setEvaluationcriterionDbpss(list); - String _evaluationcriterionDbpss = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationcriterionDbpss += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationcriterionDbpss += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - _evaluationcriterionDbpss += (e.getCriterionName() + ","); - } - _evaluationcriterionDbpss = _evaluationcriterionDbpss.substring(0, _evaluationcriterionDbpss.length()-1); - evaluationIndexY.set_evaluationcriterionDbpss(_evaluationcriterionDbpss); - } - if(null != evaluationIndexY.getEvaluationcriterionOrganicIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionOrganicIds())){ - String ecoids = evaluationIndexY.getEvaluationcriterionOrganicIds(). - replaceAll(",", "','"); - ecoids = "'" + ecoids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecoids + ") order by criterion_name"); - evaluationIndexY.setEvaluationcriterionOrganics(list); - String _evaluationcriterionOrganics = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationcriterionOrganics += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationcriterionOrganics += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationcriterionOrganics += (e.getCriterionName() + ","); - } - _evaluationcriterionOrganics = _evaluationcriterionOrganics.substring(0, _evaluationcriterionOrganics.length()-1); - evaluationIndexY.set_evaluationcriterionOrganics(_evaluationcriterionOrganics); - } - if(null != evaluationIndexY.getEvaluationcriterionSmellIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionSmellIds())){ - String ecsids = evaluationIndexY.getEvaluationcriterionSmellIds(). - replaceAll(",", "','"); - ecsids = "'" + ecsids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecsids + ") order by criterion_name"); - evaluationIndexY.setEvaluationcriterionSmells(list); - String _evaluationcriterionSmells = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationcriterionSmells += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationcriterionSmells += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationcriterionSmells += (e.getCriterionName() + ","); - } - _evaluationcriterionSmells = _evaluationcriterionSmells.substring(0, _evaluationcriterionSmells.length()-1); - evaluationIndexY.set_evaluationcriterionSmells(_evaluationcriterionSmells); - } - return evaluationIndexY; - } - - @Override - public int deleteById(String t) { - return evaluationIndexYDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationIndexY t) { - return evaluationIndexYDao.insertSelective(t); - } - - @Override - public int update(EvaluationIndexY t) { - return evaluationIndexYDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationIndexY y = new EvaluationIndexY(); - y.setWhere(t); - List evaluationIndexYs = evaluationIndexYDao.selectListByWhere(y); - for(EvaluationIndexY evaluationIndexY:evaluationIndexYs){ - if(null != evaluationIndexY.getEvaluationcriterionBacteriologyIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionBacteriologyIds())){ - String ecbids = evaluationIndexY.getEvaluationcriterionBacteriologyIds(). - replaceAll(",", "','"); - ecbids = "'" + ecbids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecbids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionBacteriologys(list); - String _evaluationCriterionBacteriologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionBacteriologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionBacteriologys += (e.getCriterionName() + ","); - } - _evaluationCriterionBacteriologys = _evaluationCriterionBacteriologys.substring(0, _evaluationCriterionBacteriologys.length()-1); - evaluationIndexY.set_evaluationCriterionBacteriologys(_evaluationCriterionBacteriologys); - } - if(null != evaluationIndexY.getEvaluationcriterionDisinfectantIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionDisinfectantIds())){ - String ecdids = evaluationIndexY.getEvaluationcriterionDisinfectantIds(). - replaceAll(",", "','"); - ecdids = "'" + ecdids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecdids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionDisinfectants(list); - String _evaluationCriterionDisinfectants = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionDisinfectants += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionDisinfectants += (e.getCriterionName() + ","); - } - _evaluationCriterionDisinfectants = _evaluationCriterionDisinfectants.substring(0, _evaluationCriterionDisinfectants.length()-1); - evaluationIndexY.set_evaluationCriterionDisinfectants(_evaluationCriterionDisinfectants); - } - if(null != evaluationIndexY.getEvaluationcriterionSensoryorgansIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionSensoryorgansIds())){ - String ecsids = evaluationIndexY.getEvaluationcriterionSensoryorgansIds(). - replaceAll(",", "','"); - ecsids = "'" + ecsids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecsids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionSensoryorgans(list); - String _evaluationCriterionSensoryorgans = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionSensoryorgans += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionSensoryorgans += (e.getCriterionName() + ","); - } - _evaluationCriterionSensoryorgans = _evaluationCriterionSensoryorgans.substring(0, _evaluationCriterionSensoryorgans.length()-1); - evaluationIndexY.set_evaluationCriterionSensoryorgans(_evaluationCriterionSensoryorgans); - } - if(null != evaluationIndexY.getEvaluationcriterionToxicologyIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionToxicologyIds())){ - String ectids = evaluationIndexY.getEvaluationcriterionToxicologyIds(). - replaceAll(",", "','"); - ectids = "'" + ectids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ectids + ") order by criterion_name"); - evaluationIndexY.setEvaluationCriterionToxicologys(list); - String _evaluationCriterionToxicologys = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationCriterionToxicologys += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationCriterionToxicologys += (e.getCriterionName() + ","); - } - _evaluationCriterionToxicologys = _evaluationCriterionToxicologys.substring(0, _evaluationCriterionToxicologys.length()-1); - evaluationIndexY.set_evaluationCriterionToxicologys(_evaluationCriterionToxicologys); - } - if(null != evaluationIndexY.getEvaluationcriterionDbpsIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionDbpsIds())){ - String ecdpids = evaluationIndexY.getEvaluationcriterionDbpsIds(). - replaceAll(",", "','"); - ecdpids = "'" + ecdpids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecdpids + ") order by criterion_name"); - evaluationIndexY.setEvaluationcriterionDbpss(list); - String _evaluationcriterionDbpss = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationcriterionDbpss += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationcriterionDbpss += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - _evaluationcriterionDbpss += (e.getCriterionName() + ","); - } - _evaluationcriterionDbpss = _evaluationcriterionDbpss.substring(0, _evaluationcriterionDbpss.length()-1); - evaluationIndexY.set_evaluationcriterionDbpss(_evaluationcriterionDbpss); - } - if(null != evaluationIndexY.getEvaluationcriterionOrganicIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionOrganicIds())){ - String ecoids = evaluationIndexY.getEvaluationcriterionOrganicIds(). - replaceAll(",", "','"); - ecoids = "'" + ecoids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecoids + ") order by criterion_name"); - evaluationIndexY.setEvaluationcriterionOrganics(list); - String _evaluationcriterionOrganics = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationcriterionOrganics += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationcriterionOrganics += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationcriterionOrganics += (e.getCriterionName() + ","); - } - _evaluationcriterionOrganics = _evaluationcriterionOrganics.substring(0, _evaluationcriterionOrganics.length()-1); - evaluationIndexY.set_evaluationcriterionOrganics(_evaluationcriterionOrganics); - } - if(null != evaluationIndexY.getEvaluationcriterionSmellIds() && - !"".equals(evaluationIndexY.getEvaluationcriterionSmellIds())){ - String ecsids = evaluationIndexY.getEvaluationcriterionSmellIds(). - replaceAll(",", "','"); - ecsids = "'" + ecsids + "'" ; - List list = evaluationCriterionService. - selectListByWhere(" where id in (" + ecsids + ") order by criterion_name"); - evaluationIndexY.setEvaluationcriterionSmells(list); - String _evaluationcriterionSmells = ""; - for(EvaluationCriterion e: list){ - if("1".equals(e.getCondition()) || "2".equals(e.getCondition())){ - _evaluationcriterionSmells += (e.getCriterionName() + - "[国标:" +e.getNationCriterionValue() + ",地标:" - + e.getAreaCriterionValue() + ",内控:" + e.getCompanyCriterionValue() + "],"); - }else{ - _evaluationcriterionSmells += (e.getCriterionName() + - "[国标:" +e.getNationCriterionMin()+ "-" + e.getNationCriterionMax() + ",地标:" - + e.getAreaCriterionMin() + "-" +e.getAreaCriterionMax() + - ",内控:" + e.getCompanyCriterionMin() + "-" + e.getCompanyCriterionMax() + "],"); - } - //_evaluationcriterionSmells += (e.getCriterionName() + ","); - } - _evaluationcriterionSmells = _evaluationcriterionSmells.substring(0, _evaluationcriterionSmells.length()-1); - evaluationIndexY.set_evaluationcriterionSmells(_evaluationcriterionSmells); - } - } - return evaluationIndexYs; - } - - @Override - public int deleteByWhere(String t) { - EvaluationIndexY y = new EvaluationIndexY(); - y.setWhere(t); - return evaluationIndexYDao.deleteByWhere(y); - } - -} diff --git a/src/com/sipai/service/evaluation/EvaluationIndexYearService.java b/src/com/sipai/service/evaluation/EvaluationIndexYearService.java deleted file mode 100644 index 403252f7..00000000 --- a/src/com/sipai/service/evaluation/EvaluationIndexYearService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.evaluation; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.evaluation.EvaluationIndexYearDao; -import com.sipai.entity.evaluation.EvaluationIndexYear; -import com.sipai.tools.CommService; - -@Service -public class EvaluationIndexYearService implements CommService{ - @Resource - private EvaluationIndexYearDao evaluationIndexYearDao; - - @Override - public EvaluationIndexYear selectById(String t) { - return evaluationIndexYearDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return evaluationIndexYearDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EvaluationIndexYear t) { - return evaluationIndexYearDao.insertSelective(t); - } - - @Override - public int update(EvaluationIndexYear t) { - return evaluationIndexYearDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EvaluationIndexYear evaluationIndexYear = new EvaluationIndexYear(); - evaluationIndexYear.setWhere(t); - return evaluationIndexYearDao.selectListByWhere(evaluationIndexYear); - } - - @Override - public int deleteByWhere(String t) { - EvaluationIndexYear evaluationIndexYear = new EvaluationIndexYear(); - evaluationIndexYear.setWhere(t); - return evaluationIndexYearDao.deleteByWhere(evaluationIndexYear); - } - -} diff --git a/src/com/sipai/service/exam/DaytestPaperService.java b/src/com/sipai/service/exam/DaytestPaperService.java deleted file mode 100644 index 95de6c51..00000000 --- a/src/com/sipai/service/exam/DaytestPaperService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.entity.exam.DaytestPaper; - -import java.util.List; - -public interface DaytestPaperService { - - public DaytestPaper selectById(String t); - - public int deleteById(String t); - - public int save(DaytestPaper t); - - public int update(DaytestPaper t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/exam/DaytestPaperServiceImpl.java b/src/com/sipai/service/exam/DaytestPaperServiceImpl.java deleted file mode 100644 index ad27dd7d..00000000 --- a/src/com/sipai/service/exam/DaytestPaperServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.DaytestPaperDao; -import com.sipai.entity.exam.DaytestPaper; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("DaytestPaperService") -public class DaytestPaperServiceImpl implements DaytestPaperService{ - - @Resource - private DaytestPaperDao daytestPaperDao; - - @Override - public DaytestPaper selectById(String t) { - return daytestPaperDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return daytestPaperDao.deleteByPrimaryKey(t); - } - - @Override - public int save(DaytestPaper t) { - return daytestPaperDao.insertSelective(t); - } - - @Override - public int update(DaytestPaper t) { - return daytestPaperDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - DaytestPaper daytestPaper = new DaytestPaper(); - daytestPaper.setWhere(t); - List list = daytestPaperDao.selectListByWhere(daytestPaper); - - return list; - } - - @Override - public int deleteByWhere(String t) { - DaytestPaper daytestPaper = new DaytestPaper(); - daytestPaper.setWhere(t); - return daytestPaperDao.deleteByWhere(daytestPaper); - } - -} diff --git a/src/com/sipai/service/exam/DaytestQuesOptionService.java b/src/com/sipai/service/exam/DaytestQuesOptionService.java deleted file mode 100644 index bd3dec9a..00000000 --- a/src/com/sipai/service/exam/DaytestQuesOptionService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.entity.exam.DaytestQuesOption; - -import java.util.List; - -public interface DaytestQuesOptionService { - - public DaytestQuesOption selectById(String t); - - public int deleteById(String t); - - public int save(DaytestQuesOption t); - - public int update(DaytestQuesOption t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/exam/DaytestQuesOptionServiceImpl.java b/src/com/sipai/service/exam/DaytestQuesOptionServiceImpl.java deleted file mode 100644 index 093f91dc..00000000 --- a/src/com/sipai/service/exam/DaytestQuesOptionServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.DaytestQuesOptionDao; -import com.sipai.entity.exam.DaytestQuesOption; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("DaytestQuesOptionService") -public class DaytestQuesOptionServiceImpl implements DaytestQuesOptionService{ - @Resource - private DaytestQuesOptionDao daytestQuesOptionDao; - - @Override - public DaytestQuesOption selectById(String t) { - return daytestQuesOptionDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return daytestQuesOptionDao.deleteByPrimaryKey(t); - } - - @Override - public int save(DaytestQuesOption t) { - return daytestQuesOptionDao.insertSelective(t); - } - - @Override - public int update(DaytestQuesOption t) { - return daytestQuesOptionDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - DaytestQuesOption daytestQuesOption = new DaytestQuesOption(); - daytestQuesOption.setWhere(t); - List list = daytestQuesOptionDao.selectListByWhere(daytestQuesOption); - - return list; - } - - @Override - public int deleteByWhere(String t) { - DaytestQuesOption daytestQuesOption = new DaytestQuesOption(); - daytestQuesOption.setWhere(t); - return daytestQuesOptionDao.deleteByWhere(daytestQuesOption); - } - -} diff --git a/src/com/sipai/service/exam/DaytestRecordService.java b/src/com/sipai/service/exam/DaytestRecordService.java deleted file mode 100644 index 97f52bc4..00000000 --- a/src/com/sipai/service/exam/DaytestRecordService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.entity.exam.DaytestRecord; - -import java.util.List; - -public interface DaytestRecordService { - - public DaytestRecord selectById(String t); - - public int deleteById(String t); - - public int save(DaytestRecord t); - - public int update(DaytestRecord t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - - public void daytestnormal(String id,String userid,String nowDate); - -} diff --git a/src/com/sipai/service/exam/DaytestRecordServiceImpl.java b/src/com/sipai/service/exam/DaytestRecordServiceImpl.java deleted file mode 100644 index 24fbd95e..00000000 --- a/src/com/sipai/service/exam/DaytestRecordServiceImpl.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.DaytestRecordDao; -import com.sipai.dao.question.QuesTitleDao; -import com.sipai.entity.exam.DaytestPaper; -import com.sipai.entity.exam.DaytestQuesOption; -import com.sipai.entity.exam.DaytestRecord; -import com.sipai.entity.question.QuesOption; -import com.sipai.entity.question.QuesTitle; -import com.sipai.service.question.QuesOptionService; -import com.sipai.service.question.QuesTitleService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service("DaytestRecordService") -public class DaytestRecordServiceImpl implements DaytestRecordService{ - @Resource - private DaytestRecordDao daytestRecordDao; - @Resource - private QuesTitleDao quesTitleDao; - @Resource - private QuesTitleService quesTitleService; - @Resource - private QuesOptionService quesOptionService; - @Resource - private DaytestPaperService daytestPaperService; - @Resource - private DaytestQuesOptionService daytestQuesOptionService; - - @Override - public DaytestRecord selectById(String t) { - return daytestRecordDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return daytestRecordDao.deleteByPrimaryKey(t); - } - - @Override - public int save(DaytestRecord t) { - return daytestRecordDao.insertSelective(t); - } - - @Override - public int update(DaytestRecord t) { - return daytestRecordDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - DaytestRecord daytestRecord = new DaytestRecord(); - daytestRecord.setWhere(t); - List list = daytestRecordDao.selectListByWhere(daytestRecord); - - return list; - } - - @Override - public int deleteByWhere(String t) { - DaytestRecord daytestRecord = new DaytestRecord(); - daytestRecord.setWhere(t); - return daytestRecordDao.deleteByWhere(daytestRecord); - } - - @Override - @Transactional(rollbackFor=Exception.class)//事务注解 - public void daytestnormal(String id,String userid,String nowDate) { - DaytestRecord daytestRecord = selectById(id); - - - - int orderNum=0; - - List quesTitlesByQuesttype = this.quesTitleService.selectListByWhere(" where subjecttypeid in ('"+daytestRecord.getSubjecttypeids().replace(",","','")+"') " - - + "ORDER BY NEWID() "); - //先判断是否大于等于10道题 - if(quesTitlesByQuesttype !=null && quesTitlesByQuesttype.size()>=10){ - //每种题型几道题 - for (int k = 0; k < 10; k++) { - orderNum++; - DaytestPaper daytestPaper = new DaytestPaper(); - daytestPaper.setId(CommUtil.getUUID()); - daytestPaper.setDaytestrecordid(daytestRecord.getId()); - daytestPaper.setQuestitleid(quesTitlesByQuesttype.get(k).getId()); - daytestPaper.setQuestypeid(quesTitlesByQuesttype.get(k).getQuesttypeid()); - daytestPaper.setOrd(orderNum); - List QuesOptionlist = this.quesOptionService.selectListByWhere(" where questitleid = '"+quesTitlesByQuesttype.get(k).getId()+"' and optionvalue = 'T' order by ord asc"); - String answervalue=""; - for (int l = 0; l < QuesOptionlist.size(); l++) { - answervalue += QuesOptionlist.get(l).getId(); - if(l!=(QuesOptionlist.size()-1)){ - answervalue+=","; - } - } - daytestPaper.setAnswervalue(answervalue); - daytestPaper.setUseranswer(""); - daytestPaper.setInsuser(userid); - daytestPaper.setInsdt(nowDate); - //插入一道题 - if(this.daytestPaperService.save(daytestPaper)!=1){ - throw new RuntimeException(); - } - List quesOptions = this.quesOptionService.selectListByWhere(" where questitleid = '"+daytestPaper.getQuestitleid()+"' order by ord asc"); - for (int l = 0; l < quesOptions.size(); l++) { - DaytestQuesOption daytestQuesOption = new DaytestQuesOption(); - daytestQuesOption.setId(CommUtil.getUUID()); - daytestQuesOption.setDaytestpaperid(daytestPaper.getId()); - daytestQuesOption.setQuesoptionid(quesOptions.get(l).getId()); - daytestQuesOption.setOrd(l+1); - daytestQuesOption.setInsuser(userid); - daytestQuesOption.setInsdt(nowDate); - //插入一个选项 - if(this.daytestQuesOptionService.save(daytestQuesOption)!=1){ - throw new RuntimeException(); - } - } - }//结束循环 - - }else if(quesTitlesByQuesttype !=null && quesTitlesByQuesttype.size()>0 && quesTitlesByQuesttype.size()<10){ - //每种题型几道题 - for (int k = 0; k < quesTitlesByQuesttype.size(); k++) { - orderNum++; - DaytestPaper daytestPaper = new DaytestPaper(); - daytestPaper.setId(CommUtil.getUUID()); - daytestPaper.setDaytestrecordid(daytestRecord.getId()); - daytestPaper.setQuestitleid(quesTitlesByQuesttype.get(k).getId()); - daytestPaper.setQuestypeid(quesTitlesByQuesttype.get(k).getQuesttypeid()); - daytestPaper.setOrd(orderNum); - List QuesOptionlist = this.quesOptionService.selectListByWhere(" where questitleid = '"+quesTitlesByQuesttype.get(k).getId()+"' and optionvalue = 'T' order by ord asc"); - String answervalue=""; - for (int l = 0; l < QuesOptionlist.size(); l++) { - answervalue += QuesOptionlist.get(l).getId(); - if(l!=(QuesOptionlist.size()-1)){ - answervalue+=","; - } - } - daytestPaper.setAnswervalue(answervalue); - daytestPaper.setUseranswer(""); - daytestPaper.setInsuser(userid); - daytestPaper.setInsdt(nowDate); - //插入一道题 - if(this.daytestPaperService.save(daytestPaper)!=1){ - throw new RuntimeException(); - } - List quesOptions = this.quesOptionService.selectListByWhere(" where questitleid = '"+daytestPaper.getQuestitleid()+"' order by ord asc"); - for (int l = 0; l < quesOptions.size(); l++) { - DaytestQuesOption daytestQuesOption = new DaytestQuesOption(); - daytestQuesOption.setId(CommUtil.getUUID()); - daytestQuesOption.setDaytestpaperid(daytestPaper.getId()); - daytestQuesOption.setQuesoptionid(quesOptions.get(l).getId()); - daytestQuesOption.setOrd(l+1); - daytestQuesOption.setInsuser(userid); - daytestQuesOption.setInsdt(nowDate); - //插入一个选项 - if(this.daytestQuesOptionService.save(daytestQuesOption)!=1){ - throw new RuntimeException(); - } - } - }//结束循环 - }else { - throw new RuntimeException(); - } - - - } - -} diff --git a/src/com/sipai/service/exam/ExamPlanService.java b/src/com/sipai/service/exam/ExamPlanService.java deleted file mode 100644 index 111b4ec6..00000000 --- a/src/com/sipai/service/exam/ExamPlanService.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.ExamPlanDao; -import com.sipai.entity.exam.*; -import com.sipai.entity.question.QuesOption; -import com.sipai.entity.question.QuesTitle; -import com.sipai.entity.question.QuestType; -import com.sipai.service.question.QuesOptionService; -import com.sipai.service.question.QuesTitleService; -import com.sipai.service.question.QuestTypeService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -@Service -public class ExamPlanService implements CommService { - @Resource - private ExamPlanDao examPlanDao; - @Resource - private ExamRecordService examRecordService; - @Resource - private ExamTitleRangeService examTitleRangeService; - @Resource - private QuesTitleService quesTitleService; - @Resource - private TestPaperService testPaperService; - @Resource - private TestQuesOptionService testQuesOptionService; - @Resource - private QuesOptionService quesOptionService; - @Resource - private QuestTypeService questTypeService; - - @Override - public ExamPlan selectById(String id) { - ExamPlan examPlan = this.examPlanDao.selectByPrimaryKey(id); - return examPlan; - } - - @Override - public int deleteById(String id) { - int res = this.examPlanDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(ExamPlan examPlan) { - int res = this.examPlanDao.insert(examPlan); - return res; - } - - @Override - public int update(ExamPlan examPlan) { - int res = this.examPlanDao.updateByPrimaryKeySelective(examPlan); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - ExamPlan examPlan = new ExamPlan(); - examPlan.setWhere(wherestr); - List list = this.examPlanDao.selectListByWhere(examPlan); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ExamPlan examPlan = new ExamPlan(); - examPlan.setWhere(wherestr); - int res = this.examPlanDao.deleteByWhere(examPlan); - return res; - } - @Transactional(rollbackFor=Exception.class)//事务注解 - public void publishExamPlan(String id,String userid,String nowDate) { - ExamPlan examPlan = selectById(id); - examPlan.setStatus("已发布"); - examPlan.setReleasetime(nowDate); - //更新考试安排 - if(update(examPlan)!=1){ - throw new RuntimeException(); - } - List examTitleRanges = this.examTitleRangeService.selectListByWhere(" where pid = '"+id+"' order by ord asc"); - - String examuserids = examPlan.getExamuserids(); - String[] examuseridsArray = examuserids.split(","); - - - //查看是否跨天发布 - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - long startdt = 0; - long enddt = 0; - try { - startdt = df.parse(examPlan.getStartdate()).getTime(); - enddt = df.parse(examPlan.getEnddate()).getTime(); - } catch (ParseException e) { - e.printStackTrace(); - } - int daynum = (int) ((enddt - startdt) / (1000 * 3600 * 24)); - if(daynum<0){ - throw new RuntimeException(); - }else if (daynum==0) { - //每个考生一条考试记录 - for (int i = 0; i < examuseridsArray.length; i++) { - ExamRecord examRecord = new ExamRecord(); - examRecord.setId(CommUtil.getUUID()); - examRecord.setExamplanid(examPlan.getId()); - examRecord.setExamcount(1); - examRecord.setStartdate(examPlan.getStartdate()); - examRecord.setEnddate(examPlan.getEnddate()); - examRecord.setExamuserid(examuseridsArray[i]); - if(i<9){ - examRecord.setExamusernumber("00"+(i+1)); - }else if (i<99) { - examRecord.setExamusernumber("0"+(i+1)); - } - examRecord.setStatus("未考"); - examRecord.setInsuser(userid); - examRecord.setInsdt(nowDate); - //插入考试记录 - if(this.examRecordService.save(examRecord)!=1){ - throw new RuntimeException(); - } - -// int panduanNum=0; -// int danxuanNum=0; -// int duoxuanNum=0; -// int tiankongNum=0; - int orderNum=0; - for (int j = 0; j < examTitleRanges.size(); j++) {//每种题型 - - QuestType questType = this.questTypeService.selectById(examTitleRanges.get(j).getQuesttypeid()); - - - List quesTitlesByQuesttype = this.quesTitleService.selectListByWhere(" where subjecttypeid in ('"+examTitleRanges.get(j).getSubjecttypeids().replace(",","','")+"') " - + "and ranktypeid in ('"+examTitleRanges.get(j).getRanktypeids().replace(",","','")+"') " - + "and questtypeid = '"+examTitleRanges.get(j).getQuesttypeid()+"' " - + "ORDER BY NEWID() "); - - //每种题型几道题 - for (int k = 0; k < examTitleRanges.get(j).getTitlenum(); k++) { -// if (questType.getName().equals("判断题")) { -// panduanNum++; -// } -// if (questType.getName().equals("单选题")) { -// danxuanNum++; -// } -// if (questType.getName().equals("多选题")) { -// duoxuanNum++; -// } -// if (questType.getName().equals("填空题")) { -// tiankongNum++; -// } - orderNum++; - TestPaper testPaper = new TestPaper(); - testPaper.setId(CommUtil.getUUID()); - testPaper.setExamrecordid(examRecord.getId()); - testPaper.setQuestitleid(quesTitlesByQuesttype.get(k).getId()); - testPaper.setQuesttypeid(quesTitlesByQuesttype.get(k).getQuesttypeid()); - testPaper.setOrd(orderNum); - List selectListByWhere = this.quesOptionService.selectListByWhere(" where questitleid = '"+quesTitlesByQuesttype.get(k).getId()+"' and optionvalue = 'T' order by ord asc"); - String answervalue=""; - for (int l = 0; l < selectListByWhere.size(); l++) { - answervalue += selectListByWhere.get(l).getId(); - if(l!=(selectListByWhere.size()-1)){ - answervalue+=","; - } - } - testPaper.setAnswervalue(answervalue); - testPaper.setUseranswer(""); - testPaper.setInsuser(userid); - testPaper.setInsdt(nowDate); - //插入一道题 - if(this.testPaperService.save(testPaper)!=1){ - throw new RuntimeException(); - } - List quesOptions = this.quesOptionService.selectListByWhere(" where questitleid = '"+testPaper.getQuestitleid()+"' order by ord asc"); - for (int l = 0; l < quesOptions.size(); l++) { - TestQuesOption testQuesOption = new TestQuesOption(); - testQuesOption.setId(CommUtil.getUUID()); - testQuesOption.setTestpaperid(testPaper.getId()); - testQuesOption.setQuesoptionid(quesOptions.get(l).getId()); - testQuesOption.setOrd(l+1); - testQuesOption.setInsuser(userid); - testQuesOption.setInsdt(nowDate); - //插入一个选项 - if(this.testQuesOptionService.save(testQuesOption)!=1){ - throw new RuntimeException(); - } - } - } - } - }//循环结束 - }else if (daynum>0) { - System.out.println("不同天"); - - //每个考生一条考试记录 - for (int i = 0; i < examuseridsArray.length; i++) { - for (int dn = 1; dn <= daynum+1; dn++) { - ExamRecord examRecord = new ExamRecord(); - - SimpleDateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date startdt1 = null; - Date enddt1 = null; - try { - startdt1 = df1.parse(examPlan.getStartdate()); - enddt1 = df1.parse(examPlan.getEnddate()); - } catch (ParseException e) { - e.printStackTrace(); - } - - - examRecord.setId(CommUtil.getUUID()); - examRecord.setExamplanid(examPlan.getId()); - examRecord.setExamcount(1); - examRecord.setStartdate(df1.format(new Date(startdt1.getTime()+(long)(1000*3600*24)*(dn-1)))); - examRecord.setEnddate(df1.format(new Date(enddt1.getTime()-(long)(1000*3600*24)*(daynum-dn+1)))); - examRecord.setExamuserid(examuseridsArray[i]); - if(i<9){ - examRecord.setExamusernumber("00"+(i+1)); - }else if (i<99) { - examRecord.setExamusernumber("0"+(i+1)); - } - examRecord.setStatus("未考"); - examRecord.setInsuser(userid); - examRecord.setInsdt(nowDate); - //插入考试记录 - if(this.examRecordService.save(examRecord)!=1){ - throw new RuntimeException(); - } - - // int panduanNum=0; - // int danxuanNum=0; - // int duoxuanNum=0; - // int tiankongNum=0; - int orderNum=0; - for (int j = 0; j < examTitleRanges.size(); j++) {//每种题型 - - QuestType questType = this.questTypeService.selectById(examTitleRanges.get(j).getQuesttypeid()); - - - List quesTitlesByQuesttype = this.quesTitleService.selectListByWhere(" where subjecttypeid in ('"+examTitleRanges.get(j).getSubjecttypeids().replace(",","','")+"') " - + "and ranktypeid in ('"+examTitleRanges.get(j).getRanktypeids().replace(",","','")+"') " - + "and questtypeid = '"+examTitleRanges.get(j).getQuesttypeid()+"' " - + "ORDER BY NEWID() "); - - //每种题型几道题 - for (int k = 0; k < examTitleRanges.get(j).getTitlenum(); k++) { - // if (questType.getName().equals("判断题")) { - // panduanNum++; - // } - // if (questType.getName().equals("单选题")) { - // danxuanNum++; - // } - // if (questType.getName().equals("多选题")) { - // duoxuanNum++; - // } - // if (questType.getName().equals("填空题")) { - // tiankongNum++; - // } - orderNum++; - TestPaper testPaper = new TestPaper(); - testPaper.setId(CommUtil.getUUID()); - testPaper.setExamrecordid(examRecord.getId()); - testPaper.setQuestitleid(quesTitlesByQuesttype.get(k).getId()); - testPaper.setQuesttypeid(quesTitlesByQuesttype.get(k).getQuesttypeid()); - testPaper.setOrd(orderNum); - List selectListByWhere = this.quesOptionService.selectListByWhere(" where questitleid = '"+quesTitlesByQuesttype.get(k).getId()+"' and optionvalue = 'T' order by ord asc"); - String answervalue=""; - for (int l = 0; l < selectListByWhere.size(); l++) { - answervalue += selectListByWhere.get(l).getId(); - if(l!=(selectListByWhere.size()-1)){ - answervalue+=","; - } - } - testPaper.setAnswervalue(answervalue); - testPaper.setUseranswer(""); - testPaper.setInsuser(userid); - testPaper.setInsdt(nowDate); - //插入一道题 - if(this.testPaperService.save(testPaper)!=1){ - throw new RuntimeException(); - } - List quesOptions = this.quesOptionService.selectListByWhere(" where questitleid = '"+testPaper.getQuestitleid()+"' order by ord asc"); - for (int l = 0; l < quesOptions.size(); l++) { - TestQuesOption testQuesOption = new TestQuesOption(); - testQuesOption.setId(CommUtil.getUUID()); - testQuesOption.setTestpaperid(testPaper.getId()); - testQuesOption.setQuesoptionid(quesOptions.get(l).getId()); - testQuesOption.setOrd(l+1); - testQuesOption.setInsuser(userid); - testQuesOption.setInsdt(nowDate); - //插入一个选项 - if(this.testQuesOptionService.save(testQuesOption)!=1){ - throw new RuntimeException(); - } - } - } - } - } - }//循环结束 - } - - - - - } -} diff --git a/src/com/sipai/service/exam/ExamRecordService.java b/src/com/sipai/service/exam/ExamRecordService.java deleted file mode 100644 index 8772a24a..00000000 --- a/src/com/sipai/service/exam/ExamRecordService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.entity.exam.ExamRecord; - -import java.util.List; - -; - -public interface ExamRecordService { - - public ExamRecord selectById(String t); - - public int deleteById(String t); - - public int save(ExamRecord t); - - public int update(ExamRecord t); - - public List selectListByWhere(String t); - - public List selectTestListByWhere(String t); - - public List selectmonicount(String t); - - public List selectsearch(String t); - - public int deleteByWhere(String t); - public int calculateScore(String examRecordId); -} diff --git a/src/com/sipai/service/exam/ExamRecordServiceImpl.java b/src/com/sipai/service/exam/ExamRecordServiceImpl.java deleted file mode 100644 index e2e23758..00000000 --- a/src/com/sipai/service/exam/ExamRecordServiceImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.ExamRecordDao; -import com.sipai.entity.exam.ExamPlan; -import com.sipai.entity.exam.ExamRecord; -import com.sipai.entity.exam.ExamTitleRange; -import com.sipai.entity.exam.TestPaper; -import com.sipai.entity.question.QuesTitle; -import com.sipai.entity.user.User; -import com.sipai.service.question.QuesTitleService; -import com.sipai.service.question.QuestTypeService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("ExamRecordService") -public class ExamRecordServiceImpl implements ExamRecordService{ - @Resource - private ExamRecordDao examRecordDao; - @Resource - private TestPaperService testPaperService; - @Resource - private ExamPlanService examPlanService; - @Resource - private ExamTitleRangeService examTitleRangeService; - @Resource - private QuesTitleService quesTitleService; - @Resource - private QuestTypeService questTypeService; - @Resource - private UserService userService; - - @Override - public ExamRecord selectById(String t) { - return examRecordDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return examRecordDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ExamRecord t) { - return examRecordDao.insertSelective(t); - } - - @Override - public int update(ExamRecord t) { - return examRecordDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - ExamRecord examRecord = new ExamRecord(); - examRecord.setWhere(t); - List list = examRecordDao.selectListByWhere(examRecord); - for(ExamRecord item : list){ - ExamPlan examPlan = examPlanService.selectById(item.getExamplanid()); - User user = userService.getUserById(item.getExamuserid()); - if(examPlan!=null){ - item.setExamPlan(examPlan); - item.set_examname(examPlan.getExamname()); - } - if(user!=null){ - item.set_username(user.getCaption()); - } - } - return list; - } - - @Override - public List selectTestListByWhere(String t) { - ExamRecord examRecord = new ExamRecord(); - examRecord.setWhere(t); - List list = examRecordDao.selectTestListByWhere(examRecord); - return list; - } - - @Override - public List selectmonicount(String t) { - ExamRecord examRecord = new ExamRecord(); - examRecord.setWhere(t); - List list = examRecordDao.selectmonicount(examRecord); - return list; - } - - @Override - public List selectsearch(String t) { - ExamRecord examRecord = new ExamRecord(); - examRecord.setWhere(t); - List list = examRecordDao.selectsearch(examRecord); - for(ExamRecord item : list){ - ExamPlan examPlan = examPlanService.selectById(item.getExamplanid()); - User user = userService.getUserById(item.getExamuserid()); - if(examPlan!=null){ - item.setExamPlan(examPlan); - item.set_examname(examPlan.getExamname()); - } - if(user!=null){ - item.set_username(user.getCaption()); - } - } - return list; - } - - @Override - public int deleteByWhere(String t) { - ExamRecord examRecord = new ExamRecord(); - examRecord.setWhere(t); - return examRecordDao.deleteByWhere(examRecord); - } - - @Override - public int calculateScore(String examRecordId){ - double score = 0; - ExamRecord examRecord = selectById(examRecordId); - ExamPlan examPlan = this.examPlanService.selectById(examRecord.getExamplanid()); - List examTitleRanges = this.examTitleRangeService.selectListByWhere(" where pid = '"+examPlan.getId()+"' "); - - List list = this.testPaperService.selectListByWhere(" where examrecordid = '"+examRecordId+"' "); - for (TestPaper testPaper : list) { - if("正确".equals(testPaper.getStatus())){ - QuesTitle quesTitle = this.quesTitleService.selectById(testPaper.getQuestitleid()); - for (ExamTitleRange examTitleRange : examTitleRanges) { - if(examTitleRange.getQuesttypeid().equals(quesTitle.getQuesttypeid())){ - score+=examTitleRange.getSinglyscore(); - } - } - } - } - - examRecord.setExamscore(score); - examRecord.setStatus("完成考试"); - examRecord.setExamendtime(CommUtil.nowDate()); - if(score>=examPlan.getPassscore()){ - examRecord.setPassstatus("合格"); - }else { - examRecord.setPassstatus("不合格"); - } - return update(examRecord); - } -} diff --git a/src/com/sipai/service/exam/ExamTitleRangeService.java b/src/com/sipai/service/exam/ExamTitleRangeService.java deleted file mode 100644 index f420ece2..00000000 --- a/src/com/sipai/service/exam/ExamTitleRangeService.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.ExamTitleRangeDao; -import com.sipai.entity.exam.ExamTitleRange; -import com.sipai.entity.question.QuestType; -import com.sipai.entity.question.RankType; -import com.sipai.entity.question.Subjecttype; -import com.sipai.service.question.QuestTypeService; -import com.sipai.service.question.RankTypeService; -import com.sipai.service.question.SubjecttypeService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class ExamTitleRangeService implements CommService { - @Resource - private ExamTitleRangeDao examTitleRangeDao; - @Resource - private SubjecttypeService subjecttypeService; - @Resource - private RankTypeService rankTypeService; - @Resource - private QuestTypeService questTypeService; - - @Override - public ExamTitleRange selectById(String id) { - ExamTitleRange examTitleRange = this.examTitleRangeDao.selectByPrimaryKey(id); - String subjectTypeIds = examTitleRange.getSubjecttypeids().replace(",","','"); - String rankTypeIds = examTitleRange.getRanktypeids().replace(",","','"); - String questTypeId = examTitleRange.getQuesttypeid(); - List subjecttypes = this.subjecttypeService.selectListByWhere("where id in ('"+subjectTypeIds+"')"); - List rankTypes = this.rankTypeService.selectListByWhere("where id in ('"+rankTypeIds+"')"); - QuestType questType = this.questTypeService.selectById(questTypeId); - String subjectTypeName =""; - String rankTypeName = ""; - for (int i = 0; i < subjecttypes.size(); i++) { - subjectTypeName+=subjecttypes.get(i).getName(); - if(i!=(subjecttypes.size()-1)){ - subjectTypeName+=","; - } - } - for (int i = 0; i < rankTypes.size(); i++) { - rankTypeName+=rankTypes.get(i).getName(); - if(i!=(rankTypes.size()-1)){ - rankTypeName+=","; - } - } - examTitleRange.set_subjectTypeName(subjectTypeName); - examTitleRange.set_rankTypeName(rankTypeName); - examTitleRange.set_questTypeName(questType.getName()); - if(examTitleRange.getSinglyscore()!=null&&examTitleRange.getTitlenum()!=null){ - examTitleRange.set_score(examTitleRange.getSinglyscore()*examTitleRange.getTitlenum()); - } - return examTitleRange; - } - - @Override - public int deleteById(String id) { - int res = this.examTitleRangeDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(ExamTitleRange examTitleRange) { - int res = this.examTitleRangeDao.insert(examTitleRange); - return res; - } - - @Override - public int update(ExamTitleRange examTitleRange) { - int res = this.examTitleRangeDao.updateByPrimaryKeySelective(examTitleRange); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - ExamTitleRange examTitleRange = new ExamTitleRange(); - examTitleRange.setWhere(wherestr); - List list = this.examTitleRangeDao.selectListByWhere(examTitleRange); - for (ExamTitleRange item : list) { - String subjectTypeIds = item.getSubjecttypeids().replace(",","','"); - String rankTypeIds = item.getRanktypeids().replace(",","','"); - String questTypeId = item.getQuesttypeid(); - List subjecttypes = this.subjecttypeService.selectListByWhere("where id in ('"+subjectTypeIds+"')"); - List rankTypes = this.rankTypeService.selectListByWhere("where id in ('"+rankTypeIds+"')"); - QuestType questType = this.questTypeService.selectById(questTypeId); - String subjectTypeName =""; - String rankTypeName = ""; - for (int i = 0; i < subjecttypes.size(); i++) { - subjectTypeName+=subjecttypes.get(i).getName(); - if(i!=(subjecttypes.size()-1)){ - subjectTypeName+=","; - } - } - for (int i = 0; i < rankTypes.size(); i++) { - rankTypeName+=rankTypes.get(i).getName(); - if(i!=(rankTypes.size()-1)){ - rankTypeName+=","; - } - } - if(subjectTypeName!=null){ - item.set_subjectTypeName(subjectTypeName); - } - if(rankTypeName!=null){ - item.set_rankTypeName(rankTypeName); - } - if(questType!=null){ - item.set_questTypeName(questType.getName()); - } - if(item.getSinglyscore()!=null&&item.getTitlenum()!=null){ - item.set_score(item.getSinglyscore()*item.getTitlenum()); - } - - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ExamTitleRange examTitleRange = new ExamTitleRange(); - examTitleRange.setWhere(wherestr); - int res = this.examTitleRangeDao.deleteByWhere(examTitleRange); - return res; - } - -} diff --git a/src/com/sipai/service/exam/TestPaperService.java b/src/com/sipai/service/exam/TestPaperService.java deleted file mode 100644 index 4bbcbe49..00000000 --- a/src/com/sipai/service/exam/TestPaperService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.TestPaperDao; -import com.sipai.entity.exam.TestPaper; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class TestPaperService implements CommService{ - @Resource - private TestPaperDao testPaperDao; - - @Override - public TestPaper selectById(String id) { - TestPaper testPaper = this.testPaperDao.selectByPrimaryKey(id); - return testPaper; - } - - @Override - public int deleteById(String id) { - int res = this.testPaperDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(TestPaper testPaper) { - int res = this.testPaperDao.insert(testPaper); - return res; - } - - @Override - public int update(TestPaper testPaper) { - int res = this.testPaperDao.updateByPrimaryKeySelective(testPaper); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - TestPaper testPaper = new TestPaper(); - testPaper.setWhere(wherestr); - List list = this.testPaperDao.selectListByWhere(testPaper); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - TestPaper testPaper = new TestPaper(); - testPaper.setWhere(wherestr); - int res = this.testPaperDao.deleteByWhere(testPaper); - return res; - } - -} diff --git a/src/com/sipai/service/exam/TestQuesOptionService.java b/src/com/sipai/service/exam/TestQuesOptionService.java deleted file mode 100644 index efe940e7..00000000 --- a/src/com/sipai/service/exam/TestQuesOptionService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.exam; - -import com.sipai.dao.exam.TestQuesOptionDao; -import com.sipai.entity.exam.TestQuesOption; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class TestQuesOptionService implements CommService{ - @Resource - private TestQuesOptionDao testQuesOptionDao; - - @Override - public TestQuesOption selectById(String id) { - TestQuesOption testQuesOption = this.testQuesOptionDao.selectByPrimaryKey(id); - return testQuesOption; - } - - @Override - public int deleteById(String id) { - int res = this.testQuesOptionDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(TestQuesOption testQuesOption) { - int res = this.testQuesOptionDao.insert(testQuesOption); - return res; - } - - @Override - public int update(TestQuesOption testQuesOption) { - int res = this.testQuesOptionDao.updateByPrimaryKeySelective(testQuesOption); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - TestQuesOption testQuesOption = new TestQuesOption(); - testQuesOption.setWhere(wherestr); - List list = this.testQuesOptionDao.selectListByWhere(testQuesOption); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - TestQuesOption testQuesOption = new TestQuesOption(); - testQuesOption.setWhere(wherestr); - int res = this.testQuesOptionDao.deleteByWhere(testQuesOption); - return res; - } - -} diff --git a/src/com/sipai/service/fangzhen/FangZhenBalanceService.java b/src/com/sipai/service/fangzhen/FangZhenBalanceService.java deleted file mode 100644 index ee8243cd..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenBalanceService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenBalance; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenBalanceService { - - public List selectListByWhere(String where); - - public abstract FangZhenBalance selectById(String t); - -} diff --git a/src/com/sipai/service/fangzhen/FangZhenBrowserService.java b/src/com/sipai/service/fangzhen/FangZhenBrowserService.java deleted file mode 100644 index 63a63967..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenBrowserService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenBrowser; - -import java.util.List; - -public interface FangZhenBrowserService { - public List selectListByWhere(String where); - - public abstract FangZhenBrowser selectById(String t); - - public int deleteById(String t); - - public int save(FangZhenBrowser t); - - public int update(FangZhenBrowser t); -} diff --git a/src/com/sipai/service/fangzhen/FangZhenEquipmentService.java b/src/com/sipai/service/fangzhen/FangZhenEquipmentService.java deleted file mode 100644 index ef6f19bf..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenEquipmentService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenEquipment; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenEquipmentService { - public List selectListByWhere(String where); - - public abstract FangZhenEquipment selectById(String t); -} diff --git a/src/com/sipai/service/fangzhen/FangZhenHeadUIService.java b/src/com/sipai/service/fangzhen/FangZhenHeadUIService.java deleted file mode 100644 index bc680897..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenHeadUIService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenHeadUI; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenHeadUIService { - public List selectListByWhere(String where); - - public abstract FangZhenHeadUI selectById(String t); -} diff --git a/src/com/sipai/service/fangzhen/FangZhenPipeService.java b/src/com/sipai/service/fangzhen/FangZhenPipeService.java deleted file mode 100644 index da498b2c..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenPipeService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenPipe; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenPipeService { - public List selectListByWhere(String where); - - public abstract FangZhenPipe selectById(String t); -} diff --git a/src/com/sipai/service/fangzhen/FangZhenStationService.java b/src/com/sipai/service/fangzhen/FangZhenStationService.java deleted file mode 100644 index d39c2d79..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenStationService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenPipe; -import com.sipai.entity.fangzhen.FangZhenStation; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenStationService { - public List selectListByWhere(String where); - - public abstract FangZhenStation selectById(String t); -} diff --git a/src/com/sipai/service/fangzhen/FangZhenWaterService.java b/src/com/sipai/service/fangzhen/FangZhenWaterService.java deleted file mode 100644 index 342a453b..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenWaterService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenWater; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenWaterService { - public List selectListByWhere(String where); - - public abstract FangZhenWater selectById(String t); -} diff --git a/src/com/sipai/service/fangzhen/FangZhenXeomaService.java b/src/com/sipai/service/fangzhen/FangZhenXeomaService.java deleted file mode 100644 index f114cfa3..00000000 --- a/src/com/sipai/service/fangzhen/FangZhenXeomaService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.service.fangzhen; - -import com.sipai.entity.fangzhen.FangZhenWater; -import com.sipai.entity.fangzhen.FangZhenXeoma; -import org.springframework.stereotype.Service; - -import java.util.List; - -public interface FangZhenXeomaService { - public List selectListByWhere(String where); - - public abstract FangZhenXeoma selectById(String t); -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenBalanceServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenBalanceServiceImpl.java deleted file mode 100644 index 50b76b53..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenBalanceServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.dao.fangzhen.FangZhenBalanceDao; -import com.sipai.entity.fangzhen.FangZhenBalance; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.fangzhen.FangZhenBalanceService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenBalanceServiceImpl implements FangZhenBalanceService { - @Resource - private FangZhenBalanceDao fangZhenBalanceDao; - - @Override - public List selectListByWhere(String where) { - FangZhenBalance entity = new FangZhenBalance(); - entity.setWhere(where); - List list = fangZhenBalanceDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenBalance selectById(String t) { - FangZhenBalance entity = fangZhenBalanceDao.selectByPrimaryKey(t); - return entity; - } - -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenBrowserServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenBrowserServiceImpl.java deleted file mode 100644 index fa2ee8a4..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenBrowserServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.dao.fangzhen.FangZhenBrowserDao; -import com.sipai.entity.fangzhen.FangZhenBrowser; -import com.sipai.service.fangzhen.FangZhenBrowserService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenBrowserServiceImpl implements FangZhenBrowserService { - @Resource - private FangZhenBrowserDao fangZhenBrowserDao; - - @Override - public List selectListByWhere(String where) { - FangZhenBrowser entity = new FangZhenBrowser(); - entity.setWhere(where); - List list = fangZhenBrowserDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenBrowser selectById(String t) { - FangZhenBrowser entity = fangZhenBrowserDao.selectByPrimaryKey(t); - return entity; - } - - @Override - public int deleteById(String t) { - return fangZhenBrowserDao.deleteByPrimaryKey(t); - } - - @Override - public int save(FangZhenBrowser t) { - return fangZhenBrowserDao.insert(t); - } - - @Override - public int update(FangZhenBrowser t) { - return fangZhenBrowserDao.updateByPrimaryKeySelective(t); - } - -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenEquipmentServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenEquipmentServiceImpl.java deleted file mode 100644 index 2270cb0e..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenEquipmentServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.dao.fangzhen.FangZhenEquipmentDao; -import com.sipai.entity.fangzhen.FangZhenEquipment; -import com.sipai.service.fangzhen.FangZhenEquipmentService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenEquipmentServiceImpl implements FangZhenEquipmentService { - @Resource - private FangZhenEquipmentDao fangZhenEquipmentDao; - - @Override - public List selectListByWhere(String where) { - FangZhenEquipment entity = new FangZhenEquipment(); - entity.setWhere(where); - List list = fangZhenEquipmentDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenEquipment selectById(String t) { - FangZhenEquipment entity = fangZhenEquipmentDao.selectByPrimaryKey(t); - return entity; - } - -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenHeadUIServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenHeadUIServiceImpl.java deleted file mode 100644 index c4e4447c..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenHeadUIServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.dao.fangzhen.FangZhenHeadUIDao; -import com.sipai.entity.fangzhen.FangZhenHeadUI; -import com.sipai.service.fangzhen.FangZhenHeadUIService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenHeadUIServiceImpl implements FangZhenHeadUIService { - @Resource - private FangZhenHeadUIDao FangZhenHeadUIDao; - - @Override - public List selectListByWhere(String where) { - FangZhenHeadUI entity = new FangZhenHeadUI(); - entity.setWhere(where); - List list = FangZhenHeadUIDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenHeadUI selectById(String t) { - FangZhenHeadUI entity = FangZhenHeadUIDao.selectByPrimaryKey(t); - return entity; - } -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenPipeServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenPipeServiceImpl.java deleted file mode 100644 index 659b6b22..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenPipeServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.entity.fangzhen.FangZhenPipe; -import com.sipai.service.fangzhen.FangZhenPipeService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenPipeServiceImpl implements FangZhenPipeService { - @Resource - private com.sipai.dao.fangzhen.FangZhenPipeDao FangZhenPipeDao; - - @Override - public List selectListByWhere(String where) { - FangZhenPipe entity = new FangZhenPipe(); - entity.setWhere(where); - List list = FangZhenPipeDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenPipe selectById(String t) { - FangZhenPipe entity = FangZhenPipeDao.selectByPrimaryKey(t); - return entity; - } - -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenStationServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenStationServiceImpl.java deleted file mode 100644 index 15918ebb..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenStationServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.entity.fangzhen.FangZhenStation; -import com.sipai.service.fangzhen.FangZhenStationService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenStationServiceImpl implements FangZhenStationService { - @Resource - private com.sipai.dao.fangzhen.FangZhenStationDao FangZhenStationDao; - - @Override - public List selectListByWhere(String where) { - FangZhenStation entity = new FangZhenStation(); - entity.setWhere(where); - List list = FangZhenStationDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenStation selectById(String t) { - FangZhenStation entity = FangZhenStationDao.selectByPrimaryKey(t); - return entity; - } -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenWaterServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenWaterServiceImpl.java deleted file mode 100644 index 1e6350b8..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenWaterServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.entity.fangzhen.FangZhenWater; -import com.sipai.service.fangzhen.FangZhenWaterService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenWaterServiceImpl implements FangZhenWaterService { - @Resource - private com.sipai.dao.fangzhen.FangZhenWaterDao FangZhenWaterDao; - - @Override - public List selectListByWhere(String where) { - FangZhenWater entity = new FangZhenWater(); - entity.setWhere(where); - List list = FangZhenWaterDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenWater selectById(String t) { - FangZhenWater entity = FangZhenWaterDao.selectByPrimaryKey(t); - return entity; - } -} diff --git a/src/com/sipai/service/fangzhen/impl/FangZhenXeomaServiceImpl.java b/src/com/sipai/service/fangzhen/impl/FangZhenXeomaServiceImpl.java deleted file mode 100644 index 3bc66403..00000000 --- a/src/com/sipai/service/fangzhen/impl/FangZhenXeomaServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.fangzhen.impl; - -import com.sipai.entity.fangzhen.FangZhenXeoma; -import com.sipai.entity.fangzhen.FangZhenXeoma; -import com.sipai.service.fangzhen.FangZhenXeomaService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FangZhenXeomaServiceImpl implements FangZhenXeomaService { - @Resource - private com.sipai.dao.fangzhen.FangZhenXeomaDao FangZhenXeomaDao; - - @Override - public List selectListByWhere(String where) { - FangZhenXeoma entity = new FangZhenXeoma(); - entity.setWhere(where); - List list = FangZhenXeomaDao.selectListByWhere(entity); - return list; - } - - @Override - public FangZhenXeoma selectById(String t) { - FangZhenXeoma entity = FangZhenXeomaDao.selectByPrimaryKey(t); - return entity; - } -} diff --git a/src/com/sipai/service/finance/FinanceEquipmentDeptInfoService.java b/src/com/sipai/service/finance/FinanceEquipmentDeptInfoService.java deleted file mode 100644 index e99d5276..00000000 --- a/src/com/sipai/service/finance/FinanceEquipmentDeptInfoService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.finance; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.finance.FinanceEquipmentDeptInfoDao; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.finance.FinanceEquipmentDeptInfo; -import com.sipai.tools.CommService; - -@Service -public class FinanceEquipmentDeptInfoService implements CommService{ - @Resource - private FinanceEquipmentDeptInfoDao financeEquipmentDeptInfoDao; - - @Override - public FinanceEquipmentDeptInfo selectById(String t) { - // TODO Auto-generated method stub - return financeEquipmentDeptInfoDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return financeEquipmentDeptInfoDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(FinanceEquipmentDeptInfo t) { - // TODO Auto-generated method stub - return financeEquipmentDeptInfoDao.insert(t); - - } - - @Override - public int update(FinanceEquipmentDeptInfo t) { - // TODO Auto-generated method stub - return financeEquipmentDeptInfoDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - FinanceEquipmentDeptInfo financeEquDeptInfo = new FinanceEquipmentDeptInfo(); - financeEquDeptInfo.setWhere(t); - return financeEquipmentDeptInfoDao.selectListByWhere(financeEquDeptInfo); - - } - - @Override - public int deleteByWhere(String t) { - FinanceEquipmentDeptInfo financeEquDeptInfo = new FinanceEquipmentDeptInfo(); - financeEquDeptInfo.setWhere(t); - return financeEquipmentDeptInfoDao.deleteByWhere(financeEquDeptInfo); - } - -} diff --git a/src/com/sipai/service/fwk/MenunumberService.java b/src/com/sipai/service/fwk/MenunumberService.java deleted file mode 100644 index 4eba7adc..00000000 --- a/src/com/sipai/service/fwk/MenunumberService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.fwk; - -import java.util.List; - -import com.sipai.entity.fwk.Menunumber; - -public interface MenunumberService { - - public Menunumber selectById(String t); - - public int deleteById(String t); - - public int save(Menunumber t); - - public int update(Menunumber t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - - public void toMenu(String menuId); - - public String get_menuitemname(); - - public void set_menuitemname(String _menuitemname); - - public List selectCountListByWhere(String t); - - public List selectCountListByWhereDetail(String t); - -} diff --git a/src/com/sipai/service/fwk/UserToMenuService.java b/src/com/sipai/service/fwk/UserToMenuService.java deleted file mode 100644 index b49e0d4b..00000000 --- a/src/com/sipai/service/fwk/UserToMenuService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.fwk; - -import java.util.List; - -import com.sipai.entity.fwk.UserToMenu; - -public interface UserToMenuService { - - public UserToMenu selectById(String t); - - public int deleteById(String t); - - public int save(UserToMenu t); - - public int update(UserToMenu t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/fwk/WeatherHistoryService.java b/src/com/sipai/service/fwk/WeatherHistoryService.java deleted file mode 100644 index 551e8916..00000000 --- a/src/com/sipai/service/fwk/WeatherHistoryService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.fwk; - -import java.util.List; - -import com.sipai.entity.fwk.WeatherHistory; - -public interface WeatherHistoryService { - - public WeatherHistory selectById(String t); - - public int deleteById(String t); - - public int save(WeatherHistory t); - - public int update(WeatherHistory t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/fwk/impl/MenunumberServiceImpl.java b/src/com/sipai/service/fwk/impl/MenunumberServiceImpl.java deleted file mode 100644 index e282fb66..00000000 --- a/src/com/sipai/service/fwk/impl/MenunumberServiceImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.service.fwk.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.fwk.MenunumberDao; -import com.sipai.entity.fwk.Menunumber; -import com.sipai.entity.user.Menu; -import com.sipai.service.fwk.MenunumberService; -import com.sipai.service.user.MenuService; - -@Service("menunumberService") -public class MenunumberServiceImpl implements MenunumberService{ - - @Resource - private MenunumberDao menunumberDao; - @Resource - private MenuService menuService; - - @Override - public Menunumber selectById(String t) { - // TODO Auto-generated method stub - return menunumberDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return menunumberDao.deleteByPrimaryKey(t); - } - - @Override - public int save(Menunumber entity) { - // TODO Auto-generated method stub - - return menunumberDao.insertSelective(entity); - } - - - - @Override - public int update(Menunumber entity) { - // TODO Auto-generated method stub - - return menunumberDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String t) { - Menunumber entity = new Menunumber(); - entity.setWhere(t); - return menunumberDao.selectListByWhere(entity); - } - - - @Transactional - public int deleteByWhere(String t) { - Menunumber entity = new Menunumber(); - entity.setWhere(t); - return menunumberDao.deleteByWhere(entity); - } - - public String _menuitemname=""; - - public String get_menuitemname() { - return _menuitemname; - } - - public void set_menuitemname(String _menuitemname) { - this._menuitemname = _menuitemname; - } - - public void toMenu(String menuId){ - Menu menu = this.menuService.getMenuById(menuId); - if(menu!=null){ - this._menuitemname+=menu.getName().trim(); - if(!menu.getPid().trim().equals("-1")){ - this._menuitemname+=">>"; - this.toMenu(menu.getPid()); - } - } - } - - public List selectCountListByWhere(String t) { - Menunumber entity = new Menunumber(); - entity.setWhere(t); - return menunumberDao.selectCountListByWhere(entity); - } - - public List selectCountListByWhereDetail(String t) { - Menunumber entity = new Menunumber(); - entity.setWhere(t); - return menunumberDao.selectCountListByWhereDetail(entity); - } - -} diff --git a/src/com/sipai/service/fwk/impl/UserToMenuServiceImpl.java b/src/com/sipai/service/fwk/impl/UserToMenuServiceImpl.java deleted file mode 100644 index b8f076c6..00000000 --- a/src/com/sipai/service/fwk/impl/UserToMenuServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.fwk.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.fwk.UserToMenuDao; -import com.sipai.entity.fwk.UserToMenu; -import com.sipai.service.fwk.UserToMenuService; - -@Service("userToMenuService") -public class UserToMenuServiceImpl implements UserToMenuService{ - - @Resource - private UserToMenuDao userToMenuDao; - - @Override - public UserToMenu selectById(String t) { - // TODO Auto-generated method stub - return userToMenuDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return userToMenuDao.deleteByPrimaryKey(t); - } - - @Override - public int save(UserToMenu entity) { - // TODO Auto-generated method stub - - return userToMenuDao.insertSelective(entity); - } - - - - @Override - public int update(UserToMenu entity) { - // TODO Auto-generated method stub - - return userToMenuDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String t) { - UserToMenu entity = new UserToMenu(); - entity.setWhere(t); - return userToMenuDao.selectListByWhere(entity); - } - - - @Transactional - public int deleteByWhere(String t) { - UserToMenu entity = new UserToMenu(); - entity.setWhere(t); - return userToMenuDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/fwk/impl/WeatherHistoryServiceImpl.java b/src/com/sipai/service/fwk/impl/WeatherHistoryServiceImpl.java deleted file mode 100644 index f45960e0..00000000 --- a/src/com/sipai/service/fwk/impl/WeatherHistoryServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.fwk.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.fwk.WeatherHistoryDao; -import com.sipai.entity.fwk.WeatherHistory; -import com.sipai.service.fwk.WeatherHistoryService; - -@Service("weatherHistoryService") -public class WeatherHistoryServiceImpl implements WeatherHistoryService{ - - @Resource - private WeatherHistoryDao weatherHistoryDao; - - @Override - public WeatherHistory selectById(String t) { - // TODO Auto-generated method stub - return weatherHistoryDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return weatherHistoryDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WeatherHistory entity) { - // TODO Auto-generated method stub - - return weatherHistoryDao.insertSelective(entity); - } - - - - @Override - public int update(WeatherHistory entity) { - // TODO Auto-generated method stub - - return weatherHistoryDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String t) { - WeatherHistory entity = new WeatherHistory(); - entity.setWhere(t); - return weatherHistoryDao.selectListByWhere(entity); - } - - - @Transactional - public int deleteByWhere(String t) { - WeatherHistory entity = new WeatherHistory(); - entity.setWhere(t); - return weatherHistoryDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/hqconfig/EnterRecordService.java b/src/com/sipai/service/hqconfig/EnterRecordService.java deleted file mode 100644 index cf224ee6..00000000 --- a/src/com/sipai/service/hqconfig/EnterRecordService.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.service.hqconfig; - -import com.sipai.dao.hqconfig.EnterRecordDao; -import com.sipai.dao.user.UserDao; -import com.sipai.entity.hqconfig.EnterRecord; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserOutsiders; -import com.sipai.service.user.UserOutsidersService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -@Service -public class EnterRecordService implements CommService{ - @Resource - private EnterRecordDao enterRecordDao; - @Resource - private UserDao userDao; - @Resource - UserOutsidersService userOutsidersService; - - @Override - public EnterRecord selectById(String t) { - // TODO Auto-generated method stub - return enterRecordDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return enterRecordDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EnterRecord t) { - // TODO Auto-generated method stub - return enterRecordDao.insertSelective(t); - } - - @Override - public int update(EnterRecord t) { - // TODO Auto-generated method stub - return enterRecordDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - EnterRecord enterRecord = new EnterRecord(); - enterRecord.setWhere(t); - return enterRecordDao.selectListByWhere(enterRecord); - } - - @Override - public int deleteByWhere(String t) { - EnterRecord enterRecord = new EnterRecord(); - enterRecord.setWhere(t); - return enterRecordDao.deleteByWhere(enterRecord); - } - - public List selectTopNlistByWhere(Map map) { - List list = enterRecordDao.selectTopNlistByWhere(map); - if (list != null && list.size() > 0) { - for (EnterRecord enterRecord : list) { - User user = userDao.selectByPrimaryKey(enterRecord.getEnterid()); - if (user != null) { - enterRecord.setPersonName(user.getCaption()); - enterRecord.setJobText(user.get_pname()); - }else{ - UserOutsiders userOutsiders = userOutsidersService.selectById(enterRecord.getEnterid()); - if(userOutsiders!=null){ - enterRecord.setPersonName(userOutsiders.getName()); - if ( "1".equals(userOutsiders.getPid())) { - enterRecord.setJobText("访客"); - } else { - if ("2".equals(userOutsiders.getPid())) { - enterRecord.setJobText("承包商"); - } else { - enterRecord.setJobText("其他"); - } - } - } - } - if (enterRecord.getDuration() != null) { - enterRecord.setDurationText(CommUtil.secondToDate(enterRecord.getDuration())); - } - enterRecord.setIntime(enterRecord.getIntime().substring(11, 19)); - enterRecord.set_state(enterRecord.getState() ? "区域内" : "区域外"); - } - } - return list; - } - public List selectCount4state() { - return enterRecordDao.selectCount4state(); - } - -} diff --git a/src/com/sipai/service/hqconfig/HQAlarmRecordService.java b/src/com/sipai/service/hqconfig/HQAlarmRecordService.java deleted file mode 100644 index 93960788..00000000 --- a/src/com/sipai/service/hqconfig/HQAlarmRecordService.java +++ /dev/null @@ -1,1123 +0,0 @@ -package com.sipai.service.hqconfig; - -import com.sipai.dao.hqconfig.HQAlarmRecordDao; -import com.sipai.entity.alarm.AlarmLevelsConfig; -import com.sipai.entity.hqconfig.HQAlarmRecord; -import com.sipai.entity.hqconfig.WorkModel; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Unit; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.alarm.AlarmLevesConfigService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.*; -import io.swagger.models.auth.In; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.*; - -@Service("hqAlarmRecordService") -public class HQAlarmRecordService implements CommService { - @Resource - private HQAlarmRecordDao hqAlarmRecordDao; - @Resource - private RiskLevelService riskLevelService; - @Resource -// private AreaManageDao areaManageDao; - private AreaManageService areaManageService; - @Resource - private UnitService unitService; - @Resource - private AlarmLevesConfigService alarmLevesConfigService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @Override - public HQAlarmRecord selectById(String t) { - // TODO Auto-generated method stub - return hqAlarmRecordDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return hqAlarmRecordDao.deleteByPrimaryKey(t); - } - - @Override - public int save(HQAlarmRecord t) { - // TODO Auto-generated method stub - return hqAlarmRecordDao.insertSelective(t); - } - - @Override - public int update(HQAlarmRecord t) { - // TODO Auto-generated method stub - return hqAlarmRecordDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - HQAlarmRecord hqAlarmRecord = new HQAlarmRecord(); - hqAlarmRecord.setWhere(t); - return hqAlarmRecordDao.selectListByWhere(hqAlarmRecord); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - HQAlarmRecord hqAlarmRecord = new HQAlarmRecord(); - hqAlarmRecord.setWhere(t); - return hqAlarmRecordDao.deleteByWhere(hqAlarmRecord); - } - - /** - * 查询指定条件的ABCD数量 lzh 2021-08-29 - */ - public JSONArray selectABCDListByDate(String wherestr, String dateType, String patrolDateStart, String patrolDateEnd) { - - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 7为年月 4为年 10为年月日 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - List> listYdateArray = new ArrayList<>(); - - JSONObject jsonObjectForAll = new JSONObject();// - - List listXdate = new ArrayList<>(); -// 1、先处理 时间 放进 xdate - int listXdateSize = 0; - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "4"; - int startYear = Integer.parseInt(patrolDateStart.substring(0, 4)); // 2021-01到2021-09 - int endYear = Integer.parseInt(patrolDateEnd.substring(0, 4)); // 2021-10到2021-12 - - for (int i = startYear; i <= endYear; i++) { - listXdate.add("" + i); - } - listXdateSize = listXdate.size(); - jsonObjectForAll.put("xdate", listXdate.toString()); - - } - - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "7"; // patrolDateStart 2019-08-18 到 patrolDateEnd2021-10-01 - - String strStartYear = patrolDateStart.substring(0, 4); - String strEndYear = patrolDateEnd.substring(0, 4); - int startYear = Integer.parseInt(strStartYear); - int endYear = Integer.parseInt(strEndYear); - - String strStartMonth = patrolDateStart.substring(5, 7); - String strEndMonth = patrolDateEnd.substring(5, 7); - int startMonth = Integer.parseInt(strStartMonth); - int endMonth = Integer.parseInt(strEndMonth); - int everystartMonth = 0; - int everyendMonth = 0; - - for (int i = startYear; i <= endYear; i++) { - if (i == startYear && startYear == endYear) { //如果开始和结束选的都是同一年,比如2021-01 到 2021-09 - everystartMonth = startMonth; - everyendMonth = endMonth; - } else if (i == startYear) { - everystartMonth = startMonth; - everyendMonth = 12; - } else if (i == endYear) { - everystartMonth = 1; - everyendMonth = endMonth; - } else { - everystartMonth = 1; - everyendMonth = 12; - } - for (int j = everystartMonth; j <= everyendMonth; j++) { - if (j <= 9) { - listXdate.add("" + i + "-0" + j); - } else { - listXdate.add("" + i + "-" + j); - } - } - } - listXdateSize = listXdate.size(); - jsonObjectForAll.put("xdate", listXdate.toString()); - } - - -// List typeList = this.riskLevelService.selectListByWhere("where 1 = 1"); - ArrayList abcdList = new ArrayList<>(); - abcdList.add("A"); - abcdList.add("B"); - abcdList.add("C"); - abcdList.add("D"); - - jsonObjectForAll.put("abcdName", abcdList); - - -// 2、分别处理A B C D 4个等级的sql 放进 ADate BDate CDate DDate - for (String abcdName : abcdList) { - - wherestr = String.format( - "where l.riskLevel = '%s' " - + "and DateDiff(%s, '%s', r.insdt) >= 0 " - + "and DateDiff(%s, r.insdt, '%s') >= 0 " - + "and r.alarmTypeid = l.id", - abcdName, dateTypeStr, patrolDateStart, dateTypeStr, patrolDateEnd); - - ////////////////////////// lzh /////////////////////////// - List listP = this.hqAlarmRecordDao.selectABCDListByDate(wherestr, str); - - List listYdate = new ArrayList<>(); - for (int i = 0; i < listXdateSize; i++) { - listYdate.add("0"); - } -// listYdate = Arrays.asList(listYdateZero); - if (listP != null && listP.size() > 0) { - for (int i = 0; i < listP.size(); i++) { - for (int j = 0; j < listXdate.size(); j++) { - if (listP.get(i).get_date().equals(listXdate.get(j))) { - String get_num = listP.get(i).get_num() + ""; - listYdate.set(j, get_num); - } - } - - } - } - - listYdateArray.add(listYdate); - } - - jsonObjectForAll.put("listYdateArray", listYdateArray.toString()); - -// 3、返回jsonArray - - jsonObject.put("jsonObjectForAll", jsonObjectForAll);// 各种各样的任务类型 - - jsonArray.add(jsonObject); - return jsonArray; - } - - public JSONArray selectAreaListByDate(String wherestr, String dateType, String patrolDateStart, String patrolDateEnd) { - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 7为年月 4为年 10为年月日 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - List> listYdateArray = new ArrayList<>(); - - JSONObject jsonObjectForAll = new JSONObject();// - - List listXdate = new ArrayList<>(); -// 1、先处理 时间 放进 xdate - int listXdateSize = 0; - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "4"; - int startYear = Integer.parseInt(patrolDateStart.substring(0, 4)); // 2021-01到2021-09 - int endYear = Integer.parseInt(patrolDateEnd.substring(0, 4)); // 2021-10到2021-12 - - for (int i = startYear; i <= endYear; i++) { - listXdate.add("" + i); - } - listXdateSize = listXdate.size(); - jsonObjectForAll.put("xdate", listXdate.toString()); - - } - - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "7"; // patrolDateStart 2019-08-18 到 patrolDateEnd2021-10-01 - - String strStartYear = patrolDateStart.substring(0, 4); - String strEndYear = patrolDateEnd.substring(0, 4); - int startYear = Integer.parseInt(strStartYear); - int endYear = Integer.parseInt(strEndYear); - - String strStartMonth = patrolDateStart.substring(5, 7); - String strEndMonth = patrolDateEnd.substring(5, 7); - int startMonth = Integer.parseInt(strStartMonth); - int endMonth = Integer.parseInt(strEndMonth); - int everystartMonth = 0; - int everyendMonth = 0; - - for (int i = startYear; i <= endYear; i++) { - if (i == startYear && startYear == endYear) { //如果开始和结束选的都是同一年,比如2021-01 到 2021-09 - everystartMonth = startMonth; - everyendMonth = endMonth; - } else if (i == startYear) { - everystartMonth = startMonth; - everyendMonth = 12; - } else if (i == endYear) { - everystartMonth = 1; - everyendMonth = endMonth; - } else { - everystartMonth = 1; - everyendMonth = 12; - } - for (int j = everystartMonth; j <= everyendMonth; j++) { - if (j <= 9) { - listXdate.add("" + i + "-0" + j); - } else { - listXdate.add("" + i + "-" + j); - } - } - } - listXdateSize = listXdate.size(); - jsonObjectForAll.put("xdate", listXdate.toString()); - } - - - List areaManageList = this.areaManageService.selectListByWhere("where pid = '-1'"); - List areaNameList = new ArrayList<>(); - List areaAlarmList = new ArrayList<>(); - for (AreaManage areaManage : areaManageList) { - areaNameList.add(areaManage.getName()); - areaAlarmList.add(areaManage.getFid()); - } - jsonObjectForAll.put("areaName", areaNameList); - -// ArrayList abcdList = new ArrayList<>(); -// abcdList.add("加药区"); -// abcdList.add("预处理上层"); -// abcdList.add("预处理下层"); - - -// 2、分别处理A B C D 4个等级的sql 放进 ADate BDate CDate DDate - for (String areaFid : areaAlarmList) { - - wherestr = String.format( -// "where a.name = '%s' " // + "%'" - "where a.fid = '%s' " - + "and DateDiff(%s, '%s', r.insdt) >= 0 " - + "and DateDiff(%s, r.insdt, '%s') >= 0 " - + "and r.areaid = a.id " - , - areaFid, dateTypeStr, patrolDateStart, dateTypeStr, patrolDateEnd); - - ////////////////////////// lzh /////////////////////////// - List listP = this.hqAlarmRecordDao.selectAreaListByDate(wherestr, str); - - List listYdate = new ArrayList<>(); - for (int i = 0; i < listXdateSize; i++) { - listYdate.add("0"); - } -// listYdate = Arrays.asList(listYdateZero); - if (listP != null && listP.size() > 0) { - for (int i = 0; i < listP.size(); i++) { - for (int j = 0; j < listXdate.size(); j++) { - if (listP.get(i).get_date().equals(listXdate.get(j))) { - String get_num = listP.get(i).get_num() + ""; - listYdate.set(j, get_num); - } - } - - } - } - - listYdateArray.add(listYdate); - } -// System.out.println(listYdateArray); -// [ [2, 0, 3], [0, 1, 3], [2, 1, 2] ] - - jsonObjectForAll.put("listYdateArray", listYdateArray.toString()); - -// 3、返回jsonArray - - jsonObject.put("jsonObjectForAll", jsonObjectForAll);// 各种各样的任务类型 - - jsonArray.add(jsonObject); - return jsonArray; - } - - public List selectAlarmAndRiskLevelByWhere(String where) { - HQAlarmRecord hqAlarmRecord = new HQAlarmRecord(); - hqAlarmRecord.setWhere(where); - return hqAlarmRecordDao.selectAlarmAndRiskLevelByWhere(hqAlarmRecord); - } - - public JSONObject getAnalysisDataLevel(String unitId, String dateType, String patrolDate) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - JSONObject jsonObject_a = new JSONObject(); - JSONObject jsonObject_b = new JSONObject(); - JSONObject jsonObject_c = new JSONObject(); - JSONObject jsonObject_d = new JSONObject(); - JSONObject jsonObject_all = new JSONObject(); - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - - for (int i = 0; i < 12; i++) { - jsonObject_a.put((i + 1) + "月", "0"); - jsonObject_b.put((i + 1) + "月", "0"); - jsonObject_c.put((i + 1) + "月", "0"); - jsonObject_d.put((i + 1) + "月", "0"); - jsonObject_all.put((i + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int i = 0; i < maxDay; i++) { - jsonObject_a.put((i + 1), "0"); - jsonObject_b.put((i + 1), "0"); - jsonObject_c.put((i + 1), "0"); - jsonObject_d.put((i + 1), "0"); - jsonObject_all.put((i + 1), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - - for (int i = 0; i < 24; i++) { - if (i < 9) { - jsonObject_a.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_b.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_c.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_d.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_all.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - } else { - jsonObject_a.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_b.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_c.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_d.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_all.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - } - } - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { -// unitstr += " and unit_id in (" + unitIds + ")"; - } - - //总数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid in ('A','B','C','D') "; - List list_all = this.hqAlarmRecordDao.selectListByNum(wherestr, str); - if (list_all != null && list_all.size() > 0) { - for (int i = 0; i < list_all.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_all.put(Integer.valueOf(list_all.get(i).get_date().substring(5, list_all.get(i).get_date().length())) + "月", list_all.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_all.put(Integer.valueOf(list_all.get(i).get_date().substring(8, list_all.get(i).get_date().length())), list_all.get(i).get_num()); - } else { - jsonObject_all.put(list_all.get(i).get_date(), list_all.get(i).get_num()); - } - } - } - - //A类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'A' "; - List list_a = this.hqAlarmRecordDao.selectListByNum(wherestr, str); - if (list_a != null && list_a.size() > 0) { - for (int i = 0; i < list_a.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_a.put(Integer.valueOf(list_a.get(i).get_date().substring(5, list_a.get(i).get_date().length())) + "月", list_a.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_a.put(Integer.valueOf(list_a.get(i).get_date().substring(8, list_a.get(i).get_date().length())), list_a.get(i).get_num()); - } else { - jsonObject_a.put(list_a.get(i).get_date(), list_a.get(i).get_num()); - } - } - } - - //B类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'B' "; - List list_b = this.hqAlarmRecordDao.selectListByNum(wherestr, str); - if (list_b != null && list_b.size() > 0) { - for (int i = 0; i < list_b.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_b.put(Integer.valueOf(list_b.get(i).get_date().substring(5, list_b.get(i).get_date().length())) + "月", list_b.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_b.put(Integer.valueOf(list_b.get(i).get_date().substring(8, list_b.get(i).get_date().length())), list_b.get(i).get_num()); - } else { - jsonObject_b.put(list_b.get(i).get_date(), list_b.get(i).get_num()); - } - } - } - - //C类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'C' "; - List list_c = this.hqAlarmRecordDao.selectListByNum(wherestr, str); - if (list_c != null && list_c.size() > 0) { - for (int i = 0; i < list_c.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_c.put(Integer.valueOf(list_c.get(i).get_date().substring(5, list_c.get(i).get_date().length())) + "月", list_c.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_c.put(Integer.valueOf(list_c.get(i).get_date().substring(8, list_c.get(i).get_date().length())), list_c.get(i).get_num()); - } else { - jsonObject_c.put(list_c.get(i).get_date(), list_c.get(i).get_num()); - } - } - } - - //D类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'D' "; - List list_d = this.hqAlarmRecordDao.selectListByNum(wherestr, str); - if (list_d != null && list_d.size() > 0) { - for (int i = 0; i < list_d.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_d.put(Integer.valueOf(list_d.get(i).get_date().substring(5, list_d.get(i).get_date().length())) + "月", list_d.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_d.put(Integer.valueOf(list_d.get(i).get_date().substring(8, list_d.get(i).get_date().length())), list_d.get(i).get_num()); - } else { - jsonObject_d.put(list_d.get(i).get_date(), list_d.get(i).get_num()); - } - } - } - - jsonObject.put("jsonObject_a", jsonObject_a); - jsonObject.put("jsonObject_b", jsonObject_b); - jsonObject.put("jsonObject_c", jsonObject_c); - jsonObject.put("jsonObject_d", jsonObject_d); - jsonObject.put("jsonObject_all", jsonObject_all); - - return jsonObject; - } - - public JSONObject getAnalysisDataLevelPie(String unitId, String dateType, String patrolDate) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - JSONObject jsonObject_a = new JSONObject(); - JSONObject jsonObject_b = new JSONObject(); - JSONObject jsonObject_c = new JSONObject(); - JSONObject jsonObject_d = new JSONObject(); - JSONObject jsonObject_all = new JSONObject(); - - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { -// unitstr += " and unit_id in (" + unitIds + ")"; - } - - //总数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid in ('A','B','C','D') "; - HQAlarmRecord hqAlarmRecord = new HQAlarmRecord(); - hqAlarmRecord.setWhere(wherestr); - List list_all = this.hqAlarmRecordDao.selectListByWhere(hqAlarmRecord); - if (list_all != null && list_all.size() > 0) { - jsonObject_all.put("name", "合计"); - jsonObject_all.put("size", list_all.size()); - } - - //A类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'A' "; - hqAlarmRecord.setWhere(wherestr); - List list_a = this.hqAlarmRecordDao.selectListByWhere(hqAlarmRecord); - if (list_a != null && list_a.size() > 0) { - jsonObject_a.put("name", "A"); - jsonObject_a.put("size", list_a.size()); - } - - //B类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'B' "; - hqAlarmRecord.setWhere(wherestr); - List list_b = this.hqAlarmRecordDao.selectListByWhere(hqAlarmRecord); - if (list_b != null && list_b.size() > 0) { - jsonObject_b.put("name", "B"); - jsonObject_b.put("size", list_b.size()); - } - - //C类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'C' "; - hqAlarmRecord.setWhere(wherestr); - List list_c = this.hqAlarmRecordDao.selectListByWhere(hqAlarmRecord); - if (list_c != null && list_c.size() > 0) { - jsonObject_c.put("name", "C"); - jsonObject_c.put("size", list_c.size()); - } - - //D类 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and alarmTypeid = 'D' "; - hqAlarmRecord.setWhere(wherestr); - List list_d = this.hqAlarmRecordDao.selectListByWhere(hqAlarmRecord); - if (list_d != null && list_d.size() > 0) { - jsonObject_d.put("name", "D"); - jsonObject_d.put("size", list_d.size()); - } - - jsonObject.put("jsonObject_a", jsonObject_a); - jsonObject.put("jsonObject_b", jsonObject_b); - jsonObject.put("jsonObject_c", jsonObject_c); - jsonObject.put("jsonObject_d", jsonObject_d); - jsonObject.put("jsonObject_all", jsonObject_all); -// System.out.println(jsonObject); - return jsonObject; - } - - public JSONArray getAnalysisDataArea(String unitId, String dateType, String patrolDate) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - } - - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { -// unitstr += " and unit_id in (" + unitIds + ")"; - } - - //总数 - wherestr = " where DateDiff(" + dateTypeStr + ",ar.insdt,'" + patrolDate + "')=0 " + unitstr + " and am.name is not null "; - List list_all = this.hqAlarmRecordDao.selectListByNumArea(wherestr, str); - //区域分组 - Set set = new HashSet<>(); - if (list_all != null && list_all.size() > 0) { - for (int i = 0; i < list_all.size(); i++) { - if (list_all.get(i).get_areaName1() != null) { - set.add(list_all.get(i).get_areaName1()); - } else { - set.add(list_all.get(i).get_areaName2()); - } - } - } - - Iterator it = set.iterator(); - while (it.hasNext()) { - String name = (String) it.next(); - - /** - * 各区域数量 - 取一级区域名称 - */ - wherestr = " where DateDiff(" + dateTypeStr + ",ar.insdt,'" + patrolDate + "')=0 " + unitstr + " and am.name is not null and ( CASE WHEN amp.name IS NOT NULL THEN amp.name ELSE am.name END ) = '" + name + "' "; - List list_area = this.hqAlarmRecordDao.selectListByNumArea(wherestr, str); - if (list_area != null && list_area.size() > 0) { - com.alibaba.fastjson.JSONArray jsonArray1 = new com.alibaba.fastjson.JSONArray(); - Map map = new LinkedHashMap<>(); - - //先0~31号全部赋值个0 - for (int i = 0; i < list_area.size(); i++) { - if (dateType != null && dateType.equals("year")) { - for (int j = 0; j < 12; j++) { - map.put((j + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int j = 0; j < maxDay; j++) { - map.put(String.valueOf((j + 1)), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - for (int j = 0; j < 24; j++) { - if (i < 9) { - map.put(patrolDate.substring(0, 10) + " 0" + (j + 1), "0"); - } else { - map.put(patrolDate.substring(0, 10) + " " + (j + 1), "0"); - } - } - } - } - - //然后再按真实数据进行赋值 - for (int i = 0; i < list_area.size(); i++) { - if ("year".equals(dateType)) { - map.put(Integer.valueOf(list_area.get(i).get_date().substring(5, list_area.get(i).get_date().length())) + "月", list_area.get(i).get_num() + ""); - } else if ("month".equals(dateType)) { - map.put(String.valueOf(Integer.valueOf(list_area.get(i).get_date().substring(8, list_area.get(i).get_date().length()))), list_area.get(i).get_num() + ""); - } else { - map.put(list_area.get(i).get_date(), list_area.get(i).get_num() + ""); - } - } - - //map转list - Iterator> entries = map.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = entries.next(); - String mapKey = entry.getKey(); - String mapValue = entry.getValue(); - - List list = new ArrayList<>(); - list.add(mapKey); - list.add(mapValue); - jsonArray1.add(list); - } - - //左边Y轴数据 - com.alibaba.fastjson.JSONObject json2 = new com.alibaba.fastjson.JSONObject(); - json2.put("name", name); - json2.put("type", "bar"); - json2.put("stack", "total"); - json2.put("data", jsonArray1); - jsonArray.add(json2); - } - - } - - /** - * 所有区域合计数量 - */ - wherestr = " where DateDiff(" + dateTypeStr + ",ar.insdt,'" + patrolDate + "')=0 " + unitstr + " and am.name is not null "; - List list_area_all = this.hqAlarmRecordDao.selectListByNumArea(wherestr, str); - if (list_area_all != null && list_area_all.size() > 0) { - com.alibaba.fastjson.JSONArray jsonArray1 = new com.alibaba.fastjson.JSONArray(); - Map map_all = new LinkedHashMap<>(); - - //先0~31号全部赋值个0 - for (int i = 0; i < list_area_all.size(); i++) { - if (dateType != null && dateType.equals("year")) { - for (int j = 0; j < 12; j++) { - map_all.put((j + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int j = 0; j < maxDay; j++) { - map_all.put(String.valueOf((j + 1)), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - for (int j = 0; j < 24; j++) { - if (i < 9) { - map_all.put(patrolDate.substring(0, 10) + " 0" + (j + 1), "0"); - } else { - map_all.put(patrolDate.substring(0, 10) + " " + (j + 1), "0"); - } - } - } - } - - //然后再按真实数据进行赋值 - for (int i = 0; i < list_area_all.size(); i++) { - if ("year".equals(dateType)) { - map_all.put(Integer.valueOf(list_area_all.get(i).get_date().substring(5, list_area_all.get(i).get_date().length())) + "月", list_area_all.get(i).get_num() + ""); - } else if ("month".equals(dateType)) { - map_all.put(String.valueOf(Integer.valueOf(list_area_all.get(i).get_date().substring(8, list_area_all.get(i).get_date().length()))), list_area_all.get(i).get_num() + ""); - } else { - map_all.put(list_area_all.get(i).get_date(), list_area_all.get(i).get_num() + ""); - } - } - - //map转list - Iterator> entries = map_all.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = entries.next(); - String mapKey = entry.getKey(); - String mapValue = entry.getValue(); - - List list = new ArrayList<>(); - list.add(mapKey); - list.add(mapValue); - jsonArray1.add(list); - } - - //左边Y轴数据 - com.alibaba.fastjson.JSONObject json2 = new com.alibaba.fastjson.JSONObject(); - json2.put("name", "总数"); - json2.put("type", "line"); -// json2.put("smooth", "true"); - json2.put("data", jsonArray1); - jsonArray.add(json2); - } - -// System.out.println(jsonArray); - return jsonArray; - } - - public com.alibaba.fastjson.JSONArray getAnalysisDataAreaPie(String unitId, String dateType, String patrolDate) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - } - - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { -// unitstr += " and unit_id in (" + unitIds + ")"; - } - - //总数 - wherestr = " where DateDiff(" + dateTypeStr + ",ar.insdt,'" + patrolDate + "')=0 " + unitstr + " and am.name is not null "; - List list_all = this.hqAlarmRecordDao.selectListByNumArea(wherestr, str); - - //区域分组 - Set set = new HashSet<>(); - if (list_all != null && list_all.size() > 0) { - for (int i = 0; i < list_all.size(); i++) { - if (list_all.get(i).get_areaName1() != null) { - set.add(list_all.get(i).get_areaName1()); - } else { - set.add(list_all.get(i).get_areaName2()); - } - } - } - - Iterator it = set.iterator(); - while (it.hasNext()) { - String name = (String) it.next(); - - //取一级区域作为 echart的展示 - wherestr = " where DateDiff(" + dateTypeStr + ",ar.insdt,'" + patrolDate + "')=0 " + unitstr + " and am.name is not null and ( CASE WHEN amp.name IS NOT NULL THEN amp.name ELSE am.name END ) = '" + name + "' "; - List list_area = this.hqAlarmRecordDao.selectListByNumArea(wherestr, str); - - if (list_area != null && list_area.size() > 0) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - double num = list_area.stream().mapToDouble(HQAlarmRecord::get_num).sum(); - jsonObject.put("name", name); - jsonObject.put("value", num); - jsonArray.add(jsonObject); - } - } - return jsonArray; - } - - /** - * 递归获取子节点 - * - * @param - */ - public List getChildren(String pid, List t) { - List t2 = new ArrayList(); - for (int i = 0; i < t.size(); i++) { - if (t.get(i).getPid() != null && t.get(i).getPid().equalsIgnoreCase(pid)) { - if (t.get(i).getType().equals(CommString.UNIT_TYPE_WORKSHOP)) { - t2.add(t.get(i)); - List result = getChildren(t.get(i).getId(), t); - if (result != null) { - t2.addAll(result); - } - } - } - } - return t2; - } - - /** - * 消除报警 - * @param workModel - * @return - */ - public int eliminateAlarm(WorkModel workModel) { - if(workModel.getCameraDetail() == null || workModel.getRiskLevel() == null) { - return 0; - } - List hqAlarmRecords = selectListByWhere("where state = '1' and alarmTypeid = '" + workModel.getRiskLevel().getSafetyinspection() - + "' and riskLevel = '" + workModel.getRiskLevel().getAlarmLevelsConfig().getLevel() + "' and cameraDetailId = '" + workModel.getCameraDetail().getId() + "' order by insdt desc"); - if (hqAlarmRecords != null && hqAlarmRecords.size() > 0) { - HQAlarmRecord hqAlarmRecord = hqAlarmRecords.get(0); - hqAlarmRecord.setState("2"); - hqAlarmRecord.setEliminatedt(CommUtil.nowDate()); - int update = this.update(hqAlarmRecord); - if (update == 1) { - pushMqtt(workModel, CommString.ALARM_BLUE); - } - return update; - } - return 0; - } - - /** - * 新增报警 - */ - public int addAlarm(WorkModel workModel) { - if(workModel.getCameraDetail() == null || workModel.getRiskLevel() == null) { - return 0; - } - String wherestr = " where 1 = 1"; - if (workModel.getRiskLevel() != null) { - wherestr = "where state = '1' and alarmTypeid = '" + workModel.getRiskLevel().getSafetyinspection() - + "' and riskLevel = '" + workModel.getRiskLevel().getAlarmLevelsConfig().getLevel() + "' and cameraDetailId = '" + workModel.getCameraDetail().getId() + "' order by insdt desc"; - } else { - wherestr = "where state = '1' " - + " and cameraDetailId = '" + workModel.getCameraDetail().getId() + "' order by insdt desc"; - } - List hqAlarmRecords = selectListByWhere(wherestr); - if (hqAlarmRecords != null && hqAlarmRecords.size() > 0) { - pushMqtt(workModel, CommString.ALARM_RED); - return 0; - } - HQAlarmRecord hqAlarmRecord = new HQAlarmRecord(); - hqAlarmRecord.setId(CommUtil.getUUID()); - if (workModel.getCameraDetail().getCameraNVR() != null) { - hqAlarmRecord.setAreaid(workModel.getCameraDetail().getCameraNVR().getAreaManage().getId()); - hqAlarmRecord.setAreaName(workModel.getCameraDetail().getCameraNVR().getAreaManage().getName()); - } - hqAlarmRecord.setInsdt(CommUtil.nowDate()); - hqAlarmRecord.setName(workModel.getRiskLevel().getSecuritycontent() + "(" + workModel.getCameraDetail().getCamera().getName() + ")"); - hqAlarmRecord.setRiskLevel(workModel.getRiskLevel().getAlarmLevelsConfig().getLevel()); - hqAlarmRecord.setState("1"); - hqAlarmRecord.setAlarmtypeid(workModel.getRiskLevel().getSafetyinspection()); - hqAlarmRecord.setCameraDetailId(workModel.getCameraDetail().getId()); - hqAlarmRecord.setTargetid(workModel.getCameraDetail().getCamera().getId()); - hqAlarmRecord.setCameraid(workModel.getCameraDetail().getCamera().getId()); - hqAlarmRecord.setUnitId(workModel.getCameraDetail().getCamera().getBizid()); - int save = this.save(hqAlarmRecord); - if (save == 1) { - pushMqtt(workModel, CommString.ALARM_RED); - } - return save; - } - /** - * 新增报警 - */ - public int addAlarm(WorkModel workModel,String insdt) { - if(workModel.getCameraDetail() == null || workModel.getRiskLevel() == null) { - return 0; - } - String wherestr = " where 1 = 1"; - if (workModel.getRiskLevel() != null) { - wherestr = "where state = '1' and alarmTypeid = '" + workModel.getRiskLevel().getSafetyinspection() - + "' and riskLevel = '" + workModel.getRiskLevel().getAlarmLevelsConfig().getLevel() + "' and cameraDetailId = '" + workModel.getCameraDetail().getId() + "' order by insdt desc"; - } else { - wherestr = "where state = '1' " - + " and cameraDetailId = '" + workModel.getCameraDetail().getId() + "' order by insdt desc"; - } - List hqAlarmRecords = selectListByWhere(wherestr); - if (hqAlarmRecords != null && hqAlarmRecords.size() > 0) { - return 0; - } - HQAlarmRecord hqAlarmRecord = new HQAlarmRecord(); - hqAlarmRecord.setId(CommUtil.getUUID()); - if (workModel.getCameraDetail().getCameraNVR() != null) { - hqAlarmRecord.setAreaid(workModel.getCameraDetail().getCameraNVR().getAreaManage().getId()); - hqAlarmRecord.setAreaName(workModel.getCameraDetail().getCameraNVR().getAreaManage().getName()); - } - hqAlarmRecord.setInsdt(insdt); - hqAlarmRecord.setName(workModel.getRiskLevel().getSecuritycontent() + "(" + workModel.getCameraDetail().getCamera().getName() + ")"); - hqAlarmRecord.setRiskLevel(workModel.getRiskLevel().getAlarmLevelsConfig().getLevel()); - hqAlarmRecord.setState("1"); - hqAlarmRecord.setAlarmtypeid(workModel.getRiskLevel().getSafetyinspection()); - hqAlarmRecord.setCameraDetailId(workModel.getCameraDetail().getId()); - hqAlarmRecord.setTargetid(workModel.getCameraDetail().getCamera().getId()); - hqAlarmRecord.setCameraid(workModel.getCameraDetail().getCamera().getId()); - hqAlarmRecord.setUnitId(workModel.getCameraDetail().getCamera().getBizid()); - int save = this.save(hqAlarmRecord); - if (save == 1) { - pushMqtt(workModel, CommString.ALARM_RED); - } - return save; - } - /** - * 计算安全评分方法 - */ - public int secureScoreSS() { - //报警状态筛选 - String wherestr = " where state = '1' order by insdt desc"; - List list = this.selectListByWhere(wherestr); - int score = 100; - if(list!=null && list.size()>0){ - for(HQAlarmRecord alarmRecord: list){ - List levels = this.alarmLevesConfigService.selectListByWhere("where level='"+alarmRecord.getRiskLevel()+"' order by level"); - if(levels!=null && levels.size()>0 && levels.get(0).getFraction()!=null){ - score = score-levels.get(0).getFraction(); - } - } - } - if(score<0){ - score=0; - } - return score; - } - /** - * 计算安全评分方法 - */ - public void secureScore() { - //报警状态筛选 - String wherestr = " where state = '1' order by insdt desc"; - List list = this.selectListByWhere(wherestr); - int score = 100; - if(list!=null && list.size()>0){ - for(HQAlarmRecord alarmRecord: list){ - List levels = this.alarmLevesConfigService.selectListByWhere("where level='"+alarmRecord.getRiskLevel()+"' order by level"); - if(levels!=null && levels.size()>0 && levels.get(0).getFraction()!=null){ - score = score-levels.get(0).getFraction(); - } - } - } - if(score<0){ - score=0; - } - String unitId = "021HQWS"; - MPoint mPointEntity = mPointService.selectById(unitId, "HQWS_Secure_Score"); - if(mPointEntity!=null) { - BigDecimal parmvalue = new BigDecimal(score); - String measuredt = CommUtil.nowDate().substring(0,13)+":00:00"; - mPointEntity.setParmvalue(parmvalue); - mPointEntity.setMeasuredt(measuredt); - int res = mPointService.update2(unitId, mPointEntity); - if (res > 0) { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(parmvalue); - mPointHistory.setMeasuredt(measuredt); - mPointHistory.setTbName("TB_MP_" + mPointEntity.getMpointcode()); - - List mPointHistoryList = mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", - "TB_MP_" + mPointEntity.getMpointcode(), "where MeasureDT = '" + measuredt + "' order by MeasureDT desc"); - if (mPointHistoryList != null && mPointHistoryList.size() > 0) { - res = mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - } else { - res = mPointHistoryService.save(unitId, mPointHistory); - } - } - } - } - public void pushMqtt(WorkModel workModel, int type) { -// if (type == 1) { -// Integer integer = CommString.typeMap.get(workModel.getCameraDetail().getCamera().getId()); -// } - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - try { - jsonObject.put("cameraid", workModel.getCameraDetail().getCamera().getId()); - jsonObject.put("type", type); - // 将模型 及 对应报警set进入集合 - String cameraId = workModel.getCameraDetail().getCamera().getId(); - HashMap modelTypeMap; - if (CommString.typeMap.get(cameraId) == null) { - modelTypeMap = new HashMap<>(); - } else { - modelTypeMap = CommString.typeMap.get(cameraId); - } - modelTypeMap.put(workModel.getModelName(), type); - CommString.typeMap.put(workModel.getCameraDetail().getCamera().getId(), modelTypeMap); - String areaId = ""; - if (!"-1".equals(workModel.getCameraDetail().getCameraNVR().getAreaManage().getPid())) { - areaId = workModel.getCameraDetail().getCameraNVR().getAreaManage().getPid(); - } else { - areaId = workModel.getCameraDetail().getCameraNVR().getAreaManage().getId(); - } - if (type == CommString.ALARM_RED) { - MqttUtil.publish(jsonObject, "dataVisualData_cameraAlarm_" + areaId); - } else { - String types = "x"; - for (String key : modelTypeMap.keySet()) { - types += modelTypeMap.get(key); - } - if (types.contains(String.valueOf(CommString.ALARM_RED))) { - jsonObject.put("type", CommString.ALARM_RED); - MqttUtil.publish(jsonObject, "dataVisualData_cameraAlarm_" + areaId); - } else if (types.contains(String.valueOf(CommString.ALARM_YELLOW))) { - jsonObject.put("type", CommString.ALARM_YELLOW); - MqttUtil.publish(jsonObject, "dataVisualData_cameraAlarm_" + areaId); - } else { - jsonObject.put("type", CommString.ALARM_BLUE); - MqttUtil.publish(jsonObject, "dataVisualData_cameraAlarm_" + areaId); - } - } - - } catch (Exception e) { - System.out.println("摄像头变色推送失败: 请检查是否配置区域"); - } - } -} diff --git a/src/com/sipai/service/hqconfig/PositionsCasualService.java b/src/com/sipai/service/hqconfig/PositionsCasualService.java deleted file mode 100644 index 8e51364e..00000000 --- a/src/com/sipai/service/hqconfig/PositionsCasualService.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.sipai.service.hqconfig; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.hqconfig.PositionsCasualDao; -import com.sipai.entity.hqconfig.PositionsCasual; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserOutsiders; -import com.sipai.service.user.UserOutsidersService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -@Service("positionsCasualService") -public class PositionsCasualService implements CommService { - @Resource - private PositionsCasualDao positionsCasualDao; - @Resource - UserService userService; - @Resource - UserOutsidersService userOutsidersService; - - @Override - public PositionsCasual selectById(String t) { - // TODO Auto-generated method stub - return positionsCasualDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return positionsCasualDao.deleteByPrimaryKey(t); - } - - @Override - public int save(PositionsCasual t) { - // TODO Auto-generated method stub - return positionsCasualDao.insertSelective(t); - } - - @Override - public int update(PositionsCasual t) { - // TODO Auto-generated method stub - return positionsCasualDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - PositionsCasual positionsCasual = new PositionsCasual(); - positionsCasual.setWhere(t); - return positionsCasualDao.selectListByWhere(positionsCasual); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - PositionsCasual positionsCasual = new PositionsCasual(); - positionsCasual.setWhere(t); - return positionsCasualDao.deleteByWhere(positionsCasual); - } - - /** - * 获取总人数 - * @return - */ - public JSONObject getUserNumber() { - JSONObject result = new JSONObject(); - List list = this.selectListByWhere("order by insdt"); - String userCards=""; - String userCards_out=""; - String userCards_bus=""; - List userList= userService.selectListByWhere2("where cardid is not null and cardid !='' order by insdt"); - if(userList!=null && userList.size()>0){ - for(User user:userList){ - userCards += user.getCardid()+","; - } - userCards=userCards.replace(",","','"); - } - List userOutsiders_out= userOutsidersService.selectListByWhere("where cardid is not null and cardid !='' and pid='1' order by insdt"); - if(userOutsiders_out!=null && userOutsiders_out.size()>0){ - for(UserOutsiders userOutsiders:userOutsiders_out){ - userCards_out += userOutsiders.getCardid()+","; - } - userCards_out=userCards_out.replace(",","','"); - } - List userOutsiders_bus= userOutsidersService.selectListByWhere("where cardid is not null and cardid !='' and pid='2' order by insdt"); - if(userOutsiders_bus!=null && userOutsiders_bus.size()>0){ - for(UserOutsiders userOutsiders:userOutsiders_bus){ - userCards_bus += userOutsiders.getCardid()+","; - } - userCards_bus=userCards_bus.replace(",","','"); - } - - List list0_in = this.selectListByWhere("where floor='-1' and cardid in ('"+userCards+"') order by insdt"); - List list0_out = this.selectListByWhere("where floor='-1' and cardid in ('"+userCards_out+"') order by insdt"); - List list0_bus = this.selectListByWhere("where floor='-1' and cardid in ('"+userCards_bus+"') order by insdt"); - List list1_in = this.selectListByWhere("where floor='1' and cardid in ('"+userCards+"') order by insdt"); - List list1_out = this.selectListByWhere("where floor='1' and cardid in ('"+userCards_out+"') order by insdt"); - List list1_bus = this.selectListByWhere("where floor='1' and cardid in ('"+userCards_bus+"') order by insdt"); - result.put("minusOne_insider",list0_in.size()); - result.put("minusOne_visitor",list0_out.size()); - result.put("minusOne_contractor",list0_bus.size()); - result.put("one_insider",list1_in.size()); - result.put("one_visitor",list1_out.size()); - result.put("one_contractor",list1_bus.size()); - return result; - } - /** - * 获取区域内人数 - * @param positionsCam 指定区域坐标 - * @return - */ - public int getUserNumber(String positionsCam) { - //一层 - double left_v_1 = 642.0/276.0; - double top_v_1 = 667.0/283.0; - //负一层 - double left_v_0 = 637.0/272.0; - double top_v_0 = 814.0/346.0; - - double v = 0.444; - int userNumber = 0; - List poly = new ArrayList(); - String[] positions = positionsCam.split(";"); - if(positions!=null && positions.length>0){ - /*for(int i=0;i list = this.selectListByWhere("order by insdt"); - for(PositionsCasual positionsCasual:list){ - System.out.println("insdt-----------"+ positionsCasual.getInsdt()); - String floor = positionsCasual.getFloor(); - String x = positionsCasual.getX(); - String y = positionsCasual.getY(); - double top = 0; - double left = 0; - //转化坐标 - if("1".equals(floor)){ - top = Double.parseDouble(x)*top_v_1; - left = Double.parseDouble(y)*left_v_1; - }else - if("-1".equals(floor)){ - top = Double.parseDouble(x)*top_v_0; - left = Double.parseDouble(y)*left_v_0; - }else{ - top = Double.parseDouble(x)*v; - left = Double.parseDouble(y)*v; - } - double[] p= {left,top}; - System.out.println("x,y-----------"+ left+","+top); - //boolean rayCasting = CommUtil.rayCasting(p,poly); - boolean rayCasting = CommUtil.rayCasting2(positions,p); - if(rayCasting){ - userNumber ++; - } - } - } - return userNumber; - } -} diff --git a/src/com/sipai/service/hqconfig/RiskLevelService.java b/src/com/sipai/service/hqconfig/RiskLevelService.java deleted file mode 100644 index 5adb6371..00000000 --- a/src/com/sipai/service/hqconfig/RiskLevelService.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.service.hqconfig; - -import com.sipai.dao.hqconfig.RiskLevelDao; -import com.sipai.entity.hqconfig.RiskLevel; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.service.alarm.AlarmLevesConfigService; -import com.sipai.service.work.AlarmTypesService; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class RiskLevelService implements CommService { - @Resource - private RiskLevelDao riskLevelDao; - - @Resource - private AlarmLevesConfigService alarmLevesConfigService; - - @Resource - private AlarmTypesService alarmTypesService; - - @Override - public RiskLevel selectById(String t) { - RiskLevel riskLevel = riskLevelDao.selectByPrimaryKey(t); - if(riskLevel != null) { - riskLevel.setAlarmLevelsConfig(alarmLevesConfigService.selectById(riskLevel.getRisklevel())); - if (StringUtils.isNotBlank(riskLevel.getSafetyinspection())) { - AlarmTypes alarmTypes = alarmTypesService.selectById(riskLevel.getSafetyinspection()); - if (alarmTypes != null) { - riskLevel.setSafetyinspectionname(alarmTypes.getpName()); - } - } - } - // TODO Auto-generated method stub - return riskLevel; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return riskLevelDao.deleteByPrimaryKey(t); - } - - @Override - public int save(RiskLevel t) { - // TODO Auto-generated method stub - return riskLevelDao.insertSelective(t); - } - - @Override - public int update(RiskLevel t) { - // TODO Auto-generated method stub - return riskLevelDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - RiskLevel riskLevel = new RiskLevel(); - riskLevel.setWhere(t); - List riskLevels = riskLevelDao.selectListByWhere(riskLevel); - for (RiskLevel r : riskLevels) { - if (StringUtils.isNotBlank(r.getRisklevel())) { - r.setAlarmLevelsConfig(alarmLevesConfigService.selectById(r.getRisklevel())); - } - if (StringUtils.isNotBlank(r.getSafetyinspection())) { - AlarmTypes alarmTypes = alarmTypesService.selectById(r.getSafetyinspection()); - if (alarmTypes != null) { - r.setSafetyinspectionname(alarmTypes.getpName()); - } -// if (alarmTypes != null) { -// r.setSafetyinspectionname(alarmTypes.getName()); -// if (StringUtils.isNotBlank(alarmTypes.getPid())) { -// AlarmTypes alarmTypesf = alarmTypesService.selectById(alarmTypes.getPid()); -// -// } -// } - } - } - return riskLevels; - } - - @Override - public int deleteByWhere(String t) { - RiskLevel riskLevel = new RiskLevel(); - riskLevel.setWhere(t); - return riskLevelDao.deleteByWhere(riskLevel); - } -} diff --git a/src/com/sipai/service/hqconfig/WorkModelService.java b/src/com/sipai/service/hqconfig/WorkModelService.java deleted file mode 100644 index 5f17fead..00000000 --- a/src/com/sipai/service/hqconfig/WorkModelService.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.service.hqconfig; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.work.CameraDetail; -import com.sipai.service.work.CameraDetailService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import com.sipai.dao.hqconfig.WorkModelDao; -import com.sipai.entity.hqconfig.WorkModel; -import com.sipai.tools.CommService; - -@Service -public class WorkModelService implements CommService{ - @Resource - private WorkModelDao workModelDao; - @Resource - private RiskLevelService riskLevelService; - @Resource - private CameraDetailService cameraDetailService; - - @Override - public WorkModel selectById(String t) { - // TODO Auto-generated method stub - return workModelDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return workModelDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WorkModel t) { - // TODO Auto-generated method stub - return workModelDao.insertSelective(t); - } - - @Override - public int update(WorkModel t) { - // TODO Auto-generated method stub - return workModelDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - WorkModel workModel = new WorkModel(); - workModel.setWhere(t); - List workModels = workModelDao.selectListByWhere(workModel); - for (int i = 0; i < workModels.size(); i++) { - if (StringUtils.isNotBlank(workModels.get(i).getRiskLevelId())) { - workModels.get(i).setRiskLevel(riskLevelService.selectById(workModels.get(i).getRiskLevelId())); - } - } - return workModels; - } - - @Override - public int deleteByWhere(String t) { - WorkModel workModel = new WorkModel(); - workModel.setWhere(t); - return workModelDao.deleteByWhere(workModel); - } - - public WorkModel selectModelAndCameraByWhere(String where, String id) { - List workModels = this.selectListByWhere(where); - if (workModels != null && workModels.size() > 0) { - WorkModel workModel = workModels.get(0); - // 风险分级 - workModel.setRiskLevel(riskLevelService.selectById(workModel.getRiskLevelId())); - // 摄像头关联nvr及模型配置及点位信息 - workModel.setCameraDetail(cameraDetailService.selectByCameraId(workModel.getId(), id)); - return workModels.get(0); - } - return null; - } - - // 查出所有绑定摄像头的行车模型 - public WorkModel selectModelAndCameraListByWhere(String where) { - List workModels = this.selectListByWhere(where); - if (workModels != null && workModels.size() > 0) { - WorkModel workModel = workModels.get(0); - // 风险分级 - workModel.setRiskLevel(riskLevelService.selectById(workModel.getRiskLevelId())); - // 摄像头关联nvr及模型配置及点位信息 - List cameraDetails = cameraDetailService.selectListByWhere("where algorithmid = '" + workModel.getId() + "'"); - workModel.setCameraDetailList(cameraDetails); - return workModel; - } - return null; - } -} diff --git a/src/com/sipai/service/info/InfoRecvService.java b/src/com/sipai/service/info/InfoRecvService.java deleted file mode 100644 index c5a314a5..00000000 --- a/src/com/sipai/service/info/InfoRecvService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.info; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.info.InfoRecvDao; -import com.sipai.entity.info.InfoRecv; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -@Service -public class InfoRecvService implements CommService{ - - @Resource - private InfoRecvDao infoRecvDao; - @Resource - private UnitService unitService; - @Override - public InfoRecv selectById(String id) { - return infoRecvDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return infoRecvDao.deleteByPrimaryKey(id); - } - - @Override - public int save(InfoRecv entity) { - int res =0; - - return infoRecvDao.insert(entity); - } - - @Override - public int update(InfoRecv entity) { - - return infoRecvDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - InfoRecv infoRecv = new InfoRecv(); - infoRecv.setWhere(wherestr); - return infoRecvDao.selectListByWhere(infoRecv); - } - - @Override - public int deleteByWhere(String wherestr) { - InfoRecv infoRecv = new InfoRecv(); - infoRecv.setWhere(wherestr); - return infoRecvDao.deleteByWhere(infoRecv); - } - - -} diff --git a/src/com/sipai/service/info/InfoService.java b/src/com/sipai/service/info/InfoService.java deleted file mode 100644 index db0a87e4..00000000 --- a/src/com/sipai/service/info/InfoService.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.service.info; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.info.InfoDao; -import com.sipai.entity.info.Info; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class InfoService implements CommService{ - - @Resource - private InfoDao infoDao; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private MsgServiceImpl msgService; - private final String MsgType_INFO ="INFO"; - private final String InfoType_System ="system"; - - @Override - public Info selectById(String id) { - Info info = infoDao.selectByPrimaryKey(id); - if (info != null && info.getInsuser() != null) { - User user = userService.getUserById(info.getInsuser()); - info.setUserInsuser(user); - } - return info; - } - - @Override - public int deleteById(String id) { - return infoDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Info entity) { - int res =0; - - return infoDao.insert(entity); - } - - @Override - public int update(Info entity) { - - return infoDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Info info = new Info(); - info.setWhere(wherestr); - List infoList = infoDao.selectListByWhere(info); - for (Info entity : infoList){ - User user = userService.getUserById(entity.getInsuser()); - entity.setUserInsuser(user); - } - return infoList; - } - - @Override - public int deleteByWhere(String wherestr) { - Info info = new Info(); - info.setWhere(wherestr); - return infoDao.deleteByWhere(info); - } - - public List selectListWithRecvByWhere(String wherestr) { - Info info = new Info(); - info.setWhere(wherestr); - return infoDao.selectListWithRecvByWhere(info); - } - - public List selectListTopByWhere(String wherestr) { - Info info = new Info(); - info.setWhere(wherestr); - return infoDao.selectListTopByWhere(info); - } - - public Map sendMessage(Info info,String content) { - Map ret = new HashMap(); - String result=""; - String recvid=""; - if(InfoType_System.equals(info.getTypeid())){ - List userlist = userService.selectList(); - for(int i=0;i userlist = userService.getUserListByPid(recvidarr[i]); - for(int j=0;j selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public void saveAsync(LogInfo entity); - -} \ No newline at end of file diff --git a/src/com/sipai/service/info/impl/LogInfoServiceImpl.java b/src/com/sipai/service/info/impl/LogInfoServiceImpl.java deleted file mode 100644 index 03b01186..00000000 --- a/src/com/sipai/service/info/impl/LogInfoServiceImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.service.info.impl; - -import com.sipai.dao.info.LogInfoDao; -import com.sipai.entity.info.LogInfo; -import com.sipai.service.info.LogInfoService; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("logInfoService") -public class LogInfoServiceImpl implements LogInfoService{ - - @Resource - private LogInfoDao logInfoDao; - - - public LogInfo selectById(String id) { - return logInfoDao.selectByPrimaryKey(id); - } - - - - public int deleteById(String id) { - return logInfoDao.deleteByPrimaryKey(id); - } - - - - - public int save(LogInfo entity) { - int res =0; - - return logInfoDao.insert(entity); - } - /** - * 异步执行 - */ - @Async("my_info_executor") - public void saveAsync(LogInfo entity) { - - this.save(entity); - } - - - - - public int update(LogInfo entity) { - - return logInfoDao.updateByPrimaryKeySelective(entity); - } - - - - - - public List selectListByWhere(String wherestr) { - LogInfo info = new LogInfo(); - info.setWhere(wherestr); - return logInfoDao.selectListByWhere(info); - } - - - - - public int deleteByWhere(String wherestr) { - LogInfo info = new LogInfo(); - info.setWhere(wherestr); - return logInfoDao.deleteByWhere(info); - } - - - - - - - - - - - - -} diff --git a/src/com/sipai/service/jsyw/JsywCompanyService.java b/src/com/sipai/service/jsyw/JsywCompanyService.java deleted file mode 100644 index c6557597..00000000 --- a/src/com/sipai/service/jsyw/JsywCompanyService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.jsyw; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.jsyw.JsywCompanyDao; -import com.sipai.entity.jsyw.JsywCompany; -import com.sipai.tools.CommService; - -@Service -public class JsywCompanyService implements CommService { - @Resource - private JsywCompanyDao jsywCompanyDao; - - @Override - public JsywCompany selectById(String id) { - JsywCompany jsywCompany = jsywCompanyDao.selectByPrimaryKey(id); - return jsywCompany; - } - - @Override - public int deleteById(String id) { - return jsywCompanyDao.deleteByPrimaryKey(id); - } - - @Override - public int save(JsywCompany jsywCompany) { - return jsywCompanyDao.insert(jsywCompany); - } - - @Override - public int update(JsywCompany jsywCompany) { - return jsywCompanyDao.updateByPrimaryKeySelective(jsywCompany); - } - - @Override - public List selectListByWhere(String wherestr) { - JsywCompany jsywCompany = new JsywCompany(); - jsywCompany.setWhere(wherestr); - List list = jsywCompanyDao.selectListByWhere(jsywCompany); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - JsywCompany jsywCompany = new JsywCompany(); - jsywCompany.setWhere(wherestr); - return jsywCompanyDao.deleteByWhere(jsywCompany); - } -} diff --git a/src/com/sipai/service/jsyw/JsywPointService.java b/src/com/sipai/service/jsyw/JsywPointService.java deleted file mode 100644 index e421eb11..00000000 --- a/src/com/sipai/service/jsyw/JsywPointService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.jsyw; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.jsyw.JsywPointDao; -import com.sipai.entity.jsyw.JsywPoint; -import com.sipai.tools.CommService; - -@Service -public class JsywPointService implements CommService { - @Resource - private JsywPointDao jsywPointDao; - - @Override - public JsywPoint selectById(String id) { - JsywPoint jsywPoint = jsywPointDao.selectByPrimaryKey(id); - return jsywPoint; - } - - @Override - public int deleteById(String id) { - return jsywPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(JsywPoint jsywPoint) { - return jsywPointDao.insert(jsywPoint); - } - - @Override - public int update(JsywPoint jsywPoint) { - return jsywPointDao.updateByPrimaryKeySelective(jsywPoint); - } - - @Override - public List selectListByWhere(String wherestr) { - JsywPoint jsywPoint = new JsywPoint(); - jsywPoint.setWhere(wherestr); - List list = jsywPointDao.selectListByWhere(jsywPoint); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - JsywPoint jsywPoint = new JsywPoint(); - jsywPoint.setWhere(wherestr); - return jsywPointDao.deleteByWhere(jsywPoint); - } -} diff --git a/src/com/sipai/service/kpi/KpiApplyBizService.java b/src/com/sipai/service/kpi/KpiApplyBizService.java deleted file mode 100644 index 4943e9c1..00000000 --- a/src/com/sipai/service/kpi/KpiApplyBizService.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiApplyBizDao; -import com.sipai.dao.kpi.KpiPlanStaffDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.kpi.*; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.DateUtil; -import org.activiti.engine.impl.task.TaskDefinition; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.runtime.ProcessInstanceQuery; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.*; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2022/7/7 - **/ -@Service -public class KpiApplyBizService implements CommService { - @Resource - private KpiApplyBizDao kpiApplyBizDao; - @Resource - private MsgServiceImpl msgService; - @Resource - private KpiPlanStaffDao kpiPlanStaffDao; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiWorkflowService kpiWorkflowService; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - - @Resource - private KpiIndicatorLibService kpiIndicatorLibService; - - @Resource - private UserService userService; - @Resource - private JobService jobService; - - @Override - public KpiApplyBiz selectById(String t) { - return kpiApplyBizDao.selectByPrimaryKey(t); - } - - public KpiApplyBizBo selectBoById(String t) { - KpiApplyBiz po = selectById(t); - KpiPeriodInstance instance = kpiPeriodInstanceService.selectById(po.getPeriodInstanceId()); - KpiApplyBizBo bo = new KpiApplyBizBo(); - BeanUtils.copyProperties(po, bo); - bo.setPeriodInstance(instance); - return bo; - } - - @Override - public int deleteById(String t) { - return 0; - } - - @Override - public int save(KpiApplyBiz kpiApplyBiz) { - - return kpiApplyBizDao.insert(kpiApplyBiz); - } - - @Override - public int update(KpiApplyBiz kpiApplyBiz) { - return 0; - } - - @Override - public List selectListByWhere(String t) { - KpiApplyBiz kpiApplyBiz = new KpiApplyBiz(); - kpiApplyBiz.setWhere(t); - return kpiApplyBizDao.selectListByWhere(kpiApplyBiz); - } - - @Override - public int deleteByWhere(String t) { - KpiApplyBiz entity = new KpiApplyBiz(); - entity.setWhere(t); - return kpiApplyBizDao.deleteByWhere(entity); - } - - /** - * 计划审批流程启动 - * - * @Author: lichen - * @Date: 2022/7/8 - **/ - @Transactional(rollbackFor = Exception.class) - public Result startProcess(KpiActivitiRequest applyRequest, User loginUser) { - - try { - kpiPlanStaffDetailService.checkEveryStaffTotalWeight(applyRequest.getBizId()); - } catch (Exception ex) { - return Result.failed(ex.getMessage()); - } - - //根据业务id获取子计划信息 - KpiApplyBizBo applyBiz = selectBoById(applyRequest.getBizId()); - - - if (KpiApplyStatusEnum.PlanMaking.getId() != applyBiz.getStatus() - && KpiApplyStatusEnum.PlanReject.getId() != applyBiz.getStatus()) { - return Result.failed("该记录已处于审核状态。"); - } - - // 判断有无流程定义,如果没有,则启动失败。 - // 流程定义的id - String processKey = ProcessType.KPI_MAKE_PLAN.getId() + "-" + applyRequest.getUnitId(); - List processDefinitions = - workflowProcessDefinitionService.getProcessDefsBykey(processKey); - if (processDefinitions == null || processDefinitions.size() == 0) { - return Result.failed("缺少该流程定义。"); - } - // 启动流程实例 - // 设置网关条件 - Map map = new HashMap<>(); - //通过 - map.put(CommString.ACTI_KEK_Condition, 1); - //根据岗位类型设定路由 - map.put("jobLevelType", applyBiz.getPeriodInstance().getJobType()); - map.put(CommString.ACTI_KEK_Assignee, loginUser.getId()); - map.put(CommString.ACTI_KEK_Candidate_Users, loginUser.getId()); - - // 启动流程 - ProcessInstance processInstance = workflowService.startWorkflow( - // 业务主键 - applyRequest.getBizId(), - // 申请者id - loginUser.getId(), - // 流程Key - processDefinitions.get(0).getKey(), - // 流程变量 - map); - // 判断实例是否启动成功 - if (processInstance == null) { - return Result.failed("流程实例创建失败。"); - } - - // 获取当前任务 - Task task = - workflowService.getTaskService().createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); - // 指定当前任务的执行人 ,并完成申请 -// task.setAssignee(loginUser.getId()); -// workflowService.getTaskService().saveTask(task); - Map map2 = processInstance.getProcessVariables(); - map2.put(CommString.ACTI_KEK_Assignee, applyRequest.getAuditorId()); - map2.put(CommString.ACTI_KEK_Candidate_Users, applyRequest.getAuditorId()); - workflowService.getTaskService().complete(task.getId(), map2); - - - // 更新业务数据状态 - applyBiz.setStatus(KpiApplyStatusEnum.PlanAuditing.getId()); - applyBiz.setUpdateTime(DateUtil.toStr(null, new Date())); - applyBiz.setUnitId(applyRequest.getUnitId()); - - kpiApplyBizDao.updateByPrimaryKeySelective(applyBiz); - kpiPlanStaffDao.updateStatusByApplyBizId(applyBiz); - return Result.success(); - } - - /** - * 提交审核 - * - * @return - * @author lichen - * @date 2021/10/19 13:34 - **/ - @Transactional(rollbackFor = Exception.class) - public Result audit(KpiActivitiRequest applyRequest, User cu) throws Exception { - //1.获取task - Task curenntTask = workflowService.getTaskService().createTaskQuery().taskId(applyRequest.getTaskId()).singleResult(); - //2.设置批注 - if (applyRequest.getAuditComment() == null) { - applyRequest.setAuditComment(" "); - } - workflowService.getTaskService().addComment(curenntTask.getId(), curenntTask.getProcessInstanceId(), applyRequest.getAuditComment()); - // 3.判断后续还有没有审批人节点 - TaskDefinition taskDefinition = kpiWorkflowService.getNextTaskInfo(curenntTask.getId()); - String now = DateUtil.toStr(null, new Date()); - KpiApplyBizBo kpiApplyBizBo = selectBoById(applyRequest.getBizId()); - kpiApplyBizBo.setAuditors(auditsUpdate(cu.getId(), kpiApplyBizBo)); - //4.判断审核结果决定走向 - if ("0".equals(applyRequest.getPass())) { - //驳回 - Map map = new HashMap<>(); - map.put("pass", "0"); - - workflowService.getTaskService().complete(curenntTask.getId(), map); - - kpiApplyBizBo.setRejectionComment(cu.getCaption() + ":" + applyRequest.getAuditComment()); - kpiApplyBizBo.setStatus(KpiApplyStatusEnum.PlanReject.getId()); - kpiApplyBizBo.setUpdateTime(now); - kpiPlanStaffDao.updateStatusByApplyBizId(kpiApplyBizBo); - // 给编制者发送消息 - msgService.insertMsgSend(KpiConstant.MSG_TYPE_KPI, - cu.getCaption() + "于" + now + ",驳回了【" + kpiApplyBizBo.getPeriodInstance().getPeriodName() - + "】考核计划。驳回意见是:\"" - + applyRequest.getAuditComment() + "\"", - kpiApplyBizBo.getCreateUserId(), - cu.getId(), "U"); - - } else { - - if (taskDefinition != null) { - //有,则获取当前任务并设置审批人(即设置后续的审批人) - ProcessInstanceQuery processInstanceQuery = workflowService.getRuntimeService().createProcessInstanceQuery().processInstanceId(curenntTask.getProcessInstanceId()); - Map map2 = processInstanceQuery.singleResult().getProcessVariables(); - map2.put(CommString.ACTI_KEK_Assignee, applyRequest.getAuditorId()); - map2.put(CommString.ACTI_KEK_Candidate_Users, applyRequest.getAuditorId()); - //通过 - workflowService.getTaskService().complete(curenntTask.getId(), map2); - - } else { - //通过 - workflowService.getTaskService().complete(curenntTask.getId()); - // 没有,则 - KpiPeriodInstance instance = kpiPeriodInstanceService.selectById(kpiApplyBizBo.getPeriodInstanceId()); - List kpiPlanStaffs = kpiPlanStaffService.selectPageListByCreateUserIdAndApplyBizId(kpiApplyBizBo.getCreateUserId(), kpiApplyBizBo.getId()); - // 因为加了绩效考核负责人的角色,所以此处直接下发。 - kpiApplyBizBo.setStatus(KpiApplyStatusEnum.PlanAccessed.getId()); - kpiApplyBizBo.setUpdateTime(now); - - kpiPlanStaffDao.updateStatusByApplyBizId(kpiApplyBizBo); - - // 给直接上级 - msgService.insertMsgSend(KpiConstant.MSG_TYPE_KPI, - "【" + instance.getPeriodName() + "】的绩效考核内容审核通过,可以在计划编制菜单进行评分了。", - kpiApplyBizBo.getCreateUserId(), - cu.getId(), "U"); - for (KpiPlanStaff staff : kpiPlanStaffs) { - // 通知给所有的被考核对象 - msgService.insertMsgSend(KpiConstant.MSG_TYPE_KPI, - "【" + instance.getPeriodName() + "】的绩效考核内容审核通过,可以在绩效考核记录进行查询。", - staff.getObjUserId(), - kpiApplyBizBo.getCreateUserId(), "U"); - } - - } - } - kpiApplyBizDao.updateByPrimaryKeySelective(kpiApplyBizBo); - return Result.success(); - } - - /** - * 处理计划审核人字段 - * - * @Author: lichen - * @Date: 2022/8/15 - **/ - public String auditsUpdate(String auditUserId, KpiApplyBiz kpiApplyBiz) { - String auditIdsSource = kpiApplyBiz.getAuditors(); - if (auditIdsSource == null || auditIdsSource.length() < 10) { - return auditUserId; - } else { - List idList = new ArrayList<>(Arrays.asList(auditIdsSource.split(","))); - idList.add(auditUserId); - return StringUtils.join(idList, ","); - } - } - - /** - * 处理评分人字段 - * - * @Author: lichen - * @Date: 2022/8/15 - **/ - public String markersUpdate(String auditUserId, KpiApplyBiz kpiApplyBiz) { - String auditIdsSource = kpiApplyBiz.getMarker(); - if (auditIdsSource == null || auditIdsSource.length() < 10) { - return auditUserId; - } else { - List idList = new ArrayList<>(Arrays.asList(auditIdsSource.split(","))); - idList.add(auditUserId); - return StringUtils.join(idList, ","); - } - } - - // 处理审核人字段 - public String markersUpdateReject(KpiApplyBiz kpiApplyBiz) { - if (StringUtils.isEmpty(kpiApplyBiz.getMarker())) { - return ""; - } else { - List idList = new ArrayList<>(Arrays.asList(kpiApplyBiz.getMarker().split(","))); - idList.remove(idList.size() - 1); - - if (idList.size() > 0) { - return StringUtils.join(idList, ","); - } else { - return ""; - } - } - } -} diff --git a/src/com/sipai/service/kpi/KpiDimensionService.java b/src/com/sipai/service/kpi/KpiDimensionService.java deleted file mode 100644 index fd55e8d3..00000000 --- a/src/com/sipai/service/kpi/KpiDimensionService.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiDimensionDao; -import com.sipai.entity.base.Tree; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.kpi.KpiDimension; -import com.sipai.tools.CommService; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.UUID; - -/** - * 考核维度管理 - * - * @Author: lichen - * @Date: 2021/10/8 - **/ -@Service -public class KpiDimensionService implements CommService { - - @Resource - private KpiDimensionDao kpiDimensionDao; - - /** - * 根据主键获取考核维度对象 - * - * @param id: 考核维度主键 - * @return 考核维度对象 - * @author lichen - * @date 2021/10/8 10:55 - **/ - @Override - public KpiDimension selectById(String id) { - return kpiDimensionDao.selectByPrimaryKey(id); - } - - /** - * 删除考核维度 - * - * @return 新增考核维度 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @Override - public int deleteById(String t) { - return kpiDimensionDao.deleteByPrimaryKey(t); - } - - /** - * 新增考核维度 - * - * @return 新增考核维度 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @Override - public int save(KpiDimension kpiDimension) { - kpiDimension.setId(UUID.randomUUID().toString()); - return kpiDimensionDao.insert(kpiDimension); - } - - public boolean uniqueCheck(KpiDimension kpiDimension) { - String where; - if (StringUtils.isEmpty(kpiDimension.getId())) { - where = " where period_type=" + kpiDimension.getPeriodType() + " and job_type=" + kpiDimension.getJobType() + " and dimension_name='" + kpiDimension.getDimensionName() + "' and status=1 and is_deleted=0 order by morder"; - } else { - where = " where id !='"+ kpiDimension.getId() +"' and period_type=" + kpiDimension.getPeriodType() + " and job_type=" + kpiDimension.getJobType() + " and dimension_name='" + kpiDimension.getDimensionName() + "' and status=1 and is_deleted=0 order by morder"; - } - - List kpiDimensions = selectListByWhere(where); - return kpiDimensions.size() == 0; - } - - /** - * 更新考核维度 - * - * @return 新增考核维度 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @Override - public int update(KpiDimension kpiDimension) { - - return kpiDimensionDao.updateByPrimaryKeySelective(kpiDimension); - } - - /** - * 获取考核维度列表 - * - * @return 考核维度对象列表 - * @author lichen - * @date 2021/10/8 9:40 - **/ - @Override - public List selectListByWhere(String t) { - KpiDimension kpiDimension = new KpiDimension(); - kpiDimension.setWhere(t); - return kpiDimensionDao.selectListByWhere(kpiDimension); - } - - /** - * 批量删除 - * - * @author maxinhui - * @date 2021/11/26 - **/ - - @Override - public int deleteByWhere(String t) { - KpiDimension entity = new KpiDimension(); - entity.setWhere(t); - return kpiDimensionDao.deleteByWhere(entity); - } - - /** - * 获取考核维度下拉列表JSON数据 - * - * @author lichen - * @date 2021/10/8 9:40 - **/ - public String selectForJson(String where) { - List list = kpiDimensionDao.selectForJson(where); - return JSONArray.fromObject(list).toString(); - } - - public String getPeriodTypeListByJobType(String jobType) { - List treeList = kpiDimensionDao.getPeriodTypeListByJobType(jobType); - for (Tree item : treeList) { - item.setText(PeriodTypeEnum.getNameByid(Integer.parseInt(item.getId()))); - } - return JSONArray.fromObject(treeList).toString(); - } - - public String getDimensionId(String dimensionName, int jobLeveL, int periodType) { - return kpiDimensionDao.getDimensionId(dimensionName, jobLeveL, periodType); - } -} diff --git a/src/com/sipai/service/kpi/KpiIndicatorLibDetailService.java b/src/com/sipai/service/kpi/KpiIndicatorLibDetailService.java deleted file mode 100644 index 3ce42bf8..00000000 --- a/src/com/sipai/service/kpi/KpiIndicatorLibDetailService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiIndicatorLibDetailDao; -import com.sipai.entity.kpi.KpiIndicatorLibDetail; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * @author maxinhui - * @date 2021/10/15 上午 9:13 - */ -@Service -public class KpiIndicatorLibDetailService implements CommService { - @Resource - private KpiIndicatorLibDetailDao kpiIndicatorLibDetailDao; - - @Override - public KpiIndicatorLibDetail selectById(String id) { - return kpiIndicatorLibDetailDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String t) { - return kpiIndicatorLibDetailDao.deleteByPrimaryKey(t); - } - - @Override - public int save(KpiIndicatorLibDetail kpiIndicatorLibDetail) { - return kpiIndicatorLibDetailDao.insert(kpiIndicatorLibDetail); - } - - @Override - public int update(KpiIndicatorLibDetail kpiIndicatorLibDetail) { - return kpiIndicatorLibDetailDao.updateByPrimaryKeySelective(kpiIndicatorLibDetail); - } - - @Override - public List selectListByWhere(String t) { - KpiIndicatorLibDetail kpiIndicatorLibDetail=new KpiIndicatorLibDetail(); - kpiIndicatorLibDetail.setWhere(t); - return kpiIndicatorLibDetailDao.selectListByWhere(kpiIndicatorLibDetail); - } - - @Override - public int deleteByWhere(String t) { - KpiIndicatorLibDetail kpiIndicatorLibDetail=new KpiIndicatorLibDetail(); - kpiIndicatorLibDetail.setWhere(t); - return kpiIndicatorLibDetailDao.deleteByWhere(kpiIndicatorLibDetail); - } - - public List selectList(KpiIndicatorLibDetail t){ - return kpiIndicatorLibDetailDao.selectList(t); - } -} diff --git a/src/com/sipai/service/kpi/KpiIndicatorLibService.java b/src/com/sipai/service/kpi/KpiIndicatorLibService.java deleted file mode 100644 index f825d62b..00000000 --- a/src/com/sipai/service/kpi/KpiIndicatorLibService.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiIndicatorLibDao; -import com.sipai.entity.kpi.KpiDimension; -import com.sipai.entity.kpi.KpiIndicatorLib; -import com.sipai.entity.user.Job; -import com.sipai.service.user.JobService; -import com.sipai.tools.CommService; -import com.sipai.tools.DateUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.*; - -/** - * @author maxinhui - * @date 2021/10/13 下午 1:42 - */ -@Service -public class KpiIndicatorLibService implements CommService { - @Resource - private KpiIndicatorLibDao kpiIndicatorLibDao; - - @Resource - private JobService jobService; - - @Resource - private KpiDimensionService kpiDimensionService; - - - @Override - public KpiIndicatorLib selectById(String id) { - - return kpiIndicatorLibDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String t) { - return kpiIndicatorLibDao.deleteByPrimaryKey(t); - } - - @Override - public int save(KpiIndicatorLib kpiIndicatorLib) { - kpiIndicatorLib.setCreateTime(DateUtil.toStr(null,new Date())); - kpiIndicatorLib.setUpdateTime(kpiIndicatorLib.getCreateTime()); - kpiIndicatorLib.setIsDeleted(false); - return kpiIndicatorLibDao.insert(kpiIndicatorLib); - } - - @Override - public int update(KpiIndicatorLib kpiIndicatorLib) { - return kpiIndicatorLibDao.updateByPrimaryKeySelective(kpiIndicatorLib); - } - - @Override - public List selectListByWhere(String t) { - KpiIndicatorLib kpiIndicatorLib=new KpiIndicatorLib(); - kpiIndicatorLib.setWhere(t); - return kpiIndicatorLibDao.selectListByWhere(kpiIndicatorLib); - } - public KpiIndicatorLib selectInfo(String t) { - KpiIndicatorLib kpiIndicatorLib=new KpiIndicatorLib(); - kpiIndicatorLib.setWhere(t); - return kpiIndicatorLibDao.selectByWhere(kpiIndicatorLib); - } - - /** - * 批量删除 - * - * @author maxinhui - * @date 2021/11/26 - * - **/ - - - @Override - public int deleteByWhere(String t) { - KpiIndicatorLib entity= new KpiIndicatorLib(); - entity.setWhere(t); - return kpiIndicatorLibDao.deleteByWhere(entity); - } - public List selectList(KpiIndicatorLib t){ - return kpiIndicatorLibDao.selectList(t); - } - - - /** - * 获取职位-维度树的数据 - * - * @return - * @author lichen - * @date 2021/11/25 16:30 - **/ - public List> getTree(String jobType,String periodType) { - - String orderstr = " order by period_type asc , job_type asc, morder asc, id asc "; - String wherestr = " where is_deleted = 0 and status = '1' "; - if (StringUtils.isNotBlank(periodType)) { - wherestr += " and period_type = " + periodType; - } - if (StringUtils.isNotBlank(jobType)) { - wherestr += " and job_type = " + jobType; - } - List kpiDimensionList = kpiDimensionService.selectListByWhere(wherestr + orderstr); - - orderstr = " order by pri asc "; - wherestr = " where 1=1 " ; - - if (StringUtils.isNotBlank(jobType)) { - wherestr += "and level_type = "+jobType +" "; - } - List list = this.jobService.selectListByWhere(wherestr + orderstr); - - List> mapList = new ArrayList<>(); - for (Job n : list) { - Map map = new HashMap<>(); - map.put("id", n.getId()); - map.put("text", n.getName()); - map.put("pid", "-1"); - map.put("nodes", initNodes(kpiDimensionList, n.getId())); - mapList.add(map); - } - return mapList; - - } - - - private List> initNodes(List list, String pid){ - List> mapList = new ArrayList<>(); - for (KpiDimension n : list) { - Map map = new HashMap<>(); - map.put("id", n.getId()); - map.put("text", n.getDimensionName()); - map.put("pid", pid); - mapList.add(map); - } - - return mapList; - - } -} \ No newline at end of file diff --git a/src/com/sipai/service/kpi/KpiPeriodInstanceService.java b/src/com/sipai/service/kpi/KpiPeriodInstanceService.java deleted file mode 100644 index b1f1566b..00000000 --- a/src/com/sipai/service/kpi/KpiPeriodInstanceService.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiPeriodInstanceDao; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.enums.PositionTypeEnum; -import com.sipai.entity.kpi.KpiPeriodInstance; -import com.sipai.entity.kpi.KpiPeriodInstanceVo; -import com.sipai.tools.CommService; -import com.sipai.tools.KpiUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 计划编制:考核计划 - * - * @Author: lichen - * @Date: 2021/10/8 - **/ -@Service -public class KpiPeriodInstanceService implements CommService { - - @Resource - private KpiPeriodInstanceDao kpiPeriodInstanceDao; - - @Resource - private KpiPlanService kpiPlanService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiPlanDetailService kpiPlanDetailService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - - @Override - public KpiPeriodInstance selectById(String t) { - return kpiPeriodInstanceDao.selectByPrimaryKey(t); - } - - public KpiPeriodInstanceVo selectVoById(String t) { - KpiPeriodInstance po = kpiPeriodInstanceDao.selectByPrimaryKey(t); - KpiPeriodInstanceVo vo = new KpiPeriodInstanceVo(); - BeanUtils.copyProperties(po, vo); - - // 绩效类型名称转换 - vo.setPositionTypeName(PositionTypeEnum.getNameByid(vo.getJobType()) + "考核"); - //考核周期类型名称转换 - vo.setPeriodTypeName(PeriodTypeEnum.getNameByid(vo.getPeriodType())); - // 考核周期完整名称拼接 - vo.setPeriodName(KpiUtils.getPeriodName(vo.getPeriodYear(), vo.getPeriodType(), vo.getPeriodNo())); - return vo; - } - - - @Override - public int deleteById(String t) { - return kpiPeriodInstanceDao.deleteByPrimaryKey(t); - } - - /** - * 新增考核计划 - * - * @return - * @author lichen - * @date 2021/10/15 11:06 - **/ - @Override - public int save(KpiPeriodInstance kpiPeriodInstance) { - - int result = kpiPeriodInstanceDao.insert(kpiPeriodInstance); - // 查找方案中符合条件的数据 - // 考核周期类型 - int peroidType = kpiPeriodInstance.getPeriodType(); - // 岗位类型 - int jobType = kpiPeriodInstance.getJobType(); - -// String where = " period_type='"+ peroidType +"' "; -// List planlist = kpiPlanService.selectCopySource(peroidType,jobType); - -// KpiPlanStaff kpiPlanStaff; -// KpiPlanStaffDetail kpiPlanStaffDetail; -// for(KpiPlan plan: planlist){ -// // 保存考核对象 -// kpiPlanStaff =new KpiPlanStaff(); -// kpiPlanStaff.setId(UUID.randomUUID().toString()); -// kpiPlanStaff.setPeriodInstanceId(kpiPeriodInstance.getId()); -// kpiPlanStaff.setObjUserId(plan.getObjUserId()); -// kpiPlanStaff.setJobId(plan.getJobId()); -// kpiPlanStaff.setStatus(PlanStaffStatusEnum.PlanMaking.getId()); -// kpiPlanStaff.setCreateUserId(plan.getCreateUserId()); -// kpiPlanStaff.setCreateTime(kpiPeriodInstance.getCreateTime()); -// kpiPlanStaff.setUpdateTime(kpiPeriodInstance.getUpdateTime()); -// kpiPlanStaff.setIsDeleted(false); -//// kpiPlanStaff.setJobLevelType(plan.getLevelType()); -//// kpiPlanStaff.setPeriodType(plan.getPeriodType()); -// kpiPlanStaff.setUnitId(plan.getUnitId()); -// kpiPlanStaffService.save(kpiPlanStaff); -// // 保存考核内容 -// String where =" where plan_id='"+plan.getId()+"'"; -// List kpiPlanDetailList = kpiPlanDetailService.selectListByWhere(where); -// for(KpiPlanDetail planDetail: kpiPlanDetailList ){ -// kpiPlanStaffDetail =new KpiPlanStaffDetail(); -// kpiPlanStaffDetail.setId(UUID.randomUUID().toString()); -// kpiPlanStaffDetail.setPlanStaffId(kpiPlanStaff.getId()); -// kpiPlanStaffDetail.setDimensionId(planDetail.getDimensionId()); -// kpiPlanStaffDetail.setIndicatorName(planDetail.getIndicatorName()); -// kpiPlanStaffDetail.setContentA(planDetail.getContentA()); -// kpiPlanStaffDetail.setContentB(planDetail.getContentB()); -// kpiPlanStaffDetail.setContentC(planDetail.getContentC()); -// kpiPlanStaffDetail.setContentD(planDetail.getContentD()); -// kpiPlanStaffDetail.setIndicatorDetail(planDetail.getIndicatorDetail()); -// kpiPlanStaffDetail.setIndicatorWeight(planDetail.getIndicatorWeight()); -// kpiPlanStaffDetail.setCreateTime(kpiPeriodInstance.getCreateTime()); -// kpiPlanStaffDetail.setUpdateTime(kpiPeriodInstance.getUpdateTime()); -// kpiPlanStaffDetail.setIsDeleted(false); -// kpiPlanStaffDetailService.save(kpiPlanStaffDetail); -// } -// } - return result; - } - - @Override - public int update(KpiPeriodInstance kpiPeriodInstance) { - return 0; - } - - /** - * 考核计划列表 - * - * @return - * @author lichen - * @date 2021/10/11 17:27 - **/ - @Override - public List selectListByWhere(String t) { - KpiPeriodInstance kpiPeriodInstance = new KpiPeriodInstance(); - kpiPeriodInstance.setWhere(t); - return kpiPeriodInstanceDao.selectListByWhere(kpiPeriodInstance); - } - - @Override - public int deleteByWhere(String t) { - KpiPeriodInstance entity = new KpiPeriodInstance(); - entity.setWhere(t); - return kpiPeriodInstanceDao.deleteByWhere(entity); - } - - /** - * 查询重复计划 - * - * @return - * @author lichen - * @date 2021/10/11 17:27 - **/ - public KpiPeriodInstance selectOneWithOutId(KpiPeriodInstance kpiPeriodInstance) { - String where = " where job_type='" + kpiPeriodInstance.getJobType() + "'"; - where += " and period_year='" + kpiPeriodInstance.getPeriodYear() + "'"; - where += " and period_type='" + kpiPeriodInstance.getPeriodType() + "'"; - where += " and period_no='" + kpiPeriodInstance.getPeriodNo() + "'"; - kpiPeriodInstance.setWhere(where); - return kpiPeriodInstanceDao.selectByWhere(kpiPeriodInstance); - } - - /** - * 考核主计划列表 - * - * @Author: lichen - * @Date: 2022/7/7 - **/ - public List selectPageList(String userId) { - return kpiPeriodInstanceDao.selectPageList(userId); - } -} diff --git a/src/com/sipai/service/kpi/KpiPlanDetailReadListenner.java b/src/com/sipai/service/kpi/KpiPlanDetailReadListenner.java deleted file mode 100644 index 166bb21e..00000000 --- a/src/com/sipai/service/kpi/KpiPlanDetailReadListenner.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.kpi; - -import com.alibaba.excel.context.AnalysisContext; -import com.alibaba.excel.metadata.CellExtra; -import com.alibaba.excel.metadata.data.ReadCellData; -import com.alibaba.excel.read.listener.ReadListener; -import com.sipai.dao.kpi.KpiPlanDetailDao; -import com.sipai.entity.kpi.KpiPlan; -import com.sipai.entity.kpi.KpiPlanDetail; -import com.sipai.tools.DateUtil; -import lombok.Data; -import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; -import java.util.Map; - -@Data -public class KpiPlanDetailReadListenner implements ReadListener { - -// private KpiPlan kpiPlan; -//// private KpiPlanDetailService service; -//// public KpiPlanDetailReadListenner(KpiPlan kpiPlan, KpiPlanDetailService service){ -//// this.kpiPlan=kpiPlan; -//// this.service=service; -//// } - - @Override - public void onException(Exception exception, AnalysisContext context) throws Exception { - - } - - @Override - public void invokeHead(Map> headMap, AnalysisContext context) { - - } - - @Override - public void invoke(KpiPlanDetail kpiPlanDetail, AnalysisContext analysisContext) { - - - } - - @Override - public void extra(CellExtra extra, AnalysisContext context) { - - } - - @Override - public void doAfterAllAnalysed(AnalysisContext analysisContext) { - - } - - @Override - public boolean hasNext(AnalysisContext context) { - return false; - } -} \ No newline at end of file diff --git a/src/com/sipai/service/kpi/KpiPlanDetailService.java b/src/com/sipai/service/kpi/KpiPlanDetailService.java deleted file mode 100644 index ca8de98c..00000000 --- a/src/com/sipai/service/kpi/KpiPlanDetailService.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiPlanDetailDao; -import com.sipai.entity.kpi.KpiPlanDetail; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class KpiPlanDetailService implements CommService { - - @Resource - private KpiPlanDetailDao kpiPlanDetailDao; - - /** - * 根据主键查询 - * @param t - * @return - */ - @Override - public KpiPlanDetail selectById(String t) { - return kpiPlanDetailDao.selectByPrimaryKey(t); - } - - /** - * 删除 - * @param t - * @return - */ - @Override - public int deleteById(String t) { - return kpiPlanDetailDao.deleteByPrimaryKey(t); - } - public int deleteByPlanId(String t) { - return kpiPlanDetailDao.deleteByByPlanId(t); - } - - /** - * 新增 - * @param kpiPlanDetail - * @return - */ - @Override - public int save(KpiPlanDetail kpiPlanDetail) { - - return kpiPlanDetailDao.insert(kpiPlanDetail); - } - - /** - * 更新 - * @param kpiPlanDetail - * @return - */ - @Override - public int update(KpiPlanDetail kpiPlanDetail) { - return kpiPlanDetailDao.updateByPrimaryKeySelective(kpiPlanDetail); - } - - /** - * 条件查询 - * @param t - * @return - */ - @Override - public List selectListByWhere(String t) { - KpiPlanDetail kpiPlanDetail=new KpiPlanDetail(); - kpiPlanDetail.setWhere(t); - return kpiPlanDetailDao.selectListByWhere(kpiPlanDetail); - } - - /** - * 批量删除 - * - * @author maxinhui - * @date 2021/11/26 - * - **/ - - @Override - public int deleteByWhere(String t) { - KpiPlanDetail entity =new KpiPlanDetail(); - entity.setWhere(t); - return kpiPlanDetailDao.deleteByWhere(entity); - } - - - - -} \ No newline at end of file diff --git a/src/com/sipai/service/kpi/KpiPlanService.java b/src/com/sipai/service/kpi/KpiPlanService.java deleted file mode 100644 index 2b3e01d2..00000000 --- a/src/com/sipai/service/kpi/KpiPlanService.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiPlanDao; -import com.sipai.entity.kpi.KpiPlan; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class KpiPlanService implements CommService { - - @Resource - private KpiPlanDao kpiPlanDao; - - /** - * 根据id查询 - * @param t - * @return - */ - @Override - public KpiPlan selectById(String t) { - return kpiPlanDao.selectByPrimaryKey(t); - } - /** - * 删除绩效方案列表 - * - * @author lihongye - * @date 2021/10/18 9:40 - **/ - @Override - public int deleteById(String t) { - return kpiPlanDao.deleteByPrimaryKey(t); - } - /** - * 新增绩效方案列表 - * - * @author lihongye - * @date 2021/10/18 9:40 - **/ - @Override - public int save(KpiPlan kpiPlan) { - return kpiPlanDao.insert(kpiPlan); - } - - @Override - public int update(KpiPlan kpiPlan) { - return kpiPlanDao.updateByPrimaryKeySelective(kpiPlan); - } - - /** - * 获取绩效方案列表 - * - * @author lihongye - * @date 2021/10/12 9:40 - **/ - @Override - public List selectListByWhere(String t) { - KpiPlan kpiPlan=new KpiPlan(); - kpiPlan.setWhere(t); - return kpiPlanDao.selectListByWhere(kpiPlan); - } - /** - * 批量删除 - * - * @author maxinhui - * @date 2021/11/26 - * - **/ - - @Override - public int deleteByWhere(String t) { - KpiPlan entity =new KpiPlan(); - entity.setWhere(t); - return kpiPlanDao.deleteByWhere(entity); - } - /** - * 根据考核周期与岗位类型搜索考核人员方案列表 - * - * @author lichen - * @date 2021/12/29 - * - **/ - - public List selectCopySource(int peroidType, int jobType, String createUserId) { - return kpiPlanDao.selectCopySource(peroidType,jobType,createUserId); - } - - public KpiPlan selectByObjUserIdAndPeriodTypeId(String objUserId, String jobId, int periodType,String createuserId) { - return kpiPlanDao.selectByObjUserIdAndPeriodTypeId(objUserId,jobId,periodType,createuserId); - } -} diff --git a/src/com/sipai/service/kpi/KpiPlanStaffDetailService.java b/src/com/sipai/service/kpi/KpiPlanStaffDetailService.java deleted file mode 100644 index 6f3104d0..00000000 --- a/src/com/sipai/service/kpi/KpiPlanStaffDetailService.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiPlanStaffDetailDao; -import com.sipai.entity.kpi.KpiDimension; -import com.sipai.entity.kpi.KpiMarkListQuery; -import com.sipai.entity.kpi.KpiPlanStaff; -import com.sipai.entity.kpi.KpiPlanStaffDetail; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -@Service -public class KpiPlanStaffDetailService implements CommService { - @Resource - private KpiDimensionService kpiDimensionService; - @Resource - private KpiPlanStaffDetailDao kpiPlanStaffDetailDao; - - @Resource - private UserService userService; - - @Resource - private KpiPlanStaffService kpiPlanStaffService; - - @Override - public KpiPlanStaffDetail selectById(String t) { - KpiPlanStaffDetail kpiPlanStaffDetail = kpiPlanStaffDetailDao.selectByPrimaryKey(t); - kpiPlanStaffDetail.setDimensionName(kpiDimensionService.selectById(kpiPlanStaffDetail.getDimensionId()).getDimensionName()); - return kpiPlanStaffDetail; - } - - /** - * 删除考核内容 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @Override - public int deleteById(String t) { - return kpiPlanStaffDetailDao.deleteByPrimaryKey(t); - } - - /** - * 新增考核内容 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @Override - public int save(KpiPlanStaffDetail kpiPlanStaffDetail) { - return kpiPlanStaffDetailDao.insert(kpiPlanStaffDetail); - } - - /** - * 更新考核内容 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @Override - public int update(KpiPlanStaffDetail kpiPlanStaffDetail) { - return kpiPlanStaffDetailDao.updateByPrimaryKeySelective(kpiPlanStaffDetail); - } - - /** - * 获取考核内容列表 - * - * @return 考核内容对象列表 - * @author lichen - * @date 2021/10/15 9:40 - **/ - @Override - public List selectListByWhere(String s) { - KpiPlanStaffDetail kpiPlanStaffDetail = new KpiPlanStaffDetail(); - kpiPlanStaffDetail.setWhere(s); - List list = kpiPlanStaffDetailDao.selectListByWhere(kpiPlanStaffDetail); - // 填充维度名称 - for (KpiPlanStaffDetail item : list) { - KpiDimension kpiDimension = kpiDimensionService.selectById(item.getDimensionId()); - if (kpiDimension != null) { - item.setDimensionName(kpiDimension.getDimensionName()); - } - } - return list; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - /** - * 查询当前总权重 - * - * @author lichen - * @date 2021/10/15 10:55 - **/ - public BigDecimal getTotalWeight(String planStaffId) { - Map map = kpiPlanStaffDetailDao.getTotalWeight(planStaffId); - if (map == null) { - return new BigDecimal("0.00"); - } else { - return map.get("totalWeight"); - } - } - public void checkEveryStaffTotalWeight(String bizId) throws Exception { - - List kpiPlanStaffs = kpiPlanStaffService.selectListByWhere(" where apply_biz_id='" + bizId + "' order by id "); - String userIds=""; - - for( KpiPlanStaff item : kpiPlanStaffs){ - Map map = kpiPlanStaffDetailDao.getTotalWeight(item.getId()); - if (map == null || map.get("totalWeight").intValue()!=100 ) { - userIds += item.getObjUserId()+","; - } - } - - if(StringUtils.isNotEmpty(userIds) ){ - String userName=userService.getUserNamesByUserIds(userIds); - throw new Exception( "以下用户的考核指标,权重之和不是100,请修改各项权重后再提交审核。\n"+userName); - } - - } - - /** - * 根据主表id查询考核指标列表 - * - * @return - * @author lichen - * @date 2021/10/21 11:30 - **/ - public List selectListByPlanStaffId(String planStaffId) { - String whereStr = "where plan_staff_id ='" + planStaffId + "'"; - String orderStr = " order by dimension_id desc,morder desc,update_time desc "; - KpiPlanStaffDetail kpiPlanStaffDetail = new KpiPlanStaffDetail(); - kpiPlanStaffDetail.setWhere(whereStr + orderStr); - List list = kpiPlanStaffDetailDao.selectListByWhere(kpiPlanStaffDetail); - // 填充维度名称 - for (KpiPlanStaffDetail item : list) { - item.setDimensionName(kpiDimensionService.selectById(item.getDimensionId()).getDimensionName()); - } - return list; - } - - /** - * 给打分页面的列表用 - * - * @return - * @author lichen - * @date 2021/10/30 10:58 - **/ - public List selectListByWhereWihtCompletionStatus(KpiMarkListQuery s) { - - List list = kpiPlanStaffDetailDao.selectListByWhereWihtCompletionStatus(s); - // 填充维度名称 - for (KpiPlanStaffDetail item : list) { - item.setDimensionName(kpiDimensionService.selectById(item.getDimensionId()).getDimensionName()); - } - return list; - } - public List selectListByWhereWihtCompletionStatusFinal(KpiMarkListQuery s) { - - List list = kpiPlanStaffDetailDao.selectListByWhereWihtCompletionStatusFianl(s); - // 填充维度名称 - for (KpiPlanStaffDetail item : list) { - item.setDimensionName(kpiDimensionService.selectById(item.getDimensionId()).getDimensionName()); - } - return list; - } -} diff --git a/src/com/sipai/service/kpi/KpiPlanStaffService.java b/src/com/sipai/service/kpi/KpiPlanStaffService.java deleted file mode 100644 index 944b7cbf..00000000 --- a/src/com/sipai/service/kpi/KpiPlanStaffService.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiPlanStaffDao; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.kpi.KpiPeriodInstanceVo; -import com.sipai.entity.kpi.KpiPlanStaff; -import com.sipai.entity.kpi.KpiPlanStaffBo; -import com.sipai.entity.user.Job; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.UUID; - -/** - * 计划编制:考核对象 - * - * @Author: lichen - * @Date: 2021/10/14 - **/ -@Service -public class KpiPlanStaffService implements CommService { - - @Resource - private MsgServiceImpl msgService; - @Resource - private KpiPlanStaffDao kpiPlanStaffDao; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private KpiWorkflowService kpiWorkflowService; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - - @Resource - private KpiIndicatorLibService kpiIndicatorLibService; - - @Resource - private UserService userService; - @Resource - private JobService jobService; - - /** - * 查询单条记录 - * - * @return - * @author lichen - * @date 2021/10/18 13:52 - **/ - @Override - public KpiPlanStaffBo selectById(String id) { - - KpiPlanStaff kpiPlanStaff = kpiPlanStaffDao.selectByPrimaryKey(id); - User user = userService.getUserById(kpiPlanStaff.getObjUserId()); - Job job = jobService.selectById(kpiPlanStaff.getJobId()); - KpiPeriodInstanceVo kpiPeriodInstance = kpiPeriodInstanceService.selectVoById(kpiPlanStaff.getPeriodInstanceId()); - - KpiPlanStaffBo bo = new KpiPlanStaffBo(); - BeanUtils.copyProperties(kpiPlanStaff,bo); - bo.setStatusName(KpiApplyStatusEnum.getNameByid(bo.getStatus())); - bo.setJob(job); - bo.setKpiPeriodInstance(kpiPeriodInstance); - bo.setUser(user); - -// kpiPlanStaff.setObjUserName(user.getCaption()); -// kpiPlanStaff.setDeptName(user.get_pname()); -// kpiPlanStaff.setCardId(user.getUserCardId()); -// kpiPlanStaff.setJobLevelType(job.getLevelType()); -// kpiPlanStaff.setJobLevelTypeName(PositionTypeEnum.getNameByid(job.getLevelType())); -// kpiPlanStaff.setJobName(job.getName()); -// kpiPlanStaff.setStatusName(PlanStaffStatusEnum.getNameByid(kpiPlanStaff.getStatus())); -// kpiPlanStaff.setKpiPeriodInstance(kpiPeriodInstance); - - return bo; - } - - /** - * 根据ID删除考核计划 - * - * @return - * @author lihongye - * @date 2021/10/20 16:32 - **/ - @Override - public int deleteById(String t) { - return kpiPlanStaffDao.deleteByPrimaryKey(t); - } - - - /** - * 计划编制:添加考核对象 - * - * @return - * @author lichen - * @date 2021/10/14 16:51 - **/ - @Override - public int save(KpiPlanStaff kpiPlanStaff) { - kpiPlanStaff.setId(UUID.randomUUID().toString()); - return kpiPlanStaffDao.insert(kpiPlanStaff); - } - - /** - * 更新 - * - * @return - * @author lichen - * @date 2021/10/14 16:51 - **/ - @Override - public int update(KpiPlanStaff kpiPlanStaff) { - return kpiPlanStaffDao.updateByPrimaryKeySelective(kpiPlanStaff); - } - - /** - * 查询列表 - * - * @return - * @author lichen - * @date 2021/10/14 16:51 - **/ - - @Override - public List selectListByWhere(String t) { - KpiPlanStaff kpiPlanStaff = new KpiPlanStaff(); - kpiPlanStaff.setWhere(t); - return kpiPlanStaffDao.selectListByWhere(kpiPlanStaff); - } - - @Override - public int deleteByWhere(String t) { - KpiPlanStaff kpiPlanStaff = new KpiPlanStaff(); - kpiPlanStaff.setWhere(t); - return kpiPlanStaffDao.deleteByWhere(kpiPlanStaff); - } - - /** - * 获取考核对象列表 - * - * @return - * @author lichen - * @date 2021/10/14 9:42 - **/ - public List selectPageListByCreateUserIdAndApplyBizId(String createUserId, String applyBizId) { - KpiPlanStaff kpiPlanStaff = new KpiPlanStaff(); - kpiPlanStaff.setCreateUserId(createUserId); - kpiPlanStaff.setApplyBizId(applyBizId); - return kpiPlanStaffDao.selectPageListByCreateUserIdAndApplyBizId(kpiPlanStaff); - } - -} diff --git a/src/com/sipai/service/kpi/KpiResultIndicatorService.java b/src/com/sipai/service/kpi/KpiResultIndicatorService.java deleted file mode 100644 index 97a5b12c..00000000 --- a/src/com/sipai/service/kpi/KpiResultIndicatorService.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiResultIndicatorDao; -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.kpi.*; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.DateUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Service -public class KpiResultIndicatorService implements CommService { - @Resource - private KpiResultIndicatorDao kpiResultIndicatorDao; - - @Resource - private UserService userService; - - @Resource - private KpiApplyBizService kpiApplyBizService; - - @Resource - private KpiPlanStaffService kpiPlanStaffService; - - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - - @Override - public KpiResultIndicator selectById(String t) { - return null; - } - - @Override - public int deleteById(String t) { - return 0; - } - - /** - * 新增 - * - * @author lichen - * @date 2021/10/20 15:14 - **/ - @Override - public int save(KpiResultIndicator kpiResultIndicator) { - kpiResultIndicator.setId(UUID.randomUUID().toString()); - String now = DateUtil.toStr(null, new Date()); - kpiResultIndicator.setCreateTime(now); - kpiResultIndicator.setUpdateTime(now); - kpiResultIndicator.setIsDeleted(false); - return kpiResultIndicatorDao.insert(kpiResultIndicator); - } - - /** - * 更新 - * - * @author lichen - * @date 2021/10/20 15:14 - **/ - @Override - public int update(KpiResultIndicator kpiResultIndicator) { - String now = DateUtil.toStr(null, new Date()); - kpiResultIndicator.setUpdateTime(now); - return kpiResultIndicatorDao.updateByPrimaryKeySelective(kpiResultIndicator); - } - - /** - * 查询列表 - * - * @author lichen - * @date 2021/10/20 15:14 - **/ - @Override - public List selectListByWhere(String t) { - KpiResultIndicator kpiResultIndicator = new KpiResultIndicator(); - kpiResultIndicator.setWhere(t); - return kpiResultIndicatorDao.selectListByWhere(kpiResultIndicator); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - /** - * 根据考核计划人员详情表主键,以及评分人id查询打分记录 - * - * @return - * @author lichen - * @date 2021/10/20 14:49 - **/ - public KpiResultIndicator selectByPlanStaffDetailIdAndAuditorId(String planStaffDetailId, String auditorID) { - String where = " where is_deleted='0' "; - where += "and auditor_id= '" + auditorID + "'"; - where += "and plan_staff_detail_id= '" + planStaffDetailId + "'"; - String order = " order by update_time desc"; - - KpiResultIndicator kpiResultIndicator = new KpiResultIndicator(); - kpiResultIndicator.setWhere(where + order); - - List list = kpiResultIndicatorDao.selectListByWhere(kpiResultIndicator); - if (list == null || list.size() == 0) { - return null; - } else if (list.size() > 1) { - throw new RuntimeException(); - } else { - return list.get(0); - } - } - - /** - * 根据考核计划人员表主键,以及评分人id查询打分记录 - * - * @return - * @author lichen - * @date 2021/10/20 14:49 - **/ - public List selectByPlanStaffIdAndAuditorId(KpiActivitiRequest kpiActivitiRequest) { - return kpiResultIndicatorDao.selectByPlanStaffIdAndAuditorId(kpiActivitiRequest); - } - public List auditList(KpiMarkListQuery kpiActivitiRequest) { - return kpiResultIndicatorDao.auditList(kpiActivitiRequest); - } - - /** - * 根据考核内容的主键查询各个评价人的打分情况 - * - * @return - * @author lichen - * @date 2021/10/20 14:49 - **/ - public List selectListByPlanStaffDetailId(String planStaffDetailId) { - String where = " where is_deleted='0' "; - where += "and plan_staff_detail_id= '" + planStaffDetailId + "'"; - String order = " order by update_time asc"; - - KpiResultIndicator kpiResultIndicator = new KpiResultIndicator(); - kpiResultIndicator.setWhere(where + order); - return kpiResultIndicatorDao.selectListByWhere(kpiResultIndicator); - } - - /** - * 判断打分合理性 - * - * @return - * @author lichen - * @date 2021/10/29 15:57 - **/ - public void checkMarkPoint(KpiActivitiRequest applyRequest) { - - KpiApplyBiz kpiApplyBiz = kpiApplyBizService.selectById(applyRequest.getBizId()); - List kpiPlanStaffs = kpiPlanStaffService.selectPageListByCreateUserIdAndApplyBizId(kpiApplyBiz.getCreateUserId(), kpiApplyBiz.getId()); - for (KpiPlanStaff staff : kpiPlanStaffs) { - - // 打分列表 - applyRequest.setPlanStaffId(staff.getId()); - - List resultIndicators = selectByPlanStaffIdAndAuditorId(applyRequest); - // 考核项目列表 - List planStaffDetails = kpiPlanStaffDetailService.selectListByPlanStaffId(staff.getId()); - //对比数量 - if (resultIndicators == null || resultIndicators.size() == 0) { - for (KpiPlanStaffDetail planStaffDetail : planStaffDetails) { - if (!planStaffDetail.getDimensionName().equals(KpiConstant.SPECIAL_DIMENSION)) { - String userName= userService.getUserById( staff.getObjUserId()).getCaption(); - throw new RuntimeException("考核对象【"+userName+"】:有个别考核项目未打分,或者分数不在0~100范围内。"); - } - } - } - // 如果某一个打分项目中结果打分和过程打分某一个没打分 - for (KpiPlanStaffDetail planStaffDetail : planStaffDetails) { - for (KpiResultIndicator resultIndicator : resultIndicators) { - if (planStaffDetail.getId().equals(resultIndicator.getPlanStaffDetailId())) { - if ((!planStaffDetail.getDimensionName().equals(KpiConstant.SPECIAL_DIMENSION)) - && (resultIndicator.getProcessPoint() == null || resultIndicator.getResultPoint() == null)) { - // 除了内部客户以外,都必须要打分 - String userName= userService.getUserById( staff.getObjUserId()).getName(); - throw new RuntimeException("考核对象【"+userName+"】:有个别考核项目未打分,或者分数不在0~100范围内。"); - } - } - } - } - - } - - } -} \ No newline at end of file diff --git a/src/com/sipai/service/kpi/KpiResultIndicatorWeightService.java b/src/com/sipai/service/kpi/KpiResultIndicatorWeightService.java deleted file mode 100644 index 648a4228..00000000 --- a/src/com/sipai/service/kpi/KpiResultIndicatorWeightService.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.service.kpi; - -import com.sipai.dao.kpi.KpiResultIndicatorWeightDao; -import com.sipai.entity.kpi.KpiResultIndicatorWeight; -import com.sipai.tools.CommService; -import com.sipai.tools.DateUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Service -public class KpiResultIndicatorWeightService implements CommService { - - - @Resource - private KpiResultIndicatorWeightDao kpiResultIndicatorWeightDao; - - @Override - public KpiResultIndicatorWeight selectById(String t) { - return kpiResultIndicatorWeightDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return 0; - } - - @Override - public int save(KpiResultIndicatorWeight kpiResultIndicatorWeight) { - String now = DateUtil.toStr(null, new Date()); - kpiResultIndicatorWeight.setId(UUID.randomUUID().toString()); - kpiResultIndicatorWeight.setCreateTime(now); - kpiResultIndicatorWeight.setUpdateTime(now); - kpiResultIndicatorWeight.setIsDeleted(false); - return kpiResultIndicatorWeightDao.insert(kpiResultIndicatorWeight); - } - - @Override - public int update(KpiResultIndicatorWeight kpiResultIndicatorWeight) { - - return kpiResultIndicatorWeightDao.updateByWhere(kpiResultIndicatorWeight); - } - - @Override - public List selectListByWhere(String t) { - KpiResultIndicatorWeight kpiResultIndicatorWeight=new KpiResultIndicatorWeight(); - kpiResultIndicatorWeight.setWhere(t); - return kpiResultIndicatorWeightDao.selectListByWhere(kpiResultIndicatorWeight); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - /** - * 根据plan_staff_detail_id查询单条记录 - * - * @return - * @author lichen - * @date 2021/10/26 14:23 - **/ - public KpiResultIndicatorWeight selectByPlanStaffDetailId(String id) { - String where = "where plan_staff_detail_id ='" + id + "' "; - KpiResultIndicatorWeight kpiResultIndicatorWeight = new KpiResultIndicatorWeight(); - kpiResultIndicatorWeight.setWhere(where); - return kpiResultIndicatorWeightDao.selectByWhere(kpiResultIndicatorWeight); - } -} diff --git a/src/com/sipai/service/kpi/KpiResultService.java b/src/com/sipai/service/kpi/KpiResultService.java deleted file mode 100644 index 9d2cf27b..00000000 --- a/src/com/sipai/service/kpi/KpiResultService.java +++ /dev/null @@ -1,524 +0,0 @@ -package com.sipai.service.kpi; - - -import com.sipai.dao.kpi.KpiApplyBizDao; -import com.sipai.dao.kpi.KpiPlanStaffDao; -import com.sipai.dao.kpi.KpiResultDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.KpiApplyStatusEnum; -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.kpi.*; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.KpiWorkflowService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.UnitServiceImpl; -import com.sipai.service.user.UserServiceImpl; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.DateUtil; -import com.sipai.tools.KpiUtils; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.impl.task.TaskDefinition; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.Execution; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.runtime.ProcessInstanceQuery; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.*; - -@Service -public class KpiResultService implements CommService { - @Resource - private UnitServiceImpl unitService; - @Resource - private KpiDimensionService kpiDimensionService; - @Resource - private KpiPlanStaffDao kpiPlanStaffDao; - @Resource - private UserServiceImpl userService; - @Resource - private KpiApplyBizDao kpiApplyBizDao; - @Resource - private KpiPeriodInstanceService kpiPeriodInstanceService; - @Resource - private KpiResultIndicatorService kpiResultIndicatorService; - @Resource - private KpiResultDao kpiResultDao; - @Resource - private KpiResultIndicatorWeightService kpiResultIndicatorWeightService; - @Resource - private KpiPlanStaffService kpiPlanStaffService; - @Resource - private KpiPlanStaffDetailService kpiPlanStaffDetailService; - @Resource - private MsgServiceImpl msgService; - - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private KpiWorkflowService kpiWorkflowService; - - @Resource - private KpiApplyBizService kpiApplyBizService; - - - @Override - public KpiResult selectById(String t) { - return null; - } - - public KpiResult selectByKpiPlanStaffId(String KpiPlanStaffId) { - String where = " where is_deleted='0' "; - where += "and plan_staff_id= '" + KpiPlanStaffId + "'"; - String order = " order by update_time desc"; - - KpiResult kpiResult = new KpiResult(); - kpiResult.setWhere(where + order); - List list = kpiResultDao.selectListByWhere(kpiResult); - if (list != null && list.size() > 1) { - throw new RuntimeException(); - } else if (list.size() == 0) { - return null; - } - return list.get(0); - } - - @Override - public int deleteById(String t) { - return 0; - } - - @Override - public int save(KpiResult kpiResult) { - String now = DateUtil.toStr(null, new Date()); - kpiResult.setId(UUID.randomUUID().toString()); - kpiResult.setCreateTime(now); - kpiResult.setUpdateTime(now); - kpiResult.setIsDeleted(false); - return kpiResultDao.insert(kpiResult); - } - - @Override - public int update(KpiResult kpiResult) { - String now = DateUtil.toStr(null, new Date()); - kpiResult.setUpdateTime(now); - return kpiResultDao.updateByPrimaryKeySelective(kpiResult); - } - - @Override - public List selectListByWhere(String t) { - KpiResult kpiResult = new KpiResult(); - kpiResult.setWhere(t); - return kpiResultDao.selectListByWhere(kpiResult); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - - public Result saveSingleIndicator(KpiActivitiRequest applyRequest) { - // 如果是一级打分人提交打分时,页面会传入单列打分信息,需要跟新结果表 - if (StringUtils.isBlank(applyRequest.getSingleIndicatorName())) { - applyRequest.setSingleIndicatorName("无"); - } - if (applyRequest.getSingleIndicatorPoint() == null) { - applyRequest.setSingleIndicatorPoint(new BigDecimal("0")); - } - // 更新单列指标名称和得分 - KpiResult kpiResultFromDB = selectByKpiPlanStaffId(applyRequest.getPlanStaffId()); - if (kpiResultFromDB != null) { - kpiResultFromDB.setSingleIndicatorName(applyRequest.getSingleIndicatorName()); - kpiResultFromDB.setSingleIndicatorPoint(applyRequest.getSingleIndicatorPoint()); - update(kpiResultFromDB); - } else { - KpiResult kpiResult = new KpiResult(); - kpiResult.setPlanStaffId(applyRequest.getPlanStaffId()); - kpiResult.setSingleIndicatorName(applyRequest.getSingleIndicatorName()); - kpiResult.setSingleIndicatorPoint(applyRequest.getSingleIndicatorPoint()); - save(kpiResult); - } - return Result.success(); - } - - /** - * 启动打分流程 - * - * @author lichen - * @date 2021/10/20 15:24 - **/ - @Transactional(rollbackFor = Exception.class) - public Result startProcess(KpiActivitiRequest applyRequest, User loginUser) { - - //根据业务id获取人员计划表信息 - KpiApplyBiz applyBiz = kpiApplyBizService.selectById(applyRequest.getBizId()); - KpiPeriodInstance instance = kpiPeriodInstanceService.selectById(applyBiz.getPeriodInstanceId()); - - //直接驳回 - if ("0".equals(applyRequest.getPass())) { - - //流程结束,更细你状态 - applyBiz.setStatus(KpiApplyStatusEnum.PlanReject.getId()); - kpiApplyBizDao.updateByPrimaryKeySelective(applyBiz); - kpiPlanStaffDao.updateStatusByApplyBizId(applyBiz); - return Result.success(); - } - - if (KpiApplyStatusEnum.PlanAccessed.getId() != applyBiz.getStatus() && KpiApplyStatusEnum.PlanMarkReject.getId() != applyBiz.getStatus()) { - return Result.failed("该记录还未下发。"); - } - - // 判断有无流程定义,如果没有,则启动失败。 - // 流程定义的id - String processKey = ProcessType.KPI_MARK.getId() + "-" + applyBiz.getUnitId(); - List processDefinitions = - workflowProcessDefinitionService.getProcessDefsBykey(processKey); - if (processDefinitions == null || processDefinitions.size() == 0) { - return Result.failed("缺少该流程定义。"); - } - // 启动流程实例 - // 设置网关条件 - Map map = new HashMap<>(); - map.put(CommString.ACTI_KEK_Condition, 1); - map.put("jobLevelType", instance.getJobType()); - map.put(CommString.ACTI_KEK_Assignee, loginUser.getId()); - map.put(CommString.ACTI_KEK_Candidate_Users, loginUser.getId()); - - // 启动流程 - ProcessInstance processInstance = workflowService.startWorkflow( - // 业务主键 - applyRequest.getBizId(), - // 申请者id - loginUser.getId(), - // 流程Key - processDefinitions.get(0).getKey(), - // 流程变量 - map); - - // 判断实例是否启动成功 - if (processInstance == null) { - return Result.failed("流程实例创建失败。"); - } - - // 获取当前任务 - // 获取当前任务 - Task task = - workflowService.getTaskService().createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); - // 指定当前任务的执行人 ,并完成申请 -// task.setAssignee(loginUser.getId()); -// workflowService.getTaskService().saveTask(task); - Map map2 = processInstance.getProcessVariables(); - map.put(CommString.ACTI_KEK_Condition, 1); - map2.put(CommString.ACTI_KEK_Assignee, applyRequest.getAuditorId()); - map2.put(CommString.ACTI_KEK_Candidate_Users, applyRequest.getAuditorId()); - workflowService.getTaskService().complete(task.getId(), map2); - - - // 更新业务数据状态 - applyBiz.setStatus(KpiApplyStatusEnum.PlanMarking.getId()); - applyBiz.setRejectionComment(applyRequest.getAuditComment()); - applyBiz.setUpdateTime(DateUtil.toStr(null, new Date())); - kpiApplyBizDao.updateByPrimaryKeySelective(applyBiz); - kpiPlanStaffDao.updateStatusByApplyBizId(applyBiz); - return Result.success(); - } - - /** - * 审批打分流程 - * - * @author lichen - * @date 2021/10/20 15:24 - **/ - @Transactional(rollbackFor = Exception.class) - public Result audit(KpiActivitiRequest applyRequest, User lgoinUser) throws Exception { - //1.获取task - Task curenntTask = workflowService.getTaskService().createTaskQuery().taskId(applyRequest.getTaskId()).singleResult(); - //2.设置批注 - if (applyRequest.getAuditComment() == null) { - applyRequest.setAuditComment(""); - } - workflowService.getTaskService().addComment(curenntTask.getId(), curenntTask.getProcessInstanceId(), applyRequest.getAuditComment()); - // 3.判断后续还有没有审批人节点 - TaskDefinition taskDefinition = kpiWorkflowService.getNextTaskInfo(curenntTask.getId()); - //4.判断审核结果决定走向 - - // 没有,则 - KpiApplyBiz kpiApplyBiz = kpiApplyBizService.selectById(applyRequest.getBizId()); - KpiPeriodInstance instance = kpiPeriodInstanceService.selectById(kpiApplyBiz.getPeriodInstanceId()); - List kpiPlanStaffs = kpiPlanStaffService.selectPageListByCreateUserIdAndApplyBizId(kpiApplyBiz.getCreateUserId(), kpiApplyBiz.getId()); - - if ("0".equals(applyRequest.getPass())) { - //驳回 - Map map = new HashMap<>(); - map.put("pass", 0); - map.put("jobLevelType", instance.getJobType()); - map.put(CommString.ACTI_KEK_Assignee, kpiApplyBiz.getUserIdForRejectTo()); - map.put(CommString.ACTI_KEK_Candidate_Users, kpiApplyBiz.getUserIdForRejectTo()); - workflowService.getTaskService().complete(curenntTask.getId(), map); - - kpiApplyBiz.setMarker(kpiApplyBizService.markersUpdateReject(kpiApplyBiz)); - kpiApplyBiz.setRejectionComment(applyRequest.getAuditComment()); - kpiApplyBiz.setUpdateTime(DateUtil.toStr(null, new Date())); - - - //判断评分流程是否结束 - Execution execution = workflowService.getRuntimeService().createExecutionQuery().processInstanceId(curenntTask.getProcessInstanceId()).singleResult(); - if (Objects.isNull(execution)) { - //流程结束,更细你状态 - kpiApplyBiz.setStatus(KpiApplyStatusEnum.PlanReject.getId()); - } - kpiPlanStaffDao.updateStatusByApplyBizId(kpiApplyBiz); - } else { - // 同意 - kpiApplyBiz.setMarker(kpiApplyBizService.markersUpdate(lgoinUser.getId(), kpiApplyBiz)); - if (taskDefinition != null) { - //有,则获取当前任务并设置审批人(即设置后续的审批人) - ProcessInstanceQuery processInstanceQuery = workflowService.getRuntimeService().createProcessInstanceQuery().processInstanceId(curenntTask.getProcessInstanceId()); - Map map2 = processInstanceQuery.singleResult().getProcessVariables(); - map2.put("pass", 1); - map2.put("jobLevelType", instance.getJobType()); - map2.put(CommString.ACTI_KEK_Assignee, applyRequest.getAuditorId()); - map2.put(CommString.ACTI_KEK_Candidate_Users, applyRequest.getAuditorId()); - //通过 - workflowService.getTaskService().complete(curenntTask.getId(), map2); - } else { - //通过 - workflowService.getTaskService().complete(curenntTask.getId()); - - // 审批完成 - kpiApplyBiz.setStatus(KpiApplyStatusEnum.PlanMarked.getId()); - kpiApplyBiz.setUpdateTime(DateUtil.toStr(null, new Date())); - kpiPlanStaffDao.updateStatusByApplyBizId(kpiApplyBiz); - - // 统计综合结果 - - // 给直接上级 - msgService.insertMsgSend(KpiConstant.MSG_TYPE_KPI, - "【" + instance.getPeriodName() + "】的绩效考核评分工作已完成。", - kpiApplyBiz.getCreateUserId(), - lgoinUser.getId(), "U"); - - - for (KpiPlanStaff staff : kpiPlanStaffs) { - resultPointCalculate(staff, instance); - // 通知给所有的被考核对象 - msgService.insertMsgSend(KpiConstant.MSG_TYPE_KPI, - "【" + instance.getPeriodName() + "】的绩效考核评分工作已完成,可以在绩效考核记录进行查询考核结果。", - staff.getObjUserId(), - kpiApplyBiz.getCreateUserId(), "U"); - } - - } - } - kpiApplyBiz.setRejectionComment(applyRequest.getAuditComment()); - kpiApplyBizDao.updateByPrimaryKeySelective(kpiApplyBiz); - return Result.success(); - } - - - /** - * 计算评分结果 - * - * @param kpiPlanStaff - * @param instance - * @return - * @author lichen - * @date 2021/10/21 11:00 - **/ - private void resultPointCalculate(KpiPlanStaff kpiPlanStaff, KpiPeriodInstance instance) { - // 获取单列得分信息 - KpiResult kpiResult = this.selectByKpiPlanStaffId(kpiPlanStaff.getId()); - // 获取所有考核指标 - List kpiPlanStaffDetailList = kpiPlanStaffDetailService.selectListByPlanStaffId(kpiPlanStaff.getId()); - // 四维度最终得分 - BigDecimal dimension_point = new BigDecimal("0.00"); - // 计算每一个指标的总得分 - for (KpiPlanStaffDetail item : kpiPlanStaffDetailList) { - // 1.获取每一个指标的结果得分与过程得分 - List kpiResultIndicatorList = - kpiResultIndicatorService.selectListByPlanStaffDetailId(item.getId()); - // 2.计算权重得分 - int[] auditorLevelWeightRate; - if (kpiResultIndicatorList.size() == 2) { - auditorLevelWeightRate = KpiConstant.MARK_LEVEL_2_WEIGHT; - } else if (kpiResultIndicatorList.size() == 3) { - auditorLevelWeightRate = KpiConstant.MARK_LEVEL_3_WEIGHT; - } else if (kpiDimensionService.selectById(item.getDimensionId()).getDimensionName().equals(KpiConstant.SPECIAL_DIMENSION)) { - auditorLevelWeightRate = new int[]{100}; - } else { - throw new RuntimeException(); - } - // 结果得分*结果权重(单个评价人) - BigDecimal resultPoint; - // 过程得分*过程权重(单个评价人) - BigDecimal processPoint; - // (结果权重+过程权重)* 审批人层级的权重 (单个评价人) - BigDecimal oneAuditorPoint; - // 单项考核指标权重 - BigDecimal weightSum = new BigDecimal("0.00"); - // 多个人的权重 - for (int i = 0; i < kpiResultIndicatorList.size(); i++) { - if (PeriodTypeEnum.Year.getId() != instance.getPeriodType()) { - resultPoint = kpiResultIndicatorList.get(i).getResultPoint().multiply(BigDecimal.valueOf(KpiConstant.RESULT_PROCESS_WEIGHT[0])).multiply(new BigDecimal("0.01")); - processPoint = kpiResultIndicatorList.get(i).getProcessPoint().multiply(BigDecimal.valueOf(KpiConstant.RESULT_PROCESS_WEIGHT[1])).multiply(new BigDecimal("0.01")); - oneAuditorPoint = resultPoint.add(processPoint); - } else { - // 年度考核的时候不分结果和过程,全看结果的分数 - resultPoint = kpiResultIndicatorList.get(i).getResultPoint(); - oneAuditorPoint = resultPoint; - } - BigDecimal oneAuditorWeihgtPoint = oneAuditorPoint.multiply(BigDecimal.valueOf(auditorLevelWeightRate[i])).multiply(new BigDecimal("0.01")); - weightSum = weightSum.add(oneAuditorWeihgtPoint); - } - weightSum = weightSum.multiply(item.getIndicatorWeight()).multiply(new BigDecimal("0.01")); - // 每一项的权重得分插入权重得分表 - KpiResultIndicatorWeight kpiResultIndicatorWeight = kpiResultIndicatorWeightService.selectByPlanStaffDetailId(item.getId()); - if (kpiResultIndicatorWeight == null) { - kpiResultIndicatorWeight = new KpiResultIndicatorWeight(); - kpiResultIndicatorWeight.setPlanStaffDetailId(item.getId()); - kpiResultIndicatorWeight.setWeightPoint(weightSum); - kpiResultIndicatorWeightService.save(kpiResultIndicatorWeight); - } else { - kpiResultIndicatorWeight.setWeightPoint(weightSum); - String whereStr = "where plan_staff_detail_id = '" + item.getId() + "'"; - kpiResultIndicatorWeight.setWhere(whereStr); - kpiResultIndicatorWeightService.update(kpiResultIndicatorWeight); - } - - // 累加每个考核指标的权重后得分 - dimension_point = dimension_point.add(weightSum); - } - // 计算最终得分 - kpiResult.setDimensionPoint(dimension_point); - kpiResult.setResultPoint(dimension_point.add(kpiResult.getSingleIndicatorPoint())); - kpiResult.setResultLevel(KpiUtils.getResultLevelString(dimension_point)); - this.update(kpiResult); - } - - /** - * 查询指定部门和考核周期的考核结果列表 - * - * @return - * @author lichen - * @date 2021/10/26 10:58 - **/ - public List selectListByPeriod(KpiResultStatisticsListRequest resultStatisticsListRequest, Unit unit) { - // 部门下面的人员(包括子部门) - List userList = unitService.getChildrenUsersById(resultStatisticsListRequest.getDeptId()); - String users = ""; - for (User user : userList) { - users += "'" + user.getId() + "',"; - } - if (users.length() > 1) { - users = users.substring(0, users.length() - 1); - } else { - return new ArrayList<>(); - } - resultStatisticsListRequest.setUsers(users); - List statisticsList = kpiResultDao.selectListByPeriodAndObjUserIds(resultStatisticsListRequest); - for (int i = 0; i < statisticsList.size(); i++) { - statisticsList.get(i).setRowNo(i + 1); - statisticsList.get(i).setDeptName(unit.getName()); - statisticsList.get(i).setResultLevel(KpiUtils.getResultLevelString(statisticsList.get(i).getResultPoint())); - statisticsList.get(i).setResultLevelCoefficient(KpiUtils.getResultLevelCoefficient(statisticsList.get(i).getResultPoint())); - } - return statisticsList; - } - - - /** - * 获取得分列表以外的统计情报 - * - * @return - * @author lichen - * @date 2021/10/26 11:48 - **/ - public KpiResultStatisticsInfo selectStatisticsInfo(KpiResultStatisticsListRequest resultStatisticsListRequest, List resultStatisticsList, Unit unit) { - - // 考核周期 - String periodName = KpiUtils.getPeriodName(resultStatisticsListRequest.getPeriodYear(), resultStatisticsListRequest.getPeriodType(), resultStatisticsListRequest.getPeriodNo()); - - KpiResultStatisticsInfo kpiResultStatisticsInfo = new KpiResultStatisticsInfo(); - kpiResultStatisticsInfo.setDeptName(unit.getName()); - kpiResultStatisticsInfo.setPeriodName(periodName); - kpiResultStatisticsInfo.setUserNumber(resultStatisticsList.size()); - KpiUtils.getPointLevelInfo(resultStatisticsList, kpiResultStatisticsInfo); - return kpiResultStatisticsInfo; - } - - /** - * 当年非年度考核的平均得分 - * - * @return - * @author lichen - * @date 2021/10/26 15:20 - **/ - public BigDecimal resultAvgPointByYear(String objUserId, String periodYear) { - KpiYearAvgResponse map = kpiResultDao.resultAvgPointByYear(objUserId, periodYear); - // 如果当年除了年度考核以外没有其它考核,就应该按照满分来算。 - if (map == null) { - return new BigDecimal("100"); - } - return map.getAvgPoint(); - } - - /** - * 获取计划制定和审定信息 - * - * @return - * @author lichen - * @date 2021/10/29 10:51 - **/ - public List getPlanMakeInfo(KpiPlanStaff kpiPlanStaff, String processKey) { - processKey = processKey + "-" + kpiPlanStaff.getUnitId(); - List list = new ArrayList<>(); - - List processDefinitions = - workflowProcessDefinitionService.getProcessDefsBykey(processKey); - if (processDefinitions == null || processDefinitions.size() == 0) { - throw new RuntimeException("缺少该流程定义。"); - } - List taskList = workflowService.getHistoryService().createHistoricTaskInstanceQuery() - .processDefinitionKey(processKey) - .processInstanceBusinessKey(kpiPlanStaff.getId()) - .finished() - .list(); - for (HistoricTaskInstance task : taskList) { - KpiResultDetailInfo.KpiResultDetailAuditInfo bean = new KpiResultDetailInfo.KpiResultDetailAuditInfo(); - bean.setTaskName(task.getName()); - bean.setUserName(userService.getUserById(task.getAssignee()).getCaption()); - bean.setDate(DateUtil.toStr(null, task.getEndTime())); - list.add(bean); - } - Collections.sort(list, new Comparator() { - @Override - public int compare(KpiResultDetailInfo.KpiResultDetailAuditInfo o1, KpiResultDetailInfo.KpiResultDetailAuditInfo o2) { - // 升序 - //return o1.getAge()-o2.getAge(); - return o1.getDate().compareTo(o2.getDate()); - // 降序 - // return o2.getAge()-o1.getAge(); - // return o2.getAge().compareTo(o1.getAge()); - } - }); - return list; - } - - public List selectResultList(KpiResultQuery query) { - return kpiResultDao.selectResultList(query); - } -} \ No newline at end of file diff --git a/src/com/sipai/service/maintenance/AbnormityService.java b/src/com/sipai/service/maintenance/AbnormityService.java deleted file mode 100644 index 0500150f..00000000 --- a/src/com/sipai/service/maintenance/AbnormityService.java +++ /dev/null @@ -1,975 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.enums.AbnormityTypeEnum; -import com.sipai.entity.enums.AbnormityStatusEnum; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.timeefficiency.PatrolRecordPatrolRouteService; -import com.sipai.service.timeefficiency.PatrolRecordService; - -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.*; -import com.sipai.tools.DateUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.AbnormityDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; - -@Service("abnormityService") -public class AbnormityService implements CommService { - @Resource - private AbnormityDao abnormityDao; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private RuntimeService runtimeService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private CompanyService companyService; - @Resource - private PatrolRecordPatrolRouteService patrolRecordPatrolRouteService; - - @Override - public Abnormity selectById(String id) { - Abnormity abnormity = this.abnormityDao.selectByPrimaryKey(id); - if (abnormity != null) { - Company company = this.unitService.getCompById(abnormity.getBizId()); - abnormity.setCompany(company); - User user = userService.getUserById(abnormity.getInsuser()); - abnormity.setInsertUser(user); - abnormity.setStatusText(AbnormityStatusEnum.getNameByid(abnormity.getStatus())); - - //异常接收人员(多个) - if (abnormity.getReceiveUserId() != null && !abnormity.getReceiveUserId().equals("")) { - String[] userIds = abnormity.getReceiveUserId().split(","); - if (userIds != null && userIds.length > 0) { - String names = ""; - for (int i = 0; i < userIds.length; i++) { - User user1 = userService.getUserById(userIds[i]); - if (user1 != null) { - names += user1.getCaption() + "、"; - } - } - if (!names.equals("")) { - names = names.substring(0, names.length() - 1); - abnormity.set_receiveUserName(names); - } - } - } - - //根据工艺段unitid和code查询 - List list_processSection = processSectionService.selectListByWhere("where unit_id = '" + abnormity.getBizId() + "' and code = '" + abnormity.getProcessSectionId() + "'"); - if (list_processSection != null && list_processSection.size() > 0) { - abnormity.setProcessSection(list_processSection.get(0)); - } - - if (abnormity.getEquipmentIds() != null && !abnormity.getEquipmentIds().equals("")) { - String[] equipmentIdStr = abnormity.getEquipmentIds().split(","); - String equipmentNames = ""; - for (int i = 0; i < equipmentIdStr.length; i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentIdStr[i]); - if (equipmentCard != null) { - if (equipmentNames != "") { - equipmentNames += ","; - } - equipmentNames += equipmentCard.getEquipmentname(); - } - } - abnormity.setEquipmentNames(equipmentNames); - } - } - return abnormity; - } - - public Abnormity selectSimpleById(String id) { - Abnormity abnormity = this.abnormityDao.selectByPrimaryKey(id); - if (abnormity != null) { - User user = userService.getUserById(abnormity.getInsuser()); - abnormity.setInsertUser(user); - } - return abnormity; - } - - @Override - public int deleteById(String id) { - return this.abnormityDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Abnormity abnormity) { - return this.abnormityDao.insert(abnormity); - } - - @Override - public int update(Abnormity abnormity) { - return this.abnormityDao.updateByPrimaryKeySelective(abnormity); - } - - @Override - public List selectListByWhere(String wherestr) { - Abnormity abnormity = new Abnormity(); - abnormity.setWhere(wherestr); - List list = this.abnormityDao.selectListByWhere(abnormity); - for (Abnormity item : list) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); -// ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); -// item.setProcessSection(processSection); - - //根据工艺段unitid和code查询 - List list_processSection = processSectionService.selectListByWhere("where unit_id = '" + item.getBizId() + "' and code = '" + item.getProcessSectionId() + "'"); - if (list_processSection != null && list_processSection.size() > 0) { - item.setProcessSection(list_processSection.get(0)); - } - -// List maintenanceDetail = this.maintenanceDetailService.selectListByWhere("where abnormity_id like '%" + item.getId() + "%'"); -// if (maintenanceDetail != null && maintenanceDetail.size() > 0) { -// item.setMaintenanceDetail(maintenanceDetail.get(0)); -// } - - if (!"".equals(item.getEquipmentIds()) && null != item.getEquipmentIds()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentIds()); - if (equipmentCard != null) { - item.setEquipmentNames(equipmentCard.getEquipmentname()); - item.setEquipmentCardId(equipmentCard.getEquipmentcardid()); - } - } - /*2019-02-27 YYJ 添加 insuser的实体类*/ - User user = this.userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - } - return list; - } - - public List selectSimpleListByWhere(String wherestr) { - Abnormity abnormity = new Abnormity(); - abnormity.setWhere(wherestr); - List list = this.abnormityDao.selectListByWhere(abnormity); - return list; - } - - public Abnormity countListByWhere(String wherestr) { - Abnormity entity = new Abnormity(); - entity.setWhere(wherestr); - return abnormityDao.countListByWhere(entity); - } - - public List selectListByWhere20200831(String wherestr) { - Abnormity abnormity = new Abnormity(); - abnormity.setWhere(wherestr); - List list = this.abnormityDao.selectListByWhere20200831(abnormity); - for (Abnormity item : list) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); - item.setProcessSection(processSection); - - List maintenanceDetail = this.maintenanceDetailService.selectListByWhere("where abnormity_id like '%" + item.getId() + "%'"); - if (maintenanceDetail != null && maintenanceDetail.size() > 0) { - item.setMaintenanceDetail(maintenanceDetail.get(0)); - } - - if (!"".equals(item.getEquipmentIds()) && null != item.getEquipmentIds()) { - String[] equipmentIdStr = item.getEquipmentIds().split(","); - String equipmentNames = ""; - for (int i = 0; i < equipmentIdStr.length; i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentIdStr[i]); - if (equipmentCard != null) { - if (equipmentNames != "") { - equipmentNames += ","; - } - equipmentNames += equipmentCard.getEquipmentname(); - } - } - item.setEquipmentNames(equipmentNames); - } - /*2019-02-27 YYJ 添加 insuser的实体类*/ - User user = this.userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - } - return list; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - Abnormity abnormity = new Abnormity(); - abnormity.setWhere(wherestr); - - List abnormities = this.selectListByWhere(wherestr); - for (Abnormity item : abnormities) { - String pInstancId = item.getProcessid(); - if (pInstancId != null) { - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + item.getId() + "'"); - } - } - - return this.abnormityDao.deleteByWhere(abnormity); - } - - /** - * 去除数组中重复的元素,参数为字符串,返回字符串 - */ - @SuppressWarnings({"unchecked", "rawtypes"}) - public String deleteRepeatElement(String str) { - String[] strArr = str.split(","); - Set set = new HashSet(); - for (int i = 0; i < strArr.length; i++) { - set.add(strArr[i]); - } - Object[] objectArr = set.toArray(); - return org.apache.commons.lang3.StringUtils.join(objectArr, ","); - - } - - /** - * 有设备的异常生成维修处理 - * 没有设备的异常生成缺陷处理 - */ - @Transactional - public int createDefect(String ids, MaintenanceDetail maintenanceDetail) { - try { - ids = ids.replace(",", "','"); - List list = this.selectListByWhere("where id in ('" + ids + "')"); - String equipmentIds = ""; - String pSectionIds = ""; - String problemContent = ""; - for (Abnormity abnormity : list) { - if (abnormity.getEquipmentIds() != null && !abnormity.getEquipmentIds().isEmpty()) { - if (equipmentIds != "") { - equipmentIds += ","; - } - equipmentIds += abnormity.getEquipmentIds(); - } - if (pSectionIds != "") { - pSectionIds += ","; - } - pSectionIds += abnormity.getProcessSectionId(); - if (problemContent != "") { - problemContent += ";"; - } - problemContent += abnormity.getAbnormityDescription(); - - } - equipmentIds = this.deleteRepeatElement(equipmentIds); - pSectionIds = this.deleteRepeatElement(pSectionIds); - - Date nowTime = new Date(); - //当前时间,加时分秒毫秒 - SimpleDateFormat sdformat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); - String dateStr = sdformat.format(nowTime); - //当前日期 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - maintenanceDetail.setCompanyid(list.get(0).getBizId()); - maintenanceDetail.setEquipmentId(equipmentIds); - maintenanceDetail.setProcessSectionId(pSectionIds); - Company company = new Company(); - if (null != maintenanceDetail.getCompanyid() && !maintenanceDetail.getCompanyid().isEmpty()) { - company = this.unitService.getCompById(maintenanceDetail.getCompanyid()); - } - - //无设备生成缺陷,有设备生成维修 - if (equipmentIds.equals("")) { - maintenanceDetail.setType(MaintenanceCommString.MAINTENANCE_TYPE_DEFECT); - maintenanceDetail.setDetailNumber(company.getEname() + "-QXJL-" + dateStr); - } else { - maintenanceDetail.setType(MaintenanceCommString.MAINTENANCE_TYPE_REPAIR); - maintenanceDetail.setDetailNumber(company.getEname() + "-SBWX-" + dateStr); - } - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - - /*List users = roleService.getRoleUsers("where serial='"+PatrolType.Product.getId()+"' and bizid='"+list.get(0).getBizId()+"'"); - String userIds=""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds+=","; - } - userIds+=user.getId(); - }*/ - maintenanceDetail.setSolver(maintenanceDetail.getSolver()); - maintenanceDetail.setProblemcontent(problemContent); - maintenanceDetail.setAbnormityId(ids); - int result = this.maintenanceDetailService.start(maintenanceDetail); - if (result == 1) { - //保存异常和缺陷的关系 - for (Abnormity abnormity : list) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setId(CommUtil.getUUID()); - planRecordAbnormity.setInsdt(CommUtil.nowDate()); - planRecordAbnormity.setFatherId(abnormity.getId()); - planRecordAbnormity.setSonId(maintenanceDetail.getId()); - result += planRecordAbnormityService.save(planRecordAbnormity); - //设置异常的状态为处理中 - abnormity.setStatus(MaintenanceDetail.Status_Start); - this.update(abnormity); - } - return result; - } else { - return result; - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 查询指定条件的异常数量 去除其他循环查询 sj 2020-04-27 - */ - public JSONArray selectListByNum(String wherestr, String unitId, String dateType, String reportDate, String pSectionId) { - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - JSONObject jsonObjectForP = new JSONObject();//运行异常 - JSONObject jsonObjectForE = new JSONObject();//运行异常 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - - for (int i = 0; i < 12; i++) { - jsonObjectForP.put((i + 1) + "月", "0"); - jsonObjectForE.put((i + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - - String yearStr = reportDate.substring(0, 4); - String monthStr = reportDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int i = 0; i < maxDay; i++) { - jsonObjectForP.put((i + 1), "0"); - jsonObjectForE.put((i + 1), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - - for (int i = 0; i < 24; i++) { - jsonObjectForP.put(reportDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObjectForE.put(reportDate.substring(0, 10) + " " + (i + 1), "0"); - } - } - String sqlstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - //部门筛选 - if (unitIds != null && !unitIds.equals("")) { - sqlstr += " and biz_id in (" + unitIds + ")"; - } - //工艺段筛选 - if (pSectionId != null && !pSectionId.equals("")) { - sqlstr += " and process_section_id = '" + pSectionId + "' "; - } - //运行异常 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + reportDate + "')=0 " - + "and (equipment_ids is null or equipment_ids ='') " + sqlstr; - List listP = this.abnormityDao.selectListByNum(wherestr, str); - if (listP != null && listP.size() > 0) { - for (int i = 0; i < listP.size(); i++) { - if ("year".equals(dateType)) { - jsonObjectForP.put(Integer.valueOf(listP.get(i).get_date().substring(5, listP.get(i).get_date().length())) + "月", listP.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObjectForP.put(Integer.valueOf(listP.get(i).get_date().substring(8, listP.get(i).get_date().length())), listP.get(i).get_num()); - } else { - jsonObjectForP.put(listP.get(i).get_date(), listP.get(i).get_num()); - } - } - } - //设备异常 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + reportDate + "')=0 " - + "and (equipment_ids is not null and equipment_ids !='') " + sqlstr; - List listE = this.abnormityDao.selectListByNum(wherestr, str); - if (listE != null && listE.size() > 0) { - for (int i = 0; i < listE.size(); i++) { - if ("year".equals(dateType)) { - jsonObjectForE.put(Integer.valueOf(listE.get(i).get_date().substring(5, listE.get(i).get_date().length())) + "月", listE.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObjectForE.put(Integer.valueOf(listE.get(i).get_date().substring(8, listE.get(i).get_date().length())), listE.get(i).get_num()); - } else { - jsonObjectForE.put(listE.get(i).get_date(), listE.get(i).get_num()); - } - } - } - - jsonObject.put("pdata", jsonObjectForP);//运行异常 - jsonObject.put("edata", jsonObjectForE);//设备异常 - jsonArray.add(jsonObject); - return jsonArray; - } - - /** - * 查询指定条件的异常列表 sj 2020-05-29 - */ - public List selectListByNumByDate(String wherestr, String unitId, String dateType, String reportDate, String type) { - String dateTypeStr = "";//用于DateDiff函数日期类型 - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - unitstr += " and biz_id in (" + unitIds + ")"; - } - - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - } - - //运行异常 - if (type != null && type.equals(TimeEfficiencyCommStr.PatrolType_Product)) { - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + reportDate + "')=0 " - + "and (equipment_ids is null or equipment_ids ='') " + unitstr; - } - //设备异常 - if (type != null && type.equals(TimeEfficiencyCommStr.PatrolType_Equipment)) { - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + reportDate + "')=0 " - + "and (equipment_ids is not null and equipment_ids !='') " + unitstr; - } - Abnormity abnormity = new Abnormity(); - abnormity.setWhere(wherestr); - List list = this.abnormityDao.selectListByWhere(abnormity); - for (Abnormity item : list) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - - String[] equipmentIdStr = item.getEquipmentIds().split(","); - String equipmentNames = ""; - for (int i = 0; i < equipmentIdStr.length; i++) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentIdStr[i]); - if (equipmentCard != null) { - if (equipmentNames != "") { - equipmentNames += ","; - } - equipmentNames += equipmentCard.getEquipmentname(); - } - } - item.setEquipmentNames(equipmentNames); - - /*2019-02-27 YYJ 添加 insuser的实体类*/ - User user = this.userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - } - return list; - } - - /** - * 递归获取子节点 - * - * @param - */ - public List getChildren(String pid, List t) { - List t2 = new ArrayList(); - for (int i = 0; i < t.size(); i++) { - if (t.get(i).getPid() != null && t.get(i).getPid().equalsIgnoreCase(pid)) { - if (t.get(i).getType().equals(CommString.UNIT_TYPE_WORKSHOP)) { - t2.add(t.get(i)); - List result = getChildren(t.get(i).getId(), t); - if (result != null) { - t2.addAll(result); - } - } - } - } - return t2; - } - - @Transactional - public int start(Abnormity entity) { - try { - Map variables = new HashMap(); - if (entity.getReceiveUserId() != null && !entity.getReceiveUserId().isEmpty()) { - variables.put(CommString.ACTI_KEK_Candidate_Users, entity.getReceiveUserId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - - List processDefinitions = null; - - if (entity.getType() != null && entity.getType().equals(Abnormity.Type_Run)) { - //运行异常 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Workorder_Abnormity_Run.getId() + "-" + entity.getBizId()); - } - if (entity.getType() != null && entity.getType().equals(Abnormity.Type_Equipment)) { - //设备异常 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Workorder_Abnormity_Equipment.getId() + "-" + entity.getBizId()); - } - if (entity.getType() != null && entity.getType().equals(Abnormity.Type_Facilities)) { - //设施异常 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Workorder_Abnormity_Facilities.getId() + "-" + entity.getBizId()); - } - - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(entity.getId(), entity.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - - //在app首页进行异常上报时查询是否有时间范围内的巡检任务,有的话自动进行关联 - try { - if (entity.getPatrolRecordId() == null) { - List list = patrolRecordService.selectSimpleListByWhere("where unit_id = '" + entity.getBizId() + "' and start_time<='" + CommUtil.nowDate() + "' and '" + CommUtil.nowDate() + "' <=end_time "); - if (list != null && list.size() > 0) { - for (PatrolRecord patrolRecord : list) { - List list2 = patrolRecordPatrolRouteService.selectSimpleListByWhere("where patrol_record_id='" + patrolRecord.getId() + "' and worker_id = '" + entity.getInsuser() + "' "); - if (list2 != null && list2.size() > 0) { - entity.setPatrolRecordId(patrolRecord.getId()); - break; - } - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = abnormityDao.insert(entity); - if (res == 1) { - - } - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecord.sendMessage(entity.getReceiveUserId(), ""); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 非抢单 - * - * @param id - * @param cu - * @param receiveIds - * @return - */ - @Transactional - public int updateStatus(String id, User cu, String receiveIds, String planDate) { - Abnormity entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { -// entity.setStatus(Abnormity.Status_Start); - entity.setStatus(Abnormity.Status_Processing); - //结束流程后 创建对应的工单 - if (entity != null) { - switch (entity.getType()) { - case Abnormity.Type_Run: - System.out.println("创建缺陷工单"); - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setId(CommUtil.getUUID()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setInsuser(cu.getId()); - maintenanceDetail.setPlannedenddt(null); - maintenanceDetail.setSolver(receiveIds); - maintenanceDetail.setEquipmentCardIds(null); - createDefect(id, maintenanceDetail); - break; - case Abnormity.Type_Equipment: - System.out.println("创建设备维修工单"); - WorkorderDetail workorderDetail = new WorkorderDetail(); - workorderDetail.setId(CommUtil.getUUID()); - workorderDetail.setInsuser(cu.getId()); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Start); - workorderDetail.setUnitId(entity.getBizId()); - Company company = unitService.getCompById(entity.getBizId()); - if (company != null) { - String jobNumber = company.getEname() + "-WXGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - workorderDetail.setJobNumber(jobNumber); - } - workorderDetail.setJobName("临时维修"); - workorderDetail.setType(WorkorderDetail.REPAIR); - workorderDetail.setRepairPlanType(WorkorderDetail.planOut); - workorderDetail.setRepairType(WorkorderDetail.smallRepair); - workorderDetail.setReceiveUserId(receiveIds); - workorderDetail.setEquipmentId(entity.getEquipmentIds()); - workorderDetail.setPlanDate(planDate); - workorderDetail.setFaultDescription(entity.getAbnormityDescription()); - workorderDetail.setSchemeResume(null); - workorderDetail.setStatus(WorkorderDetail.Status_Start); - workorderDetail.setAbnormityId(id); - workorderDetailService.startWorkorderDetail(id, workorderDetail); - break; - case Abnormity.Type_Facilities: - System.out.println("创建设施维修工单"); - - break; - default: - // - } - } - } - int res = this.update(entity); - return res; - } - - /** - * 抢单 - * - * @param id - * @param cu - * @param receiveIds - * @return - */ - @Transactional - public int updateStatusCompete(String id, User cu, String receiveIds, String planDate) { - Abnormity entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { -// entity.setStatus(Abnormity.Status_Start); - entity.setStatus(Abnormity.Status_Processing); - //结束流程后 创建对应的工单 - if (entity != null) { - switch (entity.getType()) { - case Abnormity.Type_Run: - System.out.println("创建缺陷工单"); - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setId(CommUtil.getUUID()); - maintenanceDetail.setInsdt(CommUtil.nowDate()); - maintenanceDetail.setInsuser(cu.getId()); - maintenanceDetail.setPlannedenddt(null); - maintenanceDetail.setSolver(receiveIds); - maintenanceDetail.setEquipmentCardIds(null); - createDefect(id, maintenanceDetail); - break; - case Abnormity.Type_Equipment: - System.out.println("创建设备维修工单"); - WorkorderDetail workorderDetail = new WorkorderDetail(); - workorderDetail.setId(CommUtil.getUUID()); - workorderDetail.setInsuser(cu.getId()); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Start); - workorderDetail.setUnitId(entity.getBizId()); - Company company = unitService.getCompById(entity.getBizId()); - if (company != null) { - String jobNumber = company.getEname() + "-WXGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - workorderDetail.setJobNumber(jobNumber); - } - workorderDetail.setJobName("临时维修"); - workorderDetail.setType(WorkorderDetail.REPAIR); - workorderDetail.setRepairPlanType(WorkorderDetail.planOut); - workorderDetail.setRepairType(WorkorderDetail.smallRepair); - workorderDetail.setReceiveUserId(receiveIds); - workorderDetail.setEquipmentId(entity.getEquipmentIds()); - workorderDetail.setPlanDate(planDate); - workorderDetail.setFaultDescription(entity.getAbnormityDescription()); - workorderDetail.setSchemeResume(null); - workorderDetail.setStatus(WorkorderDetail.Status_Compete); - workorderDetail.setIsCompete(CommString.Active_True);//抢单 - workorderDetail.setCompeteTeamIds(receiveIds); - workorderDetail.setAbnormityId(id); - workorderDetailService.save(workorderDetail); -// workorderDetailService.startWorkorderDetail(id,workorderDetail); - break; - case Abnormity.Type_Facilities: - System.out.println("创建设施维修工单"); - break; - default: - - } - } - } - int res = this.update(entity); - return res; - } - - /** - * 异常下发导出 - * - * @param response - * @param unitId - * @throws IOException - */ - public void doExport(String unitId, HttpServletRequest request, - HttpServletResponse response - ) throws IOException { - - String fileName = "异常上报.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "异常上报"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 8000); - sheet.setColumnWidth(6, 4000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "所属厂区,工艺段,异常描述,类型,上报人,上报时间,状态"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("异常上报"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - String mpidss = request.getParameter("ids"); - Abnormity entity = new Abnormity(); - List list = new ArrayList<>(); - if (org.apache.commons.lang3.StringUtils.isNotBlank(mpidss)) { - mpidss = mpidss.substring(0, mpidss.length() - 1); - mpidss = mpidss.replace(",", "','"); - list = this.selectListByWhere("where id in ('" + mpidss + "')"); - } - - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(2 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - list.get(i).setCompany(companyService.selectByPrimaryKey(unitId)); - - //所属厂区 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getCompany().getName()) ? list.get(i).getCompany().getName() : ""); - //工艺段 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getProcessSection().getName()) ? list.get(i).getProcessSection().getName() : ""); - //异常描述 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getAbnormityDescription()) ? list.get(i).getAbnormityDescription() : ""); - //类型 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getType()) ? AbnormityTypeEnum.getNameByid(list.get(i).getType()) : ""); - //上报人 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getInsertUser().getCaption()) ? list.get(i).getInsertUser().getCaption() : ""); - //上报时间 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getInsdt()) ? list.get(i).getInsdt() : ""); - //状态 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getStatus()) ? AbnormityStatusEnum.getNameByid(list.get(i).getStatus()) : ""); - } - - int rownum = 2;//第2行开始 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - for (Iterator iter = jsonObject2.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - -} diff --git a/src/com/sipai/service/maintenance/AnticorrosiveLibraryEquipmentService.java b/src/com/sipai/service/maintenance/AnticorrosiveLibraryEquipmentService.java deleted file mode 100644 index 2b3276d2..00000000 --- a/src/com/sipai/service/maintenance/AnticorrosiveLibraryEquipmentService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.AnticorrosiveLibraryEquipment; - -public interface AnticorrosiveLibraryEquipmentService { - - public abstract AnticorrosiveLibraryEquipment selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AnticorrosiveLibraryEquipment entity); - - public abstract int update(AnticorrosiveLibraryEquipment entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/AnticorrosiveLibraryMaterialService.java b/src/com/sipai/service/maintenance/AnticorrosiveLibraryMaterialService.java deleted file mode 100644 index db2e3a82..00000000 --- a/src/com/sipai/service/maintenance/AnticorrosiveLibraryMaterialService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.AnticorrosiveLibraryMaterial; - -public interface AnticorrosiveLibraryMaterialService { - - public abstract AnticorrosiveLibraryMaterial selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AnticorrosiveLibraryMaterial entity); - - public abstract int update(AnticorrosiveLibraryMaterial entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/AnticorrosiveLibraryService.java b/src/com/sipai/service/maintenance/AnticorrosiveLibraryService.java deleted file mode 100644 index 151abab3..00000000 --- a/src/com/sipai/service/maintenance/AnticorrosiveLibraryService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; - -public interface AnticorrosiveLibraryService { - - public abstract AnticorrosiveLibrary selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AnticorrosiveLibrary entity); - - public abstract int update(AnticorrosiveLibrary entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/AnticorrosiveMaterialService.java b/src/com/sipai/service/maintenance/AnticorrosiveMaterialService.java deleted file mode 100644 index 0e547b67..00000000 --- a/src/com/sipai/service/maintenance/AnticorrosiveMaterialService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.AnticorrosiveMaterial; - -public interface AnticorrosiveMaterialService { - - public abstract AnticorrosiveMaterial selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(AnticorrosiveMaterial entity); - - public abstract int update(AnticorrosiveMaterial entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/EquipmentPlanEquService.java b/src/com/sipai/service/maintenance/EquipmentPlanEquService.java deleted file mode 100644 index c329741b..00000000 --- a/src/com/sipai/service/maintenance/EquipmentPlanEquService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.EquipmentPlanEqu; - -public interface EquipmentPlanEquService { - - public abstract EquipmentPlanEqu selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EquipmentPlanEqu entity); - - public abstract int update(EquipmentPlanEqu entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListByWhereSP(String wherestr); - - public abstract List selectListByWhereWithEqu(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract EquipmentPlanEqu selectByWhere(String wherestr); - - /** - * 批量下发 普通单子 - * - * @param ids 工单id - * @param userIds 人员id - * @return - */ - public abstract int issue(String ids, String userIds); - - /** - * 批量下发 抢单 - * - * @param ids - * @param userIds - * @return - */ - public abstract int iscompete(String ids, String competeTeamIds); -} diff --git a/src/com/sipai/service/maintenance/EquipmentPlanMainYearDetailService.java b/src/com/sipai/service/maintenance/EquipmentPlanMainYearDetailService.java deleted file mode 100644 index a2d741bc..00000000 --- a/src/com/sipai/service/maintenance/EquipmentPlanMainYearDetailService.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.EquipmentPlanMainYearDetailDao; -import com.sipai.entity.maintenance.EquipmentPlanMainYearDetail; -import com.sipai.entity.user.Company; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentPlanMainYearDetailService implements CommService{ - @Resource - private EquipmentPlanMainYearDetailDao equipmentPlanMainYearDetailDao; - @Resource - private UnitService unitService; - @Resource - private MaintainerService maintainerService; - @Resource - private EquipmentCardService equipmentCardService; - @Override - public EquipmentPlanMainYearDetail selectById(String id) { - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail =equipmentPlanMainYearDetailDao.selectByPrimaryKey(id); - return equipmentPlanMainYearDetail; - } - - @Override - public int deleteById(String id) { - return equipmentPlanMainYearDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentPlanMainYearDetail equipmentPlanMainYearDetail) { - return equipmentPlanMainYearDetailDao.insert(equipmentPlanMainYearDetail); - } - - @Override - public int update(EquipmentPlanMainYearDetail equipmentPlanMainYearDetail) { - return equipmentPlanMainYearDetailDao.updateByPrimaryKeySelective(equipmentPlanMainYearDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail = new EquipmentPlanMainYearDetail(); - equipmentPlanMainYearDetail.setWhere(wherestr); - List equipmentPlanMainYearDetails =equipmentPlanMainYearDetailDao.selectListByWhere(equipmentPlanMainYearDetail); - - return equipmentPlanMainYearDetails; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail = new EquipmentPlanMainYearDetail(); - equipmentPlanMainYearDetail.setWhere(wherestr); - return equipmentPlanMainYearDetailDao.deleteByWhere(equipmentPlanMainYearDetail); - } - - - -} diff --git a/src/com/sipai/service/maintenance/EquipmentPlanMainYearService.java b/src/com/sipai/service/maintenance/EquipmentPlanMainYearService.java deleted file mode 100644 index 323d9ef9..00000000 --- a/src/com/sipai/service/maintenance/EquipmentPlanMainYearService.java +++ /dev/null @@ -1,735 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; - -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.EquipmentPlanMainYearDao; -import com.sipai.dao.maintenance.EquipmentPlanMainYearDetailDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.EquipmentPlanMainYear; -import com.sipai.entity.maintenance.EquipmentPlanMainYearDetail; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class EquipmentPlanMainYearService implements CommService { - @Resource - private EquipmentPlanMainYearDao equipmentPlanMainYearDao; - @Resource - private EquipmentPlanMainYearDetailService equipmentPlanMainYearDetailService; - @Resource - private UnitService unitService; - @Resource - private MaintainerService maintainerService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private UserService userService; - - @Override - public EquipmentPlanMainYear selectById(String id) { - EquipmentPlanMainYear equipmentPlanMainYear = equipmentPlanMainYearDao.selectByPrimaryKey(id); - - equipmentPlanMainYear.setEquipmentCard(this.equipmentCardService.selectById(equipmentPlanMainYear.getEquipmentId())); - equipmentPlanMainYear.setParticularYear(equipmentPlanMainYear.getParticularYear().substring(0, 4)); - - if (equipmentPlanMainYear.getReceiveUserId() != null && !equipmentPlanMainYear.getReceiveUserId().equals("")) { - equipmentPlanMainYear.setReceiveUser(this.userService.getUserById(equipmentPlanMainYear.getReceiveUserId())); - } - - return equipmentPlanMainYear; - } - - @Override - public int deleteById(String id) { - return equipmentPlanMainYearDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentPlanMainYear equipmentPlanMainYear) { - return equipmentPlanMainYearDao.insert(equipmentPlanMainYear); - } - - @Override - public int update(EquipmentPlanMainYear equipmentPlanMainYear) { - return equipmentPlanMainYearDao.updateByPrimaryKeySelective(equipmentPlanMainYear); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentPlanMainYear equipmentPlanMainYear = new EquipmentPlanMainYear(); - equipmentPlanMainYear.setWhere(wherestr); - List equipmentPlanMainYears = equipmentPlanMainYearDao.selectListByWhere(equipmentPlanMainYear); - for (EquipmentPlanMainYear item : equipmentPlanMainYears) { - item.setEquipmentCard(this.equipmentCardService.selectSimpleListById(item.getEquipmentId())); - item.setParticularYear(item.getParticularYear().substring(0, 4)); - item.setEquipmentPlanType(this.equipmentPlanTypeService.selectById(item.getType())); - item.setReceiveUser(this.userService.getUserById(item.getReceiveUserId())); - } - return equipmentPlanMainYears; - } - - public List selectListByWhereWithEqu(String wherestr) { - EquipmentPlanMainYear equipmentPlanMainYear = new EquipmentPlanMainYear(); - equipmentPlanMainYear.setWhere(wherestr); - List equipmentPlanMainYears = equipmentPlanMainYearDao.selectListByWhereWithEqu(equipmentPlanMainYear); - for (EquipmentPlanMainYear item : equipmentPlanMainYears) { - item.setEquipmentCard(this.equipmentCardService.selectSimpleListById(item.getEquipmentId())); - item.setParticularYear(item.getParticularYear().substring(0, 4)); - item.setEquipmentPlanType(this.equipmentPlanTypeService.selectById(item.getType())); - item.setReceiveUser(this.userService.getUserById(item.getReceiveUserId())); - } - return equipmentPlanMainYears; - } - - public List selectListByWhereSimple(String wherestr) { - EquipmentPlanMainYear equipmentPlanMainYear = new EquipmentPlanMainYear(); - equipmentPlanMainYear.setWhere(wherestr); - List equipmentPlanMainYears = equipmentPlanMainYearDao.selectListByWhere(equipmentPlanMainYear); - return equipmentPlanMainYears; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentPlanMainYear equipmentPlanMainYear = new EquipmentPlanMainYear(); - equipmentPlanMainYear.setWhere(wherestr); - return equipmentPlanMainYearDao.deleteByWhere(equipmentPlanMainYear); - } - - /** - * xls文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXls(InputStream input, String companyId, String userId, String plan_type) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - String equipmentcardid = ""; - //卡片编号 - HSSFCell equipmentcardidCell = row.getCell(1); - if (null != equipmentcardidCell && !"".equals(equipmentcardidCell)) { - equipmentcardid = getStringVal(equipmentcardidCell); - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentcardid = '" + equipmentcardid + "'"); - if (null != equipmentCardList && equipmentCardList.size() > 0) { - EquipmentPlanMainYear equipmentPlanMainYear = new EquipmentPlanMainYear(); - equipmentPlanMainYear.setId(CommUtil.getUUID()); - equipmentPlanMainYear.setInsdt(CommUtil.nowDate()); - equipmentPlanMainYear.setInsuser(userId); - equipmentPlanMainYear.setUnitId(companyId); - equipmentPlanMainYear.setEquipmentId(equipmentCardList.get(0).getId()); - equipmentPlanMainYear.setPlanType(plan_type); - HSSFCell cell_3 = row.getCell(3); - String contents = getStringVal(cell_3); - if (null != contents && !"".equals(contents)) { - equipmentPlanMainYear.setContents(contents); - } - - HSSFCell cell_4 = row.getCell(4); - String planMoney = getStringVal(cell_4); - if (null != planMoney && !"".equals(planMoney)) { - equipmentPlanMainYear.setPlanMoney(new BigDecimal(planMoney)); - } - - HSSFCell cell_5 = row.getCell(5); - String type = getStringVal(cell_5); - if (null != type && !"".equals(type)) { - List list = this.equipmentPlanTypeService.selectListByWhere("where name = '" + type + "'"); - equipmentPlanMainYear.setType(list.get(0).getId()); - } - - HSSFCell cell_6 = row.getCell(6); - String str6 = getStringVal(cell_6); - if (null != str6 && !"".equals(str6)) { - List users = userService.selectListByWhere("where caption = '" + str6 + "'"); - if (users != null && users.size() > 0) { - equipmentPlanMainYear.setReceiveUserId(users.get(0).getId()); - } - } - - HSSFCell cell_7 = row.getCell(7); - String yearstr = getStringVal(cell_7); - if (null != yearstr && !"".equals(yearstr)) { - equipmentPlanMainYear.setParticularYear(yearstr); - } - //保存主表 - int suc = this.save(equipmentPlanMainYear); - insertNum += suc; - - for (int j = 8; j < 20; j++) { - HSSFCell cellDetail = row.getCell(j); - if (cellDetail != null && !cellDetail.toString().equals("")) { - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail = new EquipmentPlanMainYearDetail(); - equipmentPlanMainYearDetail.setId(CommUtil.getUUID()); - equipmentPlanMainYearDetail.setPid(equipmentPlanMainYear.getId()); - equipmentPlanMainYearDetail.setMonth(String.valueOf(j - 7)); - equipmentPlanMainYearDetail.setMainType(getStringVal(cellDetail)); - this.equipmentPlanMainYearDetailService.save(equipmentPlanMainYearDetail); - } - } - } else { - System.out.println(equipmentcardid + "======不存在"); - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - return result; - } - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsx(InputStream input, String companyId, String userId, String plan_type) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - XSSFRow row = sheet.getRow(rowNum); - String equipmentcardid = ""; - //卡片编号 - XSSFCell equipmentcardidCell = row.getCell(1); - if (null != equipmentcardidCell && !"".equals(equipmentcardidCell)) { - equipmentcardid = getStringVal(equipmentcardidCell); - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentcardid = '" + equipmentcardid + "'"); - if (null != equipmentCardList && equipmentCardList.size() > 0) { - EquipmentPlanMainYear equipmentPlanMainYear = new EquipmentPlanMainYear(); - equipmentPlanMainYear.setId(CommUtil.getUUID()); - equipmentPlanMainYear.setInsdt(CommUtil.nowDate()); - equipmentPlanMainYear.setInsuser(userId); - equipmentPlanMainYear.setUnitId(companyId); - equipmentPlanMainYear.setEquipmentId(equipmentCardList.get(0).getId()); - equipmentPlanMainYear.setPlanType(plan_type); - XSSFCell cell_3 = row.getCell(3); - String contents = getStringVal(cell_3); - if (null != contents && !"".equals(contents)) { - equipmentPlanMainYear.setContents(contents); - } - - XSSFCell cell_4 = row.getCell(4); - String planMoney = getStringVal(cell_4); - if (null != planMoney && !"".equals(planMoney)) { - equipmentPlanMainYear.setPlanMoney(new BigDecimal(planMoney)); - } - - XSSFCell cell_5 = row.getCell(5); - String type = getStringVal(cell_5); - if (null != type && !"".equals(type)) { - List list = this.equipmentPlanTypeService.selectListByWhere("where name = '" + type + "'"); - equipmentPlanMainYear.setType(list.get(0).getId()); - } - - XSSFCell cell_6 = row.getCell(6); - String str6 = getStringVal(cell_6); - if (null != str6 && !"".equals(str6)) { - List users = userService.selectListByWhere("where caption = '" + str6 + "'"); - if (users != null && users.size() > 0) { - equipmentPlanMainYear.setReceiveUserId(users.get(0).getId()); - } - } - - XSSFCell cell_7 = row.getCell(7); - String yearstr = getStringVal(cell_7); - if (null != yearstr && !"".equals(yearstr)) { - equipmentPlanMainYear.setParticularYear(yearstr); - } - //保存主表 - int suc = this.save(equipmentPlanMainYear); - insertNum += suc; - - for (int j = 8; j < 20; j++) { - XSSFCell cellDetail = row.getCell(j); - if (null != cellDetail && !"".equals(cellDetail)) { - EquipmentPlanMainYearDetail equipmentPlanMainYearDetail = new EquipmentPlanMainYearDetail(); - equipmentPlanMainYearDetail.setId(CommUtil.getUUID()); - equipmentPlanMainYearDetail.setPid(equipmentPlanMainYear.getId()); - equipmentPlanMainYearDetail.setMonth(String.valueOf(j - 7)); - equipmentPlanMainYearDetail.setMainType(getStringVal(cellDetail)); - this.equipmentPlanMainYearDetailService.save(equipmentPlanMainYearDetail); - } - } - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - return result; - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - - /** - * 导出设备表 - * - * @param response - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadExcel(HttpServletResponse response, List list, String plan_type) throws IOException { - String fileName = "设备保养年计划.xls"; - String title = "设备保养年计划"; - if (plan_type.equals(EquipmentPlanType.Code_Type_Wx)) { - fileName = "设备维修年计划.xls"; - title = "设备维修年计划"; - } else if (plan_type.equals(EquipmentPlanType.Code_Type_Dx)) { - fileName = "设备大修年计划.xls"; - title = "设备大修年计划"; - } else { - fileName = "设备保养年计划.xls"; - title = "设备保养年计划"; - } - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 5000); - sheet.setColumnWidth(2, 6000); - sheet.setColumnWidth(3, 9000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 4000); - sheet.setColumnWidth(6, 4000); - sheet.setColumnWidth(7, 3000); - sheet.setColumnWidth(8, 3000); - sheet.setColumnWidth(9, 3000); - sheet.setColumnWidth(10, 3000); - sheet.setColumnWidth(11, 3000); - sheet.setColumnWidth(12, 3000); - sheet.setColumnWidth(13, 3000); - sheet.setColumnWidth(14, 3000); - sheet.setColumnWidth(15, 3000); - sheet.setColumnWidth(16, 3000); - sheet.setColumnWidth(17, 3000); - sheet.setColumnWidth(18, 3000); - sheet.setColumnWidth(19, 3000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - - - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - //产生表格表头 - String excelTitleStr = "序号,设备编号,设备名称,设备内容,计划费用,类型,实施人员,计划年份,1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 400); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - //遍历集合数据,产生数据行 - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(i + 2);//第三行为插入的数据行 - EquipmentPlanMainYear equip = list.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0: - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - break; - case 1: - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - if (list.get(i).getEquipmentCard() != null) { - cell_1.setCellValue(list.get(i).getEquipmentCard().getEquipmentcardid()); - } else { - cell_1.setCellValue(""); - } - - break; - case 2: - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - if (list.get(i).getEquipmentCard() != null) { - cell_2.setCellValue(list.get(i).getEquipmentCard().getEquipmentname()); - } else { - cell_2.setCellValue("未关联设备"); - } - break; - case 3: - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getContents()); - break; - case 4: - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getPlanMoney() + ""); - break; - case 5: - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getEquipmentPlanType().getName()); - break; - case 6: - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getReceiveUser() == null ? "" : list.get(i).getReceiveUser().getCaption()); - break; - case 7: - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getParticularYear() == null ? "" : list.get(i).getParticularYear().substring(0, 4)); - break; - case 8: - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - List list_1 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '1'"); - if (list_1 != null && list_1.size() > 0) { - cell_8.setCellValue(list_1.get(0).getMainType()); - } else { - cell_8.setCellValue(""); - } - break; - case 9: - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - List list_2 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '2'"); - if (list_2 != null && list_2.size() > 0) { - cell_9.setCellValue(list_2.get(0).getMainType()); - } else { - cell_9.setCellValue(""); - } - break; - case 10: - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - List list_3 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '3'"); - if (list_3 != null && list_3.size() > 0) { - cell_10.setCellValue(list_3.get(0).getMainType()); - } else { - cell_10.setCellValue(""); - } - break; - case 11: - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - List list_4 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '4'"); - if (list_4 != null && list_4.size() > 0) { - cell_11.setCellValue(list_4.get(0).getMainType()); - } else { - cell_11.setCellValue(""); - } - break; - case 12: - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - List list_5 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '5'"); - if (list_5 != null && list_5.size() > 0) { - cell_12.setCellValue(list_5.get(0).getMainType()); - } else { - cell_12.setCellValue(""); - } - break; - case 13: - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - List list_6 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '6'"); - if (list_6 != null && list_6.size() > 0) { - cell_13.setCellValue(list_6.get(0).getMainType()); - } else { - cell_13.setCellValue(""); - } - break; - case 14: - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - List list_7 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '7'"); - if (list_7 != null && list_7.size() > 0) { - cell_14.setCellValue(list_7.get(0).getMainType()); - } else { - cell_14.setCellValue(""); - } - break; - case 15: - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - List list_8 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '8'"); - if (list_8 != null && list_8.size() > 0) { - cell_15.setCellValue(list_8.get(0).getMainType()); - } else { - cell_15.setCellValue(""); - } - break; - case 16: - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - List list_9 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '9'"); - if (list_9 != null && list_9.size() > 0) { - cell_16.setCellValue(list_9.get(0).getMainType()); - } else { - cell_16.setCellValue(""); - } - break; - case 17: - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - List list_10 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '10'"); - if (list_10 != null && list_10.size() > 0) { - cell_17.setCellValue(list_10.get(0).getMainType()); - } else { - cell_17.setCellValue(""); - } - break; - case 18: - HSSFCell cell_18 = row.createCell(18); - cell_18.setCellStyle(listStyle); - List list_11 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '11'"); - if (list_11 != null && list_11.size() > 0) { - cell_18.setCellValue(list_11.get(0).getMainType()); - } else { - cell_18.setCellValue(""); - } - break; - case 19: - HSSFCell cell_19 = row.createCell(19); - cell_19.setCellStyle(listStyle); - List list_12 = equipmentPlanMainYearDetailService.selectListByWhere("where pid = '" + list.get(i).getId() + "' and month = '12'"); - if (list_12 != null && list_12.size() > 0) { - cell_19.setCellValue(list_12.get(0).getMainType()); - } else { - cell_19.setCellValue(""); - } - break; - default: - break; - } - } - String col = "TIME"; - Map time_Map = new HashMap<>(); - time_Map.put("TIME", "月,季,半年,年"); - HSSFDataValidation dataValidation = createBox(col, time_Map, i + 2, i + 2, 8, 19); - if (dataValidation != null) { - sheet.addValidationData(dataValidation); - } - - String col2 = "TYPES"; - Map time_Map2 = new HashMap<>(); - time_Map2.put("TYPES", "通用保养,润滑保养,防腐保养,仪表保养"); - HSSFDataValidation dataValidation2 = createBox(col2, time_Map2, i + 2, i + 2, 5, 5); - if (dataValidation2 != null) { - sheet.addValidationData(dataValidation2); - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.getMessage()); - } finally { - workbook.close(); - } - } - - public HSSFDataValidation createBox(String col, Map boxMap, int firstRow, int lastRow, int firstCol, int lastCol) { - HSSFDataValidation dataValidation = null; - //查询码值表 - String cols = ""; - if (null != boxMap.get(col)) { - cols = boxMap.get(col); - } - //设置下拉框 - if (cols.length() > 0 && null != cols) { - String str[] = cols.split(","); - //指定0-9行,0-0列为下拉框 - CellRangeAddressList cas = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol); - //创建下拉数据列 - DVConstraint dvConstraint = DVConstraint.createExplicitListConstraint(str); - //将下拉数据放入下拉框 - dataValidation = new HSSFDataValidation(cas, dvConstraint); - } - return dataValidation; - - } -} diff --git a/src/com/sipai/service/maintenance/EquipmentPlanService.java b/src/com/sipai/service/maintenance/EquipmentPlanService.java deleted file mode 100644 index 4beab9bf..00000000 --- a/src/com/sipai/service/maintenance/EquipmentPlanService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.IOException; -import java.util.List; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanEqu; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public interface EquipmentPlanService { - - public abstract EquipmentPlan selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(EquipmentPlan entity); - - public abstract int update(EquipmentPlan entity); - - public abstract List selectListByWhere(String wherestr); - - public List selectListByWhereWithEquEqu(String wherestr); - - public abstract int deleteByWhere(String wherestr); - //启动流程 - public int startPlanAudit(EquipmentPlan equipmentPlan); - //流程审核 - public int doAudit(BusinessUnitAudit entity); - - public abstract EquipmentPlan countListByWhere(String wh); - - void doExport(String id, HttpServletRequest request, HttpServletResponse response) throws IOException; - -} diff --git a/src/com/sipai/service/maintenance/EquipmentPlanTypeService.java b/src/com/sipai/service/maintenance/EquipmentPlanTypeService.java deleted file mode 100644 index 1ef66707..00000000 --- a/src/com/sipai/service/maintenance/EquipmentPlanTypeService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.EquipmentPlanType; - -public interface EquipmentPlanTypeService { - - public abstract EquipmentPlanType selectById(String id); - - public abstract EquipmentPlanType selectByCode(String id); - - public abstract EquipmentPlanType selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(EquipmentPlanType entity); - - public abstract int update(EquipmentPlanType entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/FaultLibraryService.java b/src/com/sipai/service/maintenance/FaultLibraryService.java deleted file mode 100644 index a72dc59b..00000000 --- a/src/com/sipai/service/maintenance/FaultLibraryService.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.FaultLibraryDao; -import com.sipai.dao.maintenance.MaintainerDao; -import com.sipai.dao.maintenance.MaintenanceDao; -import com.sipai.dao.user.MenuDao; -import com.sipai.dao.user.UserPowerDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.maintenance.FaultLibrary; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.RoleMenu; -import com.sipai.entity.user.UserPower; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.service.user.RoleService; -import com.sipai.tools.CommService; - -@Service -public class FaultLibraryService implements CommService{ - @Resource - private FaultLibraryDao faultLibraryDao; - - @Override - public FaultLibrary selectById(String id) { - FaultLibrary faultLibrary =faultLibraryDao.selectByPrimaryKey(id); - FaultLibrary p =faultLibraryDao.selectByPrimaryKey(faultLibrary.getPid()); - if(p!=null){ - faultLibrary.set_pname(p.getName()); - } - return faultLibrary; - } - //工艺可视化,异常消缺查id的 - public FaultLibrary selectByFaultId(String id) { - FaultLibrary faultLibrary =faultLibraryDao.selectByPrimaryKey(id); - return faultLibrary; - } - - @Override - public int deleteById(String id) { - return faultLibraryDao.deleteByPrimaryKey(id); - } - - @Override - public int save(FaultLibrary faultLibrary) { - return faultLibraryDao.insert(faultLibrary); - } - - @Override - public int update(FaultLibrary faultLibrary) { - return faultLibraryDao.updateByPrimaryKeySelective(faultLibrary); - } - - @Override - public List selectListByWhere(String wherestr) { - FaultLibrary faultLibrary = new FaultLibrary(); - faultLibrary.setWhere(wherestr); - List faultLibraries =faultLibraryDao.selectListByWhere(faultLibrary); - return faultLibraries; - } - - @Override - public int deleteByWhere(String wherestr) { - FaultLibrary faultLibrary = new FaultLibrary(); - faultLibrary.setWhere(wherestr); - return faultLibraryDao.deleteByWhere(faultLibrary); - } - - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(FaultLibrary k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(FaultLibrary k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid",k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/maintenance/LibraryAddResetProjectBizService.java b/src/com/sipai/service/maintenance/LibraryAddResetProjectBizService.java deleted file mode 100644 index 170335ab..00000000 --- a/src/com/sipai/service/maintenance/LibraryAddResetProjectBizService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryAddResetProjectBiz; - -public interface LibraryAddResetProjectBizService { - - public abstract LibraryAddResetProjectBiz selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryAddResetProjectBiz entity); - - public abstract int update(LibraryAddResetProjectBiz entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryAddResetProjectBiz selectByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryAddResetProjectBlocService.java b/src/com/sipai/service/maintenance/LibraryAddResetProjectBlocService.java deleted file mode 100644 index cdb1c86f..00000000 --- a/src/com/sipai/service/maintenance/LibraryAddResetProjectBlocService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; -import com.sipai.entity.maintenance.LibraryAddResetProjectBloc; - -public interface LibraryAddResetProjectBlocService { - - public abstract LibraryAddResetProjectBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryAddResetProjectBloc entity); - - public abstract int update(LibraryAddResetProjectBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryAddResetProjectBloc selectByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryAddResetProjectService.java b/src/com/sipai/service/maintenance/LibraryAddResetProjectService.java deleted file mode 100644 index 97c46fee..00000000 --- a/src/com/sipai/service/maintenance/LibraryAddResetProjectService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryAddResetProject; - -public interface LibraryAddResetProjectService { - - public abstract LibraryAddResetProject selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryAddResetProject entity); - - public abstract int update(LibraryAddResetProject entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectList4Class(String wherestr); - - //根据设备型号查询下面所有的大修内容 - public abstract List selectList4Model(String wherestr, String modelId, String unitId); - - //根据设备查询下面所有的大修内容 - public abstract List selectList4Equ(String wherestr, String modelId, String unitId); - - public abstract int save4Model(LibraryAddResetProject entity, String modelId, String unitId); - - public abstract int update4Model(LibraryAddResetProject entity, String modelId, String unitId); - - public abstract int update4Equ(LibraryAddResetProject entity, String modelId, String unitId); - - //大修库导出 -- 集团 - public abstract void doExport(HttpServletResponse response, List equipmentClasses, String unitId) throws IOException; - - //大修库导出 -- 单厂 - public abstract void doExport4Biz(HttpServletResponse response, List equipmentClasses, String unitId, String smallClassId) throws IOException; - - //导入 -- 集团 - public abstract String readXls(InputStream input, String json, String userId, String unitId) throws IOException; - - public abstract String readXlsx(InputStream input, String json, String userId, String unitId) throws IOException; - - //导入 -- 单厂 - public abstract String readXls4Biz(InputStream input, String json, String userId, String unitId) throws IOException; - - public abstract String readXlsx4Biz(InputStream input, String json, String userId, String unitId) throws IOException; - -} diff --git a/src/com/sipai/service/maintenance/LibraryBaseService.java b/src/com/sipai/service/maintenance/LibraryBaseService.java deleted file mode 100644 index e4558867..00000000 --- a/src/com/sipai/service/maintenance/LibraryBaseService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import com.sipai.entity.maintenance.LibraryBase; - -import java.util.List; - -public interface LibraryBaseService { - - public abstract LibraryBase selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryBase entity); - - public abstract int update(LibraryBase entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/LibraryFaultBlocService.java b/src/com/sipai/service/maintenance/LibraryFaultBlocService.java deleted file mode 100644 index a2554dd0..00000000 --- a/src/com/sipai/service/maintenance/LibraryFaultBlocService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.maintenance; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.workorder.WorkorderDetail; - - -public interface LibraryFaultBlocService{ - public abstract LibraryFaultBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryFaultBloc entity); - - public abstract int update(LibraryFaultBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr,String ids); - //获取树 - public String getTreeList(List> list_result,List list); - //维修库导出--业务区 - public abstract void doExportLibraryFaultBloc(HttpServletResponse response,List equipmentClasses,String unitId) throws IOException; - //维修库导出--单厂 - public abstract void doExportLibraryFaultBiz(HttpServletResponse response,List equipmentClasses,String unitId,String smallClassId) throws IOException; - - //集团 - public abstract String readXls(InputStream input,String json,String userId,String unitId) throws IOException; - public abstract String readXlsx(InputStream input,String json,String userId,String unitId) throws IOException; - //单厂 - public abstract String readXls4Biz(InputStream input,String json,String userId,String unitId) throws IOException; - public abstract String readXlsx4Biz(InputStream input,String json,String userId,String unitId) throws IOException; - - public abstract LibraryFaultBloc selectById4Part(String id); - public abstract List selectList4Part(String wherestr); - - void doInit(String unitId); - - //维修记录详情导出 -// public abstract void doExportLibraryRepair(HttpServletResponse response, List workorderDetailList, String type) throws IOException; - - -} diff --git a/src/com/sipai/service/maintenance/LibraryMaintainCarDetailService.java b/src/com/sipai/service/maintenance/LibraryMaintainCarDetailService.java deleted file mode 100644 index df4d59f2..00000000 --- a/src/com/sipai/service/maintenance/LibraryMaintainCarDetailService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryMaintainCarDetail; - -public interface LibraryMaintainCarDetailService { - - public abstract LibraryMaintainCarDetail selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryMaintainCarDetail libraryMaintainCarDetail); - - public abstract int update(LibraryMaintainCarDetail libraryMaintainCarDetail); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryMaintainCarService.java b/src/com/sipai/service/maintenance/LibraryMaintainCarService.java deleted file mode 100644 index 8e8e17a8..00000000 --- a/src/com/sipai/service/maintenance/LibraryMaintainCarService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryMaintainCar; - -public interface LibraryMaintainCarService { - - public abstract LibraryMaintainCar selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryMaintainCar libraryMaintainCar); - - public abstract int update(LibraryMaintainCar libraryMaintainCar); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryMaintenanceCommonContentService.java b/src/com/sipai/service/maintenance/LibraryMaintenanceCommonContentService.java deleted file mode 100644 index 7e709f13..00000000 --- a/src/com/sipai/service/maintenance/LibraryMaintenanceCommonContentService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryMaintenanceCommonContent; -import com.sipai.entity.maintenance.LibraryRepairBloc; - -public interface LibraryMaintenanceCommonContentService { - - public abstract LibraryMaintenanceCommonContent selectById(String id); - - public abstract LibraryMaintenanceCommonContent selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(LibraryMaintenanceCommonContent entity); - - public abstract int update(LibraryMaintenanceCommonContent entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - //根据设备类别查询下面所有的维修内容 有部件的 - public abstract List selectList4Class(String wherestr,String unitId,String type); - - //根据设备类别查询下面所有的维修内容 没有部件的 - public abstract List selectList3Class(String wherestr,String unitId,String type); -} diff --git a/src/com/sipai/service/maintenance/LibraryMaintenanceCommonService.java b/src/com/sipai/service/maintenance/LibraryMaintenanceCommonService.java deleted file mode 100644 index 776de0d3..00000000 --- a/src/com/sipai/service/maintenance/LibraryMaintenanceCommonService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryMaintenanceCommon; - -public interface LibraryMaintenanceCommonService { - - public abstract LibraryMaintenanceCommon selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryMaintenanceCommon entity); - - public abstract int update(LibraryMaintenanceCommon entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /* - * 导出 - */ - public abstract void doExport(HttpServletResponse response,List equipmentClasses,String unitId,String smallClassId,String type) throws IOException; - /* - * 导入 - */ - public abstract String readXls(InputStream input,String json,String userId,String unitId,String mainType) throws IOException; - public abstract String readXlsx(InputStream input,String json,String userId,String unitId,String mainType) throws IOException; - - //用于保养工单关联库 - public abstract LibraryMaintenanceCommon selectById4part(String id); - public abstract List selectListByWhere4part(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryMaintenanceLubricationService.java b/src/com/sipai/service/maintenance/LibraryMaintenanceLubricationService.java deleted file mode 100644 index ad4e3f4c..00000000 --- a/src/com/sipai/service/maintenance/LibraryMaintenanceLubricationService.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryMaintenanceLubrication; - -public interface LibraryMaintenanceLubricationService { - - public abstract LibraryMaintenanceLubrication selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryMaintenanceLubrication entity); - - public abstract int update(LibraryMaintenanceLubrication entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - //根据设备类别查询下面所有的内容 - //public abstract List selectList4Class(String wherestr); - - /* - * 导入 - */ - public abstract String readXls(InputStream input,String json,String userId,String unitId) throws IOException; - public abstract String readXlsx(InputStream input,String json,String userId,String unitId) throws IOException; - /* - * 导出 - */ - public abstract void doExport(HttpServletResponse response,List equipmentClasses,String unitId,String smallClassId) throws IOException; - - public abstract LibraryMaintenanceLubrication selectById4part(String id); - public abstract List selectListByWhere4part(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryMaterialQuotaService.java b/src/com/sipai/service/maintenance/LibraryMaterialQuotaService.java deleted file mode 100644 index 91e04b0f..00000000 --- a/src/com/sipai/service/maintenance/LibraryMaterialQuotaService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryMaterialQuota; - -public interface LibraryMaterialQuotaService { - - public abstract LibraryMaterialQuota selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryMaterialQuota entity); - - public abstract int update(LibraryMaterialQuota entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/LibraryOverhaulContentBlocService.java b/src/com/sipai/service/maintenance/LibraryOverhaulContentBlocService.java deleted file mode 100644 index b57e1d17..00000000 --- a/src/com/sipai/service/maintenance/LibraryOverhaulContentBlocService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; - -public interface LibraryOverhaulContentBlocService { - - public abstract LibraryOverhaulContentBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryOverhaulContentBloc entity); - - public abstract int update(LibraryOverhaulContentBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - /** - * 根据设备类别查询下面所有的大修内容 - * @param wherestr - * @return - */ - public abstract List selectList4Class(String wherestr,String unitId); - //根据设备型号查询下面所有的大修内容 - public abstract List selectList4Model(String wherestr, String modelId , String unitId); - //根据设备查询下面所有的大修内容 - public abstract List selectList4Equ(String wherestr, String modelId, String unitId); - - public abstract int save4Model(LibraryOverhaulContentBloc entity, String modelId ,String unitId); - public abstract int update4Model(LibraryOverhaulContentBloc entity, String modelId ,String unitId); - public abstract int update4Equ(LibraryOverhaulContentBloc entity, String modelId ,String unitId); - - public abstract LibraryOverhaulContentBloc selectByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryOverhaulContentEquBizService.java b/src/com/sipai/service/maintenance/LibraryOverhaulContentEquBizService.java deleted file mode 100644 index 0e5036c2..00000000 --- a/src/com/sipai/service/maintenance/LibraryOverhaulContentEquBizService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; - -public interface LibraryOverhaulContentEquBizService { - - public abstract LibraryOverhaulContentEquBiz selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryOverhaulContentEquBiz entity); - - public abstract int update(LibraryOverhaulContentEquBiz entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryOverhaulContentEquBiz selectByWhere(String id); -} diff --git a/src/com/sipai/service/maintenance/LibraryOverhaulContentModelBlocService.java b/src/com/sipai/service/maintenance/LibraryOverhaulContentModelBlocService.java deleted file mode 100644 index 77133c4c..00000000 --- a/src/com/sipai/service/maintenance/LibraryOverhaulContentModelBlocService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; - -public interface LibraryOverhaulContentModelBlocService { - - public abstract LibraryOverhaulContentModelBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryOverhaulContentModelBloc entity); - - public abstract int update(LibraryOverhaulContentModelBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryOverhaulContentModelBloc selectByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryOverhaulProjectBlocService.java b/src/com/sipai/service/maintenance/LibraryOverhaulProjectBlocService.java deleted file mode 100644 index 87177873..00000000 --- a/src/com/sipai/service/maintenance/LibraryOverhaulProjectBlocService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; - -public interface LibraryOverhaulProjectBlocService { - - public abstract LibraryOverhaulProjectBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryOverhaulProjectBloc entity); - - public abstract int update(LibraryOverhaulProjectBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - //大修库导出--集团 - public abstract void doExportLibraryOverhaulBloc(HttpServletResponse response, List equipmentClasses, String unitId) throws IOException; - - //大修库导出--单厂 - public abstract void doExportLibraryOverhaulBiz(HttpServletResponse response, List equipmentClasses, String unitId, String smallClassId) throws IOException; - - //excel导入--集团 - public abstract String readXls(InputStream input, String json, String userId, String unitId) throws IOException; - public abstract String readXlsx(InputStream input, String json, String userId, String unitId) throws IOException; - //excel导入--单厂 - public abstract String readXls4Biz(InputStream input, String json, String userId, String unitId) throws IOException; - public abstract String readXlsx4Biz(InputStream input, String json, String userId, String unitId) throws IOException; - - //根据设备型号查询下面所有的大修内容 - public abstract List selectList4Model(String wherestr, String modelId, String unitId); - - //根据设备查询下面所有的大修内容 - public abstract List selectList4Equ(String wherestr, String modelId, String unitId); - - public abstract int save4Model(LibraryOverhaulProjectBloc entity, String modelId, String unitId); - - public abstract int update4Model(LibraryOverhaulProjectBloc entity, String modelId, String unitId); - - public abstract int update4Equ(LibraryOverhaulProjectBloc entity, String modelId, String unitId); - - /** - * 用分厂定额覆盖业务区定额 - * - * @param id 分厂库定额id - * @param modelId 型号id - * @param unitId - * @return - */ - public abstract int updateProjectQuota(String id, String modelId, String unitId, String equipmentId); -} diff --git a/src/com/sipai/service/maintenance/LibraryOverhaulProjectEquBizService.java b/src/com/sipai/service/maintenance/LibraryOverhaulProjectEquBizService.java deleted file mode 100644 index aad3bec2..00000000 --- a/src/com/sipai/service/maintenance/LibraryOverhaulProjectEquBizService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryOverhaulProjectEquBiz; - -public interface LibraryOverhaulProjectEquBizService { - - public abstract LibraryOverhaulProjectEquBiz selectById(String id); - - public abstract LibraryOverhaulProjectEquBiz selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(LibraryOverhaulProjectEquBiz entity); - - public abstract int update(LibraryOverhaulProjectEquBiz entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/LibraryOverhaulProjectModelBlocService.java b/src/com/sipai/service/maintenance/LibraryOverhaulProjectModelBlocService.java deleted file mode 100644 index 22d2752c..00000000 --- a/src/com/sipai/service/maintenance/LibraryOverhaulProjectModelBlocService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; - -public interface LibraryOverhaulProjectModelBlocService { - public abstract LibraryOverhaulProjectModelBloc selectById(String id); - - public abstract LibraryOverhaulProjectModelBloc selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(LibraryOverhaulProjectModelBloc entity); - - public abstract int update(LibraryOverhaulProjectModelBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryRepairBlocService.java b/src/com/sipai/service/maintenance/LibraryRepairBlocService.java deleted file mode 100644 index 7c97c552..00000000 --- a/src/com/sipai/service/maintenance/LibraryRepairBlocService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; -import java.util.TreeSet; - -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.maintenance.LibraryRepairBloc; - -public interface LibraryRepairBlocService { - - public abstract LibraryRepairBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract LibraryRepairBloc selectByWhere(String wherestr); - - public abstract int save(LibraryRepairBloc entity); - - public abstract int update(LibraryRepairBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListByWhere2(String wherestr,String unitId); - - public abstract int deleteByWhere(String wherestr); - - void deletePid(LibraryRepairBloc libraryRepairBloc); - - //根据设备类别查询下面所有的维修内容 - public abstract List selectList4Class(String wherestr,String unitId); - //根据设备类别查询下面所有的维修内容 这个是不查部件的 - public abstract List selectList3Class(String wherestr,String unitId); - //根据设备型号查询下面所有的维修内容 - public abstract List selectList4Model(String wherestr, String modelId); - //根据设备查询下面所有的大修内容 - public abstract List selectList4Equ(String wherestr, String modelId, String unitId); - public abstract int save4Model(LibraryRepairBloc entity, String modelId); - public abstract int update4Model(LibraryRepairBloc entity, String modelId); - public abstract int update5Model(LibraryRepairBloc entity); - public abstract int update4Equ(LibraryRepairBloc entity, String modelId, String unitId); - - //用于关联查父级故障及部位及分厂的定额对象 sj 2020-11-12 - public abstract LibraryRepairBloc selectById4FaultAndBiz(String id,String unitId,String equipmentId); - //用于关联查父级故障及部位及分厂的定额List sj 2020-11-12 - public abstract List selectList4FaultAndBiz(String wherestr,String unitId,String equipmentId); - - void doInit(LibraryRepairBloc libraryRepairBloc); - - //用于关联查分厂的信息 -// public abstract LibraryRepairBloc selectById4Biz(String id, String unitId,String equipmentId); - -} diff --git a/src/com/sipai/service/maintenance/LibraryRepairEquBizService.java b/src/com/sipai/service/maintenance/LibraryRepairEquBizService.java deleted file mode 100644 index c2874c11..00000000 --- a/src/com/sipai/service/maintenance/LibraryRepairEquBizService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.maintenance.LibraryRepairEquBiz; - -public interface LibraryRepairEquBizService { - - public abstract LibraryRepairEquBiz selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryRepairEquBiz entity); - - public abstract int update(LibraryRepairEquBiz entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int copy4Equ(String id,String modelId,String unitId); - - public abstract LibraryRepairEquBiz selectByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/LibraryRepairModelBlocService.java b/src/com/sipai/service/maintenance/LibraryRepairModelBlocService.java deleted file mode 100644 index 885f5ec9..00000000 --- a/src/com/sipai/service/maintenance/LibraryRepairModelBlocService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.maintenance.LibraryRepairModelBloc; - -public interface LibraryRepairModelBlocService { - - public abstract LibraryRepairModelBloc selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryRepairModelBloc entity); - - public abstract int update(LibraryRepairModelBloc entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryRepairModelBloc selectByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/maintenance/MaintainCarService.java b/src/com/sipai/service/maintenance/MaintainCarService.java deleted file mode 100644 index 0ed9b3e8..00000000 --- a/src/com/sipai/service/maintenance/MaintainCarService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.MaintainCar; - -public interface MaintainCarService { - - public abstract MaintainCar selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(MaintainCar maintainCar); - - public abstract int update(MaintainCar maintainCar); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int startProcess(MaintainCar maintainCar); - - public abstract int doAudit(BusinessUnitAudit businessUnitAudit); -} diff --git a/src/com/sipai/service/maintenance/MaintainPlanService.java b/src/com/sipai/service/maintenance/MaintainPlanService.java deleted file mode 100644 index 0cfc43c2..00000000 --- a/src/com/sipai/service/maintenance/MaintainPlanService.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.MaintainPlanDao; -import com.sipai.entity.maintenance.MaintainPlan; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.user.Company; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class MaintainPlanService implements CommService{ - @Resource - private MaintainPlanDao maintainPlanDao; - @Resource - private UnitService unitService; - @Resource - private MaintainerService maintainerService; - - @Override - public MaintainPlan selectById(String id) { - MaintainPlan maintainPlan =maintainPlanDao.selectByPrimaryKey(id); - - Company company =unitService.getCompById(maintainPlan.getCompanyid()); - maintainPlan.setCompany(company); - - Maintainer maintainer = maintainerService.selectById(maintainPlan.getMaintainerid()); - maintainPlan.setMaintainer(maintainer); - maintainPlan.setTypeName(MaintainPlan.getPlanTypeName(maintainPlan.getType())); - return maintainPlan; - } - - @Override - public int deleteById(String id) { - return maintainPlanDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MaintainPlan maintainPlan) { - return maintainPlanDao.insert(maintainPlan); - } - - @Override - public int update(MaintainPlan maintainPlan) { - return maintainPlanDao.updateByPrimaryKeySelective(maintainPlan); - } - - @Override - public List selectListByWhere(String wherestr) { - MaintainPlan maintainPlan = new MaintainPlan(); - maintainPlan.setWhere(wherestr); - List maintainPlans =maintainPlanDao.selectListByWhere(maintainPlan); - for (MaintainPlan item : maintainPlans) { - Company company =unitService.getCompById(item.getCompanyid()); - item.setCompany(company); - Maintainer maintainer = maintainerService.selectById(item.getMaintainerid()); - item.setMaintainer(maintainer); - item.setTypeName(MaintainPlan.getPlanTypeName(item.getType())); - } - return maintainPlans; - } - - @Override - public int deleteByWhere(String wherestr) { - MaintainPlan maintainPlan = new MaintainPlan(); - maintainPlan.setWhere(wherestr); - return maintainPlanDao.deleteByWhere(maintainPlan); - } - - - -} diff --git a/src/com/sipai/service/maintenance/MaintainService.java b/src/com/sipai/service/maintenance/MaintainService.java deleted file mode 100644 index f2f302c8..00000000 --- a/src/com/sipai/service/maintenance/MaintainService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; -import com.sipai.entity.maintenance.Maintain; - -public interface MaintainService { - - public abstract Maintain selectById(String id); - - public abstract Maintain selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(Maintain entity); - - public abstract int update(Maintain entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/MaintainerSelectTypeService.java b/src/com/sipai/service/maintenance/MaintainerSelectTypeService.java deleted file mode 100644 index 6084faf8..00000000 --- a/src/com/sipai/service/maintenance/MaintainerSelectTypeService.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.MaintainerCompanyDao; -import com.sipai.dao.maintenance.MaintainerDao; -import com.sipai.dao.maintenance.MaintainerSelectTypeDao; -import com.sipai.dao.maintenance.MaintenanceDao; -import com.sipai.dao.user.CompanyDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.maintenance.MaintainerSelectType; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.UserRole; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Service -public class MaintainerSelectTypeService implements CommService{ - @Resource - private MaintainerSelectTypeDao maintainerSelectTypeDao; - @Resource - private MaintainerService maintainerService; - @Override - public MaintainerSelectType selectById(String id) { - return maintainerSelectTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return maintainerSelectTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MaintainerSelectType maintainerSelectType) { - return maintainerSelectTypeDao.insert(maintainerSelectType); - } - - @Override - public int update(MaintainerSelectType maintainerSelectType) { - return maintainerSelectTypeDao.updateByPrimaryKeySelective(maintainerSelectType); - } - - @Override - public List selectListByWhere(String wherestr) { - MaintainerSelectType maintainerSelectType = new MaintainerSelectType(); - maintainerSelectType.setWhere(wherestr); - return maintainerSelectTypeDao.selectListByWhere(maintainerSelectType); - } - - @Override - public int deleteByWhere(String wherestr) { - MaintainerSelectType maintainerSelectType = new MaintainerSelectType(); - maintainerSelectType.setWhere(wherestr); - return maintainerSelectTypeDao.deleteByWhere(maintainerSelectType); - } - /** - * 获取运维商类型的方法 - * @param wherestr是查询条件 - * @return 返回该运维商的类型 - */ - public ListgetMaintainerTypes (String wherestr){ - MaintainerType maintainerType = new MaintainerType(); - maintainerType.setWhere(wherestr); - return this.maintainerSelectTypeDao.selectMaintainerType(maintainerType); - } - - public ListgetMaintainers (String wherestr){ - List result = new ArrayList<>(); - MaintainerSelectType maintainerSelectType = new MaintainerSelectType(); - maintainerSelectType.setWhere(wherestr); - List list =this.maintainerSelectTypeDao.selectListByWhere(maintainerSelectType); - String maintainerIds= ""; - for (MaintainerSelectType item : list) { - if(!maintainerIds.isEmpty()){ - maintainerIds+="','"; - } - maintainerIds+=item.getMaintainerid(); - } - result =this.maintainerService.selectListByWhere("where id in('"+maintainerIds+"')"); - return result; - } -} diff --git a/src/com/sipai/service/maintenance/MaintainerService.java b/src/com/sipai/service/maintenance/MaintainerService.java deleted file mode 100644 index b4bcb4dc..00000000 --- a/src/com/sipai/service/maintenance/MaintainerService.java +++ /dev/null @@ -1,321 +0,0 @@ -package com.sipai.service.maintenance; -import java.sql.Date; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.List; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.axis2.databinding.utils.reader.NullXMLStreamReader; -//import org.apache.naming.java.javaURLContextFactory; -import org.springframework.stereotype.Service; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.sipai.dao.maintenance.MaintainerCompanyDao; -import com.sipai.dao.maintenance.MaintainerDao; -import com.sipai.dao.maintenance.MaintenanceDao; -import com.sipai.dao.user.CompanyDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerCompany; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserRole; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class MaintainerService implements CommService{ - @Resource - private MaintainerDao maintainerDao; - @Resource - private MaintainerCompanyDao maintainerCompanyDao; - - @Resource - private MaintainerTypeService maintainerTypeService; - @Resource - private MaintainerSelectTypeService maintainerSelectTypeService; - @Resource - private CompanyDao companyDao; - @Resource - private UserService userService; - - @Override - public Maintainer selectById(String id) { - return maintainerDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - Maintainer maintainer =this.selectById(id); - maintainer.setActive(CommString.Active_False); - return update(maintainer); - } - - @Override - public int save(Maintainer maintainer) { - return maintainerDao.insert(maintainer); - } - - @Override - public int update(Maintainer maintainer) { - return maintainerDao.updateByPrimaryKeySelective(maintainer); - } - - @Override - public List selectListByWhere(String wherestr) { - Maintainer maintainer = new Maintainer(); - maintainer.setWhere(wherestr); - List maintainers =maintainerDao.selectListByWhere(maintainer); - for (Maintainer item : maintainers) { - List maintainerTypes=maintainerSelectTypeService.getMaintainerTypes("where maintainerid='"+item.getId()+"'"); - item.setMaintainerTypes(maintainerTypes); - } - return maintainers; - } - - @Override - public int deleteByWhere(String wherestr) { - int resp=0; - List maintainers= this.selectListByWhere(wherestr); - for (Maintainer maintainer : maintainers) { - maintainer.setActive(CommString.Active_False); - resp+= this.update(maintainer); - } - return resp; - } - /** - * 获取维护商在有效期内维护的水厂清单 - * */ - public List getMaintainerCompany(String maintainerId) { - MaintainerCompany maintainerCompany = new MaintainerCompany(); - maintainerCompany.setWhere("where maintainerid='"+maintainerId+"'"); - List maintainers =maintainerCompanyDao.selectListByWhere(maintainerCompany); - String companyIds=""; - for (MaintainerCompany item : maintainers) { - if (isEffectiveDate(item.getStartdate(),item.getEnddate())) { - if(!companyIds.isEmpty()){ - companyIds+="','"; - } - companyIds+=item.getCompanyid(); - } - } - Company company= new Company(); - company.setWhere("where id in ('"+companyIds+"')"); - List companies=companyDao.selectListByWhere(company); - return companies; - } - /** - * 获取运维商运维厂区的负责人 - * @param companyIds 公司id集合 - * @param maintainerId 运维商id - * */ - public List getMaintainerLeaders(String companyIds,String maintainerId) { - List users = new ArrayList<>(); - MaintainerCompany maintainerCompany = new MaintainerCompany(); - String whereStr="where 1=1 "; - if (maintainerId!=null && !maintainerId.isEmpty()) { - whereStr+=" and maintainerid='"+maintainerId+"' "; - } - if (companyIds!=null && !companyIds.isEmpty()) { - whereStr+=" and companyId in ('"+companyIds.replace(",", "','")+"') "; - } - maintainerCompany.setWhere(whereStr); - List maintainers =maintainerCompanyDao.selectListByWhere(maintainerCompany); - String userIds=""; - for (MaintainerCompany item : maintainers) { - if (isEffectiveDate(item.getStartdate(),item.getEnddate())) { - if(!userIds.isEmpty()){ - userIds+=","; - } - userIds+=item.getMaintainerleader(); - } - } - users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - return users; - } - /** - * 获取运维商运维厂区的联系人 - * @param companyIds 公司id集合 - * @param maintainerId 运维商id - * */ - public List getCompanyContacters(String companyIds,String maintainerId) { - List users = new ArrayList<>(); - MaintainerCompany maintainerCompany = new MaintainerCompany(); - String whereStr="where 1=1 "; - if (maintainerId!=null && !maintainerId.isEmpty()) { - whereStr+=" and maintainerid='"+maintainerId+"' "; - } - if (companyIds!=null && !companyIds.isEmpty()) { - whereStr+=" and companyId in ('"+companyIds.replace(",", "','")+"') "; - } - maintainerCompany.setWhere(whereStr); - List maintainers =maintainerCompanyDao.selectListByWhere(maintainerCompany); - String userIds=""; - for (MaintainerCompany item : maintainers) { - if (isEffectiveDate(item.getStartdate(),item.getEnddate())) { - if(!userIds.isEmpty()){ - userIds+=","; - } - userIds+=item.getFactorycontacter(); - } - } - users = userService.selectListByWhere("where id in('"+userIds.replace(",", "','")+"')"); - return users; - } - /** - * 获取维护商关联厂区的数据 - */ - public List selectMaintainerCompanyList(String maintainerId){ - MaintainerCompany maintainerCompany = new MaintainerCompany(); - maintainerCompany.setWhere("where maintainerid='"+maintainerId+"'"); - List maintainerCompanies =maintainerCompanyDao.selectListByWhere(maintainerCompany); - for (int i=0;i getCompanyMaintainer(String companyId) { - MaintainerCompany maintainerCompany = new MaintainerCompany(); - maintainerCompany.setWhere("where companyId='"+companyId+"'"); - List maintainerCompanies =maintainerCompanyDao.selectListByWhere(maintainerCompany); - String maintainerIds=""; - for (MaintainerCompany item : maintainerCompanies) { - if(!maintainerIds.isEmpty()){ - maintainerIds+="','"; - } - maintainerIds+=item.getMaintainerid(); - } - List maintainers=this.selectListByWhere("where id in ('"+maintainerIds+"')"); - return maintainers; - } - /** - * 判断字符串是否在数组中 - * @param str - * @param strArray - * @return - */ - public boolean isInArry(String str,String[] strArray){ - for (int i = 0; i < strArray.length; i++) { - if (strArray[i].equals(str)) { - return true; - } - } - return false; - } - /** - * 保存维护商可维护的厂区 - * */ - public int saveMaintainerCompany(String maintainerId,String companyIds){ - String[] datas = companyIds.split(","); - int insres=0; - MaintainerCompany maintainerCompany = new MaintainerCompany(); - maintainerCompany.setWhere("where maintainerid='"+maintainerId+"'"); - Listlist =maintainerCompanyDao.selectListByWhere(maintainerCompany); - String oldIds="";//数据库中原有的数据的id - String newIds = "";//页面中传过来的数据id - for (MaintainerCompany item : list) { - if (oldIds!="") { - oldIds+=","; - } - oldIds+=item.getId(); - } - for (String item : datas) { - maintainerCompany.setWhere("where maintainerid='"+maintainerId+"' and companyid='"+item+"'"); - Listlisttwo =maintainerCompanyDao.selectListByWhere(maintainerCompany); - if (newIds!="") { - newIds+=","; - } - if (listtwo !=null && listtwo.size()>0) { - newIds+= listtwo.get(0).getId(); - } - } - //当原有的运维商关联厂区数据id不在新的关联的id数组中时,默认为被取消,删除此条数据 - String[] oldIdsArr = oldIds.split(","); - String[] newIdsArr = newIds.split(","); - for (int i = 0; i < oldIdsArr.length; i++) { - if (!isInArry(oldIdsArr[i], newIdsArr)) { - insres=maintainerCompanyDao.deleteByPrimaryKey(oldIdsArr[i]); - } - } - return insres; - } - /** - * 保存维护商可维护的厂区,单条数据保存 - * */ - public int insertMaintainerCompany(MaintainerCompany maintainerCompany){ - int insres=0; - MaintainerCompany maintainerCompanytwo = new MaintainerCompany(); - maintainerCompanytwo.setWhere("where companyid='"+maintainerCompany.getCompanyid()+"' and maintainerid='"+maintainerCompany.getMaintainerid()+"'"); - int delres=maintainerCompanyDao.deleteByWhere(maintainerCompanytwo); - insres += maintainerCompanyDao.insert(maintainerCompany); - return insres; - } - /** - * 根据运维商关联维护厂区的id获取数据 - * @param id 运维商关联维护厂区表中的id - * @return - */ - public MaintainerCompany selectMaintainerCompanyById(String id) { - return maintainerCompanyDao.selectByPrimaryKey(id); - } - -} diff --git a/src/com/sipai/service/maintenance/MaintainerTypeService.java b/src/com/sipai/service/maintenance/MaintainerTypeService.java deleted file mode 100644 index 8f0b243e..00000000 --- a/src/com/sipai/service/maintenance/MaintainerTypeService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.MaintainerDao; -import com.sipai.dao.maintenance.MaintainerTypeDao; -import com.sipai.dao.maintenance.MaintenanceDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.tools.CommService; - -@Service -public class MaintainerTypeService implements CommService{ - @Resource - private MaintainerTypeDao maintainerTypeDao; - - @Override - public MaintainerType selectById(String id) { - return maintainerTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return maintainerTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MaintainerType maintainerType) { - return maintainerTypeDao.insert(maintainerType); - } - - @Override - public int update(MaintainerType maintainerType) { - return maintainerTypeDao.updateByPrimaryKeySelective(maintainerType); - } - - @Override - public List selectListByWhere(String wherestr) { - MaintainerType maintainerType = new MaintainerType(); - maintainerType.setWhere(wherestr); - return maintainerTypeDao.selectListByWhere(maintainerType); - } - - @Override - public int deleteByWhere(String wherestr) { - MaintainerType maintainerType = new MaintainerType(); - maintainerType.setWhere(wherestr); - return maintainerTypeDao.deleteByWhere(maintainerType); - } -} diff --git a/src/com/sipai/service/maintenance/MaintenanceDetailService.java b/src/com/sipai/service/maintenance/MaintenanceDetailService.java deleted file mode 100644 index 67702b4c..00000000 --- a/src/com/sipai/service/maintenance/MaintenanceDetailService.java +++ /dev/null @@ -1,1287 +0,0 @@ -package com.sipai.service.maintenance; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.user.Unit; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.entity.workorder.WorkorderRepairContent; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.RuntimeService; -import org.activiti.engine.history.HistoricActivityInstance; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.MaintenanceDao; -import com.sipai.dao.maintenance.MaintenanceDetailDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentMaintain; -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.LibraryFaultBloc; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.MaintenancePlanService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.BonusPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.RoleService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Service -public class MaintenanceDetailService implements CommService { - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private MaintenanceDetailDao maintenanceDetailDao; - @Resource - private WorkflowService workflowService; - @Resource - private AbnormityService abnormityService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private MaintenanceService maintenanceService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private BonusPointService bonusPointService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private RoleService roleService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private RuntimeService runtimeService; - @Resource - private CompanyService companyService; - - @Override - public MaintenanceDetail selectById(String id) { - MaintenanceDetail item = maintenanceDetailDao.selectByPrimaryKey(id); - if (item != null && item.getCompanyid() != null && !item.getCompanyid().isEmpty()) { - Company company = unitService.getCompById(item.getCompanyid()); - item.setCompany(company); - } - if (item != null && item.getPlan_id() != null) { - item.setMaintenancePlan(this.maintenancePlanService.selectById(item.getPlan_id())); - ; - } - if (item != null && item.getProcessSectionId() != null && !item.getProcessSectionId().isEmpty()) { -// ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); -// item.setProcessSection(processSection); - List processSections = processSectionService.selectListByWhere("where 1=1 and unit_id = '" + item.getCompanyid() + "' and code = '" + item.getProcessSectionId() + "'"); - if (processSections != null && processSections.size() > 0) { - item.setProcessSection(processSections.get(0)); - } - } - if (item != null && item.getEquipmentId() != null && !item.getEquipmentId().isEmpty()) { - String equipmentIds = item.getEquipmentId().replace(",", "','"); - List equipmentCards = equipmentCardService.selectListByWhere("where id in ('" + equipmentIds + "')"); - String equipmentNames = ""; - String equipmentCardIds = ""; - for (EquipmentCard equipmentCard : equipmentCards) { - if (equipmentNames != "") { - equipmentNames += ","; - } - equipmentNames += equipmentCard.getEquipmentname(); - if (equipmentCardIds != "") { - equipmentCardIds += ","; - } - equipmentCardIds += equipmentCard.getEquipmentcardid(); - } - item.setEquipmentNames(equipmentNames); - item.setEquipmentCardIds(equipmentCardIds); - } - if (item != null && item.getProblemtypeid() != null && !item.getProblemtypeid().isEmpty()) { - String problemTypeIds = item.getProblemtypeid().replace(",", "','"); - List faultLibraries = libraryFaultBlocService.selectListByWhere("where id in ('" + problemTypeIds + "')"); - String problemTypeNames = ""; - for (LibraryFaultBloc libraryFaultBloc : faultLibraries) { - if (problemTypeNames != "") { - problemTypeNames += ","; - } - problemTypeNames += libraryFaultBloc.getFaultName(); - } - item.setProblemTypeNames(problemTypeNames); - } - if (item != null && item.getInsuser() != null && !item.getInsuser().isEmpty()) { - User user = userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - } - if (item != null && item.getSolver() != null && !item.getSolver().isEmpty()) { - String solverIds = item.getSolver().replace(",", "','"); - List users = userService.selectListByWhere("where id in ('" + solverIds + "')"); - String solverNames = ""; - for (User user : users) { - if (solverNames != "") { - solverNames += ","; - } - solverNames += user.getCaption(); - } - item.set_solverName(solverNames); - } - - return item; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - MaintenanceDetail maintenanceDetail = this.selectById(id); - String pInstancId = maintenanceDetail.getProcessid(); - if (pInstancId != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + id + "'"); - //异常、保养计划和检修计划关联表清除记录 - planRecordAbnormityService.deleteByWhere("where son_id='" + id + "'"); - return maintenanceDetailDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(MaintenanceDetail maintenanceDetail) { - return maintenanceDetailDao.insert(maintenanceDetail); - } - - @Transactional - public int start(MaintenanceDetail maintenanceDetail) { - try { - Map variables = new HashMap(); - if (!maintenanceDetail.getSolver().isEmpty()) { - variables.put("userIds", maintenanceDetail.getSolver()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - - variables.put("applicantId", null); - - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.B_Maintenance.getId() + "-" + maintenanceDetail.getCompanyid() + "-" + maintenanceDetail.getType()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(maintenanceDetail.getId(), maintenanceDetail.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - maintenanceDetail.setProcessid(processInstance.getId()); - maintenanceDetail.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - - int res = 0; - if (maintenanceDetail.getId() != null) { - MaintenanceDetail entity = maintenanceDetailDao.selectByPrimaryKey(maintenanceDetail.getId()); - if (entity != null) { - //存在 update - res = maintenanceDetailDao.updateByPrimaryKeySelective(maintenanceDetail); - } else { - //不存在 insert - res = maintenanceDetailDao.insert(maintenanceDetail); - } - } - - /*if (res == 1) { - - }*/ - - if (maintenanceDetail.getSolver() != null && !maintenanceDetail.getSolver().equals("")) { - String str = maintenanceDetail.getSolver(); - boolean status = str.contains(","); - if (status) { - //选择多人 - String[] userId = str.split(","); - for (int i = 0; i < userId.length; i++) { - maintenanceDetail.setSolver(userId[i]);//选择多人也每次赋值一个人 - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecord.sendMessage(maintenanceDetail.getSolver(), ""); - } - } else { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintenanceDetail); - businessUnitRecord.sendMessage(maintenanceDetail.getSolver(), ""); - } - } - - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 根据当前任务节点更新运维详情状态 - */ - public int updateStatus(String id) { - MaintenanceDetail maintenanceDetail = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(maintenanceDetail.getProcessid()).singleResult(); - if (task != null) { - maintenanceDetail.setStatus(task.getName()); - } else { - maintenanceDetail.setStatus(MaintenanceDetail.Status_Finish); - maintenanceDetail.setActualFinishDate(CommUtil.nowDate()); - //maintenanceDetail.setActualMoney(maintenanceDetail.getPlanMoney()); - //任务节点更新的同时,更新异常的处理状态 - List abnormities = this.planRecordAbnormityService.selectListByRepairId(id); - if (abnormities != null && abnormities.size() > 0) { - for (Abnormity abnormity : abnormities) { - abnormity.setStatus(Abnormity.Status_Finish); - this.abnormityService.update(abnormity); - } - } - } - int res = this.update(maintenanceDetail); - //保存负责人下发任务和保养积分 - if (res == 1 && MaintenanceDetail.Status_Finish.equals(maintenanceDetail.getStatus()) && - (maintenanceDetail.getMaintenanceid() == null || maintenanceDetail.getMaintenanceid().isEmpty())) { - bonusPointService.saveBonusPoint(maintenanceDetail); - } - return res; - } - - @Override - public int update(MaintenanceDetail maintenanceDetail) { - int res = maintenanceDetailDao.updateByPrimaryKeySelective(maintenanceDetail); - if (res == 1 && maintenanceDetail.getJudgemaintainerstaff() != null && maintenanceDetail.getJudgeresult() != null && - (maintenanceDetail.getMaintenanceid() == null || maintenanceDetail.getMaintenanceid().isEmpty())) { - bonusPointService.saveBonusPoint_Judge(maintenanceDetail); - } - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List maintenanceDetails = maintenanceDetailDao.selectListByWhere(maintenanceDetail); - for (MaintenanceDetail item : maintenanceDetails) { - if (item.getMaintenanceid() != null && !item.getMaintenanceid().isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(item.getMaintenanceid()); - item.setMaintenance(maintenance); - } - ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); - item.setProcessSection(processSection); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - - /*2019-02-27 YYJ 添加 insuser的实体类*/ - User user = this.userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - /*2019-03-08 YYJ 添加 libraryFaultBloc的名称String*/ - /*if (item.getProblemtypeid() != null) { - String libraryFaultBlocIds = item.getProblemtypeid().replace(",", "','"); - List libraryFaultBloc = this.libraryFaultBlocService.selectListByWhere(" where id in ('" + libraryFaultBlocIds + "')"); - String libraryFaultBlocNames = ""; - for (int i = 0; i < libraryFaultBloc.size(); i++) { - if (i == 0) { - libraryFaultBlocNames = libraryFaultBloc.get(i).getFaultName(); - } else { - libraryFaultBlocNames += "," + libraryFaultBloc.get(i).getFaultName(); - } - } - item.setProblemTypeNames(libraryFaultBlocNames); - }*/ - } - return maintenanceDetails; - } - - public List selectSimpleListByWhere(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List maintenanceDetails = maintenanceDetailDao.selectListByWhere(maintenanceDetail); - return maintenanceDetails; - } - - public List selectListByWhere20200831(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List maintenanceDetails = maintenanceDetailDao.selectListByWhere20200831(maintenanceDetail); - for (MaintenanceDetail item : maintenanceDetails) { - if (item.getMaintenanceid() != null && !item.getMaintenanceid().isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(item.getMaintenanceid()); - item.setMaintenance(maintenance); - } - ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); - item.setProcessSection(processSection); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - - /*2019-02-27 YYJ 添加 insuser的实体类*/ - User user = this.userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - /*2019-03-08 YYJ 添加 libraryFaultBloc的名称String*/ - if (item.getProblemtypeid() != null) { - String libraryFaultBlocIds = item.getProblemtypeid().replace(",", "','"); - List libraryFaultBloc = this.libraryFaultBlocService.selectListByWhere(" where id in ('" + libraryFaultBlocIds + "')"); - String libraryFaultBlocNames = ""; - for (int i = 0; i < libraryFaultBloc.size(); i++) { - if (i == 0) { - libraryFaultBlocNames = libraryFaultBloc.get(i).getFaultName(); - } else { - libraryFaultBlocNames += "," + libraryFaultBloc.get(i).getFaultName(); - } - } - item.setProblemTypeNames(libraryFaultBlocNames); - } - } - return maintenanceDetails; - } - - /** - * 与Maintenance联查 - */ - public List selectListWithMaintenanceByWhere(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List maintenanceDetails = maintenanceDetailDao.selectListWithMaintenanceByWhere(maintenanceDetail); - for (MaintenanceDetail item : maintenanceDetails) { - if (item.getMaintenanceid() != null && !item.getMaintenanceid().isEmpty()) { - Maintenance maintenance = maintenanceService.selectById(item.getMaintenanceid()); - item.setMaintenance(maintenance); - } - - if (item.getCompanyid() != null && !item.getCompanyid().isEmpty()) { - Company company = unitService.getCompById(item.getCompanyid()); - item.setCompany(company); - } - - /*if (item != null && item.getInsuser() != null && !item.getInsuser().isEmpty()) { - User user = userService.getUserById(item.getInsuser()); - item.setInsertUser(user); - }*/ - - //执行人 - if (item.getSolver() != null && !item.getSolver().equals("")) { - User user = userService.getUserById(item.getSolver()); - if (user != null) { - item.set_solverName(user.getCaption()); - } - } - - //工艺段 - if (item.getProcessSectionId() != null && !item.getProcessSectionId().equals("")) { - List processSections = this.processSectionService.selectSimpleListByWhere("where unit_id = '" + item.getCompanyid() + "' and code = '" + item.getProcessSectionId() + "'"); - if (processSections != null && processSections.size() > 0) { - item.setProcessSection(processSections.get(0)); - } - } - - /*if (item != null && item.getEquipmentId() != null && !item.getEquipmentId().isEmpty()) { - String equipmentIds = item.getEquipmentId().replace(",", "','"); - List equipmentCards = equipmentCardService.selectListByWhere("where id in ('" + equipmentIds + "')"); - String equipmentNames = ""; - String equipmentCardIds = ""; - for (EquipmentCard equipmentCard : equipmentCards) { - if (equipmentNames != "") { - equipmentNames += ","; - } - equipmentNames += equipmentCard.getEquipmentname(); - if (equipmentCardIds != "") { - equipmentCardIds += ","; - } - equipmentCardIds += equipmentCard.getEquipmentcardid(); - } - item.setEquipmentNames(equipmentNames); - item.setEquipmentCardIds(equipmentCardIds); - }*/ - - /*if (item != null && item.getProblemtypeid() != null && !item.getProblemtypeid().isEmpty()) { - String problemTypeIds = item.getProblemtypeid().replace(",", "','"); - List faultLibraries = libraryFaultBlocService.selectListByWhere("where id in ('" + problemTypeIds + "')"); - String problemTypeNames = ""; - for (LibraryFaultBloc libraryFaultBloc : faultLibraries) { - if (problemTypeNames != "") { - problemTypeNames += ","; - } - problemTypeNames += libraryFaultBloc.getFaultName(); - } - item.setProblemTypeNames(problemTypeNames); - }*/ - - } - return maintenanceDetails; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List maintenanceDetails = this.selectListByWhere(wherestr); - for (MaintenanceDetail item : maintenanceDetails) { - String pInstancId = item.getProcessid(); - if (pInstancId != null) { - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + item.getId() + "'"); - //异常、保养计划和检修计划关联表清除记录 - planRecordAbnormityService.deleteByWhere("where son_id='" + item.getId() + "'"); - } - } - return maintenanceDetailDao.deleteByWhere(maintenanceDetail); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 检修记录发起 - */ - /*@Transactional - public int issueOverHaulRecord(MaintenanceDetail maintenanceDetail) { - try { - Date nowTime = new Date(); - //当前日期 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(nowTime); - calendar.add(Calendar.DAY_OF_MONTH, maintenanceDetail.getPlanConsumeTime()); - maintenanceDetail.setPlannedenddt(sdf.format(calendar.getTime())); - maintenanceDetail.setStatus(MaintenanceDetail.Status_Start); - List users =roleService.getRoleUsers("where serial='"+MaintenanceCommString.RoleSerial_Maintain+"' and bizid='"+maintenanceDetail.getCompanyid()+"'"); - String userIds=""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds+=","; - } - userIds+=user.getId(); - } - maintenanceDetail.setSolver(userIds); - int result= this.start(maintenanceDetail); - if (result==1) { - return result; - }else{ - throw new RuntimeException(); - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - }*/ - - /*** - * 获取下发给个人的缺陷和异常 - * @param startDate - * @param bizid - * @param userid - * @return - */ - public int[] getCount(String startDate, String bizid, String userid) { - String nowDate = CommUtil.nowDate(); - String wherestr = " where insdt between '" + startDate + "' and '" + nowDate + "'"; - String wherestr4Abnormity = wherestr + " and status = '" + MaintenanceDetail.Status_Wait + "'"; - - wherestr += " and companyId ='" + bizid + "' "; - wherestr4Abnormity += " and biz_id ='" + bizid + "' "; - - String wherestr4Start = wherestr + " and status not in ('" + MaintenanceDetail.Status_Finish + "','" + MaintenanceDetail.Status_Wait + "') and solver like '%" + userid + "%'"; - //String wherestr4Finish = wherestr + " and status = '"+MaintenanceDetail.Status_Finish+"' and solver like '%"+userid+"%'"; - //20200421修改 - String wherestr4Finish = wherestr + " and status = '" + MaintenanceDetail.Status_Finish + "'"; - List abnormityList = this.abnormityService.selectListByWhere(wherestr4Abnormity); - - List startList = this.selectListByWhere(wherestr4Start); - List finishList = this.selectListByWhere(wherestr4Finish); - int[] count = {abnormityList.size(), startList.size(), finishList.size()}; - return count; - } - - /** - * 运维详情审核 - * - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /*** - * 获取查询范围内的总金额 - * @param wherestr - * @return - */ - public MaintenanceDetail selectTotalMoneyByWhere(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - MaintenanceDetail one = maintenanceDetailDao.selectTotalMoneyByWhere(maintenanceDetail); - return one; - } - - /*** - * 获取数量 - * @param wherestr - * @return - */ - public List selectTotalBizNumberByWhere(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List list = this.maintenanceDetailDao.selectTotalBizNumberByWhere(maintenanceDetail); - return list; - } - - /*** - * 获取保养单 保养计划类型 - * @param wherestr - * @return - */ - public List getPlanTypeByWhere(String wherestr) { - MaintenanceDetail maintenanceDetail = new MaintenanceDetail(); - maintenanceDetail.setWhere(wherestr); - List list = this.maintenanceDetailDao.getPlanTypeByWhere(maintenanceDetail); - return list; - } - /** - * 导出保养记录表 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - /*@SuppressWarnings("deprecation") - public void downloadExcel(HttpServletResponse response,List maintenanceDetail,String type) throws IOException { - String fileName = "维修保养记录表"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "维修保养记录表"; - if(MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(type)){ - fileName = "保养记录表"+CommUtil.nowDate().substring(0,10)+".xls"; - title = "保养记录表"; - }else if(MaintenanceCommString.MAINTENANCE_TYPE_REPAIR.equals(type)){ - fileName = "维修记录表"+CommUtil.nowDate().substring(0,10)+".xls"; - title = "维修记录表"; - } - - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 7000); - sheet.setColumnWidth(3, 6000); - sheet.setColumnWidth(4, 6000); - sheet.setColumnWidth(5, 6000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = this.getExcelStr("ExcelEquipmentMaintain"); - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("维修保养记录表"); - if(MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(type)){ - cell.setCellValue("保养记录表"); - }else if(MaintenanceCommString.MAINTENANCE_TYPE_REPAIR.equals(type)){ - cell.setCellValue("维修记录表"); - } - - //遍历集合数据,产生数据行 - for(int i = 0; i < maintenanceDetail.size(); i++){ - row = sheet.createRow(i+3);//第三行为插入的数据行 - row.setHeight((short) 600); - MaintenanceDetail entity = maintenanceDetail.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i+1); - break; - case 1://厂区 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - if (null != entity.getCompany()) { - cell_1.setCellValue(entity.getCompany().getName()); - }else { - cell_1.setCellValue(""); - } - break; - case 2://保养编号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(entity.getDetailNumber()); - break; - case 3://保养设备 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(entity.getEquipmentNames()); - break; - case 4://设备编号 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(entity.getEquipmentCardIds()); - break; - case 5://保养内容 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(entity.getProblemcontent()); - case 6://发起时间 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(entity.getInsdt()); - break; - case 7://类型 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - if(MaintenanceCommString.MAINTENANCE_TYPE_REPAIR.equals(entity.getType()) ){ - cell_7.setCellValue("缺陷"); - }else if(MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL.equals(entity.getType()) ){ - cell_7.setCellValue("检修"); - }else if(MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN.equals(entity.getType()) ){ - cell_7.setCellValue("保养"); - } - - break; - case 8://保养状态 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - if(MaintenanceDetail.Status_Start.equals(entity.getStatus())||Maintenance.TYPE_SUPPLEMENT.equals(entity.getType()) ){ - cell_8.setCellValue("处理中"); - }else if(MaintenanceDetail.Status_Start.equals(entity.getStatus()) ){ - cell_8.setCellValue("已下发"); - }else if(MaintenanceDetail.Status_Finish.equals(entity.getStatus()) ){ - cell_8.setCellValue("已完成"); - } - break; - - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - }*/ - - /** - * 导出缺陷(单个详情) - * - * @param response - * @param maintenanceDetail - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadListExcel(HttpServletResponse response, List maintenanceDetail) throws IOException { - String fileName = "缺陷记录表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 8000);// - sheet.setColumnWidth(1, 14000);// - sheet.setColumnWidth(2, 6000);// - sheet.setColumnWidth(3, 6000);// - sheet.setColumnWidth(4, 6000);// - sheet.setColumnWidth(5, 6000);// - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - String excelTitleStr = "缺陷编号,缺陷情况描述,上报人,上报时间,完成人,完成时间"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 800); - for (int s = 0; s < excelTitle.length; s++) { - HSSFCell cell = row.createCell(s); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[s]); - cell.setCellValue(text); - } - for (int i = 0; i < maintenanceDetail.size(); i++) { - row = sheet.createRow(1 + i); - row.setHeight((short) 400); - // 工单号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(maintenanceDetail.get(i).getDetailNumber()); - - //查询异常上报信息 - String insertUser = "";//上报人员 - String handleUser = "";//处理人员 - - if (maintenanceDetail.get(i).getInsuser() != null) { - User user = userService.getUserById(maintenanceDetail.get(i).getInsuser()); - if (user != null) { - insertUser += user.getCaption(); - } - } - - if (maintenanceDetail.get(i).getSolver() != null) { - String[] ids = maintenanceDetail.get(i).getSolver().split(","); - if (ids != null) { - for (int j = 0; j < ids.length; j++) { - User user = userService.getUserById(ids[j]); - if (user != null) { - handleUser += user.getCaption(); - } - } - } - } - - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(maintenanceDetail.get(i).getProblemcontent()); - - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(insertUser); - - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - if (maintenanceDetail.get(i).getInsdt() != null && !maintenanceDetail.get(i).getInsdt().equals("")) { - cell_3.setCellValue(maintenanceDetail.get(i).getInsdt().substring(0, 19)); - } else { - cell_3.setCellValue(""); - } - - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(handleUser); - - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - if (maintenanceDetail.get(i).getActualFinishDate() != null && !maintenanceDetail.get(i).getActualFinishDate().equals("")) { - cell_5.setCellValue(maintenanceDetail.get(i).getActualFinishDate().substring(0, 19)); - } else { - cell_5.setCellValue(""); - } - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 导出缺陷(单个详情) - * - * @param response - * @param maintenanceDetail - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadExcel(HttpServletResponse response, List maintenanceDetail) throws IOException { - String fileName = "保养记录表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - if (maintenanceDetail != null && maintenanceDetail.size() > 0) { - for (int i = 0; i < maintenanceDetail.size(); i++) { - - String equcode = ""; - String equname = ""; - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(maintenanceDetail.get(i).getEquipmentId()); - if (equipmentCard != null) { - equcode = equipmentCard.getEquipmentcardid(); - equname = equipmentCard.getEquipmentname(); - } - - String title = equname + "(" + (i + 1) + ")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 8000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 8000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); -// columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); -// columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); -// columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - //标题 - CellRangeAddress region_head = new CellRangeAddress(0, 0, 0, 3); - sheet.addMergedRegion(region_head); - HSSFRow row_head = sheet.createRow(0);//第六行 - - HSSFCell cellname_head = row_head.createCell(0); - cellname_head.setCellStyle(headStyle); - cellname_head.setCellValue("维修工单"); - HSSFCell cellname_head_2 = row_head.createCell(1); - cellname_head_2.setCellStyle(headStyle); - HSSFCell cellname_head_3 = row_head.createCell(2); - cellname_head_3.setCellStyle(headStyle); - HSSFCell cellname_head_4 = row_head.createCell(3); - cellname_head_4.setCellStyle(headStyle); - - - // HSSFRow handRow = sheet.createRow(0); - // //handRow.setHeight((short) 800); - // HSSFCell cell = handRow.createCell(0); - // cell.setCellStyle(headStyle); - // cell.setCellValue("123"); - - //工单号 - HSSFRow handRowName2 = sheet.createRow(1);//第二行 - - HSSFCell cellname2 = handRowName2.createCell(0); - cellname2.setCellStyle(columnNameStyle); - cellname2.setCellValue("工单号"); - - HSSFCell cellval2 = handRowName2.createCell(1); - cellval2.setCellStyle(listStyle); - cellval2.setCellValue(maintenanceDetail.get(i).getDetailNumber()); - - //填报日期 - HSSFCell cellname3 = handRowName2.createCell(2); - cellname3.setCellStyle(columnNameStyle); - cellname3.setCellValue("填报日期"); - - HSSFCell cellval3 = handRowName2.createCell(3); - cellval3.setCellStyle(listStyle); - cellval3.setCellValue(maintenanceDetail.get(i).getInsdt().substring(0, 19)); - - //工作任务地 - HSSFRow handRowName3 = sheet.createRow(2);//第三行 - - HSSFCell cellname4 = handRowName3.createCell(0); - cellname4.setCellStyle(columnNameStyle); - cellname4.setCellValue("工作任务地"); - - HSSFCell cellval5 = handRowName3.createCell(1); - cellval5.setCellStyle(listStyle); - ProcessSection processSection = processSectionService.selectById(maintenanceDetail.get(i).getProcessSectionId()); - if (processSection != null) { - cellval5.setCellValue(processSection.getSname()); - } else { - cellval5.setCellValue(""); - } - - //填报部门 - HSSFCell cellname6 = handRowName3.createCell(2); - cellname6.setCellStyle(columnNameStyle); - cellname6.setCellValue("填报部门"); - - HSSFCell cellval7 = handRowName3.createCell(3); - cellval7.setCellStyle(listStyle); - Company company = companyService.selectByPrimaryKey(maintenanceDetail.get(i).getCompanyid()); - if (company != null) { - cellval7.setCellValue(company.getSname()); - } else { - cellval7.setCellValue(""); - } - - //设备编号 - HSSFRow handRowName4 = sheet.createRow(3);//第四行 - - HSSFCell cellname8 = handRowName4.createCell(0); - cellname8.setCellStyle(columnNameStyle); - cellname8.setCellValue("设备编号"); - - HSSFCell cellval9 = handRowName4.createCell(1); - cellval9.setCellStyle(listStyle); - cellval9.setCellValue(equcode); - - //设备名称 - HSSFCell cellname10 = handRowName4.createCell(2); - cellname10.setCellStyle(columnNameStyle); - cellname10.setCellValue("设备名称"); - - HSSFCell cellval11 = handRowName4.createCell(3); - cellval11.setCellStyle(listStyle); - cellval11.setCellValue(equname); - - //开始时间 - HSSFRow handRowName5 = sheet.createRow(4);//第五行 - - HSSFCell cellname12 = handRowName5.createCell(0); - cellname12.setCellStyle(columnNameStyle); - cellname12.setCellValue("开始时间"); - - HSSFCell cellval13 = handRowName5.createCell(1); - cellval13.setCellStyle(listStyle); - if (maintenanceDetail.get(i).getInsdt() != null && !maintenanceDetail.get(i).getInsdt().equals("")) { - cellval13.setCellValue(maintenanceDetail.get(i).getInsdt().substring(0, 19)); - } else { - cellval13.setCellValue(""); - } - - //结束时间 - HSSFCell cellname14 = handRowName5.createCell(2); - cellname14.setCellStyle(columnNameStyle); - cellname14.setCellValue("结束时间"); - - HSSFCell cellval15 = handRowName5.createCell(3); - cellval15.setCellStyle(listStyle); - if (maintenanceDetail.get(i).getActualFinishDate() != null && !maintenanceDetail.get(i).getActualFinishDate().equals("")) { - cellval15.setCellValue(maintenanceDetail.get(i).getActualFinishDate().substring(0, 19)); - } else { - cellval15.setCellValue(""); - } - - - //维修内容 - CellRangeAddress region = new CellRangeAddress(5, 5, 1, 3); - sheet.addMergedRegion(region); - HSSFRow handRowName6 = sheet.createRow(5);//第六行 - - HSSFCell cellname16 = handRowName6.createCell(0); - cellname16.setCellStyle(columnNameStyle); - cellname16.setCellValue("维修内容"); - - HSSFCell cellname17 = handRowName6.createCell(1); - - //为了合并单元格样式 - HSSFCell cellname17_2 = handRowName6.createCell(2); - HSSFCell cellname17_3 = handRowName6.createCell(3); - cellname17_2.setCellStyle(listStyle); - cellname17_3.setCellStyle(listStyle); - - cellname17.setCellStyle(listStyle); - cellname17.setCellValue(maintenanceDetail.get(i).getProblemcontent()); - - //维修人员 - CellRangeAddress region2 = new CellRangeAddress(6, 6, 1, 3); - sheet.addMergedRegion(region2); - HSSFRow handRowName7 = sheet.createRow(6);//第七行 - - HSSFCell cellname18 = handRowName7.createCell(0); - cellname18.setCellStyle(columnNameStyle); - cellname18.setCellValue("维修人员"); - - HSSFCell cellname19 = handRowName7.createCell(1); - - //为了合并单元格样式 - HSSFCell cellname19_2 = handRowName7.createCell(2); - HSSFCell cellname19_3 = handRowName7.createCell(3); - cellname19_2.setCellStyle(listStyle); - cellname19_3.setCellStyle(listStyle); - - cellname19.setCellStyle(listStyle); - User user = userService.getUserById(maintenanceDetail.get(i).getInsuser()); - if (user != null) { - cellname19.setCellValue(user.getCaption()); - } else { - cellname19.setCellValue(""); - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 读取Excel表格的配置文件,中文表头 - * - * @param key - * @return - */ - private String getExcelStr(String key) { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("excelConfig.properties"); - Properties prop = new Properties(); - try { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));//解决读取properties文件中产生中文乱码的问题 - prop.load(bufferedReader); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String str = prop.getProperty(key).replace(" ", "");//去掉空格 - return str; - } - - /** - * 根据设备类型查询设备故障次数 - * - * @param wherestr - * @return - */ - public JSONArray getRepairCount4Class(String wherestr) { - MaintenanceDetail entity = new MaintenanceDetail(); - entity.setWhere(wherestr); - List list = maintenanceDetailDao.getRepairCount4Class(entity); - - JSONArray jsonArray = new JSONArray(); - for (MaintenanceDetail maintenanceDetail : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("classname", maintenanceDetail.get_classname()); - jsonObject.put("repaircount", maintenanceDetail.get_repaircount()); - jsonArray.add(jsonObject); - } - return jsonArray; - } - - /** - * 根据设备类型查询设备故障次数 - * - * @param wherestr - * @return - */ - public List getRepairCount4Equipment(String wherestr) { - MaintenanceDetail entity = new MaintenanceDetail(); - entity.setWhere(wherestr); - List list = maintenanceDetailDao.getRepairCount4Equipment(entity); - return list; - } - - public List selectListByNum(String wherestr, String str) { - List list = maintenanceDetailDao.selectListByNum(wherestr, str); - return list; - } -} diff --git a/src/com/sipai/service/maintenance/MaintenanceEquipmentConfigService.java b/src/com/sipai/service/maintenance/MaintenanceEquipmentConfigService.java deleted file mode 100644 index 39b780e5..00000000 --- a/src/com/sipai/service/maintenance/MaintenanceEquipmentConfigService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.service.maintenance; - -import com.sipai.entity.maintenance.MaintenanceEquipmentConfig; - -import java.util.List; - -public interface MaintenanceEquipmentConfigService { - public abstract MaintenanceEquipmentConfig selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(MaintenanceEquipmentConfig entity); - - public abstract int update(MaintenanceEquipmentConfig entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/maintenance/MaintenanceRecordService.java b/src/com/sipai/service/maintenance/MaintenanceRecordService.java deleted file mode 100644 index 674ef717..00000000 --- a/src/com/sipai/service/maintenance/MaintenanceRecordService.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.MaintenanceRecordDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.maintenance.Maintainer; -import com.sipai.entity.maintenance.MaintainerType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceRecord; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class MaintenanceRecordService implements CommService{ - @Resource - private MaintenanceRecordDao maintenanceRecordDao; - @Resource - private MaintenanceService maintenanceService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Override - public MaintenanceRecord selectById(String id) { - return maintenanceRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return maintenanceRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MaintenanceRecord maintenanceRecord) { - return maintenanceRecordDao.insert(maintenanceRecord); - } - - @Override - public int update(MaintenanceRecord maintenanceRecord) { - return maintenanceRecordDao.updateByPrimaryKeySelective(maintenanceRecord); - } - - @Override - public List selectListByWhere(String wherestr) { - MaintenanceRecord maintenanceRecord = new MaintenanceRecord(); - maintenanceRecord.setWhere(wherestr); - List maintenanceRecords =maintenanceRecordDao.selectListByWhere(maintenanceRecord); - for (MaintenanceRecord item : maintenanceRecords) { - Unit unit = unitService.getUnitById(item.getUnitid()); - item.setUnit(unit); - User user = userService.getUserById(item.getInsuser()); - item.setUser(user); - } - return maintenanceRecords; - } - - @Override - public int deleteByWhere(String wherestr) { - MaintenanceRecord maintenanceRecord = new MaintenanceRecord(); - maintenanceRecord.setWhere(wherestr); - return maintenanceRecordDao.deleteByWhere(maintenanceRecord); - } - - public int saveRecord(Maintenance maintenance) { - int result=0; - //= maintenanceService.selectById(maintenanceId); - String status= maintenance.getStatus();{ - switch (status) { - case Maintenance.Status_Launch: - MaintenanceRecord maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getCompanyid()); - maintenanceRecord.setInsuser(maintenance.getInsuser()); - String record ="发起问题。问题描述:"+maintenance.getProblem(); - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_Submit_Problem: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getCompanyid()); - maintenanceRecord.setInsuser(maintenance.getApplicantid()); - record ="发布维护任务。"; - List units=unitService.selectListByWhere("where id='"+maintenance.getMaintainerid()+"'"); - if (units!=null && units.size()>0) { - record+="选择运维商"+units.get(0).getName(); - } - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_Confirm_Maintainer: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getMaintainerid()); - maintenanceRecord.setInsuser(maintenance.getManagerid()); - User user =userService.getUserById(maintenance.getManagerid()); - String mobile=user==null?"":user.getMobile(); - record ="确认维护订单。计划维护方式为"+maintenance.getMaintenancemethod()+",计划维护时间为"+maintenance.getMaintenancedt().substring(0,10)+",具体维护方式和时间以详细中的维护方式和维护日期为准,如有疑问可拨打电话:"+mobile; - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_Cancel_Maintainer: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getMaintainerid()); - maintenanceRecord.setInsuser(maintenance.getManagerid()); - units=unitService.selectListByWhere("where id='"+maintenance.getMaintainerid()+"'"); - record ="维护订单被"; - if (units!=null && units.size()>0) { - record+="运维商"+units.get(0).getName(); - } - record+="退回,退回理由为:"+maintenance.getCancelreason(); - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_Submit_Maintainer: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getMaintainerid()); - maintenanceRecord.setInsuser(maintenance.getManagerid()); - record ="提交维护内容。"; - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_CancelTOMaintainer: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getCompanyid()); - maintenanceRecord.setInsuser(maintenance.getApplicantid()); - units=unitService.selectListByWhere("where id='"+maintenance.getCompanyid()+"'"); - record ="维护订单被"; - if (units!=null && units.size()>0) { - record+="客户"+units.get(0).getName(); - } - record+="退回,退回理由为:"+maintenance.getCancelreason(); - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_Cancel: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getCompanyid()); - maintenanceRecord.setInsuser(maintenance.getApplicantid()); - units=unitService.selectListByWhere("where id='"+maintenance.getCompanyid()+"'"); - record ="作废维护订单!作废原因为:"+maintenance.getCancelreason(); - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - case Maintenance.Status_Finish: - maintenanceRecord= new MaintenanceRecord(); - maintenanceRecord.setId(CommUtil.getUUID()); - maintenanceRecord.setInsdt(CommUtil.nowDate()); - maintenanceRecord.setMaintenanceid(maintenance.getId()); - maintenanceRecord.setUnitid(maintenance.getCompanyid()); - maintenanceRecord.setInsuser(maintenance.getApplicantid()); - record ="确认维护完成。"; - maintenanceRecord.setRecord(record); - result =this.save(maintenanceRecord); - break; - default: - break; - } - } - return result; - } -} diff --git a/src/com/sipai/service/maintenance/MaintenanceService.java b/src/com/sipai/service/maintenance/MaintenanceService.java deleted file mode 100644 index af5e15c0..00000000 --- a/src/com/sipai/service/maintenance/MaintenanceService.java +++ /dev/null @@ -1,462 +0,0 @@ -package com.sipai.service.maintenance; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.IdentityService; -import org.activiti.engine.TaskService; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.MaintenanceDao; -import com.sipai.dao.maintenance.MaintenanceEquipmentDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.BonusPointService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class MaintenanceService implements CommService{ - @Resource - private MaintenanceDao maintenanceDao; - @Resource - private CommonFileService commonFileService; - @Resource - private UserService userService; - @Resource - private MsgServiceImpl msgService; - @Resource - private UnitService unitService; - @Resource - private WorkflowService workflowService; - @Resource - private TaskService taskService; - @Resource - private IdentityService identityService; - @Resource - private MaintenanceRecordService maintenanceRecordService; - @Resource - private MaintenanceEquipmentDao maintenanceEquipmentDao; - @Resource - private BonusPointService bonusPointService; - /* - private final String TBName_Problem ="tb_maintenance_problem_fille";*/ - private final String MsgType_Both ="ProblemSubmit"; - private final String MsgType_Msg ="ProduceRemand"; - - //厂区普通员工权限key - public final static String RoleSerial_Launch ="LaunchGroup"; - //厂区负责人权限key - public final static String RoleSerial_Applicant ="ApplicantGroup"; - //运维商负责人权限key - public final static String RoleSerial_Maintainer ="MaintainerGroup"; - //运维人员权限key - public final static String RoleSerial_Solver ="SolverGroup"; - @Override - public Maintenance selectById(String id) { - Maintenance maintenance =maintenanceDao.selectByPrimaryKey(id); - if (maintenance!=null && maintenance.getCompanyid()!=null && !maintenance.getCompanyid().isEmpty()) { - Company company = unitService.getCompById(maintenance.getCompanyid()); - maintenance.setCompany(company); - } - /*MaintenanceEquipment maintenanceEquipment = new MaintenanceEquipment(); - maintenanceEquipment.setWhere("where maintenanceId = '"+maintenance.getId()+"'"); - List maintenanceEquipments=maintenanceEquipmentDao.selectListByWhere(maintenanceEquipment); - String equipmentIds=""; - for (MaintenanceEquipment item : maintenanceEquipments) { - if(!equipmentIds.isEmpty()){ - equipmentIds+=","; - } - equipmentIds+=item.getEquipmentid(); - } - maintenance.setEquipmentIds(equipmentIds);*/ - return maintenance; - } - - @Override - public int deleteById(String id) { - Maintenance maintenance=this.selectById(id); - String pInstancId=maintenance.getProcessid(); - if(pInstancId!=null){ - workflowService.delProcessInstance(pInstancId); - } - return maintenanceDao.deleteByPrimaryKey(id); - } - - @Transactional - @Override - public int save(Maintenance entity) { - try{ - int res =0; - //第一次发起状态启动流程实例 - if(Maintenance.Status_Launch.equals(entity.getStatus()) ){ - Map variables = new HashMap<>(); - List list=unitService.getChildrenUsersByIdWithRole(entity.getCompanyid(),RoleSerial_Applicant); - String userids=""; - for (User user : list) { - if(!userids.isEmpty()){ - userids+=","; - } - userids+=user.getId(); - } - variables.put("userIds", userids); - variables.put("applicantId", null); - ProcessInstance processInstance =workflowService.startWorkflow(entity.getId(), entity.getInsuser(), ProcessType.S_Maintenance.getId(),variables); - if(processInstance!=null){ - entity.setProcessid(processInstance.getId()); - }else{ - return res; - } - } - res=this.maintenanceDao.insert(entity); - if(res==1 && Maintenance.Status_Launch.equals(entity.getStatus())){ - this.sendMessage(entity, ""); - //保存维护记录 - maintenanceRecordService.saveRecord(entity); - } - return res; - }catch(Exception e){ - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 只更新数据,不执行流程 - * - * */ - public int updateData(Maintenance maintenance) { - int result=maintenanceDao.updateByPrimaryKeySelective(maintenance); - if (result==1) { - //用户评价结算积分 - bonusPointService.saveBonusPoint_Judge(maintenance); - } - return result; - } - /** - * 流程流转 - * - * */ - @Transactional - @Override - public int update(Maintenance maintenance) { - try{ - Maintenance maintenance_old = this.selectById(maintenance.getId()); - - boolean status_flag=false;//状态变化标识 - boolean start_flag=false;//流程开始标识 - if(!maintenance.getStatus().equals(maintenance_old.getStatus())){ - status_flag= true; - } - - if(status_flag && Maintenance.Status_Launch.equals(maintenance.getStatus()) && maintenance_old.getProcessid()==null){ - //第一次发起状态启动流程实例 - Map variables = new HashMap<>(); - List list=unitService.getChildrenUsersByIdWithRole(maintenance.getCompanyid(),RoleSerial_Applicant); - String userids=""; - for (User user : list) { - if(!userids.isEmpty()){ - userids+=","; - } - userids+=user.getId(); - } - variables.put("userIds", userids); - variables.put("applicantId", null); - ProcessInstance processInstance =workflowService.startWorkflow(maintenance.getId(), maintenance.getInsuser(), ProcessType.S_Maintenance.getId(),variables); - if(processInstance!=null){ - maintenance.setProcessid(processInstance.getId()); - }else{ - return 0; - } - //保存维护记录 - maintenanceRecordService.saveRecord(maintenance); - start_flag=true; - } - int result=maintenanceDao.updateByPrimaryKeySelective(maintenance); - //保存关联设备,设备已不直接跟维护单关联 - /*if (result==1) { - String equipmentIds=maintenance.getEquipmentIds(); - if (equipmentIds!=null && !equipmentIds.isEmpty()) { - MaintenanceEquipment maintenanceEquipment = new MaintenanceEquipment(); - maintenanceEquipment.setWhere("where maintenanceId='"+maintenance.getId()+"'"); - maintenanceEquipmentDao.deleteByWhere(maintenanceEquipment); - String[] ids_Array= equipmentIds.split(","); - for (String item : ids_Array) { - if (item!=null && !item.isEmpty()) { - maintenanceEquipment = new MaintenanceEquipment(); - maintenanceEquipment.setId(CommUtil.getUUID()); - maintenanceEquipment.setInsdt(CommUtil.nowDate()); - maintenanceEquipment.setMaintenanceid(maintenance.getId()); - maintenanceEquipment.setEquipmentid(item); - maintenanceEquipmentDao.insert(maintenanceEquipment); - } - } - } - }*/ - //若存储的记录与新记录状态一致,则为保存信息,不发送消息,但有消息发布状态除外 - if(result==1 && (status_flag || maintenance.getStatus().equals(Maintenance.Status_Submit_Problem))){ - //更新内容可能缺少元素,此处重新获取更新后的数据 - maintenance= this.selectById(maintenance.getId()); - this.sendMessage(maintenance, ""); - } - //流程引擎联动,此时maintenance为数据库中最新的 - if(result==1 && status_flag && !start_flag){ - String processInstancesId=maintenance.getProcessid(); - Task task=taskService.createTaskQuery().processInstanceId(processInstancesId).singleResult(); - //if(task!=null){ - String taskId = task.getId(); - /*if(comment!=null && !comment.isEmpty()){ - taskService.addComment(taskId, processInstancesId, comment); - }*/ - Map variables = this.getTaskVariables(maintenance); - taskService.complete(taskId, variables); - //} - //保存维护记录 - maintenanceRecordService.saveRecord(maintenance); - //保存积分 - bonusPointService.saveBonusPoint(maintenance); - } - - return result; - }catch(Exception e){ - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public Map getTaskVariables(Maintenance maintenance){ - Map variables = new HashMap(); - switch (maintenance.getStatus()) { - case Maintenance.Status_Launch://问题驳回后发起 - variables.put("applicantId", maintenance.getApplicantid()); - break; - case Maintenance.Status_Cancel_Problem://问题驳回 - variables.put("target", Maintenance.Target_Reject); - //为适用旧流程执行,继续增加pass变量 - variables.put("pass", false); - break; - case Maintenance.Status_Submit_Problem://问题发布 - identityService.setAuthenticatedUserId(maintenance.getApplicantid()); - List list=unitService.getChildrenUsersByIdWithRole(maintenance.getMaintainerid(),RoleSerial_Maintainer); - String userids=""; - for (User user : list) { - if(!userids.isEmpty()){ - userids+=","; - } - userids+=user.getId(); - } - variables.put("userIds", userids); - variables.put("target", Maintenance.Target_Pass); - //为适用旧流程执行,继续增加pass变量 - variables.put("pass", true); - break; - case Maintenance.Status_Cancel://流程废弃 - variables.put("target", Maintenance.Target_Cancel); - break; - case Maintenance.Status_Confirm_Maintainer://维护确认 - list=unitService.getChildrenUsersByIdWithRole(maintenance.getMaintainerid(),RoleSerial_Maintainer); - userids=""; - for (User user : list) { - if(!userids.isEmpty()){ - userids+=","; - } - userids+=user.getId(); - } - variables.put("managerId", null); - variables.put("userIds", userids); - variables.put("pass", true); - break; - case Maintenance.Status_Cancel_Maintainer://维护退回 - variables.put("applicantId", maintenance.getApplicantid()); - variables.put("pass", false); - break; - case Maintenance.Status_Submit_Maintainer://维护提交 - variables.put("applicantId", maintenance.getApplicantid()); - variables.put("pass", true); - break; - case Maintenance.Status_CancelTOMaintainer://退回运维单至运维商 - variables.put("managerId", maintenance.getManagerid()); - variables.put("pass", false); - break; - case Maintenance.Status_Finish://退回运维单至运维商 - variables.put("pass", true); - break; - default: - break; - } - return variables; - } - - @Override - public List selectListByWhere(String wherestr) { - Maintenance maintenance = new Maintenance(); - maintenance.setWhere(wherestr); - List maintenances =maintenanceDao.selectListByWhere(maintenance); - for (Maintenance item : maintenances) { - Company company = unitService.getCompById(item.getCompanyid()); - item.setCompany(company); - } - return maintenances; - } - - @Override - public int deleteByWhere(String wherestr) { - Maintenance maintenance = new Maintenance(); - maintenance.setWhere(wherestr); - List maintenances =maintenanceDao.selectListByWhere(maintenance); - for (Maintenance item : maintenances) { - String pInstancId=item.getProcessid(); - if(pInstancId!=null){ - workflowService.delProcessInstance(pInstancId); - } - } - return maintenanceDao.deleteByWhere(maintenance); - } - - - /*public Map deleteFile(String id) { - Map ret = new HashMap(); - int res =commonFileService.deleteByTableAWhere(TBName_Problem, "where id='"+id+"'"); - if (res==1) { - ret.put("suc", true); - } else { - ret.put("suc", false); - } - return ret; - }*/ - - public Map sendMessage(Maintenance maintenance,String content) { - Map ret = new HashMap(); - String status= maintenance.getStatus(); - String result=""; - switch (status) { - case Maintenance.Status_Launch://问题发起 - String companyid=maintenance.getCompanyid(); - String sendUserId=maintenance.getInsuser(); - String userIds=""; - String applicantid = maintenance.getApplicantid();//驳回时会记录驳回人的id为applicantid,此时消息只发送给驳回人 - if(applicantid!=null && !applicantid.isEmpty()){ - userIds=applicantid; - }else{ - List users= unitService.getChildrenUsersByIdWithRole(companyid,RoleSerial_Applicant); - for (User item : users) { - if(item.getId().equals(sendUserId)){ - continue; - } - if(!userIds.isEmpty()){ - userIds+=","; - } - userIds+=item.getId(); - } - } - - Unit unit= unitService.getUnitById(companyid); - User user = userService.getUserById(sendUserId); - if(content==null || content.isEmpty()){ - content =unit.getName()+user.getCaption()+"于"+CommUtil.nowDate().substring(0,16)+"提交新运维问题,请相关负责人及时确认。"; - }else{ - content=unit.getName()+"提醒您:"+content; - } - result =msgService.insertMsgSend(MsgType_Msg, content, userIds, sendUserId, "U"); - break; - case Maintenance.Status_Cancel_Problem://问题驳回 - sendUserId=maintenance.getApplicantid(); - String insdt = maintenance.getInsdt().substring(0,16); - userIds=maintenance.getInsuser(); - if(content==null || content.isEmpty()){ - content ="您于"+insdt+"提交的运维问题,被厂区相关负责人驳回,请查看驳回意见后再处理。"; - }else{ - content="厂区负责人提醒您:"+content; - } - result =msgService.insertMsgSend(MsgType_Msg, content, userIds, sendUserId, "U"); - break; - case Maintenance.Status_Submit_Problem://问题发布 - String maintainerId=maintenance.getMaintainerid(); - List users= unitService.getChildrenUsersByIdWithRole(maintainerId,RoleSerial_Maintainer); - userIds=""; - for (User item : users) { - if(!userIds.isEmpty()){ - userIds+=","; - } - userIds+=item.getId(); - } - sendUserId=maintenance.getApplicantid(); - unit= unitService.getUnitById(maintenance.getCompanyid()); - if(content==null || content.isEmpty()){ - content =unit.getName()+"于"+maintenance.getConfirmdt().substring(0,16)+"发布新的维护任务,请及时确认。"; - }else{ - content=unit.getName()+"提醒您:"+content; - } - result =msgService.insertMsgSend(this.MsgType_Both, content, userIds, sendUserId, "U"); - break; - case Maintenance.Status_Cancel_Maintainer://发布退回 - sendUserId=maintenance.getManagerid(); - String submitproblemdt = maintenance.getSubmitproblemdt().substring(0,16); - userIds=maintenance.getApplicantid(); - if(content==null || content.isEmpty()){ - content ="您于"+submitproblemdt+"发布的运维问题,被运维商退回,请查看驳回意见后再处理。"; - }else{ - content="运维商提醒您:"+content; - } - result =msgService.insertMsgSend(MsgType_Msg, content, userIds, sendUserId, "U"); - break; - case Maintenance.Status_Confirm_Maintainer://发布确认 - sendUserId=maintenance.getManagerid(); - submitproblemdt = maintenance.getMaintainerconfirmdt().substring(0,16); - userIds=maintenance.getApplicantid(); - if(content==null || content.isEmpty()){ - content ="您于"+submitproblemdt+"发布的运维问题,运营商已确认,具体信息请至运维清单中查看。"; - }else{ - content="运维商提醒您:"+content; - } - result =msgService.insertMsgSend(MsgType_Msg, content, userIds, sendUserId, "U"); - break; - case Maintenance.Status_Submit_Maintainer://发布确认 - sendUserId=maintenance.getManagerid(); - submitproblemdt = maintenance.getMaintainerconfirmdt().substring(0,16); - userIds=maintenance.getApplicantid(); - if(content==null || content.isEmpty()){ - content ="您于"+submitproblemdt+"发布的运维问题,运营商已确认完成,请于清单中评价并确认完成。"; - }else{ - content="运维商提醒您:"+content; - } - result =msgService.insertMsgSend(MsgType_Both, content, userIds, sendUserId, "U"); - break; - default: - break; - } - if (result.contains("成功")) { - ret.put("suc", true); - } else { - ret.put("suc", false); - } - return ret; - } - - - /** - * 与设备联查 - * */ - public List selectListWithEquByWhere(String wherestr) { - Maintenance maintenance = new Maintenance(); - maintenance.setWhere(wherestr); - List maintenances=maintenanceDao.selectListWithEquByWhere(maintenance); - for (Maintenance item : maintenances) { - Company company = unitService.getCompById(item.getCompanyid()); - item.setCompany(company); - } - return maintenances; - } -} diff --git a/src/com/sipai/service/maintenance/PlanRecordAbnormityService.java b/src/com/sipai/service/maintenance/PlanRecordAbnormityService.java deleted file mode 100644 index b0293d40..00000000 --- a/src/com/sipai/service/maintenance/PlanRecordAbnormityService.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.equipment.AssetClassDao; -import com.sipai.dao.maintenance.AbnormityDao; -import com.sipai.dao.maintenance.PlanRecordAbnormityDao; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -import com.sipai.tools.CommService; -@Service -public class PlanRecordAbnormityService implements CommService{ - @Resource - private PlanRecordAbnormityDao planRecordAbnormityDao; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private AbnormityService abnormityService; - - @Override - public PlanRecordAbnormity selectById(String id) { - return this.planRecordAbnormityDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.planRecordAbnormityDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PlanRecordAbnormity planRecordAbnormity) { - return this.planRecordAbnormityDao.insert(planRecordAbnormity); - } - - @Override - public int update(PlanRecordAbnormity planRecordAbnormity) { - return this.planRecordAbnormityDao.updateByPrimaryKeySelective(planRecordAbnormity); - } - - @Override - public List selectListByWhere(String wherestr) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setWhere(wherestr); - return this.planRecordAbnormityDao.selectListByWhere(planRecordAbnormity); - } - - @Override - public int deleteByWhere(String wherestr) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setWhere(wherestr); - return this.planRecordAbnormityDao.deleteByWhere(planRecordAbnormity); - } - /** - * 根据计划id,查询对应的记录列表 - * @param maintenanceId - * @return - */ - public List selectListByPlanId (String maintenanceId){ - Listlist = this.selectListByWhere("where father_id = '"+maintenanceId+"'"); - String maintenanceDetailIds = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - if (maintenanceDetailIds != "") { - maintenanceDetailIds += ","; - } - maintenanceDetailIds += list.get(i).getSonId(); - } - } - maintenanceDetailIds = maintenanceDetailIds.replace(",","','"); - List maintenanceDetails = this.maintenanceDetailService.selectListByWhere("where id in ('"+maintenanceDetailIds+"')"); - return maintenanceDetails; - } - /** - * 根据缺陷id,查询异常数据 - * @param repairId - * @return - */ - public List selectListByRepairId (String repairId){ - Listlist = this.selectListByWhere("where son_id = '"+repairId+"'"); - String abnormalIds = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - if (abnormalIds != "") { - abnormalIds += ","; - } - abnormalIds += list.get(i).getFatherId(); - } - } - abnormalIds = abnormalIds.replace(",","','"); - List abnormities = this.abnormityService.selectListByWhere("where id in ('"+abnormalIds+"')"); - return abnormities; - } -} diff --git a/src/com/sipai/service/maintenance/RepairCarService.java b/src/com/sipai/service/maintenance/RepairCarService.java deleted file mode 100644 index ff45764a..00000000 --- a/src/com/sipai/service/maintenance/RepairCarService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.RepairCar; - -public interface RepairCarService { - - public abstract RepairCar selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RepairCar repairCar); - - public abstract int update(RepairCar repairCar); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int startProcess(RepairCar repairCar); - - public abstract int doAudit(BusinessUnitAudit businessUnitAudit); - -} diff --git a/src/com/sipai/service/maintenance/RepairService.java b/src/com/sipai/service/maintenance/RepairService.java deleted file mode 100644 index fb3831d2..00000000 --- a/src/com/sipai/service/maintenance/RepairService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.Repair; - -public interface RepairService { - - public abstract Repair selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(Repair entity); - - public abstract int update(Repair entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int doAudit(BusinessUnitAudit entity); - - public abstract int updateStatus(String id); - -} diff --git a/src/com/sipai/service/maintenance/WorkorderLibraryMaintainService.java b/src/com/sipai/service/maintenance/WorkorderLibraryMaintainService.java deleted file mode 100644 index bf466fc1..00000000 --- a/src/com/sipai/service/maintenance/WorkorderLibraryMaintainService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.service.maintenance; - -import java.util.List; -import com.sipai.entity.maintenance.WorkorderLibraryMaintain; - -public interface WorkorderLibraryMaintainService { - - public abstract WorkorderLibraryMaintain selectById(String id); - - public abstract WorkorderLibraryMaintain selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(WorkorderLibraryMaintain entity); - - public abstract int update(WorkorderLibraryMaintain entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /** - * - * @param id 工单Id - * @param libraryIds 库的ids - * @param type 区分是保养还是维修等 - * @param unitId - * @param equipmentId 设备Id (维修库每台设备的定额不一样) - * @return - */ - public abstract int saveLibrary(String id,String libraryIds,String type,String unitId,String equipmentId); - - public abstract List selectListByWhereTy(String wherestr); - public abstract List selectListByWhereRh(String wherestr); - public abstract List selectListByWhereYb(String wherestr); - public abstract List selectListByWhereWx(String wherestr,String unitId,String equipmentId); - - public abstract WorkorderLibraryMaintain selectByIdTy(String id); - public abstract WorkorderLibraryMaintain selectByIdRh(String id); - public abstract WorkorderLibraryMaintain selectByIdYb(String id); - public abstract WorkorderLibraryMaintain selectByIdWx(String id,String unitId,String equipmentId); -} diff --git a/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryEquipmentServiceImpl.java b/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryEquipmentServiceImpl.java deleted file mode 100644 index 12cb22d9..00000000 --- a/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryEquipmentServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.AnticorrosiveLibraryEquipmentDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.AnticorrosiveLibraryEquipment; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.AnticorrosiveLibraryEquipmentService; - -@Service -public class AnticorrosiveLibraryEquipmentServiceImpl implements AnticorrosiveLibraryEquipmentService{ - @Resource - private AnticorrosiveLibraryEquipmentDao anticorrosiveLibraryEquipmentDao; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public AnticorrosiveLibraryEquipment selectById(String id) { - return anticorrosiveLibraryEquipmentDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return anticorrosiveLibraryEquipmentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AnticorrosiveLibraryEquipment entity) { - return anticorrosiveLibraryEquipmentDao.insert(entity); - } - - @Override - public int update(AnticorrosiveLibraryEquipment entity) { - return anticorrosiveLibraryEquipmentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AnticorrosiveLibraryEquipment entity = new AnticorrosiveLibraryEquipment(); - entity.setWhere(wherestr); - List list = anticorrosiveLibraryEquipmentDao.selectListByWhere(entity); - for (AnticorrosiveLibraryEquipment anticorrosiveLibraryEquipment : list) { - EquipmentCard equipmentCard = equipmentCardService.selectById(anticorrosiveLibraryEquipment.getEquid()); - anticorrosiveLibraryEquipment.setEquipmentCard(equipmentCard); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AnticorrosiveLibraryEquipment entity = new AnticorrosiveLibraryEquipment(); - entity.setWhere(wherestr); - return anticorrosiveLibraryEquipmentDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryMaterialServiceImpl.java b/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryMaterialServiceImpl.java deleted file mode 100644 index 2dca5dba..00000000 --- a/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryMaterialServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.AnticorrosiveLibraryMaterialDao; -import com.sipai.dao.maintenance.AnticorrosiveMaterialDao; -import com.sipai.entity.maintenance.AnticorrosiveLibraryMaterial; -import com.sipai.entity.maintenance.AnticorrosiveMaterial; -import com.sipai.service.maintenance.AnticorrosiveLibraryMaterialService; - -@Service -public class AnticorrosiveLibraryMaterialServiceImpl implements AnticorrosiveLibraryMaterialService{ - - @Resource - private AnticorrosiveLibraryMaterialDao anticorrosiveLibraryMaterialDao; - @Resource - private AnticorrosiveMaterialDao anticorrosiveMaterialDao; - - @Override - public AnticorrosiveLibraryMaterial selectById(String id) { - return anticorrosiveLibraryMaterialDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return anticorrosiveLibraryMaterialDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AnticorrosiveLibraryMaterial entity) { - return anticorrosiveLibraryMaterialDao.insert(entity); - } - - @Override - public int update(AnticorrosiveLibraryMaterial entity) { - return anticorrosiveLibraryMaterialDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AnticorrosiveLibraryMaterial entity = new AnticorrosiveLibraryMaterial(); - entity.setWhere(wherestr); - List list = anticorrosiveLibraryMaterialDao.selectListByWhere(entity); - for (AnticorrosiveLibraryMaterial anticorrosiveLibraryMaterial : list) { - AnticorrosiveMaterial anticorrosiveMaterial = anticorrosiveMaterialDao.selectByPrimaryKey(anticorrosiveLibraryMaterial.getMaterialId()); - anticorrosiveLibraryMaterial.setAnticorrosiveMaterial(anticorrosiveMaterial); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AnticorrosiveLibraryMaterial anticorrosiveLibraryMaterial = new AnticorrosiveLibraryMaterial(); - anticorrosiveLibraryMaterial.setWhere(wherestr); - return anticorrosiveLibraryMaterialDao.deleteByWhere(anticorrosiveLibraryMaterial); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryServiceImpl.java b/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryServiceImpl.java deleted file mode 100644 index d0c1d095..00000000 --- a/src/com/sipai/service/maintenance/impl/AnticorrosiveLibraryServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.AnticorrosiveLibraryDao; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; -import com.sipai.service.maintenance.AnticorrosiveLibraryService; - -@Service -public class AnticorrosiveLibraryServiceImpl implements AnticorrosiveLibraryService{ - - @Resource - private AnticorrosiveLibraryDao anticorrosiveLibraryDao; - - @Override - public AnticorrosiveLibrary selectById(String id) { - return anticorrosiveLibraryDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return anticorrosiveLibraryDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AnticorrosiveLibrary entity) { - return anticorrosiveLibraryDao.insert(entity); - } - - @Override - public int update(AnticorrosiveLibrary entity) { - return anticorrosiveLibraryDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AnticorrosiveLibrary anticorrosiveLibrary = new AnticorrosiveLibrary(); - anticorrosiveLibrary.setWhere(wherestr); - List list = anticorrosiveLibraryDao.selectListByWhere(anticorrosiveLibrary); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AnticorrosiveLibrary anticorrosiveLibrary = new AnticorrosiveLibrary(); - anticorrosiveLibrary.setWhere(wherestr); - return anticorrosiveLibraryDao.deleteByWhere(anticorrosiveLibrary); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/AnticorrosiveMaterialServiceImpl.java b/src/com/sipai/service/maintenance/impl/AnticorrosiveMaterialServiceImpl.java deleted file mode 100644 index 97f2cc21..00000000 --- a/src/com/sipai/service/maintenance/impl/AnticorrosiveMaterialServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.AnticorrosiveMaterialDao; -import com.sipai.entity.maintenance.AnticorrosiveLibrary; -import com.sipai.entity.maintenance.AnticorrosiveMaterial; -import com.sipai.service.maintenance.AnticorrosiveMaterialService; - -@Service -public class AnticorrosiveMaterialServiceImpl implements AnticorrosiveMaterialService{ - - @Resource - private AnticorrosiveMaterialDao anticorrosiveMaterialDao; - - @Override - public AnticorrosiveMaterial selectById(String id) { - return anticorrosiveMaterialDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return anticorrosiveMaterialDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AnticorrosiveMaterial entity) { - return anticorrosiveMaterialDao.insert(entity); - } - - @Override - public int update(AnticorrosiveMaterial entity) { - return anticorrosiveMaterialDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AnticorrosiveMaterial anticorrosiveMaterial = new AnticorrosiveMaterial(); - anticorrosiveMaterial.setWhere(wherestr); - List list = anticorrosiveMaterialDao.selectListByWhere(anticorrosiveMaterial); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - AnticorrosiveMaterial anticorrosiveMaterial = new AnticorrosiveMaterial(); - anticorrosiveMaterial.setWhere(wherestr); - return anticorrosiveMaterialDao.deleteByWhere(anticorrosiveMaterial); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/EquipmentPlanEquServiceImpl.java b/src/com/sipai/service/maintenance/impl/EquipmentPlanEquServiceImpl.java deleted file mode 100644 index 699d9b62..00000000 --- a/src/com/sipai/service/maintenance/impl/EquipmentPlanEquServiceImpl.java +++ /dev/null @@ -1,402 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.entity.workorder.WorkorderRepairContent; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.EquipmentPlanService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.service.workorder.WorkorderRepairContentService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.EquipmentPlanEquDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.EquipmentPlanEqu; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.EquipmentPlanEquService; -import org.springframework.transaction.annotation.Transactional; - -@Service("equipmentPlanEquService") -public class EquipmentPlanEquServiceImpl implements EquipmentPlanEquService { - @Resource - private EquipmentPlanEquDao equipmentPlanEquDao; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private EquipmentPlanService equipmentPlanService; - @Resource - private CompanyService companyService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private WorkorderRepairContentService workorderRepairContentService; - @Resource - private UserService userService; - @Resource - private GroupDetailService groupDetailService; - - @Override - public EquipmentPlanEqu selectById(String id) { - return equipmentPlanEquDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return equipmentPlanEquDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentPlanEqu entity) { - return equipmentPlanEquDao.insert(entity); - } - - @Override - public int update(EquipmentPlanEqu entity) { - return equipmentPlanEquDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhereSP(String wherestr) { - EquipmentPlanEqu entity = new EquipmentPlanEqu(); - entity.setWhere(wherestr); - List list = equipmentPlanEquDao.selectListByWhere(entity); - return list; - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentPlanEqu entity = new EquipmentPlanEqu(); - entity.setWhere(wherestr); - List list = equipmentPlanEquDao.selectListByWhere(entity); - for (EquipmentPlanEqu equipmentPlanEqu : list) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentPlanEqu.getEquipmentId()); - equipmentPlanEqu.setEquipmentCard(equipmentCard); - - EquipmentPlan equipmentPlan = equipmentPlanService.selectById(equipmentPlanEqu.getPid()); - equipmentPlanEqu.setEquipmentPlan(equipmentPlan); - } - return list; - } - - public List selectListByWhereWithEqu(String wherestr) { - EquipmentPlanEqu entity = new EquipmentPlanEqu(); - entity.setWhere(wherestr); - List list = equipmentPlanEquDao.selectListByWhereWithEqu(entity); - for (EquipmentPlanEqu equipmentPlanEqu : list) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(equipmentPlanEqu.getEquipmentId()); - equipmentPlanEqu.setEquipmentCard(equipmentCard); - - EquipmentPlan equipmentPlan = equipmentPlanService.selectById(equipmentPlanEqu.getPid()); - equipmentPlanEqu.setEquipmentPlan(equipmentPlan); - - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - equipmentPlan.setCompany(company); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentPlanEqu entity = new EquipmentPlanEqu(); - entity.setWhere(wherestr); - return equipmentPlanEquDao.deleteByWhere(entity); - } - - @Override - public EquipmentPlanEqu selectByWhere(String wherestr) { - EquipmentPlanEqu entity = new EquipmentPlanEqu(); - entity.setWhere(wherestr); - return equipmentPlanEquDao.selectByWhere(entity); - } - - @Transactional - @Override - public int issue(String ids, String userIds) { - int res = 0; - if (ids != null && !ids.trim().equals("")) { - String[] id = ids.split(","); - if (id != null) { - for (int i = 0; i < id.length; i++) { - EquipmentPlanEqu equipmentPlanEqu = equipmentPlanEquDao.selectByPrimaryKey(id[i]); - //将计划状态置为已下发 - equipmentPlanEqu.setStatus(EquipmentPlan.Status_Issued); - equipmentPlanEquDao.updateByPrimaryKeySelective(equipmentPlanEqu); - - if (equipmentPlanEqu != null) { - EquipmentPlan equipmentPlan = equipmentPlanService.selectById(equipmentPlanEqu.getPid()); - if (equipmentPlan != null) { - WorkorderDetail workorderDetail = new WorkorderDetail(); - if (workorderDetail != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - - String type = ""; - String jobName = ""; - String jobNumber = ""; - - //去类型表里查看是什么类型的 保养 - if (equipmentPlan.getPlanTypeSmall() != null && !equipmentPlan.getPlanTypeSmall().equals("")) { - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - switch (equipmentPlanType.getCode()) { - //通用 - case WorkorderDetail.MAINTAIN: - type = WorkorderDetail.MAINTAIN; - jobName = "保养计划工单"; - jobNumber = company.getEname() + "-BYGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - //防腐 - case WorkorderDetail.ANTISEPTIC: - type = WorkorderDetail.ANTISEPTIC; - jobName = "防腐计划工单"; - jobNumber = company.getEname() + "-FFGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - //润滑 - case WorkorderDetail.LUBRICATION: - type = WorkorderDetail.LUBRICATION; - jobName = "润滑计划工单"; - jobNumber = company.getEname() + "-RHGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - //仪表 - case WorkorderDetail.INSTRUMENT: - type = WorkorderDetail.INSTRUMENT; - jobName = "仪表计划工单"; - jobNumber = company.getEname() + "-YBGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - default: - } - } - - //保养 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_By)) { - String byId = CommUtil.getUUID(); - workorderDetail.setId(byId); - workorderDetail.setType(WorkorderDetail.MAINTAIN); - workorderDetail.setEquPlanId(id[i]); - workorderDetail.setUnitId(equipmentPlan.getUnitId()); - workorderDetail.setJobNumber(jobNumber); - workorderDetail.setJobName(jobName); - workorderDetail.setEquipmentId(equipmentPlanEqu.getEquipmentId()); - workorderDetail.setRepairPlanType(WorkorderDetail.planIn); - workorderDetail.setRepairType(type); - workorderDetail.setPlanDate(equipmentPlan.getPlanDate()); - workorderDetail.setReceiveUserId(userIds); - workorderDetail.setInsuser("emp01"); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Start); - workorderDetail.setSchemeResume(equipmentPlanEqu.getContents()); - int result = 0; - try { - result = this.workorderDetailService.startWorkorderDetail("", workorderDetail); - - if (equipmentPlanEqu.getContents() != null && !equipmentPlanEqu.getContents().equals("")) { - //默认把计划内容插到保养内容第一条里去 - WorkorderRepairContent workorderRepairContent = new WorkorderRepairContent(); - workorderRepairContent.setId(CommUtil.getUUID()); - workorderRepairContent.setDetailId(byId); - workorderRepairContent.setRepairName(equipmentPlanEqu.getContents()); - workorderRepairContent.setSelfActualHour(1); - workorderRepairContent.setUnitId(equipmentPlan.getUnitId()); - workorderRepairContentService.save(workorderRepairContent); - } - - System.out.println("提交状态:" + result); - } catch (Exception e) { - System.out.println(e); - e.printStackTrace(); - } - } - - //维修 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_Wx)) { - workorderDetail.setId(CommUtil.getUUID()); - workorderDetail.setType(WorkorderDetail.REPAIR); - workorderDetail.setUnitId(equipmentPlan.getUnitId()); - jobNumber = company.getEname() + "-WXGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - workorderDetail.setJobNumber(jobNumber); - workorderDetail.setJobName("维修计划工单"); - workorderDetail.setEquipmentId(equipmentPlanEqu.getEquipmentId()); - workorderDetail.setRepairPlanType(WorkorderDetail.planIn); - workorderDetail.setRepairType(WorkorderDetail.smallRepair); - workorderDetail.setEquPlanId(id[i]); - workorderDetail.setPlanDate(equipmentPlan.getPlanDate()); - workorderDetail.setReceiveUserId(userIds); - workorderDetail.setInsuser("emp01"); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Start); - int result = 0; - try { - result = this.workorderDetailService.startWorkorderDetail("", workorderDetail); - System.out.println("提交状态:" + result); - } catch (Exception e) { - System.out.println(e); - e.printStackTrace(); - } - } - - //大修 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_Dx)) { - // - } - - } - res = res + 1; - } - } - } - } - } - return res; - } - - @Transactional - @Override - public int iscompete(String ids, String competeTeamIds) { - int res = 0; - if (ids != null && !ids.trim().equals("")) { - String[] id = ids.split(","); - if (id != null) { - for (int i = 0; i < id.length; i++) { - EquipmentPlanEqu equipmentPlanEqu = equipmentPlanEquDao.selectByPrimaryKey(id[i]); - //将计划状态置为已下发 - equipmentPlanEqu.setStatus(EquipmentPlan.Status_Issued); - equipmentPlanEquDao.updateByPrimaryKeySelective(equipmentPlanEqu); - if (equipmentPlanEqu != null) { - EquipmentPlan equipmentPlan = equipmentPlanService.selectById(equipmentPlanEqu.getPid()); - if (equipmentPlan != null) { - WorkorderDetail workorderDetail = new WorkorderDetail(); - if (workorderDetail != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - - String type = ""; - String jobName = ""; - String jobNumber = ""; - - //去类型表里查看是什么类型的 保养 - if (equipmentPlan.getPlanTypeSmall() != null && !equipmentPlan.getPlanTypeSmall().equals("")) { - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - switch (equipmentPlanType.getCode()) { - //通用 - case WorkorderDetail.MAINTAIN: - type = WorkorderDetail.MAINTAIN; - jobName = "保养计划工单"; - jobNumber = company.getEname() + "-BYGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - //防腐 - case WorkorderDetail.ANTISEPTIC: - type = WorkorderDetail.ANTISEPTIC; - jobName = "防腐计划工单"; - jobNumber = company.getEname() + "-FFGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - //润滑 - case WorkorderDetail.LUBRICATION: - type = WorkorderDetail.LUBRICATION; - jobName = "润滑计划工单"; - jobNumber = company.getEname() + "-RHGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - //仪表 - case WorkorderDetail.INSTRUMENT: - type = WorkorderDetail.INSTRUMENT; - jobName = "仪表计划工单"; - jobNumber = company.getEname() + "-YBGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - break; - default: - } - } - - //保养 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_By)) { - String byId = CommUtil.getUUID(); - workorderDetail.setId(byId); - workorderDetail.setType(WorkorderDetail.MAINTAIN); - workorderDetail.setEquPlanId(id[i]); - workorderDetail.setUnitId(equipmentPlan.getUnitId()); - workorderDetail.setJobNumber(jobNumber); - workorderDetail.setJobName(jobName); - workorderDetail.setEquipmentId(equipmentPlanEqu.getEquipmentId()); - workorderDetail.setRepairPlanType(WorkorderDetail.planIn); - workorderDetail.setRepairType(type); - workorderDetail.setPlanDate(equipmentPlan.getPlanDate()); -// workorderDetail.setReceiveUserId(userIds); - workorderDetail.setInsuser("emp01"); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Compete); - workorderDetail.setSchemeResume(equipmentPlanEqu.getContents()); - workorderDetail.setCompeteTeamIds(competeTeamIds); - int result = 0; - try { - result = this.workorderDetailService.save(workorderDetail); - - if (equipmentPlanEqu.getContents() != null && !equipmentPlanEqu.getContents().equals("")) { - //默认把计划内容插到保养内容第一条里去 - WorkorderRepairContent workorderRepairContent = new WorkorderRepairContent(); - workorderRepairContent.setId(CommUtil.getUUID()); - workorderRepairContent.setDetailId(byId); - workorderRepairContent.setRepairName(equipmentPlanEqu.getContents()); - workorderRepairContent.setSelfActualHour(1); - workorderRepairContent.setUnitId(equipmentPlan.getUnitId()); - workorderRepairContentService.save(workorderRepairContent); - } - - System.out.println("提交状态:" + result); - } catch (Exception e) { - System.out.println(e); - e.printStackTrace(); - } - } - - //维修 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_Wx)) { - workorderDetail.setId(CommUtil.getUUID()); - workorderDetail.setType(WorkorderDetail.REPAIR); - workorderDetail.setUnitId(equipmentPlan.getUnitId()); - jobNumber = company.getEname() + "-WXGD-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - workorderDetail.setJobNumber(jobNumber); - workorderDetail.setJobName("维修计划工单"); - workorderDetail.setEquipmentId(equipmentPlanEqu.getEquipmentId()); - workorderDetail.setRepairPlanType(WorkorderDetail.planIn); - workorderDetail.setRepairType(WorkorderDetail.smallRepair); - workorderDetail.setEquPlanId(id[i]); - workorderDetail.setPlanDate(equipmentPlan.getPlanDate()); -// workorderDetail.setReceiveUserId(userIds); - workorderDetail.setInsuser("emp01"); - workorderDetail.setInsdt(CommUtil.nowDate()); - workorderDetail.setStatus(WorkorderDetail.Status_Compete); - workorderDetail.setCompeteTeamIds(competeTeamIds); - int result = 0; - try { - result = this.workorderDetailService.save(workorderDetail); - System.out.println("提交状态:" + result); - } catch (Exception e) { - System.out.println(e); - e.printStackTrace(); - } - } - - //大修 - if (equipmentPlan.getPlanTypeBig().equals(EquipmentPlanType.Code_Type_Dx)) { - // - } - - } - res = res + 1; - } - } - } - } - } - return res; - } -} diff --git a/src/com/sipai/service/maintenance/impl/EquipmentPlanServiceImpl.java b/src/com/sipai/service/maintenance/impl/EquipmentPlanServiceImpl.java deleted file mode 100644 index 0d8fed91..00000000 --- a/src/com/sipai/service/maintenance/impl/EquipmentPlanServiceImpl.java +++ /dev/null @@ -1,757 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.MaintenancePlan; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.workorder.WorkTimeRespDto; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.equipment.EquipmentRepairPlanService; -import com.sipai.service.equipment.MaintenancePlanService; -import com.sipai.service.maintenance.EquipmentPlanEquService; -import com.sipai.service.maintenance.EquipmentPlanMainYearService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.workorder.WorkorderDetailService; -import com.sipai.tools.*; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.EquipmentPlanDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentRepairPlan; -import com.sipai.entity.user.Company; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.EquipmentPlanService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import org.springframework.util.CollectionUtils; - -@Service("equipmentPlanService") -public class EquipmentPlanServiceImpl implements EquipmentPlanService { - @Resource - private EquipmentPlanDao equipmentPlanDao; - @Resource - private CompanyService companyService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private RuntimeService runtimeService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private EquipmentPlanEquService equipmentPlanEquService; - @Resource - private EquipmentRepairPlanService equipmentRepairPlanService; - @Resource - private MaintenancePlanService maintenancePlanService; - @Resource - private EquipmentPlanMainYearService equipmentPlanMainYearService; - @Resource - private UserService userService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private WorkorderDetailService workorderDetailService; - -// static Work work = (Work) SpringContextUtil.getBean("work"); - - @Override - public EquipmentPlan selectById(String id) { - EquipmentPlan equipmentPlan = equipmentPlanDao.selectByPrimaryKey(id); - return equipmentPlan; - } - - @Override - public int deleteById(String id) { - try { - EquipmentPlan equipmentPlan = equipmentPlanDao.selectByPrimaryKey(id); - if (equipmentPlan != null) { - String pInstancId = equipmentPlan.getProcessid(); - if (pInstancId != null) { - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + id + "'"); - } - } - return equipmentPlanDao.deleteByPrimaryKey(id); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public EquipmentPlan countListByWhere(String wherestr) { - EquipmentPlan entity = new EquipmentPlan(); - entity.setWhere(wherestr); - return equipmentPlanDao.countListByWhere(entity); - } - - @Override - public int save(EquipmentPlan entity) { - return equipmentPlanDao.insert(entity); - } - - @Override - public int update(EquipmentPlan entity) { - return equipmentPlanDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentPlan entity = new EquipmentPlan(); - entity.setWhere(wherestr); - List list = equipmentPlanDao.selectListByWhere(entity); - for (EquipmentPlan equipmentPlan : list) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - equipmentPlan.setCompany(company); - //查询类型 - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - equipmentPlan.setEquipmentPlanType(equipmentPlanType); - } - return list; - } - - public List selectListByWhereWithEquEqu(String wherestr) { - EquipmentPlan entity = new EquipmentPlan(); - entity.setWhere(wherestr); - List list = new ArrayList<>(); - try { - list = equipmentPlanDao.selectListByWhereWithEqu(entity); - } catch (Exception e) { - e.printStackTrace(); - } - for (EquipmentPlan equipmentPlan : list) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - equipmentPlan.setCompany(company); - //查询类型 - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - equipmentPlan.setEquipmentPlanType(equipmentPlanType); - - //月度计划下所有设备表单的id - String equPlanIds = ""; - - //计划下关联的工单 总数 - List list_equ = equipmentPlanEquService.selectListByWhereSP("where pid = '" + equipmentPlan.getId() + "'"); - if (list_equ != null && list_equ.size() > 0) { - equipmentPlan.setEquipmentNum(list_equ.size()); - for (int i = 0; i < list_equ.size(); i++) { - equPlanIds += "'" + list_equ.get(i).getId() + "',"; - } - } else { - equipmentPlan.setEquipmentNum(0); - } - - if (equPlanIds != null && !equPlanIds.equals("")) { - equPlanIds = equPlanIds.substring(0, equPlanIds.length() - 1); - //计划下关联的工单 签收数 - List list_equ_signfor = workorderDetailService.selectSimpleListByWhere("where equ_plan_id in ("+equPlanIds+") and status!='" + WorkorderDetail.Status_Compete + "'"); - if (list_equ_signfor != null) { - equipmentPlan.setEquipmentNumSignfor(list_equ_signfor.size()); - } else { - equipmentPlan.setEquipmentNumSignfor(0); - } - - //计划下关联的工单 完成数 - List list_equ_finish = workorderDetailService.selectSimpleListByWhere("where equ_plan_id in ("+equPlanIds+") and status='" + WorkorderDetail.Status_Finish + "'"); - if (list_equ_finish != null) { - equipmentPlan.setEquipmentNumFinish(list_equ_finish.size()); - } else { - equipmentPlan.setEquipmentNumFinish(0); - } - } - - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { -// EquipmentPlan entity = new EquipmentPlan(); -// entity.setWhere(wherestr); -// return equipmentPlanDao.deleteByWhere(entity); - - try { - EquipmentPlan entity = new EquipmentPlan(); - entity.setWhere(wherestr); - List entityList = this.selectListByWhere(wherestr); - for (EquipmentPlan item : entityList) { - String pInstancId = item.getProcessid(); - if (pInstancId != null) { - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + item.getId() + "'"); - } - } - return equipmentPlanDao.deleteByWhere(entity); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - - } - - @Transactional - public int startPlanAudit(EquipmentPlan equipmentPlan) { - try { - Map variables = new HashMap(); - if (!equipmentPlan.getAuditId().isEmpty()) { - variables.put("userIds", equipmentPlan.getAuditId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - - List processDefinitions = null; - if (equipmentPlan.getPlanTypeBig() != null) { - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectByCode(equipmentPlan.getPlanTypeBig()); - if (equipmentPlanType != null) { - if (equipmentPlanType.getCode().equals(EquipmentPlanType.Code_Type_Wx)) {//维修 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Repair_Plan.getId() + "-" + equipmentPlan.getUnitId()); - } - if (equipmentPlanType.getCode().equals(EquipmentPlanType.Code_Type_By)) {//保养 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Maintain_Plan.getId() + "-" + equipmentPlan.getUnitId()); - } - if (equipmentPlanType.getCode().equals(EquipmentPlanType.Code_Type_Dx)) {//大修 - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Overhaul.getId() + "-" + equipmentPlan.getUnitId()); - } - } - } - - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(equipmentPlan.getId(), equipmentPlan.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - equipmentPlan.setProcessid(processInstance.getId()); - equipmentPlan.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - EquipmentPlan mPlan = selectById(equipmentPlan.getId()); - int res = 0; - if (null == mPlan) { - res = save(equipmentPlan); - } else { - res = update(equipmentPlan); - } - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentPlan); - businessUnitRecord.sendMessage(equipmentPlan.getAuditId(), ""); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); -// int res = 1; - if (res > 0) { - int res2 = this.updateStatus(entity.getBusinessid()); - if (res2 == 1) { - EquipmentPlan equipmentPlan = equipmentPlanDao.selectByPrimaryKey(entity.getBusinessid()); - if (equipmentPlan != null) { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - if (company != null) { - //查询计划类型 - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectByCode(equipmentPlan.getPlanTypeBig()); - if (equipmentPlanType != null) { - List list = equipmentPlanEquService.selectListByWhere("where pid = '" + entity.getBusinessid() + "'"); - for (EquipmentPlanEqu equipmentPlanEqu : list) { - //维修 - if (equipmentPlanType.getCode().equals(EquipmentPlanType.Code_Type_Wx)) { - EquipmentRepairPlan equipmentRepairPlan = new EquipmentRepairPlan(); - equipmentRepairPlan.setId(CommUtil.getUUID()); - equipmentRepairPlan.setInsuser(""); - equipmentRepairPlan.setActive(MaintenanceCommString.PLAN_FINISH); - equipmentRepairPlan.setBizId(equipmentPlan.getUnitId()); - equipmentRepairPlan.setEquipmentId(equipmentPlanEqu.getEquipmentId()); - equipmentRepairPlan.setInsdt(CommUtil.nowDate()); - equipmentRepairPlan.setPlanType("1"); - if (equipmentPlanEqu.getPlanMoney() != 0) { - BigDecimal calculation = new BigDecimal(Float.toString(equipmentPlanEqu.getPlanMoney())); - equipmentRepairPlan.setPlanMoney(calculation); - } - String detailNumber = company.getEname() + "-WXJH-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - equipmentRepairPlan.setPlanNumber(detailNumber); - equipmentRepairPlanService.save(equipmentRepairPlan); - } - - //保养 - if (equipmentPlanType.getCode().equals(EquipmentPlanType.Code_Type_By)) { - String uuid = CommUtil.getUUID(); - MaintenancePlan maintenancePlan = new MaintenancePlan(); - maintenancePlan.setId(uuid); - maintenancePlan.setInsuser(""); - maintenancePlan.setActive(MaintenanceCommString.PLAN_FINISH); - maintenancePlan.setBizId(equipmentPlan.getUnitId()); - maintenancePlan.setEquipmentId(equipmentPlanEqu.getEquipmentId()); - maintenancePlan.setInsdt(CommUtil.nowDate()); - maintenancePlan.setPlanType("1"); - if (equipmentPlanEqu.getPlanMoney() != 0) { - BigDecimal calculation = new BigDecimal(Float.toString(equipmentPlanEqu.getPlanMoney())); - maintenancePlan.setPlanMoney(calculation); - } - String detailNumber = company.getEname() + "-BYJH-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - maintenancePlan.setPlanNumber(detailNumber); - Work work = (Work) SpringContextUtil.getBean("work"); - if (work.getMainPlanAuto() != null && work.getMainPlanAuto().equals("0")) { - int res3 = maintenancePlanService.save(maintenancePlan); - if (res3 == 1) { - if (equipmentPlan.getGroupDetailId() != null) {//月度计划中配置了班组 优先按班组下发 - this.equipmentPlanEquService.iscompete(equipmentPlanEqu.getId(), equipmentPlan.getGroupDetailId()); - } else {//未配置班组的,按年度计划中配置的人员下发,如都未配置,则需要手动下发 - List list3 = equipmentPlanMainYearService.selectListByWhere("where datediff(year,particular_year,'" + equipmentPlan.getPlanDate() + "')=0 and equipment_id = '" + equipmentPlanEqu.getEquipmentId() + "'"); - if (list3 != null && list3.size() > 0) { - if (list3.get(0).getReceiveUserId() != null) { - this.equipmentPlanEquService.issue(equipmentPlanEqu.getId(), list3.get(0).getReceiveUserId()); - } - } - } - - } - } else { - maintenancePlanService.save(maintenancePlan); - } - } - - //大修 (暂无) - if (equipmentPlanType.getCode().equals(EquipmentPlanType.Code_Type_Dx)) { - - } - - } - - - /** - * 度计划中配置了班组 - 抢单模式 - * 给班组对应的每个人发一条消息进行提醒 - */ - if (equipmentPlan.getGroupDetailId() != null) {//月度计划中配置了班组 - 抢单模式 - String[] gid = equipmentPlan.getGroupDetailId().split(","); - Set set = new HashSet<>(); - for (int i = 0; i < gid.length; i++) { - //查询对应班组人员 - GroupDetail groupDetail = groupDetailService.selectSimpleById(gid[i]); - if (groupDetail != null) { - //组长 - if (groupDetail.getLeader() != null) { - String[] userIds = groupDetail.getLeader().split(","); - for (int j = 0; j < userIds.length; j++) { - set.add(userIds[j]); - } - } - //组员 - if (groupDetail.getMembers() != null) { - String[] userIds = groupDetail.getMembers().split(","); - for (int j = 0; j < userIds.length; j++) { - set.add(userIds[j]); - } - } - } - } - //循环给每个人发送消息 - Iterator iterator = set.iterator(); - while (iterator.hasNext()) { - String userId = iterator.next(); - WorkorderDetail workorderDetail = new WorkorderDetail(); - workorderDetail.setReceiveUserId(userId); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(workorderDetail); - businessUnitRecord.sendMessage(userId, "有新的保养单,可以抢单!"); - } - } - - } - } - } - } - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 根据当前任务节点更新运维详情状态 - */ - public int updateStatus(String id) { - EquipmentPlan equipmentPlan = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(equipmentPlan.getProcessid()).singleResult(); - if (task != null) { - equipmentPlan.setStatus(task.getName()); - } else { - equipmentPlan.setStatus(EquipmentPlan.Status_Finish); - - //将附表状态update成完成 - List list = equipmentPlanEquService.selectListByWhere("where pid = '" + id + "'"); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - EquipmentPlanEqu equipmentPlanEqu = new EquipmentPlanEqu(); - equipmentPlanEqu.setId(list.get(i).getId()); - equipmentPlanEqu.setStatus(EquipmentPlan.Status_Finish); - equipmentPlanEquService.update(equipmentPlanEqu); - } - } - } - int res = this.update(equipmentPlan); - return res; - } - - /** - * 导出 - * - * @param response - * @param id - * @throws IOException - */ - public void doExport(String id, HttpServletRequest request, - HttpServletResponse response - ) throws IOException { - - String fileName = "保养月度计划.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - EquipmentPlan equipmentPlan = this.selectById(id); - if (equipmentPlan == null) { - return; - } else { - Company company = companyService.selectByPrimaryKey(equipmentPlan.getUnitId()); - if (company != null) { - equipmentPlan.setCompany(company); - } - // 类别 - EquipmentPlanType equipmentPlanType_small = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeSmall()); - if (equipmentPlanType_small != null) { - equipmentPlan.setPlanTypeSmall(equipmentPlanType_small.getName()); - } - } - String title = equipmentPlan.getPlanDate().substring(0, 7) + "保养月度计划"; - // 生成一个表格 - HSSFSheet sheet = null; - try { - sheet = workbook.createSheet(title); - } catch (Exception e) { - e.printStackTrace(); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 10000); - sheet.setColumnWidth(1, 10000); - sheet.setColumnWidth(2, 10000); - sheet.setColumnWidth(3, 13000); - sheet.setColumnWidth(4, 5000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - - // 计划内容样式 - HSSFCellStyle oneStyle = workbook.createCellStyle(); - oneStyle.setBorderBottom(BorderStyle.THIN); - oneStyle.setBorderLeft(BorderStyle.THIN); - oneStyle.setBorderRight(BorderStyle.THIN); - oneStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont1 = workbook.createFont(); - headfont1.setBold(false); - headfont1.setFontHeightInPoints((short) 16); - headfont1.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - oneStyle.setFont(headfont1); - oneStyle.setWrapText(true); - oneStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - oneStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - oneStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index); - oneStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 计划内容样式 - HSSFCellStyle twoStyle = workbook.createCellStyle(); - twoStyle.setBorderBottom(BorderStyle.THIN); - twoStyle.setBorderLeft(BorderStyle.THIN); - twoStyle.setBorderRight(BorderStyle.THIN); - twoStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - twoStyle.setFont(headfont2); - twoStyle.setWrapText(true); - twoStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - twoStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - twoStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index); - twoStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - // 计划内容样式 - HSSFCellStyle threeStyle = workbook.createCellStyle(); - threeStyle.setBorderBottom(BorderStyle.THIN); - threeStyle.setBorderLeft(BorderStyle.THIN); - threeStyle.setBorderRight(BorderStyle.THIN); - threeStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont4 = workbook.createFont(); - headfont4.setBold(false); - headfont4.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - threeStyle.setFont(headfont4); - threeStyle.setWrapText(true); - threeStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - threeStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - threeStyle.setFillForegroundColor(IndexedColors.TAN.index); - threeStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont3 = workbook.createFont(); - headfont3.setBold(false); - headfont3.setFontHeightInPoints((short) 12); - headfont3.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont3); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "设备编号,设备名称,预算(元),计划内容,保养人员"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(5); - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - } - // 合并标题单元格 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - // 创建 主表数据格 - // 所属厂区 与计划编号 - HSSFRow row1 = sheet.createRow(1); - // 类别 预算 (元) - HSSFRow row2 = sheet.createRow(2); - // 计划内容 - HSSFRow row3 = sheet.createRow(3); - // 所属厂区 - HSSFCell cell = row1.createCell(0); - cell.setCellStyle(oneStyle); - cell.setCellValue("所属厂区"); - HSSFCell cell1 = row1.createCell(1); - cell1.setCellStyle(twoStyle); - cell1.setCellValue(equipmentPlan.getCompany().getName()); - // 计划编号 - HSSFCell cell2 = row1.createCell(2); - cell2.setCellStyle(oneStyle); - cell2.setCellValue("计划编号"); - sheet.addMergedRegion(new CellRangeAddress(1, 1, 3, excelTitle.length - 1)); - HSSFCell cell3 = row1.createCell(3); - HSSFCell cell3x = row1.createCell(4); - cell3.setCellStyle(twoStyle); - cell3x.setCellStyle(twoStyle); - cell3.setCellValue(equipmentPlan.getPlanNumber()); - - // 类别 - HSSFCell cell4 = row2.createCell(0); - cell4.setCellStyle(oneStyle); - cell4.setCellValue("类别"); - HSSFCell cell5 = row2.createCell(1); - cell5.setCellStyle(twoStyle); - cell5.setCellValue(equipmentPlan.getPlanTypeSmall()); - // 预算(元) - HSSFCell cell6 = row2.createCell(2); - cell6.setCellStyle(oneStyle); - cell6.setCellValue("预算(元)"); - HSSFCell cell7 = row2.createCell(3); - HSSFCell cell7x = row2.createCell(4); - cell7.setCellStyle(twoStyle); - cell7x.setCellStyle(twoStyle); - cell7.setCellValue(equipmentPlan.getPlanMoney()); - sheet.addMergedRegion(new CellRangeAddress(2, 2, 3, excelTitle.length - 1)); - - // 计划内容 - HSSFCell cell8 = row3.createCell(0); - cell8.setCellStyle(oneStyle); - cell8.setCellValue("计划内容"); - HSSFCell cell9 = row3.createCell(1); - HSSFCell cell11 = row3.createCell(2); - HSSFCell cell12 = row3.createCell(3); - HSSFCell cell12x = row3.createCell(4); - cell9.setCellStyle(twoStyle); - cell11.setCellStyle(twoStyle); - cell12.setCellStyle(twoStyle); - cell12x.setCellStyle(twoStyle); - sheet.addMergedRegion(new CellRangeAddress(3, 3, 1, excelTitle.length - 1)); - cell9.setCellValue(equipmentPlan.getPlanContents()); - - // 中间隔开一行 - sheet.addMergedRegion(new CellRangeAddress(4, 4, 0, excelTitle.length - 1)); - HSSFRow row4 = sheet.createRow(4); - HSSFCell cell10 = row4.createCell(0); - HSSFCell cell13 = row4.createCell(3); - cell10.setCellStyle(threeStyle); - cell13.setCellStyle(threeStyle); - - String orderstr = " order by equipment_id"; - String wherestr = "where 1=1 and pid = '" + id + "'"; - List list = this.equipmentPlanEquService.selectListByWhere(wherestr + orderstr); - - if (list != null && list.size() > 0) { - row.setHeight((short) 600); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cellx = row.createCell(i); - cellx.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cellx.setCellValue(text); - } - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(6 + i);//第三行为插入的数据行 - row.setHeight((short) 600); - - // 设备编号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(StringUtils.isNotBlank(list.get(i).getEquipmentCard().getEquipmentcardid()) ? list.get(i).getEquipmentCard().getEquipmentcardid() : ""); - // 设备名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(StringUtils.isNotBlank(list.get(i).getEquipmentCard().getEquipmentname()) ? list.get(i).getEquipmentCard().getEquipmentname() : ""); - // 预算(元) - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getPlanMoney()); - // 计划内容 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(StringUtils.isNotBlank(list.get(i).getContents()) ? list.get(i).getContents() : ""); - // 保养人员 - - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - try { - List equipmentPlanMainYears = equipmentPlanMainYearService.selectListByWhereSimple("where equipment_id = '" + list.get(i).getEquipmentId() + "' and particular_year = '" + CommUtil.nowDate().substring(0, 4) + "-01-01'"); - if (!CollectionUtils.isEmpty(equipmentPlanMainYears)) { - if (StringUtils.isNotBlank(equipmentPlanMainYears.get(0).getReceiveUserId())) { - User user = userService.getUserById(equipmentPlanMainYears.get(0).getReceiveUserId()); - if (user != null) { - cell_4.setCellValue(user.getCaption()); - } else { - cell_4.setCellValue(""); - } - } else { - cell_4.setCellValue(""); - } - } else { - cell4.setCellValue(""); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - -} diff --git a/src/com/sipai/service/maintenance/impl/EquipmentPlanTypeServiceImpl.java b/src/com/sipai/service/maintenance/impl/EquipmentPlanTypeServiceImpl.java deleted file mode 100644 index 88dfba3c..00000000 --- a/src/com/sipai/service/maintenance/impl/EquipmentPlanTypeServiceImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.EquipmentPlanTypeDao; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.service.maintenance.EquipmentPlanTypeService; - -@Service("equipmentPlanTypeService") -public class EquipmentPlanTypeServiceImpl implements EquipmentPlanTypeService{ - @Resource - private EquipmentPlanTypeDao equipmentPlanTypeDao; - - @Override - public EquipmentPlanType selectById(String id) { - return equipmentPlanTypeDao.selectByPrimaryKey(id); - } - - @Override - public EquipmentPlanType selectByCode(String code) { - return equipmentPlanTypeDao.selectByCode(code); - } - - @Override - public int deleteById(String id) { - return equipmentPlanTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentPlanType entity) { - return equipmentPlanTypeDao.insert(entity); - } - - @Override - public int update(EquipmentPlanType entity) { - return equipmentPlanTypeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentPlanType equipmentPlanType = new EquipmentPlanType(); - equipmentPlanType.setWhere(wherestr); - return equipmentPlanTypeDao.selectListByWhere(equipmentPlanType); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentPlanType equipmentPlanType = new EquipmentPlanType(); - equipmentPlanType.setWhere(wherestr); - return equipmentPlanTypeDao.deleteByWhere(equipmentPlanType); - } - - @Override - public EquipmentPlanType selectByWhere(String wherestr) { - EquipmentPlanType equipmentPlanType = new EquipmentPlanType(); - equipmentPlanType.setWhere(wherestr); - return equipmentPlanTypeDao.selectByWhere(equipmentPlanType); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectBizServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectBizServiceImpl.java deleted file mode 100644 index dbf48f98..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectBizServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; -import com.sipai.dao.maintenance.LibraryAddResetProjectBizDao; -import com.sipai.entity.maintenance.LibraryAddResetProjectBiz; -import com.sipai.service.maintenance.LibraryAddResetProjectBizService; - -@Service -public class LibraryAddResetProjectBizServiceImpl implements LibraryAddResetProjectBizService{ - @Resource - private LibraryAddResetProjectBizDao libraryAddResetProjectBizDao; - - @Override - public LibraryAddResetProjectBiz selectById(String id) { - // TODO Auto-generated method stub - return libraryAddResetProjectBizDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - // TODO Auto-generated method stub - return libraryAddResetProjectBizDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryAddResetProjectBiz entity) { - // TODO Auto-generated method stub - return libraryAddResetProjectBizDao.insert(entity); - } - - @Override - public int update(LibraryAddResetProjectBiz entity) { - // TODO Auto-generated method stub - return libraryAddResetProjectBizDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryAddResetProjectBiz entity = new LibraryAddResetProjectBiz(); - entity.setWhere(wherestr); - return libraryAddResetProjectBizDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryAddResetProjectBiz entity = new LibraryAddResetProjectBiz(); - entity.setWhere(wherestr); - return libraryAddResetProjectBizDao.deleteByWhere(entity); - } - - @Override - public LibraryAddResetProjectBiz selectByWhere(String wherestr) { - LibraryAddResetProjectBiz entity = new LibraryAddResetProjectBiz(); - entity.setWhere(wherestr); - return libraryAddResetProjectBizDao.selectByWhere(entity); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectBlocServiceImpl.java deleted file mode 100644 index 013297f0..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectBlocServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryAddResetProjectBlocDao; -import com.sipai.entity.maintenance.LibraryAddResetProjectBloc; -import com.sipai.service.maintenance.LibraryAddResetProjectBlocService; -@Service -public class LibraryAddResetProjectBlocServiceImpl implements LibraryAddResetProjectBlocService{ - @Resource - private LibraryAddResetProjectBlocDao libraryAddResetProjectBlocDao; - - @Override - public LibraryAddResetProjectBloc selectById(String id) { - return libraryAddResetProjectBlocDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryAddResetProjectBlocDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryAddResetProjectBloc entity) { - return libraryAddResetProjectBlocDao.insert(entity); - } - - @Override - public int update(LibraryAddResetProjectBloc entity) { - return libraryAddResetProjectBlocDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryAddResetProjectBloc entity = new LibraryAddResetProjectBloc(); - entity.setWhere(wherestr); - return libraryAddResetProjectBlocDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryAddResetProjectBloc entity = new LibraryAddResetProjectBloc(); - entity.setWhere(wherestr); - return libraryAddResetProjectBlocDao.deleteByWhere(entity); - } - - @Override - public LibraryAddResetProjectBloc selectByWhere(String wherestr) { - LibraryAddResetProjectBloc entity = new LibraryAddResetProjectBloc(); - entity.setWhere(wherestr); - return libraryAddResetProjectBlocDao.selectByWhere(entity); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectServiceImpl.java deleted file mode 100644 index bfed08e9..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryAddResetProjectServiceImpl.java +++ /dev/null @@ -1,1519 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.LibraryAddResetProjectDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryAddResetProject; -import com.sipai.entity.maintenance.LibraryAddResetProjectBiz; -import com.sipai.entity.maintenance.LibraryAddResetProjectBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; -import com.sipai.entity.maintenance.MaintainCommStr; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.LibraryAddResetProjectBizService; -import com.sipai.service.maintenance.LibraryAddResetProjectBlocService; -import com.sipai.service.maintenance.LibraryAddResetProjectService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryAddResetProjectServiceImpl implements LibraryAddResetProjectService { - @Resource - private LibraryAddResetProjectDao libraryAddResetProjectDao; - @Resource - private LibraryAddResetProjectBlocService libraryAddResetProjectBlocService; - @Resource - private LibraryAddResetProjectBizService libraryAddResetProjectBizService; - @Resource - private CompanyService companyService; - - @Override - public LibraryAddResetProject selectById(String id) { - return libraryAddResetProjectDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryAddResetProjectDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryAddResetProject entity) { - return libraryAddResetProjectDao.insert(entity); - } - - @Override - public int update(LibraryAddResetProject entity) { - return libraryAddResetProjectDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryAddResetProject entity = new LibraryAddResetProject(); - entity.setWhere(wherestr); - List list = libraryAddResetProjectDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryAddResetProject entity = new LibraryAddResetProject(); - entity.setWhere(wherestr); - return libraryAddResetProjectDao.deleteByWhere(entity); - } - - @Override - public List selectList4Model(String wherestr, String modelId, String unitId) { - LibraryAddResetProject entity = new LibraryAddResetProject(); - entity.setWhere(wherestr); - List list = libraryAddResetProjectDao.selectListByWhere(entity); - for (LibraryAddResetProject libraryAddResetProject : list) { - List listModel = libraryAddResetProjectBlocService.selectListByWhere("where project_id='" + libraryAddResetProject.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listModel != null && listModel.size() > 0) { - libraryAddResetProject.setLibraryAddResetProjectBloc(listModel.get(0)); - } - } - return list; - } - - @Override - public List selectList4Equ(String wherestr, String modelId, String unitId) { - LibraryAddResetProject entity = new LibraryAddResetProject(); - entity.setWhere(wherestr); - List list = libraryAddResetProjectDao.selectListByWhere(entity); - for (LibraryAddResetProject libraryAddResetProject : list) { - List listModel = libraryAddResetProjectBizService.selectListByWhere("where project_id='" + libraryAddResetProject.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listModel != null && listModel.size() > 0) { - libraryAddResetProject.setLibraryAddResetProjectBiz(listModel.get(0)); - } - } - return list; - } - - @Transactional - public int save4Model(LibraryAddResetProject entity, String modelId, - String unitId) { - List list = libraryAddResetProjectBlocService.selectListByWhere("where project_id='" + entity.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryAddResetProjectBloc libraryAddResetProjectBloc = new LibraryAddResetProjectBloc(); - - libraryAddResetProjectBloc.setProjectId(entity.getId()); - libraryAddResetProjectBloc.setModelId(modelId); - libraryAddResetProjectBloc.setUnitId(unitId); - libraryAddResetProjectBloc.setDismantle(entity.getDismantle()); - libraryAddResetProjectBloc.setInstall(entity.getInstall()); - libraryAddResetProjectBloc.setDebugging(entity.getDebugging()); - libraryAddResetProjectBloc.setAccessory(entity.getAccessory()); - libraryAddResetProjectBloc.setTransport(entity.getTransport()); - libraryAddResetProjectBloc.setMaterialCost(entity.getMaterialCost()); - - //自修 - if (entity.getRepairPartyType() != null && entity.getRepairPartyType().equals(MaintainCommStr.Maintain_IN)) { - float num = entity.getDismantle() + entity.getInstall() + entity.getDebugging() + entity.getAccessory(); - libraryAddResetProjectBloc.setInsideRepairTime(num); - libraryAddResetProjectBloc.setOutsideRepairCost(0); - } - //委外 - if (entity.getRepairPartyType() != null && entity.getRepairPartyType().equals(MaintainCommStr.Maintain_OUT)) { - float num = entity.getDismantle() + entity.getInstall() + entity.getDebugging() + entity.getAccessory() + entity.getTransport(); - libraryAddResetProjectBloc.setInsideRepairTime(0); - libraryAddResetProjectBloc.setOutsideRepairCost(num); - } - libraryAddResetProjectBloc.setId(CommUtil.getUUID()); - libraryAddResetProjectBlocService.save(libraryAddResetProjectBloc); - - return libraryAddResetProjectDao.insert(entity); - } - - @Transactional - public int update4Model(LibraryAddResetProject entity, String modelId, - String unitId) { - List list = libraryAddResetProjectBlocService.selectListByWhere("where project_id='" + entity.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryAddResetProjectBloc libraryAddResetProjectBloc = new LibraryAddResetProjectBloc(); - - libraryAddResetProjectBloc.setProjectId(entity.getId()); - libraryAddResetProjectBloc.setModelId(modelId); - libraryAddResetProjectBloc.setUnitId(unitId); - libraryAddResetProjectBloc.setDismantle(entity.getDismantle()); - libraryAddResetProjectBloc.setInstall(entity.getInstall()); - libraryAddResetProjectBloc.setDebugging(entity.getDebugging()); - libraryAddResetProjectBloc.setAccessory(entity.getAccessory()); - libraryAddResetProjectBloc.setTransport(entity.getTransport()); - libraryAddResetProjectBloc.setMaterialCost(entity.getMaterialCost()); - - //自修 - if (entity.getRepairPartyType() != null && entity.getRepairPartyType().equals(MaintainCommStr.Maintain_IN)) { - float num = entity.getDismantle() + entity.getInstall() + entity.getDebugging() + entity.getAccessory(); - libraryAddResetProjectBloc.setInsideRepairTime(num); - libraryAddResetProjectBloc.setOutsideRepairCost(0); - } - //委外 - if (entity.getRepairPartyType() != null && entity.getRepairPartyType().equals(MaintainCommStr.Maintain_OUT)) { - float num = entity.getDismantle() + entity.getInstall() + entity.getDebugging() + entity.getAccessory() + entity.getTransport(); - libraryAddResetProjectBloc.setInsideRepairTime(0); - libraryAddResetProjectBloc.setOutsideRepairCost(num); - } - - if (list != null && list.size() > 0) {//修改 - libraryAddResetProjectBloc.setId(list.get(0).getId()); - libraryAddResetProjectBlocService.update(libraryAddResetProjectBloc); - } else {//新增 - libraryAddResetProjectBloc.setId(CommUtil.getUUID()); - libraryAddResetProjectBlocService.save(libraryAddResetProjectBloc); - } - entity.setUnitId(null); - return libraryAddResetProjectDao.updateByPrimaryKeySelective(entity); - } - - @Transactional - public int update4Equ(LibraryAddResetProject entity, String modelId, - String unitId) { - List list = libraryAddResetProjectBizService.selectListByWhere("where project_id='" + entity.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryAddResetProjectBiz libraryAddResetProjectBiz = new LibraryAddResetProjectBiz(); - - libraryAddResetProjectBiz.setProjectId(entity.getId()); - libraryAddResetProjectBiz.setEquipmentId(modelId); - libraryAddResetProjectBiz.setUnitId(unitId); - libraryAddResetProjectBiz.setDismantle(entity.getDismantle()); - libraryAddResetProjectBiz.setInstall(entity.getInstall()); - libraryAddResetProjectBiz.setDebugging(entity.getDebugging()); - libraryAddResetProjectBiz.setAccessory(entity.getAccessory()); - libraryAddResetProjectBiz.setTransport(entity.getTransport()); - libraryAddResetProjectBiz.setMaterialCost(entity.getMaterialCost()); - - //自修 - if (entity.getRepairPartyType() != null && entity.getRepairPartyType().equals(MaintainCommStr.Maintain_IN)) { - float num = entity.getDismantle() + entity.getInstall() + entity.getDebugging() + entity.getAccessory(); - libraryAddResetProjectBiz.setInsideRepairTime(num); - libraryAddResetProjectBiz.setOutsideRepairCost(0); - } - //委外 - if (entity.getRepairPartyType() != null && entity.getRepairPartyType().equals(MaintainCommStr.Maintain_OUT)) { - float num = entity.getDismantle() + entity.getInstall() + entity.getDebugging() + entity.getAccessory() + entity.getTransport(); - libraryAddResetProjectBiz.setInsideRepairTime(0); - libraryAddResetProjectBiz.setOutsideRepairCost(num); - } - - int res = 0; - if (list != null && list.size() > 0) {//修改 - libraryAddResetProjectBiz.setId(list.get(0).getId()); - res = libraryAddResetProjectBizService.update(libraryAddResetProjectBiz); - } else {//新增 - libraryAddResetProjectBiz.setId(CommUtil.getUUID()); - res = libraryAddResetProjectBizService.save(libraryAddResetProjectBiz); - } - return res; - } - - @SuppressWarnings({"deprecation", "rawtypes"}) - @Override - public void doExport(HttpServletResponse response, List equipmentClasses, String unitId) throws IOException { - String fileName = "设备新增、重置库" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if (equipmentClasses != null && equipmentClasses.size() > 0) { - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName() + "(" + equipmentClasses.get(z).getEquipmentClassCode() + ")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000); - sheet.setColumnWidth(4, 3000); - sheet.setColumnWidth(5, 3000); - sheet.setColumnWidth(6, 3000); - sheet.setColumnWidth(7, 3500); - sheet.setColumnWidth(8, 3500); - sheet.setColumnWidth(9, 3500); - sheet.setColumnWidth(10, 3800); - sheet.setColumnWidth(11, 3000); - sheet.setColumnWidth(12, 3000); - sheet.setColumnWidth(13, 6000); - sheet.setColumnWidth(14, 6000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - //标题样式 - HSSFCellStyle titleStyle3 = workbook.createCellStyle(); - titleStyle3.setBorderBottom(BorderStyle.THIN); - titleStyle3.setBorderLeft(BorderStyle.THIN); - titleStyle3.setBorderRight(BorderStyle.THIN); - titleStyle3.setBorderTop(BorderStyle.THIN); - HSSFFont headfont3 = workbook.createFont(); - headfont3.setBold(false); - headfont3.setFontHeightInPoints((short) 12); - headfont3.setBold(true);//粗体显示 - headfont3.setColor(HSSFFont.COLOR_RED);//字体颜色 - // 把字体应用到当前的样式 - titleStyle3.setFont(headfont3); - titleStyle3.setWrapText(true); - titleStyle3.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle3.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle3.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "小类代码,设备小类,设备型号,项目代码,项目名称,委外/自修,新增/重置,原设备拆除,新设备安装," - + "新设备调试,附属物及土建,运输费等,物资费(元),自修工时定额(小时),委外工时费定额(元)"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("新增重置库"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 2)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 3, 3)); - HSSFCell twocell3 = twoRow.createCell(3); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 4, 5)); - HSSFCell twocell4 = twoRow.createCell(4); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, excelTitle.length - 1)); - HSSFCell twocell5 = twoRow.createCell(6); - twocell5.setCellStyle(titleStyle3); - twocell5.setCellValue("注:自修的单位为小时,委外为元。自修工时定额与委外工时费定额无需填写,系统自动计算"); - - String contentStr = ""; - //如果配置了所属标准库则认为是水厂 否则认为是业务区 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - contentStr += " and (p.unit_id = '" + company.getLibraryBizid() + "' or p.unit_id is null) "; - } else { - contentStr += " and (p.unit_id = '" + unitId + "' or p.unit_id is null) "; - } - - contentStr += " where m.pid = '" + equipmentClasses.get(z).getId() + "' and m.type='" + CommString.EquipmentClass_Equipment + "'"; - - String classSql = contentStr + " order by m.morder,p.code"; - - LibraryAddResetProject libraryAddResetProject = new LibraryAddResetProject(); - libraryAddResetProject.setWhere(classSql); - List list = libraryAddResetProjectDao.selectList4Class(libraryAddResetProject); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - /*JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject();*/ - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 用于后面的合并单元格 - if (jsonObject1.has(list.get(i).getM_id())) { - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - //小类代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //小类名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //项目代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getCode()); - //项目名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getName()); - //委外/自修 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_IN.equals(list.get(i).getRepairPartyType())) { - cell_5.setCellValue("自修"); - } - if (MaintainCommStr.Maintain_OUT.equals(list.get(i).getRepairPartyType())) { - cell_5.setCellValue("委外"); - } - //新增/重置 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_OverhaulType_add.equals(list.get(i).getType())) { - cell_6.setCellValue("新增"); - } - if (MaintainCommStr.Maintain_OverhaulType_reset.equals(list.get(i).getType())) { - cell_6.setCellValue("重置"); - } - - String sqlstrContent = "where project_id = '" + list.get(i).getId() + "' and unit_id = '" + unitId + "' and model_id = '-1'"; - LibraryAddResetProjectBloc libraryAddResetProjectBloc = libraryAddResetProjectBlocService.selectByWhere(sqlstrContent); - if (libraryAddResetProjectBloc != null) { - //原设备拆除 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(libraryAddResetProjectBloc.getDismantle()); - //新设备安装 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(libraryAddResetProjectBloc.getInstall()); - //新设备调试 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(libraryAddResetProjectBloc.getDebugging()); - //附属物及土建 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(libraryAddResetProjectBloc.getAccessory()); - //运输费等 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(libraryAddResetProjectBloc.getTransport()); - //物资费(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(libraryAddResetProjectBloc.getMaterialCost()); - //自修工时定额(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(libraryAddResetProjectBloc.getInsideRepairTime()); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(libraryAddResetProjectBloc.getOutsideRepairCost()); - } else { - //原设备拆除 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(""); - //新设备安装 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(""); - //新设备调试 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(""); - //附属物及土建 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(""); - //运输费等 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(""); - //物资费(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(""); - //自修工时定额(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(""); - } - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - //设备型号合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Override - public void doExport4Biz(HttpServletResponse response, List equipmentClasses, String unitId, String smallClassId) throws IOException { - String fileName = "设备新增、重置库" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if (equipmentClasses != null && equipmentClasses.size() > 0) { - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName() + "(" + equipmentClasses.get(z).getEquipmentClassCode() + ")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000); - sheet.setColumnWidth(4, 3000); - sheet.setColumnWidth(5, 3000); - sheet.setColumnWidth(6, 3000); - sheet.setColumnWidth(7, 3500); - sheet.setColumnWidth(8, 3500); - sheet.setColumnWidth(9, 3500); - sheet.setColumnWidth(10, 3800); - sheet.setColumnWidth(11, 3000); - sheet.setColumnWidth(12, 3000); - sheet.setColumnWidth(13, 6000); - sheet.setColumnWidth(14, 6000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - //标题样式 - HSSFCellStyle titleStyle3 = workbook.createCellStyle(); - titleStyle3.setBorderBottom(BorderStyle.THIN); - titleStyle3.setBorderLeft(BorderStyle.THIN); - titleStyle3.setBorderRight(BorderStyle.THIN); - titleStyle3.setBorderTop(BorderStyle.THIN); - HSSFFont headfont3 = workbook.createFont(); - headfont3.setBold(false); - headfont3.setFontHeightInPoints((short) 12); - headfont3.setBold(true);//粗体显示 - headfont3.setColor(HSSFFont.COLOR_RED);//字体颜色 - // 把字体应用到当前的样式 - titleStyle3.setFont(headfont3); - titleStyle3.setWrapText(true); - titleStyle3.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle3.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle3.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "小类代码,设备小类,设备型号,项目代码,项目名称,委外/自修,新增/重置,原设备拆除,新设备安装," - + "新设备调试,附属物及土建,运输费等,物资费(元),自修工时定额(小时),委外工时费定额(元)"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("新增重置库"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 2)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 3, 3)); - HSSFCell twocell3 = twoRow.createCell(3); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 4, 5)); - HSSFCell twocell4 = twoRow.createCell(4); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, excelTitle.length - 1)); - HSSFCell twocell5 = twoRow.createCell(6); - twocell5.setCellStyle(titleStyle3); - twocell5.setCellValue("注:自修的单位为小时,委外为元。自修工时定额与委外工时费定额无需填写,系统自动计算"); - - String contentStr = ""; - //如果配置了所属标准库则认为是水厂 否则认为是业务区 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - contentStr += " and (p.unit_id = '" + company.getLibraryBizid() + "' or p.unit_id is null) "; - } else { - contentStr += " and (p.unit_id = '" + unitId + "' or p.unit_id is null) "; - } - - contentStr += " where m.pid = '" + equipmentClasses.get(z).getId() + "' and m.type='" + CommString.EquipmentClass_Equipment + "'"; - contentStr += " and m.id in (" + smallClassId + ") "; - - String classSql = contentStr + " order by m.morder,p.code"; - - LibraryAddResetProject libraryAddResetProject = new LibraryAddResetProject(); - libraryAddResetProject.setWhere(classSql); - List list = libraryAddResetProjectDao.selectList4Class(libraryAddResetProject); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - /*JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject();*/ - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 用于后面的合并单元格 - if (jsonObject1.has(list.get(i).getM_id())) { - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - //小类代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //小类名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //项目代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getCode()); - //项目名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getName()); - //委外/自修 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_IN.equals(list.get(i).getRepairPartyType())) { - cell_5.setCellValue("自修"); - } - if (MaintainCommStr.Maintain_OUT.equals(list.get(i).getRepairPartyType())) { - cell_5.setCellValue("委外"); - } - //新增/重置 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_OverhaulType_add.equals(list.get(i).getType())) { - cell_6.setCellValue("新增"); - } - if (MaintainCommStr.Maintain_OverhaulType_reset.equals(list.get(i).getType())) { - cell_6.setCellValue("重置"); - } - - String sqlstrContent = "where project_id = '" + list.get(i).getId() + "' and unit_id = '" + unitId + "' and equipment_id = '-1'"; - LibraryAddResetProjectBiz libraryAddResetProjectBiz = libraryAddResetProjectBizService.selectByWhere(sqlstrContent); - if (libraryAddResetProjectBiz != null) { - //原设备拆除 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(libraryAddResetProjectBiz.getDismantle()); - //新设备安装 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(libraryAddResetProjectBiz.getInstall()); - //新设备调试 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(libraryAddResetProjectBiz.getDebugging()); - //附属物及土建 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(libraryAddResetProjectBiz.getAccessory()); - //运输费等 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(libraryAddResetProjectBiz.getTransport()); - //物资费(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(libraryAddResetProjectBiz.getMaterialCost()); - //自修工时定额(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(libraryAddResetProjectBiz.getInsideRepairTime()); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(libraryAddResetProjectBiz.getOutsideRepairCost()); - } else { - //原设备拆除 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(""); - //新设备安装 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(""); - //新设备调试 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(""); - //附属物及土建 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(""); - //运输费等 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(""); - //物资费(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(""); - //自修工时定额(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(""); - } - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - //设备型号合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Transactional - public String readXls(InputStream input, String json, String userId, String unitId) throws IOException { - System.out.println("导入新增重置库开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 14) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_class_id = "";//设备部位id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 3);//设备项目代码 - String cell_project_id = "";//大修项目id - String cell_model_id = "";//型号id - - JSONArray jsonArray = JSONArray.fromObject(json); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if (cell_big_class_code != null && cell_big_class_code.equals(getJsonObj.get("code"))) { - if (getJsonObj.has("nodes")) { - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if (jsonArray2 != null && jsonArray2.size() > 0) { - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if (getJsonObj2 != null) { - if (cell_class_code != null && cell_class_code.equals(getJsonObj2.get("code"))) { - cell_class_id = getJsonObj2.get("id") + ""; - /*if(getJsonObj2.has("nodes")){ - JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); - if(jsonArray3!=null && jsonArray3.size()>0){ - for (int k = 0; k < jsonArray3.size(); k++) { - JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 - if(getJsonObj3!=null){ - if(cell_part_code!=null && cell_part_code.equals(getJsonObj3.get("code"))){ - cell_part_id = getJsonObj3.get("id")+""; - } - } - } - } - }*/ - } - } - } - } - } - } - } - } - - LibraryAddResetProject libraryAddResetProject = new LibraryAddResetProject(); - //大修项目定额 - LibraryAddResetProjectBloc libraryAddResetProjectBloc = new LibraryAddResetProjectBloc(); - - float outsideRepairCost = 0;//委外工时费定额 - float insideRepairTime = 0;//自主实施工时定额 - - for (int i = minCellNum; i < maxCellNum; i++) { - - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i)) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3://项目代码 - libraryAddResetProject.setCode(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - libraryAddResetProject.setName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 6: - if ("新增".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setType(MaintainCommStr.Maintain_OverhaulType_add); - } - if ("重置".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setType(MaintainCommStr.Maintain_OverhaulType_reset); - } - break; - case 7: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBloc.setDismantle(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 8: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBloc.setInstall(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 9: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBloc.setDebugging(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 10: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBloc.setAccessory(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 11: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBloc.setTransport(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 12: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryAddResetProjectBloc.setMaterialCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 13: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - //libraryAddResetProjectBloc.setInsideRepairTime(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 14: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - //libraryAddResetProjectBloc.setOutsideRepairCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - libraryAddResetProject.setUnitId(company.getLibraryBizid()); - } else { - libraryAddResetProject.setUnitId(unitId); - } - - //部位库中必须要有 否则为无效数据 - if (cell_class_code != null && !cell_class_code.equals("") && cell_project_code != null && !cell_project_code.equals("")) { - libraryAddResetProject.setPid(cell_class_id); - /* - * 处理项目数据 - */ - libraryAddResetProject.setWhere("where pid = '" + cell_class_id + "' and code = '" + cell_project_code + "' and unit_id = '" + unitId + "'"); - LibraryAddResetProject projectBloc = libraryAddResetProjectDao.selectByWhere(libraryAddResetProject); - if (projectBloc != null) { - cell_project_id = projectBloc.getId();//如存在则赋值原有的项目id - libraryAddResetProject.setId(cell_project_id); - libraryAddResetProjectDao.updateByPrimaryKeySelective(libraryAddResetProject); - updateContentNum += 1; - } else { - cell_project_id = CommUtil.getUUID();//否则创建新的项目id - libraryAddResetProject.setId(cell_project_id); - if (libraryAddResetProject.getCode() != null && !libraryAddResetProject.getCode().equals("")) { - libraryAddResetProjectDao.insert(libraryAddResetProject); - insertContentNum += 1; - } - } - - /* - * 处理项目定额 - */ - String pmbsql = "where project_id = '" + cell_project_id + "' and model_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryAddResetProjectBloc projectModelBloc = libraryAddResetProjectBlocService.selectByWhere(pmbsql); - - if (libraryAddResetProject.getRepairPartyType() != null && libraryAddResetProject.getRepairPartyType().equals(MaintainCommStr.Maintain_IN)) { - libraryAddResetProjectBloc.setInsideRepairTime(insideRepairTime); - libraryAddResetProjectBloc.setOutsideRepairCost(0); - } - if (libraryAddResetProject.getRepairPartyType() != null && libraryAddResetProject.getRepairPartyType().equals(MaintainCommStr.Maintain_OUT)) { - libraryAddResetProjectBloc.setOutsideRepairCost(outsideRepairCost); - libraryAddResetProjectBloc.setInsideRepairTime(0); - } - - if (projectModelBloc != null) { - libraryAddResetProjectBloc.setId(projectModelBloc.getId()); - libraryAddResetProjectBloc.setUnitId(unitId); - libraryAddResetProjectBloc.setProjectId(cell_project_id); - libraryAddResetProjectBloc.setModelId(cell_model_id); - libraryAddResetProjectBlocService.update(libraryAddResetProjectBloc); - } else { - libraryAddResetProjectBloc.setId(CommUtil.getUUID()); - libraryAddResetProjectBloc.setUnitId(unitId); - libraryAddResetProjectBloc.setProjectId(cell_project_id); - libraryAddResetProjectBloc.setModelId(cell_model_id); - libraryAddResetProjectBlocService.save(libraryAddResetProjectBloc); - } - - } - } - } - String result = ""; - result = "" - + "新增内容:" + insertContentNum + "条,修改内容:" + updateContentNum + "条!"; - System.out.println("导入新增重置库结束=============" + CommUtil.nowDate()); - return result; - } - - @Transactional - public String readXlsx(InputStream input, String json, String userId, - String unitId) throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public String readXls4Biz(InputStream input, String json, String userId, String unitId) throws IOException { - System.out.println("导入新增重置库开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 14) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_class_id = "";//设备部位id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 3);//设备项目代码 - String cell_project_id = "";//大修项目id - String cell_model_id = "";//型号id - - JSONArray jsonArray = JSONArray.fromObject(json); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if (cell_big_class_code != null && cell_big_class_code.equals(getJsonObj.get("code"))) { - if (getJsonObj.has("nodes")) { - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if (jsonArray2 != null && jsonArray2.size() > 0) { - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if (getJsonObj2 != null) { - if (cell_class_code != null && cell_class_code.equals(getJsonObj2.get("code"))) { - cell_class_id = getJsonObj2.get("id") + ""; - } - } - } - } - } - } - } - } - - LibraryAddResetProject libraryAddResetProject = new LibraryAddResetProject(); - //大修项目定额 - LibraryAddResetProjectBiz libraryAddResetProjectBiz = new LibraryAddResetProjectBiz(); - - float outsideRepairCost = 0;//委外工时费定额 - float insideRepairTime = 0;//自主实施工时定额 - - int contstr = 0;//用来判断excel是否有值 有则赋值为1 - - for (int i = minCellNum; i < maxCellNum; i++) { - - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i)) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3://项目代码 - libraryAddResetProject.setCode(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - libraryAddResetProject.setName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 6: - if ("新增".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setType(MaintainCommStr.Maintain_OverhaulType_add); - } - if ("重置".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryAddResetProject.setType(MaintainCommStr.Maintain_OverhaulType_reset); - } - break; - case 7: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBiz.setDismantle(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contstr = 1; - } - break; - case 8: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBiz.setInstall(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contstr = 1; - } - break; - case 9: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBiz.setDebugging(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contstr = 1; - } - break; - case 10: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - insideRepairTime += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBiz.setAccessory(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contstr = 1; - } - break; - case 11: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - outsideRepairCost += Float.parseFloat(getMergedRegionValue(sheet, rowNum, i)); - libraryAddResetProjectBiz.setTransport(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contstr = 1; - } - break; - case 12: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryAddResetProjectBiz.setMaterialCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contstr = 1; - } - break; - case 13: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - //libraryAddResetProjectBloc.setInsideRepairTime(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 14: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - //libraryAddResetProjectBloc.setOutsideRepairCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - libraryAddResetProject.setUnitId(company.getLibraryBizid()); - } else { - libraryAddResetProject.setUnitId(unitId); - } - - //部位库中必须要有 否则为无效数据 - if (cell_class_code != null && !cell_class_code.equals("") && cell_project_code != null && !cell_project_code.equals("")) { - libraryAddResetProject.setPid(cell_class_id); - /* - * 处理项目数据 - */ - libraryAddResetProject.setWhere("where pid = '" + cell_class_id + "' and code = '" + cell_project_code + "' and unit_id = '" + libraryAddResetProject.getUnitId() + "'"); - LibraryAddResetProject projectBloc = libraryAddResetProjectDao.selectByWhere(libraryAddResetProject); - if (projectBloc != null) { - cell_project_id = projectBloc.getId();//如存在则赋值原有的项目id - } else { - cell_project_id = CommUtil.getUUID();//否则创建新的项目id - } - - /* - * 处理项目定额 - */ - String pmbsql = "where project_id = '" + cell_project_id + "' and equipment_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryAddResetProjectBiz projectModelBiz = libraryAddResetProjectBizService.selectByWhere(pmbsql); - - if (libraryAddResetProject.getRepairPartyType() != null && libraryAddResetProject.getRepairPartyType().equals(MaintainCommStr.Maintain_IN)) { - libraryAddResetProjectBiz.setInsideRepairTime(insideRepairTime); - libraryAddResetProjectBiz.setOutsideRepairCost(0); - } - if (libraryAddResetProject.getRepairPartyType() != null && libraryAddResetProject.getRepairPartyType().equals(MaintainCommStr.Maintain_OUT)) { - libraryAddResetProjectBiz.setOutsideRepairCost(outsideRepairCost); - libraryAddResetProjectBiz.setInsideRepairTime(0); - } - - if (contstr == 1) { - if (projectModelBiz != null) { - libraryAddResetProjectBiz.setId(projectModelBiz.getId()); - libraryAddResetProjectBiz.setUnitId(unitId); - libraryAddResetProjectBiz.setProjectId(cell_project_id); - libraryAddResetProjectBiz.setEquipmentId(cell_model_id); - updateContentNum += libraryAddResetProjectBizService.update(libraryAddResetProjectBiz); - } else { - libraryAddResetProjectBiz.setId(CommUtil.getUUID()); - libraryAddResetProjectBiz.setUnitId(unitId); - libraryAddResetProjectBiz.setProjectId(cell_project_id); - libraryAddResetProjectBiz.setEquipmentId(cell_model_id); - insertContentNum += libraryAddResetProjectBizService.save(libraryAddResetProjectBiz); - } - } - - } - } - } - String result = ""; - result = "" - + "新增内容:" + insertContentNum + "条,修改内容:" + updateContentNum + "条!"; - System.out.println("导入新增重置库结束=============" + CommUtil.nowDate()); - return result; - } - - @Override - public String readXlsx4Biz(InputStream input, String json, String userId, String unitId) throws IOException { - return null; - } - - @Override - public List selectList4Class(String wherestr) { - LibraryAddResetProject entity = new LibraryAddResetProject(); - entity.setWhere(wherestr); - List list = libraryAddResetProjectDao.selectList4Class(entity); - return list; - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - - for (int i = 0; i < sheetMergeCount; i++) { - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell); - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell); - } -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryBaseServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryBaseServiceImpl.java deleted file mode 100644 index 876257e2..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryBaseServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import com.sipai.dao.maintenance.LibraryBaseDao; -import com.sipai.entity.maintenance.LibraryBase; -import com.sipai.service.maintenance.LibraryBaseService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class LibraryBaseServiceImpl implements LibraryBaseService { - - @Resource - LibraryBaseDao libraryBaseDao; - - @Override - public LibraryBase selectById(String id) { - LibraryBase libraryBase = libraryBaseDao.selectByPrimaryKey(id); - return libraryBase; - } - - @Override - public int deleteById(String id) { - int i = libraryBaseDao.deleteByPrimaryKey(id); - return i; - } - - @Override - public int save(LibraryBase entity) { - int insert = libraryBaseDao.insert(entity); - return insert; - } - - @Override - public int update(LibraryBase entity) { - int i = libraryBaseDao.updateByPrimaryKeySelective(entity); - return i; - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryBase libraryBase = new LibraryBase(); - libraryBase.setWhere(wherestr); - List libraryBases = libraryBaseDao.selectListByWhere(libraryBase); - return libraryBases; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryBase libraryBase = new LibraryBase(); - libraryBase.setWhere(wherestr); - int i = libraryBaseDao.deleteByWhere(libraryBase); - return i; - } -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryFaultBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryFaultBlocServiceImpl.java deleted file mode 100644 index e0626148..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryFaultBlocServiceImpl.java +++ /dev/null @@ -1,2287 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.entity.workorder.WorkorderRepairContent; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.*; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.workorder.WorkorderRepairContentService; -import com.sipai.tools.LibraryTool; -import com.sipai.tools.SpringContextUtil; -import com.sipai.tools.Work; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.dao.maintenance.LibraryFaultBlocDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryFaultBlocServiceImpl implements LibraryFaultBlocService { - - @Resource - private LibraryFaultBlocDao libraryFaultBlocDao; - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - @Resource - private CompanyService companyService; - @Resource - private LibraryRepairModelBlocService libraryRepairModelBlocService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private LibraryRepairEquBizService libraryRepairEquBizService; - @Resource - private LibraryBaseService libraryBaseService; - @Resource - WorkorderRepairContentService workorderRepairContentService; - - @Override - public LibraryFaultBloc selectById(String id) { - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocDao.selectByPrimaryKey(id); - // if(libraryFaultBloc!=null){ - // LibraryFaultBloc p =libraryFaultBlocDao.selectByPrimaryKey(libraryFaultBloc.getPid()); - // if(p!=null){ - // libraryFaultBloc.set_pname(p.getName()); - // } - // } - return libraryFaultBloc; - } - - //工艺可视化,异常消缺查id的 - public LibraryFaultBloc selectByFaultId(String id) { - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocDao.selectByPrimaryKey(id); - return libraryFaultBloc; - } - - @Transactional - public int deleteById(String id) { - //删除对应的维修内容表 - libraryRepairBlocService.deleteByWhere("where pid ='" + id + "'"); - return libraryFaultBlocDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryFaultBloc libraryFaultBloc) { - return libraryFaultBlocDao.insert(libraryFaultBloc); - } - - @Override - public int update(LibraryFaultBloc libraryFaultBloc) { - return libraryFaultBlocDao.updateByPrimaryKeySelective(libraryFaultBloc); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryFaultBloc libraryFaultBloc = new LibraryFaultBloc(); - libraryFaultBloc.setWhere(wherestr); - List faultLibraries = libraryFaultBlocDao.selectListByWhere(libraryFaultBloc); - return faultLibraries; - } - - @Transactional - public int deleteByWhere(String wherestr, String ids) { - LibraryFaultBloc libraryFaultBloc = new LibraryFaultBloc(); - libraryFaultBloc.setWhere(wherestr); - System.out.println(libraryFaultBloc.getId()); - //删除对应的维修内容表 - libraryRepairBlocService.deleteByWhere("where pid in ('" + ids + "')"); - return libraryFaultBlocDao.deleteByWhere(libraryFaultBloc); - } - - - /** - * 获取树 弃用 sj 2020-07-21 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (LibraryFaultBloc k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getFaultName()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (LibraryFaultBloc k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getFaultName()); - m.put("pid", k.getPid()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 集团维修库导出 - */ - @SuppressWarnings({"deprecation", "rawtypes"}) - @Override - public void doExportLibraryFaultBloc(HttpServletResponse response, - List equipmentClasses, String unitId) throws IOException { - String fileName = "设备维修库" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - /*List libraryBases = null; - try { - libraryBases = libraryBaseService.selectListByWhere("where library_type = 'repair'"); - } catch (Exception e) { - e.printStackTrace(); - } - String placeStatus = libraryBases.get(0).getPlaceStatus();*/ - - String placeStatus = "n"; - //读取配置是否有区域 会让模板显示的不一样 - LibraryTool libraryTool = (LibraryTool) SpringContextUtil.getBean("library"); - if (libraryTool != null) { - placeStatus = libraryTool.getRepairPart(); - } - - if (equipmentClasses != null && equipmentClasses.size() > 0) { - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName() + "(" + equipmentClasses.get(z).getEquipmentClassCode() + ")"; - - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 表头 - String excelTitleStr = ""; - String unitstr = " "; - //如果配置了所属标准库则认为是水厂 否则认为是业务区 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - unitstr = company.getLibraryBizid(); - } else { - unitstr = unitId; - } - // 查数据了 - List list = null; - String contentStr = " where m.pid = '" + equipmentClasses.get(z).getId() + "' "; - // 创建一个int类型来赋值 - int count = 0; - if ("y".equals(placeStatus)) { - excelTitleStr = "小类代码,设备小类,设备型号,部位代码,部位名称,故障代码,故障名称,故障描述,维修代码,维修名称,维修内容," - + "委外/自修,小修/中修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - count = 17; - list = libraryRepairBlocService.selectList4Class(contentStr + "order by m.morder,ec.morder,p.fault_number,c.repair_number", unitstr); - for (int x = 0; x < 17; x++) { - // 设置表格每列的宽度 - sheet.setColumnWidth(x, 4000); - } - } else if ("n".equals(placeStatus)) { - count = 15; - excelTitleStr = "小类代码,设备小类,设备型号,故障代码,故障名称,故障描述,维修代码,维修名称,维修内容," - + "委外/自修,小修/中修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - list = libraryRepairBlocService.selectList3Class(contentStr + "order by m.morder,p.fault_number,c.repair_number", unitstr); - for (int x = 0; x < 15; x++) { - // 设置表格每列的宽度 - sheet.setColumnWidth(x, 4000); - } - } - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 -// String excelTitleStr = "小类代码,设备小类,设备型号,部位代码,部位名称,故障代码,故障名称,故障描述,维修代码,维修名称,维修内容," -// + "委外/自修,小修/中修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("维修库" + "(" + equipmentClasses.get(z).getName() + ")"); - } - - if ((excelTitle.length - 1) != 0) { - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - } - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - -// sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 4)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - -// sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, 5)); - HSSFCell twocell3 = twoRow.createCell(5); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 9)); - HSSFCell twocell4 = twoRow.createCell(6); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - if ((count - 1) != 10) { - sheet.addMergedRegion(new CellRangeAddress(1, 1, 10, count - 1)); - } - HSSFCell twocell5 = twoRow.createCell(10); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if (jsonObject1.has(list.get(i).getM_id())) { - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - //设备部位 - if (jsonObject2.has(list.get(i).getEc_id())) { - int num = (int) jsonObject2.get(list.get(i).getEc_id()); - jsonObject2.put(list.get(i).getEc_id(), num + 1); - } else { - if (list.get(i).getEc_id() != null) { - jsonObject2.put(list.get(i).getEc_id(), 1); - } else { - jsonObject2.put("空" + CommUtil.getUUID(), 1); - } - } - - //故障内容 - if (jsonObject3.has(list.get(i).getP_id())) { - int num = (int) jsonObject3.get(list.get(i).getP_id()); - jsonObject3.put(list.get(i).getP_id(), num + 1); - } else { - if (list.get(i).getP_id() != null) { - jsonObject3.put(list.get(i).getP_id(), 1); - } else { - jsonObject3.put("空" + CommUtil.getUUID(), 1); - } - } - - //String sqlstrContent = "where content_id = '"+list.get(i).getId()+"' and unit_id = '"+unitId+"' and model_id = '-1'"; - String sqlstrContent = "where content_id = '" + list.get(i).getId() + "' and model_id = '-1'"; - LibraryRepairModelBloc libraryRepairModelBloc = libraryRepairModelBlocService.selectByWhere(sqlstrContent); - if (count == 15) { - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); -// //部位代码 -// HSSFCell cell_3 = row.createCell(3); -// cell_3.setCellStyle(listStyle); -// cell_3.setCellValue(list.get(i).getEc_code()); -// //部位名称 -// HSSFCell cell_4 = row.createCell(4); -// cell_4.setCellStyle(listStyle); -// cell_4.setCellValue(list.get(i).getEc_name()); - //故障代码 - HSSFCell cell_5 = row.createCell(3); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getP_code()); - //故障名称 - HSSFCell cell_6 = row.createCell(4); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getP_name()); - //故障描述 - HSSFCell cell_7 = row.createCell(5); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getP_describe()); - //维修代码 - HSSFCell cell_8 = row.createCell(6); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getRepairNumber()); - //维修名称 - HSSFCell cell_9 = row.createCell(7); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getRepairName()); - //维修内容 - HSSFCell cell_10 = row.createCell(8); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getRepairContent()); - //委外/自修 - HSSFCell cell_11 = row.createCell(9); - cell_11.setCellStyle(listStyle); - if (MaintenanceCommString.Maintenance_Type_In.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("自修"); - } - if (MaintenanceCommString.Maintenance_Type_Out.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("委外"); - } - //小修/中修 - HSSFCell cell_12 = row.createCell(10); - cell_12.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_RepairType_Small.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("小修"); - } - if (MaintainCommStr.Maintain_RepairType_Medium.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("中修"); - } - - if (libraryRepairModelBloc != null) { - //自修工时(小时) - HSSFCell cell_13 = row.createCell(11); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(libraryRepairModelBloc.getInsideRepairTime()); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(12); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(libraryRepairModelBloc.getOutsideRepairCost()); - //物资费定额(元) - HSSFCell cell_15 = row.createCell(13); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(libraryRepairModelBloc.getMaterialCost()); - //总大修费定额(元) - HSSFCell cell_16 = row.createCell(14); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(libraryRepairModelBloc.getTotalCost()); - } else { - //自修工时(小时) - HSSFCell cell_13 = row.createCell(11); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(12); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(""); - //物资费定额(元) - HSSFCell cell_15 = row.createCell(13); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(""); - //总大修费定额(元) - HSSFCell cell_16 = row.createCell(14); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(""); - } - } else { - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //部位代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getEc_code()); - //部位名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getEc_name()); - //故障代码 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getP_code()); - //故障名称 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getP_name()); - //故障描述 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getP_describe()); - //维修代码 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getRepairNumber()); - //维修名称 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getRepairName()); - //维修内容 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getRepairContent()); - //委外/自修 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if (MaintenanceCommString.Maintenance_Type_In.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("自修"); - } - if (MaintenanceCommString.Maintenance_Type_Out.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("委外"); - } - //小修/中修 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_RepairType_Small.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("小修"); - } - if (MaintainCommStr.Maintain_RepairType_Medium.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("中修"); - } - if (libraryRepairModelBloc != null) { - //自修工时(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(libraryRepairModelBloc.getInsideRepairTime()); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(libraryRepairModelBloc.getOutsideRepairCost()); - //物资费定额(元) - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(libraryRepairModelBloc.getMaterialCost()); - //总大修费定额(元) - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(libraryRepairModelBloc.getTotalCost()); - } else { - //自修工时(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(""); - //物资费定额(元) - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(""); - //总大修费定额(元) - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(""); - } - } - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - if (num != 1) { - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - //设备型号合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - } - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - if (placeStatus.equals("y")) { - - for (Iterator iter = jsonObject2.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - if (num != 1) { - //设备型号 - //sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - //部位代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - //部位名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - } - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - if (num != 1) { - //故障代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - //故障名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - //故障描述合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 7, 7)); - } - rownum = rownum + num; - } - - } - - if (placeStatus.equals("n")) { - //设备部位代码及名称的合并单元格 - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - if (num != 1) { - //故障代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - //故障名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - //故障描述合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - } - rownum = rownum + num; - } - } - - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - /** - * 分厂维修库导出 - * - * @param response - * @param equipmentClasses - * @param unitId - * @param smallClassId - * @throws IOException - */ - @Override - public void doExportLibraryFaultBiz(HttpServletResponse response, List equipmentClasses, String unitId, String smallClassId) throws IOException { - String fileName = "设备维修库" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if (equipmentClasses != null && equipmentClasses.size() > 0) { - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName() + "(" + equipmentClasses.get(z).getEquipmentClassCode() + ")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - String placeStatus = "n"; - //读取配置是否有区域 会让模板显示的不一样 - LibraryTool libraryTool = (LibraryTool) SpringContextUtil.getBean("library"); - if (libraryTool != null) { - placeStatus = libraryTool.getRepairPart(); - } - - if (placeStatus.equals("n")) { - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000);//类别代码 - sheet.setColumnWidth(1, 4000);//类别名称 - sheet.setColumnWidth(2, 3000);//设备型号 - sheet.setColumnWidth(3, 3000);//故障代码 - sheet.setColumnWidth(4, 4000);//故障名称 - sheet.setColumnWidth(5, 5000);//故障描述 - sheet.setColumnWidth(6, 2000);//维修代码 - sheet.setColumnWidth(7, 3000);//维修名称 - sheet.setColumnWidth(8, 9000);//维修内容 - sheet.setColumnWidth(9, 3000);//委外、自修 - sheet.setColumnWidth(10, 4000);//小修、中修 - sheet.setColumnWidth(11, 4000);//自修工时 - sheet.setColumnWidth(12, 4000);//委外工时费 - sheet.setColumnWidth(13, 4000);//物资费定额 - sheet.setColumnWidth(14, 4000);//总大修费 - } - if (placeStatus.equals("y")) { - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000);//类别代码 - sheet.setColumnWidth(1, 4000);//类别名称 - sheet.setColumnWidth(2, 3000);//设备型号 - sheet.setColumnWidth(3, 3000);//部位代码 - sheet.setColumnWidth(4, 4000);//部位名称 - sheet.setColumnWidth(5, 3000);//故障代码 - sheet.setColumnWidth(6, 4000);//故障名称 - sheet.setColumnWidth(7, 5000);//故障描述 - sheet.setColumnWidth(8, 2000);//维修代码 - sheet.setColumnWidth(9, 3000);//维修名称 - sheet.setColumnWidth(10, 9000);//维修内容 - sheet.setColumnWidth(11, 3000);//委外、自修 - sheet.setColumnWidth(12, 4000);//小修、中修 - sheet.setColumnWidth(13, 4000);//自修工时 - sheet.setColumnWidth(14, 4000);//委外工时费 - sheet.setColumnWidth(15, 4000);//物资费定额 - sheet.setColumnWidth(16, 4000);//总大修费 - } - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = ""; - if (placeStatus.equals("n")) { - excelTitleStr = "小类代码,设备小类,设备型号,故障代码,故障名称,故障描述,维修代码,维修名称,维修内容," - + "委外/自修,小修/中修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - } - if (placeStatus.equals("y")) { - excelTitleStr = "小类代码,设备小类,设备型号,部位代码,部位名称,故障代码,故障名称,故障描述,维修代码,维修名称,维修内容," - + "委外/自修,小修/中修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - } - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("维修库" + "(" + equipmentClasses.get(z).getName() + ")"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - -// sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 4)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - -// sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, 5)); - HSSFCell twocell3 = twoRow.createCell(5); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 9)); - HSSFCell twocell4 = twoRow.createCell(6); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - if (placeStatus.equals("n")) { - sheet.addMergedRegion(new CellRangeAddress(1, 1, 10, 14)); - } - if (placeStatus.equals("y")) { - sheet.addMergedRegion(new CellRangeAddress(1, 1, 10, 16)); - } - HSSFCell twocell5 = twoRow.createCell(10); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - String unitstr = " "; - unitstr = unitId; - String contentStr = " where m.pid = '" + equipmentClasses.get(z).getId() + "' "; - contentStr += " and m.id in (" + smallClassId + ") "; - - List list = libraryRepairBlocService.selectList3Class(contentStr + "order by m.morder,p.fault_number,c.repair_number", unitstr); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if (jsonObject1.has(list.get(i).getM_id())) { - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - if (placeStatus.equals("y")) { - //设备部位 - if (jsonObject2.has(list.get(i).getEc_id())) { - int num = (int) jsonObject2.get(list.get(i).getEc_id()); - jsonObject2.put(list.get(i).getEc_id(), num + 1); - } else { - if (list.get(i).getEc_id() != null) { - jsonObject2.put(list.get(i).getEc_id(), 1); - } else { - jsonObject2.put("空" + CommUtil.getUUID(), 1); - } - } - } - - //故障内容 - if (jsonObject3.has(list.get(i).getP_id())) { - int num = (int) jsonObject3.get(list.get(i).getP_id()); - jsonObject3.put(list.get(i).getP_id(), num + 1); - } else { - if (list.get(i).getP_id() != null) { - jsonObject3.put(list.get(i).getP_id(), 1); - } else { - jsonObject3.put("空" + CommUtil.getUUID(), 1); - } - } - - if (placeStatus.equals("n")) { - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //故障代码 - HSSFCell cell_5 = row.createCell(3); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getP_code()); - //故障名称 - HSSFCell cell_6 = row.createCell(4); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getP_name()); - //故障描述 - HSSFCell cell_7 = row.createCell(5); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getP_describe()); - //维修代码 - HSSFCell cell_8 = row.createCell(6); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getRepairNumber()); - //维修名称 - HSSFCell cell_9 = row.createCell(7); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getRepairName()); - //维修内容 - HSSFCell cell_10 = row.createCell(8); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getRepairContent()); - //委外/自修 - HSSFCell cell_11 = row.createCell(9); - cell_11.setCellStyle(listStyle); - if (MaintenanceCommString.Maintenance_Type_In.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("自修"); - } - if (MaintenanceCommString.Maintenance_Type_Out.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("委外"); - } - //小修/中修 - HSSFCell cell_12 = row.createCell(10); - cell_12.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_RepairType_Small.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("小修"); - } - if (MaintainCommStr.Maintain_RepairType_Medium.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("中修"); - } - -// String sqlstrContent = "where content_id = '" + list.get(i).getId() + "' and equipment_id = '-1'"; -// LibraryRepairEquBiz libraryRepairEquBiz = libraryRepairEquBizService.selectByWhere(sqlstrContent); -// if (libraryRepairEquBiz != null) { - //自修工时(小时) - HSSFCell cell_13 = row.createCell(11); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(list.get(i).getInsideRepairTime()); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(12); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(list.get(i).getOutsideRepairCost()); - //物资费定额(元) - HSSFCell cell_15 = row.createCell(13); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(list.get(i).getMaterialCost()); - //总大修费定额(元) - HSSFCell cell_16 = row.createCell(14); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(list.get(i).getTotalCost()); - } - if (placeStatus.equals("y")) { - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //部位代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getEc_code()); - //部位名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getEc_name()); - //故障代码 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getP_code()); - //故障名称 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getP_name()); - //故障描述 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getP_describe()); - //维修代码 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getRepairNumber()); - //维修名称 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getRepairName()); - //维修内容 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getRepairContent()); - //委外/自修 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if (MaintenanceCommString.Maintenance_Type_In.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("自修"); - } - if (MaintenanceCommString.Maintenance_Type_Out.equals(list.get(i).getRepairPartyType())) { - cell_11.setCellValue("委外"); - } - //小修/中修 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_RepairType_Small.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("小修"); - } - if (MaintainCommStr.Maintain_RepairType_Medium.equals(list.get(i).getRepairType())) { - cell_12.setCellValue("中修"); - } - - //自修工时(小时) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(list.get(i).getInsideRepairTime()); - //委外工时费定额(元) - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(list.get(i).getOutsideRepairCost()); - //物资费定额(元) - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(list.get(i).getMaterialCost()); - //总大修费定额(元) - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(list.get(i).getTotalCost()); - } - - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - if (num != 1) { - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - //设备型号合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - } - rownum = rownum + num; - } - - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - if (placeStatus.equals("y")) { - - for (Iterator iter = jsonObject2.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - if (num != 1) { - //设备型号 - //部位代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - //部位名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - } - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - if (num != 1) { - //故障代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - //故障名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - //故障描述合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 7, 7)); - } - rownum = rownum + num; - } - - } - - if (placeStatus.equals("n")) { - //设备部位代码及名称的合并单元格 - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - if (num != 1) { - //故障代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - //故障名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - //故障描述合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - } - rownum = rownum + num; - } - } - - - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Transactional - public String readXls(InputStream input, String json, String userId, String unitId) throws IOException { - System.out.println("导入维修库开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertProjectNum = 0, updateProjectNum = 0; - int insertContentNum = 0, updateContentNum = 0; - - String placeStatus = "n"; - //读取配置是否有区域 会让模板显示的不一样 - LibraryTool libraryTool = (LibraryTool) SpringContextUtil.getBean("library"); - if (libraryTool != null) { - placeStatus = libraryTool.getRepairPart(); - } - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - String project_id = ""; - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 15) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_part_code = getMergedRegionValue(sheet, rowNum, 3);//设备部位代码 - String cell_class_id = "";//设备小类id - String cell_part_id = "";//设备部位id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 5);//设备故障代码 - String cell_project_id = "";//故障id - String cell_repair_id = "";//内容id - String cell_repair_code = getMergedRegionValue(sheet, rowNum, 8);//维修代码 - String cell_model_id = "";//型号id - - //没有部位的项目 excel位置也会变化 - if (placeStatus.equals("n")) { - cell_project_code = getMergedRegionValue(sheet, rowNum, 3);//设备故障代码 - cell_repair_code = getMergedRegionValue(sheet, rowNum, 6);//维修代码 - } - - JSONArray jsonArray = JSONArray.fromObject(json); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if (cell_big_class_code != null && cell_big_class_code.equals(getJsonObj.get("code"))) { - if (getJsonObj.has("nodes")) { - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if (jsonArray2 != null && jsonArray2.size() > 0) { - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if (getJsonObj2 != null) { - if (cell_class_code != null && cell_class_code.equals(getJsonObj2.get("code"))) { - cell_class_id = getJsonObj2.get("id") + ""; - if (getJsonObj2.has("nodes")) { - JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); - if (jsonArray3 != null && jsonArray3.size() > 0) { - for (int k = 0; k < jsonArray3.size(); k++) { - JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 - if (getJsonObj3 != null) { - if (cell_part_code != null && cell_part_code.equals(getJsonObj3.get("code"))) { - cell_part_id = getJsonObj3.get("id") + ""; - } - } - } - } - } - } - } - } - } - } - } - } - } - - LibraryFaultBloc libraryFaultBloc = new LibraryFaultBloc(); - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - LibraryRepairModelBloc libraryRepairModelBloc = new LibraryRepairModelBloc(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i)) { - continue; - } - try { - if (placeStatus != null && placeStatus.equals("n")) { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3: - libraryFaultBloc.setFaultNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - libraryFaultBloc.setFaultName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - libraryFaultBloc.setFaultDescribe(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - libraryRepairBloc.setRepairNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7: - libraryRepairBloc.setRepairName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 8: - libraryRepairBloc.setRepairContent(getMergedRegionValue(sheet, rowNum, i)); - break; - case 9://内容代码 - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 10: - if ("小修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairType(MaintainCommStr.Maintain_RepairType_Small); - } - if ("中修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairType(MaintainCommStr.Maintain_RepairType_Medium); - } - break; - case 11: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { -// libraryRepairModelBloc.setInsideRepairTime(Float.parseFloat(getStringVal(cell))); - libraryRepairBloc.setInsideRepairTime(Float.parseFloat(getStringVal(cell))); - } - break; - case 12: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { -// libraryRepairModelBloc.setOutsideRepairCost(Float.parseFloat(getStringVal(cell))); - libraryRepairBloc.setOutsideRepairCost(Float.parseFloat(getStringVal(cell))); - } - break; - case 13: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { -// libraryRepairModelBloc.setMaterialCost(Float.parseFloat(getStringVal(cell))); - libraryRepairBloc.setMaterialCost(Float.parseFloat(getStringVal(cell))); - } - break; - case 14: - cell.setCellType(CellType.STRING); - String value = cell.getStringCellValue(); - if (value != null && !value.equals("")) { -// libraryRepairModelBloc.setTotalCost(Float.parseFloat(value)); - libraryRepairBloc.setTotalCost(Float.parseFloat(value)); - } - break; - default: - break; - } - } else { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3: - break; - case 4: - break; - case 5://故障编号 - libraryFaultBloc.setFaultNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - libraryFaultBloc.setFaultName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7: - libraryFaultBloc.setFaultDescribe(getMergedRegionValue(sheet, rowNum, i)); - break; - case 8: - libraryRepairBloc.setRepairNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 9://内容代码 - libraryRepairBloc.setRepairName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 10: - libraryRepairBloc.setRepairContent(getMergedRegionValue(sheet, rowNum, i)); - break; - case 11://维修方式 委外自修 - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 12: - if ("小修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairType(MaintainCommStr.Maintain_RepairType_Small); - } - if ("中修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairType(MaintainCommStr.Maintain_RepairType_Medium); - } - break; - case 13: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { -// libraryRepairModelBloc.setInsideRepairTime(Float.parseFloat(getStringVal(cell))); - libraryRepairBloc.setInsideRepairTime(Float.parseFloat(getStringVal(cell))); - } - break; - case 14: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { -// libraryRepairModelBloc.setOutsideRepairCost(Float.parseFloat(getStringVal(cell))); - libraryRepairBloc.setOutsideRepairCost(Float.parseFloat(getStringVal(cell))); - } - break; - case 15: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { -// libraryRepairModelBloc.setMaterialCost(Float.parseFloat(getStringVal(cell))); - libraryRepairBloc.setMaterialCost(Float.parseFloat(getStringVal(cell))); - } - break; - case 16: - cell.setCellType(CellType.STRING); - String value = cell.getStringCellValue(); - if (value != null && !value.equals("")) { -// libraryRepairModelBloc.setTotalCost(Float.parseFloat(value)); - libraryRepairBloc.setTotalCost(Float.parseFloat(value)); - } - break; - default: - break; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - libraryFaultBloc.setUnitId(company.getLibraryBizid()); - } else { - libraryFaultBloc.setUnitId(unitId); - } - - //部位库中必须要有 否则为无效数据 - String pid = ""; - if (cell_part_id != null && !cell_part_id.equals("")) {// - pid = cell_part_id; - libraryFaultBloc.setPid(pid); - libraryFaultBloc.setMorder(rowNum); - } else { - pid = cell_class_id; - libraryFaultBloc.setPid(pid); - libraryFaultBloc.setMorder(rowNum); - } - /* - * 处理项目数据 - */ - libraryFaultBloc.setWhere("where pid = '" + pid + "' and fault_number = '" + cell_project_code + "' and unit_id = '" + unitId + "'"); - LibraryFaultBloc libraryFaultBloc2 = libraryFaultBlocDao.selectByWhere(libraryFaultBloc); - if (libraryFaultBloc2 != null) { - cell_project_id = libraryFaultBloc2.getId();//如存在则赋值原有的项目id - libraryFaultBloc.setId(cell_project_id); -// libraryFaultBlocDao.deleteByPrimaryKey(cell_project_id); - libraryFaultBlocDao.updateByPrimaryKeySelective(libraryFaultBloc); - updateProjectNum += 1; - } else { - cell_project_id = CommUtil.getUUID();//否则创建新的项目id - libraryFaultBloc.setId(cell_project_id); - if (libraryFaultBloc.getFaultNumber() != null && !libraryFaultBloc.getFaultNumber().equals("")) { - libraryFaultBlocDao.insert(libraryFaultBloc); - insertProjectNum += 1; - } - } - - /* - * 处理内容数据 - */ - if (cell_project_code != null && !cell_project_code.equals("")) { - libraryRepairBloc.setPid(cell_project_id); - String sqlstr = "where pid = '" + cell_project_id + "' and repair_number = '" + libraryRepairBloc.getRepairNumber() + "'"; - LibraryRepairBloc repairBloc = libraryRepairBlocService.selectByWhere(sqlstr); - if (repairBloc != null) { - cell_repair_id = repairBloc.getId(); - libraryRepairBloc.setId(cell_repair_id); - libraryRepairBlocService.update(libraryRepairBloc); - updateContentNum += 1; - } else { - cell_repair_id = CommUtil.getUUID(); - libraryRepairBloc.setId(cell_repair_id); - if (libraryRepairBloc.getRepairNumber() != null && !libraryRepairBloc.getRepairNumber().equals("")) { - libraryRepairBlocService.save(libraryRepairBloc); - insertContentNum += 1; - } - } - } - - - /* - * 处理定额数据 - */ - /*if (cell_repair_code != null && !cell_repair_code.equals("")) { - String sqlstrmodel = "where content_id = '" + cell_repair_id + "' and model_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryRepairModelBloc lrModelBloc = libraryRepairModelBlocService.selectByWhere(sqlstrmodel); - if (lrModelBloc != null) { - libraryRepairModelBloc.setId(lrModelBloc.getId()); - libraryRepairModelBloc.setContentId(lrModelBloc.getContentId()); - libraryRepairModelBloc.setModelId(lrModelBloc.getModelId()); - libraryRepairModelBloc.setUnitId(unitId); - libraryRepairModelBlocService.update(libraryRepairModelBloc); - } else { - libraryRepairModelBloc.setId(CommUtil.getUUID()); - libraryRepairModelBloc.setContentId(cell_repair_id); - libraryRepairModelBloc.setModelId(cell_model_id); - libraryRepairModelBloc.setUnitId(unitId); - libraryRepairModelBlocService.save(libraryRepairModelBloc); - } - }*/ - - } - } - String result = ""; - result = "" - //+ "新增项目:"+insertProjectNum+"条,修改项目:"+updateProjectNum+"条," - + "新增内容:" + insertContentNum + "条,修改内容:" + updateContentNum + "条!"; - System.out.println("导入维修库结束=============" + CommUtil.nowDate()); - return result; - } - - @Override - public String readXlsx(InputStream input, String json, String userId, String unitId) - throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - @Transactional - public String readXls4Biz(InputStream input, String json, String userId, String unitId) throws IOException { - System.out.println("导入维修库开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertProjectNum = 0, updateProjectNum = 0; - int insertContentNum = 0, updateContentNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - String project_id = ""; - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 15) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_part_code = getMergedRegionValue(sheet, rowNum, 3);//设备部位代码 - String cell_part_id = "";//设备部位id - String cell_tree_id = "";//设备树id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 3);//设备故障代码 - String cell_project_id = "";//故障id - String cell_repair_id = "";//内容id - String cell_repair_code = getMergedRegionValue(sheet, rowNum, 8);//内容code - String cell_model_id = "";//型号id - - JSONArray jsonArray = JSONArray.fromObject(json); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if (cell_big_class_code != null && cell_big_class_code.equals(getJsonObj.get("code"))) { - if (getJsonObj.has("nodes")) { - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if (jsonArray2 != null && jsonArray2.size() > 0) { - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if (getJsonObj2 != null) { - if (cell_class_code != null && cell_class_code.equals(getJsonObj2.get("code"))) { - cell_tree_id = getJsonObj2.get("id") + ""; -// if (getJsonObj2.has("nodes")) { -// JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); -// if (jsonArray3 != null && jsonArray3.size() > 0) { -// for (int k = 0; k < jsonArray3.size(); k++) { -// JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 -// if (getJsonObj3 != null) { -// if (cell_part_code != null && cell_part_code.equals(getJsonObj3.get("code"))) { -// cell_part_id = getJsonObj3.get("id") + ""; -// } -// } -// } -// } -// } - } - } - } - } - } - } - } - } - - LibraryFaultBloc libraryFaultBloc = new LibraryFaultBloc(); - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - LibraryRepairEquBiz libraryRepairEquBiz = new LibraryRepairEquBiz(); - - int numstr = 0;//判断excel是否存在值 - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i)) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3: - //故障编号 - libraryFaultBloc.setFaultNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - libraryFaultBloc.setFaultName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - libraryFaultBloc.setFaultDescribe(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - libraryRepairBloc.setRepairNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7://内容代码 - libraryRepairBloc.setRepairName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 8: - libraryRepairBloc.setRepairContent(getMergedRegionValue(sheet, rowNum, i)); - break; - case 9://维修方式 委外自修 - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 10: - if ("小修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairType(MaintainCommStr.Maintain_RepairType_Small); - } - if ("中修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryRepairBloc.setRepairType(MaintainCommStr.Maintain_RepairType_Medium); - } - break; - case 11: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - libraryRepairBloc.setInsideRepairTime(Float.parseFloat(getStringVal(cell))); - numstr = 1; - } - break; - case 12: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - libraryRepairBloc.setOutsideRepairCost(Float.parseFloat(getStringVal(cell))); - numstr = 1; - } - break; - case 13: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - libraryRepairBloc.setMaterialCost(Float.parseFloat(getStringVal(cell))); - numstr = 1; - } - break; - case 14: - cell.setCellType(CellType.STRING); - String value = cell.getStringCellValue(); - if (value != null && !value.equals("")) { - libraryRepairEquBiz.setTotalCost(Float.parseFloat(value)); - numstr = 1; - } - break; - case 15: - break; - case 16: - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - -// Company company = companyService.selectByPrimaryKey(unitId); -// if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { -// libraryFaultBloc.setUnitId(company.getLibraryBizid()); -//// unitId = company.getLibraryBizid(); -// } else { - libraryFaultBloc.setUnitId(unitId); -// } - - //部位库中必须要有 否则为无效数据 - if (cell_tree_id != null && !cell_tree_id.equals("")) {// - libraryFaultBloc.setPid(cell_tree_id); - libraryFaultBloc.setMorder(rowNum); - /* - * 处理项目数据 - */ - libraryFaultBloc.setWhere("where pid = '" + cell_tree_id + "' and fault_number = '" + cell_project_code + "' and unit_id = '" + libraryFaultBloc.getUnitId() + "'"); - LibraryFaultBloc libraryFaultBloc2 = libraryFaultBlocDao.selectByWhere(libraryFaultBloc); - if (libraryFaultBloc2 != null) { - cell_project_id = libraryFaultBloc2.getId();//如存在则赋值原有的项目id - } else { - cell_project_id = CommUtil.getUUID();//否则创建新的项目id - } - - /* - * 处理内容数据 - */ - LibraryRepairBloc repairBloc = new LibraryRepairBloc(); - if (cell_project_code != null && !cell_project_code.equals("")) { - libraryRepairBloc.setPid(cell_project_id); - String sqlstr = "where pid = '" + cell_project_id + "' and repair_number = '" + libraryRepairBloc.getRepairNumber() + "'"; - repairBloc = libraryRepairBlocService.selectByWhere(sqlstr); - if (repairBloc != null) { - cell_repair_id = repairBloc.getId(); - /* - * 处理定额数据 - */ - if (numstr == 1) { - updateContentNum += 1; - System.out.println("修改数据"); - repairBloc.setRepairNumber(libraryRepairBloc.getRepairNumber()); - repairBloc.setRepairName(libraryRepairBloc.getRepairName()); - repairBloc.setRepairContent(libraryRepairBloc.getRepairContent()); - repairBloc.setRepairPartyType(libraryRepairBloc.getRepairPartyType()); - repairBloc.setRepairType(libraryRepairBloc.getRepairType()); - repairBloc.setInsideRepairTime(libraryRepairBloc.getInsideRepairTime()); - repairBloc.setOutsideRepairCost(libraryRepairBloc.getOutsideRepairCost()); - repairBloc.setMaterialCost(libraryRepairBloc.getMaterialCost()); - repairBloc.setTotalCost(libraryRepairBloc.getTotalCost()); - libraryRepairBlocService.update(repairBloc); - } - } else { - cell_repair_id = CommUtil.getUUID(); - /* - * 处理定额数据 - */ - if (numstr == 1) { - insertContentNum += 1; - System.out.println("新增数据"); - System.out.println(cell_repair_id); - libraryRepairBloc.setId(cell_repair_id); - libraryRepairBloc.setUnitId(unitId); - libraryFaultBloc.setInsdt(CommUtil.nowDate()); - libraryRepairBlocService.save(libraryRepairBloc); - } - } - } - } - } - } - String result = ""; - result = "" - + "新增内容:" + insertContentNum + "条,修改内容:" + updateContentNum + "条!"; - System.out.println("导入维修库结束=============" + CommUtil.nowDate()); - return result; - } - - @Override - public String readXlsx4Biz(InputStream input, String json, String userId, String unitId) throws IOException { - return null; - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - - for (int i = 0; i < sheetMergeCount; i++) { - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell); - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell); - } - - @Override - public LibraryFaultBloc selectById4Part(String id) { - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocDao.selectByPrimaryKey(id); - if (libraryFaultBloc != null) { - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryFaultBloc.getPid()); - libraryFaultBloc.setEquipmentClass(equipmentClass); - } - return libraryFaultBloc; - } - - @Override - public List selectList4Part(String wherestr) { - LibraryFaultBloc entity = new LibraryFaultBloc(); - entity.setWhere(wherestr); - List faultLibraries = libraryFaultBlocDao.selectListByWhere(entity); - for (LibraryFaultBloc libraryFaultBloc : faultLibraries) { - //查部位 - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryFaultBloc.getPid()); - libraryFaultBloc.setEquipmentClass(equipmentClass); - } - return faultLibraries; - } - - @Override - public void doInit(String unitId) { - // 1. 初始化维修 先删除再同步 - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - libraryRepairBloc.setWhere("where p.unit_id = '" + unitId +"'"); - libraryRepairBloc.setUnitId(unitId); - libraryRepairBlocService.deletePid(libraryRepairBloc); - libraryRepairBlocService.deleteByWhere("where id like '%" + unitId + "'"); - libraryRepairBlocService.doInit(libraryRepairBloc); - // 2. 初始化故障 先删除再同步 - LibraryFaultBloc libraryFaultBloc = new LibraryFaultBloc(); - libraryFaultBloc.setWhere("where unit_id = '" + unitId +"'"); - libraryFaultBloc.setUnitId(unitId); - libraryFaultBlocDao.deleteByWhere(libraryFaultBloc); - libraryFaultBlocDao.doInit(libraryFaultBloc); - } - - /* @Override - public void doExportLibraryRepair(HttpServletResponse response, List workorderDetailList, String type) throws IOException { - String fileName = "设备维修汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - HSSFWorkbook workbook = new HSSFWorkbook(); - List libraryBases = null; - try { - libraryBases = libraryBaseService.selectListByWhere("where library_type = 'repair'"); - } catch (Exception e) { - e.printStackTrace(); - } - String placeStatus = libraryBases.get(0).getPlaceStatus(); - if (workorderDetailList.size() > 1) { - if ("maintain".equals(type)) { - fileName = "设备保养汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } else { - fileName = "设备维修汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000);//保修单编号 - sheet.setColumnWidth(1, 4000);//上报班组 - sheet.setColumnWidth(2, 3000);//上报人员 - sheet.setColumnWidth(3, 3000);//上报日期 - sheet.setColumnWidth(4, 4000);//设备编号 - sheet.setColumnWidth(5, 3000);//安装地点 - sheet.setColumnWidth(6, 4000);//设备名称 - sheet.setColumnWidth(7, 2000);//故障类别 - sheet.setColumnWidth(8, 5000);//故障情况 - sheet.setColumnWidth(9, 5000);//维修内容 - sheet.setColumnWidth(10, 5000);//使用材料 - sheet.setColumnWidth(11, 3000);//完成情况 - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - String excelTitleStr = "报修单编号,上报班组,上报人员,上报日期,设备编号,安装地点,设备名称,故障类别,故障情况,维修内容,使用材料,完成情况"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 800); - for (int s = 0; s < excelTitle.length; s++) { - HSSFCell cell = row.createCell(s); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[s]); - cell.setCellValue(text); - } - for (int i = 0; i < workorderDetailList.size(); i++) { - row = sheet.createRow(1 + i); - row.setHeight((short) 400); - // 报修单编号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(workorderDetailList.get(i).getJobNumber()); - //上报班组 值暂定 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(" "); - //上报人员 值暂定 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(" "); - //上报日期 值暂定 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(" "); - //设备编号 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentcardid()); - //安装地点 值暂定 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(" "); - //设备名称 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentname()); - //故障类别 值暂定 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(""); - //故障情况 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(workorderDetailList.get(i).getFaultDescription()); - //维修内容 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - List workorderRepairContents = workorderRepairContentService.selectListByWhere("where detail_id = '" + workorderDetailList.get(i).getId() + "'"); - if (workorderRepairContents.size() > 0) { - cell_9.setCellValue(workorderRepairContents.get(0).getRepairName()); - } else { - cell_9.setCellValue(""); - } - //使用材料 值暂定 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(""); - //完成情况 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if ("finish".equals(workorderDetailList.get(i).getStatus())) { - cell_11.setCellValue("已完成"); - } else { - cell_11.setCellValue(""); - } - } - } else { - fileName = "设备维修单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备维修单"; - if ("maintain".equals(type)) { - title = "设备保养单"; - fileName = "设备保养单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 5000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - String excelTitleStr = "单号,所属区域;上报人,上报时间;设备编号,设备名称;设备型号,安装地点;故障情况" + - ";签收人,签收时间;维修内容;使用材料,是否委外;维修部门,维修时间;确认人员,确认时间"; - String[] excelTitle = excelTitleStr.split(";"); - for (int i = 0; i < excelTitle.length; i++) { - // 新建一行 - HSSFRow row1 = sheet.createRow(1 + i); - row1.setHeight((short) 800); - if (excelTitle[i].contains(",")) { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell2 = row1.createCell(2); - HSSFCell cell3 = row1.createCell(3); - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i].substring(0, excelTitle[i].indexOf(","))); - cell1.setCellStyle(listStyle); - switch (i) { - case 0: - cell1.setCellValue(workorderDetailList.get(0).getJobNumber()); // 单号 - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getAreaid()); //所属区域 - break; - case 1: - cell1.setCellValue(""); // 上报人 - cell3.setCellValue(""); // 上报时间 - break; - case 2: - cell1.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentcardid()); // 设备编号 - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentname()); // 设备名称 - break; - case 3: - cell1.setCellValue(workorderDetailList.get(0).getEquipmentCard().getTechParameters()); // 设备型号 - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getAreaid()); // 安装地点 - break; - case 5: - cell1.setCellValue(""); // 签收人 - cell3.setCellValue(""); // 签收时间 - break; - case 7: - cell1.setCellValue(""); // 使用材料 - cell3.setCellValue(""); // 是否委外 - break; - case 8: - cell1.setCellValue(""); // 维修部门 - cell3.setCellValue(""); // 维修时间 - break; - case 9: - cell1.setCellValue(""); // 确认人员 - cell3.setCellValue(""); // 确认时间 - break; - default: - cell1.setCellValue(""); - cell3.setCellValue(""); - } - cell2.setCellStyle(listStyle); - cell2.setCellValue(excelTitle[i].substring(excelTitle[i].indexOf(",") + 1, excelTitle[i].length())); - cell3.setCellStyle(listStyle); - } else { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i]); - if (i == 4) { - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 3)); - sheet.addMergedRegion(new CellRangeAddress(i + 1, i + 1, 1, 3)); - } else { - sheet.addMergedRegion(new CellRangeAddress(i + 1, i + 1, 1, 3)); - } - switch (i) { - case 4: - cell1.setCellValue(workorderDetailList.get(0).getFaultDescription()); // 故障情况 - break; - case 6: - List workorderRepairContents = workorderRepairContentService.selectListByWhere("where detail_id = '" + workorderDetailList.get(0).getId() + "'"); - if (workorderRepairContents.size() > 0) { - String workderName = ""; - for (WorkorderRepairContent workorderRepairContent : workorderRepairContents) { - workderName += workorderRepairContent.getRepairName() + ","; - } - cell1.setCellValue(workderName.substring(0, workderName.length() - 1)); // 维修内容 - } else { - cell1.setCellValue(""); // 维修内容 - } - break; - } - } - } - // 将合并后单元格设置边框 - sheet.getRow(0).getCell(0).setCellStyle(listStyle); - sheet.getRow(5).getCell(1).setCellStyle(listStyle); - sheet.getRow(7).getCell(1).setCellStyle(listStyle); - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - }*/ - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryMaintainCarDetailServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryMaintainCarDetailServiceImpl.java deleted file mode 100644 index e6de6ede..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryMaintainCarDetailServiceImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryMaintainCarDetailDao; -import com.sipai.entity.maintenance.LibraryMaintainCarDetail; -import com.sipai.service.maintenance.LibraryMaintainCarDetailService; - -@Service -public class LibraryMaintainCarDetailServiceImpl implements LibraryMaintainCarDetailService { - @Resource - private LibraryMaintainCarDetailDao libraryMaintainCarDetailDao; - - @Override - public LibraryMaintainCarDetail selectById(String id) { - LibraryMaintainCarDetail libraryMaintainCarDetail = this.libraryMaintainCarDetailDao.selectByPrimaryKey(id); - return libraryMaintainCarDetail; - } - - @Override - public int deleteById(String id) { - int code = this.libraryMaintainCarDetailDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(LibraryMaintainCarDetail libraryMaintainCarDetail) { - int code = this.libraryMaintainCarDetailDao.insert(libraryMaintainCarDetail); - return code; - } - - @Override - public int update(LibraryMaintainCarDetail libraryMaintainCarDetail) { - int code = this.libraryMaintainCarDetailDao.updateByPrimaryKeySelective(libraryMaintainCarDetail); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryMaintainCarDetail libraryMaintainCarDetail = new LibraryMaintainCarDetail(); - libraryMaintainCarDetail.setWhere(wherestr); - List list = this.libraryMaintainCarDetailDao.selectListByWhere(libraryMaintainCarDetail); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryMaintainCarDetail libraryMaintainCarDetail = new LibraryMaintainCarDetail(); - libraryMaintainCarDetail.setWhere(wherestr); - int code = this.libraryMaintainCarDetailDao.deleteByWhere(libraryMaintainCarDetail); - return code; - } -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryMaintainCarServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryMaintainCarServiceImpl.java deleted file mode 100644 index ac1c1f9f..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryMaintainCarServiceImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryMaintainCarDao; -import com.sipai.entity.maintenance.LibraryMaintainCar; -import com.sipai.service.maintenance.LibraryMaintainCarService; - -@Service -public class LibraryMaintainCarServiceImpl implements LibraryMaintainCarService { - @Resource - private LibraryMaintainCarDao libraryMaintainCarDao; - - @Override - public LibraryMaintainCar selectById(String id) { - LibraryMaintainCar libraryMaintainCar = this.libraryMaintainCarDao.selectByPrimaryKey(id); - return libraryMaintainCar; - } - - @Override - public int deleteById(String id) { - int code = this.libraryMaintainCarDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(LibraryMaintainCar libraryMaintainCar) { - int code = this.libraryMaintainCarDao.insert(libraryMaintainCar); - return code; - } - - @Override - public int update(LibraryMaintainCar libraryMaintainCar) { - int code = this.libraryMaintainCarDao.updateByPrimaryKeySelective(libraryMaintainCar); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryMaintainCar libraryMaintainCar = new LibraryMaintainCar(); - libraryMaintainCar.setWhere(wherestr); - List list = this.libraryMaintainCarDao.selectListByWhere(libraryMaintainCar); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryMaintainCar libraryMaintainCar = new LibraryMaintainCar(); - libraryMaintainCar.setWhere(wherestr); - int code = this.libraryMaintainCarDao.deleteByWhere(libraryMaintainCar); - return code; - } -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryMaintenanceCommonContentServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryMaintenanceCommonContentServiceImpl.java deleted file mode 100644 index 2c017ffb..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryMaintenanceCommonContentServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryMaintenanceCommonContentDao; -import com.sipai.entity.maintenance.LibraryMaintenanceCommonContent; -import com.sipai.service.maintenance.LibraryMaintenanceCommonContentService; - -@Service -public class LibraryMaintenanceCommonContentServiceImpl implements LibraryMaintenanceCommonContentService{ - @Resource - private LibraryMaintenanceCommonContentDao libraryMaintenanceCommonContentDao; - - @Override - public LibraryMaintenanceCommonContent selectById(String id) { - return libraryMaintenanceCommonContentDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryMaintenanceCommonContentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryMaintenanceCommonContent entity) { - return libraryMaintenanceCommonContentDao.insert(entity); - } - - @Override - public int update(LibraryMaintenanceCommonContent entity) { - return libraryMaintenanceCommonContentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryMaintenanceCommonContent libraryMaintenanceCommonContent = new LibraryMaintenanceCommonContent(); - libraryMaintenanceCommonContent.setWhere(wherestr); - List list = libraryMaintenanceCommonContentDao.selectListByWhere(libraryMaintenanceCommonContent); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryMaintenanceCommonContent libraryMaintenanceCommonContent = new LibraryMaintenanceCommonContent(); - libraryMaintenanceCommonContent.setWhere(wherestr); - return libraryMaintenanceCommonContentDao.deleteByWhere(libraryMaintenanceCommonContent); - } - - @Override - public List selectList4Class( - String wherestr,String unitId,String type) { -// LibraryMaintenanceCommonContent libraryMaintenanceCommonContent = new LibraryMaintenanceCommonContent(); -// libraryMaintenanceCommonContent.setWhere(wherestr); - List list = libraryMaintenanceCommonContentDao.selectList4Class(wherestr,unitId,type); - return list; - } - - @Override - public List selectList3Class(String wherestr, String unitId, String type) { - List list = libraryMaintenanceCommonContentDao.selectList3Class(wherestr,unitId,type); - return list; - } - - @Override - public LibraryMaintenanceCommonContent selectByWhere(String wherestr) { - LibraryMaintenanceCommonContent libraryMaintenanceCommonContent = new LibraryMaintenanceCommonContent(); - libraryMaintenanceCommonContent.setWhere(wherestr); - return libraryMaintenanceCommonContentDao.selectByWhere(libraryMaintenanceCommonContent); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryMaintenanceCommonServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryMaintenanceCommonServiceImpl.java deleted file mode 100644 index 7856a490..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryMaintenanceCommonServiceImpl.java +++ /dev/null @@ -1,831 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.maintenance.*; -import com.sipai.service.maintenance.LibraryBaseService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryMaintenanceCommonDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryMaintenanceCommon; -import com.sipai.entity.maintenance.LibraryMaintenanceCommonContent; -import com.sipai.entity.user.Company; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryMaintenanceCommonContentService; -import com.sipai.service.maintenance.LibraryMaintenanceCommonService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryMaintenanceCommonServiceImpl implements LibraryMaintenanceCommonService{ - - @Resource - private LibraryMaintenanceCommonDao libraryMaintenanceCommonDao; - @Resource - private UserService userService; - @Resource - private LibraryMaintenanceCommonContentService libraryMaintenanceCommonContentService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private LibraryBaseService libraryBaseService; - - @Override - public LibraryMaintenanceCommon selectById(String id) { - return libraryMaintenanceCommonDao.selectByPrimaryKey(id); - } - @Override - public int deleteById(String id) { - return libraryMaintenanceCommonDao.deleteByPrimaryKey(id); - } - @Override - public int save(LibraryMaintenanceCommon entity) { - return libraryMaintenanceCommonDao.insert(entity); - } - @Override - public int update(LibraryMaintenanceCommon entity) { - return libraryMaintenanceCommonDao.updateByPrimaryKeySelective(entity); - } - @Override - public List selectListByWhere(String wherestr) { - LibraryMaintenanceCommon libraryMaintenanceCommon = new LibraryMaintenanceCommon(); - libraryMaintenanceCommon.setWhere(wherestr); - List list = libraryMaintenanceCommonDao.selectListByWhere(libraryMaintenanceCommon); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - LibraryMaintenanceCommon libraryMaintenanceCommon = new LibraryMaintenanceCommon(); - libraryMaintenanceCommon.setWhere(wherestr); - return libraryMaintenanceCommonDao.deleteByWhere(libraryMaintenanceCommon); - } - - /** - * 导出 - */ - @SuppressWarnings({ "deprecation", "rawtypes" }) - @Override - public void doExport(HttpServletResponse response, - List equipmentClasses,String unitId,String smallClassId,String type) throws IOException { - String fileName = "设备维保库"+CommUtil.nowDate().substring(0, 10)+".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if(equipmentClasses!=null && equipmentClasses.size()>0){ - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName()+"("+equipmentClasses.get(z).getEquipmentClassCode()+")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - List libraryBases = libraryBaseService.selectListByWhere("where library_type = 'main'"); - int count = 0; - String excelTitleStr = " "; - String contentStr = " where m.pid = '"+equipmentClasses.get(z).getId()+"' "; - contentStr += " and m.id in ("+smallClassId+") "; - List list = null; - if ("y".equals(libraryBases.get(0).getPlaceStatus())) { - count = 13; - excelTitleStr = "小类代码,设备小类,部位代码,部位名称,维保代码,维保名称,周期,工时定额(小时),维保费(元),内容代码,维护保养内容,维护保养方法及材料,安全保障措施"; - list = libraryMaintenanceCommonContentService.selectList4Class(contentStr + "order by m.morder,ec.morder,p.code,c.code",unitId,type); - } else { - count = 11; - excelTitleStr = "小类代码,设备小类,维保代码,维保名称,周期,工时定额(小时),维保费(元),内容代码,维护保养内容,维护保养方法及材料,安全保障措施"; - list = libraryMaintenanceCommonContentService.selectList3Class(contentStr + "order by m.morder,p.code,c.code",unitId,type); - } - for (int x = 0; x < count ; x++) { - sheet.setColumnWidth(x, 4000); - } - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("保养库"+"("+equipmentClasses.get(z).getName()+")"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - -// sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 3)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - -// sheet.addMergedRegion(new CellRangeAddress(1, 1, 4, 4)); - HSSFCell twocell3 = twoRow.createCell(4); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, 8)); - HSSFCell twocell4 = twoRow.createCell(5); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 9, excelTitle.length-1)); - HSSFCell twocell5 = twoRow.createCell(9); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - if(list!=null && list.size()>0){ - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if (jsonObject1.has(list.get(i).getM_id())) { // 如果设备小类的长度 不为空则长度加1 - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - //设备部位 - if (jsonObject2.has(list.get(i).getEc_id())) { - int num = (int) jsonObject2.get(list.get(i).getEc_id()); - jsonObject2.put(list.get(i).getEc_id(), num + 1); - } else { - if (list.get(i).getEc_id() != null) { - jsonObject2.put(list.get(i).getEc_id(), 1); - } else { - jsonObject2.put("空" + CommUtil.getUUID(), 1); - } - } - - //大修项目 - if (jsonObject3.has(list.get(i).getP_id())) { - int num = (int) jsonObject3.get(list.get(i).getP_id()); - jsonObject3.put(list.get(i).getP_id(), num + 1); - } else { - if (list.get(i).getP_id() != null) { - jsonObject3.put(list.get(i).getP_id(), 1); - } else { - jsonObject3.put("空" + CommUtil.getUUID(), 1); - } - } - - if (count == 13) { - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //部位代码 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getEc_code()); - //部位名称 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getEc_name()); - //项目代码 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getP_code()); - //故障名称 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getP_name()); - - String cycleName = ""; - if (list.get(i).getP_cycle() != null && !list.get(i).getP_cycle().equals("")) { - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Week)) { - cycleName = "一周"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_TenDays)) { - cycleName = "旬"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Month)) { - cycleName = "月度"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Quarter)) { - cycleName = "季度"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_HalfYear)) { - cycleName = "半年度"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Year)) { - cycleName = "年度"; - } - } - - //周期 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(cycleName); - //工时定额 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getP_time()); - //费用 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getP_cost()); - //内容代码 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getCode()); - //维保内容 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getContents()); - - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(list.get(i).getTools()); - - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(list.get(i).getSecurity()); - } else { - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //项目代码 - HSSFCell cell_4 = row.createCell(2); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getP_code()); - //故障名称 - HSSFCell cell_5 = row.createCell(3); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getP_name()); - - String cycleName = ""; - if (list.get(i).getP_cycle() != null && !list.get(i).getP_cycle().equals("")) { - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Week)) { - cycleName = "一周"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_TenDays)) { - cycleName = "旬"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Month)) { - cycleName = "月度"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Quarter)) { - cycleName = "季度"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_HalfYear)) { - cycleName = "半年度"; - } - if (list.get(i).getP_cycle().equals(MaintainCommStr.Maintain_Year)) { - cycleName = "年度"; - } - } - - //周期 - HSSFCell cell_6 = row.createCell(4); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(cycleName); - //工时定额 - HSSFCell cell_7 = row.createCell(5); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getP_time()); - //费用 - HSSFCell cell_8 = row.createCell(6); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getP_cost()); - //内容代码 - HSSFCell cell_9 = row.createCell(7); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getCode()); - //维保内容 - HSSFCell cell_10 = row.createCell(8); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getContents()); - - HSSFCell cell_11 = row.createCell(9); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(list.get(i).getTools()); - - HSSFCell cell_12 = row.createCell(10); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(list.get(i).getSecurity()); - } - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - if (num > 1) { - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - } - rownum += num; - } - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - for(Iterator iter = jsonObject2.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - if (num > 1) { - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 7, 7)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 8, 8)); - } - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - for(Iterator iter = jsonObject3.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - if (num > 1) { - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - } - rownum = rownum + num; - } - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - @Override - public String readXls(InputStream input, String json, String userId, String unitId, String mainType) throws IOException { - System.out.println("导入维保库开始============="+CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertProjectNum = 0, updateProjectNum = 0 ; - int insertContentNum = 0, updateContentNum = 0 ; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - String project_id = ""; - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() != 13) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - }else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_part_code = getMergedRegionValue(sheet, rowNum, 2);//设备部位代码 - String cell_part_id = "";//设备部位id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 4);//设备故障代码 - String cell_project_id = "";//故障id - String cell_content_id = "";//内容id - String cell_content_code = getMergedRegionValue(sheet, rowNum, 9);//内容code - - JSONArray jsonArray = JSONArray.fromObject(json); - if(jsonArray!=null && jsonArray.size()>0){ - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if(cell_big_class_code!=null && cell_big_class_code.equals(getJsonObj.get("code"))){ - if(getJsonObj.has("nodes")){ - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if(jsonArray2!=null && jsonArray2.size()>0){ - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if(getJsonObj2!=null){ - if(cell_class_code!=null && cell_class_code.equals(getJsonObj2.get("code"))){ - if(getJsonObj2.has("nodes")){ - JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); - if(jsonArray3!=null && jsonArray3.size()>0){ - for (int k = 0; k < jsonArray3.size(); k++) { - JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 - if(getJsonObj3!=null){ - if(cell_part_code!=null && cell_part_code.equals(getJsonObj3.get("code"))){ - cell_part_id = getJsonObj3.get("id")+""; - } - } - } - } - } - } - } - } - } - } - } - } - } - - LibraryMaintenanceCommon libraryMaintenanceCommon = new LibraryMaintenanceCommon(); - LibraryMaintenanceCommonContent libraryMaintenanceCommonContent = new LibraryMaintenanceCommonContent(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i) ) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - break; - case 3: - break; - case 4: - libraryMaintenanceCommon.setCode(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - libraryMaintenanceCommon.setName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - String cycle = ""; -// System.out.println(getMergedRegionValue(sheet, rowNum, i)); - if(getMergedRegionValue(sheet, rowNum, i)!=null){ - if(getMergedRegionValue(sheet, rowNum, i).equals("一周")){ - cycle = MaintainCommStr.Maintain_Week; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("旬")){ - cycle = MaintainCommStr.Maintain_TenDays; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("月度")){ - cycle = MaintainCommStr.Maintain_Month; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("季度")){ - cycle = MaintainCommStr.Maintain_Quarter; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("半年度")){ - cycle = MaintainCommStr.Maintain_HalfYear; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("年度")){ - cycle = MaintainCommStr.Maintain_Year; - } - } - libraryMaintenanceCommon.setCycle(cycle); - break; - case 7: - if(getMergedRegionValue(sheet, rowNum, i)!=null && !getMergedRegionValue(sheet, rowNum, i).equals("")){ - libraryMaintenanceCommon.setInsideRepairTime(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 8: - if(getMergedRegionValue(sheet, rowNum, i)!=null && !getMergedRegionValue(sheet, rowNum, i).equals("")){ - libraryMaintenanceCommon.setCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 9: - libraryMaintenanceCommonContent.setCode(getMergedRegionValue(sheet, rowNum, i)); - break; - case 10: - libraryMaintenanceCommonContent.setContents(getMergedRegionValue(sheet, rowNum, i)); - break; - case 11: - libraryMaintenanceCommonContent.setTools(getMergedRegionValue(sheet, rowNum, i)); - break; - case 12: - libraryMaintenanceCommonContent.setSecurity(getMergedRegionValue(sheet, rowNum, i)); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //部位库中必须要有 否则为无效数据 - if(cell_part_id!=null && !cell_part_id.equals("")){// - libraryMaintenanceCommon.setPid(cell_part_id); - libraryMaintenanceCommon.setMorder(rowNum); - libraryMaintenanceCommon.setUnitId(unitId); - libraryMaintenanceCommon.setType(mainType); - libraryMaintenanceCommon.setCode(cell_project_code); - /* - * 处理项目数据 - */ - libraryMaintenanceCommon.setWhere("where pid = '"+cell_part_id+"' and code = '"+cell_project_code+"' and unit_id = '"+unitId+"' and type = '"+mainType+"'"); - LibraryMaintenanceCommon libraryMaintenanceCommon2 = libraryMaintenanceCommonDao.selectByWhere(libraryMaintenanceCommon); - if(libraryMaintenanceCommon2!=null){ - cell_project_id = libraryMaintenanceCommon2.getId();//如存在则赋值原有的项目id - libraryMaintenanceCommon.setId(cell_project_id); - libraryMaintenanceCommonDao.updateByPrimaryKeySelective(libraryMaintenanceCommon); - updateProjectNum += 1; - }else { - cell_project_id = CommUtil.getUUID();//否则创建新的项目id - libraryMaintenanceCommon.setId(cell_project_id); - if(cell_project_code!=null && !cell_project_code.equals("")){ - libraryMaintenanceCommonDao.insert(libraryMaintenanceCommon); - insertProjectNum +=1; - } - } - - /* - * 处理内容数据 - */ - - if(cell_project_code!=null && !cell_project_code.equals("")){ - libraryMaintenanceCommonContent.setCommonId(cell_project_id); - String sqlstr = "where common_id = '"+cell_project_id+"' and code = '"+libraryMaintenanceCommonContent.getCode()+"'"; - LibraryMaintenanceCommonContent repairBloc = libraryMaintenanceCommonContentService.selectByWhere(sqlstr); - if(repairBloc!=null){ - cell_content_id = repairBloc.getId(); - libraryMaintenanceCommonContent.setId(cell_content_id); - libraryMaintenanceCommonContentService.update(libraryMaintenanceCommonContent); - updateContentNum += 1; - }else { - cell_content_id = CommUtil.getUUID(); - libraryMaintenanceCommonContent.setId(cell_content_id); - if(libraryMaintenanceCommonContent.getCode()!=null && !libraryMaintenanceCommonContent.getCode().equals("")){ - libraryMaintenanceCommonContentService.save(libraryMaintenanceCommonContent); - insertContentNum += 1; - } - } - } - - - } - } - } - String result = ""; - result = "" - //+ "新增项目:"+insertProjectNum+"条,修改项目:"+updateProjectNum+"条," - + "新增内容:"+insertContentNum+"条,修改内容:"+updateContentNum+"条!"; - System.out.println("导入维保库结束============="+CommUtil.nowDate()); - return result; - } - @Override - public String readXlsx(InputStream input, String json, String userId, - String unitId, String mainType) throws IOException { - // TODO Auto-generated method stub - return null; - } - - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column){ - int sheetMergeCount = sheet.getNumMergedRegions(); - - for(int i = 0 ; i < sheetMergeCount ; i++){ - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if(row >= firstRow && row <= lastRow){ - if(column >= firstColumn && column <= lastColumn){ - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell) ; - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell) ; - } - @Override - public LibraryMaintenanceCommon selectById4part(String id) { - LibraryMaintenanceCommon entity = libraryMaintenanceCommonDao.selectByPrimaryKey(id); - if(entity!=null){ - EquipmentClass equipmentClass = equipmentClassService.selectById(entity.getPid()); - entity.setEquipmentClass(equipmentClass); - } - return entity; - } - @Override - public List selectListByWhere4part(String wherestr) { - LibraryMaintenanceCommon entity = new LibraryMaintenanceCommon(); - entity.setWhere(wherestr); - List list = libraryMaintenanceCommonDao.selectListByWhere(entity); - for (LibraryMaintenanceCommon libraryMaintenanceCommon : list) { - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryMaintenanceCommon.getPid()); - libraryMaintenanceCommon.setEquipmentClass(equipmentClass); - } - return list; - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryMaintenanceLubricationServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryMaintenanceLubricationServiceImpl.java deleted file mode 100644 index eff0c3c3..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryMaintenanceLubricationServiceImpl.java +++ /dev/null @@ -1,724 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.sipai.dao.maintenance.LibraryMaintenanceLubricationDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.LibraryMaintenanceLubrication; -import com.sipai.entity.maintenance.MaintainCommStr; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.LibraryMaintenanceLubricationService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryMaintenanceLubricationServiceImpl implements LibraryMaintenanceLubricationService{ - @Resource - private LibraryMaintenanceLubricationDao libraryMaintenanceLubricationDao; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; -// @Resource -// private LibraryMaintenanceLubricationService libraryMaintenanceLubricationService; - @Resource - private EquipmentClassService equipmentClassService; - - - @Override - public LibraryMaintenanceLubrication selectById(String id) { - return libraryMaintenanceLubricationDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryMaintenanceLubricationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryMaintenanceLubrication entity) { - return libraryMaintenanceLubricationDao.insert(entity); - } - - @Override - public int update(LibraryMaintenanceLubrication entity) { - return libraryMaintenanceLubricationDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryMaintenanceLubrication libraryMaintenanceLubrication = new LibraryMaintenanceLubrication(); - libraryMaintenanceLubrication.setWhere(wherestr); - List list = libraryMaintenanceLubricationDao.selectListByWhere(libraryMaintenanceLubrication); - for (LibraryMaintenanceLubrication entity : list) { - User user = userService.getUserById(entity.getLubricationuid()); - if(user!=null){ - entity.setUser(user); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryMaintenanceLubrication libraryMaintenanceLubrication = new LibraryMaintenanceLubrication(); - libraryMaintenanceLubrication.setWhere(wherestr); - return libraryMaintenanceLubricationDao.deleteByWhere(libraryMaintenanceLubrication); - } - - /** - * xls表格导入 - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXls(InputStream input,String json,String userId, String unitId) throws IOException { - System.out.println("导入润滑库开始============="+CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0 ; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() != 12) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - }else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_part_code = getMergedRegionValue(sheet, rowNum, 2);//设备部位代码 - String cell_part_id = "";//设备部位id - - JSONArray jsonArray = JSONArray.fromObject(json); - if(jsonArray!=null && jsonArray.size()>0){ - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if(cell_big_class_code!=null && cell_big_class_code.equals(getJsonObj.get("code"))){ - if(getJsonObj.has("nodes")){ - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if(jsonArray2!=null && jsonArray2.size()>0){ - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if(getJsonObj2!=null){ - if(cell_class_code!=null && cell_class_code.equals(getJsonObj2.get("code"))){ - if(getJsonObj2.has("nodes")){ - JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); - if(jsonArray3!=null && jsonArray3.size()>0){ - for (int k = 0; k < jsonArray3.size(); k++) { - JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 - if(getJsonObj3!=null){ - if(cell_part_code!=null && cell_part_code.equals(getJsonObj3.get("code"))){ - cell_part_id = getJsonObj3.get("id")+""; - } - } - } - } - } - } - } - } - } - } - } - } - } - - LibraryMaintenanceLubrication libraryMaintenanceLubrication = new LibraryMaintenanceLubrication(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i) ) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - break; - case 3: - break; - case 4://周期 - String cycle = ""; - if(getMergedRegionValue(sheet, rowNum, i)!=null){ - if(getMergedRegionValue(sheet, rowNum, i).equals("一周")){ - cycle = MaintainCommStr.Maintain_Week; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("旬")){ - cycle = MaintainCommStr.Maintain_TenDays; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("月度")){ - cycle = MaintainCommStr.Maintain_Month; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("季度")){ - cycle = MaintainCommStr.Maintain_Quarter; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("半年度")){ - cycle = MaintainCommStr.Maintain_HalfYear; - } - if(getMergedRegionValue(sheet, rowNum, i).equals("年度")){ - cycle = MaintainCommStr.Maintain_Year; - } - } - libraryMaintenanceLubrication.setCycle(cycle); - break; - case 5://内容代码 - libraryMaintenanceLubrication.setCode(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6://润滑内容 - libraryMaintenanceLubrication.setContents(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7://油量标准 - if(getMergedRegionValue(sheet, rowNum, i)!=null){ - libraryMaintenanceLubrication.setStandard(Float.valueOf(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 8://单位 - libraryMaintenanceLubrication.setUnit(getMergedRegionValue(sheet, rowNum, i)); - break; - case 9://油品型号 - libraryMaintenanceLubrication.setModel(getMergedRegionValue(sheet, rowNum, i)); - break; - case 10://润滑工时 - if(getMergedRegionValue(sheet, rowNum, i)!=null){ - libraryMaintenanceLubrication.setInsideRepairTime(Float.valueOf(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 11://润滑人员 - String caption=getMergedRegionValue(sheet, rowNum, i); - List userlist = this.userService.selectListByWhere(" where caption='"+caption+"' "); - if(userlist!=null&&userlist.size()>0){ - libraryMaintenanceLubrication.setLubricationuid(userlist.get(0).getId()); - } - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /*Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null && company.getLibraryBizid()!=null && !company.getLibraryBizid().equals("")){ - libraryMaintenanceLubrication.setUnitId(company.getLibraryBizid()); - }else { - libraryMaintenanceLubrication.setUnitId(unitId); - }*/ - libraryMaintenanceLubrication.setUnitId(unitId); - - //部位库中必须要有 否则为无效数据 - if(cell_part_id!=null && !cell_part_id.equals("") && libraryMaintenanceLubrication.getContents()!=null){// - libraryMaintenanceLubrication.setPid(cell_part_id); - libraryMaintenanceLubrication.setMorder(rowNum); - - String sqlstrmodel = "where pid = '"+cell_part_id+"' and code = '"+libraryMaintenanceLubrication.getCode()+"' and unit_id = '"+unitId+"'"; - libraryMaintenanceLubrication.setWhere(sqlstrmodel); - - List lrModelBloclist = libraryMaintenanceLubricationDao.selectListByWhere(libraryMaintenanceLubrication); - if(lrModelBloclist!=null&&lrModelBloclist.size()>0){ - libraryMaintenanceLubrication.setId(lrModelBloclist.get(0).getId()); - libraryMaintenanceLubricationDao.updateByPrimaryKeySelective(libraryMaintenanceLubrication); - updateContentNum++; - }else { - libraryMaintenanceLubrication.setId(CommUtil.getUUID()); - libraryMaintenanceLubrication.setInsuser(userId); - libraryMaintenanceLubrication.setInsdt(CommUtil.nowDate()); - libraryMaintenanceLubricationDao.insert(libraryMaintenanceLubrication); - insertContentNum++; - } - - } - } - } - String result = ""; - result = "" - //+ "新增项目:"+insertProjectNum+"条,修改项目:"+updateProjectNum+"条," - + "新增内容:"+insertContentNum+"条,修改内容:"+updateContentNum+"条!"; - System.out.println("导入润滑库结束============="+CommUtil.nowDate()); - return result; - } - - @Override - public String readXlsx(InputStream input, String json, String userId, String unitId) - throws IOException { - // TODO Auto-generated method stub - return null; - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column){ - int sheetMergeCount = sheet.getNumMergedRegions(); - - for(int i = 0 ; i < sheetMergeCount ; i++){ - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if(row >= firstRow && row <= lastRow){ - if(column >= firstColumn && column <= lastColumn){ - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell) ; - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell) ; - } - - @SuppressWarnings({ "deprecation", "rawtypes" }) - @Override - public void doExport(HttpServletResponse response,List equipmentClasses,String unitId,String smallClassId) throws IOException { - String fileName = "设备润滑库"+CommUtil.nowDate().substring(0, 10)+".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if(equipmentClasses!=null && equipmentClasses.size()>0){ - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName()+"("+equipmentClasses.get(z).getEquipmentClassCode()+")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 3000); - sheet.setColumnWidth(6, 6000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 2000); - sheet.setColumnWidth(9, 3000); - sheet.setColumnWidth(10,4000); - sheet.setColumnWidth(11,3000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "小类代码,设备小类,部位代码,部位名称,周期,内容代码,润滑内容,油量标准,单位,油品型号,润滑工时(时),润滑人员"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("润滑库"+"("+equipmentClasses.get(z).getName()+")"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 4)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, 5)); - HSSFCell twocell3 = twoRow.createCell(5); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 9)); - HSSFCell twocell4 = twoRow.createCell(6); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 10, 11)); - HSSFCell twocell5 = twoRow.createCell(10); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - String wherestr = " and (l.unit_id = '"+unitId+"' or l.unit_id is null) " - + "where s.pid = '"+equipmentClasses.get(z).getId()+"' "; - wherestr += "and s.id in ("+smallClassId+") " - + "order by s.equipment_class_code,p.equipment_class_code,l.code asc"; -// System.out.println(wherestr); - LibraryMaintenanceLubrication libraryMaintenanceLubrication = new LibraryMaintenanceLubrication(); - libraryMaintenanceLubrication.setWhere(wherestr); - List list = libraryMaintenanceLubricationDao.selectList4Class(libraryMaintenanceLubrication); - if(list!=null && list.size()>0){ - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); -// JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3+i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if(jsonObject1.has(list.get(i).getS_id())){ - int num = (int) jsonObject1.get(list.get(i).getS_id()); - jsonObject1.put(list.get(i).getS_id(),num+1); - }else { - jsonObject1.put(list.get(i).getS_id(),1); - } - - - //设备部位 - if(jsonObject2.has(list.get(i).getP_id())){ - int num = (int) jsonObject2.get(list.get(i).getP_id()); - jsonObject2.put(list.get(i).getP_id(),num+1); - }else { - if(list.get(i).getP_id()!=null){ - jsonObject2.put(list.get(i).getP_id(),1); - }else { - jsonObject2.put("空"+CommUtil.getUUID(),1); - } - } - - //类别代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getS_code()); - //类别名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getS_name()); - //部位代码 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getP_code()); - //部位名称 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getP_name()); - - String cycleName = ""; - if(list.get(i).getCycle()!=null && !list.get(i).getCycle().equals("")){ - if(list.get(i).getCycle().equals(MaintainCommStr.Maintain_Week)){ - cycleName = "一周"; - } - if(list.get(i).getCycle().equals(MaintainCommStr.Maintain_TenDays)){ - cycleName = "旬"; - } - if(list.get(i).getCycle().equals(MaintainCommStr.Maintain_Month)){ - cycleName = "月度"; - } - if(list.get(i).getCycle().equals(MaintainCommStr.Maintain_Quarter)){ - cycleName = "季度"; - } - if(list.get(i).getCycle().equals(MaintainCommStr.Maintain_HalfYear)){ - cycleName = "半年度"; - } - if(list.get(i).getCycle().equals(MaintainCommStr.Maintain_Year)){ - cycleName = "年度"; - } - } - - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(cycleName); - - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getCode()); - - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getContents()); - - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getStandard()); - - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getUnit()); - - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getModel()); - - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getInsideRepairTime()); - - String userName = ""; - if(list.get(i).getLubricationuid()!=null && !list.get(i).getLubricationuid().equals("")){ - User user = userService.getUserById(list.get(i).getLubricationuid()); - if(user!=null){ - userName = user.getCaption(); - } - }else { - userName = ""; - } - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(userName); - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - for(Iterator iter = jsonObject2.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - //部位代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - //部位名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - rownum = rownum + num; - } - - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - @Override - public LibraryMaintenanceLubrication selectById4part(String id) { - LibraryMaintenanceLubrication entity = libraryMaintenanceLubricationDao.selectByPrimaryKey(id); - if(entity!=null){ - EquipmentClass equipmentClass = equipmentClassService.selectById(entity.getPid()); - entity.setEquipmentClass(equipmentClass); - } - return entity; - } - - @Override - public List selectListByWhere4part(String wherestr) { - LibraryMaintenanceLubrication entity = new LibraryMaintenanceLubrication(); - entity.setWhere(wherestr); - List list = libraryMaintenanceLubricationDao.selectListByWhere(entity); - for (LibraryMaintenanceLubrication libraryMaintenanceLubrication : list) { - EquipmentClass equipmentClass = equipmentClassService.selectById(libraryMaintenanceLubrication.getPid()); - libraryMaintenanceLubrication.setEquipmentClass(equipmentClass); - } - return list; - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryMaterialQuotaServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryMaterialQuotaServiceImpl.java deleted file mode 100644 index ff580dce..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryMaterialQuotaServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryMaterialQuotaDao; -import com.sipai.entity.maintenance.LibraryMaterialQuota; -import com.sipai.service.maintenance.LibraryMaterialQuotaService; -import com.sipai.service.sparepart.GoodsService; - -@Service -public class LibraryMaterialQuotaServiceImpl implements LibraryMaterialQuotaService{ - @Resource - private LibraryMaterialQuotaDao libraryRepairMaterialBizDao; - @Resource - private GoodsService goodsService; - - @Override - public LibraryMaterialQuota selectById(String id) { - return libraryRepairMaterialBizDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryRepairMaterialBizDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryMaterialQuota entity) { - return libraryRepairMaterialBizDao.insert(entity); - } - - @Override - public int update(LibraryMaterialQuota entity) { - return libraryRepairMaterialBizDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryMaterialQuota entity = new LibraryMaterialQuota(); - entity.setWhere(wherestr); - List list = libraryRepairMaterialBizDao.selectListByWhere(entity); - for (LibraryMaterialQuota item : list) { - item.setGoods(this.goodsService.selectById(item.getMaterialId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryMaterialQuota entity = new LibraryMaterialQuota(); - entity.setWhere(wherestr); - return libraryRepairMaterialBizDao.deleteByWhere(entity); - } - - - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentBlocServiceImpl.java deleted file mode 100644 index 3ca7bb6c..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentBlocServiceImpl.java +++ /dev/null @@ -1,363 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.LibraryOverhaulContentBlocDao; -import com.sipai.entity.maintenance.LibraryOverhaulContentBloc; -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectBloc; -import com.sipai.entity.maintenance.LibraryOverhaulProjectEquBiz; -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; -import com.sipai.service.maintenance.LibraryOverhaulContentBlocService; -import com.sipai.service.maintenance.LibraryOverhaulContentEquBizService; -import com.sipai.service.maintenance.LibraryOverhaulContentModelBlocService; -import com.sipai.service.maintenance.LibraryOverhaulProjectBlocService; -import com.sipai.service.maintenance.LibraryOverhaulProjectEquBizService; -import com.sipai.service.maintenance.LibraryOverhaulProjectModelBlocService; -import com.sipai.tools.CommUtil; - -@Service -public class LibraryOverhaulContentBlocServiceImpl implements LibraryOverhaulContentBlocService { - - @Resource - private LibraryOverhaulContentBlocDao libraryOverhaulContentBlocDao; - @Resource - private LibraryOverhaulContentModelBlocService libraryOverhaulContentModelBlocService; - @Resource - private LibraryOverhaulContentEquBizService libraryOverhaulContentEquBizService; - @Resource - private LibraryOverhaulProjectModelBlocService libraryOverhaulProjectModelBlocService; - @Resource - private LibraryOverhaulProjectBlocService libraryOverhaulProjectBlocService; - @Resource - private LibraryOverhaulProjectEquBizService libraryOverhaulProjectEquBizService; - @Resource - private CompanyService companyService; - - @Override - public LibraryOverhaulContentBloc selectById(String id) { - return libraryOverhaulContentBlocDao.selectByPrimaryKey(id); - } - - @Transactional - public int deleteById(String id) { - return libraryOverhaulContentBlocDao.deleteByPrimaryKey(id); - } - - @Transactional - public int save(LibraryOverhaulContentBloc entity) { - /*if(jsonStr!=null && !jsonStr.equals("")){ - JSONArray jsonArray = JSONArray.fromObject(jsonStr);//直接解析成数组 - for(int i = 0; i < jsonArray.size(); i++){ - LibraryOverhaulContentBlocQuota libraryOverhaulContentBlocQuota = new LibraryOverhaulContentBlocQuota(); - libraryOverhaulContentBlocQuota.setId(CommUtil.getUUID()); - libraryOverhaulContentBlocQuota.setLevelId(jsonArray.getJSONObject(i).get("levelId")+""); - libraryOverhaulContentBlocQuota.setPid(entity.getId()); - if(jsonArray.getJSONObject(i).get("insideRepairTime")!=null && !jsonArray.getJSONObject(i).get("insideRepairTime").equals("")){ - libraryOverhaulContentBlocQuota.setInsideRepairTime(Float.parseFloat(jsonArray.getJSONObject(i).get("insideRepairTime").toString())); - }else { - libraryOverhaulContentBlocQuota.setInsideRepairTime(0); - } - if(jsonArray.getJSONObject(i).get("materialCost")!=null && !jsonArray.getJSONObject(i).get("materialCost").equals("")){ - libraryOverhaulContentBlocQuota.setMaterialCost(Float.parseFloat(jsonArray.getJSONObject(i).get("materialCost").toString())); - }else { - libraryOverhaulContentBlocQuota.setMaterialCost(0); - } - if(jsonArray.getJSONObject(i).get("outsideRepairCost")!=null && !jsonArray.getJSONObject(i).get("outsideRepairCost").equals("")){ - libraryOverhaulContentBlocQuota.setOutsideRepairCost(Float.parseFloat(jsonArray.getJSONObject(i).get("outsideRepairCost").toString())); - }else { - libraryOverhaulContentBlocQuota.setOutsideRepairCost(0); - } - if(jsonArray.getJSONObject(i).get("totalCost")!=null && !jsonArray.getJSONObject(i).get("totalCost").equals("")){ - libraryOverhaulContentBlocQuota.setTotalCost(Float.parseFloat(jsonArray.getJSONObject(i).get("totalCost").toString())); - }else { - libraryOverhaulContentBlocQuota.setTotalCost(0); - } - libraryOverhaulContentBlocQuotaService.save(libraryOverhaulContentBlocQuota); - } - }*/ - return libraryOverhaulContentBlocDao.insert(entity); - } - - @Transactional - public int update(LibraryOverhaulContentBloc entity) { - - /*if(jsonStr!=null && !jsonStr.equals("")){ - JSONArray jsonArray = JSONArray.fromObject(jsonStr);//直接解析成数组 - for(int i = 0; i < jsonArray.size(); i++){ - //List list = libraryOverhaulContentBlocQuotaService.selectListByWhere("where d.pid= '"+entity.getId()+"'"); - - LibraryOverhaulContentBlocQuota libraryOverhaulContentBlocQuota = new LibraryOverhaulContentBlocQuota(); - libraryOverhaulContentBlocQuota.setId(jsonArray.getJSONObject(i).get("quotaId").toString()); - libraryOverhaulContentBlocQuota.setLevelId(jsonArray.getJSONObject(i).get("levelId")+""); - libraryOverhaulContentBlocQuota.setPid(entity.getId()); - if(jsonArray.getJSONObject(i).get("insideRepairTime")!=null && !jsonArray.getJSONObject(i).get("insideRepairTime").equals("")){ - libraryOverhaulContentBlocQuota.setInsideRepairTime(Float.parseFloat(jsonArray.getJSONObject(i).get("insideRepairTime").toString())); - }else { - libraryOverhaulContentBlocQuota.setInsideRepairTime(0); - } - if(jsonArray.getJSONObject(i).get("materialCost")!=null && !jsonArray.getJSONObject(i).get("materialCost").equals("")){ - libraryOverhaulContentBlocQuota.setMaterialCost(Float.parseFloat(jsonArray.getJSONObject(i).get("materialCost").toString())); - }else { - libraryOverhaulContentBlocQuota.setMaterialCost(0); - } - if(jsonArray.getJSONObject(i).get("outsideRepairCost")!=null && !jsonArray.getJSONObject(i).get("outsideRepairCost").equals("")){ - libraryOverhaulContentBlocQuota.setOutsideRepairCost(Float.parseFloat(jsonArray.getJSONObject(i).get("outsideRepairCost").toString())); - }else { - libraryOverhaulContentBlocQuota.setOutsideRepairCost(0); - } - if(jsonArray.getJSONObject(i).get("totalCost")!=null && !jsonArray.getJSONObject(i).get("totalCost").equals("")){ - libraryOverhaulContentBlocQuota.setTotalCost(Float.parseFloat(jsonArray.getJSONObject(i).get("totalCost").toString())); - }else { - libraryOverhaulContentBlocQuota.setTotalCost(0); - } - - LibraryOverhaulContentBlocQuota entity2 = libraryOverhaulContentBlocQuotaService.selectById(jsonArray.getJSONObject(i).get("quotaId").toString()); - if(entity2!=null){ - libraryOverhaulContentBlocQuota.setId(jsonArray.getJSONObject(i).get("quotaId").toString()); - libraryOverhaulContentBlocQuotaService.update(libraryOverhaulContentBlocQuota); - }else { - libraryOverhaulContentBlocQuota.setId(CommUtil.getUUID()); - libraryOverhaulContentBlocQuotaService.save(libraryOverhaulContentBlocQuota); - } - - //libraryOverhaulContentBlocQuotaService.save(libraryOverhaulContentBlocQuota); - } - }*/ - - return libraryOverhaulContentBlocDao.updateByPrimaryKeySelective(entity); - } - - @Transactional - public int update4Model(LibraryOverhaulContentBloc entity, String modelId, String unitId) { - List list = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id='" + entity.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc = new LibraryOverhaulContentModelBloc(); - - int res = 0; - if (list != null && list.size() > 0) {//修改 - libraryOverhaulContentModelBloc.setId(list.get(0).getId()); - libraryOverhaulContentModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - /*libraryOverhaulContentModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulContentModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulContentModelBloc.setTotalCost(entity.getTotalCost());*/ - libraryOverhaulContentModelBloc.setContentId(entity.getId()); - libraryOverhaulContentModelBloc.setModelId(modelId); - libraryOverhaulContentModelBloc.setUnitId(unitId); - res = libraryOverhaulContentModelBlocService.update(libraryOverhaulContentModelBloc); - } else {//新增 - libraryOverhaulContentModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulContentModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - /*libraryOverhaulContentModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulContentModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulContentModelBloc.setTotalCost(entity.getTotalCost());*/ - libraryOverhaulContentModelBloc.setContentId(entity.getId()); - libraryOverhaulContentModelBloc.setModelId(modelId); - libraryOverhaulContentModelBloc.setUnitId(unitId); - res = libraryOverhaulContentModelBlocService.save(libraryOverhaulContentModelBloc); - } - if (res == 1) { - List listc = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id='" + entity.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listc != null && listc.size() > 0) { - LibraryOverhaulContentBloc libraryOverhaulContentBloc = libraryOverhaulContentBlocDao.selectByPrimaryKey(entity.getId()); - if (libraryOverhaulContentBloc != null) { - int insideRepairTime = 0; - LibraryOverhaulContentBloc libraryOverhaulContentBloc2 = new LibraryOverhaulContentBloc(); - libraryOverhaulContentBloc2.setWhere("where pid = '" + libraryOverhaulContentBloc.getPid() + "'"); - List list2 = libraryOverhaulContentBlocDao.selectListByWhere(libraryOverhaulContentBloc2); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - List list3 = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id = '" + list2.get(i).getId() + "' and model_id = '" + modelId + "' and unit_id = '" + unitId + "'"); - if (list3 != null && list3.size() > 0) { - insideRepairTime += list3.get(0).getInsideRepairTime(); - } - } - } - /*LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = libraryOverhaulProjectBlocService.selectById(libraryOverhaulContentBloc.getPid()); - if (libraryOverhaulProjectBloc != null) { - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc = libraryOverhaulProjectModelBlocService.selectByWhere("where project_id = '" + libraryOverhaulProjectBloc.getId() + "' and model_id = '" + modelId + "' and unit_id = '" + unitId + "'"); - if (libraryOverhaulProjectModelBloc != null) { - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc2 = new LibraryOverhaulProjectModelBloc(); - libraryOverhaulProjectModelBloc2.setId(libraryOverhaulProjectModelBloc.getId()); - libraryOverhaulProjectModelBloc2.setInsideRepairTime(insideRepairTime); - libraryOverhaulProjectModelBloc2.setOutsideRepairCost(libraryOverhaulProjectModelBloc.getOutsideRepairCost()); - libraryOverhaulProjectModelBloc2.setMaterialCost(libraryOverhaulProjectModelBloc.getMaterialCost()); - libraryOverhaulProjectModelBloc2.setTotalCost(libraryOverhaulProjectModelBloc.getTotalCost()); - res = libraryOverhaulProjectModelBlocService.update(libraryOverhaulProjectModelBloc2); - } else { - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc2 = new LibraryOverhaulProjectModelBloc(); - libraryOverhaulProjectModelBloc2.setId(CommUtil.getUUID()); - libraryOverhaulProjectModelBloc2.setProjectId(libraryOverhaulProjectBloc.getId()); - libraryOverhaulProjectModelBloc2.setUnitId(unitId); - libraryOverhaulProjectModelBloc2.setModelId(modelId); - libraryOverhaulProjectModelBloc2.setInsideRepairTime(insideRepairTime); - res = libraryOverhaulProjectModelBlocService.save(libraryOverhaulProjectModelBloc2); - } - }*/ - } - } - } - return libraryOverhaulContentBlocDao.updateByPrimaryKeySelective(entity); - } - - @Transactional - public int update4Equ(LibraryOverhaulContentBloc entity, String modelId, String unitId) { - int res = 0; - List list = libraryOverhaulContentEquBizService.selectListByWhere("where content_id='" + entity.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz = new LibraryOverhaulContentEquBiz(); - if (list != null && list.size() > 0) {//修改 - libraryOverhaulContentEquBiz.setId(list.get(0).getId()); - libraryOverhaulContentEquBiz.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulContentEquBiz.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulContentEquBiz.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulContentEquBiz.setTotalCost(entity.getTotalCost()); - libraryOverhaulContentEquBiz.setContentId(entity.getId()); - libraryOverhaulContentEquBiz.setEquipmentId(modelId); - libraryOverhaulContentEquBiz.setUnitId(unitId); - res = libraryOverhaulContentEquBizService.update(libraryOverhaulContentEquBiz); - } else {//新增 - libraryOverhaulContentEquBiz.setId(CommUtil.getUUID()); - libraryOverhaulContentEquBiz.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulContentEquBiz.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulContentEquBiz.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulContentEquBiz.setTotalCost(entity.getTotalCost()); - libraryOverhaulContentEquBiz.setContentId(entity.getId()); - libraryOverhaulContentEquBiz.setEquipmentId(modelId); - libraryOverhaulContentEquBiz.setUnitId(unitId); - res = libraryOverhaulContentEquBizService.save(libraryOverhaulContentEquBiz); - } - - if (res == 1) { - List listc = libraryOverhaulContentEquBizService.selectListByWhere("where content_id='" + entity.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listc != null && listc.size() > 0) { - LibraryOverhaulContentBloc libraryOverhaulContentBloc = libraryOverhaulContentBlocDao.selectByPrimaryKey(entity.getId()); - if (libraryOverhaulContentBloc != null) { - int insideRepairTime = 0; - LibraryOverhaulContentBloc libraryOverhaulContentBloc2 = new LibraryOverhaulContentBloc(); - libraryOverhaulContentBloc2.setWhere("where pid = '" + libraryOverhaulContentBloc.getPid() + "'"); - List list2 = libraryOverhaulContentBlocDao.selectListByWhere(libraryOverhaulContentBloc2); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - List list3 = libraryOverhaulContentEquBizService.selectListByWhere("where content_id = '" + list2.get(i).getId() + "' and equipment_id = '" + modelId + "' and unit_id = '" + unitId + "'"); - if (list3 != null && list3.size() > 0) { - insideRepairTime += list3.get(0).getInsideRepairTime(); - } - } - } - /*LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = libraryOverhaulProjectBlocService.selectById(libraryOverhaulContentBloc.getPid()); - if (libraryOverhaulProjectBloc != null) { - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = libraryOverhaulProjectEquBizService.selectByWhere("where project_id = '" + libraryOverhaulProjectBloc.getId() + "' and equipment_id = '" + modelId + "' and unit_id = '" + unitId + "'"); - if (libraryOverhaulProjectEquBiz != null) { - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz2 = new LibraryOverhaulProjectEquBiz(); - libraryOverhaulProjectEquBiz2.setId(libraryOverhaulProjectEquBiz.getId()); - libraryOverhaulProjectEquBiz2.setInsideRepairTime(insideRepairTime); - libraryOverhaulProjectEquBiz2.setOutsideRepairCost(libraryOverhaulProjectEquBiz.getOutsideRepairCost()); - libraryOverhaulProjectEquBiz2.setMaterialCost(libraryOverhaulProjectEquBiz.getMaterialCost()); - libraryOverhaulProjectEquBiz2.setTotalCost(libraryOverhaulProjectEquBiz.getTotalCost()); - res = libraryOverhaulProjectEquBizService.update(libraryOverhaulProjectEquBiz2); - } else { - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz2 = new LibraryOverhaulProjectEquBiz(); - libraryOverhaulProjectEquBiz2.setId(CommUtil.getUUID()); - libraryOverhaulProjectEquBiz2.setProjectId(libraryOverhaulProjectBloc.getId()); - libraryOverhaulProjectEquBiz2.setUnitId(unitId); - libraryOverhaulProjectEquBiz2.setEquipmentId(modelId); - libraryOverhaulProjectEquBiz2.setInsideRepairTime(insideRepairTime); - res = libraryOverhaulProjectEquBizService.save(libraryOverhaulProjectEquBiz2); - } - }*/ - } - } - } - - return 1; - } - - @Transactional - public int save4Model(LibraryOverhaulContentBloc entity, String modelId, String unitId) { - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc = new LibraryOverhaulContentModelBloc(); - libraryOverhaulContentModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulContentModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulContentModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulContentModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulContentModelBloc.setTotalCost(entity.getTotalCost()); - libraryOverhaulContentModelBloc.setContentId(entity.getId()); - libraryOverhaulContentModelBloc.setModelId(modelId); - libraryOverhaulContentModelBlocService.save(libraryOverhaulContentModelBloc); - return libraryOverhaulContentBlocDao.insert(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryOverhaulContentBloc entity = new LibraryOverhaulContentBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulContentBlocDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryOverhaulContentBloc entity = new LibraryOverhaulContentBloc(); - entity.setWhere(wherestr); - return libraryOverhaulContentBlocDao.deleteByWhere(entity); - } - - @Override - public List selectList4Class(String wherestr, String unitId) { - List list = libraryOverhaulContentBlocDao.selectList4Class(wherestr, unitId); - return list; - } - - - @Override - public List selectList4Model(String wherestr, String modelId, String unitId) { - LibraryOverhaulContentBloc entity = new LibraryOverhaulContentBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulContentBlocDao.selectListByWhere(entity); - for (LibraryOverhaulContentBloc libraryOverhaulContentBloc : list) { - List listModel = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id='" + libraryOverhaulContentBloc.getId() + "' and model_id='" + modelId + "' and unit_id = '" + unitId + "'"); - if (listModel != null && listModel.size() > 0) { - libraryOverhaulContentBloc.setLibraryOverhaulContentModelBloc(listModel.get(0)); - } - } - return list; - } - - @Override - public List selectList4Equ(String wherestr, String modelId, String unitId) { - LibraryOverhaulContentBloc entity = new LibraryOverhaulContentBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulContentBlocDao.selectListByWhere(entity); - for (LibraryOverhaulContentBloc libraryOverhaulContentBloc : list) { - //标准库 - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null){ - List listModel = libraryOverhaulContentModelBlocService.selectListByWhere("where content_id='" + libraryOverhaulContentBloc.getId() + "' and model_id='" + modelId + "' and unit_id = '" + company.getLibraryBizid() + "'"); - if (listModel != null && listModel.size() > 0) { - libraryOverhaulContentBloc.setLibraryOverhaulContentModelBloc(listModel.get(0)); - } - } - //厂级 - List listEqu = libraryOverhaulContentEquBizService.selectListByWhere("where content_id='" + libraryOverhaulContentBloc.getId() + "' and equipment_id='" + modelId + "' and unit_id = '" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryOverhaulContentBloc.setLibraryOverhaulContentEquBiz(listEqu.get(0)); - } - } - return list; - } - - @Override - public LibraryOverhaulContentBloc selectByWhere(String wherestr) { - LibraryOverhaulContentBloc entity = new LibraryOverhaulContentBloc(); - entity.setWhere(wherestr); - return libraryOverhaulContentBlocDao.selectByWhere(entity); - } - - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentEquBizServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentEquBizServiceImpl.java deleted file mode 100644 index 4e2225ae..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentEquBizServiceImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryOverhaulContentEquBizDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.LibraryOverhaulContentEquBizService; - -@Service -public class LibraryOverhaulContentEquBizServiceImpl implements LibraryOverhaulContentEquBizService{ - @Resource - private LibraryOverhaulContentEquBizDao libraryOverhaulContentEquBizDao; - @Resource - private CompanyService companyService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public LibraryOverhaulContentEquBiz selectById(String id) { - return libraryOverhaulContentEquBizDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryOverhaulContentEquBizDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryOverhaulContentEquBiz entity) { - return libraryOverhaulContentEquBizDao.insert(entity); - } - - @Override - public int update(LibraryOverhaulContentEquBiz entity) { - return libraryOverhaulContentEquBizDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryOverhaulContentEquBiz entity = new LibraryOverhaulContentEquBiz(); - entity.setWhere(wherestr); - List list = libraryOverhaulContentEquBizDao.selectListByWhere(entity); - for (LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz : list) { - Company company = companyService.selectByPrimaryKey(libraryOverhaulContentEquBiz.getUnitId()); - libraryOverhaulContentEquBiz.setCompany(company); - EquipmentCard equipmentCard = equipmentCardService.selectById4Model(libraryOverhaulContentEquBiz.getEquipmentId()); - libraryOverhaulContentEquBiz.setEquipmentCard(equipmentCard); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz = new LibraryOverhaulContentEquBiz(); - libraryOverhaulContentEquBiz.setWhere(wherestr); - return libraryOverhaulContentEquBizDao.deleteByWhere(libraryOverhaulContentEquBiz); - } - - @Override - public LibraryOverhaulContentEquBiz selectByWhere(String wherestr) { - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz = new LibraryOverhaulContentEquBiz(); - libraryOverhaulContentEquBiz.setWhere(wherestr); - return libraryOverhaulContentEquBizDao.selectByWhere(libraryOverhaulContentEquBiz); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentModelBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentModelBlocServiceImpl.java deleted file mode 100644 index 065e181e..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryOverhaulContentModelBlocServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryOverhaulContentModelBlocDao; -import com.sipai.entity.maintenance.LibraryOverhaulContentModelBloc; -import com.sipai.service.maintenance.LibraryOverhaulContentModelBlocService; - -@Service -public class LibraryOverhaulContentModelBlocServiceImpl implements LibraryOverhaulContentModelBlocService{ - @Resource - private LibraryOverhaulContentModelBlocDao libraryOverhaulContentModelBlocDao; - - @Override - public LibraryOverhaulContentModelBloc selectById(String id) { - return libraryOverhaulContentModelBlocDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryOverhaulContentModelBlocDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryOverhaulContentModelBloc entity) { - return libraryOverhaulContentModelBlocDao.insert(entity); - } - - @Override - public int update(LibraryOverhaulContentModelBloc entity) { - return libraryOverhaulContentModelBlocDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryOverhaulContentModelBloc entity = new LibraryOverhaulContentModelBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulContentModelBlocDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryOverhaulContentModelBloc entity = new LibraryOverhaulContentModelBloc(); - entity.setWhere(wherestr); - return libraryOverhaulContentModelBlocDao.deleteByWhere(entity); - } - - @Override - public LibraryOverhaulContentModelBloc selectByWhere(String wherestr) { - LibraryOverhaulContentModelBloc entity = new LibraryOverhaulContentModelBloc(); - entity.setWhere(wherestr); - return libraryOverhaulContentModelBlocDao.selectByWhere(entity); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectBlocServiceImpl.java deleted file mode 100644 index 21991568..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectBlocServiceImpl.java +++ /dev/null @@ -1,1586 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import com.sipai.dao.maintenance.LibraryOverhaulProjectBlocDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.maintenance.*; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Properties; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryOverhaulProjectBlocServiceImpl implements LibraryOverhaulProjectBlocService { - - @Resource - private LibraryOverhaulProjectBlocDao libraryOverhaulProjectBlocDao; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private LibraryOverhaulContentBlocService libraryOverhaulContentBlocService; - @Resource - private CompanyService companyService; - @Resource - private LibraryOverhaulProjectEquBizService libraryOverhaulProjectEquBizService; - @Resource - private LibraryOverhaulContentEquBizService libraryOverhaulContentEquBizService; - @Resource - private LibraryOverhaulProjectModelBlocService libraryOverhaulProjectModelBlocService; - @Resource - private LibraryOverhaulContentModelBlocService libraryOverhaulContentModelBlocService; - - @Override - public LibraryOverhaulProjectBloc selectById(String id) { - return libraryOverhaulProjectBlocDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryOverhaulProjectBlocDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryOverhaulProjectBloc entity) { - return libraryOverhaulProjectBlocDao.insert(entity); - } - - @Override - public int update(LibraryOverhaulProjectBloc entity) { - return libraryOverhaulProjectBlocDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryOverhaulProjectBloc entity = new LibraryOverhaulProjectBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulProjectBlocDao.selectListByWhere(entity); - /*for (LibraryOverhaulProjectBloc libraryOverhaulProjectBloc : list) { - Company company = companyService.selectByPrimaryKey(libraryOverhaulProjectBloc.getUnitId()); - System.out.println(company.getName()); - }*/ - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = new LibraryOverhaulProjectBloc(); - libraryOverhaulProjectBloc.setWhere(wherestr); - return libraryOverhaulProjectBlocDao.deleteByWhere(libraryOverhaulProjectBloc); - } - - /** - * 大修库导出 - */ - @SuppressWarnings({"deprecation", "rawtypes"}) - @Override - public void doExportLibraryOverhaulBloc(HttpServletResponse response, List equipmentClasses, String unitId) throws IOException { - String fileName = "设备大修库" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if (equipmentClasses != null && equipmentClasses.size() > 0) { - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName() + "(" + equipmentClasses.get(z).getEquipmentClassCode() + ")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000);//大修项目代码 - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 5000);//大修条件 - sheet.setColumnWidth(6, 3500); - sheet.setColumnWidth(7, 3000); - sheet.setColumnWidth(8, 9000);//内容 - sheet.setColumnWidth(9, 3000); - sheet.setColumnWidth(10, 4000); - sheet.setColumnWidth(11, 4000); - sheet.setColumnWidth(12, 4000); - sheet.setColumnWidth(13, 4000); - sheet.setColumnWidth(14, 4000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "小类代码,设备小类,设备型号,项目代码,项目名称,大修条件,周期(年),内容代码,内容描述," - + "委外/自修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("大修库" + "(" + equipmentClasses.get(z).getName() + ")"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 4)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, 5)); - HSSFCell twocell3 = twoRow.createCell(5); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 9)); - HSSFCell twocell4 = twoRow.createCell(6); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 10, excelTitle.length - 1)); - HSSFCell twocell5 = twoRow.createCell(10); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - String unitstr = " "; - //如果配置了所属标准库则认为是水厂 否则认为是业务区 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - unitstr = company.getLibraryBizid(); - } else { - unitstr = unitId; - } - - String contentStr = " where m.pid = '" + equipmentClasses.get(z).getId() + "' and m.type='" + CommString.EquipmentClass_Equipment + "'"; - - List list = libraryOverhaulContentBlocService.selectList4Class(contentStr + " order by m.morder,p.morder,c.content_number", unitstr); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if (jsonObject1.has(list.get(i).getM_id())) { - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - //大修项目 - if (jsonObject3.has(list.get(i).getP_id())) { - int num = (int) jsonObject3.get(list.get(i).getP_id()); - jsonObject3.put(list.get(i).getP_id(), num + 1); - } else { - if (list.get(i).getP_id() != null) { - jsonObject3.put(list.get(i).getP_id(), 1); - } else { - jsonObject3.put("空" + CommUtil.getUUID(), 1); - } - } - - //小类代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //小类名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //项目代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getP_code()); - //项目名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getP_name()); - //大修条件 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).get_condition()); - //周期 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).get_cycle()); - //内容代码 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getContentNumber()); - //内容描述 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getRepairContent()); - //委外/自修 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_IN.equals(list.get(i).getRepairPartyType())) { - cell_9.setCellValue("自修"); - } - if (MaintainCommStr.Maintain_OUT.equals(list.get(i).getRepairPartyType())) { - cell_9.setCellValue("委外"); - } - - String sqlstrContent = "where content_id = '" + list.get(i).getId() + "' and unit_id = '" + unitId + "' and model_id = '-1'"; - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc = libraryOverhaulContentModelBlocService.selectByWhere(sqlstrContent); - if (libraryOverhaulContentModelBloc != null) { - //自修工时定额(小时) - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(libraryOverhaulContentModelBloc.getInsideRepairTime()); - } else { - //自修工时定额(小时) - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(""); - } - - String sqlstrProject = "where project_id = '" + list.get(i).getP_id() + "' and unit_id = '" + unitId + "' and model_id = '-1'"; - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc = libraryOverhaulProjectModelBlocService.selectByWhere(sqlstrProject); - if (libraryOverhaulProjectModelBloc != null) { - //委外工时费定额(元) - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(libraryOverhaulProjectModelBloc.getOutsideRepairCost()); - //物资费定额(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(libraryOverhaulProjectModelBloc.getMaterialCost()); - //总大修费定额(元) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(libraryOverhaulProjectModelBloc.getTotalCost()); - } else { - //委外工时费定额(元) - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(""); - //物资费定额(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(""); - //总大修费定额(元) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - } - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - //设备型号合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - //项目代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - //项目名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - //大修条件合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - //大修周期合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 11, 11)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 12, 12)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 13, 13)); - - rownum = rownum + num; - } - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Override - public void doExportLibraryOverhaulBiz(HttpServletResponse response, List equipmentClasses, String unitId, String smallClassId) throws IOException { - String fileName = "设备大修库" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if (equipmentClasses != null && equipmentClasses.size() > 0) { - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName() + "(" + equipmentClasses.get(z).getEquipmentClassCode() + ")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 3000);//大修项目代码 - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 5000);//大修条件 - sheet.setColumnWidth(6, 3500); - sheet.setColumnWidth(7, 3000); - sheet.setColumnWidth(8, 9000);//内容 - sheet.setColumnWidth(9, 3000); - sheet.setColumnWidth(10, 4000); - sheet.setColumnWidth(11, 4000); - sheet.setColumnWidth(12, 4000); - sheet.setColumnWidth(13, 4000); - sheet.setColumnWidth(14, 4000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "小类代码,设备小类,设备型号,项目代码,项目名称,大修条件,周期(年),内容代码,内容描述," - + "委外/自修,自修工时定额(小时),委外工时费定额(元),物资费定额(元),总大修费定额(元)"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("大修库" + "(" + equipmentClasses.get(z).getName() + ")"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 4)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, 5)); - HSSFCell twocell3 = twoRow.createCell(5); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 9)); - HSSFCell twocell4 = twoRow.createCell(6); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 10, excelTitle.length - 1)); - HSSFCell twocell5 = twoRow.createCell(10); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - String unitstr = " "; - //如果配置了所属标准库则认为是水厂 否则认为是业务区 - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - unitstr = company.getLibraryBizid(); - } else { - unitstr = unitId; - } - - String contentStr = " where m.pid = '" + equipmentClasses.get(z).getId() + "' and m.type='" + CommString.EquipmentClass_Equipment + "'"; - contentStr += " and m.id in (" + smallClassId + ") "; - - List list = libraryOverhaulContentBlocService.selectList4Class(contentStr + " order by m.morder,p.morder,c.content_number", unitstr); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - JSONObject jsonObject3 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(3 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if (jsonObject1.has(list.get(i).getM_id())) { - int num = (int) jsonObject1.get(list.get(i).getM_id()); - jsonObject1.put(list.get(i).getM_id(), num + 1); - } else { - jsonObject1.put(list.get(i).getM_id(), 1); - } - - //大修项目 - if (jsonObject3.has(list.get(i).getP_id())) { - int num = (int) jsonObject3.get(list.get(i).getP_id()); - jsonObject3.put(list.get(i).getP_id(), num + 1); - } else { - if (list.get(i).getP_id() != null) { - jsonObject3.put(list.get(i).getP_id(), 1); - } else { - jsonObject3.put("空" + CommUtil.getUUID(), 1); - } - } - - //小类代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getM_code()); - //小类名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getM_name()); - //设备型号 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue("通用"); - //项目代码 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getP_code()); - //项目名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getP_name()); - //大修条件 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).get_condition()); - //周期 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).get_cycle()); - //内容代码 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getContentNumber()); - //内容描述 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getRepairContent()); - //委外/自修 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - if (MaintainCommStr.Maintain_IN.equals(list.get(i).getRepairPartyType())) { - cell_9.setCellValue("自修"); - } - if (MaintainCommStr.Maintain_OUT.equals(list.get(i).getRepairPartyType())) { - cell_9.setCellValue("委外"); - } - - String sqlstrContent = "where content_id = '" + list.get(i).getId() + "' and unit_id = '" + unitId + "' and equipment_id = '-1'"; - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz = libraryOverhaulContentEquBizService.selectByWhere(sqlstrContent); - if (libraryOverhaulContentEquBiz != null) { - //自修工时定额(小时) - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(libraryOverhaulContentEquBiz.getInsideRepairTime()); - } else { - //自修工时定额(小时) - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(""); - } - - String sqlstrProject = "where project_id = '" + list.get(i).getP_id() + "' and unit_id = '" + unitId + "' and equipment_id = '-1'"; - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = libraryOverhaulProjectEquBizService.selectByWhere(sqlstrProject); - if (libraryOverhaulProjectEquBiz != null) { - //委外工时费定额(元) - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(libraryOverhaulProjectEquBiz.getOutsideRepairCost()); - //物资费定额(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(libraryOverhaulProjectEquBiz.getMaterialCost()); - //总大修费定额(元) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(libraryOverhaulProjectEquBiz.getTotalCost()); - } else { - //委外工时费定额(元) - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(""); - //物资费定额(元) - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(""); - //总大修费定额(元) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - } - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - //设备型号合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 3;//第3行开始 - - //设备部位代码及名称的合并单元格 - for (Iterator iter = jsonObject3.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject3.getString(key)); - //项目代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - //项目名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - //大修条件合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 5, 5)); - //大修周期合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 6, 6)); - - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 11, 11)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 12, 12)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 13, 13)); - - rownum = rownum + num; - } - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - /** - * 读取Excel表格的配置文件,中文表头 - * - * @param key - * @return - */ - private String getExcelStr(String key) { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("excelConfig.properties"); - Properties prop = new Properties(); - try { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));//解决读取properties文件中产生中文乱码的问题 - prop.load(bufferedReader); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String str = prop.getProperty(key).replace(" ", "");//去掉空格 - return str; - } - - /** - * xls表格导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXls(InputStream input, String json, String userId, String unitId) throws IOException { - System.out.println("导入大修库开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 13) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - //String cell_part_code = getMergedRegionValue(sheet, rowNum, 3);//设备部位代码 - String cell_class_id = "";//设备部位id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 3);//设备项目代码 - String cell_project_id = "";//大修项目id - String cell_content_id = "";//大修内容id - String cell_model_id = "";//型号id - - JSONArray jsonArray = JSONArray.fromObject(json); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if (cell_big_class_code != null && cell_big_class_code.equals(getJsonObj.get("code"))) { - if (getJsonObj.has("nodes")) { - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if (jsonArray2 != null && jsonArray2.size() > 0) { - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if (getJsonObj2 != null) { - if (cell_class_code != null && cell_class_code.equals(getJsonObj2.get("code"))) { - cell_class_id = getJsonObj2.get("id") + ""; - /*if(getJsonObj2.has("nodes")){ - JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); - if(jsonArray3!=null && jsonArray3.size()>0){ - for (int k = 0; k < jsonArray3.size(); k++) { - JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 - if(getJsonObj3!=null){ - if(cell_part_code!=null && cell_part_code.equals(getJsonObj3.get("code"))){ - cell_part_id = getJsonObj3.get("id")+""; - } - } - } - } - }*/ - } - } - } - } - } - } - } - } - - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = new LibraryOverhaulProjectBloc(); - LibraryOverhaulContentBloc libraryOverhaulContentBloc = new LibraryOverhaulContentBloc(); - //大修项目定额 - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc = new LibraryOverhaulProjectModelBloc(); - //大修内容定额 - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc = new LibraryOverhaulContentModelBloc(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i)) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3://项目代码 - libraryOverhaulProjectBloc.setProjectNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - libraryOverhaulProjectBloc.setProjectName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - libraryOverhaulProjectBloc.setCondition(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - libraryOverhaulProjectBloc.setCycle(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7://内容代码 - libraryOverhaulContentBloc.setContentNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 8: - libraryOverhaulContentBloc.setRepairContent(getMergedRegionValue(sheet, rowNum, i)); - break; - case 9://维修方式 委外自修 - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryOverhaulContentBloc.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryOverhaulContentBloc.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 10: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryOverhaulContentModelBloc.setInsideRepairTime(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 11: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryOverhaulProjectModelBloc.setOutsideRepairCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 12: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryOverhaulProjectModelBloc.setMaterialCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - } - break; - case 13: - cell.setCellType(STRING); - String value = getMergedRegionValue(sheet, rowNum, i); - if (value != null && !value.equals("")) { - libraryOverhaulProjectModelBloc.setTotalCost(Float.parseFloat(value)); - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - libraryOverhaulProjectBloc.setUnitId(company.getLibraryBizid()); - } else { - libraryOverhaulProjectBloc.setUnitId(unitId); - } - - //部位库中必须要有 否则为无效数据 - if (cell_class_code != null && !cell_class_code.equals("") && cell_project_code != null && !cell_project_code.equals("")) { - libraryOverhaulProjectBloc.setPid(cell_class_id); - libraryOverhaulProjectBloc.setMorder(rowNum); - /* - * 处理项目数据 - */ - libraryOverhaulProjectBloc.setWhere("where pid = '" + cell_class_id + "' and project_number = '" + cell_project_code + "' and unit_id = '" + unitId + "'"); - LibraryOverhaulProjectBloc projectBloc = libraryOverhaulProjectBlocDao.selectByWhere(libraryOverhaulProjectBloc); - if (projectBloc != null) { - cell_project_id = projectBloc.getId();//如存在则赋值原有的项目id - libraryOverhaulProjectBloc.setId(cell_project_id); -// libraryOverhaulProjectBlocDao.deleteByPrimaryKey(cell_project_id); -// libraryOverhaulProjectBlocDao.insert(libraryOverhaulProjectBloc); - libraryOverhaulProjectBlocDao.updateByPrimaryKeySelective(libraryOverhaulProjectBloc); - //updateProjectNum += 1; - } else { - cell_project_id = CommUtil.getUUID();//否则创建新的项目id - libraryOverhaulProjectBloc.setId(cell_project_id); - if (libraryOverhaulProjectBloc.getProjectNumber() != null && !libraryOverhaulProjectBloc.getProjectNumber().equals("")) { - libraryOverhaulProjectBlocDao.insert(libraryOverhaulProjectBloc); - //insertProjectNum +=1; - } - } - - /* - * 处理内容数据 - */ - libraryOverhaulContentBloc.setPid(cell_project_id); - String sqlstr = "where pid = '" + cell_project_id + "' and content_number = '" + libraryOverhaulContentBloc.getContentNumber() + "'"; - LibraryOverhaulContentBloc contentBloc = libraryOverhaulContentBlocService.selectByWhere(sqlstr); - if (contentBloc != null) { - cell_content_id = contentBloc.getId(); - libraryOverhaulContentBloc.setId(cell_content_id); - libraryOverhaulContentBlocService.update(libraryOverhaulContentBloc); - updateContentNum += 1; - } else { - cell_content_id = CommUtil.getUUID(); - libraryOverhaulContentBloc.setId(cell_content_id); - if (libraryOverhaulContentBloc.getContentNumber() != null && !libraryOverhaulContentBloc.getContentNumber().equals("")) { - libraryOverhaulContentBlocService.save(libraryOverhaulContentBloc); - insertContentNum += 1; - } - } - /* - * 处理项目定额 - */ - String pmbsql = "where project_id = '" + cell_project_id + "' and model_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryOverhaulProjectModelBloc projectModelBloc = libraryOverhaulProjectModelBlocService.selectByWhere(pmbsql); - if (projectModelBloc != null) { - libraryOverhaulProjectModelBloc.setId(projectModelBloc.getId()); - libraryOverhaulProjectModelBloc.setUnitId(unitId); - libraryOverhaulProjectModelBloc.setProjectId(cell_project_id); - libraryOverhaulProjectModelBloc.setModelId(cell_model_id); - libraryOverhaulProjectModelBlocService.update(libraryOverhaulProjectModelBloc); - } else { - libraryOverhaulProjectModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulProjectModelBloc.setUnitId(unitId); - libraryOverhaulProjectModelBloc.setProjectId(cell_project_id); - libraryOverhaulProjectModelBloc.setModelId(cell_model_id); - libraryOverhaulProjectModelBlocService.save(libraryOverhaulProjectModelBloc); - } - - /* - * 处理内容额定 - */ - String cmbsql = "where content_id = '" + cell_content_id + "' and model_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryOverhaulContentModelBloc contentModelBloc = libraryOverhaulContentModelBlocService.selectByWhere(cmbsql); - if (contentModelBloc != null) { - libraryOverhaulContentModelBloc.setId(contentModelBloc.getId()); - libraryOverhaulContentModelBloc.setUnitId(unitId); - libraryOverhaulContentModelBloc.setContentId(cell_content_id); - libraryOverhaulContentModelBloc.setModelId(cell_model_id); - libraryOverhaulContentModelBlocService.update(libraryOverhaulContentModelBloc); - } else { - libraryOverhaulContentModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulContentModelBloc.setUnitId(unitId); - libraryOverhaulContentModelBloc.setContentId(cell_content_id); - libraryOverhaulContentModelBloc.setModelId(cell_model_id); - libraryOverhaulContentModelBlocService.save(libraryOverhaulContentModelBloc); - } - } - } - } - String result = ""; - result = "" - //+ "新增项目:"+insertProjectNum+"条,修改项目:"+updateProjectNum+"条," - + "新增内容:" + insertContentNum + "条,修改内容:" + updateContentNum + "条!"; - System.out.println("导入大修库结束=============" + CommUtil.nowDate()); - return result; - } - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsx(InputStream input, String json, String userId, String unitId) throws IOException { - return null; - } - - @Override - public String readXls4Biz(InputStream input, String json, String userId, String unitId) throws IOException { - System.out.println("导入大修库开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertProjectNum = 0, updateProjectNum = 0; - int insertContentNum = 0, updateContentNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 13) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - } else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - //String cell_part_code = getMergedRegionValue(sheet, rowNum, 3);//设备部位代码 - String cell_class_id = "";//设备部位id - String cell_project_code = getMergedRegionValue(sheet, rowNum, 3);//设备项目代码 - String cell_project_id = "";//大修项目id - String cell_content_id = "";//大修内容id - String cell_model_id = "";//型号id - - JSONArray jsonArray = JSONArray.fromObject(json); - if (jsonArray != null && jsonArray.size() > 0) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if (cell_big_class_code != null && cell_big_class_code.equals(getJsonObj.get("code"))) { - if (getJsonObj.has("nodes")) { - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if (jsonArray2 != null && jsonArray2.size() > 0) { - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if (getJsonObj2 != null) { - if (cell_class_code != null && cell_class_code.equals(getJsonObj2.get("code"))) { - cell_class_id = getJsonObj2.get("id") + ""; - } - } - } - } - } - } - } - } - - LibraryOverhaulProjectBloc libraryOverhaulProjectBloc = new LibraryOverhaulProjectBloc(); - LibraryOverhaulContentBloc libraryOverhaulContentBloc = new LibraryOverhaulContentBloc(); - //大修项目定额 - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = new LibraryOverhaulProjectEquBiz(); - //大修内容定额 - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz = new LibraryOverhaulContentEquBiz(); - - - int contentstr = 0;//判断excel是否存在项目数据 存在置为1 - int projectstr = 0;//判断excel是否存在内容数据 存在置为1 - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i)) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - if (getMergedRegionValue(sheet, rowNum, i) != null && getMergedRegionValue(sheet, rowNum, i).equals("通用")) { - cell_model_id = "-1"; - } - break; - case 3://项目代码 - libraryOverhaulProjectBloc.setProjectNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - libraryOverhaulProjectBloc.setProjectName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 5: - libraryOverhaulProjectBloc.setCondition(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - libraryOverhaulProjectBloc.setCycle(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7://内容代码 - libraryOverhaulContentBloc.setContentNumber(getMergedRegionValue(sheet, rowNum, i)); - break; - case 8: - libraryOverhaulContentBloc.setRepairContent(getMergedRegionValue(sheet, rowNum, i)); - break; - case 9://维修方式 委外自修 - if ("自修".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryOverhaulContentBloc.setRepairPartyType(MaintainCommStr.Maintain_IN); - } - if ("委外".equals(getMergedRegionValue(sheet, rowNum, i))) { - libraryOverhaulContentBloc.setRepairPartyType(MaintainCommStr.Maintain_OUT); - } - break; - case 10: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryOverhaulContentEquBiz.setInsideRepairTime(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - contentstr = 1; - } - break; - case 11: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryOverhaulProjectEquBiz.setOutsideRepairCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - projectstr = 1; - } - break; - case 12: - if (getMergedRegionValue(sheet, rowNum, i) != null && !getMergedRegionValue(sheet, rowNum, i).equals("")) { - libraryOverhaulProjectEquBiz.setMaterialCost(Float.parseFloat(getMergedRegionValue(sheet, rowNum, i))); - projectstr = 1; - } - break; - case 13: - cell.setCellType(STRING); - String value = getMergedRegionValue(sheet, rowNum, i); - if (value != null && !value.equals("")) { - libraryOverhaulProjectEquBiz.setTotalCost(Float.parseFloat(value)); - projectstr = 1; - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - String unitIdStr = unitId; - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - libraryOverhaulProjectBloc.setUnitId(company.getLibraryBizid()); - unitIdStr = company.getLibraryBizid(); - } else { - libraryOverhaulProjectBloc.setUnitId(unitId); - } - - //部位库中必须要有 否则为无效数据 - if (cell_class_code != null && !cell_class_code.equals("") && cell_project_code != null && !cell_project_code.equals("")) { - libraryOverhaulProjectBloc.setPid(cell_class_id); - libraryOverhaulProjectBloc.setMorder(rowNum); - /* - * 处理项目数据 - */ - libraryOverhaulProjectBloc.setWhere("where pid = '" + cell_class_id + "' and project_number = '" + cell_project_code + "' and unit_id = '" + unitIdStr + "'"); - LibraryOverhaulProjectBloc projectBloc = libraryOverhaulProjectBlocDao.selectByWhere(libraryOverhaulProjectBloc); - if (projectBloc != null) { - cell_project_id = projectBloc.getId(); - } else { - cell_project_id = CommUtil.getUUID(); - } - - /* - * 处理内容数据 - */ - libraryOverhaulContentBloc.setPid(cell_project_id); - String sqlstr = "where pid = '" + cell_project_id + "' and content_number = '" + libraryOverhaulContentBloc.getContentNumber() + "'"; - LibraryOverhaulContentBloc contentBloc = libraryOverhaulContentBlocService.selectByWhere(sqlstr); - if (contentBloc != null) { - cell_content_id = contentBloc.getId(); - } else { - cell_content_id = CommUtil.getUUID(); - } - /* - * 处理项目定额 - */ - if (projectstr == 1) { //projectstr=1 为excel格子中有数据 - String pmbsql = "where project_id = '" + cell_project_id + "' and equipment_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryOverhaulProjectEquBiz projectEquBiz = libraryOverhaulProjectEquBizService.selectByWhere(pmbsql); - if (projectEquBiz != null) { - libraryOverhaulProjectEquBiz.setId(projectEquBiz.getId()); - libraryOverhaulProjectEquBiz.setUnitId(unitId); - libraryOverhaulProjectEquBiz.setProjectId(cell_project_id); - libraryOverhaulProjectEquBiz.setEquipmentId(cell_model_id); - insertProjectNum += libraryOverhaulProjectEquBizService.update(libraryOverhaulProjectEquBiz); - } else { - libraryOverhaulProjectEquBiz.setId(CommUtil.getUUID()); - libraryOverhaulProjectEquBiz.setUnitId(unitId); - libraryOverhaulProjectEquBiz.setProjectId(cell_project_id); - libraryOverhaulProjectEquBiz.setEquipmentId(cell_model_id); - insertProjectNum += libraryOverhaulProjectEquBizService.save(libraryOverhaulProjectEquBiz); - } - } - - /* - * 处理内容额定 - */ - if (contentstr == 1) { //contentstr=1 为excel格子中有数据 - String cmbsql = "where content_id = '" + cell_content_id + "' and equipment_id = '" + cell_model_id + "' and unit_id = '" + unitId + "'"; - LibraryOverhaulContentEquBiz contentEquBiz = libraryOverhaulContentEquBizService.selectByWhere(cmbsql); - if (contentEquBiz != null) { - libraryOverhaulContentEquBiz.setId(contentEquBiz.getId()); - libraryOverhaulContentEquBiz.setUnitId(unitId); - libraryOverhaulContentEquBiz.setContentId(cell_content_id); - libraryOverhaulContentEquBiz.setEquipmentId(cell_model_id); - insertContentNum += libraryOverhaulContentEquBizService.update(libraryOverhaulContentEquBiz); - } else { - libraryOverhaulContentEquBiz.setId(CommUtil.getUUID()); - libraryOverhaulContentEquBiz.setUnitId(unitId); - libraryOverhaulContentEquBiz.setContentId(cell_content_id); - libraryOverhaulContentEquBiz.setEquipmentId(cell_model_id); - insertContentNum += libraryOverhaulContentEquBizService.save(libraryOverhaulContentEquBiz); - } - } - } - } - } - String result = ""; - result = "" - + "新增项目:" + insertProjectNum + "条,修改项目:" + updateProjectNum + "条," - + "新增内容:" + insertContentNum + "条,修改内容:" + updateContentNum + "条!"; - System.out.println("导入大修库结束=============" + CommUtil.nowDate()); - return result; - } - - @Override - public String readXlsx4Biz(InputStream input, String json, String userId, String unitId) throws IOException { - return null; - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - - for (int i = 0; i < sheetMergeCount; i++) { - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell); - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell); - } - - @Override - public List selectList4Model(String wherestr, String modelId, String unitId) { - LibraryOverhaulProjectBloc entity = new LibraryOverhaulProjectBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulProjectBlocDao.selectListByWhere(entity); - for (LibraryOverhaulProjectBloc libraryOverhaulProjectBloc : list) { - List listModel = libraryOverhaulProjectModelBlocService.selectListByWhere("where project_id='" + libraryOverhaulProjectBloc.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listModel != null && listModel.size() > 0) { - libraryOverhaulProjectBloc.setLibraryOverhaulProjectModelBloc(listModel.get(0)); - } - } - return list; - } - - @Override - public List selectList4Equ(String wherestr, - String modelId, String unitId) { - LibraryOverhaulProjectBloc entity = new LibraryOverhaulProjectBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulProjectBlocDao.selectListByWhere(entity); - for (LibraryOverhaulProjectBloc libraryOverhaulProjectBloc : list) { - //标准层 Project - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - List listModel = libraryOverhaulProjectModelBlocService.selectListByWhere("where project_id='" + libraryOverhaulProjectBloc.getId() + "' and model_id='" + modelId + "' and unit_id='" + company.getLibraryBizid() + "'"); - if (listModel != null && listModel.size() > 0) { - libraryOverhaulProjectBloc.setLibraryOverhaulProjectModelBloc(listModel.get(0)); - } - } - //厂级 Project - List listEqu = libraryOverhaulProjectEquBizService.selectListByWhere("where project_id='" + libraryOverhaulProjectBloc.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryOverhaulProjectBloc.setLibraryOverhaulProjectEquBiz(listEqu.get(0)); - } - - //大修项目上的工时 根据厂配的显示 - /*List listContent = libraryOverhaulContentBlocService.selectListByWhere("where pid = '" + libraryOverhaulProjectBloc.getId() + "'"); - if (listContent != null && listContent.size() > 0) { - float dt = 0; - for (int i = 0; i < listContent.size(); i++) { - LibraryOverhaulContentEquBiz libraryOverhaulContentEquBiz = libraryOverhaulContentEquBizService.selectByWhere("where content_id = '" + listContent.get(i).getId() + "'"); - if (libraryOverhaulContentEquBiz != null) { - dt += libraryOverhaulContentEquBiz.getInsideRepairTime(); - } - } - libraryOverhaulProjectBloc.setInsideRepairTime(dt); - }*/ - } - return list; - } - - @Transactional - public int save4Model(LibraryOverhaulProjectBloc entity, String modelId, - String unitId) { - // TODO Auto-generated method stub - return 0; - } - - @Transactional - public int update4Model(LibraryOverhaulProjectBloc entity, String modelId, - String unitId) { - List list = libraryOverhaulProjectModelBlocService.selectListByWhere("where project_id='" + entity.getId() + "' and model_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc = new LibraryOverhaulProjectModelBloc(); - if (list != null && list.size() > 0) {//修改 - libraryOverhaulProjectModelBloc.setId(list.get(0).getId()); - libraryOverhaulProjectModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulProjectModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulProjectModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulProjectModelBloc.setTotalCost(entity.getOutsideRepairCost() + entity.getMaterialCost()); - libraryOverhaulProjectModelBloc.setProjectId(entity.getId()); - libraryOverhaulProjectModelBloc.setModelId(modelId); - libraryOverhaulProjectModelBloc.setUnitId(unitId); - libraryOverhaulProjectModelBlocService.update(libraryOverhaulProjectModelBloc); - } else {//新增 - libraryOverhaulProjectModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulProjectModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulProjectModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulProjectModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulProjectModelBloc.setTotalCost(entity.getOutsideRepairCost() + entity.getMaterialCost()); - libraryOverhaulProjectModelBloc.setProjectId(entity.getId()); - libraryOverhaulProjectModelBloc.setModelId(modelId); - libraryOverhaulProjectModelBloc.setUnitId(unitId); - libraryOverhaulProjectModelBlocService.save(libraryOverhaulProjectModelBloc); - } - entity.setUnitId(null); - return libraryOverhaulProjectBlocDao.updateByPrimaryKeySelective(entity); - } - - @Transactional - public int update4Equ(LibraryOverhaulProjectBloc entity, String modelId, - String unitId) { - List list = libraryOverhaulProjectEquBizService.selectListByWhere("where project_id='" + entity.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = new LibraryOverhaulProjectEquBiz(); - int res = 0; - if (list != null && list.size() > 0) {//修改 - libraryOverhaulProjectEquBiz.setId(list.get(0).getId()); - libraryOverhaulProjectEquBiz.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulProjectEquBiz.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulProjectEquBiz.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulProjectEquBiz.setTotalCost(entity.getOutsideRepairCost() + entity.getMaterialCost()); - libraryOverhaulProjectEquBiz.setProjectId(entity.getId()); - libraryOverhaulProjectEquBiz.setEquipmentId(modelId); - libraryOverhaulProjectEquBiz.setUnitId(unitId); - res = libraryOverhaulProjectEquBizService.update(libraryOverhaulProjectEquBiz); - } else {//新增 - libraryOverhaulProjectEquBiz.setId(CommUtil.getUUID()); - libraryOverhaulProjectEquBiz.setInsideRepairTime(entity.getInsideRepairTime()); - libraryOverhaulProjectEquBiz.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryOverhaulProjectEquBiz.setMaterialCost(entity.getMaterialCost()); - libraryOverhaulProjectEquBiz.setTotalCost(entity.getOutsideRepairCost() + entity.getMaterialCost()); - libraryOverhaulProjectEquBiz.setProjectId(entity.getId()); - libraryOverhaulProjectEquBiz.setEquipmentId(modelId); - libraryOverhaulProjectEquBiz.setUnitId(unitId); - res = libraryOverhaulProjectEquBizService.save(libraryOverhaulProjectEquBiz); - } - return res; - } - - @Transactional - public int updateProjectQuota(String id, String modelId, String unitId, String equipmentId) {//id为分厂库项目id - - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null && company.getLibraryBizid() != null && !company.getLibraryBizid().equals("")) { - unitId = company.getLibraryBizid(); - } - - int res = 0; - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = libraryOverhaulProjectEquBizService.selectById(id); - if (libraryOverhaulProjectEquBiz != null) { - String sqlstr = "where project_id = '" + libraryOverhaulProjectEquBiz.getProjectId() + "' and model_id = '" + modelId + "' and unit_id = '" + unitId + "'"; - List list = libraryOverhaulProjectModelBlocService.selectListByWhere(sqlstr); - if (list != null && list.size() > 0) { - //修改 - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc = new LibraryOverhaulProjectModelBloc(); - libraryOverhaulProjectModelBloc.setId(list.get(0).getId()); - libraryOverhaulProjectModelBloc.setInsideRepairTime(libraryOverhaulProjectEquBiz.getInsideRepairTime()); - libraryOverhaulProjectModelBloc.setOutsideRepairCost(libraryOverhaulProjectEquBiz.getOutsideRepairCost()); - libraryOverhaulProjectModelBloc.setMaterialCost(libraryOverhaulProjectEquBiz.getMaterialCost()); - libraryOverhaulProjectModelBloc.setTotalCost(libraryOverhaulProjectEquBiz.getTotalCost()); - res = libraryOverhaulProjectModelBlocService.update(libraryOverhaulProjectModelBloc); - } else { - //新增 - LibraryOverhaulProjectModelBloc libraryOverhaulProjectModelBloc = new LibraryOverhaulProjectModelBloc(); - libraryOverhaulProjectModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulProjectModelBloc.setInsideRepairTime(libraryOverhaulProjectEquBiz.getInsideRepairTime()); - libraryOverhaulProjectModelBloc.setOutsideRepairCost(libraryOverhaulProjectEquBiz.getOutsideRepairCost()); - libraryOverhaulProjectModelBloc.setMaterialCost(libraryOverhaulProjectEquBiz.getMaterialCost()); - libraryOverhaulProjectModelBloc.setTotalCost(libraryOverhaulProjectEquBiz.getTotalCost()); - libraryOverhaulProjectModelBloc.setProjectId(libraryOverhaulProjectEquBiz.getProjectId()); - libraryOverhaulProjectModelBloc.setModelId(modelId); - libraryOverhaulProjectModelBloc.setUnitId(unitId); - res = libraryOverhaulProjectModelBlocService.save(libraryOverhaulProjectModelBloc); - } - //分厂的项目定额导入成功后再导入内容的工时 - if (res == 1) { - //先查询项目下有哪些内容 - String contentstr = " where pid = '" + libraryOverhaulProjectEquBiz.getProjectId() + "'"; - List contentlist = libraryOverhaulContentBlocService.selectListByWhere(contentstr); - for (LibraryOverhaulContentBloc libraryOverhaulContentBloc : contentlist) { - //查询分厂内容定额 - String equbizsql = " where content_id = '" + libraryOverhaulContentBloc.getId() + "' and equipment_id = '" + equipmentId + "' and unit_id = '" + libraryOverhaulProjectEquBiz.getUnitId() + "' "; - List equbizlist = libraryOverhaulContentEquBizService.selectListByWhere(equbizsql); - if (equbizlist != null && equbizlist.size() > 0) { - //查询业务区是否存在 - String contentModelBlocSql = "where content_id = '" + libraryOverhaulContentBloc.getId() + "' and model_id = '" + modelId + "' and unit_id = '" + unitId + "' "; - List modelbloclist = libraryOverhaulContentModelBlocService.selectListByWhere(contentModelBlocSql); - if (modelbloclist != null && modelbloclist.size() > 0) { - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc = new LibraryOverhaulContentModelBloc(); - libraryOverhaulContentModelBloc.setId(modelbloclist.get(0).getId()); - libraryOverhaulContentModelBloc.setInsideRepairTime(equbizlist.get(0).getInsideRepairTime()); - res = libraryOverhaulContentModelBlocService.update(libraryOverhaulContentModelBloc); - } else { - LibraryOverhaulContentModelBloc libraryOverhaulContentModelBloc = new LibraryOverhaulContentModelBloc(); - libraryOverhaulContentModelBloc.setId(CommUtil.getUUID()); - libraryOverhaulContentModelBloc.setInsideRepairTime(equbizlist.get(0).getInsideRepairTime()); - libraryOverhaulContentModelBloc.setUnitId(unitId); - libraryOverhaulContentModelBloc.setContentId(libraryOverhaulContentBloc.getId()); - libraryOverhaulContentModelBloc.setModelId(modelId); - res = libraryOverhaulContentModelBlocService.save(libraryOverhaulContentModelBloc); - } - } else { - System.out.println("分厂也没有定额.."); - } - } - } - } - return res; - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectEquBizServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectEquBizServiceImpl.java deleted file mode 100644 index 6e361cd4..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectEquBizServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryOverhaulProjectEquBizDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.LibraryOverhaulProjectEquBiz; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.LibraryOverhaulProjectEquBizService; - -@Service -public class LibraryOverhaulProjectEquBizServiceImpl implements LibraryOverhaulProjectEquBizService{ - - @Resource - private LibraryOverhaulProjectEquBizDao libraryOverhaulProjectEquBizDao; - @Resource - private CompanyService companyService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public LibraryOverhaulProjectEquBiz selectById(String id) { - return libraryOverhaulProjectEquBizDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryOverhaulProjectEquBizDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryOverhaulProjectEquBiz entity) { - return libraryOverhaulProjectEquBizDao.insert(entity); - } - - @Override - public int update(LibraryOverhaulProjectEquBiz entity) { - return libraryOverhaulProjectEquBizDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryOverhaulProjectEquBiz entity = new LibraryOverhaulProjectEquBiz(); - entity.setWhere(wherestr); - List list = libraryOverhaulProjectEquBizDao.selectListByWhere(entity); - for (LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz : list) { - Company company = companyService.selectByPrimaryKey(libraryOverhaulProjectEquBiz.getUnitId()); - libraryOverhaulProjectEquBiz.setCompany(company); - EquipmentCard equipmentCard = equipmentCardService.selectById4Model(libraryOverhaulProjectEquBiz.getEquipmentId()); - libraryOverhaulProjectEquBiz.setEquipmentCard(equipmentCard); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = new LibraryOverhaulProjectEquBiz(); - libraryOverhaulProjectEquBiz.setWhere(wherestr); - return libraryOverhaulProjectEquBizDao.deleteByWhere(libraryOverhaulProjectEquBiz); - } - - @Override - public LibraryOverhaulProjectEquBiz selectByWhere(String wherestr) { - LibraryOverhaulProjectEquBiz libraryOverhaulProjectEquBiz = new LibraryOverhaulProjectEquBiz(); - libraryOverhaulProjectEquBiz.setWhere(wherestr); - return libraryOverhaulProjectEquBizDao.selectByWhere(libraryOverhaulProjectEquBiz); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectModelBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectModelBlocServiceImpl.java deleted file mode 100644 index aa4424d7..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryOverhaulProjectModelBlocServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryOverhaulProjectModelBlocDao; -import com.sipai.entity.maintenance.LibraryOverhaulProjectModelBloc; -import com.sipai.service.maintenance.LibraryOverhaulProjectModelBlocService; - -@Service -public class LibraryOverhaulProjectModelBlocServiceImpl implements LibraryOverhaulProjectModelBlocService{ - @Resource - private LibraryOverhaulProjectModelBlocDao libraryOverhaulProjectModelBlocDao; - - @Override - public LibraryOverhaulProjectModelBloc selectById(String id) { - return libraryOverhaulProjectModelBlocDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryOverhaulProjectModelBlocDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryOverhaulProjectModelBloc entity) { - return libraryOverhaulProjectModelBlocDao.insert(entity); - } - - @Override - public int update(LibraryOverhaulProjectModelBloc entity) { - return libraryOverhaulProjectModelBlocDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryOverhaulProjectModelBloc entity = new LibraryOverhaulProjectModelBloc(); - entity.setWhere(wherestr); - List list = libraryOverhaulProjectModelBlocDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryOverhaulProjectModelBloc entity = new LibraryOverhaulProjectModelBloc(); - entity.setWhere(wherestr); - return libraryOverhaulProjectModelBlocDao.deleteByWhere(entity); - } - - @Override - public LibraryOverhaulProjectModelBloc selectByWhere(String wherestr) { - LibraryOverhaulProjectModelBloc entity = new LibraryOverhaulProjectModelBloc(); - entity.setWhere(wherestr); - return libraryOverhaulProjectModelBlocDao.selectByWhere(entity); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryRepairBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryRepairBlocServiceImpl.java deleted file mode 100644 index 58f51fe4..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryRepairBlocServiceImpl.java +++ /dev/null @@ -1,281 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; -import java.util.TreeSet; - -import javax.annotation.Resource; - -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.maintenance.*; -import com.sipai.service.maintenance.LibraryFaultBlocService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.LibraryRepairBlocDao; -import com.sipai.service.maintenance.LibraryRepairBlocService; -import com.sipai.service.maintenance.LibraryRepairEquBizService; -import com.sipai.service.maintenance.LibraryRepairModelBlocService; -import com.sipai.tools.CommUtil; - -@Service -public class LibraryRepairBlocServiceImpl implements LibraryRepairBlocService { - - @Resource - private LibraryRepairBlocDao libraryRepairBlocDao; - @Resource - private LibraryRepairModelBlocService libraryRepairModelBlocService; - @Resource - private LibraryRepairEquBizService libraryRepairEquBizService; - @Resource - private LibraryFaultBlocService libraryFaultBlocService; - - @Override - public LibraryRepairBloc selectById(String id) { - LibraryRepairBloc libraryRepairBloc = libraryRepairBlocDao.selectByPrimaryKey(id); - return libraryRepairBloc; - } - - //工艺可视化,异常消缺查id的 - public LibraryRepairBloc selectByFaultId(String id) { - LibraryRepairBloc libraryRepairBloc = libraryRepairBlocDao.selectByPrimaryKey(id); - return libraryRepairBloc; - } - - @Override - public int deleteById(String id) { - //libraryRepairBlocQuotaService.deleteByWhere("where pid = '"+id+"'"); - return libraryRepairBlocDao.deleteByPrimaryKey(id); - } - - @Transactional - public int save(LibraryRepairBloc libraryRepairBloc) { - return libraryRepairBlocDao.insert(libraryRepairBloc); - } - - @Transactional - public int update(LibraryRepairBloc libraryRepairBloc) { - return libraryRepairBlocDao.updateByPrimaryKeySelective(libraryRepairBloc); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - libraryRepairBloc.setWhere(wherestr); - List faultLibraries = libraryRepairBlocDao.selectListByWhere(libraryRepairBloc); - return faultLibraries; - } - - @Override - public List selectListByWhere2(String wherestr, String unitId) { - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - libraryRepairBloc.setWhere(wherestr); - List faultLibraries = libraryRepairBlocDao.selectListByWhere(libraryRepairBloc); - if (faultLibraries != null && faultLibraries.size() > 0) { - for (int i = 0; i < faultLibraries.size(); i++) { - //先查询子表中是否配了工时等 - String sql = "where content_id = '" + faultLibraries.get(i).getId() + "' and equipment_id = '-1' and unit_id= '" + unitId + "'"; - LibraryRepairEquBiz libraryRepairEquBiz = libraryRepairEquBizService.selectByWhere(sql); - if (libraryRepairEquBiz != null) { - faultLibraries.get(i).setInsideRepairTime(libraryRepairEquBiz.getInsideRepairTime()); - faultLibraries.get(i).setOutsideRepairCost(libraryRepairEquBiz.getOutsideRepairCost()); - faultLibraries.get(i).setMaterialCost(libraryRepairEquBiz.getMaterialCost()); - faultLibraries.get(i).setTotalCost(libraryRepairEquBiz.getTotalCost()); - } else { - String sql2 = "where content_id = '" + faultLibraries.get(i).getId() + "' and model_id = '-1' "; - LibraryRepairModelBloc libraryRepairModelBloc = libraryRepairModelBlocService.selectByWhere(sql2); - if (libraryRepairModelBloc != null) { - faultLibraries.get(i).setInsideRepairTime(libraryRepairModelBloc.getInsideRepairTime()); - faultLibraries.get(i).setOutsideRepairCost(libraryRepairModelBloc.getOutsideRepairCost()); - faultLibraries.get(i).setMaterialCost(libraryRepairModelBloc.getMaterialCost()); - faultLibraries.get(i).setTotalCost(libraryRepairModelBloc.getTotalCost()); - } - } - } - } - return faultLibraries; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - libraryRepairBloc.setWhere(wherestr); - return libraryRepairBlocDao.deleteByWhere(libraryRepairBloc); - } - - @Override - public void deletePid(LibraryRepairBloc libraryRepairBloc) { - libraryRepairBlocDao.deletePid(libraryRepairBloc); - } - - @Override - public List selectList4Model(String wherestr, String modelId) { - LibraryRepairBloc entity = new LibraryRepairBloc(); - entity.setWhere(wherestr); - List list = libraryRepairBlocDao.selectListByWhere(entity); - /*for (LibraryRepairBloc libraryRepairBloc : list) { - List listModel = libraryRepairModelBlocService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and model_id='" + modelId + "'"); - if (listModel != null && listModel.size() > 0) { - libraryRepairBloc.setLibraryRepairModelBloc(listModel.get(0)); - } - }*/ - return list; - } - - @Override - public List selectList4Equ(String wherestr, String modelId, String unitId) { - LibraryRepairBloc entity = new LibraryRepairBloc(); - entity.setWhere(wherestr); - List list = libraryRepairBlocDao.selectListByWhere(entity); - /*for (LibraryRepairBloc libraryRepairBloc : list) { - List listEqu = libraryRepairEquBizService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryRepairBloc.setLibraryRepairEquBiz(listEqu.get(0)); - } - }*/ - return list; - } - - @Transactional - public int save4Model(LibraryRepairBloc entity, String modelId) { - LibraryRepairModelBloc libraryRepairModelBloc = new LibraryRepairModelBloc(); - libraryRepairModelBloc.setId(CommUtil.getUUID()); - libraryRepairModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - libraryRepairModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryRepairModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryRepairModelBloc.setTotalCost(entity.getTotalCost()); - libraryRepairModelBloc.setContentId(entity.getId()); - libraryRepairModelBloc.setModelId(modelId); - libraryRepairModelBlocService.save(libraryRepairModelBloc); - return libraryRepairBlocDao.insert(entity); - } - - @Transactional - public int update4Model(LibraryRepairBloc entity, String modelId) { - List list = libraryRepairModelBlocService.selectListByWhere("where content_id='" + entity.getId() + "' and model_id='" + modelId + "'"); - LibraryRepairModelBloc libraryRepairModelBloc = new LibraryRepairModelBloc(); - if (list != null && list.size() > 0) {//修改 - libraryRepairModelBloc.setId(list.get(0).getId()); - libraryRepairModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - libraryRepairModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryRepairModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryRepairModelBloc.setTotalCost(entity.getTotalCost()); - libraryRepairModelBloc.setContentId(entity.getId()); - libraryRepairModelBloc.setModelId(modelId); - libraryRepairModelBlocService.update(libraryRepairModelBloc); - } else {//新增 - libraryRepairModelBloc.setId(CommUtil.getUUID()); - libraryRepairModelBloc.setInsideRepairTime(entity.getInsideRepairTime()); - libraryRepairModelBloc.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryRepairModelBloc.setMaterialCost(entity.getMaterialCost()); - libraryRepairModelBloc.setTotalCost(entity.getTotalCost()); - libraryRepairModelBloc.setContentId(entity.getId()); - libraryRepairModelBloc.setModelId(modelId); - libraryRepairModelBlocService.save(libraryRepairModelBloc); - } - return libraryRepairBlocDao.updateByPrimaryKeySelective(entity); - } - - @Transactional - public int update5Model(LibraryRepairBloc entity) { - return libraryRepairBlocDao.updateByPrimaryKeySelective(entity); - } - - @Transactional - public int update4Equ(LibraryRepairBloc entity, String modelId, String unitId) { - List list = libraryRepairEquBizService.selectListByWhere("where content_id='" + entity.getId() + "' and equipment_id='" + modelId + "' and unit_id='" + unitId + "'"); - LibraryRepairEquBiz libraryRepairEquBiz = new LibraryRepairEquBiz(); - if (list != null && list.size() > 0) {//修改 - libraryRepairEquBiz.setId(list.get(0).getId()); - libraryRepairEquBiz.setInsideRepairTime(entity.getInsideRepairTime()); - libraryRepairEquBiz.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryRepairEquBiz.setMaterialCost(entity.getMaterialCost()); - libraryRepairEquBiz.setTotalCost(entity.getTotalCost()); - libraryRepairEquBiz.setContentId(entity.getId()); - libraryRepairEquBiz.setEquipmentId(modelId); - libraryRepairEquBiz.setUnitId(unitId); - libraryRepairEquBizService.update(libraryRepairEquBiz); - } else {//新增 - libraryRepairEquBiz.setId(CommUtil.getUUID()); - libraryRepairEquBiz.setInsideRepairTime(entity.getInsideRepairTime()); - libraryRepairEquBiz.setOutsideRepairCost(entity.getOutsideRepairCost()); - libraryRepairEquBiz.setMaterialCost(entity.getMaterialCost()); - libraryRepairEquBiz.setTotalCost(entity.getTotalCost()); - libraryRepairEquBiz.setContentId(entity.getId()); - libraryRepairEquBiz.setEquipmentId(modelId); - libraryRepairEquBiz.setUnitId(unitId); - libraryRepairEquBizService.save(libraryRepairEquBiz); - } - //return libraryOverhaulContentBlocDao.updateByPrimaryKeySelective(entity); - return 1; - } - - @Override - public LibraryRepairBloc selectByWhere(String wherestr) { - LibraryRepairBloc libraryRepairBloc = new LibraryRepairBloc(); - libraryRepairBloc.setWhere(wherestr); - return libraryRepairBlocDao.selectByWhere(libraryRepairBloc); - } - - @Override - public List selectList4Class(String wherestr, String unitId) { - return libraryRepairBlocDao.selectList4Class(wherestr, unitId); - } - - @Override - public List selectList3Class(String wherestr, String unitId) { - return libraryRepairBlocDao.selectList3Class(wherestr, unitId); - } - - @Override - public LibraryRepairBloc selectById4FaultAndBiz(String id, String unitId, String equipmentId) { - LibraryRepairBloc libraryRepairBloc = libraryRepairBlocDao.selectByPrimaryKey(id); - if (libraryRepairBloc != null) { - //查询故障库 - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocService.selectById4Part(libraryRepairBloc.getPid()); - libraryRepairBloc.setLibraryFaultBloc(libraryFaultBloc); - - //查询分厂的工时 - List listEqu = libraryRepairEquBizService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and equipment_id='" + equipmentId + "' and unit_id='" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryRepairBloc.setLibraryRepairEquBiz(listEqu.get(0)); - } - } - return libraryRepairBloc; - } - - @Override - public List selectList4FaultAndBiz(String wherestr, String unitId, String equipmentId) { - LibraryRepairBloc enetity = new LibraryRepairBloc(); - enetity.setWhere(wherestr); - List list = libraryRepairBlocDao.selectListByWhere(enetity); - for (LibraryRepairBloc libraryRepairBloc : list) { - //查询故障库 - LibraryFaultBloc libraryFaultBloc = libraryFaultBlocService.selectById4Part(libraryRepairBloc.getPid()); - libraryRepairBloc.setLibraryFaultBloc(libraryFaultBloc); - //查询分厂的工时 - List listEqu = libraryRepairEquBizService.selectListByWhere("where content_id='" + libraryRepairBloc.getId() + "' and equipment_id='" + equipmentId + "' and unit_id='" + unitId + "'"); - if (listEqu != null && listEqu.size() > 0) { - libraryRepairBloc.setLibraryRepairEquBiz(listEqu.get(0)); - } - } - return list; - } - - @Override - public void doInit(LibraryRepairBloc libraryRepairBloc) { - libraryRepairBlocDao.doInit(libraryRepairBloc); - } - -// @Override -// public LibraryRepairBloc selectById4Biz(String id,String unitId,String equipmentId) { -// LibraryRepairBloc libraryRepairBloc =libraryRepairBlocDao.selectByPrimaryKey(id); -// if(libraryRepairBloc!=null){ -// List listEqu = libraryRepairEquBizService.selectListByWhere("where content_id='"+libraryRepairBloc.getId()+"' and equipment_id='"+equipmentId+"' and unit_id='"+unitId+"'"); -// if(listEqu!=null && listEqu.size()>0){ -// libraryRepairBloc.setLibraryRepairEquBiz(listEqu.get(0)); -// } -// } -// return libraryRepairBloc; -// } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryRepairEquBizServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryRepairEquBizServiceImpl.java deleted file mode 100644 index 9873baa0..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryRepairEquBizServiceImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryRepairEquBizDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.LibraryOverhaulContentEquBiz; -import com.sipai.entity.maintenance.LibraryRepairEquBiz; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.LibraryRepairEquBizService; - -@Service -public class LibraryRepairEquBizServiceImpl implements LibraryRepairEquBizService{ - @Resource - private LibraryRepairEquBizDao libraryRepairEquBizDao; - @Resource - private CompanyService companyService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public LibraryRepairEquBiz selectById(String id) { - return libraryRepairEquBizDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryRepairEquBizDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryRepairEquBiz entity) { - return libraryRepairEquBizDao.insert(entity); - } - - @Override - public int update(LibraryRepairEquBiz entity) { - return libraryRepairEquBizDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryRepairEquBiz entity = new LibraryRepairEquBiz(); - entity.setWhere(wherestr); - List list = libraryRepairEquBizDao.selectListByWhere(entity); - for (LibraryRepairEquBiz libraryRepairEquBiz : list) { - Company company = companyService.selectByPrimaryKey(libraryRepairEquBiz.getUnitId()); - libraryRepairEquBiz.setCompany(company); - EquipmentCard equipmentCard = equipmentCardService.selectById4Model(libraryRepairEquBiz.getEquipmentId()); - libraryRepairEquBiz.setEquipmentCard(equipmentCard); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryRepairEquBiz libraryRepairEquBiz = new LibraryRepairEquBiz(); - libraryRepairEquBiz.setWhere(wherestr); - return libraryRepairEquBizDao.deleteByWhere(libraryRepairEquBiz); - } - - @Override - public int copy4Equ(String id, String modelId, String unitId) { - return 2; - } - - @Override - public LibraryRepairEquBiz selectByWhere(String wherestr) { - LibraryRepairEquBiz libraryRepairEquBiz = new LibraryRepairEquBiz(); - libraryRepairEquBiz.setWhere(wherestr); - return libraryRepairEquBizDao.selectByWhere(libraryRepairEquBiz); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/LibraryRepairModelBlocServiceImpl.java b/src/com/sipai/service/maintenance/impl/LibraryRepairModelBlocServiceImpl.java deleted file mode 100644 index 4690633f..00000000 --- a/src/com/sipai/service/maintenance/impl/LibraryRepairModelBlocServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryRepairModelBlocDao; -import com.sipai.entity.maintenance.LibraryRepairModelBloc; -import com.sipai.service.maintenance.LibraryRepairModelBlocService; - -@Service -public class LibraryRepairModelBlocServiceImpl implements LibraryRepairModelBlocService{ - @Resource - private LibraryRepairModelBlocDao libraryRepairModelBlocDao; - - @Override - public LibraryRepairModelBloc selectById(String id) { - return libraryRepairModelBlocDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - // TODO Auto-generated method stub - return libraryRepairModelBlocDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryRepairModelBloc entity) { - // TODO Auto-generated method stub - return libraryRepairModelBlocDao.insert(entity); - } - - @Override - public int update(LibraryRepairModelBloc entity) { - // TODO Auto-generated method stub - return libraryRepairModelBlocDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryRepairModelBloc libraryRepairModelBloc = new LibraryRepairModelBloc(); - libraryRepairModelBloc.setWhere(wherestr); - List list = libraryRepairModelBlocDao.selectListByWhere(libraryRepairModelBloc); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryRepairModelBloc libraryRepairModelBloc = new LibraryRepairModelBloc(); - libraryRepairModelBloc.setWhere(wherestr); - return libraryRepairModelBlocDao.deleteByWhere(libraryRepairModelBloc); - } - - @Override - public LibraryRepairModelBloc selectByWhere(String wherestr) { - LibraryRepairModelBloc libraryRepairModelBloc = new LibraryRepairModelBloc(); - libraryRepairModelBloc.setWhere(wherestr); - return libraryRepairModelBlocDao.selectByWhere(libraryRepairModelBloc); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/MaintainCarServiceImpl.java b/src/com/sipai/service/maintenance/impl/MaintainCarServiceImpl.java deleted file mode 100644 index b7450e7f..00000000 --- a/src/com/sipai/service/maintenance/impl/MaintainCarServiceImpl.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.MaintainCarDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintainCar; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.RepairCar; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.maintenance.LibraryMaintainCarDetailService; -import com.sipai.service.maintenance.LibraryMaintainCarService; -import com.sipai.service.maintenance.MaintainCarService; - -@Service -public class MaintainCarServiceImpl implements MaintainCarService { - @Resource - private MaintainCarDao maintainCarDao; - @Resource - private LibraryMaintainCarService libraryMaintainCarService; - @Resource - private LibraryMaintainCarDetailService libraryMaintainCarDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - - @Override - public MaintainCar selectById(String id) { - MaintainCar maintainCar = this.maintainCarDao.selectByPrimaryKey(id); - if (maintainCar != null) { - if (maintainCar.getMaintainCarId() != null) { - maintainCar.setLibraryMaintainCar(this.libraryMaintainCarService.selectById(maintainCar.getMaintainCarId())); - } - if (maintainCar.getMaintainCarDetailId() != null) { - maintainCar.setLibraryMaintainCarDetail(this.libraryMaintainCarDetailService.selectById(maintainCar.getMaintainCarDetailId())); - } - } - return maintainCar; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - MaintainCar maintainCar = this.selectById(id); - String pInstancId = maintainCar.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return maintainCarDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(MaintainCar maintainCar) { - int code = this.maintainCarDao.insert(maintainCar); - return code; - } - - @Override - public int update(MaintainCar maintainCar) { - int code = this.maintainCarDao.updateByPrimaryKeySelective(maintainCar); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - MaintainCar maintainCar = new MaintainCar(); - maintainCar.setWhere(wherestr); - List list = this.maintainCarDao.selectListByWhere(maintainCar); - for (MaintainCar item : list) { - if (item.getMaintainCarId()!=null) { - item.setLibraryMaintainCar(this.libraryMaintainCarService.selectById(item.getMaintainCarId())); - } - if (item.getMaintainCarDetailId()!=null) { - item.setLibraryMaintainCarDetail(this.libraryMaintainCarDetailService.selectById(item.getMaintainCarDetailId())); - } - } - return list; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - MaintainCar maintainCar = new MaintainCar(); - maintainCar.setWhere(wherestr); - List list = this.selectListByWhere(wherestr); - for (MaintainCar item : list) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return maintainCarDao.deleteByWhere(maintainCar); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Transactional - public int startProcess(MaintainCar maintainCar) { - try { - Map variables = new HashMap(); - if(!maintainCar.getSolver().isEmpty()){ - variables.put("userIds", maintainCar.getSolver()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Maintain_Car.getId()+"-"+maintainCar.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(maintainCar.getId(), maintainCar.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - maintainCar.setProcessid(processInstance.getId()); - maintainCar.setProcessdefid(processDefinitions.get(0).getId()); -// maintainCar.setStatus("已提交"); - }else{ - throw new RuntimeException(); - } - int res=this.update(maintainCar); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(maintainCar); - businessUnitRecord.sendMessage(maintainCar.getSolver(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - public int updateStatus(String id) { - MaintainCar maintainCar = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(maintainCar.getProcessid()).list(); - if (task!=null && task.size()>0) { - maintainCar.setStatus(task.get(0).getName()); - }else{ - maintainCar.setStatus("已审核"); - } - int res =this.update(maintainCar); - return res; - } -} diff --git a/src/com/sipai/service/maintenance/impl/MaintainServiceImpl.java b/src/com/sipai/service/maintenance/impl/MaintainServiceImpl.java deleted file mode 100644 index 83dd4bfa..00000000 --- a/src/com/sipai/service/maintenance/impl/MaintainServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.MaintainDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.maintenance.Maintain; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.maintenance.MaintainService; -import com.sipai.service.user.UserService; - - -@Service -public class MaintainServiceImpl implements MaintainService{ - @Resource - private MaintainDao maintainDao; - @Resource - private CompanyService companyService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UserService userService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - - @Override - public Maintain selectById(String id) { - Maintain maintain = maintainDao.selectByPrimaryKey(id); - if(maintain!=null){ - Company company = companyService.selectByPrimaryKey(maintain.getUnitId()); - maintain.setCompany(company); - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(maintain.getEquipmentId()); - maintain.setEquipmentCard(equipmentCard); -// User user = userService.getUserById(maintain.getReceiveUserId()); -// maintain.setReceiveUser(user); - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(maintain.getMaintainType()); - maintain.setEquipmentPlanType(equipmentPlanType); - } - return maintain; - } - - @Override - public int deleteById(String id) { - return maintainDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Maintain entity) { - return maintainDao.insert(entity); - } - - @Override - public int update(Maintain entity) { - return maintainDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Maintain entity = new Maintain(); - entity.setWhere(wherestr); - List list = maintainDao.selectListByWhere(entity); - for (Maintain maintain : list) { - Company company = companyService.selectByPrimaryKey(maintain.getUnitId()); - maintain.setCompany(company); - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(maintain.getEquipmentId()); - maintain.setEquipmentCard(equipmentCard); - User user = userService.getUserById(maintain.getReceiveUserId()); - maintain.setReceiveUser(user); - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(maintain.getMaintainType()); - maintain.setEquipmentPlanType(equipmentPlanType); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Maintain entity = new Maintain(); - entity.setWhere(wherestr); - return maintainDao.deleteByWhere(entity); - } - - @Override - public Maintain selectByWhere(String wherestr) { - Maintain entity = new Maintain(); - entity.setWhere(wherestr); - return maintainDao.selectByWhere(entity); - } - -} diff --git a/src/com/sipai/service/maintenance/impl/MaintenanceEquipmentConfigServiceImpl.java b/src/com/sipai/service/maintenance/impl/MaintenanceEquipmentConfigServiceImpl.java deleted file mode 100644 index cc049e62..00000000 --- a/src/com/sipai/service/maintenance/impl/MaintenanceEquipmentConfigServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import com.sipai.dao.maintenance.MaintenanceEquipmentConfigDao; -import com.sipai.entity.maintenance.MaintenanceEquipmentConfig; -import com.sipai.service.maintenance.MaintenanceEquipmentConfigService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class MaintenanceEquipmentConfigServiceImpl implements MaintenanceEquipmentConfigService { - @Resource - private MaintenanceEquipmentConfigDao maintenanceEquipmentConfigDao; - - @Override - public MaintenanceEquipmentConfig selectById(String id) { - return maintenanceEquipmentConfigDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return maintenanceEquipmentConfigDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MaintenanceEquipmentConfig entity) { - return maintenanceEquipmentConfigDao.insert(entity); - } - - @Override - public int update(MaintenanceEquipmentConfig entity) { - return maintenanceEquipmentConfigDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MaintenanceEquipmentConfig entity = new MaintenanceEquipmentConfig(); - entity.setWhere(wherestr); - return maintenanceEquipmentConfigDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - MaintenanceEquipmentConfig entity = new MaintenanceEquipmentConfig(); - entity.setWhere(wherestr); - return maintenanceEquipmentConfigDao.deleteByWhere(entity); - } -} diff --git a/src/com/sipai/service/maintenance/impl/RepairCarServiceImpl.java b/src/com/sipai/service/maintenance/impl/RepairCarServiceImpl.java deleted file mode 100644 index 305f7264..00000000 --- a/src/com/sipai/service/maintenance/impl/RepairCarServiceImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.RepairCarDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.RepairCar; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.maintenance.LibraryMaintainCarService; -import com.sipai.service.maintenance.RepairCarService; - -@Service -public class RepairCarServiceImpl implements RepairCarService { - @Resource - private RepairCarDao repairCarDao; - @Resource - private LibraryMaintainCarService libraryMaintainCarService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - - @Override - public RepairCar selectById(String id) { - RepairCar repairCar = this.repairCarDao.selectByPrimaryKey(id); - if (repairCar.getMaintainCarId()!=null) { - repairCar.setLibraryMaintainCar(this.libraryMaintainCarService.selectById(repairCar.getMaintainCarId())); - } - return repairCar; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - RepairCar repairCar = this.selectById(id); - String pInstancId = repairCar.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return repairCarDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(RepairCar repairCar) { - int code = this.repairCarDao.insert(repairCar); - return code; - } - - @Override - public int update(RepairCar repairCar) { - int code = this.repairCarDao.updateByPrimaryKeySelective(repairCar); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - RepairCar repairCar = new RepairCar(); - repairCar.setWhere(wherestr); - List list = this.repairCarDao.selectListByWhere(repairCar); - for (RepairCar item : list) { - if (item.getMaintainCarId()!=null) { - item.setLibraryMaintainCar(this.libraryMaintainCarService.selectById(item.getMaintainCarId())); - } - } - return list; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - RepairCar repairCar = new RepairCar(); - repairCar.setWhere(wherestr); - List list = this.selectListByWhere(wherestr); - for (RepairCar item : list) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return repairCarDao.deleteByWhere(repairCar); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Transactional - public int startProcess(RepairCar repairCar) { - try { - Map variables = new HashMap(); - if(!repairCar.getSolver().isEmpty()){ - variables.put("userIds", repairCar.getSolver()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Repair_Car.getId()+"-"+repairCar.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(repairCar.getId(), repairCar.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - repairCar.setProcessid(processInstance.getId()); - repairCar.setProcessdefid(processDefinitions.get(0).getId()); -// repairCar.setStatus("已提交"); - }else{ - throw new RuntimeException(); - } - int res=this.update(repairCar); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(repairCar); - businessUnitRecord.sendMessage(repairCar.getSolver(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - public int updateStatus(String id) { - RepairCar repairCar = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(repairCar.getProcessid()).list(); - if (task!=null && task.size()>0) { - repairCar.setStatus(task.get(0).getName()); - }else{ - repairCar.setStatus("已审核"); - } - int res =this.update(repairCar); - return res; - } -} diff --git a/src/com/sipai/service/maintenance/impl/RepairServiceImpl.java b/src/com/sipai/service/maintenance/impl/RepairServiceImpl.java deleted file mode 100644 index cc4a2bc9..00000000 --- a/src/com/sipai/service/maintenance/impl/RepairServiceImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.RepairDao; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.maintenance.Repair; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.StockCheck; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.maintenance.RepairService; -import com.sipai.service.user.UserService; - -@Service -public class RepairServiceImpl implements RepairService{ - @Resource - private RepairDao repairDao; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Resource - private UserService userService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - - @Override - public Repair selectById(String id) { - - Repair item=repairDao.selectByPrimaryKey(id); - //维修类型 - EquipmentPlanType eqPlanType=this.equipmentPlanTypeService.selectById(item.getRepairType()); - item.setRepairTypeName(eqPlanType.getName()); - //接收人员们 - String[] receiveUserids=item.getReceiveUserIds().split(","); - if(receiveUserids!=null&&receiveUserids.length>0){ - String receiveUsersName=""; - for(int u=0;u0){ - item.setReceiveUsersName(receiveUsersName.substring(0, receiveUsersName.length()-1)); - } - } - //接收人员 - User user=this.userService.getUserById(item.getReceiveUserId()); - if(user!=null){ - item.setReceiveUserName(user.getCaption()); - } - //设备 - EquipmentCard eCard=this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(eCard); - - return item; - } - - @Override - public int deleteById(String id) { - return repairDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Repair entity) { - return repairDao.insert(entity); - } - - @Override - public int update(Repair entity) { - return repairDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Repair entity = new Repair(); - entity.setWhere(wherestr); - List list = this.repairDao.selectListByWhere(entity); - for (Repair item : list) { - //维修类型 - EquipmentPlanType eqPlanType=this.equipmentPlanTypeService.selectById(item.getRepairType()); - item.setRepairTypeName(eqPlanType.getName()); - //接收人员们 - String[] receiveUserids=item.getReceiveUserIds().split(","); - if(receiveUserids!=null&&receiveUserids.length>0){ - String receiveUsersName=""; - for(int u=0;u0){ - item.setReceiveUsersName(receiveUsersName.substring(0, receiveUsersName.length()-1)); - } - } - //接收人员 - User user=this.userService.getUserById(item.getReceiveUserId()); - if(user!=null){ - item.setReceiveUserName(user.getCaption()); - } - //设备 - EquipmentCard eCard=this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(eCard); - - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Repair entity = new Repair(); - entity.setWhere(wherestr); - return repairDao.deleteByWhere(entity); - } - - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - Repair entity = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).singleResult(); - if (task!=null) { - entity.setProcessStatus(task.getName()); - }else{ - entity.setProcessStatus(SparePartCommString.STATUS_CHECK_FINISH); - } - int res =this.update(entity); - return res; - } - - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - -} diff --git a/src/com/sipai/service/maintenance/impl/WorkorderLibraryMaintainServiceImpl.java b/src/com/sipai/service/maintenance/impl/WorkorderLibraryMaintainServiceImpl.java deleted file mode 100644 index bbb553ac..00000000 --- a/src/com/sipai/service/maintenance/impl/WorkorderLibraryMaintainServiceImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -package com.sipai.service.maintenance.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.maintenance.*; -import com.sipai.entity.user.Company; -import com.sipai.service.company.CompanyService; -import com.sipai.service.maintenance.*; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.maintenance.WorkorderLibraryMaintainDao; -import com.sipai.tools.CommUtil; -@Service -public class WorkorderLibraryMaintainServiceImpl implements WorkorderLibraryMaintainService{ - @Resource - private WorkorderLibraryMaintainDao workorderLibraryMaintainDao; - @Resource - private LibraryMaintenanceCommonService libraryMaintenanceCommonService; - @Resource - private LibraryMaintenanceLubricationService libraryMaintenanceLubricationService; - @Resource - private CompanyService companyService; - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - - @Override - public WorkorderLibraryMaintain selectById(String id) { - return workorderLibraryMaintainDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return workorderLibraryMaintainDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WorkorderLibraryMaintain entity) { - return workorderLibraryMaintainDao.insert(entity); - } - - @Override - public int update(WorkorderLibraryMaintain entity) { - return workorderLibraryMaintainDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WorkorderLibraryMaintain entity = new WorkorderLibraryMaintain(); - entity.setWhere(wherestr); - List list = workorderLibraryMaintainDao.selectListByWhere(entity); - /*for (WorkorderLibraryMaintain workorderLibraryMaintain : list) { - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById4part(workorderLibraryMaintain.getLibraryId()); - workorderLibraryMaintain.setLibraryMaintenanceCommon(libraryMaintenanceCommon); - }*/ - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WorkorderLibraryMaintain workorderLibraryMaintain = new WorkorderLibraryMaintain(); - workorderLibraryMaintain.setWhere(wherestr); - return workorderLibraryMaintainDao.deleteByWhere(workorderLibraryMaintain); - } - - @Override - public WorkorderLibraryMaintain selectByWhere(String wherestr) { - WorkorderLibraryMaintain workorderLibraryMaintain = new WorkorderLibraryMaintain(); - workorderLibraryMaintain.setWhere(wherestr); - return workorderLibraryMaintainDao.selectByWhere(workorderLibraryMaintain); - } - - @Transactional - public int saveLibrary(String id, String libraryIds, String type, String unitId,String equipmentId) { - int result = 0; - String[] idArrary = libraryIds.split(","); - - String ids = ""; - for (String str : idArrary) { - if(str != null && !str.isEmpty()){ - WorkorderLibraryMaintain workorderLibraryMaintain = new WorkorderLibraryMaintain(); - workorderLibraryMaintain.setPid(id); - workorderLibraryMaintain.setLibraryId(str); - workorderLibraryMaintain.setType(type); - - float actualWorkTime = 0;//工单实际工时 - //通用 - if(type!=null && type.equals(EquipmentPlanType.Type_Ty)){ - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById(str); - if(libraryMaintenanceCommon!=null){ - actualWorkTime = libraryMaintenanceCommon.getInsideRepairTime(); - } - } - //润滑 - if(type!=null && type.equals(EquipmentPlanType.Type_Rh)){ - LibraryMaintenanceLubrication libraryMaintenanceLubrication = libraryMaintenanceLubricationService.selectById(str); - if(libraryMaintenanceLubrication!=null){ - actualWorkTime = libraryMaintenanceLubrication.getInsideRepairTime(); - } - } - //防腐 - if(type!=null && type.equals(EquipmentPlanType.Type_Ff)){ - - } - //仪表 - if(type!=null && type.equals(EquipmentPlanType.Type_Yb)){ - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById(str); - if(libraryMaintenanceCommon!=null){ - actualWorkTime = libraryMaintenanceCommon.getInsideRepairTime(); - } - } - //维修 - if(type!=null && type.equals(EquipmentPlanType.Type_Wx)){ - LibraryRepairBloc libraryRepairBloc = libraryRepairBlocService.selectById4FaultAndBiz(str,unitId,equipmentId); - if(libraryRepairBloc!=null){ - if(libraryRepairBloc.getLibraryRepairEquBiz()!=null){ - actualWorkTime = libraryRepairBloc.getLibraryRepairEquBiz().getInsideRepairTime(); - } - } - } - - workorderLibraryMaintain.setWhere("where pid = '"+id+"' and library_id = '"+str+"'"); - WorkorderLibraryMaintain entitywork = workorderLibraryMaintainDao.selectByWhere(workorderLibraryMaintain); - if(entitywork!=null){ - //修改 - workorderLibraryMaintain.setId(entitywork.getId()); - workorderLibraryMaintain.setActualWorkTime(entitywork.getActualWorkTime()); - result += this.workorderLibraryMaintainDao.updateByPrimaryKeySelective(workorderLibraryMaintain); - }else { - //新增 - workorderLibraryMaintain.setId(CommUtil.getUUID()); - workorderLibraryMaintain.setActualWorkTime(actualWorkTime);//工单实际工时在导入时候赋值库中的值,修改时候不处理 - result += this.workorderLibraryMaintainDao.insert(workorderLibraryMaintain); - } - } - ids += "'"+ str +"',"; - } - //删除未勾选的内容 - if(ids!=null && !ids.equals("")){ - ids = ids.substring(0, ids.length()-1); - WorkorderLibraryMaintain workorderdelete = new WorkorderLibraryMaintain(); - workorderdelete.setWhere("where pid = '"+id+"' and library_id not in ("+ids+")"); - this.workorderLibraryMaintainDao.deleteByWhere(workorderdelete); - } - return result; - } - - @Override - public List selectListByWhereTy(String wherestr) { - WorkorderLibraryMaintain entity = new WorkorderLibraryMaintain(); - entity.setWhere(wherestr); - List list = workorderLibraryMaintainDao.selectListByWhere(entity); - for (WorkorderLibraryMaintain workorderLibraryMaintain : list) { - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById4part(workorderLibraryMaintain.getLibraryId()); - workorderLibraryMaintain.setLibraryMaintenanceCommon(libraryMaintenanceCommon); - } - return list; - } - - @Override - public List selectListByWhereRh(String wherestr) { - WorkorderLibraryMaintain entity = new WorkorderLibraryMaintain(); - entity.setWhere(wherestr); - List list = workorderLibraryMaintainDao.selectListByWhere(entity); - for (WorkorderLibraryMaintain workorderLibraryMaintain : list) { - LibraryMaintenanceLubrication libraryMaintenanceLubrication = libraryMaintenanceLubricationService.selectById4part(workorderLibraryMaintain.getLibraryId()); - workorderLibraryMaintain.setLibraryMaintenanceLubrication(libraryMaintenanceLubrication); - } - return list; - } - - @Override - public List selectListByWhereYb(String wherestr) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List selectListByWhereWx(String wherestr,String unitId,String equipmentId) { - WorkorderLibraryMaintain entity = new WorkorderLibraryMaintain(); - entity.setWhere(wherestr); - List list = workorderLibraryMaintainDao.selectListByWhere(entity); - for (WorkorderLibraryMaintain workorderLibraryMaintain : list) { - //如果配置了所属标准库则 查看对应的业务区库 - String libraryUnitId = ""; - Company company = companyService.selectByPrimaryKey(unitId); - if(company!=null && company.getLibraryBizid()!=null && !company.getLibraryBizid().equals("")){ - libraryUnitId = company.getLibraryBizid(); - }else { - libraryUnitId = unitId; - } - LibraryRepairBloc libraryRepairBloc = libraryRepairBlocService.selectById4FaultAndBiz(workorderLibraryMaintain.getLibraryId(),unitId,equipmentId); - if(libraryRepairBloc!=null){ - workorderLibraryMaintain.setLibraryRepairBloc(libraryRepairBloc); - } - } - return list; - } - - @Override - public WorkorderLibraryMaintain selectByIdTy(String id) { - WorkorderLibraryMaintain workorderLibraryMaintain = workorderLibraryMaintainDao.selectByPrimaryKey(id); - if(workorderLibraryMaintain!=null){ - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById4part(workorderLibraryMaintain.getLibraryId()); - workorderLibraryMaintain.setLibraryMaintenanceCommon(libraryMaintenanceCommon); - } - return workorderLibraryMaintain; - } - - @Override - public WorkorderLibraryMaintain selectByIdRh(String id) { - WorkorderLibraryMaintain workorderLibraryMaintain = workorderLibraryMaintainDao.selectByPrimaryKey(id); - if(workorderLibraryMaintain!=null){ - LibraryMaintenanceLubrication libraryMaintenanceLubrication = libraryMaintenanceLubricationService.selectById4part(workorderLibraryMaintain.getLibraryId()); - workorderLibraryMaintain.setLibraryMaintenanceLubrication(libraryMaintenanceLubrication); - } - return workorderLibraryMaintain; - } - - @Override - public WorkorderLibraryMaintain selectByIdYb(String id) { - WorkorderLibraryMaintain workorderLibraryMaintain = workorderLibraryMaintainDao.selectByPrimaryKey(id); - if(workorderLibraryMaintain!=null){ - LibraryMaintenanceCommon libraryMaintenanceCommon = libraryMaintenanceCommonService.selectById4part(workorderLibraryMaintain.getLibraryId()); - workorderLibraryMaintain.setLibraryMaintenanceCommon(libraryMaintenanceCommon); - } - return workorderLibraryMaintain; - } - - @Override - public WorkorderLibraryMaintain selectByIdWx(String id,String unitId,String equipmentId) { - WorkorderLibraryMaintain workorderLibraryMaintain = workorderLibraryMaintainDao.selectByPrimaryKey(id); - if(workorderLibraryMaintain!=null){ - LibraryRepairBloc libraryRepairBloc = libraryRepairBlocService.selectById4FaultAndBiz(workorderLibraryMaintain.getLibraryId(),unitId,equipmentId); - workorderLibraryMaintain.setLibraryRepairBloc(libraryRepairBloc); - } - return workorderLibraryMaintain; - } - -} diff --git a/src/com/sipai/service/model/ModelSetValueService.java b/src/com/sipai/service/model/ModelSetValueService.java deleted file mode 100644 index 120946eb..00000000 --- a/src/com/sipai/service/model/ModelSetValueService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.model; - -import com.sipai.entity.model.ModelSetValue; - -import java.util.List; - -public interface ModelSetValueService { - - /** - * 查询潮汐表 - * - * @param where - * @return - */ - public List selectListByWhereTide(String where, String num); - - /** - * 查询压力表 - * - * @param where - * @return - */ - public List selectListByWherePressure(String where, String num); - -} diff --git a/src/com/sipai/service/model/impl/ModelSetValueServiceImpl.java b/src/com/sipai/service/model/impl/ModelSetValueServiceImpl.java deleted file mode 100644 index 270b6d38..00000000 --- a/src/com/sipai/service/model/impl/ModelSetValueServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.model.impl; - -import com.sipai.dao.model.ModelSetValueDao; -import com.sipai.entity.model.ModelSetValue; -import com.sipai.service.model.ModelSetValueService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service("modelSetValueService") -public class ModelSetValueServiceImpl implements ModelSetValueService { - @Resource - private ModelSetValueDao modelSetValueDao; - - @Override - public List selectListByWhereTide(String where, String num) { -// ModelSetValue modelSetValue = new ModelSetValue(); -// modelSetValue.setWhere(where); - return modelSetValueDao.selectListByWhereTide(where, num); - } - - @Override - public List selectListByWherePressure(String where, String num) { -// ModelSetValue modelSetValue = new ModelSetValue(); -// modelSetValue.setWhere(where); - return modelSetValueDao.selectListByWherePressure(where, num); - } -} diff --git a/src/com/sipai/service/msg/EmppAdminService.java b/src/com/sipai/service/msg/EmppAdminService.java deleted file mode 100644 index 370b1e4c..00000000 --- a/src/com/sipai/service/msg/EmppAdminService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.msg; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.msg.EmppAdminDao; -import com.sipai.entity.msg.EmppAdmin; -import com.sipai.tools.CommService; - -@Service -public class EmppAdminService implements CommService{ - @Resource - private EmppAdminDao emppadminDao; - - @Override - public EmppAdmin selectById(String id) { - return emppadminDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return emppadminDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EmppAdmin entity) { - return emppadminDao.insert(entity); - } - - @Override - public int update(EmppAdmin t) { - return emppadminDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - EmppAdmin emppadmin = new EmppAdmin(); - emppadmin.setWhere(wherestr); - return emppadminDao.selectListByWhere(emppadmin); - } - - @Override - public int deleteByWhere(String wherestr) { - EmppAdmin emppadmin = new EmppAdmin(); - emppadmin.setWhere(wherestr); - return emppadminDao.deleteByWhere(emppadmin); - } - -} diff --git a/src/com/sipai/service/msg/EmppSendService.java b/src/com/sipai/service/msg/EmppSendService.java deleted file mode 100644 index 56e6ceaf..00000000 --- a/src/com/sipai/service/msg/EmppSendService.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.sipai.service.msg; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.entity.msg.EmppAdmin; -import com.sipai.dao.msg.EmppSendDao; -import com.sipai.entity.msg.EmppSend; -import com.sipai.tools.CommService; -import com.wondertek.esmp.esms.empp.EMPPConnectResp; -import com.wondertek.esmp.esms.empp.EmppApi; - -@Service -public class EmppSendService implements CommService{ - @Resource - private EmppSendDao emppsendDao; - - @Override - public EmppSend selectById(String id) { - return emppsendDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return emppsendDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EmppSend entity) { - return emppsendDao.insert(entity); - } - - @Override - public int update(EmppSend t) { - return emppsendDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - EmppSend emppsend = new EmppSend(); - emppsend.setWhere(wherestr); - return emppsendDao.selectListByWhere(emppsend); - } - - @Override - public int deleteByWhere(String wherestr) { - EmppSend emppsend = new EmppSend(); - emppsend.setWhere(wherestr); - return emppsendDao.deleteByWhere(emppsend); - } - public void dosendmsg(ArrayList elist,ArrayList alist,String message){ - String host =elist.get(0).getHost(); - int port = elist.get(0).getPort(); - String accountId = elist.get(0).getAccountid(); - String password = elist.get(0).getPassword(); - String serviceId = elist.get(0).getServiceid(); - - - - EmppApi emppApi = new EmppApi(); - RecvListener listener = new RecvListener(emppApi); - - try { - //建立同服务器的连接 - EMPPConnectResp response = emppApi.connect(host, port, accountId, - password, listener); - System.out.println(response); - if (response == null) { - System.out.println("连接超时失败"); - return; - } - if (!emppApi.isConnected()) { - System.out.println("连接失败:响应包状态位=" + response.getStatus()); - return; - } - } catch (Exception e) { - System.out.println("发生异常,导致连接失败"); - e.printStackTrace(); - return; - } - -// 发送短信 - if (emppApi.isSubmitable()) { -// String mobile=""; - for(int i=0;i { - @Resource - private EmppSendUserDao emppsenduserDao; - @Resource - private UserService userService; - - @Override - public EmppSendUser selectById(String id) { - return emppsenduserDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return emppsenduserDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EmppSendUser entity) { - return emppsenduserDao.insert(entity); - } - - @Override - public int update(EmppSendUser t) { - return emppsenduserDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - EmppSendUser emppsenduser = new EmppSendUser(); - emppsenduser.setWhere(wherestr); - List list = emppsenduserDao.selectListByWhere(emppsenduser); - for (EmppSendUser entity : list) { - User user = userService.getUserById(entity.getRecuserid()); - if (user != null) { - entity.setRecusername(user.getCaption()); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EmppSendUser emppsenduser = new EmppSendUser(); - emppsenduser.setWhere(wherestr); - return emppsenduserDao.deleteByWhere(emppsenduser); - } - -} diff --git a/src/com/sipai/service/msg/FrequentContactsService.java b/src/com/sipai/service/msg/FrequentContactsService.java deleted file mode 100644 index df4dce7d..00000000 --- a/src/com/sipai/service/msg/FrequentContactsService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.msg; - -import com.sipai.dao.msg.FrequentContactsDao; -import com.sipai.entity.msg.FrequentContacts; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class FrequentContactsService implements CommService { - @Resource - private FrequentContactsDao frequentContactsDao; - @Resource - private UserService userService; - - @Override - public FrequentContacts selectById(String t) { - return frequentContactsDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return frequentContactsDao.deleteByPrimaryKey(t); - } - - @Override - public int save(FrequentContacts frequentContacts) { - return frequentContactsDao.insert(frequentContacts); - } - - @Override - public int update(FrequentContacts frequentContacts) { - return frequentContactsDao.updateByPrimaryKeySelective(frequentContacts); - } - - @Override - public List selectListByWhere(String t) { - FrequentContacts entity = new FrequentContacts(); - entity.setWhere(t); - List list = frequentContactsDao.selectListByWhere(entity); - for (FrequentContacts frequentContacts : list) { - User user = userService.getUserById(frequentContacts.getUserId()); - if (user != null) { - frequentContacts.setUserName(user.getCaption()); - frequentContacts.setMobile(user.getMobile()); - } - } - return list; - } - - @Override - public int deleteByWhere(String t) { - FrequentContacts entity = new FrequentContacts(); - entity.setWhere(t); - return frequentContactsDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/msg/MsgAlarmlevelService.java b/src/com/sipai/service/msg/MsgAlarmlevelService.java deleted file mode 100644 index f0c60d34..00000000 --- a/src/com/sipai/service/msg/MsgAlarmlevelService.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.sipai.service.msg; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; -import com.sipai.dao.msg.MsgAlarmlevelDao; -import com.sipai.dao.msg.MsguserDao; -import com.sipai.dao.msg.SmsuserDao; -import com.sipai.entity.msg.MsgAlarmlevel; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.msg.Msguser; -import com.sipai.entity.msg.Smsuser; -import com.sipai.entity.work.ScadaPic_MPoint_Expression; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class MsgAlarmlevelService implements CommService{ - @Resource - private MsgAlarmlevelDao msgAlarmlevelDao; - @Resource - private MsgTypeService msgtypeService; - @Resource - private MsguserService msguserService; - @Resource - private SmsuserService smsuserService; - @Override - public MsgAlarmlevel selectById(String id) { - // TODO Auto-generated method stub - MsgAlarmlevel msgAlarmlevel=msgAlarmlevelDao.selectByPrimaryKey(id); - List msgusers =msguserService.selectListByWhere("where masterid='"+msgAlarmlevel.getId()+"'"); - msgAlarmlevel.setMsgusers(msgusers); - List smsusers =smsuserService.selectListByWhere("where masterid='"+msgAlarmlevel.getId()+"'"); - msgAlarmlevel.setSmsusers(smsusers); - return msgAlarmlevel; - } - - @Override - public int deleteById(String id) { - // TODO Auto-generated method stub - MsgAlarmlevel item =this.selectById(id); - smsuserService.deleteByWhere("where masterid='"+item.getId()+"'"); - msguserService.deleteByWhere("where masterid='"+item.getId()+"'"); - return msgAlarmlevelDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MsgAlarmlevel entity) { - // TODO Auto-generated method stub - return msgAlarmlevelDao.insert(entity); - } - @Transactional - public int saveMsgAlarmLevel(MsgAlarmlevel entity,String msguserids,String smsuserids) { - int result=0; - try{ - result =msgAlarmlevelDao.insert(entity); - if (result==1) { - String[] ids =msguserids.split(","); - for (String str : ids) { - if(!str.isEmpty()){ - Msguser msguser =new Msguser(); - msguser.setId(CommUtil.getUUID()); - msguser.setInsdt(new Date()); - msguser.setInsuser(entity.getInsuser()); - msguser.setMasterid(entity.getId()); - msguser.setUserid(str); - msguserService.save(msguser); - } - } - ids =smsuserids.split(","); - for (String str : ids) { - if(!str.isEmpty()){ - Smsuser smsuser =new Smsuser(); - smsuser.setId(CommUtil.getUUID()); - smsuser.setInsdt(new Date()); - smsuser.setInsuser(entity.getInsuser()); - smsuser.setMasterid(entity.getId()); - smsuser.setUserid(str); - smsuserService.save(smsuser); - } - } - } - }catch(Exception e){ - e.printStackTrace(); - throw new RuntimeException(); - } - // TODO Auto-generated method stub - return result; - } - @Transactional - public int updateMsgAlarmLevel(MsgAlarmlevel entity,String msguserids,String smsuserids) { - int result=0; - try{ - result =msgAlarmlevelDao.updateByPrimaryKeySelective(entity); - if (result==1) { - msguserService.deleteByWhere("where masterid='"+entity.getId()+"'"); - String[] ids =msguserids.split(","); - for (String str : ids) { - if(!str.isEmpty()){ - Msguser msguser =new Msguser(); - msguser.setId(CommUtil.getUUID()); - msguser.setInsdt(new Date()); - msguser.setInsuser(entity.getInsuser()); - msguser.setMasterid(entity.getId()); - msguser.setUserid(str); - msguserService.save(msguser); - } - } - smsuserService.deleteByWhere("where masterid='"+entity.getId()+"'"); - ids =smsuserids.split(","); - for (String str : ids) { - if(!str.isEmpty()){ - Smsuser smsuser =new Smsuser(); - smsuser.setId(CommUtil.getUUID()); - smsuser.setInsdt(new Date()); - smsuser.setInsuser(entity.getInsuser()); - smsuser.setMasterid(entity.getId()); - smsuser.setUserid(str); - smsuserService.save(smsuser); - } - } - } - }catch(Exception e){ - e.printStackTrace(); - throw new RuntimeException(); - } - // TODO Auto-generated method stub - return result; - } - @Override - public int update(MsgAlarmlevel entity) { - // TODO Auto-generated method stub - return msgAlarmlevelDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MsgAlarmlevel msgAlarmlevel = new MsgAlarmlevel(); - msgAlarmlevel.setWhere(wherestr); - List msgAlarmlevels =msgAlarmlevelDao.selectListByWhere(msgAlarmlevel); - for (MsgAlarmlevel item : msgAlarmlevels) { - List msgusers =msguserService.selectListByWhere("where masterid='"+item.getId()+"'"); - item.setMsgusers(msgusers); - List smsusers =smsuserService.selectListByWhere("where masterid='"+item.getId()+"'"); - item.setSmsusers(smsusers); - } - return msgAlarmlevels; - } - - @Override - public int deleteByWhere(String wherestr) { - MsgAlarmlevel msgAlarmlevel = new MsgAlarmlevel(); - msgAlarmlevel.setWhere(wherestr); - List msgAlarmlevels=msgAlarmlevelDao.selectListByWhere(msgAlarmlevel); - for (MsgAlarmlevel item : msgAlarmlevels) { - smsuserService.deleteByWhere("where masterid='"+item.getId()+"'"); - msguserService.deleteByWhere("where masterid='"+item.getId()+"'"); - } - return msgAlarmlevelDao.deleteByWhere(msgAlarmlevel); - } - /** - * 根据value的值判断消息的发送 - * **/ - public MsgAlarmlevel alarmLevel(String mid,double value) { - List list= this.selectListByWhere("where state ='"+mid+"' order by insdt asc"); - for (MsgAlarmlevel msgAlarmlevel : list) { - if(msgAlarmlevel.getMsgrole().isEmpty()){ - continue; - } - String[] list_strs = msgAlarmlevel.getMsgrole().split(","); - boolean flag =false ; - for (String str : list_strs) { - char firstChar =str.charAt(0); - - switch (firstChar) { - case '>': - double t = Double.valueOf(str.replace(">", "")); - if(value>t){ - flag=true; - } - break; - case '<': - t = Double.valueOf(str.replace("<", "")); - if(value 0) { - MsgRecv cr = new MsgRecv(); - cr.setId(CommUtil.getUUID()); - cr.setMasterid(masterid); - cr.setStatus("U"); - cr.setUnitid(recvids[i]); - cr.setDelflag("FALSE"); - cr.setInsdt(new Date()); - cr.setRedflag(redflag); - this.msgrecvDao.insert(cr); - cr = null; - } - } - } - @Override - public int updateMsgRecvBySetAndWhere(String setandwhere) { - - MsgRecv sMsgRecv = new MsgRecv(); - sMsgRecv.setWhere(setandwhere); - // TODO Auto-generated method stub - return this.msgrecvDao.updateBySetAndWhere(sMsgRecv); - } -}//end diff --git a/src/com/sipai/service/msg/MsgService.java b/src/com/sipai/service/msg/MsgService.java deleted file mode 100644 index e5e4d734..00000000 --- a/src/com/sipai/service/msg/MsgService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.service.msg; - -import java.util.List; - -import com.sipai.entity.msg.Msg; - -public interface MsgService { - public Msg getMsgById(String msg); - - public int saveMsg(Msg msg); - - public int updateMsgById(Msg msg); - - public int deleteMsgById(String msgId); - - public int deleteMsgByWhere(String whereStr); - - public int deleteById(String id); - - public int deleteByWhere(String wherestr); - - public List selectList(); - - public List selectListByWhere(String wherestr); - - public List getMsgrecv(String wherestr); - - public int updateMsgBySetAndWhere(String setandwhere); - - public List getMsgrecv_RU(String wherestr); - - public List getMsgrecvNum(String wherestr); - - public String sendNewsFromAlarm(String sendType,String sender,String content,String msgtypeid,String getreceivers); - -} diff --git a/src/com/sipai/service/msg/MsgServiceImpl.java b/src/com/sipai/service/msg/MsgServiceImpl.java deleted file mode 100644 index 915acfff..00000000 --- a/src/com/sipai/service/msg/MsgServiceImpl.java +++ /dev/null @@ -1,1551 +0,0 @@ -package com.sipai.service.msg; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.annotation.Resource; - -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.tools.MqttUtil; -import net.sf.json.JSONException; -import net.sf.json.JSONObject; - -import org.apache.http.client.ClientProtocolException; -import org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import com.google.gson.JsonObject; -import com.sipai.controller.msg.Client; -import com.sipai.dao.msg.MsgDao; -import com.sipai.entity.msg.EmppAdmin; -import com.sipai.entity.msg.EmppSendUser; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.msg.MsgAlarmlevel; -import com.sipai.entity.msg.MsgRecv; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.msg.Msguser; -import com.sipai.entity.msg.Smsuser; -import com.sipai.entity.user.User; -import com.sipai.entity.alarm.AlarmInformationAlarmModeEnum; -import com.sipai.entity.base.ServerObject; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.WeChatAuthUtil; -import com.sipai.websocket.MsgWebSocket; -import com.sipai.websocket.ScadaWebSocket; - -@Service("msgService") -public class MsgServiceImpl implements MsgService { - @Resource - private MsgDao msgDao; - @Resource - private MsgRecvService msgrecvService; - @Resource - private UserService userService; - @Resource - private MsgTypeService msgtypeService; - @Resource - private EmppAdminService emppadminService; - @Resource - private EmppSendService emppsendService; - @Resource - private EmppSendUserService emppsenduserService; - @Resource - private MsgAlarmlevelService msgAlarmlevelService; - @Resource - private RedissonClient redissonClient; - - public static String title = "【运管平台】"; - - @Override - public Msg getMsgById(String msgId) { - // TODO Auto-generated method stub - return this.msgDao.selectByPrimaryKey(msgId); - } - - @Override - public int saveMsg(Msg msg) { - // TODO Auto-generated method stub - return this.msgDao.insert(msg); - } - - @Override - public int updateMsgById(Msg msg) { - // TODO Auto-generated method stub - return this.msgDao.updateByPrimaryKeySelective(msg); - } - - @Override - public int deleteById(String id) { - return this.msgDao.deleteByPrimaryKey(id); - } - - @Override - public int deleteByWhere(String wherestr) { - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.deleteByWhere(msg); - } - - @Override - public int deleteMsgById(String msgId) { - // TODO Auto-generated method stub - return this.msgDao.deleteByPrimaryKey(msgId); - } - - @Override - public int deleteMsgByWhere(String whereStr) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(whereStr); - return this.msgDao.deleteByWhere(msg); - } - - @Override - public List selectList() { - // TODO Auto-generated method stub - Msg msg = new Msg(); - return this.msgDao.selectList(msg); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.selectListByWhere(msg); - } - - @Override - //getMsgrecv联表查询取得符合条件的msg,不局限于接收或者发送者使用。 - public List getMsgrecv(String wherestr) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.getMsgrecv(msg); - } - - @Override - public List getMsgrecvNum(String wherestr) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.getMsgrecvNum(msg); - } - - @Override - //获取实时表中的信息 - public List getMsgrecv_RU(String wherestr) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.getMsgrecv_RU(msg); - } - - public List getMsgsend(String wherestr) { - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.getMsgsend(msg); - } - - public List getMsgsendlist(String wherestr) { - Msg msg = new Msg(); - msg.setWhere(wherestr); - List list = this.msgDao.getMsgsendlist(msg); - return list; - } - - /** - * 要去查emppsenduser表 用getMsgsendlist会影响效率 - * - * @param wherestr - * @return - */ - public List getMsgsendlistMobile(String wherestr) { - Msg msg = new Msg(); - msg.setWhere(wherestr); - List list = this.msgDao.getMsgsendlist(msg); - for (Msg msg1 : list) { - List list1 = emppsenduserService.selectListByWhere("where emppSendid = '" + msg1.getId() + "'"); - if (list1 != null && list1.size() > 0) { - String r_userName = ""; - String r_userMobile = ""; - for (int i = 0; i < list1.size(); i++) { - r_userName += list1.get(i).getRecusername() + ","; - r_userMobile += list1.get(i).getMobile() + ","; - } - if (r_userName != null && !r_userName.equals("")) { - r_userName = r_userName.substring(0, r_userName.length() - 1); - } - if (r_userMobile != null && !r_userMobile.equals("")) { - r_userMobile = r_userMobile.substring(0, r_userMobile.length() - 1); - } - msg1.setRecvUserName(r_userName); - msg1.setRecvUserMobile(r_userMobile); - } - } - return list; - } - - public List getMsgrecvTop1(String wherestr) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(wherestr); - return this.msgDao.getMsgrecvTop1(msg); - } - - @Override - public int updateMsgBySetAndWhere(String setandwhere) { - // TODO Auto-generated method stub - Msg msg = new Msg(); - msg.setWhere(setandwhere); - return this.msgDao.updateBySetAndWhere(msg); - } - /*public String proxy(Msg msg){ - if(ServerObject.getAtttable().get("OASERVER")!=null){ - CommSQL cs= new CommSQL(); - //cs.setDbservername(ServerObject.getAtttable().get("OASERVER")); - cs.setXservername(ServerObject.getAtttable().get("OASERVER")); - try{ - if(msg.get_recvid()!=null){ - for(int i = 0;i msgusers = msgAlarmlevel.getMsgusers(); - String msguserstrs = ""; - for (Msguser msguser : msgusers) { - if (!msguserstrs.isEmpty()) { - msguserstrs += ","; - } - msguserstrs += msguser.getUserid(); - } - //短信接收人 - List smsusers = msgAlarmlevel.getSmsusers(); - -// MsgType mtype=this.msgtypeService.getMsgType(" where T.id='"+msgtypeid+"' order by T.insdt").get(0); - String sendway = msgAlarmlevel.getSendway(); - - Msg msg = new Msg(); - msg.setContent(content); - String msgId = CommUtil.getUUID(); - msg.setId(msgId); - msg.setSdt(CommUtil.nowDate()); - msg.setInsdt(CommUtil.nowDate()); - msg.setInsuser(cuid); - msg.setDelflag("FALSE"); - msg.setTypeid(msgtypeid); - msg.setSuserid(cuid); - msg.setIssms("msg"); - msg.setRedflag(Msg.UnReadFlag); - msg.setSendview("1");//default - if (!sendway.equals("sms")) { - //仅消息 - result = this.saveMsg(msg); - this.msgrecvService.saveRecv(msguserstrs, msg.getId(), msg.getRedflag()); - if (sendway.equals("both")) { - //消息+短信: - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[smsusers.size()]; - for (int i = 0; i < smsusers.size(); i++) { - if (!smsusers.get(i).getUserid().isEmpty()) { - userlist.add(this.userService.getUserById(smsusers.get(i).getUserid())); - mobilearr[i] = this.userService.getUserById(smsusers.get(i).getUserid()).getMobile(); - //recvidlist.add(recvids[i]); - } - } - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - //保存短信 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - } - } - } else { - //仅发短信 - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[smsusers.size()]; - for (int i = 0; i < smsusers.size(); i++) { - if (!smsusers.get(i).getUserid().isEmpty()) { - userlist.add(this.userService.getUserById(smsusers.get(i).getUserid())); - mobilearr[i] = this.userService.getUserById(smsusers.get(i).getUserid()).getMobile(); - //recvidlist.add(recvids[i]); - } - } - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - - } - } - //websocket发动推松到前台 - for (Map item : MsgWebSocket.webSocketSet) { - for (Msguser msguser : msgusers) { - if (item.get("key").equals(msguser.getUserid())) { - try { - ((MsgWebSocket) item.get("ws")).sendMessage(content); - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - - } - if (result == 1) { - return "发送成功"; - } else { - return "发送失败"; - } - } - - /** - * 发送短信验证码 - * - * @param mobile 手机号 - * @param content 发送内容 - * @return - */ - public boolean sendVerificationCode(String content, String mobile) { - String[] mobilearr = mobile.split(","); - int i = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //返回判断,是否发送成功 - boolean res; - if (i == 0) { - res = true; - } else { - res = false; - } - return res; - } - - /** - * 为亿美短信发送消息和手机短信的功能,发送成功的消息插入表tb_message,消息接受者列表tb_message_recv,短信接受者列表tb_empp_emppsenduser - * - * @param msgtypeid 为发送类型id,使用时可调用消息类型选择界面,或使用获得typeid函数 - * @param content 为发送手机的信息内容 - * @param recvid 为接收手机的用户id,用,区分多个 - * @param cuid 为发送手机用户id,手机发送人不允许为空,判断权限 - * @param redflag 发送消息标注红旗状态 - * @return result 发送成功,发送失败,无权限 - */ - @SuppressWarnings({"unchecked", "unused"}) - public String insertMsgSend(String msgtypeid, String content, String recvid, String cuid, String redflag) { - String mtypeid = ""; - int result = 0; - MsgType mtype = new MsgType(); - mtype = this.msgtypeService.getMsgType(" where T.id='" + msgtypeid + "' order by T.insdt").get(0); - String sendway = mtype.getSendway(); - String[] recvids = recvid.split(","); - //判断权限 - List unsendusers = new ArrayList(); - if (!mtype.getRole().isEmpty()) { - for (int i = 0; i < recvids.length; i++) { - User useri = this.userService.getUserById(recvids[i]); - List mtyperoles = mtype.getRole(); - mtyperoles.retainAll(useri.getRoles()); - if (mtyperoles.isEmpty()) { - unsendusers.add(recvids[i]); - recvids[i] = ""; - } - } - } - mtypeid = mtype.getId(); - Msg msg = new Msg(); - msg.setContent(content); - String msgId = CommUtil.getUUID(); - msg.setId(msgId); - msg.setSdt(CommUtil.nowDate()); - msg.setInsdt(CommUtil.nowDate()); - msg.setInsuser(cuid); - msg.setDelflag("FALSE"); - msg.setTypeid(mtypeid); - msg.setSuserid(cuid); - msg.setIssms("msg"); - msg.setRedflag(redflag); - msg.setSendview("1");//default - if (!sendway.equals("sms")) { - //仅消息 - result = this.saveMsg(msg); - this.msgrecvService.saveRecv(recvid, msg.getId(), msg.getRedflag()); - if (sendway.equals("both")) { - //消息+短信: - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[recvids.length]; - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - //recvidlist.add(recvids[i]); - } - } - //删除空电话号 - List strs = new ArrayList<>(); - for (String str : mobilearr) { - if (str != null && !str.isEmpty()) { - strs.add(str); - } - } - mobilearr = new String[strs.size()]; - strs.toArray(mobilearr); - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - //System.out.println("testSendSMS=====" + i1); - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - //保存短信 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - } - } - } else { - //仅发短信 - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[recvids.length]; - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - //recvidlist.add(recvids[i]); - } - } - //删除空电话号 - List strs = new ArrayList<>(); - for (String str : mobilearr) { - if (str != null && !str.isEmpty()) { - strs.add(str); - } - } - mobilearr = new String[strs.size()]; - strs.toArray(mobilearr); - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - - } - } - String unsendusername = ""; - if (!unsendusers.isEmpty()) { - for (int z = 0; z < unsendusers.size(); z++) { - unsendusername += this.userService.getUserById(unsendusers.get(z)).getCaption() + ","; - } - } - //websocket发动推松到前台 - for (Map item : MsgWebSocket.webSocketSet) { - if (item.get("key").equals(recvid)) { - try { - MsgWebSocket wss = (MsgWebSocket) item.get("ws"); - //synchronized(wss) { - wss.sendMessage(content); - //} - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - if (result == 1) { - if (sendway.equals("sms")) { - if (!unsendusername.equals("")) { - return "短信未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "短信发送成功"; - } - } else if (sendway.equals("msg")) { - if (!unsendusername.equals("")) { - return "消息未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "消息发送成功"; - } - } else { - if (!unsendusername.equals("")) { - return "未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "发送成功"; - } - } - } else { - return "发送失败"; - } - } - - @SuppressWarnings({"unchecked", "unused"}) - public String insertMsgSendMobile(String msgtypeid, String content, String recvid, String cuid, String redflag, String sendway) { - String mtypeid = ""; - int result = 0; - MsgType mtype = new MsgType(); - mtype = this.msgtypeService.getMsgType(" where T.id='" + msgtypeid + "' order by T.insdt").get(0); - if (sendway == null || !sendway.equals("")) { - sendway = mtype.getSendway(); - } - String[] recvids = recvid.split(","); - //判断权限 - List unsendusers = new ArrayList(); - if (!mtype.getRole().isEmpty()) { - for (int i = 0; i < recvids.length; i++) { - User useri = this.userService.getUserById(recvids[i]); - List mtyperoles = mtype.getRole(); - mtyperoles.retainAll(useri.getRoles()); - if (mtyperoles.isEmpty()) { - unsendusers.add(recvids[i]); - recvids[i] = ""; - } - } - } - mtypeid = mtype.getId(); - Msg msg = new Msg(); - msg.setContent(content); - String msgId = CommUtil.getUUID(); - msg.setId(msgId); - msg.setSdt(CommUtil.nowDate()); - msg.setInsdt(CommUtil.nowDate()); - msg.setInsuser(cuid); - msg.setDelflag("FALSE"); - msg.setTypeid(mtypeid); - msg.setSuserid(cuid); - msg.setIssms("msg"); - msg.setRedflag(redflag); - msg.setSendview("1");//default - if (!sendway.equals("sms")) { - //仅消息 - result = this.saveMsg(msg); - this.msgrecvService.saveRecv(recvid, msg.getId(), msg.getRedflag()); - if (sendway.equals("both")) { - //消息+短信: - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[recvids.length]; - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - //recvidlist.add(recvids[i]); - } - } - //删除空电话号 - List strs = new ArrayList<>(); - for (String str : mobilearr) { - if (str != null && !str.isEmpty()) { - strs.add(str); - } - } - mobilearr = new String[strs.size()]; - strs.toArray(mobilearr); - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - //System.out.println("testSendSMS=====" + i1); - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - //保存短信 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - } - } - } else { - //仅发短信 - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[recvids.length]; - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - //recvidlist.add(recvids[i]); - } - } - //删除空电话号 - List strs = new ArrayList<>(); - for (String str : mobilearr) { - if (str != null && !str.isEmpty()) { - strs.add(str); - } - } - mobilearr = new String[strs.size()]; - strs.toArray(mobilearr); - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - - } - } - String unsendusername = ""; - if (!unsendusers.isEmpty()) { - for (int z = 0; z < unsendusers.size(); z++) { - unsendusername += this.userService.getUserById(unsendusers.get(z)).getCaption() + ","; - } - } - //websocket发动推松到前台 - for (Map item : MsgWebSocket.webSocketSet) { - if (item.get("key").equals(recvid)) { - try { - MsgWebSocket wss = (MsgWebSocket) item.get("ws"); - //synchronized(wss) { - wss.sendMessage(content); - //} - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - if (result == 1) { - if (sendway.equals("sms")) { - if (!unsendusername.equals("")) { - return "短信未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "短信发送成功"; - } - } else if (sendway.equals("msg")) { - if (!unsendusername.equals("")) { - return "消息未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "消息发送成功"; - } - } else { - if (!unsendusername.equals("")) { - return "未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "发送成功"; - } - } - } else { - return "发送失败"; - } - } - - public String insertMsgSendMobileZY1C(String msgtypeid, String content, String recvid, String cuid, String redflag, String sendway) { - String mtypeid = ""; - int result = 0; - MsgType mtype = new MsgType(); - mtype = this.msgtypeService.getMsgType(" where T.id='" + msgtypeid + "' order by T.insdt").get(0); - if (sendway == null || !sendway.equals("")) { - sendway = mtype.getSendway(); - } - String[] recvids = recvid.split(","); - //判断权限 - List unsendusers = new ArrayList(); - if (!mtype.getRole().isEmpty()) { - for (int i = 0; i < recvids.length; i++) { - User useri = this.userService.getUserById(recvids[i]); - List mtyperoles = mtype.getRole(); - mtyperoles.retainAll(useri.getRoles()); - if (mtyperoles.isEmpty()) { - unsendusers.add(recvids[i]); - recvids[i] = ""; - } - } - } - mtypeid = mtype.getId(); - Msg msg = new Msg(); - msg.setContent(content); - String msgId = CommUtil.getUUID(); - msg.setId(msgId); - msg.setSdt(CommUtil.nowDate()); - msg.setInsdt(CommUtil.nowDate()); - msg.setInsuser(cuid); - msg.setDelflag("FALSE"); - msg.setTypeid(mtypeid); - msg.setSuserid(cuid); - msg.setIssms("msg"); - msg.setRedflag(redflag); - msg.setSendview("1");//default - if (!sendway.equals("sms")) { - //仅消息 - result = this.saveMsg(msg); - this.msgrecvService.saveRecv(recvid, msg.getId(), msg.getRedflag()); - if (sendway.equals("both")) { - //消息+短信: - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); -// String[] mobilearr = new String[recvids.length]; - /*for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - System.out.println(mobilearr[i]); - } - }*/ - - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - } - } - - RMap map_redis = redissonClient.getMap("zy1c_msg_tel"); - String tels = map_redis.get("tel"); - String[] tel = tels.split(","); - -// mobilearr[0] = "18721147110"; - - String[] mobilearr = new String[tel.length]; - for (int i = 0; i < tel.length; i++) { - mobilearr[i] = tel[i]; - } - System.out.println(mobilearr); -// mobilearr[0] = "18721147110"; - - String titleZY1C = "【竹园污水公司】"; - //删除空电话号 - List strs = new ArrayList<>(); - for (String str : mobilearr) { - if (str != null && !str.isEmpty()) { - strs.add(str); - } - } - mobilearr = new String[strs.size()]; - strs.toArray(mobilearr); - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, titleZY1C + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - //保存短信 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - if (userlist.get(ii).getMobile() != null && !userlist.get(ii).getMobile().equals("")) { - esu.setMobile(userlist.get(ii).getMobile()); - } else { - esu.setMobile("-"); - } - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - } - } - } else { - //仅发短信 - String smsid = CommUtil.getUUID(); - //发送短信 - //获得手机短信发送名单 - //ArrayList recvidlist=new ArrayList(); - List userlist = new ArrayList(); - String[] mobilearr = new String[recvids.length]; - for (int i = 0; i < recvids.length; i++) { - if (recvids[i].length() > 0) { - userlist.add(this.userService.getUserById(recvids[i])); - mobilearr[i] = this.userService.getUserById(recvids[i]).getMobile(); - //recvidlist.add(recvids[i]); - } - } - //删除空电话号 - List strs = new ArrayList<>(); - for (String str : mobilearr) { - if (str != null && !str.isEmpty()) { - strs.add(str); - } - } - mobilearr = new String[strs.size()]; - strs.toArray(mobilearr); - int i1 = 9999; - try { - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); - Properties prop = new Properties(); - prop.load(inStream); - String softwareSerialNo = prop.getProperty("softwareSerialNo"); - String key = prop.getProperty("key"); - String password = prop.getProperty("password"); - i1 = new Client(softwareSerialNo, key).registEx(password); - //System.out.println("testTegistEx:" + i1); - i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, - title + content, "", 5);// 带扩展码 - } catch (Exception e) { - e.printStackTrace(); - } - //发送成功 - if (i1 == 0) { - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //手机用户表 - for (int ii = 0; ii < userlist.size(); ii++) { - EmppSendUser esu = new EmppSendUser(); - esu.setId(CommUtil.getUUID()); - esu.setEmppsendid(smsid); - esu.setSenduserid(cuid); - esu.setSenddate(new Date()); - esu.setRecuserid(userlist.get(ii).getId()); - esu.setMobile(userlist.get(ii).getMobile()); - esu.setBackdate(null); - esu.setInsertuserid(cuid); - esu.setInsertdate(new Date()); - esu.setUpdateuserid(cuid); - esu.setUpdatedate(new Date()); - this.emppsenduserService.save(esu); - esu = null; - } - - } - } - String unsendusername = ""; - if (!unsendusers.isEmpty()) { - for (int z = 0; z < unsendusers.size(); z++) { - unsendusername += this.userService.getUserById(unsendusers.get(z)).getCaption() + ","; - } - } - //websocket发动推松到前台 - for (Map item : MsgWebSocket.webSocketSet) { - if (item.get("key").equals(recvid)) { - try { - MsgWebSocket wss = (MsgWebSocket) item.get("ws"); - //synchronized(wss) { - wss.sendMessage(content); - //} - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - if (result == 1) { - if (sendway.equals("sms")) { - if (!unsendusername.equals("")) { - return "短信未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "短信发送成功"; - } - } else if (sendway.equals("msg")) { - if (!unsendusername.equals("")) { - return "消息未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "消息发送成功"; - } - } else { - if (!unsendusername.equals("")) { - return "未全部发送,其中 【" + unsendusername + "】未向其发送,原因:消息类型角色未包含。"; - } else { - return "发送成功"; - } - } - } else { - return "发送失败"; - } - } - - /** - * 微信推送模板消息给指定的用户 - * - * @param touser 用户的openid,数据库里为wechatid字段 - * @param msgtypeid 消息类型id - * @param sender 发送人 - * @param content 内容 - * @return - * @throws IOException - * @throws ClientProtocolException - */ - public String sendMsgToUserByWeChat(String touser, String msgtypeid, String sender, String content) throws ClientProtocolException, IOException { - - //将需要推送的内容打包成json对象 - JSONObject jsonMsg = new JSONObject(); - //消息标题,存放消息的内容 - JSONObject jsonFirst = new JSONObject(); - jsonFirst.put("value", content); - jsonFirst.put("color", "#A0522D"); - jsonMsg.put("first", jsonFirst); - //时间 - JSONObject sendTime = new JSONObject(); - sendTime.put("value", CommUtil.nowDate().substring(0, 16)); - sendTime.put("color", "#A0522D"); - jsonMsg.put("keyword1", sendTime); - //发送人 - JSONObject msgSender = new JSONObject(); - msgSender.put("value", sender); - msgSender.put("color", "#A0522D"); - jsonMsg.put("keyword2", msgSender); - //备注 - JSONObject jsonRemark = new JSONObject(); - jsonRemark.put("value", ""); - jsonRemark.put("color", "#636363"); - jsonMsg.put("remark", jsonRemark); - - //获取公众号的APPID和APPSECRET - String APPID = WeChatAuthUtil.searchWeChatSources("APPID"); - String APPSECRET = WeChatAuthUtil.searchWeChatSources("APPSECRET"); - //获取accesss_token凭证 - String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APPID - + "&secret=" + APPSECRET; - JSONObject jsonObject = WeChatAuthUtil.doGetJson(url); - String token = jsonObject.getString("access_token"); - //向微信请求发送模板消息的url - String tmpurl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + token; - //通过消息类型msgtypeid判断出使用的模板id - String templat_id = ""; - switch (msgtypeid) { - case "MaintenanceId": - templat_id = WeChatAuthUtil.searchWeChatSources("MaintenanceId"); - break; - case "WorkOrderId": - templat_id = WeChatAuthUtil.searchWeChatSources("WorkOrderId"); - break; - default: - break; - } - //推送消息查看详情时跳转的地址,为空则不跳转 - String clickurl = ""; - //将推送的所有数据打包成json对象 - JSONObject json = new JSONObject(); - json.put("touser", touser); - json.put("template_id", templat_id); - json.put("url", clickurl); - json.put("data", jsonMsg); - String result = WeChatAuthUtil.httpsRequest(tmpurl, "POST", json.toString()); - try { - JSONObject resultJson = JSONObject.fromObject(result); - String errmsg = (String) resultJson.get("errmsg"); - if (!"ok".equals(errmsg)) { //如果为errmsg为ok,则代表发送成功,公众号推送信息给用户了。 - return "error"; - } - } catch (JSONException e) { - e.printStackTrace(); - } - return "success"; - } - - - /** - * 为empp发送消息和手机短信的功能,发送成功的消息插入表tb_message,消息接受者列表tb_message_recv,短信接受者列表tb_empp_emppsenduser - * - * @param msgtypeid 为发送类型id,使用时可调用消息类型选择界面,或使用获得typeid函数 - * @param content 为发送手机的信息内容 - * @return result 发送成功,发送失败,无权限 - */ /* - @SuppressWarnings("unused") - public String insertMsgSendEmpp(String msgtypeid,String content,String recvid,String cuid){ - String mtypeid=""; - int result=0; - MsgType mtype=new MsgType(); - mtype=this.msgtypeService.getMsgType(" where T.id='"+msgtypeid+"'").get(0); - String sendway=mtype.getSendway(); - String[] recvids = recvid.split(","); - //判断权限 - List unsendusers=new ArrayList(); - if(!mtype.getRole().isEmpty()){ - for(int i=0;i emppadminlist = (ArrayList)this.emppadminService.selectListByWhere(emppadminwhere+emppadminorder); - if(emppadminlist!=null && emppadminlist.size()>=1){ - emppAdminid=emppadminlist.get(0).getId(); - try{ - com.sipai.tools.EncryptionDecryption en=new com.sipai.tools.EncryptionDecryption("usertel"); - emppadminlist.get(0).setAccountid(en.decrypt(emppadminlist.get(0).getAccountid())); - emppadminlist.get(0).setAccname(en.decrypt(emppadminlist.get(0).getAccname())); - emppadminlist.get(0).setPassword(en.decrypt(emppadminlist.get(0).getPassword())); - emppadminlist.get(0).setServiceid(en.decrypt(emppadminlist.get(0).getServiceid())); - en=null; - }catch(Exception e){ - e.printStackTrace(); - } - } - //2获得手机短信发送名单recvids - //3手机用户表 - List userlist=new ArrayList(); - for(int i=0;i 0){ - userlist.add(this.userService.getUserById(recvids[i])); - } - } - for(int ii=0;ii slist=new ArrayList(); - if(emppadminlist!=null && emppadminlist.size()>=1 && recvids.length>=1){ - for(int i=0;i(); - try{ //需要延迟1秒 - Thread.sleep(1000); //延时1秒 - }catch(InterruptedException e){} - } - } - - } - slist=null; - emppadminlist=null; - // - } - }else{ - //仅发短信 - msg.setIssms("sms"); - result = this.saveMsg(msg); - //发送短信 - //短信:0保存短信 - String smsid=CommUtil.getUUID(); - msg.setId(smsid); - msg.setIssms("sms"); - result = this.saveMsg(msg); - //发送短信:1获得手机短信管理 - String emppAdminid=""; - String emppadminwhere=" where emppname='部门短信'"; - String emppadminorder=" order by id"; - ArrayList emppadminlist = (ArrayList)this.emppadminService.selectListByWhere(emppadminwhere+emppadminorder); - if(emppadminlist!=null && emppadminlist.size()>=1){ - emppAdminid=emppadminlist.get(0).getId(); - try{ - com.sipai.tools.EncryptionDecryption en=new com.sipai.tools.EncryptionDecryption("usertel"); - emppadminlist.get(0).setAccountid(en.decrypt(emppadminlist.get(0).getAccountid())); - emppadminlist.get(0).setAccname(en.decrypt(emppadminlist.get(0).getAccname())); - emppadminlist.get(0).setPassword(en.decrypt(emppadminlist.get(0).getPassword())); - emppadminlist.get(0).setServiceid(en.decrypt(emppadminlist.get(0).getServiceid())); - en=null; - }catch(Exception e){ - e.printStackTrace(); - } - } - //2获得手机短信发送名单recvids - //3手机用户表 - List userlist=new ArrayList(); - for(int i=0;i 0){ - userlist.add(this.userService.getUserById(recvids[i])); - } - } - for(int ii=0;ii slist=new ArrayList(); - if(emppadminlist!=null && emppadminlist.size()>=1 && recvids.length>=1){ - for(int i=0;i(); - try{ //需要延迟1秒 - Thread.sleep(1000); //延时1秒 - }catch(InterruptedException e){} - } - } - - } - slist=null; - emppadminlist=null; - // - } - String unsendusername = ""; - if(!unsendusers.isEmpty()){ - for(int z=0;z item: MsgWebSocket.webSocketSet){ -// for (String receiver:receivers){ -// if(item.get("key").equals(receiver)){ -// try { -// String msgId = CommUtil.getUUID(); -// msg.setId(msgId); -// newsresult += saveMsg(msg); -// -// this.msgrecvService.saveRecv(receiver, msg.getId(),msg.getRedflag()); -// -// System.out.println(content); -// -// ((MsgWebSocket)item.get("ws")).sendMessage(content); -// } catch (IOException e) { -// e.printStackTrace(); -// continue; -// } -// } -// } -// } - - } -// if (sendType.equals(AlarmInformationAlarmModeEnum.message.getKey()) || sendType.equals(AlarmInformationAlarmModeEnum.all.getKey())) { -// List userlist = new ArrayList(); -// String[] mobilearr = new String[receivers.length]; -// for (int i = 0; i < receivers.length; i++) { -// if (!receivers[i].isEmpty()) { -// userlist.add(this.userService.getUserById(receivers[i])); -// mobilearr[i] = this.userService.getUserById(receivers[i]).getMobile(); -// //recvidlist.add(recvids[i]); -// } -// } -// int i1 = 9999; -// try { -// InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("emsg.properties"); -// Properties prop = new Properties(); -// prop.load(inStream); -// String softwareSerialNo = prop.getProperty("softwareSerialNo"); -// String key = prop.getProperty("key"); -// String password = prop.getProperty("password"); -// i1 = new Client(softwareSerialNo, key).registEx(password); -// //System.out.println("testTegistEx:" + i1); -// i1 = new Client(softwareSerialNo, key).sendSMS(mobilearr, -// title + content, "", 5);// 带扩展码 -// } catch (Exception e) { -// e.printStackTrace(); -// } -// //发送成功 -// //保存短信 -// if (i1 == 0) { -// String msgId = CommUtil.getUUID(); -// msg.setId(msgId); -// msg.setIssms("sms"); -// messageresult += saveMsg(msg); -// //手机用户表 -// for (int ii = 0; ii < userlist.size(); ii++) { -// EmppSendUser esu = new EmppSendUser(); -// esu.setId(CommUtil.getUUID()); -// esu.setEmppsendid(msgId); -// esu.setSenduserid(sender); -// esu.setSenddate(new Date()); -// esu.setRecuserid(userlist.get(ii).getId()); -// esu.setMobile(userlist.get(ii).getMobile()); -// esu.setBackdate(null); -// esu.setInsertuserid(sender); -// esu.setInsertdate(new Date()); -// esu.setUpdateuserid(sender); -// esu.setUpdatedate(new Date()); -// this.emppsenduserService.save(esu); -// esu = null; -// } -// } -// } - String resstr = "{\"news\":\"" + newsresult + "\",\"message\":\"" + messageresult + "\"}"; - return resstr; - } -} diff --git a/src/com/sipai/service/msg/MsgTypeService.java b/src/com/sipai/service/msg/MsgTypeService.java deleted file mode 100644 index 5c162245..00000000 --- a/src/com/sipai/service/msg/MsgTypeService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.service.msg; - -import java.util.List; - -import com.sipai.entity.msg.MsgType; - -public interface MsgTypeService { - public MsgType getMsgTypeById(String msgtype); - - public int saveMsgType(MsgType msgtype); - - public int updateMsgTypeById(MsgType msgtype); - - public int deleteMsgTypeById(String msgtypeId); - - public int deleteMsgTypeByWhere(String whereStr,String msgtypeIds); - - public List selectList(); - - public List selectListByWhere(String wherestr); - - public boolean checkNotOccupied(String msgtypeId); - - public List getMsgType(String wherestr); - public int saveMsgRole(String msgroleids, String masterid); - public int saveMsguser(String msguserids, String masterid); - public int saveSmsuser(String smsuserids, String masterid); -} diff --git a/src/com/sipai/service/msg/MsgTypeServiceImpl.java b/src/com/sipai/service/msg/MsgTypeServiceImpl.java deleted file mode 100644 index 6c9ac991..00000000 --- a/src/com/sipai/service/msg/MsgTypeServiceImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.sipai.service.msg; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.msg.MsgRoleDao; -import com.sipai.dao.msg.MsgTypeDao; -import com.sipai.dao.msg.MsguserDao; -import com.sipai.dao.msg.SmsuserDao; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.msg.MsgRecv; -import com.sipai.entity.msg.MsgRole; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.msg.Msguser; -import com.sipai.entity.msg.Smsuser; -import com.sipai.tools.CommUtil; - - - -@Service -public class MsgTypeServiceImpl implements MsgTypeService{ - @Resource - private MsgTypeDao msgtypeDao; - @Resource - private MsgRoleDao msgroleDao; - @Resource - private MsguserDao msguserDao; - @Resource - private SmsuserDao smsuserDao; - @Resource - private MsgAlarmlevelService msgAlarmlevelService; - @Override - public MsgType getMsgTypeById(String msgtypeId) { - // TODO Auto-generated method stub - return this.msgtypeDao.selectByPrimaryKey(msgtypeId); - } - - @Override - public int saveMsgType(MsgType msgtype) { - // TODO Auto-generated method stub - return this.msgtypeDao.insert(msgtype); - } - - @Override - public int updateMsgTypeById(MsgType msgtype) { - // TODO Auto-generated method stub - return this.msgtypeDao.updateByPrimaryKeySelective(msgtype); - } - - @Override - public int deleteMsgTypeById(String msgtypeId) { - // TODO Auto-generated method stub - msgAlarmlevelService.deleteByWhere("where state='"+msgtypeId+"'"); - int res=this.msgtypeDao.deleteByPrimaryKey(msgtypeId); - return res; - } - - @Override - public int deleteMsgTypeByWhere(String whereStr,String msgtypeIds) { - // TODO Auto-generated method stub - MsgType msgtype = new MsgType(); - msgtype.setWhere(whereStr); - msgAlarmlevelService.deleteByWhere("where state in('"+msgtypeIds+"')"); - int res=this.msgtypeDao.deleteByWhere(msgtype); - return res; - } - - @Override - public List selectList() { - // TODO Auto-generated method stub - MsgType msgtype = new MsgType(); - return this.msgtypeDao.selectList(msgtype); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - MsgType msgtype = new MsgType(); - msgtype.setWhere(wherestr); - return this.msgtypeDao.selectListByWhere(msgtype); - } - @Override - public boolean checkNotOccupied(String msgtypeId){ - MsgType msgtype = new MsgType(); - msgtype.setWhere(" where id='"+msgtypeId+"' order by insdt"); - List list=this.msgtypeDao.selectListByWhere(msgtype); - if(list.size()!=0){ - return false; - }else{ - return true; - } - } - @Override - public List getMsgType(String wherestr){ - MsgType msgtype = new MsgType(); - msgtype.setWhere(wherestr); - return this.msgtypeDao.getMsgType(msgtype); - } - @Override - public int saveMsgRole(String msgroleids, String masterid){ - //* 更新接受者的函数,在新建或更新接受者的时候都要先删除所有的原来的接受者,不带消息提示 - MsgRole msgrole = new MsgRole(); - msgrole.setWhere(" where masterid='"+ masterid + "'"); - this.msgroleDao.deleteByWhere(msgrole); - - String[] msgroleid = msgroleids.split(","); - int res=0; - for (int i = 0; i <= msgroleid.length - 1; i++) { - if (msgroleid[i].length() > 0) { - MsgRole cr = new MsgRole(); - cr.setId(CommUtil.getUUID()); - cr.setMasterid(masterid); - cr.setRoleid(msgroleid[i]); - cr.setInsdt(new Date()); - res=this.msgroleDao.insert(cr); - cr = null; - } - } - return res; - } - @Override - public int saveMsguser(String msguserids, String masterid){ - Msguser msguser = new Msguser(); - msguser.setWhere(" where masterid='"+ masterid + "'"); - this.msguserDao.deleteByWhere(msguser); - - String[] msguserid = msguserids.split(","); - int res=0; - for (int i = 0; i <= msguserid.length - 1; i++) { - if (msguserid[i].length() > 0) { - Msguser cr = new Msguser(); - cr.setId(CommUtil.getUUID()); - cr.setMasterid(masterid); - cr.setUserid(msguserid[i]); - cr.setInsdt(new Date()); - res=this.msguserDao.insert(cr); - cr = null; - } - } - return res; - } - @Override - public int saveSmsuser(String smsuserids, String masterid){ - Smsuser smsuser = new Smsuser(); - smsuser.setWhere(" where masterid='"+ masterid + "'"); - this.smsuserDao.deleteByWhere(smsuser); - - String[] smsuserid = smsuserids.split(","); - int res=0; - for (int i = 0; i <= smsuserid.length - 1; i++) { - if (smsuserid[i].length() > 0) { - Smsuser cr = new Smsuser(); - cr.setId(CommUtil.getUUID()); - cr.setMasterid(masterid); - cr.setUserid(smsuserid[i]); - cr.setInsdt(new Date()); - res=this.smsuserDao.insert(cr); - cr = null; - } - } - return res; - } -} diff --git a/src/com/sipai/service/msg/MsguserService.java b/src/com/sipai/service/msg/MsguserService.java deleted file mode 100644 index 627fe61b..00000000 --- a/src/com/sipai/service/msg/MsguserService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.msg; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.msg.MsguserDao; -import com.sipai.entity.msg.Msguser; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class MsguserService implements CommService{ - @Resource - private MsguserDao msguserDao; - @Resource - private UserService userService; - @Override - public Msguser selectById(String id) { - return msguserDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return msguserDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Msguser entity) { - return msguserDao.insert(entity); - } - - @Override - public int update(Msguser entity) { - return msguserDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Msguser entity =new Msguser(); - entity.setWhere(wherestr); - List msgusers=msguserDao.selectListByWhere(entity); - for (Msguser msguser : msgusers) { - User user =userService.getUserById(msguser.getUserid()); - msguser.setUser(user); - } - return msgusers; - } - @Override - public int deleteByWhere(String wherestr) { - Msguser entity =new Msguser(); - entity.setWhere(wherestr); - return msguserDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/msg/RecvListener.java b/src/com/sipai/service/msg/RecvListener.java deleted file mode 100644 index d0069f8a..00000000 --- a/src/com/sipai/service/msg/RecvListener.java +++ /dev/null @@ -1,212 +0,0 @@ -package com.sipai.service.msg; - -import java.math.BigInteger; -import java.util.ArrayList; - -import com.wondertek.esmp.esms.empp.EMPPAnswer; -import com.wondertek.esmp.esms.empp.EMPPChangePassResp; -import com.wondertek.esmp.esms.empp.EMPPDeliver; -import com.wondertek.esmp.esms.empp.EMPPDeliverReport; -import com.wondertek.esmp.esms.empp.EMPPObject; -import com.wondertek.esmp.esms.empp.EMPPRecvListener; -import com.wondertek.esmp.esms.empp.EMPPReqNoticeResp; -import com.wondertek.esmp.esms.empp.EMPPSubmitSM; -import com.wondertek.esmp.esms.empp.EMPPSubmitSMResp; -import com.wondertek.esmp.esms.empp.EMPPSyncAddrBookResp; -import com.wondertek.esmp.esms.empp.EMPPTerminate; -import com.wondertek.esmp.esms.empp.EMPPUnAuthorization; -import com.wondertek.esmp.esms.empp.EmppApi; - -/** - * @author chensheng - * - * 要更改此生成的类型注释的模板,请转至 - * 窗口 - 首选项 - Java - 代码样式 - 代码模板 - */ -public class RecvListener implements EMPPRecvListener { - - private static final long RECONNECT_TIME = 10 * 1000; - - private EmppApi emppApi = null; - - private int closedCount = 0; - - protected RecvListener(){ - - } - - public RecvListener(EmppApi emppApi){ - this.emppApi = emppApi; - } - - /*// 处理接收到的消息 - @SuppressWarnings("unchecked") - public void onMessage(EMPPObject message) { - if(message instanceof EMPPUnAuthorization){ - @SuppressWarnings("unused") - EMPPUnAuthorization unAuth=(EMPPUnAuthorization)message; -// System.out.println("客户端无权执行此操作 commandId="+unAuth.getUnAuthCommandId()); - return; - } - if(message instanceof EMPPSubmitSMResp){ - EMPPSubmitSMResp resp=(EMPPSubmitSMResp)message; -// System.out.println("收到sumbitResp:"); - @SuppressWarnings("unused") - byte[] msgId=fiterBinaryZero(resp.getMsgId()); - -// System.out.println("移动公司收到的msgId="+new BigInteger(msgId)+",手机号码是:"+resp.); -// System.out.println("result="+resp.getResult()); - return; - } - if(message instanceof EMPPDeliver){ - EMPPDeliver deliver = (EMPPDeliver)message; - if(deliver.getRegister()==EMPPSubmitSM.EMPP_STATUSREPORT_TRUE){ - //收到状态报告 - EMPPDeliverReport report=deliver.getDeliverReport(); -// System.out.println("收到状态报告:"); - byte[] msgId=fiterBinaryZero(report.getMsgId()); - -// System.out.println("客户反馈的msgId11="+new BigInteger(msgId)+",手机号码是:"+report.getDstAddr()); -// System.out.println("status="+report.getStat()); - - String mobile=report.getDstAddr();//获得手机号码 - try{ - com.sipai.tools.EncryptionDecryption en=new com.sipai.tools.EncryptionDecryption("usertel"); - mobile=en.encrypt(mobile); - en=null; - }catch(Exception e){ - e.printStackTrace(); - } - - com.sipai.fwk.CommSQL.updateStatic("update tb_EMPP_EmppSendUser set msgId='"+new BigInteger(msgId)+"',backdate='"+com.sipai.tools.CommUtil.nowDate()+"' where mobile='"+mobile+"' " + - " and (backdate is null or backdate='' )"); - - - - }else{ - byte[] msgId1=fiterBinaryZero(deliver.getMsgId()); - //收到手机回复 -// System.out.println("收到"+deliver.getSrcTermId()+"发送的短信,编号是:"+new BigInteger(msgId1)+",子账号是:"+deliver.getDstAddr()); -// System.out.println("短信内容为:"+deliver.getMsgContent().debugString().replaceAll("sm: msg: ","")); -// - - * 先查询该id号得到的tb_EMPP_EmppAdmin - - String emppSendid=""; - String accountId="";//为子账号 - try{ - com.sipai.tools.EncryptionDecryption en=new com.sipai.tools.EncryptionDecryption("usertel"); - accountId=en.encrypt(deliver.getDstAddr()); - EmppAdminDAO emdao=new EmppAdminDAO(); - ArrayList emlist=new ArrayList(); - emlist=(ArrayList)emdao.loadList("select * from tb_EMPP_EmppAdmin where accountId='"+accountId+"' "); - if(emlist!=null && emlist.size()>=1){ - EmppreplaceDAO epdao=new EmppreplaceDAO(); - emppSendid=emlist.get(0).getId(); - Emppreplace e=new Emppreplace(); - e.setId(com.sipai.tool.CommUtil.getUUID()); - e.setEmppSendid(emppSendid); - e.setMobile(en.encrypt(deliver.getSrcTermId())); - e.setBackdate(com.sipai.tool.CommUtil.nowDate()); - e.setMsgId(String.valueOf(new BigInteger(msgId1))); - e.setRepcontent(en.encrypt(deliver.getMsgContent().debugString().replaceAll("sm: msg: ",""))); - - epdao.save(e, ""); - epdao=null; - e=null; - } - - emlist=null; - emdao=null; - en=null; - }catch(Exception e){ - e.printStackTrace(); - } - - - } - return; - } - if(message instanceof EMPPSyncAddrBookResp){ - EMPPSyncAddrBookResp resp=(EMPPSyncAddrBookResp)message; - if(resp.getResult()!=EMPPSyncAddrBookResp.RESULT_OK) - System.out.println("同步通讯录失败"); - else{ - System.out.println("收到服务器发送的通讯录信息"); - System.out.println("通讯录类型为:"+resp.getAddrBookType()); - System.out.println(resp.getAddrBook()); - } - } - if(message instanceof EMPPChangePassResp){ - EMPPChangePassResp resp=(EMPPChangePassResp)message; - if(resp.getResult()==EMPPChangePassResp.RESULT_VALIDATE_ERROR) - System.out.println("更改密码:验证失败"); - if(resp.getResult()==EMPPChangePassResp.RESULT_OK) - { - System.out.println("更改密码成功,新密码为:"+resp.getPassword()); - emppApi.setPassword(resp.getPassword()); - } - return; - - } - if(message instanceof EMPPReqNoticeResp){ - EMPPReqNoticeResp response=(EMPPReqNoticeResp)message; - if(response.getResult()!=EMPPReqNoticeResp.RESULT_OK) - System.out.println("查询运营商发布信息失败"); - else{ - System.out.println("收到运营商发布的信息"); - System.out.println(response.getNotice()); - } - return; - } - if(message instanceof EMPPAnswer){ - System.out.println("收到企业疑问解答"); - EMPPAnswer answer=(EMPPAnswer)message; - System.out.println(answer.getAnswer()); - - } - System.out.println(message); - - } - *///处理连接断掉事件 - public void OnClosed(Object object) { - // 该连接是被服务器主动断掉,不需要重连 - if(object instanceof EMPPTerminate){ - System.out.println("收到服务器发送的Terminate消息,连接终止"); - return; - } - //这里注意要将emppApi做为参数传入构造函数 - RecvListener listener = new RecvListener(emppApi) - ; - System.out.println("连接断掉次数:"+(++closedCount)); - for(int i = 1;!emppApi.isConnected();i++){ - try { - System.out.println("重连次数:"+i); - Thread.sleep(RECONNECT_TIME); - emppApi.reConnect(listener); - }catch (Exception e) { - e.printStackTrace(); - } - } - System.out.println("重连成功"); - } - - //处理错误事件 - public void OnError(Exception e) { - e.printStackTrace(); - } - - public static byte[] fiterBinaryZero(byte[] bytes) { - byte[] returnBytes = new byte[8]; - for (int i = 0; i < 8; i++) { - returnBytes[i] = bytes[i]; - } - return returnBytes; - } - - @Override - public void onMessage(EMPPObject arg0) { - // TODO Auto-generated method stub - - } -} diff --git a/src/com/sipai/service/msg/SmsuserService.java b/src/com/sipai/service/msg/SmsuserService.java deleted file mode 100644 index 851829e9..00000000 --- a/src/com/sipai/service/msg/SmsuserService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.msg; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.msg.MsguserDao; -import com.sipai.dao.msg.SmsuserDao; -import com.sipai.entity.msg.Msguser; -import com.sipai.entity.msg.Smsuser; -import com.sipai.entity.msg.Smsuser; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class SmsuserService implements CommService{ - @Resource - private SmsuserDao smsuserDao; - @Resource - private UserService userService; - @Override - public Smsuser selectById(String id) { - return smsuserDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return smsuserDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Smsuser entity) { - return smsuserDao.insert(entity); - } - - @Override - public int update(Smsuser entity) { - return smsuserDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Smsuser entity =new Smsuser(); - entity.setWhere(wherestr); - List smsusers=smsuserDao.selectListByWhere(entity); - for (Smsuser smsuser : smsusers) { - User user =userService.getUserById(smsuser.getUserid()); - smsuser.setUser(user); - } - return smsusers; - } - @Override - public int deleteByWhere(String wherestr) { - Smsuser entity =new Smsuser(); - entity.setWhere(wherestr); - return smsuserDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/DataPatrolResultDataService.java b/src/com/sipai/service/process/DataPatrolResultDataService.java deleted file mode 100644 index ebaba0df..00000000 --- a/src/com/sipai/service/process/DataPatrolResultDataService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataPatrolResultData; - -public interface DataPatrolResultDataService { - - public abstract DataPatrolResultData selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataPatrolResultData entity); - - public abstract int update(DataPatrolResultData entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectAnyByWhere(String wherestr,String any); - -} diff --git a/src/com/sipai/service/process/DataPatrolService.java b/src/com/sipai/service/process/DataPatrolService.java deleted file mode 100644 index e1f0061d..00000000 --- a/src/com/sipai/service/process/DataPatrolService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataPatrol; - -public interface DataPatrolService { - - public abstract DataPatrol selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataPatrol entity); - - public abstract int update(DataPatrol entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - String getTreeList(List> list_result, List list); - - String getTreeList1(List> list_result, List list); - - String getDataPatrolSt(String mpCodes, String unitId); - -} diff --git a/src/com/sipai/service/process/DataVisualBarChartSeriesService.java b/src/com/sipai/service/process/DataVisualBarChartSeriesService.java deleted file mode 100644 index 5b060640..00000000 --- a/src/com/sipai/service/process/DataVisualBarChartSeriesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualBarChartSeries; - -public interface DataVisualBarChartSeriesService { - - public abstract DataVisualBarChartSeries selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualBarChartSeries entity); - - public abstract int update(DataVisualBarChartSeries entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualBarChartService.java b/src/com/sipai/service/process/DataVisualBarChartService.java deleted file mode 100644 index 39a6ca6f..00000000 --- a/src/com/sipai/service/process/DataVisualBarChartService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualBarChart; - -public interface DataVisualBarChartService { - - public abstract DataVisualBarChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualBarChart entity); - - public abstract int update(DataVisualBarChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualBarChartYAxisService.java b/src/com/sipai/service/process/DataVisualBarChartYAxisService.java deleted file mode 100644 index 6d654b22..00000000 --- a/src/com/sipai/service/process/DataVisualBarChartYAxisService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualBarChartYAxis; - -public interface DataVisualBarChartYAxisService { - - public abstract DataVisualBarChartYAxis selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualBarChartYAxis entity); - - public abstract int update(DataVisualBarChartYAxis entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualCameraAlarmService.java b/src/com/sipai/service/process/DataVisualCameraAlarmService.java deleted file mode 100644 index 1ce8c545..00000000 --- a/src/com/sipai/service/process/DataVisualCameraAlarmService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualCameraAlarm; - -public interface DataVisualCameraAlarmService { - - public abstract DataVisualCameraAlarm selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualCameraAlarm entity); - - public abstract int update(DataVisualCameraAlarm entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualCameraService.java b/src/com/sipai/service/process/DataVisualCameraService.java deleted file mode 100644 index d8e2490c..00000000 --- a/src/com/sipai/service/process/DataVisualCameraService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualCamera; - -public interface DataVisualCameraService { - - public abstract DataVisualCamera selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualCamera entity); - - public abstract int update(DataVisualCamera entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualContentService.java b/src/com/sipai/service/process/DataVisualContentService.java deleted file mode 100644 index 3a0703e4..00000000 --- a/src/com/sipai/service/process/DataVisualContentService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualContent; -import com.sipai.entity.scada.MPoint; - -public interface DataVisualContentService { - - public abstract DataVisualContent selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualContent entity); - - public abstract int update(DataVisualContent entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int updateFixedByWhere(String wherestr, String fixedSt); - - public abstract MPoint getMpointJsonForEXAndDV(String mpid, String valuemethod, String sdt, String edt); - - public abstract String getContentId(String assemblyId); - - public abstract void deleteContentById(String id, String type, String did); - - public abstract List selectDistinctTypeListByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualDateSelectService.java b/src/com/sipai/service/process/DataVisualDateSelectService.java deleted file mode 100644 index dbc55cb2..00000000 --- a/src/com/sipai/service/process/DataVisualDateSelectService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualDateSelect; - -public interface DataVisualDateSelectService { - - public abstract DataVisualDateSelect selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualDateSelect entity); - - public abstract int update(DataVisualDateSelect entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualDateService.java b/src/com/sipai/service/process/DataVisualDateService.java deleted file mode 100644 index 62f87b6f..00000000 --- a/src/com/sipai/service/process/DataVisualDateService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualDate; - -public interface DataVisualDateService { - - public abstract DataVisualDate selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualDate entity); - - public abstract int update(DataVisualDate entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualEqPointsService.java b/src/com/sipai/service/process/DataVisualEqPointsService.java deleted file mode 100644 index e4ffef1b..00000000 --- a/src/com/sipai/service/process/DataVisualEqPointsService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualEqPoints; - -public interface DataVisualEqPointsService { - - public abstract DataVisualEqPoints selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualEqPoints entity); - - public abstract int update(DataVisualEqPoints entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualFormService.java b/src/com/sipai/service/process/DataVisualFormService.java deleted file mode 100644 index 8da1ad66..00000000 --- a/src/com/sipai/service/process/DataVisualFormService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.process.DataVisualForm; - -public interface DataVisualFormService { - - public abstract DataVisualForm selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualForm entity); - - public abstract int update(DataVisualForm entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List> getSpData(String content); - -} diff --git a/src/com/sipai/service/process/DataVisualFormShowStyleService.java b/src/com/sipai/service/process/DataVisualFormShowStyleService.java deleted file mode 100644 index 9aed7179..00000000 --- a/src/com/sipai/service/process/DataVisualFormShowStyleService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.process.DataVisualFormShowStyle; - -public interface DataVisualFormShowStyleService { - - public abstract DataVisualFormShowStyle selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualFormShowStyle entity); - - public abstract int update(DataVisualFormShowStyle entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/process/DataVisualFormSqlPointService.java b/src/com/sipai/service/process/DataVisualFormSqlPointService.java deleted file mode 100644 index 69948a8c..00000000 --- a/src/com/sipai/service/process/DataVisualFormSqlPointService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.process.DataVisualFormSqlPoint; - -public interface DataVisualFormSqlPointService { - - public abstract DataVisualFormSqlPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualFormSqlPoint entity); - - public abstract int update(DataVisualFormSqlPoint entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualFrameContainerService.java b/src/com/sipai/service/process/DataVisualFrameContainerService.java deleted file mode 100644 index bce7362b..00000000 --- a/src/com/sipai/service/process/DataVisualFrameContainerService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualFrameContainer; - -public interface DataVisualFrameContainerService { - - public abstract DataVisualFrameContainer selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualFrameContainer entity); - - public abstract int update(DataVisualFrameContainer entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualFrameService.java b/src/com/sipai/service/process/DataVisualFrameService.java deleted file mode 100644 index ea40de82..00000000 --- a/src/com/sipai/service/process/DataVisualFrameService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Service; - -import com.sipai.entity.process.DataVisualFrame; - -public interface DataVisualFrameService { - - public abstract DataVisualFrame selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualFrame entity); - - public abstract int update(DataVisualFrame entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int morderUpBywhere(String wherestr); - - public abstract int morderDownBywhere(String wherestr); - - String getTreeList(List> list_result, List list); - - public abstract void copyFrame(String ckid, String id); - - public abstract void deleteAllContentFromFrameId(String frameId); - - public abstract String getFrameContentToMqtt(String menuType,String inFrameId); - -} diff --git a/src/com/sipai/service/process/DataVisualGaugeChartService.java b/src/com/sipai/service/process/DataVisualGaugeChartService.java deleted file mode 100644 index 89aaddef..00000000 --- a/src/com/sipai/service/process/DataVisualGaugeChartService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualGaugeChart; - -public interface DataVisualGaugeChartService { - - public abstract DataVisualGaugeChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualGaugeChart entity); - - public abstract int update(DataVisualGaugeChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualLineChartSeriesService.java b/src/com/sipai/service/process/DataVisualLineChartSeriesService.java deleted file mode 100644 index e295328e..00000000 --- a/src/com/sipai/service/process/DataVisualLineChartSeriesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualLineChartSeries; - -public interface DataVisualLineChartSeriesService { - - public abstract DataVisualLineChartSeries selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualLineChartSeries entity); - - public abstract int update(DataVisualLineChartSeries entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualLineChartService.java b/src/com/sipai/service/process/DataVisualLineChartService.java deleted file mode 100644 index c1cd5168..00000000 --- a/src/com/sipai/service/process/DataVisualLineChartService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualLineChart; - -public interface DataVisualLineChartService { - - public abstract DataVisualLineChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualLineChart entity); - - public abstract int update(DataVisualLineChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualLineChartYAxisService.java b/src/com/sipai/service/process/DataVisualLineChartYAxisService.java deleted file mode 100644 index 35957e84..00000000 --- a/src/com/sipai/service/process/DataVisualLineChartYAxisService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualLineChartYAxis; - -public interface DataVisualLineChartYAxisService { - - public abstract DataVisualLineChartYAxis selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualLineChartYAxis entity); - - public abstract int update(DataVisualLineChartYAxis entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualMPointService.java b/src/com/sipai/service/process/DataVisualMPointService.java deleted file mode 100644 index 1ef03ace..00000000 --- a/src/com/sipai/service/process/DataVisualMPointService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualMPoint; - -public interface DataVisualMPointService { - - public abstract DataVisualMPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualMPoint entity); - - public abstract int update(DataVisualMPoint entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualMPointWarehouseService.java b/src/com/sipai/service/process/DataVisualMPointWarehouseService.java deleted file mode 100644 index e9035895..00000000 --- a/src/com/sipai/service/process/DataVisualMPointWarehouseService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualMPointWarehouse; - -public interface DataVisualMPointWarehouseService { - - public abstract DataVisualMPointWarehouse selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualMPointWarehouse entity); - - public abstract int update(DataVisualMPointWarehouse entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualMpViewService.java b/src/com/sipai/service/process/DataVisualMpViewService.java deleted file mode 100644 index 5458ba95..00000000 --- a/src/com/sipai/service/process/DataVisualMpViewService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualMpView; - -public interface DataVisualMpViewService { - - public abstract DataVisualMpView selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualMpView entity); - - public abstract int update(DataVisualMpView entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/process/DataVisualPercentChartService.java b/src/com/sipai/service/process/DataVisualPercentChartService.java deleted file mode 100644 index a8107d1e..00000000 --- a/src/com/sipai/service/process/DataVisualPercentChartService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualPercentChart; - -public interface DataVisualPercentChartService { - - public abstract DataVisualPercentChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualPercentChart entity); - - public abstract int update(DataVisualPercentChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualPersonnelPositioningService.java b/src/com/sipai/service/process/DataVisualPersonnelPositioningService.java deleted file mode 100644 index 247a4309..00000000 --- a/src/com/sipai/service/process/DataVisualPersonnelPositioningService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualPersonnelPositioning; - -public interface DataVisualPersonnelPositioningService { - - public abstract DataVisualPersonnelPositioning selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualPersonnelPositioning entity); - - public abstract int update(DataVisualPersonnelPositioning entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualPieChartSeriesService.java b/src/com/sipai/service/process/DataVisualPieChartSeriesService.java deleted file mode 100644 index e839cd04..00000000 --- a/src/com/sipai/service/process/DataVisualPieChartSeriesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualPieChartSeries; - -public interface DataVisualPieChartSeriesService { - - public abstract DataVisualPieChartSeries selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualPieChartSeries entity); - - public abstract int update(DataVisualPieChartSeries entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualPieChartService.java b/src/com/sipai/service/process/DataVisualPieChartService.java deleted file mode 100644 index 1a6499cc..00000000 --- a/src/com/sipai/service/process/DataVisualPieChartService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualPieChart; - -public interface DataVisualPieChartService { - - public abstract DataVisualPieChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualPieChart entity); - - public abstract int update(DataVisualPieChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualPolarCoordinatesSeriesService.java b/src/com/sipai/service/process/DataVisualPolarCoordinatesSeriesService.java deleted file mode 100644 index d3e17658..00000000 --- a/src/com/sipai/service/process/DataVisualPolarCoordinatesSeriesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualPolarCoordinatesSeries; - -public interface DataVisualPolarCoordinatesSeriesService { - - public abstract DataVisualPolarCoordinatesSeries selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualPolarCoordinatesSeries entity); - - public abstract int update(DataVisualPolarCoordinatesSeries entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualPolarCoordinatesService.java b/src/com/sipai/service/process/DataVisualPolarCoordinatesService.java deleted file mode 100644 index e0c5da1c..00000000 --- a/src/com/sipai/service/process/DataVisualPolarCoordinatesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualPolarCoordinates; - -public interface DataVisualPolarCoordinatesService { - - public abstract DataVisualPolarCoordinates selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualPolarCoordinates entity); - - public abstract int update(DataVisualPolarCoordinates entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualProgressBarChartService.java b/src/com/sipai/service/process/DataVisualProgressBarChartService.java deleted file mode 100644 index 357c4f15..00000000 --- a/src/com/sipai/service/process/DataVisualProgressBarChartService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualProgressBarChart; - -public interface DataVisualProgressBarChartService { - - public abstract DataVisualProgressBarChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualProgressBarChart entity); - - public abstract int update(DataVisualProgressBarChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/process/DataVisualRadarChartAxisService.java b/src/com/sipai/service/process/DataVisualRadarChartAxisService.java deleted file mode 100644 index 09ae9714..00000000 --- a/src/com/sipai/service/process/DataVisualRadarChartAxisService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualRadarChartAxis; - -public interface DataVisualRadarChartAxisService { - - public abstract DataVisualRadarChartAxis selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualRadarChartAxis entity); - - public abstract int update(DataVisualRadarChartAxis entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualRadarChartSeriesService.java b/src/com/sipai/service/process/DataVisualRadarChartSeriesService.java deleted file mode 100644 index 95659a52..00000000 --- a/src/com/sipai/service/process/DataVisualRadarChartSeriesService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualRadarChartSeries; - -public interface DataVisualRadarChartSeriesService { - - public abstract DataVisualRadarChartSeries selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualRadarChartSeries entity); - - public abstract int update(DataVisualRadarChartSeries entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualRadarChartService.java b/src/com/sipai/service/process/DataVisualRadarChartService.java deleted file mode 100644 index 955cb644..00000000 --- a/src/com/sipai/service/process/DataVisualRadarChartService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualRadarChart; - -public interface DataVisualRadarChartService { - - public abstract DataVisualRadarChart selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualRadarChart entity); - - public abstract int update(DataVisualRadarChart entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualSelectService.java b/src/com/sipai/service/process/DataVisualSelectService.java deleted file mode 100644 index 50b1f0a1..00000000 --- a/src/com/sipai/service/process/DataVisualSelectService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualSelect; - -public interface DataVisualSelectService { - - public abstract DataVisualSelect selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualSelect entity); - - public abstract int update(DataVisualSelect entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualSuspensionFrameService.java b/src/com/sipai/service/process/DataVisualSuspensionFrameService.java deleted file mode 100644 index b6225127..00000000 --- a/src/com/sipai/service/process/DataVisualSuspensionFrameService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualSuspensionFrame; - -public interface DataVisualSuspensionFrameService { - - public abstract DataVisualSuspensionFrame selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualSuspensionFrame entity); - - public abstract int update(DataVisualSuspensionFrame entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualSvgAlarmService.java b/src/com/sipai/service/process/DataVisualSvgAlarmService.java deleted file mode 100644 index 61be7e95..00000000 --- a/src/com/sipai/service/process/DataVisualSvgAlarmService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualSvgAlarm; - -public interface DataVisualSvgAlarmService { - - public abstract DataVisualSvgAlarm selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualSvgAlarm entity); - - public abstract int update(DataVisualSvgAlarm entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualSvgService.java b/src/com/sipai/service/process/DataVisualSvgService.java deleted file mode 100644 index d1433596..00000000 --- a/src/com/sipai/service/process/DataVisualSvgService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualSvg; - -public interface DataVisualSvgService { - - public abstract DataVisualSvg selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualSvg entity); - - public abstract int update(DataVisualSvg entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualSwitchPointService.java b/src/com/sipai/service/process/DataVisualSwitchPointService.java deleted file mode 100644 index 58e04dfd..00000000 --- a/src/com/sipai/service/process/DataVisualSwitchPointService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualSwitchPoint; - -public interface DataVisualSwitchPointService { - - public abstract DataVisualSwitchPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualSwitchPoint entity); - - public abstract int update(DataVisualSwitchPoint entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualSwitchService.java b/src/com/sipai/service/process/DataVisualSwitchService.java deleted file mode 100644 index 51ade278..00000000 --- a/src/com/sipai/service/process/DataVisualSwitchService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualSwitch; - -public interface DataVisualSwitchService { - - public abstract DataVisualSwitch selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualSwitch entity); - - public abstract int update(DataVisualSwitch entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualTabService.java b/src/com/sipai/service/process/DataVisualTabService.java deleted file mode 100644 index 8b0d840f..00000000 --- a/src/com/sipai/service/process/DataVisualTabService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualTab; - -public interface DataVisualTabService { - - public abstract DataVisualTab selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualTab entity); - - public abstract int update(DataVisualTab entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int updateByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualTaskPointsService.java b/src/com/sipai/service/process/DataVisualTaskPointsService.java deleted file mode 100644 index 7bd89a88..00000000 --- a/src/com/sipai/service/process/DataVisualTaskPointsService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.DataVisualTaskPoints; - -public interface DataVisualTaskPointsService { - - public abstract DataVisualTaskPoints selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualTaskPoints entity); - - public abstract int update(DataVisualTaskPoints entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualTextService.java b/src/com/sipai/service/process/DataVisualTextService.java deleted file mode 100644 index 820a1d2b..00000000 --- a/src/com/sipai/service/process/DataVisualTextService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualText; - -public interface DataVisualTextService { - - public abstract DataVisualText selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualText entity); - - public abstract int update(DataVisualText entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualTextWarehouseService.java b/src/com/sipai/service/process/DataVisualTextWarehouseService.java deleted file mode 100644 index a61c4b0d..00000000 --- a/src/com/sipai/service/process/DataVisualTextWarehouseService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualTextWarehouse; - -public interface DataVisualTextWarehouseService { - - public abstract DataVisualTextWarehouse selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualTextWarehouse entity); - - public abstract int update(DataVisualTextWarehouse entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DataVisualWeatherService.java b/src/com/sipai/service/process/DataVisualWeatherService.java deleted file mode 100644 index 2e1620be..00000000 --- a/src/com/sipai/service/process/DataVisualWeatherService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DataVisualWeather; - -public interface DataVisualWeatherService { - - public abstract DataVisualWeather selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DataVisualWeather entity); - - public abstract int update(DataVisualWeather entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectTop1ListByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/DecisionExpertBaseService.java b/src/com/sipai/service/process/DecisionExpertBaseService.java deleted file mode 100644 index f5f16db4..00000000 --- a/src/com/sipai/service/process/DecisionExpertBaseService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DecisionExpertBase; - -public interface DecisionExpertBaseService { - - public abstract DecisionExpertBase selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DecisionExpertBase entity); - - public abstract int update(DecisionExpertBase entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - String getTreeList(List> list_result, List list); - -} diff --git a/src/com/sipai/service/process/DecisionExpertBaseTextService.java b/src/com/sipai/service/process/DecisionExpertBaseTextService.java deleted file mode 100644 index f91836c1..00000000 --- a/src/com/sipai/service/process/DecisionExpertBaseTextService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.process.DecisionExpertBaseText; - -public interface DecisionExpertBaseTextService { - - public abstract DecisionExpertBaseText selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(DecisionExpertBaseText entity); - - public abstract int update(DecisionExpertBaseText entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - String getChildren(String pid); - - String getChildrenID(String pid, List decisionExpertBases); - - List getChildren(String pid,List t); - - List getChildrenById(String id); - -} diff --git a/src/com/sipai/service/process/EquipmentAdjustmentDetailService.java b/src/com/sipai/service/process/EquipmentAdjustmentDetailService.java deleted file mode 100644 index b7b304a2..00000000 --- a/src/com/sipai/service/process/EquipmentAdjustmentDetailService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.process.EquipmentAdjustmentDetailDao; -import com.sipai.entity.process.EquipmentAdjustmentDetail; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentAdjustmentDetailService implements CommService{ - - @Resource - private EquipmentAdjustmentDetailDao equipmentAdjustmentDetailDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public EquipmentAdjustmentDetail selectById(String id) { - EquipmentAdjustmentDetail equipmentAdjustmentDetail = this.equipmentAdjustmentDetailDao.selectByPrimaryKey(id); - if (equipmentAdjustmentDetail!=null) { - equipmentAdjustmentDetail.setEquipmentCard(this.equipmentCardService.selectById(equipmentAdjustmentDetail.getEquipmentId())); - } - return equipmentAdjustmentDetail; - } - - @Override - public int deleteById(String id) { - int code = this.equipmentAdjustmentDetailDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(EquipmentAdjustmentDetail equipmentAdjustmentDetail) { - int code = this.equipmentAdjustmentDetailDao.insert(equipmentAdjustmentDetail); - return code; - } - - @Override - public int update(EquipmentAdjustmentDetail equipmentAdjustmentDetail) { - int code = this.equipmentAdjustmentDetailDao.updateByPrimaryKeySelective(equipmentAdjustmentDetail); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentAdjustmentDetail equipmentAdjustmentDetail = new EquipmentAdjustmentDetail(); - equipmentAdjustmentDetail.setWhere(wherestr); - List list = this.equipmentAdjustmentDetailDao.selectListByWhere(equipmentAdjustmentDetail); - for (EquipmentAdjustmentDetail item : list) { - item.setEquipmentCard(this.equipmentCardService.selectById(item.getEquipmentId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentAdjustmentDetail equipmentAdjustmentDetail = new EquipmentAdjustmentDetail(); - equipmentAdjustmentDetail.setWhere(wherestr); - int code = this.equipmentAdjustmentDetailDao.deleteByWhere(equipmentAdjustmentDetail); - return code; - } - -} diff --git a/src/com/sipai/service/process/EquipmentAdjustmentService.java b/src/com/sipai/service/process/EquipmentAdjustmentService.java deleted file mode 100644 index 1900e28f..00000000 --- a/src/com/sipai/service/process/EquipmentAdjustmentService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.process.EquipmentAdjustment; -import org.springframework.stereotype.Service; - -import com.sipai.dao.process.EquipmentAdjustmentDao; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentAdjustmentService implements CommService{ - - @Resource - private EquipmentAdjustmentDao equipmentAdjustmentDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - - @Override - public EquipmentAdjustment selectById(String id) { - EquipmentAdjustment equipmentAdjustment = this.equipmentAdjustmentDao.selectByPrimaryKey(id); - if (equipmentAdjustment!=null) { - equipmentAdjustment.setCompany(this.unitService.getCompById(equipmentAdjustment.getUnitId())); - equipmentAdjustment.setUser(this.userService.getUserById(equipmentAdjustment.getApplyUser())); - equipmentAdjustment.setUserF(this.userService.getUserById(equipmentAdjustment.getFeedbackUser())); - } - return equipmentAdjustment; - } - - @Override - public int deleteById(String id) { - int code = this.equipmentAdjustmentDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(EquipmentAdjustment equipmentAdjustment) { - int code = this.equipmentAdjustmentDao.insert(equipmentAdjustment); - return code; - } - - @Override - public int update(EquipmentAdjustment equipmentAdjustment) { - int code = this.equipmentAdjustmentDao.updateByPrimaryKeySelective(equipmentAdjustment); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentAdjustment equipmentAdjustment = new EquipmentAdjustment(); - equipmentAdjustment.setWhere(wherestr); - List list = this.equipmentAdjustmentDao.selectListByWhere(equipmentAdjustment); - for (EquipmentAdjustment item : list) { - item.setCompany(this.unitService.getCompById(item.getUnitId())); - item.setUser(this.userService.getUserById(item.getApplyUser())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentAdjustment equipmentAdjustment = new EquipmentAdjustment(); - equipmentAdjustment.setWhere(wherestr); - int code = this.equipmentAdjustmentDao.deleteByWhere(equipmentAdjustment); - return code; - } - -} diff --git a/src/com/sipai/service/process/LibraryProcessAbnormalService.java b/src/com/sipai/service/process/LibraryProcessAbnormalService.java deleted file mode 100644 index e0ef444c..00000000 --- a/src/com/sipai/service/process/LibraryProcessAbnormalService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.process.LibraryProcessAbnormal; - -import java.util.List; - -public interface LibraryProcessAbnormalService { - - public abstract LibraryProcessAbnormal selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryProcessAbnormal entity); - - public abstract int update(LibraryProcessAbnormal entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/LibraryProcessAdjustmentService.java b/src/com/sipai/service/process/LibraryProcessAdjustmentService.java deleted file mode 100644 index d7110762..00000000 --- a/src/com/sipai/service/process/LibraryProcessAdjustmentService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.process; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.process.LibraryProcessAdjustment; - -public interface LibraryProcessAdjustmentService { - - public abstract LibraryProcessAdjustment selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryProcessAdjustment entity); - - public abstract int update(LibraryProcessAdjustment entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public String readXls(InputStream inputStream,String unitId) throws IOException; - - public abstract void outExcelTemplate(HttpServletResponse response, String unitId) throws IOException; - -} diff --git a/src/com/sipai/service/process/LibraryProcessManageDetailService.java b/src/com/sipai/service/process/LibraryProcessManageDetailService.java deleted file mode 100644 index e957e92a..00000000 --- a/src/com/sipai/service/process/LibraryProcessManageDetailService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.process.LibraryProcessManageDetail; - -import java.util.List; - -public interface LibraryProcessManageDetailService { - - public abstract LibraryProcessManageDetail selectById(String id, String unitId); - - public abstract int deleteById(String id); - - public abstract int save(LibraryProcessManageDetail entity); - - public abstract int update(LibraryProcessManageDetail entity); - - public abstract List selectListByWhere(String wherestr, String unitId); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/LibraryProcessManageService.java b/src/com/sipai/service/process/LibraryProcessManageService.java deleted file mode 100644 index 8647d3b8..00000000 --- a/src/com/sipai/service/process/LibraryProcessManageService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.process.LibraryProcessManage; -import java.util.List; - -public interface LibraryProcessManageService { - - public abstract LibraryProcessManage selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryProcessManage entity); - - public abstract int update(LibraryProcessManage entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/LibraryProcessManageTypeService.java b/src/com/sipai/service/process/LibraryProcessManageTypeService.java deleted file mode 100644 index bc37b9ea..00000000 --- a/src/com/sipai/service/process/LibraryProcessManageTypeService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.LibraryProcessManageType; - -public interface LibraryProcessManageTypeService { - - public abstract LibraryProcessManageType selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryProcessManageType entity); - - public abstract int update(LibraryProcessManageType entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeListtest(List list); - -} diff --git a/src/com/sipai/service/process/LibraryProcessManageWorkOrderService.java b/src/com/sipai/service/process/LibraryProcessManageWorkOrderService.java deleted file mode 100644 index 97f5676f..00000000 --- a/src/com/sipai/service/process/LibraryProcessManageWorkOrderService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.LibraryProcessManageWorkOrder; - -public interface LibraryProcessManageWorkOrderService { - - public abstract LibraryProcessManageWorkOrder selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryProcessManageWorkOrder entity); - - public abstract int update(LibraryProcessManageWorkOrder entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/LibraryRoutineWorkService.java b/src/com/sipai/service/process/LibraryRoutineWorkService.java deleted file mode 100644 index af3f13f2..00000000 --- a/src/com/sipai/service/process/LibraryRoutineWorkService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.service.process; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.process.LibraryRoutineWork; - - -public interface LibraryRoutineWorkService { - - public abstract LibraryRoutineWork selectById(String id); - - public abstract LibraryRoutineWork selectSimpleById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryRoutineWork entity); - - public abstract int update(LibraryRoutineWork entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryRoutineWork selectByWhere(String wherestr); - - public String readXls(InputStream inputStream,String unitId,String type) throws IOException; - - public abstract void outExcelTemplate(HttpServletResponse response, String unitId, String datatype) throws IOException; -} diff --git a/src/com/sipai/service/process/LibraryWaterTestService.java b/src/com/sipai/service/process/LibraryWaterTestService.java deleted file mode 100644 index 33694bda..00000000 --- a/src/com/sipai/service/process/LibraryWaterTestService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.process.LibraryWaterTest; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import javax.servlet.http.HttpServletResponse; - -public interface LibraryWaterTestService { - - public abstract LibraryWaterTest selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(LibraryWaterTest entity); - - public abstract int update(LibraryWaterTest entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract LibraryWaterTest selectByWhere(String wherestr); - - public String readXls(InputStream inputStream,String unitId) throws IOException; - - public abstract void outExcelTemplate(HttpServletResponse response, String unitId) throws IOException; -} diff --git a/src/com/sipai/service/process/MeterCheckLibraryService.java b/src/com/sipai/service/process/MeterCheckLibraryService.java deleted file mode 100644 index 04bdcfe2..00000000 --- a/src/com/sipai/service/process/MeterCheckLibraryService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.MeterCheckLibrary; - -public interface MeterCheckLibraryService { - - public abstract MeterCheckLibrary selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(MeterCheckLibrary entity); - - public abstract int update(MeterCheckLibrary entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int updateByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/MeterCheckService.java b/src/com/sipai/service/process/MeterCheckService.java deleted file mode 100644 index 3688b0b6..00000000 --- a/src/com/sipai/service/process/MeterCheckService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.process.MeterCheck; - -public interface MeterCheckService { - - public abstract MeterCheck selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(MeterCheck entity); - - public abstract int update(MeterCheck entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListLeftLibraryByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int updateByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/ProcessAdjustmentContentService.java b/src/com/sipai/service/process/ProcessAdjustmentContentService.java deleted file mode 100644 index 84c3f1d9..00000000 --- a/src/com/sipai/service/process/ProcessAdjustmentContentService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.process.ProcessAdjustmentContent; - -import java.util.List; - -public interface ProcessAdjustmentContentService { - - public abstract ProcessAdjustmentContent selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ProcessAdjustmentContent entity); - - public abstract int update(ProcessAdjustmentContent entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int updateLibrary(String id, String libraryIds); - - public abstract List selectListForFileByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/ProcessAdjustmentService.java b/src/com/sipai/service/process/ProcessAdjustmentService.java deleted file mode 100644 index f6658bf9..00000000 --- a/src/com/sipai/service/process/ProcessAdjustmentService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.process.ProcessAdjustment; -import java.util.List; - -public interface ProcessAdjustmentService { - - public abstract ProcessAdjustment selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ProcessAdjustment entity); - - public abstract int update(ProcessAdjustment entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - //启动流程 - public abstract int startProcess(ProcessAdjustment entity); - //审核 - public abstract int doAudit(BusinessUnitAudit entity); - //改变状态 - public abstract int updateStatus(String id); -} diff --git a/src/com/sipai/service/process/ProcessAdjustmentTypeService.java b/src/com/sipai/service/process/ProcessAdjustmentTypeService.java deleted file mode 100644 index cfbe2fa3..00000000 --- a/src/com/sipai/service/process/ProcessAdjustmentTypeService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.process.ProcessAdjustmentType; -import java.util.List; -import java.util.Map; - -public interface ProcessAdjustmentTypeService { - - public abstract ProcessAdjustmentType selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(ProcessAdjustmentType entity); - - public abstract int update(ProcessAdjustmentType entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String getTreeListtest(List list); - -} diff --git a/src/com/sipai/service/process/ProcessSectionInformationService.java b/src/com/sipai/service/process/ProcessSectionInformationService.java deleted file mode 100644 index 0998535a..00000000 --- a/src/com/sipai/service/process/ProcessSectionInformationService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.process.ProcessSectionInformationDao; -import com.sipai.entity.process.ProcessSectionInformation; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommService; - -@Service -public class ProcessSectionInformationService implements CommService{ - @Resource - private ProcessSectionInformationDao processSectionInformationDao; - @Resource - private ProcessSectionService processSectionService; - - @Override - public ProcessSectionInformation selectById(String id) { - ProcessSectionInformation item = this.processSectionInformationDao.selectByPrimaryKey(id); - if(item!=null && item.getProcessSectionId()!=null){ - ProcessSection processSection = processSectionService.selectById(item.getProcessSectionId()); - if(processSection!=null){ - item.setProcessSection(processSection); - } - } - return item; - } - - @Override - public int deleteById(String id) { - return this.processSectionInformationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessSectionInformation entity) { - return this.processSectionInformationDao.insert(entity); - } - - @Override - public int update(ProcessSectionInformation processSectionInformation) { - return this.processSectionInformationDao.updateByPrimaryKeySelective(processSectionInformation); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessSectionInformation processSectionInformation = new ProcessSectionInformation(); - processSectionInformation.setWhere(wherestr); - List list = this.processSectionInformationDao.selectListByWhere(processSectionInformation); - if(list!=null && list.size()>0){ - for(ProcessSectionInformation item : list){ - if(item!=null && item.getProcessSectionId()!=null){ - ProcessSection processSection = processSectionService.selectById(item.getProcessSectionId()); - if(processSection!=null){ - item.setProcessSection(processSection); - } - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessSectionInformation processSectionInformation = new ProcessSectionInformation(); - processSectionInformation.setWhere(wherestr); - return this.processSectionInformationDao.deleteByWhere(processSectionInformation); - } - -} diff --git a/src/com/sipai/service/process/ProcessWebsiteService.java b/src/com/sipai/service/process/ProcessWebsiteService.java deleted file mode 100644 index a9257fe2..00000000 --- a/src/com/sipai/service/process/ProcessWebsiteService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.process.ProcessWebsiteDao; -import com.sipai.entity.process.ProcessWebsite; -import com.sipai.tools.CommService; - -@Service -public class ProcessWebsiteService implements CommService{ - @Resource - private ProcessWebsiteDao processWebsiteDao; - - - @Override - public ProcessWebsite selectById(String id) { - return this.processWebsiteDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.processWebsiteDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessWebsite entity) { - return this.processWebsiteDao.insert(entity); - } - - @Override - public int update(ProcessWebsite processWebsite) { - return this.processWebsiteDao.updateByPrimaryKeySelective(processWebsite); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessWebsite processWebsite = new ProcessWebsite(); - processWebsite.setWhere(wherestr); - return this.processWebsiteDao.selectListByWhere(processWebsite); - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessWebsite processWebsite = new ProcessWebsite(); - processWebsite.setWhere(wherestr); - return this.processWebsiteDao.deleteByWhere(processWebsite); - } - -} diff --git a/src/com/sipai/service/process/RoutineWorkService.java b/src/com/sipai/service/process/RoutineWorkService.java deleted file mode 100644 index f82bb881..00000000 --- a/src/com/sipai/service/process/RoutineWorkService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.process.RoutineWork; -import java.util.List; - -public interface RoutineWorkService { - - public abstract RoutineWork selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RoutineWork entity); - - public abstract int update(RoutineWork entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract RoutineWork selectByWhere(String wherestr); - - //启动流程 - public abstract int startProcess(RoutineWork entity); - //审核 - public abstract int doAudit(BusinessUnitAudit entity); - //改变状态 - public abstract int updateStatus(String id); - //为作业创建工单 - public abstract String doCreate(String id,String libraryId,String unitId,String typestr,String insdt); - //获取条件下数据条数 - public abstract int selectCountByWhere(String wherestr); -} diff --git a/src/com/sipai/service/process/TestIndexManageService.java b/src/com/sipai/service/process/TestIndexManageService.java deleted file mode 100644 index 9a314476..00000000 --- a/src/com/sipai/service/process/TestIndexManageService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.TestIndexManage; - -public interface TestIndexManageService { - - public abstract TestIndexManage selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(TestIndexManage entity); - - public abstract int update(TestIndexManage entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/TestMethodsService.java b/src/com/sipai/service/process/TestMethodsService.java deleted file mode 100644 index b6938054..00000000 --- a/src/com/sipai/service/process/TestMethodsService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.TestMethods; - -public interface TestMethodsService { - - public abstract TestMethods selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(TestMethods entity); - - public abstract int update(TestMethods entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/TestTaskService.java b/src/com/sipai/service/process/TestTaskService.java deleted file mode 100644 index 10641724..00000000 --- a/src/com/sipai/service/process/TestTaskService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.process; - -import java.util.List; - -import com.sipai.entity.process.TestTask; - -public interface TestTaskService { - - public abstract TestTask selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(TestTask entity); - - public abstract int update(TestTask entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectTop1ListByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/WaterTestDetailService.java b/src/com/sipai/service/process/WaterTestDetailService.java deleted file mode 100644 index fadf72ff..00000000 --- a/src/com/sipai/service/process/WaterTestDetailService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.process.WaterTestDetail; -import java.util.List; - -public interface WaterTestDetailService { - - public abstract WaterTestDetail selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(WaterTestDetail entity); - - public abstract int update(WaterTestDetail entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListForFileByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract WaterTestDetail selectByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/process/WaterTestService.java b/src/com/sipai/service/process/WaterTestService.java deleted file mode 100644 index 00e37f76..00000000 --- a/src/com/sipai/service/process/WaterTestService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.process; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.process.WaterTest; -import java.util.List; - -public interface WaterTestService { - - public abstract WaterTest selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(WaterTest entity); - - public abstract int update(WaterTest entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract WaterTest selectByWhere(String wherestr); - - //启动流程 - public abstract int startProcess(WaterTest entity); - //审核 - public abstract int doAudit(BusinessUnitAudit entity); - //改变状态 - public abstract int updateStatus(String id); - - //改变其他字段(定制) - public abstract int updateOther(String id,String actualTime); -} diff --git a/src/com/sipai/service/process/impl/DataPatrolResultDataServiceImpl.java b/src/com/sipai/service/process/impl/DataPatrolResultDataServiceImpl.java deleted file mode 100644 index 23c2f3e0..00000000 --- a/src/com/sipai/service/process/impl/DataPatrolResultDataServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataPatrolResultDataDao; -import com.sipai.entity.process.DataPatrolResultData; -import com.sipai.service.process.DataPatrolResultDataService; - -@Service -public class DataPatrolResultDataServiceImpl implements DataPatrolResultDataService { - @Resource - private DataPatrolResultDataDao dataPatrolResultDataDao; - @Resource - private MPointService mPointService; - - @Override - public DataPatrolResultData selectById(String id) { - DataPatrolResultData entity = dataPatrolResultDataDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataPatrolResultDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataPatrolResultData entity) { - return dataPatrolResultDataDao.insert(entity); - } - - @Override - public int update(DataPatrolResultData entity) { - return dataPatrolResultDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataPatrolResultData entity = new DataPatrolResultData(); - entity.setWhere(wherestr); - List list = dataPatrolResultDataDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataPatrolResultData entity = new DataPatrolResultData(); - entity.setWhere(wherestr); - return dataPatrolResultDataDao.deleteByWhere(entity); - } - - @Override - public List selectAnyByWhere(String wherestr,String any) { - List list = dataPatrolResultDataDao.selectAnyByWhere(wherestr,any); - return list; - } - -} diff --git a/src/com/sipai/service/process/impl/DataPatrolServiceImpl.java b/src/com/sipai/service/process/impl/DataPatrolServiceImpl.java deleted file mode 100644 index 2ab7b076..00000000 --- a/src/com/sipai/service/process/impl/DataPatrolServiceImpl.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.service.process.impl; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.process.DataPatrolResultData; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.process.DataPatrolResultDataService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataPatrolDao; -import com.sipai.entity.process.DataPatrol; -import com.sipai.service.process.DataPatrolService; - -@Service("dataPatrolService") -public class DataPatrolServiceImpl implements DataPatrolService { - @Resource - private DataPatrolDao dataPatrolDao; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private DataPatrolResultDataService dataPatrolResultDataService; - @Resource - private ProAlarmService proAlarmService; - - - @Override - public DataPatrol selectById(String id) { - DataPatrol entity = dataPatrolDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataPatrolDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataPatrol entity) { - return dataPatrolDao.insert(entity); - } - - @Override - public int update(DataPatrol entity) { - return dataPatrolDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataPatrol entity = new DataPatrol(); - entity.setWhere(wherestr); - List list = dataPatrolDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataPatrol entity = new DataPatrol(); - entity.setWhere(wherestr); - return dataPatrolDao.deleteByWhere(entity); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - @Override - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (DataPatrol k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DataPatrol k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - String unitId = k.getUnitId(); - Map m = new HashMap(); - m.put("id", k.getId().toString()); - String showText = k.getName(); - if (k.getMpid() != null) { - m.put("mpid", k.getMpid()); - MPoint mPoint = this.mPointService.selectById(unitId, k.getMpid()); - - //判断当前状态 - List stlist = this.dataPatrolResultDataService.selectListByWhere(" where mpcode='" + k.getMpid() + "' and unit_id='" + unitId + "' and lastDataSt='1' "); - if (stlist != null && stlist.size() > 0) { - DataPatrolResultData dataPatrolResultData = stlist.get(0); - if (mPoint != null) { - m.put("value", CommUtil.formatMPointValue(dataPatrolResultData.getParmvalue(), mPoint.getNumtail(), mPoint.getRate())); - if (mPoint.getUnit() != null) { - m.put("unit", mPoint.getUnit()); - } -// showText += ":" + mPoint.getParmvalue(); -// if (mPoint.getUnit() != null) { -// showText += " " + mPoint.getUnit(); -// } - } - - String type = dataPatrolResultData.getResult(); -// if (type.equals(DataPatrolResultData.Result_0)) { -// m.put("resultColor", DataPatrolResultData.Result_0_Color); -// } - if (type.equals(DataPatrolResultData.Result_1)) { - m.put("resultColor", DataPatrolResultData.Result_1_Color); - } else if (type.equals(DataPatrolResultData.Result_2)) { - m.put("resultColor", DataPatrolResultData.Result_2_Color); - } else if (type.equals(DataPatrolResultData.Result_3)) { - m.put("resultColor", DataPatrolResultData.Result_3_Color); - } else if (type.equals(DataPatrolResultData.Result_4)) { - m.put("resultColor", DataPatrolResultData.Result_4_Color); - } else if (type.equals(DataPatrolResultData.Result_5)) { - m.put("resultColor", DataPatrolResultData.Result_5_Color); - } - m.put("resultType", type); - } else { - if (mPoint != null) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - m.put("value", parmValue); - } else { - m.put("value", "-999"); - } - if (mPoint.getUnit() != null) { - m.put("unit", mPoint.getUnit()); - } - m.put("resultType", "0"); - m.put("resultColor", DataPatrolResultData.Result_0_Color); - } - } - - m.put("text", showText); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - @Override - public String getTreeList1(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (DataPatrol k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList1(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DataPatrol k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - String unitId = k.getUnitId(); - Map m = new HashMap(); - m.put("id", k.getId().toString()); - String showText = k.getName(); - - m.put("text", showText); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList1(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - - @Override - public String getDataPatrolSt(String mpCodes, String unitId) { - // 0正常 1数据中断 2数据停滞 3超上限 4超下限 5异常趋势 - JSONArray jsonArray = new JSONArray(); - try { - - String[] mpCodess = mpCodes.split(","); - String nowTime = CommUtil.nowDate(); - - JSONObject outShowOjb = new JSONObject(); - if (mpCodess != null && mpCodess.length > 0) { - this.dataPatrolResultDataService.deleteByWhere(""); - - for (String mpCode : - mpCodess) { -// System.out.println(mpCode); - String st = DataPatrolResultData.Result_0; - - MPoint mPoint = this.mPointService.selectById(unitId, mpCode); - if (mPoint != null) { - - - BigDecimal parmvalue = mPoint.getParmvalue(); - String pointTime = mPoint.getMeasuredt(); - - long diffTime = CommUtil.getDays2(nowTime, pointTime, "min"); - if ((diffTime) > 15) {//数据中断 - st = DataPatrolResultData.Result_1; - } else { - String diffDate = CommUtil.subplus(nowTime, "-15", "min"); - List hisList = this.mPointHistoryService.selectReportList(unitId, "tb_mp_" + mpCode, " where MeasureDT>='" + diffDate + "' and MeasureDT<='" + nowTime + "' ", "distinct ParmValue "); - if (hisList.size() == 1) { - st = DataPatrolResultData.Result_2; - } else { - BigDecimal alarmmax = mPoint.getAlarmmax(); - BigDecimal halarmmax = mPoint.getHalarmmax(); - BigDecimal alarmmin = mPoint.getAlarmmin(); - BigDecimal lalarmmin = mPoint.getLalarmmin(); - - - if (halarmmax != null) { - if (parmvalue.floatValue() > halarmmax.floatValue()) {//上极限 - st = DataPatrolResultData.Result_3; - } else if (parmvalue.floatValue() > alarmmax.floatValue() && parmvalue.floatValue() <= halarmmax.floatValue()) {//上限 - st = DataPatrolResultData.Result_3; - } - } else { - if (alarmmax != null) { - if (parmvalue.floatValue() > alarmmax.floatValue()) {//上限 - st = DataPatrolResultData.Result_3; - } - } - } - - if (lalarmmin != null) { - if (parmvalue.floatValue() < lalarmmin.floatValue()) {//下极限 - st = DataPatrolResultData.Result_4; - } else if (parmvalue.floatValue() < alarmmax.floatValue() && parmvalue.floatValue() >= lalarmmin.floatValue()) {//下限 - st = DataPatrolResultData.Result_4; - } - } else { - if (alarmmin != null) { - if (parmvalue.floatValue() < alarmmin.floatValue()) {//下限 - st = DataPatrolResultData.Result_4; - } - } - } - } - } - - JSONObject reJSONObject = new JSONObject(); - reJSONObject.put("mpointId", mpCode); - reJSONObject.put("mpointCode", mpCode); - reJSONObject.put("mpointName", mPoint.getParmname()); - reJSONObject.put("numtail", mPoint.getNumtail()); - reJSONObject.put("paramValue", parmvalue); - reJSONObject.put("unit", mPoint.getUnit()); - reJSONObject.put("type", st); - jsonArray.add(reJSONObject); - - - DataPatrolResultData dataPatrolResultData = new DataPatrolResultData(); - dataPatrolResultData.setId(CommUtil.getUUID()); - dataPatrolResultData.setMpcode(mpCode); - dataPatrolResultData.setUnitId(mPoint.getUnit()); - dataPatrolResultData.setResult(st); - this.dataPatrolResultDataService.save(dataPatrolResultData); - } - - } - - } - } catch (Exception e) { - System.out.println(e); - } - return jsonArray.toString(); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualBarChartSeriesServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualBarChartSeriesServiceImpl.java deleted file mode 100644 index 1ba27ff7..00000000 --- a/src/com/sipai/service/process/impl/DataVisualBarChartSeriesServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualBarChartSeriesDao; -import com.sipai.entity.process.DataVisualBarChartSeries; -import com.sipai.service.process.DataVisualBarChartSeriesService; - -@Service -public class DataVisualBarChartSeriesServiceImpl implements DataVisualBarChartSeriesService { - @Resource - private DataVisualBarChartSeriesDao dataVisualBarChartSeriesDao; - - @Override - public DataVisualBarChartSeries selectById(String id) { - DataVisualBarChartSeries entity = dataVisualBarChartSeriesDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualBarChartSeriesDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualBarChartSeries entity) { - return dataVisualBarChartSeriesDao.insert(entity); - } - - @Override - public int update(DataVisualBarChartSeries entity) { - return dataVisualBarChartSeriesDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualBarChartSeries entity = new DataVisualBarChartSeries(); - entity.setWhere(wherestr); - List list = dataVisualBarChartSeriesDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualBarChartSeries entity = new DataVisualBarChartSeries(); - entity.setWhere(wherestr); - return dataVisualBarChartSeriesDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualBarChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualBarChartServiceImpl.java deleted file mode 100644 index db1c6888..00000000 --- a/src/com/sipai/service/process/impl/DataVisualBarChartServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualBarChartDao; -import com.sipai.entity.process.DataVisualBarChart; -import com.sipai.service.process.DataVisualBarChartService; - -@Service -public class DataVisualBarChartServiceImpl implements DataVisualBarChartService { - @Resource - private DataVisualBarChartDao dataVisualBarChartDao; - - @Override - public DataVisualBarChart selectById(String id) { - DataVisualBarChart entity = dataVisualBarChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualBarChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualBarChart entity) { - return dataVisualBarChartDao.insert(entity); - } - - @Override - public int update(DataVisualBarChart entity) { - return dataVisualBarChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualBarChart entity = new DataVisualBarChart(); - entity.setWhere(wherestr); - List list = dataVisualBarChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualBarChart entity = new DataVisualBarChart(); - entity.setWhere(wherestr); - return dataVisualBarChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualBarChartYAxisServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualBarChartYAxisServiceImpl.java deleted file mode 100644 index 0302c94f..00000000 --- a/src/com/sipai/service/process/impl/DataVisualBarChartYAxisServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualBarChartYAxisDao; -import com.sipai.entity.process.DataVisualBarChartYAxis; -import com.sipai.service.process.DataVisualBarChartYAxisService; - -@Service -public class DataVisualBarChartYAxisServiceImpl implements DataVisualBarChartYAxisService { - @Resource - private DataVisualBarChartYAxisDao dataVisualBarChartYAxisDao; - - @Override - public DataVisualBarChartYAxis selectById(String id) { - DataVisualBarChartYAxis entity = dataVisualBarChartYAxisDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualBarChartYAxisDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualBarChartYAxis entity) { - return dataVisualBarChartYAxisDao.insert(entity); - } - - @Override - public int update(DataVisualBarChartYAxis entity) { - return dataVisualBarChartYAxisDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualBarChartYAxis entity = new DataVisualBarChartYAxis(); - entity.setWhere(wherestr); - List list = dataVisualBarChartYAxisDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualBarChartYAxis entity = new DataVisualBarChartYAxis(); - entity.setWhere(wherestr); - return dataVisualBarChartYAxisDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualCameraAlarmServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualCameraAlarmServiceImpl.java deleted file mode 100644 index a72f670b..00000000 --- a/src/com/sipai/service/process/impl/DataVisualCameraAlarmServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualCameraAlarmDao; -import com.sipai.entity.process.DataVisualCameraAlarm; -import com.sipai.service.process.DataVisualCameraAlarmService; - -@Service -public class DataVisualCameraAlarmServiceImpl implements DataVisualCameraAlarmService { - @Resource - private DataVisualCameraAlarmDao dataVisualCameraAlarmDao; - - @Override - public DataVisualCameraAlarm selectById(String id) { - DataVisualCameraAlarm entity = dataVisualCameraAlarmDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualCameraAlarmDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualCameraAlarm entity) { - return dataVisualCameraAlarmDao.insert(entity); - } - - @Override - public int update(DataVisualCameraAlarm entity) { - return dataVisualCameraAlarmDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualCameraAlarm entity = new DataVisualCameraAlarm(); - entity.setWhere(wherestr); - List list = dataVisualCameraAlarmDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualCameraAlarm entity = new DataVisualCameraAlarm(); - entity.setWhere(wherestr); - return dataVisualCameraAlarmDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualCameraServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualCameraServiceImpl.java deleted file mode 100644 index 1870bbe7..00000000 --- a/src/com/sipai/service/process/impl/DataVisualCameraServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualCameraDao; -import com.sipai.entity.process.DataVisualCamera; -import com.sipai.entity.work.Camera; -import com.sipai.service.process.DataVisualCameraService; -import com.sipai.service.work.CameraService; - -@Service -public class DataVisualCameraServiceImpl implements DataVisualCameraService { - @Resource - private DataVisualCameraDao dataVisualCameraDao; - @Resource - private CameraService cameraService; - - @Override - public DataVisualCamera selectById(String id) { - DataVisualCamera entity = dataVisualCameraDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualCameraDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualCamera entity) { - return dataVisualCameraDao.insert(entity); - } - - @Override - public int update(DataVisualCamera entity) { - return dataVisualCameraDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualCamera entity = new DataVisualCamera(); - entity.setWhere(wherestr); - List list = dataVisualCameraDao.selectListByWhere(entity); - for (DataVisualCamera dataVisualCamera : list) { - Camera camera=this.cameraService.selectById(dataVisualCamera.getCameraid()); - dataVisualCamera.setCamera(camera); - } - - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualCamera entity = new DataVisualCamera(); - entity.setWhere(wherestr); - return dataVisualCameraDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualContentServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualContentServiceImpl.java deleted file mode 100644 index 68373b6f..00000000 --- a/src/com/sipai/service/process/impl/DataVisualContentServiceImpl.java +++ /dev/null @@ -1,317 +0,0 @@ -package com.sipai.service.process.impl; - -import java.io.File; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.process.DataVisualTab; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.process.*; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.work.WeatherNewService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualContentDao; -import com.sipai.entity.process.DataVisualContent; - -@Service("dataVisualContentService") -public class DataVisualContentServiceImpl implements DataVisualContentService { - @Resource - private DataVisualContentDao dataVisualContentDao; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private DataVisualTabService dataVisualTabService; - @Resource - private DataVisualMPointService dataVisualMPointService; - @Resource - private DataVisualTextService dataVisualTextService; - @Resource - private DataVisualCameraService dataVisualCameraService; - @Resource - private DataVisualCameraAlarmService dataVisualCameraAlarmService; - @Resource - private DataVisualFormService dataVisualFormService; - @Resource - private DataVisualLineChartService dataVisualLineChartService; - @Resource - private DataVisualLineChartSeriesService dataVisualLineChartSeriesService; - @Resource - private DataVisualLineChartYAxisService dataVisualLineChartYAxisService; - @Resource - private DataVisualBarChartService dataVisualBarChartService; - @Resource - private DataVisualBarChartSeriesService dataVisualBarChartSeriesService; - @Resource - private DataVisualBarChartYAxisService dataVisualBarChartYAxisService; - @Resource - private DataVisualPercentChartService dataVisualPercentChartService; - @Resource - private DataVisualRadarChartService dataVisualRadarChartService; - @Resource - private DataVisualRadarChartSeriesService dataVisualRadarChartSeriesService; - @Resource - private DataVisualRadarChartAxisService dataVisualRadarChartAxisService; - @Resource - private DataVisualPieChartService dataVisualPieChartService; - @Resource - private DataVisualPieChartSeriesService dataVisualPieChartSeriesService; - @Resource - private DataVisualGaugeChartService dataVisualGaugeChartService; - @Resource - private DataVisualDateService dataVisualDateService; - @Resource - private DataVisualDateSelectService dataVisualDateSelectService; - @Resource - private DataVisualMpViewService dataVisualMpViewService; - @Resource - private DataVisualProgressBarChartService dataVisualProgressBarChartService; - @Resource - private DataVisualSuspensionFrameService dataVisualSuspensionFrameService; - @Resource - private DataVisualPolarCoordinatesService dataVisualPolarCoordinatesService; - @Resource - private DataVisualPolarCoordinatesSeriesService dataVisualPolarCoordinatesSeriesService; - @Resource - private DataVisualWeatherService dataVisualWeatherService; - @Resource - private CommonFileService commonFileService; - @Resource - private DataVisualFrameContainerService dataVisualFrameContainerService; - @Resource - private DataVisualSwitchService dataVisualSwitchService; - @Resource - private DataVisualSwitchPointService dataVisualSwitchPointService; - @Resource - private DataVisualPersonnelPositioningService dataVisualPersonnelPositioningService; - @Resource - private DataVisualSvgService dataVisualSvgService; - @Resource - private DataVisualFormShowStyleService dataVisualFormShowStyleService; - @Resource - private DataVisualFormSqlPointService dataVisualFormSqlPointService; - @Resource - private DataVisualTaskPointsService dataVisualTaskPointsService; - @Resource - private DataVisualEqPointsService dataVisualEqPointsService; - @Resource - private DataVisualSelectService dataVisualSelectService; - - @Override - public DataVisualContent selectById(String id) { - DataVisualContent entity = dataVisualContentDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualContentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualContent entity) { - return dataVisualContentDao.insert(entity); - } - - @Override - public int update(DataVisualContent entity) { - return dataVisualContentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualContent entity = new DataVisualContent(); - entity.setWhere(wherestr); - List list = dataVisualContentDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualContent entity = new DataVisualContent(); - entity.setWhere(wherestr); - return dataVisualContentDao.deleteByWhere(entity); - } - - @Override - public void deleteContentById(String id, String type, String did) { - if (type.equals(DataVisualContent.Type_DataPoint) || type.equals(DataVisualContent.Type_SignalPoint)) { - this.dataVisualMPointService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_Text)) { - this.dataVisualTextService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_Camera)) { - this.dataVisualCameraService.deleteById(did); - this.dataVisualCameraAlarmService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_Form)) { - this.dataVisualFormService.deleteByWhere(" where frameId='" + id + "' "); - this.dataVisualFormShowStyleService.deleteByWhere(" where pid='" + did + "' "); - this.dataVisualFormSqlPointService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_LineChart)) { - this.dataVisualLineChartService.deleteById(did); - this.dataVisualLineChartSeriesService.deleteByWhere(" where pid='" + did + "' "); - this.dataVisualLineChartYAxisService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_BarChart)) { - this.dataVisualBarChartService.deleteById(did); - this.dataVisualBarChartSeriesService.deleteByWhere(" where pid='" + did + "' "); - this.dataVisualBarChartYAxisService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_PercentChart)) { - this.dataVisualPercentChartService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_RadarChart)) { - this.dataVisualRadarChartService.deleteById(did); - this.dataVisualRadarChartSeriesService.deleteByWhere(" where pid='" + did + "' "); - this.dataVisualRadarChartAxisService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_PieChart)) { - this.dataVisualPieChartService.deleteById(did); - this.dataVisualPieChartSeriesService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_Picture)) { - List commfiles = this.commonFileService.selectListByTableAWhere("tb_pro_dataVisual_picture_file", "where masterid='" + id + "'"); - if (commfiles != null && commfiles.size() > 0) { - File file = new File(commfiles.get(0).getAbspath()); - if (file.exists()) { - file.delete();//删除文件 - } - this.commonFileService.deleteByTableAWhere("tb_pro_dataVisual_picture_file", "where masterid='" + id + "'"); - } - } else if (type.equals(DataVisualContent.Type_GaugeChart)) { - this.dataVisualGaugeChartService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_Date)) { - this.dataVisualDateService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_Weather)) { - this.dataVisualWeatherService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_Tab)) { - this.dataVisualTabService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_MpView)) { - this.dataVisualMpViewService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_ProgressBar)) { - this.dataVisualProgressBarChartService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_DateSelect)) { - this.dataVisualDateSelectService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_SuspensionFrame)) { - this.dataVisualSuspensionFrameService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_PolarCoordinates)) { - this.dataVisualPolarCoordinatesService.deleteById(did); - this.dataVisualPolarCoordinatesSeriesService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_Switch)) { - this.dataVisualSwitchService.deleteById(did); - this.dataVisualSwitchPointService.deleteByWhere(" where pid='" + did + "' "); - } else if (type.equals(DataVisualContent.Type_PersonnelPositioning)) { - this.dataVisualPersonnelPositioningService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_Svg)) { - this.dataVisualSvgService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_TaskPoints)) { - this.dataVisualTaskPointsService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_EqPoints)) { - this.dataVisualEqPointsService.deleteById(did); - } else if (type.equals(DataVisualContent.Type_SelectJump)) { - this.dataVisualSelectService.deleteByWhere(" where pid='" + did + "' "); - } - } - - @Override - public int updateFixedByWhere(String wherestr, String fixedSt) { - return dataVisualContentDao.updateFixedByWhere(wherestr, fixedSt); - } - - public MPoint getMpointJsonForEXAndDV(String mpid, String valuemethod, String sdt, String edt) { - if (sdt != null && sdt.length() > 10) { - } else { - sdt += " 00:00"; - } - if (edt != null && edt.length() > 0) { - if (edt != null && edt.length() > 10) { - } else { - edt += " 23:59"; - } - } else { - edt = sdt + " 23:59"; - } - - MPoint mPoint = this.mPointService.selectById(mpid); - if (valuemethod.equals("nowTime")) { - - } else { - String unitId = mPoint.getBizid(); - String whereString = ""; - List mpVlist = new ArrayList<>(); - if (valuemethod.equals("first")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt desc "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " top 1 * "); - } else if (valuemethod.equals("last")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') order by measuredt "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " top 1 * "); - } else if (valuemethod.equals("diff")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " (max(ParmValue)-min(ParmValue)) as ParmValue "); - } else if (valuemethod.equals("avg")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " avg(ParmValue) as ParmValue "); - } else if (valuemethod.equals("min")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " min(ParmValue) as ParmValue "); - } else if (valuemethod.equals("max")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " max(ParmValue) as ParmValue "); - } else if (valuemethod.equals("sum")) { - whereString = " where (MeasureDT>='" + sdt + "' and MeasureDT<='" + edt + "') "; - mpVlist = mPointHistoryService - .selectAggregateList(unitId, "tb_mp_" + mpid, whereString, " sum(ParmValue) as ParmValue "); - } - - if (mpVlist != null && mpVlist.size() > 0) { - if (mpVlist.get(0) != null) { - mPoint.setParmvalue(mpVlist.get(0).getParmvalue()); - BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - } else { - mPoint.setParmvalue(new BigDecimal(0)); - } - } - - } - -// model.addAttribute("result", JSONArray.fromObject(mPoint)); - return mPoint; - } - - - String contentId = ""; - - public String getContentId(String assemblyId) { - DataVisualContent dataVisualContent = selectById(assemblyId); - - DataVisualTab dataVisualTab = this.dataVisualTabService.selectById(dataVisualContent.getPid()); - if (dataVisualTab != null) { - DataVisualContent lastDataVisualContent = selectById(dataVisualTab.getPid()); - getContentId(lastDataVisualContent.getId()); - } else { - contentId = dataVisualContent.getPid(); - } - return contentId; - } - - @Override - public List selectDistinctTypeListByWhere(String wherestr) { - List list = dataVisualContentDao.selectDistinctTypeListByWhere(wherestr); - return list; - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualDateSelectServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualDateSelectServiceImpl.java deleted file mode 100644 index d90b6105..00000000 --- a/src/com/sipai/service/process/impl/DataVisualDateSelectServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualDateSelectDao; -import com.sipai.entity.process.DataVisualDateSelect; -import com.sipai.service.process.DataVisualDateSelectService; - -@Service -public class DataVisualDateSelectServiceImpl implements DataVisualDateSelectService { - @Resource - private DataVisualDateSelectDao dataVisualDateSelectDao; - - @Override - public DataVisualDateSelect selectById(String id) { - DataVisualDateSelect entity = dataVisualDateSelectDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualDateSelectDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualDateSelect entity) { - return dataVisualDateSelectDao.insert(entity); - } - - @Override - public int update(DataVisualDateSelect entity) { - return dataVisualDateSelectDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualDateSelect entity = new DataVisualDateSelect(); - entity.setWhere(wherestr); - List list = dataVisualDateSelectDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualDateSelect entity = new DataVisualDateSelect(); - entity.setWhere(wherestr); - return dataVisualDateSelectDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualDateServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualDateServiceImpl.java deleted file mode 100644 index 124e6bdb..00000000 --- a/src/com/sipai/service/process/impl/DataVisualDateServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualDateDao; -import com.sipai.entity.process.DataVisualDate; -import com.sipai.service.process.DataVisualDateService; - -@Service -public class DataVisualDateServiceImpl implements DataVisualDateService { - @Resource - private DataVisualDateDao dataVisualDateDao; - - @Override - public DataVisualDate selectById(String id) { - DataVisualDate entity = dataVisualDateDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualDateDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualDate entity) { - return dataVisualDateDao.insert(entity); - } - - @Override - public int update(DataVisualDate entity) { - return dataVisualDateDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualDate entity = new DataVisualDate(); - entity.setWhere(wherestr); - List list = dataVisualDateDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualDate entity = new DataVisualDate(); - entity.setWhere(wherestr); - return dataVisualDateDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualEqPointsServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualEqPointsServiceImpl.java deleted file mode 100644 index 3878188d..00000000 --- a/src/com/sipai/service/process/impl/DataVisualEqPointsServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.HashMap; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.service.equipment.EquipmentCardService; -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualEqPointsDao; -import com.sipai.entity.process.DataVisualEqPoints; -import com.sipai.service.process.DataVisualEqPointsService; - -@Service -public class DataVisualEqPointsServiceImpl implements DataVisualEqPointsService { - @Resource - private DataVisualEqPointsDao dataVisualEqPointsDao; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public DataVisualEqPoints selectById(String id) { - DataVisualEqPoints entity = dataVisualEqPointsDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualEqPointsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualEqPoints entity) { - return dataVisualEqPointsDao.insert(entity); - } - - @Override - public int update(DataVisualEqPoints entity) { - return dataVisualEqPointsDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualEqPoints entity = new DataVisualEqPoints(); - entity.setWhere(wherestr); - List list = dataVisualEqPointsDao.selectListByWhere(entity); - for (DataVisualEqPoints dataVisualEqPoints : - list) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(dataVisualEqPoints.getEqid()); - if (equipmentCard != null) { - dataVisualEqPoints.setEqName(equipmentCard.getEquipmentname()); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualEqPoints entity = new DataVisualEqPoints(); - entity.setWhere(wherestr); - return dataVisualEqPointsDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualFormServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualFormServiceImpl.java deleted file mode 100644 index 3c10216b..00000000 --- a/src/com/sipai/service/process/impl/DataVisualFormServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualFormDao; -import com.sipai.entity.process.DataVisualForm; -import com.sipai.service.process.DataVisualFormService; - -@Service -public class DataVisualFormServiceImpl implements DataVisualFormService { - @Resource - private DataVisualFormDao dataVisualFormDao; - - @Override - public DataVisualForm selectById(String id) { - DataVisualForm entity = dataVisualFormDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualFormDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualForm entity) { - return dataVisualFormDao.insert(entity); - } - - @Override - public int update(DataVisualForm entity) { - return dataVisualFormDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualForm entity = new DataVisualForm(); - entity.setWhere(wherestr); - List list = dataVisualFormDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualForm entity = new DataVisualForm(); - entity.setWhere(wherestr); - return dataVisualFormDao.deleteByWhere(entity); - } - - public List> getSpData(String content) { - return dataVisualFormDao.getSpData(content); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualFormShowStyleServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualFormShowStyleServiceImpl.java deleted file mode 100644 index a4b0c718..00000000 --- a/src/com/sipai/service/process/impl/DataVisualFormShowStyleServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualFormShowStyleDao; -import com.sipai.entity.process.DataVisualFormShowStyle; -import com.sipai.service.process.DataVisualFormShowStyleService; - -@Service -public class DataVisualFormShowStyleServiceImpl implements DataVisualFormShowStyleService { - @Resource - private DataVisualFormShowStyleDao dataVisualFormShowStyleDao; - - @Override - public DataVisualFormShowStyle selectById(String id) { - DataVisualFormShowStyle entity = dataVisualFormShowStyleDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualFormShowStyleDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualFormShowStyle entity) { - return dataVisualFormShowStyleDao.insert(entity); - } - - @Override - public int update(DataVisualFormShowStyle entity) { - return dataVisualFormShowStyleDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualFormShowStyle entity = new DataVisualFormShowStyle(); - entity.setWhere(wherestr); - List list = dataVisualFormShowStyleDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualFormShowStyle entity = new DataVisualFormShowStyle(); - entity.setWhere(wherestr); - return dataVisualFormShowStyleDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualFormSqlPointServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualFormSqlPointServiceImpl.java deleted file mode 100644 index 424a1e83..00000000 --- a/src/com/sipai/service/process/impl/DataVisualFormSqlPointServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualFormSqlPointDao; -import com.sipai.entity.process.DataVisualFormSqlPoint; -import com.sipai.service.process.DataVisualFormSqlPointService; - -@Service -public class DataVisualFormSqlPointServiceImpl implements DataVisualFormSqlPointService { - @Resource - private DataVisualFormSqlPointDao dataVisualFormSqlPointDao; - - @Override - public DataVisualFormSqlPoint selectById(String id) { - DataVisualFormSqlPoint entity = dataVisualFormSqlPointDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualFormSqlPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualFormSqlPoint entity) { - return dataVisualFormSqlPointDao.insert(entity); - } - - @Override - public int update(DataVisualFormSqlPoint entity) { - return dataVisualFormSqlPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualFormSqlPoint entity = new DataVisualFormSqlPoint(); - entity.setWhere(wherestr); - List list = dataVisualFormSqlPointDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualFormSqlPoint entity = new DataVisualFormSqlPoint(); - entity.setWhere(wherestr); - return dataVisualFormSqlPointDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualFrameContainerServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualFrameContainerServiceImpl.java deleted file mode 100644 index 464e4869..00000000 --- a/src/com/sipai/service/process/impl/DataVisualFrameContainerServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualFrameContainerDao; -import com.sipai.entity.process.DataVisualFrameContainer; -import com.sipai.service.process.DataVisualFrameContainerService; - -@Service("dataVisualFrameContainerService") -public class DataVisualFrameContainerServiceImpl implements DataVisualFrameContainerService { - @Resource - private DataVisualFrameContainerDao dataVisualFrameContainerDao; - - @Override - public DataVisualFrameContainer selectById(String id) { - DataVisualFrameContainer entity = dataVisualFrameContainerDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualFrameContainerDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualFrameContainer entity) { - return dataVisualFrameContainerDao.insert(entity); - } - - @Override - public int update(DataVisualFrameContainer entity) { - return dataVisualFrameContainerDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualFrameContainer entity = new DataVisualFrameContainer(); - entity.setWhere(wherestr); - List list = dataVisualFrameContainerDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualFrameContainer entity = new DataVisualFrameContainer(); - entity.setWhere(wherestr); - return dataVisualFrameContainerDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualFrameServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualFrameServiceImpl.java deleted file mode 100644 index 04841dcf..00000000 --- a/src/com/sipai/service/process/impl/DataVisualFrameServiceImpl.java +++ /dev/null @@ -1,1303 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.process.*; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.process.*; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.WeatherNewService; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualFrameDao; -import com.sipai.entity.data.CurveMpoint; - -@Service("dataVisualFrameService") -public class DataVisualFrameServiceImpl implements DataVisualFrameService { - @Resource - private DataVisualFrameDao dataVisualFrameDao; - @Resource - private UserService userService; - @Resource - private DataVisualTabService dataVisualTabService; - @Resource - private DataVisualMPointService dataVisualMPointService; - @Resource - private DataVisualTextService dataVisualTextService; - @Resource - private DataVisualCameraService dataVisualCameraService; - @Resource - private DataVisualFormService dataVisualFormService; - @Resource - private DataVisualLineChartService dataVisualLineChartService; - @Resource - private DataVisualLineChartSeriesService dataVisualLineChartSeriesService; - @Resource - private DataVisualLineChartYAxisService dataVisualLineChartYAxisService; - @Resource - private DataVisualBarChartService dataVisualBarChartService; - @Resource - private DataVisualBarChartSeriesService dataVisualBarChartSeriesService; - @Resource - private DataVisualBarChartYAxisService dataVisualBarChartYAxisService; - @Resource - private DataVisualPercentChartService dataVisualPercentChartService; - @Resource - private DataVisualRadarChartService dataVisualRadarChartService; - @Resource - private DataVisualRadarChartSeriesService dataVisualRadarChartSeriesService; - @Resource - private DataVisualRadarChartAxisService dataVisualRadarChartAxisService; - @Resource - private DataVisualPieChartService dataVisualPieChartService; - @Resource - private DataVisualPieChartSeriesService dataVisualPieChartSeriesService; - @Resource - private DataVisualGaugeChartService dataVisualGaugeChartService; - @Resource - private DataVisualDateService dataVisualDateService; - @Resource - private DataVisualDateSelectService dataVisualDateSelectService; - @Resource - private DataVisualMpViewService dataVisualMpViewService; - @Resource - private DataVisualProgressBarChartService dataVisualProgressBarChartService; - @Resource - private DataVisualSuspensionFrameService dataVisualSuspensionFrameService; - @Resource - private DataVisualPolarCoordinatesService dataVisualPolarCoordinatesService; - @Resource - private DataVisualPolarCoordinatesSeriesService dataVisualPolarCoordinatesSeriesService; - @Resource - private DataVisualWeatherService dataVisualWeatherService; - @Resource - private CommonFileService commonFileService; - @Resource - private DataVisualFrameContainerService dataVisualFrameContainerService; - @Resource - private WeatherNewService weatherNewService; - @Resource - private DataVisualContentService dataVisualContentService; - @Resource - private DataVisualCameraAlarmService dataVisualCameraAlarmService; - @Resource - private DataVisualFormShowStyleService dataVisualFormShowStyleService; - @Resource - private DataVisualFormSqlPointService dataVisualFormSqlPointService; - @Resource - private DataVisualPersonnelPositioningService dataVisualPersonnelPositioningService; - @Resource - private DataVisualSvgService dataVisualSvgService; - @Resource - private DataVisualSvgAlarmService dataVisualSvgAlarmService; - @Resource - private DataVisualSwitchService dataVisualSwitchService; - @Resource - private DataVisualSwitchPointService dataVisualSwitchPointService; - @Resource - private DataVisualSelectService dataVisualSelectService; - @Resource - private MPointService mPointService; - - @Override - public DataVisualFrame selectById(String id) { - DataVisualFrame entity = dataVisualFrameDao.selectByPrimaryKey(id); - if (entity != null && StringUtils.isNotBlank(entity.getRolepeople())) { -// if (entity.getRolepeople() != null && entity.getRolepeople().length() > 0) { - String rolepeopleName = this.userService.getUserNamesByUserIds(entity.getRolepeople()); - entity.setRolepeopleName(rolepeopleName); - } - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualFrameDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualFrame entity) { - return dataVisualFrameDao.insert(entity); - } - - @Override - public int update(DataVisualFrame entity) { - return dataVisualFrameDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualFrame entity = new DataVisualFrame(); - entity.setWhere(wherestr); - List list = dataVisualFrameDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualFrame entity = new DataVisualFrame(); - entity.setWhere(wherestr); - return dataVisualFrameDao.deleteByWhere(entity); - } - - @Override - public int morderUpBywhere(String wherestr) { - DataVisualFrame entity = new DataVisualFrame(); - entity.setWhere(wherestr); - return dataVisualFrameDao.morderUpBywhere(entity); - } - - @Override - public int morderDownBywhere(String wherestr) { - DataVisualFrame entity = new DataVisualFrame(); - entity.setWhere(wherestr); - return dataVisualFrameDao.morderDownBywhere(entity); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - @Override - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (DataVisualFrame k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(DataVisualFrame.Type_structure)) { - map.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } else if (k.getType().equals(DataVisualFrame.Type_frame)) { - map.put("icon", "fa fa-photo"); - //m.put("color", "#357ca5"); - } - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DataVisualFrame k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - if (k.getType().equals(DataVisualFrame.Type_structure)) { - m.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - } else if (k.getType().equals(DataVisualFrame.Type_frame)) { - m.put("icon", "fa fa-photo"); - //m.put("color", "#357ca5"); - } - - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - - @Override - public void deleteAllContentFromFrameId(String frameId) { - List ckfclist = this.dataVisualFrameContainerService.selectListByWhere(" where type='" + DataVisualFrameContainer.Type_column + "' and frameId='" + frameId + "' order by rows,columns "); - for (DataVisualFrameContainer ckfc : - ckfclist) { - String ckfcCId = ckfc.getId(); - List contentlist = this.dataVisualContentService.selectListByWhere(" where pid='" + ckfcCId + "' "); - for (DataVisualContent ckContent : - contentlist) { - String id = ckContent.getId(); - String type = ckContent.getType(); - this.dataVisualContentService.deleteById(id); - - if (type.equals(DataVisualContent.Type_DataPoint) || type.equals(DataVisualContent.Type_SignalPoint)) { - DataVisualMPoint dcontnet = this.dataVisualMPointService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_Text)) { - DataVisualText dcontnet = this.dataVisualTextService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_Camera)) { - DataVisualCamera dcontnet = this.dataVisualCameraService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_Form)) { - this.dataVisualContentService.deleteContentById(id, type, id); - } else if (type.equals(DataVisualContent.Type_LineChart)) { - DataVisualLineChart dcontnet = this.dataVisualLineChartService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_BarChart)) { - DataVisualBarChart dcontnet = this.dataVisualBarChartService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_PercentChart)) { - DataVisualPercentChart dcontnet = this.dataVisualPercentChartService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_RadarChart)) { - DataVisualRadarChart dcontnet = this.dataVisualRadarChartService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_Picture)) { - this.dataVisualContentService.deleteContentById(id, type, id); - } else if (type.equals(DataVisualContent.Type_GaugeChart)) { - DataVisualGaugeChart dcontnet = this.dataVisualGaugeChartService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_Date)) { - DataVisualDate dcontnet = this.dataVisualDateService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_Weather)) { - DataVisualWeather dcontnet = this.dataVisualWeatherService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_MpView)) { - this.dataVisualContentService.deleteContentById(id, type, id); - } else if (type.equals(DataVisualContent.Type_ProgressBar)) { - DataVisualProgressBarChart dcontnet = this.dataVisualProgressBarChartService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_DateSelect)) { - DataVisualDateSelect dcontnet = this.dataVisualDateSelectService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_SuspensionFrame)) { - DataVisualSuspensionFrame dcontnet = this.dataVisualSuspensionFrameService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_PolarCoordinates)) { - DataVisualPolarCoordinates dcontnet = this.dataVisualPolarCoordinatesService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } else if (type.equals(DataVisualContent.Type_SelectJump)) { - DataVisualSelect dcontnet = this.dataVisualSelectService.selectListByWhere(" where pid='" + id + "' ").get(0); - String did = dcontnet.getId(); - this.dataVisualContentService.deleteContentById(id, type, did); - } - } - } - } - - @Override - public void copyFrame(String ckid, String id) { - //获取需要被拷贝的画面的第一个DataVisualFrameContainer column id - List fclist = this.dataVisualFrameContainerService.selectListByWhere(" where type='" + DataVisualFrameContainer.Type_column + "' and frameId='" + id + "' order by rows,columns "); - String columnId = fclist.get(0).getId(); - - List ckfclist = this.dataVisualFrameContainerService.selectListByWhere(" where type='" + DataVisualFrameContainer.Type_column + "' and frameId='" + ckid + "' order by rows,columns "); - for (DataVisualFrameContainer ckfc : - ckfclist) { - String ckfcCId = ckfc.getId(); - List contentlist = this.dataVisualContentService.selectListByWhere(" where pid='" + ckfcCId + "' "); - for (DataVisualContent ckContent : - contentlist) { - String ckContentId = ckContent.getId(); - DataVisualContent newDataVisualContent = ckContent; - String nowContentId = CommUtil.getUUID(); - newDataVisualContent.setId(nowContentId); - newDataVisualContent.setPid(columnId); - this.dataVisualContentService.save(newDataVisualContent); - - String type = ckContent.getType(); - - if (type.equals(DataVisualContent.Type_Tab)) { - List dlist = this.dataVisualTabService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualTab dc : - dlist) { - DataVisualTab newD = dc; - String tabid = CommUtil.getUUID(); - String oldTabId = newD.getId(); - newD.setId(tabid); - newD.setPid(nowContentId); - this.dataVisualTabService.save(newD); - copyFrameContentForTab(oldTabId, tabid); - } - } else if (type.equals(DataVisualContent.Type_DataPoint) || type.equals(DataVisualContent.Type_SignalPoint)) { - List dlist = this.dataVisualMPointService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualMPoint dc : - dlist) { - DataVisualMPoint newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualMPointService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Text)) { - List dlist = this.dataVisualTextService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualText dc : - dlist) { - DataVisualText newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualTextService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Camera)) { - List dlist = this.dataVisualCameraService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualCamera dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualCamera newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualCameraService.save(newD); - List dlist2 = this.dataVisualCameraAlarmService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualCameraAlarm dcontent : - dlist2) { - DataVisualCameraAlarm newD2 = dcontent; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualCameraAlarmService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_Form)) { - List rowlist = this.dataVisualFormService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualForm row : - rowlist) { - String lastRowId = row.getId(); - String rowId = CommUtil.getUUID(); - DataVisualForm newD = row; - newD.setId(rowId); - newD.setPid(nowContentId); - newD.setFrameid(ckContentId); - this.dataVisualFormService.save(newD); - List columnlist = this.dataVisualFormService.selectListByWhere(" where pid='" + lastRowId + "' "); - for (DataVisualForm column : - columnlist) { - String lastRowId2 = column.getId(); - String cId = CommUtil.getUUID(); - DataVisualForm newD2 = column; - newD2.setId(cId); - newD2.setPid(rowId); - newD2.setFrameid(ckContentId); - this.dataVisualFormService.save(newD2); - - List dlist = this.dataVisualFormShowStyleService.selectListByWhere(" where pid='" + lastRowId2 + "' "); - for (DataVisualFormShowStyle dcontent : - dlist) { - DataVisualFormShowStyle newD3 = dcontent; - newD3.setId(CommUtil.getUUID()); - newD3.setPid(cId); - this.dataVisualFormShowStyleService.save(newD3); - } - - List dlist2 = this.dataVisualFormSqlPointService.selectListByWhere(" where pid='" + lastRowId2 + "' "); - for (DataVisualFormSqlPoint dcontent : - dlist2) { - DataVisualFormSqlPoint newD3 = dcontent; - newD3.setId(CommUtil.getUUID()); - newD3.setPid(cId); - this.dataVisualFormSqlPointService.save(newD3); - } - } - } - } else if (type.equals(DataVisualContent.Type_LineChart)) { - List dlist = this.dataVisualLineChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualLineChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualLineChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualLineChartService.save(newD); - List dlist2 = this.dataVisualLineChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualLineChartSeries dc2 : - dlist2) { - DataVisualLineChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualLineChartSeriesService.save(newD2); - } - List dlist3 = this.dataVisualLineChartYAxisService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualLineChartYAxis dc3 : - dlist3) { - DataVisualLineChartYAxis newD2 = dc3; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualLineChartYAxisService.save(newD2); - } - - } - - } else if (type.equals(DataVisualContent.Type_BarChart)) { - List dlist = this.dataVisualBarChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualBarChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualBarChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualBarChartService.save(newD); - List dlist2 = this.dataVisualBarChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualBarChartSeries dc2 : - dlist2) { - DataVisualBarChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualBarChartSeriesService.save(newD2); - } - List dlist3 = this.dataVisualBarChartYAxisService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualBarChartYAxis dc3 : - dlist3) { - DataVisualBarChartYAxis newD2 = dc3; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualBarChartYAxisService.save(newD2); - } - - } - - } else if (type.equals(DataVisualContent.Type_PercentChart)) { - List dlist = this.dataVisualPercentChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPercentChart dc : - dlist) { - DataVisualPercentChart newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualPercentChartService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_RadarChart)) { - List dlist = this.dataVisualRadarChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualRadarChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualRadarChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualRadarChartService.save(newD); - List dlist2 = this.dataVisualRadarChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualRadarChartSeries dc2 : - dlist2) { - DataVisualRadarChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualRadarChartSeriesService.save(newD2); - } - List dlist3 = this.dataVisualRadarChartAxisService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualRadarChartAxis dc3 : - dlist3) { - DataVisualRadarChartAxis newD2 = dc3; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualRadarChartAxisService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_PieChart)) { - List dlist = this.dataVisualPieChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPieChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualPieChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualPieChartService.save(newD); - List dlist2 = this.dataVisualPieChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualPieChartSeries dc2 : - dlist2) { - DataVisualPieChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualPieChartSeriesService.save(newD2); - } - } - - } else if (type.equals(DataVisualContent.Type_Picture)) { - //图片具体内容暂不复制 - } else if (type.equals(DataVisualContent.Type_GaugeChart)) { - List dlist = this.dataVisualGaugeChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualGaugeChart dc : - dlist) { - DataVisualGaugeChart newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualGaugeChartService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Date)) { - List dlist = this.dataVisualDateService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualDate dc : - dlist) { - DataVisualDate newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualDateService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Weather)) { - List dlist = this.dataVisualWeatherService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualWeather dc : - dlist) { - DataVisualWeather newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualWeatherService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_MpView)) { - List dlist = this.dataVisualMpViewService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualMpView dc : - dlist) { - DataVisualMpView newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualMpViewService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_ProgressBar)) { - List dlist = this.dataVisualProgressBarChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualProgressBarChart dc : - dlist) { - DataVisualProgressBarChart newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualProgressBarChartService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_DateSelect)) { - List dlist = this.dataVisualDateSelectService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualDateSelect dc : - dlist) { - DataVisualDateSelect newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualDateSelectService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_SuspensionFrame)) { - List dlist = this.dataVisualSuspensionFrameService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSuspensionFrame dc : - dlist) { - DataVisualSuspensionFrame newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualSuspensionFrameService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_PolarCoordinates)) { - List dlist = this.dataVisualPolarCoordinatesService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPolarCoordinates dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualPolarCoordinates newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualPolarCoordinatesService.save(newD); - List dlist2 = this.dataVisualPolarCoordinatesSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualPolarCoordinatesSeries dc2 : - dlist2) { - DataVisualPolarCoordinatesSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualPolarCoordinatesSeriesService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_PersonnelPositioning)) { - List dlist = this.dataVisualPersonnelPositioningService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPersonnelPositioning dc : - dlist) { - DataVisualPersonnelPositioning newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualPersonnelPositioningService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Svg)) { - List dlist = this.dataVisualSvgService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSvg dc : - dlist) { - DataVisualSvg newD = dc; - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualSvgService.save(newD); - - List dlist2 = this.dataVisualSvgAlarmService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualSvgAlarm dc2 : - dlist2) { - DataVisualSvgAlarm newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualSvgAlarmService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_Switch)) { - List dlist = this.dataVisualSwitchService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSwitch dc : - dlist) { - DataVisualSwitch newD = dc; - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualSwitchService.save(newD); - - List dlist2 = this.dataVisualSwitchPointService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualSwitchPoint dc2 : - dlist2) { - DataVisualSwitchPoint newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualSwitchPointService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_SelectJump)) { - List dlist = this.dataVisualSelectService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSelect dc : - dlist) { - DataVisualSelect newD = dc; - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualSelectService.save(newD); - - } - } - - - } - - } - - - } - - public void copyFrameContentForTab(String upContentId, String ckid) { - List contentlist = this.dataVisualContentService.selectListByWhere(" where pid='" + upContentId + "' "); - for (DataVisualContent ckContent : - contentlist) { - String ckContentId = ckContent.getId(); - DataVisualContent newDataVisualContent = ckContent; - String nowContentId = CommUtil.getUUID(); - newDataVisualContent.setId(nowContentId); - newDataVisualContent.setPid(ckid); - this.dataVisualContentService.save(newDataVisualContent); - - String type = ckContent.getType(); - - if (type.equals(DataVisualContent.Type_Tab)) { - List dlist = this.dataVisualTabService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualTab dc : - dlist) { - DataVisualTab newD = dc; - String tabid = CommUtil.getUUID(); - String oldTabId = newD.getId(); - newD.setId(tabid); - newD.setPid(nowContentId); - this.dataVisualTabService.save(newD); - copyFrameContentForTab(oldTabId, tabid); - } - } else if (type.equals(DataVisualContent.Type_DataPoint) || type.equals(DataVisualContent.Type_SignalPoint)) { - List dlist = this.dataVisualMPointService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualMPoint dc : - dlist) { - DataVisualMPoint newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualMPointService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Text)) { - List dlist = this.dataVisualTextService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualText dc : - dlist) { - DataVisualText newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualTextService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Camera)) { - List dlist = this.dataVisualCameraService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualCamera dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualCamera newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualCameraService.save(newD); - List dlist2 = this.dataVisualCameraAlarmService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualCameraAlarm dcontent : - dlist2) { - DataVisualCameraAlarm newD2 = dcontent; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualCameraAlarmService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_Form)) { - List rowlist = this.dataVisualFormService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualForm row : - rowlist) { - String lastRowId = row.getId(); - String rowId = CommUtil.getUUID(); - DataVisualForm newD = row; - newD.setId(rowId); - newD.setPid(nowContentId); - newD.setFrameid(ckContentId); - this.dataVisualFormService.save(newD); - List columnlist = this.dataVisualFormService.selectListByWhere(" where pid='" + lastRowId + "' "); - for (DataVisualForm column : - columnlist) { - String lastRowId2 = column.getId(); - String cId = CommUtil.getUUID(); - DataVisualForm newD2 = column; - newD2.setId(cId); - newD2.setPid(rowId); - newD2.setFrameid(ckContentId); - this.dataVisualFormService.save(newD2); - - List dlist = this.dataVisualFormShowStyleService.selectListByWhere(" where pid='" + lastRowId2 + "' "); - for (DataVisualFormShowStyle dcontent : - dlist) { - DataVisualFormShowStyle newD3 = dcontent; - newD3.setId(CommUtil.getUUID()); - newD3.setPid(cId); - this.dataVisualFormShowStyleService.save(newD3); - } - - List dlist2 = this.dataVisualFormSqlPointService.selectListByWhere(" where pid='" + lastRowId2 + "' "); - for (DataVisualFormSqlPoint dcontent : - dlist2) { - DataVisualFormSqlPoint newD3 = dcontent; - newD3.setId(CommUtil.getUUID()); - newD3.setPid(cId); - this.dataVisualFormSqlPointService.save(newD3); - } - } - } - } else if (type.equals(DataVisualContent.Type_LineChart)) { - List dlist = this.dataVisualLineChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualLineChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualLineChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualLineChartService.save(newD); - List dlist2 = this.dataVisualLineChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualLineChartSeries dc2 : - dlist2) { - DataVisualLineChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualLineChartSeriesService.save(newD2); - } - List dlist3 = this.dataVisualLineChartYAxisService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualLineChartYAxis dc3 : - dlist3) { - DataVisualLineChartYAxis newD2 = dc3; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualLineChartYAxisService.save(newD2); - } - - } - - } else if (type.equals(DataVisualContent.Type_BarChart)) { - List dlist = this.dataVisualBarChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualBarChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualBarChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualBarChartService.save(newD); - List dlist2 = this.dataVisualBarChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualBarChartSeries dc2 : - dlist2) { - DataVisualBarChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualBarChartSeriesService.save(newD2); - } - List dlist3 = this.dataVisualBarChartYAxisService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualBarChartYAxis dc3 : - dlist3) { - DataVisualBarChartYAxis newD2 = dc3; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualBarChartYAxisService.save(newD2); - } - - } - - } else if (type.equals(DataVisualContent.Type_PercentChart)) { - List dlist = this.dataVisualPercentChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPercentChart dc : - dlist) { - DataVisualPercentChart newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualPercentChartService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_RadarChart)) { - List dlist = this.dataVisualRadarChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualRadarChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualRadarChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualRadarChartService.save(newD); - List dlist2 = this.dataVisualRadarChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualRadarChartSeries dc2 : - dlist2) { - DataVisualRadarChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualRadarChartSeriesService.save(newD2); - } - List dlist3 = this.dataVisualRadarChartAxisService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualRadarChartAxis dc3 : - dlist3) { - DataVisualRadarChartAxis newD2 = dc3; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualRadarChartAxisService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_PieChart)) { - List dlist = this.dataVisualPieChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPieChart dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualPieChart newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualPieChartService.save(newD); - List dlist2 = this.dataVisualPieChartSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualPieChartSeries dc2 : - dlist2) { - DataVisualPieChartSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualPieChartSeriesService.save(newD2); - } - } - - } else if (type.equals(DataVisualContent.Type_Picture)) { - //图片具体内容暂不复制 - } else if (type.equals(DataVisualContent.Type_GaugeChart)) { - List dlist = this.dataVisualGaugeChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualGaugeChart dc : - dlist) { - DataVisualGaugeChart newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualGaugeChartService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Date)) { - List dlist = this.dataVisualDateService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualDate dc : - dlist) { - DataVisualDate newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualDateService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Weather)) { - List dlist = this.dataVisualWeatherService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualWeather dc : - dlist) { - DataVisualWeather newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualWeatherService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_MpView)) { - List dlist = this.dataVisualMpViewService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualMpView dc : - dlist) { - DataVisualMpView newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualMpViewService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_ProgressBar)) { - List dlist = this.dataVisualProgressBarChartService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualProgressBarChart dc : - dlist) { - DataVisualProgressBarChart newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualProgressBarChartService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_DateSelect)) { - List dlist = this.dataVisualDateSelectService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualDateSelect dc : - dlist) { - DataVisualDateSelect newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualDateSelectService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_SuspensionFrame)) { - List dlist = this.dataVisualSuspensionFrameService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSuspensionFrame dc : - dlist) { - DataVisualSuspensionFrame newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualSuspensionFrameService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_PolarCoordinates)) { - List dlist = this.dataVisualPolarCoordinatesService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPolarCoordinates dc : - dlist) { - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - DataVisualPolarCoordinates newD = dc; - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualPolarCoordinatesService.save(newD); - List dlist2 = this.dataVisualPolarCoordinatesSeriesService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualPolarCoordinatesSeries dc2 : - dlist2) { - DataVisualPolarCoordinatesSeries newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualPolarCoordinatesSeriesService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_PersonnelPositioning)) { - List dlist = this.dataVisualPersonnelPositioningService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualPersonnelPositioning dc : - dlist) { - DataVisualPersonnelPositioning newD = dc; - newD.setId(CommUtil.getUUID()); - newD.setPid(nowContentId); - this.dataVisualPersonnelPositioningService.save(newD); - } - } else if (type.equals(DataVisualContent.Type_Svg)) { - List dlist = this.dataVisualSvgService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSvg dc : - dlist) { - DataVisualSvg newD = dc; - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualSvgService.save(newD); - - List dlist2 = this.dataVisualSvgAlarmService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualSvgAlarm dc2 : - dlist2) { - DataVisualSvgAlarm newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualSvgAlarmService.save(newD2); - } - } - } else if (type.equals(DataVisualContent.Type_Switch)) { - List dlist = this.dataVisualSwitchService.selectListByWhere(" where pid='" + ckContentId + "' "); - for (DataVisualSwitch dc : - dlist) { - DataVisualSwitch newD = dc; - String lastId = dc.getId(); - String nowId = CommUtil.getUUID(); - newD.setId(nowId); - newD.setPid(nowContentId); - this.dataVisualSwitchService.save(newD); - - List dlist2 = this.dataVisualSwitchPointService.selectListByWhere(" where pid='" + lastId + "' "); - for (DataVisualSwitchPoint dc2 : - dlist2) { - DataVisualSwitchPoint newD2 = dc2; - newD2.setId(CommUtil.getUUID()); - newD2.setPid(nowId); - this.dataVisualSwitchPointService.save(newD2); - } - } - } - - - } - - } - - - /** - * 获取所有画面 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getFrameContentToMqtt(String menuType, String inFrameId) { - - menuType = menuType.replace(",", "','"); - inFrameId = inFrameId.replace(",", "','"); - - com.alibaba.fastjson.JSONArray jSONArray = new com.alibaba.fastjson.JSONArray(); - - String whereString = " where 1=1 and type='" + DataVisualFrame.Type_frame + "' and active = '" + DataVisualFrame.Active_1 + "' "; - if (inFrameId != null && inFrameId.length() > 0) { - whereString += " and id in ('" + inFrameId + "') "; - } - if (menuType != null && menuType.length() > 0) { - whereString += " and menuType in ('" + menuType + "') "; - } - - List framelist = selectListByWhere(whereString); - - if (framelist != null && framelist.size() > 0) { - for (DataVisualFrame dataVisualFrame : - framelist) { - JSONObject frameIdjsonObject = new JSONObject(); - - String frameId = dataVisualFrame.getId(); - - com.alibaba.fastjson.JSONArray ckjSONArray = new com.alibaba.fastjson.JSONArray(); - List ckfclist = this.dataVisualFrameContainerService.selectListByWhere(" where type='" + DataVisualFrameContainer.Type_column + "' and frameId='" + frameId + "' order by rows,columns "); - for (DataVisualFrameContainer ckfc : - ckfclist) { - String ckfcCId = ckfc.getId(); - - getFrameContentToMqttContent(ckjSONArray, ckfcCId); - } - - frameIdjsonObject.put("frameId", frameId); -// frameIdjsonObject.put("contentId", ckjSONArray); - frameIdjsonObject.put("data", ckjSONArray); - jSONArray.add(frameIdjsonObject); - - } - - - } - return jSONArray.toString(); - } - - public void getFrameContentToMqttContent(com.alibaba.fastjson.JSONArray ckjSONArray, String upCkid) { - List contentlist = this.dataVisualContentService.selectListByWhere(" where pid='" + upCkid + "' "); - - //按照前台需要接收mq数据添加 - String textIds = ""; - String formIds = ""; - String diIds = ""; - String aiIds = ""; - String mpViewIds = ""; - String percentChartIds = ""; - - String tabIds = ""; - - String distinctMpid = "";//直接可赋值的 - - for (DataVisualContent ckContent : - contentlist) { - String id = ckContent.getId(); - String type = ckContent.getType(); - if (type.equals(DataVisualContent.Type_Text)) { - textIds += id + ","; - } else if (type.equals(DataVisualContent.Type_Form)) { - formIds += id + ","; - } else if (type.equals(DataVisualContent.Type_SignalPoint)) { - diIds += id + ","; - } else if (type.equals(DataVisualContent.Type_DataPoint)) { - aiIds += id + ","; - } else if (type.equals(DataVisualContent.Type_MpView)) { - mpViewIds += id + ","; - } else if (type.equals(DataVisualContent.Type_PercentChart)) { - percentChartIds += id + ","; - } else if (type.equals(DataVisualContent.Type_Tab)) { - tabIds += id + ","; - } - } - -// String[] tabIdss = tabIds.split(","); -// for (String tabId : tabIdss) { -// getFrameContentToMqttContent(ckjSONArray,tabId); -// } - tabIds = tabIds.replace(",", "','"); - List dataVisualTabList = this.dataVisualTabService.selectListByWhere(" where pid in ('" + tabIds + "') order by pid,morder"); - for (DataVisualTab dataVisualTab : - dataVisualTabList) { - String tabIdString = dataVisualTab.getId(); - getFrameContentToMqttContent(ckjSONArray, tabIdString); - } - - textIds = textIds.replace(",", "','"); - List dataVisualTextList = this.dataVisualTextService.selectListByWhere(" where pid in ('" + textIds + "') "); - for (DataVisualText dataVisualText : - dataVisualTextList) { - JSONObject mpjsonObject = new JSONObject(); - if (dataVisualText.getMpid() != null && !dataVisualText.getMpid().equals("")) { - - if (distinctMpid.indexOf(dataVisualText.getMpid()) < 0) { - mpjsonObject.put("mpid", dataVisualText.getMpid()); - mpjsonObject.put("type", DataVisualContent.Type_Text); - mpjsonObject.put("contentId", dataVisualText.getPid()); - - MPoint mPoint = this.mPointService.selectById(dataVisualText.getMpid()); - if(mPoint!=null){ - if(dataVisualText.getUnitst()!=null&&!dataVisualText.getUnitst().equals("")&&dataVisualText.getUnitst().equals("true")){ - mpjsonObject.put("unitst", mPoint.getUnit()); - }else{ - mpjsonObject.put("unitst", ""); - } - } - - if(dataVisualText.getNumtail()!=null&&!dataVisualText.getNumtail().equals("")){ - mpjsonObject.put("numtail", dataVisualText.getNumtail()); - }else{ - if(mPoint!=null){ - mpjsonObject.put("numtail", mPoint.getNumtail()); - }else { - mpjsonObject.put("numtail", ""); - } - } - - ckjSONArray.add(mpjsonObject); - - distinctMpid += dataVisualText.getMpid() + ","; - } - - } - } - - formIds = formIds.replace(",", "','"); - List dataVisualFormList = this.dataVisualFormService.selectListByWhere(" where pid in ('" + formIds + "') "); - for (DataVisualForm dataVisualForm : - dataVisualFormList) { - JSONObject mpjsonObject = new JSONObject(); - if (dataVisualForm.getMpid() != null && !dataVisualForm.getMpid().equals("")) { - if (distinctMpid.indexOf(dataVisualForm.getMpid()) < 0) { - mpjsonObject.put("mpid", dataVisualForm.getMpid()); - mpjsonObject.put("type", DataVisualContent.Type_Form); - mpjsonObject.put("contentId", dataVisualForm.getPid()); - ckjSONArray.add(mpjsonObject); - - distinctMpid += dataVisualForm.getMpid() + ","; - } - } - } - - diIds = diIds.replace(",", "','"); - List mPointFormList_di = this.dataVisualMPointService.selectListByWhere(" where pid in ('" + diIds + "') "); - for (DataVisualMPoint dataVisualMPoint : - mPointFormList_di) { - JSONObject mpjsonObject = new JSONObject(); - if (dataVisualMPoint.getMpid() != null && !dataVisualMPoint.getMpid().equals("")) { - if (distinctMpid.indexOf(dataVisualMPoint.getMpid()) < 0) { - mpjsonObject.put("mpid", dataVisualMPoint.getMpid()); - mpjsonObject.put("type", DataVisualContent.Type_SignalPoint); - mpjsonObject.put("contentId", dataVisualMPoint.getPid()); - ckjSONArray.add(mpjsonObject); - - distinctMpid += dataVisualMPoint.getMpid() + ","; - } - } - } - - aiIds = aiIds.replace(",", "','"); - List mPointFormList_ai = this.dataVisualMPointService.selectListByWhere(" where pid in ('" + aiIds + "') "); - for (DataVisualMPoint dataVisualMPoint : - mPointFormList_ai) { - JSONObject mpjsonObject = new JSONObject(); - if (dataVisualMPoint.getMpid() != null && !dataVisualMPoint.getMpid().equals("")) { - if (distinctMpid.indexOf(dataVisualMPoint.getMpid()) < 0) { - mpjsonObject.put("mpid", dataVisualMPoint.getMpid()); - mpjsonObject.put("type", DataVisualContent.Type_DataPoint); - mpjsonObject.put("contentId", dataVisualMPoint.getPid()); - ckjSONArray.add(mpjsonObject); - - distinctMpid += dataVisualMPoint.getMpid() + ","; - } - } - } - - mpViewIds = mpViewIds.replace(",", "','"); - List mPointMpViewList = this.dataVisualMpViewService.selectListByWhere(" where pid in ('" + mpViewIds + "') order by pid,morder"); - if (mPointMpViewList != null && mPointMpViewList.size() > 0) { - String oldPid = ""; - String mpids = ""; - for (int i = 0; i < mPointMpViewList.size(); i++) { - DataVisualMpView dataVisualMpView = mPointMpViewList.get(i); - JSONObject mpjsonObject = new JSONObject(); - if (dataVisualMpView.getMpid() != null && !dataVisualMpView.getMpid().equals("")) { - - if (i == 0) { - oldPid = dataVisualMpView.getPid(); - mpids = dataVisualMpView.getMpid() + ","; - } else { - String nowPid = dataVisualMpView.getPid(); - - if (oldPid.equals(nowPid)) { - if (mpids.indexOf(dataVisualMpView.getMpid()) < 0) { - mpids += dataVisualMpView.getMpid() + ","; - } - } else { - mpjsonObject.put("mpid", mpids); - mpjsonObject.put("type", DataVisualContent.Type_MpView); - mpjsonObject.put("contentId", oldPid); - ckjSONArray.add(mpjsonObject); - - oldPid = nowPid; - mpids = dataVisualMpView.getMpid() + ","; - } - } - if ((i + 1) == mPointMpViewList.size()) { - mpjsonObject.put("mpid", mpids); - mpjsonObject.put("type", DataVisualContent.Type_MpView); - mpjsonObject.put("contentId", dataVisualMpView.getPid()); - ckjSONArray.add(mpjsonObject); - } - - } - } - } - - percentChartIds = percentChartIds.replace(",", "','"); - List percentChartList = this.dataVisualPercentChartService.selectListByWhere(" where pid in ('" + percentChartIds + "') "); - for (DataVisualPercentChart dataVisualPercentChart : - percentChartList) { - JSONObject mpjsonObject = new JSONObject(); - if (dataVisualPercentChart.getMpid() != null && !dataVisualPercentChart.getMpid().equals("")) { - mpjsonObject.put("mpid", dataVisualPercentChart.getMpid()); - mpjsonObject.put("type", DataVisualContent.Type_PercentChart); - mpjsonObject.put("contentId", dataVisualPercentChart.getPid()); - - ckjSONArray.add(mpjsonObject); - } - } - - } - - -} diff --git a/src/com/sipai/service/process/impl/DataVisualGaugeChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualGaugeChartServiceImpl.java deleted file mode 100644 index f538a2b4..00000000 --- a/src/com/sipai/service/process/impl/DataVisualGaugeChartServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualGaugeChartDao; -import com.sipai.entity.process.DataVisualGaugeChart; -import com.sipai.service.process.DataVisualGaugeChartService; - -@Service -public class DataVisualGaugeChartServiceImpl implements DataVisualGaugeChartService { - @Resource - private DataVisualGaugeChartDao dataVisualGaugeChartDao; - - @Override - public DataVisualGaugeChart selectById(String id) { - DataVisualGaugeChart entity = dataVisualGaugeChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualGaugeChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualGaugeChart entity) { - return dataVisualGaugeChartDao.insert(entity); - } - - @Override - public int update(DataVisualGaugeChart entity) { - return dataVisualGaugeChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualGaugeChart entity = new DataVisualGaugeChart(); - entity.setWhere(wherestr); - List list = dataVisualGaugeChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualGaugeChart entity = new DataVisualGaugeChart(); - entity.setWhere(wherestr); - return dataVisualGaugeChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualLineChartSeriesServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualLineChartSeriesServiceImpl.java deleted file mode 100644 index 00025a9d..00000000 --- a/src/com/sipai/service/process/impl/DataVisualLineChartSeriesServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualLineChartSeriesDao; -import com.sipai.entity.process.DataVisualLineChartSeries; -import com.sipai.service.process.DataVisualLineChartSeriesService; - -@Service -public class DataVisualLineChartSeriesServiceImpl implements DataVisualLineChartSeriesService { - @Resource - private DataVisualLineChartSeriesDao dataVisualLineChartSeriesDao; - - @Override - public DataVisualLineChartSeries selectById(String id) { - DataVisualLineChartSeries entity = dataVisualLineChartSeriesDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualLineChartSeriesDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualLineChartSeries entity) { - return dataVisualLineChartSeriesDao.insert(entity); - } - - @Override - public int update(DataVisualLineChartSeries entity) { - return dataVisualLineChartSeriesDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualLineChartSeries entity = new DataVisualLineChartSeries(); - entity.setWhere(wherestr); - List list = dataVisualLineChartSeriesDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualLineChartSeries entity = new DataVisualLineChartSeries(); - entity.setWhere(wherestr); - return dataVisualLineChartSeriesDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualLineChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualLineChartServiceImpl.java deleted file mode 100644 index 29b25050..00000000 --- a/src/com/sipai/service/process/impl/DataVisualLineChartServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualLineChartDao; -import com.sipai.entity.process.DataVisualLineChart; -import com.sipai.service.process.DataVisualLineChartService; - -@Service -public class DataVisualLineChartServiceImpl implements DataVisualLineChartService { - @Resource - private DataVisualLineChartDao dataVisualLineChartDao; - - @Override - public DataVisualLineChart selectById(String id) { - DataVisualLineChart entity = dataVisualLineChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualLineChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualLineChart entity) { - return dataVisualLineChartDao.insert(entity); - } - - @Override - public int update(DataVisualLineChart entity) { - return dataVisualLineChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualLineChart entity = new DataVisualLineChart(); - entity.setWhere(wherestr); - List list = dataVisualLineChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualLineChart entity = new DataVisualLineChart(); - entity.setWhere(wherestr); - return dataVisualLineChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualLineChartYAxisServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualLineChartYAxisServiceImpl.java deleted file mode 100644 index bac6c736..00000000 --- a/src/com/sipai/service/process/impl/DataVisualLineChartYAxisServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualLineChartYAxisDao; -import com.sipai.entity.process.DataVisualLineChartYAxis; -import com.sipai.service.process.DataVisualLineChartYAxisService; - -@Service -public class DataVisualLineChartYAxisServiceImpl implements DataVisualLineChartYAxisService { - @Resource - private DataVisualLineChartYAxisDao dataVisualLineChartYAxisDao; - - @Override - public DataVisualLineChartYAxis selectById(String id) { - DataVisualLineChartYAxis entity = dataVisualLineChartYAxisDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualLineChartYAxisDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualLineChartYAxis entity) { - return dataVisualLineChartYAxisDao.insert(entity); - } - - @Override - public int update(DataVisualLineChartYAxis entity) { - return dataVisualLineChartYAxisDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualLineChartYAxis entity = new DataVisualLineChartYAxis(); - entity.setWhere(wherestr); - List list = dataVisualLineChartYAxisDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualLineChartYAxis entity = new DataVisualLineChartYAxis(); - entity.setWhere(wherestr); - return dataVisualLineChartYAxisDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualMPointServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualMPointServiceImpl.java deleted file mode 100644 index a8269761..00000000 --- a/src/com/sipai/service/process/impl/DataVisualMPointServiceImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.service.process.impl; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualMPointDao; -import com.sipai.entity.process.DataVisualMPoint; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.process.DataVisualMPointService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -@Service -public class DataVisualMPointServiceImpl implements DataVisualMPointService { - @Resource - private DataVisualMPointDao dataVisualMPointDao; - @Resource - private MPointService mPointService; - - @Override - public DataVisualMPoint selectById(String id) { - DataVisualMPoint entity = dataVisualMPointDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualMPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualMPoint entity) { - return dataVisualMPointDao.insert(entity); - } - - @Override - public int update(DataVisualMPoint entity) { - return dataVisualMPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualMPoint entity = new DataVisualMPoint(); - entity.setWhere(wherestr); - List list = dataVisualMPointDao.selectListByWhere(entity); - for (int i = 0; i < list.size(); i++) { - DataVisualMPoint dataVisualMPoint = list.get(i); - MPoint mPoint = this.mPointService.selectById(dataVisualMPoint.getMpid()); -// MPoint mPoint=this.mPointService.selectById(dataVisualMPoint.getUnitid(), dataVisualMPoint.getMpid()); - if (mPoint != null) { - BigDecimal parmvalue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmvalue); - dataVisualMPoint.setmPoint(mPoint); - - BigDecimal alarmmax = mPoint.getAlarmmax(); - BigDecimal halarmmax = mPoint.getHalarmmax(); - BigDecimal alarmmin = mPoint.getAlarmmin(); - BigDecimal lalarmmin = mPoint.getLalarmmin(); - - list.get(i).setTextColor("#00ff00"); - if (halarmmax != null) { - if (parmvalue.floatValue() > halarmmax.floatValue()) {//上极限 - list.get(i).setTextColor("#FF0000"); - } else {//上限 - if (alarmmax != null) { - if (parmvalue.floatValue() > alarmmax.floatValue() && parmvalue.floatValue() <= halarmmax.floatValue()) { - list.get(i).setTextColor("yellow"); - } - } - } - } else { - if (alarmmax != null) { - if (parmvalue.floatValue() > alarmmax.floatValue()) {//上限 - list.get(i).setTextColor("yellow"); - } - } - } - - if (lalarmmin != null) { - if (parmvalue.floatValue() < lalarmmin.floatValue()) {//下极限 - list.get(i).setTextColor("#FF0000"); - } else { - if (alarmmin != null) { - if (parmvalue.floatValue() < alarmmin.floatValue() && parmvalue.floatValue() >= lalarmmin.floatValue()) {//下限 - list.get(i).setTextColor("yellow"); - } - } - } - } else { - if (alarmmin != null) { - if (parmvalue.floatValue() < alarmmin.floatValue()) {//下限 - list.get(i).setTextColor("yellow"); - } - } - - } - - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualMPoint entity = new DataVisualMPoint(); - entity.setWhere(wherestr); - return dataVisualMPointDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualMPointWarehouseServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualMPointWarehouseServiceImpl.java deleted file mode 100644 index 289afef6..00000000 --- a/src/com/sipai/service/process/impl/DataVisualMPointWarehouseServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualMPointWarehouseDao; -import com.sipai.entity.process.DataVisualMPointWarehouse; -import com.sipai.service.process.DataVisualMPointWarehouseService; - -@Service -public class DataVisualMPointWarehouseServiceImpl implements DataVisualMPointWarehouseService { - @Resource - private DataVisualMPointWarehouseDao dataVisualMPointWarehouseDao; - - @Override - public DataVisualMPointWarehouse selectById(String id) { - DataVisualMPointWarehouse entity = dataVisualMPointWarehouseDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualMPointWarehouseDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualMPointWarehouse entity) { - return dataVisualMPointWarehouseDao.insert(entity); - } - - @Override - public int update(DataVisualMPointWarehouse entity) { - return dataVisualMPointWarehouseDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualMPointWarehouse entity = new DataVisualMPointWarehouse(); - entity.setWhere(wherestr); - List list = dataVisualMPointWarehouseDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualMPointWarehouse entity = new DataVisualMPointWarehouse(); - entity.setWhere(wherestr); - return dataVisualMPointWarehouseDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualMpViewServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualMpViewServiceImpl.java deleted file mode 100644 index a50f8919..00000000 --- a/src/com/sipai/service/process/impl/DataVisualMpViewServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualMpViewDao; -import com.sipai.entity.process.DataVisualMpView; -import com.sipai.service.process.DataVisualMpViewService; - -@Service -public class DataVisualMpViewServiceImpl implements DataVisualMpViewService { - @Resource - private DataVisualMpViewDao dataVisualMpViewDao; - - @Override - public DataVisualMpView selectById(String id) { - DataVisualMpView entity = dataVisualMpViewDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualMpViewDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualMpView entity) { - return dataVisualMpViewDao.insert(entity); - } - - @Override - public int update(DataVisualMpView entity) { - return dataVisualMpViewDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualMpView entity = new DataVisualMpView(); - entity.setWhere(wherestr); - List list = dataVisualMpViewDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualMpView entity = new DataVisualMpView(); - entity.setWhere(wherestr); - return dataVisualMpViewDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualPercentChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualPercentChartServiceImpl.java deleted file mode 100644 index f8ce7249..00000000 --- a/src/com/sipai/service/process/impl/DataVisualPercentChartServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualPercentChartDao; -import com.sipai.entity.process.DataVisualPercentChart; -import com.sipai.service.process.DataVisualPercentChartService; - -@Service -public class DataVisualPercentChartServiceImpl implements DataVisualPercentChartService { - @Resource - private DataVisualPercentChartDao dataVisualPercentChartDao; - - @Override - public DataVisualPercentChart selectById(String id) { - DataVisualPercentChart entity = dataVisualPercentChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualPercentChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualPercentChart entity) { - return dataVisualPercentChartDao.insert(entity); - } - - @Override - public int update(DataVisualPercentChart entity) { - return dataVisualPercentChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualPercentChart entity = new DataVisualPercentChart(); - entity.setWhere(wherestr); - List list = dataVisualPercentChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualPercentChart entity = new DataVisualPercentChart(); - entity.setWhere(wherestr); - return dataVisualPercentChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualPersonnelPositioningServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualPersonnelPositioningServiceImpl.java deleted file mode 100644 index aed53bcf..00000000 --- a/src/com/sipai/service/process/impl/DataVisualPersonnelPositioningServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualPersonnelPositioningDao; -import com.sipai.entity.process.DataVisualPersonnelPositioning; -import com.sipai.service.process.DataVisualPersonnelPositioningService; - -@Service -public class DataVisualPersonnelPositioningServiceImpl implements DataVisualPersonnelPositioningService { - @Resource - private DataVisualPersonnelPositioningDao dataVisualPersonnelPositioningDao; - - @Override - public DataVisualPersonnelPositioning selectById(String id) { - DataVisualPersonnelPositioning entity = dataVisualPersonnelPositioningDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualPersonnelPositioningDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualPersonnelPositioning entity) { - return dataVisualPersonnelPositioningDao.insert(entity); - } - - @Override - public int update(DataVisualPersonnelPositioning entity) { - return dataVisualPersonnelPositioningDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualPersonnelPositioning entity = new DataVisualPersonnelPositioning(); - entity.setWhere(wherestr); - List list = dataVisualPersonnelPositioningDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualPersonnelPositioning entity = new DataVisualPersonnelPositioning(); - entity.setWhere(wherestr); - return dataVisualPersonnelPositioningDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualPieChartSeriesServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualPieChartSeriesServiceImpl.java deleted file mode 100644 index 41c51be6..00000000 --- a/src/com/sipai/service/process/impl/DataVisualPieChartSeriesServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualPieChartSeriesDao; -import com.sipai.entity.process.DataVisualPieChartSeries; -import com.sipai.service.process.DataVisualPieChartSeriesService; - -@Service -public class DataVisualPieChartSeriesServiceImpl implements DataVisualPieChartSeriesService { - @Resource - private DataVisualPieChartSeriesDao dataVisualPieChartSeriesDao; - - @Override - public DataVisualPieChartSeries selectById(String id) { - DataVisualPieChartSeries entity = dataVisualPieChartSeriesDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualPieChartSeriesDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualPieChartSeries entity) { - return dataVisualPieChartSeriesDao.insert(entity); - } - - @Override - public int update(DataVisualPieChartSeries entity) { - return dataVisualPieChartSeriesDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualPieChartSeries entity = new DataVisualPieChartSeries(); - entity.setWhere(wherestr); - List list = dataVisualPieChartSeriesDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualPieChartSeries entity = new DataVisualPieChartSeries(); - entity.setWhere(wherestr); - return dataVisualPieChartSeriesDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualPieChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualPieChartServiceImpl.java deleted file mode 100644 index 1de21546..00000000 --- a/src/com/sipai/service/process/impl/DataVisualPieChartServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualPieChartDao; -import com.sipai.entity.process.DataVisualPieChart; -import com.sipai.service.process.DataVisualPieChartService; - -@Service -public class DataVisualPieChartServiceImpl implements DataVisualPieChartService { - @Resource - private DataVisualPieChartDao dataVisualPieChartDao; - - @Override - public DataVisualPieChart selectById(String id) { - DataVisualPieChart entity = dataVisualPieChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualPieChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualPieChart entity) { - return dataVisualPieChartDao.insert(entity); - } - - @Override - public int update(DataVisualPieChart entity) { - return dataVisualPieChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualPieChart entity = new DataVisualPieChart(); - entity.setWhere(wherestr); - List list = dataVisualPieChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualPieChart entity = new DataVisualPieChart(); - entity.setWhere(wherestr); - return dataVisualPieChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualPolarCoordinatesSeriesServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualPolarCoordinatesSeriesServiceImpl.java deleted file mode 100644 index 588c82d5..00000000 --- a/src/com/sipai/service/process/impl/DataVisualPolarCoordinatesSeriesServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualPolarCoordinatesSeriesDao; -import com.sipai.entity.process.DataVisualPolarCoordinatesSeries; -import com.sipai.service.process.DataVisualPolarCoordinatesSeriesService; - -@Service -public class DataVisualPolarCoordinatesSeriesServiceImpl implements DataVisualPolarCoordinatesSeriesService { - @Resource - private DataVisualPolarCoordinatesSeriesDao dataVisualPolarCoordinatesSeriesDao; - - @Override - public DataVisualPolarCoordinatesSeries selectById(String id) { - DataVisualPolarCoordinatesSeries entity = dataVisualPolarCoordinatesSeriesDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualPolarCoordinatesSeriesDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualPolarCoordinatesSeries entity) { - return dataVisualPolarCoordinatesSeriesDao.insert(entity); - } - - @Override - public int update(DataVisualPolarCoordinatesSeries entity) { - return dataVisualPolarCoordinatesSeriesDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualPolarCoordinatesSeries entity = new DataVisualPolarCoordinatesSeries(); - entity.setWhere(wherestr); - List list = dataVisualPolarCoordinatesSeriesDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualPolarCoordinatesSeries entity = new DataVisualPolarCoordinatesSeries(); - entity.setWhere(wherestr); - return dataVisualPolarCoordinatesSeriesDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualPolarCoordinatesServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualPolarCoordinatesServiceImpl.java deleted file mode 100644 index 975c8a9f..00000000 --- a/src/com/sipai/service/process/impl/DataVisualPolarCoordinatesServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualPolarCoordinatesDao; -import com.sipai.entity.process.DataVisualPolarCoordinates; -import com.sipai.service.process.DataVisualPolarCoordinatesService; - -@Service -public class DataVisualPolarCoordinatesServiceImpl implements DataVisualPolarCoordinatesService { - @Resource - private DataVisualPolarCoordinatesDao dataVisualPolarCoordinatesDao; - - @Override - public DataVisualPolarCoordinates selectById(String id) { - DataVisualPolarCoordinates entity = dataVisualPolarCoordinatesDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualPolarCoordinatesDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualPolarCoordinates entity) { - return dataVisualPolarCoordinatesDao.insert(entity); - } - - @Override - public int update(DataVisualPolarCoordinates entity) { - return dataVisualPolarCoordinatesDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualPolarCoordinates entity = new DataVisualPolarCoordinates(); - entity.setWhere(wherestr); - List list = dataVisualPolarCoordinatesDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualPolarCoordinates entity = new DataVisualPolarCoordinates(); - entity.setWhere(wherestr); - return dataVisualPolarCoordinatesDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualProgressBarChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualProgressBarChartServiceImpl.java deleted file mode 100644 index f1993375..00000000 --- a/src/com/sipai/service/process/impl/DataVisualProgressBarChartServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualProgressBarChartDao; -import com.sipai.entity.process.DataVisualProgressBarChart; -import com.sipai.service.process.DataVisualProgressBarChartService; - -@Service -public class DataVisualProgressBarChartServiceImpl implements DataVisualProgressBarChartService { - @Resource - private DataVisualProgressBarChartDao dataVisualProgressBarChartDao; - - @Override - public DataVisualProgressBarChart selectById(String id) { - DataVisualProgressBarChart entity = dataVisualProgressBarChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualProgressBarChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualProgressBarChart entity) { - return dataVisualProgressBarChartDao.insert(entity); - } - - @Override - public int update(DataVisualProgressBarChart entity) { - return dataVisualProgressBarChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualProgressBarChart entity = new DataVisualProgressBarChart(); - entity.setWhere(wherestr); - List list = dataVisualProgressBarChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualProgressBarChart entity = new DataVisualProgressBarChart(); - entity.setWhere(wherestr); - return dataVisualProgressBarChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualRadarChartAxisServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualRadarChartAxisServiceImpl.java deleted file mode 100644 index 6a18c621..00000000 --- a/src/com/sipai/service/process/impl/DataVisualRadarChartAxisServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualRadarChartAxisDao; -import com.sipai.entity.process.DataVisualRadarChartAxis; -import com.sipai.service.process.DataVisualRadarChartAxisService; - -@Service -public class DataVisualRadarChartAxisServiceImpl implements DataVisualRadarChartAxisService { - @Resource - private DataVisualRadarChartAxisDao dataVisualRadarChartAxisDao; - - @Override - public DataVisualRadarChartAxis selectById(String id) { - DataVisualRadarChartAxis entity = dataVisualRadarChartAxisDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualRadarChartAxisDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualRadarChartAxis entity) { - return dataVisualRadarChartAxisDao.insert(entity); - } - - @Override - public int update(DataVisualRadarChartAxis entity) { - return dataVisualRadarChartAxisDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualRadarChartAxis entity = new DataVisualRadarChartAxis(); - entity.setWhere(wherestr); - List list = dataVisualRadarChartAxisDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualRadarChartAxis entity = new DataVisualRadarChartAxis(); - entity.setWhere(wherestr); - return dataVisualRadarChartAxisDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualRadarChartSeriesServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualRadarChartSeriesServiceImpl.java deleted file mode 100644 index 3ad4fdba..00000000 --- a/src/com/sipai/service/process/impl/DataVisualRadarChartSeriesServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualRadarChartSeriesDao; -import com.sipai.entity.process.DataVisualRadarChartSeries; -import com.sipai.service.process.DataVisualRadarChartSeriesService; - -@Service -public class DataVisualRadarChartSeriesServiceImpl implements DataVisualRadarChartSeriesService { - @Resource - private DataVisualRadarChartSeriesDao dataVisualRadarChartSeriesDao; - - @Override - public DataVisualRadarChartSeries selectById(String id) { - DataVisualRadarChartSeries entity = dataVisualRadarChartSeriesDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualRadarChartSeriesDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualRadarChartSeries entity) { - return dataVisualRadarChartSeriesDao.insert(entity); - } - - @Override - public int update(DataVisualRadarChartSeries entity) { - return dataVisualRadarChartSeriesDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualRadarChartSeries entity = new DataVisualRadarChartSeries(); - entity.setWhere(wherestr); - List list = dataVisualRadarChartSeriesDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualRadarChartSeries entity = new DataVisualRadarChartSeries(); - entity.setWhere(wherestr); - return dataVisualRadarChartSeriesDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualRadarChartServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualRadarChartServiceImpl.java deleted file mode 100644 index 5077c968..00000000 --- a/src/com/sipai/service/process/impl/DataVisualRadarChartServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualRadarChartDao; -import com.sipai.entity.process.DataVisualRadarChart; -import com.sipai.service.process.DataVisualRadarChartService; - -@Service -public class DataVisualRadarChartServiceImpl implements DataVisualRadarChartService { - @Resource - private DataVisualRadarChartDao dataVisualRadarChartDao; - - @Override - public DataVisualRadarChart selectById(String id) { - DataVisualRadarChart entity = dataVisualRadarChartDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualRadarChartDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualRadarChart entity) { - return dataVisualRadarChartDao.insert(entity); - } - - @Override - public int update(DataVisualRadarChart entity) { - return dataVisualRadarChartDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualRadarChart entity = new DataVisualRadarChart(); - entity.setWhere(wherestr); - List list = dataVisualRadarChartDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualRadarChart entity = new DataVisualRadarChart(); - entity.setWhere(wherestr); - return dataVisualRadarChartDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualSelectServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualSelectServiceImpl.java deleted file mode 100644 index d7612577..00000000 --- a/src/com/sipai/service/process/impl/DataVisualSelectServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualSelectDao; -import com.sipai.entity.process.DataVisualSelect; -import com.sipai.service.process.DataVisualSelectService; - -@Service -public class DataVisualSelectServiceImpl implements DataVisualSelectService { - @Resource - private DataVisualSelectDao dataVisualSelectDao; - - @Override - public DataVisualSelect selectById(String id) { - DataVisualSelect entity = dataVisualSelectDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualSelectDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualSelect entity) { - return dataVisualSelectDao.insert(entity); - } - - @Override - public int update(DataVisualSelect entity) { - return dataVisualSelectDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualSelect entity = new DataVisualSelect(); - entity.setWhere(wherestr); - List list = dataVisualSelectDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualSelect entity = new DataVisualSelect(); - entity.setWhere(wherestr); - return dataVisualSelectDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualSuspensionFrameServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualSuspensionFrameServiceImpl.java deleted file mode 100644 index 1f041da9..00000000 --- a/src/com/sipai/service/process/impl/DataVisualSuspensionFrameServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualSuspensionFrameDao; -import com.sipai.entity.process.DataVisualSuspensionFrame; -import com.sipai.service.process.DataVisualSuspensionFrameService; - -@Service -public class DataVisualSuspensionFrameServiceImpl implements DataVisualSuspensionFrameService { - @Resource - private DataVisualSuspensionFrameDao dataVisualSuspensionFrameDao; - - @Override - public DataVisualSuspensionFrame selectById(String id) { - DataVisualSuspensionFrame entity = dataVisualSuspensionFrameDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualSuspensionFrameDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualSuspensionFrame entity) { - return dataVisualSuspensionFrameDao.insert(entity); - } - - @Override - public int update(DataVisualSuspensionFrame entity) { - return dataVisualSuspensionFrameDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualSuspensionFrame entity = new DataVisualSuspensionFrame(); - entity.setWhere(wherestr); - List list = dataVisualSuspensionFrameDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualSuspensionFrame entity = new DataVisualSuspensionFrame(); - entity.setWhere(wherestr); - return dataVisualSuspensionFrameDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualSvgAlarmServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualSvgAlarmServiceImpl.java deleted file mode 100644 index cebb65f4..00000000 --- a/src/com/sipai/service/process/impl/DataVisualSvgAlarmServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualSvgAlarmDao; -import com.sipai.entity.process.DataVisualSvgAlarm; -import com.sipai.service.process.DataVisualSvgAlarmService; - -@Service -public class DataVisualSvgAlarmServiceImpl implements DataVisualSvgAlarmService { - @Resource - private DataVisualSvgAlarmDao dataVisualSvgAlarmDao; - - @Override - public DataVisualSvgAlarm selectById(String id) { - DataVisualSvgAlarm entity = dataVisualSvgAlarmDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualSvgAlarmDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualSvgAlarm entity) { - return dataVisualSvgAlarmDao.insert(entity); - } - - @Override - public int update(DataVisualSvgAlarm entity) { - return dataVisualSvgAlarmDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualSvgAlarm entity = new DataVisualSvgAlarm(); - entity.setWhere(wherestr); - List list = dataVisualSvgAlarmDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualSvgAlarm entity = new DataVisualSvgAlarm(); - entity.setWhere(wherestr); - return dataVisualSvgAlarmDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualSvgServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualSvgServiceImpl.java deleted file mode 100644 index eb16e079..00000000 --- a/src/com/sipai/service/process/impl/DataVisualSvgServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualSvgDao; -import com.sipai.entity.process.DataVisualSvg; -import com.sipai.service.process.DataVisualSvgService; - -@Service -public class DataVisualSvgServiceImpl implements DataVisualSvgService { - @Resource - private DataVisualSvgDao DataVisualSvgDao; - - @Override - public DataVisualSvg selectById(String id) { - DataVisualSvg entity = DataVisualSvgDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return DataVisualSvgDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualSvg entity) { - return DataVisualSvgDao.insert(entity); - } - - @Override - public int update(DataVisualSvg entity) { - return DataVisualSvgDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualSvg entity = new DataVisualSvg(); - entity.setWhere(wherestr); - List list = DataVisualSvgDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualSvg entity = new DataVisualSvg(); - entity.setWhere(wherestr); - return DataVisualSvgDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualSwitchPointServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualSwitchPointServiceImpl.java deleted file mode 100644 index 5bf9a6dc..00000000 --- a/src/com/sipai/service/process/impl/DataVisualSwitchPointServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualSwitchPointDao; -import com.sipai.entity.process.DataVisualSwitchPoint; -import com.sipai.service.process.DataVisualSwitchPointService; - -@Service -public class DataVisualSwitchPointServiceImpl implements DataVisualSwitchPointService { - @Resource - private DataVisualSwitchPointDao DataVisualSwitchPointDao; - - @Override - public DataVisualSwitchPoint selectById(String id) { - DataVisualSwitchPoint entity = DataVisualSwitchPointDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return DataVisualSwitchPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualSwitchPoint entity) { - return DataVisualSwitchPointDao.insert(entity); - } - - @Override - public int update(DataVisualSwitchPoint entity) { - return DataVisualSwitchPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualSwitchPoint entity = new DataVisualSwitchPoint(); - entity.setWhere(wherestr); - List list = DataVisualSwitchPointDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualSwitchPoint entity = new DataVisualSwitchPoint(); - entity.setWhere(wherestr); - return DataVisualSwitchPointDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualSwitchServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualSwitchServiceImpl.java deleted file mode 100644 index d73d9ee3..00000000 --- a/src/com/sipai/service/process/impl/DataVisualSwitchServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualSwitchDao; -import com.sipai.entity.process.DataVisualSwitch; -import com.sipai.service.process.DataVisualSwitchService; - -@Service -public class DataVisualSwitchServiceImpl implements DataVisualSwitchService { - @Resource - private DataVisualSwitchDao DataVisualSwitchDao; - - @Override - public DataVisualSwitch selectById(String id) { - DataVisualSwitch entity = DataVisualSwitchDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return DataVisualSwitchDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualSwitch entity) { - return DataVisualSwitchDao.insert(entity); - } - - @Override - public int update(DataVisualSwitch entity) { - return DataVisualSwitchDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualSwitch entity = new DataVisualSwitch(); - entity.setWhere(wherestr); - List list = DataVisualSwitchDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualSwitch entity = new DataVisualSwitch(); - entity.setWhere(wherestr); - return DataVisualSwitchDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualTabServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualTabServiceImpl.java deleted file mode 100644 index 5d0ad517..00000000 --- a/src/com/sipai/service/process/impl/DataVisualTabServiceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualTabDao; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.DataVisualTab; -import com.sipai.service.process.DataVisualTabService; - -@Service -public class DataVisualTabServiceImpl implements DataVisualTabService { - @Resource - private DataVisualTabDao dataVisualTabDao; - - @Override - public DataVisualTab selectById(String id) { - DataVisualTab entity = dataVisualTabDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualTabDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualTab entity) { - return dataVisualTabDao.insert(entity); - } - - @Override - public int update(DataVisualTab entity) { - return dataVisualTabDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualTab entity = new DataVisualTab(); - entity.setWhere(wherestr); - List list = dataVisualTabDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualTab entity = new DataVisualTab(); - entity.setWhere(wherestr); - return dataVisualTabDao.deleteByWhere(entity); - } - - @Override - public int updateByWhere(String wherestr) { - DataVisualTab entity = new DataVisualTab(); - entity.setWhere(wherestr); - return dataVisualTabDao.updateByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualTaskPointsServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualTaskPointsServiceImpl.java deleted file mode 100644 index ebacb6ca..00000000 --- a/src/com/sipai/service/process/impl/DataVisualTaskPointsServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.service.timeefficiency.PatrolPointService; -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualTaskPointsDao; -import com.sipai.entity.process.DataVisualTaskPoints; -import com.sipai.service.process.DataVisualTaskPointsService; - -@Service -public class DataVisualTaskPointsServiceImpl implements DataVisualTaskPointsService { - @Resource - private DataVisualTaskPointsDao dataVisualTaskPointsDao; - @Resource - private PatrolPointService patrolPointService; - - @Override - public DataVisualTaskPoints selectById(String id) { - DataVisualTaskPoints entity = dataVisualTaskPointsDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualTaskPointsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualTaskPoints entity) { - return dataVisualTaskPointsDao.insert(entity); - } - - @Override - public int update(DataVisualTaskPoints entity) { - return dataVisualTaskPointsDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualTaskPoints entity = new DataVisualTaskPoints(); - entity.setWhere(wherestr); - List list = dataVisualTaskPointsDao.selectListByWhere(entity); - for (DataVisualTaskPoints dataVisualTaskPoints : - list) { - PatrolPoint patrolPoint = this.patrolPointService.selectById(dataVisualTaskPoints.getTaskid()); - if (patrolPoint != null) { - dataVisualTaskPoints.setTask_name(patrolPoint.getName()); - dataVisualTaskPoints.setTask_pointCode(patrolPoint.getPointCode()); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualTaskPoints entity = new DataVisualTaskPoints(); - entity.setWhere(wherestr); - return dataVisualTaskPointsDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualTextServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualTextServiceImpl.java deleted file mode 100644 index 7f907eac..00000000 --- a/src/com/sipai/service/process/impl/DataVisualTextServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualTextDao; -import com.sipai.entity.process.DataVisualText; -import com.sipai.service.process.DataVisualTextService; - -@Service("dataVisualTextService") -public class DataVisualTextServiceImpl implements DataVisualTextService { - @Resource - private DataVisualTextDao dataVisualTextDao; - - @Override - public DataVisualText selectById(String id) { - DataVisualText entity = dataVisualTextDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualTextDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualText entity) { - return dataVisualTextDao.insert(entity); - } - - @Override - public int update(DataVisualText entity) { - return dataVisualTextDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualText entity = new DataVisualText(); - entity.setWhere(wherestr); - List list = dataVisualTextDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualText entity = new DataVisualText(); - entity.setWhere(wherestr); - return dataVisualTextDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualTextWarehouseServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualTextWarehouseServiceImpl.java deleted file mode 100644 index 09f34765..00000000 --- a/src/com/sipai/service/process/impl/DataVisualTextWarehouseServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualTextWarehouseDao; -import com.sipai.entity.process.DataVisualTextWarehouse; -import com.sipai.service.process.DataVisualTextWarehouseService; - -@Service -public class DataVisualTextWarehouseServiceImpl implements DataVisualTextWarehouseService { - @Resource - private DataVisualTextWarehouseDao dataVisualTextWarehouseDao; - - @Override - public DataVisualTextWarehouse selectById(String id) { - DataVisualTextWarehouse entity = dataVisualTextWarehouseDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualTextWarehouseDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualTextWarehouse entity) { - return dataVisualTextWarehouseDao.insert(entity); - } - - @Override - public int update(DataVisualTextWarehouse entity) { - return dataVisualTextWarehouseDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualTextWarehouse entity = new DataVisualTextWarehouse(); - entity.setWhere(wherestr); - List list = dataVisualTextWarehouseDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualTextWarehouse entity = new DataVisualTextWarehouse(); - entity.setWhere(wherestr); - return dataVisualTextWarehouseDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/DataVisualWeatherServiceImpl.java b/src/com/sipai/service/process/impl/DataVisualWeatherServiceImpl.java deleted file mode 100644 index 75533922..00000000 --- a/src/com/sipai/service/process/impl/DataVisualWeatherServiceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DataVisualWeatherDao; -import com.sipai.entity.process.DataVisualWeather; -import com.sipai.service.process.DataVisualWeatherService; - -@Service -public class DataVisualWeatherServiceImpl implements DataVisualWeatherService { - @Resource - private DataVisualWeatherDao dataVisualWeatherDao; - - @Override - public DataVisualWeather selectById(String id) { - DataVisualWeather entity = dataVisualWeatherDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return dataVisualWeatherDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataVisualWeather entity) { - return dataVisualWeatherDao.insert(entity); - } - - @Override - public int update(DataVisualWeather entity) { - return dataVisualWeatherDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DataVisualWeather entity = new DataVisualWeather(); - entity.setWhere(wherestr); - List list = dataVisualWeatherDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DataVisualWeather entity = new DataVisualWeather(); - entity.setWhere(wherestr); - return dataVisualWeatherDao.deleteByWhere(entity); - } - - @Override - public List selectTop1ListByWhere(String wherestr) { - DataVisualWeather entity = new DataVisualWeather(); - entity.setWhere(wherestr); - List list = dataVisualWeatherDao.selectTop1ListByWhere(entity); - return list; - } - -} diff --git a/src/com/sipai/service/process/impl/DecisionExpertBaseServiceImpl.java b/src/com/sipai/service/process/impl/DecisionExpertBaseServiceImpl.java deleted file mode 100644 index 975b79c3..00000000 --- a/src/com/sipai/service/process/impl/DecisionExpertBaseServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DecisionExpertBaseDao; -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.service.process.DecisionExpertBaseService; - -@Service -public class DecisionExpertBaseServiceImpl implements DecisionExpertBaseService { - @Resource - private DecisionExpertBaseDao decisionExpertBaseDao; - - @Override - public DecisionExpertBase selectById(String id) { - DecisionExpertBase entity = decisionExpertBaseDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return decisionExpertBaseDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DecisionExpertBase entity) { - return decisionExpertBaseDao.insert(entity); - } - - @Override - public int update(DecisionExpertBase entity) { - return decisionExpertBaseDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DecisionExpertBase entity = new DecisionExpertBase(); - entity.setWhere(wherestr); - List list = decisionExpertBaseDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DecisionExpertBase entity = new DecisionExpertBase(); - entity.setWhere(wherestr); - return decisionExpertBaseDao.deleteByWhere(entity); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - @Override - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (DecisionExpertBase k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (DecisionExpertBase k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/process/impl/DecisionExpertBaseTextServiceImpl.java b/src/com/sipai/service/process/impl/DecisionExpertBaseTextServiceImpl.java deleted file mode 100644 index 4942c5cf..00000000 --- a/src/com/sipai/service/process/impl/DecisionExpertBaseTextServiceImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.*; - -import javax.annotation.Resource; - -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.user.Unit; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.tools.CommString; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.DecisionExpertBaseTextDao; -import com.sipai.entity.process.DecisionExpertBaseText; -import com.sipai.service.process.DecisionExpertBaseTextService; - -@Service -public class DecisionExpertBaseTextServiceImpl implements DecisionExpertBaseTextService { - @Resource - private DecisionExpertBaseTextDao decisionExpertBaseTextDao; - @Resource - private DecisionExpertBaseService decisionExpertBaseService; - - @Override - public DecisionExpertBaseText selectById(String id) { - DecisionExpertBaseText entity = decisionExpertBaseTextDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return decisionExpertBaseTextDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DecisionExpertBaseText entity) { - return decisionExpertBaseTextDao.insert(entity); - } - - @Override - public int update(DecisionExpertBaseText entity) { - return decisionExpertBaseTextDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - DecisionExpertBaseText entity = new DecisionExpertBaseText(); - entity.setWhere(wherestr); - List list = decisionExpertBaseTextDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - DecisionExpertBaseText entity = new DecisionExpertBaseText(); - entity.setWhere(wherestr); - return decisionExpertBaseTextDao.deleteByWhere(entity); - } - - /** - * 获取所有子节点id - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - String resIds = ""; - public String getChildren(String pid){ - List decisionExpertBases = decisionExpertBaseService.selectListByWhere(" where pid='" + pid + "'"); - if(decisionExpertBases != null && decisionExpertBases.size() > 0){ - for(int i = 0; i < decisionExpertBases.size(); i++){ - resIds += decisionExpertBases.get(i).getId() + ","; - getChildren(decisionExpertBases.get(i).getId()); - } - } - return resIds; - } - - List t = new ArrayList(); - public List getChildrenById(String id){ - t = decisionExpertBaseService.selectListByWhere(" where 1 = 1"); - List listRes = getChildren(id,t); - listRes.add(decisionExpertBaseService.selectById(id)); - listRes.removeAll(Collections.singleton(null)); - return listRes; - } - - /** - * 递归获取子节点 - * @param - */ - public List getChildren(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0; i result=getChildren(t.get(i).getId(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - - /** - * 获取所有子节点id - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getChildrenID(String ids,List list) { - if(ids == null && ids.equals("") ) { - for(DecisionExpertBase k: list) { - if( "-1".equals(k.getPid()) ) { - ids += k.getId().toString()+","; - } - } - getChildrenID(ids,list); - }else{ - String[] idsAll = ids.split(","); - for(String id:idsAll) { - String childIds = ""; - for(DecisionExpertBase k:list) { - String pid = k.getPid()+""; - if(id.equals(pid)) { - childIds += k.getId().toString()+","; - } - } - if(childIds!=null && !childIds.equals("")) { - ids += childIds; - getChildrenID(childIds,list); - } - } - } - resIds += ids; - return ids; - } - -} diff --git a/src/com/sipai/service/process/impl/LibraryProcessAbnormalServiceImpl.java b/src/com/sipai/service/process/impl/LibraryProcessAbnormalServiceImpl.java deleted file mode 100644 index 8b61fee8..00000000 --- a/src/com/sipai/service/process/impl/LibraryProcessAbnormalServiceImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.LibraryProcessAbnormalDao; -import com.sipai.entity.process.LibraryProcessAbnormal; -import com.sipai.service.process.LibraryProcessAbnormalService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class LibraryProcessAbnormalServiceImpl implements LibraryProcessAbnormalService { - @Resource - private LibraryProcessAbnormalDao libraryProcessAbnormalDao; - - @Override - public LibraryProcessAbnormal selectById(String id) { - return libraryProcessAbnormalDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryProcessAbnormalDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryProcessAbnormal entity) { - return libraryProcessAbnormalDao.insert(entity); - } - - @Override - public int update(LibraryProcessAbnormal entity) { - return libraryProcessAbnormalDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryProcessAbnormal entity = new LibraryProcessAbnormal(); - entity.setWhere(wherestr); - List list = libraryProcessAbnormalDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryProcessAbnormal entity = new LibraryProcessAbnormal(); - entity.setWhere(wherestr); - return libraryProcessAbnormalDao.deleteByWhere(entity); - } -} diff --git a/src/com/sipai/service/process/impl/LibraryProcessAdjustmentServiceImpl.java b/src/com/sipai/service/process/impl/LibraryProcessAdjustmentServiceImpl.java deleted file mode 100644 index 4e2e87f0..00000000 --- a/src/com/sipai/service/process/impl/LibraryProcessAdjustmentServiceImpl.java +++ /dev/null @@ -1,518 +0,0 @@ -package com.sipai.service.process.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.process.ProcessAdjustmentType; -import com.sipai.service.process.ProcessAdjustmentTypeService; -import com.sipai.tools.CommUtil; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.process.LibraryProcessAdjustmentDao; -import com.sipai.entity.process.LibraryProcessAbnormal; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.LibraryWaterTest; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.service.process.LibraryProcessAbnormalService; -import com.sipai.service.process.LibraryProcessAdjustmentService; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryProcessAdjustmentServiceImpl implements LibraryProcessAdjustmentService { - @Resource - private LibraryProcessAdjustmentDao libraryProcessAdjustmentDao; - @Resource - private ProcessAdjustmentTypeService processAdjustmentTypeService; - @Resource - private LibraryProcessAbnormalService libraryProcessAbnormalService; - - @Override - public LibraryProcessAdjustment selectById(String id) { - LibraryProcessAdjustment entity = libraryProcessAdjustmentDao.selectByPrimaryKey(id); - if (entity != null) { -// ProcessAdjustmentType processAdjustmentType = processAdjustmentTypeService.selectById(entity.getPid()); -// entity.setProcessAdjustmentType(processAdjustmentType); - LibraryProcessAbnormal libraryProcessAbnormal = libraryProcessAbnormalService.selectById(entity.getPid()); - entity.setLibraryProcessAbnormal(libraryProcessAbnormal); - } - return entity; - } - - @Override - public int deleteById(String id) { - return libraryProcessAdjustmentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryProcessAdjustment entity) { - return libraryProcessAdjustmentDao.insert(entity); - } - - @Override - public int update(LibraryProcessAdjustment entity) { - return libraryProcessAdjustmentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryProcessAdjustment entity = new LibraryProcessAdjustment(); - entity.setWhere(wherestr); - List list = libraryProcessAdjustmentDao.selectListByWhere(entity); - for (LibraryProcessAdjustment libraryProcessAdjustment : list) { -// ProcessAdjustmentType processAdjustmentType = processAdjustmentTypeService.selectById(libraryProcessAdjustment.getPid()); -// libraryProcessAdjustment.setProcessAdjustmentType(processAdjustmentType); - LibraryProcessAbnormal libraryProcessAbnormal = libraryProcessAbnormalService.selectById(libraryProcessAdjustment.getPid()); - libraryProcessAdjustment.setLibraryProcessAbnormal(libraryProcessAbnormal); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryProcessAdjustment entity = new LibraryProcessAdjustment(); - entity.setWhere(wherestr); - return libraryProcessAdjustmentDao.deleteByWhere(entity); - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input, String unitId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; -// for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - List clist = this.processAdjustmentTypeService.selectListByWhere(" where 1=1 order by morder "); - if (clist != null && clist.size() > 0) { - for (ProcessAdjustmentType processAdjustmentType : clist) { - String typeName = processAdjustmentType.getName(); - HSSFSheet sheet = workbook.getSheet(typeName); - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头 - HSSFRow row = sheet.getRow(rowNum); - - //编号为空则不跳过 不导入 防止导入空的 - if (getMergedRegionValue(sheet, rowNum, 1) == null || getMergedRegionValue(sheet, rowNum, 1).trim().equals("")) { - break; - } - - int minCellNum = 1;//读取数据从第1列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - - LibraryProcessAbnormal lAbnormal = new LibraryProcessAbnormal(); - LibraryProcessAdjustment lAdjustment = new LibraryProcessAdjustment(); - for (int i = minCellNum; i < maxCellNum; i++) { - String resultString = getMergedRegionValue(sheet, rowNum, i); - if (i == 1) {//异常编号 - lAbnormal.setAbnormalCode(resultString); - } else if (i == 2) {//异常名称 - lAbnormal.setAbnormalName(resultString); - } else if (i == 3) {//异常现象分析 - lAbnormal.setAbnormalAnalysis(resultString); - } else if (i == 4) {//工艺调整代码 - lAdjustment.setProCode(resultString); - } else if (i == 5) {//工艺调整名称 - lAdjustment.setProName(resultString); - } else if (i == 6) {//接单额定工时 - lAdjustment.setReceiveRatedTime(Float.valueOf(resultString)); - } else if (i == 7) {//工艺调整措施 - lAdjustment.setProMeasures(resultString); - } else if (i == 8) {//工艺调整监控指标 - lAdjustment.setMonitorTarget(resultString); - } else if (i == 9) {//工艺调整验收标准 - lAdjustment.setCheckStandard(resultString); - } - } - - lAbnormal.setUnitId(unitId); - lAbnormal.setPid(processAdjustmentType.getId()); - lAbnormal.setInsdt(CommUtil.nowDate()); - - List alist = this.libraryProcessAbnormalService.selectListByWhere(" where abnormal_code='" + lAbnormal.getAbnormalCode() + "' and pid='" + processAdjustmentType.getId() + "' and unit_id='" + unitId + "' "); - if (alist != null && alist.size() > 0) { - lAbnormal.setId(alist.get(0).getId()); - this.libraryProcessAbnormalService.update(lAbnormal); - } else { - lAbnormal.setId(CommUtil.getUUID()); - this.libraryProcessAbnormalService.save(lAbnormal); - } - - - lAdjustment.setUnitId(unitId); - lAdjustment.setPid(lAbnormal.getId()); - lAdjustment.setInsdt(CommUtil.nowDate()); - - int codeInsert = 0; - int codeUpdate = 0; - lAdjustment.setWhere("where pid='" + lAbnormal.getId() + "' and pro_code = '" + lAdjustment.getProCode() + "' and unit_id = '" + unitId + "' "); - - LibraryProcessAdjustment libraryProcessAdjustment = libraryProcessAdjustmentDao.selectByWhere(lAdjustment); - if (libraryProcessAdjustment != null) { - lAdjustment.setId(libraryProcessAdjustment.getId()); - codeUpdate = update(lAdjustment); - } else { - lAdjustment.setId(CommUtil.getUUID()); - codeInsert = save(lAdjustment); - } - - if (codeInsert == 1) { - insertNum++; - } - if (codeUpdate == 1) { - updateNum++; - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - return result; - } - - @SuppressWarnings("deprecation") - public void outExcelTemplate(HttpServletResponse response, String unitId) throws IOException { - String fileName = "运行工单工艺调整库.xls"; - String title = "运行工单工艺调整库"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 -// HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - - List clist = this.processAdjustmentTypeService.selectListByWhere(" where 1=1 order by morder "); - if (clist != null && clist.size() > 0) { - for (ProcessAdjustmentType processAdjustmentType : clist) { - String typeName = processAdjustmentType.getName(); - String cidString = processAdjustmentType.getId(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(typeName); - - String excelTitleStr = "序号,异常编号,异常名称,异常现象分析,工艺调整代码,工艺调整名称,接单额定工时,工艺调整措施,工艺调整监控指标,工艺调整验收标准"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 700); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - // 设置表格每列的宽度 - if (i == 0) { - sheet.setColumnWidth(i, 3000); - } else { - sheet.setColumnWidth(i, 6000); - } - - } - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("运行工单工艺调整库-" + typeName); - - List alist = this.libraryProcessAbnormalService.selectListByWhere(" where pid='" + cidString + "' and unit_id='" + unitId + "' "); - if (alist != null && alist.size() > 0) { - int lastNum = 0; - for (int m = 0; m < alist.size(); m++) { - List list = selectListByWhere(" where pid='" + alist.get(m).getId() + "' and unit_id='" + unitId + "' "); - if (list != null && list.size() > 0) { -// System.out.println(m+2+lastNum); - HSSFRow rowMC = sheet.createRow(m + 2 + lastNum); - - LibraryProcessAbnormal libraryProcessAbnormal = alist.get(m); - - HSSFCell cell_0 = rowMC.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(m + 1); - - if (libraryProcessAbnormal.getAbnormalCode() != null) { - HSSFCell cell_c = rowMC.createCell(1);//异常编号 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAbnormal.getAbnormalCode()); - } - - if (libraryProcessAbnormal.getAbnormalName() != null) { - HSSFCell cell_c = rowMC.createCell(2);//异常名称 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAbnormal.getAbnormalName()); - } - - if (libraryProcessAbnormal.getAbnormalAnalysis() != null) { - HSSFCell cell_c = rowMC.createCell(3);//异常现象分析 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAbnormal.getAbnormalAnalysis()); - } - - - for (int i = 0; i < list.size(); i++) { - HSSFRow rowC = null; - if (i == 0) { - rowC = sheet.getRow(m + 2 + lastNum); - } else { - rowC = sheet.createRow(m + 2 + lastNum + 1 + i - 1); - //给合并的单元格加框 - HSSFCell cell_c_0 = rowC.createCell(0); - cell_c_0.setCellStyle(listStyle); - cell_c_0.setCellValue(""); - HSSFCell cell_c_1 = rowC.createCell(1);//异常编号 - cell_c_1.setCellStyle(listStyle); - cell_c_1.setCellValue(""); - HSSFCell cell_c_2 = rowC.createCell(2);//异常名称 - cell_c_2.setCellStyle(listStyle); - cell_c_2.setCellValue(""); - HSSFCell cell_c_3 = rowC.createCell(3);//异常现象分析 - cell_c_3.setCellStyle(listStyle); - cell_c_3.setCellValue(""); - } - - LibraryProcessAdjustment libraryProcessAdjustment = list.get(i); - - - if (libraryProcessAdjustment.getProCode() != null) { - HSSFCell cell_c = rowC.createCell(4);//工艺调整代码 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAdjustment.getProCode()); - } - - if (libraryProcessAdjustment.getProName() != null) { - HSSFCell cell_c = rowC.createCell(5);//工艺调整名称 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAdjustment.getProName()); - } - - HSSFCell cell_c_7 = rowC.createCell(6);//接单额定工时 - cell_c_7.setCellStyle(listStyle); - cell_c_7.setCellValue(libraryProcessAdjustment.getReceiveRatedTime()); - - if (libraryProcessAdjustment.getProMeasures() != null) { - HSSFCell cell_c = rowC.createCell(7);//工艺调整措施 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAdjustment.getProMeasures()); - } - - if (libraryProcessAdjustment.getMonitorTarget() != null) { - HSSFCell cell_c = rowC.createCell(8);//工艺调整监控指标 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAdjustment.getMonitorTarget()); - } - - if (libraryProcessAdjustment.getCheckStandard() != null) { - HSSFCell cell_c = rowC.createCell(9);//工艺调整验收标准 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAdjustment.getCheckStandard()); - } - - } - sheet.addMergedRegion(new CellRangeAddress(m + 2 + lastNum, list.size() - 1 + m + 2 + lastNum, 0, 0)); - sheet.addMergedRegion(new CellRangeAddress(m + 2 + lastNum, list.size() - 1 + m + 2 + lastNum, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(m + 2 + lastNum, list.size() - 1 + m + 2 + lastNum, 2, 2)); - sheet.addMergedRegion(new CellRangeAddress(m + 2 + lastNum, list.size() - 1 + m + 2 + lastNum, 3, 3)); - lastNum = lastNum + list.size() - 1; - } else { -// System.out.println("lastNum:"+lastNum); -// System.out.println(m+2+lastNum); - HSSFRow rowMC = sheet.createRow(m + 2 + lastNum); - - HSSFCell cell_0 = rowMC.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(m + 1); - LibraryProcessAbnormal libraryProcessAbnormal = alist.get(m); - if (libraryProcessAbnormal.getAbnormalCode() != null) { - HSSFCell cell_c = rowMC.createCell(1);//异常编号 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAbnormal.getAbnormalCode()); - } - - if (libraryProcessAbnormal.getAbnormalName() != null) { - HSSFCell cell_c = rowMC.createCell(2);//异常名称 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAbnormal.getAbnormalName()); - } - - if (libraryProcessAbnormal.getAbnormalAnalysis() != null) { - HSSFCell cell_c = rowMC.createCell(3);//异常现象分析 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryProcessAbnormal.getAbnormalAnalysis()); - } -// lastNum=lastNum+1; - } - } - } - - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * 获取合并单元格的值 - * - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - - for (int i = 0; i < sheetMergeCount; i++) { - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell); - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell); - } - -} diff --git a/src/com/sipai/service/process/impl/LibraryProcessManageDetailServiceImpl.java b/src/com/sipai/service/process/impl/LibraryProcessManageDetailServiceImpl.java deleted file mode 100644 index efe504a2..00000000 --- a/src/com/sipai/service/process/impl/LibraryProcessManageDetailServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.LibraryProcessManageDetailDao; -import com.sipai.entity.process.LibraryProcessManageDetail; -import com.sipai.service.process.LibraryProcessManageDetailService; -import com.sipai.service.scada.MPointService; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class LibraryProcessManageDetailServiceImpl implements LibraryProcessManageDetailService { - @Resource - private LibraryProcessManageDetailDao libraryProcessManageDetailDao; - @Resource - private MPointService mPointService; - - @Override - public LibraryProcessManageDetail selectById(String id,String unitId) { - LibraryProcessManageDetail entity = libraryProcessManageDetailDao.selectByPrimaryKey(id); - if(entity!=null){ - entity.setmPoint(this.mPointService.selectById(unitId, entity.getMeasurePointId())); - } - return entity; - } - - @Override - public int deleteById(String id) { - return libraryProcessManageDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryProcessManageDetail entity) { - return libraryProcessManageDetailDao.insert(entity); - } - - @Override - public int update(LibraryProcessManageDetail entity) { - return libraryProcessManageDetailDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr,String unitId) { - LibraryProcessManageDetail entity = new LibraryProcessManageDetail(); - entity.setWhere(wherestr); - List list = libraryProcessManageDetailDao.selectListByWhere(entity); - for (LibraryProcessManageDetail libraryProcessManageDetail : list){ - libraryProcessManageDetail.setmPoint(this.mPointService.selectById(unitId, libraryProcessManageDetail.getMeasurePointId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryProcessManageDetail entity = new LibraryProcessManageDetail(); - entity.setWhere(wherestr); - return libraryProcessManageDetailDao.deleteByWhere(entity); - } -} diff --git a/src/com/sipai/service/process/impl/LibraryProcessManageServiceImpl.java b/src/com/sipai/service/process/impl/LibraryProcessManageServiceImpl.java deleted file mode 100644 index d6224bfb..00000000 --- a/src/com/sipai/service/process/impl/LibraryProcessManageServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.LibraryProcessManageDao; -import com.sipai.entity.process.LibraryProcessManage; -import com.sipai.service.process.LibraryProcessManageService; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class LibraryProcessManageServiceImpl implements LibraryProcessManageService { - @Resource - private LibraryProcessManageDao libraryProcessManageDao; - - @Override - public LibraryProcessManage selectById(String id) { - return libraryProcessManageDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryProcessManageDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryProcessManage entity) { - return libraryProcessManageDao.insert(entity); - } - - @Override - public int update(LibraryProcessManage entity) { - return libraryProcessManageDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryProcessManage entity = new LibraryProcessManage(); - entity.setWhere(wherestr); - List list = libraryProcessManageDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryProcessManage entity = new LibraryProcessManage(); - entity.setWhere(wherestr); - return libraryProcessManageDao.deleteByWhere(entity); - } -} diff --git a/src/com/sipai/service/process/impl/LibraryProcessManageTypeServiceImpl.java b/src/com/sipai/service/process/impl/LibraryProcessManageTypeServiceImpl.java deleted file mode 100644 index 246fcc40..00000000 --- a/src/com/sipai/service/process/impl/LibraryProcessManageTypeServiceImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.process.LibraryProcessManageTypeDao; -import com.sipai.entity.process.LibraryProcessManageType; -import com.sipai.service.process.LibraryProcessManageTypeService; - -@Service("LibraryProcessManageTypeService") -public class LibraryProcessManageTypeServiceImpl implements LibraryProcessManageTypeService{ - @Resource - private LibraryProcessManageTypeDao libraryProcessManageTypeDao; - - @Override - public LibraryProcessManageType selectById(String id) { - return libraryProcessManageTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return libraryProcessManageTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryProcessManageType entity) { - return libraryProcessManageTypeDao.insert(entity); - } - - @Override - public int update(LibraryProcessManageType entity) { - return libraryProcessManageTypeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryProcessManageType entity = new LibraryProcessManageType(); - entity.setWhere(wherestr); - return libraryProcessManageTypeDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryProcessManageType entity = new LibraryProcessManageType(); - entity.setWhere(wherestr); - return libraryProcessManageTypeDao.deleteByWhere(entity); - } - - @Override - public String getTreeListtest(List list) { - List> list_result = new ArrayList>(); - for (LibraryProcessManageType entity : list) { - Map map = new HashMap(); - map.put("id", entity.getId().toString()); - map.put("text", entity.getName().toString()); - map.put("pid", "-1"); - map.put("icon", ""); - list_result.add(map); - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/process/impl/LibraryProcessManageWorkOrderServiceImpl.java b/src/com/sipai/service/process/impl/LibraryProcessManageWorkOrderServiceImpl.java deleted file mode 100644 index 6a5fb649..00000000 --- a/src/com/sipai/service/process/impl/LibraryProcessManageWorkOrderServiceImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.process.LibraryProcessManageWorkOrderDao; -import com.sipai.entity.process.LibraryProcessManage; -import com.sipai.entity.process.LibraryProcessManageWorkOrder; -import com.sipai.entity.user.User; -import com.sipai.service.process.LibraryProcessManageService; -import com.sipai.service.process.LibraryProcessManageWorkOrderService; -import com.sipai.service.user.UserService; - -@Service("LibraryProcessManageWorkOrderService") -public class LibraryProcessManageWorkOrderServiceImpl implements LibraryProcessManageWorkOrderService{ - @Resource - private LibraryProcessManageWorkOrderDao libraryProcessManageWorkOrderDao; - @Resource - private LibraryProcessManageService libraryProcessManageService; - @Resource - private UserService userService; - - @Override - public LibraryProcessManageWorkOrder selectById(String id) { - LibraryProcessManageWorkOrder libraryProcessManageWorkOrder = libraryProcessManageWorkOrderDao.selectByPrimaryKey(id); - LibraryProcessManage libraryProcessManage=this.libraryProcessManageService.selectById(libraryProcessManageWorkOrder.getWarehouseId()); - if(libraryProcessManage!=null){ - libraryProcessManageWorkOrder.setLibraryProcessManage(libraryProcessManage); - } - - User issuederUser=this.userService.getUserById(libraryProcessManageWorkOrder.getIssueder()); - if(issuederUser!=null){ - libraryProcessManageWorkOrder.set_issueder(issuederUser.getCaption()); - } - - User reviewerUser=this.userService.getUserById(libraryProcessManageWorkOrder.getReviewer()); - if(reviewerUser!=null){ - libraryProcessManageWorkOrder.set_reviewer(reviewerUser.getCaption()); - } - - return libraryProcessManageWorkOrder; - } - - @Override - public int deleteById(String id) { - return libraryProcessManageWorkOrderDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryProcessManageWorkOrder entity) { - return libraryProcessManageWorkOrderDao.insert(entity); - } - - @Override - public int update(LibraryProcessManageWorkOrder entity) { - return libraryProcessManageWorkOrderDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryProcessManageWorkOrder entity = new LibraryProcessManageWorkOrder(); - entity.setWhere(wherestr); - List list=libraryProcessManageWorkOrderDao.selectListByWhere(entity); - if(list!=null&&list.size()>0){ - for (LibraryProcessManageWorkOrder libraryProcessManageWorkOrder : list) { - LibraryProcessManage libraryProcessManage=this.libraryProcessManageService.selectById(libraryProcessManageWorkOrder.getWarehouseId()); - if(libraryProcessManage!=null){ - libraryProcessManageWorkOrder.setLibraryProcessManage(libraryProcessManage); - } - - User issuederUser=this.userService.getUserById(libraryProcessManageWorkOrder.getIssueder()); - if(issuederUser!=null){ - libraryProcessManageWorkOrder.set_issueder(issuederUser.getCaption()); - } - - User reviewerUser=this.userService.getUserById(libraryProcessManageWorkOrder.getReviewer()); - if(reviewerUser!=null){ - libraryProcessManageWorkOrder.set_reviewer(reviewerUser.getCaption()); - } - - } - - } - - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryProcessManageWorkOrder entity = new LibraryProcessManageWorkOrder(); - entity.setWhere(wherestr); - return libraryProcessManageWorkOrderDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/LibraryRoutineWorkServiceImpl.java b/src/com/sipai/service/process/impl/LibraryRoutineWorkServiceImpl.java deleted file mode 100644 index 0370c05a..00000000 --- a/src/com/sipai/service/process/impl/LibraryRoutineWorkServiceImpl.java +++ /dev/null @@ -1,485 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.LibraryRoutineWorkDao; -import com.sipai.entity.administration.OrganizationClass; -import com.sipai.entity.process.LibraryRoutineWork; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexPlanNameData; -import com.sipai.service.administration.OrganizationClassService; -import com.sipai.service.process.LibraryRoutineWorkService; -import com.sipai.tools.CommUtil; - -import org.apache.poi.hssf.usermodel.DVConstraint; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFDataValidation; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryRoutineWorkServiceImpl implements LibraryRoutineWorkService { - @Resource - private LibraryRoutineWorkDao libraryRoutineWorkDao; - @Resource - private OrganizationClassService organizationClassService; - - @Override - public LibraryRoutineWork selectById(String id) { - LibraryRoutineWork lRoutineWork = libraryRoutineWorkDao.selectByPrimaryKey(id); - OrganizationClass positionType = this.organizationClassService.selectById(lRoutineWork.getPositionType()); - if (positionType != null) { - lRoutineWork.setPpositionType(positionType.getName()); - lRoutineWork.setPpositionTypeCode(positionType.getCode()); - } else { - lRoutineWork.setPpositionType("-1"); - lRoutineWork.setPpositionTypeCode("-1"); - } - OrganizationClass workTypeName = this.organizationClassService.selectById(lRoutineWork.getWorkTypeName()); - if (workTypeName != null) { - lRoutineWork.setPworkTypeName(workTypeName.getName()); - lRoutineWork.setPworkTypeNameCode(workTypeName.getCode()); - } else { - lRoutineWork.setPworkTypeName("-1"); - lRoutineWork.setPpositionTypeCode("-1"); - } - return lRoutineWork; - } - - @Override - public LibraryRoutineWork selectSimpleById(String id) { - LibraryRoutineWork lRoutineWork = libraryRoutineWorkDao.selectByPrimaryKey(id); - if(lRoutineWork!=null){ - OrganizationClass workTypeName = this.organizationClassService.selectById(lRoutineWork.getWorkTypeName()); - if (workTypeName != null) { - lRoutineWork.setPworkTypeName(workTypeName.getName()); - lRoutineWork.setPworkTypeNameCode(workTypeName.getCode()); - } - } - return lRoutineWork; - } - - @Override - public int deleteById(String id) { - return libraryRoutineWorkDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryRoutineWork entity) { - return libraryRoutineWorkDao.insert(entity); - } - - @Override - public int update(LibraryRoutineWork entity) { - return libraryRoutineWorkDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryRoutineWork entity = new LibraryRoutineWork(); - entity.setWhere(wherestr); - List list = libraryRoutineWorkDao.selectListByWhere(entity); - if (list != null && list.size() > 0) { - for (LibraryRoutineWork libraryRoutineWork : list) { - OrganizationClass positionType = this.organizationClassService.selectById(libraryRoutineWork.getPositionType()); - if (positionType != null) { - libraryRoutineWork.setPpositionType(positionType.getName()); - libraryRoutineWork.setPpositionTypeCode(positionType.getCode()); - } else { - libraryRoutineWork.setPpositionType("-1"); - libraryRoutineWork.setPpositionTypeCode("-1"); - } - OrganizationClass workTypeName = this.organizationClassService.selectById(libraryRoutineWork.getWorkTypeName()); - if (workTypeName != null) { - libraryRoutineWork.setPworkTypeName(workTypeName.getName()); - libraryRoutineWork.setPworkTypeNameCode(positionType.getCode()); - } else { - libraryRoutineWork.setPworkTypeName("-1"); - libraryRoutineWork.setPpositionTypeCode("-1"); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryRoutineWork entity = new LibraryRoutineWork(); - entity.setWhere(wherestr); - return libraryRoutineWorkDao.deleteByWhere(entity); - } - - @Override - public LibraryRoutineWork selectByWhere(String wherestr) { - LibraryRoutineWork entity = new LibraryRoutineWork(); - entity.setWhere(wherestr); - return libraryRoutineWorkDao.selectByWhere(entity); - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input, String unitId, String type) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; -// for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(0); - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头 - HSSFRow row = sheet.getRow(rowNum); - - //编号为空则不跳过 不导入 防止导入空的 - HSSFCell cell2 = row.getCell(2); - String resultString2 = getStringVal(cell2); - if (resultString2 == null || resultString2.trim().equals("")) { - break; - } - - int minCellNum = 1;//读取数据从第1列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - - LibraryRoutineWork lRoutineWork = new LibraryRoutineWork(); - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (null != cell && !"".equals(cell)) { - String resultString = getStringVal(cell); - if (i == 1) {//工作类型 - String[] WorkTypeNameShow = resultString.split("\\("); - List olist1 = this.organizationClassService.selectListByWhere(" where code='" + WorkTypeNameShow[1].substring(0, WorkTypeNameShow[1].length() - 1) + "' "); - if (olist1 != null && olist1.size() > 0) { - lRoutineWork.setWorkTypeName(olist1.get(0).getId()); - - List olist2 = this.organizationClassService.selectListByWhere(" where id='" + olist1.get(0).getPid() + "' "); - if (olist2 != null && olist2.size() > 0) { - lRoutineWork.setPositionType(olist2.get(0).getId()); - } else { - lRoutineWork.setPositionType(""); - } - - } else { - lRoutineWork.setWorkTypeName(""); - } - } else if (i == 2) {//工作编号 - lRoutineWork.setWorkCode(resultString); - } else if (i == 3) {//工作名称 - lRoutineWork.setWorkName(resultString); - } else if (i == 4) {//工作内容 - lRoutineWork.setWorkContent(resultString); - } else if (i == 5) {//评价标准及文件 - lRoutineWork.setEvaluationCriterion(resultString); - } else if (i == 6) {//定额工时 - lRoutineWork.setBaseHours(Float.valueOf(resultString)); - } else if (i == 7) {//定额费用 - lRoutineWork.setBaseCost(Float.valueOf(resultString)); - } else if (i == 8) {//需要人数 - lRoutineWork.setNeedPeople(Integer.valueOf(resultString)); - } else if (i == 9) {//需要技能等级 - lRoutineWork.setSkillLevel(resultString); - } else if (i == 10) {//是否可抢单 - lRoutineWork.setRobWorkorder(resultString); - } - } - } - - lRoutineWork.setType(type); - lRoutineWork.setUnitId(unitId); - - int codeInsert = 0; - int codeUpdate = 0; - lRoutineWork.setWhere("where work_code = '" + lRoutineWork.getWorkCode() + "' and unit_id = '" + unitId + "' and type = '" + type + "' "); - - LibraryRoutineWork libraryRoutineWork = libraryRoutineWorkDao.selectByWhere(lRoutineWork); - if (libraryRoutineWork != null) { - lRoutineWork.setId(libraryRoutineWork.getId()); - codeUpdate = update(lRoutineWork); - } else { - lRoutineWork.setId(CommUtil.getUUID()); - codeInsert = save(lRoutineWork); - } - - if (codeInsert == 1) { - insertNum++; - } - if (codeUpdate == 1) { - updateNum++; - } - } -// } - String result = ""; - System.out.println(insertNum); - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - System.out.println(result); - return result; - } - - @SuppressWarnings("deprecation") - public void outExcelTemplate(HttpServletResponse response, String unitId, String type) throws IOException { - String fileName = "常规工单常规库.xls"; - String title = "常规工单常规库"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,工作类型,工作编号,工作名称,工作内容,评价标准及文件,定额工时,定额费用,需要人数,需要技能等级,是否可抢单(是、否)"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 700); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - // 设置表格每列的宽度 - if (i == 0) { - sheet.setColumnWidth(i, 3000); - } else { - sheet.setColumnWidth(i, 6000); - } - } - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("常规工单常规库"); - - String whereString = " where 1=1 and unit_id='" + unitId + "' and type='" + type + "' order by morder "; - List list = selectListByWhere(whereString); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - HSSFRow rowC = sheet.createRow(i + 2); - - LibraryRoutineWork lRoutineWork = list.get(i); - - HSSFCell cell_0 = rowC.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - - if (lRoutineWork.getWorkTypeName() != null) { - HSSFCell cell_c = rowC.createCell(1);//工作类型名称 - cell_c.setCellStyle(listStyle); - OrganizationClass oClass = this.organizationClassService.selectById(lRoutineWork.getWorkTypeName()); - if (oClass != null) { - cell_c.setCellValue(oClass.getName() + "(" + oClass.getCode() + ")"); - } else { - cell_c.setCellValue(""); - } - - } - - if (lRoutineWork.getWorkCode() != null) { - HSSFCell cell_c = rowC.createCell(2);//工作编号 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(lRoutineWork.getWorkCode()); - } - - if (lRoutineWork.getWorkName() != null) { - HSSFCell cell_c = rowC.createCell(3);//工作名称 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(lRoutineWork.getWorkName()); - } - - if (lRoutineWork.getWorkContent() != null) { - HSSFCell cell_c = rowC.createCell(4);//工作内容 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(lRoutineWork.getWorkContent()); - } - - if (lRoutineWork.getEvaluationCriterion() != null) { - HSSFCell cell_c = rowC.createCell(5);//评价标准及文件 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(lRoutineWork.getEvaluationCriterion()); - } - - HSSFCell cell_c_0 = rowC.createCell(6);//定额工时 - cell_c_0.setCellStyle(listStyle); - cell_c_0.setCellValue(lRoutineWork.getBaseHours()); - - HSSFCell cell_c_1 = rowC.createCell(7);//定额费用 - cell_c_1.setCellStyle(listStyle); - cell_c_1.setCellValue(lRoutineWork.getBaseCost()); - - HSSFCell cell_c_2 = rowC.createCell(8);//需要人数 - cell_c_2.setCellStyle(listStyle); - cell_c_2.setCellValue(lRoutineWork.getNeedPeople()); - - if (lRoutineWork.getSkillLevel() != null) { - HSSFCell cell_c = rowC.createCell(9);//需要技能等级 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(lRoutineWork.getSkillLevel()); - } - - if (lRoutineWork.getRobWorkorder() != null) { - HSSFCell cell_c = rowC.createCell(10);//是否可抢单 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(lRoutineWork.getRobWorkorder()); - } - - } - } - - List olist = this.organizationClassService.selectListByWhere("where type='" + OrganizationClass.Type_1 + "' order by code"); - if (olist != null && olist.size() > 0) { - //设置下拉控制的范围 - @SuppressWarnings("deprecation") - CellRangeAddressList regions = new CellRangeAddressList(2, 9999, 1, 1); - // 生成下拉框内容 - String[] strings = new String[olist.size()]; - for (int s = 0; s < olist.size(); s++) { - strings[s] = olist.get(s).getName() + "(" + olist.get(s).getCode() + ")"; - } - DVConstraint constraint = DVConstraint.createExplicitListConstraint(strings); - // 绑定下拉框和作用区域 - HSSFDataValidation data_validation = new HSSFDataValidation(regions, constraint); - // 对sheet页生效 - sheet.addValidationData(data_validation); - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } -} diff --git a/src/com/sipai/service/process/impl/LibraryWaterTestServiceImpl.java b/src/com/sipai/service/process/impl/LibraryWaterTestServiceImpl.java deleted file mode 100644 index 89fda758..00000000 --- a/src/com/sipai/service/process/impl/LibraryWaterTestServiceImpl.java +++ /dev/null @@ -1,355 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.LibraryWaterTestDao; -import com.sipai.entity.process.LibraryWaterTest; -import com.sipai.entity.process.LibraryWaterTest; -import com.sipai.service.process.LibraryWaterTestService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class LibraryWaterTestServiceImpl implements LibraryWaterTestService { - @Resource - private LibraryWaterTestDao libraryWaterTestDao; - @Resource - private MPointService mPointService; - - @Override - public LibraryWaterTest selectById(String id) { - LibraryWaterTest libraryWaterTest = libraryWaterTestDao.selectByPrimaryKey(id); - if (libraryWaterTest != null) { - libraryWaterTest.setmPoint(this.mPointService.selectById(libraryWaterTest.getUnitId(), libraryWaterTest.getMeasurePointId())); - } - return libraryWaterTest; - } - - @Override - public int deleteById(String id) { - return libraryWaterTestDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LibraryWaterTest entity) { - return libraryWaterTestDao.insert(entity); - } - - @Override - public int update(LibraryWaterTest entity) { - return libraryWaterTestDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LibraryWaterTest entity = new LibraryWaterTest(); - entity.setWhere(wherestr); - List list = libraryWaterTestDao.selectListByWhere(entity); - for (LibraryWaterTest libraryWaterTest : list) { - libraryWaterTest.setmPoint(this.mPointService.selectById(libraryWaterTest.getUnitId(), libraryWaterTest.getMeasurePointId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - LibraryWaterTest entity = new LibraryWaterTest(); - entity.setWhere(wherestr); - return libraryWaterTestDao.deleteByWhere(entity); - } - - @Override - public LibraryWaterTest selectByWhere(String wherestr) { - LibraryWaterTest entity = new LibraryWaterTest(); - entity.setWhere(wherestr); - return libraryWaterTestDao.selectByWhere(entity); - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input, String unitId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; -// for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(0); - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头 - HSSFRow row = sheet.getRow(rowNum); - - int minCellNum = 1;//读取数据从第1列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - - LibraryWaterTest entity = new LibraryWaterTest(); - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - if (null != cell && !"".equals(cell)) { -// System.out.println(getStringVal(cell)); - String resultString = getStringVal(cell); - if (i == 1) {//化验指标名称 - entity.setName(resultString); - } else if (i == 2) {//额定工时(小时) - entity.setBaseHours(Float.valueOf(resultString)); - } else if (i == 3) {//额定费用(元) - entity.setBaseCost(Float.valueOf(resultString)); - } else if (i == 4) {//化验方法 - entity.setMethod(resultString); - } else if (i == 5) {//安全注意事项 - entity.setSafeCareful(resultString); - } - } - } - entity.setId(CommUtil.getUUID()); - entity.setUnitId(unitId); - - int codeInsert = 0; - int codeUpdate = 0; - entity.setWhere("where name = '" + entity.getName() + "' and unit_id = '" + unitId + "'"); - - LibraryWaterTest libraryWaterTest = libraryWaterTestDao.selectByWhere(entity); - if (libraryWaterTest != null) { - entity.setId(libraryWaterTest.getId()); - codeUpdate = update(entity); - } else { - entity.setId(CommUtil.getUUID()); - codeInsert = save(entity); - } - - if (codeInsert == 1) { - insertNum++; - } - if (codeUpdate == 1) { - updateNum++; - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - return result; - } - - @SuppressWarnings("deprecation") - public void outExcelTemplate(HttpServletResponse response, String unitId) throws IOException { - String fileName = "运行工单水质化验库.xls"; - String title = "运行工单水质化验库"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,化验指标名称,额定工时(小时),额定费用(元),化验方法,安全注意事项"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 700); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - // 设置表格每列的宽度 - if (i == 0) { - sheet.setColumnWidth(i, 3000); - } else { - sheet.setColumnWidth(i, 6000); - } - } - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("运行工单水质化验库"); - - String whereString = " where 1=1 and unit_id='" + unitId + "' order by morder "; - List list = selectListByWhere(whereString); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - HSSFRow rowC = sheet.createRow(i + 2); - - LibraryWaterTest libraryWaterTest = list.get(i); - - HSSFCell cell_0 = rowC.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - - if (libraryWaterTest.getName() != null) { - HSSFCell cell_c = rowC.createCell(1);//化验指标名称 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryWaterTest.getName()); - } - - HSSFCell cell_c_0 = rowC.createCell(2);//定额工时 - cell_c_0.setCellStyle(listStyle); - cell_c_0.setCellValue(libraryWaterTest.getBaseHours()); - - HSSFCell cell_c_1 = rowC.createCell(3);//定额费用 - cell_c_1.setCellStyle(listStyle); - cell_c_1.setCellValue(libraryWaterTest.getBaseCost()); - - if (libraryWaterTest.getMethod() != null) { - HSSFCell cell_c = rowC.createCell(4);//化验方法 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryWaterTest.getMethod()); - } - - if (libraryWaterTest.getSafeCareful() != null) { - HSSFCell cell_c = rowC.createCell(5);//安全注意事项 - cell_c.setCellStyle(listStyle); - cell_c.setCellValue(libraryWaterTest.getSafeCareful()); - } - - - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - -} diff --git a/src/com/sipai/service/process/impl/MeterCheckLibraryServiceImpl.java b/src/com/sipai/service/process/impl/MeterCheckLibraryServiceImpl.java deleted file mode 100644 index 0c7e77c3..00000000 --- a/src/com/sipai/service/process/impl/MeterCheckLibraryServiceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.MeterCheckLibraryDao; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.process.MeterCheckLibrary; -import com.sipai.service.process.MeterCheckLibraryService; - -@Service -public class MeterCheckLibraryServiceImpl implements MeterCheckLibraryService { - @Resource - private MeterCheckLibraryDao meterCheckLibraryDao; - - @Override - public MeterCheckLibrary selectById(String id) { - MeterCheckLibrary entity = meterCheckLibraryDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return meterCheckLibraryDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MeterCheckLibrary entity) { - return meterCheckLibraryDao.insert(entity); - } - - @Override - public int update(MeterCheckLibrary entity) { - return meterCheckLibraryDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MeterCheckLibrary entity = new MeterCheckLibrary(); - entity.setWhere(wherestr); - List list = meterCheckLibraryDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - MeterCheckLibrary entity = new MeterCheckLibrary(); - entity.setWhere(wherestr); - return meterCheckLibraryDao.deleteByWhere(entity); - } - - @Override - public int updateByWhere(String wherestr) { - MeterCheckLibrary entity = new MeterCheckLibrary(); - entity.setWhere(wherestr); - return meterCheckLibraryDao.updateByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/MeterCheckServiceImpl.java b/src/com/sipai/service/process/impl/MeterCheckServiceImpl.java deleted file mode 100644 index 93abedc5..00000000 --- a/src/com/sipai/service/process/impl/MeterCheckServiceImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import com.sipai.entity.process.MeterCheckLibrary; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.User; -import com.sipai.service.process.MeterCheckLibraryService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.MeterCheckDao; -import com.sipai.entity.process.MeterCheck; -import com.sipai.service.process.MeterCheckService; - -@Service -public class MeterCheckServiceImpl implements MeterCheckService { - @Resource - private MeterCheckDao meterCheckDao; - @Resource - private MeterCheckLibraryService meterCheckLibraryService; - @Resource - private UserService userService; - @Resource - private PatrolRecordService patrolRecordService; - - - @Override - public MeterCheck selectById(String id) { - MeterCheck entity = meterCheckDao.selectByPrimaryKey(id); - PatrolRecord patrolRecord = this.patrolRecordService.selectById(entity.getXjId()); - if (patrolRecord != null) { - entity.setXjName(patrolRecord.getName()); - } - return entity; - } - - @Override - public int deleteById(String id) { - return meterCheckDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MeterCheck entity) { - return meterCheckDao.insert(entity); - } - - @Override - public int update(MeterCheck entity) { - return meterCheckDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MeterCheck entity = new MeterCheck(); - entity.setWhere(wherestr); - List list = meterCheckDao.selectListByWhere(entity); - if (list != null && list.size() > 0) { - for (MeterCheck meterCheck : - list) { -// MeterCheckLibrary meterCheckLibrary = this.meterCheckLibraryService.selectById(meterCheck.getLibraryId()); -// if (meterCheckLibrary != null) { -// meterCheck.setLibraryName(meterCheckLibrary.getName()); -// meterCheck.set_targetValue(meterCheckLibrary.getTargetvalue()); -// } - User user = this.userService.getUserById(meterCheck.getInputUser()); - if (user != null) { - meterCheck.setInputUserName(user.getCaption()); - } - } - } - return list; - } - - @Override - public List selectListLeftLibraryByWhere(String wherestr) { - MeterCheck entity = new MeterCheck(); - entity.setWhere(wherestr); - List list = meterCheckDao.selectListLeftLibraryByWhere(entity); - if (list != null && list.size() > 0) { - for (MeterCheck meterCheck : - list) { - User user = this.userService.getUserById(meterCheck.getInputUser()); - if (user != null) { - meterCheck.setInputUserName(user.getCaption()); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - MeterCheck entity = new MeterCheck(); - entity.setWhere(wherestr); - return meterCheckDao.deleteByWhere(entity); - } - - @Override - public int updateByWhere(String wherestr) { - MeterCheck entity = new MeterCheck(); - entity.setWhere(wherestr); - return meterCheckDao.updateByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/ProcessAdjustmentContentServiceImpl.java b/src/com/sipai/service/process/impl/ProcessAdjustmentContentServiceImpl.java deleted file mode 100644 index 1a67a2cf..00000000 --- a/src/com/sipai/service/process/impl/ProcessAdjustmentContentServiceImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.ProcessAdjustmentContentDao; -import com.sipai.entity.document.DocFileRelation; -import com.sipai.entity.process.LibraryProcessAbnormal; -import com.sipai.entity.process.LibraryProcessAdjustment; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.ProcessAdjustmentContent; -import com.sipai.entity.user.User; -import com.sipai.service.document.DocFileRelationService; -import com.sipai.service.process.LibraryProcessAbnormalService; -import com.sipai.service.process.LibraryProcessAdjustmentService; -import com.sipai.service.process.ProcessAdjustmentContentService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; - -import java.util.ArrayList; -import java.util.List; - -@Service -public class ProcessAdjustmentContentServiceImpl implements ProcessAdjustmentContentService { - @Resource - private ProcessAdjustmentContentDao entityDao; - @Resource - private LibraryProcessAdjustmentService libraryProcessAdjustmentService; - @Resource - private LibraryProcessAbnormalService libraryProcessAbnormalService; - @Resource - private UserService userService; - @Resource - private DocFileRelationService docFileRelationService; - - @Override - public ProcessAdjustmentContent selectById(String id) { - ProcessAdjustmentContent entity = entityDao.selectByPrimaryKey(id); - if (entity != null) { - LibraryProcessAdjustment libraryProcessAdjustment = libraryProcessAdjustmentService.selectById(entity.getLibraryId()); - entity.setLibraryProcessAdjustment(libraryProcessAdjustment); - } - return entity; - } - - @Override - public int deleteById(String id) { - return entityDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessAdjustmentContent entity) { - return entityDao.insert(entity); - } - - @Override - public int update(ProcessAdjustmentContent entity) { - return entityDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessAdjustmentContent entity = new ProcessAdjustmentContent(); - entity.setWhere(wherestr); - List list = entityDao.selectListByWhere(entity); - for (ProcessAdjustmentContent processAdjustmentContent : list) { - LibraryProcessAdjustment libraryProcessAdjustment = libraryProcessAdjustmentService.selectById(processAdjustmentContent.getLibraryId()); - processAdjustmentContent.setLibraryProcessAdjustment(libraryProcessAdjustment); - -// User user = userService.getUserById(processAdjustmentContent.getReceiveUserId()); -// processAdjustmentContent.setUser(user); - } - return list; - } - - @Override - public List selectListForFileByWhere(String wherestr) { - List fileList = new ArrayList(); - ProcessAdjustmentContent entity = new ProcessAdjustmentContent(); - entity.setWhere(wherestr); - List list = entityDao.selectListByWhere(entity); - //循环工艺调整内容 - for (ProcessAdjustmentContent processAdjustmentContent : list) { - LibraryProcessAdjustment libraryProcessAdjustment = libraryProcessAdjustmentService.selectById(processAdjustmentContent.getLibraryId()); - - - //循环每个内容对应库的资料 - List dlist = this.docFileRelationService.selectListByWhere(" where masterid='" + processAdjustmentContent.getLibraryId() + "' "); - if (dlist != null && dlist.size() > 0) { - for (int i = 0; i < dlist.size(); i++) { - ProcessAdjustmentContent entityContent = new ProcessAdjustmentContent(); - entityContent.setId(processAdjustmentContent.getId()); - entityContent.setLibraryProcessAdjustment(libraryProcessAdjustment); - entityContent.setDocFileRelation(dlist.get(i)); - fileList.add(entityContent); - } - } - } - return fileList; - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessAdjustmentContent entity = new ProcessAdjustmentContent(); - entity.setWhere(wherestr); - return entityDao.deleteByWhere(entity); - } - - @Transactional - public int updateLibrary(String id, String libraryIds) { - ProcessAdjustmentContent processAdjustmentContent = new ProcessAdjustmentContent(); - int res = 0; - if (libraryIds != null && !libraryIds.equals("")) { - String[] libraryId = libraryIds.split(","); - if (libraryId != null) { - for (int i = 0; i < libraryId.length; i++) { - //查询对应工艺调整库 -- 内容 - LibraryProcessAdjustment libraryProcessAdjustment = libraryProcessAdjustmentService.selectById(libraryId[i]); - if(libraryProcessAdjustment!=null){ - ProcessAdjustmentContent entity = new ProcessAdjustmentContent(); - entity.setInsdt(CommUtil.nowDate()); - entity.setLibraryId(libraryId[i]); - entity.setPid(id); - - //查询对应工艺调整库 -- 异常 - LibraryProcessAbnormal libraryProcessAbnormal = libraryProcessAbnormalService.selectById(libraryProcessAdjustment.getPid()); - if(libraryProcessAbnormal!=null){ - entity.setAbnormalCode(libraryProcessAbnormal.getAbnormalCode()); - entity.setAbnormalName(libraryProcessAbnormal.getAbnormalName()); - - processAdjustmentContent.setWhere("where pid = '" + id + "' and library_id = '" + libraryId[i] + "'"); - ProcessAdjustmentContent entity2 = entityDao.selectByWhere(processAdjustmentContent); - if (entity2 != null) { - entity.setId(entity2.getId()); - entity.setProCode(libraryProcessAdjustment.getProCode()); - entity.setProName(libraryProcessAdjustment.getProName()); - entity.setProMeasures(libraryProcessAdjustment.getProMeasures()); - entity.setReceiveRatedTime(libraryProcessAdjustment.getReceiveRatedTime()); - res += entityDao.updateByPrimaryKeySelective(entity); - } else { - entity.setId(CommUtil.getUUID()); - entity.setProCode(libraryProcessAdjustment.getProCode()); - entity.setProName(libraryProcessAdjustment.getProName()); - entity.setProMeasures(libraryProcessAdjustment.getProMeasures()); - entity.setReceiveRatedTime(libraryProcessAdjustment.getReceiveRatedTime()); - res += entityDao.insert(entity); - } - } - - } - } - } - } - //删除没有勾选的内容 - libraryIds = libraryIds.replace(",", "','"); - - processAdjustmentContent.setWhere("where pid = '" + id + "' and library_id not in ('" + libraryIds + "')"); - entityDao.deleteByWhere(processAdjustmentContent); - - return res; - } -} diff --git a/src/com/sipai/service/process/impl/ProcessAdjustmentServiceImpl.java b/src/com/sipai/service/process/impl/ProcessAdjustmentServiceImpl.java deleted file mode 100644 index 3198bebe..00000000 --- a/src/com/sipai/service/process/impl/ProcessAdjustmentServiceImpl.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.ProcessAdjustmentDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.ProcessAdjustmentType; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.process.ProcessAdjustmentService; -import com.sipai.service.process.ProcessAdjustmentTypeService; -import com.sipai.service.sparepart.SubscribeService; -import com.sipai.service.user.UserService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service("processAdjustmentService") -public class ProcessAdjustmentServiceImpl implements ProcessAdjustmentService { - @Resource - private ProcessAdjustmentDao processAdjustmentDao; - @Resource - private CompanyService companyService; - @Resource - private UserService userService; - @Resource - private ProcessAdjustmentTypeService processAdjustmentTypeService; - @Resource - private SubscribeService subscribeService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - - @Override - public ProcessAdjustment selectById(String id) { - ProcessAdjustment processAdjustment = processAdjustmentDao.selectByPrimaryKey(id); - if (processAdjustment != null) { - Company company = companyService.selectByPrimaryKey(processAdjustment.getUnitId()); - processAdjustment.setCompany(company); - User user = userService.getUserById(processAdjustment.getInsuser()); - processAdjustment.setUser(user); - ProcessAdjustmentType processAdjustmentType = processAdjustmentTypeService.selectById(processAdjustment.getTypeId()); - processAdjustment.setProcessAdjustmentType(processAdjustmentType); - - if(processAdjustment.getTargetUserIds()!=null && !processAdjustment.getTargetUserIds().equals("")){ - String auditManName = this.subscribeService.getUserNamesByUserIds(processAdjustment.getTargetUserIds()); - processAdjustment.setTargetUser(auditManName); - } - } - return processAdjustment; - } - - @Override - public int deleteById(String id) { - return processAdjustmentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessAdjustment entity) { - return processAdjustmentDao.insert(entity); - } - - @Override - public int update(ProcessAdjustment entity) { - return processAdjustmentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessAdjustment entity = new ProcessAdjustment(); - entity.setWhere(wherestr); - List list = processAdjustmentDao.selectListByWhere(entity); - for (ProcessAdjustment processAdjustment : list) { - Company company = companyService.selectByPrimaryKey(processAdjustment.getUnitId()); - processAdjustment.setCompany(company); - User user1 = userService.getUserById(processAdjustment.getInsuser()); - processAdjustment.setUser(user1); - ProcessAdjustmentType processAdjustmentType = processAdjustmentTypeService.selectById(processAdjustment.getTypeId()); - processAdjustment.setProcessAdjustmentType(processAdjustmentType); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessAdjustment entity = new ProcessAdjustment(); - entity.setWhere(wherestr); - return processAdjustmentDao.deleteByWhere(entity); - } - - @Override - public int startProcess(ProcessAdjustment entity) { - try { - Map variables = new HashMap(); - if(!entity.getTargetUserIds().isEmpty()){ - variables.put("userIds", entity.getTargetUserIds()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Process_Adjustment.getId()+"-"+entity.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(entity.getId(), entity.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(entity); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecord.sendMessage(entity.getTargetUserIds(),"工艺调整申请"); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public int updateStatus(String id) { - ProcessAdjustment entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task!=null && task.size()>0) { - entity.setStatus(task.get(0).getName()); - }else{ - entity.setStatus(ProcessAdjustment.Status_Finish); - } - int res =this.update(entity); - return res; - } - - -} diff --git a/src/com/sipai/service/process/impl/ProcessAdjustmentTypeServiceImpl.java b/src/com/sipai/service/process/impl/ProcessAdjustmentTypeServiceImpl.java deleted file mode 100644 index 68640779..00000000 --- a/src/com/sipai/service/process/impl/ProcessAdjustmentTypeServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.ProcessAdjustmentTypeDao; -import com.sipai.entity.process.ProcessAdjustmentType; -import com.sipai.service.process.ProcessAdjustmentTypeService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class ProcessAdjustmentTypeServiceImpl implements ProcessAdjustmentTypeService { - @Resource - private ProcessAdjustmentTypeDao processAdjustmentTypeDao; - - @Override - public ProcessAdjustmentType selectById(String id) { - return processAdjustmentTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return processAdjustmentTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessAdjustmentType entity) { - return processAdjustmentTypeDao.insert(entity); - } - - @Override - public int update(ProcessAdjustmentType entity) { - return processAdjustmentTypeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessAdjustmentType entity = new ProcessAdjustmentType(); - entity.setWhere(wherestr); - return processAdjustmentTypeDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessAdjustmentType entity = new ProcessAdjustmentType(); - entity.setWhere(wherestr); - return processAdjustmentTypeDao.deleteByWhere(entity); - } - - @Override - public String getTreeListtest(List list) { - List> list_result = new ArrayList>(); - for (ProcessAdjustmentType entity : list) { - Map map = new HashMap(); - map.put("id", entity.getId().toString()); - map.put("text", entity.getName().toString()); - map.put("pid", "-1"); - map.put("icon", ""); - list_result.add(map); - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/process/impl/RoutineWorkServiceImpl.java b/src/com/sipai/service/process/impl/RoutineWorkServiceImpl.java deleted file mode 100644 index 671da727..00000000 --- a/src/com/sipai/service/process/impl/RoutineWorkServiceImpl.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.RoutineWorkDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.process.LibraryRoutineWork; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.RoutineWork; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.process.LibraryRoutineWorkService; -import com.sipai.service.process.RoutineWorkService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class RoutineWorkServiceImpl implements RoutineWorkService { - @Resource - private RoutineWorkDao routineWorkDao; - @Resource - private UserService userService; - @Resource - private LibraryRoutineWorkService libraryRoutineWorkService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private UnitService unitService; - - @Override - public RoutineWork selectById(String id) { - RoutineWork routineWork = routineWorkDao.selectByPrimaryKey(id); - if (routineWork != null) { - //发送人员 - User userSend = userService.getUserById(routineWork.getSendUserId()); - routineWork.setSendUser(userSend); - //接收人员 - User receiveSend = userService.getUserById(routineWork.getReceiveUserId()); - routineWork.setReceiveUser(receiveSend); - //库 - LibraryRoutineWork libraryRoutineWork = libraryRoutineWorkService.selectById(routineWork.getLibraryId()); - routineWork.setLibraryRoutineWork(libraryRoutineWork); - //接收人员们 - if (routineWork.getReceiveUserIds() != null) { - String[] receiveUserids = routineWork.getReceiveUserIds().split(","); - if (receiveUserids != null && receiveUserids.length > 0) { - String receiveUsersName = ""; - for (int u = 0; u < receiveUserids.length; u++) { - User user = this.userService.getUserById(receiveUserids[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - routineWork.setReceiveUsersName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - } - } - return routineWork; - } - - @Override - public int deleteById(String id) { - return routineWorkDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RoutineWork entity) { - return routineWorkDao.insert(entity); - } - - @Override - public int update(RoutineWork entity) { - return routineWorkDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - RoutineWork entity = new RoutineWork(); - entity.setWhere(wherestr); - List list = routineWorkDao.selectListByWhere(entity); - for (RoutineWork routineWork : list) { -// User userSend = userService.getUserById(routineWork.getSendUserId()); -// routineWork.setSendUser(userSend); - - //接单人 - if (routineWork.getReceiveUserIds() != null) { - String receiveUserIds = routineWork.getReceiveUserIds().replace(",", "','"); - List listUser = userService.selectListByWhere("where id in ('" + receiveUserIds + "')"); - String receiveUsersName = ""; - for (User user : listUser) { - receiveUsersName += user.getCaption() + ","; - } - receiveUsersName = receiveUsersName.substring(0, receiveUsersName.length() - 1); - routineWork.setReceiveUsersName(receiveUsersName); - } - - LibraryRoutineWork libraryRoutineWork = libraryRoutineWorkService.selectSimpleById(routineWork.getLibraryId()); - routineWork.setLibraryRoutineWork(libraryRoutineWork); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RoutineWork entity = new RoutineWork(); - entity.setWhere(wherestr); - return routineWorkDao.deleteByWhere(entity); - } - - @Override - public RoutineWork selectByWhere(String wherestr) { - RoutineWork entity = new RoutineWork(); - entity.setWhere(wherestr); - return routineWorkDao.selectByWhere(entity); - } - - @Override - public int startProcess(RoutineWork entity) { - try { - Map variables = new HashMap(); - if (!entity.getReceiveUserIds().isEmpty()) { - variables.put("userIds", entity.getReceiveUserIds()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Routine_Work.getId() + "-" + entity.getUnitId()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(entity.getId(), entity.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = this.update(entity); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecord.sendMessage(entity.getReceiveUserIds(), ""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public int updateStatus(String id) { - RoutineWork entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { - entity.setStatus(RoutineWork.Status_Finish); - } - int res = this.update(entity); - return res; - } - - public String doCreate(String id,String libraryId, String unitId, String typestr, String insdt) { - RoutineWork routineWork = new RoutineWork(); - routineWork.setId(id); - routineWork.setInsdt(insdt); - routineWork.setInsuser("emp01"); - routineWork.setLibraryId(libraryId); - routineWork.setUnitId(unitId); - routineWork.setType(typestr); - routineWork.setStatus(RoutineWork.Status_NotStart); - Company company = unitService.getCompById(unitId); - if (company != null) { - String jobNumber = company.getEname() + "-ZQCG-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", ""); - routineWork.setJobNumber(jobNumber); - } - int res = 0; - res = save(routineWork); - String result = ""; - if (res == 1) { - result = CommString.Status_Pass; - } else { - result = CommString.Status_Fail; - } - return result; - } - - public int selectCountByWhere(String wherestr) { - RoutineWork routineWork = new RoutineWork(); - routineWork.setWhere(wherestr); - List list = this.routineWorkDao.selectCountByWhere(routineWork); - int listSize = 0; - if (list != null && list.size() > 0) { - listSize = list.get(0).getListSize(); - } - return listSize; - } -} diff --git a/src/com/sipai/service/process/impl/TestIndexManageServiceImpl.java b/src/com/sipai/service/process/impl/TestIndexManageServiceImpl.java deleted file mode 100644 index 1361d380..00000000 --- a/src/com/sipai/service/process/impl/TestIndexManageServiceImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.TestIndexManageDao; -import com.sipai.entity.process.TestIndexManage; -import com.sipai.entity.process.TestMethods; -import com.sipai.service.process.TestIndexManageService; -import com.sipai.service.process.TestMethodsService; -import com.sipai.service.work.CameraService; - -@Service -public class TestIndexManageServiceImpl implements TestIndexManageService { - @Resource - private TestIndexManageDao testIndexManageDao; - @Resource - private TestMethodsService testMethodsService; - - @Override - public TestIndexManage selectById(String id) { - TestIndexManage entity = testIndexManageDao.selectByPrimaryKey(id); - - String method = entity.getMethod(); - String[] methods = method.split(","); - String methodnames = ""; - List list = new ArrayList(); - if (!methods.equals("") && methods.length > 0) { - for (int i = 0; i < methods.length; i++) { - TestMethods testMethods = this.testMethodsService.selectById(methods[i]); - list.add(testMethods); - if (!methodnames.equals("")) { - methodnames += ","; - } - methodnames += testMethods.getName(); - } - } - entity.setTestMethodsList(list); - entity.setMethodname(methodnames); - - return entity; - } - - @Override - public int deleteById(String id) { - return testIndexManageDao.deleteByPrimaryKey(id); - } - - @Override - public int save(TestIndexManage entity) { - return testIndexManageDao.insert(entity); - } - - @Override - public int update(TestIndexManage entity) { - return testIndexManageDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - TestIndexManage entity = new TestIndexManage(); - entity.setWhere(wherestr); - List list = testIndexManageDao.selectListByWhere(entity); - for (TestIndexManage testIndexManage : list) { - String method = testIndexManage.getMethod(); - String[] methods = method.split(","); - String methodnames = ""; - List mlist = new ArrayList(); - if (!methods.equals("") && methods.length > 0) { - for (int i = 0; i < methods.length; i++) { - TestMethods testMethods = this.testMethodsService.selectById(methods[i]); - if (testMethods != null) { - mlist.add(testMethods); - if (!methodnames.equals("")) { - methodnames += ","; - } - methodnames += testMethods.getName(); - } - } - } - testIndexManage.setTestMethodsList(mlist); - testIndexManage.setMethodname(methodnames); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - TestIndexManage entity = new TestIndexManage(); - entity.setWhere(wherestr); - return testIndexManageDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/TestMethodsServiceImpl.java b/src/com/sipai/service/process/impl/TestMethodsServiceImpl.java deleted file mode 100644 index 61b93c18..00000000 --- a/src/com/sipai/service/process/impl/TestMethodsServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.TestMethodsDao; -import com.sipai.entity.process.TestMethods; -import com.sipai.service.process.TestMethodsService; -import com.sipai.service.work.CameraService; -@Service -public class TestMethodsServiceImpl implements TestMethodsService { - @Resource - private TestMethodsDao testMethodsDao; - - @Override - public TestMethods selectById(String id) { - TestMethods entity = testMethodsDao.selectByPrimaryKey(id); - return entity; - } - - @Override - public int deleteById(String id) { - return testMethodsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(TestMethods entity) { - return testMethodsDao.insert(entity); - } - - @Override - public int update(TestMethods entity) { - return testMethodsDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - TestMethods entity = new TestMethods(); - entity.setWhere(wherestr); - List list = testMethodsDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - TestMethods entity = new TestMethods(); - entity.setWhere(wherestr); - return testMethodsDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/TestTaskServiceImpl.java b/src/com/sipai/service/process/impl/TestTaskServiceImpl.java deleted file mode 100644 index 4516c18b..00000000 --- a/src/com/sipai/service/process/impl/TestTaskServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.service.process.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import com.sipai.dao.process.TestTaskDao; -import com.sipai.entity.process.TestIndexManage; -import com.sipai.entity.process.TestMethods; -import com.sipai.entity.process.TestTask; -import com.sipai.service.process.TestIndexManageService; -import com.sipai.service.process.TestTaskService; -import com.sipai.service.user.UserService; -@Service -public class TestTaskServiceImpl implements TestTaskService { - @Resource - private TestTaskDao testTaskDao; - @Resource - private TestIndexManageService testIndexManageService; - @Resource - private UserService userService; - - @Override - public TestTask selectById(String id) { - TestTask entity = testTaskDao.selectByPrimaryKey(id); - TestIndexManage testIndexManage=this.testIndexManageService.selectById(entity.getTestindexmanageid()); - entity.setTestIndexManage(testIndexManage); - return entity; - } - - @Override - public int deleteById(String id) { - return testTaskDao.deleteByPrimaryKey(id); - } - - @Override - public int save(TestTask entity) { - return testTaskDao.insert(entity); - } - - @Override - public int update(TestTask entity) { - return testTaskDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - TestTask entity = new TestTask(); - entity.setWhere(wherestr); - List list = testTaskDao.selectListByWhere(entity); - for (TestTask testTask : list) { - TestIndexManage testIndexManage=this.testIndexManageService.selectById(testTask.getTestindexmanageid()); - testTask.setTestIndexManage(testIndexManage); - testTask.setSendname(this.userService.getUserNamesByUserIds(testTask.getSender())); - testTask.setReceivname(this.userService.getUserNamesByUserIds(testTask.getReceiver())); - testTask.setReviewname(this.userService.getUserNamesByUserIds(testTask.getReviewer())); - } - return list; - } - - @Override - public List selectTop1ListByWhere(String wherestr) { - TestTask entity = new TestTask(); - entity.setWhere(wherestr); - List list = testTaskDao.selectTop1ListByWhere(entity); - for (TestTask testTask : list) { - TestIndexManage testIndexManage=this.testIndexManageService.selectById(testTask.getTestindexmanageid()); - testTask.setTestIndexManage(testIndexManage); - testTask.setSendname(this.userService.getUserNamesByUserIds(testTask.getSender())); - testTask.setReceivname(this.userService.getUserNamesByUserIds(testTask.getReceiver())); - testTask.setReviewname(this.userService.getUserNamesByUserIds(testTask.getReviewer())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - TestTask entity = new TestTask(); - entity.setWhere(wherestr); - return testTaskDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/process/impl/WaterTestDetailServiceImpl.java b/src/com/sipai/service/process/impl/WaterTestDetailServiceImpl.java deleted file mode 100644 index 76e3a429..00000000 --- a/src/com/sipai/service/process/impl/WaterTestDetailServiceImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.sipai.service.process.impl; - -import com.sipai.dao.process.LibraryWaterTestDao; -import com.sipai.dao.process.WaterTestDetailDao; -import com.sipai.entity.document.DocFileRelation; -import com.sipai.entity.process.LibraryWaterTest; -import com.sipai.entity.process.WaterTestDetail; -import com.sipai.entity.user.User; -import com.sipai.service.document.DocFileRelationService; -import com.sipai.service.process.LibraryWaterTestService; -import com.sipai.service.process.WaterTestDetailService; -import com.sipai.service.user.UserService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -import java.util.ArrayList; -import java.util.List; - -@Service -public class WaterTestDetailServiceImpl implements WaterTestDetailService { - @Resource - private WaterTestDetailDao waterTestDetailDao; - @Resource - private LibraryWaterTestService libraryWaterTestService; - @Resource - private UserService userService; - @Resource - private DocFileRelationService docFileRelationService; - - @Override - public WaterTestDetail selectById(String id) { - WaterTestDetail entity = waterTestDetailDao.selectByPrimaryKey(id); - if (entity != null) { - LibraryWaterTest libraryWaterTest = libraryWaterTestService.selectById(entity.getLibraryId()); - entity.setLibraryWaterTest(libraryWaterTest); - //接收人员们 - if(entity.getImplementUserId()!=null){ - String[] receiveUserids = entity.getImplementUserId().split(","); - if (receiveUserids != null && receiveUserids.length > 0) { - String receiveUsersName = ""; - for (int u = 0; u < receiveUserids.length; u++) { - User user = this.userService.getUserById(receiveUserids[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - entity.setImplementUserName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - } - } - return entity; - } - - @Override - public int deleteById(String id) { - return waterTestDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WaterTestDetail entity) { - return waterTestDetailDao.insert(entity); - } - - @Override - public int update(WaterTestDetail entity) { - return waterTestDetailDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WaterTestDetail entity = new WaterTestDetail(); - entity.setWhere(wherestr); - List list = waterTestDetailDao.selectListByWhere(entity); - for (WaterTestDetail waterTestDetail : list) { - LibraryWaterTest libraryWaterTest = libraryWaterTestService.selectById(waterTestDetail.getLibraryId()); - waterTestDetail.setLibraryWaterTest(libraryWaterTest); - - //接收人员们 - if(waterTestDetail.getImplementUserId()!=null){ - String[] receiveUserids = waterTestDetail.getImplementUserId().split(","); - if (receiveUserids != null && receiveUserids.length > 0) { - String receiveUsersName = ""; - for (int u = 0; u < receiveUserids.length; u++) { - User user = this.userService.getUserById(receiveUserids[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - waterTestDetail.setImplementUserName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - } - } - return list; - } - - @Override - public List selectListForFileByWhere(String wherestr) { - List fileList=new ArrayList(); - - WaterTestDetail entity = new WaterTestDetail(); - entity.setWhere(wherestr); - List list = waterTestDetailDao.selectListByWhere(entity); - for (WaterTestDetail waterTestDetail : list) { - LibraryWaterTest libraryWaterTest = libraryWaterTestService.selectById(waterTestDetail.getLibraryId()); - waterTestDetail.setLibraryWaterTest(libraryWaterTest); - - List dlist = this.docFileRelationService.selectListByWhere(" where masterid='"+waterTestDetail.getLibraryId()+"' "); - if(dlist!=null&&dlist.size()>0){ - for(int i=0;i 0) { - String receiveUsersName = ""; - for (int u = 0; u < receiveUserids.length; u++) { - User user = this.userService.getUserById(receiveUserids[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - entity.setReceiveUsersName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - } - } - return entity; - } - - @Override - public int deleteById(String id) { - return waterTestDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WaterTest entity) { - return waterTestDao.insert(entity); - } - - @Override - public int update(WaterTest entity) { - return waterTestDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WaterTest entity = new WaterTest(); - entity.setWhere(wherestr); - List list = waterTestDao.selectListByWhere(entity); - for (WaterTest waterTest : list) { - User sendUser = userService.getUserById(waterTest.getSendUserId()); - waterTest.setSendUser(sendUser); - User receiveUser = userService.getUserById(waterTest.getReceiveUserIds()); - waterTest.setReceiveUser(receiveUser); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WaterTest entity = new WaterTest(); - entity.setWhere(wherestr); - return waterTestDao.deleteByWhere(entity); - } - - @Override - public WaterTest selectByWhere(String wherestr) { - WaterTest entity = new WaterTest(); - entity.setWhere(wherestr); - return waterTestDao.selectByWhere(entity); - } - - @Override - public int startProcess(WaterTest entity) { - try { - Map variables = new HashMap(); - if (!entity.getReceiveUserIds().isEmpty()) { - variables.put("userIds", entity.getReceiveUserIds()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Water_Test.getId() + "-" + entity.getUnitId()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(entity.getId(), entity.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = this.update(entity); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecord.sendMessage(entity.getReceiveUserIds(), ""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Transactional - public int updateStatus(String id) { - WaterTest entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { - entity.setStatus(ProcessAdjustment.Status_Finish); - } - int res = this.update(entity); - return res; - } - - @Transactional - public int updateOther(String id, String actualTime) { - WaterTest entity = this.selectById(id); - int res = 0; - if (entity != null) { - entity.setActualTime(actualTime); - res = this.update(entity); - } - return res; - } -} diff --git a/src/com/sipai/service/question/QuesOptionService.java b/src/com/sipai/service/question/QuesOptionService.java deleted file mode 100644 index a4c23e58..00000000 --- a/src/com/sipai/service/question/QuesOptionService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.question; - -import com.sipai.dao.question.QuesOptionDao; -import com.sipai.entity.question.QuesOption; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class QuesOptionService implements CommService { - @Resource - private QuesOptionDao quesOptionDao; - - @Override - public QuesOption selectById(String id) { - QuesOption quesOption = this.quesOptionDao.selectByPrimaryKey(id); - return quesOption; - } - - @Override - public int deleteById(String id) { - int res = this.quesOptionDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(QuesOption quesOption) { - int res = this.quesOptionDao.insert(quesOption); - return res; - } - - @Override - public int update(QuesOption quesOption) { - int res = this.quesOptionDao.updateByPrimaryKeySelective(quesOption); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - QuesOption quesOption = new QuesOption(); - quesOption.setWhere(wherestr); - List list = this.quesOptionDao.selectListByWhere(quesOption); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - QuesOption quesOption = new QuesOption(); - quesOption.setWhere(wherestr); - int res = this.quesOptionDao.deleteByWhere(quesOption); - return res; - } -} diff --git a/src/com/sipai/service/question/QuesTitleService.java b/src/com/sipai/service/question/QuesTitleService.java deleted file mode 100644 index 7521ad50..00000000 --- a/src/com/sipai/service/question/QuesTitleService.java +++ /dev/null @@ -1,773 +0,0 @@ -package com.sipai.service.question; - -import com.sipai.dao.question.QuesTitleDao; -import com.sipai.entity.question.QuesTitle; -import com.sipai.entity.question.QuestType; -import com.sipai.entity.question.RankType; -import com.sipai.entity.question.Subjecttype; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -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.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@Service -public class QuesTitleService implements CommService { - @Resource - private QuesTitleDao quesTitleDao; - @Resource - private QuesOptionService quesOptionService; - @Resource - private RankTypeService rankTypeService; - @Resource - private QuestTypeService questTypeService; - @Resource - private SubjecttypeService subjecttypeService; - @Resource - private UserService userService; - //定义全局变量,当前登录人的id,调用表格导入方法时赋值 - private String insuserId = ""; - @Override - public QuesTitle selectById(String id) { - QuesTitle quesTitle = this.quesTitleDao.selectByPrimaryKey(id); - return quesTitle; - } - - @Override - public int deleteById(String id) { - int res = this.quesTitleDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(QuesTitle quesTitle) { - int res = this.quesTitleDao.insert(quesTitle); - return res; - } - - @Override - public int update(QuesTitle quesTitle) { - int res = this.quesTitleDao.updateByPrimaryKeySelective(quesTitle); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - QuesTitle quesTitle = new QuesTitle(); - quesTitle.setWhere(wherestr); - List list = this.quesTitleDao.selectListByWhere(quesTitle); - for (QuesTitle item : list) { - Subjecttype subjecttype = subjecttypeService.selectById(item.getSubjecttypeid()); - if(subjecttype!=null){ - item.set_subjectTypeName(subjecttype.getName()); - } - RankType rankType = rankTypeService.selectById(item.getRanktypeid()); - if(rankType!=null){ - item.set_rankTypeName(rankType.getName()); - } - QuestType questType = questTypeService.selectById(item.getQuesttypeid()); - if(questType!=null){ - item.set_questTypeName(questType.getName()); - } - User user = userService.getUserById(item.getInsuser()); - if(user!=null){ - item.set_insusername(user.getName()); - } - } - return list; - } - - public int selectNumByWhere(String wherestr){ - QuesTitle quesTitle = new QuesTitle(); - quesTitle.setWhere(wherestr); - return this.quesTitleDao.selectNumByWhere(quesTitle); - } - - @Override - public int deleteByWhere(String wherestr) { - QuesTitle quesTitle = new QuesTitle(); - quesTitle.setWhere(wherestr); - int res = this.quesTitleDao.deleteByWhere(quesTitle); - return res; - } - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if(cell==null){ - return null; - } - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - if ("0".equals(cell.getCellType().toString())) { - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(CellType.STRING); - return cell.getStringCellValue(); - } - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if(cell==null){ - return null; - } - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - if ("0".equals(cell.getCellType().toString())) { - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(CellType.STRING); - return cell.getStringCellValue(); - } - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /**针对传输进去的内容,进行内容的导出,将只导出《》内的内容 - * @param invalue - * @return - */ - private static String returnvalue(String invalue){ - String res=""; - Pattern pattern = Pattern.compile("((.*?))"); //中文括号 - Matcher matcher = pattern.matcher(invalue); - while(matcher.find()){ - res=matcher.group(1).toString().trim(); //0是包括括号1是只取内容 - } - return res; - } - - /** - * 新增tb_question_QuesTitle表 - * - * @param id - * @param userid - * @param yiji - * @param erji - * @param sanji - * @param nandu - * @param tixing - * @param nowdate - * @param timu - * @param kaohe - * @param jiexi - * @return - */ - private String insertq(String id, String userid, String yiji,String erji ,String sanji, String nandu,String tixing, - String nowdate,String timu,String kaohe,String jiexi) { - String res = "ok"; - /* - * 先针对题目科目、题目类型找到此题目的上级id - */ - - String subjecttypeid = ""; - String ranktypeid = ""; - String questtypeid = ""; - int ordernumber = 1; - - /* - * 找到工作领域 - */ - if(sanji==null||sanji.trim().length()==0){ - List stlist = subjecttypeService.selectListByWhere(" where name like '%"+erji.trim()+"%' "); - if(stlist!=null && stlist.size()>0){ //如果能找到记录 - for (int i = 0; i < stlist.size(); i++) { - Subjecttype firstSubjecttype = subjecttypeService.selectById(stlist.get(i).getPid()); - if (firstSubjecttype!=null&&yiji.equals(firstSubjecttype.getName())) { - subjecttypeid = stlist.get(i).getId(); - } - } - } - }else { - List stlist = subjecttypeService.selectListByWhere(" where name like '%"+sanji.trim()+"%' "); - if(stlist!=null && stlist.size()>0){ //如果能找到记录 - for (int i = 0; i < stlist.size(); i++) { - Subjecttype secondSubjecttype = subjecttypeService.selectById(stlist.get(i).getPid()); - if (secondSubjecttype!=null&&erji.equals(secondSubjecttype.getName())) { - Subjecttype firstSubjecttype = subjecttypeService.selectById(secondSubjecttype.getPid()); - if (firstSubjecttype!=null&&yiji.equals(firstSubjecttype.getName())) { - subjecttypeid = stlist.get(i).getId(); - } - } - } - } - } - /* - * 找到难度 - */ - List qtlist = rankTypeService.selectListByWhere(" where name like '%"+nandu.trim().substring(1)+"%' "); - if(qtlist!=null && qtlist.size()==1){ //如果能找到记录 - ranktypeid = qtlist.get(0).getId(); - } - /* - * 找到题型 - */ - List qtslist = questTypeService.selectListByWhere(" where name like '%"+tixing.trim().substring(1)+"%' "); - if(qtslist!=null && qtslist.size()==1){ //如果能找到记录 - questtypeid = qtslist.get(0).getId(); - } - - - if (ranktypeid != null && questtypeid!=null && subjecttypeid!=null&&ranktypeid.length()>0&&subjecttypeid.length()>0&&questtypeid.length()>0) { // 如果都正常,并获得了二级列表id - // 针对二级列表id,获得该列表的最后顺序号+1 - ordernumber = this.selectlastq(subjecttypeid,questtypeid,ranktypeid); - /* - * 以下开始新增 - */ - Subjecttype subjecttype = this.subjecttypeService.selectById(subjecttypeid); - - String quescode=""; - if(ordernumber<10){ - quescode = subjecttype.getCode()+nandu.trim().substring(0,1)+tixing.trim().substring(0,1)+"0"+ordernumber; - }else { - quescode = "0"+subjecttype.getCode()+nandu.trim().substring(0,1)+tixing.trim().substring(0,1)+ordernumber; - } - - QuesTitle q = new QuesTitle(); - q.setId(id); - q.setQuesdescript(timu); - q.setStatus("启用"); - q.setOrd(ordernumber); - q.setCode(quescode); - q.setSubjecttypeid(subjecttypeid); - q.setQuesttypeid(questtypeid); - q.setRanktypeid(ranktypeid); - q.setInsuser(userid); - q.setInsdt(nowdate); - q.setTestpoint(kaohe); - q.setAnalysis(jiexi); - - - int rescode = save(q); - if (rescode == 1) { // 如果成功 - res = "ok"; - } else { - res = "error";// 如果有问题,则退回 - } - - } else { - res = "error";// 如果有问题,则退回 - } - - return res; - } - - public int selectlastq(String subjecttypeid, String questtypeid,String ranktypeid) { - int ordernumber = 1; - List qlist = selectListByWhere(" where " - + "subjecttypeid='"+subjecttypeid.trim()+"' " - + "and questtypeid = '"+questtypeid.trim()+"' " - + "and ranktypeid='"+ ranktypeid.trim() - + "' order by ord desc "); - if (qlist != null && qlist.size() >= 1) { - ordernumber = qlist.get(0).getOrd() + 1; - } - return ordernumber; - } - public String insertqoForTianshan(String quesTitleid,String daan,String xuanxiang,String userid,String nowdate,String tixing){ - String res="ok"; - - if(tixing.trim().substring(1).equals("判断题")){ //如果是判断题 - String tr="2"; - if(daan.trim().equals("正确")){ //如果为正确 - tr="1"; - } - /* - * 增加正确错误大答案并保存 - */ - - for(int i=1;i<=2;i++){ //从1遍历到2,出现两组数据 - com.sipai.entity.question.QuesOption q = new com.sipai.entity.question.QuesOption(); - q.setId(CommUtil.getUUID()); - q.setQuestitleid(quesTitleid); - q.setStatus("启用"); - q.setInsdt(nowdate); - q.setInsuser(userid); - //判断是否正确 - if(i==1){ //如果第一次循环 - if(tr.trim().equals("1")){ //如果第一个答案正确 - q.setOptionvalue("T"); //为第一行是正确的 - q.setOptioncontent("正确"); - q.setOptionnumber("A"); - q.setOrd(1); - }else{ //如果是第二个答案正确 - q.setOptionvalue("F"); //为第一行是错误的 - q.setOptioncontent("正确"); - q.setOptionnumber("A"); - q.setOrd(1); - } - } - if(i==2){ //如果第二次循环 - if(tr.trim().equals("1")){ //如果第一个答案正确 - q.setOptionvalue("F"); //为第二行是错误的 - q.setOptioncontent("错误"); - q.setOptionnumber("B"); - q.setOrd(2); - }else{ //如果是第二个答案正确 - q.setOptionvalue("T"); //为第二行是正确的 - q.setOptioncontent("错误"); - q.setOptionnumber("B"); - q.setOrd(2); - } - } - int save = this.quesOptionService.save(q); - if(save!=1){ - res="error"; - return res; - } - } - }else if(tixing.trim().substring(1).equals("单选题")){ //如果是单项选择题或者多项选择题,则继续 - if(xuanxiang!=null && !xuanxiang.trim().equals("")){ //必须有选项区 -// String reg1="[a-zA-Z]( |、)"; -// String reg1="[a-zA-Z]、"; -// Pattern p1=Pattern.compile(reg1); -// Matcher m1=p1.matcher(daan); -// if(m1.find()){ -// res="error"; -// return res; -// } - String reg="[a-zA-Z]"; - Pattern p=Pattern.compile(reg); - Matcher m=p.matcher(daan); - ArrayList tr = new ArrayList<>(); - while (m.find()) { - tr.add(m.group()); - } - if (tr.size()!=1) { - res="error"; - return res; - } - /* - * 以下为把答案分割成各个正确的数组放入对象中 - */ - String[] nowvalue=xuanxiang.split("("); - if(nowvalue.length>=2){ //必须有超过2个 - String quesoptionfirst="";//为单题答案 - - for(int i=1;i tr = new ArrayList<>(); - while (m.find()) { - tr.add(m.group()); - } - if (tr.size()<1) { - res="error"; - return res; - } - /* - * 以下为把答案分割成各个正确的数组放入对象中 - */ - String[] nowvalue=xuanxiang.split("("); - if(nowvalue.length>=2){ //必须有超过2个 - String quesoptionfirst="";//为单题答案 - for(int i=1;i=0){ //如果能找到正确答案,则为tr - q.setOptionvalue("T"); - }else{//如果没找到正确答案,则为fai,错误 - q.setOptionvalue("F"); - } - int save = this.quesOptionService.save(q); - if(save!=1){ - res="error"; - return res; - } - } - - }else{ - res="error"; - } - }else{ //如果没答案,则报错 - res="error"; - } - }else if (tixing.trim().substring(1).equals("填空题")) { - if(daan!=null && !daan.trim().equals("")){ - String[] daansplit = daan.split(";|;"); - for (int i = 0; i < daansplit.length; i++) { - com.sipai.entity.question.QuesOption q = new com.sipai.entity.question.QuesOption(); - q.setId(CommUtil.getUUID()); - q.setOptioncontent(daansplit[i]); - q.setStatus("启用"); - q.setOrd(i); - q.setQuestitleid(quesTitleid); - q.setOptionvalue("T"); - q.setInsdt(nowdate); - q.setInsuser(userid); - int save = this.quesOptionService.save(q); - if(save!=1){ - res="error"; - return res; - } - } - }else { - res="error"; - } - } - return res; - } - - /** - * xlsx文件导入 - * @param input - * @return - * @throws IOException - */ - public String readXlsx(InputStream input,String userId) throws IOException { - String res = ""; - insuserId = userId; - XSSFWorkbook workbook = new XSSFWorkbook(input); - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - String sheetName = sheet.getSheetName(); - System.out.println(sheetName); - res+=sheetName+":"; - XSSFRow rowTitle = sheet.getRow(0); - //如果表头小于11列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 11) { - continue; - } - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前一行为表头部门,读取数据从1行开始,没有序号的不导入 - XSSFRow row = sheet.getRow(rowNum); - - if (null == row || null == row.getCell(0)||getStringVal(row.getCell(0))==null||getStringVal(row.getCell(0)).trim().length()==0) { - continue;// 如果没有顺序号,则中断 - } - String id = CommUtil.getUUID(); - String xh = getStringVal(row.getCell(0));// 为序号 - String yiji = getStringVal(row.getCell(1));// 为一级类型 - if(yiji==null||yiji.length()==0){ - res += xh.trim() + ","; - continue; - } - String erji = getStringVal(row.getCell(2));// 为二级类型 - String sanji = getStringVal(row.getCell(3));// 为三级类型 - String nandu = getStringVal(row.getCell(4));// 为难度 - String tixing = getStringVal(row.getCell(5));// 为题型 - String timu = getStringVal(row.getCell(6));// 为题目区 - String xuanxiang = getStringVal(row.getCell(7));// 为选项区 - String daan = getStringVal(row.getCell(8));// 为答案区 - String kaohe = getStringVal(row.getCell(9));// 为考核点 - String jiexi = getStringVal(row.getCell(10));// 为试题解析 - // 对题库科目判断 - if (nandu != null && nandu.trim().length() > 0) { // 如果有题库科目 - if (!(nandu.trim()).substring(1).equals("初级") - && !(nandu.trim()).substring(1).equals("中级") - && !(nandu.trim()).substring(1).equals("高级")) {// 如果不是初级,中级,高级,则跳过本行 - - res += xh.trim() + ","; - continue; - } - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - // 对题库类型判断 - if (tixing != null && tixing.trim().length() > 0) { // 如果有题库类型 - if (!(tixing.trim()).substring(1).equals("判断题") - && !(tixing.trim()).substring(1).equals("单选题") - && !(tixing.trim()).substring(1).equals("多选题") - && !(tixing.trim()).substring(1).equals("填空题")) { - res += xh.trim() + ","; - continue; - } - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - // 对题目区判断 - if (timu != null && timu.trim().length() > 0) { // 如果有题目区 - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - // 如果不是判断题且没有选项区,则也跳过 - if (xuanxiang != null && xuanxiang.trim().length() > 0) { // 如果有答案区,则不管是否判断题,都继续,判断题则不调用答案区内容 - } else {// 跳过本次循环 - if ((tixing.trim()).substring(1).equals("判断题")||(tixing.trim()).substring(1).equals("填空题")) { // 如果没有答案区,却是判断题,也正确,跳过 - - } else {// 既不是判断题填空题,却又没答案,也跳过 - res += xh.trim() + ","; - continue; - } - } - // 对答案区判断 - if (daan != null && daan.trim().length() > 0) { // 如果有答案区 - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - /* - * 以下为新增考试题目主表,tb_question_QuesTitle - */ - String userid = userId; - if(sanji==null||sanji.trim().length()==0){ - sanji=erji; - } - String res1 = ""; - res1 = this.insertq(id, userid, yiji,erji,sanji,nandu,tixing,CommUtil.nowDate(),timu,kaohe,jiexi); - if (res1.trim().equals("error")) { // 如果错误,则进行本行记录 - // 删除记录 - this.deleteById(id); - res += xh.trim() + ","; - continue; - } else { - - res1 = insertqoForTianshan(id, daan, xuanxiang, - userid, - CommUtil.nowDate(), - tixing); - - if (res1.trim().equals("error")) { // 如果错误,则进行本行记录 - // 删除记录 - this.quesOptionService.deleteByWhere(" where questitleid = '"+id+"' "); - res += xh.trim() + ","; - } - } - } - } - input.close(); - if (res.trim().equals("")) { // 如果为没有任何报错,则上传成功 - return "上传成功"; - } else {// 提示所有的报错行的信息 - return "顺序号:" + res + "上传失败,请核查原因或手动上传!"; - } - } - - /** - * xls表格导入 - * @param input - * @return - * @throws IOException - */ - public String readXls(InputStream input,String userId) throws IOException { - String res = ""; - insuserId = userId; - HSSFWorkbook workbook = new HSSFWorkbook(input); - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - String sheetName = sheet.getSheetName(); - System.out.println(sheetName); - res+=sheetName+":"; - HSSFRow rowTitle = sheet.getRow(0); - //如果表头小于11列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 11) { - continue; - } - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前一行为表头部门,读取数据从1行开始,没有序号的不导入 - HSSFRow row = sheet.getRow(rowNum); - - if (null == row || null == row.getCell(0)||getStringVal(row.getCell(0))==null||getStringVal(row.getCell(0)).trim().length()==0) { - continue;// 如果没有顺序号,则中断 - } - String id = CommUtil.getUUID(); - String xh = getStringVal(row.getCell(0));// 为序号 - String yiji = getStringVal(row.getCell(1));// 为一级类型 - if(yiji==null||yiji.length()==0){ - res += xh.trim() + ","; - continue; - } - String erji = getStringVal(row.getCell(2));// 为二级类型 - String sanji = getStringVal(row.getCell(3));// 为三级类型 - String nandu = getStringVal(row.getCell(4));// 为难度 - String tixing = getStringVal(row.getCell(5));// 为题型 - String timu = getStringVal(row.getCell(6));// 为题目区 - String xuanxiang = getStringVal(row.getCell(7));// 为选项区 - String daan = getStringVal(row.getCell(8));// 为答案区 - String kaohe = getStringVal(row.getCell(9));// 为考核点 - String jiexi = getStringVal(row.getCell(10));// 为试题解析 - // 对题库科目判断 - if (nandu != null && nandu.trim().length() > 0) { // 如果有题库科目 - if (!(nandu.trim()).substring(1).equals("初级") - && !(nandu.trim()).substring(1).equals("中级") - && !(nandu.trim()).substring(1).equals("高级")) {// 如果不是初级,中级,高级,则跳过本行 - - res += xh.trim() + ","; - continue; - } - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - // 对题库类型判断 - if (tixing != null && tixing.trim().length() > 0) { // 如果有题库类型 - if (!(tixing.trim()).substring(1).equals("判断题") - && !(tixing.trim()).substring(1).equals("单选题") - && !(tixing.trim()).substring(1).equals("多选题") - && !(tixing.trim()).substring(1).equals("填空题")) { - res += xh.trim() + ","; - continue; - } - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - // 对题目区判断 - if (timu != null && timu.trim().length() > 0) { // 如果有题目区 - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - // 如果不是判断题且没有选项区,则也跳过 - if (xuanxiang != null && xuanxiang.trim().length() > 0) { // 如果有答案区,则不管是否判断题,都继续,判断题则不调用答案区内容 - } else {// 跳过本次循环 - if ((tixing.trim()).substring(1).equals("判断题")||(tixing.trim()).substring(1).equals("填空题")) { // 如果没有答案区,却是判断题,也正确,跳过 - - } else {// 既不是判断题填空题,却又没答案,也跳过 - res += xh.trim() + ","; - continue; - } - } - // 对答案区判断 - if (daan != null && daan.trim().length() > 0) { // 如果有答案区 - } else {// 跳过本次循环 - res += xh.trim() + ","; - continue; - } - /* - * 以下为新增考试题目主表,tb_question_QuesTitle - */ - String userid = userId; -// if(sanji==null||sanji.trim().length()==0){ -// sanji=erji; -// } - String res1 = ""; - res1 = this.insertq(id, userid, yiji,erji,sanji,nandu,tixing,CommUtil.nowDate(),timu,kaohe,jiexi); - if (res1.trim().equals("error")) { // 如果错误,则进行本行记录 - // 删除记录 - this.deleteById(id); - res += xh.trim() + ","; - continue; - } else { - - res1 = insertqoForTianshan(id, daan, xuanxiang, - userid, - CommUtil.nowDate(), - tixing); - - if (res1.trim().equals("error")) { // 如果错误,则进行本行记录 - // 删除记录 - this.quesOptionService.deleteByWhere(" where questitleid = '"+id+"' "); - res += xh.trim() + ","; - } - } - } - } - input.close(); - if (res.trim().equals("")) { // 如果为没有任何报错,则上传成功 - return "上传成功"; - } else {// 提示所有的报错行的信息 - return "顺序号:" + res + "上传失败,请核查原因或手动上传!"; - } - } - -} diff --git a/src/com/sipai/service/question/QuestTypeService.java b/src/com/sipai/service/question/QuestTypeService.java deleted file mode 100644 index b3b5644a..00000000 --- a/src/com/sipai/service/question/QuestTypeService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.question; - -import com.sipai.dao.question.QuestTypeDao; -import com.sipai.entity.question.QuestType; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class QuestTypeService implements CommService { - @Resource - private QuestTypeDao questTypeDao; - - @Override - public QuestType selectById(String id) { - QuestType questType = this.questTypeDao.selectByPrimaryKey(id); - return questType; - } - - @Override - public int deleteById(String id) { - int res = this.questTypeDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(QuestType questType) { - int res = this.questTypeDao.insert(questType); - return res; - } - - @Override - public int update(QuestType questType) { - int res = this.questTypeDao.updateByPrimaryKeySelective(questType); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - QuestType questType = new QuestType(); - questType.setWhere(wherestr); - List list = this.questTypeDao.selectListByWhere(questType); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - QuestType questType = new QuestType(); - questType.setWhere(wherestr); - int res = this.questTypeDao.deleteByWhere(questType); - return res; - } -} diff --git a/src/com/sipai/service/question/RankTypeService.java b/src/com/sipai/service/question/RankTypeService.java deleted file mode 100644 index 52200b96..00000000 --- a/src/com/sipai/service/question/RankTypeService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.question; - -import com.sipai.dao.question.RankTypeDao; -import com.sipai.entity.question.RankType; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class RankTypeService implements CommService { - @Resource - private RankTypeDao rankTypeDao; - @Resource - private UserService userService; - @Override - public RankType selectById(String id) { - RankType rankType = this.rankTypeDao.selectByPrimaryKey(id); - return rankType; - } - - @Override - public int deleteById(String id) { - int res = this.rankTypeDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(RankType rankType) { - int res = this.rankTypeDao.insert(rankType); - return res; - } - - @Override - public int update(RankType rankType) { - int res = this.rankTypeDao.updateByPrimaryKeySelective(rankType); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - RankType rankType = new RankType(); - rankType.setWhere(wherestr); - List list = this.rankTypeDao.selectListByWhere(rankType); - for (RankType item : list) { - if(item.getInsertuserid()!=null){ - item.set_insertusername(userService.getUserById(item.getInsertuserid()).getName()); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RankType rankType = new RankType(); - rankType.setWhere(wherestr); - int res = this.rankTypeDao.deleteByWhere(rankType); - return res; - } - -} diff --git a/src/com/sipai/service/question/SubjecttypeService.java b/src/com/sipai/service/question/SubjecttypeService.java deleted file mode 100644 index 0292d8bd..00000000 --- a/src/com/sipai/service/question/SubjecttypeService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.question; - -import com.sipai.entity.question.Subjecttype; - -import java.util.List; -import java.util.Map; - -public interface SubjecttypeService { - - public Subjecttype selectById(String t); - - public int deleteById(String t); - - public int save(Subjecttype t); - - public int update(Subjecttype t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - - /** - * 获取bootstrap-treeview 所需json数据*/ - public String getTreeList(List> list_result,List list); - - //获取底层节点 - public List selectListOnlyLast(String t); - -} diff --git a/src/com/sipai/service/question/SubjecttypeServiceImpl.java b/src/com/sipai/service/question/SubjecttypeServiceImpl.java deleted file mode 100644 index 0dddd522..00000000 --- a/src/com/sipai/service/question/SubjecttypeServiceImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.service.question; - -import com.sipai.dao.question.SubjecttypeDao; -import com.sipai.entity.question.Subjecttype; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -@Service("SubjecttypeService") -public class SubjecttypeServiceImpl implements SubjecttypeService{ - @Resource - private SubjecttypeDao subjecttypeDao; - - @Override - public Subjecttype selectById(String t) { - return subjecttypeDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return subjecttypeDao.deleteByPrimaryKey(t); - } - - @Override - public int save(Subjecttype t) { - return subjecttypeDao.insertSelective(t); - } - - @Override - public int update(Subjecttype t) { - return subjecttypeDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - Subjecttype subjecttype = new Subjecttype(); - subjecttype.setWhere(t); - return subjecttypeDao.selectListByWhere(subjecttype); - } - - @Override - public int deleteByWhere(String t) { - Subjecttype subjecttype = new Subjecttype(); - subjecttype.setWhere(t); - return subjecttypeDao.deleteByWhere(subjecttype); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(Subjecttype k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Subjecttype k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); -// List tags = new ArrayList(); -// tags.add(k.getDescription()); -// m.put("tags", tags); - childlist.add(m); - } - } - if(childlist.size()>0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - - @Override - public List selectListOnlyLast(String t) { - Subjecttype subjecttype = new Subjecttype(); - subjecttype.setWhere(t); - return subjecttypeDao.selectListOnlyLast(subjecttype); - } - -} diff --git a/src/com/sipai/service/report/BaseService.java b/src/com/sipai/service/report/BaseService.java deleted file mode 100644 index b510b2c8..00000000 --- a/src/com/sipai/service/report/BaseService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; -/** - * 自定义泛型接口,用于通用自定义查询 - * @author 12235 - * - * @param 接口返回的list对应的类 如List List - * @param 接口的入参类型 如String Integer - */ -public interface BaseService { - public List selectList(R arg1,O arg2); -} diff --git a/src/com/sipai/service/report/CustomReportMPointService.java b/src/com/sipai/service/report/CustomReportMPointService.java deleted file mode 100644 index aee0b47c..00000000 --- a/src/com/sipai/service/report/CustomReportMPointService.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.service.report; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.base.Result; -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardPropDao; -import com.sipai.dao.report.CustomReportMPointDao; -import com.sipai.entity.report.CustomReportMPoint; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; - -@Service -public class CustomReportMPointService implements CommService{ - @Resource - private CustomReportMPointDao customReportMPointDao; - @Resource - private EquipmentCardPropDao equipmentCardPropDao; - @Resource - private MPointService mPointService; - - @Override - public CustomReportMPoint selectById(String id) { - return customReportMPointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return customReportMPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CustomReportMPoint entity) { - CustomReportMPoint customReportMPoint = new CustomReportMPoint(); - customReportMPoint.setWhere("where pid = '" + entity.getPid() + "' and mpoint_id = '" + entity.getMpointId() + "'"); - List customReportMPoints = customReportMPointDao.selectListByWhere(customReportMPoint); - if (customReportMPoints != null && customReportMPoints.size() > 0) { - return Result.REPEATED; - } - return customReportMPointDao.insert(entity); - } - - @Override - public int update(CustomReportMPoint entity) { - return customReportMPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - CustomReportMPoint customReportMPoint = new CustomReportMPoint(); - customReportMPoint.setWhere(wherestr); - List ps=customReportMPointDao.selectListByWhere(customReportMPoint); - for (CustomReportMPoint item : ps) { - MPoint mPoint = mPointService.selectById(item.getUnitId(),item.getMpointId()); - item.setmPoint(mPoint); - } - return ps; - } - - @Override - public int deleteByWhere(String wherestr) { - CustomReportMPoint group = new CustomReportMPoint(); - group.setWhere(wherestr); - return customReportMPointDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/report/CustomReportService.java b/src/com/sipai/service/report/CustomReportService.java deleted file mode 100644 index 913f4646..00000000 --- a/src/com/sipai/service/report/CustomReportService.java +++ /dev/null @@ -1,307 +0,0 @@ -package com.sipai.service.report; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; - -import net.sf.json.JSONObject; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; - -import com.sipai.dao.equipment.EquipmentCardPropDao; -import com.sipai.dao.report.CustomReportDao; -import com.sipai.entity.report.CustomReport; -import com.sipai.tools.CommService; - -@Service("customReportService") -public class CustomReportService implements CommService { - @Resource - private CustomReportDao customReportDao; - - @Override - public CustomReport selectById(String id) { - return customReportDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return customReportDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CustomReport entity) { - return customReportDao.insert(entity); - } - - @Override - public int update(CustomReport entity) { - return customReportDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - CustomReport group = new CustomReport(); - group.setWhere(wherestr); - return customReportDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - CustomReport group = new CustomReport(); - group.setWhere(wherestr); - return customReportDao.deleteByWhere(group); - } - - public List> getSpCustomReportData(String sdt, String edt, String calculation, String frequencyType, String frequency, String mpids, String EPName, String chooseDataWhere) { - return customReportDao.getSpCustomReportData(sdt, edt, calculation, frequencyType, frequency, mpids, EPName, chooseDataWhere); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (CustomReport k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - map.put("frequencytype", k.getFrequencytype()); - map.put("frequency", k.getFrequency()); - map.put("calculation", k.getCalculation()); -// if(k.getType().equals(CustomReport.Type_group)){ -// map.put("icon", CustomReport.DATA_CURVE_GROUP_ICON); -// //map.put("color", "#357ca5"); -// }else if(k.getType().equals(CustomReport.Type_curve)){ -// map.put("icon", CustomReport.DATA_CURVE_ICON); -// map.put("color", "#39cccc"); -// }else if(k.getType().equals(CustomReport.Type_curve_mpoint)){ -// map.put("icon", CustomReport.DATA_CURVE_MPOINT_ICON); -// map.put("color", "#39cccc"); -// } - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (CustomReport k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - m.put("frequencytype", k.getFrequencytype()); - m.put("frequency", k.getFrequency()); - m.put("calculation", k.getCalculation()); -// if(k.getType().equals(CustomReport.Type_group)){ -// m.put("icon", CustomReport.DATA_CURVE_GROUP_ICON); -// //m.put("color", "#357ca5"); -// }else if(k.getType().equals(CustomReport.Type_curve)){ -// m.put("icon", CustomReport.DATA_CURVE_ICON); -// m.put("color", "#39cccc"); -// }else if(k.getType().equals(CustomReport.Type_curve_mpoint)){ -// m.put("icon", CustomReport.DATA_CURVE_MPOINT_ICON); -// m.put("color", "#39cccc"); -// } -// List tags = new ArrayList(); -// tags.add(k.getRemark()); -// m.put("tags", tags); - childlist.add(m); - } - } - if (childlist.size() > 0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist, list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - - public void downloadExcel(HttpServletResponse response, JSONObject jsonObject) throws IOException { - String fileName = "测量点记录表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "测量点记录表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 7000); - sheet.setColumnWidth(3, 7000); - sheet.setColumnWidth(4, 7000); - sheet.setColumnWidth(5, 7000); - sheet.setColumnWidth(6, 7000); - sheet.setColumnWidth(7, 7000); - sheet.setColumnWidth(8, 7000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "序号,日期," + jsonObject.get("names"); -// for(int i = 0; i < jsonarr.size(); i++){ -// JSONObject jsonObject = jsonarr.getJSONObject(i); -// if (null != jsonObject.get("measurepointname").toString()) { -// excelTitleStr+=jsonObject.get("measurepointname").toString()+","; -// } -// } - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("测量点记录表"); - - //遍历集合数据,产生数据行 -// for(int i = 0; i < jsonarr.size(); i++){ - int rownum = 0; - //填充列数据,如果数据有不同的格式请注意匹配转换 - JSONArray jsonD = new JSONArray(); - jsonD = (JSONArray) jsonObject.get("parmList"); - for (int j = 0; j < excelTitle.length; j++) { - if (j > 1) { -// JSONObject jsonObject = jsonarr.getJSONObject(j-2); - if (jsonD != null) { - if (j == 2) { - rownum = jsonD.size(); - } - for (int m = 0; m < jsonD.size(); m++) { - JSONObject jsonObjectd = jsonD.getJSONObject(m); - if ((j - 2) == 0) { - row = sheet.createRow(m + 3);//行 - row.setHeight((short) 600); - - HSSFCell cell_d1 = row.createCell(j - 2); - cell_d1.setCellStyle(listStyle); - cell_d1.setCellValue(m + 1); - - HSSFCell cell_d2 = row.createCell(j - 1); - cell_d2.setCellStyle(listStyle); - cell_d2.setCellValue(jsonObjectd.get("measuredt").toString()); - - for (int n = 0; n < (excelTitle.length - 2); n++) { - HSSFCell cell_d = row.createCell(j+n); - cell_d.setCellStyle(listStyle); - cell_d.setCellValue(jsonObjectd.get("paramvalue" + n).toString()); - } - - } - - } - } - } - } -// } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - -} diff --git a/src/com/sipai/service/report/DrainageDataomprehensiveTableConfigureService.java b/src/com/sipai/service/report/DrainageDataomprehensiveTableConfigureService.java deleted file mode 100644 index bb6ed44d..00000000 --- a/src/com/sipai/service/report/DrainageDataomprehensiveTableConfigureService.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.service.report; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.DrainageDataomprehensiveTableConfigureDao; -import com.sipai.dao.timeefficiency.PatrolAreaDao; -import com.sipai.entity.report.DrainageDataomprehensiveTableConfigure; -import com.sipai.tools.CommService; - -@Service -public class DrainageDataomprehensiveTableConfigureService implements CommService{ - @Resource - private DrainageDataomprehensiveTableConfigureDao drainageDataomprehensiveTableConfigureDao; - @Resource - private PatrolAreaDao patrolAreaDao; - - - public List selectList() { - // TODO Auto-generated method stub - DrainageDataomprehensiveTableConfigure DrainageDataomprehensiveTableConfigure = new DrainageDataomprehensiveTableConfigure(); - return this.drainageDataomprehensiveTableConfigureDao.selectList(DrainageDataomprehensiveTableConfigure); - } - - - @Override - public DrainageDataomprehensiveTableConfigure selectById(String id) { - return this.drainageDataomprehensiveTableConfigureDao.selectByPrimaryKey(id); - } - - public DrainageDataomprehensiveTableConfigure selectByIdAddPname(String id) { - DrainageDataomprehensiveTableConfigure drainageDataomprehensiveTableConfigure =drainageDataomprehensiveTableConfigureDao.selectByPrimaryKey(id); - DrainageDataomprehensiveTableConfigure p =drainageDataomprehensiveTableConfigureDao.selectByPrimaryKey(drainageDataomprehensiveTableConfigure.getPid()); - if(p!=null){ - drainageDataomprehensiveTableConfigure.set_pname(p.getName()); - } - return drainageDataomprehensiveTableConfigure; - } - - @Override - public int deleteById(String id) { - return this.drainageDataomprehensiveTableConfigureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DrainageDataomprehensiveTableConfigure entity) { - return this.drainageDataomprehensiveTableConfigureDao.insert(entity); - } - - @Override - public int update(DrainageDataomprehensiveTableConfigure t) { - return this.drainageDataomprehensiveTableConfigureDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DrainageDataomprehensiveTableConfigure drainageDataomprehensiveTableConfigure = new DrainageDataomprehensiveTableConfigure(); - drainageDataomprehensiveTableConfigure.setWhere(wherestr); - return this.drainageDataomprehensiveTableConfigureDao.selectListByWhere(drainageDataomprehensiveTableConfigure); - } - - @Override - public int deleteByWhere(String wherestr) { - DrainageDataomprehensiveTableConfigure drainageDataomprehensiveTableConfigure = new DrainageDataomprehensiveTableConfigure(); - drainageDataomprehensiveTableConfigure.setWhere(wherestr); - return this.drainageDataomprehensiveTableConfigureDao.deleteByWhere(drainageDataomprehensiveTableConfigure); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - if(list_result == null ) { - list_result = new ArrayList>(); - for(DrainageDataomprehensiveTableConfigure k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(DrainageDataomprehensiveTableConfigure k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid",k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/report/DrainageDataomprehensiveTableMainconfigureDetailService.java b/src/com/sipai/service/report/DrainageDataomprehensiveTableMainconfigureDetailService.java deleted file mode 100644 index 4daf8636..00000000 --- a/src/com/sipai/service/report/DrainageDataomprehensiveTableMainconfigureDetailService.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.service.report; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.DrainageDataomprehensiveTableMainconfigureDetailDao; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigure; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigureDetail; -import com.sipai.tools.CommService; - -@Service -public class DrainageDataomprehensiveTableMainconfigureDetailService implements CommService{ - @Resource - private DrainageDataomprehensiveTableMainconfigureDetailDao drainageDataomprehensiveTableMainconfigureDetailDao; - - public List selectList() { - // TODO Auto-generated method stub - DrainageDataomprehensiveTableMainconfigureDetail DrainageDataomprehensiveTableMainconfigureDetail = new DrainageDataomprehensiveTableMainconfigureDetail(); - return this.drainageDataomprehensiveTableMainconfigureDetailDao.selectList(DrainageDataomprehensiveTableMainconfigureDetail); - } - - @Override - public DrainageDataomprehensiveTableMainconfigureDetail selectById(String id) { - return this.drainageDataomprehensiveTableMainconfigureDetailDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.drainageDataomprehensiveTableMainconfigureDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DrainageDataomprehensiveTableMainconfigureDetail entity) { - return this.drainageDataomprehensiveTableMainconfigureDetailDao.insert(entity); - } - - @Override - public int update(DrainageDataomprehensiveTableMainconfigureDetail t) { - return this.drainageDataomprehensiveTableMainconfigureDetailDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail = new DrainageDataomprehensiveTableMainconfigureDetail(); - drainageDataomprehensiveTableMainconfigureDetail.setWhere(wherestr); - return this.drainageDataomprehensiveTableMainconfigureDetailDao.selectListByWhere(drainageDataomprehensiveTableMainconfigureDetail); - } - - @Override - public int deleteByWhere(String wherestr) { - DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail = new DrainageDataomprehensiveTableMainconfigureDetail(); - drainageDataomprehensiveTableMainconfigureDetail.setWhere(wherestr); - return this.drainageDataomprehensiveTableMainconfigureDetailDao.deleteByWhere(drainageDataomprehensiveTableMainconfigureDetail); - } - - public List getownsql(String wherestr) { - DrainageDataomprehensiveTableMainconfigureDetail drainageDataomprehensiveTableMainconfigureDetail = new DrainageDataomprehensiveTableMainconfigureDetail(); - drainageDataomprehensiveTableMainconfigureDetail.setWhere(wherestr); - return this.drainageDataomprehensiveTableMainconfigureDetailDao.getownsql(drainageDataomprehensiveTableMainconfigureDetail); - } - -} diff --git a/src/com/sipai/service/report/DrainageDataomprehensiveTableMainconfigureService.java b/src/com/sipai/service/report/DrainageDataomprehensiveTableMainconfigureService.java deleted file mode 100644 index 9212c12d..00000000 --- a/src/com/sipai/service/report/DrainageDataomprehensiveTableMainconfigureService.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.sipai.service.report; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.DrainageDataomprehensiveTableMainconfigureDao; -import com.sipai.entity.report.DrainageDataomprehensiveTableConfigure; -import com.sipai.entity.report.DrainageDataomprehensiveTableMainconfigure; -import com.sipai.tools.CommService; - -@Service -public class DrainageDataomprehensiveTableMainconfigureService implements CommService{ - @Resource - private DrainageDataomprehensiveTableMainconfigureDao drainageDataomprehensiveTableMainconfigureDao; - - public List selectList() { - // TODO Auto-generated method stub - DrainageDataomprehensiveTableMainconfigure DrainageDataomprehensiveTableMainconfigure = new DrainageDataomprehensiveTableMainconfigure(); - return this.drainageDataomprehensiveTableMainconfigureDao.selectList(DrainageDataomprehensiveTableMainconfigure); - } - - @Override - public DrainageDataomprehensiveTableMainconfigure selectById(String id) { - return this.drainageDataomprehensiveTableMainconfigureDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.drainageDataomprehensiveTableMainconfigureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DrainageDataomprehensiveTableMainconfigure entity) { - return this.drainageDataomprehensiveTableMainconfigureDao.insert(entity); - } - - @Override - public int update(DrainageDataomprehensiveTableMainconfigure t) { - return this.drainageDataomprehensiveTableMainconfigureDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure = new DrainageDataomprehensiveTableMainconfigure(); - drainageDataomprehensiveTableMainconfigure.setWhere(wherestr); - return this.drainageDataomprehensiveTableMainconfigureDao.selectListByWhere(drainageDataomprehensiveTableMainconfigure); - } - - @Override - public int deleteByWhere(String wherestr) { - DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure = new DrainageDataomprehensiveTableMainconfigure(); - drainageDataomprehensiveTableMainconfigure.setWhere(wherestr); - return this.drainageDataomprehensiveTableMainconfigureDao.deleteByWhere(drainageDataomprehensiveTableMainconfigure); - } - - public List getownsql(String wherestr) { - DrainageDataomprehensiveTableMainconfigure drainageDataomprehensiveTableMainconfigure = new DrainageDataomprehensiveTableMainconfigure(); - drainageDataomprehensiveTableMainconfigure.setWhere(wherestr); - return this.drainageDataomprehensiveTableMainconfigureDao.getownsql(drainageDataomprehensiveTableMainconfigure); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - if(list_result == null ) { - list_result = new ArrayList>(); - for(DrainageDataomprehensiveTableMainconfigure k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(DrainageDataomprehensiveTableMainconfigure k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid",k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/report/DrainageDataomprehensiveTableService.java b/src/com/sipai/service/report/DrainageDataomprehensiveTableService.java deleted file mode 100644 index 37552804..00000000 --- a/src/com/sipai/service/report/DrainageDataomprehensiveTableService.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.DrainageDataomprehensiveTableDao; -import com.sipai.dao.timeefficiency.PatrolAreaDao; -import com.sipai.entity.report.DrainageDataomprehensiveTable; -import com.sipai.tools.CommService; - -@Service -public class DrainageDataomprehensiveTableService implements CommService{ - @Resource - private DrainageDataomprehensiveTableDao drainageDataomprehensiveTableDao; - @Resource - private PatrolAreaDao patrolAreaDao; - - - public List selectList() { - // TODO Auto-generated method stub - DrainageDataomprehensiveTable DrainageDataomprehensiveTable = new DrainageDataomprehensiveTable(); - return this.drainageDataomprehensiveTableDao.selectList(DrainageDataomprehensiveTable); - } - - - @Override - public DrainageDataomprehensiveTable selectById(String id) { - return this.drainageDataomprehensiveTableDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.drainageDataomprehensiveTableDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DrainageDataomprehensiveTable entity) { - return this.drainageDataomprehensiveTableDao.insert(entity); - } - - @Override - public int update(DrainageDataomprehensiveTable t) { - return this.drainageDataomprehensiveTableDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DrainageDataomprehensiveTable drainageDataomprehensiveTable = new DrainageDataomprehensiveTable(); - drainageDataomprehensiveTable.setWhere(wherestr); - return this.drainageDataomprehensiveTableDao.selectListByWhere(drainageDataomprehensiveTable); - } - - @Override - public int deleteByWhere(String wherestr) { - DrainageDataomprehensiveTable drainageDataomprehensiveTable = new DrainageDataomprehensiveTable(); - drainageDataomprehensiveTable.setWhere(wherestr); - return this.drainageDataomprehensiveTableDao.deleteByWhere(drainageDataomprehensiveTable); - } - - public List getownsql(String wherestr) { - DrainageDataomprehensiveTable drainageDataomprehensiveTable = new DrainageDataomprehensiveTable(); - drainageDataomprehensiveTable.setWhere(wherestr); - return this.drainageDataomprehensiveTableDao.getownsql(drainageDataomprehensiveTable); - } -} diff --git a/src/com/sipai/service/report/ReportEnergyPumpService.java b/src/com/sipai/service/report/ReportEnergyPumpService.java deleted file mode 100644 index 54fb7462..00000000 --- a/src/com/sipai/service/report/ReportEnergyPumpService.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.service.report; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -/**二级水泵运行记录能耗报表 - * @author 12235 - * - */ -@Service -public class ReportEnergyPumpService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - public List selectList(String arg1,String arg2) { -/*String ids="NK_A_CSTLF1_KD,NK_A_CSTLF2_KD,NK_A_CSTLF3_KD,NK_A_CSTLF4_KD,NK_C_PSPSB1_RT,NK_C_PSPSB2_RT,NK_C_PSPSB3_RT,NK_C_PSPSB4_RT,NK_A_JBJ1_RT_A,NK_A_JBJ2_RT_A,NK_A_JBJ3_RT_A,NK_A_JBJ4_RT_A,"; -String[] idArr = ids.split(","); -String stime="";//开始时间 -String edtime="";//结束时间 -*/ - List list=new ArrayList(); - for(int i=0;i<24;i++){ - ReportEnergyPump reportEnergyPump = new ReportEnergyPump(); - - String sdt = ""; - String edt = ""; - if(i<10){ - sdt="0"+String.valueOf(i); - }else{ - sdt=String.valueOf(i); - } - if(i+1<10){ - edt="0"+String.valueOf(i+1); - }else{ - edt=String.valueOf(i+1); - } - reportEnergyPump.setTime(sdt+"-"+edt); - for(int j=0;j<4;j++){ - ReportEnergyPumpParam reportEnergyPumpParam = new ReportEnergyPumpParam(); - reportEnergyPumpParam.setI("0.00"); - reportEnergyPumpParam.setP("0.00"); - reportEnergyPumpParam.setE("0.00"); - reportEnergyPumpParam.setT("0.00"); - switch (j){ - case 0: - reportEnergyPump.setPump1(reportEnergyPumpParam); - break; - case 1: - reportEnergyPump.setPump2(reportEnergyPumpParam); - break; - case 2: - reportEnergyPump.setPump3(reportEnergyPumpParam); - break; - case 3: - reportEnergyPump.setPump4(reportEnergyPumpParam); - break; - } - - } - - list.add(reportEnergyPump); - } - return list; - } -} diff --git a/src/com/sipai/service/report/ReportTemplateService.java b/src/com/sipai/service/report/ReportTemplateService.java deleted file mode 100644 index 2a5982ef..00000000 --- a/src/com/sipai/service/report/ReportTemplateService.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.sipai.service.report; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Properties; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.TemplateType; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.tools.FileUtil; - -@Service -public class ReportTemplateService{ - @Resource - private ReportTemplateDao reportTemplateDao; - @Resource - private TemplateTypeService templateTypeService; - @Resource - private CommonFileService commonFileService; - - public ReportTemplate selectById(String id){ - ReportTemplate reportTemplate = reportTemplateDao.selectByPrimaryKey(id); - if (null != reportTemplate.getTypeId() && !reportTemplate.getTypeId().isEmpty()) { - TemplateType templateType = this.templateTypeService.selectById(reportTemplate.getTypeId()); - reportTemplate.setTemplateType(templateType); - } - return reportTemplate; - } - - @Transactional - public int deleteById(String id, String tbName){ - try { - //删除报表模板时同时删除模板文件数据和文件 - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid ='"+id+"'"); - int res = 0; - if(commfiles!=null && commfiles.size()>0){ - res = this.commonFileService.deleteByTableAWhere(tbName, "where masterid='"+id+"'"); - } - //删除文件地址后删除文件 - /*if(res>0){ - FileUtil.deleteFile(commfiles.get(0).getAbspath()); - }*/ - return reportTemplateDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - public int save(ReportTemplate reportTemplate){ - return reportTemplateDao.insert(reportTemplate); - } - - public int update(ReportTemplate reportTemplate){ - return reportTemplateDao.updateByPrimaryKeySelective(reportTemplate); - } - @Transactional - public int deleteByWhere(String wherestr,String tbName){ - try { - ReportTemplate reportTemplate = new ReportTemplate(); - reportTemplate.setWhere(wherestr); - Listlist = reportTemplateDao.selectListByWhere(reportTemplate); - if (list!=null && list.size()>0) { - for (ReportTemplate item:list) { - //删除报表模板时同时删除模板文件数据和文件 - List commfiles = this.commonFileService.selectListByTableAWhere(tbName, "where masterid ='"+item.getId()+"'"); - int res = 0; - if(commfiles!=null && commfiles.size()>0){ - res = this.commonFileService.deleteByTableAWhere(tbName, "where masterid='"+item.getId()+"'"); - } - //删除文件地址后删除文件 - /*if(res>0){ - FileUtil.deleteFile(commfiles.get(0).getAbspath()); - }*/ - } - } - return reportTemplateDao.deleteByWhere(reportTemplate); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - public ListselectListByWhere(String wherestr){ - ReportTemplate reportTemplate = new ReportTemplate(); - reportTemplate.setWhere(wherestr); - Listlist = reportTemplateDao.selectListByWhere(reportTemplate); - for (ReportTemplate item : list) { - if (null != item.getTypeId() && !item.getTypeId().isEmpty()) { - TemplateType templateType = this.templateTypeService.selectById(item.getTypeId()); - item.setTemplateType(templateType); - } - } - return list; - } - - /** - * 获取历史表名称 - * @param key - * @return - */ - public String searchHistoryTbName(String reportKey){ - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("reportMPointCode.properties"); - Properties prop = new Properties(); - try { - prop.load(inStream); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String mpointCode = prop.getProperty(reportKey).replace(" ", "");//去掉空格 - /*JSONObject jsonObject = JSONObject.parseObject(keys); - String tbName = "TB_MP_"+jsonObject.get(key);*/ - return mpointCode; - } -} diff --git a/src/com/sipai/service/report/ReportWaterBackWashEquipmentService.java b/src/com/sipai/service/report/ReportWaterBackWashEquipmentService.java deleted file mode 100644 index d81a2e01..00000000 --- a/src/com/sipai/service/report/ReportWaterBackWashEquipmentService.java +++ /dev/null @@ -1,229 +0,0 @@ -package com.sipai.service.report; - -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.gson.Gson; -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.ReportWaterOutletPump; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sun.xml.xsom.impl.scd.Iterators.Map; - -@Service -public class ReportWaterBackWashEquipmentService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterBackWashEquipment"; - - /** - * 反洗设备报表参数处理 - * type 日报或月报 - */ - public List selectList(String type,String bizId) { - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - for (int i = 0; i < count; i++) { - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - ReportWaterBackWashEquipment backWashEquipment = new ReportWaterBackWashEquipment(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizId, "TB_MP_" + idArr[j] - ," where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT asc"); - BigDecimal param = new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - } - switch (j) { - case 0: - if (param.intValue() == 1) { - backWashEquipment.setStatusA("运行"); - }else { - backWashEquipment.setStatusA("停止"); - } - break; - case 1: - backWashEquipment.setRateA(param); - break; - case 2: - backWashEquipment.setRunTimeA(param); - break; - case 3: - backWashEquipment.setCurrentA(param); - break; - case 4: - backWashEquipment.setPressureA(param); - break; - - case 5: - if (param.intValue() == 1) { - backWashEquipment.setStatusB("运行"); - }else { - backWashEquipment.setStatusB("停止"); - } - break; - case 6: - backWashEquipment.setRateB(param); - break; - case 7: - backWashEquipment.setRunTimeB(param); - break; - case 8: - backWashEquipment.setCurrentB(param); - break; - case 9: - backWashEquipment.setPressureB(param); - break; - - case 10: - backWashEquipment.setGeneralFlow(param); - break; - case 11: - backWashEquipment.setGeneralPressure(param); - break; - - case 12: - if (param.intValue() == 1) { - backWashEquipment.setStatusC("运行"); - }else { - backWashEquipment.setStatusC("停止"); - } - break; - case 13: - backWashEquipment.setRateC(param); - break; - case 14: - backWashEquipment.setRunTimeC(param); - break; - case 15: - backWashEquipment.setCurrentC(param); - break; - case 16: - backWashEquipment.setPressureC(param); - break; - - case 17: - if (param.intValue() == 1) { - backWashEquipment.setStatusD("运行"); - }else { - backWashEquipment.setStatusD("停止"); - } - break; - case 18: - backWashEquipment.setRateD(param); - break; - case 19: - backWashEquipment.setRunTimeD(param); - break; - case 20: - backWashEquipment.setCurrentD(param); - break; - case 21: - backWashEquipment.setPressureD(param); - break; - - case 22: - backWashEquipment.setFlowRate(param); - break; - case 23: - backWashEquipment.setTotalFlow(param); - break; - } - } - if(type.equals(TemplateType.REPORT_DAY)){ - backWashEquipment.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - backWashEquipment.setTime(sdt.substring(5, 10)); - } - list.add(backWashEquipment); - t++; - } - return list; - } -} diff --git a/src/com/sipai/service/report/ReportWaterInAndOutFlowService.java b/src/com/sipai/service/report/ReportWaterInAndOutFlowService.java deleted file mode 100644 index 5910fa1c..00000000 --- a/src/com/sipai/service/report/ReportWaterInAndOutFlowService.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.sipai.service.report; - -import groovy.sql.OutParameter; - -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.gson.Gson; -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.ReportWaterInAndOutFlow; -import com.sipai.entity.report.ReportWaterOutletPump; -import com.sipai.entity.report.ReportWaterTlc; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sun.xml.xsom.impl.scd.Iterators.Map; - -@Service -public class ReportWaterInAndOutFlowService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterInAndOutFlow"; - /** - * 进出水流量报表参数处理 - * type 日报或月报 - */ - public List selectList(String type,String bizId) { - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - for (int i = 0; i < count; i++) { - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - ReportWaterInAndOutFlow inAndOutFlow = new ReportWaterInAndOutFlow(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizId, "TB_MP_" + idArr[j] - ," where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT asc"); - BigDecimal param = new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - param = param.setScale(2,BigDecimal.ROUND_HALF_UP); - } - switch (j) { - case 0: - inAndOutFlow.setFlowRateA(param); - break; - case 1: - inAndOutFlow.setTotalFlowA(param); - break; - - case 2: - inAndOutFlow.setFlowRateB(param); - break; - case 3: - inAndOutFlow.setTotalFlowB(param); - break; - - case 4: - inAndOutFlow.setFlowRateC(param); - break; - case 5: - inAndOutFlow.setTotalFlowC(param); - break; - - case 6: - inAndOutFlow.setFlowRateD(param); - break; - case 7: - inAndOutFlow.setTotalFlowD(param); - break; - - case 8: - inAndOutFlow.setFlowRateE(param); - break; - case 9: - inAndOutFlow.setTotalFlowE(param); - break; - - case 10: - inAndOutFlow.setFlowRateF(param); - break; - case 11: - inAndOutFlow.setTotalFlowF(param); - break; - - case 12: - inAndOutFlow.setFlowRateG(param); - break; - case 13: - inAndOutFlow.setTotalFlowG(param); - break; - - case 14: - inAndOutFlow.setFlowRateH(param); - break; - case 15: - inAndOutFlow.setTotalFlowH(param); - break; - - case 16: - inAndOutFlow.setFlowRateI(param); - break; - case 17: - inAndOutFlow.setTotalFlowI(param); - break; - - case 18: - inAndOutFlow.setFlowRateJ(param); - break; - case 19: - inAndOutFlow.setTotalFlowJ(param); - break; - - case 20: - inAndOutFlow.setFlowRateK(param); - break; - case 21: - inAndOutFlow.setTotalFlowK(param); - break; - case 22: - inAndOutFlow.setPressureK(param); - break; - - case 23: - inAndOutFlow.setTotalFlowL(param); - break; - case 24: - inAndOutFlow.setFlowRateL(param); - break; - case 25: - inAndOutFlow.setPressureL(param); - break; - - } - - } - if(type.equals(TemplateType.REPORT_DAY)){ - inAndOutFlow.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - inAndOutFlow.setTime(sdt.substring(5, 10)); - } - list.add(inAndOutFlow); - t++; - } - return list; - } -} diff --git a/src/com/sipai/service/report/ReportWaterInAndOutParamService.java b/src/com/sipai/service/report/ReportWaterInAndOutParamService.java deleted file mode 100644 index ed6387f8..00000000 --- a/src/com/sipai/service/report/ReportWaterInAndOutParamService.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.sipai.service.report; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterTlc; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -/**进出水参数报表 - * @author 12235 - * - */ -@Service -public class ReportWaterInAndOutParamService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterInAndOutParam"; - - public List selectList(String type,String bizid) { -/*String ids="NK_A_CSTLF1_KD,NK_A_CSTLF2_KD,NK_A_CSTLF3_KD,NK_A_CSTLF4_KD,NK_C_PSPSB1_RT,NK_C_PSPSB2_RT,NK_C_PSPSB3_RT,NK_C_PSPSB4_RT,NK_A_JBJ1_RT_A,NK_A_JBJ2_RT_A,NK_A_JBJ3_RT_A,NK_A_JBJ4_RT_A,"; -String[] idArr = ids.split(","); -String stime="";//开始时间 -String edtime="";//结束时间 -*/ - - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - - - for (int i = 0; i < count; i++) { - - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - ReportWaterTlc reportEnergyPump = new ReportWaterTlc(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizid, "[TB_MP_" + idArr[j] - + "]", " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT "); - BigDecimal param=new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - } else { - - } - switch (j) { - case 0: - reportEnergyPump.setParam1(param); - break; - case 1: - reportEnergyPump.setParam2(param); - break; - case 2: - reportEnergyPump.setParam3(param); - break; - case 3: - reportEnergyPump.setParam4(param); - break; - case 4: - reportEnergyPump.setParam5(param); - break; - case 5: - reportEnergyPump.setParam6(param); - break; - case 6: - reportEnergyPump.setParam7(param); - break; - case 7: - reportEnergyPump.setParam8(param); - break; - case 8: - reportEnergyPump.setParam9(param); - break; - case 9: - reportEnergyPump.setParam10(param); - break; - case 10: - reportEnergyPump.setParam11(param); - break; - case 11: - reportEnergyPump.setParam12(param); - break; - case 12: - reportEnergyPump.setParam13(param); - break; - case 13: - reportEnergyPump.setParam14(param); - break; - case 14: - reportEnergyPump.setParam15(param); - break; - case 15: - reportEnergyPump.setParam16(param); - break; - case 16: - reportEnergyPump.setParam17(param); - break; - } - - } - if(type.equals(TemplateType.REPORT_DAY)){ - reportEnergyPump.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - reportEnergyPump.setTime(sdt.substring(5, 10)); - } - - list.add(reportEnergyPump); - t++; - - } - - return list; - } -} diff --git a/src/com/sipai/service/report/ReportWaterMlcService.java b/src/com/sipai/service/report/ReportWaterMlcService.java deleted file mode 100644 index 11e2d0d3..00000000 --- a/src/com/sipai/service/report/ReportWaterMlcService.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.service.report; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterTlc; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -/**膜滤池、中和池、清水池工艺参数报表 - * @author 12235 - * - */ -@Service -public class ReportWaterMlcService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterMlc"; - - public List selectList(String type,String bizid) { -/*String ids="NK_A_CSTLF1_KD,NK_A_CSTLF2_KD,NK_A_CSTLF3_KD,NK_A_CSTLF4_KD,NK_C_PSPSB1_RT,NK_C_PSPSB2_RT,NK_C_PSPSB3_RT,NK_C_PSPSB4_RT,NK_A_JBJ1_RT_A,NK_A_JBJ2_RT_A,NK_A_JBJ3_RT_A,NK_A_JBJ4_RT_A,"; -String[] idArr = ids.split(","); -String stime="";//开始时间 -String edtime="";//结束时间 -*/ - - //String sdt=nowdate+" 08:00:00"; - //String edt=nowdate+" 19:00:00"; - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - - - for (int i = 0; i < count; i++) { - - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - ReportWaterTlc reportEnergyPump = new ReportWaterTlc(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizid, "[TB_MP_" + idArr[j] - + "]", " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT "); - BigDecimal param=new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - } else { - - } - switch (j) { - case 0: - reportEnergyPump.setParam1(param); - break; - case 1: - reportEnergyPump.setParam2(param); - break; - case 2: - reportEnergyPump.setParam3(param); - break; - case 3: - reportEnergyPump.setParam4(param); - break; - case 4: - reportEnergyPump.setParam5(param); - break; - case 5: - reportEnergyPump.setParam6(param); - break; - case 6: - reportEnergyPump.setParam7(param); - break; - case 7: - reportEnergyPump.setParam8(param); - break; - case 8: - reportEnergyPump.setParam9(param); - break; - case 9: - reportEnergyPump.setParam10(param); - break; - case 10: - reportEnergyPump.setParam11(param); - break; - case 11: - reportEnergyPump.setParam12(param); - break; - case 12: - reportEnergyPump.setParam13(param); - break; - case 13: - reportEnergyPump.setParam14(param); - break; - case 14: - reportEnergyPump.setParam15(param); - break; - case 15: - reportEnergyPump.setParam16(param); - break; - case 16: - reportEnergyPump.setParam17(param); - break; - } - - } - if(type.equals(TemplateType.REPORT_DAY)){ - reportEnergyPump.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - reportEnergyPump.setTime(sdt.substring(5, 10)); - } - - list.add(reportEnergyPump); - t++; - - } - - return list; - } -} diff --git a/src/com/sipai/service/report/ReportWaterOutletPumpService.java b/src/com/sipai/service/report/ReportWaterOutletPumpService.java deleted file mode 100644 index f9cdf1a4..00000000 --- a/src/com/sipai/service/report/ReportWaterOutletPumpService.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.sipai.service.report; - -import groovy.sql.OutParameter; - -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.gson.Gson; -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterBackWashEquipment; -import com.sipai.entity.report.ReportWaterOutletPump; -import com.sipai.entity.report.ReportWaterTlc; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sun.xml.xsom.impl.scd.Iterators.Map; - -@Service -public class ReportWaterOutletPumpService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterOutletPump"; - /** - * 出水泵报表参数处理 - * type 日报或月报 - */ - public List selectList(String type,String bizId) { - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - for (int i = 0; i < count; i++) { - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - ReportWaterOutletPump outletPump = new ReportWaterOutletPump(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizId, "TB_MP_" + idArr[j] - ," where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT asc"); - BigDecimal param = new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - } - switch (j) { - case 0: - if (param.intValue() == 1) { - outletPump.setStatusA("运行"); - }else { - outletPump.setStatusA("停止"); - } - break; - case 1: - outletPump.setRateA(param); - break; - case 2: - outletPump.setRunTimeA(param); - break; - case 3: - outletPump.setCurrentA(param); - break; - case 4: - outletPump.setFlowRateA(param); - break; - case 5: - outletPump.setTotalFlowA(param); - break; - case 6: - outletPump.setPressureA(param); - break; - - case 7: - if (param.intValue() == 1) { - outletPump.setStatusB("运行"); - }else { - outletPump.setStatusB("停止"); - } - break; - case 8: - outletPump.setRateB(param); - break; - case 9: - outletPump.setRunTimeB(param); - break; - case 10: - outletPump.setCurrentB(param); - break; - case 11: - outletPump.setFlowRateB(param); - break; - case 12: - outletPump.setTotalFlowB(param); - break; - case 13: - outletPump.setPressureB(param); - break; - - case 14: - if (param.intValue() == 1) { - outletPump.setStatusC("运行"); - }else { - outletPump.setStatusC("停止"); - } - break; - case 15: - outletPump.setRateC(param); - break; - case 16: - outletPump.setRunTimeC(param); - break; - case 17: - outletPump.setCurrentC(param); - break; - case 18: - outletPump.setFlowRateC(param); - break; - case 19: - outletPump.setTotalFlowC(param); - break; - case 20: - outletPump.setPressureC(param); - break; - case 21: - if (param.intValue() == 1) { - outletPump.setStatusD("运行"); - }else { - outletPump.setStatusD("停止"); - } - break; - case 22: - outletPump.setRateD(param); - break; - case 23: - outletPump.setRunTimeD(param); - break; - case 24: - outletPump.setCurrentD(param); - break; - case 25: - outletPump.setFlowRateD(param); - break; - case 26: - outletPump.setTotalFlowD(param); - break; - case 27: - outletPump.setPressureD(param); - break; - } - - } - if(type.equals(TemplateType.REPORT_DAY)){ - outletPump.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - outletPump.setTime(sdt.substring(5, 10)); - } - list.add(outletPump); - t++; - } - return list; - } -} diff --git a/src/com/sipai/service/report/ReportWaterTlcService.java b/src/com/sipai/service/report/ReportWaterTlcService.java deleted file mode 100644 index dc31d3e9..00000000 --- a/src/com/sipai/service/report/ReportWaterTlcService.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.service.report; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterTlc; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -/**炭滤池工艺参数报表 - * @author 12235 - * - */ -@Service -public class ReportWaterTlcService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterTlc"; - - public List selectList(String type,String bizid) { -/*String ids="NK_A_CSTLF1_KD,NK_A_CSTLF2_KD,NK_A_CSTLF3_KD,NK_A_CSTLF4_KD,NK_C_PSPSB1_RT,NK_C_PSPSB2_RT,NK_C_PSPSB3_RT,NK_C_PSPSB4_RT,NK_A_JBJ1_RT_A,NK_A_JBJ2_RT_A,NK_A_JBJ3_RT_A,NK_A_JBJ4_RT_A,"; -String[] idArr = ids.split(","); -String stime="";//开始时间 -String edtime="";//结束时间 -*/ - - //String sdt=nowdate+" 08:00:00"; - //String edt=nowdate+" 19:00:00"; - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - - - for (int i = 0; i < count; i++) { - - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - ReportWaterTlc reportEnergyPump = new ReportWaterTlc(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizid, "[TB_MP_" + idArr[j] - + "]", " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT "); - BigDecimal param=new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - } else { - - } - switch (j) { - case 0: - reportEnergyPump.setParam1(param); - break; - case 1: - reportEnergyPump.setParam2(param); - break; - case 2: - reportEnergyPump.setParam3(param); - break; - case 3: - reportEnergyPump.setParam4(param); - break; - case 4: - reportEnergyPump.setParam5(param); - break; - case 5: - reportEnergyPump.setParam6(param); - break; - case 6: - reportEnergyPump.setParam7(param); - break; - case 7: - reportEnergyPump.setParam8(param); - break; - case 8: - reportEnergyPump.setParam9(param); - break; - case 9: - reportEnergyPump.setParam10(param); - break; - case 10: - reportEnergyPump.setParam11(param); - break; - case 11: - reportEnergyPump.setParam12(param); - break; - case 12: - reportEnergyPump.setParam13(param); - break; - case 13: - reportEnergyPump.setParam14(param); - break; - case 14: - reportEnergyPump.setParam15(param); - break; - case 15: - reportEnergyPump.setParam16(param); - break; - case 16: - reportEnergyPump.setParam17(param); - break; - } - - } - if(type.equals(TemplateType.REPORT_DAY)){ - reportEnergyPump.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - reportEnergyPump.setTime(sdt.substring(5, 10)); - } - - list.add(reportEnergyPump); - t++; - - } - - return list; - } -} diff --git a/src/com/sipai/service/report/ReportWaterTsjfService.java b/src/com/sipai/service/report/ReportWaterTsjfService.java deleted file mode 100644 index 38e2d0c9..00000000 --- a/src/com/sipai/service/report/ReportWaterTsjfService.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.service.report; - -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.ReportTemplateDao; -import com.sipai.entity.report.ReportEnergyPump; -import com.sipai.entity.report.ReportEnergyPumpParam; -import com.sipai.entity.report.ReportTemplate; -import com.sipai.entity.report.ReportWaterTlc; -import com.sipai.entity.report.TemplateType; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -/**脱水机房、污泥浓缩池工艺参数报表 - * @author 12235 - * - */ -@Service -public class ReportWaterTsjfService implements BaseService{ - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ReportTemplateService rservice; - - //报表的关键字,reportMPointCode.properties文件中 - public static String reportKey = "ReportWaterTsjf"; - - public List selectList(String type,String bizid) { -/*String ids="NK_A_CSTLF1_KD,NK_A_CSTLF2_KD,NK_A_CSTLF3_KD,NK_A_CSTLF4_KD,NK_C_PSPSB1_RT,NK_C_PSPSB2_RT,NK_C_PSPSB3_RT,NK_C_PSPSB4_RT,NK_A_JBJ1_RT_A,NK_A_JBJ2_RT_A,NK_A_JBJ3_RT_A,NK_A_JBJ4_RT_A,"; -String[] idArr = ids.split(","); -String stime="";//开始时间 -String edtime="";//结束时间 -*/ - - //String sdt=nowdate+" 08:00:00"; - //String edt=nowdate+" 19:00:00"; - String ids= this.rservice.searchHistoryTbName(reportKey); - String[] idArr = ids.split(","); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - List list=new ArrayList(); - int count=0; - int t = 0; - Calendar st = Calendar.getInstance(); - String nowdate=""; - if(type.equals(TemplateType.REPORT_DAY)){ - count=24;//一天24小时 - t=8;//从8点开始 - st.add(Calendar.DATE, -1);//获取前一天日期 - nowdate =sdf.format(st.getTime()); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - count=31;//总共31天 - t=1;//第一天从1号开始 - st.add(Calendar.MONTH, -1);//获取前一月日期 - nowdate =sdf.format(st.getTime()); - } - - - for (int i = 0; i < count; i++) { - - Date date = new Date(); - String sdt = ""; - String edt = ""; - if(type.equals(TemplateType.REPORT_DAY)){ - try { - if(t<10){ - date = sdtf.parse(nowdate + " 0"+t+":00:00"); - }else{ - date = sdtf.parse(nowdate +" "+ t+":00:00"); - } - - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.HOUR, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - }else if(type.equals(TemplateType.REPORT_MONTH)){ - try { - date = sdtf.parse(nowdate.substring(0,10) + " 00:00:00");//上月的第一天,2019-03-01 00:00:00 - //date = sdtf.parse(nowdate + " 08:00:00"); - if(t<10){ - date = sdtf.parse(nowdate.substring(0,8) + " 0"+t+" 00:00:00"); - }else{ - date = sdtf.parse(nowdate.substring(0,8) +" "+ t+" 00:00:00"); - } - st.setTime(date); - sdt = sdtf.format(st.getTime()); - st.add(Calendar.DATE, 1); - edt = sdtf.format(st.getTime()); - //nowdate=edt; - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - ReportWaterTlc reportEnergyPump = new ReportWaterTlc(); - for (int j = 0; j < idArr.length; j++) { - List mplist = mPointHistoryService - .selectListByTableAWhere(bizid, "[TB_MP_" + idArr[j] - + "]", " where MeasureDT >= '" + sdt - + "' and MeasureDT<= '" + edt - + "' order by MeasureDT "); - BigDecimal param=new BigDecimal(0); - if (mplist != null && mplist.size() > 0) { - param = mplist.get(0).getParmvalue(); - } else { - - } - switch (j) { - case 0: - reportEnergyPump.setParam1(param); - break; - case 1: - reportEnergyPump.setParam2(param); - break; - case 2: - reportEnergyPump.setParam3(param); - break; - case 3: - reportEnergyPump.setParam4(param); - break; - case 4: - reportEnergyPump.setParam5(param); - break; - case 5: - reportEnergyPump.setParam6(param); - break; - case 6: - reportEnergyPump.setParam7(param); - break; - case 7: - reportEnergyPump.setParam8(param); - break; - case 8: - reportEnergyPump.setParam9(param); - break; - case 9: - reportEnergyPump.setParam10(param); - break; - case 10: - reportEnergyPump.setParam11(param); - break; - case 11: - reportEnergyPump.setParam12(param); - break; - case 12: - reportEnergyPump.setParam13(param); - break; - case 13: - reportEnergyPump.setParam14(param); - break; - case 14: - reportEnergyPump.setParam15(param); - break; - case 15: - reportEnergyPump.setParam16(param); - break; - case 16: - reportEnergyPump.setParam17(param); - break; - } - - } - if(type.equals(TemplateType.REPORT_DAY)){ - reportEnergyPump.setTime(sdt.substring(11, 16)); - }else if(type.equals(TemplateType.REPORT_MONTH)){ - reportEnergyPump.setTime(sdt.substring(5, 10)); - } - - list.add(reportEnergyPump); - t++; - - } - - return list; - } -} diff --git a/src/com/sipai/service/report/RptCollectModeService.java b/src/com/sipai/service/report/RptCollectModeService.java deleted file mode 100644 index e0e2c543..00000000 --- a/src/com/sipai/service/report/RptCollectModeService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import com.sipai.entity.report.RptCollectMode;; - -public interface RptCollectModeService { - - public abstract RptCollectMode selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptCollectMode entity); - - public abstract int update(RptCollectMode entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/report/RptCollectModeServiceImpl.java b/src/com/sipai/service/report/RptCollectModeServiceImpl.java deleted file mode 100644 index 84aaf166..00000000 --- a/src/com/sipai/service/report/RptCollectModeServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.RptCollectModeDao; -import com.sipai.entity.report.RptCollectMode; - -@Service -public class RptCollectModeServiceImpl implements RptCollectModeService{ - - @Resource - private RptCollectModeDao rptCollectModeDao; - - @Override - public RptCollectMode selectById(String t) { - // TODO Auto-generated method stub - return rptCollectModeDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return rptCollectModeDao.deleteByPrimaryKey(t); - } - - @Override - public int save(RptCollectMode t) { - // TODO Auto-generated method stub - return rptCollectModeDao.insertSelective(t); - } - - @Override - public int update(RptCollectMode t) { - // TODO Auto-generated method stub - return rptCollectModeDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - RptCollectMode rptCollectMode = new RptCollectMode(); - rptCollectMode.setWhere(t); - return rptCollectModeDao.selectListByWhere(rptCollectMode); - } - - @Override - public int deleteByWhere(String t) { - RptCollectMode rptCollectMode = new RptCollectMode(); - rptCollectMode.setWhere(t); - return rptCollectModeDao.deleteByWhere(rptCollectMode); - } - - - -} diff --git a/src/com/sipai/service/report/RptCreateService.java b/src/com/sipai/service/report/RptCreateService.java deleted file mode 100644 index b7f706ab..00000000 --- a/src/com/sipai/service/report/RptCreateService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.report; - -import java.io.IOException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactoryConfigurationError; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.report.RptInfoSet; -import org.xmlpull.v1.XmlPullParserException; - -public interface RptCreateService { - - public abstract RptCreate selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptCreate entity); - - public abstract int save2(RptCreate entity); - - public abstract int update(RptCreate entity); - - public abstract int update4generate(RptCreate entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract String[] getStEt(String rpttype, String rptdt, String mthstartdt); - - //解析excel - public abstract String convertExceltoHtml(String path, String sheetname, String id, String layerType, String nameSpace) throws IOException, ParserConfigurationException, TransformerFactoryConfigurationError, TransformerException; - - //启动流程 - public abstract int startProcess(RptCreate entity); - - //审核 - public abstract int doAudit(BusinessUnitAudit entity); - - public abstract int save4Job(String rptInfoSetId, String rptdt) throws XmlPullParserException, NoSuchAlgorithmException, InvalidKeyException, IOException; - - //改变状态 - public abstract int updateStatus(String id); -} \ No newline at end of file diff --git a/src/com/sipai/service/report/RptDayLogService.java b/src/com/sipai/service/report/RptDayLogService.java deleted file mode 100644 index ded44ebe..00000000 --- a/src/com/sipai/service/report/RptDayLogService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.report; - -import com.sipai.entity.base.Result; -import com.sipai.entity.report.RptDayLog; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import net.sf.json.JSONObject; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -public interface RptDayLogService { - - public abstract RptDayLog selectById(String id); - - public abstract int deleteById(String id); - - public abstract int savejson(JSONObject jsonObject, String userId) throws IOException; - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListByWhere(String wherestr,String dateType); - - public abstract int deleteByWhere(String wherestr); - - public abstract int update(RptDayLog rptdaylog); - - public abstract ArrayList selectMPointList(String unitId, - String rptdeptId); - - public abstract String readXls(InputStream inputStream, String userId, String unitId, String rptdeptId) throws IOException; - - public abstract String readXlsx(InputStream inputStream, String userId, String unitId, String rptdeptId) throws IOException; - - public abstract void downloadExcel(HttpServletResponse response, - String unitId, String rptdeptId) throws IOException; - - public abstract JSONObject getJson(String id, - String rptdeptId, String rptdt, String userId) throws IOException; - - public abstract boolean checkRptdt(String rptdeptId, String rptdt); - - public abstract String splicingRptdt(String dateType, String rptdt); - - /** 提交审核/提交结束 - * @param id 填报信息id - * @param cu 用户信息 - * @param rptdeptId 类型id - * @return - */ - public abstract Result dosubmit(String id, User cu, String rptdeptId); - - /** 一键审核 - * @param ids 填报信息id组 - * @param cu 用户信息 - * @param rptdeptId 类型id - * @return - */ - public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId); -} diff --git a/src/com/sipai/service/report/RptDayValSetService.java b/src/com/sipai/service/report/RptDayValSetService.java deleted file mode 100644 index dfaed9cc..00000000 --- a/src/com/sipai/service/report/RptDayValSetService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.service.report; - -import com.sipai.entity.report.RptDayValSet; -import java.util.List; - -public interface RptDayValSetService { - - public abstract RptDayValSet selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptDayValSet rptDayValSet); - - public abstract int update(RptDayValSet rptDayValSet); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/report/RptDeptSetService.java b/src/com/sipai/service/report/RptDeptSetService.java deleted file mode 100644 index d229c20e..00000000 --- a/src/com/sipai/service/report/RptDeptSetService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.report.RptDeptSet; - -public interface RptDeptSetService { - - public abstract RptDeptSet selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptDeptSet rptDeptSet); - - public abstract int update(RptDeptSet rptDeptSet); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - String getTreeList(List> list_result,List list,boolean disabled); -} diff --git a/src/com/sipai/service/report/RptDeptSetUserService.java b/src/com/sipai/service/report/RptDeptSetUserService.java deleted file mode 100644 index 7e94813d..00000000 --- a/src/com/sipai/service/report/RptDeptSetUserService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import com.sipai.entity.report.RptDeptSetUser; -import com.sipai.entity.user.Unit; - -public interface RptDeptSetUserService { - - public abstract RptDeptSetUser selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptDeptSetUser rptDeptSetUser); - - public abstract int update(RptDeptSetUser rptDeptSetUser); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -// public abstract List getParent(String id, List units); -} diff --git a/src/com/sipai/service/report/RptInfoSetFileService.java b/src/com/sipai/service/report/RptInfoSetFileService.java deleted file mode 100644 index e629d762..00000000 --- a/src/com/sipai/service/report/RptInfoSetFileService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; -import com.sipai.entity.report.RptInfoSetFile; - -public interface RptInfoSetFileService { - - public abstract RptInfoSetFile selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptInfoSetFile entity); - - public abstract int update(RptInfoSetFile rptInfoSet); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/report/RptInfoSetService.java b/src/com/sipai/service/report/RptInfoSetService.java deleted file mode 100644 index 3154212c..00000000 --- a/src/com/sipai/service/report/RptInfoSetService.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.report.RptInfoSet; -import com.sipai.entity.report.RptTypeSet; - -public interface RptInfoSetService { - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptInfoSetService#selectById(java.lang.String) - */ - public abstract RptInfoSet selectById(String id); - - /* 只查询对象 避免查询过多 - * @see com.sipai.service.report.impl.RptInfoSetService#selectById(java.lang.String) - */ - public abstract RptInfoSet selectById4Simple(String id); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptInfoSetService#deleteById(java.lang.String) - */ - public abstract int deleteById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptInfoSetService#save(com.sipai.entity.report.RptInfoSet) - */ - public abstract int save(RptInfoSet entity); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptInfoSetService#update(com.sipai.entity.report.RptInfoSet) - */ - public abstract int update(RptInfoSet rptInfoSet); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptInfoSetService#selectListByWhere(java.lang.String) - */ - public abstract List selectListByWhere(String wherestr); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptInfoSetService#deleteByWhere(java.lang.String) - */ - public abstract int deleteByWhere(String wherestr); - - public RptInfoSet selectByIdWithFile(String id); - - public abstract String getTreeList(List> list_result, - List list); - - public abstract String getTreeList4Tag(List> list_result, List list, List str); - - /* - 获取生成权限记录 - */ - public abstract List selectListByWhere4Generate(String userId, String unitId); - - /* - 获取审核权限记录 - */ - public abstract List selectListByWhere4Check(String userId, String unitId); - - /* - 获取浏览权限记录 - */ - public abstract List selectListByWhere4view(String userId, String unitId); - - /** - * 获取对应权限的报表ids - * @param userId - * @param unitId - * @return - */ - public abstract String getRptInfoSetIds(String userId, String unitId, String type); - - /** - * - * @param list_result - * @param unitIds - * @param firstUnitId - * @param roleIds roleIds传all的时候显示所有层级 - * @return - */ - public abstract String getChildrenUnitIdTree(List> list_result, String unitIds, String firstUnitId, String roleIds); -} \ No newline at end of file diff --git a/src/com/sipai/service/report/RptInfoSetSheetService.java b/src/com/sipai/service/report/RptInfoSetSheetService.java deleted file mode 100644 index 46e12339..00000000 --- a/src/com/sipai/service/report/RptInfoSetSheetService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.report; - -import com.sipai.entity.report.RptInfoSetSheet; -import java.util.List; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2022/02/17/14:45 - * @Description: - */ -public interface RptInfoSetSheetService { - - public abstract RptInfoSetSheet selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptInfoSetSheet entity); - - public abstract int update(RptInfoSetSheet rptInfoSet); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/report/RptLogService.java b/src/com/sipai/service/report/RptLogService.java deleted file mode 100644 index bfbdd661..00000000 --- a/src/com/sipai/service/report/RptLogService.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.service.report; - -import java.io.IOException; -import java.util.List; - -import com.sipai.entity.report.RptLog; -import net.sf.json.JSONObject; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; - -public interface RptLogService { - - public abstract RptLog selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptLog entity); - - public abstract int saveSelective(RptLog entity); - - public abstract int update(RptLog entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract RptLog selectByWhere(String wherestr); - - public abstract String updateExcel(String path, String sheetname, String afterValue, int posx, int posy) throws IOException, ParserConfigurationException, TransformerException; - -} diff --git a/src/com/sipai/service/report/RptMpSetService.java b/src/com/sipai/service/report/RptMpSetService.java deleted file mode 100644 index 18bd64c0..00000000 --- a/src/com/sipai/service/report/RptMpSetService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import com.sipai.entity.report.RptMpSet; - -public interface RptMpSetService { - - public abstract RptMpSet selectById(String id); - - public abstract int deleteById(String id,String rptMpSetId); - - public abstract int save(RptMpSet entity); - - public abstract int update(RptMpSet rptInfoSet); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr,String rptMpSetId); - - /** - * 保存导入测量点 - * @param ids 测量点ids - * @param id 表单id - * @return - */ - public abstract int saveMp(String ids, String id); - - /** - * 插入横杠 - * @param id 表单id - * @return - */ - public abstract int saveRod(String id); - - /** - * 插入日期 - * @param id 表单id - * @return - */ - public abstract int saveDt(String id); -} diff --git a/src/com/sipai/service/report/RptSpSetService.java b/src/com/sipai/service/report/RptSpSetService.java deleted file mode 100644 index d7190015..00000000 --- a/src/com/sipai/service/report/RptSpSetService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import com.sipai.entity.report.RptSpSet; - -public interface RptSpSetService { - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptSpSetService#selectById(java.lang.String) - */ - public abstract RptSpSet selectById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptSpSetService#deleteById(java.lang.String) - */ - public abstract int deleteById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptSpSetService#save(com.sipai.entity.report.RptSpSet) - */ - public abstract int save(RptSpSet entity); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptSpSetService#update(com.sipai.entity.report.RptSpSet) - */ - public abstract int update(RptSpSet rptSpSet); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptSpSetService#selectListByWhere(java.lang.String) - */ - public abstract List selectListByWhere(String wherestr); - - /* (non-Javadoc) - * @see com.sipai.service.report.impl.RptSpSetService#deleteByWhere(java.lang.String) - */ - public abstract int deleteByWhere(String wherestr); - - List selectSheetNameList(String s); -} \ No newline at end of file diff --git a/src/com/sipai/service/report/RptTypeSetService.java b/src/com/sipai/service/report/RptTypeSetService.java deleted file mode 100644 index af3a49b0..00000000 --- a/src/com/sipai/service/report/RptTypeSetService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; -import com.sipai.entity.report.RptTypeSet; - -public interface RptTypeSetService { - - public abstract RptTypeSet selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(RptTypeSet entity); - - public abstract int update(RptTypeSet rptInfoSet); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/report/TemplateTypeService.java b/src/com/sipai/service/report/TemplateTypeService.java deleted file mode 100644 index 2fa75818..00000000 --- a/src/com/sipai/service/report/TemplateTypeService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.report; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.TemplateTypeDao; -import com.sipai.entity.report.TemplateType; -import com.sipai.tools.CommService; - -@Service -public class TemplateTypeService implements CommService{ - - @Resource - private TemplateTypeDao templateTypeDao; - - @Override - public TemplateType selectById(String id){ - return templateTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id){ - return templateTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(TemplateType templateType){ - return templateTypeDao.insert(templateType); - } - - @Override - public int update(TemplateType templateType){ - return templateTypeDao.updateByPrimaryKeySelective(templateType); - } - - @Override - public int deleteByWhere(String wherestr){ - TemplateType templateType = new TemplateType(); - templateType.setWhere(wherestr); - return templateTypeDao.deleteByWhere(templateType); - } - - @Override - public ListselectListByWhere (String wherestr){ - TemplateType templateType = new TemplateType(); - templateType.setWhere(wherestr); - return templateTypeDao.selectListByWhere(templateType); - } -} diff --git a/src/com/sipai/service/report/impl/RptCreateServiceImpl.java b/src/com/sipai/service/report/impl/RptCreateServiceImpl.java deleted file mode 100644 index 4673fa84..00000000 --- a/src/com/sipai/service/report/impl/RptCreateServiceImpl.java +++ /dev/null @@ -1,1866 +0,0 @@ -package com.sipai.service.report.impl; - -import java.io.*; -import java.math.BigDecimal; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.*; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.report.*; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.TempReport; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.work.Scheduling; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.report.*; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.TempReportService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.work.SchedulingService; -import com.sipai.tools.*; -import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; -import io.minio.MinioClient; -import io.minio.errors.InvalidEndpointException; -import io.minio.errors.InvalidPortException; -import io.minio.errors.MinioException; -import net.sf.json.JsonConfig; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.converter.ExcelToHtmlConverter; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.formula.ConditionalFormattingEvaluator; -import org.apache.poi.ss.formula.EvaluationConditionalFormatRule; -import org.apache.poi.ss.formula.WorkbookEvaluatorProvider; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.util.StringUtil; -import org.apache.poi.xssf.usermodel.*; -import org.dom4j.Document; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.RptCreateDao; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.user.UserService; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; -import org.xmlpull.v1.XmlPullParserException; - -import static com.microsoft.schemas.office.visio.x2012.main.CellType.*; -import static org.apache.poi.ss.usermodel.CellType.*; -import static org.apache.poi.ss.usermodel.CellType.FORMULA; - -@Service("rptCreateService") -//@Service -public class RptCreateServiceImpl implements RptCreateService { - @Resource - private RptCreateDao rptCreateDao; - @Resource - private UserService userService; - @Resource - private CommonFileService commonFileService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private RptLogService rptLogService; - @Resource - private RptInfoSetFileService rptInfoSetFileService; - @Resource - private RptInfoSetService rptInfoSetService; - @Resource - private RptSpSetService rptSpSetService; - @Resource - private MPointService mPointService; - @Resource - private RptMpSetService rptMpSetService; - @Resource - private TempReportService tempReportService; - @Autowired - private MinioProp minioProp; - @Resource - private SchedulingService schedulingService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private GroupDetailService groupDetailService; - - @Override - public RptCreate selectById(String id) { - RptCreate entity = rptCreateDao.selectByPrimaryKey(id); - if (entity != null) { - User user = userService.getUserById(entity.getInputuser()); - if (user != null) { - entity.setInputusername(user.getCaption()); - } - if (entity.getCheckuser() != null && !entity.getCheckuser().equals("")) { - String checkusername = this.getUserNamesByUserIds(entity.getCheckuser()); - entity.setCheckusername(checkusername); - } - } - return entity; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - //删除对应流程 - RptCreate rptCreate = rptCreateDao.selectByPrimaryKey(id); - if(rptCreate!=null && rptCreate.getStatus()!=null && rptCreate.getStatus().equals(RptCreate.Status_Finish)){ - //已完成的 - }else{ - String pInstancId = rptCreate.getProcessid(); - if (pInstancId != null) { - workflowService.delProcessInstance(pInstancId); - } - //删除对应处理详情 - businessUnitAuditService.deleteByWhere("where businessId='" + id + "'"); - } - //删除 - return rptCreateDao.deleteByPrimaryKey(id); - } catch (Exception e) { - throw new RuntimeException(); - } - } - - @Override - public int save(RptCreate rptCreate) { - RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId()); - if (rptInfoSet != null) { - //创建excel - CreateExcel(rptCreate.getInputuser(), rptCreate, rptInfoSet); - } - return rptCreateDao.insert(rptCreate); - } - - @Override - public int save2(RptCreate rptCreate) { - return rptCreateDao.insert(rptCreate); - } - - @Override - public int update(RptCreate entity) { - return rptCreateDao.updateByPrimaryKeySelective(entity); - } - - @Override - public int update4generate(RptCreate rptCreate) { - RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId()); - if (rptInfoSet != null) { - CreateExcel(rptCreate.getInputuser(), rptCreate, rptInfoSet); - } - return rptCreateDao.updateByPrimaryKeySelective(rptCreate); - } - - @Override - public List selectListByWhere(String wherestr) { - RptCreate entity = new RptCreate(); - entity.setWhere(wherestr); - List list = rptCreateDao.selectListByWhere(entity); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getInputuser() != null && !list.get(i).getInputuser().equals("")) { - User user = this.userService.getUserById(list.get(i).getInputuser()); - if (user != null) { - list.get(i).setInputusername(user.getCaption()); - } - } else { - User user = this.userService.getUserById(list.get(i).getInsuser()); - if (user != null) { - list.get(i).setInputusername(user.getCaption()); - } - } - RptInfoSet rptInfoSet = rptInfoSetService.selectById4Simple(list.get(i).getRptsetId()); - if (rptInfoSet != null) { - list.get(i).setRptInfoSet(rptInfoSet); - } - } - } - return list; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - RptCreate entity = new RptCreate(); - entity.setWhere(wherestr); - List list = rptCreateDao.selectListByWhere(entity); - for (RptCreate item : list) { - String pInstancId = item.getProcessid(); - if (pInstancId != null) { - workflowService.delProcessInstance(pInstancId); - } - //删除对应处理详情 - businessUnitAuditService.deleteByWhere("where businessId='" + item.getId() + "'"); - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + item.getId() + "'"); - } - return rptCreateDao.deleteByWhere(entity); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public String[] getStEt(String rpttype, String rptdt, String mthstartdt) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String convertExceltoHtml(String path, String sheetname, - String id, String layerType, String nameSpace) throws IOException, ParserConfigurationException, TransformerFactoryConfigurationError, TransformerException { - String content = null; - StringWriter writer = null; - byte[] bytes = commonFileService.getInputStreamBytes(nameSpace, path); - InputStream is = new ByteArrayInputStream(bytes); - //判断Excel文件是2003版还是2007版 - String suffix = path.substring(path.lastIndexOf(".")); - if (suffix.equals(".xlsx")) { - XSSFWorkbook workBook = new XSSFWorkbook(is); - XSSFSheet sheet = workBook.getSheet(sheetname); - try { - ExcelToHtmlConverter converter = new ExcelToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument()); - converter.setOutputColumnHeaders(false);// 不显示列的表头 - converter.setOutputRowNumbers(false);// 不显示行的表头 - - //重新创建workbook - HSSFWorkbook wb = CreatNewWorkBook(sheet, sheetname, id, layerType); - converter.processWorkbook(wb); - - writer = new StringWriter(); - Transformer serializer = TransformerFactory.newInstance().newTransformer(); - serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); - serializer.setOutputProperty(OutputKeys.INDENT, "no"); - serializer.setOutputProperty(OutputKeys.METHOD, "html"); - serializer.transform(new DOMSource(converter.getDocument()), - new StreamResult(writer)); - - content = writer.toString(); - writer.close(); - workBook.close(); - } finally { - try { - if (is != null) { - is.close(); - } - if (writer != null) { - writer.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } else { - HSSFWorkbook workBook = new HSSFWorkbook(is); - HSSFSheet sheet = workBook.getSheet(sheetname); - try { - ExcelToHtmlConverter converter = new ExcelToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument()); - converter.setOutputColumnHeaders(false);// 不显示列的表头 - converter.setOutputRowNumbers(false);// 不显示行的表头 - //重新创建workbook - HSSFWorkbook wb = CreatNewWorkBook(sheet, sheetname, id, layerType); - converter.processWorkbook(wb); - writer = new StringWriter(); - Transformer serializer = TransformerFactory.newInstance().newTransformer(); - serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); - serializer.setOutputProperty(OutputKeys.INDENT, "no"); - serializer.setOutputProperty(OutputKeys.METHOD, "html"); - serializer.transform(new DOMSource(converter.getDocument()), new StreamResult(writer)); - content = writer.toString(); - writer.close(); - workBook.close(); - } finally { - try { - if (is != null) { - is.close(); - } - if (writer != null) { - writer.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return content; - } - - @Override - public int startProcess(RptCreate entity) { - try { - Map variables = new HashMap(); - if (!entity.getCheckuser().isEmpty()) { - variables.put("userIds", entity.getCheckuser()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Report_Check.getId() + "-" + entity.getUnitId()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(entity.getId(), entity.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = this.update(entity); - if (res == 1) { - //发送消息 -// BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); -// businessUnitRecord.sendMessage(entity.getCheckuser(), "报表审核"); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public int updateStatus(String id) { - RptCreate entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { - entity.setStatus(RptCreate.Status_Finish); - } - int res = this.update(entity); - return res; - } - - public static List getMergedRegionValue(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - List list = new ArrayList<>(); - for (int i = 0; i < sheetMergeCount; i++) { - CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - list.add(firstColumn); - list.add(lastColumn); - list.add(firstRow); - list.add(lastRow); - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return list; - } - - private HSSFWorkbook CreatNewWorkBook(Sheet sheet, String sheetname, String id, String layerType) throws IOException { - // Drawing draw = sheet.createDrawingPatriarch();//初始化批注 - // Comment comment = draw.createCellComment(new HSSFClientAnchor()); - // comment.setString(new HSSFRichTextString("请在平台上查看备注"));//设置批注内容 - // 创建新的excel - HSSFWorkbook wbCreat = new HSSFWorkbook(); - HSSFSheet sheetCreat = wbCreat.createSheet(sheetname); - - // 复制源表中的合并单元格 - MergerRegion(sheetCreat, sheet); - - //单元格式样 - HSSFCellStyle cellStyle = wbCreat.createCellStyle(); - - HSSFSheetConditionalFormatting scf = sheetCreat.getSheetConditionalFormatting(); - int firstRow = sheet.getFirstRowNum(); - int lastRow = sheet.getLastRowNum(); - for (int i = firstRow; i <= lastRow; i++) { - // 创建新建excel Sheet的行 - Row rowCreat = sheetCreat.createRow(i); - // 取得源有excel Sheet的行 - Row row = sheet.getRow(i); - // 备注式样 - // HSSFCellStyle BoldNumberCenterRemarkStyle = null; - if (row != null) { - - if (row.getZeroHeight()) { - rowCreat.setZeroHeight(true); - } - - int firstCell = row.getFirstCellNum(); - int lastCell = row.getLastCellNum(); - - int row_hidden = 0;//默认0 为1的时候为该行存在合并单元格 不隐藏列 - for (int j = firstCell; j < lastCell; j++) { - - //如果存在隐藏行 - if (row.getZeroHeight() && row_hidden == 0) { - Boolean bool = isMergedRegion2(sheet, i, j); - if (bool) { - System.out.println(i + "~~~" + j + "~~~存在合并单元格,无法隐藏列"); - rowCreat.setZeroHeight(false); - row_hidden = 1; - } - } - - - //设置单元格字体 - Font headfont = wbCreat.createFont(); - headfont.setFontName("宋体"); - headfont.setFontHeightInPoints((short) 9); - // 设置单元格高度 - rowCreat.setHeight(row.getHeight()); - // 单元格类型 - if (row.getCell(j) != null) { - switch (row.getCell(j).getCellType()) { - case STRING: - String strVal = row.getCell(j).getStringCellValue(); - cellStyle = wbCreat.createCellStyle(); - - List int1 = getMergedRegionValue(sheetCreat, i, j); - if (int1 != null && int1.size() > 0) { - for (int k = int1.get(0); k <= int1.get(1); k++) { - if (row.getCell(k) != null && !row.getCell(k).equals("")) { - cellStyle.cloneStyleFrom(row.getCell(k).getCellStyle()); - rowCreat.createCell(k).setCellStyle(cellStyle); - } - } - } else { - cellStyle.cloneStyleFrom(row.getCell(j).getCellStyle()); - rowCreat.createCell(j).setCellStyle(cellStyle); - } - - if (strVal.contains("1,")) {//指令 - //此处为字体大小样式 不需要 注释即可 -// cellStyle.setFont(headfont); - } - if (strVal.contains("0,")) {//指令 - //此处为字体大小样式 不需要 注释即可 -// cellStyle.setFont(headfont); - } - rowCreat.getCell(j).setCellValue(strVal); - break; - case NUMERIC: - cellStyle = wbCreat.createCellStyle(); - cellStyle.cloneStyleFrom(row.getCell(j).getCellStyle()); - rowCreat.createCell(j).setCellStyle(cellStyle); - rowCreat.getCell(j).setCellValue(row.getCell(j).getNumericCellValue()); - break; - case FORMULA: - cellStyle = wbCreat.createCellStyle(); - cellStyle.cloneStyleFrom(row.getCell(j).getCellStyle()); - rowCreat.createCell(j).setCellStyle(cellStyle); - //此处为字体大小样式 不需要 注释即可 -// cellStyle.setFont(headfont); - try { - // 设置内容位置:例水平居中,居右,居工 - //cellStyle1.setAlignment(row.getCell(j).getCellStyle().getAlignment()); - // 设置内容位置:例垂直居中,居上,居下 - //cellStyle1.setVerticalAlignment(row.getCell(j).getCellStyle().getVerticalAlignment()); - - /** - * 下面为获取excle中的小数位 - */ - HSSFCellStyle hssVal = (HSSFCellStyle) row.getCell(j).getCellStyle(); - String excelValStyle = hssVal.getDataFormatString(); - if (excelValStyle != null && excelValStyle.contains("_")) { - String result = excelValStyle; - if (excelValStyle.contains("[Red]")) { - int strStartIndex = excelValStyle.indexOf("\\("); - int strEndIndex = excelValStyle.indexOf("\\)"); - result = excelValStyle.substring(strStartIndex, strEndIndex).substring("\\(".length()); - } else { - result = result.replace("#", ""); - result = result.replace(",", ""); - if (result.trim().equals("0_")) { - result = "0"; - } else if (result.trim().equals("0.0_")) { - result = "0.0"; - } else if (result.trim().equals("0.00_")) { - result = "0.00"; - } else if (result.trim().equals("0.000_")) { - result = "0.000"; - } else if (result.trim().equals("0.0000_")) { - result = "0.0000"; - } - } -// System.out.println(row.getCell(j).getNumericCellValue() + "======" + result); - if (result.equals("0")) { - DecimalFormat df = new DecimalFormat("0"); - rowCreat.getCell(j).setCellValue(df.format(row.getCell(j).getNumericCellValue())); - } else if (result.equals("0.0")) { - DecimalFormat df = new DecimalFormat("0.0"); - rowCreat.getCell(j).setCellValue(df.format(row.getCell(j).getNumericCellValue())); - } else if (result.equals("0.00")) { - DecimalFormat df = new DecimalFormat("0.00"); - rowCreat.getCell(j).setCellValue(df.format(row.getCell(j).getNumericCellValue())); - } else if (result.equals("0.000")) { - DecimalFormat df = new DecimalFormat("0.000"); - rowCreat.getCell(j).setCellValue(df.format(row.getCell(j).getNumericCellValue())); -// System.out.println(row.getCell(j).getNumericCellValue() + "======" + result + "======" + df.format(row.getCell(j).getNumericCellValue())); - } else if (result.equals("0.0000")) { - DecimalFormat df = new DecimalFormat("0.0000"); - rowCreat.getCell(j).setCellValue(df.format(row.getCell(j).getNumericCellValue())); - } else { - DecimalFormat df = new DecimalFormat("0"); - rowCreat.getCell(j).setCellValue(df.format(row.getCell(j).getNumericCellValue())); - } - } else { - DecimalFormat df = new DecimalFormat("0"); - Object obj = getCellFormatValue(row.getCell(j)); - rowCreat.getCell(j).setCellValue(obj.toString()); - } - } catch (IllegalStateException e) { - try { - rowCreat.getCell(j).setCellValue(row.getCell(j).getRichStringCellValue()); - } catch (Exception ex) { - rowCreat.getCell(j).setCellValue("#DIV/0!"); - } - } - break; - default: - cellStyle = wbCreat.createCellStyle(); - cellStyle.cloneStyleFrom(row.getCell(j).getCellStyle()); - rowCreat.createCell(j).setCellStyle(cellStyle); - } - } - // 自动适应列宽 貌似不起作用 - //sheetCreat.autoSizeColumn(j); - // 调整每一列宽度 - sheetCreat.autoSizeColumn((short) j); - // 解决自动设置列宽中文失效的问题 -// sheetCreat.setColumnWidth(j, sheet.getColumnWidth(j)); - sheetCreat.setColumnWidth(j, sheet.getColumnWidth(j) * 13 / 10); -// sheetCreat.setDefaultRowHeight(sheet.getDefaultRowHeight()); - //隐藏列 - sheetCreat.setColumnHidden(j, sheet.isColumnHidden(j)); - } - } - } - return wbCreat; - } - - /** - * excel97中颜色转化为uof颜色 - * - * @param color 颜色序号 - * @return 颜色或者null - */ - private static ColorInfo excel97Color2UOF(Workbook book, short color) { - if (book instanceof HSSFWorkbook) { - HSSFWorkbook hb = (HSSFWorkbook) book; - HSSFColor hc = hb.getCustomPalette().getColor(color); - ColorInfo ci = excelColor2UOF(hc); - return ci; - } - return null; - } - - /** - * excel(包含97和2007)中颜色转化为uof颜色 - * - * @param color 颜色序号 - * @return 颜色或者null - */ - private static ColorInfo excelColor2UOF(Color color) { - if (color == null) { - return null; - } - ColorInfo ci = null; - if (color instanceof XSSFColor) {// .xlsx - XSSFColor xc = (XSSFColor) color; - byte[] b = xc.getRGB(); - if (b != null) {// 一定是argb - ci = ColorInfo.fromARGB(b[0], b[1], b[2], b[3]); - } - } else if (color instanceof HSSFColor) {// .xls - HSSFColor hc = (HSSFColor) color; - short[] s = hc.getTriplet();// 一定是rgb - if (s != null) { - ci = ColorInfo.fromARGB(s[0], s[1], s[2]); - } - } - return ci; - } - - /** - * 复制原有sheet的合并单元格到新创建的sheet - * - * @param sheetCreat 新创建sheet - * @param sheet 原有的sheet - */ - public static void MergerRegion(Sheet sheetCreat, Sheet sheet) { - int sheetMergerCount = sheet.getNumMergedRegions(); - for (int i = 0; i < sheetMergerCount; i++) { - CellRangeAddress mergedRegionAt = sheet.getMergedRegion(i); - sheetCreat.addMergedRegion(mergedRegionAt); - } - } - - /** - * 去除字符串内部空格 - */ - public static String removeInternalBlank(String s) { - Pattern p = Pattern.compile(""); - Matcher m = p.matcher(s); - char str[] = s.toCharArray(); - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < str.length; i++) { - if (str[i] == ' ') { - sb.append(' '); - } else { - break; - } - } - String after = m.replaceAll(""); - return sb.toString() + after; - } - - public String getUserNamesByUserIds(String userIds) { - userIds = userIds.replace(",", "','"); - String userNames = ""; - List users = this.userService.selectListByWhere("where id in ('" + userIds + "')"); - for (User item : users) { - if (userNames != "") { - userNames += ","; - } - userNames += item.getCaption(); - } - return userNames; - } - - @Override - public int save4Job(String rptInfoSetId, String rptdt) throws XmlPullParserException, NoSuchAlgorithmException, InvalidKeyException, IOException { - if (rptInfoSetId != null && !rptInfoSetId.equals("")) { - RptInfoSet rptInfoSet = this.rptInfoSetService.selectById(rptInfoSetId); - if (rptInfoSet != null) { - RptCreate rptCreate = new RptCreate(); - rptCreate.setRptdt(rptdt); - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Day)) { - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 10)); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + rptCreate.getRptdt().substring(5, 7) + "月" + rptCreate.getRptdt().substring(8, 10) + "日)"); - } - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Month)) { - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 7) + "-01"); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年" + rptCreate.getRptdt().substring(5, 7) + "月)"); - } - if (rptInfoSet.getRpttype().equals(RptInfoSet.RptType_Year)) { - rptCreate.setRptdt(rptCreate.getRptdt().substring(0, 4) + "-01-01"); - rptCreate.setRptname(rptInfoSet.getName() + "(" + rptCreate.getRptdt().substring(0, 4) + "年)"); - } - - /** - * 查询报表的晚班作为报表的负责人 1111 - */ - String userId = "emp01"; -// if (rptInfoSet.getUnitId().equals("021THZS") && rptInfoSet.getRpttype().equals("sp_report_day_01")) { -// String sql = "where pid ='" + rptInfoSet.getId() + "' and type = '" + RptSpSet.RptSpSet_Type_Confirm + "'"; -// List list_set = rptSpSetService.selectListByWhere(sql); -// if (list_set != null && list_set.size() > 0) { -// String grouptypeId = list_set.get(0).getGrouptypeId(); -// String grouptimeId = list_set.get(0).getGrouptimeId(); -// String nowTime = CommUtil.differenceDate(-1); -// String sql_scheduling = " where bizid='" + rptInfoSet.getUnitId() + "' and DateDiff(dd,stdt,'" + nowTime + "')=0 and schedulingtype='" + grouptypeId + "' and groupManageid = '" + grouptimeId + "'"; -// List schedulingList = this.schedulingService.selectListByWhere(sql_scheduling); -// String userIds = ""; -// if (schedulingList != null && schedulingList.size() > 0) { -// userIds = schedulingList.get(0).getWorkpeople(); -// } -// if (userIds != null && !userIds.trim().equals("")) { -// String[] users = userIds.split(","); -// for (String id : users) { -// User user = userService.getUserById(id); -// if (user != null) { -// userId = user.getId(); -// } -// } -// } -// } -// } - - int result = 0; - rptCreate.setWhere(" where rptdt='" + rptCreate.getRptdt() + "' and unit_id='" + rptInfoSet.getUnitId() + "' and rptset_id = '" + rptInfoSetId + "'"); - List rCreates = this.rptCreateDao.selectListByWhere(rptCreate); - if (rCreates != null && rCreates.size() > 0) { - rptCreate.setUpsdt(CommUtil.nowDate()); - rptCreate.setUpsuser(userId); - rptCreate.setId(rCreates.get(0).getId()); - rptCreate.setUnitId(rptInfoSet.getUnitId()); - rptCreate.setRptsetId(rptInfoSet.getId()); - result = this.rptCreateDao.updateByPrimaryKeySelective(rptCreate); - } else { - rptCreate.setId(CommUtil.getUUID()); - rptCreate.setInsdt(CommUtil.nowDate()); - if (rptInfoSet.getUnitId().equals("021YSPZS")) {//杨树浦 - String userId_2 = "zdsc"; - rptCreate.setInsuser(userId_2); - rptCreate.setInputuser(userId_2); - rptCreate.setUpsuser(userId_2); - } else { - rptCreate.setInsuser(userId); - rptCreate.setInputuser(userId); - rptCreate.setUpsuser(userId); - } - rptCreate.setUpsdt(CommUtil.nowDate()); - rptCreate.setMemo(rptCreate.getMemo()); - rptCreate.setUnitId(rptInfoSet.getUnitId()); - rptCreate.setRptsetId(rptInfoSet.getId()); - result = this.rptCreateDao.insert(rptCreate); - } - System.out.println("执行结果" + result); - //生成excel文件 - CreateExcel(userId, rptCreate, rptInfoSet); - } - } - - return 0; - } - - public String CreateExcel(String userId, RptCreate rptCreate, RptInfoSet rptInfoSet) { -// String tbName = "tb_report_RptInfoSetFile"; - String rptdt = rptCreate.getRptdt();//excel报表生成日期 -// System.out.println("rptdt==============================================================" + rptdt); - String rpttype = rptInfoSet.getRpttype();//报表类型 - String bucketName = "rptinfosetfile"; - List filelist = this.rptInfoSetFileService.selectListByWhere(" where masterid='" + rptInfoSet.getId() + "' "); - String path = ""; - try { - for (RptInfoSetFile rptInfoSetFile : filelist) { - MinioClient minioClient2 = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - String obj = minioClient2.presignedGetObject(bucketName, rptInfoSetFile.getAbspath(), 3600 * 24 * 7); - path = rptInfoSetFile.getAbspath(); - rptInfoSetFile.setAbspath(obj); - } - } catch (Exception e) { - System.out.println(e); - } - if (filelist != null && filelist.size() > 0) { - // 设定Excel文件所在路径 - String excelFileName = filelist.get(0).getAbspath(); - // 读取Excel文件内容 - HSSFWorkbook workbook = null; - FileInputStream inputStream = null; - byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path); - // 直接从本地文件创建Workbook, 从输入流创建Workbook - InputStream ins = new ByteArrayInputStream(bytes_m); - // 构建Workbook对象, 只读Workbook对象 - try { - workbook = new HSSFWorkbook(ins); - } catch (IOException e) { - e.printStackTrace(); - } - String endtype = ".xls"; - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = null; - if (endtype.equals(".xls")) { - listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - //listStyle.setWrapText(false);//不自动换行 - //listStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));//设置格式 - } - // 生成一个样式,用在表格数据 修改过的数据 - HSSFCellStyle listStyle2 = null; - if (endtype.equals(".xls")) { - listStyle2 = workbook.createCellStyle(); - // 设置这些样式 - listStyle2.setBorderBottom(BorderStyle.THIN); - listStyle2.setBorderLeft(BorderStyle.THIN); - listStyle2.setBorderRight(BorderStyle.THIN); - listStyle2.setBorderTop(BorderStyle.THIN); - listStyle2.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND); - listStyle2.setFillForegroundColor(IndexedColors.GREEN.getIndex()); - } - List rptSpSetlist = this.rptSpSetService.selectListByWhere(" where pid='" + rptInfoSet.getId() + "' and (active !='" + CommString.Active_False_CH + "' or active is null) order by morder asc"); - if (rptSpSetlist != null && rptSpSetlist.size() > 0) { - for (int s = 0; s < rptSpSetlist.size(); s++) { - String rptsdt = "";//报表起始日期 - String rptedt = "";//报表结束日期 - if (rptSpSetlist.get(s).getRptsdt() != null && !rptSpSetlist.get(s).getRptsdt().equals("")) { - if (rpttype.equals(RptInfoSet.RptType_Day)) { - rptsdt = rptdt; - rptedt = CommUtil.subplus(rptsdt, "1", "").substring(0, 10); - } - if (rpttype.equals(RptInfoSet.RptType_Month)) { - if (rptSpSetlist.get(s).getRptsdt() != null) { - try { - rptsdt = rptdt.substring(0, 7) + "-" + rptSpSetlist.get(s).getRptsdt(); - rptedt = CommUtil.subplus(rptsdt, "1", "month").substring(0, 10); - rptedt = CommUtil.subplus(rptedt, "-1", "").substring(0, 10); - } catch (Exception e) { - e.printStackTrace(); - } - } - if (rptSpSetlist.get(s).getRptedt() != null && !rptSpSetlist.get(s).getRptedt().equals("") && !rptSpSetlist.get(s).getRptedt().equals("-")) { - int sInt = Integer.parseInt(rptSpSetlist.get(s).getRptsdt()); - int eInt = Integer.parseInt(rptSpSetlist.get(s).getRptedt()); - if (sInt < eInt) { - //当月 - rptedt = rptsdt.substring(0, 7) + "-" + rptSpSetlist.get(s).getRptedt(); - } else { - //跨月 - rptedt = rptedt.substring(0, 7) + "-" + rptSpSetlist.get(s).getRptedt(); - } - } else { - //没有结束日期默认传下个月当前日期的前一天 -// rptedt = CommUtil.subplus(rptsdt, "1", "month").substring(0, 10); -// rptedt = CommUtil.subplus(rptedt + " 00:00:00", "-24", "hour").substring(0, 10); - } - } - if (rpttype.equals(RptInfoSet.RptType_Quarterly)) { - rptsdt = rptdt; - rptedt = CommUtil.subplus(rptsdt, "3", "month").substring(0, 10); - } - if (rpttype.equals(RptInfoSet.RptType_HalfYear)) { - if (Integer.parseInt(rptCreate.getRptdt().substring(5, 7)) <= 6) { - rptsdt = rptdt.substring(0, 4) + "-01-01"; - rptedt = CommUtil.subplus(rptsdt, "6", "month").substring(0, 10); - } else { - rptsdt = rptdt.substring(0, 4) + "-07-01"; - rptedt = CommUtil.subplus(rptsdt, "6", "month").substring(0, 10); - } - } - if (rpttype.equals(RptInfoSet.RptType_Year)) { - rptsdt = rptdt.substring(0, 4) + "-01-01"; - rptedt = CommUtil.subplus(rptsdt, "1", "year").substring(0, 10); - } - } - - String spname = rptSpSetlist.get(s).getSpname(); - int rownum = Integer.valueOf(rptSpSetlist.get(s).getRownum()); - int colnum = Integer.valueOf(rptSpSetlist.get(s).getColnum()); - int posx = 0; - if ("1234567890".contains(rptSpSetlist.get(s).getPosx())) { - posx = Integer.valueOf(rptSpSetlist.get(s).getPosx()); - } else { - posx = CommUtil.excelColStrToNum(rptSpSetlist.get(s).getPosx()); - } - int posy = Integer.valueOf(rptSpSetlist.get(s).getPosy()); - String writermode = rptSpSetlist.get(s).getWritermode(); - List rmslist = this.rptMpSetService.selectListByWhere(" where pid='" + rptSpSetlist.get(s).getId() + "' order by morder "); - String mpstr = ""; - if (rmslist != null && rmslist.size() > 0) { - for (int j = 0; j < rmslist.size(); j++) { - //如果为“-” - if (rmslist.get(j).getMpid() != null && rmslist.get(j).getMpid().equals("-")) { - mpstr = mpstr + "-" + ";" + "-"; - if (j != rmslist.size() - 1) { - mpstr = mpstr + "|"; - } - rptSpSetlist.get(s).set_mpstr(mpstr); - } else { - MPoint mPoint = mPointService.selectById(rptInfoSet.getUnitId(), rmslist.get(j).getMpid()); - if (mPoint != null) { - mpstr = mpstr + mPoint.getMpointcode() + ";" + rmslist.get(j).getCollectMode(); - if (j != rmslist.size() - 1) { - mpstr = mpstr + "|"; - } - rptSpSetlist.get(s).set_mpstr(mpstr); - } else { - mpstr = mpstr + rmslist.get(j).getMpid() + ";" + rmslist.get(j).getCollectMode(); - if (j != rmslist.size() - 1) { - mpstr = mpstr + "|"; - } - rptSpSetlist.get(s).set_mpstr(mpstr); - } - } - } - colnum = rmslist.size(); - } - ArrayList rpttemplist = new ArrayList(); - int endhour = 0; - if (rptSpSetlist.get(s).getEndhour().equals("-")) { - endhour = Integer.valueOf(rptSpSetlist.get(s).getStarthour()); - } else { - endhour = Integer.valueOf(rptSpSetlist.get(s).getEndhour()); - } - - if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Confirm)) { //接班人 类型 - for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 - if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { - HSSFSheet sheet = workbook.getSheetAt(ws); - HSSFRow row = sheet.getRow(posy - 1); - if (row != null) { - HSSFCell cell_d = row.getCell(posx - 1); - if (cell_d != null) { - //插入日志表 - RptLog rptLog = new RptLog(); - String sql = "where posx = '" + (posx - 1) + "' and posy = '" + (posy - 1) + "' and creat_id = '" + rptCreate.getId() + "' and sheet = '" + rptSpSetlist.get(s).getSheet() + "' and type = '" + RptSpSet.RptSpSet_Type_Confirm + "'"; - rptLog.setPosx(posx - 1 + ""); - rptLog.setPosy(posy - 1 + ""); - rptLog.setCreatId(rptCreate.getId()); - rptLog.setSheet(rptSpSetlist.get(s).getSheet()); - rptLog.setType(RptSpSet.RptSpSet_Type_Confirm); - RptLog rptl = rptLogService.selectByWhere(sql); - if (rptl != null) { - rptLog.setId(rptl.getId()); - rptLog.setStatus(rptl.getStatus()); - int res = rptLogService.update(rptLog); - cell_d.setCellStyle(listStyle); - //获取报表日期班次的值班人员 - cell_d.setCellValue(getUserName4Where(rptCreate, rptSpSetlist.get(s))); - } else { - rptLog.setId(CommUtil.getUUID()); - rptLog.setStatus(RptLog.RptLog_Status_0); - int res = rptLogService.save(rptLog); - cell_d.setCellStyle(listStyle); - //获取报表日期班次的值班人员 - cell_d.setCellValue(getUserName4Where(rptCreate, rptSpSetlist.get(s))); - } - } - } - } - } - } else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_Rptdt)) {//日期 类型 - for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 - if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { - HSSFSheet sheet = workbook.getSheetAt(ws); - HSSFRow row = sheet.getRow(posy - 1); - if (row != null) { - HSSFCell cell_d = row.getCell(posx - 1); - if (cell_d != null) { - try { - cell_d.setCellStyle(cell_d.getCellStyle()); - if (rpttype.equals(RptInfoSet.RptType_Day)) { - DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); - cell_d.setCellValue(rptCreate.getRptdt()); - } - if (rpttype.equals(RptInfoSet.RptType_Month)) { - DateFormat format1 = new SimpleDateFormat("yyyy-MM"); - cell_d.setCellValue(rptCreate.getRptdt().substring(0, 7));//报表日期 - } - if (rpttype.equals(RptInfoSet.RptType_Year)) { - DateFormat format1 = new SimpleDateFormat("yyyy"); - cell_d.setCellValue(rptCreate.getRptdt().substring(0, 4));//报表日期 - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - } - } - } else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_BanZhang)) {//值班班长 类型 - for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 - if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { - HSSFSheet sheet = workbook.getSheetAt(ws); - HSSFRow row = sheet.getRow(posy - 1); - if (row != null) { - HSSFCell cell_d = row.getCell(posx - 1); - if (cell_d != null) { - //插入日志表 - RptLog rptLog = new RptLog(); - String sql = "where posx = '" + (posx - 1) + "' and posy = '" + (posy - 1) + "' and creat_id = '" + rptCreate.getId() + "' and sheet = '" + rptSpSetlist.get(s).getSheet() + "' and type = '" + RptSpSet.RptSpSet_Type_Confirm + "'"; - rptLog.setPosx(posx - 1 + ""); - rptLog.setPosy(posy - 1 + ""); - rptLog.setCreatId(rptCreate.getId()); - rptLog.setSheet(rptSpSetlist.get(s).getSheet()); - rptLog.setType(RptSpSet.RptSpSet_Type_Confirm); - RptLog rptl = rptLogService.selectByWhere(sql); - if (rptl != null) { - rptLog.setId(rptl.getId()); - rptLog.setStatus(rptl.getStatus()); - int res = rptLogService.update(rptLog); - cell_d.setCellStyle(listStyle); - //获取报表日期班次的值班人员 - cell_d.setCellValue(getUserNameBanZu(rptCreate, rptSpSetlist.get(s), "1")); - } else { - rptLog.setId(CommUtil.getUUID()); - rptLog.setStatus(RptLog.RptLog_Status_0); - int res = rptLogService.save(rptLog); - cell_d.setCellStyle(listStyle); - //获取报表日期班次的值班人员 - cell_d.setCellValue(getUserNameBanZu(rptCreate, rptSpSetlist.get(s), "1")); - } - } - } - } - } - } else if (spname != null && spname.equals(RptSpSet.RptSpSet_Type_ZuYuan)) { //值班组员 类型 - for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 - if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { - HSSFSheet sheet = workbook.getSheetAt(ws); - HSSFRow row = sheet.getRow(posy - 1); - if (row != null) { - HSSFCell cell_d = row.getCell(posx - 1); - if (cell_d != null) { - //插入日志表 - RptLog rptLog = new RptLog(); - String sql = "where posx = '" + (posx - 1) + "' and posy = '" + (posy - 1) + "' and creat_id = '" + rptCreate.getId() + "' and sheet = '" + rptSpSetlist.get(s).getSheet() + "' and type = '" + RptSpSet.RptSpSet_Type_Confirm + "'"; - rptLog.setPosx(posx - 1 + ""); - rptLog.setPosy(posy - 1 + ""); - rptLog.setCreatId(rptCreate.getId()); - rptLog.setSheet(rptSpSetlist.get(s).getSheet()); - rptLog.setType(RptSpSet.RptSpSet_Type_Confirm); - RptLog rptl = rptLogService.selectByWhere(sql); - if (rptl != null) { - rptLog.setId(rptl.getId()); - rptLog.setStatus(rptl.getStatus()); - int res = rptLogService.update(rptLog); - cell_d.setCellStyle(listStyle); - //获取报表日期班次的值班人员 - cell_d.setCellValue(getUserNameBanZu(rptCreate, rptSpSetlist.get(s), "2")); - } else { - rptLog.setId(CommUtil.getUUID()); - rptLog.setStatus(RptLog.RptLog_Status_0); - int res = rptLogService.save(rptLog); - cell_d.setCellStyle(listStyle); - //获取报表日期班次的值班人员 - cell_d.setCellValue(getUserNameBanZu(rptCreate, rptSpSetlist.get(s), "2")); - } - } - } - } - } - } else {//普通数据 类型 - rpttemplist = GetExecSp(rpttype, rptCreate.getUnitId(), spname, rptsdt, rptedt, Integer.valueOf(rptSpSetlist.get(s).getStarthour()), endhour, Integer.valueOf(rptSpSetlist.get(s).getIntv()), rptSpSetlist.get(s).get_mpstr(), rownum, colnum, posx, posy, writermode, rptSpSetlist.get(s).getIntvType()); - } - if (rpttemplist != null && rpttemplist.size() > 0) { - for (int r = 0; r < rpttemplist.size(); r++) { - for (int ws = 0; ws < workbook.getNumberOfSheets(); ws++) {//获取每个Sheet表 - if (workbook.getSheetName(ws).equals(rptSpSetlist.get(s).getSheet())) { - HSSFSheet sheet = workbook.getSheetAt(ws); - HSSFRow row = sheet.getRow(rpttemplist.get(r).getColposy() - 1); - if (row != null) { - Cell cell_d = row.getCell(rpttemplist.get(r).getColposx() - 1); - if (cell_d != null) { - HSSFCellStyle cellStyle = row.getCell(rpttemplist.get(r).getColposx() - 1).getCellStyle(); -// HSSFCellStyle cellStyle_r = row.getCell(rpttemplist.get(r).getColposx() - 1).getCellStyle(); - try { - /** - * 正常字体样式 - */ - cellStyle.cloneStyleFrom(cell_d.getCellStyle()); -// cellStyle.cloneStyleFrom(cellStyle); - //获取单元格小数位 -// System.out.println(rpttemplist.get(r).getParmvalue() + "===" + cellStyle.getDataFormatString()); - if (cellStyle.getDataFormatString() != null) { -// cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat(cellStyle.getDataFormatString().replaceAll("_", ""))); - } - - /** - * 红色字体样式 - */ -// cellStyle_r.cloneStyleFrom(cell_d.getCellStyle()); -// cellStyle_r.cloneStyleFrom(cellStyle_r); - //获取单元格小数位 - /*if (cellStyle_r.getDataFormatString() != null) { - cellStyle_r.setDataFormat(HSSFDataFormat.getBuiltinFormat(cellStyle_r.getDataFormatString().replaceAll("_", ""))); - }*/ - - // 获取原有字体 - /*Font oldFont = workbook.getFontAt(cellStyle_r.getFontIndexAsInt()); - // 创建新字体 - Font redFont = workbook.createFont(); - // 保留原字体样式 - redFont.setFontName(oldFont.getFontName()); // 保留原字体 - redFont.setFontHeightInPoints(oldFont.getFontHeightInPoints()); // 保留原字体高度 - redFont.setColor(IndexedColors.RED.getIndex()); // 字体颜色:红色*/ - - -// cellStyle_r.setFont(redFont); - -// HSSFColor xssfColor = (HSSFColor) cell_d.getCellStyle().getFillForegroundColorColor(); -// System.out.println(rpttemplist.get(r).getColposx() + "===" + rpttemplist.get(r).getColposy() + "===" + rpttemplist.get(r).getParmvalue() + "===" + xssfColor.getIndex()); -// cellStyle_r.setFillForegroundColor(xssfColor.getIndex()); -// cellStyle_r.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - /*HSSFColor xssfColor = (HSSFColor) cell_d.getCellStyle().getFillForegroundColorColor(); - System.out.println(rpttemplist.get(r).getParmvalue() + "======" + xssfColor.getIndex()); - cellStyle_r.setFillForegroundColor((short) 13); - cellStyle_r.setFillPattern(FillPatternType.SOLID_FOREGROUND);*/ - -// byte[] bytes; - /*if (xssfColor != null) { - System.out.println(rpttemplist.get(r).getParmvalue() + "======" + xssfColor.getIndex()); -// cellStyle_r.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); -// cellStyle_r.setFillForegroundColor(xssfColor.getIndex()); -// cellStyle_r.setFillPattern(FillPatternType.SOLID_FOREGROUND); - cellStyle_r.setFillForegroundColor((short) 13); - cellStyle_r.setFillPattern(FillPatternType.SOLID_FOREGROUND); - }*/ - - -// cellStyle_r.setFillForegroundColor(IndexedColors.BLUE_GREY.getIndex()); -// cellStyle_r.setFillPattern(FillPatternType.SOLID_FOREGROUND); -// System.out.println(cellStyle.getFillForegroundColorColor()); - - } catch (Exception e) { - e.printStackTrace(); - } - - -// cellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); -// cellStyle_r.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); - -// if (rpttemplist.get(r).getMpcode()!=null && rpttemplist.get(r).getMpcode().equals("date")) { - List list_mpoint = mPointService.selectListByWhere(rptCreate.getUnitId(), "where MPointCode = '" + rpttemplist.get(r).getMpcode() + "'"); - if (list_mpoint != null && list_mpoint.size() > 0) { - //去除小数点后多余的0 然后再去判断 - String sval = subZeroAndDot(rpttemplist.get(r).getParmvalue()); - if (sval.indexOf(".") != -1) { - //包含小数点 - double d1 = Double.parseDouble(rpttemplist.get(r).getParmvalue()); - BigDecimal b = new BigDecimal(d1); - double f1 = b.setScale(rpttemplist.get(r).getDecimal(), BigDecimal.ROUND_HALF_UP).doubleValue(); - - if (list_mpoint.get(0).getAlarmmax() != null && !list_mpoint.get(0).getAlarmmax().equals("")) { - if (f1 > list_mpoint.get(0).getAlarmmax().doubleValue()) { -// cell_d.setCellStyle(cellStyle_r); - cell_d.setCellStyle(cellStyle); - } - } else if (list_mpoint.get(0).getAlarmmin() != null && !list_mpoint.get(0).getAlarmmin().equals("")) { - if (f1 < list_mpoint.get(0).getAlarmmin().doubleValue()) { -// cell_d.setCellStyle(cellStyle_r); - cell_d.setCellStyle(cellStyle); - } - } else { - cell_d.setCellStyle(cellStyle); - } - //目前都截取2位 存到数据库 - cell_d.setCellValue(f1);//小数 - } else { - //不包含小数点 - if (sval != null && sval.equals("-")) { -// cell_d.setCellValue("-");//横杠 - } else if (sval != null && sval.contains(",")) { - cell_d.setCellValue(sval + "");//内容为:0,2021-01-01 - } else { - if (CommUtil.isNumeric(sval)) { - if (list_mpoint.get(0).getAlarmmax() != null && !list_mpoint.get(0).getAlarmmax().equals("")) { - if (Double.parseDouble(sval) > list_mpoint.get(0).getAlarmmax().doubleValue()) { -// cell_d.setCellStyle(cellStyle_r); - cell_d.setCellStyle(cellStyle); - } - } else if (list_mpoint.get(0).getAlarmmin() != null && !list_mpoint.get(0).getAlarmmin().equals("")) { - if (Double.parseDouble(sval) < list_mpoint.get(0).getAlarmmin().doubleValue()) { -// cell_d.setCellStyle(cellStyle_r); - cell_d.setCellStyle(cellStyle); - } - } else { - cell_d.setCellStyle(cellStyle); - } - cell_d.setCellValue(Double.parseDouble(sval));//整数 - } else { - cell_d.setCellValue(sval);//非数字 - } - } - } - //2021-11-02 sj 获取源单元格格式 赋值样式 -// cell_d.setCellStyle(cell_d.getCellStyle()); - } else { - cell_d.setCellValue(rpttemplist.get(r).getParmvalue()); - } -// } else { -// cell_d.setCellValue(rpttemplist.get(r).getParmvalue()); -// } - - - } - } else { -// System.out.println(CommUtil.nowDate() + "--------" + rpttemplist.get(r).getColposx()); - } - //设置刷新公式 -// sheet.setForceFormulaRecalculation(true); - } - } - } - - /** - * 将修改记录赋值到新生成的报表里 - */ - List list = rptLogService.selectListByWhere("where creat_id = '" + rptCreate.getId() + "'"); - for (RptLog rptLog : list) { - HSSFSheet sheet = workbook.getSheet(rptLog.getSheet()); - if (rptLog.getPosyE() != null && !rptLog.getPosyE().equals("") && sheet != null) { - HSSFRow row = sheet.getRow(Integer.parseInt(rptLog.getPosyE()) - 1); - if (row != null) { - Cell cell_d = row.getCell(Integer.parseInt(rptLog.getPosxE()) - 1); - if (cell_d != null) { - cell_d.setCellValue(rptLog.getAfterValue()); - } - } - } - } - - } - } - } - - //重新刷新所有单元格格式 - FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); - for (int i = 0; i < workbook.getNumberOfSheets(); i++) { - Sheet sheet2 = workbook.getSheetAt(i); - for (int j = 0; j < sheet2.getPhysicalNumberOfRows(); j++) { - Row row = sheet2.getRow(j); - if (row != null) { - for (int k = 0; k < row.getLastCellNum(); k++) { - if (row.getCell(k) != null && (row.getCell(k).getCellType() == FORMULA)) { - if (StringUtils.isNotBlank(row.getCell(k).getCellFormula())) { - try { -// System.out.println("属于公式----------------------" + row.getCell(k).getCellType() + "----------------------" + row.getCell(k)); - evaluator.evaluateFormulaCell(row.getCell(k)); - } catch (Exception e) { -// System.out.println("重新找公式异常" + CommUtil.nowDate() + ":" + row.getCell(k)); - } - } - } else { -// System.out.println("不属于公式----------------------" + row.getCell(k).getCellType() + "----------------------" + row.getCell(k)); - } - } - } - } - workbook.getSheetAt(i).setForceFormulaRecalculation(Boolean.TRUE); - } - - //重新计算所有的公式 - workbook.setForceFormulaRecalculation(true); - - /* - * 传到minio - */ - try { - String showname = rptCreate.getRptname() + rptCreate.getId(); - InputStream stream = null; - //获取类加载的根路径 - String file3 = SSCL.cont + "/" + showname + endtype; - // 新建一输出流 - FileOutputStream fout = null; - try { - fout = new FileOutputStream(file3); - // 存盘 - workbook.write(fout); - // 清空缓冲区 - fout.flush(); - // 结束关闭 - fout.close(); - } catch (IOException e) { - e.printStackTrace(); - } - // 参数为:图床,账号,密码 - MinioClient minioClient = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - // 检查文件夹是否已经存在 - boolean isExist = false; - try { - isExist = minioClient.bucketExists("report"); - if (isExist) { - //文件夹已经存在了 - } else { - // 创建一个名为report的文件夹 - minioClient.makeBucket("report"); - } - //参数为:文件夹,要存成的名字,要存的文件 - minioClient.putObject("report", showname + endtype, file3); - //删除文件 只保留minio中的文件 - File file = new File(file3);//根据指定的文件名创建File对象 - file.delete(); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (XmlPullParserException e) { - e.printStackTrace(); - } - } catch (MinioException e) { - e.printStackTrace(); - } - } - return null; - } - - /** - * 将小数位后面多余0去掉 - * - * @param s - * @return - */ - public static String subZeroAndDot(String s) { - if (s.indexOf(".") > 0) { - s = s.replaceAll("0+?$", "");//去掉多余的0 - s = s.replaceAll("[.]$", "");//如最后一位是.则去掉 - } - return s; - } - - /** - * @param bizid 厂id - * @param spnamestr sp名称 - * @param stimestr - * @param etimestr - * @param starthour 开始小时 - * @param endhour 结束小时 - * @param intval 时间间隔 - * @param mpstr 变量名 测量名;采集方式|测量名;采集方式| - * @param rownum 行数 - * @param colnum 列数 - * @param posx x轴 - * @param posy y轴 - * @param writermode 插入方式 横向/纵向 - * @return - */ - -// @Transactional -// @Async - public ArrayList GetExecSp(String rpttype, String bizid, String spnamestr, String stimestr, String etimestr, int starthour, int endhour, int intval, String mpstr, int rownum, int colnum, int posx, int posy, String writermode, String intvType) { - System.out.println("进入GetExecSp方法:" + CommUtil.nowDate()); - ArrayList rpttemplist = new ArrayList(); - - /*if (bizid.equals("021ZY1C")) { - spnamestr = spnamestr + "_1"; - }*/ - -// String stimestr1 = "2023-07-01"; -// String etimestr1 = "2023-07-20"; - - try { - String userid = CommUtil.getUUID(); - int code = 0; - - if (mpstr != null && !mpstr.equals("") && !mpstr.equals("null")) { - int ac_intval = intval; - int monthNum = 0; - if (intvType != null && !intvType.equals("")) { - switch (intvType) { - case RptSpSet.RptSpSet_IntvType_Hour: - ac_intval = intval;//小时类型:直接按用户输入的小时数 - monthNum = 0; - break; - case RptSpSet.RptSpSet_IntvType_Day: - ac_intval = intval * 24;//天类型:按用户输入的小时数*24 - monthNum = 0; - break; - case RptSpSet.RptSpSet_IntvType_Month: - monthNum = CommUtil.getDays(stimestr, etimestr, "month"); - break; - } - - //不跨天 - if (rpttype.equals(RptInfoSet.RptType_Day) && starthour < endhour) { - if (monthNum > 0) { - //暂时用不到 - } else { - code = this.tempReportService.execSql_ReportDay(bizid, spnamestr, stimestr, stimestr, starthour, endhour, ac_intval, mpstr, rownum, userid); - } - } - - //跨天 - if (rpttype.equals(RptInfoSet.RptType_Day) && starthour >= endhour) { - if (monthNum > 0) { - //暂时用不到 - } else { - code = this.tempReportService.execSql_ReportDay(bizid, spnamestr, stimestr, etimestr, starthour, endhour, ac_intval, mpstr, rownum, userid); - } - } - - //月报 - if (rpttype.equals(RptInfoSet.RptType_Month)) { - if (monthNum > 0) { - //如果是多个月先将间隔置为0 - ac_intval = 0; - int tianshu = CommUtil.getDaysByYearMonth(Integer.parseInt(stimestr.substring(0, 4)), Integer.parseInt(stimestr.substring(5, 7))); - ac_intval = intval * 24 * tianshu; - - //将月底减少一分钟调整为月初 避免存储过程当2个月来执行 - etimestr = CommUtil.subplus(etimestr + " 00:00", -1 + "", "min"); - etimestr = etimestr.substring(0, 10); - - code = this.tempReportService.execSql_ReportMth(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } else { - int tianshu = CommUtil.getDaysByYearMonth(Integer.parseInt(stimestr.substring(0, 4)), Integer.parseInt(stimestr.substring(5, 7))); -// ac_intval = intval * 24 * tianshu; - - switch (intvType) { - case RptSpSet.RptSpSet_IntvType_Hour: - ac_intval = intval;//小时类型:直接按用户输入的小时数 - break; - case RptSpSet.RptSpSet_IntvType_Day: - ac_intval = intval * 24;//天类型:按用户输入的小时数*24 - break; - case RptSpSet.RptSpSet_IntvType_Month: - ac_intval = intval * 24 * tianshu;//月类型:按用户输入的小时数*24*当月天数 - break; - } - - code = this.tempReportService.execSql_ReportMth(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - } - - //季报 - if (rpttype.equals(RptInfoSet.RptType_Quarterly)) { - if (monthNum > 0) { - //如果是多个月先将间隔置为0 - ac_intval = 0; - int num = 3 / intval; - System.out.println("间隔=" + intval + " 行数=" + num); - List str = new ArrayList<>(); - for (int i = 1; i <= 3; i++) { - String sdt = CommUtil.subplus(stimestr, (i - 1) + "", "month").substring(0, 10); - int tianshu = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //将间隔累加 在符合条件时候置零 - ac_intval += 24 * tianshu; - //将月份放到list里 在符合条件时候置零 - str.add(sdt); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dt", str);//日期list - if (i % intval == 0) { - JSONArray json = (JSONArray) JSON.toJSON(jsonObject.get("dt")); - if (json != null) { - String edt = CommUtil.subplus(json.get(json.size() - 1).toString(), "1", "month").substring(0, 10); - edt = CommUtil.subplus(edt + " 00:00", "-1", "day").substring(0, 10); - code = this.tempReportService.execSql_ReportQua(bizid, spnamestr, json.get(0).toString(), edt, starthour, ac_intval, mpstr, rownum, userid); - str.clear(); - ac_intval = 0; - } - } - } - } else { - code = this.tempReportService.execSql_ReportQua(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - } - - //半年报 - if (rpttype.equals(RptInfoSet.RptType_HalfYear)) { - if (monthNum > 0) { - //如果是多个月先将间隔置为0 - ac_intval = 0; - int num = 3 / intval; - System.out.println("间隔=" + intval + " 行数=" + num); - List str = new ArrayList<>(); - for (int i = 1; i <= 6; i++) { - String sdt = CommUtil.subplus(stimestr, (i - 1) + "", "month").substring(0, 10); - int tianshu = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //将间隔累加 在符合条件时候置零 - ac_intval += 24 * tianshu; - //将月份放到list里 在符合条件时候置零 - str.add(sdt); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dt", str);//日期list - if (i % intval == 0) { - JSONArray json = (JSONArray) JSON.toJSON(jsonObject.get("dt")); - if (json != null) { - String edt = CommUtil.subplus(json.get(json.size() - 1).toString(), "1", "month").substring(0, 10); - edt = CommUtil.subplus(edt + " 00:00", "-1", "day").substring(0, 10); - code = this.tempReportService.execSql_ReportHalfYear(bizid, spnamestr, json.get(0).toString(), edt, starthour, ac_intval, mpstr, rownum, userid); - str.clear(); - ac_intval = 0; - } - } - } - } else { - code = this.tempReportService.execSql_ReportHalfYear(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - } - - //年报 - if (rpttype.equals(RptInfoSet.RptType_Year)) { - - if (monthNum > 0) { - //如果是多个月先将间隔置为0 - ac_intval = 0; - int num = 3 / intval; - System.out.println("间隔=" + intval + " 行数=" + num); - List str = new ArrayList<>(); - for (int i = 1; i <= 12; i++) { - String sdt = CommUtil.subplus(stimestr, (i - 1) + "", "month").substring(0, 10); - int tianshu = CommUtil.getDaysByYearMonth(Integer.parseInt(sdt.substring(0, 4)), Integer.parseInt(sdt.substring(5, 7))); - //将间隔累加 在符合条件时候置零 - ac_intval += 24 * tianshu; - //将月份放到list里 在符合条件时候置零 - str.add(sdt); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("dt", str);//日期list - if (i % intval == 0) { - JSONArray json = (JSONArray) JSON.toJSON(jsonObject.get("dt")); - if (json != null) { - String edt = CommUtil.subplus(json.get(json.size() - 1).toString(), "1", "month").substring(0, 10); - edt = CommUtil.subplus(edt + " 00:00", "-1", "day").substring(0, 10); - code = this.tempReportService.execSql_ReportYear(bizid, spnamestr, json.get(0).toString(), edt, starthour, ac_intval, mpstr, rownum, userid); - str.clear(); - ac_intval = 0; - } - } - } - } else { - code = this.tempReportService.execSql_ReportYear(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - } - - } else { - //intvType字段是后加的 之前的项目有些没有配置 intvType - - //不跨天 - if (rpttype.equals(RptInfoSet.RptType_Day) && starthour < endhour) { - code = this.tempReportService.execSql_ReportDay(bizid, spnamestr, stimestr, stimestr, starthour, endhour, ac_intval, mpstr, rownum, userid); - } - - //跨天 - if (rpttype.equals(RptInfoSet.RptType_Day) && starthour >= endhour) { - code = this.tempReportService.execSql_ReportDay(bizid, spnamestr, stimestr, etimestr, starthour, endhour, ac_intval, mpstr, rownum, userid); - } - - //月报 - if (rpttype.equals(RptInfoSet.RptType_Month)) { - code = this.tempReportService.execSql_ReportMth(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - - //季报 - if (rpttype.equals(RptInfoSet.RptType_Quarterly)) { - code = this.tempReportService.execSql_ReportQua(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - - //半年报 - if (rpttype.equals(RptInfoSet.RptType_HalfYear)) { - code = this.tempReportService.execSql_ReportHalfYear(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - - //年报 - if (rpttype.equals(RptInfoSet.RptType_Year)) { - code = this.tempReportService.execSql_ReportYear(bizid, spnamestr, stimestr, etimestr, starthour, ac_intval, mpstr, rownum, userid); - } - } - } - - code = 0;//岳麓现场返回1 暂时置为0 待修改 - if (code == 0) { - List tList = this.tempReportService.selectListByWhere(bizid, " where userid= '" + userid + "' order by ItemID asc"); - int count = 0; - int posxtemp = 0; - int posytemp = 0; - if (tList != null && tList.size() > 0) { - for (int i = 0; i < tList.size(); i++) { - RptTemp rpttemp = new RptTemp(); - rpttemp.setItemid(Integer.parseInt(tList.get(i).getItemid().toString())); - rpttemp.setParmvalue(tList.get(i).getParmvalue().toString()); - rpttemp.setMeasuredt(tList.get(i).getMeasuredt().toString()); - rpttemp.setFormatType(tList.get(i).getFormattype().toString()); - rpttemp.setDecimal(tList.get(i).getDecimal()); - rpttemp.setMpcode(tList.get(i).getMpcode()); - if (writermode.equals(RptSpSet.RptSpSet_Writermode_Horizontal)) { - if (count % colnum > 0) { - posxtemp = posx + count % colnum; - } else { - posxtemp = posx; - posytemp = posy + count / colnum; - } - } else { - if (count % rownum > 0) { - posytemp = posy + count % rownum; - } else { - posxtemp = posx + count / rownum; - posytemp = posy; - } - } - rpttemp.setColposx(posxtemp); - rpttemp.setColposy(posytemp); - rpttemplist.add(rpttemp); - count++; - } - //删除对应的临时表数据 - this.tempReportService.deleteListByWhere(bizid, spnamestr, "where userid = '" + userid + "'"); - } - } - return rpttemplist; - } catch (Exception e) { - e.printStackTrace(); - } - return rpttemplist; - } - - /** - * 根据条件获取接班人员名字 - * - * @param rptCreate - * @param rptSpSet - * @return - */ - public String getUserName4Where(RptCreate rptCreate, RptSpSet rptSpSet) { - String nowTime = rptCreate.getRptdt(); - if (rptSpSet.getIntv() != null && !rptSpSet.getIntv().equals("")) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - try { - Date dt1 = df.parse(nowTime); - Calendar calendar = new GregorianCalendar(); - if (rptSpSet.getIntv().equals("-1")) { - calendar.setTime(dt1); - calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动 - dt1 = calendar.getTime(); //这个时间就是日期往后推一天的结果 - nowTime = df.format(dt1); - } - if (rptSpSet.getIntv().equals("0")) { - - } - if (rptSpSet.getIntv().equals("1")) { - calendar.setTime(dt1); - calendar.add(calendar.DATE, +1);//把日期往后增加一天.整数往后推,负数往前移动 - dt1 = calendar.getTime(); //这个时间就是日期往后推一天的结果 - nowTime = df.format(dt1); - } - } catch (ParseException e) { - e.printStackTrace(); - } - } - - String sql_scheduling = " where bizid='" + rptCreate.getUnitId() + "' and DateDiff(dd,stdt,'" + nowTime + "')=0 and schedulingtype='" + rptSpSet.getGrouptypeId() + "' and groupManageid = '" + rptSpSet.getGrouptimeId() + "'"; - List schedulingList = this.schedulingService.selectListByWhere(sql_scheduling); - String userIds = ""; - String userNames = ""; - if (schedulingList != null && schedulingList.size() > 0) { - if (schedulingList.get(0).getSucceeduser() != null && !schedulingList.get(0).getSucceeduser().equals("")) { - //先获取接班人员 - userIds = schedulingList.get(0).getSucceeduser(); - } else { - //没有接班人员再获取值班人员 - userIds = schedulingList.get(0).getWorkpeople(); - } - } - if (userIds != null && !userIds.trim().equals("")) { - String[] users = userIds.split(","); - for (String id : users) { - User user = userService.getUserById(id); - if (user != null) { - userNames += user.getCaption() + ","; - } - } - userNames = userNames.substring(0, userNames.length() - 1); - } - return userNames; - } - - /** - * 根据条件获取值班班长名字 - * - * @param rptCreate - * @param rptSpSet - * @param type 1是获取值班班长 2是获取值班组员 - * @return - */ - public String getUserNameBanZu(RptCreate rptCreate, RptSpSet rptSpSet, String type) { - String nowTime = rptCreate.getRptdt(); - if (rptSpSet.getIntv() != null && !rptSpSet.getIntv().equals("")) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - try { - Date dt1 = df.parse(nowTime); - Calendar calendar = new GregorianCalendar(); - if (rptSpSet.getIntv().equals("-1")) { - calendar.setTime(dt1); - calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动 - dt1 = calendar.getTime(); //这个时间就是日期往后推一天的结果 - nowTime = df.format(dt1); - } - if (rptSpSet.getIntv().equals("0")) { - - } - if (rptSpSet.getIntv().equals("1")) { - calendar.setTime(dt1); - calendar.add(calendar.DATE, +1);//把日期往后增加一天.整数往后推,负数往前移动 - dt1 = calendar.getTime(); //这个时间就是日期往后推一天的结果 - nowTime = df.format(dt1); - } - } catch (ParseException e) { - e.printStackTrace(); - } - } - - String sql_scheduling = " where bizid='" + rptCreate.getUnitId() + "' and DateDiff(dd,stdt,'" + nowTime + "')=0 and schedulingtype='" + rptSpSet.getGrouptypeId() + "' and groupManageid = '" + rptSpSet.getGrouptimeId() + "'"; - List schedulingList = this.schedulingService.selectListByWhere(sql_scheduling); - String userIds = ""; - String userNames = ""; - if (schedulingList != null && schedulingList.size() > 0) { - if (type.equals("1")) {//班长 - GroupDetail groupDetail = groupDetailService.selectById(schedulingList.get(0).getGroupdetailId()); - if (groupDetail != null) { - userIds = groupDetail.getLeader(); - } - } - if (type.equals("2")) {//组员 - userIds = schedulingList.get(0).getWorkpeople(); - } - } - if (userIds != null && !userIds.trim().equals("")) { - String[] users = userIds.split(","); - for (String id : users) { - User user = userService.getUserById(id); - if (user != null) { - userNames += user.getCaption() + ","; - } - } - userNames = userNames.substring(0, userNames.length() - 1); - } - return userNames; - } - - - /** - * 判断公式是否属于日期 - * - * @param cell - * @return - */ - public Object getCellFormatValue(Cell cell) { - - Object cellValue = null; - if (cell == null) { - return ""; - } - - //cell 类型 - CellType cellType = cell.getCellType(); - //公式类型处理 - if (cellType == FORMULA) { - //获取公式结果的cell类型 - cellType = cell.getCachedFormulaResultType(); - } - // 判断cell类型 - switch (cellType) { - //数字类型 - case NUMERIC: { - //如果为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - Date date = cell.getDateCellValue(); - //日期格式format - cellValue = new SimpleDateFormat("yyyy-MM-dd").format(date); - return cellValue; - } - //保留小数位format - cellValue = new DecimalFormat("#").format(cell.getNumericCellValue()); - break; - } - //字符串类型 - case STRING: { - cellValue = cell.getRichStringCellValue().getString(); - break; - } - case ERROR: { - cellValue = ""; - break; - } - default: - cellValue = ""; - } - return cellValue; - } - - /** - * 获取单元格的 合并单元格范围 - * - * @param sheet - * @param row - * @param column - * @return - */ - private ReportResult isMergedRegion(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - for (int i = 0; i < sheetMergeCount; i++) { - CellRangeAddress range = sheet.getMergedRegion(i); - int firstColumn = range.getFirstColumn(); - int lastColumn = range.getLastColumn(); - int firstRow = range.getFirstRow(); - int lastRow = range.getLastRow(); - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - return new ReportResult(true, firstRow + 1, lastRow + 1, firstColumn + 1, lastColumn + 1); - } - } - } - return new ReportResult(false, 0, 0, 0, 0); - } - - /** - * 判断是否合并单元格 - * - * @param sheet - * @param row - * @param column - * @return - */ - private Boolean isMergedRegion2(Sheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - for (int i = 0; i < sheetMergeCount; i++) { - CellRangeAddress range = sheet.getMergedRegion(i); - int firstColumn = range.getFirstColumn(); - int lastColumn = range.getLastColumn(); - int firstRow = range.getFirstRow(); - int lastRow = range.getLastRow(); - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - return true; - } - } - } - return false; - } - -} diff --git a/src/com/sipai/service/report/impl/RptDayLogServiceImpl.java b/src/com/sipai/service/report/impl/RptDayLogServiceImpl.java deleted file mode 100644 index 82108afd..00000000 --- a/src/com/sipai/service/report/impl/RptDayLogServiceImpl.java +++ /dev/null @@ -1,881 +0,0 @@ -package com.sipai.service.report.impl; - -import com.sipai.dao.report.RptDayLogDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.msg.MsgType; -import com.sipai.entity.report.RptDayLog; -import com.sipai.entity.report.RptDayValSet; -import com.sipai.entity.report.RptDeptSet; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointExpand; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.service.msg.MsgService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.msg.MsgTypeService; -import com.sipai.service.report.RptDayLogService; -import com.sipai.service.report.RptDayValSetService; -import com.sipai.service.report.RptDeptSetService; -import com.sipai.service.scada.MPointExpandService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Properties; - -import static org.apache.poi.ss.usermodel.CellType.STRING; - -@Service -public class RptDayLogServiceImpl implements RptDayLogService { - @Resource - private RptDayLogDao rptDayLogDao; - @Resource - private RptDayValSetService rptDayValSetService; - @Resource - private RptDeptSetService rptDeptSetService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private UserService userService; - @Resource - private MsgService msgService; - @Resource - private MsgTypeService msgtypeService; - @Resource - private MPointExpandService mPointExpandService; - - @Override - public RptDayLog selectById(String id) { - RptDayLog rptDayLog =this.rptDayLogDao.selectByPrimaryKey(id); - if(rptDayLog!=null){ - if(rptDayLog.getCheckuser()!=null && !rptDayLog.getCheckuser().isEmpty()){ - rptDayLog.set_checkuser(this.userService.getUserById(rptDayLog.getCheckuser())); - } - rptDayLog.setUser(this.userService.getUserById(rptDayLog.getInsuser())); - } - return rptDayLog; - } - -// @Transactional - @Override - public int deleteById(String id) { - RptDayLog rptDayLog = this.rptDayLogDao.selectByPrimaryKey(id); - ArrayList MPointList = this.selectMPointList(rptDayLog.getUnitId(),rptDayLog.getRptdeptId()); - rptDayLog.setmPointList(MPointList); - for (int i = 0; i < MPointList.size(); i++) { - this.mPointHistoryService.deleteByTableAWhere(rptDayLog.getUnitId(), "TB_MP_"+MPointList.get(i).getMpointcode() - , " where MeasureDT = '"+rptDayLog.getRptdt()+"'"); - } - int code = this.rptDayLogDao.deleteByPrimaryKey(id); - return code; - } - /* - * 截取时间 - * */ - public String splitRptdt(String dateType, String rptdt) { - switch (dateType) { - case "I": - rptdt = rptdt.substring(0, 16)+":00"; - break; - case "H": - rptdt = rptdt.substring(0, 13)+":00"; - break; - case "D": - rptdt = rptdt.substring(0, 10); - break; - case "M": - rptdt = rptdt.substring(0, 7); - break; - case "Y": - rptdt = rptdt.substring(0, 4); - break; - default: - rptdt = rptdt.substring(0, 19); - } - return rptdt; - } - /* - * 拼接时间 - * */ - public String splicingRptdt(String dateType, String rptdt) { - switch (dateType) { - case "I": - rptdt = rptdt.substring(0, 16)+":00"; - break; - case "H": - rptdt = rptdt.substring(0, 13)+":00:00"; - break; - case "D": - rptdt = rptdt.substring(0, 10)+" 00:00:00"; - break; - case "M": - rptdt = rptdt.substring(0, 7)+"-01 00:00:00"; - break; - case "Y": - rptdt = rptdt.substring(0, 4)+"-01-01 00:00:00"; - break; - default: - rptdt = rptdt.substring(0, 19); - } - return rptdt; - } - @Override - public ArrayList selectMPointList(String unitId, String rptdeptId) { - List rptDayValSetList = this.rptDayValSetService.selectListByWhere(" where pid = '"+rptdeptId+"' order by morder"); - - ArrayList MPointList = new ArrayList<>(); - if(rptDayValSetList!=null&&rptDayValSetList.size()>0){ - for (int i = 0; i < rptDayValSetList.size(); i++) { - MPoint mPoint = rptDayValSetList.get(i).getmPoint(); - if(mPoint!=null){ - if(rptDayValSetList.get(i).getmPoint2()!=null){ - mPoint.setParmvalue(rptDayValSetList.get(i).getmPoint2().getParmvalue()); - } -// MPoint mPoint = this.mPointService.selectById(unitId, rptDayValSetList.get(i).getMpid());优化查询性能 - - //把mpid2 赋值给 mpointid - mPoint.setMpointid(rptDayValSetList.get(i).getMpid2()); - mPoint.setTimeType(rptDayValSetList.get(i).getTimeType()); - mPoint.setOffset(rptDayValSetList.get(i).getOffset()); - MPointList.add(mPoint); - } - } - } - return MPointList; - } - - @Override - public JSONObject getJson(String id, String rptdeptId, - String rptdt, String userId) throws IOException { - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - RptDayLog rptDayLog = this.selectById(id); - rptdt = rptdt==null?this.splitRptdt(rptDeptSet.getDateType(),rptDayLog.getRptdt()):this.splitRptdt(rptDeptSet.getDateType(),rptdt); - String unitId = rptDeptSet.getUnitId(); - - //主表记录 - JSONObject jsonObject = new JSONObject(); - if (id==null) { - jsonObject.put("id", ""); - jsonObject.put("rptdeptId", rptdeptId); - jsonObject.put("rptdt", rptdt); - jsonObject.put("unitId", unitId); - jsonObject.put("type", rptDeptSet.getDateType()); - jsonObject.put("others", ""); - jsonObject.put("memo", ""); - jsonObject.put("reviewComments", ""); - jsonObject.put("status", "未提交"); - jsonObject.put("user", this.userService.getUserById(userId)); - }else { - jsonObject.put("id", rptDayLog.getId()); - jsonObject.put("rptdeptId", rptDayLog.getRptdeptId()); - jsonObject.put("rptdt", rptdt); - jsonObject.put("unitId", rptDayLog.getUnitId()); - jsonObject.put("type", rptDeptSet.getDateType()); - jsonObject.put("memo", rptDayLog.getMemo()); - jsonObject.put("others", rptDayLog.getOthers()); - jsonObject.put("reviewComments", rptDayLog.getReviewComments()); - jsonObject.put("status", rptDayLog.getStatus()); - jsonObject.put("user", this.userService.getUserById(rptDayLog.getInsuser())); - jsonObject.put("checkuser", rptDayLog.get_checkuser()); - } - //读取配置文件 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //偏移类型默认读取配置文件 - String timeType_properties = properties.getProperty("timeType"); - String offset_properties = properties.getProperty("offset"); - String dateType_properties = properties.getProperty("dateType"); - if(offset_properties==null || "".equals(offset_properties)){ - offset_properties = "0"; - } - if(timeType_properties ==null || "".equals(timeType_properties)){ - timeType_properties = "hour"; - } - if(dateType_properties == null || "".equals(dateType_properties)) { - dateType_properties = "I,H,D,M,Y"; - } - String timeType = timeType_properties; - String offset = offset_properties; - - rptdt = this.splicingRptdt(rptDeptSet.getDateType(),rptdt); - //测量点 - //记录录入时间 - String rptdtOld = rptdt; - //测量点 - ArrayList MPointList = this.selectMPointList(unitId,rptdeptId); - JSONArray mPointList = new JSONArray(); - JSONArray mPointHistoryList = new JSONArray(); - for (int i = 0; i < MPointList.size(); i++) { - rptdt = rptdtOld; - timeType = timeType_properties; - offset = offset_properties; - MPoint mPointjson = (MPoint) MPointList.get(i); - if(mPointjson.getOffset()!=null && - !"".equals(mPointjson.getOffset().toString()) - ){ - offset = mPointjson.getOffset().toString(); - } - if(mPointjson.getTimeType()!=null && - !"".equals(mPointjson.getTimeType().toString())){ - timeType = mPointjson.getTimeType().toString(); - } - //偏移量为空或0时,不偏移 - if(!"0".equals(offset)){ - // 存在包含关系 - if(dateType_properties.indexOf(rptDeptSet.getDateType())!=-1) { - rptdt = CommUtil.subplus(rptdtOld,offset,timeType); - } - } - JSONObject mPoint = new JSONObject(); -// mPoint.put("mpointcode", MPointList.get(i).getMpointcode()); - mPoint.put("mpointcode", MPointList.get(i).getId()); - mPoint.put("mpointcode2", MPointList.get(i).getMpointid()); - mPoint.put("parmname", MPointList.get(i).getParmname()); - mPoint.put("lastvalue", MPointList.get(i).getParmvalue()); - mPoint.put("measuredt", MPointList.get(i).getMeasuredt()); - mPoint.put("alarmmin", MPointList.get(i).getAlarmmin()); - mPoint.put("alarmmax", MPointList.get(i).getAlarmmax()); - mPoint.put("forcemin", MPointList.get(i).getForcemin()); - mPoint.put("forcemax", MPointList.get(i).getForcemax()); - mPoint.put("timeType", MPointList.get(i).getTimeType()); - mPoint.put("offset", MPointList.get(i).getOffset()); - mPoint.put("visible", false); - mPoint.put("content", ""); - mPoint.put("NumTail", MPointList.get(i).getNumtail()); - mPoint.put("Unit", MPointList.get(i).getUnit()); - //中文含义选择框 - String valuemeaning = MPointList.get(i).getValuemeaning()==null?"":MPointList.get(i).getValuemeaning(); - String[] split = valuemeaning.split(","); - if (split.length==2) { - JSONArray jsonArray = new JSONArray(); - String[] mingcheng = split[0].split("/"); - String[] zhi = split[1].split("/"); - for (int j = 0; j < mingcheng.length; j++) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("mingcheng", mingcheng[j]); - jsonObject2.put("zhi", zhi[j]); - jsonArray.add(jsonObject2); - } - mPoint.put("valuemeaningArray", jsonArray); - mPoint.put("valuemeaningFlag", true); - }else { - mPoint.put("valuemeaningFlag", false); - } - //历史值 - JSONObject mPointHistoryJson = new JSONObject(); - List mPointHistory = this.mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_"+MPointList.get(i).getMpointcode() - , " where CONVERT(VARCHAR(20),[MeasureDT],20) like '%"+rptdt+"%' order by MeasureDT"); - if (mPointHistory.size()==0||id==null) { - mPoint.put("parmvalue", ""); - mPointHistoryJson.put("parmvalue", ""); - }else { - mPoint.put("parmvalue", mPointHistory.get(0).getParmvalue()); - mPointHistoryJson.put("parmvalue", mPointHistory.get(0).getParmvalue()); - } - - //拓展字段 - List list = mPointExpandService.selectListByWhere(unitId, "where measure_point_id = '" + MPointList.get(i).getId() + "'"); - if(list!=null && list.size()>0){ - mPoint.put("explain", list.get(0).getExplain()); - }else{ - mPoint.put("explain", ""); - } - - mPointList.add(mPoint); - mPointHistoryList.add(mPointHistoryJson); - } - - jsonObject.put("mPointList", mPointList); - jsonObject.put("mPointHistoryList", mPointHistoryList); - return jsonObject; - } - - //新增修改通用 -// @Transactional - @Override - public int savejson(JSONObject jsonObject, String userId) throws IOException { - String id = (String)jsonObject.get("id"); - String rptdt = (String)jsonObject.get("rptdt"); - String unitId = (String)jsonObject.get("unitId"); - JSONArray mPointList = (JSONArray)jsonObject.get("mPointList"); - JSONArray mPointHistoryList = (JSONArray)jsonObject.get("mPointHistoryList"); - RptDayLog item = this.rptDayLogDao.selectByPrimaryKey(id); - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById((String)jsonObject.get("rptdeptId")); - rptdt = this.splicingRptdt(rptDeptSet.getDateType(),rptdt); - String status = jsonObject.get("status").toString(); - boolean msgSt = false; - String msgContent = ""; - String sendUserId = ""; - String receiveUserIds = ""; - if (item==null) {//新增主表记录 - RptDayLog rptDayLog = new RptDayLog(); - rptDayLog.setId(id); - rptDayLog.setRptdeptId((String)jsonObject.get("rptdeptId")); - rptDayLog.setRptdt(rptdt); - rptDayLog.setUnitId(unitId); - rptDayLog.setInsuser(userId); - rptDayLog.setInsdt(CommUtil.nowDate()); - rptDayLog.setStatus("未提交"); - rptDayLog.setOthers((String)jsonObject.get("others")); - rptDayLog.setMemo((String)jsonObject.get("memo")); - int code = this.rptDayLogDao.insert(rptDayLog); - if(code!=1){ - throw new RuntimeException(); - } - }else {//修改主表记录 - item.setRptdt(rptdt); - item.setUpsuser(userId); - item.setUpsdt(CommUtil.nowDate()); - item.setOthers((String)jsonObject.get("others")); - item.setMemo((String)jsonObject.get("memo")); - item.setReviewComments((String)jsonObject.get("reviewComments")); - item.setStatus(status); - if(status!=null && !status.isEmpty()){ - if("已审核".equals(status) || "已退回".equals(status) ){ - item.setCheckdt(CommUtil.nowDate()); - item.setCheckuser(userId); - msgSt = true; - sendUserId = userId; - receiveUserIds = item.getInsuser(); -// userService.getUserById(item.getCheckuser()); -// msgContent = item.get_checkuser().getCaption()+status+"“"+rptDeptSet.getName()+"”填报内容,请注意查收。"; - msgContent = userService.getUserById(item.getCheckuser()).getCaption()+status+"“"+rptDeptSet.getName()+"”填报内容,请注意查收。"; - } - if("待审核".equals(status) ){ - msgSt = true; - sendUserId = userId; - receiveUserIds = rptDeptSet.getCheckuser(); - msgContent = item.getUser().getCaption()+"申请进行“"+rptDeptSet.getName()+"”填报内容审核,请及时处理。"; - } - } - int code = this.rptDayLogDao.updateByPrimaryKeySelective(item); - if(code!=1){ - throw new RuntimeException(); - } - } - //读取配置文件 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //偏移类型默认读取配置文件 - String timeType_properties = properties.getProperty("timeType"); - String offset_properties = properties.getProperty("offset"); - String dateType_properties = properties.getProperty("dateType"); - if(offset_properties==null || "".equals(offset_properties)){ - offset_properties = "0"; - } - if(timeType_properties ==null || "".equals(timeType_properties)){ - timeType_properties = "hour"; - } - if(dateType_properties == null || "".equals(dateType_properties)) { - dateType_properties = "I,H,D,M,Y"; - } - String timeType = timeType_properties; - String offset = offset_properties; - //测量点 - //记录录入时间 - String rptdtOld = rptdt; - for (int i = 0; i < mPointList.size(); i++) { - rptdt = rptdtOld; - timeType = timeType_properties; - offset = offset_properties; - JSONObject mPointjson = (JSONObject)mPointList.get(i); - String mpointcode = (String)mPointjson.get("mpointcode"); - JSONObject mPointHistoryjson = (JSONObject)mPointHistoryList.get(i); - if(mPointjson.get("offset")!=null && - !"".equals(mPointjson.get("offset").toString()) - ){ - offset = mPointjson.get("offset").toString(); - } - if(mPointjson.get("timeType")!=null && - !"".equals(mPointjson.get("timeType").toString())){ - timeType = mPointjson.get("timeType").toString(); - } - //偏移量为空或0时,不偏移 - if(!"0".equals(offset)){ - // 存在包含关系 - if(dateType_properties.indexOf(rptDeptSet.getDateType())!=-1) { - rptdt = CommUtil.subplus(rptdtOld,offset,timeType); - } - } - - if (mPointHistoryjson.get("parmvalue")!=null - && !mPointHistoryjson.get("parmvalue").equals("null") - && !mPointHistoryjson.get("parmvalue").equals("")) {//是否填写,填了新增或修改,没填删除 - MPoint mPoint1 = this.mPointService.selectById(unitId,mpointcode); - - String parmvalue = mPointHistoryjson.get("parmvalue").toString(); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(rptdt); - mPointHistory.setParmvalue(new BigDecimal(parmvalue)); - mPointHistory.setTbName("TB_MP_"+mPoint1.getMpointcode()); - mPoint1 = null; - - List mPointHistoryListFlag = this.mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_"+mpointcode - , " where MeasureDT = '"+rptdt+"'"); - if(mPointHistoryListFlag!=null&&mPointHistoryListFlag.size()>0){//修改 - this.mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - MPoint mPoint = this.mPointService.selectById(unitId, mpointcode); - mPoint.setMeasuredt(rptdt); - mPoint.setParmvalue(new BigDecimal(parmvalue)); - this.mPointService.update2(unitId, mPoint); - mPoint = null; - mPointHistory = null; - }else {//新增 - this.mPointHistoryService.save(unitId, mPointHistory); - MPoint mPoint = this.mPointService.selectById(unitId, mpointcode); - mPoint.setMeasuredt(rptdt); - mPoint.setParmvalue(new BigDecimal(parmvalue)); - this.mPointService.update2(unitId, mPoint); - mPoint = null; - mPointHistory = null; - } - - }else {//删除 - this.mPointHistoryService.deleteByTableAWhere(unitId, "TB_MP_"+mpointcode - , " where MeasureDT = '"+rptdt+"'"); - MPoint mPoint = this.mPointService.selectById(unitId, mpointcode); - mPoint.setMeasuredt(rptdt); - mPoint.setParmvalue(new BigDecimal("0")); - this.mPointService.update2(unitId, mPoint); - mPoint = null; - } - } - if(msgSt){ - String msgTypeID = rptDeptSet.getMessageType(); - if(msgTypeID!=null && !msgTypeID.isEmpty()){ - MsgType msgType =this.msgtypeService.getMsgTypeById(msgTypeID); - if(msgType!=null){ - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - msgService.insertMsgSend(msgTypeID, msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - msgType = null; - } - } - // 通知审核人员 -// String auditUserStr = (String)jsonObject.get("auditUser"); -// String type = (String)jsonObject.get("type"); -// String content = "报告!"+rptdt+"的"+DateType.getNameById(type)+"数据已填报完毕, 请首长指示"; -// this.msgService.insertMsgSend("REPORT", content, auditUserStr, userId, "U"); - //String[] auditUsers = auditUserStr.split(","); - //for(int i=0;i selectListByWhere(String wherestr) { - RptDayLog rptDayLog = new RptDayLog(); - rptDayLog.setWhere(wherestr); - List list = this.rptDayLogDao.selectListByWhere(rptDayLog); - for (RptDayLog item : list) { - item.setUser(this.userService.getUserById(item.getInsuser())); - if(item.getCheckuser()!=null && !item.getCheckuser().isEmpty()){ - item.set_checkuser(this.userService.getUserById(item.getCheckuser())); - } - } - return list; - } - public List selectListByWhere(String wherestr,String dateType) { - RptDayLog rptDayLog = new RptDayLog(); - rptDayLog.setWhere(wherestr); - List list = this.rptDayLogDao.selectListByWhere(rptDayLog); - for (RptDayLog item : list) { - if(dateType!=null && !dateType.isEmpty() - && item.getRptdt()!=null && !item.getRptdt().isEmpty()){ - item.setRptdt(this.splitRptdt(dateType,item.getRptdt())); - } - item.setUser(this.userService.getUserById(item.getInsuser())); - if(item.getCheckuser()!=null && !item.getCheckuser().isEmpty()){ - item.set_checkuser(this.userService.getUserById(item.getCheckuser())); - } - } - return list; - } - - @Override - public int update(RptDayLog rptdaylog) { - int code = this.rptDayLogDao.updateByPrimaryKeySelective(rptdaylog); - return code; - } - - @Override - public int deleteByWhere(String wherestr) { - RptDayLog rptDayLog = new RptDayLog(); - rptDayLog.setWhere(wherestr); - int code = this.rptDayLogDao.deleteByWhere(rptDayLog); - return code; - } - - @SuppressWarnings("deprecation") - @Override - public void downloadExcel(HttpServletResponse response, String unitId, - String rptdeptId) throws IOException { - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - - String fileName = rptDeptSet.getName()+"记录表"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = rptDeptSet.getName()+"记录表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - ArrayList mPointList = this.selectMPointList(unitId, rptdeptId); - sheet.setColumnWidth(0, 8000); - for (int i = 0; i < mPointList.size()+1; i++) { - sheet.setColumnWidth(i+1, 5000); - } - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - HSSFRow row0 = sheet.createRow(0); - row0.setHeight((short) 800); - for (int i = 0; i < mPointList.size()+2; i++) { - HSSFCell cell = row0.createCell(i); - cell.setCellStyle(columnNameStyle); - if(i==0){ - cell.setCellValue("日期"); - }else if (i==mPointList.size()+1) { - cell.setCellValue("备注"); - }else { - cell.setCellValue(mPointList.get(i-1).getMpointcode()); - } - } - HSSFRow row1 = sheet.createRow(1); - row1.setHeight((short) 800); - for (int i = 0; i < mPointList.size()+2; i++) { - HSSFCell cell = row1.createCell(i); - cell.setCellStyle(columnNameStyle); - if(i==0){ - cell.setCellValue("例:2020/1/1 1:00:00"); - }else if (i==mPointList.size()+1) { - }else { - cell.setCellValue(mPointList.get(i-1).getParmname()); - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } finally{ - workbook.close(); - } - } -// @Transactional - @Override - public String readXls(InputStream inputStream, String userId, String unitId, String rptdeptId) throws IOException { - try { - HSSFWorkbook workbook = new HSSFWorkbook(inputStream); - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - if(sheet==null){ - continue; - } - HSSFRow rowTitle = sheet.getRow(0); - if(rowTitle==null){ - continue; - } - ArrayList mPointList = this.selectMPointList(unitId, rptdeptId); - //检查测量点数量 - if (rowTitle.getLastCellNum() !=mPointList.size()+2) { - throw new RuntimeException("导入失败:测量点数量不匹配!"); - } - //检查测量点编号是否对应 - HSSFRow title = sheet.getRow(0); - for (int i = 0; i < mPointList.size(); i++) { - String mPointCode = getStringVal(title.getCell(i+1)); - if(!mPointCode.equals(mPointList.get(i).getMpointcode())){ - throw new RuntimeException("导入失败:测量点编号不匹配或顺序错误!"); - } - } - //录入数据 - //System.out.println("sheet.getLastRowNum():"+sheet.getLastRowNum()); - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - String rptdt = ""; -// if(HSSFDateUtil.isCellDateFormatted(row.getCell(0))) { - //增加判断时间单元格的数据类型是否正常,不正常则跳过 - CellType cellType = row.getCell(0).getCellType(); - if(cellType != STRING){ - Date d = (Date) row.getCell(0).getDateCellValue(); - if(d==null){ - continue; - } - DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - rptdt = df2.format(d); - }else{ - continue; - } -// } -// String rptdt = getStringVal(row.getCell(0)); - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - String type = ""; - rptdt = this.splicingRptdt(rptDeptSet.getDateType(),rptdt); - /*switch (rptDeptSet.getDateType()) { - case "I": - rptdt = rptdt.substring(0, 19); - type = "I"; - break; - case "H": - rptdt = rptdt.substring(0, 13)+":00:00"; - type = "H"; - break; - case "D": - rptdt = rptdt.substring(0, 10); - type = "D"; - break; - }*/ - String memo = getStringVal(row.getCell(mPointList.size()+1)); - List rptDayLogs = this.selectListByWhere("where rptdept_id = '"+rptdeptId+"' and rptdt = '"+rptdt+"' and unit_id = '"+unitId+"'"); - if (rptDayLogs!=null&&rptDayLogs.size()>0) { - RptDayLog rptDayLog = rptDayLogs.get(0); - rptDayLog.setUpsuser(userId); - rptDayLog.setUpsdt(CommUtil.nowDate()); - rptDayLog.setMemo(memo); - int update = this.rptDayLogDao.updateByPrimaryKeySelective(rptDayLog); - if (update!=1) { - throw new RuntimeException(rptdt+"修改失败,请联系管理员!"); - } - }else { - RptDayLog rptDayLog = new RptDayLog(); - rptDayLog.setId(CommUtil.getUUID()); - rptDayLog.setRptdeptId(rptdeptId); - rptDayLog.setRptdt(rptdt); - rptDayLog.setUnitId(unitId); - rptDayLog.setInsuser(userId); - rptDayLog.setInsdt(CommUtil.nowDate()); - rptDayLog.setStatus("未提交"); - rptDayLog.setMemo(memo); - int insert = this.rptDayLogDao.insert(rptDayLog); - if (insert!=1) { - throw new RuntimeException(rptdt+"新增失败,请联系管理员!"); - } - RptDeptSet rptDeptSet1 = new RptDeptSet(); - rptDeptSet1.setId(rptdeptId); - rptDeptSet1.setRemindStatus("已填报"); - rptDeptSet1.setRemindStatus(rptdt); - this.rptDeptSetService.update(rptDeptSet1); - } - - - for (int i = 0; i < mPointList.size(); i++) { - String mPointCode = mPointList.get(i).getMpointcode(); - String paramValue = getStringVal(row.getCell(1+i)); - - if(paramValue!=null&&!paramValue.equals("")){//是否填写,填了新增或修改,没填删除 - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setMeasuredt(rptdt); - mPointHistory.setParmvalue(new BigDecimal(paramValue)); - mPointHistory.setTbName("TB_MP_"+mPointCode); - - List mPointHistoryListFlag = this.mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_"+mPointCode - , " where MeasureDT = '"+rptdt+"'"); - if(mPointHistoryListFlag!=null&&mPointHistoryListFlag.size()>0){//修改 - this.mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - - }else {//新增 - this.mPointHistoryService.save(unitId, mPointHistory); - MPoint mPoint = this.mPointService.selectById(unitId, mPointCode); - mPoint.setMeasuredt(rptdt); - mPoint.setParmvalue(new BigDecimal(paramValue)); - this.mPointService.update(unitId, mPoint); - } - }else {//删除 - this.mPointHistoryService.deleteByTableAWhere(unitId, "TB_MP_"+mPointCode - , " where MeasureDT = '"+rptdt+"'"); - } - - - } - } - - - } - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(e.getMessage()); - }finally{ - inputStream.close(); - } - System.out.println("成功!"); - return "成功"; - } - @Transactional - @Override - public String readXlsx(InputStream inputStream, String userId, String unitId, String rptdeptId) { - // TODO Auto-generated method stub - return null; - } - - /** - * xls文件数据转换 - * @param cell - * @return - */ - @SuppressWarnings("deprecation") - private String getStringVal(HSSFCell cell) { - if(cell==null){ - return null; - } - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - @Override - public boolean checkRptdt(String rptdeptId, String rptdt) { - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - rptdt = this.splicingRptdt(rptDeptSet.getDateType(),rptdt); - List list = this.selectListByWhere("where rptdept_id = '"+rptdeptId+"' and rptdt = '"+rptdt+"'"); - return list.size()>0?false:true; - } - public Result dosubmit(String id, User cu, String rptdeptId){ - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - Result result = Result.success(null); - if(rptDeptSet!=null){ - boolean msgSt = false; - String msgContent = ""; - String sendUserId = ""; - String receiveUserIds = ""; - RptDayLog rptDayLog = this.selectById(id); - if("是".equals(rptDeptSet.getCheckst())){ - rptDayLog.setStatus("待审核"); - msgSt = true; - sendUserId = rptDayLog.getInsuser(); - receiveUserIds = rptDeptSet.getCheckuser(); - msgContent = rptDayLog.getUser().getCaption()+"申请进行“"+rptDeptSet.getName()+"”填报内容审核,请及时处理。"; - }else{ - rptDayLog.setStatus("已提交"); - } - rptDayLog.setUpsuser(cu.getId()); - rptDayLog.setUpsdt(CommUtil.nowDate()); - int res = this.update(rptDayLog); - if(res==1){ - result = Result.success(null); - if(msgSt){ - String msgTypeID = rptDeptSet.getMessageType(); - if(msgTypeID!=null && !msgTypeID.isEmpty()){ - MsgType msgType =this.msgtypeService.getMsgTypeById(msgTypeID); - if(msgType!=null){ - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - msgService.insertMsgSend(msgTypeID, msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - msgType = null; - } - } - }else{ - result = Result.failed("提交失败"); - } - }else{ - result = Result.failed("提交失败"); - } - return result; - } - public Result onekeyAudit(String ids ,User cu,String rptdeptId){ - RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId); - String msgTypeID = rptDeptSet.getMessageType(); - MsgType msgType = null; - MsgServiceImpl msgService = null; - if(msgTypeID!=null && !msgTypeID.isEmpty()){ - msgType = this.msgtypeService.getMsgTypeById(msgTypeID); - msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - } - String[] idArray = ids.split(","); - String msgContent = ""; - String sendUserId = ""; - String receiveUserIds = ""; - for (int i = 0; i < idArray.length; i++) { - RptDayLog rptDayLog = this.selectById(idArray[i]); - rptDayLog.setReviewComments("通过"); - rptDayLog.setStatus("已审核"); - rptDayLog.setCheckdt(CommUtil.nowDate()); - rptDayLog.setCheckuser(cu.getId()); - int res = this.update(rptDayLog); - System.out.println(idArray[i]+":"+res); - if(msgType!=null){ - sendUserId = cu.getId(); - receiveUserIds = rptDayLog.getInsuser(); - if(rptDayLog.get_checkuser()!=null && rptDayLog.get_checkuser().getCaption()!=null && rptDeptSet.getName()!=null){ - msgContent = rptDayLog.get_checkuser().getCaption()+"已审核“"+rptDeptSet.getName()+"”填报内容,请注意查收。"; - } - msgService.insertMsgSend(msgTypeID, msgContent, receiveUserIds, sendUserId, "U"); - msgService = null; - } - msgContent = ""; - sendUserId = ""; - receiveUserIds = ""; - } - msgType = null; - Result result = Result.success(1); - return result; - } - -} diff --git a/src/com/sipai/service/report/impl/RptDayValSetServiceImpl.java b/src/com/sipai/service/report/impl/RptDayValSetServiceImpl.java deleted file mode 100644 index 8b817918..00000000 --- a/src/com/sipai/service/report/impl/RptDayValSetServiceImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.report.impl; - -import com.sipai.dao.report.RptDayValSetDao; -import com.sipai.entity.report.RptDayValSet; -import com.sipai.service.report.RptDayValSetService; -import com.sipai.service.scada.MPointService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class RptDayValSetServiceImpl implements RptDayValSetService { - @Resource - private RptDayValSetDao rptDayValSetDao; - @Resource - private MPointService mPointService; - - @Override - public RptDayValSet selectById(String id) { - RptDayValSet rptDayValSet = this.rptDayValSetDao.selectByPrimaryKey(id); - return rptDayValSet; - } - - @Override - public int deleteById(String id) { - int code = this.rptDayValSetDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(RptDayValSet rptDayValSet) { - int code = this.rptDayValSetDao.insert(rptDayValSet); - return code; - } - - @Override - public int update(RptDayValSet rptDayValSet) { - int code = this.rptDayValSetDao.updateByPrimaryKeySelective(rptDayValSet); - return code; - } - - @Override - public List selectListByWhere(String wherestr){ - RptDayValSet rptDayValSet = new RptDayValSet(); - rptDayValSet.setWhere(wherestr); - List list = this.rptDayValSetDao.selectListByWhere(rptDayValSet); - for (RptDayValSet item : list) { - if (item.getMpid2()!=null&&!"".equals(item.getMpid2())) { - item.setmPoint2(this.mPointService.selectById(item.getUnitId(), item.getMpid2())); - } - item.setmPoint(this.mPointService.selectById(item.getUnitId(), item.getMpid())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptDayValSet rptDayValSet = new RptDayValSet(); - rptDayValSet.setWhere(wherestr); - int code = this.rptDayValSetDao.deleteByWhere(rptDayValSet); - return code; - } -} diff --git a/src/com/sipai/service/report/impl/RptDeptSetServiceImpl.java b/src/com/sipai/service/report/impl/RptDeptSetServiceImpl.java deleted file mode 100644 index 844d8e69..00000000 --- a/src/com/sipai/service/report/impl/RptDeptSetServiceImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.report.RptDeptSetDao; -import com.sipai.entity.report.RptDeptSet; -import com.sipai.entity.report.RptInfoSet; -import com.sipai.entity.user.Unit; -import com.sipai.service.report.RptDeptSetService; -import com.sipai.service.user.UnitService; - -import net.sf.json.JSONArray; - -@Service -public class RptDeptSetServiceImpl implements RptDeptSetService { - @Resource - private RptDeptSetDao rptDeptSetDao; - @Resource - private UnitService unitService; - - @Override - public RptDeptSet selectById(String id) { - RptDeptSet rptDeptSet = this.rptDeptSetDao.selectByPrimaryKey(id); - return rptDeptSet; - } - - @Override - public int deleteById(String id) { - int code = this.rptDeptSetDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(RptDeptSet rptDeptSet) { - int code = this.rptDeptSetDao.insert(rptDeptSet); - return code; - } - - @Override - public int update(RptDeptSet rptDeptSet) { - int code = this.rptDeptSetDao.updateByPrimaryKeySelective(rptDeptSet); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - RptDeptSet rptDeptSet = new RptDeptSet(); - rptDeptSet.setWhere(wherestr); - List list = this.rptDeptSetDao.selectListByWhere(rptDeptSet); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptDeptSet rptDeptSet = new RptDeptSet(); - rptDeptSet.setWhere(wherestr); - int code = this.rptDeptSetDao.deleteByWhere(rptDeptSet); - return code; - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list,boolean disabled) { - String text =""; - if(list_result == null ) { - list_result = new ArrayList>(); - for(RptDeptSet k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - text = k.getName(); - map.put("text", text); - map.put("pid", k.getPid()); - map.put("type", k.getType()); - if(k.getType()!=null && RptInfoSet.TYPE_CATALOGUE.equals(k.getType())){ - map.put("icon", "fa fa-list-ul"); - //是否需要目录类型不可点击 - if(disabled){ - map.put("selectable", false); - } - }else{ - map.put("icon", "fa fa-file-text-o"); - } - list_result.add(map); - } - } - getTreeList(list_result,list,disabled); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(RptDeptSet k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - text = k.getName(); - m.put("text", text); - m.put("pid", k.getPid()); - m.put("type", k.getType()); - if(k.getType()!=null && RptInfoSet.TYPE_CATALOGUE.equals(k.getType())){ - m.put("icon", "fa fa-list-ul"); - //是否需要目录类型不可点击 - if(disabled){ - m.put("selectable", false); - } - }else{ - m.put("icon", "fa fa-file-text-o"); - } - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list,disabled); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/report/impl/RptDeptSetUserServiceImpl.java b/src/com/sipai/service/report/impl/RptDeptSetUserServiceImpl.java deleted file mode 100644 index ba58ade0..00000000 --- a/src/com/sipai/service/report/impl/RptDeptSetUserServiceImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.RptDeptSetUserDao; -import com.sipai.entity.report.RptDeptSetUser; -import com.sipai.service.report.RptDeptSetUserService; - -@Service -public class RptDeptSetUserServiceImpl implements RptDeptSetUserService { - @Resource - private RptDeptSetUserDao rptDeptSetUserDao; - - @Override - public RptDeptSetUser selectById(String id) { - RptDeptSetUser rptDeptSetUser = this.rptDeptSetUserDao.selectByPrimaryKey(id); - return rptDeptSetUser; - } - - @Override - public int deleteById(String id) { - int code = this.rptDeptSetUserDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(RptDeptSetUser rptDeptSetUser) { - int code = this.rptDeptSetUserDao.insert(rptDeptSetUser); - return code; - } - - @Override - public int update(RptDeptSetUser rptDeptSetUser) { - int code = this.rptDeptSetUserDao.updateByPrimaryKeySelective(rptDeptSetUser); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - RptDeptSetUser rptDeptSetUser = new RptDeptSetUser(); - rptDeptSetUser.setWhere(wherestr); - List list = this.rptDeptSetUserDao.selectListByWhere(rptDeptSetUser); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptDeptSetUser rptDeptSetUser = new RptDeptSetUser(); - rptDeptSetUser.setWhere(wherestr); - int code = this.rptDeptSetUserDao.deleteByWhere(rptDeptSetUser); - return code; - } - -// @Override -// public List getParent(String id, List t) { -// -// List t2 = new ArrayList(); -// for(int i=0;i result =getParent(t.get(i).getPid(),t); -// if(result!=null){ -// t2.addAll(result); -// } -// } -// } -// return t2; -// } -} diff --git a/src/com/sipai/service/report/impl/RptInfoSetFileServiceImpl.java b/src/com/sipai/service/report/impl/RptInfoSetFileServiceImpl.java deleted file mode 100644 index 4c245307..00000000 --- a/src/com/sipai/service/report/impl/RptInfoSetFileServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.RptInfoSetFileDao; -import com.sipai.entity.report.RptInfoSetFile; -import com.sipai.service.report.RptInfoSetFileService; - -@Service -public class RptInfoSetFileServiceImpl implements RptInfoSetFileService{ - @Resource - private RptInfoSetFileDao rptInfoSetFileDao; - - @Override - public RptInfoSetFile selectById(String id) { - return rptInfoSetFileDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return rptInfoSetFileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RptInfoSetFile entity) { - return rptInfoSetFileDao.insert(entity); - } - - @Override - public int update(RptInfoSetFile rptInfoSet) { - return rptInfoSetFileDao.updateByPrimaryKeySelective(rptInfoSet); - } - - @Override - public List selectListByWhere(String wherestr) { - RptInfoSetFile entity = new RptInfoSetFile(); - entity.setWhere(wherestr); - List list = rptInfoSetFileDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptInfoSetFile entity = new RptInfoSetFile(); - entity.setWhere(wherestr); - return rptInfoSetFileDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/report/impl/RptInfoSetServiceImpl.java b/src/com/sipai/service/report/impl/RptInfoSetServiceImpl.java deleted file mode 100644 index f2ea834e..00000000 --- a/src/com/sipai/service/report/impl/RptInfoSetServiceImpl.java +++ /dev/null @@ -1,622 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.*; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSON; -import com.sipai.entity.user.Job; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserJob; -import com.sipai.service.user.JobService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserJobService; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.RptInfoSetDao; -import com.sipai.entity.report.RptInfoSet; -import com.sipai.service.report.RptInfoSetService; - -@Service -public class RptInfoSetServiceImpl implements RptInfoSetService { - @Resource - private RptInfoSetDao rptInfoSetDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private JobService jobService; - @Resource - private UserJobService userJobService; - - @Override - public RptInfoSet selectById(String id) { - RptInfoSet rptInfoSet = rptInfoSetDao.selectByPrimaryKey(id); - if (rptInfoSet != null) { - //可审核报表用户 - String[] checkuserIds = rptInfoSet.getCheckuser().split(","); - if (checkuserIds != null && checkuserIds.length > 0) { - String receiveUsersName = ""; - for (int u = 0; u < checkuserIds.length; u++) { - User user = this.userService.getUserById(checkuserIds[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - rptInfoSet.setCheckuserName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - //可生成报表用户 - String[] createusersIds = rptInfoSet.getCreateusers().split(","); - if (createusersIds != null && createusersIds.length > 0) { - String receiveUsersName = ""; - for (int u = 0; u < createusersIds.length; u++) { - User user = this.userService.getUserById(createusersIds[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - rptInfoSet.setCreateuserName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - //可浏览报表用户 - String[] browseusersIds = rptInfoSet.getBrowseusers().split(","); - if (browseusersIds != null && browseusersIds.length > 0) { - String receiveUsersName = ""; - for (int u = 0; u < browseusersIds.length; u++) { - User user = this.userService.getUserById(browseusersIds[u]); - if (user != null) { - receiveUsersName += user.getCaption() + ","; - } - } - if (receiveUsersName.length() > 0) { - rptInfoSet.setBrowseuserName(receiveUsersName.substring(0, receiveUsersName.length() - 1)); - } - } - if (rptInfoSet.getGeneratePosition() != null && !rptInfoSet.getGeneratePosition().isEmpty()) { - //可生成报表岗位 - List jobs = this.jobService.selectListByWhere("where id in ('" + rptInfoSet.getGeneratePosition().replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + rptInfoSet.getGeneratePosition() + ",')"); - if (jobs != null && jobs.size() > 0) { - String generatePositionName = ""; - for (int i = 0; i < jobs.size(); i++) { - generatePositionName += jobs.get(i).getName() + ","; - } - generatePositionName.substring(0, generatePositionName.length() - 1); - rptInfoSet.setGeneratePositionName(generatePositionName); - } - } - if (rptInfoSet.getBrowsePosition() != null && !rptInfoSet.getBrowsePosition().isEmpty()) { - //可浏览报表岗位 - List jobs = this.jobService.selectListByWhere("where id in ('" + rptInfoSet.getBrowsePosition().replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + rptInfoSet.getBrowsePosition() + ",')"); - if (jobs != null && jobs.size() > 0) { - String browsePositionName = ""; - for (int i = 0; i < jobs.size(); i++) { - browsePositionName += jobs.get(i).getName() + ","; - } - browsePositionName.substring(0, browsePositionName.length() - 1); - rptInfoSet.setBrowsePositionName(browsePositionName); - } - } - } - return rptInfoSet; - } - - @Override - public RptInfoSet selectById4Simple(String id) { - RptInfoSet rptInfoSet = rptInfoSetDao.selectByPrimaryKey(id); - return rptInfoSet; - } - - @Override - public int deleteById(String id) { - return rptInfoSetDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RptInfoSet entity) { - return rptInfoSetDao.insert(entity); - } - - @Override - public int update(RptInfoSet rptInfoSet) { - return rptInfoSetDao.updateByPrimaryKeySelective(rptInfoSet); - } - - @Override - public List selectListByWhere(String wherestr) { - RptInfoSet entity = new RptInfoSet(); - entity.setWhere(wherestr); - List list = rptInfoSetDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptInfoSet entity = new RptInfoSet(); - entity.setWhere(wherestr); - return rptInfoSetDao.deleteByWhere(entity); - } - - @Override - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (RptInfoSet k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (RptInfoSet k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - @Override - public String getTreeList4Tag(List> list_result, List list, List str) { - if (list_result == null) { - list_result = new ArrayList>(); - for (RptInfoSet k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - map.put("tags", ""); - list_result.add(map); - } - } - getTreeList4Tag(list_result, list, str); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (RptInfoSet k : list) { - int tag = 0;//用于标记右边的待办数 - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - - for (String a : str) { - if (a.equals(k.getId())) { - tag = tag + 1; - } else { - //不包含 - } - } - - List tagstr = new ArrayList<>(); - tagstr.add(tag + ""); - - if (tag == 0) { - m.put("tags", ""); - } else { - m.put("tags", tagstr); - } - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList4Tag(childlist, list, str); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - @Override - public List selectListByWhere4Generate(String userId, String unitId) { - RptInfoSet entity = new RptInfoSet(); - entity.setWhere("where 1=1 and unit_id='" + unitId + "' and createusers like '%" + userId + "%' order by morder"); - List list = rptInfoSetDao.selectListByWhere(entity); - String ids = ""; - for (RptInfoSet rptInfoSet : list) { - ids += rptInfoSet.getId() + ","; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - TreeSet rptlist = selectListByIds(ids); - - String ids2 = ""; - for (String id : rptlist) { - ids2 += "'" + id + "',"; - } - if (ids2 != null && !ids2.equals("")) { - ids2 = ids2.substring(0, ids2.length() - 1); - } - entity.setWhere("where 1=1 and id in(" + ids2 + ") order by morder"); - List list2 = rptInfoSetDao.selectListByWhere(entity); - - return list2; - } - - @Override - public String getRptInfoSetIds(String userId, String unitId, String type) { - String unitIds = this.unitService.getAllBizIdFromFather(unitId, ""); - unitIds = unitIds.replace(",", "','"); - - //加上自己 - unitIds = unitIds + "','" + unitId; - - RptInfoSet entity = new RptInfoSet(); - if (type != null && type.equals(RptInfoSet.Role_Generate)) { - //岗位 - List userJobList = userJobService.selectListByWhere(" where userid = '" + userId + "' order by jobid"); - String generate_position = ""; - if (userJobList != null && userJobList.size() > 0) { - for (UserJob userJob : userJobList) { - generate_position += "or generate_position like '%" + userJob.getJobid() + "%' "; - } - } - entity.setWhere("where 1=1 and unit_id in ('" + unitIds + "') and (createusers like '%" + userId + "%' " + generate_position + " ) order by morder"); - } else if (type != null && type.equals(RptInfoSet.Role_Check)) { - entity.setWhere("where 1=1 and unit_id in ('" + unitIds + "') and checkuser like '%" + userId + "%' order by morder"); - } else if (type != null && type.equals(RptInfoSet.Role_View)) { - //岗位 - List userJobList = userJobService.selectListByWhere(" where userid = '" + userId + "' order by jobid"); - String browse_position = ""; - if (userJobList != null && userJobList.size() > 0) { - for (UserJob userJob : userJobList) { - browse_position += "or browse_position like '%" + userJob.getJobid() + "%' "; - } - } - entity.setWhere("where 1=1 and unit_id in ('" + unitIds + "') and (browseusers like '%" + userId + "%' " + browse_position + " ) order by morder"); - } else { - entity.setWhere("where id = 'false' "); - } - List list = rptInfoSetDao.selectListByWhere(entity); - String ids = ""; - for (RptInfoSet rptInfoSet : list) { - ids += rptInfoSet.getId() + ","; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - return ids; - } - - - @Override - public List selectListByWhere4Check(String userId, String unitId) { - RptInfoSet entity = new RptInfoSet(); - entity.setWhere("where 1=1 and unit_id='" + unitId + "' and checkuser like '%" + userId + "%' order by morder"); - List list = rptInfoSetDao.selectListByWhere(entity); - String ids = ""; - for (RptInfoSet rptInfoSet : list) { - ids += rptInfoSet.getId() + ","; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - TreeSet rptlist = selectListByIds(ids); - - String ids2 = ""; - for (String id : rptlist) { - ids2 += "'" + id + "',"; - } - if (ids2 != null && !ids2.equals("")) { - ids2 = ids2.substring(0, ids2.length() - 1); - } - entity.setWhere("where 1=1 and id in(" + ids2 + ") order by morder"); - List list2 = rptInfoSetDao.selectListByWhere(entity); - - return list2; - } - - @Override - public List selectListByWhere4view(String userId, String unitId) { - RptInfoSet entity = new RptInfoSet(); - entity.setWhere("where 1=1 and unit_id='" + unitId + "' and browseusers like '%" + userId + "%' order by morder"); - List list = rptInfoSetDao.selectListByWhere(entity); - String ids = ""; - for (RptInfoSet rptInfoSet : list) { - ids += rptInfoSet.getId() + ","; - } - if (ids != null && !ids.equals("")) { - ids = ids.substring(0, ids.length() - 1); - } - TreeSet rptlist = selectListByIds(ids); - - String ids2 = ""; - for (String id : rptlist) { - ids2 += "'" + id + "',"; - } - if (ids2 != null && !ids2.equals("")) { - ids2 = ids2.substring(0, ids2.length() - 1); - } - entity.setWhere("where 1=1 and id in(" + ids2 + ") order by morder"); - List list2 = rptInfoSetDao.selectListByWhere(entity); - - return list2; - } - - @Override - public RptInfoSet selectByIdWithFile(String id) { - // TODO Auto-generated method stub - return null; - } - - public TreeSet selectListByIds(String ids) { - TreeSet classIdList = new TreeSet(); - if (ids != null) { - String[] id = ids.split(","); - if (id != null) { - for (int i = 0; i < id.length; i++) { - //反向递归找到子节点的所有父节点及根节点 - TreeSet list2 = selectListByChild(classIdList, id[i]); - - Iterator itSet = list2.iterator();//也可以遍历输出 - while (itSet.hasNext()) { - classIdList.add(itSet.next()); - } - } - } - } - return classIdList; - } - - /** - * 反向递归父节点 - */ - public TreeSet selectListByChild(TreeSet classIdList, String pid) { - classIdList.add(pid); - RptInfoSet rptInfoSet = new RptInfoSet(); - rptInfoSet.setWhere(" where id='" + pid + "'"); - List rptInfoSetList = rptInfoSetDao.selectListByWhere(rptInfoSet); - if (rptInfoSetList.size() > 0 && null != rptInfoSetList && !rptInfoSetList.isEmpty()) { - //System.out.println(classList.get(0).getPid()); - if (rptInfoSetList.get(0).getPid() != null && !rptInfoSetList.get(0).getPid().equals("-1")) { - //不是根节点 - classIdList.add(rptInfoSetList.get(0).getId());//保存上一层及id - selectListByChild(classIdList, rptInfoSetList.get(0).getPid()); - } else { - //为根节点 - classIdList.add(rptInfoSetList.get(0).getId());//保存上一层及id - } - } - return classIdList; - } - - @Override - public String getChildrenUnitIdTree(List> list_result, String unitIds, String firstUnitId, String roleIds) { - String ids = ""; - if (roleIds != null && !roleIds.equals("")) { - String[] id = roleIds.split(","); - for (String s : id) { - ids += "'" + s + "',"; - } - ids = ids.substring(0, ids.length() - 1); - } - - String[] unitId = unitIds.split(","); - if (list_result == null) { - list_result = new ArrayList>(); - Unit unit = this.unitService.getUnitById(unitIds); - Map map = new HashMap(); -// List list = selectListByWhere(" where unit_id='" + unitIds + "' "); -// List> tree = getTreeList2(null, list); - map.put("id", unitIds); - map.put("text", unit.getName()); - map.put("type", "unitId"); -// map.put("icon", "fa fa-th-large"); - map.put("unitId", unitIds); -// map.put("nodes", tree); - list_result.add(map); - String uid = this.unitService.getChildrenBizids(unitIds); -// if (!uid.equals("") && uid.length() > 0) { - getChildrenUnitIdTree(list_result, uid, unitIds, roleIds); -// } - } else if (list_result.size() > 0 && unitId.length > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (String u : unitId) { - Unit unit = this.unitService.getUnitById(u); - String where = " where unit_id='" + u + "' "; - if (roleIds != null && roleIds.equals("all")) { - //查所有层级 - } else { - if (!roleIds.equals("")) { -// roleIds = roleIds.replace(",", "','"); - where += " and id in (" + ids + ") "; - } else { - where += " and id = 'false' "; - } - } - List list = selectListByWhere(where + " order by morder"); - if (list != null && list.size() > 0) { - List> tree = getTreeList3(null, list, u); - Map map = new HashMap(); - map.put("id", u); - map.put("text", unit.getName()); - map.put("type", "unitId"); -// map.put("icon", "fa fa-th-large"); - map.put("unitId", u); - map.put("nodes", tree); - childlist.add(map); - } - } - if (firstUnitId != null && firstUnitId.length() > 0) { - String where = " where unit_id='" + firstUnitId + "' "; - - if (roleIds != null && roleIds.equals("all")) { - //查所有层级 - } else { - if (!roleIds.equals("")) { -// roleIds = roleIds.replace(",", "','"); - where += " and (id in (" + ids + ") or type='catalogue')"; - } else { - where += " and id = 'false' "; - } - } - List list = selectListByWhere(where + " order by morder"); - List> tree = getTreeList2(null, list); - - Map m = new HashMap(); - for (Map firstmp : tree) { - m.put("id", firstmp.get("id") + ""); - m.put("text", firstmp.get("text") + ""); - m.put("type", firstmp.get("type") + ""); -// m.put("icon", "fa fa-table"); - m.put("unitId", firstUnitId); - m.put("rpttype", firstmp.get("rpttype")); - m.put("nodes", firstmp.get("nodes") + ""); - childlist.add(firstmp); - } - } - mp.put("nodes", childlist); - if (childlist.size() > 0) { - for (String u : unitId) { - String uid = this.unitService.getChildrenBizids(u); - if (!uid.equals("") && uid.length() > 0) { - getChildrenUnitIdTree(childlist, uid, "", roleIds); - } - } - } - } - } -// System.out.println(JSONArray.fromObject(list_result).toString()); - return JSONArray.fromObject(list_result).toString(); - } - - public List> getTreeList2(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (RptInfoSet k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - map.put("rpttype", k.getRpttype()); -// map.put("icon", "fa fa-table"); - map.put("unitId", k.getUnitId()); - list_result.add(map); - } - } - getTreeList2(list_result, list); - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (RptInfoSet k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - m.put("rpttype", k.getRpttype()); -// m.put("icon", "fa fa-table"); - m.put("unitId", k.getUnitId()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList2(childlist, list); - } - } - } - return list_result; - } - - - public List> getTreeList3(List> list_result, List list, String unitId) { - if (list_result == null) { - list_result = new ArrayList>(); - for (RptInfoSet k : list) { - RptInfoSet rptInfoSet = rptInfoSetDao.selectByPrimaryKey(k.getPid()); - if (rptInfoSet != null) { - if ("-1".equals(rptInfoSet.getPid())) { - Map map = new HashMap(); - map.put("id", rptInfoSet.getId().toString()); - map.put("text", rptInfoSet.getName()); - map.put("type", rptInfoSet.getType()); -// map.put("icon", "fa fa-table"); - map.put("unitId", rptInfoSet.getUnitId()); - map.put("rpttype", rptInfoSet.getRpttype()); - - if (list_result.contains(map)) { - //为重复添加 - } else { - list_result.add(map); - } - } else { - RptInfoSet rptInfoSet2 = rptInfoSetDao.selectByPrimaryKey(rptInfoSet.getPid()); - if (rptInfoSet2 != null) { - if ("-1".equals(rptInfoSet2.getPid())) { - Map map = new HashMap(); - map.put("id", rptInfoSet2.getId().toString()); - map.put("text", rptInfoSet2.getName()); - map.put("type", rptInfoSet2.getType()); - map.put("unitId", rptInfoSet2.getUnitId()); - map.put("rpttype", rptInfoSet.getRpttype()); - list_result.add(map); - } - } - } - } - } - getTreeList3(list_result, list, unitId); - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (RptInfoSet k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); -// m.put("icon", "fa fa-table"); - m.put("unitId", k.getUnitId()); - m.put("rpttype", k.getRpttype()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList3(childlist, list, unitId); - } - } - } - return list_result; - } -} diff --git a/src/com/sipai/service/report/impl/RptInfoSetSheetServiceImpl.java b/src/com/sipai/service/report/impl/RptInfoSetSheetServiceImpl.java deleted file mode 100644 index 63fa3ac2..00000000 --- a/src/com/sipai/service/report/impl/RptInfoSetSheetServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.report.impl; - -import com.sipai.dao.report.RptInfoSetSheetDao; -import com.sipai.entity.report.RptInfoSetSheet; -import com.sipai.service.report.RptInfoSetSheetService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2022/02/17/14:45 - * @Description: - */ -@Service -public class RptInfoSetSheetServiceImpl implements RptInfoSetSheetService { - @Resource - private RptInfoSetSheetDao rptInfoSetSheetDao; - - @Override - public RptInfoSetSheet selectById(String id) { - return rptInfoSetSheetDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return rptInfoSetSheetDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RptInfoSetSheet entity) { - return rptInfoSetSheetDao.insert(entity); - } - - @Override - public int update(RptInfoSetSheet rptInfoSet) { - return rptInfoSetSheetDao.updateByPrimaryKeySelective(rptInfoSet); - } - - @Override - public List selectListByWhere(String wherestr) { - RptInfoSetSheet entity = new RptInfoSetSheet(); - entity.setWhere(wherestr); - return rptInfoSetSheetDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - RptInfoSetSheet entity = new RptInfoSetSheet(); - entity.setWhere(wherestr); - return rptInfoSetSheetDao.deleteByWhere(entity); - } -} diff --git a/src/com/sipai/service/report/impl/RptLogServiceImpl.java b/src/com/sipai/service/report/impl/RptLogServiceImpl.java deleted file mode 100644 index 8f02b8ec..00000000 --- a/src/com/sipai/service/report/impl/RptLogServiceImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -package com.sipai.service.report.impl; - -import com.sipai.dao.report.RptLogDao; -import com.sipai.entity.enums.FileNameSpaceEnum; -import com.sipai.entity.report.RptLog; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.base.MinioTemplate; -import com.sipai.service.report.RptLogService; -import com.sipai.service.user.UserService; -import com.sipai.tools.MinioProp; -import com.sipai.tools.SSCL; -import io.minio.MinioClient; -import io.minio.errors.MinioException; -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.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.xmlpull.v1.XmlPullParserException; - -import javax.annotation.Resource; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactoryConfigurationError; -import java.io.*; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.util.List; - -@Service -public class RptLogServiceImpl implements RptLogService { - @Resource - private RptLogDao rptLogDao; - @Resource - private UserService userService; - @Resource - private CommonFileService commonFileService; - @Resource - private MinioTemplate minioTemplate; - @Autowired - private MinioProp minioProp; - - @Override - public RptLog selectById(String id) { - return rptLogDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return rptLogDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RptLog entity) { - return rptLogDao.insert(entity); - } - - @Override - public int saveSelective(RptLog entity) { - return rptLogDao.insert(entity); - } - - @Override - public int update(RptLog entity) { - return rptLogDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - RptLog rptLog = new RptLog(); - rptLog.setWhere(wherestr); - List list = rptLogDao.selectListByWhere(rptLog); - for (RptLog entity : list) { - User user = userService.getUserById(entity.getInsuser()); - entity.setUser(user); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptLog rptLog = new RptLog(); - rptLog.setWhere(wherestr); - return rptLogDao.deleteByWhere(rptLog); - } - - @Override - public RptLog selectByWhere(String wherestr) { - RptLog rptLog = new RptLog(); - rptLog.setWhere(wherestr); - return rptLogDao.selectByWhere(rptLog); - } - - @Override - public String updateExcel(String path, String sheetname, String afterValue, int posx, int posy) throws IOException, ParserConfigurationException, TransformerFactoryConfigurationError, TransformerException { - String content = null; - StringWriter writer = null; - byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path); - InputStream is = new ByteArrayInputStream(bytes); - //判断Excel文件是2003版还是2007版 - String suffix = path.substring(path.lastIndexOf(".")); - if (suffix.equals(".xlsx")) { - // - } else { - HSSFWorkbook workbook = new HSSFWorkbook(is); - HSSFSheet sheet = workbook.getSheet(sheetname); - - try { - int ac_x = posx - 1;//最终x值 - int ac_y = posy - 1;//最终x值 - - //将修改值写入excel - HSSFRow r = sheet.getRow(ac_y); - HSSFCell cell = r.getCell(ac_x); - cell.setCellValue(afterValue); - /* - * 传到minio - */ - try { - String rptname = path.replaceAll(".xls", ""); - String showname = rptname; - InputStream stream = null; - //获取类加载的根路径 - String file3 = SSCL.cont + "/" + showname + ".xls"; - // 新建一输出流 - FileOutputStream fout = null; - try { - fout = new FileOutputStream(file3); - // 存盘 - workbook.write(fout); - // 清空缓冲区 - fout.flush(); - // 结束关闭 - fout.close(); - } catch (IOException e) { - e.printStackTrace(); - } - // 参数为:图床,账号,密码 - MinioClient minioClient = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey()); - // 检查文件夹是否已经存在 - boolean isExist = false; - try { - isExist = minioClient.bucketExists(FileNameSpaceEnum.RptCreateFile.getNameSpace()); - if (isExist) { - //文件夹已经存在了 - } else { - // 创建一个名为report的文件夹 - minioClient.makeBucket(FileNameSpaceEnum.RptCreateFile.getNameSpace()); - } - //参数为:文件夹,要存成的名字,要存的文件 - minioClient.putObject(FileNameSpaceEnum.RptCreateFile.getNameSpace(), showname + ".xls", file3); - //删除文件 只保留minio中的文件 - File file = new File(file3);//根据指定的文件名创建File对象 - file.delete(); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (XmlPullParserException e) { - e.printStackTrace(); - } - } catch (MinioException e) { - e.printStackTrace(); - } - - } finally { - try { - if (is != null) { - is.close(); - } - if (writer != null) { - writer.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return content; - } - - - /*public Result hasMerged(HSSFSheet sheet, int row, int column) { - int sheetMergeCount = sheet.getNumMergedRegions(); - for (int i = 0; i < sheetMergeCount; i++) { - CellRangeAddress range = sheet.getMergedRegion(i); - int firstColumn = range.getFirstColumn(); - int lastColumn = range.getLastColumn(); - int firstRow = range.getFirstRow(); - int lastRow = range.getLastRow(); - if (row >= firstRow && row <= lastRow) { - if (column >= firstColumn && column <= lastColumn) { - return new Result(true, firstRow + 1, lastRow + 1, firstColumn + 1, lastColumn + 1); - } - } - } - return new Result(false, 0, 0, 0, 0); - } - - class Result { - public boolean merged; - public int startRow; - public int endRow; - public int startCol; - public int endCol; - - public Result(boolean merged, int startRow, int endRow, int startCol, int endCol) { - this.merged = merged; - this.startRow = startRow; - this.endRow = endRow; - this.startCol = startCol; - this.endCol = endCol; - } - - }*/ - -} - - diff --git a/src/com/sipai/service/report/impl/RptMpSetServiceImpl.java b/src/com/sipai/service/report/impl/RptMpSetServiceImpl.java deleted file mode 100644 index b46347eb..00000000 --- a/src/com/sipai/service/report/impl/RptMpSetServiceImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.report.RptCollectMode; -import com.sipai.entity.report.RptSpSet; -import com.sipai.service.report.RptCollectModeService; -import com.sipai.service.report.RptSpSetService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.report.RptMpSetDao; -import com.sipai.entity.report.RptMpSet; -import com.sipai.service.report.RptMpSetService; - -import org.springframework.transaction.annotation.Transactional; - -@Service -public class RptMpSetServiceImpl implements RptMpSetService { - @Resource - private RptMpSetDao rptMpSetDao; - @Resource - private MPointService mPointService; - @Resource - private RptSpSetService rptSpSetService; - @Resource - private RptCollectModeService rptCollectModeService; - - @Override - public RptMpSet selectById(String id) { - RptMpSet entity = rptMpSetDao.selectByPrimaryKey(id); - if (entity != null) { - if (entity.getMpid().equals(RptMpSet.rog)) { - //插入的横杠 - } else if (entity.getMpid().equals(RptMpSet.dt)) { - //插入的日期 - } else { - //测量点 - entity.setmPoint(this.mPointService.selectById(entity.getUnitId(), entity.getMpid())); - } - } - return entity; - } - - @Override - public int deleteById(String id, String rptMpSetId) { - int res = rptMpSetDao.deleteByPrimaryKey(id); - if (res == 1) { - //整体重新排序 - updateMorder(rptMpSetId); - } - return res; - } - - @Transactional - public int save(RptMpSet rptMpSet) { - - if (rptMpSet.getPid() != null && !rptMpSet.getPid().equals("")) { - RptSpSet rptSpSet = rptSpSetService.selectById(rptMpSet.getPid()); - if (rptSpSet != null) { - rptMpSet.setUnitId(rptSpSet.getUnitId()); - } - } - - //默认插到最后 - rptMpSet.setWhere("where pid = '" + rptMpSet.getPid() + "' order by morder desc"); - List list = rptMpSetDao.selectListByWhere(rptMpSet); - if (list != null && list.size() > 0) { - rptMpSet.setMorder(list.get(0).getMorder() + 1); - } else { - rptMpSet.setMorder(0); - } - - return rptMpSetDao.insert(rptMpSet); - } - - @Transactional - public int update(RptMpSet rptInfoSet) { - //所有修改排序 全部往后加1位 - rptInfoSet.setMorder(rptInfoSet.getMorder()); - - int res = rptMpSetDao.updateByPrimaryKeySelective(rptInfoSet); - if (res == 1) { - RptMpSet rptMpSet = new RptMpSet(); - rptMpSet.setWhere("where pid = '" + rptInfoSet.getPid() + "' and morder<='" + rptInfoSet.getMorder() + "' and id!='" + rptInfoSet.getId() + "'"); - //查出所有morder大于当前排序的哪一行 - List list = rptMpSetDao.selectListByWhere(rptMpSet); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - RptMpSet rptMpSet1 = list.get(i); - rptMpSet1.setMorder(rptMpSet1.getMorder() - 1); - rptMpSetDao.updateByPrimaryKeySelective(rptMpSet1); - } - - //最后 整体重新排序 - updateMorder(list.get(0).getPid()); - } - } - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - RptMpSet entity = new RptMpSet(); - entity.setWhere(wherestr); - List list = rptMpSetDao.selectListByWhere(entity); - for (RptMpSet rptMpSet : list) { - if (rptMpSet.getUnitId() != null && !rptMpSet.getUnitId().equals("")) { - //查询测量点 - rptMpSet.setmPoint(this.mPointService.selectById(rptMpSet.getUnitId(), rptMpSet.getMpid())); - } - //查询采集方式 - List listMode = rptCollectModeService.selectListByWhere("where name = '" + rptMpSet.getCollectMode() + "'"); - if (listMode != null && listMode.size() > 0) { - rptMpSet.setRptCollectMode(listMode.get(0)); - } - } - return list; - } - - @Transactional - public int deleteByWhere(String wherestr, String rptMpSetId) { - RptMpSet rptMpSet = new RptMpSet(); - rptMpSet.setWhere(wherestr); - int res = rptMpSetDao.deleteByWhere(rptMpSet); - if (res > 0) { - //整体重新排序 - updateMorder(rptMpSetId); - } - return res; - } - - @Transactional - public int saveMp(String ids, String id) { - int res = 0; - RptSpSet rptSpSet = rptSpSetService.selectById(id); - if (rptSpSet != null) { - if (ids != null && !ids.equals("")) { - String[] idsstr = ids.split(","); - if (idsstr != null && idsstr.length > 0) { - for (int i = 0; i < idsstr.length; i++) { - RptMpSet rptMpSet = new RptMpSet(); - rptMpSet.setPid(id); - rptMpSet.setMpid(idsstr[i]); - rptMpSet.setInsdt(CommUtil.nowDate()); - rptMpSet.setUnitId(rptSpSet.getUnitId()); - rptMpSet.setWhere("where pid = '" + id + "' and mpid = '" + idsstr[i] + "'"); - RptMpSet entity = rptMpSetDao.selectByWhere(rptMpSet); - //之前同一个sp不可插入相同点位,现在改为可以 -// if (entity != null) { -// rptMpSet.setMorder(entity.getMorder()); -// rptMpSet.setId(entity.getId()); -// res += rptMpSetDao.updateByPrimaryKeySelective(rptMpSet); -// } else { - //默认插到最后 - rptMpSet.setWhere("where pid = '" + id + "' order by morder desc"); - List list = rptMpSetDao.selectListByWhere(rptMpSet); - if (list != null && list.size() > 0) { - rptMpSet.setMorder(list.get(0).getMorder() + 1); - } else { - rptMpSet.setMorder(1); - } - rptMpSet.setDataType("日数据"); - rptMpSet.setCollectMode("first"); - rptMpSet.setId(CommUtil.getUUID()); - res += rptMpSetDao.insert(rptMpSet); -// } - } - } - } - } - return res; - } - - @Override - public int saveRod(String id) { - int res = 0; - RptMpSet rptMpSet = new RptMpSet(); - rptMpSet.setId(CommUtil.getUUID()); - rptMpSet.setPid(id); - rptMpSet.setMpid("-"); - rptMpSet.setCollectMode("first"); - rptMpSet.setDataType("日数据"); - //rptMpSet.setMorder(0); - - //默认插到最后 - rptMpSet.setWhere("where pid = '" + id + "' order by morder desc"); - List list = rptMpSetDao.selectListByWhere(rptMpSet); - if (list != null && list.size() > 0) { - rptMpSet.setMorder(list.get(0).getMorder() + 1); - } else { - rptMpSet.setMorder(0); - } - - res = rptMpSetDao.insert(rptMpSet); - return res; - } - - @Override - public int saveDt(String id) { - int res = 0; - RptMpSet rptMpSet = new RptMpSet(); - rptMpSet.setId(CommUtil.getUUID()); - rptMpSet.setPid(id); - rptMpSet.setMpid("date"); - rptMpSet.setCollectMode("first"); - rptMpSet.setDataType("日数据"); - //默认插到第一行 - rptMpSet.setMorder(0); - res = rptMpSetDao.insert(rptMpSet); - return res; - } - - /** - * 刷新整体排序 - * - * @param rptMpSetId - * @return - */ - public int updateMorder(String rptMpSetId) { - int res = 0; - RptMpSet rptMpSet = new RptMpSet(); - //默认插到最后 - rptMpSet.setWhere("where pid = '" + rptMpSetId + "' order by morder asc"); - List list = rptMpSetDao.selectListByWhere(rptMpSet); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - RptMpSet mpset = rptMpSetDao.selectByPrimaryKey(list.get(i).getId()); - mpset.setMorder(i + 1); - int upres = rptMpSetDao.updateByPrimaryKeySelective(mpset); - res += upres; - } - } - return res; - } -} diff --git a/src/com/sipai/service/report/impl/RptSpSetServiceImpl.java b/src/com/sipai/service/report/impl/RptSpSetServiceImpl.java deleted file mode 100644 index 54bc68ec..00000000 --- a/src/com/sipai/service/report/impl/RptSpSetServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.List; -import javax.annotation.Resource; - -import com.sipai.entity.work.GroupTime; -import com.sipai.entity.work.GroupType; -import com.sipai.service.work.GroupTimeService; -import com.sipai.service.work.GroupTypeService; -import org.springframework.stereotype.Service; -import com.sipai.dao.report.RptSpSetDao; -import com.sipai.entity.report.RptSpSet; -import com.sipai.service.report.RptSpSetService; - -@Service -public class RptSpSetServiceImpl implements RptSpSetService { - @Resource - private RptSpSetDao rptSpSetDao; - @Resource - private GroupTypeService groupTypeService; - @Resource - private GroupTimeService groupTimeService; - - @Override - public RptSpSet selectById(String id) { - return rptSpSetDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return rptSpSetDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RptSpSet entity) { - return rptSpSetDao.insert(entity); - } - - @Override - public int update(RptSpSet rptSpSet) { - return rptSpSetDao.updateByPrimaryKeySelective(rptSpSet); - } - - @Override - public List selectListByWhere(String wherestr) { - RptSpSet entity = new RptSpSet(); - entity.setWhere(wherestr); - List list = rptSpSetDao.selectListByWhere(entity); - for (RptSpSet rptSpSet : list) { - GroupType groupType = groupTypeService.selectById(rptSpSet.getGrouptypeId()); - rptSpSet.setGroupType(groupType); - GroupTime groupTime = groupTimeService.selectById(rptSpSet.getGrouptimeId()); - rptSpSet.setGroupTime(groupTime); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptSpSet entity = new RptSpSet(); - entity.setWhere(wherestr); - return rptSpSetDao.deleteByWhere(entity); - } - - @Override - public List selectSheetNameList(String s) { - return rptSpSetDao.selectSheetNameList(s); - } - -} diff --git a/src/com/sipai/service/report/impl/RptTypeSetServiceImpl.java b/src/com/sipai/service/report/impl/RptTypeSetServiceImpl.java deleted file mode 100644 index 5295edb0..00000000 --- a/src/com/sipai/service/report/impl/RptTypeSetServiceImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.report.impl; - -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; -import com.sipai.dao.report.RptTypeSetDao; -import com.sipai.entity.report.RptTypeSet; -import com.sipai.service.report.RptTypeSetService; - -@Service -public class RptTypeSetServiceImpl implements RptTypeSetService{ - @Resource - private RptTypeSetDao rptTypeSetDao; - - @Override - public RptTypeSet selectById(String id) { - return rptTypeSetDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return rptTypeSetDao.deleteByPrimaryKey(id); - } - - @Override - public int save(RptTypeSet entity) { - return rptTypeSetDao.insert(entity); - } - - @Override - public int update(RptTypeSet rptInfoSet) { - return rptTypeSetDao.updateByPrimaryKeySelective(rptInfoSet); - } - - @Override - public List selectListByWhere(String wherestr) { - RptTypeSet entity = new RptTypeSet(); - entity.setWhere(wherestr); - List list = rptTypeSetDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - RptTypeSet entity = new RptTypeSet(); - entity.setWhere(wherestr); - return rptTypeSetDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/safety/SafetyCertificateService.java b/src/com/sipai/service/safety/SafetyCertificateService.java deleted file mode 100644 index 8b5ae0f4..00000000 --- a/src/com/sipai/service/safety/SafetyCertificateService.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyCertificateDao; -import com.sipai.entity.safety.SafetyCertificate; -import com.sipai.entity.safety.SafetyExternalCertificateVo; -import com.sipai.entity.safety.SafetyFiles; -import com.sipai.entity.safety.SafetyInternalCertificateVo; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -/** - * @author LiTao - * @date 2022-09-21 14:33:24 - * @description: 人员证书 - */ -@Service -public class SafetyCertificateService implements CommService { - @Resource - private SafetyCertificateDao dao; - @Resource - private SafetyFilesService safetyFilesService; - - @Override - public SafetyCertificate selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyCertificate safetyCertificate) { - return dao.insert(safetyCertificate); - } - - @Override - public int update(SafetyCertificate safetyCertificate) { - return dao.updateByPrimaryKeySelective(safetyCertificate); - } - - @Override - public List selectListByWhere(String t) { - SafetyCertificate entity = new SafetyCertificate(); - entity.setWhere(t); - List list = dao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String t) { - SafetyCertificate entity = new SafetyCertificate(); - entity.setWhere(t); - return dao.deleteByWhere(entity); - } - - /** - * 作业类型下拉 - * @return - */ - public List> jobTypePulldown(){ - return dao.jobTypePulldown(); - } - -// ---------------- 内部证书 ---------------- - - public List selectListByConditionForInternal(String t) { - SafetyInternalCertificateVo vo = new SafetyInternalCertificateVo(); - vo.setWhere(t); - List list = dao.selectListByConditionForInternal(vo); - return list; - } - - public SafetyInternalCertificateVo selectOneByIdForInternal(String id) { - SafetyInternalCertificateVo vo = dao.selectOneByIdForInternal(id); - if(vo != null){ - List fileList = safetyFilesService.selectListByWhere(" where biz_id ='" + id + "' order by id desc"); - if(!CollectionUtils.isEmpty(fileList)){ - vo.setSafetyFiles(fileList.get(0)); - } - } - return vo; - } - - // 证书编号唯一 - public List selectOneByConditionForInternal(SafetyCertificate bean) { - return dao.selectOneByConditionForInternal(bean); - } - - -// ----------------- 外部证书 ------------- - - - - public List selectListByConditionForExternal(String t) { - SafetyExternalCertificateVo vo = new SafetyExternalCertificateVo(); - vo.setWhere(t); - List list = dao.selectListByConditionForExternal(vo); - return list; - } - - public SafetyExternalCertificateVo selectOneByIdForExternal(String id) { - SafetyExternalCertificateVo vo = dao.selectOneByIdForExternal(id); - if(vo != null){ - List fileList = safetyFilesService.selectListByWhere(" where biz_id ='" + id + "' order by id desc"); - if(!CollectionUtils.isEmpty(fileList)){ - vo.setSafetyFiles(fileList.get(0)); - } - } - return vo; - } - - // 证书编号唯一 - public List selectOneByConditionForExternal(SafetyCertificate bean) { - return dao.selectOneByConditionForExternal(bean); - } -} diff --git a/src/com/sipai/service/safety/SafetyCheckActivityService.java b/src/com/sipai/service/safety/SafetyCheckActivityService.java deleted file mode 100644 index b01da02c..00000000 --- a/src/com/sipai/service/safety/SafetyCheckActivityService.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.Company; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class SafetyCheckActivityService { - - @Resource - private UnitService unitService; - - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - - @Resource - private WorkflowService workflowService; - @Resource - private SafetyFlowTaskService safetyFlowTaskService; - - /** - * 发起安全检查 - * - * @Author: lichen - * @Date: 2022/10/9 - **/ - public Result apply(String applyUserId, String nextUserId, ProcessType processBaseKey, String bizId) { - Company company = unitService.getCompanyByUserId(applyUserId); - // 判断有无流程定义,如果没有,则启动失败。 - // 流程定义的id - String processKey = processBaseKey.getId() + "-" + company.getId(); - List processDefinitions = - workflowProcessDefinitionService.getProcessDefsBykey(processKey); - if (processDefinitions == null || processDefinitions.size() == 0) { - return Result.failed(company.getName() + "缺少该流程定义。"); - } - // 启动流程实例 - // 设置网关条件 - Map map = new HashMap<>(); - map.put(CommString.ACTI_KEK_Condition, 1); - map.put(CommString.ACTI_KEK_Assignee, applyUserId); - map.put(CommString.ACTI_KEK_Candidate_Users, applyUserId); - - // 启动流程 - ProcessInstance processInstance = workflowService.startWorkflow( - // 业务主键 - bizId, - // 申请者id - applyUserId, - // 流程Key - processDefinitions.get(0).getKey(), - // 流程变量 - map); - // 判断实例是否启动成功 - // 获取当前任务 - Task task = - workflowService.getTaskService().createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); - Map map2 = new HashMap<>(); - map2.put(CommString.ACTI_KEK_Condition, 1); - map2.put(CommString.ACTI_KEK_Assignee, nextUserId); - map2.put(CommString.ACTI_KEK_Candidate_Users, nextUserId); - workflowService.getTaskService().complete(task.getId(), map2); - - return Result.success(); - } - - /** - * 审核 - * - * @Author: lichen - * @Date: 2022/10/10 - **/ - public Result audit(String nextUserId, String processInstanceId, int pass) { - Task task = - workflowService.getTaskService().createTaskQuery().processInstanceId(processInstanceId).singleResult(); - Map map = new HashMap<>(); - map.put(CommString.ACTI_KEK_Condition, pass); - map.put(CommString.ACTI_KEK_Assignee, nextUserId); - map.put(CommString.ACTI_KEK_Candidate_Users, nextUserId); - workflowService.getTaskService().complete(task.getId(), map); - return Result.success(); - } - - -} diff --git a/src/com/sipai/service/safety/SafetyCheckComprehensiveService.java b/src/com/sipai/service/safety/SafetyCheckComprehensiveService.java deleted file mode 100644 index 248f9a8b..00000000 --- a/src/com/sipai/service/safety/SafetyCheckComprehensiveService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyCheckComprehensiveDao; -import com.sipai.entity.safety.SafetyCheckComprehensive; -import com.sipai.entity.safety.SafetyCheckComprehensiveQuery; -import com.sipai.entity.safety.SafetyCheckComprehensiveVo; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.List; - -/** - * 综合检查 - * @author lt - */ -@Service -public class SafetyCheckComprehensiveService implements CommService { - - @Resource - private SafetyCheckComprehensiveDao dao; - - @Override - public SafetyCheckComprehensive selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyCheckComprehensive bean) { - return dao.insert(bean); - } - - @Override - public int update(SafetyCheckComprehensive bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(SafetyCheckComprehensiveQuery query) { - return dao.getList(query); - } -} diff --git a/src/com/sipai/service/safety/SafetyCheckDaylyService.java b/src/com/sipai/service/safety/SafetyCheckDaylyService.java deleted file mode 100644 index bb66f857..00000000 --- a/src/com/sipai/service/safety/SafetyCheckDaylyService.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyCheckDaylyDao; -import com.sipai.entity.safety.SafetyCheckDayly; -import com.sipai.entity.safety.SafetyCheckDaylyQuery; -import com.sipai.entity.safety.SafetyCheckDaylyVo; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.List; - -@Service -public class SafetyCheckDaylyService implements CommService { - @Resource - private SafetyCheckDaylyDao dao; - - @Override - public SafetyCheckDayly selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyCheckDayly bean) { - return dao.insert(bean); - } - - @Override - public int update(SafetyCheckDayly bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(SafetyCheckDaylyQuery query) { - return dao.getList(query); - } - - -} diff --git a/src/com/sipai/service/safety/SafetyCheckSpecialService.java b/src/com/sipai/service/safety/SafetyCheckSpecialService.java deleted file mode 100644 index 94fa330c..00000000 --- a/src/com/sipai/service/safety/SafetyCheckSpecialService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyCheckSpecialDao; -import com.sipai.entity.safety.SafetyCheckSpecial; -import com.sipai.entity.safety.SafetyCheckSpecialQuery; -import com.sipai.entity.safety.SafetyCheckSpecialVo; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.List; - -/** - * 专项安全检查 - * @author lt - */ -@Service -public class SafetyCheckSpecialService implements CommService { - - @Resource - private SafetyCheckSpecialDao dao; - - @Override - public SafetyCheckSpecial selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyCheckSpecial bean) { - return dao.insert(bean); - } - - @Override - public int update(SafetyCheckSpecial bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(SafetyCheckSpecialQuery query) { - return dao.getList(query); - } -} diff --git a/src/com/sipai/service/safety/SafetyEducationBuilderService.java b/src/com/sipai/service/safety/SafetyEducationBuilderService.java deleted file mode 100644 index f9e9e8f9..00000000 --- a/src/com/sipai/service/safety/SafetyEducationBuilderService.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyEducationBuilderDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.safety.*; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.List; - -/** - * 访客教育 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ -@Service -public class SafetyEducationBuilderService implements CommService { - @Resource - private SafetyEducationBuilderDao dao; - - @Override - public SafetyEducationBuilder selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyEducationBuilder safetyEducationBuilder) { - - return dao.insert(safetyEducationBuilder); - } - - @Override - public int update(SafetyEducationBuilder safetyEducationBuilder) { - return dao.updateByPrimaryKeySelective(safetyEducationBuilder); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(SafetyCommonQuery query) { - return dao.getList(query); - } - - public List companyList(){ - return dao.companyList(); - } - public boolean timeRangeCheck(SafetyEducationBuilder bean) throws ParseException { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Timestamp startTime = new Timestamp(dateFormat.parse(bean.getEducationDate()).getTime()); - Timestamp endTime = new Timestamp(dateFormat.parse(bean.getDeadline()).getTime()); - return endTime.getTime()>=startTime.getTime(); - } - public List getUnbindList(SafetyEducationBuilderQuery query) { - - return dao.getUnbindList(query); - } -} diff --git a/src/com/sipai/service/safety/SafetyEducationInsiderService.java b/src/com/sipai/service/safety/SafetyEducationInsiderService.java deleted file mode 100644 index b8f794d8..00000000 --- a/src/com/sipai/service/safety/SafetyEducationInsiderService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyEducationInsiderDao; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationInsider; -import com.sipai.entity.safety.SafetyEducationInsiderVo; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 访客教育 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ -@Service -public class SafetyEducationInsiderService implements CommService { - @Resource - private SafetyEducationInsiderDao dao; - - @Override - public SafetyEducationInsider selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyEducationInsider safetyEducationInsider) { - - return dao.insert(safetyEducationInsider); - } - - @Override - public int update(SafetyEducationInsider safetyEducationInsider) { - return dao.updateByPrimaryKeySelective(safetyEducationInsider); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(SafetyCommonQuery query) { - return dao.getList(query); - } -} diff --git a/src/com/sipai/service/safety/SafetyEducationTraineeService.java b/src/com/sipai/service/safety/SafetyEducationTraineeService.java deleted file mode 100644 index c873ec07..00000000 --- a/src/com/sipai/service/safety/SafetyEducationTraineeService.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyEducationTraineeDao; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationBuilder; -import com.sipai.entity.safety.SafetyEducationTrainee; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.List; - -/** - * 访客教育 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ -@Service -public class SafetyEducationTraineeService implements CommService { - @Resource - private SafetyEducationTraineeDao dao; - - @Override - public SafetyEducationTrainee selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyEducationTrainee safetyEducationTrainee) { - - return dao.insert(safetyEducationTrainee); - } - - @Override - public int update(SafetyEducationTrainee safetyEducationTrainee) { - return dao.updateByPrimaryKeySelective(safetyEducationTrainee); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - - public boolean timeRangeCheck(SafetyEducationTrainee bean) throws ParseException { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Timestamp startTime = new Timestamp(dateFormat.parse(bean.getEducationDate()).getTime()); - Timestamp endTime = new Timestamp(dateFormat.parse(bean.getDeadline()).getTime()); - return endTime.getTime()>=startTime.getTime(); - } - - public List getList(SafetyCommonQuery query) { - return dao.getList(query); - } -} diff --git a/src/com/sipai/service/safety/SafetyEducationVisitorService.java b/src/com/sipai/service/safety/SafetyEducationVisitorService.java deleted file mode 100644 index 6ca12e7c..00000000 --- a/src/com/sipai/service/safety/SafetyEducationVisitorService.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyEducationVisitorDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.safety.SafetyCommonQuery; -import com.sipai.entity.safety.SafetyEducationVisitor; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -/** - * 访客教育 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ -@Service -public class SafetyEducationVisitorService implements CommService { - @Resource - private SafetyEducationVisitorDao dao; - - @Override - public SafetyEducationVisitor selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyEducationVisitor safetyEducationVisitor) { - - return dao.insert(safetyEducationVisitor); - } - - @Override - public int update(SafetyEducationVisitor safetyEducationVisitor) { - return dao.updateByPrimaryKeySelective(safetyEducationVisitor); - } - - @Override - public List selectListByWhere(String t) { - return null; - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public boolean timeRangeCheck(SafetyEducationVisitor bean) throws ParseException { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); - Timestamp startTime = new Timestamp(dateFormat.parse(bean.getAccessTime()).getTime()); - Timestamp endTime = new Timestamp(dateFormat.parse(bean.getLeaveTime()).getTime()); - return !startTime.after(endTime); - } - - public List getList(SafetyCommonQuery query) { - return dao.getList(query); - } -} diff --git a/src/com/sipai/service/safety/SafetyExternalStaffService.java b/src/com/sipai/service/safety/SafetyExternalStaffService.java deleted file mode 100644 index c8c63d94..00000000 --- a/src/com/sipai/service/safety/SafetyExternalStaffService.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyExternalStaffDao; -import com.sipai.entity.safety.SafetyExternalCertificateExcel; -import com.sipai.entity.safety.SafetyExternalStaff; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * @author LiTao - * @date 2022-09-21 14:33:24 - * @description: 外部人员 - */ -@Service -public class SafetyExternalStaffService implements CommService { - @Resource - private SafetyExternalStaffDao dao; - - @Override - public SafetyExternalStaff selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t){ - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyExternalStaff safetyExternalStaff) { - return dao.insert(safetyExternalStaff); - } - - @Override - public int update(SafetyExternalStaff safetyExternalStaff) { - return dao.updateByPrimaryKeySelective(safetyExternalStaff); - } - - @Override - public List selectListByWhere(String t) { - SafetyExternalStaff entity = new SafetyExternalStaff(); - entity.setWhere(t); - List list = dao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String t) { - SafetyExternalStaff entity = new SafetyExternalStaff(); - entity.setWhere(t); - return dao.deleteByWhere(entity); - } - - //施工单位下拉 - public List> companyPulldown() { - return dao.companyPulldown(); - } - - /** - * 根据条件获取外部人员信息列表 - * @param externalStaff - * @return - */ - public List getExternalStaffByCondition(SafetyExternalStaff externalStaff) { - return dao.getExternalStaffByCondition(externalStaff); - } - - /** - * 外部人员身份证号验证唯一 - * @param safetyExternalStaff - * @return - */ - public List validationIdcard(SafetyExternalStaff safetyExternalStaff){ - return dao.validationIdcard(safetyExternalStaff); - } - - - /** - * 根据名称和部门名称 查询负责人ID - */ - public String selectUsher(SafetyExternalCertificateExcel excelEntity){ - return dao.selectUsher(excelEntity); - } -} diff --git a/src/com/sipai/service/safety/SafetyFilesService.java b/src/com/sipai/service/safety/SafetyFilesService.java deleted file mode 100644 index 4d1e7697..00000000 --- a/src/com/sipai/service/safety/SafetyFilesService.java +++ /dev/null @@ -1,416 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyFilesDao; -import com.sipai.entity.enums.safety.SafetyCheckStatusEnum; -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.enums.safety.SafetyJobInsideStatusEnum; -import com.sipai.entity.enums.safety.SafetyOutsiderJobStatusEnum; -import com.sipai.entity.safety.SafetyFiles; -import com.sipai.entity.safety.SafetyFilesVo; -import com.sipai.tools.CommService; -import com.sipai.tools.FileUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -/** - * 安全管理文件服务 - * - * @Author: lichen - * @Date: 2022/9/20 - **/ -@Service -public class SafetyFilesService implements CommService { - - @Resource - private SafetyFilesDao dao; - - /** - * 上传文件保存路径 - */ - private static final String uploadPath = "UploadFile"; - - /** - * 安全管理模块上传文件路径分类 - */ - private static final String workspace = "Safety"; - - @Override - public SafetyFiles selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - if (StringUtils.isEmpty(t)) { - return 0; - } - SafetyFiles files = selectById(t); - if(files!=null){ - int i = dao.deleteByPrimaryKey(t); - FileUtil.deleteFile(files.getAbsolutePath()); - return i; - } - return 0; - } - - @Override - public int save(SafetyFiles safetyFiles) { - return dao.insert(safetyFiles); - } - - @Override - public int update(SafetyFiles safetyFiles) { - return dao.updateByPrimaryKeySelective(safetyFiles); - } - - @Override - public List selectListByWhere(String t) { - SafetyFiles file = new SafetyFiles(); - file.setWhere(t); - return dao.selectListByWhere(file); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - /** - * 上传文件 - * - * @param functionId 功能枚举类的id SafetyFunctionEnum - * @param statusId 功能对应的状态枚举类的id SafetyInnsiderJobStatusEnum、SafetyOutsiderJobStatusEnum、SafetyCheckStatusEnum - * @Author: lichen - * @Date: 2022/9/20 - **/ - public List upload(HttpServletRequest request, MultipartFile multipartFile, Integer functionId, Integer statusId, String bizId) throws IOException { - List safetyFilesList = new ArrayList<>(); // 返回文件数据容器 - if (multipartFile == null || multipartFile.getSize() == 0) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List files = multipartRequest.getFiles("file"); - for (MultipartFile mfile : files) { - String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf(".")); - - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String basePath = filepathSever.substring(0, filepathSever.indexOf(contextPath) - 1); - String filepath = basePath + File.separator + uploadPath + File.separator + workspace + File.separator; - String fileNewName = UUID.randomUUID().toString() + suffix; - String abPath = filepath + fileNewName; - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - File fileWrite = new File(abPath); - mfile.transferTo(fileWrite); - SafetyFiles file = new SafetyFiles(); - file.setId(UUID.randomUUID().toString()); - file.setFileName(fileNewName); - file.setOriginalFileName(mfile.getOriginalFilename()); - file.setUploadTime(new Date()); - file.setAbsolutePath(abPath); - file.setAccessUrl(""); - file.setFunctionCode(functionId); - file.setStatusCode(statusId); - file.setBizId(bizId); - dao.insert(file); - safetyFilesList.add(file); - } - } else { - String suffix = multipartFile.getOriginalFilename().substring(multipartFile.getOriginalFilename().lastIndexOf(".")); - - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String basePath = filepathSever.substring(0, filepathSever.indexOf(contextPath) - 1); - String filepath = basePath + File.separator + uploadPath + File.separator + workspace + File.separator; - String fileNewName = UUID.randomUUID().toString() + suffix; - String abPath = filepath + fileNewName; - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - File fileWrite = new File(abPath); - multipartFile.transferTo(fileWrite); - SafetyFiles file = new SafetyFiles(); - file.setId(UUID.randomUUID().toString()); - file.setFileName(fileNewName); - file.setOriginalFileName(multipartFile.getOriginalFilename()); - file.setUploadTime(new Date()); - file.setAbsolutePath(abPath); - file.setAccessUrl(""); - file.setFunctionCode(functionId); - file.setStatusCode(statusId); - file.setBizId(bizId); - dao.insert(file); - safetyFilesList.add(file); - } - return safetyFilesList; - } - /** - * 上传文件 - * - * @Author: niu - * @Date: 2023/4/14 - **/ - public List uploads(HttpServletRequest request, MultipartFile[] multipartFiles, Integer functionId, Integer statusId, String bizId) throws IOException { - List safetyFilesList = new ArrayList<>(); // 返回文件数据容器 - for (MultipartFile multipartFile:multipartFiles){ - if (multipartFile == null || multipartFile.getSize() == 0) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - List files = multipartRequest.getFiles("file"); - for (MultipartFile mfile : files) { - String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf(".")); - - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String basePath = filepathSever.substring(0, filepathSever.indexOf(contextPath) - 1); - String filepath = basePath + File.separator + uploadPath + File.separator + workspace + File.separator; - String fileNewName = UUID.randomUUID().toString() + suffix; - String abPath = filepath + fileNewName; - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - File fileWrite = new File(abPath); - mfile.transferTo(fileWrite); - SafetyFiles file = new SafetyFiles(); - file.setId(UUID.randomUUID().toString()); - file.setFileName(fileNewName); - file.setOriginalFileName(mfile.getOriginalFilename()); - file.setUploadTime(new Date()); - file.setAbsolutePath(abPath); - file.setAccessUrl(""); - file.setFunctionCode(functionId); - file.setStatusCode(statusId); - file.setBizId(bizId); - dao.insert(file); - safetyFilesList.add(file); - } - } else { - String suffix = multipartFile.getOriginalFilename().substring(multipartFile.getOriginalFilename().lastIndexOf(".")); - - //判断保存文件的路径是否存在 - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String basePath = filepathSever.substring(0, filepathSever.indexOf(contextPath) - 1); - String filepath = basePath + File.separator + uploadPath + File.separator + workspace + File.separator; - String fileNewName = UUID.randomUUID().toString() + suffix; - String abPath = filepath + fileNewName; - File fileUploadPath = new File(filepath); - if (!fileUploadPath.exists()) { - //解决上传文件目录无法自动创建 - fileUploadPath.mkdirs(); - } - File fileWrite = new File(abPath); - multipartFile.transferTo(fileWrite); - SafetyFiles file = new SafetyFiles(); - file.setId(UUID.randomUUID().toString()); - file.setFileName(fileNewName); - file.setOriginalFileName(multipartFile.getOriginalFilename()); - file.setUploadTime(new Date()); - file.setAbsolutePath(abPath); - file.setAccessUrl(""); - file.setFunctionCode(functionId); - file.setStatusCode(statusId); - file.setBizId(bizId); - dao.insert(file); - safetyFilesList.add(file); - } - } - return safetyFilesList; - } - - /** - * 下载 - * - * @Author: lichen - * @Date: 2022/9/21 - **/ - public void download(HttpServletResponse response, String fileId) throws IOException { - SafetyFiles file = selectById(fileId); - FileInputStream input = new FileInputStream(file.getAbsolutePath()); - int len = 0; - byte[] buffer = new byte[1024]; - ServletOutputStream out = response.getOutputStream(); - response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(file.getOriginalFileName(), "UTF-8")); - response.getOutputStream(); - while ((len = input.read(buffer)) > 0) { - out.write(buffer, 0, len); - } - input.close(); - out.close(); - } - - /** - * 查询文件列表 - * - * @param functionId 功能枚举类的id SafetyFunctionEnum - * @param statusId 功能对应的状态枚举类的id SafetyInnsiderJobStatusEnum、SafetyOutsiderJobStatusEnum、SafetyCheckStatusEnum - * @Author: lichen - * @Date: 2022/9/20 - **/ - public List list(Integer functionId, Integer statusId) { - return null; - - } - - /** - * 根据bizId删除文件 - * - * @Author: lichen - * @Date: 2022/9/21 - **/ - public void deleteByBizId(String bizId) throws IOException { - List safetyFiles = selectListByWhere(" where biz_id ='" + bizId + "' order by id desc"); - dao.deleteByBizId(bizId); - if (safetyFiles != null) { - for (SafetyFiles item : safetyFiles) { - try { - FileUtil.deleteFile(item.getAbsolutePath()); - } catch (Exception ignored) { - - } - } - } - } - - - public List list(String bizId, Integer functionCode, Integer statusCode) { - List safetyFileList = selectListByWhere(" where biz_id='" + bizId + "' order by status_code asc, upload_time asc"); - Integer oldStatus = 99; - List list =new ArrayList<>(); - List subList = new ArrayList<>(); - SafetyFilesVo vo = new SafetyFilesVo(); - for (SafetyFiles file : safetyFileList) { - if (oldStatus.equals(99)) { - //第一条数据 - vo.setFileListTitle(getFileListTitle(functionCode, file.getStatusCode())); - if (statusCode.equals(file.getStatusCode())) { - vo.setIsEditable(true); - } else { - vo.setIsEditable(false); - } - subList.add(file); - oldStatus = file.getStatusCode(); - } else if (oldStatus.equals(file.getStatusCode())) { - //与上一条数据状态相同的数据 - subList.add(file); - oldStatus = file.getStatusCode(); - } else { - //与上一条数据状态不相同的数据 - // 先完结上一条vo - vo.setFileList(subList); - list.add(vo); - // 再开启新状态的vo - vo = new SafetyFilesVo(); - subList = new ArrayList<>(); - vo.setFileListTitle(getFileListTitle(functionCode, file.getStatusCode())); - if (statusCode.equals(file.getStatusCode())) { - vo.setIsEditable(true); - } else { - vo.setIsEditable(false); - } - subList.add(file); - oldStatus = file.getStatusCode(); - } - } - //最后一条vo添加 - vo.setFileList(subList); - vo.setFileListTitle(getFileListTitle(functionCode,oldStatus)); - if (statusCode.equals(oldStatus)) { - vo.setIsEditable(true); - } else { - vo.setIsEditable(false); - } - list.add(vo); - - return list; - } - - private String getFileListTitle(Integer functionCode, Integer statusCode) { - - if (functionCode.equals(SafetyFunctionEnum.SAFETY_CHECK_DAYLY.getId()) - || functionCode.equals(SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE.getId()) - || functionCode.equals(SafetyFunctionEnum.SAFETY_CHECK_SPECIAL.getId())) { - - return SafetyCheckStatusEnum.getFileListTitleByid(statusCode); - } else if (functionCode.equals(SafetyFunctionEnum.JOB_INSIDER.getId())) { - return SafetyJobInsideStatusEnum.getFileListTitleByid(statusCode); - } else if (functionCode.equals(SafetyFunctionEnum.JOB_OUTSIDER.getId())) { - return SafetyOutsiderJobStatusEnum.getFileListTitleByid(statusCode); - } else { - return "未知名称"; - } - } - - public void picToJSP(String imgUrl,HttpServletRequest request, HttpServletResponse response) - { - FileInputStream in; - response.setContentType("application/octet-stream;charset=UTF-8"); - try { - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String basePath = filepathSever.substring(0, filepathSever.indexOf(contextPath) - 1); - String filepath = basePath + File.separator + uploadPath + File.separator + workspace + File.separator; - //图片读取路径 - in=new FileInputStream(filepath+imgUrl); - int i=in.available(); - byte[]data=new byte[i]; - in.read(data); - in.close(); - //写图片 - OutputStream outputStream=new BufferedOutputStream(response.getOutputStream()); - outputStream.write(data); - outputStream.flush(); - outputStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void picToJSPById(String fileId,HttpServletRequest request, HttpServletResponse response) - { - SafetyFiles safetyFiles = this.selectById(fileId); - String imgUrl = safetyFiles.getFileName(); - FileInputStream in; - response.setContentType("application/octet-stream;charset=UTF-8"); - try { - String contextPath = request.getContextPath().replace("/", ""); - String filepathSever = request.getSession().getServletContext().getRealPath(""); - String basePath = filepathSever.substring(0, filepathSever.indexOf(contextPath) - 1); - String filepath = basePath + File.separator + uploadPath + File.separator + workspace + File.separator; - //图片读取路径 - in=new FileInputStream(filepath+imgUrl); - int i=in.available(); - byte[]data=new byte[i]; - in.read(data); - in.close(); - //写图片 - OutputStream outputStream=new BufferedOutputStream(response.getOutputStream()); - outputStream.write(data); - outputStream.flush(); - outputStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/src/com/sipai/service/safety/SafetyFlowTaskDetailService.java b/src/com/sipai/service/safety/SafetyFlowTaskDetailService.java deleted file mode 100644 index 207c1678..00000000 --- a/src/com/sipai/service/safety/SafetyFlowTaskDetailService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyFlowTaskDetailDao; -import com.sipai.entity.safety.SafetyFlowTaskDetail; -import com.sipai.tools.CommService; -import com.sipai.tools.DateUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.Date; -import java.util.List; - -@Service -public class SafetyFlowTaskDetailService implements CommService { - @Resource - private SafetyFlowTaskDetailDao dao; - - @Override - public SafetyFlowTaskDetail selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return 0; - } - - @Override - public int save(SafetyFlowTaskDetail bean) { - bean.setCreateTime(DateUtil.toStr(null, new Date())); - return dao.insert(bean); - } - - @Override - public int update(SafetyFlowTaskDetail bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - SafetyFlowTaskDetail bean = new SafetyFlowTaskDetail(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - - public void deleteByFlowTaskId(String id) { - SafetyFlowTaskDetail bean = new SafetyFlowTaskDetail(); - bean.setWhere(" where flow_task_id='" + id + "'"); - dao.deleteByWhere(bean); - } -} diff --git a/src/com/sipai/service/safety/SafetyFlowTaskService.java b/src/com/sipai/service/safety/SafetyFlowTaskService.java deleted file mode 100644 index 070975a5..00000000 --- a/src/com/sipai/service/safety/SafetyFlowTaskService.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyFlowTaskDao; -import com.sipai.entity.enums.safety.SafetyCheckConstant; -import com.sipai.entity.safety.SafetyFlowTask; -import com.sipai.entity.safety.SafetyFlowTaskDetail; -import com.sipai.entity.safety.SafetyFlowTaskVo; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.tools.CommService; -import com.sipai.tools.DateUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.xml.rpc.ServiceException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -@Service -public class SafetyFlowTaskService implements CommService { - @Resource - private SafetyFlowTaskDao dao; - @Resource - private SafetyFlowTaskDetailService safetyFlowTaskDetailService; - @Resource - private MsgServiceImpl msgService; - - - @Override - public SafetyFlowTask selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return 0; - } - - public int deleteByBizId(String id) throws IOException { - SafetyFlowTask bean = new SafetyFlowTask(); - bean.setWhere(" where biz_id='"+id +"'"); - safetyFlowTaskDetailService.deleteByFlowTaskId(id); - return dao.deleteByWhere(bean); - } - @Override - public int save(SafetyFlowTask safetyFlowTask) { - safetyFlowTask.setCreateTime(DateUtil.toStr(null, new Date())); - return dao.insert(safetyFlowTask); - } - - @Override - public int update(SafetyFlowTask safetyFlowTask) { - return dao.updateByPrimaryKeySelective(safetyFlowTask); - } - - @Override - public List selectListByWhere(String t) { - SafetyFlowTask bean = new SafetyFlowTask(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(String bizId) { - List taskVoList = new ArrayList<>(); - List taskList = this.selectListByWhere(" where biz_id='" + bizId + "' order by create_time asc"); - for (SafetyFlowTask item : taskList) { - SafetyFlowTaskVo taskVo = new SafetyFlowTaskVo(); - BeanUtils.copyProperties(item, taskVo); - List recordList = safetyFlowTaskDetailService.selectListByWhere(" where flow_task_id='" + item.getId() + "' order by create_time asc"); - if (recordList != null) { - taskVo.setRecordList(recordList); - } - taskVoList.add(taskVo); - } - return taskVoList; - } - - /** - * 流程信息记录 - * - * @Author: lichen - * @Date: 2022/10/9 - **/ - public void saveWorkFlowRecord( - boolean isDone, - String bizId, - String taskTitle, - String auditorId, - String auditorName, - String copyIds, - String copyNames, - String record) throws ServiceException { - - SafetyFlowTask safetyFlowTask; - List list = selectListByWhere(" where biz_id='" + bizId + "' order by create_time desc"); - if (list != null && list.size() != 0 && list.get(0).getTaskName().equals(taskTitle)) { - safetyFlowTask = list.get(0); - safetyFlowTask.setIsDone(true); - safetyFlowTask.setCopy(copyNames); - safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date())); - update(safetyFlowTask); - } else if (list != null && list.size() != 0 && !list.get(0).getTaskName().equals(taskTitle)) { - safetyFlowTask = list.get(0); - safetyFlowTask.setIsDone(true); - safetyFlowTask.setCopy(copyNames); - safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date())); - update(safetyFlowTask); - - safetyFlowTask = new SafetyFlowTask(); - - safetyFlowTask.setId(UUID.randomUUID().toString()); - safetyFlowTask.setBizId(bizId); - safetyFlowTask.setTaskName(taskTitle); - safetyFlowTask.setIsDone(isDone); - safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null); - safetyFlowTask.setAuditor(auditorName); - safetyFlowTask.setCopy(copyNames); - save(safetyFlowTask); - - } else { - safetyFlowTask = new SafetyFlowTask(); - - safetyFlowTask.setId(UUID.randomUUID().toString()); - safetyFlowTask.setBizId(bizId); - safetyFlowTask.setTaskName(taskTitle); - safetyFlowTask.setIsDone(isDone); - safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null); - safetyFlowTask.setAuditor(auditorName); - safetyFlowTask.setCopy(copyNames); - save(safetyFlowTask); - } - if (StringUtils.isNotEmpty(record)) { - SafetyFlowTaskDetail safetyFlowTaskDetail = new SafetyFlowTaskDetail(); - safetyFlowTaskDetail.setId(UUID.randomUUID().toString()); - safetyFlowTaskDetail.setFlowTaskId(safetyFlowTask.getId()); - safetyFlowTaskDetail.setRecord(record); - safetyFlowTaskDetailService.save(safetyFlowTaskDetail); - } - if (StringUtils.isNotEmpty(copyIds) && StringUtils.isNotEmpty(record)) { - // 给编制者发送消息 - msgService.insertMsgSend(SafetyCheckConstant.MSG_TYPE_SAFETY_CHECK, - record, - copyIds, - auditorId, "U"); - } - } -} diff --git a/src/com/sipai/service/safety/SafetyJobInsideActivityService.java b/src/com/sipai/service/safety/SafetyJobInsideActivityService.java deleted file mode 100644 index 64d62bfa..00000000 --- a/src/com/sipai/service/safety/SafetyJobInsideActivityService.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.Result; -import com.sipai.entity.user.Company; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.xml.rpc.ServiceException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class SafetyJobInsideActivityService { - - @Resource - private UnitService unitService; - - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - - @Resource - private WorkflowService workflowService; - - public void closeProcessInstance(String processInstanceId){ - workflowService.getRuntimeService().deleteProcessInstance(processInstanceId,"发起人撤销!"); - - } - - /** - * 发起会签 - * - * @Author: lichen - * @Date: 2022/10/9 - **/ - public String apply(String applyUserId, String signerList, ProcessType processBaseKey, String bizId) throws ServiceException { - Company company = unitService.getCompanyByUserId(applyUserId); - // 判断有无流程定义,如果没有,则启动失败。 - // 流程定义的id - String processKey = processBaseKey.getId() + "-" + company.getId(); - List processDefinitions = - workflowProcessDefinitionService.getProcessDefsBykey(processKey); - if (processDefinitions == null || processDefinitions.size() == 0) { - throw new ServiceException("缺少该流程定义。"); - } - // 启动流程实例 - // 设置网关条件 - Map map = new HashMap<>(); - map.put(CommString.ACTI_KEK_Condition, 1); - map.put(CommString.ACTI_KEK_Assignee, applyUserId); - map.put(CommString.ACTI_KEK_Candidate_Users, applyUserId); - - // 启动流程 - ProcessInstance processInstance = workflowService.startWorkflow( - // 业务主键 - bizId, - // 申请者id - applyUserId, - // 流程Key - processDefinitions.get(0).getKey(), - // 流程变量 - map); - // 判断实例是否启动成功 - // 获取当前任务 - Task task = - workflowService.getTaskService().createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); - Map map2 = new HashMap<>(); - map2.put(CommString.ACTI_KEK_Condition, 1); - List userids = Arrays.asList(signerList.split(",")); - map2.put(CommString.ACTI_KEK_AssigneeList, userids); - workflowService.getTaskService().complete(task.getId(), map2); - - return processInstance.getProcessInstanceId(); - } - - /** - * 会签审核 - * - * @Author: lichen - * @Date: 2022/10/10 - **/ - public Result sign(String nextUserId, String taskId, int pass) { - Task task = - workflowService.getTaskService().createTaskQuery().taskId(taskId).singleResult(); - Map map = new HashMap<>(); - map.put(CommString.ACTI_KEK_Condition, pass); - map.put(CommString.ACTI_KEK_Assignee, nextUserId); - workflowService.getTaskService().complete(task.getId(), map); - return Result.success(); - } - -} diff --git a/src/com/sipai/service/safety/SafetyJobInsideService.java b/src/com/sipai/service/safety/SafetyJobInsideService.java deleted file mode 100644 index 7bfe0423..00000000 --- a/src/com/sipai/service/safety/SafetyJobInsideService.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.sipai.service.safety; - -import com.alibaba.fastjson.JSON; -import com.sipai.dao.safety.SafetyJobInsideDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.safety.*; -import com.sipai.entity.safety.SafetyJobInside; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -@Service -public class SafetyJobInsideService implements CommService { - @Resource - private SafetyJobInsideDao dao; - @Resource - private UserService userService; - @Override - public SafetyJobInside selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyJobInside safetyJobInside) { - return dao.insert(safetyJobInside); - } - - @Override - public int update(SafetyJobInside safetyJobInside) { - return dao.updateByPrimaryKeySelective(safetyJobInside); - } - - @Override - public List selectListByWhere(String t) { - SafetyJobInside bean = new SafetyJobInside(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - return 0; - } - public List getList(SafetyJobCommonQuery query){ - return dao.getList(query); - } - public List getJobCompanyList(){ - return dao.jobCompanyList(); - } - public boolean timeRangeCheck(SafetyJobInside bean) throws ParseException { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Timestamp startTime = new Timestamp(dateFormat.parse(bean.getProjectBeginDate()).getTime()); - Timestamp endTime = new Timestamp(dateFormat.parse(bean.getProjectEndDate()).getTime()); - return endTime.getTime()>=startTime.getTime(); - } - public String createSignDetail(SafetyJobInside bean) { - List list= new ArrayList<>(); - for(String item : bean.getCountersignUserId().split(",")){ - if(StringUtils.isNotEmpty(item)){ - SafetyJobInsideSignInfo info =new SafetyJobInsideSignInfo(); - User user = userService.getUserById(item); - info.setDeptName(user.get_pname()); - info.setUserName(user.getCaption()); - info.setPass("尚未完成"); - info.setTime(""); - info.setRemark(""); - list.add(info); - } - } - - return JSON.toJSONString(list); - } -} diff --git a/src/com/sipai/service/safety/SafetyJobOutsideService.java b/src/com/sipai/service/safety/SafetyJobOutsideService.java deleted file mode 100644 index 0270f7f8..00000000 --- a/src/com/sipai/service/safety/SafetyJobOutsideService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.SafetyJobOutsideDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.safety.*; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.List; - -@Service -public class SafetyJobOutsideService implements CommService { - @Resource - private SafetyJobOutsideDao dao; - - @Override - public SafetyJobOutside selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyJobOutside safetyJobOutside) { - return dao.insert(safetyJobOutside); - } - - @Override - public int update(SafetyJobOutside safetyJobOutside) { - return dao.updateByPrimaryKeySelective(safetyJobOutside); - } - - @Override - public List selectListByWhere(String t) { - SafetyJobOutside bean = new SafetyJobOutside(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - public boolean timeRangeCheck(SafetyJobOutside bean) throws ParseException { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Timestamp startTime = new Timestamp(dateFormat.parse(bean.getProjectBeginDate()).getTime()); - Timestamp endTime = new Timestamp(dateFormat.parse(bean.getProjectEndDate()).getTime()); - return endTime.getTime()>=startTime.getTime(); - } - @Override - public int deleteByWhere(String t) { - return 0; - } - - public List getList(SafetyJobCommonQuery query) { - return dao.getList(query); - } - - public List getJobCompanyList() { - return dao.jobCompanyList(); - } -} diff --git a/src/com/sipai/service/safety/SafetySeqService.java b/src/com/sipai/service/safety/SafetySeqService.java deleted file mode 100644 index 57b5d58f..00000000 --- a/src/com/sipai/service/safety/SafetySeqService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.entity.enums.safety.SafetyFunctionEnum; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.redis.RedisUtil; -import com.sipai.service.user.UnitService; -import org.redisson.api.RBucket; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.concurrent.TimeUnit; - -@Service -public class SafetySeqService { - @Resource - private UnitService unitService; - - @Resource - RedissonClient redissonClient; - - public String code(HttpServletRequest request, SafetyFunctionEnum function) throws Exception { - User cu = (User) request.getSession().getAttribute("cu"); - Company company = this.unitService.getCompanyByUserId(cu.getId()); - String seq = getSeq(function); - return company.getEname()+"-"+function.getCode()+"-"+seq; - -//return "123"; - - } - - private String getSeq(SafetyFunctionEnum function) throws Exception { - - LocalDate now = LocalDate.now(); - String today =now.format(DateTimeFormatter.ofPattern("yyyyMMdd")); - - RBucket bucket = redissonClient.getBucket("SafetySeq:" + function.getName()+":"+ today); - Integer o = (Integer) bucket.get(); - - String seq="0000"; - if(o==null){ - o=1; - }else { - o++; - } - if(o>9999){ - throw new Exception("序列不够用了!"); - } - - bucket.set(o,24, TimeUnit.HOURS); - seq=today+"-"+String.format("%04d",o); - return seq; - } -} diff --git a/src/com/sipai/service/safety/StaffArchivesService.java b/src/com/sipai/service/safety/StaffArchivesService.java deleted file mode 100644 index fc9743a8..00000000 --- a/src/com/sipai/service/safety/StaffArchivesService.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.safety; - -import com.sipai.dao.safety.StaffArchivesDao; -import com.sipai.entity.safety.SafetyStaffArchives; -import com.sipai.entity.safety.SafetyStaffArchivesVo; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -/** - * @author LiTao - * @date 2022-09-19 17:50:33 - * @description: 人员档案管理 - */ -@Service -public class StaffArchivesService implements CommService { - @Resource - private StaffArchivesDao staffArchivesDao; - - - @Override - public SafetyStaffArchives selectById(String userid) { - return staffArchivesDao.selectByPrimaryKey(userid); - } - - @Override - public int deleteById(String t) { - return staffArchivesDao.deleteByPrimaryKey(t); - } - - @Override - public int save(SafetyStaffArchives safetyStaffArchives) { - return staffArchivesDao.insert(safetyStaffArchives); - } - - @Override - public int update(SafetyStaffArchives safetyStaffArchives) { - return staffArchivesDao.updateByPrimaryKeySelective(safetyStaffArchives); - } - - @Override - public List selectListByWhere(String t) { - SafetyStaffArchives safetyStaffArchives = new SafetyStaffArchives(); - safetyStaffArchives.setWhere(t); - List list = staffArchivesDao.selectListByWhere(safetyStaffArchives); - return list; - } - - @Override - public int deleteByWhere(String t) { - SafetyStaffArchives safetyStaffArchives = new SafetyStaffArchives(); - safetyStaffArchives.setWhere(t); - return staffArchivesDao.deleteByWhere(safetyStaffArchives); - } - - - public List selectListByCondition(String t) { - SafetyStaffArchivesVo vo = new SafetyStaffArchivesVo(); - vo.setWhere(t); - List list = staffArchivesDao.selectListByCondition(vo); - return list; - } - - public SafetyStaffArchivesVo selectOneById(String userid) { - return staffArchivesDao.selectOneById(userid); - } - - //从事岗位下拉 - public List> postPulldown() { - return staffArchivesDao.postPulldown(); - } - - // 验证身份证号重复 - public List verifyIdcardRepeat(SafetyStaffArchives safetyStaffArchives){ - return staffArchivesDao.verifyIdcardRepeat(safetyStaffArchives); - } - -} diff --git a/src/com/sipai/service/scada/DataSummaryService.java b/src/com/sipai/service/scada/DataSummaryService.java deleted file mode 100644 index da1cd335..00000000 --- a/src/com/sipai/service/scada/DataSummaryService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.scada; - -import java.util.List; - -import com.sipai.entity.scada.DataSummary; - -public interface DataSummaryService { - - public abstract DataSummary selectById(String bizId, String id); - - public abstract int deleteById(String bizId, String id); - - public abstract int save(String bizId,DataSummary entity); - - public abstract int update(String bizId, DataSummary entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointExpandService.java b/src/com/sipai/service/scada/MPointExpandService.java deleted file mode 100644 index 1164ffef..00000000 --- a/src/com/sipai/service/scada/MPointExpandService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.scada; - - -import com.sipai.entity.scada.MPointExpand; - -import java.util.List; - -public interface MPointExpandService { - public abstract MPointExpand selectById(String bizId, String id); - - public abstract int deleteById(String bizId, String id); - - public abstract int save(String bizId, MPointExpand entity); - - public abstract int update(String bizId, MPointExpand entity); - - public abstract List selectListByWhere(String bizId, String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); -} diff --git a/src/com/sipai/service/scada/MPointFormulaAutoHourService.java b/src/com/sipai/service/scada/MPointFormulaAutoHourService.java deleted file mode 100644 index f534df90..00000000 --- a/src/com/sipai/service/scada/MPointFormulaAutoHourService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.scada; - -import java.util.List; - -import com.sipai.entity.scada.MPointFormulaAutoHour; - -public interface MPointFormulaAutoHourService { - - public abstract MPointFormulaAutoHour selectById(String bizId, String id); - - public abstract int deleteById(String bizId, String id); - - public abstract int save(String bizId,MPointFormulaAutoHour entity); - - public abstract int update(String bizId, MPointFormulaAutoHour entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointFormulaDenominatorService.java b/src/com/sipai/service/scada/MPointFormulaDenominatorService.java deleted file mode 100644 index 8ab9bdfc..00000000 --- a/src/com/sipai/service/scada/MPointFormulaDenominatorService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.scada; - -import java.util.List; - -import com.sipai.entity.scada.MPointFormulaDenominator; - -public interface MPointFormulaDenominatorService { - - public abstract MPointFormulaDenominator selectById(String bizId, String mpointid); - - public abstract int deleteById(String bizId, String mpointid); - - public abstract int save(String bizId,MPointFormulaDenominator entity); - - public abstract int update(String bizId, MPointFormulaDenominator entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointFormulaService.java b/src/com/sipai/service/scada/MPointFormulaService.java deleted file mode 100644 index 34d8777a..00000000 --- a/src/com/sipai/service/scada/MPointFormulaService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.service.scada; - -import java.util.HashMap; -import java.util.List; - -import com.sipai.entity.scada.MPointHistory; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.scada.MPointFormula; - -public interface MPointFormulaService { - - public abstract MPointFormula selectById(String bizId, String mpointid); - - public abstract int deleteById(String bizId, String mpointid); - - public abstract int save(String bizId, MPointFormula entity); - - public abstract int update(String bizId, MPointFormula entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract List selectListByWhereGetMp(String bizId, - String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - - public abstract List> getSpData(String bizId, String execTime, String execType, String inMpids, String mark); - - public abstract List getMpHisDataByUserid(String bizId,String inMpids,String mark); - - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointHistoryService.java b/src/com/sipai/service/scada/MPointHistoryService.java deleted file mode 100644 index 045018ad..00000000 --- a/src/com/sipai/service/scada/MPointHistoryService.java +++ /dev/null @@ -1,433 +0,0 @@ -package com.sipai.service.scada; -import com.sipai.dao.scada.MPointHistoryDao; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.tools.CommUtil; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.BorderStyle; -import org.apache.poi.ss.usermodel.HorizontalAlignment; -import org.apache.poi.ss.usermodel.VerticalAlignment; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.List; - -@Service("mPointHistoryService") -public class MPointHistoryService { - @Resource - private MPointHistoryDao mPointHistoryDao; - @Resource - private MPointService mPointService; - - /* - * Param table 生产库点历史表的表名 如 tb_mp_xxx - * param@wherestr 查询条件 如measuredt=''(注:不含where) - * - * */ - public List selectListByTableAWhere(String bizId, String table ,String wherestr) { - List mpHlistList=mPointHistoryDao.selectListByTableAWhere(table ,wherestr); -// -// MPoint mPoint=mPointService.selectById(bizId, table.replace("TB_MP_", "")); -// String numTail="2"; -// if(mPoint.getNumtail()!=null){ -// numTail=mPoint.getNumtail(); -// } -// String changeDf="#0."; -// for(int n=0;n selectListByTableAWhereForKPI(String bizId, String table ,String wherestr) { - List mpHlistList=mPointHistoryDao.selectListByTableAWhere(table ,wherestr); - return mpHlistList; - } - public List selectListByTableAWhere4insdt(String bizId, String table ,String wherestr) { - List mpHlistList=mPointHistoryDao.selectListByTableAWhere4insdt(table ,wherestr); - return mpHlistList; - } - - public MPointHistory selectSumValueByTableAWhere(String bizId, String table ,String wherestr) { - return mPointHistoryDao.selectSumValueByTableAWhere(table ,wherestr); - } - - public List selectTopNumListByTableAWhere(String bizId, String topNum, String table ,String wherestr) { - return mPointHistoryDao.selectTopNumListByTableAWhere(table ,wherestr,topNum); - } - - public List selectTopNumListByTableMultipleWhere(String bizId, String topNum, String tableA, String tableB ,String wherestr) { - if(tableB==null || tableB.isEmpty()){ - tableB = tableA; - } - return mPointHistoryDao.selectTopNumListByTableMultipleWhere(tableA ,tableB ,wherestr,topNum); - } - - public List getRankHistory(String bizId, String topNum, String table ,String wherestr) { - return mPointHistoryDao.getRankHistory(table ,wherestr,topNum); - } - - public int deleteByTableAWhere(String bizId,String table ,String wherestr) { - return mPointHistoryDao.deleteByTableAWhere(table ,wherestr); - } - - public int dropTable(String bizId, String table) { - return mPointHistoryDao.dropTable(table ); - } - public int save(String bizId,MPointHistory entity) { - return mPointHistoryDao.insertSelective(entity); - } - - /** - * 每小时第一个值 - * @param bizId - * @param table - * @param wherestr - * @param topNum - * @return - */ - public List selectTop1RecordPerHour(String bizId,String table ,String wherestr,String topNum) { - return mPointHistoryDao.selectTop1RecordPerHour(table ,wherestr, topNum); - } - /** - * 每小时第一个值 - * @param bizId - * @param table - * @param wherestr在外层 - * @param topNum - * @return - */ - public List selectTop1RecordPerHour1(String bizId,String table ,String wherestr,String topNum) { - return mPointHistoryDao.selectTop1RecordPerHour1(table ,wherestr, topNum); - } - public List selectReportList(String bizId,String table ,String wherestr,String select) { - return mPointHistoryDao.selectReportList(table ,wherestr, select); - } - - public List selectAggregateList(String bizId,String table ,String wherestr,String select) { - return mPointHistoryDao.selectAggregateList(table ,wherestr, select); - } - - public int updateByMeasureDt(String bizId,MPointHistory entity) { - return mPointHistoryDao.updateByMeasureDt(entity); - } - - public int updateByWhere(String bizId,String tbName,String set, String where) { - return mPointHistoryDao.updateByWhere(tbName,set,where); - } - - - /** - * 每天平均值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectAVGday(String bizId,String topNum,String table ,String wherestr) { - return mPointHistoryDao.selectAVGday(table ,wherestr, topNum); - } - /** - * 每月平均值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectAVGmonth(String bizId,String topNum,String table ,String wherestr) { - return mPointHistoryDao.selectAVGmonth(table ,wherestr, topNum); - } - /** - * 每天平均值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectAVGdayMultiple(String bizId,String topNum,String tableA ,String tableB ,String wherestr) { - if(tableB==null || tableB.isEmpty()){ - tableB = tableA; - } - return mPointHistoryDao.selectAVGdayMultiple(tableA ,tableB ,wherestr, topNum); - } - /** - * 每月平均值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectAVGmonthMultiple(String bizId,String topNum,String tableA ,String tableB ,String wherestr) { - if(tableB==null || tableB.isEmpty()){ - tableB = tableA; - } - return mPointHistoryDao.selectAVGmonthMultiple(tableA ,tableB ,wherestr, topNum); - } - /** - * 平均值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectAVG(String bizId,String table ,String wherestr) { - return mPointHistoryDao.selectAVG(table ,wherestr); - } - /** - * 最大值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectMAX(String bizId,String table ,String wherestr) { - return mPointHistoryDao.selectMAX(table ,wherestr); - } - /** - * 最小值 - * @param bizId - * @param table - * @param wherestr在外层 - * @return - */ - public List selectMIN(String bizId,String table ,String wherestr) { - return mPointHistoryDao.selectMIN(table ,wherestr); - } - - public List selectMpHisDataLeftMpHisChange(String bizId,String table,String mpid ,String wherestr, String dbname) { - return mPointHistoryDao.selectMpHisDataLeftMpHisChange(table ,mpid,wherestr,dbname); - } - - - /** - * 导出历史数据 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadExcel(HttpServletResponse response,List mPointHistory,String mpcode) throws IOException { - String fileName = mpcode+"历史数据"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "历史数据"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4500); - sheet.setColumnWidth(1, 4500); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - //HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - //HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(8, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - //comment.setString(new HSSFRichTextString("请注意")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - //comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "时间,值"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 500); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - //遍历集合数据,产生数据行 - for(int i = 0; i < mPointHistory.size(); i++){ - row = sheet.createRow(i+1);//第二行为插入的数据行 - row.setHeight((short) 500); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(mPointHistory.get(i).getMeasuredt().substring(0, 16)); - break; - case 1://名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(mPointHistory.get(i).getParmvalue().doubleValue()); - break; - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - } - /** - * 导出历史数据模板 - * @param response - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadExcelTemplate(HttpServletResponse response) throws IOException { - String fileName = "历史数据导入模板.xls"; - String title = "历史数据导入模板"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4500); - sheet.setColumnWidth(1, 4500); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 14); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - /*columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN);*/ - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - /*listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN);*/ - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - //HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - //HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(8, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - //comment.setString(new HSSFRichTextString("请注意")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - //comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "测量点,test_01"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 500); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - //产生表格表头 - excelTitleStr = "时间,值"; - excelTitle = excelTitleStr.split(","); - row = sheet.createRow(1); - row.setHeight((short) 500); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - //产生数据行 - row = sheet.createRow(2);//第二行为插入的数据行 - row.setHeight((short) 500); - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue("2023-10-04 00:00:00"); - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(0); - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - } -} diff --git a/src/com/sipai/service/scada/MPointProgrammeDetailService.java b/src/com/sipai/service/scada/MPointProgrammeDetailService.java deleted file mode 100644 index 7f3f2d01..00000000 --- a/src/com/sipai/service/scada/MPointProgrammeDetailService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.sipai.service.scada; -import org.springframework.transaction.annotation.Transactional; -import java.util.List; - -import com.sipai.entity.scada.MPointProgrammeDetail; - -public interface MPointProgrammeDetailService { - public abstract List selectListByWhere(String bizId, - String wherestr); - -} diff --git a/src/com/sipai/service/scada/MPointProgrammeService.java b/src/com/sipai/service/scada/MPointProgrammeService.java deleted file mode 100644 index c48fccb7..00000000 --- a/src/com/sipai/service/scada/MPointProgrammeService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.scada; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.scada.MPointProgramme; - -public interface MPointProgrammeService { - - public abstract MPointProgramme selectById(String bizId, String mpointid); - - public abstract int deleteById(String bizId, String mpointid); - - public abstract int save(String bizId,MPointProgramme entity); - - public abstract int update(String bizId, MPointProgramme entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointPropService.java b/src/com/sipai/service/scada/MPointPropService.java deleted file mode 100644 index c3e515e3..00000000 --- a/src/com/sipai/service/scada/MPointPropService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.scada; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointProp; -import com.sipai.entity.scada.MPointPropSource; - -import java.util.List; -import java.util.concurrent.Future; - -public interface MPointPropService { - - public abstract MPointProp selectById(String bizId, String id); - - public abstract int deleteById(String bizId, String id); - - public abstract int save(String bizId, MPointProp entity); - - public abstract int update(String bizId, MPointProp entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract List selectByPid(String bizId, String pid); - - public abstract int deleteByWhere(String bizId, String wherestr); - - /** - * 根据PointProp的id删除关联测量点的数据 - * @param bizId - * @param list - * @return - */ - public abstract int deletesMPointPropSource(String bizId, - List list); - - public abstract double calculate(String bizId,String mPointPropId,String nowTime); - - public abstract List getChildKPIPoints(String freqUnit); - - public abstract List getChildMPoints(String mpoints); - /** -  * @description: 获取父测量点,结果包含本身 -  * @param -  * @return -  * @author WXP -  * @date 2021/8/27 14:14 -  */ - public abstract List getParentMPoints(String mpointIds); - - public abstract List getChildKPIPointsWithKPIPoints(boolean searchChildFlag,String KPIPoints); - - public abstract int calculateAndSave(String bizId, MPoint mPoint,String nowTime); - - public abstract Future calculateAndSaveAsync(String bizId, MPoint mPoint, String nowTime); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointPropSourceService.java b/src/com/sipai/service/scada/MPointPropSourceService.java deleted file mode 100644 index 8740e4be..00000000 --- a/src/com/sipai/service/scada/MPointPropSourceService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.scada; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointPropSource; -import com.sipai.entity.scada.MPointVectorValue; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; - -import java.util.List; -import java.util.concurrent.Future; - -public interface MPointPropSourceService { - - public abstract MPointPropSource selectById(String bizId, String id); - - public abstract int deleteById(String bizId, String id); - - public abstract int save(String bizId, MPointPropSource entity); - - public abstract int update(String bizId, MPointPropSource entity); - - public abstract List selectListByWhere(NativeSearchQueryBuilder nativeSearchQueryBuilder); - public abstract List selectListByWhere(String bizId,String wherestr); - public abstract List selectListByWhereNoname(String bizId,String wherestr); - public abstract int deleteByWhere(String bizId, String wherestr); - public List selectListWihMPointByWhere(NativeSearchQueryBuilder nativeSearchQueryBuilder); - - public abstract List getValuesByWhere(List mPointPropSources,String nowTime); - public Future getValuesAsyncByWhere(MPointPropSource mPointPropSource, String nowTime); -// public abstract List getValueByWhere(MPointPropSource mPointPropSource); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointPropTargetService.java b/src/com/sipai/service/scada/MPointPropTargetService.java deleted file mode 100644 index bf546d0b..00000000 --- a/src/com/sipai/service/scada/MPointPropTargetService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.scada; - -import com.sipai.entity.scada.MPointPropTarget; - -import java.util.List; - -public interface MPointPropTargetService { - - public abstract MPointPropTarget selectById(String bizId, String id); - - public abstract int deleteById(String bizId, String id); - - public abstract int save(String bizId, MPointPropTarget entity); - - public abstract int update(String bizId, MPointPropTarget entity); - - public abstract List selectListByWhere(String bizId, - String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/MPointService.java b/src/com/sipai/service/scada/MPointService.java deleted file mode 100644 index 920ca15e..00000000 --- a/src/com/sipai/service/scada/MPointService.java +++ /dev/null @@ -1,1765 +0,0 @@ -package com.sipai.service.scada; - -import com.serotonin.modbus4j.sero.util.queue.ByteQueue; -import com.sipai.controller.work.ReadAWriteUtil; -import com.sipai.dao.repository.MPointRepo; -import com.sipai.dao.scada.MPointDao; -import com.sipai.entity.enums.EnableTypeEnum; -import com.sipai.entity.enums.SourceTypeEnum; -import com.sipai.entity.scada.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.work.MPointES; -import com.sipai.entity.work.ModbusFig; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.ModbusFigService; -import com.sipai.service.work.ScadaPic_MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.ValueTypeEnum; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.data.elasticsearch.core.query.SearchQuery; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -import static org.apache.poi.ss.usermodel.CellType.STRING; - -@Service("mPointService") -public class MPointService { - private static Logger logger = Logger.getLogger(MPointService.class); - @Resource - private MPointDao mPointDao; - @Resource - private ModbusFigService modbusFigService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private PersonalMpCollectionService personalMpCollectionService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private MPointRepo mPointRepo; - @Resource - @Lazy - private ScadaPic_MPointService scadaPic_mPointService; - @Resource - @Lazy - private MPointPropService mPointPropService; - @Autowired - private CompanyService companyService; - @Resource - private UnitService unitService; - - public MPoint selectById(String bizId, String id) { - MPoint mPoint = mPointDao.selectByPrimaryKey(id); - if (mPoint != null) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - } - return mPoint; - } - - /** - * es查询 - * - * @param id - * @return - */ - public MPoint selectById(String id) { - if (id == null) { - return null; - } - MPoint mPoint = null; - try { - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - SearchQuery searchQuery = nativeSearchQueryBuilder.withQuery(QueryBuilders.idsQuery().addIds(id)).build(); - List mPoints = mPointRepo.search(searchQuery).getContent(); - - if (mPoints != null && mPoints.size() > 0) { - mPoint = mPoints.get(0); - BigDecimal parmValue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - - /* EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(mPoint.getEquipmentid()); - mPoint.setEquipmentCard(equipmentCard);*/ - } - } catch (Exception e) { - e.printStackTrace(); - System.out.println("点位搜索失败" + e.getMessage()); - } - return mPoint; - } - - //删除数据库 - public int deleteById(String bizId, String id) { - int res = 1; - try { -// String[] ids = id.replace("'", "").split(","); -// for (String i : ids) { -// MPoint mPoint = this.selectById(i); -// String tablename = "tb_mp_" + mPoint.getMpointcode(); -// try { -// mPointHistoryService.dropTable(bizId, tablename); -// } catch (Exception e) { -// // TODO: handle exception -// e.printStackTrace(); -// } -// } - res = mPointDao.deleteByPrimaryKey(id); - if (mPointRepo.existsById(id)) { - mPointRepo.deleteById(id); - } - this.scadaPic_mPointService.deleteByWhere("where mpid ='" + id + "'"); - this.mPointPropService.deleteById(bizId, id); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); -// throw new RuntimeException(); - } - return res; - } - - //删除数据库 + 删除es - public int deleteByIdEs(String bizId, String id) { - int res = 1; - try { - res = mPointDao.deleteByPrimaryKey(id); - ; - if (mPointRepo.existsById(id)) { - mPointRepo.deleteById(id); - } - } catch (Exception e) { - e.printStackTrace(); - } - return res; - } - - @Transactional - public int save(String bizId, MPoint entity) { - int res = 0; - try { - entity.setBizid(bizId); - res = mPointDao.insertSelective(entity); - - try { - //更新es - MPointES mPointES = MPointES.format(entity); - mPointRepo.save(mPointES); - } catch (Exception e) { - System.out.println("mPoint_save------------------" + e.getMessage()); - } - - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } - - @Transactional - public int update(String bizId, MPoint entity) { - int res = 0; - try { - res = mPointDao.updateByPrimaryKeySelective(entity); - try { - //更新es - MPointES mPointES = MPointES.format(entity); - mPointRepo.save(mPointES); - } catch (Exception e) { - e.printStackTrace(); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Transactional - public int update2(String bizId, MPoint entity) { - try { -// entity.setMeasuredt(CommUtil.nowDate()); 日期不要写这里,写调用的时候 - int res = mPointDao.updateByPrimaryKeySelective(entity); - - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Transactional - public int update3(String bizId, MPoint entity) { - int res = 0; - try { - try { - //更新es - MPointES mPointES = MPointES.format(entity); - mPointRepo.save(mPointES); - } catch (Exception e) { - e.printStackTrace(); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public int updateAlarmmax(String bizId, String mpointcode) { - try { -// entity.setMeasuredt(CommUtil.nowDate()); 日期不要写这里,写调用的时候 - int res = mPointDao.updateAlarmmax(mpointcode); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - - public int updateAlarmmin(String bizId, String mpointcode) { - try { -// entity.setMeasuredt(CommUtil.nowDate()); 日期不要写这里,写调用的时候 - int res = mPointDao.updateAlarmmin(mpointcode); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public int updateHalarmmax(String bizId, String mpointcode) { - try { -// entity.setMeasuredt(CommUtil.nowDate()); 日期不要写这里,写调用的时候 - int res = mPointDao.updateHalarmmax(mpointcode); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public int updateLalarmmin(String bizId, String mpointcode) { - try { -// entity.setMeasuredt(CommUtil.nowDate()); 日期不要写这里,写调用的时候 - int res = mPointDao.updateLalarmmin(mpointcode); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - - public List selectListByWhere(String bizId, String wherestr) { -// if (wherestr!=null && !wherestr.isEmpty()) { -// wherestr = "where bizid ='"+bizId+"' and " +wherestr.replace("where", ""); -// }else{ -// wherestr="where bizid ='"+bizId+"'"; -// } - MPoint group = new MPoint(); - group.setWhere(wherestr); - List mPoints = mPointDao.selectListByWhere(group); - for (MPoint item : mPoints) { - item.setText(item.getParmname());//text用于树形显示 - } - return mPoints; - } - - public List selectListByWhereForKPI(String bizId, String wherestr) { - MPoint group = new MPoint(); - group.setWhere(wherestr); - List mPoints = mPointDao.selectListByWhere(group); - for (MPoint item : mPoints) { - item.setText(item.getParmname());//text用于树形显示 - if (StringUtils.isNotBlank(item.getMpointcode())) { - List mPointProps = mPointPropService.selectByPid(bizId, item.getMpointcode()); - if (mPointProps != null && mPointProps.size() > 0) { - item.setmPointProp(mPointProps.get(0)); - } - } - } - return mPoints; - } - - public List selectListByWhereWithBizids(String bizIds, String wherestr) { - if (wherestr != null && !wherestr.isEmpty()) { - wherestr = "where bizid in (" + bizIds + ") and " + wherestr.replace("where", ""); - } else { - wherestr = "where bizid in (" + bizIds + ")"; - } - MPoint group = new MPoint(); - group.setWhere(wherestr); - List mPoints = mPointDao.selectListByWhere(group); - return mPoints; - } - - //删除 - @Transactional - public int deleteByWhere(String bizId, String wherestr) { - int res = 0; - try { - MPoint group = new MPoint(); - group.setWhere(wherestr); - List mPoints = mPointDao.selectListByWhere(group); - res = 0; - for (MPoint mpoint : mPoints) { - res += this.deleteById(mpoint.getBizid(), mpoint.getId()); - } - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } - - public int deleteByIds(String bizId, String ids) { - dropHistoryTable(bizId, ids); - ids = ids.replace(",", "','"); - String wherestr = "where id in ('" + ids + "')"; - MPoint group = new MPoint(); - group.setWhere(wherestr); - return mPointDao.deleteByWhere(group); - } - - /** - * 删除测量点的历史表 - */ - public int dropHistoryTable(String bizId, String ids) { - String[] idss = ids.replace("'", "").split(","); - for (String id : idss) { - MPoint mPoint = this.selectById(bizId, id); - String tablename = "tb_mp_" + mPoint.getMpointcode(); - try { - mPointHistoryService.dropTable(bizId, tablename); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - } - return 1; - } - - /** - * 获取测量点值 - */ - public List getvaluefunc(String bizId, String ids) { - ids = ids.replace(",", "','"); - List result = this.selectListByWhere(bizId, "where id in ('" + ids + "') and valuetype='" + MPoint.Flag_Sql + "'"); - List result_modbus = this.selectListByWhere(bizId, "where id in ('" + ids + "') and valuetype='" + MPoint.Flag_Modbus + "'"); - ////将使用modbus查值的点单独列出,根据modbus协议查值 - getValueWithModbus(result_modbus); - result.addAll(result); - return result; - } - - public void getValueWithModbus(List mData) { - List modbuslist = getmodbuslist(mData); - int i = 0; - if (modbuslist != null && modbuslist.size() > 0) { - for (ModbusFig modbusFig : modbuslist) { - String idStr = modbusFig.getId(); - String ipsever = modbusFig.getIpsever(); - String port = modbusFig.getPort(); - String slaveid = modbusFig.getSlaveid(); - String order32 = modbusFig.getOrder32(); - int min = modbusFig.getMin(); - int max = modbusFig.getMax(); - ByteQueue rece = new ByteQueue(); - rece = ReadAWriteUtil.modbusTCP(ipsever, Integer.parseInt(port), min, max - min + 2); - if (rece != null) { - rece.pop(3); - String recestr = rece.toString(); - //System.out.println(recestr.substring(1, recestr.length()-1)); - String[] s = recestr.substring(1, recestr.length() - 1).split(","); - for (i = 0; i < s.length; i++) { - if (s[i].length() < 2) { - s[i] = "0" + s[i]; - } - } - //mData_temp存储Modbus返回数据 modbusfigid 、register、value - for (MPoint mPoint : mData) { - if (mPoint.getModbusfigid() != null && mPoint.getModbusfigid().equals(idStr)) { - int reg = Integer.parseInt(mPoint.getRegister()) - (min); - float val = 0; - try { - if (order32.equals("4321")) { - val = Float.intBitsToFloat(Integer.parseInt(s[2 * reg] + s[2 * reg + 1] + s[2 * reg + 2] + s[2 * reg + 3], 16)); - //System.out.println("4321:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else if (order32.equals("3412")) { - val = Float.intBitsToFloat(Integer.parseInt(s[2 * reg + 1] + s[2 * reg] + s[2 * reg + 3] + s[2 * reg + 2], 16)); - //System.out.println("3412:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else if (order32.equals("1234")) { - val = Float.intBitsToFloat(Integer.parseInt(s[2 * reg + 3] + s[2 * reg + 2] + s[2 * reg + 1] + s[2 * reg], 16)); - // System.out.println("1234:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else if (order32.equals("2143")) { - val = Float.intBitsToFloat(Integer.parseInt(s[2 * reg + 2] + s[2 * reg + 3] + s[2 * reg] + s[2 * reg + 1], 16)); - //System.out.println("2143:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else { - val = Float.intBitsToFloat(Integer.parseInt(s[2 * reg] + s[2 * reg + 1] + s[2 * reg + 2] + s[2 * reg + 3], 16)); - // System.out.println("4321:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } - } catch (Throwable e) { - System.out.println("error:数据转换时出错!" + e); - } finally { - - } - //DecimalFormat fnum = new DecimalFormat("##0.00"); - //System.out.println(fnum.format(val)); - mPoint.setParmvalue(new BigDecimal(val)); - mPoint.setMeasuredt(CommUtil.formatDate("yyyy-MM-dd HH:mm:ss", new Date())); - //map.put("value", fnum.format(val)+"(Modbus)"); - } - } - } - } - } - } - - /* - * - * //获取modbus发送sever列表 - */ - private List getmodbuslist(List mData) { - List mData_Sever = new ArrayList(); - ////获取测量点所有sever - for (int i = 0; i < mData.size(); i++) { - ModbusFig map = this.modbusFigService.selectById(mData.get(i).getModbusfigid()); - if (!mData_Sever.contains(map)) { - mData_Sever.add(map); - } - } - for (ModbusFig modbusFig : mData_Sever) { - if (modbusFig.getIpsever() == null) { - continue; - } - - int min = 0; - int max = 0; - int j; - //最大值和最小值初始化,初始化的值必须对应到服务器 - for (j = 0; j < mData.size(); j++) { - if (mData.get(j).getModbusfigid() != null && mData.get(j).getModbusfigid().equals(modbusFig.getId())) { - min = Integer.parseInt(mData.get(j).getRegister()); - max = min; - break; - } - } - for (MPoint mPoint : mData) { - if (mPoint.getModbusfigid() != null && mPoint.getModbusfigid().equals(modbusFig.getId())) { - int register = Integer.parseInt(mPoint.getRegister()); - if (min > register) { - min = register; - } - if (max < register) { - max = register; - } - } - } - modbusFig.setMax(max); - modbusFig.setMin(min); - - } - return mData_Sever; - } - - /** - * 根据测量点表达式exp和value,获取表达式结果,满足返回true - */ - public boolean getResByExpression(String exp, double value) { - String[] expressions_strs = exp.split(","); - boolean flag = false; - for (String str : expressions_strs) { - char firstChar = str.charAt(0); - switch (firstChar) { - case '>': - double t = Double.valueOf(str.replace(">", "")); - if (value > t) { - flag = true; - } - break; - case '<': - t = Double.valueOf(str.replace("<", "")); - if (value < t) { - flag = true; - } - break; - case '=': - t = Double.valueOf(str.replace("=", "")); - if (value == t) { - flag = true; - } - break; - - default: - if (str.contains("-")) { - String[] ss = str.split("-"); - double min = Double.valueOf(ss[0]); - double max = Double.valueOf(ss[1]); - if (value >= min && value <= max) { - flag = true; - } - - } else { - t = Double.valueOf(str); - if (value == t) { - flag = true; - } - } - break; - } - //若条件满足则返回 - if (flag) { - return flag; - } - } - - return flag; - } - - /** - * APP需求测量点参数 - * - * @param bizId - * @param id - * @return - */ - public MPoint4APP selectByWhere4APP(String bizId, String id) { - return mPointDao.selectByWhere4APP(id); - } - - public List selectListByWhere4APP(String bizId, String wherestr) { - MPoint4APP mPoint4APP = new MPoint4APP(); - mPoint4APP.setWhere(wherestr); - return mPointDao.selectListByWhere4APP(mPoint4APP); - } - - public List selectListByWhere4APPLeftCollection(String bizId, String wherestr, String userId) { - MPoint4APP mPoint4APP = new MPoint4APP(); - mPoint4APP.setWhere(wherestr); - List list = mPointDao.selectListByWhere4APP(mPoint4APP); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List plist = this.personalMpCollectionService.selectListByWhere(bizId, " where mpids='" + list.get(i).getMpointcode() + "' and userid='" + userId + "' "); - if (plist != null && plist.size() > 0) { - list.get(i).setUserid(userId); - } - } - } - return list; - } - - @SuppressWarnings("unchecked") - @Transactional - public String saveMenualMPoint(JSONArray json, String bizid) { - try { - List mPoints = (List) JSONArray.toCollection(json, MPoint.class); - for (int i = 0; i < mPoints.size(); i++) { - //更新测量点主表 - int res = 0; - mPoints.get(i).setMeasuredt(CommUtil.nowDate());//赋值测量时间 - res = this.update(bizid, mPoints.get(i)); - if (res == 0) { - throw new RuntimeException(); - } - //插入测量点历史表 - int resH = 0; - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(mPoints.get(i).getParmvalue()); - mPointHistory.setMeasuredt(mPoints.get(i).getMeasuredt()); - mPointHistory.setTbName("[TB_MP_" + mPoints.get(i).getMpointcode() + "]"); - resH = this.mPointHistoryService.save(bizid, mPointHistory); - if (resH == 0) { - throw new RuntimeException(); - } - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - return "{\"status\":\"" + CommString.Status_Pass + "\"}"; - } - - public List selectTopNumListByTableAWhere(String bizId, String wherestr) { - MPoint mPoint = new MPoint(); - mPoint.setWhere(wherestr); - return this.mPointDao.selectTopNumListByTableAWhere(mPoint); - } - - public List selectTopNumListByWhere(String bizId, String wherestr, String topNum) { - return this.mPointDao.selectTopNumListByWhere(wherestr, topNum); - } - - public MPoint selectByMpointCode(String mpointcode) { - return mPointDao.selectByMpointCode(mpointcode); - } - - - public List getList4Layer(String bizId, String wherestr) { - MPoint entity = new MPoint(); - entity.setWhere(wherestr); - List mPoints = mPointDao.selectListByWhere(entity); -// for (MPoint item : mPoints) { -// EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(item.getEquipmentid()); -// item.setEquipmentCard(equipmentCard); -// } - return mPoints; - } - - public MPoint selectByWhere(String bizId, String wherestr) { - MPoint entity = new MPoint(); - entity.setWhere(wherestr); - List list = mPointDao.selectListByWhere(entity); - if (list != null && list.size() > 0) { - return list.get(0); - } else { - return null; - } - } - - - /** - * 通过ES搜索查询,返回Page类型 - * - * @param nativeSearchQueryBuilder - * @return - */ - public Page selectListByES(NativeSearchQueryBuilder nativeSearchQueryBuilder) { - SearchQuery searchQuery = nativeSearchQueryBuilder.build(); - Page mPage = mPointRepo.search(searchQuery); - for (MPoint mPoint : mPage) { - if (mPoint.getNumtail() != null) { - BigDecimal value = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - if (value != null) { - try { - mPoint.setParmvalue(value); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - } - } - if(mPoint.getBizid()!=null && !mPoint.getBizid().isEmpty()){ - Unit unit = this.unitService.getUnitById(mPoint.getBizid()); - if (unit != null) { - String unitName = unit.getSname(); - if (unitName == null || unitName.isEmpty()) { - unitName = unit.getName(); - } - mPoint.setBizname(unitName); - } - } - } - return mPage; - } - - @Transactional - public int updateValue(String bizId, MPoint entity, MPointHistory mPointHistory) { - try { - int res = mPointDao.updateByPrimaryKeySelective(entity); - int response = mPointRepo.updateSelective(entity); - MPoint mPoint = this.selectById(bizId, entity.getId()); - if (res == 1) { - mPointHistory.setTbName("TB_MP_" + mPoint.getMpointcode()); - res = mPointHistoryService.save(bizId, mPointHistory); - if (res != 1) { - throw new RuntimeException(); - } - } else { - throw new RuntimeException(); - } - - return res; - } catch (Exception e) { - // TODO: handle exception - logger.error(e.getMessage()); - throw new RuntimeException(); - } - } - - /** - * es查询 - * - * @return - */ - public List selectListByWhere(NativeSearchQueryBuilder nativeSearchQueryBuilder) { - - SearchQuery searchQuery = nativeSearchQueryBuilder.build(); - Page mPage = mPointRepo.search(searchQuery); - List mPoints = mPage.getContent(); - for (MPoint mPoint : mPoints) { - if (mPoint.getNumtail() != null) { - BigDecimal value = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - if (value != null) { - try { - mPoint.setParmvalue(value); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - } - } - } - return mPoints; - - } - - /** - * @author YYJ - * 通过map 获取测量点集合 - */ - public List selectListByES(Map map, Integer page, Integer rows) { - List mpoints = new ArrayList<>(); - try { - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); -// BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - BoolQueryBuilder childBoolQueryBuilder = QueryBuilders.boolQuery(); - //TODO 或与非 - for (Map.Entry entry : map.entrySet()) { - if (entry.getKey() != null && !entry.getKey().isEmpty() && entry.getValue() != null) { - childBoolQueryBuilder.must(QueryBuilders.matchQuery(entry.getKey(), entry.getValue())); - } - } -// boolQueryBuilder.should(childBoolQueryBuilder); - nativeSearchQueryBuilder.withQuery(childBoolQueryBuilder); - if (page != null && rows != null && page > 0 && rows > 0) { - nativeSearchQueryBuilder.withPageable(PageRequest.of(page - 1, rows)); - } - SearchQuery searchQuery = nativeSearchQueryBuilder.build(); - Page mPage = mPointRepo.search(searchQuery); - for (MPoint mPoint : mPage) { - if (mPoint.getNumtail() != null) { - BigDecimal value = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - if (value != null) { - try { - mPoint.setParmvalue(value); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - } - } - } - mpoints = mPage.getContent(); - nativeSearchQueryBuilder = null; -// boolQueryBuilder = null; - childBoolQueryBuilder = null; - searchQuery = null; - mPage = null; - } catch (Exception e) { - e.printStackTrace(); - } - return mpoints; - } - - /** - * 将mpoint数组转化成mpoint4APP数组 - * - * @return - */ - public List copyProperties2Unit(List mpoints) { - List mPointList = new ArrayList(); - for (MPoint mpoint : mpoints) { - MPoint4APP mPoint4APP = new MPoint4APP(); - BeanUtils.copyProperties(mpoint, mPoint4APP); - mPointList.add(mPoint4APP); - } - return mPointList; - } - - /** - * 测量点导出 - * - * @param response - * @param unitId - * @throws IOException - */ - public void doExport(String unitId, HttpServletRequest request, - HttpServletResponse response - ) throws IOException { - - String fileName = "测量点.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "测量点"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 4000); - sheet.setColumnWidth(6, 4000); - sheet.setColumnWidth(7, 4000); - sheet.setColumnWidth(8, 4000); - sheet.setColumnWidth(9, 4000); - sheet.setColumnWidth(10, 4000); - sheet.setColumnWidth(11, 4000); - sheet.setColumnWidth(12, 4000); - sheet.setColumnWidth(13, 4000); - sheet.setColumnWidth(14, 4000); - sheet.setColumnWidth(15, 4000); - sheet.setColumnWidth(16, 4000); - sheet.setColumnWidth(17, 4000); - sheet.setColumnWidth(18, 4000); - sheet.setColumnWidth(19, 4000); - sheet.setColumnWidth(20, 4000); - sheet.setColumnWidth(21, 4000); - sheet.setColumnWidth(22, 4000); - sheet.setColumnWidth(23, 4000); - sheet.setColumnWidth(24, 4000); - sheet.setColumnWidth(25, 4000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "ID,隶属,mpointid,mpointcode,名称,简称,所属工艺段,含义," + - "信号类型,信号标签,报警上限,报警下限,报警超上限,报警超下限,量程上限,量程下限," + - "精度,倍率,采集类型,信号源,单位,关联设备,报警状态,启用状态,网关编号,数值取反"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("测量点"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - String mpidss = request.getParameter("mpids"); - MPoint entity = new MPoint(); - if (StringUtils.isNotBlank(mpidss)) { - mpidss = mpidss.substring(0, mpidss.length() - 1); - mpidss = mpidss.replace(",", "','"); - entity.setWhere("where id in ('" + mpidss + "')"); - } - List list = mPointDao.selectListByWhere(entity); - if (list != null && list.size() > 0) { - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(2 + i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //ID - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(StringUtils.isNotBlank(list.get(i).getId()) ? list.get(i).getId() : ""); - //隶属 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(StringUtils.isNotBlank(list.get(i).getBizname()) ? list.get(i).getBizname() : ""); - //mpointid - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(StringUtils.isNotBlank(list.get(i).getMpointid()) ? list.get(i).getMpointid() : ""); - //mpointcode - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(StringUtils.isNotBlank(list.get(i).getMpointcode()) ? list.get(i).getMpointcode() : ""); - //名称 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(StringUtils.isNotBlank(list.get(i).getParmname()) ? list.get(i).getParmname() : ""); - //简称 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(StringUtils.isNotBlank(list.get(i).getDisname()) ? list.get(i).getDisname() : ""); - //所属工艺段 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - String processsectioncode = list.get(i).getProcesssectioncode(); - cell_6.setCellValue(processsectioncode); -// if (processSectionService.selectListByWhere("where id = '" + list.get(i).getProcesssectioncode() + "'") != null) { -// cell_6.setCellValue(processSectionService.selectListByWhere("where id = '" + list.get(i).getProcesssectioncode() + "'").get(0).getName()); -// } - //含义 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(StringUtils.isNotBlank(list.get(i).getValuemeaning()) ? list.get(i).getValuemeaning() : ""); - //信号类型 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(StringUtils.isNotBlank(list.get(i).getSignaltype()) ? list.get(i).getSignaltype() : ""); - //信号标签 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(StringUtils.isNotBlank(list.get(i).getSignaltag()) ? list.get(i).getSignaltag() : ""); - //报警上限 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getAlarmmax() != null ? list.get(i).getAlarmmax() + "" : ""); - //报警下限 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(list.get(i).getAlarmmin() != null ? list.get(i).getAlarmmin() + "" : ""); - //报警超上限 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(list.get(i).getHalarmmax() != null ? list.get(i).getHalarmmax() + "" : ""); - //报警超下限 - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(list.get(i).getLalarmmin() != null ? list.get(i).getLalarmmin() + "" : ""); - //量程上限 - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(list.get(i).getForcemax() != null ? list.get(i).getForcemax() + "" : ""); - //量程下限 - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(list.get(i).getLalarmmin() != null ? list.get(i).getLalarmmin() + "" : ""); - //精度 - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(list.get(i).getNumtail() != null ? list.get(i).getNumtail() + "" : ""); - //倍率 - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(list.get(i).getRate() != null ? list.get(i).getRate() + "" : ""); - //采集类型 - HSSFCell cell_18 = row.createCell(18); - cell_18.setCellStyle(listStyle); - cell_18.setCellValue(StringUtils.isNotBlank(list.get(i).getSourceType()) ? SourceTypeEnum.getNameById(list.get(i).getSourceType()) : ""); - //信号源 - HSSFCell cell_19 = row.createCell(19); - cell_19.setCellStyle(listStyle); - cell_19.setCellValue(StringUtils.isNotBlank(list.get(i).getValuetype()) ? ValueTypeEnum.getValue(list.get(i).getValuetype()) : ""); - //单位 - HSSFCell cell_20 = row.createCell(20); - cell_20.setCellStyle(listStyle); - cell_20.setCellValue(StringUtils.isNotBlank(list.get(i).getUnit()) ? list.get(i).getUnit() : ""); - //关联设备 - HSSFCell cell_21 = row.createCell(21); - cell_21.setCellStyle(listStyle); - cell_21.setCellValue(StringUtils.isNotBlank(list.get(i).getEquipmentid()) ? list.get(i).getEquipmentid() : ""); - //报警状态 - HSSFCell cell_22 = row.createCell(22); - cell_22.setCellStyle(listStyle); - if (StringUtils.isNotBlank(list.get(i).getTriggeralarm())) { - cell_22.setCellValue(EnableTypeEnum.getNameByid(Integer.parseInt(list.get(i).getTriggeralarm()))); - } else { - cell_22.setCellValue(""); - } - - //启用状态 - HSSFCell cell_23 = row.createCell(23); - cell_23.setCellStyle(listStyle); - cell_23.setCellValue(StringUtils.isNotBlank(list.get(i).getActive()) ? list.get(i).getActive() : ""); - //网关编号 - HSSFCell cell_24 = row.createCell(24); - cell_24.setCellStyle(listStyle); - cell_24.setCellValue(StringUtils.isNotBlank(list.get(i).getBiztype()) ? list.get(i).getBiztype() : ""); - //数值取反 - HSSFCell cell_25 = row.createCell(25); - cell_25.setCellStyle(listStyle); - if (StringUtils.isNotBlank(list.get(i).getDirecttype())) { - cell_25.setCellValue(EnableTypeEnum.getNameByid(Integer.parseInt(list.get(i).getDirecttype()))); - } else { - cell_25.setCellValue(""); - } - - } - - int rownum = 2;//第2行开始 - - //设备大类合并单元格 - for (Iterator iter = jsonObject1.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - //设备小类合并单元格 - for (Iterator iter = jsonObject2.keys(); iter.hasNext(); ) { - String key = (String) iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(String unitId, InputStream input, String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - //如果表头小于26列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 26) { - continue; - } - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - /*if (null == row || null == row.getCell(3) || "".equals(row.getCell(3))) { - continue; - }*/ - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = 0;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - MPoint mPoint = new MPoint(); - mPoint.setBizid(unitId); - String flag = ""; - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (i == 0) { - String id = getStringVal(cell); - if (StringUtils.isBlank(id)) { - break; - } - } - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - try { - switch (i) { - case 0://ID - //根据excel中的厂区来保存 - String id = getStringVal(cell); - MPoint mPoint1 = new MPoint(); - mPoint1.setWhere("where id = '" + id + "'"); - List list = mPointDao.selectListByWhere(mPoint1); - if (list != null) { - if (list.size() > 0) { - flag = "update"; - } else { - flag = "insert"; - } - } else { - flag = "insert"; - } - mPoint.setId(id); - break; - case 1://隶属 - String bizName = getStringVal(cell); - mPoint.setBizname(bizName); - break; - case 2://mpointid - String mpointid = getStringVal(cell); - mPoint.setMpointid(mpointid); - break; - case 3://mpointcode - mPoint.setMpointcode(getStringVal(cell)); - break; - case 4://名称 - mPoint.setParmname(getStringVal(cell)); - break; - case 5://简称 - mPoint.setDisname(getStringVal(cell)); - break; - case 6://所属工艺段 - mPoint.setProcesssectioncode(getStringVal(cell)); - break; - case 7://含义 - mPoint.setValuemeaning(getStringVal(cell)); - break; - case 8://信号类型 - mPoint.setSignaltype(getStringVal(cell)); - break; - case 9://信号标签 - mPoint.setSignaltag(getStringVal(cell)); - break; - case 10://报警上限 - mPoint.setAlarmmax(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 11://报警下限 - mPoint.setAlarmmin(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 12://报警超上限 - mPoint.setHalarmmax(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 13://报警超下限 - mPoint.setLalarmmin(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 14://量程上限 - mPoint.setForcemax(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 15://量程下限 - mPoint.setForcemin(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 16://精度 - mPoint.setNumtail(getStringVal(cell)); - break; - case 17://倍率 - mPoint.setRate(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 18://采集类型 - mPoint.setSourceType(SourceTypeEnum.getIdByName(getStringVal(cell))); - break; - case 19://信号源 - mPoint.setValuetype(ValueTypeEnum.getIdByName(getStringVal(cell))); - break; - case 20://单位 - mPoint.setUnit(getStringVal(cell)); - break; - case 21://关联设备 - mPoint.setEquipmentid(getStringVal(cell)); - break; - case 22://报警状态 - mPoint.setTriggeralarm(String.valueOf(EnableTypeEnum.getIdByName(getStringVal(cell)))); - break; - case 23://启用状态 - mPoint.setActive(getStringVal(cell)); - break; - case 24://网关编号 - mPoint.setBiztype(getStringVal(cell)); - break; - case 25://数值取反 - mPoint.setDirecttype(String.valueOf(EnableTypeEnum.getIdByName(getStringVal(cell)))); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - - /*String contractIds = ""; - if (contractNumber != null && !contractNumber.equals("")) { - contractNumber = contractNumber.replace(",", "','"); - List contractList = this.contractService.selectListByWhere("where contractNumber in ('" + contractNumber + "') order by insdt desc"); - for (Contract contract : contractList) { - contractIds += contract.getId() + ","; - } - if (contractIds != null && !contractIds.equals("") && contractIds.length() > 0) { - contractIds = contractIds.substring(0, contractIds.length() - 1); - } - }*/ - - if (mPoint != null) { - if (flag != null && flag.equals("insert")) { - insertNum += this.mPointDao.insert(mPoint); - } - if (flag != null && flag.equals("update")) { - updateNum += this.mPointDao.updateByPrimaryKeySelective(mPoint); - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - return result; - } - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsx(String unitId, InputStream input, String userId) throws IOException { - Company company = companyService.selectByPrimaryKey(unitId); - if (company != null) { - if (!company.getType().equals("B")) { - return "请选择公司级"; - } - } else { - return "请选择公司级"; - } - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(2); - //如果表头小于26列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 26) { - continue; - } - MPoint mPoint = new MPoint(); - String flag = ""; - String assetTypeNum = ""; - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - XSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell cell = row.getCell(i); - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - if (i == 0) { - String id = getStringVal(cell); - if (StringUtils.isBlank(id)) { - break; - } - } - try { - switch (i) { - case 0://ID - //根据excel中的厂区来保存 - String id = getStringVal(cell); - MPoint mPoint1 = new MPoint(); - mPoint1.setWhere("where id = '" + id + "'"); - List list = mPointDao.selectListByWhere(mPoint1); - if (list != null) { - if (list.size() > 0) { - flag = "update"; - } else { - flag = "insert"; - } - } else { - flag = "insert"; - } - mPoint.setId(id); - break; - case 1://隶属 - String bizName = getStringVal(cell); - mPoint.setBizname(bizName); - break; - case 2://mpointid - String mpointid = getStringVal(cell); - mPoint.setMpointid(mpointid); - break; - case 3://mpointcode - mPoint.setMpointcode(getStringVal(cell)); - break; - case 4://名称 - mPoint.setParmname(getStringVal(cell)); - break; - case 5://简称 - mPoint.setDisname(getStringVal(cell)); - break; - case 6://所属工艺段 - mPoint.setProcesssectioncode(getStringVal(cell)); - break; - case 7://含义 - mPoint.setValuemeaning(getStringVal(cell)); - break; - case 8://信号类型 - mPoint.setSignaltype(getStringVal(cell)); - break; - case 9://信号标签 - mPoint.setSignaltag(getStringVal(cell)); - break; - case 10://报警上限 - mPoint.setAlarmmax(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 11://报警下限 - mPoint.setAlarmmin(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 12://报警超上限 - mPoint.setHalarmmax(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 13://报警超下限 - mPoint.setLalarmmin(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 14://量程上限 - mPoint.setForcemax(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 15://量程下限 - mPoint.setForcemin(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 16://精度 - mPoint.setNumtail(getStringVal(cell)); - break; - case 17://倍率 - mPoint.setRate(StringUtils.isNotBlank(getStringVal(cell)) ? new BigDecimal(getStringVal(cell)) : null); - break; - case 18://采集类型 - mPoint.setSourceType(SourceTypeEnum.getIdByName(getStringVal(cell))); - break; - case 19://信号源 - mPoint.setValuetype(ValueTypeEnum.getIdByName(getStringVal(cell))); - break; - case 20://单位 - mPoint.setUnit(getStringVal(cell)); - break; - case 21://关联设备 - mPoint.setEquipmentid(getStringVal(cell)); - break; - case 22://报警状态 - mPoint.setTriggeralarm(String.valueOf(EnableTypeEnum.getIdByName(getStringVal(cell)))); - break; - case 23://启用状态 - mPoint.setActive(getStringVal(cell)); - break; - case 24://网关编号 - mPoint.setBiztype(getStringVal(cell)); - break; - case 25://数值取反 - mPoint.setDirecttype(String.valueOf(EnableTypeEnum.getIdByName(getStringVal(cell)))); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - if (mPoint != null) { - if (flag != null && flag.equals("insert")) { - insertNum += this.mPointDao.insert(mPoint); - } - if (flag != null && flag.equals("update")) { - updateNum += this.mPointDao.updateByPrimaryKeySelective(mPoint); - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - if (updateNum > 0) { - result += "更新成功数据" + updateNum + "条;"; - } - return result; - } - - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXlsHis(String unitId, String mpid, InputStream input, String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(1); - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - int minCellNum = 0;//读取数据从第1列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - try { - switch (i) { - case 0:// 时间 - String measuredt = getStringVal(cell); - mPointHistory.setMeasuredt(measuredt); - break; - case 1:// 值 - String parmValue = getStringVal(cell); - BigDecimal value = new BigDecimal(parmValue); - mPointHistory.setParmvalue(value); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - if (mPointHistory != null) { - insertNum += mPointHistoryService.save(unitId, mPointHistory); - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - return result; - } - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsxHis(String unitId, String mpid, InputStream input, String userId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - XSSFRow row = sheet.getRow(rowNum); - - int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell cell = row.getCell(i); - try { - switch (i) { - case 0:// 时间 - String measuredt = getStringVal(cell); - mPointHistory.setMeasuredt(measuredt); - break; - case 1:// 值 - String parmValue = getStringVal(cell); - BigDecimal value = new BigDecimal(parmValue); - mPointHistory.setParmvalue(value); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - if (mPointHistory != null) { - insertNum += mPointHistoryService.save(unitId, mPointHistory); - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - return result; - } - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXlsHisMultiple(String unitId, InputStream input) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - //获取第一行。点位名称 - HSSFRow mpidRow = sheet.getRow(0); - //第二行开始。获取时间和数据 - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - HSSFCell cell_measuredt = row.getCell(0); - String measuredt = getStringVal(cell_measuredt); - int minCellNum = 1;//读取数据从第2列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell mpidCell = mpidRow.getCell(i); - String mpidStr = getStringVal(mpidCell); - MPoint mPoint = this.selectByWhere(unitId,"where MPointCode like '%"+mpidStr+"%' or ParmName like '%"+mpidStr+"%' "); - if(mPoint!=null){ - String mpid = mPoint.getMpointcode(); - MPointHistory mPointHistory = new MPointHistory(); - boolean st = true; - List mPointHistorys = mPointHistoryService.selectListByTableAWhere(unitId,"[TB_MP_" + mpid + "]", - "where MeasureDT='"+measuredt+"' order by MeasureDT "); - if(mPointHistorys!=null && mPointHistorys.size()>0){ - mPointHistory= mPointHistorys.get(0); - st = false; - } - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - mPointHistory.setMeasuredt(measuredt); - HSSFCell cell = row.getCell(i); - String parmValue = getStringVal(cell); - BigDecimal value = new BigDecimal(parmValue); - mPointHistory.setParmvalue(value); - if (mPointHistory != null) { - if(st){ - insertNum += mPointHistoryService.save(unitId, mPointHistory); - }else{ - insertNum += mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - } - } - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - return result; - } - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsxHisMultiple(String unitId, InputStream input) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - //获取第一行。点位名称 - XSSFRow mpidRow = sheet.getRow(0); - //第二行开始。获取时间和数据 - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - XSSFRow row = sheet.getRow(rowNum); - XSSFCell cell_measuredt = row.getCell(0); - String measuredt = getStringVal(cell_measuredt); - int minCellNum = 1;//读取数据从第2列开始,第一列为时间 - int maxCellNum = row.getLastCellNum();//最后一列 - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell mpidCell = mpidRow.getCell(i); - String mpidStr = getStringVal(mpidCell); - MPoint mPoint = this.selectByWhere(unitId,"where MPointCode like '%"+mpidStr+"%' or ParmName like '%"+mpidStr+"%' "); - if(mPoint!=null) { - boolean st = true; - String mpid = mPoint.getMpointcode(); - MPointHistory mPointHistory = new MPointHistory(); - List mPointHistorys = mPointHistoryService.selectListByTableAWhere(unitId,"[TB_MP_" + mpid + "]", - "where MeasureDT='"+measuredt+"' order by MeasureDT "); - if(mPointHistorys!=null && mPointHistorys.size()>0){ - mPointHistory= mPointHistorys.get(0); - st = false; - } - mPointHistory.setTbName("[TB_MP_" + mpid + "]"); - mPointHistory.setMeasuredt(measuredt); - XSSFCell cell = row.getCell(i); - String parmValue = getStringVal(cell); - BigDecimal value = new BigDecimal(parmValue); - mPointHistory.setParmvalue(value); - if (mPointHistory != null) { - if(st){ - insertNum += mPointHistoryService.save(unitId, mPointHistory); - }else{ - insertNum += mPointHistoryService.updateByMeasureDt(unitId, mPointHistory); - } - } - } - } - } - } - String result = ""; - if (insertNum > 0) { - result += "新增成功数据" + insertNum + "条;"; - } - return result; - } -} diff --git a/src/com/sipai/service/scada/OEProcessService.java b/src/com/sipai/service/scada/OEProcessService.java deleted file mode 100644 index 815079c6..00000000 --- a/src/com/sipai/service/scada/OEProcessService.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.service.scada; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.activiti.OEProcessDao; -import com.sipai.entity.activiti.OEProcess; -import com.sipai.tools.CommService; - - -@Service -public class OEProcessService implements CommService{ - @Resource - private OEProcessDao oeProcessDao; - - @Override - public OEProcess selectById(String t) { - // TODO Auto-generated method stub - return oeProcessDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return oeProcessDao.deleteByPrimaryKey(t); - - } - - @Override - public int save(OEProcess t) { - // TODO Auto-generated method stub - return oeProcessDao.insertSelective(t); - } - - @Override - public int update(OEProcess t) { - // TODO Auto-generated method stub - return oeProcessDao.updateByPrimaryKeySelective(t); - - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - OEProcess oeProcess = new OEProcess(); - oeProcess.setWhere(t); - return oeProcessDao.selectListByWhere(oeProcess); - } - - @Override - public int deleteByWhere(String t) { - // TODO Auto-generated method stub - OEProcess oeProcess = new OEProcess(); - oeProcess.setWhere(t); - return oeProcessDao.deleteByWhere(oeProcess); - } - - - public OEProcess selectByIdOAELM(String dataSources,String t) { - // TODO Auto-generated method stub - return oeProcessDao.selectByPrimaryKey(t); - } - - - public int deleteByIdOAELM(String dataSources,String t) { - // TODO Auto-generated method stub - return oeProcessDao.deleteByPrimaryKey(t); - - } - - - public int saveOAELM(String dataSources,OEProcess t) { - // TODO Auto-generated method stub - return oeProcessDao.insertSelective(t); - } - - - public int updateOAELM(String dataSources,OEProcess t) { - // TODO Auto-generated method stub - return oeProcessDao.updateByPrimaryKeySelective(t); - - } - - public int deleteByWhereOAELM(String dataSources,String t) { - // TODO Auto-generated method stub - OEProcess oeProcess = new OEProcess(); - oeProcess.setWhere(t); - return oeProcessDao.deleteByWhere(oeProcess); - } - - - public List selectListByWhereOAELM(String dataSources,String t) { - // TODO Auto-generated method stub - OEProcess oeProcess = new OEProcess(); - oeProcess.setWhere(t); - return oeProcessDao.selectListByWhere(oeProcess); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/PersonalMpCollectionService.java b/src/com/sipai/service/scada/PersonalMpCollectionService.java deleted file mode 100644 index e4a85077..00000000 --- a/src/com/sipai/service/scada/PersonalMpCollectionService.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.sipai.service.scada; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.scada.PersonalMpCollectionDao; -import com.sipai.entity.scada.PersonalMpCollection; -import com.sipai.tools.CommService; - -@Service -public class PersonalMpCollectionService{ - @Resource - private PersonalMpCollectionDao personalMpCollectionDao; - public PersonalMpCollection selectById(String bizId,String id) { - return personalMpCollectionDao.selectByPrimaryKey(id); - } - - public int deleteById(String bizId,String id) { - return personalMpCollectionDao.deleteByPrimaryKey(id); - } - - public int save(String bizId,PersonalMpCollection entity) { - return personalMpCollectionDao.insert(entity); - } - - public int update(String bizId,PersonalMpCollection entity) { - return personalMpCollectionDao.updateByPrimaryKeySelective(entity); - } - - public List selectListByWhere(String bizId,String wherestr) { - PersonalMpCollection group = new PersonalMpCollection(); - group.setWhere(wherestr); - return personalMpCollectionDao.selectListByWhere(group); - } - - public int deleteByWhere(String bizId,String wherestr) { - PersonalMpCollection group = new PersonalMpCollection(); - group.setWhere(wherestr); - return personalMpCollectionDao.deleteByWhere(group); - } - - - -} diff --git a/src/com/sipai/service/scada/ProAlarmBaseTextService.java b/src/com/sipai/service/scada/ProAlarmBaseTextService.java deleted file mode 100644 index cbc13779..00000000 --- a/src/com/sipai/service/scada/ProAlarmBaseTextService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.service.scada; - -import com.sipai.entity.scada.ProAlarmBaseText; - -import java.util.List; - -public interface ProAlarmBaseTextService { - - public abstract ProAlarmBaseText selectById(String unitId, String id); - - public abstract int deleteById(String unitId, String id); - - public abstract int save(String unitId, ProAlarmBaseText entity); - - public abstract int update(String unitId, ProAlarmBaseText entity); - - public abstract List selectListByWhere(String unitId, String wherestr); - - public abstract List selectListByWhere2(String unitId, String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - - public abstract List selectCountByWhere(String unitId, String wherestr); - - /** - * 获取指定条件内的数据量 - * - * @param wherestr - * @param str - * @return - */ - public abstract List selectNumFromDateByWhere(String unitId,String wherestr, String str); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/ProAlarmDataStopHisPointService.java b/src/com/sipai/service/scada/ProAlarmDataStopHisPointService.java deleted file mode 100644 index 18b649bc..00000000 --- a/src/com/sipai/service/scada/ProAlarmDataStopHisPointService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.scada; - -import com.sipai.entity.scada.ProAlarmDataStopHisPoint; - -import java.util.List; - -public interface ProAlarmDataStopHisPointService { - - public abstract ProAlarmDataStopHisPoint selectById(String unitId, String id); - - public abstract int deleteById(String unitId, String id); - - public abstract int save(String unitId, ProAlarmDataStopHisPoint entity); - - public abstract int update(String unitId, ProAlarmDataStopHisPoint entity); - - public abstract List selectListByWhere(String unitId, String wherestr); - - public abstract int deleteByWhere(String bizId, String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/ProAlarmService.java b/src/com/sipai/service/scada/ProAlarmService.java deleted file mode 100644 index ab6a4418..00000000 --- a/src/com/sipai/service/scada/ProAlarmService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.sipai.service.scada; - -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.user.ProcessSection; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -public interface ProAlarmService { - - public abstract ProAlarm selectById(String unitId, String id); - - public abstract int deleteById(String unitId, String id); - - public abstract int save(String unitId, ProAlarm entity); - - public abstract int update(String unitId, ProAlarm entity); - - public abstract List selectListByWhere(String unitId, String wherestr); - - public abstract int recoverAlarmByWhere(String bizid, String wherestr, String nowTime, String value); - - public abstract List selectCountByWhere(String unitId, String wherestr); - - public abstract void topAlarmNumC(HttpServletRequest request, String point, String type); - - public abstract List selectTop1ListByWhere(String unitId, String wherestr); - - public abstract List selectTopNumListByWhere(String unitId, String wherestr, String num); - - /** - * 获取指定条件内的数据量 - * - * @param wherestr - * @param str - * @return - */ - public abstract List selectNumFromDateByWhere(String unitId, String wherestr, String str); - -} \ No newline at end of file diff --git a/src/com/sipai/service/scada/ScadaAlarmService.java b/src/com/sipai/service/scada/ScadaAlarmService.java deleted file mode 100644 index ec83e5fe..00000000 --- a/src/com/sipai/service/scada/ScadaAlarmService.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.sipai.service.scada; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.ScadaAlarmDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ScadaAlarm; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.DateSpan; -import com.sipai.tools.DateUtil; - -@Service -public class ScadaAlarmService { - @Resource - private ScadaAlarmDao scadaAlarmDao; - - public ScadaAlarm selectById(String bizId,String id) { - return scadaAlarmDao.selectByPrimaryKey(id); - } - - public int deleteById(String bizId,String id) { - return scadaAlarmDao.deleteByPrimaryKey(id); - } - - public int save(String bizId,ScadaAlarm entity) { - return scadaAlarmDao.insert(entity); - } - - @Transactional - public int update(String bizId,ScadaAlarm entity) { - try { - int res= scadaAlarmDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - /** - * 查询基础方法 - * @param bizId - * @param wherestr - * @return - */ - public List selectListByWhere(String bizId,String wherestr) { - ScadaAlarm group = new ScadaAlarm(); - group.setWhere(wherestr); - List scadaAlarms =scadaAlarmDao.selectListByWhere(group); - return scadaAlarms; - } - /** - * 整理过报警状态的查询方法,查询效率慢,建议后期处理 - * @param bizId - * @param wherestr - * @return - */ - public List getListByWhere(String bizId,String wherestr) { - String whereStr_Alarm=""; - if (wherestr!=null && !wherestr.isEmpty()) { - whereStr_Alarm= "where status='"+ScadaAlarm.STATUS_ALARM+"' and "+wherestr.replace("where", ""); - if (!wherestr.contains("order")) { - whereStr_Alarm+=" order by insdt desc"; - } - } - List scadaAlarms =this.selectListByWhere(bizId,whereStr_Alarm); - if(scadaAlarms!=null&&scadaAlarms.size()>0){ - for (ScadaAlarm scadaAlarm : scadaAlarms) { - String whereStr_Alarm_Recover = "where insdt>'"+scadaAlarm.getInsdt()+ - "' and mpoint_code ='"+scadaAlarm.getMpointCode()+"' and status <>'"+ScadaAlarm.STATUS_ALARM+"' order by insdt asc"; - List scadaAlarms_ =this.selectListByWhere(bizId,whereStr_Alarm_Recover); - if (scadaAlarms_.size()>0) { - for (ScadaAlarm item : scadaAlarms_) { - scadaAlarm.setStatus(item.getStatus()); - //若检测到恢复则最终结果就是报警恢复 - if (ScadaAlarm.STATUS_ALARM_RECOVER.equals(item.getStatus())) { - break; - } - } - - } - } - } - return scadaAlarms; - } - - /** - * 根据时间跨度获取不同跨度的报警数量(未解除报警和已解除的报警) - * @param bizId - * @param processSectionCode - * @param dateSpan - * @return - */ - public List> getAmountByDateSpan(String bizId,String processSectionCode, String dateSpan,String nowDate) { - List datas=null; - Date dateNow =DateUtil.toDate(nowDate); - String dateStart =""; - String dateEnd =""; - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String unit =""; - if (DateSpan.YEAR.toString().equals(dateSpan)) { - datas = DateUtil.yearMonthList(dateNow); - dateStart=sdf.format(DateUtil.getYearStartTime(dateNow)) ; - dateEnd=sdf.format(DateUtil.getYearEndTime(dateNow)); - unit="月"; - } - String wherestr= "where 1=1 and insdt>='"+dateStart+"' and insdt<='"+dateEnd+"'"; - if (processSectionCode !=null && !processSectionCode.isEmpty()) { - wherestr =" and process_section_code='"+processSectionCode+"'"; - } - List scadaAlarms =this.getListByWhere(bizId, wherestr); - List> result = new ArrayList<>(); - for (int i = 0; i < datas.size(); i++) { - Map itemMap = new HashMap(); - Date[] date = datas.get(i); - itemMap.put("name", i+1+unit); - long num =0; - long num_recover=0; - Iterator iterator = scadaAlarms.iterator(); - while(iterator.hasNext()){ - ScadaAlarm scadaAlarm = iterator.next(); - Date alarmDate = DateUtil.toDate(scadaAlarm.getInsdt()); - if (date[0].before(alarmDate) && date[1].after(alarmDate)) { - if (ScadaAlarm.STATUS_ALARM.equals(scadaAlarm.getStatus())) { - num++; - iterator.remove(); - }else if(ScadaAlarm.STATUS_ALARM_RECOVER.equals(scadaAlarm.getStatus())){ - num_recover++; - iterator.remove(); - } - } - } - itemMap.put("num", num);//未解除报警数量 - itemMap.put("num_recover", num_recover);//解除报警数量 - result.add(itemMap); - } - - return result; - } - public int deleteByWhere(String bizId,String wherestr) { - ScadaAlarm group = new ScadaAlarm(); - group.setWhere(wherestr); - return scadaAlarmDao.deleteByWhere(group); - } - public int deleteByIds(String bizId,String ids) { - - ids=ids.replace(",", "','"); - String wherestr= "where id in ('"+ids+"')"; - ScadaAlarm group = new ScadaAlarm(); - group.setWhere(wherestr); - return scadaAlarmDao.deleteByWhere(group); - } - - public int updateStatusByWhere(String bizid, String wherestr, String status) { - return scadaAlarmDao.updateStatusByWhere(status,wherestr); - } - - public int recoverAlarmByWhere(String bizid, String wherestr, String recover_time, String recover_value) { - return scadaAlarmDao.recoverAlarmByWhere(recover_time,recover_value,wherestr); - } - - public ScadaAlarm selectCountByWhere(String bizid,String wherestr) { - return scadaAlarmDao.selectCountByWhere(wherestr); - } - - public ScadaAlarm selectOneByWhere(String bizid,String wherestr) { - return scadaAlarmDao.selectOneByWhere(wherestr); - } - - public void saveMPAlarm(String bizid,MPoint mPoint,String nowTime,String alarmTypeLv1,String alarmTypeLv2,String describe,String processSectionName){ - ScadaAlarm scadaAlarm=new ScadaAlarm(); - scadaAlarm.setInsdt(nowTime); - scadaAlarm.setAlarmTime(nowTime); - scadaAlarm.setMpointCode(mPoint.getMpointcode()); - scadaAlarm.setMpointName(mPoint.getParmname()); - scadaAlarm.setStatus(ScadaAlarm.STATUS_ALARM); - if(mPoint.getProcesssectioncode()!=null&&!mPoint.getProcesssectioncode().equals("")){ - scadaAlarm.setProcessSectionCode(mPoint.getProcesssectioncode()); - scadaAlarm.setProcessSectionName(processSectionName); - } - scadaAlarm.setBizId(bizid); - scadaAlarm.setDescribe(describe); - scadaAlarm.setAlarmTypeLv1(alarmTypeLv1); - scadaAlarm.setAlarmTypeLv2(alarmTypeLv2); - scadaAlarm.setOriginalStatus(mPoint.getParmvalue().toPlainString()); - - this.save(bizid, scadaAlarm); - } - - public void recoverAlarm(String bizid,String code,String nowTime,String value){ - this.recoverAlarmByWhere(bizid," where status!='2' and mpoint_code='"+code+"' ",nowTime,value); - } - -} diff --git a/src/com/sipai/service/scada/TempReportService.java b/src/com/sipai/service/scada/TempReportService.java deleted file mode 100644 index a029513c..00000000 --- a/src/com/sipai/service/scada/TempReportService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sipai.service.scada; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.scada.TempReportDao; -import com.sipai.entity.scada.TempReport; - -@Service -public class TempReportService { - @Resource - private TempReportDao tempReportDao; - - // public TempReport selectById(String bizId,String id) { -// return tempReportDao.selectByPrimaryKey(id); -// } - public List selectListByWhere(String bizId, String wherestr) { - return tempReportDao.selectListByWhere(wherestr); - } - - public int execSql_ReportDay(String bizId, String spname, String stime, String etime, int starthour, int endhour, int intval, String mpstr, int rownum, String userid) { - return tempReportDao.execSql_ReportDay(spname, stime, etime, starthour, endhour, intval, mpstr, rownum, userid); - } - - public int execSql_ReportMth(String bizId, String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - return tempReportDao.execSql_ReportMth(spname, stime, etime, starthour, intval, mpstr, rownum, userid); - } - - public int execSql_ReportQua(String bizId, String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - return tempReportDao.execSql_ReportQua(spname, stime, etime, starthour, intval, mpstr, rownum, userid); - } - - public int execSql_ReportHalfYear(String bizId, String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - return tempReportDao.execSql_ReportHalfYear(spname, stime, etime, starthour, intval, mpstr, rownum, userid); - } - - public int execSql_ReportYear(String bizId, String spname, String stime, String etime, int starthour, int intval, String mpstr, int rownum, String userid) { - return tempReportDao.execSql_ReportYear(spname, stime, etime, starthour, intval, mpstr, rownum, userid); - } - - public int deleteListByWhere(String bizId, String spname, String where) { - return tempReportDao.deleteListByWhere(spname, where); - } -} diff --git a/src/com/sipai/service/scada/WeatherService.java b/src/com/sipai/service/scada/WeatherService.java deleted file mode 100644 index a482e7d9..00000000 --- a/src/com/sipai/service/scada/WeatherService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.scada; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WeatherDao; -import com.sipai.entity.work.Weather; -import com.sipai.tools.CommService; - -@Service -public class WeatherService { - @Resource - private WeatherDao weatherDao; - - public List selectListByWhere(String bizId,String wherestr) { - Weather weather = new Weather(); - weather.setWhere(wherestr); - return this.weatherDao.selectListByWhere(weather); - } - - public List getownsql(String bizId,String wherestr) { - Weather weather = new Weather(); - weather.setWhere(wherestr); - return this.weatherDao.getownsql(weather); - } - -} diff --git a/src/com/sipai/service/scada/impl/DataSummaryServiceImpl.java b/src/com/sipai/service/scada/impl/DataSummaryServiceImpl.java deleted file mode 100644 index d9a54edf..00000000 --- a/src/com/sipai/service/scada/impl/DataSummaryServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.scada.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.DataSummaryDao; -import com.sipai.entity.scada.DataSummary; -import com.sipai.service.scada.DataSummaryService; - -@Service -public class DataSummaryServiceImpl implements DataSummaryService { - @Resource - private DataSummaryDao dataSummaryDao; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public DataSummary selectById(String bizId, String id) { - return dataSummaryDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String id) { - return dataSummaryDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId,DataSummary entity) { - return dataSummaryDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, DataSummary entity) { - try { - int res= dataSummaryDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - DataSummary group = new DataSummary(); - group.setWhere(wherestr); - List dataSummary =dataSummaryDao.selectListByWhere(group); - return dataSummary; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - DataSummary group = new DataSummary(); - group.setWhere(wherestr); - return dataSummaryDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointExpandServiceImpl.java b/src/com/sipai/service/scada/impl/MPointExpandServiceImpl.java deleted file mode 100644 index 53bdc6f7..00000000 --- a/src/com/sipai/service/scada/impl/MPointExpandServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.scada.impl; - -import com.sipai.dao.scada.MPointExpandDao; -import com.sipai.entity.scada.MPointExpand; -import com.sipai.service.scada.MPointExpandService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class MPointExpandServiceImpl implements MPointExpandService { - @Resource - private MPointExpandDao mPointExpandDao; - - @Override - public MPointExpand selectById(String bizId, String id) { - return mPointExpandDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String bizId, String id) { - return mPointExpandDao.deleteByPrimaryKey(id); - } - - @Override - public int save(String bizId, MPointExpand entity) { - return mPointExpandDao.insert(entity); - } - - @Override - public int update(String bizId, MPointExpand entity) { - return mPointExpandDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String bizId, String wherestr) { - MPointExpand mPointExpand = new MPointExpand(); - mPointExpand.setWhere(wherestr); - return mPointExpandDao.selectListByWhere(mPointExpand); - } - - @Override - public int deleteByWhere(String bizId, String wherestr) { - MPointExpand mPointExpand = new MPointExpand(); - mPointExpand.setWhere(wherestr); - return mPointExpandDao.deleteByWhere(mPointExpand); - } -} diff --git a/src/com/sipai/service/scada/impl/MPointFormulaAutoHourServiceImpl.java b/src/com/sipai/service/scada/impl/MPointFormulaAutoHourServiceImpl.java deleted file mode 100644 index 885c1162..00000000 --- a/src/com/sipai/service/scada/impl/MPointFormulaAutoHourServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.scada.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.MPointFormulaAutoHourDao; -import com.sipai.entity.scada.MPointFormulaAutoHour; -import com.sipai.service.scada.MPointFormulaAutoHourService; - -@Service -public class MPointFormulaAutoHourServiceImpl implements MPointFormulaAutoHourService { - @Resource - private MPointFormulaAutoHourDao mPointDao; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public MPointFormulaAutoHour selectById(String bizId, String id) { - return mPointDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String id) { - return mPointDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId,MPointFormulaAutoHour entity) { - return mPointDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, MPointFormulaAutoHour entity) { - try { - int res= mPointDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - MPointFormulaAutoHour group = new MPointFormulaAutoHour(); - group.setWhere(wherestr); - List mPointFormulaAutoHour =mPointDao.selectListByWhere(group); - return mPointFormulaAutoHour; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - MPointFormulaAutoHour group = new MPointFormulaAutoHour(); - group.setWhere(wherestr); - return mPointDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointFormulaDenominatorServiceImpl.java b/src/com/sipai/service/scada/impl/MPointFormulaDenominatorServiceImpl.java deleted file mode 100644 index d950e9b6..00000000 --- a/src/com/sipai/service/scada/impl/MPointFormulaDenominatorServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.scada.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.MPointFormulaDenominatorDao; -import com.sipai.entity.scada.MPointFormulaDenominator; -import com.sipai.service.scada.MPointFormulaDenominatorService; - -@Service -public class MPointFormulaDenominatorServiceImpl implements MPointFormulaDenominatorService { - @Resource - private MPointFormulaDenominatorDao mPointDao; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public MPointFormulaDenominator selectById(String bizId, String id) { - return mPointDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String id) { - return mPointDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId,MPointFormulaDenominator entity) { - return mPointDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, MPointFormulaDenominator entity) { - try { - int res= mPointDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - MPointFormulaDenominator group = new MPointFormulaDenominator(); - group.setWhere(wherestr); - List mPointFormulaDenominator =mPointDao.selectListByWhere(group); - return mPointFormulaDenominator; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - MPointFormulaDenominator group = new MPointFormulaDenominator(); - group.setWhere(wherestr); - return mPointDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointFormulaServiceImpl.java b/src/com/sipai/service/scada/impl/MPointFormulaServiceImpl.java deleted file mode 100644 index 1947b30e..00000000 --- a/src/com/sipai/service/scada/impl/MPointFormulaServiceImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.service.scada.impl; - -import java.util.List; -import java.util.HashMap; - -import javax.annotation.Resource; - -import com.sipai.dao.scada.MPointHistoryDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.scada.MPointService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.MPointFormulaDao; -import com.sipai.entity.scada.MPointFormula; -import com.sipai.service.scada.MPointFormulaService; - -@Service("mPointFormulaService") -public class MPointFormulaServiceImpl implements MPointFormulaService { - @Resource - private MPointFormulaDao mPointDao; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryDao mPointHistoryDao; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public MPointFormula selectById(String bizId, String id) { - return mPointDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String id) { - return mPointDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId, MPointFormula entity) { - return mPointDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, MPointFormula entity) { - try { - int res = mPointDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - MPointFormula group = new MPointFormula(); - group.setWhere(wherestr); - List mPointFormulaList = mPointDao.selectListByWhere(group); - return mPointFormulaList; - } - - public List selectListByWhereGetMp(String bizId, String wherestr) { - MPointFormula group = new MPointFormula(); - group.setWhere(wherestr); - List mPointFormulaList = mPointDao.selectListByWhere(group); - for (MPointFormula mPointFormula : - mPointFormulaList) { - String mpid = mPointFormula.getMpid(); - MPoint mPoint = this.mPointService.selectById(bizId, mpid); - if (mPoint != null) { - mPointFormula.setmPoint(mPoint); - } - } - return mPointFormulaList; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - MPointFormula group = new MPointFormula(); - group.setWhere(wherestr); - return mPointDao.deleteByWhere(group); - } - - public List> getSpData(String bizId,String execTime,String execType,String inMpids,String mark) { - return mPointDao.getSpData(execTime,execType,inMpids,mark); - } - - public List getMpHisDataByUserid(String bizId,String inMpids,String mark) { - List mpHlistList=mPointHistoryDao.selectListByTableAWhere("tb_mp_"+inMpids , - " where userid='"+mark+"' "); - return mpHlistList; - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointProgrammeDetailServiceImpl.java b/src/com/sipai/service/scada/impl/MPointProgrammeDetailServiceImpl.java deleted file mode 100644 index 3e73fbf3..00000000 --- a/src/com/sipai/service/scada/impl/MPointProgrammeDetailServiceImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.scada.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.scada.MPointProgrammeDetailDao; -import com.sipai.entity.scada.MPointProgrammeDetail; -import com.sipai.service.scada.MPointProgrammeDetailService; -@Service -public class MPointProgrammeDetailServiceImpl implements MPointProgrammeDetailService{ - @Resource - private MPointProgrammeDetailDao mpfaddao; - - - public List selectListByWhere(String bizId, String wherestr) { - MPointProgrammeDetail group = new MPointProgrammeDetail(); - group.setWhere(wherestr); - List mPoints =mpfaddao.selectListByWhere(group); - return mPoints; - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointProgrammeServiceImpl.java b/src/com/sipai/service/scada/impl/MPointProgrammeServiceImpl.java deleted file mode 100644 index 045bc46a..00000000 --- a/src/com/sipai/service/scada/impl/MPointProgrammeServiceImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.service.scada.impl; -import com.sipai.dao.scada.MPointProgrammeDao; -import com.sipai.entity.scada.MPointProgramme; -import com.sipai.service.scada.MPointProgrammeService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class MPointProgrammeServiceImpl implements MPointProgrammeService { - @Resource - private MPointProgrammeDao mPointDao; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public MPointProgramme selectById(String bizId, String mpointid) { - return mPointDao.selectByPrimaryKey(mpointid); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String mpointid) { - return mPointDao.deleteByPrimaryKey(mpointid); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId,MPointProgramme entity) { - return mPointDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, MPointProgramme entity) { - try { - int res= mPointDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - MPointProgramme group = new MPointProgramme(); - group.setWhere(wherestr); - List mPoints =mPointDao.selectListByWhere(group); - return mPoints; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - MPointProgramme group = new MPointProgramme(); - group.setWhere(wherestr); - return mPointDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointPropServiceImpl.java b/src/com/sipai/service/scada/impl/MPointPropServiceImpl.java deleted file mode 100644 index 05fae5bb..00000000 --- a/src/com/sipai/service/scada/impl/MPointPropServiceImpl.java +++ /dev/null @@ -1,666 +0,0 @@ -package com.sipai.service.scada.impl; -import java.math.BigDecimal; -import java.util.*; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.singularsys.jep.Jep; -import com.sipai.dao.repository.MPointPropSourceRepo; -import com.sipai.entity.enums.TimeUnitEnum; -import com.sipai.entity.scada.*; -import com.sipai.entity.score.LibraryMPointProp; -import com.sipai.entity.score.LibraryMPointPropSource; -import com.sipai.service.scada.MPointPropService; -import com.sipai.service.scada.MPointPropSourceService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DataSourceHolder; -import com.sipai.tools.jep.Max; -import com.sipai.tools.jep.Min; -import org.apache.log4j.Logger; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.data.domain.Page; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.data.elasticsearch.core.query.SearchQuery; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.AsyncResult; -import org.springframework.stereotype.Service; - -import com.sipai.dao.scada.MPointPropDao; -import com.sipai.service.user.UnitService; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class MPointPropServiceImpl implements MPointPropService { - private static final Logger logger = Logger.getLogger(MPointPropServiceImpl.class); - @Resource - private MPointPropDao mPointPropDao; - @Resource - private MPointPropSourceService mPointPropSourceService; - @Resource - private MPointPropSourceRepo mPointPropSourceRepo; - @Resource - private MPointService mPointService; - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropService#selectById(java.lang.String, java.lang.String) - */ - public MPointProp selectById(String bizId,String id) { - MPointProp mPointProp = mPointPropDao.selectByPrimaryKey(id); - if(mPointProp != null){ - MPoint mpoint = mPointService.selectById(id); - mPointProp.setMpoint(mpoint); - } - return mPointProp; - } - - public MPointProp selectById(String id) { - return mPointPropDao.selectByPrimaryKey(id); - } - - @Transactional - public int deleteById(String bizId,String id) { - try{ - mPointPropSourceService.deleteByWhere(bizId, "where pid ='"+id+"'"); - return mPointPropDao.deleteByPrimaryKey(id); - }catch (Exception e){ - e.printStackTrace(); - throw new RuntimeException(); - } - - - } - - public int save(String bizId,MPointProp entity) { - return mPointPropDao.insert(entity); - } - - public int update(String bizId,MPointProp entity) { - return mPointPropDao.updateByPrimaryKeySelective(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId,String wherestr) { - MPointProp measurePointProp = new MPointProp(); - measurePointProp.setWhere(wherestr); - return mPointPropDao.selectListByWhere(measurePointProp); - } - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropService#selectByPid(java.lang.String, java.lang.String) - */ - public List selectByPid(String bizId,String pid) { - MPointProp mPointProp = new MPointProp(); - mPointProp.setWhere(" where pid='"+pid+"'"); - List measurePointProps = mPointPropDao.selectListByWhere(mPointProp); - for (MPointProp item:measurePointProps){ - MPoint mpoint = mPointService.selectById(bizId, pid); - item.setMpoint(mpoint); - } - return measurePointProps; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId,String wherestr) { - ListmPointProps=this.selectListByWhere(bizId,wherestr); - int res =0; - for (MPointProp mPointProp:mPointProps) { - res+=this.deleteById(mPointProp.getBizId(),mPointProp.getId()); - } - return res; - } - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropService#deletesMPointPropSource(java.lang.String, java.util.List) - */ - public int deletesMPointPropSource(String bizId,Listlist){ - int result = 0; - if (list!= null && list.size()>0) { - String propSourceIds = ""; - for (MPointPropSource item : list) { - if (propSourceIds != "") { - propSourceIds+=","; - } - propSourceIds+= item.getId(); - } - propSourceIds = propSourceIds.replace(",","','"); - result = this.mPointPropSourceService.deleteByWhere(bizId, "where id in ('"+propSourceIds+"')"); - } - return result; - } - /** - * 根据附表信息计算结果值 - * */ - public double calculate(String bizId,String mPointPropId,String nowTime){ - double result = 0.0; - MPointProp mPointProp = this.selectById( mPointPropId); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - nativeSearchQueryBuilder.withQuery(QueryBuilders.matchQuery("pid", mPointPropId)); - SearchQuery searchQuery = nativeSearchQueryBuilder.build(); - Page mPage = mPointPropSourceRepo.search(searchQuery); - List mPointPropSources= mPage.getContent(); - if (mPointPropSources==null || mPointPropSources.size()==0){ - return Double.NaN; - } - List> futures = new ArrayList<>(); - for (MPointPropSource mPointPropSource : mPointPropSources) { - MPoint mPoint = mPointService.selectById(mPointPropSource.getMpid()); - mPointPropSource.setmPoint(mPoint); -// logger.info("获取点"+mPoint.getParmname()+"值开始"); - Future mp=mPointPropSourceService.getValuesAsyncByWhere(mPointPropSource,nowTime); - futures.add(mp); - } - List mPoints = new ArrayList<>(); -// List mPoints = this.mPointPropSourceService.getValuesByWhere(mPointPropSources,nowTime); - for (Future future : futures) { - try { - MPointVectorValue mPoint = future.get(20, TimeUnit.SECONDS); - mPoints.add(mPoint); -// logger.info("获取点"+mPoint.getParmname()+"值完成"); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ExecutionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (TimeoutException e) { - e.printStackTrace(); - logger.error(e.getMessage()); - } - - } - Jep jep = new Jep(); - try { - List vectorNames = new ArrayList(); - logger.info(JSONArray.toJSONString(mPoints)); - for (MPointVectorValue mPoint : mPoints) { - String param= CommUtil.formatJepFormula(mPoint.getParmname()); - if (mPoint.getVectorValue()!=null && mPoint.getVectorValue().length>0){ - jep.addVariable(param, new Vector(Arrays.asList(mPoint.getVectorValue()))); - vectorNames.add(param); - logger.info("--参与计算-vector值---"+param+"-----"+JSONArray.toJSONString(mPoint.getVectorValue())); - }else { - jep.addVariable(param, mPoint.getParmvalue()); - logger.info("--参与计算-parmvalue值---"+param+"-----"+mPoint.getParmvalue()); - } - - // 变量含特殊字符如#无法识别,所有将公式中变量名改为id - } - // - logger.info(JSONArray.toJSONString(mPoints)); - String evaluationFormula= CommUtil.formatJepFormula(mPointProp.getEvaluationFormula()); - //vector数据的点需要用小括号包一下 - /*for (String itemName:vectorNames) { - evaluationFormula=evaluationFormula.replace(itemName,"("+itemName+")"); - }*/ - //按天取平均值 - if(evaluationFormula.contains("day")){ - String startTime=CommUtil.getStartTimeByFreq(nowTime,1, TimeUnitEnum.MONTH.getId(), true); - int num = CommUtil.getDaysOfMonth(startTime,true); - jep.addVariable("day", num); - } - logger.info("--计算公式--------"+evaluationFormula); - jep.addFunction("min",new Min()); - jep.addFunction("max",new Max()); - jep.parse(evaluationFormula); - //3. 计算结果 - Object resulta = jep.evaluate(); - //4. 输出显示 - if (resulta instanceof BigDecimal) { - BigDecimal res = (BigDecimal) resulta; - result=res.doubleValue(); - }else { - result=(double)resulta; - } - logger.info("计算点结果 = " + result + " "); - } catch (Exception e) { - logger.error(mPointProp.getId()+"计算报错!!!!!"); - logger.error(e.toString()); -// e.printStackTrace(); - } - return result; - } - /** -  * @description: 异步执行计算并存储计算点结果 -  * @param -  * @return 成功则返回该计算点ID -  * @author WXP -  * @date 2020/12/15 16:37 -  */ - @Async("my-calculate-executor") - public Future calculateAndSaveAsync(String bizId, MPoint mPoint,String nowTime){ - int res = calculateAndSave(bizId, mPoint,nowTime); - logger.info(mPoint.getId()+"-----异步---成功---"); - String resStr=""; - if (res==0) { - resStr= mPoint.getId(); - }else{ - resStr= ""; - } - return new AsyncResult<>(resStr); - } - /** -  * @description: 执行计算并存储计算点结果 -  * @param -  * @return -  * @author WXP -  * @date 2020/12/15 16:37 -  */ - public int calculateAndSave(String bizId, MPoint mPoint,String nowTime){ - - double res=this.calculate(mPoint.getBizid(), mPoint.getId(), nowTime); - // 由于计算结果的时间是滞后的,需要将时间提前后保存 - // 比如21号8点计算的结果 应该属于20号的 - /*calendar = Calendar.getInstance(); - try { - Date date =sdf.parse(nowTime); - calendar.setTime(date); - TimeUnitEnum unit = TimeUnitEnum.getTypeByValue(mPoint.getFrequnit()); - switch(unit){ - case MINUTE: - calendar.add(Calendar.MINUTE,-1); - break; - case DAY: - calendar.add(Calendar.DATE,-1); - break; - case MONTH: - calendar.add(Calendar.MONTH,-1); - break; - case YEAR: - calendar.add(Calendar.YEAR,-1); - break; - default: - } - nowTime = sdf.format(calendar.getTime()); - } catch (ParseException e) { - e.printStackTrace(); - }*/ - - if (Double.isNaN(res)){ - logger.info(mPoint.getId()+"-----"+mPoint.getMeasuredt()+"---计算失败---"); - return 0; - } - BigDecimal res_b = new BigDecimal(res); - res_b = res_b.setScale(5, BigDecimal.ROUND_HALF_DOWN); - mPoint.setParmvalue(res_b); - mPoint.setMeasuredt(nowTime); - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setInsdt(nowTime); - mPointHistory.setMeasuredt(nowTime); - mPointHistory.setParmvalue(res_b); - int res_s=mPointService.updateValue(mPoint.getBizid(),mPoint,mPointHistory); - if (res_s==1) { - logger.info(mPoint.getId()+"-----"+mPoint.getMeasuredt()+"---保存计算结果成功---"+mPoint.getParmvalue()); - }else{ - logger.info(mPoint.getId()+"-----"+mPoint.getMeasuredt()+"---保存计算结果失败---"+mPoint.getParmvalue()); - } - return res_s; - } - /** - * 获取所有子KPI点,返回包含父测量点,其中子KPI包含时间类型(如天、小时)的点 - * 需要排序 - * @return - */ - public List getChildKPIPoints(String freqUnit){ - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); -// boolQueryBuilder.should(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_CAL)); - if (freqUnit!=null && !freqUnit.isEmpty()) { - boolQueryBuilder.must(QueryBuilders.matchQuery("frequnit",freqUnit)); - } - logger.info("--parms----"+MPoint.Flag_Type_KPI+freqUnit); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List mPoints_source= this.mPointService.selectListByWhere(nativeSearchQueryBuilder); -// logger.info("---mPoints_source----"+JSONArray.toJSONString(mPoints_source)); - List mPoints_res = new ArrayList<>(); - NativeSearchQueryBuilder nativeSearch = new NativeSearchQueryBuilder(); - List mPointPropSources=this.mPointPropSourceService.selectListWihMPointByWhere(nativeSearch); -// logger.info("---mPointPropSources----"+JSONArray.toJSONString(mPointPropSources)); - for (MPointPropSource mPointPropSource : mPointPropSources) { - MPoint mPoint_c = mPointPropSource.getmPoint(); - MPoint mPoint_p = null; -// System.out.println(mPoint_c.getParmname()); -// System.out.println(mPoint_c.getSourceType()); - //若子不是KPI则无需排序, - if (mPoint_c==null || !MPoint.Flag_Type_KPI.equals(mPoint_c.getSourceType())) { - continue; - } - - String pid = mPointPropSource.getPid(); - String cid = mPointPropSource.getMpid(); - int pid_index = -1; - int cid_index = -1; -// System.out.println("pid---"+pid); -// System.out.println("cid---"+cid); -// System.out.println("mPoints_res.size()---"+mPoints_res.size()); - for (int i=0; i-1 ) { - if (cid_index==-1) { - mPoints_res.add(pid_index,mPoint_c); - }else if (pid_index getChildMPoints(String mpoints){ - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); -// boolQueryBuilder.should(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_CAL)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List mPoints_source= this.mPointService.selectListByWhere(nativeSearchQueryBuilder); - List mPoints_res = new ArrayList<>(); - nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - List mPointPropSources=this.mPointPropSourceService.selectListWihMPointByWhere(nativeSearchQueryBuilder); - for (MPointPropSource mPointPropSource : mPointPropSources) { - MPoint mPoint_c = mPointPropSource.getmPoint(); -// System.out.println("mPoint_c:"+mPoint_c.getParmname()); - MPoint mPoint_p = null; -// System.out.println(mPoint_c.getParmname()); -// System.out.println(mPoint_c.getSourceType()); - if (mPoint_c != null) { - if (mpoints == null || mpoints.length() == 0) { - // 若子是KPI则不存储 - if (MPoint.Flag_Type_KPI.equals(mPoint_c.getSourceType())) { - continue; - } - } else { - if (MPoint.Flag_Type_KPI.equals(mPoint_c.getSourceType()) - || mpoints.indexOf(mPoint_c.getId()) < 0) { - continue; - } - } - } - - - String pid = mPointPropSource.getPid(); - String cid = mPointPropSource.getMpid(); - int pid_index = -1; - int cid_index = -1; - for (int i=0; i-1 ) { - logger.info("----pid_index------"+pid_index+"-----开始------"); - if (cid_index==-1) { - logger.info("----cid_index------"+cid_index+"-----开始------"); -// mPoints_res.add(pid_index,mPoint_c); - }else if (pid_index getParentMPoints(String mpointIds){ - - Set mPointSet =new HashSet<>(); - String[] mpointArray = mpointIds.split(","); - for (String item:mpointArray) { - if (item!=null && !item.isEmpty()){ - List items =this.getParent(item); - mPointSet.addAll(items); - - } - } - List mPoints_res = new ArrayList<>(mPointSet); - return mPoints_res; - } - /** - * 获取所有子也是KPI的父:KPI测量点和子:KPI测量点 - * 只有KPI关联KPI的 - * 需要排序 - * @param KPIPoints 和KPIPoints相关 - * @return - */ - public List getChildKPIPointsWithKPIPoints(boolean searchChildFlag,String KPIPoints){ - - List mPointPropSources= new ArrayList<>(); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); - //KPIPoints只存单点id - boolQueryBuilder.must(QueryBuilders.matchQuery("id",KPIPoints.replace(","," "))); -// boolQueryBuilder.should(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_CAL)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List mPoints_source= this.mPointService.selectListByWhere(nativeSearchQueryBuilder); - if(searchChildFlag){ - List mPointPropSourcesSource= new ArrayList<>(); - for (MPoint item:mPoints_source) { - List mPointPropSourceItems= getChildren(item.getId()); - mPointPropSourcesSource.addAll(mPointPropSourceItems); - } - HashSet set = new HashSet(mPointPropSourcesSource); - mPointPropSources.addAll(set); - } - - //---------------------- - List mPoints_res = new ArrayList<>(); - /*nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - boolQueryBuilder = QueryBuilders.boolQuery(); - //KPIPoints只存单点id - boolQueryBuilder.must(QueryBuilders.matchQuery("pid",KPIPoints)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List mPointPropSources=this.mPointPropSourceService.selectListWihMPointByWhere(nativeSearchQueryBuilder);*/ - - for (MPointPropSource mPointPropSource : mPointPropSources) { - MPoint mPoint_c = mPointPropSource.getmPoint(); - if(mPoint_c==null){ - continue; - } - logger.info("----getChildKPIPointsWithKPIPoints-----------------"); - logger.info("----mPointPropSource-----------------"); - logger.info(JSONObject.toJSONString(mPointPropSource)); - MPoint mPoint_p = null; -// System.out.println(mPoint_c.getParmname()); -// System.out.println(mPoint_c.getSourceType()); - /*if(KPIPoints ==null || KPIPoints.length()==0){ - //若子不是KPI则无需排序, - if (!MPoint.Flag_Type_KPI.equals(mPoint_c.getSourceType())) { - continue; - } - }else{ - if (!MPoint.Flag_Type_KPI.equals(mPoint_c.getSourceType()) || KPIPoints.indexOf(mPoint_c.getId())<0 ) { - continue; - } - }*/ - if (!MPoint.Flag_Type_KPI.equals(mPoint_c.getSourceType())) { - continue; - } - String pid = mPointPropSource.getPid(); - String cid = mPointPropSource.getMpid(); - int pid_index = -1; - int cid_index = -1; - for (int i=0; i-1 ) { - if (cid_index==-1) { - mPoints_res.add(pid_index,mPoint_c); - }else if (pid_index getChildren(String pid){ - List t2 = new ArrayList(); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); -// boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); - //KPIPoints只存单点id - boolQueryBuilder.must(QueryBuilders.matchQuery("pid",pid)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List mPointPropSources=this.mPointPropSourceService.selectListWihMPointByWhere(nativeSearchQueryBuilder); - for (MPointPropSource item:mPointPropSources) { - if (item.getmPoint()!=null && MPoint.Flag_Type_KPI.equals(item.getmPoint().getSourceType())){ - t2.add(item); - //防止点作为子点被无限递归 - if(pid!=null && !pid.equals(item.getMpid())){ - List result=getChildren(item.getMpid()); - if(result!=null){ - t2.addAll(result); - } - } - - } - } - return t2; - } - /** - * 递归获取子节点 - */ - public List getParent(String cid){ - List t2 = new ArrayList(); - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); -// boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); - //KPIPoints只存单点id - boolQueryBuilder.must(QueryBuilders.matchQuery("mpid",cid)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List mPointPropSources=this.mPointPropSourceService.selectListWihMPointByWhere(nativeSearchQueryBuilder); - for (MPointPropSource item:mPointPropSources) { - if (item.getmPoint()!=null ){ - - //防止点作为子点被无限递归 - if(cid!=null && !cid.equals(item.getPid())){ - List result=getParent(item.getPid()); - if(result!=null){ - t2.addAll(result); - } - } - - } - } - MPoint mPoint = mPointService.selectById(cid); - t2.add(mPoint); - return t2; - } - - -} diff --git a/src/com/sipai/service/scada/impl/MPointPropSourceServiceImpl.java b/src/com/sipai/service/scada/impl/MPointPropSourceServiceImpl.java deleted file mode 100644 index 4aecdb6f..00000000 --- a/src/com/sipai/service/scada/impl/MPointPropSourceServiceImpl.java +++ /dev/null @@ -1,595 +0,0 @@ -package com.sipai.service.scada.impl; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.repository.MPointPropSourceRepo; -import com.sipai.dao.scada.MPointPropSourceDao; -import com.sipai.entity.enums.MPointPropValueTypeEnum; -import com.sipai.entity.enums.TimeUnitEnum; -import com.sipai.entity.scada.*; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointPropSourceService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommUtil; -import org.apache.log4j.Logger; -import org.springframework.data.domain.Page; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.data.elasticsearch.core.query.SearchQuery; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.AsyncResult; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; -import java.util.*; -import java.util.concurrent.Future; -import java.util.stream.Collectors; - -@Service -public class MPointPropSourceServiceImpl implements MPointPropSourceService { - private static final Logger logger = Logger.getLogger(MPointPropSourceServiceImpl.class); - - @Resource - private MPointPropSourceDao mPointPropSourceDao; - /*@Resource - private MPointPropService mPointPropService;*/ - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointPropSourceRepo mPointPropSourceRepo; - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropSourceService#selectById(java.lang.String, java.lang.String) - */ - public MPointPropSource selectById(String bizId, String id) { - MPointPropSource mPointPropSource = mPointPropSourceDao.selectByPrimaryKey(id); - MPoint mPoint = mPointService.selectById(bizId, mPointPropSource.getMpid()); - mPointPropSource.setmPoint(mPoint); - return mPointPropSource; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropSourceService#deleteById(java.lang.String, java.lang.String) - */ - @Transactional - public int deleteById(String bizId, String id) { - int res = 0; - try { - mPointPropSourceRepo.deleteById(id); - res = mPointPropSourceDao.deleteByPrimaryKey(id); - - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropSourceService#save(java.lang.String, com.sipai.entity.scada.MPointPropSource) - */ - @Transactional - public int save(String bizId, MPointPropSource entity) { - int res = 0; - try { - res = mPointPropSourceDao.insert(entity); - MPointPropSourceES mPointPropSourceES = MPointPropSourceES.format(entity); - mPointPropSourceRepo.save(mPointPropSourceES); - } catch (Exception e) { - // TODO: handle exception - logger.error(e); - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropSourceService#update(java.lang.String, com.sipai.entity.scada.MPointPropSource) - */ - @Transactional - public int update(String bizId, MPointPropSource entity) { - try { - MPointPropSourceES mPointPropSourceES = MPointPropSourceES.format(entity); - mPointPropSourceRepo.save(mPointPropSourceES); - return mPointPropSourceDao.updateByPrimaryKeySelective(entity); - } catch (Exception e) { - e.printStackTrace(); - logger.error(e.getMessage()); - throw new RuntimeException(e.getMessage()); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropSourceService#selectListByWhere(java.lang.String, java.lang.String) - */ - - /** - * es查询 - * - * @return - */ - public List selectListByWhere(NativeSearchQueryBuilder nativeSearchQueryBuilder) { - SearchQuery searchQuery = nativeSearchQueryBuilder.build(); - Page mPage = mPointPropSourceRepo.search(searchQuery); - return mPage.getContent(); - } - - public List selectListByWhere(String bizId, String wherestr) { - MPointPropSource measurePointPropSource = new MPointPropSource(); - measurePointPropSource.setWhere(wherestr); - List mPointPropSources = mPointPropSourceDao.selectListByWhere(measurePointPropSource); - for (MPointPropSource mPointPropSource : mPointPropSources) { - MPoint mPoint = mPointService.selectById(mPointPropSource.getMpid()); - if (mPoint != null) { - mPointPropSource.setMpname(mPoint == null ? "" : mPoint.getParmname()); - mPointPropSource.setmPoint(mPoint); - } - - } - return mPointPropSources; - } - - @Override - public List selectListByWhereNoname(String bizId, String wherestr) { - MPointPropSource measurePointPropSource = new MPointPropSource(); - measurePointPropSource.setWhere(wherestr); - List mPointPropSources = mPointPropSourceDao.selectListByWhere(measurePointPropSource); - return mPointPropSources; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropSourceService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - MPointPropSource measurePointPropSource = new MPointPropSource(); - measurePointPropSource.setWhere(wherestr); - List mPointPropSources = this.mPointPropSourceDao.selectListByWhere(measurePointPropSource); - int res = 0; - for (MPointPropSource mPointPropSource : mPointPropSources) { - res += this.deleteById(bizId, mPointPropSource.getId()); - } - return res; - } - - public List selectListWihMPointByWhere(NativeSearchQueryBuilder nativeSearchQueryBuilder) { - List mPointPropSources = this.selectListByWhere(nativeSearchQueryBuilder); -// logger.info("---mPointPropSources--"+JSONArray.toJSONString(mPointPropSources)); - List mPointPropSources_ = new ArrayList<>(mPointPropSources); - Iterator iterator = mPointPropSources_.iterator(); - while (iterator.hasNext()) { - MPointPropSource mPointPropSource = (MPointPropSource) iterator.next(); - try { - MPoint mPoint = mPointService.selectById(mPointPropSource.getMpid()); - mPointPropSource.setmPoint(mPoint); - } catch (Exception e) { - e.printStackTrace(); - iterator.remove(); - logger.error("--mPointPropSource--未找到mpoint点位--" + JSONObject.toJSONString(mPointPropSource)); - } - - } -// for (MPointPropSource mPointPropSource : mPointPropSources) { -// MPoint mPoint =mPointService.selectById(mPointPropSource.getMpid()); -// mPointPropSource.setmPoint(mPoint); -// } - return mPointPropSources; - } - - /** - * 获取附表结果 - * - * @return - */ - - public List getValuesByWhere(List mPointPropSources, String nowTime) { - ArrayList mPoints = new ArrayList<>(); - for (MPointPropSource mPointPropSource : mPointPropSources) { - MPoint mPoint = mPointPropSource.getmPoint(); - //测量点会重复引用,所以需要使用mPointPropSource的mpointname作为计算点名称 - mPoint.setParmname(mPointPropSource.getIndexDetails()); - MPointPropValueTypeEnum mPointPropValueTypeEnum = MPointPropValueTypeEnum.getTypeByValue(mPointPropSource.getValueType()); - - if (mPointPropValueTypeEnum != null) { - //有valueType,才有计算范围 - String startTime = CommUtil.getStartTimeByFreq(nowTime, mPointPropSource.getCalRange(), mPointPropSource.getCalRangeUnit(), false); - String whereStr_history = "where measuredt > '" + startTime + "' and measuredt < '" + nowTime + "' order by measuredt desc"; - logger.info("获取附表历史---开始"); - List mPointHistories = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), CommUtil.getMPointTableName(mPoint.getMpointcode()), whereStr_history); - logger.info("获取附表历史---结束"); - switch (mPointPropValueTypeEnum) { - - case avg: - - //查询到结果才赋值,否则使用最后的值 - if (mPointHistories != null && mPointHistories.size() > 0) { - double avgValue = 0.0; - for (MPointHistory mPointHistory : mPointHistories) { - avgValue += mPointHistory.getParmvalue().doubleValue(); - } - avgValue = avgValue / mPointHistories.size(); - mPoint.setParmvalue(new BigDecimal(avgValue)); - } - - break; - case max: - //查询到结果才赋值,否则使用最后的值 - if (mPointHistories != null && mPointHistories.size() > 0) { - double max = mPointHistories.get(0).getParmvalue().doubleValue(); - for (MPointHistory mPointHistory : mPointHistories) { - if (max < mPointHistory.getParmvalue().doubleValue()) { - max = mPointHistory.getParmvalue().doubleValue(); - } - } - mPoint.setParmvalue(new BigDecimal(max)); - } - break; - case min: - //查询到结果才赋值,否则使用最后的值 - if (mPointHistories != null && mPointHistories.size() > 0) { - double min = mPointHistories.get(0).getParmvalue().doubleValue(); - for (MPointHistory mPointHistory : mPointHistories) { - if (min > mPointHistory.getParmvalue().doubleValue()) { - min = mPointHistory.getParmvalue().doubleValue(); - } - } - mPoint.setParmvalue(new BigDecimal(min)); - } - break; - case median: - //查询到结果才赋值,否则使用最后的值 - if (mPointHistories != null && mPointHistories.size() > 0) { - Collections.sort(mPointHistories, new Comparator() { - public int compare(MPointHistory arg0, MPointHistory arg1) { - return arg0.getParmvalue().compareTo(arg1.getParmvalue()); - } - }); - double median = 0.0; - if (mPointHistories.size() % 2 == 0) { - median = (mPointHistories.get(mPointHistories.size() / 2).getParmvalue().doubleValue() + mPointHistories.get(mPointHistories.size() / 2 + 1).getParmvalue().doubleValue()) / 2; - } else { - median = mPointHistories.get(mPointHistories.size() / 2).getParmvalue().doubleValue(); - } - mPoint.setParmvalue(new BigDecimal(median)); - } - break; - default: - if (mPointHistories != null && mPointHistories.size() > 0) { - mPoint.setParmvalue(mPointHistories.get(0).getParmvalue()); - } - break; - } - } else { - String whereStr_history = "where measuredt < '" + nowTime + "' order by measuredt desc"; - logger.info("获取附表历史---开始"); - List mPointHistories = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), CommUtil.getMPointTableName(mPoint.getMpointcode()), whereStr_history); - logger.info("获取附表历史---结束"); - if (mPointHistories != null && mPointHistories.size() > 0) { - mPoint.setParmvalue(mPointHistories.get(0).getParmvalue()); - } - } - mPoints.add(mPoint); - } - - return mPoints; - } - - @Async - public Future getValuesAsyncByWhere(MPointPropSource mPointPropSource, String nowTime) { - MPointVectorValue mPointVectorValue = new MPointVectorValue(); - MPoint mPoint = mPointPropSource.getmPoint(); - mPointVectorValue.setId(mPoint.getId()); - //默认取最新的值,若查询历史失败,则使用最新的值 - mPointVectorValue.setParmvalue(mPoint.getParmvalue()); - - //测量点会重复引用,所以需要使用mPointPropSource的IndexDetails作为计算点名称 -// mPoint.setParmname(mPointPropSource.getIndexDetails()); - mPointVectorValue.setParmname(mPointPropSource.getIndexDetails()); - MPointPropValueTypeEnum mPointPropValueTypeEnum = MPointPropValueTypeEnum.getTypeByValue(mPointPropSource.getValueType()); -// logger.info("getValuesAsyncByWhere----mPointPropSource---"+JSONObject.toJSONString(mPointPropSource)); -// logger.info("getValuesAsyncByWhere----mPointPropValueTypeEnum---"+JSONObject.toJSONString(mPointPropValueTypeEnum)); - if (mPointPropValueTypeEnum != null) { - //有valueType,才有计算范围 - int calRange = mPointPropSource.getCalRange() == null ? 0 : mPointPropSource.getCalRange(); - String calRangeUnit = mPointPropSource.getCalRangeUnit(); - MPoint mPoint_p = mPointService.selectById(mPointPropSource.getPid()); - if (calRange == 0 || calRangeUnit == null) { - calRange = mPoint_p.getFreq(); - calRangeUnit = mPoint_p.getFrequnit(); - } - List mPointHistories = new ArrayList<>(); - switch (mPointPropValueTypeEnum) { - - case avg: - - //查询到结果才赋值,否则使用最后的值 - String startTime = CommUtil.getStartTimeByFreq(nowTime, mPoint_p.getFreq(), mPoint_p.getFrequnit(), true); - mPointHistories = getMPointHistoryByVertical(mPoint, startTime, nowTime, calRange, calRangeUnit, - mPointPropSource.getCalculationType(), false, false); - if (mPointHistories != null && mPointHistories.size() > 0) { - double avgValue = 0.0; - for (MPointHistory mPointHistory : mPointHistories) { - avgValue += mPointHistory.getParmvalue().doubleValue(); - } - avgValue = avgValue / mPointHistories.size(); - mPointVectorValue.setParmvalue(new BigDecimal(avgValue)); - } - - break; - case sum: - //按父测量点的时间频率进行累计,只能用作日合计,月合计,年合计 - startTime = CommUtil.getStartTimeByFreq(nowTime, mPoint_p.getFreq(), mPoint_p.getFrequnit(), true); - mPointHistories = getMPointHistoryByVertical(mPoint, startTime, nowTime, calRange, calRangeUnit, - mPointPropSource.getCalculationType(), false, true); - if (mPointHistories != null && mPointHistories.size() > 0) { - double avgValue = 0.0; - for (MPointHistory mPointHistory : mPointHistories) { - avgValue += mPointHistory.getParmvalue().doubleValue(); - } - mPointVectorValue.setParmvalue(new BigDecimal(avgValue)); - } - - break; - case sum_month: - //计算当月累计,固定从当月21日开始 - startTime = CommUtil.getStartTimeByFreq(nowTime, 1, TimeUnitEnum.MONTH.getId(), true); - mPointHistories = getMPointHistoryByVertical(mPoint, startTime, nowTime, calRange, calRangeUnit, - mPointPropSource.getCalculationType(), false, true); - BigDecimal result = new BigDecimal(0.0); - if (mPointHistories != null && mPointHistories.size() > 1) { - result = mPointHistories.get(mPointHistories.size() - 1).getParmvalue().subtract(mPointHistories.get(0).getParmvalue()); - } - mPointVectorValue.setParmvalue(result); - break; - case sum_day: - //计算当日累计,固定从当日8点开始 - startTime = CommUtil.getStartTimeByFreq(nowTime, 1, TimeUnitEnum.DAY.getId(), true); - mPointHistories = getMPointHistoryByVertical(mPoint, startTime, nowTime, calRange, calRangeUnit, - mPointPropSource.getCalculationType(), false, true); - result = new BigDecimal(0.0); - logger.info("sum_day-mPointHistories---" + JSONArray.toJSONString(mPointHistories)); - if (mPointHistories != null && mPointHistories.size() > 1) { - result = mPointHistories.get(mPointHistories.size() - 1).getParmvalue().subtract(mPointHistories.get(0).getParmvalue()); - logger.info("sum_day-result---" + result); - } - mPointVectorValue.setParmvalue(result); - logger.info("sum_day-mPoint---" + JSONObject.toJSONString(mPoint)); - break; - case sum_year: - //计算当也累计,固定从当日8点开始 - startTime = CommUtil.getStartTimeByFreq(nowTime, 1, TimeUnitEnum.YEAR.getId(), true); - mPointHistories = getMPointHistoryByVertical(mPoint, startTime, nowTime, calRange, calRangeUnit, - mPointPropSource.getCalculationType(), false, true); - result = new BigDecimal(0.0); - if (mPointHistories != null && mPointHistories.size() > 1) { - result = mPointHistories.get(mPointHistories.size() - 1).getParmvalue().subtract(mPointHistories.get(0).getParmvalue()); - } - mPointVectorValue.setParmvalue(result); - - break; - case max: - //查询到结果才赋值,否则使用最后的值 - mPointHistories = getMPointHistoryHorizontal(mPoint, nowTime, calRange, calRangeUnit, mPointPropSource.getCalculationType()); - if (mPointHistories != null && mPointHistories.size() > 0) { - double max = mPointHistories.get(0).getParmvalue().doubleValue(); - for (MPointHistory mPointHistory : mPointHistories) { - if (max < mPointHistory.getParmvalue().doubleValue()) { - max = mPointHistory.getParmvalue().doubleValue(); - } - } - mPointVectorValue.setParmvalue(new BigDecimal(max)); - } - break; - case min: - //查询到结果才赋值,否则使用最后的值 - mPointHistories = getMPointHistoryHorizontal(mPoint, nowTime, calRange, calRangeUnit, mPointPropSource.getCalculationType()); - if (mPointHistories != null && mPointHistories.size() > 0) { - double min = mPointHistories.get(0).getParmvalue().doubleValue(); - for (MPointHistory mPointHistory : mPointHistories) { - if (min > mPointHistory.getParmvalue().doubleValue()) { - min = mPointHistory.getParmvalue().doubleValue(); - } - } - mPointVectorValue.setParmvalue(new BigDecimal(min)); - } - break; - case last: - //查询到结果才赋值,否则使用最后的值 -// logger.info(mPoint.getParmname()+"----枚举型--------last---"+nowTime); - mPointHistories = getMPointHistoryHorizontal(mPoint, nowTime, calRange, calRangeUnit, mPointPropSource.getCalculationType()); - if (mPointHistories != null && mPointHistories.size() > 0) { - //倒叙排取第一个,即去最后时刻的值 - BigDecimal min = mPointHistories.get(0).getParmvalue(); - mPointVectorValue.setParmvalue(min); - } - break; - case first: - //查询到结果才赋值,否则使用最后的值 - mPointHistories = getMPointHistoryHorizontal(mPoint, nowTime, calRange, calRangeUnit, mPointPropSource.getCalculationType()); - if (mPointHistories != null && mPointHistories.size() > 0) { - //倒叙排取第最后个,即取最开始时刻的值 - BigDecimal min = mPointHistories.get(mPointHistories.size() - 1).getParmvalue(); - mPointVectorValue.setParmvalue(min); - } - break; - case median: - //查询到结果才赋值,否则使用最后的值 - mPointHistories = getMPointHistoryHorizontal(mPoint, nowTime, calRange, calRangeUnit, mPointPropSource.getCalculationType()); - if (mPointHistories != null && mPointHistories.size() > 0) { - Collections.sort(mPointHistories, new Comparator() { - public int compare(MPointHistory arg0, MPointHistory arg1) { - return arg0.getParmvalue().compareTo(arg1.getParmvalue()); - } - }); - double median = 0.0; - if (mPointHistories.size() % 2 == 0) { - median = (mPointHistories.get(mPointHistories.size() / 2).getParmvalue().doubleValue() + mPointHistories.get(mPointHistories.size() / 2 + 1).getParmvalue().doubleValue()) / 2; - } else { - median = mPointHistories.get(mPointHistories.size() / 2).getParmvalue().doubleValue(); - } - mPointVectorValue.setParmvalue(new BigDecimal(median)); - } - break; - case vector: - //计算当月累计,固定从当月21日开始 - logger.info("vector-nowTime--" + nowTime); - startTime = CommUtil.getStartTimeByFreq(nowTime, 1, TimeUnitEnum.MONTH.getId(), true); - logger.info("vector-startTime--" + startTime); - mPointHistories = getMPointHistoryByVertical(mPoint, startTime, nowTime, calRange, calRangeUnit, - mPointPropSource.getCalculationType(), true, false); - logger.info("vector-mPointHistories--" + JSONArray.toJSONString(mPointHistories)); - Double[] values = new Double[mPointHistories.size()]; - for (int i = 0; i < mPointHistories.size(); i++) { - values[i] = mPointHistories.get(i).getParmvalue().doubleValue(); - } - mPointVectorValue.setVectorValue(values); - break; - default: - mPointHistories = getMPointHistoryHorizontal(mPoint, nowTime, calRange, calRangeUnit, mPointPropSource.getCalculationType()); - if (mPointHistories != null && mPointHistories.size() > 0) { - mPointVectorValue.setParmvalue(mPointHistories.get(mPointHistories.size() - 1).getParmvalue()); - } - break; - } - } else { - String whereStr_history = "where measuredt <= '" + nowTime + "' order by measuredt desc,ItemID desc"; -// logger.info("获取附表历史--"+mPoint.getParmname()+nowTime+"-开始"); - List mPointHistories = mPointHistoryService.selectAggregateList(mPoint.getBizid(), CommUtil.getMPointTableName(mPoint.getMpointcode()), whereStr_history, " ParmValue,MeasureDT "); -// logger.info("获取附表历史--"+mPoint.getParmname()+nowTime+"-结束-"+mPointHistories.size()); - if (mPointHistories != null && mPointHistories.size() > 0) { - //倒叙排取第一个,即去最后时刻的值 - mPointVectorValue.setParmvalue(mPointHistories.get(0).getParmvalue()); - } - } - - return new AsyncResult<>(mPointVectorValue); - } - - /** - * 跟时间频率,(时间横向)获取当前时间之前的数据范围内历史,主要用于获取最大最小值 - * 如向前推1天 - * - * @param mPoint - * @param nowTime - * @param calRange - * @param calRangeUnit - * @return - */ - public List getMPointHistoryHorizontal(MPoint mPoint, String nowTime, int calRange, String calRangeUnit, String culType) { - - String startTime = CommUtil.getStartTimeByFreq(nowTime, calRange, calRangeUnit, false); - if (culType != null && !culType.isEmpty()) { - //时间是否偏移,如处理量当天的数据,需要第二天才有 - startTime = CommUtil.getTimeByculType(startTime, culType, calRangeUnit); - nowTime = CommUtil.getTimeByculType(nowTime, culType, calRangeUnit); - } - String whereStr_history = "where measuredt >= '" + startTime + "' and measuredt < '" + nowTime + "' order by measuredt desc,ItemID desc"; - logger.info("获取附表历史--" + mPoint.getId() + "-" + mPoint.getParmname() + "--" + startTime + "--" + nowTime + "--" + culType + "--开始"); - List mPointHistories = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), CommUtil.getMPointTableName(mPoint.getMpointcode()), whereStr_history); - logger.info("获取附表历史--" + mPoint.getId() + "-" + mPoint.getParmname() + "-结束"); -// logger.info(mPoint.getParmname()+"获取附表历史结果为--"+JSONArray.toJSONString(mPointHistories)); - return mPointHistories; - } - - /** - * 跟时间频率,(时间纵向过滤间隔)获取当前时间之前的数据范围内历史,主要用于获取求和值 - * 如只取每小时的值 - * - * @param mPoint - * @param startTime - * @param edtTime - * @param calRange - * @param calRangeUnit - * @param fixFlag 数据不足,是否补全 - * @param fixEdtTime 查询时间范围是否包含最后时间,主要是日累计 - * @return - */ - public List getMPointHistoryByVertical(MPoint mPoint, String startTime, String edtTime, int calRange, String calRangeUnit, - String culType, boolean fixFlag, boolean fixEdtTime) { - if (culType != null && !culType.isEmpty()) { - //时间是否偏移,如处理量当天的数据,需要第二天才有 - startTime = CommUtil.getTimeByculType(startTime, culType, calRangeUnit); - edtTime = CommUtil.getTimeByculType(edtTime, culType, calRangeUnit); - } - String whereStr_history = "where measuredt >= '" + startTime + "' "; - if (fixEdtTime) { - whereStr_history += "and measuredt < '" + edtTime + "'"; - } else { - whereStr_history += "and measuredt <= '" + edtTime + "'"; - } - whereStr_history += " order by measuredt desc,ItemID desc"; - logger.info("获取附表历史--" + mPoint.getParmname() + "--" + startTime + "--" + edtTime + "--" + "开始"); - List list_all = mPointHistoryService.selectListByTableAWhere(mPoint.getBizid(), CommUtil.getMPointTableName(mPoint.getMpointcode()), whereStr_history); - logger.info("获取附表历史--" + mPoint.getParmname() + "-结束,点数为" + list_all.size()); - - List list = new ArrayList<>(); - DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - TimeUnitEnum timeUnitEnum = TimeUnitEnum.getTypeByValue(calRangeUnit); - Map map = list_all.stream().collect(Collectors.groupingBy(item -> { - // Store the minute-of-hour field. - LocalDateTime time = LocalDateTime.parse(item.getMeasuredt().substring(0, 19), df); - - - switch (timeUnitEnum) { - case MINUTE: - int last = time.getMinute(); - int first = last % calRange; - return time.truncatedTo(ChronoUnit.MINUTES).withMinute(last - first); - case HOUR: - - last = time.getHour(); - first = last % (calRange); - return time.truncatedTo(ChronoUnit.HOURS).withHour(last - first); - default: - last = time.getDayOfMonth(); - first = last % calRange; - return time.truncatedTo(ChronoUnit.DAYS).withDayOfYear(last - first); - } - - })); - // 按子测量点的频率取值,若是day,则每天取一个值 - for (Object value : map.values()) { - List items = (List) value; - if (items.size() > 0) list.add(items.get(items.size() - 1)); - } - list = list.stream().sorted(Comparator.comparing(MPointHistory::getMeasuredt)).collect(Collectors.toList()); - if (fixFlag) { - switch (timeUnitEnum) { - case MINUTE: - break; - case HOUR: - if (list.size() > 24) { - list = list.subList(0, 24); - } - break; - case DAY: - //vector计算必须数组大小一致,如果缺少数据,暂时直接在尾部添加,后续考虑考虑中间时间点补值 - int num = CommUtil.getDaysOfMonth(startTime, true); - if (list.size() < num) { - for (int i = list.size(); i < num; i++) { - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(0)); - list.add(mPointHistory); - } - } - break; - case MONTH: - break; - case YEAR: - break; - default: - } - } - - logger.info(mPoint.getParmname() + "获取附表历史结果为--" + JSONArray.toJSONString(list)); - return list; - } - -} diff --git a/src/com/sipai/service/scada/impl/MPointPropTargetServiceImpl.java b/src/com/sipai/service/scada/impl/MPointPropTargetServiceImpl.java deleted file mode 100644 index 644ce960..00000000 --- a/src/com/sipai/service/scada/impl/MPointPropTargetServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.scada.impl; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.service.scada.MPointPropTargetService; -import org.springframework.stereotype.Service; - -import com.sipai.dao.scada.MPointPropTargetDao; -import com.sipai.entity.scada.MPointPropTarget; -import com.sipai.tools.CommService; - -@Service -public class MPointPropTargetServiceImpl implements MPointPropTargetService { - @Resource - private MPointPropTargetDao mPointPropTargetDao; - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropTargetService#selectById(java.lang.String, java.lang.String) - */ - public MPointPropTarget selectById(String bizId,String id) { - return mPointPropTargetDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropTargetService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId,String id) { - return mPointPropTargetDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropTargetService#save(java.lang.String, com.sipai.entity.scada.MPointPropTarget) - */ - public int save(String bizId,MPointPropTarget entity) { - return mPointPropTargetDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropTargetService#update(java.lang.String, com.sipai.entity.scada.MPointPropTarget) - */ - public int update(String bizId,MPointPropTarget entity) { - return mPointPropTargetDao.updateByPrimaryKeySelective(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropTargetService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId,String wherestr) { - MPointPropTarget group = new MPointPropTarget(); - group.setWhere(wherestr); - return mPointPropTargetDao.selectListByWhere(group); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.MPointPropTargetService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId,String wherestr) { - MPointPropTarget group = new MPointPropTarget(); - group.setWhere(wherestr); - return mPointPropTargetDao.deleteByWhere(group); - } -} diff --git a/src/com/sipai/service/scada/impl/ProAlarmBaseTextServiceImpl.java b/src/com/sipai/service/scada/impl/ProAlarmBaseTextServiceImpl.java deleted file mode 100644 index f37a6571..00000000 --- a/src/com/sipai/service/scada/impl/ProAlarmBaseTextServiceImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.service.scada.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.process.DecisionExpertBase; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.process.DecisionExpertBaseService; -import com.sipai.service.scada.ProAlarmService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.ProAlarmBaseTextDao; -import com.sipai.entity.scada.ProAlarmBaseText; -import com.sipai.service.scada.ProAlarmBaseTextService; - -@Service -public class ProAlarmBaseTextServiceImpl implements ProAlarmBaseTextService { - @Resource - private ProAlarmBaseTextDao proAlarmBaseTextDao; - @Resource - private ProAlarmService proAlarmService; - @Resource - private DecisionExpertBaseService decisionExpertBaseService; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public ProAlarmBaseText selectById(String bizId, String id) { - return proAlarmBaseTextDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String id) { - return proAlarmBaseTextDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId, ProAlarmBaseText entity) { - return proAlarmBaseTextDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, ProAlarmBaseText entity) { - try { - int res = proAlarmBaseTextDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - ProAlarmBaseText group = new ProAlarmBaseText(); - group.setWhere(wherestr); - List proAlarmBaseTextList = proAlarmBaseTextDao.selectListByWhere(group); - return proAlarmBaseTextList; - } - - public List selectListByWhere2(String bizId, String wherestr) { - ProAlarmBaseText group = new ProAlarmBaseText(); - group.setWhere(wherestr); - List proAlarmBaseTextList = proAlarmBaseTextDao.selectListByWhere(group); - for (ProAlarmBaseText proAlarmBaseText : - proAlarmBaseTextList) { - String alarmId = proAlarmBaseText.getAlarmId(); - ProAlarm proAlarm = this.proAlarmService.selectById(bizId, alarmId); - proAlarmBaseText.setProAlarm(proAlarm); - - DecisionExpertBase decisionExpertBase = this.decisionExpertBaseService.selectById(proAlarmBaseText.getDecisionexpertbasePid()); - if(decisionExpertBase!=null){ - proAlarmBaseText.setZdTypeName(decisionExpertBase.getName()); - }else{ - proAlarmBaseText.setZdTypeName("-"); - } - } - return proAlarmBaseTextList; - } - - - public List selectCountByWhere(String bizId, String wherestr) { - ProAlarmBaseText group = new ProAlarmBaseText(); - group.setWhere(wherestr); - List proAlarmBaseTextList = proAlarmBaseTextDao.selectCountByWhere(group); - return proAlarmBaseTextList; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - ProAlarmBaseText group = new ProAlarmBaseText(); - group.setWhere(wherestr); - return proAlarmBaseTextDao.deleteByWhere(group); - } - - @Override - public List selectNumFromDateByWhere(String bizId,String wherestr, String str) { - List list = proAlarmBaseTextDao.selectNumFromDateByWhere(wherestr, str); - return list; - } - -} diff --git a/src/com/sipai/service/scada/impl/ProAlarmDataStopHisPointServiceImpl.java b/src/com/sipai/service/scada/impl/ProAlarmDataStopHisPointServiceImpl.java deleted file mode 100644 index a3664bae..00000000 --- a/src/com/sipai/service/scada/impl/ProAlarmDataStopHisPointServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.service.scada.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.scada.ProAlarmDataStopHisPointDao; -import com.sipai.entity.scada.ProAlarmDataStopHisPoint; -import com.sipai.service.scada.ProAlarmDataStopHisPointService; - -@Service -public class ProAlarmDataStopHisPointServiceImpl implements ProAlarmDataStopHisPointService { - @Resource - private ProAlarmDataStopHisPointDao proAlarmDataStopHisPointDao; - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectById(java.lang.String, java.lang.String) - */ - public ProAlarmDataStopHisPoint selectById(String bizId, String id) { - return proAlarmDataStopHisPointDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteById(java.lang.String, java.lang.String) - */ - public int deleteById(String bizId, String id) { - return proAlarmDataStopHisPointDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#save(com.sipai.entity.scada.MPFangAn) - */ - public int save(String bizId,ProAlarmDataStopHisPoint entity) { - return proAlarmDataStopHisPointDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#update(java.lang.String, com.sipai.entity.scada.MPFangAn) - */ - @Transactional - public int update(String bizId, ProAlarmDataStopHisPoint entity) { - try { - int res= proAlarmDataStopHisPointDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#selectListByWhere(java.lang.String, java.lang.String) - */ - public List selectListByWhere(String bizId, String wherestr) { - ProAlarmDataStopHisPoint group = new ProAlarmDataStopHisPoint(); - group.setWhere(wherestr); - List proAlarmDataStopHisPoint =proAlarmDataStopHisPointDao.selectListByWhere(group); - return proAlarmDataStopHisPoint; - } - - /* (non-Javadoc) - * @see com.sipai.service.scada.impl.MPFangAnService#deleteByWhere(java.lang.String, java.lang.String) - */ - public int deleteByWhere(String bizId, String wherestr) { - ProAlarmDataStopHisPoint group = new ProAlarmDataStopHisPoint(); - group.setWhere(wherestr); - return proAlarmDataStopHisPointDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/scada/impl/ProAlarmServiceImpl.java b/src/com/sipai/service/scada/impl/ProAlarmServiceImpl.java deleted file mode 100644 index 8b0be10b..00000000 --- a/src/com/sipai/service/scada/impl/ProAlarmServiceImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.sipai.service.scada.impl; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.scada.ProAlarmDao; -import com.sipai.entity.alarm.AlarmInformation; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.alarm.AlarmPoint; -import com.sipai.entity.alarm.AlarmSubscribe; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.alarm.AlarmInformationService; -import com.sipai.service.alarm.AlarmPointService; -import com.sipai.service.alarm.AlarmSubscribeService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.Mqtt; -import com.sipai.tools.MqttUtil; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; - -@Service("proAlarmService") -public class ProAlarmServiceImpl implements ProAlarmService { - @Resource - private ProAlarmDao proAlarmDao; - @Resource - private MPointService mPointService; - @Resource - private AlarmPointService alarmPointService; - @Resource - private AlarmInformationService alarmInformationService; - @Resource - private AlarmSubscribeService alarmSubscribeService; - @Resource - private ProcessSectionService processSectionService; - - public ProAlarm selectById(String unitId, String id) { - ProAlarm proAlarm = proAlarmDao.selectByPrimaryKey(id); - return proAlarm; - } - - public int deleteById(String unitId, String id) { - return proAlarmDao.deleteByPrimaryKey(id); - } - - public int save(String unitId, ProAlarm entity) { - return proAlarmDao.insert(entity); - } - - @Transactional - public int update(String unitId, ProAlarm entity) { - try { - int res = proAlarmDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhere(String unitId, String wherestr) { - ProAlarm group = new ProAlarm(); - group.setWhere(wherestr); - List proAlarm = proAlarmDao.selectListByWhere(group); - if (proAlarm != null && proAlarm.size() > 0) { - for (int i = 0; i < proAlarm.size(); i++) { - proAlarm.get(i).setAlarmTypeName(AlarmMoldCodeEnum.getName(proAlarm.get(i).getAlarmType())); - } - } - return proAlarm; - } - - @Override - public int recoverAlarmByWhere(String bizid, String wherestr, String recover_time, String recover_value) { - return proAlarmDao.recoverAlarmByWhere(recover_time, recover_value, wherestr); - } - - @Override - public List selectCountByWhere(String unitId, String wherestr) { - List proAlarm = proAlarmDao.selectCountByWhere(wherestr); - return proAlarm; - } - - @Override() - public List selectTop1ListByWhere(String bizid, String wherestr) { - ProAlarm entity = new ProAlarm(); - entity.setWhere(wherestr); - List list = proAlarmDao.selectTop1ListByWhere(entity); - return list; - } - - public void topAlarmNumC(HttpServletRequest request, String point, String type) { - String receivers = ""; - - List plist = this.alarmPointService.selectListByWhere2(" where alarm_point='" + point + "' "); - if (plist != null && plist.size() > 0) { - AlarmPoint alarmPoint = plist.get(0); - String informationCode = alarmPoint.getInformationCode(); - String alarmPointId = alarmPoint.getInformationCode(); - - //系统订阅 - List ilist = this.alarmInformationService.selectListByWhere2(" where code='" + informationCode + "' and unit_id='" + alarmPoint.getUnitId() + "' "); - if (ilist != null && ilist.size() > 0) { - receivers += ilist.get(0).getAlarmReceivers() + ","; - } - - AlarmSubscribe alarmSubscribe = this.alarmSubscribeService.selectById(alarmPointId); - if (alarmSubscribe != null) { - receivers += alarmSubscribe.getUserid() + ","; - } - - } - - if (!receivers.equals("")) { - if (request != null) { - HttpSession session = request.getSession(); - HashMap map = (HashMap) request.getSession().getAttribute("userlist"); - if (map != null && map.size() > 0) { - for (Object s : map.values()) { - User u = (User) s; - String uid = u.getId(); -// System.out.println(u.getId()); - if (receivers.contains(uid)) { - JSONObject jsonWebmain = new JSONObject(); - jsonWebmain.put("type", type); - // mqtt发布消息 - MqttUtil.publish(jsonWebmain, Mqtt.Type_Alarm_Num_Topic + "_" + u.getId()); - break; - } - } - } else { - JSONObject jsonWebmain = new JSONObject(); - jsonWebmain.put("type", type); - String[] receiver = receivers.split(","); - for (String u : - receiver) { - MqttUtil.publish(jsonWebmain, Mqtt.Type_Alarm_Num_Topic + "_" + u); - } - - } - } - } - - - } - - @Override - public List selectNumFromDateByWhere(String bizId, String wherestr, String str) { - List list = proAlarmDao.selectNumFromDateByWhere(wherestr, str); - return list; - } - - @Override - public List selectTopNumListByWhere(String bizId, String wherestr, String num) { - List list = proAlarmDao.selectTopNumListByWhere(wherestr, num); - return list; - } - -// public int deleteByWhere(String wherestr) { -// ProAlarm group = new ProAlarm(); -// group.setWhere(wherestr); -// return proAlarmDao.deleteByWhere(group); -// } - -} diff --git a/src/com/sipai/service/schedule/ScheduleJobDetailService.java b/src/com/sipai/service/schedule/ScheduleJobDetailService.java deleted file mode 100644 index 970d36a6..00000000 --- a/src/com/sipai/service/schedule/ScheduleJobDetailService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.schedule; - -import java.util.List; - -import com.sipai.entity.schedule.ScheduleJobDetail; - -public interface ScheduleJobDetailService { - - public ScheduleJobDetail selectById(String t); - - public int deleteById(String t); - - public int save(ScheduleJobDetail t); - - public int update(ScheduleJobDetail t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/schedule/ScheduleJobService.java b/src/com/sipai/service/schedule/ScheduleJobService.java deleted file mode 100644 index f0e40b33..00000000 --- a/src/com/sipai/service/schedule/ScheduleJobService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.service.schedule; - -import java.util.List; - -import org.springframework.stereotype.Service; - -import com.sipai.entity.schedule.ScheduleJob; - - - - -public interface ScheduleJobService { - - public ScheduleJob selectById(String t); - - public int deleteById(String t); - - public int save(ScheduleJob t); - - public int update(ScheduleJob t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - - /** - * 暂停定时任务 - * @param jobId - */ - void pauseJob(String jobId); - - /** - * 恢复一个定时任务 - * @param jobId - */ - void resumeJob(String jobId); - - /** - * 立即执行一个定时任务 - * @param jobId - */ - void runOnce(String jobId); - -} diff --git a/src/com/sipai/service/schedule/ScheduleJobTypeService.java b/src/com/sipai/service/schedule/ScheduleJobTypeService.java deleted file mode 100644 index a6d82f97..00000000 --- a/src/com/sipai/service/schedule/ScheduleJobTypeService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.schedule; - -import java.util.List; - -import com.sipai.entity.schedule.ScheduleJobType; - -public interface ScheduleJobTypeService { - - public ScheduleJobType selectById(String t); - - public int deleteById(String t); - - public int save(ScheduleJobType t); - - public int update(ScheduleJobType t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/schedule/impl/ScheduleJobDetailServiceImpl.java b/src/com/sipai/service/schedule/impl/ScheduleJobDetailServiceImpl.java deleted file mode 100644 index 443c62f0..00000000 --- a/src/com/sipai/service/schedule/impl/ScheduleJobDetailServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.schedule.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.schedule.ScheduleJobDetailDao; -import com.sipai.entity.schedule.ScheduleJobDetail; -import com.sipai.service.schedule.ScheduleJobDetailService; - -@Service("scheduleJobDetailService") -public class ScheduleJobDetailServiceImpl implements ScheduleJobDetailService{ - - @Resource - private ScheduleJobDetailDao scheduleJobDetailDao; - - @Override - public ScheduleJobDetail selectById(String t) { - // TODO Auto-generated method stub - return scheduleJobDetailDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return scheduleJobDetailDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ScheduleJobDetail job) { - // TODO Auto-generated method stub - - return scheduleJobDetailDao.insertSelective(job); - } - - - - @Override - public int update(ScheduleJobDetail scheduleJob) { - // TODO Auto-generated method stub - - return scheduleJobDetailDao.updateByPrimaryKeySelective(scheduleJob); - } - - @Override - public List selectListByWhere(String t) { - ScheduleJobDetail entity = new ScheduleJobDetail(); - entity.setWhere(t); - return scheduleJobDetailDao.selectListByWhere(entity); - } - - - @Transactional - public int deleteByWhere(String t) { - ScheduleJobDetail entity = new ScheduleJobDetail(); - entity.setWhere(t); - return scheduleJobDetailDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/schedule/impl/ScheduleJobServiceImpl.java b/src/com/sipai/service/schedule/impl/ScheduleJobServiceImpl.java deleted file mode 100644 index 129749c4..00000000 --- a/src/com/sipai/service/schedule/impl/ScheduleJobServiceImpl.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.sipai.service.schedule.impl; - -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; - -import org.quartz.CronScheduleBuilder; -import org.quartz.CronTrigger; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobKey; -import org.quartz.Scheduler; -import org.quartz.TriggerBuilder; -import org.quartz.TriggerKey; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.sipai.dao.schedule.ScheduleJobDao; -import com.sipai.entity.schedule.ScheduleJob; -import com.sipai.entity.schedule.ScheduleJobType; -import com.sipai.quartz.job.QuartzJobFactory; -import com.sipai.service.schedule.ScheduleJobService; -import com.sipai.service.schedule.ScheduleJobTypeService; -import com.sipai.tools.CommString; - -@Service("scheduleJobService") -public class ScheduleJobServiceImpl implements ScheduleJobService { -// private Logger log = LoggerFactory.getLogger(ScheduleJobServiceImpl.class); - - - @Resource - private ScheduleJobDao scheduleJobDao; - @Resource - private Scheduler scheduler; - @Resource - private ScheduleJobTypeService scheduleJobTypeService; - - @PostConstruct - public void init() { - //获取所有的定时任务 - List scheduleJobList = this.selectListByWhere("where 1=1 and status = '0'"); -// if (scheduleJobList.size() != 0) { -// for (ScheduleJob scheduleJob : scheduleJobList) { -// addJob(scheduleJob); -// } -// } - } - - /** - * 添加任务 - * - * @param job - */ - private void addJob(ScheduleJob job) { - try { -// log.info("初始化"); - TriggerKey triggerKey = TriggerKey.triggerKey(job.getJobName(), job.getJobGroup()); - CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - - //不存在,则创建 - if (null == trigger) { - Class clazz = QuartzJobFactory.class; - JobDetail jobDetail = JobBuilder. - newJob(clazz). - withIdentity(job.getJobName(), job.getJobGroup()). - build(); - jobDetail.getJobDataMap().put("scheduleJob", job); - - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression()); - - //withIdentity中写jobName和groupName - trigger = TriggerBuilder. - newTrigger(). - withIdentity(job.getJobName(), job.getJobGroup()) - .withSchedule(scheduleBuilder) - .build(); - scheduler.scheduleJob(jobDetail, trigger); - //如果定时任务是暂停状态 - if (job.getStatus() == CommString.STATUS_NOT_RUNNING) { - pauseJob(job.getId()); - } - } else { - // Trigger已存在,那么更新相应的定时设置 - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression()); - - // 按新的cronExpression表达式重新构建trigger - trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - - // 按新的trigger重新设置job执行 - scheduler.rescheduleJob(triggerKey, trigger); - } - } catch (Exception e) { -// log.error("添加任务失败", e); - } - } - - - /** - * 暂停定时任务 - * - * @param jobId - */ - public void pauseJob(String jobId) { - //修改定时任务状态 - ScheduleJob scheduleJob = selectById(jobId); - scheduleJob.setId(jobId); - scheduleJob.setStatus(CommString.STATUS_NOT_RUNNING); - update(scheduleJob); - try { - //暂停一个job - JobKey jobKey = JobKey.jobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - scheduler.pauseJob(jobKey); - } catch (Exception e) { -// log.error("CatchException:暂停任务失败",e); - } - } - - /** - * 恢复一个定时任务 - * - * @param jobId - */ - public void resumeJob(String jobId) { - //修改定时任务状态 - ScheduleJob scheduleJob = selectById(jobId); - scheduleJob.setStatus(CommString.STATUS_RUNNING); - update(scheduleJob); - try { - //恢复一个定时任务 - JobKey jobKey = JobKey.jobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - scheduler.resumeJob(jobKey); - } catch (Exception e) { -// log.error("CatchException:恢复定时任务失败",e); - } - } - - /** - * 立即执行一个定时任务 - * - * @param jobId - */ - public void runOnce(String jobId) { - try { - ScheduleJob scheduleJob = selectById(jobId); - JobKey jobKey = JobKey.jobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - scheduler.triggerJob(jobKey); - } catch (Exception e) { -// log.error("CatchException:恢复定时任务失败",e); - } - } - - /** - * 更新时间表达式 - * - * @param id - * @param cronExpression - */ - public void updateCron(String id, String cronExpression) { - ScheduleJob scheduleJob = selectById(id); - scheduleJob.setCronExpression(cronExpression); - update(scheduleJob); - try { - TriggerKey triggerKey = TriggerKey.triggerKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()); - trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - scheduler.rescheduleJob(triggerKey, trigger); - } catch (Exception e) { -// log.error("CatchException:更新时间表达式失败",e); - } - - } - - @Override - public ScheduleJob selectById(String t) { - // TODO Auto-generated method stub - return scheduleJobDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return scheduleJobDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ScheduleJob job) { - // TODO Auto-generated method stub - addJob(job); - return scheduleJobDao.insertSelective(job); - } - - - @Override - public int update(ScheduleJob scheduleJob) { - // TODO Auto-generated method stub - try { - TriggerKey triggerKey = TriggerKey.triggerKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()); - trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - scheduler.rescheduleJob(triggerKey, trigger); - //如果是暂停状态,调用暂停方法 - if (scheduleJob.getStatus() == 1) { - try { - //暂停一个job - JobKey jobKey = JobKey.jobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - scheduler.pauseJob(jobKey); - } catch (Exception e) { -// log.error("CatchException:暂停任务失败",e); - } - } else { - //否则恢复启动 - try { - //恢复一个定时任务 - JobKey jobKey = JobKey.jobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup()); - scheduler.resumeJob(jobKey); - } catch (Exception e) { -// log.error("CatchException:恢复定时任务失败",e); - } - } - } catch (Exception e) { -// log.error("CatchException:更新时间表达式失败",e); - } - - return scheduleJobDao.updateByPrimaryKeySelective(scheduleJob); - } - - @Override - public List selectListByWhere(String t) { - ScheduleJob scheduleJob = new ScheduleJob(); - scheduleJob.setWhere(t); - List scheduleJobs = scheduleJobDao.selectListByWhere(scheduleJob); - for (ScheduleJob item : scheduleJobs) { - if (null != item.getJobGroup() && !item.getJobGroup().isEmpty()) { - ScheduleJobType scheduleJobType = scheduleJobTypeService.selectById(item.getJobGroup()); - item.setScheduleJobType(scheduleJobType); - } - } - return scheduleJobs; - } - - - @Override - public int deleteByWhere(String t) { - ScheduleJob scheduleJob = new ScheduleJob(); - scheduleJob.setWhere(t); - return scheduleJobDao.deleteByWhere(scheduleJob); - } - - -} diff --git a/src/com/sipai/service/schedule/impl/ScheduleJobTypeServiceImpl.java b/src/com/sipai/service/schedule/impl/ScheduleJobTypeServiceImpl.java deleted file mode 100644 index 398ef67d..00000000 --- a/src/com/sipai/service/schedule/impl/ScheduleJobTypeServiceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.schedule.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.quartz.CronScheduleBuilder; -import org.quartz.CronTrigger; -import org.quartz.JobKey; -import org.quartz.TriggerKey; -import org.springframework.stereotype.Service; - -import com.sipai.dao.schedule.ScheduleJobTypeDao; -import com.sipai.entity.schedule.ScheduleJobType; -import com.sipai.service.schedule.ScheduleJobTypeService; - -@Service("scheduleJobTypeService") -public class ScheduleJobTypeServiceImpl implements ScheduleJobTypeService{ - - @Resource - private ScheduleJobTypeDao scheduleJobTypeDao; - - @Override - public ScheduleJobType selectById(String t) { - // TODO Auto-generated method stub - return scheduleJobTypeDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return scheduleJobTypeDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ScheduleJobType job) { - // TODO Auto-generated method stub - - return scheduleJobTypeDao.insertSelective(job); - } - - - - @Override - public int update(ScheduleJobType scheduleJob) { - // TODO Auto-generated method stub - - return scheduleJobTypeDao.updateByPrimaryKeySelective(scheduleJob); - } - - @Override - public List selectListByWhere(String t) { - ScheduleJobType entity = new ScheduleJobType(); - entity.setWhere(t); - return scheduleJobTypeDao.selectListByWhere(entity); - } - - - @Override - public int deleteByWhere(String t) { - ScheduleJobType entity = new ScheduleJobType(); - entity.setWhere(t); - return scheduleJobTypeDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/score/LibraryMPointPropService.java b/src/com/sipai/service/score/LibraryMPointPropService.java deleted file mode 100644 index 46b230af..00000000 --- a/src/com/sipai/service/score/LibraryMPointPropService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.service.score; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.MPointProp; -import com.sipai.entity.score.LibraryMPoint; -import com.sipai.entity.score.LibraryMPointProp; -import com.sipai.entity.score.LibraryMPointPropSource; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -public interface LibraryMPointPropService { - LibraryMPointProp selectById(String t); - - int deleteById(String t); - - int save(LibraryMPointProp libraryMPointProp); - - int update(LibraryMPointProp entity); - - List selectListByWhere(String t); - - @Transactional - int deleteByWhere(String t); - - int deletesMPointPropSource(Listlist); - - JSONObject getTree(LibraryMPointProp prop,String sourceId); - - LibraryMPoint getList(LibraryMPointProp prop, LibraryMPoint libraryMPoint); - -// Result createMPointPropAndSource(LibraryMPoint libraryMPoint, String userId, String unitId); - - JSONObject getTree(String id,String sourceId); - -} diff --git a/src/com/sipai/service/score/LibraryMPointPropSourceService.java b/src/com/sipai/service/score/LibraryMPointPropSourceService.java deleted file mode 100644 index 6a462b38..00000000 --- a/src/com/sipai/service/score/LibraryMPointPropSourceService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.score; - -import com.sipai.entity.score.LibraryMPointPropSource; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -public interface LibraryMPointPropSourceService { - LibraryMPointPropSource selectById(String t); - - int deleteById(String t); - - int save(LibraryMPointPropSource libraryMPointPropSource); - - int update(LibraryMPointPropSource entity); - - List selectListByWhere(String t); - - @Transactional - int deleteByWhere(String t); -} diff --git a/src/com/sipai/service/score/impl/LibraryMPointPropServiceImpl.java b/src/com/sipai/service/score/impl/LibraryMPointPropServiceImpl.java deleted file mode 100644 index 8113e3d9..00000000 --- a/src/com/sipai/service/score/impl/LibraryMPointPropServiceImpl.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.sipai.service.score.impl; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.score.LibraryMPointPropDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointProp; -import com.sipai.entity.scada.MPointPropSource; -import com.sipai.entity.score.LibraryMPoint; -import com.sipai.entity.score.LibraryMPointProp; -import com.sipai.entity.score.LibraryMPointPropSource; -import com.sipai.service.scada.MPointPropService; -import com.sipai.service.scada.MPointPropSourceService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.score.LibraryMPointPropService; -import com.sipai.service.score.LibraryMPointPropSourceService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DataSourceHolder; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.beans.BeanUtils; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -@Service("LibraryMPointPropServiceImpl") -public class LibraryMPointPropServiceImpl implements LibraryMPointPropService { - - @Resource - private LibraryMPointPropDao libraryMPointPropDao; - @Resource - private LibraryMPointPropSourceService libraryMPointPropSourceService; - - @Resource - private MPointService mPointService; - @Resource - private MPointPropService mPointPropService; - @Resource - private MPointPropSourceService mPointPropSourceService; - - @Override - public LibraryMPointProp selectById(String t) { - // TODO Auto-generated method stub - return libraryMPointPropDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return libraryMPointPropDao.deleteByPrimaryKey(t); - } - - @Override - public int save(LibraryMPointProp libraryMPointProp) { - // TODO Auto-generated method stub - return libraryMPointPropDao.insertSelective(libraryMPointProp); - } - - @Override - public int update(LibraryMPointProp entity) { - // TODO Auto-generated method stub - return libraryMPointPropDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String t) { - LibraryMPointProp entity = new LibraryMPointProp(); - entity.setWhere(t); - return libraryMPointPropDao.selectListByWhere(entity); - } - - @Override - @Transactional - public int deleteByWhere(String t) { - LibraryMPointProp entity = new LibraryMPointProp(); - entity.setWhere(t); - return libraryMPointPropDao.deleteByWhere(entity); - } - - public int deletesMPointPropSource(Listlist){ - int result = 0; - if (list!= null && list.size()>0) { - String propSourceIds = ""; - for (LibraryMPointPropSource item : list) { - if (propSourceIds != "") { - propSourceIds+=","; - } - propSourceIds+= item.getId(); - } - propSourceIds = propSourceIds.replace(",","','"); - result = this.libraryMPointPropSourceService.deleteByWhere("where id in ('"+propSourceIds+"')"); - } - return result; - } - - public JSONObject getTree(LibraryMPointProp prop,String sourceId){ - JSONObject res = new JSONObject(); - if (prop == null) { - return res; - } - if(prop!=null){ - res.put("id",prop.getId()); - res.put("name",prop.getName()); - res.put("sourceId",sourceId); - } - List sources = this.libraryMPointPropSourceService - .selectListByWhere(" where pid = '"+prop.getId()+"'"); - JSONArray children = new JSONArray(); - for(LibraryMPointPropSource source:sources){ - LibraryMPointProp p = this.selectById(source.getMpid()); - if(p!=null){ - children.add(this.getTree(p,source.getId())); - } - } - res.put("children",children); - return res; - } - - public LibraryMPoint getList(LibraryMPointProp prop,LibraryMPoint libraryMPoint){ - if(libraryMPoint == null){ - libraryMPoint = new LibraryMPoint(); - List props = new ArrayList<>(); - List sources = new ArrayList<>(); - libraryMPoint.setLibraryMPointProp(props); - libraryMPoint.setLibraryMPointPropSource(sources); - } - if(prop!=null){ - libraryMPoint.getLibraryMPointProp().add(prop); - List sources = this.libraryMPointPropSourceService - .selectListByWhere(" where pid = '"+prop.getId()+"'"); - libraryMPoint.getLibraryMPointPropSource().addAll(sources); - for(LibraryMPointPropSource source:sources){ - LibraryMPointProp p = this.selectById(source.getMpid()); - libraryMPoint = this.getList(p,libraryMPoint); - } - } - return libraryMPoint; - } - -// @Transactional -// public Result createMPointPropAndSource(LibraryMPoint libraryMPoint,String userId,String unitId){ -// if(libraryMPoint == null){ -// Result result = Result.failed("未获取到对应库数据"); -// return result; -// } -// //1 prop -// for(LibraryMPointProp prop:libraryMPoint.getLibraryMPointProp()){ -// MPointProp mPointProp = new MPointProp(); -// BeanUtils.copyProperties(prop,mPointProp); -// String id = CommUtil.generateIdCode(prop.getId(),unitId); -// mPointProp.setId(id); -// mPointProp.setInsdt(CommUtil.nowDate()); -// mPointProp.setInsuser(userId); -// MPointProp last = this.mPointPropService.selectById(unitId, id); -// if(last!=null){ -// //update -// int res = this.mPointPropService.update(unitId, mPointProp); -// }else{ -// //insert -// int res = this.mPointPropService.save(unitId, mPointProp); -// } -// List lastSource = this.mPointPropSourceService -// .selectListByWhere(unitId," where pid = '"+id+"'"); -// if(lastSource.size()>0){ -// for(MPointPropSource s:lastSource){ -// this.mPointPropSourceService.deleteById(unitId,s.getId()); -// } -// } -// // todo 匹配或生成点 -// MPoint mPoint = this.mPointService.selectById(id); -// if(mPoint == null){ -// // 没有就生成 -// -// } -// } -// -// //2 propsource -// for(LibraryMPointPropSource source:libraryMPoint.getLibraryMPointPropSource()){ -// MPointPropSource mPointPropSource = new MPointPropSource(); -// BeanUtils.copyProperties(source,mPointPropSource); -// String mpid = CommUtil.generateIdCode(source.getMpid(),unitId); -// String pid = CommUtil.generateIdCode(source.getPid(),unitId); -// mPointPropSource.setId(CommUtil.getUUID()); -// mPointPropSource.setPid(pid); -// mPointPropSource.setMpid(mpid); -// mPointPropSource.setInsdt(CommUtil.nowDate()); -// mPointPropSource.setInsuser(userId); -// int res = this.mPointPropSourceService.save(unitId,mPointPropSource); -// // todo 匹配或生成点 -// MPoint mPoint = this.mPointService.selectById(mpid); -// if(mPoint == null){ -// // 没有就生成 -// -// } -// } -// Result result = Result.success(1); -// return result; -// } - - public JSONObject getTree(String id,String sourceId){ - JSONObject res = new JSONObject(); - MPoint mpoint = this.mPointService.selectById(id); - res.put("id",id); - res.put("sourceId",sourceId); - if(mpoint!=null) { - res.put("mpoint", mpoint); - } - NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); -// boolQueryBuilder.must(QueryBuilders.matchQuery("source_type",MPoint.Flag_Type_KPI)); - //KPIPoints只存单点id - boolQueryBuilder.must(QueryBuilders.matchQuery("pid",id)); - nativeSearchQueryBuilder.withQuery(boolQueryBuilder); - List sources = this.mPointPropSourceService - .selectListByWhere(nativeSearchQueryBuilder); - JSONArray children = new JSONArray(); - for(MPointPropSource source:sources){ - MPoint m = this.mPointService.selectById(source.getMpid()); - if(m!=null){ - children.add(this.getTree(m.getId(),source.getId())); - } - } - res.put("children",children); - return res; - } - -} diff --git a/src/com/sipai/service/score/impl/LibraryMPointPropSourceServiceImpl.java b/src/com/sipai/service/score/impl/LibraryMPointPropSourceServiceImpl.java deleted file mode 100644 index 4ee95a3d..00000000 --- a/src/com/sipai/service/score/impl/LibraryMPointPropSourceServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.service.score.impl; - -import com.sipai.dao.score.LibraryMPointPropSourceDao; -import com.sipai.entity.score.LibraryMPointPropSource; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service("LibraryMPointPropSourceServiceImpl") -public class LibraryMPointPropSourceServiceImpl implements com.sipai.service.score.LibraryMPointPropSourceService { - - @Resource - private LibraryMPointPropSourceDao libraryMPointPropSourceDao; - - @Override - public LibraryMPointPropSource selectById(String t) { - // TODO Auto-generated method stub - return libraryMPointPropSourceDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return libraryMPointPropSourceDao.deleteByPrimaryKey(t); - } - - @Override - public int save(LibraryMPointPropSource libraryMPointPropSource) { - // TODO Auto-generated method stub - return libraryMPointPropSourceDao.insertSelective(libraryMPointPropSource); - } - - @Override - public int update(LibraryMPointPropSource entity) { - // TODO Auto-generated method stub - return libraryMPointPropSourceDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String t) { - LibraryMPointPropSource entity = new LibraryMPointPropSource(); - entity.setWhere(t); - return libraryMPointPropSourceDao.selectListByWhere(entity); - } - - @Override - @Transactional - public int deleteByWhere(String t) { - LibraryMPointPropSource entity = new LibraryMPointPropSource(); - entity.setWhere(t); - return libraryMPointPropSourceDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/sparepart/ApplyPurchasePlanService.java b/src/com/sipai/service/sparepart/ApplyPurchasePlanService.java deleted file mode 100644 index 9498a21e..00000000 --- a/src/com/sipai/service/sparepart/ApplyPurchasePlanService.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.Resource; -import org.springframework.stereotype.Service; -import com.sipai.dao.sparepart.ApplyPurchasePlanDao; -import com.sipai.entity.sparepart.ApplyPurchasePlan; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class ApplyPurchasePlanService implements CommService{ - @Resource - private ApplyPurchasePlanDao applyPurchasePlanDao; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public ApplyPurchasePlan selectById(String id) { - ApplyPurchasePlan applyPurchasePlan = applyPurchasePlanDao.selectByPrimaryKey(id); - if (applyPurchasePlan.getDepartmentId() != null && !applyPurchasePlan.getDepartmentId().isEmpty()) { - Unit unit = this.unitService.getUnitById(applyPurchasePlan.getDepartmentId()); - applyPurchasePlan.setUnit(unit); - } - if (applyPurchasePlan.getApplicant() != null && !applyPurchasePlan.getApplicant().isEmpty()) { - String userIds = applyPurchasePlan.getApplicant().replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - applyPurchasePlan.setApplicantName(userNames); - } - return applyPurchasePlan; - } - - @Override - public int deleteById(String id) { - return applyPurchasePlanDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ApplyPurchasePlan applyPurchasePlan) { - return applyPurchasePlanDao.insert(applyPurchasePlan); - } - - @Override - public int update(ApplyPurchasePlan applyPurchasePlan) { - return applyPurchasePlanDao.updateByPrimaryKeySelective(applyPurchasePlan); - } - - @Override - public List selectListByWhere(String wherestr) { - ApplyPurchasePlan applyPurchasePlan = new ApplyPurchasePlan(); - applyPurchasePlan.setWhere(wherestr); - List list = applyPurchasePlanDao.selectListByWhere(applyPurchasePlan); - for (ApplyPurchasePlan item : list) { - if (item.getDepartmentId() != null && !item.getDepartmentId().isEmpty()) { - Unit unit = this.unitService.getUnitById(item.getDepartmentId()); - item.setUnit(unit); - } - if (item.getApplicant() != null && !item.getApplicant().isEmpty()) { - String userIds = item.getApplicant().replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User user : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=user.getCaption(); - } - item.setApplicantName(userNames); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ApplyPurchasePlan applyPurchasePlan = new ApplyPurchasePlan(); - applyPurchasePlan.setWhere(wherestr); - return applyPurchasePlanDao.deleteByWhere(applyPurchasePlan); - } - /** - * 判断状态:保证同一个厂区同一个部门只有一个启用状态 - * @return - */ - public int changeStatus(ApplyPurchasePlan applyPurchasePlan){ - int res = 0; - String status = applyPurchasePlan.getStatus(); - if("启用".equals(status)){ - ApplyPurchasePlan applyPurchasePlanOther = new ApplyPurchasePlan(); - applyPurchasePlanOther.setWhere("where id !='"+applyPurchasePlan.getId()+"' " - + "and biz_id='"+applyPurchasePlan.getBizId()+"' " - + "and department_id ='"+applyPurchasePlan.getDepartmentId()+"' " - + "and status='启用' order by insdt desc"); - List list = applyPurchasePlanDao.selectListByWhere(applyPurchasePlanOther); - for (ApplyPurchasePlan item : list) { - item.setStatus("禁用"); - this.update(item); - } - }else{//禁用 - ApplyPurchasePlan applyPurchasePlanOther = new ApplyPurchasePlan(); - applyPurchasePlanOther.setWhere("where id !='"+applyPurchasePlan.getId()+"' " - + "and biz_id='"+applyPurchasePlan.getBizId()+"' " - + "and department_id ='"+applyPurchasePlan.getDepartmentId()+"' " - + "and status='启用' order by insdt desc"); - List list = applyPurchasePlanDao.selectListByWhere(applyPurchasePlanOther); - if(list!=null && list.size()>0){ - //不变 - }else{ - applyPurchasePlanOther = new ApplyPurchasePlan(); - applyPurchasePlanOther.setWhere("where id !='"+applyPurchasePlan.getId()+"' " - + "and biz_id='"+applyPurchasePlan.getBizId()+"' " - + "and department_id ='"+applyPurchasePlan.getDepartmentId()+"' " - + "and status='禁用' order by insdt desc"); - list = applyPurchasePlanDao.selectListByWhere(applyPurchasePlanOther); - if(list!=null && list.size()>0){ - ApplyPurchasePlan item = list.get(0); - item.setStatus("启用"); - this.update(item); - }else{ - applyPurchasePlan.setStatus("启用"); - this.update(applyPurchasePlan); - } - } - } - return res; - } - /** - * 获取表格中导入的工艺段id(全厂通用,不绑定厂区id) - * @param companyId - * @param cellValue - * @return - */ - public String getApplyPurchasePlanId(String cellValue){ - String applyPurchasePlanId = ""; - ListapplyPurchasePlan = selectListByWhere("where (name = '"+cellValue+"' or id='"+cellValue+"')"); - if (applyPurchasePlan!=null && applyPurchasePlan.size()>0) { - applyPurchasePlanId = applyPurchasePlan.get(0).getId(); - } - return applyPurchasePlanId; - } - - /** - * 递归获取子节点 - * @param list - */ - public List getChildren(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0;i result=getChildren(t.get(i).getId(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - - /** - * 判断状态:保证同一个厂区同一个部门只有一个启用状态 - * @return - */ - public boolean judgmentRange(String nowDate,String bizId,String departmentId){ - boolean res = false ; - ApplyPurchasePlan applyPurchasePlan = new ApplyPurchasePlan(); - applyPurchasePlan.setWhere("where status='启用' and biz_id='"+bizId+"' and department_id='"+departmentId+"' order by insdt desc"); - List list = applyPurchasePlanDao.selectListByWhere(applyPurchasePlan); - if(list!=null && list.size()>0){ - ApplyPurchasePlan applyPurchasePlan_item = list.get(0); - int start = 0; - int end = 0; - if(applyPurchasePlan_item!=null - && applyPurchasePlan_item.getPlanApplyPurchaseStartdate()!=null - && applyPurchasePlan_item.getPlanApplyPurchaseEnddate()!=null){ - start = applyPurchasePlan_item.getPlanApplyPurchaseStartdate(); - end = applyPurchasePlan_item.getPlanApplyPurchaseEnddate(); - } - if(nowDate==null || nowDate.isEmpty()){ - nowDate = CommUtil.nowDate(); - }else{ - if(nowDate.length()<11){ - nowDate = nowDate+" 00:00:00"; - } - } - int now = Integer.parseInt(nowDate.substring(8, 10)); - int endDays = CommUtil.getDaysOfMonth(nowDate,false); - if(endDays>end){ - - }else{ - end = endDays; - } - if(end>=now && now>=start){ - res = true; - } - } - return res; - } -} diff --git a/src/com/sipai/service/sparepart/ChannelsService.java b/src/com/sipai/service/sparepart/ChannelsService.java deleted file mode 100644 index b522b2ea..00000000 --- a/src/com/sipai/service/sparepart/ChannelsService.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ChannelsDao; -import com.sipai.entity.equipment.EquipmentStatusManagement; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.tools.CommService; - -@Service -public class ChannelsService implements CommService{ - @Resource - private ChannelsDao channelsDao; - @Resource - private ContractService contractService; - - @Override - public Channels selectById(String id) { - Channels channels = channelsDao.selectByPrimaryKey(id); - if(channels!=null){ - Channels channelsC =channelsDao.selectByPrimaryKey(channels.getPid()); - if(channelsC!=null){ - channels.setPname(channelsC.getName()); - } - } - return channels; - } - - @Override - public int deleteById(String id) { - return channelsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Channels channels) { - return channelsDao.insert(channels); - } - - @Override - public int update(Channels channels) { - return channelsDao.updateByPrimaryKeySelective(channels); - } - - @Override - public List selectListByWhere(String wherestr) { - Channels channels = new Channels(); - channels.setWhere(wherestr); - List list = channelsDao.selectListByWhere(channels); - return list; - } - public List selectList4ContractByWhere(String wherestr,String wherestr1) { - Channels channels = new Channels(); - channels.setWhere(wherestr); - List list = channelsDao.selectListByWhere(channels); - if(list!=null && list.size()>0){ - String contractwherestr = ""; - String contractorderstr = " order by contractStartDate desc"; - for(Channels channelss:list){ - contractwherestr = "where channelsId='"+channelss.getId()+"' "+wherestr1; - List contractList = this.contractService.selectListByWhere(contractwherestr+contractorderstr); - channelss.setContractList(contractList); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Channels channels = new Channels(); - channels.setWhere(wherestr); - return channelsDao.deleteByWhere(channels); - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(Channels k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - map.put("code", k.getMorder()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Channels k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("code", k.getMorder()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 获得所有列资渠道name string[] 用于excel数据验证 - */ - public String[] getChannelsName(String channelsids){ - String whereStr = ""; - if(channelsids!=null && !channelsids.isEmpty()){ - channelsids = channelsids.replace(",","','"); - whereStr = "where pid in ('"+channelsids+"') "; - }else{ - whereStr = "where pid !='-1' order by pid,id"; - } - List channels = this.selectListByWhere(whereStr); - String[] channelsStrings = null; - List list_all = this.selectListByWhere(" order by source,morder"); - if(channels!=null && channels.size()>0){ - channelsStrings = new String[list_all.size()]; - int arrayLen=0; - for(int i=0;i list_result = this.getChildren(channels.get(i).getId(),list_all); - for(int c=0;c0){ - channelsStrings = new String[channels.size()]; - int arrayLen=0; - for(int i=0;i list_result = this.getChildren(channels.get(i).getId(),list_all); - for(int c=0;cchannels = selectListByWhere("where (name = '"+cellValue+"' or id='"+cellValue+"')"); - if (channels!=null && channels.size()>0) { - channelsId = channels.get(0).getId(); - } - return channelsId; - } - - /** - * 递归获取子节点 - * @param list - */ - public List getChildren(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0;i result=getChildren(t.get(i).getId(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } -} diff --git a/src/com/sipai/service/sparepart/ConsumeDetailService.java b/src/com/sipai/service/sparepart/ConsumeDetailService.java deleted file mode 100644 index 8635f7d7..00000000 --- a/src/com/sipai/service/sparepart/ConsumeDetailService.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ConsumeDetailDao; -import com.sipai.entity.sparepart.ConsumeDetail; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.Stock; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class ConsumeDetailService implements CommService{ - @Resource - private ConsumeDetailDao consumeDetailDao; - @Resource - private GoodsService goodsService; - - - @Override - public ConsumeDetail selectById(String id) { - ConsumeDetail consumeDetail = consumeDetailDao.selectByPrimaryKey(id); - - return consumeDetail; - } - - - - @Override - public int deleteById(String id) { - return consumeDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ConsumeDetail goods) { - return consumeDetailDao.insert(goods); - } - public String saveOrupdate(String userId,String goodsId,String goodsNumber,String worksheetId) { - String wherestr1 = " where a.user_id = '"+userId+"' and goods_id = '"+goodsId+"' "; - List list1 = this.ConsumeTotal(wherestr1); - String res= ""; - if(list1!=null&& Double.valueOf(list1.get(0).get_allnumber()) list = this.selectListByWhere(wherestr); - if(list!=null&&list.size()>0){ - ConsumeDetail consumeDetail = list.get(0); - if("0".equals(goodsNumber)||goodsNumber==null){ - this.deleteById(consumeDetail.getId()); - res = "已删除"; - }else{ - consumeDetail.setConsumeNumber(new BigDecimal(goodsNumber)); - this.update(consumeDetail); - res = "更新成功";} - }else { - ConsumeDetail consumeDetail = new ConsumeDetail(); - consumeDetail.setId(CommUtil.getUUID()); - consumeDetail.setInsdt(CommUtil.nowDate()); - consumeDetail.setInsuser(userId); - consumeDetail.setGoodsId(goodsId); - consumeDetail.setConsumeNumber(new BigDecimal(goodsNumber)); - consumeDetail.setWorkOrderId(worksheetId); - int result = this.save(consumeDetail); - res = "保存成功"; - } - } - return res; - } - - public int deletebyWorksheetId(String worksheetId) { - ConsumeDetail consumeDetail = new ConsumeDetail(); - consumeDetail.setWhere(("where work_order_id = '"+worksheetId+"'")); - return consumeDetailDao.deleteByWhere(consumeDetail); - } - @Override - public int update(ConsumeDetail goods) { - return consumeDetailDao.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - ConsumeDetail consumeDetail = new ConsumeDetail(); - consumeDetail.setWhere(wherestr); - List list = consumeDetailDao.selectListByWhere(consumeDetail); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ConsumeDetail consumeDetail = new ConsumeDetail(); - consumeDetail.setWhere(wherestr); - return consumeDetailDao.deleteByWhere(consumeDetail); - } - - public List ConsumeTotal(String SQL) { - List list = consumeDetailDao.ConsumeTotal(SQL); - if (list != null && list.size()>0) { - for(ConsumeDetail consumeDetail:list){ - if (consumeDetail.getGoodsId() != null && !consumeDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(consumeDetail.getGoodsId()); - consumeDetail.setGoods(goods); - } - } - } - return list; - } -} diff --git a/src/com/sipai/service/sparepart/ContractChangeFileService.java b/src/com/sipai/service/sparepart/ContractChangeFileService.java deleted file mode 100644 index cc45573a..00000000 --- a/src/com/sipai/service/sparepart/ContractChangeFileService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractChangeFileDao; -import com.sipai.entity.sparepart.ContractChangeFile; -import com.sipai.tools.CommService; - -@Service -public class ContractChangeFileService implements CommService{ - @Resource - private ContractChangeFileDao contractChangeFileDao; - - @Override - public ContractChangeFile selectById(String id) { - ContractChangeFile contractChangeFile = contractChangeFileDao.selectByPrimaryKey(id); - return contractChangeFile; - } - - @Override - public int deleteById(String id) { - return contractChangeFileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractChangeFile contractChangeFile) { - return contractChangeFileDao.insert(contractChangeFile); - } - - @Override - public int update(ContractChangeFile contractChangeFile) { - return contractChangeFileDao.updateByPrimaryKeySelective(contractChangeFile); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractChangeFile contractChangeFile = new ContractChangeFile(); - contractChangeFile.setWhere(wherestr); - List list = contractChangeFileDao.selectListByWhere(contractChangeFile); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractChangeFile contractChangeFile = new ContractChangeFile(); - contractChangeFile.setWhere(wherestr); - return contractChangeFileDao.deleteByWhere(contractChangeFile); - } -} diff --git a/src/com/sipai/service/sparepart/ContractClassService.java b/src/com/sipai/service/sparepart/ContractClassService.java deleted file mode 100644 index e4a350d7..00000000 --- a/src/com/sipai/service/sparepart/ContractClassService.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractClassDao; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.tools.CommService; - -@Service -public class ContractClassService implements CommService{ - @Resource - private ContractClassDao contractClassDao; - @Resource - private ContractService contractService; - - @Override - public ContractClass selectById(String id) { - ContractClass contractClass = contractClassDao.selectByPrimaryKey(id); - ContractClass goodsC =contractClassDao.selectByPrimaryKey(contractClass.getPid()); - if(goodsC!=null){ - contractClass.setPname(goodsC.getName()); - contractClass.setpClass(goodsC); - } - return contractClass; - } - - @Override - public int deleteById(String id) { - return contractClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractClass contractClass) { - return contractClassDao.insert(contractClass); - } - - @Override - public int update(ContractClass contractClass) { - return contractClassDao.updateByPrimaryKeySelective(contractClass); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractClass contractClass = new ContractClass(); - contractClass.setWhere(wherestr); - List list = contractClassDao.selectListByWhere(contractClass); - return list; - } - - public List selectList4ContractByWhere(String wherestr,String wherestr1) { - ContractClass contractClass = new ContractClass(); - contractClass.setWhere(wherestr); - List list = contractClassDao.selectListByWhere(contractClass); - if(list!=null && list.size()>0){ - String contractwherestr = ""; - String contractorderstr = " order by contractStartDate desc"; - for(ContractClass contractClasss:list){ - contractwherestr = "where contractClassId='"+contractClasss.getId()+"' "+wherestr1; - List contractList = this.contractService.selectListByWhere(contractwherestr+contractorderstr); - contractClasss.setContractList(contractList); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractClass contractClass = new ContractClass(); - contractClass.setWhere(wherestr); - return contractClassDao.deleteByWhere(contractClass); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(ContractClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - map.put("code", k.getNumber()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(ContractClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - m.put("code", k.getNumber()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList4select(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(ContractClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList4select(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(ContractClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("children", childlist); - getTreeList4select(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/sparepart/ContractDetailInvoiceFileService.java b/src/com/sipai/service/sparepart/ContractDetailInvoiceFileService.java deleted file mode 100644 index 81ff62e4..00000000 --- a/src/com/sipai/service/sparepart/ContractDetailInvoiceFileService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractDetailInvoiceFileDao; -import com.sipai.entity.sparepart.ContractDetailInvoiceFile; -import com.sipai.tools.CommService; - -@Service -public class ContractDetailInvoiceFileService implements CommService{ - @Resource - private ContractDetailInvoiceFileDao contractDetailInvoiceFileDao; - - @Override - public ContractDetailInvoiceFile selectById(String id) { - ContractDetailInvoiceFile contractDetailInvoiceFile = contractDetailInvoiceFileDao.selectByPrimaryKey(id); - return contractDetailInvoiceFile; - } - - @Override - public int deleteById(String id) { - return contractDetailInvoiceFileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractDetailInvoiceFile contractDetailInvoiceFile) { - return contractDetailInvoiceFileDao.insert(contractDetailInvoiceFile); - } - - @Override - public int update(ContractDetailInvoiceFile contractDetailInvoiceFile) { - return contractDetailInvoiceFileDao.updateByPrimaryKeySelective(contractDetailInvoiceFile); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractDetailInvoiceFile contractDetailInvoiceFile = new ContractDetailInvoiceFile(); - contractDetailInvoiceFile.setWhere(wherestr); - List list = contractDetailInvoiceFileDao.selectListByWhere(contractDetailInvoiceFile); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractDetailInvoiceFile contractDetailInvoiceFile = new ContractDetailInvoiceFile(); - contractDetailInvoiceFile.setWhere(wherestr); - return contractDetailInvoiceFileDao.deleteByWhere(contractDetailInvoiceFile); - } -} diff --git a/src/com/sipai/service/sparepart/ContractDetailInvoiceService.java b/src/com/sipai/service/sparepart/ContractDetailInvoiceService.java deleted file mode 100644 index 10a95bf2..00000000 --- a/src/com/sipai/service/sparepart/ContractDetailInvoiceService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractDetailInvoiceDao; -import com.sipai.entity.sparepart.ContractDetailInvoice; -import com.sipai.entity.sparepart.ContractDetailInvoice; -import com.sipai.tools.CommService; - -@Service -public class ContractDetailInvoiceService implements CommService{ - @Resource - private ContractDetailInvoiceDao contractDetailInvoiceDao; - - @Override - public ContractDetailInvoice selectById(String id) { - ContractDetailInvoice contractDetailInvoice = contractDetailInvoiceDao.selectByPrimaryKey(id); - return contractDetailInvoice; - } - - @Override - public int deleteById(String id) { - return contractDetailInvoiceDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractDetailInvoice contractDetailInvoice) { - return contractDetailInvoiceDao.insert(contractDetailInvoice); - } - - @Override - public int update(ContractDetailInvoice contractDetailInvoice) { - return contractDetailInvoiceDao.updateByPrimaryKeySelective(contractDetailInvoice); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractDetailInvoice contractDetailInvoice = new ContractDetailInvoice(); - contractDetailInvoice.setWhere(wherestr); - List list = contractDetailInvoiceDao.selectListByWhere(contractDetailInvoice); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractDetailInvoice contractDetailInvoice = new ContractDetailInvoice(); - contractDetailInvoice.setWhere(wherestr); - return contractDetailInvoiceDao.deleteByWhere(contractDetailInvoice); - } - public List selectByContractId(String contractId) { - ContractDetailInvoice contractDetailInvoice = new ContractDetailInvoice(); - String wherestr = " where contract_id='"+contractId+"' "; - contractDetailInvoice.setWhere(wherestr); - List list = contractDetailInvoiceDao.selectListByWhere(contractDetailInvoice); - return list; - } -} diff --git a/src/com/sipai/service/sparepart/ContractDetailPaymentService.java b/src/com/sipai/service/sparepart/ContractDetailPaymentService.java deleted file mode 100644 index a6bce21a..00000000 --- a/src/com/sipai/service/sparepart/ContractDetailPaymentService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractDetailPaymentDao; -import com.sipai.entity.sparepart.ContractDetailPayment; -import com.sipai.tools.CommService; - -@Service -public class ContractDetailPaymentService implements CommService{ - @Resource - private ContractDetailPaymentDao contractDetailPaymentDao; - - @Override - public ContractDetailPayment selectById(String id) { - ContractDetailPayment contractDetailPayment = contractDetailPaymentDao.selectByPrimaryKey(id); - return contractDetailPayment; - } - - @Override - public int deleteById(String id) { - return contractDetailPaymentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractDetailPayment contractDetailPayment) { - return contractDetailPaymentDao.insert(contractDetailPayment); - } - - @Override - public int update(ContractDetailPayment contractDetailPayment) { - return contractDetailPaymentDao.updateByPrimaryKeySelective(contractDetailPayment); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractDetailPayment contractDetailPayment = new ContractDetailPayment(); - contractDetailPayment.setWhere(wherestr); - List list = contractDetailPaymentDao.selectListByWhere(contractDetailPayment); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractDetailPayment contractDetailPayment = new ContractDetailPayment(); - contractDetailPayment.setWhere(wherestr); - return contractDetailPaymentDao.deleteByWhere(contractDetailPayment); - } - - public List selectByContractId(String contractId) { - ContractDetailPayment contractDetailPayment = new ContractDetailPayment(); - String wherestr = " where contract_id='"+contractId+"' "; - contractDetailPayment.setWhere(wherestr); - List list = contractDetailPaymentDao.selectListByWhere(contractDetailPayment); - return list; - } - -} diff --git a/src/com/sipai/service/sparepart/ContractDetailService.java b/src/com/sipai/service/sparepart/ContractDetailService.java deleted file mode 100644 index f4298a33..00000000 --- a/src/com/sipai/service/sparepart/ContractDetailService.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.ContractDetailDao; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.ContractDetail; -import com.sipai.tools.CommService; - -@Service -public class ContractDetailService implements CommService{ - @Resource - private GoodsService goodsService; - @Resource - private ContractDetailDao contractDetailDao; - @Resource - private ContractService contractService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - - - @Override - public ContractDetail selectById(String id) { - ContractDetail contractDetail = contractDetailDao.selectByPrimaryKey(id); - if (contractDetail.getGoodsId() != null && !contractDetail.getGoodsId() .isEmpty()) { - Goods goods = this.goodsService.selectById(contractDetail.getGoodsId()); - contractDetail.setGoods(goods); - } - if (contractDetail.getContractId() != null && !contractDetail.getContractId().isEmpty()) { - Contract contract = this.contractService.selectById(contractDetail.getContractId()); - contractDetail.setContract(contract); - } - return contractDetail; - } - @Transactional - @Override - public int deleteById(String id) { - try { - ContractDetail contractDetail = this.selectById(id); - int result = this.contractDetailDao.deleteByPrimaryKey(id); - //删除申购明细时更新申购单总金额 - if (contractDetail.getContractId() != null && !contractDetail.getContractId().isEmpty()) { - Contract contract = this.contractService.selectById(contractDetail.getContractId()); - this.contractService.update(contract); - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(ContractDetail contractDetail) { - return contractDetailDao.insert(contractDetail); - } - - @Override - public int update(ContractDetail contractDetail) { - return contractDetailDao.updateByPrimaryKeySelective(contractDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractDetail contractDetail = new ContractDetail(); - contractDetail.setWhere(wherestr); - List list = contractDetailDao.selectListByWhere(contractDetail); - if (list != null && list.size()>0) { - for (ContractDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - if (item.getContractId() != null && !item.getContractId().isEmpty()) { - List contracts = this.contractService.selectListByWhere("where id = '"+item.getContractId()+"'"); - if (contracts != null && contracts.size()>0) { - item.setContract(contracts.get(0)); - } - } - } - } - return list; - } - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - ContractDetail contractDetail = new ContractDetail(); - contractDetail.setWhere(wherestr); - ListcontractDetails = this.selectListByWhere(wherestr); - int result = this.contractDetailDao.deleteByWhere(contractDetail); - //删除申购明细时更新申购单总金额 - if (contractDetails!= null && contractDetails.size()>0) { - if (contractDetails.get(0).getContractId() != null && !contractDetails.get(0).getContractId().isEmpty()) { - Contract contract = this.contractService.selectById(contractDetails.get(0).getContractId()); - this.contractService.update(contract); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 更新申购明细的数量或单价,同时更新明细的合计金额和申购单的总金额 - */ - @Transactional - public int updateTotalMoney(ContractDetail contractDetail,String number ,String price) { - try { - if (null != number && !number.isEmpty()) { - BigDecimal numberbBigDecimal = new BigDecimal(number); - contractDetail.setNumber(numberbBigDecimal); - } - if (null != price && !price.isEmpty()) { - BigDecimal pricebBigDecimal = new BigDecimal(price); - contractDetail.setPrice(pricebBigDecimal); - } - BigDecimal totalMoney = contractDetail.getTotalMoney(); - totalMoney = (contractDetail.getNumber()).multiply(contractDetail.getPrice()); - contractDetail.setTotalMoney(totalMoney); - int result = this.update(contractDetail); - if (result == 1) { - if (contractDetail.getContractId() != null && !contractDetail.getContractId().isEmpty()) { - List contracts = this.contractService.selectListByWhere("where id = '"+contractDetail.getContractId()+"'"); - if (contracts!=null && contracts.size()>0) { - Contract contract = this.contractService.selectById(contractDetail.getContractId()); - this.contractService.update(contract); - } - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - /** - * 判断string字符串是否在数组中 - * @param arr - * @param str - * @return - */ - public boolean isInArray(String[] arr,String str){ - return Arrays.asList(arr).contains(str); - } - /** - * 计算采购计划明细的可用数量 - */ - public BigDecimal getUsableNumber( String contractDetailId){ - List recordDetails = this.purchaseRecordDetailService.selectListByWhere("where contract_detail_id = '"+contractDetailId+"'"); - BigDecimal usedNumber = new BigDecimal(0); - if (recordDetails != null && recordDetails.size()>0) { - for (PurchaseRecordDetail recordDetail : recordDetails) { - if (recordDetail.getNumber() != null) { - usedNumber = usedNumber.add(recordDetail.getNumber()); - } - } - } - ContractDetail contractDetail = this.selectById(contractDetailId); - return contractDetail.getNumber().subtract(usedNumber); - } -} diff --git a/src/com/sipai/service/sparepart/ContractFileService.java b/src/com/sipai/service/sparepart/ContractFileService.java deleted file mode 100644 index 78c74ae5..00000000 --- a/src/com/sipai/service/sparepart/ContractFileService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractFileDao; -import com.sipai.entity.sparepart.ContractFile; -import com.sipai.tools.CommService; - -@Service -public class ContractFileService implements CommService{ - @Resource - private ContractFileDao contractFileDao; - - @Override - public ContractFile selectById(String id) { - ContractFile contractFile = contractFileDao.selectByPrimaryKey(id); - return contractFile; - } - - @Override - public int deleteById(String id) { - return contractFileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractFile contractFile) { - return contractFileDao.insert(contractFile); - } - - @Override - public int update(ContractFile contractFile) { - return contractFileDao.updateByPrimaryKeySelective(contractFile); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractFile contractFile = new ContractFile(); - contractFile.setWhere(wherestr); - List list = contractFileDao.selectListByWhere(contractFile); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractFile contractFile = new ContractFile(); - contractFile.setWhere(wherestr); - return contractFileDao.deleteByWhere(contractFile); - } -} diff --git a/src/com/sipai/service/sparepart/ContractService.java b/src/com/sipai/service/sparepart/ContractService.java deleted file mode 100644 index 77c63e62..00000000 --- a/src/com/sipai/service/sparepart/ContractService.java +++ /dev/null @@ -1,560 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.activiti.workflow.simple.definition.WorkflowDefinition; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.github.pagehelper.PageHelper; -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.sparepart.PurchasePlanDao; -import com.sipai.dao.sparepart.ContractDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.ContractClass; -import com.sipai.entity.sparepart.ContractDetailInvoice; -import com.sipai.entity.sparepart.ContractDetailPayment; -import com.sipai.entity.sparepart.ContractTaxRate; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchaseMethods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.ContractDetail; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.sparepart.WarrantyPeriod; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AutoAlert; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.AutoAlertService; -import com.sipai.tools.CommService; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class ContractService implements CommService{ - @Resource - private ContractDao contractDao; - @Resource - private ContractClassService contractClassService; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private SupplierService supplierService; - @Resource - private SubscribeService subscribeService; - @Resource - private WarrantyPeriodService warrantyPeriodService; - @Resource - private ChannelsService channelsService; - @Resource - private PurchaseMethodsService purchaseMethodsService; - @Resource - private PurchaseRecordService purchaseRecordService; - @Resource - private ContractTaxRateService contractTaxRateService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private ContractDetailService contractDetailService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitService businessUnitService; - @Resource - private ContractDetailPaymentService contractDetailPaymentService; - @Resource - private ContractDetailInvoiceService contractDetailInvoiceService; - @Resource - private AutoAlertService autoAlertService; - @Resource - private SubscribeDetailService subscribeDetailService; - - @Override - public Contract selectById(String id) { - Contract contract = contractDao.selectByPrimaryKey(id); - if(contract != null){ - if (contract.getDeptId() != null && !contract.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(contract.getDeptId()); - contract.setDept(dept); - } - if (contract.getBizId() != null && !contract.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(contract.getBizId()); - contract.setCompany(company); - List autoAlertList = this.autoAlertService.selectListByWhere(" where biz_id='"+contract.getBizId()+"' and alert_date>0 "); - contract.setAutoAlertList(autoAlertList); - } - if (contract.getAgentid() != null && !contract.getAgentid().isEmpty()) { - String contractManName = this.getUserNamesByUserIds(contract.getAgentid()); - contract.setAgentName(contractManName); - } - if (contract.getContractAuditId() != null && !contract.getContractAuditId().isEmpty()) { - String contractAuditName = this.getUserNamesByUserIds(contract.getContractAuditId()); - contract.setContractAuditName(contractAuditName); - } - if (contract.getContractclassid() != null && !contract.getContractclassid().isEmpty()) { - ContractClass Contractclass = this.contractClassService.selectById(contract.getContractclassid()); - contract.setContractclassName(Contractclass.getName()); - } - - if (contract.getWarrantyperiodid() != null && !contract.getWarrantyperiodid().isEmpty()) { - WarrantyPeriod warrantyperiod = this.warrantyPeriodService.selectById(contract.getWarrantyperiodid()); - contract.setWarrantyperiod(warrantyperiod.getPeriod()); - } - if (contract.getSupplierid() != null && !contract.getSupplierid().isEmpty()) { - Supplier supplier = this.supplierService.selectById(contract.getSupplierid()); - contract.setSupplierName(supplier.getName()); - } - - if (contract.getChannelsid() != null && !contract.getChannelsid().isEmpty()) { - String[] channels = contract.getChannelsid().split(","); - String channelsNames = ""; - for(int i=0;i selectListByWhere(String wherestr) { - Contract contract = new Contract(); - contract.setWhere(wherestr); - List list = contractDao.selectListByWhere(contract); - for (Contract item : list) { - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - if (item.getBizId() != null && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (item.getAgentid() != null && !item.getAgentid().isEmpty()) { - String contractManName = this.getUserNamesByUserIds(item.getAgentid()); - item.setAgentName(contractManName); - } - if (item.getContractAuditId() != null && !item.getContractAuditId().isEmpty()) { - String contractAuditName = this.getUserNamesByUserIds(item.getContractAuditId()); - item.setContractAuditName(contractAuditName); - } - if (item.getContractclassid() != null && !item.getContractclassid().isEmpty()) { - ContractClass Contractclass = this.contractClassService.selectById(item.getContractclassid()); - item.setContractclassName(Contractclass.getName()); - } - if (item.getWarrantyperiodid() != null && !item.getWarrantyperiodid().isEmpty()) { - WarrantyPeriod warrantyperiod = this.warrantyPeriodService.selectById(item.getWarrantyperiodid()); - item.setWarrantyperiod(warrantyperiod.getPeriod()); - } - if (item.getSupplierid() != null && !item.getSupplierid().isEmpty()) { - Supplier supplier = this.supplierService.selectById(item.getSupplierid()); - item.setSupplierName(supplier.getName()); - } - if (item.getChannelsid() != null && !item.getChannelsid().isEmpty()) { - String[] channels = item.getChannelsid().split(","); - String channelsNames = ""; - for(int i=0;i paymentList = this.contractDetailPaymentService.selectByContractId(item.getId()); - BigDecimal PaymentTotal =new BigDecimal(0); - BigDecimal noPaymentTotal =new BigDecimal(0); - for (ContractDetailPayment contractDetailPayment : paymentList) { - if(contractDetailPayment.getAmountpaid()!=null){ - PaymentTotal = PaymentTotal.add(contractDetailPayment.getAmountpaid()); - } - if(contractDetailPayment.getAmountoutstanding()!=null){ - noPaymentTotal= noPaymentTotal.add(contractDetailPayment.getAmountoutstanding()); - } - } - item.set_totalpayment(PaymentTotal); - item.set_nototalpayment(noPaymentTotal); - item.setPaymentList(paymentList); - } - if (item.getId() != null && !item.getId().isEmpty()) { - List invoiceList = this.contractDetailInvoiceService.selectByContractId(item.getId()); - BigDecimal amountinvoicetotal =new BigDecimal(0); - for (ContractDetailInvoice contractDetailInvoice : invoiceList) { - if(contractDetailInvoice.getAmountinvoice()!=null){ - amountinvoicetotal= amountinvoicetotal.add(contractDetailInvoice.getAmountinvoice()); - } - } - item.set_totalinvoice(amountinvoicetotal); - item.setInvoiceList(invoiceList); - } - if (item.getId() != null && !item.getId().isEmpty()) { - List autoAlertList = this.autoAlertService.selectListByWhere(" where alert_date is not null and alert_date>0 "); - item.setAutoAlertList(autoAlertList); - } - - } - return list; - } - /** - * 删除申购单时同时删除关联的流程,申购明细,使用业务回滚方式 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - Contract contract = new Contract(); - contract.setWhere(wherestr); - List contracts = this.selectListByWhere(wherestr); - for (Contract item : contracts) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - //删除申购单的同时删除关联的申购明细 - this.contractDetailService.deleteByWhere("where contract_id = '"+item.getId()+"'"); - } - return contractDao.deleteByWhere(contract); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } - /** - * 合同审批流程启动 - * @param - * @return - */ - @Transactional - public int startContractProcess(Contract contract) { - try { - Map variables = new HashMap(); - if(!contract.getContractAuditId().isEmpty()){ - variables.put("userIds", contract.getContractAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.B_Contract.getId()+"-"+contract.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(contract.getId(), contract.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - contract.setProcessid(processInstance.getId()); - contract.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res = 0; - Contract contracts = this.selectById(contract.getId()); - if (contracts != null) {//编辑页面发起,用更新方法 - res = contractDao.updateByPrimaryKeySelective(contract); - }else {//新增页面直接发起,用保存方法 - res = contractDao.insert(contract); - } - if (res==1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(contract); - businessUnitRecord.sendMessage(contract.getContractAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - Contract contract = this.selectById(id); - //Task task=workflowService.getTaskService().createTaskQuery().processInstanceId(contract.getProcessid()).singleResult(); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(contract.getProcessid()).list(); - if (task!=null && task.size()>0) { - contract.setStatus(task.get(0).getName()); - }else{ - contract.setStatus(SparePartCommString.STATUS_CONTRACT_EXECUTE); - } - int res =this.update(contract); - return res; - } - /** - * 合同审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter=this.selectById(entity.getBusinessid()); - int res =businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public List selectListByWhere4SUM(String wherestr) { - Contract contract = new Contract(); - contract.setWhere(wherestr); - List list = contractDao.selectListByWhere(contract); - Contract contractTotle = new Contract(); - BigDecimal contractamounttotle = new BigDecimal("0"); - BigDecimal paymentamounttotle = new BigDecimal("0"); - int sign = 0; - int implement = 0; - int FINISH = 0; - //完成率 - double completionrate=0; - //支付率 - double paymentrate=0; - if(list!=null && list.size()>0){ - for (Contract item : list) { - if(item.getContractamount()!=null){ - contractamounttotle = contractamounttotle.add(item.getContractamount()); - } - List paymentList = this.contractDetailPaymentService.selectByContractId(item.getId()); - if(paymentList!=null && paymentList.size()>0){ - for (ContractDetailPayment payment : paymentList) { - if(payment.getAmountpaid()!=null){ - paymentamounttotle = paymentamounttotle.add(payment.getAmountpaid()); - } - } - } - //在执行 - if(item.getStatus().equals(SparePartCommString.STATUS_CONTRACT_EXECUTE)){ - implement++; - }else{ - if( item.getStatus().equals(SparePartCommString.STATUS_CONTRACT_FINISH)){ - //已结束 - FINISH++; - }else{ - //在签 - sign++; - } - } - } - completionrate = FINISH/list.size()*100; - } - contractTotle.setContractcount(list.size()); - contractTotle.setSign(sign); - contractTotle.setImplement(implement); - contractTotle.setCompletionrate(completionrate); - if(contractamounttotle.doubleValue()>0){ - paymentrate = paymentamounttotle.doubleValue()/contractamounttotle.doubleValue()*100; - } - contractTotle.setPaymentrate(paymentrate); - contractTotle.setContractamounttotle(contractamounttotle); - contractTotle.setPaymentamounttotle(paymentamounttotle); - List listTotle = new ArrayList(); - listTotle.add(contractTotle); - return listTotle; - } - public List selectListByWhereforServlet(String wherestr) { - Contract contract = new Contract(); - contract.setWhere(wherestr); - List list = contractDao.selectListByWhere(contract); - for (Contract item : list) { - - if (item.getAgentid() != null && !item.getAgentid().isEmpty()) { - User agent = this.userService.getUserById(item.getAgentid()); - item.setAgent(agent); - } - if (item.getContractclassid() != null && !item.getContractclassid().isEmpty()) { - ContractClass Contractclass = this.contractClassService.selectById(item.getContractclassid()); - item.setContractclassName(Contractclass.getName()); - item.setContractclass(Contractclass); - } - if (item.getChannelsid() != null && !item.getChannelsid().isEmpty()) { - Channels channels = this.channelsService.selectById(item.getChannelsid()); - item.setChannelsName(channels.getName()); - } - List subscribeDetailList = this.subscribeDetailService.selectListByWhere("where contract_id='"+item.getId()+"' order by insdt "); - if(subscribeDetailList!=null && subscribeDetailList.size()>0){ - item.setSubscribeDetailList(subscribeDetailList); - } - } - return list; - } - - /** - * 合同撤回 - * @param entity - * @return - */ - @Transactional - public int doWithdraw(Task task) { - try { - int res = businessUnitService.doWithdraw(task); - /*if (res>0) { - this.updateStatus(entity.getBusinessid()); - }*/ - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - public List selectStatusByWhere(String wherestr) { - Contract contract = new Contract(); - contract.setWhere(wherestr); - List list = contractDao.selectStatusByWhere(contract); - return list; - } - public List selectPriceByWhere(String wherestr) { - Contract contract = new Contract(); - contract.setWhere(wherestr); - List list = contractDao.selectPriceByWhere(contract); - return list; - } -} diff --git a/src/com/sipai/service/sparepart/ContractTaxRateService.java b/src/com/sipai/service/sparepart/ContractTaxRateService.java deleted file mode 100644 index e396756a..00000000 --- a/src/com/sipai/service/sparepart/ContractTaxRateService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ContractTaxRateDao; -import com.sipai.entity.sparepart.ContractTaxRate; -import com.sipai.tools.CommService; - -@Service -public class ContractTaxRateService implements CommService{ - @Resource - private ContractTaxRateDao contractTaxRateDao; - - @Override - public ContractTaxRate selectById(String id) { - ContractTaxRate contractTaxRate = contractTaxRateDao.selectByPrimaryKey(id); - return contractTaxRate; - } - - @Override - public int deleteById(String id) { - return contractTaxRateDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ContractTaxRate contractTaxRate) { - return contractTaxRateDao.insert(contractTaxRate); - } - - @Override - public int update(ContractTaxRate contractTaxRate) { - return contractTaxRateDao.updateByPrimaryKeySelective(contractTaxRate); - } - - @Override - public List selectListByWhere(String wherestr) { - ContractTaxRate contractTaxRate = new ContractTaxRate(); - contractTaxRate.setWhere(wherestr); - List list = contractTaxRateDao.selectListByWhere(contractTaxRate); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ContractTaxRate contractTaxRate = new ContractTaxRate(); - contractTaxRate.setWhere(wherestr); - return contractTaxRateDao.deleteByWhere(contractTaxRate); - } -} diff --git a/src/com/sipai/service/sparepart/GoodsAcceptanceApplyDetailService.java b/src/com/sipai/service/sparepart/GoodsAcceptanceApplyDetailService.java deleted file mode 100644 index c5d2fb32..00000000 --- a/src/com/sipai/service/sparepart/GoodsAcceptanceApplyDetailService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.GoodsAcceptanceApplyDetailDao; -import com.sipai.entity.sparepart.GoodsAcceptanceApplyDetail; -import com.sipai.tools.CommService; - -@Service -public class GoodsAcceptanceApplyDetailService implements CommService{ - - @Resource - private GoodsAcceptanceApplyDetailDao goodsAcceptanceApplyDetailDao; - - @Override - public GoodsAcceptanceApplyDetail selectById(String t) { - return goodsAcceptanceApplyDetailDao.selectByPrimaryKey(t); - - } - - @Override - public int deleteById(String t) { - int resultNum=goodsAcceptanceApplyDetailDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(GoodsAcceptanceApplyDetail t) { - int resultNum=goodsAcceptanceApplyDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(GoodsAcceptanceApplyDetail t) { - int resultNum=goodsAcceptanceApplyDetailDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - GoodsAcceptanceApplyDetail gaad=new GoodsAcceptanceApplyDetail(); - gaad.setWhere(t); - return goodsAcceptanceApplyDetailDao.selectListByWhere(gaad); - - } - - @Override - public int deleteByWhere(String t) { - GoodsAcceptanceApplyDetail gaad=new GoodsAcceptanceApplyDetail(); - gaad.setWhere(t); - return goodsAcceptanceApplyDetailDao.deleteByWhere(gaad); - } - -} - diff --git a/src/com/sipai/service/sparepart/GoodsApplyService.java b/src/com/sipai/service/sparepart/GoodsApplyService.java deleted file mode 100644 index 416ff0f3..00000000 --- a/src/com/sipai/service/sparepart/GoodsApplyService.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.GoodsApplyDao; -import com.sipai.entity.sparepart.GoodsApply; -import com.sipai.entity.sparepart.GoodsClass; - -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.tools.CommService; - -@Service -public class GoodsApplyService implements CommService{ - @Resource - private GoodsApplyDao goodsApplyDao; - @Resource - private GoodsClassService goodsClassService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public GoodsApply selectById(String id) { - GoodsApply goodsApply = goodsApplyDao.selectByPrimaryKey(id); - if (null != goodsApply) { - if (null != goodsApply.getClassId() && !goodsApply.getClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(goodsApply.getClassId()); - goodsApply.setGoodsClass(goodsClass); - } - } - return goodsApply; - } - - @Override - public int deleteById(String id) { - return goodsApplyDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GoodsApply goodsApply) { - return goodsApplyDao.insert(goodsApply); - } - - @Override - public int update(GoodsApply goodsApply) { - return goodsApplyDao.updateByPrimaryKeySelective(goodsApply); - } - - @Override - public List selectListByWhere(String wherestr) { - GoodsApply goodsApply = new GoodsApply(); - goodsApply.setWhere(wherestr); - List list = goodsApplyDao.selectListByWhere(goodsApply); - for (GoodsApply item : list) { - if (item.getClassId() != null && !item.getClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(item.getClassId()); - item.setGoodsClass(goodsClass); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - GoodsApply goodsApply = new GoodsApply(); - goodsApply.setWhere(wherestr); - return goodsApplyDao.deleteByWhere(goodsApply); - } -} diff --git a/src/com/sipai/service/sparepart/GoodsClassService.java b/src/com/sipai/service/sparepart/GoodsClassService.java deleted file mode 100644 index fe297392..00000000 --- a/src/com/sipai/service/sparepart/GoodsClassService.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.GoodsClassDao; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.tools.CommService; - -@Service -public class GoodsClassService implements CommService{ - @Resource - private GoodsClassDao goodsClassDao; - - @Override - public GoodsClass selectById(String id) { - GoodsClass goodsClass = goodsClassDao.selectByPrimaryKey(id); - if(goodsClass!=null && goodsClass.getPid()!=null && !goodsClass.getPid().isEmpty()){ - GoodsClass goodsC =goodsClassDao.selectByPrimaryKey(goodsClass.getPid()); - if(goodsC!=null){ - goodsClass.setPname(goodsC.getName()); - } - } - return goodsClass; - } - - @Override - public int deleteById(String id) { - return goodsClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GoodsClass goodsClass) { - return goodsClassDao.insert(goodsClass); - } - - @Override - public int update(GoodsClass goodsClass) { - return goodsClassDao.updateByPrimaryKeySelective(goodsClass); - } - - @Override - public List selectListByWhere(String wherestr) { - GoodsClass goodsClass = new GoodsClass(); - goodsClass.setWhere(wherestr); - List list = goodsClassDao.selectListByWhere(goodsClass); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - GoodsClass goodsClass = new GoodsClass(); - goodsClass.setWhere(wherestr); - return goodsClassDao.deleteByWhere(goodsClass); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - String text =""; - if(list_result == null ) { - list_result = new ArrayList>(); - for(GoodsClass k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - if(k.getGoodsClassCode()!=null && !"".equals(k.getGoodsClassCode())){ - text = k.getName()+"("+k.getGoodsClassCode()+")"; - }else{ - text = k.getName(); - } - map.put("text", text); - map.put("pid", k.getPid()); - map.put("code", k.getGoodsClassCode()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(GoodsClass k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - if(k.getGoodsClassCode()!=null && !"".equals(k.getGoodsClassCode())){ - text = k.getName()+"("+k.getGoodsClassCode()+")"; - }else{ - text = k.getName(); - } - m.put("text", text); - m.put("pid", k.getPid()); - m.put("code", k.getGoodsClassCode()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - /** - * 获取所有子节点id - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getChildrenID(String ids,List list) { - if(ids == null && ids.equals("") ) { - for(GoodsClass k: list) { - if( "-1".equals(k.getPid()) ) { - ids += k.getId().toString()+","; - } - } - getChildrenID(ids,list); - - }else{ - String[] idsAll = ids.split(","); - for(String id:idsAll) { - String childIds = ""; - for(GoodsClass k:list) { - String pid = k.getPid()+""; - if(id.equals(pid)) { - childIds += k.getId().toString()+","; - } - } - if(childIds!=null && !childIds.equals("")) { - ids += childIds; - getChildrenID(childIds,list); - } - } - } - return ids; - } - - /** - * 获取所有父节点code - */ - public ArrayList getPCode(GoodsClass goodsClass) { - ArrayList items = new ArrayList<>(); - items.add(goodsClass); - if (!"-1".equals(goodsClass.getPid())) { - GoodsClass goodsClass1 = selectById(goodsClass.getPid()); - items.add(goodsClass1); - getPCode(goodsClass1); - } - return items; - } - -} diff --git a/src/com/sipai/service/sparepart/GoodsReserveService.java b/src/com/sipai/service/sparepart/GoodsReserveService.java deleted file mode 100644 index 9d4ea573..00000000 --- a/src/com/sipai/service/sparepart/GoodsReserveService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.sparepart; - - -import com.sipai.dao.sparepart.GoodsReserveDao; -import com.sipai.entity.sparepart.GoodsReserve; -import com.sipai.service.company.CompanyService; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class GoodsReserveService implements CommService{ - @Resource - private GoodsReserveDao goodsReserveDao; - @Resource - CompanyService companyService; - - @Override - public GoodsReserve selectById(String id) { - GoodsReserve goodsReserve = goodsReserveDao.selectByPrimaryKey(id); - return goodsReserve; - } - - @Override - public int deleteById(String id) { - return goodsReserveDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GoodsReserve goodsReserve) { - return goodsReserveDao.insert(goodsReserve); - } - - @Override - public int update(GoodsReserve goodsReserve) { - return goodsReserveDao.updateByPrimaryKeySelective(goodsReserve); - } - - @Override - public List selectListByWhere(String wherestr) { - GoodsReserve goodsReserve = new GoodsReserve(); - goodsReserve.setWhere(wherestr); - List list = goodsReserveDao.selectListByWhere(goodsReserve); - for (GoodsReserve data : list) { - if (StringUtils.isNotBlank(data.getBizId())) { - data.setCompany(companyService.selectByPrimaryKey(data.getBizId())); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - GoodsReserve goodsApply = new GoodsReserve(); - goodsApply.setWhere(wherestr); - return goodsReserveDao.deleteByWhere(goodsApply); - } -} diff --git a/src/com/sipai/service/sparepart/GoodsService.java b/src/com/sipai/service/sparepart/GoodsService.java deleted file mode 100644 index 8f48fb75..00000000 --- a/src/com/sipai/service/sparepart/GoodsService.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.GoodsDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.GoodsClass; - -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.tools.CommService; - -@Service -public class GoodsService implements CommService{ - @Resource - private GoodsDao goodsDao; - @Resource - private GoodsClassService goodsClassService; - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public Goods selectById(String id) { - Goods goods = goodsDao.selectByPrimaryKey(id); - if (null != goods) { - if (null != goods.getClassId() && !goods.getClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(goods.getClassId()); - goods.setGoodsClass(goodsClass); - } - if (null != goods.getEquipmentIds() && !goods.getEquipmentIds().isEmpty()) { - String equipmentNames = this.getEquipmentNamesByIds(goods.getEquipmentIds()); - goods.setEquipmentNames(equipmentNames); - } - } - return goods; - } - - @Override - public int deleteById(String id) { - return goodsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Goods goods) { - return goodsDao.insert(goods); - } - - @Override - public int update(Goods goods) { - return goodsDao.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - Goods goods = new Goods(); - goods.setWhere(wherestr); - List list = goodsDao.selectListByWhere(goods); - for (Goods item : list) { - if (item.getClassId() != null && !item.getClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(item.getClassId()); - item.setGoodsClass(goodsClass); - } - if (item.getEquipmentIds() != null && !item.getEquipmentIds().isEmpty()) { - String equipmentNames = this.getEquipmentNamesByIds(item.getEquipmentIds()); - item.setEquipmentNames(equipmentNames); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Goods goods = new Goods(); - goods.setWhere(wherestr); - return goodsDao.deleteByWhere(goods); - } - /** - * 把多个设备的id转换为名称 - * @param equipmentIds - * @return - */ - public String getEquipmentNamesByIds(String equipmentIds){ - equipmentIds = equipmentIds.replace("," , "','"); - String equipmentNames = ""; - ListequipmentCards = this.equipmentCardService.selectListByWhere("where id in ('"+equipmentIds+"')"); - for (EquipmentCard item : equipmentCards) { - if (equipmentNames!= "") { - equipmentNames+=","; - } - equipmentNames+=item.getEquipmentname(); - } - return equipmentNames; - } - public List selectGoodsSelaNotCheck(String year, String month, String wherestr,String biz) { - return goodsDao.selectGoodsSelaNotCheck(year,month, wherestr,biz); - } - public List selectGoodsSela(String year, String month, String wherestr,String biz) { - return goodsDao.selectGoodsSela(year,month, wherestr,biz); - } - public List selectListByWhere4DistinctName(String wherestr) { - Goods goods = new Goods(); - goods.setWhere(wherestr); - List list = goodsDao.selectListByWhere4DistinctName(goods); - return list; - } - -} diff --git a/src/com/sipai/service/sparepart/HazardousChemicalsService.java b/src/com/sipai/service/sparepart/HazardousChemicalsService.java deleted file mode 100644 index b0e6e1ae..00000000 --- a/src/com/sipai/service/sparepart/HazardousChemicalsService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.sipai.service.sparepart; - -import com.sipai.entity.sparepart.HazardousChemicals; - -public interface HazardousChemicalsService { - - public abstract HazardousChemicals selectById(String t); - - public abstract HazardousChemicals selectSimpleById(String t); - - public int deleteById(String t); - - public int save(HazardousChemicals t); - - public int update(HazardousChemicals t); - -} diff --git a/src/com/sipai/service/sparepart/InOutDeatilService.java b/src/com/sipai/service/sparepart/InOutDeatilService.java deleted file mode 100644 index 698c0371..00000000 --- a/src/com/sipai/service/sparepart/InOutDeatilService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sipai.service.sparepart; - -import com.sipai.dao.sparepart.InOutDeatilDao; -import com.sipai.dao.sparepart.ScoreDao; -import com.sipai.entity.sparepart.InOutDeatil; -import com.sipai.entity.sparepart.Score; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class InOutDeatilService implements CommService{ - @Resource - private InOutDeatilDao inOutDeatilDao; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - - @Override - public InOutDeatil selectById(String id) { - InOutDeatil inOutDeatil = inOutDeatilDao.selectByPrimaryKey(id); - - return inOutDeatil; - } - - @Override - public int deleteById(String id) { - return inOutDeatilDao.deleteByPrimaryKey(id); - } - - @Override - public int save(InOutDeatil inOutDeatil) { - return inOutDeatilDao.insert(inOutDeatil); - } - - @Override - public int update(InOutDeatil inOutDeatil) { - return inOutDeatilDao.updateByPrimaryKeySelective(inOutDeatil); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - InOutDeatil inOutDeatil = new InOutDeatil(); - inOutDeatil.setWhere(wherestr); - List list = inOutDeatilDao.selectListByWhere(inOutDeatil); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - InOutDeatil inOutDeatil = new InOutDeatil(); - inOutDeatil.setWhere(wherestr); - return inOutDeatilDao.deleteByWhere(inOutDeatil); - } - - -} diff --git a/src/com/sipai/service/sparepart/InStockRecordDetailService.java b/src/com/sipai/service/sparepart/InStockRecordDetailService.java deleted file mode 100644 index 253af492..00000000 --- a/src/com/sipai/service/sparepart/InStockRecordDetailService.java +++ /dev/null @@ -1,244 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.sparepart.*; -import org.apache.commons.lang3.StringUtils; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.InStockRecordDetailDao; -import com.sipai.dao.sparepart.WarehouseDao; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class InStockRecordDetailService implements CommService{ - @Resource - private InStockRecordDetailDao inStockRecordDetailDao; - @Resource - private UnitService unitService; - @Resource - private GoodsService goodsService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private StockService stockService; - - @Override - public InStockRecordDetail selectById(String id) { - InStockRecordDetail inStockRecordDetail = inStockRecordDetailDao.selectByPrimaryKey(id); - if (inStockRecordDetail.getGoodsId() != null && !inStockRecordDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(inStockRecordDetail.getGoodsId()); - inStockRecordDetail.setGoods(goods); - } - if (inStockRecordDetail.getDeptId() != null && !inStockRecordDetail.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(inStockRecordDetail.getDeptId()); - inStockRecordDetail.setDept(dept); - } - return inStockRecordDetail; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - InStockRecordDetail inStockRecordDetail = this.selectById(id); - int result = this.inStockRecordDetailDao.deleteByPrimaryKey(id); - //删除入库记录明细时更新入库记录单总金额 - if (inStockRecordDetail.getInstockRecordId() != null && !inStockRecordDetail.getInstockRecordId().isEmpty()) { - InStockRecord inStockRecord = this.inStockRecordService.selectById(inStockRecordDetail.getInstockRecordId()); - this.inStockRecordService.update(inStockRecord); - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(InStockRecordDetail inStockRecordDetail) { - inStockRecordDetail = this.updateTotalMoney(inStockRecordDetail); - if (inStockRecordDetail.getInstockRecordId() != null && !inStockRecordDetail.getInstockRecordId().isEmpty()) { - List inStockRecords = this.inStockRecordService.selectListByWhere("where id = '"+inStockRecordDetail.getInstockRecordId()+"'"); - if (inStockRecords!=null && inStockRecords.size()>0) { - InStockRecord inStockRecord = inStockRecords.get(0); - this.inStockRecordService.update(inStockRecord); - } - } - return inStockRecordDetailDao.insert(inStockRecordDetail); - } - - @Override - public int update(InStockRecordDetail inStockRecordDetail) { - inStockRecordDetail = this.updateTotalMoney(inStockRecordDetail); - int i = inStockRecordDetailDao.updateByPrimaryKeySelective(inStockRecordDetail); - InStockRecord inStockRecord = inStockRecordService.selectById(inStockRecordDetail.getInstockRecordId()); - // 流程中修改平均库的税率或价格 - if ("2".equals(inStockRecord.getStatus()) && inStockRecord.getWarehouse().getOutboundType() == SparePartCommString.W_AVG) { - inStockRecordService.update_ITPM(inStockRecord, inStockRecordDetail); - } - return i; - } - public int update_total(InStockRecordDetail inStockRecordDetail) { - return inStockRecordDetailDao.updateByPrimaryKeySelective(inStockRecordDetail); - } - public int updateInStockDetail_ITP_total(InStockRecordDetail inStockRecordDetail) { - inStockRecordDetail = this.updateInStockDetail_ITP(inStockRecordDetail); - return inStockRecordDetailDao.updateByPrimaryKeySelective(inStockRecordDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setWhere(wherestr); - List inStockRecordDetails = inStockRecordDetailDao.selectListByWhere(inStockRecordDetail); - if (inStockRecordDetails != null && inStockRecordDetails.size()>0) { - for (InStockRecordDetail item : inStockRecordDetails) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - } - - } - return inStockRecordDetails; - } - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setWhere(wherestr); - ListinStockRecordDetails = this.selectListByWhere(wherestr); - int result = this.inStockRecordDetailDao.deleteByWhere(inStockRecordDetail); - //删除入库记录明细时更新入库记录单总金额 - if (inStockRecordDetails!= null && inStockRecordDetails.size()>0) { - if (inStockRecordDetails.get(0).getInstockRecordId() != null && !inStockRecordDetails.get(0).getInstockRecordId().isEmpty()) { - InStockRecord inStockRecord = this.inStockRecordService.selectById(inStockRecordDetails.get(0).getInstockRecordId()); - this.inStockRecordService.update(inStockRecord); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 入库明细保存时,更新每条明细的合计金额,更新入库单的总金额 通过含税单价算出不含税单价及合计 - */ - public InStockRecordDetail updateTotalMoney(InStockRecordDetail inStockRecordDetail) { - // 合计 - BigDecimal totalMoney = inStockRecordDetail.getTotalMoney(); - // 含税合计 - BigDecimal includeTaxrateTotalMoney = inStockRecordDetail.getIncludeTaxrateTotalMoney(); - // 不含税单价 - BigDecimal price = inStockRecordDetail.getPrice(); - // 数量不为空 - - InStockRecord inStockRecord = inStockRecordService.selectById(inStockRecordDetail.getInstockRecordId()); - if (inStockRecord != null) { - if (null != inStockRecordDetail.getInstockNumber()) { - if (StringUtils.isNotBlank(inStockRecordDetail.getInstockRecordId())) { - if (inStockRecordDetail.getTaxrate() != null) { - inStockRecord.setTaxrate(inStockRecordDetail.getTaxrate()); - } - // 单价不为空 - if (null != inStockRecordDetail.getPrice()) { - // 是专票 - if ((inStockRecord.getVatInvoice() != null && inStockRecord.getVatInvoice() == 1) || (inStockRecordDetail.getV() != null && 1 == inStockRecordDetail.getV())) { - BigDecimal oNum = new BigDecimal(1); - BigDecimal sum = oNum.add(inStockRecord.getTaxrate().divide(new BigDecimal(100))); - System.out.println(sum.toString()); - // 算不含税单价 - if (inStockRecordDetail.getIncludeTaxratePrice() != null) { - price = (inStockRecordDetail.getIncludeTaxratePrice()).divide(sum, 5, RoundingMode.HALF_UP); - inStockRecordDetail.setPrice(price); - } - } else { - if (inStockRecordDetail.getIncludeTaxratePrice() == null) { - inStockRecordDetail.setPrice(new BigDecimal("0")); - } else { - inStockRecordDetail.setPrice(inStockRecordDetail.getIncludeTaxratePrice()); - } - } - totalMoney = (inStockRecordDetail.getInstockNumber()).multiply(inStockRecordDetail.getPrice()); - } - - // 含税单价不为空 - if (null != inStockRecordDetail.getIncludeTaxratePrice()) { - includeTaxrateTotalMoney = (inStockRecordDetail.getInstockNumber()).multiply(inStockRecordDetail.getIncludeTaxratePrice()); - } - inStockRecordService.onlyUpdate(inStockRecord); - } - } - inStockRecordDetail.setTotalMoney(totalMoney); - inStockRecordDetail.setIncludeTaxrateTotalMoney(includeTaxrateTotalMoney); - // 单价不为空 -// if (null != inStockRecordDetail.getPrice()) { -// totalMoney = (inStockRecordDetail.getInstockNumber()).multiply(inStockRecordDetail.getPrice()); -// } - // 含税单价不为空 -// if (null != inStockRecordDetail.getIncludeTaxratePrice()) { -// includeTaxrateTotalMoney = (inStockRecordDetail.getInstockNumber()).multiply(inStockRecordDetail.getIncludeTaxratePrice()); -// } - } - return inStockRecordDetail; - } - /** - * 入库明细保存时,更新每条明细的合计金额,更新入库单的总金额 通过不含税单价算出含税单价及合计 - */ - public InStockRecordDetail updateInStockDetail_ITP(InStockRecordDetail inStockRecordDetail) { - // 合计 - BigDecimal totalMoney = inStockRecordDetail.getTotalMoney(); - // 含税合计 - BigDecimal includeTaxrateTotalMoney = inStockRecordDetail.getIncludeTaxrateTotalMoney(); - // 含税单价 - BigDecimal includeTaxratePrice = inStockRecordDetail.getIncludeTaxratePrice(); - // 数量不为空 - if (null != inStockRecordDetail.getInstockNumber()) { - if (StringUtils.isNotBlank(inStockRecordDetail.getInstockRecordId())) { - InStockRecord inStockRecord = inStockRecordService.selectById(inStockRecordDetail.getInstockRecordId()); - // 单价不为空 - if (null != inStockRecordDetail.getPrice()) { - totalMoney = (inStockRecordDetail.getInstockNumber()).multiply(inStockRecordDetail.getPrice()); - } -// if ("2".equals(inStockRecord.getStatus())) { -// // 此处拿的是库里面的不是前端传过来算好的 -// InStockRecordDetail inStockRecordDetail1 = selectById(inStockRecordDetail.getId()); -// inStockRecordService.update_ITPM(inStockRecord, inStockRecordDetail); -// } - } - } - - inStockRecordDetail.setTotalMoney(totalMoney); - return inStockRecordDetail; - } - - public List selectListByWhereWithRecord(String where) { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setWhere(where); - return inStockRecordDetailDao.selectListByWhereWithRecord(inStockRecordDetail); - } - public InStockRecordDetail selectTopByWhereWithRecord(String where) { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setWhere(where); - return inStockRecordDetailDao.selectTopByWhereWithRecord(inStockRecordDetail); - } -} diff --git a/src/com/sipai/service/sparepart/InStockRecordService.java b/src/com/sipai/service/sparepart/InStockRecordService.java deleted file mode 100644 index 2ef3dcfa..00000000 --- a/src/com/sipai/service/sparepart/InStockRecordService.java +++ /dev/null @@ -1,598 +0,0 @@ -package com.sipai.service.sparepart; - -import com.sipai.dao.sparepart.InStockRecordDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.ThreadPoolUpdateMoney; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadPoolExecutor; - -@Service -@Transactional -public class InStockRecordService implements CommService{ - @Resource - private InStockRecordDao inStockRecordDao; - @Resource - private GoodsClassService goodsClassService; - @Resource - private WarehouseService warehouseService; - @Resource - private SubscribeService subscribeService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private InOutDeatilService inOutDeatilService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private InStockRecordUpdateMoneyService inStockRecordUpdateMoneyService; - - @Override - public InStockRecord selectById(String id) { - InStockRecord inStockRecord = inStockRecordDao.selectByPrimaryKey(id); - if (inStockRecord != null) { - if (null != inStockRecord.getGoodsClassId() && !inStockRecord.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(inStockRecord.getGoodsClassId()); - inStockRecord.setGoodsClass(goodsClass); - } - if (null != inStockRecord.getWarehouseId() && !inStockRecord.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(inStockRecord.getWarehouseId()); - inStockRecord.setWarehouse(warehouse); - } - if (null != inStockRecord.getBizId() && !inStockRecord.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(inStockRecord.getBizId()); - inStockRecord.setCompany(company); - } - if (null != inStockRecord.getAuditManId() && !inStockRecord.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(inStockRecord.getAuditManId()); - inStockRecord.setAuditManName(auditManName); - } - if (null != inStockRecord.getInstockManId() && !inStockRecord.getInstockManId().isEmpty()) { - String instockManName = this.subscribeService.getUserNamesByUserIds(inStockRecord.getInstockManId()); - inStockRecord.setInstockManName(instockManName); - } - if (inStockRecord.getFareAdjustment() == 0) { - inStockRecord.setFareAdjustmentText("否"); - } else if (inStockRecord.getFareAdjustment() == 1) { - inStockRecord.setFareAdjustmentText("是"); - } - } - return inStockRecord; - } - - /** - * 删除入库单时同时删除入库记录明细,关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - InStockRecord inStockRecord = this.selectById(id); - this.inStockRecordDetailService.deleteByWhere("where instock_record_id = '"+id+"'"); - String pInstancId = inStockRecord.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return inStockRecordDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(InStockRecord inStockRecord) { - return inStockRecordDao.insert(inStockRecord); - } - - @Override - public int update(InStockRecord inStockRecord) { - inStockRecord = this.updateTotalMoney(inStockRecord); - //审核通过的入库登记单,明细加到库存中 - if (SparePartCommString.STATUS_STOCK_FINISH.equals(inStockRecord.getStatus())) { - int result = this.putInStock(inStockRecord.getId()); - if (result == 0 ) { - return result; - } - } - return inStockRecordDao.updateByPrimaryKeySelective(inStockRecord); - } - - public int onlyUpdate(InStockRecord inStockRecord) { - return inStockRecordDao.updateByPrimaryKeySelective(inStockRecord); - } - - public int updateByVat(InStockRecord inStockRecord) { - inStockRecord = this.updateTotalMoney(inStockRecord); - return inStockRecordDao.updateByPrimaryKeySelective(inStockRecord); - } - - @Override - public List selectListByWhere(String wherestr) { - InStockRecord inStockRecord = new InStockRecord(); - inStockRecord.setWhere(wherestr); - List inStockRecords = inStockRecordDao.selectListByWhere(inStockRecord); - for (InStockRecord item: inStockRecords) { - if (null != item.getGoodsClassId() && !item.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(item.getGoodsClassId()); - item.setGoodsClass(goodsClass); - } - if (null != item.getBizId() && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (null != item.getWarehouseId() && !item.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(item.getWarehouseId()); - item.setWarehouse(warehouse); - } - if (null != item.getAuditManId()&& !item.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - if (null !=item.getInstockManId() && !item.getInstockManId().isEmpty()) { - String instockManName = this.subscribeService.getUserNamesByUserIds(item.getInstockManId()); - item.setInstockManName(instockManName); - } - } - return inStockRecords; - } - /** - * 删除入库单时同时删除入库记录明细,关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - InStockRecord inStockRecord = new InStockRecord(); - inStockRecord.setWhere(wherestr); - List inStockRecords = this.selectListByWhere(wherestr); - for (InStockRecord item : inStockRecords) { - this.inStockRecordDetailService.deleteByWhere("where instock_record_id = '"+item.getId()+"'"); - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return inStockRecordDao.deleteByWhere(inStockRecord); - } catch (Exception e) { - // TODO: handle exception -// throw new RuntimeException(); - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 更新入库记录的总价 - */ - public InStockRecord updateTotalMoney(InStockRecord inStockRecord) { - //在保存入库单时,将入库单明细的金额加起来,生成入库单的总金额 - BigDecimal totalMoney = new BigDecimal(0); - ListinStockRecordDetails = this.inStockRecordDetailService.selectListByWhere("where instock_record_id = '"+inStockRecord.getId()+"'"); - if (inStockRecordDetails!= null && inStockRecordDetails.size()>0) { - for (InStockRecordDetail item : inStockRecordDetails) { - if (item.getIncludeTaxrateTotalMoney() != null) { - totalMoney = totalMoney.add(item.getIncludeTaxrateTotalMoney()); - } - } - } - inStockRecord.setTotalMoney(totalMoney); - return inStockRecord; - } - /** - * 将审核完的入库登记单的明细物品放到库存中 - */ - public int putInStock (String inStockRecordId) { - int result = 0; - InStockRecord inStockRecord = this.inStockRecordDao.selectByPrimaryKey(inStockRecordId); - List recordDetails = this.inStockRecordDetailService.selectListByWhere("where instock_record_id = '"+inStockRecordId+"'"); - Warehouse warehouse = warehouseService.selectById(inStockRecord.getWarehouseId()); - if (recordDetails != null && recordDetails.size()>0) { - for (InStockRecordDetail detail : recordDetails) {//Stock的selectListByWhere方法不用加where,mapper里已经有了 - String where = "goods_id = '"+detail.getGoodsId()+"' and warehouse_id ='"+inStockRecord.getWarehouseId() + "'"; - // 先入先出 - if (warehouse.getOutboundType() == SparePartCommString.F_IN_OUT) { - where = "goods_id = '"+detail.getGoodsId()+"' and warehouse_id ='"+inStockRecord.getWarehouseId() + "' " + - "and included_tax_cost_price = " + detail.getIncludeTaxratePrice(); - } - List stocks = this.stockService.selectListByWhere(where); - //当同一个仓库中的库存中有相同的物品时,直接在物品上加数量和总价 - if (stocks !=null && stocks.size()>0) { - Stock stock = stocks.get(0); - BigDecimal stockNumber = stock.getNowNumber().add(detail.getInstockNumber()); - BigDecimal aNumber = stock.getAvailableNumber().add(detail.getInstockNumber()); - BigDecimal totalMoney = stock.getTotalMoney().add(detail.getTotalMoney()); - BigDecimal includedTaxCostPrice = stock.getIncludedTaxTotalMoney().add(detail.getIncludeTaxrateTotalMoney()); - stock.setNowNumber(stockNumber); - stock.setAvailableNumber(aNumber); - stock.setTotalMoney(totalMoney); - stock.setIncludedTaxTotalMoney(includedTaxCostPrice); - // 平均法 - if (warehouse.getOutboundType() == SparePartCommString.W_AVG) { - stock.setCostPrice(totalMoney.divide(stockNumber, 5, RoundingMode.HALF_DOWN)); - stock.setIncludedTaxCostPrice(includedTaxCostPrice.divide(stockNumber, 5, RoundingMode.HALF_DOWN)); - } - if (stock.getInNumber() == null) { - stock.setInNumber(detail.getInstockNumber()); - } else { - stock.setInNumber(stock.getInNumber().add(detail.getInstockNumber())); - } - stock = this.stockService.stockAlarm(stock); - result += this.stockService.update(stock); - //当库存中没有此类物品时,直接导入物品数据 - }else { - Stock stock = new Stock(); - stock.setId(CommUtil.getUUID()); - stock.setInsdt(CommUtil.nowDate()); - stock.setInsuser(detail.getInsuser()); - stock.setBizId(inStockRecord.getBizId()); - stock.setGoodsId(detail.getGoodsId()); - stock.setGoods(detail.getGoods()); - stock.setWarehouseId(inStockRecord.getWarehouseId()); - stock.setNowNumber(detail.getInstockNumber()); - stock.setAvailableNumber(detail.getInstockNumber()); - stock.setInitNumber(detail.getInstockNumber()); - // 平均法 - if (warehouse.getOutboundType() == SparePartCommString.W_AVG) { - stock.setCostPrice(detail.getTotalMoney().divide(detail.getInstockNumber(), 5, RoundingMode.HALF_DOWN)); - stock.setIncludedTaxCostPrice(detail.getIncludeTaxrateTotalMoney().divide(detail.getInstockNumber(), 5, RoundingMode.HALF_DOWN)); - } else { - stock.setCostPrice(detail.getPrice()); - stock.setIncludedTaxCostPrice(detail.getIncludeTaxratePrice()); - } - stock.setTotalMoney(detail.getTotalMoney()); - stock.setIncludedTaxTotalMoney(detail.getIncludeTaxrateTotalMoney()); - if (stock.getInNumber() == null) { - stock.setInNumber(detail.getInstockNumber()); - } else { - stock.setInNumber(stock.getInNumber().add(detail.getInstockNumber())); - } - stock = this.stockService.stockAlarm(stock); - result += this.stockService.save(stock); - } - detail.setNowNumber(detail.getInstockNumber()); - // 此为普通更新方法 - inStockRecordDetailService.update_total(detail); - } - } - return result; - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - InStockRecord inStockRecord = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(inStockRecord.getProcessid()).list(); - if (task!=null && task.size()>0) { - inStockRecord.setStatus(task.get(0).getName()); - }else{ - inStockRecord.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - } - int res =this.update(inStockRecord); - return res; - } - /** - * 启动入库审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(InStockRecord inStockRecord) { - try { - Map variables = new HashMap(); - if(!inStockRecord.getAuditManId().isEmpty()){ - variables.put("userIds", inStockRecord.getAuditManId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.I_Stock.getId()+"-"+inStockRecord.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(inStockRecord.getId(), inStockRecord.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - inStockRecord.setProcessid(processInstance.getId()); - inStockRecord.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(inStockRecord); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(inStockRecord); - businessUnitRecord.sendMessage(inStockRecord.getAuditManId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 入库审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public com.alibaba.fastjson.JSONArray selectStockDetailByGoosId(String whereStr, Stock stock, Warehouse warehouse) { - List inStockRecordDetails = inStockRecordDetailService.selectListByWhere(whereStr); - com.alibaba.fastjson.JSONArray inResult = new com.alibaba.fastjson.JSONArray(); - com.alibaba.fastjson.JSONArray outResult = new com.alibaba.fastjson.JSONArray(); - for (InStockRecordDetail inStockRecordDetail : inStockRecordDetails) { - if (StringUtils.isNotBlank(inStockRecordDetail.getInstockRecordId())) { - List inStockRecords = selectListByWhere("where status = '2' and id = '" + inStockRecordDetail.getInstockRecordId() + "' and warehouse_id = '" + warehouse.getId() + "'"); - if (inStockRecords != null && inStockRecords.size() > 0) { - InStockRecord inStockRecord = inStockRecords.get(0); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - if (StringUtils.isNotBlank(inStockRecordDetail.getInsuser())) { - User user = userService.getUserById(inStockRecordDetail.getInsuser()); - jsonObject.put("user", user.getCaption()); // 出入库 - } - jsonObject.put("type", "入库"); // 出入库 - jsonObject.put("id", inStockRecord.getId()); // 单据编号 - jsonObject.put("insdt", inStockRecordDetail.getInsdt()); // 日期 - jsonObject.put("number", inStockRecordDetail.getInstockNumber()); // 数量 - jsonObject.put("price", inStockRecordDetail.getPrice()); // 不含税单价 - jsonObject.put("totalMoney", inStockRecordDetail.getPrice().multiply(inStockRecordDetail.getInstockNumber())); // 不含税合计 - jsonObject.put("tPrice", inStockRecordDetail.getIncludeTaxratePrice()); // 含税单价 - jsonObject.put("tTotalMoney", inStockRecordDetail.getIncludeTaxratePrice().multiply(inStockRecordDetail.getInstockNumber())); // 含税合计 - inResult.add(jsonObject); - } - } - if (warehouse.getOutboundType() == SparePartCommString.F_IN_OUT) { - List inOutDeatils = inOutDeatilService.selectListByWhere("where inId = '" + inStockRecordDetail.getId() + "' order by insdt desc"); - for (InOutDeatil inOutDeatil : inOutDeatils) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - OutStockRecordDetail outStockRecordDetail = outStockRecordDetailService.selectById(inOutDeatil.getOutid()); - - List outStockRecords = outStockRecordService.selectListByWhere("where status = '2' and id = '" + outStockRecordDetail.getOutstockRecordId() + "' and warehouse_id = '" + warehouse.getId() + "'"); - if (outStockRecords != null && outStockRecords.size() > 0) { - OutStockRecord outStockRecord = outStockRecords.get(0); - if (StringUtils.isNotBlank(inStockRecordDetail.getInsuser())) { - User user = userService.getUserById(inStockRecordDetail.getInsuser()); - jsonObject.put("user", user.getCaption()); // 出入库 - } - jsonObject.put("type", "出库"); // 出入库 - jsonObject.put("id", outStockRecord.getId()); // 单据编号 - jsonObject.put("insdt", outStockRecordDetail.getInsdt()); // 日期 - jsonObject.put("number", inOutDeatil.getNum()); // 数量 - jsonObject.put("price", inStockRecordDetail.getPrice()); // 不含税单价 - jsonObject.put("totalMoney", inStockRecordDetail.getPrice().multiply(inOutDeatil.getNum())); // 不含税合计 - jsonObject.put("tPrice", inStockRecordDetail.getIncludeTaxratePrice()); // 含税单价 - jsonObject.put("tTotalMoney", inStockRecordDetail.getIncludeTaxratePrice().multiply(inOutDeatil.getNum())); // 含税单价 - outResult.add(jsonObject); - } - } - } - } - if (warehouse.getOutboundType() == SparePartCommString.W_AVG) { - List outStockRecordDetails = outStockRecordDetailService.selectListByWhere(whereStr); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - List outStockRecords = outStockRecordService.selectListByWhere("where status = '2' and id = '" + outStockRecordDetail.getOutstockRecordId() + "' and warehouse_id = '" + warehouse.getId() + "'"); - if (outStockRecords != null && outStockRecords.size() > 0) { - OutStockRecord outStockRecord = outStockRecords.get(0); - if (StringUtils.isNotBlank(outStockRecordDetail.getInsuser())) { - User user = userService.getUserById(outStockRecordDetail.getInsuser()); - jsonObject.put("user", user.getCaption()); // 出入库 - } - jsonObject.put("type", "出库"); // 出入库 - jsonObject.put("id", outStockRecord.getId()); // 单据编号 - jsonObject.put("insdt", outStockRecordDetail.getInsdt()); // 日期 - jsonObject.put("number", outStockRecordDetail.getOutNumber()); // 数量 - jsonObject.put("price", outStockRecordDetail.getPrice()); // 不含税单价 - jsonObject.put("totalMoney", outStockRecordDetail.getTotalMoney()); // 不含税合计 - jsonObject.put("tPrice", outStockRecordDetail.getIncludedTaxCostPrice()); // 含税单价 - jsonObject.put("tTotalMoney", outStockRecordDetail.getIncludedTaxTotalMoney()); // 含税单价 - outResult.add(jsonObject); - } - } - } - inResult.addAll(outResult); - return inResult; - } - - - /** - * 更改出库及库存不含税单价 - */ -// @Async - public int update_ITPM(InStockRecord inStockRecord, InStockRecordDetail inStockRecordDetail) { - Warehouse warehouse = warehouseService.selectById(inStockRecord.getWarehouseId()); - // 平均库进行计算 - if (SparePartCommString.W_AVG == warehouse.getOutboundType()) { - List stocks = stockService.selectListByWhere(" warehouse_id = '" + inStockRecord.getWarehouseId() + - "' and goods_id = '" + inStockRecordDetail.getGoodsId() + "'"); - if (stocks != null && stocks.size() > 0) { - Stock stock = stocks.get(0); - //当前循环中入库单的不含税总价 - BigDecimal nowTotalMoney = new BigDecimal("0"); - //当前循环中入库单的总计数量 - BigDecimal totalNum = new BigDecimal("0"); - // 区间之前时间 - String beforeTime = inStockRecordDetail.getInsdt(); - // 区间之后时间 - String afterTime = ""; - // 拿取所有这个入库单日期之前的入库单重新加上不含税合计 - List inStockRecordDetailBefores = inStockRecordDetailService.selectListByWhereWithRecord("where " + - "tsd.goods_id = '" + inStockRecordDetail.getGoodsId() + "' and tsi.warehouse_id = '" + stock.getWarehouseId() + - "' and tsi.status = '2' and tsd.insdt <= '" + inStockRecordDetail.getInsdt() + "'"); - for (InStockRecordDetail inStockRecordDetailBefore : inStockRecordDetailBefores) { - nowTotalMoney = nowTotalMoney.add(inStockRecordDetailBefore.getTotalMoney()); - totalNum = totalNum.add(inStockRecordDetailBefore.getInstockNumber()); - } - - // 拿取所有这个入库单日期之前的入库单重新加上不含税合计 - List inStockRecordDetailAfters = inStockRecordDetailService.selectListByWhereWithRecord("where " + - "tsd.goods_id = '" + inStockRecordDetail.getGoodsId() + "' and tsi.warehouse_id = '" + stock.getWarehouseId() + - "' and tsi.status = '2' and tsd.insdt > '" + inStockRecordDetail.getInsdt() + "'"); - // 如果之后没有单子那就直接查出库单 - for (InStockRecordDetail inStockRecordDetailAfter : inStockRecordDetailAfters) { - // 更新之后时间为当前单子时间时间 - afterTime = inStockRecordDetailAfter.getInsdt(); - // 审核完成的且日期大于更改税率后的入库单的时间的且同仓库的相同物品 - List outStockRecordDetails = outStockRecordDetailService.selectListByWhereWithRecord("where tso.status = '2' " + - "and tsod.goods_id = '" + stock.getGoodsId() + "' and tso.warehouse_id = '" + stock.getWarehouseId() + "' " + - "and tsod.insdt > '" + beforeTime + "' and tsod.insdt < '" + afterTime + "'"); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - outStockRecordDetail.setPrice(nowTotalMoney.divide(totalNum, 4)); - outStockRecordDetail.setTotalMoney(outStockRecordDetail.getPrice().multiply(outStockRecordDetail.getOutNumber())); - outStockRecordDetailService.update(outStockRecordDetail); - } - // 更新之前时间为已处理完时间 - beforeTime = inStockRecordDetailAfter.getInsdt(); - nowTotalMoney = nowTotalMoney.add(inStockRecordDetailAfter.getTotalMoney()); - totalNum = totalNum.add(inStockRecordDetailAfter.getInstockNumber()); - } - - // 审核完成的且日期大于最后一次入库单的更新掉 - List outStockRecordDetails = outStockRecordDetailService.selectListByWhereWithRecord("where tso.status = '2' " + - "and tsod.goods_id = '" + stock.getGoodsId() + "' and tso.warehouse_id = '" + stock.getWarehouseId() + "' " + - "and tsod.insdt >= '" + beforeTime + "'"); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - outStockRecordDetail.setPrice(nowTotalMoney.divide(totalNum, 4)); - outStockRecordDetail.setTotalMoney(outStockRecordDetail.getPrice().multiply(outStockRecordDetail.getOutNumber())); - outStockRecordDetailService.update(outStockRecordDetail); - } - - // 所有完成后更新库存 - stock.setCostPrice(nowTotalMoney.divide(totalNum, 4)); - stock.setTotalMoney(stock.getCostPrice().multiply(stock.getNowNumber())); - return stockService.update(stock); - } - return 0; - } - return 0; - } - - - public String doBusiness(String id) { - InStockRecordUpdateMoney inStockRecordUpdateMoney = new InStockRecordUpdateMoney(); - inStockRecordUpdateMoney.setId(CommUtil.getUUID()); - inStockRecordUpdateMoney.setStatus(2); - inStockRecordUpdateMoney.setInDetailId(id); - inStockRecordUpdateMoney.setInsdt(CommUtil.nowDate()); - inStockRecordUpdateMoneyService.save(inStockRecordUpdateMoney); - // 执行业务耗时 10s - try { - // 获取当前线程池 - ExecutorService executor = ThreadPoolUpdateMoney.getExecutor(); - Map startMap = ThreadPoolUpdateMoney.getStartMap(); - if (executor == null){ - ThreadPoolUpdateMoney threadPoolUpdateMoney = new ThreadPoolUpdateMoney(); - threadPoolUpdateMoney.start(); - } - // 运行中则将收到的参数加入队列中 - else { - // 关机状态 - if (executor.isShutdown()) { - ThreadPoolUpdateMoney threadPoolUpdateMoney = new ThreadPoolUpdateMoney(); - threadPoolUpdateMoney.start(); - } - // 没关机 - else { - // 等等 - startMap.put(inStockRecordUpdateMoney.getId(), inStockRecordUpdateMoney.getInDetailId()); - executor.execute(new ThreadPoolUpdateMoney.InStockUpdateMoney(inStockRecordUpdateMoney.getId() + "," + inStockRecordUpdateMoney.getInDetailId())); - } - } -// int activeCount = ((ThreadPoolExecutor)executor).getActiveCount(); -// System.out.println("加入线程后总线程数 : " + activeCount); - } catch (Exception e) { - e.printStackTrace(); - } - return UUID.randomUUID().toString(); - } - - /** - * 任务流转,入库业务处理完后提交审核 - * @param inStockRecord - * @return - */ - /*@Transactional - public int doInStockHandle(InStockRecord inStockRecord) { - try { - Map variables = new HashMap(); - variables.put(CommString.ACTI_KEK_Candidate_Users, inStockRecord.getAuditManId()); - variables.put(CommString.ACTI_KEK_Assignee, null); - List tasks =taskService.createTaskQuery().processInstanceId(inStockRecord.getProcessid()).orderByTaskCreateTime().desc().list(); - taskService.complete(tasks.get(0).getId(), variables); - int res=this.update(inStockRecord); - inStockRecord = this.selectById(inStockRecord.getId()); - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(inStockRecord); - businessUnitRecord.sendMessage(inStockRecord.getAuditManId(),""); - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - }*/ - -} diff --git a/src/com/sipai/service/sparepart/InStockRecordUpdateMoneyService.java b/src/com/sipai/service/sparepart/InStockRecordUpdateMoneyService.java deleted file mode 100644 index ebaa4df2..00000000 --- a/src/com/sipai/service/sparepart/InStockRecordUpdateMoneyService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.sparepart; - -import com.sipai.dao.sparepart.InStockRecordUpdateMoneyDao; -import com.sipai.entity.sparepart.InStockRecordUpdateMoney; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class InStockRecordUpdateMoneyService implements CommService{ - @Resource - private InStockRecordUpdateMoneyDao inStockRecordUpdateMoneyDao; - - @Override - public InStockRecordUpdateMoney selectById(String id) { - InStockRecordUpdateMoney inStockRecordUpdateMoney = inStockRecordUpdateMoneyDao.selectByPrimaryKey(id); - return inStockRecordUpdateMoney; - } - - @Override - public int deleteById(String id) { - return inStockRecordUpdateMoneyDao.deleteByPrimaryKey(id); - } - - @Override - public int save(InStockRecordUpdateMoney inStockRecordUpdateMoney) { - return inStockRecordUpdateMoneyDao.insert(inStockRecordUpdateMoney); - } - - @Override - public int update(InStockRecordUpdateMoney inStockRecordUpdateMoney) { - return inStockRecordUpdateMoneyDao.updateByPrimaryKeySelective(inStockRecordUpdateMoney); - } - - @Override - public List selectListByWhere(String wherestr) { - InStockRecordUpdateMoney inStockRecordUpdateMoney = new InStockRecordUpdateMoney(); - inStockRecordUpdateMoney.setWhere(wherestr); - List inStockRecordUpdateMonies = inStockRecordUpdateMoneyDao.selectListByWhere(inStockRecordUpdateMoney); - return inStockRecordUpdateMonies; - } - @Override - public int deleteByWhere(String wherestr) { - InStockRecordUpdateMoney inStockRecordUpdateMoney = new InStockRecordUpdateMoney(); - inStockRecordUpdateMoney.setWhere(wherestr); - return inStockRecordUpdateMoneyDao.deleteByWhere(inStockRecordUpdateMoney); - } -} diff --git a/src/com/sipai/service/sparepart/OutStockRecordDetailService.java b/src/com/sipai/service/sparepart/OutStockRecordDetailService.java deleted file mode 100644 index 7989b63d..00000000 --- a/src/com/sipai/service/sparepart/OutStockRecordDetailService.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.InStockRecordDetailDao; -import com.sipai.dao.sparepart.OutStockRecordDetailDao; -import com.sipai.dao.sparepart.WarehouseDao; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.OutStockRecord; -import com.sipai.entity.sparepart.OutStockRecordDetail; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class OutStockRecordDetailService implements CommService{ - @Resource - private OutStockRecordDetailDao outStockRecordDetailDao; - @Resource - private UnitService unitService; - @Resource - private GoodsService goodsService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private StockService stockService; - - @Override - public OutStockRecordDetail selectById(String id) { - OutStockRecordDetail outStockRecordDetail = outStockRecordDetailDao.selectByPrimaryKey(id); - if (outStockRecordDetail.getGoodsId() != null && !outStockRecordDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(outStockRecordDetail.getGoodsId()); - outStockRecordDetail.setGoods(goods); - } - if (outStockRecordDetail.getDeptId() != null && !outStockRecordDetail.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(outStockRecordDetail.getDeptId()); - outStockRecordDetail.setDept(dept); - } - return outStockRecordDetail; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - OutStockRecordDetail outStockRecordDetail = this.selectById(id); - int result = this.outStockRecordDetailDao.deleteByPrimaryKey(id); - //删除出库记录明细时更新出库单总金额 - if (outStockRecordDetail.getOutstockRecordId() != null && !outStockRecordDetail.getOutstockRecordId().isEmpty()) { - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordDetail.getOutstockRecordId()); - this.outStockRecordService.update(outStockRecord); - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(OutStockRecordDetail outStockRecordDetail) { - return outStockRecordDetailDao.insert(outStockRecordDetail); - } - - @Override - public int update(OutStockRecordDetail outStockRecordDetail) { - return outStockRecordDetailDao.updateByPrimaryKeySelective(outStockRecordDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - OutStockRecordDetail outStockRecordDetail = new OutStockRecordDetail(); - outStockRecordDetail.setWhere(wherestr); - List outStockRecordDetails = outStockRecordDetailDao.selectListByWhere(outStockRecordDetail); - if (outStockRecordDetails != null && outStockRecordDetails.size()>0) { - for (OutStockRecordDetail item : outStockRecordDetails) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - } - - } - return outStockRecordDetails; - } - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - OutStockRecordDetail outStockRecordDetail = new OutStockRecordDetail(); - outStockRecordDetail.setWhere(wherestr); - ListoutStockRecordDetails = this.selectListByWhere(wherestr); - int result = this.outStockRecordDetailDao.deleteByWhere(outStockRecordDetail); - //删除出库记录明细时更新出库记录单总金额 - if (outStockRecordDetails!= null && outStockRecordDetails.size()>0) { - if (outStockRecordDetails.get(0).getOutstockRecordId() != null && !outStockRecordDetails.get(0).getOutstockRecordId().isEmpty()) { - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordDetails.get(0).getOutstockRecordId()); - this.outStockRecordService.update(outStockRecord); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 入库明细保存时,更新每条明细的合计金额,更新入库单的总金额 - *//* - public OutStockRecordDetail updateTotalMoney(OutStockRecordDetail outStockRecordDetail) { - BigDecimal totalMoney = outStockRecordDetail.getTotalMoney(); - if (null != outStockRecordDetail.getOutNumber() && null != outStockRecordDetail.getPrice()) { - totalMoney = (outStockRecordDetail.getOutNumber()).multiply(outStockRecordDetail.getPrice()); - }else { - totalMoney = new BigDecimal(0); - } - outStockRecordDetail.setTotalMoney(totalMoney); - return outStockRecordDetail; - }*/ - /** - * 入库明细更新时,更新每条明细的合计金额,更新入库单的总金额 - */ - @Transactional - public String updateTotalMoney(String id,String number ,String price) { - try { - OutStockRecordDetail outStockRecordDetail = this.selectById(id); - if (outStockRecordDetail.getStockId() != null && !outStockRecordDetail.getStockId().isEmpty()) { - Stock stock = this.stockService.selectById(outStockRecordDetail.getStockId()); - //可用数量 - BigDecimal usableNumber = stock.getAvailableNumber(); - if (null != number && !number.isEmpty()) { - BigDecimal numberBigDecimal = new BigDecimal(number); - if (usableNumber.compareTo(numberBigDecimal) == -1) {//可用数量小于使用数量 - return "库存数量不足,仅有"+usableNumber.setScale(2, BigDecimal.ROUND_HALF_UP).toString()+stock.getGoods().getUnit()+"可用,请重新输入"; - }else{ - outStockRecordDetail.setOutNumber(numberBigDecimal); - } - } - outStockRecordService.updateIODeatilByPrice(outStockRecordDetail.getOutNumber(), outStockRecordDetail.getIncludedTaxCostPrice(), outStockRecordDetail); - } - /*if (null != price && !price.isEmpty()) { - BigDecimal priceBigDecimal = new BigDecimal(price); - purchaseRecordDetail.setPrice(priceBigDecimal); - }*/ - BigDecimal totalMoney = outStockRecordDetail.getTotalMoney(); - totalMoney = (outStockRecordDetail.getOutNumber()).multiply(outStockRecordDetail.getPrice()); - outStockRecordDetail.setTotalMoney(totalMoney); - BigDecimal includedTaxTotalMoney = outStockRecordDetail.getIncludedTaxTotalMoney(); - includedTaxTotalMoney =(outStockRecordDetail.getIncludedTaxCostPrice()).multiply(outStockRecordDetail.getOutNumber()); - outStockRecordDetail.setIncludedTaxTotalMoney(includedTaxTotalMoney); - int result = this.update(outStockRecordDetail); - if (result == 1) { - if (outStockRecordDetail.getOutstockRecordId() != null && !outStockRecordDetail.getOutstockRecordId().isEmpty()) { - OutStockRecord outStockRecord = this.outStockRecordService.selectById(outStockRecordDetail.getOutstockRecordId()); - this.outStockRecordService.update(outStockRecord); - } - } - return Integer.toString(result); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - throw new RuntimeException(); - } - - } - - public List selectListByWhereWithRecord(String where) { - OutStockRecordDetail outStockRecordDetail = new OutStockRecordDetail(); - outStockRecordDetail.setWhere(where); - return outStockRecordDetailDao.selectListByWhereWithRecord(outStockRecordDetail); - } -} diff --git a/src/com/sipai/service/sparepart/OutStockRecordService.java b/src/com/sipai/service/sparepart/OutStockRecordService.java deleted file mode 100644 index cf183235..00000000 --- a/src/com/sipai/service/sparepart/OutStockRecordService.java +++ /dev/null @@ -1,724 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.sparepart.*; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.dao.sparepart.InStockRecordDao; -import com.sipai.dao.sparepart.OutStockRecordDao; -import com.sipai.dao.sparepart.WarehouseDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Service -public class OutStockRecordService implements CommService{ - @Resource - private OutStockRecordDao outStockRecordDao; - @Resource - private GoodsClassService goodsClassService; - @Resource - private WarehouseService warehouseService; - @Resource - private SubscribeService subscribeService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private StockService stockService; - @Resource - private UnitService unitService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UserService userService; - @Resource - private InOutDeatilService inOutDeatilService; - - @Override - public OutStockRecord selectById(String id) { - OutStockRecord outStockRecord = outStockRecordDao.selectByPrimaryKey(id); - if (outStockRecord != null) { - if (null != outStockRecord.getGoodsClassId() && !outStockRecord.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(outStockRecord.getGoodsClassId()); - outStockRecord.setGoodsClass(goodsClass); - } - if (null != outStockRecord.getBizId() && !outStockRecord.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(outStockRecord.getBizId()); - outStockRecord.setCompany(company); - } - if (null != outStockRecord.getWarehouseId() && !outStockRecord.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(outStockRecord.getWarehouseId()); - outStockRecord.setWarehouse(warehouse); - } - if (null != outStockRecord.getInhouseId() && !outStockRecord.getInhouseId().isEmpty()) { - Warehouse inhouse = this.warehouseService.selectById(outStockRecord.getInhouseId()); - outStockRecord.setInhouse(inhouse); - } - if (null != outStockRecord.getAuditManId() && !outStockRecord.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(outStockRecord.getAuditManId()); - outStockRecord.setAuditManName(auditManName); - } - if (null != outStockRecord.getUserId() && !outStockRecord.getUserId().isEmpty()) { - String userName = this.subscribeService.getUserNamesByUserIds(outStockRecord.getUserId()); - outStockRecord.setUserName(userName); - } - if (null != outStockRecord.getDeptId() && !outStockRecord.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(outStockRecord.getDeptId()); - outStockRecord.setDept(dept); - } - } - return outStockRecord; - } - - /** - * 删除物资领用单时同时删除领用明细,关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - OutStockRecord outStockRecord = this.selectById(id); - this.outStockRecordDetailService.deleteByWhere("where outstock_record_id ='"+outStockRecord.getId()+"'"); - String pInstancId=outStockRecord.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - int result = this.outStockRecordDao.deleteByPrimaryKey(id); - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(OutStockRecord outStockRecord) { - outStockRecord = this.updateTotalMoney(outStockRecord); - return outStockRecordDao.insert(outStockRecord); - } - - public int onlySave(OutStockRecord outStockRecord) { - return outStockRecordDao.insert(outStockRecord); - } - - @Override - @Transactional - public int update(OutStockRecord outStockRecord) { - try { - //更新出库单总额 - outStockRecord = this.updateTotalMoney(outStockRecord); - //出库单审核完成后,库存中去掉数量和金额 - if (outStockRecord.getStatus().equals(SparePartCommString.STATUS_STOCK_FINISH)) { - this.dofinishApplyMaterial(outStockRecord); - } - return outStockRecordDao.updateByPrimaryKeySelective(outStockRecord); - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - throw new RuntimeException(); - } - } - public int updateSection(OutStockRecord outStockRecord) { - try { - //更新出库单总额 - outStockRecord = this.updateTotalMoney(outStockRecord); - //出库单审核完成后,库存中去掉数量和金额 - if (outStockRecord.getStatus().equals(SparePartCommString.STATUS_STOCK_FINISH)) { - this.dofinishApplySectionMaterial(outStockRecord); - } - return outStockRecordDao.updateByPrimaryKeySelective(outStockRecord); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public List selectListByWhere(String wherestr) { - OutStockRecord outStockRecord = new OutStockRecord(); - outStockRecord.setWhere(wherestr); - List outStockRecords = outStockRecordDao.selectListByWhere(outStockRecord); - for (OutStockRecord item: outStockRecords) { - if (null != item.getGoodsClassId() && !item.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(item.getGoodsClassId()); - item.setGoodsClass(goodsClass); - } - if (null != item.getBizId() && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (null != item.getWarehouseId() && !item.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(item.getWarehouseId()); - item.setWarehouse(warehouse); - } - if (null != item.getInhouseId() && !item.getInhouseId().isEmpty()) { - Warehouse inhouse = this.warehouseService.selectById(item.getInhouseId()); - item.setInhouse(inhouse); - } - if (null != item.getAuditManId()&& !item.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - if (null != item.getUserId() && !item.getUserId().isEmpty()) { - String userName = this.subscribeService.getUserNamesByUserIds(item.getUserId()); - item.setUserName(userName); - } - if (null != item.getDeptId() && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - } - return outStockRecords; - } - /** - ** 删除物资领用单时同时删除领用明细,关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - OutStockRecord outStockRecord = new OutStockRecord(); - outStockRecord.setWhere(wherestr); - ListoutStockRecords = outStockRecordDao.selectListByWhere(outStockRecord); - for (OutStockRecord item : outStockRecords) { - this.outStockRecordDetailService.deleteByWhere("where outstock_record_id ='"+item.getId()+"'"); - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - int result = outStockRecordDao.deleteByWhere(outStockRecord); - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 出级物资领用审核完成后,上级库存的数量去掉领用明细的数量,领入库存记录增加 - * @param - * @param - * @return - */ - public int dofinishApplySectionMaterial( OutStockRecord outStockRecord) { - Liststocks = this.stockService.selectListByWhere(" warehouse_id = '"+outStockRecord.getWarehouseId()+"'"); -// Listinstock = this.stockService.selectListByWhere(" warehouse_id = '"+outStockRecord.getInhouseId()+"'"); - List recordDetails = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id ='"+outStockRecord.getId()+"'"); - int result = 0; - for (OutStockRecordDetail detail : recordDetails) { - for (Stock stock : stocks) { - if (detail.getGoods().getId().equals(stock.getGoods().getId())) { - if (detail.getOutNumber()!=null ) { - BigDecimal nowNumber = stock.getNowNumber().subtract(detail.getOutNumber()); - stock.setNowNumber(nowNumber); - } - if (detail.getTotalMoney()!=null) { - BigDecimal nowTotalMoneyBigDecimal = stock.getTotalMoney().subtract(detail.getTotalMoney()); - stock.setTotalMoney(nowTotalMoneyBigDecimal); - } - if (detail.getIncludedTaxTotalMoney()!=null) { - BigDecimal nowIncludedTaxTotalMoneyBigDecimal = stock.getIncludedTaxTotalMoney().subtract(detail.getIncludedTaxTotalMoney()); - stock.setIncludedTaxTotalMoney(nowIncludedTaxTotalMoneyBigDecimal); - } - stock = stockService.stockAlarm(stock); - this.stockService.update(stock); - }; - - } - } - Warehouse inhouse = this.warehouseService.selectById(outStockRecord.getInhouseId()); - Company company = this.unitService.getCompById(inhouse.getBizId()); - if(company!= null ){ - - String inStockId= company.getEname()+"-DJRK-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - InStockRecord inStockRecord = new InStockRecord(); - inStockRecord.setId(inStockId); - inStockRecord.setBizId(company.getId()); - inStockRecord.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - inStockRecord.setInstockDate(CommUtil.nowDate()); - inStockRecord.setInstockManId(outStockRecord.getUserId()); - inStockRecord.setWarehouseId(outStockRecord.getInhouseId()); - inStockRecord.setInsdt(CommUtil.nowDate()); - - if(recordDetails.size()>0){ - //List list = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id='"+id+"' "); - - for (OutStockRecordDetail list : recordDetails) { - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setId(CommUtil.getUUID()); - inStockRecordDetail.setInsdt(CommUtil.nowDate()); - inStockRecordDetail.setGoodsId(list.getGoodsId()); - inStockRecordDetail.setInstockNumber(list.getOutNumber()); - inStockRecordDetail.setInstockRecordId(inStockId); - inStockRecordDetail.setPrice(list.getPrice()); - inStockRecordDetail.setDeptId(list.getDeptId()); - inStockRecordDetail.setType(SparePartCommString.INSTOCK_OTHER); - this.inStockRecordDetailService.save(inStockRecordDetail); - } - } - BigDecimal totalMoney = new BigDecimal(0); - //ListinStockRecordDetails = this.inStockRecordDetailService.selectListByWhere("where instock_record_id = '"+inStockRecord.getId()+"'"); - if (recordDetails!= null && recordDetails.size()>0) { - for (OutStockRecordDetail item : recordDetails) { - if (item.getIncludedTaxTotalMoney() != null) { - totalMoney = totalMoney.add(item.getIncludedTaxTotalMoney()); - } - } - } - inStockRecord.setTotalMoney(totalMoney); - - int result1 = this.inStockRecordService.save(inStockRecord); - this.inStockRecordService.putInStock(inStockRecord.getId()); - } - - - return result; - } - /** - * 物资领用审核完成后,库存的数量去掉领用明细的数量 - * @param - * @param - * @return - */ - public int dofinishApplyMaterial( OutStockRecord outStockRecord) { -// Liststocks = this.stockService.selectListByWhere(" warehouse_id = '"+outStockRecord.getWarehouseId()+"'"); - List recordDetails = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id ='"+outStockRecord.getId()+"'"); - int result = 0; - BigDecimal oNum = new BigDecimal("0"); - for (OutStockRecordDetail detail : recordDetails) { - List stocks = stockService.selectListByWhere(" warehouse_id = '" + outStockRecord.getWarehouseId() + - "' and goods_id = '" + detail.getGoodsId() + - "' and included_tax_cost_price = " + detail.getIncludedTaxCostPrice()); - oNum = detail.getOutNumber(); - for (Stock stock : stocks) { - if (detail.getGoods().getId().equals(stock.getGoods().getId())) { - if (detail.getOutNumber()!=null ) { - BigDecimal nowNumber = stock.getNowNumber().subtract(detail.getOutNumber()); - stock.setNowNumber(nowNumber); - } - if (detail.getTotalMoney()!=null) { - BigDecimal nowTotalMoneyBigDecimal = stock.getTotalMoney().subtract(detail.getTotalMoney()); - stock.setIncludedTaxTotalMoney(stock.getIncludedTaxTotalMoney().subtract(detail.getIncludedTaxTotalMoney())); - stock.setTotalMoney(nowTotalMoneyBigDecimal); - } - if (stock.getOutNumber() == null) { - stock.setOutNumber(detail.getOutNumber()); - } else { - stock.setOutNumber(stock.getOutNumber().add(detail.getOutNumber())); - } - stock = stockService.stockAlarm(stock); - this.stockService.update(stock); - } - inOutDeatilService.deleteByWhere("where outId = '" + detail.getId() + "'"); - // 减去入库当前数量 - List inStockRecordDetails = inStockRecordDetailService.selectListByWhere("where now_number > 0 and include_taxrate_price = " + stock.getIncludedTaxCostPrice() + " order by insdt asc"); - for (InStockRecordDetail item : inStockRecordDetails) { - // 如果出库数量减去入库当前数量大于0则将此入库当前数量置为零 - if (oNum.subtract(item.getNowNumber()).compareTo(new BigDecimal("0")) == 1) { - BigDecimal subtract = oNum.subtract(item.getNowNumber()); - oNum = subtract; - // 出入库关联 - InOutDeatil inOutDeatil = new InOutDeatil(); - inOutDeatil.setInid(item.getId()); - inOutDeatil.setOutid(detail.getId()); - inOutDeatil.setNum(item.getNowNumber()); - item.setNowNumber(new BigDecimal("0")); - inOutDeatil.setInsdt(CommUtil.nowDate()); - inOutDeatilService.save(inOutDeatil); - } else { - // 出入库关联 - InOutDeatil inOutDeatil = new InOutDeatil(); - inOutDeatil.setInid(item.getId()); - inOutDeatil.setOutid(detail.getId()); - inOutDeatil.setNum(oNum); - inOutDeatil.setInsdt(CommUtil.nowDate()); - item.setNowNumber(new BigDecimal("0")); - inOutDeatilService.save(inOutDeatil); - item.setNowNumber(item.getInstockNumber().subtract(oNum)); - inStockRecordDetailService.update_total(item); - break; - } - inStockRecordDetailService.update_total(item); - } - } - } - return result; - } - /** - * 更新物资领用单的总价 - */ - public OutStockRecord updateTotalMoney(OutStockRecord outStockRecord) { - //在保存物资领用单时,将物资领用明细的金额加起来,生成领用单的总金额 - BigDecimal totalMoney = new BigDecimal(0); - ListoutStockRecordDetails = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id = '"+outStockRecord.getId()+"'"); - if (outStockRecordDetails!= null && outStockRecordDetails.size()>0) { - for (OutStockRecordDetail item : outStockRecordDetails) { - if (item.getTotalMoney() != null) { - totalMoney = totalMoney.add(item.getIncludedTaxTotalMoney()); - } - } - } - outStockRecord.setTotalMoney(totalMoney); - return outStockRecord; - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateSectionStatus(String id) { - OutStockRecord outStockRecord = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(outStockRecord.getProcessid()).singleResult(); - int res =0; - if (task!=null) { - outStockRecord.setStatus(task.getName()); - res =this.updateSection(outStockRecord); - }else{ - outStockRecord.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - res =this.updateSection(outStockRecord); - /*//判断是否为一级公司,是则向领用部门自动入库登记 - Warehouse warehouse = this.warehouseService.selectById(outStockRecord.getWarehouseId()); - Company company = this.unitService.getCompById(warehouse.getBizId()); - if(company!= null && company.getPid().equals("-1")){ - company =this.unitService.getCompanyByUserId(outStockRecord.getUserId()); - company = this.unitService.getCompById(company.getId()); - String inStockId= company.getEname()+"-DJRK-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - InStockRecord inStockRecord = new InStockRecord(); - inStockRecord.setId(inStockId); - inStockRecord.setBizId(company.getId()); - inStockRecord.setStatus(SparePartCommString.STATUS_STOCK_START); - inStockRecord.setInstockDate(CommUtil.nowDate()); - inStockRecord.setInstockManId(outStockRecord.getUserId()); - inStockRecord.setInsdt(CommUtil.nowDate()); - int result = this.inStockRecordService.save(inStockRecord); - if(result>0){ - List list = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id='"+id+"' "); - if(list!=null && list.size()>0){ - for(int o=0;o0){ - List list = this.outStockRecordDetailService.selectListByWhere("where outstock_record_id='"+id+"' "); - if(list!=null && list.size()>0){ - for(int o=0;o variables = new HashMap(); - if(!outStockRecord.getAuditManId().isEmpty()){ - variables.put("userIds", outStockRecord.getAuditManId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.O_Stock.getId()+"-"+outStockRecord.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(outStockRecord.getId(), outStockRecord.getInsuser(), processDefinitions.get(0).getKey(),variables); - - // 进行可用数量缩减 - // 1. 查出当前出库物品 - List outStockRecordDetails = outStockRecordDetailService.selectListByWhere("where outstock_record_id = '" + outStockRecord.getId() + "'"); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - List stocks = stockService.selectListByWhere(" s.goods_id = '" + outStockRecordDetail.getGoodsId() + "'" + - " and warehouse_id = '" + outStockRecord.getWarehouseId() + - "' and included_tax_cost_price = " + outStockRecordDetail.getIncludedTaxCostPrice()); - for (Stock stock : stocks) { - stock.setAvailableNumber(stock.getAvailableNumber().subtract(outStockRecordDetail.getOutNumber())); - stockService.update(stock); - } - } - - if(processInstance!=null){ - outStockRecord.setProcessid(processInstance.getId()); - outStockRecord.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(outStockRecord); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(outStockRecord); - businessUnitRecord.sendMessage(outStockRecord.getAuditManId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 启动处级流程 - * @param - * @return - */ - public int startSectionProcess(OutStockRecord outStockRecord) { - try { - Map variables = new HashMap(); - if(!outStockRecord.getAuditManId().isEmpty()){ - variables.put("userIds", outStockRecord.getAuditManId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Scetion_Stock.getId()+"-"+outStockRecord.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(outStockRecord.getId(), outStockRecord.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - outStockRecord.setProcessid(processInstance.getId()); - outStockRecord.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(outStockRecord); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(outStockRecord); - businessUnitRecord.sendMessage(outStockRecord.getAuditManId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 出库审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - public int doSectionAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateSectionStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 根据物品ID反查所有出库单信息并将 - * @return - */ - public com.alibaba.fastjson.JSONArray selectStockDetailByGoosId(String goodsId, String whereStr, Stock stock, Warehouse warehouse) { - List outStockRecordDetails = outStockRecordDetailService.selectListByWhere(whereStr); - com.alibaba.fastjson.JSONArray result = new com.alibaba.fastjson.JSONArray(); - for (OutStockRecordDetail outStockRecordDetail : outStockRecordDetails) { - if (StringUtils.isNotBlank(outStockRecordDetail.getOutstockRecordId())) { - List outStockRecords = selectListByWhere("where status = 2 and id = '" + outStockRecordDetail.getOutstockRecordId() + "' and warehouse_id = '" + warehouse.getId() + "'"); - List inOutDeatils = inOutDeatilService.selectListByWhere("where outId = '" + outStockRecordDetail.getId() + "' order by id desc"); - for (InOutDeatil inOutDeatil : inOutDeatils) { - InStockRecordDetail inStockRecordDetail = inStockRecordDetailService.selectById(inOutDeatil.getInid()); - OutStockRecord outStockRecord = outStockRecords.get(0); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - if (StringUtils.isNotBlank(outStockRecordDetail.getInsuser())) { - User user = userService.getUserById(outStockRecordDetail.getInsuser()); - jsonObject.put("user", user.getCaption()); // 出入库 - } - jsonObject.put("type", "出库"); // 出入库 - jsonObject.put("id", outStockRecord.getId()); // 单据编号 - jsonObject.put("insdt", outStockRecordDetail.getInsdt()); // 日期 - jsonObject.put("number", inOutDeatil.getNum()); // 数量 - jsonObject.put("price", inStockRecordDetail.getPrice()); // 单价 - jsonObject.put("tPrice", inStockRecordDetail.getIncludeTaxratePrice()); // 含税单价 - result.add(jsonObject); - } - } - } - System.out.println(System.currentTimeMillis()); - return result; - } - /** - * 任务流转,出库(物资领用)业务处理完后提交审核 - * @param - * @return - */ - /*@Transactional - public int doOutStockHandle(OutStockRecord outStockRecord) { - try { - Map variables = new HashMap(); - variables.put(CommString.ACTI_KEK_Candidate_Users, outStockRecord.getAuditManId()); - variables.put(CommString.ACTI_KEK_Assignee, null); - List tasks = taskService.createTaskQuery().processInstanceId(outStockRecord.getProcessid()).orderByTaskCreateTime().desc().list(); - taskService.complete(tasks.get(0).getId(), variables); - int res=this.update(outStockRecord); - outStockRecord = this.selectById(outStockRecord.getId()); - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(outStockRecord); - businessUnitRecord.sendMessage(outStockRecord.getAuditManId(),""); - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - }*/ - - public void updateIODeatilByPrice(BigDecimal oNum, BigDecimal price, OutStockRecordDetail detail) { - - inOutDeatilService.deleteByWhere("where outId = '" + detail.getId() + "'"); - - // 减去入库当前数量 - List inStockRecordDetails = inStockRecordDetailService.selectListByWhere("where now_number > 0 and include_taxrate_price = " + price + " and goods_id = '"+ detail.getGoodsId() +"' order by insdt asc"); - for (InStockRecordDetail item : inStockRecordDetails) { - // 如果出库数量减去入库当前数量大于0则将此入库当前数量置为零 - if (oNum.subtract(item.getNowNumber()).compareTo(new BigDecimal("0")) == 1) { - BigDecimal subtract = oNum.subtract(item.getNowNumber()); - oNum = subtract; - // 出入库关联 - InOutDeatil inOutDeatil = new InOutDeatil(); - inOutDeatil.setInid(item.getId()); - inOutDeatil.setOutid(detail.getId()); - inOutDeatil.setNum(item.getNowNumber()); - inOutDeatil.setInsdt(CommUtil.nowDate()); - inOutDeatilService.save(inOutDeatil); - } else { - // 出入库关联 - InOutDeatil inOutDeatil = new InOutDeatil(); - inOutDeatil.setInid(item.getId()); - inOutDeatil.setOutid(detail.getId()); - inOutDeatil.setNum(oNum); - inOutDeatil.setInsdt(CommUtil.nowDate()); - item.setNowNumber(new BigDecimal("0")); - inOutDeatilService.save(inOutDeatil); - break; - } - } - } - -} diff --git a/src/com/sipai/service/sparepart/PerformanceService.java b/src/com/sipai/service/sparepart/PerformanceService.java deleted file mode 100644 index d4905487..00000000 --- a/src/com/sipai/service/sparepart/PerformanceService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.PerformanceDao; -import com.sipai.entity.sparepart.Performance; -import com.sipai.tools.CommService; - -@Service -public class PerformanceService implements CommService{ - @Resource - private PerformanceDao performanceDao; - - @Override - public Performance selectById(String id) { - Performance performance = performanceDao.selectByPrimaryKey(id); - return performance; - } - - @Override - public int deleteById(String id) { - return performanceDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Performance performance) { - return performanceDao.insert(performance); - } - - @Override - public int update(Performance performance) { - return performanceDao.updateByPrimaryKeySelective(performance); - } - - @Override - public List selectListByWhere(String wherestr) { - Performance performance = new Performance(); - performance.setWhere(wherestr); - List list = performanceDao.selectListByWhere(performance); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Performance performance = new Performance(); - performance.setWhere(wherestr); - return performanceDao.deleteByWhere(performance); - } -} diff --git a/src/com/sipai/service/sparepart/PurchaseDetailService.java b/src/com/sipai/service/sparepart/PurchaseDetailService.java deleted file mode 100644 index b93c893c..00000000 --- a/src/com/sipai/service/sparepart/PurchaseDetailService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.GoodsDao; -import com.sipai.dao.sparepart.PurchaseDetailDao; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.tools.CommService; - -@Service -public class PurchaseDetailService implements CommService{ - @Resource - private GoodsService goodsService; - @Resource - private PurchaseDetailDao purchaseDetailDao; - - @Override - public PurchaseDetail selectById(String id) { - PurchaseDetail purchaseDetail = purchaseDetailDao.selectByPrimaryKey(id); - if (purchaseDetail.getGoodsId() != null && !purchaseDetail.getGoodsId() .isEmpty()) { - Goods goods = this.goodsService.selectById(purchaseDetail.getGoodsId()); - purchaseDetail.setGoods(goods); - } - return purchaseDetail; - } - - @Override - public int deleteById(String id) { - return purchaseDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PurchaseDetail purchaseDetail) { - return purchaseDetailDao.insert(purchaseDetail); - } - - @Override - public int update(PurchaseDetail purchaseDetail) { - return purchaseDetailDao.updateByPrimaryKeySelective(purchaseDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - PurchaseDetail purchaseDetail = new PurchaseDetail(); - purchaseDetail.setWhere(wherestr); - List list = purchaseDetailDao.selectListByWhere(purchaseDetail); - for (PurchaseDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - PurchaseDetail purchaseDetail = new PurchaseDetail(); - purchaseDetail.setWhere(wherestr); - return purchaseDetailDao.deleteByWhere(purchaseDetail); - } -} diff --git a/src/com/sipai/service/sparepart/PurchaseMethodsService.java b/src/com/sipai/service/sparepart/PurchaseMethodsService.java deleted file mode 100644 index 9a24dd01..00000000 --- a/src/com/sipai/service/sparepart/PurchaseMethodsService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.PurchaseMethodsDao; -import com.sipai.entity.sparepart.PurchaseMethods; -import com.sipai.tools.CommService; - -@Service -public class PurchaseMethodsService implements CommService{ - @Resource - private PurchaseMethodsDao purchaseMethodsDao; - - @Override - public PurchaseMethods selectById(String id) { - PurchaseMethods purchaseMethods = purchaseMethodsDao.selectByPrimaryKey(id); - return purchaseMethods; - } - - @Override - public int deleteById(String id) { - return purchaseMethodsDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PurchaseMethods purchaseMethods) { - return purchaseMethodsDao.insert(purchaseMethods); - } - - @Override - public int update(PurchaseMethods purchaseMethods) { - return purchaseMethodsDao.updateByPrimaryKeySelective(purchaseMethods); - } - - @Override - public List selectListByWhere(String wherestr) { - PurchaseMethods purchaseMethods = new PurchaseMethods(); - purchaseMethods.setWhere(wherestr); - List list = purchaseMethodsDao.selectListByWhere(purchaseMethods); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - PurchaseMethods purchaseMethods = new PurchaseMethods(); - purchaseMethods.setWhere(wherestr); - return purchaseMethodsDao.deleteByWhere(purchaseMethods); - } -} diff --git a/src/com/sipai/service/sparepart/PurchasePlanService.java b/src/com/sipai/service/sparepart/PurchasePlanService.java deleted file mode 100644 index d99e9a61..00000000 --- a/src/com/sipai/service/sparepart/PurchasePlanService.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.PurchasePlanDao; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class PurchasePlanService implements CommService{ - @Resource - private PurchasePlanDao purchasePlanDao; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - - @Override - public PurchasePlan selectById(String id) { - PurchasePlan purchasePlan = purchasePlanDao.selectByPrimaryKey(id); - if (purchasePlan.getDepartmentId() != null && !purchasePlan.getDepartmentId().isEmpty()) { - Dept dept = this.unitService.getDeptById(purchasePlan.getDepartmentId()); - purchasePlan.setDept(dept); - } - if (purchasePlan.getApplicant() != null && !purchasePlan.getApplicant().isEmpty()) { - String userIds = purchasePlan.getApplicant().replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - purchasePlan.setUserNames(userNames); - } - return purchasePlan; - } - - @Override - public int deleteById(String id) { - return purchasePlanDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PurchasePlan purchasePlan) { - return purchasePlanDao.insert(purchasePlan); - } - - @Override - public int update(PurchasePlan purchasePlan) { - return purchasePlanDao.updateByPrimaryKeySelective(purchasePlan); - } - - @Override - public List selectListByWhere(String wherestr) { - PurchasePlan purchasePlan = new PurchasePlan(); - purchasePlan.setWhere(wherestr); - List list = purchasePlanDao.selectListByWhere(purchasePlan); - for (PurchasePlan item : list) { - BigDecimal totalMoney = new BigDecimal("0"); - if (item.getType().equals(SparePartCommString.PURCHASE_DEPARTMENT)) { - List purchaseDetails = this.purchaseDetailService.selectListByWhere("where pid = '"+item.getId()+"'"); - for (PurchaseDetail purchaseDetail : purchaseDetails) { - totalMoney = totalMoney.add(purchaseDetail.getTotalMoney()); - } - }else { - purchasePlan.setWhere("where pid = '"+item.getId()+"'"); - ListpurchasePlans = purchasePlanDao.selectListByWhere(purchasePlan); - for (PurchasePlan purchaseItem: purchasePlans) { - totalMoney = totalMoney.add(purchaseItem.getTotalMoney()); - } - } - item.setTotalMoney(totalMoney); - - if (item.getDepartmentId() != null && !item.getDepartmentId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDepartmentId()); - item.setDept(dept); - } - if (item.getApplicant() != null && !item.getApplicant().isEmpty()) { - String userIds = item.getApplicant().replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User user : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=user.getCaption(); - } - item.setUserNames(userNames); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - PurchasePlan purchasePlan = new PurchasePlan(); - purchasePlan.setWhere(wherestr); - return purchasePlanDao.deleteByWhere(purchasePlan); - } -} diff --git a/src/com/sipai/service/sparepart/PurchaseRecordDetailService.java b/src/com/sipai/service/sparepart/PurchaseRecordDetailService.java deleted file mode 100644 index fed51a1b..00000000 --- a/src/com/sipai/service/sparepart/PurchaseRecordDetailService.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.PurchaseRecordDetailDao; -import com.sipai.dao.sparepart.SubscribeDetailDao; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class PurchaseRecordDetailService implements CommService{ - @Resource - private GoodsService goodsService; - @Resource - private PurchaseRecordDetailDao purchaseRecordDetailDao; - @Resource - private SubscribeService subscribeService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private UnitService unitService; - @Resource - private PurchaseRecordService purchaseRecordService; - - - @Override - public PurchaseRecordDetail selectById(String id) { - PurchaseRecordDetail purchaseRecordDetail = purchaseRecordDetailDao.selectByPrimaryKey(id); - if (purchaseRecordDetail.getGoodsId() != null && !purchaseRecordDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(purchaseRecordDetail.getGoodsId()); - purchaseRecordDetail.setGoods(goods); - } - if (purchaseRecordDetail.getDeptId() != null && !purchaseRecordDetail.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(purchaseRecordDetail.getDeptId()); - purchaseRecordDetail.setDept(dept); - } - return purchaseRecordDetail; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - PurchaseRecordDetail purchaseRecordDetail = this.selectById(id); - int result = this.purchaseRecordDetailDao.deleteByPrimaryKey(id); - //删除采购记录明细时更新采购记录单总金额 - if (purchaseRecordDetail.getRecordId() != null && !purchaseRecordDetail.getRecordId().isEmpty()) { - PurchaseRecord purchaseRecord = this.purchaseRecordService.selectById(purchaseRecordDetail.getRecordId()); - this.purchaseRecordService.noMessageUpdate(purchaseRecord); - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(PurchaseRecordDetail purchaseRecordDetail) { - return purchaseRecordDetailDao.insert(purchaseRecordDetail); - } - - @Override - public int update(PurchaseRecordDetail purchaseRecordDetail) { - return purchaseRecordDetailDao.updateByPrimaryKeySelective(purchaseRecordDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - PurchaseRecordDetail purchaseRecordDetail = new PurchaseRecordDetail(); - purchaseRecordDetail.setWhere(wherestr); - List list = purchaseRecordDetailDao.selectListByWhere(purchaseRecordDetail); - for (PurchaseRecordDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - } - return list; - } - - public List selectListByWhere(String wherestr, String name) { - PurchaseRecordDetail purchaseRecordDetail = new PurchaseRecordDetail(); - purchaseRecordDetail.setWhere(wherestr); - List list = purchaseRecordDetailDao.selectListByWhere(purchaseRecordDetail); - List resultList = new ArrayList<>(); - for (PurchaseRecordDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - if (StringUtils.isNotBlank(name)) { - List goods = goodsService.selectListByWhere("where id = '" + item.getGoodsId() + "' and name like '%" + name + "%'"); - if (goods != null && goods.size() > 0) { - item.setGoods(goods.get(0)); - resultList.add(item); - } - } else { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - resultList.add(item); - } - } - - if (StringUtils.isNotBlank(item.getSubscribeDetailId())) { - SubscribeDetail subscribeDetail = subscribeDetailService.selectById(item.getSubscribeDetailId()); - BigDecimal usableNumber = subscribeDetailService.getUsableNumber(subscribeDetail.getId()); - subscribeDetail.setUsableNumber(usableNumber); - item.setSubscribeDetail(subscribeDetail); - } - -// if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { -// Dept dept = this.unitService.getDeptById(item.getDeptId()); -// item.setDept(dept); -// } - } - return resultList; - } - - public List selectDetailListByWhere(String wherestr, String name) { - PurchaseRecordDetail purchaseRecordDetail = new PurchaseRecordDetail(); - purchaseRecordDetail.setWhere(wherestr); - List resultList = new ArrayList<>(); - List list = purchaseRecordDetailDao.selectDetailListByWhere(purchaseRecordDetail); - for (PurchaseRecordDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - if (StringUtils.isNotBlank(name)) { - List goods = goodsService.selectListByWhere("where id = '" + item.getGoodsId() + "' and name like '%" + name + "%'"); - if (goods != null && goods.size() > 0) { - item.setGoods(goods.get(0)); - resultList.add(item); - } - } else { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - resultList.add(item); - } - } - if (StringUtils.isNotBlank(item.getSubscribeDetailId())) { - SubscribeDetail subscribeDetail = subscribeDetailService.selectById(item.getSubscribeDetailId()); - BigDecimal usableNumber = subscribeDetailService.getUsableNumber(subscribeDetail.getId()); - subscribeDetail.setUsableNumber(usableNumber); - item.setSubscribeDetail(subscribeDetail); - } - } - return resultList; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - PurchaseRecordDetail purchaseRecordDetail = new PurchaseRecordDetail(); - purchaseRecordDetail.setWhere(wherestr); - ListpurchaseRecordDetails = this.selectListByWhere(wherestr); - int result = this.purchaseRecordDetailDao.deleteByWhere(purchaseRecordDetail); - //删除采购记录明细时更新采购记录单总金额 - if (purchaseRecordDetails!= null && purchaseRecordDetails.size()>0) { - if (purchaseRecordDetails.get(0).getRecordId() != null && !purchaseRecordDetails.get(0).getRecordId().isEmpty()) { - PurchaseRecord purchaseRecord = this.purchaseRecordService.selectById(purchaseRecordDetails.get(0).getRecordId()); - this.purchaseRecordService.noMessageUpdate(purchaseRecord); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 更新采购记录明细时,需要对比申购计划明细中的可用数量,明细更新后更新记录单总价 - */ - @Transactional - public String updateTotalMoney(String id,String number ,String price) { - try { - PurchaseRecordDetail purchaseRecordDetail = this.selectById(id); - if (purchaseRecordDetail.getSubscribeDetailId() != null && !purchaseRecordDetail.getSubscribeDetailId().isEmpty()) { - //可用数量 - BigDecimal usableNumber = this.subscribeDetailService.getUsableNumber(purchaseRecordDetail.getSubscribeDetailId()); - if (purchaseRecordDetail.getNumber() != null) { - usableNumber = usableNumber.add(purchaseRecordDetail.getNumber()); - } - if (null != number && !number.isEmpty()) { - BigDecimal numberBigDecimal = new BigDecimal(number); - if (usableNumber.compareTo(numberBigDecimal) == -1) {//可用数量小于使用数量 - return "可用数量不足,请重新输入"; - }else{ - purchaseRecordDetail.setNumber(numberBigDecimal); - } - } - - } - if (null != price && !price.isEmpty()) { - BigDecimal priceBigDecimal = new BigDecimal(price); - purchaseRecordDetail.setPrice(priceBigDecimal); - } - BigDecimal totalMoney = purchaseRecordDetail.getTotalMoney(); - totalMoney = (purchaseRecordDetail.getNumber()).multiply(purchaseRecordDetail.getPrice()); - purchaseRecordDetail.setTotalMoney(totalMoney); - int result = this.update(purchaseRecordDetail); - if (result == 1) { - if (purchaseRecordDetail.getRecordId() != null && !purchaseRecordDetail.getRecordId().isEmpty()) { - List purchaseRecords = this.purchaseRecordService.selectListByWhere("where id = '"+purchaseRecordDetail.getRecordId()+"'"); - if (purchaseRecords!=null && purchaseRecords.size()>0) { - PurchaseRecord purchaseRecord = this.purchaseRecordService.selectById(purchaseRecordDetail.getRecordId()); - this.purchaseRecordService.update(purchaseRecord); - } - } - } - return Integer.toString(result); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } -} diff --git a/src/com/sipai/service/sparepart/PurchaseRecordService.java b/src/com/sipai/service/sparepart/PurchaseRecordService.java deleted file mode 100644 index 13f81dea..00000000 --- a/src/com/sipai/service/sparepart/PurchaseRecordService.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.tools.Mqtt; -import com.sipai.tools.MqttUtil; -import com.sipai.tools.SpringContextUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.PurchasePlanDao; -import com.sipai.dao.sparepart.PurchaseRecordDao; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class PurchaseRecordService implements CommService{ - @Resource - private PurchaseRecordDao purchaseRecordDao; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private UnitService unitService; - @Resource - private SubscribeService subscribeService; - @Resource - private UserService userService; - - @Override - public PurchaseRecord selectById(String id) { - PurchaseRecord purchaseRecord = purchaseRecordDao.selectByPrimaryKey(id); - if (purchaseRecord.getBizId() != null && !purchaseRecord.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(purchaseRecord.getBizId()); - purchaseRecord.setCompany(company); - } - if (purchaseRecord.getAuditManId() !=null && !purchaseRecord.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(purchaseRecord.getAuditManId()); - purchaseRecord.setAuditManName(auditManName); - } - if (purchaseRecord.getPurchaseManId() !=null && !purchaseRecord.getPurchaseManId().isEmpty()) { - String purchaseManName = this.subscribeService.getUserNamesByUserIds(purchaseRecord.getPurchaseManId()); - purchaseRecord.setPurchaseManName(purchaseManName); - } - return purchaseRecord; - } - - /** - * 删除采购单时同时删除采购记录明细 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - //删除采购单的同时删除关联的采购记录明细 - this.purchaseRecordDetailService.deleteByWhere("where record_id = '"+id+"'"); - return purchaseRecordDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(PurchaseRecord purchaseRecord) { - return purchaseRecordDao.insert(purchaseRecord); - } - - @Override - public int update(PurchaseRecord purchaseRecord) { - purchaseRecord = this.updateTotalMoney(purchaseRecord); - //推送mqtt消息 - if (StringUtils.isNotBlank(purchaseRecord.getsUserId()) && SparePartCommString.STATUS_COMEIN.equals(purchaseRecord.getStatus())) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(purchaseRecord); -// businessUnitRecord.sendMessage(purchaseRecord.getsUserId(), "有新的采购记录提交,可进行入库操作!"); - businessUnitRecord.sendMessage(purchaseRecord.getsUserId(), ""); - - } - return purchaseRecordDao.updateByPrimaryKeySelective(purchaseRecord); - } - public int noMessageUpdate(PurchaseRecord purchaseRecord) { - purchaseRecord = this.updateTotalMoney(purchaseRecord); - return purchaseRecordDao.updateByPrimaryKeySelective(purchaseRecord); - } - - @Override - public List selectListByWhere(String wherestr) { - PurchaseRecord purchaseRecord = new PurchaseRecord(); - purchaseRecord.setWhere(wherestr); - List list = purchaseRecordDao.selectListByWhere(purchaseRecord); - for (PurchaseRecord item : list) { - if (item.getBizId() != null && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (item.getAuditManId() !=null && !item.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - if (item.getPurchaseManId() !=null && !item.getPurchaseManId().isEmpty()) { - String purchaseManName = this.subscribeService.getUserNamesByUserIds(item.getPurchaseManId()); - item.setPurchaseManName(purchaseManName); - } - } - return list; - } - /** - * 删除采购记录单时同时删除关联的采购记录明细 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - PurchaseRecord purchaseRecord = new PurchaseRecord(); - purchaseRecord.setWhere(wherestr); - List purchaseRecords = this.selectListByWhere(wherestr); - for (PurchaseRecord item : purchaseRecords) { - //删除采购记录单的同时删除关联的采购记录明细 - this.purchaseRecordDetailService.deleteByWhere("where record_id = '"+item.getId()+"'"); - } - return purchaseRecordDao.deleteByWhere(purchaseRecord); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 更新采购记录的总价 - */ - public PurchaseRecord updateTotalMoney(PurchaseRecord purchaseRecord) { - //在保存申购单时,将申购单明细的金额加起来,生成申购单的总金额 - BigDecimal totalMoney = new BigDecimal(0); - ListpurchaseRecordDetails = this.purchaseRecordDetailService.selectListByWhere("where record_id = '"+purchaseRecord.getId()+"'"); - if (purchaseRecordDetails!= null && purchaseRecordDetails.size()>0) { - for (PurchaseRecordDetail item : purchaseRecordDetails) { - if (item.getTotalMoney() != null) { - totalMoney = totalMoney.add(item.getTotalMoney()); - } - } - } - purchaseRecord.setTotalMoney(totalMoney); - return purchaseRecord; - } - - public PurchaseRecord PurchaseRecordMoneyTotal(String SQL) { - return purchaseRecordDao.PurchaseRecordMoneyTotal(SQL); - } -} diff --git a/src/com/sipai/service/sparepart/PurposeService.java b/src/com/sipai/service/sparepart/PurposeService.java deleted file mode 100644 index 0890fb46..00000000 --- a/src/com/sipai/service/sparepart/PurposeService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.PurposeDao; -import com.sipai.entity.sparepart.Purpose; -import com.sipai.tools.CommService; - -@Service -public class PurposeService implements CommService{ - @Resource - private PurposeDao purposeDao; - - @Override - public Purpose selectById(String id) { - Purpose purpose = purposeDao.selectByPrimaryKey(id); - return purpose; - } - - @Override - public int deleteById(String id) { - return purposeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Purpose purpose) { - return purposeDao.insert(purpose); - } - - @Override - public int update(Purpose purpose) { - return purposeDao.updateByPrimaryKeySelective(purpose); - } - - @Override - public List selectListByWhere(String wherestr) { - Purpose purpose = new Purpose(); - purpose.setWhere(wherestr); - List list = purposeDao.selectListByWhere(purpose); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Purpose purpose = new Purpose(); - purpose.setWhere(wherestr); - return purposeDao.deleteByWhere(purpose); - } -} diff --git a/src/com/sipai/service/sparepart/QualificationTypeService.java b/src/com/sipai/service/sparepart/QualificationTypeService.java deleted file mode 100644 index 5869ff8d..00000000 --- a/src/com/sipai/service/sparepart/QualificationTypeService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.QualificationTypeDao; - -import com.sipai.entity.sparepart.QualificationType; - -import com.sipai.tools.CommService; - -@Service -public class QualificationTypeService implements CommService{ - @Resource - private QualificationTypeDao qualificationTypeDao; - - - @Override - public QualificationType selectById(String id) { - QualificationType qualificationType = qualificationTypeDao.selectByPrimaryKey(id); - - return qualificationType; - } - - - - @Override - public int deleteById(String id) { - return qualificationTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(QualificationType goods) { - return qualificationTypeDao.insert(goods); - } - - @Override - public int update(QualificationType goods) { - return qualificationTypeDao.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - QualificationType QualificationType = new QualificationType(); - QualificationType.setWhere(wherestr); - List list = qualificationTypeDao.selectListByWhere(QualificationType); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - QualificationType QualificationType = new QualificationType(); - QualificationType.setWhere(wherestr); - return qualificationTypeDao.deleteByWhere(QualificationType); - } - - -} diff --git a/src/com/sipai/service/sparepart/QualificationType_copyService.java b/src/com/sipai/service/sparepart/QualificationType_copyService.java deleted file mode 100644 index d7b5beb7..00000000 --- a/src/com/sipai/service/sparepart/QualificationType_copyService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.QualificationType_copyDao; - -import com.sipai.entity.sparepart.QualificationType_copy; - -import com.sipai.tools.CommService; - -@Service -public class QualificationType_copyService implements CommService{ - @Resource - private QualificationType_copyDao qualificationTypeDao1; - - - @Override - public QualificationType_copy selectById(String id) { - QualificationType_copy qualificationType = qualificationTypeDao1.selectByPrimaryKey(id); - - return qualificationType; - } - - - - @Override - public int deleteById(String id) { - return qualificationTypeDao1.deleteByPrimaryKey(id); - } - - @Override - public int save(QualificationType_copy goods) { - return qualificationTypeDao1.insert(goods); - } - - @Override - public int update(QualificationType_copy goods) { - return qualificationTypeDao1.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - QualificationType_copy QualificationType = new QualificationType_copy(); - QualificationType.setWhere(wherestr); - List list = qualificationTypeDao1.selectListByWhere(QualificationType); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - QualificationType_copy QualificationType = new QualificationType_copy(); - QualificationType.setWhere(wherestr); - return qualificationTypeDao1.deleteByWhere(QualificationType); - } - - -} diff --git a/src/com/sipai/service/sparepart/RawMaterialDetailService.java b/src/com/sipai/service/sparepart/RawMaterialDetailService.java deleted file mode 100644 index b140def5..00000000 --- a/src/com/sipai/service/sparepart/RawMaterialDetailService.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.RawMaterialDetailDao; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.RawMaterial; -import com.sipai.entity.sparepart.RawMaterialDetail; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class RawMaterialDetailService implements CommService{ - @Resource - private RawMaterialDetailDao rawMaterialDetailDao; - @Resource - private UnitService unitService; - @Resource - private GoodsService goodsService; - @Resource - private RawMaterialService rawMaterialService; - - @Override - public RawMaterialDetail selectById(String id) { - RawMaterialDetail rawMaterialDetail = rawMaterialDetailDao.selectByPrimaryKey(id); - if (rawMaterialDetail.getGoodsId() != null && !rawMaterialDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(rawMaterialDetail.getGoodsId()); - rawMaterialDetail.setGoods(goods); - } - if (rawMaterialDetail.getDeptId() != null && !rawMaterialDetail.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(rawMaterialDetail.getDeptId()); - rawMaterialDetail.setDept(dept); - } - return rawMaterialDetail; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - RawMaterialDetail rawMaterialDetail = this.selectById(id); - int result = this.rawMaterialDetailDao.deleteByPrimaryKey(id); - //删除入库记录明细时更新入库记录单总金额 - if (rawMaterialDetail.getRawmaterialId() != null && !rawMaterialDetail.getRawmaterialId().isEmpty()) { - RawMaterial rawMaterial = this.rawMaterialService.selectById(rawMaterialDetail.getRawmaterialId()); - this.rawMaterialService.update(rawMaterial); - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(RawMaterialDetail rawMaterialDetail) { - rawMaterialDetail = this.updateTotalMoney(rawMaterialDetail); - if (rawMaterialDetail.getRawmaterialId() != null && !rawMaterialDetail.getRawmaterialId().isEmpty()) { - List rawMaterials = this.rawMaterialService.selectListByWhere("where id = '"+rawMaterialDetail.getRawmaterialId()+"'"); - if (rawMaterials!=null && rawMaterials.size()>0) { - RawMaterial rawMaterial = rawMaterials.get(0); - this.rawMaterialService.update(rawMaterial); - } - } - return rawMaterialDetailDao.insert(rawMaterialDetail); - } - - @Override - public int update(RawMaterialDetail rawMaterialDetail) { - rawMaterialDetail = this.updateTotalMoney(rawMaterialDetail); - return rawMaterialDetailDao.updateByPrimaryKeySelective(rawMaterialDetail); - } - public int update_total(RawMaterialDetail rawMaterialDetail) { - return rawMaterialDetailDao.updateByPrimaryKeySelective(rawMaterialDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - RawMaterialDetail rawMaterialDetail = new RawMaterialDetail(); - rawMaterialDetail.setWhere(wherestr); - List rawMaterialDetails = rawMaterialDetailDao.selectListByWhere(rawMaterialDetail); - if (rawMaterialDetails != null && rawMaterialDetails.size()>0) { - for (RawMaterialDetail item : rawMaterialDetails) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - } - - } - return rawMaterialDetails; - } - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - RawMaterialDetail rawMaterialDetail = new RawMaterialDetail(); - rawMaterialDetail.setWhere(wherestr); - ListrawMaterialDetails = this.selectListByWhere(wherestr); - int result = this.rawMaterialDetailDao.deleteByWhere(rawMaterialDetail); - //删除入库记录明细时更新入库记录单总金额 - if (rawMaterialDetails!= null && rawMaterialDetails.size()>0) { - if (rawMaterialDetails.get(0).getRawmaterialId() != null && !rawMaterialDetails.get(0).getRawmaterialId().isEmpty()) { - RawMaterial rawMaterial = this.rawMaterialService.selectById(rawMaterialDetails.get(0).getRawmaterialId()); - this.rawMaterialService.update(rawMaterial); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 入库明细保存时,更新每条明细的合计金额,更新入库单的总金额 - */ - public RawMaterialDetail updateTotalMoney(RawMaterialDetail rawMaterialDetail) { - BigDecimal totalMoney = rawMaterialDetail.getTotalMoney(); - BigDecimal includeTaxrateTotalMoney = rawMaterialDetail.getIncludeTaxrateTotalMoney(); - if (null != rawMaterialDetail.getRawmaterialNumber()) { - if (null != rawMaterialDetail.getPrice()) { - totalMoney = (rawMaterialDetail.getRawmaterialNumber()).multiply(rawMaterialDetail.getPrice()); - } - if (null != rawMaterialDetail.getIncludeTaxratePrice()) { - includeTaxrateTotalMoney = (rawMaterialDetail.getRawmaterialNumber()).multiply(rawMaterialDetail.getIncludeTaxratePrice()); - } - } - rawMaterialDetail.setTotalMoney(totalMoney); - rawMaterialDetail.setIncludeTaxrateTotalMoney(includeTaxrateTotalMoney); - return rawMaterialDetail; - } -} diff --git a/src/com/sipai/service/sparepart/RawMaterialService.java b/src/com/sipai/service/sparepart/RawMaterialService.java deleted file mode 100644 index ea7d8340..00000000 --- a/src/com/sipai/service/sparepart/RawMaterialService.java +++ /dev/null @@ -1,290 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.RawMaterialDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.RawMaterial; -import com.sipai.entity.sparepart.RawMaterialDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.Company; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class RawMaterialService implements CommService{ - @Resource - private RawMaterialDao rawMaterialDao; - @Resource - private GoodsClassService goodsClassService; - @Resource - private WarehouseService warehouseService; - @Resource - private SubscribeService subscribeService; - @Resource - private RawMaterialDetailService rawMaterialDetailService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UnitService unitService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - - @Override - public RawMaterial selectById(String id) { - RawMaterial rawMaterial = rawMaterialDao.selectByPrimaryKey(id); - if (null != rawMaterial.getGoodsClassId() && !rawMaterial.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(rawMaterial.getGoodsClassId()); - rawMaterial.setGoodsClass(goodsClass); - } - if (null != rawMaterial.getBizId() && !rawMaterial.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(rawMaterial.getBizId()); - rawMaterial.setCompany(company); - } - if (null != rawMaterial.getAuditManId() && !rawMaterial.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(rawMaterial.getAuditManId()); - rawMaterial.setAuditManName(auditManName); - } - if (null != rawMaterial.getRegisterManId() && !rawMaterial.getRegisterManId().isEmpty()) { - String instockManName = this.subscribeService.getUserNamesByUserIds(rawMaterial.getRegisterManId()); - rawMaterial.setRegisterManName(instockManName); - } - return rawMaterial; - } - - /** - * 删除药剂登记单时同时删除药剂登记记录明细,关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - RawMaterial rawMaterial = this.selectById(id); - this.rawMaterialDetailService.deleteByWhere("where rawmaterial_id = '"+id+"'"); - String pInstancId = rawMaterial.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return rawMaterialDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(RawMaterial rawMaterial) { - return rawMaterialDao.insert(rawMaterial); - } - - @Override - public int update(RawMaterial rawMaterial) { - return rawMaterialDao.updateByPrimaryKeySelective(rawMaterial); - } - - @Override - public List selectListByWhere(String wherestr) { - RawMaterial rawMaterial = new RawMaterial(); - rawMaterial.setWhere(wherestr); - List rawMaterials = rawMaterialDao.selectListByWhere(rawMaterial); - for (RawMaterial item: rawMaterials) { - if (null != item.getGoodsClassId() && !item.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(item.getGoodsClassId()); - item.setGoodsClass(goodsClass); - } - if (null != item.getBizId() && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (null != item.getAuditManId()&& !item.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - if (null !=item.getRegisterManId() && !item.getRegisterManId().isEmpty()) { - String instockManName = this.subscribeService.getUserNamesByUserIds(item.getRegisterManId()); - item.setRegisterManName(instockManName); - } - } - return rawMaterials; - } - /** - * 删除药剂登记单时同时删除药剂登记记录明细,关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - RawMaterial rawMaterial = new RawMaterial(); - rawMaterial.setWhere(wherestr); - List rawMaterials = this.selectListByWhere(wherestr); - for (RawMaterial item : rawMaterials) { - this.rawMaterialDetailService.deleteByWhere("where rawmaterial_id = '"+item.getId()+"'"); - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return rawMaterialDao.deleteByWhere(rawMaterial); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id ,boolean passstatus) { - RawMaterial rawMaterial = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(rawMaterial.getProcessid()).list(); - if (task!=null && task.size()>0) { - rawMaterial.setStatus(task.get(0).getName()); - }else{ - //检验通过 - if(passstatus){ - rawMaterial.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - Company company = this.unitService.getCompById(rawMaterial.getBizId()); - String inStockRecordId = company.getEname()+"-DJRK-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - InStockRecord inStockRecord = new InStockRecord(); - inStockRecord.setId(inStockRecordId); - inStockRecord.setInstockDate(CommUtil.nowDate()); - inStockRecord.setInsuser(rawMaterial.getInsuser()); - inStockRecord.setInsdt(CommUtil.nowDate()); - inStockRecord.setBizId(rawMaterial.getBizId()); - inStockRecord.setStatus(SparePartCommString.STATUS_STOCK_START); - inStockRecord.setRemark("药剂检验通过"); - try{ - //复制数据到入库单中 - int res_inStock = inStockRecordService.save(inStockRecord); - if(res_inStock==1){ - List rawMaterialDetailList = - rawMaterialDetailService.selectListByWhere("where rawmaterial_id = '"+id+"' order by insdt "); - if(rawMaterialDetailList!=null && rawMaterialDetailList.size()>0){ - for(RawMaterialDetail rawMaterialDetail:rawMaterialDetailList){ - InStockRecordDetail inStockRecordDetail = new InStockRecordDetail(); - inStockRecordDetail.setId(rawMaterialDetail.getId()); - inStockRecordDetail.setGoodsId(rawMaterialDetail.getGoodsId()); - inStockRecordDetail.setInstockRecordId(inStockRecordId); - inStockRecordDetail.setInstockNumber(rawMaterialDetail.getRawmaterialNumber()); - inStockRecordDetail.setIncludeTaxratePrice(rawMaterialDetail.getIncludeTaxratePrice()); - inStockRecordDetail.setIncludeTaxrateTotalMoney(rawMaterialDetail.getIncludeTaxrateTotalMoney()); - inStockRecordDetail.setPrice(rawMaterialDetail.getPrice()); - inStockRecordDetail.setTotalMoney(rawMaterialDetail.getTotalMoney()); - inStockRecordDetail.setInsdt(CommUtil.nowDate()); - inStockRecordDetail.setInsuser(rawMaterial.getInsuser()); - inStockRecordDetail.setType(SparePartCommString.INSTOCK_OTHER); - //生成入库明细 - inStockRecordDetailService.save(inStockRecordDetail); - } - } - } - }catch(Exception e){ - System.out.println(e.getMessage()); - return 0; - } - } - //检验不通过 - else{ - rawMaterial.setStatus(SparePartCommString.STATUS_STOCK_FAIL); - } - } - int res =this.update(rawMaterial); - return res; - } - /** - * 启动药剂登记审核流程 - * @param - * @return - */ - @Transactional - public int startProcess(RawMaterial rawMaterial) { - try { - Map variables = new HashMap(); - if(!rawMaterial.getAuditManId().isEmpty()){ - variables.put("userIds", rawMaterial.getAuditManId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Raw_Material.getId()+"-"+rawMaterial.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(rawMaterial.getId(), rawMaterial.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - rawMaterial.setProcessid(processInstance.getId()); - rawMaterial.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res=this.update(rawMaterial); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(rawMaterial); - businessUnitRecord.sendMessage(rawMaterial.getAuditManId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 药剂登记审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid(),entity.getPassstatus()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - -} diff --git a/src/com/sipai/service/sparepart/ReturnStockRecordDetailService.java b/src/com/sipai/service/sparepart/ReturnStockRecordDetailService.java deleted file mode 100644 index 56e73cde..00000000 --- a/src/com/sipai/service/sparepart/ReturnStockRecordDetailService.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.ReturnStockRecordDetailDao; -import com.sipai.dao.sparepart.WarehouseDao; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.ReturnStockRecord; -import com.sipai.entity.sparepart.ReturnStockRecordDetail; -import com.sipai.entity.sparepart.PurchaseRecord; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class ReturnStockRecordDetailService implements CommService{ - @Resource - private ReturnStockRecordDetailDao returnStockRecordDetailDao; - @Resource - private UnitService unitService; - @Resource - private GoodsService goodsService; - @Resource - private ReturnStockRecordService returnStockRecordService; - - @Override - public ReturnStockRecordDetail selectById(String id) { - ReturnStockRecordDetail returnStockRecordDetail = returnStockRecordDetailDao.selectByPrimaryKey(id); - if (returnStockRecordDetail.getGoodsId() != null && !returnStockRecordDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(returnStockRecordDetail.getGoodsId()); - returnStockRecordDetail.setGoods(goods); - } - if (returnStockRecordDetail.getDeptId() != null && !returnStockRecordDetail.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(returnStockRecordDetail.getDeptId()); - returnStockRecordDetail.setDept(dept); - } - return returnStockRecordDetail; - } - - @Transactional - @Override - public int deleteById(String id) { - try { - ReturnStockRecordDetail returnStockRecordDetail = this.selectById(id); - int result = this.returnStockRecordDetailDao.deleteByPrimaryKey(id); - //删除退回入库记录明细时更新退回入库记录单总金额 - if (returnStockRecordDetail.getInstockRecordId() != null && !returnStockRecordDetail.getInstockRecordId().isEmpty()) { - ReturnStockRecord returnStockRecord = this.returnStockRecordService.selectById(returnStockRecordDetail.getInstockRecordId()); - this.returnStockRecordService.update(returnStockRecord); - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - @Override - public int save(ReturnStockRecordDetail returnStockRecordDetail) { - returnStockRecordDetail = this.updateTotalMoney(returnStockRecordDetail); - if (returnStockRecordDetail.getInstockRecordId() != null && !returnStockRecordDetail.getInstockRecordId().isEmpty()) { - List returnStockRecords = this.returnStockRecordService.selectListByWhere("where id = '"+returnStockRecordDetail.getInstockRecordId()+"'"); - if (returnStockRecords!=null && returnStockRecords.size()>0) { - ReturnStockRecord returnStockRecord = returnStockRecords.get(0); - this.returnStockRecordService.update(returnStockRecord); - } - } - return returnStockRecordDetailDao.insert(returnStockRecordDetail); - } - - @Override - public int update(ReturnStockRecordDetail returnStockRecordDetail) { - returnStockRecordDetail = this.updateTotalMoney(returnStockRecordDetail); - return returnStockRecordDetailDao.updateByPrimaryKeySelective(returnStockRecordDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - ReturnStockRecordDetail returnStockRecordDetail = new ReturnStockRecordDetail(); - returnStockRecordDetail.setWhere(wherestr); - List returnStockRecordDetails = returnStockRecordDetailDao.selectListByWhere(returnStockRecordDetail); - if (returnStockRecordDetails != null && returnStockRecordDetails.size()>0) { - for (ReturnStockRecordDetail item : returnStockRecordDetails) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - } - - } - return returnStockRecordDetails; - } - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - ReturnStockRecordDetail returnStockRecordDetail = new ReturnStockRecordDetail(); - returnStockRecordDetail.setWhere(wherestr); - ListreturnStockRecordDetails = this.selectListByWhere(wherestr); - int result = this.returnStockRecordDetailDao.deleteByWhere(returnStockRecordDetail); - //删除退回入库记录明细时更新退回入库记录单总金额 - if (returnStockRecordDetails!= null && returnStockRecordDetails.size()>0) { - if (returnStockRecordDetails.get(0).getInstockRecordId() != null && !returnStockRecordDetails.get(0).getInstockRecordId().isEmpty()) { - ReturnStockRecord returnStockRecord = this.returnStockRecordService.selectById(returnStockRecordDetails.get(0).getInstockRecordId()); - this.returnStockRecordService.update(returnStockRecord); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 退回入库明细保存时,更新每条明细的合计金额,更新退回入库单的总金额 - */ - public ReturnStockRecordDetail updateTotalMoney(ReturnStockRecordDetail returnStockRecordDetail) { - BigDecimal totalMoney = returnStockRecordDetail.getTotalMoney(); - if (null != returnStockRecordDetail.getInstockNumber() && null != returnStockRecordDetail.getPrice()) { - totalMoney = (returnStockRecordDetail.getInstockNumber()).multiply(returnStockRecordDetail.getPrice()); - } - returnStockRecordDetail.setTotalMoney(totalMoney); - return returnStockRecordDetail; - } -} diff --git a/src/com/sipai/service/sparepart/ReturnStockRecordService.java b/src/com/sipai/service/sparepart/ReturnStockRecordService.java deleted file mode 100644 index 3ee5dde1..00000000 --- a/src/com/sipai/service/sparepart/ReturnStockRecordService.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.activiti.engine.TaskService; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.sparepart.ReturnStockRecordDao; -import com.sipai.entity.sparepart.GoodsClass; -import com.sipai.entity.sparepart.ReturnStockRecord; -import com.sipai.entity.sparepart.ReturnStockRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class ReturnStockRecordService implements CommService{ - @Resource - private ReturnStockRecordDao returnStockRecordDao; - @Resource - private GoodsClassService goodsClassService; - @Resource - private WarehouseService warehouseService; - @Resource - private SubscribeService subscribeService; - @Resource - private ReturnStockRecordDetailService returnStockRecordDetailService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private UnitService unitService; - - @Override - public ReturnStockRecord selectById(String id) { - ReturnStockRecord returnStockRecord = returnStockRecordDao.selectByPrimaryKey(id); - if (null != returnStockRecord.getGoodsClassId() && !returnStockRecord.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(returnStockRecord.getGoodsClassId()); - returnStockRecord.setGoodsClass(goodsClass); - } - if (null != returnStockRecord.getWarehouseId() && !returnStockRecord.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(returnStockRecord.getWarehouseId()); - returnStockRecord.setWarehouse(warehouse); - } - if (null != returnStockRecord.getBizId() && !returnStockRecord.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(returnStockRecord.getBizId()); - returnStockRecord.setCompany(company); - } - if (null != returnStockRecord.getAuditManId() && !returnStockRecord.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(returnStockRecord.getAuditManId()); - returnStockRecord.setAuditManName(auditManName); - } - if (null != returnStockRecord.getInstockManId() && !returnStockRecord.getInstockManId().isEmpty()) { - String instockManName = this.subscribeService.getUserNamesByUserIds(returnStockRecord.getInstockManId()); - returnStockRecord.setInstockManName(instockManName); - } - return returnStockRecord; - } - - /** - * 删除退回入库单时同时删除退回入库记录明细,关联的流程 - */ - @Transactional - @Override - public int deleteById(String id) { - try { - ReturnStockRecord returnStockRecord = this.selectById(id); - this.returnStockRecordDetailService.deleteByWhere("where instock_record_id = '"+id+"'"); - String pInstancId = returnStockRecord.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return returnStockRecordDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Override - public int save(ReturnStockRecord returnStockRecord) { - return returnStockRecordDao.insert(returnStockRecord); - } - - @Override - public int update(ReturnStockRecord returnStockRecord) { - returnStockRecord = this.updateTotalMoney(returnStockRecord); - //审核通过的退回入库登记单,明细加到库存中 - if (returnStockRecord.getStatus().equals(SparePartCommString.STATUS_STOCK_FINISH)) { - int result = this.putInStock(returnStockRecord.getId()); - if (result == 0 ) { - return result; - } - } - return returnStockRecordDao.updateByPrimaryKeySelective(returnStockRecord); - } - - @Override - public List selectListByWhere(String wherestr) { - ReturnStockRecord returnStockRecord = new ReturnStockRecord(); - returnStockRecord.setWhere(wherestr); - List returnStockRecords = returnStockRecordDao.selectListByWhere(returnStockRecord); - for (ReturnStockRecord item: returnStockRecords) { - if (null != item.getGoodsClassId() && !item.getGoodsClassId().isEmpty()) { - GoodsClass goodsClass = this.goodsClassService.selectById(item.getGoodsClassId()); - item.setGoodsClass(goodsClass); - } - if (null != item.getBizId() && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (null != item.getWarehouseId() && !item.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(item.getWarehouseId()); - item.setWarehouse(warehouse); - } - if (null != item.getAuditManId()&& !item.getAuditManId().isEmpty()) { - String auditManName = this.subscribeService.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditManName(auditManName); - } - if (null !=item.getInstockManId() && !item.getInstockManId().isEmpty()) { - String instockManName = this.subscribeService.getUserNamesByUserIds(item.getInstockManId()); - item.setInstockManName(instockManName); - } - } - return returnStockRecords; - } - /** - * 删除退回入库单时同时删除退回入库记录明细,关联的流程 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - ReturnStockRecord returnStockRecord = new ReturnStockRecord(); - returnStockRecord.setWhere(wherestr); - List returnStockRecords = this.selectListByWhere(wherestr); - for (ReturnStockRecord item : returnStockRecords) { - this.returnStockRecordDetailService.deleteByWhere("where instock_record_id = '"+item.getId()+"'"); - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - return returnStockRecordDao.deleteByWhere(returnStockRecord); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 更新退回入库记录的总价 - */ - public ReturnStockRecord updateTotalMoney(ReturnStockRecord returnStockRecord) { - //在保存退回入库单时,将退回入库单明细的金额加起来,生成退回入库单的总金额 - BigDecimal totalMoney = new BigDecimal(0); - ListreturnStockRecordDetails = this.returnStockRecordDetailService.selectListByWhere("where instock_record_id = '"+returnStockRecord.getId()+"'"); - if (returnStockRecordDetails!= null && returnStockRecordDetails.size()>0) { - for (ReturnStockRecordDetail item : returnStockRecordDetails) { - if (item.getTotalMoney() != null) { - totalMoney = totalMoney.add(item.getTotalMoney()); - } - } - } - returnStockRecord.setTotalMoney(totalMoney); - return returnStockRecord; - } - /** - * 将审核完的退回入库登记单的明细物品放到库存中 - */ - public int putInStock (String returnStockRecordId) { - int result = 0; - ReturnStockRecord returnStockRecord = this.returnStockRecordDao.selectByPrimaryKey(returnStockRecordId); - ListrecordDetails = this.returnStockRecordDetailService.selectListByWhere("where instock_record_id = '"+returnStockRecordId+"'"); - if (recordDetails != null && recordDetails.size()>0) { - for (ReturnStockRecordDetail detail : recordDetails) {//Stock的selectListByWhere方法不用加where,mapper里已经有了 - Liststocks = this.stockService.selectListByWhere("goods_id = '"+detail.getGoodsId()+"' and warehouse_id ='"+returnStockRecord.getWarehouseId()+"'"); - //当同一个仓库中的库存中有相同的物品时,直接在物品上加数量和总价 - if (stocks !=null && stocks.size()>0) { - Stock stock = stocks.get(0); - BigDecimal stockNumber = stock.getNowNumber().add(detail.getInstockNumber()); - BigDecimal totalMoney = stock.getTotalMoney().add(detail.getTotalMoney()); - stock.setNowNumber(stockNumber); - stock.setTotalMoney(totalMoney); - stock = this.stockService.stockAlarm(stock); - result += this.stockService.update(stock); - //当库存中没有此类物品时,直接导入次物品数据 - }else { - Stock stock = new Stock(); - stock.setId(CommUtil.getUUID()); - stock.setInsdt(CommUtil.nowDate()); - stock.setInsuser(detail.getInsuser()); - stock.setBizId(returnStockRecord.getBizId()); - stock.setGoodsId(detail.getGoodsId()); - stock.setWarehouseId(returnStockRecord.getWarehouseId()); - stock.setNowNumber(detail.getInstockNumber()); - stock.setTotalMoney(detail.getTotalMoney()); - stock = this.stockService.stockAlarm(stock); - result += this.stockService.save(stock); - } - } - } - return result; - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - ReturnStockRecord returnStockRecord = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(returnStockRecord.getProcessid()).singleResult(); - if (task!=null) { - returnStockRecord.setStatus(task.getName()); - }else{ - returnStockRecord.setStatus(SparePartCommString.STATUS_STOCK_FINISH); - } - int res =this.update(returnStockRecord); - return res; - } - - -} diff --git a/src/com/sipai/service/sparepart/ScoreService.java b/src/com/sipai/service/sparepart/ScoreService.java deleted file mode 100644 index 0d4d11ad..00000000 --- a/src/com/sipai/service/sparepart/ScoreService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.ScoreDao; - -import com.sipai.entity.sparepart.Score; - -import com.sipai.tools.CommService; - -@Service -public class ScoreService implements CommService{ - @Resource - private ScoreDao scoreDao; - - - @Override - public Score selectById(String id) { - Score score = scoreDao.selectByPrimaryKey(id); - - return score; - } - - - - @Override - public int deleteById(String id) { - return scoreDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Score goods) { - return scoreDao.insert(goods); - } - - @Override - public int update(Score goods) { - return scoreDao.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - Score score = new Score(); - score.setWhere(wherestr); - List list = scoreDao.selectListByWhere(score); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Score score = new Score(); - score.setWhere(wherestr); - return scoreDao.deleteByWhere(score); - } - - -} diff --git a/src/com/sipai/service/sparepart/Score_copyService.java b/src/com/sipai/service/sparepart/Score_copyService.java deleted file mode 100644 index 84a94be3..00000000 --- a/src/com/sipai/service/sparepart/Score_copyService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.Score_copyDao; - -import com.sipai.entity.sparepart.Score_copy; - -import com.sipai.tools.CommService; - -@Service -public class Score_copyService implements CommService{ - @Resource - private Score_copyDao scoreDao1; - - - @Override - public Score_copy selectById(String id) { - Score_copy score = scoreDao1.selectByPrimaryKey(id); - - return score; - } - - - - @Override - public int deleteById(String id) { - return scoreDao1.deleteByPrimaryKey(id); - } - - @Override - public int save(Score_copy goods) { - return scoreDao1.insert(goods); - } - - @Override - public int update(Score_copy goods) { - return scoreDao1.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - Score_copy score = new Score_copy (); - score.setWhere(wherestr); - List list = scoreDao1.selectListByWhere(score); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Score_copy score = new Score_copy (); - score.setWhere(wherestr); - return scoreDao1.deleteByWhere(score); - } - - -} diff --git a/src/com/sipai/service/sparepart/SewageInputService.java b/src/com/sipai/service/sparepart/SewageInputService.java deleted file mode 100644 index 4e235086..00000000 --- a/src/com/sipai/service/sparepart/SewageInputService.java +++ /dev/null @@ -1,298 +0,0 @@ -package com.sipai.service.sparepart; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SewageInputDao; -import com.sipai.entity.sparepart.Sewage; -import com.sipai.entity.sparepart.SewageInput; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class SewageInputService implements CommService{ - @Resource - private SewageInputDao sewageInputDao; - @Resource - private UserService userService; - @Resource - private SewageService sewageService; - - @Override - public SewageInput selectById(String id) { - SewageInput sewageInput = sewageInputDao.selectByPrimaryKey(id); - - if(sewageInput.getInputUserid()!=null && !sewageInput.getInputUserid().isEmpty()){ - User inputUser = userService.getUserById(sewageInput.getInputUserid()); - sewageInput.setInputUser(inputUser); - } - if(sewageInput.getSewageId()!=null && !sewageInput.getSewageId().isEmpty()){ - List sewage = sewageService.selectListByWhere("where contract_number = '"+sewageInput.getSewageId()+"' "); - if(sewage!=null && sewage.size()>0){ - sewageInput.setSewage(sewage.get(0)); - } - } - return sewageInput; - } - - @Override - public int deleteById(String id) { - return sewageInputDao.deleteByPrimaryKey(id); - } - - @Override - public int save(SewageInput sewageInput) { - return sewageInputDao.insert(sewageInput); - } - - @Override - public int update(SewageInput sewageInput) { - return sewageInputDao.updateByPrimaryKeySelective(sewageInput); - } - - @Override - public List selectListByWhere(String wherestr) { - SewageInput sewageInput = new SewageInput(); - sewageInput.setWhere(wherestr); - List list = sewageInputDao.selectListByWhere(sewageInput); - for (SewageInput item : list) { - if(item.getInputUserid()!=null && !item.getInputUserid().isEmpty()){ - User inputUser = userService.getUserById(item.getInputUserid()); - item.setInputUser(inputUser); - } - if(item.getSewageId()!=null && !item.getSewageId().isEmpty()){ - List sewage = sewageService.selectListByWhere("where contract_number = '"+item.getSewageId()+"' "); - if(sewage!=null && sewage.size()>0){ - item.setSewage(sewage.get(0)); - } - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - SewageInput sewageInput = new SewageInput(); - sewageInput.setWhere(wherestr); - return sewageInputDao.deleteByWhere(sewageInput); - } - public List selectListByWhere4Pure(String wherestr) { - SewageInput sewageInput = new SewageInput(); - sewageInput.setWhere(wherestr); - List list = sewageInputDao.selectListByWhere(sewageInput); - return list; - } - - public void outExcelFun(HttpServletResponse response,String wherestr,String orderstr) throws IOException { - String fileName = "纳管企业数据录入表.xls"; - String title = "数据录入"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - // 生成并设置一个样式,用于注释 - HSSFCellStyle tipStyle = workbook.createCellStyle(); - tipStyle.setAlignment(HorizontalAlignment.CENTER); - tipStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont tipfont = workbook.createFont(); - tipfont.setColor(IndexedColors.RED.index); - tipfont.setBold(false); - tipfont.setFontHeightInPoints((short) 9); - // 把字体应用到当前的样式 - tipStyle.setFont(tipfont); - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 11); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - - - //产生表格表头 - String excelTitleStr = "编号,排污源,采样时间,填报人,COD,PH,氨氮,总磷,总氮,SS,BOD,色度"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 4000); - sheet.setColumnWidth(6, 4000); - sheet.setColumnWidth(7, 4000); - sheet.setColumnWidth(8, 4000); - sheet.setColumnWidth(9, 4000); - sheet.setColumnWidth(10, 4000); - sheet.setColumnWidth(11, 4000); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("纳管企业数据录入表"); - - List list = this.selectListByWhere(wherestr+orderstr); - int n = 1; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - SewageInput sewageInput = list.get(i); - HSSFRow listrow1 = sheet.createRow(i + 2); - listrow1.setHeight((short) 400); - HSSFCell listcell0 = listrow1.createCell(0); - listcell0.setCellStyle(listStyle); - listcell0.setCellValue(n++); - - HSSFCell listcell1 = listrow1.createCell(1); - listcell1.setCellStyle(listStyle); - if (sewageInput.getSewage() != null) { - listcell1.setCellValue(sewageInput.getSewage().getName()); - }else{ - listcell1.setCellValue(""); - } - - HSSFCell listcell2 = listrow1.createCell(2); - listcell2.setCellStyle(listStyle); - listcell2.setCellValue(sewageInput.getInputDt().substring(0, 16)); - - HSSFCell listcell3 = listrow1.createCell(3); - listcell3.setCellStyle(listStyle); - if (sewageInput.getInputUser() != null) { - listcell3.setCellValue(sewageInput.getInputUser().getCaption()); - }else{ - listcell3.setCellValue(""); - } - - HSSFCell listcell4 = listrow1.createCell(4); - listcell4.setCellStyle(listStyle); - listcell4.setCellValue(sewageInput.getInputCod()); - - HSSFCell listcell5 = listrow1.createCell(5); - listcell5.setCellStyle(listStyle); - listcell5.setCellValue(sewageInput.getInputPh()); - - HSSFCell listcell6 = listrow1.createCell(6); - listcell6.setCellStyle(listStyle); - listcell6.setCellValue(sewageInput.getInputAmmoniaNitrogen()); - - HSSFCell listcell7 = listrow1.createCell(7); - listcell7.setCellStyle(listStyle); - listcell7.setCellValue(sewageInput.getInputPhosphorus()); - - HSSFCell listcell8 = listrow1.createCell(8); - listcell8.setCellStyle(listStyle); - listcell8.setCellValue(sewageInput.getInputNitrogen()); - - HSSFCell listcell9 = listrow1.createCell(9); - listcell9.setCellStyle(listStyle); - listcell9.setCellValue(sewageInput.getInputSs()); - - HSSFCell listcell10 = listrow1.createCell(10); - listcell10.setCellStyle(listStyle); - listcell10.setCellValue(sewageInput.getInputBod()); - - HSSFCell listcell11 = listrow1.createCell(11); - listcell11.setCellStyle(listStyle); - listcell11.setCellValue(sewageInput.getInputChroma()); - - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } -} diff --git a/src/com/sipai/service/sparepart/SewageService.java b/src/com/sipai/service/sparepart/SewageService.java deleted file mode 100644 index da6f7b25..00000000 --- a/src/com/sipai/service/sparepart/SewageService.java +++ /dev/null @@ -1,705 +0,0 @@ -package com.sipai.service.sparepart; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.sparepart.SewageDao; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.jsyw.JsywPoint; -import com.sipai.entity.sparepart.Sewage; -import com.sipai.entity.sparepart.SewageInput; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.work.GroupTime; -import com.sipai.entity.work.GroupType; -import com.sipai.entity.work.Scheduling; -import com.sipai.service.company.CompanyService; -import com.sipai.service.jsyw.JsywPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class SewageService implements CommService{ - @Resource - private SewageDao SewageDao; - @Resource - private UnitService unitService; - @Resource - private CompanyService companyService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private SewageInputService sewageInputService; - - @Resource - private JsywPointService jsywPointService; - - @Override - public Sewage selectById(String id) { - Sewage sewage = SewageDao.selectByPrimaryKey(id); - sewage.setCompany(this.unitService.getCompById(sewage.getUnitId())); - List processSectionList = this.processSectionService.selectListByWhere("where code = '"+sewage.getProcessSectionId()+"' and unit_id = 'JSBZ'"); - if (processSectionList.size()>0) { - sewage.setProcessSection(processSectionList.get(0)); - } - List sewageInputList = this.sewageInputService.selectListByWhere("where sewage_id='"+sewage.getContractNumber()+"' order by insdt"); - if(sewageInputList!=null && sewageInputList.size()>0){ - sewage.set_input(true); - }else{ - sewage.set_input(false); - } - List jsywPointList = this.jsywPointService.selectListByWhere("where psname='"+sewage.getName()+"' order by update_date"); - if(jsywPointList!=null && jsywPointList.size()>0){ - sewage.set_point(true); - }else{ - sewage.set_point(false); - } - return sewage; - } - - @Override - public int deleteById(String id) { - return SewageDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Sewage sewage) { - return SewageDao.insert(sewage); - } - - @Override - public int update(Sewage sewage) { - return SewageDao.updateByPrimaryKeySelective(sewage); - } - - @Override - public List selectListByWhere(String wherestr) { - Sewage sewage = new Sewage(); - sewage.setWhere(wherestr); - List list = SewageDao.selectListByWhere(sewage); - for (Sewage item : list) { - item.setCompany(this.unitService.getCompById(item.getUnitId())); - List processSectionList = this.processSectionService.selectListByWhere("where code = '"+item.getProcessSectionId()+"' and unit_id = 'JSBZ'"); - if (processSectionList.size()>0) { - item.setProcessSection(processSectionList.get(0)); - } - List sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='"+item.getContractNumber()+"' order by insdt"); - if(sewageInputList!=null && sewageInputList.size()>0){ - item.set_input(true); - }else{ - item.set_input(false); - } - List jsywPointList = this.jsywPointService.selectListByWhere("where psname='"+item.getName()+"' order by update_date"); - if(jsywPointList!=null && jsywPointList.size()>0){ - item.set_point(true); - }else{ - item.set_point(false); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Sewage sewage = new Sewage(); - sewage.setWhere(wherestr); - return SewageDao.deleteByWhere(sewage); - } - public List selectDistinctCityByWhere(String wherestr) { - Sewage sewage = new Sewage(); - sewage.setWhere(wherestr); - List list = SewageDao.selectDistinctCityByWhere(sewage); - return list; - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } private String getBizId(String bizName) { - String bizId = ""; - List CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "' or name = '" + bizName + "' "); - if (CompanyList != null && CompanyList.size() > 0) { - bizId = CompanyList.get(0).getId(); - } else { - bizId = "9999"; - } - return bizId; - } - - public String readXls(InputStream input, String userId, String unitId) throws IOException { - System.out.println("导入纳管企业开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int sumNum = 0; - int failNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - if (null == row) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - Sewage sewage = new Sewage(); - - HSSFCell cell = row.getCell(1); - if (getStringVal(cell)==null) { - continue; - } - sewage.setContractNumber(getStringVal(cell)); - - cell = row.getCell(2); - System.out.println(getStringVal(cell)); - sewage.setContractOrder(Integer.parseInt(getStringVal(cell))); - - cell = row.getCell(3); - sewage.setName(getStringVal(cell)); - - cell = row.getCell(4); - sewage.setAddress(getStringVal(cell)); - cell = row.getCell(5); - sewage.setContractDate(getStringVal(cell)); - cell = row.getCell(6); - sewage.setUsername(getStringVal(cell)); - cell = row.getCell(7); - sewage.setPhone(getStringVal(cell)); - cell = row.getCell(8); - List processSectionList = this.processSectionService.selectListByWhere("where name = '"+getStringVal(cell)+"' and unit_id = 'JSBZ'"); - if (processSectionList.size()>0) { - sewage.setProcessSectionId(processSectionList.get(0)==null?"":processSectionList.get(0).getCode()); - } - cell = row.getCell(9); - sewage.setUnitId(this.getBizId(getStringVal(cell))); - cell = row.getCell(10); - sewage.setPermitNum(getStringVal(cell)); - cell = row.getCell(11); - sewage.setPlaneNum(getStringVal(cell)); - cell = row.getCell(12); - sewage.setEnvironmentNum(getStringVal(cell)); - cell = row.getCell(13); - sewage.setTrade(getStringVal(cell)); - cell = row.getCell(14); - sewage.setPermit(getStringVal(cell)); - cell = row.getCell(15); - sewage.setDisplacement(Integer.parseInt((getStringVal(cell)==null?"0":getStringVal(cell)))); - cell = row.getCell(16); - sewage.setStandard(getStringVal(cell)); - cell = row.getCell(17); - sewage.setCity(getStringVal(cell)); - cell = row.getCell(18); - sewage.setSocietyNumber(getStringVal(cell)); - cell = row.getCell(19); - sewage.setLongitudeLatitude(getStringVal(cell)); - cell = row.getCell(26); - sewage.setAttribute(getStringVal(cell)); - cell = row.getCell(27); - sewage.setRemark(getStringVal(cell)); - -// sewage.setVentNum(ventNum); - - sewage.setId(CommUtil.getUUID()); - - List selectListByWhere = this.selectListByWhere("where contract_number = '"+sewage.getContractNumber()+"'"); - if (selectListByWhere!=null&&selectListByWhere.size()>0) { - sewage.setId(selectListByWhere.get(0).getId()); - - int result = this.update(sewage); - if (result == 1) { - sumNum++; - } else { - failNum++; - } - }else { - - int result = this.save(sewage); - if (result == 1) { - sumNum++; - } else { - failNum++; - } - } - - } - } - String result = ""; - if (failNum > 0) { - result = "共导入" + (int) (sumNum + failNum) + "条记录!" + "其中失败" + failNum + "条!"; - } else { - result = "共导入" + sumNum + "条!"; - } - System.out.println(result); - - System.out.println("导入纳管企业结束=============" + CommUtil.nowDate()); - return result; - } - - public void outExcelFun(HttpServletResponse response) throws IOException { - String fileName = "金山排海工程有限公司纳管企业表.xls"; - String title = "纳管企业"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - // 生成并设置一个样式,用于注释 - HSSFCellStyle tipStyle = workbook.createCellStyle(); - tipStyle.setAlignment(HorizontalAlignment.CENTER); - tipStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont tipfont = workbook.createFont(); - tipfont.setColor(IndexedColors.RED.index); - tipfont.setBold(false); - tipfont.setFontHeightInPoints((short) 9); - // 把字体应用到当前的样式 - tipStyle.setFont(tipfont); - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 11); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - - - //产生表格表头 - String excelTitleStr = "序号,合同编号,合同顺序,单位名称,单位地址,合同到期日,联系人,联系电话,*所属泵站,*所属车间,排污许可证编号,雨、污水管平面图,环评报告/登记表/批复,所属行业,排水许可证(编号)复印件/申请表,实际日排量(吨/天),排放标准(排水许可证),管网所有权单位,统一社会信用代码,地址位置(经纬度),接入管网坐标-经度(度),接入管网坐标-经度(分),接入管网坐标-经度(秒),接入管网坐标-纬度(度),接入管网坐标-纬度(分),接入管网坐标-纬度(秒),管网属性(分流/合流),备注"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 4000); - sheet.setColumnWidth(6, 4000); - sheet.setColumnWidth(7, 4000); - sheet.setColumnWidth(8, 4000); - sheet.setColumnWidth(9, 4000); - sheet.setColumnWidth(10, 4000); - sheet.setColumnWidth(11, 4000); - sheet.setColumnWidth(12, 4000); - sheet.setColumnWidth(13, 4000); - sheet.setColumnWidth(14, 4000); - sheet.setColumnWidth(15, 4000); - sheet.setColumnWidth(16, 4000); - sheet.setColumnWidth(17, 4000); - sheet.setColumnWidth(18, 4000); - sheet.setColumnWidth(19, 4000); - sheet.setColumnWidth(20, 4000); - sheet.setColumnWidth(21, 4000); - sheet.setColumnWidth(22, 4000); - sheet.setColumnWidth(23, 4000); - sheet.setColumnWidth(24, 4000); - sheet.setColumnWidth(25, 4000); - sheet.setColumnWidth(26, 4000); - sheet.setColumnWidth(27, 4000); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("金山排海工程有限公司纳管企业表"); - // 说明 -// HSSFCell smcell = handRow.createCell(5); -// smcell.setCellStyle(tipStyle); -// smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。"); - - List list = this.selectListByWhere("where 1=1 order by contract_order asc"); - int n = 1; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - Sewage sewage = list.get(i); - HSSFRow listrow1 = sheet.createRow(i + 2); - listrow1.setHeight((short) 400); - HSSFCell listcell0 = listrow1.createCell(0); - listcell0.setCellStyle(listStyle); - listcell0.setCellValue(n++); - - HSSFCell listcell1 = listrow1.createCell(1); - listcell1.setCellStyle(listStyle); - listcell1.setCellValue(sewage.getContractNumber()); - - HSSFCell listcell2 = listrow1.createCell(2); - listcell2.setCellStyle(listStyle); - listcell2.setCellValue(sewage.getContractOrder()); - - HSSFCell listcell3 = listrow1.createCell(3); - listcell3.setCellStyle(listStyle); - listcell3.setCellValue(sewage.getName()); - - HSSFCell listcell4 = listrow1.createCell(4); - listcell4.setCellStyle(listStyle); - listcell4.setCellValue(sewage.getAddress()); - - HSSFCell listcell5 = listrow1.createCell(5); - listcell5.setCellStyle(listStyle); - listcell5.setCellValue(sewage.getContractDate()); - - HSSFCell listcell6 = listrow1.createCell(6); - listcell6.setCellStyle(listStyle); - listcell6.setCellValue(sewage.getUsername()); - - HSSFCell listcell7 = listrow1.createCell(7); - listcell7.setCellStyle(listStyle); - listcell7.setCellValue(sewage.getPhone()); - - HSSFCell listcell8 = listrow1.createCell(8); - listcell8.setCellStyle(listStyle); - if (sewage.getProcessSection() != null) { - listcell8.setCellValue(sewage.getProcessSection().getName()); - } else { - listcell8.setCellValue(""); - } - - HSSFCell listcell9 = listrow1.createCell(9); - listcell9.setCellStyle(listStyle); - if (sewage.getCompany() != null) { - listcell9.setCellValue(sewage.getCompany().getName()); - } else { - listcell9.setCellValue(""); - } - - HSSFCell listcell10 = listrow1.createCell(10); - listcell10.setCellStyle(listStyle); - listcell10.setCellValue(sewage.getPermitNum()); - - HSSFCell listcell11 = listrow1.createCell(11); - listcell11.setCellStyle(listStyle); - listcell11.setCellValue(sewage.getPlaneNum()); - - HSSFCell listcell12 = listrow1.createCell(12); - listcell12.setCellStyle(listStyle); - listcell12.setCellValue(sewage.getEnvironmentNum()); - - HSSFCell listcell13 = listrow1.createCell(13); - listcell13.setCellStyle(listStyle); - listcell13.setCellValue(sewage.getTrade()); - - HSSFCell listcell14 = listrow1.createCell(14); - listcell14.setCellStyle(listStyle); - listcell14.setCellValue(sewage.getPermit()); - - HSSFCell listcell15 = listrow1.createCell(15); - listcell15.setCellStyle(listStyle); - listcell15.setCellValue((sewage.getDisplacement()==null?0:sewage.getDisplacement())); - - HSSFCell listcell16 = listrow1.createCell(16); - listcell16.setCellStyle(listStyle); - listcell16.setCellValue(sewage.getStandard()); - - HSSFCell listcell17 = listrow1.createCell(17); - listcell17.setCellStyle(listStyle); - listcell17.setCellValue(sewage.getCity()); - - HSSFCell listcell18 = listrow1.createCell(18); - listcell18.setCellStyle(listStyle); - listcell18.setCellValue(sewage.getSocietyNumber()); - - HSSFCell listcell19 = listrow1.createCell(19); - listcell19.setCellStyle(listStyle); - listcell19.setCellValue(sewage.getLongitudeLatitude()); - - HSSFCell listcell20 = listrow1.createCell(20); - listcell20.setCellStyle(listStyle); - listcell20.setCellValue(""); - - HSSFCell listcell21 = listrow1.createCell(21); - listcell21.setCellStyle(listStyle); - listcell21.setCellValue(""); - - HSSFCell listcell22 = listrow1.createCell(22); - listcell22.setCellStyle(listStyle); - listcell22.setCellValue(""); - - HSSFCell listcell23 = listrow1.createCell(23); - listcell23.setCellStyle(listStyle); - listcell23.setCellValue(""); - - HSSFCell listcell24 = listrow1.createCell(24); - listcell24.setCellStyle(listStyle); - listcell24.setCellValue(""); - - HSSFCell listcell25 = listrow1.createCell(25); - listcell25.setCellStyle(listStyle); - listcell25.setCellValue(""); - - HSSFCell listcell26 = listrow1.createCell(26); - listcell26.setCellStyle(listStyle); - listcell26.setCellValue(sewage.getAttribute()); - - HSSFCell listcell27 = listrow1.createCell(27); - listcell27.setCellStyle(listStyle); - listcell27.setCellValue(sewage.getRemark()); - - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - /** - * 获取树,三层结构,processSection为根节点,sewage为子节点 - * @方法名:getTreeList - * @参数 @param - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List list) { - JSONArray list_result = new JSONArray(); - if(list!=null && list.size()>0){ - String processSectionId = null; - String unitId = null; - JSONObject root_childs = new JSONObject(); - JSONArray root_childlist = new JSONArray(); - JSONObject childs = new JSONObject(); - JSONArray childlist = new JSONArray(); - for(int i=0;i{ - @Resource - private StockCheckDetailDao stockCheckDetailDao; - @Resource - private GoodsService goodsService; - - @Override - public StockCheckDetail selectById(String id) { - StockCheckDetail stockCheckDetail = stockCheckDetailDao.selectByPrimaryKey(id); - if (stockCheckDetail.getGoodsId() != null && !stockCheckDetail.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(stockCheckDetail.getGoodsId()); - stockCheckDetail.setGoods(goods); - } - return stockCheckDetail; - } - - @Override - public int deleteById(String id) { - return stockCheckDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(StockCheckDetail stockCheckDetail) { - return stockCheckDetailDao.insert(stockCheckDetail); - } - - @Override - public int update(StockCheckDetail stockCheckDetail) { - return stockCheckDetailDao.updateByPrimaryKeySelective(stockCheckDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - StockCheckDetail stockCheckDetail = new StockCheckDetail(); - stockCheckDetail.setWhere(wherestr); - List list = stockCheckDetailDao.selectListByWhere(stockCheckDetail); - if (list != null && list.size()>0) { - for (StockCheckDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - } - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - StockCheckDetail stockCheckDetail = new StockCheckDetail(); - stockCheckDetail.setWhere(wherestr); - return stockCheckDetailDao.deleteByWhere(stockCheckDetail); - } -} diff --git a/src/com/sipai/service/sparepart/StockCheckService.java b/src/com/sipai/service/sparepart/StockCheckService.java deleted file mode 100644 index 3a1d95c5..00000000 --- a/src/com/sipai/service/sparepart/StockCheckService.java +++ /dev/null @@ -1,784 +0,0 @@ -package com.sipai.service.sparepart; - -import com.sipai.dao.sparepart.StockCheckDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentCodeRule; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.*; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.WeatherNew; -import com.sipai.entity.work.WeatherSaveName; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.activiti.engine.TaskService; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.BorderStyle; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.ss.usermodel.HorizontalAlignment; -import org.apache.poi.ss.usermodel.VerticalAlignment; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -import static org.apache.poi.ss.usermodel.CellType.STRING; - -@Service -public class StockCheckService implements CommService { - @Resource - private StockCheckDao stockCheckDao; - @Resource - private UnitService unitService; - @Resource - private WarehouseService warehouseService; - @Resource - private StockCheckDetailService stockCheckDetailService; - @Resource - private SubscribeService subscribeService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private StockService stockService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private TaskService taskService; - @Resource - private CompanyService companyService; - - - @Override - public StockCheck selectById(String id) { - StockCheck stockCheck = stockCheckDao.selectByPrimaryKey(id); - if (null != stockCheck) { - if (stockCheck.getBizId() != null && !stockCheck.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(stockCheck.getBizId()); - stockCheck.setCompany(company); - } - if (stockCheck.getWarehouseId() != null && !stockCheck.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(stockCheck.getWarehouseId()); - stockCheck.setWarehouse(warehouse); - } - if (stockCheck.getHandlerId() != null && !stockCheck.getHandlerId().isEmpty()) { - String handlerName = this.subscribeService.getUserNamesByUserIds(stockCheck.getHandlerId()); - stockCheck.setHandlerName(handlerName); - } - if (stockCheck.getAuditId() != null && !stockCheck.getAuditId().isEmpty()) { - String auditName = this.subscribeService.getUserNamesByUserIds(stockCheck.getAuditId()); - stockCheck.setAuditName(auditName); - } - } - return stockCheck; - } - - //删除盘点单时删掉关联的明细 - @Transactional - @Override - public int deleteById(String id) { - try { - StockCheck stockCheck = stockCheckDao.selectByPrimaryKey(id); - this.stockCheckDetailService.deleteByWhere("where check_id = '" + stockCheck.getId() + "'"); - String pInstancId = stockCheck.getProcessid(); - if (pInstancId != null && !pInstancId.isEmpty()) { - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - return stockCheckDao.deleteByPrimaryKey(id); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - @Transactional - @Override - public int save(StockCheck stockCheck) { - //库存盘点单新增后,根据厂区和仓库导入盘点的物品明细 - List stocks = this.stockService.selectListByWhere("biz_id = '" + stockCheck.getBizId() + "' and warehouse_id ='" + stockCheck.getWarehouseId() + "'"); - if (stocks != null && stocks.size() > 0) { - for (Stock stock : stocks) { - StockCheckDetail detail = new StockCheckDetail(); - detail.setId(CommUtil.getUUID()); - detail.setInsdt(CommUtil.nowDate()); - detail.setInsuser(stockCheck.getInsuser()); - detail.setCheckId(stockCheck.getId()); - detail.setGoodsId(stock.getGoodsId()); - detail.setAccountNumber(stock.getNowNumber()); - try { - detail.setPrice(stock.getIncludedTaxCostPrice()); - } catch (ArithmeticException e) { - detail.setPrice(new BigDecimal(0)); - } - this.stockCheckDetailService.save(detail); - } - } - return stockCheckDao.insert(stockCheck); - } - - @Override - public int update(StockCheck stockCheck) { - //库存盘点审核完成后,对差异数量自动生成入库和出库单 - if (stockCheck.getStatus().equals(SparePartCommString.STATUS_CHECK_FINISH)) { - this.launchInOrOutRecord(stockCheck); - } - return stockCheckDao.updateByPrimaryKeySelective(stockCheck); - } - - @Override - public List selectListByWhere(String wherestr) { - StockCheck stockCheck = new StockCheck(); - stockCheck.setWhere(wherestr); - List list = stockCheckDao.selectListByWhere(stockCheck); - for (StockCheck item : list) { - if (null != item.getBizId() && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (null != item.getWarehouseId() && !item.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(item.getWarehouseId()); - item.setWarehouse(warehouse); - } - if (null != item.getHandlerId() && !item.getHandlerId().isEmpty()) { - String handlerName = this.subscribeService.getUserNamesByUserIds(item.getHandlerId()); - item.setHandlerName(handlerName); - } - } - return list; - } - - //删除盘点单时删掉关联的明细 - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - StockCheck stockCheck = new StockCheck(); - stockCheck.setWhere(wherestr); - List list = stockCheckDao.selectListByWhere(stockCheck); - if (list != null && list.size() > 0) { - for (StockCheck item : list) { - this.stockCheckDetailService.deleteByWhere("where check_id = '" + item.getId() + "'"); - String pInstancId = item.getProcessid(); - if (pInstancId != null && !pInstancId.isEmpty()) { - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - } - } - return stockCheckDao.deleteByWhere(stockCheck); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - /** - * 对盘点的差异数量,直接生成入库单或出库单,发起审核,达到账物一致 - * - * @param stockCheck - * @param - * @return - */ - public String launchInOrOutRecord(StockCheck stockCheck) { - Company company = companyService.selectByPrimaryKey(stockCheck.getBizId()); - List details = this.stockCheckDetailService.selectListByWhere("where check_id = '" + stockCheck.getId() + "'"); - //生成一个临时入库单 - InStockRecord inStockRecord = new InStockRecord(); - inStockRecord.setId(company.getEname() + "-PDRK-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", "")); - inStockRecord.setInsuser(stockCheck.getInsuser()); - inStockRecord.setInsdt(CommUtil.nowDate()); - inStockRecord.setInstockDate(CommUtil.nowDate()); - inStockRecord.setBizId(stockCheck.getBizId()); - inStockRecord.setWarehouseId(stockCheck.getWarehouseId()); - inStockRecord.setInstockManId(stockCheck.getInsuser()); - inStockRecord.setAuditManId(stockCheck.getInsuser()); - inStockRecord.setFareAdjustment(1); - inStockRecord.setVatInvoice(0); - - //生成一个临时出库单 - OutStockRecord outStockRecord = new OutStockRecord(); - outStockRecord.setId(company.getEname() + "-PDCK-" + CommUtil.nowDate().replaceAll("[[\\s-:punct:]]", "")); - outStockRecord.setInsuser(stockCheck.getInsuser()); - outStockRecord.setInsdt(CommUtil.nowDate()); - outStockRecord.setOutDate(CommUtil.nowDate()); - outStockRecord.setBizId(stockCheck.getBizId()); - outStockRecord.setWarehouseId(stockCheck.getWarehouseId()); - outStockRecord.setUserId(stockCheck.getInsuser()); - outStockRecord.setAuditManId(stockCheck.getInsuser()); - - BigDecimal outTotalMoney = new BigDecimal("0"); - - int inResult = 0, outResult = 0; - if (details != null && !details.isEmpty()) { - for (StockCheckDetail detail : details) { - List stocks = stockService.selectListByWhere(" s.goods_id = '" + detail.getGoodsId() + "'" + - " and warehouse_id = '" + stockCheck.getWarehouseId() + - "' and included_tax_cost_price = " + detail.getPrice()); - Warehouse warehouse = warehouseService.selectById(stockCheck.getWarehouseId()); - //如果盘点差异数量大于零,生成入库单账面库存增加,小于零的生成出库单 - if (detail.getDifferenceNumber().compareTo(BigDecimal.ZERO) == 1) { - InStockRecordDetail inDetail = new InStockRecordDetail(); - inDetail.setId(CommUtil.getUUID()); - inDetail.setInsdt(CommUtil.nowDate()); - inDetail.setInsuser(inStockRecord.getInsuser()); - inDetail.setInstockRecordId(inStockRecord.getId()); - inDetail.setGoodsId(detail.getGoodsId()); - inDetail.setInstockNumber(detail.getDifferenceNumber()); - inDetail.setNowNumber(detail.getDifferenceNumber()); - inDetail.setIncludeTaxratePrice(new BigDecimal("0")); - inDetail.setIncludeTaxrateTotalMoney(new BigDecimal("0")); - inDetail.setPrice(new BigDecimal("0")); - inDetail.setTotalMoney(new BigDecimal("0")); -// if (stocks != null && stocks.size() > 0) { -// // 拿取最新的入库单的不含税单价 不过盘点的是没有发票的为什么会有不含税单价的呢 -// InStockRecordDetail inStockRecordDetail = inStockRecordDetailService.selectTopByWhereWithRecord("where tsi.status = '" + SparePartCommString.STATUS_STOCK_FINISH + "'" + -// " and tsd.goods_id = '" + detail.getGoodsId() + "' and tsi.warehouse_id = '" + stockCheck.getWarehouseId() + "'" + -// " and tsd.include_taxrate_price = "+ stocks.get(0).getIncludedTaxCostPrice() +" order by insdt desc"); -// if (inStockRecordDetail != null) { -// inDetail.setPrice(inStockRecordDetail.getPrice()); -// } else { -// inDetail.setPrice(stocks.get(0).getCostPrice()); -// } -// inDetail.setTotalMoney(inDetail.getPrice().multiply(inDetail.getInstockNumber())); -// inDetail.setIncludeTaxratePrice(stocks.get(0).getIncludedTaxCostPrice()); -// inDetail.setIncludeTaxrateTotalMoney(stocks.get(0).getIncludedTaxCostPrice().multiply(inDetail.getInstockNumber())); -// } - inResult += this.inStockRecordDetailService.save(inDetail); - } else if (detail.getDifferenceNumber().compareTo(BigDecimal.ZERO) == -1) { - OutStockRecordDetail outDetail = new OutStockRecordDetail(); - outDetail.setId(CommUtil.getUUID()); - outDetail.setInsdt(CommUtil.nowDate()); - outDetail.setInsuser(outStockRecord.getInsuser()); - outDetail.setOutstockRecordId(outStockRecord.getId()); - outDetail.setGoodsId(detail.getGoodsId()); - outDetail.setOutNumber(detail.getDifferenceNumber().abs()); - outDetail.setStockId(stocks.get(0).getId()); - outDetail.setIncludedTaxCostPrice(detail.getPrice()); - outDetail.setIncludedTaxTotalMoney(outDetail.getOutNumber().multiply(stocks.get(0).getIncludedTaxCostPrice())); - if (warehouse.getOutboundType() == SparePartCommString.F_IN_OUT) { - outStockRecordService.updateIODeatilByPrice(outDetail.getOutNumber(), outDetail.getIncludedTaxCostPrice(), outDetail); - } else { - outDetail.setPrice(stocks.get(0).getCostPrice()); - outDetail.setTotalMoney(outDetail.getOutNumber().multiply(stocks.get(0).getCostPrice())); - } - outTotalMoney = outTotalMoney.add(outDetail.getIncludedTaxTotalMoney()); - outResult += this.outStockRecordDetailService.save(outDetail); - } - stocks.get(0).setRealNumber(detail.getRealNumber()); - stockService.update(stocks.get(0)); - } - } - if (inResult > 0) { - inStockRecord.setStatus(SparePartCommString.STATUS_STOCK_AUDIT); - this.inStockRecordService.save(inStockRecord); - this.inStockRecordService.startProcess(inStockRecord); - } - if (outResult > 0) { - outStockRecord.setTotalMoney(outTotalMoney); - outStockRecord.setStatus(SparePartCommString.STATUS_STOCK_AUDIT); - this.outStockRecordService.onlySave(outStockRecord); - this.outStockRecordService.startProcess(outStockRecord); - } - return "result"; - } - - /** - * 导出库存盘点表,浏览器中直接下载 - * - * @param response - * @param - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void exportStockCheckExcel(HttpServletResponse response, StockCheck stockCheck, List stockCheckDetails) throws IOException { - String fileName = "库存盘点表.xls"; - String title = "库存盘点表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 8500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 4500); - sheet.setColumnWidth(5, 3500); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String[] excelTitle = {"序号", "物品编号", "物品名称", "规格型号", "品牌", "单位", "单价", "账面数量", "盘点数量",}; - HSSFRow row = sheet.createRow(3); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(stockCheck.getCompany().getName() + "库存盘点表"); - - // 第二行仓库 - HSSFRow subhand = sheet.createRow(1); - HSSFCell subcell = subhand.createCell(5); - subcell.setCellValue("所属仓库:"); - subcell = subhand.createCell(6); - subcell.setCellValue(stockCheck.getWarehouse().getName()); - // 第三行时间 - HSSFRow dateRow = sheet.createRow(2); - HSSFCell datecell = dateRow.createCell(5); - datecell.setCellValue("盘点月份:"); - datecell = dateRow.createCell(6); - datecell.setCellValue(stockCheck.getNowTime().substring(0, 7)); - //遍历集合数据,产生数据行 - for (int i = 0; i < stockCheckDetails.size(); i++) { - row = sheet.createRow(i + 4); - //填充列数据,若果数据有不同的格式请注意匹配转换 - HSSFCell cellk = row.createCell(0); - cellk.setCellStyle(listStyle); - cellk.setCellValue(i + 1); - - cellk = row.createCell(1); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getGoods().getId()); - - cellk = row.createCell(2); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getGoods().getName()); - - cellk = row.createCell(3); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getGoods().getModel()); - - cellk = row.createCell(4); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getGoods().getBrand()); - - cellk = row.createCell(5); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getGoods().getUnit()); - - cellk = row.createCell(6); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getPrice().doubleValue()); - - cellk = row.createCell(7); - cellk.setCellStyle(listStyle); - cellk.setCellValue(stockCheckDetails.get(i).getAccountNumber().doubleValue()); - - cellk = row.createCell(8); - cellk.setCellStyle(listStyle); - cellk.setCellValue(""); - - } - try { - response.reset(); - response.setContentType("application/x-msdownload"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - /** - * 启动库存盘点审核流程 - * - * @param - * @return - */ - @Transactional - public int startProcess(StockCheck stockCheck) { - try { - Map variables = new HashMap(); - if (!stockCheck.getAuditId().isEmpty()) { - variables.put("userIds", stockCheck.getAuditId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Stock_Check.getId() + "-" + stockCheck.getBizId()); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(stockCheck.getId(), stockCheck.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - stockCheck.setProcessid(processInstance.getId()); - stockCheck.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(stockCheck.getProcessid()).singleResult(); - stockCheck.setStatus(task.getName()); - int res = this.update(stockCheck); - if (res == 1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(stockCheck); - businessUnitRecord.sendMessage(stockCheck.getAuditId(), ""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * 根据当前任务节点更新状态 - */ - public int updateStatus(String id) { - StockCheck stockCheck = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(stockCheck.getProcessid()).singleResult(); - if (task != null) { - stockCheck.setStatus(task.getName()); - } else { - stockCheck.setStatus(SparePartCommString.STATUS_CHECK_FINISH); - } - int res = this.update(stockCheck); - return res; - } - - /** - * 库存盘点审核 - * - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /** - * xls文件导入 - * - * @param input - * @return - * @throws IOException - */ - public String readXls(InputStream input, String checkId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - String res = ""; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - //如果表头小于7列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 7) { - continue; - } - for (int rowNum = 4; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头,读取数据从rowNum+3行开始 - HSSFRow row = sheet.getRow(rowNum); - // 第一列表名 第二列仓库 第三列月份 所以从第四列开始 - int minCellNum = 0; - int maxCellNum = row.getLastCellNum();//最后一列 - StockCheckDetail stockCheckDetail = new StockCheckDetail(); - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - try { - switch (i) { - // 序号 - case 0: - stockCheckDetail.setSort(getStringVal(cell)); - break; - // 物品编号 - case 1: - stockCheckDetail.setGoodsId(getStringVal(cell)); - break; - // 账面数量 - case 7: - stockCheckDetail.setAccountNumber(new BigDecimal(getStringVal(cell))); - break; - // 盘点数量 - case 8: - stockCheckDetail.setRealNumber(new BigDecimal(getStringVal(cell))); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - List stockCheckDetails = stockCheckDetailService.selectListByWhere("where check_id = '" + checkId + "' " + - "and goods_id = '" + stockCheckDetail.getGoodsId() + "'"); - if (stockCheckDetails != null && stockCheckDetails.size() > 0) { - stockCheckDetails.get(0).setDifferenceNumber(stockCheckDetail.getRealNumber().subtract(stockCheckDetail.getAccountNumber())); - stockCheckDetails.get(0).setRealNumber(stockCheckDetail.getRealNumber()); - stockCheckDetailService.update(stockCheckDetails.get(0)); - } else { - res += "序号(" + stockCheckDetail.getSort() + ")"; - } - } - } - - String result = ""; - if (StringUtils.isBlank(res)) { - result = "导入成功!"; - } else { - res += "数据异常 请检查数据后重试!"; - result = res; - } - return result; - } - - - /** - * xlsx文件导入 - * - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsx(InputStream input, String checkId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - String res = ""; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(2); - //如果表头小于7列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 7) { - continue; - } - for (int rowNum = 4; rowNum <= sheet.getLastRowNum(); rowNum++) { - XSSFRow row = sheet.getRow(rowNum); - int minCellNum = row.getFirstCellNum();//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - StockCheckDetail stockCheckDetail = new StockCheckDetail(); - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell cell = row.getCell(i); - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - try { - switch (i) { - // 序号 - case 0: - stockCheckDetail.setSort(getStringVal(cell)); - break; - // 物品编号 - case 1: - stockCheckDetail.setGoodsId(getStringVal(cell)); - break; - // 账面数量 - case 7: - stockCheckDetail.setAccountNumber(new BigDecimal(getStringVal(cell))); - break; - // 盘点数量 - case 8: - stockCheckDetail.setRealNumber(new BigDecimal(getStringVal(cell))); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - List stockCheckDetails = stockCheckDetailService.selectListByWhere("where check_id = '" + checkId + "' " + - "and goods_id = '" + stockCheckDetail.getGoodsId() + "'"); - if (stockCheckDetails != null && stockCheckDetails.size() > 0) { - stockCheckDetails.get(0).setDifferenceNumber(stockCheckDetail.getRealNumber().subtract(stockCheckDetail.getAccountNumber())); - stockCheckDetails.get(0).setRealNumber(stockCheckDetail.getRealNumber()); - stockCheckDetailService.update(stockCheckDetails.get(0)); - } else { - res += "序号(" + stockCheckDetail.getSort() + ")"; - } - } - } - String result = ""; - if (StringUtils.isBlank(res)) { - result = "导入成功!"; - } else { - res += "数据异常 请检查数据后重试!"; - result = res; - } - return result; - } - - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - -} diff --git a/src/com/sipai/service/sparepart/StockService.java b/src/com/sipai/service/sparepart/StockService.java deleted file mode 100644 index 9b4ae26d..00000000 --- a/src/com/sipai/service/sparepart/StockService.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.sparepart.*; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.StockDao; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.RoleService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class StockService implements CommService{ - @Resource - private StockDao stockDao; - @Resource - private GoodsService goodsService; - @Resource - private UnitService unitService; - @Resource - private WarehouseService warehouseService; - @Resource - private MsgServiceImpl msgService; - @Resource - private RoleService roleService; - @Resource - private SubscribeService subscribeService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private InStockRecordService inStockRecordService; - @Resource - private InStockRecordDetailService inStockRecordDetailService; - @Resource - private OutStockRecordService outStockRecordService; - @Resource - private OutStockRecordDetailService outStockRecordDetailService; - @Resource - private GoodsReserveService goodsReserveService; - - - private final String MsgType_Both ="StockAlarm"; - - @Override - public Stock selectById(String id) { - try { - Stock stock = stockDao.selectByPrimaryKey(id); - if (stock.getGoodsId() != null && !stock.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(stock.getGoodsId()); - stock.setGoods(goods); - } - if (stock.getBizId() != null && !stock.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(stock.getBizId()); - stock.setCompany(company); - } - if (stock.getWarehouseId() != null && !stock.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(stock.getWarehouseId()); - stock.setWarehouse(warehouse); - } - return stock; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - @Override - public int deleteById(String id) { - return stockDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Stock stock) { - return stockDao.insert(stock); - } - - @Override - public int update(Stock stock) { - return stockDao.updateByPrimaryKeySelective(stock); - } - - @Override - public List selectListByWhere(String wherestr) { - Stock stock = new Stock(); - stock.setWhere(wherestr); - List list = stockDao.selectListByWhere(stock); - for (Stock item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - item.setGoods(goods); - // 入库时间 - List inStockRecordDetails = inStockRecordDetailService.selectListByWhere("where now_number > 0 and include_taxrate_price = " + item.getIncludedTaxCostPrice() + " order by insdt asc"); - if (inStockRecordDetails != null && inStockRecordDetails.size() > 0) { - item.setDate(inStockRecordDetails.get(0).getInsdt()); - } else { - item.setDate(item.getInsdt()); - } - } - if (item.getBizId() != null && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (item.getWarehouseId() != null && !item.getWarehouseId().isEmpty()) { - Warehouse warehouse = this.warehouseService.selectById(item.getWarehouseId()); - item.setWarehouse(warehouse); - } - List goodsReserveList = goodsReserveService.selectListByWhere("where biz_id = '" + item.getBizId() + "' and pid = '" + item.getGoodsId() + "'"); - for (GoodsReserve goodsReserve : goodsReserveList) { - item.setMax(String.valueOf(goodsReserve.getMax())); - item.setMin(String.valueOf(goodsReserve.getMin())); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Stock stock = new Stock(); - stock.setWhere(wherestr); - return stockDao.deleteByWhere(stock); - } - /** - * 库存报警 - * @param stock - * @return - */ - public Stock stockAlarm(Stock stock){ - if (null == stock.getAlarmStatus()) { - stock.setAlarmStatus(SparePartCommString.STATUS_STOCK_NORMAL); - } - //当前库存数量 - BigDecimal stockNumber = stock.getNowNumber(); - if (null != stock.getGoodsId()&&null != stock.getWarehouseId() && null != stockNumber) { - Warehouse warehouse = this.warehouseService.selectById(stock.getWarehouseId()); - List goodsReserveList = goodsReserveService.selectListByWhere("where pid = '" + stock.getGoodsId() + "' and biz_id = '" + stock.getBizId() + "'"); - if(goodsReserveList != null && goodsReserveList.size() > 0){ - GoodsReserve goodsReserve = goodsReserveList.get(0); - //最小存储量 - BigDecimal minReserve = new BigDecimal(goodsReserve.getMin()); - String content = ""; - boolean flag = false; - - if (minReserve != null && goodsReserve.getMinStatus() == 1 && (stockNumber.compareTo(minReserve) == - 1 || stockNumber.compareTo(minReserve) == 0)) {//库存低于最小值 - content = warehouse.getName()+stock.getGoods().getName() - +"库存为"+stock.getNowNumber()+"低于库存最小值,请及时补充库存!"; - //自动生成采购清单 - Subscribe subscribe = new Subscribe(); - Company company = this.unitService.getCompById(stock.getBizId()); - String id = company.getEname()+"-BMSG-"+CommUtil.nowDate().replaceAll("[[\\s-:punct:]]",""); - subscribe.setId(id); - subscribe.setInsdt(CommUtil.nowDate()); - subscribe.setBizId(stock.getBizId()); - subscribe.setDeptId(stock.getBizId()); - subscribe.setSubscribeDate(CommUtil.nowDate()); - subscribe.setInsuser(stock.getInsuser()); - subscribe.setSubscribeManId(stock.getInsuser()); - subscribe.setStatus(SparePartCommString.STATUS_START); - int result = subscribeService.save(subscribe); - if(result>0){ - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setInsdt(CommUtil.nowDate()); - subscribeDetail.setSubscribeId(id); - subscribeDetail.setGoodsId(stock.getGoodsId()); - subscribeDetailService.save(subscribeDetail); - } - flag = true; - } - //最大存储量 - BigDecimal maxReserve = new BigDecimal(goodsReserve.getMax()); - if (maxReserve != null && goodsReserve.getMinStatus() == 1 && (stockNumber.compareTo(maxReserve) == 0 || stockNumber.compareTo(maxReserve) == 1)) {//库存高于最大值 - content = warehouse.getName()+stock.getGoods().getName() - +"库存为"+stock.getNowNumber()+"高于库存最大值,请及时解决库存压力!"; - flag = true; - } - List users =roleService.getRoleUsers("where serial='"+PatrolType.Administrator.getId()+"' and bizid='"+stock.getBizId()+"'"); - String userIds=""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds+=","; - } - userIds+=user.getId(); - } - if (flag) { - //库存由正常变为报警,第一次发送消息,后面继续报警不发消息 - if (SparePartCommString.STATUS_STOCK_NORMAL.equals(stock.getAlarmStatus())) { - msgService.insertMsgSend(MsgType_Both, content, userIds, "emp01", "U"); - stock.setAlarmStatus(SparePartCommString.STATUS_STOCK_ALARM); - } - - }else { - //库存由报警变为正常,第一次发送消息,后面不发消息 - if (SparePartCommString.STATUS_STOCK_ALARM.equals(stock.getAlarmStatus())) { - content = warehouse.getName()+stock.getGoods().getName()+"库存报警已解除!"; - msgService.insertMsgSend(MsgType_Both, content, userIds, "emp01", "U"); - stock.setAlarmStatus(SparePartCommString.STATUS_STOCK_NORMAL); - } - } - } - } - return stock; - } - public Stock numberTotal(String SQL) { - return stockDao.numberTotal(SQL); - } - public Stock RecordTotal(String SQL) { - return stockDao.RecordTotal(SQL); - } - public Stock ContractTotal(String SQL) { - return stockDao.ContractTotal(SQL); - } - public List StocktypeTotal(String SQL) { - return stockDao.StocktypeTotal(SQL); - } - public Stock RecordDurationTotal(String SQL) { - return stockDao.RecordDurationTotal(SQL); - } - public Stock MaintenanceWorkinghoursTotal(String SQL) { - return stockDao.MaintenanceWorkinghoursTotal(SQL); - } - public Stock maxTotal(String SQL) { - return stockDao.maxTotal(SQL); - } - - -} diff --git a/src/com/sipai/service/sparepart/StockTransfersApplyDetailService.java b/src/com/sipai/service/sparepart/StockTransfersApplyDetailService.java deleted file mode 100644 index 7395e5d3..00000000 --- a/src/com/sipai/service/sparepart/StockTransfersApplyDetailService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.StockTransfersApplyDetailDao; -import com.sipai.entity.sparepart.StockTransfersApplyDetail; -import com.sipai.tools.CommService; -@Service -public class StockTransfersApplyDetailService implements CommService{ - - @Resource - private StockTransfersApplyDetailDao stockTransfersApplyDetailDao; - - @Override - public StockTransfersApplyDetail selectById(String t) { - StockTransfersApplyDetail stad=stockTransfersApplyDetailDao.selectByPrimaryKey(t); - return stad; - } - - @Override - public int deleteById(String t) { - int resultNum=stockTransfersApplyDetailDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(StockTransfersApplyDetail t) { - int resultNum=stockTransfersApplyDetailDao.insert(t); - return resultNum; - } - - @Override - public int update(StockTransfersApplyDetail t) { - int resultNum=stockTransfersApplyDetailDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - StockTransfersApplyDetail stad=new StockTransfersApplyDetail(); - stad.setWhere(t); - return stockTransfersApplyDetailDao.selectListByWhere(stad); - } - - @Override - public int deleteByWhere(String t) { - StockTransfersApplyDetail stad=new StockTransfersApplyDetail(); - stad.setWhere(t); - int resultNum=stockTransfersApplyDetailDao.deleteByWhere(stad); - return resultNum; - } - -} diff --git a/src/com/sipai/service/sparepart/SubscribeDetailService.java b/src/com/sipai/service/sparepart/SubscribeDetailService.java deleted file mode 100644 index 76d3f88c..00000000 --- a/src/com/sipai/service/sparepart/SubscribeDetailService.java +++ /dev/null @@ -1,2924 +0,0 @@ -package com.sipai.service.sparepart; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.DVConstraint; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataValidation; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFName; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.sparepart.SubscribeDetailDao; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentCodeRule; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.PurchaseRecordDetail; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class SubscribeDetailService implements CommService{ - @Resource - private GoodsService goodsService; - @Resource - private SubscribeDetailDao subscribeDetailDao; - @Resource - private SubscribeService subscribeService; - @Resource - private PurchaseRecordDetailService purchaseRecordDetailService; - @Resource - private ChannelsService channelsService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private ProcessSectionService processSectionService; - - @Override - public SubscribeDetail selectById(String id) { - SubscribeDetail subscribeDetail = subscribeDetailDao.selectByPrimaryKey(id); - if (subscribeDetail.getGoodsId() != null && !subscribeDetail.getGoodsId() .isEmpty()) { - Goods goods = this.goodsService.selectById(subscribeDetail.getGoodsId()); - if(goods!=null){ - subscribeDetail.setGoods(goods); - if(subscribeDetail.getBrand()!=null && !subscribeDetail.getBrand().isEmpty() - && goods.getBrand()!=null && !goods.getBrand().isEmpty()){ - subscribeDetail.setBrand(goods.getBrand()); - } - } - } - if (subscribeDetail.getSubscribeId() != null && !subscribeDetail.getSubscribeId().isEmpty()) { - Subscribe subscribe = this.subscribeService.selectById(subscribeDetail.getSubscribeId()); - subscribeDetail.setSubscribe(subscribe); - } - if (subscribeDetail.getChannelsid() != null && !subscribeDetail.getChannelsid().isEmpty()) { - String[] channelsids = subscribeDetail.getChannelsid().split(","); - String channelsNames = ""; - for(int i=0;i selectListByWhere(String wherestr) { - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setWhere(wherestr); - List list = subscribeDetailDao.selectListByWhere(subscribeDetail); - if (list != null && list.size()>0) { - for (SubscribeDetail item : list) { - if (item.getGoodsId() != null && !item.getGoodsId().isEmpty()) { - Goods goods = this.goodsService.selectById(item.getGoodsId()); - if(goods!=null){ - item.setGoods(goods); -// if(item.getBrand()!=null && !item.getBrand().isEmpty() -// && goods.getBrand()!=null && !goods.getBrand().isEmpty()){ -// item.setBrand(goods.getBrand()); -// } - } - } - if (item.getSubscribeId() != null && !item.getSubscribeId().isEmpty()) { - List subscribes = this.subscribeService.selectListByWhere("where id = '"+item.getSubscribeId()+"'"); - if (subscribes != null && subscribes.size()>0) { - item.setSubscribe(subscribes.get(0)); - } - } - if (item.getChannelsid() != null && !item.getChannelsid().isEmpty()) { - String[] channelsids = item.getChannelsid().split(","); - String channelsNames = ""; - for(int i=0;i selectDetailByBizId(String wherestr) { - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setWhere(wherestr); - List list = subscribeDetailDao.selectDetailByBizId(subscribeDetail); - return list; - } - - public int updateGoodsIdByWhere(SubscribeDetail data) { - return subscribeDetailDao.updateGoodsIdByWhere(data); - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setWhere(wherestr); - ListsubscribeDetails = this.selectListByWhere(wherestr); - int result = this.subscribeDetailDao.deleteByWhere(subscribeDetail); - //删除申购明细时更新申购单总金额 - if (subscribeDetails!= null && subscribeDetails.size()>0) { - if (subscribeDetails.get(0).getSubscribeId() != null && !subscribeDetails.get(0).getSubscribeId().isEmpty()) { - Subscribe subscribe = this.subscribeService.selectById(subscribeDetails.get(0).getSubscribeId()); - this.subscribeService.update(subscribe); - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - - - /** - * 更新申购明细的数量或单价,同时更新明细的合计金额和申购单的总金额 - */ - @Transactional - public int updateTotalMoney(SubscribeDetail subscribeDetail,String number ,String price) { - try { - if (null != number && !number.isEmpty()) { - BigDecimal numberbBigDecimal = new BigDecimal(number); - subscribeDetail.setNumber(numberbBigDecimal); - } - if (null != price && !price.isEmpty()) { - BigDecimal pricebBigDecimal = new BigDecimal(price); - subscribeDetail.setPrice(pricebBigDecimal); - } - BigDecimal totalMoney = subscribeDetail.getTotalMoney(); - totalMoney = (subscribeDetail.getNumber()).multiply(subscribeDetail.getPrice()); - subscribeDetail.setTotalMoney(totalMoney); - int result = this.update(subscribeDetail); - if (result == 1) { - if (subscribeDetail.getSubscribeId() != null && !subscribeDetail.getSubscribeId().isEmpty()) { - List subscribes = this.subscribeService.selectListByWhere("where id = '"+subscribeDetail.getSubscribeId()+"'"); - if (subscribes!=null && subscribes.size()>0) { - Subscribe subscribe = this.subscribeService.selectById(subscribeDetail.getSubscribeId()); - this.subscribeService.update(subscribe); - } - } - } - return result; - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - - } - /** - * 判断string字符串是否在数组中 - * @param arr - * @param str - * @return - */ - public boolean isInArray(String[] arr,String str){ - return Arrays.asList(arr).contains(str); - } - /** - * 计算采购计划明细的可用数量 - */ - public BigDecimal getUsableNumber( String subscribeDetailId){ - // - List recordDetails = this.purchaseRecordDetailService.selectListByWhere("where subscribe_detail_id = '"+subscribeDetailId+"'"); - BigDecimal usedNumber = new BigDecimal(0); - if (recordDetails != null && recordDetails.size()>0) { - for (PurchaseRecordDetail recordDetail : recordDetails) { - if (recordDetail.getNumber() != null) { - usedNumber = usedNumber.add(recordDetail.getNumber()); - } - } - } -// System.out.println(usedNumber.toString()); - SubscribeDetail subscribeDetail = this.selectById(subscribeDetailId); -// System.out.println((subscribeDetail.getNumber().subtract(usedNumber)).toString()); - return subscribeDetail.getNumber().subtract(usedNumber); - } - /** - * 导出设备表 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadSubscribeDetailExcel(HttpServletResponse response,List subscribeDetails,int outType) throws IOException { - String fileName = "申购明细表"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "申购明细表"; - if(outType==1){ - fileName = "合同明细表"+CommUtil.nowDate().substring(0,10)+".xls"; - title = "合同明细表"; - } - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - sheet.setColumnWidth(9, 5000); - sheet.setColumnWidth(10, 5000); - sheet.setColumnWidth(11, 5000); - sheet.setColumnWidth(12, 5000); - sheet.setColumnWidth(13, 5000); - sheet.setColumnWidth(14, 5000); - sheet.setColumnWidth(15, 5000); - sheet.setColumnWidth(16, 5000); - sheet.setColumnWidth(17, 5000); - sheet.setColumnWidth(18, 5000); - sheet.setColumnWidth(19, 5000); - sheet.setColumnWidth(20, 5000); - sheet.setColumnWidth(21, 5000); - sheet.setColumnWidth(22, 5000); - sheet.setColumnWidth(23, 5000); - sheet.setColumnWidth(24, 5000); - sheet.setColumnWidth(25, 5000); - sheet.setColumnWidth(26, 5000); - sheet.setColumnWidth(27, 5000); - sheet.setColumnWidth(28, 5000); - sheet.setColumnWidth(29, 5000); - sheet.setColumnWidth(30, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - - - - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(8, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("数量、单价、总价请注意填写数字")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - - HSSFRow twoRow = sheet.createRow(0); - twoRow.setHeight((short) 500); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellValue("说明:“黄色”为必填项,如果不填导入时会忽略该条数据;“白色”为选填项。请按照要求填写。"); - //产生表格表头 - String excelTitleStr = "序号,*名称,*性能参数(设计参数),规格,型号,品牌,生产厂家,*单位,*数量,单价,总价,是否负责安装,子项工程,安装部位(工艺位置),设备类型-大类,设备类型-小类,用途,备注"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - if(excelTitle[i] !=null && excelTitle[i].contains("*")){ - //表头带*的标黄色 - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - } - else{ - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - } - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - //遍历集合数据,产生数据行 - for(int i = 0; i < subscribeDetails.size(); i++){ - row = sheet.createRow(i+2);//第三行为插入的数据行 - row.setHeight((short) 600); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i+1); - break; - case 1://名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(subscribeDetails.get(i).getGoods().getName()); - break; - case 2://性能参数(设计参数) - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(subscribeDetails.get(i).getDesign()); - break; - case 3://规格 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(subscribeDetails.get(i).getGoods().getModel()); - break; - case 4://型号 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(subscribeDetails.get(i).getGoods().getModel()); - break; - case 5://品牌 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(subscribeDetails.get(i).getBrand()); - break; - case 6://生产厂家 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(subscribeDetails.get(i).getManufacturer()); - break; - case 7://单位 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(subscribeDetails.get(i).getGoods().getUnit()); - break; - case 8://数量 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(subscribeDetails.get(i).getNumber().toString()); - break; - case 9://单价 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(subscribeDetails.get(i).getPrice().toString()); - break; - case 10://总价 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(subscribeDetails.get(i).getTotalMoney().toString()); - break; - case 11://是否负责安装 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(subscribeDetails.get(i).getInstall()); - break; - case 12://子项工程 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(subscribeDetails.get(i).getChannelsName()); - break; - case 13://安装部位(工艺位置) - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(getProcesssectionName(subscribeDetails.get(i).getProcesssectionid())); - break; - case 14://设备类型-大类 - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(getEquipmentClassName(subscribeDetails.get(i).getEquipmentBigClassId())); - break; - case 15://设备类型-小类 - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(getEquipmentClassName(subscribeDetails.get(i).getEquipmentclassid())); - break; - case 16://用途 - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(subscribeDetails.get(i).getPurpose()); - break; - case 17://备注 - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(subscribeDetails.get(i).getMemo()); - break; - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - } - /** - * 导出明细模板 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadSubscribeDetailExcelTemplate(HttpServletResponse response,int templateNum,String channelsids,int outType) throws IOException { - String fileName = "申购明细模板"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "申购明细模板"; - if(outType==1){ - fileName = "合同明细表"+CommUtil.nowDate().substring(0,10)+".xls"; - title = "合同明细表"; - } - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 暂时注释此为数据验证 -// HSSFSheet sheet2 = workbook.createSheet("数据验证"); - -// HSSFRow row0 = sheet2.createRow(0); - -// HSSFCell cell0 = null; -// String[] Sheet2title = {"子项工程","安装部位","设备类型大类"}; -// for(int k=0;k0){ -// String codeSmall = getExcelColumnLabel(ii+3); -// createName(workbook, object.getString("name"), "数据验证!$"+codeSmall+"$2:$"+codeSmall+"$"+(smallClass.length+1)); -// for(int a=0;a goodsList = this.goodsService.selectListByWhere(wherestr); - SubscribeDetail subscribeDetail = null; - int res = 0; - if (goodsList!=null && goodsList.size()>0) { - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(goodsList.get(0).getId()); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(number).multiply(new BigDecimal(price))); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - } else { - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(""); - subscribeDetail.setDetailGoodsName(goodsname); - subscribeDetail.setDetailGoodsModel(goodsmodel); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(number).multiply(new BigDecimal(price))); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - /** - * xls表格导入 - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input,String subscribeId,String contractId,String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - String goodsError = ""; - for (int numSheet = 0; numSheet < 1; numSheet++) { -// for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(1); - //如果表头小于18列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 10) { - continue; - } - //设备大类 - String equipmentBigClassId=""; - //设备小类 - String equipmentSmallClassId = ""; - //安装位置 - String pScetionId = ""; - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - int minCellNum = 1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - String goodsname = ""; - String goodsmodel = ""; - String design = ""; - String channelsid = ""; - String purpose = ""; - String memo = ""; - String install = ""; - String totalMoney = ""; - String price = ""; - String number = ""; - String manufacturer = ""; - String brand = ""; - - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - - try { - switch (i) { - case 1://名称 - goodsname = getStringVal(cell); - break; - case 2://规格型号 - goodsmodel = getStringVal(cell); - break; - case 3://品牌 - brand = getStringVal(cell); - break; - case 4://生产厂家 - manufacturer = getStringVal(cell); - break; - case 5://数量 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - number = getStringVal(cell); - }else{ - number = "0"; - } - break; - case 6://单价 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - price = getStringVal(cell); - }else{ - price = "0"; - } - break; - case 7://总价 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - totalMoney = getStringVal(cell); - }else{ - totalMoney = "0"; - } - break; - case 8://用途 - purpose = getStringVal(cell); - break; - case 9://备注 - memo = getStringVal(cell); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - String wherestr = "where name='"+goodsname+"' " - + "and model like '%"+goodsmodel+"%'"; - List goodsList = this.goodsService.selectListByWhere(wherestr); - SubscribeDetail subscribeDetail = null; - int res = 0; - if (goodsList!=null && goodsList.size()>0) { - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(goodsList.get(0).getId()); - subscribeDetail.setDetailGoodsName(goodsname); - subscribeDetail.setDetailGoodsModel(goodsmodel); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(number).multiply(new BigDecimal(price))); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - }else{ - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(""); - subscribeDetail.setDetailGoodsName(goodsname); - subscribeDetail.setDetailGoodsModel(goodsmodel); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(number).multiply(new BigDecimal(price))); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - // 需要维护的物品 - goodsError += goodsname + " "; -// } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - if (StringUtils.isNotBlank(goodsError)) { - result += " " + goodsError + " 未查询到物品信息;"; - } - return result; - } - - /** - * xlsx文件导入-合并相同物品 - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsxMerge(InputStream input,String subscribeId,String contractId,String userId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(1); - //如果表头小于18列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 18) { - continue; - } - //设备大类 - String equipmentBigClassId=""; - //设备小类 - String equipmentSmallClassId = ""; - //安装位置 - String pScetionId = ""; - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - XSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - String goodsname = ""; - String goodsmodel = ""; - String goodsSpecifications = ""; - String goodsunit = ""; - String design = ""; - String channelsid = ""; - String purpose = ""; - String memo = ""; - String install = ""; - String totalMoney = ""; - String price = ""; - String number = ""; - String manufacturer = ""; - String brand = ""; - - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell cell = row.getCell(i); - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - try { - switch (i) { - case 1://名称 - goodsname = getStringVal(cell); - break; - case 2://性能参数(设计参数) - design = getStringVal(cell); - break; - case 3://规格 - goodsSpecifications = getStringVal(cell); - break; - case 4://型号 - goodsmodel = getStringVal(cell); - break; - case 5://品牌 - brand = getStringVal(cell); - break; - case 6://生产厂家 - manufacturer = getStringVal(cell); - break; - case 7://单位 - goodsunit = getStringVal(cell); - break; - case 8://数量 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - number = getStringVal(cell); - } - break; - case 9://单价 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - price = getStringVal(cell); - } - break; - case 10://总价 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - totalMoney = getStringVal(cell); - } - break; - case 11://是否负责安装 - install = getStringVal(cell); - break; - case 12://子项工程 - channelsid = this.channelsService.getChannelsId(getStringVal(cell)); - break; - case 13://安装部位(工艺位置) - pScetionId = getProcessSectionId(getStringVal(cell)); - break; - case 14://设备类型-大类 - equipmentBigClassId = getEquipmentBigClassId(getStringVal(cell)); - break; - case 15://设备类型-小类 - equipmentSmallClassId = getEquipmentSmallClassId(equipmentBigClassId,getStringVal(cell)); - break; - case 16://用途 - purpose = getStringVal(cell); - break; - case 17://备注 - memo = getStringVal(cell); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - - String wherestr = "where name='"+goodsname+"' and unit='"+goodsunit+"' " - + "and model like '%"+goodsmodel+"%' and model like '%"+goodsSpecifications+"%' "; - List goodsList = this.goodsService.selectListByWhere(wherestr); - SubscribeDetail subscribeDetail = null; - int res = 0; - if (goodsList!=null && goodsList.size()>0) { - //已有物品 - String whereStr = "where subscribe_id='"+subscribeId+"' and goods_id='"+goodsList.get(0).getId()+"' "; - if(contractId!=null && !contractId.isEmpty()){ - whereStr = "where contract_id='"+contractId+"' and goods_id='"+goodsList.get(0).getId()+"' "; - } - List subscribeDetails = this.selectListByWhere(whereStr); - if(subscribeDetails!=null && subscribeDetails.size()>0){ - subscribeDetail = subscribeDetails.get(0); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(totalMoney)); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.update(subscribeDetail); - if(res == 1){ - updateNum++; - } - }else{ - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(goodsList.get(0).getId()); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(totalMoney)); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - } - }else{ - //新物品 - String GoodsId = CommUtil.getUUID(); - Goods goods = new Goods(); - goods.setId(GoodsId); - goods.setName(goodsname); - goods.setModel(goodsmodel); - goods.setUnit(goodsunit); - goods.setMaxReserve(100.0); - res = goodsService.save(goods); - if(res == 1){ - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(GoodsId); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(totalMoney)); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - } - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - /** - * xls表格导入-合并相同物品 - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXlsMerge(InputStream input,String subscribeId,String contractId,String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(1); - //如果表头小于18列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 18) { - continue; - } - //设备大类 - String equipmentBigClassId=""; - //设备小类 - String equipmentSmallClassId = ""; - //安装位置 - String pScetionId = ""; - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - int minCellNum = 1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - String goodsname = ""; - String goodsmodel = ""; - String goodsSpecifications = ""; - String goodsunit = ""; - String design = ""; - String channelsid = ""; - String purpose = ""; - String memo = ""; - String install = ""; - String totalMoney = ""; - String price = ""; - String number = ""; - String manufacturer = ""; - String brand = ""; - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - - try { - switch (i) { - case 1://名称 - goodsname = getStringVal(cell); - break; - case 2://性能参数(设计参数) - design = getStringVal(cell); - break; - case 3://规格 - goodsSpecifications = getStringVal(cell); - break; - case 4://型号 - goodsmodel = getStringVal(cell); - break; - case 5://品牌 - brand = getStringVal(cell); - break; - case 6://生产厂家 - manufacturer = getStringVal(cell); - break; - case 7://单位 - goodsunit = getStringVal(cell); - break; - case 8://数量 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - number = getStringVal(cell); - }else{ - number = "0"; - } - break; - case 9://单价 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - price = getStringVal(cell); - }else{ - price = "0"; - } - break; - case 10://总价 - if(null!=getStringVal(cell) && !"".equals(getStringVal(cell))){ - totalMoney = getStringVal(cell); - }else{ - totalMoney = "0"; - } - break; - case 11://是否负责安装 - install = getStringVal(cell); - break; - case 12://子项工程 - channelsid = this.channelsService.getChannelsId(getStringVal(cell)); - break; - case 13://安装部位(工艺位置) - pScetionId = getProcessSectionId(getStringVal(cell)); - break; - case 14://设备类型-大类 - equipmentBigClassId = getEquipmentBigClassId(getStringVal(cell)); - break; - case 15://设备类型-小类 - equipmentSmallClassId = getEquipmentSmallClassId(equipmentBigClassId,getStringVal(cell)); - break; - case 16://用途 - purpose = getStringVal(cell); - break; - case 17://备注 - memo = getStringVal(cell); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - String wherestr = "where name='"+goodsname+"' and unit='"+goodsunit+"' " - + "and (model like '%"+goodsmodel+"%' or model like '%"+goodsSpecifications+"%' )"; - List goodsList = this.goodsService.selectListByWhere(wherestr); - SubscribeDetail subscribeDetail = null; - int res = 0; - if (goodsList!=null && goodsList.size()>0) { - //已有物品 - String whereStr = "where subscribe_id='"+subscribeId+"' and goods_id='"+goodsList.get(0).getId()+"' "; - if(contractId!=null && !contractId.isEmpty()){ - whereStr = "where contract_id='"+contractId+"' and goods_id='"+goodsList.get(0).getId()+"' "; - } - List subscribeDetails = this.selectListByWhere(whereStr); - if(subscribeDetails!=null && subscribeDetails.size()>0){ - subscribeDetail = subscribeDetails.get(0); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(totalMoney)); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.update(subscribeDetail); - if(res == 1){ - updateNum++; - } - }else{ - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(goodsList.get(0).getId()); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(totalMoney)); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - } - }else{ - //新物品 - String GoodsId = CommUtil.getUUID(); - Goods goods = new Goods(); - goods.setId(GoodsId); - goods.setName(goodsname); - goods.setModel(goodsmodel+goodsSpecifications); - goods.setUnit(goodsunit); - goods.setMaxReserve(100.0); - goods.setNumber(""); - res = goodsService.save(goods); - if(res == 1){ - subscribeDetail = new SubscribeDetail(); - subscribeDetail.setId(CommUtil.getUUID()); - subscribeDetail.setGoodsId(GoodsId); - subscribeDetail.setSubscribeId(subscribeId); - subscribeDetail.setContractId(contractId); - subscribeDetail.setDesign(design); - subscribeDetail.setBrand(brand); - subscribeDetail.setManufacturer(manufacturer); - subscribeDetail.setNumber(new BigDecimal(number)); - subscribeDetail.setPrice(new BigDecimal(price)); - subscribeDetail.setTotalMoney(new BigDecimal(totalMoney)); - subscribeDetail.setInstall(install); - subscribeDetail.setChannelsid(channelsid); - subscribeDetail.setProcesssectionid(pScetionId); - subscribeDetail.setEquipmentBigClassId(equipmentBigClassId); - subscribeDetail.setEquipmentclassid(equipmentSmallClassId); - subscribeDetail.setPurpose(purpose); - subscribeDetail.setMemo(memo); - subscribeDetail.setInsdt(CommUtil.nowDate()); - res = this.save(subscribeDetail); - if(res == 1){ - insertNum++; - } - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - - /** - * 获取表格中导出的设备大类,小类name - * @param cellValue - * @return - */ - private String getEquipmentClassName(String equipmentClassId){ - String equipmentClassName = ""; - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentClassId); - if(equipmentClass != null){ - equipmentClassName = equipmentClass.getEquipmentClassCode()+equipmentClass.getName(); - } - return equipmentClassName; - } - /** - * 获取表格中导入的设备大类id - * @param cellValue - * @return - */ - private String getEquipmentBigClassId(String cellValue){ - String equipmentBigClassId = ""; - cellValue = cellValue.replace(" ", ""); - if(cellValue!=null && !cellValue.equals("") && cellValue.length()>=2){ - List equipmentBigClassList = this.equipmentClassService.selectListByWhere("where equipment_class_code = '"+cellValue.trim().substring(0, 2)+"' and type = '"+CommString.EquipmentClass_Category+"'"); - if (equipmentBigClassList!=null && equipmentBigClassList.size()>0) { - equipmentBigClassId = equipmentBigClassList.get(0).getId(); - }else { - //根据文字来找 - List equipmentBigClassListByName = this.equipmentClassService.selectListByWhere("where name = '"+cellValue+"' and type = '"+CommString.EquipmentClass_Category+"'"); - if(equipmentBigClassListByName!=null && equipmentBigClassListByName.size()>0){ - equipmentBigClassId = equipmentBigClassListByName.get(0).getId(); - } - - } - } - return equipmentBigClassId; - } - - /** - * 获取表格中导入的设备小类id - * @param cellValue - * @return - */ - private String getEquipmentSmallClassId(String equipmentBigClassId,String cellValue){ - String equipmentSmallClassId = ""; - cellValue = cellValue.replace(" ", ""); - if(cellValue!=null && !cellValue.equals("") && cellValue.length()>=2){ - String whereSql = "where equipment_class_code = '"+cellValue.trim().substring(0, 2)+"'"+" and pid='"+equipmentBigClassId+"'"; - List equipmentBigClassList = this.equipmentClassService.selectListByWhere(whereSql); - if (equipmentBigClassList!=null && equipmentBigClassList.size()>0) { - equipmentSmallClassId = equipmentBigClassList.get(0).getId(); - }else { - //根据文字来找 - List equipmentSmallClassListByName = this.equipmentClassService.selectListByWhere("where name = '"+cellValue+"' and pid='"+equipmentBigClassId+"'"); - if(equipmentSmallClassListByName!=null && equipmentSmallClassListByName.size()>0){ - equipmentSmallClassId = equipmentSmallClassListByName.get(0).getId(); - } - - } - } - return equipmentSmallClassId; - } - - /** - * 获取表格中导入的工艺段id(全厂通用,不绑定厂区id) - * @param companyId - * @param cellValue - * @return - */ - private String getProcessSectionId(String cellValue){ - String ProcessSectionId = ""; - ListpSections = processSectionService.selectListByWhere("where (name = '"+cellValue+"' or code='"+cellValue+"')"); - if (pSections!=null && pSections.size()>0) { - ProcessSectionId = pSections.get(0).getId(); - }else { - - } - return ProcessSectionId; - } - - /** - * 获取表格中导入的工艺段id(全厂通用,不绑定厂区id) - * @param companyId - * @param cellValue - * @return - */ - private String getProcesssectionName(String ProcessSectionId){ - ProcessSection pSections = processSectionService.selectById(ProcessSectionId); - String processSection = ""; - if (pSections!=null) { - processSection = pSections.getName(); - }else { - - } - return processSection; - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return ""; - } - }else{ - return ""; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - try { - return cell.getStringCellValue(); - } catch (IllegalStateException e) { - return String.valueOf(cell.getNumericCellValue()); - } - //return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return ""; - } - }else{ - return ""; - } - } - /** - * 添加数据有效性检查. 2020-11-14 chengpj - * @param sheet 要添加此检查的Sheet - * @param firstRow 开始行 - * @param endRow 结束行 - * @param firstCol 开始列 - * @param endCol 结束列 - * @param dataArray 有效性检查的下拉列表 - * @param wbCreat workbook - * @param code (A,B,C...) 第几列 - * @param ord(1,2,3...)与code对应 - * @param titlename sheet2的表头 - * @throws IllegalArgumentException 如果传入的行或者列小于0(< 0)或者结束行/列比开始行/列小 - */ - private static HSSFDataValidation getDataValidationList4Col(HSSFSheet sheet, int firstRow,int endRow,int firstCol, int endCol, String[] dataArray,HSSFWorkbook wbCreat,HSSFSheet sheet2,String code,int ord,String titlename,Name namedCell){ - int num = dataArray.length+1; - namedCell.setRefersToFormula("数据验证!$"+code+"$2:$"+code+"$" + String.valueOf(num)); - //System.out.println(dataArray.length); - //加载数据,将名称为hidden的 - DVConstraint constraint = DVConstraint.createFormulaListConstraint(titlename); - - // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 - CellRangeAddressList addressList = new CellRangeAddressList(firstRow, endRow, firstCol,endCol); - HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint); - - if (null != validation) - { - sheet.addValidationData(validation); - } - return validation; - } - /** - * 添加数据有效性检查. 2020-11-14 chengpj - * @param sheet 要添加此检查的Sheet - * @param firstRow 开始行 - * @param endRow 结束行 - * @param firstCol 开始列 - * @param endCol 结束列 - * @param dataArray 有效性检查的下拉列表 - * @param wbCreat workbook - * @param code1 (A,B,C...) 开始第几列 - * @param code2 (A,B,C...) 结束第几列 - * @param ord(1,2,3...)与code对应 - * @param titlename sheet2的表头 - * @throws IllegalArgumentException 如果传入的行或者列小于0(< 0)或者结束行/列比开始行/列小 - */ - private static HSSFDataValidation getDataValidationList4Col_class(HSSFSheet sheet, int firstRow,int endRow,int firstCol, int endCol,String titlename){ - - //加载数据,将名称为hidden的 - DVConstraint constraint = DVConstraint.createFormulaListConstraint(titlename); - - // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 - CellRangeAddressList addressList = new CellRangeAddressList(firstRow, endRow, firstCol,endCol); - HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint); - - if (null != validation) - { - sheet.addValidationData(validation); - } - return validation; - } - /** - * 导出设备表 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadEquipmentExcel(HttpServletResponse response,List subscribeDetails,String contractNumbers) throws IOException { - - String fileName = "合同明细转设备台账表"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "设备台账表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - HSSFSheet sheet2 = workbook.createSheet("数据验证"); - HSSFRow row0 = sheet2.createRow(0); - HSSFCell cell0 = null; - String[] Sheet2title = {"所属厂区","设备归属","设备类型大类","设备类型小类","工艺段","ABC分类","设备状态","是否强检","强检类型"}; - for(int k=0;k EquipmentBigClasss = this.equipmentClassService.selectListByWhere("where 1=1 and type = '"+CommString.EquipmentClass_Category+"' order by morder"); - String[] EquipmentBigClassNamesStrings = null; - JSONArray array = new JSONArray(); - if(EquipmentBigClasss!=null && EquipmentBigClasss.size()>0){ - EquipmentBigClassNamesStrings = new String[EquipmentBigClasss.size()]; - for(int i=0;i equipmentSmallClassNames = this.equipmentClassService.selectListByWhere("where pid = '"+pid+"' order by morder"); - String[] equipmentSmallClassNamesStrings = null; - if(equipmentSmallClassNames!=null && equipmentSmallClassNames.size()>0){ - equipmentSmallClassNamesStrings = new String[equipmentSmallClassNames.size()]; - for(int i=0;i 1) { - double sub = num - 26 * (Math.pow(26, i - 1) - 1) / 25; - for (double j = i; j > 0; j--) { - temp = temp + (char) (sub / Math.pow(26, j - 1) + 65); - sub = sub % Math.pow(26, j - 1); - } - } else { - temp = temp + (char) (num + 65); - } - return temp; - } - - /** - * 复制个人申购明细到部门申购 - */ - @Transactional - public int personalDetil2Department(String subscribeIds,String departmentId,User cu ) { - int result = 0; - if(subscribeIds!=null && !subscribeIds.isEmpty() - && subscribeIds!=null && !subscribeIds.isEmpty()){ - String wherestr = "where id is not null and subscribe_id in ('"+subscribeIds+"') "; - String orderStr = " order by subscribe_id,id "; - SubscribeDetail subscribeDetail = new SubscribeDetail(); - subscribeDetail.setWhere(wherestr+orderStr); - List list = subscribeDetailDao.selectListByWhere(subscribeDetail); - if (list != null && list.size()>0) { - for (SubscribeDetail item : list) { - item.setId(CommUtil.getUUID()); - item.setInsdt(CommUtil.nowDate()); - item.setInsuser(cu.getId()); - item.setSubscribeId(departmentId); - result += save(item); - } - if(result>0){ - wherestr = "where id in ('"+subscribeIds+"') "; - orderStr = " order by id "; - List subscribeList = subscribeService.selectListByWhere(wherestr+orderStr); - if (subscribeList != null && subscribeList.size()>0) { - for (Subscribe subscribe : subscribeList) { - subscribe.setStatus(SparePartCommString.STATUS_PERSONAL_FINISH); - subscribeService.update(subscribe); - } - } - } - } - } - return result; - } - - /** - * 导出明细表-沙口采购计划 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadSubscribeDetailExcel(HttpServletResponse response,List subscribeDetails,String subscribe_man,String subscribe_audit) - throws IOException { - String fileName = "物资采购计划表"+CommUtil.nowDate().substring(0,10)+".xls"; - String title = "物资采购计划表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - sheet.setColumnWidth(9, 5000); - sheet.setColumnWidth(10, 5000); - sheet.setColumnWidth(11, 5000); - sheet.setColumnWidth(12, 5000); - sheet.setColumnWidth(13, 5000); - sheet.setColumnWidth(14, 5000); - sheet.setColumnWidth(15, 5000); - sheet.setColumnWidth(16, 5000); - sheet.setColumnWidth(17, 5000); - sheet.setColumnWidth(18, 5000); - sheet.setColumnWidth(19, 5000); - sheet.setColumnWidth(20, 5000); - sheet.setColumnWidth(21, 5000); - sheet.setColumnWidth(22, 5000); - sheet.setColumnWidth(23, 5000); - sheet.setColumnWidth(24, 5000); - sheet.setColumnWidth(25, 5000); - sheet.setColumnWidth(26, 5000); - sheet.setColumnWidth(27, 5000); - sheet.setColumnWidth(28, 5000); - sheet.setColumnWidth(29, 5000); - sheet.setColumnWidth(30, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(true); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成并设置一个样式,用于表头 - HSSFCellStyle subheadStyle = workbook.createCellStyle(); - subheadStyle.setBorderBottom(BorderStyle.THIN); - subheadStyle.setBorderLeft(BorderStyle.THIN); - subheadStyle.setBorderRight(BorderStyle.THIN); - subheadStyle.setBorderTop(BorderStyle.THIN); - subheadStyle.setAlignment(HorizontalAlignment.LEFT); - subheadStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 把字体应用到当前的样式 - subheadStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setAlignment(HorizontalAlignment.CENTER); - //产生表格表头 - String excelTitleStr = "序号,物资名称,主要参数说明,单位,数量,单价(元),采购预算(元),计划(月度/年度计划/计划外),用 途:1、技改2、低值易耗3、新(扩)建 4、生产性原材料," - + "截止25日 库存量,要求完成采购时间,计划到货时间,到货地点,是否纳入资金滚动计划,是否属于用户工程,备注(填写该物资的编码),采购主体(自购/运营管理部),采购方式"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(3); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - if(excelTitle[i] !=null && excelTitle[i].contains("*")){ - //表头带*的标黄色 - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - } - else{ - columnNameStyle = workbook.createCellStyle(); - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFont(columnNamefont); - columnNameStyle.setFillForegroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillBackgroundColor(IndexedColors.WHITE.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - } - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - //遍历集合数据,产生数据行 - int rowNum = 0; - BigDecimal totalMoney = new BigDecimal("0"); - for(int i = 0; i < subscribeDetails.size(); i++){ - rowNum = i+4; - row = sheet.createRow(rowNum);//第5行为插入的数据行 - row.setHeight((short) 400); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i+1); - break; - case 1://名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(subscribeDetails.get(i).getGoods().getName()); - break; - case 2://性能参数(设计参数) - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(subscribeDetails.get(i).getDesign()); - break; - case 3://单位 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(subscribeDetails.get(i).getGoods().getUnit()); - break; - case 4://数量 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - if(subscribeDetails.get(i).getNumber()!=null){ - cell_4.setCellValue(subscribeDetails.get(i).getNumber().toString()); - }else{ - cell_4.setCellValue("0"); - } - break; - case 5://单价 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - if(subscribeDetails.get(i).getPrice()!=null){ - cell_5.setCellValue(subscribeDetails.get(i).getPrice().toString()); - }else{ - cell_5.setCellValue("0"); - } - break; - case 6://总价或采购预算(元) - totalMoney = totalMoney.add(subscribeDetails.get(i).getTotalMoney()); - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - if(subscribeDetails.get(i).getTotalMoney()!=null){ - cell_6.setCellValue(subscribeDetails.get(i).getTotalMoney().toString()); - }else{ - cell_6.setCellValue("0"); - } - break; - case 7://计划(月度/年度计划/计划外) - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(""); - break; - case 8://用途 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(subscribeDetails.get(i).getPurpose()); - break; - case 9://截止25日 库存量 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(""); - break; - case 10://要求完成采购时间 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(""); - break; - case 11://计划到货时间 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(subscribeDetails.get(i).getPlanArrivalTime()); - break; - case 12://到货地点 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(subscribeDetails.get(i).getPlanArrivalPlace()); - break; - case 13://是否纳入资金滚动计划 - HSSFCell cell_13 = row.createCell(13); - cell_13.setCellStyle(listStyle); - cell_13.setCellValue(""); - break; - case 14://是否属于用户工程 - HSSFCell cell_14 = row.createCell(14); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(""); - break; - case 15://备注(填写该物资的编码) - HSSFCell cell_15 = row.createCell(15); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(subscribeDetails.get(i).getGoods().getNumber()); - break; - case 16://采购主体(自购/运营管理部) - HSSFCell cell_16 = row.createCell(16); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(""); - break; - case 17://采购方式 - HSSFCell cell_17 = row.createCell(17); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(""); - break; - default: - break; - } - } - } - rowNum++; - HSSFRow reciprocalTwoRow = sheet.createRow(rowNum); - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - // 第二行说明信息 - HSSFRow twoRow = sheet.createRow(1); - // 第3行说明信息 - HSSFRow threeRow = sheet.createRow(2); - - HSSFRow reciprocalOneRow = sheet.createRow(rowNum+1); - for(int i=0;i<18;i++){ - HSSFCell reciprocalTwocell_1 = handRow.createCell(i); - reciprocalTwocell_1.setCellStyle(listStyle); - reciprocalTwocell_1.setCellValue(""); - HSSFCell reciprocalTwocell_2 = twoRow.createCell(i); - reciprocalTwocell_2.setCellStyle(listStyle); - reciprocalTwocell_2.setCellValue(""); - HSSFCell reciprocalTwocell_3 = threeRow.createCell(i); - reciprocalTwocell_3.setCellStyle(listStyle); - reciprocalTwocell_3.setCellValue(""); - HSSFCell reciprocalTwocell_7 = reciprocalOneRow.createCell(i); - reciprocalTwocell_7.setCellStyle(listStyle); - reciprocalTwocell_7.setCellValue(""); - HSSFCell reciprocalTwocell_8 = reciprocalTwoRow.createCell(i); - reciprocalTwocell_8.setCellStyle(listStyle); - reciprocalTwocell_8.setCellValue("\\"); - } - - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - twoRow.setHeight((short) 500); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(subheadStyle); - twocell.setCellValue("编号:"); - threeRow.setHeight((short) 400); - HSSFCell threecell = threeRow.createCell(0); - threecell.setCellStyle(columnNameStyle); - threecell.setCellValue("填报人: "); - HSSFCell threecell_1 = threeRow.createCell(5); - threecell_1.setCellStyle(columnNameStyle); - threecell_1.setCellValue("填报部门:"); - HSSFCell threecell_2 = threeRow.createCell(16); - threecell_2.setCellStyle(columnNameStyle); - threecell_2.setCellValue("日期: "); - - reciprocalTwoRow.setHeight((short) 500); - HSSFCell reciprocalTwocell = reciprocalTwoRow.createCell(0); - reciprocalTwocell.setCellStyle(columnNameStyle); - reciprocalTwocell.setCellValue("总计"); - - HSSFCell reciprocalTwocell_5 = reciprocalTwoRow.createCell(5); - reciprocalTwocell_5.setCellStyle(listStyle); - reciprocalTwocell_5.setCellValue("\\"); - - HSSFCell reciprocalTwocell_6 = reciprocalTwoRow.createCell(6); - reciprocalTwocell_6.setCellStyle(listStyle); - reciprocalTwocell_6.setCellValue(totalMoney.toString()); - - reciprocalOneRow.setHeight((short) 500); - HSSFCell reciprocalOnecell = reciprocalOneRow.createCell(0); - reciprocalOnecell.setCellStyle(listStyle); - reciprocalOnecell.setCellValue("填报人:"); - HSSFCell reciprocalOnecell_1 = reciprocalOneRow.createCell(2); - reciprocalOnecell_1.setCellStyle(listStyle); - reciprocalOnecell_1.setCellValue(subscribe_man); - HSSFCell reciprocalOnecell_2 = reciprocalOneRow.createCell(7); - reciprocalOnecell_2.setCellStyle(listStyle); - reciprocalOnecell_2.setCellValue("部门领导审核:"); - HSSFCell reciprocalOnecell_3 = reciprocalOneRow.createCell(9); - reciprocalOnecell_3.setCellStyle(listStyle); - reciprocalOnecell_3.setCellValue(subscribe_audit); - - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, excelTitle.length - 1)); - sheet.addMergedRegion(new CellRangeAddress(2, 2, 0, 1)); - sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 0, 4)); - sheet.addMergedRegion(new CellRangeAddress(rowNum+1, rowNum+1, 0, 1)); - sheet.addMergedRegion(new CellRangeAddress(rowNum+1, rowNum+1, 2, 6)); - sheet.addMergedRegion(new CellRangeAddress(rowNum+1, rowNum+1, 7, 8)); - sheet.addMergedRegion(new CellRangeAddress(rowNum+1, rowNum+1, 9, 17)); - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - } -} diff --git a/src/com/sipai/service/sparepart/SubscribeService.java b/src/com/sipai/service/sparepart/SubscribeService.java deleted file mode 100644 index 1a5a39dc..00000000 --- a/src/com/sipai/service/sparepart/SubscribeService.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.sipai.service.sparepart; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.activiti.workflow.simple.definition.WorkflowDefinition; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.sparepart.PurchasePlanDao; -import com.sipai.dao.sparepart.SubscribeDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.PurchaseDetail; -import com.sipai.entity.sparepart.PurchaseMethods; -import com.sipai.entity.sparepart.PurchasePlan; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.webservice.server.user.UserServer; - -@Service -public class SubscribeService implements CommService{ - @Resource - private SubscribeDao subscribeDao; - @Resource - private PurchaseDetailService purchaseDetailService; - @Resource - private UnitService unitService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private SubscribeDetailService subscribeDetailService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private ChannelsService channelsService; - @Resource - private PurchaseMethodsService purchaseMethodsService; - @Override - public Subscribe selectById(String id) { - Subscribe subscribe = subscribeDao.selectByPrimaryKey(id); - if(subscribe != null){ - if (subscribe.getDeptId() != null && !subscribe.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(subscribe.getDeptId()); - if(dept!=null){ - subscribe.setDept(dept); - } - } - if (subscribe.getBizId() != null && !subscribe.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(subscribe.getBizId()); - if(company!=null){ - subscribe.setCompany(company); - } - } - if (subscribe.getSubscribeManId() != null && !subscribe.getSubscribeManId().isEmpty()) { - String subscribeManName = this.getUserNamesByUserIds(subscribe.getSubscribeManId()); - subscribe.setSubscribeManName(subscribeManName); - } - if (subscribe.getSubscribeAuditId() != null && !subscribe.getSubscribeAuditId().isEmpty()) { - String subscribeAuditName = this.getUserNamesByUserIds(subscribe.getSubscribeAuditId()); - subscribe.setSubscribeAuditName(subscribeAuditName); - } - if (subscribe.getChannelsid() != null && !subscribe.getChannelsid().isEmpty()) { - String[] channelsids = subscribe.getChannelsid().split(","); - String channelsNames = ""; - for(int i=0;i selectListByWhere(String wherestr) { - Subscribe subscribe = new Subscribe(); - subscribe.setWhere(wherestr); - List list = subscribeDao.selectListByWhere(subscribe); - for (Subscribe item : list) { - if (item.getDeptId() != null && !item.getDeptId().isEmpty()) { - Dept dept = this.unitService.getDeptById(item.getDeptId()); - item.setDept(dept); - } - if (item.getBizId() != null && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - if (item.getSubscribeManId() != null && !item.getSubscribeManId().isEmpty()) { - String subscribeManName = this.getUserNamesByUserIds(item.getSubscribeManId()); - item.setSubscribeManName(subscribeManName); - } - if (item.getSubscribeAuditId() != null && !item.getSubscribeAuditId().isEmpty()) { - String subscribeAuditName = this.getUserNamesByUserIds(item.getSubscribeAuditId()); - item.setSubscribeAuditName(subscribeAuditName); - } - } - return list; - } - /** - * 删除申购单时同时删除关联的流程,申购明细,使用业务回滚方式 - */ - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - Subscribe subscribe = new Subscribe(); - subscribe.setWhere(wherestr); - List subscribes = this.selectListByWhere(wherestr); - for (Subscribe item : subscribes) { - String pInstancId = item.getProcessid(); - if(pInstancId != null && !pInstancId.isEmpty() ){ - //删掉关联的流程 - this.workflowService.delProcessInstance(pInstancId); - } - //删除申购单的同时删除关联的申购明细 - this.subscribeDetailService.deleteByWhere("where subscribe_id = '"+item.getId()+"'"); - } - return subscribeDao.deleteByWhere(subscribe); - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - } - /** - * 更新申购单的总价 - */ - public Subscribe updateTotalMoney(Subscribe subscribe) { - //在保存申购单时,将申购单明细的金额加起来,生成申购单的总金额 - BigDecimal totalMoney = new BigDecimal(0); - ListsubscribeDetails = this.subscribeDetailService.selectListByWhere("where subscribe_id = '"+subscribe.getId()+"'"); - if (subscribeDetails!= null && subscribeDetails.size()>0) { - for (SubscribeDetail item : subscribeDetails) { - if (item.getTotalMoney() != null) { - totalMoney = totalMoney.add(item.getTotalMoney()); - } - } - } - subscribe.setTotalMoney(totalMoney); - return subscribe; - } - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } - /** - * 部门申购流程启动 - * @param - * @return - */ - @Transactional - public int startSubscribeProcess(Subscribe subscribe) { - try { - Map variables = new HashMap(); - if(!subscribe.getSubscribeAuditId().isEmpty()){ - variables.put("userIds", subscribe.getSubscribeAuditId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.B_Purchase.getId()+"-"+subscribe.getBizId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(subscribe.getId(), subscribe.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - subscribe.setProcessid(processInstance.getId()); - subscribe.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res = 0; - Listsubscribes = this.selectListByWhere("where id = '"+subscribe.getId()+"'"); - if (subscribes != null && subscribes.size()>0) {//编辑页面发起,用更新方法 - res = subscribeDao.updateByPrimaryKeySelective(subscribe); - }else {//新增页面直接发起,用保存方法 - res = subscribeDao.insert(subscribe); - } - if (res==1) { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(subscribe); - businessUnitRecord.sendMessage(subscribe.getSubscribeAuditId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - Subscribe subscribe = this.selectById(id); - //Task task=workflowService.getTaskService().createTaskQuery().processInstanceId(subscribe.getProcessid()).singleResult(); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(subscribe.getProcessid()).list(); - if (task!=null && task.size()>0) { - subscribe.setStatus(task.get(0).getName()); - }else{ - subscribe.setStatus(SparePartCommString.STATUS_FINISH); - } - int res =this.update(subscribe); - return res; - } - /** - * 采购审核 - * @param entity - * @return - */ - @Transactional - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter=this.selectById(entity.getBusinessid()); - int res =businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } -} diff --git a/src/com/sipai/service/sparepart/SupplierClassService.java b/src/com/sipai/service/sparepart/SupplierClassService.java deleted file mode 100644 index 32d3fcb8..00000000 --- a/src/com/sipai/service/sparepart/SupplierClassService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SupplierClassDao; -import com.sipai.entity.sparepart.SupplierClass; -import com.sipai.tools.CommService; - -@Service -public class SupplierClassService implements CommService{ - @Resource - private SupplierClassDao supplierClassDao; - - @Override - public SupplierClass selectById(String id) { - SupplierClass supplierClass = supplierClassDao.selectByPrimaryKey(id); - return supplierClass; - } - - @Override - public int deleteById(String id) { - return supplierClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(SupplierClass supplierClass) { - return supplierClassDao.insert(supplierClass); - } - - @Override - public int update(SupplierClass supplierClass) { - return supplierClassDao.updateByPrimaryKeySelective(supplierClass); - } - - @Override - public List selectListByWhere(String wherestr) { - SupplierClass supplierClass = new SupplierClass(); - supplierClass.setWhere(wherestr); - List list = supplierClassDao.selectListByWhere(supplierClass); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - SupplierClass supplierClass = new SupplierClass(); - supplierClass.setWhere(wherestr); - return supplierClassDao.deleteByWhere(supplierClass); - } -} diff --git a/src/com/sipai/service/sparepart/SupplierClass_copyService.java b/src/com/sipai/service/sparepart/SupplierClass_copyService.java deleted file mode 100644 index 1563e4b1..00000000 --- a/src/com/sipai/service/sparepart/SupplierClass_copyService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SupplierClass_copyDao; -import com.sipai.entity.sparepart.SupplierClass_copy; -import com.sipai.tools.CommService; - -@Service -public class SupplierClass_copyService implements CommService{ - @Resource - private SupplierClass_copyDao supplierClassDao1; - - @Override - public SupplierClass_copy selectById(String id) { - SupplierClass_copy supplierClass = supplierClassDao1.selectByPrimaryKey(id); - return supplierClass; - } - - @Override - public int deleteById(String id) { - return supplierClassDao1.deleteByPrimaryKey(id); - } - - @Override - public int save(SupplierClass_copy supplierClass) { - return supplierClassDao1.insert(supplierClass); - } - - @Override - public int update(SupplierClass_copy supplierClass) { - return supplierClassDao1.updateByPrimaryKeySelective(supplierClass); - } - - @Override - public List selectListByWhere(String wherestr) { - SupplierClass_copy supplierClass = new SupplierClass_copy(); - supplierClass.setWhere(wherestr); - List list = supplierClassDao1.selectListByWhere(supplierClass); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - SupplierClass_copy supplierClass = new SupplierClass_copy(); - supplierClass.setWhere(wherestr); - return supplierClassDao1.deleteByWhere(supplierClass); - } -} diff --git a/src/com/sipai/service/sparepart/SupplierQualificationService.java b/src/com/sipai/service/sparepart/SupplierQualificationService.java deleted file mode 100644 index d2e8637a..00000000 --- a/src/com/sipai/service/sparepart/SupplierQualificationService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SupplierQualificationDao; - -import com.sipai.entity.sparepart.SupplierQualification; - -import com.sipai.tools.CommService; - -@Service -public class SupplierQualificationService implements CommService{ - @Resource - private SupplierQualificationDao SupplierQualificationDao; - - - @Override - public SupplierQualification selectById(String id) { - SupplierQualification supplierQualification = SupplierQualificationDao.selectByPrimaryKey(id); - - return supplierQualification; - } - - - - @Override - public int deleteById(String id) { - return SupplierQualificationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(SupplierQualification goods) { - return SupplierQualificationDao.insert(goods); - } - - @Override - public int update(SupplierQualification goods) { - return SupplierQualificationDao.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - SupplierQualification supplierQualification = new SupplierQualification(); - supplierQualification.setWhere(wherestr); - List list = SupplierQualificationDao.selectListByWhere(supplierQualification); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - SupplierQualification supplierQualification = new SupplierQualification(); - supplierQualification.setWhere(wherestr); - return SupplierQualificationDao.deleteByWhere(supplierQualification); - } - - -} diff --git a/src/com/sipai/service/sparepart/SupplierQualification_copyService.java b/src/com/sipai/service/sparepart/SupplierQualification_copyService.java deleted file mode 100644 index d029088e..00000000 --- a/src/com/sipai/service/sparepart/SupplierQualification_copyService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SupplierQualification_copyDao; - -import com.sipai.entity.sparepart.SupplierQualification_copy; - -import com.sipai.tools.CommService; - -@Service -public class SupplierQualification_copyService implements CommService{ - @Resource - private SupplierQualification_copyDao SupplierQualificationDao1; - - - @Override - public SupplierQualification_copy selectById(String id) { - SupplierQualification_copy supplierQualification = SupplierQualificationDao1.selectByPrimaryKey(id); - - return supplierQualification; - } - - - - @Override - public int deleteById(String id) { - return SupplierQualificationDao1.deleteByPrimaryKey(id); - } - - @Override - public int save(SupplierQualification_copy goods) { - return SupplierQualificationDao1.insert(goods); - } - - @Override - public int update(SupplierQualification_copy goods) { - return SupplierQualificationDao1.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - SupplierQualification_copy supplierQualification = new SupplierQualification_copy(); - supplierQualification.setWhere(wherestr); - List list = SupplierQualificationDao1.selectListByWhere(supplierQualification); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - SupplierQualification_copy supplierQualification = new SupplierQualification_copy(); - supplierQualification.setWhere(wherestr); - return SupplierQualificationDao1.deleteByWhere(supplierQualification); - } - - -} diff --git a/src/com/sipai/service/sparepart/SupplierQualification_fileService.java b/src/com/sipai/service/sparepart/SupplierQualification_fileService.java deleted file mode 100644 index 1c50f2b1..00000000 --- a/src/com/sipai/service/sparepart/SupplierQualification_fileService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SupplierQualification_fileDao; - -import com.sipai.entity.sparepart.SupplierQualification_file; - -import com.sipai.tools.CommService; - -@Service -public class SupplierQualification_fileService implements CommService{ - @Resource - private SupplierQualification_fileDao supplierQualification_fileDao; - - - @Override - public SupplierQualification_file selectById(String id) { - SupplierQualification_file SupplierQualification_file = supplierQualification_fileDao.selectByPrimaryKey(id); - - return SupplierQualification_file; - } - - - - @Override - public int deleteById(String id) { - return supplierQualification_fileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(SupplierQualification_file goods) { - return supplierQualification_fileDao.insert(goods); - } - - @Override - public int update(SupplierQualification_file goods) { - return supplierQualification_fileDao.updateByPrimaryKeySelective(goods); - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - SupplierQualification_file supplierQualification_file = new SupplierQualification_file(); - supplierQualification_file.setWhere(wherestr); - List list = supplierQualification_fileDao.selectListByWhere(supplierQualification_file); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - SupplierQualification_file supplierQualification_file = new SupplierQualification_file(); - supplierQualification_file.setWhere(wherestr); - return supplierQualification_fileDao.deleteByWhere(supplierQualification_file); - } - - -} diff --git a/src/com/sipai/service/sparepart/SupplierService.java b/src/com/sipai/service/sparepart/SupplierService.java deleted file mode 100644 index 575404ce..00000000 --- a/src/com/sipai/service/sparepart/SupplierService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.SupplierDao; -import com.sipai.entity.sparepart.Supplier; -import com.sipai.entity.sparepart.SupplierClass; -import com.sipai.tools.CommService; - -@Service -public class SupplierService implements CommService{ - @Resource - private SupplierDao supplierDao; - @Resource - private SupplierClassService supplierClassService; - - @Override - public Supplier selectById(String id) { - Supplier supplier = supplierDao.selectByPrimaryKey(id); - if (supplier.getClassId() != null && !supplier.getClassId().isEmpty()) { - SupplierClass supplierClass = this.supplierClassService.selectById(supplier.getClassId()); - supplier.setSupplierClass(supplierClass); - } - return supplier; - } - - @Override - public int deleteById(String id) { - return supplierDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Supplier supplier) { - return supplierDao.insert(supplier); - } - - @Override - public int update(Supplier supplier) { - return supplierDao.updateByPrimaryKeySelective(supplier); - } - - @Override - public List selectListByWhere(String wherestr) { - Supplier supplier = new Supplier(); - supplier.setWhere(wherestr); - List list = supplierDao.selectListByWhere(supplier); - for (Supplier item : list) { - if (item.getClassId() != null && !item.getClassId().isEmpty()) { - SupplierClass supplierClass = this.supplierClassService.selectById(item.getClassId()); - item.setSupplierClass(supplierClass); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Supplier supplier = new Supplier(); - supplier.setWhere(wherestr); - return supplierDao.deleteByWhere(supplier); - } -} diff --git a/src/com/sipai/service/sparepart/Supplier_copyService.java b/src/com/sipai/service/sparepart/Supplier_copyService.java deleted file mode 100644 index 03b7aa95..00000000 --- a/src/com/sipai/service/sparepart/Supplier_copyService.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.apache.cxf.binding.soap.interceptor.TibcoSoapActionInterceptor; -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.servlet.ModelAndView; - -import com.sipai.dao.sparepart.Supplier_copyDao; -import com.sipai.dao.user.DeptDao; -import com.sipai.dao.user.UnitDao; -import com.sipai.entity.sparepart.Supplier_copy; -import com.sipai.entity.sparepart.SupplierClass_copy; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -@Service -public class Supplier_copyService implements CommService{ - @Resource - private Supplier_copyDao supplierDao1; - @Resource - private UnitDao unitDao; - @Resource - private DeptDao deptDao; - @Resource - private SupplierClass_copyService supplierClassService1; - @Resource - private UnitService unitService; - @Override - public Supplier_copy selectById(String id) { - Supplier_copy supplier = supplierDao1.selectByPrimaryKey(id); - if (supplier.getClassId() != null && !supplier.getClassId().isEmpty()) { - SupplierClass_copy supplierClass = this.supplierClassService1.selectById(supplier.getClassId()); - supplier.setSupplierClass_copy(supplierClass); - } - return supplier; - } - - @Override - public int deleteById(String id) { - this.deptDao.deleteByPrimaryKey(id); - return supplierDao1.deleteByPrimaryKey(id); - } - - public int doCompanySave(Company t){ - int result = 0; - if(t.getPid() == null||t.getPid().length() == 0){ - t.setPid(CommString.Tree_Outsourcer); - } - if(this.unitService.getCompById(CommString.Tree_Outsourcer)==null){ - Company t1 = new Company(); - t1.setId(CommString.Tree_Outsourcer); - t1.setName("外包单位"); - t1.setActive(CommString.Flag_Active); - t1.setPid(CommString.Tree_Root); - t1.setAddress("外包单位"); - t1.setSname("外包"); - t1.setEname("WG"); - t1.setType(CommString.UNIT_TYPE_Maintainer); - this.unitService.saveComp(t1); - } - result = this.unitService.saveComp(t); - - - return result; - } - public int updateCompany(Company t) { - if(null == this.unitService.getCompById(t.getId())){ - if(t.getPid() == null||t.getPid().length() == 0){ - t.setPid(CommString.Tree_Outsourcer); - } - int result = this.unitService.saveComp(t); - return result; - } - return this.unitService.updateComp(t); - } - @Override - public int save(Supplier_copy supplier) { - return supplierDao1.insert(supplier); - } - - @Override - public int update(Supplier_copy supplier) { - return supplierDao1.updateByPrimaryKeySelective(supplier); - } - - @Override - public List selectListByWhere(String wherestr) { - Supplier_copy supplier = new Supplier_copy(); - supplier.setWhere(wherestr); - List list = supplierDao1.selectListByWhere(supplier); - for (Supplier_copy item : list) { - if (item.getClassId() != null && !item.getClassId().isEmpty()) { - SupplierClass_copy supplierClass = this.supplierClassService1.selectById(item.getClassId()); - item.setSupplierClass_copy(supplierClass); - } - } - return list; - } - @Override - public int deleteByWhere(String wherestr) { - Dept dept = new Dept(); - dept.setWhere(wherestr); - this.deptDao.deleteByWhere(dept); - Supplier_copy supplier = new Supplier_copy(); - supplier.setWhere(wherestr); - return supplierDao1.deleteByWhere(supplier); - } -} diff --git a/src/com/sipai/service/sparepart/WarehouseService.java b/src/com/sipai/service/sparepart/WarehouseService.java deleted file mode 100644 index cc415b55..00000000 --- a/src/com/sipai/service/sparepart/WarehouseService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.WarehouseDao; -import com.sipai.entity.sparepart.Warehouse; -import com.sipai.entity.user.Company; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class WarehouseService implements CommService{ - @Resource - private WarehouseDao warehouseDao; - @Resource - private UnitService unitService; - - @Override - public Warehouse selectById(String id) { - Warehouse warehouse = warehouseDao.selectByPrimaryKey(id); - if (null != warehouse && null != warehouse.getBizId() && !warehouse.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(warehouse.getBizId()); - warehouse.setCompany(company); - } - return warehouse; - } - - @Override - public int deleteById(String id) { - return warehouseDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Warehouse warehouse) { - return warehouseDao.insert(warehouse); - } - - @Override - public int update(Warehouse warehouse) { - return warehouseDao.updateByPrimaryKeySelective(warehouse); - } - - @Override - public List selectListByWhere(String wherestr) { - Warehouse warehouse = new Warehouse(); - warehouse.setWhere(wherestr); - List warehouses = warehouseDao.selectListByWhere(warehouse); - for (Warehouse item: warehouses) { - if (item.getBizId() != null && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - } - return warehouses; - } - @Override - public int deleteByWhere(String wherestr) { - Warehouse warehouse = new Warehouse(); - warehouse.setWhere(wherestr); - return warehouseDao.deleteByWhere(warehouse); - } -} diff --git a/src/com/sipai/service/sparepart/WarrantyPeriodService.java b/src/com/sipai/service/sparepart/WarrantyPeriodService.java deleted file mode 100644 index e9a0d1ce..00000000 --- a/src/com/sipai/service/sparepart/WarrantyPeriodService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.sparepart; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.sparepart.WarrantyPeriodDao; -import com.sipai.entity.sparepart.WarrantyPeriod; -import com.sipai.tools.CommService; - -@Service -public class WarrantyPeriodService implements CommService{ - @Resource - private WarrantyPeriodDao warrantyPeriodDao; - - @Override - public WarrantyPeriod selectById(String id) { - WarrantyPeriod warrantyPeriod = warrantyPeriodDao.selectByPrimaryKey(id); - return warrantyPeriod; - } - - @Override - public int deleteById(String id) { - return warrantyPeriodDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WarrantyPeriod warrantyPeriod) { - return warrantyPeriodDao.insert(warrantyPeriod); - } - - @Override - public int update(WarrantyPeriod warrantyPeriod) { - return warrantyPeriodDao.updateByPrimaryKeySelective(warrantyPeriod); - } - - @Override - public List selectListByWhere(String wherestr) { - WarrantyPeriod warrantyPeriod = new WarrantyPeriod(); - warrantyPeriod.setWhere(wherestr); - List list = warrantyPeriodDao.selectListByWhere(warrantyPeriod); - return list; - } - @Override - public int deleteByWhere(String wherestr) { - WarrantyPeriod warrantyPeriod = new WarrantyPeriod(); - warrantyPeriod.setWhere(wherestr); - return warrantyPeriodDao.deleteByWhere(warrantyPeriod); - } -} diff --git a/src/com/sipai/service/sparepart/impl/HazardousChemicalsServiceImpl.java b/src/com/sipai/service/sparepart/impl/HazardousChemicalsServiceImpl.java deleted file mode 100644 index 18f30a4b..00000000 --- a/src/com/sipai/service/sparepart/impl/HazardousChemicalsServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.service.sparepart.impl; - -import com.sipai.dao.sparepart.HazardousChemicalsDao; -import com.sipai.dao.workorder.WorkorderDetailDao; -import com.sipai.entity.sparepart.HazardousChemicals; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.sparepart.HazardousChemicalsService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -@Service -public class HazardousChemicalsServiceImpl implements HazardousChemicalsService { - @Resource - private HazardousChemicalsDao hazardousChemicalsDao; - - @Override - public HazardousChemicals selectById(String t) { - return hazardousChemicalsDao.selectByPrimaryKey(t); - } - - @Override - public HazardousChemicals selectSimpleById(String t) { - HazardousChemicals entity = hazardousChemicalsDao.selectByPrimaryKey(t); - return entity; - } - - @Override - public int deleteById(String t) { - return hazardousChemicalsDao.deleteByPrimaryKey(t); - } - - @Override - public int save(HazardousChemicals t) { - return hazardousChemicalsDao.insertSelective(t); - } - - @Override - public int update(HazardousChemicals t) { - return hazardousChemicalsDao.updateByPrimaryKeySelective(t); - } -} diff --git a/src/com/sipai/service/structure/StructureCardPictureRoutePointdetailService.java b/src/com/sipai/service/structure/StructureCardPictureRoutePointdetailService.java deleted file mode 100644 index fdcb05ad..00000000 --- a/src/com/sipai/service/structure/StructureCardPictureRoutePointdetailService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.structure; - -import java.util.List; - -import com.sipai.entity.structure.StructureCardPictureRoutePointdetail; - -public interface StructureCardPictureRoutePointdetailService { - - public abstract StructureCardPictureRoutePointdetail selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(StructureCardPictureRoutePointdetail entity); - - public abstract int update(StructureCardPictureRoutePointdetail entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/structure/StructureCardPictureRoutePointdetailServiceImpl.java b/src/com/sipai/service/structure/StructureCardPictureRoutePointdetailServiceImpl.java deleted file mode 100644 index 075d6b2e..00000000 --- a/src/com/sipai/service/structure/StructureCardPictureRoutePointdetailServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.structure; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.structure.StructureCardPictureRoutePointdetailDao; -import com.sipai.entity.structure.StructureCardPictureRoutePointdetail; - - -@Service -public class StructureCardPictureRoutePointdetailServiceImpl implements StructureCardPictureRoutePointdetailService{ - @Resource - private StructureCardPictureRoutePointdetailDao structureCardPictureRoutePointdetailDao; - - - @Override - public StructureCardPictureRoutePointdetail selectById(String id) { - return this.structureCardPictureRoutePointdetailDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.structureCardPictureRoutePointdetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(StructureCardPictureRoutePointdetail entity) { - return this.structureCardPictureRoutePointdetailDao.insert(entity); - } - - @Override - public int update(StructureCardPictureRoutePointdetail structureCardPictureRoutePointdetail) { - return this.structureCardPictureRoutePointdetailDao.updateByPrimaryKeySelective(structureCardPictureRoutePointdetail); - } - - @Override - public List selectListByWhere(String wherestr) { - StructureCardPictureRoutePointdetail structureCardPictureRoutePointdetail = new StructureCardPictureRoutePointdetail(); - structureCardPictureRoutePointdetail.setWhere(wherestr); - return this.structureCardPictureRoutePointdetailDao.selectListByWhere(structureCardPictureRoutePointdetail); - } - - @Override - public int deleteByWhere(String wherestr) { - StructureCardPictureRoutePointdetail structureCardPictureRoutePointdetail = new StructureCardPictureRoutePointdetail(); - structureCardPictureRoutePointdetail.setWhere(wherestr); - return this.structureCardPictureRoutePointdetailDao.deleteByWhere(structureCardPictureRoutePointdetail); - } - -} diff --git a/src/com/sipai/service/structure/StructureCardPictureRouteService.java b/src/com/sipai/service/structure/StructureCardPictureRouteService.java deleted file mode 100644 index 22ddabf6..00000000 --- a/src/com/sipai/service/structure/StructureCardPictureRouteService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.sipai.service.structure; - -import java.util.List; - -import com.sipai.entity.structure.StructureCardPictureRoute; - - - -public interface StructureCardPictureRouteService { - - public abstract StructureCardPictureRoute selectById(String id); - - public abstract int deleteById(String id); - - public abstract int deletePoint(String id, String previousId, String nextId); - - public abstract int save(StructureCardPictureRoute entity); - - public abstract int update(StructureCardPictureRoute entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /** - * 顺叙排序 - * @param source - * @return - */ - public abstract List sort(List source); - - - - -} diff --git a/src/com/sipai/service/structure/StructureCardPictureRouteServiceImpl.java b/src/com/sipai/service/structure/StructureCardPictureRouteServiceImpl.java deleted file mode 100644 index 87ebd233..00000000 --- a/src/com/sipai/service/structure/StructureCardPictureRouteServiceImpl.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.sipai.service.structure; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.structure.StructureCardPictureRouteDao; -import com.sipai.entity.structure.StructureCardPicture; -import com.sipai.entity.structure.StructureCardPictureRoute; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.tools.CommUtil; -@Service -public class StructureCardPictureRouteServiceImpl implements StructureCardPictureRouteService{ - - @Resource - private StructureCardPictureRouteDao structureCardPictureRouteDao; - @Resource - private PatrolPointService patrolPointService; - @Resource - private StructureCardPictureService structureCardPictureService; - - @Override - public StructureCardPictureRoute selectById(String id) { - return structureCardPictureRouteDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return structureCardPictureRouteDao.deleteByPrimaryKey(id); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#deletePoint(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - @Transactional - public int deletePoint(String id,String previousId,String nextId) { - try { - int res = this.deleteById(id); - if (res ==0) { - throw new RuntimeException(); - } - StructureCardPictureRoute structureCardPictureRoute = this.selectById(previousId); - if(structureCardPictureRoute!=null){ - structureCardPictureRoute.setNextId(nextId); - res= this.update(structureCardPictureRoute); - if (res ==0) { - throw new RuntimeException(); - } - } - structureCardPictureRoute = this.selectById(nextId); - if(structureCardPictureRoute!=null){ - structureCardPictureRoute.setPreviousId(previousId); - res= this.update(structureCardPictureRoute); - if (res ==0) { - throw new RuntimeException(); - } - } - return res; - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - throw new RuntimeException(); - } - - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#save(com.sipai.entity.timeefficiency.PatrolRoute) - */ - @Override - @Transactional - - public int save(StructureCardPictureRoute entity) { - try { - int res =structureCardPictureRouteDao.insert(entity); - if (res==1) { - String previousId = entity.getPreviousId(); - String nextId = entity.getNextId(); - if (previousId!=null && !previousId.isEmpty()) { - StructureCardPictureRoute structureCardPictureRoute = this.selectById(previousId); - structureCardPictureRoute.setNextId(entity.getId()); - res = this.update(structureCardPictureRoute); - if (res==0) { - throw new RuntimeException(); - } - } - if (nextId!=null && !nextId.isEmpty()) { - StructureCardPictureRoute structureCardPictureRoute = this.selectById(nextId); - structureCardPictureRoute.setPreviousId(entity.getId()); - res = this.update(structureCardPictureRoute); - if (res==0) { - throw new RuntimeException(); - } - } - - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#update(com.sipai.entity.timeefficiency.PatrolRoute) - */ - @Override - public int update(StructureCardPictureRoute entity) { - return structureCardPictureRouteDao.updateByPrimaryKeySelective(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - StructureCardPictureRoute structureCardPictureRoute = new StructureCardPictureRoute(); - structureCardPictureRoute.setWhere(wherestr); - List structureCardPictureRoutes= structureCardPictureRouteDao.selectListByWhere(structureCardPictureRoute); - for (StructureCardPictureRoute item: structureCardPictureRoutes) { - if (TimeEfficiencyCommStr.PatrolRoutType_PatrolPoint.equals(item.getType())) { - PatrolPoint patrolPoint=patrolPointService.selectById(item.getPatrolPointId()); - item.setPatrolPoint(patrolPoint); - } - } - structureCardPictureRoutes=sort(structureCardPictureRoutes); - return structureCardPictureRoutes; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - StructureCardPictureRoute structureCardPictureRoute = new StructureCardPictureRoute(); - structureCardPictureRoute.setWhere(wherestr); - return structureCardPictureRouteDao.deleteByWhere(structureCardPictureRoute); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#sort(java.util.List) - */ - @Override - public List sort(List source){ - List dest = new ArrayList<>(); - List last = new ArrayList<>(); - //寻找所有尾结点,并存储 - Iterator iterator = source.iterator(); - while (iterator.hasNext()) { - StructureCardPictureRoute item_src = (StructureCardPictureRoute)iterator.next(); - if (item_src.getPreviousId()==null || item_src.getPreviousId().isEmpty()) { - last.add(item_src); - iterator.remove(); - } - } - //按尾节点 巡检链表上的其它节点 - for (StructureCardPictureRoute item_last : last) { - iterator = source.iterator(); - List parent = new ArrayList<>(); - parent.add(item_last); - while (iterator.hasNext()) { - StructureCardPictureRoute item_src = (StructureCardPictureRoute)iterator.next(); - //若查询到父节点则在存储后,重新查 - if (parent.get(parent.size()-1).getId().equals(item_src.getPreviousId())) { - parent.add(item_src); - iterator.remove(); - iterator = source.iterator(); - } - } - dest.addAll(parent); - } - //存储其它异常的节点 - dest.addAll(source); - return dest; - } - -} diff --git a/src/com/sipai/service/structure/StructureCardPictureService.java b/src/com/sipai/service/structure/StructureCardPictureService.java deleted file mode 100644 index 409bca95..00000000 --- a/src/com/sipai/service/structure/StructureCardPictureService.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.service.structure; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.structure.StructureCardPictureDao; -import com.sipai.entity.structure.StructureCardPicture; -import com.sipai.entity.user.Company; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class StructureCardPictureService implements CommService{ - @Resource - private StructureCardPictureDao structureCardPictureDao; - @Resource - private UnitService unitService; - - @Override - public StructureCardPicture selectById(String id) { - StructureCardPicture structureCardPicture = this.structureCardPictureDao.selectByPrimaryKey(id); - - return structureCardPicture; - } - - @Override - public int deleteById(String id) { - return this.structureCardPictureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(StructureCardPicture entity) { - return this.structureCardPictureDao.insert(entity); - } - - @Override - public int update(StructureCardPicture structureCardPicture) { - return this.structureCardPictureDao.updateByPrimaryKeySelective(structureCardPicture); - } - - @Override - public List selectListByWhere(String wherestr) { - StructureCardPicture structureCardPicture = new StructureCardPicture(); - structureCardPicture.setWhere(wherestr); - List StructureCardPictures = this.structureCardPictureDao.selectListByWhere(structureCardPicture); - for(StructureCardPicture item: StructureCardPictures){ - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - } - return StructureCardPictures; - } - - @Override - public int deleteByWhere(String wherestr) { - StructureCardPicture structureCardPicture = new StructureCardPicture(); - structureCardPicture.setWhere(wherestr); - return this.structureCardPictureDao.deleteByWhere(structureCardPicture); - } - - public List selectListGroupByFloor(String wherestr){ - StructureCardPicture structureCardPicture = new StructureCardPicture(); - structureCardPicture.setWhere(wherestr); - List StructureCardPictures = this.structureCardPictureDao.selectListGroupByFloor(structureCardPicture); - return StructureCardPictures; - } - - public List selectListGroupByStructureId(String wherestr){ - StructureCardPicture structureCardPicture = new StructureCardPicture(); - structureCardPicture.setWhere(wherestr); - List StructureCardPictures = this.structureCardPictureDao.selectListGroupByStructureId(structureCardPicture); - return StructureCardPictures; - } - -} diff --git a/src/com/sipai/service/structure/StructureCardService.java b/src/com/sipai/service/structure/StructureCardService.java deleted file mode 100644 index 5e949e7f..00000000 --- a/src/com/sipai/service/structure/StructureCardService.java +++ /dev/null @@ -1,557 +0,0 @@ -package com.sipai.service.structure; - -import java.io.FileInputStream; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -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.POIFSFileSystem; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import com.sipai.dao.structure.StructureCardDao; -import com.sipai.entity.equipment.AssetClass; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.structure.Structure; -import com.sipai.entity.structure.StructureCard; -import com.sipai.entity.structure.StructureClass; -import com.sipai.entity.structure.StructureCommStr; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ExtSystem; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.ExtSystemService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; - - -@Service -public class StructureCardService implements CommService{ - @Resource - private StructureCardDao structureCardDao; - @Resource - private MPointService mPointService; - @Resource - private StructureClassService structureClassService; - @Resource - private ExtSystemService extSystemService; - @Resource - private UnitService unitService; - @Resource - private ProcessSectionService processSectionService; -// @Resource -// private LineService lineService; - @Resource - private EquipmentCardService equipmentCardService; - - public List selectList() { - // TODO Auto-generated method stub - StructureCard structureCard = new StructureCard(); - return this.structureCardDao.selectList(structureCard); - } - - - @Override - public StructureCard selectById(String id) { - StructureCard structureCard = this.structureCardDao.selectByPrimaryKey(id); - if(structureCard !=null){ - StructureCard p = this.structureCardDao.selectByPrimaryKey(structureCard.getPid()); - if(p!=null){ - structureCard.set_pname(p.getName()); - } - if(structureCard.getDesignCode()!=null - && !structureCard.getDesignCode().equals("")){ - MPoint mPoint = this.mPointService.selectById(null, structureCard.getDesignCode()); - structureCard.set_design(mPoint.getParmvalue()); - } - if(structureCard.getAdjustableCode()!=null - && !structureCard.getAdjustableCode().equals("")){ - MPoint mPoint = this.mPointService.selectById(null, structureCard.getAdjustableCode()); - structureCard.set_adjustable(mPoint.getParmvalue()); - } - if(structureCard.getCurrentCode()!=null - && !structureCard.getCurrentCode().equals("")){ - MPoint mPoint = this.mPointService.selectById(null, structureCard.getCurrentCode()); - structureCard.set_current(mPoint.getParmvalue()); - } - if(structureCard.getLoadCode()!=null - && !structureCard.getLoadCode().equals("")){ - MPoint mPoint = this.mPointService.selectById(null, structureCard.getLoadCode()); - structureCard.set_load(mPoint.getParmvalue()); - } - } - return structureCard; - } - - @Override - public int deleteById(String id) { - return this.structureCardDao.deleteByPrimaryKey(id); - } - - @Override - public int save(StructureCard entity) { - return this.structureCardDao.insertSelective(entity); - } - - @Override - public int update(StructureCard structureCard) { - return this.structureCardDao.updateByPrimaryKeySelective(structureCard); - } - - @Override - public List selectListByWhere(String wherestr) { - StructureCard structureCard = new StructureCard(); - structureCard.setWhere(wherestr); - List structureCards = this.structureCardDao.selectListByWhere(structureCard); - return structureCards; - } - public List selectStructureListByLine(String wherestr,String lineid) { - StructureCard structureCard = new StructureCard(); - structureCard.setWhere(wherestr); - List structureCards = this.structureCardDao.selectStructureListByLine(structureCard); - return structureCards; - } - @Override - public int deleteByWhere(String wherestr) { - StructureCard structureCard = new StructureCard(); - structureCard.setWhere(wherestr); - return this.structureCardDao.deleteByWhere(structureCard); - } - - public List getStructureCard(String wherestr){ - StructureCard structureCard=new StructureCard(); - structureCard.setWhere(wherestr); - return this.structureCardDao.getStructureCard(structureCard); - } - - public StructureCard getStructureCardById( String structurecardid){ - StructureCard structureCard=new StructureCard(); - structureCard.setWhere(" where E.id='"+structurecardid+"' order by E.structurecardid"); - return this.structureCardDao.getStructureCard(structureCard).get(0); - } - /** - * 是否未被占用 - * @param id - * @param structurecardid - * @return - */ - public boolean checkNotOccupied(String id, String structurecardid) { - List list = this.selectListByWhere("where structurecardid ='"+structurecardid+"'"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return true; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(StructureCard structurecard :list){ - if(!id.equals(structurecard.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - - return false; - } - - /** - * 递归获取子节点 - * @param list - */ - public List getChildren(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0;i result=getChildren(t.get(i).getId(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - - /** - * 递归获取父节点 - * @param - */ - public List getParent(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0;i result =getParent(t.get(i).getPid(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - - /** - * 获取树 - * @方法名:getTreeList - */ - public String getTreeList(List> list_result, List list, List equList, String structureId) { - if(list==null || list.size()==0){ - List> equMapList = this.equipmentCardService.getEquipmentByStructureId(structureId, equList); - return JSONArray.fromObject(equMapList).toString(); - } - if( list_result == null ) { - //找根节点 - list_result = new ArrayList>(); - for(StructureCard k: list) { - Map map = new HashMap(); - Inner:for(int i =0;i0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(StructureCard k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("label", k.getName()); - m.put("type", CommString.Flag_Structure); - childlist.add(m); - } - } - // 获取设备 - List> equMapList = this.equipmentCardService.getEquipmentByStructureId(mp.get("id")+"", equList); - childlist.addAll(equMapList); - if(childlist.size()>0) { - mp.put("children", childlist); - getTreeList(childlist,list,equList,null); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(StructureCard k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(StructureCard k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid",k.getPid()); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList4Structure(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(Structure k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - map.put("type", k.getType()); - if(k.getType()!=null && k.getType().equals(CommString.ZERO_STRING)){ - map.put("icon", StructureCommStr.iconLevel0); - } - if(k.getType()!=null && k.getType().equals(CommString.ONE_STRING)){ - map.put("icon", StructureCommStr.iconLevel1); - } - if(k.getType()!=null && k.getType().equals(CommString.TWO_STRING)){ - map.put("icon", StructureCommStr.iconLevel2); - } - list_result.add(map); - } - } - getTreeList4Structure(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Structure k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid",k.getPid()); - m.put("type", k.getType()); - if(k.getType()!=null && k.getType().equals(CommString.ZERO_STRING)){ - m.put("icon", StructureCommStr.iconLevel0); - } - if(k.getType()!=null && k.getType().equals(CommString.ONE_STRING)){ - m.put("icon", StructureCommStr.iconLevel1); - } - if(k.getType()!=null && k.getType().equals(CommString.TWO_STRING)){ - m.put("icon", StructureCommStr.iconLevel2); - } - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - - getTreeList4Structure(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - /** - * 得到测量点的值 - * @param list - * @return - */ - public List getEquipStatusByList(List list) { - String[] items = CommString.MPointFunType; - for (StructureCard structureCard : list) { - /*List structurePoints=this.structurePointService.selectListByWhere(" where structurecardid='"+structureCard.getId()+"' order by insdt"); - if(structurePoints!=null &&structurePoints.size()>0){ - String ids=""; - for(StructurePoint structurePoint:structurePoints){ - if(!ids.isEmpty()){ - ids+=","; - } - ids+=structurePoint.getPointid(); - } - List mPoints =this.mPointService.getvaluefunc(structureCard.getBizid(),ids); - boolean status_flag=false;//状态测量点存在标示 - boolean status_dj=false; - boolean status_gz=false; - boolean status_qd=false; - for(MPoint mPoint:mPoints ){ - String exp=mPoint.getPointfunctiondefinition(); - if (exp==null||exp.isEmpty()) { - continue; - } - switch (exp) { - case "故障": - status_flag=true; - boolean res = mPointService.getResByExpression(mPoint.getExp(), mPoint.getParmvalue().doubleValue()); - if(res){ - status_gz= true; - } - break; - case "待机": - status_flag=true; - res = mPointService.getResByExpression(mPoint.getExp(), mPoint.getParmvalue().doubleValue()); - if(res){ - status_dj= true; - } - break; - case "启停": - status_flag=true; - res = mPointService.getResByExpression(mPoint.getExp(), mPoint.getParmvalue().doubleValue()); - if(res){ - status_qd= true; - } - break; - - default: - break; - } - } - if(status_gz){ - structureCard.setStructurestatus(StructureCard.Status_Fault); - }else if(status_qd){ - structureCard.setStructurestatus(StructureCard.Status_ON); - if(status_dj){ - structureCard.setStructurestatus(structureCard.Status_StandBy); - } - }else if(status_flag){ - structureCard.setStructurestatus(StructureCard.Status_OFF); - }else{ - structureCard.setStructurestatus(StructureCard.Status_UnMatch); - } - - }else{ - structureCard.setStructurestatus(StructureCard.Status_UnMatch); - }*/ - } - return list; - - } - - - public List selectListByWhere4UV(String wherestr) { - Structure structure = new Structure(); - structure.setWhere(wherestr); - return this.structureCardDao.selectListByWhere4UV(structure); - } -// /** -// * 获取设备类型 -// * @param list -// * @return -// */ -// public StructureClass getStructureClass(String structureId) { -// StructureCard structureCard =this.selectById(structureId); -// StructureClass structureClass= structureClassService.selectById(structureCard.getStructureclassid()); -// return structureClass; -// } -// /** -// * Structurecardid是否已存在 -// * @param Structurecardid -// * @return boolean -// */ -// public boolean checkNotOccupiedbycode(String Structurecardid) { -// List list = this.selectListByWhere("where structurecardid = '"+Structurecardid+"'order by structurecardid asc"); -// -// if(list!=null && list.size()>0){ -// return false; -// } -// -// return true; -// } -// /** -// * 获取设备信息 -// * map参数: ids,bizid,page,row,searchName,psectionid -// * */ -// public String getStructures(Map map) { -// String url=""; -// ExtSystem extSystem= this.extSystemService.getActiveDataManage(null); -// if(extSystem!=null){ -// url=extSystem.getUrl(); -// } -// url+="/proapp.do?method=getStructures"; -// String resp = com.sipai.tools.HttpUtil.sendPost(url, map); -// return resp; -// } -// -// public StructureCard selectById(String bizId,String id) { -// StructureCard structureCard = this.structureCardDao.selectByPrimaryKey(id); -// if(structureCard.getProcesssectionid() != null && structureCard.getProcesssectionid() != ""){ -// ProcessSection processSection = processSectionService.selectById(structureCard.getProcesssectionid()); -// structureCard.setProcessSection(processSection); -// } -// /** -// * 设备查询接口增加设备关联的产线 -// */ -// List lines = lineService.selectLineListWithEqu(" where E.structure_id='"+id+"' order by E.id desc"); -// structureCard.setLineList(lines); -// if(structureCard.getStructureclassid() != null && structureCard.getStructureclassid() != ""){ -// StructureClass structureClass = structureClassService.selectById(structureCard.getStructureclassid()); -// structureCard.setStructureClass(structureClass); -// } -// return structureCard; -// } -// -// public List selectListByWhere(String bizId,String wherestr) { -// StructureCard group = new StructureCard(); -// group.setWhere(wherestr); -// List structureCards =this.structureCardDao.selectListByWhere(group); -// return structureCards; -// } -// -// public List selectListByWhere4Count(String wherestr) { -// StructureCard structureCard = new StructureCard(); -// structureCard.setWhere(wherestr); -// return null; -// /*return structureCards;*/ -// } - - List t = new ArrayList(); - public List getUnitChildrenById(String id){ - t=selectListByWhere(" where 1=1 order by morder"); - List listRes = getChildren(id,t); - listRes.add(selectById(id)); - listRes.removeAll(Collections.singleton(null)); - return listRes; - } - - - -} diff --git a/src/com/sipai/service/structure/StructureClassService.java b/src/com/sipai/service/structure/StructureClassService.java deleted file mode 100644 index 217ac57a..00000000 --- a/src/com/sipai/service/structure/StructureClassService.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.service.structure; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.structure.StructureClassDao; -import com.sipai.entity.structure.StructureCard; -import com.sipai.entity.structure.StructureClass; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -@Service -public class StructureClassService implements CommService{ - @Resource - private StructureClassDao structureClassDao; - - public List selectList() { - // TODO Auto-generated method stub - StructureClass structureClass = new StructureClass(); - return this.structureClassDao.selectList(structureClass); - } - - - @Override - public StructureClass selectById(String id) { - return this.structureClassDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.structureClassDao.deleteByPrimaryKey(id); - } - - @Override - public int save(StructureClass structureClass) { - return this.structureClassDao.insert(structureClass); - } - - @Override - public int update(StructureClass structureClass) { - return this.structureClassDao.updateByPrimaryKeySelective(structureClass); - } - - @Override - public List selectListByWhere(String wherestr) { - StructureClass structureClass = new StructureClass(); - structureClass.setWhere(wherestr); - return this.structureClassDao.selectListByWhere(structureClass); - } - - @Override - public int deleteByWhere(String wherestr) { - StructureClass structureClass = new StructureClass(); - structureClass.setWhere(wherestr); - return this.structureClassDao.deleteByWhere(structureClass); - } - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name) { - List list = this.selectListByWhere(" where name='"+name+"' order by insdt"); - if(id == null){//新增 - if(list!=null && list.size()>0){ - return true; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(StructureClass structureclass :list){ - if(!id.equals(structureclass.getId())){//不是当前编辑的那条记录 - return true; - } - } - } - } - return false; - } - - -} diff --git a/src/com/sipai/service/teacher/TeacherFileService.java b/src/com/sipai/service/teacher/TeacherFileService.java deleted file mode 100644 index 36acfc3e..00000000 --- a/src/com/sipai/service/teacher/TeacherFileService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.teacher; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.teacher.TeacherFileDao; -import com.sipai.entity.teacher.TeacherFile; -import com.sipai.tools.CommService; -@Service -public class TeacherFileService implements CommService{ - @Resource - private TeacherFileDao teacherFileDao; - - @Override - public TeacherFile selectById(String id) { - TeacherFile teacherFile = this.teacherFileDao.selectByPrimaryKey(id); - return teacherFile; - } - - @Override - public int deleteById(String id) { - int res = this.teacherFileDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(TeacherFile teacherFile) { - int res = this.teacherFileDao.insert(teacherFile); - return res; - } - - @Override - public int update(TeacherFile teacherFile) { - int res = this.teacherFileDao.updateByPrimaryKeySelective(teacherFile); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - TeacherFile teacherFile = new TeacherFile(); - teacherFile.setWhere(wherestr); - List teacherFiles = this.teacherFileDao.selectListByWhere(teacherFile); - - return teacherFiles; - } - - @Override - public int deleteByWhere(String wherestr) { - TeacherFile teacherFile = new TeacherFile(); - teacherFile.setWhere(wherestr); - return this.teacherFileDao.deleteByWhere(teacherFile); - } - -} diff --git a/src/com/sipai/service/teacher/TeachertypeService.java b/src/com/sipai/service/teacher/TeachertypeService.java deleted file mode 100644 index 63565280..00000000 --- a/src/com/sipai/service/teacher/TeachertypeService.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.service.teacher; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.teacher.TeachertypeDao; -import com.sipai.entity.teacher.Teachertype; -import com.sipai.tools.CommService; - -import net.sf.json.JSONArray; - -@Service -public class TeachertypeService implements CommService{ - @Resource - private TeachertypeDao teachertypeDao; - - @Override - public Teachertype selectById(String id) { - Teachertype teachertype = this.teachertypeDao.selectByPrimaryKey(id); - return teachertype; - } - - @Override - public int deleteById(String id) { - int res = this.teachertypeDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(Teachertype teachertype) { - int res = this.teachertypeDao.insert(teachertype); - return res; - } - - @Override - public int update(Teachertype teachertype) { - int res = this.teachertypeDao.updateByPrimaryKeySelective(teachertype); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - Teachertype teachertype = new Teachertype(); - teachertype.setWhere(wherestr); - List teachertypes = this.teachertypeDao.selectListByWhere(teachertype); - return teachertypes; - } - - @Override - public int deleteByWhere(String wherestr) { - Teachertype teachertype = new Teachertype(); - teachertype.setWhere(wherestr); - return this.teachertypeDao.deleteByWhere(teachertype); - } - - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (Teachertype k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (Teachertype k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - // List tags = new ArrayList(); - // tags.add(k.getDescription()); - // m.put("tags", tags); - childlist.add(m); - } - } - if (childlist.size() > 0) { - /* - * List sizelist = new ArrayList(); - * sizelist.add(childlist.size()+""); mp.put("tags", - * sizelist); - */ - mp.put("nodes", childlist); - // JSONObject jsonObject = new JSONObject(); - // jsonObject.put("text", "sdfsf"); - - getTreeList(childlist, list); - } - } - } - /* - * for (Map item : list_result) { JSONObject jsonObject - * = new JSONObject(); item.put("state", jsonObject); jsonObject=null; } - */ - return JSONArray.fromObject(list_result).toString(); - } - - /** - * 获得当前节点所有的子元素(包含当前节点) - * @param id - * @return - */ - - List t = new ArrayList(); - public List getUnitChildrenById(String id){ - t=selectList(); - List listRes = getChildren(id); - listRes.add(getUnitById(id)); - listRes.removeAll(Collections.singleton(null)); - return listRes; - } - - - public List selectList() { - Teachertype teachertype= new Teachertype(); - return this.teachertypeDao.selectList(teachertype); - } - - /** - * 递归获取子节点 - * @param list - */ - public List getChildren(String pid){ - t=selectListByWhere(" where 1=1"); - List t2 = new ArrayList(); - for(int i=0;i{ - - @Resource - private ClockinRecordDao clockinRecordDao; - - @Override - public ClockinRecord selectById(String id) { - ClockinRecord clockinRecord=clockinRecordDao.selectByPrimaryKey(id); - return clockinRecord; - } - - @Override - public int deleteById(String id) { - return clockinRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ClockinRecord entity) { - return this.clockinRecordDao.insert(entity); - } - - @Override - public int update(ClockinRecord clockinRecord) { - return clockinRecordDao.updateByPrimaryKeySelective(clockinRecord); - } - - @Override - public List selectListByWhere(String wherestr) { - ClockinRecord clockinRecord = new ClockinRecord(); - clockinRecord.setWhere(wherestr); - return clockinRecordDao.selectListByWhere(clockinRecord); - } - - @Override - public int deleteByWhere(String wherestr) { - ClockinRecord clockinRecord = new ClockinRecord(); - clockinRecord.setWhere(wherestr); - return clockinRecordDao.deleteByWhere(clockinRecord); - } - - /** - * 获取时间范围内的打卡人员数量 - */ - public List selectClockinUserByWhere(String wherestr) { - ClockinRecord clockinRecord = new ClockinRecord(); - clockinRecord.setWhere(wherestr); - return clockinRecordDao.selectClockinUserByWhere(clockinRecord); - } - - - //导出巡检人员打卡记录Excel - public void downloadClockInRecordExcel(HttpServletResponse response,List crList) throws IOException { - //行索引 - int rowIndex=0; - //序号 - int serialNum=1; - String fileName="巡检人员打卡记录"+CommUtil.nowDate().substring(0,10)+".xlsx"; - String sheetName = "巡检人员打卡记录"; - //表头 - String[] title={"序号","姓名","打卡时间","是否准时"}; - //创建excel文档工作簿(xlsx支持数据量可超过100万行,xls最大支持65535行) - XSSFWorkbook workBook=new XSSFWorkbook(); - //创建Sheet对象 - XSSFSheet sheet=workBook.createSheet(sheetName); - - //设置单元格样式 - XSSFCellStyle cellStyle=workBook.createCellStyle(); - cellStyle.setAlignment(HorizontalAlignment.CENTER); - XSSFRow firRow=sheet.createRow(rowIndex++); - sheet.addMergedRegion(new CellRangeAddress(0,0,0,title.length-1)); - firRow.createCell(0).setCellStyle(cellStyle); - firRow.getCell(0).setCellValue(crList.get(0).getCompanyName()+sheetName); - - //创建行 - XSSFRow secRow=sheet.createRow(rowIndex++); - //创建单元格 - //XSSFCell cell=row.createCell(0); - for(int i=0;i{ - @Resource - private EfficiencyProcessDao efficiencyProcessDao; - @Resource - private CameraService cameraService; - - @Override - public EfficiencyProcess selectById(String t) { - return efficiencyProcessDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return efficiencyProcessDao.deleteByPrimaryKey(t); - } - - @Override - public int save(EfficiencyProcess t) { - // TODO Auto-generated method stub - return efficiencyProcessDao.insertSelective(t); - } - - @Override - public int update(EfficiencyProcess t) { - // TODO Auto-generated method stub - return efficiencyProcessDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - EfficiencyProcess efficiencyProcess = new EfficiencyProcess(); - efficiencyProcess.setWhere(t); - return efficiencyProcessDao.selectListByWhere(efficiencyProcess); - } - - @Override - public int deleteByWhere(String t) { - EfficiencyProcess efficiencyProcess = new EfficiencyProcess(); - efficiencyProcess.setWhere(t); - return efficiencyProcessDao.deleteByWhere(efficiencyProcess); - } - - public List selectListCameraByWhere(String t){ - List list = selectListByWhere(t); - for(EfficiencyProcess efficiencyProcess:list){ - //efficiencyProcess.setCamera(cameraService.selectById(efficiencyProcess.getCameraid())); - } - return list; - } - -} diff --git a/src/com/sipai/service/timeefficiency/ElectricityPriceDetailService.java b/src/com/sipai/service/timeefficiency/ElectricityPriceDetailService.java deleted file mode 100644 index f2ac3fd9..00000000 --- a/src/com/sipai/service/timeefficiency/ElectricityPriceDetailService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.timeefficiency.ElectricityPriceDetailDao; -import com.sipai.entity.timeefficiency.ElectricityPriceDetail; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; -@Service -public class ElectricityPriceDetailService implements CommService{ - @Resource - private ElectricityPriceDetailDao electricityPriceDetailDao; - @Resource - private CameraService cameraService; - - @Override - public ElectricityPriceDetail selectById(String t) { - return electricityPriceDetailDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return electricityPriceDetailDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ElectricityPriceDetail t) { - // TODO Auto-generated method stub - return electricityPriceDetailDao.insertSelective(t); - } - - @Override - public int update(ElectricityPriceDetail t) { - // TODO Auto-generated method stub - return electricityPriceDetailDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - ElectricityPriceDetail electricityPriceDetail = new ElectricityPriceDetail(); - electricityPriceDetail.setWhere(t); - return electricityPriceDetailDao.selectListByWhere(electricityPriceDetail); - } - - @Override - public int deleteByWhere(String t) { - ElectricityPriceDetail electricityPriceDetail = new ElectricityPriceDetail(); - electricityPriceDetail.setWhere(t); - return electricityPriceDetailDao.deleteByWhere(electricityPriceDetail); - } - - public List selectListCameraByWhere(String t){ - List list = selectListByWhere(t); - for(ElectricityPriceDetail electricityPriceDetail:list){ - //electricityPriceDetail.setCamera(cameraService.selectById(electricityPriceDetail.getCameraid())); - } - return list; - } - -} diff --git a/src/com/sipai/service/timeefficiency/ElectricityPriceService.java b/src/com/sipai/service/timeefficiency/ElectricityPriceService.java deleted file mode 100644 index 4eac093d..00000000 --- a/src/com/sipai/service/timeefficiency/ElectricityPriceService.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.timeefficiency.ElectricityPriceDao; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.timeefficiency.EfficiencyProcess; -import com.sipai.entity.timeefficiency.ElectricityPrice; -import com.sipai.entity.timeefficiency.ElectricityPriceDetail; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderAchievement; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; - -@Service -public class ElectricityPriceService implements CommService { - @Resource - private ElectricityPriceDao electricityPriceDao; - @Resource - private CameraService cameraService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private EfficiencyProcessService efficiencyProcessService; - @Resource - private ElectricityPriceDetailService electricityPriceDetailService; - - @Override - public ElectricityPrice selectById(String t) { - return electricityPriceDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return electricityPriceDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ElectricityPrice t) { - // TODO Auto-generated method stub - return electricityPriceDao.insertSelective(t); - } - - @Override - public int update(ElectricityPrice t) { - // TODO Auto-generated method stub - return electricityPriceDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - ElectricityPrice electricityPrice = new ElectricityPrice(); - electricityPrice.setWhere(t); - return electricityPriceDao.selectListByWhere(electricityPrice); - } - - @Override - public int deleteByWhere(String t) { - ElectricityPrice electricityPrice = new ElectricityPrice(); - electricityPrice.setWhere(t); - return electricityPriceDao.deleteByWhere(electricityPrice); - } - - public Double getElectricitytimebybizId(String bizId, String startime, String endtime) { - Double Electricitytime = (double) 0; - List efficiencyProcesss = this.efficiencyProcessService.selectListByWhere("where bizid = '" + bizId + "'"); - for (EfficiencyProcess efficiencyProcess : efficiencyProcesss) { - List mPointHistories = mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + efficiencyProcess.getCode(), " where MeasureDT >'" + startime + "' and MeasureDT <'" + endtime + "'"); - for (MPointHistory mPointHistory : mPointHistories) { - Electricitytime = Electricitytime + mPointHistory.getParmvalue().doubleValue(); - } - } - - return Electricitytime; - } - - public Double getElectricityPricebybizId(String bizId, String startime, String endtime, ElectricityPrice electricityPricecode) { - //Double Electricitytime = (double) 0; - Double electricityPrice = (double) 0; - List efficiencyProcesss = this.efficiencyProcessService.selectListByWhere("where bizid = '" + bizId + "'"); - for (EfficiencyProcess efficiencyProcess : efficiencyProcesss) { - - List mPointHistories = mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + efficiencyProcess.getCode(), " where MeasureDT >'" + startime + "' and MeasureDT <'" + endtime + "'"); - for (MPointHistory mPointHistory : mPointHistories) { - List electricityPriceDetailList = electricityPriceDetailService.selectListByWhere("where pid = '" + electricityPricecode.getId() + "' "); - // Electricitytime = Electricitytime + mPointHistory.getParmvalue().doubleValue(); - boolean flag = true; - for (ElectricityPriceDetail electricityPriceDetail : electricityPriceDetailList) { - - try { - if (isEffectiveDate(mPointHistory.getMeasuredt().substring(11, mPointHistory.getMeasuredt().length()), electricityPriceDetail.getStartTime(), electricityPriceDetail.getEndTime())) { - electricityPrice = electricityPrice + (mPointHistory.getParmvalue().doubleValue() * electricityPriceDetail.getDianduprice()); - flag = false; - break; - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if (flag) { - electricityPrice = electricityPrice + (mPointHistory.getParmvalue().doubleValue() * electricityPricecode.getDianduprice()); - } - - } - } - - return electricityPrice; - } - - public List selectListCameraByWhere(String t) { - List list = selectListByWhere(t); - for (ElectricityPrice electricityPrice : list) { - //electricityPrice.setCamera(cameraService.selectById(electricityPrice.getCameraid())); - } - return list; - } - - /** - * 判断当前时间是否在[startTime, endTime]区间,注意时间格式要一致 - * - * @param nowTime 当前时间 - * @param startTime 开始时间 - * @param endTime 结束时间 - * @return - * @throws ParseException - */ - public static boolean isEffectiveDate(String nowTimeString, String startTimeString, String endTimeString) throws ParseException { - String format = "HH:mm:ss"; - - Date nowTime = new SimpleDateFormat(format).parse(nowTimeString); - Date startTime; - - startTime = new SimpleDateFormat(format).parse(startTimeString); - - Date endTime = new SimpleDateFormat(format).parse(endTimeString); - if (nowTime.getTime() == startTime.getTime() - || nowTime.getTime() == endTime.getTime()) { - return true; - } - - Calendar date = Calendar.getInstance(); - date.setTime(nowTime); - - Calendar begin = Calendar.getInstance(); - begin.setTime(startTime); - - Calendar end = Calendar.getInstance(); - end.setTime(endTime); - - - if (date.after(begin) && date.before(end)) { - return true; - } else { - return false; - } - } -} diff --git a/src/com/sipai/service/timeefficiency/PatrolAreaFloorService.java b/src/com/sipai/service/timeefficiency/PatrolAreaFloorService.java deleted file mode 100644 index 4c40b099..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolAreaFloorService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolAreaFloor; - -public interface PatrolAreaFloorService { - - public abstract PatrolAreaFloor selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolAreaFloor entity); - - public abstract int update(PatrolAreaFloor patrolArea); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolAreaProcessSectionService.java b/src/com/sipai/service/timeefficiency/PatrolAreaProcessSectionService.java deleted file mode 100644 index ee7e88c3..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolAreaProcessSectionService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolAreaProcessSection; - -public interface PatrolAreaProcessSectionService { - - public abstract PatrolAreaProcessSection selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolAreaProcessSection entity); - - public abstract int update(PatrolAreaProcessSection patrolareaprocessSection); - - public abstract List selectListByWhere( - String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /** - * 搜索不同水厂,复制区域后新区域对应的新工艺段 - * @param wherestr - * @return - */ - public abstract List selectNewProcessSectionByWhere( - String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolAreaService.java b/src/com/sipai/service/timeefficiency/PatrolAreaService.java deleted file mode 100644 index c3632a05..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolAreaService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.user.ProcessSection; - -public interface PatrolAreaService { - - public abstract PatrolArea selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolArea entity); - - public abstract int update(PatrolArea patrolArea); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /** - * 获取巡检区域的工艺段 - * @param patrolAreaId - * @return - */ - public abstract List getProcessSections(String patrolAreaId); - - /** - * 获取巡检区域内的巡检点 - * @param patrolAreaId - * @return - */ - public abstract List getPatrolPoints(String patrolAreaId,String type); - /* - public List selectScheduleList(String wherestr) { - PatrolArea patrolArea = new PatrolArea(); - patrolArea.setWhere(wherestr); - - List patrolAreas= patrolAreaDao.selectListByWhere(patrolArea); - for (PatrolArea item : patrolAreas) { - List list = patrolAreaProcessSectionService.selectListByWhere("where patrolAreaId = '"+item.getId()+"'"); - for (int i = 0; i < list.size(); i++) { - - } - item.setProcessSection(); - } - - return patrolAreaDao.selectListByWhere(patrolArea); - }*/ - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolAreaUserService.java b/src/com/sipai/service/timeefficiency/PatrolAreaUserService.java deleted file mode 100644 index f24d8f2c..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolAreaUserService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.timeefficiency; - - -import com.sipai.entity.timeefficiency.PatrolAreaUser; -import java.util.List; - -public interface PatrolAreaUserService { - - public abstract PatrolAreaUser selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolAreaUser entity); - - public abstract int update(PatrolAreaUser entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} diff --git a/src/com/sipai/service/timeefficiency/PatrolContentsPlanService.java b/src/com/sipai/service/timeefficiency/PatrolContentsPlanService.java deleted file mode 100644 index fd004995..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolContentsPlanService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolContentsPlan; - - -public interface PatrolContentsPlanService { - public abstract PatrolContentsPlan selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolContentsPlan entity); - - public abstract int update(PatrolContentsPlan entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - /** - * 保存巡检计划下巡检点内的--巡检内容 - * @param plan_point_id - * @param ids - * @return - */ - public abstract int saveByPlan(String jsonStr,String patrolPlanId,String patrolPointId,String userId,String type); - - public abstract int saveByPlan(String ids,String patrolPlanId,String EquipmentId,String userId); - - public abstract List selectListByTree(String wherestr); -} diff --git a/src/com/sipai/service/timeefficiency/PatrolContentsRecordService.java b/src/com/sipai/service/timeefficiency/PatrolContentsRecordService.java deleted file mode 100644 index b0220865..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolContentsRecordService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import net.sf.json.JSONArray; - -import com.sipai.entity.timeefficiency.PatrolContentsRecord; - -public interface PatrolContentsRecordService { - - public abstract PatrolContentsRecord selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolContentsRecord entity); - - public abstract int update(PatrolContentsRecord entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract JSONArray selectListByTree(String patrolRecordId,String patrolPointId,String equipmentId,String unitId); - -} diff --git a/src/com/sipai/service/timeefficiency/PatrolContentsService.java b/src/com/sipai/service/timeefficiency/PatrolContentsService.java deleted file mode 100644 index aa12416c..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolContentsService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolContents; - -public interface PatrolContentsService { - - public abstract PatrolContents selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolContents entity); - - public abstract int update(PatrolContents entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - /** - * 通过巡检计划中查看配置中的所有巡检内容 (已配置的与未配置的) - * @param wherestr - * @return - */ - public abstract List selectListByPlan(String wherestr, String pid, String type); - /** - * 执行复制的巡检内容到指定巡检点 - * @param patrolPointIds 需要执行复制的巡检点Ids - * @param patrolContentIds 勾选的巡检内容ids - * @return - */ - public abstract int copyPatrolContents4Point(String patrolPointIds, String patrolContentIds); -} diff --git a/src/com/sipai/service/timeefficiency/PatrolContentsStandardService.java b/src/com/sipai/service/timeefficiency/PatrolContentsStandardService.java deleted file mode 100644 index b2832cbf..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolContentsStandardService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.timeefficiency.PatrolContentsStandard; - -public interface PatrolContentsStandardService { - - public abstract PatrolContentsStandard selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolContentsStandard entity); - - public abstract int update(PatrolContentsStandard entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /* - * 导入 - */ - public abstract String readXls(InputStream input,String json,String userId,String unitId) throws IOException; - public abstract String readXlsx(InputStream input,String json,String userId,String unitId) throws IOException; - /* - * 导出 - */ - public abstract void doExport(HttpServletResponse response,List equipmentClasses,String unitId,String smallClassId) throws IOException; -} diff --git a/src/com/sipai/service/timeefficiency/PatrolMeasurePointPlanService.java b/src/com/sipai/service/timeefficiency/PatrolMeasurePointPlanService.java deleted file mode 100644 index 89293092..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolMeasurePointPlanService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolMeasurePointPlan; - -public interface PatrolMeasurePointPlanService { - public abstract PatrolMeasurePointPlan selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolMeasurePointPlan entity); - - public abstract int update(PatrolMeasurePointPlan entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectListByPlan(String bizId,String wherestr); - - public abstract List selectListByTree(String bizId,String wherestr); - /** - * 保存计划下关联的填报内容 - * @param ids - * @param planId - * @param plan_point_id - * @param userId - * @return - */ - public abstract int saveByPlan(String jsonStr,String patrolPlanId,String patrolPointId,String userId,String unitId,String type); - - public abstract int saveByPlan(String ids,String planId,String equipmentId,String userId); -} diff --git a/src/com/sipai/service/timeefficiency/PatrolMeasurePointRecordService.java b/src/com/sipai/service/timeefficiency/PatrolMeasurePointRecordService.java deleted file mode 100644 index da90efdd..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolMeasurePointRecordService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import net.sf.json.JSONArray; - -import com.sipai.entity.timeefficiency.PatrolMeasurePointRecord; - -public interface PatrolMeasurePointRecordService { - public abstract PatrolMeasurePointRecord selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolMeasurePointRecord entity); - - public abstract int update(PatrolMeasurePointRecord entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectListByRecord(String bizId,String wherestr); - - public abstract JSONArray selectListByTree(String patrolRecordId,String patrolPointId,String equipmentId,String unitId); -} diff --git a/src/com/sipai/service/timeefficiency/PatrolModelService.java b/src/com/sipai/service/timeefficiency/PatrolModelService.java deleted file mode 100644 index eb0d7c4a..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolModelService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.timeefficiency.PatrolModel; - -public interface PatrolModelService { - - public abstract PatrolModel selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolModel entity); - - public abstract int update(PatrolModel entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int setDefaultModel(String patrolModelId); - - /** - * 复制巡检配置 - * @param oldCompanyId - * @param newCompanyId - * @param userid - * @param fileTable - * @return - */ - public abstract String setDefaultPatrol(String oldCompanyId, - String newCompanyId, String userid, String fileTable); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanDeptService.java b/src/com/sipai/service/timeefficiency/PatrolPlanDeptService.java deleted file mode 100644 index 42cf31f1..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanDeptService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolPlanDept; -import com.sipai.entity.user.Dept; - -public interface PatrolPlanDeptService { - - public abstract PatrolPlanDept selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPlanDept entity); - - public abstract int update(PatrolPlanDept entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getDeptsByPatrolPlanId(String patrolPlanId); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanPatrolCameraService.java b/src/com/sipai/service/timeefficiency/PatrolPlanPatrolCameraService.java deleted file mode 100644 index 5b75b145..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanPatrolCameraService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolPlanPatrolCameraDao; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolCamera; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; -@Service -public class PatrolPlanPatrolCameraService implements CommService{ - @Resource - private PatrolPlanPatrolCameraDao patrolCameraDao; - @Resource - private CameraService cameraService; - - @Override - public PatrolPlanPatrolCamera selectById(String t) { - return patrolCameraDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return patrolCameraDao.deleteByPrimaryKey(t); - } - - @Override - public int save(PatrolPlanPatrolCamera t) { - return patrolCameraDao.insertSelective(t); - } - - @Override - public int update(PatrolPlanPatrolCamera t) { - return patrolCameraDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - PatrolPlanPatrolCamera patrolCamera = new PatrolPlanPatrolCamera(); - patrolCamera.setWhere(t); - return patrolCameraDao.selectListByWhere(patrolCamera); - } - - @Override - public int deleteByWhere(String t) { - PatrolPlanPatrolCamera patrolCamera = new PatrolPlanPatrolCamera(); - patrolCamera.setWhere(t); - return patrolCameraDao.deleteByWhere(patrolCamera); - } - - public List selectListByWhereCamera(String t){ - List list = selectListByWhere(t); - for(PatrolPlanPatrolCamera patrolCamera:list){ - patrolCamera.setCamera(cameraService.selectById(patrolCamera.getCameraid())); - } - return list; - } - -} diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanPatrolEquipmentService.java b/src/com/sipai/service/timeefficiency/PatrolPlanPatrolEquipmentService.java deleted file mode 100644 index 087cca5f..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanPatrolEquipmentService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment; - -public interface PatrolPlanPatrolEquipmentService { - - public abstract PatrolPlanPatrolEquipment selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPlanPatrolEquipment entity); - - public abstract int update( - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment); - - public abstract List selectListByWhere( - String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getEquipmentCardsByPatrolPlanId( - String patrolPlanId); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanPatrolPointService.java b/src/com/sipai/service/timeefficiency/PatrolPlanPatrolPointService.java deleted file mode 100644 index a7725412..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanPatrolPointService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPoint; - -public interface PatrolPlanPatrolPointService { - - public abstract PatrolPlanPatrolPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPlanPatrolPoint entity); - - public abstract int update(PatrolPlanPatrolPoint patrolPlanPatrolPoint); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectSimpleListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getPatrolPointsByPatrolPlanId(String patrolPlanId); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanRiskLevelService.java b/src/com/sipai/service/timeefficiency/PatrolPlanRiskLevelService.java deleted file mode 100644 index 719d7dcb..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanRiskLevelService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.timeefficiency; - -import com.sipai.entity.timeefficiency.PatrolPlanRiskLevel; - -import java.util.List; - - -public interface PatrolPlanRiskLevelService { - - public abstract PatrolPlanRiskLevel selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPlanRiskLevel entity); - - public abstract int update(PatrolPlanRiskLevel patrolPlanRiskLevel); - - public abstract List selectListByWhere( String wherestr); - - public abstract int deleteByWhere(String wherestr); - - -} diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanService.java b/src/com/sipai/service/timeefficiency/PatrolPlanService.java deleted file mode 100644 index a7c7a1ba..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.timeefficiency.PatrolPlan; - -public interface PatrolPlanService { - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#selectById(java.lang.String) - */ - public abstract PatrolPlan selectById(String id); - - public abstract PatrolPlan selectSimpleById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#deleteById(java.lang.String) - */ - public abstract int deleteById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#save(com.sipai.entity.timeefficiency.PatrolPlan) - */ - public abstract int save(PatrolPlan entity); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#update(com.sipai.entity.timeefficiency.PatrolPlan) - */ - public abstract int update(PatrolPlan entity); - - public abstract int updateSimple(PatrolPlan entity); - - /** - * 计划查询 (通用) - * @param wherestr - * @return - */ - public abstract List selectListByWhere(String wherestr); - - public abstract List selectSimpleListByWhere(String wherestr); - - /** - * 计划查询 (仅安全任务) - * @param wherestr - * @return - */ - public abstract List selectListByWhere4Safe(String wherestr); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#deleteByWhere(java.lang.String) - */ - public abstract int deleteByWhere(String wherestr); - - /** - * 巡检计划下关联设备(后台会根据设备自动保存对应的控制箱) - * - * @param patrolEquipmentIds - * @return - */ - public abstract int saveEquipmentCards(String patrolEquipmentIds,String userId,String patrolPlanId); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPlanTypeService.java b/src/com/sipai/service/timeefficiency/PatrolPlanTypeService.java deleted file mode 100644 index ce688ed3..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPlanTypeService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.service.timeefficiency; - -import com.sipai.entity.timeefficiency.PatrolPlanType; - -import java.util.List; - -; - -public interface PatrolPlanTypeService { - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#selectById(java.lang.String) - */ - public abstract PatrolPlanType selectById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#deleteById(java.lang.String) - */ - public abstract int deleteById(String id); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#save(com.sipai.entity.timeefficiency.PatrolPlan) - */ - public abstract int save(PatrolPlanType entity); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#update(com.sipai.entity.timeefficiency.PatrolPlan) - */ - public abstract int update(PatrolPlanType entity); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#selectListByWhere(java.lang.String) - */ - public abstract List selectListByWhere(String wherestr); - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#deleteByWhere(java.lang.String) - */ - public abstract int deleteByWhere(String wherestr); - -// public abstract List getPatrolTypes(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPointCameraService.java b/src/com/sipai/service/timeefficiency/PatrolPointCameraService.java deleted file mode 100644 index 137ebff5..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPointCameraService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolPointCamera; - -public interface PatrolPointCameraService { - public PatrolPointCamera selectById(String id); - - public int deleteById(String id); - - public int save(PatrolPointCamera patrolPointCamera); - - public int update(PatrolPointCamera patrolPointCamera); - - public List selectListByWhere(String where); - - public List selectListByWhereCamera(String where); - - public int deleteByWhere(String where); - -} diff --git a/src/com/sipai/service/timeefficiency/PatrolPointEquipmentCardService.java b/src/com/sipai/service/timeefficiency/PatrolPointEquipmentCardService.java deleted file mode 100644 index 8c454aca..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPointEquipmentCardService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; - -public interface PatrolPointEquipmentCardService { - - public abstract PatrolPointEquipmentCard selectById(String id); - - public abstract PatrolPointEquipmentCard selectById(String bizId, String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPointEquipmentCard entity); - - public abstract int update(PatrolPointEquipmentCard patrolpointequipmentCard); - - public abstract List selectListByWhere( - String wherestr); - - public abstract List selectListByWhereEquipmentCard( - String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /*public abstract List getEquipmentCardsByPatrolPointId( - String patrolPointId);*/ - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPointFileService.java b/src/com/sipai/service/timeefficiency/PatrolPointFileService.java deleted file mode 100644 index 0bc7c6bb..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPointFileService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.timeefficiency.PatrolPointFile; - -public interface PatrolPointFileService { - - public abstract PatrolPointFile selectById(String id); - - public abstract PatrolPointFile selectById(String bizId, String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPointFile entity); - - public abstract int update(PatrolPointFile patrolpointmeasurePoint); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getFilesByPatrolPointId( - String patrolPointId); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPointMeasurePointService.java b/src/com/sipai/service/timeefficiency/PatrolPointMeasurePointService.java deleted file mode 100644 index 64e2bfeb..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPointMeasurePointService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import net.sf.json.JSONArray; - -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; - -public interface PatrolPointMeasurePointService { - - public abstract PatrolPointMeasurePoint selectById(String id); - - public abstract PatrolPointMeasurePoint selectById(String bizId, String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPointMeasurePoint entity); - - public abstract int update(PatrolPointMeasurePoint patrolpointmeasurePoint); - - public abstract List selectListByWhere( - String wherestr); - //获取巡检点下的测量点 - public abstract List selectListByWhereMPoint( - String unitId, String wherestr); - //获取巡检点 和 设备下的测量点 - public abstract List selectListByWhereMPointAndEquiment( - String unitId,String patrolPointId, String wherestr); - - public abstract int deleteByWhere(String wherestr); - - /*** APP接口方法 通过巡检点获取其对应测量点数�? */ - public abstract List selectMPointListByPatrolPoint( - String wherestr, String bizId); - /** - * 获取 巡检点 下测量点(自动点) - * @param request - * @param model - * @return - */ - public abstract JSONArray selectList4MPoint(String unitId,String type, String patrolPointId); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolPointService.java b/src/com/sipai/service/timeefficiency/PatrolPointService.java deleted file mode 100644 index 17379571..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolPointService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.alibaba.fastjson.JSONArray; -import com.sipai.entity.timeefficiency.PatrolContents; - -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.timeefficiency.PatrolPoint; - -public interface PatrolPointService { - - public abstract PatrolPoint selectById(String id); - - public PatrolPoint selectByIdSafe(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolPoint entity); - - public abstract int update(PatrolPoint patrolPoint); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getPatrolPoints(String wherestr); - - public abstract List getPatrolPointsSafe(String wherestr); - - public abstract List selectPointListByRecord(String wherestr); - - public abstract List getNewProcessSectionPatrolPoint( - String wherestr); - //根据车间id查询所有的巡检点 - public abstract List selectListByUnitId(String wherestr); - - public abstract JSONArray selectListByWhereGroup(String wherestr, String type, String search_name, String unitId); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolRecordDeptService.java b/src/com/sipai/service/timeefficiency/PatrolRecordDeptService.java deleted file mode 100644 index 448506dd..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRecordDeptService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.timeefficiency; - -import com.sipai.entity.timeefficiency.PatrolRecordDept; -import com.sipai.entity.user.Dept; - -import java.util.List; - -public interface PatrolRecordDeptService { - - public abstract PatrolRecordDept selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolRecordDept entity); - - public abstract int update(PatrolRecordDept entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getDeptsByPatrolRecordId(String patrolRecordId); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolCameraService.java b/src/com/sipai/service/timeefficiency/PatrolRecordPatrolCameraService.java deleted file mode 100644 index 580dc31b..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolCameraService.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import org.springframework.stereotype.Service; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.timeefficiency.PatrolRecordPatrolCameraDao; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolCamera; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; - -@Service -public class PatrolRecordPatrolCameraService implements CommService { - @Resource - private PatrolRecordPatrolCameraDao patrolCameraDao; - @Resource - private CameraService cameraService; - @Resource - private UserService userService; - - @Override - public PatrolRecordPatrolCamera selectById(String t) { - return patrolCameraDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return patrolCameraDao.deleteByPrimaryKey(t); - } - - @Override - public int save(PatrolRecordPatrolCamera t) { - // TODO Auto-generated method stub - return patrolCameraDao.insertSelective(t); - } - - @Override - public int update(PatrolRecordPatrolCamera t) { - // TODO Auto-generated method stub - return patrolCameraDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - PatrolRecordPatrolCamera patrolCamera = new PatrolRecordPatrolCamera(); - patrolCamera.setWhere(t); - return patrolCameraDao.selectListByWhere(patrolCamera); - } - - @Override - public int deleteByWhere(String t) { - PatrolRecordPatrolCamera patrolCamera = new PatrolRecordPatrolCamera(); - patrolCamera.setWhere(t); - return patrolCameraDao.deleteByWhere(patrolCamera); - } - - public List selectListCameraByWhere(String t) { - List list = selectListByWhere(t); - for (PatrolRecordPatrolCamera patrolCamera : list) { - patrolCamera.setCamera(cameraService.selectById(patrolCamera.getCameraid())); - User user = this.userService.getUserById(patrolCamera.getUpdateuser()); - if (user != null) { - patrolCamera.setUpdateuserName(user.getCaption()); - } -// patrolCamera.setCamera(cameraService.selectById(patrolCamera.getCameraid())); - } - return list; - } - -} diff --git a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolEquipmentService.java b/src/com/sipai/service/timeefficiency/PatrolRecordPatrolEquipmentService.java deleted file mode 100644 index 8e0432a2..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolEquipmentService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; -import net.sf.json.JSONArray; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolEquipment; - -public interface PatrolRecordPatrolEquipmentService { - - public abstract PatrolRecordPatrolEquipment selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolRecordPatrolEquipment entity); - - public abstract int update(PatrolRecordPatrolEquipment patrolRecordPatrolEquipment); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectSimpleListByWhere(String wherestr); - - public abstract List selectListGroupByWhere(String wherestr, String name); - - public abstract int deleteByWhere(String wherestr); - - public abstract List getEquipmentCardsByPatrolRecordId(String patrolRecordId); - - /** - * 获取任务中 巡检点下关联的设备列表 及 下面的巡检内容和填报内容 - * - * @param wherestr - * @return - */ - public abstract JSONArray selectListByWhere4APP( - String wherestr, String unitId); - - /** - * 查询所有的信息 (包括巡检内容和填报内容) -- 目前为离线巡检使用 - * - * @param wherestr - * @param unitId - * @return - */ - public abstract List selectListByWhere2(String unitId, String wherestr); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolPointService.java b/src/com/sipai/service/timeefficiency/PatrolRecordPatrolPointService.java deleted file mode 100644 index 4250670d..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolPointService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolRecordPatrolPoint; - -public interface PatrolRecordPatrolPointService { - - public abstract PatrolRecordPatrolPoint selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolRecordPatrolPoint entity); - - public abstract int update(PatrolRecordPatrolPoint patrolRecordPatrolPoint); - - public abstract List selectListByWhere( - String wherestr); - - public abstract int deleteByWhere(String wherestr); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolRouteService.java b/src/com/sipai/service/timeefficiency/PatrolRecordPatrolRouteService.java deleted file mode 100644 index 2e4e57c1..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRecordPatrolRouteService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; - -public interface PatrolRecordPatrolRouteService { - - public abstract PatrolRecordPatrolRoute selectById(String id); - - public abstract PatrolRecordPatrolRoute selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(PatrolRecordPatrolRoute entity); - - public abstract int update(PatrolRecordPatrolRoute patrolRecordPatrolRoute); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListByWhereSafe(String wherestr); - - public abstract List selectSimpleListByWhere(String wherestr); - - public abstract List selectListGroupByWhere(String wherestr, String name); - - public abstract int deleteByWhere(String wherestr); - - public abstract int updateByWhere( - PatrolRecordPatrolRoute patrolRecordPatrolRoute); - /** - * 提交巡检点时候计划完成数 - * @param patrolRecordPatrolRoute - * @return - */ - public abstract int updateNum(PatrolRecordPatrolRoute patrolRecordPatrolRoute); - - /** - * 顺叙排序 - * @param source - * @return - */ - public abstract List sortRecord( - List source); - - public abstract int updateByRecord(String patrolRecordId); - - /** - * 查询所有的信息 (包括巡检内容和填报内容) -- 目前为离线巡检使用 - * @param wherestr - * @param unitId - * @return - */ - public List selectListByWhere2(String wherestr,String unitId); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolRecordService.java b/src/com/sipai/service/timeefficiency/PatrolRecordService.java deleted file mode 100644 index 1afc0c3e..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRecordService.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.io.IOException; -import java.util.List; -import java.util.Set; - -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.business.BusinessUnitAudit; -import net.sf.json.JSONArray; - -import net.sf.json.JSONObject; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolRecordDetailStatistics; - -public interface PatrolRecordService { - - public abstract PatrolRecord selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(PatrolRecord entity); - - public abstract int update(PatrolRecord entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectListByWhere4Safe(String wherestr); - - public abstract List selectListAndASumByWhere(String wherestr, String date); - - public abstract List selectSimpleListByWhere(String wherestr); - - /* - * 查巡检日历每天的完成率及巡检数 - */ - public abstract List selectListByWhereForCalendar(String wherestr); - - /* - * 根据条件去重复时间 - */ - //public abstract List selectDateDistinct(String wherestr); - - - /** - * 删除任务 - * @param wherestr - * @return - */ - public abstract int deleteByWhere(String wherestr); - - /** - * 撤销任务 - * @param wherestr - * @return - */ - public abstract int cancelByWhere(String wherestr); - - /** - * 生成巡检记录 - * 生产巡检日期当天下发多条 - * 设备巡检触发时则生成一条记录 - */ - public abstract int createPatrolRecord(String date, String patrolPlanId, - String userId); - - public abstract int createPatrolRecord_Equipment(String date, String patrolPlanId, - String userId); - - public abstract int createPatrolRecord_Camera(String date, String patrolPlanId, - String userId); - - public abstract int createPatrolRecord_Safe(String sdt, String edt, String patrolPlanId, - String userId); - - /** - * 补全记录标注颜色 - * - * @param patrolRecord - */ - public abstract void fixColor(PatrolRecord patrolRecord); - - /** - * 导出巡检记录表 - * - * @param response - * @throws IOException - */ - public abstract void downloadExcel(HttpServletResponse response, - List patrolRecord) throws IOException; - - /** - * 读取Excel表格的配置文件,中文表头 - * @param key - * @return - */ - // private String getExcelStr(String key){ - // InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("excelConfig.properties"); - // Properties prop = new Properties(); - // try { - // BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream,"UTF-8"));//解决读取properties文件中产生中文乱码的问题 - // prop.load(bufferedReader); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - // String str = prop.getProperty(key).replace(" ", "");//去掉空格 - // return str; - // } - - /** - * 获取巡检记录详情的统计分析,包括巡检点、测量点、设备测量点及异常数 - * - * @param patrolRecordId - * @return - */ - public abstract List getProductPatrolDetailStatistic( - String patrolRecordId); - - public abstract PatrolRecordDetailStatistics getEquipmentPatrolDetailStatistic( - String patrolRecordId); - - - /** - * 根据指定日期获取巡检情况 --巡检总览 sj 2020-04-27 - */ - public abstract JSONArray getPatrolRecordDetailsByDay(String wherestr, String unitId); - - /** - * 根据指定日期异常数和异常工单数 --巡检总览 sj 2023-02-10 - */ - public abstract com.alibaba.fastjson.JSONObject getPatrolRecordAbnormityNum(String unitId, String dateType, String patrolDate); - - /** - * 根据指定日期获取各班组完成情况 --巡检总览 sj 2020-04-27 - */ - public abstract com.alibaba.fastjson.JSONObject getPatrolRecordBanZuByDay(String wherestr, String unitId); - - public abstract com.alibaba.fastjson.JSONObject getPatrolRecordBanZuByDay2(String wherestr, String unitId); - - public abstract com.alibaba.fastjson.JSONObject getPatrolRecordBanZuByDay3(String wherestr, String unitId); - - public abstract com.alibaba.fastjson.JSONObject getFinishData(String dateTypeStr, String patrolDate, String unitId); - - /** - * 根据指定日期获取临时任务情况 --巡检总览 sj 2020-05-22 - */ - public abstract List getPatrolRecordByTask(String wherestr, String unitId); - - /** - * 查询指定条件的任务数量 --巡检总览 sj 2020-04-27 - */ - public abstract JSONArray selectListByNum(String wherestr, String unitId, String dateType, String patrolDate); - - /** - * 巡检总览---各类任务数折线图数据 --巡检总览 sj 2020-04-27 - */ - public abstract JSONArray selectListByNum2(String unitId, String dateType, String patrolDate, String type); - - /** - * 巡检总览---异常工单数折线图数据 --巡检总览 sj 2023-02-13 - */ - public abstract JSONArray selectListByNum3(String unitId, String dateType, String patrolDate, String type); - - /** - * 根据右上角的筛选获取车间下拉框选择---巡检总览 sj 2020-05-07 - */ - //public abstract JSONArray getUnit(String unitId); - - /** - * 巡检总览左上角5个数字的点击分别弹出对应的列表 sj 2020-05-27 - */ - public abstract List getPatrolRecordByStatus(String wherestr, String unitId, String st); - - public abstract List selectTopByWhere(String wherestr, String topNum); - - public abstract List selectDistinctWorkTimeByWhere(String wherestr); - - public abstract List selectForAchievementWork(String wherestr); - - public abstract JSONArray getPointJson4Product(String patrolRecordId); - - public abstract JSONArray getPointAndEquipJson4Equipment(String patrolRecordId); - - /** - * 任务提交 - * - * @param entity - * @param json - * @return - */ - public abstract int submit(PatrolRecord entity, String json, String start); - - /** - * 解析app提交的离线巡检任务 - * - * @param json - * @return - */ - public abstract int receivePatrolRecord4App(String json); - - - /** - * 根据人员id及其他提交 查出每个人的任务(通用) - * - * @param userId - * @param wherestr - * @param orderstr - * @param unitId - * @param type - * @return - */ - public abstract Set selectListByUserId(String userId, String wherestr, String orderstr, String unitId, String type); - - /** - * 根据人员id及其他提交 查出每个人的任务(安全任务) - * - * @param userId - * @param wherestr - * @param orderstr - * @param unitId - * @param type - * @return - */ - public abstract Set selectListByUserIdSafe(String userId, String wherestr, String orderstr, String unitId, String type); - - int start(PatrolRecord patrolRecord); - - int updateStatus(String businessid, String status); - - /** - * 获取巡检楼层对应的数据 - * @param unitId 厂id - * @param patrolDate 巡检日期 - * @param type 巡检类型 运行巡检:P 设备巡检:E - * @return - */ - public abstract com.alibaba.fastjson.JSONArray getPatrolRecordFloorData(String unitId,String patrolDate,String type); - - /** - * 根据区域Ids获取对应的任务 - * @return - */ - public abstract List getPatrolRecord4AreaId(String wherestr,String groupWhere,String orderWhere); - - - /** - * 安全任务分析 sj 2023-07-18 - */ - public abstract JSONArray getAnalysisData(String unitId, String dateType, String patrolDate, String type); - public abstract JSONObject getAnalysisData2(String unitId, String dateType, String patrolDate, String type); - public abstract JSONObject getPatrolRecordGroup(String patrolRecordId); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/PatrolRouteService.java b/src/com/sipai/service/timeefficiency/PatrolRouteService.java deleted file mode 100644 index 615493fe..00000000 --- a/src/com/sipai/service/timeefficiency/PatrolRouteService.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.business.BusinessUnitAudit; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; -import com.sipai.entity.timeefficiency.PatrolRoute; - -public interface PatrolRouteService { - - public abstract PatrolRoute selectById(String id); - - public abstract int deleteById(String id); - - public abstract int deletePoint(String id, String previousId, String nextId); - - public abstract int save(PatrolRoute entity); - - public abstract int update(PatrolRoute entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract List selectSimpleListByWhere(String wherestr); - - /** - * 获取巡检记录的巡检轨迹 - * - * @param patrolRecordId - * @param floorId - * @return - */ - public abstract List selectListWithRecord( - String patrolRecordId, String floorId); - - public abstract int deleteByWhere(String wherestr); - - /** - * 顺叙排序 - * - * @param source - * @return - */ - public abstract List sort(List source); - - /** - * 顺叙排序 - * - * @param source - * @return - */ - public abstract List sortRecord( - List source); - - /** - * 获取巡检计划下的巡检点(通用巡检) - * - * @param wherestr - * @return - */ - public abstract List selectListByPlan(String wherestr); - - /** - * 获取巡检计划下的巡检点(安全任务) - * - * @param wherestr - * @return - */ - public abstract List selectListByPlanSafe(String wherestr); - - /** - * 保存巡检计划下的巡检点 - * - * @param patrolPlanId 巡检计划Id - * @param patrolPointIds 巡检点Id - * @param userId 操作人员Id - * @return - */ - public abstract int saveByPlan(String patrolPlanId, String patrolPointIds, String userId); - - /** - * 修改巡检计划下的巡检点---拖拽排序 - * - * @param patrolPlanId 巡检计划Id - * @param patrolPointIds 巡检点Id - * @param userId 操作人员Id - * @return - */ - public abstract int updateByPlan(String patrolPlanId, String ids); - - /** - * 删除巡检计划下的巡检点 - * - * @param id 巡检点id - * @param previousId 前面节点 - * @param nextId 紧后节点 - * @return - */ - public abstract int deleteByPlan(String id, String previousId, String nextId); -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/ViolationRecordCountService.java b/src/com/sipai/service/timeefficiency/ViolationRecordCountService.java deleted file mode 100644 index c81aacc7..00000000 --- a/src/com/sipai/service/timeefficiency/ViolationRecordCountService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.ViolationRecordCountDao; -import com.sipai.entity.timeefficiency.PatrolRecordViolationRecord; -import com.sipai.entity.timeefficiency.ViolationRecordCount; -import com.sipai.tools.CommService; - - -@Service -public class ViolationRecordCountService { - @Resource - private ViolationRecordCountDao violationRecordCountDao; - - public List selectListByCondition(ViolationRecordCount vrc){ - return violationRecordCountDao.selectListByCondition(vrc); - } - -} diff --git a/src/com/sipai/service/timeefficiency/WorkRecordService.java b/src/com/sipai/service/timeefficiency/WorkRecordService.java deleted file mode 100644 index 614f400b..00000000 --- a/src/com/sipai/service/timeefficiency/WorkRecordService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.sipai.service.timeefficiency; - -import java.util.List; - -import com.sipai.entity.timeefficiency.WorkRecord; - -public interface WorkRecordService { - - public abstract WorkRecord selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(WorkRecord entity); - - public abstract int update(WorkRecord entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/timeefficiency/WorkerPositionService.java b/src/com/sipai/service/timeefficiency/WorkerPositionService.java deleted file mode 100644 index 8ac5b111..00000000 --- a/src/com/sipai/service/timeefficiency/WorkerPositionService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.service.timeefficiency; - -import net.sf.json.JSONArray; - -import com.sipai.entity.timeefficiency.WorkerPosition; - -public interface WorkerPositionService { - - public abstract WorkerPosition selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(WorkerPosition entity); - - public abstract int update(WorkerPosition entity); - - public abstract JSONArray selectListByWhere(String patrolRecordId); - - public abstract int deleteByWhere(String wherestr); - - public abstract int realtimePosition(WorkerPosition entity); - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolAreaFloorServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolAreaFloorServiceImpl.java deleted file mode 100644 index a5a31346..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolAreaFloorServiceImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.service.timeefficiency.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolAreaFloorDao; -import com.sipai.entity.timeefficiency.PatrolAreaFloor; -import com.sipai.entity.user.Unit; -import com.sipai.service.timeefficiency.PatrolAreaFloorService; -import com.sipai.service.user.UnitService; -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolAreaFloorServiceImpl implements PatrolAreaFloorService { - - @Resource - private PatrolAreaFloorDao patrolAreaFloorDao; - //@Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaFloorService#selectById(java.lang.String) - */ - @Override - public PatrolAreaFloor selectById(String id) { - PatrolAreaFloor patrolArea=patrolAreaFloorDao.selectByPrimaryKey(id); - return patrolArea; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaFloorService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolAreaFloorDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaFloorService#save(com.sipai.entity.timeefficiency.PatrolAreaFloor) - */ - @Override - public int save(PatrolAreaFloor entity) { - return this.patrolAreaFloorDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaFloorService#update(com.sipai.entity.timeefficiency.PatrolAreaFloor) - */ - @Override - public int update(PatrolAreaFloor patrolArea) { - return patrolAreaFloorDao.updateByPrimaryKeySelective(patrolArea); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaFloorService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolAreaFloor patrolArea = new PatrolAreaFloor(); - patrolArea.setWhere(wherestr); - List patrolAreaFloor = this.patrolAreaFloorDao.selectListByWhere(patrolArea); - for(int i=0;i selectListByWhere(String wherestr) { - PatrolAreaProcessSection patrolareaprocessSection = new PatrolAreaProcessSection(); - patrolareaprocessSection.setWhere(wherestr); - return patrolareaprocessSectionDao.selectListByWhere(patrolareaprocessSection); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaProcessSectionService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolAreaProcessSection patrolareaprocessSection = new PatrolAreaProcessSection(); - patrolareaprocessSection.setWhere(wherestr); - return patrolareaprocessSectionDao.deleteByWhere(patrolareaprocessSection); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolAreaProcessSectionService#selectNewProcessSectionByWhere(java.lang.String) - */ - @Override - public List selectNewProcessSectionByWhere(String wherestr) { - PatrolAreaProcessSection patrolAreaProcessSection = new PatrolAreaProcessSection(); - patrolAreaProcessSection.setWhere(wherestr); - return patrolareaprocessSectionDao.selectNewProcessSectionByWhere(patrolAreaProcessSection); - } -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolAreaServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolAreaServiceImpl.java deleted file mode 100644 index 64692500..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolAreaServiceImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.sipai.service.timeefficiency.impl; -import java.util.List; - -import javax.annotation.Resource; - - - - - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolAreaDao; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolAreaProcessSection; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.timeefficiency.PatrolAreaProcessSectionService; -import com.sipai.service.timeefficiency.PatrolAreaService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolAreaServiceImpl implements PatrolAreaService{ - - @Resource - private PatrolAreaDao patrolAreaDao; -// @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolAreaProcessSectionService patrolAreaProcessSectionService; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Override - public PatrolArea selectById(String id) { - PatrolArea patrolArea=patrolAreaDao.selectByPrimaryKey(id); - if (patrolArea!=null) { - List list = patrolAreaProcessSectionService.selectListByWhere("where patrol_area_id = '"+patrolArea.getId()+"'"); - String processSectionIds = ""; - for (PatrolAreaProcessSection item : list) { - if (processSectionIds!= "") { - processSectionIds += ","; - } - processSectionIds += item.getProcessSectionId(); - } - processSectionIds=processSectionIds.replace(",","','"); - List processSections = processSectionService.selectListByWhere("where id in ('"+processSectionIds+"')"); - patrolArea.setProcessSections(processSections); - } - return patrolArea; - } - - @Override - public int deleteById(String id) { - return patrolAreaDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolArea entity) { - return this.patrolAreaDao.insert(entity); - } - - @Override - public int update(PatrolArea patrolArea) { - return patrolAreaDao.updateByPrimaryKeySelective(patrolArea); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolArea patrolArea = new PatrolArea(); - patrolArea.setWhere(wherestr); - List patrolAreas = patrolAreaDao.selectListByWhere(patrolArea); - for (PatrolArea item : patrolAreas ) { - List patrolAreaProcessSections = patrolAreaProcessSectionService.selectListByWhere("where patrol_area_id = '"+item.getId()+"'"); - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - String processSectionName = ""; - for (PatrolAreaProcessSection thing : patrolAreaProcessSections ) { - ProcessSection processSection = this.processSectionService.selectById(thing.getProcessSectionId()); - if (processSection==null) { - continue; - } - if (processSectionName != "") { - processSectionName += ","; - } - processSectionName += processSection.getName(); - } - item.setProcessSectionName(processSectionName); - } - - return patrolAreas; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolArea patrolArea = new PatrolArea(); - patrolArea.setWhere(wherestr); - return patrolAreaDao.deleteByWhere(patrolArea); - } - /** - * 获取巡检区域的工艺段 - * @param patrolAreaId - * @return - */ - @Override - public List getProcessSections(String patrolAreaId) { - List patrolAreaprocessSections = this.patrolAreaProcessSectionService.selectListByWhere("where patrol_area_id='"+patrolAreaId+"'"); - String processSectionIdS=""; - for (PatrolAreaProcessSection item : patrolAreaprocessSections) { - if (!processSectionIdS.isEmpty()) { - processSectionIdS+=","; - } - processSectionIdS+=item.getProcessSectionId(); - } - return processSectionService.selectListByWhere("where id in ('"+processSectionIdS.replace(",", "','")+"')"); - } - - /** - * 获取巡检区域内的巡检点 - * @param patrolAreaId - * @return - */ - @Override - public List getPatrolPoints(String floorId, String type) { - String wherestr = " where (floor_id = '"+floorId+"' or floor_id is null)"; - if(type!=null && !type.isEmpty()){ - wherestr+=" and type ='"+type+"'"; - } - List patrolPoints =patrolPointService.selectListByWhere(wherestr); - return patrolPoints; - } - /* - public List selectScheduleList(String wherestr) { - PatrolArea patrolArea = new PatrolArea(); - patrolArea.setWhere(wherestr); - - List patrolAreas= patrolAreaDao.selectListByWhere(patrolArea); - for (PatrolArea item : patrolAreas) { - List list = patrolAreaProcessSectionService.selectListByWhere("where patrolAreaId = '"+item.getId()+"'"); - for (int i = 0; i < list.size(); i++) { - - } - item.setProcessSection(); - } - - return patrolAreaDao.selectListByWhere(patrolArea); - }*/ - public List selectAreaListByDept(String wherestr) { - PatrolArea patrolArea = new PatrolArea(); - patrolArea.setWhere(wherestr); - return patrolAreaDao.selectAreaListByDept(patrolArea); - } - } \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolAreaUserServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolAreaUserServiceImpl.java deleted file mode 100644 index e9afb3d5..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolAreaUserServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import com.sipai.dao.timeefficiency.PatrolAreaUserDao; -import com.sipai.entity.timeefficiency.PatrolAreaUser; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.PatrolAreaUserService; -import com.sipai.service.user.UserService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class PatrolAreaUserServiceImpl implements PatrolAreaUserService { - @Resource - private PatrolAreaUserDao patrolAreaUserDao; - @Resource - private UserService userService; - - @Override - public PatrolAreaUser selectById(String id) { - return patrolAreaUserDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return patrolAreaUserDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolAreaUser entity) { - return patrolAreaUserDao.insert(entity); - } - - @Override - public int update(PatrolAreaUser entity) { - return patrolAreaUserDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolAreaUser entity = new PatrolAreaUser(); - entity.setWhere(wherestr); - List list = patrolAreaUserDao.selectListByWhere(entity); - for (PatrolAreaUser patrolAreaUser : list){ - User user = userService.getUserById(patrolAreaUser.getUserId()); - patrolAreaUser.setUser(user); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolAreaUser entity = new PatrolAreaUser(); - entity.setWhere(wherestr); - return patrolAreaUserDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolContentsPlanServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolContentsPlanServiceImpl.java deleted file mode 100644 index f4cdfe15..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolContentsPlanServiceImpl.java +++ /dev/null @@ -1,259 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolContentsPlanDao; -import com.sipai.dao.timeefficiency.PatrolPlanPatrolEquipmentDao; -import com.sipai.dao.timeefficiency.PatrolPointEquipmentCardDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolContents; -import com.sipai.entity.timeefficiency.PatrolContentsPlan; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.timeefficiency.PatrolContentsPlanService; -import com.sipai.service.timeefficiency.PatrolContentsService; -import com.sipai.tools.CommUtil; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolContentsPlanServiceImpl implements PatrolContentsPlanService{ - - @Resource - private PatrolContentsPlanDao patrolContentsPlanDao; - @Resource - private PatrolContentsService patrolContentsService; - @Resource - private PatrolPointEquipmentCardDao patrolPointEquipmentCardDao; - @Resource - private PatrolPlanPatrolEquipmentDao patrolPlanPatrolEquipmentDao; - //@Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public PatrolContentsPlan selectById(String id) { - return patrolContentsPlanDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return patrolContentsPlanDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolContentsPlan entity) { - return patrolContentsPlanDao.insert(entity); - } - - @Override - public int update(PatrolContentsPlan entity) { - return patrolContentsPlanDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolContentsPlan patrolContentsPlan = new PatrolContentsPlan(); - patrolContentsPlan.setWhere(wherestr); - List patrolContentsPlans = patrolContentsPlanDao.selectListByWhere(patrolContentsPlan); - //获取巡检内容库中 此条巡检内容的详细 YYJ 20200423 - for( int i=0;i0){ - String equId = ""; - EquipmentCard equipmentCard = equipmentCardService.selectById(jsonObject.getString("id")); - if(equipmentCard!=null){ - equId = equipmentCard.getId(); - - //保存设备中间表 - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and equipment_id='"+equId+"' and patrol_point_id='"+patrolPointId+"' and type='"+TimeEfficiencyCommStr.PatrolEquipment_Point+"' "); - List list = patrolPlanPatrolEquipmentDao.selectListByWhere(patrolPlanPatrolEquipment); - if(list!=null && list.size()>0){ - //已存在 - }else { - patrolPlanPatrolEquipment.setId(CommUtil.getUUID()); - patrolPlanPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolEquipment.setPatrolPlanId(patrolPlanId); - patrolPlanPatrolEquipment.setPatrolPointId(patrolPointId); - patrolPlanPatrolEquipment.setEquipmentId(equId); - patrolPlanPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - patrolPlanPatrolEquipmentDao.insert(patrolPlanPatrolEquipment); - } - }else { - equId = null; - } - for (int j = 0; j < jsonarry2.length(); j++) { - JSONObject jsonObject2 = jsonarry2.getJSONObject(j); - patrolContentsPlan2.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id='"+patrolPointId+"' and patrol_contents_id='"+jsonObject2.getString("id")+"'"); - - PatrolContentsPlan patrolContentsPlan = new PatrolContentsPlan(); - patrolContentsPlan.setId(CommUtil.getUUID()); - patrolContentsPlan.setInsdt(CommUtil.nowDate()); - patrolContentsPlan.setInsuser(userId); - patrolContentsPlan.setPatrolPlanId(patrolPlanId); - patrolContentsPlan.setPatrolPointId(patrolPointId); - patrolContentsPlan.setType(type); - patrolContentsPlan.setPatrolContentsId(jsonObject2.getString("id")); - patrolContentsPlan.setEquipmentId(equId); - patrolContentsPlan.setPlanPointId(patrolPointId);//备用 - /*int ressave = patrolContentsPlanDao.insert(patrolContentsPlan); - res = res + ressave;*/ - - //判断子节点是否存在 - List list2 = patrolContentsPlanDao.selectListByWhere(patrolContentsPlan2); - if(list2!=null && list2.size()>0){ - //已存在 - }else { - int ressave = patrolContentsPlanDao.insert(patrolContentsPlan); - res = res + ressave; - } - } - } - }else { - PatrolContents patrolContents = patrolContentsService.selectById(jsonObject.getString("id")); - if(patrolContents!=null){ - String equId = ""; - equId = patrolContents.getPid(); - - PatrolPointEquipmentCard patrolPointEquipmentCard = patrolPointEquipmentCardDao.selectByPrimaryKey(patrolContents.getPid()); - if(patrolPointEquipmentCard!=null){ - //equId = patrolPointEquipmentCard.getEquipmentCardId(); - - //保存设备中间表 - /*PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and equipment_id='"+equId+"' and patrol_point_id='"+patrolPointId+"' and type='"+TimeEfficiencyCommStr.PatrolEquipment_Point+"' "); - List list = patrolPlanPatrolEquipmentDao.selectListByWhere(patrolPlanPatrolEquipment); - if(list!=null && list.size()>0){ - //已存在 - }else { - patrolPlanPatrolEquipment.setId(CommUtil.getUUID()); - patrolPlanPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolEquipment.setPatrolPlanId(patrolPlanId); - patrolPlanPatrolEquipment.setPatrolPointId(patrolPointId); - patrolPlanPatrolEquipment.setEquipmentId(equId); - patrolPlanPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - patrolPlanPatrolEquipmentDao.insert(patrolPlanPatrolEquipment); - }*/ - }else { - //equId = null; - } - patrolContentsPlan2.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id='"+patrolPointId+"' and patrol_contents_id='"+jsonObject.getString("id")+"'"); - - PatrolContentsPlan patrolContentsPlan = new PatrolContentsPlan(); - patrolContentsPlan.setId(CommUtil.getUUID()); - patrolContentsPlan.setInsdt(CommUtil.nowDate()); - patrolContentsPlan.setInsuser(userId); - patrolContentsPlan.setPatrolPlanId(patrolPlanId); - patrolContentsPlan.setPatrolPointId(patrolPointId); - patrolContentsPlan.setType(type); - patrolContentsPlan.setPatrolContentsId(jsonObject.getString("id")); - if(jsonObject.getString("type")!=null && jsonObject.getString("type").equals("equipment")){ - patrolContentsPlan.setEquipmentId(equId); - } - patrolContentsPlan.setPlanPointId(patrolPointId);//备用 - /*int ressave = patrolContentsPlanDao.insert(patrolContentsPlan); - res = res + ressave;*/ - - //保存设备中间表 - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and equipment_id='"+equId+"' and patrol_point_id='"+patrolPointId+"' and type='"+TimeEfficiencyCommStr.PatrolEquipment_Point+"' "); - List list = patrolPlanPatrolEquipmentDao.selectListByWhere(patrolPlanPatrolEquipment); - if(list!=null && list.size()>0){ - //已存在 - }else { - if(jsonObject.getString("type")!=null && jsonObject.getString("type").equals("equipment")){ - patrolPlanPatrolEquipment.setId(CommUtil.getUUID()); - patrolPlanPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolEquipment.setPatrolPlanId(patrolPlanId); - patrolPlanPatrolEquipment.setPatrolPointId(patrolPointId); - patrolPlanPatrolEquipment.setEquipmentId(equId); - patrolPlanPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - patrolPlanPatrolEquipmentDao.insert(patrolPlanPatrolEquipment); - } - } - - //判断子节点是否存在 - List list2 = patrolContentsPlanDao.selectListByWhere(patrolContentsPlan2); - if(list2!=null && list2.size()>0){ - //已存在 - }else { - int ressave = patrolContentsPlanDao.insert(patrolContentsPlan); - res = res + ressave; - } - } - } - } - return res; - } - - @Override - public int saveByPlan(String ids,String patrolPlanId,String EquipmentId,String userId) { - int res = 0 ; - if(ids!=null && !ids.equals("")){ - String[] id = ids.split(","); - for (int i = 0; i < id.length; i++) { - PatrolContentsPlan patrolContentsPlan = new PatrolContentsPlan(); - patrolContentsPlan.setId(CommUtil.getUUID()); - patrolContentsPlan.setInsdt(CommUtil.nowDate()); - patrolContentsPlan.setInsuser(userId); - patrolContentsPlan.setPatrolPlanId(patrolPlanId); - patrolContentsPlan.setEquipmentId(EquipmentId); - patrolContentsPlan.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - patrolContentsPlan.setPatrolContentsId(id[i]); - int ressave = patrolContentsPlanDao.insert(patrolContentsPlan); - res = res + ressave; - } - } - return res; - } - - @Override - public List selectListByTree(String wherestr) { - PatrolContentsPlan patrolContentsPlan = new PatrolContentsPlan(); - patrolContentsPlan.setWhere(wherestr); - List list = new ArrayList<>(); - List patrolContentsPlans = patrolContentsPlanDao.selectListByWhere(patrolContentsPlan); - for( int i=0;i selectListByWhere(String wherestr) { - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setWhere(wherestr); - List list = this.patrolContentsRecordDao.selectListByWhere(patrolContentsRecord); - for (int i = 0; i < list.size(); i++) { - User user = userService.getUserById(list.get(i).getCompleteuser()); - list.get(i).setUser(user); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setWhere(wherestr); - return patrolContentsRecordDao.deleteByWhere(patrolContentsRecord); - } - - @Override - public JSONArray selectListByTree(String patrolRecordId,String patrolPointId,String equipmentId,String unitId) { - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - PatrolPoint patrolPoint = patrolPointDao.selectByPrimaryKey(patrolPointId); - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObjectPoint = new JSONObject(); - JSONArray jsonArrayPoint = new JSONArray(); - if(patrolPoint!=null){ - patrolContentsRecord.setWhere(" where patrol_record_id='"+patrolRecordId+"' and patrol_point_id='"+patrolPointId+"' and equipment_id is null "); - List list = patrolContentsRecordDao.selectListByWhere(patrolContentsRecord); - if(list!=null && list.size()>0){ - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getContents()); - jsonObject.put("text", list.get(i).getContents());//珠海专用 - jsonObject.put("status", list.get(i).getStatus()); - jsonObject.put("completedt", list.get(i).getCompletedt()); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents); - String s1; - switch (list.get(i).getStatus()) { - case PatrolRecord.Status_Issue: - s1="已下发"; - break; - case PatrolRecord.Status_Start: - s1="进行中"; - break; - case PatrolRecord.Status_Finish: - s1="已完成"; - break; - case PatrolRecord.Status_PartFinish: - s1="部分完成"; - break; - case PatrolRecord.Status_Undo: - s1="不处理"; - break; - default: - s1=""; - break; - } - String[] tags={""+s1}; - jsonObject.put("tags", tags);//珠海专用 - jsonArrayPoint.add(jsonObject); - } - jsonObjectPoint.put("id", patrolPoint.getId()); - jsonObjectPoint.put("name", patrolPoint.getName()); - jsonObjectPoint.put("text", patrolPoint.getName());//珠海专用 - jsonObjectPoint.put("icon", TimeEfficiencyCommStr.PatrolPoint); - jsonObjectPoint.put("data", jsonArrayPoint); - jsonObjectPoint.put("nodes", jsonArrayPoint);//珠海专用 - jsonArray.add(jsonObjectPoint); - } - } - if(equipmentId!=null && !equipmentId.equals("")){ - //设备巡检 - patrolContentsRecord.setWhere(" where patrol_record_id='"+patrolRecordId+"' and equipment_id = '"+equipmentId+"' "); - }else { - //运行巡检 - patrolContentsRecord.setWhere(" where patrol_record_id='"+patrolRecordId+"' and patrol_point_id='"+patrolPointId+"' and equipment_id is not null "); - } - - List list = patrolContentsRecordDao.selectListByWhere(patrolContentsRecord); - if(list!=null && list.size()>0){ - HashSet hashSet = new HashSet<>(); - for (int i = 0; i < list.size(); i++) { - hashSet.add(list.get(i).getEquipmentId()); - } - Iterator iterator=hashSet.iterator(); - while(iterator.hasNext()){ - String equId = iterator.next(); - if(equipmentId!=null && !equipmentId.equals("")){ - patrolContentsRecord.setWhere(" where patrol_record_id='"+patrolRecordId+"' and equipment_id='"+equId+"' "); - }else { - patrolContentsRecord.setWhere(" where patrol_record_id='"+patrolRecordId+"' and patrol_point_id='"+patrolPointId+"' and equipment_id='"+equId+"' "); - } - List list2 = patrolContentsRecordDao.selectListByWhere(patrolContentsRecord); - if(list2!=null && list2.size()>0){ - JSONObject jsonObjectEqu = new JSONObject(); - JSONArray jsonArrayEqu = new JSONArray(); - for (int i = 0; i < list2.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list2.get(i).getId()); - if(list2.get(i).getContents()!=null){ - jsonObject.put("name", list2.get(i).getContents()); - jsonObject.put("text", list2.get(i).getContents());//珠海专用 - }else { - jsonObject.put("name", ""); - jsonObject.put("text", "");//珠海专用 - } - jsonObject.put("status", list2.get(i).getStatus()); - jsonObject.put("completedt", list2.get(i).getCompletedt()); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents); - String s1; - switch (list2.get(i).getStatus()) { - case PatrolRecord.Status_Issue: - s1="已下发"; - break; - case PatrolRecord.Status_Start: - s1="进行中"; - break; - case PatrolRecord.Status_Finish: - s1="已完成"; - break; - case PatrolRecord.Status_PartFinish: - s1="部分完成"; - break; - case PatrolRecord.Status_Undo: - s1="不处理"; - break; - default: - s1=""; - break; - } - String[] tags={""+s1}; - jsonObject.put("tags", tags);//珠海专用 - jsonArrayEqu.add(jsonObject); - } - jsonObjectEqu.put("id", equId); - EquipmentCard equipmentCard = equipmentCardService.selectById(equId); - if(equipmentCard!=null){ - jsonObjectEqu.put( "name", equipmentCard.getEquipmentname()); - jsonObjectEqu.put( "text", equipmentCard.getEquipmentname());//珠海专用 - }else { - jsonObjectEqu.put("name", ""); - jsonObjectEqu.put("text", "");//珠海专用 - } - jsonObjectEqu.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObjectEqu.put("data", jsonArrayEqu); - jsonObjectEqu.put("nodes", jsonArrayEqu);//珠海专用 - jsonArray.add(jsonObjectEqu); - } - } - } - return jsonArray; - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolContentsServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolContentsServiceImpl.java deleted file mode 100644 index 0a3f41d9..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolContentsServiceImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.timeefficiency.*; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.dao.timeefficiency.PatrolContentsDao; -import com.sipai.dao.timeefficiency.PatrolPointDao; -import com.sipai.dao.timeefficiency.PatrolPointEquipmentCardDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolContentsService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.tools.CommUtil; - -@Service -//@Service(version=CommString.DUBBO_VERSION_PATROL) -public class PatrolContentsServiceImpl implements PatrolContentsService { - - @Resource - private PatrolContentsDao patrolContentsDao; - @Resource - private PatrolPointEquipmentCardDao patrolPointEquipmentCardDao; - @Resource - private PatrolPointDao patrolPointDao; - @Resource - private PatrolPointService patrolPointService; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - - public PatrolContents selectById(String id) { - return patrolContentsDao.selectByPrimaryKey(id); - } - - public int deleteById(String id) { - return patrolContentsDao.deleteByPrimaryKey(id); - } - - public int save(PatrolContents entity) { - return patrolContentsDao.insert(entity); - } - - public int update(PatrolContents entity) { - return patrolContentsDao.updateByPrimaryKeySelective(entity); - } - - public List selectListByWhere(String wherestr) { - PatrolContents patrolContents = new PatrolContents(); - patrolContents.setWhere(wherestr); - List list = patrolContentsDao.selectListByWhere(patrolContents); - for (PatrolContents item : list) { - item.setText(item.getContents());//text用于树形显示 - } - return list; - } - - public int deleteByWhere(String wherestr) { - PatrolContents patrolContents = new PatrolContents(); - patrolContents.setWhere(wherestr); - return patrolContentsDao.deleteByWhere(patrolContents); - } - - @SuppressWarnings("unchecked") - public List selectListByPlan(String wherestr, String pid, String type) { - PatrolContents patrolContents = new PatrolContents(); - PatrolPoint patrolPoint = patrolPointService.selectById(pid); - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObjectPoint = new JSONObject(); - JSONArray jsonArrayPoint = new JSONArray(); - if (patrolPoint != null) { - wherestr = " where pid='" + pid + "' and patrol_contents_type = '" + type + "' and unit_id = '" + patrolPoint.getUnitId() + "' order by contents"; - patrolContents.setWhere(wherestr); - List list = patrolContentsDao.selectListByWhere(patrolContents); - if (list != null && list.size() > 0) { - //循环巡检点下面的巡检内容 - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - jsonObject.put("name", list.get(i).getContents()); - jsonObject.put("text", list.get(i).getContents()); - jsonObject.put("contentsDetail", list.get(i).getContentsDetail()); - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Point); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents); - -// JSONObject jsonObject2 = new JSONObject(); -// jsonObject2.put("checked","true"); -// jsonObject2.put("expanded", "true"); -// jsonObject.put("state", jsonObject2); - - jsonArrayPoint.add(jsonObject); - } - jsonObjectPoint.put("id", pid); - jsonObjectPoint.put("name", patrolPoint.getName()); - jsonObjectPoint.put("text", patrolPoint.getName()); - jsonObjectPoint.put("type", "point"); - jsonObjectPoint.put("icon", TimeEfficiencyCommStr.PatrolPoint); -// jsonObjectPoint.put("icon", "el-tree-node__icon fa fa-circle"); - jsonObjectPoint.put("data", jsonArrayPoint); - jsonObjectPoint.put("nodes", jsonArrayPoint);//之前树的取名未规范,后面子节点数组都用nodes - jsonArray.add(jsonObjectPoint); - } - } - - //根据巡检点查询下面关联的设备 - PatrolPointEquipmentCard patrolPointEquipmentCard = new PatrolPointEquipmentCard(); - patrolPointEquipmentCard.setWhere("where patrol_point_id = '" + pid + "' order by equipment_card_id"); - List list2 = patrolPointEquipmentCardDao.selectListByWhere(patrolPointEquipmentCard); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - JSONObject jsonObjectEqu = new JSONObject(); - JSONArray jsonArrayEqu = new JSONArray(); - - //patrolContents.setWhere(" where pid ='"+list2.get(i).getId()+"' "); - patrolContents.setWhere(" where pid ='" + list2.get(i).getEquipmentCardId() + "' and patrol_contents_type = '" + type + "' and unit_id = '" + patrolPoint.getUnitId() + "' "); - List list3 = patrolContentsDao.selectListByWhere(patrolContents); - if (list3 != null && list3.size() > 0) { - //查询设备下面的巡检内容 - for (int j = 0; j < list3.size(); j++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list3.get(j).getId()); - jsonObject.put("name", list3.get(j).getContents()); - jsonObject.put("text", list3.get(j).getContents()); - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents); - jsonArrayEqu.add(jsonObject); - } - } else { - continue; - } - EquipmentCard equipmentCard = equipmentCardService.selectById(list2.get(i).getEquipmentCardId()); - if (equipmentCard != null) { - // jsonObjectEqu.put("id", list2.get(i).getId()); - jsonObjectEqu.put("id", equipmentCard.getId()); - jsonObjectEqu.put("name", equipmentCard.getEquipmentname()); - jsonObjectEqu.put("text", equipmentCard.getEquipmentname()); - jsonObjectEqu.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment); - jsonObjectEqu.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObjectEqu.put("data", jsonArrayEqu); - jsonObjectEqu.put("nodes", jsonArrayEqu); - jsonArray.add(jsonObjectEqu); - } - } - } - return jsonArray; - } - - @Transactional - public int copyPatrolContents4Point(String patrolPointIds, String patrolContentIds) { - int num = 0; - if (patrolPointIds != null && !patrolPointIds.equals("") && patrolContentIds != null && !patrolContentIds.equals("")) { - String[] pointIds = patrolPointIds.split(","); - String[] contentIds = patrolContentIds.split(","); - if (pointIds != null && pointIds.length > 0) { - for (int i = 0; i < pointIds.length; i++) { - if (contentIds != null && contentIds.length > 0) { - for (int j = 0; j < contentIds.length; j++) { - PatrolContents patrolContents = new PatrolContents(); - PatrolContents entity = patrolContentsDao.selectByPrimaryKey(contentIds[j]); - if (entity != null) { - patrolContents.setWhere("where pid = '" + pointIds[i] + "' and contents = '" + entity.getContents() + "'"); - PatrolContents entityContents = patrolContentsDao.selectByWhere(patrolContents); - if (entityContents != null) { - //重复 - } else { - patrolContents.setId(CommUtil.getUUID()); - patrolContents.setContents(entity.getContents()); - patrolContents.setContentsDetail(entity.getContentsDetail()); - patrolContents.setPid(pointIds[i]); - patrolContents.setBizId(entity.getBizId()); - patrolContents.setUnitId(entity.getUnitId()); - patrolContents.setPatrolContentsType(entity.getPatrolContentsType()); - num += patrolContentsDao.insert(patrolContents); - } - } - } - } - } - } - } - return num; - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolContentsStandardServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolContentsStandardServiceImpl.java deleted file mode 100644 index b55a7529..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolContentsStandardServiceImpl.java +++ /dev/null @@ -1,580 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.sipai.dao.timeefficiency.PatrolContentsStandardDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.timeefficiency.PatrolContentsStandard; -import com.sipai.service.company.CompanyService; -import com.sipai.service.timeefficiency.PatrolContentsStandardService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class PatrolContentsStandardServiceImpl implements PatrolContentsStandardService{ - @Resource - private PatrolContentsStandardDao patrolContentsStandardDao; - @Resource - private CompanyService companyService; - - @Override - public PatrolContentsStandard selectById(String id) { - return patrolContentsStandardDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return patrolContentsStandardDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolContentsStandard entity) { - return patrolContentsStandardDao.insert(entity); - } - - @Override - public int update(PatrolContentsStandard entity) { - return patrolContentsStandardDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolContentsStandard patrolContentsStandard = new PatrolContentsStandard(); - patrolContentsStandard.setWhere(wherestr); - List list = patrolContentsStandardDao.selectListByWhere(patrolContentsStandard); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolContentsStandard patrolContentsStandard = new PatrolContentsStandard(); - patrolContentsStandard.setWhere(wherestr); - return patrolContentsStandardDao.deleteByWhere(patrolContentsStandard); - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(XSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - /** - * 获取合并单元格的值 - * @param sheet - * @param row - * @param column - * @return - */ - public static String getMergedRegionValue(Sheet sheet, int row, int column){ - int sheetMergeCount = sheet.getNumMergedRegions(); - - for(int i = 0 ; i < sheetMergeCount ; i++){ - org.apache.poi.ss.util.CellRangeAddress ca = sheet.getMergedRegion(i); - int firstColumn = ca.getFirstColumn(); - int lastColumn = ca.getLastColumn(); - int firstRow = ca.getFirstRow(); - int lastRow = ca.getLastRow(); - - if(row >= firstRow && row <= lastRow){ - if(column >= firstColumn && column <= lastColumn){ - Row fRow = sheet.getRow(firstRow); - HSSFCell fCell = (HSSFCell) fRow.getCell(firstColumn); - return getStringVal(fCell) ; - } - } - } - Row row2 = sheet.getRow(row); - HSSFCell cell = (HSSFCell) row2.getCell(column); - return getStringVal(cell) ; - } - - @Transactional - public String readXls(InputStream input, String json, String userId, - String unitId) throws IOException { - System.out.println("导入设备巡检库开始============="+CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertContentNum = 0, updateContentNum = 0 ; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - - //如果表头小于43列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() != 8) { - continue; - } - - HSSFRow codeRow = sheet.getRow(1); - HSSFCell codeCell = codeRow.getCell(1); - - //判断如果没有类型则不导入 - if (codeCell == null || codeCell.equals("") || getStringVal(codeCell) == null) { - continue; - }else { - - } - - String cell_big_class_code = getMergedRegionValue(sheet, 1, 1);//设备大类代码 - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+3行开始,没有设备编号的不导入 - HSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(5)) { - continue; - } - //int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - - String cell_class_code = getMergedRegionValue(sheet, rowNum, 0);//设备类别代码 - String cell_part_code = getMergedRegionValue(sheet, rowNum, 2);//设备部位代码 - String cell_part_id = "";//设备部位id - - JSONArray jsonArray = JSONArray.fromObject(json); - if(jsonArray!=null && jsonArray.size()>0){ - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject getJsonObj = jsonArray.getJSONObject(i);//分离设备 - //判断是否存在 - if(cell_big_class_code!=null && cell_big_class_code.equals(getJsonObj.get("code"))){ - if(getJsonObj.has("nodes")){ - JSONArray jsonArray2 = JSONArray.fromObject(getJsonObj.get("nodes")); - if(jsonArray2!=null && jsonArray2.size()>0){ - for (int j = 0; j < jsonArray2.size(); j++) { - JSONObject getJsonObj2 = jsonArray2.getJSONObject(j);//回转式粗格栅 - if(getJsonObj2!=null){ - if(cell_class_code!=null && cell_class_code.equals(getJsonObj2.get("code"))){ - if(getJsonObj2.has("nodes")){ - cell_part_id = getJsonObj2.get("id")+""; - /*JSONArray jsonArray3 = JSONArray.fromObject(getJsonObj2.get("nodes")); - if(jsonArray3!=null && jsonArray3.size()>0){ - for (int k = 0; k < jsonArray3.size(); k++) { - JSONObject getJsonObj3 = jsonArray3.getJSONObject(k);//机械部位 - if(getJsonObj3!=null){ - if(cell_part_code!=null && cell_part_code.equals(getJsonObj3.get("code"))){ - cell_part_id = getJsonObj3.get("id")+""; - } - } - } - }*/ - } - } - } - } - } - } - } - } - } - - PatrolContentsStandard patrolContentsStandard = new PatrolContentsStandard(); - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - if (cell == null || null == getMergedRegionValue(sheet, rowNum, i) ) { - continue; - } - try { - switch (i) { - case 0: - break; - case 1: - break; - case 2: - patrolContentsStandard.setCode(getMergedRegionValue(sheet, rowNum, i)); - break; - case 3: - patrolContentsStandard.setName(getMergedRegionValue(sheet, rowNum, i)); - break; - case 4: - String rank = getMergedRegionValue(sheet, rowNum, i); - if(rank!=null && !rank.equals("")){ - if(rank.equals("一级巡检") || rank.equals("一级")){ - patrolContentsStandard.setPatrolRank("1"); - } - if(rank.equals("二级巡检") || rank.equals("二级")){ - patrolContentsStandard.setPatrolRank("2"); - } - if(rank.equals("三级巡检") || rank.equals("三级")){ - patrolContentsStandard.setPatrolRank("3"); - } - } - break; - case 5: - patrolContentsStandard.setContents(getMergedRegionValue(sheet, rowNum, i)); - break; - case 6: - patrolContentsStandard.setTool(getMergedRegionValue(sheet, rowNum, i)); - break; - case 7: - patrolContentsStandard.setSafeNote(getMergedRegionValue(sheet, rowNum, i)); - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - patrolContentsStandard.setUnitId(unitId); - - //部位库中必须要有 否则为无效数据 - if(cell_part_id!=null && !cell_part_id.equals("") && patrolContentsStandard.getContents()!=null){// - patrolContentsStandard.setPid(cell_part_id); - patrolContentsStandard.setMorder(rowNum); - - String sqlstrmodel = "where pid = '"+cell_part_id+"' and code = '"+patrolContentsStandard.getCode()+"' and unit_id = '"+unitId+"'"; - patrolContentsStandard.setWhere(sqlstrmodel); - - List lrModelBloclist = patrolContentsStandardDao.selectListByWhere(patrolContentsStandard); - if(lrModelBloclist!=null&&lrModelBloclist.size()>0){ - patrolContentsStandard.setId(lrModelBloclist.get(0).getId()); - patrolContentsStandardDao.updateByPrimaryKeySelective(patrolContentsStandard); - updateContentNum++; - }else { - patrolContentsStandard.setId(CommUtil.getUUID()); - patrolContentsStandardDao.insert(patrolContentsStandard); - insertContentNum++; - } - - } - } - } - String result = ""; - result = "" - + "新增内容:"+insertContentNum+"条,修改内容:"+updateContentNum+"条!"; - System.out.println("导入设备巡检库结束============="+CommUtil.nowDate()); - return result; - } - - @Transactional - public String readXlsx(InputStream input, String json, String userId, - String unitId) throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public void doExport(HttpServletResponse response, - List equipmentClasses, String unitId, - String smallClassId) throws IOException { - String fileName = "设备巡检库"+CommUtil.nowDate().substring(0, 10)+".xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - if(equipmentClasses!=null && equipmentClasses.size()>0){ - for (int z = 0; z < equipmentClasses.size(); z++) { - String title = equipmentClasses.get(z).getName()+"("+equipmentClasses.get(z).getEquipmentClassCode()+")"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 3000); - sheet.setColumnWidth(5, 6000); - sheet.setColumnWidth(6, 6000); - sheet.setColumnWidth(7, 6000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "小类代码,设备小类,巡检代码,巡检名称,巡检类型,巡检方法,所需工具,安全注意事项"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("设备巡检库"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - - //下面4个为第二行信息 - HSSFRow twoRow = sheet.createRow(1); - twoRow.setHeight((short) 500); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 0)); - HSSFCell twocell = twoRow.createCell(0); - twocell.setCellStyle(titleStyle); - twocell.setCellValue("大类代码"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 1)); - HSSFCell twocell2 = twoRow.createCell(1); - twocell2.setCellStyle(titleStyle); - twocell2.setCellValue(equipmentClasses.get(z).getEquipmentClassCode()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 2, 2)); - HSSFCell twocell3 = twoRow.createCell(2); - twocell3.setCellStyle(titleStyle); - twocell3.setCellValue("设备大类"); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 3, 4)); - HSSFCell twocell4 = twoRow.createCell(3); - twocell4.setCellStyle(titleStyle); - twocell4.setCellValue(equipmentClasses.get(z).getName()); - - sheet.addMergedRegion(new CellRangeAddress(1, 1, 5, excelTitle.length-1)); - HSSFCell twocell5 = twoRow.createCell(5); - twocell5.setCellStyle(titleStyle); - twocell5.setCellValue(""); - - String wherestr = "and (l.unit_id = '"+unitId+"' or l.unit_id is null) " - + "where s.pid = '"+equipmentClasses.get(z).getId()+"' and s.id in ("+smallClassId+") "; - wherestr += "order by s.equipment_class_code,l.code asc"; - - PatrolContentsStandard patrolContentsStandard = new PatrolContentsStandard(); - patrolContentsStandard.setWhere(wherestr); - List list = patrolContentsStandardDao.selectList4Class(patrolContentsStandard); - if(list!=null && list.size()>0){ - JSONObject jsonObject1 = new JSONObject(); - - for (int i = 0; i < list.size(); i++) { - // System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!:"+i); - row = sheet.createRow(3+i);//第三行为插入的数据行 - row.setHeight((short) 400); - - //设备小类 - if(jsonObject1.has(list.get(i).getS_id())){ - int num = (int) jsonObject1.get(list.get(i).getS_id()); - jsonObject1.put(list.get(i).getS_id(),num+1); - }else { - jsonObject1.put(list.get(i).getS_id(),1); - } - - //小类代码 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(list.get(i).getS_code()); - //小类名称 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getS_name()); - // - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getCode()); - // - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getName()); - // - String rank = list.get(i).getPatrolRank(); - if(rank!=null){ - if(rank.equals("1")){ - rank = "一级巡检"; - } - if(rank.equals("2")){ - rank = "二级巡检"; - } - if(rank.equals("3")){ - rank = "三级巡检"; - } - }else { - rank = ""; - } - - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(rank); - // - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getContents()); - // - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getTool()); - //内容代码 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getSafeNote()); - } - - int rownum = 3;//第3行开始 - - //设备小类代码及名称的合并单元格 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - //小类代码合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 0, 0)); - //小类名称合并单元格 - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - rownum = rownum + num; - } - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolMeasurePointPlanServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolMeasurePointPlanServiceImpl.java deleted file mode 100644 index 21db21ac..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolMeasurePointPlanServiceImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolMeasurePointPlanDao; -import com.sipai.dao.timeefficiency.PatrolPlanPatrolEquipmentDao; -import com.sipai.dao.timeefficiency.PatrolPointMeasurePointDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.timeefficiency.PatrolMeasurePointPlan; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolMeasurePointPlanService; -import com.sipai.tools.CommUtil; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolMeasurePointPlanServiceImpl implements PatrolMeasurePointPlanService{ - - @Resource - private PatrolMeasurePointPlanDao entityDao; - @Resource - private PatrolPlanPatrolEquipmentDao patrolPlanPatrolEquipmentDao; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private PatrolPointMeasurePointDao patrolPointMeasurePointDao; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - - @Override - public PatrolMeasurePointPlan selectById(String id) { - return entityDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return entityDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolMeasurePointPlan entity) { - return entityDao.insert(entity); - } - - @Override - public int update(PatrolMeasurePointPlan entity) { - return entityDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolMeasurePointPlan entity = new PatrolMeasurePointPlan(); - entity.setWhere(wherestr); - return entityDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolMeasurePointPlan entity = new PatrolMeasurePointPlan(); - entity.setWhere(wherestr); - return entityDao.deleteByWhere(entity); - } - - @Override - public List selectListByPlan(String bizId,String wherestr) { - PatrolMeasurePointPlan entity = new PatrolMeasurePointPlan(); - entity.setWhere(wherestr); - List list = entityDao.selectListByWhere(entity); - for (PatrolMeasurePointPlan item : list) { - item.setmPoint(mPointService.selectById(bizId,item.getMeasurePointId())); - } - return list; - } - - /** - * 巡检点关联填报内容(运行巡检) 设备巡检保存设备下填报内容在下面一个方法,不是此方法 - */ - @Override - public int saveByPlan(String jsonStr,String patrolPlanId,String patrolPointId,String userId,String unitId,String type) { - int res = 0 ; - PatrolMeasurePointPlan patrolMeasurePointPlan2 = new PatrolMeasurePointPlan(); - JSONArray jsonarry = new JSONArray(jsonStr.toString()); - for (int i = 0;i < jsonarry.length();i++) { - JSONObject jsonObject = jsonarry.getJSONObject(i); - //如果包含data则是父节点 - if(jsonObject.has("data")){ - JSONArray jsonarry2 = jsonObject.getJSONArray("data"); - if(jsonarry2.length()>0){ - if(jsonObject.getString("type")!=null && jsonObject.getString("type").equals(TimeEfficiencyCommStr.PatrolEquipment_Equipment)){ - for (int j = 0; j < jsonarry2.length(); j++) { - JSONObject jsonObject2 = jsonarry2.getJSONObject(j); - patrolMeasurePointPlan2.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id='"+patrolPointId+"' and measure_point_id='"+jsonObject2.getString("id")+"'"); - - MPoint mPoint = mPointService.selectById(unitId, jsonObject2.getString("id")); - if(mPoint!=null){ - PatrolMeasurePointPlan patrolMeasurePointPlan = new PatrolMeasurePointPlan(); - patrolMeasurePointPlan.setId(CommUtil.getUUID()); - patrolMeasurePointPlan.setInsdt(CommUtil.nowDate()); - patrolMeasurePointPlan.setInsuser(userId); - patrolMeasurePointPlan.setPatrolPlanId(patrolPlanId); - patrolMeasurePointPlan.setPatrolPointId(patrolPointId); - patrolMeasurePointPlan.setMeasurePointId(jsonObject2.getString("id")); - patrolMeasurePointPlan.setEquipmentId(mPoint.getEquipmentid()); - patrolMeasurePointPlan.setPid(patrolPointId); - patrolMeasurePointPlan.setType(type); - - //判断子节点是否存在 - List list2 = entityDao.selectListByWhere(patrolMeasurePointPlan2); - if(list2!=null && list2.size()>0){ - //已存在 - }else { - int ressave = entityDao.insert(patrolMeasurePointPlan); - res = res + ressave; - } - } - } - }else { - for (int j = 0; j < jsonarry2.length(); j++) { - JSONObject jsonObject2 = jsonarry2.getJSONObject(j); - patrolMeasurePointPlan2.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id='"+patrolPointId+"' and measure_point_id='"+jsonObject2.getString("id")+"'"); - - PatrolMeasurePointPlan patrolMeasurePointPlan = new PatrolMeasurePointPlan(); - patrolMeasurePointPlan.setId(CommUtil.getUUID()); - patrolMeasurePointPlan.setInsdt(CommUtil.nowDate()); - patrolMeasurePointPlan.setInsuser(userId); - patrolMeasurePointPlan.setPatrolPlanId(patrolPlanId); - patrolMeasurePointPlan.setPatrolPointId(patrolPointId); - patrolMeasurePointPlan.setMeasurePointId(jsonObject2.getString("id")); - patrolMeasurePointPlan.setEquipmentId(null); - patrolMeasurePointPlan.setPid(patrolPointId); - patrolMeasurePointPlan.setType(type); - - //判断子节点是否存在 - List list2 = entityDao.selectListByWhere(patrolMeasurePointPlan2); - if(list2!=null && list2.size()>0){ - //已存在 - }else { - int ressave = entityDao.insert(patrolMeasurePointPlan); - res = res + ressave; - } - } - } - } - }else { - patrolMeasurePointPlan2.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id='"+patrolPointId+"' and measure_point_id='"+jsonObject.getString("id")+"'"); - //只勾选了子节点 - MPoint mPoint = mPointService.selectById(unitId, jsonObject.getString("id")); - if(mPoint!=null){ - if(jsonObject.getString("type")!=null && jsonObject.getString("type").equals(TimeEfficiencyCommStr.PatrolEquipment_Equipment)){ - PatrolMeasurePointPlan patrolMeasurePointPlan = new PatrolMeasurePointPlan(); - patrolMeasurePointPlan.setId(CommUtil.getUUID()); - patrolMeasurePointPlan.setInsdt(CommUtil.nowDate()); - patrolMeasurePointPlan.setInsuser(userId); - patrolMeasurePointPlan.setPatrolPlanId(patrolPlanId); - patrolMeasurePointPlan.setPatrolPointId(patrolPointId); - patrolMeasurePointPlan.setMeasurePointId(jsonObject.getString("id")); - patrolMeasurePointPlan.setEquipmentId(mPoint.getEquipmentid()); - patrolMeasurePointPlan.setPid(patrolPointId); - patrolMeasurePointPlan.setType(type); - - //判断子节点是否存在 - List list2 = entityDao.selectListByWhere(patrolMeasurePointPlan2); - if(list2!=null && list2.size()>0){ - //已存在 - }else { - int ressave = entityDao.insert(patrolMeasurePointPlan); - res = res + ressave; - } - - //保存设备中间表 - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and equipment_id='"+mPoint.getEquipmentid()+"' and patrol_point_id='"+patrolPointId+"' and type='"+TimeEfficiencyCommStr.PatrolEquipment_Point+"' "); - List list = patrolPlanPatrolEquipmentDao.selectListByWhere(patrolPlanPatrolEquipment); - if(list!=null && list.size()>0){ - //已存在 - }else { - patrolPlanPatrolEquipment.setId(CommUtil.getUUID()); - patrolPlanPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolEquipment.setPatrolPlanId(patrolPlanId); - patrolPlanPatrolEquipment.setPatrolPointId(patrolPointId); - patrolPlanPatrolEquipment.setEquipmentId(mPoint.getEquipmentid()); - patrolPlanPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - patrolPlanPatrolEquipmentDao.insert(patrolPlanPatrolEquipment); - } - }else { - PatrolMeasurePointPlan patrolMeasurePointPlan = new PatrolMeasurePointPlan(); - patrolMeasurePointPlan.setId(CommUtil.getUUID()); - patrolMeasurePointPlan.setInsdt(CommUtil.nowDate()); - patrolMeasurePointPlan.setInsuser(userId); - patrolMeasurePointPlan.setPatrolPlanId(patrolPlanId); - patrolMeasurePointPlan.setPatrolPointId(patrolPointId); - patrolMeasurePointPlan.setMeasurePointId(jsonObject.getString("id")); - patrolMeasurePointPlan.setEquipmentId(null); - patrolMeasurePointPlan.setPid(patrolPointId); - patrolMeasurePointPlan.setType(type); - - //判断子节点是否存在 - List list2 = entityDao.selectListByWhere(patrolMeasurePointPlan2); - if(list2!=null && list2.size()>0){ - //已存在 - }else { - int ressave = entityDao.insert(patrolMeasurePointPlan); - res = res + ressave; - } - } - } - } - } - return res; - } - - /** - * 设备关联填报内容(设备巡检) - */ - @Override - public int saveByPlan(String ids,String planId,String equipmentId,String userId) { - int res = 0 ; - if(ids!=null && !ids.equals("")){ - - String[] id = ids.split(","); - for (int i = 0; i < id.length; i++) { -// PatrolPointMeasurePoint patrolPointMeasurePoint = patrolPointMeasurePointDao.selectByPrimaryKey(id[i]); -// if(patrolPointMeasurePoint!=null){ - PatrolMeasurePointPlan patrolMeasurePointPlan = new PatrolMeasurePointPlan(); - patrolMeasurePointPlan.setId(CommUtil.getUUID()); - patrolMeasurePointPlan.setInsdt(CommUtil.nowDate()); - patrolMeasurePointPlan.setInsuser(userId); - patrolMeasurePointPlan.setPatrolPlanId(planId); - patrolMeasurePointPlan.setEquipmentId(equipmentId); - patrolMeasurePointPlan.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - patrolMeasurePointPlan.setMeasurePointId(id[i]); - int ressave = entityDao.insert(patrolMeasurePointPlan); - res = res + ressave; -// } - } - } - return res; - } - - - @Override - public List selectListByTree(String bizId,String wherestr) { - PatrolMeasurePointPlan entity = new PatrolMeasurePointPlan(); - entity.setWhere(wherestr); - List patrolMeasurePointPlans = entityDao.selectListByWhere(entity); - List list = new ArrayList<>(); - for (PatrolMeasurePointPlan item : patrolMeasurePointPlans) { - list.add(item.getMeasurePointId()); - } - return list; - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolMeasurePointRecordServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolMeasurePointRecordServiceImpl.java deleted file mode 100644 index 83d0ed40..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolMeasurePointRecordServiceImpl.java +++ /dev/null @@ -1,420 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.enums.MeterLibraryTypeEnum; -import com.sipai.entity.process.MeterCheck; -import com.sipai.entity.process.MeterCheckLibrary; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.service.process.MeterCheckService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.tools.CommUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.dao.timeefficiency.PatrolContentsRecordDao; -import com.sipai.dao.timeefficiency.PatrolMeasurePointRecordDao; -import com.sipai.dao.timeefficiency.PatrolPointDao; -import com.sipai.dao.timeefficiency.PatrolPointMeasurePointDao; -import com.sipai.dao.timeefficiency.PatrolRecordPatrolRouteDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.timeefficiency.PatrolMeasurePointRecord; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolMeasurePointRecordService; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolMeasurePointRecordServiceImpl implements PatrolMeasurePointRecordService { - @Resource - private PatrolMeasurePointRecordDao entityDao; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private PatrolPointMeasurePointDao patrolPointMeasurePointDao; - @Resource - private PatrolRecordPatrolRouteDao patrolRecordPatrolRouteDao; - @Resource - private PatrolPointDao patrolPointDao; - @Resource - private PatrolMeasurePointRecordDao patrolMeasurePointRecordDao; - @Resource - private PatrolContentsRecordDao patrolContentsRecordDao; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MeterCheckService meterCheckService; - - @Override - public PatrolMeasurePointRecord selectById(String id) { - return entityDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return entityDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolMeasurePointRecord entity) { - return entityDao.insert(entity); - } - - @Override - public int update(PatrolMeasurePointRecord entity) { - return entityDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolMeasurePointRecord entity = new PatrolMeasurePointRecord(); - entity.setWhere(wherestr); - return entityDao.selectListByWhere(entity); - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolMeasurePointRecord entity = new PatrolMeasurePointRecord(); - entity.setWhere(wherestr); - return entityDao.deleteByWhere(entity); - } - - @Override - public List selectListByRecord(String bizId, String wherestr) { - PatrolMeasurePointRecord entity = new PatrolMeasurePointRecord(); - entity.setWhere(wherestr); - List list = entityDao.selectListByWhere(entity); - for (PatrolMeasurePointRecord item : list) { - MPoint mPoint = this.mPointService.selectById(bizId, item.getMeasurePointId()); - //通过测量点valueMeaning字段获取手动测量点 中文值 - if (mPoint != null) { - - //中文含义选择框 - String valuemeaning = mPoint.getValuemeaning() == null ? "" : mPoint.getValuemeaning(); - String[] split = valuemeaning.split(","); - if (split.length == 2) { - JSONArray jsonArray = new JSONArray(); - String[] mingcheng = split[0].split("/"); - String[] zhi = split[1].split("/"); - for (int j = 0; j < mingcheng.length; j++) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("mingcheng", mingcheng[j]); - jsonObject2.put("zhi", zhi[j]); - jsonArray.add(jsonObject2); - } - mPoint.setValuemeaningArray(jsonArray); - mPoint.setValuemeaningFlag(true); - } else { - mPoint.setValuemeaningFlag(false); - } - -// if(mPoint.getValuemeaning()!=null&&!mPoint.getValuemeaning().equals("")){ -// String name = MPointValueMeaningEnum.getName(mPoint.getValuemeaning()); -// try{ -// String[] arr = name.split("/"); -// mPoint.setChineseValue(arr[item.getMpvalue().intValue()]); -// }catch(Exception e){ -// if(item.getMpvalue()!=null){ -// mPoint.setChineseValue(String.valueOf(item.getMpvalue().intValue())); -// } -// System.out.println("枚举类name转换数组报错"+e); -// } -// }else{ -// if(item.getMpvalue()!=null){ -// mPoint.setChineseValue(String.valueOf(item.getMpvalue().intValue())); -// } -// } - //查出子表对应的值 - List list_his = mPointHistoryService.selectListByTableAWhere(bizId, "[tb_mp_" + mPoint.getMpointcode() + "]", "where userid = '" + item.getPatrolRecordId() + "'"); - if (list_his != null && list_his.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(list_his.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - item.setMpvalue(parmValue + ""); - } else { - item.setMpvalue(""); - } - } else { - item.setMpvalue(""); - } - //测量点对象 - item.setmPoint(mPoint); - } - return list; - } - - @Override - public JSONArray selectListByTree(String patrolRecordId, String patrolPointId, String equipmentId, String unitId) { - PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); - PatrolPoint patrolPoint = patrolPointDao.selectByPrimaryKey(patrolPointId); - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObjectPoint = new JSONObject(); - JSONArray jsonArrayPoint = new JSONArray(); - // 0为普通树状 1为表格树状 - Integer type = 0; - if (patrolPoint != null) { - if (equipmentId != null && !equipmentId.equals("")) { - //设备巡检 - patrolMeasurePointRecord.setWhere(" where patrol_record_id='" + patrolRecordId + "' and equipment_id = '" + equipmentId + "' "); - } else { - //运行巡检 - patrolMeasurePointRecord.setWhere(" where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id is null "); - } - List list = patrolMeasurePointRecordDao.selectListByWhere(patrolMeasurePointRecord); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list.get(i).getId()); - MPoint mPoint = mPointService.selectById(unitId, list.get(i).getMeasurePointId()); - // 查询是否 存在对比表中 - if (StringUtils.isBlank(equipmentId)) { - if (mPoint != null) { - String where = "where m.xj_id = '" + patrolRecordId + "' and m.input_time between '" + list.get(i).getInsdt().substring(0, 10) + " 00:00' and '" + list.get(i).getInsdt().substring(0, 10) + " 23:59'" + - " and ml.mpid_rg = '" + mPoint.getMpointid() + "'"; - List meterChecks = meterCheckService.selectListLeftLibraryByWhere(where); - if (meterChecks.size() > 0) { - // 在线值 - BigDecimal mpValue = new BigDecimal(meterChecks.get(0).getMpValue()); - // 填报值 - BigDecimal inputValue = new BigDecimal(meterChecks.get(0).getInputValue()); - // 填报值 - if (list.get(i).getMpvalue() != null) { - inputValue = new BigDecimal(list.get(i).getMpvalue()); - } - jsonObject.put("inputValue", inputValue.setScale(2, RoundingMode.HALF_UP)); - jsonObject.put("zjValue", meterChecks.get(0).getMpValue()); - String unit = StringUtils.isNotBlank(mPoint.getUnit()) ? mPoint.getUnit() : ""; - // 填报值 - jsonObject.put("newValue", inputValue.setScale(2, RoundingMode.HALF_UP).toString() + unit); - BigDecimal outValue = mpValue.subtract(inputValue); - BigDecimal hValue = new BigDecimal(meterChecks.get(0).get_targetValue()); - BigDecimal lValue = new BigDecimal(meterChecks.get(0).get_targetValue2()); - // 如果类型是偏差率 - if (meterChecks.get(0).get_targetValueType().equals(MeterLibraryTypeEnum.TYPE_PERCENT.getName())) { - outValue = outValue.divide(inputValue, 2, BigDecimal.ROUND_HALF_UP); - // 高于上限 或 低于下限 - if (outValue.compareTo(hValue) == 1 || outValue.compareTo(lValue) == -1) { - jsonObject.put("type", "red"); - outValue = outValue.multiply(new BigDecimal("10")); - } - hValue = hValue.multiply(new BigDecimal("10")); - lValue = lValue.multiply(new BigDecimal("10")); - jsonObject.put("targetValue", hValue.toString() + "%"); - jsonObject.put("targetValue2", lValue.toString() + "%"); - } else { - jsonObject.put("targetValue", hValue.toString()); - jsonObject.put("targetValue2", lValue.toString()); - } - jsonObject.put("dValue", outValue.setScale(2, RoundingMode.HALF_UP)); - type = 1; - } - } - } - if (mPoint != null) { - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("text", mPoint.getParmname());//珠海专用 - } else { - jsonObject.put("name", ""); - jsonObject.put("text", "");//珠海专用 - } - jsonObject.put("status", list.get(i).getStatus()); - String unitStr = ""; - String valueStr = ""; - if (list.get(i).getMpvalue() != null) { - if (mPoint != null && mPoint.getUnit() != null && !mPoint.getUnit().equals("")) { - unitStr = mPoint.getUnit(); - } - jsonObject.put("mpvalue", list.get(i).getMpvalue()); - - valueStr = jsonObject.get("mpvalue").toString(); - valueStr = valueStr.substring(0, valueStr.indexOf(".") + 3); - } else { - jsonObject.put("mpvalue", ""); - } - // 如果含义不为空 - if (mPoint != null && StringUtils.isNotBlank(mPoint.getValuemeaning())) { - String[] valueMeaning = mPoint.getValuemeaning().split(","); - // 得到 实义代表的index - String[] valueMeaningIds = valueMeaning[1].split("/"); - String[] valueMeanings = valueMeaning[0].split("/"); - // 遍历index 如果等于 index 则将实义赋予填报值 - for (int j = 0; j < valueMeaningIds.length; j++) { - if(list.get(i).getMpvalue()!=null && !list.get(i).getMpvalue().equals("")){ - if (Double.valueOf(valueMeaningIds[j]).equals(Double.valueOf(list.get(i).getMpvalue()))) { - jsonObject.put("mpvalue", valueMeanings[j]); - valueStr = valueMeanings[j]; - unitStr = ""; - } - } - } - } - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolMeasurePoint); - - //通过测量点valueMeaning字段获取手动测量点 中文值 - if (mPoint != null) { -// if(mPoint.getValuemeaning()!=null&&!mPoint.getValuemeaning().equals("")){ -// String name = MPointValueMeaningEnum.getName(mPoint.getValuemeaning()); -// try{ -// String[] arr = name.split("/"); -// mPoint.setChineseValue(arr[list.get(i).getMpvalue().intValue()]); -// }catch(Exception e){ -// if(list.get(i).getMpvalue()!=null){ -// mPoint.setChineseValue(String.valueOf(list.get(i).getMpvalue().intValue())); -// } -// System.out.println("枚举类name转换数组报错"+e); -// } -// }else{ -// if(list.get(i).getMpvalue()!=null){ -// BigDecimal bd = new BigDecimal(String.valueOf(list.get(i).getMpvalue())); -// bd = bd.setScale(2,BigDecimal.ROUND_HALF_UP); -// mPoint.setChineseValue(String.valueOf(bd)); -// } -// } - } - jsonObject.put("mPoint", mPoint); - String[] tags = {"" + valueStr + unitStr}; - jsonObject.put("tags", tags);//珠海专用 - jsonArrayPoint.add(jsonObject); - } - jsonObjectPoint.put("id", patrolPoint.getId()); - jsonObjectPoint.put("name", patrolPoint.getName()); - jsonObjectPoint.put("text", patrolPoint.getName());//珠海专用 - jsonObjectPoint.put("icon", TimeEfficiencyCommStr.PatrolPoint); - jsonObjectPoint.put("mPoint", null); - jsonObjectPoint.put("data", jsonArrayPoint); - jsonObjectPoint.put("nodes", jsonArrayPoint);//珠海专用 - jsonObjectPoint.put("type", type); - jsonArray.add(jsonObjectPoint); - } - } - if (equipmentId != null && !equipmentId.equals("")) { - //设备巡检 - patrolMeasurePointRecord.setWhere(" where patrol_record_id='" + patrolRecordId + "' and equipment_id = '" + equipmentId + "' "); - } else { - //运行巡检 - patrolMeasurePointRecord.setWhere(" where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id is not null "); - } - - List list = patrolMeasurePointRecordDao.selectListByWhere(patrolMeasurePointRecord); - if (list != null && list.size() > 0) { - HashSet hashSet = new HashSet<>(); - for (int i = 0; i < list.size(); i++) { - hashSet.add(list.get(i).getEquipmentId()); - } - Iterator iterator = hashSet.iterator(); - while (iterator.hasNext()) { - String equId = iterator.next(); - //有些任务是 公司下面的 既配了1车间的也配了2车间的巡检点或者 无法通过前端传的unitId来识别 智能根据巡检点或设备id来查询对应的unitId - EquipmentCard equipmentCard = equipmentCardService.selectById(equId); - if (equipmentCard != null) { - //unitId = equipmentCard.getUnitId(); - } - - if (equipmentId != null && !equipmentId.equals("")) { - //设备巡检 - patrolMeasurePointRecord.setWhere(" where patrol_record_id='" + patrolRecordId + "' and equipment_id='" + equId + "' "); - } else { - //运行巡检 - patrolMeasurePointRecord.setWhere(" where patrol_record_id='" + patrolRecordId + "' and patrol_point_id='" + patrolPointId + "' and equipment_id='" + equId + "' "); - } - - List list2 = patrolMeasurePointRecordDao.selectListByWhere(patrolMeasurePointRecord); - if (list2 != null && list2.size() > 0) { - JSONObject jsonObjectEqu = new JSONObject(); - JSONArray jsonArrayEqu = new JSONArray(); - for (int i = 0; i < list2.size(); i++) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", list2.get(i).getId()); - MPoint mPoint = mPointService.selectById(unitId, list2.get(i).getMeasurePointId()); - if (mPoint != null) { - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("text", mPoint.getParmname());//珠海专用 - /*if (mPoint != null) { - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("text", mPoint.getParmname());//珠海专用 - } else { - jsonObject.put("name", ""); - jsonObject.put("text", "");//珠海专用 - }*/ - jsonObject.put("status", list2.get(i).getStatus()); - String unitStr = ""; - String valueStr = ""; - if (list2.get(i).getMpvalue() != null) { - jsonObject.put("mpvalue", list2.get(i).getMpvalue()); - if (mPoint != null && mPoint.getUnit() != null && !mPoint.getUnit().equals("")) { - unitStr = mPoint.getUnit(); - } - - valueStr = jsonObject.get("mpvalue").toString(); - valueStr = valueStr.substring(0, valueStr.indexOf(".") + 3); - } else { - jsonObject.put("mpvalue", ""); - } - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolMeasurePoint); - - //通过测量点valueMeaning字段获取手动测量点 中文值 - if (mPoint != null) { -// if(mPoint.getValuemeaning()!=null&&!mPoint.getValuemeaning().equals("")){ -// String name = MPointValueMeaningEnum.getName(mPoint.getValuemeaning()); -// try{ -// String[] arr = name.split("/"); -// mPoint.setChineseValue(arr[list2.get(i).getMpvalue().intValue()]); -// }catch(Exception e){ -// if(list2.get(i).getMpvalue()!=null){ -// mPoint.setChineseValue(String.valueOf(list2.get(i).getMpvalue().intValue())); -// } -// System.out.println("枚举类name转换数组报错"+e); -// } -// }else{ -// if(list2.get(i).getMpvalue()!=null){ -// BigDecimal bd = new BigDecimal(String.valueOf(list2.get(i).getMpvalue())); -// bd = bd.setScale(2,BigDecimal.ROUND_HALF_UP); -// mPoint.setChineseValue(String.valueOf(bd)); -// } -// } - } - jsonObject.put("mPoint", mPoint); - String[] tags = {"" + valueStr + unitStr}; - jsonObject.put("tags", tags);//珠海专用 - jsonArrayEqu.add(jsonObject); - } else { - jsonObject.put("name", ""); - jsonObject.put("text", "");//珠海专用 - } - } - jsonObjectEqu.put("id", equId); - //EquipmentCard equipmentCard = equipmentCardService.selectById(equId); - if (equipmentCard != null) { - jsonObjectEqu.put("name", equipmentCard.getEquipmentname()); - jsonObjectEqu.put("text", equipmentCard.getEquipmentname());//珠海专用 - } else { - jsonObjectEqu.put("name", ""); - jsonObjectEqu.put("text", "");//珠海专用 - } - jsonObjectEqu.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObjectEqu.put("mPoint", null); - jsonObjectEqu.put("data", jsonArrayEqu); - jsonObjectEqu.put("nodes", jsonArrayEqu);//珠海专用 - jsonArray.add(jsonObjectEqu); - } - } - - } - return jsonArray; - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolModelServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolModelServiceImpl.java deleted file mode 100644 index e64b84da..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolModelServiceImpl.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.timeefficiency.PatrolModelDao; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.timeefficiency.PatrolAreaFloor; -import com.sipai.entity.timeefficiency.PatrolAreaProcessSection; -import com.sipai.entity.timeefficiency.PatrolModel; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.timeefficiency.PatrolAreaFloorService; -import com.sipai.service.timeefficiency.PatrolAreaProcessSectionService; -import com.sipai.service.timeefficiency.PatrolAreaService; -import com.sipai.service.timeefficiency.PatrolModelService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolModelService") -public class PatrolModelServiceImpl implements PatrolModelService{ - @Resource - private PatrolModelDao patrolModelDao; -// @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolAreaService patrolAreaService; - @Resource - private PatrolAreaFloorService patrolAreaFloorService; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private CommonFileService commonFileService; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private PatrolAreaProcessSectionService patrolAreaProcessSectionService; - @Resource - private PatrolPointService patrolPointService; - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolModelService#selectById(java.lang.String) - */ - @Override - public PatrolModel selectById(String id) { - return patrolModelDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolModelService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolModelDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolModelService#save(com.sipai.entity.timeefficiency.PatrolModel) - */ - @Override - public int save(PatrolModel entity) { - return patrolModelDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolModelService#update(com.sipai.entity.timeefficiency.PatrolModel) - */ - @Override - public int update(PatrolModel entity) { - return patrolModelDao.updateByPrimaryKeySelective(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolModelService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolModel patrolModel = new PatrolModel(); - patrolModel.setWhere(wherestr); - List patrolModels = this.patrolModelDao.selectListByWhere(patrolModel); - for(int i=0;i patrolModels = this.selectListByWhere("where biz_id ='"+patrolModel.getBizId()+"' and type='"+patrolModel.getType()+"'"); - for (PatrolModel item : patrolModels) { - item.setDefaultFlag(false); - this.update(item); - } - patrolModel.setDefaultFlag(true); - return this.update(patrolModel); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolModelService#setDefaultPatrol(java.lang.String, java.lang.String, java.lang.String, java.lang.String) - */ - @Override - @SuppressWarnings("unchecked") - @Transactional - public String setDefaultPatrol(String oldCompanyId,String newCompanyId,String userid,String fileTable) { - String result ="1"; - try { - //工艺段复制 - List processSections = this.processSectionService.selectListByWhere(" where pid='"+oldCompanyId+"'"); - //先删除 - int dresProcess = this.processSectionService.deleteByWhere(" where pid='"+newCompanyId+"'"); - int processSectionSize = processSections.size();//赋值数组大小,减少循环内对比获取数组长度 - for (int i =0;i patrolModels = this.selectListByWhere(" where biz_id ='"+oldCompanyId+"'"); - //先删除 - int dresModel = this.deleteByWhere(" where biz_id='"+newCompanyId+"'"); - int patrolModelSize = patrolModels.size();//赋值数组大小,减少循环内对比获取数组长度 - for (int i=0;i patrolAreas = this.patrolAreaService.selectListByWhere(" where biz_id ='"+oldCompanyId+"'"); - //先删除 未将楼层和文件删除,此后完善 - int dresArea = this.patrolAreaService.deleteByWhere(" where biz_id='"+newCompanyId+"'"); - int patrolAreaSize = patrolAreas.size(); - for (int i=0;i patolAreaFloors = this - .patrolAreaFloorService.selectListByWhere("where patrol_area_id = '"+oldPatrolAreaId+"'"); - int patolAreaFloorSize = patolAreaFloors.size(); - for (int j=0;j floorFile = this - .commonFileService.selectListByTableAWhere(fileTable," where masterid = '"+oldPatrolFloorId+"'"); - for (int f=0;f patrolAreaProcessSection = this.patrolAreaProcessSectionService - .selectNewProcessSectionByWhere(" where A.pid = '"+oldCompanyId+"' and B.pid = '"+newCompanyId+"'"); - int patrolAreaProcessSectionSize = patrolAreaProcessSection.size(); - for (int p=0;p patrolPoints = this.patrolPointService.getNewProcessSectionPatrolPoint(" where A.pid = '"+oldCompanyId+"' and B.pid = '"+newCompanyId+"'"); - //先删除 - int dResPoint = this.patrolPointService.deleteByWhere(" where biz_id='"+newCompanyId+"'"); - int patrolPointSize = patrolPoints.size(); - for (int i=0;i selectListByWhere(String wherestr) { - PatrolPlanDept patrolPlanDept = new PatrolPlanDept(); - patrolPlanDept.setWhere(wherestr); - List patrolPlans= patrolPlanDeptDao.selectListByWhere(patrolPlanDept); - return patrolPlans; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanDeptService#deleteByWhere(java.lang.String) - */ - - public int deleteByWhere(String wherestr) { - PatrolPlanDept patrolPlanDept = new PatrolPlanDept(); - patrolPlanDept.setWhere(wherestr); - return patrolPlanDeptDao.deleteByWhere(patrolPlanDept); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanDeptService#getDeptsByPatrolPlanId(java.lang.String) - */ - - public List getDeptsByPatrolPlanId(String patrolPlanId) { - List depts = new ArrayList<>(); - List patrolPlanDepts = this.selectListByWhere("where patrol_plan_id ='"+patrolPlanId+"'"); - for (PatrolPlanDept patrolPlanDept : patrolPlanDepts) { - Dept dept = this.unitService.getDeptById(patrolPlanDept.getDeptId()); - depts.add(dept); - } - return depts; - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPlanPatrolEquipmentServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPlanPatrolEquipmentServiceImpl.java deleted file mode 100644 index 4777697f..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPlanPatrolEquipmentServiceImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolPlanPatrolEquipmentDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.timeefficiency.PatrolPlanPatrolEquipmentService; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolPlanPatrolEquipmentServiceImpl implements PatrolPlanPatrolEquipmentService { - - @Resource - private PatrolPlanPatrolEquipmentDao patrolPlanPatrolEquipmentDao; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#selectById(java.lang.String) - */ - @Override - public PatrolPlanPatrolEquipment selectById(String id) { - return patrolPlanPatrolEquipmentDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolPlanPatrolEquipmentDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#save(com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment) - */ - @Override - public int save(PatrolPlanPatrolEquipment entity) { - return this.patrolPlanPatrolEquipmentDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#update(com.sipai.entity.timeefficiency.PatrolPlanPatrolEquipment) - */ - @Override - public int update(PatrolPlanPatrolEquipment patrolPlanPatrolEquipment) { - return patrolPlanPatrolEquipmentDao.updateByPrimaryKeySelective(patrolPlanPatrolEquipment); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setWhere(wherestr); - List patrolPlanPatrolEquipments = patrolPlanPatrolEquipmentDao.selectListByWhere(patrolPlanPatrolEquipment); - for (PatrolPlanPatrolEquipment item : patrolPlanPatrolEquipments) { - item.setEquipmentCard(equipmentCardService.selectSimpleListById(item.getEquipmentId())); - } - return patrolPlanPatrolEquipments; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setWhere(wherestr); - return patrolPlanPatrolEquipmentDao.deleteByWhere(patrolPlanPatrolEquipment); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolEquipmentService#getEquipmentCardsByPatrolPlanId(java.lang.String) - */ - @Override - public List getEquipmentCardsByPatrolPlanId(String patrolPlanId) { - List equipmentCards = new ArrayList<>(); - List patrolPlanPatrolEquipments = this.selectListByWhere("where plan_id ='" + patrolPlanId + "'"); - for (PatrolPlanPatrolEquipment patrolPlanPatrolEquipment : patrolPlanPatrolEquipments) { -// EquipmentCard patrolPoint =equipmentCardService.selectById(patrolPlanPatrolEquipment.getEquipmentId()); - equipmentCards.add(patrolPlanPatrolEquipment.getEquipmentCard()); - - } - return equipmentCards; - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPlanPatrolPointServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPlanPatrolPointServiceImpl.java deleted file mode 100644 index a6a3f6fa..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPlanPatrolPointServiceImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.sipai.service.timeefficiency.impl; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolPlanPatrolPointDao; -import com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.service.timeefficiency.PatrolPlanPatrolPointService; -import com.sipai.service.timeefficiency.PatrolPointService; -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolPlanPatrolPointService") -public class PatrolPlanPatrolPointServiceImpl implements PatrolPlanPatrolPointService{ - - @Resource - private PatrolPlanPatrolPointDao patrolPlanPatrolPointDao; - @Resource - private PatrolPointService patrolPointService; - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#selectById(java.lang.String) - */ - @Override - public PatrolPlanPatrolPoint selectById(String id) { - return patrolPlanPatrolPointDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolPlanPatrolPointDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#save(com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint) - */ - @Override - public int save(PatrolPlanPatrolPoint entity) { - return this.patrolPlanPatrolPointDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#update(com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint) - */ - @Override - public int update(PatrolPlanPatrolPoint patrolPlanPatrolPoint) { - return patrolPlanPatrolPointDao.updateByPrimaryKeySelective(patrolPlanPatrolPoint); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolPlanPatrolPoint patrolPlanPatrolPoint = new PatrolPlanPatrolPoint(); - patrolPlanPatrolPoint.setWhere(wherestr); - List patrolPlanPatrolPoints=patrolPlanPatrolPointDao.selectListByWhere(patrolPlanPatrolPoint); - for (PatrolPlanPatrolPoint item : patrolPlanPatrolPoints) { - item.setPatrolPoint(patrolPointService.selectById(item.getPatrolPointId())); - } - return patrolPlanPatrolPoints; - } - - @Override - public List selectSimpleListByWhere(String wherestr) { - PatrolPlanPatrolPoint patrolPlanPatrolPoint = new PatrolPlanPatrolPoint(); - patrolPlanPatrolPoint.setWhere(wherestr); - List patrolPlanPatrolPoints=patrolPlanPatrolPointDao.selectListByWhere(patrolPlanPatrolPoint); - return patrolPlanPatrolPoints; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolPlanPatrolPoint patrolPlanPatrolPoint = new PatrolPlanPatrolPoint(); - patrolPlanPatrolPoint.setWhere(wherestr); - return patrolPlanPatrolPointDao.deleteByWhere(patrolPlanPatrolPoint); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#getPatrolPointsByPatrolPlanId(java.lang.String) - */ - @Override - public List getPatrolPointsByPatrolPlanId(String patrolPlanId) { - List patrolPoints = new ArrayList<>(); - List PatrolPlanPatrolPoints = this.selectListByWhere("where plan_id ='"+patrolPlanId+"'"); - for (PatrolPlanPatrolPoint patrolPlanPatrolPoint : PatrolPlanPatrolPoints) { -// PatrolPoint patrolPoint =patrolPointService.selectById(patrolPlanPatrolPoint.getPatrolPointId()); - patrolPoints.add(patrolPlanPatrolPoint.getPatrolPoint()); - - } - return patrolPoints; - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPlanRiskLevelServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPlanRiskLevelServiceImpl.java deleted file mode 100644 index e7a6f26a..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPlanRiskLevelServiceImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import com.sipai.dao.timeefficiency.PatrolPlanRiskLevelDao; -import com.sipai.entity.timeefficiency.PatrolPlanRiskLevel; -import com.sipai.service.hqconfig.RiskLevelService; -import com.sipai.service.timeefficiency.PatrolPlanRiskLevelService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class PatrolPlanRiskLevelServiceImpl implements PatrolPlanRiskLevelService { - - - @Resource - private PatrolPlanRiskLevelDao patrolPlanRiskLevelDao; - @Resource - private RiskLevelService riskLevelService; - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#selectById(java.lang.String) - */ - @Override - public PatrolPlanRiskLevel selectById(String id) { - return patrolPlanRiskLevelDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolPlanRiskLevelDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#save(com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint) - */ - @Override - public int save(PatrolPlanRiskLevel entity) { - return this.patrolPlanRiskLevelDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#update(com.sipai.entity.timeefficiency.PatrolPlanPatrolPoint) - */ - @Override - public int update(PatrolPlanRiskLevel patrolPlanRiskLevel) { - return patrolPlanRiskLevelDao.updateByPrimaryKeySelective(patrolPlanRiskLevel); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolPlanRiskLevel patrolPlanRiskLevel = new PatrolPlanRiskLevel(); - patrolPlanRiskLevel.setWhere(wherestr); - List patrolPlanRiskLevels = patrolPlanRiskLevelDao.selectListByWhere(patrolPlanRiskLevel); - for (PatrolPlanRiskLevel item : patrolPlanRiskLevels) { - item.setRiskLevel(riskLevelService.selectById( item.getRiskLevelId() ) ); - } - return patrolPlanRiskLevels; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanPatrolPointService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolPlanRiskLevel patrolPlanRiskLevel = new PatrolPlanRiskLevel(); - patrolPlanRiskLevel.setWhere(wherestr); - return patrolPlanRiskLevelDao.deleteByWhere(patrolPlanRiskLevel); - } - - - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPlanServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPlanServiceImpl.java deleted file mode 100644 index c1e2c3ae..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPlanServiceImpl.java +++ /dev/null @@ -1,284 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.*; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.timeefficiency.*; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.timeefficiency.PatrolPlanDao; -import com.sipai.entity.user.Dept; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolPlanService") -public class PatrolPlanServiceImpl implements PatrolPlanService { - @Resource - private PatrolPlanDao patrolPlanDao; - @Resource - private PatrolAreaService patrolAreaService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolPlanPatrolPointService patrolPlanPatrolPointService; - @Resource - private PatrolPlanPatrolEquipmentService patrolPatrolEquipmentService; - @Resource - private PatrolRouteService patrolRouteService; - @Resource - private PatrolPlanDeptService patrolPlanDeptService; - @Resource - private PatrolContentsPlanService patrolContentsPlanService; - @Resource - private PatrolMeasurePointPlanService patrolMeasurePointPlanService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPlanPatrolEquipmentService patrolPlanPatrolEquipmentService; - @Resource - private PatrolPlanTypeService patrolPlanTypeService; - - public PatrolPlan selectById(String id) { - PatrolPlan patrolPlan = patrolPlanDao.selectByPrimaryKey(id); - if (patrolPlan != null) { - patrolPlan.setDepts(patrolPlanDeptService.getDeptsByPatrolPlanId(patrolPlan.getId())); - } - return patrolPlan; - } - - public PatrolPlan selectSimpleById(String id) { - PatrolPlan patrolPlan = patrolPlanDao.selectByPrimaryKey(id); - return patrolPlan; - } - - public int deleteById(String id) { - PatrolPlan patrolPlan = this.selectById(id); - if (TimeEfficiencyCommStr.PatrolType_Product.equals(patrolPlan.getType())) { - patrolPlanPatrolPointService.deleteByWhere("where plan_id='" + id + "'"); - patrolRouteService.deleteByWhere("where patrol_plan_id='" + id + "'"); - //巡检记录巡检内容 - patrolContentsPlanService.deleteByWhere(" where patrol_plan_id='" + id + "'"); - //巡检记录填报因素 - patrolMeasurePointPlanService.deleteByWhere(" where patrol_plan_id='" + id + "'"); - } else if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(patrolPlan.getType())) { - /* - * 暂时 - */ - patrolRouteService.deleteByWhere("where patrol_plan_id='" + id + "'"); - //巡检记录巡检内容 - patrolContentsPlanService.deleteByWhere(" where patrol_plan_id='" + id + "'"); - //巡检记录填报因素 - patrolMeasurePointPlanService.deleteByWhere(" where patrol_plan_id='" + id + "'"); - patrolPatrolEquipmentService.deleteByWhere("where patrol_plan_id='" + id + "'"); - } - ; - return patrolPlanDao.deleteByPrimaryKey(id); - } - - @Transactional - public int save(PatrolPlan entity) { - try { - int res = patrolPlanDao.insert(entity); - if (res == 1) { - patrolPlanDeptService.deleteByWhere("where patrol_plan_id ='" + entity.getId() + "'"); - List depts = entity.getDepts(); - if (depts != null && depts.size() > 0) { - for (int i = 0; i < depts.size(); i++) { - PatrolPlanDept patrolPlanDept = new PatrolPlanDept(); - patrolPlanDept.setId(CommUtil.getUUID()); - patrolPlanDept.setInsdt(entity.getInsdt()); - patrolPlanDept.setInsuser(entity.getInsuser()); - patrolPlanDept.setPatrolPlanId(entity.getId()); - patrolPlanDept.setDeptId(depts.get(i).getId()); - int res_ = patrolPlanDeptService.save(patrolPlanDept); - if (res_ == 0) { - throw new RuntimeException(); - } - - } - } - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - - @Transactional - public int update(PatrolPlan entity) { - try { - int res = patrolPlanDao.updateByPrimaryKeySelective(entity); - if (res == 1) { - patrolPlanDeptService.deleteByWhere("where patrol_plan_id ='" + entity.getId() + "'"); - List depts = entity.getDepts(); - if (depts != null && depts.size() > 0) { - for (int i = 0; i < depts.size(); i++) { - PatrolPlanDept patrolPlanDept = new PatrolPlanDept(); - patrolPlanDept.setId(CommUtil.getUUID()); -// patrolPlanDept.setInsdt(depts.get(i).getInsdt()); - patrolPlanDept.setInsuser(depts.get(i).getInsuser()); - patrolPlanDept.setPatrolPlanId(entity.getId()); - patrolPlanDept.setDeptId(depts.get(i).getId()); - int res_ = patrolPlanDeptService.save(patrolPlanDept); - if (res_ == 0) { - throw new RuntimeException(); - } - - } - } - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - - public int updateSimple(PatrolPlan entity) { - int res = patrolPlanDao.updateByPrimaryKeySelective(entity); - return res; - } - - public List selectListByWhere(String wherestr) { - PatrolPlan patrolPlan = new PatrolPlan(); - patrolPlan.setWhere(wherestr); - List patrolPlans = patrolPlanDao.selectListByWhere(patrolPlan); - for (PatrolPlan item : patrolPlans) { - item.setDepts(patrolPlanDeptService.getDeptsByPatrolPlanId(item.getId())); - } - return patrolPlans; - } - - public List selectSimpleListByWhere(String wherestr) { - PatrolPlan patrolPlan = new PatrolPlan(); - patrolPlan.setWhere(wherestr); - List patrolPlans = patrolPlanDao.selectListByWhere(patrolPlan); - return patrolPlans; - } - - public List selectListByWhere4Safe(String wherestr) { - PatrolPlan patrolPlan = new PatrolPlan(); - patrolPlan.setWhere(wherestr); - List patrolPlans = patrolPlanDao.selectListByWhere(patrolPlan); - for (PatrolPlan item : patrolPlans) { - //查询班组 - item.setDepts(patrolPlanDeptService.getDeptsByPatrolPlanId(item.getId())); - - //查询任务类型 - item.setPatrolPlanType(patrolPlanTypeService.selectById(item.getTaskType())); - } - return patrolPlans; - } - - public int deleteByWhere(String wherestr) { - PatrolPlan patrolPlan = new PatrolPlan(); - patrolPlan.setWhere(wherestr); - List patrolPlans = patrolPlanDao.selectListByWhere(patrolPlan); - for (PatrolPlan item : patrolPlans) { - if (TimeEfficiencyCommStr.PatrolType_Product.equals(item.getType())) { - patrolPlanPatrolPointService.deleteByWhere("where plan_id='" + item.getId() + "'"); - patrolRouteService.deleteByWhere("where patrol_plan_id='" + item.getId() + "'"); - //巡检记录巡检内容 - patrolContentsPlanService.deleteByWhere(" where patrol_plan_id='" + item.getId() + "'"); - //巡检记录填报因素 - patrolMeasurePointPlanService.deleteByWhere(" where patrol_plan_id='" + item.getId() + "'"); - } else if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(item.getType())) { - patrolPatrolEquipmentService.deleteByWhere("where patrol_plan_id='" + item.getId() + "'"); - /* - * 暂时 - */ - patrolRouteService.deleteByWhere("where patrol_plan_id='" + item.getId() + "'"); - //巡检记录巡检内容 - patrolContentsPlanService.deleteByWhere(" where patrol_plan_id='" + item.getId() + "'"); - //巡检记录填报因素 - patrolMeasurePointPlanService.deleteByWhere(" where patrol_plan_id='" + item.getId() + "'"); - } - ; - } - return patrolPlanDao.deleteByWhere(patrolPlan); - } - - @Override - public int saveEquipmentCards(String patrolEquipmentIds, String userId, String patrolPlanId) { - int res = 0; - String[] idArray = patrolEquipmentIds.split(","); - HashSet hashSet = new HashSet<>(); - for (int i = 0; i < idArray.length; i++) { - if (idArray[i] != null && !idArray[i].isEmpty() && !idArray[i].equals("undefined")) { - hashSet.add(idArray[i]); - } - } - - Iterator iterator = hashSet.iterator(); - int morder = 1; - while (iterator.hasNext()) { - String string = (String) iterator.next(); - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(string); - if (equipmentCard != null) { - PatrolPlanPatrolEquipment patrolPlanPatrolEquipment = new PatrolPlanPatrolEquipment(); - patrolPlanPatrolEquipment.setId(CommUtil.getUUID()); - patrolPlanPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolPlanPatrolEquipment.setInsuser(userId); - patrolPlanPatrolEquipment.setPatrolPlanId(patrolPlanId); - patrolPlanPatrolEquipment.setEquipmentId(string); - patrolPlanPatrolEquipment.setMorder(morder); - morder++; - patrolPlanPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - List patrolPointEquipmentCards = this.patrolPointEquipmentCardService.selectListByWhere("where equipment_card_id = '" + string + "'"); - if (patrolPointEquipmentCards != null && patrolPointEquipmentCards.size() > 0) { - for (PatrolPointEquipmentCard patrolPointEquipmentCard : patrolPointEquipmentCards) { - PatrolPoint patrolPoint = this.patrolPointService.selectById(patrolPointEquipmentCard.getPatrolPointId()); - if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(patrolPoint.getType())) { - patrolPlanPatrolEquipment.setPatrolPointId(patrolPointEquipmentCards.get(0).getPatrolPointId()); - - List patrolRoutes = this.patrolRouteService.selectListByWhere("where patrol_plan_id = '" + patrolPlanId + "' and patrol_point_id = '" + patrolPoint.getId() + "'"); - if (!(patrolRoutes != null && patrolRoutes.size() > 0)) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setId(CommUtil.getUUID()); - patrolRoute.setInsdt(CommUtil.nowDate()); - patrolRoute.setInsuser(userId); - patrolRoute.setPatrolPlanId(patrolPlanId);//巡检计划id - patrolRoute.setType("0"); - patrolRoute.setMorder(morder); - morder++; - patrolRoute.setPatrolPointId(patrolPoint.getId()); - BigDecimal bigDecimal_x = new BigDecimal(0); - BigDecimal bigDecimal_y = new BigDecimal(0); - BigDecimal bigDecimal_width = new BigDecimal(0); - BigDecimal bigDecimal_height = new BigDecimal(0); - patrolRoute.setPosx(bigDecimal_x); - patrolRoute.setPosy(bigDecimal_y); - patrolRoute.setContainerWidth(bigDecimal_width); - patrolRoute.setContainerHeight(bigDecimal_height); - res += this.patrolRouteService.save(patrolRoute); - } - } - } - } - res += this.patrolPlanPatrolEquipmentService.save(patrolPlanPatrolEquipment); - } - } - return res; - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPlanTypeServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPlanTypeServiceImpl.java deleted file mode 100644 index f4b071dc..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPlanTypeServiceImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import com.sipai.dao.timeefficiency.PatrolPlanDao; -import com.sipai.dao.timeefficiency.PatrolPlanTypeDao; -import com.sipai.entity.timeefficiency.PatrolPlanType; -import com.sipai.service.timeefficiency.PatrolPlanDeptService; -import com.sipai.service.timeefficiency.PatrolPlanTypeService; -import com.sipai.service.user.ProcessSectionService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - - -@Service("patrolPlanTypeService") -public class PatrolPlanTypeServiceImpl implements PatrolPlanTypeService { - @Resource -// private PatrolPlanTypeService patrolPlanTypeService; - private PatrolPlanTypeDao patrolPlanTypeDao; - - @Resource - private PatrolPlanDao patrolPlanDao; - @Resource - private ProcessSectionService processSectionService; -// @Resource -// private PatrolPlanPatrolPointService patrolPlanPatrolPointService; - @Resource - private PatrolPlanDeptService patrolPlanDeptService; - -// private PatrolPlanTypeDao patrolPlanTypeDao2; - - - @Override - public PatrolPlanType selectById(String id) { - // TODO Auto-generated method stub - PatrolPlanType patrolPlanType =patrolPlanTypeDao.selectByPrimaryKey(id); - /* PatrolPlanType.setDepts(patrolPlanDeptService.getDeptsByPatrolPlanId(patrolPlan.getId())); */ - return patrolPlanType; - // return null; - - } - - @Override - public int deleteById(String id) { - // TODO Auto-generated method stub - int res = patrolPlanTypeDao.deleteByPrimaryKey(id); - return res; - // 1是删除成功 0是删除失败 -// return 0; - } - - @Override - public int save(PatrolPlanType entity) { - // TODO Auto-generated method stub - try { - int res =patrolPlanTypeDao.insert(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } -// return 0; - } - - @Override - public int update(PatrolPlanType entity) { - // TODO Auto-generated method stub - // return 0; - /* PatrolPlanType patrolPlanTypeDao =patrolPlanTypeDao.selectByPrimaryKey(id); */ - /* PatrolPlanType.setDepts(patrolPlanDeptService.getDeptsByPatrolPlanId(patrolPlan.getId())); */ - - try { - int res =patrolPlanTypeDao.updateByPrimaryKeySelective(entity); - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - - } - - @Override - public List selectListByWhere(String wherestr) { - // TODO Auto-generated method stub - PatrolPlanType patrolPlanType = new PatrolPlanType(); - patrolPlanType.setWhere(wherestr); - List patrolPlanTypes= this.patrolPlanTypeDao.selectListByWhere(patrolPlanType); - - - return patrolPlanTypes; - } - - @Override - public int deleteByWhere(String wherestr) { - // TODO Auto-generated method stub -// wherestr = "where id in ('" + ids + "')" - // 1、先根据传入的所有id 来选出这些对象,放到一个List集合里 - PatrolPlanType patrolPlanType = new PatrolPlanType(); - patrolPlanType.setWhere(wherestr); - List selectList = patrolPlanTypeDao.selectListByWhere(patrolPlanType); - int selectSize = selectList.size(); - int resAll = 0; - // 2、遍历这些对象的List - // 3、对单个对象进行 删除, 调用deleteByWhere,where id = item.getId() - for (PatrolPlanType patrolPlanType2 : selectList) { - String id = patrolPlanType2.getId(); - int res = patrolPlanTypeDao.deleteByPrimaryKey(id); - // 自己类的sql调用是走的Dao,调用别人的sql是走的Service - if(res == 1) { - resAll += 1; - } - else { - break; - } - } - // 4、循环结束,多选的选项 全部 被删除 完毕。 - - return resAll; - - } - - - - - - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPointCameraServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPointCameraServiceImpl.java deleted file mode 100644 index 9829e51c..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPointCameraServiceImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolPointCameraDao; -import com.sipai.entity.timeefficiency.PatrolPointCamera; -import com.sipai.service.timeefficiency.PatrolPointCameraService; -import com.sipai.service.work.CameraService; - -@Service -public class PatrolPointCameraServiceImpl implements PatrolPointCameraService { - @Resource - private PatrolPointCameraDao patrolPointCameraDao; - @Resource - private CameraService cameraService; - - @Override - public PatrolPointCamera selectById(String id) { - return patrolPointCameraDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return patrolPointCameraDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolPointCamera patrolPointCamera) { - return patrolPointCameraDao.insertSelective(patrolPointCamera); - } - - @Override - public int update(PatrolPointCamera patrolPointCamera) { - return patrolPointCameraDao.updateByPrimaryKeySelective(patrolPointCamera); - } - - @Override - public List selectListByWhere(String where) { - PatrolPointCamera patrolPointCamera = new PatrolPointCamera(); - patrolPointCamera.setWhere(where); - return patrolPointCameraDao.selectListByWhere(patrolPointCamera); - } - - @Override - public List selectListByWhereCamera(String where) { - List list = selectListByWhere(where); - for(PatrolPointCamera patrolPointCamera:list){ - patrolPointCamera.setCamera(cameraService.selectById(patrolPointCamera.getCameraId())); - } - return list; - } - - @Override - public int deleteByWhere(String where) { - PatrolPointCamera patrolPointCamera = new PatrolPointCamera(); - patrolPointCamera.setWhere(where); - return patrolPointCameraDao.deleteByWhere(patrolPointCamera); - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPointEquipmentCardServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPointEquipmentCardServiceImpl.java deleted file mode 100644 index 134904f5..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPointEquipmentCardServiceImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolPointEquipmentCardDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.timeefficiency.PatrolPointEquipmentCardService; -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolPointEquipmentCardServiceImpl implements PatrolPointEquipmentCardService{ - - @Resource - private PatrolPointEquipmentCardDao patrolpointequipmentCardDao; -// @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#selectById(java.lang.String) - */ - @Override - public PatrolPointEquipmentCard selectById(String id) { - return patrolpointequipmentCardDao.selectByPrimaryKey(id); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#selectById(java.lang.String, java.lang.String) - */ - @Override - public PatrolPointEquipmentCard selectById(String bizId,String id) { - PatrolPointEquipmentCard patrolPointEquipmentCard = patrolpointequipmentCardDao.selectByPrimaryKey(id); - EquipmentCard equipmentCard = this.equipmentCardService.selectById(patrolPointEquipmentCard.getEquipmentCardId()) ; - patrolPointEquipmentCard.setEquipmentCard(equipmentCard); - return patrolPointEquipmentCard; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolpointequipmentCardDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#save(com.sipai.entity.timeefficiency.PatrolPointEquipmentCard) - */ - @Override - public int save(PatrolPointEquipmentCard entity) { - return this.patrolpointequipmentCardDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#update(com.sipai.entity.timeefficiency.PatrolPointEquipmentCard) - */ - @Override - public int update(PatrolPointEquipmentCard patrolpointequipmentCard) { - return patrolpointequipmentCardDao.updateByPrimaryKeySelective(patrolpointequipmentCard); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolPointEquipmentCard patrolpointequipmentCard = new PatrolPointEquipmentCard(); - patrolpointequipmentCard.setWhere(wherestr); - List patrolPointEquipmentCards=patrolpointequipmentCardDao.selectListByWhere(patrolpointequipmentCard); - for (PatrolPointEquipmentCard patrolPointEquipmentCard : patrolPointEquipmentCards) { - patrolPointEquipmentCard.setEquipmentCard(equipmentCardService.selectSimpleListById(patrolPointEquipmentCard.getEquipmentCardId())); - } - return patrolPointEquipmentCards; - } - - - public List selectListByWhereEquipmentCard(String wherestr) { - PatrolPointEquipmentCard patrolpointequipmentCard = new PatrolPointEquipmentCard(); - patrolpointequipmentCard.setWhere(wherestr); - List patrolPointEquipmentCards=patrolpointequipmentCardDao.selectListByEquipment(patrolpointequipmentCard); - for (PatrolPointEquipmentCard item : patrolPointEquipmentCards) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(item.getEquipmentCardId()); - if(equipmentCard!=null){ - item.setEquipmentCard(equipmentCard); - } - } - return patrolPointEquipmentCards; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolPointEquipmentCard patrolpointequipmentCard = new PatrolPointEquipmentCard(); - patrolpointequipmentCard.setWhere(wherestr); - return patrolpointequipmentCardDao.deleteByWhere(patrolpointequipmentCard); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointEquipmentCardService#getEquipmentCardsByPatrolPointId(java.lang.String) - */ - /*@Override - public List getEquipmentCardsByPatrolPointId(String patrolPointId) { - ArrayList equipmentCards = new ArrayList<>(); - List patrolPointEquipmentCards=this.selectListByWhere("where patrol_point_id ='"+patrolPointId+"'"); - for (PatrolPointEquipmentCard item : patrolPointEquipmentCards) { - equipmentCards.add(item.getEquipmentCard()); - } - return equipmentCards; - }*/ -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPointFileServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPointFileServiceImpl.java deleted file mode 100644 index 514b3b78..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPointFileServiceImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolPointFileDao; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.timeefficiency.PatrolPointFile; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.timeefficiency.PatrolPointFileService; -import com.sipai.tools.CommString; -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolPointFileServiceImpl implements PatrolPointFileService{ - - private final static String tablename ="tb_doc_file"; - @Resource - private PatrolPointFileDao patrolPointFileDao; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private CommonFileService commonFileService; - - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#selectById(java.lang.String) - */ - @Override - public PatrolPointFile selectById(String id) { - return patrolPointFileDao.selectByPrimaryKey(id); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#selectById(java.lang.String, java.lang.String) - */ - @Override - public PatrolPointFile selectById(String bizId,String id) { - PatrolPointFile patrolPointFile = patrolPointFileDao.selectByPrimaryKey(id); - return patrolPointFile; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolPointFileDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#save(com.sipai.entity.timeefficiency.PatrolPointFile) - */ - @Override - public int save(PatrolPointFile entity) { - return this.patrolPointFileDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#update(com.sipai.entity.timeefficiency.PatrolPointFile) - */ - @Override - public int update(PatrolPointFile patrolpointmeasurePoint) { - return patrolPointFileDao.updateByPrimaryKeySelective(patrolpointmeasurePoint); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolPointFile patrolpointmeasurePoint = new PatrolPointFile(); - patrolpointmeasurePoint.setWhere(wherestr); - return patrolPointFileDao.selectListByWhere(patrolpointmeasurePoint); - } - - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolPointFile patrolpointmeasurePoint = new PatrolPointFile(); - patrolpointmeasurePoint.setWhere(wherestr); - return patrolPointFileDao.deleteByWhere(patrolpointmeasurePoint); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPointFileService#getFilesByPatrolPointId(java.lang.String) - */ - @Override - public List getFilesByPatrolPointId(String patrolPointId) { - List commonFiles = new ArrayList<>(); - List patrolPointFiles = this.selectListByWhere("where patrol_point_id ='"+patrolPointId+"'"); - for (PatrolPointFile patrolPointFile : patrolPointFiles) { - List commonFiles_ =commonFileService.selectListByTableAWhere(tablename, "where id ='"+patrolPointFile.getFileId()+"'"); - commonFiles.addAll(commonFiles_); -// CommonFile commonFile = commonFileService.selectById(patrolPointFile.getFileId(),null); -// commonFiles.add(commonFile); - } - return commonFiles; - } - - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPointMeasurePointServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPointMeasurePointServiceImpl.java deleted file mode 100644 index 10eca0b5..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPointMeasurePointServiceImpl.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.h2.util.New; -import org.springframework.stereotype.Service; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.dao.timeefficiency.PatrolPointDao; -import com.sipai.dao.timeefficiency.PatrolPointEquipmentCardDao; -import com.sipai.dao.timeefficiency.PatrolPointMeasurePointDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPoint4APP; -import com.sipai.entity.timeefficiency.PatrolPoint; -import com.sipai.entity.timeefficiency.PatrolPointEquipmentCard; -import com.sipai.entity.timeefficiency.PatrolPointMeasurePoint; -import com.sipai.entity.timeefficiency.TimeEfficiencyCommStr; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolPointMeasurePointService; -import com.sipai.tools.CommString; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolPointMeasurePointServiceImpl implements PatrolPointMeasurePointService { - - @Resource - private PatrolPointMeasurePointDao patrolpointmeasurePointDao; - @Resource - private PatrolPointEquipmentCardDao patrolPointEquipmentCardDao; - @Resource - private PatrolPointDao patrolPointDao; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - - - @Override - public PatrolPointMeasurePoint selectById(String id) { - return patrolpointmeasurePointDao.selectByPrimaryKey(id); - } - - public PatrolPointMeasurePoint selectById(String bizId, String id) { - PatrolPointMeasurePoint patrolPointMeasurePoint = patrolpointmeasurePointDao.selectByPrimaryKey(id); - MPoint mPoint = this.mPointService.selectById(bizId, patrolPointMeasurePoint.getMeasurePointId()); - patrolPointMeasurePoint.setmPoint(mPoint); - return patrolPointMeasurePoint; - } - - @Override - public int deleteById(String id) { - return patrolpointmeasurePointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolPointMeasurePoint entity) { - return this.patrolpointmeasurePointDao.insert(entity); - } - - @Override - public int update(PatrolPointMeasurePoint patrolpointmeasurePoint) { - return patrolpointmeasurePointDao.updateByPrimaryKeySelective(patrolpointmeasurePoint); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolPointMeasurePoint patrolpointmeasurePoint = new PatrolPointMeasurePoint(); - patrolpointmeasurePoint.setWhere(wherestr); - return patrolpointmeasurePointDao.selectListByWhere(patrolpointmeasurePoint); - } - - public List selectListByWhereMPoint(String unitId, String wherestr) { - PatrolPointMeasurePoint patrolpointmeasurePoint = new PatrolPointMeasurePoint(); - patrolpointmeasurePoint.setWhere(wherestr); - List patrolPointMeasurePoints = patrolpointmeasurePointDao.selectListByWhere(patrolpointmeasurePoint); - //需要通过对测量点类型进行筛选,取出手动测量点 - for (PatrolPointMeasurePoint item : patrolPointMeasurePoints) { - item.setmPoint(mPointService.selectById(unitId, item.getMeasurePointId())); - } - return patrolPointMeasurePoints; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolPointMeasurePoint patrolpointmeasurePoint = new PatrolPointMeasurePoint(); - patrolpointmeasurePoint.setWhere(wherestr); - return patrolpointmeasurePointDao.deleteByWhere(patrolpointmeasurePoint); - } - - /*** APP接口方法 通过巡检点获取其对应测量点数组 */ - public List selectMPointListByPatrolPoint(String wherestr, String bizId) { - List patrolPointMPointList = this.selectListByWhere(wherestr); - String mPointIdStr = ""; - for (int i = 0; i < patrolPointMPointList.size(); i++) { - if (i == 0) { - mPointIdStr += patrolPointMPointList.get(i).getMeasurePointId(); - } else { - mPointIdStr += "','" + patrolPointMPointList.get(i).getMeasurePointId(); - } - } - mPointIdStr = " where ID in ('" + mPointIdStr + "')"; - return this.mPointService.selectListByWhere4APP(bizId, mPointIdStr); - } - - @SuppressWarnings("unchecked") - public List selectListByWhereMPointAndEquiment(String unitId, String patrolPointId, String wherestr) { - JSONArray jsonArray = new JSONArray(); - PatrolPointMeasurePoint patrolpointmeasurePoint = new PatrolPointMeasurePoint(); - patrolpointmeasurePoint.setWhere(wherestr); - List patrolPointMeasurePoints = patrolpointmeasurePointDao.selectListByWhere(patrolpointmeasurePoint); - //需要通过对测量点类型进行筛选,取出手动测量点 - JSONObject jsonObjectPoint = new JSONObject(); - JSONArray jsonArrayPoint = new JSONArray(); - - PatrolPoint patrolPoint = patrolPointDao.selectByPrimaryKey(patrolPointId); - if (patrolPoint != null) { - for (PatrolPointMeasurePoint item : patrolPointMeasurePoints) { - MPoint mPoint = mPointService.selectById(unitId, item.getMeasurePointId()); - if (mPoint != null && MPoint.Flag_Type_Hand.equals(mPoint.getSourceType())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item.getMeasurePointId()); - //jsonObject.put("measurePointId", item.getMeasurePointId()); - //jsonObject.put("mPoint", mPointService.selectById(unitId,item.getMeasurePointId())); - jsonObject.put("name", mPoint.getParmname()); - jsonObject.put("text", mPoint.getParmname());//之前树的取名未规范,后面名称都用text - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Point); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolMeasurePoint); - jsonArrayPoint.add(jsonObject); - } - } - if (jsonArrayPoint.size() > 0) { - jsonObjectPoint.put("id", patrolPointId); - jsonObjectPoint.put("name", patrolPoint.getName()); - jsonObjectPoint.put("text", patrolPoint.getName()); - jsonObjectPoint.put("type", TimeEfficiencyCommStr.PatrolEquipment_Point); - jsonObjectPoint.put("icon", TimeEfficiencyCommStr.PatrolPoint); - jsonObjectPoint.put("data", jsonArrayPoint); - jsonObjectPoint.put("nodes", jsonArrayPoint);//之前树的取名未规范,后面子节点数组都用nodes - jsonArray.add(jsonObjectPoint); - } - } - PatrolPointEquipmentCard patrolPointEquipmentCard = new PatrolPointEquipmentCard(); - patrolPointEquipmentCard.setWhere(wherestr); - //查该巡检点下的设备 - List patrolPointEquipmentCards = patrolPointEquipmentCardDao.selectListByWhere(patrolPointEquipmentCard); - for (PatrolPointEquipmentCard item : patrolPointEquipmentCards) { - JSONObject jsonObjectEqu = new JSONObject(); - JSONArray jsonArrayEqu = new JSONArray(); - String whereStr = " where equipmentId='" + item.getEquipmentCardId() + "' and source_type='" + MPoint.Flag_Type_Hand + "'"; - List mPoints = mPointService.selectListByWhere(unitId, whereStr); - if (mPoints.size() > 0) { - for (MPoint item2 : mPoints) { - JSONObject jsonObject = new JSONObject(); - //jsonObject.put("measurePointId", item2.getMpointid()); - //jsonObject.put("mPoint", mPointService.selectById(unitId,item2.getMpointid())); - jsonObject.put("id", item2.getId()); - /*MPoint mPoint = mPointService.selectById(unitId,item2.getMpointid()); - if(mPoint!=null){ - jsonObject.put("name", mPoint.getParmname()); - }else { - jsonObject.put("name", ""); - }*/ - jsonObject.put("name", item2.getParmname()); - jsonObject.put("text", item2.getParmname());//之前树的取名未规范,后面名称都用text - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolMeasurePoint); - jsonArrayEqu.add(jsonObject); - } - EquipmentCard equipmentCard = equipmentCardService.selectById(item.getEquipmentCardId()); - if (equipmentCard != null) { - jsonObjectEqu.put("id", item.getId()); - //jsonObjectEqu.put("id", equipmentCard.getId()); - jsonObjectEqu.put("name", equipmentCard.getEquipmentname()); - jsonObjectEqu.put("text", equipmentCard.getEquipmentname()); - jsonObjectEqu.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment); - jsonObjectEqu.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObjectEqu.put("data", jsonArrayEqu); - jsonObjectEqu.put("nodes", jsonArrayEqu);//之前树的取名未规范,后面子节点数组都用nodes - jsonArray.add(jsonObjectEqu); - } - } - } - return jsonArray; - } - - /** - * 获取 巡检点 下测量点(自动点) - * - * @param - * @param - * @return - */ - public JSONArray selectList4MPoint(String unitId, String type, String patrolPointId) { - JSONArray jsonArray = new JSONArray(); - PatrolPointMeasurePoint patrolpointmeasurePoint = new PatrolPointMeasurePoint(); -// patrolpointmeasurePoint.setWhere(" where patrol_point_id='" + patrolPointId + "' order by measure_point_id,LEFT([measure_point_id],PATINDEX('%[^0-9]%',[measure_point_id])) "); - patrolpointmeasurePoint.setWhere(" where patrol_point_id='" + patrolPointId + "' order by morder asc "); - List patrolPointMeasurePoints = patrolpointmeasurePointDao.selectListByWhere(patrolpointmeasurePoint); - - //需要通过对测量点类型进行筛选,去掉手动测量点 - for (PatrolPointMeasurePoint item : patrolPointMeasurePoints) { - MPoint mPoint = mPointService.selectById(unitId, item.getMeasurePointId()); - if (mPoint != null) { - - //中文含义选择框 - String valuemeaning = mPoint.getValuemeaning() == null ? "" : mPoint.getValuemeaning(); - String[] split = valuemeaning.split(","); - if (split.length == 2) { - JSONArray jsonArray2 = new JSONArray(); - String[] mingcheng = split[0].split("/"); - String[] zhi = split[1].split("/"); - for (int j = 0; j < mingcheng.length; j++) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("mingcheng", mingcheng[j]); - jsonObject2.put("zhi", zhi[j]); - jsonArray2.add(jsonObject2); - } - mPoint.setValuemeaningArray(jsonArray2); - mPoint.setValuemeaningFlag(true); - } else { - mPoint.setValuemeaningFlag(false); - } - - if ((mPoint.getSourceType() != null && !mPoint.getSourceType().equals("hand")) || (mPoint.getSourceType() == null)) { - jsonArray.add(mPoint); - } - } - } - return jsonArray; - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolPointServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolPointServiceImpl.java deleted file mode 100644 index 2d509b95..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolPointServiceImpl.java +++ /dev/null @@ -1,333 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.work.AreaManageService; -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.timeefficiency.PatrolPointDao; -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Unit; -import com.sipai.service.timeefficiency.PatrolPointFileService; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolPointService") -public class PatrolPointServiceImpl implements PatrolPointService { - - @Resource - private PatrolPointDao patrolPointDao; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolPointFileService patrolPointFileService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private AreaManageService areaManageService; - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#selectById(java.lang.String) - */ - public PatrolPoint selectById(String id) { - PatrolPoint patrolPoint = patrolPointDao.selectByPrimaryKey(id); - if (patrolPoint != null) { - //根据工艺段unitid和code查询 - List list_processSection = processSectionService.selectListByWhere("where unit_id = '" + patrolPoint.getUnitId() + "' and code = '" + patrolPoint.getProcessSectionId() + "'"); - if (list_processSection != null && list_processSection.size() > 0) { - patrolPoint.setProcessSection(list_processSection.get(0)); - } -// patrolPoint.setProcessSection(processSectionService.selectById(patrolPoint.getProcessSectionId())); - patrolPoint.setFiles(patrolPointFileService.getFilesByPatrolPointId(id)); - } - return patrolPoint; - } - - public PatrolPoint selectByIdSafe(String id) { - PatrolPoint patrolPoint = patrolPointDao.selectByPrimaryKey(id); - if (patrolPoint != null) { - AreaManage areaManage = areaManageService.selectSimpleById(patrolPoint.getAreaId()); - if (areaManage != null) { - if (!areaManage.getPid().equals("-1")) { - //二级区域 - patrolPoint.setAreaManage2(areaManage); - - AreaManage areaManage1 = areaManageService.selectSimpleById(areaManage.getPid()); - patrolPoint.setAreaManage1(areaManage1); - } else { - //一级区域 - patrolPoint.setAreaManage1(areaManage); - } - } - } - return patrolPoint; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#deleteById(java.lang.String) - */ - public int deleteById(String id) { - return patrolPointDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#save(com.sipai.entity.timeefficiency.PatrolPoint) - */ - @Transactional - public int save(PatrolPoint entity) { - try { - int res = this.patrolPointDao.insert(entity); - if (res == 1) { - patrolPointFileService.deleteByWhere("where patrol_point_id ='" + entity.getId() + "'"); - List commonFiles = entity.getFiles(); - if (commonFiles != null && commonFiles.size() > 0) { - for (int i = 0; i < commonFiles.size(); i++) { - PatrolPointFile patrolPointFile = new PatrolPointFile(); - patrolPointFile.setId(CommUtil.getUUID()); - patrolPointFile.setInsdt(commonFiles.get(i).getInsdt()); - patrolPointFile.setInsuser(commonFiles.get(i).getInsuser()); - patrolPointFile.setPatrolPointId(entity.getId()); - patrolPointFile.setFileId(commonFiles.get(i).getId()); - int res_ = patrolPointFileService.save(patrolPointFile); - if (res_ == 0) { - throw new RuntimeException(); - } - - } - } - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#update(com.sipai.entity.timeefficiency.PatrolPoint) - */ - @Transactional - public int update(PatrolPoint patrolPoint) { - try { - int res = patrolPointDao.updateByPrimaryKeySelective(patrolPoint); - if (res == 1) { - patrolPointFileService.deleteByWhere("where patrol_point_id ='" + patrolPoint.getId() + "'"); - List commonFiles = patrolPoint.getFiles(); - if (commonFiles != null && commonFiles.size() > 0) { - for (int i = 0; i < commonFiles.size(); i++) { - PatrolPointFile patrolPointFile = new PatrolPointFile(); - patrolPointFile.setId(CommUtil.getUUID()); - patrolPointFile.setInsdt(commonFiles.get(i).getInsdt()); - patrolPointFile.setInsuser(commonFiles.get(i).getInsuser()); - patrolPointFile.setPatrolPointId(patrolPoint.getId()); - patrolPointFile.setFileId(commonFiles.get(i).getId()); - int res_ = patrolPointFileService.save(patrolPointFile); - if (res_ == 0) { - throw new RuntimeException(); - } - - } - } - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#selectListByWhere(java.lang.String) - */ - public List selectListByWhere(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - return patrolPointDao.selectListByWhere(patrolPoint); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#deleteByWhere(java.lang.String) - */ - public int deleteByWhere(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - return patrolPointDao.deleteByWhere(patrolPoint); - } - - /** - * 巡检点列表(通用) - * - * @param wherestr - * @return - */ - public List getPatrolPoints(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - List patrolPoints = patrolPointDao.getPatrolPoints(patrolPoint); - for (int i = 0; i < patrolPoints.size(); i++) { - Unit unit = this.unitService.getUnitById(patrolPoints.get(i).getUnitId()); - patrolPoints.get(i).setUnit(unit); - - //根据工艺段unitid和code查询 - List list_processSection = processSectionService.selectListByWhere("where unit_id = '" + patrolPoints.get(i).getUnitId() + "' and code = '" + patrolPoints.get(i).getProcessSectionId() + "'"); - if (list_processSection != null && list_processSection.size() > 0) { - patrolPoints.get(i).setProcessSection(list_processSection.get(0)); - } - } - return patrolPoints; - } - - /** - * 巡检点列表(安全) - * - * @param wherestr - * @return - */ - public List getPatrolPointsSafe(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - List patrolPoints = patrolPointDao.getPatrolPointsSafe(patrolPoint); - for (int i = 0; i < patrolPoints.size(); i++) { - //查询所属厂 - Unit unit = this.unitService.getUnitById(patrolPoints.get(i).getUnitId()); - patrolPoints.get(i).setUnit(unit); - - AreaManage areaManage = areaManageService.selectSimpleById(patrolPoints.get(i).getAreaId()); - if (areaManage != null) { - if (!areaManage.getPid().equals("-1")) { - //二级区域 - patrolPoints.get(i).setAreaManage2(areaManage); - - AreaManage areaManage1 = areaManageService.selectSimpleById(areaManage.getPid()); - patrolPoints.get(i).setAreaManage1(areaManage1); - } else { - //一级区域 - patrolPoints.get(i).setAreaManage1(areaManage); - } - } - } - return patrolPoints; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#selectPointListByRecord(java.lang.String) - */ - public List selectPointListByRecord(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - List patrolPointList = this.patrolPointDao.selectPointListByRecord(patrolPoint); - //获取测量点工艺段 - for (int i = 0; i < patrolPointList.size(); i++) { - ProcessSection processSection = this.processSectionService.selectById(patrolPointList.get(i).getProcessSectionId()); - patrolPointList.get(i).setProcessSection(processSection); - patrolPointList.get(i).setFiles(patrolPointFileService.getFilesByPatrolPointId(patrolPointList.get(i).getId())); - } - return patrolPointList; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolPlanService#getNewProcessSectionPatrolPoint(java.lang.String) - */ - public List getNewProcessSectionPatrolPoint(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - return patrolPointDao.getNewProcessSectionPatrolPoint(patrolPoint); - } - - /** - * 根据车间id查询所有的巡检点 - */ - public List selectListByUnitId(String wherestr) { - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr); - List list = patrolPointDao.selectListByWhere(patrolPoint); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - list.get(i).setProcessSection(processSectionService.selectById(list.get(i).getProcessSectionId())); - list.get(i).setUnit(unitService.getUnitById(list.get(i).getUnitId())); - } - } - return list; - } - - @Override - public com.alibaba.fastjson.JSONArray selectListByWhereGroup(String wherestr, String type, String search_name, String unitId) { - String equIds = "";//用于统计关联巡检点的设备id - //挂了巡检点的设备 - PatrolPoint patrolPoint = new PatrolPoint(); - patrolPoint.setWhere(wherestr + " order by p.morder,ec.equipmentCardID"); - List list = this.patrolPointDao.selectListByWhereGroup(patrolPoint); - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - - List list_result = new ArrayList<>(); - for (PatrolPoint patrolPoint1 : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPoint1.getId()); - jsonObject.put("name", patrolPoint1.getName()); - jsonObject.put("equipmentId", patrolPoint1.getEquipmentId()); - jsonObject.put("equipmentName", patrolPoint1.getEquipmentName()); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolPoint); - equIds += "'" + patrolPoint1.getEquipmentId() + "',"; - jsonArray.add(jsonObject); - } - - //没有挂巡检点的设备 - if (type != null && !type.equals("") && type.equals(PatrolType.Equipment.getId())) { - String ids = "'-1'"; - if (equIds != null && !equIds.equals("")) { - ids = equIds.substring(0, equIds.length() - 1); - } - List list3 = this.equipmentCardService.selectSimpleListByWhere(" where bizId='" + unitId + "' and id not in (" + ids + ") order by equipmentCardID"); - for (EquipmentCard equipmentCard : list3) { - JSONObject jsonObject = new JSONObject(); - /*jsonObject.put("id", equipmentCard.getId()); - jsonObject.put("name", equipmentCard.getEquipmentname()); - jsonObject.put("text", equipmentCard.getEquipmentname());//珠海专用 - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObject.put("pid", "-1");*/ - jsonObject.put("id", equipmentCard.getId()); - jsonObject.put("text", equipmentCard.getEquipmentname()); -// jsonObject.put("equipmentCardPid", equipmentCard.getEquipmentcardid()); -// jsonObject.put("equipmentCardName", equipmentCard.getEquipmentname()); - jsonObject.put("icon", TimeEfficiencyCommStr.PatrolEquipment); - jsonObject.put("pid", "-1"); - jsonObject.put("point_type", "noPoint"); - - if (search_name != null && !search_name.trim().equals("")) { - if (equipmentCard.getEquipmentname().contains(search_name)) { - jsonArray.add(jsonObject); - } else { - - } - } else { - jsonArray.add(jsonObject); - } - } - } - return jsonArray; - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolRecordDeptServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolRecordDeptServiceImpl.java deleted file mode 100644 index df0c869b..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolRecordDeptServiceImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import com.sipai.dao.timeefficiency.PatrolRecordDeptDao; -import com.sipai.entity.timeefficiency.PatrolRecordDept; -import com.sipai.entity.user.Dept; -import com.sipai.service.timeefficiency.PatrolRecordDeptService; -import com.sipai.service.user.UnitService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolRecordDeptServiceImpl implements PatrolRecordDeptService{ - @Resource - private PatrolRecordDeptDao patrolRecordDeptDao; - @Resource - private UnitService unitService; - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#selectById(java.lang.String) - */ - - public PatrolRecordDept selectById(String id) { - return patrolRecordDeptDao.selectByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#deleteById(java.lang.String) - */ - - public int deleteById(String id) { - return patrolRecordDeptDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#save(com.sipai.entity.timeefficiency.PatrolRecordDept) - */ - - public int save(PatrolRecordDept entity) { - return patrolRecordDeptDao.insert(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#update(com.sipai.entity.timeefficiency.PatrolRecordDept) - */ - - public int update(PatrolRecordDept entity) { - return patrolRecordDeptDao.updateByPrimaryKeySelective(entity); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#selectListByWhere(java.lang.String) - */ - - public List selectListByWhere(String wherestr) { - PatrolRecordDept patrolRecordDept = new PatrolRecordDept(); - patrolRecordDept.setWhere(wherestr); - List patrolRecords= patrolRecordDeptDao.selectListByWhere(patrolRecordDept); - return patrolRecords; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#deleteByWhere(java.lang.String) - */ - - public int deleteByWhere(String wherestr) { - PatrolRecordDept patrolRecordDept = new PatrolRecordDept(); - patrolRecordDept.setWhere(wherestr); - return patrolRecordDeptDao.deleteByWhere(patrolRecordDept); - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordDeptService#getDeptsByPatrolRecordId(java.lang.String) - */ - - public List getDeptsByPatrolRecordId(String patrolRecordId) { - List depts = new ArrayList<>(); - List patrolRecordDepts = this.selectListByWhere("where patrol_plan_id ='"+patrolRecordId+"'"); - for (PatrolRecordDept patrolRecordDept : patrolRecordDepts) { - Dept dept = this.unitService.getDeptById(patrolRecordDept.getDeptId()); - depts.add(dept); - } - return depts; - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolEquipmentServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolEquipmentServiceImpl.java deleted file mode 100644 index 2fdc428a..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolEquipmentServiceImpl.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.*; - -import javax.annotation.Resource; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONException; -import com.sipai.entity.timeefficiency.*; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.dao.timeefficiency.PatrolContentsRecordDao; -import com.sipai.dao.timeefficiency.PatrolMeasurePointRecordDao; -import com.sipai.dao.timeefficiency.PatrolRecordPatrolEquipmentDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.timeefficiency.PatrolContentsRecordService; -import com.sipai.service.timeefficiency.PatrolMeasurePointRecordService; -import com.sipai.service.timeefficiency.PatrolRecordPatrolEquipmentService; -import com.sipai.service.timeefficiency.PatrolRecordService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolRecordPatrolEquipmentServiceImpl implements PatrolRecordPatrolEquipmentService { - - @Resource - private PatrolRecordPatrolEquipmentDao patrolRecordPatrolEquipmentDao; - // @Reference(version=CommString.DUBBO_VERSION_EQUIPMENT,check=false) - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private PatrolContentsRecordService patrolContentsRecordService; - @Resource - private PatrolMeasurePointRecordService patrolMeasurePointRecordService; - @Resource - private PatrolContentsRecordDao patrolContentsRecordDao; - @Resource - private PatrolMeasurePointRecordDao patrolMeasurePointRecordDao; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private UserService userService; - @Resource - private PatrolRecordService patrolRecordService; - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordPatrolEquipmentService#selectById(java.lang.String) - */ - @Override - public PatrolRecordPatrolEquipment selectById(String id) { - return patrolRecordPatrolEquipmentDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordPatrolEquipmentService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolRecordPatrolEquipmentDao.deleteByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordPatrolEquipmentService#save(com.sipai.entity.timeefficiency.PatrolRecordPatrolEquipment) - */ - @Override - public int save(PatrolRecordPatrolEquipment entity) { - return this.patrolRecordPatrolEquipmentDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordPatrolEquipmentService#update(com.sipai.entity.timeefficiency.PatrolRecordPatrolEquipment) - */ - @Override - public int update(PatrolRecordPatrolEquipment patrolRecordPatrolEquipment) { - PatrolRecord patrolRecord = patrolRecordService.selectById(patrolRecordPatrolEquipment.getPatrolRecordId()); - if (patrolRecord != null && patrolRecord.getStatus().equals(PatrolRecord.Status_Issue)) { - PatrolRecord patrolRecord2 = new PatrolRecord(); - patrolRecord2.setId(patrolRecordPatrolEquipment.getPatrolRecordId()); - patrolRecord2.setStatus(PatrolRecord.Status_Start);//将任务设置为进行中 - patrolRecordService.update(patrolRecord2); - } - return patrolRecordPatrolEquipmentDao.updateByPrimaryKeySelective(patrolRecordPatrolEquipment); - } - - - @Override - public List selectListByWhere(String wherestr) { - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setWhere(wherestr); - List patrolRecordPatrolEquipments = patrolRecordPatrolEquipmentDao.selectListByWhere(patrolRecordPatrolEquipment); - List patrolContentsRecord = this.patrolContentsRecordService.selectListByWhere(wherestr); - List patrolMeasurePointRecord = this.patrolMeasurePointRecordService.selectListByWhere(wherestr); - for (PatrolRecordPatrolEquipment item : patrolRecordPatrolEquipments) { - item.setEquipmentCard(this.equipmentCardService.selectSimpleListById(item.getEquipmentId())); - //计算巡检内容统计 - int totalContents = 0; - int finishContents = 0; - for (int i = 0; i < patrolContentsRecord.size(); i++) { - if (patrolContentsRecord.get(i).getEquipmentId().equals(item.getEquipmentId())) { - totalContents++; - if (patrolContentsRecord.get(i).getStatus().equals(PatrolRecord.Status_Finish) - || patrolContentsRecord.get(i).getStatus().equals(PatrolRecord.Status_PartFinish)) { - finishContents++; - } - } - } - item.setAllNumContent(totalContents); - item.setFinishNumContent(finishContents); - - //计算填报项统计 - int totalMPoints = 0; - int finishMPoints = 0; - for (int j = 0; j < patrolMeasurePointRecord.size(); j++) { - if (patrolMeasurePointRecord.get(j).getEquipmentId().equals(item.getEquipmentId())) { - totalMPoints++; - if (patrolMeasurePointRecord.get(j).getStatus().equals(PatrolRecord.Status_Finish) - || patrolMeasurePointRecord.get(j).getStatus().equals(PatrolRecord.Status_PartFinish)) { - finishMPoints++; - } - } - } - item.setAllNumMeasurePoint(totalMPoints); - item.setFinishNumMeasurePoint(finishMPoints); - - User user = userService.getUserById(item.getUpdateuser()); - if (user != null) { - item.setUser(user); - } - } - return patrolRecordPatrolEquipments; - } - - @Override - public List selectSimpleListByWhere(String wherestr) { - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setWhere(wherestr); - List patrolRecordPatrolEquipments = patrolRecordPatrolEquipmentDao.selectListByWhere(patrolRecordPatrolEquipment); - return patrolRecordPatrolEquipments; - } - - @Override - public List selectListGroupByWhere(String wherestr, String name) { - List patrolRecordPatrolEquipments = patrolRecordPatrolEquipmentDao.selectListGroupByWhere(wherestr, name); - return patrolRecordPatrolEquipments; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordPatrolEquipmentService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setWhere(wherestr); - return patrolRecordPatrolEquipmentDao.deleteByWhere(patrolRecordPatrolEquipment); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordPatrolEquipmentService#getEquipmentCardsByPatrolRecordId(java.lang.String) - */ - @Override - public List getEquipmentCardsByPatrolRecordId(String patrolRecordId) { - List equipmentCards = new ArrayList<>(); - List patrolRecordPatrolEquipments = this.selectListByWhere("where patrol_record_id ='" + patrolRecordId + "'"); - for (PatrolRecordPatrolEquipment patrolRecordPatrolEquipment : patrolRecordPatrolEquipments) { -// EquipmentCard patrolPoint =equipmentCardService.selectById(patrolPlanPatrolEquipment.getEquipmentId()); - patrolRecordPatrolEquipment.getEquipmentCard().setPatrolStatus(patrolRecordPatrolEquipment.getStatus()); - equipmentCards.add(patrolRecordPatrolEquipment.getEquipmentCard()); - } - return equipmentCards; - } - - /** - * 获取任务中 巡检点下 关联的设备列表 设备下的自动点列表 - * - * @param wherestr - * @return - */ - @Override - public JSONArray selectListByWhere4APP(String wherestr, String unitId) { - JSONArray jsonArray = new JSONArray(); - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setWhere(wherestr); - List patrolRecordPatrolEquipments = patrolRecordPatrolEquipmentDao.selectListByWhere(patrolRecordPatrolEquipment); - for (PatrolRecordPatrolEquipment item : patrolRecordPatrolEquipments) { - EquipmentCard equipmentCard = equipmentCardService.selectById(item.getEquipmentId()); - if (equipmentCard != null) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("equipmentId", item.getEquipmentId());//设备Id - jsonObject.put("equipmentName", equipmentCard.getEquipmentname());//设备名称 - jsonObject.put("equipmentCardId", equipmentCard.getEquipmentcardid());//设备编号 - if (equipmentCard.getRatedpower() != null) { - jsonObject.put("ratedPower", equipmentCard.getRatedpower());//额定功率 - } else { - jsonObject.put("ratedPower", ""); - } - if (equipmentCard.getEquipmentmanufacturer() != null) { - jsonObject.put("equipmentManufacturer", equipmentCard.getEquipmentmanufacturer());//生产商 - } else { - jsonObject.put("equipmentManufacturer", ""); - } - jsonObject.put("status", item.getStatus()); - jsonObject.put("patrolPointId", item.getPatrolPointId()); - jsonObject.put("patrolRecordId", item.getPatrolRecordId()); - - JSONArray jsonArray2 = new JSONArray(); - String whereStr = " where equipmentId='" + item.getEquipmentId() + "' and source_type != '" + MPoint.Flag_Type_Hand + "' "; - List mPoints = mPointService.selectListByWhere(unitId, whereStr); - if (mPoints != null && mPoints.size() > 0) { - for (int i = 0; i < mPoints.size(); i++) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", mPoints.get(i).getId()); - jsonObject2.put("type", mPoints.get(i).getSourceType());//手动点还是自动点 - jsonObject2.put("signaltype", mPoints.get(i).getSignaltype());//AI还是DI - jsonObject2.put("parmName", mPoints.get(i).getParmname()); - if (mPoints.get(i).getParmvalue() != null && !mPoints.get(i).getParmvalue().equals("")) { - jsonObject2.put("parmValue", mPoints.get(i).getParmvalue()); - } else { - jsonObject2.put("parmValue", ""); - } - if (mPoints.get(i).getUnit() != null && !mPoints.get(i).getUnit().equals("")) { - jsonObject2.put("unit", mPoints.get(i).getUnit()); - } else { - jsonObject2.put("unit", ""); - } - jsonArray2.add(jsonObject2); - } - jsonObject.put("measurePoints", jsonArray2); - } - jsonArray.add(jsonObject); - } - } - //将json根据 equipmentCardId 进行排序 - String jsonArraySort = CommUtil.jsonArraySort(String.valueOf(jsonArray), "equipmentCardId"); - //字符串转 JSONArray - JSONArray jsonArray1 = JSONArray.fromObject(jsonArraySort); - return jsonArray1; - } - - /*@Override - public JSONArray selectListByWhere4APP(String wherestr,String unitId) { - JSONArray jsonArray = new JSONArray(); - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setWhere(wherestr); - List patrolRecordPatrolEquipments=patrolRecordPatrolEquipmentDao.selectListByWhere(patrolRecordPatrolEquipment); - for (PatrolRecordPatrolEquipment item : patrolRecordPatrolEquipments) { - EquipmentCard equipmentCard =equipmentCardService.selectById(item.getEquipmentId()); - //item.setEquipmentCard(equipmentCard); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("equipmentId", item.getEquipmentId()); - jsonObject.put("equipmentName", equipmentCard.getEquipmentname()); - jsonObject.put("status", item.getStatus()); - jsonObject.put("patrolPointId", item.getPatrolPointId()); - jsonObject.put("patrolRecordId", item.getPatrolRecordId()); - - - JSONArray jsonArray2 = new JSONArray(); - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setWhere("where patrol_record_id = '"+item.getPatrolRecordId()+"' and patrol_point_id = '"+item.getPatrolPointId()+"' and equipment_id = '"+item.getEquipmentId()+"'"); - List patrolContentsRecords = patrolContentsRecordDao.selectListByWhere(patrolContentsRecord); - if(patrolContentsRecords!=null && patrolContentsRecords.size()>0){ - for (int i = 0; i < patrolContentsRecords.size(); i++) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", patrolContentsRecords.get(i).getId()); - jsonObject2.put("status", patrolContentsRecords.get(i).getStatus()); - jsonObject2.put("contents",patrolContentsRecords.get(i).getContents()); - jsonObject2.put("contentsDetail",patrolContentsRecords.get(i).getContentsDetail()); - jsonArray2.add(jsonObject2); - } - jsonObject.put("patrolContents", jsonArray2); - } - - JSONArray jsonArray3 = new JSONArray(); - PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); - patrolMeasurePointRecord.setWhere("where patrol_record_id = '"+item.getPatrolRecordId()+"' and patrol_point_id = '"+item.getPatrolPointId()+"' and equipment_id = '"+item.getEquipmentId()+"'"); - List patrolMeasurePointRecords = patrolMeasurePointRecordDao.selectListByWhere(patrolMeasurePointRecord); - if(patrolMeasurePointRecords!=null && patrolMeasurePointRecords.size()>0){ - for (int i = 0; i < patrolMeasurePointRecords.size(); i++) { - MPoint mPoint = mPointService.selectById(unitId, patrolMeasurePointRecords.get(i).getMeasurePointId()); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", patrolMeasurePointRecords.get(i).getId()); - jsonObject2.put("status", patrolMeasurePointRecords.get(i).getStatus()); - jsonObject2.put("measurePointName", mPoint.getParmname()); - if(patrolMeasurePointRecords.get(i).getMpvalue()!=null && !patrolMeasurePointRecords.get(i).getMpvalue().equals("")){ - jsonObject2.put("mpvalue", patrolMeasurePointRecords.get(i).getMpvalue()); - }else { - jsonObject2.put("mpvalue", ""); - } - jsonArray3.add(jsonObject2); - } - jsonObject.put("measurePoints", jsonArray3); - } - - jsonArray.add(jsonObject); - } - return jsonArray; - }*/ - - - @Override - public List selectListByWhere2(String unitId, String wherestr) { - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setWhere(wherestr); - List patrolRecordPatrolEquipments = patrolRecordPatrolEquipmentDao.selectListByWhere(patrolRecordPatrolEquipment); -// List patrolContentsRecord = this.patrolContentsRecordService.selectListByWhere(wherestr); -// List patrolMeasurePointRecord = this.patrolMeasurePointRecordService.selectListByWhere(wherestr); - for (PatrolRecordPatrolEquipment item : patrolRecordPatrolEquipments) { - item.setEquipmentCard(this.equipmentCardService.selectSimpleListById(item.getEquipmentId())); - //设备下巡检内容 - List list = patrolContentsRecordService.selectListByWhere("where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "' and equipment_id = '" + item.getEquipmentId() + "'"); - if (list != null && list.size() > 0) { - item.setPatrolContentsRecords(list); - } - //设备下填报内容 - List list2 = patrolMeasurePointRecordService.selectListByRecord(unitId, "where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "' and equipment_id = '" + item.getEquipmentId() + "'"); - if (list2 != null && list2.size() > 0) { - item.setPatrolMeasurePointRecords(list2); - } - } - return patrolRecordPatrolEquipments; - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolPointServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolPointServiceImpl.java deleted file mode 100644 index a2ae585e..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolPointServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.sipai.service.timeefficiency.impl; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolRecordPatrolPointDao; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolPoint; -import com.sipai.service.timeefficiency.PatrolPointService; -import com.sipai.service.timeefficiency.PatrolRecordPatrolPointService; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class PatrolRecordPatrolPointServiceImpl implements PatrolRecordPatrolPointService{ - - @Resource - private PatrolRecordPatrolPointDao patrolRecordPatrolPointDao; - @Resource - private PatrolPointService patrolPointService; - - @Override - public PatrolRecordPatrolPoint selectById(String id) { - return patrolRecordPatrolPointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return patrolRecordPatrolPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolRecordPatrolPoint entity) { - return this.patrolRecordPatrolPointDao.insert(entity); - } - - @Override - public int update(PatrolRecordPatrolPoint patrolRecordPatrolPoint) { - return patrolRecordPatrolPointDao.updateByPrimaryKeySelective(patrolRecordPatrolPoint); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolRecordPatrolPoint patrolRecordPatrolPoint = new PatrolRecordPatrolPoint(); - patrolRecordPatrolPoint.setWhere(wherestr); - List patrolPlanPatrolPoints=patrolRecordPatrolPointDao.selectListByWhere(patrolRecordPatrolPoint); - for (PatrolRecordPatrolPoint item : patrolPlanPatrolPoints) { - item.setPatrolPoint(patrolPointService.selectById(item.getPatrolPointId())); - } - return patrolPlanPatrolPoints; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolRecordPatrolPoint patrolRecordPatrolPoint = new PatrolRecordPatrolPoint(); - patrolRecordPatrolPoint.setWhere(wherestr); - return patrolRecordPatrolPointDao.deleteByWhere(patrolRecordPatrolPoint); - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolRouteServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolRouteServiceImpl.java deleted file mode 100644 index 8727a7ab..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolRecordPatrolRouteServiceImpl.java +++ /dev/null @@ -1,342 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.user.User; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.timeefficiency.*; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.timeefficiency.PatrolRecordPatrolRouteDao; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.user.UserService; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolRecordPatrolRouteService") -public class PatrolRecordPatrolRouteServiceImpl implements PatrolRecordPatrolRouteService { - - @Resource - private PatrolRecordPatrolRouteDao patrolRecordPatrolRouteDao; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolMeasurePointRecordService patrolMeasurePointRecordService; - @Resource - private PatrolContentsRecordService patrolContentsRecordService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UserService userService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private AbnormityService abnormityService; - @Resource - private PatrolRecordPatrolEquipmentService patrolRecordPatrolEquipmentService; - @Resource - CommonFileService commonFileService; - - @Override - public PatrolRecordPatrolRoute selectById(String id) { - return patrolRecordPatrolRouteDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return patrolRecordPatrolRouteDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PatrolRecordPatrolRoute entity) { - return this.patrolRecordPatrolRouteDao.insert(entity); - } - - @Transactional - public int update(PatrolRecordPatrolRoute patrolRecordPatrolRoute) { - PatrolRecord patrolRecord = patrolRecordService.selectById(patrolRecordPatrolRoute.getPatrolRecordId()); - if (patrolRecord != null && patrolRecord.getStatus().equals(PatrolRecord.Status_Issue)) { - PatrolRecord patrolRecord2 = new PatrolRecord(); - patrolRecord2.setId(patrolRecordPatrolRoute.getPatrolRecordId()); - patrolRecord2.setStatus(PatrolRecord.Status_Start);//将任务设置为进行中 - patrolRecord2.setDuration(patrolRecord.getDuration()); - patrolRecordService.update(patrolRecord2); - } - return patrolRecordPatrolRouteDao.updateByPrimaryKeySelective(patrolRecordPatrolRoute); - } - - @Override - public List selectListByWhere(String wherestr) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - List patrolRecordPatrolRoutes = patrolRecordPatrolRouteDao.selectListByWhere(patrolRecordPatrolRoute); - //根据链表结构进行排序 - //patrolRecordPatrolRoutes = sortRecord(patrolRecordPatrolRoutes); - for (PatrolRecordPatrolRoute item : patrolRecordPatrolRoutes) { - item.setPatrolPoint(patrolPointService.selectById(item.getPatrolPointId())); - item.setWorker(userService.getUserById(item.getWorkerId())); - - List list = abnormityService.selectSimpleListByWhere("where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "'"); - if (list != null && list.size() > 0) { - item.setAbnormityNum(list.size()); - } - List list_e = patrolRecordPatrolEquipmentService.selectSimpleListByWhere("where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "'"); - if (list_e != null && list_e.size() > 0) { - item.setEquipmentNum(list_e.size()); - } - List list_file_pic = this.commonFileService.selectListByTableAWhere("TB_TimeEfficiency_PatrolRecord_file", "where masterid='" + item.getId() + "' and type like '%image%'"); - if(list_file_pic!=null && list_file_pic.size()>0){ - item.setFileNumPic(list_file_pic.size()); - } - List list_file_video = this.commonFileService.selectListByTableAWhere("TB_TimeEfficiency_PatrolRecord_file", "where masterid='" + item.getId() + "' and type like '%video%'"); - if(list_file_video!=null && list_file_video.size()>0){ - item.setFileNumVideo(list_file_video.size()); - } - } - return patrolRecordPatrolRoutes; - } - - @Override - public List selectListByWhereSafe(String wherestr) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - List patrolRecordPatrolRoutes = patrolRecordPatrolRouteDao.selectListByWhere(patrolRecordPatrolRoute); - //根据链表结构进行排序 - //patrolRecordPatrolRoutes = sortRecord(patrolRecordPatrolRoutes); - for (PatrolRecordPatrolRoute item : patrolRecordPatrolRoutes) { - item.setPatrolPoint(patrolPointService.selectByIdSafe(item.getPatrolPointId())); - item.setWorker(userService.getUserById(item.getWorkerId())); - - List list = abnormityService.selectSimpleListByWhere("where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "'"); - if (list != null && list.size() > 0) { - item.setAbnormityNum(list.size()); - } - List list_e = patrolRecordPatrolEquipmentService.selectSimpleListByWhere("where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "'"); - if (list_e != null && list_e.size() > 0) { - item.setEquipmentNum(list_e.size()); - } - List list_file_pic = this.commonFileService.selectListByTableAWhere("TB_TimeEfficiency_PatrolRecord_file", "where masterid='" + item.getId() + "' and type like '%image%'"); - if(list_file_pic!=null && list_file_pic.size()>0){ - item.setFileNumPic(list_file_pic.size()); - } - List list_file_video = this.commonFileService.selectListByTableAWhere("TB_TimeEfficiency_PatrolRecord_file", "where masterid='" + item.getId() + "' and type like '%video%'"); - if(list_file_video!=null && list_file_video.size()>0){ - item.setFileNumVideo(list_file_video.size()); - } - } - return patrolRecordPatrolRoutes; - } - - @Override - public List selectSimpleListByWhere(String wherestr) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - List patrolRecordPatrolRoutes = patrolRecordPatrolRouteDao.selectListByWhere(patrolRecordPatrolRoute); - return patrolRecordPatrolRoutes; - } - - @Override - public List selectListGroupByWhere(String wherestr, String name) { - List patrolRecordPatrolRoutes = patrolRecordPatrolRouteDao.selectListGroupByWhere(wherestr, name); - return patrolRecordPatrolRoutes; - } - - @Override - public int deleteByWhere(String wherestr) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - return patrolRecordPatrolRouteDao.deleteByWhere(patrolRecordPatrolRoute); - } - - public int updateByWhere(PatrolRecordPatrolRoute patrolRecordPatrolRoute) { - return patrolRecordPatrolRouteDao.updateByWhere(patrolRecordPatrolRoute); - } - - @Override - public int updateNum(PatrolRecordPatrolRoute patrolRoute) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = patrolRecordPatrolRouteDao.selectByPrimaryKey(patrolRoute.getId()); - String wherestr = ""; - if (patrolRecordPatrolRoute != null) { - wherestr = " where 1=1 and status='" + PatrolRecord.Status_Finish + "' and patrol_record_id='" + patrolRecordPatrolRoute.getPatrolRecordId() + "' and patrol_point_id='" + patrolRecordPatrolRoute.getPatrolPointId() + "' "; - List list1 = patrolContentsRecordService.selectListByWhere(wherestr); - List list2 = patrolMeasurePointRecordService.selectListByWhere(wherestr); - - patrolRecordPatrolRoute.setFinishNumContent(list1.size()); - patrolRecordPatrolRoute.setFinishNumMeasurePoint(list2.size()); - int res = patrolRecordPatrolRouteDao.updateByPrimaryKeySelective(patrolRecordPatrolRoute); - } - return 0; - } - - /* - * 根据链表结构进行排序 - * @see com.sipai.service.timeefficiency.PatrolRecordPatrolRouteService#sortRecord(java.util.List) - */ - @Override - public List sortRecord(List source) { - List dest = new ArrayList<>(); - List last = new ArrayList<>(); - //寻找所有尾结点,并存储 - Iterator iterator = source.iterator(); - while (iterator.hasNext()) { - PatrolRecordPatrolRoute item_src = (PatrolRecordPatrolRoute) iterator.next(); - if (item_src.getPreviousId() == null || item_src.getPreviousId().isEmpty()) { - last.add(item_src); - iterator.remove(); - } - } - //按尾节点 巡检链表上的其它节点 - for (PatrolRecordPatrolRoute item_last : last) { - iterator = source.iterator(); - List parent = new ArrayList<>(); - parent.add(item_last); - while (iterator.hasNext()) { - PatrolRecordPatrolRoute item_src = (PatrolRecordPatrolRoute) iterator.next(); - //若查询到父节点则在存储后,重新查 - if (parent.get(parent.size() - 1).getPatrolRouteId().equals(item_src.getPreviousId())) { - parent.add(item_src); - iterator.remove(); - iterator = source.iterator(); - } - } - dest.addAll(parent); - } - //存储其它异常的节点 - dest.addAll(source); - return dest; - } - - @Override - public PatrolRecordPatrolRoute selectByWhere(String wherestr) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - return patrolRecordPatrolRouteDao.selectByWhere(patrolRecordPatrolRoute); - } - - /** - * 获取巡检记录下的巡检点 暂时不用 - */ - /*public List selectPointListByWhere(String wherestr) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - List patrolPlanPatrolRoutes=patrolRecordPatrolRouteDao.selectListByWhere(patrolRecordPatrolRoute); - - String patrolPointstr = ""; - for (PatrolRecordPatrolRoute item : patrolPlanPatrolRoutes) { - if(patrolPointstr == ""){ - patrolPointstr += item.getPatrolPointId(); - }else{ - patrolPointstr += "','" + item.getPatrolPointId(); - } - } - List patrolPointList = this.patrolPointService.selectListByWhere(" where id in ('"+patrolPointstr+"')"); - - return patrolPointList; - }*/ - @Override - public int updateByRecord(String patrolRecordId) { - String recordIds = ""; - PatrolRecordPatrolRoute patrolRoute1 = new PatrolRecordPatrolRoute(); - patrolRoute1.setWhere(" where patrol_record_id='" + patrolRecordId + "' "); - List list1 = patrolRecordPatrolRouteDao.selectListByWhere(patrolRoute1); - for (PatrolRecordPatrolRoute entity : list1) { - recordIds += entity.getId() + ","; - } - if (recordIds != null && !recordIds.equals("")) { - recordIds = recordIds.substring(0, recordIds.length() - 1); - } - String ids = recordIds; - - int res = 0; - HashSet str = new HashSet<>(); - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - if (id != null) { - for (int i = 0; i < id.length; i++) { - PatrolRecordPatrolRoute patrolRoute = patrolRecordPatrolRouteDao.selectByPrimaryKey(id[i]); - if (patrolRoute != null) { - str.add(patrolRoute.getFloorId()); - } - } - - Iterator iterator = str.iterator(); - while (iterator.hasNext()) { - //最后进行线的连接 - PatrolRecordPatrolRoute patrolRoute2 = new PatrolRecordPatrolRoute(); - patrolRoute2.setWhere(" where patrol_record_id='" + patrolRecordId + "' and floor_id = '" + iterator.next() + "' order by finishdt asc "); - List list2 = patrolRecordPatrolRouteDao.selectListByWhere(patrolRoute2); - if (list2 != null && list2.size() > 1) { - for (int i = 0; i < list2.size(); i++) { - - PatrolRecordPatrolRoute patrolRoute = patrolRecordPatrolRouteDao.selectByPrimaryKey(list2.get(i).getId()); - patrolRoute.setId(list2.get(i).getId()); - patrolRoute.setMorder(i); - //第一个点 - if (i == 0) { - patrolRoute.setPreviousIdActual(""); - patrolRoute.setNextIdActual(list2.get(i + 1).getId()); - } - //最后一个点 - else if (i == list2.size() - 1) { - patrolRoute.setPreviousIdActual(list2.get(i - 1).getId()); - patrolRoute.setNextIdActual(""); - } - //中间点位 - else { - patrolRoute.setPreviousIdActual(list2.get(i - 1).getId()); - patrolRoute.setNextIdActual(list2.get(i + 1).getId()); - } - int prouteres = patrolRecordPatrolRouteDao.updateByPrimaryKeySelective(patrolRoute); - res = res + prouteres; - } - } - } - } - } - return res; - } - - - @Override - public List selectListByWhere2(String wherestr, String unitId) { - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(wherestr); - List patrolRecordPatrolRoutes = patrolRecordPatrolRouteDao.selectListByWhere(patrolRecordPatrolRoute); - //根据链表结构进行排序 - for (PatrolRecordPatrolRoute item : patrolRecordPatrolRoutes) { - item.setPatrolPoint(patrolPointService.selectById(item.getPatrolPointId())); - item.setWorker(userService.getUserById(item.getWorkerId())); - User user = userService.getUserById(item.getWorkerId()); - if (user != null) { - item.setWorkerName(user.getName());//仅用于app查看 - } else { - item.setWorkerName("");//仅用于app查看 - } - - //查询巡检点下的巡检内容 - List list = patrolContentsRecordService.selectListByWhere("where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "' and equipment_id is null"); - if (list != null && list.size() > 0) { - item.setPatrolContentsRecords(list); - } - //查询巡检点下的填报内容 - List list2 = patrolMeasurePointRecordService.selectListByRecord(unitId, "where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "' and equipment_id is null"); - if (list2 != null && list2.size() > 0) { - item.setPatrolMeasurePointRecords(list2); - } - //查询巡检点下配的设备 - List list3 = patrolRecordPatrolEquipmentService.selectListByWhere2(unitId, "where patrol_record_id = '" + item.getPatrolRecordId() + "' and patrol_point_id = '" + item.getPatrolPointId() + "'"); - if (list3 != null && list3.size() > 0) { - item.setPatrolRecordPatrolEquipments(list3); - } - - } - return patrolRecordPatrolRoutes; - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolRecordServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolRecordServiceImpl.java deleted file mode 100644 index 06c88c93..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolRecordServiceImpl.java +++ /dev/null @@ -1,3334 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.report.RptCreate; -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.user.Dept; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.work.GroupType; -import com.sipai.entity.work.Scheduling; -import com.sipai.entity.workorder.WorkorderAchievement; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.timeefficiency.*; -import com.sipai.service.work.*; -import com.sipai.service.workorder.WorkorderAchievementService; -import com.sipai.service.workorder.WorkorderDetailService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.ss.usermodel.*; -import org.springframework.security.access.method.P; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.timeefficiency.PatrolRecordDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.msg.MsgService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DateUtil; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolRecordService") -public class PatrolRecordServiceImpl implements PatrolRecordService { - @Resource - private PatrolRecordDao patrolRecordDao; - @Resource - private PatrolPlanService patrolPlanService; - @Resource - private PatrolModelService patrolModelService; - @Resource - private PatrolPlanPatrolEquipmentService patrolPlanPatrolEquipmentService; - @Resource - private PatrolPlanPatrolCameraService patrolPlanPatrolCameraService; - @Resource - private PatrolRouteService patrolRouteService; - @Resource - private PatrolRecordPatrolRouteService patrolRecordPatrolRouteService; - @Resource - private PatrolContentsPlanService patrolContentsPlanService; - @Resource - private PatrolContentsRecordService patrolContentsRecordService; - @Resource - private PatrolMeasurePointPlanService patrolMeasurePointPlanService; - @Resource - private PatrolMeasurePointRecordService patrolMeasurePointRecordService; - @Resource - private PatrolRecordPatrolEquipmentService patrolRecordPatrolEquipmentService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UnitService unitService; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UserService userService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolAreaService patrolAreaService; - @Resource - private PatrolAreaFloorService patrolAreaFloorService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private GroupManageService groupManageService; - @Resource - private PatrolPointEquipmentCardService patrolPointEquipmentCardService; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolPointMeasurePointService patrolPointMeasurePointService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointHistoryService mPointHistoryService; - // @Reference(version=CommString.DUBBO_VERSION_OPERATION,check=false) - @Resource - private MPointService mPointService; - @Resource - private PatrolRecordPatrolCameraService patrolRecordPatrolCameraService; - @Resource - private WorkerPositionService workerPositionService; - @Resource - private WorkorderAchievementService workorderAchievementService; - @Resource - private GroupTimeService groupTimeService; - @Resource - private SchedulingService schedulingService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private PatrolPlanDeptService patrolPlanDeptService; - @Resource - private PatrolRecordDeptService patrolRecordDeptService; - @Resource - private PatrolAreaUserService patrolAreaUserService; - @Resource - private PatrolPointCameraService patrolPointCameraService; - @Resource - private AbnormityService abnormityService; - @Resource - private WorkorderDetailService workorderDetailService; - @Resource - private MaintenanceDetailService maintenanceDetailServicel; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private PatrolPlanTypeService patrolPlanTypeService; - @Resource - private GroupTypeService groupTypeService; - - public PatrolRecord selectById(String id) { - PatrolRecord patrolRecord = patrolRecordDao.selectByPrimaryKey(id); - if (patrolRecord != null) { - Unit unit = unitService.getUnitById(patrolRecord.getUnitId()); - patrolRecord.setUnit(unit); - User user = userService.getUserById(patrolRecord.getWorkerId()); - patrolRecord.setWorker(user); - User user2 = userService.getUserById(patrolRecord.getInsuser()); - patrolRecord.setSendUser(user2); - fixColor(patrolRecord); - //任务类型 - PatrolPlanType patrolPlanType = patrolPlanTypeService.selectById(patrolRecord.getTaskType()); - patrolRecord.setPatrolPlanType(patrolPlanType); - } - return patrolRecord; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordService#deleteById(java.lang.String) - */ - - public int deleteById(String id) { - PatrolRecord patrolRecord = patrolRecordDao.selectByPrimaryKey(id); - int result = 0; - if (PatrolRecord.Status_Issue.equals(patrolRecord.getStatus())) { - result = patrolRecordDao.deleteByPrimaryKey(id); - if (result == 1) { - if (TimeEfficiencyCommStr.PatrolType_Product.equals(patrolRecord.getType())) { - //巡检记录巡检路线 - patrolRecordPatrolRouteService.deleteByWhere(" where patrol_record_id='" + id + "'"); - //巡检记录巡检设备 - patrolRecordPatrolEquipmentService.deleteByWhere(" where patrol_record_id='" + id + "'"); - //巡检记录巡检内容 - patrolContentsRecordService.deleteByWhere(" where patrol_record_id='" + id + "'"); - //巡检记录填报因素 - patrolMeasurePointRecordService.deleteByWhere(" where patrol_record_id='" + id + "'"); - } else if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(patrolRecord.getType())) { - //巡检记录巡检路线 - patrolRecordPatrolRouteService.deleteByWhere(" where patrol_record_id='" + id + "'"); - //巡检记录巡检设备 - patrolRecordPatrolEquipmentService.deleteByWhere(" where patrol_record_id='" + id + "'"); - //巡检记录巡检内容 - patrolContentsRecordService.deleteByWhere(" where patrol_record_id='" + id + "'"); - //巡检记录填报因素 - patrolMeasurePointRecordService.deleteByWhere(" where patrol_record_id='" + id + "'"); - } - } - } - return result; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordService#save(com.sipai.entity.timeefficiency.PatrolRecord) - */ - - public int save(PatrolRecord entity) { - return patrolRecordDao.insert(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordService#update(com.sipai.entity.timeefficiency.PatrolRecord) - */ - - public int update(PatrolRecord entity) { - return patrolRecordDao.updateByPrimaryKeySelective(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordService#selectListByWhere(java.lang.String) - */ - - public List selectListByWhere(String wherestr) { - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - for (PatrolRecord item : patrolRecords) { - PatrolModel patrolModel = patrolModelService.selectById(item.getPatrolModelId()); - item.setPatrolModel(patrolModel); - fixColor(item); - User user = userService.getUserById(item.getWorkerId()); - item.setWorker(user); - } - return patrolRecords; - } - - public List selectListByWhere4Safe(String wherestr) { - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - for (PatrolRecord item : patrolRecords) { - User user = userService.getUserById(item.getWorkerId()); - item.setWorker(user); - - // status = '4' 为不合格 / status = '3' 为不合格 - List list2 = patrolRecordPatrolRouteService.selectSimpleListByWhere(" where patrol_record_id = '" + item.getId() + "' and status = '4'"); - if (list2 != null && list2.size() > 0) { - item.set_resultName("不合格"); - break; - } else { - List list3 = patrolRecordPatrolRouteService.selectSimpleListByWhere(" where patrol_record_id = '" + item.getId() + "'"); - if (list3 != null && list3.size() > 0) { - for (int i = 0; i < list3.size(); i++) { - if (list3.get(i).getStatus() != null && !list3.get(i).getStatus().equals("3")) { - item.set_resultName("进行中"); - break; - } else { - item.set_resultName("合格"); - } - } - } - } - } - return patrolRecords; - } - - public List selectListAndASumByWhere(String wherestr, String date) { - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - for (PatrolRecord item : patrolRecords) { - PatrolModel patrolModel = patrolModelService.selectById(item.getPatrolModelId()); - List abnormities = abnormityService.selectSimpleListByWhere("where patrol_record_id = '" + item.getId() + "' "); - item.setaSum(abnormities.size() == 0 ? "-" : String.valueOf(abnormities.size())); - item.setPatrolModel(patrolModel); - fixColor(item); - User user = userService.getUserById(item.getWorkerId()); - item.setWorker(user); - } - return patrolRecords; - } - - public List selectSimpleListByWhere(String wherestr) { - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - return patrolRecords; - } - - public List selectTopByWhere(String wherestr, String topNum) { - List patrolRecords = patrolRecordDao.selectTopByWhere(wherestr, topNum); - return patrolRecords; - } - - public List selectDistinctWorkTimeByWhere(String wherestr) { - List patrolRecords = patrolRecordDao.selectDistinctWorkTimeByWhere(wherestr); - return patrolRecords; - } - - public List selectForAchievementWork(String wherestr) { - List patrolRecords = patrolRecordDao.selectForAchievementWork(wherestr); - return patrolRecords; - } - - public JSONArray selectListByWhereForCalendar(String wherestr) { - DecimalFormat df = new DecimalFormat("######0.00"); - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectDateDistinct(patrolRecord); - JSONArray jsonArray = new JSONArray(); - if (patrolRecords != null && patrolRecords.size() > 0) { - for (int i = 0; i < patrolRecords.size(); i++) { - if (patrolRecords.get(i) != null) { - JSONObject jsonObject = new JSONObject(); - int plannum = 0;//当天巡检总数 - int finishnum = 0;//当天完成总数 - float doRate = 0;//巡检完成率 - int routineNum = 0;//常规任务数 - int tempNum = 0;//临时任务数 - int faultNum_r = 0;//异常数-运行 - int faultNum_e = 0;//异常数-设备 - int faultNum = 0;//异常数-总的 - - //计划数查询 - String strplan = " and convert(varchar(10),start_time,120)='" + patrolRecords.get(i).getStartTime() + "' "; - patrolRecord.setWhere(wherestr + strplan); - List patrolRecordsstplan = patrolRecordDao.selectListByWhere(patrolRecord); - if (patrolRecordsstplan != null && patrolRecordsstplan.size() > 0) { - plannum = patrolRecordsstplan.size(); - } else { - plannum = 0; - } - //完成数查询 - String strfinsh = " and convert(varchar(10),start_time,120)='" + patrolRecords.get(i).getStartTime() + "' and (status='3'or status='4') "; - patrolRecord.setWhere(wherestr + strfinsh); - List patrolRecordsfinsh = patrolRecordDao.selectListByWhere(patrolRecord); - if (patrolRecordsfinsh != null && patrolRecordsfinsh.size() > 0) { - finishnum = patrolRecordsfinsh.size(); - } else { - finishnum = 0; - } - //完成率 - doRate = ((float) finishnum / (float) plannum) * 100; - doRate = Math.round(doRate); - - //常规巡检数查询 - String strroutine = " and convert(varchar(10),start_time,120)='" + patrolRecords.get(i).getStartTime() + "' and patrol_model_id!='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' "; - patrolRecord.setWhere(wherestr + strroutine); - List patrolRecordsstrroutine = patrolRecordDao.selectListByWhere(patrolRecord); - if (patrolRecordsstrroutine != null && patrolRecordsstrroutine.size() > 0) { - routineNum = patrolRecordsstrroutine.size(); - } else { - routineNum = 0; - } - //临时巡检数查询 - tempNum = plannum - routineNum; - - //运行异常 - /*String sql_abnormity_r = " where convert(varchar(10),insdt,120)='" + patrolRecords.get(i).getStartTime() + "' and type = '" + Abnormity.Type_Run + "' and patrol_record_id='" + patrolRecords.get(i).getId() + "' ''"; - List abnormityList_r = abnormityService.selectListByWhere(sql_abnormity_r); - if (abnormityList_r != null && abnormityList_r.size() > 0) { - faultNum_r = abnormityList_r.size(); - } else { - faultNum_r = 0; - }*/ - //设备异常 - /*String sql_abnormity_e = " where convert(varchar(10),insdt,120)='" + patrolRecords.get(i).getStartTime() + "' and type = '" + Abnormity.Type_Equipment + "' and patrol_record_id='" + patrolRecords.get(i).getId() + "' ''"; - List abnormityList_e = abnormityService.selectListByWhere(sql_abnormity_e); - if (abnormityList_e != null && abnormityList_e.size() > 0) { - faultNum_e = abnormityList_e.size(); - } else { - faultNum_e = 0; - }*/ - - //获取当天所有的巡检任务id - String ids = "'-',"; - for (PatrolRecord patrolRecord1 : patrolRecordsstplan) { - ids += "'" + patrolRecord1.getId() + "',"; - } - ids = ids.substring(0, ids.length() - 1); - - //查找这些巡检的异常数总和 - String sql_abnormity = " where patrol_record_id in (" + ids + ")"; - List abnormityList = abnormityService.selectSimpleListByWhere(sql_abnormity); - if (abnormityList != null && abnormityList.size() > 0) { - faultNum = abnormityList.size(); - } else { - faultNum = 0; - } - - jsonObject.put("startTime", patrolRecords.get(i).getStartTime()); - //任务完成率 - jsonObject.put("doRate", doRate); - //常规巡检数量 - jsonObject.put("routineNum", routineNum); - //临时巡检数 - jsonObject.put("tempNum", tempNum); - //上报异常数 -// jsonObject.put("faultNum_r", faultNum_r); - //上报异常数 -// jsonObject.put("faultNum_e", faultNum_e); - jsonObject.put("faultNum", faultNum); - - jsonArray.add(jsonObject); - } - } - } - return jsonArray; - } - - public int deleteByWhere(String wherestr) { - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - int result = 0; - for (PatrolRecord item : patrolRecords) { - int res = patrolRecordDao.deleteByPrimaryKey(item.getId()); - if (res == 1) { - //巡检记录巡检路线 - patrolRecordPatrolRouteService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录巡检设备 - patrolRecordPatrolEquipmentService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录巡检内容 - patrolContentsRecordService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录填报因素 - patrolMeasurePointRecordService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - } - result += res; - } - return result; - } - - public int cancelByWhere(String wherestr) { - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - int result = 0; - for (PatrolRecord item : patrolRecords) { - if (PatrolRecord.Status_Issue.equals(item.getStatus())) { - int res = patrolRecordDao.deleteByPrimaryKey(item.getId()); - if (res == 1) { - if (TimeEfficiencyCommStr.PatrolType_Product.equals(item.getType())) { - //巡检记录巡检路线 - patrolRecordPatrolRouteService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录巡检设备 - patrolRecordPatrolEquipmentService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录巡检内容 - patrolContentsRecordService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录填报因素 - patrolMeasurePointRecordService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - } else if (TimeEfficiencyCommStr.PatrolType_Equipment.equals(item.getType())) { - //巡检记录巡检路线 - patrolRecordPatrolRouteService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录巡检设备 - patrolRecordPatrolEquipmentService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录巡检内容 - patrolContentsRecordService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - //巡检记录填报因素 - patrolMeasurePointRecordService.deleteByWhere(" where patrol_record_id='" + item.getId() + "'"); - } - } - result += res; - } - } - return result; - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordService#createPatrolRecord(java.lang.String, java.lang.String, java.lang.String) - */ - - @Transactional - public int createPatrolRecord(String date, String patrolPlanId, String userId) { - int result = 0; - int res = 0; - try { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //时间格式化GroupTimeService - date = date.substring(0, 10); - String[] dayTime = groupTimeService.getStartAndEndTime(date); - - //若当天同一计划已下发,则不再重复下发 - /*List records = this.selectListByWhere("where start_time >= '" + dayTime[0] + "' and end_time <='" + dayTime[1] + "' and patrol_plan_id='" + patrolPlanId + "'"); - if (records != null && records.size() > 0) { - return result; - }*/ - - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - //巡检计划未启用则不下发 - if (!patrolPlan.getActive()) { - return result; - } - PatrolRecord patrolRecord = new PatrolRecord(); -// String id = CommUtil.getUUID(); - patrolRecord.setBizId(patrolPlan.getBizId()); - patrolRecord.setUnitId(patrolPlan.getUnitId()); - patrolRecord.setInsuser(userId); - patrolRecord.setPatrolAreaId(patrolPlan.getPatrolAreaId()); - patrolRecord.setName(patrolPlan.getName()); - patrolRecord.setContent(patrolPlan.getPatrolContent()); - patrolRecord.setPatrolPlanId(patrolPlan.getId()); - patrolRecord.setType(patrolPlan.getType()); - patrolRecord.setPatrolModelId(patrolPlan.getPatrolModelId()); - patrolRecord.setStatus(PatrolRecord.Status_Issue); - patrolRecord.setDuration(patrolPlan.getDuration()); - patrolRecord.setGroupTypeId(patrolPlan.getGroupTypeId()); - - String sdt = ""; - String edt = ""; - sdt = date + " " + patrolPlan.getSdt().substring(11, 16) + ":00"; - edt = date + " " + patrolPlan.getEdt().substring(11, 16) + ":00"; - Calendar startCalendar = Calendar.getInstance(); - Calendar lastEndCalendar = Calendar.getInstance(); - try { - startCalendar.setTime(sdf.parse(sdt)); - lastEndCalendar.setTime(sdf.parse(edt)); - //若开始时间大于结束时间,则说明跨天,结束时间加一天 - if (startCalendar.getTimeInMillis() >= lastEndCalendar.getTimeInMillis()) { - lastEndCalendar.add(Calendar.DATE, 1); - } - while (startCalendar.getTimeInMillis() < lastEndCalendar.getTimeInMillis()) { - String startTime = sdf.format(startCalendar.getTime()); - //记录的结束时间 - Calendar endCalendar = Calendar.getInstance(); - endCalendar.setTime(startCalendar.getTime()); - endCalendar.add(Calendar.MINUTE, patrolPlan.getDuration()); - String endTime = sdf.format(endCalendar.getTime()); - - String id = CommUtil.getUUID(); - - //保存任务班组 - if (patrolPlan != null) { - List list_plan_dept = patrolPlanDeptService.selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "'"); - for (PatrolPlanDept patrolPlanDept : list_plan_dept) { - PatrolRecordDept patrolRecordDept = new PatrolRecordDept(); - patrolRecordDept.setId(CommUtil.getUUID()); - patrolRecordDept.setInsdt(CommUtil.nowDate()); - patrolRecordDept.setPatrolRecordId(id); - patrolRecordDept.setDeptId(patrolPlanDept.getDeptId()); - patrolRecordDept.setInsuser(patrolPlanDept.getInsuser()); - patrolRecordDeptService.save(patrolRecordDept); - } - } - - patrolRecord.setStartTime(startTime); - patrolRecord.setEndTime(endTime); - patrolRecord.setId(id); - patrolRecord.setInsdt(CommUtil.nowDate()); - - //判断是否一存在相同的任务 - PatrolRecord patrolRecord1 = new PatrolRecord(); - patrolRecord1.setWhere(" where unit_id = '" + patrolPlan.getUnitId() + "' and type = '" + patrolPlan.getType() + "' " + - "and start_time = '" + startTime + "' and end_time = '" + endTime + "' and patrol_plan_id = '" + patrolPlan.getId() + "' "); - List list_record = patrolRecordDao.selectListByWhere(patrolRecord1); - if (list_record != null && list_record.size() > 0) { - result = 9; - } else { - result = this.save(patrolRecord); - } - - switch (patrolPlan.getType()) { - //设备巡检 - case TimeEfficiencyCommStr.PatrolType_Equipment: - /*---------------------------- 设备下发 内容 填报项 1.赋值type(equipment) 2.赋值equipmentId ------------------------------*/ - // 1°获取设备巡检计划下直接配置的设备 - List patrolPlanPatrolEquipments = this.patrolPlanPatrolEquipmentService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"); - //将设备id塞入set中 去重 - Set set = new HashSet(); - for (PatrolPlanPatrolEquipment patrolPlanPatrolEquipment : patrolPlanPatrolEquipments) { -// if (patrolPlanPatrolEquipment.getEquipmentCard() != null && -// patrolPlanPatrolEquipment.getEquipmentCard().getEquipmentstatus().equals(EquipmentCard.Status_ON)) { - //判断这个设备对象是否为空 且 状态为启动的设备才进行下发 - if (set.add(patrolPlanPatrolEquipment.getEquipmentId())) { - //生成 - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setId(CommUtil.getUUID()); - patrolRecordPatrolEquipment.setInsuser(userId); - patrolRecordPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolEquipment.setEquipmentId(patrolPlanPatrolEquipment.getEquipmentId()); - patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Issue); - patrolRecordPatrolEquipment.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - patrolRecordPatrolEquipment.setMorder(patrolPlanPatrolEquipment.getMorder()); - this.patrolRecordPatrolEquipmentService.save(patrolRecordPatrolEquipment); - } -// } - } - - // 2°获取设备巡检计划下直接配置的设备 的 巡检内容 - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setInsuser(userId); - patrolContentsRecord.setInsdt(CommUtil.nowDate()); - patrolContentsRecord.setPatrolRecordId(patrolRecord.getId()); - patrolContentsRecord.setStatus(PatrolRecord.Status_Issue); - //找该计划下所有 巡检计划巡检内容配置对应表 - List patrolContentsPlans = this.patrolContentsPlanService - .selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"); - for (PatrolContentsPlan patrolContentsPlan : patrolContentsPlans) { - patrolContentsRecord.setId(CommUtil.getUUID()); - patrolContentsRecord.setEquipmentId(patrolContentsPlan.getEquipmentId());//设备 - if (patrolContentsPlan.getContents() != null && !patrolContentsPlan.getContents().equals("")) { - patrolContentsRecord.setContents(patrolContentsPlan.getContents());//巡检内容 - } - if (patrolContentsPlan.getContentsDetail() != null && !patrolContentsPlan.getContentsDetail().equals("")) { - patrolContentsRecord.setContentsDetail(patrolContentsPlan.getContentsDetail());//巡检内容详细 - } - patrolContentsRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - this.patrolContentsRecordService.save(patrolContentsRecord);//保存 - } - - // 3°获取设备巡检计划下直接配置的设备 的 填报项 - PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); - patrolMeasurePointRecord.setInsuser(userId); - patrolMeasurePointRecord.setInsdt(CommUtil.nowDate()); - patrolMeasurePointRecord.setPatrolRecordId(patrolRecord.getId()); - patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Issue); - List patrolMeasurePointPlans = this.patrolMeasurePointPlanService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"); - for (PatrolMeasurePointPlan patrolMeasurePointPlan : patrolMeasurePointPlans) { - patrolMeasurePointRecord.setId(CommUtil.getUUID()); - patrolMeasurePointRecord.setMeasurePointId(patrolMeasurePointPlan.getMeasurePointId());//测量点 - patrolMeasurePointRecord.setEquipmentId(patrolMeasurePointPlan.getEquipmentId()); - patrolMeasurePointRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - this.patrolMeasurePointRecordService.save(patrolMeasurePointRecord);//保存 - } - - } - - if (result == 0) { //任务保存异常 - throw new RuntimeException(); - } else if (result == 9) {//任务重复 - System.out.println("重复任务===" + patrolPlan.getName() + "===" + patrolRecord.getStartTime() + "===已过滤===" + CommUtil.nowDate()); - } else {//任务保存正常 - res += 1; - List patrolRoutes = patrolRouteService.selectListByWhere("where patrol_plan_id='" + patrolPlanId + "'");//+"' and floor_id in ('"+floorIds+"')"); - String patrolPointIds = "";//巡检计划的所有巡检点id - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setInsuser(userId); - patrolRecordPatrolRoute.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Issue); - for (PatrolRoute item : patrolRoutes) { - if (item.getPatrolPointId() != null && !item.getPatrolPointId().equals("")) { - if (patrolPointIds.equals("")) { - patrolPointIds += item.getPatrolPointId(); - } else { - patrolPointIds += "','" + item.getPatrolPointId(); - } - } - patrolRecordPatrolRoute.setId(CommUtil.getUUID()); - patrolRecordPatrolRoute.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setPatrolPointId(item.getPatrolPointId()); - patrolRecordPatrolRoute.setFloorId(item.getFloorId()); - patrolRecordPatrolRoute.setPatrolRouteId(item.getId()); - patrolRecordPatrolRoute.setPreviousId(item.getPreviousId()); - patrolRecordPatrolRoute.setNextId(item.getNextId()); - patrolRecordPatrolRoute.setType(item.getType()); - patrolRecordPatrolRoute.setPosx(item.getPosx()); - patrolRecordPatrolRoute.setPosy(item.getPosy()); - patrolRecordPatrolRoute.setContainerWidth(item.getContainerWidth()); - patrolRecordPatrolRoute.setContainerHeight(item.getContainerHeight()); - //统计单条巡检记录巡检路线有多少内容和填报数量 - List patrolContentsPlans = this.patrolContentsPlanService - .selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "' and patrol_point_id = '" + patrolRecordPatrolRoute.getPatrolPointId() - + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Point + "'"); - patrolRecordPatrolRoute.setAllNumContent(patrolContentsPlans.size()); - List patrolMeasurePointPlans = this.patrolMeasurePointPlanService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and patrol_point_id = '" + patrolRecordPatrolRoute.getPatrolPointId() - + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Point + "'"); - patrolRecordPatrolRoute.setAllNumMeasurePoint(patrolMeasurePointPlans.size()); - this.patrolRecordPatrolRouteService.save(patrolRecordPatrolRoute); - } - - /*---------------------------- 巡检点下发设备 内容 填报项 1.赋值type(point) 2.赋值equipmentId 和 patrolPointId ------------------------------*/ - // 2°生成巡检记录对应设备 查询该巡检路线所有巡检点下的所有设备ID - List patrolEquipments = this.patrolPointEquipmentCardService - .selectListByWhere(" where patrol_point_id in ('" + patrolPointIds + "')"); - //将设备id塞入set中 去重 - Set set = new HashSet(); - for (PatrolPointEquipmentCard patrolEquipment : patrolEquipments) { - //if(patrolEquipment.getEquipmentCard()!=null && patrolEquipment.getEquipmentCard().getEquipmentstatus()!=null && patrolEquipment.getEquipmentCard().getEquipmentstatus().equals(EquipmentCard.Status_ON)){ - //判断这个设备对象是否为空 且 状态为启动的设备才进行下发 - //if (set.add(patrolEquipment.getEquipmentCardId())) { - //生成 - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setId(CommUtil.getUUID()); - patrolRecordPatrolEquipment.setInsuser(userId); - patrolRecordPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolEquipment.setEquipmentId(patrolEquipment.getEquipmentCardId()); - patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Issue); - patrolRecordPatrolEquipment.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolEquipment.setPatrolPointId(patrolEquipment.getPatrolPointId()); - patrolRecordPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - this.patrolRecordPatrolEquipmentService.save(patrolRecordPatrolEquipment); - //} - //} - } - - // 3° 通过 巡检计划的巡检内容 生成 巡检记录的巡检内容 - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setInsuser(userId); - patrolContentsRecord.setInsdt(CommUtil.nowDate()); - patrolContentsRecord.setPatrolRecordId(patrolRecord.getId()); - patrolContentsRecord.setStatus(PatrolRecord.Status_Issue); - //找该计划下所有 巡检计划巡检内容配置对应表 - List patrolContentsPlans = this.patrolContentsPlanService - .selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Point + "'"); - for (PatrolContentsPlan patrolContentsPlan : patrolContentsPlans) { - patrolContentsRecord.setId(CommUtil.getUUID()); - patrolContentsRecord.setPatrolPointId(patrolContentsPlan.getPlanPointId());//巡检点 - patrolContentsRecord.setEquipmentId(patrolContentsPlan.getEquipmentId());//设备 - patrolContentsRecord.setPid(patrolRecordPatrolRoute.getId());//巡检记录巡检路线ID - if (patrolContentsPlan.getContents() != null && !patrolContentsPlan.getContents().equals("")) { - patrolContentsRecord.setContents(patrolContentsPlan.getContents());//巡检内容 - } - if (patrolContentsPlan.getContentsDetail() != null && !patrolContentsPlan.getContentsDetail().equals("")) { - patrolContentsRecord.setContentsDetail(patrolContentsPlan.getContentsDetail());//巡检内容详细 - } - patrolContentsRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - this.patrolContentsRecordService.save(patrolContentsRecord);//保存 - } - - // 4° 通过巡检计划的填报因素 生成 巡检记录的填报因素 - PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); - patrolMeasurePointRecord.setInsuser(userId); - patrolMeasurePointRecord.setInsdt(CommUtil.nowDate()); - patrolMeasurePointRecord.setPatrolRecordId(patrolRecord.getId()); - patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Issue); - List patrolMeasurePointPlans = this.patrolMeasurePointPlanService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Point + "'"); - for (PatrolMeasurePointPlan patrolMeasurePointPlan : patrolMeasurePointPlans) { - patrolMeasurePointRecord.setId(CommUtil.getUUID()); - patrolMeasurePointRecord.setMeasurePointId(patrolMeasurePointPlan.getMeasurePointId());//测量点 - patrolMeasurePointRecord.setEquipmentId(patrolMeasurePointPlan.getEquipmentId());//设备 - patrolMeasurePointRecord.setPatrolPointId(patrolMeasurePointPlan.getPatrolPointId());//巡检点 - patrolMeasurePointRecord.setPid(patrolRecordPatrolRoute.getId());//巡检记录巡检路线ID - patrolMeasurePointRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - this.patrolMeasurePointRecordService.save(patrolMeasurePointRecord);//保存 - } - - } - //若时间间隔为0,则在一天中只产生一次记录 - if (patrolPlan.getTimeInterval() == null || patrolPlan.getTimeInterval() == 0) { - break; - } - startCalendar.add(Calendar.MINUTE, patrolPlan.getTimeInterval()); - } - } catch (ParseException e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return res; - - } - - @Transactional - public int createPatrolRecord_Equipment(String date, String patrolPlanId, String userId) { - int result = 0; - try { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //时间格式化GroupTimeService - date = date.substring(0, 10); - String[] dayTime = groupTimeService.getStartAndEndTime(date); - - //若当天同一计划已下发,则不再重复下发 - List records = this.selectListByWhere("where start_time >= '" + dayTime[0] + "' and end_time <='" + dayTime[1] + "' and patrol_plan_id='" + patrolPlanId + "'"); - if (records != null && records.size() > 0) { - return result; - } - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - //巡检计划未启用则不下发 - if (!patrolPlan.getActive()) { - return result; - } - PatrolRecord patrolRecord = new PatrolRecord(); -// String id = CommUtil.getUUID(); - patrolRecord.setBizId(patrolPlan.getBizId()); - patrolRecord.setUnitId(patrolPlan.getUnitId()); - patrolRecord.setInsuser(userId); - patrolRecord.setPatrolAreaId(patrolPlan.getPatrolAreaId()); - patrolRecord.setName(patrolPlan.getName()); - patrolRecord.setContent(patrolPlan.getPatrolContent()); - patrolRecord.setPatrolPlanId(patrolPlan.getId()); - patrolRecord.setType(patrolPlan.getType()); - patrolRecord.setPatrolModelId(patrolPlan.getPatrolModelId()); - patrolRecord.setStatus(PatrolRecord.Status_Issue); - patrolRecord.setGroupTypeId(patrolPlan.getGroupTypeId()); - - String sdt = ""; - String edt = ""; - sdt = date + " " + patrolPlan.getSdt().substring(11, 16) + ":00"; - edt = date + " " + patrolPlan.getEdt().substring(11, 16) + ":00"; - Calendar startCalendar = Calendar.getInstance(); - Calendar lastEndCalendar = Calendar.getInstance(); - try { - startCalendar.setTime(sdf.parse(sdt)); - lastEndCalendar.setTime(sdf.parse(edt)); - //若开始时间大于结束时间,则说明跨天,结束时间加一天 - if (startCalendar.getTimeInMillis() >= lastEndCalendar.getTimeInMillis()) { - lastEndCalendar.add(Calendar.DATE, 1); - } - while (startCalendar.getTimeInMillis() < lastEndCalendar.getTimeInMillis()) { - String startTime = sdf.format(startCalendar.getTime()); - //记录的结束时间 - Calendar endCalendar = Calendar.getInstance(); - endCalendar.setTime(startCalendar.getTime()); - endCalendar.add(Calendar.MINUTE, patrolPlan.getDuration()); - String endTime = sdf.format(endCalendar.getTime()); - - String id = CommUtil.getUUID(); - - //保存任务班组 - if (patrolPlan != null) { - List list_plan_dept = patrolPlanDeptService.selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "'"); - for (PatrolPlanDept patrolPlanDept : list_plan_dept) { - PatrolRecordDept patrolRecordDept = new PatrolRecordDept(); - patrolRecordDept.setId(CommUtil.getUUID()); - patrolRecordDept.setInsdt(CommUtil.nowDate()); - patrolRecordDept.setPatrolRecordId(id); - patrolRecordDept.setDeptId(patrolPlanDept.getDeptId()); - patrolRecordDept.setInsuser(patrolPlanDept.getInsuser()); - patrolRecordDeptService.save(patrolRecordDept); - } - } - - patrolRecord.setStartTime(startTime); - patrolRecord.setEndTime(endTime); - patrolRecord.setId(id); - patrolRecord.setInsdt(CommUtil.nowDate()); - result = this.save(patrolRecord); - - switch (patrolPlan.getType()) { - //设备巡检 - case TimeEfficiencyCommStr.PatrolType_Equipment: - /*---------------------------- 设备下发 内容 填报项 1.赋值type(equipment) 2.赋值equipmentId ------------------------------*/ - // 1°获取设备巡检计划下直接配置的设备 - List patrolPlanPatrolEquipments = this.patrolPlanPatrolEquipmentService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"); - //将设备id塞入set中 去重 - Set set = new HashSet(); - for (PatrolPlanPatrolEquipment patrolPlanPatrolEquipment : patrolPlanPatrolEquipments) { - //sj 2020-10-27 注释 - //if(patrolPlanPatrolEquipment.getEquipmentCard()!=null && - // patrolPlanPatrolEquipment.getEquipmentCard().getEquipmentstatus().equals(EquipmentCard.Status_ON)){ - //判断这个设备对象是否为空 且 状态为启动的设备才进行下发 - if (set.add(patrolPlanPatrolEquipment.getEquipmentId())) { - //生成 - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setId(CommUtil.getUUID()); - patrolRecordPatrolEquipment.setInsuser(userId); - patrolRecordPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolEquipment.setEquipmentId(patrolPlanPatrolEquipment.getEquipmentId()); - patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Issue); - patrolRecordPatrolEquipment.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolEquipment.setPatrolPointId(patrolPlanPatrolEquipment.getPatrolPointId()); - patrolRecordPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - patrolRecordPatrolEquipment.setMorder(patrolPlanPatrolEquipment.getMorder()); - this.patrolRecordPatrolEquipmentService.save(patrolRecordPatrolEquipment); - } - //} - } - - // 2°获取设备巡检计划下直接配置的设备 的 巡检内容 - PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); - patrolContentsRecord.setInsuser(userId); - patrolContentsRecord.setInsdt(CommUtil.nowDate()); - patrolContentsRecord.setPatrolRecordId(patrolRecord.getId()); - patrolContentsRecord.setStatus(PatrolRecord.Status_Issue); - //找该计划下所有 巡检计划巡检内容配置对应表 - List patrolContentsPlans = this.patrolContentsPlanService - .selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"); - for (PatrolContentsPlan patrolContentsPlan : patrolContentsPlans) { - patrolContentsRecord.setId(CommUtil.getUUID()); - patrolContentsRecord.setEquipmentId(patrolContentsPlan.getEquipmentId());//设备 - if (patrolContentsPlan.getContents() != null && !patrolContentsPlan.getContents().equals("")) { - patrolContentsRecord.setContents(patrolContentsPlan.getContents());//巡检内容 - } - if (patrolContentsPlan.getContentsDetail() != null && !patrolContentsPlan.getContentsDetail().equals("")) { - patrolContentsRecord.setContentsDetail(patrolContentsPlan.getContentsDetail());//巡检内容详细 - } - patrolContentsRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - this.patrolContentsRecordService.save(patrolContentsRecord);//保存 - } - - // 3°获取设备巡检计划下直接配置的设备 的 填报项 - PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); - patrolMeasurePointRecord.setInsuser(userId); - patrolMeasurePointRecord.setInsdt(CommUtil.nowDate()); - patrolMeasurePointRecord.setPatrolRecordId(patrolRecord.getId()); - patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Issue); - List patrolMeasurePointPlans = this.patrolMeasurePointPlanService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Equipment + "'"); - for (PatrolMeasurePointPlan patrolMeasurePointPlan : patrolMeasurePointPlans) { - patrolMeasurePointRecord.setId(CommUtil.getUUID()); - patrolMeasurePointRecord.setMeasurePointId(patrolMeasurePointPlan.getMeasurePointId());//测量点 - patrolMeasurePointRecord.setEquipmentId(patrolMeasurePointPlan.getEquipmentId()); - patrolMeasurePointRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Equipment); - this.patrolMeasurePointRecordService.save(patrolMeasurePointRecord);//保存 - } - - } - - if (result == 0) { - throw new RuntimeException(); - } else { - //保存巡检点巡检任务 - /*List patrolPlanPatrolPoints = patrolPlanPatrolPointService.selectListByWhere("where plan_id='"+patrolPlanId+"'"); - PatrolRecordPatrolPoint patrolRecordPatrolPoint = new PatrolRecordPatrolPoint(); - patrolRecordPatrolPoint.setInsuser(userId); - patrolRecordPatrolPoint.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolPoint.setStatus(PatrolRecord.Status_Issue); - for (PatrolPlanPatrolPoint patrolPlanPatrolPoint : patrolPlanPatrolPoints) { - patrolRecordPatrolPoint.setId(CommUtil.getUUID()); - patrolRecordPatrolPoint.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolPoint.setPatrolPointId(patrolPlanPatrolPoint.getPatrolPointId()); - this.patrolRecordPatrolPointService.save(patrolRecordPatrolPoint); - }*/ - // 1°根据巡检路线中的巡检点发布巡检点巡检记录 BLG取消用区域筛选巡检点,直接用计划Id寻找路线 - // List patrolAreaFloor = this.patrolAreaFloorService.selectListByWhere(" where patrol_area_id = '"+patrolPlan.getPatrolAreaId()+"'"); - // String floorIds = ""; - // for(int i=0;i patrolRoutes = patrolRouteService.selectListByWhere("where patrol_plan_id='" + patrolPlanId + "'");//+"' and floor_id in ('"+floorIds+"')"); - String patrolPointIds = "";//巡检计划的所有巡检点id - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setInsuser(userId); - patrolRecordPatrolRoute.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Issue); - for (PatrolRoute item : patrolRoutes) { - if (item.getPatrolPointId() != null && !item.getPatrolPointId().equals("")) { - if (patrolPointIds.equals("")) { - patrolPointIds += item.getPatrolPointId(); - } else { - patrolPointIds += "','" + item.getPatrolPointId(); - } - } - patrolRecordPatrolRoute.setId(CommUtil.getUUID()); - patrolRecordPatrolRoute.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setPatrolPointId(item.getPatrolPointId()); - patrolRecordPatrolRoute.setFloorId(item.getFloorId()); - patrolRecordPatrolRoute.setPatrolRouteId(item.getId()); - patrolRecordPatrolRoute.setPreviousId(item.getPreviousId()); - patrolRecordPatrolRoute.setNextId(item.getNextId()); - patrolRecordPatrolRoute.setType(item.getType()); - patrolRecordPatrolRoute.setPosx(item.getPosx()); - patrolRecordPatrolRoute.setPosy(item.getPosy()); - patrolRecordPatrolRoute.setContainerWidth(item.getContainerWidth()); - patrolRecordPatrolRoute.setContainerHeight(item.getContainerHeight()); - //统计单条巡检记录巡检路线有多少内容和填报数量 -// List patrolContentsPlans = this.patrolContentsPlanService -// .selectListByWhere(" where patrol_plan_id = '"+ patrolPlanId +"' and patrol_point_id = '"+patrolRecordPatrolRoute.getPatrolPointId() -// +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// patrolRecordPatrolRoute.setAllNumContent(patrolContentsPlans.size()); -// List patrolMeasurePointPlans = this.patrolMeasurePointPlanService -// .selectListByWhere(" where patrol_plan_id ='"+patrolPlanId+"' and patrol_point_id = '"+patrolRecordPatrolRoute.getPatrolPointId() -// +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// patrolRecordPatrolRoute.setAllNumMeasurePoint(patrolMeasurePointPlans.size()); - this.patrolRecordPatrolRouteService.save(patrolRecordPatrolRoute); - } - - /*---------------------------- 巡检点下发设备 内容 填报项 1.赋值type(point) 2.赋值equipmentId 和 patrolPointId ------------------------------*/ - // 2°生成巡检记录对应设备 查询该巡检路线所有巡检点下的所有设备ID -// List patrolEquipments = this.patrolPointEquipmentCardService -// .selectListByWhere(" where patrol_point_id in ('"+patrolPointIds+"')"); -// //将设备id塞入set中 去重 -// Set set = new HashSet(); -// for(PatrolPointEquipmentCard patrolEquipment: patrolEquipments){ -// //if(patrolEquipment.getEquipmentCard()!=null && patrolEquipment.getEquipmentCard().getEquipmentstatus()!=null && patrolEquipment.getEquipmentCard().getEquipmentstatus().equals(EquipmentCard.Status_ON)){ -// //判断这个设备对象是否为空 且 状态为启动的设备才进行下发 -// //if (set.add(patrolEquipment.getEquipmentCardId())) { -// //生成 -// PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); -// patrolRecordPatrolEquipment.setId(CommUtil.getUUID()); -// patrolRecordPatrolEquipment.setInsuser(userId); -// patrolRecordPatrolEquipment.setInsdt(CommUtil.nowDate()); -// patrolRecordPatrolEquipment.setEquipmentId(patrolEquipment.getEquipmentCardId()); -// patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Issue); -// patrolRecordPatrolEquipment.setPatrolRecordId(patrolRecord.getId()); -// patrolRecordPatrolEquipment.setPatrolPointId(patrolEquipment.getPatrolPointId()); -// patrolRecordPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); -// this.patrolRecordPatrolEquipmentService.save(patrolRecordPatrolEquipment); -// //} -// //} -// } -// -// // 3° 通过 巡检计划的巡检内容 生成 巡检记录的巡检内容 -// PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); -// patrolContentsRecord.setInsuser(userId); -// patrolContentsRecord.setInsdt(CommUtil.nowDate()); -// patrolContentsRecord.setPatrolRecordId(patrolRecord.getId()); -// patrolContentsRecord.setStatus(PatrolRecord.Status_Issue); -// //找该计划下所有 巡检计划巡检内容配置对应表 -// List patrolContentsPlans = this.patrolContentsPlanService -// .selectListByWhere(" where patrol_plan_id = '"+ patrolPlanId +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// for(PatrolContentsPlan patrolContentsPlan: patrolContentsPlans){ -// patrolContentsRecord.setId(CommUtil.getUUID()); -// patrolContentsRecord.setPatrolPointId(patrolContentsPlan.getPlanPointId());//巡检点 -// patrolContentsRecord.setEquipmentId(patrolContentsPlan.getEquipmentId());//设备 -// patrolContentsRecord.setPid(patrolRecordPatrolRoute.getId());//巡检记录巡检路线ID -// if(patrolContentsPlan.getContents()!=null && !patrolContentsPlan.getContents().equals("")){ -// patrolContentsRecord.setContents(patrolContentsPlan.getContents());//巡检内容 -// } -// if(patrolContentsPlan.getContentsDetail()!=null && !patrolContentsPlan.getContentsDetail().equals("")){ -// patrolContentsRecord.setContentsDetail(patrolContentsPlan.getContentsDetail());//巡检内容详细 -// } -// patrolContentsRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); -// this.patrolContentsRecordService.save(patrolContentsRecord);//保存 -// } -// -// // 4° 通过巡检计划的填报因素 生成 巡检记录的填报因素 -// PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); -// patrolMeasurePointRecord.setInsuser(userId); -// patrolMeasurePointRecord.setInsdt(CommUtil.nowDate()); -// patrolMeasurePointRecord.setPatrolRecordId(patrolRecord.getId()); -// patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Issue); -// List patrolMeasurePointPlans = this.patrolMeasurePointPlanService -// .selectListByWhere(" where patrol_plan_id ='"+patrolPlanId+"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// for(PatrolMeasurePointPlan patrolMeasurePointPlan: patrolMeasurePointPlans){ -// patrolMeasurePointRecord.setId(CommUtil.getUUID()); -// patrolMeasurePointRecord.setMeasurePointId(patrolMeasurePointPlan.getMeasurePointId());//测量点 -// patrolMeasurePointRecord.setEquipmentId(patrolMeasurePointPlan.getEquipmentId());//设备 -// patrolMeasurePointRecord.setPatrolPointId(patrolMeasurePointPlan.getPatrolPointId());//巡检点 -// patrolMeasurePointRecord.setPid(patrolRecordPatrolRoute.getId());//巡检记录巡检路线ID -// patrolMeasurePointRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); -// this.patrolMeasurePointRecordService.save(patrolMeasurePointRecord);//保存 -// } - - } - //若时间间隔为0,则在一天中只产生一次记录 - if (patrolPlan.getTimeInterval() == null || patrolPlan.getTimeInterval() == 0) { - break; - } - startCalendar.add(Calendar.MINUTE, patrolPlan.getTimeInterval()); - - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - throw new RuntimeException(); - } - // break; - - // default: - // break; - // } - - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return result; - - } - - @Transactional - public int createPatrolRecord_Camera(String date, String patrolPlanId, String userId) { - int result = 0; - try { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //时间格式化GroupTimeService - date = date.substring(0, 10); - String[] dayTime = groupTimeService.getStartAndEndTime(date); - - //若当天同一计划已下发,则不再重复下发 - List records = this.selectListByWhere("where start_time >= '" + dayTime[0] + "' and end_time <='" + dayTime[1] + "' and patrol_plan_id='" + patrolPlanId + "'"); - if (records != null && records.size() > 0) { - return result; - } - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - //巡检计划未启用则不下发 - if (!patrolPlan.getActive()) { - return result; - } - PatrolRecord patrolRecord = new PatrolRecord(); - String id = CommUtil.getUUID(); - patrolRecord.setBizId(patrolPlan.getBizId()); - patrolRecord.setUnitId(patrolPlan.getUnitId()); - patrolRecord.setInsuser(userId); - patrolRecord.setPatrolAreaId(patrolPlan.getPatrolAreaId()); - patrolRecord.setName(patrolPlan.getName()); - patrolRecord.setContent(patrolPlan.getPatrolContent()); - patrolRecord.setPatrolPlanId(patrolPlan.getId()); - patrolRecord.setType(patrolPlan.getType()); - patrolRecord.setPatrolModelId(patrolPlan.getPatrolModelId()); - patrolRecord.setStatus(PatrolRecord.Status_Issue); - patrolRecord.setGroupTypeId(patrolPlan.getGroupTypeId()); - - //保存任务班组 - if (patrolPlan != null) { - List list_plan_dept = patrolPlanDeptService.selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "'"); - for (PatrolPlanDept patrolPlanDept : list_plan_dept) { - PatrolRecordDept patrolRecordDept = new PatrolRecordDept(); - patrolRecordDept.setId(CommUtil.getUUID()); - patrolRecordDept.setInsdt(CommUtil.nowDate()); - patrolRecordDept.setPatrolRecordId(id); - patrolRecordDept.setDeptId(patrolPlanDept.getDeptId()); - patrolRecordDept.setInsuser(patrolPlanDept.getInsuser()); - patrolRecordDeptService.save(patrolRecordDept); - } - } - - String sdt = ""; - String edt = ""; - sdt = date + " " + patrolPlan.getSdt().substring(11, 16) + ":00"; - edt = date + " " + patrolPlan.getEdt().substring(11, 16) + ":00"; - Calendar startCalendar = Calendar.getInstance(); - Calendar lastEndCalendar = Calendar.getInstance(); - try { - startCalendar.setTime(sdf.parse(sdt)); - lastEndCalendar.setTime(sdf.parse(edt)); - //若开始时间大于结束时间,则说明跨天,结束时间加一天 - if (startCalendar.getTimeInMillis() >= lastEndCalendar.getTimeInMillis()) { - lastEndCalendar.add(Calendar.DATE, 1); - } - while (startCalendar.getTimeInMillis() < lastEndCalendar.getTimeInMillis()) { - String startTime = sdf.format(startCalendar.getTime()); - //记录的结束时间 - Calendar endCalendar = Calendar.getInstance(); - endCalendar.setTime(startCalendar.getTime()); - endCalendar.add(Calendar.MINUTE, patrolPlan.getDuration()); - String endTime = sdf.format(endCalendar.getTime()); - patrolRecord.setStartTime(startTime); - patrolRecord.setEndTime(endTime); - patrolRecord.setId(id); - patrolRecord.setInsdt(CommUtil.nowDate()); - result = this.save(patrolRecord); - - switch (patrolPlan.getType()) { - //视频巡检 - case TimeEfficiencyCommStr.PatrolType_Camera: - //先判断巡检计划是否关联巡检点,如关联则只下发巡检点下摄像头记录 -// String planId = request.getParameter("planId"); - String wherestr = " where 1=1 and patrol_plan_id = '" + patrolPlanId + "' and type = '" + PatrolRoute.Point_0 + "' order by morder"; - List patrolRouteList = this.patrolRouteService.selectListByPlan(wherestr); - if (patrolRouteList != null && patrolRouteList.size() > 0) { - List patrolPointCameras = this.patrolPointCameraService - .selectListByWhere(" where patrol_point_id ='" + patrolRouteList.get(0).getPatrolPointId() + "' "); - Set set = new HashSet(); - for (PatrolPointCamera patrolPointCamera : patrolPointCameras) { - if (set.add(patrolPointCamera.getCameraId())) { - //生成 - PatrolRecordPatrolCamera patrolRecordPatrolCamera = new PatrolRecordPatrolCamera(); - patrolRecordPatrolCamera.setId(CommUtil.getUUID()); - patrolRecordPatrolCamera.setInsuser(userId); - patrolRecordPatrolCamera.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolCamera.setCameraid(patrolPointCamera.getCameraId()); - patrolRecordPatrolCamera.setStatus(PatrolRecord.Status_Issue); - patrolRecordPatrolCamera.setPatrolrecordid(patrolRecord.getId()); - patrolRecordPatrolCamera.setType(TimeEfficiencyCommStr.PatrolEquipment_Camera); -// patrolRecordPatrolCamera.setMorder(patrolPointCamera.getMorder()); - this.patrolRecordPatrolCameraService.save(patrolRecordPatrolCamera); - } - //} - } - } else { - List patrolPlanPatrolCameras = this.patrolPlanPatrolCameraService - .selectListByWhere(" where patrol_plan_id ='" + patrolPlanId + "' and type = '" + TimeEfficiencyCommStr.PatrolEquipment_Camera + "'"); - Set set = new HashSet(); - for (PatrolPlanPatrolCamera patrolPlanPatrolCamera : patrolPlanPatrolCameras) { - if (set.add(patrolPlanPatrolCamera.getCameraid())) { - //生成 - PatrolRecordPatrolCamera patrolRecordPatrolCamera = new PatrolRecordPatrolCamera(); - patrolRecordPatrolCamera.setId(CommUtil.getUUID()); - patrolRecordPatrolCamera.setInsuser(userId); - patrolRecordPatrolCamera.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolCamera.setCameraid(patrolPlanPatrolCamera.getCameraid()); - patrolRecordPatrolCamera.setStatus(PatrolRecord.Status_Issue); - patrolRecordPatrolCamera.setPatrolrecordid(patrolRecord.getId()); - patrolRecordPatrolCamera.setType(TimeEfficiencyCommStr.PatrolEquipment_Camera); - patrolRecordPatrolCamera.setMorder(patrolPlanPatrolCamera.getMorder()); - this.patrolRecordPatrolCameraService.save(patrolRecordPatrolCamera); - } - //} - } - } - - } - - if (result == 0) { - throw new RuntimeException(); - } else { - //保存巡检点巡检任务 - /*List patrolPlanPatrolPoints = patrolPlanPatrolPointService.selectListByWhere("where plan_id='"+patrolPlanId+"'"); - PatrolRecordPatrolPoint patrolRecordPatrolPoint = new PatrolRecordPatrolPoint(); - patrolRecordPatrolPoint.setInsuser(userId); - patrolRecordPatrolPoint.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolPoint.setStatus(PatrolRecord.Status_Issue); - for (PatrolPlanPatrolPoint patrolPlanPatrolPoint : patrolPlanPatrolPoints) { - patrolRecordPatrolPoint.setId(CommUtil.getUUID()); - patrolRecordPatrolPoint.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolPoint.setPatrolPointId(patrolPlanPatrolPoint.getPatrolPointId()); - this.patrolRecordPatrolPointService.save(patrolRecordPatrolPoint); - }*/ - // 1°根据巡检路线中的巡检点发布巡检点巡检记录 BLG取消用区域筛选巡检点,直接用计划Id寻找路线 - // List patrolAreaFloor = this.patrolAreaFloorService.selectListByWhere(" where patrol_area_id = '"+patrolPlan.getPatrolAreaId()+"'"); - // String floorIds = ""; - // for(int i=0;i patrolRoutes = patrolRouteService.selectListByWhere("where patrol_plan_id='" + patrolPlanId + "'");//+"' and floor_id in ('"+floorIds+"')"); - String patrolPointIds = "";//巡检计划的所有巡检点id - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setInsuser(userId); - patrolRecordPatrolRoute.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Issue); - for (PatrolRoute item : patrolRoutes) { - if (item.getPatrolPointId() != null && !item.getPatrolPointId().equals("")) { - if (patrolPointIds.equals("")) { - patrolPointIds += item.getPatrolPointId(); - } else { - patrolPointIds += "','" + item.getPatrolPointId(); - } - } - patrolRecordPatrolRoute.setId(CommUtil.getUUID()); - patrolRecordPatrolRoute.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setPatrolPointId(item.getPatrolPointId()); - patrolRecordPatrolRoute.setFloorId(item.getFloorId()); - patrolRecordPatrolRoute.setPatrolRouteId(item.getId()); - patrolRecordPatrolRoute.setPreviousId(item.getPreviousId()); - patrolRecordPatrolRoute.setNextId(item.getNextId()); - patrolRecordPatrolRoute.setType(item.getType()); - patrolRecordPatrolRoute.setPosx(item.getPosx()); - patrolRecordPatrolRoute.setPosy(item.getPosy()); - patrolRecordPatrolRoute.setContainerWidth(item.getContainerWidth()); - patrolRecordPatrolRoute.setContainerHeight(item.getContainerHeight()); - //统计单条巡检记录巡检路线有多少内容和填报数量 -// List patrolContentsPlans = this.patrolContentsPlanService -// .selectListByWhere(" where patrol_plan_id = '"+ patrolPlanId +"' and patrol_point_id = '"+patrolRecordPatrolRoute.getPatrolPointId() -// +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// patrolRecordPatrolRoute.setAllNumContent(patrolContentsPlans.size()); -// List patrolMeasurePointPlans = this.patrolMeasurePointPlanService -// .selectListByWhere(" where patrol_plan_id ='"+patrolPlanId+"' and patrol_point_id = '"+patrolRecordPatrolRoute.getPatrolPointId() -// +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// patrolRecordPatrolRoute.setAllNumMeasurePoint(patrolMeasurePointPlans.size()); - this.patrolRecordPatrolRouteService.save(patrolRecordPatrolRoute); - } - - /*---------------------------- 巡检点下发设备 内容 填报项 1.赋值type(point) 2.赋值equipmentId 和 patrolPointId ------------------------------*/ - // 2°生成巡检记录对应设备 查询该巡检路线所有巡检点下的所有设备ID -// List patrolEquipments = this.patrolPointEquipmentCardService -// .selectListByWhere(" where patrol_point_id in ('"+patrolPointIds+"')"); -// //将设备id塞入set中 去重 -// Set set = new HashSet(); -// for(PatrolPointEquipmentCard patrolEquipment: patrolEquipments){ -// //if(patrolEquipment.getEquipmentCard()!=null && patrolEquipment.getEquipmentCard().getEquipmentstatus()!=null && patrolEquipment.getEquipmentCard().getEquipmentstatus().equals(EquipmentCard.Status_ON)){ -// //判断这个设备对象是否为空 且 状态为启动的设备才进行下发 -// //if (set.add(patrolEquipment.getEquipmentCardId())) { -// //生成 -// PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); -// patrolRecordPatrolEquipment.setId(CommUtil.getUUID()); -// patrolRecordPatrolEquipment.setInsuser(userId); -// patrolRecordPatrolEquipment.setInsdt(CommUtil.nowDate()); -// patrolRecordPatrolEquipment.setEquipmentId(patrolEquipment.getEquipmentCardId()); -// patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Issue); -// patrolRecordPatrolEquipment.setPatrolRecordId(patrolRecord.getId()); -// patrolRecordPatrolEquipment.setPatrolPointId(patrolEquipment.getPatrolPointId()); -// patrolRecordPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); -// this.patrolRecordPatrolEquipmentService.save(patrolRecordPatrolEquipment); -// //} -// //} -// } -// -// // 3° 通过 巡检计划的巡检内容 生成 巡检记录的巡检内容 -// PatrolContentsRecord patrolContentsRecord = new PatrolContentsRecord(); -// patrolContentsRecord.setInsuser(userId); -// patrolContentsRecord.setInsdt(CommUtil.nowDate()); -// patrolContentsRecord.setPatrolRecordId(patrolRecord.getId()); -// patrolContentsRecord.setStatus(PatrolRecord.Status_Issue); -// //找该计划下所有 巡检计划巡检内容配置对应表 -// List patrolContentsPlans = this.patrolContentsPlanService -// .selectListByWhere(" where patrol_plan_id = '"+ patrolPlanId +"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// for(PatrolContentsPlan patrolContentsPlan: patrolContentsPlans){ -// patrolContentsRecord.setId(CommUtil.getUUID()); -// patrolContentsRecord.setPatrolPointId(patrolContentsPlan.getPlanPointId());//巡检点 -// patrolContentsRecord.setEquipmentId(patrolContentsPlan.getEquipmentId());//设备 -// patrolContentsRecord.setPid(patrolRecordPatrolRoute.getId());//巡检记录巡检路线ID -// if(patrolContentsPlan.getContents()!=null && !patrolContentsPlan.getContents().equals("")){ -// patrolContentsRecord.setContents(patrolContentsPlan.getContents());//巡检内容 -// } -// if(patrolContentsPlan.getContentsDetail()!=null && !patrolContentsPlan.getContentsDetail().equals("")){ -// patrolContentsRecord.setContentsDetail(patrolContentsPlan.getContentsDetail());//巡检内容详细 -// } -// patrolContentsRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); -// this.patrolContentsRecordService.save(patrolContentsRecord);//保存 -// } -// -// // 4° 通过巡检计划的填报因素 生成 巡检记录的填报因素 -// PatrolMeasurePointRecord patrolMeasurePointRecord = new PatrolMeasurePointRecord(); -// patrolMeasurePointRecord.setInsuser(userId); -// patrolMeasurePointRecord.setInsdt(CommUtil.nowDate()); -// patrolMeasurePointRecord.setPatrolRecordId(patrolRecord.getId()); -// patrolMeasurePointRecord.setStatus(PatrolRecord.Status_Issue); -// List patrolMeasurePointPlans = this.patrolMeasurePointPlanService -// .selectListByWhere(" where patrol_plan_id ='"+patrolPlanId+"' and type = '"+TimeEfficiencyCommStr.PatrolEquipment_Point+"'"); -// for(PatrolMeasurePointPlan patrolMeasurePointPlan: patrolMeasurePointPlans){ -// patrolMeasurePointRecord.setId(CommUtil.getUUID()); -// patrolMeasurePointRecord.setMeasurePointId(patrolMeasurePointPlan.getMeasurePointId());//测量点 -// patrolMeasurePointRecord.setEquipmentId(patrolMeasurePointPlan.getEquipmentId());//设备 -// patrolMeasurePointRecord.setPatrolPointId(patrolMeasurePointPlan.getPatrolPointId());//巡检点 -// patrolMeasurePointRecord.setPid(patrolRecordPatrolRoute.getId());//巡检记录巡检路线ID -// patrolMeasurePointRecord.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); -// this.patrolMeasurePointRecordService.save(patrolMeasurePointRecord);//保存 -// } - - } - //若时间间隔为0,则在一天中只产生一次记录 - if (patrolPlan.getTimeInterval() == null || patrolPlan.getTimeInterval() == 0) { - break; - } - startCalendar.add(Calendar.MINUTE, patrolPlan.getTimeInterval()); - - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - throw new RuntimeException(); - } - // break; - - // default: - // break; - // } - - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - return result; - - } - - @Transactional - public int createPatrolRecord_Safe(String sdt, String edt, String patrolPlanId, String userId) { - int result = 0; - try { - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolPlanId); - //巡检计划未启用则不下发 - if (!patrolPlan.getActive()) { - return result; - } - - PatrolRecord patrolRecord = new PatrolRecord(); - String id = CommUtil.getUUID(); - patrolRecord.setBizId(patrolPlan.getBizId()); - patrolRecord.setUnitId(patrolPlan.getUnitId()); - patrolRecord.setInsuser(userId); - patrolRecord.setPatrolAreaId(patrolPlan.getPatrolAreaId()); - patrolRecord.setName(patrolPlan.getName()); - patrolRecord.setContent(patrolPlan.getPatrolContent()); - patrolRecord.setPatrolPlanId(patrolPlan.getId()); - patrolRecord.setType(patrolPlan.getType()); - patrolRecord.setPatrolModelId(patrolPlan.getPatrolModelId()); - patrolRecord.setStatus(PatrolRecord.Status_Issue); - patrolRecord.setTaskType(patrolPlan.getTaskType()); - patrolRecord.setAdvanceDay(patrolPlan.getAdvanceDay()); - patrolRecord.setReleaseModal(patrolPlan.getReleaseModal()); - patrolRecord.setGroupTypeId(patrolPlan.getGroupTypeId()); - patrolRecord.setIsPictures(patrolPlan.getIsPictures()); - - //保存任务班组 - if (patrolPlan != null) { - List list_plan_dept = patrolPlanDeptService.selectListByWhere(" where patrol_plan_id = '" + patrolPlanId + "'"); - for (PatrolPlanDept patrolPlanDept : list_plan_dept) { - PatrolRecordDept patrolRecordDept = new PatrolRecordDept(); - patrolRecordDept.setId(CommUtil.getUUID()); - patrolRecordDept.setInsdt(CommUtil.nowDate()); - patrolRecordDept.setPatrolRecordId(id); - patrolRecordDept.setDeptId(patrolPlanDept.getDeptId()); - patrolRecordDept.setInsuser(patrolPlanDept.getInsuser()); - patrolRecordDeptService.save(patrolRecordDept); - } - } - - try { - patrolRecord.setStartTime(sdt.substring(0, 10) + " 00:00:00"); - patrolRecord.setEndTime(edt.substring(0, 10) + " 23:59:59"); - patrolRecord.setId(id); - patrolRecord.setInsdt(CommUtil.nowDate()); - result = this.save(patrolRecord); - - if (result == 0) { - throw new RuntimeException(); - } else { - List patrolRoutes = patrolRouteService.selectListByWhere("where patrol_plan_id='" + patrolPlanId + "'");//+"' and floor_id in ('"+floorIds+"')"); - String patrolPointIds = "";//巡检计划的所有巡检点id - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setInsuser(userId); - patrolRecordPatrolRoute.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolRoute.setStatus(PatrolRecord.Status_Issue); - for (PatrolRoute item : patrolRoutes) { - if (item.getPatrolPointId() != null && !item.getPatrolPointId().equals("")) { - if (patrolPointIds.equals("")) { - patrolPointIds += item.getPatrolPointId(); - } else { - patrolPointIds += "','" + item.getPatrolPointId(); - } - } - patrolRecordPatrolRoute.setId(CommUtil.getUUID()); - patrolRecordPatrolRoute.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolRoute.setPatrolPointId(item.getPatrolPointId()); - patrolRecordPatrolRoute.setFloorId(item.getFloorId()); - patrolRecordPatrolRoute.setPatrolRouteId(item.getId()); - patrolRecordPatrolRoute.setPreviousId(item.getPreviousId()); - patrolRecordPatrolRoute.setNextId(item.getNextId()); - patrolRecordPatrolRoute.setType(item.getType()); - patrolRecordPatrolRoute.setPosx(item.getPosx()); - patrolRecordPatrolRoute.setPosy(item.getPosy()); - patrolRecordPatrolRoute.setContainerWidth(item.getContainerWidth()); - patrolRecordPatrolRoute.setContainerHeight(item.getContainerHeight()); - this.patrolRecordPatrolRouteService.save(patrolRecordPatrolRoute); - } - - List patrolPlanPatrolEquipments = patrolPlanPatrolEquipmentService - .selectListByWhere("where patrol_plan_id = '" + patrolPlanId + "'"); - for (PatrolPlanPatrolEquipment patrolPlanPatrolEquipment : patrolPlanPatrolEquipments) { - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = new PatrolRecordPatrolEquipment(); - patrolRecordPatrolEquipment.setId(CommUtil.getUUID()); - patrolRecordPatrolEquipment.setInsuser(userId); - patrolRecordPatrolEquipment.setInsdt(CommUtil.nowDate()); - patrolRecordPatrolEquipment.setEquipmentId(patrolPlanPatrolEquipment.getEquipmentId()); - patrolRecordPatrolEquipment.setStatus(PatrolRecord.Status_Issue); - patrolRecordPatrolEquipment.setPatrolRecordId(patrolRecord.getId()); - patrolRecordPatrolEquipment.setPatrolPointId(patrolPlanPatrolEquipment.getPatrolPointId()); - patrolRecordPatrolEquipment.setType(TimeEfficiencyCommStr.PatrolEquipment_Point); - this.patrolRecordPatrolEquipmentService.save(patrolRecordPatrolEquipment); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } catch (Exception e) { - e.printStackTrace(); - } - return result; - } - - public void fixColor(PatrolRecord patrolRecord) { - try { - PatrolPlan patrolPlan = this.patrolPlanService.selectById(patrolRecord.getPatrolPlanId()); - if (patrolPlan != null && patrolPlan.getColor() != null) { - patrolRecord.setColor(patrolPlan.getColor()); - } - } catch (Exception e) { - // TODO: handle exception - patrolRecord.setColor(""); - } - - } - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRecordService#downloadExcel(javax.servlet.http.HttpServletResponse, java.util.List) - */ - - @SuppressWarnings("deprecation") - public void downloadExcel(HttpServletResponse response, List patrolRecord) throws IOException { - String fileName = "巡检记录表" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "巡检记录表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 2000); - sheet.setColumnWidth(1, 4500); - sheet.setColumnWidth(2, 4500); - sheet.setColumnWidth(3, 4500); - sheet.setColumnWidth(4, 5000); - sheet.setColumnWidth(5, 5000); - sheet.setColumnWidth(6, 5000); - sheet.setColumnWidth(7, 5000); - sheet.setColumnWidth(8, 5000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = this.getExcelStr("ExcelPatrolRecord"); - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - //sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("巡检记录表"); - - //遍历集合数据,产生数据行 - for (int i = 0; i < patrolRecord.size(); i++) { - row = sheet.createRow(i + 3);//第三行为插入的数据行 - row.setHeight((short) 600); - PatrolRecord entity = patrolRecord.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < excelTitle.length; j++) { - switch (j) { - case 0://序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i + 1); - break; - case 1://厂区 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - if (null != entity.getUnit()) { - cell_1.setCellValue(entity.getUnit().getName()); - } else { - cell_1.setCellValue(""); - } - break; - case 2://巡检名称 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(entity.getName()); - break; - case 3://巡检内容 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(entity.getContent()); - break; - case 4://计划开始时间 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(entity.getStartTime()); - break; - case 5://计划结束时间 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(entity.getEndTime()); - case 6://巡检模式 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - if (entity.getPatrolModel() != null) { - cell_6.setCellValue(entity.getPatrolModel().getName()); - } - break; - case 7://巡检区域 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - if (entity.getPatrolArea() != null) { - cell_7.setCellValue(entity.getPatrolArea().getName()); - } - - break; - case 8://执行人员 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - if (entity.getWorker() != null) { - cell_8.setCellValue(entity.getWorker().getCaption()); - } - break; - case 9://执行反馈 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(entity.getWorkResult()); - break; - default: - break; - } - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - public List getProductPatrolDetailStatistic(String patrolRecordId) { - PatrolRecord patrolRecord = this.selectById(patrolRecordId); - String unitId = patrolRecord.getUnitId(); - List patrolRecordDetailStatisticsList = new ArrayList<>(); - List patrolRecordPatrolRoutes = patrolRouteService.selectListWithRecord(patrolRecordId, null); - for (PatrolRecordPatrolRoute patrolRecordPatrolRoute : patrolRecordPatrolRoutes) { - if (TimeEfficiencyCommStr.PatrolRoutType_PatrolPoint.equals(patrolRecordPatrolRoute.getType())) { - String patrolPointId = patrolRecordPatrolRoute.getPatrolPointId(); - PatrolRecordDetailStatistics patrolRecordDetailStatistics = new PatrolRecordDetailStatistics(); - patrolRecordDetailStatistics.setPatrolPointId(patrolPointId); - patrolRecordDetailStatistics.setPatrolPoint(patrolPointService.selectById(patrolPointId)); - List patrolPointMeasurePoints = patrolPointMeasurePointService.selectListByWhereMPoint(unitId, "where patrol_point_id='" + patrolRecordPatrolRoute.getPatrolPointId() + "'"); - //巡检点下测量点数量 - patrolRecordDetailStatistics.setMpointNum(patrolPointMeasurePoints.size()); - long num_mpoint = 0; - for (PatrolPointMeasurePoint patrolPointMeasurePoint : patrolPointMeasurePoints) { - if (patrolPointMeasurePoint.getmPoint() != null) { - // List mPointHistories = mPointHistoryService.selectListByTableAWhere(bizId, table, wherestr).selectListByTableAWhere(unitId,patrolPointMeasurePoint.getmPoint().getId(),"","","where patrolRecordId ='"+patrolRecordId+"' and patrolPointId='"+patrolPointId+"'"," order by measuredt"); - // if (mPointHistories!=null && mPointHistories.size()>0) { - // num_mpoint++; - // } - } - - } - //巡检点下完成测量点数量 - patrolRecordDetailStatistics.setMpointFinishNum(num_mpoint); - - List patrolPointEquipmentCards = patrolPointEquipmentCardService.selectListByWhere("where patrol_point_id='" + patrolRecordPatrolRoute.getPatrolPointId() + "'"); - String equipmentIds = ""; - for (PatrolPointEquipmentCard patrolPointEquipmentCard : patrolPointEquipmentCards) { - if (!equipmentIds.isEmpty()) { - equipmentIds += "','"; - } - equipmentIds += patrolPointEquipmentCard.getEquipmentCardId(); - } - List mPoints = mPointService.selectListByWhere(unitId, "where equipmentid in('" + equipmentIds + "')"); - patrolRecordDetailStatistics.setMpointNum_Equ(mPoints.size()); - //巡检点下设备测量点数量 - num_mpoint = 0; - for (MPoint mPoint : mPoints) { - - // if ("0512ZJG_p1201d_yx".equals(mPoint.getMpointcode())) { - // System.out.println(); - // } - // List mPointHistories = mPointHistoryService.selectListByTableAWhere(unitId,mPoint.getId(),"","","where patrolRecordId ='"+patrolRecordId+"' and patrolPointId='"+patrolPointId+"'"," order by measuredt"); - // if (mPointHistories!=null && mPointHistories.size()>0) { - // num_mpoint++; - // } - } - //巡检点下设备测量点完成数量 - patrolRecordDetailStatistics.setMpointFinishNum_Equ(num_mpoint); - patrolRecordDetailStatisticsList.add(patrolRecordDetailStatistics); - } - } - return patrolRecordDetailStatisticsList; - } - - public PatrolRecordDetailStatistics getEquipmentPatrolDetailStatistic(String patrolRecordId) { - PatrolRecordDetailStatistics patrolRecordDetailStatistics = new PatrolRecordDetailStatistics(); - String wherestr = " where patrol_record_id = '" + patrolRecordId + "'"; - List totalEquipCount = this.patrolRecordPatrolEquipmentService.selectListByWhere(wherestr); - wherestr += " and status = '" + PatrolRecord.Status_Finish + "'"; - List finishEquipCount = this.patrolRecordPatrolEquipmentService.selectListByWhere(wherestr); - patrolRecordDetailStatistics.setTotalEquipmentNum(totalEquipCount.size()); - patrolRecordDetailStatistics.setFinishEquipmentNum(finishEquipCount.size()); - return patrolRecordDetailStatistics; - } - - /** - * 读取Excel表格的配置文件,中文表头 - * - * @param key - * @return - */ - private String getExcelStr(String key) { - InputStream inStream = MsgService.class.getClassLoader().getResourceAsStream("excelConfig.properties"); - Properties prop = new Properties(); - try { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));//解决读取properties文件中产生中文乱码的问题 - prop.load(bufferedReader); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String str = prop.getProperty(key).replace(" ", "");//去掉空格 - return str; - } - - /** - * 根据指定日期获取当天巡检情况 --巡检总览 - * - * @param wherestr - * @return - */ - @Override - public JSONArray getPatrolRecordDetailsByDay(String wherestr, String unitId) { - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - wherestr += " and unit_id in (" + unitIds + ")"; - } - PatrolRecord patrolRecord = new PatrolRecord(); - //当天巡检计划数 - patrolRecord.setWhere(wherestr + " and patrol_model_id!='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "'"); - List list1 = patrolRecordDao.selectListByWhere(patrolRecord); - //当天巡检临时数 - patrolRecord.setWhere(wherestr + " and patrol_model_id='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "'"); - List list2 = patrolRecordDao.selectListByWhere(patrolRecord); - //当天未开始数 - patrolRecord.setWhere(wherestr + " and status='" + PatrolRecord.Status_Issue + "'"); - List list3 = patrolRecordDao.selectListByWhere(patrolRecord); - //当天进行中数 - patrolRecord.setWhere(wherestr + " and status='" + PatrolRecord.Status_Start + "'"); - List list4 = patrolRecordDao.selectListByWhere(patrolRecord); - //当天巡检完成数 (已完成、部分完成、不处理都算完成) - patrolRecord.setWhere(wherestr + " and (status='" + PatrolRecord.Status_Finish + "' or status='" + PatrolRecord.Status_PartFinish + "' or status='" + PatrolRecord.Status_Undo + "') "); - List list5 = patrolRecordDao.selectListByWhere(patrolRecord); - //当天巡检计划任务完成数 (已完成、部分完成、不处理都算完成) - patrolRecord.setWhere(wherestr + "and patrol_model_id!='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' and (status='" + PatrolRecord.Status_Finish + "' or status='" + PatrolRecord.Status_PartFinish + "' or status='" + PatrolRecord.Status_Undo + "') "); - List list6 = patrolRecordDao.selectListByWhere(patrolRecord); - //当天巡检临时任务完成数 (已完成、部分完成、不处理都算完成) - patrolRecord.setWhere(wherestr + "and patrol_model_id='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' and (status='" + PatrolRecord.Status_Finish + "' or status='" + PatrolRecord.Status_PartFinish + "' or status='" + PatrolRecord.Status_Undo + "') "); - List list7 = patrolRecordDao.selectListByWhere(patrolRecord); - - int allNum = 0;//当天巡检总数 - int planNum = 0;//当天巡检计划数 - int tempNum = 0;//当天巡检临时数 - int notStartNum = 0;//当天未开始数 - int startNum = 0;//当天进行中数 - int finishNum = 0;//当天巡检完成数 - int finishNumPlan = 0;//当天巡检完成数-计划 - int finishNumTemp = 0;//当天巡检完成数-临时 - if (list1 != null) { - planNum = list1.size(); - } else { - planNum = 0; - } - if (list2 != null) { - tempNum = list2.size(); - } else { - tempNum = 0; - } - if (list3 != null) { - notStartNum = list3.size(); - } else { - notStartNum = 0; - } - if (list4 != null) { - startNum = list4.size(); - } else { - startNum = 0; - } - if (list5 != null) { - finishNum = list5.size(); - } else { - finishNum = 0; - } - if (list6 != null) { - finishNumPlan = list6.size(); - } else { - finishNumPlan = 0; - } - if (list7 != null) { - finishNumTemp = list7.size(); - } else { - finishNumTemp = 0; - } - allNum = planNum + tempNum; - - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("allNum", allNum); - jsonObject.put("planNum", planNum); - jsonObject.put("tempNum", tempNum); - jsonObject.put("notStartNum", notStartNum); - jsonObject.put("startNum", startNum); - jsonObject.put("finishNum", finishNum); - jsonObject.put("finishNumPlan", finishNumPlan); - jsonObject.put("finishNumTemp", finishNumTemp); - jsonArray.add(jsonObject); - return jsonArray; - } - - @Override - public com.alibaba.fastjson.JSONObject getPatrolRecordAbnormityNum(String unitId, String dateType, String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数时间类型 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "yy"; - } else if (dateType != null && dateType.equals("month")) { - dateTypeStr = "mm"; - } else { - dateTypeStr = "dd"; - } - - //运行异常数 - String wherestr1 = " where biz_id = '" + unitId + "' and type='" + Abnormity.Type_Run + "' and DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0"; - List list1 = abnormityService.selectSimpleListByWhere(wherestr1); - - //运行异常数-去年同期 - String wherestr1_last = " where biz_id = '" + unitId + "' and type='" + Abnormity.Type_Run + "' and DateDiff(" + dateTypeStr + ",insdt,'" + CommUtil.subplus(patrolDate, "-1", "year") + "')=0"; - List list1_last = abnormityService.selectSimpleListByWhere(wherestr1_last); - - //设备异常数 - String wherestr2 = " where biz_id = '" + unitId + "' and type='" + Abnormity.Type_Equipment + "' and DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0"; - List list2 = abnormityService.selectSimpleListByWhere(wherestr2); - - //设备异常数-去年同期 - String wherestr2_last = " where biz_id = '" + unitId + "' and type='" + Abnormity.Type_Equipment + "' and DateDiff(" + dateTypeStr + ",insdt,'" + CommUtil.subplus(patrolDate, "-1", "year") + "')=0"; - List list2_last = abnormityService.selectSimpleListByWhere(wherestr2_last); - - //维修工单-总数 - String wherestr3 = " where unit_id = '" + unitId + "' and type='" + WorkorderDetail.REPAIR + "' and DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0"; - List list3 = workorderDetailService.selectSimpleListByWhere(wherestr3); - - //维修工单-完成数 - String wherestr4 = " where unit_id = '" + unitId + "' and type='" + WorkorderDetail.REPAIR + "' and DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 and status in ('" + WorkorderDetail.Status_Finish + "','" + WorkorderDetail.Status_Compete + "') "; - List list4 = workorderDetailService.selectSimpleListByWhere(wherestr4); - - //缺陷工单-总数 - String wherestr5 = " where companyId = '" + unitId + "' and type='3' and DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0"; - List list5 = maintenanceDetailServicel.selectSimpleListByWhere(wherestr5); - - //缺陷工单-完成数 - String wherestr6 = " where companyId = '" + unitId + "' and type='3' and DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 and status in ('" + MaintenanceDetail.Status_Finish + "') "; - List list6 = maintenanceDetailServicel.selectSimpleListByWhere(wherestr6); - - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("abnormity_num_all", list1.size() + list2.size()); - jsonObject.put("abnormity_num_run", list1.size()); - jsonObject.put("abnormity_num_equipment", list2.size()); - - if (list1_last != null && list1_last.size() > 0) { - BigDecimal bigDecimal = new BigDecimal(Double.valueOf((list1.size() - list1_last.size())) / Double.valueOf(list1_last.size()) * 100); - bigDecimal = bigDecimal.setScale(0, BigDecimal.ROUND_HALF_UP); - String bigDecimalStr = bigDecimal.toString().replace("-", ""); - if (Double.valueOf((list1.size() - list1_last.size())) / Double.valueOf(list1_last.size()) < 1) { - jsonObject.put("abnormity_num_run_tb", bigDecimalStr + "%⬇"); - } else { - jsonObject.put("abnormity_num_run_tb", bigDecimalStr + "%⬆"); - } - } else { - jsonObject.put("abnormity_num_run_tb", "0%"); - } - - if (list2_last != null && list2_last.size() > 0) { - BigDecimal bigDecimal2 = new BigDecimal(Double.valueOf((list2.size() - list2_last.size())) / Double.valueOf(list2_last.size()) * 100); - bigDecimal2 = bigDecimal2.setScale(0, BigDecimal.ROUND_HALF_UP); - String bigDecimalStr2 = bigDecimal2.toString().replace("-", ""); - if (Double.valueOf((list2.size() - list2_last.size())) / Double.valueOf(list2_last.size()) < 1) { - jsonObject.put("abnormity_num_equipment_tb", bigDecimalStr2 + "%⬇"); - } else { - jsonObject.put("abnormity_num_equipment_tb", bigDecimalStr2 + "%⬆"); - } - } else { - jsonObject.put("abnormity_num_equipment_tb", "0%"); - } - - jsonObject.put("repair_all", list3.size() + list5.size()); - jsonObject.put("repair_num", list3.size()); - jsonObject.put("repair_num_f", list4.size()); - jsonObject.put("defect_num", list5.size()); - jsonObject.put("defect_num_f", list6.size()); -// System.out.println(jsonObject); - return jsonObject; - } - - @Override - public com.alibaba.fastjson.JSONObject getPatrolRecordBanZuByDay(String wherestr, String unitId) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - - String orderstr1 = " order by name "; - String wherestr1 = " where 1=1 and unit_id='" + unitId + "' "; - int all_num = 0; - //循环班组 - List list = this.groupDetailService.selectListByWhere(wherestr1 + orderstr1); - for (GroupDetail groupDetail : list) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("name", groupDetail.getName()); - - //查出该班组下所有的人员Id - String userId = groupDetail.getLeader() + "," + groupDetail.getMembers(); - String[] ids = userId.split(","); - String userIds = ""; - for (String id : ids) { - userIds += "'" + id + "',"; - } - if (userIds != null && !userIds.equals("")) { - userIds = userIds.substring(0, userIds.length() - 1); - } - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr + " and worker_id in (" + userIds + ")"); - //查出班组下人员对应的所有任务 - List list1 = patrolRecordDao.selectListByWhere(patrolRecord); - int c = 0; - for (PatrolRecord patrolRecord1 : list1) { - c += patrolRecord1.getPointNumFinish(); - } - jsonObject.put("value", c); - jsonArray.add(jsonObject); - - all_num += c; - } - - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("data", jsonArray); - jsonObject1.put("allnum", all_num); - return jsonObject1; - } - - @Override - public com.alibaba.fastjson.JSONObject getPatrolRecordBanZuByDay2(String wherestr, String unitId) { - //X轴 - com.alibaba.fastjson.JSONArray jsonArray_x = new com.alibaba.fastjson.JSONArray(); - //所有打卡点位 - com.alibaba.fastjson.JSONArray jsonArray_all = new com.alibaba.fastjson.JSONArray(); - //完成打卡点位 - com.alibaba.fastjson.JSONArray jsonArray_f = new com.alibaba.fastjson.JSONArray(); - - String orderstr1 = " order by name "; - String wherestr1 = " where 1=1 and unit_id='" + unitId + "' "; - //循环班组 - List list = this.groupDetailService.selectListByWhere(wherestr1 + orderstr1); - for (GroupDetail groupDetail : list) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject jsonObject_f = new com.alibaba.fastjson.JSONObject(); - - //查出该班组下所有的人员Id - String userId = groupDetail.getLeader() + "," + groupDetail.getMembers(); - String[] ids = userId.split(","); - String userIds = ""; - for (String id : ids) { - userIds += "'" + id + "',"; - } - if (userIds != null && !userIds.equals("")) { - userIds = userIds.substring(0, userIds.length() - 1); - } - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr + " and worker_id in (" + userIds + ")"); - //查出班组下人员对应的所有任务 - List list1 = patrolRecordDao.selectListByWhere(patrolRecord); - int c = 0; - int c_f = 0; - for (PatrolRecord patrolRecord1 : list1) { - c += patrolRecord1.getPointNumAll(); - c_f += patrolRecord1.getPointNumFinish(); - } - if (c > 0) { - jsonArray_all.add(c); - jsonArray_f.add(c_f); - jsonArray_x.add(groupDetail.getName()); - } - } - - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("x", jsonArray_x); - jsonObject1.put("data_all", jsonArray_all); - jsonObject1.put("data_f", jsonArray_f); - return jsonObject1; - } - - @Override - public com.alibaba.fastjson.JSONObject getPatrolRecordBanZuByDay3(String wherestr, String unitId) { - //X轴 - com.alibaba.fastjson.JSONArray jsonArray_x = new com.alibaba.fastjson.JSONArray(); - //所有打卡点位 - com.alibaba.fastjson.JSONArray jsonArray_all = new com.alibaba.fastjson.JSONArray(); - //完成打卡点位 - com.alibaba.fastjson.JSONArray jsonArray_f = new com.alibaba.fastjson.JSONArray(); - - String orderstr1 = " order by name "; - String wherestr1 = " where 1=1 and unit_id='" + unitId + "' "; - //循环班组 - List list = this.groupDetailService.selectListByWhere(wherestr1 + orderstr1); - for (GroupDetail groupDetail : list) { - //查出该班组下所有的人员Id - String userId = groupDetail.getLeader() + "," + groupDetail.getMembers(); - String[] ids = userId.split(","); - String userIds = ""; - for (String id : ids) { - userIds += "'" + id + "',"; - } - if (userIds != null && !userIds.equals("")) { - userIds = userIds.substring(0, userIds.length() - 1); - } - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr + " and worker_id in (" + userIds + ")"); - //查出班组下人员对应的所有任务 - List list1 = patrolRecordDao.selectListByWhere(patrolRecord); - int c = 0; - int c_f = 0; - for (PatrolRecord patrolRecord1 : list1) { - c += patrolRecord1.getPointNumAll(); - c_f += patrolRecord1.getPointNumFinish(); - } - if (c > 0) { - jsonArray_all.add(c); - jsonArray_f.add(c_f); - jsonArray_x.add(groupDetail.getName()); - } - - } - - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("x", jsonArray_x); - jsonObject1.put("data_all", jsonArray_all); - jsonObject1.put("data_f", jsonArray_f); - return jsonObject1; - } - - @Override - public com.alibaba.fastjson.JSONObject getFinishData(String dateTypeStr, String patrolDate, String unitId) { - String wherestr = " where DateDiff(" + dateTypeStr + ",start_time,'" + patrolDate + "')=0 and unit_id='" + unitId + "'"; - String wherestr2 = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 and worker_id is not null"; - String wherestr3 = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 and updateuser is not null"; - - //完成打卡点位数 - int point_p = 0; - //巡检班组数 - com.alibaba.fastjson.JSONArray jsonArray_banzu_P = new com.alibaba.fastjson.JSONArray(); - //巡检人员数 - Set set_P = new HashSet<>(); - - //完成打卡点位数 - int point_e = 0; - //巡检班组数 - com.alibaba.fastjson.JSONArray jsonArray_banzu_E = new com.alibaba.fastjson.JSONArray(); - //巡检人员数 - Set set_E = new HashSet<>(); - - String orderstr1 = " order by name "; - String wherestr1 = " where 1=1 and unit_id='" + unitId + "' "; - //循环班组 - List list = this.groupDetailService.selectListByWhere(wherestr1 + orderstr1); - for (GroupDetail groupDetail : list) { - //查出该班组下所有的人员Id - String userId = groupDetail.getLeader() + "," + groupDetail.getMembers(); - String[] ids = userId.split(","); - String userIds = ""; - for (String id : ids) { - userIds += "'" + id + "',"; - } - if (userIds != null && !userIds.equals("")) { - userIds = userIds.substring(0, userIds.length() - 1); - } - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr + " and type='P' and worker_id in (" + userIds + ")"); - //查出班组下人员对应的所有任务 - List list1 = patrolRecordDao.selectListByWhere(patrolRecord); - int c = 0; - int c_all = 0; - for (PatrolRecord patrolRecord1 : list1) { - c += patrolRecord1.getPointNumFinish(); - c_all += patrolRecord1.getPointNumAll(); - } - if (c_all > 0) { - point_p += c; - jsonArray_banzu_P.add(groupDetail.getName()); - } - //查询 运行巡检 打卡参与人员 - List list_route_p = patrolRecordPatrolRouteService.selectListGroupByWhere(wherestr2, "worker_id"); - if (list_route_p != null && list_route_p.size() > 0) { - for (int i = 0; i < list_route_p.size(); i++) { - set_P.add(list_route_p.get(i).getWorkerId()); - } - } - - PatrolRecord patrolRecord2 = new PatrolRecord(); - patrolRecord2.setWhere(wherestr + " and type='E' and worker_id in (" + userIds + ")"); - //查出班组下人员对应的所有任务 - List list2 = patrolRecordDao.selectListByWhere(patrolRecord2); - int c_e = 0; - for (PatrolRecord patrolRecord1 : list2) { - c_e += patrolRecord1.getPointNumFinish(); - } - if (c_e > 0) { - point_e += c_e; - jsonArray_banzu_E.add(groupDetail.getName()); - } - //查询 设备巡检 打卡参与人员 - List list_route_e = patrolRecordPatrolEquipmentService.selectListGroupByWhere(wherestr3, "updateuser"); - if (list_route_e != null && list_route_e.size() > 0) { - for (int i = 0; i < list_route_e.size(); i++) { - set_E.add(list_route_e.get(i).getUpdateuser()); - } - } - - } - - com.alibaba.fastjson.JSONObject jsonObject1 = new com.alibaba.fastjson.JSONObject(); - jsonObject1.put("finsh_num_point_P", point_p); - jsonObject1.put("finsh_num_banzu_P", jsonArray_banzu_P.size()); - jsonObject1.put("finsh_num_user_P", set_P.size()); - - jsonObject1.put("finsh_num_point_E", point_e); - jsonObject1.put("finsh_num_banzu_E", jsonArray_banzu_E.size()); - jsonObject1.put("finsh_num_user_E", set_E.size()); - return jsonObject1; - } - - /** - * 查询指定条件的任务数量--巡检总览 sj 2020-04-27 - */ - public JSONArray selectListByNum(String wherestr, String unitId, String dateType, String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - JSONObject jsonObjectForP = new JSONObject();//运行巡检 - JSONObject jsonObjectForE = new JSONObject();//设备巡检 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - - for (int i = 0; i < 12; i++) { - if (i < 9) { - jsonObjectForP.put(patrolDate.substring(0, 4) + "-0" + (i + 1), "0"); - jsonObjectForE.put(patrolDate.substring(0, 4) + "-0" + (i + 1), "0"); - } else { - jsonObjectForP.put(patrolDate.substring(0, 4) + "-" + (i + 1), "0"); - jsonObjectForE.put(patrolDate.substring(0, 4) + "-" + (i + 1), "0"); - } - } - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int i = 0; i < maxDay; i++) { - if (i < 9) { - jsonObjectForP.put(patrolDate.substring(0, 7) + "-0" + (i + 1), "0"); - jsonObjectForE.put(patrolDate.substring(0, 7) + "-0" + (i + 1), "0"); - } else { - jsonObjectForP.put(patrolDate.substring(0, 7) + "-" + (i + 1), "0"); - jsonObjectForE.put(patrolDate.substring(0, 7) + "-" + (i + 1), "0"); - } - } - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - - for (int i = 0; i < 24; i++) { - if (i < 9) { - jsonObjectForP.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObjectForE.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - } else { - jsonObjectForP.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObjectForE.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - } - } - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - unitstr += " and unit_id in (" + unitIds + ")"; - } - - //运行巡检 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " - + " and type='" + PatrolType.Product.getId() + "'" + unitstr; - List listP = this.patrolRecordDao.selectListByNum(wherestr, str); - if (listP != null && listP.size() > 0) { - for (int i = 0; i < listP.size(); i++) { - jsonObjectForP.put(listP.get(i).get_date(), listP.get(i).get_num()); - } - } - //设备巡检 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " - + " and type='" + PatrolType.Equipment.getId() + "'" + unitstr; - List listE = this.patrolRecordDao.selectListByNum(wherestr, str); - if (listE != null && listE.size() > 0) { - for (int i = 0; i < listE.size(); i++) { - jsonObjectForE.put(listE.get(i).get_date(), listE.get(i).get_num()); - } - } - - jsonObject.put("pdata", jsonObjectForP);//运行巡检 - jsonObject.put("edata", jsonObjectForE);//设备巡检 - jsonArray.add(jsonObject); - return jsonArray; - } - - /** - * 查询指定条件的任务数量--巡检总览 sj 2020-04-27 - */ - public JSONArray selectListByNum2(String unitId, String dateType, String patrolDate, String type) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - JSONObject jsonObject_all = new JSONObject();//总任务数 - JSONObject jsonObject_plan = new JSONObject();//计划数 - JSONObject jsonObject_plan_finsh = new JSONObject();//计划完成 - JSONObject jsonObject_temp_finsh = new JSONObject();//临时完成 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - - for (int i = 0; i < 12; i++) { - jsonObject_all.put((i + 1) + "月", "0"); - jsonObject_plan.put((i + 1) + "月", "0"); - jsonObject_plan_finsh.put((i + 1) + "月", "0"); - jsonObject_temp_finsh.put((i + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int i = 0; i < maxDay; i++) { - jsonObject_all.put((i + 1), "0"); - jsonObject_plan.put((i + 1), "0"); - jsonObject_plan_finsh.put((i + 1), "0"); - jsonObject_temp_finsh.put((i + 1), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - - for (int i = 0; i < 24; i++) { - if (i < 9) { - jsonObject_all.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_plan.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_plan_finsh.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_temp_finsh.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - } else { - jsonObject_all.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_plan.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_plan_finsh.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_temp_finsh.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - } - } - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - unitstr += " and unit_id in (" + unitIds + ")"; - } - - //总任务数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "'" + unitstr; - List list_all = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_all != null && list_all.size() > 0) { - for (int i = 0; i < list_all.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_all.put(Integer.valueOf(list_all.get(i).get_date().substring(5, list_all.get(i).get_date().length())) + "月", list_all.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_all.put(Integer.valueOf(list_all.get(i).get_date().substring(8, list_all.get(i).get_date().length())), list_all.get(i).get_num()); - } else { - jsonObject_all.put(list_all.get(i).get_date(), list_all.get(i).get_num()); - } - } - } - //计划任务数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "' and patrol_model_id!='temp' " + unitstr; - List list_plan = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_plan != null && list_plan.size() > 0) { - for (int i = 0; i < list_plan.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_plan.put(Integer.valueOf(list_plan.get(i).get_date().substring(5, list_plan.get(i).get_date().length())) + "月", list_plan.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_plan.put(Integer.valueOf(list_plan.get(i).get_date().substring(8, list_plan.get(i).get_date().length())), list_plan.get(i).get_num()); - } else { - jsonObject_plan.put(list_plan.get(i).get_date(), list_plan.get(i).get_num()); - } - } - } - //计划任务完成数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "' and patrol_model_id!='temp' and status in ('" + PatrolRecord.Status_Finish + "','" + PatrolRecord.Status_PartFinish + "') " + unitstr; - List list_plan_finsh = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_plan_finsh != null && list_plan_finsh.size() > 0) { - for (int i = 0; i < list_plan_finsh.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_plan_finsh.put(Integer.valueOf(list_plan_finsh.get(i).get_date().substring(5, list_plan_finsh.get(i).get_date().length())) + "月", list_plan_finsh.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_plan_finsh.put(Integer.valueOf(list_plan_finsh.get(i).get_date().substring(8, list_plan_finsh.get(i).get_date().length())), list_plan_finsh.get(i).get_num()); - } else { - jsonObject_plan_finsh.put(list_plan_finsh.get(i).get_date(), list_plan_finsh.get(i).get_num()); - } - } - } - //临时任务完成数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "' and patrol_model_id='temp' and status in ('" + PatrolRecord.Status_Finish + "','" + PatrolRecord.Status_PartFinish + "')" + unitstr; - List list_temp_finsh = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_temp_finsh != null && list_temp_finsh.size() > 0) { - for (int i = 0; i < list_temp_finsh.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_temp_finsh.put(Integer.valueOf(list_temp_finsh.get(i).get_date().substring(5, list_temp_finsh.get(i).get_date().length())) + "月", list_temp_finsh.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_temp_finsh.put(Integer.valueOf(list_temp_finsh.get(i).get_date().substring(8, list_temp_finsh.get(i).get_date().length())), list_temp_finsh.get(i).get_num()); - } else { - jsonObject_temp_finsh.put(list_temp_finsh.get(i).get_date(), list_temp_finsh.get(i).get_num()); - } - } - } - - jsonObject.put("jsonObject_all", jsonObject_all);//总任务数 - jsonObject.put("jsonObject_plan", jsonObject_plan);//计划任务数 - jsonObject.put("jsonObject_plan_finsh", jsonObject_plan_finsh);//计划任务完成数 - jsonObject.put("jsonObject_temp_finsh", jsonObject_temp_finsh);//临时任务完成数 - jsonArray.add(jsonObject); - return jsonArray; - } - - /** - * 查询指定条件的任务数量--巡检总览 sj 2020-04-27 - */ - public JSONArray selectListByNum3(String wherestr, String unitId, String dateType, String patrolDate) { - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - net.sf.json.JSONObject jsonObject = new net.sf.json.JSONObject(); - net.sf.json.JSONObject jsonObject_repair = new net.sf.json.JSONObject();// - net.sf.json.JSONObject jsonObject_main = new net.sf.json.JSONObject();// - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - - for (int i = 0; i < 12; i++) { - jsonObject_repair.put((i + 1) + "月", "0"); - jsonObject_main.put((i + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int i = 0; i < maxDay; i++) { - jsonObject_repair.put((i + 1), "0"); - jsonObject_main.put((i + 1), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - - for (int i = 0; i < 24; i++) { - if (i < 9) { - jsonObject_repair.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_main.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - } else { - jsonObject_repair.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_main.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - } - } - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = CommUtil.getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - unitstr += " and unit_id in (" + unitIds + ")"; - } - - //维修工单 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr + " and type = 'repair' "; - List listP = this.workorderDetailService.selectListByNum(wherestr, str); - if (listP != null && listP.size() > 0) { - for (int i = 0; i < listP.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_repair.put(Integer.valueOf(listP.get(i).get_date().substring(5, listP.get(i).get_date().length())) + "月", listP.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_repair.put(Integer.valueOf(listP.get(i).get_date().substring(8, listP.get(i).get_date().length())), listP.get(i).get_num()); - } else { - jsonObject_repair.put(listP.get(i).get_date(), listP.get(i).get_num()); - } - } - } - - if (unitIds != null && !unitIds.equals("")) { - unitstr = " and companyId in (" + unitIds + ")"; - } - //缺陷工单 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + unitstr; - List listE = this.maintenanceDetailServicel.selectListByNum(wherestr, str); - if (listE != null && listE.size() > 0) { - for (int i = 0; i < listE.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_main.put(Integer.valueOf(listE.get(i).get_date().substring(5, listE.get(i).get_date().length())) + "月", listE.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_main.put(Integer.valueOf(listE.get(i).get_date().substring(8, listE.get(i).get_date().length())), listE.get(i).get_num()); - } else { - jsonObject_main.put(listE.get(i).get_date(), listE.get(i).get_num()); - } - } - } - - jsonObject.put("repairData", jsonObject_repair);//维修工单 - jsonObject.put("mainData", jsonObject_main);//缺陷工单 - jsonArray.add(jsonObject); - return jsonArray; - } - - /** - * 根据右上角的筛选获取车间临时列表---巡检总览 sj 2020-05-22 - */ - public List getPatrolRecordByTask(String wherestr, String unitId) { - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - wherestr += " and unit_id in (" + unitIds + ")"; - } - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List patrolRecords = patrolRecordDao.selectListByWhere(patrolRecord); - for (PatrolRecord item : patrolRecords) { - PatrolModel patrolModel = patrolModelService.selectById(item.getPatrolModelId()); - item.setPatrolModel(patrolModel); - fixColor(item); - User user = userService.getUserById(item.getWorkerId()); - item.setWorker(user); - } - return patrolRecords; - } - - /** - * 递归获取子节点 - * - * @param - */ - public List getChildren(String pid, List t) { - List t2 = new ArrayList(); - for (int i = 0; i < t.size(); i++) { - if (t.get(i).getPid() != null && t.get(i).getPid().equalsIgnoreCase(pid)) { - if (t.get(i).getType().equals(CommString.UNIT_TYPE_WORKSHOP)) { - t2.add(t.get(i)); - List result = getChildren(t.get(i).getId(), t); - if (result != null) { - t2.addAll(result); - } - } - } - } - return t2; - } - - public List getPatrolRecordByStatus(String wherestr, String unitId, String st) { - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - wherestr += " and unit_id in (" + unitIds + ")"; - } - - if (st != null && st.equals(TimeEfficiencyCommStr.Patrol_Type_Plan)) { - wherestr += " and patrol_model_id!='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' "; - } - if (st != null && st.equals(TimeEfficiencyCommStr.Patrol_Type_Temp)) { - wherestr += " and patrol_model_id='" + TimeEfficiencyCommStr.PatrolModel_TempTask + "' "; - } - if (st != null && st.equals(TimeEfficiencyCommStr.Patrol_Type_Unstart)) { - wherestr += " and status='" + PatrolRecord.Status_Issue + "' "; - } - if (st != null && st.equals(TimeEfficiencyCommStr.Patrol_Type_Progress)) { - wherestr += " and status='" + PatrolRecord.Status_Start + "' "; - } - if (st != null && st.equals(TimeEfficiencyCommStr.Patrol_Type_Finish)) { - wherestr += " and (status='" + PatrolRecord.Status_Finish + "' or status='" + PatrolRecord.Status_PartFinish + "' or status='" + PatrolRecord.Status_Undo + "') "; - } - //当天巡检计划数 - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List list = patrolRecordDao.selectListByWhere(patrolRecord); - for (PatrolRecord item : list) { - PatrolModel patrolModel = patrolModelService.selectById(item.getPatrolModelId()); - item.setPatrolModel(patrolModel); - fixColor(item); - User user = userService.getUserById(item.getWorkerId()); - item.setWorker(user); - } - return list; - } - - - @Override//返回运行巡检记录下 巡检点列表的json(APP) - public JSONArray getPointJson4Product(String patrolRecordId) { - String wherestr = " where patrol_record_id='" + patrolRecordId + "' and type = '" + PatrolRoute.Point_0 + "' order by morder"; - List list = this.patrolRecordPatrolRouteService.selectListByWhere(wherestr); - JSONArray jsonArray = new JSONArray(); - if (list != null && list.size() > 0) { - for (PatrolRecordPatrolRoute item : list) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item.getPatrolPointId()); - jsonObject.put("recordId", item.getId()); - jsonObject.put("name", item.getPatrolPoint().getName()); - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Point); - jsonObject.put("status", item.getStatus()); - jsonObject.put("processSectionId", item.getPatrolPoint().getProcessSectionId()); - if (item.getPatrolPoint().getProcessSection() != null) { - jsonObject.put("processSectionName", item.getPatrolPoint().getProcessSection().getName()); - } - jsonObject.put("workerId", "" + (item.getWorker() == null ? "" : item.getWorker().getId())); - jsonObject.put("workerName", "" + (item.getWorker() == null ? "" : item.getWorker().getCaption())); - jsonObject.put("finishDt", "" + (item.getFinishdt() == null ? "" : item.getFinishdt())); - jsonArray.add(jsonObject); - } - } - return jsonArray; - } - - - @Override//返回设备巡检记录下 巡检点和设备的json(APP) - public JSONArray getPointAndEquipJson4Equipment(String patrolRecordId) { - List str = new ArrayList(); - JSONArray jsonArray = new JSONArray(); - Set pointSet = new HashSet<>(); - - String wherestr1 = " where patrol_record_id='" + patrolRecordId + "' order by morder"; - List list1 = this.patrolRecordPatrolEquipmentService.selectListByWhere(wherestr1); - if (list1 != null && list1.size() > 0) { - for (PatrolRecordPatrolEquipment item : list1) { - String equipmentId = item.getEquipmentId(); - List list2 = patrolPointEquipmentCardService.selectListByWhere("where 1=1 and equipment_card_id = '" + equipmentId + "'"); - for (PatrolPointEquipmentCard patrolPointEquipmentCard : list2) { - PatrolPoint patrolPoint = patrolPointService.selectById(patrolPointEquipmentCard.getPatrolPointId()); - if (patrolPoint != null && patrolPoint.getType().equals(TimeEfficiencyCommStr.PatrolType_Equipment)) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", patrolPoint.getId()); - jsonObject.put("recordId", patrolRecordId); - jsonObject.put("name", patrolPoint.getName()); - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Point); - - //查找路线表是否完成 - String wherestr2 = " where patrol_record_id='" + patrolRecordId + "' and patrol_point_id = '" + patrolPoint.getId() + "'"; - List list_patrolRoute = this.patrolRecordPatrolRouteService.selectListByWhere(wherestr2); - if (list_patrolRoute != null && list_patrolRoute.size() > 0) { - jsonObject.put("status", list_patrolRoute.get(0).getStatus()); - jsonObject.put("workerId", "" + (list_patrolRoute.get(0).getWorker() == null ? "" : list_patrolRoute.get(0).getWorker().getId())); - jsonObject.put("workerName", "" + (list_patrolRoute.get(0).getWorker() == null ? "" : list_patrolRoute.get(0).getWorker().getCaption())); - jsonObject.put("finishDt", "" + (list_patrolRoute.get(0).getFinishdt() == null ? "" : list_patrolRoute.get(0).getFinishdt())); - } - - if (pointSet.add(patrolPoint.getId())) { - jsonArray.add(jsonObject); - } - - str.add(item.getPatrolPointId()); - } - } - } - } - - jsonArray.sort(Comparator.comparing(obj -> ((JSONObject) obj).getString("name"))); - - //查控制箱 - String wherestr2 = " where patrol_record_id='" + patrolRecordId + "' order by morder"; - List list2 = this.patrolRecordPatrolEquipmentService.selectListByWhere(wherestr2); - if (list2 != null && list2.size() > 0) { - for (PatrolRecordPatrolEquipment item : list2) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("id", item.getEquipmentId()); - jsonObject.put("recordId", item.getPatrolRecordId()); - jsonObject.put("name", item.getEquipmentCard().getEquipmentname()); - jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment); - jsonObject.put("status", item.getStatus()); - jsonObject.put("processSectionId", item.getEquipmentCard().getProcesssectionid()); - if (item.getEquipmentCard().getProcessSection() != null) { - jsonObject.put("processSectionName", item.getEquipmentCard().getProcessSection().getName()); - } - jsonObject.put("workerId", "" + (item.getUser() == null ? "" : item.getUser().getCaption())); - jsonObject.put("finishDt", "" + (item.getUpdatedt() == null ? "" : item.getUpdatedt())); - - if (str.contains(item.getPatrolPointId())) { - } else { - jsonArray.add(jsonObject); - } - } - } - - return jsonArray; - } - - @Transactional - public int submit(PatrolRecord entity, String json, String start) { - //修改记录中的路线顺序 - patrolRecordPatrolRouteService.updateByRecord(entity.getId()); - //保存gps - if (json != null && !json.trim().equals("")) { - saveGPS(entity.getId(), json); - } - - //获取所有的该任务参与人员 - List routeList = this.patrolRecordPatrolRouteService - .selectListByWhere(" where patrol_record_id = '" + entity.getId() + "' "); - Set set = new HashSet(); - for (PatrolRecordPatrolRoute patrolRoute : routeList) { - if (patrolRoute.getWorkerId() != null && !patrolRoute.getWorkerId().equals("")) { - set.add(patrolRoute.getWorkerId()); - } - } - - //该任务是由几个人完成的 作为平均工时的人数 - int num = 0; - if (set != null && set.size() > 0) { - num = set.size(); - //先删除任务下所有工时分配 - workorderAchievementService.deleteByWhere("where pid = '" + entity.getId() + "'"); - WorkorderAchievement workorderAchievement = new WorkorderAchievement(); - Iterator it = set.iterator(); - while (it.hasNext()) { - //进行工时的平均分配 - workorderAchievement.setId(CommUtil.getUUID()); - workorderAchievement.setUserId(it.next() + ""); - workorderAchievement.setParticipateContent("参与巡检"); - workorderAchievement.setProjectRole("巡检人员"); - workorderAchievement.setWorkTime(Float.parseFloat(entity.getDuration() + "") / num / 60); - workorderAchievement.setPid(entity.getId()); - workorderAchievement.setType(WorkorderAchievement.Type_PatrolRecord); - workorderAchievementService.save(workorderAchievement); - } - } - if (StringUtils.isNotBlank(start) && "1".equals(start) && StringUtils.isBlank(entity.getProcessid())) { - this.start(entity); - } - - //巡检记录设置为完成 - return patrolRecordDao.updateByPrimaryKeySelective(entity); - } - - /** - * 解析离线gps-json - * - * @param id 任务id - * @param json 离线json - */ - public void saveGPS(String id, String json) { - JSONObject jsonObject = JSONObject.fromObject(json); - JSONArray jsonArray = jsonObject.getJSONArray("re1"); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jObject2 = jsonArray.getJSONObject(i); - WorkerPosition workerPosition = new WorkerPosition(); - workerPosition.setId(CommUtil.getUUID()); - workerPosition.setInsdt(jObject2.getString("insdt")); - workerPosition.setInsuser(jObject2.getString("userid")); - BigDecimal latitude = new BigDecimal(jObject2.getString("latitude")); - workerPosition.setLatitude(latitude.toString()); - BigDecimal longitude = new BigDecimal(jObject2.getString("longitude")); - workerPosition.setLongitude(longitude.toString()); - workerPosition.setPatrolRecordId(id); - workerPositionService.save(workerPosition); - } - } - - public int updateStatus(String id, String status) { - PatrolRecord entity = this.selectById(id); - entity.setStatus(status); - int res = this.update(entity); - return res; - } - - @Transactional - @Override - public int receivePatrolRecord4App(String json) { - com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(json); - if (jsonObject != null && !jsonObject.isEmpty()) { - com.alibaba.fastjson.JSONArray jsonArray = jsonObject.getJSONArray("patrolRecordPatrolRoutes"); - if (jsonArray != null && jsonArray.size() > 0) { - //循环巡检点 - for (int i = 0; i < jsonArray.size(); i++) { - com.alibaba.fastjson.JSONObject jsonObject2 = com.alibaba.fastjson.JSONObject.parseObject(jsonArray.get(i).toString()); - - //更新(巡检点)状态 - PatrolRecordPatrolRoute patrolRecordPatrolRoute = patrolRecordPatrolRouteService.selectById(jsonObject2.get("patrolRecordPatrolRouteId").toString()); - patrolRecordPatrolRoute.setStatus(jsonObject2.get("status").toString()); - patrolRecordPatrolRoute.setFinishdt(jsonObject2.get("finishDt").toString()); - patrolRecordPatrolRoute.setWorkerId(jsonObject2.get("workerId").toString()); - int res1 = patrolRecordPatrolRouteService.update(patrolRecordPatrolRoute); - - //解析巡检点下(巡检内容) - com.alibaba.fastjson.JSONArray jsonArray3 = jsonObject2.getJSONArray("patrolContentsRecords"); - if (jsonArray3 != null && jsonArray3.size() > 0) { - for (int j = 0; j < jsonArray3.size(); j++) { - com.alibaba.fastjson.JSONObject jsonObject3 = com.alibaba.fastjson.JSONObject.parseObject(jsonArray3.get(j).toString()); - - //更新巡检点里面(巡检内容)状态 - PatrolContentsRecord patrolContentsRecord = patrolContentsRecordService.selectById(jsonObject3.get("sid").toString()); - patrolContentsRecord.setStatus(jsonObject3.get("status").toString()); - int res2 = patrolContentsRecordService.update(patrolContentsRecord); - } - } - - //解析巡检点下(填报内容) - com.alibaba.fastjson.JSONArray jsonArray4 = jsonObject2.getJSONArray("patrolMeasurePointRecords"); - if (jsonArray4 != null && jsonArray4.size() > 0) { - for (int j = 0; j < jsonArray4.size(); j++) { - com.alibaba.fastjson.JSONObject jsonObject3 = com.alibaba.fastjson.JSONObject.parseObject(jsonArray4.get(j).toString()); - - //更新巡检点里面(巡检内容)状态 - PatrolMeasurePointRecord patrolMeasurePointRecord = patrolMeasurePointRecordService.selectById(jsonObject3.get("sid").toString()); -// patrolMeasurePointRecord.setMpvalue(new BigDecimal(jsonObject3.get("parmvalue").toString())); - patrolMeasurePointRecord.setMpvalue(jsonObject3.get("parmvalue").toString()); - int res3 = patrolMeasurePointRecordService.update(patrolMeasurePointRecord); - } - } - - //解析巡检点下(设备) - com.alibaba.fastjson.JSONArray jsonArray5 = jsonObject2.getJSONArray("patrolRecordPatrolEquipments"); - if (jsonArray5 != null && jsonArray5.size() > 0) { - for (int j = 0; j < jsonArray5.size(); j++) { - com.alibaba.fastjson.JSONObject jsonObject3 = com.alibaba.fastjson.JSONObject.parseObject(jsonArray5.get(j).toString()); - - //更新巡检点里面(设备)状态 - PatrolRecordPatrolEquipment patrolRecordPatrolEquipment = patrolRecordPatrolEquipmentService.selectById(jsonObject3.get("sid").toString()); - patrolRecordPatrolEquipment.setStatus(jsonObject3.get("status").toString()); - int res4 = patrolRecordPatrolEquipmentService.update(patrolRecordPatrolEquipment); - - //解析巡检点下(巡检内容) - com.alibaba.fastjson.JSONArray jsonArray6 = jsonObject3.getJSONArray("patrolContentsRecords"); - if (jsonArray6 != null && jsonArray6.size() > 0) { - for (int k = 0; k < jsonArray6.size(); k++) { - com.alibaba.fastjson.JSONObject jsonObject6 = com.alibaba.fastjson.JSONObject.parseObject(jsonArray6.get(k).toString()); - - //更新巡检点里面(巡检内容)状态 - PatrolContentsRecord patrolContentsRecord = patrolContentsRecordService.selectById(jsonObject6.get("sid").toString()); - patrolContentsRecord.setStatus(jsonObject6.get("status").toString()); - int res5 = patrolContentsRecordService.update(patrolContentsRecord); - } - } - - //解析巡检点下(填报内容) - com.alibaba.fastjson.JSONArray jsonArray7 = jsonObject3.getJSONArray("patrolMeasurePointRecords"); - if (jsonArray7 != null && jsonArray7.size() > 0) { - for (int k = 0; k < jsonArray7.size(); k++) { - com.alibaba.fastjson.JSONObject jsonObject7 = com.alibaba.fastjson.JSONObject.parseObject(jsonArray7.get(k).toString()); - - //更新巡检点里面(巡检内容)状态 - PatrolMeasurePointRecord patrolMeasurePointRecord = patrolMeasurePointRecordService.selectById(jsonObject7.get("sid").toString()); -// patrolMeasurePointRecord.setMpvalue(new BigDecimal(jsonObject7.get("parmvalue").toString())); - patrolMeasurePointRecord.setMpvalue(jsonObject7.get("parmvalue").toString()); - int res6 = patrolMeasurePointRecordService.update(patrolMeasurePointRecord); - } - } - - } - } - - - } - } - } - - - return 0; - } - - /** - * 运行设备巡检使用 - * - * @param userId - * @param wherestr - * @param orderstr - * @param unitId - * @param type - * @return - */ - @Override - public Set selectListByUserId(String userId, String wherestr, String orderstr, String unitId, String type) { - Set patrolRecordIds = new HashSet(); - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List list = patrolRecordDao.selectListByWhere(patrolRecord); - // 1.循环今天所有的任务 - for (PatrolRecord pd : list) { -// PatrolPlan patrolPlan = patrolPlanService.selectById(pd.getPatrolPlanId()); -// if (patrolPlan != null) { - String nowTime = CommUtil.nowDate(); - // 2.查询该任务属于的班组 是否存在排班 - List list_s = this.schedulingService.selectListByWhere(" where (stdt<='" + nowTime + "' and eddt>='" + nowTime + "') and schedulingtype='" + pd.getGroupTypeId() + "' and bizid='" + unitId + "' "); - if (list_s != null && list_s.size() > 0) { - Scheduling scheduling = list_s.get(0); - if (scheduling != null && scheduling.getWorkpeople() != null && scheduling.getWorkpeople().contains(userId)) { - //在排班中则继续筛选区域条件 - String ids = ""; - if (pd.getPatrolAreaId() != null && !pd.getPatrolAreaId().trim().equals("")) { - String[] areaId = pd.getPatrolAreaId().split(","); - for (String s : areaId) { - ids += "'" + s + "',"; - } - ids = ids.substring(0, ids.length() - 1);//去掉逗号 - } else { - ids += "'false'"; - } - // 3.查询人员是否在该任务对应的区域下 - List list_a = patrolAreaUserService.selectListByWhere("where patrol_area_id in (" + ids + ")"); - if (list_a != null && list_a.size() > 0) { - for (PatrolAreaUser patrolAreaUser : list_a) { - if (userId.equals(patrolAreaUser.getUserId())) { - //该任务符合条件 - patrolRecordIds.add(pd.getId()); - } else { - - } - } - } else { - //直接添加(暂定) - patrolRecordIds.add(pd.getId()); - } - - } else { - //不在排班中则看不到任何任务 - } - } else { - List list_dept = patrolRecordDeptService.selectListByWhere("where patrol_record_id='" + pd.getId() + "'"); - for (PatrolRecordDept patrolRecordDept : list_dept) { - GroupDetail groupDetail = groupDetailService.selectById(patrolRecordDept.getDeptId()); - if (groupDetail != null) { - //判断是否为该组---组长 - if (groupDetail.getLeader() != null && !groupDetail.getLeader().trim().equals("")) { - if (userId.equals(groupDetail.getLeader())) { - //该任务符合条件 - patrolRecordIds.add(pd.getId()); - } - } - - //判断是否为该组---组员 - if (groupDetail.getMembers() != null && !groupDetail.getMembers().trim().equals("")) { - String[] zuyuanIds = groupDetail.getMembers().split(","); - for (String s : zuyuanIds) { - if (userId.equals(s)) { - //该任务符合条件 - patrolRecordIds.add(pd.getId()); - } - } - } - - } - } - } -// } else { -// patrolRecordIds.add(pd.getId()); -// } - - } - return patrolRecordIds; - } - - @Override - public Set selectListByUserIdSafe(String userId, String wherestr, String orderstr, String unitId, String type) { - Set patrolRecordIds = new HashSet(); - - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List list = patrolRecordDao.selectListByWhere(patrolRecord); - // 1.循环今天所有的任务 - for (PatrolRecord pd : list) { - List list_dept = patrolRecordDeptService.selectListByWhere("where patrol_record_id='" + pd.getId() + "'"); - for (PatrolRecordDept patrolPlanDept : list_dept) { - GroupDetail groupDetail = groupDetailService.selectById(patrolPlanDept.getDeptId()); - if (groupDetail != null) { - //判断是否为该组---组长 - if (groupDetail.getLeader() != null && !groupDetail.getLeader().trim().equals("")) { - if (userId.equals(groupDetail.getLeader())) { - //该任务符合条件 - patrolRecordIds.add(pd.getId()); - } - } - - //判断是否为该组---组员 - if (groupDetail.getMembers() != null && !groupDetail.getMembers().trim().equals("")) { - String[] zuyuanIds = groupDetail.getMembers().split(","); - for (String s : zuyuanIds) { - if (userId.equals(s)) { - //该任务符合条件 - patrolRecordIds.add(pd.getId()); - } - } - } - - } - } - } - return patrolRecordIds; - } - - @Transactional - public int start(PatrolRecord entity) { - try { - Map variables = new HashMap(); - if (entity.getReceiveUserId() != null && !entity.getReceiveUserId().isEmpty()) { - variables.put(CommString.ACTI_KEK_Candidate_Users, entity.getReceiveUserId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - - List processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Patrol_Record.getId() + "-" + entity.getBizId()); - - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(entity.getId(), entity.getWorkerId(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - entity.setProcessid(processInstance.getId()); - entity.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = this.update(entity); - if (res == 1) { - - } - - String[] split = entity.getReceiveUserId().split(","); - for (int i = 0; i < split.length; i++) { - //发送消息 - entity.setReceiveUserId(split[i]); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecord.sendMessage(split[i], ""); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public com.alibaba.fastjson.JSONArray getPatrolRecordFloorData(String unitId, String patrolDate, String type) { - com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray(); - List list = patrolAreaFloorService.selectListByWhere("where 1=1 and unit_id = '" + unitId + "'"); - for (PatrolAreaFloor patrolAreaFloor : list) { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("floor_id", patrolAreaFloor.getId()); - jsonObject.put("floor_name", patrolAreaFloor.getName()); - - //未完成的 - String where = "where m.unit_id = '" + unitId + "' and m.type = '" + type + "' and datediff(DAY,m.start_time,'" + patrolDate + "')=0 and f.id = '" + patrolAreaFloor.getId() + "' and r.status=3"; - List list_record = patrolRecordDao.getPatrolRecordFloorData(where); - jsonObject.put("num_complete", list_record.size()); - - //总数 - String where2 = "where m.unit_id = '" + unitId + "' and m.type = '" + type + "' and datediff(DAY,m.start_time,'" + patrolDate + "')=0 and f.id = '" + patrolAreaFloor.getId() + "'"; - List list_record2 = patrolRecordDao.getPatrolRecordFloorData(where2); - jsonObject.put("num_all", list_record2.size()); - - jsonArray.add(jsonObject); - } - return jsonArray; - } - - @Override - public List getPatrolRecord4AreaId(String wherestr, String groupWhere, String orderWhere) { - List patrolRecords = patrolRecordDao.getPatrolRecord4AreaId(wherestr, groupWhere, orderWhere); - return patrolRecords; - } - - @Override - public JSONArray getAnalysisData(String unitId, String dateType, String patrolDate, String type) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - - JSONObject jsonObject_all = new JSONObject();//总任务数 - JSONObject jsonObject_plan = new JSONObject();//计划数 - JSONObject jsonObject_plan_finsh = new JSONObject();//计划完成 - JSONObject jsonObject_temp_finsh = new JSONObject();//临时完成 - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - - for (int i = 0; i < 12; i++) { - jsonObject_all.put((i + 1) + "月", "0"); - jsonObject_plan.put((i + 1) + "月", "0"); - jsonObject_plan_finsh.put((i + 1) + "月", "0"); - jsonObject_temp_finsh.put((i + 1) + "月", "0"); - } - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - - String yearStr = patrolDate.substring(0, 4); - String monthStr = patrolDate.substring(5, 7); - int maxDay = DateUtil.getMaxDayByYearMonth(Integer.parseInt(yearStr), Integer.parseInt(monthStr)); - for (int i = 0; i < maxDay; i++) { - jsonObject_all.put((i + 1), "0"); - jsonObject_plan.put((i + 1), "0"); - jsonObject_plan_finsh.put((i + 1), "0"); - jsonObject_temp_finsh.put((i + 1), "0"); - } - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - - for (int i = 0; i < 24; i++) { - if (i < 9) { - jsonObject_all.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_plan.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_plan_finsh.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - jsonObject_temp_finsh.put(patrolDate.substring(0, 10) + " 0" + (i + 1), "0"); - } else { - jsonObject_all.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_plan.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_plan_finsh.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - jsonObject_temp_finsh.put(patrolDate.substring(0, 10) + " " + (i + 1), "0"); - } - } - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - unitstr += " and unit_id in (" + unitIds + ")"; - } - - //总任务数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "'" + unitstr; - List list_all = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_all != null && list_all.size() > 0) { - for (int i = 0; i < list_all.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_all.put(Integer.valueOf(list_all.get(i).get_date().substring(5, list_all.get(i).get_date().length())) + "月", list_all.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_all.put(Integer.valueOf(list_all.get(i).get_date().substring(8, list_all.get(i).get_date().length())), list_all.get(i).get_num()); - } else { - jsonObject_all.put(list_all.get(i).get_date(), list_all.get(i).get_num()); - } - } - } - //计划任务数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "' and patrol_model_id!='temp' " + unitstr; - List list_plan = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_plan != null && list_plan.size() > 0) { - for (int i = 0; i < list_plan.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_plan.put(Integer.valueOf(list_plan.get(i).get_date().substring(5, list_plan.get(i).get_date().length())) + "月", list_plan.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_plan.put(Integer.valueOf(list_plan.get(i).get_date().substring(8, list_plan.get(i).get_date().length())), list_plan.get(i).get_num()); - } else { - jsonObject_plan.put(list_plan.get(i).get_date(), list_plan.get(i).get_num()); - } - } - } - //计划任务完成数 - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "' and status in ('" + PatrolRecord.Status_Finish + "','" + PatrolRecord.Status_PartFinish + "') " + unitstr; - List list_plan_finsh = this.patrolRecordDao.selectListByNum(wherestr, str); - if (list_plan_finsh != null && list_plan_finsh.size() > 0) { - for (int i = 0; i < list_plan_finsh.size(); i++) { - if ("year".equals(dateType)) { - jsonObject_plan_finsh.put(Integer.valueOf(list_plan_finsh.get(i).get_date().substring(5, list_plan_finsh.get(i).get_date().length())) + "月", list_plan_finsh.get(i).get_num()); - } else if ("month".equals(dateType)) { - jsonObject_plan_finsh.put(Integer.valueOf(list_plan_finsh.get(i).get_date().substring(8, list_plan_finsh.get(i).get_date().length())), list_plan_finsh.get(i).get_num()); - } else { - jsonObject_plan_finsh.put(list_plan_finsh.get(i).get_date(), list_plan_finsh.get(i).get_num()); - } - } - } - - jsonObject.put("jsonObject_all", jsonObject_all);//总任务数 - jsonObject.put("jsonObject_plan", jsonObject_plan);//计划任务数 - jsonObject.put("jsonObject_plan_finsh", jsonObject_plan_finsh);//计划任务完成数 - jsonArray.add(jsonObject); - return jsonArray; - } - - @Override - public JSONObject getAnalysisData2(String unitId, String dateType, String patrolDate, String type) { - String wherestr = ""; - String dateTypeStr = "";//用于DateDiff函数日期类型 - String str = "";//用于切割日期时候 10为年月日 7为年月 - JSONObject jsonObject = new JSONObject(); - - if (dateType != null && dateType.equals("year")) { - dateTypeStr = "year"; - str = "7"; - } - if (dateType != null && dateType.equals("month")) { - dateTypeStr = "month"; - str = "10"; - } - if (dateType != null && dateType.equals("day")) { - dateTypeStr = "day"; - str = "13"; - } - String unitstr = ""; - List t = new ArrayList(); - t = unitService.selectListByWhere(" where active='" + CommString.Flag_Active + "' order by morder"); - String pid = unitId; - String unitIds = "'" + unitId + "',"; - ;//车间ids 先将自己的id加上去 - List units_c = getChildren(pid, t); - //查询自己层级下的所有车间 - if (units_c != null && units_c.size() > 0) { - for (int i = 0; i < units_c.size(); i++) { - unitIds += "'" + units_c.get(i).getId() + "',"; - } - } - //去掉最后一位字符 - unitIds = unitIds.substring(0, unitIds.length() - 1); - - if (unitIds != null && !unitIds.equals("")) { - unitstr += " and unit_id in (" + unitIds + ")"; - } - - wherestr = " where DateDiff(" + dateTypeStr + ",insdt,'" + patrolDate + "')=0 " + " and type='" + type + "'" + unitstr; - PatrolRecord patrolRecord = new PatrolRecord(); - patrolRecord.setWhere(wherestr); - List list_all = this.patrolRecordDao.selectListByWhere(patrolRecord); - - int wb = 0; - int nj = 0; - int xj = 0; - if (list_all != null && list_all.size() > 0) { - for (int i = 0; i < list_all.size(); i++) { -// PatrolPlan patrolPlan = patrolPlanService.selectSimpleById(list_all.get(i).getPatrolPlanId()); - //维保任务 - if (list_all.get(i).getTaskType() != null && list_all.get(i).getTaskType().equals("363cc2a731ff4c67ae3f22d9e903149d")) { - wb += 1; - } - //年检任务 - if (list_all.get(i).getTaskType() != null && list_all.get(i).getTaskType().equals("be941e16d0a74aa4b752603b666e6b3f")) { - nj += 1; - } - //巡检任务 - if (list_all.get(i).getTaskType() != null && list_all.get(i).getTaskType().equals("db0bc6cb7de84f8b8b462a3758a5609f")) { - xj += 1; - } - } - } - jsonObject.put("wb", wb); - jsonObject.put("nj", nj); - jsonObject.put("xj", xj); - return jsonObject; - } - - @Override - public JSONObject getPatrolRecordGroup(String patrolRecordId) { - JSONObject jsonObject = new JSONObject(); - PatrolRecord patrolRecord = patrolRecordDao.selectByPrimaryKey(patrolRecordId); - if (patrolRecord != null) { - //班组类型 - GroupType groupType = groupTypeService.selectById(patrolRecord.getGroupTypeId()); - if (groupType != null) { - jsonObject.put("groupTypeName", groupType.getName()); - } else { - jsonObject.put("groupTypeName", ""); - } - List list = patrolRecordDeptService.selectListByWhere(" where patrol_record_id = '" + patrolRecordId + "'"); - String names = ""; - for (PatrolRecordDept patrolRecordDept : list) { - GroupDetail groupDetail = groupDetailService.selectSimpleById(patrolRecordDept.getDeptId()); - if (groupDetail != null) { - names += groupDetail.getName() + ","; - } - } - if (names != null && !names.equals("")) { - names = names.substring(0, names.length() - 1); - } - jsonObject.put("taskGroupName", names); - } - return jsonObject; - } - -} - diff --git a/src/com/sipai/service/timeefficiency/impl/PatrolRouteServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/PatrolRouteServiceImpl.java deleted file mode 100644 index 3003a985..00000000 --- a/src/com/sipai/service/timeefficiency/impl/PatrolRouteServiceImpl.java +++ /dev/null @@ -1,553 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.timeefficiency.*; -import com.sipai.entity.user.ProcessSection; -import com.sipai.service.timeefficiency.*; -import com.sipai.service.user.ProcessSectionService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.timeefficiency.PatrolRouteDao; -import com.sipai.tools.CommUtil; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service("patrolRouteService") -public class PatrolRouteServiceImpl implements PatrolRouteService { - @Resource - private PatrolRouteDao patrolRouteDao; - @Resource - private PatrolPointService patrolPointService; - @Resource - private PatrolRecordService patrolRecordService; - @Resource - private PatrolRecordPatrolRouteService patrolRecordPatrolRouteService; - @Resource - private PatrolContentsPlanService patrolContentsPlanService; - @Resource - private PatrolMeasurePointPlanService patrolMeasurePointPlanService; - @Resource - private PatrolAreaFloorService patrolAreaFloorService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private PatrolPlanPatrolEquipmentService patrolPlanPatrolEquipmentService; - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#selectById(java.lang.String) - */ - @Override - public PatrolRoute selectById(String id) { - return patrolRouteDao.selectByPrimaryKey(id); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#deleteById(java.lang.String) - */ - @Override - public int deleteById(String id) { - return patrolRouteDao.deleteByPrimaryKey(id); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#deletePoint(java.lang.String, java.lang.String, java.lang.String) - */ - @Override - @Transactional - public int deletePoint(String id, String previousId, String nextId) { - try { - int res = this.deleteById(id); - if (res == 0) { - throw new RuntimeException(); - } - PatrolRoute patrolRoute = this.selectById(previousId); - if (patrolRoute != null) { - patrolRoute.setNextId(nextId); - res = this.update(patrolRoute); - if (res == 0) { - throw new RuntimeException(); - } - } - patrolRoute = this.selectById(nextId); - if (patrolRoute != null) { - patrolRoute.setPreviousId(previousId); - res = this.update(patrolRoute); - if (res == 0) { - throw new RuntimeException(); - } - } - return res; - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - throw new RuntimeException(); - } - - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#save(com.sipai.entity.timeefficiency.PatrolRoute) - */ - @Override - @Transactional - - public int save(PatrolRoute entity) { - try { - int res = patrolRouteDao.insert(entity); - if (res == 1) { - String previousId = entity.getPreviousId(); - String nextId = entity.getNextId(); - if (previousId != null && !previousId.isEmpty()) { - PatrolRoute patrolRoute = this.selectById(previousId); - patrolRoute.setNextId(entity.getId()); - res = this.update(patrolRoute); - if (res == 0) { - throw new RuntimeException(); - } - } - if (nextId != null && !nextId.isEmpty()) { - PatrolRoute patrolRoute = this.selectById(nextId); - patrolRoute.setPreviousId(entity.getId()); - res = this.update(patrolRoute); - if (res == 0) { - throw new RuntimeException(); - } - } - - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#update(com.sipai.entity.timeefficiency.PatrolRoute) - */ - @Override - public int update(PatrolRoute entity) { - return patrolRouteDao.updateByPrimaryKeySelective(entity); - } - - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#selectListByWhere(java.lang.String) - */ - @Override - public List selectListByWhere(String wherestr) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setWhere(wherestr); - List patrolRoutes = patrolRouteDao.selectListByWhere(patrolRoute); - for (PatrolRoute item : patrolRoutes) { - if (TimeEfficiencyCommStr.PatrolRoutType_PatrolPoint.equals(item.getType())) { - PatrolPoint patrolPoint = patrolPointService.selectById(item.getPatrolPointId()); - item.setPatrolPoint(patrolPoint); - } - } - patrolRoutes = sort(patrolRoutes); - return patrolRoutes; - } - - @Override - public List selectSimpleListByWhere(String wherestr) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setWhere(wherestr); - List patrolRoutes = patrolRouteDao.selectListByWhere(patrolRoute); - return patrolRoutes; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#selectListWithRecord(java.lang.String, java.lang.String) - */ - @Override - public List selectListWithRecord(String patrolRecordId, String floorId) { - String wherestr = "where patrol_record_id ='" + patrolRecordId + "' "; - if (floorId != null && !floorId.isEmpty()) { - wherestr += " and floor_id='" + floorId + "'"; - } - String orderstr = " order by finishdt asc"; - List patrolRecordPatrolRoutes = patrolRecordPatrolRouteService.selectListByWhere(wherestr + orderstr); - //根据链表结构进行排序 - patrolRecordPatrolRoutes = sortRecord(patrolRecordPatrolRoutes); - return patrolRecordPatrolRoutes; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#deleteByWhere(java.lang.String) - */ - @Override - public int deleteByWhere(String wherestr) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setWhere(wherestr); - return patrolRouteDao.deleteByWhere(patrolRoute); - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#sort(java.util.List) - */ - @Override - public List sort(List source) { - List dest = new ArrayList<>(); - List last = new ArrayList<>(); - //寻找所有尾结点,并存储 - Iterator iterator = source.iterator(); - while (iterator.hasNext()) { - PatrolRoute item_src = (PatrolRoute) iterator.next(); - if (item_src.getPreviousId() == null || item_src.getPreviousId().isEmpty()) { - last.add(item_src); - iterator.remove(); - } - } - //按尾节点 巡检链表上的其它节点 - for (PatrolRoute item_last : last) { - iterator = source.iterator(); - List parent = new ArrayList<>(); - parent.add(item_last); - while (iterator.hasNext()) { - PatrolRoute item_src = (PatrolRoute) iterator.next(); - //若查询到父节点则在存储后,重新查 - if (parent.get(parent.size() - 1).getId().equals(item_src.getPreviousId())) { - parent.add(item_src); - iterator.remove(); - iterator = source.iterator(); - } - } - dest.addAll(parent); - } - //存储其它异常的节点 - dest.addAll(source); - return dest; - } - - /* (non-Javadoc) - * @see com.sipai.service.timeefficiency.impl.PatrolRouteService#sortRecord(java.util.List) - */ - @Override - public List sortRecord(List source) { - List dest = new ArrayList<>(); - List last = new ArrayList<>(); - //寻找所有尾结点,并存储 - Iterator iterator = source.iterator(); - while (iterator.hasNext()) { - PatrolRecordPatrolRoute item_src = (PatrolRecordPatrolRoute) iterator.next(); - if (item_src.getPreviousId() == null || item_src.getPreviousId().isEmpty()) { - last.add(item_src); - iterator.remove(); - } - } - //按尾节点 巡检链表上的其它节点 - for (PatrolRecordPatrolRoute item_last : last) { - iterator = source.iterator(); - List parent = new ArrayList<>(); - parent.add(item_last); - while (iterator.hasNext()) { - PatrolRecordPatrolRoute item_src = (PatrolRecordPatrolRoute) iterator.next(); - //若查询到父节点则在存储后,重新查 - if (parent.get(parent.size() - 1).getPatrolRouteId().equals(item_src.getPreviousId())) { - parent.add(item_src); - iterator.remove(); - iterator = source.iterator(); - } - } - dest.addAll(parent); - } - //存储其它异常的节点 - dest.addAll(source); - return dest; - } - - @Override - public List selectListByPlan(String wherestr) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setWhere(wherestr); - List patrolRoutes = patrolRouteDao.selectListByWhere(patrolRoute); - for (PatrolRoute item : patrolRoutes) { - if (TimeEfficiencyCommStr.PatrolRoutType_PatrolPoint.equals(item.getType())) { - PatrolPoint patrolPoint = patrolPointService.selectById(item.getPatrolPointId()); - item.setPatrolPoint(patrolPoint); - } - PatrolAreaFloor patrolAreaFloor = patrolAreaFloorService.selectById(item.getFloorId()); - if (patrolAreaFloor != null) { - item.setPatrolAreaFloor(patrolAreaFloor); - } - //查询该点关联的巡检内容数 - List list = patrolContentsPlanService.selectListByWhere(" where patrol_plan_id='" + item.getPatrolPlanId() + "' and patrol_point_id='" + item.getPatrolPointId() + "' "); - item.setPatrolContentNum(list.size() + ""); - //查询该点关联的填报内容数 - List list2 = patrolMeasurePointPlanService.selectListByWhere(" where patrol_plan_id='" + item.getPatrolPlanId() + "' and patrol_point_id='" + item.getPatrolPointId() + "' "); - item.setMeasurePointContentNum(list2.size() + ""); - //查询该点关联的设备数 - List list3 = patrolPlanPatrolEquipmentService.selectListByWhere(" where patrol_plan_id='" + item.getPatrolPlanId() + "' and patrol_point_id='" + item.getPatrolPointId() + "' "); - item.setEquipmentNum(list3.size() + ""); - } - return patrolRoutes; - } - - @Override - public List selectListByPlanSafe(String wherestr) { - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setWhere(wherestr); - List patrolRoutes = patrolRouteDao.selectListByWhere(patrolRoute); - for (PatrolRoute item : patrolRoutes) { - PatrolPoint patrolPoint = patrolPointService.selectByIdSafe(item.getPatrolPointId()); - item.setPatrolPoint(patrolPoint); - //查询该点关联的设备数 - List list3 = patrolPlanPatrolEquipmentService.selectListByWhere(" where patrol_plan_id='" + item.getPatrolPlanId() + "' and patrol_point_id='" + item.getPatrolPointId() + "' "); - item.setEquipmentNum(list3.size() + ""); - } - return patrolRoutes; - } - - @Override - public int saveByPlan(String patrolPlanId, String patrolPointIds, String userId) { - int res = 0; - PatrolRoute patrolRoute = new PatrolRoute(); - - //获取上一次存的巡检点信息 - patrolRoute.setWhere(" where patrol_plan_id='" + patrolPlanId + "' order by morder"); - List list = patrolRouteDao.selectListByWhere(patrolRoute); - List oldPointIds = new ArrayList();//存上一次保存巡检点id的数组 - String oldids = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - oldPointIds.add(list.get(i).getPatrolPointId()); - } - } - - HashSet str = new HashSet<>(); - if (patrolPointIds != null && !patrolPointIds.equals("")) { - String[] patrolPointId = patrolPointIds.split(","); - if (patrolPointId != null) { - //String[] uids = new String[patrolPointId.length]; - for (int i = 0; i < patrolPointId.length; i++) { - //uids[i] = CommUtil.getUUID(); - - PatrolPoint patrolPoint = patrolPointService.selectById(patrolPointId[i]); - if (patrolPoint != null) { - str.add(patrolPoint.getFloorId()); - } - - //取出本次与上次 都有的巡检点id - int index = oldPointIds.indexOf(patrolPointId[i]); - if (index != -1) { - oldids = oldids + "'" + patrolPointId[i] + "',"; - } else { - - } - } - - int lastmorder = 0; - - //取出上一次保存的最大morder作为新巡检点的morder - if (oldids != null && !oldids.equals("")) { - oldids = oldids.substring(0, oldids.length() - 1); - patrolRoute.setWhere(" where patrol_plan_id='" + patrolPlanId + "' and patrol_point_id in (" + oldids + ") order by morder desc"); - List list2 = patrolRouteDao.selectListByWhere(patrolRoute); - if (list2 != null) { - lastmorder = list2.get(0).getMorder(); - } - } - - //先改顺序保存巡检点 - for (int i = 0; i < patrolPointId.length; i++) { - patrolRoute.setWhere(" where patrol_plan_id='" + patrolPlanId + "' and patrol_point_id = '" + patrolPointId[i] + "'"); - List list2 = patrolRouteDao.selectListByWhere(patrolRoute); - if (list2 != null && list2.size() > 0) { - //已存在 - } else { - //新勾选的 - patrolRoute.setId(CommUtil.getUUID()); - patrolRoute.setInsdt(CommUtil.nowDate()); - patrolRoute.setInsuser(userId); - patrolRoute.setPatrolPlanId(patrolPlanId);//巡检计划id - patrolRoute.setType("0"); - lastmorder = lastmorder + 1; - patrolRoute.setMorder(lastmorder); - patrolRoute.setPatrolPointId(patrolPointId[i]); - BigDecimal bigDecimal_x = new BigDecimal(200 + i * 20); - BigDecimal bigDecimal_y = new BigDecimal(80); - BigDecimal bigDecimal_width = new BigDecimal(0); - BigDecimal bigDecimal_height = new BigDecimal(0); - patrolRoute.setPosx(bigDecimal_x); - patrolRoute.setPosy(bigDecimal_y); - patrolRoute.setContainerWidth(bigDecimal_width); - patrolRoute.setContainerHeight(bigDecimal_height); - - PatrolPoint patrolPoint = patrolPointService.selectById(patrolPointId[i]); - if (patrolPoint != null) { - patrolRoute.setFloorId(patrolPoint.getFloorId()); - } - - int prouteres = patrolRouteDao.insert(patrolRoute); - //res = res + prouteres; - } - } - //删除上一次勾选但本次没有勾选的巡检点 - List newPointIds = new ArrayList(); - for (int i = 0; i < patrolPointId.length; i++) { - newPointIds.add(patrolPointId[i]); - } - for (int i = 0; i < oldPointIds.size(); i++) { - int index = newPointIds.indexOf(oldPointIds.get(i)); - if (index != -1) { - System.out.println("存在--无需操作"); - } else { - //删除对应关联的巡检点 - patrolRoute.setWhere(" where patrol_plan_id='" + patrolPlanId + "' and patrol_point_id = '" + oldPointIds.get(i) + "'"); - //巡检记录巡检内容 - this.patrolContentsPlanService.deleteByWhere(" where patrol_plan_id='" + patrolPlanId + "' and patrol_point_id = '" + oldPointIds.get(i) + "'"); - //巡检记录填报因素 - this.patrolMeasurePointPlanService.deleteByWhere(" where patrol_plan_id='" + patrolPlanId + "' and patrol_point_id = '" + oldPointIds.get(i) + "'"); - patrolRouteDao.deleteByWhere(patrolRoute); - //删除对应关联的巡检内容及填报内容 - - } - } - - Iterator iterator = str.iterator(); - while (iterator.hasNext()) { - //最后进行线的连接 - PatrolRoute patrolRoute2 = new PatrolRoute(); - patrolRoute2.setWhere(" where patrol_plan_id='" + patrolPlanId + "' and floor_id = '" + iterator.next() + "' order by morder asc "); - List list2 = patrolRouteDao.selectListByWhere(patrolRoute2); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - patrolRoute2.setId(list2.get(i).getId()); - //第一个点 - if (i == 0) { - if (list2.size() == 1) { - patrolRoute2.setPreviousId(""); - patrolRoute2.setNextId(""); - } else { - patrolRoute2.setPreviousId(""); - patrolRoute2.setNextId(list2.get(i + 1).getId()); - } - } - //最后一个点 - else if (i == list2.size() - 1) { - patrolRoute2.setPreviousId(list2.get(i - 1).getId()); - patrolRoute2.setNextId(""); - } - //中间点位 - else { - patrolRoute2.setPreviousId(list2.get(i - 1).getId()); - patrolRoute2.setNextId(list2.get(i + 1).getId()); - } - patrolRoute2.setMorder(i); - int prouteres = patrolRouteDao.updateByPrimaryKeySelective(patrolRoute2); - res = res + prouteres; - } - } - } - - } - } else { - - //patrolRoute.setWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id = '"+patrolPointId[i]+"'"); - //List list2 = patrolRouteDao.selectListByWhere(patrolRoute); - //删除对应关联的巡检点 - //patrolRoute.setWhere("where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id = '"+oldPointIds.get(i)+"'"); - //巡检记录巡检内容 - //this.patrolContentsPlanService.deleteByWhere(" where patrol_plan_id='"+patrolPlanId+"' and patrol_point_id = '"+oldPointIds.get(i)+"'"); - //巡检记录填报因素 - patrolRoute.setWhere("where patrol_plan_id='" + patrolPlanId + "'"); - patrolRouteDao.deleteByWhere(patrolRoute); - } - return res; - } - - @Override - public int updateByPlan(String patrolPlanId, String ids) { - int res = 0; - HashSet str = new HashSet<>(); - if (ids != null && !ids.equals("")) { - String[] id = ids.split(","); - if (id != null) { - for (int i = 0; i < id.length; i++) { - PatrolRoute patrolRoute = patrolRouteDao.selectByPrimaryKey(id[i]); - if (patrolRoute != null) { - str.add(patrolRoute.getFloorId()); - } - } - - Iterator iterator = str.iterator(); - while (iterator.hasNext()) { - //最后进行线的连接 - PatrolRoute patrolRoute2 = new PatrolRoute(); - patrolRoute2.setWhere(" where patrol_plan_id='" + patrolPlanId + "' and floor_id = '" + iterator.next() + "' order by morder asc "); - List list2 = patrolRouteDao.selectListByWhere(patrolRoute2); - if (list2 != null && list2.size() > 0) { - for (int i = 0; i < list2.size(); i++) { - - PatrolRoute patrolRoute = new PatrolRoute(); - patrolRoute.setId(list2.get(i).getId()); - patrolRoute.setMorder(i); - //第一个点 - if (i == 0) { - patrolRoute.setPreviousId(""); - patrolRoute.setNextId(list2.get(i + 1).getId()); - } - //最后一个点 - else if (i == list2.size() - 1) { - patrolRoute.setPreviousId(list2.get(i - 1).getId()); - patrolRoute.setNextId(""); - } - //中间点位 - else { - patrolRoute.setPreviousId(list2.get(i - 1).getId()); - patrolRoute.setNextId(list2.get(i + 1).getId()); - } - int prouteres = patrolRouteDao.updateByPrimaryKeySelective(patrolRoute); - res = res + prouteres; - } - } - - } - } - } - return res; - } - - @Override - public int deleteByPlan(String id, String previousId, String nextId) { - try { - int res = this.deleteById(id); - if (res == 0) { - throw new RuntimeException(); - } - PatrolRoute patrolRoute = this.selectById(previousId); - if (patrolRoute != null) { - patrolRoute.setNextId(nextId); - res = this.update(patrolRoute); - if (res == 0) { - throw new RuntimeException(); - } - } - patrolRoute = this.selectById(nextId); - if (patrolRoute != null) { - patrolRoute.setPreviousId(previousId); - res = this.update(patrolRoute); - if (res == 0) { - throw new RuntimeException(); - } - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - - } -} diff --git a/src/com/sipai/service/timeefficiency/impl/WorkRecordServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/WorkRecordServiceImpl.java deleted file mode 100644 index e999bb33..00000000 --- a/src/com/sipai/service/timeefficiency/impl/WorkRecordServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.WorkRecordDao; -import com.sipai.entity.timeefficiency.WorkRecord; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.WorkRecordService; -import com.sipai.service.user.UserService; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class WorkRecordServiceImpl implements WorkRecordService{ - @Resource - private WorkRecordDao workRecordDao; -// @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UserService userService; - - @Override - public WorkRecord selectById(String id) { - return workRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return workRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WorkRecord entity) { - return workRecordDao.insert(entity); - } - - @Override - public int update(WorkRecord entity) { - return workRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WorkRecord workRecord = new WorkRecord(); - workRecord.setWhere(wherestr); - List workRecords = this.workRecordDao.selectListByWhere(workRecord); - for(WorkRecord item :workRecords ){ - User user = userService.getUserById(item.getReportperson()); - item.setUser(user); - } - return workRecords; - } - - @Override - public int deleteByWhere(String wherestr) { - WorkRecord workRecord = new WorkRecord(); - workRecord.setWhere(wherestr); - return workRecordDao.deleteByWhere(workRecord); - } - -} diff --git a/src/com/sipai/service/timeefficiency/impl/WorkerPositionServiceImpl.java b/src/com/sipai/service/timeefficiency/impl/WorkerPositionServiceImpl.java deleted file mode 100644 index 1f8d96cd..00000000 --- a/src/com/sipai/service/timeefficiency/impl/WorkerPositionServiceImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.service.timeefficiency.impl; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.Resource; - -import com.sipai.entity.user.UserDetail; -import com.sipai.service.user.UserDetailService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.dao.timeefficiency.PatrolRecordDao; -import com.sipai.dao.timeefficiency.PatrolRecordPatrolPointDao; -import com.sipai.dao.timeefficiency.PatrolRecordPatrolRouteDao; -import com.sipai.dao.timeefficiency.WorkerPositionDao; -import com.sipai.dao.user.UserDao; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolPoint; -import com.sipai.entity.timeefficiency.PatrolRecordPatrolRoute; -import com.sipai.entity.timeefficiency.WorkerPosition; -import com.sipai.entity.user.User; -import com.sipai.service.timeefficiency.WorkerPositionService; -import com.sipai.service.user.UserService; - -//@Service(version=CommString.DUBBO_VERSION_PATROL) -@Service -public class WorkerPositionServiceImpl implements WorkerPositionService { - @Resource - private WorkerPositionDao workerPositionDao; - @Resource - private PatrolRecordDao patrolRecordDao; - @Resource - private PatrolRecordPatrolRouteDao patrolRecordPatrolRouteDao; - // @Reference(version=CommString.DUBBO_VERSION_BASE,check=false) - @Resource - private UserService userService; - @Resource - private UserDetailService userDetailService; - @Resource - private RedissonClient redissonClient; - - @Override - public WorkerPosition selectById(String id) { - return workerPositionDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return workerPositionDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WorkerPosition entity) { - return workerPositionDao.insert(entity); - } - - @Override - public int update(WorkerPosition entity) { - return workerPositionDao.updateByPrimaryKeySelective(entity); - } - - @Override - public JSONArray selectListByWhere(String patrolRecordId) { - String sdt = "";//目前按开始时间 - String edt = "";//目前按提交时间 - List userList = new ArrayList<>(); - JSONArray jsonArray = new JSONArray(); - //查询巡检记录表详情 - PatrolRecord patrolRecord = patrolRecordDao.selectByPrimaryKey(patrolRecordId); - if (patrolRecord != null) { - if (patrolRecord.getActFinishTime() != null) { - sdt = patrolRecord.getStartTime(); - edt = patrolRecord.getActFinishTime(); - - //循环下面所有巡检点表 - PatrolRecordPatrolRoute patrolRecordPatrolRoute = new PatrolRecordPatrolRoute(); - patrolRecordPatrolRoute.setWhere(" where patrol_record_id = '" + patrolRecord.getId() + "' and worker_id is not null"); -// patrolRecordPatrolRoute.setWhere(" where patrol_record_id = '" + patrolRecord.getId() + "' and insuser is not null"); - List pointList = patrolRecordPatrolRouteDao.selectListByWhere(patrolRecordPatrolRoute); - for (int i = 0; i < pointList.size(); i++) { - userList.add(pointList.get(i).getWorkerId()); -// userList.add(pointList.get(i).getInsuser()); - } - Set set1 = new HashSet(); - List newList = new ArrayList();//去重后的数组 - for (String str : userList) { - if (set1.add(str)) { - newList.add(str); - } - } - if (newList != null) { - //循环去重后的人员列表 - for (int i = 0; i < newList.size(); i++) { - JSONObject jsonObject = new JSONObject(); -// String sqlstr = " where worker_id='" + newList.get(i) + "' and dttime>='" + sdt + "' and dttime<='" + edt + "' order by dttime"; - String sqlstr = " where insuser='" + newList.get(i) + "' and insdt>='" + sdt + "' and insdt<='" + edt + "' order by insdt asc"; - System.out.println(sqlstr); - WorkerPosition workerPosition = new WorkerPosition(); - workerPosition.setWhere(sqlstr); - //根据人员列表去查询每个人的巡检轨迹 - List workList = workerPositionDao.selectListByWhere(workerPosition); - JSONArray jsonArray2 = new JSONArray(); - if (workList != null && workList.size() > 0) { - System.out.println(newList.get(i) + ":有数据:" + workList.size()); - for (int j = 0; j < workList.size(); j++) { - JSONObject jsonObject2 = new JSONObject(); - if (workList.get(j).getLongitude() != null) { - jsonObject2.put("lng", Double.parseDouble(workList.get(j).getLongitude()));//经度 - } else { - jsonObject2.put("lng", null);//经度 - } - if (workList.get(j).getLatitude() != null) { - jsonObject2.put("lat", Double.parseDouble(workList.get(j).getLatitude()));//纬度 - } else { - jsonObject2.put("lat", null);//纬度 - } - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("userId", newList.get(i)); - User user = userService.getUserById(newList.get(i) + ""); - UserDetail userDetail = this.userDetailService.selectByUserId(newList.get(i) + ""); - if (user != null) { - jsonObject.put("userName", user.getCaption()); - } - if (user != null) { - if (userDetail != null) { - jsonObject.put("icon", userDetail.getIcon()); - } else { - jsonObject.put("icon", ""); - } - } else { - jsonObject.put("icon", ""); - } - jsonObject.put("data", jsonArray2); - jsonArray.add(jsonObject); - } - } - } - } - return jsonArray; - } - - @Override - public int deleteByWhere(String wherestr) { - WorkerPosition workerPosition = new WorkerPosition(); - workerPosition.setWhere(wherestr); - return workerPositionDao.deleteByWhere(workerPosition); - } - - @Override - public int realtimePosition(WorkerPosition entity) { - RMap map_redis = redissonClient.getMap(CommString.REDIS_KEY_TYPE_RealtimePosition); - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("time", CommUtil.nowDate()); - jsonObject.put("latitude", entity.getLatitude()); - jsonObject.put("longitude", entity.getLongitude()); - map_redis.fastPutAsync(entity.getInsuser(), jsonObject); - return 1; - } -} diff --git a/src/com/sipai/service/user/BonusPointRecordService.java b/src/com/sipai/service/user/BonusPointRecordService.java deleted file mode 100644 index 4ad3b334..00000000 --- a/src/com/sipai/service/user/BonusPointRecordService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.user; -import java.util.List; - -import javax.annotation.Resource; - - - - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.BonusPointDao; -import com.sipai.dao.user.BonusPointRecordDao; -import com.sipai.entity.user.BonusPoint; -import com.sipai.entity.user.BonusPointRecord; -import com.sipai.tools.CommService; - -@Service -public class BonusPointRecordService implements CommService{ - @Resource - private BonusPointRecordDao bonusPointRecordDao; - @Override - public BonusPointRecord selectById(String id) { - return bonusPointRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return bonusPointRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(BonusPointRecord entity) { - return bonusPointRecordDao.insert(entity); - } - - @Override - public int update(BonusPointRecord entity) { - return bonusPointRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BonusPointRecord bonusPointRecord = new BonusPointRecord(); - bonusPointRecord.setWhere(wherestr); - List bonusPointRecords = bonusPointRecordDao.selectListByWhere(bonusPointRecord); - return bonusPointRecords; - } - - @Override - public int deleteByWhere(String wherestr) { - BonusPointRecord bonusPointRecord = new BonusPointRecord(); - bonusPointRecord.setWhere(wherestr); - return bonusPointRecordDao.deleteByWhere(bonusPointRecord); - } -} diff --git a/src/com/sipai/service/user/BonusPointService.java b/src/com/sipai/service/user/BonusPointService.java deleted file mode 100644 index abd6e0b5..00000000 --- a/src/com/sipai/service/user/BonusPointService.java +++ /dev/null @@ -1,524 +0,0 @@ -package com.sipai.service.user; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.Resource; - - - - - - - - - - - - - - - - - - -import org.kohsuke.rngom.digested.DDataPattern; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.user.BonusPointDao; -import com.sipai.entity.business.BusinessUnitHandleDetail; -import com.sipai.entity.maintenance.Maintenance; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.user.BonusPoint; -import com.sipai.entity.user.BonusPointRecord; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class BonusPointService implements CommService{ - @Resource - private BonusPointDao bonusPointDao; - @Resource - private BonusPointRecordService bonusPointRecordService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Override - public BonusPoint selectById(String id) { - return bonusPointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return bonusPointDao.deleteByPrimaryKey(id); - } - /** - * 增加积分 - * */ - @Transactional - @Override - public int save(BonusPoint entity) { - - int res=0; - try { - //新增积分只能是正数,如果是非正数则不保存 - if (entity.getPoint()!=null && entity.getPoint()>0) { - res=bonusPointDao.insert(entity); - if (res==1) { - BonusPointRecord bonusPointRecord = new BonusPointRecord(); - bonusPointRecord.setId(CommUtil.getUUID()); - bonusPointRecord.setInsdt(CommUtil.nowDate()); - bonusPointRecord.setInsuser(entity.getInsuser()); - bonusPointRecord.setUserid(entity.getUserid()); - bonusPointRecord.setPoint((long)entity.getPoint()); - String reason =entity.getPointTypeDescription(); - bonusPointRecord.setReason(reason); - int resp=bonusPointRecordService.save(bonusPointRecord); - if (resp!=1) { - throw new RuntimeException(); - } - } - - } - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - return res; - } - /** - * 增加积分,包含客户发单和补录 - * */ - @Transactional - public int saveBonusPoint(Maintenance maintenance) { - int res =0; - try { - //完成后统一计算积分,评价不涉及流程需重新调用 - if (Maintenance.Status_Finish.equals(maintenance.getStatus())) { - Date date = new Date(); - Calendar cal = Calendar.getInstance(); - cal.setTime(date);//设置起时间 - cal.add(Calendar.YEAR, 1);//增加一年 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String edt =simpleDateFormat.format(cal.getTime()); - BonusPoint bonusPoint = new BonusPoint(); - switch (maintenance.getType()) { - case Maintenance.TYPE_MAINTENANCE: - //问题发起人 - String launcher = maintenance.getInsuser(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsdt(CommUtil.nowDate()); - bonusPoint.setInsuser(launcher); - bonusPoint.setUserid(launcher); - bonusPoint.setPoint(BonusPoint.Type_Problem_Launch); - bonusPoint.setType("Type_Problem_Launch"); - bonusPoint.setEdt(edt); - this.save(bonusPoint); - //问题发布人 - String applicant = maintenance.getApplicantid(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(applicant); - bonusPoint.setUserid(applicant); - bonusPoint.setPoint(BonusPoint.Type_Problem_Submit); - bonusPoint.setType("Type_Problem_Submit"); - this.save(bonusPoint); - //维护单管理人 - String manager = maintenance.getManagerid(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(manager); - bonusPoint.setUserid(manager); - bonusPoint.setPoint(BonusPoint.Type_Maintenance_Manager); - bonusPoint.setType("Type_Maintenance_Manager"); - this.save(bonusPoint); - //维护单处理人,处理人只加一次 - List handlers = new ArrayList<>(); - List maintenanceDetails =maintenanceDetailService.selectListByWhere("where maintenanceid='"+maintenance.getId()+"'"); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid='"+maintenanceDetail.getId()+"'"); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handlers.add(businessUnitHandleDetail.getInsuser()); - } - } - if (handlers.size()>0) { - Set set =new HashSet(); - set.addAll(handlers); - handlers.clear(); - handlers.addAll(set); - for (String handler : handlers) { - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(handler); - bonusPoint.setUserid(handler); - bonusPoint.setPoint(BonusPoint.Type_Maintenance_Handle); - bonusPoint.setType("Type_Maintenance_Handle"); - this.save(bonusPoint); - } - - } - saveBonusPoint_Judge(maintenance); - break; - case Maintenance.TYPE_SUPPLEMENT: - //补录只计算运维人员积分,维护单处理人,处理人只加一次 - handlers = new ArrayList<>(); - maintenanceDetails =maintenanceDetailService.selectListByWhere("where maintenanceid='"+maintenance.getId()+"'"); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid='"+maintenanceDetail.getId()+"'"); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handlers.add(businessUnitHandleDetail.getInsuser()); - } - } - if (handlers.size()>0) { - Set set =new HashSet(); - set.addAll(handlers); - handlers.clear(); - handlers.addAll(set); - for (String handler : handlers) { - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsdt(CommUtil.nowDate()); - bonusPoint.setInsuser(handler); - bonusPoint.setEdt(edt); - bonusPoint.setUserid(handler); - bonusPoint.setPoint(BonusPoint.Type_Maintenance_Supplement); - bonusPoint.setType("Type_Maintenance_Supplement"); - this.save(bonusPoint); - } - - } - break; - default: - break; - } - } - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - return res; - } - /** - * 增加积分,包含运维商发任务和保养 - * */ - @Transactional - public int saveBonusPoint(MaintenanceDetail maintenanceDetail) { - int res =0; - try { - //完成后统一计算积分,评价不涉及流程需重新调用 - if (MaintenanceDetail.Status_Finish.equals(maintenanceDetail.getStatus())) { - Date date = new Date(); - Calendar cal = Calendar.getInstance(); - cal.setTime(date);//设置起时间 - cal.add(Calendar.YEAR, 1);//增加一年 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String edt =simpleDateFormat.format(cal.getTime()); - BonusPoint bonusPoint = new BonusPoint(); - switch (maintenanceDetail.getType()) { - case Maintenance.TYPE_MAINTENANCE: - //维护任务发起人 - String insuser = maintenanceDetail.getInsuser(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(insuser); - bonusPoint.setUserid(insuser); - bonusPoint.setInsdt(CommUtil.nowDate()); - bonusPoint.setEdt(edt); - bonusPoint.setPoint(BonusPoint.Type_TaskDetail); - bonusPoint.setType("Type_TaskDetail"); - this.save(bonusPoint); - //维护单处理人,处理人只加一次 - List handlers = new ArrayList<>(); - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid='"+maintenanceDetail.getId()+"'"); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handlers.add(businessUnitHandleDetail.getInsuser()); - } - if (handlers.size()>0) { - Set set =new HashSet(); - set.addAll(handlers); - handlers.clear(); - handlers.addAll(set); - for (String handler : handlers) { - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(handler); - bonusPoint.setUserid(handler); - bonusPoint.setPoint(BonusPoint.Type_TaskDetail); - bonusPoint.setType("Type_TaskDetail"); - this.save(bonusPoint); - } - - } - - break; - case Maintenance.TYPE_MAINTAIN: - //保养任务发起人 - insuser = maintenanceDetail.getInsuser(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(insuser); - bonusPoint.setInsdt(CommUtil.nowDate()); - bonusPoint.setUserid(insuser); - bonusPoint.setEdt(edt); - bonusPoint.setPoint(BonusPoint.Type_Maintenance_Maintain); - bonusPoint.setType("Type_Maintenance_Maintain"); - this.save(bonusPoint); - - handlers = new ArrayList<>(); - businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid='"+maintenanceDetail.getId()+"'"); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handlers.add(businessUnitHandleDetail.getInsuser()); - } - if (handlers.size()>0) { - Set set =new HashSet(); - set.addAll(handlers); - handlers.clear(); - handlers.addAll(set); - for (String handler : handlers) { - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(handler); - bonusPoint.setUserid(handler); - bonusPoint.setPoint(BonusPoint.Type_Maintenance_Maintain); - bonusPoint.setType("Type_Maintenance_Maintain"); - this.save(bonusPoint); - } - - } - break; - default: - break; - } - } - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - return res; - } - /** - * 增加积分,评价客户发单 - * */ - @Transactional - public int saveBonusPoint_Judge(Maintenance maintenance) { - int res =0; - try { - if (maintenance.getJudgemaintainer()!=null || maintenance.getJudgemaintainerstaff()!=null || maintenance.getJudgeresult()!=null) { - Date date = new Date(); - Calendar cal = Calendar.getInstance(); - cal.setTime(date);//设置起时间 - cal.add(Calendar.YEAR, 1);//增加一年 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String edt =simpleDateFormat.format(cal.getTime()); - - BonusPoint bonusPoint = new BonusPoint(); - //发布人评价加分 - String applicant=maintenance.getApplicantid(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsdt(CommUtil.nowDate()); - bonusPoint.setInsuser(applicant); - bonusPoint.setUserid(applicant); - bonusPoint.setPoint(BonusPoint.Type_DoJudge); - bonusPoint.setType("Type_DoJudge"); - bonusPoint.setEdt(edt); - //负责人评价得分 - String manager=maintenance.getManagerid(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(manager); - bonusPoint.setUserid(manager); - bonusPoint.setPoint(BonusPoint.Type_Judge); - bonusPoint.setType("Type_Judge"); - if (maintenance.getJudgemaintainer()!=null &&maintenance.getJudgemaintainer()==5) { - bonusPoint.setPoint(BonusPoint.Type_5Star); - bonusPoint.setType("Type_5Star"); - } - bonusPoint.setEdt(edt); - //处理人得分,目前是统一评价所有处理人 - List handlers = new ArrayList<>(); - List maintenanceDetails =maintenanceDetailService.selectListByWhere("where maintenanceid='"+maintenance.getId()+"'"); - for (MaintenanceDetail maintenanceDetail : maintenanceDetails) { - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid='"+maintenanceDetail.getId()+"'"); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handlers.add(businessUnitHandleDetail.getInsuser()); - } - } - if (handlers.size()>0) { - Set set =new HashSet(); - set.addAll(handlers); - handlers.clear(); - handlers.addAll(set); - for (String handler : handlers) { - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(handler); - bonusPoint.setUserid(handler); - bonusPoint.setPoint(BonusPoint.Type_Judge); - bonusPoint.setType("Type_Judge"); - if (maintenance.getJudgemaintainerstaff()!=null &&maintenance.getJudgemaintainerstaff()==5) { - bonusPoint.setPoint(BonusPoint.Type_5Star); - bonusPoint.setType("Type_5Star"); - } - - this.save(bonusPoint); - } - - } - } - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace();; - throw new RuntimeException(); - } - return res; - } - /** - * 增加积分,保养务 - * */ - @Transactional - public int saveBonusPoint_Judge(MaintenanceDetail maintenanceDetail) { - int res =0; - try { - if ( maintenanceDetail.getJudgemaintainerstaff()!=null || maintenanceDetail.getJudgeresult()!=null) { - Date date = new Date(); - Calendar cal = Calendar.getInstance(); - cal.setTime(date);//设置起时间 - cal.add(Calendar.YEAR, 1);//增加一年 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String edt =simpleDateFormat.format(cal.getTime()); - - BonusPoint bonusPoint = new BonusPoint(); - //保养任务发起人 - String insuser = maintenanceDetail.getInsuser(); - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(insuser); - bonusPoint.setInsdt(CommUtil.nowDate()); - bonusPoint.setUserid(insuser); - bonusPoint.setEdt(edt); - bonusPoint.setPoint(BonusPoint.Type_Judge); - bonusPoint.setType("Type_Judge"); - this.save(bonusPoint); - //处理人得分,目前是统一评价所有处理人 - List handlers = new ArrayList<>(); - List businessUnitHandleDetails = businessUnitHandleDetailService.selectListByWhere("where maintenancedetailid='"+maintenanceDetail.getId()+"'"); - for (BusinessUnitHandleDetail businessUnitHandleDetail : businessUnitHandleDetails) { - handlers.add(businessUnitHandleDetail.getInsuser()); - } - if (handlers.size()>0) { - Set set =new HashSet(); - set.addAll(handlers); - handlers.clear(); - handlers.addAll(set); - for (String handler : handlers) { - bonusPoint.setId(CommUtil.getUUID()); - bonusPoint.setInsuser(handler); - bonusPoint.setUserid(handler); - bonusPoint.setPoint(BonusPoint.Type_Judge); - bonusPoint.setType("Type_Judge"); - if (maintenanceDetail.getJudgemaintainerstaff()!=null && maintenanceDetail.getJudgemaintainerstaff()==5) { - bonusPoint.setPoint(BonusPoint.Type_5Star); - bonusPoint.setType("Type_5Star"); - } - - this.save(bonusPoint); - } - - } - } - - } catch (Exception e) { - // TODO: handle exception - throw new RuntimeException(); - } - return res; - } - /** - * 花费积分 - * */ - @Transactional - public int purchaseWithPoint(String userId,long point,String reason) { - long desPoint =point; - int res=0; - try { - if (userId==null || userId.isEmpty() || point<=0) { - return res; - } - //将有效期内的积分按剩余时间倒叙扣除 - List bonusPoints = this.selectListByWhere("where userid='"+userId+"' and point>0 and edt>GETDATE() order by edt-GETDATE() asc"); - long sum =0; - for (BonusPoint bonusPoint : bonusPoints) { - sum +=bonusPoint.getPoint(); - } - //积分不够则直接退出 - if (point>sum) { - throw new RuntimeException(); - }else{ - - for (BonusPoint bonusPoint : bonusPoints) { - if (bonusPoint.getPoint()!=null && bonusPoint.getPoint()>0 && point>0 ) { - int cpoint=bonusPoint.getPoint(); - if (cpoint>=point) { - long result=(cpoint-point); - bonusPoint.setPoint((int)result); - }else{ - bonusPoint.setPoint(0); - } - int resp=this.update(bonusPoint); - if (resp==1) { - point-=cpoint; - }else{ - throw new RuntimeException(); - } - - }else if (point<=0) { - break; - } - - } - BonusPointRecord bonusPointRecord = new BonusPointRecord(); - bonusPointRecord.setId(CommUtil.getUUID()); - bonusPointRecord.setInsdt(CommUtil.nowDate()); - bonusPointRecord.setInsuser(userId); - bonusPointRecord.setUserid(userId); - bonusPointRecord.setPoint(-desPoint); - bonusPointRecord.setReason(reason); - res=bonusPointRecordService.save(bonusPointRecord); - if (res!=1) { - throw new RuntimeException(); - } - - } - - - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - - return res; - } - @Override - public int update(BonusPoint entity) { - return bonusPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - BonusPoint bonusPoint = new BonusPoint(); - bonusPoint.setWhere(wherestr); - List bonusPoints = bonusPointDao.selectListByWhere(bonusPoint); - return bonusPoints; - } - - @Override - public int deleteByWhere(String wherestr) { - BonusPoint bonusPoint = new BonusPoint(); - bonusPoint.setWhere(wherestr); - return bonusPointDao.deleteByWhere(bonusPoint); - } -} diff --git a/src/com/sipai/service/user/DeptAreaService.java b/src/com/sipai/service/user/DeptAreaService.java deleted file mode 100644 index b68f6030..00000000 --- a/src/com/sipai/service/user/DeptAreaService.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.timeefficiency.PatrolAreaDao; -import com.sipai.dao.user.DeptAreaDao; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.user.DeptArea; -import com.sipai.entity.user.DeptRole; -import com.sipai.entity.user.Role; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - - -@Service -public class DeptAreaService implements CommService{ - @Resource - private DeptAreaDao deptAreaDao; - @Resource - private PatrolAreaDao patrolAreaDao; - - - public List selectList() { - // TODO Auto-generated method stub - DeptArea DeptArea = new DeptArea(); - return this.deptAreaDao.selectList(DeptArea); - } - - - @Override - public DeptArea selectById(String id) { - return this.deptAreaDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.deptAreaDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DeptArea entity) { - return this.deptAreaDao.insert(entity); - } - - @Override - public int update(DeptArea t) { - return this.deptAreaDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DeptArea deptArea = new DeptArea(); - deptArea.setWhere(wherestr); - return this.deptAreaDao.selectListByWhere(deptArea); - } - - @Override - public int deleteByWhere(String wherestr) { - DeptArea deptArea = new DeptArea(); - deptArea.setWhere(wherestr); - return this.deptAreaDao.deleteByWhere(deptArea); - } - - public int updateDeptArea(String deptid,String areastr) { - //先删除所有此小组下的所有关联工艺段 - this.deleteByWhere(" where deptid='"+deptid+"'"); - - //再添加小组和工艺关联 - String[] areaarr=areastr.split(","); - int insdeptres = 0; - for(String areaid:areaarr){ - DeptArea deptArea = new DeptArea(); - deptArea.setAreaid(areaid); - deptArea.setDeptid(deptid); - deptArea.setId(CommUtil.getUUID()); - insdeptres += this.deptAreaDao.insert(deptArea); - } - //若部门工艺insert数和前端传来的权限数不同,返回错误编码0 - if(insdeptres != areaarr.length){ - insdeptres = 0; - } - return insdeptres; - } - - public List selectAreaListByDept(String wherestr) { - PatrolArea patrolArea = new PatrolArea(); - patrolArea.setWhere(wherestr); - return this.patrolAreaDao.selectAreaListByDept(patrolArea); - } -} diff --git a/src/com/sipai/service/user/DeptProcessService.java b/src/com/sipai/service/user/DeptProcessService.java deleted file mode 100644 index b9f1a1c7..00000000 --- a/src/com/sipai/service/user/DeptProcessService.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.DeptProcessDao; -import com.sipai.dao.user.ProcessSectionDao; -import com.sipai.entity.user.DeptProcess; -import com.sipai.entity.user.DeptRole; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.Role; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - - -@Service -public class DeptProcessService implements CommService{ - @Resource - private DeptProcessDao deptProcessDao; - @Resource - private ProcessSectionDao processSectionDao; - - - public List selectList() { - // TODO Auto-generated method stub - DeptProcess DeptProcess = new DeptProcess(); - return this.deptProcessDao.selectList(DeptProcess); - } - - - @Override - public DeptProcess selectById(String id) { - return this.deptProcessDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.deptProcessDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DeptProcess entity) { - return this.deptProcessDao.insert(entity); - } - - @Override - public int update(DeptProcess t) { - return this.deptProcessDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DeptProcess deptProcess = new DeptProcess(); - deptProcess.setWhere(wherestr); - return this.deptProcessDao.selectListByWhere(deptProcess); - } - - @Override - public int deleteByWhere(String wherestr) { - DeptProcess deptProcess = new DeptProcess(); - deptProcess.setWhere(wherestr); - return this.deptProcessDao.deleteByWhere(deptProcess); - } - - public int updateDeptProcess(String deptid,String processstr) { - //先删除所有此小组下的所有关联工艺段 - this.deleteByWhere(" where deptid='"+deptid+"'"); - - //再添加小组和工艺关联 - String[] processarr=processstr.split(","); - int insdeptres = 0; - for(String processid:processarr){ - DeptProcess deptProcess = new DeptProcess(); - deptProcess.setProcessid(processid); - deptProcess.setDeptid(deptid); - deptProcess.setId(CommUtil.getUUID()); - insdeptres += this.deptProcessDao.insert(deptProcess); - } - //若部门工艺insert数和前端传来的权限数不同,返回错误编码0 - if(insdeptres != processarr.length){ - insdeptres = 0; - } - return insdeptres; - } - - public List selectProcessListByDept(String wherestr) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere(wherestr); - return this.processSectionDao.selectProcessListByDept(processSection); - } -} diff --git a/src/com/sipai/service/user/DeptRoleService.java b/src/com/sipai/service/user/DeptRoleService.java deleted file mode 100644 index 0bb809ea..00000000 --- a/src/com/sipai/service/user/DeptRoleService.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.DeptRoleDao; -import com.sipai.dao.user.RoleDao; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.user.DeptRole; -import com.sipai.entity.user.Role; -import com.sipai.tools.CommService; - - -@Service -public class DeptRoleService implements CommService{ - @Resource - private DeptRoleDao deptRoleDao; - - @Resource - private RoleDao roleDao; - - public List selectList() { - // TODO Auto-generated method stub - DeptRole deptRole = new DeptRole(); - return this.deptRoleDao.selectList(deptRole); - } - - - @Override - public DeptRole selectById(String id) { - return this.deptRoleDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.deptRoleDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DeptRole entity) { - return this.deptRoleDao.insert(entity); - } - - @Override - public int update(DeptRole t) { - return this.deptRoleDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - DeptRole deptRole = new DeptRole(); - deptRole.setWhere(wherestr); - return this.deptRoleDao.selectListByWhere(deptRole); - } - - @Override - public int deleteByWhere(String wherestr) { - DeptRole deptRole = new DeptRole(); - deptRole.setWhere(wherestr); - return this.deptRoleDao.deleteByWhere(deptRole); - } - - public List selectRoleListByDept(String wherestr) { - Role role = new Role(); - role.setWhere(wherestr); - return this.roleDao.selectRoleListByDept(role); - } - -} diff --git a/src/com/sipai/service/user/ExtSystemService.java b/src/com/sipai/service/user/ExtSystemService.java deleted file mode 100644 index 0d4ad1ae..00000000 --- a/src/com/sipai/service/user/ExtSystemService.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.sipai.service.user; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import net.sf.json.JSONObject; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.ExtSystemDao; -import com.sipai.entity.user.ExtSystem; -import com.sipai.tools.CommService; -import com.sipai.tools.HttpUtil; - -@Service -public class ExtSystemService implements CommService{ - @Resource - private ExtSystemDao extSystemDao; - @Override - public ExtSystem selectById(String id) { - return extSystemDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return extSystemDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ExtSystem entity) { - if(entity.getStatus()==null){ - entity.setStatus(false); - } - return extSystemDao.insert(entity); - } - - @Override - public int update(ExtSystem entity) { - if(entity.getStatus()==null){ - entity.setStatus(false); - } - return extSystemDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ExtSystem extSystem = new ExtSystem(); - extSystem.setWhere(wherestr); - List extSystems = extSystemDao.selectListByWhere(extSystem); - return extSystems; - } - - @Override - public int deleteByWhere(String wherestr) { - ExtSystem extSystem = new ExtSystem(); - extSystem.setWhere(wherestr); - return extSystemDao.deleteByWhere(extSystem); - } - /** - * 获取所有启用的外接系统 - * */ - public List getActiveSystems(String wherestr) { - if(wherestr==null || wherestr.isEmpty()){ - wherestr="where status='true' "; - }else{ - wherestr="where status='true' and "+wherestr.replace("where", ""); - } - List extSystems = this.selectListByWhere(wherestr); - return extSystems; - } - /** - * 按类型获取所有启用的系统 - * */ - public List getActiveSystemsByTypes(String[] types) { - String wherestr =""; - if(types==null || types.length==0){ - wherestr="where status='true' "; - }else{ - for (String type : types) { - if(!wherestr.isEmpty()){ - wherestr+="','"; - } - wherestr+=type; - } - wherestr="where status='true' and type in('"+wherestr+"') "; - } - List extSystems = this.selectListByWhere(wherestr); - return extSystems; - } - /** - * 获取启用的RFID系统 - * */ - public ExtSystem getActiveDataManage(String wherestr) { - if(wherestr==null || wherestr.isEmpty()){ - wherestr="where status='true' and type ='"+ExtSystem.Type_DataManage+"' "; - }else{ - wherestr="where status='true' and type ='"+ExtSystem.Type_DataManage+"' and "+wherestr.replace("where", ""); - } - List extSystems = this.selectListByWhere(wherestr); - if(extSystems!=null && extSystems.size()>0){ - return extSystems.get(0); - }else{ - return null; - } - - } - /** - * 获取企业微信审批API - * @param start,格式"yyyy-MM-dd HH:mm:ss" - * @param end,格式"yyyy-MM-dd HH:mm:ss" - * @param next_spnum,第一个拉取的审批单号,不填从该时间段的第一个审批单拉取 - * @return - */ - public JSONObject getQyWeixinApprData(String access_token,String start,String end,String next_spnum){ - JSONObject json = new JSONObject(); - HttpUtil hu = new HttpUtil(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date startdate = sdf.parse(start); - Date enddate = sdf.parse(end); - long starttime = startdate.getTime()/1000; - long endtime = enddate.getTime()/1000; - - JSONObject body = new JSONObject(); - body.put("starttime", starttime); - body.put("endtime", endtime); - if(next_spnum!=null && next_spnum.length()>0){ - body.put("next_spnum", Integer.valueOf(next_spnum)); - } - String url = "https://qyapi.weixin.qq.com/cgi-bin/corp/getapprovaldata?access_token="+access_token; - String str = hu.sendPost(url, body.toString()); - json = JSONObject.fromObject(str); - - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return json; - - - } - /** - * 获取启用的可视化联动 - * */ - public ExtSystem getActiveVisual(String extSystemType) { - String wherestr = "where status='true' and type ='"+extSystemType+"' "; - List extSystems = this.selectListByWhere(wherestr); - if(extSystems!=null && extSystems.size()>0){ - return extSystems.get(0); - }else{ - return null; - } - } -} diff --git a/src/com/sipai/service/user/JobService.java b/src/com/sipai/service/user/JobService.java deleted file mode 100644 index 33914723..00000000 --- a/src/com/sipai/service/user/JobService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import com.sipai.entity.activiti.ModelNodeJob; -import com.sipai.entity.base.Tree; -import com.sipai.entity.user.Job; - -public interface JobService { - - List selectListByWhere(String where); - - List selectListByUnitid(String unitid); - - List selectListByUserId(String userId); - - Job selectById(String id); - - int deleteById(String id); - - int save(Job t); - - int update(Job t); - - int updateModelNodeJob(String resourceId, String modelId, String jobIds); - - List selectModelNodeJobListByWhere(String where); - - /** - * 获取流程第一步的节点岗位 - * @param unitId - * @param type ProcessType中的type - * @return - */ - String getJobs4Activiti(String unitId, String type); -} diff --git a/src/com/sipai/service/user/JobServiceImpl.java b/src/com/sipai/service/user/JobServiceImpl.java deleted file mode 100644 index b2614c9c..00000000 --- a/src/com/sipai/service/user/JobServiceImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.sipai.service.user; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.base.Tree; -import com.sipai.entity.enums.PositionTypeEnum; -import org.activiti.engine.RepositoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.sipai.dao.activiti.ModelNodeJobDao; -import com.sipai.dao.user.JobDao; -import com.sipai.dao.user.UserDao; -import com.sipai.dao.user.UserJobDao; -import com.sipai.entity.activiti.ModelNodeJob; -import com.sipai.entity.user.Job; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserJob; -import com.sipai.tools.CommUtil; -import org.springframework.web.servlet.ModelAndView; - -@Service -public class JobServiceImpl implements JobService { - - @Resource - private JobDao jobDao; - @Resource - private UserJobDao userJobDao; - @Resource - private UserDao userDao; - @Resource - private ModelNodeJobDao modelNodeJobDao; - @Autowired - RepositoryService repositoryService; - - /* - *查询职位对应的人员信息 - * - */ - @Override - public List selectListByWhere(String where) { - Job job = new Job(); - job.setWhere(where); - //查询所有职位信息 - List jobList = jobDao.selectListByWhere(job); - //循环每个职位信息 - for (Job jobTemp : jobList) { - List userList = new ArrayList<>(); - //通过职位id查询职位与人员的中间表信息 - List userJobList = userJobDao.selectUserJobByJobId(jobTemp.getId()); - if (null != userJobList && !userJobList.isEmpty() && userJobList.size() > 0) { - //循环职位与人员的中间表信息 - for (UserJob userJobListTemp : userJobList) { - //查询同一个职位对应的人员信息(1对多) - User user = userDao.selectByPrimaryKey(userJobListTemp.getUserid()); - //将同一职位人员放到同一个集合中 - userList.add(user); - } - //将同一职位人员绑定到同意职位 - jobTemp.setUser(userList); - } - - } - - return jobList; - } - - @Override - public Job selectById(String id) { - Job job = this.jobDao.selectByPrimaryKey(id); - if (job == null) { - return new Job(); - } else { - return job; - } - } - - public Job selectByName(String name) { - return this.jobDao.selectByName(name); - } - - @Override - public int deleteById(String id) { - return this.jobDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Job t) { - return this.jobDao.insert(t); - } - - @Override - public int update(Job t) { - return this.jobDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByUnitid(String unitid) { - return this.jobDao.selectListByUnitid(unitid); - } - - @Override - public List selectListByUserId(String userId) { - - return this.jobDao.selectListByUserId(userId); - } - - /** - * 更新流程模板节点职位 - */ - @Override - public int updateModelNodeJob(String resourceId, String modelId, String jobIds) { - //删除关系表中原有的节点职位信息 - ModelNodeJob group = new ModelNodeJob(); - group.setWhere(" where resource_id ='" + resourceId + "' and model_id ='" + modelId + "'"); - List mnJList = this.modelNodeJobDao.selectListByWhere(group); - if (mnJList != null && mnJList.size() > 0) { - for (ModelNodeJob item : mnJList) { - this.modelNodeJobDao.deleteByPrimaryKey(item.getId()); - } - - } - //关系表中插入 - String[] jobIdArr = jobIds.split(","); - int result = 0; - for (int i = 0; i < jobIdArr.length; i++) { - ModelNodeJob mnj = new ModelNodeJob(); - mnj.setId(CommUtil.getUUID()); - mnj.setModelId(modelId); - mnj.setResourceId(resourceId); - mnj.setJobId(jobIdArr[i]); - result = this.modelNodeJobDao.insert(mnj); - } - - return result; - } - - @Override - public List selectModelNodeJobListByWhere(String where) { - ModelNodeJob mnj = new ModelNodeJob(); - mnj.setWhere(where); - List mnjList = modelNodeJobDao.selectListByWhere(mnj); - if (null != mnjList && !mnjList.isEmpty() && mnjList.size() > 0) { - - for (ModelNodeJob item : mnjList) { - Job job = this.jobDao.selectByPrimaryKey(item.getJobId()); - if (job != null) { - item.setName(job.getName()); - item.setSerial(job.getSerial()); - } - - } - } - return mnjList; - } - - @Override - public String getJobs4Activiti(String unitId, String type) { - String sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + "'"; - String jobIds = ""; - List list_model = repositoryService.createNativeModelQuery().sql(sql).list(); - if (list_model != null && list_model.size() > 0) { - ModelNodeJob modelNodeJob = new ModelNodeJob(); - modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'"); - List list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob); - HashSet hs = new HashSet(); - for (int i = 0; i < list_model_node.size(); i++) { - jobIds += "" + list_model_node.get(i).getJobId() + ","; - } - } - return jobIds; - } -} diff --git a/src/com/sipai/service/user/MenuService.java b/src/com/sipai/service/user/MenuService.java deleted file mode 100644 index 87634824..00000000 --- a/src/com/sipai/service/user/MenuService.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; -import java.util.Map; - -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.RoleMenu; -import com.sipai.entity.user.UserPower; - -public interface MenuService { - public Menu getMenuById(String menuId); - - public int saveMenu(Menu menu); - - public int updateMenu(Menu menu); - - public int deleteMenuById(String menuId); - - public List selectAll(); - - public List selectListByWhere(String where); - - public int deleteByPid(String pid); - - /** - * 获取用户菜单和功能 - */ - public List selectListByUserId(String userid); - - /** - * 获取用户菜单(不包括功能) - */ - public List selectMenuByUserId(String userid); - - /** - * 获取用户功能(不包括菜单) - */ - public List selectFuncByUserId(String userid); - /** - * 获取用户功能 - */ - public List selectUserPowerListByWhere(String whereStr); - - /** - * 获取用户菜单(包括父节点) - */ - public List getFullPower(String userid); - - /** - * 获取最终节点的菜单(不包括父节点) - */ - public List getFinalMenu(); - - public List getFinalMenuByRoleId(String roleid); - - /** - * 获取角色功能权限 - * @param roleid - * @return - */ - public List getFuncByRoleId(String roleid); - - public List getFuncByMenuId(String roleid); - /** - * 获取bootstrap-treeview 所需json数据*/ - public String getTreeList(List> list_result,List list); - /** - * 根据查询条件和用户总菜单列表,查询相关菜单 - * */ - public List getMenuListByWhereAndList(String wherestr,List list); -} diff --git a/src/com/sipai/service/user/MenuServiceImpl.java b/src/com/sipai/service/user/MenuServiceImpl.java deleted file mode 100644 index 633bccaa..00000000 --- a/src/com/sipai/service/user/MenuServiceImpl.java +++ /dev/null @@ -1,357 +0,0 @@ -package com.sipai.service.user; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.user.MenuDao; -import com.sipai.dao.user.UserPowerDao; -import com.sipai.entity.user.Menu; -import com.sipai.entity.user.RoleMenu; -import com.sipai.entity.user.UserPower; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service("menuService") -public class MenuServiceImpl implements MenuService { - - @Resource - private MenuDao menuDao; - - - @Resource - private UserPowerDao userPowerDao; - - @Resource - private RoleService roleService; - - @Override - public Menu getMenuById(String menuId) { - return this.menuDao.selectByPrimaryKey(menuId); - } - - @Override - public int saveMenu(Menu menu) { - return this.menuDao.insert(menu); - } - - @Override - public int updateMenu(Menu menu) { - return this.menuDao.updateByPrimaryKeySelective(menu); - } - - @Override - public int deleteMenuById(String menuId) { - return this.menuDao.deleteByPrimaryKey(menuId); - } - - @Override - public List selectAll() { - Menu menu= new Menu(); - return this.menuDao.selectList(menu); - } - - @Override - public List selectListByWhere(String where) { - Menu menu= new Menu(); - menu.setWhere(where); - return this.menuDao.selectListByWhere(menu); - } - - @Override - public List selectListByUserId(String userid) { - List userPowers =this.userPowerDao.selectListByUserId(userid); - /*Iterator ite=userPowers.iterator(); - while (ite.hasNext()) { - UserPower userPower =ite.next(); - this.userPowerDao.selectListByWhere(""); - //if() - //type type = (type) en.nextElement(); - - }*/ - return userPowers; - } - - @Override - public List selectMenuByUserId(String userid) { - return this.userPowerDao.selectMenuByUserId(userid); - } - - @Override - public List selectFuncByUserId(String userid) { - return this.userPowerDao.selectFuncByUserId(userid); - } - @Override - public List selectUserPowerListByWhere(String whereStr) { - return this.userPowerDao.selectListByWhere(whereStr); - } - - List powerlist= new ArrayList(); - List list = new ArrayList(); - @Override - public List getFullPower(String userid){ - powerlist = selectListByUserId(userid); - - //查找只含有菜单项。不包含内部功能的菜单-wxp - List menupower=selectMenuByUserId(userid); - for (UserPower userPower : menupower) { - if(!check(userPower.getId())){ - powerlist.add(userPower); - } - } - - - list=selectAll(); - - for(int i=0;i reslist = new ArrayList(); - for(Menu menu :list){ - for(UserPower userPower:powerlist){ - if(menu.getId().equals(userPower.getId())){ - reslist.add(menu); - } - } - } - return reslist; - } - - public void getParent(UserPower obj){ - if(obj!=null && !obj.getId().equals(obj.getPid())){ - UserPower up= new UserPower(); - for(int i=0;i getMenuListByWhereAndList(String wherestr,List list){ - List t2 = new ArrayList(); - List menus = this.selectListByWhere(wherestr); - for (Menu menu : menus) { - List children= this.getChildren(menu.getId(), list); - List parents= this.getParents(menu.getId(), list); - //为保证查询的顺序不变,用for循环 - for (Menu item : parents) { - int i=0; - for (i=0;i getChildren(String pid,List list){ - List t2 = new ArrayList(); - for(int i=0;i getParents(String pid,List list){ - List t2 = new ArrayList(); - for(int i=0;i getFinalMenu(){ - List list1=this.selectListByWhere("where type='menu'"); - List list2=list1; - if(list1!=null && list1.size()>0){ - for(int i=list1.size()-1 ;i>=0;i--){ - Menu menu1=list1.get(i); - for(int j=0 ;j getFinalMenuByRoleId(String roleid){ - List list = roleService.getRoleMenu(roleid); - List list1 = this.getFinalMenu(); - List listres= new ArrayList(); - if(list!=null &&list.size()>0){ - for(int i=0;i0){ - for(int j=0;j getFuncByRoleId(String roleid){ - List list = roleService.getRoleFunc(roleid); - return list; - } - - @Override - public List getFuncByMenuId(String roleid){ - Menu menu= new Menu(); - menu.setWhere(" where pid = '"+roleid+"' and type='func' order by morder"); - List list = this.menuDao.selectListByWhere(menu); - return list; - } - - @Override - public int deleteByPid(String pid) { - Menu menu= new Menu(); - menu.setWhere(" where pid='"+pid+"' "); - return this.menuDao.deleteByWhere(menu); - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(Menu k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Menu k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - List tags = new ArrayList(); - tags.add(k.getDescription()); - m.put("tags", tags); - /*if(k.get_checked()!=null && k.get_checked().equals("true")){ - JSONObject state = new JSONObject(); - state.put("checked",true); - m.put("state", state); - }*/ - childlist.add(m); - } - } - if(childlist.size()>0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/user/MobileManagementService.java b/src/com/sipai/service/user/MobileManagementService.java deleted file mode 100644 index e66bc295..00000000 --- a/src/com/sipai/service/user/MobileManagementService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import com.sipai.entity.user.MobileManagement; - -public interface MobileManagementService { - public abstract MobileManagement selectById(String id); - - public abstract int deleteById(String id); - - public abstract int save(MobileManagement entity); - - public abstract int update(MobileManagement entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public boolean checkCardidNotOccupied(String id, String cardid); -} diff --git a/src/com/sipai/service/user/MobileManagementServiceImpl.java b/src/com/sipai/service/user/MobileManagementServiceImpl.java deleted file mode 100644 index 385e4284..00000000 --- a/src/com/sipai/service/user/MobileManagementServiceImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.MobileManagementDao; -import com.sipai.entity.user.MobileManagement; -import com.sipai.entity.user.User; - -@Service -public class MobileManagementServiceImpl implements MobileManagementService{ - @Resource - private MobileManagementDao mobileManagementDao; - @Resource - private UserService userService; - - @Override - public MobileManagement selectById(String t) { - // TODO Auto-generated method stub - MobileManagement mobileManagement = mobileManagementDao.selectByPrimaryKey(t); - String auditman=""; - if(mobileManagement.getUserId()!=null&&!mobileManagement.getUserId().equals("")){ - String[] split = mobileManagement.getUserId().split(","); - for (int i = 0; i < split.length; i++) { - User user = this.userService.getUserById(split[i]); - auditman+=user.getCaption(); - if(i!=split.length-1){ - auditman+=","; - } - } - mobileManagement.setAuditMan(auditman); - } - return mobileManagement; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return mobileManagementDao.deleteByPrimaryKey(t); - } - - @Override - public int save(MobileManagement t) { - // TODO Auto-generated method stub - return mobileManagementDao.insertSelective(t); - } - - @Override - public int update(MobileManagement t) { - // TODO Auto-generated method stub - return mobileManagementDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - MobileManagement mobileManagement = new MobileManagement(); - mobileManagement.setWhere(t); - return mobileManagementDao.selectListByWhere(mobileManagement); - } - - @Override - public int deleteByWhere(String t) { - MobileManagement mobileManagement = new MobileManagement(); - mobileManagement.setWhere(t); - return mobileManagementDao.deleteByWhere(mobileManagement); - } - - @Override - public boolean checkCardidNotOccupied(String id, String cardid) { - List list = this.mobileManagementDao.getListByCardid(cardid); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(MobileManagement mobileManagement :list){ - if(!id.equals(mobileManagement.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - - return true; - } -} diff --git a/src/com/sipai/service/user/MobileValidationService.java b/src/com/sipai/service/user/MobileValidationService.java deleted file mode 100644 index 86f53496..00000000 --- a/src/com/sipai/service/user/MobileValidationService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.user; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.MobileValidationDao; -import com.sipai.dao.user.UserDetailDao; -import com.sipai.entity.user.MobileValidation; -import com.sipai.entity.user.UserDetail; -import com.sipai.tools.CommService; - -@Service -public class MobileValidationService implements CommService{ - @Resource - private MobileValidationDao mobileValidationDao; - - @Override - public MobileValidation selectById(String id) { - return mobileValidationDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return mobileValidationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MobileValidation mobileValidation) { - return mobileValidationDao.insert(mobileValidation); - } - - @Override - public int update(MobileValidation mobileValidation) { - return mobileValidationDao.updateByPrimaryKeySelective(mobileValidation); - } - - @Override - public List selectListByWhere(String wherestr) { - MobileValidation mobileValidation = new MobileValidation(); - mobileValidation.setWhere(wherestr); - return mobileValidationDao.selectListByWhere(mobileValidation); - } - - @Override - public int deleteByWhere(String wherestr) { - MobileValidation mobileValidation = new MobileValidation(); - mobileValidation.setWhere(wherestr); - return mobileValidationDao.deleteByWhere(mobileValidation); - } -} diff --git a/src/com/sipai/service/user/ProcessSectionScoreService.java b/src/com/sipai/service/user/ProcessSectionScoreService.java deleted file mode 100644 index 3f27af83..00000000 --- a/src/com/sipai/service/user/ProcessSectionScoreService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import com.sipai.entity.user.ProcessSectionScore; - - -public interface ProcessSectionScoreService { - - public ProcessSectionScore selectById(String t); - - public int deleteById(String t); - - public int save(ProcessSectionScore t); - - public int update(ProcessSectionScore t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/user/ProcessSectionScoreServiceImpl.java b/src/com/sipai/service/user/ProcessSectionScoreServiceImpl.java deleted file mode 100644 index b9ed5760..00000000 --- a/src/com/sipai/service/user/ProcessSectionScoreServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import javax.annotation.Resource; - -import org.quartz.CronScheduleBuilder; -import org.quartz.CronTrigger; -import org.quartz.JobKey; -import org.quartz.TriggerKey; -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.ProcessSectionScoreDao; -import com.sipai.entity.user.ProcessSectionScore; - - -@Service("ProcessSectionScoreService") -public class ProcessSectionScoreServiceImpl implements ProcessSectionScoreService{ - @Resource - private ProcessSectionScoreDao processSectionScoreDao; - - @Override - public ProcessSectionScore selectById(String t) { - // TODO Auto-generated method stub - return processSectionScoreDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return processSectionScoreDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ProcessSectionScore processSectionScore) { - // TODO Auto-generated method stub - return processSectionScoreDao.insertSelective(processSectionScore); - } - - - - @Override - public int update(ProcessSectionScore processSectionScore) { - // TODO Auto-generated method stub - return processSectionScoreDao.updateByPrimaryKeySelective(processSectionScore); - } - - @Override - public List selectListByWhere(String t) { - ProcessSectionScore processSectionScore = new ProcessSectionScore(); - processSectionScore.setWhere(t); - return processSectionScoreDao.selectListByWhere(processSectionScore); - } - - - @Override - public int deleteByWhere(String t) { - ProcessSectionScore processSectionScore = new ProcessSectionScore(); - processSectionScore.setWhere(t); - return processSectionScoreDao.deleteByWhere(processSectionScore); - } - -} diff --git a/src/com/sipai/service/user/ProcessSectionService.java b/src/com/sipai/service/user/ProcessSectionService.java deleted file mode 100644 index 31abe389..00000000 --- a/src/com/sipai/service/user/ProcessSectionService.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.sipai.service.user; - -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.user.*; -import com.sipai.service.company.CompanyService; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.ProcessSectionDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.process.ProcessSectionInformation; -import com.sipai.entity.scada.MPoint; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.process.ProcessSectionInformationService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; - -@Service("processSectionService") -public class ProcessSectionService implements CommService{ - @Resource - private ProcessSectionDao processSectionDao; - @Resource - private ProcessSectionTypeService processSectionTypeService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private ProcessSectionScoreService processSectionScoreService; - @Resource - private MPointService mPointService; - @Resource - private CompanyService companyService; - @Resource - private ProcessSectionInformationService processSectionInformationService; - - @Override - public ProcessSection selectById(String id) { - return processSectionDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return processSectionDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessSection entity) { - return processSectionDao.insert(entity); - } - - @Override - public int update(ProcessSection entity) { - return processSectionDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere(wherestr); - List processSections = processSectionDao.selectListByWhere(processSection); - for (ProcessSection item : processSections) { - Company company = this.companyService.selectByPrimaryKey(item.getUnitId()); - if(company!=null){ - item.setCompanySname(company.getSname()); - } - //工艺段介绍 - List listInformation = this.processSectionInformationService.selectListByWhere( - "where process_section_id = '"+item.getId()+"' and state=1 order by insdt desc "); - if(listInformation!=null && listInformation.size()>0){ - item.setInformation(listInformation.get(0)); - } - - } - return processSections; - } - - public List selectSimpleListByWhere(String wherestr) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere(wherestr); - List processSections = processSectionDao.selectListByWhere(processSection); - return processSections; - } - - public List selectListByWhere(String bizid,String wherestr) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere(wherestr); - List processSections = processSectionDao.selectListByWhere(processSection); - - List processSectionScoresASC = this.processSectionScoreService.selectListByWhere("where 1=1 order by upper asc "); - - for (ProcessSection item : processSections) { - ProcessSectionType processSectionType = this.processSectionTypeService.selectById(item.getProcessSectionTypeId()); - item.setProcessSectionType(processSectionType); - - int allscore = 0; - int getscore = 0; - List equipmentCards = this.equipmentCardService.selectListByWhereForSystem(bizid,"where processSectionId = '"+item.getId()+"'"); - if (equipmentCards!=null && equipmentCards.size()>0) { - for (int i = 0; i < equipmentCards.size(); i++) { - //拿到prop中的keynum并累加 - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectByEquipmentId(equipmentCards.get(i).getId()); - if (equipmentCardProp!=null && equipmentCardProp.getKeynum() !=null) { - allscore += equipmentCardProp.getKeynum(); - } - //查找该设备下的测量点,并将故障点为0的keynum加到getscore上,或者没有故障点也加到getscore上 - List mPoints = this.mPointService.selectListByWhere(bizid, "where equipmentId = '"+equipmentCards.get(i).getId()+"' and parmName like '%故障%' and ParmValue = '0'"); - if(mPoints!=null && mPoints.size()>0){ - if (equipmentCardProp!=null && equipmentCardProp.getKeynum() !=null) { - getscore += equipmentCardProp.getKeynum(); - } - } - List mPointsshort = this.mPointService.selectListByWhere(bizid, "where equipmentId = '"+equipmentCards.get(i).getId()+"' and parmName like '%故障%'"); - if(mPointsshort ==null || mPointsshort.size()==0){ - if (equipmentCardProp!=null && equipmentCardProp.getKeynum() !=null) { - getscore += equipmentCardProp.getKeynum(); - } - } - - } - - if(getscore == 0 || allscore == 0){ - item.set_score(0); - if(processSectionScoresASC!=null && processSectionScoresASC.size()>0){ - item.set_alarmcontent(processSectionScoresASC.get(0).getAlarmcontent()); - }else { - item.set_alarmcontent(""); - } - }else { -// DecimalFormat df=new DecimalFormat("0");//设置保留位数 - int _score = (getscore/allscore)*100; - item.set_score(_score); - //TODO 根据分数区间给出对应的警示 - List processSectionScores = this.processSectionScoreService.selectListByWhere("where lower <= "+_score+" and "+_score+"<=upper order by upper desc "); - if(processSectionScores!=null && processSectionScores.size()>0){ - item.set_alarmcontent(processSectionScores.get(0).getAlarmcontent()); - }else { - item.set_alarmcontent("需要重视"); - } - - - } - }else{ - item.set_score(0); - if(processSectionScoresASC!=null && processSectionScoresASC.size()>0){ - item.set_alarmcontent(processSectionScoresASC.get(0).getAlarmcontent()); - }else { - item.set_alarmcontent(""); - } - } - - - - } - - //排序方法 - Collections.sort(processSections, new Comparator() { - @Override - public int compare(ProcessSection arg0, ProcessSection arg1) { - // TODO Auto-generated method stub - - return arg1.get_score()-arg0.get_score(); - } - }); - return processSections; - } - - public List selectListGroupBy(String wherestr) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere(wherestr); - List processSections = processSectionDao.selectListGroupBy(processSection); -// for (ProcessSection item : processSections) { -// ProcessSectionType processSectionType = this.processSectionTypeService.selectById(item.getProcessSectionTypeId()); -// item.setProcessSectionType(processSectionType); -// } - return processSections; - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere(wherestr); - return processSectionDao.deleteByWhere(processSection); - } - -/* public List selectProSecByComapnyId(String companyId) { - return processSectionDao.selectProSecByComapnyId(companyId); - }*/ - -/* public List selectDistinctProSecByComapnyId(String companyId) { - return processSectionDao.selectDistinctProSecByComapnyId(companyId); - }*/ - - public List selectDistinctProSecByBTo(EquipmentCard equipmentCard) { - return processSectionDao.selectDistinctProSecByBTo(equipmentCard); - } - - /** - * 从工艺段库同步数据 - * @param unitId - * @return - */ - public int refresh(String unitId, User cu) { - ProcessSection processSection = new ProcessSection(); - processSection.setWhere("where 1=1 and unit_id = '" + ProcessSection.UnitId_Sys + "' and active = '1'"); - List list = processSectionDao.selectListByWhere(processSection); - int res = 0; - for (ProcessSection entity : list) { - processSection.setWhere("where 1=1 and code = '" + entity.getCode() + "' and unit_id = '" + unitId + "'"); - ProcessSection processSection1 = processSectionDao.selectByWhere(processSection); - if (processSection1 != null) { - System.out.println("存在"); - } else { - ProcessSection processSection2 = new ProcessSection(); - processSection2.setId(unitId + "_" + entity.getCode()); - processSection2.setInsdt(CommUtil.nowDate()); - processSection2.setInsuser(cu.getId()); - processSection2.setName(entity.getName()); - processSection2.setSname(entity.getSname()); - processSection2.setPid(entity.getPid()); - processSection2.setMorder(entity.getMorder()); - processSection2.setActive(entity.getActive()); - processSection2.setUnitId(unitId); - processSection2.setCode(entity.getCode()); - res += processSectionDao.insert(processSection2); - } - } - System.out.println(res); - return res; - } - -} diff --git a/src/com/sipai/service/user/ProcessSectionTypeService.java b/src/com/sipai/service/user/ProcessSectionTypeService.java deleted file mode 100644 index 6099c3a1..00000000 --- a/src/com/sipai/service/user/ProcessSectionTypeService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.user; -import java.util.List; - -import javax.annotation.Resource; - - - - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.ProcessSectionDao; -import com.sipai.dao.user.ProcessSectionTypeDao; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.user.ProcessSectionType; -import com.sipai.tools.CommService; - -@Service -public class ProcessSectionTypeService implements CommService{ - @Resource - private ProcessSectionTypeDao processSectionTypeDao; - @Override - public ProcessSectionType selectById(String id) { - return processSectionTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return processSectionTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessSectionType entity) { - return processSectionTypeDao.insert(entity); - } - - @Override - public int update(ProcessSectionType entity) { - return processSectionTypeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessSectionType processSectionType = new ProcessSectionType(); - processSectionType.setWhere(wherestr); - List processSectionTypes = processSectionTypeDao.selectListByWhere(processSectionType); - return processSectionTypes; - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessSectionType processSectionType = new ProcessSectionType(); - processSectionType.setWhere(wherestr); - return processSectionTypeDao.deleteByWhere(processSectionType); - } -} diff --git a/src/com/sipai/service/user/RoleService.java b/src/com/sipai/service/user/RoleService.java deleted file mode 100644 index 5559dd85..00000000 --- a/src/com/sipai/service/user/RoleService.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sipai.service.user; - -import com.sipai.entity.user.Role; -import com.sipai.entity.user.RoleMenu; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserRole; - -import java.util.List; - -public interface RoleService { - - public List getList(String where); - - public Role getObj(String userId); - - public int dosave(Role role); - - public int doupdate(Role role); - - public int dodel(String roleId); - - /** - * 更新角色和菜单关系表 - * @param roleid - * @param menustr - * @return - */ - public int updateRoleMenu(String roleid, String menustr); - - /** - * 获得角色相关菜单 - * @param roleid - * @return - */ - public List getRoleMenu(String roleid); - - /** - * 获得角色相关功能 - * @param roleid - * @return - */ - public List getRoleFunc(String roleid); - /** - * 获取指定角色和菜单数据 - * @param roleid - * @param menuid - * @return - */ - public List getRoleFunc(String roleid,String menuid); - - /** - * 根据角色,更新用户关系 - * @param roleid - * @param menustr - * @return - */ - public int updateUserRole(String roleid, String menustr); - - /** - * 根据用户,更新角色关系 - * @param roleid - * @param menustr - * @return - */ - public int updateRoleUser(String userid,String rolestr); - - /** - * 根据部门,更新部门权限关系 用户和权限关系 - * @param roleid - * @param menustr - * @return - */ - public int updateRoleDept(String deptid,String rolestr_new,String rolestr_old); - /** - * 获得角色相关用户 - * @param roleid - * @param menustr - * @return - */ - public List getUserRole(String roleid); - public List getRoleUsers(String whereStr); - /** - * 根据角色和菜单,更新功能权限 - * @param roleid - * @param menustr - * @return - */ - public int updateFuncByRoleMenu(String roleid, String menuid, String funcstr); - - public int deleteRoleMenuByMenuId(String menuIds); - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name); - - public int saveUserRole(String roleSerial,String userId); - public List selectRoleListByUser(String wherestr); - -} diff --git a/src/com/sipai/service/user/RoleServiceImpl.java b/src/com/sipai/service/user/RoleServiceImpl.java deleted file mode 100644 index 75f87505..00000000 --- a/src/com/sipai/service/user/RoleServiceImpl.java +++ /dev/null @@ -1,297 +0,0 @@ -package com.sipai.service.user; - -import com.sipai.dao.user.*; -import com.sipai.entity.user.*; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class RoleServiceImpl implements RoleService { - - @Resource - private RoleDao roleDao; - - @Resource - private RoleMenuDao roleMenuDao; - - @Resource - private UserRoleDao userRoleDao; - - @Resource - private DeptRoleDao deptRoleDao; - - @Resource - private UnitDao unitDao; - @Resource - private UserService userService; - - @Resource - private UserDao userDao; - - @Override - public List getList(String where) { - Role role = new Role(); - role.setWhere(where); - List rolelist = roleDao.selectListByWhere(role); - for(int i = 0;i getRoleMenu(String roleid){ - return roleMenuDao.selectMenuListByRole(roleid); - } - - @Override - public List getRoleFunc(String roleid){ - return roleMenuDao.selectFuncListByRole(roleid); - } - @Override - public List getRoleFunc(String roleid,String menuid){ - String wherestr = "where roleid = '"+roleid+"' and menuID='"+menuid+"' order by roleid "; - RoleMenu roleMenu = new RoleMenu(); - roleMenu.setWhere(wherestr); - return roleMenuDao.selectListByWhere(roleMenu); - } - - @Override - public int updateRoleMenu(String roleid,String menustr){ - int insres=0; - int delres=roleMenuDao.deleteMenuByRole(roleid); - if(delres>=0 && !menustr.trim().equals("")){ - String[] menuids=menustr.split(","); - for(String menuid:menuids){ - RoleMenu roleMenu = new RoleMenu(); - roleMenu.setRoleid(roleid); - roleMenu.setMenuid(menuid); - - insres += roleMenuDao.insert(roleMenu); - } - } - return insres; - } - - @Override - public int updateFuncByRoleMenu(String roleid,String menuid,String funcstr){ - int insres=0; - int delres=roleMenuDao.deleteFuncByRoleMenu(roleid, menuid); - if(delres>=0 && !funcstr.trim().equals("")){ - String[] funcids=funcstr.split(","); - for(String funcid:funcids){ - RoleMenu roleMenu = new RoleMenu(); - roleMenu.setRoleid(roleid); - roleMenu.setMenuid(funcid); - - insres += roleMenuDao.insert(roleMenu); - } - } - return insres; - } - /** - * 获取权限用户关系表信息 - */ - @Override - public List getUserRole(String roleid){ - return userRoleDao.selectListByRole(roleid); - } - /** - * 获取权限下的所有用户 - * @param roleid - * @return - */ - public List getRoleUsers(String whereStr){ - List roles=this.getList(whereStr); - String roleIds=""; - for (Role role : roles) { - if (!roleIds.isEmpty()) { - roleIds+="','"; - } - roleIds+=role.getId(); - } - UserRole userRole = new UserRole(); - userRole.setWhere("where roleid in ('"+roleIds+"')"); - List userRoles=userRoleDao.selectListByWhere(userRole); - String userIds=""; - for (UserRole item : userRoles) { - if (!userIds.isEmpty()) { - userIds+="','"; - } - userIds+=item.getEmpid(); - } - List users = userService.selectListByWhere("where id in ('"+userIds+"')"); - return users; - } - @Override - public int updateUserRole(String roleid,String userstr){ - int insres=0; - int delres=userRoleDao.deleteByRole(roleid); - if(delres>=0 && !userstr.trim().equals("")){ - String[] userids=userstr.split(","); - for(String userid:userids){ - UserRole userRole = new UserRole(); - userRole.setRoleid(roleid); - userRole.setEmpid(userid); - - insres += userRoleDao.insert(userRole); - } - } - return insres; - } - @Override - public int saveUserRole(String roleSerial,String userId){ - List roles=this.getList("where serial='"+roleSerial+"'"); - int res=0; - if(roles!=null && roles.size()>0){ - userRoleDao.deleteByUser(userId); - UserRole userRole = new UserRole(); - userRole.setRoleid(roles.get(0).getId()); - userRole.setEmpid(userId); - res= userRoleDao.insert(userRole); - } - return res; - } - @Override - public int updateRoleUser(String userid,String rolestr){ - int insres=0; - int delres=userRoleDao.deleteByUser(userid); - if(delres>=0 && !rolestr.trim().equals("")){ - String[] roleids=rolestr.split(","); - for(String roleid:roleids){ - UserRole userRole = new UserRole(); - userRole.setRoleid(roleid); - userRole.setEmpid(userid); - - insres += userRoleDao.insert(userRole); - } - } - return insres; - } - - @Override - public int updateRoleDept(String deptid,String rolestr_new,String rolestr_old){ - //先删除此部门所有权限,再加上新权限 - int insdeptres = 0; - String[] roleids=rolestr_new.split(","); - DeptRole delDeptRole = new DeptRole(); - delDeptRole.setWhere(" where deptid = '"+deptid+"'"); - int deptdelres = this.deptRoleDao.deleteByWhere(delDeptRole); - if(deptdelres>=0 && !rolestr_new.trim().equals("")){ - for(String roleid:roleids){ - DeptRole deptRole = new DeptRole(); - deptRole.setRoleid(roleid); - deptRole.setDeptid(deptid); - deptRole.setId(CommUtil.getUUID()); - insdeptres += deptRoleDao.insert(deptRole); - } - //若部门权限insert数和前端传来的权限数不同,返回错误编码0 - if(insdeptres != roleids.length){ - insdeptres = 0; - } - } - - //再删除此部门所有人员旧权限,添加新权限 - User user = new User(); - user.setWhere(" where pid = '"+deptid+"'"); - List userList = this.userDao.selectListByWhere(user); - for(int i=0;i list = this.getList(" where name='"+name+"' order by id"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(Role role :list){ - if(!id.equals(role.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } - - @Override - public List selectRoleListByUser(String wherestr){ - Role role = new Role(); - role.setWhere(wherestr); - return this.roleDao.selectRoleListByUser(role); - } -} diff --git a/src/com/sipai/service/user/UnitService.java b/src/com/sipai/service/user/UnitService.java deleted file mode 100644 index 1376c092..00000000 --- a/src/com/sipai/service/user/UnitService.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.sipai.service.user; - -import com.sipai.entity.info.InfoRecv; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.springframework.stereotype.Service; - -public interface UnitService { - public int deleteCompanyById(String id); - - public List selectList(); - - public Unit getUnitById(String id); - - /** - * 获取简称,如果没有返回全称 - * - * @param unit - * @return - */ - public String getSnameById(String id); - - public Company getCompById(String id); - - public int deleteCompById(String id); - - public int saveComp(Company t); - - public int updateComp(Company t); - - public Dept getDeptById(String id); - - public List getDeptByPid(String pid); - - public int deleteDeptById(String id); - - public int saveDept(Dept t); - - public int updateDept(Dept t); - - public List selectListByWhere(String wherestr); - - public List getCompaniesByWhere(String wherestr); - - /** - * 获得当前节点所有的子元素(包含当前节点) - * - * @param id - * @return - */ - public List getUnitChildrenById(String id); - - public String getUnitChildrenById2(String id); - - public List getChildrenUsersById(String id); - - public List getChildrenUsersByIdWithRole(String pid, String serial); - - public int saveUnit(Unit unit); - - public int updateUnit(Unit unit); - - public int deleteUnit(Unit unit); - - public List getCompanyByUserIdAndType(String userId, String type); - - public List getCompaniesByUserId(String userId); - - public Unit getParentBizByUnitId(String unitId); - - public Company getCompanyByUserId(String userId); - - public List getCompany(); - - public Company fixCompanyInfo(Company company); - - public String getTreeList(List> list_result, List list); - - public String doCheckBizOrNot(String userId); - - /** - * 维护商获取维护过的厂区清单 - */ - public List getMaintenanceBizsByWhere(String wherestr); - - /** - * 获得公告接收的公司、部门 - */ - public List getInfoRecvName(List infoRecv); - - public List getParentCompanyChildrenBiz(User user); - - public List getParentCompanyChildrenNode(User user); - - public List getAllCompanyNode(); - - public User getUserAllInfo(String userid); - - public List getParentCompanyChildrenBizByUnitid(String unitId); - - public List getParentChildrenByUnitid(String unitId); - - public Set findAllCompanyIdByCompanyId(Set companyIdList, String companyId); - - List getParentCompanyChildrenDept(User user); - - public List getCompanyByType(String unitTypeBiz); - - public String getAllParentBizId(String bizid); - - public String getAllBizIdFromFather(String bizid, String bizids); - - public List getChildrenCBWByUnitId(String unitId); - - public String getAllUsersByUserId(String userId); - - public String getChildrenBizids(String unitId); - - public Unit getUserBelongingCompany(String userId); -} diff --git a/src/com/sipai/service/user/UnitServiceImpl.java b/src/com/sipai/service/user/UnitServiceImpl.java deleted file mode 100644 index 88a36c5a..00000000 --- a/src/com/sipai/service/user/UnitServiceImpl.java +++ /dev/null @@ -1,1121 +0,0 @@ -package com.sipai.service.user; - -import com.sipai.dao.user.CompanyDao; -import com.sipai.dao.user.DeptDao; -import com.sipai.dao.user.UnitDao; -import com.sipai.entity.info.InfoRecv; -import com.sipai.entity.timeefficiency.PatrolArea; -import com.sipai.entity.user.*; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.*; - -@Service("unitService") -public class UnitServiceImpl implements UnitService { - - @Resource - private UnitDao unitDao; - @Resource - private CompanyDao compDao; - @Resource - private DeptDao deptDao; - @Resource - private UserService userService; - @Resource - private RoleService roleService; - @Resource - private ExtSystemService extSystemService; - @Resource - private DeptProcessService deptProcessService; - @Resource - private DeptRoleService deptRoleService; - @Resource - private DeptAreaService deptAreaService; - - @Override - public List selectList() { - Unit unit= new Unit(); - return this.unitDao.selectList(unit); - } - - @Override - public Unit getUnitById(String id) { - return this.unitDao.getUnitById(id); - } - - @Override - public String getSnameById(String id) { - String res=""; - Unit unit=this.getUnitById(id); - if(unit !=null){ - if(unit.getSname()==null){ - res = unit.getName(); - }else{ - if(unit.getSname().trim().equals("")){ - res = unit.getName(); - }else{ - res = unit.getSname(); - } - } - } - return res; - } - - @Override - public Company getCompById(String id) { - return this.compDao.selectByPrimaryKey(id); - } - - @Override - public int deleteCompById(String id) { - Company company = this.getCompById(id); - company.setActive(CommString.Active_False); - return updateComp(company); - } - - @Override - public int saveComp(Company t) { - return this.compDao.insert(t); - } - - @Override - public int updateComp(Company t) { - return this.compDao.updateByPrimaryKeySelective(t); - } - - @Override - public Dept getDeptById(String id) { - return this.deptDao.selectByPrimaryKey(id); - } - - @Override - public int deleteDeptById(String id) { - return this.deptDao.deleteByPrimaryKey(id); - } - - @Override - public int saveDept(Dept t) { - return this.deptDao.insert(t); - } - - @Override - public int updateDept(Dept t) { - return this.deptDao.updateByPrimaryKeySelective(t); - } - @Override - public List selectListByWhere(String wherestr) { - Unit unit= new Unit(); - unit.setWhere(wherestr); - return this.unitDao.selectListByWhere(unit); - } - - List t = new ArrayList(); - @Override - public List getUnitChildrenById(String id){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - List listRes = getChildren(id,t); - listRes.add(getUnitById(id)); - listRes.removeAll(Collections.singleton(null)); - return listRes; - } - - String companyIds = ""; - @Override - public String getUnitChildrenById2(String id){ - getChildren(id); - String nowString=id+","+companyIds; - companyIds=""; - return nowString; - } - - /** - * 递归获取子节点 - * @param list - */ - public List getChildren(String pid,List t){ - List t2 = new ArrayList(); - for(int i=0;i result=getChildren(t.get(i).getId(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - - /** - * 递归获取子节点厂id - * @param - */ - public String getChildren(String pid){ -// Unit unit=unitService.getUnitById(pid); - List t2 = selectListByWhere(" where pid='"+pid+"' and active='"+CommString.Flag_Active+"' and (type in ('"+CommString.UNIT_TYPE_BIZ - +"','"+CommString.UNIT_TYPE_COMPANY+"')) "); - if(t2!=null&&t2.size()>0){ - for(int i=0;i getParent(String pid,List t){ - - List t2 = new ArrayList(); - for(int i=0;i result =getParent(t.get(i).getPid(),t); - if(result!=null){ - t2.addAll(result); - } - } - } - return t2; - } - /** - * 按公司类型获取用户的所在厂信息, - * @param type 水厂、运维商 当为null或者“”时,则显示用户所有 - */ - public List getCompanyByUserIdAndType(String userId,String type){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - List companies = new ArrayList<>(); - User user = userService.getUserById(userId); - List units = this.getParent(user.getPid(),t); - String pid ="-1";//未查询到上级组织,默认管理员 - if(units!=null && units.size()>0){ - for (int i =0; i units_c =getChildren(pid,t); - if(!"-1".equals(pid)){ - units_c.add(getUnitById(pid)); - } - - for (Unit unit : units_c) { - if (type!=null && !type.isEmpty()) { - if(unit.getType().equals(type)){ - Company company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setSname(unit.getSname()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - companies.add(company); - } - }else{ - Company company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setSname(unit.getSname()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - companies.add(company); - } - - } - return companies; - } - public List getCompanyByType(String type){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - List companies = new ArrayList<>(); - String pid ="-1";//未查询到上级组织,默认管理员 - List units_c =getChildren(pid,t); - if(!"-1".equals(pid)){ - units_c.add(getUnitById(pid)); - } - - for (Unit unit : units_c) { - if (type!=null && !type.isEmpty()) { - if(unit.getType().equals(type)){ - Company company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - companies.add(company); - } - }else{ - Company company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - companies.add(company); - } - - } - return companies; - } - /** - * 获取所有厂信息 - * - */ - public List getCompany(){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - List companies = new ArrayList<>(); - String pid ="-1";//未查询到上级组织,默认管理员 - List units_c =getChildren(pid,t); - if(!"-1".equals(pid)){ - units_c.add(getUnitById(pid)); - } - - for (Unit unit : units_c) { - Company company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - companies.add(company); - - } - return companies; - } - /** - * 获取设备信息 - * map参数: ids,bizid,page,row,searchName,psectionid - * */ - public Company fixCompanyInfo(Company company) { - String url=""; - ExtSystem extSystem= this.extSystemService.getActiveDataManage(null); - if(extSystem!=null){ - url=extSystem.getUrl(); - } - url+="/proapp.do?method=getBizs"; - Map map = new HashMap<>(); - map.put("bizId", company.getId()); - try { - String resp = com.sipai.tools.HttpUtil.sendPost(url, map); - JSONObject jsonObject = JSONObject.fromObject(resp); - JSONArray re1=jsonObject.getJSONArray("re1"); - JSONObject resCompany =re1.getJSONObject(0); - company.setAddress(resCompany.get("location")==null?"":resCompany.get("location").toString()); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - return company; - } - /** - * 获取用户的所在厂信息,只获取实际运行的水厂或运维商 - * @param - */ - public List getCompaniesByUserId(String userId){ - List companies = new ArrayList<>(); - List companies_biz =getCompanyByUserIdAndType(userId, CommString.UNIT_TYPE_BIZ); - List companies_m =getCompanyByUserIdAndType(userId, CommString.UNIT_TYPE_Maintainer); - companies.addAll(companies_biz); - companies.addAll(companies_m); - return companies; - } - /** - * 获取用户的所在公司 - * @param - */ - public Company getCompanyByUserId(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - List companies = new ArrayList<>(); - User user = userService.getUserById(userId); - List units = this.getParent(user.getPid(),t); - String id ="-1";//未查询到上级组织,默认管理员 - if(units!=null && units.size()>0){ - for (int i =0; i getCompaniesByWhere(String wherestr){ - Company company = new Company(); - company.setWhere(wherestr); - return this.compDao.selectListByWhere(company); - }; - - /** - * 检查是否是厂区人员,否则为运营商 - * - * */ - public String doCheckBizOrNot(String userId){ - if ("emp01".equals(userId)) { - //管理员默认为厂区人员类型 - return CommString.UserType_Other; - } - List companies=getCompaniesByUserId(userId); - String userType =CommString.UserType_Other; - if(companies!=null && companies.size()>0){ - int i=0; - for (i = 0; i < companies.size(); i++) { - if(CommString.UNIT_TYPE_Maintainer.equals(companies.get(i).getType())){ - break; - } - } - if(i==companies.size()){ - userType= CommString.UserType_Biz; - }else{ - userType= CommString.UserType_Maintainer; - } - - } - return userType; - } - /** - * 获取子节点下所有用户user - * @param - */ - public List getChildrenUsersById(String pid){ - //t=selectList(); - List unitlist = getUnitChildrenById(pid); - String pidstr=""; - String wherestr=" where 1=1 "; - String orderstr=" order by name asc "; - for(int i=0;i listRes=new ArrayList(); - if(!pidstr.equals("")){ - pidstr = pidstr.substring(0, pidstr.length()-1); - wherestr += "and pid in ("+pidstr+") "; - listRes = this.userService.selectListByWhere(wherestr+orderstr); - } - return listRes; - } - /** - * 根据权限serial,获取公司下所有用户user - * @param - */ - public List getChildrenUsersByIdWithRole(String pid,String serial){ - - List listRes=new ArrayList(); - List list= getChildrenUsersById(pid); - - List roles =roleService.getList("where serial='"+serial+"'"); - List list_userrole=new ArrayList<>(); - for (Role role : roles) { - List items = this.roleService.getUserRole(role.getId()); - list_userrole.addAll(items); - } - for (User user : list) { - for (UserRole userRole : list_userrole) { - if(user.getId().equals(userRole.getEmpid())){ - listRes.add(user); - break; - } - } - - } - - return listRes; - } - /** - * 保存同步过来的unit*/ - public int saveUnit(Unit unit){ - int resp=0; - switch (unit.getType()) { - case CommString.UNIT_TYPE_COMPANY: - Company company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setSname(unit.getSname()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - company.setInsdt(CommUtil.nowDate()); - resp=saveComp(company); - break; - case CommString.UNIT_TYPE_BIZ: - company = new Company(); - company.setId(unit.getId()); - company.setName(unit.getName()); - company.setSname(unit.getSname()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - company.setInsdt(CommUtil.nowDate()); - resp=saveComp(company); - break; - case CommString.UNIT_TYPE_DEPT: - Dept dept = new Dept(); - dept.setId(unit.getId()); - dept.setName(unit.getName()); - dept.setSname(unit.getSname()); - dept.setPid(unit.getPid()); - dept.setInsdt(new Date()); - resp = saveDept(dept); - break; - case CommString.UNIT_TYPE_USER: - User user = new User(); - user.setId(unit.getId()); - user.setName(unit.getName()); - user.setPassword(UserCommStr.default_password); - /*try { - String password=CommUtil.generatePassword(URLEncoder.encode("123456", "utf-8")); - user.setPassword(password); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - }*/ - user.setActive(CommString.Active_True); - user.setCaption(unit.getSname()); - user.setPid(unit.getPid()); - user.setMobile(unit.getTaskid()); - user.setSyncflag(CommString.Sync_Finish); - resp =userService.saveUserWithBaseRole(user); - break; - - default: - break; - } - return resp; - } - /** - * 保存同步过来的unit*/ - public int updateUnit(Unit unit){ - int resp=0; - switch (unit.getType()) { - case CommString.UNIT_TYPE_COMPANY: - Company company = this.getCompById(unit.getId()); - if(company!=null){ - company.setName(unit.getName()); - company.setSname(unit.getSname()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - company.setInsdt(CommUtil.nowDate()); - resp = updateComp(company); - }else{ - resp = saveUnit(unit); - } - break; - case CommString.UNIT_TYPE_BIZ: - company=null; - company = this.getCompById(unit.getId()); - if(company!=null){ - company.setName(unit.getName()); - company.setSname(unit.getSname()); - company.setPid(unit.getPid()); - company.setType(unit.getType()); - company.setInsdt(CommUtil.nowDate()); - resp = updateComp(company); - }else{ - resp = saveUnit(unit); - } - break; - case CommString.UNIT_TYPE_DEPT: - Dept dept = this.getDeptById(unit.getId()); - if(dept!=null){ - dept.setId(unit.getId()); - dept.setName(unit.getName()); - dept.setSname(unit.getSname()); - dept.setPid(unit.getPid()); - dept.setInsdt(new Date()); - resp= this.updateDept(dept); - }else{ - resp=saveUnit(unit); - } - - break; - case CommString.UNIT_TYPE_USER: - User user = this.userService.getUserById(unit.getId()); - if(user!=null){ - user.setName(unit.getName()); - user.setCaption(unit.getSname()); - user.setPid(unit.getPid()); - user.setMobile(unit.getTaskid()); - user.setSyncflag(CommString.Sync_Finish); - resp =userService.updateUserById(user); - }else{ - resp= saveUnit(unit); - } - - break; - default: - break; - } - return resp; - } - /** - * 保存同步过来的unit*/ - public int deleteUnit(Unit unit){ - int resp=0; - switch (unit.getType()) { - case CommString.UNIT_TYPE_COMPANY: - resp = deleteCompById(unit.getId()); - break; - case CommString.UNIT_TYPE_BIZ: - resp = deleteCompById(unit.getId()); - break; - case CommString.UNIT_TYPE_DEPT: - resp = this.deleteDeptById(unit.getId()); - break; - case CommString.UNIT_TYPE_USER: - resp=this.userService.deleteUserById(unit.getId()); - break; - - default: - break; - } - return resp; - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list) { - - /*if(list_result == null ) { - list_result = new ArrayList>(); - for(Unit k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - if(k.getType().equals(CommString.UNIT_TYPE_BIZ)){ - map.put("icon", CommString.UNIT_BIZ_ICON); - }else if(k.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - map.put("icon", CommString.UNIT_COMPANY_ICON); - }else if(k.getType().equals(CommString.UNIT_TYPE_DEPT)){ - map.put("icon", CommString.UNIT_DEPT_ICON); - } - list_result.add(map); - } - } - getTreeList(list_result,list);*/ - //20181212 YYJ 树根节点判断方法为该项的pid不在数组中的id内出现则认为根节点 - if(list_result == null ) { - list_result = new ArrayList>(); - for(Unit k: list) { - Map map = new HashMap(); - Inner:for(int i =0;i0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Unit k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getSname()); - m.put("type", k.getType()); - if(k.getType().equals(CommString.UNIT_TYPE_BIZ)){ - m.put("icon", CommString.UNIT_BIZ_ICON); - }else if(k.getType().equals(CommString.UNIT_TYPE_COMPANY)){ - m.put("icon", CommString.UNIT_COMPANY_ICON); - }else if(k.getType().equals(CommString.UNIT_TYPE_DEPT)){ - m.put("icon", CommString.UNIT_DEPT_ICON); - }else if(k.getType().equals(CommString.UNIT_TYPE_USER)){ - m.put("icon", CommString.UNIT_USER_ICON); - }else if(k.getType().equals(CommString.UNIT_TYPE_Maintainer)){ - m.put("icon", CommString.UNIT_Maintainer_ICON); - } - List tags = new ArrayList(); - /* tags.add(k.getDescription()); - m.put("tags", tags);*/ - childlist.add(m); - } - } - if(childlist.size()>0) { - /*List sizelist = new ArrayList(); - sizelist.add(childlist.size()+""); - mp.put("tags", sizelist);*/ - mp.put("nodes", childlist); -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("text", "sdfsf"); - - getTreeList(childlist,list); - } - } - } - /* for (Map item : list_result) { - JSONObject jsonObject = new JSONObject(); - item.put("state", jsonObject); - jsonObject=null; - }*/ - return JSONArray.fromObject(list_result).toString(); - } - /** - * 维护商获取维护过的厂区清单 - * */ - public List getMaintenanceBizsByWhere(String wherestr) { - Unit unit = new Unit(); - unit.setWhere(wherestr); - List units =unitDao.getMaintenanceBizsByWhere(unit); - return units; - } - /** - * 获得公告接收的公司、部门 - * */ - @Override - public List getInfoRecvName(List infoRecv) { - List list=new ArrayList(); - if(infoRecv!=null && infoRecv.size()>0){ - for(int i=0;i getParentCompanyDeptByUserId(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - User user = userService.getUserById(userId); - List units = this.getParent(user.getPid(),t); - List units_result = new ArrayList(); - if(units!=null && units.size()>0){ - for (int i =0; i getParentCompanyBizByUserId(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - User user = userService.getUserById(userId); - List units = this.getParent(user.getPid(),t); - List units_result = new ArrayList(); - if(units!=null && units.size()>0){ - for (int i =0; i getChildrenExceptUser(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - //User user = userService.getUserById(userId); - List units = this.getChildren(userId,t); - List units_result = new ArrayList(); - if(units!=null && units.size()>0){ - for (int i =0; i getChildrenOnlyBiz(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - //User user = userService.getUserById(userId); - List units = this.getChildren(userId,t); - List units_result = new ArrayList(); - if(units!=null && units.size()>0){ - for (int i =0; i getChildrenByCAndD(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by type,morder"); - //User user = userService.getUserById(userId); - List units = this.getChildren(userId,t); - List units_result = new ArrayList(); - if(units!=null && units.size()>0){ - for (int i =0; i getParentCompanyChildrenBizByUnitid(String unitId) { - List units_result = new ArrayList(); - Unit parents =getUnitById(unitId); - List childrens =getChildrenOnlyBiz(unitId); - units_result.add(parents); - units_result.addAll(childrens); - return units_result; - } - - /** - * 通过厂id以Unit形式获取父公司节点下所有水厂 部门 - * */ - @Override - public List getParentChildrenByUnitid(String unitId) { - List units_result = new ArrayList(); - Unit parents =getUnitById(unitId); - List childrens =getChildrenByCAndD(unitId); - units_result.add(parents); - units_result.addAll(childrens); - return units_result; - } - - /** - * 以Unit形式获取用户父公司节点下所有水厂(水厂选择) - * */ - @Override - public List getParentCompanyChildrenBiz(User user) { - List units_result = new ArrayList(); - if(user.getId().equals(CommString.ID_Admin)){//管理员时 - List all =selectListByWhere(" where (type in ('"+CommString.UNIT_TYPE_BIZ - +"','"+CommString.UNIT_TYPE_COMPANY+"')) and active='"+CommString.Flag_Active+"' ");//and active='"+CommString.Flag_Active+"' - units_result.addAll(all); - }else{//非管理员时 - List parents =getParentCompanyBizByUserId(user.getId()); - List childrens =getChildrenOnlyBiz(parents.get(parents.size()-1).getId()); - units_result.addAll(parents); - units_result.addAll(childrens); - } - return units_result; - } - /** - * 以Unit形式获取用户父公司节点下所有水厂(水厂选择) - * */ - @Override - public List getParentCompanyChildrenDept(User user) { - List units_result = new ArrayList(); - if(user.getId().equals(CommString.ID_Admin)){//管理员时,管理员可以看到所有状态的数据 - List all =selectListByWhere(" where (type in ('"+CommString.UNIT_TYPE_BIZ - +"','"+CommString.UNIT_TYPE_COMPANY+"','"+CommString.UNIT_TYPE_DEPT+"')) order by morder asc");//and active='"+CommString.Flag_Active+"' - units_result.addAll(all); - }else{//非管理员时 - List parents =getParentCompanyBizByUserId(user.getId()); - List childrens =getChildrenOnlyBiz(parents.get(parents.size()-1).getId()); - units_result.addAll(parents); - units_result.addAll(childrens); - } - return units_result; - } - /** - * 以Unit形式获取用户父公司、部门以及用户子节点下所有非用户单位, - * */ - @Override - public List getParentCompanyChildrenNode(User user) { - List units_result = new ArrayList(); - if(user.getId().equals(CommString.ID_Admin)){//管理员时 - List all =selectListByWhere(" where type not in ('"+CommString.UNIT_TYPE_USER - +"','"+CommString.UNIT_TYPE_Maintainer+"')"+"order by morder asc");//and active='"+CommString.Flag_Active+"' - units_result.addAll(all); - }else{//非管理员时 - List parents =getParentCompanyDeptByUserId(user.getId()); - List childrens =getChildrenExceptUser(parents.get(parents.size()-1).getId()); - units_result.add(parents.get(parents.size()-1)); - units_result.addAll(childrens); - } - return units_result; - } - @Override - public Unit getUserBelongingCompany(String userId) { - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - User user = userService.getUserById(userId); - List units = this.getParent(user.getPid(),t); - Unit unit = new Unit(); - if(units!=null && units.size()>0){ - for (int i =0; i getAllCompanyNode() { - List units_result = new ArrayList(); - List all =selectListByWhere(" where type not in ('"+CommString.UNIT_TYPE_USER - +"','"+CommString.UNIT_TYPE_Maintainer+"') ");//and active='"+CommString.Flag_Active+"' - units_result.addAll(all); - return units_result; - } - - /** - * 获取部门信息 - * @param id - * @return - */ - public Dept getDept(String id) { - Dept dept = this.deptDao.selectByPrimaryKey(id); - if(dept!=null){ - String wherestr = " where D.deptid = '"+dept.getId(); - List roleList = this.deptRoleService.selectRoleListByDept(wherestr+"' order by R.morder"); - /*List processSectionList = this.deptProcessService.selectProcessListByDept(wherestr+"' order by P.morder");*/ - List patrolAreaList = this.deptAreaService.selectAreaListByDept(wherestr+"' order by P.insdt desc"); - dept.setRoleList(roleList); - dept.setPatrolAreaList(patrolAreaList); - } - return dept; - } - - /** - * 通过厂区id获取小组(部门)信息 - * @param - * @return - */ - public List getDeptByPid(String pid) { - Dept deptRequest = new Dept(); - deptRequest.setWhere(" where pid = '"+pid+"' order by morder"); - List deptList = this.deptDao.selectListByWhere(deptRequest); - for(int i=0;i roleList = this.deptRoleService.selectRoleListByDept(wherestr+"' order by R.morder"); - /*List processSectionList = this.deptProcessService.selectProcessListByDept(wherestr+"' order by P.morder");*/ - List patrolAreaList = this.deptAreaService.selectAreaListByDept(wherestr+"' order by P.insdt desc"); - deptList.get(i).setRoleList(roleList); - deptList.get(i).setPatrolAreaList(patrolAreaList); - } - return deptList; - } - - /** - * 获取用户的所有信息 - * */ - @Override - public User getUserAllInfo(String userid) { - User user = this.userService.getUserById(userid); - List userRoles = this.roleService.selectRoleListByUser(" where U.EmpID = '"+user.getId()+"'"); - Dept dept = this.getDept(user.getPid()); - user.setRoles(userRoles); - user.setDept(dept); - return user; - } - @Override - public int deleteCompanyById(String id) { - return compDao.deleteByPrimaryKey(id); - } - - /** - * 通过unitId以Unit形式获取用户父公司、水厂 - * */ - public Unit getParentBizByUnitId(String unitId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - List units = this.getParent(unitId,t); - Unit units_result = new Unit(); - if(units!=null && units.size()>0){ - for (int i =0; i findAllCompanyIdByCompanyId(Set companyIdList,String companyId){ - companyIdList.add(companyId); - Company company = new Company(); - company.setWhere(" where pid='"+companyId+"'"); - List companyList=compDao.selectListByWhere(company); - if(companyList.size()>0 && null!=companyList && !companyList.isEmpty()){ - for(Company companyVar:companyList){ - companyIdList.add(companyVar.getId()); - findAllCompanyIdByCompanyId(companyIdList,companyVar.getId()); - } - } - - return companyIdList; - } - - @Override - public String getAllParentBizId(String bizid){ - String parentBizids=""; - - List units = this.getParent(bizid,t); - if(units!=null&&units.size()>0){ - for(int i=0;i units = selectListByWhere(" where pid='"+bizid+"' and active='"+CommString.Active_True+"' and type in ('"+CommString.UNIT_TYPE_BIZ+"','"+CommString.UNIT_TYPE_COMPANY+"') order by morder "); - if(units!=null&&units.size()>0){ - for(int i=0;i units = this.selectListByWhere(" where pid='"+bizid+"' and type in ('"+CommString.UNIT_TYPE_BIZ+"','"+CommString.UNIT_TYPE_COMPANY+"') and active='"+CommString.Active_True+"' order by morder"); - if(units!=null&&units.size()>0){ - for(int i=0;i getChildrenCBWByUnitId(String unitId) { - List childrens =getChildrenToWorkshop(unitId); - return childrens; - } - - /** - * 以Unit形式获取用户子节点下所有公司、水厂、车间 - * */ - public List getChildrenToWorkshop(String userId){ - t=selectListByWhere(" where active='"+CommString.Flag_Active+"' order by morder"); - //User user = userService.getUserById(userId); - List units = this.getChildren(userId,t); - List units_result = new ArrayList(); - if(units!=null && units.size()>0){ - for (int i =0; i userList= this.getChildrenUsersById(unit.getPid()); - if(userList!=null && userList.size()>0){ - for (User user :userList) { - result += user.getId()+","; - } - result = result.substring(0, result.length()-1); - } - } - return result; - } - -} diff --git a/src/com/sipai/service/user/UserDetailService.java b/src/com/sipai/service/user/UserDetailService.java deleted file mode 100644 index a5b08d05..00000000 --- a/src/com/sipai/service/user/UserDetailService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.user; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.UserDetailDao; -import com.sipai.entity.user.UserDetail; -import com.sipai.tools.CommService; - -@Service -public class UserDetailService implements CommService{ - @Resource - private UserDetailDao userDetailDao; - - @Override - public UserDetail selectById(String id) { - return userDetailDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return userDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(UserDetail userDetail) { - return userDetailDao.insert(userDetail); - } - - @Override - public int update(UserDetail userDetail) { - return userDetailDao.updateByPrimaryKeySelective(userDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - UserDetail userDetail = new UserDetail(); - userDetail.setWhere(wherestr); - return userDetailDao.selectListByWhere(userDetail); - } - - @Override - public int deleteByWhere(String wherestr) { - UserDetail userDetail = new UserDetail(); - userDetail.setWhere(wherestr); - return userDetailDao.deleteByWhere(userDetail); - } - /** - * 根据用户Id判断用户的头像信息是否存在 - * @param userId - * @return - */ - public UserDetail selectByUserId(String userId){ - Listlist = this.selectListByWhere("where userid = '"+userId+"'"); - if (list != null && list.size()>0) { - UserDetail userDetail = list.get(0); - return userDetail; - }else { - return null; - } - } -} diff --git a/src/com/sipai/service/user/UserJobService.java b/src/com/sipai/service/user/UserJobService.java deleted file mode 100644 index 70790de8..00000000 --- a/src/com/sipai/service/user/UserJobService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.user; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.UserJobDao; -import com.sipai.entity.user.UserJob; -import com.sipai.tools.CommService; - -@Service -public class UserJobService implements CommService{ - @Resource - private UserJobDao userJobDao; - - @Override - public UserJob selectById(String t) { - UserJob uj=userJobDao.selectByPrimaryKey(t); - return uj; - } - - @Override - public int deleteById(String t) { - int resultNum=userJobDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(UserJob t) { - int resultNum=userJobDao.insert(t); - return resultNum; - } - - @Override - public int update(UserJob t) { - int resultNum=userJobDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - UserJob uj=new UserJob(); - uj.setWhere(t); - List ujList=userJobDao.selectListByWhere(uj); - return ujList; - } - - @Override - public int deleteByWhere(String t) { - UserJob uj=new UserJob(); - uj.setWhere(t); - int resultNum=userJobDao.deleteByWhere(uj); - return resultNum; - } - -} - diff --git a/src/com/sipai/service/user/UserOutsidersService.java b/src/com/sipai/service/user/UserOutsidersService.java deleted file mode 100644 index 3f064b41..00000000 --- a/src/com/sipai/service/user/UserOutsidersService.java +++ /dev/null @@ -1,513 +0,0 @@ -package com.sipai.service.user; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.user.UserOutsidersDao; -import com.sipai.entity.hqconfig.EnterRecord; -import com.sipai.entity.hqconfig.PositionsCasual; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserOutsiders; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.hqconfig.EnterRecordService; -import com.sipai.service.hqconfig.PositionsCasualService; -import com.sipai.service.work.AreaManageService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sipai.websocket.PositionsNumWebSocket; -import org.apache.http.HttpEntity; -import org.apache.http.ParseException; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -@Service -public class UserOutsidersService implements CommService{ - @Resource - private UserOutsidersDao userOutsidersDao; - @Resource - UserService userService; - @Resource - UnitService unitService; - @Resource - private AreaManageService areaManageService; - @Resource - private EnterRecordService enterRecordService; - @Resource - private PositionsCasualService positionsCasualService; - - @Override - public UserOutsiders selectById(String t) { - UserOutsiders uj=userOutsidersDao.selectByPrimaryKey(t); - return uj; - } - - @Override - public int deleteById(String t) { - int resultNum=userOutsidersDao.deleteByPrimaryKey(t); - return resultNum; - } - - @Override - public int save(UserOutsiders t) { - int resultNum=userOutsidersDao.insert(t); - return resultNum; - } - - @Override - public int update(UserOutsiders t) { - int resultNum=userOutsidersDao.updateByPrimaryKeySelective(t); - return resultNum; - } - - @Override - public List selectListByWhere(String t) { - UserOutsiders uj=new UserOutsiders(); - uj.setWhere(t); - List ujList=userOutsidersDao.selectListByWhere(uj); - return ujList; - } - - @Override - public int deleteByWhere(String t) { - UserOutsiders uj=new UserOutsiders(); - uj.setWhere(t); - int resultNum=userOutsidersDao.deleteByWhere(uj); - return resultNum; - } - - public String getPositionApi4tag(String cardid) throws IOException { - String access_token = getToken(); - JSONArray jsonArray = new JSONArray(); - if(access_token!=null && !access_token.isEmpty()){ - System.out.println("获取token:"+access_token); - //读取配置文件 - Properties properties = new CommUtil().getProperties("rabbitmq.properties"); - String host = properties.getProperty("positionApi.host"); - String port = properties.getProperty("positionApi.port"); - String url = "http://"+host+":"+port+"/positionApi/api/tag/list"; - String json = "{\"orgId\": 100,\"pageNum\": 1,\"pageSize\": 100}"; - String result = sendPOST(url, json, "bearer "+access_token); - JSONObject resultData = JSONObject.parseObject(result); - String code = resultData.get("code").toString(); - if(code!=null && !code.isEmpty() && "200".equals(code)){ - JSONObject data = JSONObject.parseObject(resultData.get("data").toString()); - JSONArray list = (JSONArray) data.get("records"); - if (list != null && list.size()>0) { - for(Object object:list){ - JSONObject tagObject = JSONObject.parseObject(object.toString()); - if(tagObject!=null){ - //标签号 - String tagId = tagObject.get("tagId").toString(); - //是否被绑定 - String F_CALCULATIONID = tagObject.get("used").toString(); - boolean saveBool = true; - if(!tagId.equals(cardid)){ - List users = userService.getUserByCardId(tagId); - if(users!=null && users.size()>0){ - saveBool = false; - } - } - if(saveBool){ - JSONObject jsonObject = new JSONObject(); - //查找不到直接插入 - jsonObject.put("id", tagId); - jsonObject.put("text", tagId); - jsonArray.add(jsonObject); - } - } - } - } - } - } - return jsonArray.toJSONString(); - } - public void getPositionApi4User() throws IOException { - String access_token = getToken(); - JSONArray jsonArray = new JSONArray(); - if(access_token!=null && !access_token.isEmpty()){ - //System.out.println("获取token:"+access_token); - //读取配置文件 - Properties properties = new CommUtil().getProperties("rabbitmq.properties"); - String host = properties.getProperty("positionApi.host"); - String port = properties.getProperty("positionApi.port"); - String url = "http://"+host+":"+port+"/positionApi/api/staff/dataList"; - //访客和承包商 - String json = "{\"orgId\": 100,\"type\": \"3\",\"pageNum\": 1,\"pageSize\": 100}"; - String result = sendPOST(url, json, "bearer "+access_token); - JSONObject resultData = JSONObject.parseObject(result); - //System.out.println("resultData:"+resultData.toString()); - if(resultData!=null && resultData.get("code")!=null){ - - String code = resultData.get("code").toString(); - if(code!=null && !code.isEmpty() && "200".equals(code)){ - JSONObject data = JSONObject.parseObject(resultData.get("data").toString()); - //System.out.println("data:"+data.toString()); - JSONArray list = (JSONArray) data.get("records"); - if (list != null && list.size()>0) { - //清空 - //this.deleteByWhere(""); - for(Object object:list){ - JSONObject tagObject = JSONObject.parseObject(object.toString()); - if(tagObject!=null){ - UserOutsiders userOutsiders = new UserOutsiders(); - boolean saveBool = true; - //删除标识(0.未删除1.已删除) - if(tagObject.get("deleted")!=null){ - String deleted = tagObject.get("deleted").toString(); - if("1".equals(deleted)){ - saveBool=false; - } - } - if(saveBool){ - //人员名称 - String name = tagObject.get("name").toString(); - //已绑定的标签id - String tagId = tagObject.get("tagId").toString(); - List lists =this.selectListByWhere("where name='"+name+"' or cardid='"+tagId+"' "); - if(lists!=null && lists.size()>0){ - userOutsiders = lists.get(0); - }else{ - userOutsiders.setId(CommUtil.getUUID()); - } - //性别(0.未填写1.男2.女) - /*String sex = tagObject.get("sex").toString(); - userOutsiders.setSex(sex);*/ - userOutsiders.setInsdt(CommUtil.nowDate()); - userOutsiders.setName(name); - userOutsiders.setCardid(tagId); - if(tagObject.get("unit")!=null){ - //承包商单位 - String unit = tagObject.get("unit").toString(); - //System.out.println("承包商单位:"+unit); - if("访客".equals(unit)){ - userOutsiders.setPid("1"); - }else{ - //承包商 - userOutsiders.setPid("2"); - } - }else{ - //未知 - userOutsiders.setPid("0"); - } - if(lists!=null && lists.size()>0){ - this.update(userOutsiders); - }else{ - this.save(userOutsiders); - } - } - } - } - } - } - - } - //内部人员 - json = "{\"orgId\": 100,\"type\": \"1\",\"pageNum\": 1,\"pageSize\": 200}"; - result = sendPOST(url, json, "bearer "+access_token); - resultData = JSONObject.parseObject(result); - - if(resultData!=null && resultData.get("code")!=null) { - String code = resultData.get("code").toString(); - if (code != null && !code.isEmpty() && "200".equals(code)) { - JSONObject data = JSONObject.parseObject(resultData.get("data").toString()); - JSONArray list = (JSONArray) data.get("records"); - if (list != null && list.size() > 0) { - for (Object object : list) { - JSONObject tagObject = JSONObject.parseObject(object.toString()); - if (tagObject != null) { - //System.out.println(tagObject); - User user = new User(); - boolean saveBool = true; - if (tagObject.get("jobNumber") != null && tagObject.get("name") != null) { - //工号 - String jobNumber = tagObject.get("jobNumber").toString(); - //人员名称 - String name = tagObject.get("name").toString(); - List users = this.userService.selectListByWhere2("where userCardId='" + jobNumber + "' "); - if (users != null && users.size() > 0) { - user = users.get(0); - //已绑定的标签id - if (tagObject.get("tagId") != null && !tagObject.get("tagId").toString().isEmpty()) { - String tagId = tagObject.get("tagId").toString(); - //System.out.println("tagId:"+tagId); - if (!tagId.isEmpty()) { - user.setCardid(tagId); - } - }else{ - user.setCardid(""); - } - //System.out.println("姓名:"+user.getCaption()); - //System.out.println("定位卡:"+user.getCardid()); - this.userService.updateUserById(user); - }else{ - //没有则新增 -// user.setId(CommUtil.getUUID()); -// user.setInsdt(CommUtil.nowDate()); -// String caption = name; -// //默认登录名为姓名+工号 -// name = name+jobNumber; -// //判断登录名是否重复 -// List userName = this.userService.selectListByWhere2("where name like '%"+name+"%' "); -// if(userName!=null && userName.size()>0){ -// name = name+"_"+(userName.size()+1); -// } -// user.setName(name); -// user.setPassword("123456"); -// User adminUser = this.userService.getUserById("emp01"); -// if(adminUser!=null){ -// user.setPid(adminUser.getPid()); -// }else{ -// List companys =this.unitService.getCompaniesByWhere("where active='"+ CommString.Flag_Active+"' order by morder"); -// if(companys!=null && companys.size()>0){ -// user.setPid(companys.get(0).getId()); -// } -// } -// user.setCaption(caption); -// user.setUserCardId(jobNumber); -// //已绑定的标签id -// if(tagObject.get("tagId")!=null){ -// String tagId = tagObject.get("tagId").toString(); -// if(!tagId.isEmpty()){ -// user.setCardid(tagId); -// } -// } -// this.userService.saveUser(user); - } - } - } - } - } - } - } - } - System.out.println("执行获取定位系统人员数据方法"); - - PositionsNumWebSocket positionsNum = new PositionsNumWebSocket(); - JSONObject positionsNumJson= getUserNumber(); - positionsNum.onMessage(positionsNumJson.toString(), null); - } - public String sendGET(URIBuilder uriBuilder, String token) { - String response = null; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(uriBuilder.build()); - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpGet.setHeader("Authorization", token); - httpresponse = httpclient.execute(httpGet); - response = EntityUtils.toString(httpresponse.getEntity()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var11) { - var11.printStackTrace(); - } - - return response; - } - public String getToken() throws IOException { - //读取配置文件 - Properties properties = new CommUtil().getProperties("rabbitmq.properties"); - String host = properties.getProperty("positionApi.host"); - String port = properties.getProperty("positionApi.port"); - String client_id = properties.getProperty("positionApi.client_id"); - String grant_type = properties.getProperty("positionApi.grant_type"); - String client_secret = properties.getProperty("positionApi.client_secret"); - String url = "http://"+host+":"+port+"/positionApi/oauth/token?client_id="+client_id+"&grant_type="+grant_type+"&client_secret="+client_secret; - String access_token = null; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - httpclient = HttpClients.createDefault(); - HttpGet httpGet = new HttpGet(url); - httpresponse = httpclient.execute(httpGet); - String response = EntityUtils.toString(httpresponse.getEntity()); - JSONObject jsonObject = JSONObject.parseObject(response); - if(jsonObject!=null) { - access_token = jsonObject.get("access_token").toString(); - } - }catch (Exception var10) { - var10.printStackTrace(); - access_token = null; - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception var10) { - var10.printStackTrace(); - access_token = null; - } - return access_token; - } - - public String sendPOST(String url, String json, String token) { - String result = null; - StringEntity postingString = null; - try { - CloseableHttpClient httpclient = HttpClients.createDefault(); - HttpPost httppost = new HttpPost(url); - postingString = new StringEntity(json); - httppost.setEntity(postingString); - httppost.setHeader("Content-type", "application/json;charset=UTF-8"); - httppost.setHeader("Authorization", token); - httppost.setHeader("X-Requested-With", "XMLHttpRequest"); - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - //logger.error(e.getMessage(), e); - System.err.println(e.getMessage()); - } - return result; - } - /** - * 获取总人数 - * @return - */ - public JSONObject getUserNumber() { - JSONObject result = new JSONObject(); - String userCards=""; - String userCards_out=""; - String userCards_bus=""; - List userList= userService.selectListByWhere2("where cardid is not null and cardid !='' order by insdt"); - if(userList!=null && userList.size()>0){ - for(User user:userList){ - userCards += user.getCardid()+","; - } - userCards=userCards.replace(",","','"); - } - List userOutsiders_out= selectListByWhere("where cardid is not null and cardid !='' and pid='1' order by insdt"); - if(userOutsiders_out!=null && userOutsiders_out.size()>0){ - for(UserOutsiders userOutsiders:userOutsiders_out){ - userCards_out += userOutsiders.getCardid()+","; - } - userCards_out=userCards_out.replace(",","','"); - } - List userOutsiders_bus= selectListByWhere("where cardid is not null and cardid !='' and pid='2' order by insdt"); - if(userOutsiders_bus!=null && userOutsiders_bus.size()>0){ - for(UserOutsiders userOutsiders:userOutsiders_bus){ - userCards_bus += userOutsiders.getCardid()+","; - } - userCards_bus=userCards_bus.replace(",","','"); - } - - List list0_in = positionsCasualService.selectListByWhere("where floor='-1' and cardid in ('"+userCards+"') order by insdt"); - List list0_out = positionsCasualService.selectListByWhere("where floor='-1' and cardid in ('"+userCards_out+"') order by insdt"); - List list0_bus = positionsCasualService.selectListByWhere("where floor='-1' and cardid in ('"+userCards_bus+"') order by insdt"); - List list1_in = positionsCasualService.selectListByWhere("where floor='1' and cardid in ('"+userCards+"') order by insdt"); - List list1_out = positionsCasualService.selectListByWhere("where floor='1' and cardid in ('"+userCards_out+"') order by insdt"); - List list1_bus = positionsCasualService.selectListByWhere("where floor='1' and cardid in ('"+userCards_bus+"') order by insdt"); - result.put("minusOne_insider",list0_in.size()); - result.put("minusOne_visitor",list0_out.size()); - result.put("minusOne_contractor",list0_bus.size()); - result.put("one_insider",list1_in.size()); - result.put("one_visitor",list1_out.size()); - result.put("one_contractor",list1_bus.size()); - List countList = enterRecordService.selectCount4state(); - if(countList==null || countList.size()==0){ - String wherestr = "where record_status='1' order by id desc"; - List areaManagelist = areaManageService.selectListByWhere(wherestr); - if(areaManagelist!=null && areaManagelist.size()>0){ - for(AreaManage areaManage : areaManagelist){ - String areaManageId = areaManage.getId(); - int num = 0; - List list = positionsCasualService.selectListByWhere("order by insdt"); - if(list!=null && list.size()>0) { - for (PositionsCasual positionsCasual: list) { - double top = 0; - double left = 0; - double width = 642; - double height = 667.0; - //比例数值 - double v = 0.444; - //一层 - double left_v_1 = 642.0/276.0; - double top_v_1 = 667.0/283.0; - //负一层 - double left_v_0 = 637.0/272.0; - double top_v_0 = 814.0/346.0; - boolean rayCasting = false; - //楼层 - String floor = positionsCasual.getFloor(); - String x = positionsCasual.getX(); - String y = positionsCasual.getY(); - //转化坐标 - String layer = "1"; - if("1".equals(floor)){ - top = Double.parseDouble(x)*top_v_1; - left = Double.parseDouble(y)*left_v_1; - width = 642; - height = 667.0; - }else - if("-1".equals(floor)){ - top = Double.parseDouble(x)*top_v_0; - left = Double.parseDouble(y)*left_v_0; - width = 637.0; - height = 814.0; - layer = "2"; - }else{ - top = Double.parseDouble(x)*v; - left = Double.parseDouble(y)*v; - width = 642; - height = 667.0; - } - left = left+5; - double[] p= {left,top}; - List poly = new ArrayList(); - String coordinatesPosition = areaManage.getCoordinatesPosition(); - String[] positions = coordinatesPosition.split(";"); - if(positions!=null && positions.length>0){ - String position=positions[0]; - String[] posit = position.split(","); - rayCasting = CommUtil.rayCasting2(positions,p); - if(rayCasting){ - num++; - } - } - } - } - if(num>0){ - EnterRecord enterRecord = new EnterRecord(); - enterRecord.setAreaid(areaManageId); - enterRecord.setFid(String.valueOf(num)); - countList.add(enterRecord); - } - } - } - } - result.put("countList", net.sf.json.JSONArray.fromObject(countList)); - return result; - } -} - diff --git a/src/com/sipai/service/user/UserRoleService.java b/src/com/sipai/service/user/UserRoleService.java deleted file mode 100644 index e5bae143..00000000 --- a/src/com/sipai/service/user/UserRoleService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.user; - -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.UserRoleDao; -import com.sipai.entity.user.UserRole; -import com.sipai.tools.CommService; - -@Service -public class UserRoleService implements CommService { - - @Resource - private UserRoleDao userRoleDao; - - @Override - public UserRole selectById(String id) { - UserRole userRole = this.userRoleDao.selectByPrimaryKey(id); - return userRole; - } - - @Override - public int deleteById(String id) { - int code = this.userRoleDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(UserRole userRole) { - int code = this.userRoleDao.insert(userRole); - return code; - } - - @Override - public int update(UserRole userRole) { - int code = this.userRoleDao.updateByPrimaryKeySelective(userRole); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - UserRole userRole = new UserRole(); - userRole.setWhere(wherestr); - return userRoleDao.selectListByWhere(userRole); - } - - @Override - public int deleteByWhere(String wherestr) { - UserRole userRole = new UserRole(); - userRole.setWhere(wherestr); - int code = this.userRoleDao.deleteByWhere(userRole); - return code; - } - -} diff --git a/src/com/sipai/service/user/UserService.java b/src/com/sipai/service/user/UserService.java deleted file mode 100644 index 44a06b55..00000000 --- a/src/com/sipai/service/user/UserService.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.service.user; - -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserTime; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -public interface UserService { - public User getUserById(String userId); - - public List getUserByCardId(String cardId); - - public User getUserByUserCardId(String userCardId); - - public User getUserWithDetailById(String userId); - - public int saveUser(User user); - - public int saveUserWithBaseRole(User user); - - public int syncUsers(List users); - - public int updateUserById(User user); - - public int updateByPrimaryKey4Lock(String userId); - - public int deleteUserById(String userId); - - public int deleteUserByWhere(String whereStr); - - public int resetpassword(User user, String pwd); - - public int unlockFun(User user); - - public List selectList(); - - public List selectListByWhere(String wherestr); - - /** - * 简单查询 - * - * @param wherestr - * @return - */ - public List selectListByWhere2(String wherestr); - - public List selectListByWhere3(String wherestr,String timeScope); - - public boolean checkNotOccupied(String id, String name); - - public String doimport(String realPath, MultipartFile[] file) throws IOException; - - public String exportUsers(String filePath, List list) throws IOException; - - public void exportUsersByResponse(HttpServletResponse response, String filename, List list) throws IOException; - - public List getUserListByPid(String pid); - - public int saveUserTime(User cu); - - public int updateTotaltimeByUserId(String userId); - - /** - * 根据用户id,更新用户所在部门的职位 - * - * @param userId - * @return - */ - public int updateJobByUserid(String jobstr, String userid, String unitid); - - public boolean checkSerialNotOccupied(String id, String serial); - - public boolean checkCardidNotOccupied(String id, String cardid); - - public User getUserByLoginName(String name); - - /** - * 把多个人员的id转换为名称 - * - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds); - - public List selectUserTimeListByWhere(String wherestr); - - /** - * 更新用户登录记录 - * - * @param userId: 人员id - * @return int 0失败;1成功 - * @author: sipai - * @version: 11/4/2022 - **/ - public int updateUserTime(String userId); - - /** - * 更新用户登录记录 - * - * @param cu 用户类 - * @param source 登录来源 - * @return int 0失败;1成功 - * @author: njp - */ - public int saveUserTime(User cu, String source); -} diff --git a/src/com/sipai/service/user/UserServiceImpl.java b/src/com/sipai/service/user/UserServiceImpl.java deleted file mode 100644 index 27f95712..00000000 --- a/src/com/sipai/service/user/UserServiceImpl.java +++ /dev/null @@ -1,851 +0,0 @@ -package com.sipai.service.user; - -import com.sipai.dao.user.UserDao; -import com.sipai.dao.user.UserJobDao; -import com.sipai.dao.user.UserTimeDao; -import com.sipai.entity.user.*; -import com.sipai.service.maintenance.MaintenanceService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.FileUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.apache.poi.ss.usermodel.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.net.URLEncoder; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -@Service("userService") -public class UserServiceImpl implements UserService { - private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); - @Resource - private UserDao userDao; - - @Resource - UserTimeDao userTimeDao; - - @Resource - UserJobDao userJobDao; - @Resource - UnitService unitService; - @Resource - RoleService roleService; - @Resource - private ExtSystemService extSystemService; - @Resource - private UserDetailService userDetailService; - - @Override - public User getUserById(String userId) { - return this.userDao.selectByPrimaryKey(userId); - } - - @Override - public List getUserByCardId(String cardId) { - return userDao.getListByCardid(cardId); - } - - @Override - public User getUserByUserCardId(String userCardId) { - return userDao.getListByUserCardid(userCardId); - } - - @Override - public User getUserWithDetailById(String userId) { - User user = this.getUserById(userId); - UserDetail userDetail = userDetailService.selectByUserId(userId); - user.setUserDetail(userDetail); - return user; - } - - @Override - public int saveUser(User user) { - try { - user.setPassword(CommUtil.generatePassword(user.getPassword())); - //初始化密码如果包含@特殊字符,使用下面的MD5加密会导致默认密码登陆不成功 - //user.setPassword(CommUtil.generatePassword(URLEncoder.encode(user.getPassword(), "utf-8"))); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return this.userDao.insert(user); - } - - @Transactional - @Override - public int saveUserWithBaseRole(User user) { - int res = 0; - try { - res = this.saveUser(user); - String userType = unitService.doCheckBizOrNot(user.getId()); - if (userType.equals(CommString.UserType_Biz)) { - roleService.saveUserRole(MaintenanceService.RoleSerial_Launch, user.getId()); - } else if (userType.equals(CommString.UserType_Maintainer)) { - roleService.saveUserRole(MaintenanceService.RoleSerial_Solver, user.getId()); - } - //注册的同时同步数据中心权限 - List list = unitService.selectListByWhere("where id ='" + user.getId() + "'"); - this.syncUsers(list); - } catch (Exception e) { - // TODO Auto-generated catch block - throw new RuntimeException(); - } - return res; - } - - /** - * 同步用户信息至数据中心,并获取数据中心权限 - */ - @Override - public int syncUsers(List users) { - int res = 0; - try { - String result = JSONArray.fromObject(users).toString(); - String url = null; - try { - ExtSystem extSystem = this.extSystemService.getActiveDataManage(null); - if (extSystem != null) { - url = extSystem.getUrl(); - } - url += "/proapp.do?method=syncUsersInfo"; - Map map = new HashMap(); - map.put("param", result); - String resp = com.sipai.tools.HttpUtil.sendPost(url, map); - JSONArray jsonArray = JSONArray.fromObject(resp); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = jsonArray.getJSONObject(i); - //String type = jsonObject.getString("type"); - String id = jsonObject.getString("id"); - String syncflag = jsonObject.getString("syncflag"); - - if (CommString.Sync_Finish.equals(syncflag)) { - User user = this.getUserById(id); - user.setSyncflag(CommString.Sync_Finish); - this.updateUserById(user); - } - } - if (jsonArray != null && users.size() == jsonArray.size()) { - res = 1; - } - } catch (Exception e) { - e.printStackTrace(); - } - } catch (Exception e) { - // TODO Auto-generated catch block - throw new RuntimeException(); - } - return res; - } - - @Override - public int saveUserTime(User cu) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// String edate = CommUtil.nowDate(); - String sdate = cu.getLastlogintime() == null ? CommUtil.nowDate() : cu.getLastlogintime(); -// java.util.Date begin; -// java.util.Date end; -// long between=0; -// try { -// begin = sdf.parse(sdate); -// end = sdf.parse(edate); -// between=(end.getTime() - begin.getTime()); -// } catch (ParseException e) { -// e.printStackTrace(); -// } -// DecimalFormat df = new DecimalFormat("#0.00"); - -// Double val=Double.valueOf(df.format(between/3600000.00)); - - UserTime userTime = new UserTime(); - userTime.setId(CommUtil.getUUID()); - userTime.setUserid(cu.getId()); - userTime.setInsdt(CommUtil.nowDate()); - userTime.setIp(cu.getCurrentip()); - userTime.setSdate(sdate); -// userTime.setEdate(edate); -// userTime.setLogintime(val); - userTime.setInsuser(cu.getId()); - userTime.setInsdt(CommUtil.nowDate()); -// String whereStr ="where userid ='"+cu.getId()+"' order by insdt desc"; -// List userTimes =this.selectTimeListByWhere(whereStr); -// List users =this.selectListByWhere("order by insdt asc"); - return this.userTimeDao.insert(userTime); - } - - @Override - public int saveUserTime(User cu, String source) { - String sdate = cu.getLastlogintime() == null ? CommUtil.nowDate() : cu.getLastlogintime(); - String id = CommUtil.getUUID(); - if (id != null && !id.isEmpty()) { - id += "-" + source; - } - UserTime userTime = new UserTime(); - userTime.setId(id); - userTime.setUserid(cu.getId()); - userTime.setInsdt(CommUtil.nowDate()); - userTime.setIp(cu.getCurrentip()); - userTime.setSdate(sdate); - userTime.setInsuser(cu.getId()); - userTime.setInsdt(CommUtil.nowDate()); - return this.userTimeDao.insert(userTime); - } - - @Override - public int updateUserById(User user) { - return this.userDao.updateByPrimaryKeySelective(user); - } - - @Override - public int updateByPrimaryKey4Lock(String userId) { - return this.userDao.updateByPrimaryKey4Lock(userId); - } - - @Override - public int updateTotaltimeByUserId(String userId) { - User user = new User(); - user.setId(userId); - user.setTotaltime(userTimeDao.getTotaltimeByUserId(userId)); - return this.userDao.updateByPrimaryKeySelective(user); - } - - @Override - public int resetpassword(User user, String newpwd) { - newpwd = CommUtil.generatePassword(newpwd); - user.setPassword(newpwd); - return this.userDao.updateByPrimaryKeySelective(user); - } - - @Override - public int unlockFun(User user) { - return this.updateByPrimaryKey4Lock(user.getId()); - } - - @Override - public List selectListByWhere(String wherestr) { - User user = new User(); - user.setWhere(wherestr); - List users = this.userDao.selectListByWhere(user); - UserTime userTime = new UserTime(); - for (User item : users) { - userTime.setWhere(" where userid='" + item.getId() + "' and edate is not null order by sdate desc"); - List userTimes = userTimeDao.selectListByWhere(userTime); - if (userTimes != null && userTimes.size() > 0) { - item.setLastlogintime(userTimes.get(0).getSdate()); - item.setLastloginduration(userTimes.get(0).getLogintime()); - boolean status = userTimes.get(0).getId().contains(UserTime.handheld); - if (status) { - item.setSource("手持端"); - } else { - status = userTimes.get(0).getId().contains(UserTime.platform); - if (status) { - item.setSource("平台端"); - } else { - item.setSource("未识别"); - } - } - } - //查询一周内记录 - userTime.setWhere(" where userid='" + item.getId() + "' and edate is not null " - + "and sdate between dateadd(day, -7, '" + CommUtil.nowDate() + "') and '" + CommUtil.nowDate() + "' order by sdate desc"); - userTimes = userTimeDao.selectListByWhere(userTime); - if (userTimes != null && userTimes.size() > 0) { - Double weekloginduration = 0.0; - for (UserTime ut : userTimes) { - weekloginduration += ut.getLogintime(); - } - item.setWeekloginduration(weekloginduration); - } - } - return users; - } - - /** - * 简单查询 - * - * @param wherestr - * @return - */ - @Override - public List selectListByWhere2(String wherestr) { - User user = new User(); - user.setWhere(wherestr); - List users = this.userDao.selectListByWhere(user); - return users; - } - - @Override - public List selectListByWhere3(String wherestr, String timeScope) { - User user = new User(); - user.setWhere(wherestr); - List users = this.userDao.selectListByWhere(user); - UserTime userTime = new UserTime(); - for (User item : users) { - //日期筛选 - if (timeScope != null && !timeScope.equals("")) { - String[] st = timeScope.split("~"); - userTime.setWhere(" where userid='" + item.getId() + "' and sdate between '" + st[0] + "' and '" + st[1] + "' order by sdate desc"); - } else { - userTime.setWhere(" where userid='" + item.getId() + "' and edate is not null order by sdate desc"); - } - List userTimes = userTimeDao.selectListByWhere(userTime); - if (userTimes != null && userTimes.size() > 0) { - item.setLastlogintime(userTimes.get(0).getSdate()); - item.setLastloginduration(userTimes.get(0).getLogintime()); - boolean status = userTimes.get(0).getId().contains(UserTime.handheld); - if (status) { - item.setSource("手持端"); - } else { - status = userTimes.get(0).getId().contains(UserTime.platform); - if (status) { - item.setSource("平台端"); - } else { - item.setSource("未识别"); - } - } - } - //查询一周内记录 - userTime.setWhere(" where userid='" + item.getId() + "' and edate is not null " - + "and sdate between dateadd(day, -7, '" + CommUtil.nowDate() + "') and '" + CommUtil.nowDate() + "' order by sdate desc"); - userTimes = userTimeDao.selectListByWhere(userTime); - if (userTimes != null && userTimes.size() > 0) { - Double weekloginduration = 0.0; - for (UserTime ut : userTimes) { - weekloginduration += ut.getLogintime(); - } - item.setWeekloginduration(weekloginduration); - } - } - - //去除不在筛选日期范围内的 - if (timeScope != null && !timeScope.equals("")) { - Iterator iterator = users.iterator(); - while (iterator.hasNext()) { - if (iterator.next().getLastlogintime() == null) { - iterator.remove(); - } - } - } - - return users; - } - - public List selectUserTimeListByWhere(String wherestr) { - UserTime entity = new UserTime(); - entity.setWhere(wherestr); - List users = this.userTimeDao.selectListByWhere(entity); - return users; - } - - @Override - public List selectList() { - User user = new User(); - return this.userDao.selectList(user); - } - - @Override - public int deleteUserById(String userId) { - User user = getUserById(userId); - user.setActive(CommString.Active_False); - user.setSyncflag(CommString.Sync_Delete); - return this.updateUserById(user); - } - - @Override - public int deleteUserByWhere(String whereStr) { - List users = this.selectListByWhere(whereStr); - int res = 0; - for (User user : users) { - user.setActive(CommString.Active_False); - user.setSyncflag(CommString.Sync_Delete); - res += this.updateUserById(user); - } - return res; - } - - @Override - public List getUserListByPid(String pid) { - User user = new User(); - user.setWhere("where pid ='" + pid + "'"); - return this.userDao.selectListByWhere(user); - } - - /** - * 是否未被占用 - * - * @param id - * @param name - * @return - */ - @Override - public boolean checkNotOccupied(String id, String name) { - List list = this.userDao.getListByLoginName(name); - if (id == null) {//新增 - if (list != null && list.size() > 0) { - return false; - } - } else {//编辑 - if (list != null && list.size() > 0) { - for (User user : list) { - if (!id.equals(user.getId())) {//不是当前编辑的那条记录 - return false; - } - } - } - } - - return true; - } - - @SuppressWarnings("resource") - @Override - public String doimport(String realPath, MultipartFile[] file) throws IOException { - String result = ""; - int suc = 0; - int fal = 0; - //上传文件的原名(即上传前的文件名字) - String originalFilename = null; - //服务器路径 - String serverPath = null; - ArrayList list = new ArrayList(); - for (MultipartFile myfile : file) { - if (myfile.isEmpty()) { - return null; - } else { - originalFilename = myfile.getOriginalFilename(); - //兼容linux路径 - serverPath = realPath + System.getProperty("file.separator") + CommUtil.getUUID() + originalFilename; - FileUtil.saveFile(myfile.getInputStream(), serverPath); - System.out.println("-->>临时文件上传完成!"); - - FileInputStream is = new FileInputStream(serverPath); - try { - POIFSFileSystem fs = new POIFSFileSystem(is); - HSSFWorkbook wb = new HSSFWorkbook(fs); - HSSFSheet sheet = wb.getSheetAt(0); - // 得到总行数 - int rowNum = sheet.getPhysicalNumberOfRows(); - HSSFRow row = sheet.getRow(0); - //以导入时列名长度为需要导入数据的长度,超过部分程序将忽略 - int colNum = row.getPhysicalNumberOfCells(); - // 正文内容应该从第二行开始,第一行为表头的标题 - - for (int i = 1; i < rowNum; i++) { - row = sheet.getRow(i); - User user = new User(); - - String UUID = CommUtil.getUUID(); - user.setId(UUID); - user.setActive("1"); - int j = 0; - while (j < colNum) { - if (j == 0) { - user.setCaption(row.getCell(j).getStringCellValue()); - } else if (j == 1) { - user.setName(row.getCell(j).getStringCellValue()); - } else if (j == 2) { - String sex = row.getCell(j).getStringCellValue(); - if (sex != null) { - if (sex.equals("男")) { - sex = "1"; - } else if (sex.equals("女")) { - sex = "0"; - } else { - - } - } - user.setSex(sex); - } else if (j == 3) { - user.setTotaltime(row.getCell(j).getNumericCellValue()); - } else { - } - - j++; - } - int res = this.saveUser(user); - user = null; - if (res > 0) { - suc++; - list.add(user); - } else { - fal++; - } - } - //导入动作完成后,删除导入文件的临时文件 - FileUtil.deleteFile(serverPath); - System.out.println("<<--临时文件已删除!"); - //关闭流文件 - is.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - int totalNum = suc + fal; - String feedback = "共导入" + totalNum + "条数据:"; - if (suc > 0) { - feedback += "导入成功" + suc + "条!"; - } - if (fal > 0) { - feedback += "导入失败" + fal + "条!"; - } - result = "{\"feedback\":\"" + feedback + "\"}"; - - return result; - } - - @Override - public String exportUsers(String filePath, List list) throws IOException { - String result = ""; - String title = "人员导出测试"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth(15); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(IndexedColors.SKY_BLUE.index); - style.setFillPattern(FillPatternType.SOLID_FOREGROUND); - style.setBorderBottom(BorderStyle.THIN); - style.setBorderLeft(BorderStyle.THIN); - style.setBorderRight(BorderStyle.THIN); - style.setBorderTop(BorderStyle.THIN); - style.setAlignment(HorizontalAlignment.CENTER); - // 生成一个字体 - HSSFFont font = workbook.createFont(); - font.setColor(IndexedColors.VIOLET.index); - font.setFontHeightInPoints((short) 12); - font.setBold(true); - // 把字体应用到当前的样式 - style.setFont(font); - // 生成并设置另一个样式 - HSSFCellStyle style2 = workbook.createCellStyle(); - style2.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.index); - style2.setFillPattern(FillPatternType.SOLID_FOREGROUND); - style2.setBorderBottom(BorderStyle.THIN); - style2.setBorderLeft(BorderStyle.THIN); - style2.setBorderRight(BorderStyle.THIN); - style2.setBorderTop(BorderStyle.THIN); - style2.setAlignment(HorizontalAlignment.CENTER); - style2.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont font2 = workbook.createFont(); - font2.setBold(false); - // 把字体应用到当前的样式 - style2.setFont(font2); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - - //产生表格标题行 - String[] headers = {"姓名", "登录名", "性别", "在线时长"}; - HSSFRow row = sheet.createRow(0); - for (int i = 0; i < headers.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(style); - HSSFRichTextString text = new HSSFRichTextString(headers[i]); - cell.setCellValue(text); - } - - //遍历集合数据,产生数据行 - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(i + 1); - User user = list.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - HSSFCell cell0 = row.createCell(0); - cell0.setCellValue(user.getCaption()); - - HSSFCell cell1 = row.createCell(1); - cell1.setCellValue(user.getName()); - - HSSFCell cell2 = row.createCell(2); - String sex = ""; - if (user.getSex() != null) { - if (user.getSex().equals("0")) { - sex = "女"; - } else if (user.getSex().equals("1")) { - sex = "男"; - } else { - sex = "未知"; - } - } - cell2.setCellValue(sex); - - HSSFCell cell3 = row.createCell(3); - Double totalTime = 0.0; - if (user.getTotaltime() != null) { - totalTime = user.getTotaltime(); - } - cell3.setCellValue(totalTime); - - } - try { - File file = new File(filePath); - OutputStream out = new FileOutputStream(file); - workbook.write(out); - out.close(); - result = "文件导出成功:" + filePath; - } catch (IOException e) { - e.printStackTrace(); - } finally { - workbook.close(); - } - return result; - } - - @Override - public void exportUsersByResponse(HttpServletResponse response, String filename, List list) throws IOException { - String title = "人员导出测试"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth(15); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(IndexedColors.SKY_BLUE.index); - style.setFillPattern(FillPatternType.SOLID_FOREGROUND); - style.setBorderBottom(BorderStyle.THIN); - style.setBorderLeft(BorderStyle.THIN); - style.setBorderRight(BorderStyle.THIN); - style.setBorderTop(BorderStyle.THIN); - style.setAlignment(HorizontalAlignment.CENTER); - // 生成一个字体 - HSSFFont font = workbook.createFont(); - font.setColor(IndexedColors.VIOLET.index); - font.setFontHeightInPoints((short) 12); - font.setBold(true); - // 把字体应用到当前的样式 - style.setFont(font); - // 生成并设置另一个样式 - HSSFCellStyle style2 = workbook.createCellStyle(); - style2.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.index); - style2.setFillPattern(FillPatternType.SOLID_FOREGROUND); - style2.setBorderBottom(BorderStyle.THIN); - style2.setBorderLeft(BorderStyle.THIN); - style2.setBorderRight(BorderStyle.THIN); - style2.setBorderTop(BorderStyle.THIN); - style2.setAlignment(HorizontalAlignment.CENTER); - style2.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont font2 = workbook.createFont(); - font2.setBold(false); - // 把字体应用到当前的样式 - style2.setFont(font2); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - - //产生表格标题行 - String[] headers = {"姓名", "登录名", "性别", "在线时长"}; - HSSFRow row = sheet.createRow(0); - for (int i = 0; i < headers.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(style); - HSSFRichTextString text = new HSSFRichTextString(headers[i]); - cell.setCellValue(text); - } - - //遍历集合数据,产生数据行 - for (int i = 0; i < list.size(); i++) { - row = sheet.createRow(i + 1); - User user = list.get(i); - //填充列数据,若果数据有不同的格式请注意匹配转换 - HSSFCell cell0 = row.createCell(0); - cell0.setCellValue(user.getCaption()); - - HSSFCell cell1 = row.createCell(1); - cell1.setCellValue(user.getName()); - - HSSFCell cell2 = row.createCell(2); - String sex = ""; - if (user.getSex() != null) { - if (user.getSex().equals("0")) { - sex = "女"; - } else if (user.getSex().equals("1")) { - sex = "男"; - } else { - sex = "未知"; - } - } - cell2.setCellValue(sex); - - HSSFCell cell3 = row.createCell(3); - Double totalTime = 0.0; - if (user.getTotaltime() != null) { - totalTime = user.getTotaltime(); - } - cell3.setCellValue(totalTime); - - } - try { - response.reset(); - response.setContentType("application/x-msdownload"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(filename, "UTF-8")); -// System.out.println(response.getHeader("Content-disposition")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - @Override - public int updateJobByUserid(String jobstr, String userid, String unitid) { - int res = 0; - UserJob userJob = new UserJob(); - userJob.setWhere(" where userid='" + userid + "' "); - int delres = userJobDao.deleteByWhere(userJob); - if (delres >= 0) { - String[] jobs = jobstr.split(","); - for (int i = 0; i < jobs.length; i++) { - if (!jobs[i].equals("")) { - UserJob userJob1 = new UserJob(); - userJob1.setUserid(userid); - userJob1.setJobid(jobs[i]); - userJob1.setUnitid(unitid); - res += userJobDao.insert(userJob1); - } - } - } - return res; - } - - @Override - public boolean checkSerialNotOccupied(String id, String serial) { - List list = this.userDao.getListBySerial(serial); - if (id == null) {//新增 - if (list != null && list.size() > 0) { - return false; - } - } else {//编辑 - if (list != null && list.size() > 0) { - for (User user : list) { - if (!id.equals(user.getId())) {//不是当前编辑的那条记录 - return false; - } - } - } - } - - return true; - } - - @Override - public boolean checkCardidNotOccupied(String id, String cardid) { - List list = this.userDao.getListByCardid(cardid); - if (id == null) {//新增 - if (list != null && list.size() > 0) { - return false; - } - } else {//编辑 - if (list != null && list.size() > 0) { - for (User user : list) { - if (!id.equals(user.getId())) {//不是当前编辑的那条记录 - return false; - } - } - } - } - - return true; - } - - @Override - public User getUserByLoginName(String name) { - return userDao.getUserByLoginName(name); - } - - /** - * 把多个人员的id转换为名称 - * - * @param userIds - * @return - */ - @Override - public String getUserNamesByUserIds(String userIds) { - String userNames = ""; - if (userIds != null && !userIds.equals("")) { - userIds = userIds.replace(",", "','"); - List users = this.selectListByWhere("where id in ('" + userIds + "')"); - for (User item : users) { - if (userNames != "") { - userNames += ","; - } - userNames += item.getCaption(); - } - } - return userNames; - } - - public int updateUserTime(String userId) { - String whereStr = "where userid ='" + userId + "' order by sdate desc"; -// List userTimes =userTimeDao.selectTopNumListByWhere(whereStr,"top 1"); - List userTimes = this.selectUserTimeListByWhere(whereStr); - //没有开始时间则不更新 - if (userTimes.size() == 0 || userTimes.get(0).getEdate() != null) { - return 0; - } - UserTime userTime = userTimes.get(0); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String edate = CommUtil.nowDate(); - String sdate = userTime.getSdate(); - java.util.Date begin; - java.util.Date end; - long between = 0; - try { - begin = sdf.parse(sdate); - end = sdf.parse(edate); - between = (end.getTime() - begin.getTime()); - } catch (ParseException e) { - e.printStackTrace(); - } - DecimalFormat df = new DecimalFormat("#0.00"); - - Double val = Double.valueOf(df.format(between / 3600000.00)); - - userTime.setEdate(edate); - userTime.setLogintime(val); - - int res = this.userTimeDao.updateByPrimaryKeySelective(userTime); - //logger.info("userId:" + userTime.getUserid() + ",time:" + userTime.getSdate()); - return res; - } -} diff --git a/src/com/sipai/service/valueEngineering/EquipmentDepreciationService.java b/src/com/sipai/service/valueEngineering/EquipmentDepreciationService.java deleted file mode 100644 index b36e13c4..00000000 --- a/src/com/sipai/service/valueEngineering/EquipmentDepreciationService.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.service.valueEngineering; -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.valueEngineering.EquipmentDepreciationDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.valueEngineering.EquipmentDepreciation; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -@Service -public class EquipmentDepreciationService implements CommService{ - @Resource - private EquipmentDepreciationDao equipmentDepreciationDao; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private UnitService unitService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - - @Override - public EquipmentDepreciation selectById(String id) { - EquipmentDepreciation equipmentDep = equipmentDepreciationDao.selectByPrimaryKey(id); - if (null != equipmentDep) { - if (null != equipmentDep.getEquipmentId() && !equipmentDep.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentDep.getEquipmentId()); - equipmentDep.setEquipmentCard(equipmentCard); - } - if (null != equipmentDep.getProcessSectionId() && !equipmentDep.getProcessSectionId().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(equipmentDep.getProcessSectionId()); - equipmentDep.setProcessSection(processSection); - } - if (null != equipmentDep.getBizId() && !equipmentDep.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(equipmentDep.getBizId()); - equipmentDep.setCompany(company); - } - } - return equipmentDep; - } - - @Override - public int deleteById(String id) { - return equipmentDepreciationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentDepreciation entity) { - EquipmentDepreciation equipmentDepreciation = this.getequipmentDepreciation(entity); - return equipmentDepreciationDao.insert(equipmentDepreciation); - } - - @Override - public int update(EquipmentDepreciation entity) { - EquipmentDepreciation equipmentDepreciation = this.getequipmentDepreciation(entity); - return equipmentDepreciationDao.updateByPrimaryKeySelective(equipmentDepreciation); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentDepreciation equipmentDep = new EquipmentDepreciation(); - equipmentDep.setWhere(wherestr); - Listlist = equipmentDepreciationDao.selectListByWhere(equipmentDep); - if (null != list && list.size()>0) { - for (EquipmentDepreciation item :list) { - if (null != item) { - if (null != item.getEquipmentId() && !item.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - if (null != item.getProcessSectionId() && !item.getProcessSectionId().isEmpty()) { - ProcessSection processSection = this.processSectionService.selectById(item.getProcessSectionId()); - item.setProcessSection(processSection); - } - if (null != item.getBizId() && !item.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(item.getBizId()); - item.setCompany(company); - } - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentDepreciation equipmentDep = new EquipmentDepreciation(); - equipmentDep.setWhere(wherestr); - return equipmentDepreciationDao.deleteByWhere(equipmentDep); - } - - /** - * 计算设备折旧的数据 - */ - public EquipmentDepreciation getequipmentDepreciation(EquipmentDepreciation entity) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(entity.getEquipmentId()); - EquipmentCardProp equipmentCardProp = this.equipmentCardPropService.selectByEquipmentId(entity.getEquipmentId()); - - //资产原值 - BigDecimal initValue = equipmentCard.getEquipmentvalue(); - //预计使用年限 - double useAge; - if (null == equipmentCard.getUseage()) { - useAge = 0; - }else { - useAge = equipmentCard.getUseage(); - } - - //残值率 - double residualValueRate; - if (null == equipmentCardProp.getResidualValueRate()) { - residualValueRate =0; - }else { - residualValueRate = equipmentCardProp.getResidualValueRate(); - } - - //已用年限 - double useTime; - if (null == equipmentCardProp.getUseTime()) { - useTime = 0; - }else { - useTime = equipmentCardProp.getUseTime(); - } - - try { - //年折旧率,年折旧额,月折旧率,月折旧额 - if (useAge != 0 && null != initValue) { - //年折旧率,年折旧额 - BigDecimal yearDepreciationRate = new BigDecimal((1-residualValueRate)/useAge).setScale(2, BigDecimal.ROUND_HALF_UP); - entity.setYearDepreciationRate(yearDepreciationRate); - BigDecimal yearDepreciation = initValue.multiply(yearDepreciationRate).setScale(2, BigDecimal.ROUND_HALF_UP); - entity.setYearDepreciation(yearDepreciation); - - //月折旧率,年折旧额 - BigDecimal monthDepreciationRate = yearDepreciationRate.divide(new BigDecimal(12),4,BigDecimal.ROUND_HALF_UP); - entity.setMonthDepreciationRate(monthDepreciationRate); - BigDecimal monthDepreciation = yearDepreciation.divide(new BigDecimal(12),2,BigDecimal.ROUND_HALF_UP); - entity.setMonthDepreciation(monthDepreciation); - - //当前价值 - BigDecimal currentValue = initValue.subtract(monthDepreciation.multiply(new BigDecimal(useTime*12))).setScale(2, BigDecimal.ROUND_HALF_UP); - entity.setCurrentValue(currentValue); - - //累计折旧 - BigDecimal totalDepreciation = monthDepreciationRate.multiply(initValue).multiply(new BigDecimal(useTime*12)).setScale(2, BigDecimal.ROUND_HALF_UP); - entity.setTotalDepreciation(totalDepreciation); - - //净残值 - BigDecimal residualValue = initValue.multiply(new BigDecimal(residualValueRate)).setScale(2, BigDecimal.ROUND_HALF_UP); - entity.setResidualValue(residualValue); - } - - } catch (ArithmeticException e) { - // TODO: handle exception - } - - return entity; - } -} \ No newline at end of file diff --git a/src/com/sipai/service/valueEngineering/EquipmentEvaluateService.java b/src/com/sipai/service/valueEngineering/EquipmentEvaluateService.java deleted file mode 100644 index 26207724..00000000 --- a/src/com/sipai/service/valueEngineering/EquipmentEvaluateService.java +++ /dev/null @@ -1,2725 +0,0 @@ -package com.sipai.service.valueEngineering; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.valueEngineering.EquipmentEvaluateDao; -import com.sipai.dao.valueEngineering.EquipmentModelDao; -import com.sipai.dao.work.KPIPointDao; -import com.sipai.entity.base.LineChart; -import com.sipai.entity.equipment.Characteristic; -import com.sipai.entity.equipment.EquipmentAge; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.equipment.EquipmentClassProp; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.equipment.EquipmentTypeNumber; -import com.sipai.entity.equipment.EquipmentUseAge; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.MaintenanceDetail; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Unit; -import com.sipai.entity.valueEngineering.EquipmentEvaluate; -import com.sipai.entity.valueEngineering.EquipmentEvaluateCommStr; -import com.sipai.entity.valueEngineering.EquipmentModel; -import com.sipai.entity.work.KPIPoint; -import com.sipai.service.equipment.CharacteristicService; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.equipment.EquipmentClassPropService; -import com.sipai.service.equipment.EquipmentClassService; -import com.sipai.service.equipment.EquipmentSpecificationService; -import com.sipai.service.equipment.EquipmentTypeNumberService; -import com.sipai.service.equipment.EquipmentUseAgeService; -import com.sipai.service.maintenance.MaintenanceDetailService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class EquipmentEvaluateService implements CommService{ - @Resource - private EquipmentEvaluateDao equipmentEvaluateDao; - @Resource - private EquipmentClassService equipmentClassService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointService mPointService; - @Resource - private EquipmentSpecificationService equipmentSpecificationService; - @Resource - private EquipmentUseAgeService equipmentUseAgeService; - @Resource - private EquipmentTypeNumberService equipmentTypeNumberService; - @Resource - private EquipmentClassPropService equipmentClassPropService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private EquipmentCardPropService equipmentCardPropService; - @Resource - private MaintenanceDetailService maintenanceDetailService; - @Resource - private CharacteristicService characteristicService; - @Resource - private UnitService unitService; - @Override - public EquipmentEvaluate selectById(String id) { - EquipmentEvaluate equipmentEvaluate = equipmentEvaluateDao.selectByPrimaryKey(id); - if (null != equipmentEvaluate.getClassId() && !equipmentEvaluate.getClassId().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(equipmentEvaluate.getClassId()); - equipmentEvaluate.setClassName(equipmentClass.getName()); - } - return equipmentEvaluate; - } - - @Override - public int deleteById(String id) { - return equipmentEvaluateDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentEvaluate entity) { - return equipmentEvaluateDao.insert(entity); - } - - @Override - public int update(EquipmentEvaluate entity) { - return equipmentEvaluateDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentEvaluate equipmentEvaluate = new EquipmentEvaluate(); - equipmentEvaluate.setWhere(wherestr); - Listlist = equipmentEvaluateDao.selectListByWhere(equipmentEvaluate); - if (null != list && list.size()>0) { - for (EquipmentEvaluate item :list) { - if (null != item.getClassId() && !item.getClassId().isEmpty()) { - EquipmentClass equipmentClass = this.equipmentClassService.selectById(item.getClassId()); - item.setClassName(equipmentClass.getName()); - } - if (null != item.getSpecification() && !item.getSpecification().isEmpty()) { - EquipmentSpecification equipmentSpecification = this.equipmentSpecificationService.selectById(item.getSpecification()); - item.setEquipmentSpecification(equipmentSpecification); - } - if (null != item.getModel() && !item.getModel().isEmpty()) { - EquipmentTypeNumber equipmentTypeNumber = this.equipmentTypeNumberService.selectById(item.getModel()); - item.setEquipmentTypeNumber(equipmentTypeNumber); - } - if (null != item.getUseTime() && !item.getUseTime().isEmpty()) { - EquipmentUseAge equipmentUseAge = this.equipmentUseAgeService.selectById(item.getUseTime()); - item.setEquipmentUseAge(equipmentUseAge); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentEvaluate equipmentEvaluate = new EquipmentEvaluate(); - equipmentEvaluate.setWhere(wherestr); - return equipmentEvaluateDao.deleteByWhere(equipmentEvaluate); - } - - /** - * 第一个数学模型,生成设备排名 - * @param id - * @return - */ - public List getRankLineChart(String id){ - EquipmentEvaluate equipmentEvaluate = this.selectById(id); - String wherestr = ""; - ArrayList xAis = new ArrayList();//月份 x轴 - ArrayList econRank = new ArrayList();//经济排名数组 - ArrayList effiRank = new ArrayList();//效率排名数组 - ArrayList qualRank = new ArrayList();//质量排名数组 - ArrayList commRank = new ArrayList();//综合排名数组 - try{ - //经济评分排名 - List econMPointHistory = this.mPointHistoryService - .getRankHistory(EquipmentEvaluateCommStr.KPI_BizId, EquipmentEvaluateCommStr.KPI_topNum_String ,"[TB_MP_"+equipmentEvaluate.getEcomomicKpi()+"]", wherestr); - //效率评分排名 - List effiMPointHistory = this.mPointHistoryService - .getRankHistory(EquipmentEvaluateCommStr.KPI_BizId, EquipmentEvaluateCommStr.KPI_topNum_String ,"[TB_MP_"+equipmentEvaluate.getEfficiencyKpi()+"]", wherestr); - //质量评分排名 - List qualMPointHistory = this.mPointHistoryService - .getRankHistory(EquipmentEvaluateCommStr.KPI_BizId, EquipmentEvaluateCommStr.KPI_topNum_String ,"[TB_MP_"+equipmentEvaluate.getQualityKpi()+"]", wherestr); - //综合评分排名 - List commMPointHistory = this.mPointHistoryService - .getRankHistory(EquipmentEvaluateCommStr.KPI_BizId, EquipmentEvaluateCommStr.KPI_topNum_String ,"[TB_MP_"+equipmentEvaluate.getTotalKpi()+"]", wherestr); - for(int i=0;i lineList = new ArrayList(); - lineList.add(econLineChart); - lineList.add(effiLineChart); - lineList.add(qualLineChart); - lineList.add(commLineChart); - return lineList; - } - - /** - * 经济寿命模型,生成经济寿命曲线 - * @param id - * @return - */ - public String getEquipmentLifeLine(String id){ - String result = ""; - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - List equipList = this.equipmentCardPropService.selectAgeListByWhere(" where E.id = '"+id+"'"); - //获取设定经济寿命T0 - List equipmentClassProp = this.equipmentClassPropService - .selectListByWhere(" where [equipment_class_id] = '"+equipmentCard.getEquipmentclassid()+"'"); - Double t0 = equipmentClassProp.get(0).getEcoLifeSet();//经济寿命设定值 - Double k0 = equipList.get(0).getPurchaseMoney().doubleValue();//购置费 - Double gamma = equipList.get(0).getResidualValueRate();//残值率 - Double lambda = t0*t0/2/(k0-k0*gamma);//λ - ArrayList c =new ArrayList(); - int maintainSign = 0;//用于判断有几年的保养数据 - //获取当前时间与购置时间的差值 - Double days = CommUtil.getDays(CommUtil.nowDate(),equipList.get(0).getInstallDate())/365.0; - /* 先获取 等额资产回复成本 和 X轴 */ - ArrayList An = new ArrayList();//等额资产回复成本 - List xAis = new ArrayList();//X轴 - SimpleDateFormat formatter = new SimpleDateFormat("yyyy"); - Date date = null;Double forNum = 0.0; - if(days Bn = new ArrayList();//设备年等额运行成本 - //获取全部保养单和维修单 - List maintenanceDetail = this.maintenanceDetailService - .getPlanTypeByWhere(" where D.status = '"+MaintenanceDetail.Status_Finish+"' and equipment_id = '"+id+"'"); - try{ - //循环时间差值,获取每年的设备保养和维修费用 - for(int i=0;i mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' and ParmName like '%年电增量费%' "); - /*List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' and ParmName like '%电费%' "); - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where id='"+equipmentCard.getEquipmentcardid()+"_energy'");*/ - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - /*MPointHistory totalEnergyFeePerEquip = this.mPointHistoryService - .selectSumValueByTableAWhere(equipmentCard.getBizid(), "[TB_MP_"+equipmentCard.getEquipmentcardid()+"_energy]" - , "where CONVERT(VARCHAR(4),MeasureDT,120) like '"+rangeYear+"%'");*/ - MPointHistory totalEnergyFeePerEquip = this.mPointHistoryService - .selectSumValueByTableAWhere(equipmentCard.getBizid(), "[TB_MP_"+mPoint.get(0).getMpointcode()+"]" - , "where CONVERT(VARCHAR(4),MeasureDT,120) <= '"+rangeYear+"' "); - if(totalEnergyFeePerEquip!=null){ - energyFee=totalEnergyFeePerEquip.getParmvalue().doubleValue(); - //energyFee=totalEnergyFeePerEquip.getParmvalue().doubleValue()/(i+1); - //System.out.println("energyFee:"+energyFee); - } - } - //求C 并push进数组 - Double cPerEquip = maintainFeePerEquip + energyFee; - c.add(cPerEquip); - }else{ - double ck = equipmentClassProp.get(0).getMaintainceFeeSet(); - double ckbot = 0.0; - if(i!=0){ - ckbot = c.get(i-1); - } - double bn = ckbot + ck + ck*(forNum)*lambda +(i-1)*lambda/2; - c.add(bn); - } - - } - - //根据表示判断使用方法1还是方法2 - //System.out.println("maintainSign:"+maintainSign); - if(maintainSign>=2){ - //方法2 - //先倒序Cn为double y,并同时生成序号double x - int size = equipList.get(0).getPhysicalLife().intValue()+1;//向上取整 - double[] x = new double[size]; - double[] y = new double[size]; - int length = c.size()-1;//获取Cn的长度,避免重复赋值 - for(int n=length;n>=0;n--){ - y[length-n-1] = c.get(n); - x[length-n-1] = length-n; - } - Map map = LeastSquare_Linear(x,y); - for(int j=1;j<=equipList.get(0).getPhysicalLife();j++){ - double bn = Double.valueOf(map.get("a"))*(j-1)/2 + Double.valueOf(map.get("b"))+Double.valueOf(map.get("a"));//Bn = b+1+(n-1)*a/2 - Bn.add(bn); - } - }else{ - //方法1 - //模拟值 - Double ckdot = c.get((c.size()-2)) + (days)*lambda; - //实际值 - Double ck = c.get(0); - if(ck mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - for(int i=0;i='"+startdate+"' order by MeasureDT "); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , "where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , "where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y characteristic = characteristicService.selectListByWhere(" where equipment_id like '%"+equipmentCard.getId()+"%' and c_type='1' "); - if(characteristic!=null && characteristic.size()>0){ - if(characteristic.get(0).getCharacteristic()!=null){ - String[] Characteristics = characteristic.get(0).getCharacteristic().split(";"); - for(int c=0;c mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' and MPointCode like '%_NUM' "); - if(mPoint != null && mPoint.size()!=0){ - if(pumpMultiple!=null && !pumpMultiple.isEmpty()){ - multipleTable = "[TB_MP_"+mPoint.get(0).getMpointcode()+"]"; - if(pumpMultiple.equals("0")){ - //单泵 - multipleWherestr = " and n.ParmValue>0 and n.ParmValue<2 "; - } - if(pumpMultiple.equals("1")){ - //满负荷 - multipleWherestr = " and n.ParmValue>3 "; - } - } - } - mPoint = this.mPointService.selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - for(int i=0;i='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT "); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , "where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , "where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y characteristic = characteristicService.selectListByWhere(" where equipment_id like '%"+equipmentCard.getId()+"%' and c_type='1' "); - if(characteristic!=null && characteristic.size()>0){ - if(characteristic.get(0).getCharacteristic()!=null){ - String[] Characteristics = characteristic.get(0).getCharacteristic().split(";"); - for(int c=0;c0){ - for(int i=0;i units = this.unitService.getUnitChildrenById(unitId); - String companyids=""; - for(Unit unit : units){ - if(unit.getType()!=null && !"U".equals(unit.getType())){ - companyids += "'"+unit.getId()+"',"; - } - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentmanufacturer in ('"+equipmentmanufacturerStr+"') " - + "and id in (select equipment_id from [TB_EM_EquipmentCard_Prop] where specification in ('"+specificationStr+"')) "+wherestr+" order by insdt "); - JSONArray result = new JSONArray(); - for(EquipmentCard equipmentCard:equipmentCardList){ - String equipmentCardName = equipmentCard.getEquipmentname(); - JSONArray flow_actual = new JSONArray(); - JSONArray power_actual = new JSONArray(); - JSONArray lift_actual = new JSONArray(); - JSONArray efficiency_actual = new JSONArray(); - JSONArray flow_standard = new JSONArray(); - JSONArray power_standard = new JSONArray(); - JSONArray lift_standard = new JSONArray(); - JSONArray efficiency_standard = new JSONArray(); - JSONArray flow_xAxis = new JSONArray(); - JSONArray power_xAxis = new JSONArray(); - JSONArray lift_xAxis = new JSONArray(); - JSONArray efficiency_xAxis = new JSONArray(); - - JSONArray flow_legend = new JSONArray(); - JSONArray power_legend = new JSONArray(); - JSONArray lift_legend = new JSONArray(); - JSONArray efficiency_legend = new JSONArray(); - //青标液位 - JSONArray level_actual = new JSONArray(); - JSONArray level_standard = new JSONArray(); - JSONArray level_xAxis = new JSONArray(); - JSONArray level_legend = new JSONArray(); - //吨米污水提升电单耗 - JSONArray tons_actual = new JSONArray(); - JSONArray tons_standard = new JSONArray(); - JSONArray tons_xAxis = new JSONArray(); - JSONArray tons_legend = new JSONArray(); - - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - for(int i=0;i='"+startdate+"' order by MeasureDT "); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , "where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , "where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y characteristic = characteristicService.selectListByWhere(" where equipment_id like '%"+equipmentCard.getId()+"%' and c_type='1' "); - if(characteristic!=null && characteristic.size()>0){ - if(characteristic.get(0).getCharacteristic()!=null){ - String[] Characteristics = characteristic.get(0).getCharacteristic().split(";"); - for(int c=0;c0){ - for(int i=0;i units = this.unitService.getUnitChildrenById(unitId); - String companyids=""; - for(Unit unit : units){ - if(unit.getType()!=null && !"U".equals(unit.getType())){ - companyids += "'"+unit.getId()+"',"; - } - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentmanufacturer in ('"+equipmentmanufacturerStr+"') " - + "and id in (select equipment_id from [TB_EM_EquipmentCard_Prop] where specification in ('"+specificationStr+"')) "+wherestr+" order by insdt "); - JSONArray result = new JSONArray(); - - for(EquipmentCard equipmentCard:equipmentCardList){ - //吨水电耗 - BigDecimal[] actual = new BigDecimal[3]; - - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' " - + "and (MPointCode like '%_WE' or MPointCode like '%_timesacc' or MPointCode like '%_timeacc' ) "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - List MPointHistoryListSt = null; - for(int i=0;i='"+startdate+"' and ParmValue>0"); - if(MPointHistoryList!=null && MPointHistoryList.size()>0){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - if(MPointHistoryList!=null && MPointHistoryList.size()>0 - && MPointHistoryListSt!=null && MPointHistoryListSt.size()>0){ - parmvalue = MPointHistoryList.get(0).getParmvalue().subtract(MPointHistoryListSt.get(0).getParmvalue()); - } - actual[1]=parmvalue; - } - if(mPoint.get(i).getParmname().contains("运行时间")){ - //差值 - MPointHistoryList = this.mPointHistoryService - .selectTopNumListByTableAWhere(equipmentCard.getBizid()," top 1 ", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' order by MeasureDT desc"); - MPointHistoryListSt = this.mPointHistoryService - .selectTopNumListByTableAWhere(equipmentCard.getBizid()," top 1 ", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT>='"+startdate+"' order by MeasureDT"); - if(MPointHistoryList!=null && MPointHistoryList.size()>0 - && MPointHistoryListSt!=null && MPointHistoryListSt.size()>0){ - parmvalue = MPointHistoryList.get(0).getParmvalue().subtract(MPointHistoryListSt.get(0).getParmvalue()).divide(new BigDecimal("3600"), 1, BigDecimal.ROUND_HALF_UP); - } - actual[2]=parmvalue; - } - } - } - } - String object="{\"equipmentCard\":'"+JSONObject.toJSON(equipmentCard)+"',\"actual\":"+JSONArray.toJSON(actual)+"}"; - result.add(JSONObject.parseObject(object)); - } - return result.toJSONString(); - } - - /** - * 经济寿命模型,生成经济寿命曲线 - * @param id - * @return - */ - public String getEquipmentPumpAnalysisModel(String selectionModels,String timeType,String startdate,String enddate,String unitId,String pumpMultiple){ - if(startdate!=null && !startdate.isEmpty() && startdate.length()<11){ - startdate += " 00:00"; - } - if(enddate!=null && !enddate.isEmpty() && enddate.length()<11){ - enddate += " 23:59"; - } - JSONArray jsonArray = JSON.parseArray(selectionModels); - String specification=""; - String equipmentmanufacturer=""; - if(jsonArray!=null && jsonArray.size()>0){ - for(int i=0;i units = this.unitService.getUnitChildrenById(unitId); - String companyids=""; - for(Unit unit : units){ - if(unit.getType()!=null && !"U".equals(unit.getType())){ - companyids += "'"+unit.getId()+"',"; - } - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentmanufacturer in ('"+equipmentmanufacturerStr+"') " - + "and id in (select equipment_id from [TB_EM_EquipmentCard_Prop] where specification in ('"+specificationStr+"')) "+wherestr+" order by insdt "); - JSONArray result = new JSONArray(); - for(EquipmentCard equipmentCard:equipmentCardList){ - String equipmentCardName = equipmentCard.getEquipmentname(); - JSONArray flow_actual = new JSONArray(); - JSONArray power_actual = new JSONArray(); - JSONArray lift_actual = new JSONArray(); - JSONArray efficiency_actual = new JSONArray(); - JSONArray flow_standard = new JSONArray(); - JSONArray power_standard = new JSONArray(); - JSONArray lift_standard = new JSONArray(); - JSONArray efficiency_standard = new JSONArray(); - JSONArray flow_xAxis = new JSONArray(); - JSONArray power_xAxis = new JSONArray(); - JSONArray lift_xAxis = new JSONArray(); - JSONArray efficiency_xAxis = new JSONArray(); - - JSONArray flow_legend = new JSONArray(); - JSONArray power_legend = new JSONArray(); - JSONArray lift_legend = new JSONArray(); - JSONArray efficiency_legend = new JSONArray(); - //青标液位 - JSONArray level_actual = new JSONArray(); - JSONArray level_standard = new JSONArray(); - JSONArray level_xAxis = new JSONArray(); - JSONArray level_legend = new JSONArray(); - //吨米污水提升电单耗 - JSONArray tons_actual = new JSONArray(); - JSONArray tons_standard = new JSONArray(); - JSONArray tons_xAxis = new JSONArray(); - JSONArray tons_legend = new JSONArray(); - String multipleTable = ""; - String multipleWherestr = ""; - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' and MPointCode like '%_NUM' "); - if(mPoint != null && mPoint.size()!=0){ - multipleTable = "[TB_MP_"+mPoint.get(0).getMpointcode()+"]"; - if(pumpMultiple!=null && !pumpMultiple.isEmpty()){ - if(pumpMultiple.equals("0")){ - //单泵 - multipleWherestr = " and n.ParmValue>0 and n.ParmValue<2 "; - } - if(pumpMultiple.equals("1")){ - //满负荷 - multipleWherestr = " and n.ParmValue>3 "; - } - } - } - mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - for(int i=0;i='"+startdate+"' order by a.MeasureDT "); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , "where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , "where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y characteristic = characteristicService.selectListByWhere(" where equipment_id like '%"+equipmentCard.getId()+"%' and c_type='1' "); - if(characteristic!=null && characteristic.size()>0){ - if(characteristic.get(0).getCharacteristic()!=null){ - String[] Characteristics = characteristic.get(0).getCharacteristic().split(";"); - for(int c=0;c units = this.unitService.getUnitChildrenById(unitId); - String companyids=""; - for(Unit unit : units){ - if(unit.getType()!=null && !"U".equals(unit.getType())){ - companyids += "'"+unit.getId()+"',"; - } - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - List equipmentCardList = this.equipmentCardService.selectListByWhere("where id in ('"+ids+"') "+wherestr+" order by insdt "); - - String result =getEquipmentPumpAnalysisDHData(equipmentCardList,startdate,enddate,pumpMultiple); - return result; - } - - public String getEquipmentPumpAnalysisDHModel(String selectionModels,String startdate,String enddate,String unitId,String pumpMultiple){ - if(startdate!=null && !startdate.isEmpty() && startdate.length()<11){ - startdate += " 00:00"; - } - if(enddate!=null && !enddate.isEmpty() && enddate.length()<11){ - enddate += " 23:59"; - } - JSONArray jsonArray = JSON.parseArray(selectionModels); - String specification=""; - String equipmentmanufacturer=""; - if(jsonArray!=null && jsonArray.size()>0){ - for(int i=0;i units = this.unitService.getUnitChildrenById(unitId); - String companyids=""; - for(Unit unit : units){ - if(unit.getType()!=null && !"U".equals(unit.getType())){ - companyids += "'"+unit.getId()+"',"; - } - } - if(companyids!=""){ - companyids = companyids.substring(0, companyids.length()-1); - wherestr += " and bizId in ("+companyids+") "; - } - } - List equipmentCardList = this.equipmentCardService.selectListByWhere("where equipmentmanufacturer in ('"+equipmentmanufacturerStr+"') " - + "and id in (select equipment_id from [TB_EM_EquipmentCard_Prop] where specification in ('"+specificationStr+"')) "+wherestr+" order by insdt "); - - String result =getEquipmentPumpAnalysisDHData(equipmentCardList,startdate,enddate,pumpMultiple); - return result; - } - /** - * 经济寿命模型,生成经济寿命曲线 - * @param id - * @return - */ - public String getEquipmentPumpAnalysisDHData(List equipmentCardList,String startdate,String enddate,String pumpMultiple){ - JSONArray result = new JSONArray(); - - for(EquipmentCard equipmentCard:equipmentCardList){ - //吨水电耗 - BigDecimal[] actual = new BigDecimal[3]; - - String multipleTable = ""; - String multipleWherestr = ""; - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' and MPointCode like '%_NUM' "); - if(mPoint != null && mPoint.size()!=0){ - multipleTable = "[TB_MP_"+mPoint.get(0).getMpointcode()+"]"; - if(pumpMultiple!=null && !pumpMultiple.isEmpty()){ - if(pumpMultiple.equals("0")){ - //单泵 - multipleWherestr = " and n.ParmValue>0 and n.ParmValue<2 "; - } - if(pumpMultiple.equals("1")){ - //满负荷 - multipleWherestr = " and n.ParmValue>3 "; - } - } - } - mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' " - + "and (MPointCode like '%_WE' or MPointCode like '%_timesacc' or MPointCode like '%_timeacc' ) "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - List MPointHistoryListSt = null; - for(int i=0;i='"+startdate+"' and a.ParmValue>0"); - /*MPointHistoryList = this.mPointHistoryService - .selectAVGMultiple(equipmentCard.getBizid(), "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' and a.ParmValue>0");*/ - if(MPointHistoryList!=null && MPointHistoryList.size()>0){ - for(int y=0;y='"+startdate+"' order by a.MeasureDT"); - if(MPointHistoryList!=null && MPointHistoryList.size()>0 - && MPointHistoryListSt!=null && MPointHistoryListSt.size()>0){ - parmvalue = MPointHistoryList.get(0).getParmvalue().subtract(MPointHistoryListSt.get(0).getParmvalue()); - } - actual[1]=parmvalue; - } - if(mPoint.get(i).getParmname().contains("运行时间")){ - //差值 - MPointHistoryList = this.mPointHistoryService - .selectTopNumListByTableMultipleWhere(equipmentCard.getBizid()," top 1 ", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' order by a.MeasureDT desc"); - MPointHistoryListSt = this.mPointHistoryService - .selectTopNumListByTableMultipleWhere(equipmentCard.getBizid()," top 1 ", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT>='"+startdate+"' order by a.MeasureDT"); - if(MPointHistoryList!=null && MPointHistoryList.size()>0 - && MPointHistoryListSt!=null && MPointHistoryListSt.size()>0){ - parmvalue = MPointHistoryList.get(0).getParmvalue().subtract(MPointHistoryListSt.get(0).getParmvalue()).divide(new BigDecimal("3600"), 1, BigDecimal.ROUND_HALF_UP); - } - actual[2]=parmvalue; - } - } - } - } - String object="{\"equipmentCard\":'"+JSONObject.toJSON(equipmentCard)+"',\"actual\":"+JSONArray.toJSON(actual)+"}"; - result.add(JSONObject.parseObject(object)); - } - return result.toJSONString(); - } - /** - * 经济寿命模型,生成经济寿命曲线 - * @param id - * @return - */ - public String getEquipmentFanAnalysis(String id,String timeType,String num,String startdate,String enddate){ - if(startdate!=null && !startdate.isEmpty() && startdate.length()<11){ - startdate += " 00:00"; - } - if(enddate!=null && !enddate.isEmpty() && enddate.length()<11){ - enddate += " 23:59"; - } - if(num==null || num.equals("")){ - num="12"; - } - EquipmentCard equipmentCard = this.equipmentCardService.selectById(id); - - JSONArray flow_actual = new JSONArray(); - JSONArray power_actual = new JSONArray(); - JSONArray lift_actual = new JSONArray(); - JSONArray efficiency_actual = new JSONArray(); - JSONArray flow_standard = new JSONArray(); - JSONArray power_standard = new JSONArray(); - JSONArray lift_standard = new JSONArray(); - JSONArray efficiency_standard = new JSONArray(); - JSONArray flow_xAxis = new JSONArray(); - JSONArray power_xAxis = new JSONArray(); - JSONArray lift_xAxis = new JSONArray(); - JSONArray efficiency_xAxis = new JSONArray(); - JSONArray pneumatics_actual = new JSONArray(); - JSONArray input_actual = new JSONArray(); - JSONArray pneumatics_xAxis = new JSONArray(); - JSONArray input_xAxis = new JSONArray(); - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - for(int i=0;i='"+startdate+"' order by MeasureDT "); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , "where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , "where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' order by MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGday(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonth(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]" - , " where MeasureDT<='"+enddate+"' and MeasureDT>='"+startdate+"' "); - } - if(MPointHistoryList!=null){ - for(int y=0;y characteristic = characteristicService.selectListByWhere(" where equipment_id like '%"+equipmentCard.getId()+"%' and c_type='1' "); - if(characteristic!=null && characteristic.size()>0){ - if(characteristic.get(0).getCharacteristic()!=null){ - String[] Characteristics = characteristic.get(0).getCharacteristic().split(";"); - for(int c=0;c xAxisList = new ArrayList(); - for(String equipmentCardid:ids){ - EquipmentCard equipmentCard = this.equipmentCardService.selectById(equipmentCardid); - String equipmentCardName = equipmentCard.getEquipmentname(); - JSONArray flow_actual = new JSONArray(); - JSONArray power_actual = new JSONArray(); - JSONArray lift_actual = new JSONArray(); - JSONArray efficiency_actual = new JSONArray(); - JSONArray flow_standard = new JSONArray(); - JSONArray power_standard = new JSONArray(); - JSONArray lift_standard = new JSONArray(); - JSONArray efficiency_standard = new JSONArray(); - - JSONArray flow_legend = new JSONArray(); - JSONArray power_legend = new JSONArray(); - JSONArray lift_legend = new JSONArray(); - JSONArray efficiency_legend = new JSONArray(); - //青标液位 - JSONArray level_actual = new JSONArray(); - JSONArray level_standard = new JSONArray(); - JSONArray level_legend = new JSONArray(); - //吨米污水提升电单耗 - JSONArray tons_actual = new JSONArray(); - JSONArray tons_standard = new JSONArray(); - JSONArray tons_legend = new JSONArray(); - //压力 - JSONArray pressure_actual = new JSONArray(); - JSONArray pressure_standard = new JSONArray(); - JSONArray pressure_legend = new JSONArray(); - String multipleTable = ""; - String multipleWherestr = ""; - List mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' and MPointCode like '%_NUM' "); - if(mPoint != null && mPoint.size()!=0){ - if(pumpMultiple!=null && !pumpMultiple.isEmpty()){ - multipleTable = "[TB_MP_"+mPoint.get(0).getMpointcode()+"]"; - if(pumpMultiple.equals("0")){ - //单泵 - multipleWherestr = " and n.ParmValue>0 and n.ParmValue<2 "; - } - if(pumpMultiple.equals("1")){ - //满负荷 - multipleWherestr = " and n.ParmValue>3 "; - } - } - } - mPoint = this.mPointService.selectListByWhere(equipmentCard.getBizid(), " where equipmentId='"+equipmentCard.getId()+"' "); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - List MPointHistoryList = null; - for(int i=0;i='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT "); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , "where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , "where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y='"+startdate+"' "+multipleWherestr+" order by a.MeasureDT"); - }else if(timeType.equals("1")){ - MPointHistoryList = this.mPointHistoryService - .selectAVGdayMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - }else{ - MPointHistoryList = this.mPointHistoryService - .selectAVGmonthMultiple(equipmentCard.getBizid(),"", "[TB_MP_"+mPoint.get(i).getMpointcode()+"]", multipleTable - , " where a.MeasureDT<='"+enddate+"' and a.MeasureDT>='"+startdate+"' "+multipleWherestr+" "); - } - if(MPointHistoryList!=null){ - for(int y=0;y characteristic = characteristicService.selectListByWhere(" where equipment_id like '%"+equipmentCard.getId()+"%' and c_type='1' "); - if(characteristic!=null && characteristic.size()>0){ - if(characteristic.get(0).getCharacteristic()!=null){ - String[] Characteristics = characteristic.get(0).getCharacteristic().split(";"); - for(int c=0;c() { - @Override - public int compare(String o1, String o2) { - Date date1 = null; - Date date2 = null; - try { - // 注意格式需要与上面一致,不然会出现异常 - date1 = sdf.parse(o1); - date2 = sdf.parse(o2); - } catch (ParseException e) { - e.printStackTrace(); - } - // TODO Auto-generated method stub - // 升序 - return date1.compareTo(date2); - // 降序 - //return date2.compareTo(date1); - } - }); - resultObj.put("xAxisList", xAxisList); - resultObj.put("dataList", result); - return resultObj.toJSONString(); - } - /** - * 一元线性回归最小二乘:多个 (x,y) 点拟合一条直线 y=ax+b - * @author Administrator - *返回Map,a和b的值 - */ - public static Map LeastSquare_Linear(double []x,double []y) { - double a = 0; - double b = 0; - double t1 = 0; - double t2 = 0; - double t3 = 0; - double t4 = 0; - for (int i=0;i map = new HashMap(); - map.put("a", a); - map.put("b", b); - return map; - } - - /** - * 获取当年的保养模拟值 - * @param list 所有保养和维修记录 - * @param rangeYear 对比年份 - * @return - */ - private Double getLastYearMaintenanceFee(List list,String rangeYear){ - Double maintenanceDetailMonthly = 0.0;//月保养费用 - Integer maintenanceDetailMonthlyNum = 0;//月保养次数 - Double maintenanceDetailHalfYear = 0.0;//半年保养费用 - Integer maintenanceDetailHalfYearNum = 0;//半年保养次数 - Double other = 0.0;//其他没有保养计划的保养以及年保养 - for(int i=0;i list,String rangeYear){ - Double total = 0.0; - for(int i=0;i equipList = this.equipmentCardPropService.selectAgeListByWhere(" where E.id = '"+id+"'"); - //获取设定经济寿命T0 - List equipmentClassProp = this.equipmentClassPropService - .selectListByWhere(" where [equipment_class_id] = '"+equipmentCard.getEquipmentclassid()+"'"); - Double t0 = equipmentClassProp.get(0).getEcoLifeSet();//经济寿命设定值 - Double k0 = equipList.get(0).getPurchaseMoney().doubleValue();//购置费 - Double gamma = equipList.get(0).getResidualValueRate();//残值率 - Double lambda = t0*t0/2/(k0-k0*gamma);//λ - ArrayList c =new ArrayList(); - int maintainSign = 0;//用于判断有几年的保养数据 - //获取当前时间与购置时间的差值 - int days = CommUtil.getDays(CommUtil.nowDate(),equipList.get(0).getInstallDate())/365; - - /* 先获取 等额资产回复成本 和 X轴 */ - ArrayList An = new ArrayList();//等额资产回复成本 - List xAis = new ArrayList();//X轴 - SimpleDateFormat formatter = new SimpleDateFormat("yyyy"); - Date date = null; - try { - date = formatter.parse(equipList.get(0).getInstallDate()); - for(int j=1;j<=equipList.get(0).getPhysicalLife();j++){ - double an = (k0-k0*gamma)/j; - An.add(an); - //x轴 - Calendar calendar=Calendar.getInstance(); - calendar.setTime(date); - calendar.add(Calendar.YEAR, j-1);//增加i年 - String xAisDate = formatter.format(calendar.getTime()); - xAis.add(xAisDate); - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - /* 再获取 设备年等额运行成本 */ - ArrayList Bn = new ArrayList();//设备年等额运行成本 - //获取全部保养单和维修单 - List maintenanceDetail = this.maintenanceDetailService - .getPlanTypeByWhere(" where D.status = '"+MaintenanceDetail.Status_Finish+"' and equipment_id = '"+id+"'"); - try{ - //循环时间差值,获取每年的设备保养和维修费用 - for(int i=0;i mPoint = this.mPointService - .selectListByWhere(equipmentCard.getBizid(), " where id='"+equipmentCard.getEquipmentcardid()+"_energy'"); - if(mPoint != null && mPoint.size()!=0){ - //若有此测量点寻找时间范围内的历史表 - MPointHistory totalEnergyFeePerEquip = this.mPointHistoryService - .selectSumValueByTableAWhere(equipmentCard.getBizid(), "[TB_MP_"+equipmentCard.getEquipmentcardid()+"_energy]" - , "where CONVERT(VARCHAR(4),MeasureDT,120) like '"+rangeYear+"%'"); - if(totalEnergyFeePerEquip!=null){ - energyFee=totalEnergyFeePerEquip.getParmvalue().doubleValue(); - } - } - - //求C 并push进数组 - Double cPerEquip = maintainFeePerEquip + energyFee; - c.add(cPerEquip); - } - - //根据表示判断使用方法1还是方法2 - if(maintainSign>=2){ - //方法2 - //先倒序Cn为double y,并同时生成序号double x - int size = equipList.get(0).getPhysicalLife().intValue()+1;//向上取整 - double[] x = new double[size]; - double[] y = new double[size]; - int length = c.size()-1;//获取Cn的长度,避免重复赋值 - for(int n=length;n>=0;n--){ - y[length-n-1] = c.get(n); - x[length-n-1] = length-n; - } - Map map = LeastSquare_Linear(x,y); - for(int j=1;j<=equipList.get(0).getPhysicalLife();j++){ - double bn = Double.valueOf(map.get("a"))*(j-1)/2 + Double.valueOf(map.get("b"))+Double.valueOf(map.get("a"));//Bn = b+1+(n-1)*a/2 - Bn.add(bn); - } - }else{ - //方法1 - //模拟值 - Double ckdot = c.get((c.size()-2)) + (days)*lambda; - //实际值 - Double ck = c.get(0); - if(ck{ - @Resource - private EquipmentModelDao equipmentModelDao; - @Resource - private EquipmentCardPropDao equipmentCardPropDao; - @Override - public EquipmentModel selectById(String id) { - return equipmentModelDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return equipmentModelDao.deleteByPrimaryKey(id); - } - - @Override - public int save(EquipmentModel entity) { - return equipmentModelDao.insert(entity); - } - - @Override - public int update(EquipmentModel entity) { - return equipmentModelDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - EquipmentModel group = new EquipmentModel(); - group.setWhere(wherestr); - return equipmentModelDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - EquipmentModel group = new EquipmentModel(); - group.setWhere(wherestr); - return equipmentModelDao.deleteByWhere(group); - } - - /** - * 数学模型参数重置 - * @param entity - * @return - */ - public int reset(String flag,String value) { - EquipmentCardProp equipmentCardProp = new EquipmentCardProp(); - equipmentCardProp.setWhere(""); - List equipmentCardProps=equipmentCardPropDao.selectListByWhere(equipmentCardProp); - int result = 0; - - for (EquipmentCardProp item : equipmentCardProps) { - if(value != null){ - if(flag.equals(EquipmentModel.Flag_Reset_Param1)){ - item.setResidualValueRate(Double.valueOf(value));//残值率 - }else if(flag.equals(EquipmentModel.Flag_Reset_Param2)){ - item.setPhysicalLife(Double.valueOf(value));//物理寿命 - }else if(flag.equals(EquipmentModel.Flag_Reset_Param3)){ - item.setTechnicalLife(Double.valueOf(value));//技术寿命 - }else{ - - } - } - result = equipmentCardPropDao.updateByPrimaryKeySelective(item); - } - - return result; - } - -} diff --git a/src/com/sipai/service/visit/SafeAreaPositionService.java b/src/com/sipai/service/visit/SafeAreaPositionService.java deleted file mode 100644 index c1f1a3db..00000000 --- a/src/com/sipai/service/visit/SafeAreaPositionService.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.sipai.service.visit; - -import com.sipai.dao.visit.SafeAreaPositionDao; -import com.sipai.entity.visit.SafeAreaPosition; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -@Service -public class SafeAreaPositionService implements CommService{ - @Resource - private SafeAreaPositionDao safeAreaPositionDao; - - @Override - public SafeAreaPosition selectById(String id) { - SafeAreaPosition safeAreaPosition = this.safeAreaPositionDao.selectByPrimaryKey(id); - return safeAreaPosition; - } - - @Override - public int deleteById(String id) { - int res = this.safeAreaPositionDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(SafeAreaPosition safeAreaPosition) { - int res = this.safeAreaPositionDao.insert(safeAreaPosition); - return res; - } - - @Override - public int update(SafeAreaPosition safeAreaPosition) { - int res = this.safeAreaPositionDao.updateByPrimaryKeySelective(safeAreaPosition); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - SafeAreaPosition safeAreaPosition = new SafeAreaPosition(); - safeAreaPosition.setWhere(wherestr); - List safeAreaPositions = this.safeAreaPositionDao.selectListByWhere(safeAreaPosition); - - return safeAreaPositions; - } - - @Override - public int deleteByWhere(String wherestr) { - SafeAreaPosition safeAreaPosition = new SafeAreaPosition(); - safeAreaPosition.setWhere(wherestr); - return this.safeAreaPositionDao.deleteByWhere(safeAreaPosition); - } - /** - * 判断当前位置是否在多边形区域内 - * @param orderLocation 当前点 - * @param safeAreaIds 安全区域id(英文逗号拼接) - * @return - */ - public boolean isInPolygon(Map orderLocation, String safeAreaIds){ - - double p_x =Double.parseDouble(orderLocation.get("X")); - double p_y =Double.parseDouble(orderLocation.get("Y")); - Point2D.Double point = new Point2D.Double(p_x, p_y); - - List pointList= new ArrayList(); - safeAreaIds = safeAreaIds.replace(",","','"); - List safeAreaPositionList = this.selectListByWhere("where safeArea_id in ('"+safeAreaIds+"') order by safeArea_id,morder"); - - for (SafeAreaPosition safeAreaPosition : safeAreaPositionList){ - double polygonPoint_x=safeAreaPosition.getLatitude().doubleValue(); - double polygonPoint_y=safeAreaPosition.getLongitude().doubleValue(); - Point2D.Double polygonPoint = new Point2D.Double(polygonPoint_x,polygonPoint_y); - pointList.add(polygonPoint); - } - return IsPtInPoly(point,pointList); - } - /** - * 返回一个点是否在一个多边形区域内, 如果点位于多边形的顶点或边上,不算做点在多边形内,返回false - * @param point - * @param polygon - * @return - */ - public boolean checkWithJdkGeneralPath(Point2D.Double point, List polygon) { - java.awt.geom.GeneralPath p = new java.awt.geom.GeneralPath(); - Point2D.Double first = polygon.get(0); - p.moveTo(first.x, first.y); - polygon.remove(0); - for (Point2D.Double d : polygon) { - p.lineTo(d.x, d.y); - } - p.lineTo(first.x, first.y); - p.closePath(); - return p.contains(point); - } - - /** - * 判断点是否在多边形内,如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true - * @param point 检测点 - * @param pts 多边形的顶点 - * @return 点在多边形内返回true,否则返回false - */ - public boolean IsPtInPoly(Point2D.Double point, List pts){ - - int N = pts.size(); - boolean boundOrVertex = true; //如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true - int intersectCount = 0;//cross points count of x - double precision = 2e-10; //浮点类型计算时候与0比较时候的容差 - Point2D.Double p1, p2;//neighbour bound vertices - Point2D.Double p = point; //当前点 - - p1 = pts.get(0);//left vertex - for(int i = 1; i <= N; ++i){//check all rays - if(p.equals(p1)){ - return boundOrVertex;//p is an vertex - } - - p2 = pts.get(i % N);//right vertex - if(p.x < Math.min(p1.x, p2.x) || p.x > Math.max(p1.x, p2.x)){//ray is outside of our interests - p1 = p2; - continue;//next ray left point - } - - if(p.x > Math.min(p1.x, p2.x) && p.x < Math.max(p1.x, p2.x)){//ray is crossing over by the algorithm (common part of) - if(p.y <= Math.max(p1.y, p2.y)){//x is before of ray - if(p1.x == p2.x && p.y >= Math.min(p1.y, p2.y)){//overlies on a horizontal ray - return boundOrVertex; - } - - if(p1.y == p2.y){//ray is vertical - if(p1.y == p.y){//overlies on a vertical ray - return boundOrVertex; - }else{//before ray - ++intersectCount; - } - }else{//cross point on the left side - double xinters = (p.x - p1.x) * (p2.y - p1.y) / (p2.x - p1.x) + p1.y;//cross point of y - if(Math.abs(p.y - xinters) < precision){//overlies on a ray - return boundOrVertex; - } - - if(p.y < xinters){//before ray - ++intersectCount; - } - } - } - }else{//special case when ray is crossing through the vertex - if(p.x == p2.x && p.y <= p2.y){//p crossing over p2 - Point2D.Double p3 = pts.get((i+1) % N); //next vertex - if(p.x >= Math.min(p1.x, p3.x) && p.x <= Math.max(p1.x, p3.x)){//p.x lies between p1.x & p3.x - ++intersectCount; - }else{ - intersectCount += 2; - } - } - } - p1 = p2;//next ray left point - } - - if(intersectCount % 2 == 0){//偶数在多边形外 - return false; - } else { //奇数在多边形内 - return true; - } - } -} diff --git a/src/com/sipai/service/visit/SafeAreaService.java b/src/com/sipai/service/visit/SafeAreaService.java deleted file mode 100644 index 189762f0..00000000 --- a/src/com/sipai/service/visit/SafeAreaService.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.sipai.service.visit; - -import com.sipai.dao.visit.SafeAreaDao; -import com.sipai.entity.visit.SafeArea; -import com.sipai.entity.visit.VisitCommString; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class SafeAreaService implements CommService{ - @Resource - private SafeAreaDao safeAreaDao; - - String[][] VISITS = VisitCommString.STATUS_VISIT; - @Override - public SafeArea selectById(String id) { - SafeArea safeArea = this.safeAreaDao.selectByPrimaryKey(id); - - if (safeArea != null) { - if (safeArea.getState() != null) { - String stateName = safeArea.getState(); - for (String[] VISIT : VISITS) { - if (VISIT[0].equals(safeArea.getState())) { - stateName = VISIT[1]; - break; - } - } - safeArea.setStateName(stateName); - } - } - return safeArea; - } - - @Override - public int deleteById(String id) { - int res = this.safeAreaDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(SafeArea safeArea) { - int res = this.safeAreaDao.insert(safeArea); - return res; - } - - @Override - public int update(SafeArea safeArea) { - int res = this.safeAreaDao.updateByPrimaryKeySelective(safeArea); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - SafeArea safeArea = new SafeArea(); - safeArea.setWhere(wherestr); - List safeAreas = this.safeAreaDao.selectListByWhere(safeArea); - if(safeAreas != null && safeAreas.size()>0){ - for(SafeArea item :safeAreas){ - if (item.getState() != null) { - String stateName = item.getState(); - for(String[] VISIT:VISITS){ - if(VISIT[0].equals(item.getState())){ - stateName = VISIT[1]; - break; - } - } - item.setStateName(stateName); - } - } - } - return safeAreas; - } - - @Override - public int deleteByWhere(String wherestr) { - SafeArea safeArea = new SafeArea(); - safeArea.setWhere(wherestr); - return this.safeAreaDao.deleteByWhere(safeArea); - } - -} diff --git a/src/com/sipai/service/visit/VisitApplyService.java b/src/com/sipai/service/visit/VisitApplyService.java deleted file mode 100644 index 59eb07c8..00000000 --- a/src/com/sipai/service/visit/VisitApplyService.java +++ /dev/null @@ -1,715 +0,0 @@ -package com.sipai.service.visit; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.poi.hssf.usermodel.HSSFCell; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFComment; -import org.apache.poi.hssf.usermodel.HSSFDataValidation; -import org.apache.poi.hssf.usermodel.HSSFFont; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFRichTextString; -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.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.visit.VisitApplyDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.sparepart.Goods; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.VisitApply; -import com.sipai.entity.visit.VisitCommString; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -import static org.apache.poi.ss.usermodel.CellType.*; - -@Service -public class VisitApplyService implements CommService{ - @Resource - private VisitApplyDao visitApplyDao; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitService businessUnitService; - - String[][] VISITS = VisitCommString.STATUS_VISIT; - @Override - public VisitApply selectById(String id) { - VisitApply visitApply = this.visitApplyDao.selectByPrimaryKey(id); - if(visitApply != null){ - if (visitApply.getAuditManId() != null && !visitApply.getAuditManId().isEmpty()) { - String auditMan = this.getUserNamesByUserIds(visitApply.getAuditManId()); - visitApply.setAuditMan(auditMan); - } - if (visitApply.getState() != null) { - String stateName = visitApply.getState(); - for(String[] VISIT:VISITS){ - if(VISIT[0].equals(visitApply.getState())){ - stateName = VISIT[1]; - break; - } - } - visitApply.setStateName(stateName); - } - } - return visitApply; - } - - @Override - public int deleteById(String id) { - int res = this.visitApplyDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(VisitApply visitApply) { - int res = this.visitApplyDao.insert(visitApply); - return res; - } - - @Override - public int update(VisitApply visitApply) { - int res = this.visitApplyDao.updateByPrimaryKeySelective(visitApply); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - VisitApply visitApply = new VisitApply(); - visitApply.setWhere(wherestr); - List visitApplys = this.visitApplyDao.selectListByWhere(visitApply); - - if(visitApplys != null && visitApplys.size()>0){ - for(VisitApply item :visitApplys){ - if (item.getAuditManId() != null && !item.getAuditManId().isEmpty()) { - String auditMan = this.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditMan(auditMan); - } - if (item.getState() != null) { - String stateName = item.getState(); - for(String[] VISIT:VISITS){ - if(VISIT[0].equals(item.getState())){ - stateName = VISIT[1]; - break; - } - } - item.setStateName(stateName); - } - } - } - return visitApplys; - } - - @Override - public int deleteByWhere(String wherestr) { - VisitApply visitApply = new VisitApply(); - visitApply.setWhere(wherestr); - return this.visitApplyDao.deleteByWhere(visitApply); - } - - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } - /** - * 流程启动 - * @param - * @return - */ - @Transactional - public int doStartProcess(VisitApply visitApply) { - try { - Map variables = new HashMap(); - if(!visitApply.getAuditManId().isEmpty()){ - variables.put("userIds", visitApply.getAuditManId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Visit_Apply.getId()+"-"+visitApply.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(visitApply.getId(), visitApply.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - visitApply.setProcessid(processInstance.getId()); - visitApply.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res = 0; - VisitApply visitApplys = this.selectById(visitApply.getId()); - if (visitApplys != null) {//编辑页面发起,用更新方法 - res = visitApplyDao.updateByPrimaryKeySelective(visitApply); - }else {//新增页面直接发起,用保存方法 - res = visitApplyDao.insert(visitApply); - } - if (res==1) { - //发送消息 - User user = userService.getUserById(visitApply.getInsuser()); - String recordUser = visitApply.getAuditMan(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(visitApply.getInsdt(),visitApply.getInsuser(), - visitApply.getId(),visitApply.getProcessid(),visitApply.getUnitId(), - null,"提交了参观申请表至" + recordUser + "进行审批。",user,"流程发起"); - businessUnitRecord.sendMessage(visitApply.getAuditManId(),""); - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - VisitApply visitApply = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(visitApply.getProcessid()).list(); - if (task!=null && task.size()>0) { - visitApply.setState(task.get(0).getName()); - }else{ - - visitApply.setState(VisitCommString.STATUS_VISIT_EXECUTE); - } - int res =this.update(visitApply); - return res; - } - /** - * 流程审核 - * @param entity - * @return - */ - @Transactional - public int doAuditProcess(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter=this.selectById(entity.getBusinessid()); - int res =businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 导出申请模板 - * @param response - * @param fileName - * @param stockCheckDetails - * @throws IOException - */ - @SuppressWarnings("deprecation") - public void downloadExcelTemplate(HttpServletResponse response,int templateNum) throws IOException { - String title = "参观申请表"; - String fileName = title+"模板.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - //合并 - CellRangeAddress region01 = new CellRangeAddress( 0, 0, 0, 3); - sheet.addMergedRegion(region01); - CellRangeAddress region02 = new CellRangeAddress( 2, 2, 1, 3); - sheet.addMergedRegion(region02); - CellRangeAddress region03 = new CellRangeAddress( 3, 3, 1, 3); - sheet.addMergedRegion(region03); - CellRangeAddress region04 = new CellRangeAddress( 4, 4, 1, 3); - sheet.addMergedRegion(region04); - CellRangeAddress region05 = new CellRangeAddress( 6, 6, 1, 3); - sheet.addMergedRegion(region05); - CellRangeAddress region06 = new CellRangeAddress( 8, 8, 1, 3); - sheet.addMergedRegion(region06); - CellRangeAddress region07 = new CellRangeAddress( 9, 9, 0, 3); - sheet.addMergedRegion(region07); - - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 6000); - sheet.setColumnWidth(1, 6000); - sheet.setColumnWidth(2, 6000); - sheet.setColumnWidth(3, 6000); - sheet.setColumnWidth(4, 6000); - sheet.setColumnWidth(5, 6000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setFontName("宋体"); - headfont.setBold(true); - headfont.setFontHeightInPoints((short) 18); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - // 生成并设置一个样式,用于编号 - HSSFCellStyle numberStyle = workbook.createCellStyle(); - numberStyle.setAlignment(HorizontalAlignment.RIGHT); - numberStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont numberfont = workbook.createFont(); - numberfont.setFontName("宋体"); - numberfont.setBold(false); - numberfont.setFontHeightInPoints((short) 14); - // 把字体应用到当前的样式 - numberStyle.setFont(numberfont); - - // 生成并设置一个样式,用于编号 - HSSFCellStyle notesStyle = workbook.createCellStyle(); - notesStyle.setAlignment(HorizontalAlignment.CENTER); - notesStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont notesfont = workbook.createFont(); - notesfont.setFontName("宋体"); - notesfont.setBold(false); - notesfont.setFontHeightInPoints((short) 12); - // 把字体应用到当前的样式 - notesStyle.setFont(notesfont); - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - // 生成另一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontName("仿宋"); - columnNamefont.setBold(false); - columnNamefont.setFontHeightInPoints((short) 14); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - //表头 - HSSFRow titleRow = sheet.createRow(0); - titleRow.setHeight((short) 800); - HSSFCell twocell = titleRow.createCell(0); - twocell.setCellStyle(headStyle); - twocell.setCellValue(title); - //编号 - String numberStr = "编号:"; - HSSFRow numberrow = sheet.createRow(1); - numberrow.setHeight((short) 800); - HSSFCell numbercell = numberrow.createCell(2); - numbercell.setCellStyle(numberStyle); - HSSFRichTextString text = new HSSFRichTextString(numberStr); - numbercell.setCellValue(text); - - //title-来访参观单位 - HSSFRow tableRow = sheet.createRow(2); - tableRow.setHeight((short) 600); - HSSFCell tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("来访参观单位"); - //cont-来访参观单位 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - - //title-来访参观 - tableRow = sheet.createRow(3); - tableRow.setHeight((short) 600); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("来访参观"); - //cont-来访参观 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //title-组织单位 - tableRow = sheet.createRow(4); - tableRow.setHeight((short) 600); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("组织单位"); - //cont-组织单位 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //title-领队名称 - tableRow = sheet.createRow(5); - tableRow.setHeight((short) 600); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("领队名称"); - //cont-领队名称 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //title-职务 - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("职 务"); - //cont-职务 - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - - //title-联系方式 - tableRow = sheet.createRow(6); - tableRow.setHeight((short) 600); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("联系方式"); - //cont-联系方式 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //title- - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //cont- - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - - //title-来访时间 - tableRow = sheet.createRow(7); - tableRow.setHeight((short) 600); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("来访时间"); - //cont-来访时间 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //title-来访人数 - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("来访人数"); - //cont-来访人数 - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(templateNum); - - //title-来访参观目的及主要内容 - tableRow = sheet.createRow(8); - tableRow.setHeight((short) 1600); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue("来访参观目的及主要内容"); - //cont-来访参观目的及主要内容 - tableCell = tableRow.createCell(1); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //title- - tableCell = tableRow.createCell(2); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - //cont- - tableCell = tableRow.createCell(3); - tableCell.setCellStyle(columnNameStyle); - tableCell.setCellValue(""); - - //注 - String notesStr = "注:编号由竹园污水公司统一编制,来访单位请勿填写。"; - HSSFRow notesRow = sheet.createRow(9); - notesRow.setHeight((short) 400); - HSSFCell notesCell = notesRow.createCell(0); - notesCell.setCellStyle(notesStyle); - notesCell.setCellValue(notesStr); - - // 生成一个表格 - HSSFSheet sheetList = workbook.createSheet("参观人员名册"); - CellRangeAddress region08 = new CellRangeAddress( 11, 11, 0, 4); - sheet.addMergedRegion(region08); - //参观人员名册 - tableRow = sheetList.createRow(0); - tableRow.setHeight((short) 800); - tableCell = tableRow.createCell(0); - tableCell.setCellStyle(headStyle); - tableCell.setCellValue("参观人员名册"); - - //产生表格表头 - String tableTitleStr = "序号,姓名,性别,年龄,备注"; - String[] tableTitle = tableTitleStr.split(","); - HSSFRow tableTitleRow = sheetList.createRow(1); - tableTitleRow.setHeight((short) 600); - - for (int i = 0; i < tableTitle.length; i++) { - HSSFCell cell = tableTitleRow.createCell(i); - cell.setCellStyle(columnNameStyle); - text = new HSSFRichTextString(tableTitle[i]); - cell.setCellValue(text); - }//遍历集合数据,产生数据行 - for(int i = 0; i < templateNum; i++){ - tableTitleRow = sheetList.createRow(i+2); - tableTitleRow.setHeight((short) 600); - //填充列数据,若果数据有不同的格式请注意匹配转换 - for (int j = 0; j < tableTitle.length; j++) { - HSSFCell cell_0 = tableTitleRow.createCell(j); - cell_0.setCellStyle(columnNameStyle); - cell_0.setCellValue(""); - } - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - } - /** - * xls表格导入 - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input,String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - String result = ""; - if(workbook.getNumberOfSheets()>1){ - HSSFSheet sheet = workbook.getSheetAt(0); - String visitUnits = ""; - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头 - HSSFRow row = sheet.getRow(rowNum); - HSSFCell cell = row.getCell(1); - visitUnits = getStringVal(cell); - } - }else{ - result = "文件内容异常:缺少sheet。"; - } - - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - - /** - * xlsx文件导入 - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsx(InputStream input,String userId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow rowTitle = sheet.getRow(1); - //如果表头小于18列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 18) { - continue; - } - //设备大类 - String equipmentBigClassId=""; - //设备小类 - String equipmentSmallClassId = ""; - //安装位置 - String pScetionId = ""; - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头部门,读取数据从rowNum+4行开始,没有设备编号的不导入 - XSSFRow row = sheet.getRow(rowNum); - if (null == row || null == row.getCell(3)) { - continue; - } - int minCellNum = row.getFirstCellNum()+1;//读取数据从第二列开始,第一列为序号 - int maxCellNum = row.getLastCellNum();//最后一列 - String goodsname = ""; - String goodsmodel = ""; - String goodsSpecifications = ""; - String goodsunit = ""; - String design = ""; - String channelsid = ""; - String purpose = ""; - String memo = ""; - String install = ""; - String totalMoney = ""; - String price = ""; - String number = ""; - String manufacturer = ""; - String brand = ""; - - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return ""; - } - }else{ - return ""; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - try { - return cell.getStringCellValue(); - } catch (IllegalStateException e) { - return String.valueOf(cell.getNumericCellValue()); - } - //return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return ""; - } - }else{ - return ""; - } - } -} diff --git a/src/com/sipai/service/visit/VisitPositionService.java b/src/com/sipai/service/visit/VisitPositionService.java deleted file mode 100644 index 2576348c..00000000 --- a/src/com/sipai/service/visit/VisitPositionService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.visit; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visit.VisitPositionDao; -import com.sipai.entity.visit.VisitPosition; -import com.sipai.tools.CommService; -@Service -public class VisitPositionService implements CommService{ - @Resource - private VisitPositionDao visitPositionDao; - - @Override - public VisitPosition selectById(String id) { - VisitPosition visitPosition = this.visitPositionDao.selectByPrimaryKey(id); - return visitPosition; - } - - @Override - public int deleteById(String id) { - int res = this.visitPositionDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(VisitPosition visitPosition) { - int res = this.visitPositionDao.insert(visitPosition); - return res; - } - - @Override - public int update(VisitPosition visitPosition) { - int res = this.visitPositionDao.updateByPrimaryKeySelective(visitPosition); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - VisitPosition visitPosition = new VisitPosition(); - visitPosition.setWhere(wherestr); - List visitPositions = this.visitPositionDao.selectListByWhere(visitPosition); - - return visitPositions; - } - - @Override - public int deleteByWhere(String wherestr) { - VisitPosition visitPosition = new VisitPosition(); - visitPosition.setWhere(wherestr); - return this.visitPositionDao.deleteByWhere(visitPosition); - } - -} diff --git a/src/com/sipai/service/visit/VisitRegisterService.java b/src/com/sipai/service/visit/VisitRegisterService.java deleted file mode 100644 index 45e24c74..00000000 --- a/src/com/sipai/service/visit/VisitRegisterService.java +++ /dev/null @@ -1,259 +0,0 @@ -package com.sipai.service.visit; - -import com.sipai.dao.visit.VisitRegisterDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.user.User; -import com.sipai.entity.visit.VisitApply; -import com.sipai.entity.visit.VisitCommString; -import com.sipai.entity.visit.VisitRegister; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.business.BusinessUnitService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.SpringContextUtil; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -@Service -public class VisitRegisterService implements CommService{ - @Resource - private VisitRegisterDao visitRegisterDao; - @Resource - private VisitApplyService visitApplyService; - @Resource - private UserService userService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private BusinessUnitService businessUnitService; - - String[][] VISITS = VisitCommString.STATUS_VISIT; - - @Override - public VisitRegister selectById(String id) { - VisitRegister visitRegister = this.visitRegisterDao.selectByPrimaryKey(id); - if(visitRegister != null){ - if (visitRegister.getAuditManId() != null && !visitRegister.getAuditManId().isEmpty()) { - String auditMan = this.getUserNamesByUserIds(visitRegister.getAuditManId()); - visitRegister.setAuditMan(auditMan); - } - if (visitRegister.getCommentator() != null && !visitRegister.getCommentator().isEmpty()) { - String commentator = this.getUserNamesByUserIds(visitRegister.getCommentator()); - visitRegister.setCommentatorName(commentator); - } - if (visitRegister.getReceptionist() != null && !visitRegister.getReceptionist().isEmpty()) { - String receptionist = this.getUserNamesByUserIds(visitRegister.getReceptionist()); - visitRegister.setReceptionistName(receptionist); - } - if (visitRegister.getState() != null) { - String stateName = visitRegister.getState(); - for(String[] VISIT:VISITS){ - if(VISIT[0].equals(visitRegister.getState())){ - stateName = VISIT[1]; - break; - } - } - visitRegister.setStateName(stateName); - } - } - return visitRegister; - } - - @Override - public int deleteById(String id) { - int res = this.visitRegisterDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(VisitRegister visitRegister) { - int res = this.visitRegisterDao.insert(visitRegister); - return res; - } - - @Override - public int update(VisitRegister visitRegister) { - int res = this.visitRegisterDao.updateByPrimaryKeySelective(visitRegister); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - VisitRegister visitRegister = new VisitRegister(); - visitRegister.setWhere(wherestr); - List visitRegisters = this.visitRegisterDao.selectListByWhere(visitRegister); - if(visitRegisters != null && visitRegisters.size()>0){ - for(VisitRegister item :visitRegisters){ - if (item.getAuditManId() != null && !item.getAuditManId().isEmpty()) { - String auditMan = this.getUserNamesByUserIds(item.getAuditManId()); - item.setAuditMan(auditMan); - } - if (item.getCommentator() != null && !item.getCommentator().isEmpty()) { - String commentator = this.getUserNamesByUserIds(item.getCommentator()); - item.setCommentatorName(commentator); - } - if (item.getReceptionist() != null && !item.getReceptionist().isEmpty()) { - String receptionist = this.getUserNamesByUserIds(item.getReceptionist()); - item.setReceptionistName(receptionist); - } - if (item.getState() != null) { - String stateName = item.getState(); - for(String[] VISIT:VISITS){ - if(VISIT[0].equals(item.getState())){ - stateName = VISIT[1]; - break; - } - } - item.setStateName(stateName); - } - } - } - return visitRegisters; - } - - @Override - public int deleteByWhere(String wherestr) { - VisitRegister visitRegister = new VisitRegister(); - visitRegister.setWhere(wherestr); - return this.visitRegisterDao.deleteByWhere(visitRegister); - } - - /** - * 把多个人员的id转换为名称 - * @param userIds - * @return - */ - public String getUserNamesByUserIds(String userIds){ - userIds = userIds.replace("," , "','"); - String userNames = ""; - Listusers = this.userService.selectListByWhere("where id in ('"+userIds+"')"); - for (User item : users) { - if (userNames!= "") { - userNames+=","; - } - userNames+=item.getCaption(); - } - return userNames; - } - /** - * 流程启动 - * @param - * @return - */ - @Transactional - public int doStartProcess(VisitRegister visitRegister) { - try { - Map variables = new HashMap(); - if(!visitRegister.getAuditManId().isEmpty()){ - variables.put("userIds", visitRegister.getAuditManId()); - }else{ - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - List processDefinitions=workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Visit_Register.getId()+"-"+visitRegister.getUnitId()); - if (processDefinitions==null || processDefinitions.size()==0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance =workflowService.startWorkflow(visitRegister.getId(), visitRegister.getInsuser(), processDefinitions.get(0).getKey(),variables); - if(processInstance!=null){ - visitRegister.setProcessid(processInstance.getId()); - visitRegister.setProcessdefid(processDefinitions.get(0).getId()); - }else{ - throw new RuntimeException(); - } - int res = 0; - VisitRegister visitRegisters = this.selectById(visitRegister.getId()); - if (visitRegisters != null) {//编辑页面发起,用更新方法 - res = visitRegisterDao.updateByPrimaryKeySelective(visitRegister); - }else {//新增页面直接发起,用保存方法 - res = visitRegisterDao.insert(visitRegister); - } - if (res==1) { - //发送消息 - User user = userService.getUserById(visitRegister.getInsuser()); - String recordUser = visitRegister.getAuditMan(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(visitRegister.getInsdt(),visitRegister.getInsuser(), - visitRegister.getId(),visitRegister.getProcessid(),visitRegister.getUnitId(), - null,"提交了参观登记表至" + recordUser + "进行审批。",user,"流程发起"); - businessUnitRecord.sendMessage(visitRegister.getAuditManId(),""); - - //更新参观申请状态 - VisitApply visitApply = this.visitApplyService.selectById(visitRegister.getApplyId()); - if(visitApply!=null){ - //已参观登记 - visitApply.setState(VisitCommString.STATUS_VISIT_FINISH); - this.visitApplyService.update(visitApply); - } - } - return res; - - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - /** - * 根据当前任务节点更新运维详情状态 - * */ - public int updateStatus(String id) { - VisitRegister visitRegister = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(visitRegister.getProcessid()).list(); - int res = 0; - if (task!=null && task.size()>0) { - visitRegister.setState(task.get(0).getName()); - res =this.update(visitRegister); - }else{ - visitRegister.setState(VisitCommString.STATUS_VISIT_EXECUTE); - res =this.update(visitRegister); - //审核结束向讲解员发送消息 - if(visitRegister.getCommentator()!=null - && !"".equals(visitRegister.getCommentator())){ - //发送信息 - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - String content = "有讲解任务下达,任务时间:"+visitRegister.getVisitTime().substring(0,10)+";"; - msgService.insertMsgSend("ALARM", content, visitRegister.getCommentator(), "emp01", "U"); - }; - } - return res; - } - /** - * 流程审核 - * @param entity - * @return - */ - @Transactional - public int doAuditProcess(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter=this.selectById(entity.getBusinessid()); - int res =businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } -} diff --git a/src/com/sipai/service/visit/VisitSafetyCommitmentRecordService.java b/src/com/sipai/service/visit/VisitSafetyCommitmentRecordService.java deleted file mode 100644 index 9b71c7aa..00000000 --- a/src/com/sipai/service/visit/VisitSafetyCommitmentRecordService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.visit; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visit.VisitSafetyCommitmentRecordDao; -import com.sipai.entity.visit.VisitSafetyCommitmentRecord; -import com.sipai.tools.CommService; -@Service -public class VisitSafetyCommitmentRecordService implements CommService{ - @Resource - private VisitSafetyCommitmentRecordDao visitSafetyCommitmentRecordDao; - - @Override - public VisitSafetyCommitmentRecord selectById(String id) { - VisitSafetyCommitmentRecord visitSafetyCommitmentRecord = this.visitSafetyCommitmentRecordDao.selectByPrimaryKey(id); - return visitSafetyCommitmentRecord; - } - - @Override - public int deleteById(String id) { - int res = this.visitSafetyCommitmentRecordDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(VisitSafetyCommitmentRecord visitSafetyCommitmentRecord) { - int res = this.visitSafetyCommitmentRecordDao.insert(visitSafetyCommitmentRecord); - return res; - } - - @Override - public int update(VisitSafetyCommitmentRecord visitSafetyCommitmentRecord) { - int res = this.visitSafetyCommitmentRecordDao.updateByPrimaryKeySelective(visitSafetyCommitmentRecord); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - VisitSafetyCommitmentRecord visitSafetyCommitmentRecord = new VisitSafetyCommitmentRecord(); - visitSafetyCommitmentRecord.setWhere(wherestr); - List visitSafetyCommitmentRecords = this.visitSafetyCommitmentRecordDao.selectListByWhere(visitSafetyCommitmentRecord); - - return visitSafetyCommitmentRecords; - } - - @Override - public int deleteByWhere(String wherestr) { - VisitSafetyCommitmentRecord visitSafetyCommitmentRecord = new VisitSafetyCommitmentRecord(); - visitSafetyCommitmentRecord.setWhere(wherestr); - return this.visitSafetyCommitmentRecordDao.deleteByWhere(visitSafetyCommitmentRecord); - } - -} diff --git a/src/com/sipai/service/visit/VisitSafetyCommitmentService.java b/src/com/sipai/service/visit/VisitSafetyCommitmentService.java deleted file mode 100644 index 0ea1bc15..00000000 --- a/src/com/sipai/service/visit/VisitSafetyCommitmentService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.visit; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visit.VisitSafetyCommitmentDao; -import com.sipai.entity.visit.VisitSafetyCommitment; -import com.sipai.tools.CommService; -@Service -public class VisitSafetyCommitmentService implements CommService{ - @Resource - private VisitSafetyCommitmentDao visitSafetyCommitmentDao; - - @Override - public VisitSafetyCommitment selectById(String id) { - VisitSafetyCommitment visitSafetyCommitment = this.visitSafetyCommitmentDao.selectByPrimaryKey(id); - return visitSafetyCommitment; - } - - @Override - public int deleteById(String id) { - int res = this.visitSafetyCommitmentDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(VisitSafetyCommitment visitSafetyCommitment) { - int res = this.visitSafetyCommitmentDao.insert(visitSafetyCommitment); - return res; - } - - @Override - public int update(VisitSafetyCommitment visitSafetyCommitment) { - int res = this.visitSafetyCommitmentDao.updateByPrimaryKeySelective(visitSafetyCommitment); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - VisitSafetyCommitment visitSafetyCommitment = new VisitSafetyCommitment(); - visitSafetyCommitment.setWhere(wherestr); - List visitSafetyCommitments = this.visitSafetyCommitmentDao.selectListByWhere(visitSafetyCommitment); - - return visitSafetyCommitments; - } - - @Override - public int deleteByWhere(String wherestr) { - VisitSafetyCommitment visitSafetyCommitment = new VisitSafetyCommitment(); - visitSafetyCommitment.setWhere(wherestr); - return this.visitSafetyCommitmentDao.deleteByWhere(visitSafetyCommitment); - } - -} diff --git a/src/com/sipai/service/visit/VisitVisitorsService.java b/src/com/sipai/service/visit/VisitVisitorsService.java deleted file mode 100644 index 20dfd851..00000000 --- a/src/com/sipai/service/visit/VisitVisitorsService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.visit; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visit.VisitVisitorsDao; -import com.sipai.entity.visit.VisitVisitors; -import com.sipai.tools.CommService; -@Service -public class VisitVisitorsService implements CommService{ - @Resource - private VisitVisitorsDao visitVisitorsDao; - - @Override - public VisitVisitors selectById(String id) { - VisitVisitors visitVisitors = this.visitVisitorsDao.selectByPrimaryKey(id); - return visitVisitors; - } - - @Override - public int deleteById(String id) { - int res = this.visitVisitorsDao.deleteByPrimaryKey(id); - return res; - } - - @Override - public int save(VisitVisitors visitVisitors) { - int res = this.visitVisitorsDao.insert(visitVisitors); - return res; - } - - @Override - public int update(VisitVisitors visitVisitors) { - int res = this.visitVisitorsDao.updateByPrimaryKeySelective(visitVisitors); - return res; - } - - @Override - public List selectListByWhere(String wherestr) { - VisitVisitors visitVisitors = new VisitVisitors(); - visitVisitors.setWhere(wherestr); - List visitVisitorss = this.visitVisitorsDao.selectListByWhere(visitVisitors); - - return visitVisitorss; - } - - @Override - public int deleteByWhere(String wherestr) { - VisitVisitors visitVisitors = new VisitVisitors(); - visitVisitors.setWhere(wherestr); - return this.visitVisitorsDao.deleteByWhere(visitVisitors); - } - -} diff --git a/src/com/sipai/service/visual/CacheDataService.java b/src/com/sipai/service/visual/CacheDataService.java deleted file mode 100644 index 668c7589..00000000 --- a/src/com/sipai/service/visual/CacheDataService.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.sipai.service.visual; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.CacheDataDao; -import com.sipai.entity.app.AppDataConfigure; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.Unit; -import com.sipai.entity.visual.CacheData; -import com.sipai.service.app.AppDataConfigureService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -@Service -public class CacheDataService implements CommService{ - - @Resource - private CacheDataDao cacheDataDao; - @Resource - private MPointService mPointService; - @Resource - private AppDataConfigureService appDataConfigureService; - - @Override - public CacheData selectById(String id) { - return this.cacheDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return cacheDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CacheData entity) { - return this.cacheDataDao.insert(entity); - } - - @Override - public int update(CacheData cacheData) { - return cacheDataDao.updateByPrimaryKeySelective(cacheData); - } - - @Override - public List selectListByWhere(String wherestr) { - CacheData cacheData= new CacheData(); - cacheData.setWhere(wherestr); - return this.cacheDataDao.selectListByWhere(cacheData); - } - - @Override - public int deleteByWhere(String wherestr) { - CacheData cacheData = new CacheData(); - cacheData.setWhere(wherestr); - return cacheDataDao.deleteByWhere(cacheData); - } - - public String getAPPYesterdayMainDataTreeList(List> list_result,List list,String type) { - if(list_result == null ) { - list_result = new ArrayList>(); - for(Unit k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - List aList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+k.getId()+"' and ac.type='"+type+"' and ac.datatype='"+AppDataConfigure.type_newData+"' order by ac.morder "); - JSONArray jsondata=new JSONArray(); - if(aList!=null&&aList.size()>0){ - for(int m=0;m0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(Unit k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - List aList=this.appDataConfigureService.selectListByCacheData(" where ac.unitId='"+k.getId()+"' and ac.type='"+type+"' and ac.datatype='"+AppDataConfigure.type_newData+"' order by ac.morder "); - JSONArray jsondata=new JSONArray(); - if(aList!=null&&aList.size()>0){ - for(int n=0;n0) { - mp.put("nodes", childlist); - getAPPYesterdayMainDataTreeList(childlist,list,type); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/DataTypeService.java b/src/com/sipai/service/visual/DataTypeService.java deleted file mode 100644 index f9900a37..00000000 --- a/src/com/sipai/service/visual/DataTypeService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.visual; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.DataTypeDao; -import com.sipai.entity.visual.DataType; -import com.sipai.tools.CommService; - -@Service -public class DataTypeService implements CommService { - - @Resource - private DataTypeDao dataTypeDao; - - @Override - public DataType selectById(String id) { - return this.dataTypeDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.dataTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(DataType entity) { - return this.dataTypeDao.insert(entity); - } - - @Override - public int update(DataType dataType) { - return this.dataTypeDao.updateByPrimaryKeySelective(dataType); - } - - @Override - public List selectListByWhere(String wherestr) { - DataType dataType = new DataType(); - dataType.setWhere(wherestr); - return this.dataTypeDao.selectListByWhere(dataType); - } - - @Override - public int deleteByWhere(String wherestr) { - DataType dataType = new DataType(); - dataType.setWhere(wherestr); - return this.dataTypeDao.deleteByWhere(dataType); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/GetValueService.java b/src/com/sipai/service/visual/GetValueService.java deleted file mode 100644 index a35392cc..00000000 --- a/src/com/sipai/service/visual/GetValueService.java +++ /dev/null @@ -1,2559 +0,0 @@ -package com.sipai.service.visual; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.serotonin.modbus4j.sero.util.queue.ByteQueue; -import com.sipai.controller.work.ReadAWriteUtil; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.visual.*; -import com.sipai.entity.work.ModbusFig; -import com.sipai.entity.work.Weather; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.WeatherService; -import com.sipai.service.work.ModbusFigService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.HttpUtil; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -@Service -public class GetValueService { - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private ModbusFigService modbusFigService; - @Resource - private VisualJspService visualJspService; - @Resource - private PlanLayoutService planLayoutService; - @Resource - private JspElementService jspElementService; - @Resource - private PlanService planService; - @Resource - private WeatherService weatherService; - @Resource - private VisualCacheDataService visualCacheDataService; - @Resource - private VisualCacheConfigService visualCacheConfigService; - @Resource - private RedissonClient redissonClient; - - /** - * 通过jsp配置获取测量点值 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getValueByJspElement(JspElement jspElement, String bizId) { - // 获取单条配置测量点值 - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); -// try{ -// List mPointHistory = this.mPointHistoryService -// .selectTopNumListByTableAWhere(bizId, -// "[TB_MP_" + mPoint.getMpointcode() + "]", -// JspElement.MPointHistory_ValueNum, " order by insdt desc"); -// if (mPointHistory != null && mPointHistory.size() != 0) { -// mPoint.setParmvalue(mPointHistory.get(0).getParmvalue()); -// } -// }catch(Exception e){ -// System.out.println(e); -// } - if (mPoint != null) { - String numtail = mPoint.getNumtail(); - if (numtail.contains(".")) { - numtail = "#" + numtail.substring(1, numtail.length()); - java.text.DecimalFormat df = new java.text.DecimalFormat(numtail); - mPoint.setParmvalue(new BigDecimal(df.format(mPoint.getParmvalue().doubleValue()))); - jspElement.setmPoint(mPoint); - } else { - double v = CommUtil.round(mPoint.getParmvalue().doubleValue(), Double.valueOf(numtail).intValue()); - mPoint.setParmvalue(new BigDecimal(v)); - jspElement.setmPoint(mPoint); - } - } - return jspElement; - } - - /** - * 通过jsp配置获取测量点值 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getHisSumValue(JspElement jspElement, String bizId, String sdt, String edt) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, - "[TB_MP_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' ", " sum(ParmValue) as ParmValue "); - jspElement.setmPoint(mPoint); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 通过jsp配置获取测量点值 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getHisAvgValue(JspElement jspElement, String bizId, String sdt, String edt) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, - "[TB_MP_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' ", " avg(ParmValue) as ParmValue "); - jspElement.setmPoint(mPoint); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getHourHistoryByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectTop1RecordPerHour(bizId, - "[TB_MP_" + mPoint.getMpointcode() + "]", "", - JspElement.MPointHistory_ValueNum); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getNowHourFirstByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(hour,'" + CommUtil.nowDate() + "',MeasureDT)=0 order by MeasureDT desc", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getLastHourFirstByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(hour,'" + CommUtil.subplus(CommUtil.nowDate(), "-1", "hour") + "',MeasureDT)=0 order by MeasureDT desc", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getTodayFirstValueByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(day,'" + CommUtil.nowDate() + "',MeasureDT)=0 order by MeasureDT", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYesterdayFirstValueByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(day,'" + CommUtil.subplus(CommUtil.nowDate(), "-1", "day") + "',MeasureDT)=0 order by MeasureDT", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取今年累计数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYearSumValueByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(year,'" + CommUtil.nowDate() + "',MeasureDT)=0 ", " sum(ParmValue) as ParmValue "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取昨日当前小时数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYesterdayNowHourFirstValue(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - String sdt = CommUtil.subplus(CommUtil.nowDate(), "-1", "day").substring(0, 10) + CommUtil.subplus(CommUtil.nowDate(), "-1", "hour").substring(10, 19); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(hour,'" + sdt + "',MeasureDT)=0 ", " top 1 * "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取昨日当前小时为止累计数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYesterdayHisHourSumValue(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - String sdt = CommUtil.subplus(CommUtil.nowDate(), "-1", "day").substring(0, 10) + " 00:00"; - String edt = (CommUtil.subplus(CommUtil.nowDate(), "-1", "day").substring(0, 10) + CommUtil.subplus(CommUtil.nowDate(), "-1", "hour").substring(10, 19)).substring(0, 13) + ":59"; - - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' ", " sum(ParmValue) as ParmValue "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getTodaySumValueByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(day,'" + CommUtil.nowDate() + "',MeasureDT)=0 ", " sum(ParmValue) as ParmValue "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYesterdaySumValueByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(day,'" + CommUtil.subplus(CommUtil.nowDate(), "-1", "day") + "',MeasureDT)=0 ", " sum(ParmValue) as ParmValue "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYesterdayLastValueByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, "[TB_MP_" + mPoint.getMpointcode() + "]", " where datediff(day,'" + CommUtil.subplus(CommUtil.nowDate(), "-1", "day") + "',MeasureDT)=0 order by MeasureDT desc", " top 1 ParmValue "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getTodayHistoryByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - String nowtime = CommUtil.nowDate(); - String sdt = nowtime.substring(0, 10) + " 00:00"; - String edt = nowtime.substring(0, 10) + " 23:59"; - List mPointHistory = this.mPointHistoryService - .selectListByTableAWhere(bizId, - "[TB_MP_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' order by MeasureDT "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getYesterdayHistoryByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - String nowtime = CommUtil.subplus(CommUtil.nowDate(), "-1", "day"); - String sdt = nowtime.substring(0, 10) + " 00:00"; - String edt = nowtime.substring(0, 10) + " 23:59"; - List mPointHistory = this.mPointHistoryService - .selectListByTableAWhere(bizId, - "[TB_MP_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sdt + "' and '" + edt + "' order by MeasureDT "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - return jspElement; - } - - /** - * 获取历史数据 模块 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement get5YearHistoryByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - String nowtime = CommUtil.nowDate(); - String lastyear = CommUtil.subplus(nowtime, "0", "year").substring(0, 4) + "-12-31 23:59"; - String sixlastyear = CommUtil.subplus(nowtime, "-6", "year").substring(0, 4) + "-01-01 00:00"; - List mPointHistory = this.mPointHistoryService - .selectAggregateList(bizId, - "[TB_MP_" + mPoint.getMpointcode() + "]", " where MeasureDT between '" + sixlastyear + "' and '" + lastyear + "' group by left(CONVERT(varchar(100), MeasureDT, 120),4) ", " sum(ParmValue) as ParmValue,left(CONVERT(varchar(100), MeasureDT, 120),4) as MeasureDT "); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - } - return jspElement; - } - - public JspElement get7dayHistoryByJspElement(JspElement jspElement, String bizId) { - MPoint mPoint = this.mPointService.selectById(bizId, - jspElement.getValueUrl()); - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - String edt = nowtime.substring(0, 10) + " 23:59"; - String sdt = com.sipai.tools.CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - List mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() != 0) { - jspElement.setmPoint(mPoint); - jspElement.setmPointHistory(mPointHistory); - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - return jspElement; - } - - public List getAll7dayHistoryByJspElement(JspElement jspElement, String bizId) { - // 获取全部配置测量点值 - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by morder "); - List mPointHistory = null; - if (list != null && list.size() > 0) { - MPoint mPoint = this.mPointService.selectById(bizId, list.get(0).getMpcode()); - if (mPoint != null) { - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - String edt = com.sipai.tools.CommUtil.subplus(nowtime, "-1", "day").substring(0, 10) + " 23:59"; - String sdt = com.sipai.tools.CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - } - } - return mPointHistory; - } - - /** - * 获取历史数据 交互 - * - * @param bizId - * @return - */ - public PlanInteraction getHistoryByPlanInteraction(PlanInteraction planInteraction, String bizId) { - List mPoints = this.mPointService.selectListByWhere(bizId, " where id in ('" + planInteraction.getParameter().replace(",", "','") + "')"); - for (int i = 0; i < mPoints.size(); i++) { - List mPointHistory = this.mPointHistoryService - .selectTop1RecordPerHour(bizId, - "[TB_MP_" + mPoints.get(i).getMpointcode() + "]", "", - JspElement.MPointHistory_ValueNum); - if (mPointHistory != null && mPointHistory.size() != 0) { - mPoints.get(i).setmPointHistory(mPointHistory); - } - } - planInteraction.setmPoint(mPoints); - return planInteraction; - } - - - /** - * 获取HTTP请求数据 目前只获取一个String值 可以是JSON - * - * @param jspElement - * @return - */ - public JspElement getHttpValueByJspElement(JspElement jspElement) { - if (jspElement.getValueUrl() != null - && !jspElement.getValueUrl().equals("")) { - // 添加判断获取值方法 - // if(pageConfigures.get(i).getValuetype().equals("getValue")){ - String value = ""; - try { - value = HttpUtil.sendPost(jspElement.getValueUrl()); - } catch (Exception e) { - value = ""; - } - jspElement.setValue(value); - } else { - jspElement.setValue(""); - } - return jspElement; - } - - /** - * 通过planLayout获取jspElement 中测量点值 - * - * @param planLayoutId 方案布局id - * @param bizId 厂区id - * @param type 节点类型 - * @return - */ - public List getValueByplanLayoutId(String planLayoutId, String bizId, String type) { - PlanLayout planLayout = this.planLayoutService.selectById(planLayoutId); - List visualJsp = this.visualJspService.selectListByWhere(" where jsp_code = '" + planLayout.getJspCode() + "'"); - List jspElements = this.jspElementService - .selectListByWhere(" where pid = '" + visualJsp.get(0).getId() + "' and data_type = '" + planLayout.getDataType() + "' and style='process' order by morder"); - List list = this.planService.selectListByWhere("where type='" + type + "' order by morder"); - // 获取单条配置测量点值 - for (int i = 0; i < jspElements.size(); i++) { - //获取值 - MPoint mPoint = this.mPointService.selectById(bizId, - jspElements.get(i).getValueUrl()); - if (mPoint != null) { - jspElements.get(i).setmPoint(mPoint); - if (jspElements.get(i).getElementCode().indexOf(JspElement.Batch_Code) != -1) { - //若是批次编码 判断文件夹 - String value = String.valueOf(this.planService.getProcessNum("-1", list, mPoint.getParmvalue())); - jspElements.get(i).setValue(value); - } - } - } - return jspElements; - } - - - /** - * 获取MODBUS值 用MPoint返回 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getModbusValueByJspElement(JspElement jspElement, String bizId) { - List mPoint = this.mPointService.selectListByWhere(bizId, - " where id = '" + jspElement.getValueUrl() + "'"); - if (mPoint != null && mPoint.size() != 0) { - getValueWithModbus(mPoint);// 获取modbus值 - jspElement.setmPoint(mPoint.get(0)); - } - return jspElement; - } - - // modbus获取值方法 - public void getValueWithModbus(List mData) { - List modbuslist = getmodbuslist(mData); - int i = 0; - if (modbuslist != null && modbuslist.size() > 0) { - for (ModbusFig modbusFig : modbuslist) { - String idStr = modbusFig.getId(); - String ipsever = modbusFig.getIpsever(); - String port = modbusFig.getPort(); - String slaveid = modbusFig.getSlaveid(); - String order32 = modbusFig.getOrder32(); - int min = modbusFig.getMin(); - int max = modbusFig.getMax(); - ByteQueue rece = new ByteQueue(); - rece = ReadAWriteUtil.modbusTCP(ipsever, - Integer.parseInt(port), min, max - min + 2); - if (rece != null) { - rece.pop(3); - String recestr = rece.toString(); - // System.out.println(recestr.substring(1, - // recestr.length()-1)); - String[] s = recestr.substring(1, recestr.length() - 1) - .split(","); - for (i = 0; i < s.length; i++) { - if (s[i].length() < 2) { - s[i] = "0" + s[i]; - } - } - // mData_temp存储Modbus返回数据 modbusfigid 、register、value - for (MPoint mPoint : mData) { - if (mPoint.getModbusfigid() != null - && mPoint.getModbusfigid().equals(idStr)) { - int reg = Integer.parseInt(mPoint.getRegister()) - - (min); - float val = 0; - try { - if (order32.equals("4321")) { - val = Float.intBitsToFloat(Integer - .parseInt(s[2 * reg] - + s[2 * reg + 1] - + s[2 * reg + 2] - + s[2 * reg + 3], 16)); - // System.out.println("4321:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else if (order32.equals("3412")) { - val = Float.intBitsToFloat(Integer - .parseInt(s[2 * reg + 1] - + s[2 * reg] - + s[2 * reg + 3] - + s[2 * reg + 2], 16)); - // System.out.println("3412:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else if (order32.equals("1234")) { - val = Float.intBitsToFloat(Integer - .parseInt(s[2 * reg + 3] - + s[2 * reg + 2] - + s[2 * reg + 1] - + s[2 * reg], 16)); - // System.out.println("1234:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else if (order32.equals("2143")) { - val = Float.intBitsToFloat(Integer - .parseInt(s[2 * reg + 2] - + s[2 * reg + 3] - + s[2 * reg] - + s[2 * reg + 1], 16)); - // System.out.println("2143:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } else { - val = Float.intBitsToFloat(Integer - .parseInt(s[2 * reg] - + s[2 * reg + 1] - + s[2 * reg + 2] - + s[2 * reg + 3], 16)); - // System.out.println("4321:"+s[2*reg]+s[2*reg+1]+s[2*reg+2]+s[2*reg+3]); - } - } catch (Throwable e) { - System.out.println("error:数据转换时出错!" + e); - } finally { - - } - // DecimalFormat fnum = new DecimalFormat("##0.00"); - // System.out.println(fnum.format(val)); - mPoint.setParmvalue(new BigDecimal(val)); - mPoint.setMeasuredt(CommUtil.formatDate( - "yyyy-MM-dd HH:mm:ss", new Date())); - // map.put("value", fnum.format(val)+"(Modbus)"); - } - } - } - } - } - } - - /* - * - * //获取modbus发送sever列表 - */ - private List getmodbuslist(List mData) { - List mData_Sever = new ArrayList(); - // //获取测量点所有sever - for (int i = 0; i < mData.size(); i++) { - ModbusFig map = this.modbusFigService.selectById(mData.get(i) - .getModbusfigid()); - if (!mData_Sever.contains(map)) { - mData_Sever.add(map); - } - } - for (ModbusFig modbusFig : mData_Sever) { - if (modbusFig.getIpsever() == null) { - continue; - } - int min = 0; - int max = 0; - int j; - // 最大值和最小值初始化,初始化的值必须对应到服务器 - for (j = 0; j < mData.size(); j++) { - if (mData.get(j).getModbusfigid() != null - && mData.get(j).getModbusfigid() - .equals(modbusFig.getId())) { - min = Integer.parseInt(mData.get(j).getRegister()); - max = min; - break; - } - } - for (MPoint mPoint : mData) { - if (mPoint.getModbusfigid() != null - && mPoint.getModbusfigid().equals(modbusFig.getId())) { - int register = Integer.parseInt(mPoint.getRegister()); - if (min > register) { - min = register; - } - if (max < register) { - max = register; - } - } - } - modbusFig.setMax(max); - modbusFig.setMin(min); - - } - return mData_Sever; - } - - /** - * 通过jsp配置获取天气情况 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getWeatherByJspElement(JspElement jspElement, String bizId) { - // 获取单条配置测量点值 - List list = this.weatherService.getownsql(bizId, "select top 1 * from tb_weather order by datetime desc "); - Weather weather = new Weather(); - if (list != null && list.size() > 0) { - weather = list.get(0); - } - - if (weather != null) { - jspElement.setWeather(weather); - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElement(JspElement jspElement, String bizId) { - // 获取单条配置测量点值 - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by morder "); - VisualCacheData vCacheData = new VisualCacheData(); - MPoint mPoint = new MPoint(); - if (list != null && list.size() > 0) { - String mpid = list.get(0).getMpcode(); - mPoint = this.mPointService.selectById(bizId, mpid); - if (list.get(0).getActive().equals(CacheData.Active_false)) { - list.get(0).setValue(list.get(0).getInivalue()); - if (list.get(0).getInivalue() == null) { - list.get(0).setEmptyvalue("-"); - } - } else { - if (mPoint != null) { - String numtail = mPoint.getNumtail(); - if (list.get(0).getValue() != null && numtail != null) { - double v = CommUtil.round(list.get(0).getValue(), Double.valueOf(numtail).intValue()); - list.get(0).setValue(v); - } else { - list.get(0).setEmptyvalue("-"); - } - } - } - if (list.get(0).getValue() == null) { - list.get(0).setEmptyvalue("-"); - } - vCacheData = list.get(0); - } - - if (vCacheData != null) { - jspElement.setVisualCacheData(vCacheData); - } - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - return jspElement; - } - - public List getAllCacheDataByJspElement(JspElement jspElement, String bizId) { - // 获取全部配置测量点值 - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by morder "); - //List jspElements = new ArrayList<>(); - if (list != null && list.size() > 0) { - for (VisualCacheData visualCacheData : list) { - if (visualCacheData.getActive().equals(CacheData.Active_false)) { - visualCacheData.setValue(visualCacheData.getInivalue()); - } - -// if (visualCacheData != null) { -// JspElement jspElement2 = new JspElement(); -// jspElement2.setVisualCacheData(visualCacheData); -// jspElements.add(jspElement2); -// } - } - - - } - - - return list; - } - - /** - * 通过jsp配置获取中间缓存数据-重庆白洋滩 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElementCQ(JspElement jspElement, String bizId, String time) { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - // 获取单条配置测量点值 - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by insdt desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - } - - if (vCacheData != null) { - jspElement.setVisualCacheData(vCacheData); - } - - List configlist = this.visualCacheConfigService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' "); - if (configlist != null && configlist.size() > 0) { - jspElement.setVisualCacheConfig(configlist.get(0)); - } - String edt = time.substring(0, 10) + " 23:59:59"; - //1小时 - String sdt = CommUtil.subplus(edt, "-24", "hour"); - String rptdt = " and insdt between '" + sdt + "' and '" + edt + "' "; - List listAll = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' " + rptdt + " order by insdt "); - if (listAll != null && listAll.size() > 0) { - jspElement.setVisualCacheDataList(listAll); - } - if (mpointid != null && !mpointid.equals("")) { - MPoint mPoint = this.mPointService.selectById(bizId, mpointid); - List mPointHistory = null; - if (mPoint != null) { - /*edt=time.substring(0, 10)+" 23:59"; - sdt=time.substring(0, 10)+" 00:00";*/ - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - jspElement.setmPoint(mPoint); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } else { - wherestr = " order by measuredt desc "; - mPointHistory = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, " top 50 ", "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - Collections.reverse(mPointHistory); - jspElement.setmPointHistory(mPointHistory); - } - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElement(JspElement jspElement, String bizId, String time) { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - // 获取单条配置测量点值 - //String rptdt = " and year(rptdt) = '"+time.substring(0, 4)+"' and month(rptdt) = '"+time.substring(5, 7)+"' and day(rptdt) = '"+time.substring(8, 10)+"' "; - //List list = this.visualCacheDataService.selectListByWhere(" where dataName='"+jspElement.getValueUrl()+"' and unitId='"+bizId+"' "+rptdt+" order by morder "); - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by insdt desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - } - - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - if (vCacheData != null) { - if (jspElement != null && vCacheData.getValue() == null) { - if (jspElement.getElementCode().equals("cumulative_times_today")) { - //南市_调度指令_今日累计次数 - String select = " count(id) as value "; - String wherestr = "where method_id='a09a5c54c3784b7a981ed913acecc917' and model_name='水平衡模型' " - + "and insdt >='" + time.substring(0, 10) + " 00:00" + "' and insdt <='" + time + "' "; - List cumulative_times_today = this.visualCacheDataService.selectAggregateList("[SIPAIIS_Model].[dbo].[tb_model_cal_log]", wherestr, select); - if (cumulative_times_today != null && cumulative_times_today.size() > 0) { - vCacheData.setValue(cumulative_times_today.get(0).getValue()); - } - } - if (jspElement.getElementCode().equals("automatic_execution_times")) { - //调度指令_自动执行次数 - String select = " count(id) as value "; - String wherestr = "where method_id='a09a5c54c3784b7a981ed913acecc917' and model_name='水平衡模型' and execute_status='1' " - + "and insdt >='" + time.substring(0, 10) + " 00:00" + "' and insdt <='" + time + "' "; - List cumulative_times_today = this.visualCacheDataService.selectAggregateList("[SIPAIIS_Model].[dbo].[tb_model_cal_log]", wherestr, select); - if (cumulative_times_today != null && cumulative_times_today.size() > 0) { - vCacheData.setValue(cumulative_times_today.get(0).getValue()); - } - } - } - jspElement.setVisualCacheData(vCacheData); - } - - List configlist = this.visualCacheConfigService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' "); - if (configlist != null && configlist.size() > 0) { - jspElement.setVisualCacheConfig(configlist.get(0)); - } - String edt = time.substring(0, 10) + " 23:59:59"; - //30天 - String sdt = CommUtil.subplus(edt, "-720", "hour"); - String rptdt = " and insdt between '" + sdt + "' and '" + edt + "' "; - List listAll = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' " + rptdt + " order by insdt "); - if (listAll != null && listAll.size() > 0) { - jspElement.setVisualCacheDataList(listAll); - } - - if (vCacheData != null) { - if (getValueType != null) { - List mPointHistory = null; - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(bizId, mpointid); - } - if (getValueType.equals(JspElement.Type_GetHistoryYearMAX)) { - if (mPoint != null) { - //特定类型,取最大值,时间范围为当年,取一个值,修改mPoint的parmvalue - String whereStr = "where MeasureDT between '" + time.substring(0, 4) + "-01-01 00:00:00' and '" + time.substring(0, 4) + "-12-31 23:59:59' "; - mPointHistory = this.mPointHistoryService.selectMAX(bizId, "TB_MP_" + mPoint.getMpointcode(), whereStr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - mPoint.setParmvalue(parmvalue); - } - jspElement.setmPoint(mPoint); - } - } else { - if (getValueType.equals(JspElement.Type_Get7dayHistory)) { - if (mPoint != null) { - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - edt = nowtime.substring(0, 10) + " 23:59"; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - jspElement.setmPoint(mPoint); - } - } else { - if (getValueType.equals(JspElement.Type_Get10dayHistory)) { - if (mPoint != null) { - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - edt = nowtime.substring(0, 10) + " 23:59"; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-10", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - jspElement.setmPoint(mPoint); - } - } else { - if (getValueType.equals(JspElement.Type_Get2HourHistory)) { - if (mPoint != null) { - edt = time; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-2", "hour"); - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - jspElement.setmPoint(mPoint); - } - } else { - if (getValueType.equals(JspElement.Type_Get24HourHistory)) { - if (mPoint != null) { - edt = time; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-24", "hour"); - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - jspElement.setmPoint(mPoint); - } - } else { - if (mPoint != null) { - edt = time.substring(0, 10) + " 23:59"; - sdt = time.substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - jspElement.setmPoint(mPoint); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } else { - wherestr = " order by measuredt desc "; - mPointHistory = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, " top 50 ", "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - Collections.reverse(mPointHistory); - jspElement.setmPointHistory(mPointHistory); - } - } - } - } - } - } - } - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElement4ES(JspElement jspElement, String bizId, String time) { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - // 获取单条配置测量点值 - VisualCacheData vCacheData = this.visualCacheDataService.selectListByWhere4TopOne(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by insdt desc "); - String mpointid = null; - String getValueType = null; - if (vCacheData != null) { - mpointid = vCacheData.getMpcode(); - jspElement.setVisualCacheData(vCacheData); - } - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - /*List configlist = this.visualCacheConfigService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' "); - if (configlist != null && configlist.size() > 0) { - jspElement.setVisualCacheConfig(configlist.get(0)); - }*/ - if (vCacheData != null) { - if (getValueType != null) { - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(mpointid); - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElement2(JspElement jspElement, String bizId, String time, String dataType) { - try { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - String cacheDataWhere = " where 1=1 and dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "'"; - - List list = this.visualCacheDataService.selectListByWhere(cacheDataWhere + " order by morder desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - String dataTypeC = "-"; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - if (list.get(0).getDatatype() != null) { - dataTypeC = list.get(0).getDatatype(); - } - jspElement.setVisualCacheData(list.get(0)); - } - - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - - if (vCacheData != null) { - if (getValueType != null) { - if (getValueType.equals(JspElement.Type_GetRedisData)) { - if (mpointid != null && !mpointid.equals("")) { -// String[] codes = mpointid.split(","); -// if (codes != null && codes.length > 1) { -// RMap map_redis = redissonClient.getMap(codes[0]); -// String outValue = map_redis.get(codes[1]); -// jspElement.setValue(outValue); -//// System.out.println(key_value); -// } - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - } - } else if (getValueType.equals(JspElement.Type_GetTHMonthHistoryAndRedisData)) { - List mPointHistory = null; - if (mpointid != null && !mpointid.equals("")) { -// String[] codes = mpointid.split(","); -// if (codes != null && codes.length > 1) { -// RMap map_redis = redissonClient.getMap(codes[0]); -// String outValue = map_redis.get(codes[1]); -// jspElement.setValue(outValue); -//// System.out.println(key_value); -// } - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - String sdt = ""; - String edt = ""; - int dayNum = Integer.valueOf(time.substring(8, 10)); - if (dayNum < 21) { - sdt = CommUtil.subplus(time, "-1", "month").substring(0, 7) + "-21 08:00"; - edt = time.substring(0, 7) + "-21 08:00"; - } else { - sdt = time.substring(0, 7) + "-21 08:00"; - edt = CommUtil.subplus(time, "1", "month").substring(0, 7) + "-21 08:00"; - } - - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - } - - } else { - List mPointHistory = null; - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(bizId, mpointid); - } - if (getValueType.equals(JspElement.Type_GetTHDayHistory4Predicted)) { - if (mPoint != null) { - String sdt = time.substring(0, 10) + " 08:00"; - String edt = CommUtil.subplus(sdt, "1", "day").substring(0, 10) + " 08:00"; - int hourNum = Integer.valueOf(time.substring(11, 13)); - if (hourNum < 8) { - sdt = CommUtil.subplus(time, "-1", "day").substring(0, 10) + " 08:00"; - edt = time.substring(0, 10) + " 08:00"; - } else { - sdt = time.substring(0, 10) + " 08:00"; - edt = CommUtil.subplus(time, "1", "day").substring(0, 10) + " 08:00"; - } - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by insdt,measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere4insdt(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - JSONArray jsonarray = new JSONArray(); - JSONObject jsonobject = new JSONObject(); - String insdt = mPointHistory.get(0).getInsdt(); - for (int j = 0; j < mPointHistory.size(); j++) { - String insdtNew = mPointHistory.get(j).getInsdt(); - if (!insdt.equals(insdtNew)) { - jsonobject = new JSONObject(); - jsonobject.put("insdt", insdt); - jsonobject.put("data", jsondata); - jsonarray.add(jsonobject); - insdt = insdtNew; - jsondata = new JSONArray(); - } - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jsonobject = new JSONObject(); - jsonobject.put("insdt", insdt); - jsonobject.put("data", jsondata); - jsonarray.add(jsonobject); - jspElement.setJsonArray(jsonarray); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetTHMonthHistory4Predicted)) { - if (mPoint != null) { - String sdt = ""; - String edt = ""; - int dayNum = Integer.valueOf(time.substring(8, 10)); - if (dayNum < 21) { - sdt = CommUtil.subplus(time, "-1", "month").substring(0, 7) + "-21 08:00"; - edt = time.substring(0, 7) + "-21 08:00"; - } else { - sdt = time.substring(0, 7) + "-21 08:00"; - edt = CommUtil.subplus(time, "1", "month").substring(0, 7) + "-21 08:00"; - } - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by insdt,measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere4insdt(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - JSONArray jsonarray = new JSONArray(); - JSONObject jsonobject = new JSONObject(); - String insdt = mPointHistory.get(0).getInsdt(); - for (int j = 0; j < mPointHistory.size(); j++) { - String insdtNew = mPointHistory.get(j).getInsdt(); - if (!insdt.equals(insdtNew)) { - jsonobject = new JSONObject(); - jsonobject.put("insdt", insdt); - jsonobject.put("data", jsondata); - jsonarray.add(jsonobject); - insdt = insdtNew; - jsondata = new JSONArray(); - } - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jsonobject = new JSONObject(); - jsonobject.put("insdt", insdt); - jsonobject.put("data", jsondata); - jsonarray.add(jsonobject); - jspElement.setJsonArray(jsonarray); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetTHDayHistory)) { - if (mPoint != null) { - String numtail = "2"; - if (mPoint.getNumtail() != null) { - numtail = mPoint.getNumtail(); - } - String sdt = time.substring(0, 10) + " 08:00"; - String edt = CommUtil.subplus(sdt, "1", "day").substring(0, 10) + " 08:00"; - int hourNum = Integer.valueOf(time.substring(11, 13)); - if (hourNum < 8) { - sdt = CommUtil.subplus(time, "-27", "hour").substring(0, 10) + " 08:00"; - edt = time.substring(0, 10) + " 08:00"; - } else { - sdt = CommUtil.subplus(time.substring(0, 10) + " 08:00", "-27", "hour").substring(0, 10) + " 08:00"; - edt = CommUtil.subplus(time, "1", "day").substring(0, 10) + " 08:00"; - } - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - BigDecimal v = new BigDecimal(mPointHistory.get(j).getParmvalue().toString()); - dataValue[1] = String.valueOf(v.setScale(Integer.valueOf(numtail), BigDecimal.ROUND_HALF_UP).doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetTHDayHistory2)) { - if (mPoint != null) { - String sdt = time.substring(0, 10) + " 06:00"; - String edt = CommUtil.subplus(sdt, "1", "day").substring(0, 10) + " 08:00"; - int hourNum = Integer.valueOf(time.substring(11, 13)); - if (hourNum < 8) { - sdt = CommUtil.subplus(time, "-27", "hour").substring(0, 10) + " 06:00"; - edt = time.substring(0, 10) + " 08:00"; - } else { - sdt = CommUtil.subplus(time.substring(0, 10) + " 06:00", "-27", "hour").substring(0, 10) + " 06:00"; - edt = CommUtil.subplus(time, "1", "day").substring(0, 10) + " 08:00"; - } - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetMonthHistory)) { - if (mPoint != null) { - String wherestr = " where datediff(month,measuredt,'" + time + "')=0 order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt().substring(0, 10); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_Get30dayHistory)) { - String sdt = ""; - String edt = ""; - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - edt = nowtime.substring(0, 10) + " 23:59"; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-30", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt().substring(0, 10); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } else if (getValueType.equals(JspElement.Type_Get24HourHistory)) { - if (mPoint != null) { - String edt = time; - String sdt = com.sipai.tools.CommUtil.subplus(edt, "-24", "hour"); - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_Get12MonthHistory)) { - if (mPoint != null) { - String edt = com.sipai.tools.CommUtil.subplus(time, "1", "month").substring(0, 7) + "-01 00:00"; - String sdt = com.sipai.tools.CommUtil.subplus(edt, "-12", "month").substring(0, 7) + "-01 00:00"; - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetTHMonthHistory)) { - if (mPoint != null) { - String sdt = ""; - String edt = ""; - int dayNum = Integer.valueOf(time.substring(8, 10)); - if (dayNum < 21) { - sdt = CommUtil.subplus(time.substring(0, 7) + "-21 08:00", "-1", "month").substring(0, 7) + "-21 08:00"; - sdt = CommUtil.subplus(sdt, "-7", "day"); - edt = time.substring(0, 7) + "-21 08:00"; - } else { - sdt = CommUtil.subplus(time.substring(0, 7) + "-21 08:00", "-7", "day"); - edt = CommUtil.subplus(time, "1", "month").substring(0, 7) + "-21 08:00"; - } - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetTHMonthHistory2)) { - if (mPoint != null) { - String sdt = ""; - String edt = ""; - int dayNum = Integer.valueOf(time.substring(8, 10)); - if (dayNum < 21) { - sdt = CommUtil.subplus(time.substring(0, 7) + "-21 06:00", "-1", "month").substring(0, 7) + "-21 06:00"; - sdt = CommUtil.subplus(sdt, "-7", "day"); - edt = time.substring(0, 7) + "-21 08:00"; - } else { - sdt = CommUtil.subplus(time.substring(0, 7) + "-21 06:00", "-7", "day"); - edt = CommUtil.subplus(time, "1", "month").substring(0, 7) + "-21 08:00"; - } - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetMpMainValue)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetMpMainValue4Avg)) { - if (mpointid != null && !mpointid.equals("")) { - String[] mpointids = mpointid.split(","); - BigDecimal parmvalue = new BigDecimal("0"); - for (String mp : mpointids) { - mPoint = this.mPointService.selectById(mp); - if (mPoint != null) { - parmvalue = parmvalue.add(mPoint.getParmvalue()); - } - } - parmvalue = parmvalue.divide(new BigDecimal(String.valueOf(mpointids.length))); - if (mPoint != null) { - mPoint.setParmvalue(parmvalue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_GetYesterdayAvgValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 10) + " 00:00"; - String sdt = CommUtil.subplus(edt, "-1", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"; - mPointHistory = this.mPointHistoryService.selectAVG(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_GetYesterdayMaxValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 10) + " 00:00"; - String sdt = CommUtil.subplus(edt, "-1", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"; - mPointHistory = this.mPointHistoryService.selectMAX(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_GetYesterdayMinValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 10) + " 00:00"; - String sdt = CommUtil.subplus(edt, "-1", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"; - mPointHistory = this.mPointHistoryService.selectMIN(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_Get7dayAvgValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 10) + " 00:00"; - String sdt = CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"; - mPointHistory = this.mPointHistoryService.selectAVG(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_Get7dayMaxValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 10) + " 00:00"; - String sdt = CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"; - mPointHistory = this.mPointHistoryService.selectMAX(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_Get7dayMinValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 10) + " 00:00"; - String sdt = CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "'"; - mPointHistory = this.mPointHistoryService.selectMIN(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } else if (getValueType.equals(JspElement.Type_GetMpcode)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetMpcodeLimitingValue)) { - if (mPoint != null) { - String outValue = ""; - - BigDecimal maxparmValue = CommUtil.formatMPointValue(mPoint.getAlarmmax(), mPoint.getNumtail(), mPoint.getRate()); - BigDecimal minparmValue = CommUtil.formatMPointValue(mPoint.getAlarmmin(), mPoint.getNumtail(), mPoint.getRate()); - if (mPoint.getAlarmmax() != null && mPoint.getAlarmmin() != null) { - outValue = minparmValue + "~" + maxparmValue; - } else if (mPoint.getAlarmmax() == null && mPoint.getAlarmmin() != null) { - outValue = minparmValue + ""; - } else if (mPoint.getAlarmmax() != null && mPoint.getAlarmmin() == null) { - outValue = maxparmValue + ""; - } - - jspElement.setValue(outValue); -// jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetDayHistory)) { - if (mPoint != null) { - String edt = time.substring(0, 10) + " 23:59"; - String sdt = time.substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue.add(measuredt); - dataValue.add(mPointHistory.get(j).getParmvalue().doubleValue()); - - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - } - } else if (getValueType.equals(JspElement.Type_GetLastMonthFinalValue)) { - if (mPoint != null) { - String edt = CommUtil.nowDate().substring(0, 7) + "-01 00:00"; - String sdt = CommUtil.subplus(edt, "-1", "month").substring(0, 7) + "-01 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "' order by measuredt desc"; - mPointHistory = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, "1", "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - mPoint.setParmvalue(parmValue); - jspElement.setmPoint(mPoint); - } - } - } - } - } - } - } catch (Exception e) { - System.out.println(e); - } - - return jspElement; - } - - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElementBG(JspElement jspElement, String bizId, String sdt, String edt, String dataType) { - if (sdt == null || sdt.isEmpty()) { - sdt = CommUtil.subplus(CommUtil.nowDate(), "-15", "day"); - } - if (edt == null || edt.isEmpty()) { - edt = CommUtil.subplus(CommUtil.nowDate(), "15", "day"); - } - String cacheDataWhere = " where 1=1 and dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "'"; - - List list = this.visualCacheDataService.selectListByWhere(cacheDataWhere + " order by morder desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - String dataTypeC = "-"; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - if (list.get(0).getDatatype() != null) { - dataTypeC = list.get(0).getDatatype(); - } - jspElement.setVisualCacheData(list.get(0)); - } - - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - - if (vCacheData != null) { - if (getValueType != null) { - if (getValueType.equals(JspElement.Type_GetRedisData)) { - if (mpointid != null && !mpointid.equals("")) { - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - } - } else if (getValueType.equals(JspElement.Type_GetHisData)) { - List mPointHistory = null; - if (mpointid != null && !mpointid.equals("")) { - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { -// String[] dataValue = new String[2]; - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue.add(measuredt); - dataValue.add(mPointHistory.get(j).getParmvalue().doubleValue()); -// dataValue[0] = measuredt; -// dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - } - } else if (getValueType.equals(JspElement.Type_GetHourHistory)) { - List mPointHistory = null; - if (mpointid != null && !mpointid.equals("")) { - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { -// String[] dataValue = new String[2]; - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(j).getMeasuredt().substring(0, 13); - dataValue.add(measuredt); - dataValue.add(mPointHistory.get(j).getParmvalue().doubleValue()); -// dataValue[0] = measuredt; -// dataValue[1] = String.valueOf(mPointHistory.get(j).getParmvalue().doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - } - } else { - List mPointHistory = null; - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(bizId, mpointid); - } - if (getValueType.equals(JspElement.Type_GetMpMainValue)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElement_HFCG(JspElement jspElement, String bizId, String time, String dataType) { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - String cacheDataWhere = " where 1=1 and dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "'"; - - List list = this.visualCacheDataService.selectListByWhere(cacheDataWhere + " order by morder desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - String dataTypeC = "-"; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - if (list.get(0).getDatatype() != null) { - dataTypeC = list.get(0).getDatatype(); - } - jspElement.setVisualCacheData(list.get(0)); - } - - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - - if (vCacheData != null) { - if (getValueType != null) { - if (getValueType.equals(JspElement.Type_GetRedisData)) { - if (mpointid != null && !mpointid.equals("")) { -// String[] codes = mpointid.split(","); -// if (codes != null && codes.length > 1) { -// RMap map_redis = redissonClient.getMap(codes[0]); -// String outValue = map_redis.get(codes[1]); -// jspElement.setValue(outValue); -//// System.out.println(key_value); -// } - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - } - } else { - List mPointHistory = null; - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(bizId, mpointid); - } - if (getValueType.equals(JspElement.Type_GetMpMainValue)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_Get24HourHistory)) { - if (mPoint != null) { - int numtail = 2; - if (mPoint.getNumtail() != null) { - numtail = Double.valueOf(mPoint.getNumtail()).intValue(); - } - - String edt = time.substring(0, 16); - String sdt = CommUtil.subplus(edt, "-1", "day").substring(0, 16); - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - BigDecimal v = new BigDecimal(mPointHistory.get(j).getParmvalue().toString()); - dataValue[1] = String.valueOf(v.setScale(numtail, BigDecimal.ROUND_HALF_UP).doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataByJspElement_TY(JspElement jspElement, String bizId, String sdt, String edt, String dataType) { - if (sdt == null || sdt.isEmpty()) { - sdt = CommUtil.subplus(CommUtil.nowDate(), "-15", "day"); - } - if (edt == null || edt.isEmpty()) { - edt = CommUtil.subplus(CommUtil.nowDate(), "15", "day"); - } - String cacheDataWhere = " where 1=1 and dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "'"; - - List list = this.visualCacheDataService.selectListByWhere(cacheDataWhere + " order by morder desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - String dataTypeC = "-"; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - if (list.get(0).getDatatype() != null) { - dataTypeC = list.get(0).getDatatype(); - } - jspElement.setVisualCacheData(list.get(0)); - } - - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - - if (vCacheData != null) { - if (getValueType != null) { - if (getValueType.equals(JspElement.Type_GetRedisData)) { - if (mpointid != null && !mpointid.equals("")) { -// String[] codes = mpointid.split(","); -// if (codes != null && codes.length > 1) { -// RMap map_redis = redissonClient.getMap(codes[0]); -// String outValue = map_redis.get(codes[1]); -// jspElement.setValue(outValue); -//// System.out.println(key_value); -// } - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - } - } else { - List mPointHistory = null; - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(bizId, mpointid); - } - if (getValueType.equals(JspElement.Type_GetMpMainValue)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_Get24HourHistory)) { - if (mPoint != null) { - int numtail = 2; - if (mPoint.getNumtail() != null) { - numtail = Double.valueOf(mPoint.getNumtail()).intValue(); - } - - edt = CommUtil.nowDate().substring(0, 16); - sdt = CommUtil.subplus(edt, "-1", "day").substring(0, 16); - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - BigDecimal v = new BigDecimal(mPointHistory.get(j).getParmvalue().toString()); - dataValue[1] = String.valueOf(v.setScale(numtail, BigDecimal.ROUND_HALF_UP).doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetHisAvgValue)) { - if (mPoint != null) { - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' "; - mPointHistory = this.mPointHistoryService.selectAVG(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - - if (mPointHistory != null && mPointHistory.size() > 0) { - mPoint.setParmvalue(mPointHistory.get(0).getParmvalue()); - } - } - } else if (getValueType.equals(JspElement.Type_GetHisMaxValue)) { - if (mPoint != null) { - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' "; - mPointHistory = this.mPointHistoryService.selectMAX(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - - if (mPointHistory != null && mPointHistory.size() > 0) { - mPoint.setParmvalue(mPointHistory.get(0).getParmvalue()); - } - } - } else if (getValueType.equals(JspElement.Type_GetHisMinValue)) { - if (mPoint != null) { - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' "; - mPointHistory = this.mPointHistoryService.selectMIN(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - - if (mPointHistory != null && mPointHistory.size() > 0) { - mPoint.setParmvalue(mPointHistory.get(0).getParmvalue()); - } - } - } else if (getValueType.equals(JspElement.Type_Get30dayHistory)) { - if (mPoint != null) { - int numtail = 2; - if (mPoint.getNumtail() != null) { - numtail = Double.valueOf(mPoint.getNumtail()).intValue(); - } - - edt = CommUtil.nowDate(); - sdt = CommUtil.subplus(edt, "-30", "day"); - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectMIN(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - BigDecimal v = new BigDecimal(mPointHistory.get(j).getParmvalue().toString()); - dataValue[1] = String.valueOf(v.setScale(numtail, BigDecimal.ROUND_HALF_UP).doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetMonthHistory)) { - if (mPoint != null) { - int numtail = 2; - if (mPoint.getNumtail() != null) { - numtail = Double.valueOf(mPoint.getNumtail()).intValue(); - } - - sdt = CommUtil.nowDate().substring(0, 7) + "-01 00:00"; - edt = CommUtil.subplus(sdt, "1", "month"); - - String wherestr = " where measuredt>='" + sdt + "' and measuredt<'" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectMIN(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - String[] dataValue = new String[2]; - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue[0] = measuredt; - BigDecimal v = new BigDecimal(mPointHistory.get(j).getParmvalue().toString()); - dataValue[1] = String.valueOf(v.setScale(numtail, BigDecimal.ROUND_HALF_UP).doubleValue()); - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - jspElement.setmPoint(mPoint); - } - } - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getSDKCacheDataByJspElement(JspElement jspElement, String bizId, String time, String dataType) { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - String cacheDataWhere = " where 1=1 and dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "'"; - - List list = this.visualCacheDataService.selectListByWhere(cacheDataWhere + " order by morder desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - String dataTypeC = "-"; - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - if (list.get(0).getDatatype() != null) { - dataTypeC = list.get(0).getDatatype(); - } - jspElement.setVisualCacheData(list.get(0)); - } - - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - - if (vCacheData != null) { - if (getValueType != null) { - if (getValueType.equals(JspElement.Type_GetRedisData)) { - if (mpointid != null && !mpointid.equals("")) { - RMap map_redis = redissonClient.getMap(dataTypeC); - String outValue = map_redis.get(mpointid); - jspElement.setValue(outValue); - } - } else { - List mPointHistory = null; - MPoint mPoint = null; - if (mpointid != null && !mpointid.equals("")) { - mPoint = this.mPointService.selectById(bizId, mpointid); - } - if (getValueType.equals(JspElement.Type_GetMpMainValue)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } else if (getValueType.equals(JspElement.Type_GetTop1DayHis)) { - if (mPoint != null) { - String wherestr = " where datediff(day,'" + time + "',measuredt)=0 order by measuredt desc "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(0).getMeasuredt(); - dataValue.add(measuredt); - BigDecimal parmValue = CommUtil.formatMPointValue(mPointHistory.get(0).getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - dataValue.add(parmValue); - - jspElement.setJsonArray(dataValue); - } - } - } else if (getValueType.equals(JspElement.Type_GetDayHistory)) { - if (mPoint != null) { - String wherestr = " where datediff(day,'" + time + "',measuredt)=0 order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue.add(measuredt); - dataValue.add(mPointHistory.get(j).getParmvalue().doubleValue()); - - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - } - } else if (getValueType.equals(JspElement.Type_GetMonthHistory)) { - if (mPoint != null) { - String sdt = CommUtil.subplus(time.substring(0, 10), "-30", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt>='" + sdt + "' and measuredt<='" + time.substring(0, 10) + " 23:59' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointid, wherestr); - mPointHistory.removeAll(Collections.singleton(null)); //移除所有的null元素 - if (mPointHistory != null && mPointHistory.size() > 0) { - JSONArray jsondata = new JSONArray(); - for (int j = 0; j < mPointHistory.size(); j++) { - JSONArray dataValue = new JSONArray(); - String measuredt = mPointHistory.get(j).getMeasuredt(); - dataValue.add(measuredt.substring(0, 10)); - dataValue.add(mPointHistory.get(j).getParmvalue().doubleValue()); - - jsondata.add(dataValue); - } - jspElement.setJsonArray(jsondata); - } - } - } else if (getValueType.equals(JspElement.Type_GetMpMainValue)) { - if (mPoint != null) { - jspElement.setmPoint(mPoint); - } - } - - } - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataAndHisForMonthByJspElement(JspElement jspElement, String bizId, String - time, HttpServletRequest request) { - if (time == null || time.isEmpty()) { - time = CommUtil.nowDate(); - } - // 获取单条配置测量点值 - //String rptdt = " and year(rptdt) = '"+time.substring(0, 4)+"' and month(rptdt) = '"+time.substring(5, 7)+"' and day(rptdt) = '"+time.substring(8, 10)+"' "; - //List list = this.visualCacheDataService.selectListByWhere(" where dataName='"+jspElement.getValueUrl()+"' and unitId='"+bizId+"' "+rptdt+" order by morder "); - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' order by insdt desc "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - String getValueType = null; - if (jspElement != null && jspElement.getGetValueType() != null) { - getValueType = jspElement.getGetValueType(); - } - if (list != null && list.size() > 0) { - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - } - - List configlist = this.visualCacheConfigService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' "); - if (configlist != null && configlist.size() > 0) { - jspElement.setVisualCacheConfig(configlist.get(0)); - } - String edt = time.substring(0, 10) + " 23:59:59"; - //12个月 - String sdt = CommUtil.subplus(edt, "-12", "month"); - if (sdt == null || sdt.isEmpty()) { - sdt = edt.substring(0, 4) + "-01-01 00:00:00"; - } - String rptdt = " and insdt between '" + sdt + "' and '" + edt + "' "; - List listAll = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' " + rptdt + " order by insdt "); - if (listAll != null && listAll.size() > 0) { - jspElement.setVisualCacheDataList(listAll); - } - - if (vCacheData != null) { - if (getValueType != null) { - if (getValueType.equals(JspElement.Type_GetInternalMethod)) { - //内部接口 - if (vCacheData.getValue() == null) { - String url = vCacheData.getMpcode(); - if (url != null) { - url = request.getScheme() + "://" + request.getServerName() + ":" + - request.getServerPort() + request.getContextPath() + "/" + String.format(url, bizId); - String resultStr = HttpUtil.sendPost(url); - JSONObject jsonObject = JSONObject.parseObject(resultStr); - String result = jsonObject.getString("result"); - Boolean strResult = result.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if (strResult == true) { - vCacheData.setValue(Double.parseDouble(result)); - } else { - JSONArray jsonArrays = JSONArray.parseArray(result); - if (jsonArrays != null && jsonArrays.size() > 0) { - List mPointHistory = new ArrayList(); - for (int j = 0; j < jsonArrays.size(); j++) { - JSONArray jsonArray = JSONArray.parseArray(jsonArrays.get(j).toString()); - MPointHistory mpointHistory = new MPointHistory(); - mpointHistory.setMeasuredt(jsonArray.get(0).toString()); - String parmvalueStr = jsonArray.get(1).toString(); - if (parmvalueStr != null && !parmvalueStr.isEmpty()) { - mpointHistory.setParmvalue(new BigDecimal(parmvalueStr)); - } - mPointHistory.add(mpointHistory); - } - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } - } - } - } - } else if (getValueType.equals(JspElement.Type_GetHistoryAllMAX4TwoCodes)) { - if (vCacheData.getValue() == null && mpointid != null) { - //2个点位数据相加 - String[] mpointids = mpointid.split(","); - if (mpointids != null) { - List mPointHistory = null; - if (mpointids.length > 1) { - //实用性较差的实现方式,仅限两个表关联 - String wherestr = ""; - String table = " [TB_MP_" + mpointids[0] + "] z left join [TB_MP_" + mpointids[1] + "] p on z.[MeasureDT]=p.[MeasureDT] "; - String select = " max(z.ParmValue+p.ParmValue) as ParmValue "; - mPointHistory = this.mPointHistoryService.selectAggregateList(bizId, table, wherestr, select); - if (mPointHistory != null && mPointHistory.size() > 0) { - vCacheData.setValue(mPointHistory.get(0).getParmvalue().doubleValue()); - } - } else { - //特定类型,取最大值,时间范围为全部,取一个值,修改mPoint的parmvalue - mPointHistory = this.mPointHistoryService.selectMAX(bizId, "TB_MP_" + mpointids[0], ""); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - vCacheData.setValue(parmvalue.doubleValue()); - } - } - } - } - } else if (getValueType.equals(JspElement.Type_GetHistoryAllAVG4TwoCodes)) { - if (vCacheData.getValue() == null && mpointid != null) { - //2个点位数据相加 - String[] mpointids = mpointid.split(","); - if (mpointids != null) { - List mPointHistory = null; - if (mpointids.length > 1) { - //实用性较差的实现方式,仅限两个表关联 - String wherestr = ""; - String table = " [TB_MP_" + mpointids[0] + "] z left join [TB_MP_" + mpointids[1] + "] p on z.[MeasureDT]=p.[MeasureDT] "; - String select = " avg(z.ParmValue+p.ParmValue) as ParmValue "; - mPointHistory = this.mPointHistoryService.selectAggregateList(bizId, table, wherestr, select); - if (mPointHistory != null && mPointHistory.size() > 0) { - vCacheData.setValue(mPointHistory.get(0).getParmvalue().doubleValue()); - } - } else { - //特定类型,取平均值,时间范围为全部,取一个值,修改mPoint的parmvalue - mPointHistory = this.mPointHistoryService.selectAVG(bizId, "TB_MP_" + mpointids[0], ""); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - vCacheData.setValue(parmvalue.doubleValue()); - } - } - } - } - } else if (getValueType.equals(JspElement.Type_GetYesterdayHistory4TwoCodes)) { - if (vCacheData.getValue() == null && mpointid != null) { - //2个点位数据相加 - String[] mpointids = mpointid.split(","); - if (mpointids != null && mpointids.length > 0) { - List mPointHistory = null; - String nowtime = CommUtil.subplus(time, "-1", "day"); - sdt = nowtime.substring(0, 10) + " 00:00"; - edt = nowtime.substring(0, 10) + " 23:59"; - if (mpointids.length > 1) { - //实用性较差的实现方式,仅限两个表关联 - String wherestr = " where z.MeasureDT>='" + sdt + "' and z.MeasureDT<='" + edt + "' "; - String table = " [TB_MP_" + mpointids[0] + "] z left join [TB_MP_" + mpointids[1] + "] p on z.[MeasureDT]=p.[MeasureDT] "; - String select = " avg(z.ParmValue+p.ParmValue) as ParmValue "; - mPointHistory = this.mPointHistoryService.selectAggregateList(bizId, table, wherestr, select); - if (mPointHistory != null && mPointHistory.size() > 0) { - vCacheData.setValue(mPointHistory.get(0).getParmvalue().doubleValue()); - } - } else { - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt desc"; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointids[0], wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - vCacheData.setValue(parmvalue.doubleValue()); - } - } - } - } - } else if (getValueType.equals(JspElement.Type_Get10dayHistory4TwoCodes)) { - if (vCacheData.getValue() == null && mpointid != null) { - //2个点位数据相加 - String[] mpointids = mpointid.split(","); - if (mpointids != null && mpointids.length > 0) { - Double value = 0.0; - MPoint mPoint = null; - for (int m = 0; m < mpointids.length; m++) { - mPoint = this.mPointService.selectById(bizId, mpointids[m]); - if (mPoint != null && mPoint.getParmvalue() != null) { - value += mPoint.getParmvalue().doubleValue(); - } - } - vCacheData.setValue(value); - List mPointHistory = null; - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - edt = nowtime.substring(0, 10) + " 23:59"; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-10", "day").substring(0, 10) + " 00:00"; - if (mpointids.length > 1) { - //实用性较差的实现方式,仅限两个表关联 - String wherestr = " where z.MeasureDT>='" + sdt + "' and z.MeasureDT<='" + edt + "' " - + " group by YEAR(z.MeasureDT),MONTH(z.MeasureDT),DAY(z.MeasureDT) " - + " order by YEAR(z.MeasureDT),MONTH(z.MeasureDT),DAY(z.MeasureDT) "; - String table = " [TB_MP_" + mpointids[0] + "] z left join [TB_MP_" + mpointids[1] + "] p on z.[MeasureDT]=p.[MeasureDT] "; - String select = " cast(YEAR(z.MeasureDT) as varchar(5))+'-'+cast(month(z.MeasureDT) as varchar(5))+'-'+cast(day(z.MeasureDT) as varchar(5)) as MeasureDT" - + ",max(z.ParmValue+p.ParmValue) as ParmValue "; - mPointHistory = this.mPointHistoryService.selectAggregateList(bizId, table, wherestr, select); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } else { - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mpointids[0], wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } - } - } - } else if (mpointid != null && !mpointid.equals("")) { - MPoint mPoint = this.mPointService.selectById(bizId, mpointid); - List mPointHistory = null; - if (mPoint != null) { - if (getValueType.equals(JspElement.Type_GetHistoryAllMAX)) { - //特定类型,取最大值,时间范围为全部,取一个值,修改mPoint的parmvalue - mPointHistory = this.mPointHistoryService.selectMAX(bizId, "TB_MP_" + mPoint.getMpointcode(), ""); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - mPoint.setParmvalue(parmvalue); - } - } else { - if (getValueType.equals(JspElement.Type_GetHistoryAllAVG)) { - //特定类型,取平均值,时间范围为全部,取一个值,修改mPoint的parmvalue - mPointHistory = this.mPointHistoryService.selectAVG(bizId, "TB_MP_" + mPoint.getMpointcode(), ""); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - mPoint.setParmvalue(parmvalue); - } - } else { - if (getValueType.equals(JspElement.Type_GetYesterdayHistory)) { - //特定类型,取昨日值,时间范围为昨天,取最晚一个值,修改mPoint的parmvalue - String nowtime = CommUtil.subplus(time, "-1", "day"); - sdt = nowtime.substring(0, 10) + " 00:00"; - edt = nowtime.substring(0, 10) + " 23:59"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt desc"; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - BigDecimal parmvalue = mPointHistory.get(0).getParmvalue(); - mPoint.setParmvalue(parmvalue); - } - } else { - if (getValueType.equals(JspElement.Type_Get7dayHistory)) { - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - edt = nowtime.substring(0, 10) + " 23:59"; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-7", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } else { - if (getValueType.equals(JspElement.Type_Get10dayHistory)) { - String nowtime = com.sipai.tools.CommUtil.nowDate().substring(0, 10) + " 23:59"; - edt = nowtime.substring(0, 10) + " 23:59"; - sdt = com.sipai.tools.CommUtil.subplus(edt, "-10", "day").substring(0, 10) + " 00:00"; - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } else { - if (getValueType.equals(JspElement.Type_GetTodayHistory)) { - //当天或指定日期内所有值 - edt = time; - sdt = CommUtil.subplus(time, "-12", "hour"); - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } else { - wherestr = " order by measuredt desc "; - mPointHistory = this.mPointHistoryService.selectTopNumListByTableAWhere(bizId, " top 50 ", "TB_MP_" + mPoint.getMpointcode(), wherestr); - if (mPointHistory != null && mPointHistory.size() > 0) { - Collections.reverse(mPointHistory); - jspElement.setmPointHistory(mPointHistory); - } - } - } - } - } - - } - } - } - jspElement.setmPoint(mPoint); - } - } - } - jspElement.setVisualCacheData(vCacheData); - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getCacheDataAndHisForYearByJspElement(JspElement jspElement, String bizId, String time) { - // 获取单条配置测量点值 - String rptdt = " and year(rptdt) = '" + time.substring(0, 4) + "' and month(rptdt) = '" + time.substring(5, 7) + "' "; - List list = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' " + rptdt + " order by morder "); - VisualCacheData vCacheData = new VisualCacheData(); - String mpointid = null; - if (list != null && list.size() > 0) { -// if(list.get(0).getActive().equals(CacheData.Active_false)){ -// list.get(0).setValue(list.get(0).getInivalue()); -// } - vCacheData = list.get(0); - mpointid = list.get(0).getMpcode(); - } - - if (vCacheData != null) { - jspElement.setVisualCacheData(vCacheData); - } - - List configlist = this.visualCacheConfigService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' "); - if (configlist != null && configlist.size() > 0) { - jspElement.setVisualCacheConfig(configlist.get(0)); - } - - String edt = time.substring(0, 10) + " 23:59"; - String sdt = time.substring(0, 4) + "-01-01 00:00"; - rptdt = " and rptdt between '" + sdt + "' and '" + edt + "' "; - List listAll = this.visualCacheDataService.selectListByWhere(" where dataName='" + jspElement.getValueUrl() + "' and unitId='" + bizId + "' " + rptdt + " order by rptdt "); - if (listAll != null && listAll.size() > 0) { - jspElement.setVisualCacheDataList(listAll); - } - if (mpointid != null && !mpointid.equals("")) { - MPoint mPoint = this.mPointService.selectById(bizId, mpointid); - List mPointHistory = null; - if (mPoint != null) { - edt = time.substring(0, 10) + " 23:59"; - sdt = time.substring(0, 4) + "-01-01 00:00"; - /* String wherestr=" where measuredt between '"+sdt+"' and '"+edt+"' and memo ='ins'"+" and memotype ='hour' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode()+"_cal", wherestr); - if(mPointHistory==null || mPointHistory.size()<=0){ - wherestr=" where measuredt between '"+sdt+"' and '"+edt+"' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - }*/ - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - jspElement.setmPoint(mPoint); - } - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } - return jspElement; - } - - /** - * 通过jsp配置获取中间缓存数据 - * - * @param jspElement - * @param bizId - * @return - */ - public JspElement getmPointDataByJspElement(JspElement jspElement, String bizId, String time) { - long LoadstartTime = System.currentTimeMillis(); - String mpointid = jspElement.getVisualCacheData().getMpcode(); - String edt = ""; - String sdt = ""; - if (mpointid != null && !mpointid.equals("")) { - MPoint mPoint = this.mPointService.selectById(bizId, mpointid); - List mPointHistory = null; - if (mPoint != null) { - edt = time.substring(0, 10) + " 23:59"; - sdt = time.substring(0, 10) + " 00:00"; - /* String wherestr=" where measuredt between '"+sdt+"' and '"+edt+"' and memo ='ins'"+" and memotype ='hour' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode()+"_cal", wherestr); - if(mPointHistory==null || mPointHistory.size()<=0){ - wherestr=" where measuredt between '"+sdt+"' and '"+edt+"' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - }*/ - String wherestr = " where measuredt between '" + sdt + "' and '" + edt + "' order by measuredt "; - mPointHistory = this.mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + mPoint.getMpointcode(), wherestr); - jspElement.setmPoint(mPoint); - } - if (mPointHistory != null && mPointHistory.size() > 0) { - jspElement.setmPointHistory(mPointHistory); - } - } - long LoadendTime = System.currentTimeMillis(); - System.out.println(jspElement.getName() + "装载结束时间:" + (LoadendTime - LoadstartTime) + "ms"); - return jspElement; - } - - public void test(String[] classAllStrs, String bizId, VisualCacheData vCacheData) { - //内部接口 - try { - //通过反射来加载对应的接口 - //通过Class.forName(“包名+方法的类名”)拿到方法的对象; - //Class cls = Class.forName("com.sipai.controller.visual.SmartController"); - Class cls = Class.forName(classAllStrs[0]); - String interfaceName = classAllStrs[1]; - //实例化对象 - Object obj = cls.newInstance(); - double value = 0; - //通过类的实例化对象加载对应的方法,其中interfaceName为方法名,Map.class是该方法的参数类型,有几个参数则依次传几个对应的类型 - if (classAllStrs.length == 3) { - Method setMethod = cls.getDeclaredMethod(interfaceName, String.class); - //最后直接调用Method的invoke方法即可实现方法的调用 - //@SuppressWarnings("unchecked") - String resultStr = (String) setMethod.invoke(obj, bizId); - System.out.println(resultStr); - //采用正则表达式的方式来判断一个字符串是否为数字 - Boolean strResult = resultStr.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if (strResult == true) { - value = Double.parseDouble(resultStr); - } - } - if (classAllStrs.length == 4) { - Method setMethod = cls.getDeclaredMethod(interfaceName, String.class, String.class); - //最后直接调用Method的invoke方法即可实现方法的调用 - try { //@SuppressWarnings("unchecked") - double resultStr = (double) setMethod.invoke(obj, bizId, classAllStrs[3]); - System.out.println(resultStr); - value = resultStr; - } catch (InvocationTargetException e) { - Throwable t = e.getCause(); - t.printStackTrace(); - } - /*//采用正则表达式的方式来判断一个字符串是否为数字 - Boolean strResult = resultStr.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if(strResult == true) { - value = Double.parseDouble(resultStr); - }*/ - } - if (classAllStrs.length == 5) { - Method setMethod = cls.getDeclaredMethod(interfaceName, String.class, String.class, String.class); - //最后直接调用Method的invoke方法即可实现方法的调用 - //@SuppressWarnings("unchecked") - double resultStr = (double) setMethod.invoke(obj, bizId, classAllStrs[3], vCacheData.getDataname()); - System.out.println(resultStr); - value = resultStr; - //采用正则表达式的方式来判断一个字符串是否为数字 - /* Boolean strResult = resultStr.matches("[+-]?[0-9]+(\\.[0-9]+)?"); - if(strResult == true) { - value = Double.parseDouble(resultStr); - }*/ - } - vCacheData.setValue(value); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvocationTargetException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NoSuchMethodException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SecurityException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/InteractionService.java b/src/com/sipai/service/visual/InteractionService.java deleted file mode 100644 index a0c871ef..00000000 --- a/src/com/sipai/service/visual/InteractionService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.visual; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.InteractionDao; -import com.sipai.entity.visual.Interaction; -import com.sipai.tools.CommService; - -@Service -public class InteractionService implements CommService { - - @Resource - private InteractionDao interactionDao; - - @Override - public Interaction selectById(String id) { - return this.interactionDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.interactionDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Interaction entity) { - return this.interactionDao.insert(entity); - } - - @Override - public int update(Interaction interaction) { - return this.interactionDao.updateByPrimaryKeySelective(interaction); - } - - @Override - public List selectListByWhere(String wherestr) { - Interaction interaction = new Interaction(); - interaction.setWhere(wherestr); - return this.interactionDao.selectListByWhere(interaction); - } - - @Override - public int deleteByWhere(String wherestr) { - Interaction interaction = new Interaction(); - interaction.setWhere(wherestr); - return this.interactionDao.deleteByWhere(interaction); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/JspConfigureDetailService.java b/src/com/sipai/service/visual/JspConfigureDetailService.java deleted file mode 100644 index c6e3882c..00000000 --- a/src/com/sipai/service/visual/JspConfigureDetailService.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.sipai.service.visual; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.visual.JspConfigureDetailDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.visual.JspConfigureDetail; -import com.sipai.service.process.DataVisualFrameService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; - -import net.sf.json.JSONArray; -@Service -public class JspConfigureDetailService implements CommService{ - - @Resource - private JspConfigureDetailDao jspConfigureDetailDao; - @Resource - private DataVisualFrameService dataVisualFrameService; - @Resource - private UnitService unitService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @Override - public JspConfigureDetail selectById(String id) { - JspConfigureDetail jspConfigure = this.jspConfigureDetailDao.selectByPrimaryKey(id); - if (jspConfigure.getMpcode()!= null && !jspConfigure.getMpcode().isEmpty()) { - MPoint mPoint=mPointService.selectById(jspConfigure.getMpcode()); - if(mPoint!=null){ - jspConfigure.setmPoint(mPoint); - } - } - return jspConfigure; - } - - @Override - public int deleteById(String id) { - return this.jspConfigureDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(JspConfigureDetail entity) { - return this.jspConfigureDetailDao.insert(entity); - } - - @Override - public int update(JspConfigureDetail jspConfigure) { - return this.jspConfigureDetailDao.updateByPrimaryKeySelective(jspConfigure); - } - - @Override - public List selectListByWhere(String wherestr) { - JspConfigureDetail jspConfigure= new JspConfigureDetail(); - jspConfigure.setWhere(wherestr); - List list = this.jspConfigureDetailDao.selectListByWhere(jspConfigure); - for (JspConfigureDetail item : list) { - if (item.getMpcode()!= null && !item.getMpcode().isEmpty()) { - MPoint mPoint=mPointService.selectById(item.getMpcode()); - if(mPoint!=null){ - item.setmPoint(mPoint); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - JspConfigureDetail jspConfigure = new JspConfigureDetail(); - jspConfigure.setWhere(wherestr); - return this.jspConfigureDetailDao.deleteByWhere(jspConfigure); - } - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result,List list,String configureId) { - - if(list_result == null ) { - list_result = new ArrayList>(); - for(JspConfigureDetail k: list) { - if( configureId.equals(k.getConfigureId()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getDataName()); - list_result.add(map); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/JspConfigureService.java b/src/com/sipai/service/visual/JspConfigureService.java deleted file mode 100644 index ef1c295c..00000000 --- a/src/com/sipai/service/visual/JspConfigureService.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.sipai.service.visual; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import com.sipai.dao.visual.JspConfigureDao; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.Unit; -import com.sipai.entity.visual.JspConfigure; -import com.sipai.entity.visual.JspConfigureDetail; -import com.sipai.entity.work.Camera; -import com.sipai.service.process.DataVisualFrameService; -import com.sipai.service.user.UnitService; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; -@Service -public class JspConfigureService implements CommService{ - - @Resource - private JspConfigureDao jspConfigureDao; - @Resource - private DataVisualFrameService dataVisualFrameService; - @Resource - private UnitService unitService; - @Resource - private JspConfigureDetailService jspConfigureDetailService; - @Resource - private CameraService cameraService; - - - @Override - public JspConfigure selectById(String id) { - JspConfigure jspConfigure = this.jspConfigureDao.selectByPrimaryKey(id); - if (jspConfigure.getProDatavisualFrameId()!= null && !jspConfigure.getProDatavisualFrameId().isEmpty()) { - DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(jspConfigure.getProDatavisualFrameId()); - jspConfigure.setDataVisualFrame(dataVisualFrame); - Camera camera = this.cameraService.selectById(jspConfigure.getProDatavisualFrameId()); - jspConfigure.setCamera(camera); - } - if (jspConfigure.getSelectUnitId()!= null && !jspConfigure.getSelectUnitId().isEmpty()) { - Unit unit = this.unitService.getUnitById(jspConfigure.getSelectUnitId()); - jspConfigure.setUnit(unit); - } - if (jspConfigure.getId()!= null && !jspConfigure.getId().isEmpty()) { - List detailList = this.jspConfigureDetailService.selectListByWhere( - "where configure_id = '"+jspConfigure.getId()+"' order by morder"); - jspConfigure.setDetailList(detailList); - } - return jspConfigure; - } - - @Override - public int deleteById(String id) { - return this.jspConfigureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(JspConfigure entity) { - return this.jspConfigureDao.insert(entity); - } - - @Override - public int update(JspConfigure jspConfigure) { - return this.jspConfigureDao.updateByPrimaryKeySelective(jspConfigure); - } - - @Override - public List selectListByWhere(String wherestr) { - JspConfigure jspConfigure= new JspConfigure(); - jspConfigure.setWhere(wherestr); - List list = this.jspConfigureDao.selectListByWhere(jspConfigure); - for (JspConfigure item : list) { - if (item.getProDatavisualFrameId()!= null && !item.getProDatavisualFrameId().isEmpty()) { - DataVisualFrame dataVisualFrame = this.dataVisualFrameService.selectById(item.getProDatavisualFrameId()); - item.setDataVisualFrame(dataVisualFrame); - Camera camera = this.cameraService.selectById(item.getProDatavisualFrameId()); - item.setCamera(camera); - } - if (item.getSelectUnitId()!= null && !item.getSelectUnitId().isEmpty()) { - Unit unit = this.unitService.getUnitById(item.getSelectUnitId()); - item.setUnit(unit); - } - if (item.getId()!= null && !item.getId().isEmpty()) { - List detailList = this.jspConfigureDetailService.selectListByWhere( - "where configure_id = '"+item.getId()+"' order by morder"); - item.setDetailList(detailList); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - JspConfigure jspConfigure = new JspConfigure(); - jspConfigure.setWhere(wherestr); - return this.jspConfigureDao.deleteByWhere(jspConfigure); - } -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/JspElementService.java b/src/com/sipai/service/visual/JspElementService.java deleted file mode 100644 index a11a5455..00000000 --- a/src/com/sipai/service/visual/JspElementService.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.sipai.service.visual; -import com.alibaba.fastjson.JSONArray; -import com.sipai.dao.visual.JspElementDao; -import com.sipai.entity.visual.JspElement; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -@Service -public class JspElementService implements CommService{ - - @Resource - private JspElementDao jspElementDao; - @Resource - private GetValueService getValueService; - @Override - public JspElement selectById(String id) { - return this.jspElementDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.jspElementDao.deleteByPrimaryKey(id); - } - - @Override - public int save(JspElement entity) { - return this.jspElementDao.insert(entity); - } - - @Override - public int update(JspElement jspElement) { - return this.jspElementDao.updateByPrimaryKeySelective(jspElement); - } - - @Override - public List selectListByWhere(String wherestr) { - JspElement jspElement= new JspElement(); - jspElement.setWhere(wherestr); - return this.jspElementDao.selectListByWhere(jspElement); - } - - @Override - public int deleteByWhere(String wherestr) { - JspElement jspElement = new JspElement(); - jspElement.setWhere(wherestr); - return this.jspElementDao.deleteByWhere(jspElement); - } - - public JSONArray getValue(String bizid,String time,String jsp_id){ - List list = this.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere(jspElementwhere+" order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i list = this.selectListByWhere("where pid like '%"+jsp_id+"%' order by morder"); - JSONArray jsonArray = new JSONArray(); - if(list!=null && list.size()>0){ - long startTime=System.currentTimeMillis(); - for(int i=0;i{ - - @Resource - private LayoutDetailDao layoutDetailDao; - @Override - public LayoutDetail selectById(String id) { - return this.layoutDetailDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return layoutDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LayoutDetail entity) { - return this.layoutDetailDao.insert(entity); - } - - @Override - public int update(LayoutDetail layoutDetail) { - return layoutDetailDao.updateByPrimaryKeySelective(layoutDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - LayoutDetail layoutDetail= new LayoutDetail(); - layoutDetail.setWhere(wherestr); - return this.layoutDetailDao.selectListByWhere(layoutDetail); - } - - @Override - public int deleteByWhere(String wherestr) { - LayoutDetail layoutDetail = new LayoutDetail(); - layoutDetail.setWhere(wherestr); - return layoutDetailDao.deleteByWhere(layoutDetail); - } - - } \ No newline at end of file diff --git a/src/com/sipai/service/visual/LayoutService.java b/src/com/sipai/service/visual/LayoutService.java deleted file mode 100644 index eb33a7c5..00000000 --- a/src/com/sipai/service/visual/LayoutService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.visual; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.LayoutDao; -import com.sipai.dao.visual.PlanLayoutDao; -import com.sipai.entity.visual.Layout; -import com.sipai.entity.visual.LayoutDetail; -import com.sipai.entity.visual.PlanLayout; -import com.sipai.tools.CommService; -@Service -public class LayoutService implements CommService{ - - @Resource - private LayoutDao layoutDao; - @Resource - private LayoutDetailService layoutDetailService; - @Override - public Layout selectById(String id) { - return this.layoutDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - //先删除元素 - List layoutDetails = this.layoutDetailService.selectListByWhere(" where pid = '"+id+"'"); - String layoutDetailIds = ""; - for(int i=0;i selectListByWhere(String wherestr) { - Layout layout= new Layout(); - layout.setWhere(wherestr); - return this.layoutDao.selectListByWhere(layout); - } - - @Override - public int deleteByWhere(String wherestr) { - Layout layout = new Layout(); - layout.setWhere(wherestr); - return layoutDao.deleteByWhere(layout); - } - - } \ No newline at end of file diff --git a/src/com/sipai/service/visual/PlanInteractionService.java b/src/com/sipai/service/visual/PlanInteractionService.java deleted file mode 100644 index ed241be4..00000000 --- a/src/com/sipai/service/visual/PlanInteractionService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.visual; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.PlanInteractionDao; -import com.sipai.entity.visual.PlanInteraction; -import com.sipai.tools.CommService; - -@Service -public class PlanInteractionService implements CommService { - - @Resource - private PlanInteractionDao planInteractionDao; - - @Override - public PlanInteraction selectById(String id) { - return this.planInteractionDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return planInteractionDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PlanInteraction entity) { - return this.planInteractionDao.insert(entity); - } - - @Override - public int update(PlanInteraction planInteraction) { - return planInteractionDao.updateByPrimaryKeySelective(planInteraction); - } - - @Override - public List selectListByWhere(String wherestr) { - PlanInteraction planInteraction = new PlanInteraction(); - planInteraction.setWhere(wherestr); - return this.planInteractionDao.selectListByWhere(planInteraction); - } - - @Override - public int deleteByWhere(String wherestr) { - PlanInteraction planInteraction = new PlanInteraction(); - planInteraction.setWhere(wherestr); - return planInteractionDao.deleteByWhere(planInteraction); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/PlanLayoutService.java b/src/com/sipai/service/visual/PlanLayoutService.java deleted file mode 100644 index 785aa491..00000000 --- a/src/com/sipai/service/visual/PlanLayoutService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.visual; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.PlanLayoutDao; -import com.sipai.entity.visual.PlanLayout; -import com.sipai.tools.CommService; -@Service -public class PlanLayoutService implements CommService{ - - @Resource - private PlanLayoutDao planLayoutDao; - @Override - public PlanLayout selectById(String id) { - return this.planLayoutDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return planLayoutDao.deleteByPrimaryKey(id); - } - - @Override - public int save(PlanLayout entity) { - return this.planLayoutDao.insert(entity); - } - - @Override - public int update(PlanLayout planLayout) { - return planLayoutDao.updateByPrimaryKeySelective(planLayout); - } - - @Override - public List selectListByWhere(String wherestr) { - PlanLayout planLayout= new PlanLayout(); - planLayout.setWhere(wherestr); - return this.planLayoutDao.selectListByWhere(planLayout); - } - - @Override - public int deleteByWhere(String wherestr) { - PlanLayout planLayout = new PlanLayout(); - planLayout.setWhere(wherestr); - return planLayoutDao.deleteByWhere(planLayout); - } - - } \ No newline at end of file diff --git a/src/com/sipai/service/visual/PlanService.java b/src/com/sipai/service/visual/PlanService.java deleted file mode 100644 index 59471f35..00000000 --- a/src/com/sipai/service/visual/PlanService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.sipai.service.visual; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.Plan; -import com.sipai.entity.work.Camera; - -public interface PlanService { - public Plan getPlanById(String planId); - - public int savePlan(Plan plan); - - public int updatePlan(Plan plan); - - public int deletePlanById(String planId); - - public List selectAll(); - - public List selectListByWhere(String where); - - public int deleteByPid(String pid); - - /** - * 获取bootstrap-treeview 所需json数据*/ - public String getTreeList(List> list_result,List list); - /** - * 根据查询条件和用户总菜单列表,查询相关菜单 - * */ - public List getPlanListByWhereAndList(String wherestr,List list); - - /** - * 选择布局时生成plan布局 - * @param planId 方案id - * @param layoutId 布局id - * @param userId 人员id - * @return - */ - public int createPlanLayout(String planId,String layoutId,String userId); - - /** - * 重新更新方案布局 - * @param planId 方案id - * @param layoutId 布局id - * @param userId 人员id - * @return - */ - public int updatePlanLayout(String planId,String layoutId,String userId); - - public Plan selectWholeInfoById(String planId); - - public List getJspWholeInfoByPlanLayoutId(String planLayoutId, String sdt, String edt,String elementCode); - - public Camera getCameraByPlanLayoutId(String planLayoutId); - - public int getProcessNum(String ID, List list, BigDecimal bigDecimal); -} diff --git a/src/com/sipai/service/visual/PlanServiceImpl.java b/src/com/sipai/service/visual/PlanServiceImpl.java deleted file mode 100644 index ff26ee6c..00000000 --- a/src/com/sipai/service/visual/PlanServiceImpl.java +++ /dev/null @@ -1,560 +0,0 @@ -package com.sipai.service.visual; - -import java.io.File; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.swing.text.TabableView; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.aspectj.weaver.ast.Var; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.user.UserPowerDao; -import com.sipai.dao.visual.PlanDao; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.UserPower; -import com.sipai.entity.visual.DataType; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.LayoutDetail; -import com.sipai.entity.visual.Plan; -import com.sipai.entity.visual.PlanInteraction; -import com.sipai.entity.visual.PlanLayout; -import com.sipai.entity.visual.VisualJsp; -import com.sipai.entity.work.Camera; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommUtil; - -@Service("planService") -public class PlanServiceImpl implements PlanService { - @Resource - private PlanDao planDao; - @Resource - private LayoutDetailService layoutDetailService; - @Resource - private PlanLayoutService planLayoutService; - @Resource - private VisualJspService visualJspService; - @Resource - private JspElementService jspElementService; - @Resource - private PlanInteractionService planInteractionService; - @Resource - private GetValueService getValueService; - @Resource - private DataTypeService dataTypeService; - @Resource - private CameraService cameraService; - - @Override - public Plan getPlanById(String planId) { - return this.planDao.selectByPrimaryKey(planId); - } - - @Override - public int savePlan(Plan plan) { - return this.planDao.insert(plan); - } - - @Override - public int updatePlan(Plan plan) { - return this.planDao.updateByPrimaryKeySelective(plan); - } - - @Override - public int deletePlanById(String planId) { - return this.planDao.deleteByPrimaryKey(planId); - } - - @Override - public List selectAll() { - Plan plan = new Plan(); - return this.planDao.selectList(plan); - } - - @Override - public List selectListByWhere(String where) { - Plan plan = new Plan(); - plan.setWhere(where); - return this.planDao.selectListByWhere(plan); - } - - List list = new ArrayList(); - - /** - * 根据查询条件和用户总菜单列表,查询相关菜单 - * */ - public List getPlanListByWhereAndList(String wherestr, List list) { - List t2 = new ArrayList(); - List plans = this.selectListByWhere(wherestr); - for (Plan plan : plans) { - List children = this.getChildren(plan.getId(), list); - List parents = this.getParents(plan.getId(), list); - // 为保证查询的顺序不变,用for循环 - for (Plan item : parents) { - int i = 0; - for (i = 0; i < t2.size(); i++) { - if (t2.get(i).getId().equals(item.getId())) { - break; - } - } - if (i == t2.size()) { - t2.add(item); - } - } - int j = 0; - for (j = 0; j < t2.size(); j++) { - if (t2.get(j).getId().equals(plan.getId())) { - break; - } - } - if (j == t2.size()) { - t2.add(plan); - } - for (Plan item : children) { - int i = 0; - for (i = 0; i < t2.size(); i++) { - if (t2.get(i).getId().equals(item.getId())) { - break; - } - } - if (i == t2.size()) { - t2.add(item); - } - } - } - return t2; - } - - /** - * 递归获取子节点 - * - * @param list - */ - public List getChildren(String pid, List list) { - List t2 = new ArrayList(); - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getPid() != null - && list.get(i).getPid().equalsIgnoreCase(pid)) { - // t.get(i).setName(t.get(i).getName()); - t2.add(list.get(i)); - if (getChildren(list.get(i).getId(), list) != null) { - t2.addAll(getChildren(list.get(i).getId(), list)); - } - } - } - return t2; - } - - /** - * 递归获取父节点 - * - * @param - */ - public List getParents(String pid, List list) { - List t2 = new ArrayList(); - for (int i = 0; i < list.size(); i++) { - if (list.get(i).getId() != null - && list.get(i).getId().equalsIgnoreCase(pid)) { - // t.get(i).setName(t.get(i).getName()); - t2.add(list.get(i)); - if (getParents(list.get(i).getPid(), list) != null) { - t2.addAll(getParents(list.get(i).getPid(), list)); - } - } - } - return t2; - } - - @Override - public int deleteByPid(String pid) { - Plan plan = new Plan(); - plan.setWhere(" where pid='" + pid + "' "); - return this.planDao.deleteByWhere(plan); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, - List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (Plan k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (Plan k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - List tags = new ArrayList(); - tags.add(k.getDescription()); - m.put("tags", tags); - childlist.add(m); - } - } - if (childlist.size() > 0) { - /* - * List sizelist = new ArrayList(); - * sizelist.add(childlist.size()+""); mp.put("tags", - * sizelist); - */ - mp.put("nodes", childlist); - // JSONObject jsonObject = new JSONObject(); - // jsonObject.put("text", "sdfsf"); - - getTreeList(childlist, list); - } - } - } - /* - * for (Map item : list_result) { JSONObject jsonObject - * = new JSONObject(); item.put("state", jsonObject); jsonObject=null; } - */ - return JSONArray.fromObject(list_result).toString(); - } - - @Override - @Transactional - public int createPlanLayout(String planId, String layoutId, String userId) { - // 先获取目前已有的布局id下的布局 - List planLayouts = this.planLayoutService - .selectListByWhere(" where plan_id = '" + planId - + "' and layout_id = '" + layoutId + "'"); - // 若没有则新增 - if (planLayouts != null && planLayouts.size() == 0) { - // 获取所选布局id下所有布局元素 - List layoutDetails = this.layoutDetailService - .selectListByWhere(" where pid = '" + layoutId - + "' order by morder "); - for (int i = 0; i < layoutDetails.size(); i++) { - PlanLayout planLayout = new PlanLayout(); - planLayout.setId(CommUtil.getUUID()); - planLayout.setInsdt(CommUtil.nowDate()); - planLayout.setInsuser(userId); - planLayout.setHeight(layoutDetails.get(i).getHeight());// 目前默认把百分比进行存储,之后可能存储px(待定) - planLayout.setWidth(layoutDetails.get(i).getWidth());// 同上 - planLayout.setLayoutId(layoutId); - planLayout.setPlanId(planId); - planLayout.setMorder(Integer.valueOf(layoutDetails.get(i) - .getRowno() - + String.valueOf(layoutDetails.get(i).getMorder()))); - planLayout.setPid(layoutDetails.get(i).getId());// 存储对应的布局元素ID - int res = this.planLayoutService.save(planLayout); - if (res == 0) { - throw new RuntimeException(); - } - } - } - return 1; - } - - @Override - @Transactional - public int updatePlanLayout(String planId, String layoutId, String userId) { - // 先删除原先的方案布局 - this.planLayoutService.deleteByWhere(" where plan_id = '" + planId - + "' and layout_id = '" + layoutId + "'"); - // 获取所选布局id下所有布局元素 - List layoutDetails = this.layoutDetailService - .selectListByWhere(" where pid = '" + layoutId - + "' order by morder "); - for (int i = 0; i < layoutDetails.size(); i++) { - PlanLayout planLayout = new PlanLayout(); - planLayout.setId(CommUtil.getUUID()); - planLayout.setInsdt(CommUtil.nowDate()); - planLayout.setInsuser(userId); - planLayout.setHeight(layoutDetails.get(i).getHeight());// 目前默认把百分比进行存储,之后可能存储px(待定) - planLayout.setWidth(layoutDetails.get(i).getWidth());// 同上 - planLayout.setLayoutId(layoutId); - planLayout.setPlanId(planId); - planLayout.setMorder(Integer.valueOf(layoutDetails.get(i) - .getRowno() - + String.valueOf(layoutDetails.get(i).getMorder()))); - planLayout.setPid(layoutDetails.get(i).getId());// 存储对应的布局元素ID - int res = this.planLayoutService.save(planLayout); - if (res == 0) { - throw new RuntimeException(); - } - } - return 1; - } - - @Override - public Plan selectWholeInfoById(String planId) { - Plan plan = this.planDao.selectByPrimaryKey(planId); - // 获取布局 - List planLayout = this.planLayoutService - .selectListByWhere(" where plan_id = '" + plan.getId() + "' and layout_id = '"+plan.getLayoutId() - + "' order by morder"); - // 通过布局获取模块 - for (int i = 0; i < planLayout.size(); i++) { - try { - // 先获取行号 - LayoutDetail layoutDetail = this.layoutDetailService - .selectById(planLayout.get(i).getPid()); - planLayout.get(i).setLayoutDetail(layoutDetail); - VisualJsp visualJsp=this.visualJspService.selectById(planLayout.get(i).getJspCode()); - planLayout.get(i).setJspCode(visualJsp.getJspCode()); - } catch (Exception e) { - System.out.println(e); - } - } - plan.setPlanLayout(planLayout); - - // 获取交互 - List planInteractions = this.planInteractionService - .selectListByWhere(" where plan_id = '" + plan.getId() + "'"); - plan.setPlanInteraction(planInteractions); - return plan; - } - - @Override - public List getJspWholeInfoByPlanLayoutId(String planLayoutId,String sdt,String edt,String elementCode) { - // 获取布局 - PlanLayout planLayout = this.planLayoutService.selectById(planLayoutId); - List jspElements = new ArrayList(); - // 通过布局获取模块 - try { - // 先获取行号 - LayoutDetail layoutDetail = this.layoutDetailService - .selectById(planLayout.getPid()); - planLayout.setLayoutDetail(layoutDetail); - List visualJsp = this.visualJspService.selectListByWhere(" where id = '" - + planLayout.getJspCode() + "'"); -// String dataType = ""; -// if (planLayout.getDataType() == null || planLayout.getDataType().equals("")) { -// List dataTypeList = this.dataTypeService -// .selectListByWhere("order by morder"); -// dataType = dataTypeList.get(0).getId();// 没数据时默认赋值第一个 -// } else { -// dataType = planLayout.getDataType(); -// } - String jspWhereString=""; - if(elementCode!=null&&elementCode.length()>0){ - jspWhereString+=" and element_code='"+elementCode+"' "; - } - jspElements = this.jspElementService.selectListByWhere(" where pid = '" - + visualJsp.get(0).getId() + "' "+jspWhereString+" order by morder"); - - // 获取jspelements中配置数据 - for (int i = 0; i < jspElements.size(); i++) { - String bizId=jspElements.get(i).getUnitId(); - if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetValue)) { - // 获取值 - jspElements.set(i, this.getValueService - .getValueByJspElement(jspElements.get(i), bizId)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetTodayHistory)) { - // 获取历史数据 - jspElements.set(i, this.getValueService - .getTodayHistoryByJspElement(jspElements.get(i), bizId));// - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYesterdayHistory)) { - // 获取历史数据 - jspElements.set(i, this.getValueService - .getYesterdayHistoryByJspElement(jspElements.get(i), bizId));// - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_Get5YearHistory)) { - // 获取历史数据 - jspElements.set(i, this.getValueService - .get5YearHistoryByJspElement(jspElements.get(i), bizId)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetHourHistory)) { - // 获取历史数据 - jspElements.set(i, this.getValueService - .getHourHistoryByJspElement(jspElements.get(i), bizId)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_Get7dayHistory)) { - // 获取历史数据 - jspElements.set(i, this.getValueService - .get7dayHistoryByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetHisSumValue)) { - // 获取历史累计数据 - jspElements.set(i, this.getValueService - .getHisSumValue(jspElements.get(i), bizId, sdt ,edt)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetHisAvgValue)) { - // 获取历史平均数据 - jspElements.set(i, this.getValueService - .getHisAvgValue(jspElements.get(i), bizId, sdt ,edt)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetModbus)) { - // 获取Modbus数据 - jspElements.set(i, this.getValueService - .getModbusValueByJspElement(jspElements.get(i), - bizId)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetHttp)) { - // 获取HTTP数据 - jspElements.set(i, this.getValueService - .getHttpValueByJspElement(jspElements.get(i))); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetWeather)) { - // 获取天气数据 - jspElements.set(i, this.getValueService - .getWeatherByJspElement(jspElements.get(i), bizId)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetCacheData)) { - // 获取中间表数据 - jspElements.set(i, this.getValueService - .getCacheDataByJspElement(jspElements.get(i), bizId)); - } else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetNowHourFirst)) { - // 获取当前小时第一条数据 - jspElements.set(i, this.getValueService - .getNowHourFirstByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetLastHourFirst)) { - // 获取上个小时第一条数据 - jspElements.set(i, this.getValueService - .getLastHourFirstByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetTodaySumValue)) { - // 获取今日累计数据 - jspElements.set(i, this.getValueService - .getTodaySumValueByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYesterdaySumValue)) { - // 获取昨日累计数据 - jspElements.set(i, this.getValueService - .getYesterdaySumValueByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYesterdayLastValue)) { - // 获取昨日最后条数据 - jspElements.set(i, this.getValueService - .getYesterdayLastValueByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetTodayFirstValue)) { - // 获取今日第一条数据 - jspElements.set(i, this.getValueService - .getTodayFirstValueByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYesterdayFirstValue)) { - // 获取昨日第一条数据 - jspElements.set(i, this.getValueService - .getYesterdayFirstValueByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYearSum)) { - // 获取今年累计数据 - jspElements.set(i, this.getValueService - .getYearSumValueByJspElement(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYesterdayNowHourFirstValue)) { - // 获取昨日当前小时数据 - jspElements.set(i, this.getValueService - .getYesterdayNowHourFirstValue(jspElements.get(i), bizId)); - }else if (jspElements.get(i).getGetValueType() - .equals(JspElement.Type_GetYesterdayHisHourSumValue)) { - // 获取昨日当前小时为止累计数据 - jspElements.set(i, this.getValueService - .getYesterdayHisHourSumValue(jspElements.get(i), bizId)); - }else { - - } - } - } catch (Exception e) { - System.out.println(e); - } - return jspElements; - } - - @Override - public Camera getCameraByPlanLayoutId(String planLayoutId) { - Camera camera = new Camera();//默认第一个摄像头作为显示摄像头 - PlanLayout planLayout = this.planLayoutService.selectById(planLayoutId); - if(planLayout!=null && planLayout.getCameraId()!=null){ - camera = this.cameraService.selectById(planLayout.getCameraId()); - } - -// List visualJsp = this.visualJspService.selectListByWhere(" where jsp_code = '" -// + planLayout.getJspCode() + "'"); -// String dataType = ""; -// if (planLayout.getDataType() == null || planLayout.getDataType().equals("")) { -// List dataTypeList = this.dataTypeService -// .selectListByWhere("order by morder"); -// dataType = dataTypeList.get(0).getId();// 没数据时默认赋值第一个 -// } else { -// dataType = planLayout.getDataType(); -// } -// List jspElements = this.jspElementService.selectListByWhere(" where pid = '" -// + visualJsp.get(0).getId() + "' and data_Type = '" + dataType + "' order by morder"); -// for(int i=0;i list, BigDecimal batchNo) { - int num = list.size()+1; - String path = ""; - File dirFile; - boolean bFile = false; - Out: for (int i = 0; i < list.size(); i++) { - if (list.get(i).getPid().equalsIgnoreCase(ID)) { - path = list.get(i).getLocation(); - In: for (int a = 0; a < list.size(); a++) {// 倒序查文件,若顺序靠后的文件被找到则返回其顺序号 - String allPath = ""; - bFile = false; - allPath += path + "\\" +batchNo + "\\" + list.get(a).getLocation(); - System.out.println("allPath=" + allPath); - try { - dirFile = new File(allPath); - bFile = dirFile.exists(); - if (bFile == true) { - num = list.get(a).getMorder(); - System.out.println("文件夹已存在,顺序号为" - + list.get(a).getMorder()); - break Out; - } else { - System.out.println("文件夹不存在"); - } - dirFile = null; - } catch (Exception e) { - System.out.println("错误发生在 :" + e.toString()); - } - } - } - } - return num; - } - -} diff --git a/src/com/sipai/service/visual/ProcessOperationService.java b/src/com/sipai/service/visual/ProcessOperationService.java deleted file mode 100644 index 4dcbfb0d..00000000 --- a/src/com/sipai/service/visual/ProcessOperationService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.visual; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.ProcessOperationDao; -import com.sipai.entity.visual.ProcessOperation; -import com.sipai.tools.CommService; - -@Service -public class ProcessOperationService implements CommService { - - @Resource - private ProcessOperationDao processOperationDao; - - @Override - public ProcessOperation selectById(String id) { - return this.processOperationDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.processOperationDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProcessOperation entity) { - return this.processOperationDao.insert(entity); - } - - @Override - public int update(ProcessOperation processOperation) { - return this.processOperationDao.updateByPrimaryKeySelective(processOperation); - } - - @Override - public List selectListByWhere(String wherestr) { - ProcessOperation processOperation = new ProcessOperation(); - processOperation.setWhere(wherestr); - return this.processOperationDao.selectListByWhere(processOperation); - } - - @Override - public int deleteByWhere(String wherestr) { - ProcessOperation processOperation = new ProcessOperation(); - processOperation.setWhere(wherestr); - return this.processOperationDao.deleteByWhere(processOperation); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/VisualCacheConfigService.java b/src/com/sipai/service/visual/VisualCacheConfigService.java deleted file mode 100644 index 04bd8851..00000000 --- a/src/com/sipai/service/visual/VisualCacheConfigService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.visual; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.VisualCacheConfigDao; -import com.sipai.entity.visual.VisualCacheConfig; -import com.sipai.tools.CommService; - -@Service -public class VisualCacheConfigService implements CommService { - - @Resource - private VisualCacheConfigDao visualCacheConfigDao; - - @Override - public VisualCacheConfig selectById(String id) { - return this.visualCacheConfigDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.visualCacheConfigDao.deleteByPrimaryKey(id); - } - - @Override - public int save(VisualCacheConfig entity) { - return this.visualCacheConfigDao.insert(entity); - } - - @Override - public int update(VisualCacheConfig visualCacheConfig) { - return this.visualCacheConfigDao.updateByPrimaryKeySelective(visualCacheConfig); - } - - @Override - public List selectListByWhere(String wherestr) { - VisualCacheConfig visualCacheConfig = new VisualCacheConfig(); - visualCacheConfig.setWhere(wherestr); - return this.visualCacheConfigDao.selectListByWhere(visualCacheConfig); - } - - @Override - public int deleteByWhere(String wherestr) { - VisualCacheConfig visualCacheConfig = new VisualCacheConfig(); - visualCacheConfig.setWhere(wherestr); - return this.visualCacheConfigDao.deleteByWhere(visualCacheConfig); - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/VisualCacheDataService.java b/src/com/sipai/service/visual/VisualCacheDataService.java deleted file mode 100644 index b4c47f33..00000000 --- a/src/com/sipai/service/visual/VisualCacheDataService.java +++ /dev/null @@ -1,395 +0,0 @@ -package com.sipai.service.visual; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.visual.VisualCacheDataDao; -import com.sipai.entity.alarm.AlarmMoldCodeEnum; -import com.sipai.entity.scada.*; -import com.sipai.entity.visual.VisualCacheData; -import com.sipai.service.scada.*; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.DecimalFormat; -import java.util.List; - -@Service -public class VisualCacheDataService implements CommService { - - @Resource - private VisualCacheDataDao visualCacheDataDao; - @Resource - private ProAlarmService proAlarmService; - @Resource - private ProAlarmBaseTextService proAlarmBaseTextService; - @Resource - private MPointHistoryService mPointHistoryService; - @Resource - private MPointService mPointService; - @Resource - private MPointFormulaService mPointFormulaService; - - @Override - public VisualCacheData selectById(String id) { - return this.visualCacheDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return this.visualCacheDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(VisualCacheData entity) { - return this.visualCacheDataDao.insert(entity); - } - - @Override - public int update(VisualCacheData visualCacheData) { - return this.visualCacheDataDao.updateByPrimaryKeySelective(visualCacheData); - } - - @Override - public List selectListByWhere(String wherestr) { - VisualCacheData visualCacheData = new VisualCacheData(); - visualCacheData.setWhere(wherestr); - return this.visualCacheDataDao.selectListByWhere(visualCacheData); - } - public VisualCacheData selectListByWhere4TopOne(String wherestr) { - VisualCacheData visualCacheData = new VisualCacheData(); - visualCacheData.setWhere(wherestr); - return this.visualCacheDataDao.selectListByWhere4TopOne(visualCacheData); - } - - @Override - public int deleteByWhere(String wherestr) { - VisualCacheData visualCacheData = new VisualCacheData(); - visualCacheData.setWhere(wherestr); - return this.visualCacheDataDao.deleteByWhere(visualCacheData); - } - - public List selectAggregateList(String table, String wherestr, String select) { - return this.visualCacheDataDao.selectAggregateList(table, wherestr, select); - } - - public String getGYYXBG_TH_Data(String unitId, String sdt, String mainScoreMpid) { - String mainAlarmNews = ""; - List mainMpHis = this.mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "TB_MP_" + mainScoreMpid, " where datediff(day,measuredt,'" + sdt + "')=0"); - MPoint mPoint = this.mPointService.selectById(unitId, mainScoreMpid); - JSONObject jsonObject1 = new JSONObject(); - if (mPoint != null) { - jsonObject1.put("text", mPoint.getParmname()); - if (mainMpHis != null && mainMpHis.size() > 0) { - jsonObject1.put("value", mainMpHis.get(0).getParmvalue()); - } else { - jsonObject1.put("value", "0"); - } - jsonObject1.put("spanrange", mPoint.getSpanrange()); - - List mfList = this.mPointFormulaService.selectListByWhere(unitId, " where pmpid='" + mainScoreMpid + "' order by starthour "); - if (mfList != null && mfList.size() > 0) { - JSONArray jsonArray2 = new JSONArray(); - for (MPointFormula mPointFormula : - mfList) { - List d1MpHis = this.mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "TB_MP_" + mPointFormula.getMpid(), " where datediff(day,measuredt,'" + sdt + "')=0"); - MPoint mPoint2 = this.mPointService.selectById(unitId, mPointFormula.getMpid()); - JSONObject jsonObject2 = new JSONObject(); -// jsonObject2.put("text", mPointFormula.getFormulaname()); - jsonObject2.put("text", mPoint2.getDisname()); - if (d1MpHis != null && d1MpHis.size() > 0) { - jsonObject2.put("value", d1MpHis.get(0).getParmvalue()); - } else { - jsonObject2.put("value", "0"); - } - jsonObject2.put("rate", mPoint2.getRate()); - jsonObject2.put("spanrange", mPoint2.getSpanrange()); - jsonArray2.add(jsonObject2); - - List mfList2 = this.mPointFormulaService.selectListByWhere(unitId, " where pmpid='" + mPointFormula.getMpid() + "' order by starthour "); - if (mfList2 != null && mfList2.size() > 0) { - JSONArray jsonArray3 = new JSONArray(); - for (MPointFormula mPointFormula2 : - mfList2) { - List d2MpHis = this.mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "TB_MP_" + mPointFormula2.getMpid(), " where datediff(day,measuredt,'" + sdt + "')=0"); - MPoint mPoint3 = this.mPointService.selectById(unitId, mPointFormula2.getMpid()); - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("text", mPoint3.getDisname()); - if (d2MpHis != null && d2MpHis.size() > 0) { - jsonObject3.put("value", d2MpHis.get(0).getParmvalue()); - } else { - jsonObject3.put("value", "0"); - } - jsonObject3.put("mpcode", mPoint3.getId()); - jsonObject3.put("spanrange", mPoint3.getSpanrange()); -// MPoint mPoint4 = this.mPointService.selectById(unitId, mPointFormula2.getMpid() + "_score"); - List d3MpHis = this.mPointHistoryService.selectTopNumListByTableAWhere(unitId, "1", "TB_MP_" + mPointFormula2.getMpid() + "_score", " where datediff(day,measuredt,'" + sdt + "')=0"); - if (d3MpHis != null && d3MpHis.size() > 0) { - jsonObject3.put("score", d3MpHis.get(0).getParmvalue()); - } else { - jsonObject3.put("score", "0"); - } - String alarmNews = ""; - String alarmIds = ""; - List proAlarmList = this.proAlarmService.selectListByWhere(unitId, " where point_code='" + mPointFormula2.getMpid() + "' and datediff(day,alarm_time,'" + sdt + "')=0 and alarm_type='" + AlarmMoldCodeEnum.LimitValue_Pro.getKey() + "' order by alarm_time "); - if (proAlarmList != null && proAlarmList.size() > 0) { - for (int i = 0; i < proAlarmList.size(); i++) { - alarmNews += proAlarmList.get(i).getDescribe(); - if (i < (proAlarmList.size() - 1)) { - alarmNews += "
"; - } - alarmIds += proAlarmList.get(i).getId() + ","; - } - } - - jsonObject3.put("alarmNews", alarmNews); - - alarmIds = alarmIds.replace(",", "','"); - List proAlarmBaseTextList = this.proAlarmBaseTextService.selectListByWhere2(unitId, " where datediff(day,insdt,'" + sdt + "')=0 and alarm_id in ('" + alarmIds + "')"); - if (proAlarmBaseTextList != null && proAlarmBaseTextList.size() > 0) { - for (int i = 0; i < proAlarmBaseTextList.size(); i++) { - mainAlarmNews += proAlarmBaseTextList.get(i).getDecisionexpertbasetext(); - if (i < (proAlarmBaseTextList.size() - 1)) { - mainAlarmNews += "
"; - } - } - } - - - jsonArray3.add(jsonObject3); - } - jsonObject2.put("child", jsonArray3); - } - - } - jsonObject1.put("child", jsonArray2); - } - - jsonObject1.put("alarmNews", mainAlarmNews); - } - - return jsonObject1.toString(); - } - - public void doGYYXBG_Out(HttpServletResponse response, JSONObject jsonObject1, String sdt) throws IOException { - DecimalFormat df = new DecimalFormat("#"); - - String fileName = "工艺运行评价" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "工艺运行评价"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 6000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 10000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setWrapText(true); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 5)); - HSSFRow row_0 = sheet.createRow(0); - row_0.setHeight((short) 800); - HSSFCell cell_row0 = row_0.createCell(0); - cell_row0.setCellStyle(headStyle); - cell_row0.setCellValue("工艺运行评价"); - - HSSFRow row_1 = sheet.createRow(1); - row_1.setHeight((short) 400); - HSSFCell cell_row1_3 = row_1.createCell(3); - cell_row1_3.setCellStyle(listStyle); - cell_row1_3.setCellValue("日期"); - HSSFCell cell_row1_4 = row_1.createCell(4); - cell_row1_4.setCellStyle(listStyle); - cell_row1_4.setCellValue(sdt.substring(0, 10)); - - //产生表格表头 - String excelTitleStr = "评价项目,满分指标值,今日得分,异常情况"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row_2 = sheet.createRow(2); - row_2.setHeight((short) 800); - CellRangeAddress region = new CellRangeAddress(2, 2, 0, 2); - sheet.addMergedRegion(region); - for (int i = 0; i < excelTitle.length; i++) { - int ci = i; - if (i > 0) { - ci = i + 2; - } - HSSFCell cell_row2 = row_2.createCell(ci); - cell_row2.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell_row2.setCellValue(text); - } -// System.out.println(jsonObject1); - JSONArray jsonArray_2 = jsonObject1.getJSONArray("child"); -// System.out.println(jsonArray_2); - int totalRowNum = 3; - int[] rowsList = new int[10]; - for (int i = 0; i < jsonArray_2.size(); i++) { - JSONObject jsonObject_3 = jsonArray_2.getJSONObject(i); - JSONArray jsonArray_3 = jsonObject_3.getJSONArray("child"); - rowsList[i] = jsonArray_3.size(); - - totalRowNum += jsonArray_3.size(); - } - - int firstRowNum = 3; - for (int i = 0; i < jsonArray_2.size(); i++) { - JSONObject jsonObject_3 = jsonArray_2.getJSONObject(i); - JSONArray jsonArray_3 = jsonObject_3.getJSONArray("child"); - int nowRowNum = rowsList[i]; - int lastRowNum = 0; - - if (i > 0) { - firstRowNum = firstRowNum + rowsList[i - 1]; - } - lastRowNum = firstRowNum + nowRowNum - 1; - -// System.out.println(firstRowNum); -// System.out.println(lastRowNum); -// System.out.println("==="); - sheet.addMergedRegion(new CellRangeAddress(firstRowNum, lastRowNum, 0, 0)); - sheet.addMergedRegion(new CellRangeAddress(firstRowNum, lastRowNum, 1, 1)); - - HSSFRow row_lvl_2 = sheet.createRow(firstRowNum); - - HSSFCell cell_lvl_2_1 = row_lvl_2.createCell(0); - cell_lvl_2_1.setCellStyle(listStyle); - cell_lvl_2_1.setCellValue(jsonObject_3.get("text").toString()); - - HSSFCell cell_lvl_2_2 = row_lvl_2.createCell(1); - cell_lvl_2_2.setCellStyle(listStyle); - cell_lvl_2_2.setCellValue(df.format((Float.valueOf(jsonObject_3.get("value").toString())/Float.valueOf(jsonObject_3.get("spanrange").toString()))*100)+"分("+jsonObject_3.get("value").toString()+"分)"); - - for (int j = 0; j < jsonArray_3.size(); j++) { - JSONObject jsonObject_4 = jsonArray_3.getJSONObject(j); - - if (j == 0) { - HSSFCell cell_lvl_3_1 = row_lvl_2.createCell(2); - cell_lvl_3_1.setCellStyle(listStyle); - cell_lvl_3_1.setCellValue(jsonObject_4.get("text").toString()); - - HSSFCell cell_lvl_3_2 = row_lvl_2.createCell(3); - cell_lvl_3_2.setCellStyle(listStyle); - cell_lvl_3_2.setCellValue(jsonObject_4.get("spanrange").toString()); - - HSSFCell cell_lvl_3_3 = row_lvl_2.createCell(4); - cell_lvl_3_3.setCellStyle(listStyle); - cell_lvl_3_3.setCellValue(jsonObject_4.get("score").toString()); - - HSSFCell cell_lvl_3_4 = row_lvl_2.createCell(5); - cell_lvl_3_4.setCellStyle(listStyle); - cell_lvl_3_4.setCellValue(jsonObject_4.get("alarmNews").toString().replaceAll("
","\n")); - } else { - HSSFRow row_lvl_3 = sheet.createRow(firstRowNum + j); - - HSSFCell cell_lvl_3_1 = row_lvl_3.createCell(2); - cell_lvl_3_1.setCellStyle(listStyle); - cell_lvl_3_1.setCellValue(jsonObject_4.get("text").toString()); - - HSSFCell cell_lvl_3_2 = row_lvl_3.createCell(3); - cell_lvl_3_2.setCellStyle(listStyle); - cell_lvl_3_2.setCellValue(jsonObject_4.get("spanrange").toString()); - - HSSFCell cell_lvl_3_3 = row_lvl_3.createCell(4); - cell_lvl_3_3.setCellStyle(listStyle); - cell_lvl_3_3.setCellValue(jsonObject_4.get("score").toString()); - - HSSFCell cell_lvl_3_4 = row_lvl_3.createCell(5); - cell_lvl_3_4.setCellStyle(listStyle); - cell_lvl_3_4.setCellValue(jsonObject_4.get("alarmNews").toString().replaceAll("
","\n")); - } - - - } - - } - - HSSFRow row_JRDF = sheet.createRow(totalRowNum); - sheet.addMergedRegion(new CellRangeAddress(totalRowNum, totalRowNum, 1, 5)); - HSSFCell cell_JRDF_1 = row_JRDF.createCell(0); - cell_JRDF_1.setCellStyle(listStyle); - cell_JRDF_1.setCellValue("今日得分"); - HSSFCell cell_JRDF_2 = row_JRDF.createCell(1); - cell_JRDF_2.setCellStyle(listStyle); - cell_JRDF_2.setCellValue(df.format((Float.valueOf(jsonObject1.get("value").toString())/Float.valueOf(jsonObject1.get("spanrange").toString()))*100)+"分("+jsonObject1.get("value").toString()+"分)"); - - HSSFRow row_YXJY = sheet.createRow(totalRowNum + 1); - row_YXJY.setHeight((short) 2000); - sheet.addMergedRegion(new CellRangeAddress(totalRowNum+ 1, totalRowNum+ 1, 1, 5)); - HSSFCell cell_YXJY_1 = row_YXJY.createCell(0); - cell_YXJY_1.setCellStyle(listStyle); - cell_YXJY_1.setCellValue("运行建议"); - HSSFCell cell_YXJY_2 = row_YXJY.createCell(1); - cell_YXJY_2.setCellStyle(listStyle); - cell_YXJY_2.setCellValue(jsonObject1.get("alarmNews").toString().replaceAll("
","\n")); - - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - -} \ No newline at end of file diff --git a/src/com/sipai/service/visual/VisualJspService.java b/src/com/sipai/service/visual/VisualJspService.java deleted file mode 100644 index 1474a536..00000000 --- a/src/com/sipai/service/visual/VisualJspService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.visual; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.visual.VisualJspDao; -import com.sipai.entity.visual.JspElement; -import com.sipai.entity.visual.VisualJsp; -import com.sipai.tools.CommService; -@Service -public class VisualJspService implements CommService{ - - @Resource - private VisualJspDao visualJspDao; - @Resource - private JspElementService jspElementService; - @Override - public VisualJsp selectById(String id) { - return this.visualJspDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - //先删除元素 - List jspElements = this.jspElementService.selectListByWhere(" where pid = '"+id+"'"); - String jspElementIds = ""; - for(int i=0;i selectListByWhere(String wherestr) { - VisualJsp visualJsp= new VisualJsp(); - visualJsp.setWhere(wherestr); - return this.visualJspDao.selectListByWhere(visualJsp); - } - - @Override - public int deleteByWhere(String wherestr) { - VisualJsp visualJsp = new VisualJsp(); - visualJsp.setWhere(wherestr); - return this.visualJspDao.deleteByWhere(visualJsp); - } - - } \ No newline at end of file diff --git a/src/com/sipai/service/whp/baseinfo/WhpEquipmentService.java b/src/com/sipai/service/whp/baseinfo/WhpEquipmentService.java deleted file mode 100644 index 30919d06..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpEquipmentService.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.controller.exception.BizCheckException; -import com.sipai.dao.whp.baseinfo.WhpEquipmentDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpEquipment; -import com.sipai.entity.whp.baseinfo.WhpEquipmentQuery; -import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurve; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.UUID; - -/** - * 设备管理 Service类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Service -public class WhpEquipmentService implements CommService { - @Resource - private WhpEquipmentDao dao; - - @Override - public WhpEquipment selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpEquipment bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpEquipment bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpEquipment bean = new WhpEquipment(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpEquipment bean = new WhpEquipment(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public List queryList(WhpEquipmentQuery query) { - return dao.queryList(query); - } - - - /** - * 业务校验 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public void bizCheck(WhpEquipment bean) throws BizCheckException { - //1. 设备编码不能重复 - String where = " where code ='" + bean.getCode() + "' "; - if (bean.getId() != null) { - where += " and id != '" + bean.getId() + "'"; - } - where += " order by id"; - List WhpEquipmentList = selectListByWhere(where); - if (WhpEquipmentList != null && WhpEquipmentList.size() > 0) { - throw new BizCheckException("设备编码重复!"); - } - - } - - /** - * 存放地址下拉列表 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ - public List addressDropDownList() { - return dao.addressList(); - } - /** - * 设备下拉列表 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ - public List equipmentDropDownList() { - return dao.equipmentDropDownList(); - } - /** - * 设备下拉列表 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ - public List equipmentDropDownListByWhere(String sql) { - WhpEquipment bean = new WhpEquipment(); - bean.setWhere(sql); - return dao.equipmentDropDownListByWhere(bean); - } - - /** - * 名称组装 - * - * @Author: 李晨 - * @Date: 2022/12/30 - **/ - public String selectNamesByIds(String testItemId) { - String result = ""; - - for (String id : testItemId.split(",")) { - - WhpEquipment whpEquipment = selectById(id); - if (whpEquipment!=null){ - result += whpEquipment.getName() + ","; - }else { - result += "未知设备,"; - } - - } - return StringUtils.isNotEmpty(result)?result.substring(0, result.length() - 1):result; - } -} diff --git a/src/com/sipai/service/whp/baseinfo/WhpLiquidWasteDisposeOrgService.java b/src/com/sipai/service/whp/baseinfo/WhpLiquidWasteDisposeOrgService.java deleted file mode 100644 index 1e6aa348..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpLiquidWasteDisposeOrgService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.dao.whp.baseinfo.WhpLiquidWasteDisposeOrgDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrg; -import com.sipai.entity.whp.baseinfo.WhpLiquidWasteDisposeOrgQuery; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Objects; -import java.util.UUID; - -/** - * 废液处理机构Service类 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ -@Service -public class WhpLiquidWasteDisposeOrgService implements CommService { - @Resource - private WhpLiquidWasteDisposeOrgDao dao; - - @Override - public WhpLiquidWasteDisposeOrg selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpLiquidWasteDisposeOrg bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpLiquidWasteDisposeOrg bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpLiquidWasteDisposeOrg bean = new WhpLiquidWasteDisposeOrg(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpLiquidWasteDisposeOrg bean = new WhpLiquidWasteDisposeOrg(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - public List queryList(WhpLiquidWasteDisposeOrgQuery query) { - return dao.queryList(query); - } - - public Result uniqueCheck(WhpLiquidWasteDisposeOrg bean){ - List results = selectListByWhere(" where name ='" + bean.getName() + "' order by id"); - if(Objects.isNull(results)||results.size()==0){ - return Result.success(); - }else if(results.get(0).getId().equals(bean.getId())){ - return Result.success(); - }else { - return Result.failed("机构重复!"); - } - } - -} diff --git a/src/com/sipai/service/whp/baseinfo/WhpResidualSampleDisposeTypeService.java b/src/com/sipai/service/whp/baseinfo/WhpResidualSampleDisposeTypeService.java deleted file mode 100644 index 8ad45ec8..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpResidualSampleDisposeTypeService.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.controller.exception.BizCheckException; -import com.sipai.dao.whp.baseinfo.WhpResidualSampleDisposeTypeDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeType; -import com.sipai.entity.whp.baseinfo.WhpResidualSampleDisposeTypeQuery; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.UUID; - -/** - * 检测机构Service类 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ -@Service -public class WhpResidualSampleDisposeTypeService implements CommService { - @Resource - private WhpResidualSampleDisposeTypeDao dao; - - @Override - public WhpResidualSampleDisposeType selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpResidualSampleDisposeType bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpResidualSampleDisposeType bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpResidualSampleDisposeType bean = new WhpResidualSampleDisposeType(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpResidualSampleDisposeType bean = new WhpResidualSampleDisposeType(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - public List queryList(WhpResidualSampleDisposeTypeQuery query) { - return dao.queryList(query); - } - - public void bizCheck(WhpResidualSampleDisposeType bean) throws BizCheckException { - // 余样处置方式名称不能重复 - String where = " where name ='" + bean.getName() + "' "; - if (bean.getId() != null) { - where += " and id != '" + bean.getId() + "'"; - } - where += " order by id"; - List beans = selectListByWhere(where); - if (beans != null && beans.size() > 0) { - throw new BizCheckException("余样处置方式名称已经存在!"); - } - } - /** - * 样品处置方法下拉列表用 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public List dropDownList() { - return dao.dropDownList(); - } -} diff --git a/src/com/sipai/service/whp/baseinfo/WhpSampleCodeService.java b/src/com/sipai/service/whp/baseinfo/WhpSampleCodeService.java deleted file mode 100644 index 8afa9c3e..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpSampleCodeService.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.controller.exception.BizCheckException; -import com.sipai.dao.whp.baseinfo.WhpSampleCodeDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.whp.baseinfo.WhpSampleCode; -import com.sipai.entity.whp.baseinfo.WhpSampleCodeQuery; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.UUID; - -/** - * 采样编码Service类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Service -public class WhpSampleCodeService implements CommService { - @Resource - private WhpSampleCodeDao dao; - - @Override - public WhpSampleCode selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpSampleCode bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpSampleCode bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpSampleCode bean = new WhpSampleCode(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpSampleCode bean = new WhpSampleCode(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public List queryList(WhpSampleCodeQuery query) { - return dao.queryList(query); - } - - - /** - * 业务校验 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public void bizCheck(WhpSampleCode bean) throws BizCheckException { - //1. 地址不能重复 - //2. 地址编码不能重复 - String where = " where type_id ='" + bean.getTypeId() + "' and prefix ='" + bean.getPrefix() + "' and address_code ='" + bean.getAddressCode() + "' "; - if (bean.getId() != null) { - where += " and id != '" + bean.getId() + "'"; - } - where += " order by id"; - List whpSampleCodes = selectListByWhere(where); - if (whpSampleCodes != null && whpSampleCodes.size() > 0) { - throw new BizCheckException("同一类型下前缀和地点编号已经存在!"); - //return Result.failed("地点或者地点编号已经存在!"); - } - - - //return Result.success(); - } - - -} diff --git a/src/com/sipai/service/whp/baseinfo/WhpSampleTypeService.java b/src/com/sipai/service/whp/baseinfo/WhpSampleTypeService.java deleted file mode 100644 index 0e3035a8..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpSampleTypeService.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.controller.exception.BizCheckException; -import com.sipai.dao.whp.baseinfo.WhpSampleTypeDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import com.sipai.entity.whp.baseinfo.WhpSampleTypeQuery; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.UUID; - -/** - * 采样类型Service类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Service -public class WhpSampleTypeService implements CommService { - @Resource - private WhpSampleTypeDao dao; - - @Override - public WhpSampleType selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpSampleType bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpSampleType bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpSampleType bean = new WhpSampleType(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpSampleType bean = new WhpSampleType(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public List queryList(WhpSampleTypeQuery query) { - return dao.queryList(query); - } - - /** - * 业务校验 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public void bizCheck(WhpSampleType bean) throws BizCheckException { - //1. 采样类型名称不能重复 - //2. 编码简称不能重复 - String where = " where ( name ='" + bean.getName() + "' or code ='" + bean.getCode() + "' )"; - if (bean.getId() != null) { - where += " and id != '" + bean.getId() + "'"; - } - where += " order by id"; - List whpSampleTypes = selectListByWhere(where); - if (whpSampleTypes != null && whpSampleTypes.size() > 0) { - throw new BizCheckException("采样类型名称或者编码简称已经存在!"); - } - } - - /** - * 样品类型下拉列表用 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public List dropDownList() { - return dao.dropDownList(); - } - -} diff --git a/src/com/sipai/service/whp/baseinfo/WhpTestItemService.java b/src/com/sipai/service/whp/baseinfo/WhpTestItemService.java deleted file mode 100644 index 18fceae5..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpTestItemService.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.controller.exception.BizCheckException; -import com.sipai.dao.whp.baseinfo.WhpTestItemDao; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Dept; -import com.sipai.entity.user.Unit; -import com.sipai.entity.whp.baseinfo.WhpTestItem; -import com.sipai.entity.whp.baseinfo.WhpTestItemQuery; -import com.sipai.service.user.UnitService; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.stream.Collectors; - -/** - * 检测项目Service类 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ -@Service -public class WhpTestItemService implements CommService { - @Resource - private WhpTestItemDao dao; - - @Resource - private UnitService unitService; - - @Override - public WhpTestItem selectById(String t) { - - WhpTestItem whpTestItem= dao.selectByPrimaryKey(t); - - if (whpTestItem!=null) { - if (null != whpTestItem.getBizId() && !whpTestItem.getBizId().isEmpty()) { - Company company = this.unitService.getCompById(whpTestItem.getBizId()); - whpTestItem.setCompany(company); - } - } - return whpTestItem; - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpTestItem bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpTestItem bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpTestItem bean = new WhpTestItem(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpTestItem bean = new WhpTestItem(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public List queryList(WhpTestItemQuery query) { - return dao.queryList(query); - } - - - /** - * 业务校验 - * - * @Author: 李晨 - * @Date: 2022/12/16 - **/ - public void bizCheck(WhpTestItem bean) throws BizCheckException { - //1. 检测项目名称不能重复 - String where = " where name ='" + bean.getName() + "'"; - if (bean.getId() != null) { - where += " and id != '" + bean.getId() + "'"; - } - where += " order by id"; - List whpTestItems = selectListByWhere(where); - if (whpTestItems != null && whpTestItems.size() > 0) { - throw new BizCheckException("检测项目名称已经存在!"); - } - } - - /** - * 检测项目下拉列表用 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ - public List testItemDropDownList() { - return dao.testItemDropDownList(); - } - // 检测项目下拉列表用(限定检测项目范围) - public List testItemDropDownList(String testItemIds) { - String conditionInStr="'"+testItemIds.replace(",","','")+"'"; - return dao.testItemDropDownListByRange(conditionInStr); - } - - /** - * 检测部门下拉列表用 - * - * @Author: lichen - * @Date: 2022/12/16 - **/ - public List testOrgDropDownList() { - List resultList = new ArrayList<>(); - String deptIds = dao.testOrgDropDownList(); - String[] deptIdsArr; - if (deptIds != null && deptIds.length() > 0) { - deptIdsArr = deptIds.split(","); - List deptIdList = Arrays.asList(deptIdsArr); - List distinctResult = deptIdList.stream().distinct().collect(Collectors.toList()); - - for (String id : distinctResult) { - EnumJsonObject object = new EnumJsonObject(); - Unit dept = unitService.getUnitById(id); - if (dept != null) { - object.setId(dept.getId()); - object.setText(dept.getName()); - resultList.add(object); - } - - - } - - } - return resultList; - } - - /** - * 根据ids获取检测项目名称 - * - * @Author: lichen - * @Date: 2022/12/20 - **/ - public String getTestItemNamesByIds(String testItemIds) { - String result = ""; - if (StringUtils.isNotEmpty(testItemIds)) { - String[] idArr = testItemIds.split(","); - for (String id : idArr) { - WhpTestItem whpTestItem = selectById(id); - if (whpTestItem == null) { - result += "未知检测项目,"; - } else { - result += whpTestItem.getName() + ","; - } - } - return result.substring(0, result.length() - 1); - } - return result; - } -} diff --git a/src/com/sipai/service/whp/baseinfo/WhpTestItemWorkingCurveService.java b/src/com/sipai/service/whp/baseinfo/WhpTestItemWorkingCurveService.java deleted file mode 100644 index 27b8c0ef..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpTestItemWorkingCurveService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.baseinfo; import cn.hutool.core.util.NumberUtil; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.baseinfo.WhpTestItemWorkingCurveDao; import com.sipai.entity.scada.MPoint; import com.sipai.entity.scada.MPointFormula; import com.sipai.entity.scada.MPointHistory; import com.sipai.entity.scada.MPointPropSource; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurve; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveVo; import com.sipai.service.scada.MPointFormulaService; import com.sipai.service.scada.MPointHistoryService; import com.sipai.service.scada.MPointPropSourceService; import com.sipai.service.scada.MPointService; import com.sipai.tools.CommService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveQuery; import javax.annotation.Resource; import java.io.IOException; import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.*; /** * 方法依据Service类 * * @Author: zxq * @Date: 2023/05/15 **/ @Service public class WhpTestItemWorkingCurveService implements CommService { @Resource private WhpTestItemWorkingCurveDao dao; @Resource private MPointService mPointService; @Resource private MPointFormulaService mPointFormulaService; @Resource private MPointPropSourceService mPointPropSourceService; @Resource private MPointHistoryService mPointHistoryService; @Override public WhpTestItemWorkingCurve selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpTestItemWorkingCurve bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpTestItemWorkingCurve bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpTestItemWorkingCurve bean = new WhpTestItemWorkingCurve(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpTestItemWorkingCurve bean = new WhpTestItemWorkingCurve(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: zxq * @Date: 2023/05/15 **/ public List queryList(WhpTestItemWorkingCurveQuery query) { query.setformulatype(); return dao.queryList(query); } /** * * 业务校验 * * @Author: zxq * @Date: 2023/05/15 **/ public void bizCheck(WhpTestItemWorkingCurve bean) throws BizCheckException { } public List selectListByItem(String testItemId,String formulatype){ List List=selectListByTestItemId(testItemId,formulatype); List listvo=new ArrayList<>(); if(List!=null&&List.size()>0) { for( WhpTestItemWorkingCurve item : List) { WhpTestItemWorkingCurveVo vo = new WhpTestItemWorkingCurveVo(); BeanUtils.copyProperties(item, vo); if(item.getKpi_id()!=null&&!item.getKpi_id().equals("")) { // System.out.println("监测点id:" + item.getKpi_id()); MPoint mPoint=mPointService.selectById(item.getKpi_id()); vo.setMPoint( mPoint); vo.setDefaultValue(item.getDefault_value()); } listvo.add(vo); } } return listvo; } /** * 查询检测点 * @param testItemId * @param formulatype * @param bizid * @param gdid * @param contmap * @return */ public List selectCurveListByItemForm(String testItemId, String formulatype, String bizid, String gdid, Map contmap){ Map proMap=new HashMap<>(); DecimalFormat df = new DecimalFormat("#.00"); //System.out.println(df.format(f)); /** * 查询 项目 曲线配置 */ List List=selectListByTestItemId(testItemId,formulatype); // 若是过程公式 筛选 和过程公式重复的点位 再显示 if (formulatype.equals("2")){ for (int i=0;i< List.size();i++) { proMap.put(List.get(i).getKpi_id(),List.get(i).getKpi_id()); } } List listvo=new ArrayList<>(); if(List!=null&&List.size()>0) { for( WhpTestItemWorkingCurve item : List) { BigDecimal pval=BigDecimal.valueOf(0); WhpTestItemWorkingCurveVo vo = new WhpTestItemWorkingCurveVo(); BeanUtils.copyProperties(item, vo); if(item.getKpi_id()!=null&&!item.getKpi_id().equals("")) { //根据测点 查询 测点详细信息 MPoint mPoint=mPointService.selectById(item.getKpi_id()); if ("NULL".equals(mPoint.getRemark())) { mPoint.setRemark("0"); } String sql=" where pid='"+mPoint.getMpointcode()+"' order by index_details"; //根据测点 查询 计算点信息 List mPointFormulas = this.mPointPropSourceService.selectListByWhere(bizid,sql); List mPointFormulasVO=new ArrayList<>(); if (mPoint!=null) { //查询测点 检测值 List mPointHistoryList = this.mPointHistoryService.selectAggregateList(bizid, "tb_mp_" +mPoint.getMpointcode() , " where userid='" + gdid + "' ", "ItemID, MeasureDT, memotype, memo, userid, insdt"); if(mPointHistoryList!=null&&mPointHistoryList.size()>0) { if (mPoint.getNumtail()!=null&&mPoint.getNumtail()!="") { //mPoint.setParmvalue(mPointHistoryList.get(0).getParmvalue().setScale(Integer.valueOf(mPoint.getNumtail()),BigDecimal.ROUND_HALF_UP)); // mPoint.setParmvalue(NumberUtil.roundHalfEven(mPointHistoryList.get(0).getParmvalue(),Integer.valueOf(mPoint.getNumtail()))); if (mPointHistoryList.get(0).getMemo() != null) { mPoint.setParmvalue(mPointHistoryList.get(0).getParmvalue()); mPoint.setParmvalueStr(mPointHistoryList.get(0).getMemo()); } else { mPoint.setParmvalue(mPointHistoryList.get(0).getParmvalue()); mPoint.setParmvalueStr("0"); } }else{ if (mPointHistoryList.get(0).getMemo() != null) { mPoint.setParmvalue(mPointHistoryList.get(0).getParmvalue()); mPoint.setParmvalueStr(mPointHistoryList.get(0).getMemo()); } else { mPoint.setParmvalue(mPointHistoryList.get(0).getParmvalue()); mPoint.setParmvalueStr("0"); } } }else{ mPoint.setParmvalue(pval); mPoint.setParmvalueStr("0"); } //查询计算点值 Boolean morderIsNull = false; if(mPointFormulas!=null&&mPointFormulas.size()>0) { for (MPointPropSource mPointPropSource:mPointFormulas) { if (mPointPropSource.getMorder() == null) { morderIsNull = true; } List templist = this.mPointHistoryService.selectAggregateList(bizid, "tb_mp_" +mPointPropSource.getMpid() , " where userid='" + gdid + "' ", "ItemID, MeasureDT, memotype, memo, userid, insdt"); if (templist!=null&&templist.size()>0) { if (mPoint.getNumtail()!=null&&mPoint.getNumtail()!="") { mPointPropSource.getmPoint().setParmvalueStr(templist.get(0).getMemo()); mPointPropSource.getmPoint().setParmvalue(templist.get(0).getParmvalue()); // mPointPropSource.getmPoint().setParmvalue(NumberUtil.roundHalfEven(templist.get(0).getParmvalue(),Integer.valueOf(mPoint.getNumtail()))); // mPointPropSource.getmPoint().setParmvalue(templist.get(0).getParmvalue().setScale(Integer.valueOf(mPoint.getNumtail()), BigDecimal.ROUND_HALF_UP)); }else{ mPointPropSource.getmPoint().setParmvalueStr(templist.get(0).getMemo()); mPointPropSource.getmPoint().setParmvalue(templist.get(0).getParmvalue()); } } //去除常量中配置的重复计算点 if (contmap==null&&proMap==null) { mPointFormulasVO.add(mPointPropSource); }else { if((contmap!=null&&contmap.get(mPointPropSource.getmPoint().getMpointcode())!=null)||(proMap!=null&&proMap.get(mPointPropSource.getmPoint().getMpointcode())!=null)) { }else{ mPointFormulasVO.add(mPointPropSource); } } } } if (!morderIsNull) { mPointFormulasVO.sort(Comparator.comparing(MPointPropSource::getMorder)); } mPoint.setmPointPropSource( mPointFormulasVO); } vo.setMPoint( mPoint); } listvo.add(vo); } } return listvo; } /** * 列表查询 根据检测项目主键 * * @Author: zxq * @Date: 2022/12/16 **/ public List selectListByTestItemId(String testItemId,String formulatype) { String sql=" where test_item_id='" + testItemId + "'"; if(formulatype!=null&&!formulatype.equals("")) { sql=sql+" and formulatype in ( "; String[] arr=formulatype.split(","); { for(int i=0;i list= selectListByWhere(sql); if(list!=null&&list.size()>0) { curve=list.get(0); } return curve; } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/baseinfo/WhpTestMethodService.java b/src/com/sipai/service/whp/baseinfo/WhpTestMethodService.java deleted file mode 100644 index be7f4870..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpTestMethodService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.baseinfo; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.baseinfo.WhpTestMethodDao; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.whp.baseinfo.WhpTestMethod; import com.sipai.tools.CommService; import org.springframework.stereotype.Service; import com.sipai.entity.whp.baseinfo.WhpTestMethodQuery; import javax.annotation.Resource; import java.io.IOException; import java.util.List; import java.util.UUID; /** * 方法依据Service类 * * @Author: zxq * @Date: 2023/05/15 **/ @Service public class WhpTestMethodService implements CommService { @Resource private WhpTestMethodDao dao; @Override public WhpTestMethod selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpTestMethod bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpTestMethod bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpTestMethod bean = new WhpTestMethod(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpTestMethod bean = new WhpTestMethod(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: zxq * @Date: 2023/05/15 **/ public List queryList(WhpTestMethodQuery query) { return dao.queryList(query); } /** * 业务校验 * * @Author: zxq * @Date: 2023/05/15 **/ public void bizCheck(WhpTestMethod bean) throws BizCheckException { } public List testMethodDropDownList( String testItem_id) { WhpTestMethodQuery whpTestMethodQuery=new WhpTestMethodQuery(); whpTestMethodQuery.setTestItem_id(testItem_id); List enumJsonObjects = dao.testMethodDropDownList(whpTestMethodQuery); return enumJsonObjects; } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/baseinfo/WhpTestOrgService.java b/src/com/sipai/service/whp/baseinfo/WhpTestOrgService.java deleted file mode 100644 index 9d474cea..00000000 --- a/src/com/sipai/service/whp/baseinfo/WhpTestOrgService.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.sipai.service.whp.baseinfo; - -import com.sipai.dao.whp.baseinfo.WhpTestOrgDao; -import com.sipai.entity.base.Result; -import com.sipai.entity.enums.EnumJsonObject; -import com.sipai.entity.whp.baseinfo.WhpTestOrg; -import com.sipai.entity.whp.baseinfo.WhpTestOrgQuery; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Objects; -import java.util.UUID; - -/** - * 检测机构Service类 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ -@Service -public class WhpTestOrgService implements CommService { - @Resource - private WhpTestOrgDao dao; - - @Override - public WhpTestOrg selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpTestOrg bean) { - bean.setId(UUID.randomUUID().toString()); - return dao.insert(bean); - } - - @Override - public int update(WhpTestOrg bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpTestOrg bean = new WhpTestOrg(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpTestOrg bean = new WhpTestOrg(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/5 - **/ - public List queryList(WhpTestOrgQuery query) { - return dao.queryList(query); - } - - public Result uniqueCheck(WhpTestOrg bean) { - List results = selectListByWhere(" where name ='" + bean.getName() + "' order by id"); - if (Objects.isNull(results) || results.size() == 0) { - return Result.success(); - } else if (results.get(0).getId().equals(bean.getId())) { - return Result.success(); - } else { - return Result.failed("机构重复!"); - } - } - - public List dropDown() { - return dao.dropDown(); - } -} diff --git a/src/com/sipai/service/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogService.java b/src/com/sipai/service/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogService.java deleted file mode 100644 index 9b86781d..00000000 --- a/src/com/sipai/service/whp/liquidWasteDispose/WhpLiquidWasteDisposeLogService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.liquidWasteDispose; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.liquidWasteDispose.WhpLiquidWasteDisposeLogDao; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDisposeLog; import com.sipai.tools.CommService; import org.springframework.stereotype.Service; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDisposeLogQuery; import javax.annotation.Resource; import java.io.IOException; import java.util.List; import java.util.UUID; /** * 方法依据Service类 * * @Author: zxq * @Date: 2023/05/15 **/ @Service public class WhpLiquidWasteDisposeLogService implements CommService { @Resource private WhpLiquidWasteDisposeLogDao dao; @Override public WhpLiquidWasteDisposeLog selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpLiquidWasteDisposeLog bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpLiquidWasteDisposeLog bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpLiquidWasteDisposeLog bean = new WhpLiquidWasteDisposeLog(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpLiquidWasteDisposeLog bean = new WhpLiquidWasteDisposeLog(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: zxq * @Date: 2023/05/15 **/ public List queryList(WhpLiquidWasteDisposeLogQuery query) { return dao.queryList(query); } /** * 业务校验 * * @Author: zxq * @Date: 2023/05/15 **/ public void bizCheck(WhpLiquidWasteDisposeLog bean) throws BizCheckException { } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/liquidWasteDispose/WhpLiquidWasteDisposeService.java b/src/com/sipai/service/whp/liquidWasteDispose/WhpLiquidWasteDisposeService.java deleted file mode 100644 index e8e252fc..00000000 --- a/src/com/sipai/service/whp/liquidWasteDispose/WhpLiquidWasteDisposeService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.liquidWasteDispose; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.liquidWasteDispose.WhpLiquidWasteDisposeDao; import com.sipai.entity.enums.whp.LiquidWasteDisposeStatusEnum; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDispose; import com.sipai.entity.whp.liquidWasteDispose.WhpLiquidWasteDisposeQuery; import com.sipai.tools.CommService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.UUID; /** * 余样处置方式Service类 * * @Author: 李晨 * @Date: 2022/12/20 **/ @Service public class WhpLiquidWasteDisposeService implements CommService { @Resource private WhpLiquidWasteDisposeDao dao; @Override public WhpLiquidWasteDispose selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpLiquidWasteDispose bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpLiquidWasteDispose bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpLiquidWasteDispose bean = new WhpLiquidWasteDispose(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpLiquidWasteDispose bean = new WhpLiquidWasteDispose(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: 李晨 * @Date: 2022/12/20 **/ public List queryList(WhpLiquidWasteDisposeQuery query) { return dao.queryList(query); } /** * 统计当前登记容量 * @param s * @return */ public Float getCurrentNumbCount(WhpLiquidWasteDisposeQuery s) { return dao.getCurrentNumbCount(s); } /** * 统计数量 * @param s * @return */ public Float getNumberCount(WhpLiquidWasteDisposeQuery s) { return dao.getNumberCount(s); } /** * 列表查询(废液处置) * * @Author: 李晨 * @Date: 2022/12/20 **/ public List queryListDispose(WhpLiquidWasteDisposeQuery query) { return dao.queryListDispose(query); } /** * 登记业务校验 * * @Author: 李晨 * @Date: 2022/12/20 **/ public void updateInputBizCheck(WhpLiquidWasteDispose bean) throws BizCheckException { WhpLiquidWasteDispose whpLiquidWasteDispose = selectById(bean.getId()); if(whpLiquidWasteDispose.getStatus()== LiquidWasteDisposeStatusEnum.DISPOSED.getId()){ throw new BizCheckException("不能操作已处置的记录!"); } } /** * 登记业务校验 * * @Author: 李晨 * @Date: 2022/12/20 **/ public void updateInputBatchBizCheck(WhpLiquidWasteDispose bean,int type) throws BizCheckException { WhpLiquidWasteDispose whpLiquidWasteDispose = selectById(bean.getId()); if (type==0) { if (whpLiquidWasteDispose.getStatus() != LiquidWasteDisposeStatusEnum.RECORD.getId()) { throw new BizCheckException("只能操作登记数据!"); } }else{ if (whpLiquidWasteDispose.getStatus() != LiquidWasteDisposeStatusEnum.NON_DISPOSED.getId()) { throw new BizCheckException("只能操作入库数据!"); } } } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/plan/WhpSamplingPlanService.java b/src/com/sipai/service/whp/plan/WhpSamplingPlanService.java deleted file mode 100644 index 01470bc2..00000000 --- a/src/com/sipai/service/whp/plan/WhpSamplingPlanService.java +++ /dev/null @@ -1,298 +0,0 @@ -package com.sipai.service.whp.plan; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.controller.exception.BizCheckException; -import com.sipai.dao.whp.plan.WhpSamplingPlanDao; -import com.sipai.entity.enums.whp.*; -import com.sipai.entity.whp.baseinfo.WhpSampleType; -import com.sipai.entity.whp.baseinfo.WhpTestItem; -import com.sipai.entity.whp.plan.WhpSamplingPlan; -import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; -import com.sipai.entity.whp.plan.WhpSamplingPlanTask; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; -import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItem; -import com.sipai.service.whp.baseinfo.WhpSampleTypeService; -import com.sipai.service.whp.baseinfo.WhpTestItemService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestConfirmService; -import com.sipai.service.whp.test.WhpSamplingPlanTaskTestItemService; -import com.sipai.tools.*; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.net.URLEncoder; -import java.util.*; - -/** - * 采样计划Service类 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ -@Service -public class WhpSamplingPlanService implements CommService { - @Resource - private WhpSampleTypeService whpSampleTypeService; - @Resource - private WhpSamplingPlanTaskTestConfirmService confirmService; - @Resource - private WhpSamplingPlanTaskService whpSamplingPlanTaskService; - @Resource - private WhpTestItemService whpTestItemService; - - @Resource - private WhpSamplingPlanDao dao; - - @Override - public WhpSamplingPlan selectById(String t) { - return dao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - return dao.deleteByPrimaryKey(t); - } - - @Override - public int save(WhpSamplingPlan bean) { - - bean.setId(UUID.randomUUID().toString()); - - if (bean.getSampleTypeName() == null) { - bean.setSampleTypeName(whpSampleTypeService.selectById(bean.getSampleTypeId()).getName()); - } - //状态是草稿 - if (bean.getStatus() == null) { - bean.setStatus(SamplingPlanStatusEnum.TEMPLATE.getId()); - } - return dao.insert(bean); - } - - @Override - public int update(WhpSamplingPlan bean) { - return dao.updateByPrimaryKeySelective(bean); - } - - @Override - public List selectListByWhere(String t) { - WhpSamplingPlan bean = new WhpSamplingPlan(); - bean.setWhere(t); - return dao.selectListByWhere(bean); - } - - @Override - public int deleteByWhere(String t) { - WhpSamplingPlan bean = new WhpSamplingPlan(); - bean.setWhere(t); - return dao.deleteByWhere(bean); - } - - /** - * 列表查询 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - public List queryList(WhpSamplingPlanQuery query) { - return dao.queryList(query); - } - - - - - /** - * 业务校验 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - public void bizCheck(WhpSamplingPlan bean) throws BizCheckException { - - //1. 采样编码不能重复 - String where = " where code ='" + bean.getCode() + "' "; - if (bean.getId() != null) { - where += " and id != '" + bean.getId() + "'"; - } - where += " order by id"; - List samplingPlans = selectListByWhere(where); - if (samplingPlans != null && samplingPlans.size() > 0) { - throw new BizCheckException("当日存在重复的采样计划!"); - } - } - - /** - * 业务校验 - * - * @Author: 李晨 - * @Date: 2022/12/29 - **/ - public int bizBatchCheck(String code) throws BizCheckException { - - //1. 采样编码不能重复 - String where = " where code ='" + code+ "' "; - - List samplingPlans = selectListByWhere(where); - if (samplingPlans!=null) - { - return samplingPlans.size(); - } - return 0; - } - - /** - * 采样单编码 - * - * @Author: lichen - * @Date: 2022/12/29 - **/ - public void code(WhpSamplingPlan bean) { - WhpSampleType whpSampleType = whpSampleTypeService.selectById(bean.getSampleTypeId()); - Date planDate = DateUtil.toDate(bean.getDate()); - bean.setCode(whpSampleType.getCode() + DateUtil.toStr("yyMMdd", planDate)); - } - - /** - * 判断是否采样完成,完成则更新计划的状态。 - * - * @Author: lichen - * @Date: 2022/12/29 - **/ - public void isSamplingPlanTaskDone(String id) { - List list = whpSamplingPlanTaskService.selectListByWhere("where plan_id='" + id + "' and status !='" + SamplingPlanTaskStatusEnum.AUDIT.getId() + "' and is_test=1 order by id desc "); - if (list.size() == 0) { - WhpSamplingPlan plan = new WhpSamplingPlan(); - plan.setId(id); - plan.setStatus(SamplingPlanStatusEnum.SAMPLING_DONE.getId()); - update(plan); - } - } - - /** - * 判断是否测试复核完成,完成则更新计划的状态。 - * - * @Author: lichen - * @Date: 2022/12/29 - **/ - public void isTestConfirmDone(String planId) { - List list = confirmService.selectListByWhere("where plan_id='" + planId + "' and status !='" + SamplingPlanTaskTestConfirmStatusEnum.AUDIT.getId() + "' order by id desc "); - if (list.size() == 0) { - WhpSamplingPlan plan = new WhpSamplingPlan(); - plan.setId(planId); - plan.setStatus(SamplingPlanStatusEnum.AUDIT.getId()); - update(plan); - } - } - - @Resource - private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; - - /** - * 采样计划详细状态拼写 - * - * @Author: lichen - * @Date: 2023/1/10 - **/ - public String writeStatusString(WhpSamplingPlan item) { - if (SamplingPlanStatusEnum.SAMPLING.getId().equals(item.getStatus())) { - String alert = ""; - if (DateUtil.toDate(item.getDate()).before(DateUtil.getDayStartTime(new Date()))) { - alert = "超时预警"; - } - - List all = whpSamplingPlanTaskService.selectListByPlanId(item.getId()); - List done = whpSamplingPlanTaskService.selectListByWhere(" where plan_id='" + item.getId() + "' and status='" + SamplingPlanTaskStatusEnum.AUDIT.getId() + "' order by id desc "); - return SamplingPlanStatusEnum.SAMPLING.getName() + " " + done.size() + "/" + all.size() + " " + alert; - } else if (SamplingPlanStatusEnum.TESTING.getId().equals(item.getStatus())) { - String alert = ""; - if (DateUtil.toDate(item.getReportDate()).before(DateUtil.getDayStartTime(new Date()))) { - alert = "超时预警"; - } - - List all = whpSamplingPlanTaskTestItemService.selectListByWhere(" where plan_id='" + item.getId() + "' order by id desc "); - List done = whpSamplingPlanTaskTestItemService.selectListByWhere(" where plan_id='" + item.getId() + "' and status='" +SamplingPlanTaskTestItemStatusEnum.CONFIRM.getId() + "' order by id desc "); - return SamplingPlanStatusEnum.TESTING.getName() + " " + done.size() + "/" + all.size() + " " + alert; - } - return SamplingPlanStatusEnum.getNameByid(item.getStatus()); - } - /** - * 采样计划详细状态拼写 - * - * @Author: lichen - * @Date: 2023/1/10 - **/ - public Map writeIndexStatusString(PlanIndexJson item) { - Map map=new HashMap<>(); - if (SamplingPlanStatusEnum.TESTING.getId().equals(item.getStatus())) { - - List all = whpSamplingPlanTaskTestItemService.selectListByWhere(" where plan_id='" + item.getId() + "' order by id desc "); - List done = whpSamplingPlanTaskTestItemService.selectListByWhere(" where plan_id='" + item.getId() + "' and status='" +SamplingPlanTaskTestItemStatusEnum.CONFIRM.getId() + "' order by id desc "); - map.put("all", all.size()); - map.put("done",done.size()); - }else{ - List all = whpSamplingPlanTaskService.selectListByPlanId(item.getId()); - map.put("all", all.size()); - map.put("done",0); - - } - - return map; - } - - /** - * - */ - public Integer syncSamplingPlan() { - // 查询检验单未同步已下发的数据 - List whpSamplingPlanTasks = this.selectListByWhere("where status = '" + SamplingPlanStatusEnum.SAMPLING_DONE.getId() + "' and (isSync = '' or isSync is null )"); - ThirdRequestProp thirdRequestProp = (ThirdRequestProp) SpringContextUtil.getBean("thirdRequestProp"); - // 调用老平台接口同步数据 - for (WhpSamplingPlan plan : whpSamplingPlanTasks) { - // 处理数据 - List tasks = whpSamplingPlanTaskService.selectListByPlanId(plan.getId()); - for(WhpSamplingPlanTask task : tasks) { - // 查询itemTest表对应 itemid - if (StringUtils.isNotBlank(task.getTestItemIds())) { - String[] itemIds = task.getTestItemIds().split(","); - String assayItemIds = ""; - String names = ""; - for (String itemId : itemIds) { - WhpTestItem whpTestItem = whpTestItemService.selectById(itemId); - assayItemIds += whpTestItem.getAssayItemId() + ","; - names += whpTestItem.getName() + ","; - } - if (StringUtils.isNotBlank(assayItemIds)) { - task.setAssayItemIdarr(assayItemIds.substring(0, assayItemIds.length() - 1)); - } - if (StringUtils.isNotBlank(names)) { - task.setItemname(names.substring(0, names.length() - 1)); - } - if (StringUtils.isNotBlank(task.getSampleCode())) { - String sampleCode = task.getSampleCode(); - task.setOrd(sampleCode.substring(sampleCode.indexOf("-") + 1, sampleCode.length()).replaceAll("[a-zA-Z]", "")); - } - } - } - plan.setPlantask(tasks); - if (StringUtils.isBlank(plan.getAcceptDate())) { - plan.setAcceptDate(plan.getDate()); - } - try { - HashMap map = new HashMap<>(); - map.put("method", "sampleinto"); - map.put("params", JSONObject.toJSONString(plan)); - String id = HttpUtil.sendPost(thirdRequestProp.getInterfaces(), map); -// if (StringUtils.isNotBlank(id)) { -// plan.setIsSync(id); -// this.update(plan); -// } - } catch (Exception e) { - System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeee"); - System.out.println(plan.getId()); - System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeee"); - } - } - return 0; - } - - -} diff --git a/src/com/sipai/service/whp/plan/WhpSamplingPlanTaskService.java b/src/com/sipai/service/whp/plan/WhpSamplingPlanTaskService.java deleted file mode 100644 index b089a2be..00000000 --- a/src/com/sipai/service/whp/plan/WhpSamplingPlanTaskService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.plan; import com.alibaba.fastjson.JSON; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.plan.WhpSamplingPlanTaskDao; import com.sipai.entity.enums.EnableTypeEnum; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.enums.whp.*; import com.sipai.entity.whp.baseinfo.WhpSampleCode; import com.sipai.entity.whp.baseinfo.WhpSampleType; import com.sipai.entity.whp.plan.WhpSamplingPlan; import com.sipai.entity.whp.plan.WhpSamplingPlanQuery; import com.sipai.entity.whp.plan.WhpSamplingPlanTask; import com.sipai.entity.whp.plan.WhpSamplingPlanTaskQuery; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItem; import com.sipai.service.whp.baseinfo.WhpSampleCodeService; import com.sipai.service.whp.baseinfo.WhpTestItemService; import com.sipai.service.whp.test.WhpSamplingPlanTaskTestItemService; import com.sipai.tools.CommService; import com.sipai.tools.DateUtil; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.List; import java.util.UUID; /** * 采样任务Service类 * * @Author: 李晨 * @Date: 2022/12/30 **/ @Service public class WhpSamplingPlanTaskService implements CommService { @Resource private WhpSampleCodeService sampleCodeService; @Resource private WhpTestItemService whpTestItemService; @Resource private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; @Resource private WhpSamplingPlanTaskDao dao; @Override public WhpSamplingPlanTask selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpSamplingPlanTask bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } public void save(WhpSamplingPlan bean) { List sampleCodeList = sampleCodeService.selectListByWhere(" where type_id='" + bean.getSampleTypeId() + "' and status='" + EnableTypeEnum.Enable.getId() + "' order by id desc"); for (WhpSampleCode source : sampleCodeList) { WhpSamplingPlanTask target = new WhpSamplingPlanTask(); target.setPlanId(bean.getId()); target.setPlanCode(bean.getCode()); target.setSampleAddress(source.getAddress()); // target.setIsTest(Boolean.TRUE); //2023.8.30 修改为根据编码的是否检测 target.setIsTest(source.getIsTest()); target.setTestItemIds(source.getTestItemIds()); target.setStatus(SamplingPlanTaskStatusEnum.TEMPLATE.getId()); target.setPlanDate(bean.getDate()); //命名要求:字母前缀+日期+_+顺序号 Date planDate = DateUtil.toDate(target.getPlanDate()); target.setSampleCode(source.getPrefix() + DateUtil.toStr("yyMMdd", planDate) + "-" + source.getAddressCode()); target.setTestItemJson(JSON.toJSONString(whpTestItemService.testItemDropDownList(source.getTestItemIds()))); target.setSampleTypeId(bean.getSampleTypeId()); target.setSampleTypeName(bean.getSampleTypeName()); target.setReportDate(bean.getReportDate()); target.setDisposeStatus(ResidualSampleDisposeStatusEnum.WAIT.getId()); target.setDeptIds(source.getDeptIds()); target.setDeptNames(source.getDeptNames()); this.save(target); } } /** * 车间采样 新增 接收人即为创建人 状态为采样中 * @param bean */ public void workSave(WhpSamplingPlan bean) { List sampleCodeList = sampleCodeService.selectListByWhere(" where type_id='" + bean.getSampleTypeId() + "' and status='" + EnableTypeEnum.Enable.getId() + "' and is_test='1' order by id desc"); for (WhpSampleCode source : sampleCodeList) { WhpSamplingPlanTask target = new WhpSamplingPlanTask(); target.setPlanId(bean.getId()); target.setReceiverUserId(bean.getCreateUserId()); target.setStatus(SamplingPlanTaskStatusEnum.ING.getId()); target.setPlanCode(bean.getCode()); target.setSampleAddress(source.getAddress()); //target.setIsTest(Boolean.TRUE); target.setIsTest(source.getIsTest()); target.setTestItemIds(source.getTestItemIds()); // target.setStatus(SamplingPlanTaskStatusEnum.TEMPLATE.getId()); target.setPlanDate(bean.getDate()); //命名要求:字母前缀+日期+_+顺序号 Date planDate = DateUtil.toDate(target.getPlanDate()); target.setSampleCode(source.getPrefix() + DateUtil.toStr("yyMMdd", planDate) + "-" + source.getAddressCode()); target.setTestItemJson(JSON.toJSONString(whpTestItemService.testItemDropDownList(source.getTestItemIds()))); target.setSampleTypeId(bean.getSampleTypeId()); target.setSampleTypeName(bean.getSampleTypeName()); target.setReportDate(bean.getReportDate()); target.setDisposeStatus(ResidualSampleDisposeStatusEnum.WAIT.getId()); this.save(target); } } @Override public int update(WhpSamplingPlanTask bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: 李晨 * @Date: 2022/12/30 **/ public List queryList(WhpSamplingPlanTaskQuery query) { return dao.queryList(query); } /** * 业务校验 * * @Author: 李晨 * @Date: 2022/12/30 **/ public void bizCheck(WhpSamplingPlanTask bean) throws BizCheckException { } /** * 采样人下拉 * * @Author: lichen * @Date: 2023/1/3 **/ public List sampleUserDropDown() { return dao.sampleUserDropDown(); } /** * 采样地点下拉 * * @Author: lichen * @Date: 2023/1/3 **/ public List addressDropDown() { return dao.addressDropDown(); } /** * 根据采样单计划查询采样任务 * * @Author: lichen * @Date: 2023/1/3 **/ public List selectListByPlanId(String planid) { return selectListByWhere("where plan_id='" + planid + "' and is_test=1 order by id desc"); } /** * 根据采样单计划删除不检测的采样计划 * * @Author: lichen * @Date: 2023/1/3 **/ public void delByPlanIdNotTest(String planid) { deleteByWhere("where plan_id='" + planid + "' and is_test=0 "); } /** * 下发计划后,采样任务的状态也要提交为执行中 * * @Author: lichen * @Date: 2023/1/3 **/ public void submit(List taskList) { for (WhpSamplingPlanTask item : taskList) { item.setStatus(SamplingPlanTaskStatusEnum.WAIT.getId()); update(item); } } /** * 车间 采样登记完成 采样提交 * * @Author: lichen * @Date: 2023/1/3 **/ public void workSubmit(List taskList) { for (WhpSamplingPlanTask item : taskList) { item.setStatus(SamplingPlanTaskStatusEnum.AUDIT.getId()); update(item); } } /** * 批量下发计划后,采样任务也要批量复制,状态也要提交为执行中 * * @Author: lichen * @Date: 2023/1/3 **/ public void submit(WhpSamplingPlan plan, List taskList) { for (WhpSamplingPlanTask item : taskList) { item.setPlanId(plan.getId()); item.setPlanCode(plan.getCode()); item.setStatus(SamplingPlanTaskStatusEnum.WAIT.getId()); String sampleCode = item.getSampleCode(); String firstPart = sampleCode.split("-")[0]; String planDate = firstPart.substring(firstPart.length() - 6); Date planDateNew = DateUtil.toDate(plan.getDate()); String newPlanDate = DateUtil.toStr("yyMMdd", planDateNew); item.setSampleCode(item.getSampleCode().replace(planDate, newPlanDate)); item.setPlanDate(plan.getDate()); item.setReportDate(plan.getReportDate()); item.setStatus(SamplingPlanTaskStatusEnum.WAIT.getId()); save(item); } } /** * 批量下发计划后,采样任务也要批量复制,状态也要提交为执行中 * * @Author: lichen * @Date: 2023/1/3 **/ public void submitTask(WhpSamplingPlan plan) { List sampleCodeList = sampleCodeService.selectListByWhere(" where type_id='" + plan.getSampleTypeId() + "' and status='" + EnableTypeEnum.Enable.getId() + "' and is_test='1' order by id desc"); for (WhpSampleCode source : sampleCodeList) { WhpSamplingPlanTask target = new WhpSamplingPlanTask(); target.setPlanId(plan.getId()); target.setPlanCode(plan.getCode()); target.setSampleAddress(source.getAddress()); target.setIsTest(source.getIsTest()); target.setTestItemIds(source.getTestItemIds()); // target.setReceiverUserId(plan.getCreateUserId()); target.setStatus(SamplingPlanTaskStatusEnum.WAIT.getId()); target.setPlanDate(plan.getDate()); //命名要求:字母前缀+日期+_+顺序号 Date planDate = DateUtil.toDate(target.getPlanDate()); target.setSampleCode(source.getPrefix() + DateUtil.toStr("yyMMdd", planDate) + "-" + source.getAddressCode()); target.setTestItemJson(JSON.toJSONString(whpTestItemService.testItemDropDownList(source.getTestItemIds()))); target.setSampleTypeId(plan.getSampleTypeId()); target.setSampleTypeName(plan.getSampleTypeName()); target.setReportDate(plan.getReportDate()); target.setDisposeStatus(ResidualSampleDisposeStatusEnum.WAIT.getId()); this.save(target); } } /** * 查询列表,不包含草稿 * * @Author: lichen * @Date: 2023/1/4 **/ public List queryListNoTemplate(WhpSamplingPlanTaskQuery query) { return dao.queryListNoTemplate(query); } /** * 根据采样计划id更新状态 * @Author: lichen * @Date: 2023/1/6 **/ public void updateStatusByPlanId(String planId,int status) { WhpSamplingPlanTask bean = new WhpSamplingPlanTask(); bean.setPlanId(planId); bean.setStatus(status); dao.updateStatusByPlanId(bean); } /** * 根据采样计划id更新状态 * @Author: lichen * @Date: 2023/1/6 **/ public void updateStatusByPlanId(WhpSamplingPlanTask whpSamplingPlanTask) { dao.updateStatusByPlanId(whpSamplingPlanTask); } public String writeStatusString(WhpSamplingPlanTask item) { if (SamplingPlanTaskStatusEnum.ING.getId().equals(item.getStatus())) { List all = whpSamplingPlanTaskTestItemService.selectListByWhere(" where sample_code='" + item.getSampleCode() + "' order by id desc "); List done = whpSamplingPlanTaskTestItemService.selectListByWhere(" where sample_code='" + item.getSampleCode() + "' and status in ('" + SamplingPlanTaskStatusEnum.AUDIT.getId() + "','"+SamplingPlanTaskStatusEnum.REJECTION.getId()+"') order by id desc "); return SamplingPlanTaskStatusEnum.ING.getName() + " " + done.size() + "/" + all.size(); } if (SamplingPlanTaskStatusEnum.TEST.getId().equals(item.getStatus())) { List all = whpSamplingPlanTaskTestItemService.selectListByWhere(" where sample_code='" + item.getSampleCode() + "' order by id desc "); List done = whpSamplingPlanTaskTestItemService.selectListByWhere(" where sample_code='" + item.getSampleCode() + "' and status='" + SamplingPlanTaskTestItemStatusEnum.TEST.getId() + "' order by id desc "); return SamplingPlanTaskStatusEnum.TEST.getName() + " " + done.size() + "/" + all.size(); } return SamplingPlanTaskStatusEnum.getNameByid(item.getStatus()); } /** * 查询 首页 根据时间 统计相关数据 * @param query * @return */ public List queryListPlanTj(WhpSamplingPlanQuery query){ return dao.queryListPlanTj(query); } /** * 查询 首页 项目检测完成 统计相关数据 * @param query * @return */ public List selectItemCount(WhpSamplingPlanQuery query){ return dao.selectItemCount(query); } /** * 根据日期 查询 检测类型 * @param query * @return */ public List selectTypeByDate(WhpSamplingPlanQuery query){ return dao.selectTypeByDate(query); } /** * 根据 月份 查询 时间分组查询 采样计划完成 和总数 * @param query * @return */ public List selectPlanByDate(WhpSamplingPlanQuery query){ return dao.selectPlanByDate(query); } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/test/WhpSamplingPlanTaskTestConfirmService.java b/src/com/sipai/service/whp/test/WhpSamplingPlanTaskTestConfirmService.java deleted file mode 100644 index d0bf1361..00000000 --- a/src/com/sipai/service/whp/test/WhpSamplingPlanTaskTestConfirmService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.test; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.singularsys.jep.functions.Str; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.test.WhpSamplingPlanTaskTestConfirmDao; import com.sipai.entity.enums.EnumJsonObject; import com.sipai.entity.enums.whp.*; import com.sipai.entity.scada.MPointHistory; import com.sipai.entity.whp.baseinfo.WhpTestItem; import com.sipai.entity.whp.baseinfo.WhpTestItemWorkingCurveVo; import com.sipai.entity.whp.baseinfo.WhpTestMethod; import com.sipai.entity.whp.plan.WhpSamplingPlanTask; import com.sipai.entity.whp.test.*; import com.sipai.service.scada.MPointHistoryService; import com.sipai.service.whp.baseinfo.WhpTestItemService; import com.sipai.service.whp.baseinfo.WhpTestItemWorkingCurveService; import com.sipai.service.whp.baseinfo.WhpTestMethodService; import com.sipai.service.whp.plan.WhpSamplingPlanTaskService; import com.sipai.tools.*; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.*; /** * 计划单检测项目分组信息Service类 * * @Author: 李晨 * @Date: 2023/1/5 **/ @Service public class WhpSamplingPlanTaskTestConfirmService implements CommService { @Resource private WhpSamplingPlanTaskTestItemService whpSamplingPlanTaskTestItemService; @Resource private WhpSamplingPlanTaskService whpSamplingPlanTaskService; @Resource private WhpTestItemService whpTestItemService; @Resource private WhpTestItemWorkingCurveService whpTestItemWorkingCurveService; @Resource private MPointHistoryService mPointHistoryService; @Resource private WhpSamplingPlanTaskTestConfirmDao dao; @Resource private WhpTaskItemCurveService whpTaskItemCurveService; @Resource private WhpTestMethodService whpTestMethodService; @Resource private WhpTestItemWorkingCurveService workingCurveService; @Override public WhpSamplingPlanTaskTestConfirm selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpSamplingPlanTaskTestConfirm bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpSamplingPlanTaskTestConfirm bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpSamplingPlanTaskTestConfirm bean = new WhpSamplingPlanTaskTestConfirm(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpSamplingPlanTaskTestConfirm bean = new WhpSamplingPlanTaskTestConfirm(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: 李晨 * @Date: 2023/1/5 **/ public List queryList(WhpSamplingPlanTaskTestConfirmQuery query) { return dao.queryList(query); } /** * 业务校验 * * @Author: 李晨 * @Date: 2023/1/5 **/ public void bizCheck(WhpSamplingPlanTaskTestConfirm bean) throws BizCheckException { } /** * 检测项目树 * * @Author: lichen * @Date: 2023/1/5 **/ public List testItemTree(WhpSamplingPlanTaskTestConfirmQuery query) { return dao.testItemTree(query); } /** * 采样计划详细状态拼写 * * @Author: lichen * @Date: 2023/1/10 **/ public String writeStatusString(WhpSamplingPlanTaskTestConfirm item) { if (SamplingPlanTaskTestConfirmStatusEnum.TEST.getId().equals(item.getStatus())) { String alert = ""; if (DateUtil.toDate(item.getReportDate()).before(DateUtil.getDayStartTime(new Date()))) { alert = "超时预警"; } return SamplingPlanTaskTestConfirmStatusEnum.TEST.getName() + " " + alert; } return SamplingPlanTaskTestConfirmStatusEnum.getNameByid(item.getStatus()); } /** * 采样计划详细状态拼写` * * @Author: lichen * @Date: 2023/1/10 **/ public String writeIndexStatusString(WhpSamplingPlanTaskTestConfirm item) { if (SamplingPlanTaskTestConfirmStatusEnum.TEST.getId().equals(item.getStatus())) { List all = whpSamplingPlanTaskTestItemService.selectListByWhere(" where test_confirm_id='" + item.getId() + "' "); int id = SamplingPlanTaskTestItemStatusEnum.CONFIRM.getId(); List done = whpSamplingPlanTaskTestItemService.selectListByWhere(" where test_confirm_id='" + item.getId() + "' and detected='" + "1" + "' order by id desc "); return SamplingPlanStatusEnum.TESTING.getName() + " " + done.size() + "/" + all.size() ; } return SamplingPlanTaskTestConfirmStatusEnum.getNameByid(item.getStatus()); } /** * 原始记录同步 */ public void syncSamplingPlanTask() { ThirdRequestProp thirdRequestProp = (ThirdRequestProp) SpringContextUtil.getBean("thirdRequestProp"); WhpSamplingPlanTaskTestConfirm whpSamplingPlanTaskTestConfirm = new WhpSamplingPlanTaskTestConfirm(); whpSamplingPlanTaskTestConfirm.setWhere("where (isSync = '' or isSync is null) and status = 5 and plan_code = 'BLGTN230110' "); // 获取主表数据根据采样单号分组 List whpSamplingPlanTaskTestConfirmListVos = dao.selectPlanCodeList(whpSamplingPlanTaskTestConfirm); // 白龙港老项目主表对象集合 ArrayList intorecords = new ArrayList<>(); for (WhpSamplingPlanTaskTestConfirmListVo item : whpSamplingPlanTaskTestConfirmListVos) { // 拿出此单号所有的检测项目 List whpSamplingPlanTaskTestConfirmList = item.getWhpSamplingPlanTaskTestConfirmList(); for (WhpSamplingPlanTaskTestConfirm whpItem : whpSamplingPlanTaskTestConfirmList) { Intorecord intorecord = new Intorecord(); intorecord.setPlace(whpItem.getTestAddress()); // 测定地点 intorecord.setTemperature(String.valueOf(whpItem.getTemperature())); // 室温 intorecord.setAssaydt(whpItem.getTestDate()); // 测定日期 intorecord.setFormula(whpItem.getWorkCurveName()); // 工作曲线 intorecord.setInstrument(whpItem.getEquipmentCode()); // 仪器编号 if (StringUtils.isNotBlank(whpItem.getMethod())) { WhpTestMethod whpTestMethod = whpTestMethodService.selectById(whpItem.getMethod()); if (whpTestMethod != null) { intorecord.setMethods(whpTestMethod.getMethodBasis()); }// 方法依据 } intorecord.setAssayuser(whpItem.getTestUserName()); // 测定人员 intorecord.setCheckuser(whpItem.getConfirmUserName()); // 复核人员 intorecord.setChargeuser(whpItem.getTestUserName()); // 负责人 intorecord.setInsdt(whpItem.getTestDate()); // 新增日期 intorecord.setSampdt(whpItem.getTestDate()); // 采样日期 WhpTestItem whpTestItem = whpTestItemService.selectById(whpItem.getTestItemId()); if (whpTestItem != null) { intorecord.setType(whpTestItem.getAssayItemId()); } //常量 List contantCurves = workingCurveService.selectListByItem(whpItem.getTestItemId(), "1"); if (contantCurves != null && contantCurves.size() > 0) { ArrayList rl = new ArrayList<>(); for (WhpTestItemWorkingCurveVo item1 : contantCurves) { List mPointHistoryList = this.mPointHistoryService.selectAggregateList(item1.getMPoint().getBizid(), "tb_mp_" + item1.getMPoint().getMpointcode(), " where userid='" + item1.getId() + "' ", "*"); if (mPointHistoryList != null && mPointHistoryList.size() > 0) { if (item1.getMPoint().getNumtail() != null) { Recorddet recorddet = new Recorddet(); recorddet.setMpointid(item1.getMPoint().getMpointid()); recorddet.setFieldname(item1.getMPoint().getParmname()); recorddet.setVariabletype("常量"); // recorddet.setParmvalue(String.valueOf(mPointHistoryList.get(0).getParmvalue())); recorddet.setParmvalue(mPointHistoryList.get(0).getMemo()); rl.add(recorddet); } } } intorecord.setRecorddetcl(rl); } // 拿到此检测项目所有的样品信息 List whpSamplingPlanTaskTestItems = whpSamplingPlanTaskTestItemService.selectListByWhere("where test_item_id = '" + whpItem.getTestItemId() + "'"); ArrayList intorecordchildren = new ArrayList<>(); for (WhpSamplingPlanTaskTestItem whpSamplingPlanTaskTestItem : whpSamplingPlanTaskTestItems) { Intorecordchild intorecordchild = new Intorecordchild(); String sampleCode = whpSamplingPlanTaskTestItem.getSampleCode(); intorecordchild.setSerial(sampleCode); // 样品编号 intorecordchild.setOrd(Float.parseFloat(sampleCode.substring(sampleCode.indexOf("-") + 1, sampleCode.length()).replaceAll("[a-zA-Z]", ""))); // 顺序号 Map contaneMap = new HashMap<>(); // 非常量 ArrayList r = new ArrayList<>(); //过程公式 List processCurves = workingCurveService.selectCurveListByItemForm(whpSamplingPlanTaskTestItem.getTestItemId(), "2", "021BLG", whpSamplingPlanTaskTestItem.getId(), contaneMap); if (processCurves != null && processCurves.size() > 0) { for (WhpTestItemWorkingCurveVo item1 : processCurves) { //若检测值不为空 则 替换为最新值 if (item1.getMPoint().getParmvalue() != null) { Recorddet recorddet = new Recorddet(); recorddet.setMpointid(item1.getMPoint().getMpointid()); recorddet.setFieldname(item1.getMPoint().getParmname()); recorddet.setVariabletype("变量"); recorddet.setParmvalue(item1.getMPoint().getParmvalueStr()); r.add(recorddet); } } } /** * 查询结果公式 */ List curve = workingCurveService.selectCurveListByItemForm(whpSamplingPlanTaskTestItem.getTestItemId(), "3", "021BLG", whpSamplingPlanTaskTestItem.getId(), contaneMap); if (curve != null && curve.size() > 0) { WhpTestItemWorkingCurveVo curveVo = curve.get(0); if (curveVo.getKpi_id() != null) // { Recorddet recorddet = new Recorddet(); recorddet.setMpointid(curveVo.getMPoint().getMpointid()); recorddet.setFieldname(curveVo.getMPoint().getParmname()); recorddet.setParmvalue(String.valueOf(curveVo.getMPoint().getParmvalueStr())); recorddet.setVariabletype("变量"); r.add(recorddet); } } // // //查询 基础描述 List basicCurves = workingCurveService.selectListByItem(whpSamplingPlanTaskTestItem.getTestItemId(), "0"); if (basicCurves != null && basicCurves.size() > 0) { for (WhpTestItemWorkingCurveVo item1 : basicCurves) { String sql = " where plan_code= '" + whpSamplingPlanTaskTestItem.getPlanCode() + "' and working_curve_id ='" + item1.getId() + "' AND sample_code ='" + whpSamplingPlanTaskTestItem.getSampleCode() + "'"; List taskItemCurveList = whpTaskItemCurveService.selectListByWhere(sql); //若检测值不为空 则 替换为最新值 if (taskItemCurveList != null && taskItemCurveList.size() > 0) { if (StringUtils.isNotBlank((taskItemCurveList.get(0).getName()))) { Recorddet recorddet = new Recorddet(); recorddet.setFieldname(taskItemCurveList.get(0).getName()); recorddet.setParmvalue(taskItemCurveList.get(0).getCalculated_value()); recorddet.setVariabletype("变量"); r.add(recorddet); } } } } intorecordchild.setRecorddet(r); intorecordchildren.add(intorecordchild); } intorecord.setIntorecordchild(intorecordchildren); HashMap map = new HashMap<>(); map.put("method", "recordinto"); ArrayList json = new ArrayList<>(); json.add(JSONObject.toJSONString(intorecord)); JSONObject jsonObject = new JSONObject(); jsonObject.put("intorecord", json); map.put("params", JSONObject.toJSONString(jsonObject)); String id = HttpUtil.sendPost(thirdRequestProp.getInterfaces(), map); System.out.println(id); if (StringUtils.isNotBlank(id)) { whpItem.setIsSync(id); // this.update(whpItem); } } } System.out.println(whpSamplingPlanTaskTestConfirmListVos.size()); } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/test/WhpSamplingPlanTaskTestItemService.java b/src/com/sipai/service/whp/test/WhpSamplingPlanTaskTestItemService.java deleted file mode 100644 index 45d35e1c..00000000 --- a/src/com/sipai/service/whp/test/WhpSamplingPlanTaskTestItemService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.test; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.test.WhpSamplingPlanTaskTestItemDao; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestConfirm; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItem; import com.sipai.entity.whp.test.WhpSamplingPlanTaskTestItemQuery; import com.sipai.tools.CommService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.UUID; /** * 计划单检测项目记录Service类 * * @Author: 李晨 * @Date: 2023/1/5 **/ @Service public class WhpSamplingPlanTaskTestItemService implements CommService { @Resource private WhpSamplingPlanTaskTestItemDao dao; @Override public WhpSamplingPlanTaskTestItem selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpSamplingPlanTaskTestItem bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpSamplingPlanTaskTestItem bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpSamplingPlanTaskTestItem bean = new WhpSamplingPlanTaskTestItem(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpSamplingPlanTaskTestItem bean = new WhpSamplingPlanTaskTestItem(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: 李晨 * @Date: 2023/1/5 **/ public List queryList(WhpSamplingPlanTaskTestItemQuery query) { return dao.queryList(query); } /** * 业务校验 * * @Author: 李晨 * @Date: 2023/1/5 **/ public void bizCheck(WhpSamplingPlanTaskTestItem bean) throws BizCheckException { } /** * 更新分组id * * @Author: lichen * @Date: 2023/1/5 **/ public void updateConfirmId(WhpSamplingPlanTaskTestConfirm confirm) { dao.updateConfirmId(confirm); } /** * 更新分组状态 * * @Author: lichen * @Date: 2023/1/5 **/ public void updateStatusByConfirmId(WhpSamplingPlanTaskTestItem confirm) { dao.updateStatusByConfirmId(confirm); } /** * 任务数量 * * @Author: lichen * @Date: 2023/1/5 **/ public Integer countByConfirmId(String id) { return selectListByWhere(" where test_confirm_id='" + id + "'").size(); } } \ No newline at end of file diff --git a/src/com/sipai/service/whp/test/WhpTaskItemCurveService.java b/src/com/sipai/service/whp/test/WhpTaskItemCurveService.java deleted file mode 100644 index 8a9c171a..00000000 --- a/src/com/sipai/service/whp/test/WhpTaskItemCurveService.java +++ /dev/null @@ -1 +0,0 @@ -package com.sipai.service.whp.test; import com.sipai.controller.exception.BizCheckException; import com.sipai.dao.whp.test.WhpTaskItemCurveDao; import com.sipai.entity.whp.test.WhpTaskItemCurve; import com.sipai.tools.CommService; import org.springframework.stereotype.Service; import com.sipai.entity.whp.test.WhpTaskItemCurveQuery; import javax.annotation.Resource; import java.io.IOException; import java.util.List; import java.util.UUID; /** * 方法依据Service类 * * @Author: zxq * @Date: 2023/05/15 **/ @Service public class WhpTaskItemCurveService implements CommService { @Resource private WhpTaskItemCurveDao dao; @Override public WhpTaskItemCurve selectById(String t) { return dao.selectByPrimaryKey(t); } @Override public int deleteById(String t) { return dao.deleteByPrimaryKey(t); } @Override public int save(WhpTaskItemCurve bean) { bean.setId(UUID.randomUUID().toString()); return dao.insert(bean); } @Override public int update(WhpTaskItemCurve bean) { return dao.updateByPrimaryKeySelective(bean); } @Override public List selectListByWhere(String t) { WhpTaskItemCurve bean = new WhpTaskItemCurve(); bean.setWhere(t); return dao.selectListByWhere(bean); } @Override public int deleteByWhere(String t) { WhpTaskItemCurve bean = new WhpTaskItemCurve(); bean.setWhere(t); return dao.deleteByWhere(bean); } /** * 列表查询 * * @Author: zxq * @Date: 2023/05/15 **/ public List queryList(WhpTaskItemCurveQuery query) { return dao.queryList(query); } /** * 业务校验 * * @Author: zxq * @Date: 2023/05/15 **/ public void bizCheck(WhpTaskItemCurve bean) throws BizCheckException { } } \ No newline at end of file diff --git a/src/com/sipai/service/work/AlarmTypesService.java b/src/com/sipai/service/work/AlarmTypesService.java deleted file mode 100644 index 01315b16..00000000 --- a/src/com/sipai/service/work/AlarmTypesService.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.AlarmTypesDao; -import com.sipai.entity.work.AlarmTypes; -import com.sipai.tools.CommService; -import net.sf.json.JSONArray; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class AlarmTypesService implements CommService { - @Resource - private AlarmTypesDao alarmTypesDao; - - @Override - public AlarmTypes selectById(String t) { - AlarmTypes alarmTypes = alarmTypesDao.selectByPrimaryKey(t); - if (alarmTypes != null && StringUtils.isNotBlank(alarmTypes.getPid()) && !"-1".equals(alarmTypes.getPid())) { - alarmTypes.setpName(alarmTypesDao.selectByPrimaryKey(alarmTypes.getPid()).getName() + "——" + alarmTypes.getName()); - } - return alarmTypes; - } - - public AlarmTypes selectSimpleById(String t) { - AlarmTypes alarmTypes = alarmTypesDao.selectByPrimaryKey(t); - return alarmTypes; - } - - @Override - public int deleteById(String t) { - return alarmTypesDao.deleteByPrimaryKey(t); - } - - @Override - public int save(AlarmTypes t) { - return alarmTypesDao.insertSelective(t); - } - - @Override - public int update(AlarmTypes t) { - return alarmTypesDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - AlarmTypes alarmTypes = new AlarmTypes(); - alarmTypes.setWhere(t); - List list = alarmTypesDao.selectListByWhere(alarmTypes); - return list; - } - - public List selectSimpleListByWhere(String t) { - AlarmTypes alarmTypes = new AlarmTypes(); - alarmTypes.setWhere(t); - List list = alarmTypesDao.selectListByWhere(alarmTypes); - return list; - } - - @Override - public int deleteByWhere(String t) { - AlarmTypes alarmTypes = new AlarmTypes(); - alarmTypes.setWhere(t); - return alarmTypesDao.deleteByWhere(alarmTypes); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (AlarmTypes k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - //map.put("code", k.getCode()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (AlarmTypes k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - //m.put("code", k.getCode()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/work/AreaManageService.java b/src/com/sipai/service/work/AreaManageService.java deleted file mode 100644 index 6648c976..00000000 --- a/src/com/sipai/service/work/AreaManageService.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.AreaManageDao; -import com.sipai.entity.process.DataVisualFrame; -import com.sipai.entity.user.User; -import com.sipai.entity.work.AreaManage; -import com.sipai.service.process.DataVisualFrameService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class AreaManageService implements CommService { - @Resource - private AreaManageDao areaManageDao; - @Resource - private DataVisualFrameService dataVisualFrameService; - @Resource - private UserService userService; - - - @Override - public AreaManage selectById(String t) { - AreaManage areaManage = areaManageDao.selectByPrimaryKey(t); - if (areaManage != null) { - DataVisualFrame dataVisualFrame = dataVisualFrameService.selectById(areaManage.getFid()); - areaManage.setDataVisualFrame(dataVisualFrame); - if (areaManage.getPowerids() != null) { - String userids = areaManage.getPowerids().replaceAll(",", "','"); - - List users = userService.selectListByWhere("where id in ('" + userids + "') order by name"); - if (users != null && users.size() > 0) { - String _powers = ""; - for (int i = 0; i < users.size(); i++) { - _powers += users.get(i).getCaption() + ","; - } - areaManage.set_powers(_powers); - } - } - if (areaManage.getPid() != null) { - AreaManage pareaManage = areaManageDao.selectByPrimaryKey(areaManage.getPid()); - if (pareaManage != null) { - areaManage.setPname(pareaManage.getName()); - } - } - } - return areaManage; - } - - public AreaManage selectSimpleById(String t) { - AreaManage areaManage = areaManageDao.selectByPrimaryKey(t); - return areaManage; - } - - @Override - public int deleteById(String t) { - return areaManageDao.deleteByPrimaryKey(t); - } - - @Override - public int save(AreaManage t) { - return areaManageDao.insertSelective(t); - } - - @Override - public int update(AreaManage t) { - return areaManageDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - AreaManage areaManage = new AreaManage(); - areaManage.setWhere(t); - List list = areaManageDao.selectListByWhere(areaManage); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - DataVisualFrame dataVisualFrame = dataVisualFrameService.selectById(list.get(i).getFid()); - list.get(i).setDataVisualFrame(dataVisualFrame); - if (list.get(i).getPowerids() != null) { - String userids = list.get(i).getPowerids().replaceAll(",", "','"); - - List users = userService.selectListByWhere("where id in ('" + userids + "') order by name"); - if (users != null && users.size() > 0) { - for (int j = 0; j < users.size(); j++) { - areaManage.set_powers(users.get(j).getCaption() + ","); - } - } - } - - } - } - return list; - } - - public List selectSimpleListByWhere(String t) { - AreaManage areaManage = new AreaManage(); - areaManage.setWhere(t); - List list = areaManageDao.selectListByWhere(areaManage); - return list; - } - - @Override - public int deleteByWhere(String t) { - AreaManage areaManage = new AreaManage(); - areaManage.setWhere(t); - return areaManageDao.deleteByWhere(areaManage); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - - if (list_result == null) { - list_result = new ArrayList>(); - for (AreaManage k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("pid", k.getPid()); - //map.put("code", k.getCode()); - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (AreaManage k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("pid", k.getPid()); - //m.put("code", k.getCode()); - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - -} diff --git a/src/com/sipai/service/work/AutoAlertService.java b/src/com/sipai/service/work/AutoAlertService.java deleted file mode 100644 index 9aaec1d3..00000000 --- a/src/com/sipai/service/work/AutoAlertService.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.AutoAlertDao; -import com.sipai.entity.work.AutoAlert; -import com.sipai.tools.CommService; - -@Service -public class AutoAlertService implements CommService{ - @Resource - private AutoAlertDao autoAlertDao; - @Override - public AutoAlert selectById(String id) { - return autoAlertDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return autoAlertDao.deleteByPrimaryKey(id); - } - - @Override - public int save(AutoAlert entity) { - return autoAlertDao.insert(entity); - } - - @Override - public int update(AutoAlert entity) { - return autoAlertDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - AutoAlert autoAlert = new AutoAlert(); - autoAlert.setWhere(wherestr); - return autoAlertDao.selectListByWhere(autoAlert); - } - - @Override - public int deleteByWhere(String wherestr) { - AutoAlert autoAlert = new AutoAlert(); - autoAlert.setWhere(wherestr); - return autoAlertDao.deleteByWhere(autoAlert); - } - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name) { - List list = this.selectListByWhere(" where name='"+name+"' order by insdt"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(AutoAlert autoAlert :list){ - if(!id.equals(autoAlert.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } - - -} diff --git a/src/com/sipai/service/work/CameraDetailService.java b/src/com/sipai/service/work/CameraDetailService.java deleted file mode 100644 index e1955962..00000000 --- a/src/com/sipai/service/work/CameraDetailService.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.sipai.service.work; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.dao.work.CameraDetailDao; -import com.sipai.entity.hqconfig.WorkModel; -import com.sipai.entity.work.Camera; -import com.sipai.entity.work.CameraDetail; -import com.sipai.entity.work.CameraNVR; -import com.sipai.service.hqconfig.WorkModelService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.*; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -import static org.apache.cxf.version.Version.getName; - -@Service -public class CameraDetailService implements CommService { - - @Resource - CameraDetailDao cameraDetailDao; - - @Resource - CameraService cameraService; - - @Resource - CameraNVRService cameraNVRService; - - @Resource - WorkModelService workModelService; - - @Resource - MPointService mPointService; - - @Override - public CameraDetail selectById(String id) { - CameraDetail data = cameraDetailDao.selectByPrimaryKey(id); - if (StringUtils.isNotBlank(data.getCameraid())) { - data.setCamera(cameraService.selectById(data.getCameraid())); - data.setCameraNVR(cameraNVRService.selectById(data.getCameraid())); - } - if (StringUtils.isNotBlank(data.getAlgorithmid())) { - data.setWorkModel(workModelService.selectById(data.getAlgorithmid())); - } - if (StringUtils.isNotBlank(data.getPointid())) { - data.setmPoint(mPointService.selectById(data.getPointid())); - } - return data; - } - - @Override - public int deleteById(String id) { - return cameraDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CameraDetail entity) { - return this.cameraDetailDao.insert(entity); - } - - @Override - public int update(CameraDetail cameraDetail) { - return cameraDetailDao.updateByPrimaryKeySelective(cameraDetail); - } - - @Override - public List selectListByWhere(String wherestr) { - CameraDetail cameraDetail = new CameraDetail(); - cameraDetail.setWhere(wherestr); - List list = cameraDetailDao.selectListByWhere(cameraDetail); - for (CameraDetail data : list) { - if (StringUtils.isNotBlank(data.getAlgorithmid())) { - data.setWorkModel(workModelService.selectById(data.getAlgorithmid())); - } - if (StringUtils.isNotBlank(data.getCameraid())) { - data.setCamera(cameraService.selectById(data.getCameraid())); - data.setCameraNVR(cameraNVRService.selectById(data.getCameraid())); - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - CameraDetail cameraDetail = new CameraDetail(); - cameraDetail.setWhere(wherestr); - return cameraDetailDao.deleteByWhere(cameraDetail); - } - - public Number selectPointData(String modelId, String carmeraId) { - // 查询启用的模型拿到点位数据 - List cameraDetails = this.selectListByWhere("where algorithmid ='" + modelId + "' and cameraid = '" + carmeraId + "' and status = '1'"); - if (cameraDetails != null && cameraDetails.size() > 0) { - CameraDetail cameraDetail = cameraDetails.get(0); - } - return 0; - } - - public CameraDetail selectByCameraId(String modelId, String cameraId) { - List cameraDetails = this.selectListByWhere("where cameraid = '" + cameraId + "' and algorithmid = '" + modelId + "'"); - if (cameraDetails != null && cameraDetails.size() > 0) { - CameraDetail data = cameraDetails.get(0); - if (StringUtils.isNotBlank(data.getCameraid())) { - data.setCamera(cameraService.selectById(data.getCameraid())); - data.setCameraNVR(cameraNVRService.selectById(data.getCameraid())); - } - if (StringUtils.isNotBlank(data.getAlgorithmid())) { - data.setWorkModel(workModelService.selectById(data.getAlgorithmid())); - } - if (StringUtils.isNotBlank(data.getPointid())) { - data.setmPoint(mPointService.selectById(data.getPointid())); - } - return data; - } - return null; - } - - - public int selectAINumBywhere(String where) { - int num = 0; - List cameraNVRS = cameraNVRService.selectListByWhere(where); - for (CameraNVR item : cameraNVRS) { - Camera camera = cameraService.selectById(item.getId()); - List cameraDetails = selectListByWhere("where cameraid = '" + item.getId() + "'"); - if (cameraDetails != null && cameraDetails.size() > 0) { - num = num + 1; - } - } - return num; - } - - public int selectNumBywhere(String where) { - int num = 0; - List cameraNVRS = cameraNVRService.selectListByWhere(where); - if(cameraNVRS != null && cameraNVRS.size() > 0) { - num = cameraNVRS.size(); - } - return num; - } - public String selectProcesssectionBywhere(String where) { - List cameraNVRS = cameraNVRService.selectListByWhere(where); - if (cameraNVRS != null && cameraNVRS.size() > 0) { - Camera camera = cameraService.selectById(cameraNVRS.get(0).getId()); - if(camera!=null){ - return camera.getProcesssectionid(); - }else{ - return ""; - } - } - return ""; - } - - public List selectAIListByWhere(String where) { - List cameraNVRS = cameraNVRService.selectListByWhere(where); - List cameras = new ArrayList<>(); - for (CameraNVR cameraNVR: cameraNVRS) { - if (cameraNVR == null) { - break; - } - Camera camera = cameraService.selectById(cameraNVR.getId()); - if (camera == null) { - break; - } - List cameraDetails = selectListByWhere("where cameraid = '" + camera.getId() + "'"); - String modelName = ""; - for (CameraDetail cameraDetail: cameraDetails) { - WorkModel workModel = workModelService.selectById(cameraDetail.getAlgorithmid()); - if (workModel != null) { - modelName += workModel.getName() + "、"; - } - } - if (StringUtils.isNotBlank(modelName)) { - camera.setModelNames(modelName.substring(0, modelName.length() - 1)); - cameras.add(camera); - } - } - return cameras; - } - - public int deleteCameraByWhere (String ids) { - int delete = cameraService.deleteByWhere("where id in ('" + ids + "')"); - this.deleteByWhere("where cameraid in ('" + ids + "')"); - cameraNVRService.deleteByWhere("where id in ('" + ids + "')"); - return delete; - } -} diff --git a/src/com/sipai/service/work/CameraFileService.java b/src/com/sipai/service/work/CameraFileService.java deleted file mode 100644 index 97793a1f..00000000 --- a/src/com/sipai/service/work/CameraFileService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.CameraFileDao; -import com.sipai.entity.work.CameraFile; -import com.sipai.tools.CommService; - -@Service -public class CameraFileService implements CommService{ - @Resource - private CameraFileDao cameraFileDao; - @Override - public CameraFile selectById(String id) { - return cameraFileDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return cameraFileDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CameraFile entity) { - return cameraFileDao.insert(entity); - } - - @Override - public int update(CameraFile entity) { - return cameraFileDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - CameraFile cameraFile = new CameraFile(); - cameraFile.setWhere(wherestr); - return cameraFileDao.selectListByWhere(cameraFile); - } - - @Override - public int deleteByWhere(String wherestr) { - CameraFile cameraFile = new CameraFile(); - cameraFile.setWhere(wherestr); - return cameraFileDao.deleteByWhere(cameraFile); - } - -} diff --git a/src/com/sipai/service/work/CameraNVRService.java b/src/com/sipai/service/work/CameraNVRService.java deleted file mode 100644 index bea5339a..00000000 --- a/src/com/sipai/service/work/CameraNVRService.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.CameraNVRDao; -import com.sipai.entity.work.AreaManage; -import com.sipai.entity.work.CameraNVR; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class CameraNVRService implements CommService { - - @Resource - CameraNVRDao cameraNVRDao; - - @Resource - AreaManageService areaManageService; - - @Override - public CameraNVR selectById(String id) { - CameraNVR e = cameraNVRDao.selectByPrimaryKey(id); - if (e != null) { - if (StringUtils.isNotBlank(e.getAreamanageid())) { - AreaManage areaManage = areaManageService.selectById(e.getAreamanageid()); - e.setAreaManage(areaManage); - e.setAreaText(areaManage.getName()); - if (!"-1".equals(areaManage.getPid())) { - AreaManage areaManageP = areaManageService.selectById(areaManage.getPid()); - e.setAreaText(areaManageP.getName() + "——" + areaManage.getName()); - } - } - } - return e; - } - - @Override - public int deleteById(String id) { - return cameraNVRDao.deleteByPrimaryKey(id); - } - - @Override - public int save(CameraNVR entity) { - return this.cameraNVRDao.insert(entity); - } - - @Override - public int update(CameraNVR cameraNVR) { - return cameraNVRDao.updateByPrimaryKeySelective(cameraNVR); - } - - @Override - public List selectListByWhere(String wherestr) { - CameraNVR cameraNVR = new CameraNVR(); - cameraNVR.setWhere(wherestr); - List list = cameraNVRDao.selectListByWhere(cameraNVR); - for (CameraNVR e : list) { - if (StringUtils.isNotBlank(e.getAreamanageid())) { - AreaManage areaManage = areaManageService.selectById(e.getAreamanageid()); - e.setAreaText(areaManage.getName()); - if (!"-1".equals(areaManage.getPid())) { - AreaManage areaManageP = areaManageService.selectById(areaManage.getPid()); - e.setAreaText(areaManageP.getName() + "——" + areaManage.getName()); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - CameraNVR cameraNVR = new CameraNVR(); - cameraNVR.setWhere(wherestr); - return cameraNVRDao.deleteByWhere(cameraNVR); - } -} diff --git a/src/com/sipai/service/work/CameraService.java b/src/com/sipai/service/work/CameraService.java deleted file mode 100644 index d64e5fbc..00000000 --- a/src/com/sipai/service/work/CameraService.java +++ /dev/null @@ -1,652 +0,0 @@ -package com.sipai.service.work; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import com.sipai.entity.base.CommonFile; -import com.sipai.entity.work.CameraDetail; -import com.sipai.service.base.CommonFileService; -import com.sipai.service.base.MinioTemplate; -import com.sipai.tools.CommUtil; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -import com.sipai.dao.work.CameraDao; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.ProcessSection; -import com.sipai.entity.work.Camera; -import com.sipai.service.company.CompanyService; -import com.sipai.service.user.ProcessSectionService; -import com.sipai.tools.CameraCall; -import com.sipai.tools.CommService; -import com.sipai.tools.InitHCNetSDK; -import sun.misc.BASE64Decoder; - -@Service -public class CameraService implements CommService { - - @Resource - private CameraDao cameraDao; - @Resource - private CameraNVRService cameraNVRService; - @Resource - private ProcessSectionService processSectionService; - @Resource - private CompanyService companyService; - @Resource - private MinioTemplate minioTemplate; - @Resource - private CommonFileService commonFileService; - - @Override - public Camera selectById(String id) { - Camera camera = cameraDao.selectByPrimaryKey(id); - if (camera != null && StringUtils.isNotBlank(camera.getId())) { - camera.setCameraNVR(cameraNVRService.selectById(camera.getId())); - } - return camera; - } - - public List selecttoponeById(String wherestr) { - Camera camera = new Camera(); - camera.setWhere(wherestr); - return cameraDao.selecttoponeById(camera); - } - - @Override - public int deleteById(String id) { - return cameraDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Camera entity) { - return this.cameraDao.insert(entity); - } - - @Override - public int update(Camera camera) { - return cameraDao.updateByPrimaryKeySelective(camera); - } - - @Override - public List selectListByWhere(String wherestr) { - Camera camera = new Camera(); - camera.setWhere(wherestr); - List list = cameraDao.selectListByWhere(camera); - return list; - } - - public List selectList_OnlineByWhere(String wherestr) { - Camera camera = new Camera(); - camera.setWhere(wherestr); - List list = cameraDao.selectListByWhere(camera); - if (InitHCNetSDK.cameraUserId > -1) { - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - //System.out.println("---"+Integer.parseInt(list.get(i).getChannel())); - int res = CameraCall.getState(Integer.parseInt(list.get(i).getChannel())); - if (res > 0) { - list.get(i).setOnline(true); - } - camera.setCameraNVR(cameraNVRService.selectById(camera.getId())); - } - } - } else { - //重新登录一次 - //System.out.println("重新登录"); - //InitHCNetSDK.cameraUserId = CameraCall.getUserId("10.28.137.227", "admin", "YH123456789"); - //if (InitHCNetSDK.cameraUserId>-1) { - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - //int res = CameraCall.getState(Integer.parseInt(list.get(i).getChannel())); - //if(res>0){ - list.get(i).setOnline(true); - //} - } - } - //} - } - return list; - } - - public JSONObject getTree(String companyId, String cameraName, String online, HttpServletRequest request) { -// JSONArray jsonArray = new JSONArray(); -// JSONObject jsonObject = new JSONObject(); -// int cameracount = 0; -// int onlinecount = 0; -// int notonlinecount = 0; -// int qiujicount = 0; -// int qiangjicount = 0; -// int shengchancount = 0; -// int anfangcount = 0; -// Company company = companyService.selectByPrimaryKey(companyId); -// if(company == null){ -// company = companyService.selectListByWhere("where pid = '-1'").get(0); -// } -// jsonObject.put("id", company.getId()); -// jsonObject.put("text", company.getName()); -// jsonObject.put("type", "C"); -// if("-1".equals(company.getPid())){ -// List companies = companyService.selectListByWhere("where pid = '"+company.getId()+"'"); -// for(Company company2 : companies){ -// JSONObject jsonObject3 = new JSONObject(); -// jsonObject3.put("id", company2.getId()); -// jsonObject3.put("text", company2.getName()); -// jsonObject3.put("type", "C"); -// List companies2 = companyService.selectListByWhere("where pid = '"+company2.getId()+"'"); -// JSONArray jsonArray3 = new JSONArray(); -// for(Company company3 : companies2){ -// List processSections = this.processSectionService. -// selectListGroupBy("where b.bizId = '"+company3.getId()+"' group by a.id,a.name,a.code,a.morder order by a.name asc"); -// JSONObject jsonObject4 = new JSONObject(); -// jsonObject4.put("id", company3.getId()); -// jsonObject4.put("text", company3.getName()); -// jsonObject4.put("type", "C"); -// JSONArray jsonArray4 = new JSONArray(); -// if(processSections != null && processSections.size()>0){ -// for(ProcessSection p:processSections){ -// JSONObject jsonObjectp = new JSONObject(); -// jsonObjectp.put("id", p.getId()); -// jsonObjectp.put("text", p.getName()); -// jsonObjectp.put("type", "P"); -// String where = "where processsectionid = '"+p.getId().replace(companyId, "").replace("P", "")+"'"; -// if(cameraName!= null && !"".equals(cameraName)){ -// where += " and name like'%"+cameraName+"%' "; -// } -// List list = this.selectList_OnlineByWhere( -// where + " order by name"); -// List> childlist = new ArrayList>(); -// boolean flag = true; -// for(Camera camera:list){ -// cameracount += 1; -// Map m = new HashMap(); -// m.put("id", camera.getId()); -// if(camera.isOnline()){ -// onlinecount += 1; -// if("1".equals(camera.getStyle())){ -// qiujicount += 1; -// m.put("text", ""+camera.getName()+"(在线)"); -// }else{ -// qiangjicount += 1; -// m.put("text", ""+camera.getName()+"(在线)"); -// } -// -// }else{ -// notonlinecount += 1; -// if("1".equals(camera.getStyle())){ -// qiujicount += 1; -// m.put("text", ""+camera.getName()+"(离线)"); -// }else{ -// qiangjicount += 1; -// m.put("text", ""+camera.getName()+"(离线)"); -// } -// } -// m.put("type", "V"); -// m.put("online", camera.isOnline()); -// if(online != null && !"".equals(online)){ -// if(!camera.isOnline()){ -// childlist.add(m); -// } -// }else{ -// childlist.add(m); -// } -// } -// if(childlist.size()>0){ -// jsonObjectp.put("nodes", childlist); -// } -// if(cameraName != null && !"".equals(cameraName)){ -// if(childlist.size()>0){ -// jsonArray4.add(jsonObjectp); -// } -// }else{ -// if(online != null && !"".equals(online)){ -// if(jsonObjectp.opt("nodes")!= null){ -// jsonArray4.add(jsonObjectp); -// } -// }else{ -// jsonArray4.add(jsonObjectp); -// } -// } -// -// } -// } -// List cameras = this.selectList_OnlineByWhere( -// " where bizid = '"+company3.getId()+"' and " -// + "(processsectionid is null or processsectionid = '') order by name"); -// for(Camera camera : cameras){ -// cameracount += 1; -// JSONObject jsonObjectcamera = new JSONObject(); -// jsonObjectcamera.put("id", camera.getId()); -// if(camera.isOnline()){ -// onlinecount += 1; -// if("1".equals(camera.getStyle())){ -// qiujicount += 1; -// jsonObjectcamera.put("text", ""+camera.getName()+"(在线)"); -// }else{ -// qiangjicount += 1; -// jsonObjectcamera.put("text", ""+camera.getName()+"(在线)"); -// } -// -// }else{ -// notonlinecount += 1; -// if("1".equals(camera.getStyle())){ -// qiujicount += 1; -// jsonObjectcamera.put("text", ""+camera.getName()+"(离线)"); -// }else{ -// qiangjicount += 1; -// jsonObjectcamera.put("text", ""+camera.getName()+"(离线)"); -// } -// } -// jsonObjectcamera.put("type", "V"); -// jsonObjectcamera.put("online", camera.isOnline()); -// jsonArray4.add(jsonObjectcamera); -// } -// jsonObject4.put("nodes", jsonArray4); -// jsonArray3.add(jsonObject4); -// } -// jsonObject3.put("nodes", jsonArray3); -// jsonArray.add(jsonObject3); -// } -// } -// jsonObject.put("nodes", jsonArray); -// JSONArray jsonArray2 = new JSONArray(); -// jsonArray2.add(jsonObject); -// //System.out.println(jsonArray2.toString()); -// JSONObject jsonObject2 = new JSONObject(); -// jsonObject2.put("cameracount", cameracount); -// jsonObject2.put("onlinecount", onlinecount); -// jsonObject2.put("notonlinecount", notonlinecount); -// jsonObject2.put("qiujicount", qiujicount); -// jsonObject2.put("qiangjicount", qiangjicount); -// jsonObject2.put("cameras", jsonArray2); -// return jsonObject2.toString(); - JSONObject res = getDiguiTree(companyId, cameraName, online, request); - //System.out.println(res); - return res; - } - - - @Override - public int deleteByWhere(String wherestr) { - Camera camera = new Camera(); - camera.setWhere(wherestr); - return cameraDao.deleteByWhere(camera); - } - - public List getCameras(String wherestr) { - Camera camera = new Camera(); - camera.setWhere(wherestr); - return cameraDao.getCameras(camera); - } - - public JSONObject getDiguiTree(String companyId, String cameraName, String online, HttpServletRequest request) { - JSONArray jsonArray = new JSONArray(); - JSONObject jsonObject = new JSONObject(); - int cameracount = 0; - int onlinecount = 0; - int notonlinecount = 0; - int qiujicount = 0; - int qiangjicount = 0; - int shengchancount = 0; - int anfangcount = 0; - Company company = companyService.selectByPrimaryKey(companyId); - jsonObject.put("id", company.getId()); - jsonObject.put("text", company.getName()); - jsonObject.put("type", "C"); - if ("C".equals(company.getType())) { - List companies = companyService.selectListByWhere - ("where pid = '" + companyId + "' order by morder"); - JSONArray jsonArray2 = new JSONArray(); - for (Company company2 : companies) { - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("id", company2.getId()); - jsonObject2.put("text", company2.getName()); - jsonObject2.put("type", "C"); - if ("B".equals(company2.getType())) { - List processSections = this.processSectionService. - selectListByWhere("where unit_id = '" + company2.getId() + "' order by morder asc"); - JSONArray jsonArray3 = new JSONArray(); - for (ProcessSection processSection : processSections) { - String where = "where processsectionid = '" + processSection.getCode() + "' and bizid='" + company2.getId() + "' "; - if (cameraName != null && !"".equals(cameraName)) { - where += " and name like'%" + cameraName + "%' "; - } - List list = this.selectList_OnlineByWhere( - where + " order by name"); - if (list != null && list.size() > 0) { - JSONObject jsonObjectp = new JSONObject(); - jsonObjectp.put("id", processSection.getId()); - jsonObjectp.put("text", processSection.getSname()); - jsonObjectp.put("type", "P"); - List> childlist = new ArrayList>(); - boolean flag = true; - for (Camera camera : list) { - cameracount += 1; - Map m = new HashMap(); - m.put("id", camera.getId()); - if (camera.isOnline()) { - onlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - m.put("text", "" + camera.getName()); - } else { - qiangjicount += 1; - m.put("text", "" + camera.getName()); - } - - } else { - notonlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - m.put("text", "" + camera.getName() + "(离线)"); - } else { - qiangjicount += 1; - m.put("text", "" + camera.getName() + "(离线)"); - } - } - m.put("type", "V"); - m.put("cameraName", camera.getName()); - m.put("online", camera.isOnline()); - if (online != null && !"".equals(online)) { - if (!camera.isOnline()) { - childlist.add(m); - } - } else { - childlist.add(m); - } - } - if (childlist.size() > 0) { - jsonObjectp.put("nodes", childlist); - } - if (cameraName != null && !"".equals(cameraName)) { - if (childlist.size() > 0) { - jsonArray3.add(jsonObjectp); - } - } else { - if (online != null && !"".equals(online)) { - if (jsonObjectp.opt("nodes") != null) { - jsonArray3.add(jsonObjectp); - } - } else { - jsonArray3.add(jsonObjectp); - } - } - //jsonArray3.add(jsonObjectp); - } - } - - String where = " where bizid = '" + company2.getId() + "' and (processsectionid is null or processsectionid = '')"; - if (cameraName != null && !"".equals(cameraName)) { - where += " and name like'%" + cameraName + "%' "; - } - List cameras = this.selectList_OnlineByWhere(where + " order by name"); - for (Camera camera : cameras) { - cameracount += 1; - JSONObject jsonObjectcamera = new JSONObject(); - jsonObjectcamera.put("id", camera.getId()); - if (camera.isOnline()) { - onlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - jsonObjectcamera.put("text", "" + camera.getName()); - } else { - qiangjicount += 1; - jsonObjectcamera.put("text", "" + camera.getName()); - } - - } else { - notonlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - jsonObjectcamera.put("text", "" + camera.getName() + "(离线)"); - } else { - qiangjicount += 1; - jsonObjectcamera.put("text", "" + camera.getName() + "(离线)"); - } - } - jsonObjectcamera.put("type", "V"); - jsonObjectcamera.put("cameraName", camera.getName()); - jsonObjectcamera.put("online", camera.isOnline()); - jsonArray3.add(jsonObjectcamera); - } - jsonObject2.put("nodes", jsonArray3); - jsonArray2.add(jsonObject2); - } - } - jsonObject.put("nodes", jsonArray2); - } else if ("B".equals(company.getType())) { - List processSections = this.processSectionService. - selectListByWhere("where unit_id = '" + company.getId() + "' order by morder asc"); - JSONArray jsonArray3 = new JSONArray(); - for (ProcessSection processSection : processSections) { - String where = "where processsectionid = '" + processSection.getCode() + "' and bizid='" + company.getId() + "'"; - if (cameraName != null && !"".equals(cameraName)) { - where += " and name like'%" + cameraName + "%' "; - } - List list = this.selectList_OnlineByWhere( - where + " order by name"); - if (list != null && list.size() > 0) { - JSONObject jsonObjectp = new JSONObject(); - jsonObjectp.put("id", processSection.getId()); - jsonObjectp.put("text", processSection.getSname()); - jsonObjectp.put("type", "P"); - List> childlist = new ArrayList>(); - boolean flag = true; - for (Camera camera : list) { - cameracount += 1; - Map m = new HashMap(); - m.put("id", camera.getId()); - if (camera.isOnline()) { - onlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - m.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiuji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(在线)"); - } else { - qiangjicount += 1; - m.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiangji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(在线)"); - } - - } else { - notonlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - m.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiuji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(离线)"); - } else { - qiangjicount += 1; - m.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiangji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(离线)"); - } - } - m.put("type", "V"); - m.put("cameraName", camera.getName()); - m.put("online", camera.isOnline()); - if (online != null && !"".equals(online)) { - if (!camera.isOnline()) { - childlist.add(m); - } - } else { - childlist.add(m); - } - } - if (childlist.size() > 0) { - jsonObjectp.put("nodes", childlist); - } -// if(cameraName != null && !"".equals(cameraName)){ -// if(childlist.size()>0){ -// jsonArray3.add(jsonObjectp); -// } -// }else{ -// if(online != null && !"".equals(online)){ -// if(jsonObjectp.opt("nodes")!= null){ -// jsonArray3.add(jsonObjectp); -// } -// }else{ -// jsonArray3.add(jsonObjectp); -// } -// } - jsonArray3.add(jsonObjectp); - } - } - String where = " where bizid = '" + company.getId() + "' and (processsectionid is null or processsectionid = '')"; - if (cameraName != null && !"".equals(cameraName)) { - where += " and name like'%" + cameraName + "%' "; - } - List cameras = this.selectList_OnlineByWhere(where + " order by name"); - for (Camera camera : cameras) { - cameracount += 1; - JSONObject jsonObjectcamera = new JSONObject(); - jsonObjectcamera.put("id", camera.getId()); - if (camera.isOnline()) { - onlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - jsonObjectcamera.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiuji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(在线)"); - } else { - qiangjicount += 1; - jsonObjectcamera.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiangji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(在线)"); - } - - } else { - notonlinecount += 1; - if ("1".equals(camera.getStyle())) { - qiujicount += 1; - jsonObjectcamera.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiuji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(离线)"); - } else { - qiangjicount += 1; - jsonObjectcamera.put("text", "" + camera.getName()); -// request.getServerPort() + request.getContextPath() + "/" + "IMG/qiangji.svg' style='width:7%;height:auto;margin-right:2px;margin-top:-3px;' alt=''/>" + camera.getName() + "(离线)"); - } - } - jsonObjectcamera.put("type", "V"); - jsonObjectcamera.put("cameraName", camera.getName()); - jsonObjectcamera.put("online", camera.isOnline()); - jsonArray3.add(jsonObjectcamera); - } - jsonObject.put("nodes", jsonArray3); - jsonArray.add(jsonObject); - - } - JSONArray jsonArray2 = new JSONArray(); - jsonArray2.add(jsonObject); - //System.out.println(jsonArray2.toString()); - JSONObject jsonObject2 = new JSONObject(); - jsonObject2.put("cameracount", cameracount); - jsonObject2.put("onlinecount", onlinecount); - jsonObject2.put("notonlinecount", notonlinecount); - jsonObject2.put("qiujicount", qiujicount); - jsonObject2.put("qiangjicount", qiangjicount); - jsonObject2.put("cameras", jsonArray2); - return jsonObject2; - } - - - public int saveImage(String masterId, String imgData, String contentType, String filename, String time,String alarmId) throws Exception { - String nameSpace = "cameraimg"; - String filePath = masterId; - String rid = CommUtil.getUUID(); - -// System.out.println(imgData); - - byte[] b = new BASE64Decoder().decodeBuffer(imgData); - for (int i = 0; i < b.length; ++i) { - if (b[i] < 0) {// 调整异常数据 - b[i] += 256; - } - } - InputStream in = new ByteArrayInputStream(b); - minioTemplate.makeBucket(nameSpace); - minioTemplate.putObject(nameSpace, rid + "_" + filePath + ".jpg", in, null, null, null, contentType); - - CommonFile commonFile = new CommonFile(); - commonFile.setId(CommUtil.getUUID()); - commonFile.setMasterid(masterId); - commonFile.setFilename(filename + ".jpg"); - commonFile.setType(contentType); - commonFile.setAbspath(rid + "_" + filePath + ".jpg"); - commonFile.setInsdt(time); - commonFile.setSize(b.length); - commonFile.setPointId(alarmId); - int res = this.commonFileService.insertByTable2("tb_work_camera_File", commonFile); - return res; - } - - public int savePicFromCameraSys(Camera camera,String alarmId,String insertSt) { - int res = 0; - String url = ""; - { - try { - url = new CommUtil().getProperties("camera.properties", "url"); - } catch (IOException e) { - e.printStackTrace(); - } - } - - String ip = camera.getUrl(); - String username = camera.getUsername(); - String pswd = camera.getPassword(); - String channel = camera.getChannel(); - String brand = camera.getType(); - String nowTime = CommUtil.nowDate(); - - if (!url.equals("")) { - String result = CommUtil.httpURL(url + "/video/getRtspPic.do?ip=" + ip + "&username=" + username + "&password=" + pswd + "&channel=" + channel + "&brand=" + brand + "&definition=standard", ""); - if (!result.equals("fail")) { -// System.out.println(result); - - String[] block = result.split(";"); - String contentType = block[0].split(":")[1];// In this case "image/jpeg" - String imgData = block[1].split(",")[1];// In this case "R0lGODlhPQBEAPeoAJosM...." - - try { - res = saveImage(camera.getId(), imgData, contentType, camera.getName() + "_" + insertSt + "_" + nowTime.substring(0, 19), nowTime,alarmId); -// System.out.println(res); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - return res; - } -} diff --git a/src/com/sipai/service/work/ChannelPortConfigService.java b/src/com/sipai/service/work/ChannelPortConfigService.java deleted file mode 100644 index d414e15e..00000000 --- a/src/com/sipai/service/work/ChannelPortConfigService.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.ChannelPortConfigDao; -import com.sipai.entity.work.AreaManage; -import com.sipai.entity.work.ChannelPortConfig; -import com.sipai.tools.CommService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class ChannelPortConfigService implements CommService { - @Resource - private ChannelPortConfigDao channelPortConfiglDao; - - @Resource - private AreaManageService areaManageService; - - @Override - public ChannelPortConfig selectById(String t) { - ChannelPortConfig config = channelPortConfiglDao.selectByPrimaryKey(t); - // TODO Auto-generated method stub - if (StringUtils.isNotBlank(config.getAddress())){ - AreaManage area = areaManageService.selectById(config.getAddress()); - if (area != null) { - config.setArea(area); - config.setAddress(area.getName()); - if (!"-1".equals(area.getPid())) { - AreaManage area2 = areaManageService.selectById(area.getPid()); - config.setAddress(area2.getName() + "——" + area.getName()); - } - } - else { - config.setAddress(""); - } - } - return config; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return channelPortConfiglDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ChannelPortConfig t) { - // TODO Auto-generated method stub - return channelPortConfiglDao.insertSelective(t); - } - - @Override - public int update(ChannelPortConfig t) { - // TODO Auto-generated method stub - return channelPortConfiglDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - // TODO Auto-generated method stub - ChannelPortConfig channelPortConfig = new ChannelPortConfig(); - channelPortConfig.setWhere(t); - List riskLevels = channelPortConfiglDao.selectListByWhere(channelPortConfig); - for (ChannelPortConfig config : riskLevels) { - if (StringUtils.isNotBlank(config.getAddress())){ - AreaManage area = areaManageService.selectById(config.getAddress()); - if (area != null) { - config.setArea(area); - config.setAddress(area.getName()); - if (!"-1".equals(area.getPid())) { - AreaManage area2 = areaManageService.selectById(area.getPid()); - config.setAddress(area2.getName() + "——" + area.getName()); - } - } - else { - config.setAddress(""); - } - } - } - return riskLevels; - } - - @Override - public int deleteByWhere(String t) { - ChannelPortConfig channelPortConfig = new ChannelPortConfig(); - channelPortConfig.setWhere(t); - return channelPortConfiglDao.deleteByWhere(channelPortConfig); - } -} diff --git a/src/com/sipai/service/work/ElectricityMeterService.java b/src/com/sipai/service/work/ElectricityMeterService.java deleted file mode 100644 index 0d1d06f0..00000000 --- a/src/com/sipai/service/work/ElectricityMeterService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ElectricityMeterDao; -import com.sipai.entity.work.ElectricityMeter; -import com.sipai.tools.CommService; -@Service -public class ElectricityMeterService implements CommService{ - - @Resource - private ElectricityMeterDao electricityMeterDao; - - @Override - public ElectricityMeter selectById(String id) { - return electricityMeterDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return electricityMeterDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ElectricityMeter entity) { - return this.electricityMeterDao.insert(entity); - } - - @Override - public int update(ElectricityMeter electricityMeter) { - return electricityMeterDao.updateByPrimaryKeySelective(electricityMeter); - } - - @Override - public List selectListByWhere(String wherestr) { - ElectricityMeter electricityMeter = new ElectricityMeter(); - electricityMeter.setWhere(wherestr); - List list = electricityMeterDao.selectListByWhere(electricityMeter); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ElectricityMeter electricityMeter = new ElectricityMeter(); - electricityMeter.setWhere(wherestr); - return electricityMeterDao.deleteByWhere(electricityMeter); - } -} diff --git a/src/com/sipai/service/work/GroupContentFormDataService.java b/src/com/sipai/service/work/GroupContentFormDataService.java deleted file mode 100644 index 9f5dbb9a..00000000 --- a/src/com/sipai/service/work/GroupContentFormDataService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupContentFormDataDao; -import com.sipai.entity.work.GroupContentFormData; -import com.sipai.tools.CommService; - -@Service -public class GroupContentFormDataService implements CommService{ - @Resource - private GroupContentFormDataDao groupContentFormDataDao; - - @Override - public GroupContentFormData selectById(String id) { - return groupContentFormDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return groupContentFormDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GroupContentFormData entity) { - return groupContentFormDataDao.insert(entity); - } - - @Override - public int update(GroupContentFormData entity) { - return groupContentFormDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - GroupContentFormData group = new GroupContentFormData(); - group.setWhere(wherestr); - return groupContentFormDataDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - GroupContentFormData group = new GroupContentFormData(); - group.setWhere(wherestr); - return groupContentFormDataDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/GroupContentFormService.java b/src/com/sipai/service/work/GroupContentFormService.java deleted file mode 100644 index 05eb76d2..00000000 --- a/src/com/sipai/service/work/GroupContentFormService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.service.work; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupContentFormDao; -import com.sipai.entity.work.GroupContentForm; -import com.sipai.tools.CommService; - -@Service -public class GroupContentFormService implements CommService{ - @Resource - private GroupContentFormDao groupContentFormDao; - - @Override - public GroupContentForm selectById(String id) { - return groupContentFormDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return groupContentFormDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GroupContentForm entity) { - return groupContentFormDao.insert(entity); - } - - @Override - public int update(GroupContentForm entity) { - return groupContentFormDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - GroupContentForm group = new GroupContentForm(); - group.setWhere(wherestr); - return groupContentFormDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - GroupContentForm group = new GroupContentForm(); - group.setWhere(wherestr); - return groupContentFormDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/GroupContentService.java b/src/com/sipai/service/work/GroupContentService.java deleted file mode 100644 index dc58ec95..00000000 --- a/src/com/sipai/service/work/GroupContentService.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.sipai.service.work; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupContentDao; -import com.sipai.entity.work.GroupContent; -import com.sipai.tools.CommService; - -@Service -public class GroupContentService implements CommService{ - @Resource - private GroupContentDao groupContentDao; - - @Override - public GroupContent selectById(String id) { - return groupContentDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return groupContentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GroupContent entity) { - return groupContentDao.insert(entity); - } - - @Override - public int update(GroupContent entity) { - return groupContentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - GroupContent group = new GroupContent(); - group.setWhere(wherestr); - return groupContentDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - GroupContent group = new GroupContent(); - group.setWhere(wherestr); - return groupContentDao.deleteByWhere(group); - } - - /** - * 获取树 - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - if(list_result == null ) { - list_result = new ArrayList>(); - for(GroupContent k: list) { - if( "-1".equals(k.getPid()) ) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", k.getName()); - map.put("type", k.getType()); - if(k.getType().equals(GroupContent.Type_Point)){ - map.put("icon", "fa fa-th-large"); - } - list_result.add(map); - } - } - getTreeList(list_result,list); - - } else if(list_result.size()>0 && list.size()>0) { - for(Map mp:list_result) { - List> childlist = new ArrayList>(); - for(GroupContent k:list) { - String id = mp.get("id")+""; - String pid = k.getPid()+""; - if(id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", k.getName()); - m.put("type", k.getType()); - if(k.getType().equals(GroupContent.Type_Point)){ - m.put("icon", "fa fa-th-large"); - //m.put("color", "#357ca5"); - }else if(k.getType().equals(GroupContent.Type_Content)){ - m.put("icon", "fa fa-reorder"); - } -// List tags = new ArrayList(); -// tags.add(k.getRemark()); -// m.put("tags", tags); - childlist.add(m); - } - } - if(childlist.size()>0) { - mp.put("nodes", childlist); - getTreeList(childlist,list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/work/GroupDetailService.java b/src/com/sipai/service/work/GroupDetailService.java deleted file mode 100644 index f49de80f..00000000 --- a/src/com/sipai/service/work/GroupDetailService.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.sipai.service.work; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupDetailDao; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupDetail; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class GroupDetailService implements CommService{ - - @Resource - private GroupDetailDao groupDetailDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private GroupTypeService groupTypeService; - - @Override - public GroupDetail selectById(String id) { - GroupDetail groupDetail = this.groupDetailDao.selectByPrimaryKey(id); - if (groupDetail!=null) { - groupDetail.setCompany(this.unitService.getCompById(groupDetail.getUnitId())); - groupDetail.setUser(this.userService.getUserById(groupDetail.getInsuser())); - groupDetail.setGroupType(this.groupTypeService.selectById(groupDetail.getGrouptypeId())); - - if (groupDetail.getLeader()!=null) { - String _leader=""; - String[] leaderArr = groupDetail.getLeader().split(","); - for (int i = 0; i < leaderArr.length; i++) { - User user = this.userService.getUserById(leaderArr[i]); - if (user!=null) { - _leader+=user.getCaption(); - if (i==leaderArr.length-1) { - }else { - _leader+=","; - } - } - } - groupDetail.set_leader(_leader); - } - - if (groupDetail.getMembers()!=null) { - String _members=""; - String[] membersArr = groupDetail.getMembers().split(","); - for (int i = 0; i < membersArr.length; i++) { - User user = this.userService.getUserById(membersArr[i]); - if (user!=null) { - _members+=user.getCaption(); - if (i==membersArr.length-1) { - }else { - _members+=","; - } - } - } - groupDetail.set_members(_members); - } - - } - return groupDetail; - } - - public GroupDetail selectSimpleById(String id) { - GroupDetail groupDetail = this.groupDetailDao.selectByPrimaryKey(id); - return groupDetail; - } - - @Override - public int deleteById(String id) { - int code = this.groupDetailDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(GroupDetail groupDetail) { - int code = this.groupDetailDao.insert(groupDetail); - return code; - } - - @Override - public int update(GroupDetail groupDetail) { - int code = this.groupDetailDao.updateByPrimaryKeySelective(groupDetail); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - GroupDetail groupDetail = new GroupDetail(); - groupDetail.setWhere(wherestr); - List list = this.groupDetailDao.selectListByWhere(groupDetail); - for (GroupDetail item : list) { - item.setCompany(this.unitService.getCompById(item.getUnitId())); - item.setUser(this.userService.getUserById(item.getInsuser())); - item.setGroupType(this.groupTypeService.selectById(item.getGrouptypeId())); - - if (item.getLeader()!=null) { - String _leader=""; - String[] leaderArr = item.getLeader().split(","); - for (int i = 0; i < leaderArr.length; i++) { - User user = this.userService.getUserById(leaderArr[i]); - if (user!=null) { - _leader+=user.getCaption(); - if (i==leaderArr.length-1) { - }else { - _leader+=","; - } - } - } - item.set_leader(_leader); - } - - if (item.getMembers()!=null) { - String _members=""; - String[] membersArr = item.getMembers().split(","); - for (int i = 0; i < membersArr.length; i++) { - User user = this.userService.getUserById(membersArr[i]); - if (user!=null) { - _members+=user.getCaption(); - if (i==membersArr.length-1) { - }else { - _members+=","; - } - } - } - item.set_members(_members); - } - - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - GroupDetail groupDetail = new GroupDetail(); - groupDetail.setWhere(wherestr); - int code = this.groupDetailDao.deleteByWhere(groupDetail); - return code; - } - -} diff --git a/src/com/sipai/service/work/GroupManageService.java b/src/com/sipai/service/work/GroupManageService.java deleted file mode 100644 index 665ba062..00000000 --- a/src/com/sipai/service/work/GroupManageService.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.service.work; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.work.GroupManageDao; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupManage; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; -import com.sun.org.apache.bcel.internal.generic.NEW; - -@Service -public class GroupManageService implements CommService{ - - @Resource - private GroupManageDao groupManageDao; - - @Override - public GroupManage selectById(String id) { - return groupManageDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { -// return groupManageDao.deleteByPrimaryKey(id); - String wherestr ="where id='"+id+"'"; - return groupManageDao.updateDelFlagByWhere(wherestr); - } - - @Override - public int save(GroupManage entity) { - return groupManageDao.insert(entity); - } - - @Transactional - public int update(GroupManage t) { - int result=0; - try{ - int res =this.deleteById(t.getId()); - if(res==1){ - t.setId(CommUtil.getUUID()); - t.setDelflag(false); - result=this.save(t); - } - - }catch(Exception e){ - e.printStackTrace(); - throw new RuntimeException(); - } - return result; - } - - @Override - public List selectListByWhere(String wherestr) { - GroupManage groupManage = new GroupManage(); - groupManage.setWhere(wherestr); - return groupManageDao.selectListByWhere(groupManage); - } - //获取当前使用的班次 - public List selectActivteListByWhere(String wherestr) { - if(wherestr.trim().isEmpty()){ - wherestr="where delflag='1'"; - }else{ - StringBuilder sb=new StringBuilder(); - sb.append(wherestr); - sb.insert(sb.indexOf("where")+5, " delflag <>1 and "); - wherestr=sb.toString(); - } - return this.selectListByWhere(wherestr); - } - @Override - public int deleteByWhere(String wherestr) { -// GroupManage groupManage = new GroupManage(); -// groupManage.setWhere(wherestr); - return groupManageDao.updateDelFlagByWhere(wherestr); - } - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name) { - List list = this.selectListByWhere(" where name='"+name+"' order by insdt"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(GroupManage groupManage :list){ - if(!id.equals(groupManage.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } - - /** - * 按班次获取一天的开始时间和结束时间 - * @param id - * @param name - * @return - */ - public String[] getStartAndEndTime(String date) { - String[] time =new String[2]; - String nowDate ="",tomDate=""; - List list = this.selectListByDate(date); - Collections.sort(list,new Comparator(){ - public int compare(GroupManage arg0, GroupManage arg1) { - return arg0.getSdt().compareTo(arg1.getSdt()); - } - }); - - if(list!=null && list.size()>0){ - nowDate=list.get(0).getSdt(); - tomDate=list.get(list.size()-1).getEdt(); - } - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat df_timer = new SimpleDateFormat("HH:mm:ss"); - try { - Date dt_stdt = df_timer.parse(nowDate); - Date dt_eddt = df_timer.parse(tomDate); - if (dt_stdt.getTime() < dt_eddt.getTime()) { - nowDate = date.substring(0,10)+df.format(dt_stdt).substring(10,19); - tomDate = date.substring(0,10)+df.format(dt_eddt).substring(10,19); - }else{ - nowDate = date.substring(0,10)+df.format(dt_stdt).substring(10,19); - Date datenext=df.parse(nowDate);//取时间 - Calendar calendar = Calendar.getInstance(); - calendar.setTime(datenext); - calendar.add(calendar.DATE,1);//把日期往后增加一天.整数往后推,负数往前移动 - datenext=calendar.getTime(); //这个时间就是日期往后推一天的结果 - tomDate = df.format(datenext).substring(0,10)+df.format(dt_eddt).substring(10,19); - } - }catch(Exception e){ - e.printStackTrace(); - } - time[0]=nowDate; - time[1]=tomDate; - - return time; - } - /** - * 按当前生产时间获取对应工单日期 - * @param time 当前时间 - * @return - */ - public String getWorkOrderDate(String time) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - String nowDate = time.substring(0,10); - String times[] = getStartAndEndTime(nowDate); - double st = df.parse(times[0]).getTime(); - double et = df.parse(times[1]).getTime(); - double nt = df.parse(time).getTime(); - if(st< nt && nt<=et){ - return nowDate; - }else{ - Calendar calendar = Calendar.getInstance(); - calendar.setTime(df.parse(time)); - calendar.add(calendar.DATE,-1);//把日期往前退一天.整数往后推,负数往前移动 - nowDate =df.format(calendar.getTime()).substring(0,10); - return nowDate; - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - //异常则返回当前日期 - String destDate=df.format(new Date()).substring(0,10); - return destDate; - } - public List selectListByDate(String date){ - if(date!=null && !date.isEmpty() && date.length()>10){ - date =date.substring(0,10); - } - return this.groupManageDao.selectListByDate(date); - } - - /*** - * 通过班次id和当前时间获取 班次开始和结束时间 - * @param groupManageid - * @param date - * @return - */ - public String[] getGroupManageStartAndEndTime(String groupManageid,String date) { - String[] time =new String[2]; - GroupManage groupManage = this.selectById(groupManageid); - if(groupManage!=null){ - time[0] = date +" " + groupManage.getSdt(); - //如果结束时间的小时位小于开始时间的小时位,默认跨天 - int sdtHour = Integer.valueOf(groupManage.getSdt().substring(0,2)); - int edtHour = Integer.valueOf(groupManage.getEdt().substring(0,2)); - if(sdtHour>=edtHour){ - //date+1天 - SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); - String nextDate = date; - try { - nextDate = df.format(new Date(df.parse(date).getTime() + 24 * 60 * 60 * 1000)); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - time[1] = nextDate +" "+ groupManage.getEdt(); - }else{ - time[1] = date +" " + groupManage.getEdt(); - } - } - return time; - } -} diff --git a/src/com/sipai/service/work/GroupMemberService.java b/src/com/sipai/service/work/GroupMemberService.java deleted file mode 100644 index 58429cc7..00000000 --- a/src/com/sipai/service/work/GroupMemberService.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.work.GroupMember; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class GroupMemberService implements CommService{ - @Resource - private GroupMemberDao groupMemberDao; - - @Override - public GroupMember selectById(String id) { - return groupMemberDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return groupMemberDao.deleteByPrimaryKey(id); - } - - @Override - public int save(GroupMember entity) { - return groupMemberDao.insert(entity); - } - - @Override - public int update(GroupMember entity) { - return groupMemberDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - return null; - } - - public List getUserid(String wherestr) { - GroupMember groupmenber = new GroupMember(); - groupmenber.setWhere(wherestr); - return groupMemberDao.getUserid(groupmenber); - } - - public List getLeaderForTree(String wherestr) { - GroupMember groupmenber = new GroupMember(); - groupmenber.setWhere(wherestr); - return groupMemberDao.getLeaderForTree(groupmenber); - } - - public List getAll(String wherestr) { - GroupMember groupmenber = new GroupMember(); - groupmenber.setWhere(wherestr); - return groupMemberDao.getAll(groupmenber); - } - - @Override - public int deleteByWhere(String wherestr) { - return 0; - } - - /** - * 按照班组id选择 - * @param groupid - * @return - */ - public List selectListByGroupId(String groupid) { - return groupMemberDao.selectListByGroupId(groupid); - } - - /** - * 按照班组id删除 - * @param groupid - * @return - */ - public int deleteByGroupId(String groupid) { - return groupMemberDao.deleteByGroupId(groupid); - } - - /** - * 保存班组人员 - * @param groupid - * @return - */ - public int saveMembers(String groupid,String members,String usertype) { - int res=0; - GroupMember leader = new GroupMember(); - leader.setGroupid(groupid); - leader.setUsertype(usertype); - String[] leaderids= members.split(","); - for(int i=0;i selectListByScheduling(String wherestr ) { - return groupMemberDao.selectListByScheduling(wherestr); - } - -} diff --git a/src/com/sipai/service/work/GroupService.java b/src/com/sipai/service/work/GroupService.java deleted file mode 100644 index 504a6274..00000000 --- a/src/com/sipai/service/work/GroupService.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupDao; -import com.sipai.dao.work.GroupMemberDao; -import com.sipai.entity.work.Group; -import com.sipai.entity.work.GroupMember; -import com.sipai.tools.CommService; - -@Service -public class GroupService implements CommService{ - @Resource - private GroupDao groupDao; - @Resource - private GroupMemberDao groupMemberDao; - @Override - public Group selectById(String id) { - return groupDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return groupDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Group entity) { - return groupDao.insert(entity); - } - - @Override - public int update(Group entity) { - return groupDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Group group = new Group(); - group.setWhere(wherestr); - return groupDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - Group group = new Group(); - group.setWhere(wherestr); - return groupDao.deleteByWhere(group); - } - /** - * 是否未被占用 - * @param id - * @param name - * @return - */ - public boolean checkNotOccupied(String id, String name) { - List list = this.selectListByWhere(" where name='"+name+"' order by insdt"); - if(id==null){//新增 - if(list!=null && list.size()>0){ - return false; - } - }else{//编辑 - if(list!=null && list.size()>0){ - for(Group group :list){ - if(!id.equals(group.getId())){//不是当前编辑的那条记录 - return false; - } - } - } - } - return true; - } - - public Group getGroupWithMembers( String id ){ - Group group =this.selectById(id); - List members = groupMemberDao.selectListByGroupId(id); - group.setGroupmembers(members); - return group; - } -} diff --git a/src/com/sipai/service/work/GroupTimeService.java b/src/com/sipai/service/work/GroupTimeService.java deleted file mode 100644 index e64d5b48..00000000 --- a/src/com/sipai/service/work/GroupTimeService.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.service.work; - -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; - -import com.sipai.entity.work.GroupManage; -import com.sipai.tools.CommUtil; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupTimeDao; -import com.sipai.entity.work.GroupTime; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class GroupTimeService implements CommService { - - @Resource - private GroupTimeDao groupTimeDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - @Resource - private GroupTypeService groupTypeService; - - @Override - public GroupTime selectById(String id) { - GroupTime groupTime = this.groupTimeDao.selectByPrimaryKey(id); - if (groupTime != null) { - groupTime.setCompany(this.unitService.getCompById(groupTime.getUnitId())); - groupTime.setUser(this.userService.getUserById(groupTime.getInsuser())); - groupTime.setGroupType(this.groupTypeService.selectById(groupTime.getGrouptypeId())); - } - return groupTime; - } - - @Override - public int deleteById(String id) { - int code = this.groupTimeDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(GroupTime groupTime) { - int code = this.groupTimeDao.insert(groupTime); - return code; - } - - @Override - public int update(GroupTime groupTime) { - int code = this.groupTimeDao.updateByPrimaryKeySelective(groupTime); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - GroupTime groupTime = new GroupTime(); - groupTime.setWhere(wherestr); - List list = this.groupTimeDao.selectListByWhere(groupTime); - for (GroupTime item : list) { - item.setCompany(this.unitService.getCompById(item.getUnitId())); - item.setUser(this.userService.getUserById(item.getInsuser())); - item.setGroupType(this.groupTypeService.selectById(item.getGrouptypeId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - GroupTime groupTime = new GroupTime(); - groupTime.setWhere(wherestr); - int code = this.groupTimeDao.deleteByWhere(groupTime); - return code; - } - - //查询某一班次的开始结束时间 - public String[] getGroupTimeStartAndEndTime(String groupTimeid, String date) { - String[] time = new String[2]; - GroupTime groupTime = this.selectById(groupTimeid); - if (groupTime != null) { - if(groupTime.getSdt().length()<=5){ - time[0] = date.substring(0, 10) + " " + groupTime.getSdt(); - }else{ - time[0] = date.substring(0, 10) + " " + groupTime.getSdt().substring(0,5); - } - - int edtAdd = groupTime.getEdtadd(); - String addDate = CommUtil.subplus(date+" 00:00", String.valueOf(edtAdd), "day"); - - if(groupTime.getEdt().length()<=5){ - time[1] = addDate.substring(0, 10) + " " + groupTime.getEdt(); - }else{ - time[1] = addDate.substring(0, 10) + " " + groupTime.getEdt().substring(0,5); - } - - } - return time; - } - - //获取当天的开始结束时间 - public String[] getStartAndEndTime(String date) { - String[] time =new String[2]; - String nowDate ="",tomDate=""; - List list = groupTimeDao.selectListByDate(date); - Collections.sort(list,new Comparator(){ - public int compare(GroupTime arg0, GroupTime arg1) { - return arg0.getSdt().compareTo(arg1.getSdt()); - } - }); - - if(list!=null && list.size()>0){ - nowDate=list.get(0).getSdt(); - tomDate=list.get(list.size()-1).getEdt(); - } - - //数据库字段类型修改导致无法使用 暂时做判断 - if(nowDate.toString().length()<=5){ - nowDate = nowDate+":00.0000000"; - }else{ - System.out.println("开始时间大于5为老版本时间:"+nowDate.toString().length()); - } - - //数据库字段类型修改导致无法使用 暂时做判断 - if(tomDate.toString().length()<=5){ - tomDate = tomDate+":00.0000000"; - }else{ - System.out.println("结束时间大于5为老版本时间:"+tomDate.toString().length()); - } - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat df_timer = new SimpleDateFormat("HH:mm:ss"); - try { - Date dt_stdt = df_timer.parse(nowDate); - Date dt_eddt = df_timer.parse(tomDate); - if (dt_stdt.getTime() < dt_eddt.getTime()) { - nowDate = date.substring(0,10)+df.format(dt_stdt).substring(10,19); - tomDate = date.substring(0,10)+df.format(dt_eddt).substring(10,19); - }else{ - nowDate = date.substring(0,10)+df.format(dt_stdt).substring(10,19); - Date datenext=df.parse(nowDate);//取时间 - Calendar calendar = Calendar.getInstance(); - calendar.setTime(datenext); - calendar.add(calendar.DATE,1);//把日期往后增加一天.整数往后推,负数往前移动 - datenext=calendar.getTime(); //这个时间就是日期往后推一天的结果 - tomDate = df.format(datenext).substring(0,10)+df.format(dt_eddt).substring(10,19); - } - }catch(Exception e){ - e.printStackTrace(); - } - time[0]=nowDate; - time[1]=tomDate; - - return time; - } - -} diff --git a/src/com/sipai/service/work/GroupTypeService.java b/src/com/sipai/service/work/GroupTypeService.java deleted file mode 100644 index fa3e0053..00000000 --- a/src/com/sipai/service/work/GroupTypeService.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.sipai.service.work; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.GroupTypeDao; -import com.sipai.entity.work.GroupType; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class GroupTypeService implements CommService{ - - @Resource - private GroupTypeDao groupTypeDao; - @Resource - private UserService userService; - @Resource - private UnitService unitService; - - @Override - public GroupType selectById(String id) { - GroupType groupType = this.groupTypeDao.selectByPrimaryKey(id); - if (groupType!=null) { - groupType.setUser(this.userService.getUserById(groupType.getInsuser())); - } - return groupType; - } - - @Override - public int deleteById(String id) { - int code = this.groupTypeDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(GroupType groupType) { - int code = this.groupTypeDao.insert(groupType); - return code; - } - - @Override - public int update(GroupType groupType) { - int code = this.groupTypeDao.updateByPrimaryKeySelective(groupType); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - GroupType groupType = new GroupType(); - groupType.setWhere(wherestr); - List list = this.groupTypeDao.selectListByWhere(groupType); - for (GroupType item : list) { - item.setUser(this.userService.getUserById(item.getInsuser())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - GroupType groupType = new GroupType(); - groupType.setWhere(wherestr); - int code = this.groupTypeDao.deleteByWhere(groupType); - return code; - } - -} diff --git a/src/com/sipai/service/work/KPIPointProfessorParamService.java b/src/com/sipai/service/work/KPIPointProfessorParamService.java deleted file mode 100644 index 84830dd9..00000000 --- a/src/com/sipai/service/work/KPIPointProfessorParamService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.KPIPointProfessorParamDao; - -import com.sipai.entity.work.KPIPointProfessorParam; -import com.sipai.tools.CommService; - -@Service -public class KPIPointProfessorParamService implements CommService{ - @Resource - private KPIPointProfessorParamDao kPIPointProfessorParamDao; - @Override - public KPIPointProfessorParam selectById(String id) { - return kPIPointProfessorParamDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return kPIPointProfessorParamDao.deleteByPrimaryKey(id); - } - - @Override - public int save(KPIPointProfessorParam entity) { - return kPIPointProfessorParamDao.insert(entity); - } - - @Override - public int update(KPIPointProfessorParam entity) { - return kPIPointProfessorParamDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - KPIPointProfessorParam group = new KPIPointProfessorParam(); - group.setWhere(wherestr); - return kPIPointProfessorParamDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - KPIPointProfessorParam group = new KPIPointProfessorParam(); - group.setWhere(wherestr); - return kPIPointProfessorParamDao.deleteByWhere(group); - } - - - -} diff --git a/src/com/sipai/service/work/KPIPointProfessorService.java b/src/com/sipai/service/work/KPIPointProfessorService.java deleted file mode 100644 index d869b411..00000000 --- a/src/com/sipai/service/work/KPIPointProfessorService.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.KPIPointProfessorDao; -import com.sipai.entity.work.KPIPointProfessor; -import com.sipai.tools.CommService; - -@Service -public class KPIPointProfessorService implements CommService{ - @Resource - private KPIPointProfessorDao kPIPointProfessorDao; - @Override - public KPIPointProfessor selectById(String id) { - return kPIPointProfessorDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return kPIPointProfessorDao.deleteByPrimaryKey(id); - } - - @Override - public int save(KPIPointProfessor entity) { - return kPIPointProfessorDao.insert(entity); - } - - @Override - public int update(KPIPointProfessor entity) { - return kPIPointProfessorDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - KPIPointProfessor group = new KPIPointProfessor(); - group.setWhere(wherestr); - return kPIPointProfessorDao.selectListByWhere(group); - } - /** - * 不同专家建议合并 - * @param wherestr - * @return - */ - public List getListByWhere(String wherestr) { - String whereStr_Alarm=""; - if (wherestr!=null && !wherestr.isEmpty()) { - whereStr_Alarm= " where flag='"+KPIPointProfessor.Flag_Yes+"' and "+wherestr.replace("where", ""); - if (!wherestr.contains("order")) { - whereStr_Alarm+=" order by insdt desc "; - } - } - List professorAlarms =this.selectListByWhere(whereStr_Alarm); - for (KPIPointProfessor professorAlarm : professorAlarms) { - String whereStr_Alarm_Recover = "where insdt>'"+professorAlarm.getInsdt()+ - "' and aid ='"+professorAlarm.getAid()+"' and flag <>'"+KPIPointProfessor.Flag_Yes+"' order by insdt asc"; - List professorAlarms_ =this.selectListByWhere(whereStr_Alarm_Recover); - if (professorAlarms_.size()>0) { - for (KPIPointProfessor item : professorAlarms_) { - professorAlarm.setFlag(item.getFlag()); - professorAlarm.setInsdt(item.getInsdt()); - //若检测到恢复建议 - if (KPIPointProfessor.Flag_Recover.equals(item.getFlag())) { - break; - } - } - } - } - return professorAlarms; - } - - @Override - public int deleteByWhere(String wherestr) { - KPIPointProfessor group = new KPIPointProfessor(); - group.setWhere(wherestr); - return kPIPointProfessorDao.deleteByWhere(group); - } - - - -} diff --git a/src/com/sipai/service/work/KPIPointService.java b/src/com/sipai/service/work/KPIPointService.java deleted file mode 100644 index c6442d47..00000000 --- a/src/com/sipai/service/work/KPIPointService.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.sipai.service.work; -import com.sipai.dao.work.KPIPointDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointProp; -import com.sipai.entity.scada.MPointPropSource; -import com.sipai.entity.work.KPIPoint; -import com.sipai.service.scada.MPointPropService; -import com.sipai.service.scada.MPointPropSourceService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class KPIPointService implements CommService{ - @Resource - private KPIPointDao kPIPointDao; - @Resource - private MPointService mPointService; - @Resource - private MPointPropService mPointPropService; - @Resource - private MPointPropSourceService mPointPropSourceService; - - @Override - public KPIPoint selectById(String id) { - return kPIPointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return kPIPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(KPIPoint entity) { - return kPIPointDao.insert(entity); - } - - @Override - public int update(KPIPoint entity) { - return kPIPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - KPIPoint group = new KPIPoint(); - group.setWhere(wherestr); - return kPIPointDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - KPIPoint group = new KPIPoint(); - group.setWhere(wherestr); - return kPIPointDao.deleteByWhere(group); - } - - public Map getMPointTree(String mpointId, String type) { - Map map = new HashMap(); - MPoint mPoint = this.mPointService.selectById(mpointId); - if(mPoint != null) { - map.put("id", mPoint.getId()); - map.put("name", mPoint.getParmname()); - map.put("type", mPoint.getSourceType()); - map.put("mpcode", mPoint.getMpointcode()); - map.put("bizid", mPoint.getBizid()); - map.put("value", mPoint.getParmvalue()); - map.put("unit", mPoint.getUnit()); - map.put("forcemax", mPoint.getForcemax()); - // 若是KPI - if(MPoint.Flag_Type_KPI.equals(type)) { - if(type.equals(mPoint.getSourceType())) { - List mPointProp = this.mPointPropService.selectByPid(mPoint.getBizid(), mPoint.getId()); - if(mPointProp.size() != 0) { - map.put("formula", mPointProp.get(0).getEvaluationFormula()); - } - - List> childlist = new ArrayList>(); - //非es查询MPointPropSource - String whereStr = " where pid = '"+ mPoint.getId() +"'"; - if("FSCCSK_KPI_GYZST".equals(mPoint.getId()) || "FSCCSK_KPI_SBZST".equals(mPoint.getId())){ - whereStr += " order by insdt"; - } - List sourceList = this.mPointPropSourceService.selectListByWhereNoname(mPoint.getBizid(), whereStr); - for (int i = 0; i < sourceList.size(); i++) { - Map childMap = this.getMPointTree(sourceList.get(i).getMpid(), type); - childMap.put("sourceId",sourceList.get(i).getId()); - childlist.add(childMap); - } - if(childlist.size() > 0) { - map.put("children", childlist); - } - } - } - } - return map; - } - - -} diff --git a/src/com/sipai/service/work/LagerScreenConfigureDetailService.java b/src/com/sipai/service/work/LagerScreenConfigureDetailService.java deleted file mode 100644 index 03650eb0..00000000 --- a/src/com/sipai/service/work/LagerScreenConfigureDetailService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.LagerScreenConfigureDetailDao; -import com.sipai.entity.work.LagerScreenConfigureDetail; -import com.sipai.tools.CommService; - -@Service -public class LagerScreenConfigureDetailService implements CommService{ - @Resource - private LagerScreenConfigureDetailDao lagerScreenConfigureDetailDao; - @Override - public LagerScreenConfigureDetail selectById(String id) { - return lagerScreenConfigureDetailDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return lagerScreenConfigureDetailDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LagerScreenConfigureDetail entity) { - return lagerScreenConfigureDetailDao.insert(entity); - } - - @Override - public int update(LagerScreenConfigureDetail entity) { - return lagerScreenConfigureDetailDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LagerScreenConfigureDetail lagerScreenConfigureDetail = new LagerScreenConfigureDetail(); - lagerScreenConfigureDetail.setWhere(wherestr); - return lagerScreenConfigureDetailDao.selectListByWhere(lagerScreenConfigureDetail); - } - - @Override - public int deleteByWhere(String wherestr) { - LagerScreenConfigureDetail lagerScreenConfigureDetail = new LagerScreenConfigureDetail(); - lagerScreenConfigureDetail.setWhere(wherestr); - return lagerScreenConfigureDetailDao.deleteByWhere(lagerScreenConfigureDetail); - } -} diff --git a/src/com/sipai/service/work/LagerScreenConfigureService.java b/src/com/sipai/service/work/LagerScreenConfigureService.java deleted file mode 100644 index 96f3077f..00000000 --- a/src/com/sipai/service/work/LagerScreenConfigureService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.LagerScreenConfigureDao; -import com.sipai.entity.work.LagerScreenConfigure; -import com.sipai.tools.CommService; - -@Service -public class LagerScreenConfigureService implements CommService{ - @Resource - private LagerScreenConfigureDao lagerScreenConfigureDao; - @Override - public LagerScreenConfigure selectById(String id) { - return lagerScreenConfigureDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return lagerScreenConfigureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(LagerScreenConfigure entity) { - return lagerScreenConfigureDao.insert(entity); - } - - @Override - public int update(LagerScreenConfigure entity) { - return lagerScreenConfigureDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - LagerScreenConfigure lagerScreenConfigure = new LagerScreenConfigure(); - lagerScreenConfigure.setWhere(wherestr); - return lagerScreenConfigureDao.selectListByWhere(lagerScreenConfigure); - } - - @Override - public int deleteByWhere(String wherestr) { - LagerScreenConfigure lagerScreenConfigure = new LagerScreenConfigure(); - lagerScreenConfigure.setWhere(wherestr); - return lagerScreenConfigureDao.deleteByWhere(lagerScreenConfigure); - } -} diff --git a/src/com/sipai/service/work/LagerScreenDataService.java b/src/com/sipai/service/work/LagerScreenDataService.java deleted file mode 100644 index 11d36d04..00000000 --- a/src/com/sipai/service/work/LagerScreenDataService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.service.work; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.work.LagerScreenDataDao; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.scada.ScadaAlarm; -import com.sipai.entity.work.LagerScreenData; -import com.sipai.entity.work.LagerScreenData; -import com.sipai.tools.DateSpan; -import com.sipai.tools.DateUtil; - -@Service -public class LagerScreenDataService { - @Resource - private LagerScreenDataDao lagerScreenDataDao; - - - public List selectListByWhere(String wherestr) { - LagerScreenData lagerScreenData = new LagerScreenData(); - lagerScreenData.setWhere(wherestr); - return lagerScreenDataDao.selectListByWhere(lagerScreenData); - } - - -} diff --git a/src/com/sipai/service/work/MPointHisChangeDataService.java b/src/com/sipai/service/work/MPointHisChangeDataService.java deleted file mode 100644 index 56d7f9cb..00000000 --- a/src/com/sipai/service/work/MPointHisChangeDataService.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.sipai.service.work; - -import java.util.List; - -import javax.annotation.Resource; - -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.MPointHisChangeDataDao; -import com.sipai.entity.work.MPointHisChangeData; -import com.sipai.tools.CommService; - -@Service -public class MPointHisChangeDataService implements CommService { - @Resource - private MPointHisChangeDataDao mPointHisChangeDataDao; - @Resource - private UserService userService; - - @Override - public MPointHisChangeData selectById(String id) { - return mPointHisChangeDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return mPointHisChangeDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(MPointHisChangeData entity) { - return mPointHisChangeDataDao.insert(entity); - } - - @Override - public int update(MPointHisChangeData t) { - return mPointHisChangeDataDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - MPointHisChangeData workstation = new MPointHisChangeData(); - workstation.setWhere(wherestr); - List list = mPointHisChangeDataDao.selectListByWhere(workstation); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - User user = this.userService.getUserById(list.get(i).getChangepeople()); - if (user != null) { - list.get(i).set_changepeopleName(user.getCaption()); - } - } - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - MPointHisChangeData workstation = new MPointHisChangeData(); - workstation.setWhere(wherestr); - return mPointHisChangeDataDao.deleteByWhere(workstation); - } - - public List selectListByWhereUnionCleaning(String wherestr) { - MPointHisChangeData mPointHisChangeData = new MPointHisChangeData(); - mPointHisChangeData.setWhere(wherestr); - List list = mPointHisChangeDataDao.selectListByWhereUnionCleaning(mPointHisChangeData); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - User user = this.userService.getUserById(list.get(i).getChangepeople()); - if (user != null) { - list.get(i).set_changepeopleName(user.getCaption()); - } - } - } - return list; - } - -} diff --git a/src/com/sipai/service/work/MeasurePoint_DATAService.java b/src/com/sipai/service/work/MeasurePoint_DATAService.java deleted file mode 100644 index f48db341..00000000 --- a/src/com/sipai/service/work/MeasurePoint_DATAService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.MeasurePoint_DATADao; - -import com.sipai.entity.work.MeasurePoint_DATA; - -import com.sipai.tools.CommService; - -@Service -public class MeasurePoint_DATAService implements CommService{ - @Resource - private MeasurePoint_DATADao measurePoint_DATADao; - - @Override - public MeasurePoint_DATA selectById(String id) { - return measurePoint_DATADao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return measurePoint_DATADao.deleteByPrimaryKey(id); - } - - @Override - public int save(MeasurePoint_DATA entity) { - return measurePoint_DATADao.insert(entity); - } - - @Override - public int update(MeasurePoint_DATA entity) { - return measurePoint_DATADao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - MeasurePoint_DATA MeasurePoint_DATA = new MeasurePoint_DATA(); - MeasurePoint_DATA.setWhere(wherestr); - return measurePoint_DATADao.selectListByWhere(MeasurePoint_DATA); - } - - @Override - public int deleteByWhere(String wherestr) { - MeasurePoint_DATA MeasurePoint_DATA = new MeasurePoint_DATA(); - MeasurePoint_DATA.setWhere(wherestr); - return measurePoint_DATADao.deleteByWhere(MeasurePoint_DATA); - } - -} diff --git a/src/com/sipai/service/work/ModbusConfigService.java b/src/com/sipai/service/work/ModbusConfigService.java deleted file mode 100644 index 7346dbe7..00000000 --- a/src/com/sipai/service/work/ModbusConfigService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.ModbusConfigDao; -import com.sipai.entity.work.ModbusConfig; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class ModbusConfigService implements CommService { - - @Resource - ModbusConfigDao modbusConfigDao; - - @Override - public ModbusConfig selectById(String t) { - return modbusConfigDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t){ - return modbusConfigDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ModbusConfig modbusConfig) { - return modbusConfigDao.insert(modbusConfig); - } - - @Override - public int update(ModbusConfig modbusConfig) { - return modbusConfigDao.updateByPrimaryKeySelective(modbusConfig); - } - - @Override - public List selectListByWhere(String t) { - ModbusConfig modbusConfig = new ModbusConfig(); - modbusConfig.setWhere(t); - return modbusConfigDao.selectListByWhere(modbusConfig); - } - - @Override - public int deleteByWhere(String t) { - ModbusConfig modbusConfig = new ModbusConfig(); - modbusConfig.setWhere(t); - return modbusConfigDao.deleteByWhere(modbusConfig); - } -} diff --git a/src/com/sipai/service/work/ModbusFigService.java b/src/com/sipai/service/work/ModbusFigService.java deleted file mode 100644 index dc30392a..00000000 --- a/src/com/sipai/service/work/ModbusFigService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ModbusFigDao; -import com.sipai.entity.work.ModbusFig; -import com.sipai.tools.CommService; - -@Service -public class ModbusFigService implements CommService{ - @Resource - private ModbusFigDao modbusFigDao; - - @Override - public ModbusFig selectById(String id) { - return modbusFigDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return modbusFigDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ModbusFig entity) { - return modbusFigDao.insert(entity); - } - - @Override - public int update(ModbusFig t) { - return modbusFigDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - ModbusFig workstation = new ModbusFig(); - workstation.setWhere(wherestr); - return modbusFigDao.selectListByWhere(workstation); - } - - @Override - public int deleteByWhere(String wherestr) { - ModbusFig workstation = new ModbusFig(); - workstation.setWhere(wherestr); - return modbusFigDao.deleteByWhere(workstation); - } - -} diff --git a/src/com/sipai/service/work/ModbusInterfaceService.java b/src/com/sipai/service/work/ModbusInterfaceService.java deleted file mode 100644 index 445d7b99..00000000 --- a/src/com/sipai/service/work/ModbusInterfaceService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.ModbusInterfaceDao; -import com.sipai.entity.work.ModbusInterface; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class ModbusInterfaceService implements CommService { - - @Resource - ModbusInterfaceDao modbusInterfaceDao; - @Resource - private ModbusConfigService modbusConfigService; - @Resource - private ModbusPointService modbusPointService; - - @Override - public ModbusInterface selectById(String t) { - return modbusInterfaceDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t){ - return modbusInterfaceDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ModbusInterface interfaceModbus) { - return modbusInterfaceDao.insert(interfaceModbus); - } - - @Override - public int update(ModbusInterface interfaceModbus) { - return modbusInterfaceDao.updateByPrimaryKeySelective(interfaceModbus); - } - - @Override - public List selectListByWhere(String t) { - ModbusInterface modbusInterface = new ModbusInterface(); - modbusInterface.setWhere(t); - return modbusInterfaceDao.selectListByWhere(modbusInterface); - } - - @Override - public int deleteByWhere(String t) { - ModbusInterface modbusInterface = new ModbusInterface(); - modbusInterface.setWhere(t); - return modbusInterfaceDao.deleteByWhere(modbusInterface); - } - - @Transactional - public int deleteAll(String id) { - int code = this.deleteById(id); - modbusConfigService.deleteByWhere("where p_id = '" + id + "'"); - modbusPointService.deleteByWhere("where p_id = '" + id + "'"); - return code; - } - - public int insertSelective(ModbusInterface tbWorkInterfaceModbus) { - return modbusInterfaceDao.insertSelective(tbWorkInterfaceModbus); - } -} diff --git a/src/com/sipai/service/work/ModbusPointService.java b/src/com/sipai/service/work/ModbusPointService.java deleted file mode 100644 index 09f4b965..00000000 --- a/src/com/sipai/service/work/ModbusPointService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.ModbusPointDao; -import com.sipai.entity.work.ModbusPoint; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -@Service -public class ModbusPointService implements CommService { - - @Resource - ModbusPointDao modbusPointDao; - - @Override - public ModbusPoint selectById(String t) { - return modbusPointDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t){ - return modbusPointDao.deleteByPrimaryKey(t); - } - - @Override - public int save(ModbusPoint modbusPoint) { - return modbusPointDao.insert(modbusPoint); - } - - @Override - public int update(ModbusPoint modbusPoint) { - return modbusPointDao.updateByPrimaryKeySelective(modbusPoint); - } - - @Override - public List selectListByWhere(String t) { - ModbusPoint modbusPoint = new ModbusPoint(); - modbusPoint.setWhere(t); - return modbusPointDao.selectListByWhere(modbusPoint); - } - - @Override - public int deleteByWhere(String t) { - ModbusPoint modbusPoint = new ModbusPoint(); - modbusPoint.setWhere(t); - return modbusPointDao.deleteByWhere(modbusPoint); - } -} diff --git a/src/com/sipai/service/work/ModbusRecordService.java b/src/com/sipai/service/work/ModbusRecordService.java deleted file mode 100644 index 9ea4febf..00000000 --- a/src/com/sipai/service/work/ModbusRecordService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ModbusFigDao; -import com.sipai.dao.work.ModbusRecordDao; -import com.sipai.entity.work.ModbusRecord; -import com.sipai.entity.work.ModbusRecord; -import com.sipai.tools.CommService; - -@Service -public class ModbusRecordService implements CommService{ - @Resource - private ModbusRecordDao modbusRecordDao; - - @Override - public ModbusRecord selectById(String id) { - return modbusRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return modbusRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ModbusRecord entity) { - return modbusRecordDao.insert(entity); - } - - @Override - public int update(ModbusRecord t) { - return modbusRecordDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String wherestr) { - ModbusRecord workstation = new ModbusRecord(); - workstation.setWhere(wherestr); - return modbusRecordDao.selectListByWhere(workstation); - } - - @Override - public int deleteByWhere(String wherestr) { - ModbusRecord workstation = new ModbusRecord(); - workstation.setWhere(wherestr); - return modbusRecordDao.deleteByWhere(workstation); - } - -} diff --git a/src/com/sipai/service/work/ProductionIndexDataService.java b/src/com/sipai/service/work/ProductionIndexDataService.java deleted file mode 100644 index fafab128..00000000 --- a/src/com/sipai/service/work/ProductionIndexDataService.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ProductionIndexDataDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexData; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.tools.CommService; - -@Service("productionIndexDataService") -public class ProductionIndexDataService implements CommService{ - @Resource - private ProductionIndexDataDao productionIndexDataDao; - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; - - @Override - public ProductionIndexData selectById(String id) { - ProductionIndexData pData=productionIndexDataDao.selectByPrimaryKey(id); - ProductionIndexPlanNameConfigure pConfigure=this.productionIndexPlanNameConfigureService.selectById(pData.getConfigureid()); - pData.setProductionIndexPlanNameConfigure(pConfigure); - return pData; - } - - @Override - public int deleteById(String id) { - return productionIndexDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProductionIndexData entity) { - return productionIndexDataDao.insert(entity); - } - - @Override - public int update(ProductionIndexData entity) { - return productionIndexDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProductionIndexData productionIndexData = new ProductionIndexData(); - productionIndexData.setWhere(wherestr); - List pDatas =productionIndexDataDao.selectListByWhere(productionIndexData); - for (ProductionIndexData item : pDatas) { - ProductionIndexPlanNameConfigure pConfigure=this.productionIndexPlanNameConfigureService.selectById(item.getConfigureid()); - item.setProductionIndexPlanNameConfigure(pConfigure); - } - return pDatas; - } - - @Override - public int deleteByWhere(String wherestr) { - ProductionIndexData productionIndexData = new ProductionIndexData(); - productionIndexData.setWhere(wherestr); - return productionIndexDataDao.deleteByWhere(productionIndexData); - } - - public List selectListByLineCWhere(String wherestr) { - ProductionIndexData productionIndexData = new ProductionIndexData(); - productionIndexData.setWhere(wherestr); - return productionIndexDataDao.selectListByLineCWhere(productionIndexData); - } - - public List selectAvgByLineCWhere(String wherestr) { - ProductionIndexData productionIndexData = new ProductionIndexData(); - productionIndexData.setWhere(wherestr); - return productionIndexDataDao.selectAvgByLineCWhere(productionIndexData); - } - -} diff --git a/src/com/sipai/service/work/ProductionIndexPlanNameConfigureService.java b/src/com/sipai/service/work/ProductionIndexPlanNameConfigureService.java deleted file mode 100644 index 5fa74835..00000000 --- a/src/com/sipai/service/work/ProductionIndexPlanNameConfigureService.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.sipai.service.work; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ProductionIndexPlanNameConfigureDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexData; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.entity.work.ProductionIndexPlanNameData; -import com.sipai.entity.work.ProductionIndexPlanNameConfigure; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -import net.sf.json.JSONArray; - -@Service("productionIndexPlanNameConfigureService") -public class ProductionIndexPlanNameConfigureService implements CommService { - @Resource - private ProductionIndexPlanNameConfigureDao productionIndexPlanNameConfigureDao; - @Resource - private ProductionIndexDataService productionIndexDataService; - @Resource - private ProductionIndexPlanNameDataService productionIndexPlanNameDataService; - @Resource - private MPointService mPointService; - @Resource - private MPointHistoryService mPointHistoryService; - - @Override - public ProductionIndexPlanNameConfigure selectById(String id) { - ProductionIndexPlanNameConfigure pConfigure = productionIndexPlanNameConfigureDao.selectByPrimaryKey(id); - if (pConfigure != null) { - if (pConfigure.getMpid() != null) { - MPoint mp = this.mPointService.selectById(pConfigure.getUnitId(), pConfigure.getMpid()); - if (mp != null) { - pConfigure.setMpname(mp.getParmname()); - } - } - if (pConfigure.getMpidPlan() != null) { - MPoint mp = this.mPointService.selectById(pConfigure.getUnitId(), pConfigure.getMpidPlan()); - if (mp != null) { - pConfigure.setMpPlanname(mp.getParmname()); - } - } - } - return pConfigure; - } - - @Override - public int deleteById(String id) { - return productionIndexPlanNameConfigureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProductionIndexPlanNameConfigure entity) { - return productionIndexPlanNameConfigureDao.insert(entity); - } - - @Override - public int update(ProductionIndexPlanNameConfigure entity) { - return productionIndexPlanNameConfigureDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure = new ProductionIndexPlanNameConfigure(); - productionIndexPlanNameConfigure.setWhere(wherestr); - List list = productionIndexPlanNameConfigureDao.selectListByWhere(productionIndexPlanNameConfigure); -// if(list!=null&&list.size()>0){ -// for (int i = 0; i < list.size(); i++) { -// ProductionIndexPlanNameConfigure pConfigure=list.get(i); -// if(pConfigure!=null){ -// if(pConfigure.getMpid()!=null){ -// MPoint mp=this.mPointService.selectById(pConfigure.getUnitId(), pConfigure.getMpid()); -// if(mp!=null){ -// list.get(i).setMpname(mp.getParmname()); -// } -// } -// if(pConfigure.getMpidPlan()!=null){ -// MPoint mp=this.mPointService.selectById(pConfigure.getUnitId(), pConfigure.getMpidPlan()); -// if(mp!=null){ -// list.get(i).setMpPlanname(mp.getParmname()); -// } -// } -// } -// } -// } - return list; - } - - public List selectListByWhereForEdit2(String wherestr, String type, String planDate, String unitId) { - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure = new ProductionIndexPlanNameConfigure(); - productionIndexPlanNameConfigure.setWhere(wherestr); - List list = productionIndexPlanNameConfigureDao.selectListByWhere(productionIndexPlanNameConfigure); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - if (type.equals(ProductionIndexPlanNameData.Type_Year)) { - String mwherestr = " where datediff(year,d.planDate,'" + planDate + "-01-01')=0 and d.type='" + ProductionIndexPlanNameData.Type_Year + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - } - } else if (type.equals(ProductionIndexPlanNameData.Type_Month)) { - String mwherestr = " where datediff(month,d.planDate,'" + planDate + "-01')=0 and d.type='" + ProductionIndexPlanNameData.Type_Month + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - } - } else if (type.equals(ProductionIndexPlanNameData.Type_Day)) { - String mwherestr = " where datediff(day,d.planDate,'" + planDate + "')=0 and d.type='" + ProductionIndexPlanNameData.Type_Day + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - } else { - if (list.get(i).getMpid() != null && !list.get(i).getMpid().equals("")) { - List mPointHistories = this.mPointHistoryService.selectListByTableAWhere(unitId, "TB_MP_" + list.get(i).getMpid(), "where DATEDIFF(day, MeasureDt, '" + planDate + "')=0"); - if (mPointHistories.size() > 0) { - list.get(i).setValue(mPointHistories.get(0).getParmvalue().doubleValue()); - } - } - } - } - } - } - - - return list; - } - - public List getDayTargetAndActualValue(String wherestr, String planDate, String unitId) { - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure = new ProductionIndexPlanNameConfigure(); - productionIndexPlanNameConfigure.setWhere(wherestr); - List list = productionIndexPlanNameConfigureDao.selectListByWhere(productionIndexPlanNameConfigure); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - String mwherestr = " where datediff(day,d.planDate,'" + planDate + "')=0 and d.type='" + ProductionIndexPlanNameData.Type_Day + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - String configureId = dmlist.get(0).getConfigureid(); - List cist = this.productionIndexPlanNameDataService.selectListByWhere(" where configureId='"+configureId+"' and datediff(month,planDate,'" + planDate + "')=0 and type='"+ProductionIndexPlanNameData.Type_Month+"' "); - if(cist!=null&&cist.size()>0){ - list.get(i).setTargetValue(cist.get(0).getValue()); - } - } else { - list.get(i).setValue(0.0); - } - } - } - return list; - } - - public List selectListByWhereForEdit(String wherestr, String type, String planDate, String unitId) { - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure = new ProductionIndexPlanNameConfigure(); - productionIndexPlanNameConfigure.setWhere(wherestr); - List list = productionIndexPlanNameConfigureDao.selectListByWhere(productionIndexPlanNameConfigure); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - if (type.equals(ProductionIndexPlanNameData.Type_Year)) { - String mwherestr = " where datediff(year,d.planDate,'" + planDate + "-01-01')=0 and d.type='" + ProductionIndexPlanNameData.Type_Year + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexPlanNameDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - } - } else if (type.equals(ProductionIndexPlanNameData.Type_Month)) { - String mwherestr = " where datediff(month,d.planDate,'" + planDate + "-01')=0 and d.type='" + ProductionIndexPlanNameData.Type_Month + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexPlanNameDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - } - } else if (type.equals(ProductionIndexPlanNameData.Type_Day)) { - String mwherestr = " where datediff(day,d.planDate,'" + planDate + "')=0 and d.type='" + ProductionIndexPlanNameData.Type_Day + "' and d.configureId='" + list.get(i).getId() + "' and d.unit_id='" + unitId + "' "; - List dmlist = this.productionIndexPlanNameDataService.selectListByLineCWhere(mwherestr); - if (dmlist != null && dmlist.size() > 0) { - list.get(i).setValue(dmlist.get(0).getValue()); - } - } - } - } - - - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - ProductionIndexPlanNameConfigure productionIndexPlanNameConfigure = new ProductionIndexPlanNameConfigure(); - productionIndexPlanNameConfigure.setWhere(wherestr); - return productionIndexPlanNameConfigureDao.deleteByWhere(productionIndexPlanNameConfigure); - } - - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (ProductionIndexPlanNameConfigure k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", " " + k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(ProductionIndexPlanNameConfigure.Type_0)) { - map.put("icon", "fa fa-list-ul"); - //m.put("color", "#357ca5"); - } else if (k.getType().equals(ProductionIndexPlanNameConfigure.Type_1)) { - map.put("icon", "fa fa-file-text-o"); -// map.put("color", "#39cccc"); - } - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (ProductionIndexPlanNameConfigure k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", " " + k.getName()); - m.put("type", k.getType()); - if (k.getType().equals(ProductionIndexPlanNameConfigure.Type_0)) { - m.put("icon", "fa fa-list-ul"); - //m.put("color", "#357ca5"); - } else if (k.getType().equals(ProductionIndexPlanNameConfigure.Type_1)) { - m.put("icon", "fa fa-file-text-o"); -// m.put("color", "#39cccc"); - } - - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } -} diff --git a/src/com/sipai/service/work/ProductionIndexPlanNameDataHisService.java b/src/com/sipai/service/work/ProductionIndexPlanNameDataHisService.java deleted file mode 100644 index 613dc753..00000000 --- a/src/com/sipai/service/work/ProductionIndexPlanNameDataHisService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.UserDao; -import com.sipai.dao.work.ProductionIndexPlanNameDataHisDao; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexPlanNameDataHis; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class ProductionIndexPlanNameDataHisService implements CommService{ - @Resource - private ProductionIndexPlanNameDataHisDao productionIndexPlanNameDataHisDao; - @Resource - private UserDao userDao; - - @Override - public ProductionIndexPlanNameDataHis selectById(String id) { - return productionIndexPlanNameDataHisDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return productionIndexPlanNameDataHisDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProductionIndexPlanNameDataHis entity) { - return productionIndexPlanNameDataHisDao.insert(entity); - } - - @Override - public int update(ProductionIndexPlanNameDataHis entity) { - return productionIndexPlanNameDataHisDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProductionIndexPlanNameDataHis group = new ProductionIndexPlanNameDataHis(); - group.setWhere(wherestr); - List list = productionIndexPlanNameDataHisDao.selectListByWhere(group); - if(list!=null&&list.size()>0){ - for(int i=0;i{ - @Resource - private ProductionIndexPlanNameDataDao productionIndexPlanNameDataDao; - @Resource - private ProductionIndexPlanNameConfigureService productionIndexPlanNameConfigureService; -// @Resource -// private ProductionIndexPlanNameDataService productionIndexPlanNameDataService; - - private static String REGEX_CHINESE = "[\u4e00-\u9fa5]";// 中文正则 - - @Override - public ProductionIndexPlanNameData selectById(String id) { - ProductionIndexPlanNameData pData=productionIndexPlanNameDataDao.selectByPrimaryKey(id); - ProductionIndexPlanNameConfigure pConfigure=this.productionIndexPlanNameConfigureService.selectById(pData.getConfigureid()); - pData.setProductionIndexPlanNameConfigure(pConfigure); - return pData; - } - - @Override - public int deleteById(String id) { - return productionIndexPlanNameDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProductionIndexPlanNameData entity) { - return productionIndexPlanNameDataDao.insert(entity); - } - - @Override - public int update(ProductionIndexPlanNameData entity) { - return productionIndexPlanNameDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProductionIndexPlanNameData productionIndexPlanNameData = new ProductionIndexPlanNameData(); - productionIndexPlanNameData.setWhere(wherestr); - List pDatas =productionIndexPlanNameDataDao.selectListByWhere(productionIndexPlanNameData); - for (ProductionIndexPlanNameData item : pDatas) { - List pConfigure=this.productionIndexPlanNameConfigureService.selectListByWhere(" where id='"+item.getConfigureid()+"'"); - if(pConfigure!=null&&pConfigure.size()>0){ - item.setProductionIndexPlanNameConfigure(pConfigure.get(0)); - } - } - return pDatas; - } - - @Override - public int deleteByWhere(String wherestr) { - ProductionIndexPlanNameData productionIndexPlanNameData = new ProductionIndexPlanNameData(); - productionIndexPlanNameData.setWhere(wherestr); - return productionIndexPlanNameDataDao.deleteByWhere(productionIndexPlanNameData); - } - - public List selectListByLineCWhere(String wherestr) { - ProductionIndexPlanNameData productionIndexPlanNameData = new ProductionIndexPlanNameData(); - productionIndexPlanNameData.setWhere(wherestr); - return productionIndexPlanNameDataDao.selectListByLineCWhere(productionIndexPlanNameData); - } - - @SuppressWarnings("deprecation") - public void downloadExcelTemplate(HttpServletRequest request, HttpServletResponse response) throws IOException { - String fileName = "生产指标控制计划表模板.xls"; - String title = "生产指标控制计划表"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "指标名称,"; - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere("where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id = '" + request.getParameter("unitId") + "' order by morder asc"); - if(clist!=null&&clist.size()>0){ - for(int i = 0; i < clist.size(); i++){ - sheet.setColumnWidth((i+1), 5000); - excelTitleStr+=clist.get(i).getName()+","; - } - } - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 400); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("生产指标控制计划表"); - - // 第二行 - HSSFRow row2 = sheet.createRow(1); - row2.setHeight((short) 400); - HSSFCell cell20 = row2.createCell(0); - cell20.setCellStyle(listStyle); - cell20.setCellValue("年份"); - HSSFCell cell21 = row2.createCell(1); - cell21.setCellStyle(listStyle); - cell21.setCellValue(""); - - for(int m=0;m<13;m++){ - if(m==0){ - HSSFRow listrow = sheet.createRow(m+3); - listrow.setHeight((short) 400); - HSSFCell listcell = listrow.createCell(0); - listcell.setCellStyle(listStyle); - listcell.setCellValue("年度指标"); - } else { - HSSFRow listrow = sheet.createRow(m+3); - listrow.setHeight((short) 400); - HSSFCell listcell = listrow.createCell(0); - listcell.setCellStyle(listStyle); - listcell.setCellValue(m+"月份"); - } - //插入空列表 - for(int n=0;n clist = this.productionIndexPlanNameConfigureService.selectListByWhere("where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1+"' and unit_id='"+unitId+"' order by morder asc"); - if(clist!=null&&clist.size()>0){ - for(int i = 0; i < clist.size(); i++){ - sheet.setColumnWidth((i+1), 5000); - excelTitleStr+=clist.get(i).getName()+","; - } - } - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 400); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("生产指标控制计划表"); - - // 第二行 - HSSFRow row2 = sheet.createRow(1); - row2.setHeight((short) 400); - HSSFCell cell20 = row2.createCell(0); - cell20.setCellStyle(listStyle); - cell20.setCellValue("年份"); - HSSFCell cell21 = row2.createCell(1); - cell21.setCellStyle(listStyle); - cell21.setCellValue(date.substring(0, 4)); - - for(int m=0;m<13;m++){ - if(m==0){ - HSSFRow listrow = sheet.createRow(m+3); - listrow.setHeight((short) 400); - HSSFCell listcell = listrow.createCell(0); - listcell.setCellStyle(listStyle); - listcell.setCellValue("年度指标"); - - for(int i=0;i dmlist2 = this.selectListByWhere(whereString); - if(dmlist2!=null&&dmlist2.size()>0){ - listcell1.setCellValue(dmlist2.get(0).getValue()); - }else{ - listcell1.setCellValue("0"); - } - } - - }else{ - HSSFRow listrow = sheet.createRow(m+3); - listrow.setHeight((short) 400); - HSSFCell listcell = listrow.createCell(0); - listcell.setCellStyle(listStyle); - listcell.setCellValue(m+"月份"); - - - for(int n=0;n dmlist2 = this.selectListByWhere(whereString); - if(dmlist2!=null&&dmlist2.size()>0){ - if(dmlist2!=null&&dmlist2.size()>0){ - listcell1.setCellValue(dmlist2.get(0).getValue()); - }else{ - listcell1.setCellValue("0"); - } - }else{ - listcell1.setCellValue("0"); - } - - - } - } - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally{ - workbook.close(); - } - } - - /** - * xlsx文件导入 - * @param input - * @return - * @throws IOException - */ - @Transactional - public String readXlsx(InputStream input,String unitId,String userId) throws IOException { - XSSFWorkbook workbook = new XSSFWorkbook(input); - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere("where 1=1 and (active='0' or active='2') order by morder asc"); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - XSSFSheet sheet = workbook.getSheetAt(numSheet); - XSSFRow yearNumRow = sheet.getRow(1); - XSSFCell yearNumcell = yearNumRow.getCell(1); - int yearNum=Integer.valueOf(getStringVal(yearNumcell).replaceAll(REGEX_CHINESE, "")); - //导入会覆盖记录,先执行删除 - deleteByWhere(" where datediff(year,planDate,'"+yearNum+"-01-01')=0 and unit_id='"+unitId+"' "); - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头,读取数据从rowNum+4行开始 - XSSFRow row = sheet.getRow(rowNum); - - int minCellNum = 1;//读取数据从第2列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - - for (int i = minCellNum; i < maxCellNum; i++) { - XSSFCell cell = row.getCell(i); - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - try { - if(clist.size()>=(i-1)){ - String type=""; - String planDate=""; - if(rowNum==3){//年度指标 - type=ProductionIndexPlanNameData.Type_Year; - planDate=yearNum+"-01-01"; - }else{ - type=ProductionIndexPlanNameData.Type_Month; - planDate=yearNum+"-"+(rowNum-3)+"-01"; - } - String cid=clist.get(i-1).getId(); - ProductionIndexPlanNameData pData=new ProductionIndexPlanNameData(); - pData.setId(CommUtil.getUUID()); - pData.setConfigureid(cid); - pData.setValue(Double.valueOf(getStringVal(cell))); - pData.setPlandate(planDate); - pData.setType(type); - pData.setUnitId(unitId); - int code=save(pData); - if(code==0){ - insertNum++; - } - - } -// System.out.println(i-1); -// System.out.println(getStringVal(cell)); - - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - /** - * xls表格导入 - * @param input - * @return readXls - * @throws IOException - */ - @Transactional - public String readXls(InputStream input,String unitId,String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - List clist = this.productionIndexPlanNameConfigureService.selectListByWhere("where 1=1 and type='"+ProductionIndexPlanNameConfigure.Type_1 + "' and unit_id = '" + unitId +"' order by morder asc"); - int insertNum = 0, updateNum = 0; - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow yearNumRow = sheet.getRow(1); - HSSFCell yearNumcell = yearNumRow.getCell(1); - int yearNum=Integer.valueOf(getStringVal(yearNumcell).replaceAll(REGEX_CHINESE, "")); - //导入会覆盖记录,先执行删除 - deleteByWhere(" where datediff(year,planDate,'"+yearNum+"-01-01')=0 and unit_id='"+unitId+"' "); - - for (int rowNum = 3; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前三行为表头,读取数据从rowNum+4行开始 - HSSFRow row = sheet.getRow(rowNum); - - int minCellNum = 1;//读取数据从第2列开始 - int maxCellNum = row.getLastCellNum();//最后一列 - - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - /*if (cell == null ||null == getStringVal(cell) ) { - continue; - }*/ - try { - if(clist.size()>=(i-1)){ - String type=""; - String planDate=""; - if(rowNum==3){//年度指标 - type=ProductionIndexPlanNameData.Type_Year; - planDate=yearNum+"-01-01"; - }else{ - type=ProductionIndexPlanNameData.Type_Month; - planDate=yearNum+"-"+(rowNum-3)+"-01"; - } - String cid=clist.get(i-1).getId(); - ProductionIndexPlanNameData pData=new ProductionIndexPlanNameData(); - pData.setId(CommUtil.getUUID()); - pData.setConfigureid(cid); - pData.setValue(Double.valueOf(getStringVal(cell))); - pData.setPlandate(planDate); - pData.setType(type); - pData.setUnitId(unitId); - int code=save(pData); - if(code==1){ - insertNum++; - } - - } -// System.out.println(i-1); -// System.out.println(getStringVal(cell)); - - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - } - } - String result = ""; - if (insertNum >0) { - result +="新增成功数据"+insertNum+"条;"; - } - if (updateNum >0) { - result +="更新成功数据"+updateNum+"条;"; - } - return result; - } - - /** - * xlsx文件数据转换 - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - }else{ - return null; - } - } - /** - * xls文件数据转换 - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if(cell!=null){ - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if(DateUtil.isCellDateFormatted(cell)){ - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - }else{ - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - }else{ - return null; - } - } - -} diff --git a/src/com/sipai/service/work/ProductionIndexWorkOrderService.java b/src/com/sipai/service/work/ProductionIndexWorkOrderService.java deleted file mode 100644 index fafdac81..00000000 --- a/src/com/sipai/service/work/ProductionIndexWorkOrderService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.user.UserDao; -import com.sipai.dao.work.ProductionIndexWorkOrderDao; -import com.sipai.entity.user.User; -import com.sipai.entity.work.ProductionIndexWorkOrder; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommService; - -@Service -public class ProductionIndexWorkOrderService implements CommService{ - @Resource - private ProductionIndexWorkOrderDao productionIndexWorkOrderDao; - @Resource - private UserDao userDao; - - @Override - public ProductionIndexWorkOrder selectById(String id) { - return productionIndexWorkOrderDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return productionIndexWorkOrderDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ProductionIndexWorkOrder entity) { - return productionIndexWorkOrderDao.insert(entity); - } - - @Override - public int update(ProductionIndexWorkOrder entity) { - return productionIndexWorkOrderDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ProductionIndexWorkOrder group = new ProductionIndexWorkOrder(); - group.setWhere(wherestr); - List list = productionIndexWorkOrderDao.selectListByWhere(group); -// if(list!=null&&list.size()>0){ -// for(int i=0;i{ - @Resource - private ScadaPicDao scadaPicDao; - @Override - public ScadaPic selectById(String id) { - return scadaPicDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return scadaPicDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ScadaPic entity) { - return scadaPicDao.insert(entity); - } - - @Override - public int update(ScadaPic entity) { - return scadaPicDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ScadaPic group = new ScadaPic(); - group.setWhere(wherestr); - return scadaPicDao.selectListByWhere(group); - } - - @Override - public int deleteByWhere(String wherestr) { - ScadaPic group = new ScadaPic(); - group.setWhere(wherestr); - return scadaPicDao.deleteByWhere(group); - } - - public List selectListForPSection(String wherestr) { - ScadaPic scadaPic = new ScadaPic(); - scadaPic.setWhere(wherestr); - List ps=scadaPicDao.selectListForPSection(scadaPic); - return ps; - } -} diff --git a/src/com/sipai/service/work/ScadaPic_EMService.java b/src/com/sipai/service/work/ScadaPic_EMService.java deleted file mode 100644 index 8671c0fa..00000000 --- a/src/com/sipai/service/work/ScadaPic_EMService.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.service.work; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ScadaPic_EMDao; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentClass; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.ScadaPic_EM; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.tools.CommService; - -@Service -public class ScadaPic_EMService implements CommService{ - @Resource - private ScadaPic_EMDao scadaPic_EMDao; - @Resource - private EquipmentCardService equipmentCardService; - @Override - public ScadaPic_EM selectById(String id) { - return scadaPic_EMDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return scadaPic_EMDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ScadaPic_EM entity) { - return scadaPic_EMDao.insert(entity); - } - - @Override - public int update(ScadaPic_EM entity) { - return scadaPic_EMDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ScadaPic_EM group = new ScadaPic_EM(); - group.setWhere(wherestr); - return scadaPic_EMDao.selectListByWhere(group); - } - /** - * 获取设备信息*/ - public List selectListWithEquipInfoByWhere(String wherestr) { - ScadaPic_EM group = new ScadaPic_EM(); - group.setWhere(wherestr); - List list =scadaPic_EMDao.selectListByWhere(group); - for (ScadaPic_EM scadaPic_EM : list) { - EquipmentCard equipmentCard =equipmentCardService.selectById(scadaPic_EM.getEquipid()); - scadaPic_EM.setEquipmentCard(equipmentCard); - } - - return list; - } - /** - * 根据工序信息和设备查询条件,获取目标工序下设备信息,*/ - public List selectListWithEquipInfoByWhereAndType(String wherestr,String type) { - ScadaPic_EM group = new ScadaPic_EM(); - group.setWhere(wherestr); - List list =scadaPic_EMDao.selectListByWhere(group); - for (ScadaPic_EM scadaPic_EM : list) { - EquipmentCard equipmentCard =equipmentCardService.selectById(scadaPic_EM.getEquipid()); - scadaPic_EM.setEquipmentCard(equipmentCard); - } - - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ScadaPic_EM group = new ScadaPic_EM(); - group.setWhere(wherestr); - return scadaPic_EMDao.deleteByWhere(group); - } -} diff --git a/src/com/sipai/service/work/ScadaPic_MPointService.java b/src/com/sipai/service/work/ScadaPic_MPointService.java deleted file mode 100644 index 6e734996..00000000 --- a/src/com/sipai/service/work/ScadaPic_MPointService.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sipai.service.work; -import java.math.BigDecimal; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.commons.lang.ObjectUtils.Null; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ScadaPic_MPointDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; - -@Service -public class ScadaPic_MPointService implements CommService{ - @Resource - private ScadaPic_MPointDao scadaPic_MPointDao; - @Resource - private MPointService mPointService; - @Resource - private ScadaPic_MPoint_ExpressionService scadaPic_MPoint_ExpressionService; - - @Override - public ScadaPic_MPoint selectById(String id) { - return scadaPic_MPointDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return scadaPic_MPointDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ScadaPic_MPoint entity) { - return scadaPic_MPointDao.insert(entity); - } - - @Override - public int update(ScadaPic_MPoint entity) { - return scadaPic_MPointDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ScadaPic_MPoint group = new ScadaPic_MPoint(); - group.setWhere(wherestr); - return scadaPic_MPointDao.selectListByWhere(group); - } - public List selectListWithPointValueByWhere(String bizId,String wherestr) { - ScadaPic_MPoint group = new ScadaPic_MPoint(); - group.setWhere(wherestr); - List list =scadaPic_MPointDao.selectListByWhere(group); - String ids =""; - //获取所有测量点id - for (ScadaPic_MPoint scadaPic_MPoint : list) { - if(!ids.isEmpty()){ - ids+=","; - } - ids+=scadaPic_MPoint.getMpid(); - } - List mPoints=mPointService.getvaluefunc(bizId,ids); - Iterator iterator=null; - for (ScadaPic_MPoint scadaPic_MPoint : list) { - iterator = mPoints.iterator(); - while (iterator.hasNext()) { - MPoint mPoint =iterator.next(); - if(scadaPic_MPoint.getMpid().equals(mPoint.getId())){ - if(scadaPic_MPoint.getExpressionflag()!=null &&scadaPic_MPoint.getExpressionflag().equals(ScadaPic_MPoint.ExpressFlag_On)){ - //表达式启用则破译表达式的结果 - try { - BigDecimal parmValue = mPoint.getParmvalue(); - String expressway =scadaPic_MPoint_ExpressionService.getExpresswayByMPoint(mPoint.getId(),parmValue==null?0.0:parmValue.doubleValue()); - mPoint.setExp(expressway); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - } - - } - scadaPic_MPoint.setmPoint(mPoint); - iterator.remove(); - } - } - } - - return list; - } - @Override - public int deleteByWhere(String wherestr) { - ScadaPic_MPoint group = new ScadaPic_MPoint(); - group.setWhere(wherestr); - return scadaPic_MPointDao.deleteByWhere(group); - } -} diff --git a/src/com/sipai/service/work/ScadaPic_MPoint_ExpressionService.java b/src/com/sipai/service/work/ScadaPic_MPoint_ExpressionService.java deleted file mode 100644 index 204db211..00000000 --- a/src/com/sipai/service/work/ScadaPic_MPoint_ExpressionService.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.sipai.service.work; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.ScadaPic_MPointDao; -import com.sipai.dao.work.ScadaPic_MPoint_ExpressionDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.ScadaPic_MPoint; -import com.sipai.entity.work.ScadaPic_MPoint_Expression; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; - -@Service -public class ScadaPic_MPoint_ExpressionService implements CommService{ - @Resource - private ScadaPic_MPoint_ExpressionDao scadaPic_MPoint_ExpressionDao; - @Resource - private MPointService mPointService; - @Override - public ScadaPic_MPoint_Expression selectById(String id) { - return scadaPic_MPoint_ExpressionDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return scadaPic_MPoint_ExpressionDao.deleteByPrimaryKey(id); - } - - @Override - public int save(ScadaPic_MPoint_Expression entity) { - return scadaPic_MPoint_ExpressionDao.insert(entity); - } - - @Override - public int update(ScadaPic_MPoint_Expression entity) { - return scadaPic_MPoint_ExpressionDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - ScadaPic_MPoint_Expression group = new ScadaPic_MPoint_Expression(); - group.setWhere(wherestr); - return scadaPic_MPoint_ExpressionDao.selectListByWhere(group); - } - @Override - public int deleteByWhere(String wherestr) { - ScadaPic_MPoint_Expression group = new ScadaPic_MPoint_Expression(); - group.setWhere(wherestr); - return scadaPic_MPoint_ExpressionDao.deleteByWhere(group); - } - /** - * 根据测量点id和value,获取表达式结果 - * */ - public String getExpresswayByMPoint(String pointId,double value) { - String expressway=""; - List expressions= this.selectListByWhere("where mpid= '"+pointId+"'"); - if(expressions==null || expressions.size()==0){ - return ""; - } - for (ScadaPic_MPoint_Expression scadaPic_MPoint_Expression : expressions) { - String[] expressions_strs = scadaPic_MPoint_Expression.getExpression().split(","); - boolean flag =false ; - for (String str : expressions_strs) { - char firstChar =str.charAt(0); - switch (firstChar) { - case '>': - double t = Double.valueOf(str.replace(">", "")); - if(value>t){ - flag=true; - } - break; - case '<': - t = Double.valueOf(str.replace("<", "")); - if(value userlist = this.userService.selectListByWhere(" where id in ('" + workpeopleids + "') "); - if (userlist != null && userlist.size() > 0) { - for (User user : - userlist) { - _workpeopleName += user.getCaption() + ","; - } - if (_workpeopleName.length() > 0) { - _workpeopleName = _workpeopleName.substring(0, _workpeopleName.length() - 1); - } - } - schedulings.set_workpeopleName(_workpeopleName); - } - } - } - - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Scheduling scheduling = new Scheduling(); - scheduling.setWhere(wherestr); - return schedulingDao.deleteByWhere(scheduling); - } - - public List selectCalenderListByWhere(String wherestr) { - List sechedulingList = schedulingDao.selectCalenderListByWhere(wherestr); - for (Scheduling scheduling : - sechedulingList) { - if (scheduling.getGroupdetailId().contains(",")) { - String[] groupDetailIds = scheduling.getGroupdetailId().split(","); - String groupDetailNames = ""; - for (String groupDetailId : - groupDetailIds) { - GroupDetail groupDetail = this.groupDetailService.selectById(groupDetailId); - groupDetailNames += groupDetail.getName() + ","; - } - if (groupDetailNames.length() > 1) { - groupDetailNames = groupDetailNames.substring(0, groupDetailNames.length() - 1); - } - scheduling.set_groupDetailName(groupDetailNames); - } - - } - return sechedulingList; - } - - public String readXls(InputStream input, String userId, String unitId) throws IOException { - System.out.println("导入排班开始=============" + CommUtil.nowDate()); - - HSSFWorkbook workbook = new HSSFWorkbook(input); - int sumNum = 0; - int failNum = 0; - - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - HSSFRow row = sheet.getRow(rowNum); - if (null == row) { - continue; - } - int minCellNum = row.getFirstCellNum(); - int maxCellNum = row.getLastCellNum();//最后一列 - - String inDate = ""; - String groupType = ""; - String groupTime = ""; - String groupDetail = ""; - String patrolmode = ""; - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - try { - switch (i) { - case 0: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - inDate = getStringVal(cell); - } - break; - case 1: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - groupType = getStringVal(cell); - } - break; - case 2: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - groupTime = getStringVal(cell); - } - break; - case 3: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - groupDetail = getStringVal(cell); - } - break; - case 4: - if (getStringVal(cell) != null && !getStringVal(cell).equals("")) { - patrolmode = getStringVal(cell); - } - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - Scheduling scheduling = new Scheduling(); -// System.out.println("=========="); -// System.out.println("=========="+inDate); -// inDate = inDate.replaceAll("/", "-"); - if (CommUtil.compare_date(inDate, CommUtil.nowDate()) <= 0) { - failNum++; - continue; - } - scheduling.setId(CommUtil.getUUID()); - scheduling.setInsdt(CommUtil.nowDate()); - scheduling.setInsuser(userId); - scheduling.setDate(inDate); - scheduling.setBizid(unitId); - - List groupTypelist = this.groupTypeService.selectListByWhere(" where name='" + groupType + "' "); - if (groupTypelist != null && groupTypelist.size() > 0) { - scheduling.setSchedulingtype(groupTypelist.get(0).getId()); - - String groupTypeId = groupTypelist.get(0).getId(); - - List groupDetaillist = this.groupDetailService.selectListByWhere(" where name='" + groupDetail + "' and grouptype_id='" + groupTypeId + "' and unit_id='" + unitId + "' "); - if (groupDetaillist != null && groupDetaillist.size() > 0) { - scheduling.setGroupdetailId(groupDetaillist.get(0).getId()); - - String[] groupdetailIds = scheduling.getGroupdetailId().split(","); - String workPeoples = ""; - for (String groupdetailId : - groupdetailIds) { - GroupDetail groupDetail2 = this.groupDetailService.selectById(groupdetailId); - String leader = groupDetail2.getLeader(); - String members = groupDetail2.getMembers(); - - String workPeople = leader; - if (!members.equals("")) { - workPeople += "," + members; - } - workPeoples += workPeople + ","; - } - scheduling.setWorkpeople(workPeoples); - - } else { - failNum++; - continue; - } - - List groupTimelist = this.groupTimeService.selectListByWhere(" where name='" + groupTime + "' and grouptype_id='" + groupTypeId + "' and unit_id='" + unitId + "' "); - if (groupTimelist != null && groupTimelist.size() > 0) { - scheduling.setGroupmanageid(groupTimelist.get(0).getId()); - - //获取当前班次的起止时间 - String[] stAndEdTime = this.groupTimeService.getGroupTimeStartAndEndTime(scheduling.getGroupmanageid(), scheduling.getDate()); - if (stAndEdTime != null && stAndEdTime[0] != "") { - scheduling.setStdt(stAndEdTime[0].substring(0, 16)); - scheduling.setEddt(stAndEdTime[1].substring(0, 16)); - } - } else { - failNum++; - continue; - } - - if (patrolmode != null && !patrolmode.equals("")) { - List patrolModellist = this.patrolModelService.selectListByWhere(" where name='" + patrolmode + "' and type='" + groupTypelist.get(0).getPatroltype() + "' and unit_id='" + unitId + "' "); - if (patrolModellist != null && patrolModellist.size() > 0) { - scheduling.setPatrolmode(patrolModellist.get(0).getId()); - } else { - failNum++; - continue; - } - } else { - scheduling.setPatrolmode(""); - } - - } else { - failNum++; - continue; - } - - scheduling.setStatus(Scheduling.Status_UnSucceeded); - scheduling.setIstypesetting(Scheduling.IsTypeSetting_True);//已排班 - - //删除已被排班的 - deleteByWhere(" where stdt='" + scheduling.getStdt() + "' and bizid='"+unitId+"' and schedulingtype='"+scheduling.getSchedulingtype()+"' "); - - int result = save(scheduling); - if (result == 1) { - sumNum++; - } else { - failNum++; - } - - } - } - String result = ""; - if (failNum > 0) { - result = "共添加" + (int) (sumNum + failNum) + "条记录!" + "其中失败" + failNum + "条!注:已发生的日期无法排班!"; - } else { - result = "共新增" + sumNum + "条!"; - } - System.out.println(result); - - System.out.println("导入排班结束=============" + CommUtil.nowDate()); - return result; - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private static String getStringVal(HSSFCell cell) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } - - public void outExcelFun(HttpServletResponse response, String date, String unitId, String groupTypeId) throws IOException { - String fileName = date.substring(0, 7) + "交接班排班.xls"; - String title = "交接班排班"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - // 生成并设置一个样式,用于注释 - HSSFCellStyle tipStyle = workbook.createCellStyle(); - tipStyle.setAlignment(HorizontalAlignment.CENTER); - tipStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont tipfont = workbook.createFont(); - tipfont.setColor(IndexedColors.RED.index); - tipfont.setBold(false); - tipfont.setFontHeightInPoints((short) 9); - // 把字体应用到当前的样式 - tipStyle.setFont(tipfont); - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 11); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - - - //产生表格表头 - String excelTitleStr = "排班日期,班组类型,班次,班组,模式,"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 400); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 40000); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("交接班排班"); - // 说明 - HSSFCell smcell = handRow.createCell(5); - smcell.setCellStyle(tipStyle); - smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。"); - - GroupType groupType = this.groupTypeService.selectById(groupTypeId); - String groupTypeName = ""; - if (groupType != null) { - groupTypeName = groupType.getName(); - } - - List list = selectListByWhere(" where bizid='" + unitId + "' and schedulingtype='" + groupTypeId + "' and datediff(month,'" + date + "',stdt)=0 " + " order by stdt "); - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - Scheduling scheduling = list.get(i); - HSSFRow listrow1 = sheet.createRow(i + 2); - listrow1.setHeight((short) 400); - HSSFCell listcell1 = listrow1.createCell(0); - listcell1.setCellStyle(listStyle); - listcell1.setCellValue(scheduling.getStdt().substring(0, 10)); - - HSSFCell listcell2 = listrow1.createCell(1); - listcell2.setCellStyle(listStyle); - listcell2.setCellValue(groupTypeName); - - HSSFCell listcell3 = listrow1.createCell(2); - listcell3.setCellStyle(listStyle); - GroupTime groupTime = this.groupTimeService.selectById(scheduling.getGroupmanageid()); - if (groupTime != null) { - listcell3.setCellValue(groupTime.getName()); - } else { - listcell3.setCellValue(""); - } - - HSSFCell listcell4 = listrow1.createCell(3); - listcell4.setCellStyle(listStyle); - GroupDetail groupDetail = this.groupDetailService.selectById(scheduling.getGroupdetailId()); - if (groupDetail != null) { - listcell4.setCellValue(groupDetail.getName()); - } else { - listcell4.setCellValue(""); - } - - HSSFCell listcell5 = listrow1.createCell(4); - listcell5.setCellStyle(listStyle); - PatrolModel patrolModel = this.patrolModelService.selectById(scheduling.getPatrolmode()); - if (patrolModel != null) { - listcell5.setCellValue(patrolModel.getName()); - } else { - listcell5.setCellValue(""); - } - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - - - public void outTemplateExcelFun(HttpServletResponse response) throws IOException { - String fileName = "交接班排班模板.xls"; - String title = "交接班排班模板"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - // 生成并设置一个样式,用于注释 - HSSFCellStyle tipStyle = workbook.createCellStyle(); - tipStyle.setAlignment(HorizontalAlignment.CENTER); - tipStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成另一个字体 - HSSFFont tipfont = workbook.createFont(); - tipfont.setColor(IndexedColors.RED.index); - tipfont.setBold(false); - tipfont.setFontHeightInPoints((short) 9); - // 把字体应用到当前的样式 - tipStyle.setFont(tipfont); - - // 生成一个样式,用在表格列名 - HSSFCellStyle columnNameStyle = workbook.createCellStyle(); - // 设置这些样式 - columnNameStyle.setBorderBottom(BorderStyle.THIN); - columnNameStyle.setBorderLeft(BorderStyle.THIN); - columnNameStyle.setBorderRight(BorderStyle.THIN); - columnNameStyle.setBorderTop(BorderStyle.THIN); - columnNameStyle.setAlignment(HorizontalAlignment.CENTER); - columnNameStyle.setVerticalAlignment(VerticalAlignment.CENTER); - columnNameStyle.setWrapText(true); - columnNameStyle.setFillForegroundColor(IndexedColors.YELLOW.index); - columnNameStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - columnNameStyle.setFillBackgroundColor(IndexedColors.YELLOW.index); - // 生成一个字体 - HSSFFont columnNamefont = workbook.createFont(); - columnNamefont.setFontHeightInPoints((short) 12); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - columnNameStyle.setFont(columnNamefont); - - // 生成一个样式,用在表格数据 - HSSFCellStyle listStyle = workbook.createCellStyle(); - // 设置这些样式 - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setAlignment(HorizontalAlignment.CENTER); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 生成一个字体 - HSSFFont listfont = workbook.createFont(); - listfont.setFontHeightInPoints((short) 11); - //columnNamefont.setBold(true); - // 把字体应用到当前的样式 - listStyle.setFont(listfont); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 -// HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. -// comment.setAuthor("leno"); - - - //产生表格表头 - String excelTitleStr = "排班日期,班组类型,班次,班组,模式,"; - - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 400); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(columnNameStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 4000); - sheet.setColumnWidth(1, 4000); - sheet.setColumnWidth(2, 4000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 40000); - - // 第一行表头标题 - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length - 1)); - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 500); - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue("交接班排班"); - // 说明 - HSSFCell smcell = handRow.createCell(5); - smcell.setCellStyle(tipStyle); - smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。"); - - HSSFRow listrow1 = sheet.createRow(2); - listrow1.setHeight((short) 400); - HSSFCell listcell1 = listrow1.createCell(0); - listcell1.setCellStyle(listStyle); - listcell1.setCellValue("2020-01-01"); - HSSFCell listcell2 = listrow1.createCell(1); - listcell2.setCellStyle(listStyle); - listcell2.setCellValue("运行班"); - HSSFCell listcell3 = listrow1.createCell(2); - listcell3.setCellStyle(listStyle); - listcell3.setCellValue("白班"); - HSSFCell listcell4 = listrow1.createCell(3); - listcell4.setCellStyle(listStyle); - listcell4.setCellValue("运行1班"); - HSSFCell listcell5 = listrow1.createCell(4); - listcell5.setCellStyle(listStyle); - listcell5.setCellValue("常规模式"); - - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - - } finally { - workbook.close(); - } - } - -} diff --git a/src/com/sipai/service/work/SpeechRecognitionMpRespondService.java b/src/com/sipai/service/work/SpeechRecognitionMpRespondService.java deleted file mode 100644 index 3ff4e1cb..00000000 --- a/src/com/sipai/service/work/SpeechRecognitionMpRespondService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.work; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.SpeechRecognitionMpRespondDao; -import com.sipai.entity.work.SpeechRecognitionMpRespond; -import com.sipai.tools.CommService; - -@Service -public class SpeechRecognitionMpRespondService implements CommService{ - @Resource - private SpeechRecognitionMpRespondDao speechRecognitionMpRespondDao; - - @Override - public SpeechRecognitionMpRespond selectById(String t) { - // TODO Auto-generated method stub - return speechRecognitionMpRespondDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return speechRecognitionMpRespondDao.deleteByPrimaryKey(t); - } - - @Override - public int save(SpeechRecognitionMpRespond t) { - // TODO Auto-generated method stub - return speechRecognitionMpRespondDao.insertSelective(t); - } - - @Override - public int update(SpeechRecognitionMpRespond t) { - // TODO Auto-generated method stub - return speechRecognitionMpRespondDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - SpeechRecognitionMpRespond speechRecognitionMpRespond = new SpeechRecognitionMpRespond(); - speechRecognitionMpRespond.setWhere(t); - List list = this.speechRecognitionMpRespondDao.selectListByWhere(speechRecognitionMpRespond); - return list; - } - - @Override - public int deleteByWhere(String t) { - SpeechRecognitionMpRespond speechRecognitionMpRespond = new SpeechRecognitionMpRespond(); - speechRecognitionMpRespond.setWhere(t); - return speechRecognitionMpRespondDao.deleteByWhere(speechRecognitionMpRespond); - } - -} diff --git a/src/com/sipai/service/work/SpeechRecognitionService.java b/src/com/sipai/service/work/SpeechRecognitionService.java deleted file mode 100644 index c095d2ce..00000000 --- a/src/com/sipai/service/work/SpeechRecognitionService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.work; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.SpeechRecognitionDao; -import com.sipai.entity.work.SpeechRecognition; -import com.sipai.tools.CommService; - -@Service -public class SpeechRecognitionService implements CommService{ - @Resource - private SpeechRecognitionDao speechRecognitionDao; - - @Override - public SpeechRecognition selectById(String t) { - // TODO Auto-generated method stub - return speechRecognitionDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return speechRecognitionDao.deleteByPrimaryKey(t); - } - - @Override - public int save(SpeechRecognition t) { - // TODO Auto-generated method stub - return speechRecognitionDao.insertSelective(t); - } - - @Override - public int update(SpeechRecognition t) { - // TODO Auto-generated method stub - return speechRecognitionDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - SpeechRecognition speechRecognition = new SpeechRecognition(); - speechRecognition.setWhere(t); - List list = this.speechRecognitionDao.selectListByWhere(speechRecognition); - return list; - } - - @Override - public int deleteByWhere(String t) { - SpeechRecognition speechRecognition = new SpeechRecognition(); - speechRecognition.setWhere(t); - return speechRecognitionDao.deleteByWhere(speechRecognition); - } - -} diff --git a/src/com/sipai/service/work/WeatherNewService.java b/src/com/sipai/service/work/WeatherNewService.java deleted file mode 100644 index f947d9b1..00000000 --- a/src/com/sipai/service/work/WeatherNewService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.service.work; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import com.sipai.entity.work.WeatherNew; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public interface WeatherNewService { - - public WeatherNew selectById(String t); - - public int deleteById(String t); - - public int save(WeatherNew t); - - public int update(WeatherNew t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - - public List selectTop1ListByWhere(String wherestr); - - public int updateByTimeSelective(WeatherNew t); - - void doExport(HttpServletRequest request, HttpServletResponse response) throws IOException; - - String readXls(InputStream input, String userId) throws IOException; - - String readXlsx(InputStream input, String userId) throws IOException; - - void exportTemp(HttpServletRequest request, HttpServletResponse response) throws IOException ; -} diff --git a/src/com/sipai/service/work/WeatherNewServiceImpl.java b/src/com/sipai/service/work/WeatherNewServiceImpl.java deleted file mode 100644 index 24a9ffcc..00000000 --- a/src/com/sipai/service/work/WeatherNewServiceImpl.java +++ /dev/null @@ -1,1166 +0,0 @@ -package com.sipai.service.work; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.entity.enums.*; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Company; -import com.sipai.entity.work.WeatherSaveName; -import com.sipai.service.company.CompanyService; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.ValueTypeEnum; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFCell; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WeatherNewDao; -import com.sipai.entity.work.WeatherNew; -import org.springframework.transaction.annotation.Transactional; - -import static org.apache.poi.ss.usermodel.CellType.STRING; - -@Service("weatherNewService") -public class WeatherNewServiceImpl implements WeatherNewService{ - @Resource - private WeatherNewDao weatherNewDao; - - @Resource - private CompanyService companyService; - - @Resource - MPointHistoryService mPointHistoryService; - - @Resource - WeatherSaveNameService weatherSaveNameService; - - public HashMap> weatherNewHashMap; - - @Override - public WeatherNew selectById(String t) { - // TODO Auto-generated method stub - return weatherNewDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return weatherNewDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WeatherNew t) { - // TODO Auto-generated method stub - return weatherNewDao.insertSelective(t); - } - - @Override - public int update(WeatherNew t) { - // TODO Auto-generated method stub - return weatherNewDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - WeatherNew weatherNew = new WeatherNew(); - weatherNew.setWhere(t); - List list = this.weatherNewDao.selectListByWhere(weatherNew); - for (int i = 0; i < list.size(); i++) { - if (StringUtils.isNotBlank(list.get(i).getBizid())) { - Company company = companyService.selectByPrimaryKey(list.get(i).getBizid()); - list.get(i).setCompanyName(company.getName()); - } - } - return list; - } - - @Override - public int deleteByWhere(String t) { - WeatherNew weatherNew = new WeatherNew(); - weatherNew.setWhere(t); - return weatherNewDao.deleteByWhere(weatherNew); - } - - public List selectTop1ListByWhere(String wherestr) { - WeatherNew entity = new WeatherNew(); - entity.setWhere(wherestr); - List list = weatherNewDao.selectTop1ListByWhere(entity); - return list; - } - - public int updateByTimeSelective(WeatherNew t) { - return weatherNewDao.updateByTimeSelective(t); - } - - /** - * 天气预报导出 - * @param response - * @param - * @throws IOException - */ - public void doExport(HttpServletRequest request, - HttpServletResponse response) throws IOException { - - String fileName = "天气预报.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "天气预报"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - // 序号 - sheet.setColumnWidth(0, 4000); - // 公司 - sheet.setColumnWidth(1, 4000); - // 城市 - sheet.setColumnWidth(2, 4000); - // bizid - sheet.setColumnWidth(3, 4000); - // 时间 - sheet.setColumnWidth(4, 8000); - // 降雨量 - sheet.setColumnWidth(5, 4000); - // 最高气温 - sheet.setColumnWidth(6, 4000); - // 最低气温 - sheet.setColumnWidth(7, 4000); - // 天气 - sheet.setColumnWidth(8, 4000); - // 温度 - sheet.setColumnWidth(9, 4000); - // 风向 - sheet.setColumnWidth(10, 4000); - // 湿度 - sheet.setColumnWidth(11, 4000); - // 风力 - sheet.setColumnWidth(12, 4000); - // 体感温度 - sheet.setColumnWidth(13, 4000); - // 大气压强 - sheet.setColumnWidth(14, 4000); - // 能见度 - sheet.setColumnWidth(15, 4000); - // 风速 - sheet.setColumnWidth(16, 6000); - // 潮汐 - sheet.setColumnWidth(17, 6000); - // 天气类型 - sheet.setColumnWidth(18, 6000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("sipaiis"); - //产生表格表头 - String excelTitleStr = "序号,公司,城市,bizid,时间,降水量-毫米,最高气温,最低气温,天气,温度,风向,湿度,风力,体感温度,大气压强-百帕,能见度-公里,风速( 公里每小时 ),潮汐,天气类型( 0实时 1预报 )"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("天气预报"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - List list = new ArrayList<>(); - if (StringUtils.isNotBlank(request.getParameter("unitId")) && !"null".equals(request.getParameter("unitId"))) { - list = this.selectListByWhere("where bizid = '" + request.getParameter("unitId") + "' and type = " + WeatherTypeEnum.WEATHER_TYPE_FUTURE.getId() + " order by time desc"); - } else { - list = this.selectListByWhere("where type = " + WeatherTypeEnum.WEATHER_TYPE_FUTURE.getId() + " order by time desc"); - } - - if(list!=null && list.size()>0){ - JSONObject jsonObject1 = new JSONObject(); - JSONObject jsonObject2 = new JSONObject(); - - for (int i = 0; i < list.size(); i++ ) { - row = sheet.createRow(2+i);//第三行为插入的数据行 - row.setHeight((short) 400); - Company company = companyService.selectByPrimaryKey(list.get(i).getBizid()); - - // 序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i); - // 公司 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(company.getName()); - // 城市 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getCity()); - // bizid - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getBizid()); - // 时间 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getTime()); - // 降雨量 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getPrecip()); - // 最高气温 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(list.get(i).getHighTemp()); - // 最低气温 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(list.get(i).getLowTemp()); - // 天气 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(list.get(i).getWeather()); - // 温度 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(list.get(i).getTemp()); - // 风向 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(list.get(i).getWind()); - // 湿度 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(list.get(i).getHumidity()); - // 风力 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(list.get(i).getWindPower()); - // 体感温度 - HSSFCell cell_14 = row.createCell(13); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(list.get(i).getFeelslike()); - // 大气压强 - HSSFCell cell_15 = row.createCell(14); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(list.get(i).getPressure()); - // 能见度 - HSSFCell cell_16 = row.createCell(15); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(list.get(i).getVis()); - // 风速 - HSSFCell cell_17 = row.createCell(16); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(list.get(i).getWindspeed()); - // 天气类型 - HSSFCell cell_18 = row.createCell(17); - cell_18.setCellStyle(listStyle); - cell_18.setCellValue(list.get(i).getTide()); - // 天气类型 - HSSFCell cell_19 = row.createCell(18); - cell_19.setCellStyle(listStyle); - cell_19.setCellValue(list.get(i).getType()); - } - - int rownum = 2;//第2行开始 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - for(Iterator iter = jsonObject2.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - rownum = rownum + num; - } - - rownum = 2;//第2行开始 - - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - /** - * xls表格导入 - * - * @param input - * @return readXls - * @throws IOException - */ - public String readXls(InputStream input, String userId) throws IOException { - HSSFWorkbook workbook = new HSSFWorkbook(input); - int insertNum = 0, updateNum = 0; - ArrayList weatherNews = new ArrayList<>(); - weatherNewHashMap = new HashMap<>(); - HashSet bizIds = new HashSet<>(); - for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { - HSSFSheet sheet = workbook.getSheetAt(numSheet); - HSSFRow rowTitle = sheet.getRow(2); - //如果表头小于7列时,sheet不符合模板规范,不导入 - if (sheet == null || rowTitle.getLastCellNum() < 7) { - continue; - } - for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { - //前2行为表头,读取数据从rowNum+2行开始 - HSSFRow row = sheet.getRow(rowNum); - // 前两列为公司名称与城市 所以从第三列开始 - int minCellNum = 2; - int maxCellNum = row.getLastCellNum();//最后一列 - WeatherNew weatherNew = new WeatherNew(); - for (int i = minCellNum; i < maxCellNum; i++) { - HSSFCell cell = row.getCell(i); - try { - switch (i) { - // 序号 - case 0: - weatherNew.setSort(getStringVal(cell)); - break; - // 公司 - case 1: - weatherNew.setCompanyName(getStringVal(cell)); - break; - // 城市 - case 2: - weatherNew.setCity(getStringVal(cell)); - break; - // 厂区id - case 3: - weatherNew.setBizid(getStringVal(cell)); - bizIds.add(getStringVal(cell)); - break; - // 时间 - case 4: - weatherNew.setTime(getStringVal(cell)); - break; - // 降雨量 - case 5: - weatherNew.setPrecip(getStringVal(cell)); - break; - // 最高气温 - case 6: - weatherNew.setHighTemp(getStringVal(cell)); - break; - // 最低气温 - case 7: - weatherNew.setLowTemp(getStringVal(cell)); - break; - // 天气 - case 8: - weatherNew.setWeather(getStringVal(cell)); - break; - // 温度 - case 9: - weatherNew.setTemp(getStringVal(cell)); - break; - // 风向 - case 10: - weatherNew.setWind(getStringVal(cell)); - break; - // 湿度 - case 11: - weatherNew.setHumidity(getStringVal(cell)); - break; - // 风力 - case 12: - weatherNew.setWindPower(getStringVal(cell)); - break; - // 体感温度 - case 13: - weatherNew.setFeelslike(getStringVal(cell)); - break; - // 大气压强 - case 14: - weatherNew.setPressure(getStringVal(cell)); - break; - // 能见度 - case 15: - weatherNew.setVis(getStringVal(cell)); - break; - // 风速 - case 16: - weatherNew.setWindspeed(getStringVal(cell)); - break; - // 潮汐 - case 17: - weatherNew.setTide(getStringVal(cell)); - break; - // 天气类型 - case 18: - weatherNew.setType(Integer.valueOf(getStringVal(cell))); - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - // TODO: handle exception - } - } - weatherNews.add(weatherNew); - // 如果get出来是空的则新建一个list去put - if (weatherNewHashMap.get(weatherNew.getBizid()) == null) { - ArrayList add = new ArrayList<>(); - weatherNewHashMap.put(weatherNew.getBizid(), add); - } else { - weatherNewHashMap.get(weatherNew.getBizid()).add(weatherNew); - } - } - } - String res = ""; - String errorBizId = "errorBizId"; - List weatherSaveNames = weatherSaveNameService.selectListByWhere("where 1 = 1"); - for (String bizId : bizIds) { - try { - for (WeatherSaveName weatherSaveName : weatherSaveNames) { - mPointHistoryService.deleteByTableAWhere(bizId, "TB_MP_" + weatherSaveName.getTbWeatherName(), "where 1 = 1"); - } - } catch (Exception e) { - errorBizId += bizId; - } - } - for (int i = 0; i < weatherNews.size(); i++) { - WeatherNew weatherNew = weatherNews.get(i); - weatherNew.setId(CommUtil.getUUID()); - String timeWhere = ""; - if (weatherNew.getType() == 0) { - timeWhere = parseTime(weatherNew.getTime()); - } else { - timeWhere = " and time = '" + weatherNew.getTime(); - } - - // 新增天气表 - List weatherNews1 = this.selectListByWhere("where bizid = '" + weatherNew.getBizid() + "' and type = '" + weatherNew.getType() + "'" + timeWhere + "'"); - if (weatherNews1 != null && weatherNews1.size() > 0) { - updateNum += weatherNewDao.updateByTimeSelective(weatherNew); - } else { - weatherNew.setId(CommUtil.getUUID()); - try { - insertNum += weatherNewDao.insert(weatherNew); - } catch (Exception e) { - e.printStackTrace(); - res += "序号: ( " + weatherNew.getSort() + " ) 导入失败"; - } - } - // 如果错误的bizid中包含此bizid则跳出循环 - if (errorBizId.contains(weatherNew.getBizid())){ - break; - } - updateOrInsert(weatherNew.getBizid(), weatherNew); - } - - String result = ""; - if (StringUtils.isBlank(res)) { - result = "导入成功!"; - } else { - result = res; - } - return result; - } - - public String parseTime(String time) { - HashMap map = new HashMap<>(); - String startTime = time.substring(0, 13) + ":00:00"; - Integer end = Integer.valueOf(time.substring(11, 13)); - String endTime = ""; - String where = ""; - if (end == 23) { - endTime = time.substring(0, 12) + "00:00:00"; - } else { - end += 1; - if (end.toString().length() < 2) { - endTime = time.substring(0, 11) + "0" + end + ":00:00"; - } else { - endTime = time.substring(0, 11) + end + ":00:00"; - } - } - where = " and time > '" + startTime + "' and time < '" + endTime + "'"; - return where; - } - - public String updateOrInsert(String bizId, WeatherNew weatherNew) { - String res = ""; - List weatherSaveNames = weatherSaveNameService.selectListByWhere("where 1 = 1"); - for (int i = 0; i < weatherSaveNames.size(); i++) { - MPointHistory history = new MPointHistory(); - history.setMeasuredt(weatherNew.getTime()); - WeatherSaveName weatherSaveName = weatherSaveNames.get(i); - String where = "where measuredt between '" + history.getMeasuredt().substring(0, 11) + "' and dateadd(second,-1,dateadd(day,1,'" + history.getMeasuredt().substring(0, 11) +"'))"; - if(String.valueOf(weatherSaveName.getType()).equals("0")) { - // 降雨量 - try { - history.setParmvalue(new BigDecimal(weatherNew.getPrecip().replace("mm", ""))); - history.setTbName("TB_MP_" + weatherSaveName.getTbWeatherName()); - } catch (Exception e) { - } - } else if (String.valueOf(weatherSaveName.getType()).equals("1")){ - // 最高温度 - try { - history.setParmvalue(new BigDecimal(weatherNew.getHighTemp().replace("℃", ""))); - history.setTbName("TB_MP_" + weatherSaveName.getTbWeatherName()); - } catch (Exception e) { - } - } else if (String.valueOf(weatherSaveName.getType()).equals("2")){ - // 最低气温 - try { - history.setParmvalue(new BigDecimal(weatherNew.getLowTemp().replace("℃", ""))); - history.setTbName("TB_MP_" + weatherSaveName.getTbWeatherName()); - } catch (Exception e) { - } - } else if (String.valueOf(weatherSaveName.getType()).equals("3")){ - // 潮汐 - try { - String startTime = history.getMeasuredt().substring(0, 15) + ":00:00"; - Integer end = Integer.valueOf(history.getMeasuredt().substring(11, 13)); - String endTime = ""; - if (end == 23) { - endTime = history.getMeasuredt().substring(0, 11) + "00:00:00"; - } else { - end += 1; - if (end.toString().length() < 2) { - endTime = history.getMeasuredt().substring(0, 11) + "0" + end + ":00:00"; - } else { - endTime = history.getMeasuredt().substring(0, 11) + end + ":00:00"; - } - } - // 潮汐 - history.setParmvalue(new BigDecimal(weatherNew.getTide())); - history.setTbName("TB_MP_" + weatherSaveName.getTbWeatherName()); - where = "where MeasureDT > '" + startTime + "' and MeasureDT < '" + endTime + "'"; - } catch (Exception e) { - } - } - try { - List mPointHistories = mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + weatherSaveName.getTbWeatherName(), where); - if (mPointHistories.size() > 0) { - mPointHistories.get(0).setParmvalue(history.getParmvalue()); - mPointHistories.get(0).setTbName("TB_MP_" + weatherSaveName.getTbWeatherName()); - mPointHistoryService.updateByMeasureDt(bizId, mPointHistories.get(0)); - } else { - mPointHistoryService.save(bizId, history); - } - List mPointHistoryList = mPointHistoryService.selectListByTableAWhere(bizId, "TB_MP_" + weatherSaveName.getTbWeatherSaveName(), where); - if (mPointHistoryList.size() > 0) { - mPointHistoryList.get(0).setParmvalue(history.getParmvalue()); - mPointHistoryList.get(0).setTbName("TB_MP_" + weatherSaveName.getTbWeatherSaveName()); - mPointHistoryService.updateByMeasureDt(bizId, mPointHistoryList.get(0)); - } else { - MPointHistory mPointHistory = history; - mPointHistory.setTbName("TB_MP_" + weatherSaveName.getTbWeatherSaveName()); - mPointHistoryService.save(bizId, mPointHistory); - } - } catch (Exception e) { - e.printStackTrace(); - res += "序号(" + weatherNew.getSort() + "): 导入子表失败;"; - } - } - return res; - } - - /** - * xlsx文件导入 - * - * @param - * @return - * @throws IOException - */ - public String readXlsx(InputStream input, String userId) throws IOException { -// XSSFWorkbook workbook = new XSSFWorkbook(input); -// int insertNum = 0, updateNum = 0; -// ArrayList weatherNews = new ArrayList<>(); -// HashSet bizIds = new HashSet<>(); -// for (int numSheet = 0; numSheet < workbook.getNumberOfSheets(); numSheet++) { -// XSSFSheet sheet = workbook.getSheetAt(numSheet); -// XSSFRow rowTitle = sheet.getRow(2); -// //如果表头小于7列时,sheet不符合模板规范,不导入 -// if (sheet == null || rowTitle.getLastCellNum() < 7) { -// continue; -// } -// -// for (int rowNum = 2; rowNum <= sheet.getLastRowNum(); rowNum++) { -// //前2行为表头,读取数据从rowNum+2行开始 -// XSSFRow row = sheet.getRow(rowNum); -// // 前两路列为公司名称与城市 所以从第散列开始 -// int minCellNum = 2; -// int maxCellNum = row.getLastCellNum();//最后一列 -// WeatherNew weatherNew = new WeatherNew(); -// for (int i = minCellNum; i < maxCellNum; i++) { -// XSSFCell cell = row.getCell(i); -// try { -// switch (i) { -// // 序号 -// case 0: -// weatherNew.setSort(getStringVal(cell)); -// // 厂区id -// case 3: -// weatherNew.setBizid(getStringVal(cell)); -// bizIds.add(getStringVal(cell)); -// break; -// // 时间 -// case 4: -// weatherNew.setTime(getStringVal(cell)); -// break; -// // 降雨量 -// case 5: -// weatherNew.setPrecip(getStringVal(cell)); -// break; -// // 最高气温 -// case 6: -// weatherNew.setHighTemp(getStringVal(cell)); -// break; -// // 最低气温 -// case 7: -// weatherNew.setLowTemp(getStringVal(cell)); -// break;// 天气 -// case 8: -// weatherNew.setWeather(getStringVal(cell)); -// break; -// // 温度 -// case 9: -// weatherNew.setTemp(getStringVal(cell)); -// break; -// // 风向 -// case 10: -// weatherNew.setWind(getStringVal(cell)); -// break; -// // 湿度 -// case 11: -// weatherNew.setHumidity(getStringVal(cell)); -// break; -// // 风力 -// case 12: -// weatherNew.setWindPower(getStringVal(cell)); -// break; -// // 降水量 -// case 13: -// weatherNew.setPrecip(getStringVal(cell)); -// break; -// // 体感温度 -// case 14: -// weatherNew.setFeelslike(getStringVal(cell)); -// break; -// // 大气压强 -// case 15: -// weatherNew.setPressure(getStringVal(cell)); -// break; -// // 能见度 -// case 16: -// weatherNew.setVis(getStringVal(cell)); -// break; -// // 风速 -// case 17: -// weatherNew.setWindspeed(getStringVal(cell)); -// break; -// // 天气类型 -// case 18: -// weatherNew.setTide(getStringVal(cell)); -// break; -// // 天气类型 -// case 19: -// weatherNew.setType(Integer.valueOf(getStringVal(cell))); -// break; -// default: -// break; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// // TODO: handle exception -// } -// } -// weatherNews.add(weatherNew); -// } -// } -// -// String res = ""; -// -// for (int i = 0; i < weatherNews.size(); i++) { -// WeatherNew weatherNew = weatherNews.get(i); -// weatherNew.setId(CommUtil.getUUID()); -// // 新增天气表 -// List weatherNews1 = this.selectListByWhere("where time = '" + weatherNew.getTime() + "' and bizid = '" + weatherNew.getBizid() + "' and type = '" + weatherNew.getType() + "'"); -// if (weatherNews1 != null && weatherNews1.size() > 0) { -// updateNum += weatherNewDao.updateByTimeSelective(weatherNew); -// } else { -// weatherNew.setId(CommUtil.getUUID()); -// insertNum += weatherNewDao.insert(weatherNew); -// } -// -// String errorBizId = "errorBizId"; -// -// // 如果错误的bizid中包含此bizid则跳出循环 -// if (errorBizId.contains(weatherNew.getBizid())){ -// break; -// } -// // 降雨量 -// MPointHistory rainfallHistory = new MPointHistory(); -// rainfallHistory.setMeasuredt(weatherNew.getTime()); -// rainfallHistory.setParmvalue(new BigDecimal(weatherNew.getPrecip().replace("mm", ""))); -// // 降雨量子表名称 -// rainfallHistory.setTbName("TB_MP_" + ForecastEnum.TH_RAINFALL_FORECAST_30_DAYS.getName()); -// try { -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), rainfallHistory); -// MPointHistory mPointHistory = rainfallHistory; -// mPointHistory.setTbName("TB_MP_" + ForecastEnum.TH_RAINFALL_FORECAST_30_DAYS_SAVE.getName()); -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), mPointHistory); -// } catch (Exception e) { -// e.printStackTrace(); -// res += "序号( " + weatherNew.getSort() + " )新增失败"; -// } -// -// // 最高温度 -// MPointHistory maxTempHistory = new MPointHistory(); -// maxTempHistory.setMeasuredt(weatherNew.getTime()); -// maxTempHistory.setParmvalue(new BigDecimal(weatherNew.getHighTemp().replace("℃", ""))); -// // 降雨量子表名称 -// maxTempHistory.setTbName("TB_MP_" + ForecastEnum.TH_MAX_TEMP_FORECAST_30_DAYS.getName()); -// try { -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), maxTempHistory); -// MPointHistory mPointHistory = maxTempHistory; -// mPointHistory.setTbName("TB_MP_" + ForecastEnum.TH_MAX_TEMP_FORECAST_30_DAYS_SAVE.getName()); -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), mPointHistory); -// } catch (Exception e) { -// e.printStackTrace(); -// res += "序号( " + weatherNew.getSort() + " )新增失败"; -// } -// -// // 最低温度 -// MPointHistory minTempHistory = new MPointHistory(); -// minTempHistory.setMeasuredt(weatherNew.getTime()); -// minTempHistory.setParmvalue(new BigDecimal(weatherNew.getLowTemp().replace("℃", ""))); -// // 降雨量子表名称 -// minTempHistory.setTbName("TB_MP_" + ForecastEnum.TH_MIN_TEMP_FORECAST_30_DAYS.getName()); -// try { -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), minTempHistory); -// MPointHistory mPointHistory = minTempHistory; -// mPointHistory.setTbName("TB_MP_" + ForecastEnum.TH_MIN_TEMP_FORECAST_30_DAYS_SAVE.getName()); -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), mPointHistory); -// } catch (Exception e) { -// e.printStackTrace(); -// res += "序号( " + weatherNew.getSort() + " )新增失败"; -// } -// // 潮汐 -// MPointHistory minTideHistory = new MPointHistory(); -// minTideHistory.setMeasuredt(weatherNew.getTime()); -// minTideHistory.setParmvalue(new BigDecimal(weatherNew.getLowTemp().replace("℃", ""))); -// // 降雨量子表名称 -// minTideHistory.setTbName("TB_MP_" + ForecastEnum.TH_MIN_TEMP_FORECAST_30_DAYS.getName()); -// try { -//// mPointHistoryService.selectListByTableAWhere(weatherNew.getBizid(), ) -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), minTempHistory); -// MPointHistory mPointHistory = minTempHistory; -// mPointHistory.setTbName("TB_MP_" + ForecastEnum.TH_MIN_TEMP_FORECAST_30_DAYS_SAVE.getName()); -// insertNum += mPointHistoryService.save(weatherNew.getBizid(), mPointHistory); -// } catch (Exception e) { -// e.printStackTrace(); -// res += "序号( " + weatherNew.getSort() + " )新增失败"; -// } -// } -// -// String result = ""; -// if (StringUtils.isBlank(res)) { -// result = "导入成功!"; -// } else { -// result = res; -// } - return null; - } - - @Override - public void exportTemp(HttpServletRequest request, HttpServletResponse response) throws IOException { - String unitId = request.getParameter("unitId"); - String fileName = "天气预报模板.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "天气预报"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - // 序号 - sheet.setColumnWidth(0, 4000); - // 公司 - sheet.setColumnWidth(1, 4000); - // 城市 - sheet.setColumnWidth(2, 4000); - // bizid - sheet.setColumnWidth(3, 4000); - // 时间 - sheet.setColumnWidth(4, 8000); - // 降雨量 - sheet.setColumnWidth(5, 4000); - // 最高气温 - sheet.setColumnWidth(6, 4000); - // 最低气温 - sheet.setColumnWidth(7, 4000); - // 天气 - sheet.setColumnWidth(8, 4000); - // 温度 - sheet.setColumnWidth(9, 4000); - // 风向 - sheet.setColumnWidth(10, 4000); - // 湿度 - sheet.setColumnWidth(11, 4000); - // 风力 - sheet.setColumnWidth(12, 4000); - // 体感温度 - sheet.setColumnWidth(13, 4000); - // 大气压强 - sheet.setColumnWidth(14, 4000); - // 能见度 - sheet.setColumnWidth(15, 4000); - // 风速 - sheet.setColumnWidth(16, 6000); - // 潮汐 - sheet.setColumnWidth(17, 4000); - // 天气类型 - sheet.setColumnWidth(18, 6500); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("sipaiis"); - //产生表格表头 - String excelTitleStr = "序号,公司,城市,bizid,时间,降雨量,最高气温,最低气温,天气,温度,风向,湿度,风力,体感温度,大气压强-百帕,能见度-公里,风速( 公里每小时 ),潮汐,天气类型( 0实时 1预报 2潮汐 )"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(1); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - cell.setCellStyle(headStyle); - cell.setCellValue("天气预报"); - } - - for (int i = 0; i < 6; i++) { - row = sheet.createRow(2+i);//第三行为插入的数据行 - row.setHeight((short) 400); - Company company = companyService.selectByPrimaryKey(unitId); - - // 序号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(i); - // 公司 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(company.getName()); - // 城市 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(company.getCity()); - // bizid - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(company.getId()); - // 时间 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(CommUtil.nowDate()); - // 降雨量 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(i > 3 ? "" : "0.0mm"); - // 最高气温 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(i > 3 ? "" : "3℃"); - // 最低气温 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue(i > 3 ? "" : "-6℃"); - // 天气 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(i > 3 ? "" : "晴"); - // 温度 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(i > 3 ? "" : "17"); - // 风向 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(i > 3 ? "" : "西北风"); - // 湿度 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - cell_11.setCellValue(i > 3 ? "" : "93"); - // 风力 - HSSFCell cell_12 = row.createCell(12); - cell_12.setCellStyle(listStyle); - cell_12.setCellValue(i > 3 ? "" : "1-2级"); - // 体感温度 - HSSFCell cell_14 = row.createCell(13); - cell_14.setCellStyle(listStyle); - cell_14.setCellValue(i > 3 ? "" : "18"); - // 大气压强 - HSSFCell cell_15 = row.createCell(14); - cell_15.setCellStyle(listStyle); - cell_15.setCellValue(i > 3 ? "" : "1022hPa"); - // 能见度 - HSSFCell cell_16 = row.createCell(15); - cell_16.setCellStyle(listStyle); - cell_16.setCellValue(i > 3 ? "" : "22公里"); - // 风速 - HSSFCell cell_17 = row.createCell(16); - cell_17.setCellStyle(listStyle); - cell_17.setCellValue(i > 3 ? "" : "11/h"); - // 潮汐 - HSSFCell cell_18 = row.createCell(17); - cell_18.setCellStyle(listStyle); - cell_18.setCellValue(i > 3 ? "" : "1"); - // 天气类型 - HSSFCell cell_19 = row.createCell(18); - cell_19.setCellStyle(listStyle); - cell_19.setCellValue(i > 3 ? "" : "1"); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length)); - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - /** - * xlsx文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(XSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - - /** - * xls文件数据转换 - * - * @param cell - * @return - */ - private String getStringVal(HSSFCell cell) { - if (cell != null) { - switch (cell.getCellType()) { - case BOOLEAN: - return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; - case FORMULA: - return cell.getCellFormula(); - case NUMERIC: - //判断是否为日期类型 - if (DateUtil.isCellDateFormatted(cell)) { - //用于转化为日期格式 - Date d = cell.getDateCellValue(); - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String cellDate = formater.format(d); - return cellDate; - } else { - cell.setCellType(STRING); - return cell.getStringCellValue(); - } - case STRING: - return cell.getStringCellValue(); - default: - return null; - } - } else { - return null; - } - } - -} diff --git a/src/com/sipai/service/work/WeatherSaveNameService.java b/src/com/sipai/service/work/WeatherSaveNameService.java deleted file mode 100644 index 27396b63..00000000 --- a/src/com/sipai/service/work/WeatherSaveNameService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.sipai.service.work; - -import com.sipai.dao.work.WeatherSaveNameDao; -import com.sipai.entity.work.WeatherSaveName; -import com.sipai.tools.CommService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.List; - -@Service -public class WeatherSaveNameService implements CommService { - - @Resource - WeatherSaveNameDao weatherSaveNameDao; - - @Override - public WeatherSaveName selectById(String t) { - return weatherSaveNameDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) throws IOException { - return weatherSaveNameDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WeatherSaveName weatherSaveName) { - return weatherSaveNameDao.insert(weatherSaveName); - } - - @Override - public int update(WeatherSaveName weatherSaveName) { - return weatherSaveNameDao.updateByPrimaryKeySelective(weatherSaveName); - } - - @Override - public List selectListByWhere(String t) { - WeatherSaveName weatherSaveName = new WeatherSaveName(); - weatherSaveName.setWhere(t); - return weatherSaveNameDao.selectListByWhere(weatherSaveName); - } - - @Override - public int deleteByWhere(String t) { - WeatherSaveName weatherSaveName = new WeatherSaveName(); - weatherSaveName.setWhere(t); - return weatherSaveNameDao.deleteByWhere(weatherSaveName); - } -} diff --git a/src/com/sipai/service/work/WordAnalysisReportContentCurveAxisService.java b/src/com/sipai/service/work/WordAnalysisReportContentCurveAxisService.java deleted file mode 100644 index 669fa34a..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportContentCurveAxisService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportContentCurveAxisDao; -import com.sipai.entity.work.WordAnalysisReportContentCurveAxis; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportContentCurveAxisService implements CommService{ - @Resource - private WordAnalysisReportContentCurveAxisDao wordAnalysisReportContentCurveAxisDao; - - @Override - public WordAnalysisReportContentCurveAxis selectById(String id) { - return wordAnalysisReportContentCurveAxisDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportContentCurveAxisDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportContentCurveAxis entity) { - return wordAnalysisReportContentCurveAxisDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportContentCurveAxis entity) { - return wordAnalysisReportContentCurveAxisDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportContentCurveAxis group = new WordAnalysisReportContentCurveAxis(); - group.setWhere(wherestr); - List list = wordAnalysisReportContentCurveAxisDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportContentCurveAxis group = new WordAnalysisReportContentCurveAxis(); - group.setWhere(wherestr); - return wordAnalysisReportContentCurveAxisDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportContentCurveService.java b/src/com/sipai/service/work/WordAnalysisReportContentCurveService.java deleted file mode 100644 index 9b2f15ce..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportContentCurveService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportContentCurveDao; -import com.sipai.entity.work.WordAnalysisReportContentCurve; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportContentCurveService implements CommService{ - @Resource - private WordAnalysisReportContentCurveDao wordAnalysisReportContentCurveDao; - - @Override - public WordAnalysisReportContentCurve selectById(String id) { - return wordAnalysisReportContentCurveDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportContentCurveDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportContentCurve entity) { - return wordAnalysisReportContentCurveDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportContentCurve entity) { - return wordAnalysisReportContentCurveDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportContentCurve group = new WordAnalysisReportContentCurve(); - group.setWhere(wherestr); - List list = wordAnalysisReportContentCurveDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportContentCurve group = new WordAnalysisReportContentCurve(); - group.setWhere(wherestr); - return wordAnalysisReportContentCurveDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportContentFormService.java b/src/com/sipai/service/work/WordAnalysisReportContentFormService.java deleted file mode 100644 index 30b2f916..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportContentFormService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportContentFormDao; -import com.sipai.entity.work.WordAnalysisReportContentForm; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportContentFormService implements CommService{ - @Resource - private WordAnalysisReportContentFormDao wordAnalysisReportContentFormDao; - - @Override - public WordAnalysisReportContentForm selectById(String id) { - return wordAnalysisReportContentFormDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportContentFormDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportContentForm entity) { - return wordAnalysisReportContentFormDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportContentForm entity) { - return wordAnalysisReportContentFormDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportContentForm group = new WordAnalysisReportContentForm(); - group.setWhere(wherestr); - List list = wordAnalysisReportContentFormDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportContentForm group = new WordAnalysisReportContentForm(); - group.setWhere(wherestr); - return wordAnalysisReportContentFormDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportContentService.java b/src/com/sipai/service/work/WordAnalysisReportContentService.java deleted file mode 100644 index d14ef1fc..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportContentService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportContentDao; -import com.sipai.entity.work.WordAnalysisReportContent; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportContentService implements CommService{ - @Resource - private WordAnalysisReportContentDao wordAnalysisReportContentDao; - - @Override - public WordAnalysisReportContent selectById(String id) { - return wordAnalysisReportContentDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportContentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportContent entity) { - return wordAnalysisReportContentDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportContent entity) { - return wordAnalysisReportContentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportContent group = new WordAnalysisReportContent(); - group.setWhere(wherestr); - List list = wordAnalysisReportContentDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportContent group = new WordAnalysisReportContent(); - group.setWhere(wherestr); - return wordAnalysisReportContentDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportFormDataService.java b/src/com/sipai/service/work/WordAnalysisReportFormDataService.java deleted file mode 100644 index a89ee1a8..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportFormDataService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportFormDataDao; -import com.sipai.entity.work.WordAnalysisReportFormData; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportFormDataService implements CommService{ - @Resource - private WordAnalysisReportFormDataDao wordAnalysisReportFormDataDao; - - @Override - public WordAnalysisReportFormData selectById(String id) { - return wordAnalysisReportFormDataDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportFormDataDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportFormData entity) { - return wordAnalysisReportFormDataDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportFormData entity) { - return wordAnalysisReportFormDataDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportFormData group = new WordAnalysisReportFormData(); - group.setWhere(wherestr); - List list = wordAnalysisReportFormDataDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportFormData group = new WordAnalysisReportFormData(); - group.setWhere(wherestr); - return wordAnalysisReportFormDataDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportRecordService.java b/src/com/sipai/service/work/WordAnalysisReportRecordService.java deleted file mode 100644 index 9c43f2dc..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportRecordService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportRecordDao; -import com.sipai.entity.work.WordAnalysisReportRecord; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportRecordService implements CommService{ - @Resource - private WordAnalysisReportRecordDao wordAnalysisReportRecordDao; - - @Override - public WordAnalysisReportRecord selectById(String id) { - return wordAnalysisReportRecordDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportRecordDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportRecord entity) { - return wordAnalysisReportRecordDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportRecord entity) { - return wordAnalysisReportRecordDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportRecord group = new WordAnalysisReportRecord(); - group.setWhere(wherestr); - List list = wordAnalysisReportRecordDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportRecord group = new WordAnalysisReportRecord(); - group.setWhere(wherestr); - return wordAnalysisReportRecordDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportStructureService.java b/src/com/sipai/service/work/WordAnalysisReportStructureService.java deleted file mode 100644 index 938e1ee7..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportStructureService.java +++ /dev/null @@ -1,759 +0,0 @@ -package com.sipai.service.work; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import net.sf.json.JSONArray; - -import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.apache.poi.util.IOUtils; -import org.apache.poi.xwpf.usermodel.Document; -import org.apache.poi.xwpf.usermodel.ParagraphAlignment; -import org.apache.poi.xwpf.usermodel.XWPFDocument; -import org.apache.poi.xwpf.usermodel.XWPFParagraph; -import org.apache.poi.xwpf.usermodel.XWPFRun; -import org.apache.poi.xwpf.usermodel.XWPFTable; -import org.apache.poi.xwpf.usermodel.XWPFTableCell; -import org.apache.poi.xwpf.usermodel.XWPFTableRow; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTJc; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth; -import org.springframework.stereotype.Service; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.sipai.controller.base.PoiUtils; -import com.sipai.dao.work.WordAnalysisReportStructureDao; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.work.WordAnalysisReportContent; -import com.sipai.entity.work.WordAnalysisReportContentCurve; -import com.sipai.entity.work.WordAnalysisReportContentForm; -import com.sipai.entity.work.WordAnalysisReportFormData; -import com.sipai.entity.work.WordAnalysisReportStructure; -import com.sipai.entity.work.WordAnalysisReportText; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommService; -import com.sipai.tools.CommUtil; - -@Service -public class WordAnalysisReportStructureService implements CommService { - @Resource - private WordAnalysisReportStructureDao wordAnalysisReportStructureDao; - @Resource - private WordAnalysisReportContentService wordAnalysisReportContentService; - @Resource - private WordAnalysisReportContentFormService wordAnalysisReportContentFormService; - @Resource - private WordAnalysisReportContentCurveService wordAnalysisReportContentCurveService; - @Resource - private WordAnalysisReportFormDataService wordAnalysisReportFormDataService; - @Resource - private WordAnalysisReportTextService wordAnalysisReportTextService; - @Resource - private MPointService mPointService; - - static ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); - - @Override - public WordAnalysisReportStructure selectById(String id) { - return wordAnalysisReportStructureDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportStructureDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportStructure entity) { - return wordAnalysisReportStructureDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportStructure entity) { - return wordAnalysisReportStructureDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportStructure group = new WordAnalysisReportStructure(); - group.setWhere(wherestr); - List list = wordAnalysisReportStructureDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportStructure group = new WordAnalysisReportStructure(); - group.setWhere(wherestr); - return wordAnalysisReportStructureDao.deleteByWhere(group); - } - - /** - * 获取树 - * - * @方法名:getTreeList - * @参数 @param kpi - * @参数 @return - * @返回类型 String - */ - public String getTreeList(List> list_result, List list) { - if (list_result == null) { - list_result = new ArrayList>(); - for (WordAnalysisReportStructure k : list) { - if ("-1".equals(k.getPid())) { - Map map = new HashMap(); - map.put("id", k.getId().toString()); - map.put("text", " " + k.getName()); - map.put("type", k.getType()); - if (k.getType().equals(WordAnalysisReportStructure.Type_title)) { - map.put("icon", "fa fa-calendar-minus-o"); - //m.put("color", "#357ca5"); - } else if (k.getType().equals(WordAnalysisReportStructure.Type_paragraph)) { - map.put("icon", "fa fa-list-ul"); -// map.put("color", "#39cccc"); - } - list_result.add(map); - } - } - getTreeList(list_result, list); - - } else if (list_result.size() > 0 && list.size() > 0) { - for (Map mp : list_result) { - List> childlist = new ArrayList>(); - for (WordAnalysisReportStructure k : list) { - String id = mp.get("id") + ""; - String pid = k.getPid() + ""; - if (id.equals(pid)) { - Map m = new HashMap(); - m.put("id", k.getId().toString()); - m.put("text", " " + k.getName()); - m.put("type", k.getType()); - if (k.getType().equals(WordAnalysisReportStructure.Type_title)) { - m.put("icon", "fa fa-calendar-minus-o"); - //m.put("color", "#357ca5"); - } else if (k.getType().equals(WordAnalysisReportStructure.Type_paragraph)) { - m.put("icon", "fa fa-list-ul"); -// m.put("color", "#39cccc"); - } - - childlist.add(m); - } - } - if (childlist.size() > 0) { - mp.put("nodes", childlist); - getTreeList(childlist, list); - } - } - } - return JSONArray.fromObject(list_result).toString(); - } - - public void getParagraphs(String pid, XWPFDocument document, int paragraphLevelNum, String sdt, String edt, String unitId, String imgpath, String rid) throws ScriptException, InvalidFormatException, IOException { - List list = selectListByWhere("where 1=1 and pid='" + pid + "' " - + " order by morder"); - paragraphLevelNum++; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - wordOut(list.get(i).getId(), document, paragraphLevelNum, sdt, edt, unitId, imgpath, rid); - List dlist = selectListByWhere("where 1=1 and pid='" + list.get(i).getId() + "' " - + " order by morder"); - if (dlist != null && dlist.size() > 0) { - for (int j = 0; j < dlist.size(); j++) { - wordOut(dlist.get(j).getId(), document, paragraphLevelNum + 1, sdt, edt, unitId, imgpath, rid); - getParagraphs(dlist.get(j).getId(), document, paragraphLevelNum + 1, sdt, edt, unitId, imgpath, rid); - } - } - } - } - } - - public String getParagraphsForView(String result, String pid, int paragraphLevelNum, String sdt, String edt, String unitId, String rid, String view) throws ScriptException { - List list = selectListByWhere("where 1=1 and pid='" + pid + "' " - + " order by morder"); - paragraphLevelNum++; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - result += "
" + calculation(list.get(i).getName(), sdt) + "
"; - result += getParagraphsForDetailView(list.get(i).getId(), sdt, edt, unitId, rid, view); - List dlist = selectListByWhere("where 1=1 and pid='" + list.get(i).getId() + "' " - + " order by morder"); - if (dlist != null && dlist.size() > 0) { - for (int j = 0; j < dlist.size(); j++) { - result += "
" + calculation(dlist.get(j).getName(), sdt) + "
"; - result += getParagraphsForDetailView(dlist.get(j).getId(), sdt, edt, unitId, rid, view); - getParagraphsForView(result, dlist.get(j).getId(), paragraphLevelNum + 1, sdt, edt, unitId, rid, view); - } - } - } - } - - return result; - } - - public String getParagraphsForDetailView(String id, String sdt, String edt, String unitId, String rid, String view) throws ScriptException { - String result = ""; - List contentlist = this.wordAnalysisReportContentService.selectListByWhere("where 1=1 and pid='" + id + "' " - + " order by morder"); - if (contentlist != null && contentlist.size() > 0) { - for (int i = 0; i < contentlist.size(); i++) { - if (contentlist.get(i).getType().equals(WordAnalysisReportContent.Type_text)) {//段落 - List textlist = this.wordAnalysisReportTextService.selectListByWhere(" where" - + " modeFormld='" + contentlist.get(i).getId() + "' and pid='" + rid + "' "); - if (textlist != null && textlist.size() > 0) { - String showText = textlist.get(0).getText(); - String[] splitResult = getContentInfo(showText).split(","); - if (splitResult != null && splitResult.length > 0) { - for (String xlValue : - splitResult) { - List wordAnalysisReportFormData = this.wordAnalysisReportFormDataService.selectListByWhere(" where pid='" + rid + "' and modeFormld='" + xlValue + "' "); - if (wordAnalysisReportFormData != null && wordAnalysisReportFormData.size() > 0) { - MPoint mPoint = this.mPointService.selectById(wordAnalysisReportFormData.get(0).getMpid()); - String numTail = mPoint.getNumtail(); - String vString = String.valueOf(wordAnalysisReportFormData.get(0).getValue()); - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - showText = showText.replace("${" + xlValue + "}", String.valueOf(df.format(Double.valueOf(vString)))); - } - } - } - if (view.equals("0")) { - showText = ""; - } else { -// showText=textlist.get(0).getText(); - } - result += "
"; - result += showText; - result += "
"; - } else { - result += "
" + calculation(contentlist.get(i).getTextcontent(), sdt) + "
"; - } - - } else if (contentlist.get(i).getType().equals(WordAnalysisReportContent.Type_form)) { - List rowformlist = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='" + WordAnalysisReportContentForm.Type_row + "' " - + " and pid='" + contentlist.get(i).getId() + "' order by insertRow asc "); - int height = (rowformlist.size()) * 45; - result += "
"; - result += ""; - if (rowformlist != null && rowformlist.size() > 0) { - for (int r = 0; r < rowformlist.size(); r++) { - result += ""; - List columnformlist = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='" + WordAnalysisReportContentForm.Type_column + "' " - + " and pid='" + rowformlist.get(r).getId() + "' order by insertColumn asc "); - if (columnformlist != null && columnformlist.size() > 0) { - for (int c = 0; c < columnformlist.size(); c++) { - List fdlist = this.wordAnalysisReportFormDataService.selectListByWhere(" where" - + " modeFormld='" + columnformlist.get(c).getId() + "' and pid='" + rid + "' "); - - if (fdlist != null && fdlist.size() > 0) { - - if (fdlist.get(0).getMpid() != null) { - BigDecimal db = new BigDecimal(fdlist.get(0).getValue()); - MPoint mPoint = this.mPointService.selectById(fdlist.get(0).getMpid()); - String numTail = mPoint.getNumtail(); - String vString = db.toPlainString(); - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - result += ""; - } else { - result += ""; - } - - } else { - String showcontent = calculation(columnformlist.get(c).getShowtext(), sdt); - result += ""; - } - - } - } - - result += ""; - } - } - result += "
"; - if (rid != null && rid.length() > 0) { - if (view.equals("0")) { - result += ""; - } else { - result += df.format(Double.valueOf(vString)); - } - } - result += ""; - if (columnformlist.get(c).getShowtextst().equals(WordAnalysisReportContentForm.Showtextst_TRUE)) { - result += ""; - } else if (fdlist.get(0).getShowtext() != null){ - if (rid != null && rid.length() > 0) { - result += fdlist.get(0).getShowtext(); - } - } - result += "" + showcontent + "
"; - result += "
"; - } else if (contentlist.get(i).getType().equals(WordAnalysisReportContent.Type_curve)) { - result += "
"; - } - } - } - - return result; - } - - public void wordOut(String id, XWPFDocument document, int paragraphLevelNum, String sdt, String edt, String unitId, String imgpath, String rid) throws ScriptException, InvalidFormatException, IOException { - List list = selectListByWhere("where 1=1 and id='" + id + "' " - + " order by morder"); - //添加段落 - XWPFParagraph titleParagraph = document.createParagraph(); - //设置段落居中 - titleParagraph.setAlignment(ParagraphAlignment.LEFT); - if (titleParagraph.getStyle() == null) { - PoiUtils.addCustomHeadingStyle(document, "标题样式" + paragraphLevelNum, paragraphLevelNum); - } - // 样式 - titleParagraph.setStyle("标题样式" + paragraphLevelNum); - - XWPFRun titleParagraphRun = titleParagraph.createRun(); - titleParagraphRun.setText(list.get(0).getName()); - titleParagraphRun.setFontFamily("等线"); - titleParagraphRun.setColor("000000"); - titleParagraphRun.setFontSize(14); - - List contentlist = this.wordAnalysisReportContentService.selectListByWhere("where 1=1 and pid='" + id + "' " - + " order by morder"); - if (contentlist != null && contentlist.size() > 0) { - for (int i = 0; i < contentlist.size(); i++) { - if (contentlist.get(i).getType().equals(WordAnalysisReportContent.Type_text)) {//段落 - String showcontent = ""; - List textlist = this.wordAnalysisReportTextService.selectListByWhere(" where" - + " modeFormld='" + contentlist.get(i).getId() + "' and pid='" + rid + "' "); - if (textlist != null && textlist.size() > 0) { - showcontent = textlist.get(0).getText(); - } else { - showcontent = contentlist.get(i).getTextcontent(); - } - XWPFParagraph text = document.createParagraph(); - XWPFRun textrun = text.createRun(); - textrun.setText(showcontent); - textrun.setFontFamily("等线"); - textrun.setColor("000000"); - textrun.setFontSize(14); - } else if (contentlist.get(i).getType().equals(WordAnalysisReportContent.Type_form)) { - //工作经历表格 - XWPFTable ComTable = document.createTable(); - //列宽自动分割 - CTTblWidth comTableWidth = ComTable.getCTTbl().addNewTblPr().addNewTblW(); - comTableWidth.setType(STTblWidth.DXA); - comTableWidth.setW(BigInteger.valueOf(9072)); - - List rowformlist = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='" + WordAnalysisReportContentForm.Type_row + "' " - + " and pid='" + contentlist.get(i).getId() + "' order by insertRow asc "); - if (rowformlist != null && rowformlist.size() > 0) { - for (int r = 0; r < rowformlist.size(); r++) { - XWPFTableRow comTableRow = null; - if (r == 0) { - comTableRow = ComTable.getRow(0); - } else { - comTableRow = ComTable.createRow(); - } - comTableRow.setHeight(80*10); - List columnformlist = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='" + WordAnalysisReportContentForm.Type_column + "' " - + " and pid='" + rowformlist.get(r).getId() + "' order by insertColumn asc "); - if (columnformlist != null && columnformlist.size() > 0) { - for (int c = 0; c < columnformlist.size(); c++) { - int column = columnformlist.get(c).getInsertcolumn() - 1; - String showcontent = ""; - List fdlist = this.wordAnalysisReportFormDataService.selectListByWhere(" where" - + " modeFormld='" + columnformlist.get(c).getId() + "' and pid='" + rid + "' "); - if (fdlist != null && fdlist.size() > 0) { - if (fdlist.get(0).getMpid() != null) { - BigDecimal db = new BigDecimal(fdlist.get(0).getValue()); - MPoint mPoint = this.mPointService.selectById(unitId, fdlist.get(0).getMpid()); - String numTail = mPoint.getNumtail(); - String vString = db.toPlainString(); - String changeDf = "#0."; - for (int n = 0; n < Double.valueOf(numTail); n++) { - changeDf += "0"; - } - if (changeDf.equals("#0.")) { - changeDf = "#"; - } - DecimalFormat df = new DecimalFormat(changeDf); - showcontent = String.valueOf(df.format(Double.valueOf(vString))); - } else if (fdlist.get(0).getShowtext() != null) { - showcontent = fdlist.get(0).getShowtext(); - } - - - } else { - showcontent = calculation(columnformlist.get(c).getShowtext(), sdt); - } - - if (comTableRow.getCell(column) != null) { - XWPFTableCell cell = comTableRow.getCell(column); - cell.setText(showcontent); - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc = cell.getCTTc(); - CTP ctp = cttc.getPList().get(0); - CTPPr ctppr = ctp.getPPr(); - if (ctppr == null) { - ctppr = ctp.addNewPPr(); - } - CTJc ctjc = ctppr.getJc(); - if (ctjc == null) { - ctjc = ctppr.addNewJc(); - } - ctjc.setVal(STJc.CENTER); //水平居中 - } else { - XWPFTableCell cell0 = comTableRow.addNewTableCell(); - cell0.setText(showcontent); - cell0.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc0 = cell0.getCTTc(); - CTP ctp0 = cttc0.getPList().get(0); - CTPPr ctppr0 = ctp0.getPPr(); - if (ctppr0 == null) { - ctppr0 = ctp0.addNewPPr(); - } - CTJc ctjc0 = ctppr0.getJc(); - if (ctjc0 == null) { - ctjc0 = ctppr0.addNewJc(); - } - ctjc0.setVal(STJc.CENTER); //水平居中 - - int columns = columnformlist.get(c).getColumns() - 1; - //创建被合并的单元格 - for (int j = 0; j < columns; j++) { -// comTableRow.addNewTableCell(); - XWPFTableCell cell = comTableRow.addNewTableCell(); - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc = cell.getCTTc(); - CTP ctp = cttc.getPList().get(0); - CTPPr ctppr = ctp.getPPr(); - if (ctppr == null) { - ctppr = ctp.addNewPPr(); - } - CTJc ctjc = ctppr.getJc(); - if (ctjc == null) { - ctjc = ctppr.addNewJc(); - } - ctjc.setVal(STJc.CENTER); //水平居中 - } - } - } - } - } - //合并行列 - for (int r = 0; r < rowformlist.size(); r++) { - List columnformlist2 = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='" + WordAnalysisReportContentForm.Type_column + "' " - + " and pid='" + rowformlist.get(r).getId() + "' and rows>1 "); - if (columnformlist2 != null && columnformlist2.size() > 0) { - for (int c2 = 0; c2 < columnformlist2.size(); c2++) { - int fromcolumn = columnformlist2.get(c2).getInsertcolumn() - 1; - int fromRow = rowformlist.get(r).getInsertrow() - 1; - int toRow = fromRow + columnformlist2.get(c2).getRows() - 1; - mergeRows(ComTable, fromcolumn, fromRow, toRow); - } - } - List columnformlist3 = this.wordAnalysisReportContentFormService.selectListByWhere(" where type='" + WordAnalysisReportContentForm.Type_column + "' " - + " and pid='" + rowformlist.get(r).getId() + "' and columns>1 "); - if (columnformlist3 != null && columnformlist3.size() > 0) { - for (int c3 = 0; c3 < columnformlist3.size(); c3++) { - int fromRow = rowformlist.get(r).getInsertrow() - 1; - int fromCell = columnformlist3.get(c3).getInsertcolumn() - 1; - int toCell = fromCell + columnformlist3.get(c3).getColumns() - 1; - mergeCells(ComTable, fromRow, fromCell, toCell); - } - } - } - - } - ComTable = null; - } else if (contentlist.get(i).getType().equals(WordAnalysisReportContent.Type_curve)) { - XWPFParagraph img = document.createParagraph(); - XWPFRun imgrun = img.createRun(); - File f = new File(imgpath + contentlist.get(i).getId() + ".png"); - InputStream inputStream = new FileInputStream(f); - byte[] bs = IOUtils.toByteArray(inputStream); - imgrun.addPicture(new ByteArrayInputStream(bs), Document.PICTURE_TYPE_PNG, "", 5800000, 2500000); -// System.out.println(); - } - } - } - - } - - - public void mergeCells(XWPFTable table, int row, int fromCell, int toCell) { - for (int cellIndex = fromCell; cellIndex <= toCell; cellIndex++) { - XWPFTableCell cell = table.getRow(row).getCell(cellIndex); - if (cellIndex == fromCell) { - cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART); - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc = cell.getCTTc(); - CTP ctp = cttc.getPList().get(0); - CTPPr ctppr = ctp.getPPr(); - if (ctppr == null) { - ctppr = ctp.addNewPPr(); - } - CTJc ctjc = ctppr.getJc(); - if (ctjc == null) { - ctjc = ctppr.addNewJc(); - } - ctjc.setVal(STJc.CENTER); //水平居中 - } else { - cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE); - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc = cell.getCTTc(); - CTP ctp = cttc.getPList().get(0); - CTPPr ctppr = ctp.getPPr(); - if (ctppr == null) { - ctppr = ctp.addNewPPr(); - } - CTJc ctjc = ctppr.getJc(); - if (ctjc == null) { - ctjc = ctppr.addNewJc(); - } - ctjc.setVal(STJc.CENTER); //水平居中 - } - } - } - - public void mergeRows(XWPFTable table, int col, int fromRow, int toRow) { - for (int rowIndex = fromRow; rowIndex <= toRow; rowIndex++) { - XWPFTableCell cell = table.getRow(rowIndex).getCell(col); - if (rowIndex == fromRow) { - cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.RESTART); - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc = cell.getCTTc(); - CTP ctp = cttc.getPList().get(0); - CTPPr ctppr = ctp.getPPr(); - if (ctppr == null) { - ctppr = ctp.addNewPPr(); - } - CTJc ctjc = ctppr.getJc(); - if (ctjc == null) { - ctjc = ctppr.addNewJc(); - } - ctjc.setVal(STJc.CENTER); //水平居中 - } else { - cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE); - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); //垂直居中 - //水平居中 - CTTc cttc = cell.getCTTc(); - CTP ctp = cttc.getPList().get(0); - CTPPr ctppr = ctp.getPPr(); - if (ctppr == null) { - ctppr = ctp.addNewPPr(); - } - CTJc ctjc = ctppr.getJc(); - if (ctjc == null) { - ctjc = ctppr.addNewJc(); - } - ctjc.setVal(STJc.CENTER); //水平居中 - } - } - } - - public static String calculation(String content, String date) throws ScriptException { - if (content.indexOf("${") != -1) { - String[] splitResult = getContentInfo(content).split(","); - for (int i = 0; i < splitResult.length; i++) { - String oldContent = splitResult[i]; - if (oldContent.indexOf("month") != -1 && oldContent.indexOf("年") == -1 && oldContent.indexOf("月") == -1) { - String newContentJS = oldContent.replace("month", ""); - String dayJS = ""; - if (!newContentJS.equals("")) { - dayJS = CommUtil.subplus(date, newContentJS, "month").substring(5, 7); - } else { - dayJS = date.substring(5, 7); - } - content = content.replace("${" + oldContent + "}", dayJS); - } else if (oldContent.indexOf("year") != -1 && oldContent.indexOf("年") == -1) { - String newContent = ""; - String newContentJS = oldContent.replace("year", date.subSequence(0, 4)); - int result = Integer.parseInt(String.valueOf(jse.eval(newContentJS))); - newContent = String.valueOf(result); - content = content.replace("${" + oldContent + "}", newContent); - } else if (oldContent.indexOf("day") != -1 && oldContent.indexOf("年") == -1 && oldContent.indexOf("月") == -1) { - String newContentJS = oldContent.replace("day", ""); - String dayJS = ""; - if (!newContentJS.equals("")) { - dayJS = CommUtil.subplus(date, newContentJS, "day").substring(8, 10); - } else { - dayJS = date.substring(8, 10); - } - content = content.replace("${" + oldContent + "}", dayJS); - } else if (oldContent.indexOf("date") != -1) { - String newContentJS = oldContent.replace("date", date); - content = content.replace("${" + oldContent + "}", newContentJS); - } else if (oldContent.indexOf("year年month") != -1) { - String jsz = oldContent.replace("year年month", ""); - String result = date.substring(0, 7); - if (!jsz.equals("")) { - result = CommUtil.subplus(date, jsz, "month").substring(0, 7); - } - - content = content.replace("${" + oldContent + "}", result); - } else if (oldContent.indexOf("year年month月day") != -1) { - String jsz = oldContent.replace("year年month月day", ""); - String result = date.substring(0, 10); - if (!jsz.equals("")) { - result = CommUtil.subplus(date, jsz, "day").substring(0, 10); - } - - content = content.replace("${" + oldContent + "}", result); - } - - } - } - - return content; - } - - - public static String getContentInfo(String content) { - Pattern regex = Pattern.compile("\\$\\{([^}]*)\\}"); - Matcher matcher = regex.matcher(content); - StringBuilder sql = new StringBuilder(); - while (matcher.find()) { - sql.append(matcher.group(1) + ","); - } - if (sql.length() > 0) { - sql.deleteCharAt(sql.length() - 1); - } - return sql.toString(); - } - - public String getTreeIds(String id, String ids) { - ids += id + ","; - List list = selectListByWhere("where pid in ('" + id.replace(",", "','") + "') " - + " " - + " order by type,morder"); - String nowids = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - nowids += list.get(i).getId() + ","; - } - } else { - return ids; - } - - return getTreeIds(nowids, ids); - } - - public String getCurveIds(String id, String ids) { -// ids+=id+","; - List list = selectListByWhere("where pid in ('" + id.replace(",", "','") + "') " - + " " - + " order by type,morder"); - String nowids = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List contentlist = this.wordAnalysisReportContentService.selectListByWhere("where 1=1 and pid='" + list.get(i).getId() + "' and type='" + WordAnalysisReportContent.Type_curve + "' " - + " order by morder"); - if (contentlist != null && contentlist.size() > 0) { - for (int j = 0; j < contentlist.size(); j++) { - ids += contentlist.get(j).getId() + ","; - } - } else { - nowids += list.get(i).getId() + ","; - } - } - } else { - return ids; - } - - return getCurveIds(nowids, ids); - } - - public String getFormIds(String id, String ids) { -// ids+=id+","; - List list = selectListByWhere("where pid in ('" + id.replace(",", "','") + "') " - + " " - + " order by type,morder"); - String nowids = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List contentlist = this.wordAnalysisReportContentService.selectListByWhere("where 1=1 and pid='" + list.get(i).getId() + "' and type='" + WordAnalysisReportContent.Type_form + "' " - + " order by morder"); - if (contentlist != null && contentlist.size() > 0) { - for (int j = 0; j < contentlist.size(); j++) { - ids += contentlist.get(j).getId() + ","; - } - } else { - nowids += list.get(i).getId() + ","; - } - } - } else { - return ids; - } - - return getFormIds(nowids, ids); - } - - public String getTextIds(String id, String ids) { -// ids+=id+","; - List list = selectListByWhere("where pid in ('" + id.replace(",", "','") + "') " - + " " - + " order by type,morder"); - String nowids = ""; - if (list != null && list.size() > 0) { - for (int i = 0; i < list.size(); i++) { - List contentlist = this.wordAnalysisReportContentService.selectListByWhere("where 1=1 and pid='" + list.get(i).getId() + "' and type='" + WordAnalysisReportContent.Type_text + "' " - + " order by morder"); - if (contentlist != null && contentlist.size() > 0) { - for (int j = 0; j < contentlist.size(); j++) { - ids += contentlist.get(j).getId() + ","; - } - } else { - nowids += list.get(i).getId() + ","; - } - } - } else { - return ids; - } - - return getTextIds(nowids, ids); - } - -} diff --git a/src/com/sipai/service/work/WordAnalysisReportTextService.java b/src/com/sipai/service/work/WordAnalysisReportTextService.java deleted file mode 100644 index acabe7c8..00000000 --- a/src/com/sipai/service/work/WordAnalysisReportTextService.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.service.work; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.work.WordAnalysisReportTextDao; -import com.sipai.entity.work.WordAnalysisReportText; -import com.sipai.tools.CommService; - -@Service -public class WordAnalysisReportTextService implements CommService{ - @Resource - private WordAnalysisReportTextDao wordAnalysisReportTextDao; - - @Override - public WordAnalysisReportText selectById(String id) { - return wordAnalysisReportTextDao.selectByPrimaryKey(id); - } - - @Override - public int deleteById(String id) { - return wordAnalysisReportTextDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WordAnalysisReportText entity) { - return wordAnalysisReportTextDao.insert(entity); - } - - @Override - public int update(WordAnalysisReportText entity) { - return wordAnalysisReportTextDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - WordAnalysisReportText group = new WordAnalysisReportText(); - group.setWhere(wherestr); - List list = wordAnalysisReportTextDao.selectListByWhere(group); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WordAnalysisReportText group = new WordAnalysisReportText(); - group.setWhere(wherestr); - return wordAnalysisReportTextDao.deleteByWhere(group); - } - -} diff --git a/src/com/sipai/service/workorder/OverhaulItemContentService.java b/src/com/sipai/service/workorder/OverhaulItemContentService.java deleted file mode 100644 index c67eb893..00000000 --- a/src/com/sipai/service/workorder/OverhaulItemContentService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.service.workorder; - -import com.sipai.entity.workorder.OverhaulItemContent; - -import java.util.List; - -public interface OverhaulItemContentService { - - public abstract OverhaulItemContent selectById(String id); - - public abstract OverhaulItemContent selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(OverhaulItemContent entity); - - public abstract int update(OverhaulItemContent entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/workorder/OverhaulItemEquipmentService.java b/src/com/sipai/service/workorder/OverhaulItemEquipmentService.java deleted file mode 100644 index 0df6e415..00000000 --- a/src/com/sipai/service/workorder/OverhaulItemEquipmentService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.sipai.service.workorder; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.workorder.OverhaulItemEquipment; -import com.sipai.entity.workorder.OverhaulStatistics; -import org.springframework.stereotype.Repository; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author chiliz - * @date 2021-11-16 14:47:42 - * @description: TODO - */ - -public interface OverhaulItemEquipmentService { - public abstract OverhaulItemEquipment selectById(String id); - - public abstract OverhaulItemEquipment selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(OverhaulItemEquipment entity); - - public abstract int update(OverhaulItemEquipment entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - /** - * 启动工单流程 - * - * @param id 异常id 没有可以为空 - * @param - * @return - */ - public int startOverhaul(String id, EquipmentPlan equipmentPlan); - - public abstract OverhaulStatistics selectByOverhaulId(String id); - - public abstract int saveSlave(OverhaulStatistics entity); - public abstract int updateSlave(OverhaulStatistics entity); - - -} diff --git a/src/com/sipai/service/workorder/OverhaulItemProjectService.java b/src/com/sipai/service/workorder/OverhaulItemProjectService.java deleted file mode 100644 index 59d79ba4..00000000 --- a/src/com/sipai/service/workorder/OverhaulItemProjectService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.sipai.service.workorder; - -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.workorder.OverhaulItemProject; -import java.util.List; - -public interface OverhaulItemProjectService { - - public abstract OverhaulItemProject selectById(String id); - - public abstract OverhaulItemProject selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(OverhaulItemProject entity); - - public abstract int update(OverhaulItemProject entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract int doAudit(BusinessUnitAudit entity); - - public abstract int updateStatus(String id); - -} diff --git a/src/com/sipai/service/workorder/OverhaulService.java b/src/com/sipai/service/workorder/OverhaulService.java deleted file mode 100644 index ce35722f..00000000 --- a/src/com/sipai/service/workorder/OverhaulService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sipai.service.workorder; - -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.workorder.OverhaulItemEquipment; - -import java.util.List; - -public interface OverhaulService { - - public abstract Overhaul selectById(String id); - - public abstract Overhaul selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(Overhaul entity); - - public abstract int update(Overhaul entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - public abstract int cheak(BusinessUnitAudit entity); - - -} diff --git a/src/com/sipai/service/workorder/OverhaulTypeService.java b/src/com/sipai/service/workorder/OverhaulTypeService.java deleted file mode 100644 index 52b55aef..00000000 --- a/src/com/sipai/service/workorder/OverhaulTypeService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.workorder; - -import com.sipai.entity.workorder.OverhaulType; -import java.util.List; - -public interface OverhaulTypeService { - - public abstract OverhaulType selectById(String id); - - public abstract OverhaulType selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(OverhaulType entity); - - public abstract int update(OverhaulType entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); -} diff --git a/src/com/sipai/service/workorder/WorkorderAchievementOrderService.java b/src/com/sipai/service/workorder/WorkorderAchievementOrderService.java deleted file mode 100644 index a56fc313..00000000 --- a/src/com/sipai/service/workorder/WorkorderAchievementOrderService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.sipai.service.workorder; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.itextpdf.text.pdf.PdfStructTreeController.returnType; -import com.sipai.dao.workorder.WorkorderAchievementOrderDao; -import com.sipai.entity.workorder.WorkorderAchievementOrder; -import com.sipai.service.work.CameraService; -import com.sipai.tools.CommService; -@Service -public class WorkorderAchievementOrderService implements CommService{ - @Resource - private WorkorderAchievementOrderDao workorderAchievementOrderDao; - @Resource - private CameraService cameraService; - - @Override - public WorkorderAchievementOrder selectById(String t) { - return workorderAchievementOrderDao.selectByPrimaryKey(t); - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return workorderAchievementOrderDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WorkorderAchievementOrder t) { - // TODO Auto-generated method stub - return workorderAchievementOrderDao.insertSelective(t); - } - - @Override - public int update(WorkorderAchievementOrder t) { - // TODO Auto-generated method stub - return workorderAchievementOrderDao.updateByPrimaryKeySelective(t); - } - - @Override - public List selectListByWhere(String t) { - WorkorderAchievementOrder workorderAchievementOrder = new WorkorderAchievementOrder(); - workorderAchievementOrder.setWhere(t); - return workorderAchievementOrderDao.selectListByWhere(workorderAchievementOrder); - } - - @Override - public int deleteByWhere(String t) { - WorkorderAchievementOrder workorderAchievementOrder = new WorkorderAchievementOrder(); - workorderAchievementOrder.setWhere(t); - return workorderAchievementOrderDao.deleteByWhere(workorderAchievementOrder); - } - - public List selectListCameraByWhere(String t){ - List list = selectListByWhere(t); - for(WorkorderAchievementOrder workorderAchievementOrder:list){ - //workorderAchievementOrder.setCamera(cameraService.selectById(workorderAchievementOrder.getCameraid())); - } - return list; - } - -} diff --git a/src/com/sipai/service/workorder/WorkorderAchievementService.java b/src/com/sipai/service/workorder/WorkorderAchievementService.java deleted file mode 100644 index 8aaf1e1a..00000000 --- a/src/com/sipai/service/workorder/WorkorderAchievementService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.service.workorder; - -import java.io.IOException; -import java.util.List; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.workorder.WorkTimeRespDto; -import com.sipai.entity.workorder.WorkUserTimeRespDto; -import com.sipai.entity.workorder.WorkorderAchievement; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public interface WorkorderAchievementService { - - public abstract WorkorderAchievement selectById(String id); - - public abstract WorkorderAchievement selectByWhere(String wherestr); - - public abstract int deleteById(String id); - - public abstract int save(WorkorderAchievement entity); - - public abstract int update(WorkorderAchievement entity); - - public abstract List selectListByWhere(String wherestr); - - public abstract int deleteByWhere(String wherestr); - - public abstract List selectDistinctWorkTimeByWhere(String wherestr); - - public List selectByWhere4Detail(String type, String where); - - public List WorkTimeTotal(String SQL); - - public abstract JSONObject getListWorkingHours(String wherestr, String sdtAndEdt, String userId, String name); - - List selectByWhereSumWorkTimeByWhere(String user_sql, String sdtAndEdt); - - WorkUserTimeRespDto selectUserOneByWhereSumWorkTimeByWhere(String user_sql, String sdtAndEdt); - - void doExport(String unitId, HttpServletRequest request, HttpServletResponse response) throws IOException; -} diff --git a/src/com/sipai/service/workorder/WorkorderConsumeService.java b/src/com/sipai/service/workorder/WorkorderConsumeService.java deleted file mode 100644 index 5e40b820..00000000 --- a/src/com/sipai/service/workorder/WorkorderConsumeService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sipai.service.workorder; - -import com.sipai.entity.workorder.WorkorderConsume; -import com.sipai.tools.CommService; - -public interface WorkorderConsumeService extends CommService { - -} diff --git a/src/com/sipai/service/workorder/WorkorderDetailService.java b/src/com/sipai/service/workorder/WorkorderDetailService.java deleted file mode 100644 index 22edfea4..00000000 --- a/src/com/sipai/service/workorder/WorkorderDetailService.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.sipai.service.workorder; - -import java.io.IOException; -import java.util.List; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.WorkorderDetail; -import net.sf.json.JSONArray; - -import javax.servlet.http.HttpServletResponse; - -public interface WorkorderDetailService { - - public abstract WorkorderDetail selectById(String t); - - public abstract WorkorderDetail selectSimpleById(String t); - - public int deleteById(String t); - - public int save(WorkorderDetail t); - - public int update(WorkorderDetail t); - - public List selectListByWhere(String where); - - public List selectListByWhereE(String where); - - public List selectSimpleListByWhere(String where); - - /** - * 仅查设备 - * - * @param where - * @return - */ - public List selectSimpleEuipmentListByWhere(String where); - - public int deleteByWhere(String t); - - public abstract List selectForAchievementWork(String wherestr); - - public abstract List selectDistinctWorkTimeByWhere(String wherestr); - - /** - * 启动工单流程 - * - * @param id 异常id 没有可以为空 - * @param workorderDetail - * @return - */ - public int startWorkorderDetail(String id, WorkorderDetail workorderDetail); - - //审核维修工单流程 - public abstract int doWorkorderDetailRepairAudit(BusinessUnitAudit entity); - - public abstract int doWorkorderDetailRepairAudit(String completeDate, BusinessUnitAudit entity); - - //改变状态 - public abstract int updateStatus(String id); - - /** - * 获取抢单列表数据 - * - * @param where - * @param userId - * @return - */ - public List selectListByWhere4App(String where, String userId); - - /** - * 点击抢单 - * - * @param id - * @param userId - * @return - */ - public String doCompete4Repair(String id, String userId); - - //维修记录详情导出(项目通用) - public abstract void doExportRepair(HttpServletResponse response, List workorderDetailList, String type) throws IOException; - - //维修记录详情导出(金山项目) - public abstract void doExportRepairJS(HttpServletResponse response, List workorderDetailList, String type) throws IOException; - - //保养记录详情导出(项目通用) - public abstract void doExportMain(HttpServletResponse response, List workorderDetailList, String type) throws IOException; - - public void sendMqtt(BusinessUnitHandle businessUnitHandle); - - /** - * 获取该工单最后一个节点人员(验收或确认人) - * - * @param id - */ - public net.sf.json.JSONObject getActivitiLastUser(String id); - - /** - * 获取指定条件内的曲线数据 - * - * @param wherestr - * @param str - * @return - */ - public abstract List selectListByNum(String wherestr, String str); - - /** - * 获取查询条件的数量 - * - * @param wherestr - * @return - */ - public abstract List selectCountByWhere(String wherestr); - - - /** - * 获取抢单数 - * - * @param userId - * @param sdt - * @param edt - * @param unitId - * @param type - * @return - */ - public abstract int getGrabOrdersNum(String userId, String sdt, String edt, String unitId, String type); - - /** - * 查询指定工单的故障时间 - * - * @param entity - * @return - */ - public JSONObject getAbnormityTime(WorkorderDetail entity); -} diff --git a/src/com/sipai/service/workorder/WorkorderRepairContentService.java b/src/com/sipai/service/workorder/WorkorderRepairContentService.java deleted file mode 100644 index 31167dcd..00000000 --- a/src/com/sipai/service/workorder/WorkorderRepairContentService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sipai.service.workorder; - -import java.util.List; - -import com.sipai.entity.workorder.WorkorderRepairContent; - -public interface WorkorderRepairContentService { - - public abstract WorkorderRepairContent selectById(String t); - - public int deleteById(String t); - - public int save(WorkorderRepairContent t); - - public int update(WorkorderRepairContent t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); - -} diff --git a/src/com/sipai/service/workorder/impl/OverhaulItemEquipmentServiceImpl.java b/src/com/sipai/service/workorder/impl/OverhaulItemEquipmentServiceImpl.java deleted file mode 100644 index c48bb4dc..00000000 --- a/src/com/sipai/service/workorder/impl/OverhaulItemEquipmentServiceImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -package com.sipai.service.workorder.impl; - -import com.sipai.dao.maintenance.EquipmentPlanDao; -import com.sipai.dao.workorder.OverhaulItemEquipmentDao; -import com.sipai.dao.workorder.OverhaulItemEquipmentSlaveDao; -import com.sipai.dao.workorder.OverhaulStatisticsDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.maintenance.EquipmentPlan; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.workorder.OverhaulItemEquipment; -import com.sipai.entity.workorder.OverhaulStatistics; -import com.sipai.service.activiti.LeaveWorkflowService; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.workorder.OverhaulItemEquipmentService; -import com.sipai.service.workorder.OverhaulService; -import com.sipai.tools.CommUtil; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author chiliz - * @date 2021-11-16 15:46:10 - * @description: TODO - */ -@Service -public class OverhaulItemEquipmentServiceImpl implements OverhaulItemEquipmentService { - @Resource - private OverhaulItemEquipmentDao overhaulItemEquipmentDao; - @Resource - private EquipmentPlanDao equipmentPlanDao; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private OverhaulItemEquipmentSlaveDao overhaulItemEquipmentSlaveDao; - @Resource - private OverhaulStatisticsDao overhaulStatisticsDao; - @Resource - private OverhaulService overhaulService; - - - OverhaulItemEquipment overhaulItemEquipment = new OverhaulItemEquipment(); - - @Override - public OverhaulItemEquipment selectById(String id) { - return overhaulItemEquipmentDao.selectByPrimaryKey(id); - } - - @Override - public OverhaulItemEquipment selectByWhere(String wherestr) { - - overhaulItemEquipment.setWhere(wherestr); - return overhaulItemEquipmentDao.selectByWhere(overhaulItemEquipment); - } - - @Override - public int deleteById(String id) { - return overhaulItemEquipmentDao.deleteByPrimaryKey(id); - } - - @Override - public int save(OverhaulItemEquipment entity) { - return overhaulItemEquipmentDao.insert(entity); - } - - @Override - public int update(OverhaulItemEquipment entity) { - return overhaulItemEquipmentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - overhaulItemEquipment.setWhere(wherestr); - return overhaulItemEquipmentDao.selectListByWhere(overhaulItemEquipment); - } - - @Override - public int deleteByWhere(String wherestr) { - overhaulItemEquipment.setWhere(wherestr); - return overhaulItemEquipmentDao.deleteByWhere(overhaulItemEquipment); - } - - @Override - @Transactional - public int startOverhaul(String id, EquipmentPlan equipmentPlan) { - Overhaul overhaul=new Overhaul(); - try { - Map variables = new HashMap(); - //判断有无审核人员 - if (!equipmentPlan.getAuditId().isEmpty()) { - variables.put("userIds", equipmentPlan.getAuditId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - - // 判断有无流程定义,如果没有,则启动失败。 - // 流程定义的id - String processKey = ProcessType.Overhaul.getId() + "-" + equipmentPlan.getUnitId(); - List processDefinitions = - workflowProcessDefinitionService.getProcessDefsBykey(processKey); - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - // 启动流程实例 - // 设置网关条件 - Map map = new HashMap<>(); - // 启动流程 - ProcessInstance processInstance = workflowService.startWorkflow( - // 业务主键 - equipmentPlan.getId(), - // 申请者id - equipmentPlan.getInsuser(), - // 流程Key - processDefinitions.get(0).getKey(), - // 流程变量 - variables); - Map map2 = processInstance.getProcessVariables(); - // 判断实例是否启动成功 - if (processInstance == null) { - return 0; - } - - // 获取当前任务 - Task task = - workflowService.getTaskService().createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); - if (task != null) { - overhaul.setId(equipmentPlan.getOverhaulId()); - overhaul.setProcessid(processInstance.getId()); - overhaul.setProcessdefid(processDefinitions.get(0).getId()); - overhaulService.update(overhaul); - equipmentPlan.setProcessid(processInstance.getId()); - task.setAssignee(equipmentPlan.getAuditId()); - equipmentPlan.setProcessdefid(processDefinitions.get(0).getId()); - workflowService.getTaskService().saveTask(task); - } else { - throw new RuntimeException(); - } - int res = 0; - if (equipmentPlan.getId() != null) { - EquipmentPlan entity = equipmentPlanDao.selectByPrimaryKey(equipmentPlan.getId()); - if (entity != null) { - //存在 update - res = equipmentPlanDao.updateByPrimaryKeySelective(equipmentPlan); - } else { - //不存在 insert - res = equipmentPlanDao.insert(equipmentPlan); - } - } - if (res == 1) { - if (id != null && !id.trim().equals("")) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setId(CommUtil.getUUID()); - planRecordAbnormity.setInsdt(CommUtil.nowDate()); - planRecordAbnormity.setFatherId(id); - planRecordAbnormity.setSonId(equipmentPlan.getId()); - res += planRecordAbnormityService.save(planRecordAbnormity); - return res; - } - } - if (equipmentPlan.getAuditId() != null && !equipmentPlan.getAuditId().equals("")) { - String str = equipmentPlan.getAuditId(); - boolean status = str.contains(","); - if (status) { - //选择多人 - String[] userId = str.split(","); - for (int i = 0; i < userId.length; i++) { - //发送消息 - equipmentPlan.setAuditId(userId[i]);//选择多人也每次赋值一个人 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentPlan); - businessUnitRecord.sendMessage(userId[i], ""); - } - } else { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(equipmentPlan); - businessUnitRecord.sendMessage(equipmentPlan.getAuditId(), ""); - } - } - return res; - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Override - public OverhaulStatistics selectByOverhaulId(String id) { - OverhaulStatistics overhaulStatistics = new OverhaulStatistics(); - overhaulStatistics.setOverhaulId(id); - return overhaulStatisticsDao.selectByPrimaryKey(id); - } - - @Override - public int saveSlave(OverhaulStatistics entity) { - return overhaulItemEquipmentSlaveDao.insertSelective(entity) ; - } - - @Override - public int updateSlave(OverhaulStatistics entity) { - return overhaulItemEquipmentSlaveDao.updateByPrimaryKeySelective(entity); - } - - - - public int save(EquipmentPlan entity) { - return equipmentPlanDao.insert(entity); - } - - public int update(EquipmentPlan entity) { - return equipmentPlanDao.updateByPrimaryKeySelective(entity); - } -} diff --git a/src/com/sipai/service/workorder/impl/OverhaulItemProjectServiceImpl.java b/src/com/sipai/service/workorder/impl/OverhaulItemProjectServiceImpl.java deleted file mode 100644 index 77e4ca7f..00000000 --- a/src/com/sipai/service/workorder/impl/OverhaulItemProjectServiceImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.sipai.service.workorder.impl; - -import com.sipai.dao.workorder.OverhaulItemProjectDao; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.workorder.OverhaulItemProject; -import com.sipai.entity.workorder.OverhaulType; -import com.sipai.entity.maintenance.Repair; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.user.User; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.workorder.OverhaulItemProjectService; -import com.sipai.service.workorder.OverhaulTypeService; -import com.sipai.service.user.UserService; -import org.activiti.engine.task.Task; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class OverhaulItemProjectServiceImpl implements OverhaulItemProjectService { - @Resource - private OverhaulItemProjectDao overhaulItemProjectDao; - @Resource - private UserService userService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private WorkflowService workflowService; - @Resource - private OverhaulTypeService overhaulTypeService; - - @Override - public OverhaulItemProject selectById(String id) { - OverhaulItemProject entity = overhaulItemProjectDao.selectByPrimaryKey(id); - if(entity!=null){ - //查询大修分项类型 - OverhaulType overhaulType = overhaulTypeService.selectById(entity.getProjectTypeId()); - if(overhaulType!=null){ - entity.setOverhaulType(overhaulType); - } - - if(entity.getReceiveUserIds()!=null){ - //接收人员们 - String[] receiveUserids=entity.getReceiveUserIds().split(","); - if(receiveUserids!=null&&receiveUserids.length>0){ - String receiveUsersName=""; - for(int u=0;u0){ - entity.setReceiveUsersName(receiveUsersName.substring(0, receiveUsersName.length()-1)); - } - } - //接收人员 - User user=this.userService.getUserById(entity.getReceiveUserId()); - if(user!=null){ - entity.setReceiveUserName(user.getCaption()); - } - } - } - return entity; - } - - @Override - public OverhaulItemProject selectByWhere(String wherestr) { - OverhaulItemProject overhaulItemProject = new OverhaulItemProject(); - overhaulItemProject.setWhere(wherestr); - return overhaulItemProjectDao.selectByWhere(overhaulItemProject); - } - - @Override - public int deleteById(String id) { - return overhaulItemProjectDao.deleteByPrimaryKey(id); - } - - @Override - public int save(OverhaulItemProject entity) { - return overhaulItemProjectDao.insert(entity); - } - - @Override - public int update(OverhaulItemProject entity) { - return overhaulItemProjectDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - OverhaulItemProject entity = new OverhaulItemProject(); - entity.setWhere(wherestr); - List list = overhaulItemProjectDao.selectListByWhere(entity); - for (OverhaulItemProject overhaulItemProject : list){ - OverhaulType overhaulType = overhaulTypeService.selectById(overhaulItemProject.getProjectTypeId()); - overhaulItemProject.setOverhaulType(overhaulType); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - OverhaulItemProject overhaulItemProject = new OverhaulItemProject(); - overhaulItemProject.setWhere(wherestr); - return overhaulItemProjectDao.deleteByWhere(overhaulItemProject); - } - - /** - * 根据当前任务节点更新状态 - * */ - public int updateStatus(String id) { - OverhaulItemProject entity = this.selectById(id); - Task task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).singleResult(); - if (task!=null) { - entity.setProcessStatus(task.getName()); - }else{ - entity.setProcessStatus(OverhaulItemProject.Status_Finish); - } - int res =this.update(entity); - return res; - } - - public int doAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter= this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res>0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } -} diff --git a/src/com/sipai/service/workorder/impl/OverhaulServiceImpl.java b/src/com/sipai/service/workorder/impl/OverhaulServiceImpl.java deleted file mode 100644 index 8aa8185c..00000000 --- a/src/com/sipai/service/workorder/impl/OverhaulServiceImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.sipai.service.workorder.impl; - -import com.sipai.dao.workorder.OverhaulDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.base.Result; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.maintenance.EquipmentPlanType; -import com.sipai.entity.maintenance.MaintenanceCommString; -import com.sipai.entity.maintenance.PlanRecordAbnormity; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.workorder.Overhaul; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.workorder.OverhaulItemEquipment; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.company.CompanyService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.maintenance.EquipmentPlanTypeService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.workorder.OverhaulService; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.DateUtil; -import org.activiti.engine.impl.task.TaskDefinition; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class OverhaulServiceImpl implements OverhaulService { - @Resource - private OverhaulDao overhaulDao; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private UserService userService; - @Resource - private CompanyService companyService; - @Resource - private EquipmentPlanTypeService equipmentPlanTypeService; - @Autowired - private BusinessUnitAuditService businessUnitAuditService; - - - - @Override - public Overhaul selectById(String id) { - Overhaul overhaul = overhaulDao.selectByPrimaryKey(id); - if(overhaul!=null){ - Company company = companyService.selectByPrimaryKey(overhaul.getUnitId()); - overhaul.setCompany(company); - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(overhaul.getEquipmentId()); - overhaul.setEquipmentCard(equipmentCard); - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(overhaul.getProjectType()); - overhaul.setEquipmentPlanType(equipmentPlanType); - User user = userService.getUserById(overhaul.getSendUserId()); - overhaul.setSendUser(user); - } - return overhaul; - } - - @Override - public Overhaul selectByWhere(String wherestr) { - Overhaul overhaul = new Overhaul(); - overhaul.setWhere(wherestr); - return overhaulDao.selectByWhere(overhaul); - } - - @Override - public int deleteById(String id) { - return overhaulDao.deleteByPrimaryKey(id); - } - - @Override - public int save(Overhaul entity) { - return overhaulDao.insert(entity); - } - - @Override - public int update(Overhaul entity) { - return overhaulDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - Overhaul entity = new Overhaul(); - entity.setWhere(wherestr); - List list = overhaulDao.selectListByWhere(entity); - for (Overhaul overhaul : list){ - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(overhaul.getEquipmentId()); - overhaul.setEquipmentCard(equipmentCard); - User user = userService.getUserById(overhaul.getReceiveUserId()); - overhaul.setReceiveUser(user); - Company company = companyService.selectByPrimaryKey(overhaul.getUnitId()); - overhaul.setCompany(company); - EquipmentPlanType equipmentPlanType = equipmentPlanTypeService.selectById(overhaul.getProjectType()); - overhaul.setEquipmentPlanType(equipmentPlanType); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - Overhaul entity = new Overhaul(); - entity.setWhere(wherestr); - return overhaulDao.deleteByWhere(entity); - } - - @Transactional - @Override - public int cheak(BusinessUnitAudit entity) { - Overhaul overhaul=new Overhaul(); - overhaul.setId(entity.getId()); - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - overhaul.setProcessStatus("51"); - this.update(overhaul); - } - if (!entity.getPassstatus()){ - overhaul.setProcessStatus("42"); - this.update(overhaul); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - -} diff --git a/src/com/sipai/service/workorder/impl/OverhaulTypeServiceImpl.java b/src/com/sipai/service/workorder/impl/OverhaulTypeServiceImpl.java deleted file mode 100644 index 475d9abd..00000000 --- a/src/com/sipai/service/workorder/impl/OverhaulTypeServiceImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.sipai.service.workorder.impl; - -import com.sipai.dao.workorder.OverhaulTypeDao; -import com.sipai.entity.workorder.OverhaulType; -import com.sipai.service.workorder.OverhaulTypeService; -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; - -@Service -public class OverhaulTypeServiceImpl implements OverhaulTypeService { - @Resource - private OverhaulTypeDao overhaulTypeDao; - - @Override - public OverhaulType selectById(String id) { - return overhaulTypeDao.selectByPrimaryKey(id); - } - - @Override - public OverhaulType selectByWhere(String wherestr) { - OverhaulType overhaulType = new OverhaulType(); - overhaulType.setWhere(wherestr); - return overhaulTypeDao.selectByWhere(overhaulType); - } - - @Override - public int deleteById(String id) { - return overhaulTypeDao.deleteByPrimaryKey(id); - } - - @Override - public int save(OverhaulType entity) { - return overhaulTypeDao.insert(entity); - } - - @Override - public int update(OverhaulType entity) { - return overhaulTypeDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String wherestr) { - OverhaulType entity = new OverhaulType(); - entity.setWhere(wherestr); - List list = overhaulTypeDao.selectListByWhere(entity); - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - OverhaulType entity = new OverhaulType(); - entity.setWhere(wherestr); - return overhaulTypeDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/service/workorder/impl/WorkorderAchievementServiceImpl.java b/src/com/sipai/service/workorder/impl/WorkorderAchievementServiceImpl.java deleted file mode 100644 index ce4dd5d6..00000000 --- a/src/com/sipai/service/workorder/impl/WorkorderAchievementServiceImpl.java +++ /dev/null @@ -1,396 +0,0 @@ -package com.sipai.service.workorder.impl; - -import java.io.IOException; -import java.io.OutputStream; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.equipment.EquipmentScrapApplyCollect; -import com.sipai.entity.maintenance.Abnormity; -import com.sipai.entity.workorder.WorkTimeRespDto; -import com.sipai.entity.workorder.WorkUserTimeRespDto; -import com.sipai.entity.workorder.WorkorderDetail; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.springframework.stereotype.Service; - -import com.sipai.dao.workorder.WorkorderAchievementDao; -import com.sipai.entity.workorder.WorkorderAchievement; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.user.User; -import com.sipai.service.workorder.WorkorderAchievementService; -import com.sipai.service.user.UserService; - -@Service -public class WorkorderAchievementServiceImpl implements WorkorderAchievementService { - @Resource - private WorkorderAchievementDao workorderAchievementDao; - @Resource - private UserService userService; - - @Override - public WorkorderAchievement selectById(String id) { - return workorderAchievementDao.selectByPrimaryKey(id); - } - - @Override - public WorkorderAchievement selectByWhere(String wherestr) { - WorkorderAchievement workorderAchievement = new WorkorderAchievement(); - workorderAchievement.setWhere(wherestr); - return workorderAchievementDao.selectByWhere(workorderAchievement); - } - - @Override - public int deleteById(String id) { - return workorderAchievementDao.deleteByPrimaryKey(id); - } - - @Override - public int save(WorkorderAchievement entity) { - return workorderAchievementDao.insert(entity); - } - - @Override - public int update(WorkorderAchievement entity) { - return workorderAchievementDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List WorkTimeTotal(String SQL) { - return workorderAchievementDao.WorkTimeTotal(SQL); - } - - @Override - public List selectListByWhere(String wherestr) { - WorkorderAchievement entity = new WorkorderAchievement(); - entity.setWhere(wherestr); - List list = workorderAchievementDao.selectListByWhere(entity); - for (WorkorderAchievement workorderAchievement : list) { - User user = userService.getUserById(workorderAchievement.getUserId()); - workorderAchievement.setUser(user); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WorkorderAchievement entity = new WorkorderAchievement(); - entity.setWhere(wherestr); - return workorderAchievementDao.deleteByWhere(entity); - } - - public List selectDistinctWorkTimeByWhere(String wherestr) { - List patrolRecords = workorderAchievementDao.selectDistinctWorkTimeByWhere(wherestr); - return patrolRecords; - } - - @Override - public JSONObject getListWorkingHours(String wherestr, String sdtAndEdt, String userId, String name) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("name", name); - - //维修工单 - String str1 = wherestr + "and a.user_id = '" + userId + "' and m.status = 'finish' and m.type = '" + WorkorderDetail.REPAIR + "'"; - //保养工单 - String str2 = wherestr + "and a.user_id = '" + userId + "' and m.status = 'finish' and m.type = '" + WorkorderDetail.MAINTAIN + "'"; - //运行巡检 - String str3 = wherestr + "and a.user_id = '" + userId + "' and m.status = '3' and m.type = 'P'"; - //设备巡检 - String str4 = wherestr + "and a.user_id = '" + userId + "' and m.status = '3' and m.type = 'E'"; - - if (sdtAndEdt != null && !sdtAndEdt.equals("")) { - String[] str = sdtAndEdt.split("~"); - str1 += " and complete_date between'" + str[0] + "'and'" + str[1] + "'"; - str2 += " and complete_date between'" + str[0] + "'and'" + str[1] + "'"; - str3 += " and start_time between'" + str[0] + "'and'" + str[1] + "'"; - str4 += " and start_time between'" + str[0] + "'and'" + str[1] + "'"; - } - - //维修工单 - List list1 = workorderAchievementDao.selectByWhere4WorkorderDetail(str1); - double num = 0; - for (WorkorderAchievement workorderAchievement : list1) { - num += workorderAchievement.getWorkTime(); - } - BigDecimal b = new BigDecimal(num); - double f1 = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - jsonObject.put("workTime_repair", f1); - - //保养工单 - List list2 = workorderAchievementDao.selectByWhere4WorkorderDetail(str2); - double num2 = 0; - for (WorkorderAchievement workorderAchievement : list2) { - num2 += workorderAchievement.getWorkTime(); - } - BigDecimal b2 = new BigDecimal(num2); - double f2 = b2.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - jsonObject.put("workTime_maintain", f2); - - //运行巡检 - List list3 = workorderAchievementDao.selectByWhere4PatrolRecord(str3); - double num3 = 0; - for (WorkorderAchievement workorderAchievement : list3) { - num3 += workorderAchievement.getWorkTime(); - } - BigDecimal b3 = new BigDecimal(num3); - double f3 = b3.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - jsonObject.put("workTime_patrolRecord_p", f3); - - //设备巡检 - List list4 = workorderAchievementDao.selectByWhere4PatrolRecord(str4); - double num4 = 0; - for (WorkorderAchievement workorderAchievement : list4) { - num4 += workorderAchievement.getWorkTime(); - } - BigDecimal b4 = new BigDecimal(num4); - double f4 = b4.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - jsonObject.put("workTime_patrolRecord_e", f4); - - jsonObject.put("workTime", f1 + f2 + f3 + f4); - return jsonObject; - } - - public List selectByWhere4Detail(String type, String where) { - List workorderAchievements = new ArrayList<>(); - if (type.equals("P") || type.equals("E")) { - workorderAchievements = workorderAchievementDao.selectByWhere4PatrolRecord(where); - } else { - workorderAchievements = workorderAchievementDao.selectByWhere4WorkorderDetail(where); - } - for (int i = 0; i < workorderAchievements.size(); i++) { - if (StringUtils.isNotBlank(workorderAchievements.get(i).getUserId())) { - workorderAchievements.get(i).setUser(userService.getUserById(workorderAchievements.get(i).getUserId())); - } - } - return workorderAchievements; - } - - @Override - public List selectByWhereSumWorkTimeByWhere(String user_sql, String sdtAndEdt) { - String startTime = ""; - String endTime = ""; - if (sdtAndEdt != null && !sdtAndEdt.equals("")) { - String[] str = sdtAndEdt.split("~"); - startTime = str[0]; - endTime = str[1]; - } - List workTimeRespDtos = workorderAchievementDao.selectByWhereSumWorkTimeByWhere(user_sql, startTime, endTime); - return workTimeRespDtos; - } - - @Override - public WorkUserTimeRespDto selectUserOneByWhereSumWorkTimeByWhere(String user_sql, String sdtAndEdt) { - String startTime = ""; - String endTime = ""; - if (sdtAndEdt != null && !sdtAndEdt.equals("")) { - String[] str = sdtAndEdt.split("~"); - startTime = str[0]; - endTime = str[1]; - } - WorkUserTimeRespDto workTimeRespDto = workorderAchievementDao.selectUserOneByWhereSumWorkTimeByWhere(user_sql, startTime, endTime); - return workTimeRespDto; - } - - /** - * 导出 - * @param response - * @param unitId - * @throws IOException - */ - public void doExport(String unitId, HttpServletRequest request, - HttpServletResponse response - ) throws IOException { - - String fileName = "工时统计.xls"; - // 声明一个工作薄 - HSSFWorkbook workbook = new HSSFWorkbook(); - - String title = "工时统计"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 6000); - sheet.setColumnWidth(1, 10000); - sheet.setColumnWidth(2, 10000); - sheet.setColumnWidth(3, 4000); - sheet.setColumnWidth(4, 4000); - sheet.setColumnWidth(5, 4000); - sheet.setColumnWidth(6, 4000); - sheet.setColumnWidth(7, 4000); - - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 -// comment.setString(new HSSFRichTextString("A列为设备型号唯一标识,用于修改所用,新增id需为空!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - //产生表格表头 - String excelTitleStr = "姓名,运行巡检(小时),设备巡检(小时),维修工单(小时),保养工单(小时),总工时"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(2); - row.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = row.createCell(i); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[i]); - cell.setCellValue(text); - } - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - HSSFRow handRow1 = sheet.createRow(1); - CellRangeAddress cra = new CellRangeAddress(1,1,0,5); - sheet.addMergedRegion(cra); - handRow.setHeight((short) 800); - for (int i = 0; i < excelTitle.length; i++) { - HSSFCell cell = handRow.createCell(i); - HSSFCell cell1 = handRow1.createCell(i); - cell1.setCellStyle(headStyle); - cell.setCellStyle(headStyle); - cell.setCellValue("工时统计"); - cell1.setCellValue("时间段:" + request.getParameter("sdtAndEdt")); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, excelTitle.length-1)); - String idss = request.getParameter("ids"); - String sdtAndEdt = request.getParameter("sdtAndEdt"); - List list = new ArrayList<>(); - if(org.apache.commons.lang3.StringUtils.isNotBlank(idss)) { - idss = idss.substring(0, idss.length() - 1); - idss = idss.replace(",","','"); - list = this.selectByWhereSumWorkTimeByWhere("where 1=1 and tu.id in ('" + idss + "')", sdtAndEdt); - } - - if(list!=null && list.size()>0){ - net.sf.json.JSONObject jsonObject1 = new net.sf.json.JSONObject(); - net.sf.json.JSONObject jsonObject2 = new net.sf.json.JSONObject(); - BigDecimal value = new BigDecimal("0.0000"); - BigDecimal worth = new BigDecimal("0.0000"); - for (int i = 0; i < list.size(); i++ ) { - row = sheet.createRow(3+i);//第三行为插入的数据行 - row.setHeight((short) 600); - - //姓名 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(org.apache.commons.lang3.StringUtils.isNotBlank(list.get(i).getCaption()) ? list.get(i).getCaption() : ""); - //运行巡检(小时) - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(list.get(i).getPTime() != null ? String.valueOf(list.get(i).getPTime()) : ""); - //设备巡检(小时) - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(list.get(i).getETime() != null ? String.valueOf(list.get(i).getETime()) : ""); - //维修工单(小时) - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(list.get(i).getRepairTime() != null ? String.valueOf(list.get(i).getRepairTime()) : ""); - //保养工单(小时) - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(list.get(i).getMaintainTime() != null ? String.valueOf(list.get(i).getMaintainTime()) : ""); - //总工时 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(list.get(i).getSumTime() != null ? String.valueOf(list.get(i).getSumTime()) : ""); - } - int rownum = 3;//第2行开始 - for(Iterator iter = jsonObject1.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject1.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 1, 1)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 2, 2)); - rownum = rownum + num; - } - - rownum = 3;//第2行开始 - - for(Iterator iter = jsonObject2.keys(); iter.hasNext();) { - String key = (String)iter.next(); - int num = Integer.parseInt(jsonObject2.getString(key)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 3, 3)); - sheet.addMergedRegion(new CellRangeAddress(rownum, rownum + num - 1, 4, 4)); - rownum = rownum + num; - } - } - - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename="+ URLEncoder.encode(fileName, "UTF-8")); - OutputStream out=response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally{ - workbook.close(); - } - } - - -} diff --git a/src/com/sipai/service/workorder/impl/WorkorderConsumeServiceImpl.java b/src/com/sipai/service/workorder/impl/WorkorderConsumeServiceImpl.java deleted file mode 100644 index 7c7f1187..00000000 --- a/src/com/sipai/service/workorder/impl/WorkorderConsumeServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.service.workorder.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.workorder.WorkorderConsumeDao; -import com.sipai.entity.workorder.WorkorderConsume; -import com.sipai.service.sparepart.GoodsService; -import com.sipai.service.workorder.WorkorderConsumeService; - -@Service -public class WorkorderConsumeServiceImpl implements WorkorderConsumeService { - @Resource - private WorkorderConsumeDao workorderConsumeDao; - @Resource - private GoodsService goodsService; - - @Override - public WorkorderConsume selectById(String id) { - WorkorderConsume workorderConsume = this.workorderConsumeDao.selectByPrimaryKey(id); - if (workorderConsume != null && workorderConsume.getGoodsId() != null) { - workorderConsume.setGoods(this.goodsService.selectById(workorderConsume.getGoodsId())); - } - return workorderConsume; - } - - @Override - public int deleteById(String id) { - int code = this.workorderConsumeDao.deleteByPrimaryKey(id); - return code; - } - - @Override - public int save(WorkorderConsume workorderConsume) { - int code = this.workorderConsumeDao.insert(workorderConsume); - return code; - } - - @Override - public int update(WorkorderConsume workorderConsume) { - int code = this.workorderConsumeDao.updateByPrimaryKeySelective(workorderConsume); - return code; - } - - @Override - public List selectListByWhere(String wherestr) { - WorkorderConsume workorderConsume = new WorkorderConsume(); - workorderConsume.setWhere(wherestr); - List list = this.workorderConsumeDao.selectListByWhere(workorderConsume); - for (WorkorderConsume item : list) { - item.setGoods(this.goodsService.selectById(item.getGoodsId())); - } - return list; - } - - @Override - public int deleteByWhere(String wherestr) { - WorkorderConsume workorderConsume = new WorkorderConsume(); - workorderConsume.setWhere(wherestr); - int code = this.workorderConsumeDao.deleteByWhere(workorderConsume); - return code; - } - -} diff --git a/src/com/sipai/service/workorder/impl/WorkorderDetailServiceImpl.java b/src/com/sipai/service/workorder/impl/WorkorderDetailServiceImpl.java deleted file mode 100644 index f06058db..00000000 --- a/src/com/sipai/service/workorder/impl/WorkorderDetailServiceImpl.java +++ /dev/null @@ -1,1923 +0,0 @@ -package com.sipai.service.workorder.impl; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson.JSONObject; -import com.serotonin.util.ArrayUtils; -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.business.BusinessUnit; -import com.sipai.entity.business.BusinessUnitHandle; -import com.sipai.entity.maintenance.*; -import com.sipai.entity.timeefficiency.PatrolRecord; -import com.sipai.entity.timeefficiency.PatrolType; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.work.GroupDetail; -import com.sipai.entity.workorder.WorkorderRepairContent; -import com.sipai.service.business.BusinessUnitHandleDetailService; -import com.sipai.service.business.BusinessUnitHandleService; -import com.sipai.service.maintenance.AbnormityService; -import com.sipai.service.maintenance.LibraryBaseService; -import com.sipai.service.maintenance.PlanRecordAbnormityService; -import com.sipai.service.user.UserService; -import com.sipai.service.work.GroupDetailService; -import com.sipai.service.workorder.WorkorderRepairContentService; -import com.sipai.tools.*; -import com.sipai.tools.DateUtil; -import net.sf.json.JSON; -import net.sf.json.JSONArray; -import org.activiti.engine.RuntimeService; -import org.activiti.engine.history.HistoricTaskInstance; -import org.activiti.engine.repository.ProcessDefinition; -import org.activiti.engine.runtime.ProcessInstance; -import org.activiti.engine.task.Task; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.hssf.util.HSSFColor; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.sipai.dao.workorder.WorkorderDetailDao; -import com.sipai.entity.activiti.ProcessType; -import com.sipai.entity.base.BusinessUnitAdapter; -import com.sipai.entity.business.BusinessUnitAudit; -import com.sipai.entity.business.BusinessUnitRecord; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentSpecification; -import com.sipai.entity.process.ProcessAdjustment; -import com.sipai.entity.process.WaterTest; -import com.sipai.entity.user.Company; -import com.sipai.entity.workorder.WorkorderDetail; -import com.sipai.service.activiti.WorkflowProcessDefinitionService; -import com.sipai.service.activiti.WorkflowService; -import com.sipai.service.business.BusinessUnitAuditService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.user.UnitService; -import com.sipai.service.workorder.WorkorderDetailService; - -@Service("workorderDetailService") -public class WorkorderDetailServiceImpl implements WorkorderDetailService { - - @Resource - private WorkorderDetailDao workorderDetailDao; - @Resource - private WorkflowProcessDefinitionService workflowProcessDefinitionService; - @Resource - private WorkflowService workflowService; - @Resource - private UnitService unitService; - @Resource - private BusinessUnitAuditService businessUnitAuditService; - @Resource - private EquipmentCardService equipmentCardService; - @Resource - private RuntimeService runtimeService; - @Resource - private BusinessUnitHandleDetailService businessUnitHandleDetailService; - @Resource - private BusinessUnitHandleService businessUnitHandleService; - @Resource - private PlanRecordAbnormityService planRecordAbnormityService; - @Resource - private UserService userService; - @Resource - private GroupDetailService groupDetailService; - @Resource - private LibraryBaseService libraryBaseService; - @Resource - private WorkorderRepairContentService workorderRepairContentService; - @Resource - private AbnormityService abnormityService; - - @Override - public WorkorderDetail selectById(String t) { - WorkorderDetail entity = workorderDetailDao.selectByPrimaryKey(t); - if (entity != null) { - EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(entity.getEquipmentId()); - entity.setEquipmentCard(equipmentCard); - User user = userService.getUserById(entity.getReceiveUserId()); - entity.setReceiveUser(user); - User user2 = userService.getUserById(entity.getInsuser()); - entity.setIssueUser(user2); - //查询关联的异常 - JSONObject jsonObject = getAbnormityTime(entity); - entity.setAbnormityTimeString(jsonObject.get("timeStr").toString()); - } - return entity; - } - - @Override - public WorkorderDetail selectSimpleById(String t) { - WorkorderDetail entity = workorderDetailDao.selectByPrimaryKey(t); - return entity; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return workorderDetailDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WorkorderDetail entity) { - // TODO Auto-generated method stub - return workorderDetailDao.insertSelective(entity); - } - - - @Override - public int update(WorkorderDetail entity) { - // TODO Auto-generated method stub - return workorderDetailDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String where) { - WorkorderDetail entity = new WorkorderDetail(); - entity.setWhere(where); - List workorderDetails = workorderDetailDao.selectListByWhere(entity); - for (WorkorderDetail item : workorderDetails) { - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - - if (null != item.getEquipmentId() && !item.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - - if (null != item.getReceiveUserId() && !item.getReceiveUserId().isEmpty()) { - User user = userService.getUserById(item.getReceiveUserId()); - item.setUser(user); - } - - if (null != item.getAbnormityId() && !item.getAbnormityId().isEmpty()) { - Abnormity abnormity = abnormityService.selectSimpleById(item.getAbnormityId()); - item.setAbnormity(abnormity); - } - } - return workorderDetails; - } - - @Override - public List selectListByWhereE(String where) { - WorkorderDetail entity = new WorkorderDetail(); - entity.setWhere(where); - List workorderDetails = workorderDetailDao.selectListByWhereWithE(where); - for (WorkorderDetail item : workorderDetails) { - //查询所属厂 - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - - //查询设备 - if (null != item.getEquipmentId() && !item.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectSimpleListById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - - //查询接收人 - if (null != item.getReceiveUserId() && !item.getReceiveUserId().isEmpty()) { - User user = userService.getUserById(item.getReceiveUserId()); - item.setUser(user); - } - - //查询关联的异常 - JSONObject jsonObject = getAbnormityTime(item); - item.setAbnormityTimeString(jsonObject.get("timeStr").toString()); - - } - return workorderDetails; - } - - @Override - public List selectSimpleListByWhere(String where) { - WorkorderDetail entity = new WorkorderDetail(); - entity.setWhere(where); - List workorderDetails = workorderDetailDao.selectListByWhere(entity); - return workorderDetails; - } - - @Override - public List selectSimpleEuipmentListByWhere(String where) { - WorkorderDetail entity = new WorkorderDetail(); - entity.setWhere(where); - List workorderDetails = workorderDetailDao.selectListByWhere(entity); - for (WorkorderDetail item : workorderDetails) { - //查询设备 - if (null != item.getEquipmentId() && !item.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectSimpleListById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - } - return workorderDetails; - } - - @Override - public List selectListByWhere4App(String where, String userId) { - - //查询该用户所属哪个班组(可能有多个) - List groupList = groupDetailService.selectListByWhere("where (leader like '%" + userId + "%' or members like '%" + userId + "%')"); - String[] groupDetailId = new String[groupList.size()]; - if (groupList != null && groupList.size() > 0) { - for (int i = 0; i < groupList.size(); i++) { - groupDetailId[i] = groupList.get(i).getId(); - } - } -// System.out.println(groupDetailId[0] + "===" + groupDetailId[1] + "===" + groupDetailId[2] + "===" + groupDetailId[3]); - WorkorderDetail entity = new WorkorderDetail(); - entity.setWhere(where); - List workorderDetails = workorderDetailDao.selectListByWhere(entity); - //去掉不是发给自己班组的工单 - Iterator iter = workorderDetails.iterator(); - while (iter.hasNext()) { - WorkorderDetail item = iter.next(); - boolean str = false; - if (item.getCompeteTeamIds() != null && !item.getCompeteTeamIds().equals("")) { - String[] ids = item.getCompeteTeamIds().split(","); - if (ids != null && ids.length > 0) { - for (int i = 0; i < ids.length; i++) { - if (ArrayUtils.contains(groupDetailId, ids[i])) { - str = true; - break; - } else { - str = false; - } - } - } - } - if (str == false) { - iter.remove(); - } - } - - //查询厂及设备 对象 - for (WorkorderDetail item : workorderDetails) { - if (null != item.getUnitId() && !item.getUnitId().isEmpty()) { - Company company = this.unitService.getCompById(item.getUnitId()); - item.setCompany(company); - } - - if (null != item.getEquipmentId() && !item.getEquipmentId().isEmpty()) { - EquipmentCard equipmentCard = this.equipmentCardService.selectById(item.getEquipmentId()); - item.setEquipmentCard(equipmentCard); - } - } - return workorderDetails; - } - - @Transactional - @Override - public int deleteByWhere(String wherestr) { - try { - WorkorderDetail entity = new WorkorderDetail(); - entity.setWhere(wherestr); - List maintenanceDetails = this.selectListByWhere(wherestr); - for (WorkorderDetail item : maintenanceDetails) { - String pInstancId = item.getProcessid(); - if (pInstancId != null) { - ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(pInstancId).singleResult(); - if (pInstance != null) { - workflowService.delProcessInstance(pInstancId); - } - //处理详情也需要删除 - businessUnitHandleDetailService.deleteByWhere("where maintenanceDetailId='" + item.getId() + "'"); - } - } - return workorderDetailDao.deleteByWhere(entity); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - public List selectForAchievementWork(String wherestr) { - List workorderDetails = workorderDetailDao.selectForAchievementWork(wherestr); - return workorderDetails; - } - - public List selectDistinctWorkTimeByWhere(String wherestr) { - List workorderDetails = workorderDetailDao.selectDistinctWorkTimeByWhere(wherestr); - return workorderDetails; - } - - /** - * 下开启流程 - * - * @param id 异常id 没有可以为空 - * @param workorderDetail - * @return - */ - @Transactional - public int startWorkorderDetail(String id, WorkorderDetail workorderDetail) { - try { - Map variables = new HashMap(); - if (!workorderDetail.getReceiveUserId().isEmpty()) { - variables.put("userIds", workorderDetail.getReceiveUserId()); - } else { - //无处理人员则不发起 - return MaintenanceCommString.Response_StartProcess_NoUser; - } - variables.put("applicantId", null); - - List processDefinitions = null; - - String type = workorderDetail.getType(); - - //去掉有时候出现的逗号 - type = type.replace(",", ""); - - if (WorkorderDetail.REPAIR.equals(type)) { - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Workorder_Repair.getId() + "-" + workorderDetail.getUnitId()); - } else if (WorkorderDetail.MAINTAIN.equals(type) || WorkorderDetail.INSTRUMENT.equals(type) || WorkorderDetail.LUBRICATION.equals(type) || WorkorderDetail.ANTISEPTIC.equals(type)) { - processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Workorder_Maintain.getId() + "-" + workorderDetail.getUnitId()); - } - - if (processDefinitions == null || processDefinitions.size() == 0) { - return MaintenanceCommString.Response_StartProcess_NoProcessDef; - } - ProcessInstance processInstance = workflowService.startWorkflow(workorderDetail.getId(), workorderDetail.getInsuser(), processDefinitions.get(0).getKey(), variables); - if (processInstance != null) { - workorderDetail.setProcessid(processInstance.getId()); - workorderDetail.setProcessdefid(processDefinitions.get(0).getId()); - } else { - throw new RuntimeException(); - } - int res = 0; - if (workorderDetail.getId() != null) { - WorkorderDetail entity = workorderDetailDao.selectByPrimaryKey(workorderDetail.getId()); - if (entity != null) { - //存在 update - res = workorderDetailDao.updateByPrimaryKeySelective(workorderDetail); - } else { - //不存在 insert - res = workorderDetailDao.insert(workorderDetail); - } - } - - if (res == 1) { - if (id != null && !id.trim().equals("")) { - PlanRecordAbnormity planRecordAbnormity = new PlanRecordAbnormity(); - planRecordAbnormity.setId(CommUtil.getUUID()); - planRecordAbnormity.setInsdt(CommUtil.nowDate()); - planRecordAbnormity.setFatherId(id); - planRecordAbnormity.setSonId(workorderDetail.getId()); - res += planRecordAbnormityService.save(planRecordAbnormity); - return res; - } - } - - if (workorderDetail.getReceiveUserId() != null && !workorderDetail.getReceiveUserId().equals("")) { - String str = workorderDetail.getReceiveUserId(); - boolean status = str.contains(","); - if (status) { - //选择多人 - String[] userId = str.split(","); - for (int i = 0; i < userId.length; i++) { - //发送消息 - workorderDetail.setReceiveUserId(userId[i]);//选择多人也每次赋值一个人 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(workorderDetail); - businessUnitRecord.sendMessage(userId[i], ""); - } - } else { - //发送消息 - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(workorderDetail); - businessUnitRecord.sendMessage(workorderDetail.getReceiveUserId(), ""); - } - } - return res; - } catch (Exception e) { - System.out.println(e.getMessage()); - } - return 0; - } - - @Transactional - @Override - public int doWorkorderDetailRepairAudit(BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid()); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Transactional - @Override - public int doWorkorderDetailRepairAudit(String completeDate, BusinessUnitAudit entity) { - try { - BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid()); - int res = this.businessUnitAuditService.doAudit(entity, businessUnitAdapter); - if (res > 0) { - this.updateStatus(entity.getBusinessid(), completeDate); - } - return res; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(); - } - } - - @Transactional - public int updateStatus(String id) { - WorkorderDetail entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { - if (entity.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectById(entity.getAbnormityId()); - if (abnormity != null) { - abnormity.setStatus(Abnormity.Status_Finish); - abnormityService.update(abnormity); - } - } - entity.setStatus(WorkorderDetail.Status_Finish); - //工单结束时间 - entity.setCompleteDate(CommUtil.nowDate()); - } - int res = this.update(entity); - return res; - } - - @Transactional - public int updateStatus(String id, String completeDate) { - WorkorderDetail entity = this.selectById(id); - List task = workflowService.getTaskService().createTaskQuery().processInstanceId(entity.getProcessid()).list(); - if (task != null && task.size() > 0) { - entity.setStatus(task.get(0).getName()); - } else { - if (entity.getAbnormityId() != null) { - Abnormity abnormity = abnormityService.selectById(entity.getAbnormityId()); - if (abnormity != null) { - abnormity.setStatus(Abnormity.Status_Finish); - abnormityService.update(abnormity); - } - } - entity.setStatus(WorkorderDetail.Status_Finish); - } - //工单结束时间 - entity.setCompleteDate(completeDate); - int res = this.update(entity); - return res; - } - - @Transactional - @Override - public String doCompete4Repair(String id, String userId) { - int res = 0; - String msg = ""; - WorkorderDetail workorderDetail = workorderDetailDao.selectByPrimaryKey(id); - if (workorderDetail != null) { - //抢单的单子 状态必须为 “抢单” - if (workorderDetail.getStatus().equals(WorkorderDetail.Status_Compete)) { - workorderDetail.setStatus(WorkorderDetail.Status_Start); - workorderDetail.setCompeteDate(CommUtil.nowDate()); - workorderDetail.setReceiveUserId(userId); - res = this.startWorkorderDetail("", workorderDetail); - msg = "抢单成功!"; - } else { - res = 0; - msg = "抢单失败,工单已被抢!"; - } - } - String result = "{\"res\":\"" + res + "\",\"msg\":\"" + msg + "\"}"; - return result; - } - - @Override - public void doExportRepair(HttpServletResponse response, List workorderDetailList, String type) throws IOException { - String fileName = ""; - HSSFWorkbook workbook = new HSSFWorkbook(); - if (workorderDetailList.size() > 1) { - if ("maintain".equals(type)) { - fileName = "设备保养汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } else { - fileName = "设备维修汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 8000);//工单号 - sheet.setColumnWidth(1, 4000);//上报人员 - sheet.setColumnWidth(2, 6000);//上报时间 - sheet.setColumnWidth(3, 6000);//设备编号 - sheet.setColumnWidth(4, 6000);//设备名称 - sheet.setColumnWidth(5, 8000);//故障情况 - sheet.setColumnWidth(6, 8000);//维修内容 - sheet.setColumnWidth(7, 4000);//维修类型 - sheet.setColumnWidth(8, 4000);//使用材料 - sheet.setColumnWidth(9, 4000);//维修人员 - sheet.setColumnWidth(10, 6000);//维修时间 - sheet.setColumnWidth(11, 4000);//完成情况 - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - String excelTitleStr = "工单号,上报人员,上报时间,设备编号,设备名称,故障情况,维修内容,维修类型,使用材料,维修人员,维修时间,完成情况"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 800); - for (int s = 0; s < excelTitle.length; s++) { - HSSFCell cell = row.createCell(s); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[s]); - cell.setCellValue(text); - } - for (int i = 0; i < workorderDetailList.size(); i++) { - row = sheet.createRow(1 + i); - row.setHeight((short) 400); - // 工单号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(workorderDetailList.get(i).getJobNumber()); - - //查询异常上报信息 - String insertUser = "";//上报人员 - String insdt = "";//上报时间 - String insTeam = "";//上报班组 - if (workorderDetailList.get(i).getAbnormityId() != null && !workorderDetailList.get(i).getAbnormityId().equals("")) { - Abnormity abnormity = abnormityService.selectById(workorderDetailList.get(i).getAbnormityId()); - if (abnormity != null) { - insertUser = abnormity.getInsertUser().getCaption(); - insdt = abnormity.getInsdt().substring(0, 19); - } - - User user = userService.getUserById(workorderDetailList.get(0).getReceiveUserId()); - if (user != null) { - Unit unit = unitService.getUnitById(user.getPid()); - if (unit != null) { - insTeam = unit.getName(); - } else { - insTeam = "无"; - } - } else { - insTeam = "无"; - } - } - - String repairUser = "";//维修人员 - String repairdt = "";//维修时间 - //维修人员信息 - if (workorderDetailList.get(0).getReceiveUserId() != null) { - User user = userService.getUserById(workorderDetailList.get(i).getReceiveUserId()); - if (user != null) { - repairUser = user.getCaption(); - if (workorderDetailList.get(i).getCompleteDate() != null) { - repairdt = workorderDetailList.get(i).getCompleteDate().substring(0, 19); - } - } - } - - // - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(insertUser); - // - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(insdt); - // - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - if (workorderDetailList.get(i).getEquipmentCard() != null) { - cell_3.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentcardid()); - } else { - cell_3.setCellValue(""); - } - // - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - if (workorderDetailList.get(i).getEquipmentCard() != null) { - cell_4.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentname()); - } else { - cell_4.setCellValue(""); - } - - // - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(workorderDetailList.get(i).getFaultDescription()); - // - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - List workorderRepairContents = workorderRepairContentService.selectListByWhere("where detail_id = '" + workorderDetailList.get(i).getId() + "'"); - if (workorderRepairContents != null && workorderRepairContents.size() > 0) { - String workderName = ""; - for (WorkorderRepairContent workorderRepairContent : workorderRepairContents) { - workderName += workorderRepairContent.getRepairName() + ","; - } - cell_6.setCellValue(workderName.substring(0, workderName.length() - 1)); - } else { - cell_6.setCellValue(""); // 维修内容 - } - // - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - if (workorderDetailList.get(i).getRepairPlanType() != null) { - if (workorderDetailList.get(i).getRepairPlanType().equals(WorkorderDetail.planIn)) { - cell_7.setCellValue("计划内"); - } else if (workorderDetailList.get(i).getRepairPlanType().equals(WorkorderDetail.planIn)) { - cell_7.setCellValue("计划外"); - } else { - cell_7.setCellValue("-"); - } - } else { - cell_7.setCellValue("-"); - } - // - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue("无"); - // - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - cell_9.setCellValue(repairUser); - // - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue(repairdt); - - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if ("finish".equals(workorderDetailList.get(i).getStatus())) { - cell_11.setCellValue("已完成"); - } else { - cell_11.setCellValue(""); - } - } - } else { - fileName = "设备维修单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备维修单"; - if ("maintain".equals(type)) { - title = "设备保养单"; - fileName = "设备保养单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 5000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 10); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 1000); - - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - - - HSSFCell cell_3 = handRow.createCell(3); - cell_3.setCellStyle(headStyle); - cell_3.setCellValue(title); - - //单独导出 - String excelTitleStr = "工单号,工单名称;上报人,上报时间;设备名称,设备编号;维修类型,小修/中修;故障现象;维修方案;发单人员,发单时间;维修人员,维修时间;验收人员,验收时间"; - String[] excelTitle = excelTitleStr.split(";"); - for (int i = 0; i < excelTitle.length; i++) { - // 新建一行 - HSSFRow row1 = sheet.createRow(1 + i); - row1.setHeight((short) 800); - if (excelTitle[i].contains(",")) { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell2 = row1.createCell(2); - HSSFCell cell3 = row1.createCell(3); - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i].substring(0, excelTitle[i].indexOf(","))); - cell1.setCellStyle(listStyle); - - String insertUser = "";//上报人员 - String insdt = "";//上报时间 - String issueUser = "";//发单人员 - String issuedt = "";//发单时间 - String repairUser = "";//维修人员 - String repairdt = "";//维修时间 - - //查询异常上报信息 - if (workorderDetailList.get(0).getAbnormityId() != null && !workorderDetailList.get(0).getAbnormityId().equals("")) { - Abnormity abnormity = abnormityService.selectById(workorderDetailList.get(0).getAbnormityId()); - insertUser = abnormity.getInsertUser().getCaption(); - insdt = abnormity.getInsdt().substring(0, 19); -// processSectionName = abnormity.getProcessSection().getName(); - } - //发单人员信息 - if (workorderDetailList.get(0).getInsuser() != null) { - User user = userService.getUserById(workorderDetailList.get(0).getInsuser()); - if (user != null) { - issueUser = user.getCaption(); - issuedt = workorderDetailList.get(0).getInsdt().substring(0, 19); - } - } - - //维修人员信息 - if (workorderDetailList.get(0).getReceiveUserId() != null) { - User user = userService.getUserById(workorderDetailList.get(0).getReceiveUserId()); - if (user != null) { - repairUser = user.getCaption(); - if (workorderDetailList.get(0).getCompleteDate() != null) { - repairdt = workorderDetailList.get(0).getCompleteDate().substring(0, 19); - } - } - } - - //工单号,工单名称;故障设备,计划完成时间;维修类型,小修/中修;故障现象;维修方案;发单人员,发单时间;维修人员,维修时间 - switch (i) { - case 0: - cell1.setCellValue(workorderDetailList.get(0).getJobNumber()); // 工单号 - cell3.setCellValue(workorderDetailList.get(0).getJobName()); // 工单名称 - break; - case 1: - cell1.setCellValue(insertUser); // 上报人 - cell3.setCellValue(insdt); // 上报时间 - break; - case 2: - if (workorderDetailList.get(0).getEquipmentCard() != null) { - cell1.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentname()); // 设备名称 - } else { - cell1.setCellValue(""); // 设备名称 - } - if (workorderDetailList.get(0).getEquipmentCard().getEquipmentcardid() != null) { - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentcardid()); // 设备编号 - } else { - cell3.setCellValue(""); // 设备编号 - } - break; - case 3: - if (workorderDetailList.get(0).getRepairPlanType().equals(WorkorderDetail.planIn)) { - cell1.setCellValue("计划内"); - } else if (workorderDetailList.get(0).getRepairPlanType().equals(WorkorderDetail.planIn)) { - cell1.setCellValue("计划外"); - } else { - cell1.setCellValue("-"); - } - - if (workorderDetailList.get(0).getRepairType().equals(WorkorderDetail.smallRepair)) { - cell3.setCellValue("小修"); - } else if (workorderDetailList.get(0).getRepairType().equals(WorkorderDetail.middleRepair)) { - cell3.setCellValue("中修"); - } else { - cell3.setCellValue("小修"); - } - - break; - case 6: - cell1.setCellValue(issueUser); - cell3.setCellValue(issuedt); - break; - case 7: - cell1.setCellValue(repairUser); - cell3.setCellValue(repairdt); - break; - case 8: - //确认人及确认时间 - net.sf.json.JSONObject jsonObject = this.getActivitiLastUser(workorderDetailList.get(0).getId()); - if (jsonObject != null) { - cell1.setCellValue(jsonObject.get("userName").toString()); - cell3.setCellValue(jsonObject.get("userTime").toString().substring(0, 19)); - } else { - cell1.setCellValue(""); - cell3.setCellValue(""); - } - break; - default: - cell1.setCellValue(""); - cell3.setCellValue(""); - } - cell2.setCellStyle(listStyle); - cell2.setCellValue(excelTitle[i].substring(excelTitle[i].indexOf(",") + 1, excelTitle[i].length())); - cell3.setCellStyle(listStyle); - } else { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell2 = row1.createCell(2); - HSSFCell cell3 = row1.createCell(3); - - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i]); - //防止合并单元格边框丢失 - cell2.setCellStyle(listStyle); - cell2.setCellValue(""); - //防止合并单元格边框丢失 - cell3.setCellStyle(listStyle); - cell3.setCellValue(""); - - if (i == 4) { - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 3)); - sheet.addMergedRegion(new CellRangeAddress(i + 1, i + 1, 1, 3)); - } else { - sheet.addMergedRegion(new CellRangeAddress(i + 1, i + 1, 1, 3)); - } - switch (i) { - case 4: - cell1.setCellValue(workorderDetailList.get(0).getFaultDescription()); // 故障情况 - cell1.setCellStyle(listStyle); - break; - case 5: - cell1.setCellValue(workorderDetailList.get(0).getSchemeResume()); // 维修方案 - cell1.setCellStyle(listStyle); - break; - } - } - } - // 将合并后单元格设置边框 - sheet.getRow(0).getCell(0).setCellStyle(listStyle); - sheet.getRow(5).getCell(1).setCellStyle(listStyle); - sheet.getRow(7).getCell(1).setCellStyle(listStyle); - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Override - public void doExportRepairJS(HttpServletResponse response, List workorderDetailList, String type) throws IOException { - String fileName = "设备维修汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - HSSFWorkbook workbook = new HSSFWorkbook(); - List libraryBases = null; - if (workorderDetailList.size() > 1) { - if ("maintain".equals(type)) { - fileName = "设备保养汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } else { - fileName = "设备维修汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 8000);//保修单编号 - sheet.setColumnWidth(1, 4000);//上报班组 - sheet.setColumnWidth(2, 3000);//上报人员 - sheet.setColumnWidth(3, 6000);//上报日期 - sheet.setColumnWidth(4, 4000);//设备编号 - sheet.setColumnWidth(5, 3000);//安装地点 - sheet.setColumnWidth(6, 4000);//设备名称 - sheet.setColumnWidth(7, 4000);//故障类别 - sheet.setColumnWidth(8, 5000);//故障情况 - sheet.setColumnWidth(9, 5000);//维修内容 - sheet.setColumnWidth(10, 5000);//使用材料 - sheet.setColumnWidth(11, 3000);//完成情况 - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - String excelTitleStr = "报修单编号,上报班组,上报人员,上报日期,设备编号,安装地点,设备名称,故障类别,故障情况,维修内容,使用材料,完成情况"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 800); - for (int s = 0; s < excelTitle.length; s++) { - HSSFCell cell = row.createCell(s); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[s]); - cell.setCellValue(text); - } - for (int i = 0; i < workorderDetailList.size(); i++) { - row = sheet.createRow(1 + i); - row.setHeight((short) 400); - // 报修单编号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(workorderDetailList.get(i).getJobNumber()); - - //查询异常上报信息 - String insertUser = "";//上报人员 - String insdt = "";//上报时间 - String insTeam = "";//上报班组 - if (workorderDetailList.get(i).getAbnormityId() != null && !workorderDetailList.get(i).getAbnormityId().equals("")) { - Abnormity abnormity = abnormityService.selectById(workorderDetailList.get(i).getAbnormityId()); - insertUser = abnormity.getInsertUser().getCaption(); - insdt = abnormity.getInsdt().substring(0, 19); - - User user = userService.getUserById(workorderDetailList.get(0).getReceiveUserId()); - if (user != null) { - Unit unit = unitService.getUnitById(user.getPid()); - if (unit != null) { - insTeam = unit.getName(); - } else { - insTeam = "无"; - } - } else { - insTeam = "无"; - } - - } - - //上报班组 值暂定 - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - cell_1.setCellValue(insTeam); - //上报人员 值暂定 - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - cell_2.setCellValue(insertUser); - //上报日期 值暂定 - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - cell_3.setCellValue(insdt); - //设备编号 - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentcardid()); - //安装地点 值暂定 - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue(workorderDetailList.get(i).getEquipmentCard().getAreaid()); - //设备名称 - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - cell_6.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentname()); - //故障类别 值暂定 - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - cell_7.setCellValue("无"); - //故障情况 - HSSFCell cell_8 = row.createCell(8); - cell_8.setCellStyle(listStyle); - cell_8.setCellValue(workorderDetailList.get(i).getFaultDescription()); - //维修内容 - HSSFCell cell_9 = row.createCell(9); - cell_9.setCellStyle(listStyle); - - List workorderRepairContents = workorderRepairContentService.selectListByWhere("where detail_id = '" + workorderDetailList.get(i).getId() + "'"); - if (workorderRepairContents != null && workorderRepairContents.size() > 0) { - String workderName = ""; - for (WorkorderRepairContent workorderRepairContent : workorderRepairContents) { - workderName += workorderRepairContent.getRepairName() + ","; - } - cell_9.setCellValue(workderName.substring(0, workderName.length() - 1)); - } else { - cell_9.setCellValue(""); // 维修内容 - } - - //使用材料 值暂定 - HSSFCell cell_10 = row.createCell(10); - cell_10.setCellStyle(listStyle); - cell_10.setCellValue("无"); - //完成情况 - HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if ("finish".equals(workorderDetailList.get(i).getStatus())) { - cell_11.setCellValue("已完成"); - } else { - cell_11.setCellValue(""); - } - } - } else { - fileName = "设备维修单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备维修单"; - if ("maintain".equals(type)) { - title = "设备保养单"; - fileName = "设备保养单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - } - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 5000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 10); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 1000); - - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - - - HSSFCell cell_3 = handRow.createCell(3); - cell_3.setCellStyle(headStyle); - cell_3.setCellValue(title); - - String excelTitleStr = "单号,所属区域;上报人,上报时间;设备编号,设备名称;设备型号,安装地点;故障情况" + - ";签收人,签收时间;维修内容;使用材料,是否委外;维修部门,维修时间;确认人员,确认时间"; - String[] excelTitle = excelTitleStr.split(";"); - for (int i = 0; i < excelTitle.length; i++) { - // 新建一行 - HSSFRow row1 = sheet.createRow(1 + i); - row1.setHeight((short) 800); - if (excelTitle[i].contains(",")) { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell2 = row1.createCell(2); - HSSFCell cell3 = row1.createCell(3); - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i].substring(0, excelTitle[i].indexOf(","))); - cell1.setCellStyle(listStyle); - - String insertUser = "";//上报人员 - String insdt = "";//上报时间 - String processSectionName = "";//工艺段 - - //查询异常上报信息 - if (workorderDetailList.get(0).getAbnormityId() != null && !workorderDetailList.get(0).getAbnormityId().equals("")) { - Abnormity abnormity = abnormityService.selectById(workorderDetailList.get(0).getAbnormityId()); - insertUser = abnormity.getInsertUser().getCaption(); - insdt = abnormity.getInsdt().substring(0, 19); - processSectionName = abnormity.getProcessSection().getName(); - } - - switch (i) { - case 0: - cell1.setCellValue(workorderDetailList.get(0).getJobNumber()); // 单号 - cell3.setCellValue(processSectionName); - break; - case 1: - cell1.setCellValue(insertUser); // 上报人 - cell3.setCellValue(insdt); // 上报时间 - break; - case 2: - cell1.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentcardid()); // 设备编号 - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentname()); // 设备名称 - break; - case 3: - cell1.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentmodelname()); // 设备型号 - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getAreaid()); // 安装地点 - break; - case 5: - cell1.setCellValue("无"); // 签收人 - cell3.setCellValue("无"); // 签收时间 - break; - case 7: - cell1.setCellValue("无"); // 使用材料 - cell3.setCellValue("无"); // 是否委外 - break; - case 8: - User user = userService.getUserById(workorderDetailList.get(0).getReceiveUserId()); - if (user != null) { - Unit unit = unitService.getUnitById(user.getPid()); - if (unit != null) { - cell1.setCellValue(unit.getName()); // 维修部门 - } else { - cell1.setCellValue("无"); // 维修部门 - } - } else { - cell1.setCellValue("无"); // 维修部门 - } - if (workorderDetailList.get(0).getCompleteDate() != null) { - cell3.setCellValue(workorderDetailList.get(0).getCompleteDate().substring(0, 19)); // 维修时间 - } else { - cell3.setCellValue("无"); // 维修时间 - } - break; - case 9: - cell1.setCellValue("1"); // 确认人员 - cell3.setCellValue("2"); // 确认时间 - break; - default: - cell1.setCellValue(""); - cell3.setCellValue(""); - } - cell2.setCellStyle(listStyle); - cell2.setCellValue(excelTitle[i].substring(excelTitle[i].indexOf(",") + 1, excelTitle[i].length())); - cell3.setCellStyle(listStyle); - } else { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell3 = row1.createCell(3); - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i]); - - //防止合并单元格边框丢失 - cell3.setCellStyle(listStyle); - cell3.setCellValue(""); - - if (i == 4) { - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 3)); - sheet.addMergedRegion(new CellRangeAddress(i + 1, i + 1, 1, 3)); - } else { - sheet.addMergedRegion(new CellRangeAddress(i + 1, i + 1, 1, 3)); - } - switch (i) { - case 4: - cell1.setCellValue(workorderDetailList.get(0).getFaultDescription()); // 故障情况 - break; - case 6: - List workorderRepairContents = workorderRepairContentService.selectListByWhere("where detail_id = '" + workorderDetailList.get(0).getId() + "'"); - if (workorderRepairContents.size() > 0) { - String workderName = ""; - for (WorkorderRepairContent workorderRepairContent : workorderRepairContents) { - workderName += workorderRepairContent.getRepairName() + ","; - } - cell1.setCellValue(workderName.substring(0, workderName.length() - 1)); // 维修内容 - } else { - cell1.setCellValue(""); // 维修内容 - } - break; - } - } - } - // 将合并后单元格设置边框 - sheet.getRow(0).getCell(0).setCellStyle(listStyle); - sheet.getRow(5).getCell(1).setCellStyle(listStyle); - sheet.getRow(7).getCell(1).setCellStyle(listStyle); - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Override - public void doExportMain(HttpServletResponse response, List workorderDetailList, String type) throws IOException { - String fileName = ""; - HSSFWorkbook workbook = new HSSFWorkbook(); - if (workorderDetailList.size() > 1) { - fileName = "设备保养汇总" + CommUtil.nowDate().substring(0, 10) + ".xls"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 8000);//工单号 - sheet.setColumnWidth(1, 6000);//设备编号 - sheet.setColumnWidth(2, 6000);//设备名称 - sheet.setColumnWidth(3, 3000);//计划日期 - sheet.setColumnWidth(4, 10000);//保养内容 - sheet.setColumnWidth(5, 4000);//使用材料 - sheet.setColumnWidth(6, 4000);//保养人员 - sheet.setColumnWidth(7, 4000);//完成情况 - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 16); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - String excelTitleStr = "工单号,设备编号,设备名称,计划日期,保养内容,使用材料,保养人员,完成情况"; - String[] excelTitle = excelTitleStr.split(","); - HSSFRow row = sheet.createRow(0); - row.setHeight((short) 800); - for (int s = 0; s < excelTitle.length; s++) { - HSSFCell cell = row.createCell(s); - cell.setCellStyle(titleStyle); - HSSFRichTextString text = new HSSFRichTextString(excelTitle[s]); - cell.setCellValue(text); - } - for (int i = 0; i < workorderDetailList.size(); i++) { - row = sheet.createRow(1 + i); - row.setHeight((short) 400); - // 报修单编号 - HSSFCell cell_0 = row.createCell(0); - cell_0.setCellStyle(listStyle); - cell_0.setCellValue(workorderDetailList.get(i).getJobNumber()); - - HSSFCell cell_1 = row.createCell(1); - cell_1.setCellStyle(listStyle); - if (workorderDetailList.get(i).getEquipmentCard() != null) { - cell_1.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentcardid()); - } else { - cell_1.setCellValue(""); - } - - HSSFCell cell_2 = row.createCell(2); - cell_2.setCellStyle(listStyle); - if (workorderDetailList.get(i).getEquipmentCard() != null) { - cell_2.setCellValue(workorderDetailList.get(i).getEquipmentCard().getEquipmentname()); - } else { - cell_2.setCellValue(""); - } - - // - HSSFCell cell_3 = row.createCell(3); - cell_3.setCellStyle(listStyle); - if (workorderDetailList.get(i).getPlanDate() != null) { - cell_3.setCellValue(workorderDetailList.get(i).getPlanDate().substring(0, 7)); - } else { - cell_3.setCellValue(""); - } - // - HSSFCell cell_4 = row.createCell(4); - cell_4.setCellStyle(listStyle); - cell_4.setCellValue(workorderDetailList.get(i).getSchemeResume()); - // - HSSFCell cell_5 = row.createCell(5); - cell_5.setCellStyle(listStyle); - cell_5.setCellValue("无"); - // - HSSFCell cell_6 = row.createCell(6); - cell_6.setCellStyle(listStyle); - User user = userService.getUserById(workorderDetailList.get(i).getReceiveUserId()); - if (user != null) { - cell_6.setCellValue(user.getCaption()); - } else { - cell_6.setCellValue(""); - } - - // - HSSFCell cell_7 = row.createCell(7); - cell_7.setCellStyle(listStyle); - if ("finish".equals(workorderDetailList.get(i).getStatus())) { - cell_7.setCellValue("已完成"); - } else { - cell_7.setCellValue(""); - } - - /*List workorderRepairContents = workorderRepairContentService.selectListByWhere("where detail_id = '" + workorderDetailList.get(i).getId() + "'"); - if (workorderRepairContents != null && workorderRepairContents.size() > 0) { - String workderName = ""; - for (WorkorderRepairContent workorderRepairContent : workorderRepairContents) { - workderName += workorderRepairContent.getRepairName() + ","; - } - cell_9.setCellValue(workderName.substring(0, workderName.length() - 1)); - } else { - cell_9.setCellValue(""); // 维修内容 - }*/ - - //使用材料 值暂定 -// HSSFCell cell_10 = row.createCell(10); -// cell_10.setCellStyle(listStyle); -// cell_10.setCellValue("无"); - //完成情况 - /*HSSFCell cell_11 = row.createCell(11); - cell_11.setCellStyle(listStyle); - if ("finish".equals(workorderDetailList.get(i).getStatus())) { - cell_11.setCellValue("已完成"); - } else { - cell_11.setCellValue(""); - }*/ - } - } else { - fileName = "设备保养单" + CommUtil.nowDate().substring(0, 10) + ".xls"; - String title = "设备保养单"; - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet(title); - // 声明一个画图的顶级管理器 - HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); - // 定义注释的大小和位置,详见文档 - HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5)); - // 设置注释内容 - comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); - // 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. - comment.setAuthor("leno"); - // 设置表格每列的宽度 - sheet.setColumnWidth(0, 3000); - sheet.setColumnWidth(1, 5000); - sheet.setColumnWidth(2, 3000); - sheet.setColumnWidth(3, 5000); - // 生成并设置一个样式,用于表头 - HSSFCellStyle headStyle = workbook.createCellStyle(); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setVerticalAlignment(VerticalAlignment.CENTER); - headStyle.setBorderBottom(BorderStyle.THIN); - headStyle.setBorderLeft(BorderStyle.THIN); - headStyle.setBorderRight(BorderStyle.THIN); - headStyle.setBorderTop(BorderStyle.THIN); - // 生成另一个字体 - HSSFFont headfont = workbook.createFont(); - headfont.setBold(false); - headfont.setFontHeightInPoints((short) 10); - // 把字体应用到当前的样式 - headStyle.setFont(headfont); - //标题样式 - HSSFCellStyle titleStyle = workbook.createCellStyle(); - titleStyle.setBorderBottom(BorderStyle.THIN); - titleStyle.setBorderLeft(BorderStyle.THIN); - titleStyle.setBorderRight(BorderStyle.THIN); - titleStyle.setBorderTop(BorderStyle.THIN); - HSSFFont headfont2 = workbook.createFont(); - headfont2.setBold(false); - headfont2.setFontHeightInPoints((short) 12); - headfont2.setBold(true);//粗体显示 - // 把字体应用到当前的样式 - titleStyle.setFont(headfont2); - titleStyle.setWrapText(true); - titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - titleStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - titleStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.index); - titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - //循环中的数据样式 - HSSFCellStyle listStyle = workbook.createCellStyle(); - listStyle.setBorderBottom(BorderStyle.THIN); - listStyle.setBorderLeft(BorderStyle.THIN); - listStyle.setBorderRight(BorderStyle.THIN); - listStyle.setBorderTop(BorderStyle.THIN); - listStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 - listStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 - listStyle.setWrapText(true); - HSSFFont font2 = workbook.createFont(); - font2.setFontName("宋体"); - //font2.setFontHeightInPoints((short) 10); - listStyle.setFont(font2);//选择需要用到的字体格式 - HSSFDataFormat format = workbook.createDataFormat(); - listStyle.setDataFormat(format.getFormat("@")); - // 第一行表头标题 - HSSFRow handRow = sheet.createRow(0); - handRow.setHeight((short) 1000); - - HSSFCell cell = handRow.createCell(0); - cell.setCellStyle(headStyle); - cell.setCellValue(title); - - HSSFCell cell_3 = handRow.createCell(3); - cell_3.setCellStyle(headStyle); - cell_3.setCellValue(title); - - String excelTitleStr = "工单号,工单名称;设备名称,设备编号;计划时间;计划内容;发单人员,发单时间;保养人员,保养时间"; - String[] excelTitle = excelTitleStr.split(";"); - for (int i = 0; i < excelTitle.length; i++) { - // 新建一行 - HSSFRow row1 = sheet.createRow(1 + i); - row1.setHeight((short) 800); - if (excelTitle[i].contains(",")) { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell2 = row1.createCell(2); - HSSFCell cell3 = row1.createCell(3); - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i].substring(0, excelTitle[i].indexOf(","))); - cell1.setCellStyle(listStyle); - - String issueUser = "";//发单人员 - String issuedt = "";//发单时间 - String repairUser = "";//维修人员 - String repairdt = "";//维修时间 - - //发单人员信息 - if (workorderDetailList.get(0).getInsuser() != null) { - User user = userService.getUserById(workorderDetailList.get(0).getInsuser()); - if (user != null) { - issueUser = user.getCaption(); - issuedt = workorderDetailList.get(0).getInsdt().substring(0, 19); - } - } - - //维修人员信息 - if (workorderDetailList.get(0).getReceiveUserId() != null) { - User user = userService.getUserById(workorderDetailList.get(0).getReceiveUserId()); - if (user != null) { - repairUser = user.getCaption(); - if (workorderDetailList.get(0).getCompleteDate() != null) { - repairdt = workorderDetailList.get(0).getCompleteDate().substring(0, 19); - } - } - } - - switch (i) { - case 0: - cell1.setCellValue(workorderDetailList.get(0).getJobNumber()); // 工单号 - cell3.setCellValue(workorderDetailList.get(0).getJobName()); // 工单名称 - break; - case 1: - cell1.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentname()); // 设备名称 - cell3.setCellValue(workorderDetailList.get(0).getEquipmentCard().getEquipmentcardid()); // 设备编号 - break; - case 4: - cell1.setCellValue(issueUser); - cell3.setCellValue(issuedt); - break; - case 5: - cell1.setCellValue(repairUser); - cell3.setCellValue(repairdt); - break; - default: - cell1.setCellValue(""); - cell3.setCellValue(""); - } - cell2.setCellStyle(listStyle); - cell2.setCellValue(excelTitle[i].substring(excelTitle[i].indexOf(",") + 1, excelTitle[i].length())); - cell3.setCellStyle(listStyle); - } else { - HSSFCell cell0 = row1.createCell(0); - HSSFCell cell1 = row1.createCell(1); - HSSFCell cell2 = row1.createCell(2); - HSSFCell cell3 = row1.createCell(3); - - switch (i) { - case 2: - cell1.setCellValue(workorderDetailList.get(0).getPlanDate().substring(0, 7)); - cell3.setCellValue(workorderDetailList.get(0).getPlanDate().substring(0, 7)); - break; - case 3: - cell1.setCellValue(workorderDetailList.get(0).getSchemeResume()); - cell3.setCellValue(workorderDetailList.get(0).getSchemeResume()); - break; - } - - cell0.setCellStyle(listStyle); - cell0.setCellValue(excelTitle[i]); - //防止合并单元格边框丢失 - cell2.setCellStyle(listStyle); - cell2.setCellValue(""); - //防止合并单元格边框丢失 - cell3.setCellStyle(listStyle); - cell3.setCellValue(""); - } - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 3)); - sheet.addMergedRegion(new CellRangeAddress(3, 3, 1, 3)); - sheet.addMergedRegion(new CellRangeAddress(4, 4, 1, 3)); - } - // 将合并后单元格设置边框 - sheet.getRow(0).getCell(0).setCellStyle(listStyle); - sheet.getRow(3).getCell(1).setCellStyle(listStyle); - sheet.getRow(4).getCell(1).setCellStyle(listStyle); - } - try { - response.reset(); - response.setContentType("applicatoin/octet-stream"); - response.setCharacterEncoding("UTF-8"); - response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); - OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - System.out.println(e.toString()); - } finally { - workbook.close(); - } - } - - @Async - public void sendMqtt(BusinessUnitHandle businessUnitHandle) { - try { - com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); - jsonObject.put("title", "维修单"); - jsonObject.put("content", "有新的维修单,可以抢单!"); - //获取需要下发的班组 ids - String teamIds = businessUnitHandle.getTargetusers(); - String[] teamId = teamIds.split(","); - String idsT = ""; - if (teamId != null && teamId.length > 0) { - for (int i = 0; i < teamId.length; i++) { - idsT += "'" + teamId[i] + "',"; - } - idsT = idsT.substring(0, idsT.length() - 1); - } - List listD = groupDetailService.selectListByWhere("where id in (" + idsT + ")"); - String userIds = ""; - for (GroupDetail groupDetail : listD) { - userIds += groupDetail.getLeader() + ","; - userIds += groupDetail.getMembers() + ","; - } - if (userIds != null && !userIds.equals("")) { - String[] userId = userIds.split(","); - if (userId != null && !userId.equals("")) { - for (int i = 0; i < userId.length; i++) { - //发送抢单指令 - Mqtt mqtt = new Mqtt(); - if (mqtt.getStatus() != null && mqtt.getStatus().equals("0")) { - MqttUtil.publish(jsonObject, userId[i]); - } - } - } - } - } catch (Exception e) { - System.out.println(e); - } - } - - @Override - public net.sf.json.JSONObject getActivitiLastUser(String id) { - WorkorderDetail entity = this.workorderDetailDao.selectByPrimaryKey(id); - List businessUnitRecords = new ArrayList<>(); - BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity); - businessUnitRecords.add(businessUnitRecord); - - List workTasks = workflowProcessDefinitionService.getAllPDTask(entity.getProcessdefid(), "desc"); - List keys = new ArrayList<>(); - for (WorkTask workTask : workTasks) { - keys.add(workTask.getTaskKey()); - } - Set set = new HashSet(); - set.addAll(keys); - keys = new ArrayList<>(); - keys.addAll(set); - for (String item : keys) { - switch (item) { - case BusinessUnit.UNIT_WORKORDER_REPAIR_HANDLE: - List list1 = businessUnitHandleService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitHandle businessUnitHandle : list1) { - businessUnitRecord = new BusinessUnitRecord(businessUnitHandle); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_REPAIR_APPLY_AUDIT: - List list2 = businessUnitAuditService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitAudit businessUnitAudit : list2) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - case BusinessUnit.UNIT_WORKORDER_REPAIR_CHECK_AUDIT: - List list3 = businessUnitAuditService.selectListByWhere("where businessid='" + id + "' "); - for (BusinessUnitAudit businessUnitAudit : list3) { - businessUnitRecord = new BusinessUnitRecord(businessUnitAudit); - businessUnitRecords.add(businessUnitRecord); - } - break; - default: - break; - } - } - //展示最新任务是否签收 - String processId = entity.getProcessid(); - List list = this.workflowService.getHistoryService() // 历史相关Service - .createHistoricTaskInstanceQuery() // 创建历史任务实例查询 - .processInstanceId(processId) // 用流程实例id查询 - .list(); - for (HistoricTaskInstance task : list) { - if (task.getAssignee() == null || task.getClaimTime() == null) { - continue; - } - businessUnitRecord = new BusinessUnitRecord(task); - businessUnitRecords.add(businessUnitRecord); - } - Collections.sort(businessUnitRecords, new Comparator() { - public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - try { - Date dt1 = df.parse(o1.getInsdt()); - Date dt2 = df.parse(o2.getInsdt()); - if (dt1.getTime() > dt2.getTime()) { - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - return -1; - } else { - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - - } - }); - net.sf.json.JSONObject json = new net.sf.json.JSONObject(); - net.sf.json.JSONArray jsonArray = JSONArray.fromObject(businessUnitRecords); - if (jsonArray != null && jsonArray.size() > 0) { - net.sf.json.JSONObject jsonObject = jsonArray.getJSONObject(jsonArray.size() - 1); - if (jsonObject != null) { - User user = userService.getUserById(jsonObject.get("insuser").toString()); - json.put("userId", jsonObject.get("insuser").toString()); - if (user != null) { - json.put("userName", user.getCaption()); - } - json.put("userTime", jsonObject.get("insdt").toString()); - json.put("userContent", jsonObject.get("record").toString()); - } - } else { - - } - return json; - } - - @Override - public List selectListByNum(String wherestr, String str) { - List list = workorderDetailDao.selectListByNum(wherestr, str); - return list; - } - - @Override - public List selectCountByWhere(String wherestr) { - List list = workorderDetailDao.selectCountByWhere(wherestr); - return list; - } - - - @Override - public int getGrabOrdersNum(String userId, String sdt, String edt, String unitId, String type) { - int num = 0; - - String wString = "where (compete_date>='" + sdt + "' and compete_date<='" + edt + "') and receive_user_id='" + userId + "' and unit_id='" + unitId + "' and type in ('" + type + "') and status = '" + WorkorderDetail.Status_Finish + "' and is_compete='" + CommString.Active_True + "' "; - List list = selectCountByWhere(wString); - - if (list != null && list.size() > 0) { - num = list.get(0).get_num(); - } - - return num; - } - - /** - * 查询 总故障时间 - * - * @param entity - * @return - */ - public JSONObject getAbnormityTime(WorkorderDetail entity) { - JSONObject jsonObject = new JSONObject(); - //查询关联的异常 - if (null != entity.getAbnormityId() && !entity.getAbnormityId().isEmpty()) { - Abnormity abnormity = abnormityService.selectSimpleById(entity.getAbnormityId()); - if (abnormity != null) { - entity.setAbnormity(abnormity); - - String sdt = abnormity.getInsdt(); - String edt = (entity.getCompleteDate() != null ? entity.getCompleteDate() : CommUtil.nowDate()); - int time = CommUtil.getDays2(edt.substring(0, 19), sdt.substring(0, 19), "second"); - if (time >= 0) { - entity.setAbnormityTimeString(CommUtil.secondToDate(time)); - jsonObject.put("time", time); - jsonObject.put("timeStr", CommUtil.secondToDate(time)); - } else { - entity.setAbnormityTimeString("0"); - jsonObject.put("time", "0"); - jsonObject.put("timeStr", "0"); - } - jsonObject.put("sdt", sdt.substring(0, 19)); - jsonObject.put("edt", edt.substring(0, 19)); - } else { - entity.setAbnormityTimeString("0"); - jsonObject.put("time", "0"); - jsonObject.put("timeStr", "0"); - } - jsonObject.put("isAbnormity", true);//是否关联的异常 - } - //未关联异常,一般由主管直接下发的 - else { - String sdt = entity.getInsdt(); - String edt = (entity.getCompleteDate() != null ? entity.getCompleteDate() : CommUtil.nowDate()); - int time = CommUtil.getDays2(edt.substring(0, 19), sdt.substring(0, 19), "second"); - if (time >= 0) { - entity.setAbnormityTimeString(CommUtil.secondToDate(time)); - jsonObject.put("time", time); - jsonObject.put("timeStr", CommUtil.secondToDate(time)); - } else { - entity.setAbnormityTimeString("0"); - jsonObject.put("time", "0"); - jsonObject.put("timeStr", "0"); - } - jsonObject.put("sdt", sdt.substring(0, 19)); - jsonObject.put("edt", edt.substring(0, 19)); - jsonObject.put("isAbnormity", false);//是否关联的异常 - } - return jsonObject; - } - -} diff --git a/src/com/sipai/service/workorder/impl/WorkorderRepairContentServiceImpl.java b/src/com/sipai/service/workorder/impl/WorkorderRepairContentServiceImpl.java deleted file mode 100644 index 18888252..00000000 --- a/src/com/sipai/service/workorder/impl/WorkorderRepairContentServiceImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.sipai.service.workorder.impl; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import com.sipai.dao.maintenance.LibraryRepairBlocDao; -import com.sipai.dao.workorder.WorkorderRepairContentDao; -import com.sipai.entity.maintenance.LibraryRepairBloc; -import com.sipai.entity.user.Company; -import com.sipai.entity.workorder.WorkorderRepairContent; -import com.sipai.service.maintenance.LibraryRepairBlocService; -import com.sipai.service.workorder.WorkorderRepairContentService; - -@Service("workorderRepairContentService") -public class WorkorderRepairContentServiceImpl implements WorkorderRepairContentService{ - - @Resource - private WorkorderRepairContentDao workorderRepairContentDao; - @Resource - private LibraryRepairBlocService libraryRepairBlocService; - - @Override - public WorkorderRepairContent selectById(String t) { - // TODO Auto-generated method stub - WorkorderRepairContent entity = workorderRepairContentDao.selectByPrimaryKey(t); - - return entity; - } - - @Override - public int deleteById(String t) { - // TODO Auto-generated method stub - return workorderRepairContentDao.deleteByPrimaryKey(t); - } - - @Override - public int save(WorkorderRepairContent entity) { - // TODO Auto-generated method stub - - return workorderRepairContentDao.insertSelective(entity); - } - - - - @Override - public int update(WorkorderRepairContent entity) { - // TODO Auto-generated method stub - - return workorderRepairContentDao.updateByPrimaryKeySelective(entity); - } - - @Override - public List selectListByWhere(String t) { - WorkorderRepairContent entity = new WorkorderRepairContent(); - entity.setWhere(t); - List workorderRepairContents = workorderRepairContentDao.selectListByWhere(entity); - for(WorkorderRepairContent item :workorderRepairContents ){ - if (null != item.getRepairContentId() && !item.getRepairContentId().isEmpty()) { - LibraryRepairBloc libraryRepairBloc = this.libraryRepairBlocService.selectById(item.getRepairContentId()); - item.setLibraryRepairBloc(libraryRepairBloc); - } - } - - return workorderRepairContents; - } - - - @Override - public int deleteByWhere(String t) { - WorkorderRepairContent entity = new WorkorderRepairContent(); - entity.setWhere(t); - return workorderRepairContentDao.deleteByWhere(entity); - } - -} diff --git a/src/com/sipai/servlet/PushSmsServlet.java b/src/com/sipai/servlet/PushSmsServlet.java deleted file mode 100644 index 8da0340d..00000000 --- a/src/com/sipai/servlet/PushSmsServlet.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.sipai.servlet; - -import java.io.IOException; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.jsp.jstl.sql.Result; - -import org.springframework.stereotype.Controller; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.google.gson.Gson; -import com.sipai.entity.msg.Msg; -import com.sipai.entity.msg.Sms; -import com.sipai.service.msg.MsgService; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.MenuService; -import com.sipai.tools.SpringContextUtil; - -public class PushSmsServlet extends HttpServlet { - private static int index = 1; - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - //System.out.println(index); - // List smsList = new ArrayList(); - String userid = request.getParameter("userid"); - String lastdate = request.getParameter("lastdate");//最新一条记录的日期 - if(lastdate==null){ - lastdate="2016-01-01 00:00:00.000"; - } - Sms sms=null; - String orderstr=" order by M.insdt desc"; - String wherestr=" where 1=1"; - wherestr+=" and M.issms!='sms' and M.delflag!='TRUE' and V.delflag!='TRUE' and V.unitid='"+request.getParameter("userid")+"' and V.status='U'"; - MsgService msgService = (MsgService) SpringContextUtil.getBean("msgService"); - List list = msgService.getMsgrecv_RU(wherestr+orderstr); - Boolean flag=false; - //request.setAttribute("pageinfo", id.getPi()); - if( list!=null&&list.size()>0){ - List u_last = msgService.getMsgrecv_RU(wherestr+" and M.insdt>'"+lastdate+"' "+orderstr); - if(u_last!=null && u_last.size()>0){//若比最新的一条消息时间晚,则有新消息 - flag=true; - lastdate=u_last.get(0).getInsdt().toString(); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String dateString = formatter.format(currentTime); - String content="您有一条新消息,请注意查收"; - if(flag && u_last.get(0).getContent()!=null&&!u_last.get(0).getContent().toString().isEmpty()){ - content=u_last.get(0).getContent().toString(); - } - sms = new Sms(index, - content, lastdate, - flag.toString(),String.valueOf(list.size()),userid); - - - - } - index++; - // smsList.add(sms); - // sms = new Sms(0, "����İ���", "2013-04-04", "13522224444"); - // smsList.add(sms); - // sms = new Sms(1, "�������İ���", "2013-05-05", "13522224444"); - // smsList.add(sms); - - response.setContentType("text/html"); - request.setCharacterEncoding("UTF-8"); - response.setCharacterEncoding("utf-8"); - PrintWriter out = response.getWriter(); - Gson gson = new Gson(); - String json = gson.toJson(sms); - out.write(json); - out.flush(); - out.close(); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - this.doGet(request, response); - } - -} diff --git a/src/com/sipai/servlet/ShowImgServlet.java b/src/com/sipai/servlet/ShowImgServlet.java deleted file mode 100644 index a665026e..00000000 --- a/src/com/sipai/servlet/ShowImgServlet.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.sipai.servlet; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.OutputStream; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -public class ShowImgServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - /** - * 显示附件上传存在服务器本地磁盘的图片 - * @param request - * @param response - * @return - * @throws ServletException - * @throws IOException - */ - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) { - if(request.getParameter("src")!=null){ - //读取本地图片输入流 - FileInputStream inputStream; - try { - //设置编码 - response.setCharacterEncoding("utf-8"); - response.setContentType("text/html; charset=utf-8"); - request.setCharacterEncoding("UTF-8"); - //文件存放路径 - String filePath = java.net.URLDecoder.decode(request.getParameter("src"),"utf-8"); - inputStream = new FileInputStream(filePath); - int i = inputStream.available(); - //byte数组用于存放图片字节数据 - byte[] buff = new byte[i]; - inputStream.read(buff); - //记得关闭输入流 - inputStream.close(); - //设置发送到客户端的响应内容类型 - response.setContentType("image/*"); - OutputStream out = response.getOutputStream(); - out.write(buff); - //关闭响应输出流 - out.close(); - } catch (FileNotFoundException e) { - System.out.println("11"); - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - System.out.println("22"); - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - } - - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - this.doPost(request, response); - } - -} diff --git a/src/com/sipai/servlet/VImage.java b/src/com/sipai/servlet/VImage.java deleted file mode 100644 index 477641cd..00000000 --- a/src/com/sipai/servlet/VImage.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.servlet; - -import com.sipai.entity.base.BasicComponents; -import com.sipai.service.base.BasicComponentsService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.tools.VerifyCodeUtils; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.util.List; - - -public class VImage extends HttpServlet { - - private static final long serialVersionUID = 1L; - - public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - /*response.setHeader("Pragma", "No-cache"); - response.setHeader("Cache-Control", "no-cache"); - response.setDateHeader("Expires", 0); */ - response.setContentType("image/jpeg"); - int verCodeStrengthNum=0; - int codenumber = 4; - //生成图片 - int w = 110, h = 34; - BasicComponentsService basicComponentsService = (BasicComponentsService) SpringContextUtil.getBean("basicComponentsService"); - List verCodeStrengthList = basicComponentsService.selectListByWhere("where active='1' and code like '%login-verCode-strength%' order by morder"); - if (verCodeStrengthList != null && verCodeStrengthList.size() > 0) { - BasicComponents verCodeStrength = verCodeStrengthList.get(0); - if(verCodeStrength!=null && verCodeStrength.getBasicConfigure()!=null && !verCodeStrength.getBasicConfigure().getType().isEmpty()){ - verCodeStrengthNum = Integer.parseInt(verCodeStrength.getBasicConfigure().getType()); - } - } - //生成随机字串 - String verifyCode = ""; - if(verCodeStrengthNum==0){ - codenumber=4; - w = 100; - h = 34; - verifyCode = VerifyCodeUtils.generateVerifyCode(codenumber); - }else{ - codenumber=6; - w = 110; - h = 34; - verifyCode = VerifyCodeUtils.generateVerifyAllCode(codenumber); - } - //存入会话session - HttpSession session = request.getSession(true); - //删除以前的 - session.removeAttribute("verCode"); - session.setAttribute("verCode", verifyCode.toLowerCase()); - String verCodeDate = CommUtil.encryptAES(CommUtil.nowDate(),"base64"); - session.setAttribute("verCodeDate", verCodeDate); - VerifyCodeUtils.outputImage(w, h, response.getOutputStream(), verifyCode); - - } - -} diff --git a/src/com/sipai/servlet/engineeringServlet.java b/src/com/sipai/servlet/engineeringServlet.java deleted file mode 100644 index ed3a0e34..00000000 --- a/src/com/sipai/servlet/engineeringServlet.java +++ /dev/null @@ -1,589 +0,0 @@ -package com.sipai.servlet; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Method; -import java.math.BigDecimal; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.httpclient.HttpException; -import org.springframework.web.bind.annotation.ResponseBody; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.sparepart.Channels; -import com.sipai.entity.sparepart.Contract; -import com.sipai.entity.sparepart.SparePartCommString; -import com.sipai.entity.sparepart.Subscribe; -import com.sipai.entity.sparepart.SubscribeDetail; -import com.sipai.service.sparepart.ChannelsService; -import com.sipai.service.sparepart.ContractService; -import com.sipai.service.sparepart.SubscribeDetailService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -public class engineeringServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - doPost(request, response); - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - // 获取请求的URI地址信息 - String url = request.getRequestURI(); - //System.out.println("工程系统接口输出url======="+url); - // 截取其中的方法名 - String methodName = url.substring(url.lastIndexOf("/")+1, url.length()); - Method method = null; - try { - //System.out.println("工程系统接口输出methodName======="+methodName); - // 使用反射机制获取在本类中声明了的方法 - method = getClass().getDeclaredMethod(methodName, HttpServletRequest.class, HttpServletResponse.class); - // 执行方法 - method.invoke(this, request, response); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - /** - * 列资渠道接口(项目和工程信息)(项目概算表) - */ - private void submitChannels(HttpServletRequest request, HttpServletResponse response) throws ServletException{ - System.out.println("调用列资渠道接口:"+CommUtil.nowDate()); - try { - request.setCharacterEncoding("utf-8"); - } catch (UnsupportedEncodingException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - String channels = request.getParameter("channels"); - if(channels!=null && !channels.equals("")){ - - }else{ - //接收json数据 - BufferedReader streamReader = null; - StringBuilder responseStrBuilder = new StringBuilder(); - String inputStr; - try { - streamReader = new BufferedReader( new - InputStreamReader(request.getInputStream(), "UTF-8")); - while ((inputStr = streamReader.readLine()) != null) - responseStrBuilder.append(inputStr); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - System.out.println(e.toString()); - e.printStackTrace(); - throw new RuntimeException(e); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - System.out.println(e.toString()); - throw new RuntimeException(e); - } - - //转化成json对象 - //System.out.println("列资渠道接口输出responseStrBuilder======="+responseStrBuilder.toString()); - JSONObject json=JSONObject.parseObject(responseStrBuilder.toString()); - if(json!=null && json.size()>0){ - channels = json.getString("channels"); - } - } - channels = charSetConvert(channels); - String result = "{\"success\":false,\"msg\":\"执行失败\"}"; - try { - JSONArray channelsArray=JSONArray.parseArray(channels); - int res=0; - if(channelsArray!=null && channelsArray.size()>0){ - //System.out.println("工程系统接口输出channelsArray======="+channelsArray.size()); - ChannelsService channelsService = (ChannelsService) SpringContextUtil.getBean("channelsService"); - String wherestr = ""; - String name = ""; - String parent = ""; - String number = ""; - String status = ""; - Channels channel = null; - for(int i=0;i0){ - channels = json.getString("channels"); - } - } - channels = charSetConvert(channels); - String result = "{\"success\":false,\"msg\":\"执行失败\"}"; - try { - System.out.println("列资渠道接口输出channels======="+channels); - JSONArray channelsArray=JSONArray.parseArray(channels); - int res=0; - if(channelsArray!=null && channelsArray.size()>0){ - //System.out.println("工程系统接口输出channelsArray======="+channelsArray.size()); - ChannelsService channelsService = (ChannelsService) SpringContextUtil.getBean("channelsService"); - String wherestr = ""; - String name = ""; - String parent = ""; - String number = ""; - String status = ""; - Channels channel = null; - for(int i=0;i0){ - channels = json.getString("channels"); - } - } - - String result = "{\"success\":false,\"msg\":\"执行失败\"}"; - if(channels!=null && !channels.equals("")){ - ChannelsService channelsService = (ChannelsService) SpringContextUtil.getBean("channelsService"); - SubscribeDetailService subscribeDetailService = (SubscribeDetailService) SpringContextUtil.getBean("subscribeDetailService"); - Channels channel = channelsService.selectById(channels); - if(channel!=null){ - List subscribeDetailList = - subscribeDetailService.selectListByWhere("where channelsId='"+channel.getId()+"' order by channelsId,id"); - if(subscribeDetailList!=null && subscribeDetailList.size()>0){ - JSONArray arr = new JSONArray(); - for (SubscribeDetail item : subscribeDetailList) { - JSONObject obj = new JSONObject(); - obj.put("name", item.getGoods().getName());//物品名称 - obj.put("model", item.getGoods().getModel());//型号规格 - obj.put("unit", item.getGoods().getUnit());//物品单位 - obj.put("brand", item.getBrand());//品牌 - obj.put("design", item.getDesign());//设计规格 - obj.put("manufacturer", item.getManufacturer());//生产厂家 - obj.put("number", item.getNumber());//数量 - obj.put("totalMoney", item.getTotalMoney());//金额 - obj.put("install", item.getInstall());//是否安装 - obj.put("channels", item.getChannelsid()); //工程编号 - arr.add(obj); - } - result = "{\"success\":true,\"msg\":\"执行成功\",\"data\":"+arr.toJSONString()+"}"; - }else{ - List list = channelsService.selectListByWhere("where pid='"+channels+"' order by id"); - if(list!=null && list.size()>0){ - JSONArray arr = new JSONArray(); - for (Channels channelsItem : list) { - subscribeDetailList = - subscribeDetailService.selectListByWhere("where channelsId='"+channelsItem.getId()+"' order by channelsId,id"); - if(subscribeDetailList!=null && subscribeDetailList.size()>0){ - for (SubscribeDetail item : subscribeDetailList) { - JSONObject obj = new JSONObject(); - obj.put("name", item.getGoods().getName());//物品名称 - obj.put("model", item.getGoods().getModel());//型号规格 - obj.put("unit", item.getGoods().getUnit());//物品单位 - obj.put("brand", item.getBrand());//品牌 - obj.put("design", item.getDesign());//设计规格 - obj.put("manufacturer", item.getManufacturer());//生产厂家 - obj.put("number", item.getNumber());//数量 - obj.put("totalMoney", item.getTotalMoney());//金额 - obj.put("install", item.getInstall());//是否安装 - obj.put("channels", item.getChannelsid()); //工程编号 - arr.add(obj); - } - } - } - result = "{\"success\":true,\"msg\":\"执行成功\",\"data\":"+arr.toJSONString()+"}"; - }else{ - result = "{\"success\":false,\"msg\":\"该项目或工程未查到相关数据\"}"; - } - } - }else{ - result = "{\"success\":false,\"msg\":\"未查到该项目或工程\"}"; - } - }else{ - result = "{\"success\":false,\"msg\":\"执行失败\"}"; - } - response.setContentType("text/html;charset=UTF-8"); - response.setCharacterEncoding("UTF-8"); - PrintWriter pw = response.getWriter(); - pw.print(result); - pw.flush(); - pw.close(); - } - /** - * 合同提交接口 - */ - public void submitContract(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String result = "{\"success\":false,\"msg\":\"接口未完成\"}"; - response.setContentType("text/html;charset=UTF-8"); - response.setCharacterEncoding("UTF-8"); - PrintWriter pw = response.getWriter(); - pw.print(result); - pw.flush(); - pw.close(); - } - /** - * 合同提交接口 - */ - public void getContracts(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String startdate= request.getParameter("startdate"); - String enddate= request.getParameter("enddate"); - String contractid= request.getParameter("contractid"); - - System.out.println("调用合同接口:"+CommUtil.nowDate()); - if(startdate==null || enddate==null){ - //接收json数据 - BufferedReader streamReader = null; - StringBuilder responseStrBuilder = new StringBuilder(); - String inputStr; - try { - streamReader = new BufferedReader( new - InputStreamReader(request.getInputStream(), "UTF-8")); - while ((inputStr = streamReader.readLine()) != null) - responseStrBuilder.append(inputStr); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - System.out.println(e.toString()); - e.printStackTrace(); - throw new RuntimeException(e); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - System.out.println(e.toString()); - throw new RuntimeException(e); - } - //转化成json对象 - //System.out.println("调用合同接口responseStrBuilder:"+responseStrBuilder.toString()); - JSONObject json=JSONObject.parseObject(responseStrBuilder.toString()); - if(json!=null && json.size()>0){ - startdate = json.getString("startdate"); - enddate = json.getString("enddate"); - } - } - //System.out.println("调用合同接口startdate:"+startdate); - //System.out.println("调用合同接口enddate:"+enddate); - String result = "{\"success\":false,\"msg\":\"执行失败\"}"; - String orderstr = " order by contractStartDate desc"; - String wherestr = " where id is not null " - + "and status in ('"+SparePartCommString.STATUS_CONTRACT_EXECUTE+"','"+SparePartCommString.STATUS_CONTRACT_FINISH+"') "; - if (startdate!= null && !startdate.isEmpty()) { - wherestr += " and contractStartDate >='"+startdate+"' "; - }else{ - startdate = CommUtil.nowDate().substring(0, 7)+"-01 00:00"; - wherestr += " and contractStartDate >='"+startdate+"' "; - } - if (enddate!= null && !enddate.isEmpty()) { - wherestr += " and contractStartDate <='"+enddate+"' "; - }else{ - enddate = CommUtil.nowDate().substring(0, 19); - wherestr += " and contractStartDate <='"+enddate+"' "; - } - ContractService contractService = (ContractService) SpringContextUtil.getBean("contractService"); - //System.out.println("sql======="+wherestr+orderstr); - List list = contractService.selectListByWhereforServlet(wherestr+orderstr); - if(list!=null && list.size()>0){ - JSONArray arr = new JSONArray(); - for (Contract contractItem : list) { - if((contractItem.getContractclass().getpClass()!=null - && contractItem.getContractclass().getpClass().getNumber()!=null - && contractItem.getContractclass().getpClass().getNumber().equals("GC")) - || (contractItem.getContractclass().getNumber().equals("GC"))){ - JSONObject obj = new JSONObject(); - JSONArray detailList = new JSONArray(); - obj.put("contractid", contractItem.getContractnumber());//合同编码(唯一) - obj.put("channels", contractItem.getChannelsid());//列资渠道编号 - obj.put("startdate", contractItem.getContractstartdate());//开始时间 - obj.put("enddate", contractItem.getContractenddate());//结束时间 - obj.put("amount", contractItem.getContractamount());//"合同金额 - obj.put("name", contractItem.getContractname());//合同名称 - obj.put("firstparty", contractItem.getFirstparty());//合同甲方 - obj.put("userid", contractItem.getAgent().getName());//经办人(用户登录名) - obj.put("supplyplanstartdate", contractItem.getSupplyplanstartdate());//供货计划开始日期 - obj.put("supplyplanenddate", contractItem.getSupplyplanenddate());//供货计划结束时间 - obj.put("supplyactualstartdate", contractItem.getSupplyactualstartdate());//供货实际开始日期 - obj.put("supplyactualenddate", contractItem.getSupplyactualenddate());//供货实际结束时间 - obj.put("status", "审批通过");//审批状态 - List subscribeDetailList = contractItem.getSubscribeDetailList(); - if(subscribeDetailList!=null && subscribeDetailList.size()>0){ - JSONObject detail = new JSONObject(); - for (SubscribeDetail item : subscribeDetailList) { - detail.put("name", item.getGoods().getName());//物品名称 - detail.put("model", item.getGoods().getModel());//型号规格 - detail.put("unit", item.getGoods().getUnit());//物品单位 - detail.put("brand", item.getBrand());//品牌 - detail.put("design", item.getDesign());//设计规格 - detail.put("manufacturer", item.getManufacturer());//生产厂家 - detail.put("number", item.getNumber());//数量 - detail.put("totalMoney", item.getTotalMoney());//金额 - detail.put("install", item.getInstall());//是否安装 - detail.put("channels", item.getChannelsid()); //工程编号 - detailList.add(detail); - } - } - obj.put("details", detailList); - arr.add(obj); - } - } - if(arr!=null && arr.size()>0){ - result = "{\"success\":true,\"msg\":\"执行成功\",\"data\":"+arr.toJSONString()+"}"; - }else{ - result = "{\"success\":false,\"msg\":\"未查到相关数据\"}"; - } - }else{ - result = "{\"success\":false,\"msg\":\"未查到相关数据\"}"; - } - response.setContentType("text/html;charset=UTF-8"); - response.setCharacterEncoding("UTF-8"); - PrintWriter pw = response.getWriter(); - pw.print(result); - pw.flush(); - pw.close(); - } - public String charSetConvert(String xmlRequest){ - String charSet = getEncoding(xmlRequest); - System.out.println("charSet======="+charSet); - try { - byte[] b = xmlRequest.getBytes(charSet); - xmlRequest = new String(b, charSet); - } catch (Exception e) { - // logger.error("输入的内容不属于常见的编码格式,请再仔细核实", e); - } - return xmlRequest; - - } - public static String getEncoding(String str) { - String encode = "GB2312"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是GB2312 - String s = encode; - return s; // 是的话,返回GB2312,以下代码同理 - } - } catch (Exception e) { - // logger.error("getEncoding异常---GB2312", e); - } - encode = "ISO-8859-1"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是ISO-8859-1 - String s1 = encode; - return s1; - } - } catch (Exception e) { - // logger.error("getEncoding异常---ISO-8859-1", e); - } - encode = "UTF-8"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是UTF-8编码 - String s2 = encode; - return s2; - } - } catch (Exception e) { - // logger.error("getEncoding异常---UTF-8", e); - } - encode = "GBK"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是GBK - String s3 = encode; - return s3; - } - } catch (Exception e) { - // logger.error("getEncoding异常---GBK", e); - } - return ""; // 到这一步,你就应该检查是不是其他编码啦 - } -} diff --git a/src/com/sipai/servlet/wechat/CallBackServlet.java b/src/com/sipai/servlet/wechat/CallBackServlet.java deleted file mode 100644 index 18094d11..00000000 --- a/src/com/sipai/servlet/wechat/CallBackServlet.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.sipai.servlet.wechat; - -import java.io.IOException; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; - -import javax.annotation.Resource; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.http.client.ClientProtocolException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.ui.Model; - -import net.sf.json.JSONObject; - -import com.sipai.controller.base.LoginServlet; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.WeChatAuthUtil; - -public class CallBackServlet extends HttpServlet{ - @Autowired - private LoginServlet loginServlet; - @Override - protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ClientProtocolException, IOException, ServletException{ - //获取微信返回的code,绑定的厂区id - System.out.println("CallBack Enter!"); - String code = request.getParameter("code"); - String state = request.getParameter("state"); - String[] stateArr = state.split(","); - String userId = stateArr[0]; - String companyid = stateArr[1]; - System.out.println(code); - //微信授权第二步,用code获取accesss_token,openid - String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" +WeChatAuthUtil.searchWeChatSources("APPID") - + "&secret=" + WeChatAuthUtil.searchWeChatSources("APPSECRET") - + "&code=" + code - + "&grant_type=authorization_code"; - JSONObject jsonObject = WeChatAuthUtil.doGetJson(url); - String openid = jsonObject.getString("openid"); - String token = jsonObject.getString("access_token"); - //微信授权第三步,用access_token和openid拉取微信用户信息 - String infoUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + token - + "&openid=" + openid - + "&lang=zh_CN"; - JSONObject userInfo = WeChatAuthUtil.doGetJson(infoUrl); - System.out.println("用户数据:"+userInfo); - //用户id和公司id都不存在,判断为登录操作 - if (userId.equals("null") && companyid.equals("null")) { - request.getRequestDispatcher("/user/weChatLogin.do?userInfo="+userInfo).forward(request,response); - - //公司id存在,判断为微信授权注册操作 - }else if(!companyid.equals("null") && companyid !=""){ - request.getRequestDispatcher("/user/saveweChatUser.do?unitId="+companyid+"&userInfo="+userInfo).forward(request,response); - - //用户id存在,判断为注册账户绑定微信操作 - }else if(!userId.equals("null") && userId!=""){ - request.getRequestDispatcher("/user/bindingWeChat.do?userId="+userId+"&userInfo="+userInfo).forward(request,response); - } - - System.out.println("over!"); - } - - - - - - - - - - - -} diff --git a/src/com/sipai/servlet/wechat/WeChatLoginInterface.java b/src/com/sipai/servlet/wechat/WeChatLoginInterface.java deleted file mode 100644 index 0231f530..00000000 --- a/src/com/sipai/servlet/wechat/WeChatLoginInterface.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.sipai.servlet.wechat; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.sipai.tools.WeChatAuthUtil; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -/** - * 运维平台接收微信用户数据接口 - */ -public class WeChatLoginInterface extends HttpServlet { - - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException { - String ip = request.getRemoteHost(); - try { - //PrintWriter out = response.getWriter(); - //接收微信用户数据 - String userData = request.getParameter("JsonData"); - /*JSONArray jsonArray = JSONArray.fromObject(JsonData); - String userData = jsonArray.getString(0);*/ - JSONObject userInfo = JSONObject.fromObject(userData); - //接收用户id和厂区id - String state = userInfo.getString("state"); - String[] stateArr = state.split(","); - String userId = stateArr[0]; - String companyid = stateArr[1]; - System.out.println("微信数据:"+userInfo); - //out.flush(); - //out.close(); - //用户id和公司id都不存在,判断为登录操作 - if (userId.equals("null") && companyid.equals("null")) { - request.getRequestDispatcher("/user/weChatLogin.do?userInfo="+userInfo).forward(request,response); - - //公司id存在,判断为微信授权注册操作 - }else if(!companyid.equals("null") && companyid !=""){ - request.getRequestDispatcher("/user/saveweChatUser.do?unitId="+companyid+"&userInfo="+userInfo).forward(request,response); - - //用户id存在,判断为注册账户绑定微信操作 - }else if(!userId.equals("null") && userId!=""){ - request.getRequestDispatcher("/user/bindingWeChat.do?userId="+userId+"&userInfo="+userInfo).forward(request,response); - } - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException { - this.doPost(request, response); - } -} diff --git a/src/com/sipai/servlet/wechat/WeChatLoginServlet.java b/src/com/sipai/servlet/wechat/WeChatLoginServlet.java deleted file mode 100644 index 00830f5d..00000000 --- a/src/com/sipai/servlet/wechat/WeChatLoginServlet.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.servlet.wechat; - -import java.io.IOException; -import java.net.URLEncoder; - -import javax.servlet.RequestDispatcher; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import com.sipai.entity.user.User; -import com.sipai.tools.CommString; -import com.sipai.tools.WeChatAuthUtil; - -/** - * 微信获取用户信息入口,请求方式只能为get - * @author ls - * - */ -public class WeChatLoginServlet extends HttpServlet{ - @SuppressWarnings("deprecation") - @Override - protected void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException{ - System.out.println("start enter!"); - //获取用户id,厂区id - String id = request.getParameter("id"); - String companyId = request.getParameter("companyid"); - String state = id+","+companyId; - System.out.println(companyId); - //微信授权的回调域名,必须是与微信公众号绑定的域名一致 - String backUrl = WeChatAuthUtil.searchWeChatSources("BackUrl"); - //微信授权第一步,获取code - String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + WeChatAuthUtil.searchWeChatSources("APPID") - + "&redirect_uri=" + URLEncoder.encode(backUrl) - + "&response_type=code" - + "&scope=snsapi_userinfo" - + "&state="+state+"#wechat_redirect"; - try { - //重定向到CallBack中 - System.out.println(url); - response.sendRedirect(url); - return; - } catch(Exception e){ - e.printStackTrace(); - } - } - -} diff --git a/src/com/sipai/tools/ActivitiUtil.java b/src/com/sipai/tools/ActivitiUtil.java deleted file mode 100644 index 23771ca0..00000000 --- a/src/com/sipai/tools/ActivitiUtil.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.sipai.tools; - -import java.awt.Color; -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.net.UnknownHostException; -import java.security.MessageDigest; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.Enumeration; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; -import org.activiti.engine.impl.pvm.process.ActivityImpl; -import org.apache.commons.codec.binary.Base64; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.support.PropertiesBeanDefinitionReader; -import org.springframework.context.support.StaticApplicationContext; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.support.EncodedResource; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; - -import com.sipai.entity.activiti.WorkTask; -import com.sipai.entity.base.BaseConfig; -import com.sipai.entity.base.ServerConfig; -import com.sipai.entity.equipment.EquipmentArrangement; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserPower; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; - - - -/** - * @author wxp - * - */ -public class ActivitiUtil { - - /** - * - * 将acitiviti的类转为worktask类 - * - * */ - public static List activitiImplToWorkTask( List list){ - List json= new ArrayList<>(); - if (list!=null) { - for(int i=0;i fixVariableWithRoute(Map variables,boolean passFlag, String routeNumStr){ - if (variables==null) { - variables= new HashMap<>(); - } - if (routeNumStr==null || routeNumStr.isEmpty()) { - return variables; - } - int routeNum = Integer.valueOf(routeNumStr); - variables.put(CommString.ACTI_KEK_Condition, passFlag); - variables.put(CommString.ACTI_KEK_Condition_Route, routeNum); - return variables; - - } -} - - - - - diff --git a/src/com/sipai/tools/ApplicationContextRegister.java b/src/com/sipai/tools/ApplicationContextRegister.java deleted file mode 100644 index b39d6dc4..00000000 --- a/src/com/sipai/tools/ApplicationContextRegister.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.tools; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -/**Webscoket 使用Service层 公共类 - * @author njp - * - */ -@Component -@Lazy(false) -public class ApplicationContextRegister implements ApplicationContextAware { - private static ApplicationContext APPLICATION_CONTEXT; - - /** - * 设置spring上下文 * * @param applicationContext spring上下文 * @throws BeansException * author:huochengyan https://blog.csdn.net/u010919083 - */ - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - APPLICATION_CONTEXT = applicationContext; - } - - public static ApplicationContext getApplicationContext() { - return APPLICATION_CONTEXT; - } -} diff --git a/src/com/sipai/tools/ArchivesLog.java b/src/com/sipai/tools/ArchivesLog.java deleted file mode 100644 index 79aaaf05..00000000 --- a/src/com/sipai/tools/ArchivesLog.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sipai.tools; - -import java.lang.annotation.*; - - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -@Documented -public @interface ArchivesLog { - - /** - * 操作说明 - */ - public String operteContent() default ""; - -} diff --git a/src/com/sipai/tools/ArchivesLogAspect.java b/src/com/sipai/tools/ArchivesLogAspect.java deleted file mode 100644 index 08238a93..00000000 --- a/src/com/sipai/tools/ArchivesLogAspect.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.sipai.tools; - - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.info.LogInfo; -import com.sipai.entity.user.User; -import com.sipai.service.info.LogInfoService; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.AfterReturning; -import org.aspectj.lang.annotation.AfterThrowing; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Map; - -/** - * 操作日志类 - * - * @author - * - */ - -@Aspect -@Component -public class ArchivesLogAspect { - @Autowired - private LogInfoService loginfoService; - private static final Logger logger = LoggerFactory.getLogger(ArchivesLog.class); - - @Pointcut("@annotation(com.sipai.tools.ArchivesLog)") - public void controllerAspect() { - //System.out.println("切入点..."); - } - - /** - * 方法调用后触发 , 记录正常操作 - * - * @param joinPoint - * @throws ClassNotFoundException - */ - @AfterReturning(value = "controllerAspect()", - returning = "methodResult") - public void after(JoinPoint joinPoint, Object methodResult) throws ClassNotFoundException { - try { - User cu = getUseId(); - // 用户id - String userId = cu.getId(); - // 用户 - String userCaption = cu.getCaption(); - // 用户IP - String ip = getUseIP(); - - JSONObject jsonPort = getUsePort(); - // 用户端口 - String remotePort = jsonPort.get("remotePort").toString(); - // 用户请求方式 - String userMethod = jsonPort.get("method").toString(); - - String param = getParam(); - - LogInfo methodDesc = getMethodDesc(joinPoint); - // 控制器名 - String targetName = methodDesc.getController(); - // 方法名 - String methodName = methodDesc.getMethod(); - String resultStr = methodResult.toString(); - // 操作说明 - String operteContent = methodDesc.getOperateContent(); - LogInfo logInfo = new LogInfo(); - logInfo.setUserId(userId); - logInfo.setIp(ip); - logInfo.setParam(param); - logInfo.setInsdt(CommUtil.nowDate()); - logInfo.setType(LogInfo.TYPE_NOMAL); - logInfo.setOperateContent(operteContent); - logInfo.setMethod(methodName); - logInfo.setController(targetName); - logInfo.setUserCaption(userCaption); - logInfo.setResult(resultStr); - logInfo.setRemotePort(remotePort); - logInfo.setUserMethod(userMethod); - loginfoService.saveAsync(logInfo); - } catch (Exception e1) { - logger.error(e1.getMessage()); - } - } - - /** - * 发生异常,走此方法 - * @param joinPoint - * @param e - */ - @AfterThrowing(pointcut = "controllerAspect()", throwing = "e") - public void AfterThrowing(JoinPoint joinPoint, Throwable e) { - try { - User cu = getUseId(); - // 用户id - String userId = cu.getId(); - // 用户 - String userCaption = cu.getCaption(); - // 用户IP - String ip = getUseIP(); - - JSONObject jsonPort = getUsePort(); - // 用户端口 - String remotePort = jsonPort.get("remotePort").toString(); - // 用户请求方式 - String userMethod = jsonPort.get("method").toString(); - - LogInfo methodDesc = getMethodDesc(joinPoint); - // 控制器名 - String targetName = methodDesc.getController(); - // 方法名 - String methodName = methodDesc.getMethod(); - // 操作说明 - String operteContent = methodDesc.getOperateContent(); - - String param =getParam(); - LogInfo logInfo = new LogInfo(); - String exMsg = e.toString(); - if (exMsg != null) { - logInfo.setUserId(userId); - logInfo.setIp(ip); - logInfo.setOperateContent(operteContent); - logInfo.setInsdt(CommUtil.nowDate()); - logInfo.setMethod(methodName); - logInfo.setController(targetName); - logInfo.setParam(param); - logInfo.setType(LogInfo.TYPE_ERROE); - logInfo.setExMsg(exMsg); - logInfo.setUserCaption(userCaption); - logInfo.setRemotePort(remotePort); - logInfo.setUserMethod(userMethod); - loginfoService.saveAsync(logInfo); - } - } catch (Exception e1) { - logger.error(e1.getMessage()); - } - } - - /** - * 获取 注解中对方法的描述 - * - * @return - * @throws ClassNotFoundException - */ - public static LogInfo getMethodDesc(JoinPoint joinPoint) throws ClassNotFoundException { - // 获取到方法签名 - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - // 请求的controller层路径 - String targetName = joinPoint.getTarget().getClass().getName(); - // 获取到连接点方法对象 - Method method = signature.getMethod(); - // 获取方法上面特定的注解 - ArchivesLog annotation = method.getAnnotation(ArchivesLog.class); - String methodName = joinPoint.getSignature().getName(); - String operteContent = annotation.operteContent(); - - Object[] args = joinPoint.getArgs(); - //参数 - String methodParvalue = Arrays.toString(args); - LogInfo logInfo = new LogInfo(); - logInfo.setController(targetName); - logInfo.setMethod(methodName); - logInfo.setOperateContent(operteContent); - return logInfo; - } - - /** - * 得到用户信息 - * - * @return - */ - public static User getUseId() { - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - User cu = (User) request.getSession().getAttribute("cu"); - return cu; - } - - public static String getUseIP() { - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - String ip = null; - - //X-Forwarded-For:Squid 服务代理 - String ipAddresses = request.getHeader("X-Forwarded-For"); - - if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { - //Proxy-Client-IP:apache 服务代理 - ipAddresses = request.getHeader("Proxy-Client-IP"); - } - - if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { - //WL-Proxy-Client-IP:weblogic 服务代理 - ipAddresses = request.getHeader("WL-Proxy-Client-IP"); - } - - if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { - //HTTP_CLIENT_IP:有些代理服务器 - ipAddresses = request.getHeader("HTTP_CLIENT_IP"); - } - - if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { - //X-Real-IP:nginx服务代理 - ipAddresses = request.getHeader("X-Real-IP"); - } - - //有些网络通过多层代理,那么获取到的ip就会有多个,一般都是通过逗号(,)分割开来,并且第一个ip为客户端的真实IP - if (ipAddresses != null && ipAddresses.length() != 0) { - ip = ipAddresses.split(",")[0]; - } - - //还是不能获取到,最后再通过request.getRemoteAddr();获取 - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) { - ip = request.getRemoteAddr(); - } - return ip; - } - public static JSONObject getUsePort() { - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - //客户机所使用的网络端口号。 - String remotePort = String.valueOf(request.getRemotePort()); - //请求方式 - String method = request.getMethod(); - JSONObject json = new JSONObject(); - json.put("remotePort",remotePort); - json.put("method",method); - return json; - } - public static String getParam() { - HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - - Map params = req.getParameterMap(); - return JSONObject.toJSONString(params); - } - -} diff --git a/src/com/sipai/tools/AudioUtils.java b/src/com/sipai/tools/AudioUtils.java deleted file mode 100644 index 149f85b6..00000000 --- a/src/com/sipai/tools/AudioUtils.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.sipai.tools; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; - -import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.SourceDataLine; - -import javazoom.spi.mpeg.sampled.file.MpegAudioFileReader; - -/** - * 创建日期:2018年1月14日 - * 创建时间:下午10:09:39 - * 创建者 :yellowcong - * 机能概要:MP3转PCM Java方式实现 - * http://ai.baidu.com/forum/topic/show/496972 - */ -public class AudioUtils { - private static AudioUtils audioUtils = null; - private AudioUtils(){} - - //双判断,解决单利问题 - public static AudioUtils getInstance(){ - if(audioUtils == null){ - synchronized (AudioUtils.class) { - if(audioUtils == null){ - audioUtils = new AudioUtils(); - } - } - } - return audioUtils; - } - - /** - * MP3转换PCM文件方法 - * - * @param mp3filepath 原始文件路径 - * @param pcmfilepath 转换文件的保存路径 - * @return - * @throws Exception - */ - public boolean convertMP32Pcm(String mp3filepath, String pcmfilepath){ - try { - //获取文件的音频流,pcm的格式 - AudioInputStream audioInputStream = getPcmAudioInputStream(mp3filepath); - //将音频转化为 pcm的格式保存下来 - AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, new File(pcmfilepath)); - return true; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return false; - } - } - - /** - * 播放MP3方法 - * - * @param mp3filepath - * @throws Exception - */ - public void playMP3(String mp3filepath) throws Exception { - //获取音频为pcm的格式 - AudioInputStream audioInputStream = getPcmAudioInputStream(mp3filepath); - - // 播放 - if (audioInputStream == null){ - System.out.println("null audiostream"); - return; - } - //获取音频的格式 - AudioFormat targetFormat = audioInputStream.getFormat(); - DataLine.Info dinfo = new DataLine.Info(SourceDataLine.class, targetFormat, AudioSystem.NOT_SPECIFIED); - //输出设备 - SourceDataLine line = null; - try { - line = (SourceDataLine) AudioSystem.getLine(dinfo); - line.open(targetFormat); - line.start(); - - int len = -1; -// byte[] buffer = new byte[8192]; - byte[] buffer = new byte[1024]; - //读取音频文件 - while ((len = audioInputStream.read(buffer)) > 0) { - //输出音频文件 - line.write(buffer, 0, len); - } - - // Block等待临时数据被输出为空 - line.drain(); - - //关闭读取流 - audioInputStream.close(); - - //停止播放 - line.stop(); - line.close(); - - } catch (Exception ex) { - ex.printStackTrace(); - System.out.println("audio problem " + ex); - - } - } - - /** - * 创建日期:2018年1月14日
- * 创建时间:下午9:53:14
- * 创建用户:yellowcong
- * 机能概要:获取文件的音频流 - * @param mp3filepath - * @return - */ - private AudioInputStream getPcmAudioInputStream(String mp3filepath) { - File mp3 = new File(mp3filepath); - AudioInputStream audioInputStream = null; - AudioFormat targetFormat = null; - try { - AudioInputStream in = null; - - //读取音频文件的类 - MpegAudioFileReader mp = new MpegAudioFileReader(); - in = mp.getAudioInputStream(mp3); - AudioFormat baseFormat = in.getFormat(); - - //设定输出格式为pcm格式的音频文件 - targetFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, baseFormat.getSampleRate(), 16, - baseFormat.getChannels(), baseFormat.getChannels() * 2, baseFormat.getSampleRate(), false); - - //输出到音频 - audioInputStream = AudioSystem.getAudioInputStream(targetFormat, in); - } catch (Exception e) { - e.printStackTrace(); - } - return audioInputStream; - } -} \ No newline at end of file diff --git a/src/com/sipai/tools/BaiDuAipSpeech.java b/src/com/sipai/tools/BaiDuAipSpeech.java deleted file mode 100644 index b2bf4288..00000000 --- a/src/com/sipai/tools/BaiDuAipSpeech.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.sipai.tools; - -import javax.servlet.http.HttpServletRequest; - -import org.json.JSONObject; - -import com.baidu.aip.speech.AipSpeech; - -public class BaiDuAipSpeech { - //设置APPID/AK/SK - public static final String APP_ID = "25115875"; - public static final String API_KEY = "8Fo1s21IRg4OZ8mY9DhPPRvV"; - public static final String SECRET_KEY = "o8lADvb2p0hMNuXQ0ziWdKFzy6HoMeG8"; - - public static void main(String[] args) { - // 初始化一个AipSpeech - AipSpeech client = new AipSpeech(APP_ID, API_KEY, SECRET_KEY); - - // 可选:设置网络连接参数 - client.setConnectionTimeoutInMillis(2000); - client.setSocketTimeoutInMillis(60000); - - // 可选:设置代理服务器地址, http和socket二选一,或者均不设置 -// client.setHttpProxy("proxy_host", proxy_port); // 设置http代理 -// client.setSocketProxy("proxy_host", proxy_port); // 设置socket代理 - - // 可选:设置log4j日志输出格式,若不设置,则使用默认配置 - // 也可以直接通过jvm启动参数设置此环境变量 -// System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties"); - - // 调用接口 - JSONObject res = client.asr("D:\\audio\\recorder.m4a", "m4a", 16000, null); - System.out.println(res.toString(2)); - - } - -} \ No newline at end of file diff --git a/src/com/sipai/tools/BaiduConst.java b/src/com/sipai/tools/BaiduConst.java deleted file mode 100644 index 3fb8d5bd..00000000 --- a/src/com/sipai/tools/BaiduConst.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.sipai.tools; - -public class BaiduConst { - /* 下面2个是鉴权信息 ,具体参数在sendStartFrame() 方法内 */ - public static final int APPID = 25115875; - public static final String APPKEY = "8Fo1s21IRg4OZ8mY9DhPPRvV"; - /* dev_pid 是语言模型 , 可以修改为其它语言模型测试,如远场普通话 19362*/ - public static final int DEV_PID = 15372; - /* 可以改为wss:// */ - public static final String URI = "ws://vop.baidu.com/realtime_asr"; -} diff --git a/src/com/sipai/tools/BaiduUtil.java b/src/com/sipai/tools/BaiduUtil.java deleted file mode 100644 index e7a396cc..00000000 --- a/src/com/sipai/tools/BaiduUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.tools; - - -public class BaiduUtil { - public static final int BYTES_PER_MS = 16000 * 2 / 1000; // 16000的采样率,16bits=2bytes, 1000ms - public static final int FRAME_MS = 160; // websocket一个数据帧 160ms - public static final int BYTES_PER_FRAME = BYTES_PER_MS * FRAME_MS; // 一个数据帧的大小=5120bytes - - /** - * 毫秒转为字节数 - * - * @param durationMs 毫秒 - * @return 字节数 - */ - public static long timeToBytes(long durationMs) { - return durationMs * BYTES_PER_MS; - } - - /** - * 字节数转为毫秒 - * - * @param size 字节数 - * @return 毫秒 - */ - public static int bytesToTime(int size) { - return size / BYTES_PER_MS; - } - - /** - * sleep, 转为RuntimeException - * - * @param millis 毫秒 - */ - public static void sleep(long millis) { - if (millis <= 0) { - return; - } - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - } -} diff --git a/src/com/sipai/tools/CameraCall.java b/src/com/sipai/tools/CameraCall.java deleted file mode 100644 index a7e7394a..00000000 --- a/src/com/sipai/tools/CameraCall.java +++ /dev/null @@ -1,1104 +0,0 @@ -package com.sipai.tools; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.swing.JOptionPane; - -import org.h2.value.Value; -import org.slf4j.LoggerFactory; - -import com.sipai.tools.HCNetSDK2.FColGlobalDataCallBack; -import com.sipai.tools.HCNetSDK2.FMSGCallBack; -import com.sipai.tools.HCNetSDK2.FMSGCallBack_V31; -import com.sipai.tools.HCNetSDK2.NET_DVR_IPPARACFG; -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.IntByReference; - -public class CameraCall { - private static HCNetSDK2 hcNetSDK = HCNetSDK2.INSTANCE; - private static org.slf4j.Logger logger = LoggerFactory.getLogger(CameraCall.class); - HCNetSDK2.NET_DVR_USER_LOGIN_INFO m_strLoginINFO = new HCNetSDK2.NET_DVR_USER_LOGIN_INFO(); - //HCNetSDK2.NET_DVR_DEVICEINFO_V40 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V40(); - static HCNetSDK2.NET_DVR_DEVICEINFO_V30 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V30(); - static HCNetSDK2.NET_DVR_WORKSTATE_V30 m_strWorkState = new HCNetSDK2.NET_DVR_WORKSTATE_V30(); - FMSGCallBack fMSFCallBack; - FColGlobalDataCallBack fGpsCallBack; - FMSGCallBack_V31 fMSFCallBack_V31; - private static HashMap lUserMap = new HashMap(); - - public static int getUserId(String ip,String username,String pwd){ - int cameraUserid = -1; - if(!hcNetSDK.NET_DVR_Init()){ - System.out.println("SDK初始化失败"); - return -2; - } - /*System.out.println("SDK初始化成功");*/ - - cameraUserid = hcNetSDK.NET_DVR_Login_V30(ip, (short)8000, username, pwd, m_strDeviceInfo); - if (cameraUserid<0){ - System.out.println("Login failed, error code="+hcNetSDK.NET_DVR_GetLastError()); - } - hcNetSDK.NET_DVR_SetConnectTime(2000,1); - hcNetSDK.NET_DVR_SetReconnect(10000,true); - System.out.println("注册成功"); - - return cameraUserid; - } - - public static boolean getPic(int cameraUserid,String fileName,String picName,int channel){ - //图片质量 - HCNetSDK2.NET_DVR_JPEGPARA jpeg = new HCNetSDK2.NET_DVR_JPEGPARA(); - //设置图片分辨率 - jpeg.wPicSize=2; - //设置图片质量 - jpeg.wPicQuality=2; - IntByReference a = new IntByReference(); - //设置图片大小 - ByteBuffer jpegBuffer = ByteBuffer.allocate(1024 * 1024); - File file = new File(fileName+"\\"+picName+".jpg"); - System.out.println(fileName+"\\"+picName+".jpg"); - /*boolean is = hcNetSDK.NET_DVR_CaptureJPEGPicture_NEW(cameraUserid, 1, jpeg, - jpegBuffer, 200 * 1024, a);*/ - - boolean is = hcNetSDK.NET_DVR_CaptureJPEGPicture(cameraUserid, channel, jpeg,fileName+"\\"+picName+".jpg"); - if(is){ - System.out.println("hksdk(抓图)-结果状态值(0表示成功):"+hcNetSDK.NET_DVR_GetLastError()); - logger.info("hksdk(抓图)-结果状态值(0表示成功):"+hcNetSDK.NET_DVR_GetLastError()); - //存储到本地 - /*BufferedOutputStream outputStream = null; - try { - outputStream = new BufferedOutputStream(new FileOutputStream(file)); - outputStream.write(jpegBuffer.array(),0,a.getValue()); - outputStream.flush(); - } catch (Exception e) { - // TODO: handle exception - }finally{ - if(outputStream!=null) { - try { - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }*/ - }else{ - System.out.println("hksdk(抓图)-结果状态值(0表示成功):"+hcNetSDK.NET_DVR_GetLastError()); - } - return is; - } - - public static boolean getPicByChannel(int cameraUserid,String fileName,String picName,int channel){ - //图片质量 - HCNetSDK2.NET_DVR_JPEGPARA jpeg = new HCNetSDK2.NET_DVR_JPEGPARA(); - //设置图片分辨率 - jpeg.wPicSize=2; - //设置图片质量 - jpeg.wPicQuality=2; - IntByReference a = new IntByReference(); - //设置图片大小 - ByteBuffer jpegBuffer = ByteBuffer.allocate(1024 * 1024); - File file = new File(fileName+"\\"+picName+".jpg"); - /*boolean is = hcNetSDK.NET_DVR_CaptureJPEGPicture_NEW(cameraUserid, 1, jpeg, - jpegBuffer, 200 * 1024, a);*/ - boolean is = hcNetSDK.NET_DVR_CaptureJPEGPicture(cameraUserid, channel, jpeg,fileName+"\\"+picName+".jpg"); - if(is){ - System.out.println("hksdk(抓图)-结果状态值(0表示成功):"+hcNetSDK.NET_DVR_GetLastError()); - logger.info("hksdk(抓图)-结果状态值(0表示成功):"+hcNetSDK.NET_DVR_GetLastError()); - //存储到本地 - /*BufferedOutputStream outputStream = null; - try { - outputStream = new BufferedOutputStream(new FileOutputStream(file)); - outputStream.write(jpegBuffer.array(),0,a.getValue()); - outputStream.flush(); - } catch (Exception e) { - // TODO: handle exception - }finally{ - if(outputStream!=null) { - try { - outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }*/ - } - return is; - } - - //获取通道号 -// public int getChannelNumber(){ -// IntByReference ibrBytesReturned = new IntByReference(); -// boolean bRet = false; -// int iChannelNum = -1; -// -// m_strIpparaCfg = new HCNetSDK2.NET_DVR_IPPARACFG(); -// m_strIpparaCfg.write(); -// -// -// -// return iChannelNum; -// } - - //退出登录 - public static void logout(String id,int lUserid){ - if(!hcNetSDK.NET_DVR_CloseAlarmChan_V30(lUserMap.get(id))){ - hcNetSDK.NET_DVR_Logout(lUserid); - }; - } - - //启动布防 - public static void startBuFang(String id,int lUserid){ - //设置报警回调函数 - FMSGCallBack_V31 fmsgCallBack_v31=new FMSGCallBack_V31(lUserid); - boolean b = hcNetSDK.NET_DVR_SetDVRMessageCallBack_V31(fmsgCallBack_v31, null); - //如果设置报警回调失败,获取错误码 - if (!b){ - System.out.println("SetDVRMessageCallBack failed, error code=" - +hcNetSDK.NET_DVR_GetLastError()); - } - //建立报警上传通道(布防) - //布防参数 - HCNetSDK2.NET_DVR_SETUPALARM_PARAM net_dvr_setupalarm_param=new HCNetSDK2.NET_DVR_SETUPALARM_PARAM(); - int nativeLong = hcNetSDK.NET_DVR_SetupAlarmChan_V41(lUserid, net_dvr_setupalarm_param); - //如果布防失败返回-1 - System.out.println("---nativeLong--"+nativeLong); - if (nativeLong<0){ - System.out.println("SetupAlarmChan failed, error code="+hcNetSDK.NET_DVR_GetLastError()); - } - lUserMap.put(id, nativeLong); - try { - //等待设备上传报警信息 - Thread.sleep(60000*60*24*365*10); - } catch (InterruptedException e) { - e.printStackTrace(); - } - //撤销布防上传通道 - if(!hcNetSDK.NET_DVR_CloseAlarmChan_V30(nativeLong)){ - //注销 - //hcNetSDK.NET_DVR_Logout(lUserid); - } - } - - public static class FMSGCallBack_V31 implements HCNetSDK2.FMSGCallBack_V31{ - private int lUserid; - public FMSGCallBack_V31(int lUserid){ - this.lUserid = lUserid; - } - //lCommand 上传消息类型 pAlarmer 报警设备信息 pAlarmInfo 报警信息 dwBufLen 报警信息缓存大小 pUser 用户数据 - public boolean invoke(int lCommand, HCNetSDK2.NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser) { - try { - //报警类型 - String sAlarmType = new String(); - //报警时间 - Date today = new Date(); - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - String format = dateFormat.format(today); - String[] sIP = new String[2]; - - sAlarmType = new String("lCommand=") + lCommand; - //lCommand是传的报警类型 - switch (lCommand) - { - case HCNetSDK2.COMM_ALARM_V40: - HCNetSDK2.NET_DVR_ALARMINFO_V40 struAlarmInfoV40 = new HCNetSDK2.NET_DVR_ALARMINFO_V40(); - struAlarmInfoV40.write(); - Pointer pInfoV40 = struAlarmInfoV40.getPointer(); - pInfoV40.write(0, pAlarmInfo.getByteArray(0, struAlarmInfoV40.size()), 0, struAlarmInfoV40.size()); - struAlarmInfoV40.read(); - System.out.println("-----"+struAlarmInfoV40.struAlarmFixedHeader.dwAlarmType); - switch (struAlarmInfoV40.struAlarmFixedHeader.dwAlarmType) - { - case 0: - struAlarmInfoV40.struAlarmFixedHeader.ustruAlarm.setType(HCNetSDK2.struIOAlarm.class); - struAlarmInfoV40.read(); - sAlarmType = sAlarmType + new String(":信号量报警") + ","+ "报警输入口:" + struAlarmInfoV40.struAlarmFixedHeader.ustruAlarm.struioAlarm.dwAlarmInputNo; - break; - case 1: - sAlarmType = sAlarmType + new String(":硬盘满"); - break; - case 2: - sAlarmType = sAlarmType + new String(":信号丢失"); - break; - case 3: - struAlarmInfoV40.struAlarmFixedHeader.ustruAlarm.setType(HCNetSDK2.struAlarmChannel.class); - struAlarmInfoV40.read(); - int iChanNum = struAlarmInfoV40.struAlarmFixedHeader.ustruAlarm.sstrualarmChannel.dwAlarmChanNum; - sAlarmType = sAlarmType + new String(":移动侦测") + ","+ "报警通道个数:" + iChanNum + ","+ "报警通道号:"; - - for (int i=0; i0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - fout = new FileOutputStream(".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() - + "wEventTypeEx[" + strVcaAlarm.struRuleInfo.wEventTypeEx + "]_"+ newName +"_vca.jpg"); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strVcaAlarm.pImage.getByteBuffer(offset, strVcaAlarm.dwPicDataLen); - byte [] bytes = new byte[strVcaAlarm.dwPicDataLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - }catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - break; - case HCNetSDK2.COMM_UPLOAD_PLATE_RESULT://交通抓拍结果上传 - HCNetSDK2.NET_DVR_PLATE_RESULT strPlateResult = new HCNetSDK2.NET_DVR_PLATE_RESULT(); - strPlateResult.write(); - Pointer pPlateInfo = strPlateResult.getPointer(); - pPlateInfo.write(0, pAlarmInfo.getByteArray(0, strPlateResult.size()), 0, strPlateResult.size()); - strPlateResult.read(); - try { - String srt3=new String(strPlateResult.struPlateInfo.sLicense,"GBK"); - sAlarmType = sAlarmType + ":交通抓拍上传,车牌:"+ srt3; - } - catch (UnsupportedEncodingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - //报警设备IP地址 - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - - if(strPlateResult.dwPicLen>0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - fout = new FileOutputStream(".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() + "_" - + newName+"_plateResult.jpg"); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strPlateResult.pBuffer1.getByteBuffer(offset, strPlateResult.dwPicLen); - byte [] bytes = new byte[strPlateResult.dwPicLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - break; - case HCNetSDK2.COMM_ITS_PLATE_RESULT://交通抓拍的终端图片上传 - HCNetSDK2.NET_ITS_PLATE_RESULT strItsPlateResult = new HCNetSDK2.NET_ITS_PLATE_RESULT(); - strItsPlateResult.write(); - Pointer pItsPlateInfo = strItsPlateResult.getPointer(); - pItsPlateInfo.write(0, pAlarmInfo.getByteArray(0, strItsPlateResult.size()), 0, strItsPlateResult.size()); - strItsPlateResult.read(); - try { - String srt3=new String(strItsPlateResult.struPlateInfo.sLicense,"GBK"); - sAlarmType = sAlarmType + ",车辆类型:"+strItsPlateResult.byVehicleType + ",交通抓拍上传,车牌:"+ srt3; - } - catch (UnsupportedEncodingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - //报警设备IP地址 - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - - for(int i=0;i0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = ".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() + "_" - + newName+"_type["+strItsPlateResult.struPicInfo[i].byType+"]_ItsPlate.jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strItsPlateResult.struPicInfo[i].pBuffer.getByteBuffer(offset, strItsPlateResult.struPicInfo[i].dwDataLen); - byte [] bytes = new byte[strItsPlateResult.struPicInfo[i].dwDataLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - break; - case HCNetSDK2.COMM_ALARM_PDC://客流量统计报警上传 - HCNetSDK2.NET_DVR_PDC_ALRAM_INFO strPDCResult = new HCNetSDK2.NET_DVR_PDC_ALRAM_INFO(); - strPDCResult.write(); - Pointer pPDCInfo = strPDCResult.getPointer(); - pPDCInfo.write(0, pAlarmInfo.getByteArray(0, strPDCResult.size()), 0, strPDCResult.size()); - strPDCResult.read(); - System.out.println("--33--"+strPDCResult.byMode); - if(strPDCResult.byMode == 0) - { - strPDCResult.uStatModeParam.setType(HCNetSDK2.NET_DVR_STATFRAME.class); - sAlarmType = sAlarmType + ":客流量统计,进入人数:"+ strPDCResult.dwEnterNum + ",离开人数:" + strPDCResult.dwLeaveNum + - ", byMode:" + strPDCResult.byMode + ", dwRelativeTime:" + strPDCResult.uStatModeParam.struStatFrame.dwRelativeTime + - ", dwAbsTime:" + strPDCResult.uStatModeParam.struStatFrame.dwAbsTime; - } - if(strPDCResult.byMode == 1) - { - strPDCResult.uStatModeParam.setType(HCNetSDK2.NET_DVR_STATTIME.class); - String strtmStart = "" + String.format("%04d", strPDCResult.uStatModeParam.struStatTime.tmStart.dwYear) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmStart.dwMonth) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmStart.dwDay) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmStart.dwHour) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmStart.dwMinute) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmStart.dwSecond); - String strtmEnd = "" + String.format("%04d", strPDCResult.uStatModeParam.struStatTime.tmEnd.dwYear) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmEnd.dwMonth) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmEnd.dwDay) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmEnd.dwHour) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmEnd.dwMinute) + - String.format("%02d", strPDCResult.uStatModeParam.struStatTime.tmEnd.dwSecond); - sAlarmType = sAlarmType + ":客流量统计,进入人数:"+ strPDCResult.dwEnterNum + ",离开人数:" + strPDCResult.dwLeaveNum + - ", byMode:" + strPDCResult.byMode + ", tmStart:" + strtmStart + ",tmEnd :" + strtmEnd; - } - - //报警设备IP地址 - sIP = new String(strPDCResult.struDevInfo.struDevIP.sIpV4).split("\0", 2); - break; - - case HCNetSDK2.COMM_ITS_PARK_VEHICLE://停车场数据上传 - HCNetSDK2.NET_ITS_PARK_VEHICLE strItsParkVehicle = new HCNetSDK2.NET_ITS_PARK_VEHICLE(); - strItsParkVehicle.write(); - Pointer pItsParkVehicle = strItsParkVehicle.getPointer(); - pItsParkVehicle.write(0, pAlarmInfo.getByteArray(0, strItsParkVehicle.size()), 0, strItsParkVehicle.size()); - strItsParkVehicle.read(); - try { - String srtParkingNo=new String(strItsParkVehicle.byParkingNo).trim(); //车位编号 - String srtPlate=new String(strItsParkVehicle.struPlateInfo.sLicense,"GBK").trim(); //车牌号码 - sAlarmType = sAlarmType + ",停产场数据,车位编号:"+ srtParkingNo + ",车位状态:" - + strItsParkVehicle.byLocationStatus+ ",车牌:"+ srtPlate; - } - catch (UnsupportedEncodingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - //报警设备IP地址 - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - - for(int i=0;i0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = ".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() + "_" - + newName+"_type["+strItsParkVehicle.struPicInfo[i].byType+"]_ParkVehicle.jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strItsParkVehicle.struPicInfo[i].pBuffer.getByteBuffer(offset, strItsParkVehicle.struPicInfo[i].dwDataLen); - byte [] bytes = new byte[strItsParkVehicle.struPicInfo[i].dwDataLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - break; - case HCNetSDK2.COMM_ALARM_TFS: //交通取证报警信息 - HCNetSDK2.NET_DVR_TFS_ALARM strTFSAlarmInfo = new HCNetSDK2.NET_DVR_TFS_ALARM(); - strTFSAlarmInfo.write(); - Pointer pTFSInfo = strTFSAlarmInfo.getPointer(); - pTFSInfo.write(0, pAlarmInfo.getByteArray(0, strTFSAlarmInfo.size()), 0, strTFSAlarmInfo.size()); - strTFSAlarmInfo.read(); - - try { - String srtPlate=new String(strTFSAlarmInfo.struPlateInfo.sLicense,"GBK").trim(); //车牌号码 - sAlarmType = sAlarmType + ":交通取证报警信息,违章类型:"+ strTFSAlarmInfo.dwIllegalType + ",车牌号码:" + srtPlate - + ",车辆出入状态:" + strTFSAlarmInfo.struAIDInfo.byVehicleEnterState; - } - catch (UnsupportedEncodingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - //报警设备IP地址 - sIP = new String(strTFSAlarmInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2); - break; - case HCNetSDK2.COMM_ALARM_AID_V41://交通事件报警信息扩展 - HCNetSDK2.NET_DVR_AID_ALARM_V41 struAIDAlarmInfo = new HCNetSDK2.NET_DVR_AID_ALARM_V41(); - struAIDAlarmInfo.write(); - Pointer pAIDInfo = struAIDAlarmInfo.getPointer(); - pAIDInfo.write(0, pAlarmInfo.getByteArray(0, struAIDAlarmInfo.size()), 0, struAIDAlarmInfo.size()); - struAIDAlarmInfo.read(); - sAlarmType = sAlarmType + ":交通事件报警信息,交通事件类型:"+ struAIDAlarmInfo.struAIDInfo.dwAIDType + ",规则ID:" - + struAIDAlarmInfo.struAIDInfo.byRuleID + ",车辆出入状态:" + struAIDAlarmInfo.struAIDInfo.byVehicleEnterState; - - //报警设备IP地址 - sIP = new String(struAIDAlarmInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2); - break; - case HCNetSDK2.COMM_ALARM_TPS_V41://交通事件报警信息扩展 - HCNetSDK2.NET_DVR_TPS_ALARM_V41 struTPSAlarmInfo = new HCNetSDK2.NET_DVR_TPS_ALARM_V41(); - struTPSAlarmInfo.write(); - Pointer pTPSInfo = struTPSAlarmInfo.getPointer(); - pTPSInfo.write(0, pAlarmInfo.getByteArray(0, struTPSAlarmInfo.size()), 0, struTPSAlarmInfo.size()); - struTPSAlarmInfo.read(); - - sAlarmType = sAlarmType + ":交通统计报警信息,绝对时标:"+ struTPSAlarmInfo.dwAbsTime - + ",能见度:" + struTPSAlarmInfo.struDevInfo.byIvmsChannel - + ",车道1交通状态:" + struTPSAlarmInfo.struTPSInfo.struLaneParam[0].byTrafficState - + ",监测点编号:" + new String(struTPSAlarmInfo.byMonitoringSiteID).trim() - + ",设备编号:" + new String(struTPSAlarmInfo.byDeviceID ).trim() - + ",开始统计时间:" + struTPSAlarmInfo.dwStartTime - + ",结束统计时间:" + struTPSAlarmInfo.dwStopTime; - - //报警设备IP地址 - sIP = new String(struTPSAlarmInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2); - break; - case HCNetSDK2.COMM_UPLOAD_FACESNAP_RESULT: //人脸识别结果上传 - System.out.println("开始人脸抓拍:"+HCNetSDK2.COMM_UPLOAD_FACESNAP_RESULT); - //实时人脸抓拍上传 - HCNetSDK2.NET_VCA_FACESNAP_RESULT strFaceSnapInfo = new HCNetSDK2.NET_VCA_FACESNAP_RESULT(); - strFaceSnapInfo.write(); - Pointer pFaceSnapInfo = strFaceSnapInfo.getPointer(); - System.out.println("pFaceSnapInfo:::"+pFaceSnapInfo+"\n"); - System.out.println("strFaceSnapInfo"+strFaceSnapInfo+"\n"); - pFaceSnapInfo.write(0, pAlarmInfo.getByteArray(0, strFaceSnapInfo.size()), 0, strFaceSnapInfo.size()); - strFaceSnapInfo.read(); - sAlarmType = sAlarmType + ":人脸抓拍上传,人脸评分:" + strFaceSnapInfo.dwFaceScore + ",年龄段:" + strFaceSnapInfo.struFeature.byAgeGroup + ",性别:" + strFaceSnapInfo.struFeature.bySex; - - System.out.println(""+sAlarmType+""); - //报警设备IP地址 - sIP = new String(strFaceSnapInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2); - System.out.println(sIP); - SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); //设置日期格式 - String time = df.format(new Date()); // new Date()为获取当前系统时间 - //人脸图片写文件 - try { - FileOutputStream small = new FileOutputStream(System.getProperty("user.dir") + "\\pic\\" + time + "small.jpg"); - FileOutputStream big = new FileOutputStream(System.getProperty("user.dir") + "\\pic\\" + time + "big.jpg"); - - if(strFaceSnapInfo.dwFacePicLen > 0) - { - try { - small.write(strFaceSnapInfo.pBuffer1.getByteArray(0, strFaceSnapInfo.dwFacePicLen), 0, strFaceSnapInfo.dwFacePicLen); - small.close(); - } catch (IOException ex) { - Logger.getLogger(CameraCall.class.getName()).log(Level.SEVERE, null, ex); - } - - } - if(strFaceSnapInfo.dwFacePicLen > 0) - { - try { - big.write(strFaceSnapInfo.pBuffer2.getByteArray(0, strFaceSnapInfo.dwBackgroundPicLen), 0, strFaceSnapInfo.dwBackgroundPicLen); - big.close(); - } catch (IOException ex) { - Logger.getLogger(CameraCall.class.getName()).log(Level.SEVERE, null, ex); - } - } - } catch (FileNotFoundException ex) { - Logger.getLogger(CameraCall.class.getName()).log(Level.SEVERE, null, ex); - } - break; - case HCNetSDK2.COMM_SNAP_MATCH_ALARM: //黑名单比对结果上传 - //人脸黑名单比对报警 - HCNetSDK2.NET_VCA_FACESNAP_MATCH_ALARM strFaceSnapMatch = new HCNetSDK2.NET_VCA_FACESNAP_MATCH_ALARM(); - strFaceSnapMatch.write(); - Pointer pFaceSnapMatch = strFaceSnapMatch.getPointer(); - pFaceSnapMatch.write(0, pAlarmInfo.getByteArray(0, strFaceSnapMatch.size()), 0, strFaceSnapMatch.size()); - strFaceSnapMatch.read(); - - if ((strFaceSnapMatch.dwSnapPicLen > 0) && (strFaceSnapMatch.byPicTransType == 0)) { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = System.getProperty("user.dir") + "\\pic\\" + newName + "_pSnapPicBuffer" + ".jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strFaceSnapMatch.pSnapPicBuffer.getByteBuffer(offset, strFaceSnapMatch.dwSnapPicLen); - byte[] bytes = new byte[strFaceSnapMatch.dwSnapPicLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if ((strFaceSnapMatch.struSnapInfo.dwSnapFacePicLen > 0) && (strFaceSnapMatch.byPicTransType == 0)) { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = System.getProperty("user.dir") + "\\pic\\" + newName + "_struSnapInfo_pBuffer1" + ".jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strFaceSnapMatch.struSnapInfo.pBuffer1.getByteBuffer(offset, strFaceSnapMatch.struSnapInfo.dwSnapFacePicLen); - byte[] bytes = new byte[strFaceSnapMatch.struSnapInfo.dwSnapFacePicLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if ((strFaceSnapMatch.struBlackListInfo.dwBlackListPicLen > 0) && (strFaceSnapMatch.byPicTransType == 0)) { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = System.getProperty("user.dir") + "\\pic\\" + newName + "_fSimilarity_" + strFaceSnapMatch.fSimilarity + "_struBlackListInfo_pBuffer1" + ".jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strFaceSnapMatch.struBlackListInfo.pBuffer1.getByteBuffer(offset, strFaceSnapMatch.struBlackListInfo.dwBlackListPicLen); - byte[] bytes = new byte[strFaceSnapMatch.struBlackListInfo.dwBlackListPicLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - sAlarmType = sAlarmType + ":人脸黑名单比对报警,相识度:" + strFaceSnapMatch.fSimilarity + ",黑名单姓名:" + new String(strFaceSnapMatch.struBlackListInfo.struBlackListInfo.struAttribute.byName, "GBK").trim() + ",\n黑名单证件信息:" + new String(strFaceSnapMatch.struBlackListInfo.struBlackListInfo.struAttribute.byCertificateNumber).trim(); - - //获取人脸库ID - byte[] FDIDbytes; - if ((strFaceSnapMatch.struBlackListInfo.dwFDIDLen > 0) && (strFaceSnapMatch.struBlackListInfo.pFDID != null)) { - ByteBuffer FDIDbuffers = strFaceSnapMatch.struBlackListInfo.pFDID.getByteBuffer(0, strFaceSnapMatch.struBlackListInfo.dwFDIDLen); - FDIDbytes = new byte[strFaceSnapMatch.struBlackListInfo.dwFDIDLen]; - FDIDbuffers.rewind(); - FDIDbuffers.get(FDIDbytes); - sAlarmType = sAlarmType + ",人脸库ID:" + new String(FDIDbytes).trim(); - } - //获取人脸图片ID - byte[] PIDbytes; - if ((strFaceSnapMatch.struBlackListInfo.dwPIDLen > 0) && (strFaceSnapMatch.struBlackListInfo.pPID != null)) { - ByteBuffer PIDbuffers = strFaceSnapMatch.struBlackListInfo.pPID.getByteBuffer(0, strFaceSnapMatch.struBlackListInfo.dwPIDLen); - PIDbytes = new byte[strFaceSnapMatch.struBlackListInfo.dwPIDLen]; - PIDbuffers.rewind(); - PIDbuffers.get(PIDbytes); - sAlarmType = sAlarmType + ",人脸图片ID:" + new String(PIDbytes).trim(); - } - //报警设备IP地址 - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - break; - case HCNetSDK2.COMM_ALARM_ACS: //门禁主机报警信息 - HCNetSDK2.NET_DVR_ACS_ALARM_INFO strACSInfo = new HCNetSDK2.NET_DVR_ACS_ALARM_INFO(); - strACSInfo.write(); - Pointer pACSInfo = strACSInfo.getPointer(); - pACSInfo.write(0, pAlarmInfo.getByteArray(0, strACSInfo.size()), 0, strACSInfo.size()); - strACSInfo.read(); - - sAlarmType = sAlarmType + ":门禁主机报警信息,卡号:"+ new String(strACSInfo.struAcsEventInfo.byCardNo).trim() + ",卡类型:" + - strACSInfo.struAcsEventInfo.byCardType + ",报警主类型:" + strACSInfo.dwMajor + ",报警次类型:" + strACSInfo.dwMinor; - - //报警设备IP地址 - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - - if(strACSInfo.dwPicDataLen>0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = ".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() + - "_byCardNo["+ new String(strACSInfo.struAcsEventInfo.byCardNo).trim() + - "_"+ newName + "_Acs.jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strACSInfo.pPicData.getByteBuffer(offset, strACSInfo.dwPicDataLen); - byte [] bytes = new byte[strACSInfo.dwPicDataLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - break; - case HCNetSDK2.COMM_ID_INFO_ALARM: //身份证信息 - HCNetSDK2.NET_DVR_ID_CARD_INFO_ALARM strIDCardInfo = new HCNetSDK2.NET_DVR_ID_CARD_INFO_ALARM(); - strIDCardInfo.write(); - Pointer pIDCardInfo = strIDCardInfo.getPointer(); - pIDCardInfo.write(0, pAlarmInfo.getByteArray(0, strIDCardInfo.size()), 0, strIDCardInfo.size()); - strIDCardInfo.read(); - - sAlarmType = sAlarmType + ":门禁身份证刷卡信息,身份证号码:"+ new String(strIDCardInfo.struIDCardCfg.byIDNum).trim() + ",姓名:" + - new String(strIDCardInfo.struIDCardCfg.byName).trim() + ",报警主类型:" + strIDCardInfo.dwMajor + ",报警次类型:" + strIDCardInfo.dwMinor; - - //报警设备IP地址 - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - - //身份证图片 - if(strIDCardInfo.dwPicDataLen>0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = ".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() + - "_byCardNo["+ new String(strIDCardInfo.struIDCardCfg.byIDNum ).trim() + - "_"+ newName + "_IDInfoPic.jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strIDCardInfo.pPicData.getByteBuffer(offset, strIDCardInfo.dwPicDataLen); - byte [] bytes = new byte[strIDCardInfo.dwPicDataLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - //抓拍图片 - if(strIDCardInfo.dwCapturePicDataLen >0) - { - SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); - String newName = sf.format(new Date()); - FileOutputStream fout; - try { - String filename = ".\\pic\\"+ new String(pAlarmer.sDeviceIP).trim() + - "_byCardNo["+ new String(strIDCardInfo.struIDCardCfg.byIDNum ).trim() + - "_"+ newName + "_IDInfoCapturePic.jpg"; - fout = new FileOutputStream(filename); - //将字节写入文件 - long offset = 0; - ByteBuffer buffers = strIDCardInfo.pCapturePicData.getByteBuffer(offset, strIDCardInfo.dwCapturePicDataLen); - byte [] bytes = new byte[strIDCardInfo.dwCapturePicDataLen]; - buffers.rewind(); - buffers.get(bytes); - fout.write(bytes); - fout.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - break; - case HCNetSDK2.COMM_ISAPI_ALARM: //ISAPI协议报警信息 - HCNetSDK2.NET_DVR_ALARM_ISAPI_INFO struEventISAPI = new HCNetSDK2.NET_DVR_ALARM_ISAPI_INFO(); - struEventISAPI.write(); - Pointer pEventISAPI = struEventISAPI.getPointer(); - pEventISAPI.write(0, pAlarmInfo.getByteArray(0, struEventISAPI.size()), 0, struEventISAPI.size()); - struEventISAPI.read(); - sAlarmType = sAlarmType + ":ISAPI协议报警信息, 数据格式:" + struEventISAPI.byDataType + - ", 图片个数:" + struEventISAPI.byPicturesNumber; - - sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); - - SimpleDateFormat sf1 = new SimpleDateFormat("yyyyMMddHHmmss"); - String curTime = sf1.format(new Date()); - FileOutputStream foutdata; - try { - String jsonfilename = ".\\pic\\" + new String(pAlarmer.sDeviceIP).trim() + curTime +"_ISAPI_Alarm_" + ".json"; - foutdata = new FileOutputStream(jsonfilename); - //将字节写入文件 - ByteBuffer jsonbuffers = struEventISAPI.pAlarmData.getByteBuffer(0, struEventISAPI.dwAlarmDataLen); - byte [] jsonbytes = new byte[struEventISAPI.dwAlarmDataLen]; - jsonbuffers.rewind(); - jsonbuffers.get(jsonbytes); - foutdata.write(jsonbytes); - foutdata.close(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - for(int i=0;i-1){ - //System.out.println("---"+m_strDeviceInfo.byIPChanNum); - boolean getDVRConfigSuc = hcNetSDK.NET_DVR_GetDVRWorkState_V30(InitHCNetSDK.cameraUserId, m_strWorkState); - IntByReference ibrBytesReturned = new IntByReference(0);//获取IP接入配置参数 - - NET_DVR_IPPARACFG ipcfg=new NET_DVR_IPPARACFG(); - ipcfg.write(); - Pointer lpIpParaConfig =ipcfg.getPointer(); - hcNetSDK.NET_DVR_GetDVRConfig(InitHCNetSDK.cameraUserId,hcNetSDK.NET_DVR_GET_IPPARACFG, 0,lpIpParaConfig,ipcfg.size(),ibrBytesReturned); - ipcfg.read(); - //显示模拟通道 - int i = m_strWorkState.struChanStatic[channel-1].bySignalStatic; - if(0==i){ - res = 1; - } - /*for ( int i= 0 ;i< m_strDeviceInfo.byIPChanNum;i++){ - System.out.print( "Camera" +i+ 1 ); //模拟通道号名称 - System.out.print( "|是否录像:" +m_strWorkState.struChanStatic[i].byRecordStatic); //0不录像,不录像 - System.out.print( "|信号状态:" +m_strWorkState.struChanStatic[i].bySignalStatic); //0正常,1信号丢失 - System.out.println( "|硬件状态:" +m_strWorkState.struChanStatic[i].byHardwareStatic); //0正常,1异常 - }*/ - /*if (getDVRConfigSuc != true) - { - System.out.println(hcNetSDK.NET_DVR_GetLastError()); - System.out.println("获取设备状态失败"); - }else{ - int i = m_strWorkState.struChanStatic[channel].bySignalStatic; - if(0==i){ - res = 1; - } - }*/ - } - return res; - } - - -} diff --git a/src/com/sipai/tools/ChangeToPinYinJP.java b/src/com/sipai/tools/ChangeToPinYinJP.java deleted file mode 100644 index 36cd2c57..00000000 --- a/src/com/sipai/tools/ChangeToPinYinJP.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.sipai.tools; - - -import com.github.stuxuhai.jpinyin.ChineseHelper; -import com.github.stuxuhai.jpinyin.PinyinFormat; -import com.github.stuxuhai.jpinyin.PinyinHelper; - -import org.springframework.stereotype.Component; - -@Component -public class ChangeToPinYinJP { - - /** - * 转换为有声调的拼音字符串 - * @param pinYinStr 汉字 - * @return 有声调的拼音字符串 - */ - public static String changeToMarkPinYin(String pinYinStr){ - - String tempStr = null; - - try - { - tempStr = PinyinHelper.convertToPinyinString(pinYinStr, " ", PinyinFormat.WITH_TONE_MARK); - - } catch (Exception e) - { - e.printStackTrace(); - } - return tempStr; - - } - - - /** - * 转换为数字声调字符串 - * @param pinYinStr 需转换的汉字 - * @return 转换完成的拼音字符串 - */ - public static String changeToNumberPinYin(String pinYinStr){ - - String tempStr = null; - - try - { - tempStr = PinyinHelper.convertToPinyinString(pinYinStr, " ", PinyinFormat.WITH_TONE_NUMBER); - } catch (Exception e) - { - e.printStackTrace(); - } - - return tempStr; - - } - - /** - * 转换为不带音调的拼音字符串 - * @param pinYinStr 需转换的汉字 - * @return 拼音字符串 - */ - public static String changeToTonePinYin(String pinYinStr){ - - String tempStr = null; - - try - { - tempStr = PinyinHelper.convertToPinyinString(pinYinStr, " ", PinyinFormat.WITHOUT_TONE); - } catch (Exception e) - { - e.printStackTrace(); - } - return tempStr; - - } - - /** - * 转换为每个汉字对应拼音首字母字符串 - * @param pinYinStr 需转换的汉字 - * @return 拼音字符串 - */ - public static String changeToGetShortPinYin(String pinYinStr){ - - String tempStr = null; - - try - { - tempStr = PinyinHelper.getShortPinyin(pinYinStr); - } catch (Exception e) - { - e.printStackTrace(); - } - return tempStr; - - } - - /** - * 检查汉字是否为多音字 - * @param pinYinStr 需检查的汉字 - * @return true 多音字,false 不是多音字 - */ - public static boolean checkPinYin(char pinYinStr){ - - boolean check = false; - try - { - check = PinyinHelper.hasMultiPinyin(pinYinStr); - } catch (Exception e) { - e.printStackTrace(); - } - return check; - } - - /** - * 简体转换为繁体 - * @param pinYinStr - * @return - */ - public static String changeToTraditional(String pinYinStr){ - - String tempStr = null; - try - { - tempStr = ChineseHelper.convertToTraditionalChinese(pinYinStr); - } catch (Exception e) - { - e.printStackTrace(); - } - return tempStr; - - } - - /** - * 繁体转换为简体 - * @param pinYinSt - * @return - */ - public static String changeToSimplified(String pinYinSt){ - - String tempStr = null; - - try - { - tempStr = ChineseHelper.convertToSimplifiedChinese(pinYinSt); - } catch (Exception e) - { - e.printStackTrace(); - } - - return tempStr; - - } - -// public static void main(String[] args) { -// String str = "重慶 most input"; -// ChangeToPinYinJP jp = new ChangeToPinYinJP(); -// System.out.println(jp.changeToSimplified(str)); -// System.out.println(jp.checkPinYin('重')); -// } -} diff --git a/src/com/sipai/tools/ColorInfo.java b/src/com/sipai/tools/ColorInfo.java deleted file mode 100644 index d369854c..00000000 --- a/src/com/sipai/tools/ColorInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sipai.tools; - - -public class ColorInfo{ - /** - * 颜色的alpha值,此值控制了颜色的透明度 - */ - public int A; - /** - * 颜色的红分量值,Red - */ - public int R; - /** - * 颜色的绿分量值,Green - */ - public int G; - /** - * 颜色的蓝分量值,Blue - */ - public int B; - - public int toRGB() { - return this.R << 16 | this.G << 8 | this.B; - } - - public java.awt.Color toAWTColor(){ - return new java.awt.Color(this.R,this.G,this.B,this.A); - } - - public static ColorInfo fromARGB(int red, int green, int blue) { - return new ColorInfo((int) 0xff, (int) red, (int) green, (int) blue); - } - public static ColorInfo fromARGB(int alpha, int red, int green, int blue) { - return new ColorInfo(alpha, red, green, blue); - } - public ColorInfo(int a,int r, int g , int b ) { - this.A = a; - this.B = b; - this.R = r; - this.G = g; - } -} diff --git a/src/com/sipai/tools/CommService.java b/src/com/sipai/tools/CommService.java deleted file mode 100644 index 328e6ece..00000000 --- a/src/com/sipai/tools/CommService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.sipai.tools; - -import java.io.IOException; -import java.util.List; - -public interface CommService { - - public T selectById(String t); - - public int deleteById(String t) throws IOException; - - public int save(T t); - - public int update(T t); - - public List selectListByWhere(String t); - - public int deleteByWhere(String t); -} diff --git a/src/com/sipai/tools/CommString.java b/src/com/sipai/tools/CommString.java deleted file mode 100644 index e1d542c2..00000000 --- a/src/com/sipai/tools/CommString.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.sipai.tools; - -import java.util.HashMap; - -public class CommString { - - public static final String TOKEN_HEADER = "token"; - public static final String JWT_SESSION_HEADER = "jwt_session"; - - public static String Alarm_PRO = "pro"; - //管理员ID - public static final String ID_Admin = "emp01";//管理员 - - //启用 禁用 active - public static final String Flag_Active = "1";//启用 - public static final String Flag_Unactive = "0";//禁用 - - //设备标识 构筑物标识 - public static final String Flag_Equipment = "E";//设备标识 - public static final String Flag_Structure = "S";//构筑物标识 - - //树节点字符串 - public static final String Tree_Root = "-1";//根节点 - //外包商树节点 - public static final String Tree_Outsourcer = "WBDW2020";//根节点 - //数据同步字段 - public static final String Sync_Insert = "I";//插入 - public static final String Sync_Edit = "E";//编辑 - public static final String Sync_Delete = "D";//删除 - public static final String Sync_Finish = "F";//同步完成 - - //unit type - public static final String UNIT_TYPE_USER = "U";// 用户 - public static final String UNIT_TYPE_DEPT = "D";//部门 - public static final String UNIT_TYPE_BIZ = "B";//水厂 - public static final String UNIT_TYPE_WORKSHOP = "W";//车间 - public static final String UNIT_TYPE_COMPANY = "C";//公司 - public static final String UNIT_TYPE_Maintainer = "M";//运维商 - - //图标 - public static final String UNIT_BIZ_ICON = "fa fa-fw fa-industry";//水厂 fa-cog fa-steam fa-gears - public static final String UNIT_COMPANY_ICON = "fa fa-fw fa-building";//公司 - public static final String UNIT_DEPT_ICON = "fa fa-fw fa-group";//部门 - public static final String UNIT_USER_ICON = "fa fa-fw fa-male";//用户 - public static final String UNIT_Maintainer_ICON = "fa fa-fw fa-wrench";//维护商 - - //启用禁用(0和1) - public static final String Active_True = "1";// 启用 - public static final String Active_False = "0";//禁用 - //启用禁用(中文的) - public static final String Active_True_CH = "启用";// 启用 - public static final String Active_False_CH = "禁用";//禁用 - - //人员类型 - public static final String UserType_Biz = "0";// 水厂人员 - public static final String UserType_Maintainer = "1";//供应商 - public static final String UserType_Other = "2";//其它 - - //miniMES接收工单的命名空间 - public static final String Resp_Success = "pass"; - public static final String Resp_Failure = "resp_fail"; - //工艺导入产品代码标识字符串 - public static final String Flag_Technics_Name = "产品型号"; - public static final String TaskType_Start = "startEvent"; - public static final String TaskType_UserTask = "task"; - public static final String TaskType_End = "endEvent"; - public static final String TaskType_Gateway = "gateway"; - - public static final String NO_CURRENT_PROCESS = "NO_CURRENT_PROCESS"; - public static final String NO_CURRENT_PROCEDURE = "NO_CURRENT_PROCEDURE"; - public static final String NO_CURRENT_WORKORDER = "NO_CURRENT_WORKORDER"; - public static final String NO_TASKDEMANDS = "NO_TASKDEMANDS"; - public static final String NO_TASKS = "NO_TASKS"; - - public static final String NO_WORKSTATION = "NO_WORKSTATION"; - - public static final String ACTI_Condition_PASS = "${pass}"; //activiti判断节点通过条件 - public static final String ACTI_Condition_FAIL = "${!pass}";//activiti判断节点不通过条件 - public static final String ACTI_KEK_Condition = "pass"; - public static final String ACTI_KEK_Condition_Route = "route";//判断按哪条路径走 - public static final String ACTI_KEK_Assignee = "applicantId"; - public static final String ACTI_KEK_Candidate_Users = "userIds"; - public static final String ACTI_KEK_AssigneeList = "applicantIdList";//会签人员 - - public static final String InkBoardType_Ink = "ink"; - public static final String InkBoardType_Board = "board"; - //制品管理可视化分类 - public static final String[] ProdManageViews = {"CNC_Execution:CNC成型", "Tempering:钢化", "TemperingClean:钢化后清洗", "SilkPrint:丝印", "SilkPrintClean:丝印后清洗"}; - //测量点功能分类 - public static final String[] MPointFunType = {"启停", "待机", "故障", "启动", "停止"}; - //工序排序分类 -// public static final String TaskProcedureOrderType_Taskorder="TO"; -// public static final String TaskProcedureOrderType_DailyPlan="DP"; - public static final String[] TASKPROCEDUREORDERTYPES_STRINGS = {"TO:任务单一览", "DP:日计划统计(任务量)", "DP-EQU:日计划统计(设备)", "ALL:所有工序"}; - - public static final String Resp_Success_RFID = "true"; - public static final String Resp_Failure_RFID = "false"; - - public static final String[] MaintenanceMethod = {"电脑远程", "上门服务"}; - - //返回结果字段 - public static final int ONE_STRING = 1;//表示数字1 - public static final int TWO_STRING = 2;//表示数字2 - public static final int ZERO_STRING = 0;//表示数字0 - - public static final String Default_Theme = "skin-blue-light";//默认主题 - - public static final String MainPageType_Produce = "produce";//首页分类-生产 - public static final String MainPageType_Security = "security";//首页分类-安全 - public static final String MainPageType_Efficiency = "efficiency";//首页分类-效率 - - - public static final String ChartType_Base = "base";//图表展示类型-基础 - public static final String ChartType_Gauge = "gauge";//图表展示类型-仪表 - public static final String ChartType_Bar = "bar";//图表展示类型-柱状图 - public static final String ChartType_Line = "line";//图表展示类型-折线 - - public static final String AnalysisChartType_Word = "word";//数据分析图表展示类型-文字 - public static final String AnalysisChartType_WaterLiquid = "waterLiquid";//数据分析图表展示类型-水球图 - public static final String AnalysisChartType_WaterRange = "waterRange";//数据分析图表展示类型-水球图量程 - public static final String AnalysisChartType_Line = "line";//数据分析图表展示类型-线图 - - - public static final HashMap> typeMap = new HashMap<>();// 模型摄像头报警类型实时更新 - - public static final HashMap craneModelMap = new HashMap<>();// 行车模型推送数据 - - /** - * 摄像头红色报警 - */ - public static final int ALARM_RED = 2; - /** - * 摄像头黄色报警 - */ - public static final int ALARM_YELLOW = 1; - /** - * 摄像头蓝色报警 - */ - public static final int ALARM_BLUE = 0; - - - /** - * 定时任务启动状态 - */ - public static final int STATUS_RUNNING = 0; - /** - * 定时任务暂停状态 - */ - public static final int STATUS_NOT_RUNNING = 1; - - //排班类型 - //public static final String SchedulingType="[{\"id\":\"E\",\"text\":\"设备巡检\"},{\"id\":\"P\",\"text\":\"生产巡检\"},{\"id\":\"A\",\"text\":\"管理组\"}]"; - - //APP接口调取数据是否成功变量 - public static final String Status_Pass = "pass";//获取数据成功 - public static final String Status_Fail = "fail";//获取数据失败 - - //APP接口调用首页配置信息分类 - public static final String Type_Efficiency = "efficiency";//效率 - public static final String Type_Produce = "produce";//生产 - - //APP接口调用KPI grade字段级别筛选 - public static final String KPI_Grade_Important = "1";//效率 - - //设备分类 - public static final String EquipmentClass_Category = "1";// 设备种类 - 大类 - public static final String EquipmentClass_Equipment = "2";// 设备种类 - 小类 - public static final String EquipmentClass_Parts = "3";// 设备部位 - - //设备台账状态 - public static final String EQUIPMENTCARD_STATUS_ON = "在用"; - - - /** - * 流程会签集合名称 - */ - public static final String ACT_COUNTERSIGN_LIST = "assigneeList"; - - public static final String ACT_COUNTERSIGN_VAR = "userIds"; - - //南市Ip - public static final String NanShiIp = "10.194.10.125:8080"; - - // KPI 计算点月开始日期 - public static final int KPI_MPOINT_START_DAY = 1; - // KPI 计算点日开始时间 - public static final int KPI_MPOINT_START_HOUR = 0; - // KPI 计算点分开始时间 - public static final int KPI_MPOINT_START_MINUTE = 0; - - - /** - * 图片类型 - */ - public static final String FILE_TYPE_IMAGE = "image";//图片 - public static final String FILE_TYPE_VIDEO = "video";//视频 - public static final String FILE_TYPE_AUDIO = "audio";//视频 - - /** - * redis类型 - */ - public static final String RedisMpointFlag = "mpoint:current:";//带有网关的项目 实时数据 - public static final String REDIS_KEY_TYPE_RealtimePosition = "realtimePosition"; - public static final String REDIS_KEY_TYPE_LocalNum = "local_num";//人员定位统计数 - public static final String REDISMqttTopicMpoint = "mpoint:mqttTopicMpoint";//动态主题和点位 - public static final String REDISWebsocketBIMMpoint = "mpoint:topic:websocketBIMMpoint";//三维_动态主题和点位 (通用) - public static final String REDISWebsocketBIMEquMpoint = "mpoint:topic:websocketBIMEquMpoint";//三维_设备动态主题和点位 (目前南厂定制) - public static final String REDISWebsocketBIMRobot = "mpoint:topic:websocketBIMRobot";//三维_机器人 - public static final String REDISWebsocketBIMRobotBoon = "mpoint:topic:websocketBIMRobotBoon";//三维_机器人(仅用于判断是否发生变化) - public static final String REDIS_KEY_TYPE_PAGEDATA = "pageData"; - public static final String REDIS_KEY_TYPE_VisualTipic = "mpoint:topic:visualTipic";//可视化 页面和点位的关联关系 - public static final String REDIS_KEY_TYPE_ModelCidData = "model:cidData_";//模型临时缓存的数据 - - /** - * 跟三维数据推送类型 - */ - public static final String WebsocketBIMTypeReal = "real";//实时数据 (通用) - public static final String WebsocketBIMTypeRobot = "robot";//机器人数据(南厂定制) - public static final String WebsocketBIMTypeRobotChange = "robot_change";//机器人数据(南厂定制) - public static final String WebsocketBIMTypePatrol = "patrol";//数据巡视 (目前在石洞口使用) - public static final String WebsocketBIMTypeEquipment = "equipment";//单台设备数据 (通用) - public static final String WebsocketBIMTypeAutoPatrol = "autopatrol";//自动巡检 (目前在南厂使用) - public static final String WebsocketBIMTypeEmergency = "emergency";//应急预案 (目前在南厂使用) - public static final String WebsocketBIMType021NS_SLCJQR01_RT = "021NS_SLCJQR01_RT";//机器人websocket (目前在南厂使用) - - public static final String WebsocketBIMTypeChangeEqu = "changeEqu";//切换设备(不是定位设备) - -} diff --git a/src/com/sipai/tools/CommUtil.java b/src/com/sipai/tools/CommUtil.java deleted file mode 100644 index 252231f7..00000000 --- a/src/com/sipai/tools/CommUtil.java +++ /dev/null @@ -1,4019 +0,0 @@ -package com.sipai.tools; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONException; -import com.alibaba.fastjson.serializer.SerializerFeature; -import com.sipai.entity.enums.TimeUnitEnum; -import com.sipai.entity.equipment.EquipmentArrangement; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserPower; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UserService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.codec.binary.Hex; -import org.apache.http.HttpHost; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.DefaultProxyRoutePlanner; -import org.apache.http.util.EntityUtils; -import org.apache.log4j.Logger; -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.joda.time.DateTime; -import org.joda.time.Months; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; -import org.redisson.api.RBucket; -import org.redisson.api.RedissonClient; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; - -import javax.crypto.Cipher; -import javax.crypto.spec.SecretKeySpec; -import javax.servlet.http.HttpServletRequest; -import java.awt.*; -import java.awt.geom.GeneralPath; -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.io.*; -import java.math.BigDecimal; -import java.net.*; -import java.security.MessageDigest; -import java.security.Security; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.text.SimpleDateFormat; -import java.util.List; -import java.util.*; -import java.util.Map.Entry; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; - - -/** - * @author Administrator - */ -public class CommUtil { - private static final Logger logger = Logger.getLogger(CommUtil.class); - - private static final SimpleDateFormat dateFormat = new SimpleDateFormat( - "yyyy-MM-dd", Locale.SIMPLIFIED_CHINESE); - - private static final SimpleDateFormat timeFormat = new SimpleDateFormat( - "hh:mm:ss", Locale.SIMPLIFIED_CHINESE); - - private static final SimpleDateFormat longDateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss", Locale.SIMPLIFIED_CHINESE); - - private static final CommUtil util = new CommUtil(); - - /*public static String HTTP_TYPE="http";//http访问server - public static String WEBSERVICE_TYPE="webservice";//webservice访问server -*/ - public CommUtil() { - } - - public static String getwherestr(String unitid) { - String wherestr = ""; - String[] str = null; - if (unitid == null || unitid.trim().equals("") || unitid.trim().equals(",")) { - wherestr = ""; - } else { - str = unitid.split(","); - for (int i = 0; i < str.length; i++) { - wherestr += "'" + str[i].trim() + "',"; - } - wherestr += "''"; - } - str = null; - return wherestr; - } - - /** - * 获取部门or自己or全部的范围 - * scope=null为自己,dept为部门,all为所有 - * - * @param column - * @param funcstr - * @param cu - * @return - */ - public static String getwherestr(String column, String funcstr, User cu) { - String wherestr = " where 1=1 "; - int lvl = 0;//0自己,1部门,2全部,3所属厂区或者运维商 - if (cu != null) { - if (cu.getId().contains("emp01")) { - return wherestr; - } - if (funcstr == null || funcstr.isEmpty()) { - lvl = 3; - } else { - MenuService menuService = (MenuService) SpringContextUtil.getBean("menuService"); - List list = menuService.selectFuncByUserId(cu.getId()); - for (UserPower up : list) { - if (up.getLocation().indexOf(funcstr) >= 0) { - if (up.getLocation().indexOf("scope=dept") >= 0) { - if (lvl < 1) { - lvl = 1; - } - } - if (up.getLocation().indexOf("scope=all") >= 0) { - if (lvl < 2) { - lvl = 2; - } - } - } - } - } - if (lvl == 0) { - wherestr += " and " + column + " = '" + cu.getId() + "' "; - } else if (lvl == 1) { - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - List userlist = userService.getUserListByPid(cu.getPid()); - String str = ""; - for (User user : userlist) { - str += "'" + user.getId() + "',"; - } - if (!str.equals("")) { - str = str.substring(0, str.length() - 1); - } - wherestr += " and " + column + " in (" + str + ") "; - } else if (lvl == 3) { - //按厂区id或者供应商公司id查询 - UnitService unitService = (UnitService) SpringContextUtil.getBean("unitServiceImpl"); - List companies = unitService.getCompaniesByUserId(cu.getId()); - String companyIds = ""; - for (Company company : companies) { - if (!companyIds.isEmpty()) { - companyIds += "','"; - } - companyIds += company.getId(); - } - wherestr += " and " + column + " in ('" + companyIds + "')"; - } - } else { - wherestr = " where 1<>1 "; - } - - return wherestr; - } - - - /** - * @return 当前函数值 - */ - public static CommUtil getInstance() { - return util; - } - - /** - * 得到yyyy-MM-dd的日期格式 - * - * @return yyyy-MM-dd的日期格式 - */ - public static SimpleDateFormat getDateFormat() { - return dateFormat; - } - - /** - * 转换对象成所需日期格式的字符串 - * - * @param format 日期格式 - * @param v 需要转换日期格式的对象 - * @return 所需要日期类型的字符串 - */ - public static String formatDate(String format, Object v) { - if (v == null) { - return null; - } else { - SimpleDateFormat df = new SimpleDateFormat(format, - Locale.SIMPLIFIED_CHINESE); - return df.format(v); - } - } - - /** - * 转换字符串成所需日期格式的日期对象 - * - * @param format 日期格式 - * @param v 需要转换日期格式的字符串 - * @return 所需要日期类型的日期对象 - */ - public static Date formatDate(String format, String v) { - if (v == null) { - return null; - } else { - SimpleDateFormat df = new SimpleDateFormat(format, - Locale.SIMPLIFIED_CHINESE); - Date d = null; - try { - d = df.parse(v); - } catch (Exception exception) { - } - return d; - } - } - - /** - * 转换对象成yyyy-MM-dd格式的字符串 - * - * @param v 需转换短日期格式的字符串 - * @return 转换成yyyy-MM-dd格式的字符串 - */ - public static String format(Object v) { - if (v == null) - return null; - else - return dateFormat.format(v); - } - - /** - * 转换对象成hh:mm:ss格式的字符串 - * - * @param v 需转换时间格式的对象 - * @return 转换成hh:mm:ss格式的字符串 - */ - public static String sortTime(Object v) { - if (v == null) { - return null; - } else { - return timeFormat.format(v); - } - } - - /** - * * 转换对象成yyyy-MM-dd hh:mm:ss格式的字符串 - * - * @param v 需转换完整日期格式的对象 - * @return 转换成yyyy-MM-dd hh:mm:ss格式的字符串 - */ - public static String longDate(Object v) { - if (v == null) { - return null; - } else { - return longDateFormat.format(v); - } - } - - /** - * 得到当前时间 - * - * @return 返回当前时间的字符串 格式为yyyy-MM-dd hh:mm:ss - */ - public static String nowDate() { - return longDateFormat.format(new Date()); - } - - /** - * 得到当前时间下相隔 num 天后的时间 - * - * @return 返回当前时间的字符串 格式为yyyy-MM-dd hh:mm:ss - */ - public static String differenceDate(int num) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(calendar.DATE, num); - String date2 = sdf.format(calendar.getTime()); - return date2; - } - - //目的是获得当前年 - public static String thisYear() { - - return Calendar.getInstance().get(Calendar.YEAR) + "-01-01"; - } - - /** - * 得到字符串的时间对象 - * - * @param s 需转换为日期对象的字符串 - * @return 转换为yyyy-MM-dd的日期对象 - */ - public static Date formatDate(String s) { - Date d = null; - try { - d = dateFormat.parse(s); - } catch (Exception exception) { - } - return d; - } -/** - 6 * 时间戳转换成日期格式字符串 - 7 * @param seconds 时间戳转 - 8 * @param formatStr - 9 * @return - 10 */ - public static String timeStamp2Date(String seconds) { - if(seconds == null || seconds.isEmpty() || seconds.equals("null")){ - return ""; - } - return longDateFormat.format(new Date(Long.valueOf(seconds))); - } - /** - * 判断对象是否为空,返回对象字符串或者没有字符 - * - * @param s 判断是否为空的对象 - * @return 不为空时返回对象的字符串,为空返回没有字符 - */ - public static String null2String(Object s) { - return s != null ? s.toString() : ""; - } - - /** - * 判断字符串是否为空,返回字符串或者没有字符 - * - * @param s 判断是否为空的字符串 - * @return 不为空时返回字符串,为空返回没有字符 - */ - public static String null2String(String s) { - return s != null ? s.toString() : ""; - } - - /** - * 判断字符串是否为空,返回int型数字或者0 - * - * @param s 判断是否为空的字符串 - * @return 不为空时返回数字,为空返回0 - */ - public static int null2Int(Object s) { - int v = 0; - if (s != null) - try { - v = Integer.parseInt(s.toString()); - } catch (Exception exception) { - } - return v; - } - - - /** - * 得到随机字符串 - * - * @param length 需要字符串的长度 - * @return 返回所需长度的字符串 - */ - public static String getRandString(int length) { - StringBuffer s = new StringBuffer(); - Random r = new Random(10L); - s.append(Math.abs(r.nextInt())); - if (s.toString().length() > length) - s.substring(0, length); - return s.toString(); - } - - /** - * 产生随机数字串 - * - * @param length 产生随机数字串位数 - * @return String 随机数字串 - * @throws - */ - public static final String getRandomNumbers(int length) { - if (length < 1) { - return null; - } - Random randGen = null; - char[] numbersAndLetters = null; - if (randGen == null) { - randGen = new Random(); - numbersAndLetters = ("0123456789" + "0123456789").toCharArray(); - } - char[] randBuffer = new char[length]; - for (int i = 0; i < randBuffer.length; i++) { - randBuffer[i] = numbersAndLetters[randGen.nextInt(19)]; - } - return new String(randBuffer); - } - - /** - * 得到唯一值 - * - * @return 返回一个当前时间为主的唯一值字符串 - */ - public static String getOnlyID() { - SimpleDateFormat df = new SimpleDateFormat("yyyyMMDDhhmmss", - Locale.SIMPLIFIED_CHINESE); - double dblTmp; - for (dblTmp = Math.random() * 100000D; dblTmp < 10000D; dblTmp = Math - .random() * 100000D) - ; - String strRnd = String.valueOf(dblTmp).substring(0, 4); - String s = df.format(new Date()) + strRnd; - return s; - } - - /** - * 把字符串解析为中文 - * - * @param strvalue 中文字符串 - * @return 返回GBK的中文字符串 - */ - public static String toChinese(String strvalue) { - try { - if (strvalue == null) { - return null; - } else { - strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK"); - return strvalue; - } - } catch (Exception e) { - return null; - } - } - - /** - * 转换成所需的编码格式的字符串 - * - * @param strvalue 需要转换的字符串 - * @param charset 需要的编码格式 - * @return 返回编码格式的字符串 - */ - public static String toChinese(String strvalue, String charset) { - try { - if (charset == null || charset.equals("")) { - return toChinese(strvalue); - } else { - strvalue = new String(strvalue.getBytes("ISO8859_1"), charset); - return strvalue; - } - } catch (Exception e) { - return null; - } - } - - /** - * 计算两个时间的天数差值 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd - * @return 返回两个时间差值,值为整型 - */ - public static int getDays(String sd, String ed) { - long l = 0; - try { - Date dt1 = dateFormat.parse(sd); - Date dt2 = dateFormat.parse(ed); - l = (dt1.getTime() - dt2.getTime()) / (3600 * 24 * 1000); - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return (int) l; - } - - /** - * 计算两个时间的差值(上面的只能精确到日 因为格式问题无法精确到秒 改用longDateFormat ) - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd HH:mm:ss - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd HH:mm:ss - * @param type 需要差值的是,分钟、小时、天、周、月,年 - * @return 返回两个时间差值,值为整型 - */ - public static int getDays2(String sd, String ed, String type) { - long l = 0; - try { - Date dt1 = longDateFormat.parse(sd); - Date dt2 = longDateFormat.parse(ed); - l = (dt1.getTime() - dt2.getTime()) / (3600 * 24 * 1000); - if ("second".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (1000); - } else if ("min".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (60 * 1000); - } else if ("hour".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (360 * 1000); - } else if ("week".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (3600 * 24 * 7 * 1000); - } else if ("month".equals(type)) { - DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); - DateTime start = formatter.parseDateTime(sd); - DateTime end = formatter.parseDateTime(ed); - l = Months.monthsBetween(start, end).getMonths(); - } - - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return (int) l; - } - - /** - * 计算两个时间的差值 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd - * @param type 需要差值的是,分钟、小时、天、周、月,年 - * @return 返回两个时间差值,值为整型 - */ - public static int getDays(String sd, String ed, String type) { - long l = 0; - try { - Date dt1 = dateFormat.parse(sd); - Date dt2 = dateFormat.parse(ed); - l = (dt1.getTime() - dt2.getTime()) / (3600 * 24 * 1000); - if ("min".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (60 * 1000); - } else if ("hour".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (360 * 1000); - } else if ("week".equals(type)) { - l = (dt1.getTime() - dt2.getTime()) / (3600 * 24 * 7 * 1000); - } else if ("month".equals(type)) { - DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); - DateTime start = formatter.parseDateTime(sd); - DateTime end = formatter.parseDateTime(ed); - l = Months.monthsBetween(start, end).getMonths(); - } - - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return (int) l; - } - - /** - * 得到日期加减 - * - * @param datestr 日期字符串 - * @param dateval 需要加减的数量 - * @param type 需要加减的是,小时、周、月,年,天 - * @return 加减后的日期字符串 - */ - public static String subplus(String datestr, String dateval, String type) { - String sreturn = null; - try { - Calendar calendar = Calendar.getInstance(); - int datetype = Calendar.DATE; - Date dt = dateFormat.parse(datestr); - if ("hour".equals(type)) { - datetype = Calendar.HOUR_OF_DAY; - SimpleDateFormat chineseDateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm", Locale.SIMPLIFIED_CHINESE); - dt = chineseDateFormat.parse(datestr); - } else if ("week".equals(type)) { - datetype = Calendar.DAY_OF_WEEK_IN_MONTH; - } else if ("month".equals(type)) { - datetype = Calendar.MONTH; - } else if ("year".equals(type)) { - datetype = Calendar.YEAR; - } else if ("min".equals(type)) { - datetype = Calendar.MINUTE; - SimpleDateFormat chineseDateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm", Locale.SIMPLIFIED_CHINESE); - dt = chineseDateFormat.parse(datestr); - } else if ("sec".equals(type)) { - datetype = Calendar.SECOND; - SimpleDateFormat chineseDateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss", Locale.SIMPLIFIED_CHINESE); - dt = chineseDateFormat.parse(datestr); - } else if ("day".equals(type)) { - datetype = Calendar.DATE; - SimpleDateFormat chineseDateFormat = new SimpleDateFormat( - "yyyy-MM-dd", Locale.SIMPLIFIED_CHINESE); - dt = chineseDateFormat.parse(datestr); - } else if ("day2".equals(type)) { - datetype = Calendar.DATE; - SimpleDateFormat chineseDateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm", Locale.SIMPLIFIED_CHINESE); - dt = chineseDateFormat.parse(datestr); - } - int val = Integer.valueOf(dateval); - calendar.setTime(dt); - calendar.add(datetype, val); - sreturn = longDateFormat.format(calendar.getTime()); - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return sreturn; - } - - /** - * 得到当前年月 - * - * @return 当前年月 - */ - public static String getMonth() { - Calendar cal = Calendar.getInstance(); - int day = cal.get(Calendar.DAY_OF_MONTH); - if (day > 22) { - cal.add(Calendar.MONTH, 1); - } - int month = cal.get(Calendar.MONTH); - int year = cal.get(Calendar.YEAR); - String sreturn = year + "年" + (month + 1) + "月"; - return sreturn; - } - - /** - * 得到参数的年月 - * - * @param val 提前月份数 - * @return 返回提前当前月份数的年月字符串 - */ - public static String getMonth(String val) { - Calendar cal = Calendar.getInstance(); - int dateval; - if (val.equals("")) { - dateval = 0; - } else { - dateval = -Integer.valueOf(val); - } - cal.add(Calendar.MONTH, dateval); - int month = cal.get(Calendar.MONTH); - int year = cal.get(Calendar.YEAR); - String sreturn = year + "年" + (month + 1) + "月"; - return sreturn; - } - - /** - * 得到唯一值 - * - * @return 返回java的util中唯一值函数的值 - */ - public static String getUUID() { - String uuid = null; - uuid = java.util.UUID.randomUUID().toString().replace("-", ""); - return uuid; - } - - /** - * @param list - */ - @SuppressWarnings({"unchecked", "unchecked"}) - public static void removeDuplicateWithOrder(List list) { - Set set = new HashSet(); - List newList = new ArrayList(); - for (Iterator iter = list.iterator(); iter.hasNext(); ) { - Object element = iter.next(); - if (set.add(element)) - newList.add(element); - } - list.clear(); - list.addAll(newList); - } - - /** - * String形式的replace - * - * @param from - * @param to - * @param source - * @return - */ - public static String strReplace(String from, String to, String source) { - StringBuffer bf = new StringBuffer(""); - if (source != null) { - - StringTokenizer st = new StringTokenizer(source, from, true); - while (st.hasMoreTokens()) { - String tmp = st.nextToken(); - if (tmp.equals(from)) { - bf.append(to); - } else { - bf.append(tmp); - } - } - } - return bf.toString(); - } - - public static String genDelMsg(int total, int suc) { - String msg = ""; - if (total == 1) { - if (suc == 1) { - msg = "删除成功!"; - } else { - msg = "删除失败,该信息已被使用!"; - } - } else { - if (total == suc) { - msg = "删除成功"; - } else { - msg = "共需删除" + String.valueOf(total) + "条,成功删除" + String.valueOf(suc) + "条,另有" + String.valueOf(total - suc) + "条信息被使用无法删除!"; - } - } - return msg; - } - - /** - * 为需要审批的数量 - * - * @param total - * @param suc - * @return - */ - public static String gencheck(int total, int suc) { - String msg = ""; - if (total == 1) { - if (suc == 1) { - msg = "审批完成!"; - } else { - msg = "审批失败,该信息有问题!"; - } - } else { - if (total == suc) { - msg = "审批完成"; - } else { - msg = "共需审批" + String.valueOf(total) + "条,成功审批" + String.valueOf(suc) + "条,另有" + String.valueOf(total - suc) + "条信息有问题审批!"; - } - } - return msg; - } - - public static String genDelMsg1(int total, int suc) { - String msg = ""; - if (total == 1) { - if (suc == 1) { - msg = "标志成功"; - } else { - msg = "标志失败"; - } - } else { - msg = "共需标志" + String.valueOf(total) + "条,成功标志" + String.valueOf(suc) + "条"; - } - return msg; - } - - public static String genDelMsg2(int total, int suc) { - String msg = ""; - if (total == 1) { - if (suc == 1) { - msg = "启用成功"; - } else { - msg = "启用失败"; - } - } else { - msg = "共需启用" + String.valueOf(total) + "条,成功启用" + String.valueOf(suc) + "条"; - } - return msg; - } - - - /** - * 比较两个日期大小(2010-12-15 snd) - * - * @param DATE1 - * @param DATE2 - * @return - */ - public static int compare_date(String DATE1, String DATE2) { - DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - try { - Date dt1 = df.parse(DATE1); - Date dt2 = df.parse(DATE2); - if (dt1.getTime() > dt2.getTime()) { - //System.out.println("dt1 在dt2前"); - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - //System.out.println("dt1在dt2后"); - return -1; - } else { - return 0; - } - } catch (Exception exception) { - exception.printStackTrace(); - } - return 0; - } - - /** - * 比较两个日期时间大小 - * - * @param DATE1 - * @param DATE2 - * @return - */ - public static int compare_time(String DATE1, String DATE2) { - DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date dt1 = df.parse(DATE1); - Date dt2 = df.parse(DATE2); - if (dt1.getTime() > dt2.getTime()) { - //System.out.println("dt1 在dt2后"); - return 1; - } else if (dt1.getTime() < dt2.getTime()) { - //System.out.println("dt1在dt2前"); - return -1; - } else { - //System.out.println("dt1=dt2"); - return 0; - } - } catch (Exception exception) { - exception.printStackTrace(); - } - return 0; - } - - //生成随机颜色 - public static String getRandColor(Random random, int fc, int bc) { - if (fc > 255) fc = 255; - if (bc > 255) bc = 255; - int r = fc + random.nextInt(bc - fc); - int g = fc + random.nextInt(bc - fc); - int b = fc + random.nextInt(bc - fc); - Color color = new Color(r, g, b); - String R = Integer.toHexString(color.getRed()); - R = R.length() < 2 ? ('0' + R) : R; - String B = Integer.toHexString(color.getBlue()); - B = B.length() < 2 ? ('0' + B) : B; - String G = Integer.toHexString(color.getGreen()); - G = G.length() < 2 ? ('0' + G) : G; - return '#' + R + B + G; - } - - //生成随机颜色(为) - public static String getRandColornew(Random random, int fc, int bc) { - if (fc > 255) fc = 255; - if (bc > 255) bc = 255; - int r = fc + random.nextInt(bc - fc); - int g = fc + random.nextInt(bc - fc); - int b = fc + random.nextInt(bc - fc); - Color color = new Color(r, g, b); - String R = Integer.toHexString(color.getRed()); - R = R.length() < 2 ? ('0' + R) : R; - String B = Integer.toHexString(color.getBlue()); - B = B.length() < 2 ? ('0' + B) : B; - String G = Integer.toHexString(color.getGreen()); - G = G.length() < 2 ? ('0' + G) : G; - return R + B + G; - } - - /** - * 获取服务器IP地址 - * - * @return - */ - public static String getServerIp() { - String SERVER_IP = null; - try { - Enumeration allNetInterfaces = NetworkInterface.getNetworkInterfaces(); - InetAddress ip = null; - boolean finded = false;// 是否找到外网IP - while (allNetInterfaces.hasMoreElements() && !finded) { - NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement(); - //System.out.println(netInterface.getName()); - Enumeration addresses = netInterface.getInetAddresses(); - while (addresses.hasMoreElements()) { - ip = (InetAddress) addresses.nextElement(); - - //&&!ip.isSiteLocalAddress() && !ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == -1 - if (ip != null && ip instanceof Inet4Address) { - try { - SERVER_IP = ip.getLocalHost().getHostAddress(); - } catch (UnknownHostException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (SERVER_IP != null && !SERVER_IP.equals("")) { - finded = true; - } - - } - } - } - } catch (SocketException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return SERVER_IP; - } - - //*============================================================== - public static String getLocalMAC() { - InetAddress addr; - try { - addr = InetAddress.getLocalHost(); - String ip = addr.getHostAddress().toString();//获得本机IP - return getMAC(ip); - } catch (UnknownHostException e) { - e.printStackTrace(); - } - return "ERROR"; - } - - public static String getMAC(String ipAddress) { - if (ipAddress.equalsIgnoreCase("localhost") || ipAddress.equalsIgnoreCase("127.0.0.1")) { - return getLocalMAC(); - } - String address = "ERROR"; - String os = System.getProperty("os.name"); - if (os != null && os.startsWith("Windows")) { - try { - String command = "cmd.exe /c nbtstat -a " + ipAddress; - Process p = Runtime.getRuntime().exec(command); - BufferedReader br = - new BufferedReader( - new InputStreamReader(p.getInputStream())); - String line; - while ((line = br.readLine()) != null) { - if (line.indexOf("MAC") > 0) { - int index = line.indexOf("="); - index += 2; - address = line.substring(index); - break; - } - } - br.close(); - return address.trim(); - } catch (IOException e) { - } - } else if (os.startsWith("Linux")) { - StringTokenizer tokenizer = new StringTokenizer(ipAddress, "\n"); - - while (tokenizer.hasMoreTokens()) { - String line = tokenizer.nextToken().trim(); - - // see if line contains MAC address - int macAddressPosition = line.indexOf("HWaddr"); - if (macAddressPosition <= 0) - continue; - - address = line.substring(macAddressPosition + 6) - .trim(); - } - } - - return address; - } - - /** - * 获取节点集合 - * - * @param doc : Doument 对象 - * @param tagName : 节点名 - * @param index : 找到的第几个 - * @return - */ - private static NodeList getNode(Document doc, String tagName, int index) { - return doc.getElementsByTagName(tagName).item(index).getChildNodes(); - } - - /** - * 获取节点内容 - * - * @param node : nodelist - * @param index : 节点索引, 也可使用 getNamedItem(String name) 节点名查找 - * @param item : 属性的索引 - * @return - */ - private static String getAttributeValue(NodeList node, int index, int item) { - return node.item(index).getAttributes().item(item).getNodeValue(); - } - - //*============================================================== - - /** - * 得到字符串的真实长度(汉字算2位) - * - * @param str - * @return - */ - public static int getRealLength(String str) { - int length = 0; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - int ascii = (int) c; - if (ascii >= 0 && ascii <= 127) { - length++; - } else { - length += 2; - } - } - return length; - } - - //*============================================================== - //默认除法运算精度 - private static final int DEF_DIV_SCALE = 10; - //这个类不能实例化 - - /** - * 提供精确的加法运算。 - * - * @param v1 被加数 - * @param v2 加数 - * @return 两个参数的和 - */ - public static double add(double v1, double v2) { - BigDecimal b1 = new BigDecimal(Double.toString(v1)); - BigDecimal b2 = new BigDecimal(Double.toString(v2)); - return b1.add(b2).doubleValue(); - } - - /** - * 提供精确的减法运算。 - * - * @param v1 被减数 - * @param v2 减数 - * @return 两个参数的差 - */ - public static double sub(double v1, double v2) { - BigDecimal b1 = new BigDecimal(Double.toString(v1)); - BigDecimal b2 = new BigDecimal(Double.toString(v2)); - return b1.subtract(b2).doubleValue(); - } - - /** - * 提供精确的乘法运算。 - * - * @param v1 被乘数 - * @param v2 乘数 - * @return 两个参数的积 - */ - public static double mul(double v1, double v2) { - BigDecimal b1 = new BigDecimal(Double.toString(v1)); - BigDecimal b2 = new BigDecimal(Double.toString(v2)); - return b1.multiply(b2).doubleValue(); - } - - /** - * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 - * 小数点以后10位,以后的数字四舍五入。 - * - * @param v1 被除数 - * @param v2 除数 - * @return 两个参数的商 - */ - public static double div(double v1, double v2) { - return div(v1, v2, DEF_DIV_SCALE); - } - - /** - * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 - * 定精度,以后的数字四舍五入。 - * - * @param v1 被除数 - * @param v2 除数 - * @param scale 表示表示需要精确到小数点以后几位。 - * @return 两个参数的商 - */ - public static double div(double v1, double v2, int scale) { - if (scale < 0) { - throw new IllegalArgumentException( - "The scale must be a positive integer or zero"); - } - BigDecimal b1 = new BigDecimal(Double.toString(v1)); - BigDecimal b2 = new BigDecimal(Double.toString(v2)); - return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); - } - - /** - * 提供精确的小数位四舍五入处理。 - * - * @param v 需要四舍五入的数字 - * @param scale 小数点后保留几位 - * @return 四舍五入后的结果 - */ - public static double round(double v, int scale) { - if (scale < 0) { - throw new IllegalArgumentException( - "The scale must be a positive integer or zero"); - } - BigDecimal b = new BigDecimal(Double.toString(v)); - BigDecimal one = new BigDecimal("1"); - return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); - } - - /** - * 保留几位小数 - * - * @param inNumber - * 需要处理的双精度浮点数字 - * @param param - * 小数点后需要保留的位数 - * @return 返回需要保留位数的字符串 - */ - // public static String round(double inNumber, int param) { - // String format = "#."; - // for (int i = 0; i < param; i++) - // format = format.concat("#"); - - // if (param == 0) - // format = format.substring(0, format.toString().length() - 1); - // DecimalFormat df = new DecimalFormat(format); - // return df.format(inNumber); - // } - //*============================================================== - - //*============================================================== - - public static String[] chineseDigits = new String[]{"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; - - /** - * 把金额转换为汉字表示的数量,小数点后四舍五入保留两位 - * - * @param amount - * @return - */ - public static String amountToChinese(double amount) { - - if (amount > 99999999999999.99 || amount < -99999999999999.99) - throw new IllegalArgumentException("参数值超出允许范围 (-99999999999999.99 ~ 99999999999999.99)!"); - - boolean negative = false; - if (amount < 0) { - negative = true; - amount = amount * (-1); - } - - long temp = Math.round(amount * 100); - int numFen = (int) (temp % 10); // 分 - temp = temp / 10; - int numJiao = (int) (temp % 10); //角 - temp = temp / 10; - //temp 目前是金额的整数部分 - - int[] parts = new int[20]; // 其中的元素是把原来金额整数部分分割为值在 0~9999 之间的数的各个部分 - int numParts = 0; // 记录把原来金额整数部分分割为了几个部分(每部分都在 0~9999 之间) - for (int i = 0; ; i++) { - if (temp == 0) - break; - int part = (int) (temp % 10000); - parts[i] = part; - numParts++; - temp = temp / 10000; - } - - boolean beforeWanIsZero = true; // 标志“万”下面一级是不是 0 - - String chineseStr = ""; - for (int i = 0; i < numParts; i++) { - - String partChinese = partTranslate(parts[i]); - if (i % 2 == 0) { - if ("".equals(partChinese)) - beforeWanIsZero = true; - else - beforeWanIsZero = false; - } - - if (i != 0) { - if (i % 2 == 0) - chineseStr = "亿" + chineseStr; - else { - if ("".equals(partChinese) && !beforeWanIsZero) // 如果“万”对应的 part 为 0,而“万”下面一级不为 0,则不加“万”,而加“零” - chineseStr = "零" + chineseStr; - else { - if (parts[i - 1] < 1000 && parts[i - 1] > 0) // 如果"万"的部分不为 0, 而"万"前面的部分小于 1000 大于 0, 则万后面应该跟“零” - chineseStr = "零" + chineseStr; - chineseStr = "万" + chineseStr; - } - } - } - chineseStr = partChinese + chineseStr; - } - - if ("".equals(chineseStr)) // 整数部分为 0, 则表达为"零元" - chineseStr = chineseDigits[0]; - else if (negative) // 整数部分不为 0, 并且原金额为负数 - chineseStr = "负" + chineseStr; - - chineseStr = chineseStr + "元"; - - if (numFen == 0 && numJiao == 0) { - chineseStr = chineseStr + "整"; - } else if (numFen == 0) { // 0 分,角数不为 0 - chineseStr = chineseStr + chineseDigits[numJiao] + "角"; - } else { // “分”数不为 0 - if (numJiao == 0) { - chineseStr = chineseStr + "零" + chineseDigits[numFen] + "分"; - } else { - chineseStr = chineseStr + chineseDigits[numJiao] + "角" + chineseDigits[numFen] + "分"; - } - } - - return chineseStr; - - } - - - /** - * 把一个 0~9999 之间的整数转换为汉字的字符串,如果是 0 则返回 "" - * - * @param amountPart - * @return - */ - private static String partTranslate(int amountPart) { - - if (amountPart < 0 || amountPart > 10000) { - throw new IllegalArgumentException("参数必须是大于等于 0,小于 10000 的整数!"); - } - - - String[] units = new String[]{"", "拾", "佰", "仟"}; - - int temp = amountPart; - - String amountStr = new Integer(amountPart).toString(); - int amountStrLength = amountStr.length(); - boolean lastIsZero = true; //在从低位往高位循环时,记录上一位数字是不是 0 - String chineseStr = ""; - - for (int i = 0; i < amountStrLength; i++) { - if (temp == 0) // 高位已无数据 - break; - int digit = temp % 10; - if (digit == 0) { // 取到的数字为 0 - if (!lastIsZero) //前一个数字不是 0,则在当前汉字串前加“零”字; - chineseStr = "零" + chineseStr; - lastIsZero = true; - } else { // 取到的数字不是 0 - chineseStr = chineseDigits[digit] + units[i] + chineseStr; - lastIsZero = false; - } - temp = temp / 10; - } - return chineseStr; - } - - //十六进制下数字到字符的映射数组 - private final static String[] hexDigits = {"0", "1", "2", "3", "4", - "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}; - - /** - * 把inputString加密 - */ - public static String generatePassword(String inputString) { - return encodeByMD5(inputString); - } - - /** - * 验证输入的密码是否正确 - * - * @param password 加密后的密码 - * @param inputString 输入的字符串 - * @return 验证结果,TRUE:正确 FALSE:错误 - */ - public static boolean validatePassword(String password, String inputString) { - if (password.equals(encodeByMD5(inputString))) { - return true; - } else { - return false; - } - } - /** - * 验证输入的密码是否强密码 - * - * @param password 密码 - * @param min 最小长度 - * @param max 最大长度 - * @return 验证结果,TRUE:正确 FALSE:错误 - */ - public static boolean isStrongPwd(String password,int min, int max) { - Map map = new HashMap(); - for (int i = 0; i < password.length(); i++) { - int A = password.charAt(i); - if (A >= 48 && A <= 57) {// 数字 - map.put("数字", "数字"); - } else if (A >= 65 && A <= 90) {// 大写 - map.put("大写", "大写"); - } else if (A >= 97 && A <= 122) {// 小写 - map.put("小写", "小写"); - } else { - map.put("特殊", "特殊"); - } - } - Set sets = map.keySet(); - int pwdSize = sets.size();// 密码字符种类数 - int pwdLength = password.length();// 密码长度 - if (pwdSize >= 4 && pwdLength >= min && pwdLength <= max) { - return true;// 强密码 - } else { - return false;// 弱密码 - } - } - /** - * 对字符串进行MD5加密 - */ - private static String encodeByMD5(String originString) { - if (originString != null) { - try { - //创建具有指定算法名称的信息摘要 - MessageDigest md = MessageDigest.getInstance("MD5"); - //使用指定的字节数组对摘要进行最后更新,然后完成摘要计算 - byte[] results = md.digest(originString.getBytes()); - //将得到的字节数组变成字符串返回 - String resultString = byteArrayToHexString(results); - return resultString.toUpperCase(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - return null; - } - - /** - * 转换字节数组为十六进制字符串 - * - * @param - * @return 十六进制字符串 - */ - private static String byteArrayToHexString(byte[] b) { - StringBuffer resultSb = new StringBuffer(); - for (int i = 0; i < b.length; i++) { - resultSb.append(byteToHexString(b[i])); - } - return resultSb.toString(); - } - - /** - * 将一个字节转化成十六进制形式的字符串 - */ - private static String byteToHexString(byte b) { - int n = b; - if (n < 0) - n = 256 + n; - int d1 = n / 16; - int d2 = n % 16; - return hexDigits[d1] + hexDigits[d2]; - } - - //*============================================================== - - /** - * @param fileName 文件名 - * @return xml的文本 - * @throws DocumentException - */ - public static org.dom4j.Document read(String fileName) throws DocumentException { - SAXReader reader = new SAXReader(); - org.dom4j.Document document = reader.read(new File(fileName)); - return document; - } - - public static org.dom4j.Document readMemo(String memo) throws DocumentException { - SAXReader reader = new SAXReader(); - org.dom4j.Document document = reader.read(memo); - return document; - } - - /** - * @param doc 文件 - * @return 文件 - */ - public static Element getRootElement(org.dom4j.Document doc) { - return doc.getRootElement(); - } - - //*============================================================== - @SuppressWarnings("unchecked") - private static LinkedHashMap spellMap = null; - - static { - if (spellMap == null) { - spellMap = new LinkedHashMap(400); - } - initialize(); - } - - - private static void spellPut(String spell, int ascii) { - spellMap.put(spell, new Integer(ascii)); - } - - private static void initialize() { - spellPut("a", -20319); - spellPut("ai", -20317); - spellPut("an", -20304); - spellPut("ang", -20295); - spellPut("ao", -20292); - spellPut("ba", -20283); - spellPut("bai", -20265); - spellPut("ban", -20257); - spellPut("bang", -20242); - spellPut("bao", -20230); - spellPut("bei", -20051); - spellPut("ben", -20036); - spellPut("beng", -20032); - spellPut("bi", -20026); - spellPut("bian", -20002); - spellPut("biao", -19990); - spellPut("bie", -19986); - spellPut("bin", -19982); - spellPut("bing", -19976); - spellPut("bo", -19805); - spellPut("bu", -19784); - spellPut("ca", -19775); - spellPut("cai", -19774); - spellPut("can", -19763); - spellPut("cang", -19756); - spellPut("cao", -19751); - spellPut("ce", -19746); - spellPut("ceng", -19741); - spellPut("cha", -19739); - spellPut("chai", -19728); - spellPut("chan", -19725); - spellPut("chang", -19715); - spellPut("chao", -19540); - spellPut("che", -19531); - spellPut("chen", -19525); - spellPut("cheng", -19515); - spellPut("chi", -19500); - spellPut("chong", -19484); - spellPut("chou", -19479); - spellPut("chu", -19467); - spellPut("chuai", -19289); - spellPut("chuan", -19288); - spellPut("chuang", -19281); - spellPut("chui", -19275); - spellPut("chun", -19270); - spellPut("chuo", -19263); - spellPut("ci", -19261); - spellPut("cong", -19249); - spellPut("cou", -19243); - spellPut("cu", -19242); - spellPut("cuan", -19238); - spellPut("cui", -19235); - spellPut("cun", -19227); - spellPut("cuo", -19224); - spellPut("da", -19218); - spellPut("dai", -19212); - spellPut("dan", -19038); - spellPut("dang", -19023); - spellPut("dao", -19018); - spellPut("de", -19006); - spellPut("deng", -19003); - spellPut("di", -18996); - spellPut("dian", -18977); - spellPut("diao", -18961); - spellPut("die", -18952); - spellPut("ding", -18783); - spellPut("diu", -18774); - spellPut("dong", -18773); - spellPut("dou", -18763); - spellPut("du", -18756); - spellPut("duan", -18741); - spellPut("dui", -18735); - spellPut("dun", -18731); - spellPut("duo", -18722); - spellPut("e", -18710); - spellPut("en", -18697); - spellPut("er", -18696); - spellPut("fa", -18526); - spellPut("fan", -18518); - spellPut("fang", -18501); - spellPut("fei", -18490); - spellPut("fen", -18478); - spellPut("feng", -18463); - spellPut("fo", -18448); - spellPut("fou", -18447); - spellPut("fu", -18446); - spellPut("ga", -18239); - spellPut("gai", -18237); - spellPut("gan", -18231); - spellPut("gang", -18220); - spellPut("gao", -18211); - spellPut("ge", -18201); - spellPut("gei", -18184); - spellPut("gen", -18183); - spellPut("geng", -18181); - spellPut("gong", -18012); - spellPut("gou", -17997); - spellPut("gu", -17988); - spellPut("gua", -17970); - spellPut("guai", -17964); - spellPut("guan", -17961); - spellPut("guang", -17950); - spellPut("gui", -17947); - spellPut("gun", -17931); - spellPut("guo", -17928); - spellPut("ha", -17922); - spellPut("hai", -17759); - spellPut("han", -17752); - spellPut("hang", -17733); - spellPut("hao", -17730); - spellPut("he", -17721); - spellPut("hei", -17703); - spellPut("hen", -17701); - spellPut("heng", -17697); - spellPut("hong", -17692); - spellPut("hou", -17683); - spellPut("hu", -17676); - spellPut("hua", -17496); - spellPut("huai", -17487); - spellPut("huan", -17482); - spellPut("huang", -17468); - spellPut("hui", -17454); - spellPut("hun", -17433); - spellPut("huo", -17427); - spellPut("ji", -17417); - spellPut("jia", -17202); - spellPut("jian", -17185); - spellPut("jiang", -16983); - spellPut("jiao", -16970); - spellPut("jie", -16942); - spellPut("jin", -16915); - spellPut("jing", -16733); - spellPut("jiong", -16708); - spellPut("jiu", -16706); - spellPut("ju", -16689); - spellPut("juan", -16664); - spellPut("jue", -16657); - spellPut("jun", -16647); - spellPut("ka", -16474); - spellPut("kai", -16470); - spellPut("kan", -16465); - spellPut("kang", -16459); - spellPut("kao", -16452); - spellPut("ke", -16448); - spellPut("ken", -16433); - spellPut("keng", -16429); - spellPut("kong", -16427); - spellPut("kou", -16423); - spellPut("ku", -16419); - spellPut("kua", -16412); - spellPut("kuai", -16407); - spellPut("kuan", -16403); - spellPut("kuang", -16401); - spellPut("kui", -16393); - spellPut("kun", -16220); - spellPut("kuo", -16216); - spellPut("la", -16212); - spellPut("lai", -16205); - spellPut("lan", -16202); - spellPut("lang", -16187); - spellPut("lao", -16180); - spellPut("le", -16171); - spellPut("lei", -16169); - spellPut("leng", -16158); - spellPut("li", -16155); - spellPut("lia", -15959); - spellPut("lian", -15958); - spellPut("liang", -15944); - spellPut("liao", -15933); - spellPut("lie", -15920); - spellPut("lin", -15915); - spellPut("ling", -15903); - spellPut("liu", -15889); - spellPut("long", -15878); - spellPut("lou", -15707); - spellPut("lu", -15701); - spellPut("lv", -15681); - spellPut("luan", -15667); - spellPut("lue", -15661); - spellPut("lun", -15659); - spellPut("luo", -15652); - spellPut("ma", -15640); - spellPut("mai", -15631); - spellPut("man", -15625); - spellPut("mang", -15454); - spellPut("mao", -15448); - spellPut("me", -15436); - spellPut("mei", -15435); - spellPut("men", -15419); - spellPut("meng", -15416); - spellPut("mi", -15408); - spellPut("mian", -15394); - spellPut("miao", -15385); - spellPut("mie", -15377); - spellPut("min", -15375); - spellPut("ming", -15369); - spellPut("miu", -15363); - spellPut("mo", -15362); - spellPut("mou", -15183); - spellPut("mu", -15180); - spellPut("na", -15165); - spellPut("nai", -15158); - spellPut("nan", -15153); - spellPut("nang", -15150); - spellPut("nao", -15149); - spellPut("ne", -15144); - spellPut("nei", -15143); - spellPut("nen", -15141); - spellPut("neng", -15140); - spellPut("ni", -15139); - spellPut("nian", -15128); - spellPut("niang", -15121); - spellPut("niao", -15119); - spellPut("nie", -15117); - spellPut("nin", -15110); - spellPut("ning", -15109); - spellPut("niu", -14941); - spellPut("nong", -14937); - spellPut("nu", -14933); - spellPut("nv", -14930); - spellPut("nuan", -14929); - spellPut("nue", -14928); - spellPut("nuo", -14926); - spellPut("o", -14922); - spellPut("ou", -14921); - spellPut("pa", -14914); - spellPut("pai", -14908); - spellPut("pan", -14902); - spellPut("pang", -14894); - spellPut("pao", -14889); - spellPut("pei", -14882); - spellPut("pen", -14873); - spellPut("peng", -14871); - spellPut("pi", -14857); - spellPut("pian", -14678); - spellPut("piao", -14674); - spellPut("pie", -14670); - spellPut("pin", -14668); - spellPut("ping", -14663); - spellPut("po", -14654); - spellPut("pu", -14645); - spellPut("qi", -14630); - spellPut("qia", -14594); - spellPut("qian", -14429); - spellPut("qiang", -14407); - spellPut("qiao", -14399); - spellPut("qie", -14384); - spellPut("qin", -14379); - spellPut("qing", -14368); - spellPut("qiong", -14355); - spellPut("qiu", -14353); - spellPut("qu", -14345); - spellPut("quan", -14170); - spellPut("que", -14159); - spellPut("qun", -14151); - spellPut("ran", -14149); - spellPut("rang", -14145); - spellPut("rao", -14140); - spellPut("re", -14137); - spellPut("ren", -14135); - spellPut("reng", -14125); - spellPut("ri", -14123); - spellPut("rong", -14122); - spellPut("rou", -14112); - spellPut("ru", -14109); - spellPut("ruan", -14099); - spellPut("rui", -14097); - spellPut("run", -14094); - spellPut("ruo", -14092); - spellPut("sa", -14090); - spellPut("sai", -14087); - spellPut("san", -14083); - spellPut("sang", -13917); - spellPut("sao", -13914); - spellPut("se", -13910); - spellPut("sen", -13907); - spellPut("seng", -13906); - spellPut("sha", -13905); - spellPut("shai", -13896); - spellPut("shan", -13894); - spellPut("shang", -13878); - spellPut("shao", -13870); - spellPut("she", -13859); - spellPut("shen", -13847); - spellPut("sheng", -13831); - spellPut("shi", -13658); - spellPut("shou", -13611); - spellPut("shu", -13601); - spellPut("shua", -13406); - spellPut("shuai", -13404); - spellPut("shuan", -13400); - spellPut("shuang", -13398); - spellPut("shui", -13395); - spellPut("shun", -13391); - spellPut("shuo", -13387); - spellPut("si", -13383); - spellPut("song", -13367); - spellPut("sou", -13359); - spellPut("su", -13356); - spellPut("suan", -13343); - spellPut("sui", -13340); - spellPut("sun", -13329); - spellPut("suo", -13326); - spellPut("ta", -13318); - spellPut("tai", -13147); - spellPut("tan", -13138); - spellPut("tang", -13120); - spellPut("tao", -13107); - spellPut("te", -13096); - spellPut("teng", -13095); - spellPut("ti", -13091); - spellPut("tian", -13076); - spellPut("tiao", -13068); - spellPut("tie", -13063); - spellPut("ting", -13060); - spellPut("tong", -12888); - spellPut("tou", -12875); - spellPut("tu", -12871); - spellPut("tuan", -12860); - spellPut("tui", -12858); - spellPut("tun", -12852); - spellPut("tuo", -12849); - spellPut("wa", -12838); - spellPut("wai", -12831); - spellPut("wan", -12829); - spellPut("wang", -12812); - spellPut("wei", -12802); - spellPut("wen", -12607); - spellPut("weng", -12597); - spellPut("wo", -12594); - spellPut("wu", -12585); - spellPut("xi", -12556); - spellPut("xia", -12359); - spellPut("xian", -12346); - spellPut("xiang", -12320); - spellPut("xiao", -12300); - spellPut("xie", -12120); - spellPut("xin", -12099); - spellPut("xing", -12089); - spellPut("xiong", -12074); - spellPut("xiu", -12067); - spellPut("xu", -12058); - spellPut("xuan", -12039); - spellPut("xue", -11867); - spellPut("xun", -11861); - spellPut("ya", -11847); - spellPut("yan", -11831); - spellPut("yang", -11798); - spellPut("yao", -11781); - spellPut("ye", -11604); - spellPut("yi", -11589); - spellPut("yin", -11536); - spellPut("ying", -11358); - spellPut("yo", -11340); - spellPut("yong", -11339); - spellPut("you", -11324); - spellPut("yu", -11303); - spellPut("yuan", -11097); - spellPut("yue", -11077); - spellPut("yun", -11067); - spellPut("za", -11055); - spellPut("zai", -11052); - spellPut("zan", -11045); - spellPut("zang", -11041); - spellPut("zao", -11038); - spellPut("ze", -11024); - spellPut("zei", -11020); - spellPut("zen", -11019); - spellPut("zeng", -11018); - spellPut("zha", -11014); - spellPut("zhai", -10838); - spellPut("zhan", -10832); - spellPut("zhang", -10815); - spellPut("zhao", -10800); - spellPut("zhe", -10790); - spellPut("zhen", -10780); - spellPut("zheng", -10764); - spellPut("zhi", -10587); - spellPut("zhong", -10544); - spellPut("zhou", -10533); - spellPut("zhu", -10519); - spellPut("zhua", -10331); - spellPut("zhuai", -10329); - spellPut("zhuan", -10328); - spellPut("zhuang", -10322); - spellPut("zhui", -10315); - spellPut("zhun", -10309); - spellPut("zhuo", -10307); - spellPut("zi", -10296); - spellPut("zong", -10281); - spellPut("zou", -10274); - spellPut("zu", -10270); - spellPut("zuan", -10262); - spellPut("zui", -10260); - spellPut("zun", -10256); - spellPut("zuo", -10254); - } - - - public static Integer getCnAscii(char cn) { - byte[] bytes = (String.valueOf(cn)).getBytes(); - if (bytes == null || bytes.length > 2 || bytes.length <= 0) { //错误 - return 0; - } - if (bytes.length == 1) { //英文字符 - return Integer.parseInt(bytes[0] + ""); - } - if (bytes.length == 2) { //中文字符 - int hightByte = 256 + bytes[0]; - int lowByte = 256 + bytes[1]; - - int ascii = (256 * hightByte + lowByte) - 256 * 256; - - // System.out.println("ASCII=" + ascii); - - return ascii; - } - - return 0; //错误 - } - - - public static String getSpellByAscii(int ascii) { - if (ascii > 0 && ascii < 160) { //单字符 - return String.valueOf((char) ascii); - } - - if (ascii < -20319 || ascii > -10247) { //不知道的字符 - return null; - } - - Set keySet = spellMap.keySet(); - Iterator it = keySet.iterator(); - - String spell0 = null; - ; - String spell = null; - - int asciiRang0 = -20319; - int asciiRang; - while (it.hasNext()) { - - spell = (String) it.next(); - Object valObj = spellMap.get(spell); - if (valObj instanceof Integer) { - asciiRang = ((Integer) valObj).intValue(); - - if (ascii >= asciiRang0 && ascii < asciiRang) { //区间找到 - return (spell0 == null) ? spell : spell0; - } else { - spell0 = spell; - asciiRang0 = asciiRang; - } - } - } - - return null; - - } - - - public static String getFullSpell(String cnStr) { - if (null == cnStr || "".equals(cnStr.trim())) { - return cnStr; - } - - char[] chars = cnStr.toCharArray(); - StringBuffer retuBuf = new StringBuffer(); - for (int i = 0, Len = chars.length; i < Len; i++) { - int ascii = getCnAscii(chars[i]); - if (ascii == 0) { //取ascii时出错 - retuBuf.append(chars[i]); - } else { - String spell = getSpellByAscii(ascii); - if (spell == null) { - retuBuf.append(chars[i]); - } else { - retuBuf.append(spell); - } // end of if spell == null - } // end of if ascii <= -20400 - } // end of for - - return retuBuf.toString(); - } - - public static String getFirstSpell(String cnStr) { - return null; - } - - /** - * 从一个JSON 对象字符格式中得到一个java对象 - * - * @param jsonString - * @param pojoCalss - * @return - */ - @SuppressWarnings("unchecked") - public static Object getObject4JsonString(String jsonString, Class pojoCalss) { - Object pojo; - JSONObject jsonObject = JSONObject.fromObject(jsonString); - pojo = JSONObject.toBean(jsonObject, pojoCalss); - return pojo; - } - - - /** - * 从 json HASH表达式中获取一个map,改map支持嵌套功能 - * - * @param jsonString - * @return - */ - @SuppressWarnings("unchecked") - public static Map getMap4Json(String jsonString) { - JSONObject jsonObject = JSONObject.fromObject(jsonString); - Iterator keyIter = jsonObject.keys(); - String key; - Object value; - Map valueMap = new HashMap(); - - while (keyIter.hasNext()) { - key = (String) keyIter.next(); - value = jsonObject.get(key); - valueMap.put(key, value); - } - - return valueMap; - } - - - /** - * 从 json数组中得到相应java数组 - * - * @param jsonString - * @return - */ - public static Object[] getObjectArray4Json(String jsonString) { - JSONArray jsonArray = JSONArray.fromObject(jsonString); - return jsonArray.toArray(); - - } - - - /** - * 从 json对象集合表达式中得到一个java对象列表 - * - * @param jsonString - * @param pojoClass - * @return - */ - @SuppressWarnings("unchecked") - public static List getList4Json(String jsonString, Class pojoClass) { - - JSONArray jsonArray = JSONArray.fromObject(jsonString); - JSONObject jsonObject; - Object pojoValue; - - List list = new ArrayList(); - for (int i = 0; i < jsonArray.size(); i++) { - - jsonObject = jsonArray.getJSONObject(i); - pojoValue = JSONObject.toBean(jsonObject, pojoClass); - list.add(pojoValue); - - } - return list; - - } - - - /** - * 从 json数组中解析出java字符串数组 - * - * @param jsonString - * @return - */ - public static String[] getStringArray4Json(String jsonString) { - - JSONArray jsonArray = JSONArray.fromObject(jsonString); - String[] stringArray = new String[jsonArray.size()]; - for (int i = 0; i < jsonArray.size(); i++) { - stringArray[i] = jsonArray.getString(i); - - } - - return stringArray; - } - - - /** - * 从 json数组中解析出javaLong型对象数组 - * - * @param jsonString - * @return - */ - public static Long[] getLongArray4Json(String jsonString) { - - JSONArray jsonArray = JSONArray.fromObject(jsonString); - Long[] longArray = new Long[jsonArray.size()]; - for (int i = 0; i < jsonArray.size(); i++) { - longArray[i] = jsonArray.getLong(i); - - } - return longArray; - } - - - /** - * 从 json数组中解析出java Integer型对象数组 - * - * @param jsonString - * @return - */ - public static Integer[] getIntegerArray4Json(String jsonString) { - - JSONArray jsonArray = JSONArray.fromObject(jsonString); - Integer[] integerArray = new Integer[jsonArray.size()]; - for (int i = 0; i < jsonArray.size(); i++) { - integerArray[i] = jsonArray.getInt(i); - - } - return integerArray; - } - - /** - * 从 json数组中解析出java Integer型对象数组 - * - * @param jsonString - * @return - */ - public static Double[] getDoubleArray4Json(String jsonString) { - - JSONArray jsonArray = JSONArray.fromObject(jsonString); - Double[] doubleArray = new Double[jsonArray.size()]; - for (int i = 0; i < jsonArray.size(); i++) { - doubleArray[i] = jsonArray.getDouble(i); - - } - return doubleArray; - } - - - /** - * 解决由于精度问题引起两个数相乘出现计算结果有偏差(2011-10-29 snd) - * - * @param number1 - * @param number2 - * @return - */ - public static double doubleMultiply(double number1, double number2) { - double resultnumber = 0; - - BigDecimal numb1 = new BigDecimal(Double.toString(number1)); - BigDecimal numb2 = new BigDecimal(Double.toString(number2)); - - resultnumber = numb1.multiply(numb2).doubleValue(); - - return resultnumber; - } - - /** - * 把HH:mm格式的字符串转化成小数,用于excel模板中格式设置为[h]:mm的求运行小时的应用 - * - * @param str - * @return - */ - public static double getstrtodouble(String str) { - double temp = 0; - String[] strarray = str.split(":"); - temp = (Double.parseDouble(strarray[0]) * 60 + Double.parseDouble(strarray[1])) / (60 * 24); - return temp; - } - - /** - * 根据输入的年份,获得前10年和后10年 - * - * @param nowyear - * @return - */ - public static ArrayList yearlist(String nowyear) { - ArrayList array = new ArrayList(); - int startyear = Integer.valueOf(nowyear) - 10; - int endyear = Integer.valueOf(nowyear) + 10; - for (int i = startyear; i <= endyear; i++) { - array.add(String.valueOf(i)); - } - - return array; - } - - public static double myRound(double d, int n) { - d = d * Math.pow(10, n); - d += 0.5d; - d = (long) d; - d = d / Math.pow(10d, n); - return d; - - } - - /* - * 不同类属性间赋值,只能用于Entity的复制-wxp - * */ - public static void Copy(Object source, Object dest) throws Exception { - // 获取属性 - BeanInfo sourceBean = Introspector.getBeanInfo(source.getClass(), java.lang.Object.class); - PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors(); - - BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(), java.lang.Object.class); - PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors(); - - try { - for (int i = 0; i < sourceProperty.length; i++) { - for (int j = 0; j < destProperty.length; j++) { - if (sourceProperty[i].getName().equals(destProperty[j].getName())) { - // 调用source的getter方法和dest的setter方法 - destProperty[j].getWriteMethod().invoke(dest, sourceProperty[i].getReadMethod().invoke(source)); - break; - } - } - } - } catch (Exception e) { - throw new Exception("属性复制失败:" + e.getMessage()); - } - } - - /** - * 检查前台框架请求-wxp - * true为angular - */ - public static boolean checkFrontEnd(HttpServletRequest request) { - // 获取属性 - if (request.getParameter("ng") == null) { - return false; - } else { - return true; - } - } - - /** - * 检查其它系统权限-wxp - * true为angular - */ - public static boolean checkExtSystem(HttpServletRequest request) { - // 获取属性 - if (request.getParameter("ext") == null) { - return false; - } else { - request.setAttribute("extFlag", true); - return true; - } - } - - /* - * 按部署时间和安排的分钟得到设备确切的安排时间 - * */ - public static EquipmentArrangement getRealTime4EuipArrangement(EquipmentArrangement equipmentArrangement) { - String arrangedate = equipmentArrangement.getArrangementdate(); - String stdt = equipmentArrangement.getStdt(); - String enddt = equipmentArrangement.getEnddt(); - - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm"); - SimpleDateFormat dfd = new SimpleDateFormat("yyyy-MM-dd"); - try { - //若stdt和enddt时间大于arrangedate,则不需要修改时间 - if (dfd.parse(arrangedate).getTime() > df.parse(stdt).getTime()) { - stdt = arrangedate.substring(0, 10) + stdt.substring(10, 16); - } - if (dfd.parse(arrangedate).getTime() > df.parse(enddt).getTime()) { - enddt = arrangedate.substring(0, 10) + enddt.substring(10, 16); - } - Date dt1 = df.parse(stdt); - Date dt2 = df.parse(enddt); - if (dt1.getTime() > dt2.getTime()) { - Calendar calendar = new GregorianCalendar(); - calendar.setTime(dt2); - calendar.add(calendar.DATE, 1);//把日期往后增加一天.整数往后推,负数往前移动 - dt2 = calendar.getTime(); //这个时间就是日期往后推一天的结果 - enddt = df.format(dt2); - } - - } catch (Exception exception) { - exception.printStackTrace(); - } - equipmentArrangement.setStdt(stdt); - equipmentArrangement.setEnddt(enddt); - return equipmentArrangement; - - } - - public static String getEncoding(String str) { - String encode = "GB2312"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是GB2312 - String s = encode; - return s; // 是的话,返回GB2312,以下代码同理 - } - } catch (Exception e) { - //logger.error("getEncoding异常---GB2312", e); - } - encode = "ISO-8859-1"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是ISO-8859-1 - String s1 = encode; - return s1; - } - } catch (Exception e) { - //logger.error("getEncoding异常---ISO-8859-1", e); - } - encode = "UTF-8"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是UTF-8编码 - String s2 = encode; - return s2; - } - } catch (Exception e) { - //logger.error("getEncoding异常---UTF-8", e); - } - encode = "GBK"; - try { - if (str.equals(new String(str.getBytes(encode), encode))) { // 判断是不是GBK - String s3 = encode; - return s3; - } - } catch (Exception e) { - //logger.error("getEncoding异常---GBK", e); - } - return ""; // 到这一步,你就应该检查是不是其他编码啦 - } - - /** - * 字符串的压缩 - * - * @param str 待压缩的字符串 - * @return 返回压缩后的字符串 - * @throws IOException - */ - public static String GZIPcompress(String str) throws IOException { - if (null == str || str.length() <= 0) { - return str; - } - // 创建一个新的输出流 - ByteArrayOutputStream out = new ByteArrayOutputStream(); - // 使用默认缓冲区大小创建新的输出流 - GZIPOutputStream gzip = new GZIPOutputStream(out); - // 将字节写入此输出流 - gzip.write(str.getBytes("utf-8")); //因为后台默认字符集有可能是GBK字符集,所以此处需指定一个字符集 - gzip.close(); - // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 - //out.toString("ISO-8859-1"); - byte[] encodeBase64 = Base64.encodeBase64(out.toByteArray()); - return new String(encodeBase64, "ISO-8859-1"); - } - - /** - * 字符串的解压 - * - * @param str 对字符串解压 - * @return 返回解压缩后的字符串 - * @throws IOException - */ - public static String unGZIPCompress(String str) throws IOException { - if (null == str || str.length() <= 0) { - return str; - } - byte[] decodeBase64 = Base64.decodeBase64(str.getBytes("ISO-8859-1")); - // 创建一个新的输出流 - ByteArrayOutputStream out = new ByteArrayOutputStream(); - // 创建一个 ByteArrayInputStream,使用 buf 作为其缓冲区数组 - ByteArrayInputStream in = new ByteArrayInputStream(decodeBase64); - // 使用默认缓冲区大小创建新的输入流 - GZIPInputStream gzip = new GZIPInputStream(in); - byte[] buffer = new byte[256]; - int n = 0; - - // 将未压缩数据读入字节数组 - while ((n = gzip.read(buffer)) >= 0) { - out.write(buffer, 0, n); - } - // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 - return out.toString("utf-8"); - } - - public static boolean checkResponse(Map result) { - if (result != null && result.containsKey("suc") && result.get("suc").equals(true)) { - return true; - } else { - return false; - } - } - - public static String getResponseMsg(Map result) { - if (result != null && result.containsKey("msg") && result.get("msg") != null) { - return result.get("msg").toString(); - } else { - return ""; - } - } - - /** - * JSON字符串特殊字符处理,比如:“\A1;1300” - * - * @param s - * @return String - */ - public static String string2Json(String s) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - switch (c) { - case '\"': - sb.append("\\\""); - break; - case '\\': - sb.append("\\\\"); - break; - case '/': - sb.append("\\/"); - break; - case '\b': - sb.append("\\b"); - break; - case '\f': - sb.append("\\f"); - break; - case '\n': - sb.append("\\n"); - break; - case '\r': - sb.append("\\r"); - break; - case '\t': - sb.append("\\t"); - break; - default: - sb.append(c); - } - } - return sb.toString(); - } - - /** - * sql违法字符筛选 - * - * @param str - * @return - */ - public static boolean sql_inj(String str) { - String inj_str = "insert|master|truncate|declare|script"; - /*String inj_str = "exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|script";*/ - String inj_stra[] = inj_str.split("\\|"); - for (int i = 0; i < inj_stra.length; i++) { - if (str.indexOf(inj_stra[i]) >= 0) { - System.out.println("未通过验证的参数:"+inj_stra[i]); - return true; - } - } - return false; - } - - //效验 - public static boolean sqlValidate(String url, List strList) { - if (url.indexOf("getMinioDirectFileList") >= 0) { - return false; - } - //userForSelectByCompany - String badStr = "'execute|insert|master|truncate|" + - "declare|sitename|net user|xp_cmdshell|" + - "from|grant|group_concat|column_name|" + - "information_schema.columns|table_schema|union|¥|…|…";//过滤掉的sql关键字,可以手动添加 - /*String badStr = "'|and|exec|execute|insert|select|delete|update|count|drop|chr|mid|master|truncate|" + - "char|declare|sitename|net user|xp_cmdshell|or|like'|and|exec|execute|insert|create|drop|" + - "table|from|grant|use|group_concat|column_name|" + -// "information_schema.columns|table_schema|union|where|select|order|by|" + - "information_schema.columns|table_schema|union|where|select|order|" + - "chr|mid|master|truncate|char|declare|or|like|//|/";//过滤掉的sql关键字,可以手动添加*/ - String[] badStrs = badStr.split("\\|"); - for (String str : strList) { - str = str.toLowerCase();//统一转为小写 - for (int i = 0; i < badStrs.length; i++) { - if (str.contains(badStrs[i])) { - System.out.println("未通过验证的参数:"+badStrs[i]); - //if (str.equals(badStrs[i])) { - return true; - } - } - } - return false; - } - - /** - * 过滤请求参数 - * - * @param request - * @return - */ - public static boolean filterRequestParameter(HttpServletRequest request) { - Map parameterMap = request.getParameterMap(); - for (Entry entry : parameterMap.entrySet()) { - String[] value = (String[]) entry.getValue(); - for (String str : value) { - boolean result = sql_inj(str); - if (result) { - return result; - } - } - } - return false; - } - - /** - * 接口返回结果json处理 - * - * @param result - * @return - * @throws Exception - */ - public static String toJson(Object result) { - - String json = JSON.toJSONString(result, - SerializerFeature.WriteMapNullValue, -// SerializerFeature.WriteNullNumberAsZero, - SerializerFeature.WriteNullListAsEmpty, - SerializerFeature.WriteNullStringAsEmpty, - SerializerFeature.WriteNullBooleanAsFalse, - SerializerFeature.DisableCircularReferenceDetect); - return json; - } - - /** - * 根据 年 月 获取对应的月份 天数 2019-12-30 sj - */ - public static int getDaysByYearMonth(int year, int month) { - Calendar a = Calendar.getInstance(); - a.set(Calendar.YEAR, year); - a.set(Calendar.MONTH, month - 1); - a.set(Calendar.DATE, 1); - a.roll(Calendar.DATE, -1); - int maxDate = a.get(Calendar.DATE); - return maxDate; - } - - /** - * 获取过去或者未来 任意天内的日期数组 2021-12-16 sj - * - * @param intervals intervals天内 - * @return 日期数组 - */ - public static ArrayList getDays4PastOrFuture(int intervals) { - ArrayList pastDaysList = new ArrayList<>(); - ArrayList futureDaysList = new ArrayList<>(); - for (int i = 0; i < intervals; i++) { - pastDaysList.add(getPastDate(i)); - futureDaysList.add(getFutureDate(i)); - } - return pastDaysList; - } - - /** - * 获取过去第几天的日期 - * - * @param past - * @return - */ - public static String getPastDate(int past) { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - past); - Date today = calendar.getTime(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String result = format.format(today); - return result; - } - - /** - * 获取未来 第 past 天的日期 - * - * @param past - * @return - */ - public static String getFutureDate(int past) { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + past); - Date today = calendar.getTime(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String result = format.format(today); - return result; - } - - /** - * 该方法用来将Excel中的ABCD列转换成具体的数据 - * - * @param column:ABCD列名称 - * @return integer:将字母列名称转换成数字 - **/ - public static int excelColStrToNum(String column) { - int num = 0; - int result = 0; - int length = column.length(); - for (int i = 0; i < length; i++) { - char ch = column.charAt(length - i - 1); - num = (int) (ch - 'A' + 1); - num *= Math.pow(26, i); - result += num; - } - return result; - } - - /** - * 报表生成功能中的报表名不包含文件后缀,在minio存储时需要额外增加 - * - * @param rptName - * @return - */ - public static String fixRptCreateFileName(String rptName) { - return rptName + ".xls"; - } - - - /** - * 将字符串时间格式转换成Date时间格式,参数String类型 - * 比如字符串时间:"2017-12-15 21:49:03" - * 转换后的date时间:Fri Dec 15 21:49:03 CST 2017 - * - * @param datetime 类型为String - * @return - */ - public static Date StringToDate(String datetime) { - SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(); - try { - date = sdFormat.parse(datetime); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return date; - } - - /** - * 中文转gb2312 - */ - public static StringBuilder strToGb2312(String str) throws IOException { - String gb = "要转换的字符串"; - byte[] bytes = gb.getBytes("gb2312");// 先把字符串按gb2312转成byte数组 - StringBuilder gbString = new StringBuilder(); - for (byte b : bytes)// 循环数组 - { - String temp = Integer.toHexString(b);// 再用Integer中的方法,把每个byte转换成16进制输出 - temp = temp.substring(6, 8); // 截取 - gbString.append("%" + temp); - } - - return gbString; - } - - /** - * 实时获取天气信息 - * - * @param city - * @return {nowTemp:当前气温,highTemp:最高气温,lowTemp:最低气温,wind:风向,windPower:风力,weather:天气} - * @throws IOException - */ - public static String getWeather(String city) throws IOException { - System.out.println("进入天气方法。"); - String urlString = URLEncoder.encode(city, "utf-8"); - URL url = new URL("http://wthrcdn.etouch.cn/weather_mini?city=" + urlString); - URLConnection open = url.openConnection(); - HttpURLConnection connection = (HttpURLConnection) open; - int code = connection.getResponseCode(); - System.out.println("天气接口code:" + code); - InputStream input = new GZIPInputStream(open.getInputStream()); - String result = org.apache.commons.io.IOUtils.toString(input, "UTF-8"); - System.out.println("天气接口返回值:" + result); - JSONObject jsonObject = JSONObject.fromObject(result); - JSONArray jsonArray = JSONArray.fromObject(jsonObject.opt("data")); - JSONObject jsonObject2 = JSONObject.fromObject(jsonArray.get(0)); - String nowtemp = jsonObject2.opt("wendu").toString(); - JSONArray jsonArray2 = JSONArray.fromObject(jsonObject2.opt("forecast")); - JSONObject jsonObject_today = (JSONObject) jsonArray2.get(1); - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("nowTemp", nowtemp); - jsonObject3.put("highTemp", jsonObject_today.opt("high")); - jsonObject3.put("lowTemp", jsonObject_today.opt("low")); - jsonObject3.put("wind", jsonObject_today.opt("fengxiang")); - String windPower = jsonObject_today.opt("fengli").toString(); - windPower = windPower.replace("", ""); - jsonObject3.put("windPower", windPower); - jsonObject3.put("weather", jsonObject_today.opt("type")); - System.out.println("天气数据:" + jsonObject3.toString()); - return jsonObject3.toString(); - } - - /** - * 设置代理 - * - * @param proxyHost - * @param proxyPort - * @param scheme - * @return - */ - public static CloseableHttpClient setHttpClientProxy(String proxyHost, Integer proxyPort, String scheme) { - - //设置代理IP、端口 - HttpHost proxy = new HttpHost(proxyHost, proxyPort, scheme); - DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy); - CloseableHttpClient httpclient = HttpClients.custom() - .setRoutePlanner(routePlanner) - .build(); - return httpclient; - } - - /** - * 实时获取天气信息HTTP - * - * @param city - * @return {nowTemp:当前气温,highTemp:最高气温,lowTemp:最低气温,wind:风向,windPower:风力,weather:天气} - * @throws IOException - */ - public static String getWeatherHTTP(String city) { - System.out.println("进入天气方法。"); - String listUrl = "http://wthrcdn.etouch.cn/weather_mini"; - String urlString = city; - /*try { - urlString = URLEncoder.encode(city, "utf-8"); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - logger.error("天气接口异常",e); - System.out.println("请求异常,异常信息:" + e.getMessage()); - }*/ - URIBuilder uriBuilder = null; - try { - uriBuilder = new URIBuilder(listUrl); - uriBuilder.addParameter("city", urlString); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - String response = ""; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - // 设置了代理协议就认为是开启了代理 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //是否使用代理 - String proxyStatus = properties.getProperty("proxyStatus"); - //代理ip - String proxyHost = properties.getProperty("proxyHost"); - //代理端口 - String proxyPort = properties.getProperty("proxyPort"); - //代理协议 - String proxyScheme = properties.getProperty("proxyScheme"); - if (Boolean.parseBoolean(proxyStatus)) { - httpclient = setHttpClientProxy(proxyHost, Integer.valueOf(proxyPort), proxyScheme); - } else { - httpclient = HttpClients.createDefault(); - } - logger.info("天气URL--------" + uriBuilder.build().toString()); - HttpGet httpGet = new HttpGet(uriBuilder.build()); // 设置请求头信息 - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpresponse = httpclient.execute(httpGet); - if (httpresponse.getStatusLine().getStatusCode() == 200) { - response = EntityUtils.toString(httpresponse.getEntity(), "UTF-8"); - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } - //System.out.println("天气接口返回值:"+response); - String result = ""; - if (response != null && !response.isEmpty()) { - - JSONObject jsonObject = JSONObject.fromObject(response); - JSONArray jsonArray = JSONArray.fromObject(jsonObject.opt("data")); - JSONObject jsonObject2 = JSONObject.fromObject(jsonArray.get(0)); - String nowtemp = jsonObject2.opt("wendu").toString(); - JSONArray jsonArray2 = JSONArray.fromObject(jsonObject2.opt("forecast")); - JSONObject jsonObject_today = (JSONObject) jsonArray2.get(1); - JSONObject jsonObject3 = new JSONObject(); - jsonObject3.put("nowTemp", nowtemp); - jsonObject3.put("highTemp", jsonObject_today.opt("high")); - jsonObject3.put("lowTemp", jsonObject_today.opt("low")); - jsonObject3.put("wind", jsonObject_today.opt("fengxiang")); - String windPower = jsonObject_today.opt("fengli").toString(); - windPower = windPower.replace("", ""); - jsonObject3.put("windPower", windPower); - jsonObject3.put("weather", jsonObject_today.opt("type")); - //System.out.println("天气数据:"+jsonObject3.toString()); - result = jsonObject3.toString(); - } - return result; - } - - /** - * 实时获取和风天气信息HTTP - * - * @param city - * @return {nowTemp:当前气温,highTemp:最高气温,lowTemp:最低气温,wind:风向,windPower:风力,weather:天气} - * @throws IOException - */ - public static String getQWeatherHTTP(String city) { - System.out.println("进入天气方法。"); - //先查询城市locationID - String listUrl = "https://geoapi.qweather.com/v2/city/lookup?key=e8eacc6f976049518bd41764c04b25d9"; - String urlString = city; - URIBuilder uriBuilder = null; - try { - uriBuilder = new URIBuilder(listUrl); - uriBuilder.addParameter("location", urlString); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - String response = ""; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - // 设置了代理协议就认为是开启了代理 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //是否使用代理 - String proxyStatus = properties.getProperty("proxyStatus"); - //代理ip - String proxyHost = properties.getProperty("proxyHost"); - //代理端口 - String proxyPort = properties.getProperty("proxyPort"); - //代理协议 - String proxyScheme = properties.getProperty("proxyScheme"); - if (Boolean.parseBoolean(proxyStatus)) { - httpclient = setHttpClientProxy(proxyHost, Integer.valueOf(proxyPort), proxyScheme); - } else { - httpclient = HttpClients.createDefault(); - } - HttpGet httpGet = new HttpGet(uriBuilder.build()); // 设置请求头信息 - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpresponse = httpclient.execute(httpGet); - if (httpresponse.getStatusLine().getStatusCode() == 200) { - response = EntityUtils.toString(httpresponse.getEntity(), "UTF-8"); - } - } catch (Exception ex) { - logger.error("城市接口异常", ex); - System.out.println("城市请求异常,异常信息:" + ex.getMessage()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception ex) { - logger.error("城市接口异常", ex); - System.out.println("城市请求异常,异常信息:" + ex.getMessage()); - } - String result = ""; - if (response != null && !response.isEmpty()) { - - JSONObject jsonObject = JSONObject.fromObject(response); - JSONArray jsonArray = JSONArray.fromObject(jsonObject.opt("location")); - if (jsonArray.size() > 0) { - JSONObject jsonObject2 = JSONObject.fromObject(jsonArray.get(0)); - String location = jsonObject2.opt("id").toString(); - //再查询城市实时天气 - listUrl = "https://devapi.qweather.com/v7/weather/now?key=e8eacc6f976049518bd41764c04b25d9"; - try { - uriBuilder = new URIBuilder(listUrl); - uriBuilder.addParameter("location", location); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - response = ""; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - // 设置了代理协议就认为是开启了代理 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //是否使用代理 - String proxyStatus = properties.getProperty("proxyStatus"); - //代理ip - String proxyHost = properties.getProperty("proxyHost"); - //代理端口 - String proxyPort = properties.getProperty("proxyPort"); - //代理协议 - String proxyScheme = properties.getProperty("proxyScheme"); - if (Boolean.parseBoolean(proxyStatus)) { - httpclient = setHttpClientProxy(proxyHost, Integer.valueOf(proxyPort), proxyScheme); - } else { - httpclient = HttpClients.createDefault(); - } - HttpGet httpGet = new HttpGet(uriBuilder.build()); // 设置请求头信息 - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpresponse = httpclient.execute(httpGet); - if (httpresponse.getStatusLine().getStatusCode() == 200) { - response = EntityUtils.toString(httpresponse.getEntity(), "UTF-8"); - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } - } - - if (response != null && !response.isEmpty()) { - jsonObject = JSONObject.fromObject(response); - JSONObject now = JSONObject.fromObject(jsonObject.opt("now")); - JSONObject resultJson = new JSONObject(); - resultJson.put("temp", now.opt("temp")); - resultJson.put("windDir", now.opt("windDir")); - resultJson.put("windScale", now.opt("windScale")); - resultJson.put("weather", now.opt("text")); - resultJson.put("humidity", now.opt("humidity")); - resultJson.put("precip", now.opt("precip")); - resultJson.put("feelsLike", now.opt("feelsLike")); - resultJson.put("pressure", now.opt("pressure")); - resultJson.put("vis", now.opt("vis")); - resultJson.put("windSpeed", now.opt("windSpeed")); - //System.out.println("天气数据:"+jsonObject3.toString()); - result = resultJson.toString(); - } - } - return result; - } - /** - * 7天获取和风天气信息HTTP - * - * @param city - * @return {nowTemp:当前气温,highTemp:最高气温,lowTemp:最低气温,wind:风向,windPower:风力,weather:天气} - * @throws IOException - */ - public static String getQWeatherHTTPByURL(String city, String url) { - System.out.println("进入天气方法。"); - //先查询城市locationID - String listUrl = "https://geoapi.qweather.com/v2/city/lookup?key=e8eacc6f976049518bd41764c04b25d9"; - String urlString = city; - URIBuilder uriBuilder = null; - try { - uriBuilder = new URIBuilder(listUrl); - uriBuilder.addParameter("location", urlString); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - String response = ""; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - // 设置了代理协议就认为是开启了代理 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //是否使用代理 - String proxyStatus = properties.getProperty("proxyStatus"); - //代理ip - String proxyHost = properties.getProperty("proxyHost"); - //代理端口 - String proxyPort = properties.getProperty("proxyPort"); - //代理协议 - String proxyScheme = properties.getProperty("proxyScheme"); - if (Boolean.parseBoolean(proxyStatus)) { - httpclient = setHttpClientProxy(proxyHost, Integer.valueOf(proxyPort), proxyScheme); - } else { - httpclient = HttpClients.createDefault(); - } - HttpGet httpGet = new HttpGet(uriBuilder.build()); // 设置请求头信息 - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpresponse = httpclient.execute(httpGet); - if (httpresponse.getStatusLine().getStatusCode() == 200) { - response = EntityUtils.toString(httpresponse.getEntity(), "UTF-8"); - } - } catch (Exception ex) { - logger.error("城市接口异常", ex); - System.out.println("城市请求异常,异常信息:" + ex.getMessage()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception ex) { - logger.error("城市接口异常", ex); - System.out.println("城市请求异常,异常信息:" + ex.getMessage()); - } - String result = ""; - if (response != null && !response.isEmpty()) { - - JSONObject jsonObject = JSONObject.fromObject(response); - JSONArray jsonArray = JSONArray.fromObject(jsonObject.opt("location")); - if (jsonArray.size() > 0) { - JSONObject jsonObject2 = JSONObject.fromObject(jsonArray.get(0)); - String location = jsonObject2.opt("id").toString(); - //再查询城市实时天气 - try { - uriBuilder = new URIBuilder(url); - uriBuilder.addParameter("location", location); - uriBuilder.addParameter("key", "e8eacc6f976049518bd41764c04b25d9"); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - response = ""; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - // 设置了代理协议就认为是开启了代理 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //是否使用代理 - String proxyStatus = properties.getProperty("proxyStatus"); - //代理ip - String proxyHost = properties.getProperty("proxyHost"); - //代理端口 - String proxyPort = properties.getProperty("proxyPort"); - //代理协议 - String proxyScheme = properties.getProperty("proxyScheme"); - if (Boolean.parseBoolean(proxyStatus)) { - httpclient = setHttpClientProxy(proxyHost, Integer.valueOf(proxyPort), proxyScheme); - } else { - httpclient = HttpClients.createDefault(); - } - HttpGet httpGet = new HttpGet(uriBuilder.build()); // 设置请求头信息 - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpresponse = httpclient.execute(httpGet); - if (httpresponse.getStatusLine().getStatusCode() == 200) { - response = EntityUtils.toString(httpresponse.getEntity(), "UTF-8"); - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } - } - - if (response != null && !response.isEmpty()) { - jsonObject = JSONObject.fromObject(response); -// JSONObject now = JSONObject.fromObject(jsonObject.opt("now")); -// JSONObject resultJson = new JSONObject(); -// resultJson.put("temp", now.opt("temp")); -// resultJson.put("windDir", now.opt("windDir")); -// resultJson.put("windScale", now.opt("windScale")); -// resultJson.put("weather", now.opt("text")); -// resultJson.put("humidity", now.opt("humidity")); -// resultJson.put("precip", now.opt("precip")); -// resultJson.put("feelsLike", now.opt("feelsLike")); -// resultJson.put("pressure", now.opt("pressure")); -// resultJson.put("vis", now.opt("vis")); -// resultJson.put("windSpeed", now.opt("windSpeed")); - //System.out.println("天气数据:"+jsonObject3.toString()); - result = jsonObject.toString(); - } - } - return result; - } - /** - * 获取和风天气信息HTTP-坐标位置天气 - * - * @param location - * @param url - * @return {nowTemp:当前气温,highTemp:最高气温,lowTemp:最低气温,wind:风向,windPower:风力,weather:天气} - * @throws IOException - */ - public static String getGridWeatherHTTPByURL(String location, String url) { - System.out.println("进入天气方法。"); - URIBuilder uriBuilder = null; - String response = ""; - String result = ""; - //再查询城市实时天气 - try { - uriBuilder = new URIBuilder(url); - uriBuilder.addParameter("location", location); - uriBuilder.addParameter("key", "e8eacc6f976049518bd41764c04b25d9"); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - response = ""; - try { - CloseableHttpClient httpclient = null; - CloseableHttpResponse httpresponse = null; - - try { - // 设置了代理协议就认为是开启了代理 - Properties properties = new CommUtil().getProperties("sessionFilter.properties"); - //是否使用代理 - String proxyStatus = properties.getProperty("proxyStatus"); - //代理ip - String proxyHost = properties.getProperty("proxyHost"); - //代理端口 - String proxyPort = properties.getProperty("proxyPort"); - //代理协议 - String proxyScheme = properties.getProperty("proxyScheme"); - if (Boolean.parseBoolean(proxyStatus)) { - httpclient = setHttpClientProxy(proxyHost, Integer.valueOf(proxyPort), proxyScheme); - } else { - httpclient = HttpClients.createDefault(); - } - HttpGet httpGet = new HttpGet(uriBuilder.build()); // 设置请求头信息 - httpGet.setHeader("Content-type", "application/json;charset=UTF-8"); - httpresponse = httpclient.execute(httpGet); - if (httpresponse.getStatusLine().getStatusCode() == 200) { - response = EntityUtils.toString(httpresponse.getEntity(), "UTF-8"); - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } finally { - if (httpclient != null) { - httpclient.close(); - } - - if (httpresponse != null) { - httpresponse.close(); - } - - } - } catch (Exception ex) { - logger.error("天气接口异常", ex); - System.out.println("请求异常,异常信息:" + ex.getMessage()); - } - - if (response != null && !response.isEmpty()) { - JSONObject jsonObject = JSONObject.fromObject(response); - result = jsonObject.toString(); - } - return result; - } - - public String getProperties(String propertie, String key) throws IOException { - Properties properties = new Properties(); - InputStreamReader inputStreamReader = new InputStreamReader - (this.getClass().getClassLoader().getResourceAsStream(propertie), "UTF-8"); - properties.load(inputStreamReader); - String value = properties.getProperty(key); - return value; - } - - public Properties getProperties(String propertie) throws IOException { - Properties properties = new Properties(); - InputStreamReader inputStreamReader = new InputStreamReader - (this.getClass().getClassLoader().getResourceAsStream(propertie), "UTF-8"); - properties.load(inputStreamReader); - return properties; - } - - /** - *  * @description: 测量点值格式化,若值不存在则返回 BigDecimal(0.0) - *  * @param numTail 保留位数 形如(2),rate 倍率 - *  * @return - *  * @author WXP - *  * @date 2020/12/26 15:56 - */ - public static BigDecimal formatMPointValue(BigDecimal source, String numTail, BigDecimal rate) { - if (source == null) { - source = new BigDecimal(0.0); - } - // todo 广业去掉这个 -// if (rate!=null){ -// source = source.multiply(rate); -// } - int length = 0; - if (numTail != null && !numTail.isEmpty()) { - if (numTail.contains(".")) { - length = numTail.length() - numTail.indexOf(".0") - 1; - } else { - length = Integer.parseInt(numTail); - } - } - source = source.setScale(length, BigDecimal.ROUND_HALF_DOWN); - return source; - } - - /** - * jep 公式格式化 - * - * @param formula - * @return - */ - public static String formatJepFormula(String formula) { - if (formula == null) { - return ""; - } - formula = formula.replaceAll(" ", "").replace("#", ""); - formula = formula.replaceAll("(", "(").replaceAll(")", ")"); - formula = formula.replaceAll("。", "."); - return formula; - } - - /** - * 根据频率向前获取起始时间,默认前一小时 - * - * @return - * @formatFlag 是否时间按标准化过滤,比如每月21号开始算,默认false - */ - public static String getStartTimeByFreq(String nowTime, int freq, String freqUnit, boolean formatFlag) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date nowDate = null; - try { - nowDate = simpleDateFormat.parse(nowTime); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - nowDate = new Date(); - } - Calendar calendar = new GregorianCalendar(); - calendar.setTime(nowDate); - String startTime = ""; - //默认和异常情况都是前一小时 - if (freq == 0) { - freq = 1; - } - if (freqUnit == null || freqUnit.isEmpty()) { - freqUnit = TimeUnitEnum.HOUR.getId(); - } - TimeUnitEnum timeUnitEnum = TimeUnitEnum.getTypeByValue(freqUnit); - try { - switch (timeUnitEnum) { - case MINUTE: - calendar.add(Calendar.MINUTE, -freq); - break; - case HOUR: - calendar.add(Calendar.HOUR_OF_DAY, -freq); - break; - case DAY: - if (formatFlag) { - int hour = calendar.get(Calendar.HOUR_OF_DAY); - if (hour < CommString.KPI_MPOINT_START_HOUR) { - calendar.add(Calendar.DATE, -freq); - } else if (CommString.KPI_MPOINT_START_HOUR == hour) { - int minute = calendar.get(Calendar.MINUTE); - if (minute <= CommString.KPI_MPOINT_START_MINUTE) { - calendar.add(Calendar.DATE, -freq); - } - } - calendar.set(Calendar.HOUR_OF_DAY, CommString.KPI_MPOINT_START_HOUR); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - } else { - calendar.add(Calendar.DATE, -freq); - } - break; - case MONTH: - if (formatFlag) { - int day = calendar.get(Calendar.DATE); - if (CommString.KPI_MPOINT_START_DAY > day) { - calendar.add(Calendar.MONTH, -freq); - calendar.set(Calendar.DATE, CommString.KPI_MPOINT_START_DAY); - } else if (CommString.KPI_MPOINT_START_DAY < day) { - calendar.add(Calendar.MONTH, -freq + 1); - calendar.set(Calendar.DATE, CommString.KPI_MPOINT_START_DAY); - } else { - int hour = calendar.get(Calendar.HOUR_OF_DAY); - if (CommString.KPI_MPOINT_START_HOUR < hour) { - calendar.set(Calendar.DATE, CommString.KPI_MPOINT_START_DAY); - } else { - calendar.add(Calendar.MONTH, -freq); - calendar.set(Calendar.DATE, CommString.KPI_MPOINT_START_DAY); - } - } - calendar.set(Calendar.HOUR_OF_DAY, CommString.KPI_MPOINT_START_HOUR); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - } else { - calendar.add(Calendar.MONTH, -freq); - } - - break; - case YEAR: - calendar.add(Calendar.YEAR, -freq); - break; - default: - calendar.add(calendar.HOUR, -freq); - break; - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - calendar.add(Calendar.HOUR_OF_DAY, -1); - } - startTime = simpleDateFormat.format(calendar.getTime()); - return startTime; - } - - /** - *  * @description: TODO - *  * @param 获取当前时间所在月的天数 - *  * @return - *  * @author WXP - *  * @date 2021/5/12 16:47 - */ - public static int getDaysOfMonth(String nowTime, boolean formatFlag) { -// String sdt = getStartTimeByFreq(nowTime,1,TimeUnitEnum.MONTH.getId(), formatFlag); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date nowDate = null; - try { - nowDate = simpleDateFormat.parse(nowTime); - } catch (Exception e) { - e.printStackTrace(); - } - Calendar calendar = Calendar.getInstance(); - calendar.setTime(nowDate); - int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - return days; - } - - /** - * 获取测量点table名称 - * - * @param mpointCode - * @return - */ - public static String getMPointTableName(String mpointCode) { - String tableName = "tb_mp_" + mpointCode; - - return tableName; - } - - /** - * 时间迁移 - * - * @return - */ - public static String getTimeByculType(String nowTime, String culType, String freqUnit) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date nowDate = null; - try { - nowDate = simpleDateFormat.parse(nowTime); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - nowDate = new Date(); - } - Calendar calendar = new GregorianCalendar(); - calendar.setTime(nowDate); - int freq = Integer.valueOf(culType); - TimeUnitEnum timeUnitEnum = TimeUnitEnum.getTypeByValue(freqUnit); - try { - switch (timeUnitEnum) { - case MINUTE: - calendar.add(Calendar.MINUTE, freq); - break; - case HOUR: - calendar.add(Calendar.HOUR_OF_DAY, freq); - break; - case DAY: - calendar.add(Calendar.DATE, freq); - break; - case MONTH: - calendar.add(Calendar.MONTH, freq); - - break; - case YEAR: - calendar.add(Calendar.YEAR, freq); - break; - default: - calendar.add(calendar.HOUR_OF_DAY, freq); - break; - } - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - calendar.add(Calendar.HOUR_OF_DAY, 1); - } - String resTime = simpleDateFormat.format(calendar.getTime()); - return resTime; - } - - /** - *  * @description: 根据实际生产要求调整每日、每月开始时间, - *  * @param autoFlag自动true/手动false,自动表示根据定时器时间生成,无需调整每日开始时间;手动表示手动生成历史时使用需要调整每日开始时间 - * 暂时取消 autoFlag - *  * @return - *  * @author WXP - *  * @date 2021/1/11 16:37 - */ - public static String adjustTime(String nowTime, String freqUnit, boolean autoFlag) { -//如果计算频率是天,则默认0点+8小时,如果计算频率是月,则默认1号+21天 - Calendar calendar = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date date = sdf.parse(nowTime); - calendar.setTime(date); - TimeUnitEnum timeUnitEnum = TimeUnitEnum.getTypeByValue(freqUnit); - switch (timeUnitEnum) { - case DAY: -// 暂时取消 autoFlag-wxp -// if(!autoFlag){ - //定时器会滞后几分钟后执行 - calendar.set(Calendar.HOUR_OF_DAY, CommString.KPI_MPOINT_START_HOUR); -// } - calendar.set(Calendar.MINUTE, 0); - break; - case HOUR: - calendar.set(Calendar.MINUTE, 0); - break; - case MINUTE: -// calendar.set(Calendar.SECOND,0); - break; - case MONTH: -// 暂时取消 autoFlag -// if(!autoFlag){ - calendar.set(Calendar.DATE, CommString.KPI_MPOINT_START_DAY); - calendar.set(Calendar.HOUR_OF_DAY, CommString.KPI_MPOINT_START_HOUR); -// } - calendar.set(Calendar.MINUTE, 0); - break; - } - calendar.set(Calendar.SECOND, 0); - nowTime = sdf.format(calendar.getTime()); - } catch (ParseException e) { - e.printStackTrace(); - } - return nowTime; - } - - public static String generateIdCode(String pattern, String code) { - String id = ""; - int i = pattern.indexOf("*"); - if (i == pattern.length() - 1) { - id = pattern.replace("*", "") + "_" + code; - } else { - id = code + "_" + pattern.replace("*", ""); - } - return id; - } - - /** - * 判断是否为数字 - * - * @param str - * @return - */ - public static boolean isNumeric(String str) { - // 该正则表达式可以匹配所有的数字 包括负数 - Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?"); - String bigStr; - try { - bigStr = new BigDecimal(str).toString(); - } catch (Exception e) { - return false;//异常 说明包含非数字。 - } - Matcher isNum = pattern.matcher(bigStr); // matcher是全匹配 - if (!isNum.matches()) { - return false; - } - return true; - } - - /** - * 判断时间是否在范围内 - * - * @param start_date 开始时间 - * @param end_date 结束时间 - * @param date 需要判断的时间 - * @return - */ - public static int compare_time(String start_date, String end_date, String date) { - DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date start_dt = df.parse(start_date); - Date end_dt = df.parse(end_date); - Date dt = df.parse(date); - if (start_dt.getTime() < dt.getTime() && dt.getTime() < end_dt.getTime()) { - return 0;//范围内 - } else { - return 1;//范围外 - } - } catch (Exception exception) { - exception.printStackTrace(); - } - return 0; - } - - /** - * 获取当月及前12月的 年月 - */ - public static String[] getLatest12Month() { - String[] latest12Months = new String[12]; - Calendar cal = Calendar.getInstance(); - cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) + 1); //要先+1,才能把本月的算进去 - for (int i = 0; i < 12; i++) { - cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) - 1); //逐次往前推1个月 - latest12Months[11 - i] = cal.get(Calendar.YEAR) + "-" + fillZero(cal.get(Calendar.MONTH) + 1); - } - return latest12Months; - } - - /** - * 月份1位 格式化成2位 - * - * @param i - * @return - */ - public static String fillZero(int i) { - String month = ""; - if (i < 10) { - month = "0" + i; - } else { - month = String.valueOf(i); - } - return month; - } - - /** - * 时间戳转日期 - * - * @param stamp - * @return - */ - public static String getDateTimeByMillisecond(String stamp) { - String sd = ""; - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - long times = Long.parseLong(stamp); - sd = format.format(times); - return sd; - } - - /** - * 日期转时间戳 - * - * @param stamp - * @return - */ - public static long getMillisecondByDateTime(String stamp) { - long time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(stamp, new ParsePosition(0)).getTime() / 1000; - return time; - } - - /** - * 去除换行符空格回车 - * - * @param str - * @return - */ - public static String replace(String str) { - String destination = ""; - if (str != null) { - Pattern p = Pattern.compile("\\s*|\t|\r|\n"); - Matcher m = p.matcher(str); - destination = m.replaceAll(""); - } - return destination; - } - - /** - * 定义移动端请求的所有可能类型 - */ - private final static String[] agent = {"Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser"}; - - /** - * 判断User-Agent 是不是来自于手机 - * - * @param ua - * @return - */ - public static boolean checkAgentIsMobile(String ua) { - boolean flag = false; - if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;"))) { - // 排除 苹果桌面系统 - if (!ua.contains("Windows NT") && !ua.contains("Macintosh")) { - for (String item : agent) { - if (ua.contains(item)) { - flag = true; - break; - } - } - } - } - return flag; - } - - public static String httpURL(String path, String data) { - try { - URL url = new URL(path); - //打开和url之间的连接 - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - PrintWriter out = null; - //请求方式 -// conn.setRequestMethod("POST"); -// //设置通用的请求属性 - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); - //设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 - //最常用的Http请求无非是get和post,get请求可以获取静态页面,也可以把参数放在URL字串后面,传递给servlet, - //post与get的 不同之处在于post的参数不是放在URL字串里面,而是放在http请求的正文内。 - conn.setDoOutput(true); - conn.setDoInput(true); - //获取URLConnection对象对应的输出流 - out = new PrintWriter(conn.getOutputStream()); - //发送请求参数即数据 - out.print(data); - //缓冲数据 - out.flush(); - //获取URLConnection对象对应的输入流 - InputStream is = conn.getInputStream(); - //构造一个字符流缓存 - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String str = ""; - while ((str = br.readLine()) != null) { -// System.out.println(str); - return str; - } - //关闭流 - is.close(); - //断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。 - //固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些。 - conn.disconnect(); -// System.out.println("完整结束"); - } catch (Exception e) { - e.printStackTrace(); - } - return "fail"; - } - - /** - * 按照JSONArray中的对象的某个字段进行排序(采用fastJson) - * sj 2022-10-10 - * - * @param jsonArrStr - * @param name 排序的key - * @return - */ - public static String jsonArraySort(String jsonArrStr, String name) { - JSONArray jsonArr = JSONArray.fromObject(JSON.parseArray(jsonArrStr)); - JSONArray sortedJsonArray = new JSONArray(); - List jsonValues = new ArrayList(); - for (int i = 0; i < jsonArr.size(); i++) { - jsonValues.add(jsonArr.getJSONObject(i)); - } - Collections.sort(jsonValues, new Comparator() { - // You can change "Name" with "ID" if you want to sort by ID - private String KEY_NAME = name; - - @Override - public int compare(JSONObject a, JSONObject b) { - String valA = new String(); - String valB = new String(); - try { - // 这里是a、b需要处理的业务,需要根据你的规则进行修改。 - String aStr = a.getString(KEY_NAME); - valA = aStr.replaceAll("-", ""); - String bStr = b.getString(KEY_NAME); - valB = bStr.replaceAll("-", ""); - } catch (JSONException e) { - // do something - } - return valA.compareTo(valB); - // if you want to change the sort order, simply use the following: - // return -valA.compareTo(valB); - } - }); - for (int i = 0; i < jsonArr.size(); i++) { - sortedJsonArray.add(jsonValues.get(i)); - } - return sortedJsonArray.toString(); - } - - /** - * 对json数组排序 - * - * @param jsonArr - * @param sortKey 排序关键字 - * @param is_desc is_desc-false升序列 is_desc-true降序 (排序字段为字符串) - * @return - */ - public static JSONArray jsonArraySort(JSONArray jsonArr, final String sortKey, final boolean is_desc) { - //存放排序结果json数组 - JSONArray sortedJsonArray = new JSONArray(); - //用于排序的list - List jsonValues = new ArrayList(); - //将参数json数组每一项取出,放入list - for (int i = 0; i < jsonArr.size(); i++) { - jsonValues.add(JSONObject.fromObject(jsonArr.getJSONObject(i))); - } - //快速排序,重写compare方法,完成按指定字段比较,完成排序 - Collections.sort(jsonValues, new Comparator() { - //排序字段 - private final String KEY_NAME = sortKey; - - //重写compare方法 - @Override - public int compare(JSONObject a, JSONObject b) { - //为数字 - if (isNumeric(a.getString(KEY_NAME))) { - Double valA = new Double("0.0"); - Double valB = new Double("0.0"); - try { - valA = Double.valueOf(a.getString(KEY_NAME)); - valB = Double.valueOf(b.getString(KEY_NAME)); - } catch (JSONException e) { - e.printStackTrace(); - } - //是升序还是降序 - if (is_desc) { - return -valA.compareTo(valB); - } else { - return -valB.compareTo(valA); - } - //为字符串 - } else { - String valA = new String(); - String valB = new String(); - try { - valA = a.getString(KEY_NAME); - valB = b.getString(KEY_NAME); - } catch (JSONException e) { - e.printStackTrace(); - } - //是升序还是降序 - if (is_desc) { - return -valA.compareTo(valB); - } else { - return -valB.compareTo(valA); - } - } - - } - }); - //将排序后结果放入结果jsonArray - for (int i = 0; i < jsonArr.size(); i++) { - sortedJsonArray.add(jsonValues.get(i)); - } - return sortedJsonArray; - } - - /** - * 验证用户菜单权限 - */ - public static boolean menuValidate(String userid, String url) { - MenuService menuService = (MenuService) SpringContextUtil.getBean("menuService"); - List menuList = menuService.selectListByWhere("where location like '%" + url + "%' and [type]='menu' "); - if (menuList != null && menuList.size() > 0) { - List resourcesList = menuService.selectUserPowerListByWhere("where EmpID = '" + userid + "' " - + " and location like '%" + url + "%' "); - if (resourcesList != null && resourcesList.size() > 0) { - return true;//数据库中有该链接,并且该用户拥有该权限,显示 - } - } else { - return true;//数据库中没有该链接 - } - return false; - } - - /** - * 递归获取子节点 - * - * @param - */ - public static List getChildren(String pid, List t) { - List t2 = new ArrayList(); - for (int i = 0; i < t.size(); i++) { - if (t.get(i).getPid() != null && t.get(i).getPid().equalsIgnoreCase(pid)) { - if (t.get(i).getType().equals(CommString.UNIT_TYPE_WORKSHOP)) { - t2.add(t.get(i)); - List result = getChildren(t.get(i).getId(), t); - if (result != null) { - t2.addAll(result); - } - } - } - } - return t2; - } - - /** - * - * @param jsonArrStr - * @param morderKey 排序key名 - * @param sortType asc desc - * @return - */ - public static String jsonArraySort(String jsonArrStr, String morderKey, String sortType) { - com.alibaba.fastjson.JSONArray jsonArr = com.alibaba.fastjson.JSONArray.parseArray(jsonArrStr); - com.alibaba.fastjson.JSONArray sortedJsonArray = new com.alibaba.fastjson.JSONArray(); - List jsonValues = new ArrayList(); - for (int i = 0; i < jsonArr.size(); i++) { - jsonValues.add(jsonArr.getJSONObject(i)); - } - Collections.sort(jsonValues, new Comparator() { - private final String KEY_NAME = morderKey; - - public int compare(com.alibaba.fastjson.JSONObject a, com.alibaba.fastjson.JSONObject b) { - String valA = new String(); - String valB = new String(); - try { - // 这里是a、b需要处理的业务,需要根据你的规则进行修改。 - String aStr = a.getString(KEY_NAME); - valA = aStr.replaceAll("-", ""); - String bStr = b.getString(KEY_NAME); - valB = bStr.replaceAll("-", ""); - } catch (JSONException e) { - // do something - } - if (sortType.equals("asc")) { - return valA.compareTo(valB); - } else if (sortType.equals("desc")) { - return -valA.compareTo(valB); - } else { - return valA.compareTo(valB); - } - } - }); - for (int i = 0; i < jsonArr.size(); i++) { - sortedJsonArray.add(jsonValues.get(i)); - } - return sortedJsonArray.toString(); - } - - /** - * 转换时间格式为xx小时xx分xx秒 - * @param second xxxxx - */ - public static String secondToDate(double second) { - Long time = new Long(new Double(second).longValue()); - String strTime = null; - Long days = time / (60 * 60 * 24); - Long hours = (time % (60 * 60 * 24)) / (60 * 60); - Long minutes = (time % (60 * 60)) / 60; - Long seconds = time % 60; - if (days > 0) { - strTime = days + "天" + hours + "小时" + minutes + "分钟"; - } else if (hours > 0) { - strTime = hours + "小时" + minutes + "分钟"; - } else if (minutes > 0) { - strTime = minutes + "分钟" + seconds + "秒"; - } else { - strTime = second + "秒"; - } - return strTime; - } - /** - * 判断坐标是否在范围内 - * - * @param positions 点集合 - * @param p 目标坐标 - * - * @return boolean - */ - public static boolean rayCasting2(String[] positions,double[] p) { - if(positions!=null && positions.length>0 && p.length>1) { - if (positions.length < 3) { - return false; - } - GeneralPath path = new GeneralPath(); - for (int i = 0; i < positions.length; i++) { - String position = positions[i]; - if (!position.isEmpty()) { - String[] posit = position.split(","); - double x = Double.parseDouble(posit[0]); - double y = Double.parseDouble(posit[1]); - if(i==0){ - path.moveTo(x, y); - } - path.lineTo(x, y); - } - } - path.closePath(); - boolean res = path.contains(p[0], p[1]); - path = null; - return res; - } - return false; - } - /** - * p :[x,y] ,带判定的P点 - * poly: [[x0,y0],[x1,y1]......] 多边形的路径 - */ - public static boolean rayCasting(double[] p, List poly) { - // px,py为p点的x和y坐标 - double px = p[0]; - double py = p[1]; - boolean flag = false; - - //这个for循环是为了遍历多边形的每一个线段 - for(int i = 0, l = poly.size(), j = l - 1; i < l; j = i, i++) { - double sx = poly.get(i)[0], //线段起点x坐标 - sy = poly.get(i)[1], //线段起点y坐标 - tx = poly.get(j)[0], //线段终点x坐标 - ty = poly.get(j)[1]; //线段终点y坐标 - - // 点与多边形顶点重合 - if((sx == px && sy == py) || (tx == px && ty == py)) { - return true; - } - - // 点的射线和多边形的一条边重合,并且点在边上 - if((sy == ty && sy == py) && ((sx > px && tx < px) || (sx < px && tx > px))) { - return true; - } - - // 判断线段两端点是否在射线两侧 - if((sy < py && ty >= py) || (sy >= py && ty < py)) { - // 求射线和线段的交点x坐标,交点y坐标当然是py - double x = sx + (py - sy) * (tx - sx) / (ty - sy); - - // 点在多边形的边上 - if(x == px) { - return true; - } - - // x大于px来保证射线是朝右的,往一个方向射,假如射线穿过多边形的边界,flag取反一下 - if(x > px) { - flag = !flag; - } - } - } - - // 射线穿过多边形边界的次数为奇数时点在多边形内 - return flag ? true : false; - } - - /** - * 根据主题,将mpcode存储到Redis - * 主题前缀是CommString.REDIS_KEY_TYPE_PAGEDATA - * @param bucket 主题后缀 - * @param mpcodes 点位数组 - * - * @return int 0异常/1正常 - */ - public static int setCodes2Redis(String bucket, String[] mpcodes) { - int res = 0; - // 根据主题,将mpcode存储到Redis - if(bucket!=null && !bucket.isEmpty()){ - RedissonClient redissonClient = SpringContextUtil.getBean(RedissonClient.class); - RBucket tokenBucket = redissonClient.getBucket(CommString.REDIS_KEY_TYPE_PAGEDATA+bucket); - String redisCodes= tokenBucket.get(); - for(String mpcode : mpcodes){ - if (redisCodes.indexOf(mpcode) == -1) { - //不存在则写入 - redisCodes += mpcode+","; - } - } - tokenBucket.set(redisCodes); - res = 1; - } - return res; - } - - /** - * 计算两个时间的天数差值 - * - * @param sd 第一个时间字符串 日期格式为yyyy-MM-dd HH:mm:ss - * @param ed 第二个时间字符串 日期格式为yyyy-MM-dd HH:mm:ss - * @return 返回两个时间差值,xx小时xx分钟 - */ - public static String getDiffTimeEndMin(String sd, String ed) { - String out = ""; - try { - Date dt1 = longDateFormat.parse(sd); - Date dt2 = longDateFormat.parse(ed); - // 相差的毫秒值 - Long milliseconds = dt1.getTime() - dt2.getTime(); - - long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数 - long nh = 1000 * 60 * 60;// 一小时的毫秒数 - long nm = 1000 * 60;// 一分钟的毫秒数 -// long ns = 1000;// 一秒钟的毫秒数 - -// long day = milliseconds / nd; // 计算相差多少天 -// long hour = milliseconds % nd / nh; // 计算相差剩余多少小时 - long hour = milliseconds / nh; // 计算相差剩余多少小时 - long min = milliseconds % nd % nh / nm; // 计算相差剩余多少分钟 -// long sec = milliseconds % nd % nh % nm / ns; // 计算相差剩余多少秒 -// out = day + "天" + hour + "小时" + min + "分钟" + sec + "秒"; - out = hour + "小时" + min + "分钟"; - } catch (Exception e) { - System.out.println("exception" + e.toString()); - } - return out; - } - private static final String KEY = "34bfeacAB39053deb006df63"; - private static final String AES_ALGORITHM = "AES/ECB/PKCS7Padding"; - /** - * 加密 encrypt input text - * @param input - * @param handle_style - * @return - */ - public static String encryptAES(String input,String handle_style) { - if(handle_style.equals("hex")){ - return encrypt_hex(input,KEY); - }else if (handle_style.equals("base64")){ - return encrypt_base64(input,KEY); - }else{ - System.out.println("加密限制为hex or base64"); - return null; - } - } - - public static String encrypt_hex(String input,String key){ - byte[] crypted = null; - Security.addProvider(new BouncyCastleProvider()); - try { - SecretKeySpec skey = new SecretKeySpec(key.getBytes(), "AES"); - Cipher cipher = Cipher.getInstance(AES_ALGORITHM,"BC"); - cipher.init(Cipher.ENCRYPT_MODE, skey); - crypted = cipher.doFinal(input.getBytes()); - } catch (Exception e) { - System.out.println(e.toString()); - e.printStackTrace(); - } - return new String(Hex.encodeHex(crypted)); - } - - public static String encrypt_base64(String input,String key){ - byte[] crypted = null; - Security.addProvider(new BouncyCastleProvider()); - try { - SecretKeySpec skey = new SecretKeySpec(key.getBytes(), "AES"); - Cipher cipher = Cipher.getInstance(AES_ALGORITHM,"BC"); - cipher.init(Cipher.ENCRYPT_MODE, skey); - crypted = cipher.doFinal(input.getBytes()); - } catch (Exception e) { - System.out.println(e.toString()); - e.printStackTrace(); - } - return new String(Base64.encodeBase64(crypted)); - } - /** - * 解密 decrypt input text - * - * @param input - * @param handle_style - * @return - */ - public static String decryptAES(String input, String handle_style){ - if(handle_style.equals("hex")){ - return decrypt_hex(input,KEY); - }else if (handle_style.equals("base64")){ - return decrypt_base64(input,KEY); - }else{ - System.out.println("解密限制为hex or base64"); - return null; - } - } - - public static String decrypt_hex(String input, String key) { - Security.addProvider(new BouncyCastleProvider()); - byte[] output = null; - try { - SecretKeySpec skey = new SecretKeySpec(key.getBytes(), "AES"); - Cipher cipher = Cipher.getInstance(AES_ALGORITHM,"BC"); - cipher.init(Cipher.DECRYPT_MODE, skey); - output = cipher.doFinal(Hex.decodeHex(input.toCharArray())); - } catch (Exception e) { - System.out.println(e.toString()); - return null; - } - return new String(output); - } - - public static String decrypt_base64(String input, String key) { - Security.addProvider(new BouncyCastleProvider()); - byte[] output = null; - try { - SecretKeySpec skey = new SecretKeySpec(key.getBytes(), "AES"); - Cipher cipher = Cipher.getInstance(AES_ALGORITHM,"BC"); - cipher.init(Cipher.DECRYPT_MODE, skey); - output = cipher.doFinal(Base64.decodeBase64(input)); - } catch (Exception e) { - System.out.println(e.toString()); - return null; - } - return new String(output); - } - public static boolean isBase64Encode(String content){ - boolean res = false; - if(content.length()%4!=0){ - res = false; - }else{ - String pattern = "^[a-zA-Z0-9/+]*={0,2}$"; - if(Pattern.matches(pattern, content) && Base64.isBase64(content)){ - res = true; - } - } - return res; - } -} - - - - - diff --git a/src/com/sipai/tools/CommentGenerator.java b/src/com/sipai/tools/CommentGenerator.java deleted file mode 100644 index 163740f7..00000000 --- a/src/com/sipai/tools/CommentGenerator.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.tools; - -import org.mybatis.generator.api.IntrospectedColumn; -import org.mybatis.generator.api.IntrospectedTable; -import org.mybatis.generator.api.dom.java.CompilationUnit; -import org.mybatis.generator.api.dom.java.Field; -import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; -import org.mybatis.generator.internal.DefaultCommentGenerator; -import org.mybatis.generator.internal.util.StringUtility; - -import java.util.Properties; - -/** - * 自定义注释生成器 - * Created by macro on 2018/4/26. - */ -public class CommentGenerator extends DefaultCommentGenerator { - private boolean addRemarkComments = false; - private static final String EXAMPLE_SUFFIX="Example"; - private static final String API_MODEL_PROPERTY_FULL_CLASS_NAME="io.swagger.annotations.ApiModelProperty"; - - /** - * 设置用户配置的参数 - */ - @Override - public void addConfigurationProperties(Properties properties) { - super.addConfigurationProperties(properties); - this.addRemarkComments = StringUtility.isTrue(properties.getProperty("addRemarkComments")); - } - - /** - * 给字段添加注释 - */ - @Override - public void addFieldComment(Field field, IntrospectedTable introspectedTable, - IntrospectedColumn introspectedColumn) { - String remarks = introspectedColumn.getRemarks(); - //根据参数和备注信息判断是否添加备注信息 - if(addRemarkComments&& StringUtility.stringHasValue(remarks)){ -// addFieldJavaDoc(field, remarks); - //数据库中特殊字符需要转义 - if(remarks.contains("\"")){ - remarks = remarks.replace("\"","'"); - } - //给model的字段添加swagger注解 - field.addJavaDocLine("@ApiModelProperty(value = \""+remarks+"\")"); - } - } - - /** - * 给model的字段添加注释 - */ - private void addFieldJavaDoc(Field field, String remarks) { - //文档注释开始 - field.addJavaDocLine("/**"); - //获取数据库字段的备注信息 - String[] remarkLines = remarks.split(System.getProperty("line.separator")); - for(String remarkLine:remarkLines){ - field.addJavaDocLine(" * "+remarkLine); - } - addJavadocTag(field, false); - field.addJavaDocLine(" */"); - } - - @Override - public void addJavaFileComment(CompilationUnit compilationUnit) { - super.addJavaFileComment(compilationUnit); - //只在model中添加swagger注解类的导入 - if(!compilationUnit.isJavaInterface()&&!compilationUnit.getType().getFullyQualifiedName().contains(EXAMPLE_SUFFIX)){ - compilationUnit.addImportedType(new FullyQualifiedJavaType(API_MODEL_PROPERTY_FULL_CLASS_NAME)); - } - } -} diff --git a/src/com/sipai/tools/CustomExceptionHandler.java b/src/com/sipai/tools/CustomExceptionHandler.java deleted file mode 100644 index 216ded43..00000000 --- a/src/com/sipai/tools/CustomExceptionHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.tools;/* - @author njp - @date 2023/5/12 15:00 - @discription -*/ - -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RestControllerAdvice; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; - -/** - * @author SIPAIIS-NJP - */ -@RestControllerAdvice //等于@ControllerAdvice+@ResponseBody,和@RestController一个道理 -public class CustomExceptionHandler { - @ExceptionHandler({Exception.class,Throwable.class, RuntimeException.class}) - public void exceptionHandler(Exception e, HttpServletResponse resp) throws IOException { - resp.setContentType("text/html;charset=utf-8"); - System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++"); - /*System.out.println(e.toString()); - System.out.println("--------------------------------------------"); - StringBuffer sb = new StringBuffer(); - if (e != null) { - for (StackTraceElement element : e.getStackTrace()) { - sb.append("\r\n\t").append(element); - } - } - System.out.println(sb.toString()); - System.out.println("--------------------------------------------");*/ - StringWriter stringWriter = new StringWriter(); - PrintWriter printWriter = new PrintWriter(stringWriter); - e.printStackTrace(printWriter); - System.out.println(stringWriter.toString()); - System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++"); - } -} diff --git a/src/com/sipai/tools/DataSourceHolder.java b/src/com/sipai/tools/DataSourceHolder.java deleted file mode 100644 index 2ababecc..00000000 --- a/src/com/sipai/tools/DataSourceHolder.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.tools; - - -public class DataSourceHolder { - private static final ThreadLocal dataSourceTypes = new ThreadLocal(){ - @Override - protected DataSources initialValue(){ - return DataSources.MASTER; - } - }; - - public static DataSources getDataSources(){ - return dataSourceTypes.get(); - } - - public static void setDataSources(DataSources dataSourceType){ - dataSourceTypes.set(dataSourceType); - } - - public static void reset(){ - dataSourceTypes.set(DataSources.MASTER); - } -} - diff --git a/src/com/sipai/tools/DataSourceInterceptor.java b/src/com/sipai/tools/DataSourceInterceptor.java deleted file mode 100644 index b50281d4..00000000 --- a/src/com/sipai/tools/DataSourceInterceptor.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.tools; - -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.After; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; -import org.springframework.core.annotation.Order; -import org.springframework.stereotype.Component; - -/*@Aspect // for aop -@Component // for auto scan -@Order(0) // execute before @Transactional -*/ -public class DataSourceInterceptor { - /* @Pointcut("execution(public * com.sipai.service.scada.*.*(..))") - public void dataSourceScadaPointcut(){};*/ - - //@Before("dataSourceScadaPointcut()") - public void before(JoinPoint jp) { - Object[] argusObjects =jp.getArgs(); - - //若只有一个参数,则默认使用es - if (argusObjects == null || argusObjects.length < 2 || !(argusObjects[0] instanceof String)) { - return; - } - - Object argus=argusObjects[0]; - if(argus!=null){ - DataSourceHolder.setDataSources(DataSources.valueOf("SCADA_"+argus.toString())); - }else{ - DataSourceHolder.setDataSources(DataSources.valueOf("SCADA_YL")); - } - - //适应所有生产库存集中为一个数据库 -// DataSourceHolder.setDataSources(DataSources.SCADA_0756ZH); - } - //@After("dataSourceScadaPointcut()") - public void after(JoinPoint jp) { - DataSourceHolder.reset(); - } - // ... ... -} diff --git a/src/com/sipai/tools/DataSources.java b/src/com/sipai/tools/DataSources.java deleted file mode 100644 index 8a9e586a..00000000 --- a/src/com/sipai/tools/DataSources.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.sipai.tools; - -/** - * 数据源的类别:master/slave - */ -public enum DataSources { - // MASTER,SCADA_021BLG,SCADA_021CMBZ,SCADA_021CMXH,SCADA_021CMCQ -// ,SCADA_021THZS -// 上实现场配置 -// MASTER,SCADA_d0f105b6eafb49c58ac072bc7a23b663,SCADA_1c4753a55245488990e0b227ad1cd235,SCADA_81d14994a52c49f4accbd8e98286ed3a,SCADA_196316aff2b54cad96d5bc50f7c7b207 -// ,SCADA_3167c63fac1a47e3901382c12e9d59c2,SCADA_5d00ccad76d7454199942fa1ab748d4a,SCADA_82094d7f7dff45169adda79a06c23a58,SCADA_191045a415234b17b59b45bb98c34007,SCADA_64ca6f6a6b8b4dc8a7f1108733bcffc7 -// ,SCADA_7935147be5ba4b87ba082b3e08ab02ac,SCADA_3d6b469db0c3401a93a16184e8284029,SCADA_d1a4801d65344096913f93709da9fd3b,SCADA_861f02e1990844fbb30a1c63c1eb767c,SCADA_979d255db91e408dbbef8e2225af5c42 -// ,SCADA_44137c952f8243ddbf6d7161ad79ce21,SCADA_372ffb8a5e0f44ac82b721493aa73069,SCADA_928f5dc0cadf43019a167949ca42d100,SCADA_6e45bbfc4ec94aefacf30b9fad5283e1,SCADA_4baa019576af453c9cc7b83d6cb4296d -// ,SCADA_9fa2410f1c69496da747fbada3811b65,SCADA_a6d084680e7242689765315ceffa4117,SCADA_9b162f0489e749ccafa86661ebcb6331,SCADA_0d4dca3ddd2a47deb2cb4c23c9a63c9b,SCADA_4b3f55cc0f7e4142bd2dce4f7af3ffbb -// ,SCADA_7e1ebd1b07a6469eaa39cb36888e849e,SCADA_db07f115e1424f208aec738980c712f6,SCADA_e5143626f856433fad439a43dfb26120,SCADA_f32d59bdba63492785fe2b9b0b892fe3,SCADA_f5799e1d2a0f4ca4978b620f50f3ce4f -// ,SCADA_8cb18a1e70d94adb9ef91b57b212036d -// 上实end -// 常排现场配置 -// MASTER, SCADA_QC, SCADA_JB, SCADA_7b19e5c1efe94009b6ba777f096f4caa, SCADA_OA_ELM -// 常排end - - // MASTER, SCADA_020ZCYH, SCADA_020ZCZX -// MASTER, SCADA_FSSY, SCADA_fe6fe310097f4679b46b7a173578dd11 - - //泰和 -// MASTER, SCADA_021TH, SCADA_021THZS - //沙口 -// MASTER, SCADA_FSSY, SCADA_fe6fe310097f4679b46b7a173578dd11 - //增城 -// MASTER, SCADA_020ZCYH, SCADA_020ZCZX, SCADA_020ZC, SCADA_fe6fe310097f4679b46b7a173578dd11,SCADA_f31c04e44c9548bdaeca9f54c9e982e2 - - MASTER, SCADA_HFCG -// MASTER, SCADA_FS_SK11_C - // MASTER, SCADA_021HQWS -// MASTER, SCADA_HFST -// MASTER, SCADA_021BLG -// MASTER, SCADA_021HQWS - -// MASTER, SCADA_021HQWS -// MASTER, SCADA_021HQWS - -// MASTER, SCADA_020ZCYH, SCADA_020ZCZX, SCADA_020ZC - //021THWS -//MASTER, SCADA_021THWS -} diff --git a/src/com/sipai/tools/DateSpan.java b/src/com/sipai/tools/DateSpan.java deleted file mode 100644 index 49a2b86e..00000000 --- a/src/com/sipai/tools/DateSpan.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sipai.tools; - -/** - * 时间跨度类别: - */ -public enum DateSpan { - YEAR, MONTH, WEEK, DAY, HOUR -} diff --git a/src/com/sipai/tools/DateUtil.java b/src/com/sipai/tools/DateUtil.java deleted file mode 100644 index 7ca34dd4..00000000 --- a/src/com/sipai/tools/DateUtil.java +++ /dev/null @@ -1,820 +0,0 @@ -package com.sipai.tools; - - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * 日、星期(周)、旬、月、季度、年等时间工具类 - */ -public class DateUtil { - - private final static SimpleDateFormat shortSdf = new SimpleDateFormat("yyyy-MM-dd"); - private final static SimpleDateFormat longHourSdf = new SimpleDateFormat("yyyy-MM-dd HH"); - private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - private final static SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - - - /** - * 根据要求的格式,格式化时间,返回String - * - * @param format 默认:yyyy-MM-dd HH:mm:ss - * @param time 要格式化的时间 - * @return 时间字符串 - */ - public static String toStr(String format, Date time) { - SimpleDateFormat df = null; - if (null == format) { - df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - } else { - df = new SimpleDateFormat(format); - } - try { - return df.format(time); - } catch (Exception e) { - return null; - } - - } - - /** - * 字符串转时间 - * - * @param source yyyy-MM-dd HH:mm:ss.SSS 格式的字符串 - * @return - */ - public static Date toDate(String source) { - String formatString = "yyyy-MM-dd hh:mm:ss"; - if (source == null || "".equals(source.trim())) { - return null; - } - source = source.trim(); - if (source.matches("^\\d{4}$")) { - formatString = "yyyy"; - } else if (source.matches("^\\d{4}-\\d{1,2}$")) { - formatString = "yyyy-MM"; - } else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")) { - formatString = "yyyy-MM-dd"; - } else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}$")) { - formatString = "yyyy-MM-dd hh"; - } else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")) { - formatString = "yyyy-MM-dd hh:mm"; - } else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) { - formatString = "yyyy-MM-dd hh:mm:ss"; - } else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{1,3}$")) { - formatString = "yyyy-MM-dd HH:mm:ss.SSS"; - } - try { - SimpleDateFormat sdf = new SimpleDateFormat(formatString); - Date date = sdf.parse(source); - return date; - } catch (ParseException e) { - e.printStackTrace(); - } - return null; - } - - /** - * 获得本小时的开始时间 - * - * @return - */ - public static Date getHourStartTime(Date date) { - Date dt = null; - try { - dt = longHourSdf.parse(longHourSdf.format(date)); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 获得本小时的结束时间 - * - * @return - */ - public static Date getHourEndTime(Date date) { - Date dt = null; - try { - dt = longSdf.parse(longHourSdf.format(date) + ":59:59.999"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 获得本天的开始时间 - * - * @return - */ - public static Date getDayStartTime(Date date) { - Date dt = null; - try { - dt = shortSdf.parse(shortSdf.format(date)); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 获得本天的结束时间 - * - * @return - */ - public static Date getDayEndTime(Date date) { - Date dt = null; - try { - dt = longSdf.parse(shortSdf.format(date) + " 23:59:59.999"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 当前时间是星期几 - * - * @return - */ - public static int getWeekDay(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - int week_of_year = c.get(Calendar.DAY_OF_WEEK); - return week_of_year - 1; - } - - /** - * 获得本周的第一天,周一 - * - * @return - */ - public static Date getWeekStartTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - try { - int weekday = c.get(Calendar.DAY_OF_WEEK) - 2; - c.add(Calendar.DATE, -weekday); - c.setTime(longSdf.parse(shortSdf.format(c.getTime()) + " 00:00:00.000")); - } catch (Exception e) { - e.printStackTrace(); - } - return c.getTime(); - } - - /** - * 获得本周的最后一天,周日 - * - * @return - */ - public static Date getWeekEndTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - try { - int weekday = c.get(Calendar.DAY_OF_WEEK); - c.add(Calendar.DATE, 8 - weekday); - c.setTime(longSdf.parse(shortSdf.format(c.getTime()) + " 23:59:59.999")); - } catch (Exception e) { - e.printStackTrace(); - } - return c.getTime(); - } - - /** - * 获得本月的开始时间 - * - * @return - */ - public static Date getMonthStartTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - Date dt = null; - try { - c.set(Calendar.DATE, 1); - dt = shortSdf.parse(shortSdf.format(c.getTime())); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 本月的结束时间 - * - * @return - */ - public static Date getMonthEndTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - Date dt = null; - try { - c.set(Calendar.DATE, 1); - c.add(Calendar.MONTH, 1); - c.add(Calendar.DATE, -1); - dt = longSdf.parse(shortSdf.format(c.getTime()) + " 23:59:59.999"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 当前年的开始时间 - * - * @return - */ - public static Date getYearStartTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - Date dt = null; - try { - c.set(Calendar.MONTH, 0); - c.set(Calendar.DATE, 1); - dt = shortSdf.parse(shortSdf.format(c.getTime())); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 当前年的结束时间 - * - * @return - */ - public static Date getYearEndTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - Date dt = null; - try { - c.set(Calendar.MONTH, 11); - c.set(Calendar.DATE, 31); - dt = longSdf.parse(shortSdf.format(c.getTime()) + " 23:59:59.999"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 当前季度的开始时间 - * - * @return - */ - public static Date getQuarterStartTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - int currentMonth = c.get(Calendar.MONTH) + 1; - Date dt = null; - try { - if (currentMonth >= 1 && currentMonth <= 3) - c.set(Calendar.MONTH, 0); - else if (currentMonth >= 4 && currentMonth <= 6) - c.set(Calendar.MONTH, 3); - else if (currentMonth >= 7 && currentMonth <= 9) - c.set(Calendar.MONTH, 6); - else if (currentMonth >= 10 && currentMonth <= 12) - c.set(Calendar.MONTH, 9); - c.set(Calendar.DATE, 1); - dt = longSdf.parse(shortSdf.format(c.getTime()) + " 00:00:00.000"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 当前季度的结束时间 - * - * @return - */ - public static Date getQuarterEndTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - int currentMonth = c.get(Calendar.MONTH) + 1; - Date dt = null; - try { - if (currentMonth >= 1 && currentMonth <= 3) { - c.set(Calendar.MONTH, 2); - c.set(Calendar.DATE, 31); - } else if (currentMonth >= 4 && currentMonth <= 6) { - c.set(Calendar.MONTH, 5); - c.set(Calendar.DATE, 30); - } else if (currentMonth >= 7 && currentMonth <= 9) { - c.set(Calendar.MONTH, 8); - c.set(Calendar.DATE, 30); - } else if (currentMonth >= 10 && currentMonth <= 12) { - c.set(Calendar.MONTH, 11); - c.set(Calendar.DATE, 31); - } - dt = longSdf.parse(shortSdf.format(c.getTime()) + " 23:59:59.999"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 获取前/后半年的开始时间 - * - * @return - */ - public static Date getHalfYearStartTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - int currentMonth = c.get(Calendar.MONTH) + 1; - Date dt = null; - try { - if (currentMonth >= 1 && currentMonth <= 6) { - c.set(Calendar.MONTH, 0); - } else if (currentMonth >= 7 && currentMonth <= 12) { - c.set(Calendar.MONTH, 6); - } - c.set(Calendar.DATE, 1); - dt = longSdf.parse(shortSdf.format(c.getTime()) + " 00:00:00.000"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - - } - - /** - * 获取前/后半年的结束时间 - * - * @return - */ - public static Date getHalfYearEndTime(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - int currentMonth = c.get(Calendar.MONTH) + 1; - Date dt = null; - try { - if (currentMonth >= 1 && currentMonth <= 6) { - c.set(Calendar.MONTH, 5); - c.set(Calendar.DATE, 30); - } else if (currentMonth >= 7 && currentMonth <= 12) { - c.set(Calendar.MONTH, 11); - c.set(Calendar.DATE, 31); - } - dt = longSdf.parse(shortSdf.format(c.getTime()) + " 23:59:59.999"); - } catch (Exception e) { - e.printStackTrace(); - } - return dt; - } - - /** - * 获取月旬 三旬: 上旬1-10日 中旬11-20日 下旬21-31日 - * - * @param date - * @return - */ - public static int getTenDay(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - int i = c.get(Calendar.DAY_OF_MONTH); - if (i < 11) - return 1; - else if (i < 21) - return 2; - else - return 3; - } - - - /** - * 获取所属旬开始时间 - * - * @param date - * @return - */ - public static Date getTenDayStartTime(Date date) { - int ten = getTenDay(date); - try { - if (ten == 1) { - return getMonthStartTime(date); - } else if (ten == 2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-11"); - return shortSdf.parse(df.format(date)); - } else { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-21"); - return shortSdf.parse(df.format(date)); - } - } catch (ParseException e) { - e.printStackTrace(); - } - return null; - - - } - - /** - * 获取所属旬结束时间 - * - * @param date - * @return - */ - public static Date getTenDayEndTime(Date date) { - int ten = getTenDay(date); - try { - if (ten == 1) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-10 23:59:59.999"); - return longSdf.parse(df.format(date)); - } else if (ten == 2) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-20 23:59:59.999"); - return longSdf.parse(df.format(date)); - } else { - return getMonthEndTime(date); - } - } catch (ParseException e) { - e.printStackTrace(); - } - return null; - - - } - - - /** - * 属于本年第几天 - * - * @return - */ - public static int getYearDayIndex(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setFirstDayOfWeek(Calendar.MONDAY); - calendar.setTime(date); - return calendar.get(Calendar.DAY_OF_YEAR); - } - - /** - * 属于本年第几周 - * - * @return - */ - public static int getYearWeekIndex(Date date) { - - Calendar calendar = Calendar.getInstance(); - calendar.setFirstDayOfWeek(Calendar.MONDAY); - calendar.setTime(date); - return calendar.get(Calendar.WEEK_OF_YEAR); - } - - /** - * 属于本年第几月 - * - * @return - */ - public static int getYearMonthIndex(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.MONTH) + 1; - } - - /** - * 当前属于本年第几个季度 - * - * @return - */ - public static int getYeartQuarterIndex(Date date) { - int month = getYearMonthIndex(date); - if (month <= 3) - return 1; - else if (month <= 6) - return 2; - else if (month <= 9) - return 3; - else - return 4; - } - - /** - * 获取date所属年的所有天列表及开始/结束时间 开始时间:date[0],结束时间:date[1] - * - * @param date - * @return - */ - public static List yearDayList(Date date) { - List result = new ArrayList<>(); - Calendar calendar = Calendar.getInstance(); - Date starttm = getYearStartTime(date); - Date endtm = getYearEndTime(date); - calendar.setTime(starttm); - - while (calendar.getTime().before(endtm)) { - Date st = getDayStartTime(calendar.getTime()); - Date et = getDayEndTime(calendar.getTime()); - result.add(new Date[]{st, et}); - calendar.add(Calendar.DAY_OF_YEAR, 1); - } - return result; - - } - - /** - * 获取date所属年的所有星期列表及开始/结束时间 开始时间:date[0],结束时间:date[1] - * - * @param date - * @return - */ - public static List yearWeekList(Date date) { - List result = new ArrayList<>(); - Calendar calendar = Calendar.getInstance(); - Date starttm = getYearStartTime(date); - Date endtm = getYearEndTime(date); - calendar.setTime(starttm); - calendar.setFirstDayOfWeek(Calendar.MONDAY); - while (calendar.getTime().before(endtm)) { - Date st = getWeekStartTime(calendar.getTime()); - Date et = getWeekEndTime(calendar.getTime()); - result.add(new Date[]{st, et}); - calendar.add(Calendar.WEEK_OF_YEAR, 1); - } - return result; - - } - - /** - * 获取date所属年的所有月列表及开始/结束时间 开始时间:date[0],结束时间:date[1] - * - * @param date - * @return - */ - public static List yearMonthList(Date date) { - List result = new ArrayList<>(); - Calendar calendar = Calendar.getInstance(); - Date starttm = getYearStartTime(date); - Date endtm = getYearEndTime(date); - calendar.setTime(starttm); - while (calendar.getTime().before(endtm)) { - Date tm = calendar.getTime(); - Date st = getMonthStartTime(tm); - Date et = getMonthEndTime(tm); - result.add(new Date[]{st, et}); - calendar.add(Calendar.MONTH, 1); - } - return result; - } - - /** - * 获取date所属年的所有季度列表及开始/结束时间 开始时间:date[0],结束时间:date[1] - * - * @param date - * @return - */ - public static List yearQuarterList(Date date) { - List result = new ArrayList<>(); - Calendar calendar = Calendar.getInstance(); - Date starttm = getYearStartTime(date); - Date endtm = getYearEndTime(date); - calendar.setTime(starttm); - while (calendar.getTime().before(endtm)) { - Date st = getQuarterStartTime(calendar.getTime()); - Date et = getQuarterEndTime(calendar.getTime()); - result.add(new Date[]{st, et}); - calendar.add(Calendar.MONTH, 3); - } - return result; - } - - /** - * 获取date所属月份的所有旬列表及开始/结束时间 开始时间:date[0],结束时间:date[1] - * - * @param date - * @return - */ - public static List monthTenDayList(Date date) { - List result = new ArrayList<>(); - Calendar calendar = Calendar.getInstance(); - Date starttm = getMonthStartTime(date); - Date endtm = getMonthEndTime(date); - calendar.setTime(starttm); - - while (calendar.getTime().before(endtm)) { - Date st = getTenDayStartTime(calendar.getTime()); - Date et = getTenDayEndTime(calendar.getTime()); - result.add(new Date[]{st, et}); - calendar.add(Calendar.DAY_OF_MONTH, 11); - } - return result; - } - - /** - * 获取date所属年的所有月旬列表及开始/结束时间 开始时间:date[0],结束时间:date[1] - * - * @param date - * @return - */ - public static List yearTenDayList(Date date) { - List result = new ArrayList<>(); - Calendar calendar = Calendar.getInstance(); - Date starttm = getYearStartTime(date); - Date endtm = getYearEndTime(date); - calendar.setTime(starttm); - - while (calendar.getTime().before(endtm)) {// - result.addAll(monthTenDayList(calendar.getTime())); - calendar.add(Calendar.MONTH, 1); - } - return result; - } - - /** - * 测试 - */ - private static void test() { - Date date = new Date(); - System.out.println("当前小时开始:" + toStr(null, getHourStartTime(date))); - System.out.println("当前小时结束:" + toStr(null, getHourEndTime(date))); - System.out.println("当前天开始:" + toStr(null, getDayStartTime(date))); - System.out.println("当前天时结束:" + toStr(null, getDayEndTime(date))); - System.out.println("当前天是星期:" + getWeekDay(date)); - System.out.println("当前周开始:" + toStr(null, getWeekStartTime(date))); - System.out.println("当前周结束:" + toStr(null, getWeekEndTime(date))); - System.out.println("当前月开始:" + toStr(null, getMonthStartTime(date))); - System.out.println("当前月结束:" + toStr(null, getMonthEndTime(date))); - System.out.println("当前季度开始:" + toStr(null, getQuarterStartTime(date))); - System.out.println("当前季度结束:" + toStr(null, getQuarterEndTime(date))); - System.out.println("当前半年/后半年开始:" + toStr(null, getHalfYearStartTime(date))); - System.out.println("当前半年/后半年结束:" + toStr(null, getHalfYearEndTime(date))); - System.out.println("当前年开始:" + toStr(null, getYearStartTime(date))); - System.out.println("当前年结束:" + toStr(null, getYearEndTime(date))); - System.out.println("当前属于本年第:" + getYearDayIndex(date) + "天"); - System.out.println("当前属于本年第:" + getYearWeekIndex(date) + "周"); - System.out.println("当前属于本年第:" + getYearMonthIndex(date) + "月"); - System.out.println("当前属于本年第:" + getYeartQuarterIndex(date) + "季度"); - System.out.println("时间转换(yyyy): " + toStr(null, toDate("2018"))); - System.out.println("时间转换(yyyy-MM): " + toStr(null, toDate("2018-01"))); - System.out.println("时间转换(yyyy-MM-dd): " + toStr(null, toDate("2018-01-01"))); - System.out.println("时间转换(yyyy-MM-dd hh): " + toStr(null, toDate("2018-01-01 23"))); - System.out.println("时间转换(yyyy-MM-dd hh:mm): " + toStr(null, toDate("2018-01-01 23:59"))); - System.out.println("时间转换(yyyy-MM-dd hh:mm:ss): " + toStr(null, toDate("2018-01-01 23:59:59"))); - System.out.println("时间转换(yyyy-MM-dd HH:mm:ss.SSS): " + toStr(null, toDate("2018-01-01 23:59:59.999"))); - } - - /** - * 测试:获取当年所有日期列表 - */ - private static void testYearDayList() { - List datas = yearDayList(new Date()); - for (int i = 0; i < datas.size(); i++) { - Date[] date = datas.get(i); - System.out.println("(一年的日期列表)第" + (i + 1) + "天:" + sdf.format(date[0]) + " " + sdf.format(date[1])); - } - } - - /** - * 测试:获取当年所有星期列表 - */ - private static void testYearWeekList() { - List datas = yearWeekList(new Date()); - for (int i = 0; i < datas.size(); i++) { - Date[] date = datas.get(i); - System.out.println("(一年的周列表)第" + (i + 1) + "周:" + sdf.format(date[0]) + " " + sdf.format(date[1])); - } - } - - /** - * 测试:获取当年所有季度列表 - */ - private static void testYearQuarterList() { - List datas = yearQuarterList(new Date()); - for (int i = 0; i < datas.size(); i++) { - Date[] date = datas.get(i); - System.out.println("(一年的季度列表)第" + (i + 1) + "季度:" + sdf.format(date[0]) + " " + sdf.format(date[1])); - } - } - - - /** - * 测试:获取当年所有月份列表 - */ - private static void testYearMonthList() { - List datas = yearMonthList(new Date()); - for (int i = 0; i < datas.size(); i++) { - Date[] date = datas.get(i); - System.out.println("(一年的月列表)第" + (i + 1) + "月:" + sdf.format(date[0]) + " " + sdf.format(date[1])); - } - } - - - /** - * 测试:获取当月所有旬列表 - */ - private static void testMonthTenDayList() { - //Date no= DateTimeTools.toDateTime("2018-02-01 15:38:15"); - List datas = monthTenDayList(new Date()); - for (int i = 0; i < datas.size(); i++) { - Date[] date = datas.get(i); - System.out.println("(一月的旬列表)第" + (i % 3 + 1) + "旬:" + sdf.format(date[0]) + " " + sdf.format(date[1])); - } - } - - /** - * 测试:获取当年所有旬列表 - */ - private static void testyearTenDayList() { - List datas = yearTenDayList(new Date()); - for (int i = 0; i < datas.size(); i++) { - Date[] date = datas.get(i); - System.out.println("(一年的旬列表)第" + (i / 3 + 1) + "月" + (i % 3 + 1) + "旬:" + sdf.format(date[0]) + " " + sdf.format(date[1])); - } - } - - /* public static void main(String[] args) { - test(); - testYearDayList(); - testYearWeekList(); - testYearMonthList(); - testYearQuarterList(); - testyearTenDayList(); - testMonthTenDayList(); - }*/ - - /** - * 获取指定月最大天数 - * - * @param year - * @param month - * @return - */ - public static int getMaxDayByYearMonth(int year, int month) { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.DATE, 1); - calendar.set(Calendar.YEAR, year); - calendar.set(Calendar.MONTH, month - 1); - return calendar.getActualMaximum(Calendar.DATE); - } - - /** - * 获取未来 第 past 天的日期 - * - * @param past - * @return - */ - public static Date getFetureDate(Date baseDate, int past) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(baseDate); - calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + past); - return calendar.getTime(); - } - - - public static int getBetweenDays(Date startdate, Date enddate) { - - - Long starTime = startdate.getTime(); - Long endTime = enddate.getTime(); - Long num = endTime - starTime;//时间戳相差的毫秒数 - int days = (int) (num / 24 / 60 / 60 / 1000);//除以一天的毫秒数 - return days; - - } - - /** - * 获取两个日期 相差的天数 - * @param startdate - * @param enddate - * @return - */ - public static int differentDays(Date startdate, Date enddate) { - - Calendar cal1 = Calendar.getInstance(); - cal1.setTime(startdate); - Calendar cal2 = Calendar.getInstance(); - cal2.setTime(enddate); - int day1 = cal1.get(Calendar.DAY_OF_YEAR); - int day2 = cal2.get(Calendar.DAY_OF_YEAR); - int year1 = cal1.get(Calendar.YEAR); - int year2 = cal2.get(Calendar.YEAR); - if (year1 != year2) //不一年 - { - int timeDistance = 0; - for (int i = year1; i < year2; i++) { - if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) //闰年  - { - timeDistance += 366; - } else//不是闰年 - { - timeDistance += 365; - } - } - return timeDistance + (day2 - day1); - } else //同年 - { - System.out.println("判断day2 - day1 : " + (day2 - day1)); - return day2 - day1; - } - } - - -} - - diff --git a/src/com/sipai/tools/DynamicDataSource.java b/src/com/sipai/tools/DynamicDataSource.java deleted file mode 100644 index 098e520e..00000000 --- a/src/com/sipai/tools/DynamicDataSource.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.sipai.tools; - -import java.sql.SQLException; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; - -import com.alibaba.druid.filter.Filter; -import com.alibaba.druid.pool.DruidDataSource; -import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; - -public class DynamicDataSource extends AbstractRoutingDataSource { - @Override - protected Object determineCurrentLookupKey() { - return DataSourceHolder.getDataSources(); - } -} - diff --git a/src/com/sipai/tools/EncryptionDecryption.java b/src/com/sipai/tools/EncryptionDecryption.java deleted file mode 100644 index bee552d2..00000000 --- a/src/com/sipai/tools/EncryptionDecryption.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.sipai.tools; - -import java.security.Key; -import java.security.Security; - -import javax.crypto.Cipher; - -public class EncryptionDecryption { - - /** 字符串默认键值 */ - private static String strDefaultKey = "national"; - - /** 加密工具 */ - private Cipher encryptCipher = null; - - /** 解密工具 */ - private Cipher decryptCipher = null; - - /** - * 将byte数组转换为表示16进制值的字符串, 如:byte[]{8,18}转换为:0813, 和public static byte[] - * hexStr2ByteArr(String strIn) 互为可逆的转换过程 - * - * @param arrB - * 需要转换的byte数组 - * @return 转换后的字符串 - * @throws Exception - * 本方法不处理任何异常,所有异常全部抛出 - */ - public static String byteArr2HexStr(byte[] arrB) throws Exception { - int iLen = arrB.length; - // 每个byte用两个字符才能表示,所以字符串的长度是数组长度的两倍 - StringBuffer sb = new StringBuffer(iLen * 2); - for (int i = 0; i < iLen; i++) { - int intTmp = arrB[i]; - // 把负数转换为正数 - while (intTmp < 0) { - intTmp = intTmp + 256; - } - // 小于0F的数需要在前面补0 - if (intTmp < 16) { - sb.append("0"); - } - sb.append(Integer.toString(intTmp, 16)); - } - return sb.toString(); - } - - /** - * 将表示16进制值的字符串转换为byte数组, 和public static String byteArr2HexStr(byte[] arrB) - * 互为可逆的转换过程 - * - * @param strIn - * 需要转换的字符串 - * @return 转换后的byte数组 - * @throws Exception - * 本方法不处理任何异常,所有异常全部抛出 - * @author LiGuoQing - */ - public static byte[] hexStr2ByteArr(String strIn) throws Exception { - byte[] arrB = strIn.getBytes(); - int iLen = arrB.length; - - // 两个字符表示一个字节,所以字节数组长度是字符串长度除以2 - byte[] arrOut = new byte[iLen / 2]; - for (int i = 0; i < iLen; i = i + 2) { - String strTmp = new String(arrB, i, 2); - arrOut[i / 2] = (byte) Integer.parseInt(strTmp, 16); - } - return arrOut; - } - - /** - * 默认构造方法,使用默认密钥 - * - * @throws Exception - */ - public EncryptionDecryption() throws Exception { - this(strDefaultKey); - } - - /** - * 指定密钥构造方法 - * - * @param strKey - * 指定的密钥 - * @throws Exception - */ - public EncryptionDecryption(String strKey) throws Exception { - Security.addProvider(new com.sun.crypto.provider.SunJCE()); - Key key = getKey(strKey.getBytes()); - - encryptCipher = Cipher.getInstance("DES"); - encryptCipher.init(Cipher.ENCRYPT_MODE, key); - - decryptCipher = Cipher.getInstance("DES"); - decryptCipher.init(Cipher.DECRYPT_MODE, key); - } - - /** - * 加密字节数组 - * - * @param arrB - * 需加密的字节数组 - * @return 加密后的字节数组 - * @throws Exception - */ - public byte[] encrypt(byte[] arrB) throws Exception { - return encryptCipher.doFinal(arrB); - } - - /** - * 加密字符串 - * - * @param strIn - * 需加密的字符串 - * @return 加密后的字符串 - * @throws Exception - */ - public String encrypt(String strIn) throws Exception { - return byteArr2HexStr(encrypt(strIn.getBytes())); - } - - /** - * 解密字节数组 - * - * @param arrB - * 需解密的字节数组 - * @return 解密后的字节数组 - * @throws Exception - */ - public byte[] decrypt(byte[] arrB) throws Exception { - return decryptCipher.doFinal(arrB); - } - - /** - * 解密字符串 - * - * @param strIn - * 需解密的字符串 - * @return 解密后的字符串 - * @throws Exception - */ - public String decrypt(String strIn) throws Exception { - return new String(decrypt(hexStr2ByteArr(strIn))); - } - - /** - * 从指定字符串生成密钥,密钥所需的字节数组长度为8位 不足8位时后面补0,超出8位只取前8位 - * - * @param arrBTmp - * 构成该字符串的字节数组 - * @return 生成的密钥 - * @throws java.lang.Exception - */ - private Key getKey(byte[] arrBTmp) throws Exception { - // 创建一个空的8位字节数组(默认值为0) - byte[] arrB = new byte[8]; - - // 将原始字节数组转换为8位 - for (int i = 0; i < arrBTmp.length && i < arrB.length; i++) { - arrB[i] = arrBTmp[i]; - } - - // 生成密钥 - Key key = new javax.crypto.spec.SecretKeySpec(arrB, "DES"); - - return key; - } - - - } \ No newline at end of file diff --git a/src/com/sipai/tools/ErrorCodeEnum.java b/src/com/sipai/tools/ErrorCodeEnum.java deleted file mode 100644 index 67e5dadf..00000000 --- a/src/com/sipai/tools/ErrorCodeEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sipai.tools; - -public enum ErrorCodeEnum { - // 登录异常 - Token_Refresh(10002, "当前token失效,请更新"), - Time_Out(10001,"页面超时"); - - - - /** 错误码 */ - private final int code; - - /** 描述 */ - private final String description; - - public int getCode() { - return code; - } - - public String getDescription() { - return description; - } - private ErrorCodeEnum(final int code, final String description) { - this.code = code; - this.description = description; - } - - public static ErrorCodeEnum getByCode(int code) { - for (ErrorCodeEnum value : ErrorCodeEnum.values()) { - if (value.getCode()==(code)) { - return value; - } - } - return null; - } -} diff --git a/src/com/sipai/tools/FileUtil.java b/src/com/sipai/tools/FileUtil.java deleted file mode 100644 index 96b1e07a..00000000 --- a/src/com/sipai/tools/FileUtil.java +++ /dev/null @@ -1,685 +0,0 @@ -package com.sipai.tools; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URLEncoder; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.tools.zip.ZipEntry; -import org.apache.tools.zip.ZipOutputStream; - -import com.jacob.activeX.ActiveXComponent; -import com.jacob.com.ComThread; -import com.jacob.com.Dispatch; -import com.jacob.com.Variant; -import com.sipai.entity.base.CommonFile; - -public class FileUtil { - - public static final String IMAGE_FILE_EXT = "jpg;jpeg;png;gif;bmp;ico"; - public static final String ATTACHE_FILE_EXT = "doc;zip;rar;pdf"; - public static final String FORBID_FILE_EXT = "jsp;com;bat"; - public static final String EXE_FILE_EXT = "exe;com;bat"; - - private static final FileUtil util = new FileUtil(); - - public FileUtil() { - } - - public static FileUtil getInstance() { - return util; - } - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - /** - * 判断文件的类型doc;zip;rar;pdf - * - * @param fileName - * 文件名称 - * @return 返回boolean值 - */ - public static boolean isAttacheFile(String fileName) { - return checkExtFile("doc;zip;rar;pdf", fileName); - } - - /** - * 判断文件的类型jsp;com;bat - * - * @param fileName - * 文件名称 - * @return 返回boolean值 - */ - public static boolean isForbidFile(String fileName) { - return checkExtFile("jsp;com;bat", fileName); - } - - /** - * 判断文件的类型为图象文件 - * - * @param fileName - * 文件名称 - * @return 返回boolean值 - */ - public static boolean isImgageFile(String fileName) { - return checkExtFile("jpg;jpeg;png;gif;bmp;ico", fileName); - } - - /** - * 判断文件的类型为可执行文件 - * - * @param fileName - * 文件名称 - * @return 返回boolean值 - */ - public static boolean isExeFile(String fileName) { - return checkExtFile("exe;com;bat", fileName); - } - - /** - * 判断文件是否为该后缀名 - * - * @param ext - * 文件后缀名 - * @param fileName - * 文件名 - * @return 返回boolean值 - */ - public static boolean checkExtFile(String ext, String fileName) { - if (ext == null) - return false; - String exts[] = ext.split(";"); - String file = fileName.toLowerCase(); - for (int i = 0; i < exts.length; i++) - if (file.endsWith("." + exts[i])) - return true; - - return false; - } - - /** - * 得到零时文件名称(绝对路径) - * - * @param dir - * 文件路径 - * @param fileExt - * 文件名 - * @return 绝对路径零时文件名称字符串 - */ - public static String getTempFile(String dir, String fileExt) { - String tempFileName = CommUtil.getRandString(8) + fileExt; - File file = new File(dir + "/" + tempFileName); - if (file.exists()) - return getTempFile(dir, fileExt); - else - return tempFileName; - } - - /** - * 上传文件并判断成功否 - * - * @param in - * 输入流 - * @param fileName - * 文件名 - * @return 返回boolean值 - */ - public static boolean saveFile(InputStream in, String fileName) { - if(FileUtil.isfilename(fileName.substring(0, fileName.lastIndexOf("\\")))){ - File outFile = new File(fileName); - try { - FileOutputStream out = new FileOutputStream(outFile); - byte temp[] = new byte[1024]; - for (int length = -1; (length = in.read(temp)) > 0;){ - out.write(temp, 0, length); - } - out.flush(); - out.close(); - in.close(); - } catch (Exception e) { - System.out.println(e); - return false; - } - return true; - } - return false; - } - public static boolean saveFile(InputStream in, String fileName,CommonFile cf) { - if(FileUtil.isfilename(fileName.substring(0, fileName.lastIndexOf("\\")))){ - File outFile = new File(fileName); - try { - FileOutputStream out = new FileOutputStream(outFile); - byte temp[] = new byte[1024]; - for (int length = -1; (length = in.read(temp)) > 0;){ - out.write(temp, 0, length); - cf.setSize(cf.getSize()+length); - } - out.flush(); - out.close(); - in.close(); - } catch (Exception e) { - System.out.println(e); - return false; - } - return true; - } - return false; - } - /** - * 删除文件 - * - * @param filepath - * 文件路径及名称 - * @throws java.io.IOException - */ - public static void deleteFile(String filepath) throws java.io.IOException { - File f = new File(filepath);// 定义文件路径 - if (f.exists() && f.isDirectory()) {// 判断是文件还是目录 - if (f.listFiles().length == 0) {// 若目录下没有文件则直接删除 - f.delete(); - } else {// 若有则把文件放进数组,并判断是否有下级目录 - File delFile[] = f.listFiles(); - int i = f.listFiles().length; - for (int j = 0; j < i; j++) { - if (delFile[j].isDirectory()) { - deleteFile(delFile[j].getAbsolutePath());// 递归调用del方法并取得子目录路径 - } - delFile[j].delete();// 删除文件 - } - } - deleteFile(filepath);// 递归调用 - }else{ - f.delete(); - } - } - - /** - * 返回文件大小不以字节形势 - * - * @param filesize - * 文件大小值 - * @return 返回文件大小以B,K,M,G - */ - public static String valuemork(int filesize) { - String mess = ""; - int filesizeleng = 0; - filesizeleng = filesize; - if (filesizeleng < 1024) { - mess = filesizeleng + " B"; - } else if (filesizeleng < (1024 * 1024)) { - mess = (filesizeleng / 1024) + " K"; - } else if (filesizeleng < (1024 * 1024 * 1024)) { - mess = (filesizeleng / (1024 * 1024)) + " M"; - } else { - mess = (filesizeleng / (1024 * 1024 * 1024)) + " G"; - } - return mess; - } - - /** - * 判断文件夹存在,不存在则建立 - * - * @param val - * 文件夹名称 - * @return 返回boolean值 - */ - public static boolean isfilename(String val) { - File dirFile; - // File tempFile; - boolean bFile; - bFile = false; - try { - dirFile = new File(val); - bFile = dirFile.exists(); - if (bFile == true) { - // System.out.println("文件夹已存在,将用原来的文件夹"); - } else { - bFile = dirFile.mkdirs(); // 创建文件夹 - if (bFile == true) { - } else { - // System.exit(1); - } - } - - } catch (Exception e) { - // System.out.println("sendmaiaction.java 文件中不能创建新文件夹,错误发生在 :" - // + e.toString()); - } - return bFile; - } - - /** - * 复制单个文件 - * - * @param oldPath - * String 原文件路径 如:c:/fqf.txt - * @param newPath - * String 复制后路径 如:f:/fqf.txt - * @return boolean - */ - @SuppressWarnings({"resource", "unused" }) - public void copyFile(String oldPath, String newPath) { - try { - int bytesum = 0; - int byteread = 0; - File oldfile = new File(oldPath); - if (oldfile.exists()) { // 文件存在时 - InputStream inStream = new FileInputStream(oldPath); // 读入原文件 - FileOutputStream fs = new FileOutputStream(newPath); - byte[] buffer = new byte[8192]; - while ((byteread = inStream.read(buffer, 0, 8192)) != -1) { - bytesum += byteread; // 字节数 文件大小 - fs.write(buffer, 0, byteread); - } - inStream.close(); - } - } catch (Exception e) { - e.printStackTrace(); - - } - - } - /** - * 复制目录下的文件(不包含该目录和子目录,只复制目录下的文件)到指定目录。 - * - * @param targetDir - * @param path - */ - public static void copyFileOnly(String targetDir, String path) { - File file = new File(path); - File targetFile = new File(targetDir); - if (file.isDirectory()) { - File[] files = file.listFiles(); - for (File subFile : files) { - if (subFile.isFile()) { - copyFile(targetFile, subFile); - } - } - } - } - - /** - * 复制目录到指定目录。targetDir是目标目录,path是源目录。 - * 该方法会将path以及path下的文件和子目录全部复制到目标目录 - * - * @param targetDir - * @param path - */ - public static void copyDir(String targetDir, String path) { - File targetFile = new File(targetDir); - createFile(targetFile, false); - File file = new File(path); - if (targetFile.isDirectory() && file.isDirectory()) { - copyFileToDir(targetFile.getAbsolutePath() + "/" + file.getName(), - listFile(file)); - } - } - - /** - * 复制文件到指定目录。targetDir是目标目录,file是源文件名,newName是重命名的名字。 - * - * @param targetFile - * @param file - * @param newName - */ - public static void copyFileToDir(String targetDir, File file, String newName) { - String newFile = ""; - if (newName != null && !"".equals(newName)) { - newFile = targetDir + "/" + newName; - } else { - newFile = targetDir + "/" + file.getName(); - } - File tFile = new File(newFile); - copyFile(tFile, file); - } - - - /** - * 复制一组文件到指定目录。targetDir是目标目录,filePath是需要复制的文件路径 - * - * @param targetDir - * @param filePath - */ - public static void copyFileToDir(String targetDir, String... filePath) { - if (targetDir == null || "".equals(targetDir)) { - System.out.println("参数错误,目标路径不能为空"); - return; - } - File targetFile = new File(targetDir); - if (!targetFile.exists()) { - targetFile.mkdir(); - } else { - if (!targetFile.isDirectory()) { - System.out.println("参数错误,目标路径指向的不是一个目录!"); - return; - } - } - for (String path : filePath) { - File file = new File(path); - if (file.isDirectory()) { - copyFileToDir(targetDir + "/" + file.getName(), listFile(file)); - } else { - copyFileToDir(targetDir, file, ""); - } - } - } - - /** - * 复制文件。targetFile为目标文件,file为源文件 - * - * @param targetFile - * @param file - */ - public static void copyFile(File targetFile, File file) { - if (targetFile.exists()) { -// System.out.println("文件" + targetFile.getAbsolutePath() -// + "已经存在,跳过该文件!"); - return; - } else { - createFile(targetFile, true); - } -// System.out.println("复制文件" + file.getAbsolutePath() + "到" -// + targetFile.getAbsolutePath()); - try { - InputStream is = new FileInputStream(file); - FileOutputStream fos = new FileOutputStream(targetFile); - byte[] buffer = new byte[1024]; - while (is.read(buffer) != -1) { - fos.write(buffer); - } - is.close(); - fos.close(); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /**浏览文件 - * @param dir - * @return - */ - public static String[] listFile(File dir) { - String absolutPath = dir.getAbsolutePath(); - String[] paths = dir.list(); - String[] files = new String[paths.length]; - for (int i = 0; i < paths.length; i++) { - files[i] = absolutPath + "/" + paths[i]; - } - return files; - } - - /**新建文件,根据路径 - * @param path - * @param isFile - */ - public static void createFile(String path, boolean isFile){ - createFile(new File(path), isFile); - } - - /**新建文件,根据文件 - * @param file - * @param isFile - */ - public static void createFile(File file, boolean isFile) { - if (!file.exists()) { - if (!file.getParentFile().exists()) { - createFile(file.getParentFile(), false); - } else { - if (isFile) { - try { - file.createNewFile(); - } catch (IOException e) { - e.printStackTrace(); - } - } else { - file.mkdir(); - } - } - } - } - - /**将批量文件压缩成zip的方式,并返回状态,不进行下载 - * response为HttpServletResponse,zippath为压缩文件的绝对路径,zipname为压缩文件的名字,files为压缩文件 - * @param zippath - * @param files - * @return - */ - public int size=0; - public String copyfiletozipnotdown(String zippath,String zipname,File files[]){ - String res=""; - byte[] bt=new byte[8192]; - try { - ZipOutputStream zout=new ZipOutputStream(new FileOutputStream(zippath+zipname)); - //循环下载每个文件并读取内容 - for(int j=0;j0){ - size++; - zout.write(bt, 0, len); - } - zout.closeEntry(); - is.close(); - } - } - zout.close(); -// toUpload(response,zippath+zipname);//调用下载方法 - res=null; - } catch (FileNotFoundException e) { - e.printStackTrace(); - res="error"; - }catch (IOException e) { - e.printStackTrace(); - res="error"; - } - - return res; - } - - /**将批量文件压缩成zip的方式,并返回状态 - * response为HttpServletResponse,zippath为压缩文件的绝对路径,zipname为压缩文件的名字,files为压缩文件 - * @param zippath - * @param files - * @return - */ - public static String copyfiletozip(HttpServletResponse response,String zippath,String zipname,File files[]){ - String res=""; - byte[] bt=new byte[8192]; - try { - ZipOutputStream zout=new ZipOutputStream(new FileOutputStream(zippath+zipname)); - //循环下载每个文件并读取内容 - for(int j=0;j0){ - zout.write(bt, 0, len); - } - zout.closeEntry(); - is.close(); - } - } - zout.close(); - toUpload(response,zippath+zipname);//调用下载方法 - res=null; - } catch (FileNotFoundException e) { - e.printStackTrace(); - res="error"; - }catch (IOException e) { - e.printStackTrace(); - res="error"; - } - - return res; - } - - //下载公用方法 - public static void toUpload(HttpServletResponse response,String str){ - try { - String path=str; - if(!"".equals(path)){ - File file=new File(path); - if(file.exists()){ - InputStream ins=new FileInputStream(path); - BufferedInputStream bins=new BufferedInputStream(ins);//放到缓冲流里面 - OutputStream outs=response.getOutputStream();//获取文件输出IO流 - BufferedOutputStream bouts=new BufferedOutputStream(outs); - response.setContentType("application/x-download");//设置response内容的类型 - response.setHeader("Content-disposition","attachment;filename="+ URLEncoder.encode(str, "UTF-8"));//设置头部信息 - int bytesRead = 0; - byte[] buffer = new byte[8192]; - //开始向网络传输文件流 - while ((bytesRead = bins.read(buffer, 0, 8192)) != -1) { - bouts.write(buffer, 0, bytesRead); - } - bouts.flush();//这里一定要调用flush()方法 - ins.close(); - bins.close(); - outs.close(); - bouts.close(); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - /**将批量文件压缩成zip的方式,并返回状态 - * @param response HttpServletResponse - * @param filename 要导出文件显示的名称 - * @param abspath 文件的绝对路径和真实名称的组合Str - * @return - */ - public static void downloadFile(HttpServletResponse response,String filename,String abspath) { - if(filename!=null&&!"".equals(filename)&&abspath!=null&&!"".equals(abspath)){ - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - try { - response.reset(); -// response.setContentType("application/x-msdownload");// Safari 浏览器会带后缀.exe - response.setContentType("applicatoin/octet-stream"); - response.setHeader("Content-disposition", "attachment; filename=" - + URLEncoder.encode(filename, "UTF-8")); - bis = new BufferedInputStream(new FileInputStream(abspath)); - bos = new BufferedOutputStream(response.getOutputStream()); - byte[] buff = new byte[1024]; - int bytesRead; - while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { - bos.write(buff, 0, bytesRead); - } - bos.flush(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - bis = null; - bos = null; - } - } - } - - //计时 - public static void trans(String filePath, String pdfPath,String type) { - try { - long old = System.currentTimeMillis(); - System.out.println("jav-转换开始:" + filePath); - toPdf(filePath,pdfPath, type); - System.out.println("完成:" + pdfPath); - long now = System.currentTimeMillis(); - System.out.println("共耗时:" + ((now - old) / 1000.0) + "秒"); - } catch (Exception e) { - System.out.println("转换失败:" + filePath); - e.printStackTrace(); - } - } - - /* - * 转换PDF,使用jacob插件 - * */ - public static void toPdf(String filePath, String pdfPath,String type) { - if("word".equals(type)){ - word2PDF(filePath,pdfPath); - }else if("excel".equals(type)){ - excel2PDF(filePath,pdfPath); - }else if("ppt".equals(type)){ - ppt2PDF(filePath,pdfPath); - } - } - - public static void word2PDF(String inputFile, String pdfFile) { - ActiveXComponent app = new ActiveXComponent("Word.Application"); - try { - app.setProperty("Visible", false); - Dispatch docs = app.getProperty("Documents").toDispatch(); - Dispatch doc = Dispatch.call(docs, "Open", new Object[]{inputFile, false, true}).toDispatch(); - Dispatch.call(doc, "ExportAsFixedFormat", new Object[]{pdfFile, 17}); - Dispatch.call(doc, "Close", new Object[]{false}); - } catch (Exception e) { - e.printStackTrace(); - System.out.println("转换出错:"+pdfFile); - }finally { - app.invoke("Quit"); - } - } - - public static void excel2PDF(String inputFile, String pdfFile) { - ComThread.InitSTA(true); - ActiveXComponent app = new ActiveXComponent("Excel.Application"); - try { - app.setProperty("Visible", false); - app.setProperty("AutomationSecurity", new Variant(3)); - Dispatch excels = app.getProperty("Workbooks").toDispatch(); - Dispatch excel = Dispatch.invoke(excels, "Open", 1, new Object[]{inputFile, new Variant(false), new Variant(false)}, new int[9]).toDispatch(); - Dispatch.invoke(excel, "ExportAsFixedFormat", 1, new Object[]{new Variant(0), pdfFile, new Variant(0)}, new int[1]); - Dispatch.call(excel, "Close", new Object[]{false}); - if (app != null) { - app.invoke("Quit", new Variant[0]); - app = null; - } - ComThread.Release(); - } catch (Exception e) { - e.printStackTrace(); - System.out.println("转换出错:"+pdfFile); - }finally { - app.invoke("Quit"); - } - } - - public static void ppt2PDF(String inputFile, String pdfFile) { - ActiveXComponent app = new ActiveXComponent("PowerPoint.Application"); - try { - Dispatch ppts = app.getProperty("Presentations").toDispatch(); - Dispatch ppt = Dispatch.call(ppts, "Open", new Object[]{inputFile, true, true, false}).toDispatch(); - Dispatch.call(ppt, "SaveAs", new Object[]{pdfFile, 32}); - Dispatch.call(ppt, "Close"); - app.invoke("Quit"); - } catch (Exception e) { - e.printStackTrace(); - System.out.println("转换出错:"+inputFile); - }finally { - app.invoke("Quit"); - } - } -} diff --git a/src/com/sipai/tools/GeneratorSwagger2Doc.java b/src/com/sipai/tools/GeneratorSwagger2Doc.java deleted file mode 100644 index 27bd536f..00000000 --- a/src/com/sipai/tools/GeneratorSwagger2Doc.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.tools; - -import org.mybatis.generator.api.IntrospectedColumn; -import org.mybatis.generator.api.IntrospectedTable; -import org.mybatis.generator.api.PluginAdapter; -import org.mybatis.generator.api.dom.java.Field; -import org.mybatis.generator.api.dom.java.TopLevelClass; - -import java.util.List; - - -public class GeneratorSwagger2Doc extends PluginAdapter { - @Override - public boolean validate(List list) { - return true; - } - - @Override - public boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) { - String classAnnotation = "@ApiModel(description=\"" + introspectedTable.getRemarks() + "\")"; - if (!topLevelClass.getAnnotations().contains(classAnnotation)) { - topLevelClass.addAnnotation(classAnnotation); - } - - String apiModelAnnotationPackage = properties.getProperty("apiModelAnnotationPackage"); - String apiModelPropertyAnnotationPackage = properties.getProperty("apiModelPropertyAnnotationPackage"); - if (null == apiModelAnnotationPackage) { - apiModelAnnotationPackage = "io.swagger.annotations.ApiModel"; - } - if (null == apiModelPropertyAnnotationPackage) { - apiModelPropertyAnnotationPackage = "io.swagger.annotations.ApiModelProperty"; - } - - topLevelClass.addImportedType(apiModelAnnotationPackage); - topLevelClass.addImportedType(apiModelPropertyAnnotationPackage); - - field.addAnnotation("@ApiModelProperty(value=\"" + introspectedColumn.getRemarks() + "\")"); - return super.modelFieldGenerated(field, topLevelClass, introspectedColumn, introspectedTable, modelClassType); - } -} \ No newline at end of file diff --git a/src/com/sipai/tools/GetRealPath.java b/src/com/sipai/tools/GetRealPath.java deleted file mode 100644 index fa725704..00000000 --- a/src/com/sipai/tools/GetRealPath.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.sipai.tools; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - -public class GetRealPath { - public static String DLL_PATH; - - static{ - String path = (Thread.currentThread().getContextClassLoader(). - getResource("").getPath().substring(1).replaceAll("%20", " ").replace("/","\\")); - //System.out.println("path---"+path); - try { - DLL_PATH = URLDecoder.decode(path, "utf-8"); - //System.out.println("DLL_PATH---"+DLL_PATH); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - -} diff --git a/src/com/sipai/tools/GroupManage.java b/src/com/sipai/tools/GroupManage.java deleted file mode 100644 index 72a3070b..00000000 --- a/src/com/sipai/tools/GroupManage.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.sipai.tools; - -/** - * 班组类型 (临时让佛山用一下,待班组类型功能开发出来,换掉) - * sj 2021-07-23 - */ -public enum GroupManage { - Product("run", "运行班组"), Equipment("equipment", "维修班组"); - - private String id; - private String name; - - private GroupManage(String id, String name) { - this.id = id; - this.name = name; - } - - public static String getName(String id) { - for (GroupManage item : GroupManage.values()) { - if (item.getId().equals(id)) { - return item.getName(); - } - } - return null; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public static String getAllPatrolType4JSON() { - String json = ""; - for (GroupManage item : GroupManage.values()) { - if (json == "") { - json += "{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } else { - json += ",{\"id\":\"" + item.getId() + "\",\"text\":\"" + item.getName() + "\"}"; - } - } - json = "[" + json + "]"; - return json; - } -} diff --git a/src/com/sipai/tools/HCNetSDK2.java b/src/com/sipai/tools/HCNetSDK2.java deleted file mode 100644 index 3c1b587b..00000000 --- a/src/com/sipai/tools/HCNetSDK2.java +++ /dev/null @@ -1,6048 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * HCNetSDK.java - * - * Created on 2009-9-14, 19:31:34 - */ - -package com.sipai.tools; - -import com.sun.jna.Native; -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.Union; -import com.sun.jna.examples.win32.GDI32.RECT; -import com.sun.jna.examples.win32.W32API; -import com.sun.jna.examples.win32.W32API.HWND; -import com.sun.jna.ptr.ByteByReference; -import com.sun.jna.win32.StdCallLibrary; -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.ptr.ShortByReference; - -import java.io.File; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.List; - -//SDK接口说明,HCNetSDK.dll -public interface HCNetSDK2 extends StdCallLibrary { - - /*HCNetSDK2 INSTANCE = (HCNetSDK2) Native.loadLibrary - ("d:\\CH-HCNetSDKV6.0.2.35_build20190411_Win64\\" - + "CH-HCNetSDKV6.0.2.35_build20190411_Win64\\kwj\\HCNetSDK", - HCNetSDK2.class);*/ - HCNetSDK2 INSTANCE = (HCNetSDK2) Native.loadLibrary - (GetRealPath.DLL_PATH + "hikvision" + File.separator + "HCNetSDK.dll", - HCNetSDK2.class); - /***宏定义***/ - //常量 - - public static final int MAX_NAMELEN = 16; //DVR本地登陆名 - public static final int MAX_RIGHT = 32; //设备支持的权限(1-12表示本地权限,13-32表示远程权限) - public static final int NAME_LEN = 32; //用户名长度 - public static final int PASSWD_LEN = 16; //密码长度 - public static final int SERIALNO_LEN = 48; //序列号长度 - public static final int MACADDR_LEN = 6; //mac地址长度 - public static final int MAX_ETHERNET = 2; //设备可配以太网络 - public static final int PATHNAME_LEN = 128; //路径长度 - public static final int MAX_TIMESEGMENT_V30 = 8; //9000设备最大时间段数 - public static final int MAX_TIMESEGMENT = 4; //8000设备最大时间段数 - public static final int MAX_SHELTERNUM = 4; //8000设备最大遮挡区域数 - public static final int MAX_DAYS = 7; //每周天数 - public static final int PHONENUMBER_LEN = 32; //pppoe拨号号码最大长度 - public static final int MAX_DISKNUM_V30 = 33; //9000设备最大硬盘数/* 最多33个硬盘(包括16个内置SATA硬盘、1个eSATA硬盘和16个NFS盘) */ - public static final int MAX_DISKNUM = 16; //8000设备最大硬盘数 - public static final int MAX_DISKNUM_V10 = 8; //1.2版本之前版本 - public static final int MAX_WINDOW_V30 = 32; //9000设备本地显示最大播放窗口数 - public static final int MAX_WINDOW = 16; //8000设备最大硬盘数 - public static final int MAX_VGA_V30 = 4; //9000设备最大可接VGA数 - public static final int MAX_VGA = 1; //8000设备最大可接VGA数 - public static final int MAX_USERNUM_V30 = 32; //9000设备最大用户数 - public static final int MAX_USERNUM = 16; //8000设备最大用户数 - public static final int MAX_EXCEPTIONNUM_V30 = 32; //9000设备最大异常处理数 - public static final int MAX_EXCEPTIONNUM = 16; //8000设备最大异常处理数 - public static final int MAX_LINK = 6; //8000设备单通道最大视频流连接数 - public static final int MAX_DECPOOLNUM = 4; //单路解码器每个解码通道最大可循环解码数 - public static final int MAX_DECNUM = 4; //单路解码器的最大解码通道数(实际只有一个,其他三个保留) - public static final int MAX_TRANSPARENTNUM = 2; //单路解码器可配置最大透明通道数 - public static final int MAX_CYCLE_CHAN = 16; //单路解码器最大轮循通道数 - public static final int MAX_DIRNAME_LENGTH = 80; //最大目录长度 - public static final int MAX_STRINGNUM_V30 = 8; //9000设备最大OSD字符行数数 - public static final int MAX_STRINGNUM = 4; //8000设备最大OSD字符行数数 - public static final int MAX_STRINGNUM_EX = 8; //8000定制扩展 - public static final int MAX_AUXOUT_V30 = 16; //9000设备最大辅助输出数 - public static final int MAX_AUXOUT = 4; //8000设备最大辅助输出数 - public static final int MAX_HD_GROUP = 16; //9000设备最大硬盘组数 - public static final int MAX_NFS_DISK = 8; //8000设备最大NFS硬盘数 - public static final int IW_ESSID_MAX_SIZE = 32; //WIFI的SSID号长度 - public static final int IW_ENCODING_TOKEN_MAX = 32; //WIFI密锁最大字节数 - public static final int MAX_SERIAL_NUM = 64; //最多支持的透明通道路数 - public static final int MAX_DDNS_NUMS = 10; //9000设备最大可配ddns数 - public static final int MAX_DOMAIN_NAME = 64; /* 最大域名长度 */ - - public static final int MAX_EMAIL_ADDR_LEN = 48; //最大email地址长度 - public static final int MAX_EMAIL_PWD_LEN = 32; //最大email密码长度 - public static final int MAXPROGRESS = 100; //回放时的最大百分率 - public static final int MAX_SERIALNUM = 2; //8000设备支持的串口数 1-232, 2-485 - public static final int CARDNUM_LEN = 20; //卡号长度 - public static final int MAX_VIDEOOUT_V30 = 4; //9000设备的视频输出数 - public static final int MAX_VIDEOOUT = 2; //8000设备的视频输出数 - public static final int MAX_PRESET_V30 = 256; /* 9000设备支持的云台预置点数 */ - public static final int MAX_TRACK_V30 = 256; /* 9000设备支持的云台轨迹数 */ - public static final int MAX_CRUISE_V30 = 256; /* 9000设备支持的云台巡航数 */ - public static final int MAX_PRESET = 128; /* 8000设备支持的云台预置点数 */ - public static final int MAX_TRACK = 128; /* 8000设备支持的云台轨迹数 */ - public static final int MAX_CRUISE = 128; /* 8000设备支持的云台巡航数 */ - public static final int CRUISE_MAX_PRESET_NUMS = 32; /* 一条巡航最多的巡航点 */ - public static final int MAX_SERIAL_PORT = 8; //9000设备支持232串口数 - public static final int MAX_PREVIEW_MODE = 8; /* 设备支持最大预览模式数目 1画面,4画面,9画面,16画面.... */ - public static final int MAX_MATRIXOUT = 16; /* 最大模拟矩阵输出个数 */ - public static final int LOG_INFO_LEN = 11840; /* 日志附加信息 */ - public static final int DESC_LEN = 16; /* 云台描述字符串长度 */ - public static final int PTZ_PROTOCOL_NUM = 200; /* 9000最大支持的云台协议数 */ - public static final int MAX_AUDIO = 1; //8000语音对讲通道数 - public static final int MAX_AUDIO_V30 = 2; //9000语音对讲通道数 - public static final int MAX_CHANNUM = 16; //8000设备最大通道数 - public static final int MAX_ALARMIN = 16; //8000设备最大报警输入数 - public static final int MAX_ALARMOUT = 4; //8000设备最大报警输出数 - //9000 IPC接入 - public static final int MAX_ANALOG_CHANNUM = 32; //最大32个模拟通道 - public static final int MAX_ANALOG_ALARMOUT = 32; //最大32路模拟报警输出 - public static final int MAX_ANALOG_ALARMIN = 32; //最大32路模拟报警输入 - public static final int MAX_IP_DEVICE = 32; //允许接入的最大IP设备数 - public static final int MAX_IP_CHANNEL = 32; //允许加入的最多IP通道数 - public static final int MAX_IP_ALARMIN = 128; //允许加入的最多报警输入数 - public static final int MAX_IP_ALARMOUT = 64; //允许加入的最多报警输出数 - - /* 最大支持的通道数 最大模拟加上最大IP支持 */ - public static final int MAX_CHANNUM_V30 = (MAX_ANALOG_CHANNUM + MAX_IP_CHANNEL);//64 - public static final int MAX_ALARMOUT_V30 = (MAX_ANALOG_ALARMOUT + MAX_IP_ALARMOUT);//96 - public static final int MAX_ALARMIN_V30 = (MAX_ANALOG_ALARMIN + MAX_IP_ALARMIN);//160 - - public static final int MAX_LICENSE_LEN = 16; - public static final int VCA_MAX_POLYGON_POINT_NUM = 10; - - public static final int MAX_ID_NUM_LEN = 32; //最大身份证号长度 - public static final int MAX_ID_NAME_LEN = 128; //最大姓名长度 - public static final int MAX_ID_ADDR_LEN = 280; //最大住址长度 - public static final int MAX_ID_ISSUING_AUTHORITY_LEN = 128; //最大签发机关长度 - /*******************全局错误码 begin**********************/ - public static final int NET_DVR_NOERROR = 0; //没有错误 - public static final int NET_DVR_PASSWORD_ERROR = 1; //用户名密码错误 - public static final int NET_DVR_NOENOUGHPRI = 2;//权限不足 - public static final int NET_DVR_NOINIT = 3;//没有初始化 - public static final int NET_DVR_CHANNEL_ERROR = 4; //通道号错误 - public static final int NET_DVR_OVER_MAXLINK = 5; //连接到DVR的客户端个数超过最大 - public static final int NET_DVR_VERSIONNOMATCH = 6; //版本不匹配 - public static final int NET_DVR_NETWORK_FAIL_CONNECT = 7;//连接服务器失败 - public static final int NET_DVR_NETWORK_SEND_ERROR = 8; //向服务器发送失败 - public static final int NET_DVR_NETWORK_RECV_ERROR = 9; //从服务器接收数据失败 - public static final int NET_DVR_NETWORK_RECV_TIMEOUT = 10; //从服务器接收数据超时 - public static final int NET_DVR_NETWORK_ERRORDATA = 11; //传送的数据有误 - public static final int NET_DVR_ORDER_ERROR = 12; //调用次序错误 - public static final int NET_DVR_OPERNOPERMIT = 13; //无此权限 - public static final int NET_DVR_COMMANDTIMEOUT = 14; //DVR命令执行超时 - public static final int NET_DVR_ERRORSERIALPORT = 15; //串口号错误 - public static final int NET_DVR_ERRORALARMPORT = 16; //报警端口错误 - public static final int NET_DVR_PARAMETER_ERROR = 17;//参数错误 - public static final int NET_DVR_CHAN_EXCEPTION = 18; //服务器通道处于错误状态 - public static final int NET_DVR_NODISK = 19; //没有硬盘 - public static final int NET_DVR_ERRORDISKNUM = 20; //硬盘号错误 - public static final int NET_DVR_DISK_FULL = 21; //服务器硬盘满 - public static final int NET_DVR_DISK_ERROR = 22;//服务器硬盘出错 - public static final int NET_DVR_NOSUPPORT = 23;//服务器不支持 - public static final int NET_DVR_BUSY = 24;//服务器忙 - public static final int NET_DVR_MODIFY_FAIL = 25;//服务器修改不成功 - public static final int NET_DVR_PASSWORD_FORMAT_ERROR = 26;//密码输入格式不正确 - public static final int NET_DVR_DISK_FORMATING = 27; //硬盘正在格式化,不能启动操作 - public static final int NET_DVR_DVRNORESOURCE = 28; //DVR资源不足 - public static final int NET_DVR_DVROPRATEFAILED = 29; //DVR操作失败 - public static final int NET_DVR_OPENHOSTSOUND_FAIL = 30; //打开PC声音失败 - public static final int NET_DVR_DVRVOICEOPENED = 31; //服务器语音对讲被占用 - public static final int NET_DVR_TIMEINPUTERROR = 32; //时间输入不正确 - public static final int NET_DVR_NOSPECFILE = 33; //回放时服务器没有指定的文件 - public static final int NET_DVR_CREATEFILE_ERROR = 34; //创建文件出错 - public static final int NET_DVR_FILEOPENFAIL = 35; //打开文件出错 - public static final int NET_DVR_OPERNOTFINISH = 36; //上次的操作还没有完成 - public static final int NET_DVR_GETPLAYTIMEFAIL = 37; //获取当前播放的时间出错 - public static final int NET_DVR_PLAYFAIL = 38; //播放出错 - public static final int NET_DVR_FILEFORMAT_ERROR = 39;//文件格式不正确 - public static final int NET_DVR_DIR_ERROR = 40; //路径错误 - public static final int NET_DVR_ALLOC_RESOURCE_ERROR = 41;//资源分配错误 - public static final int NET_DVR_AUDIO_MODE_ERROR = 42; //声卡模式错误 - public static final int NET_DVR_NOENOUGH_BUF = 43; //缓冲区太小 - public static final int NET_DVR_CREATESOCKET_ERROR = 44; //创建SOCKET出错 - public static final int NET_DVR_SETSOCKET_ERROR = 45; //设置SOCKET出错 - public static final int NET_DVR_MAX_NUM = 46; //个数达到最大 - public static final int NET_DVR_USERNOTEXIST = 47; //用户不存在 - public static final int NET_DVR_WRITEFLASHERROR = 48;//写FLASH出错 - public static final int NET_DVR_UPGRADEFAIL = 49;//DVR升级失败 - public static final int NET_DVR_CARDHAVEINIT = 50; //解码卡已经初始化过 - public static final int NET_DVR_PLAYERFAILED = 51; //调用播放库中某个函数失败 - public static final int NET_DVR_MAX_USERNUM = 52; //设备端用户数达到最大 - public static final int NET_DVR_GETLOCALIPANDMACFAIL = 53;//获得客户端的IP地址或物理地址失败 - public static final int NET_DVR_NOENCODEING = 54; //该通道没有编码 - public static final int NET_DVR_IPMISMATCH = 55; //IP地址不匹配 - public static final int NET_DVR_MACMISMATCH = 56;//MAC地址不匹配 - public static final int NET_DVR_UPGRADELANGMISMATCH = 57;//升级文件语言不匹配 - public static final int NET_DVR_MAX_PLAYERPORT = 58;//播放器路数达到最大 - public static final int NET_DVR_NOSPACEBACKUP = 59;//备份设备中没有足够空间进行备份 - public static final int NET_DVR_NODEVICEBACKUP = 60; //没有找到指定的备份设备 - public static final int NET_DVR_PICTURE_BITS_ERROR = 61; //图像素位数不符,限24色 - public static final int NET_DVR_PICTURE_DIMENSION_ERROR = 62;//图片高*宽超限, 限128*256 - public static final int NET_DVR_PICTURE_SIZ_ERROR = 63; //图片大小超限,限100K - public static final int NET_DVR_LOADPLAYERSDKFAILED = 64; //载入当前目录下Player Sdk出错 - public static final int NET_DVR_LOADPLAYERSDKPROC_ERROR = 65; //找不到Player Sdk中某个函数入口 - public static final int NET_DVR_LOADDSSDKFAILED = 66; //载入当前目录下DSsdk出错 - public static final int NET_DVR_LOADDSSDKPROC_ERROR = 67; //找不到DsSdk中某个函数入口 - public static final int NET_DVR_DSSDK_ERROR = 68; //调用硬解码库DsSdk中某个函数失败 - public static final int NET_DVR_VOICEMONOPOLIZE = 69; //声卡被独占 - public static final int NET_DVR_JOINMULTICASTFAILED = 70; //加入多播组失败 - public static final int NET_DVR_CREATEDIR_ERROR = 71; //建立日志文件目录失败 - public static final int NET_DVR_BINDSOCKET_ERROR = 72; //绑定套接字失败 - public static final int NET_DVR_SOCKETCLOSE_ERROR = 73; //socket连接中断,此错误通常是由于连接中断或目的地不可达 - public static final int NET_DVR_USERID_ISUSING = 74; //注销时用户ID正在进行某操作 - public static final int NET_DVR_SOCKETLISTEN_ERROR = 75; //监听失败 - public static final int NET_DVR_PROGRAM_EXCEPTION = 76; //程序异常 - public static final int NET_DVR_WRITEFILE_FAILED = 77; //写文件失败 - public static final int NET_DVR_FORMAT_READONLY = 78;//禁止格式化只读硬盘 - public static final int NET_DVR_WITHSAMEUSERNAME = 79;//用户配置结构中存在相同的用户名 - public static final int NET_DVR_DEVICETYPE_ERROR = 80; /*导入参数时设备型号不匹配*/ - public static final int NET_DVR_LANGUAGE_ERROR = 81; /*导入参数时语言不匹配*/ - public static final int NET_DVR_PARAVERSION_ERROR = 82; /*导入参数时软件版本不匹配*/ - public static final int NET_DVR_IPCHAN_NOTALIVE = 83; /*预览时外接IP通道不在线*/ - public static final int NET_DVR_RTSP_SDK_ERROR = 84; /*加载高清IPC通讯库StreamTransClient.dll失败*/ - public static final int NET_DVR_CONVERT_SDK_ERROR = 85; /*加载转码库失败*/ - public static final int NET_DVR_IPC_COUNT_OVERFLOW = 86; /*超出最大的ip接入通道数*/ - public static final int NET_PLAYM4_NOERROR = 500; //no error - public static final int NET_PLAYM4_PARA_OVER = 501;//input parameter is invalid; - public static final int NET_PLAYM4_ORDER_ERROR = 502;//The order of the function to be called is error. - public static final int NET_PLAYM4_TIMER_ERROR = 503;//Create multimedia clock failed; - public static final int NET_PLAYM4_DEC_VIDEO_ERROR = 504;//Decode video data failed. - public static final int NET_PLAYM4_DEC_AUDIO_ERROR = 505;//Decode audio data failed. - public static final int NET_PLAYM4_ALLOC_MEMORY_ERROR = 506; //Allocate memory failed. - public static final int NET_PLAYM4_OPEN_FILE_ERROR = 507; //Open the file failed. - public static final int NET_PLAYM4_CREATE_OBJ_ERROR = 508;//Create thread or event failed - public static final int NET_PLAYM4_CREATE_DDRAW_ERROR = 509;//Create DirectDraw object failed. - public static final int NET_PLAYM4_CREATE_OFFSCREEN_ERROR = 510;//failed when creating off-screen surface. - public static final int NET_PLAYM4_BUF_OVER = 511; //buffer is overflow - public static final int NET_PLAYM4_CREATE_SOUND_ERROR = 512; //failed when creating audio device. - public static final int NET_PLAYM4_SET_VOLUME_ERROR = 513;//Set volume failed - public static final int NET_PLAYM4_SUPPORT_FILE_ONLY = 514;//The function only support play file. - public static final int NET_PLAYM4_SUPPORT_STREAM_ONLY = 515;//The function only support play stream. - public static final int NET_PLAYM4_SYS_NOT_SUPPORT = 516;//System not support. - public static final int NET_PLAYM4_FILEHEADER_UNKNOWN = 517; //No file header. - public static final int NET_PLAYM4_VERSION_INCORRECT = 518; //The version of decoder and encoder is not adapted. - public static final int NET_PALYM4_INIT_DECODER_ERROR = 519; //Initialize decoder failed. - public static final int NET_PLAYM4_CHECK_FILE_ERROR = 520; //The file data is unknown. - public static final int NET_PLAYM4_INIT_TIMER_ERROR = 521; //Initialize multimedia clock failed. - public static final int NET_PLAYM4_BLT_ERROR = 522;//Blt failed. - public static final int NET_PLAYM4_UPDATE_ERROR = 523;//Update failed. - public static final int NET_PLAYM4_OPEN_FILE_ERROR_MULTI = 524; //openfile error, streamtype is multi - public static final int NET_PLAYM4_OPEN_FILE_ERROR_VIDEO = 525; //openfile error, streamtype is video - public static final int NET_PLAYM4_JPEG_COMPRESS_ERROR = 526; //JPEG compress error - public static final int NET_PLAYM4_EXTRACT_NOT_SUPPORT = 527; //Don't support the version of this file. - public static final int NET_PLAYM4_EXTRACT_DATA_ERROR = 528; //extract video data failed. - /*******************全局错误码 end**********************/ - /************************************************* - NET_DVR_IsSupport()返回值 - 1-9位分别表示以下信息(位与是TRUE)表示支持; - **************************************************/ - public static final int NET_DVR_SUPPORT_DDRAW = 0x01;//支持DIRECTDRAW,如果不支持,则播放器不能工作; - public static final int NET_DVR_SUPPORT_BLT = 0x02;//显卡支持BLT操作,如果不支持,则播放器不能工作; - public static final int NET_DVR_SUPPORT_BLTFOURCC = 0x04;//显卡BLT支持颜色转换,如果不支持,播放器会用软件方法作RGB转换; - public static final int NET_DVR_SUPPORT_BLTSHRINKX = 0x08;//显卡BLT支持X轴缩小;如果不支持,系统会用软件方法转换; - public static final int NET_DVR_SUPPORT_BLTSHRINKY = 0x10;//显卡BLT支持Y轴缩小;如果不支持,系统会用软件方法转换; - public static final int NET_DVR_SUPPORT_BLTSTRETCHX = 0x20;//显卡BLT支持X轴放大;如果不支持,系统会用软件方法转换; - public static final int NET_DVR_SUPPORT_BLTSTRETCHY = 0x40;//显卡BLT支持Y轴放大;如果不支持,系统会用软件方法转换; - public static final int NET_DVR_SUPPORT_SSE = 0x80;//CPU支持SSE指令,Intel Pentium3以上支持SSE指令; - public static final int NET_DVR_SUPPORT_MMX = 0x100;//CPU支持MMX指令集,Intel Pentium3以上支持SSE指令; - /**********************云台控制命令 begin*************************/ - public static final int LIGHT_PWRON = 2; /* 接通灯光电源 */ - public static final int WIPER_PWRON = 3; /* 接通雨刷开关 */ - public static final int FAN_PWRON = 4; /* 接通风扇开关 */ - public static final int HEATER_PWRON = 5; /* 接通加热器开关 */ - public static final int AUX_PWRON1 = 6; /* 接通辅助设备开关 */ - public static final int AUX_PWRON2 = 7; /* 接通辅助设备开关 */ - public static final int SET_PRESET = 8; /* 设置预置点 */ - public static final int CLE_PRESET = 9; /* 清除预置点 */ - public static final int ZOOM_IN = 11; /* 焦距以速度SS变大(倍率变大) */ - public static final int ZOOM_OUT = 12; /* 焦距以速度SS变小(倍率变小) */ - public static final int FOCUS_NEAR = 13; /* 焦点以速度SS前调 */ - public static final int FOCUS_FAR = 14; /* 焦点以速度SS后调 */ - public static final int IRIS_OPEN = 15; /* 光圈以速度SS扩大 */ - public static final int IRIS_CLOSE = 16; /* 光圈以速度SS缩小 */ - public static final int TILT_UP = 21; /* 云台以SS的速度上仰 */ - public static final int TILT_DOWN = 22; /* 云台以SS的速度下俯 */ - public static final int PAN_LEFT = 23; /* 云台以SS的速度左转 */ - public static final int PAN_RIGHT = 24; /* 云台以SS的速度右转 */ - public static final int UP_LEFT = 25; /* 云台以SS的速度上仰和左转 */ - public static final int UP_RIGHT = 26; /* 云台以SS的速度上仰和右转 */ - public static final int DOWN_LEFT = 27; /* 云台以SS的速度下俯和左转 */ - public static final int DOWN_RIGHT = 28; /* 云台以SS的速度下俯和右转 */ - public static final int PAN_AUTO = 29; /* 云台以SS的速度左右自动扫描 */ - public static final int FILL_PRE_SEQ = 30; /* 将预置点加入巡航序列 */ - public static final int SET_SEQ_DWELL = 31; /* 设置巡航点停顿时间 */ - public static final int SET_SEQ_SPEED = 32; /* 设置巡航速度 */ - public static final int CLE_PRE_SEQ = 33;/* 将预置点从巡航序列中删除 */ - public static final int STA_MEM_CRUISE = 34;/* 开始记录轨迹 */ - public static final int STO_MEM_CRUISE = 35;/* 停止记录轨迹 */ - public static final int RUN_CRUISE = 36; /* 开始轨迹 */ - public static final int RUN_SEQ = 37; /* 开始巡航 */ - public static final int STOP_SEQ = 38; /* 停止巡航 */ - public static final int GOTO_PRESET = 39; /* 快球转到预置点 */ - - /**********************云台控制命令 end*************************/ - /************************************************* - 回放时播放控制命令宏定义 - NET_DVR_PlayBackControl - NET_DVR_PlayControlLocDisplay - NET_DVR_DecPlayBackCtrl的宏定义 - 具体支持查看函数说明和代码 - **************************************************/ - public static final int NET_DVR_PLAYSTART = 1;//开始播放 - public static final int NET_DVR_PLAYSTOP = 2;//停止播放 - public static final int NET_DVR_PLAYPAUSE = 3;//暂停播放 - public static final int NET_DVR_PLAYRESTART = 4;//恢复播放 - public static final int NET_DVR_PLAYFAST = 5;//快放 - public static final int NET_DVR_PLAYSLOW = 6;//慢放 - public static final int NET_DVR_PLAYNORMAL = 7;//正常速度 - public static final int NET_DVR_PLAYFRAME = 8;//单帧放 - public static final int NET_DVR_PLAYSTARTAUDIO = 9;//打开声音 - public static final int NET_DVR_PLAYSTOPAUDIO = 10;//关闭声音 - public static final int NET_DVR_PLAYAUDIOVOLUME = 11;//调节音量 - public static final int NET_DVR_PLAYSETPOS = 12;//改变文件回放的进度 - public static final int NET_DVR_PLAYGETPOS = 13;//获取文件回放的进度 - public static final int NET_DVR_PLAYGETTIME = 14;//获取当前已经播放的时间(按文件回放的时候有效) - public static final int NET_DVR_PLAYGETFRAME = 15;//获取当前已经播放的帧数(按文件回放的时候有效) - public static final int NET_DVR_GETTOTALFRAMES = 16;//获取当前播放文件总的帧数(按文件回放的时候有效) - public static final int NET_DVR_GETTOTALTIME = 17;//获取当前播放文件总的时间(按文件回放的时候有效) - public static final int NET_DVR_THROWBFRAME = 20;//丢B帧 - public static final int NET_DVR_SETSPEED = 24;//设置码流速度 - public static final int NET_DVR_KEEPALIVE = 25;//保持与设备的心跳(如果回调阻塞,建议2秒发送一次) - //远程按键定义如下: - /* key value send to CONFIG program */ - public static final int KEY_CODE_1 = 1; - public static final int KEY_CODE_2 = 2; - public static final int KEY_CODE_3 = 3; - public static final int KEY_CODE_4 = 4; - public static final int KEY_CODE_5 = 5; - public static final int KEY_CODE_6 = 6; - public static final int KEY_CODE_7 = 7; - public static final int KEY_CODE_8 = 8; - public static final int KEY_CODE_9 = 9; - public static final int KEY_CODE_0 = 10; - public static final int KEY_CODE_POWER = 11; - public static final int KEY_CODE_MENU = 12; - public static final int KEY_CODE_ENTER = 13; - public static final int KEY_CODE_CANCEL = 14; - public static final int KEY_CODE_UP = 15; - public static final int KEY_CODE_DOWN = 16; - public static final int KEY_CODE_LEFT = 17; - public static final int KEY_CODE_RIGHT = 18; - public static final int KEY_CODE_EDIT = 19; - public static final int KEY_CODE_ADD = 20; - public static final int KEY_CODE_MINUS = 21; - public static final int KEY_CODE_PLAY = 22; - public static final int KEY_CODE_REC = 23; - public static final int KEY_CODE_PAN = 24; - public static final int KEY_CODE_M = 25; - public static final int KEY_CODE_A = 26; - public static final int KEY_CODE_F1 = 27; - public static final int KEY_CODE_F2 = 28; - - /* for PTZ control */ - public static final int KEY_PTZ_UP_START = KEY_CODE_UP; - public static final int KEY_PTZ_UP_STO = 32; - public static final int KEY_PTZ_DOWN_START = KEY_CODE_DOWN; - public static final int KEY_PTZ_DOWN_STOP = 33; - public static final int KEY_PTZ_LEFT_START = KEY_CODE_LEFT; - public static final int KEY_PTZ_LEFT_STOP = 34; - public static final int KEY_PTZ_RIGHT_START = KEY_CODE_RIGHT; - public static final int KEY_PTZ_RIGHT_STOP = 35; - public static final int KEY_PTZ_AP1_START = KEY_CODE_EDIT;/* 光圈+ */ - public static final int KEY_PTZ_AP1_STOP = 36; - public static final int KEY_PTZ_AP2_START = KEY_CODE_PAN;/* 光圈- */ - public static final int KEY_PTZ_AP2_STOP = 37; - public static final int KEY_PTZ_FOCUS1_START = KEY_CODE_A;/* 聚焦+ */ - public static final int KEY_PTZ_FOCUS1_STOP = 38; - public static final int KEY_PTZ_FOCUS2_START = KEY_CODE_M;/* 聚焦- */ - public static final int KEY_PTZ_FOCUS2_STOP = 39; - public static final int KEY_PTZ_B1_START = 40;/* 变倍+ */ - public static final int KEY_PTZ_B1_STOP = 41; - public static final int KEY_PTZ_B2_START = 42;/* 变倍- */ - public static final int KEY_PTZ_B2_STOP = 43; - //9000新增 - public static final int KEY_CODE_11 = 44; - public static final int KEY_CODE_12 = 45; - public static final int KEY_CODE_13 = 46; - public static final int KEY_CODE_14 = 47; - public static final int KEY_CODE_15 = 48; - public static final int KEY_CODE_16 = 49; - /*************************参数配置命令 begin*******************************/ -//用于NET_DVR_SetDVRConfig和NET_DVR_GetDVRConfig,注意其对应的配置结构 - public static final int NET_DVR_GET_DEVICECFG = 100; //获取设备参数 - public static final int NET_DVR_SET_DEVICECFG = 101; //设置设备参数 - public static final int NET_DVR_GET_NETCFG = 102; //获取网络参数 - public static final int NET_DVR_SET_NETCFG = 103; //设置网络参数 - public static final int NET_DVR_GET_PICCFG = 104; //获取图象参数 - public static final int NET_DVR_SET_PICCFG = 105; //设置图象参数 - public static final int NET_DVR_GET_COMPRESSCFG = 106; //获取压缩参数 - public static final int NET_DVR_SET_COMPRESSCFG = 107; //设置压缩参数 - public static final int NET_DVR_GET_RECORDCFG = 108; //获取录像时间参数 - public static final int NET_DVR_SET_RECORDCFG = 109; //设置录像时间参数 - public static final int NET_DVR_GET_DECODERCFG = 110; //获取解码器参数 - public static final int NET_DVR_SET_DECODERCFG = 111; //设置解码器参数 - public static final int NET_DVR_GET_RS232CFG = 112; //获取232串口参数 - public static final int NET_DVR_SET_RS232CFG = 113; //设置232串口参数 - public static final int NET_DVR_GET_ALARMINCFG = 114; //获取报警输入参数 - public static final int NET_DVR_SET_ALARMINCFG = 115; //设置报警输入参数 - public static final int NET_DVR_GET_ALARMOUTCFG = 116; //获取报警输出参数 - public static final int NET_DVR_SET_ALARMOUTCFG = 117; //设置报警输出参数 - public static final int NET_DVR_GET_TIMECFG = 118; //获取DVR时间 - public static final int NET_DVR_SET_TIMECFG = 119; //设置DVR时间 - public static final int NET_DVR_GET_PREVIEWCFG = 120; //获取预览参数 - public static final int NET_DVR_SET_PREVIEWCFG = 121; //设置预览参数 - public static final int NET_DVR_GET_VIDEOOUTCFG = 122; //获取视频输出参数 - public static final int NET_DVR_SET_VIDEOOUTCFG = 123; //设置视频输出参数 - public static final int NET_DVR_GET_USERCFG = 124; //获取用户参数 - public static final int NET_DVR_SET_USERCFG = 125; //设置用户参数 - public static final int NET_DVR_GET_EXCEPTIONCFG = 126; //获取异常参数 - public static final int NET_DVR_SET_EXCEPTIONCFG = 127; //设置异常参数 - public static final int NET_DVR_GET_ZONEANDDST = 128; //获取时区和夏时制参数 - public static final int NET_DVR_SET_ZONEANDDST = 129; //设置时区和夏时制参数 - public static final int NET_DVR_GET_SHOWSTRING = 130; //获取叠加字符参数 - public static final int NET_DVR_SET_SHOWSTRING = 131; //设置叠加字符参数 - public static final int NET_DVR_GET_EVENTCOMPCFG = 132; //获取事件触发录像参数 - public static final int NET_DVR_SET_EVENTCOMPCFG = 133; //设置事件触发录像参数 - public static final int NET_DVR_GET_AUXOUTCFG = 140; //获取报警触发辅助输出设置(HS设备辅助输出2006-02-28) - public static final int NET_DVR_SET_AUXOUTCFG = 141; //设置报警触发辅助输出设置(HS设备辅助输出2006-02-28) - public static final int NET_DVR_GET_PREVIEWCFG_AUX = 142; //获取-s系列双输出预览参数(-s系列双输出2006-04-13) - public static final int NET_DVR_SET_PREVIEWCFG_AUX = 143; //设置-s系列双输出预览参数(-s系列双输出2006-04-13) - public static final int NET_DVR_GET_PICCFG_EX = 200; //获取图象参数(SDK_V14扩展命令) - public static final int NET_DVR_SET_PICCFG_EX = 201; //设置图象参数(SDK_V14扩展命令) - public static final int NET_DVR_GET_USERCFG_EX = 202; //获取用户参数(SDK_V15扩展命令) - public static final int NET_DVR_SET_USERCFG_EX = 203; //设置用户参数(SDK_V15扩展命令) - public static final int NET_DVR_GET_COMPRESSCFG_EX = 204; //获取压缩参数(SDK_V15扩展命令2006-05-15) - public static final int NET_DVR_SET_COMPRESSCFG_EX = 205; //设置压缩参数(SDK_V15扩展命令2006-05-15) - public static final int NET_DVR_GET_NETAPPCFG = 222; //获取网络应用参数 NTP/DDNS/EMAIL - public static final int NET_DVR_SET_NETAPPCFG = 223; //设置网络应用参数 NTP/DDNS/EMAIL - public static final int NET_DVR_GET_NTPCFG = 224; //获取网络应用参数 NTP - public static final int NET_DVR_SET_NTPCFG = 225; //设置网络应用参数 NTP - public static final int NET_DVR_GET_DDNSCFG = 226; //获取网络应用参数 DDNS - public static final int NET_DVR_SET_DDNSCFG = 227; //设置网络应用参数 DDNS - //对应NET_DVR_EMAILPARA - public static final int NET_DVR_GET_EMAILCFG = 228; //获取网络应用参数 EMAIL - public static final int NET_DVR_SET_EMAILCFG = 229; //设置网络应用参数 EMAIL - public static final int NET_DVR_GET_NFSCFG = 230; /* NFS disk config */ - public static final int NET_DVR_SET_NFSCFG = 231; /* NFS disk config */ - public static final int NET_DVR_GET_SHOWSTRING_EX = 238; //获取叠加字符参数扩展(支持8条字符) - public static final int NET_DVR_SET_SHOWSTRING_EX = 239; //设置叠加字符参数扩展(支持8条字符) - public static final int NET_DVR_GET_NETCFG_OTHER = 244; //获取网络参数 - public static final int NET_DVR_SET_NETCFG_OTHER = 245; //设置网络参数 - //对应NET_DVR_EMAILCFG结构 - public static final int NET_DVR_GET_EMAILPARACFG = 250; //Get EMAIL parameters - public static final int NET_DVR_SET_EMAILPARACFG = 251; //Setup EMAIL parameters - public static final int NET_DVR_GET_DDNSCFG_EX = 274;//获取扩展DDNS参数 - public static final int NET_DVR_SET_DDNSCFG_EX = 275;//设置扩展DDNS参数 - public static final int NET_DVR_SET_PTZPOS = 292; //云台设置PTZ位置 - public static final int NET_DVR_GET_PTZPOS = 293; //云台获取PTZ位置 - public static final int NET_DVR_GET_PTZSCOPE = 294;//云台获取PTZ范围 - /***************************DS9000新增命令(_V30) begin *****************************/ -//网络(NET_DVR_NETCFG_V30结构) - public static final int NET_DVR_GET_NETCFG_V30 = 1000; //获取网络参数 - public static final int NET_DVR_SET_NETCFG_V30 = 1001; //设置网络参数 - //图象(NET_DVR_PICCFG_V30结构) - public static final int NET_DVR_GET_PICCFG_V30 = 1002; //获取图象参数 - public static final int NET_DVR_SET_PICCFG_V30 = 1003; //设置图象参数 - //录像时间(NET_DVR_RECORD_V30结构) - public static final int NET_DVR_GET_RECORDCFG_V30 = 1004; //获取录像参数 - public static final int NET_DVR_SET_RECORDCFG_V30 = 1005; //设置录像参数 - //用户(NET_DVR_USER_V30结构) - public static final int NET_DVR_GET_USERCFG_V30 = 1006; //获取用户参数 - public static final int NET_DVR_SET_USERCFG_V30 = 1007; //设置用户参数 - //9000DDNS参数配置(NET_DVR_DDNSPARA_V30结构) - public static final int NET_DVR_GET_DDNSCFG_V30 = 1010; //获取DDNS(9000扩展) - public static final int NET_DVR_SET_DDNSCFG_V30 = 1011; //设置DDNS(9000扩展) - //EMAIL功能(NET_DVR_EMAILCFG_V30结构) - public static final int NET_DVR_GET_EMAILCFG_V30 = 1012;//获取EMAIL参数 - public static final int NET_DVR_SET_EMAILCFG_V30 = 1013;//设置EMAIL参数 - //巡航参数 (NET_DVR_CRUISE_PARA结构) - public static final int NET_DVR_GET_CRUISE = 1020; - public static final int NET_DVR_SET_CRUISE = 1021; - //报警输入结构参数 (NET_DVR_ALARMINCFG_V30结构) - public static final int NET_DVR_GET_ALARMINCFG_V30 = 1024; - public static final int NET_DVR_SET_ALARMINCFG_V30 = 1025; - //报警输出结构参数 (NET_DVR_ALARMOUTCFG_V30结构) - public static final int NET_DVR_GET_ALARMOUTCFG_V30 = 1026; - public static final int NET_DVR_SET_ALARMOUTCFG_V30 = 1027; - //视频输出结构参数 (NET_DVR_VIDEOOUT_V30结构) - public static final int NET_DVR_GET_VIDEOOUTCFG_V30 = 1028; - public static final int NET_DVR_SET_VIDEOOUTCFG_V30 = 1029; - //叠加字符结构参数 (NET_DVR_SHOWSTRING_V30结构) - public static final int NET_DVR_GET_SHOWSTRING_V30 = 1030; - public static final int NET_DVR_SET_SHOWSTRING_V30 = 1031; - //异常结构参数 (NET_DVR_EXCEPTION_V30结构) - public static final int NET_DVR_GET_EXCEPTIONCFG_V30 = 1034; - public static final int NET_DVR_SET_EXCEPTIONCFG_V30 = 1035; - //串口232结构参数 (NET_DVR_RS232CFG_V30结构) - public static final int NET_DVR_GET_RS232CFG_V30 = 1036; - public static final int NET_DVR_SET_RS232CFG_V30 = 1037; - //压缩参数 (NET_DVR_COMPRESSIONCFG_V30结构) - public static final int NET_DVR_GET_COMPRESSCFG_V30 = 1040; - public static final int NET_DVR_SET_COMPRESSCFG_V30 = 1041; - //获取485解码器参数 (NET_DVR_DECODERCFG_V30结构) - public static final int NET_DVR_GET_DECODERCFG_V30 = 1042; //获取解码器参数 - public static final int NET_DVR_SET_DECODERCFG_V30 = 1043; //设置解码器参数 - //获取预览参数 (NET_DVR_PREVIEWCFG_V30结构) - public static final int NET_DVR_GET_PREVIEWCFG_V30 = 1044; //获取预览参数 - public static final int NET_DVR_SET_PREVIEWCFG_V30 = 1045; //设置预览参数 - //辅助预览参数 (NET_DVR_PREVIEWCFG_AUX_V30结构) - public static final int NET_DVR_GET_PREVIEWCFG_AUX_V30 = 1046; //获取辅助预览参数 - public static final int NET_DVR_SET_PREVIEWCFG_AUX_V30 = 1047; //设置辅助预览参数 - //IP接入配置参数 (NET_DVR_IPPARACFG结构) - public static final int NET_DVR_GET_IPPARACFG = 1048; //获取IP接入配置信息 - public static final int NET_DVR_SET_IPPARACFG = 1049; //设置IP接入配置信息 - //IP报警输入接入配置参数 (NET_DVR_IPALARMINCFG结构) - public static final int NET_DVR_GET_IPALARMINCFG = 1050; //获取IP报警输入接入配置信息 - public static final int NET_DVR_SET_IPALARMINCFG = 1051; //设置IP报警输入接入配置信息 - //IP报警输出接入配置参数 (NET_DVR_IPALARMOUTCFG结构) - public static final int NET_DVR_GET_IPALARMOUTCFG = 1052; //获取IP报警输出接入配置信息 - public static final int NET_DVR_SET_IPALARMOUTCFG = 1053; //设置IP报警输出接入配置信息 - //硬盘管理的参数获取 (NET_DVR_HDCFG结构) - public static final int NET_DVR_GET_HDCFG = 1054; //获取硬盘管理配置参数 - public static final int NET_DVR_SET_HDCFG = 1055; //设置硬盘管理配置参数 - //盘组管理的参数获取 (NET_DVR_HDGROUP_CFG结构) - public static final int NET_DVR_GET_HDGROUP_CFG = 1056; //获取盘组管理配置参数 - public static final int NET_DVR_SET_HDGROUP_CFG = 1057; //设置盘组管理配置参数 - //设备编码类型配置(NET_DVR_COMPRESSION_AUDIO结构) - public static final int NET_DVR_GET_COMPRESSCFG_AUD = 1058; //获取设备语音对讲编码参数 - public static final int NET_DVR_SET_COMPRESSCFG_AUD = 1059; //设置设备语音对讲编码参数 - /***************************DS9000新增命令(_V30) end *****************************/ - /*************************参数配置命令 end*******************************/ - /*******************查找文件和日志函数返回值*************************/ - public static final int NET_DVR_FILE_SUCCESS = 1000; //获得文件信息 - public static final int NET_DVR_FILE_NOFIND = 1001; //没有文件 - public static final int NET_DVR_ISFINDING = 1002;//正在查找文件 - public static final int NET_DVR_NOMOREFILE = 1003;//查找文件时没有更多的文件 - public static final int NET_DVR_FILE_EXCEPTION = 1004;//查找文件时异常 - /*********************回调函数类型 begin************************/ - public static final int COMM_ALARM = 0x1100; //8000报警信息主动上传 - public static final int COMM_TRADEINFO = 0x1500; //ATMDVR主动上传交易信息 - public static final int COMM_ALARM_V30 = 0x4000;//9000报警信息主动上传 - public static final int COMM_ALARM_V40 = 0x4007; - public static final int COMM_ALARM_RULE = 0x1102;//行为分析信息上传 - public static final int COMM_ALARM_PDC = 0x1103;//客流量统计报警上传 - public static final int COMM_UPLOAD_PLATE_RESULT = 0x2800;//交通抓拍结果上传 - public static final int COMM_ITS_PLATE_RESULT = 0x3050;//交通抓拍的终端图片上传 - public static final int COMM_IPCCFG = 0x4001;//9000设备IPC接入配置改变报警信息主动上传 - public static final int COMM_ITS_PARK_VEHICLE = 0x3056;//停车场数据上传 - public static final int COMM_ALARM_TFS = 0x1113; //交通取证报警信息 - public static final int COMM_ALARM_TPS_V41 = 0x1114; //交通事件报警信息扩展 - public static final int COMM_ALARM_AID_V41 = 0x1115; //交通事件报警信息扩展 - public static final int COMM_UPLOAD_FACESNAP_RESULT = 0x1112; //人脸识别结果上传 - public static final int COMM_SNAP_MATCH_ALARM = 0x2902; //黑名单比对结果上传 - public static final int COMM_ALARM_ACS = 0x5002; //门禁主机报警信息 - public static final int COMM_ID_INFO_ALARM = 0x5200; //门禁身份证刷卡信息 - public static final int COMM_VCA_ALARM = 0x4993; //智能检测通用报警 - public static final int COMM_ISAPI_ALARM = 0x6009;//ISAPI协议报警信息 - public static final int COMM_ALARM_TPS_STATISTICS = 0x3082; //TPS统计过车数据上传 - /*************操作异常类型(消息方式, 回调方式(保留))****************/ - public static final int EXCEPTION_EXCHANGE = 0x8000;//用户交互时异常 - public static final int EXCEPTION_AUDIOEXCHANGE = 0x8001;//语音对讲异常 - public static final int EXCEPTION_ALARM = 0x8002;//报警异常 - public static final int EXCEPTION_PREVIEW = 0x8003;//网络预览异常 - public static final int EXCEPTION_SERIAL = 0x8004;//透明通道异常 - public static final int EXCEPTION_RECONNECT = 0x8005; //预览时重连 - public static final int EXCEPTION_ALARMRECONNECT = 0x8006;//报警时重连 - public static final int EXCEPTION_SERIALRECONNECT = 0x8007;//透明通道重连 - public static final int EXCEPTION_PLAYBACK = 0x8010;//回放异常 - public static final int EXCEPTION_DISKFMT = 0x8011;//硬盘格式化 - /********************预览回调函数*********************/ - public static final int NET_DVR_SYSHEAD = 1;//系统头数据 - public static final int NET_DVR_STREAMDATA = 2;//视频流数据(包括复合流和音视频分开的视频流数据) - public static final int NET_DVR_AUDIOSTREAMDATA = 3;//音频流数据 - public static final int NET_DVR_STD_VIDEODATA = 4;//标准视频流数据 - public static final int NET_DVR_STD_AUDIODATA = 5;//标准音频流数据 - //回调预览中的状态和消息 - public static final int NET_DVR_REALPLAYEXCEPTION = 111;//预览异常 - public static final int NET_DVR_REALPLAYNETCLOSE = 112;//预览时连接断开 - public static final int NET_DVR_REALPLAY5SNODATA = 113;//预览5s没有收到数据 - public static final int NET_DVR_REALPLAYRECONNECT = 114;//预览重连 - /********************回放回调函数*********************/ - public static final int NET_DVR_PLAYBACKOVER = 101;//回放数据播放完毕 - public static final int NET_DVR_PLAYBACKEXCEPTION = 102;//回放异常 - public static final int NET_DVR_PLAYBACKNETCLOSE = 103;//回放时候连接断开 - public static final int NET_DVR_PLAYBACK5SNODATA = 104; //回放5s没有收到数据 - /*********************回调函数类型 end************************/ -//设备型号(DVR类型) - /* 设备类型 */ - public static final int DVR = 1; /*对尚未定义的dvr类型返回NETRET_DVR*/ - public static final int ATMDVR = 2; /*atm dvr*/ - public static final int DVS = 3; /*DVS*/ - public static final int DEC = 4; /* 6001D */ - public static final int ENC_DEC = 5; /* 6001F */ - public static final int DVR_HC = 6; /*8000HC*/ - public static final int DVR_HT = 7; /*8000HT*/ - public static final int DVR_HF = 8; /*8000HF*/ - public static final int DVR_HS = 9; /* 8000HS DVR(no audio) */ - public static final int DVR_HTS = 10; /* 8016HTS DVR(no audio) */ - public static final int DVR_HB = 11; /* HB DVR(SATA HD) */ - public static final int DVR_HCS = 12; /* 8000HCS DVR */ - public static final int DVS_A = 13; /* 带ATA硬盘的DVS */ - public static final int DVR_HC_S = 14; /* 8000HC-S */ - public static final int DVR_HT_S = 15; /* 8000HT-S */ - public static final int DVR_HF_S = 16; /* 8000HF-S */ - public static final int DVR_HS_S = 17; /* 8000HS-S */ - public static final int ATMDVR_S = 18; /* ATM-S */ - public static final int LOWCOST_DVR = 19; /*7000H系列*/ - public static final int DEC_MAT = 20; /*多路解码器*/ - public static final int DVR_MOBILE = 21; /* mobile DVR */ - public static final int DVR_HD_S = 22; /* 8000HD-S */ - public static final int DVR_HD_SL = 23; /* 8000HD-SL */ - public static final int DVR_HC_SL = 24; /* 8000HC-SL */ - public static final int DVR_HS_ST = 25; /* 8000HS_ST */ - public static final int DVS_HW = 26; /* 6000HW */ - public static final int IPCAM = 30; /*IP 摄像机*/ - public static final int MEGA_IPCAM = 31; /*X52MF系列,752MF,852MF*/ - public static final int IPCAM_X62MF = 32; /*X62MF系列可接入9000设备,762MF,862MF*/ - public static final int IPDOME = 40; /*IP标清快球*/ - public static final int MEGA_IPDOME = 41; /*IP高清快球*/ - public static final int IPMOD = 50; /*IP 模块*/ - public static final int DS71XX_H = 71; /* DS71XXH_S */ - public static final int DS72XX_H_S = 72; /* DS72XXH_S */ - public static final int DS73XX_H_S = 73; /* DS73XXH_S */ - public static final int DS81XX_HS_S = 81; /* DS81XX_HS_S */ - public static final int DS81XX_HL_S = 82; /* DS81XX_HL_S */ - public static final int DS81XX_HC_S = 83; /* DS81XX_HC_S */ - public static final int DS81XX_HD_S = 84; /* DS81XX_HD_S */ - public static final int DS81XX_HE_S = 85; /* DS81XX_HE_S */ - public static final int DS81XX_HF_S = 86; /* DS81XX_HF_S */ - public static final int DS81XX_AH_S = 87; /* DS81XX_AH_S */ - public static final int DS81XX_AHF_S = 88; /* DS81XX_AHF_S */ - public static final int DS90XX_HF_S = 90; /*DS90XX_HF_S*/ - public static final int DS91XX_HF_S = 91; /*DS91XX_HF_S*/ - public static final int DS91XX_HD_S = 92; /*91XXHD-S(MD)*/ - - /* 操作 */ -//主类型 - public static final int MAJOR_OPERATION = 0x3; - //次类型 - public static final int MINOR_START_DVR = 0x41; /* 开机 */ - public static final int MINOR_STOP_DVR = 0x42;/* 关机 */ - public static final int MINOR_STOP_ABNORMAL = 0x43;/* 异常关机 */ - public static final int MINOR_REBOOT_DVR = 0x44; /*本地重启设备*/ - public static final int MINOR_LOCAL_LOGIN = 0x50; /* 本地登陆 */ - public static final int MINOR_LOCAL_LOGOUT = 0x51; /* 本地注销登陆 */ - public static final int MINOR_LOCAL_CFG_PARM = 0x52; /* 本地配置参数 */ - public static final int MINOR_LOCAL_PLAYBYFILE = 0x53; /* 本地按文件回放或下载 */ - public static final int MINOR_LOCAL_PLAYBYTIME = 0x54; /* 本地按时间回放或下载*/ - public static final int MINOR_LOCAL_START_REC = 0x55; /* 本地开始录像 */ - public static final int MINOR_LOCAL_STOP_REC = 0x56; /* 本地停止录像 */ - public static final int MINOR_LOCAL_PTZCTRL = 0x57; /* 本地云台控制 */ - public static final int MINOR_LOCAL_PREVIEW = 0x58;/* 本地预览 (保留不使用)*/ - public static final int MINOR_LOCAL_MODIFY_TIME = 0x59;/* 本地修改时间(保留不使用) */ - public static final int MINOR_LOCAL_UPGRADE = 0x5a;/* 本地升级 */ - public static final int MINOR_LOCAL_RECFILE_OUTPUT = 0x5b; /* 本地备份录象文件 */ - public static final int MINOR_LOCAL_FORMAT_HDD = 0x5c; /* 本地初始化硬盘 */ - public static final int MINOR_LOCAL_CFGFILE_OUTPUT = 0x5d; /* 导出本地配置文件 */ - public static final int MINOR_LOCAL_CFGFILE_INPUT = 0x5e; /* 导入本地配置文件 */ - public static final int MINOR_LOCAL_COPYFILE = 0x5f; /* 本地备份文件 */ - public static final int MINOR_LOCAL_LOCKFILE = 0x60; /* 本地锁定录像文件 */ - public static final int MINOR_LOCAL_UNLOCKFILE = 0x61; /* 本地解锁录像文件 */ - public static final int MINOR_LOCAL_DVR_ALARM = 0x62; /* 本地手动清除和触发报警*/ - public static final int MINOR_IPC_ADD = 0x63; /* 本地添加IPC */ - public static final int MINOR_IPC_DEL = 0x64; /* 本地删除IPC */ - public static final int MINOR_IPC_SET = 0x65; /* 本地设置IPC */ - public static final int MINOR_LOCAL_START_BACKUP = 0x66; /* 本地开始备份 */ - public static final int MINOR_LOCAL_STOP_BACKUP = 0x67;/* 本地停止备份*/ - public static final int MINOR_LOCAL_COPYFILE_START_TIME = 0x68;/* 本地备份开始时间*/ - public static final int MINOR_LOCAL_COPYFILE_END_TIME = 0x69; /* 本地备份结束时间*/ - public static final int MINOR_REMOTE_LOGIN = 0x70;/* 远程登录 */ - public static final int MINOR_REMOTE_LOGOUT = 0x71;/* 远程注销登陆 */ - public static final int MINOR_REMOTE_START_REC = 0x72;/* 远程开始录像 */ - public static final int MINOR_REMOTE_STOP_REC = 0x73;/* 远程停止录像 */ - public static final int MINOR_START_TRANS_CHAN = 0x74;/* 开始透明传输 */ - public static final int MINOR_STOP_TRANS_CHAN = 0x75; /* 停止透明传输 */ - public static final int MINOR_REMOTE_GET_PARM = 0x76;/* 远程获取参数 */ - public static final int MINOR_REMOTE_CFG_PARM = 0x77;/* 远程配置参数 */ - public static final int MINOR_REMOTE_GET_STATUS = 0x78;/* 远程获取状态 */ - public static final int MINOR_REMOTE_ARM = 0x79; /* 远程布防 */ - public static final int MINOR_REMOTE_DISARM = 0x7a;/* 远程撤防 */ - public static final int MINOR_REMOTE_REBOOT = 0x7b; /* 远程重启 */ - public static final int MINOR_START_VT = 0x7c;/* 开始语音对讲 */ - public static final int MINOR_STOP_VT = 0x7d;/* 停止语音对讲 */ - public static final int MINOR_REMOTE_UPGRADE = 0x7e; /* 远程升级 */ - public static final int MINOR_REMOTE_PLAYBYFILE = 0x7f; /* 远程按文件回放 */ - public static final int MINOR_REMOTE_PLAYBYTIME = 0x80; /* 远程按时间回放 */ - public static final int MINOR_REMOTE_PTZCTRL = 0x81; /* 远程云台控制 */ - public static final int MINOR_REMOTE_FORMAT_HDD = 0x82; /* 远程格式化硬盘 */ - public static final int MINOR_REMOTE_STOP = 0x83; /* 远程关机 */ - public static final int MINOR_REMOTE_LOCKFILE = 0x84;/* 远程锁定文件 */ - public static final int MINOR_REMOTE_UNLOCKFILE = 0x85;/* 远程解锁文件 */ - public static final int MINOR_REMOTE_CFGFILE_OUTPUT = 0x86; /* 远程导出配置文件 */ - public static final int MINOR_REMOTE_CFGFILE_INTPUT = 0x87; /* 远程导入配置文件 */ - public static final int MINOR_REMOTE_RECFILE_OUTPUT = 0x88; /* 远程导出录象文件 */ - public static final int MINOR_REMOTE_DVR_ALARM = 0x89; /* 远程手动清除和触发报警*/ - public static final int MINOR_REMOTE_IPC_ADD = 0x8a; /* 远程添加IPC */ - public static final int MINOR_REMOTE_IPC_DEL = 0x8b;/* 远程删除IPC */ - public static final int MINOR_REMOTE_IPC_SET = 0x8c; /* 远程设置IPC */ - public static final int MINOR_REBOOT_VCA_LIB = 0x8d; /*重启智能库*/ - - /*日志附加信息*/ -//主类型 - public static final int MAJOR_INFORMATION = 0x4; /*附加信息*/ - //次类型 - public static final int MINOR_HDD_INFO = 0xa1;/*硬盘信息*/ - public static final int MINOR_SMART_INFO = 0xa2; /*SMART信息*/ - public static final int MINOR_REC_START = 0xa3; /*开始录像*/ - public static final int MINOR_REC_STOP = 0xa4;/*停止录像*/ - public static final int MINOR_REC_OVERDUE = 0xa5;/*过期录像删除*/ - public static final int MINOR_LINK_START = 0xa6; // ivms,多路解码器等连接前端设备 - public static final int MINOR_LINK_STOP = 0xa7;// ivms,多路解码器等断开前端设备  - //当日志的主类型为MAJOR_OPERATION=03,次类型为MINOR_LOCAL_CFG_PARM=0x52或者MINOR_REMOTE_GET_PARM=0x76或者MINOR_REMOTE_CFG_PARM=0x77时,dwParaType:参数类型有效,其含义如下: - public static final int PARA_VIDEOOUT = 0x1; - public static final int PARA_IMAGE = 0x2; - public static final int PARA_ENCODE = 0x4; - public static final int PARA_NETWORK = 0x8; - public static final int PARA_ALARM = 0x10; - public static final int PARA_EXCEPTION = 0x20; - public static final int PARA_DECODER = 0x40; /*解码器*/ - public static final int PARA_RS232 = 0x80; - public static final int PARA_PREVIEW = 0x100; - public static final int PARA_SECURITY = 0x200; - public static final int PARA_DATETIME = 0x400; - public static final int PARA_FRAMETYPE = 0x800; /*帧格式*/ - public static final int PARA_VCA_RULE = 0x1000; //行为规则 - //SDK_V222 -//智能设备类型 - public static final int DS6001_HF_B = 60;//行为分析:DS6001-HF/B - public static final int DS6001_HF_P = 61;//车牌识别:DS6001-HF/P - public static final int DS6002_HF_B = 62;//双机跟踪:DS6002-HF/B - public static final int DS6101_HF_B = 63;//行为分析:DS6101-HF/B - public static final int IVMS_2000 = 64;//智能分析仪 - public static final int DS9000_IVS = 65;//9000系列智能DVR - public static final int DS8004_AHL_A = 66;//智能ATM, DS8004AHL-S/A - public static final int DS6101_HF_P = 67;//车牌识别:DS6101-HF/P - //能力获取命令 - public static final int VCA_DEV_ABILITY = 0x100;//设备智能分析的总能力 - public static final int VCA_CHAN_ABILITY = 0x110;//行为分析能力 - //获取/设置大接口参数配置命令 -//车牌识别(NET_VCA_PLATE_CFG); - public static final int NET_DVR_SET_PLATECFG = 150;//设置车牌识别参数 - - public static final int NET_DVR_GET_PLATECFG = 151; //获取车牌识别参数 - //行为对应(NET_VCA_RULECFG) - public static final int NET_DVR_SET_RULECFG = 152; //设置行为分析规则 - public static final int NET_DVR_GET_RULECFG = 153;//获取行为分析规则, - //双摄像机标定参数(NET_DVR_LF_CFG) - public static final int NET_DVR_SET_LF_CFG = 160;//设置双摄像机的配置参数 - public static final int NET_DVR_GET_LF_CFG = 161;//获取双摄像机的配置参数 - //智能分析仪取流配置结构 - public static final int NET_DVR_SET_IVMS_STREAMCFG = 162; //设置智能分析仪取流参数 - public static final int NET_DVR_GET_IVMS_STREAMCFG = 163; //获取智能分析仪取流参数 - //智能控制参数结构 - public static final int NET_DVR_SET_VCA_CTRLCFG = 164; //设置智能控制参数 - public static final int NET_DVR_GET_VCA_CTRLCFG = 165; //获取智能控制参数 - //屏蔽区域NET_VCA_MASK_REGION_LIST - public static final int NET_DVR_SET_VCA_MASK_REGION = 166; //设置屏蔽区域参数 - public static final int NET_DVR_GET_VCA_MASK_REGION = 167; //获取屏蔽区域参数 - //ATM进入区域 NET_VCA_ENTER_REGION - public static final int NET_DVR_SET_VCA_ENTER_REGION = 168; //设置进入区域参数 - public static final int NET_DVR_GET_VCA_ENTER_REGION = 169; //获取进入区域参数 - //标定线配置NET_VCA_LINE_SEGMENT_LIST - public static final int NET_DVR_SET_VCA_LINE_SEGMENT = 170; //设置标定线 - public static final int NET_DVR_GET_VCA_LINE_SEGMENT = 171; //获取标定线 - // ivms屏蔽区域NET_IVMS_MASK_REGION_LIST - public static final int NET_DVR_SET_IVMS_MASK_REGION = 172; //设置IVMS屏蔽区域参数 - public static final int NET_DVR_GET_IVMS_MASK_REGION = 173; //获取IVMS屏蔽区域参数 - // ivms进入检测区域NET_IVMS_ENTER_REGION - public static final int NET_DVR_SET_IVMS_ENTER_REGION = 174; //设置IVMS进入区域参数 - public static final int NET_DVR_GET_IVMS_ENTER_REGION = 175; //获取IVMS进入区域参数 - public static final int NET_DVR_SET_IVMS_BEHAVIORCFG = 176;//设置智能分析仪行为规则参数 - public static final int NET_DVR_GET_IVMS_BEHAVIORCFG = 177; //获取智能分析仪行为规则参数 - public static final int NET_DVR_GET_TRAVERSE_PLANE_DETECTION = 3360; //获取越界侦测配置 - - public static final int NET_DVR_GET_CARD_CFG = 2116; //获取卡参数 - public static final int NET_DVR_SET_CARD_CFG = 2117; //设置卡参数 - /**********************设备类型 end***********************/ - - /************************************************* - 参数配置结构、参数(其中_V30为9000新增) - **************************************************/ - -///////////////////////////////////////////////////////////////////////// -//校时结构参数 - public static class NET_DVR_TIME extends Structure {//校时结构参数 - public int dwYear; //年 - public int dwMonth; //月 - public int dwDay; //日 - public int dwHour; //时 - public int dwMinute; //分 - public int dwSecond; //秒 - - public String toString() { - return "NET_DVR_TIME.dwYear: " + dwYear + "\n" + "NET_DVR_TIME.dwMonth: \n" + dwMonth + "\n" + "NET_DVR_TIME.dwDay: \n" + dwDay + "\n" + "NET_DVR_TIME.dwHour: \n" + dwHour + "\n" + "NET_DVR_TIME.dwMinute: \n" + dwMinute + "\n" + "NET_DVR_TIME.dwSecond: \n" + dwSecond; - } - - //用于列表中显示 - public String toStringTime() { - return String.format("%02d/%02d/%02d%02d:%02d:%02d", dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond); - } - - //存储文件名使用 - public String toStringTitle() { - return String.format("Time%02d%02d%02d%02d%02d%02d", dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond); - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_SCHEDTIME extends Structure { - public byte byStartHour; //开始时间 - public byte byStartMin; - public byte byStopHour; //结束时间 - public byte byStopMin; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_HANDLEEXCEPTION_V30 extends Structure { - public int dwHandleType; /*处理方式,处理方式的"或"结果*//*0x00: 无响应*//*0x01: 监视器上警告*//*0x02: 声音警告*//*0x04: 上传中心*/ /*0x08: 触发报警输出*//*0x20: 触发抓图*/ //(JPEG定制) - public byte[] byRelAlarmOut = new byte[MAX_ALARMOUT_V30]; //报警触发的输出通道,报警触发的输出,为1表示触发该输出 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //报警和异常处理结构(子结构)(多处使用) - public static class NET_DVR_HANDLEEXCEPTION extends Structure { - public int dwHandleType; /*处理方式,处理方式的"或"结果*//*0x00: 无响应*//*0x01: 监视器上警告*//*0x02: 声音警告*//*0x04: 上传中心*/ /*0x08: 触发报警输出*//*0x20: 触发抓图*/ //(JPEG定制) - public byte[] byRelAlarmOut = new byte[MAX_ALARMOUT]; //报警触发的输出通道,报警触发的输出,为1表示触发该输出 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //DVR设备参数 - public static class NET_DVR_DEVICECFG extends Structure { - public int dwSize; - public byte[] sDVRName = new byte[NAME_LEN]; //DVR名称 - public int dwDVRID; //DVR ID,用于遥控器 //V1.4(0-99), V1.5(0-255) - public int dwRecycleRecord; //是否循环录像,0:不是; 1:是 - //以下不可更改 - public byte[] sSerialNumber = new byte[SERIALNO_LEN]; //序列号 - public int dwSoftwareVersion; //软件版本号,高16位是主版本,低16位是次版本 - public int dwSoftwareBuildDate; //软件生成日期,0xYYYYMMDD - public int dwDSPSoftwareVersion; //DSP软件版本,高16位是主版本,低16位是次版本 - public int dwDSPSoftwareBuildDate; // DSP软件生成日期,0xYYYYMMDD - public int dwPanelVersion; // 前面板版本,高16位是主版本,低16位是次版本 - public int dwHardwareVersion; // 硬件版本,高16位是主版本,低16位是次版本 - public byte byAlarmInPortNum; //DVR报警输入个数 - public byte byAlarmOutPortNum; //DVR报警输出个数 - public byte byRS232Num; //DVR 232串口个数 - public byte byRS485Num; //DVR 485串口个数 - public byte byNetworkPortNum; //网络口个数 - public byte byDiskCtrlNum; //DVR 硬盘控制器个数 - public byte byDiskNum; //DVR 硬盘个数 - public byte byDVRType; //DVR类型, 1:DVR 2:ATM DVR 3:DVS ...... - public byte byChanNum; //DVR 通道个数 - public byte byStartChan; //起始通道号,例如DVS-1,DVR - 1 - public byte byDecordChans; //DVR 解码路数 - public byte byVGANum; //VGA口的个数 - public byte byUSBNum; //USB口的个数 - public byte byAuxoutNum; //辅口的个数 - public byte byAudioNum; //语音口的个数 - public byte byIPChanNum; //最大数字通道数 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPADDR extends Structure { - public byte[] sIpV4 = new byte[16]; - public byte[] byRes = new byte[128]; - - public String toString() { - return "NET_DVR_IPADDR.sIpV4: " + new String(sIpV4) + "\n" + "NET_DVR_IPADDR.byRes: " + new String(byRes) + "\n"; - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - //网络数据结构(子结构)(9000扩展) - public static class NET_DVR_ETHERNET_V30 extends Structure { - public NET_DVR_IPADDR struDVRIP; - public NET_DVR_IPADDR struDVRIPMask; - public int dwNetInterface; - public short wDVRPort; - public short wMTU; - public byte[] byMACAddr = new byte[6]; - - public String toString() { - return "NET_DVR_ETHERNET_V30.struDVRIP: \n" + struDVRIP + "\n" + "NET_DVR_ETHERNET_V30.struDVRIPMask: \n" + struDVRIPMask + "\n" + "NET_DVR_ETHERNET_V30.dwNetInterface: " + dwNetInterface + "\n" + "NET_DVR_ETHERNET_V30.wDVRPort: " + wDVRPort + "\n" + "NET_DVR_ETHERNET_V30.wMTU: " + wMTU + "\n" + "NET_DVR_ETHERNET_V30.byMACAddr: " + new String(byMACAddr) + "\n"; - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ETHERNET extends Structure {//网络数据结构(子结构) - public byte[] sDVRIP = new byte[16]; //DVR IP地址 - public byte[] sDVRIPMask = new byte[16]; //DVR IP地址掩码 - public int dwNetInterface; //网络接口 1-10MBase-T 2-10MBase-T全双工 3-100MBase-TX 4-100M全双工 5-10M/100M自适应 - public short wDVRPort; //端口号 - public byte[] byMACAddr = new byte[MACADDR_LEN]; //服务器的物理地址 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PPPOECFG extends Structure {//PPPoe - public int dwPPPoE; - public byte[] sPPPoEUser = new byte[32]; - public byte[] sPPPoEPassword = new byte[16]; - public NET_DVR_IPADDR struPPPoEIP; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_NETCFG_V30 extends Structure { - public int dwSize; - public NET_DVR_ETHERNET_V30[] struEtherNet = new NET_DVR_ETHERNET_V30[2]; - public NET_DVR_IPADDR[] struRes1 = new NET_DVR_IPADDR[2]; - public NET_DVR_IPADDR struAlarmHostIpAddr; - public short[] wRes2 = new short[2]; - public short wAlarmHostIpPort; - public byte byUseDhcp; - public byte byRes3; - public NET_DVR_IPADDR struDnsServer1IpAddr; - public NET_DVR_IPADDR struDnsServer2IpAddr; - public byte[] byIpResolver = new byte[64]; - public short wIpResolverPort; - public short wHttpPortNo; - public NET_DVR_IPADDR struMulticastIpAddr; - public NET_DVR_IPADDR struGatewayIpAddr; - public NET_DVR_PPPOECFG struPPPoE; - public byte[] byRes = new byte[64]; - - public String toString() { - return "NET_DVR_NETCFG_V30.dwSize: " + dwSize + "\n" + "NET_DVR_NETCFG_V30.struEtherNet[0]: \n" + struEtherNet[0] + "\n" + "NET_DVR_NETCFG_V30.struAlarmHostIpAddr: \n" + struAlarmHostIpAddr + "\n" + "NET_DVR_NETCFG_V30.wAlarmHostIpPort: " + wAlarmHostIpPort + "\n" + "NET_DVR_NETCFG_V30.wHttpPortNo: " + wHttpPortNo + "\n" + "NET_DVR_NETCFG_V30.struGatewayIpAddr: \n" + struGatewayIpAddr + "\n"; - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_NETCFG extends Structure {//网络配置结构 - public int dwSize; - public NET_DVR_ETHERNET[] struEtherNet = new NET_DVR_ETHERNET[MAX_ETHERNET]; /* 以太网口 */ - public byte[] sManageHostIP = new byte[16]; //远程管理主机地址 - public short wManageHostPort; //远程管理主机端口号 - public byte[] sIPServerIP = new byte[16]; //IPServer服务器地址 - public byte[] sMultiCastIP = new byte[16]; //多播组地址 - public byte[] sGatewayIP = new byte[16]; //网关地址 - public byte[] sNFSIP = new byte[16]; //NFS主机IP地址 - public byte[] sNFSDirectory = new byte[PATHNAME_LEN];//NFS目录 - public int dwPPPOE; //0-不启用,1-启用 - public byte[] sPPPoEUser = new byte[NAME_LEN]; //PPPoE用户名 - public byte[] sPPPoEPassword = new byte[PASSWD_LEN];// PPPoE密码 - public byte[] sPPPoEIP = new byte[16]; //PPPoE IP地址(只读) - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //通道图象结构 - public static class NET_DVR_SCHEDTIMEWEEK extends Structure { - public NET_DVR_SCHEDTIME[] struAlarmTime = new NET_DVR_SCHEDTIME[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class byte96 extends Structure { - public byte[] byMotionScope = new byte[96]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MOTION_V30 extends Structure {//移动侦测(子结构)(9000扩展) - public byte96[] byMotionScope = new byte96[64]; /*侦测区域,0-96位,表示64行,共有96*64个小宏块,为1表示是移动侦测区域,0-表示不是*/ - public byte byMotionSensitive; /*移动侦测灵敏度, 0 - 5,越高越灵敏,oxff关闭*/ - public byte byEnableHandleMotion; /* 是否处理移动侦测 0-否 1-是*/ - public byte byPrecision; /* 移动侦测算法的进度: 0--16*16, 1--32*32, 2--64*64 ... */ - public byte reservedData; - public NET_DVR_HANDLEEXCEPTION_V30 struMotionHandleType; /* 处理方式 */ - public NET_DVR_SCHEDTIMEWEEK[] struAlarmTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS]; /*布防时间*/ - public byte[] byRelRecordChan = new byte[64]; /* 报警触发的录象通道*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MOTION extends Structure {//移动侦测(子结构) - byte[][] byMotionScope = new byte[18][22]; /*侦测区域,共有22*18个小宏块,为1表示改宏块是移动侦测区域,0-表示不是*/ - byte byMotionSensitive; /*移动侦测灵敏度, 0 - 5,越高越灵敏,0xff关闭*/ - byte byEnableHandleMotion; /* 是否处理移动侦测 */ - byte[] reservedData = new byte[2]; - NET_DVR_HANDLEEXCEPTION strMotionHandleType; /* 处理方式 */ - byte[] byRelRecordChan = new byte[MAX_CHANNUM]; //报警触发的录象通道,为1表示触发该通道 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_HIDEALARM_V30 extends Structure {//遮挡报警 - public int dwEnableHideAlarm; /* 是否启动遮挡报警 ,0-否,1-低灵敏度 2-中灵敏度 3-高灵敏度*/ - public short wHideAlarmAreaTopLeftX; /* 遮挡区域的x坐标 */ - public short wHideAlarmAreaTopLeftY; /* 遮挡区域的y坐标 */ - public short wHideAlarmAreaWidth; /* 遮挡区域的宽 */ - public short wHideAlarmAreaHeight; /*遮挡区域的高*/ - public NET_DVR_HANDLEEXCEPTION_V30 strHideAlarmHandleType; /* 处理方式 */ - public NET_DVR_SCHEDTIMEWEEK[] struAlarmTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS];//布防时间 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_HIDEALARM extends Structure {//遮挡报警(子结构) 区域大小704*576 - public int dwEnableHideAlarm; /* 是否启动遮挡报警 ,0-否,1-低灵敏度 2-中灵敏度 3-高灵敏度*/ - public short wHideAlarmAreaTopLeftX; /* 遮挡区域的x坐标 */ - public short wHideAlarmAreaTopLeftY; /* 遮挡区域的y坐标 */ - public short wHideAlarmAreaWidth; /* 遮挡区域的宽 */ - public short wHideAlarmAreaHeight; /*遮挡区域的高*/ - public NET_DVR_HANDLEEXCEPTION strHideAlarmHandleType; /* 处理方式 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VILOST_V30 extends Structure { //信号丢失报警(子结构)(9000扩展) - public byte byEnableHandleVILost; /* 是否处理信号丢失报警 */ - public NET_DVR_HANDLEEXCEPTION_V30 strVILostHandleType; /* 处理方式 */ - public NET_DVR_SCHEDTIMEWEEK[] struAlarmTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS];//布防时间 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VILOST extends Structure { //信号丢失报警(子结构) - byte byEnableHandleVILost; /* 是否处理信号丢失报警 */ - NET_DVR_HANDLEEXCEPTION strVILostHandleType; /* 处理方式 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_SHELTER extends Structure { //遮挡区域(子结构) - public short wHideAreaTopLeftX; /* 遮挡区域的x坐标 */ - public short wHideAreaTopLeftY; /* 遮挡区域的y坐标 */ - public short wHideAreaWidth; /* 遮挡区域的宽 */ - public short wHideAreaHeight; /* 遮挡区域的高*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_COLOR extends Structure { - public byte byBrightness; /*亮度,0-255*/ - public byte byContrast; /*对比度,0-255*/ - public byte bySaturation; /*饱和度,0-255*/ - public byte byHue; /*色调,0-255*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VICOLOR extends Structure { - public NET_DVR_COLOR[] struColor = new NET_DVR_COLOR[MAX_TIMESEGMENT_V30];/*图象参数(第一个有效,其他三个保留)*/ - public NET_DVR_SCHEDTIME[] struHandleTime = new NET_DVR_SCHEDTIME[MAX_TIMESEGMENT_V30];/*处理时间段(保留)*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - ; - - public static class NET_DVR_PICCFG_V30 extends Structure { - public int dwSize; - public byte[] sChanName = new byte[NAME_LEN]; - public int dwVideoFormat; /* 只读 视频制式 1-NTSC 2-PAL*/ - public NET_DVR_VICOLOR struViColor; // 图像参数按时间段设置 - public int dwShowChanName; // 预览的图象上是否显示通道名称,0-不显示,1-显示 区域大小704*576 - public short wShowNameTopLeftX; /* 通道名称显示位置的x坐标 */ - public short wShowNameTopLeftY; /* 通道名称显示位置的y坐标 */ - public NET_DVR_VILOST_V30 struVILost; //视频信号丢失报警 - public NET_DVR_VILOST_V30 struAULost; /*音频信号丢失报警(保留)*/ - public NET_DVR_MOTION_V30 struMotion; //移动侦测 - public NET_DVR_HIDEALARM_V30 struHideAlarm;//遮挡报警 - public int dwEnableHide; /* 是否启动遮盖(区域大小704*576) ,0-否,1-是*/ - public NET_DVR_SHELTER[] struShelter = new NET_DVR_SHELTER[4]; - public int dwShowOsd; //预览的图象上是否显示OSD,0-不显示,1-显示 区域大小704*576 - public short wOSDTopLeftX; /* OSD的x坐标 */ - public short wOSDTopLeftY; /* OSD的y坐标 */ - public byte byOSDType; /* OSD类型(主要是年月日格式) */ - public byte byDispWeek; /* 是否显示星期 */ - public byte byOSDAttrib; /* OSD属性:透明,闪烁 */ - public byte byHourOSDType; /* OSD小时制:0-24小时制,1-12小时制 */ - public byte[] byRes = new byte[64]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PICCFG_EX extends Structure {//通道图象结构SDK_V14扩展 - public int dwSize; - public byte[] sChanName = new byte[NAME_LEN]; - public int dwVideoFormat; /* 只读 视频制式 1-NTSC 2-PAL*/ - public byte byBrightness; /*亮度,0-255*/ - public byte byContrast; /*对比度,0-255*/ - public byte bySaturation; /*饱和度,0-255 */ - public byte byHue; /*色调,0-255*/ - //显示通道名 - public int dwShowChanName; // 预览的图象上是否显示通道名称,0-不显示,1-显示 区域大小704*576 - public short wShowNameTopLeftX; /* 通道名称显示位置的x坐标 */ - public short wShowNameTopLeftY; /* 通道名称显示位置的y坐标 */ - //信号丢失报警 - public NET_DVR_VILOST struVILost; - //移动侦测 - public NET_DVR_MOTION struMotion; - //遮挡报警 - public NET_DVR_HIDEALARM struHideAlarm; - //遮挡 区域大小704*576 - public int dwEnableHide; /* 是否启动遮挡 ,0-否,1-是*/ - public NET_DVR_SHELTER[] struShelter = new NET_DVR_SHELTER[MAX_SHELTERNUM]; - //OSD - public int dwShowOsd;// 预览的图象上是否显示OSD,0-不显示,1-显示 区域大小704*576 - public short wOSDTopLeftX; /* OSD的x坐标 */ - public short wOSDTopLeftY; /* OSD的y坐标 */ - public byte byOSDType; /* OSD类型(主要是年月日格式) */ - /* 0: XXXX-XX-XX 年月日 */ - /* 1: XX-XX-XXXX 月日年 */ - /* 2: XXXX年XX月XX日 */ - /* 3: XX月XX日XXXX年 */ - /* 4: XX-XX-XXXX 日月年*/ - /* 5: XX日XX月XXXX年 */ - public byte byDispWeek; /* 是否显示星期 */ - public byte byOSDAttrib; /* OSD属性:透明,闪烁 */ - /* 0: 不显示OSD */ - /* 1: 透明,闪烁 */ - /* 2: 透明,不闪烁 */ - /* 3: 闪烁,不透明 */ - /* 4: 不透明,不闪烁 */ - public byte byHourOsdType; //小时制:0表示24小时制,1-12小时制或am/pm - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_PICCFG extends Structure { //通道图象结构(SDK_V13及之前版本) - public int dwSize; - public byte[] sChanName = new byte[NAME_LEN]; - public int dwVideoFormat; /* 只读 视频制式 1-NTSC 2-PAL*/ - public byte byBrightness; /*亮度,0-255*/ - public byte byContrast; /*对比度,0-255*/ - public byte bySaturation; /*饱和度,0-255 */ - public byte byHue; /*色调,0-255*/ - //显示通道名 - public int dwShowChanName; // 预览的图象上是否显示通道名称,0-不显示,1-显示 区域大小704*576 - public short wShowNameTopLeftX; /* 通道名称显示位置的x坐标 */ - public short wShowNameTopLeftY; /* 通道名称显示位置的y坐标 */ - //信号丢失报警 - public NET_DVR_VILOST struVILost; - //移动侦测 - public NET_DVR_MOTION struMotion; - //遮挡报警 - public NET_DVR_HIDEALARM struHideAlarm; - //遮挡 区域大小704*576 - public int dwEnableHide; /* 是否启动遮挡 ,0-否,1-是*/ - public short wHideAreaTopLeftX; /* 遮挡区域的x坐标 */ - public short wHideAreaTopLeftY; /* 遮挡区域的y坐标 */ - public short wHideAreaWidth; /* 遮挡区域的宽 */ - public short wHideAreaHeight; /*遮挡区域的高*/ - //OSD - public int dwShowOsd;// 预览的图象上是否显示OSD,0-不显示,1-显示 区域大小704*576 - public short wOSDTopLeftX; /* OSD的x坐标 */ - public short wOSDTopLeftY; /* OSD的y坐标 */ - public byte byOSDType; /* OSD类型(主要是年月日格式) */ - /* 0: XXXX-XX-XX 年月日 */ - /* 1: XX-XX-XXXX 月日年 */ - /* 2: XXXX年XX月XX日 */ - /* 3: XX月XX日XXXX年 */ - /* 4: XX-XX-XXXX 日月年*/ - /* 5: XX日XX月XXXX年 */ - byte byDispWeek; /* 是否显示星期 */ - byte byOSDAttrib; /* OSD属性:透明,闪烁 */ - /* 0: 不显示OSD */ - /* 1: 透明,闪烁 */ - /* 2: 透明,不闪烁 */ - /* 3: 闪烁,不透明 */ - /* 4: 不透明,不闪烁 */ - public byte reservedData2; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //码流压缩参数(子结构)(9000扩展) - public static class NET_DVR_COMPRESSION_INFO_V30 extends Structure { - public byte byStreamType; //码流类型 0-视频流, 1-复合流 - public byte byResolution; //分辨率0-DCIF 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF 5(保留)16-VGA(640*480) 17-UXGA(1600*1200) 18-SVGA (800*600)19-HD720p(1280*720)20-XVGA 21-HD900p - public byte byBitrateType; //码率类型 0:定码率,1:变码率 - public byte byPicQuality; //图象质量 0-最好 1-次好 2-较好 3-一般 4-较差 5-差 - public int dwVideoBitrate; //视频码率 0-保留 1-16K 2-32K 3-48k 4-64K 5-80K 6-96K 7-128K 8-160k 9-192K 10-224K 11-256K 12-320K 13-384K 14-448K 15-512K 16-640K 17-768K 18-896K 19-1024K 20-1280K 21-1536K 22-1792K 23-2048最高位(31位)置成1表示是自定义码流, 0-30位表示码流值。 - public int dwVideoFrameRate; //帧率 0-全部; 1-1/16; 2-1/8; 3-1/4; 4-1/2; 5-1; 6-2; 7-4; 8-6; 9-8; 10-10; 11-12; 12-16; 13-20; V2.0版本中新加14-15; 15-18; 16-22; - public short wIntervalFrameI; //I帧间隔 - public byte byIntervalBPFrame;//0-BBP帧; 1-BP帧; 2-单P帧 - public byte byENumber; //E帧数量(保留) - public byte byVideoEncType;//视频编码类型 0 hik264;1标准h264; 2标准mpeg4; - public byte byAudioEncType;//音频编码类型 0 G722 - public byte[] byres = new byte[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //通道压缩参数(9000扩展) - public static class NET_DVR_COMPRESSIONCFG_V30 extends Structure { - public int dwSize; - public NET_DVR_COMPRESSION_INFO_V30 struNormHighRecordPara; //录像 对应8000的普通 - public NET_DVR_COMPRESSION_INFO_V30 struRes; //保留 String[28]; - public NET_DVR_COMPRESSION_INFO_V30 struEventRecordPara; //事件触发压缩参数 - public NET_DVR_COMPRESSION_INFO_V30 struNetPara; //网传(子码流) - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_COMPRESSION_INFO extends Structure {//码流压缩参数(子结构) - public byte byStreamType; //码流类型0-视频流,1-复合流,表示压缩参数时最高位表示是否启用压缩参数 - public byte byResolution; //分辨率0-DCIF 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF, 5-2QCIF(352X144)(车载专用) - public byte byBitrateType; //码率类型0:变码率,1:定码率 - public byte byPicQuality; //图象质量 0-最好 1-次好 2-较好 3-一般 4-较差 5-差 - public int dwVideoBitrate; //视频码率 0-保留 1-16K(保留) 2-32K 3-48k 4-64K 5-80K 6-96K 7-128K 8-160k 9-192K 10-224K 11-256K 12-320K - // 13-384K 14-448K 15-512K 16-640K 17-768K 18-896K 19-1024K 20-1280K 21-1536K 22-1792K 23-2048K - //最高位(31位)置成1表示是自定义码流, 0-30位表示码流值(MIN-32K MAX-8192K)。 - public int dwVideoFrameRate; //帧率 0-全部; 1-1/16; 2-1/8; 3-1/4; 4-1/2; 5-1; 6-2; 7-4; 8-6; 9-8; 10-10; 11-12; 12-16; 13-20; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_COMPRESSIONCFG extends Structure {//通道压缩参数 - public int dwSize; - public NET_DVR_COMPRESSION_INFO struRecordPara; //录像/事件触发录像 - public NET_DVR_COMPRESSION_INFO struNetPara; //网传/保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_COMPRESSION_INFO_EX extends Structure {//码流压缩参数(子结构)(扩展) 增加I帧间隔 - public byte byStreamType; //码流类型0-视频流, 1-复合流 - public byte byResolution; //分辨率0-DCIF 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF, 5-2QCIF(352X144)(车载专用) - public byte byBitrateType; //码率类型0:变码率,1:定码率 - public byte byPicQuality; //图象质量 0-最好 1-次好 2-较好 3-一般 4-较差 5-差 - public int dwVideoBitrate; //视频码率 0-保留 1-16K(保留) 2-32K 3-48k 4-64K 5-80K 6-96K 7-128K 8-160k 9-192K 10-224K 11-256K 12-320K - // 13-384K 14-448K 15-512K 16-640K 17-768K 18-896K 19-1024K 20-1280K 21-1536K 22-1792K 23-2048K - //最高位(31位)置成1表示是自定义码流, 0-30位表示码流值(MIN-32K MAX-8192K)。 - public int dwVideoFrameRate; //帧率 0-全部; 1-1/16; 2-1/8; 3-1/4; 4-1/2; 5-1; 6-2; 7-4; 8-6; 9-8; 10-10; 11-12; 12-16; 13-20, //V2.0增加14-15, 15-18, 16-22; - public short wIntervalFrameI; //I帧间隔 - //2006-08-11 增加单P帧的配置接口,可以改善实时流延时问题 - public byte byIntervalBPFrame;//0-BBP帧; 1-BP帧; 2-单P帧 - public byte byENumber;//E帧数量 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_COMPRESSIONCFG_EX extends Structure {//通道压缩参数(扩展) - public int dwSize; - public NET_DVR_COMPRESSION_INFO_EX struRecordPara; //录像 - public NET_DVR_COMPRESSION_INFO_EX struNetPara; //网传 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RECCOMPRESSIONCFG_EX extends Structure {//录象时间段压缩参数配置(GE定制)2006-09-18 - int dwSize; - NET_DVR_COMPRESSION_INFO_EX[][] struRecTimePara = new NET_DVR_COMPRESSION_INFO_EX[MAX_DAYS][MAX_TIMESEGMENT]; //录像时间段 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RECORDSCHED extends Structure //时间段录像参数配置(子结构) - { - public NET_DVR_SCHEDTIME struRecordTime = new NET_DVR_SCHEDTIME(); - public byte byRecordType; //0:定时录像,1:移动侦测,2:报警录像,3:动测|报警,4:动测&报警, 5:命令触发, 6: 智能录像 - public byte[] reservedData = new byte[3]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RECORDDAY extends Structure //全天录像参数配置(子结构) - { - public short wAllDayRecord; /* 是否全天录像 0-否 1-是*/ - public byte byRecordType; /* 录象类型 0:定时录像,1:移动侦测,2:报警录像,3:动测|报警,4:动测&报警 5:命令触发, 6: 智能录像*/ - public byte reservedData; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RECORDSCHEDWEEK extends Structure { - public NET_DVR_RECORDSCHED[] struRecordSched = new NET_DVR_RECORDSCHED[MAX_TIMESEGMENT_V30]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RECORD_V30 extends Structure { //通道录像参数配置(9000扩展) - public int dwSize; - public int dwRecord; /*是否录像 0-否 1-是*/ - public NET_DVR_RECORDDAY[] struRecAllDay = new NET_DVR_RECORDDAY[MAX_DAYS]; - public NET_DVR_RECORDSCHEDWEEK[] struRecordSched = new NET_DVR_RECORDSCHEDWEEK[MAX_DAYS]; - public int dwRecordTime; /* 录象延时长度 0-5秒, 1-20秒, 2-30秒, 3-1分钟, 4-2分钟, 5-5分钟, 6-10分钟*/ - public int dwPreRecordTime; /* 预录时间 0-不预录 1-5秒 2-10秒 3-15秒 4-20秒 5-25秒 6-30秒 7-0xffffffff(尽可能预录) */ - public int dwRecorderDuration; /* 录像保存的最长时间 */ - public byte byRedundancyRec; /*是否冗余录像,重要数据双备份:0/1*/ - public byte byAudioRec; /*录像时复合流编码时是否记录音频数据:国外有此法规*/ - public byte[] byReserve = new byte[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RECORD extends Structure { //通道录像参数配置 - public int dwSize; - public int dwRecord; /*是否录像 0-否 1-是*/ - public NET_DVR_RECORDDAY[] struRecAllDay = new NET_DVR_RECORDDAY[MAX_DAYS]; - public NET_DVR_RECORDSCHEDWEEK[] struRecordSched = new NET_DVR_RECORDSCHEDWEEK[MAX_DAYS]; - public int dwRecordTime; /* 录象时间长度 0-5秒, 1-20秒, 2-30秒, 3-1分钟, 4-2分钟, 5-5分钟, 6-10分钟*/ - public int dwPreRecordTime; /* 预录时间 0-不预录 1-5秒 2-10秒 3-15秒 4-20秒 5-25秒 6-30秒 7-0xffffffff(尽可能预录) */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_STATFRAME extends Structure { //单帧统计参数 - public int dwRelativeTime; - public int dwAbsTime; /*统计绝对时标*/ - public byte[] byRes = new byte[92]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_STATTIME extends Structure { //单帧统计参数 - public NET_DVR_TIME tmStart; //统计开始时间 - public NET_DVR_TIME tmEnd; //统计结束时间 - public byte[] byRes = new byte[92]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class UNION_PDC_STATPARAM extends Union { - // public byte[] byLen = new byte[140]; - public NET_DVR_STATFRAME struStatFrame; - public NET_DVR_STATTIME struStatTime; - } - - public static class NET_DVR_PDC_ALRAM_INFO extends Structure { //通道录像参数配置 - public int dwSize; - public byte byMode; /*0-单帧统计结果,1-最小时间段统计结果*/ - public byte byChannel; - public byte bySmart; //专业智能返回0,Smart 返回 1 - public byte byRes1; // 保留字节 - public NET_VCA_DEV_INFO struDevInfo = new NET_VCA_DEV_INFO(); //前端设备信息 - public UNION_PDC_STATPARAM uStatModeParam = new UNION_PDC_STATPARAM(); - public int dwLeaveNum; /* 离开人数 */ - public int dwEnterNum; /* 进入人数 */ - public byte byBrokenNetHttp; //断网续传标志位,0-不是重传数据,1-重传数据 - public byte byRes3; - public short wDevInfoIvmsChannelEx; //与NET_VCA_DEV_INFO里的byIvmsChannel含义相同,能表示更大的值。老客户端用byIvmsChannel能继续兼容,但是最大到255。新客户端版本请使用wDevInfoIvmsChannelEx - public int dwPassingNum; // 经过人数(进入区域后徘徊没有触发进入、离开的人数) - public byte[] byRes2 = new byte[32]; - - public void read() { - super.read(); - switch (byMode) { - case 0: - uStatModeParam.setType(NET_DVR_STATFRAME.class); - break; - case 1: - uStatModeParam.setType(NET_DVR_STATTIME.class); - break; - default: - break; - } - uStatModeParam.read(); - } - - public void write() { - super.write(); - uStatModeParam.write(); - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //云台协议表结构配置 - public static class NET_DVR_PTZ_PROTOCOL extends Structure { - public int dwType; /*解码器类型值,从1开始连续递增*/ - public byte[] byDescribe = new byte[DESC_LEN]; /*解码器的描述符,和8000中的一致*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PTZCFG extends Structure { - public int dwSize; - public NET_DVR_PTZ_PROTOCOL[] struPtz = new NET_DVR_PTZ_PROTOCOL[PTZ_PROTOCOL_NUM];/*最大200中PTZ协议*/ - public int dwPtzNum; /*有效的ptz协议数目,从0开始(即计算时加1)*/ - public byte[] byRes = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /***************************云台类型(end)******************************/ - public static class NET_DVR_DECODERCFG_V30 extends Structure {//通道解码器(云台)参数配置(9000扩展) - public int dwSize; - public int dwBaudRate; //波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k; - public byte byDataBit; // 数据有几位 0-5位,1-6位,2-7位,3-8位; - public byte byStopBit; // 停止位 0-1位,1-2位; - public byte byParity; // 校验 0-无校验,1-奇校验,2-偶校验; - public byte byFlowcontrol; // 0-无,1-软流控,2-硬流控 - public short wDecoderType; //解码器类型, 0-YouLi,1-LiLin-1016,2-LiLin-820,3-Pelco-p,4-DM DynaColor,5-HD600,6-JC-4116,7-Pelco-d WX,8-Pelco-d PICO - public short wDecoderAddress; /*解码器地址:0 - 255*/ - public byte[] bySetPreset = new byte[MAX_PRESET_V30]; /* 预置点是否设置,0-没有设置,1-设置*/ - public byte[] bySetCruise = new byte[MAX_CRUISE_V30]; /* 巡航是否设置: 0-没有设置,1-设置 */ - public byte[] bySetTrack = new byte[MAX_TRACK_V30]; /* 轨迹是否设置,0-没有设置,1-设置*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECODERCFG extends Structure {//通道解码器(云台)参数配置 - public int dwSize; - public int dwBaudRate; //波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k; - public byte byDataBit; // 数据有几位 0-5位,1-6位,2-7位,3-8位; - public byte byStopBit; // 停止位 0-1位,1-2位; - public byte byParity; // 校验 0-无校验,1-奇校验,2-偶校验; - public byte byFlowcontrol; // 0-无,1-软流控,2-硬流控 - public short wDecoderType; //解码器类型, 0-YouLi,1-LiLin-1016,2-LiLin-820,3-Pelco-p,4-DM DynaColor,5-HD600,6-JC-4116,7-Pelco-d WX,8-Pelco-d PICO - public short wDecoderAddress; /*解码器地址:0 - 255*/ - public byte[] bySetPreset = new byte[MAX_PRESET]; /* 预置点是否设置,0-没有设置,1-设置*/ - public byte[] bySetCruise = new byte[MAX_CRUISE]; /* 巡航是否设置: 0-没有设置,1-设置 */ - public byte[] bySetTrack = new byte[MAX_TRACK]; /* 轨迹是否设置,0-没有设置,1-设置*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PPPCFG_V30 extends Structure {//ppp参数配置(子结构) - public NET_DVR_IPADDR struRemoteIP; //远端IP地址 - public NET_DVR_IPADDR struLocalIP; //本地IP地址 - public byte[] sLocalIPMask = new byte[16]; //本地IP地址掩码 - public byte[] sUsername = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public byte byPPPMode; //PPP模式, 0-主动,1-被动 - public byte byRedial; //是否回拨 :0-否,1-是 - public byte byRedialMode; //回拨模式,0-由拨入者指定,1-预置回拨号码 - public byte byDataEncrypt; //数据加密,0-否,1-是 - public int dwMTU; //MTU - public byte[] sTelephoneNumber = new byte[PHONENUMBER_LEN]; //电话号码 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PPPCFG extends Structure {//ppp参数配置(子结构) - public byte[] sRemoteIP = new byte[16]; //远端IP地址 - public byte[] sLocalIP = new byte[16]; //本地IP地址 - public byte[] sLocalIPMask = new byte[16]; //本地IP地址掩码 - public byte[] sUsername = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public byte byPPPMode; //PPP模式, 0-主动,1-被动 - public byte byRedial; //是否回拨 :0-否,1-是 - public byte byRedialMode; //回拨模式,0-由拨入者指定,1-预置回拨号码 - public byte byDataEncrypt; //数据加密,0-否,1-是 - public int dwMTU; //MTU - public byte[] sTelephoneNumber = new byte[PHONENUMBER_LEN]; //电话号码 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_SINGLE_RS232 extends Structure {//RS232串口参数配置(9000扩展) - public int dwBaudRate; /*波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k;*/ - public byte byDataBit; /* 数据有几位 0-5位,1-6位,2-7位,3-8位 */ - public byte byStopBit; /* 停止位 0-1位,1-2位 */ - public byte byParity; /* 校验 0-无校验,1-奇校验,2-偶校验 */ - public byte byFlowcontrol; /* 0-无,1-软流控,2-硬流控 */ - public int dwWorkMode; /* 工作模式,0-232串口用于PPP拨号,1-232串口用于参数控制,2-透明通道 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RS232CFG_V30 extends Structure {//RS232串口参数配置(9000扩展) - public int dwSize; - public NET_DVR_SINGLE_RS232 struRs232;/*目前只有第一个串口设置有效,所有设备都只支持一个串口,其他七个保留*/ - public byte[] byRes = new byte[84]; - public NET_DVR_PPPCFG_V30 struPPPConfig;/*ppp参数*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_RS232CFG extends Structure {//RS232串口参数配置 - public int dwSize; - public int dwBaudRate;//波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k; - public byte byDataBit;// 数据有几位 0-5位,1-6位,2-7位,3-8位; - public byte byStopBit;// 停止位 0-1位,1-2位; - public byte byParity;// 校验 0-无校验,1-奇校验,2-偶校验; - public byte byFlowcontrol;// 0-无,1-软流控,2-硬流控 - public int dwWorkMode;// 工作模式,0-窄带传输(232串口用于PPP拨号),1-控制台(232串口用于参数控制),2-透明通道 - public NET_DVR_PPPCFG struPPPConfig; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMINCFG_V30 extends Structure {//报警输入参数配置(9000扩展) - public int dwSize; - public byte[] sAlarmInName = new byte[NAME_LEN]; /* 名称 */ - public byte byAlarmType; //报警器类型,0:常开,1:常闭 - public byte byAlarmInHandle; /* 是否处理 0-不处理 1-处理*/ - public byte[] reservedData = new byte[2]; - public NET_DVR_HANDLEEXCEPTION_V30 struAlarmHandleType; /* 处理方式 */ - public NET_DVR_SCHEDTIMEWEEK[] struAlarmTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS];//布防时间 - public byte[] byRelRecordChan = new byte[MAX_CHANNUM_V30]; //报警触发的录象通道,为1表示触发该通道 - public byte[] byEnablePreset = new byte[MAX_CHANNUM_V30]; /* 是否调用预置点 0-否,1-是*/ - public byte[] byPresetNo = new byte[MAX_CHANNUM_V30]; /* 调用的云台预置点序号,一个报警输入可以调用多个通道的云台预置点, 0xff表示不调用预置点。*/ - public byte[] byEnablePresetRevert = new byte[MAX_CHANNUM_V30]; /* 是否恢复到调用预置点前的位置(保留) */ - public short[] wPresetRevertDelay = new short[MAX_CHANNUM_V30]; /* 恢复预置点延时(保留) */ - public byte[] byEnableCruise = new byte[MAX_CHANNUM_V30]; /* 是否调用巡航 0-否,1-是*/ - public byte[] byCruiseNo = new byte[MAX_CHANNUM_V30]; /* 巡航 */ - public byte[] byEnablePtzTrack = new byte[MAX_CHANNUM_V30]; /* 是否调用轨迹 0-否,1-是*/ - public byte[] byPTZTrack = new byte[MAX_CHANNUM_V30]; /* 调用的云台的轨迹序号 */ - public byte[] byRes = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMINCFG extends Structure {//报警输入参数配置 - public int dwSize; - public byte[] sAlarmInName = new byte[NAME_LEN]; /* 名称 */ - public byte byAlarmType; //报警器类型,0:常开,1:常闭 - public byte byAlarmInHandle; /* 是否处理 0-不处理 1-处理*/ - public NET_DVR_HANDLEEXCEPTION struAlarmHandleType; /* 处理方式 */ - public NET_DVR_SCHEDTIMEWEEK[] struAlarmTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS];//布防时间 - public byte[] byRelRecordChan = new byte[MAX_CHANNUM]; //报警触发的录象通道,为1表示触发该通道 - public byte[] byEnablePreset = new byte[MAX_CHANNUM]; /* 是否调用预置点 0-否,1-是*/ - public byte[] byPresetNo = new byte[MAX_CHANNUM]; /* 调用的云台预置点序号,一个报警输入可以调用多个通道的云台预置点, 0xff表示不调用预置点。*/ - public byte[] byEnableCruise = new byte[MAX_CHANNUM]; /* 是否调用巡航 0-否,1-是*/ - public byte[] byCruiseNo = new byte[MAX_CHANNUM]; /* 巡航 */ - public byte[] byEnablePtzTrack = new byte[MAX_CHANNUM]; /* 是否调用轨迹 0-否,1-是*/ - public byte[] byPTZTrack = new byte[MAX_CHANNUM]; /* 调用的云台的轨迹序号 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ADDIT_POSITION extends Structure {//车载GPS信息结构(2007-12-27) - public byte[] sDevName = new byte[32]; /* 设备名称 */ - public int dwSpeed; /*速度*/ - public int dwLongitude; /* 经度*/ - public int dwLatitude; /* 纬度*/ - public byte[] direction = new byte[2]; /* direction[0]:'E'or'W'(东经/西经), direction[1]:'N'or'S'(北纬/南纬) */ - public byte[] res = new byte[2]; /* 保留位 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class struRecordingHost extends Structure { - public byte bySubAlarmType; - public byte[] byRes1 = new byte[3]; - public NET_DVR_TIME_EX struRecordEndTime = new NET_DVR_TIME_EX(); - public byte[] byRes = new byte[116]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class struAlarmHardDisk extends Structure { - public int dwAlarmHardDiskNum; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class struAlarmChannel extends Structure { - public int dwAlarmChanNum; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class struIOAlarm extends Structure { - public int dwAlarmInputNo; - public int dwTrigerAlarmOutNum; - public int dwTrigerRecordChanNum; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_TIME_EX extends Structure { - public short wYear; - public byte byMonth; - public byte byDay; - public byte byHour; - public byte byMinute; - public byte bySecond; - public byte byRes; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class uStruAlarm extends Union { - public byte[] byUnionLen = new byte[128]; - public struIOAlarm struioAlarm = new struIOAlarm(); - public struAlarmHardDisk strualarmHardDisk = new struAlarmHardDisk(); - public struAlarmChannel sstrualarmChannel = new struAlarmChannel(); - public struRecordingHost strurecordingHost = new struRecordingHost(); - } - - public static class NET_DVR_ALRAM_FIXED_HEADER extends Structure { - public int dwAlarmType; - public NET_DVR_TIME_EX struAlarmTime = new NET_DVR_TIME_EX(); - public uStruAlarm ustruAlarm = new uStruAlarm(); - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMINFO_V40 extends Structure { - public NET_DVR_ALRAM_FIXED_HEADER struAlarmFixedHeader = new NET_DVR_ALRAM_FIXED_HEADER(); - public Pointer pAlarmData; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMINFO_V30 extends Structure {//上传报警信息(9000扩展) - public int dwAlarmType;/*0-信号量报警,1-硬盘满,2-信号丢失,3-移动侦测,4-硬盘未格式化,5-读写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问, 0xa-GPS定位信息(车载定制)*/ - public int dwAlarmInputNumber;/*报警输入端口*/ - public byte[] byAlarmOutputNumber = new byte[MAX_ALARMOUT_V30];/*触发的输出端口,为1表示对应输出*/ - public byte[] byAlarmRelateChannel = new byte[MAX_CHANNUM_V30];/*触发的录像通道,为1表示对应录像, dwAlarmRelateChannel[0]对应第1个通道*/ - public byte[] byChannel = new byte[MAX_CHANNUM_V30];/*dwAlarmType为2或3,6时,表示哪个通道,dwChannel[0]对应第1个通道*/ - public byte[] byDiskNumber = new byte[MAX_DISKNUM_V30];/*dwAlarmType为1,4,5时,表示哪个硬盘, dwDiskNumber[0]对应第1个硬盘*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMINFO extends Structure { - public int dwAlarmType;/*0-信号量报警,1-硬盘满,2-信号丢失,3-移动侦测,4-硬盘未格式化,5-读写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问, 9-串口状态, 0xa-GPS定位信息(车载定制)*/ - public int dwAlarmInputNumber;/*报警输入端口, 当报警类型为9时该变量表示串口状态0表示正常, -1表示错误*/ - public int[] dwAlarmOutputNumber = new int[MAX_ALARMOUT];/*触发的输出端口,为1表示对应哪一个输出*/ - public int[] dwAlarmRelateChannel = new int[MAX_CHANNUM];/*触发的录像通道,dwAlarmRelateChannel[0]为1表示第1个通道录像*/ - public int[] dwChannel = new int[MAX_CHANNUM];/*dwAlarmType为2或3,6时,表示哪个通道,dwChannel[0]位对应第1个通道*/ - public int[] dwDiskNumber = new int[MAX_DISKNUM];/*dwAlarmType为1,4,5时,表示哪个硬盘, dwDiskNumber[0]位对应第1个硬盘*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMINFO_EX extends Structure {//上传报警信息(杭州竞天定制 2006-07-28) - public int dwAlarmType;/*0-信号量报警,1-硬盘满,2-信号丢失,3-移动侦测,4-硬盘未格式化,5-读写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问*/ - public int dwAlarmInputNumber;/*报警输入端口*/ - public int[] dwAlarmOutputNumber = new int[MAX_ALARMOUT];/*报警输入端口对应的输出端口,哪一位为1表示对应哪一个输出*/ - public int[] dwAlarmRelateChannel = new int[MAX_CHANNUM];/*报警输入端口对应的录像通道,哪一位为1表示对应哪一路录像,dwAlarmRelateChannel[0]对应第1个通道*/ - public int[] dwChannel = new int[MAX_CHANNUM];/*dwAlarmType为2或3,6时,表示哪个通道,dwChannel[0]位对应第0个通道*/ - public int[] dwDiskNumber = new int[MAX_DISKNUM];/*dwAlarmType为1,4,5时,表示哪个硬盘*/ - public byte[] sSerialNumber = new byte[SERIALNO_LEN]; //序列号 - public byte[] sRemoteAlarmIP = new byte[16]; //远程报警IP地址; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - ////////////////////////////////////////////////////////////////////////////////////// -//IPC接入参数配置 - public static class NET_DVR_IPDEVINFO extends Structure {/* IP设备结构 */ - public int dwEnable; /* 该IP设备是否启用 */ - public byte[] sUserName = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public NET_DVR_IPADDR struIP = new NET_DVR_IPADDR(); /* IP地址 */ - public short wDVRPort; /* 端口号 */ - public byte[] byres = new byte[34]; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPCHANINFO extends Structure {/* IP通道匹配参数 */ - public byte byEnable; /* 该通道是否启用 */ - public byte byIPID; /* IP设备ID 取值1- MAX_IP_DEVICE */ - public byte byChannel; /* 通道号 */ - public byte[] byres = new byte[33]; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPPARACFG extends Structure {/* IP接入配置结构 */ - public int dwSize; /* 结构大小 */ - public NET_DVR_IPDEVINFO[] struIPDevInfo = new NET_DVR_IPDEVINFO[MAX_IP_DEVICE]; /* IP设备 */ - public byte[] byAnalogChanEnable = new byte[MAX_ANALOG_CHANNUM]; /* 模拟通道是否启用,从低到高表示1-32通道,0表示无效 1有效 */ - public NET_DVR_IPCHANINFO[] struIPChanInfo = new NET_DVR_IPCHANINFO[MAX_IP_CHANNEL]; /* IP通道 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPALARMOUTINFO extends Structure {/* 报警输出参数 */ - public byte byIPID; /* IP设备ID取值1- MAX_IP_DEVICE */ - public byte byAlarmOut; /* 报警输出号 */ - public byte[] byRes = new byte[18]; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPALARMOUTCFG extends Structure {/* IP报警输出配置结构 */ - public int dwSize; /* 结构大小 */ - public NET_DVR_IPALARMOUTINFO[] struIPAlarmOutInfo = new NET_DVR_IPALARMOUTINFO[MAX_IP_ALARMOUT];/* IP报警输出 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPALARMININFO extends Structure {/* 报警输入参数 */ - public byte byIPID; /* IP设备ID取值1- MAX_IP_DEVICE */ - public byte byAlarmIn; /* 报警输入号 */ - public byte[] byRes = new byte[18]; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPALARMINCFG extends Structure {/* IP报警输入配置结构 */ - public int dwSize; /* 结构大小 */ - public NET_DVR_IPALARMININFO[] struIPAlarmInInfo = new NET_DVR_IPALARMININFO[MAX_IP_ALARMIN];/* IP报警输入 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_IPALARMINFO extends Structure {//ipc alarm info - public NET_DVR_IPDEVINFO[] struIPDevInfo = new NET_DVR_IPDEVINFO[MAX_IP_DEVICE]; /* IP设备 */ - public byte[] byAnalogChanEnable = new byte[MAX_ANALOG_CHANNUM]; /* 模拟通道是否启用,0-未启用 1-启用 */ - public NET_DVR_IPCHANINFO[] struIPChanInfo = new NET_DVR_IPCHANINFO[MAX_IP_CHANNEL]; /* IP通道 */ - public NET_DVR_IPALARMININFO[] struIPAlarmInInfo = new NET_DVR_IPALARMININFO[MAX_IP_ALARMIN]; /* IP报警输入 */ - public NET_DVR_IPALARMOUTINFO[] struIPAlarmOutInfo = new NET_DVR_IPALARMOUTINFO[MAX_IP_ALARMOUT]; /* IP报警输出 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_SINGLE_HD extends Structure {//本地硬盘信息配置 - public int dwHDNo; /*硬盘号, 取值0~MAX_DISKNUM_V30-1*/ - public int dwCapacity; /*硬盘容量(不可设置)*/ - public int dwFreeSpace; /*硬盘剩余空间(不可设置)*/ - public int dwHdStatus; /*硬盘状态(不可设置) 0-正常, 1-未格式化, 2-错误, 3-SMART状态, 4-不匹配, 5-休眠*/ - public byte byHDAttr; /*0-默认, 1-冗余; 2-只读*/ - public byte[] byRes1 = new byte[3]; - public int dwHdGroup; /*属于哪个盘组 1-MAX_HD_GROUP*/ - public byte[] byRes2 = new byte[120]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_HDCFG extends Structure { - public int dwSize; - public int dwHDCount; /*硬盘数(不可设置)*/ - public NET_DVR_SINGLE_HD[] struHDInfo = new NET_DVR_SINGLE_HD[MAX_DISKNUM_V30];//硬盘相关操作都需要重启才能生效; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_SINGLE_HDGROUP extends Structure {//本地盘组信息配置 - public int dwHDGroupNo; /*盘组号(不可设置) 1-MAX_HD_GROUP*/ - public byte[] byHDGroupChans = new byte[64]; /*盘组对应的录像通道, 0-表示该通道不录象到该盘组,1-表示录象到该盘组*/ - public byte[] byRes = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_HDGROUP_CFG extends Structure { - public int dwSize; - public int dwHDGroupCount; /*盘组总数(不可设置)*/ - public NET_DVR_SINGLE_HDGROUP[] struHDGroupAttr = new NET_DVR_SINGLE_HDGROUP[MAX_HD_GROUP];//硬盘相关操作都需要重启才能生效; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_SCALECFG extends Structure {//配置缩放参数的结构 - public int dwSize; - public int dwMajorScale; /* 主显示 0-不缩放,1-缩放*/ - public int dwMinorScale; /* 辅显示 0-不缩放,1-缩放*/ - public int[] dwRes = new int[2]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMOUTCFG_V30 extends Structure {//DVR报警输出(9000扩展) - public int dwSize; - public byte[] sAlarmOutName = new byte[NAME_LEN]; /* 名称 */ - public int dwAlarmOutDelay; /* 输出保持时间(-1为无限,手动关闭) */ - //0-5秒,1-10秒,2-30秒,3-1分钟,4-2分钟,5-5分钟,6-10分钟,7-手动 - public NET_DVR_SCHEDTIMEWEEK[] struAlarmOutTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS];/* 报警输出激活时间段 */ - public byte[] byRes = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMOUTCFG extends Structure {//DVR报警输出 - public int dwSize; - public byte[] sAlarmOutName = new byte[NAME_LEN]; /* 名称 */ - public int dwAlarmOutDelay; /* 输出保持时间(-1为无限,手动关闭) */ - //0-5秒,1-10秒,2-30秒,3-1分钟,4-2分钟,5-5分钟,6-10分钟,7-手动 - public NET_DVR_SCHEDTIMEWEEK[] struAlarmOutTime = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS];/* 报警输出激活时间段 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PREVIEWCFG_V30 extends Structure {//DVR本地预览参数(9000扩展) - public int dwSize; - public byte byPreviewNumber;//预览数目,0-1画面,1-4画面,2-9画面,3-16画面, 4-6画面, 5-8画面, 0xff:最大画面 - public byte byEnableAudio;//是否声音预览,0-不预览,1-预览 - public short wSwitchTime;//切换时间,0-不切换,1-5s,2-10s,3-20s,4-30s,5-60s,6-120s,7-300s - public byte[][] bySwitchSeq = new byte[MAX_PREVIEW_MODE][MAX_WINDOW_V30];//切换顺序,如果lSwitchSeq[i]为 0xff表示不用 - public byte[] byRes = new byte[24]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PREVIEWCFG extends Structure {//DVR本地预览参数 - public int dwSize; - public byte byPreviewNumber;//预览数目,0-1画面,1-4画面,2-9画面,3-16画面,0xff:最大画面 - public byte byEnableAudio;//是否声音预览,0-不预览,1-预览 - public short wSwitchTime;//切换时间,0-不切换,1-5s,2-10s,3-20s,4-30s,5-60s,6-120s,7-300s - public byte[] bySwitchSeq = new byte[MAX_WINDOW];//切换顺序,如果lSwitchSeq[i]为 0xff表示不用 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VGAPARA extends Structure {//DVR视频输出 - public short wResolution; /* 分辨率 */ - public short wFreq; /* 刷新频率 */ - public int dwBrightness; /* 亮度 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /* - * MATRIX输出参数结构 - */ - public static class NET_DVR_MATRIXPARA_V30 extends Structure { - public short[] wOrder = new short[MAX_ANALOG_CHANNUM]; /* 预览顺序, 0xff表示相应的窗口不预览 */ - public short wSwitchTime; /* 预览切换时间 */ - public byte[] res = new byte[14]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIXPARA extends Structure { - public short wDisplayLogo; /* 显示视频通道号(保留) */ - public short wDisplayOsd; /* 显示时间(保留) */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VOOUT extends Structure { - public byte byVideoFormat; /* 输出制式,0-PAL,1-NTSC */ - public byte byMenuAlphaValue; /* 菜单与背景图象对比度 */ - public short wScreenSaveTime; /* 屏幕保护时间 0-从不,1-1分钟,2-2分钟,3-5分钟,4-10分钟,5-20分钟,6-30分钟 */ - public short wVOffset; /* 视频输出偏移 */ - public short wBrightness; /* 视频输出亮度 */ - public byte byStartMode; /* 启动后视频输出模式(0:菜单,1:预览)*/ - public byte byEnableScaler; /* 是否启动缩放 (0-不启动, 1-启动)*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VIDEOOUT_V30 extends Structure {//DVR视频输出(9000扩展) - public int dwSize; - public NET_DVR_VOOUT[] struVOOut = new NET_DVR_VOOUT[MAX_VIDEOOUT_V30]; - public NET_DVR_VGAPARA[] struVGAPara = new NET_DVR_VGAPARA[MAX_VGA_V30]; /* VGA参数 */ - public NET_DVR_MATRIXPARA_V30[] struMatrixPara = new NET_DVR_MATRIXPARA_V30[MAX_MATRIXOUT]; /* MATRIX参数 */ - public byte[] byRes = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VIDEOOUT extends Structure {//DVR视频输出 - public int dwSize; - public NET_DVR_VOOUT[] struVOOut = new NET_DVR_VOOUT[MAX_VIDEOOUT]; - public NET_DVR_VGAPARA[] struVGAPara = new NET_DVR_VGAPARA[MAX_VGA]; /* VGA参数 */ - public NET_DVR_MATRIXPARA struMatrixPara; /* MATRIX参数 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_USER_INFO_V30 extends Structure {//单用户参数(子结构)(9000扩展) - public byte[] sUserName = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public byte[] byLocalRight = new byte[MAX_RIGHT]; /* 本地权限 */ - /*数组0: 本地控制云台*/ - /*数组1: 本地手动录象*/ - /*数组2: 本地回放*/ - /*数组3: 本地设置参数*/ - /*数组4: 本地查看状态、日志*/ - /*数组5: 本地高级操作(升级,格式化,重启,关机)*/ - /*数组6: 本地查看参数 */ - /*数组7: 本地管理模拟和IP camera */ - /*数组8: 本地备份 */ - /*数组9: 本地关机/重启 */ - public byte[] byRemoteRight = new byte[MAX_RIGHT];/* 远程权限 */ - /*数组0: 远程控制云台*/ - /*数组1: 远程手动录象*/ - /*数组2: 远程回放 */ - /*数组3: 远程设置参数*/ - /*数组4: 远程查看状态、日志*/ - /*数组5: 远程高级操作(升级,格式化,重启,关机)*/ - /*数组6: 远程发起语音对讲*/ - /*数组7: 远程预览*/ - /*数组8: 远程请求报警上传、报警输出*/ - /*数组9: 远程控制,本地输出*/ - /*数组10: 远程控制串口*/ - /*数组11: 远程查看参数 */ - /*数组12: 远程管理模拟和IP camera */ - /*数组13: 远程关机/重启 */ - public byte[] byNetPreviewRight = new byte[MAX_CHANNUM_V30]; /* 远程可以预览的通道 0-有权限,1-无权限*/ - public byte[] byLocalPlaybackRight = new byte[MAX_CHANNUM_V30]; /* 本地可以回放的通道 0-有权限,1-无权限*/ - public byte[] byNetPlaybackRight = new byte[MAX_CHANNUM_V30]; /* 远程可以回放的通道 0-有权限,1-无权限*/ - public byte[] byLocalRecordRight = new byte[MAX_CHANNUM_V30]; /* 本地可以录像的通道 0-有权限,1-无权限*/ - public byte[] byNetRecordRight = new byte[MAX_CHANNUM_V30]; /* 远程可以录像的通道 0-有权限,1-无权限*/ - public byte[] byLocalPTZRight = new byte[MAX_CHANNUM_V30]; /* 本地可以PTZ的通道 0-有权限,1-无权限*/ - public byte[] byNetPTZRight = new byte[MAX_CHANNUM_V30]; /* 远程可以PTZ的通道 0-有权限,1-无权限*/ - public byte[] byLocalBackupRight = new byte[MAX_CHANNUM_V30]; /* 本地备份权限通道 0-有权限,1-无权限*/ - public NET_DVR_IPADDR struUserIP; /* 用户IP地址(为0时表示允许任何地址) */ - public byte[] byMACAddr = new byte[MACADDR_LEN]; /* 物理地址 */ - public byte byPriority; /* 优先级,0xff-无,0--低,1--中,2--高 */ - /* - 无……表示不支持优先级的设置 - 低……默认权限:包括本地和远程回放,本地和远程查看日志和状态,本地和远程关机/重启 - 中……包括本地和远程控制云台,本地和远程手动录像,本地和远程回放,语音对讲和远程预览 - 本地备份,本地/远程关机/重启 - 高……管理员 - */ - public byte[] byRes = new byte[17]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_USER_INFO_EX extends Structure {//单用户参数(SDK_V15扩展)(子结构) - public byte[] sUserName = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public int[] dwLocalRight = new int[MAX_RIGHT]; /* 权限 */ - /*数组0: 本地控制云台*/ - /*数组1: 本地手动录象*/ - /*数组2: 本地回放*/ - /*数组3: 本地设置参数*/ - /*数组4: 本地查看状态、日志*/ - /*数组5: 本地高级操作(升级,格式化,重启,关机)*/ - public int dwLocalPlaybackRight; /* 本地可以回放的通道 bit0 -- channel 1*/ - public int[] dwRemoteRight = new int[MAX_RIGHT]; /* 权限 */ - /*数组0: 远程控制云台*/ - /*数组1: 远程手动录象*/ - /*数组2: 远程回放 */ - /*数组3: 远程设置参数*/ - /*数组4: 远程查看状态、日志*/ - /*数组5: 远程高级操作(升级,格式化,重启,关机)*/ - /*数组6: 远程发起语音对讲*/ - /*数组7: 远程预览*/ - /*数组8: 远程请求报警上传、报警输出*/ - /*数组9: 远程控制,本地输出*/ - /*数组10: 远程控制串口*/ - public int dwNetPreviewRight; /* 远程可以预览的通道 bit0 -- channel 1*/ - public int dwNetPlaybackRight; /* 远程可以回放的通道 bit0 -- channel 1*/ - public byte[] sUserIP = new byte[16]; /* 用户IP地址(为0时表示允许任何地址) */ - public byte[] byMACAddr = new byte[MACADDR_LEN]; /* 物理地址 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_USER_INFO extends Structure {//单用户参数(子结构) - public byte[] sUserName = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public int[] dwLocalRight = new int[MAX_RIGHT]; /* 权限 */ - /*数组0: 本地控制云台*/ - /*数组1: 本地手动录象*/ - /*数组2: 本地回放*/ - /*数组3: 本地设置参数*/ - /*数组4: 本地查看状态、日志*/ - /*数组5: 本地高级操作(升级,格式化,重启,关机)*/ - public int[] dwRemoteRight = new int[MAX_RIGHT]; /* 权限 */ - /*数组0: 远程控制云台*/ - /*数组1: 远程手动录象*/ - /*数组2: 远程回放 */ - /*数组3: 远程设置参数*/ - /*数组4: 远程查看状态、日志*/ - /*数组5: 远程高级操作(升级,格式化,重启,关机)*/ - /*数组6: 远程发起语音对讲*/ - /*数组7: 远程预览*/ - /*数组8: 远程请求报警上传、报警输出*/ - /*数组9: 远程控制,本地输出*/ - /*数组10: 远程控制串口*/ - public byte[] sUserIP = new byte[16]; /* 用户IP地址(为0时表示允许任何地址) */ - public byte[] byMACAddr = new byte[MACADDR_LEN]; /* 物理地址 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_USER_V30 extends Structure {//DVR用户参数(9000扩展) - public int dwSize; - public NET_DVR_USER_INFO_V30[] struUser = new NET_DVR_USER_INFO_V30[MAX_USERNUM_V30]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_USER_EX extends Structure {//DVR用户参数(SDK_V15扩展) - public int dwSize; - public NET_DVR_USER_INFO_EX[] struUser = new NET_DVR_USER_INFO_EX[MAX_USERNUM]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_USER extends Structure {//DVR用户参数 - public int dwSize; - public NET_DVR_USER_INFO[] struUser = new NET_DVR_USER_INFO[MAX_USERNUM]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_EXCEPTION_V30 extends Structure {//DVR异常参数(9000扩展) - public int dwSize; - public NET_DVR_HANDLEEXCEPTION_V30[] struExceptionHandleType = new NET_DVR_HANDLEEXCEPTION_V30[MAX_EXCEPTIONNUM_V30]; - - /*数组0-盘满,1- 硬盘出错,2-网线断,3-局域网内IP 地址冲突,4-非法访问, 5-输入/输出视频制式不匹配, 6-行车超速(车载专用), 7-视频信号异常(9000)*/ - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_EXCEPTION extends Structure {//DVR异常参数 - public int dwSize; - public NET_DVR_HANDLEEXCEPTION[] struExceptionHandleType = new NET_DVR_HANDLEEXCEPTION[MAX_EXCEPTIONNUM]; - - /*数组0-盘满,1- 硬盘出错,2-网线断,3-局域网内IP 地址冲突,4-非法访问, 5-输入/输出视频制式不匹配, 6-行车超速(车载专用)*/ - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_CHANNELSTATE_V30 extends Structure {//通道状态(9000扩展) - public byte byRecordStatic; //通道是否在录像,0-不录像,1-录像 - public byte bySignalStatic; //连接的信号状态,0-正常,1-信号丢失 - public byte byHardwareStatic;//通道硬件状态,0-正常,1-异常,例如DSP死掉 - public byte reservedData; //保留 - public int dwBitRate;//实际码率 - public int dwLinkNum;//客户端连接的个数 - public NET_DVR_IPADDR[] struClientIP = new NET_DVR_IPADDR[MAX_LINK];//客户端的IP地址 - public int dwIPLinkNum;//如果该通道为IP接入,那么表示IP接入当前的连接数 - public byte[] byRes = new byte[12]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_CHANNELSTATE extends Structure {//通道状态 - public byte byRecordStatic; //通道是否在录像,0-不录像,1-录像 - public byte bySignalStatic; //连接的信号状态,0-正常,1-信号丢失 - public byte byHardwareStatic;//通道硬件状态,0-正常,1-异常,例如DSP死掉 - public byte reservedData; //保留 - public int dwBitRate;//实际码率 - public int dwLinkNum;//客户端连接的个数 - public int[] dwClientIP = new int[MAX_LINK];//客户端的IP地址 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DISKSTATE extends Structure {//硬盘状态 - public int dwVolume;//硬盘的容量 - public int dwFreeSpace;//硬盘的剩余空间 - public int dwHardDiskStatic; //硬盘的状态,按位:1-休眠,2-不正常,3-休眠硬盘出错 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_WORKSTATE_V30 extends Structure {//DVR工作状态(9000扩展) - public int dwDeviceStatic; //设备的状态,0-正常,1-CPU占用率太高,超过85%,2-硬件错误,例如串口死掉 - public NET_DVR_DISKSTATE[] struHardDiskStatic = new NET_DVR_DISKSTATE[MAX_DISKNUM_V30]; - public NET_DVR_CHANNELSTATE_V30[] struChanStatic = new NET_DVR_CHANNELSTATE_V30[MAX_CHANNUM_V30];//通道的状态 - public byte[] byAlarmInStatic = new byte[MAX_ALARMIN_V30]; //报警端口的状态,0-没有报警,1-有报警 - public byte[] byAlarmOutStatic = new byte[MAX_ALARMOUT_V30]; //报警输出端口的状态,0-没有输出,1-有报警输出 - public int dwLocalDisplay;//本地显示状态,0-正常,1-不正常 - public byte[] byAudioChanStatus = new byte[MAX_AUDIO_V30];//表示语音通道的状态 0-未使用,1-使用中, 0xff无效 - public byte[] byRes = new byte[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_WORKSTATE extends Structure {//DVR工作状态 - public int dwDeviceStatic; //设备的状态,0-正常,1-CPU占用率太高,超过85%,2-硬件错误,例如串口死掉 - public NET_DVR_DISKSTATE[] struHardDiskStatic = new NET_DVR_DISKSTATE[MAX_DISKNUM]; - public NET_DVR_CHANNELSTATE[] struChanStatic = new NET_DVR_CHANNELSTATE[MAX_CHANNUM];//通道的状态 - public byte[] byAlarmInStatic = new byte[MAX_ALARMIN]; //报警端口的状态,0-没有报警,1-有报警 - public byte[] byAlarmOutStatic = new byte[MAX_ALARMOUT]; //报警输出端口的状态,0-没有输出,1-有报警输出 - public int dwLocalDisplay;//本地显示状态,0-正常,1-不正常 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_LOG_V30 extends Structure {//日志信息(9000扩展) - public NET_DVR_TIME strLogTime; - public int dwMajorType; //主类型 1-报警; 2-异常; 3-操作; 0xff-全部 - public int dwMinorType;//次类型 0-全部; - public byte[] sPanelUser = new byte[MAX_NAMELEN]; //操作面板的用户名 - public byte[] sNetUser = new byte[MAX_NAMELEN];//网络操作的用户名 - public NET_DVR_IPADDR struRemoteHostAddr;//远程主机地址 - public int dwParaType;//参数类型 - public int dwChannel;//通道号 - public int dwDiskNumber;//硬盘号 - public int dwAlarmInPort;//报警输入端口 - public int dwAlarmOutPort;//报警输出端口 - public int dwInfoLen; - public byte[] sInfo = new byte[LOG_INFO_LEN]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //日志信息 - public static class NET_DVR_LOG extends Structure { - public NET_DVR_TIME strLogTime; - public int dwMajorType; //主类型 1-报警; 2-异常; 3-操作; 0xff-全部 - public int dwMinorType;//次类型 0-全部; - public byte[] sPanelUser = new byte[MAX_NAMELEN]; //操作面板的用户名 - public byte[] sNetUser = new byte[MAX_NAMELEN];//网络操作的用户名 - public byte[] sRemoteHostAddr = new byte[16];//远程主机地址 - public int dwParaType;//参数类型 - public int dwChannel;//通道号 - public int dwDiskNumber;//硬盘号 - public int dwAlarmInPort;//报警输入端口 - public int dwAlarmOutPort;//报警输出端口 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /************************DVR日志 end***************************/ - public static class NET_DVR_ALARMOUTSTATUS_V30 extends Structure {//报警输出状态(9000扩展) - public byte[] Output = new byte[MAX_ALARMOUT_V30]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARMOUTSTATUS extends Structure {//报警输出状态 - public byte[] Output = new byte[MAX_ALARMOUT]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_TRADEINFO extends Structure {//交易信息 - public short m_Year; - public short m_Month; - public short m_Day; - public short m_Hour; - public short m_Minute; - public short m_Second; - public byte[] DeviceName = new byte[24]; //设备名称 - public int dwChannelNumer; //通道号 - public byte[] CardNumber = new byte[32]; //卡号 - public byte[] cTradeType = new byte[12]; //交易类型 - public int dwCash; //交易金额 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_FRAMETYPECODE extends Structure {/*帧格式*/ - public byte[] code = new byte[12]; /* 代码 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_FRAMEFORMAT_V30 extends Structure {//ATM参数(9000扩展) - public int dwSize; - public NET_DVR_IPADDR struATMIP; /* ATM IP地址 */ - public int dwATMType; /* ATM类型 */ - public int dwInputMode; /* 输入方式 0-网络侦听 1-网络接收 2-串口直接输入 3-串口ATM命令输入*/ - public int dwFrameSignBeginPos; /* 报文标志位的起始位置*/ - public int dwFrameSignLength; /* 报文标志位的长度 */ - public byte[] byFrameSignContent = new byte[12]; /* 报文标志位的内容 */ - public int dwCardLengthInfoBeginPos; /* 卡号长度信息的起始位置 */ - public int dwCardLengthInfoLength; /* 卡号长度信息的长度 */ - public int dwCardNumberInfoBeginPos; /* 卡号信息的起始位置 */ - public int dwCardNumberInfoLength; /* 卡号信息的长度 */ - public int dwBusinessTypeBeginPos; /* 交易类型的起始位置 */ - public int dwBusinessTypeLength; /* 交易类型的长度 */ - public NET_DVR_FRAMETYPECODE[] frameTypeCode = new NET_DVR_FRAMETYPECODE[10]; /* 类型 */ - public short wATMPort; /* 卡号捕捉端口号(网络协议方式) (保留)0xffff表示该值无效*/ - public short wProtocolType; /* 网络协议类型(保留) 0xffff表示该值无效*/ - public byte[] byRes = new byte[24]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_FRAMEFORMAT extends Structure {//ATM参数 - public int dwSize; - public byte[] sATMIP = new byte[16]; /* ATM IP地址 */ - public int dwATMType; /* ATM类型 */ - public int dwInputMode; /* 输入方式 0-网络侦听 1-网络接收 2-串口直接输入 3-串口ATM命令输入*/ - public int dwFrameSignBeginPos; /* 报文标志位的起始位置*/ - public int dwFrameSignLength; /* 报文标志位的长度 */ - public byte[] byFrameSignContent = new byte[12]; /* 报文标志位的内容 */ - public int dwCardLengthInfoBeginPos; /* 卡号长度信息的起始位置 */ - public int dwCardLengthInfoLength; /* 卡号长度信息的长度 */ - public int dwCardNumberInfoBeginPos; /* 卡号信息的起始位置 */ - public int dwCardNumberInfoLength; /* 卡号信息的长度 */ - public int dwBusinessTypeBeginPos; /* 交易类型的起始位置 */ - public int dwBusinessTypeLength; /* 交易类型的长度 */ - public NET_DVR_FRAMETYPECODE[] frameTypeCode = new NET_DVR_FRAMETYPECODE[10];/* 类型 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_FTPTYPECODE extends Structure { - public byte[] sFtpType = new byte[32]; /*客户定义的操作类型*/ - public byte[] sFtpCode = new byte[8]; /*客户定义的操作类型的对应的码*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_FRAMEFORMAT_EX extends Structure {//ATM参数添加FTP上传参数, 俄罗斯银行定制, 2006-11-17 - public int dwSize; - public byte[] sATMIP = new byte[16]; /* ATM IP地址 */ - public int dwATMType; /* ATM类型 */ - public int dwInputMode; /* 输入方式 0-网络侦听 1-网络接收 2-串口直接输入 3-串口ATM命令输入*/ - public int dwFrameSignBeginPos; /* 报文标志位的起始位置*/ - public int dwFrameSignLength; /* 报文标志位的长度 */ - public byte[] byFrameSignContent = new byte[12]; /* 报文标志位的内容 */ - public int dwCardLengthInfoBeginPos; /* 卡号长度信息的起始位置 */ - public int dwCardLengthInfoLength; /* 卡号长度信息的长度 */ - public int dwCardNumberInfoBeginPos; /* 卡号信息的起始位置 */ - public int dwCardNumberInfoLength; /* 卡号信息的长度 */ - public int dwBusinessTypeBeginPos; /* 交易类型的起始位置 */ - public int dwBusinessTypeLength; /* 交易类型的长度 */ - public NET_DVR_FRAMETYPECODE[] frameTypeCode = new NET_DVR_FRAMETYPECODE[10];/* 类型 */ - public byte[] sFTPIP = new byte[16]; /* FTP IP */ - public byte[] byFtpUsername = new byte[NAME_LEN]; /* 用户名 */ - public byte[] byFtpPasswd = new byte[PASSWD_LEN]; /* 密码 */ - public byte[] sDirName = new byte[NAME_LEN]; /*服务器目录名*/ - public int dwATMSrvType; /*ATM服务器类型,0--wincor ,1--diebold*/ - public int dwTimeSpace; /*取值为1.2.3.4.5.10*/ - public NET_DVR_FTPTYPECODE[] sFtpTypeCodeOp = new NET_DVR_FTPTYPECODE[300]; /*新加的*/ - public int dwADPlay; /* 1 表示在播放广告,0 表示没有播放广告*/ - public int dwNewPort; //端口 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } -/****************************ATM(end)***************************/ - - /*****************************DS-6001D/F(begin)***************************/ -//DS-6001D Decoder - public static class NET_DVR_DECODERINFO extends Structure { - public byte[] byEncoderIP = new byte[16]; //解码设备连接的服务器IP - public byte[] byEncoderUser = new byte[16]; //解码设备连接的服务器的用户名 - public byte[] byEncoderPasswd = new byte[16]; //解码设备连接的服务器的密码 - public byte bySendMode; //解码设备连接服务器的连接模式 - public byte byEncoderChannel; //解码设备连接的服务器的通道号 - public short wEncoderPort; //解码设备连接的服务器的端口号 - public byte[] reservedData = new byte[4]; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECODERSTATE extends Structure { - public byte[] byEncoderIP = new byte[16]; //解码设备连接的服务器IP - public byte[] byEncoderUser = new byte[16]; //解码设备连接的服务器的用户名 - public byte[] byEncoderPasswd = new byte[16]; //解码设备连接的服务器的密码 - public byte byEncoderChannel; //解码设备连接的服务器的通道号 - public byte bySendMode; //解码设备连接的服务器的连接模式 - public short wEncoderPort; //解码设备连接的服务器的端口号 - public int dwConnectState; //解码设备连接服务器的状态 - public byte[] reservedData = new byte[4]; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECCHANINFO extends Structure { - public byte[] sDVRIP = new byte[16]; /* DVR IP地址 */ - public short wDVRPort; /* 端口号 */ - public byte[] sUserName = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public byte byChannel; /* 通道号 */ - public byte byLinkMode; /* 连接模式 */ - public byte byLinkType; /* 连接类型 0-主码流 1-子码流 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECINFO extends Structure {/*每个解码通道的配置*/ - public byte byPoolChans; /*每路解码通道上的循环通道数量, 最多4通道 0表示没有解码*/ - public NET_DVR_DECCHANINFO[] struchanConInfo = new NET_DVR_DECCHANINFO[MAX_DECPOOLNUM]; - public byte byEnablePoll; /*是否轮巡 0-否 1-是*/ - public byte byPoolTime; /*轮巡时间 0-保留 1-10秒 2-15秒 3-20秒 4-30秒 5-45秒 6-1分钟 7-2分钟 8-5分钟 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECCFG extends Structure {/*整个设备解码配置*/ - public int dwSize; - public int dwDecChanNum; /*解码通道的数量*/ - public NET_DVR_DECINFO[] struDecInfo = new NET_DVR_DECINFO[MAX_DECNUM]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //2005-08-01 - public static class NET_DVR_PORTINFO extends Structure {/* 解码设备透明通道设置 */ - public int dwEnableTransPort; /* 是否启动透明通道 0-不启用 1-启用*/ - public byte[] sDecoderIP = new byte[16]; /* DVR IP地址 */ - public short wDecoderPort; /* 端口号 */ - public short wDVRTransPort; /* 配置前端DVR是从485/232输出,1表示232串口,2表示485串口 */ - public byte[] cReserve = new byte[4]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_PORTCFG extends Structure { - public int dwSize; - public NET_DVR_PORTINFO[] struTransPortInfo = new NET_DVR_PORTINFO[MAX_TRANSPARENTNUM]; /* 数组0表示232 数组1表示485 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /*https://jna.dev.java.net/javadoc/com/sun/jna/Union.html#setType(java.lang.Class) see how to use the JNA Union*/ - public static class NET_DVR_PLAYREMOTEFILE extends Structure {/* 控制网络文件回放 */ - public int dwSize; - public byte[] sDecoderIP = new byte[16]; /* DVR IP地址 */ - public short wDecoderPort; /* 端口号 */ - public short wLoadMode; /* 回放下载模式 1-按名字 2-按时间 */ - public byte[] byFile = new byte[100]; - - public static class mode_size extends Union { - public byte[] byFile = new byte[100]; // 回放的文件名 - - public static class bytime extends Structure { - public int dwChannel; - public byte[] sUserName = new byte[NAME_LEN]; //请求视频用户名 - public byte[] sPassword = new byte[PASSWD_LEN]; // 密码 - public NET_DVR_TIME struStartTime; //按时间回放的开始时间 - public NET_DVR_TIME struStopTime; // 按时间回放的结束时间 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECCHANSTATUS extends Structure {/*当前设备解码连接状态*/ - public int dwWorkType; /*工作方式:1:轮巡、2:动态连接解码、3:文件回放下载 4:按时间回放下载*/ - public byte[] sDVRIP = new byte[16]; /*连接的设备ip*/ - public short wDVRPort; /*连接端口号*/ - public byte byChannel; /* 通道号 */ - public byte byLinkMode; /* 连接模式 */ - public int dwLinkType; /*连接类型 0-主码流 1-子码流*/ - public byte[] sUserName = new byte[NAME_LEN]; /*请求视频用户名*/ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public byte[] cReserve = new byte[52]; - - public static class objectInfo extends Union { - public static class userInfo extends Structure { - public byte[] sUserName = new byte[NAME_LEN]; //请求视频用户名 - public byte[] sPassword = new byte[PASSWD_LEN]; // 密码 - public byte[] cReserve = new byte[52]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class fileInfo extends Structure { - public byte[] fileName = new byte[100]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class timeInfo extends Structure { - public int dwChannel; - public byte[] sUserName = new byte[NAME_LEN]; //请求视频用户名 - public byte[] sPassword = new byte[PASSWD_LEN]; // 密码 - public NET_DVR_TIME struStartTime; // 按时间回放的开始时间 - public NET_DVR_TIME struStopTime; //按时间回放的结束时间 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DECSTATUS extends Structure { - public int dwSize; - public NET_DVR_DECCHANSTATUS[] struDecState = new NET_DVR_DECCHANSTATUS[MAX_DECNUM]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /*****************************DS-6001D/F(end)***************************/ - - public static class NET_DVR_SHOWSTRINGINFO extends Structure {//单字符参数(子结构) - public short wShowString; // 预览的图象上是否显示字符,0-不显示,1-显示 区域大小704*576,单个字符的大小为32*32 - public short wStringSize; /* 该行字符的长度,不能大于44个字符 */ - public short wShowStringTopLeftX; /* 字符显示位置的x坐标 */ - public short wShowStringTopLeftY; /* 字符名称显示位置的y坐标 */ - public byte[] sString = new byte[44]; /* 要显示的字符内容 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //叠加字符(9000扩展) - public static class NET_DVR_SHOWSTRING_V30 extends Structure { - public int dwSize; - public NET_DVR_SHOWSTRINGINFO[] struStringInfo = new NET_DVR_SHOWSTRINGINFO[MAX_STRINGNUM_V30]; /* 要显示的字符内容 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //叠加字符扩展(8条字符) - public static class NET_DVR_SHOWSTRING_EX extends Structure { - public int dwSize; - public NET_DVR_SHOWSTRINGINFO[] struStringInfo = new NET_DVR_SHOWSTRINGINFO[MAX_STRINGNUM_EX]; /* 要显示的字符内容 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //叠加字符 - public static class NET_DVR_SHOWSTRING extends Structure { - public int dwSize; - public NET_DVR_SHOWSTRINGINFO[] struStringInfo = new NET_DVR_SHOWSTRINGINFO[MAX_STRINGNUM]; /* 要显示的字符内容 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /****************************DS9000新增结构(begin)******************************/ - -/* -EMAIL参数结构 -*/ - public static class NET_DVR_SENDER extends Structure { - public byte[] sName = new byte[NAME_LEN]; /* 发件人姓名 */ - public byte[] sAddress = new byte[MAX_EMAIL_ADDR_LEN]; /* 发件人地址 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVRRECEIVER extends Structure { - public byte[] sName = new byte[NAME_LEN]; /* 收件人姓名 */ - public byte[] sAddress = new byte[MAX_EMAIL_ADDR_LEN]; /* 收件人地址 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_EMAILCFG_V30 extends Structure { - public int dwSize; - public byte[] sAccount = new byte[NAME_LEN]; /* 账号*/ - public byte[] sPassword = new byte[MAX_EMAIL_PWD_LEN]; /*密码 */ - public NET_DVR_SENDER struSender; - public byte[] sSmtpServer = new byte[MAX_EMAIL_ADDR_LEN]; /* smtp服务器 */ - public byte[] sPop3Server = new byte[MAX_EMAIL_ADDR_LEN]; /* pop3服务器 */ - public NET_DVRRECEIVER[] struReceiver = new NET_DVRRECEIVER[3]; /* 最多可以设置3个收件人 */ - public byte byAttachment; /* 是否带附件 */ - public byte bySmtpServerVerify; /* 发送服务器要求身份验证 */ - public byte byMailInterval; /* mail interval */ - public byte[] res = new byte[77]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /* -DVR实现巡航数据结构 -*/ - public static class NET_DVR_CRUISE_PARA extends Structure { - public int dwSize; - public byte[] byPresetNo = new byte[CRUISE_MAX_PRESET_NUMS]; /* 预置点号 */ - public byte[] byCruiseSpeed = new byte[CRUISE_MAX_PRESET_NUMS]; /* 巡航速度 */ - public short[] wDwellTime = new short[CRUISE_MAX_PRESET_NUMS]; /* 停留时间 */ - public byte[] byEnableThisCruise; /* 是否启用 */ - public byte[] res = new byte[15]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /****************************DS9000新增结构(end)******************************/ - -//时间点 - public static class NET_DVR_TIMEPOINT extends Structure { - public int dwMonth; //月 0-11表示1-12个月 - public int dwWeekNo; //第几周 0-第1周 1-第2周 2-第3周 3-第4周 4-最后一周 - public int dwWeekDate; //星期几 0-星期日 1-星期一 2-星期二 3-星期三 4-星期四 5-星期五 6-星期六 - public int dwHour; //小时 开始时间0-23 结束时间1-23 - public int dwMin; //分 0-59 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //夏令时参数 - public static class NET_DVR_ZONEANDDST extends Structure { - public int dwSize; - public byte[] byRes1 = new byte[16]; //保留 - public int dwEnableDST; //是否启用夏时制 0-不启用 1-启用 - public byte byDSTBias; //夏令时偏移值,30min, 60min, 90min, 120min, 以分钟计,传递原始数值 - public byte[] byRes2 = new byte[3]; - public NET_DVR_TIMEPOINT struBeginPoint; //夏时制开始时间 - public NET_DVR_TIMEPOINT struEndPoint; //夏时制停止时间 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //图片质量 - public static class NET_DVR_JPEGPARA extends Structure { - /*注意:当图像压缩分辨率为VGA时,支持0=CIF, 1=QCIF, 2=D1抓图, - 当分辨率为3=UXGA(1600x1200), 4=SVGA(800x600), 5=HD720p(1280x720),6=VGA,7=XVGA, 8=HD900p - 仅支持当前分辨率的抓图*/ - public short wPicSize; /* 0=CIF, 1=QCIF, 2=D1 3=UXGA(1600x1200), 4=SVGA(800x600), 5=HD720p(1280x720),6=VGA*/ - public short wPicQuality; /* 图片质量系数 0-最好 1-较好 2-一般 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /* aux video out parameter */ -//辅助输出参数配置 - public static class NET_DVR_AUXOUTCFG extends Structure { - public int dwSize; - public int dwAlarmOutChan; /* 选择报警弹出大报警通道切换时间:1画面的输出通道: 0:主输出/1:辅1/2:辅2/3:辅3/4:辅4 */ - public int dwAlarmChanSwitchTime; /* :1秒 - 10:10秒 */ - public int[] dwAuxSwitchTime = new int[MAX_AUXOUT]; /* 辅助输出切换时间: 0-不切换,1-5s,2-10s,3-20s,4-30s,5-60s,6-120s,7-300s */ - public byte[][] byAuxOrder = new byte[MAX_AUXOUT][MAX_WINDOW]; /* 辅助输出预览顺序, 0xff表示相应的窗口不预览 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //ntp - public static class NET_DVR_NTPPARA extends Structure { - public byte[] sNTPServer = new byte[64]; /* Domain Name or IP addr of NTP server */ - public short wInterval; /* adjust time interval(hours) */ - public byte byEnableNTP; /* enable NPT client 0-no,1-yes*/ - public byte cTimeDifferenceH; /* 与国际标准时间的 小时偏移-12 ... +13 */ - public byte cTimeDifferenceM;/* 与国际标准时间的 分钟偏移0, 30, 45*/ - public byte res1; - public short wNtpPort; /* ntp server port 9000新增 设备默认为123*/ - public byte[] res2 = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //ddns - public static class NET_DVR_DDNSPARA extends Structure { - public byte[] sUsername = new byte[NAME_LEN]; /* DDNS账号用户名/密码 */ - public byte[] sPassword = new byte[PASSWD_LEN]; - public byte[] sDomainName = new byte[64]; /* 域名 */ - public byte byEnableDDNS; /*是否应用 0-否,1-是*/ - public byte[] res = new byte[15]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DDNSPARA_EX extends Structure { - public byte byHostIndex; /* 0-Hikvision DNS 1-Dyndns 2-PeanutHull(花生壳), 3-希网3322*/ - public byte byEnableDDNS; /*是否应用DDNS 0-否,1-是*/ - public short wDDNSPort; /* DDNS端口号 */ - public byte[] sUsername = new byte[NAME_LEN]; /* DDNS用户名*/ - public byte[] sPassword = new byte[PASSWD_LEN]; /* DDNS密码 */ - public byte[] sDomainName = new byte[MAX_DOMAIN_NAME]; /* 设备配备的域名地址 */ - public byte[] sServerName = new byte[MAX_DOMAIN_NAME]; /* DDNS 对应的服务器地址,可以是IP地址或域名 */ - public byte[] byRes = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DDNS extends Structure { - public byte[] sUsername = new byte[NAME_LEN]; /* DDNS账号用户名*/ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public byte[] sDomainName = new byte[MAX_DOMAIN_NAME]; /* 设备配备的域名地址 */ - public byte[] sServerName = new byte[MAX_DOMAIN_NAME]; /* DDNS协议对应的服务器地址,可以是IP地址或域名 */ - public short wDDNSPort; /* 端口号 */ - public byte[] byRes = new byte[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //9000扩展 - public static class NET_DVR_DDNSPARA_V30 extends Structure { - public byte byEnableDDNS; - public byte byHostIndex;/* 0-Hikvision DNS(保留) 1-Dyndns 2-PeanutHull(花生壳) 3-希网3322 */ - public byte[] byRes1 = new byte[2]; - public NET_DVR_DDNS[] struDDNS = new NET_DVR_DDNS[MAX_DDNS_NUMS];//9000目前只支持前3个配置,其他配置保留 - public byte[] byRes2 = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //email - public static class NET_DVR_EMAILPARA extends Structure { - public byte[] sUsername = new byte[64]; /* 邮件账号/密码 */ - public byte[] sPassword = new byte[64]; - public byte[] sSmtpServer = new byte[64]; - public byte[] sPop3Server = new byte[64]; - public byte[] sMailAddr = new byte[64]; /* email */ - public byte[] sEventMailAddr1 = new byte[64]; /* 上传报警/异常等的email */ - public byte[] sEventMailAddr2 = new byte[64]; - public byte[] res = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_NETAPPCFG extends Structure {//网络参数配置 - public int dwSize; - public byte[] sDNSIp = new byte[16]; /* DNS服务器地址 */ - public NET_DVR_NTPPARA struNtpClientParam; /* NTP参数 */ - public NET_DVR_DDNSPARA struDDNSClientParam; /* DDNS参数 */ - //NET_DVR_EMAILPARA struEmailParam; /* EMAIL参数 */ - public byte[] res = new byte[464]; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_SINGLE_NFS extends Structure {//nfs结构配置 - public byte[] sNfsHostIPAddr = new byte[16]; - public byte[] sNfsDirectory = new byte[PATHNAME_LEN]; // PATHNAME_LEN = 128 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_NFSCFG extends Structure { - public int dwSize; - public NET_DVR_SINGLE_NFS[] struNfsDiskParam = new NET_DVR_SINGLE_NFS[MAX_NFS_DISK]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //巡航点配置(HIK IP快球专用) - public static class NET_DVR_CRUISE_POINT extends Structure { - public byte PresetNum; //预置点 - public byte Dwell; //停留时间 - public byte Speed; //速度 - public byte Reserve; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_CRUISE_RET extends Structure { - public NET_DVR_CRUISE_POINT[] struCruisePoint = new NET_DVR_CRUISE_POINT[32]; //最大支持32个巡航点 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /************************************多路解码器(begin)***************************************/ -//多路解码器扩展 added by zxy 2007-05-23 - public static class NET_DVR_NETCFG_OTHER extends Structure { - public int dwSize; - public byte[] sFirstDNSIP = new byte[16]; - public byte[] sSecondDNSIP = new byte[16]; - public byte[] sRes = new byte[32]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_DECINFO extends Structure { - public byte[] sDVRIP = new byte[16]; /* DVR IP地址 */ - public short wDVRPort; /* 端口号 */ - public byte byChannel; /* 通道号 */ - public byte byTransProtocol; /* 传输协议类型 0-TCP 1-UDP */ - public byte byTransMode; /* 传输码流模式 0-主码流 1-子码流*/ - public byte[] byRes = new byte[3]; - public byte[] sUserName = new byte[NAME_LEN]; /* 监控主机登陆帐号 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 监控主机密码 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_DYNAMIC_DEC extends Structure {//启动/停止动态解码 - public int dwSize; - public NET_DVR_MATRIX_DECINFO struDecChanInfo; /* 动态解码通道信息 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_DEC_CHAN_STATUS extends Structure {//2007-12-13 modified by zxy 修改多路解码器的NET_DVR_MATRIX_DEC_CHAN_STATUS结构 - public int dwSize;//2008-1-16 modified by zxy dwIsLinked的状态由原来的0-未链接 1-连接修改成以下三种状态。 - public int dwIsLinked; /* 解码通道状态 0-休眠 1-正在连接 2-已连接 3-正在解码 */ - public int dwStreamCpRate; /* Stream copy rate, X kbits/second */ - public byte[] cRes = new byte[64]; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } -//end 2007-12-13 modified by zxy - - public static class NET_DVR_MATRIX_DEC_CHAN_INFO extends Structure { - public int dwSize; - public NET_DVR_MATRIX_DECINFO struDecChanInfo; /* 解码通道信息 */ - public int dwDecState; /* 0-动态解码 1-循环解码 2-按时间回放 3-按文件回放 */ - public NET_DVR_TIME StartTime; /* 按时间回放开始时间 */ - public NET_DVR_TIME StopTime; /* 按时间回放停止时间 */ - public byte[] sFileName = new byte[128]; /* 按文件回放文件名 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //连接的通道配置 2007-11-05 - public static class NET_DVR_MATRIX_DECCHANINFO extends Structure { - public int dwEnable; /* 是否启用 0-否 1-启用*/ - public NET_DVR_MATRIX_DECINFO struDecChanInfo; /* 轮循解码通道信息 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //2007-11-05 新增每个解码通道的配置 - public static class NET_DVR_MATRIX_LOOP_DECINFO extends Structure { - public int dwSize; - public int dwPoolTime; /*轮巡时间 */ - public NET_DVR_MATRIX_DECCHANINFO[] struchanConInfo = new NET_DVR_MATRIX_DECCHANINFO[MAX_CYCLE_CHAN]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //2007-05-25 多路解码器数字矩阵配置 -//矩阵行信息 2007-12-28 - public static class NET_DVR_MATRIX_ROW_ELEMENT extends Structure { - public byte[] sSurvChanName = new byte[128]; /* 监控通道名称,支持中文 */ - public int dwRowNum; /* 行号 */ - public NET_DVR_MATRIX_DECINFO struDecChanInfo; /* 矩阵行信息 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_ROW_INDEX extends Structure { - public byte[] sSurvChanName = new byte[128]; /* 监控通道名称,支持中文 */ - public int dwRowNum; /* 行号 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //矩阵列信息 2007-12-28 - public static class NET_DVR_MATRIX_COLUMN_ELEMENT extends Structure { - public int dwLocalDispChanNum; /* 本地显示通道号 */ - public int dwGlobalDispChanNum; /* 全局显示通道号 */ - public int dwRes; /* 保留 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_GLOBAL_COLUMN_ELEMENT extends Structure { - public int dwConflictTag; /* 冲突标记,0:无冲突,1:冲突 */ - public int dwConflictGloDispChan; /* 与之冲突的全局通道号 */ - public NET_DVR_MATRIX_COLUMN_ELEMENT struColumnInfo;/* 矩阵列元素结构体 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //手动查看 2007-12-28 - public static class NET_DVR_MATRIX_ROW_COLUMN_LINK extends Structure { - public int dwSize; - /* - * 以下三个参数只需要指定其中一个便可指定数字矩阵里的某一行 - * 所代表的远程监控通道。 - * 如果指定了多个域并有冲突,设备将按照域的先后顺序为准取最先定义者。 - */ - public int dwRowNum; /* -1代表无效域,大于0者方为有效的矩阵行号 */ - public byte[] sSurvChanName = new byte[128]; /* 监控通道名,是否无效按字符串的有效性判断 */ - public int dwSurvNum; /* 监控通道号,按矩阵行列表的顺序指定,一般情况下与行号一致 */ - /* - * 以下两项只需要指定其中一项便可,如果两项都有效默认选择第一项 - */ - public int dwGlobalDispChanNum; /* 电视墙上的电视机编号 */ - public int dwLocalDispChanNum; - /* - * 0代表播放即时码流, - * 1表示按时间回访远程监控设备的文件 - * 2表示按文件名回访 - */ - public int dwTimeSel; - public NET_DVR_TIME StartTime; - public NET_DVR_TIME StopTime; - public byte[] sFileName = new byte[128]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_PREVIEW_DISP_CHAN extends Structure { - public int dwSize; - public int dwGlobalDispChanNum; /* 电视墙上的电视机编号 */ - public int dwLocalDispChanNum; /* 解码通道 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_LOOP_PLAY_SET extends Structure {//轮循功能 2007-12-28 - public int dwSize; - /* 任意指定一个,-1为无效,如果都指定则以LocalDispChanNum为准 */ - public int dwLocalDispChanNum; /* 解码通道 */ - public int dwGlobalDispChanNum; /* 电视墙上的电视机编号 */ - public int dwCycTimeInterval; /* 轮循时间间隔 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_LOCAL_HOST_INFO extends Structure {//矩阵中心配置 2007-12-28 - public int dwSize; - public int dwLocalHostProperty; /* 本地主机类型 0-服务器 1-客户端*/ - public int dwIsIsolated; /* 本地主机是否独立于系统,0:联网,1:独立 */ - public int dwLocalMatrixHostPort; /* 本地主机访问端口 */ - public byte[] byLocalMatrixHostUsrName = new byte[NAME_LEN]; /* 本地主机登录用户名 */ - public byte[] byLocalMatrixHostPasswd = new byte[PASSWD_LEN]; /* 本地主机登录密码 */ - public int dwLocalMatrixCtrlMedia; /* 控制方式 0x1串口键盘控制 0x2网络键盘控制 0x4矩阵中心控制 0x8PC客户端控制*/ - public byte[] sMatrixCenterIP = new byte[16]; /* 矩阵中心IP地址 */ - public int dwMatrixCenterPort; /* 矩阵中心端口号 */ - public byte[] byMatrixCenterUsrName = new byte[NAME_LEN]; /* 矩阵中心登录用户名 */ - public byte[] byMatrixCenterPasswd = new byte[PASSWD_LEN]; /* 矩阵中心登录密码 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //2007-12-22 - public static class TTY_CONFIG extends Structure { - public byte baudrate; /* 波特率 */ - public byte databits; /* 数据位 */ - public byte stopbits; /* 停止位 */ - public byte parity; /* 奇偶校验位 */ - public byte flowcontrol; /* 流控 */ - public byte[] res = new byte[3]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_TRAN_CHAN_INFO extends Structure { - public byte byTranChanEnable; /* 当前透明通道是否打开 0:关闭 1:打开 */ - /* - * 多路解码器本地有1个485串口,1个232串口都可以作为透明通道,设备号分配如下: - * 0 RS485 - * 1 RS232 Console - */ - public byte byLocalSerialDevice; /* Local serial device */ - /* - * 远程串口输出还是两个,一个RS232,一个RS485 - * 1表示232串口 - * 2表示485串口 - */ - public byte byRemoteSerialDevice; /* Remote output serial device */ - public byte res1; /* 保留 */ - public byte[] sRemoteDevIP = new byte[16]; /* Remote Device IP */ - public short wRemoteDevPort; /* Remote Net Communication Port */ - public byte[] res2 = new byte[2]; /* 保留 */ - public TTY_CONFIG RemoteSerialDevCfg; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_TRAN_CHAN_CONFIG extends Structure { - public int dwSize; - public byte by232IsDualChan; /* 设置哪路232透明通道是全双工的 取值1到MAX_SERIAL_NUM */ - public byte by485IsDualChan; /* 设置哪路485透明通道是全双工的 取值1到MAX_SERIAL_NUM */ - public byte[] res = new byte[2]; /* 保留 */ - public NET_DVR_MATRIX_TRAN_CHAN_INFO[] struTranInfo = new NET_DVR_MATRIX_TRAN_CHAN_INFO[MAX_SERIAL_NUM];/*同时支持建立MAX_SERIAL_NUM个透明通道*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //2007-12-24 Merry Christmas Eve... - public static class NET_DVR_MATRIX_DEC_REMOTE_PLAY extends Structure { - public int dwSize; - public byte[] sDVRIP = new byte[16]; /* DVR IP地址 */ - public short wDVRPort; /* 端口号 */ - public byte byChannel; /* 通道号 */ - public byte byReserve; - public byte[] sUserName = new byte[NAME_LEN]; /* 用户名 */ - public byte[] sPassword = new byte[PASSWD_LEN]; /* 密码 */ - public int dwPlayMode; /* 0-按文件 1-按时间*/ - public NET_DVR_TIME StartTime; - public NET_DVR_TIME StopTime; - public byte[] sFileName = new byte[128]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_MATRIX_DEC_REMOTE_PLAY_CONTROL extends Structure { - public int dwSize; - public int dwPlayCmd; /* 播放命令 见文件播放命令*/ - public int dwCmdParam; /* 播放命令参数 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_DEC_REMOTE_PLAY_STATUS extends Structure { - public int dwSize; - public int dwCurMediaFileLen; /* 当前播放的媒体文件长度 */ - public int dwCurMediaFilePosition; /* 当前播放文件的播放位置 */ - public int dwCurMediaFileDuration; /* 当前播放文件的总时间 */ - public int dwCurPlayTime; /* 当前已经播放的时间 */ - public int dwCurMediaFIleFrames; /* 当前播放文件的总帧数 */ - public int dwCurDataType; /* 当前传输的数据类型,19-文件头,20-流数据, 21-播放结束标志 */ - public byte[] res = new byte[72]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_MATRIX_PASSIVEMODE extends Structure { - public short wTransProtol; //传输协议,0-TCP, 1-UDP, 2-MCAST - public short wPassivePort; //TCP,UDP时为TCP,UDP端口, MCAST时为MCAST端口 - public byte[] sMcastIP = new byte[16]; //TCP,UDP时无效, MCAST时为多播地址 - public byte[] res = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } -/************************************多路解码器(end)***************************************/ - - /************************************多路解码器(end)***************************************/ - - public static class NET_DVR_EMAILCFG extends Structure { /* 12 bytes */ - public int dwSize; - public byte[] sUserName = new byte[32]; - public byte[] sPassWord = new byte[32]; - public byte[] sFromName = new byte[32]; /* Sender *///字符串中的第一个字符和最后一个字符不能是"@",并且字符串中要有"@"字符 - public byte[] sFromAddr = new byte[48]; /* Sender address */ - public byte[] sToName1 = new byte[32]; /* Receiver1 */ - public byte[] sToName2 = new byte[32]; /* Receiver2 */ - public byte[] sToAddr1 = new byte[48]; /* Receiver address1 */ - public byte[] sToAddr2 = new byte[48]; /* Receiver address2 */ - public byte[] sEmailServer = new byte[32]; /* Email server address */ - public byte byServerType; /* Email server type: 0-SMTP, 1-POP, 2-IMTP…*/ - public byte byUseAuthen; /* Email server authentication method: 1-enable, 0-disable */ - public byte byAttachment; /* enable attachment */ - public byte byMailinterval; /* mail interval 0-2s, 1-3s, 2-4s. 3-5s*/ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_COMPRESSIONCFG_NEW extends Structure { - public int dwSize; - public NET_DVR_COMPRESSION_INFO_EX struLowCompression; //定时录像 - public NET_DVR_COMPRESSION_INFO_EX struEventCompression; //事件触发录像 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //球机位置信息 - public static class NET_DVR_PTZPOS extends Structure { - public short wAction;//获取时该字段无效 - public short wPanPos;//水平参数 - public short wTiltPos;//垂直参数 - public short wZoomPos;//变倍参数 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //球机范围信息 - public static class NET_DVR_PTZSCOPE extends Structure { - public short wPanPosMin;//水平参数min - public short wPanPosMax;//水平参数max - public short wTiltPosMin;//垂直参数min - public short wTiltPosMax;//垂直参数max - public short wZoomPosMin;//变倍参数min - public short wZoomPosMax;//变倍参数max - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //rtsp配置 ipcamera专用 - public static class NET_DVR_RTSPCFG extends Structure { - public int dwSize; //长度 - public short wPort; //rtsp服务器侦听端口 - public byte[] byReserve = new byte[54]; //预留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - /********************************接口参数结构(begin)*********************************/ - -//NET_DVR_Login()参数结构 - public static class NET_DVR_DEVICEINFO extends Structure { - public byte[] sSerialNumber = new byte[SERIALNO_LEN]; //序列号 - public byte byAlarmInPortNum; //DVR报警输入个数 - public byte byAlarmOutPortNum; //DVR报警输出个数 - public byte byDiskNum; //DVR硬盘个数 - public byte byDVRType; //DVR类型, 1:DVR 2:ATM DVR 3:DVS ...... - public byte byChanNum; //DVR 通道个数 - public byte byStartChan; //起始通道号,例如DVS-1,DVR - 1 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //NET_DVR_Login_V30()参数结构 - public static class NET_DVR_DEVICEINFO_V30 extends Structure { - public byte[] sSerialNumber = new byte[SERIALNO_LEN]; //序列号 - public byte byAlarmInPortNum; //报警输入个数 - public byte byAlarmOutPortNum; //报警输出个数 - public byte byDiskNum; //硬盘个数 - public byte byDVRType; //设备类型, 1:DVR 2:ATM DVR 3:DVS ...... - public byte byChanNum; //模拟通道个数 - public byte byStartChan; //起始通道号,例如DVS-1,DVR - 1 - public byte byAudioChanNum; //语音通道数 - public byte byIPChanNum; //最大数字通道个数,低位 - public byte byZeroChanNum; //零通道编码个数 //2010-01-16 - public byte byMainProto; //主码流传输协议类型 0-private, 1-rtsp,2-同时支持private和rtsp - public byte bySubProto; //子码流传输协议类型0-private, 1-rtsp,2-同时支持private和rtsp - public byte bySupport; //能力,位与结果为0表示不支持,1表示支持, - public byte bySupport1; // 能力集扩充,位与结果为0表示不支持,1表示支持 - public byte bySupport2; /*能力*/ - public short wDevType; //设备型号 - public byte bySupport3; //能力集扩展 - public byte byMultiStreamProto;//是否支持多码流,按位表示,0-不支持,1-支持,bit1-码流3,bit2-码流4,bit7-主码流,bit-8子码流 - public byte byStartDChan; //起始数字通道号,0表示无效 - public byte byStartDTalkChan; //起始数字对讲通道号,区别于模拟对讲通道号,0表示无效 - public byte byHighDChanNum; //数字通道个数,高位 - public byte bySupport4; //能力集扩展 - public byte byLanguageType;// 支持语种能力,按位表示,每一位0-不支持,1-支持 - // byLanguageType 等于0 表示 老设备 - // byLanguageType & 0x1表示支持中文 - // byLanguageType & 0x2表示支持英文 - public byte byVoiceInChanNum; //音频输入通道数 - public byte byStartVoiceInChanNo; //音频输入起始通道号 0表示无效 - public byte bySupport5; - public byte bySupport6; //能力 - public byte byMirrorChanNum; //镜像通道个数,<录播主机中用于表示导播通道> - public short wStartMirrorChanNo; //起始镜像通道号 - public byte bySupport7; //能力 - public byte byRes2; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static final int NET_DVR_DEV_ADDRESS_MAX_LEN = 129; - public static final int NET_DVR_LOGIN_USERNAME_MAX_LEN = 64; - public static final int NET_DVR_LOGIN_PASSWD_MAX_LEN = 64; - - public static interface FLoginResultCallBack extends StdCallCallback { - public int invoke(int lUserID, int dwResult, NET_DVR_DEVICEINFO_V30 lpDeviceinfo, Pointer pUser); - } - - //NET_DVR_Login_V40()参数 - public static class NET_DVR_USER_LOGIN_INFO extends Structure { - public byte[] sDeviceAddress = new byte[NET_DVR_DEV_ADDRESS_MAX_LEN]; - public byte byUseTransport; - public short wPort; - public byte[] sUserName = new byte[NET_DVR_LOGIN_USERNAME_MAX_LEN]; - public byte[] sPassword = new byte[NET_DVR_LOGIN_PASSWD_MAX_LEN]; - public FLoginResultCallBack cbLoginResult; - public Pointer pUser; - public boolean bUseAsynLogin; - public byte[] byRes2 = new byte[128]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //NET_DVR_Login_V40()参数 - public static class NET_DVR_DEVICEINFO_V40 extends Structure { - public NET_DVR_DEVICEINFO_V30 struDeviceV30 = new NET_DVR_DEVICEINFO_V30(); - public byte bySupportLock; - public byte byRetryLoginTime; - public byte byPasswordLevel; - public byte byRes1; - public int dwSurplusLockTime; - public byte[] byRes2 = new byte[256]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - - } - - //sdk网络环境枚举变量,用于远程升级 - enum _SDK_NET_ENV { - LOCAL_AREA_NETWORK, - WIDE_AREA_NETWORK - } - - //显示模式 - enum DISPLAY_MODE { - NORMALMODE, - OVERLAYMODE - } - - //发送模式 - enum SEND_MODE { - PTOPTCPMODE, - PTOPUDPMODE, - MULTIMODE, - RTPMODE, - RESERVEDMODE - } - - ; - - //抓图模式 - enum CAPTURE_MODE { - BMP_MODE, //BMP模式 - JPEG_MODE //JPEG模式 - } - - ; - - //实时声音模式 - enum REALSOUND_MODE { - NONE, //SDK中无此模式,只是为了填补0这个位置 - MONOPOLIZE_MODE, //独占模式 1 - SHARE_MODE //共享模式 2 - } - - ; - - //软解码预览参数 - public static class NET_DVR_CLIENTINFO extends Structure { - public int lChannel; - public int lLinkMode; - public HWND hPlayWnd; - public String sMultiCastIP; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //SDK状态信息(9000新增) - public static class NET_DVR_SDKSTATE extends Structure { - public int dwTotalLoginNum; //当前login用户数 - public int dwTotalRealPlayNum; //当前realplay路数 - public int dwTotalPlayBackNum; //当前回放或下载路数 - public int dwTotalAlarmChanNum; //当前建立报警通道路数 - public int dwTotalFormatNum; //当前硬盘格式化路数 - public int dwTotalFileSearchNum; //当前日志或文件搜索路数 - public int dwTotalLogSearchNum; //当前日志或文件搜索路数 - public int dwTotalSerialNum; //当前透明通道路数 - public int dwTotalUpgradeNum; //当前升级路数 - public int dwTotalVoiceComNum; //当前语音转发路数 - public int dwTotalBroadCastNum; //当前语音广播路数 - public int[] dwRes = new int[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //SDK功能支持信息(9000新增) - public static class NET_DVR_SDKABL extends Structure { - public int dwMaxLoginNum; //最大login用户数 MAX_LOGIN_USERS - public int dwMaxRealPlayNum; //最大realplay路数 WATCH_NUM - public int dwMaxPlayBackNum; //最大回放或下载路数 WATCH_NUM - public int dwMaxAlarmChanNum; //最大建立报警通道路数 ALARM_NUM - public int dwMaxFormatNum; //最大硬盘格式化路数 SERVER_NUM - public int dwMaxFileSearchNum; //最大文件搜索路数 SERVER_NUM - public int dwMaxLogSearchNum; //最大日志搜索路数 SERVER_NUM - public int dwMaxSerialNum; //最大透明通道路数 SERVER_NUM - public int dwMaxUpgradeNum; //最大升级路数 SERVER_NUM - public int dwMaxVoiceComNum; //最大语音转发路数 SERVER_NUM - public int dwMaxBroadCastNum; //最大语音广播路数 MAX_CASTNUM - public int[] dwRes = new int[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //报警设备信息 - public static class NET_DVR_ALARMER extends Structure { - public byte byUserIDValid; /* userid是否有效 0-无效,1-有效 */ - public byte bySerialValid; /* 序列号是否有效 0-无效,1-有效 */ - public byte byVersionValid; /* 版本号是否有效 0-无效,1-有效 */ - public byte byDeviceNameValid; /* 设备名字是否有效 0-无效,1-有效 */ - public byte byMacAddrValid; /* MAC地址是否有效 0-无效,1-有效 */ - public byte byLinkPortValid; /* login端口是否有效 0-无效,1-有效 */ - public byte byDeviceIPValid; /* 设备IP是否有效 0-无效,1-有效 */ - public byte bySocketIPValid; /* socket ip是否有效 0-无效,1-有效 */ - public int lUserID; /* NET_DVR_Login()返回值, 布防时有效 */ - public byte[] sSerialNumber = new byte[SERIALNO_LEN]; /* 序列号 */ - public int dwDeviceVersion; /* 版本信息 高16位表示主版本,低16位表示次版本*/ - public byte[] sDeviceName = new byte[NAME_LEN]; /* 设备名字 */ - public byte[] byMacAddr = new byte[MACADDR_LEN]; /* MAC地址 */ - public short wLinkPort; /* link port */ - public byte[] sDeviceIP = new byte[128]; /* IP地址 */ - public byte[] sSocketIP = new byte[128]; /* 报警主动上传时的socket IP地址 */ - public byte byIpProtocol; /* Ip协议 0-IPV4, 1-IPV6 */ - public byte[] byRes2 = new byte[11]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //硬解码显示区域参数(子结构) - public static class NET_DVR_DISPLAY_PARA extends Structure { - public int bToScreen; - public int bToVideoOut; - public int nLeft; - public int nTop; - public int nWidth; - public int nHeight; - public int nReserved; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //硬解码预览参数 - public static class NET_DVR_CARDINFO extends Structure { - public int lChannel;//通道号 - public int lLinkMode; //最高位(31)为0表示主码流,为1表示子,0-30位表示码流连接方式:0:TCP方式,1:UDP方式,2:多播方式,3 - RTP方式,4-电话线,5-128k宽带,6-256k宽带,7-384k宽带,8-512k宽带; - public String sMultiCastIP; - public NET_DVR_DISPLAY_PARA struDisplayPara; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //录象文件参数 - public static class NET_DVR_FIND_DATA extends Structure { - public byte[] sFileName = new byte[100];//文件名 - public NET_DVR_TIME struStartTime;//文件的开始时间 - public NET_DVR_TIME struStopTime;//文件的结束时间 - public int dwFileSize;//文件的大小 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //录象文件参数(9000) - public static class NET_DVR_FINDDATA_V30 extends Structure { - public byte[] sFileName = new byte[100];//文件名 - public NET_DVR_TIME struStartTime;//文件的开始时间 - public NET_DVR_TIME struStopTime;//文件的结束时间 - public int dwFileSize;//文件的大小 - public byte[] sCardNum = new byte[32]; - public byte byLocked;//9000设备支持,1表示此文件已经被锁定,0表示正常的文件 - public byte[] byRes = new byte[3]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //录象文件参数(带卡号) - public static class NET_DVR_FINDDATA_CARD extends Structure { - public byte[] sFileName = new byte[100];//文件名 - public NET_DVR_TIME struStartTime;//文件的开始时间 - public NET_DVR_TIME struStopTime;//文件的结束时间 - public int dwFileSize;//文件的大小 - public byte[] sCardNum = new byte[32]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_FILECOND extends Structure //录象文件查找条件结构 - { - public int lChannel;//通道号 - public int dwFileType;//录象文件类型0xff-全部,0-定时录像,1-移动侦测 ,2-报警触发,3-报警|移动侦测 4-报警&移动侦测 5-命令触发 6-手动录像 - public int dwIsLocked;//是否锁定 0-正常文件,1-锁定文件, 0xff表示所有文件 - public int dwUseCardNo;//是否使用卡号 - public byte[] sCardNumber = new byte[32];//卡号 - public NET_DVR_TIME struStartTime;//开始时间 - public NET_DVR_TIME struStopTime;//结束时间 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - //云台区域选择放大缩小(HIK 快球专用) - public static class NET_DVR_POINT_FRAME extends Structure { - public int xTop; //方框起始点的x坐标 - public int yTop; //方框结束点的y坐标 - public int xBottom; //方框结束点的x坐标 - public int yBottom; //方框结束点的y坐标 - public int bCounter; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //语音对讲参数 - public static class NET_DVR_COMPRESSION_AUDIO extends Structure { - public byte byAudioEncType; //音频编码类型 0-G722; 1-G711 - public byte[] byres = new byte[7];//这里保留音频的压缩参数 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //布防参数 - public static class NET_DVR_SETUPALARM_PARAM extends Structure { - public int dwSize; - public byte byLevel; //布防优先级,0-一等级(高),1-二等级(中),2-三等级(低) - public byte byAlarmInfoType; //上传报警信息类型(抓拍机支持),0-老报警信息(NET_DVR_PLATE_RESULT),1-新报警信息(NET_ITS_PLATE_RESULT)2012-9-28 - public byte byRetAlarmTypeV40; //0--返回NET_DVR_ALARMINFO_V30或NET_DVR_ALARMINFO, 1--设备支持NET_DVR_ALARMINFO_V40则返回NET_DVR_ALARMINFO_V40,不支持则返回NET_DVR_ALARMINFO_V30或NET_DVR_ALARMINFO - public byte byRetDevInfoVersion; //CVR上传报警信息回调结构体版本号 0-COMM_ALARM_DEVICE, 1-COMM_ALARM_DEVICE_V40 - public byte byRetVQDAlarmType; //VQD报警上传类型,0-上传报报警NET_DVR_VQD_DIAGNOSE_INFO,1-上传报警NET_DVR_VQD_ALARM - public byte byFaceAlarmDetection; - public byte bySupport; - public byte byBrokenNetHttp; - public short wTaskNo; //任务处理号 和 (上传数据NET_DVR_VEHICLE_RECOG_RESULT中的字段dwTaskNo对应 同时 下发任务结构 NET_DVR_VEHICLE_RECOG_COND中的字段dwTaskNo对应) - public byte byDeployType; //布防类型:0-客户端布防,1-实时布防 - public byte[] byRes1 = new byte[3]; - public byte byAlarmTypeURL;//bit0-表示人脸抓拍报警上传(INTER_FACESNAP_RESULT);0-表示二进制传输,1-表示URL传输(设备支持的情况下,设备支持能力根据具体报警能力集判断,同时设备需要支持URL的相关服务,当前是”云存储“) - public byte byCustomCtrl;//Bit0- 表示支持副驾驶人脸子图上传: 0-不上传,1-上传,(注:只在公司内部8600/8200等平台开放) - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - //区域框参数 - public static class NET_VCA_RECT extends Structure { - public float fX; - public float fY; - public float fWidth; - public float fHeight; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //报警目标信息 - public static class NET_VCA_TARGET_INFO extends Structure { - public int dwID; - public NET_VCA_RECT struRect; - public byte[] byRes = new byte[4]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //前端设备信息 - public static class NET_VCA_DEV_INFO extends Structure { - public NET_DVR_IPADDR struDevIP; - public short wPort; - public byte byChannel; - public byte byIvmsChannel; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //事件规则信息 - public static class NET_VCA_RULE_INFO extends Structure { - public byte byRuleID; - public byte byRes; - public short wEventTypeEx; - public byte[] byRuleName = new byte[NAME_LEN]; - public int dwEventType; - public NET_VCA_EVENT_UNION uEventParam; - - public void read() { - super.read(); - switch (wEventTypeEx) { - case 1: - uEventParam.setType(NET_VCA_TRAVERSE_PLANE.class); - break; - case 2: - case 3: - uEventParam.setType(NET_VCA_AREA.class); - break; - default: - break; - } - uEventParam.read(); - } - - public void write() { - super.write(); - uEventParam.write(); - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - - } - - //警戒规则参数联合体 - public static class NET_VCA_EVENT_UNION extends Union { - public int[] uLen = new int[23]; - public NET_VCA_TRAVERSE_PLANE struTraversePlane; - public NET_VCA_AREA struArea; - } - - //穿越警戒面参数 - public static class NET_VCA_TRAVERSE_PLANE extends Structure { - public NET_VCA_LINE struPlaneBottom; - public int dwCrossDirection; - public byte bySensitivity; - public byte byPlaneHeight; - public byte byDetectionTarget;/*检测目标:0- 所有目标,1- 人,2- 车 */ - public byte[] byRes2 = new byte[37]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_HANDLEEXCEPTION_V40 extends Structure { - public int dwHandleType;/*处理方式,各种异常处理方式的"或"结果,异常处理方式: - 0x00: 无响应 0x01: 监视器上警告 0x02: 声音警告 0x04: 上传中心 - 0x08: 触发报警输出 0x10: Jpeg抓图并上传EMail - 0x20: 无线声光报警器联动 0x40: 联动电子地图(目前仅PCNVR支持) - 0x200:抓图并上传ftp 0x400: 虚焦侦测联动聚焦 - 0x800: PTZ联动跟踪(球机跟踪目标) - E.g. dwHandleType==0x01|0x04 表示配置报警发生时联动监视器上警告并且将报警信息上传中心。 */ - public int dwMaxRelAlarmOutChanNum;/*设备最大支持的触发报警输出通道数(只读) */ - public int dwRelAlarmOutChanNum;/*已配置的触发的报警输出通道个数,决定dwRelAlarmOut取前多少个数组下标 */ - public int[] dwRelAlarmOut = new int[MAX_CHANNUM_V30];/*触发报警输出通道,取数组前dwRelAlarmOutChanNum个值, - 其值表示报警输出通道号(从1开始),初始值是0xfffffffff(不关联通道)。 - 例如,dwRelAlarmOutChanNum=5,则可以配置触发报警输出通道dwRelAlarmOut[0]~dwRelAlarmOut[4]。 */ - public byte[] byRes = new byte[64]; /*保留,置为0 */ - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static final int MAX_ALERTLINE_NUM = 8; - - public static class NET_VCA_TRAVERSE_PLANE_DETECTION extends Structure { - public int dwSize; - public byte byEnable;//使能 - public byte byEnableDualVca;// 启用支持智能后检索 0-不启用,1-启用 - public byte[] byRes1 = new byte[2]; - public NET_VCA_TRAVERSE_PLANE[] struAlertParam = new NET_VCA_TRAVERSE_PLANE[MAX_ALERTLINE_NUM]; //警戒线参数 - public NET_DVR_SCHEDTIMEWEEK[] struAlarmSched = new NET_DVR_SCHEDTIMEWEEK[MAX_DAYS]; - public NET_DVR_HANDLEEXCEPTION_V40 struHandleException; //异常处理方式 - public int dwMaxRelRecordChanNum; //报警触发的录象通道 数(只读)最大支持数量 - public int dwRelRecordChanNum; //报警触发的录象通道 数 实际支持的数量 - public int[] byRelRecordChan = new int[MAX_CHANNUM_V30];//触发录像的通道号 - public NET_DVR_SCHEDTIME[] struHolidayTime = new NET_DVR_SCHEDTIME[MAX_TIMESEGMENT_V30]; //假日布防时间 - public byte[] byRes2 = new byte[100]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_CHANNEL_GROUP extends Structure { - public int dwSize; - public int dwChannel; - public int dwGroup; - public byte byID; - public byte[] byRes1 = new byte[3]; - public int dwPositionNo; - public byte[] byRes = new byte[56]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //线结构参数 - public static class NET_VCA_LINE extends Structure { - public NET_VCA_POINT struStart; - public NET_VCA_POINT struEnd; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //点坐标参数 - public static class NET_VCA_POINT extends Structure { - public float fX; - public float fY; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //进入/离开区域参数 - public static class NET_VCA_AREA extends Structure { - public NET_VCA_POLYGON struRegion; - public byte[] byRes = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //多边形结构体 - public static class NET_VCA_POLYGON extends Structure { - public int dwPointNum; - public NET_VCA_POINT[] struPos = new NET_VCA_POINT[VCA_MAX_POLYGON_POINT_NUM]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //行为分析报警 - public static class NET_VCA_RULE_ALARM extends Structure { - public int dwSize; - public int dwRelativeTime; - public int dwAbsTime; - public NET_VCA_RULE_INFO struRuleInfo; - public NET_VCA_TARGET_INFO struTargetInfo; - public NET_VCA_DEV_INFO struDevInfo; - public int dwPicDataLen; - public byte byPicType; - public byte byRelAlarmPicNum; //关联通道报警图片数量 - public byte bySmart;//IDS设备返回0(默认值),Smart Functiom Return 1 - public byte byPicTransType; //图片数据传输方式: 0-二进制;1-url - public int dwAlarmID; //报警ID,用以标识通道间关联产生的组合报警,0表示无效 - public short wDevInfoIvmsChannelEx; //与NET_VCA_DEV_INFO里的byIvmsChannel含义相同,能表示更大的值。老客户端用byIvmsChannel能继续兼容,但是最大到255。新客户端版本请使用wDevInfoIvmsChannelEx。 - public byte byRelativeTimeFlag; //dwRelativeTime字段是否有效 0-无效, 1-有效,dwRelativeTime表示UTC时间 - public byte byAppendInfoUploadEnabled; //附加信息上传使能 0-不上传 1-上传 - public Pointer pAppendInfo; //指向附加信息NET_VCA_APPEND_INFO的指针,byAppendInfoUploadEnabled为1时或者byTimeDiffFlag为1时有效 - public Pointer pImage; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //车牌识别结果子结构 - public static class NET_DVR_PLATE_INFO extends Structure { - public byte byPlateType; //车牌类型 - public byte byColor; //车牌颜色 - public byte byBright; //车牌亮度 - public byte byLicenseLen; //车牌字符个数 - public byte byEntireBelieve; //整个车牌的置信度,-100 - public byte byRegion; // 区域索引值 0-保留,1-欧洲(EU),2-俄语区域(ER),3-欧洲&俄罗斯(EU&CIS) ,4-中东(ME),0xff-所有 - public byte byCountry; // 国家索引值,参照枚举COUNTRY_INDEX(不支持"COUNTRY_ALL = 0xff, //ALL 全部") - public byte byArea; //区域(省份),各国家内部区域枚举,阿联酋参照 EMI_AREA - public byte byPlateSize; //车牌尺寸,0~未知,1~long, 2~short(中东车牌使用) - public byte[] byRes = new byte[15]; //保留 - public byte[] sPlateCategory = new byte[8];//车牌附加信息, 即中东车牌中车牌号码旁边的小字信息,(目前只有中东地区支持) - public int dwXmlLen; //XML报警信息长度 - public Pointer pXmlBuf; // XML报警信息指针,报警类型为 COMM_ITS_PLATE_RESUL时有效,其XML对应到EventNotificationAlert XML Block - public NET_VCA_RECT struPlateRect = new NET_VCA_RECT(); //车牌位置 - public byte[] sLicense = new byte[MAX_LICENSE_LEN]; //车牌号码,注:中东车牌需求把小字也纳入车牌号码,小字和车牌号中间用空格分隔 - public byte[] byBelieve = new byte[MAX_LICENSE_LEN]; //各个识别字符的置信度,如检测到车牌"浙A12345", 置信度为,20,30,40,50,60,70,则表示"浙"字正确的可能性只有%,"A"字的正确的可能性是% - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_VEHICLE_INFO extends Structure { - public int dwIndex; //车辆序号 - public byte byVehicleType; //车辆类型 0 表示其它车型,1 表示小型车,2 表示大型车 ,3表示行人触发 ,4表示二轮车触发 5表示三轮车触发(3.5Ver) - public byte byColorDepth; //车身颜色深浅 - public byte byColor; //车身颜色,参考VCR_CLR_CLASS - /*雷达异常状态: - 0~雷达正常, - 1~雷达故障 - 2~雷达一直发送某一个相同速度值 - 3~雷达送出数据为0 - 4~雷达送出数据过大或者过小 - */ - public byte byRadarState; - public short wSpeed; //单位km/h - public short wLength; //前一辆车的车身长度 - /*违规类型,0-正常,1-低速,2-超速,3-逆行,4-闯红灯,5-压车道线,6-不按导向,7-路口滞留, - 8-机占非,9-违法变道,10-不按车道 11-违反禁令,12-路口停车,13-绿灯停车, 14-未礼让行人(违法代码1357), - 15-违章停车,16-违章掉头,17-占用应急车道,18-禁右,19-禁左,20-压黄线,21-未系安全带,22-行人闯红灯,23-加塞,24-违法使用远光灯, - 25-驾驶时拨打接听手持电话,26-左转不让直行,27-右转不让左转,28-掉头不让直行,29-大弯小转, 30-闯绿灯,31-未带头盔, - 32-非机动车载人,33-非机动车占用机动车道,34-非机动车打伞棚, 35-黑烟车, 36-鸣笛*/ - public byte byIllegalType; - public byte byVehicleLogoRecog; //参考枚举类型 VLR_VEHICLE_CLASS - public byte byVehicleSubLogoRecog; //车辆品牌子类型识别;参考VSB_VOLKSWAGEN_CLASS等子类型枚举。 - public byte byVehicleModel; //车辆子品牌年款,0-未知,参考"车辆子品牌年款.xlsx" - public byte[] byCustomInfo = new byte[16]; //自定义信息 - public short wVehicleLogoRecog; //车辆主品牌,参考"车辆主品牌.xlsx" (该字段兼容byVehicleLogoRecog); - public byte byIsParking;//是否停车 0-无效,1-停车,2-未停车 - public byte byRes;//保留字节 - public int dwParkingTime; //停车时间,单位:s - public byte[] byRes3 = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //交通抓拍结果信息 - public static class NET_DVR_PLATE_RESULT extends Structure { - public int dwSize; - public byte byResultType; - public byte byChanIndex; - public short wAlarmRecordID; - public int dwRelativeTime; - public byte[] byAbsTime = new byte[32]; - public int dwPicLen; - public int dwPicPlateLen; - public int dwVideoLen; - public byte byTrafficLight; - public byte byPicNum; - public byte byDriveChan; - public byte byVehicleType; - public int dwBinPicLen; - public int dwCarPicLen; - public int dwFarCarPicLen; - public Pointer pBuffer3; - public Pointer pBuffer4; - public Pointer pBuffer5; - public byte[] byRes3 = new byte[8]; - public NET_DVR_PLATE_INFO struPlateInfo; - public NET_DVR_VEHICLE_INFO struVehicleInfo; - public Pointer pBuffer1; - public Pointer pBuffer2; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_DVR_TIME_V30 extends Structure { - public short wYear; - public byte byMonth; - public byte byDay; - public byte byHour; - public byte byMinute; - public byte bySecond; - public byte byRes; - public short wMilliSec; - public byte[] byRes1 = new byte[2]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_ITS_PICTURE_INFO extends Structure { - public int dwDataLen; - public byte byType; - public byte byDataType; - public byte byCloseUpType; - public byte byPicRecogMode; - public int dwRedLightTime; - public byte[] byAbsTime = new byte[32]; - public NET_VCA_RECT struPlateRect = new NET_VCA_RECT(); - public NET_VCA_RECT struPlateRecgRect = new NET_VCA_RECT(); - public Pointer pBuffer; - public int dwUTCTime;//UTC时间 - public byte byCompatibleAblity;//兼容能力字段,按位表示,值:0- 无效,1- 有效 - public byte byTimeDiffFlag; /*时差字段是否有效 0-时差无效, 1-时差有效 */ - public byte cTimeDifferenceH; /*与UTC的时差(小时),-12 ... +14, +表示东区,,byTimeDiffFlag为1时有效*/ - public byte cTimeDifferenceM; /*与UTC的时差(分钟),-30, 30, 45, +表示东区,byTimeDiffFlag为1时有效*/ - public byte[] byRes2 = new byte[4]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - public static class NET_ITS_PLATE_RESULT extends Structure { - public int dwSize; - public int dwMatchNo; - public byte byGroupNum; - public byte byPicNo; - public byte bySecondCam; - public byte byFeaturePicNo; - public byte byDriveChan; - public byte byVehicleType; - public byte byDetSceneID; - public byte byVehicleAttribute; - public short wIllegalType; - public byte[] byIllegalSubType = new byte[8]; - public byte byPostPicNo; - public byte byChanIndex; - public short wSpeedLimit; - public byte byChanIndexEx; //byChanIndexEx*256+byChanIndex表示真实通道号。 - public byte byRes2; - public NET_DVR_PLATE_INFO struPlateInfo = new NET_DVR_PLATE_INFO(); - public NET_DVR_VEHICLE_INFO struVehicleInfo = new NET_DVR_VEHICLE_INFO(); - public byte[] byMonitoringSiteID = new byte[48]; - public byte[] byDeviceID = new byte[48]; - public byte byDir; - public byte byDetectType; - public byte byRelaLaneDirectionType; - public byte byCarDirectionType; - public int dwCustomIllegalType; - public Pointer pIllegalInfoBuf; - public byte byIllegalFromatType; - public byte byPendant; - public byte byDataAnalysis; - public byte byYellowLabelCar; - public byte byDangerousVehicles; - public byte byPilotSafebelt; - public byte byCopilotSafebelt; - public byte byPilotSunVisor; - public byte byCopilotSunVisor; - public byte byPilotCall; - public byte byBarrierGateCtrlType; - public byte byAlarmDataType; - public NET_DVR_TIME_V30 struSnapFirstPicTime = new NET_DVR_TIME_V30(); - public int dwIllegalTime; - public int dwPicNum; - public NET_ITS_PICTURE_INFO[] struPicInfo = new NET_ITS_PICTURE_INFO[6]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public int MAX_PARKNO_LEN = 16; //车位编号长度 - public int MAX_ID_LEN = 48; //编号最大长度 - - //停车场数据上传 - public static class NET_ITS_PARK_VEHICLE extends Structure { - public int dwSize; //结构长度 - public byte byGroupNum; //图片组数量(单次轮询抓拍的图片数量) - public byte byPicNo; //连拍的图片组上传图片序号(接收到图片组数量后,表示接收完成 - //接收超时不足图片组数量时,根据需要保留或删除) - public byte byLocationNum; //单张图片所管理的车位数 - public byte byParkError; //停车异常,0-正常 1 异常 - public byte[] byParkingNo = new byte[MAX_PARKNO_LEN];//车位编号 - public byte byLocationStatus; //车位车辆状态,0-无车,1有车 - public byte bylogicalLaneNum;//逻辑车位号,0-3,一个相机最大能管4个车位 (0代表最左边,3代表最右边) - public short wUpLoadType;//第零位表示:0~轮训上传、1~变化上传 - public byte[] byRes1 = new byte[4]; //保留字节 - public int dwChanIndex; //通道号数字通道 - public NET_DVR_PLATE_INFO struPlateInfo; //车牌信息结构 - public NET_DVR_VEHICLE_INFO struVehicleInfo; //车辆信息 - public byte[] byMonitoringSiteID = new byte[MAX_ID_LEN]; //监测点编号 - public byte[] byDeviceID = new byte[MAX_ID_LEN]; //设备编号 - public int dwPicNum; //图片数量(与picGroupNum不同,代表本条信息附带的图片数量,图片信息由struVehicleInfoEx定义 - public NET_ITS_PICTURE_INFO[] struPicInfo = new NET_ITS_PICTURE_INFO[2]; //图片信息,单张回调,最多2张图,由序号区分 - public byte[] byRes2 = new byte[256]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public int MAX_INTERVAL_NUM = 4; - - public static class NET_DVR_SNAPCFG extends Structure { - - public int dwSize; - public byte byRelatedDriveWay;//触发IO关联的车道号 - public byte bySnapTimes; //线圈抓拍次数,0-不抓拍,非0-连拍次数,目前最大5次 - public short wSnapWaitTime; //抓拍等待时间,单位ms,取值范围[0,60000] - public short[] wIntervalTime = new short[MAX_INTERVAL_NUM];//连拍间隔时间,ms - public int dwSnapVehicleNum; //抓拍车辆序号。 - public NET_DVR_JPEGPARA struJpegPara;//抓拍图片参数 - public byte[] byRes2 = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //卡参数配置条件 - public static class NET_DVR_CARD_CFG_COND extends Structure { - public int dwSize; - public int dwCardNum; - public byte byCheckCardNo; - public byte[] ibyRes = new byte[31]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //获取卡参数的发送数据 - public static class NET_DVR_CARD_CFG_SEND_DATA extends Structure { - public int dwSize; - public byte[] byCardNo = new byte[32]; - public byte[] byRes = new byte[16]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class CARDRIGHTPLAN extends Structure { - public byte[] byRightPlan = new byte[4]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //卡参数 - public static class NET_DVR_CARD_CFG extends Structure { - public int dwSize; - public int dwModifyParamType; - public byte[] byCardNo = new byte[32]; - public byte byCardValid; - public byte byCardType; - public byte byLeaderCard; - public byte byRes1; - public int dwDoorRight; - public NET_DVR_VALID_PERIOD_CFG struValid; - public int dwBelongGroup; - public byte[] byCardPassword = new byte[8]; - public CARDRIGHTPLAN[] byCardRightPlan = new CARDRIGHTPLAN[32]; - public int dwMaxSwipeTime; - public int dwSwipeTime; - public short wRoomNumber; - public short wFloorNumber; - public byte[] byRes2 = new byte[20]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //有效期参数结构体 - public static class NET_DVR_VALID_PERIOD_CFG extends Structure { - public byte byEnable; - public byte[] byRes1 = new byte[3]; - public NET_DVR_TIME_EX struBeginTime; - public NET_DVR_TIME_EX struEndTime; - public byte[] byRes2 = new byte[32]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //身份证信息报警 - public static class NET_DVR_ID_CARD_INFO_ALARM extends Structure { - public int dwSize; //结构长度 - public NET_DVR_ID_CARD_INFO struIDCardCfg = new NET_DVR_ID_CARD_INFO();//身份证信息 - public int dwMajor; //报警主类型,参考宏定义 - public int dwMinor; //报警次类型,参考宏定义 - public NET_DVR_TIME_V30 struSwipeTime = new NET_DVR_TIME_V30(); //时间 - public byte[] byNetUser = new byte[MAX_NAMELEN];//网络操作的用户名 - public NET_DVR_IPADDR struRemoteHostAddr = new NET_DVR_IPADDR();//远程主机地址 - public int dwCardReaderNo; //读卡器编号,为0无效 - public int dwDoorNo; //门编号,为0无效 - public int dwPicDataLen; //图片数据大小,不为0是表示后面带数据 - public Pointer pPicData; - public byte byCardType; //卡类型,1-普通卡,2-残疾人卡,3-黑名单卡,4-巡更卡,5-胁迫卡,6-超级卡,7-来宾卡,8-解除卡,为0无效 - public byte byDeviceNo; // 设备编号,为0时无效(有效范围1-255) - public byte[] byRes2 = new byte[2]; - public int dwFingerPrintDataLen; // 指纹数据大小,不为0是表示后面带数据 - public Pointer pFingerPrintData; - public int dwCapturePicDataLen; // 抓拍图片数据大小,不为0是表示后面带数据 - public Pointer pCapturePicData; - public byte[] byRes = new byte[188]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_DATE extends Structure { - public short wYear; //年 - public byte byMonth; //月 - public byte byDay; //日 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //身份证信息 - public static class NET_DVR_ID_CARD_INFO extends Structure { - public int dwSize; //结构长度 - public byte[] byName = new byte[MAX_ID_NAME_LEN]; //姓名 - public NET_DVR_DATE struBirth; //出生日期 - public byte[] byAddr = new byte[MAX_ID_ADDR_LEN]; //住址 - public byte[] byIDNum = new byte[MAX_ID_NUM_LEN]; //身份证号码 - public byte[] byIssuingAuthority = new byte[MAX_ID_ISSUING_AUTHORITY_LEN]; //签发机关 - public NET_DVR_DATE struStartDate; //有效开始日期 - public NET_DVR_DATE struEndDate; //有效截止日期 - public byte byTermOfValidity; //是否长期有效, 0-否,1-是(有效截止日期无效) - public byte bySex; //性别,1-男,2-女 - public byte byNation; //民族,1-"汉",2-"蒙古",3-"回",4-"藏",5-"维吾尔",6-"苗",7-"彝",8-"壮",9-"布依",10-"朝鲜", - //11-"满",12-"侗",13-"瑶",14-"白",15-"土家",16-"哈尼",17-"哈萨克",18-"傣",19-"黎",20-"傈僳", - //21-"佤",22-"畲",23-"高山",24-"拉祜",25-"水",26-"东乡",27-"纳西",28-"景颇",29-"柯尔克孜",30-"土", - //31-"达斡尔",32-"仫佬",33-"羌",34-"布朗",35-"撒拉",36-"毛南",37-"仡佬",38-"锡伯",39-"阿昌",40-"普米", - //41-"塔吉克",42-"怒",43-"乌孜别克",44-"俄罗斯",45-"鄂温克",46-"德昂",47-"保安",48-"裕固",49-"京",50-"塔塔尔", - //51-"独龙",52-"鄂伦春",53-"赫哲",54-"门巴",55-"珞巴",56-"基诺" - public byte[] byRes = new byte[101]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //门禁主机报警信息结构体 - public static class NET_DVR_ACS_ALARM_INFO extends Structure { - public int dwSize; - public int dwMajor; //报警主类型,参考宏定义 - public int dwMinor; //报警次类型,参考宏定义 - public NET_DVR_TIME struTime = new NET_DVR_TIME(); //时间 - public byte[] sNetUser = new byte[MAX_NAMELEN];//网络操作的用户名 - public NET_DVR_IPADDR struRemoteHostAddr = new NET_DVR_IPADDR();//远程主机地址 - public NET_DVR_ACS_EVENT_INFO struAcsEventInfo = new NET_DVR_ACS_EVENT_INFO(); //详细参数 - public int dwPicDataLen; //图片数据大小,不为0是表示后面带数据 - public Pointer pPicData; - public short wInductiveEventType; //归纳事件类型,0-无效,客户端判断该值为非0值后,报警类型通过归纳事件类型区分,否则通过原有报警主次类型(dwMajor、dwMinor)区分 - public byte byPicTransType; //图片数据传输方式: 0-二进制;1-url - public byte byRes1; //保留字节 - public int dwIOTChannelNo; //IOT通道号 - public Pointer pAcsEventInfoExtend; //byAcsEventInfoExtend为1时,表示指向一个NET_DVR_ACS_EVENT_INFO_EXTEND结构体 - public byte byAcsEventInfoExtend; //pAcsEventInfoExtend是否有效:0-无效,1-有效 - public byte byTimeType; //时间类型:0-设备本地时间,1-UTC时间(struTime的时间) - public byte[] byRes = new byte[10]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //门禁主机事件信息 - public static class NET_DVR_ACS_EVENT_INFO extends Structure { - public int dwSize; - public byte[] byCardNo = new byte[32]; - public byte byCardType; - public byte byWhiteListNo; - public byte byReportChannel; - public byte byCardReaderKind; - public int dwCardReaderNo; - public int dwDoorNo; - public int dwVerifyNo; - public int dwAlarmInNo; - public int dwAlarmOutNo; - public int dwCaseSensorNo; - public int dwRs485No; - public int dwMultiCardGroupNo; - public short wAccessChannel; - public byte byDeviceNo; - public byte byDistractControlNo; - public int dwEmployeeNo; - public short wLocalControllerID; - public byte byInternetAccess; - public byte byType; - public byte[] byRes = new byte[20]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_XML_CONFIG_INPUT extends Structure { - public int dwSize; - public Pointer lpRequestUrl; - public int dwRequestUrlLen; - public Pointer lpInBuffer; - public int dwInBufferSize; - public int dwRecvTimeOut; - public byte[] byRes = new byte[32]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_STRING_POINTER extends Structure { - public byte[] byString = new byte[2 * 1024]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_XML_CONFIG_OUTPUT extends Structure { - public int dwSize; - public Pointer lpOutBuffer; - public int dwOutBufferSize; - public int dwReturnedXMLSize; - public Pointer lpStatusBuffer; - public int dwStatusSize; - public byte[] byRes = new byte[32]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //报警场景信息 - public static class NET_DVR_SCENE_INFO extends Structure { - public int dwSceneID; //场景ID, 0 - 表示该场景无效 - public byte[] bySceneName = new byte[NAME_LEN]; //场景名称 - public byte byDirection; //监测方向 1-上行,2-下行,3-双向,4-由东向西,5-由南向北,6-由西向东,7-由北向南,8-其它 - public byte[] byRes1 = new byte[3]; //保留 - public NET_DVR_PTZPOS struPtzPos; //Ptz 坐标 - public byte[] byRes2 = new byte[64]; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - // 方向结构体 - public static class NET_DVR_DIRECTION extends Structure { - public NET_VCA_POINT struStartPoint = new NET_VCA_POINT(); // 方向起始点 - public NET_VCA_POINT struEndPoint = new NET_VCA_POINT(); // 方向结束点 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - // 交通事件信息 - public static class NET_DVR_AID_INFO extends Structure { - public byte byRuleID; // 规则序号,为规则配置结构下标,0-16 - public byte[] byRes1 = new byte[3]; - public byte[] byRuleName = new byte[NAME_LEN]; // 规则名称 - public int dwAIDType; // 报警事件类型 - public NET_DVR_DIRECTION struDirect = new NET_DVR_DIRECTION(); // 报警指向区域 - public byte bySpeedLimit; //限速值,单位km/h[0,255] - public byte byCurrentSpeed; //当前速度值,单位km/h[0,255] - public byte byVehicleEnterState; //车辆出入状态:0- 无效,1- 驶入,2- 驶出 - public byte byState; //0-变化上传,1-轮巡上传 - public byte[] byParkingID = new byte[16]; //停车位编号 - public byte[] byRes2 = new byte[20]; // 保留字节 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public int ILLEGAL_LEN = 32; //违法代码长度 - public int MONITORSITE_ID_LEN = 48;//监测点编号长度 - public int DEVICE_ID_LEN = 48; - - //交通取证报警 - public static class NET_DVR_TFS_ALARM extends Structure { - public int dwSize; //结构体大小 - public int dwRelativeTime; //相对时标 - public int dwAbsTime; //绝对时标 - public int dwIllegalType; //违章类型,采用国标定义,当dwIllegalType值为0xffffffff时使用byIllegalCode - public int dwIllegalDuration; //违法持续时间(单位:秒) = 抓拍最后一张图片的时间 - 抓拍第一张图片的时间 - public byte[] byMonitoringSiteID = new byte[MONITORSITE_ID_LEN];//监测点编号(路口编号、内部编号) - public byte[] byDeviceID = new byte[DEVICE_ID_LEN]; //设备编号 - public NET_VCA_DEV_INFO struDevInfo = new NET_VCA_DEV_INFO(); //前端设备信息 - public NET_DVR_SCENE_INFO struSceneInfo = new NET_DVR_SCENE_INFO(); //场景信息 - public NET_DVR_TIME_EX struBeginRecTime = new NET_DVR_TIME_EX(); //录像开始时间 - public NET_DVR_TIME_EX struEndRecTime = new NET_DVR_TIME_EX(); //录像结束时间 - public NET_DVR_AID_INFO struAIDInfo = new NET_DVR_AID_INFO(); //交通事件信息 - public NET_DVR_PLATE_INFO struPlateInfo = new NET_DVR_PLATE_INFO(); //车牌信息 - public NET_DVR_VEHICLE_INFO struVehicleInfo = new NET_DVR_VEHICLE_INFO(); //车辆信息 - public int dwPicNum; //图片数量 - public NET_ITS_PICTURE_INFO[] struPicInfo = new NET_ITS_PICTURE_INFO[8]; //图片信息,最多8张 - public byte bySpecificVehicleType; //具体车辆种类 参考识别结果类型VTR_RESULT - public byte byLaneNo; //关联车道号 - public byte[] byRes1 = new byte[2]; //保留 - public NET_DVR_TIME_V30 struTime = new NET_DVR_TIME_V30();//手动跟踪定位,当前时间。 - public int dwSerialNo;//序号; - public byte byVehicleAttribute;//车辆属性,按位表示,0- 无附加属性(普通车),bit1- 黄标车(类似年检的标志),bit2- 危险品车辆,值:0- 否,1- 是 - public byte byPilotSafebelt;//0-表示未知,1-系安全带,2-不系安全带 - public byte byCopilotSafebelt;//0-表示未知,1-系安全带,2-不系安全带 - public byte byPilotSunVisor;//0-表示未知,1-不打开遮阳板,2-打开遮阳板 - public byte byCopilotSunVisor;//0-表示未知, 1-不打开遮阳板,2-打开遮阳板 - public byte byPilotCall;// 0-表示未知, 1-不打电话,2-打电话 - public byte[] byRes2 = new byte[2]; //保留 - public byte[] byIllegalCode = new byte[ILLEGAL_LEN/*32*/];//违法代码扩展,当dwIllegalType值为0xffffffff;使用这个值 - public short wCountry; // 国家索引值,参照枚举COUNTRY_INDEX - public byte byRegion; //区域索引值,0-保留,1-欧洲(Europe Region),2-俄语区域(Russian Region),3-欧洲&俄罗斯(EU&CIS) , 4-中东(Middle East),0xff-所有 - public byte byCrossLine;//是否压线停车(侧方停车),0-表示未知,1-不压线,2-压线 - public byte[] byParkingSerialNO = new byte[16];//泊车位编号 - public byte byCrossSpaces;//是否跨泊车位停车(侧方停车),0-表示未知,1-未跨泊车位停车,2-跨泊车位停车 - public byte byAngledParking;//是否倾斜停车(侧方停车), 0-表示未知,1-未倾斜停车,2-倾斜停车 - public byte byAlarmValidity;//报警置信度,可以输出驶入驶出的置信度,范围0-100;置信度越高,事件真实性越高 - public byte[] byRes = new byte[45]; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //人体特征识别结果结构体 - public static class NET_VCA_HUMAN_FEATURE extends Structure { - public byte byAgeGroup; //年龄段,参见 HUMAN_AGE_GROUP_ENUM - public byte bySex; //性别, 0-表示“未知”(算法不支持),1 – 男 , 2 – 女, 0xff-算法支持,但是没有识别出来 - public byte byEyeGlass; //是否戴眼镜 0-表示“未知”(算法不支持),1 – 不戴, 2 – 戴,0xff-算法支持,但是没有识别出来 - //抓拍图片人脸年龄的使用方式,如byAge为15,byAgeDeviation为1,表示,实际人脸图片年龄的为14-16之间 - public byte byAge;//年龄 0-表示“未知”(算法不支持),0xff-算法支持,但是没有识别出来 - public byte byAgeDeviation;//年龄误差值 - public byte byEthnic; //字段预留,暂不开放 - public byte byMask; //是否戴口罩 0-表示“未知”(算法不支持),1 – 不戴, 2 – 戴, 0xff-算法支持,但是没有识别出来 - public byte bySmile; //是否微笑 0-表示“未知”(算法不支持),1 – 不微笑, 2 – 微笑, 0xff-算法支持,但是没有识别出来 - public byte[] byRes = new byte[8]; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //人脸抓拍结果 - public static class NET_VCA_FACESNAP_RESULT extends Structure { - public int dwSize; // 结构大小 - public int dwRelativeTime; // 相对时标 - public int dwAbsTime; // 绝对时标 - public int dwFacePicID; //人脸图ID - public int dwFaceScore; //人脸评分,0-100 - public NET_VCA_TARGET_INFO struTargetInfo = new NET_VCA_TARGET_INFO();//报警目标信息 - public NET_VCA_RECT struRect = new NET_VCA_RECT(); //人脸子图区域 - public NET_VCA_DEV_INFO struDevInfo = new NET_VCA_DEV_INFO(); //前端设备信息 - public int dwFacePicLen; //人脸子图的长度,为0表示没有图片,大于0表示有图片 - public int dwBackgroundPicLen; //背景图的长度,为0表示没有图片,大于0表示有图片(保留) - public byte bySmart; //IDS设备返回0(默认值),Smart Functiom Return 1 - public byte byAlarmEndMark;//报警结束标记0-保留,1-结束标记(该字段结合人脸ID字段使用,表示该ID对应的下报警结束,主要提供给NVR使用,用于判断报警结束,提取识别图片数据中,清晰度最高的图片) - public byte byRepeatTimes; //重复报警次数,0-无意义 - public byte byUploadEventDataType;//人脸图片数据长传方式:0-二进制数据,1-URL - public NET_VCA_HUMAN_FEATURE struFeature = new NET_VCA_HUMAN_FEATURE(); //人体属性 - public float fStayDuration; //停留画面中时间(单位: 秒) - public byte[] sStorageIP = new byte[16]; //存储服务IP地址 - public short wStoragePort; //存储服务端口号 - public short wDevInfoIvmsChannelEx; //与NET_VCA_DEV_INFO里的byIvmsChannel含义相同,能表示更大的值。老客户端用byIvmsChannel能继续兼容,但是最大到255。新客户端版本请使用wDevInfoIvmsChannelEx。 - public byte byFacePicQuality; - public byte byUIDLen; // 上传报警的标识长度 - public byte byLivenessDetectionStatus;// 活体检测状态:0-保留,1-未知(检测失败),2-非真人人脸,3-真人人脸,4-未开启活体检测 - /*附加信息标识位(即是否有NET_VCA_FACESNAP_ADDINFO结构体),0-无附加信息, 1-有附加信息。*/ - public byte byAddInfo; - public Pointer pUIDBuffer; //标识指针 - //附加信息指针,指向NET_VCA_FACESNAP_ADDINFO结构体 - public Pointer pAddInfoBuffer; - public byte byTimeDiffFlag; /*时差字段是否有效 0-时差无效, 1-时差有效 */ - public byte cTimeDifferenceH; /*与UTC的时差(小时),-12 ... +14, +表示东区,,byTimeDiffFlag为1时有效*/ - public byte cTimeDifferenceM; /*与UTC的时差(分钟),-30, 30, 45, +表示东区,byTimeDiffFlag为1时有效*/ - public byte byBrokenNetHttp; //断网续传标志位,0-不是重传数据,1-重传数据 - public Pointer pBuffer1; //人脸子图的图片数据 - public Pointer pBuffer2; //背景图的图片数据(保留,通过查找背景图接口可以获取背景图) - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //人脸抓拍信息 - public static class NET_VCA_FACESNAP_INFO_ALARM extends Structure { - public int dwRelativeTime; // 相对时标 - public int dwAbsTime; // 绝对时标 - public int dwSnapFacePicID; //抓拍人脸图ID - public int dwSnapFacePicLen; //抓拍人脸子图的长度,为0表示没有图片,大于0表示有图片 - public NET_VCA_DEV_INFO struDevInfo = new NET_VCA_DEV_INFO(); //前端设备信息 - public byte byFaceScore; //人脸评分,指人脸子图的质量的评分,0-100 - public byte bySex;//性别,0-未知,1-男,2-女 - public byte byGlasses;//是否带眼镜,0-未知,1-是,2-否 - //抓拍图片人脸年龄的使用方式,如byAge为15,byAgeDeviation为1,表示,实际人脸图片年龄的为14-16之间 - public byte byAge;//年龄 - public byte byAgeDeviation;//年龄误差值 - public byte byAgeGroup;//年龄段,详见HUMAN_AGE_GROUP_ENUM,若传入0xff表示未知 - public byte byFacePicQuality; - public byte byRes1; // 保留字节 - public int dwUIDLen; // 上传报警的标识长度 - public Pointer pUIDBuffer; //标识指针 - public float fStayDuration; //停留画面中时间(单位: 秒) - public Pointer pBuffer1; //抓拍人脸子图的图片数据 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //籍贯参数 - public static class NET_DVR_AREAINFOCFG extends Structure { - public short wNationalityID; //国籍 - public short wProvinceID; //省 - public short wCityID; //市 - public short wCountyID; //县 - public int dwCode; //国家标准的省份、城市、县级代码,当这个字段不为0的时候,使用这个值,新设备上传这个值表示籍贯参数,老设备这个值为0 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //人员信息 - public int MAX_HUMAN_BIRTHDATE_LEN = 10; - - public static class NET_VCA_HUMAN_ATTRIBUTE extends Structure { - public byte bySex; //性别:0-男,1-女 - public byte byCertificateType; //证件类型:0-身份证,1-警官证 - public byte[] byBirthDate = new byte[MAX_HUMAN_BIRTHDATE_LEN]; //出生年月,如:201106 - public byte[] byName = new byte[NAME_LEN]; //姓名 - public NET_DVR_AREAINFOCFG struNativePlace = new NET_DVR_AREAINFOCFG(); //籍贯参数 - public byte[] byCertificateNumber = new byte[NAME_LEN]; //证件号 - public int dwPersonInfoExtendLen;// 人员标签信息扩展长度 - public Pointer pPersonInfoExtend; //人员标签信息扩展信息 - public byte byAgeGroup;//年龄段,详见HUMAN_AGE_GROUP_ENUM,如传入0xff表示未知 - public byte[] byRes2 = new byte[11]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //黑名单信息 - public static class NET_VCA_BLACKLIST_INFO extends Structure { - public int dwSize; //结构大小 - public int dwRegisterID; //名单注册ID号(只读) - public int dwGroupNo; //分组号 - public byte byType; //黑白名单标志:0-全部,1-白名单,2-黑名单 - public byte byLevel; //黑名单等级,0-全部,1-低,2-中,3-高 - public byte[] byRes1 = new byte[2]; //保留 - public NET_VCA_HUMAN_ATTRIBUTE struAttribute = new NET_VCA_HUMAN_ATTRIBUTE(); //人员信息 - public byte[] byRemark = new byte[NAME_LEN]; //备注信息 - public int dwFDDescriptionLen;//人脸库描述数据长度 - public Pointer pFDDescriptionBuffer;//人脸库描述数据指针 - public int dwFCAdditionInfoLen;//抓拍库附加信息长度 - public Pointer pFCAdditionInfoBuffer;//抓拍库附加信息数据指针(FCAdditionInfo中包含相机PTZ坐标) - public byte[] byRes2 = new byte[4]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //黑名单报警信息 - public static class NET_VCA_BLACKLIST_INFO_ALARM extends Structure { - public NET_VCA_BLACKLIST_INFO struBlackListInfo = new NET_VCA_BLACKLIST_INFO(); //黑名单基本信息 - public int dwBlackListPicLen; //黑名单人脸子图的长度,为0表示没有图片,大于0表示有图片 - public int dwFDIDLen;// 人脸库ID长度 - public Pointer pFDID; //人脸库Id指针 - public int dwPIDLen;// 人脸库图片ID长度 - public Pointer pPID; //人脸库图片ID指针 - public short wThresholdValue; //人脸库阈值[0,100] - public byte[] byRes = new byte[2]; // 保留字节 - public Pointer pBuffer1; //黑名单人脸子图的图片数据 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - - //黑名单比对结果报警上传 - public static class NET_VCA_FACESNAP_MATCH_ALARM extends Structure { - public int dwSize; // 结构大小 - public float fSimilarity; //相似度,[0.001,1] - public NET_VCA_FACESNAP_INFO_ALARM struSnapInfo = new NET_VCA_FACESNAP_INFO_ALARM(); //抓拍信息 - public NET_VCA_BLACKLIST_INFO_ALARM struBlackListInfo = new NET_VCA_BLACKLIST_INFO_ALARM(); //黑名单信息 - public byte[] sStorageIP = new byte[16]; //存储服务IP地址 - public short wStoragePort; //存储服务端口号 - public byte byMatchPicNum; //匹配图片的数量,0-保留(老设备这个值默认0,新设备这个值为0时表示后续没有匹配的图片信息) - public byte byPicTransType;//图片数据传输方式: 0-二进制;1-url - public int dwSnapPicLen;//设备识别抓拍图片长度 - public Pointer pSnapPicBuffer;//设备识别抓拍图片指针 - public NET_VCA_RECT struRegion = new NET_VCA_RECT();//目标边界框,设备识别抓拍图片中,人脸子图坐标 - public int dwModelDataLen;//建模数据长度 - public Pointer pModelDataBuffer;// 建模数据指针 - public byte byModelingStatus;// 建模状态 - public byte byLivenessDetectionStatus;//活体检测状态:0-保留,1-未知(检测失败),2-非真人人脸,3-真人人脸,4-未开启活体检测 - public byte cTimeDifferenceH; /*与UTC的时差(小时),-12 ... +14, +表示东区,0xff无效*/ - public byte cTimeDifferenceM; /*与UTC的时差(分钟),-30, 30, 45, +表示东区,0xff无效*/ - public byte byMask; //抓拍图是否戴口罩,0-保留,1-未知,2-不戴口罩,3-戴口罩 - public byte bySmile; //抓拍图是否微笑,0-保留,1-未知,2-不微笑,3-微笑 - public byte byContrastStatus; //比对结果,0-保留,1-比对成功,2-比对失败 - public byte byBrokenNetHttp; //断网续传标志位,0-不是重传数据,1-重传数据 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //交通事件报警(扩展) - public static class NET_DVR_AID_ALARM_V41 extends Structure { - public int dwSize; //结构长度 - public int dwRelativeTime; //相对时标 - public int dwAbsTime; //绝对时标 - public NET_VCA_DEV_INFO struDevInfo = new NET_VCA_DEV_INFO(); //前端设备信息 - public NET_DVR_AID_INFO struAIDInfo = new NET_DVR_AID_INFO(); //交通事件信息 - public NET_DVR_SCENE_INFO struSceneInfo = new NET_DVR_SCENE_INFO(); //场景信息 - public int dwPicDataLen; //图片长度 - public Pointer pImage; //指向图片的指针 - // 0-数据直接上传; 1-云存储服务器URL(3.7Ver)原先的图片数据变成URL数据,图片长度变成URL长度 - public byte byDataType; - public byte byLaneNo; //关联车道号 - public short wMilliSecond; //时标毫秒 - //监测点编号(路口编号、内部编号) - public byte[] byMonitoringSiteID = new byte[MONITORSITE_ID_LEN/*48*/]; - public byte[] byDeviceID = new byte[DEVICE_ID_LEN/*48*/];//设备编号 - public int dwXmlLen;//XML报警信息长度 - public Pointer pXmlBuf;// XML报警信息指针,其XML对应到EventNotificationAlert XML Block - public byte[] byRes = new byte[20]; // 保留字节 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //交通统计信息报警(扩展) - public static class NET_DVR_TPS_ALARM_V41 extends Structure { - public int dwSize; // 结构体大小 - public int dwRelativeTime; // 相对时标 - public int dwAbsTime; // 绝对时标 - public NET_VCA_DEV_INFO struDevInfo; // 前端设备信息 - public NET_DVR_TPS_INFO_V41 struTPSInfo; // 交通参数统计信息 - //监测点编号(路口编号、内部编号) - public byte[] byMonitoringSiteID = new byte[MONITORSITE_ID_LEN/*48*/]; - public byte[] byDeviceID = new byte[DEVICE_ID_LEN/*48*/];//设备编号 - public int dwStartTime; // 开始统计时间 - public int dwStopTime; // 结束统计时间 - public byte[] byRes = new byte[24]; // 保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_LANE_PARAM_V41 extends Structure { - public byte[] byRuleName = new byte[NAME_LEN]; // 车道规则名称 - public byte byRuleID; // 规则序号,为规则配置结构下标,0-7 - public byte byLaneType; // 车道上行或下行 - public byte byTrafficState; // 车道的交通状态,0-无效,1-畅通,2-拥挤,3-堵塞 - public byte byLaneNo; //车道号 - public int dwVaryType; // 车道交通参数变化类型参照 TRAFFIC_DATA_VARY_TYPE_EX_ENUM,按位区分 - public int dwTpsType; // 数据变化类型标志,表示当前上传的统计参数中,哪些数据有效,参照ITS_TPS_TYPE,按位区分 - public int dwLaneVolume; // 车道流量,统计有多少车子通过 - public int dwLaneVelocity; // 车道速度,公里计算 - public int dwTimeHeadway; // 车头时距,以秒计算 - public int dwSpaceHeadway; // 车头间距,以米来计算 - public float fSpaceOccupyRation; // 车道占有率,百分比计算(空间上) - public float fTimeOccupyRation; // 时间占有率,百分比计算 - public int dwLightVehicle; // 小型车数量 - public int dwMidVehicle; // 中型车数量 - public int dwHeavyVehicle; // 重型车数量 - public NET_DVR_LANE_QUEUE struLaneQueue; // 车道队列长度 - public NET_VCA_POINT struRuleLocation; // 规则位置虚拟线圈的中心 - public int dwOversizeVehicle; // 大型车数量 - public byte[] byRes2 = new byte[60]; // 保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public int MAX_TPS_RULE = 8; // 最大参数规则数目 - - public static class NET_DVR_TPS_INFO_V41 extends Structure { - public int dwLanNum; // 交通参数的车道数目 - public NET_DVR_LANE_PARAM_V41[] struLaneParam = new NET_DVR_LANE_PARAM_V41[MAX_TPS_RULE]; - public int dwSceneID;//场景ID - public byte[] byRes = new byte[28]; //保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - // 车道队列结构体 - public static class NET_DVR_LANE_QUEUE extends Structure { - public NET_VCA_POINT struHead; //队列头 - public NET_VCA_POINT struTail; //队列尾 - public int dwLength; //实际队列长度 单位为米 [0-500] - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //TPS统计过车数据上传 - public static class NET_DVR_TPS_STATISTICS_INFO extends Structure { - public int dwSize; // 结构体大小 - public int dwChan;//通道号 - public NET_DVR_TPS_STATISTICS_PARAM struTPSStatisticsInfo;// 交通参数统计信息 - public byte[] byRes = new byte[128]; // 保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - // 交通参数统计信息 - public static class NET_DVR_TPS_STATISTICS_PARAM extends Structure { - public byte byStart; // 开始码 - public byte byCMD; // 命令号, 08-定时成组数据指令 - public byte[] byRes = new byte[2]; // 预留字节 - public short wDeviceID; // 设备ID - public short wDataLen; // 数据长度 - public byte byTotalLaneNum; // 有效车道总数 - public byte[] byRes1 = new byte[15]; - public NET_DVR_TIME_V30 struStartTime; //统计开始时间 - public int dwSamplePeriod; //统计时间,单位秒 - public NET_DVR_TPS_LANE_PARAM[] struLaneParam = new NET_DVR_TPS_LANE_PARAM[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //统计信息 - public static class NET_DVR_TPS_LANE_PARAM extends Structure { - public byte byLane; // 对应车道号 - public byte bySpeed; // 车道过车平均速度 - public byte[] byRes = new byte[2]; // 保留 - public int dwLightVehicle; // 小型车数量 - public int dwMidVehicle; // 中型车数量 - public int dwHeavyVehicle; // 重型车数量 - public int dwTimeHeadway; // 车头时距,以秒计算 - public int dwSpaceHeadway; // 车头间距,以米来计算 - public float fSpaceOccupyRation; // 空间占有率,百分比计算,浮点数*1000 - public float fTimeOccupyRation; // 时间占有率,百分比计算,浮点数*1000 - public byte[] byRes1 = new byte[16]; // 保留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_ALARM_ISAPI_INFO extends Structure { - public Pointer pAlarmData; // 报警数据(参见下表) - public int dwAlarmDataLen; // 报警数据长度 - public byte byDataType; // 0-invalid,1-xml,2-json - public byte byPicturesNumber; // 图片数量 - public byte[] byRes = new byte[2]; - public Pointer pPicPackData; // 图片变长部分 - //(byPicturesNumber个{NET_DVR_ALARM_ISAPI_PICDATA};) - public byte[] byRes1 = new byte[32]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class NET_DVR_LOCAL_GENERAL_CFG extends Structure { - public byte byExceptionCbDirectly; //0-通过线程池异常回调,1-直接异常回调给上层 - public byte byNotSplitRecordFile; //回放和预览中保存到本地录像文件不切片 0-默认切片,1-不切片 - public byte byResumeUpgradeEnable; //断网续传升级使能,0-关闭(默认),1-开启 - public byte byAlarmJsonPictureSeparate; //控制JSON透传报警数据和图片是否分离,0-不分离,1-分离(分离后走COMM_ISAPI_ALARM回调返回) - public byte[] byRes = new byte[4]; //保留 - public long i64FileSize; //单位:Byte - public int dwResumeUpgradeTimeout; //断网续传重连超时时间,单位毫秒 - public byte[] byRes1 = new byte[236]; //预留 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static final int MAX_FILE_PATH_LEN = 256; //文件路径长度 - - public static class NET_DVR_ALARM_ISAPI_PICDATA extends Structure { - public int dwPicLen; - public byte byPicType; //图片格式: 1- jpg - public byte[] byRes = new byte[3]; - public byte[] szFilename = new byte[MAX_FILE_PATH_LEN]; - public Pointer pPicData; // 图片数据 - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class BYTE_ARRAY extends Structure { - public byte[] byValue; - - public BYTE_ARRAY(int iLen) { - byValue = new byte[iLen]; - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return Arrays.asList("byValue"); - } - } - - /***API函数声明,详细说明见API手册***/ - public static interface FRealDataCallBack_V30 extends StdCallCallback { - public void invoke(int lRealHandle, int dwDataType, - ByteByReference pBuffer, int dwBufSize, Pointer pUser); - } - - public static interface FMSGCallBack extends StdCallCallback { - public void invoke(int lCommand, NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser); - } - - public static interface FMSGCallBack_V31 extends StdCallCallback { - public boolean invoke(int lCommand, NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser); - } - - public static interface FMessCallBack extends StdCallCallback { - public boolean invoke(int lCommand, String sDVRIP, String pBuf, int dwBufLen); - } - - public static interface FMessCallBack_EX extends StdCallCallback { - public boolean invoke(int lCommand, int lUserID, String pBuf, int dwBufLen); - } - - public static interface FMessCallBack_NEW extends StdCallCallback { - public boolean invoke(int lCommand, String sDVRIP, String pBuf, int dwBufLen, short dwLinkDVRPort); - } - - public static interface FMessageCallBack extends StdCallCallback { - public boolean invoke(int lCommand, String sDVRIP, String pBuf, int dwBufLen, int dwUser); - } - - public static interface FExceptionCallBack extends StdCallCallback { - public void invoke(int dwType, int lUserID, int lHandle, Pointer pUser); - } - - public static interface FDrawFun extends StdCallCallback { - public void invoke(int lRealHandle, W32API.HDC hDc, int dwUser); - } - - public static interface FStdDataCallBack extends StdCallCallback { - public void invoke(int lRealHandle, int dwDataType, ByteByReference pBuffer, int dwBufSize, int dwUser); - } - - public static interface FPlayDataCallBack extends StdCallCallback { - public void invoke(int lPlayHandle, int dwDataType, ByteByReference pBuffer, int dwBufSize, int dwUser); - } - - public static interface FVoiceDataCallBack extends StdCallCallback { - public void invoke(int lVoiceComHandle, String pRecvDataBuffer, int dwBufSize, byte byAudioFlag, int dwUser); - } - - public static interface FVoiceDataCallBack_V30 extends StdCallCallback { - public void invoke(int lVoiceComHandle, String pRecvDataBuffer, int dwBufSize, byte byAudioFlag, Pointer pUser); - } - - public static interface FVoiceDataCallBack_MR extends StdCallCallback { - public void invoke(int lVoiceComHandle, String pRecvDataBuffer, int dwBufSize, byte byAudioFlag, int dwUser); - } - - public static interface FVoiceDataCallBack_MR_V30 extends StdCallCallback { - public void invoke(int lVoiceComHandle, String pRecvDataBuffer, int dwBufSize, byte byAudioFlag, String pUser); - } - - public static interface FVoiceDataCallBack2 extends StdCallCallback { - public void invoke(String pRecvDataBuffer, int dwBufSize, Pointer pUser); - } - - public static interface FSerialDataCallBack extends StdCallCallback { - public void invoke(int lSerialHandle, String pRecvDataBuffer, int dwBufSize, int dwUser); - } - - public static interface FRowDataCallBack extends StdCallCallback { - public void invoke(int lUserID, String sIPAddr, int lRowAmout, String pRecvDataBuffer, int dwBufSize, int dwUser); - } - - public static interface FColLocalDataCallBack extends StdCallCallback { - public void invoke(int lUserID, String sIPAddr, int lColumnAmout, String pRecvDataBuffer, int dwBufSize, int dwUser); - } - - public static interface FColGlobalDataCallBack extends StdCallCallback { - public void invoke(int lUserID, String sIPAddr, int lColumnAmout, String pRecvDataBuffer, int dwBufSize, int dwUser); - } - - public static interface FJpegdataCallBack extends StdCallCallback { - public int invoke(int lCommand, int lUserID, String sDVRIP, String sJpegName, String pJpegBuf, int dwBufLen, int dwUser); - } - - public static interface FPostMessageCallBack extends StdCallCallback { - public int invoke(int dwType, int lIndex); - } - - boolean NET_DVR_Init(); - - boolean NET_DVR_Cleanup(); - - boolean NET_DVR_SetSDKLocalCfg(int enumType, Pointer lpInBuff); - - boolean NET_DVR_GetSDKLocalCfg(int enumType, Pointer lpOutBuff); - - boolean NET_DVR_SetDVRMessage(int nMessage, int hWnd); - - //NET_DVR_SetDVRMessage的扩展 - boolean NET_DVR_SetExceptionCallBack_V30(int nMessage, int hWnd, FExceptionCallBack fExceptionCallBack, Pointer pUser); - - boolean NET_DVR_SetDVRMessCallBack(FMessCallBack fMessCallBack); - - boolean NET_DVR_SetDVRMessCallBack_EX(FMessCallBack_EX fMessCallBack_EX); - - boolean NET_DVR_SetDVRMessCallBack_NEW(FMessCallBack_NEW fMessCallBack_NEW); - - boolean NET_DVR_SetDVRMessageCallBack(FMessageCallBack fMessageCallBack, int dwUser); - - boolean NET_DVR_SetDVRMessageCallBack_V30(FMSGCallBack fMessageCallBack, Pointer pUser); - - boolean NET_DVR_SetDVRMessageCallBack_V31(FMSGCallBack_V31 fMessageCallBack, Pointer pUser); - - boolean NET_DVR_SetConnectTime(int dwWaitTime, int dwTryTimes); - - boolean NET_DVR_SetReconnect(int dwInterval, boolean bEnableRecon); - - int NET_DVR_GetSDKVersion(); - - int NET_DVR_GetSDKBuildVersion(); - - int NET_DVR_IsSupport(); - - boolean NET_DVR_StartListen(String sLocalIP, short wLocalPort); - - boolean NET_DVR_StopListen(); - - int NET_DVR_StartListen_V30(String sLocalIP, short wLocalPort, FMSGCallBack DataCallback, Pointer pUserData); - - boolean NET_DVR_StopListen_V30(int lListenHandle); - - int NET_DVR_Login(String sDVRIP, short wDVRPort, String sUserName, String sPassword, NET_DVR_DEVICEINFO lpDeviceInfo); - - int NET_DVR_Login_V30(String sDVRIP, short wDVRPort, String sUserName, String sPassword, NET_DVR_DEVICEINFO_V30 lpDeviceInfo); - - int NET_DVR_Login_V40(NET_DVR_USER_LOGIN_INFO pLoginInfo, NET_DVR_DEVICEINFO_V40 lpDeviceInfo); - - boolean NET_DVR_Logout(int lUserID); - - boolean NET_DVR_Logout_V30(int lUserID); - - int NET_DVR_GetLastError(); - - String NET_DVR_GetErrorMsg(IntByReference pErrorNo); - - boolean NET_DVR_SetShowMode(int dwShowType, int colorKey); - - boolean NET_DVR_GetDVRIPByResolveSvr(String sServerIP, short wServerPort, String sDVRName, short wDVRNameLen, String sDVRSerialNumber, short wDVRSerialLen, String sGetIP); - - boolean NET_DVR_GetDVRIPByResolveSvr_EX(String sServerIP, short wServerPort, String sDVRName, short wDVRNameLen, String sDVRSerialNumber, short wDVRSerialLen, String sGetIP, IntByReference dwPort); - - //预览相关接口 - int NET_DVR_RealPlay(int lUserID, NET_DVR_CLIENTINFO lpClientInfo); - - int NET_DVR_RealPlay_V30(int lUserID, NET_DVR_CLIENTINFO lpClientInfo, FRealDataCallBack_V30 fRealDataCallBack_V30, Pointer pUser, boolean bBlocked); - - boolean NET_DVR_StopRealPlay(int lRealHandle); - - boolean NET_DVR_RigisterDrawFun(int lRealHandle, FDrawFun fDrawFun, int dwUser); - - boolean NET_DVR_SetPlayerBufNumber(int lRealHandle, int dwBufNum); - - boolean NET_DVR_ThrowBFrame(int lRealHandle, int dwNum); - - boolean NET_DVR_SetAudioMode(int dwMode); - - boolean NET_DVR_OpenSound(int lRealHandle); - - boolean NET_DVR_CloseSound(); - - boolean NET_DVR_OpenSoundShare(int lRealHandle); - - boolean NET_DVR_CloseSoundShare(int lRealHandle); - - boolean NET_DVR_Volume(int lRealHandle, short wVolume); - - boolean NET_DVR_SaveRealData(int lRealHandle, String sFileName); - - boolean NET_DVR_StopSaveRealData(int lRealHandle); - - boolean NET_DVR_SetRealDataCallBack(int lRealHandle, FRowDataCallBack fRealDataCallBack, int dwUser); - - boolean NET_DVR_SetStandardDataCallBack(int lRealHandle, FStdDataCallBack fStdDataCallBack, int dwUser); - - boolean NET_DVR_CapturePicture(int lRealHandle, String sPicFileName);//bmp - - //动态生成I帧 - boolean NET_DVR_MakeKeyFrame(int lUserID, int lChannel);//主码流 - - boolean NET_DVR_MakeKeyFrameSub(int lUserID, int lChannel);//子码流 - - //云台控制相关接口 - boolean NET_DVR_PTZControl(int lRealHandle, int dwPTZCommand, int dwStop); - - boolean NET_DVR_PTZControl_Other(int lUserID, int lChannel, int dwPTZCommand, int dwStop); - - boolean NET_DVR_TransPTZ(int lRealHandle, String pPTZCodeBuf, int dwBufSize); - - boolean NET_DVR_TransPTZ_Other(int lUserID, int lChannel, String pPTZCodeBuf, int dwBufSize); - - boolean NET_DVR_PTZPreset(int lRealHandle, int dwPTZPresetCmd, int dwPresetIndex); - - boolean NET_DVR_PTZPreset_Other(int lUserID, int lChannel, int dwPTZPresetCmd, int dwPresetIndex); - - boolean NET_DVR_TransPTZ_EX(int lRealHandle, String pPTZCodeBuf, int dwBufSize); - - boolean NET_DVR_PTZControl_EX(int lRealHandle, int dwPTZCommand, int dwStop); - - boolean NET_DVR_PTZPreset_EX(int lRealHandle, int dwPTZPresetCmd, int dwPresetIndex); - - boolean NET_DVR_PTZCruise(int lRealHandle, int dwPTZCruiseCmd, byte byCruiseRoute, byte byCruisePoint, short wInput); - - boolean NET_DVR_PTZCruise_Other(int lUserID, int lChannel, int dwPTZCruiseCmd, byte byCruiseRoute, byte byCruisePoint, short wInput); - - boolean NET_DVR_PTZCruise_EX(int lRealHandle, int dwPTZCruiseCmd, byte byCruiseRoute, byte byCruisePoint, short wInput); - - boolean NET_DVR_PTZTrack(int lRealHandle, int dwPTZTrackCmd); - - boolean NET_DVR_PTZTrack_Other(int lUserID, int lChannel, int dwPTZTrackCmd); - - boolean NET_DVR_PTZTrack_EX(int lRealHandle, int dwPTZTrackCmd); - - boolean NET_DVR_PTZControlWithSpeed(int lRealHandle, int dwPTZCommand, int dwStop, int dwSpeed); - - boolean NET_DVR_PTZControlWithSpeed_Other(int lUserID, int lChannel, int dwPTZCommand, int dwStop, int dwSpeed); - - boolean NET_DVR_PTZControlWithSpeed_EX(int lRealHandle, int dwPTZCommand, int dwStop, int dwSpeed); - - boolean NET_DVR_GetPTZCruise(int lUserID, int lChannel, int lCruiseRoute, NET_DVR_CRUISE_RET lpCruiseRet); - - boolean NET_DVR_PTZMltTrack(int lRealHandle, int dwPTZTrackCmd, int dwTrackIndex); - - boolean NET_DVR_PTZMltTrack_Other(int lUserID, int lChannel, int dwPTZTrackCmd, int dwTrackIndex); - - boolean NET_DVR_PTZMltTrack_EX(int lRealHandle, int dwPTZTrackCmd, int dwTrackIndex); - - //文件查找与回放 - int NET_DVR_FindFile(int lUserID, int lChannel, int dwFileType, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime); - - int NET_DVR_FindNextFile(int lFindHandle, NET_DVR_FIND_DATA lpFindData); - - boolean NET_DVR_FindClose(int lFindHandle); - - int NET_DVR_FindNextFile_V30(int lFindHandle, NET_DVR_FINDDATA_V30 lpFindData); - - int NET_DVR_FindFile_V30(int lUserID, NET_DVR_FILECOND pFindCond); - - boolean NET_DVR_FindClose_V30(int lFindHandle); - - //2007-04-16增加查询结果带卡号的文件查找 - int NET_DVR_FindNextFile_Card(int lFindHandle, NET_DVR_FINDDATA_CARD lpFindData); - - int NET_DVR_FindFile_Card(int lUserID, int lChannel, int dwFileType, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime); - - boolean NET_DVR_LockFileByName(int lUserID, String sLockFileName); - - boolean NET_DVR_UnlockFileByName(int lUserID, String sUnlockFileName); - - int NET_DVR_PlayBackByName(int lUserID, String sPlayBackFileName, HWND hWnd); - - int NET_DVR_PlayBackByTime(int lUserID, int lChannel, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime, HWND hWnd); - - boolean NET_DVR_PlayBackControl(int lPlayHandle, int dwControlCode, int dwInValue, IntByReference LPOutValue); - - boolean NET_DVR_StopPlayBack(int lPlayHandle); - - boolean NET_DVR_SetPlayDataCallBack(int lPlayHandle, FPlayDataCallBack fPlayDataCallBack, int dwUser); - - boolean NET_DVR_PlayBackSaveData(int lPlayHandle, String sFileName); - - boolean NET_DVR_StopPlayBackSave(int lPlayHandle); - - boolean NET_DVR_GetPlayBackOsdTime(int lPlayHandle, NET_DVR_TIME lpOsdTime); - - boolean NET_DVR_PlayBackCaptureFile(int lPlayHandle, String sFileName); - - int NET_DVR_GetFileByName(int lUserID, String sDVRFileName, String sSavedFileName); - - int NET_DVR_GetFileByTime(int lUserID, int lChannel, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime, String sSavedFileName); - - boolean NET_DVR_StopGetFile(int lFileHandle); - - int NET_DVR_GetDownloadPos(int lFileHandle); - - int NET_DVR_GetPlayBackPos(int lPlayHandle); - - //升级 - int NET_DVR_Upgrade(int lUserID, String sFileName); - - int NET_DVR_GetUpgradeState(int lUpgradeHandle); - - int NET_DVR_GetUpgradeProgress(int lUpgradeHandle); - - boolean NET_DVR_CloseUpgradeHandle(int lUpgradeHandle); - - boolean NET_DVR_SetNetworkEnvironment(int dwEnvironmentLevel); - - //远程格式化硬盘 - int NET_DVR_FormatDisk(int lUserID, int lDiskNumber); - - boolean NET_DVR_GetFormatProgress(int lFormatHandle, IntByReference pCurrentFormatDisk, IntByReference pCurrentDiskPos, IntByReference pFormatStatic); - - boolean NET_DVR_CloseFormatHandle(int lFormatHandle); - - //报警 - int NET_DVR_SetupAlarmChan(int lUserID); - - boolean NET_DVR_CloseAlarmChan(int lAlarmHandle); - - int NET_DVR_SetupAlarmChan_V30(int lUserID); - - int NET_DVR_SetupAlarmChan_V41(int lUserID, NET_DVR_SETUPALARM_PARAM lpSetupParam); - - boolean NET_DVR_CloseAlarmChan_V30(int lAlarmHandle); - - //语音对讲 - int NET_DVR_StartVoiceCom(int lUserID, FVoiceDataCallBack fVoiceDataCallBack, int dwUser); - - int NET_DVR_StartVoiceCom_V30(int lUserID, int dwVoiceChan, boolean bNeedCBNoEncData, FVoiceDataCallBack_V30 fVoiceDataCallBack, Pointer pUser); - - boolean NET_DVR_SetVoiceComClientVolume(int lVoiceComHandle, short wVolume); - - boolean NET_DVR_StopVoiceCom(int lVoiceComHandle); - - //语音转发 - int NET_DVR_StartVoiceCom_MR(int lUserID, FVoiceDataCallBack_MR fVoiceDataCallBack, int dwUser); - - int NET_DVR_StartVoiceCom_MR_V30(int lUserID, int dwVoiceChan, FVoiceDataCallBack_MR_V30 fVoiceDataCallBack, Pointer pUser); - - boolean NET_DVR_VoiceComSendData(int lVoiceComHandle, String pSendBuf, int dwBufSize); - - //语音广播 - boolean NET_DVR_ClientAudioStart(); - - boolean NET_DVR_ClientAudioStart_V30(FVoiceDataCallBack2 fVoiceDataCallBack2, Pointer pUser); - - boolean NET_DVR_ClientAudioStop(); - - boolean NET_DVR_AddDVR(int lUserID); - - int NET_DVR_AddDVR_V30(int lUserID, int dwVoiceChan); - - boolean NET_DVR_DelDVR(int lUserID); - - boolean NET_DVR_DelDVR_V30(int lVoiceHandle); - - //////////////////////////////////////////////////////////// -//透明通道设置 - int NET_DVR_SerialStart(int lUserID, int lSerialPort, FSerialDataCallBack fSerialDataCallBack, int dwUser); - - //485作为透明通道时,需要指明通道号,因为不同通道号485的设置可以不同(比如波特率) - boolean NET_DVR_SerialSend(int lSerialHandle, int lChannel, String pSendBuf, int dwBufSize); - - boolean NET_DVR_SerialStop(int lSerialHandle); - - boolean NET_DVR_SendTo232Port(int lUserID, String pSendBuf, int dwBufSize); - - boolean NET_DVR_SendToSerialPort(int lUserID, int dwSerialPort, int dwSerialIndex, String pSendBuf, int dwBufSize); - - //解码 nBitrate = 16000 - Pointer NET_DVR_InitG722Decoder(int nBitrate); - - void NET_DVR_ReleaseG722Decoder(Pointer pDecHandle); - - boolean NET_DVR_DecodeG722Frame(Pointer pDecHandle, String pInBuffer, String pOutBuffer); - - //编码 - Pointer NET_DVR_InitG722Encoder(); - - boolean NET_DVR_EncodeG722Frame(Pointer pEncodeHandle, String pInBuff, String pOutBuffer); - - void NET_DVR_ReleaseG722Encoder(Pointer pEncodeHandle); - - //远程控制本地显示 - boolean NET_DVR_ClickKey(int lUserID, int lKeyIndex); - - //远程控制设备端手动录像 - boolean NET_DVR_StartDVRRecord(int lUserID, int lChannel, int lRecordType); - - boolean NET_DVR_StopDVRRecord(int lUserID, int lChannel); - - //解码卡 - boolean NET_DVR_InitDevice_Card(IntByReference pDeviceTotalChan); - - boolean NET_DVR_ReleaseDevice_Card(); - - boolean NET_DVR_InitDDraw_Card(int hParent, int colorKey); - - boolean NET_DVR_ReleaseDDraw_Card(); - - int NET_DVR_RealPlay_Card(int lUserID, NET_DVR_CARDINFO lpCardInfo, int lChannelNum); - - boolean NET_DVR_ResetPara_Card(int lRealHandle, NET_DVR_DISPLAY_PARA lpDisplayPara); - - boolean NET_DVR_RefreshSurface_Card(); - - boolean NET_DVR_ClearSurface_Card(); - - boolean NET_DVR_RestoreSurface_Card(); - - boolean NET_DVR_OpenSound_Card(int lRealHandle); - - boolean NET_DVR_CloseSound_Card(int lRealHandle); - - boolean NET_DVR_SetVolume_Card(int lRealHandle, short wVolume); - - boolean NET_DVR_AudioPreview_Card(int lRealHandle, boolean bEnable); - - int NET_DVR_GetCardLastError_Card(); - - Pointer NET_DVR_GetChanHandle_Card(int lRealHandle); - - boolean NET_DVR_CapturePicture_Card(int lRealHandle, String sPicFileName); - - //获取解码卡序列号此接口无效,改用GetBoardDetail接口获得(2005-12-08支持) - boolean NET_DVR_GetSerialNum_Card(int lChannelNum, IntByReference pDeviceSerialNo); - - //日志 - int NET_DVR_FindDVRLog(int lUserID, int lSelectMode, int dwMajorType, int dwMinorType, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime); - - int NET_DVR_FindNextLog(int lLogHandle, NET_DVR_LOG lpLogData); - - boolean NET_DVR_FindLogClose(int lLogHandle); - - int NET_DVR_FindDVRLog_V30(int lUserID, int lSelectMode, int dwMajorType, int dwMinorType, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime, boolean bOnlySmart); - - int NET_DVR_FindNextLog_V30(int lLogHandle, NET_DVR_LOG_V30 lpLogData); - - boolean NET_DVR_FindLogClose_V30(int lLogHandle); - - //截止2004年8月5日,共113个接口 -//ATM DVR - int NET_DVR_FindFileByCard(int lUserID, int lChannel, int dwFileType, int nFindType, String sCardNumber, NET_DVR_TIME lpStartTime, NET_DVR_TIME lpStopTime); -//截止2004年10月5日,共116个接口 - - //2005-09-15 - boolean NET_DVR_CaptureJPEGPicture(int lUserID, int lChannel, NET_DVR_JPEGPARA lpJpegPara, String sPicFileName); - - //JPEG抓图到内存 - //boolean NET_DVR_CaptureJPEGPicture_NEW(int lUserID, int lChannel, NET_DVR_JPEGPARA lpJpegPara, String sJpegPicBuffer, int dwPicSize, IntByReference lpSizeReturned); - boolean NET_DVR_CaptureJPEGPicture_NEW(int lUserID, int lChannel, NET_DVR_JPEGPARA lpJpegPara, ByteBuffer sJpegPicBuffer, int dwPicSize, IntByReference lpSizeReturned); - - - //2006-02-16 - int NET_DVR_GetRealPlayerIndex(int lRealHandle); - - int NET_DVR_GetPlayBackPlayerIndex(int lPlayHandle); - - //2006-08-28 704-640 缩放配置 - boolean NET_DVR_SetScaleCFG(int lUserID, int dwScale); - - boolean NET_DVR_GetScaleCFG(int lUserID, IntByReference lpOutScale); - - boolean NET_DVR_SetScaleCFG_V30(int lUserID, NET_DVR_SCALECFG pScalecfg); - - boolean NET_DVR_GetScaleCFG_V30(int lUserID, NET_DVR_SCALECFG pScalecfg); - - //2006-08-28 ATM机端口设置 - boolean NET_DVR_SetATMPortCFG(int lUserID, short wATMPort); - - boolean NET_DVR_GetATMPortCFG(int lUserID, ShortByReference LPOutATMPort); - - //2006-11-10 支持显卡辅助输出 - boolean NET_DVR_InitDDrawDevice(); - - boolean NET_DVR_ReleaseDDrawDevice(); - - int NET_DVR_GetDDrawDeviceTotalNums(); - - boolean NET_DVR_SetDDrawDevice(int lPlayPort, int nDeviceNum); - - boolean NET_DVR_PTZSelZoomIn(int lRealHandle, NET_DVR_POINT_FRAME pStruPointFrame); - - boolean NET_DVR_PTZSelZoomIn_EX(int lUserID, int lChannel, NET_DVR_POINT_FRAME pStruPointFrame); - - //解码设备DS-6001D/DS-6001F - boolean NET_DVR_StartDecode(int lUserID, int lChannel, NET_DVR_DECODERINFO lpDecoderinfo); - - boolean NET_DVR_StopDecode(int lUserID, int lChannel); - - boolean NET_DVR_GetDecoderState(int lUserID, int lChannel, NET_DVR_DECODERSTATE lpDecoderState); - - //2005-08-01 - boolean NET_DVR_SetDecInfo(int lUserID, int lChannel, NET_DVR_DECCFG lpDecoderinfo); - - boolean NET_DVR_GetDecInfo(int lUserID, int lChannel, NET_DVR_DECCFG lpDecoderinfo); - - boolean NET_DVR_SetDecTransPort(int lUserID, NET_DVR_PORTCFG lpTransPort); - - boolean NET_DVR_GetDecTransPort(int lUserID, NET_DVR_PORTCFG lpTransPort); - - boolean NET_DVR_DecPlayBackCtrl(int lUserID, int lChannel, int dwControlCode, int dwInValue, IntByReference LPOutValue, NET_DVR_PLAYREMOTEFILE lpRemoteFileInfo); - - boolean NET_DVR_StartDecSpecialCon(int lUserID, int lChannel, NET_DVR_DECCHANINFO lpDecChanInfo); - - boolean NET_DVR_StopDecSpecialCon(int lUserID, int lChannel, NET_DVR_DECCHANINFO lpDecChanInfo); - - boolean NET_DVR_DecCtrlDec(int lUserID, int lChannel, int dwControlCode); - - boolean NET_DVR_DecCtrlScreen(int lUserID, int lChannel, int dwControl); - - boolean NET_DVR_GetDecCurLinkStatus(int lUserID, int lChannel, NET_DVR_DECSTATUS lpDecStatus); - - //多路解码器 -//2007-11-30 V211支持以下接口 //11 - boolean NET_DVR_MatrixStartDynamic(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_DYNAMIC_DEC lpDynamicInfo); - - boolean NET_DVR_MatrixStopDynamic(int lUserID, int dwDecChanNum); - - boolean NET_DVR_MatrixGetDecChanInfo(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_DEC_CHAN_INFO lpInter); - - boolean NET_DVR_MatrixSetLoopDecChanInfo(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_LOOP_DECINFO lpInter); - - boolean NET_DVR_MatrixGetLoopDecChanInfo(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_LOOP_DECINFO lpInter); - - boolean NET_DVR_MatrixSetLoopDecChanEnable(int lUserID, int dwDecChanNum, int dwEnable); - - boolean NET_DVR_MatrixGetLoopDecChanEnable(int lUserID, int dwDecChanNum, IntByReference lpdwEnable); - - boolean NET_DVR_MatrixGetLoopDecEnable(int lUserID, IntByReference lpdwEnable); - - boolean NET_DVR_MatrixSetDecChanEnable(int lUserID, int dwDecChanNum, int dwEnable); - - boolean NET_DVR_MatrixGetDecChanEnable(int lUserID, int dwDecChanNum, IntByReference lpdwEnable); - - boolean NET_DVR_MatrixGetDecChanStatus(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_DEC_CHAN_STATUS lpInter); - - //2007-12-22 增加支持接口 //18 - boolean NET_DVR_MatrixSetTranInfo(int lUserID, NET_DVR_MATRIX_TRAN_CHAN_CONFIG lpTranInfo); - - boolean NET_DVR_MatrixGetTranInfo(int lUserID, NET_DVR_MATRIX_TRAN_CHAN_CONFIG lpTranInfo); - - boolean NET_DVR_MatrixSetRemotePlay(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_DEC_REMOTE_PLAY lpInter); - - boolean NET_DVR_MatrixSetRemotePlayControl(int lUserID, int dwDecChanNum, int dwControlCode, int dwInValue, IntByReference LPOutValue); - - boolean NET_DVR_MatrixGetRemotePlayStatus(int lUserID, int dwDecChanNum, NET_DVR_MATRIX_DEC_REMOTE_PLAY_STATUS lpOuter); - - //end - boolean NET_DVR_RefreshPlay(int lPlayHandle); - - //恢复默认值 - boolean NET_DVR_RestoreConfig(int lUserID); - - //保存参数 - boolean NET_DVR_SaveConfig(int lUserID); - - //重启 - boolean NET_DVR_RebootDVR(int lUserID); - - //关闭DVR - boolean NET_DVR_ShutDownDVR(int lUserID); - - //参数配置 begin - boolean NET_DVR_GetDeviceConfig(int lUserID, int dwCommand, int dwCount, Pointer lpInBuffer, int dwInBufferSize, Pointer lpStatusList, Pointer lpOutBuffer, int dwOutBufferSize); - - boolean NET_DVR_GetDVRConfig(int lUserID, int dwCommand, int lChannel, Pointer lpOutBuffer, int dwOutBufferSize, IntByReference lpBytesReturned); - - boolean NET_DVR_SetDVRConfig(int lUserID, int dwCommand, int lChannel, Pointer lpInBuffer, int dwInBufferSize); - - boolean NET_DVR_GetDVRWorkState_V30(int lUserID, NET_DVR_WORKSTATE_V30 lpWorkState); - - boolean NET_DVR_GetDVRWorkState(int lUserID, NET_DVR_WORKSTATE lpWorkState); - - boolean NET_DVR_SetVideoEffect(int lUserID, int lChannel, int dwBrightValue, int dwContrastValue, int dwSaturationValue, int dwHueValue); - - boolean NET_DVR_GetVideoEffect(int lUserID, int lChannel, IntByReference pBrightValue, IntByReference pContrastValue, IntByReference pSaturationValue, IntByReference pHueValue); - - boolean NET_DVR_ClientGetframeformat(int lUserID, NET_DVR_FRAMEFORMAT lpFrameFormat); - - boolean NET_DVR_ClientSetframeformat(int lUserID, NET_DVR_FRAMEFORMAT lpFrameFormat); - - boolean NET_DVR_ClientGetframeformat_V30(int lUserID, NET_DVR_FRAMEFORMAT_V30 lpFrameFormat); - - boolean NET_DVR_ClientSetframeformat_V30(int lUserID, NET_DVR_FRAMEFORMAT_V30 lpFrameFormat); - - boolean NET_DVR_GetAlarmOut_V30(int lUserID, NET_DVR_ALARMOUTSTATUS_V30 lpAlarmOutState); - - boolean NET_DVR_GetAlarmOut(int lUserID, NET_DVR_ALARMOUTSTATUS lpAlarmOutState); - - boolean NET_DVR_SetAlarmOut(int lUserID, int lAlarmOutPort, int lAlarmOutStatic); - - //视频参数调节 - boolean NET_DVR_ClientSetVideoEffect(int lRealHandle, int dwBrightValue, int dwContrastValue, int dwSaturationValue, int dwHueValue); - - boolean NET_DVR_ClientGetVideoEffect(int lRealHandle, IntByReference pBrightValue, IntByReference pContrastValue, IntByReference pSaturationValue, IntByReference pHueValue); - - //配置文件 - boolean NET_DVR_GetConfigFile(int lUserID, String sFileName); - - boolean NET_DVR_SetConfigFile(int lUserID, String sFileName); - - boolean NET_DVR_GetConfigFile_V30(int lUserID, String sOutBuffer, int dwOutSize, IntByReference pReturnSize); - - boolean NET_DVR_GetConfigFile_EX(int lUserID, String sOutBuffer, int dwOutSize); - - boolean NET_DVR_SetConfigFile_EX(int lUserID, String sInBuffer, int dwInSize); - - //启用日志文件写入接口 - boolean NET_DVR_SetLogToFile(int bLogEnable, String strLogDir, boolean bAutoDel); - - boolean NET_DVR_GetSDKState(NET_DVR_SDKSTATE pSDKState); - - boolean NET_DVR_GetSDKAbility(NET_DVR_SDKABL pSDKAbl); - - boolean NET_DVR_GetPTZProtocol(int lUserID, NET_DVR_PTZCFG pPtzcfg); - - //前面板锁定 - boolean NET_DVR_LockPanel(int lUserID); - - boolean NET_DVR_UnLockPanel(int lUserID); - - boolean NET_DVR_SetRtspConfig(int lUserID, int dwCommand, NET_DVR_RTSPCFG lpInBuffer, int dwInBufferSize); - - boolean NET_DVR_GetRtspConfig(int lUserID, int dwCommand, NET_DVR_RTSPCFG lpOutBuffer, int dwOutBufferSize); - - boolean NET_DVR_ContinuousShoot(int lUserID, NET_DVR_SNAPCFG lpInter); - - public static interface FRemoteConfigCallback extends StdCallCallback { - public void invoke(int dwType, Pointer lpBuffer, int dwBufLen, Pointer pUserData); - } - - int NET_DVR_StartRemoteConfig(int lUserID, int dwCommand, Pointer lpInBuffer, int dwInBufferLen, FRemoteConfigCallback cbStateCallback, Pointer pUserData); - - boolean NET_DVR_SendRemoteConfig(int lHandle, int dwDataType, Pointer pSendBuf, int dwBufSize); - - int NET_DVR_GetNextRemoteConfig(int lHandle, Pointer lpOutBuff, int dwOutBuffSize); - - boolean NET_DVR_StopRemoteConfig(int lHandle); - - boolean NET_DVR_STDXMLConfig(int lUserID, NET_DVR_XML_CONFIG_INPUT lpInputParam, NET_DVR_XML_CONFIG_OUTPUT lpOutputParam); - - //gps相关结构定义 - public static class TimeSegParam extends Structure { - //GPS数据查找起始时间 - public NET_DVR_TIME struBeginTime; - //GPS数据查找结束时间 - public NET_DVR_TIME struEndTime; - //GPS点时间间隔,单位:秒 - public int dwInterval; - //保留 - public byte[] byRes = new byte[76]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //按时间点查询 - public static class TimePointParam extends Structure { - //GPS数据查找时间点 - public NET_DVR_TIME struTimePoint; - //保留 - public byte[] byRes = new byte[104]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static class GpsDataParamUion extends Union { - //按时间段查询 - public TimeSegParam timeSeg = new TimeSegParam(); - //按时间点查询 - public TimePointParam timePoint = new TimePointParam(); - } - - //gps查询参数定义 - public static class NET_DVR_GET_GPS_DATA_PARAM extends Structure { - //查找方式:0- 按时间段查找GPS数据,1- 按时间点查找GPS数据 - public int dwCmdType; - public GpsDataParamUion gpsDataParam; - - public void read() { - super.read(); - switch (dwCmdType) { - case 0: - gpsDataParam.setType(TimeSegParam.class); - break; - case 1: - gpsDataParam.setType(TimePointParam.class); - break; - default: - break; - } - gpsDataParam.read(); - } - - public void write() { - super.write(); - gpsDataParam.write(); - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //gps数据结构定义 - public static class NET_DVR_GPS_INFO extends Structure { - public byte[] byDirection = new byte[2]; - public byte bySvs; - public byte byLocateMode; - public short wHDOP; - public short wHeight; - public int dwLatitude; - public int dwLongitude; - public int dwVehicleSpeed; - public int dwVehicleDirection; - public byte[] byRes = new byte[8]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - //gps返回数据结构定义 - public static class NET_DVR_GPS_DATA extends Structure { - public NET_DVR_GPS_INFO struGPSInfo; - public NET_DVR_TIME struTime; - public byte[] byRes = new byte[12]; - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - - public static interface fGPSDataCallback extends StdCallCallback { - public void invoke(int nHandle, int dwState, Pointer lpBuffer, int dwBufLen, Pointer pUser); - } - - int NET_DVR_GetVehicleGpsInfo(int lUserID, NET_DVR_GET_GPS_DATA_PARAM lpGPSDataParam, fGPSDataCallback cbGPSDataCallback, Pointer pUser); -} - - -//播放库函数声明,PlayCtrl.dll -interface PlayCtrl extends StdCallLibrary { - PlayCtrl INSTANCE = (PlayCtrl) Native.loadLibrary("../lib/PlayCtrl", - PlayCtrl.class); - - public static final int STREAME_REALTIME = 0; - public static final int STREAME_FILE = 1; - - boolean PlayM4_GetPort(IntByReference nPort); - - boolean PlayM4_OpenStream(int nPort, ByteByReference pFileHeadBuf, int nSize, int nBufPoolSize); - - boolean PlayM4_InputData(int nPort, ByteByReference pBuf, int nSize); - - boolean PlayM4_CloseStream(int nPort); - - boolean PlayM4_SetStreamOpenMode(int nPort, int nMode); - - boolean PlayM4_Play(int nPort, HWND hWnd); - - boolean PlayM4_Stop(int nPort); - - boolean PlayM4_SetSecretKey(int nPort, int lKeyType, String pSecretKey, int lKeyLen); -} - -//windows gdi接口,gdi32.dll in system32 folder, 在设置遮挡区域,移动侦测区域等情况下使用 -interface GDI32 extends W32API { - GDI32 INSTANCE = (GDI32) Native.loadLibrary("gdi32", GDI32.class, DEFAULT_OPTIONS); - - public static final int TRANSPARENT = 1; - - int SetBkMode(HDC hdc, int i); - - HANDLE CreateSolidBrush(int icolor); -} - -//windows user32接口,user32.dll in system32 folder, 在设置遮挡区域,移动侦测区域等情况下使用 -interface USER32 extends W32API { - - USER32 INSTANCE = (USER32) Native.loadLibrary("user32", USER32.class, DEFAULT_OPTIONS); - - public static final int BF_LEFT = 0x0001; - public static final int BF_TOP = 0x0002; - public static final int BF_RIGHT = 0x0004; - public static final int BF_BOTTOM = 0x0008; - public static final int BDR_SUNKENOUTER = 0x0002; - public static final int BF_RECT = (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM); - - boolean DrawEdge(HDC hdc, RECT qrc, int edge, int grfFlags); - - int FillRect(HDC hDC, RECT lprc, HANDLE hbr); -} diff --git a/src/com/sipai/tools/HttpUtil.java b/src/com/sipai/tools/HttpUtil.java deleted file mode 100644 index a97b0279..00000000 --- a/src/com/sipai/tools/HttpUtil.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.sipai.tools; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import com.alibaba.fastjson.JSONObject; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.client.Options; -import org.apache.axis2.rpc.client.RPCServiceClient; -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.ParseException; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicHeader; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; - - -/** - * @author wxp - * - */ -public class HttpUtil { - - private static final CloseableHttpClient httpclient = HttpClients.createDefault(); - private static final String APPLICATION_JSON = "application/json"; - private static final String CONTENT_TYPE_TEXT_JSON = "text/json"; - - /** - * 发送HttpGet请求 - * @param url - * @return - */ - public static String sendGet(String url) { - - HttpGet httpget = new HttpGet(url); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httpget); - } catch (IOException e1) { - e1.printStackTrace(); - } - String result = null; - if(response!=null){ - try { - HttpEntity entity = response.getEntity(); - if (entity != null) { - result = EntityUtils.toString(entity); - } - } catch (ParseException | IOException e) { - e.printStackTrace(); - } finally { - try { - - response.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return result; - } - - /** - * 发送HttpGet请求 - * @param url - * @return - */ - public static String sendGet(String url, Map header) { - HttpGet httpget = new HttpGet(url); - header.forEach(httpget::setHeader); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httpget); - } catch (IOException e1) { - e1.printStackTrace(); - } - String result = null; - if(response!=null){ - try { - HttpEntity entity = response.getEntity(); - if (entity != null) { - result = EntityUtils.toString(entity); - } - } catch (ParseException | IOException e) { - e.printStackTrace(); - } finally { - try { - response.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return result; - } - - /** - * 发送HttpPost请求,参数为map - * @param url - * @param map - * @return - */ - public static String sendPost(String url, Map map) { - List formparams = new ArrayList(); - for (Map.Entry entry : map.entrySet()) { - formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); - } - UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, Consts.UTF_8); - HttpPost httppost = new HttpPost(url); - httppost.setEntity(entity); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httppost); - } catch (IOException e) { - e.printStackTrace(); - } - HttpEntity entity1 = response.getEntity(); - String result = null; - try { - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - e.printStackTrace(); - } - return result; - } - - /** - * 发送HttpPost请求,参数为map - * 带请求头 - * @param url - * @param req - * @return - */ - public static String sendPost(String url, JSONObject req, Map header) throws UnsupportedEncodingException { - StringEntity entity = new StringEntity(req.toJSONString()); - HttpPost httppost = new HttpPost(url); - httppost.setEntity(entity); - header.forEach(httppost::setHeader); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httppost); - } catch (IOException e) { - e.printStackTrace(); - } - HttpEntity entity1 = response.getEntity(); - String result = null; - try { - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - e.printStackTrace(); - } - return result; - } - - /** - * 发送HttpPost请求,参数为json - * @param url - * @param json - * @return - */ - public static String sendPost(String url, String json) { - String result = null; - try { - StringEntity entity = new StringEntity(json); - entity.setContentType(CONTENT_TYPE_TEXT_JSON); - entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, APPLICATION_JSON)); - - HttpPost httppost = new HttpPost(url); - httppost.setEntity(entity); - - RequestConfig config = RequestConfig.custom() - .setConnectTimeout(2000) //连接超时时间 - .setConnectionRequestTimeout(2000) //从连接池中取的连接的最长时间 - .setSocketTimeout(2000) //数据传输的超时时间 - .build(); - //设置请求配置时间 - httppost.setConfig(config); - - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { - e.printStackTrace(); - } - return result; - } - - /** - * 带token post请求 - * @param url - * @param token - * @return - */ - public static String sendPostToken(String url, String token) { - HttpPost httppost = new HttpPost(url); - httppost.setHeader("token", token); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httppost); - } catch (IOException e) { - e.printStackTrace(); - } - HttpEntity entity = response.getEntity(); - String result = null; - try { - result = EntityUtils.toString(entity); - } catch (ParseException | IOException e) { - e.printStackTrace(); - } - return result; - } - - /** - * 发送不带参数的HttpPost请求 - * @param url - * @return - */ - public static String sendPost(String url) { - HttpPost httppost = new HttpPost(url); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httppost); - } catch (IOException e) { - e.printStackTrace(); - } - HttpEntity entity = response.getEntity(); - String result = null; - try { - result = EntityUtils.toString(entity); - } catch (ParseException | IOException e) { - e.printStackTrace(); - } - return result; - } - - /** - * 发送不带参数的HttpPost请求 5S超时 - * @param url - * @return - */ - public static String sendPost_s(String url,int s) { - String result = null; - try { - HttpPost httppost = new HttpPost(url); - RequestConfig config = RequestConfig.custom() - .setConnectTimeout(s) //连接超时时间 - .setConnectionRequestTimeout(s) //从连接池中取的连接的最长时间 - .setSocketTimeout(s) //数据传输的超时时间 - .build(); - //设置请求配置时间 - httppost.setConfig(config); - - CloseableHttpResponse response = null; - response = httpclient.execute(httppost); - HttpEntity entity1 = response.getEntity(); - result = EntityUtils.toString(entity1); - } catch (ParseException | IOException e) { -// e.printStackTrace(); - System.out.println("获取当前库位信息接口连接超时! "+CommUtil.nowDate()); - } - return result; - } - - /** - * 发送webservice请求 - * @param flag 是否启用压缩转换 - * @return - */ - public static String sendWebServie(String server,String method,String[] param ,String namespace,boolean flag) { - String result = null; - EndpointReference targetEPR = new EndpointReference(server); - RPCServiceClient sender; - try { - sender = new RPCServiceClient(); - Options options = sender.getOptions(); - options.setTimeOutInMilliSeconds(1000*5);//超时时间5s - options.setTo(targetEPR); - QName qname = new QName(namespace,method); - int length =param.length; - //String result="{\"res\":"+json+"}"; -// param = new Object[]{CommUtil.GZIPcompress(paramJson)}; - Class[] types = new Class[length]; - //这是针对返值类型的 - - for(int i=0;i180){ -// width=180; -// height= width*srcHeight/srcWidth; -// } -// }else if(flag.trim().equals("1")){//如果为固定宽 -// if(srcWidth<=1200){ -// width=srcWidth; -// height=srcHeight; -// }else if(width>1200){ -// height= width*srcHeight/srcWidth; -// } -// } -// float multiple = 1; -//// if(flag==ImageUtil.DROW_WHTH_MAX_HEIGHT){ //固定高度 -// if(flag.trim().equals("0")){ //固定高度 -// multiple = 1.0F*height/srcHeight; -// width = (int) (srcWidth*multiple); -// height = (int) (srcHeight*multiple); -//// }else if(flag==ImageUtil.DROW_WHTH_MAX_WIDTH){ //固定宽度 -// }else if(flag.trim().equals("1")){ //固定宽度 -// multiple = 1.0F*width/srcWidth; -// width = (int) (srcWidth*multiple); -// height = (int) (srcHeight*multiple); -// } - int borderWidth = width; - int borderHeight = height; - Image image = src.getScaledInstance(width, height,Image.SCALE_DEFAULT); - BufferedImage tag = new BufferedImage(borderWidth,borderHeight,BufferedImage.TYPE_INT_RGB); - Graphics g = tag.getGraphics(); - g.drawImage(image,0, 0, null); // 绘制缩小后的图 - g.setFont(new Font("宋体",Font.PLAIN,10)); - String strExif = ImageUtil.getEXIFInfo(srcFile); - exifstr=strExif; -// g.drawString(strExif,8,borderHeight-10);//添加EXIF信息 - g.setFont(new Font("华文彩云",Font.PLAIN,18)); - g.setColor(Color.LIGHT_GRAY); - g.drawString(ImageUtil.INFO_STRING,borderWidth-CommUtil.getRealLength(ImageUtil.INFO_STRING)*10-5,20+25); - ImageIO.write(tag, "JPEG", new File(outFile)); - } catch (IOException e) { - e.printStackTrace(); - } - return exifstr; - } - - public static String getEXIFInfo(File imgFile){ - StringBuffer strExif = new StringBuffer(); - try { - Metadata metadata = JpegMetadataReader.readMetadata(imgFile); - for (Directory directory : metadata.getDirectories()) { - if("ExifSubIFDDirectory".equalsIgnoreCase( directory.getClass().getSimpleName() )){ - - //光圈F值=镜头的焦距/镜头光圈的直径 - strExif.append("光圈值: f/" + directory.getString(ExifSubIFDDirectory.TAG_FNUMBER) ); - - strExif.append("曝光时间: " + directory.getString(ExifSubIFDDirectory.TAG_EXPOSURE_TIME)+ "秒" ); - strExif.append("ISO速度: " + directory.getString(ExifSubIFDDirectory.TAG_ISO_EQUIVALENT) ); - strExif.append("焦距: " + directory.getString(ExifSubIFDDirectory.TAG_FOCAL_LENGTH) + "毫米" ); - - strExif.append("拍照时间: " + directory.getString(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL) ); - strExif.append("宽: " + directory.getString(ExifSubIFDDirectory.TAG_EXIF_IMAGE_WIDTH) ); - strExif.append("高: " + directory.getString(ExifSubIFDDirectory.TAG_EXIF_IMAGE_HEIGHT) ); - - } - } - } catch (JpegProcessingException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } - return strExif.toString(); - } - - public static final int DROW_WHTH_MAX_HEIGHT=1; - public static final int DROW_WHTH_MAX_WIDTH=0; - public static final int DROW_WHTH_SIZE = 2; - public static final String INFO_STRING=""; - -} diff --git a/src/com/sipai/tools/InitHCNetSDK.java b/src/com/sipai/tools/InitHCNetSDK.java deleted file mode 100644 index 83629488..00000000 --- a/src/com/sipai/tools/InitHCNetSDK.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.sipai.tools; - -import javax.servlet.http.HttpServlet; - -@SuppressWarnings("serial") -public class InitHCNetSDK extends HttpServlet{ - public static int cameraUserId = -1; - - public void init(){ - System.out.println("初始化sdk"); - cameraUserId = CameraCall.getUserId("10.28.137.227", "admin", "YH123456789"); - } - -} diff --git a/src/com/sipai/tools/JasperHelper.java b/src/com/sipai/tools/JasperHelper.java deleted file mode 100644 index 98741aa1..00000000 --- a/src/com/sipai/tools/JasperHelper.java +++ /dev/null @@ -1,450 +0,0 @@ -//package com.sipai.tools; -//import java.io.File; -//import java.io.FileOutputStream; -//import java.io.IOException; -//import java.io.PrintWriter; -//import java.lang.reflect.Field; -//import java.net.URLEncoder; -//import java.sql.Connection; -//import java.util.HashMap; -//import java.util.Map; -// -// -// -// -// -// -// -// -// -//import javax.servlet.ServletException; -//import javax.servlet.ServletOutputStream; -//import javax.servlet.http.HttpServletRequest; -//import javax.servlet.http.HttpServletResponse; -// -// -// -// -// -// -// -// -// -//import net.sf.jasperreports.engine.JRAbstractExporter; -//import net.sf.jasperreports.engine.JRDataSource; -//import net.sf.jasperreports.engine.JRException; -//import net.sf.jasperreports.engine.JRExporter; -//import net.sf.jasperreports.engine.JRExporterParameter; -//import net.sf.jasperreports.engine.JasperExportManager; -//import net.sf.jasperreports.engine.JasperFillManager; -//import net.sf.jasperreports.engine.JasperPrint; -//import net.sf.jasperreports.engine.JasperReport; -//import net.sf.jasperreports.engine.base.JRBaseReport; -//import net.sf.jasperreports.engine.export.JExcelApiExporter; -//import net.sf.jasperreports.engine.export.JRHtmlExporter; -//import net.sf.jasperreports.engine.export.JRHtmlExporterParameter; -//import net.sf.jasperreports.engine.export.JRPdfExporter; -//import net.sf.jasperreports.engine.export.JRRtfExporter; -//import net.sf.jasperreports.engine.export.JRXlsExporter; -//import net.sf.jasperreports.engine.export.JRXlsExporterParameter; -//import net.sf.jasperreports.engine.export.JRXmlExporter; -//import net.sf.jasperreports.engine.util.FileBufferedOutputStream; -//import net.sf.jasperreports.engine.util.JRLoader; -//import net.sf.jasperreports.j2ee.servlets.ImageServlet; -//import net.sf.jasperreports.engine.design.JRJavacCompiler; -// -//import org.apache.commons.collections.map.ReferenceMap; -// -//import net.sf.jasperreports.engine.export.PdfTextRenderer; -//import net.sf.jasperreports.engine.export.JRGraphics2DExporter; -// -//import org.apache.log4j.Logger; -// -// -//public class JasperHelper { -// private static Logger logger = Logger.getLogger(JasperHelper.class); -// public static final String PRINT_TYPE = "print"; -// public static final String PDF_TYPE = "pdf"; -// public static final String EXCEL_TYPE = "excel"; -// public static final String HTML_TYPE = "html"; -// public static final String WORD_TYPE = "word"; -// -// public static void prepareReport(JasperReport jasperReport, String type) { -// logger.debug("The method======= prepareReport() start......................."); -// /* -// * 如果导出的是excel,则需要去掉周围的margin -// */ -// if ("excel".equals(type)) -// try { -// Field margin = JRBaseReport.class -// .getDeclaredField("leftMargin"); -// margin.setAccessible(true); -// margin.setInt(jasperReport, 0); -// margin = JRBaseReport.class.getDeclaredField("topMargin"); -// margin.setAccessible(true); -// margin.setInt(jasperReport, 0); -// margin = JRBaseReport.class.getDeclaredField("bottomMargin"); -// margin.setAccessible(true); -// margin.setInt(jasperReport, 0); -// Field pageHeight = JRBaseReport.class -// .getDeclaredField("pageHeight"); -// pageHeight.setAccessible(true); -// pageHeight.setInt(jasperReport, 2147483647); -// } catch (Exception exception) { -// } -// } -// -// /** -// * 导出excel -// */ -// public static void exportExcel(JasperPrint jasperPrint, -// String defaultFilename, HttpServletRequest request, -// HttpServletResponse response) throws IOException, JRException { -// /* -// * 设置头信息 -// */ -// response.setContentType("application/vnd.ms-excel"); -// String defaultname = null; -// if (defaultFilename.trim() != null && defaultFilename != null) { -// defaultname = defaultFilename + ".xls"; -// } else { -// defaultname = "export.xls"; -// } -// -// response.setHeader("Content-Disposition", "attachment; filename=\"" -// + URLEncoder.encode(defaultname, "UTF-8") + "\""); -// -// -// ServletOutputStream ouputStream = response.getOutputStream(); -// JRXlsExporter exporter = new JRXlsExporter(); -// -// exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// -// exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream); -// -// exporter.setParameter( -// JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, -// Boolean.TRUE); // 删除记录最下面的空行 -// -// exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, -// Boolean.FALSE);// 删除多余的ColumnHeader -// // -// exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, -// Boolean.FALSE);// 显示边框 -// exporter.exportReport(); -// ouputStream.flush(); -// ouputStream.close(); -// } -// -// public static enum DocType { -// PDF, HTML, XLS, XML, RTF -// } -// public static JRAbstractExporter getJRExporter(DocType docType) { -// JRAbstractExporter exporter = null; -// switch (docType) { -// case PDF: -// exporter = new JRPdfExporter(); -// break; -// case HTML: -// exporter = new JRHtmlExporter(); -// break; -// case XLS: -// exporter = new JExcelApiExporter(); -// break; -// case XML: -// exporter = new JRXmlExporter(); -// break; -// case RTF: -// exporter = new JRRtfExporter(); -// break; -// } -// return exporter; -// } -// /** -// * 导出pdf,注意此处中文问题, -// * -// * 这里应该详细说:主要在ireport里变下就行了。看图 -// * -// * 1)在ireport的classpath中加入iTextAsian.jar 2)在ireport画jrxml时,看ireport最左边有个属性栏。 -// * -// * 下边的设置就在点字段的属性后出现。 pdf font name :STSong-Light ,pdf encoding :UniGB-UCS2-H -// */ -// private static void exportPdf(JasperPrint jasperPrint, -// String defaultFilename, HttpServletRequest request, -// HttpServletResponse response) throws IOException, JRException { -// response.setContentType("application/pdf"); -// String defaultname = null; -// if (defaultFilename.trim() != null && defaultFilename != null) { -// defaultname = defaultFilename + ".pdf"; -// } else { -// defaultname = "export.pdf"; -// } -// String fileName = new String(defaultname.getBytes("GBK"), "ISO8859_1"); -// response.setHeader("Content-disposition", "attachment; filename=" -// + fileName); -// ServletOutputStream ouputStream = response.getOutputStream(); -// //File pdf = File.createTempFile("output", ".pdf",new File("D:\\Tomcat 7.0\\webapps\\")); -// //JasperExportManager.exportReportToPdfStream(jasperPrint, new FileOutputStream(pdf));\ -// JasperExportManager.exportReportToPdfStream(jasperPrint, ouputStream); -// ouputStream.flush(); -// ouputStream.close(); -// } -// -// /** -// * 导出html -// */ -// private static void exportHtml(JasperPrint jasperPrint, -// String defaultFilename, HttpServletRequest request, -// HttpServletResponse response) throws IOException, JRException { -// response.setContentType("text/html"); -// ServletOutputStream ouputStream = response.getOutputStream(); -// JRHtmlExporter exporter = new JRHtmlExporter(); -// exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, -// Boolean.FALSE); -// exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8"); -// exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream); -// -// exporter.exportReport(); -// -// ouputStream.flush(); -// ouputStream.close(); -// } -// -// /** -// * 导出word -// */ -// private static void exportWord(JasperPrint jasperPrint, -// String defaultFilename, HttpServletRequest request, -// HttpServletResponse response) throws JRException, IOException { -// response.setContentType("application/msword;charset=utf-8"); -// String defaultname = null; -// if (defaultFilename.trim() != null && defaultFilename != null) { -// defaultname = defaultFilename + ".doc"; -// } else { -// defaultname = "export.doc"; -// } -// String fileName = new String(defaultname.getBytes("GBK"), "utf-8"); -// response.setHeader("Content-disposition", "attachment; filename=" -// + fileName); -// JRExporter exporter = new JRRtfExporter(); -// exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, -// response.getOutputStream()); -// -// exporter.exportReport(); -// } -// -// /** -// * 按照类型导出不同格式文件 -// * -// * @param datas -// * 数据 -// * @param type -// * 文件类型 -// * @param is -// * jasper文件的来源 -// * @param request -// * @param response -// * @param defaultFilename默认的导出文件的名称 -// */ -// public static void export(String type, String defaultFilename, File is, -// HttpServletRequest request, HttpServletResponse response, -// Map parameters, Connection conn) { -// try { -// JasperReport jasperReport = (JasperReport) JRLoader.loadObject(is); -// prepareReport(jasperReport, type); -// -// JasperPrint jasperPrint = JasperFillManager.fillReport( -// jasperReport, parameters, conn); -// -// if (EXCEL_TYPE.equals(type)) { -// exportExcel(jasperPrint, defaultFilename, request, response); -// } else if (PDF_TYPE.equals(type)) { -// exportPdf(jasperPrint, defaultFilename, request, response); -// } else if (HTML_TYPE.equals(type)) { -// exportHtml(jasperPrint, defaultFilename, request, response); -// } else if (WORD_TYPE.equals(type)) { -// exportWord(jasperPrint, defaultFilename, request, response); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// public static void export(String type, String defaultFilename, File is, -// HttpServletRequest request, HttpServletResponse response, -// Map parameters, JRDataSource conn) { -// try { -// JasperReport jasperReport = (JasperReport) JRLoader.loadObject(is); -// prepareReport(jasperReport, type); -// -// JasperPrint jasperPrint = JasperFillManager.fillReport( -// jasperReport, parameters, conn); -// -// if (EXCEL_TYPE.equals(type)) { -// exportExcel(jasperPrint, defaultFilename, request, response); -// } else if (PDF_TYPE.equals(type)) { -// exportPdf(jasperPrint, defaultFilename, request, response); -// } else if (HTML_TYPE.equals(type)) { -// exportHtml(jasperPrint, defaultFilename, request, response); -// } else if (WORD_TYPE.equals(type)) { -// exportWord(jasperPrint, defaultFilename, request, response); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// -// -// /** -// * 输出html静态页面,必须注入request和response -// * -// * @param jasperPath -// * @param params -// * @param sourceList -// * @param imageUrl -// * 报表文件使用的图片路径,比如 ../servlets/image?image= -// * @throws JRException -// * @throws IOException -// * @throws ServletException -// */ -// public static void showHtml(String defaultFilename, String reportfile, -// HttpServletRequest request, HttpServletResponse response, Map parameters, -// JRDataSource conn) throws JRException, IOException { -// -// -// request.setCharacterEncoding("utf-8"); -// response.setCharacterEncoding("utf-8"); -// response.setContentType("text/html"); -// -// JRAbstractExporter exporter = getJRExporter(DocType.HTML); -// -// JasperPrint jasperPrint = JasperFillManager.fillReport(reportfile, -// parameters, conn); -// request.getSession().setAttribute( -// ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, -// jasperPrint); -// -// PrintWriter out = response.getWriter(); -// -// exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); -// exporter.setParameter( -// JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, -// Boolean.FALSE); -// exporter.exportReport(); -// out.flush(); -//// JasperExportManager.exportReportToHtmlFile(jasperPrint, "test.html"); -//// response.sendRedirect("test.html"); -// -// -// } -// public static void showHtml(String defaultFilename, String reportfile, -// HttpServletRequest request, HttpServletResponse response, Map parameters, -// Connection conn) throws JRException, IOException { -// -// -// request.setCharacterEncoding("utf-8"); -// response.setCharacterEncoding("utf-8"); -// response.setContentType("text/html"); -// -// JRAbstractExporter exporter = getJRExporter(DocType.HTML); -// -// JasperPrint jasperPrint = JasperFillManager.fillReport(reportfile, -// parameters, conn); -// request.getSession().setAttribute( -// ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, -// jasperPrint); -// -// PrintWriter out = response.getWriter(); -// -// exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); -// exporter.setParameter( -// JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, -// Boolean.FALSE); -// exporter.exportReport(); -// out.flush(); -// -// } -// public static void showPdf(String defaultFilename, String reportfile, -// HttpServletRequest request, HttpServletResponse response, Map parameters, -// JRDataSource conn) throws JRException, IOException { -// -// -// /* request.setCharacterEncoding("utf-8"); -// response.setCharacterEncoding("utf-8"); -// response.setContentType("text/html"); -// response.setContentType("application/pdf"); -// -// JRAbstractExporter exporter = getJRExporter(DocType.PDF); -// -// JasperPrint jasperPrint = JasperFillManager.fillReport(reportfile, -// parameters, conn); -// request.getSession().setAttribute( -// ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, -// jasperPrint); -// -// PrintWriter out = response.getWriter(); -// -// exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); -// exporter.exportReport(); -// out.flush();*/ -// -// //加载jasper文件 -// JasperPrint jasperPrint = null; -// try { -// //构造jasperPrint对象 -// jasperPrint = JasperFillManager.fillReport(reportfile, -// parameters, conn); -// } catch (JRException e) { -// e.printStackTrace(); -// } -// if (null != jasperPrint) { -// FileBufferedOutputStream fbos = new FileBufferedOutputStream(); -// JRPdfExporter exporter = new JRPdfExporter(); -// exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, fbos);//内部实现应该是用的反射 -// //将内容输出到fbos流中 -// exporter -// .setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); -// -// try { -// //exporter.setParameter(JRExporterParameter.PAGE_INDEX, new Integer(0)); -// exporter.exportReport();//导出对应的文件 -// fbos.close(); -// if (fbos.size() > 0) { -// //设置文件格式 -// response.setContentType("application/pdf"); -// response.setContentLength(fbos.size()); -// ServletOutputStream ouputStream = response -// .getOutputStream(); -// try { -// fbos.writeData(ouputStream);//将数据写入网络流当中 -// fbos.dispose(); -// ouputStream.flush(); -// } finally { -// if (null != ouputStream) { -// ouputStream.close(); -// } -// } -// } -// } catch (JRException e1) { -// e1.printStackTrace(); -// } finally { -// if (null != fbos) { -// fbos.close(); -// fbos.dispose(); -// } -// } -// } -// -// } -// -// -// -//} -// -// -// -// diff --git a/src/com/sipai/tools/JwtUtil.java b/src/com/sipai/tools/JwtUtil.java deleted file mode 100644 index 1501c6b5..00000000 --- a/src/com/sipai/tools/JwtUtil.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.sipai.tools; - -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import com.auth0.jwt.JWT; -import com.auth0.jwt.JWTVerifier; -import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.exceptions.JWTDecodeException; -import com.auth0.jwt.interfaces.DecodedJWT; - -/** - * Java web token 工具类 - * - */ -public class JwtUtil { - /** - * - * TODO token有效时间为30分钟,由于redis缓存刷新机制,实际为60分钟 - */ -// public static final long EXPIRE_TIME = 30 * 60 * 1000; - public static final long EXPIRE_TIME = 30 * 60 * 1000 * 10; -// private static final long FOREVER_TIME_MILLIS = 35659324800000L; -// public static final long EXPIRE_TIME = 60 * 1000; - /** - * token私钥 - */ - private static final String TOKEN_SECRET = "f26e587c28064d0e856e72c0a6a0e628"; - - /** - * 校验token是否正确 - * @param token 密钥 - * @return 是否正确 - */ - public static boolean verify(String token) { - try { - Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); - JWTVerifier verifier = JWT.require(algorithm) - .build(); - DecodedJWT jwt = verifier.verify(token); - return true; - } catch (Exception exception) { - return false; - } - } - - /** - * 获得token中的信息无需secret解密也能获得 - * - * @return token中包含的用户名 - */ - public static String getUsername(String token) { - try { - DecodedJWT jwt = JWT.decode(token); - return jwt.getClaim("loginName").asString(); - } catch (JWTDecodeException e) { - return null; - } - } - - /** - * 获取登陆用户ID - * @param token - * @return - */ - public static String getUserId(String token) { - try { - DecodedJWT jwt = JWT.decode(token); - return jwt.getClaim("userId").asString(); - } catch (JWTDecodeException e) { - return null; - } - } - - /** - * 生成签名,15min后过期 - * - * @param username 用户名 - * @return 加密的token - */ - public static String sign(String username,String userId) { - try { - Date nowTime = new Date(System.currentTimeMillis()); -// SimpleDateFormat sdFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// String retStrFormatNowDate = sdFormatter.format(nowTime); -// 过期时间 - Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME); -// 私钥及加密算法 - Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); -// 设置头部信息 - Map header = new HashMap<>(2); - header.put("typ", "JWT"); - header.put("alg", "HS256"); - // 附带username,userId信息,生成签名 - return JWT.create() - .withHeader(header) - .withClaim("loginName", username) - .withClaim("userId",userId) - .withIssuedAt(nowTime) - .withExpiresAt(date) - .sign(algorithm); - } catch (UnsupportedEncodingException e) { - return null; - } - } - - public static String signForever(String username,String userId) { - try { - Date nowTime = new Date(System.currentTimeMillis()); -// SimpleDateFormat sdFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// String retStrFormatNowDate = sdFormatter.format(nowTime); -// 过期时间 -// Date date = new Date(FOREVER_TIME_MILLIS); -// 私钥及加密算法 - Algorithm algorithm = Algorithm.HMAC256(TOKEN_SECRET); -// 设置头部信息 - Map header = new HashMap<>(2); - header.put("typ", "JWT"); - header.put("alg", "HS256"); - // 附带username,userId信息,生成签名 - return JWT.create() - .withHeader(header) - .withClaim("loginName", username) - .withClaim("userId",userId) - .withIssuedAt(nowTime) - .sign(algorithm); - } catch (UnsupportedEncodingException e) { - return null; - } - } - -} diff --git a/src/com/sipai/tools/KpiUtils.java b/src/com/sipai/tools/KpiUtils.java deleted file mode 100644 index 47bd531a..00000000 --- a/src/com/sipai/tools/KpiUtils.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.sipai.tools; - -import com.sipai.entity.enums.KpiConstant; -import com.sipai.entity.enums.PeriodTypeEnum; -import com.sipai.entity.kpi.KpiResultStatisticsInfo; -import com.sipai.entity.kpi.KpiResultStatisticsListBean; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.List; - -/** - * 绩效考核工具类 - * - * @Author: lichen - * @Date: 2021/10/11 - **/ -public class KpiUtils { - /** - * 考核周期名称拼接 - * - * @return - * @author lichen - * @date 2021/10/11 19:25 - **/ - public static String getPeriodName(String year, int periodType, int periodNo) { - if (PeriodTypeEnum.Quarter.getId() == periodType) { - if (periodNo == 1) { - return year + "年_一季度"; - } else if (periodNo == 2) { - return year + "年_二季度"; - } else if (periodNo == 3) { - return year + "年_三季度"; - } else if (periodNo == 4) { - return year + "年_四季度"; - } - } else if (PeriodTypeEnum.Half.getId() == periodType) { - if (periodNo == 1) { - return year + "年_上半年"; - } else if (periodNo == 2) { - return year + "年_下半年"; - } - } else if (PeriodTypeEnum.Year.getId() == periodType) { - if (periodNo == 1) { - return year + "年_全年"; - } - } - return ""; - - } - - /** - * 分数评级 - * - * @return - * @author lichen - * @date 2021/10/21 15:31 - **/ - public static String getResultLevelString(BigDecimal resultPoint) { - if (resultPoint.compareTo(KpiConstant.LEVEL_BASICALLY_COMPETENT_NOT_COMPETENT) == -1) { - return "不称职"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_C_BASICALLY_COMPETENT) == -1) { - return "基本称职"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_B_C) == -1) { - return "称职C级"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_A_B) == -1) { - return "称职B级"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_EXCELLENT_A) == -1) { - return "称职A级"; - } - return "优秀"; - - } - - /** - * 获取工资系数 - * - * @param resultPoint 分数 - * @return - * @author lichen - * @date 2021/10/26 11:36 - **/ - public static String getResultLevelCoefficient(BigDecimal resultPoint) { - if (resultPoint.compareTo(KpiConstant.LEVEL_BASICALLY_COMPETENT_NOT_COMPETENT) == -1) { - return "0.5"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_C_BASICALLY_COMPETENT) == -1) { - return "0.9"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_B_C) == -1) { - return "0.95"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_A_B) == -1) { - return "1"; - } - if (resultPoint.compareTo(KpiConstant.LEVEL_EXCELLENT_A) == -1) { - return "1"; - } - return "1.1"; - } - - /** - * 统计各个绩效等级人数和占比 - * - * @return - * @author lichen - * @date 2021/10/26 13:50 - **/ - public static KpiResultStatisticsInfo getPointLevelInfo(List list, KpiResultStatisticsInfo bean) { - int pointLevel1Number = 0; - int pointLevel2Number = 0; - int pointLevel3Number = 0; - int pointLevel4Number = 0; - int pointLevel5Number = 0; - int pointLevel6Number = 0; - for (KpiResultStatisticsListBean item : list) { - if (item.getResultPoint().compareTo(KpiConstant.LEVEL_BASICALLY_COMPETENT_NOT_COMPETENT) == -1) { - pointLevel6Number++; - continue; - } - if (item.getResultPoint().compareTo(KpiConstant.LEVEL_C_BASICALLY_COMPETENT) == -1) { - pointLevel5Number++; - continue; - } - if (item.getResultPoint().compareTo(KpiConstant.LEVEL_B_C) == -1) { - pointLevel4Number++; - continue; - } - if (item.getResultPoint().compareTo(KpiConstant.LEVEL_A_B) == -1) { - pointLevel3Number++; - continue; - } - if (item.getResultPoint().compareTo(KpiConstant.LEVEL_EXCELLENT_A) == -1) { - pointLevel2Number++; - continue; - } - pointLevel1Number++; - continue; - } - bean.setPointLevel1Number(pointLevel1Number); - bean.setPointLevel2Number(pointLevel2Number); - bean.setPointLevel3Number(pointLevel3Number); - bean.setPointLevel4Number(pointLevel4Number); - bean.setPointLevel5Number(pointLevel5Number); - bean.setPointLevel6Number(pointLevel6Number); - bean.setPointLevel1Percent(rate(pointLevel1Number, list.size())); - bean.setPointLevel2Percent(rate(pointLevel2Number, list.size())); - bean.setPointLevel3Percent(rate(pointLevel3Number, list.size())); - bean.setPointLevel4Percent(rate(pointLevel4Number, list.size())); - bean.setPointLevel5Percent(rate(pointLevel5Number, list.size())); - bean.setPointLevel6Percent(rate(pointLevel6Number, list.size())); - return bean; - } - - private static String rate(int number, int totalNumber) { - BigDecimal numberBd = new BigDecimal(number); - if (totalNumber == 0) { - return "0"; - } - return numberBd.multiply(new BigDecimal("100").divide(BigDecimal.valueOf(totalNumber), 2, RoundingMode.HALF_UP)) + "%"; - } - - /** - * 把List 转换成 sql与的in条件 - * - * @Author: lichen - * @Date: 2022/7/7 - **/ - public static String convertToSqlInCondition(List list){ - String resutl=""; - for(String str :list){ - resutl+="'"+str+"',"; - } - if(list.size()>0){ - resutl = resutl.substring(0,resutl.length()-1); - } - return resutl; - - } -} diff --git a/src/com/sipai/tools/LibraryTool.java b/src/com/sipai/tools/LibraryTool.java deleted file mode 100644 index bb42be1b..00000000 --- a/src/com/sipai/tools/LibraryTool.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.sipai.tools; - -/** - * 工单类 开关配置 - */ -public class LibraryTool { - /* - n:禁用部位 y:启用部位 - */ - //维修 - private String repairPart; - //保养 - private String mainPart; - //大修 - private String overhaulPart; - - public String getRepairPart() { - return repairPart; - } - - public void setRepairPart(String repairPart) { - this.repairPart = repairPart; - } - - public String getMainPart() { - return mainPart; - } - - public void setMainPart(String mainPart) { - this.mainPart = mainPart; - } - - public String getOverhaulPart() { - return overhaulPart; - } - - public void setOverhaulPart(String overhaulPart) { - this.overhaulPart = overhaulPart; - } -} diff --git a/src/com/sipai/tools/Listener.java b/src/com/sipai/tools/Listener.java deleted file mode 100644 index ecad0112..00000000 --- a/src/com/sipai/tools/Listener.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.sipai.tools; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionBindingEvent; - -import com.sipai.entity.base.ServerObject; -import com.sipai.entity.user.User; -import com.sipai.service.user.UserService; - - - -/** - * @author IBM 在线用户监听器 - */ -public class Listener implements HttpSessionAttributeListener { - - public static HashMap sessionlist = new HashMap();//sessionid和用户id - - public void attributeAdded(HttpSessionBindingEvent se) { - User cu; - if (se.getName().equals("cu")) { - cu = (User) se.getValue(); - //读取配置文件,判断是否运行web和app同时登录,true运行,false不允许 - Properties properties = new Properties(); - InputStreamReader inputStreamReader; - String value = ""; - try { - inputStreamReader = new InputStreamReader - (this.getClass().getClassLoader().getResourceAsStream("sessionFilter.properties"),"UTF-8"); - properties.load(inputStreamReader); - value = properties.getProperty("allowSimultaneous"); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if(value!=null && value.equals("false")){ - //s - Iterator is = Listener.sessionlist.keySet().iterator(); - while (is.hasNext()) { - HttpSession key = is.next(); - if (Listener.sessionlist.get(key).getId().equalsIgnoreCase(cu.getId())&&!Listener.sessionlist.get(key).getId().equalsIgnoreCase("emp01")) { - if(multilogin(Listener.sessionlist.get(key).getName())){ - //设置登录时间 - UserService userService = (UserService)SpringContextUtil.getBean("userService"); - int res = userService.updateUserTime(cu.getId()); - if(res>0){ - userService.updateTotaltimeByUserId(cu.getId()); - } - System.out.println(key.getId()+":remove"); - key.removeAttribute("cu"); - break; - } - } - } - } - System.out.println(se.getSession().getId()+":add"); - sessionlist.put(se.getSession(),cu); - se.getSession().setAttribute("userlist", Listener.sessionlist); - - } - } - - public void attributeRemoved(HttpSessionBindingEvent se) { - User cu = null; - if (se.getName().equals("cu")) { - cu = (User) se.getValue(); - //设置登录时间 - UserService userService = (UserService)SpringContextUtil.getBean("userService"); - int res = userService.updateUserTime(cu.getId()); - if(res>0){ - userService.updateTotaltimeByUserId(cu.getId()); - } - System.out.println(se.getSession().getId()+":remove"); - sessionlist.remove(se.getSession()); - } - } - - public void attributeReplaced(HttpSessionBindingEvent se) { - } - - public boolean multilogin(String se) { - boolean brtn=true; - if(ServerObject.atttable.get("MULTILOGIN")!=null){ - String[] str=ServerObject.atttable.get("MULTILOGIN").split(","); - for(int i=0;i mtDetails = xserverService.selectListByWhere("where status='启用' or status is null order by name "); - if (mtDetails!=null && mtDetails.size()>0) { - LOGGER.info("【无中间表配置数据,终止中间表数据源初始化任务】"); - return; - } - - for (XServer dataSource : mtDetails) { - // 判断数据源是否已经被初始化 - if (dynamicDataSource.getTargetDataSources().containsKey( - dataSource.getName())) { - // 已经初始化 - continue; - } - // 创建数据源 - DruidDataSource druidDataSource = dynamicDataSource.createDataSource( - "net.sourceforge.jtds.jdbc.Driver", "jdbc:jtds:sqlserver://"+dataSource.getIpaddress()+":"+dataSource.getPort()+"/"+dataSource.getDbname(), - dataSource.getLoginname(), dataSource.getPassword()); - // 添加到targetDataSource中,缓存起来 - dynamicDataSource.addTargetDataSource( - dataSource.getName(), druidDataSource); - //更新连接状态 - //dataSource.setStatus("连接成功"); - xserverService.update(dataSource); - } - } - - *//** - * 数据源控制开关,用于指定数据源DynamicDataSource - * @param dataSourceId 接口的唯一吗 - * @Author : ll. create at 2017年3月28日 下午1:56:28 - *//* - public void dataSourceSwitch(String dataSourceId) { - List dataSource = xserverService.selectListByWhere("where bizid='"+dataSourceId+"' and (status='启用' or status is null) order by name"); - if (dataSource != null && dataSource.size()>0) { - if (dataSource.get(0).getIpaddress()!=null && dataSource.get(0).getPort()!=null - && dataSource.get(0).getLoginname()!=null && dataSource.get(0).getDbname()!=null) { - // 判断数据源是否已经被初始化 - if (dynamicDataSource.getTargetDataSources().containsKey( - dataSource.get(0).getName())) { - // 已经初始化 - }else{ - // 创建数据源 - DruidDataSource druidDataSource = dynamicDataSource.createDataSource( - "net.sourceforge.jtds.jdbc.Driver", "jdbc:jtds:sqlserver://"+dataSource.get(0).getIpaddress()+":"+dataSource.get(0).getPort()+"/"+dataSource.get(0).getDbname(), - dataSource.get(0).getLoginname(), dataSource.get(0).getPassword()); - // 添加到targetDataSource中,缓存起来 - dynamicDataSource.addTargetDataSource( - dataSource.get(0).getName(), druidDataSource); - } - //更新连接状态 - //dataSource.get(0).setStatus("连接成功"); - xserverService.update(dataSource.get(0)); - - Map dataSourceConfigMap = new HashMap(); - dataSourceConfigMap.put(DataSourceHolder.DATASOURCE_KEY, dataSource.get(0).getName()); - dataSourceConfigMap.put(DataSourceHolder.DATASOURCE_DRIVER, "net.sourceforge.jtds.jdbc.Driver"); - dataSourceConfigMap.put(DataSourceHolder.DATASOURCE_URL, "jdbc:jtds:sqlserver://"+dataSource.get(0).getIpaddress()+":"+dataSource.get(0).getPort()+"/"+dataSource.get(0).getDbname()); - dataSourceConfigMap.put(DataSourceHolder.DATASOURCE_USERNAME, dataSource.get(0).getLoginname()); - dataSourceConfigMap.put(DataSourceHolder.DATASOURCE_PASSWORD, dataSource.get(0).getPassword()); - LOGGER.info("【指定数据源】dataSourceConfigMap = {}", dataSourceConfigMap); - DataSourceHolder.setDBType(dataSourceConfigMap); - - }else{ - throw new IllegalArgumentException(String.format("接口【%s】未配置中间表信息,无法切换数据源", - dataSourceId)); - } - }else{ - throw new IllegalArgumentException("根据接口唯一码未获取到中间表配置信息"); - }*/ - - - } -} diff --git a/src/com/sipai/tools/MinioProp.java b/src/com/sipai/tools/MinioProp.java deleted file mode 100644 index 2b215d65..00000000 --- a/src/com/sipai/tools/MinioProp.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.sipai.tools; - - - -public class MinioProp { - - public String getEndPoint() { - return endPoint; - } - - public void setEndPoint(String endPoint) { - this.endPoint = endPoint; - } - - public String getAccessKey() { - return accessKey; - } - - public void setAccessKey(String accessKey) { - this.accessKey = accessKey; - } - - public String getSecretKey() { - return secretKey; - } - - public void setSecretKey(String secretKey) { - this.secretKey = secretKey; - } - - private String endPoint;//连接url - - private String accessKey;//用户名 - - private String secretKey;//密码 - - - - - -} diff --git a/src/com/sipai/tools/MinioUtils.java b/src/com/sipai/tools/MinioUtils.java deleted file mode 100644 index 559d684c..00000000 --- a/src/com/sipai/tools/MinioUtils.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.sipai.tools; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.service.base.CommonFileService; -import io.minio.MinioClient; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; - -@Slf4j -@Component -public class MinioUtils { - - @Autowired - private MinioClient client; - @Autowired - private MinioProp minioProp; - @Autowired - private CommonFileService commonFileService; - - /** - * 创建bucket * * @param bucketName bucket名称 - */ - @SneakyThrows - public void createBucket(String bucketName) { - if (!client.bucketExists(bucketName)) { - client.makeBucket(bucketName); - } - } - - /** - * 上传文件 * * @param file 文件 * @param bucketName 存储桶 * @return - */ - public JSONObject uploadFile(MultipartFile file, String masterId, String bucketName, String tbName) throws Exception { - JSONObject res = new JSONObject(); - res.put("code", 0); - // 判断上传文件是否为空 - if (null == file || 0 == file.getSize()) { - res.put("msg", "上传文件不能为空"); - return res; - } - try { - // 判断存储桶是否存在 - createBucket(bucketName); - // 文件名 - String originalFilename = file.getOriginalFilename(); - // 新的文件名 = 存储桶名称_时间戳.后缀名 - String fileName = bucketName + "_" + System.currentTimeMillis() + originalFilename.substring(originalFilename.lastIndexOf(".")); - // 开始上传 -// client.putObject(bucketName, fileName, file.getInputStream(), file.getContentType()); - - //存表 - int res2 = commonFileService.updateFile(masterId, bucketName, tbName, file); - if (res2 == 1) { - res.put("code", 1); - } else { - res.put("code", 0); - } - - res.put("code", 1); - res.put("msg", minioProp.getEndPoint() + "/" + bucketName + "/" + fileName); - return res; - } catch (Exception e) { - log.error("上传文件失败:{}", e.getMessage()); - } - res.put("msg", "上传失败"); - return res; - } -} diff --git a/src/com/sipai/tools/ModbusProp.java b/src/com/sipai/tools/ModbusProp.java deleted file mode 100644 index f7b2ed21..00000000 --- a/src/com/sipai/tools/ModbusProp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sipai.tools; - -public class ModbusProp { - - private String url; // 链接url - private String port; //端口 - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } -} diff --git a/src/com/sipai/tools/ModbusRAndW.java b/src/com/sipai/tools/ModbusRAndW.java deleted file mode 100644 index f9385f05..00000000 --- a/src/com/sipai/tools/ModbusRAndW.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.sipai.tools; - -import com.serotonin.modbus4j.ModbusFactory; -import com.serotonin.modbus4j.ModbusMaster; -import com.serotonin.modbus4j.exception.ErrorResponseException; -import com.serotonin.modbus4j.exception.ModbusInitException; -import com.serotonin.modbus4j.exception.ModbusTransportException; -import com.serotonin.modbus4j.ip.IpParameters; -import com.serotonin.modbus4j.locator.BaseLocator; -import com.serotonin.modbus4j.msg.ReadHoldingRegistersRequest; -import com.serotonin.modbus4j.msg.ReadHoldingRegistersResponse; -import com.serotonin.modbus4j.msg.WriteRegistersRequest; -import com.serotonin.modbus4j.msg.WriteRegistersResponse; -import com.sipai.emsg.Mo; -import com.sipai.entity.Listener.ListenerInterface; -import com.sipai.service.Listener.ListenerInterfaceService; -import com.sipai.service.work.CameraService; -import org.checkerframework.checker.units.qual.A; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -public class ModbusRAndW { - /** - * 工厂。 - */ - static ModbusFactory modbusFactory; - static { - if (modbusFactory == null) { - modbusFactory = new ModbusFactory(); - } - } - - private static ModbusMaster master; - static ModbusProp modbusProp = (ModbusProp) SpringContextUtil.getBean("modbusProp"); - static{ - try { - // 这里是初始化的方法 - IpParameters params = new IpParameters(); - params.setHost(modbusProp.getUrl()); - params.setPort(Integer.parseInt(modbusProp.getPort())); - master = modbusFactory.createTcpMaster(params, true); - master.setTimeout(10000); - master.init(); - } catch(Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - /** - * holding方式写值 会根据register地址也就是offset去相应的modbus地址读值 如果0ffset为00开头也就是二进制可能会有偏移量 - * @param ip - * @param slaveId - * @param offset - * @param value - * @param dataType - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static void writeHoldingRegister(int slaveId, int offset, Number value, int dataType) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - // 获取master - if(master != null) { - // 类型 - BaseLocator locator = BaseLocator.holdingRegister(slaveId, offset, dataType); - master.setValue(locator, value); - } - } - - /** - * holding方式读值 会根据register地址也就是offset去相应的modbus地址读值 如果0ffset为00开头也就是二进制可能会有偏移量 - * @param ip - * @param slaveId - * @param offset - * @param dataType - * @return - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static Number readHoldingRegister(int slaveId, int offset, int dataType) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - // 03 Holding Register类型数据读取 - if(master != null) { - // 类型 - BaseLocator loc = BaseLocator.holdingRegister(slaveId, offset, dataType); - Number value = master.getValue(loc); - return value; - } - return null; - } - - public static Boolean readCoilStatus(int slaveId, int offset) - throws ModbusTransportException, ErrorResponseException { - if (master != null) { - BaseLocator loc = BaseLocator.coilStatus(slaveId, offset); - Boolean value = master.getValue(loc); - return value; - } - return null; - } - - public static Boolean readInputStatus(int slaveId, int offset) - throws ModbusTransportException, ErrorResponseException { - if (master != null) { - BaseLocator loc = BaseLocator.inputStatus(slaveId, offset); - Boolean value = master.getValue(loc); - return value; - } - return null; - } - -} diff --git a/src/com/sipai/tools/ModbusUtils.java b/src/com/sipai/tools/ModbusUtils.java deleted file mode 100644 index c55d0ec2..00000000 --- a/src/com/sipai/tools/ModbusUtils.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.sipai.tools; - -import com.serotonin.modbus4j.ModbusFactory; -import com.serotonin.modbus4j.ModbusMaster; -import com.serotonin.modbus4j.exception.ErrorResponseException; -import com.serotonin.modbus4j.exception.ModbusInitException; -import com.serotonin.modbus4j.exception.ModbusTransportException; -import com.serotonin.modbus4j.ip.IpParameters; -import com.serotonin.modbus4j.locator.BaseLocator; -import com.sipai.entity.work.ModbusConfig; -import com.sipai.entity.work.ModbusInterface; -import com.sipai.service.work.ModbusConfigService; -import com.sipai.service.work.ModbusInterfaceService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.util.HashMap; -import java.util.List; - -/** - * modbus4j写入数据 - * - * @author lyk - */ -public class ModbusUtils { - - static Log log = LogFactory.getLog(ModbusUtils.class); - /** - * 工厂。 - */ - static ModbusFactory modbusFactory; - - static { - if (modbusFactory == null) { - modbusFactory = new ModbusFactory(); - } - } - - private static HashMap masterMap; - private static List modbusInterfaces; - static ModbusInterfaceService modbusInterfaceService = (ModbusInterfaceService) SpringContextUtil.getBean("modbusInterfaceService"); - static ModbusConfigService modbusConfigService = (ModbusConfigService) SpringContextUtil.getBean("modbusConfigService"); - - static { - try { - masterMap = new HashMap<>(); - // 获取所有链接 - modbusInterfaces = modbusInterfaceService.selectListByWhere("where 1 = 1 and status = 1"); - for (int x = 0; x < modbusInterfaces.size(); x++) { - // 得到链接对象 初始化 - init(modbusInterfaces.get(x)); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static int init(ModbusInterface modbusInterface) { - // 已存在的链接 需要 摧毁 重新初始化 - if (masterMap.get(modbusInterface.getId()) != null) { - masterMap.get(modbusInterface.getId()).getTcpMaster().destroy(); - } - // 新建连接对象 - IpParameters params = new IpParameters(); - params.setHost(modbusInterface.getIp()); - params.setPort(modbusInterface.getPort()); - // 放入连接池 - ModbusMaster tcpMaster = modbusFactory.createTcpMaster(params, true); - int result = 0; - try { - tcpMaster.init(); - modbusInterface.setTcpMaster(tcpMaster); - // 初始化配置 - List modbusConfigs = modbusConfigService.selectListByWhere("where p_id = '" + modbusInterface.getId() + "'"); - HashMap map = new HashMap<>(); - for (ModbusConfig modbusConfig : modbusConfigs) { - map.put(modbusConfig.getType(), modbusConfig.getDataType()); - } - modbusInterface.setModbusConfigMap(map); - // 将链接对象放入map中以便后期调用 - masterMap.put(modbusInterface.getId(), modbusInterface); - result = 1; - } catch (Exception e) { - // 禁用 - modbusInterface.setStatus(0); - modbusInterfaceService.update(modbusInterface); - } - return result; - } - - /** - * - * @param id 链接表id - * @param slaveId 从站id - * @param offset 寄存器地址 - * @param value 值 - * @param dataType 数据类型 - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static void writeHoldingRegister(String id, int slaveId, int offset, Number value, int dataType) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - // 获取master - ModbusMaster tcpMaster = masterMap.get(id).getTcpMaster(); - if (!tcpMaster.isConnected()) { - // 类型 - BaseLocator locator = BaseLocator.holdingRegister(slaveId, offset, dataType); - tcpMaster.setValue(locator, value); - } - } - - /** - * - * @param id 链接表id - * @param slaveId 从站id - * @param offset 寄存器地址 - * @param value 值 - * @param type 数据类型 - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static void writeHoldingRegister(String id, int slaveId, int offset, Number value, Integer type) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - // offset 加等于 配置好的偏移量 得出最终地址 - offset += masterMap.get(id).getOffset(); - // 获取master - ModbusMaster tcpMaster = masterMap.get(id).getTcpMaster(); - - if (!tcpMaster.isConnected()) { - // 类型 - BaseLocator locator = BaseLocator.holdingRegister(slaveId, offset, masterMap.get(id).getModbusConfigMap().get(type)); - tcpMaster.setValue(locator, value); - } - } - - /** - * - * @param id 链接表id - * @param slaveId 从站id - * @param offset 寄存器地址 - * @param dataType 数据类型 - * @return - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static Number readHoldingRegister(String id, int slaveId, int offset, int dataType) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - ModbusMaster tcpMaster = masterMap.get(id).getTcpMaster(); - if (tcpMaster != null) { - BaseLocator loc = BaseLocator.holdingRegister(slaveId, offset, dataType); - Number value = tcpMaster.getValue(loc); - return value; - } - return null; - } - - /** - * - * @param id 链接表id - * @param slaveId 从站id - * @param offset 寄存器地址 - * @param type 数据类型 - * @return - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static Number readHoldingRegister(String id, int slaveId, int offset, Integer type) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - // offset 加等于 配置好的偏移量 得出最终地址 - offset += masterMap.get(id).getOffset(); - ModbusMaster tcpMaster = masterMap.get(id).getTcpMaster(); - if (tcpMaster != null) { - BaseLocator loc = BaseLocator.holdingRegister(slaveId, offset, masterMap.get(id).getModbusConfigMap().get(type)); - Number value = tcpMaster.getValue(loc); - return value; - } - return null; - } - - /** - * - * @param id 链接表id - * @param slaveId 从站id - * @param offset 寄存器地址 - * @param value 值 - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static void writeCoilStatus(String id, int slaveId, int offset, boolean value) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - ModbusMaster tcpMaster = masterMap.get(id).getTcpMaster(); - if (tcpMaster != null) { - BaseLocator locator = BaseLocator.coilStatus(slaveId, offset); - tcpMaster.setValue(locator, value); - } - } - - /** - * - * @param id 链接表id - * @param slaveId 从站id - * @param offset 寄存器地址 - * @return - * @throws ModbusTransportException - * @throws ErrorResponseException - * @throws ModbusInitException - */ - public static Boolean readCoilStatus(String id, int slaveId, int offset) - throws ModbusTransportException, ErrorResponseException, ModbusInitException { - ModbusMaster tcpMaster = masterMap.get(id).getTcpMaster(); - if (tcpMaster != null) { - BaseLocator loc = BaseLocator.coilStatus(slaveId, offset); - Boolean value = tcpMaster.getValue(loc); - return value; - } - return null; - } - - -} diff --git a/src/com/sipai/tools/Mqtt.java b/src/com/sipai/tools/Mqtt.java deleted file mode 100644 index d5e681b4..00000000 --- a/src/com/sipai/tools/Mqtt.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.sipai.tools; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2021/11/03/15:24 - * @Description: - */ -public class Mqtt { - //主题类型 - public final static String Type_Alarm_Popup_Topic = "alarm_popup_topic";//报警弹窗 - public final static String Type_Alarm_Num_Topic = "alarm_num_topic";//报警数量 - private String status;//启动状态 0:启用 1:禁用 - - private String username;//用户名 - - private String password;//密码 - - private String hostTcp; // websocketurl - - private String hostWeb; // mqtturl - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getHostTcp() { - return hostTcp; - } - - public void setHostTcp(String hostTcp) { - this.hostTcp = hostTcp; - } - - public String getHostWeb() { - return hostWeb; - } - - public void setHostWeb(String hostWeb) { - this.hostWeb = hostWeb; - } -} diff --git a/src/com/sipai/tools/MqttUtil.java b/src/com/sipai/tools/MqttUtil.java deleted file mode 100644 index dece773f..00000000 --- a/src/com/sipai/tools/MqttUtil.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.tools; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.service.Listener.ListenerPointService; -import org.eclipse.paho.client.mqttv3.MqttClient; -import org.eclipse.paho.client.mqttv3.MqttConnectOptions; -import org.eclipse.paho.client.mqttv3.MqttException; -import org.eclipse.paho.client.mqttv3.MqttMessage; -import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; -import org.springframework.beans.factory.annotation.Autowired; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - -/** - * Created with IntelliJ IDEA. - * - * @Auther: 你的名字 - * @Date: 2021/11/01/19:49 - * @Description: - */ -public class MqttUtil { - private static MqttClient mqttClient; - static Mqtt mqtt = (Mqtt) SpringContextUtil.getBean("mqtt"); - - public static MqttClient connect(String brokeraddress, String clientId, String userName, String password) throws MqttException { - MemoryPersistence persistence = new MemoryPersistence(); - MqttConnectOptions connOpts = new MqttConnectOptions(); - connOpts.setCleanSession(true); - connOpts.setUserName(userName); - connOpts.setPassword(password.toCharArray()); - connOpts.setConnectionTimeout(10); - connOpts.setKeepAliveInterval(20); - mqttClient = new MqttClient(brokeraddress, clientId, persistence); - mqttClient.connect(connOpts); - return mqttClient; - } - - public static void publish(JSONObject jsonObject, String topic) { - //连接 - try { - MqttMessage message; - message = new MqttMessage(jsonObject.toString().getBytes("UTF-8")); - message.setQos(2); - message.setRetained(false); - - if (mqttClient != null && mqttClient.isConnected()) { -// System.out.println("直接发送======" + CommUtil.nowDate() + "======主题:" + topic); - //发布主题 - mqttClient.publish(topic, message); - } else { -// System.out.println("重新连接======" + CommUtil.nowDate() + "======主题:" + topic); - mqttClient = connect(mqtt.getHostTcp(), "pingtai_zhiling" + CommUtil.getUUID(), mqtt.getUsername(), mqtt.getPassword()); - //发布主题 - mqttClient.publish(topic, message); - } -// mqttClient.disconnect(); - } catch (MqttException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } - - public static void publish(JSONArray jSONArray, String topic) { - //连接 - try { - MqttMessage message = new MqttMessage(jSONArray.toString().getBytes("UTF-8")); - message.setQos(2); - message.setRetained(false); - - if (mqttClient != null && mqttClient.isConnected()) { -// System.out.println("直接发送======" + CommUtil.nowDate() + "======主题:" + topic); - //发布主题 - mqttClient.publish(topic, message); - } else { - System.out.println("重新连接======" + CommUtil.nowDate() + "======主题:" + topic); - mqttClient = connect(mqtt.getHostTcp(), "pingtai_zhiling"+CommUtil.getUUID(), mqtt.getUsername(), mqtt.getPassword()); - //发布主题 - mqttClient.publish(topic, message); - } -// mqttClient.disconnect(); - } catch (MqttException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } - -} diff --git a/src/com/sipai/tools/PythonModelProp.java b/src/com/sipai/tools/PythonModelProp.java deleted file mode 100644 index 0437dd9a..00000000 --- a/src/com/sipai/tools/PythonModelProp.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.sipai.tools; - -public class PythonModelProp { - - private String restart; // 链接url - private String person; //端口 - private String receiveData; //端口 - - - public String getRestart() { - return restart; - } - - public void setRestart(String restart) { - this.restart = restart; - } - - public String getPerson() { - return person; - } - - public void setPerson(String person) { - this.person = person; - } - - public String getReceiveData() { - return receiveData; - } - - public void setReceiveData(String receiveData) { - this.receiveData = receiveData; - } - -} diff --git a/src/com/sipai/tools/PythonModelUtil.java b/src/com/sipai/tools/PythonModelUtil.java deleted file mode 100644 index 558b92f8..00000000 --- a/src/com/sipai/tools/PythonModelUtil.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.sipai.tools; - -import com.alibaba.fastjson.JSONObject; - -import java.io.BufferedReader; -import java.io.InputStreamReader; - -public class PythonModelUtil { - - static PythonModelProp pythonModelProp = (PythonModelProp) SpringContextUtil.getBean("pythonModelProp"); - - public static JSONObject restart() { - String data = HttpUtil.sendGet(pythonModelProp.getRestart()); - JSONObject res = JSONObject.parseObject(data); - return res; - } - - // 模型报警 - public static JSONObject receiveDataFromPython() { - - // todo ycy 增加逻辑 - JSONObject res = new JSONObject(); - return res; - } - -} diff --git a/src/com/sipai/tools/PythonReceiveData.java b/src/com/sipai/tools/PythonReceiveData.java deleted file mode 100644 index ebf2176f..00000000 --- a/src/com/sipai/tools/PythonReceiveData.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.tools; - -public class PythonReceiveData { - - /** - * id - */ - private String id; - - /** - * 摄像头名称 - */ - private String name; - - /** - * 识别时间 - */ - private String curTime; - - /** - * 模型类型 - */ - private String model; - - /** - * 返回结果 - */ - private Object result; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCurTime() { - return curTime; - } - - public void setCurTime(String curTime) { - this.curTime = curTime; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public Object getResult() { - return result; - } - - public void setResult(Object result) { - this.result = result; - } -} diff --git a/src/com/sipai/tools/RemindUtil.java b/src/com/sipai/tools/RemindUtil.java deleted file mode 100644 index 3029bff1..00000000 --- a/src/com/sipai/tools/RemindUtil.java +++ /dev/null @@ -1,271 +0,0 @@ -package com.sipai.tools; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.Point; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionAdapter; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.SwingConstants; - -import java.awt.Insets; -import java.awt.Toolkit; - -import javax.swing.JDialog; - -public class RemindUtil { - // private Map feaMap = null; - private Point oldP;// 上一次坐标,拖动窗口时用 - private TipWindow tw = null;// 提示框 - private ImageIcon img = null;// 图像组件 - private JLabel imgLabel = null; // 背景图片标签 - private JPanel headPan = null; - private JPanel feaPan = null; - private JPanel btnPan = null; - private JLabel title = null; - private JLabel head = null; - private JLabel close = null;// 关闭按钮 - private JTextArea feature = null; - private JScrollPane jfeaPan = null; - private JLabel releaseLabel = null; - private JLabel sure = null; - private SimpleDateFormat sdf = null; - - { - sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// feaMap = new HashMap(); -// feaMap.put("name", "企业注册四证联办监管系统"); -// feaMap.put("release", sdf.format(new Date())); -// feaMap.put( -// "feature", -// "1.开发环境:windows\n2.开发语言:java\n3.开发工具:Eclipse4.3\n4.数据库类型:MySql"); - } - - public void VersionUtil(String titlestr,String headstr,String contentstr) { - init(titlestr,headstr,contentstr); - handle(); - tw.setAlwaysOnTop(true); - tw.setUndecorated(true); - tw.setResizable(false); - tw.setVisible(true); - tw.run(); - } - - public void init(String titlestr,String headstr,String contentstr ) { - // 新建300x240的消息提示框 - tw = new TipWindow(300, 240); - // System.out.println(System.getProperty("user.dir")); - img = new ImageIcon(getClass().getResource("msg_bg.jpg"));//msg_bg.gif - //img = new ImageIcon("D:\\Tomcat 7.0\\webapps\\PlantEngine_RLD\\IMG\\msg_bg.jpg");//msg_bg.gif - imgLabel = new JLabel(img); - // 设置各个面板的布局以及面板中控件的边界 - headPan = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); - feaPan = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); - btnPan = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); - title = new JLabel(titlestr); - head = new JLabel(headstr); - close = new JLabel(" x");// 关闭按钮 - feature = new JTextArea(contentstr); - jfeaPan = new JScrollPane(feature); - releaseLabel = new JLabel("时间 " + sdf.format(new Date())); - sure = new JLabel("确定"); - sure.setHorizontalAlignment(SwingConstants.CENTER); - - // 将各个面板设置为透明,否则看不到背景图片 - ((JPanel) tw.getContentPane()).setOpaque(false); - headPan.setOpaque(false); - feaPan.setOpaque(false); - btnPan.setOpaque(false); - - // 设置JDialog的整个背景图片 - tw.getLayeredPane().add(imgLabel, new Integer(Integer.MIN_VALUE)); - imgLabel.setBounds(0, 0, img.getIconWidth(), img.getIconHeight()); - headPan.setPreferredSize(new Dimension(300, 60)); - - // 设置提示框的边框,宽度和颜色 - tw.getRootPane().setBorder( - BorderFactory.createMatteBorder(1, 1, 1, 1, Color.gray)); - - title.setPreferredSize(new Dimension(260, 26)); - title.setVerticalTextPosition(JLabel.CENTER); - title.setHorizontalTextPosition(JLabel.CENTER); - title.setFont(new Font("宋体", Font.PLAIN, 12)); - title.setForeground(Color.black); - - close.setFont(new Font("Arial", Font.BOLD, 15)); - close.setPreferredSize(new Dimension(20, 20)); - close.setVerticalTextPosition(JLabel.CENTER); - close.setHorizontalTextPosition(JLabel.CENTER); - close.setCursor(new Cursor(12)); - close.setToolTipText("关闭"); - - head.setPreferredSize(new Dimension(250, 35)); - head.setVerticalTextPosition(JLabel.CENTER); - head.setHorizontalTextPosition(JLabel.CENTER); - head.setFont(new Font("宋体", Font.PLAIN, 12)); - head.setForeground(Color.blue); - - feature.setEditable(false); - feature.setForeground(Color.red); - feature.setFont(new Font("宋体", Font.PLAIN, 13)); - feature.setBackground(new Color(184, 230, 172)); - // 设置文本域自动换行 - feature.setLineWrap(true); - - jfeaPan.setPreferredSize(new Dimension(250, 80)); - jfeaPan.setBorder(null); - jfeaPan.setBackground(Color.black); - - releaseLabel.setForeground(Color.DARK_GRAY); - releaseLabel.setFont(new Font("宋体", Font.PLAIN, 12)); - - // 为了隐藏文本域,加个空的JLabel将他挤到下面去 - JLabel jsp = new JLabel(); - jsp.setPreferredSize(new Dimension(300, 25)); - - sure.setPreferredSize(new Dimension(110, 30)); - // 设置标签鼠标手形 - sure.setCursor(new Cursor(12)); - - headPan.add(title); - headPan.add(close); - headPan.add(head); - - feaPan.add(jsp); - feaPan.add(jfeaPan); - feaPan.add(releaseLabel); - - btnPan.add(sure); - - tw.add(headPan, BorderLayout.NORTH); - tw.add(feaPan, BorderLayout.CENTER); - tw.add(btnPan, BorderLayout.SOUTH); - } - - public void handle() { - // 为更新按钮增加相应的事件 - sure.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent e) { - //JOptionPane.showMessageDialog(tw, "谢谢,再见"); - tw.close(); - } - - public void mouseEntered(MouseEvent e) { - sure.setBorder(BorderFactory.createLineBorder(Color.gray)); - } - - public void mouseExited(MouseEvent e) { - sure.setBorder(null); - } - }); - // 增加鼠标拖动事件 - title.addMouseMotionListener(new MouseMotionAdapter() { - public void mouseDragged(MouseEvent e) { - // TODO Auto-generated method stub - Point newP = new Point(e.getXOnScreen(), e.getYOnScreen()); - int x = tw.getX() + (newP.x - oldP.x); - int y = tw.getY() + (newP.y - oldP.y); - tw.setLocation(x, y); - oldP = newP; - - } - }); - // 鼠标按下时初始坐标,供拖动时计算用 - title.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - oldP = new Point(e.getXOnScreen(), e.getYOnScreen()); - } - }); - - // 右上角关闭按钮事件 - close.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent e) { - tw.close(); - } - - public void mouseEntered(MouseEvent e) { - close.setBorder(BorderFactory.createLineBorder(Color.gray)); - } - - public void mouseExited(MouseEvent e) { - close.setBorder(null); - } - }); - - } - -} -class TipWindow extends JDialog { - private static final long serialVersionUID = 8541659783234673950L; - private static Dimension dim; - private int x, y; - private int width, height; - private static Insets screenInsets; - - public TipWindow(int width, int height) { - this.width = width; - this.height = height; - dim = Toolkit.getDefaultToolkit().getScreenSize(); - screenInsets = Toolkit.getDefaultToolkit().getScreenInsets( - this.getGraphicsConfiguration()); - x = (int) (dim.getWidth() - width - 3); - y = (int) (dim.getHeight() - screenInsets.bottom - 3); - initComponents(); - } - - public void run() { - for (int i = 0; i <= height; i += 10) { - try { - this.setLocation(x, y - i); - Thread.sleep(25); - } catch (InterruptedException ex) { - } - } - // 此处代码用来实现让消息提示框5秒后自动消失 -// try { -// Thread.sleep(5000); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } -// close(); - } - - private void initComponents() { - this.setSize(width, height); - this.setLocation(x, y); - this.setBackground(Color.black); - } - - public void close() { - x = this.getX(); - y = this.getY(); - int ybottom = (int) dim.getHeight() - screenInsets.bottom; - for (int i = 0; i <= ybottom - y; i += 10) { - try { - setLocation(x, y + i); - Thread.sleep(5); - } catch (InterruptedException ex) { - } - } - dispose(); - } - -} - - diff --git a/src/com/sipai/tools/SSCL.java b/src/com/sipai/tools/SSCL.java deleted file mode 100644 index cd660bf0..00000000 --- a/src/com/sipai/tools/SSCL.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.sipai.tools; - -import java.util.Iterator; -import java.util.List; - -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.dom4j.Document; -import org.dom4j.Element; - -import com.sipai.entity.base.ServerObject; -import com.sipai.tools.CommUtil; - -/** - * @author IBM 服务器配置监听程序 - */ -public class SSCL implements ServletContextListener { - - public static String cont = ""; - - @SuppressWarnings("unchecked") - public void contextInitialized(ServletContextEvent event) { - - ServletContext sc = event.getServletContext(); -// cont = sc.getRealPath("//").substring(0,sc.getRealPath("//").lastIndexOf("\\")); - cont = sc.getRealPath("//").substring(0, (sc.getRealPath("//").length() - 1)); - try { - Document dc = CommUtil.read(sc.getRealPath("/") + "/WEB-INF/ServerConfig.xml"); - Element rt = dc.getRootElement(); - List al = rt.elements("Attribute"); - Iterator it = al.iterator(); - while (it.hasNext()) { - Element e = it.next(); - ServerObject.getAtttable().put( - e.attributeValue("name").toUpperCase(), - e.getData().toString()); - e = null; - } - it = null; - rt = null; - dc = null; - - } catch (Throwable e) { - e.printStackTrace(); - } - } - - @Override - public void contextDestroyed(ServletContextEvent arg0) { - // TODO Auto-generated method stub - - } - -} diff --git a/src/com/sipai/tools/SessionFilter.java b/src/com/sipai/tools/SessionFilter.java deleted file mode 100644 index a417fcbd..00000000 --- a/src/com/sipai/tools/SessionFilter.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.sipai.tools; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Properties; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.log4j.Logger; - -import com.sipai.entity.user.User; - -/** - * 用于过滤需要拦截的JSP文件 - */ -public class SessionFilter implements Filter { - - private static final Logger logger = Logger.getLogger(SessionFilter.class); - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - HttpServletRequest req = (HttpServletRequest) request; - HttpServletResponse resp = (HttpServletResponse) response; - //angular跨域访问 - resp.setHeader("Access-Control-Allow-Origin", req.getHeader("Origin")); - resp.setHeader("Access-Control-Allow-Credentials","true"); //是否支持cookie跨域 - resp.setHeader("Access-Control-Allow-Headers", " Origin,X-Requested-With, Content-Type, Accept"); - resp.setHeader("Access-Control-Allow-Methods"," GET, POST, PUT"); -// String ng=req.getParameter("ng"); -// User cuu1=(User)req.getSession().getAttribute("cu"); - String url = req.getRequestURI(); - //配置文件 - Properties properties = new Properties(); - InputStreamReader inputStreamReader = new InputStreamReader - (this.getClass().getClassLoader().getResourceAsStream("sessionFilter.properties"),"UTF-8"); - properties.load(inputStreamReader); - String value = properties.getProperty("logger"); - if(value!=null && value.equals("loggerTure")){ - //配置输出请求地址-loggerTure - logger.info(url); - } - if (CommUtil.filterRequestParameter(req)){ - return; - } - /*if (req.getParameter("ng")==null && //callback angular2前台请求参数 - url.indexOf("/Login/login.do") < 0 && - url.indexOf("/Login/validate.do") < 0 && - url.indexOf("/Login/logout.do") < 0 && - url.indexOf("/app/") < 0 && - url.indexOf("/proapp/") < 0 && - url.indexOf("/msgapp/") < 0 - ) { - HttpSession session = req.getSession(false); - if (SessionManager.isOnline(session)) { - chain.doFilter(request, response); - }else{ - if (req.getHeader("x-requested-with") == null){ - req.getRequestDispatcher("/timeout.jsp").forward(request, response); - }else{ - if(req.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")){ - resp.setHeader("sessionstatus", "timeout");//在响应头设置session状态 - resp.setCharacterEncoding("UTF-8"); - resp.getWriter().print("请重新登陆!"); - chain.doFilter(request, response); - } - } - } - }else{ - chain.doFilter(request, response); - }*/ - chain.doFilter(request, response); - return;//不加return的话,doFilter会出现连接错误 - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - - } - - @Override - public void destroy() { - } -} diff --git a/src/com/sipai/tools/SessionManager.java b/src/com/sipai/tools/SessionManager.java deleted file mode 100644 index d41e7874..00000000 --- a/src/com/sipai/tools/SessionManager.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.sipai.tools; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; - -import org.redisson.api.RBucket; -import org.redisson.api.RedissonClient; - -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.user.User; -import com.sipai.entity.user.UserPower; -import com.sipai.service.user.MenuService; -import com.sipai.service.user.UserService; - -public class SessionManager implements HttpSessionListener { - - private static Map onlineSessions = Collections.synchronizedMap(new HashMap()); - - @Override - public void sessionCreated(HttpSessionEvent event) { - onlineSessions.put(event.getSession().getId(), event.getSession()); - } - - @Override - public void sessionDestroyed(HttpSessionEvent event) { - onlineSessions.remove(event.getSession().getId()); - } - - public static Map getOnlineSessions(){ - return onlineSessions; - } - /** - * token验证 - * @param request - * @return - */ - public static boolean isOnline(HttpServletRequest request) { - String tokenstr= request.getHeader("token"); - - HttpSession session = request.getSession(true); - //验证token是否正确 - boolean result = JwtUtil.verify(tokenstr); - //按原始session存储用户信息写法,临时将用户信息写入session - if (result) { - String userId= JwtUtil.getUserId(tokenstr); - //调用工具类 写入线程缓存 - ThreadLocalUtils.set("userId", userId); - //刷新token过期时间 - RedissonClient redissonClient = (RedissonClient) SpringContextUtil.getBean("redissonClient"); - redissonClient.getBucket(CommString.JWT_SESSION_HEADER+userId).expire(JwtUtil.EXPIRE_TIME*2, TimeUnit.MILLISECONDS); - - request.getSession(); - User cu = getCu(session); - if (cu == null ) { - -// System.out.println(userId); - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - cu=userService.getUserById(userId); - session.setAttribute("cu", cu); - } - ThreadLocalUtils.set("cu", cu); - }else{ - if (session!=null) { - session.setAttribute("cu", null); - } - } - return result; - } - /** - * token失效时检测缓存中是否实效 - * @param request - * @param response - * @return - */ - public static boolean isOffTime(HttpServletRequest request,HttpServletResponse response) { - String tokenstr= request.getHeader("token"); - HttpSession session = request.getSession(false); - if (tokenstr!=null && !tokenstr.isEmpty()) { - String userId = JwtUtil.getUserId(tokenstr); - RedissonClient redissonClient = (RedissonClient) SpringContextUtil.getBean("redissonClient"); - //RedissonClient redissonClient = SpringContextUtil.getBean(RedissonClient.class); - RBucket oldToken = redissonClient.getBucket(CommString.JWT_SESSION_HEADER+userId); - //缓存中存在则生成新token - if (oldToken.isExists()) { -// RedisTemplate redisTemplate = (RedisTemplate) SpringContextUtil.getBean("redisTemplate"); -// String oldToken = (String)redisTemplate.opsForValue().get(CommString.JWT_SESSION_HEADER+userId); -// //缓存中存在则生成新token -// if (oldToken!=null && !oldToken.isEmpty()) { - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User cu=userService.getUserById(userId); - String userName = JwtUtil.getUsername(tokenstr); - String token = JwtUtil.sign( userName,userId); - // 将签发的JWT存储到Redis -// redisTemplate.opsForValue().set(CommString.JWT_SESSION_HEADER+userId, token,JwtUtil.EXPIRE_TIME*2,TimeUnit.MILLISECONDS); - oldToken.set(token); - oldToken.expire(JwtUtil.EXPIRE_TIME*2,TimeUnit.MILLISECONDS); - session.setAttribute("cu", cu); - try { -// response.setStatus(CommString.ERROR_CODE_SERVER); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code", ErrorCodeEnum.Token_Refresh.getCode()); - jsonObject.put("Access_Token", token); -// String resultstr ="{\"code\":\""+ ErrorCodeEnum.Token_Refresh.getCode() +"\",\"Access_Token\":\""+ token +"\"}"; - response.getWriter().println(jsonObject.toString()); - response.getWriter().flush(); - return false; - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - if(session!=null){ - session.setAttribute("cu", null); - } - return true; - } - public static boolean isOnline(HttpSession session) { - User cu = getCu(session); - if (cu != null && cu.getId() != null && cu.getName() != null) { - return true; - } - return false; - } - - public static User getCu(HttpSession session) { - if (null != session) { - if (null != session.getAttribute("cu")) { - return (User) session.getAttribute("cu"); - } - } - return null; - } - - public static void setAccount(HttpSession session, User cu) { - if (null != session) { - session.setAttribute("cu", cu); - } - } - - public boolean havePermission(HttpSession session, String url){ - User cu=(User) session.getAttribute("cu"); - if(cu!=null){ - MenuService menuService = (MenuService) SpringContextUtil.getBean("menuService"); - List list=menuService.selectFuncByUserId(cu.getId()); - for(UserPower obj:list){ - if(obj.getLocation().equals(url)){ - return true; - } - } - } - return false; - } -} diff --git a/src/com/sipai/tools/SpringConfiguration.java b/src/com/sipai/tools/SpringConfiguration.java deleted file mode 100644 index a4b1fb71..00000000 --- a/src/com/sipai/tools/SpringConfiguration.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.sipai.tools; - -import java.io.InputStreamReader; -import java.util.LinkedHashSet; -import java.util.Properties; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.FilterType; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.EnableTransactionManagement; - - -/** - * @author fendo - * - */ -@Configuration -@ComponentScan(basePackages = {"com.sipai"}, - excludeFilters = {@ComponentScan.Filter(type= FilterType.ANNOTATION,value = Controller.class)}) -@EnableTransactionManagement -public class SpringConfiguration { - - - //bean的id为client - @Bean - public TransportClientFactory client(){ - Properties properties = new Properties(); - try { - InputStreamReader inputStreamReader = new InputStreamReader - (this.getClass().getClassLoader().getResourceAsStream("es.properties"),"UTF-8"); - properties.load(inputStreamReader); - } catch (Exception e) { - e.printStackTrace(); - } - TransportClientFactory transportClientFactory=new TransportClientFactory(); - transportClientFactory.setClusterName(properties.getProperty("es.name")); - transportClientFactory.setHost(properties.getProperty("es.nodes")); - transportClientFactory.setPort(Integer.parseInt(properties.getProperty("es.host"))); - return transportClientFactory; - } -} diff --git a/src/com/sipai/tools/SpringContextUtil.java b/src/com/sipai/tools/SpringContextUtil.java deleted file mode 100644 index 45c4efc8..00000000 --- a/src/com/sipai/tools/SpringContextUtil.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sipai.tools; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; - -public class SpringContextUtil implements ApplicationContextAware { - - private static ApplicationContext applicationContext; // Spring应用上下文环境 - - // 下面的这个方法上加了@Override注解,原因是继承ApplicationContextAware接口是必须实现的方法 - @Override - public void setApplicationContext(ApplicationContext applicationContext) - throws BeansException { - SpringContextUtil.applicationContext = applicationContext; - } - - public static ApplicationContext getApplicationContext() { - return applicationContext; - } - - public static Object getBean(String name) throws BeansException { - return applicationContext.getBean(name); - } - - public static Object getBean(String name, Class requiredType) - throws BeansException { - return applicationContext.getBean(name, requiredType); - } - - //通过class获取Bean. - public static T getBean(Class clazz){ - return getApplicationContext().getBean(clazz); - } - - public static boolean containsBean(String name) { - return applicationContext.containsBean(name); - } - - public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { - return applicationContext.isSingleton(name); - } - - public static Class getType(String name) throws NoSuchBeanDefinitionException { - return applicationContext.getType(name); - } - - public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { - return applicationContext.getAliases(name); - } -} diff --git a/src/com/sipai/tools/StartupListener.java b/src/com/sipai/tools/StartupListener.java deleted file mode 100644 index 6769da61..00000000 --- a/src/com/sipai/tools/StartupListener.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sipai.tools; - -import org.springframework.context.ApplicationListener; -import org.springframework.context.event.ContextRefreshedEvent; -import org.springframework.stereotype.Service; - - -/** - * 启动监听器 用于后期补票入库平均库价格修改 - * - * @author ycy - */ -@Service -public class StartupListener implements ApplicationListener { - - @Override - public void onApplicationEvent(ContextRefreshedEvent evt) { - if (evt.getApplicationContext().getParent() != null && !ThreadPoolUpdateMoney.started) { - ThreadPoolUpdateMoney.started = true; -// System.out.println("后期补票价格线程池启动"); - ThreadPoolUpdateMoney threadPoolUpdateMoney = new ThreadPoolUpdateMoney(); - threadPoolUpdateMoney.start(); - } - } -} diff --git a/src/com/sipai/tools/SwaggerConfig.java b/src/com/sipai/tools/SwaggerConfig.java deleted file mode 100644 index 575d0534..00000000 --- a/src/com/sipai/tools/SwaggerConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.sipai.tools; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import com.google.common.collect.Lists; - -import io.swagger.annotations.ApiOperation; -import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.ParameterBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.schema.ModelRef; -import springfox.documentation.service.*; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.contexts.SecurityContext; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -@Configuration -//增强扫描 -@ComponentScan( - basePackages = { - "com.github.xiaoymin.knife4j.spring.plugin", - "com.github.xiaoymin.knife4j.spring.web" - } -) -@EnableSwagger2 -@Import(BeanValidatorPluginsConfiguration.class) -public class SwaggerConfig { - @Bean - public Docket createRestApi() { - - ParameterBuilder ticketPar = new ParameterBuilder(); - List pars = new ArrayList(); - ticketPar.name("token").description("user ticket")//Token 以及Authorization 为自定义的参数,session保存的名字是哪个就可以写成那个 - .modelRef(new ModelRef("string")).parameterType("header") - .required(false).build(); //header中的ticket参数非必填,传空也可以 - pars.add(ticketPar.build()); //根据每个方法名也知道当前方法在设置什么参数 - - return new Docket(DocumentationType.SWAGGER_2) - .apiInfo(apiInfo()).select() - //扫描指定包中的swagger注解 - //.apis(RequestHandlerSelectors.any()) - //扫描所有有注解的api,用这种方式更灵活 - .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) - .paths(PathSelectors.any()) - .build() - .globalOperationParameters(pars); - } - - private ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("SIPAIIS Api Documentation") - .description("项目后台API接口文档") - .termsOfServiceUrl("https://www.sipaiis.com/") - .license("") - .version("1.0.0") - .build(); - } -} \ No newline at end of file diff --git a/src/com/sipai/tools/TaskUtils.java b/src/com/sipai/tools/TaskUtils.java deleted file mode 100644 index de1565e1..00000000 --- a/src/com/sipai/tools/TaskUtils.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.sipai.tools; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.quartz.JobExecutionContext; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.sipai.entity.schedule.ScheduleJob; - -public class TaskUtils { - - public static Logger log = LoggerFactory.getLogger(TaskUtils.class); - @SuppressWarnings("unchecked") - public static void invokeMethod(ScheduleJob scheduleJob) { - Object object = null; - Class clazz = null; - if (StringUtils.isNotBlank(scheduleJob.getBeanClass())) { - try { - clazz = Class.forName(scheduleJob.getBeanClass()); - object = clazz.newInstance(); - } catch (Exception e) { - log.error("CatchException:",e); - } - } - if (object == null) { - log.error("任务名称 = [" + scheduleJob.getJobName() + "]---------------未启动成功,请检查是否配置正确!!!"); - System.out.println("任务名称 = [" + scheduleJob.getJobName() + "]---------------未启动成功,请检查是否配置正确!!!"); - return; - } - clazz = object.getClass(); - Method method = null; - - try { - method = clazz.getDeclaredMethod(scheduleJob.getMethodName(),ScheduleJob.class); - } catch (NoSuchMethodException e) { - log.error("任务名称 = [" + scheduleJob.getJobName() + "]---------------未启动成功,方法名设置错误!!!"); - System.out.println("任务名称 = [" + scheduleJob.getJobName() + "]---------------未启动成功,方法名设置错误!!!"); - } catch (SecurityException e) { - e.printStackTrace(); - } - if (method != null) { - try { - method.invoke(object,scheduleJob); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } -// log.info("任务名称 = [" + scheduleJob.getJobName() + "]----------启动成功"); - } - -} diff --git a/src/com/sipai/tools/Test.java b/src/com/sipai/tools/Test.java deleted file mode 100644 index d42f68a8..00000000 --- a/src/com/sipai/tools/Test.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.sipai.tools; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.sipai.entity.user.User; -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class Test { - /*public static void main(String[] args) throws IOException { - String json = "{\"tenantEname\":\"chengdubeikong\",\"name\":\"admin\",\"password\":\"chengdubeikong\",\"hash\":\"abc\"}"; - String url = "http://cloud.anylink.io:8600/user/getToken"; - HttpClient httpClient = new DefaultHttpClient(); - HttpPost post = new HttpPost(url); - StringEntity postingString = new StringEntity(json); - post.setEntity(postingString); - post.setHeader("Content-type", "application/json"); - HttpResponse response = httpClient.execute(post); - String content = EntityUtils.toString(response.getEntity()); - JSONObject jsonObject1 = JSONObject.parseObject(content); - String token = jsonObject1.get("data").toString(); - System.out.println(token); - - String url2 = "http://cloud.anylink.io:8600/currentdata/pagination"; - //创建httpClient - CloseableHttpClient client = HttpClients.createDefault(); - //2、封装请求参数 - List list = new ArrayList(); - list.add(new BasicNameValuePair("token", token)); - list.add(new BasicNameValuePair("page", "1")); - list.add(new BasicNameValuePair("perPage", "500")); - list.add(new BasicNameValuePair("deviceId", "1651636225")); - //3、转化参数 - String params = EntityUtils.toString(new UrlEncodedFormEntity(list, Consts.UTF_8)); - System.out.println("params:" + params); - //4、创建HttpGet请求 - HttpGet httpGet = new HttpGet(url2 + "?" + params); - CloseableHttpResponse response2 = client.execute(httpGet); - //5、获取实体 - HttpEntity entity = response2.getEntity(); - //将实体装成字符串 - String string = EntityUtils.toString(entity); - JSONObject jsonObject = JSONObject.parseObject(string); - JSONObject jsonObject2 = JSONObject.parseObject(jsonObject.get("result").toString()); - JSONArray jsonArray = JSONArray.parseArray(jsonObject2.get("data").toString()); - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject3 = JSONObject.parseObject(jsonArray.get(i).toString()); - String str = new String(jsonObject3.get("itemname").toString().getBytes("iso8859-1"),"UTF-8"); - } - - }*/ - - public static void main(String[] args) { - Double[] array = {Double.valueOf(10), Double.valueOf(5), Double.valueOf(3), Double.valueOf(7), Double.valueOf(6)}; - myBubblesort(array); - System.out.println(Arrays.toString(array)); - - User user1 = new User(); - user1.setWeekloginduration(1.0); - - User user2 = new User(); - user2.setWeekloginduration(2.1); - - User user3 = new User(); - user3.setWeekloginduration(3.1); - - User user4 = new User(); - user4.setWeekloginduration(4.1); - - User[] array1 = {user1, user2, user3, user4}; - - } - - public static void myBubblesort(Double[] array) { - for (int i = 0; i < array.length; i++) { - for (int j = 0; j < array.length - 1; j++) { - if (array[j] < array[j + 1]) { - Double tmp = Double.valueOf(0); - tmp = array[j]; - array[j] = array[j + 1]; - array[j + 1] = tmp; - } - } - } - } - - public static void myBubblesort2(User[] array) { - /*for (int i = 0; i < array.length; i++) { - for (int j = 0; j < array.length - 1; j++) { - if (array[j] < array[j + 1]) { - User tmp = 0.0; - tmp = array[j]; - array[j] = array[j + 1]; - array[j + 1] = tmp; - } - } - }*/ - } - -} diff --git a/src/com/sipai/tools/ThirdRequestProp.java b/src/com/sipai/tools/ThirdRequestProp.java deleted file mode 100644 index 46d4512d..00000000 --- a/src/com/sipai/tools/ThirdRequestProp.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sipai.tools; - -public class ThirdRequestProp { - - private String interfaces; // 第三方接口 - private String boturl; // 南市机器人实时采集机器人数据接口 - private String bottoken; // 南市机器人获取token接口 - - public String getInterfaces() { - return interfaces; - } - - public void setInterfaces(String interfaces) { - this.interfaces = interfaces; - } - - public String getBoturl() { - return boturl; - } - - public void setBoturl(String boturl) { - this.boturl = boturl; - } - - public String getBottoken() { - return bottoken; - } - - public void setBottoken(String bottoken) { - this.bottoken = bottoken; - } -} diff --git a/src/com/sipai/tools/ThreadLocalUtils.java b/src/com/sipai/tools/ThreadLocalUtils.java deleted file mode 100644 index 27ccb759..00000000 --- a/src/com/sipai/tools/ThreadLocalUtils.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.tools; - -import java.util.HashMap; -import java.util.Map; - -/** - * @Auther: wxp - * @Date: 2022/2/21 13:19 - * @Description: - */ -public class ThreadLocalUtils { - private static ThreadLocal> cache = new ThreadLocal>(); -// private static InternalThreadLocal> cache = new InternalThreadLocal>(); - /** - * 向ThreadLocal缓存值 - * - * @param key 要缓存的KEY - * @param value 要缓存的VALUE - */ - public static void set(String key, Object value) { - if (!isCaheIsNull()) { - cache.get().put(key, value); - } else { - Map vmap = new HashMap<>(); - vmap.put(key, value); - cache.set(vmap); - } - } - - /** - * 从ThreadLocal里获取缓存的值 - * - * @param key 要获取的数据的KEY - * @return 要获取的值 - */ - public static Object getCache(String key) { - Map map = cache.get(); - if (isCaheIsNull()) { - return null; - } - if (map.containsKey(key)) { - return map.get(key); - } else { - return null; - } - } - - /** - * 根据KEY移除缓存里的数据 - * - * @param key - */ - public static void removeByKey(String key) { - if (isCaheIsNull()) { - return; - } else { - cache.get().remove(key); - } - } - - /** - * 移除当前线程缓存 - * 用于释放当前线程threadlocal资源 - */ - public static void remove() { - cache.remove(); - } - - private static boolean isCaheIsNull() { - return cache.get() == null; - } -} diff --git a/src/com/sipai/tools/ThreadPoolUpdateMoney.java b/src/com/sipai/tools/ThreadPoolUpdateMoney.java deleted file mode 100644 index 86c83587..00000000 --- a/src/com/sipai/tools/ThreadPoolUpdateMoney.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.sipai.tools; - -import com.sipai.entity.sparepart.InStockRecord; -import com.sipai.entity.sparepart.InStockRecordDetail; -import com.sipai.entity.sparepart.InStockRecordUpdateMoney; -import com.sipai.service.sparepart.InStockRecordDetailService; -import com.sipai.service.sparepart.InStockRecordService; -import com.sipai.service.sparepart.InStockRecordUpdateMoneyService; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * 线程池类 针对平均库的后期补票价格更改 - */ -public class ThreadPoolUpdateMoney extends Thread { - - static boolean started = false; - - InStockRecordUpdateMoneyService inStockRecordUpdateMoneyService = (InStockRecordUpdateMoneyService) SpringContextUtil.getBean("inStockRecordUpdateMoneyService"); - - static Map startMap = new HashMap<>(); - - public static Map getStartMap() { - return startMap; - } - - public static void setStartMap(Map startMap) { - ThreadPoolUpdateMoney.startMap = startMap; - } - - // 创建线程池 - static ExecutorService executor; - - public static ExecutorService getExecutor() { - return executor; - } - - public static void setExecutor(ExecutorService executor) { - ThreadPoolUpdateMoney.executor = executor; - } - - @Override - public void start() { - ThreadPoolUpdateMoney.executor = Executors.newFixedThreadPool(1); - List inStockRecordUpdateMonies = inStockRecordUpdateMoneyService.selectListByWhere("where status != 1 order by insdt asc"); - // 准备中的 - for (InStockRecordUpdateMoney item : inStockRecordUpdateMonies) { - startMap.put(item.getId(), item.getInDetailId()); - // 更新状态 - executor.execute(new InStockUpdateMoney(item.getId() + "," +item.getInDetailId())); - } - // 当前线程池中总数 - int activeCount = ((ThreadPoolExecutor)executor).getActiveCount(); - - } - - public static class InStockUpdateMoney extends Thread { - - InStockRecordService inStockRecordService = (InStockRecordService) SpringContextUtil.getBean("inStockRecordService"); - InStockRecordDetailService inStockRecordDetailService = (InStockRecordDetailService) SpringContextUtil.getBean("inStockRecordDetailService"); - InStockRecordUpdateMoneyService inStockRecordUpdateMoneyService = (InStockRecordUpdateMoneyService) SpringContextUtil.getBean("inStockRecordUpdateMoneyService"); - - String startId; - - public String getStartId() { - return startId; - } - - public void setStartId(String startId) { - this.startId = startId; - } - - public InStockUpdateMoney(String startId) { - this.startId = startId; - } - - @Override - public void run() { - // 此为队列id + 入库详情id - String threadName = this.getStartId(); - String[] threadNames = threadName.split(","); - String updateId = threadNames[0]; - String inStockDetailId = threadNames[1]; - - // 查询详细信息 - InStockRecordDetail inStockRecordDetail = inStockRecordDetailService.selectById(inStockDetailId); - // 查询入库单 - InStockRecord inStockRecord = inStockRecordService.selectById(inStockRecordDetail.getInstockRecordId()); - // 更新价格 - int i = inStockRecordService.update_ITPM(inStockRecord, inStockRecordDetail); - if (i == 1) { - // 删除临时表中数据 - int delete = inStockRecordUpdateMoneyService.deleteById(updateId); - startMap.remove(updateId); - if (delete == 1) { - } - if (startMap.isEmpty()) { - executor.isShutdown(); - } - } - - } - } - -} diff --git a/src/com/sipai/tools/TransportClientFactory.java b/src/com/sipai/tools/TransportClientFactory.java deleted file mode 100644 index bf6dd847..00000000 --- a/src/com/sipai/tools/TransportClientFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.sipai.tools; - -import java.net.InetAddress; - -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.transport.client.PreBuiltTransportClient; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.FactoryBean; -import org.springframework.beans.factory.InitializingBean; - -public class TransportClientFactory implements FactoryBean,InitializingBean,DisposableBean{ - - - private String clusterName; - private String host; - private int port; - private TransportClient client; - - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - public void setHost(String host) { - this.host = host; - } - - public void setPort(int port) { - this.port = port; - } - - @Override - public void destroy() throws Exception { - if(client!=null) - client.close(); - - } - - @Override - public void afterPropertiesSet() throws Exception { - Settings settings=Settings.builder().put("cluster.name",this.clusterName).build(); - client=new PreBuiltTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName(this.host),this.port)); - } - - @Override - public TransportClient getObject() throws Exception { - return client; - } - - @Override - public Class getObjectType() { - return TransportClient.class; - } - - @Override - public boolean isSingleton() { - return false; - } - -} diff --git a/src/com/sipai/tools/UEditorUtil.java b/src/com/sipai/tools/UEditorUtil.java deleted file mode 100644 index 54a037bf..00000000 --- a/src/com/sipai/tools/UEditorUtil.java +++ /dev/null @@ -1,271 +0,0 @@ -package com.sipai.tools; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Random; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.fileupload.FileItemIterator; -import org.apache.commons.fileupload.FileItemStream; -import org.apache.commons.fileupload.FileUploadBase.InvalidContentTypeException; -import org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.fileupload.util.Streams; - -import sun.misc.BASE64Decoder; - -/** - * UEditor文件上传辅助类 - */ -public class UEditorUtil { - // 输出文件地址 - private String url = ""; - // 上传文件名 - private String fileName = ""; - // 状态 - private String state = ""; - // 文件类型 - private String type = ""; - // 原始文件名 - private String originalName = ""; - // 文件大小 - private String size = ""; - - private HttpServletRequest request = null; - private String title = ""; - - // 保存路径 - private String savePath = "upload"; - // 文件允许格式 - private String[] allowFiles = { ".rar", ".doc", ".docx", ".zip", ".pdf", ".txt", ".swf", ".wmv", ".gif", ".png", ".jpg", ".jpeg", ".bmp" }; - // 文件大小限制,单位KB - private int maxSize = 10000; - - private HashMap errorInfo = new HashMap(); - - public UEditorUtil(HttpServletRequest request) { - this.request = request; - HashMap tmp = this.errorInfo; - tmp.put("SUCCESS", "SUCCESS"); // 默认成功 - tmp.put("NOFILE", "未包含文件上传域"); - tmp.put("TYPE", "不允许的文件格式"); - tmp.put("SIZE", "文件大小超出限制"); - tmp.put("ENTYPE", "请求类型ENTYPE错误"); - tmp.put("REQUEST", "上传请求异常"); - tmp.put("IO", "IO异常"); - tmp.put("DIR", "目录创建失败"); - tmp.put("UNKNOWN", "未知错误"); - - } - - public void upload() throws Exception { - boolean isMultipart = ServletFileUpload.isMultipartContent(this.request); - if (!isMultipart) { - this.state = this.errorInfo.get("NOFILE"); - return; - } - DiskFileItemFactory dff = new DiskFileItemFactory(); - String savePath = this.getFolder(this.savePath); - dff.setRepository(new File(savePath)); - try { - ServletFileUpload sfu = new ServletFileUpload(dff); - sfu.setSizeMax(this.maxSize * 1024); - sfu.setHeaderEncoding("utf-8"); - FileItemIterator fii = sfu.getItemIterator(this.request); - while (fii.hasNext()) { - FileItemStream fis = fii.next(); - if (!fis.isFormField()) { - this.originalName = fis.getName().substring(fis.getName().lastIndexOf(System.getProperty("file.separator")) + 1); - if (!this.checkFileType(this.originalName)) { - this.state = this.errorInfo.get("TYPE"); - continue; - } - this.fileName = this.getName(this.originalName); - this.type = this.getFileExt(this.fileName); - this.url = savePath + "/" + this.fileName; - BufferedInputStream in = new BufferedInputStream(fis.openStream()); - FileOutputStream out = new FileOutputStream(new File(this.getPhysicalPath(this.url))); - BufferedOutputStream output = new BufferedOutputStream(out); - Streams.copy(in, output, true); - this.state = this.errorInfo.get("SUCCESS"); - // UE中只会处理单张上传,完成后即退出 - break; - } else { - String fname = fis.getFieldName(); - // 只处理title,其余表单请自行处理 - if (!fname.equals("pictitle")) { - continue; - } - BufferedInputStream in = new BufferedInputStream(fis.openStream()); - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - StringBuffer result = new StringBuffer(); - while (reader.ready()) { - result.append((char) reader.read()); - } - this.title = new String(result.toString().getBytes(), "utf-8"); - reader.close(); - - } - } - } catch (SizeLimitExceededException e) { - this.state = this.errorInfo.get("SIZE"); - } catch (InvalidContentTypeException e) { - this.state = this.errorInfo.get("ENTYPE"); - } catch (FileUploadException e) { - this.state = this.errorInfo.get("REQUEST"); - } catch (Exception e) { - this.state = this.errorInfo.get("UNKNOWN"); - } - } - - /** - * 接受并保存以base64格式上传的文件 - * - * @param fieldName - */ - public void uploadBase64(String fieldName) { - String savePath = this.getFolder(this.savePath); - String base64Data = this.request.getParameter(fieldName); - this.fileName = this.getName("test.png"); - this.url = savePath + "/" + this.fileName; - BASE64Decoder decoder = new BASE64Decoder(); - try { - File outFile = new File(this.getPhysicalPath(this.url)); - OutputStream ro = new FileOutputStream(outFile); - byte[] b = decoder.decodeBuffer(base64Data); - for (int i = 0; i < b.length; ++i) { - if (b[i] < 0) { - b[i] += 256; - } - } - ro.write(b); - ro.flush(); - ro.close(); - this.state = this.errorInfo.get("SUCCESS"); - } catch (Exception e) { - this.state = this.errorInfo.get("IO"); - } - } - - /** - * 文件类型判断 - * - * @param fileName - * @return - */ - private boolean checkFileType(String fileName) { - Iterator type = Arrays.asList(this.allowFiles).iterator(); - while (type.hasNext()) { - String ext = type.next(); - if (fileName.toLowerCase().endsWith(ext)) { - return true; - } - } - return false; - } - - /** - * 获取文件扩展名 - * - * @return string - */ - private String getFileExt(String fileName) { - return fileName.substring(fileName.lastIndexOf(".")); - } - - /** - * 依据原始文件名生成新文件名 - * - * @return - */ - private String getName(String fileName) { - Random random = new Random(); - return this.fileName = "" + random.nextInt(10000) + System.currentTimeMillis() + this.getFileExt(fileName); - } - - /** - * 根据字符串创建本地目录 并按照日期建立子目录返回 - * - * @param path - * @return - */ - private String getFolder(String path) { - SimpleDateFormat formater = new SimpleDateFormat("yyyyMMdd"); - path += "/" + formater.format(new Date()); - File dir = new File(this.getPhysicalPath(path)); - if (!dir.exists()) { - try { - dir.mkdirs(); - } catch (Exception e) { - this.state = this.errorInfo.get("DIR"); - return ""; - } - } - return path; - } - - /** - * 根据传入的虚拟路径获取物理路径 - * - * @param path - * @return - */ - private String getPhysicalPath(String path) { - String servletPath = this.request.getServletPath(); - String realPath = this.request.getSession().getServletContext().getRealPath(servletPath); - return new File(realPath).getParent() + "/" + path; - } - - public void setSavePath(String savePath) { - this.savePath = savePath; - } - - public void setAllowFiles(String[] allowFiles) { - this.allowFiles = allowFiles; - } - - public void setMaxSize(int size) { - this.maxSize = size; - } - - public String getSize() { - return this.size; - } - - public String getUrl() { - return this.url; - } - - public String getFileName() { - return this.fileName; - } - - public String getState() { - return this.state; - } - - public String getTitle() { - return this.title; - } - - public String getType() { - return this.type; - } - - public String getOriginalName() { - return this.originalName; - } -} diff --git a/src/com/sipai/tools/ValueTypeEnum.java b/src/com/sipai/tools/ValueTypeEnum.java deleted file mode 100644 index ea40c8ea..00000000 --- a/src/com/sipai/tools/ValueTypeEnum.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.sipai.tools; - -import com.sipai.entity.enums.SourceTypeEnum; - -public enum ValueTypeEnum { - - /** - * Modbus - */ - THE_MODBUS("Modbus", "Modbus"), - /** - * OPC - */ - THE_OPC("OPC", "OPC"), - /** - * 数据库 - */ - THE_SQL("sql", "数据库"); - - private String valueType; - private String valueTypeText; - - ValueTypeEnum(String valueType, String valueTypeText) { - this.valueType = valueType; - this.valueTypeText = valueTypeText; - } - - public String getValueType() { - return valueType; - } - - public void setValueType(String valueType) { - this.valueType = valueType; - } - - public String getValueTypeText() { - return valueTypeText; - } - - public void setValueTypeText(String valueTypeText) { - this.valueTypeText = valueTypeText; - } - - public static String getValue(String type) { - ValueTypeEnum[] valueTypeEnum = values(); - for (ValueTypeEnum value : valueTypeEnum) { - if (value.getValueType().equals(type)) { - return value.getValueTypeText(); - } - } - return null; - } - - public static String getIdByName(String name) { - ValueTypeEnum[] valueTypeEnums = values(); - for (ValueTypeEnum valueTypeEnum : valueTypeEnums) { - if (valueTypeEnum.getValueTypeText().equals(name)) { - return valueTypeEnum.getValueType(); - } - } - return null; - } - -} diff --git a/src/com/sipai/tools/VerifyCodeUtils.java b/src/com/sipai/tools/VerifyCodeUtils.java deleted file mode 100644 index 529ade78..00000000 --- a/src/com/sipai/tools/VerifyCodeUtils.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.sipai.tools; - -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.geom.AffineTransform; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.Random; -/** - *

VerifyCodeUtils Description: (验证码生成)

- * DATE: 2016年6月2日 下午3:53:34 - */ -public class VerifyCodeUtils{ - - //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符 - public static final String VERIFY_CODES = "23456789";//ABCDEFGHJKLMNPQRSTUVWXYZ"; - public static final String VERIFY_ALLCODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - private static Random random = new Random(); - - - /** - * 使用系统默认字符源生成验证码 - * @param verifySize 验证码长度 - * @return - */ - public static String generateVerifyCode(int verifySize){ - return generateVerifyCode(verifySize, VERIFY_CODES); - } - /** - * 使用系统默认字符源生成验证码 - * @param verifySize 验证码长度 - * @return - */ - public static String generateVerifyAllCode(int verifySize){ - return generateVerifyCode(verifySize, VERIFY_ALLCODES); - } - /** - * 使用指定源生成验证码 - * @param verifySize 验证码长度 - * @param sources 验证码字符源 - * @return - */ - public static String generateVerifyCode(int verifySize, String sources){ - if(sources == null || sources.length() == 0){ - sources = VERIFY_CODES; - } - int codesLen = sources.length(); - Random rand = new Random(System.currentTimeMillis()); - StringBuilder verifyCode = new StringBuilder(verifySize); - for(int i = 0; i < verifySize; i++){ - verifyCode.append(sources.charAt(rand.nextInt(codesLen-1))); - } - return verifyCode.toString(); - } - - /** - * 生成随机验证码文件,并返回验证码值 - * @param w - * @param h - * @param outputFile - * @param verifySize - * @return - * @throws IOException - */ - public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException{ - String verifyCode = generateVerifyCode(verifySize); - outputImage(w, h, outputFile, verifyCode); - return verifyCode; - } - - /** - * 输出随机验证码图片流,并返回验证码值 - * @param w - * @param h - * @param os - * @param verifySize - * @return - * @throws IOException - */ - public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException{ - String verifyCode = generateVerifyCode(verifySize); - outputImage(w, h, os, verifyCode); - return verifyCode; - } - - /** - * 生成指定验证码图像文件 - * @param w - * @param h - * @param outputFile - * @param code - * @throws IOException - */ - public static void outputImage(int w, int h, File outputFile, String code) throws IOException{ - if(outputFile == null){ - return; - } - File dir = outputFile.getParentFile(); - if(!dir.exists()){ - dir.mkdirs(); - } - try{ - outputFile.createNewFile(); - FileOutputStream fos = new FileOutputStream(outputFile); - outputImage(w, h, fos, code); - fos.close(); - } catch(IOException e){ - throw e; - } - } - - /** - * 输出指定验证码图片流 - * @param w - * @param h - * @param os - * @param code - * @throws IOException - */ - public static void outputImage(int w, int h, OutputStream os, String code) throws IOException{ - int verifySize = code.length(); - BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); - Random rand = new Random(); - Graphics2D g2 = image.createGraphics(); - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); - Color[] colors = new Color[5]; - Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, - Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE, - Color.PINK, Color.YELLOW }; - float[] fractions = new float[colors.length]; - for(int i = 0; i < colors.length; i++){ - colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)]; - fractions[i] = rand.nextFloat(); - } - Arrays.sort(fractions); - - /*g2.setColor(Color.GRAY);// 设置边框色 - g2.fillRect(0, 0, w, h);*/ - - Color c = getRandColor(200, 250); - g2.setColor(c);// 设置背景色 - g2.fillRect(0, 0, w, h); - - //绘制干扰线 - Random random = new Random(); - Color fontcolor = getRandColor(100, 160); - g2.setColor(fontcolor);// 设置线条的颜色 - for (int i = 0; i < 2; i++) { - int x = 0; - int y = h/2; - int xl = w; - int yl = h/2; - //设置线宽 - g2.setStroke(new BasicStroke(1.5f)); - g2.drawLine(x, y, xl, yl); - } - // 添加噪点 - float yawpRate = 0.1f;// 噪声率 - int area = (int) (yawpRate * w * h); - for (int i = 0; i < area; i++) { - int x = random.nextInt(w); - int y = random.nextInt(h); - int rgb = getRandomIntColor(); - image.setRGB(x, y, rgb); - } - - shear(g2, w, h, c);// 使图片扭曲 - - g2.setColor(fontcolor); - int fontSize = h-5; - //设置字体 - Font font = new Font("TimesRoman", Font.ITALIC, fontSize); - g2.setFont(font); - char[] chars = code.toCharArray(); - for(int i = 0; i < verifySize; i++){ - AffineTransform affine = new AffineTransform(); - affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize/2, h/2-5); - g2.setTransform(affine); - g2.drawChars(chars, i, 1, ((w-10) / verifySize) * i + 5, h/2 + fontSize/2 - 10); - } - - g2.dispose(); - ImageIO.write(image, "jpg", os); - } - - private static Color getRandColor(int fc, int bc) { - if (fc > 255) - fc = 255; - if (bc > 255) - bc = 255; - int r = fc + random.nextInt(bc - fc); - int g = fc + random.nextInt(bc - fc); - int b = fc + random.nextInt(bc - fc); - return new Color(r, g, b); - } - - private static int getRandomIntColor() { - int[] rgb = getRandomRgb(); - int color = 0; - for (int c : rgb) { - color = color << 8; - color = color | c; - } - return color; - } - - private static int[] getRandomRgb() { - int[] rgb = new int[3]; - for (int i = 0; i < 3; i++) { - rgb[i] = random.nextInt(255); - } - return rgb; - } - - private static void shear(Graphics g, int w1, int h1, Color color) { - shearX(g, w1, h1, color); - shearY(g, w1, h1, color); - } - - private static void shearX(Graphics g, int w1, int h1, Color color) { - - int period = random.nextInt(2); - - boolean borderGap = true; - int frames = 1; - int phase = random.nextInt(2); - - for (int i = 0; i < h1; i++) { - double d = (double) (period >> 1) - * Math.sin((double) i / (double) period - + (6.2831853071795862D * (double) phase) - / (double) frames); - g.copyArea(0, i, w1, 1, (int) d, 0); - if (borderGap) { - g.setColor(color); - g.drawLine((int) d, i, 0, i); - g.drawLine((int) d + w1, i, w1, i); - } - } - - } - - private static void shearY(Graphics g, int w1, int h1, Color color) { - - int period = random.nextInt(40) + 10; // 50; - - boolean borderGap = true; - int frames = 20; - int phase = 7; - for (int i = 0; i < w1; i++) { - double d = (double) (period >> 1) - * Math.sin((double) i / (double) period - + (6.2831853071795862D * (double) phase) - / (double) frames); - g.copyArea(i, 0, 1, h1, 0, (int) d); - if (borderGap) { - g.setColor(color); - g.drawLine(i, (int) d, i, 0); - g.drawLine(i, h1, i, h1); - } - - } - - } - public static void main(String[] args) throws IOException{ - File dir = new File("F:/verifies"); - int w = 200, h = 80; - for(int i = 0; i < 50; i++){ - String verifyCode = generateVerifyCode(4); - File file = new File(dir, verifyCode + ".jpg"); - outputImage(w, h, file, verifyCode); - } - } -} \ No newline at end of file diff --git a/src/com/sipai/tools/WangEditor.java b/src/com/sipai/tools/WangEditor.java deleted file mode 100644 index 6ace3a36..00000000 --- a/src/com/sipai/tools/WangEditor.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.sipai.tools; - - -public class WangEditor { - private Integer errno; //错误代码,0 表示没有错误。 - private String[] data; //已上传的图片路径 - - - public WangEditor(String[] data) { - super(); - this.errno = 0; - this.data = data; - } - - public Integer getErrno() { - return errno; - } - - public void setErrno(Integer errno) { - this.errno = errno; - } - - public String[] getData() { - return data; - } - - public void setData(String[] data) { - this.data = data; - } -} diff --git a/src/com/sipai/tools/WeChatAuthUtil.java b/src/com/sipai/tools/WeChatAuthUtil.java deleted file mode 100644 index 4b38e915..00000000 --- a/src/com/sipai/tools/WeChatAuthUtil.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.sipai.tools; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.URL; -import java.rmi.ConnectException; -import java.util.Properties; - -import javax.net.ssl.HttpsURLConnection; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; - -import com.sipai.service.msg.MsgServiceImpl; - -import net.sf.json.JSONObject; - -/** - * 微信获取用户信息公共方法 - * @author ls - * - */ -@SuppressWarnings("deprecation") -public class WeChatAuthUtil { - - //String url 地址 - public static JSONObject doGetJson(String url) throws ClientProtocolException, IOException{ - JSONObject jsonObject = null; - //初始化对象 - @SuppressWarnings("resource") - DefaultHttpClient defaultHttpClient = new DefaultHttpClient(); - /** - * 通过get方法提交 - * 并传入地址 - */ - HttpGet httpGet = new HttpGet(url); - //发送请求 - HttpResponse response = defaultHttpClient.execute(httpGet); - //返回结果 - HttpEntity entity = response.getEntity(); - if (response!=null) { - //转换成String类型 - String result = EntityUtils.toString(entity,"UTF-8"); - //String类型转换成json格式 - jsonObject = JSONObject.fromObject(result); - } - httpGet.releaseConnection(); - return jsonObject; - } - /** - * 获取微信参数配置文件中的数据 - * @param key 参数名 - * @return - * @throws IOException - */ - public static String searchWeChatSources(String key) throws IOException{ - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("wechat.properties"); - Properties prop = new Properties(); - prop.load(inStream); - return prop.getProperty(key); - } - /** - * 发送请求,通过微信公众号向指定的用户发送消息 - * @param requestUrl 请求访问微信公众号的地址 - * @param requestMethod 请求类型 - * @param outputStr 推送给用户的数据 - * @return - */ - public static String httpsRequest(String requestUrl, String requestMethod, String outputStr){ - try { - URL url = new URL(requestUrl); - HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); - conn.setDoOutput(true); - conn.setDoInput(true); - conn.setUseCaches(false); - // 设置请求方式(GET/POST) - conn.setRequestMethod(requestMethod); - conn.setRequestProperty("content-type", "application/x-www-form-urlencoded"); - // 当outputStr不为null时向输出流写数据 - if (null != outputStr) { - OutputStream outputStream = conn.getOutputStream(); - // 注意编码格式 - outputStream.write(outputStr.getBytes("UTF-8")); - outputStream.close(); - } - // 从输入流读取返回内容 - InputStream inputStream = conn.getInputStream(); - InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8"); - BufferedReader bufferedReader = new BufferedReader(inputStreamReader); - String str = null; - StringBuffer buffer = new StringBuffer(); - while ((str = bufferedReader.readLine()) != null) { - buffer.append(str); - } - // 释放资源 - bufferedReader.close(); - inputStreamReader.close(); - inputStream.close(); - inputStream = null; - conn.disconnect(); - return buffer.toString(); - } catch (ConnectException ce) { - System.out.println("连接超时:{}"); - } catch (Exception e) { - System.out.println("https请求异常:{}"); - } - return null; - } -} diff --git a/src/com/sipai/tools/WeatherTest.java b/src/com/sipai/tools/WeatherTest.java deleted file mode 100644 index 6695c6ad..00000000 --- a/src/com/sipai/tools/WeatherTest.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.sipai.tools; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.net.URL; -import java.net.URLConnection; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import net.sf.json.JSONObject; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class WeatherTest { - - private static String getSoapRequest(String city) { - StringBuilder sb = new StringBuilder(); - sb.append("" - + "" - + " " - + "" + city - + " " - + ""); - return sb.toString(); - } - - private static InputStream getSoapInputStream(String city) throws Exception { - try { - String soap = getSoapRequest(city); - if (soap == null) { - return null; - } - URL url = new URL( - "http://www.webxml.com.cn/WebServices/WeatherWS.asmx"); - URLConnection conn = url.openConnection(); - conn.setUseCaches(false); - conn.setDoInput(true); - conn.setDoOutput(true); - - conn.setRequestProperty("Content-Length", Integer.toString(soap - .length())); - conn.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); - conn.setRequestProperty("SOAPAction", - "http://WebXml.com.cn/getWeather"); - - OutputStream os = conn.getOutputStream(); - OutputStreamWriter osw = new OutputStreamWriter(os, "utf-8"); - osw.write(soap); - osw.flush(); - osw.close(); - - InputStream is = conn.getInputStream(); - return is; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - public static String getWeather(String city) { - try { - Document doc; - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - DocumentBuilder db = dbf.newDocumentBuilder(); - InputStream is = getSoapInputStream(city); - doc = db.parse(is); - NodeList nl = doc.getElementsByTagName("string"); - StringBuffer sb = new StringBuffer(); - String value = ""; - String[] array = new String[]{}; - for (int count = 0; count < nl.getLength(); count++) { - Node n = nl.item(count); - if(n.getFirstChild().getNodeValue().equals("查询结果为空!")) { - sb = new StringBuffer("#") ; - break ; - } - if(n.getFirstChild().toString().contains("今日天气实况")){ - value = n.getFirstChild().getNodeValue(); - System.out.println(n.getFirstChild().getNodeValue()); - value = value.substring(value.indexOf(":")+1, value.length()); - value = value.replace(":", ":"); - value = value.replace(";", ";"); - value = value.replace("/", "-"); -// JSONObject jsonObject = JSONObject.fromObject(value); -// System.out.println(jsonObject); - } - sb.append(n.getFirstChild().getNodeValue() + "#"); - } - array = sb.toString().split("#"); - value = "天气:"+array[7].substring(array[7].indexOf(" ")+1, array[7].length())+";"+value; -// value = "{天气:"+array[7].substring(array[7].indexOf(" ")+1, array[7].length())+";"+value+"}"; - -// System.out.println(value); - is.close(); - //System.out.println(sb); -// return sb.toString(); - return value; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - public static String getWeatherRes(String city){ - String weather = getWeather(city); - String[] wea = weather.split(";"); - String aString = "{"; - for(int i=0;i>>>>>>>>>> xxl-job config init."); - XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); - /*xxlJobSpringExecutor.setAdminAddresses(adminAddresses); - xxlJobSpringExecutor.setAppName(appName); - xxlJobSpringExecutor.setIp(ip); - xxlJobSpringExecutor.setPort(port); - xxlJobSpringExecutor.setAccessToken(accessToken); - xxlJobSpringExecutor.setLogPath(logPath); - xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);*/ - return xxlJobSpringExecutor; - } - - /** - * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP; - * - * 1、引入依赖: - * - * org.springframework.cloud - * spring-cloud-commons - * ${version} - * - * - * 2、配置文件,或者容器启动变量 - * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' - * - * 3、获取IP - * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); - */ - - -} diff --git a/src/com/sipai/tools/cs.java b/src/com/sipai/tools/cs.java deleted file mode 100644 index 9572628b..00000000 --- a/src/com/sipai/tools/cs.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.sipai.tools; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Date; - -class cs { - - public static void main(String[] args) { - String sdt = "2022-01-02 15:34"; - String out = sdt.substring(5,7); - System.out.println(out); - try { - Thread.sleep(1000); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - System.out.println("2"); - - } - -} diff --git a/src/com/sipai/tools/jep/Max.java b/src/com/sipai/tools/jep/Max.java deleted file mode 100644 index 31594dc8..00000000 --- a/src/com/sipai/tools/jep/Max.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sipai.tools.jep; - -import com.singularsys.jep.EvaluationException; -import com.singularsys.jep.functions.NaryFunction; - -/** - * @Auther: wxp - * @Date: 2021/8/6 14:19 - * @Description: - */ -public class Max extends NaryFunction { - private static final long serialVersionUID = 7234466721725129972L; - // Use default constructor: variable number of arguments - - // Ensure at least one argument - //此处实际参数个数是4,此处并未做相关的判断 n == 4 ? true : false - @Override - public boolean checkNumberOfParameters(int n) { - return true; - } - - //处理方法及相应的入参 - public Object eval(Object[] args) throws EvaluationException { - int lenth =args.length; - double res=asDouble(0,args[0]); - for (int i = 1; i < lenth; i++) { - double now=asDouble(i,args[i]); - if (resnow){ - res =now; - } - } - - return res; - } - - - -} \ No newline at end of file diff --git a/src/com/sipai/webservice/client/equipment/EquipmentClient.java b/src/com/sipai/webservice/client/equipment/EquipmentClient.java deleted file mode 100644 index 5d5bcf0b..00000000 --- a/src/com/sipai/webservice/client/equipment/EquipmentClient.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sipai.webservice.client.equipment; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.rmi.RemoteException; -import java.util.Properties; - -import javax.xml.namespace.QName; -import javax.xml.rpc.ParameterMode; - -import org.apache.avalon.framework.service.ServiceException; -import org.apache.axis.AxisFault; -import org.apache.axis.client.Call; -import org.apache.cxf.ws.addressing.Names; - -import com.google.common.collect.Table.Cell; -import com.sipai.service.msg.MsgServiceImpl; - -public class EquipmentClient { - /** - * 查询设备在GIS中的坐标 - * @param connectIdStr 设备编号 - * @param URI 查询地址 - * @return - * @throws ServiceException - * @throws javax.xml.rpc.ServiceException - * @throws IOException - */ - public String getGISCoordinate(String connectIdStr,String URL) throws ServiceException, javax.xml.rpc.ServiceException, IOException{ - //设备坐标 - String equipmentCoordinate=""; - String targetNamespace = this.getGISData("TargetNamespace");// "http://webservice接口所在的包名,逆序,一直到src下" - String methodName = this.getGISData("MethodName");// 所调用接口的方法method - try { - org.apache.axis.client.Service service = new org.apache.axis.client.Service(); - Call call = (Call) service.createCall(); - //xml文件中service name的地址 :http://132.120.132.241:8080/ZHSWELM/services/equipmentService - call.setTargetEndpointAddress(new java.net.URL(URL)); - call.setOperationName(new QName(targetNamespace, methodName)); - call.setUseSOAPAction(true); - //GIS系统接收参数 - call.addParameter(new QName(targetNamespace, "connectIdStr"), org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); - call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型 - equipmentCoordinate = (String) call.invoke(new java.lang.Object[] {connectIdStr}); - - } catch (RemoteException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return equipmentCoordinate; - } - - - /** - * 获取GIS系统配置文件信息,地址,方法名等 - * @param key 参数名 - * @return - * @throws IOException - */ - public String getGISData(String key) throws IOException{ - InputStream inStream = MsgServiceImpl.class.getClassLoader().getResourceAsStream("GIS.properties"); - Properties prop = new Properties(); - prop.load(inStream); - return prop.getProperty(key); - } - -} diff --git a/src/com/sipai/webservice/client/user/UserClient.java b/src/com/sipai/webservice/client/user/UserClient.java deleted file mode 100644 index b7a97b49..00000000 --- a/src/com/sipai/webservice/client/user/UserClient.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.sipai.webservice.client.user; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import net.sf.json.JSONArray; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMNode; -import org.apache.axis2.AxisFault; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.client.Options; -import org.apache.axis2.rpc.client.RPCServiceClient; - -import com.sipai.entity.user.Role; -import com.sipai.entity.user.User; - -public class UserClient { - @SuppressWarnings("rawtypes") - public User getUserByWS(String userId) throws AxisFault { - EndpointReference targetEPR = new EndpointReference("http://127.0.0.1:8080/PlantEngine_RLD/services/userService"); - RPCServiceClient sender = new RPCServiceClient(); - Options options = sender.getOptions(); - options.setTimeOutInMilliSeconds(2*20000L);//超时时间20s - options.setTo(targetEPR); - /** - * RPCServiceClient类的invokeBlocking方法调用了WebService中的方法。 - * invokeBlocking方法有三个参数 - * 第一个参数的类型是QName对象,表示要调用的方法名; - * 第二个参数表示要调用的WebService方法的参数值,参数类型为Object[]; - * 第三个参数表示WebService方法的返回值类型的Class对象,参数类型为Class[]。 - * - * 当方法没有参数时,invokeBlocking方法的第二个参数值不能是null,而要使用new Object[]{}。 - */ - QName qname = new QName("http://user.server.webservice.sipai.com", "getUserById"); - Object[] param = new Object[]{userId}; - //这是针对返值类型的 - Class[] types = new Class[]{User.class}; - - //方法一 传递参数,调用服务,获取服务返回结果集 【需要自己解析xml,如下:】    - OMElement element = sender.invokeBlocking(qname, param); - //获取跟路径 - Iterator iterator = element.getChildElements(); - User user1 = new User(); - while (iterator.hasNext()) { - //一级子节点【本例到达返回参数区】 - OMNode omNode = (OMNode) iterator.next(); - if (omNode.getType() == OMNode.ELEMENT_NODE) { - OMElement omElement = (OMElement) omNode; - if (omElement.getLocalName().equals("return")) { - //二级子节点【本例到达User对象区】 - Iterator userIterator = omElement.getChildElements(); - while(userIterator.hasNext()){ - OMNode userNode = (OMNode) userIterator.next(); - if (userNode.getType() == OMNode.ELEMENT_NODE) { - OMElement userElement = (OMElement) userNode; - //本例为演示使用,字段不再一一写出,注意不同数据类型的转换 - if (userElement.getLocalName().equals("id")){ - String id = userElement.getText().trim(); - user1.setName(id); - } - if (userElement.getLocalName().equals("name")){ - String name = userElement.getText().trim(); - user1.setName(name); - } - if (userElement.getLocalName().equals("cardid")){ - String cardid = userElement.getText().trim(); - user1.setName(cardid); - } - if (userElement.getLocalName().equals("roles")){ - //三级子节点【本例到达Role对象区】 - Iterator roleIterator = userElement.getChildElements(); - List roles = new ArrayList(); - while(roleIterator.hasNext()){ - OMNode roleNode = (OMNode) roleIterator.next(); - if (roleNode.getType() == OMNode.ELEMENT_NODE) { - Role role = new Role(); - OMElement roleElement = (OMElement) roleNode; - if (roleElement.getLocalName().equals("id")){ - String id = roleElement.getText().trim(); - role.setName(id); - } - if (roleElement.getLocalName().equals("name")){ - String name = roleElement.getText().trim(); - role.setName(name); - } - roles.add(role); - } - } - user1.setRoles(roles); - } - } - } - } - } - - } - //测试方法一 - JSONArray json=JSONArray.fromObject(user1); - String result="{\"rows\":"+json+"}"; - //System.out.println(result); - //方法二 传递参数,调用服务,获取服务返回对象集  - Object[] response = sender.invokeBlocking(qname, param, types); - User user2 = (User)response[0]; - /** - * 说明:实际使用中请根据需要选择者方法,本案例中返回值方法一对应user1,方法二对应user2 - */ - return user2; - } -} diff --git a/src/com/sipai/webservice/server/equipment/equipmentManagerServer.java b/src/com/sipai/webservice/server/equipment/equipmentManagerServer.java deleted file mode 100644 index 1940b155..00000000 --- a/src/com/sipai/webservice/server/equipment/equipmentManagerServer.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.sipai.webservice.server.equipment; - -import java.math.BigDecimal; -import java.util.List; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.equipment.EquipmentCardProp; -import com.sipai.entity.sparepart.Stock; -import com.sipai.entity.user.Company; -import com.sipai.entity.user.Unit; -import com.sipai.entity.user.User; -import com.sipai.service.base.LoginService; -import com.sipai.service.equipment.EquipmentCardPropService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.sparepart.StockService; -import com.sipai.service.user.UnitService; -import com.sipai.service.user.UnitServiceImpl; -import com.sipai.service.user.UserService; -import com.sipai.tools.CommString; -import com.sipai.tools.SpringContextUtil; - -public class equipmentManagerServer { - /** - * 获取所有的公司,厂区树状结构 - */ - public String getCompanys() { - try { - UnitServiceImpl unitServiceImpl = (UnitServiceImpl) SpringContextUtil.getBean("unitServiceImpl"); - List list = unitServiceImpl.getAllCompanyNode(); - String jsonCompanys = unitServiceImpl.getTreeList(null, list); - String result = "{\"success\":true,\"msg\":\"查询执行成功\",\"data\":"+jsonCompanys+"}"; - return result; - } catch (RuntimeException e) { - String result = "{\"success\":false,\"msg\":\"查询执行失败\"}"; - return result; - } - } - - /** - * 备件库存查询接口 - * @param companyId 厂区id - * @param goodsName 物品名称 (可选) - * @return - */ - public String getStockByCompanyId(String companyId,String goodsName) { - try { - StockService stockService = (StockService) SpringContextUtil.getBean("stockService"); - String orderstr = " order by s.insdt desc"; - String wherestr = " 1=1 and biz_id = '"+companyId+"' ";//mapper的selectListByWhere方法有了where 这里不需要加where - if (goodsName != null && !goodsName.isEmpty()) { - wherestr += " and name like '%"+goodsName+"%'"; - } - List list = stockService.selectListByWhere(wherestr+orderstr); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"success\":true,\"msg\":\"查询执行成功\",\"data\":"+jsonArray+"}"; - return result; - } catch (RuntimeException e) { - String result = "{\"success\":false,\"msg\":\"查询执行失败\"}"; - return result; - } - } - - /** - * 设备台账信息查询接口 - * @param companyId 厂区id - * @param equipmentName 设备名称(可选) - * @return - */ - public String getEquipmentCardByCompanyId(String companyId,String equipmentName) { - try { - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - String orderstr = " order by insdt desc"; - String wherestr = " where 1=1 and bizId = '"+companyId+"' "; - if (equipmentName != null && !equipmentName.isEmpty()) { - wherestr += " and equipmentName like '%"+equipmentName+"%'"; - } - List list = equipmentCardService.selectListByWhereForGIS(wherestr+orderstr); - JSONArray jsonArray = JSONArray.fromObject(list); - String result = "{\"success\":true,\"msg\":\"查询执行成功\",\"data\":"+jsonArray+"}"; - return result; - } catch (RuntimeException e) { - String result = "{\"success\":false,\"msg\":\"查询执行失败\"}"; - return result; - } - } - - /** - * 公司水厂资产查询接口 - * 有设备编号时,反馈设备的资产原值,剩余价值;无设备编号时,显示公司的设备总资产原值和总剩余价值。 - * @param companyId 厂区id - * @param equipmentNumber 设备编号 (可选) - * @param equipmentName 设备名称(可选) - * @return - */ - public String getEquipmentAsset(String companyId,String equipmentNumber,String equipmentName) { - try { - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - EquipmentCardPropService equipmentCardPropService = (EquipmentCardPropService) SpringContextUtil.getBean("equipmentCardPropService"); - //资产原值 - BigDecimal originalValue = new BigDecimal(0); - //剩余价值 - BigDecimal currentValue = new BigDecimal(0); - if (equipmentNumber != null && !equipmentNumber.isEmpty()) { - - EquipmentCard equipmentCard = equipmentCardService.getEquipmentByEquipmentCardId(equipmentNumber); - if (null != equipmentCard) { - EquipmentCardProp cardProp = equipmentCardPropService.selectByEquipmentId(equipmentCard.getId()); - originalValue = equipmentCard.getEquipmentvalue(); - currentValue = cardProp.getCurrentValue(); - } - - }else { - - String wherestr = "where 1=1 and bizId = '"+companyId+"' "; - if (equipmentName != null && !equipmentName.isEmpty()) { - wherestr += " and equipmentName like '%"+equipmentName+"%'"; - } - List list = equipmentCardService.selectListByWhereForGIS(wherestr); - for (EquipmentCard equipmentCard :list) { - if (null != equipmentCard) { - EquipmentCardProp cardProp = equipmentCardPropService.selectByEquipmentId(equipmentCard.getId()); - if (null != equipmentCard.getEquipmentvalue()) { - originalValue.add(equipmentCard.getEquipmentvalue()); - } - if (null != cardProp.getCurrentValue()) { - currentValue.add(cardProp.getCurrentValue()); - } - } - } - } - String result = "{\"success\":true,\"msg\":\"查询执行成功\",\"originalValue\":"+originalValue+",\"currentValue\":"+currentValue+"}"; - return result; - } catch (RuntimeException e) { - String result = "{\"success\":false,\"msg\":\"查询执行失败\"}"; - return result; - } - } - - - - /** - * 获取gis坐标,测试 - */ - public String getGISTest(String connectIdStr) { - try { - String result = "{\"success\": true,\"msg\": \"查询执行成功\"," - + "\"data\": [{\"connectid\": \"101100902211400001\",\"locationx\": \"111\",\"locationy\": \"111\"}," - + "{\"connectid\": \"101100902110200019\",\"locationx\": \"222\",\"locationy\": \"222\"}," - + "{\"connectid\": \"101100902110200021\", \"locationx\": \"333\",\"locationy\": \"333\"}]}"; - return result; - } catch (RuntimeException e) { - String result = "{\"success\":false,\"msg\":\"查询执行失败\"}"; - return result; - } - } - -} diff --git a/src/com/sipai/webservice/server/msg/ScadaAlarmServer.java b/src/com/sipai/webservice/server/msg/ScadaAlarmServer.java deleted file mode 100644 index aedf88d7..00000000 --- a/src/com/sipai/webservice/server/msg/ScadaAlarmServer.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.sipai.webservice.server.msg; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArraySet; - -import javax.annotation.Resource; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.alibaba.fastjson.JSON; - -import jodd.servlet.URLDecoder; - -import com.sipai.entity.scada.ScadaAlarm; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.user.User; -import com.sipai.entity.work.KPIPointProfessor; -import com.sipai.entity.work.KPIPointProfessorParam; -import com.sipai.service.msg.MsgServiceImpl; -import com.sipai.service.user.UnitServiceImpl; -import com.sipai.service.work.KPIPointProfessorParamService; -import com.sipai.service.work.KPIPointProfessorService; -import com.sipai.service.scada.MPointService; -import com.sipai.tools.CommString; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import com.sipai.websocket.ScadaWebSocket; - -public class ScadaAlarmServer { - private final String MsgType_Both ="ALARM"; - public void proAlarm(String id,String type) { -// UserService userService = (UserService) SpringContextUtil.getBean("userService"); -// User user=userService.getUserById(""); -// Desktop desktop = Desktop.getDesktop(); -// if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) { -// URI uri = URI.create("http://132.120.136.245:8080/PlantEngine_RLD"); -// try { -// desktop.browse(uri); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// } -// RemindUtil remindUtil=new RemindUtil(); -// remindUtil.VersionUtil("报警信息提醒",id+"测量点异常","异常异常"); - String charSet = CommUtil.getEncoding(type); - try { - byte[] b = type.getBytes(charSet); - type = new String(b, "UTF-8"); - } catch (Exception e) { - // TODO: handle exception - } - - System.out.println(type); - try { - for(Map item: ScadaWebSocket.webSocketSet){ - if(item.get("key").equals(CommString.Alarm_PRO)){ - try { - ((ScadaWebSocket)item.get("ws")).sendMessage(CommString.Alarm_PRO); - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /*** - * 获取报警信息 水厂所有人员发送报警消息 - * @param bizid - * @param mPointCode - * @param processSectionName - * @param describe - * @param insdt - * @param status - * @return - */ - public int sendAlarmMsg(String bizid,String mPointCode,String processSectionName,String describe,String insdt,String status) { - - //System.out.println(CommUtil.getEncoding(processSectionName)); - //processSectionName = URLDecoder.decode(processSectionName,"ISO-8859-1"); - - try { - //System.out.println(CommUtil.getEncoding(processSectionName)); - if(!CommUtil.getEncoding(processSectionName).equals("GB2312")){ - processSectionName = new String( processSectionName.getBytes( CommUtil.getEncoding(processSectionName) ), "utf8" ); - describe = new String( describe.getBytes( CommUtil.getEncoding(describe) ), "utf8" ); - status = new String( status.getBytes( CommUtil.getEncoding(status) ), "utf8" ); - } - String content = "";//报警内容 - //获取测量点名称 - MPointService mPointService = (MPointService)SpringContextUtil.getBean("MPointService"); - List mPoint = mPointService.selectListByWhere(bizid, " where MPointCode = '"+mPointCode+"'"); - if(mPoint!=null&&mPoint.size()!=0){ - content += mPoint.get(0).getParmname(); - } - content += " 于"+ insdt+" 发生"+describe + "("+status+")"; - - /*if(status.equals(ScadaAlarm.STATUS_ALARM)){ - content += "(报警)!"; - }else if(status.equals(ScadaAlarm.STATUS_ALARM_CONFIRM)){ - content += "(报警确认)!"; - }else if(status.equals(ScadaAlarm.STATUS_ALARM_RECOVER)){ - content += "(报警恢复)!"; - }*/ - //获取厂区所有人员 - UnitServiceImpl unitService = (UnitServiceImpl)SpringContextUtil.getBean("unitServiceImpl"); - List users = unitService.getChildrenUsersById(bizid); - String userIds=""; - for (User user : users) { - if (!userIds.isEmpty()) { - userIds+=","; - } - userIds+=user.getId(); - } - MsgServiceImpl msgService = (MsgServiceImpl) SpringContextUtil.getBean("msgService"); - msgService.insertMsgSend(MsgType_Both, content, userIds, "emp01", "U"); - //msgService.sendMessage("ALARM", 2 , content, "emp01"); - - /*//获取水厂所有人员 - UnitServiceImpl unitService = (UnitServiceImpl)SpringContextUtil.getBean("unitServiceImpl"); - List users = unitService.getChildrenUsersById(bizid); - for(int i=0;i0){ - JSONArray jsonarr1 = jsonobj.getJSONArray("kPIPointProfessorParam"); - for(int j=0;j users = unitService.getChildrenUsersById(kPIPointProfessor.getBizId()); - for(int k=0;k list = mPointService.selectListByWhere(id," where type='kpi'"); - JSONArray json=JSONArray.fromObject(list); - return json.toString(); - } - /** - * 向专家系统发送历史测量点 - * @param id - * @param ids - * @param sdt - * @param edt - * @return - */ - public String sendMpointHistoryMsg(String id,String ids,String sdt,String edt){ - MPointHistoryService mPointHistoryService = (MPointHistoryService)SpringContextUtil.getBean("MPointHistoryService"); - JSONArray jsonarr=new JSONArray(); - String[] idarr = ids.split(","); - for(int j=0;j list = mPointHistoryService.selectListByTableAWhere(id,"[TB_MP_"+idarr[j]+"]"," where MeasureDT >= '"+sdt+"' and MeasureDT<= '"+edt+"' order by MeasureDT"); - //DataSourceHolder.setDataSources(DataSources.MASTER); - JSONArray json=new JSONArray(); - if (list.size()>0) { - json=JSONArray.fromObject(list); - - } - - jsonarr.add(json); - } - return jsonarr.toString(); - } -} - - diff --git a/src/com/sipai/webservice/server/user/TestServer.java b/src/com/sipai/webservice/server/user/TestServer.java deleted file mode 100644 index bb3d1c05..00000000 --- a/src/com/sipai/webservice/server/user/TestServer.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.sipai.webservice.server.user; - -public class TestServer { - - public String sayHello(String word) { - return word; - } -} diff --git a/src/com/sipai/webservice/server/user/UserServer.java b/src/com/sipai/webservice/server/user/UserServer.java deleted file mode 100644 index 53801991..00000000 --- a/src/com/sipai/webservice/server/user/UserServer.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.sipai.webservice.server.user; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.servlet.ModelAndView; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.sipai.entity.user.User; -import com.sipai.service.base.LoginService; -import com.sipai.service.user.UserService; -import com.sipai.tools.SpringContextUtil; -public class UserServer { - - public User getUserById(String userId) { - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - return userService.getUserById(userId); - } - - public void postuser(String userId) { - UserService userService = (UserService) SpringContextUtil.getBean("userService"); - User user=userService.getUserById(userId); - } - //登录接口 - public String login(String name, String pwd) { - User cu = new User(); - LoginService loginService = (LoginService) SpringContextUtil.getBean("loginServiceImpl"); - if(name!=null && name!=null){ - cu= loginService.Login(name, pwd); - } - if (null != cu) { - JSONObject jsob = JSONObject.fromObject(cu); - return "{\"result\":\"pass\",\"userinfo\":" +jsob.toString()+ "}"; - } else { - return "{\"result\":\"fail\"}"; - } - - } -} diff --git a/src/com/sipai/webservice/server/work/getSSOldOPMDataServer.java b/src/com/sipai/webservice/server/work/getSSOldOPMDataServer.java deleted file mode 100644 index 15e507df..00000000 --- a/src/com/sipai/webservice/server/work/getSSOldOPMDataServer.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.sipai.webservice.server.work; - -import java.math.BigDecimal; -import java.util.List; - -import javax.security.auth.message.callback.PrivateKeyCallback.Request; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import com.lowagie.tools.split_pdf; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.MPointHistory; -import com.sipai.entity.user.Unit; -import com.sipai.service.scada.MPointHistoryService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.user.UnitServiceImpl; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; - -public class getSSOldOPMDataServer { - /** - * - */ - public String getDatas(String content,String bizid,String rptDt) { - try { - String[] datas=content.split(","); - String outString=""; - if(datas!=null&&datas.length>0){ - for(int i=0;i0){ - String mpcode=datass[0]; - String value=datass[1]; - - outString+=mpcode+":"+value+","; - - MPointService mPointService = (MPointService)SpringContextUtil.getBean("MPointService"); - MPoint mPoint = mPointService.selectById(bizid,mpcode); - if(mPoint!=null){ - mPoint.setParmvalue(new BigDecimal(value)); - mPoint.setMeasuredt(rptDt); - mPointService.update(bizid, mPoint); - } - - MPointHistoryService mPointHistoryService = (MPointHistoryService) SpringContextUtil.getBean("MPointHistoryService"); - List mphislist=mPointHistoryService.selectListByTableAWhere(bizid, "TB_MP_"+mpcode, " where datediff(day,MeasureDT,'"+rptDt+"')=0"); - if(mphislist!=null&&mphislist.size()>0){ - }else{ - MPointHistory mPointHistory = new MPointHistory(); - mPointHistory.setParmvalue(new BigDecimal(value)); - mPointHistory.setMeasuredt(rptDt); - mPointHistory.setTbName("[TB_MP_"+mpcode+"]"); - mPointHistoryService.save(bizid, mPointHistory); - } - - } - - } - } - String result = "{\"success\":true,\"msg\":\"执行成功\",\"content\":\""+outString+"\"}"; - System.out.println("{\"success\":true,\"msg\":\"执行成功\",\"content\":\""+outString+"\"}"); - return result; - } catch (RuntimeException e) { - String result = "{\"success\":false,\"msg\":\"执行失败\"}"; - System.out.println("{\"success\":false,\"msg\":\"执行失败\"}"); - return result; - } - } - - -} diff --git a/src/com/sipai/websocket/AjaxResult.java b/src/com/sipai/websocket/AjaxResult.java deleted file mode 100644 index fd7d98f4..00000000 --- a/src/com/sipai/websocket/AjaxResult.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.sipai.websocket; - -import java.util.HashMap; - -import org.apache.commons.lang3.ObjectUtils; - -public class AjaxResult extends HashMap{ - - private static final long serialVersionUID = 1L; - - /** - * 状态码 - */ - public static final String CODE_TAG = "code"; - - /** - * 返回内容 - */ - public static final String MSG_TAG = "msg"; - - /** - * 数据对象 - */ - public static final String DATA_TAG = "data"; - - /** - * 状态类型 - */ - public enum Type { - /** - * 成功 - */ - SUCCESS(0), - SUCCESS_IMG_BYTE(201), - /** - * 警告 - */ - WARN(301), - /** - * 错误 - */ - ERROR(500); - private final int value; - - Type(int value) { - this.value = value; - } - - public int value() { - return this.value; - } - } - - /** - * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 - */ - public AjaxResult() { - } - - /** - * 初始化一个新创建的 AjaxResult 对象 - * - * @param type 状态类型 - * @param msg 返回内容 - */ - public AjaxResult(Type type, String msg) { - super.put(CODE_TAG, type.value); - super.put(MSG_TAG, msg); - } - - /** - * 初始化一个新创建的 AjaxResult 对象 - * - * @param type 状态类型 - * @param msg 返回内容 - * @param data 数据对象 - */ - public AjaxResult(Type type, String msg, Object data) { - super.put(CODE_TAG, type.value); - super.put(MSG_TAG, msg); - if (data!=null) { - super.put(DATA_TAG, data); - } - } - - /** - * 返回成功消息 - * - * @return 成功消息 - */ - public static AjaxResult success() { - return AjaxResult.success("操作成功"); - } - - /** - * 返回成功数据 - * - * @return 成功消息 - */ - public static AjaxResult success(Object data) { - return AjaxResult.success("操作成功", data); - } - - /** - * 返回成功消息 - * - * @param msg 返回内容 - * @return 成功消息 - */ - public static AjaxResult success(String msg) { - return AjaxResult.success(msg, null); - } - - /** - * 返回成功消息 - * - * @param msg 返回内容 - * @param data 数据对象 - * @return 成功消息 - */ - public static AjaxResult success(String msg, Object data) { - return new AjaxResult(Type.SUCCESS, msg, data); - } - - /** - * 返回警告消息 - * - * @param msg 返回内容 - * @return 警告消息 - */ - public static AjaxResult warn(String msg) { - return AjaxResult.warn(msg, null); - } - - /** - * 返回警告消息 - * - * @param msg 返回内容 - * @param data 数据对象 - * @return 警告消息 - */ - public static AjaxResult warn(String msg, Object data) { - return new AjaxResult(Type.WARN, msg, data); - } - - /** - * 返回错误消息 - * - * @return - */ - public static AjaxResult error() { - return AjaxResult.error("操作失败"); - } - - /** - * 返回错误消息 - * - * @param msg 返回内容 - * @return 警告消息 - */ - public static AjaxResult error(String msg) { - return AjaxResult.error(msg, null); - } - - /** - * 返回错误消息 - * - * @param msg 返回内容 - * @param data 数据对象 - * @return 警告消息 - */ - public static AjaxResult error(String msg, Object data) { - return new AjaxResult(Type.ERROR, msg, data); - } -} diff --git a/src/com/sipai/websocket/AlarmWebSocket.java b/src/com/sipai/websocket/AlarmWebSocket.java deleted file mode 100644 index 6ff6421c..00000000 --- a/src/com/sipai/websocket/AlarmWebSocket.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.websocket; - -import javax.websocket.*; -import javax.websocket.server.ServerEndpoint; -import java.io.IOException; -import java.util.concurrent.CopyOnWriteArraySet; - -@ServerEndpoint("/AlarmWebSocket/") -public class AlarmWebSocket { - public static CopyOnWriteArraySet webSockets = - new CopyOnWriteArraySet(); - private Session session; - - @OnOpen - public void onOpen(Session session,EndpointConfig config) throws IOException{ - //System.out.println("kaiqi"); - this.session = session; - webSockets.add(this); //加入set中 - } - - @OnClose - public void onClose(){ - webSockets.remove(this); //从set中删除 - } - - @OnMessage - public void onMessage(String message,Session session) throws IOException { - for(AlarmWebSocket item:webSockets){ - item.sendMessage(message); - } - } - - @OnError - public void onError(Session session, Throwable error){ - System.out.println("发生错误"); - error.printStackTrace(); - } - - public void sendMessage(String message) throws IOException{ - synchronized(session){ - this.session.getBasicRemote().sendText(message); - } - } -} diff --git a/src/com/sipai/websocket/BaiDuAipSpeechMessage.java b/src/com/sipai/websocket/BaiDuAipSpeechMessage.java deleted file mode 100644 index 9468a3bc..00000000 --- a/src/com/sipai/websocket/BaiDuAipSpeechMessage.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sipai.websocket; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; - -import javax.imageio.ImageIO; -import javax.websocket.EncodeException; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; - -import com.sipai.service.work.CameraService; -import com.sipai.tools.SpringContextUtil; - -@ServerEndpoint(value = "/chat/baiDuAipSpeechMessage") -public class BaiDuAipSpeechMessage { - public static CopyOnWriteArraySet webSocketSet = - new CopyOnWriteArraySet(); -// public static ConcurrentHashMap webSocketSet -// = new ConcurrentHashMap(); - private Session session; - -// public static Map flagMap = new HashMap(); - - private String nickname = "实时语音识别"; - -// CameraService cameraService = (CameraService) SpringContextUtil. -// getBean("cameraService", CameraService.class); - - @OnOpen - public void onOpen(Session session,EndpointConfig config) throws IOException{ - this.session = session; - - webSocketSet.add(this); - - System.out.println(nickname + "已连接"); - sendMessage(nickname + "已连接"); - } - - @OnClose - public void onClose() throws IOException{ - System.out.println(nickname + "已断开"); -// sendMessage(nickname + "已断开"); - webSocketSet.remove(this); //从set中删除 - } - - @OnMessage - public void onMessage(String message,Session session) throws InterruptedException, IOException { - System.out.println(nickname + "发送内容:" + message); - for (BaiDuAipSpeechMessage item:BaiDuAipSpeechMessage.webSocketSet) { - item.sendMessage(message); - } -// sendMessage(message); - } - - @OnError - public void onError(Session session, Throwable error){ - System.out.println("发生错误"); - error.printStackTrace(); - } - - public void sendMessage(String message) throws IOException{ - this.session.getBasicRemote().sendText(message); - } - - -} diff --git a/src/com/sipai/websocket/MsgWebSocket.java b/src/com/sipai/websocket/MsgWebSocket.java deleted file mode 100644 index 9b9fe173..00000000 --- a/src/com/sipai/websocket/MsgWebSocket.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.sipai.websocket; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArraySet; - -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; - -/** - * @ServerEndpoint 注解是一个类层次的注解,它的功能主要是将目前的类定义成一个websocket服务器端, - * 注解的值将被用于监听用户连接的终端访问URL地址,客户端可以通过这个URL来连接到WebSocket服务器端 - */ -@ServerEndpoint("/msgWebSocket/{userId}") -public class MsgWebSocket { - //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 - private static int onlineCount = 0; - - //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。若要实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key可以为用户标识 - public static CopyOnWriteArraySet> webSocketSet = new CopyOnWriteArraySet>(); - //与某个客户端的连接会话,需要通过它来给客户端发送数据 - private Session session; - - /** - * 连接建立成功调用的方法 - * @param session 可选的参数。session为与某个客户端的连接会话,需要通过它来给客户端发送数据 - */ - @OnOpen - public void onOpen(@PathParam(value="userId") String userId,Session session){ - this.session = session; - Map itemMap =new HashMap(); - itemMap.put("key", userId); - itemMap.put("ws", this); - webSocketSet.add(itemMap); //加入set中 - addOnlineCount(); //在线数加1 - System.out.println("有新连接加入!当前在线人数为" + getOnlineCount()); - } - - /** - * 连接关闭调用的方法 - */ - @OnClose - public void onClose(){ - for(Map item: webSocketSet){ - if(((MsgWebSocket)item.get("ws"))==this){ - webSocketSet.remove(item); //从set中删除 - subOnlineCount(); //在线数减1 - System.out.println("有一连接关闭!当前需消息提醒在线人数为" + getOnlineCount()); - break; - } - } - - } - - /** - * 收到客户端消息后调用的方法 - * @param message 客户端发送过来的消息 - * @param session 可选的参数 - */ - @OnMessage - public void onMessage(String message, Session session) { - System.out.println("来自客户端的消息:" + message); - //群发消息 - for(Map item: webSocketSet){ - try { - MsgWebSocket wss =(MsgWebSocket)item.get("ws"); - synchronized(wss) { - wss.sendMessage(message); - } - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - - /** - * 发生错误时调用 - * @param session - * @param error - */ - @OnError - public void onError(Session session, Throwable error){ - System.out.println("发生错误"); - error.printStackTrace(); - } - - /** - * 这个方法与上面几个方法不一样。没有用注解,是根据自己需要添加的方法。 - * @param message - * @throws IOException - */ - public void sendMessage(String message) throws IOException{ - synchronized (session){ - this.session.getBasicRemote().sendText(message); - } - //this.session.getAsyncRemote().sendText(message); - } - - public static synchronized int getOnlineCount() { - return onlineCount; - } - - public static synchronized void addOnlineCount() { - MsgWebSocket.onlineCount++; - } - - public static synchronized void subOnlineCount() { - MsgWebSocket.onlineCount--; - } -} diff --git a/src/com/sipai/websocket/MsgWebSocket2.java b/src/com/sipai/websocket/MsgWebSocket2.java deleted file mode 100644 index 25db1d90..00000000 --- a/src/com/sipai/websocket/MsgWebSocket2.java +++ /dev/null @@ -1,261 +0,0 @@ -package com.sipai.websocket; - -import com.sipai.entity.bim.BimRouteData; -import com.sipai.entity.bim.BimRouteEqData; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.bim.BimRouteDataService; -import com.sipai.service.bim.BimRouteEqDataService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import net.sf.json.JSONArray; - -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArraySet; - -/** - * 提供BIM使用 平台继续使用 msgWebSocket - */ -@ServerEndpoint("/msgWebSocket2/{userId}") -public class MsgWebSocket2 { - BimRouteDataService bimRouteDataService = (BimRouteDataService) SpringContextUtil.getBean("bimRouteDataService"); - BimRouteEqDataService bimRouteEqDataService = (BimRouteEqDataService) SpringContextUtil.getBean("bimRouteEqDataService"); - ProAlarmService proAlarmService = (ProAlarmService) SpringContextUtil.getBean("proAlarmService"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - - //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 - private static int onlineCount = 0; - - //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。若要实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key可以为用户标识 - public static CopyOnWriteArraySet> webSocketSet = new CopyOnWriteArraySet>(); - //与某个客户端的连接会话,需要通过它来给客户端发送数据 - private Session session; - - /** - * 连接建立成功调用的方法 - * - * @param session 可选的参数。session为与某个客户端的连接会话,需要通过它来给客户端发送数据 - */ - @OnOpen - public void onOpen(@PathParam(value = "userId") String userId, Session session) { - this.session = session; - Map itemMap = new HashMap(); - itemMap.put("key", userId); - itemMap.put("ws", this); - webSocketSet.add(itemMap); //加入set中 - addOnlineCount(); //在线数加1 - System.out.println("有新连接加入!当前在线人数为" + getOnlineCount()); - } - - /** - * 连接关闭调用的方法 - */ - @OnClose - public void onClose() { - for (Map item : webSocketSet) { - if (((MsgWebSocket2) item.get("ws")) == this) { - webSocketSet.remove(item); //从set中删除 - subOnlineCount(); //在线数减1 - System.out.println("有一连接关闭!当前需消息提醒在线人数为" + getOnlineCount()); - break; - } - } - } - - /** - * 收到客户端消息后调用的方法 - * - * @param message 客户端发送过来的消息 - * @param session 可选的参数 - */ - @OnMessage - public void onMessage(String message, Session session) { - System.out.println("来自客户端的消息:" + message); - //群发消息 - for (Map item : webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(message); - } - // - try { - com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(message.toString()); - if (json != null) { - String routeCode = json.getString("routeCode"); - - if (routeCode != null) { - String unitId = json.getString("unitId"); - String eqids = json.getString("eqids"); - JSONArray eqidsjson = JSONArray.fromObject(eqids.toString()); - - bimRouteDataService.deleteByWhere("where code='" + routeCode + "' and unitId='" + unitId + "'"); - bimRouteEqDataService.deleteByWhere("where code='" + routeCode + "' and unitId='" + unitId + "'"); - - int eqTotalNum = 0; - int pointTotalNum = 0; - int alarmPointNum = 0; - int alarmEqNum = 0; - - String alarmEq = ""; - - for (int i = 0; i < eqidsjson.size(); i++) { - String eqid = (String) eqidsjson.get(i); -// System.out.println(eqid); - List equipmentCardList = equipmentCardService.selectSimpleListByWhere(" where equipmentCardID='" + eqid + "' "); -// EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(eqid); - - if (equipmentCardList != null && equipmentCardList.size() > 0) { - EquipmentCard equipmentCard = equipmentCardList.get(0); - List mPointList = mPointService.selectListByWhere(unitId, " where equipmentId='" + equipmentCard.getId() + "' "); - if (mPointList != null && mPointList.size() > 0) { - for (MPoint mPoint : - mPointList) { - List proAlarmList = proAlarmService.selectTop1ListByWhere(unitId, "where point_code = '" + mPoint.getId() + "' and (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "')"); - if (proAlarmList != null && proAlarmList.size() > 0) { - BimRouteData bimRouteData = new BimRouteData(); - bimRouteData.setId(CommUtil.getUUID()); - bimRouteData.setCode(routeCode); - bimRouteData.setEqname(equipmentCard.getEquipmentname()); - bimRouteData.setMpid(mPoint.getId()); - bimRouteData.setMpname(mPoint.getParmname()); - bimRouteData.setAlarmcontent(proAlarmList.get(0).getDescribe()); - BigDecimal parmvalue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - bimRouteData.setAlarmvalue(parmvalue.doubleValue()); - bimRouteData.setUnitid(unitId); - bimRouteData.setType("alarm"); - bimRouteDataService.save(bimRouteData); - - alarmPointNum++; - - //判断该点是否涉及到过,没涉及到+1 - if (alarmEq.indexOf(equipmentCard.getId()) != -1) { - - } else { - alarmEqNum++; - alarmEq += equipmentCard.getId() + ","; - } - - } - - BimRouteData bimRouteData2 = new BimRouteData(); - bimRouteData2.setId(CommUtil.getUUID()); - bimRouteData2.setCode(routeCode); - bimRouteData2.setEqname(equipmentCard.getEquipmentname()); - bimRouteData2.setMpid(mPoint.getId()); - bimRouteData2.setUnitid(unitId); - bimRouteData2.setType("point"); - bimRouteDataService.save(bimRouteData2); - - pointTotalNum++; - } - - } - - eqTotalNum++; - - } - - - } - - BimRouteEqData bimRouteEqData = new BimRouteEqData(); - bimRouteEqData.setId(CommUtil.getUUID()); - bimRouteEqData.setUnitid(unitId); - bimRouteEqData.setCode(routeCode); - bimRouteEqData.setEqNum(eqTotalNum); - bimRouteEqData.setPointNum(pointTotalNum); - bimRouteEqData.setAbnormalPointNum(alarmPointNum); - bimRouteEqData.setAbnormalEqNum(alarmEqNum); - bimRouteEqData.setNormalEqNum(eqTotalNum - alarmEqNum); - bimRouteEqDataService.save(bimRouteEqData); - - } else { - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - - } - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - - /** - * 推送数据给三维 定制 - * @param message - * @param session - */ - public void onMessageData(String message, Session session) { -// System.out.println("来自客户端2的消息:" + message); - //群发消息 - for (Map item : webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - MsgWebSocket2 wss = (MsgWebSocket2) item.get("ws"); - synchronized (wss) { - wss.sendMessage(message); - } - } - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - - /** - * 发生错误时调用 - * - * @param session - * @param error - */ - @OnError - public void onError(Session session, Throwable error) { - System.out.println("发生错误"); - error.printStackTrace(); - } - - /** - * 这个方法与上面几个方法不一样。没有用注解,是根据自己需要添加的方法。 - * - * @param message - * @throws IOException - */ - public void sendMessage(String message) throws IOException { - synchronized (session) { - this.session.getBasicRemote().sendText(message); - } - //this.session.getAsyncRemote().sendText(message); - } - - public static synchronized int getOnlineCount() { - return onlineCount; - } - - public static synchronized void addOnlineCount() { - MsgWebSocket2.onlineCount++; - } - - public static synchronized void subOnlineCount() { - MsgWebSocket2.onlineCount--; - } -} diff --git a/src/com/sipai/websocket/PositionsNumWebSocket.java b/src/com/sipai/websocket/PositionsNumWebSocket.java deleted file mode 100644 index 19e4d780..00000000 --- a/src/com/sipai/websocket/PositionsNumWebSocket.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.sipai.websocket; - -import javax.websocket.*; -import javax.websocket.server.ServerEndpoint; -import java.io.IOException; -import java.util.concurrent.CopyOnWriteArraySet; - -@ServerEndpoint("/PositionsNumWebSocket") -public class PositionsNumWebSocket { - public static CopyOnWriteArraySet webSockets = - new CopyOnWriteArraySet(); - private Session session; - - @OnOpen - public void onOpen(Session session,EndpointConfig config) throws IOException{ - //System.out.println("kaiqi"); - this.session = session; - webSockets.add(this); //加入set中 - } - - @OnClose - public void onClose(){ - webSockets.remove(this); //从set中删除 - } - - @OnMessage - public void onMessage(String message,Session session) throws IOException { - for(PositionsNumWebSocket item:webSockets){ - item.sendMessage(message); - } - } - - @OnError - public void onError(Session session, Throwable error){ - System.out.println("发生错误"); - error.printStackTrace(); - } - - public void sendMessage(String message) throws IOException{ - synchronized(session){ - this.session.getBasicRemote().sendText(message); - } - } -} diff --git a/src/com/sipai/websocket/ScadaWebSocket.java b/src/com/sipai/websocket/ScadaWebSocket.java deleted file mode 100644 index eb073ea9..00000000 --- a/src/com/sipai/websocket/ScadaWebSocket.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.sipai.websocket; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArraySet; - -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; - -/** - * @ServerEndpoint 注解是一个类层次的注解,它的功能主要是将目前的类定义成一个websocket服务器端, - * 注解的值将被用于监听用户连接的终端访问URL地址,客户端可以通过这个URL来连接到WebSocket服务器端 - */ -@ServerEndpoint("/websocket/{type}") -public class ScadaWebSocket { - //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 - private static int onlineCount = 0; - - //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。若要实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key可以为用户标识 -// public static CopyOnWriteArraySet webSocketSet = new CopyOnWriteArraySet(); - public static CopyOnWriteArraySet> webSocketSet = new CopyOnWriteArraySet>(); - //与某个客户端的连接会话,需要通过它来给客户端发送数据 - private Session session; - - /** - * 连接建立成功调用的方法 - * @param session 可选的参数。session为与某个客户端的连接会话,需要通过它来给客户端发送数据 - */ - @OnOpen - public void onOpen(@PathParam(value="type") String type,Session session){ - this.session = session; - Map itemMap =new HashMap(); - itemMap.put("key", type); - itemMap.put("ws", this); - webSocketSet.add(itemMap); //加入set中 - addOnlineCount(); //在线数加1 - System.out.println("有新连接加入!当前在线人数为" + getOnlineCount()); - } - - /** - * 连接关闭调用的方法 - */ - @OnClose - public void onClose(){ - for(Map item: webSocketSet){ - if(((ScadaWebSocket)item.get("ws"))==this){ - webSocketSet.remove(item); //从set中删除 - subOnlineCount(); //在线数减1 - System.out.println("有一连接关闭!当前在线人数为" + getOnlineCount()); - break; - } - } - - } - - /** - * 收到客户端消息后调用的方法 - * @param message 客户端发送过来的消息 - * @param session 可选的参数 - */ - @OnMessage - public void onMessage(String message, Session session) { - System.out.println("来自客户端的消息:" + message); - //群发消息 - for(Map item: webSocketSet){ - try { - ((ScadaWebSocket)item.get("ws")).sendMessage(message); - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - - /** - * 发生错误时调用 - * @param session - * @param error - */ - @OnError - public void onError(Session session, Throwable error){ - System.out.println("发生错误"); - error.printStackTrace(); - } - - /** - * 这个方法与上面几个方法不一样。没有用注解,是根据自己需要添加的方法。 - * @param message - * @throws IOException - */ - public void sendMessage(String message) throws IOException{ - this.session.getBasicRemote().sendText(message); - //this.session.getAsyncRemote().sendText(message); - } - - public static synchronized int getOnlineCount() { - return onlineCount; - } - - public static synchronized void addOnlineCount() { - ScadaWebSocket.onlineCount++; - } - - public static synchronized void subOnlineCount() { - ScadaWebSocket.onlineCount--; - } -} diff --git a/src/com/sipai/websocket/VisualMessage.java b/src/com/sipai/websocket/VisualMessage.java deleted file mode 100644 index 981b9261..00000000 --- a/src/com/sipai/websocket/VisualMessage.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.sipai.websocket; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; - -import javax.imageio.ImageIO; -import javax.websocket.EncodeException; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; - -import com.sipai.service.work.CameraService; -import com.sipai.tools.SpringContextUtil; - -@ServerEndpoint(value = "/chat/{userName}") -public class VisualMessage { - public static CopyOnWriteArraySet webSocketSet = - new CopyOnWriteArraySet(); -// public static ConcurrentHashMap webSocketSet -// = new ConcurrentHashMap(); - private Session session; - -// public static Map flagMap = new HashMap(); - - private String nickname = ""; - -// CameraService cameraService = (CameraService) SpringContextUtil. -// getBean("cameraService", CameraService.class); - - @OnOpen - public void onOpen(Session session,EndpointConfig config, - @PathParam(value="userName")String nickname) throws IOException{ - this.session = session; - this.nickname = nickname; - - webSocketSet.add(this); - - System.out.println(nickname + "已连接"); - sendMessage(nickname + "已连接"); - } - - @OnClose - public void onClose() throws IOException{ - System.out.println(nickname + "已断开"); -// sendMessage(nickname + "已断开"); - webSocketSet.remove(this); //从set中删除 - } - - @OnMessage - public void onMessage(String message,Session session) throws InterruptedException, IOException { - System.out.println(nickname + "发送内容:" + message); - for (VisualMessage item:VisualMessage.webSocketSet) { - item.sendMessage(message); - } -// sendMessage(message); - } - - @OnError - public void onError(Session session, Throwable error){ - System.out.println("发生错误"); - error.printStackTrace(); - } - - public void sendMessage(String message) throws IOException{ - this.session.getBasicRemote().sendText(message); - } - - -} diff --git a/src/com/sipai/websocket/WebSocketModel.java b/src/com/sipai/websocket/WebSocketModel.java deleted file mode 100644 index 6d2ff61a..00000000 --- a/src/com/sipai/websocket/WebSocketModel.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.sipai.websocket; - -import com.sipai.entity.bim.BimRouteData; -import com.sipai.entity.bim.BimRouteEqData; -import com.sipai.entity.equipment.EquipmentCard; -import com.sipai.entity.scada.MPoint; -import com.sipai.entity.scada.ProAlarm; -import com.sipai.service.bim.BimRouteDataService; -import com.sipai.service.bim.BimRouteEqDataService; -import com.sipai.service.equipment.EquipmentCardService; -import com.sipai.service.scada.MPointService; -import com.sipai.service.scada.ProAlarmService; -import com.sipai.tools.CommUtil; -import com.sipai.tools.SpringContextUtil; -import net.sf.json.JSONArray; - -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CopyOnWriteArraySet; - -/** - * 提供BIM使用 平台继续使用 msgWebSocket - */ -@ServerEndpoint("/websocketModel/{userId}") -public class WebSocketModel { - BimRouteDataService bimRouteDataService = (BimRouteDataService) SpringContextUtil.getBean("bimRouteDataService"); - BimRouteEqDataService bimRouteEqDataService = (BimRouteEqDataService) SpringContextUtil.getBean("bimRouteEqDataService"); - ProAlarmService proAlarmService = (ProAlarmService) SpringContextUtil.getBean("proAlarmService"); - MPointService mPointService = (MPointService) SpringContextUtil.getBean("mPointService"); - EquipmentCardService equipmentCardService = (EquipmentCardService) SpringContextUtil.getBean("equipmentCardService"); - - //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 - private static int onlineCount = 0; - - //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。若要实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key可以为用户标识 - public static CopyOnWriteArraySet> webSocketSet = new CopyOnWriteArraySet>(); - //与某个客户端的连接会话,需要通过它来给客户端发送数据 - private Session session; - - /** - * 连接建立成功调用的方法 - * - * @param session 可选的参数。session为与某个客户端的连接会话,需要通过它来给客户端发送数据 - */ - @OnOpen - public void onOpen(@PathParam(value = "userId") String userId, Session session) { - this.session = session; - Map itemMap = new HashMap(); - itemMap.put("key", userId); - itemMap.put("ws", this); - webSocketSet.add(itemMap); //加入set中 - addOnlineCount(); //在线数加1 - System.out.println("有新连接加入!当前在线人数为" + getOnlineCount()); - } - - /** - * 连接关闭调用的方法 - */ - @OnClose - public void onClose() { - for (Map item : webSocketSet) { - if (((WebSocketModel) item.get("ws")) == this) { - webSocketSet.remove(item); //从set中删除 - subOnlineCount(); //在线数减1 - System.out.println("有一连接关闭!当前需消息提醒在线人数为" + getOnlineCount()); - break; - } - } - } - - /** - * 收到客户端消息后调用的方法 - * - * @param message 客户端发送过来的消息 - * @param session 可选的参数 - */ - @OnMessage - public void onMessage(String message, Session session) { - System.out.println("来自客户端的消息:" + message); - //群发消息 - for (Map item : webSocketSet) { - try { - if (item.get("key").equals("BIM")) { - WebSocketModel wss = (WebSocketModel) item.get("ws"); - synchronized (wss) { - wss.sendMessage(message); - } - // - try { - com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(message.toString()); - if (json != null) { - String routeCode = json.getString("routeCode"); - - if (routeCode != null) { - String unitId = json.getString("unitId"); - String eqids = json.getString("eqids"); - JSONArray eqidsjson = JSONArray.fromObject(eqids.toString()); - - bimRouteDataService.deleteByWhere("where code='" + routeCode + "' and unitId='" + unitId + "'"); - bimRouteEqDataService.deleteByWhere("where code='" + routeCode + "' and unitId='" + unitId + "'"); - - int eqTotalNum = 0; - int pointTotalNum = 0; - int alarmPointNum = 0; - int alarmEqNum = 0; - - String alarmEq = ""; - - for (int i = 0; i < eqidsjson.size(); i++) { - String eqid = (String) eqidsjson.get(i); - System.out.println(eqid); - List equipmentCardList = equipmentCardService.selectSimpleListByWhere(" where equipmentCardID='"+eqid+"' "); -// EquipmentCard equipmentCard = equipmentCardService.selectSimpleListById(eqid); - - if (equipmentCardList != null && equipmentCardList.size()>0) { - EquipmentCard equipmentCard = equipmentCardList.get(0); - List mPointList = mPointService.selectListByWhere(unitId, " where equipmentId='" + equipmentCard.getId() + "' "); - if (mPointList != null && mPointList.size() > 0) { - for (MPoint mPoint : - mPointList) { - List proAlarmList = proAlarmService.selectTop1ListByWhere(unitId, "where point_code = '" + mPoint.getId() + "' and (status='" + ProAlarm.STATUS_ALARM + "' or status='" + ProAlarm.STATUS_ALARM_CONFIRM + "')"); - if (proAlarmList != null && proAlarmList.size() > 0) { - BimRouteData bimRouteData = new BimRouteData(); - bimRouteData.setId(CommUtil.getUUID()); - bimRouteData.setCode(routeCode); - bimRouteData.setEqname(equipmentCard.getEquipmentname()); - bimRouteData.setMpid(mPoint.getId()); - bimRouteData.setMpname(mPoint.getParmname()); - bimRouteData.setAlarmcontent(proAlarmList.get(0).getDescribe()); - BigDecimal parmvalue = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate()); - bimRouteData.setAlarmvalue(parmvalue.doubleValue()); - bimRouteData.setUnitid(unitId); - bimRouteData.setType("alarm"); - bimRouteDataService.save(bimRouteData); - - alarmPointNum++; - - //判断该点是否涉及到过,没涉及到+1 - if (alarmEq.indexOf(equipmentCard.getId()) != -1) { - - } else { - alarmEqNum++; - alarmEq += equipmentCard.getId() + ","; - } - - } - - BimRouteData bimRouteData2 = new BimRouteData(); - bimRouteData2.setId(CommUtil.getUUID()); - bimRouteData2.setCode(routeCode); - bimRouteData2.setEqname(equipmentCard.getEquipmentname()); - bimRouteData2.setMpid(mPoint.getId()); - bimRouteData2.setUnitid(unitId); - bimRouteData2.setType("point"); - bimRouteDataService.save(bimRouteData2); - - pointTotalNum++; - } - - } - - eqTotalNum++; - - } - - - } - - BimRouteEqData bimRouteEqData = new BimRouteEqData(); - bimRouteEqData.setId(CommUtil.getUUID()); - bimRouteEqData.setUnitid(unitId); - bimRouteEqData.setCode(routeCode); - bimRouteEqData.setEqNum(eqTotalNum); - bimRouteEqData.setPointNum(pointTotalNum); - bimRouteEqData.setAbnormalPointNum(alarmPointNum); - bimRouteEqData.setAbnormalEqNum(alarmEqNum); - bimRouteEqData.setNormalEqNum(eqTotalNum - alarmEqNum); - bimRouteEqDataService.save(bimRouteEqData); - - } else { - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - - } - } catch (IOException e) { - e.printStackTrace(); - continue; - } - } - } - - /** - * 发生错误时调用 - * - * @param session - * @param error - */ - @OnError - public void onError(Session session, Throwable error) { - System.out.println("发生错误"); - error.printStackTrace(); - } - - /** - * 这个方法与上面几个方法不一样。没有用注解,是根据自己需要添加的方法。 - * - * @param message - * @throws IOException - */ - public void sendMessage(String message) throws IOException { - synchronized (session) { - this.session.getBasicRemote().sendText(message); - } - //this.session.getAsyncRemote().sendText(message); - } - - public static synchronized int getOnlineCount() { - return onlineCount; - } - - public static synchronized void addOnlineCount() { - WebSocketModel.onlineCount++; - } - - public static synchronized void subOnlineCount() { - WebSocketModel.onlineCount--; - } -} diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml index 0fd7bc26..ddfac9e8 100644 --- a/src/main/resources/applicationContext.xml +++ b/src/main/resources/applicationContext.xml @@ -1,9 +1,9 @@ + xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"> diff --git a/src/main/resources/db.properties b/src/main/resources/db.properties index a6612a78..f86732dd 100644 --- a/src/main/resources/db.properties +++ b/src/main/resources/db.properties @@ -1,9 +1,9 @@ driver=com.microsoft.sqlserver.jdbc.SQLServerDriver -url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=SIPAIIS_WMS_HQAQ -password=P76XB3nm36aMkN6n +url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=SIPAIIS_WMS_HQAQ username=sa +password=P76XB3nm36aMkN6n -scada-url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=EIP_PRD_HQWS +scada-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=EIP_PRD_HQWS scada-username=sa scada-password=P76XB3nm36aMkN6n diff --git a/src/main/resources/es.properties b/src/main/resources/es.properties index a7ef1dcd..d6793c90 100644 --- a/src/main/resources/es.properties +++ b/src/main/resources/es.properties @@ -1,3 +1,7 @@ -es.nodes=110.42.238.107 -es.host=9200 -es.name=elastic +# transportClientFactory +# setHost +es.nodes=127.0.0.1 +# setPort +es.host=9300 +# setClusterName +es.name=elasticsearch-sipaiis diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index fde8f70a..c7f361d9 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -1,8 +1,10 @@ #\u5B9A\u4E49LOG\u8F93\u51FA\u7EA7\u522B log4j.rootLogger=INFO, Console ,File +log4j.encoding=UTF-8 #\u5B9A\u4E49\u65E5\u5FD7\u8F93\u51FA\u76EE\u7684\u5730\u4E3A\u63A7\u5236\u53F0 log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.Target=System.out +log4j.appender.Console.encoding=UTF-8 #\u53EF\u4EE5\u7075\u6D3B\u5730\u6307\u5B9A\u65E5\u5FD7\u8F93\u51FA\u683C\u5F0F\uFF0C\u4E0B\u9762\u4E00\u884C\u662F\u6307\u5B9A\u5177\u4F53\u7684\u683C\u5F0F log4j.appender.Console.layout = org.apache.log4j.PatternLayout log4j.appender.Console.layout.ConversionPattern=[%c] - %m%n diff --git a/src/main/resources/minio.properties b/src/main/resources/minio.properties index 4da921f8..3693c943 100644 --- a/src/main/resources/minio.properties +++ b/src/main/resources/minio.properties @@ -1,3 +1,3 @@ -minio.endPoint=http://122.51.194.184:19000 +minio.endPoint=http://127.0.0.1:19000 minio.accessKey=minio minio.secretKey=BHwChyGLt8FkaA7H diff --git a/src/main/resources/mqtt.properties b/src/main/resources/mqtt.properties index 006a692c..fa49baf9 100644 --- a/src/main/resources/mqtt.properties +++ b/src/main/resources/mqtt.properties @@ -1,22 +1,22 @@ -#项目是否使用mqtt 0:启动 1:禁用 +#\u9879\u76EE\u662F\u5426\u4F7F\u7528mqtt 0\uFF1A\u542F\u52A8 1\uFF1A\u7981\u7528 mqtt.status=0 #tcp -mqtt.host_tcp=tcp://122.51.194.184:1883 +mqtt.host_tcp=tcp://127.0.0.1:1883 #websocket -mqtt.host_ws=ws://122.51.194.184:8083/mqtt +mqtt.host_ws=ws://127.0.0.1:8083/mqtt #http -mqtt.host_http=http://122.51.194.184:18083 -#用户名 +mqtt.host_http=http://127.0.0.1:18083 +#\u00E7\u0094\u00A8\u00E6\u0088\u00B7\u00E5\u0090\u008D mqtt.username=dmbroker -#密码 +#\u00E5\u00AF\u0086\u00E7\u00A0\u0081 mqtt.password=qwer1234 -#管理平台用户名 18083 +#\u00E7\u00AE\u00A1\u00E7\u0090\u0086\u00E5\u00B9\u00B3\u00E5\u008F\u00B0\u00E7\u0094\u00A8\u00E6\u0088\u00B7\u00E5\u0090\u008D 18083 mqtt.username_dashboard=admin -#管理平台密码 18083 public +#\u00E7\u00AE\u00A1\u00E7\u0090\u0086\u00E5\u00B9\u00B3\u00E5\u008F\u00B0\u00E5\u00AF\u0086\u00E7\u00A0\u0081 18083 public mqtt.password_dashboard=siw@dh#Ffa -# 此为报警点配置中测量点编辑页面 是否关联风险等级评估列表 0 否 1是 +# \u6B64\u4E3A\u62A5\u8B66\u70B9\u914D\u7F6E\u4E2D\u6D4B\u91CF\u70B9\u7F16\u8F91\u9875\u9762 \u662F\u5426\u5173\u8054\u98CE\u9669\u7B49\u7EA7\u8BC4\u4F30\u5217\u8868 0 \u5426 1\u662F alarmConfigType = 0 diff --git a/src/main/resources/redis.properties b/src/main/resources/redis.properties index 991b8054..81f27e50 100644 --- a/src/main/resources/redis.properties +++ b/src/main/resources/redis.properties @@ -1,25 +1,25 @@ -#redis -redis.host=122.51.194.184 -#single Ⱥcluster +#redis\uFFFD\uFFFD\uFFFD\uFFFD +redis.host=127.0.0.1 +#\uFFFD\uFFFD\uFFFD\uFFFDsingle \uFFFD\uFFFD\u023Acluster redis.mode=single -redis.port=26739 +redis.port=6379 redis.password=Aa112211 redis.maxIdle=100 redis.maxActive=300 redis.maxWait=1000 redis.testOnBorrow=true redis.timeout=100000 -# Ҫ뻺 +# \uFFFD\uFFFD\uFFFD\uFFFD\u04AA\uFFFD\uFFFD\uFFFD\uBEFA\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD targetNames=xxxRecordManager,xxxSetRecordManager,xxxStatisticsIdentificationManager -# Ҫķ +# \uFFFD\uFFFD\uFFFD\uFFFD\u04AA\uFFFD\uFFFD\uFFFD\uFFFD\u0137\uFFFD\uFFFD\uFFFD methodNames= -#ûʧЧʱ +#\uFFFD\uFFFD\uFFFD\u00FB\uFFFD\uFFFD\uFFFD\u02A7\u0427\u02B1\uFFFD\uFFFD com.service.impl.xxxRecordManager= 60 com.service.impl.xxxSetRecordManager= 60 defaultCacheExpireTime=3600 fep.local.cache.capacity =10000 #cluster -cluster1.host.port=122.51.194.184: 26739 +cluster1.host.port=127.0.0.1: 6379 diff --git a/src/org/activiti/conf/SecurityConfiguration.java b/src/org/activiti/conf/SecurityConfiguration.java deleted file mode 100644 index aa3bd51b..00000000 --- a/src/org/activiti/conf/SecurityConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.activiti.conf; - -import org.activiti.rest.security.BasicAuthenticationProvider; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.authentication.AuthenticationProvider; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity; -import org.springframework.security.config.http.SessionCreationPolicy; - -@Configuration -@EnableWebSecurity -@EnableWebMvcSecurity -public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - - @Bean - public AuthenticationProvider authenticationProvider() { - return new BasicAuthenticationProvider(); - } - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.authenticationProvider(authenticationProvider()) - .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() - .csrf().disable() - .authorizeRequests() - .anyRequest().authenticated() - .and() - .httpBasic(); - } -} diff --git a/src/org/activiti/explorer/DispatcherServletConfiguration.java b/src/org/activiti/explorer/DispatcherServletConfiguration.java deleted file mode 100644 index 5ff702d1..00000000 --- a/src/org/activiti/explorer/DispatcherServletConfiguration.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.activiti.explorer; - -import java.util.List; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; - -@Configuration -@ComponentScan({"org.activiti.rest,org.activiti.conf"}) -@EnableAsync -public class DispatcherServletConfiguration extends WebMvcConfigurationSupport { - - private final Logger log = LoggerFactory.getLogger(DispatcherServletConfiguration.class); - - @Autowired - private ObjectMapper objectMapper; - - @Autowired - private Environment environment; - - @Bean - public SessionLocaleResolver localeResolver() { - return new SessionLocaleResolver(); - } - - @Bean - public LocaleChangeInterceptor localeChangeInterceptor() { - log.debug("Configuring localeChangeInterceptor"); - LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); - localeChangeInterceptor.setParamName("language"); - return localeChangeInterceptor; - } - - @Bean - public RequestMappingHandlerMapping requestMappingHandlerMapping() { - log.debug("Creating requestMappingHandlerMapping"); - RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping(); - requestMappingHandlerMapping.setUseSuffixPatternMatch(false); - Object[] interceptors = {localeChangeInterceptor()}; - requestMappingHandlerMapping.setInterceptors(interceptors); - return requestMappingHandlerMapping; - } - - @Override - public void configureMessageConverters(List> converters) { - addDefaultHttpMessageConverters(converters); - for (HttpMessageConverter converter : converters) { - if (converter instanceof MappingJackson2HttpMessageConverter) { - MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = (MappingJackson2HttpMessageConverter) converter; - jackson2HttpMessageConverter.setObjectMapper(objectMapper); - break; - } - } - } - - @Override - protected void configureContentNegotiation(ContentNegotiationConfigurer configurer) { - configurer.favorPathExtension(false); - } - -} diff --git a/src/org/activiti/explorer/FilterServletOutputStream.java b/src/org/activiti/explorer/FilterServletOutputStream.java deleted file mode 100644 index 90e2e8d3..00000000 --- a/src/org/activiti/explorer/FilterServletOutputStream.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.activiti.explorer; - -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.WriteListener; - -public class FilterServletOutputStream extends ServletOutputStream { - - private DataOutputStream stream; - private WriteListener writeListener; - - public FilterServletOutputStream(OutputStream output) { - stream = new DataOutputStream(output); - } - - public void write(int b) throws IOException { - stream.write(b); - } - - public void write(byte[] b) throws IOException { - stream.write(b); - } - - public void write(byte[] b, int off, int len) throws IOException { - stream.write(b, off, len); - } - - -// @Override - public void setWriteListener(WriteListener writeListener) { - this.writeListener = writeListener; - } - -// @Override - public boolean isReady() { - return true; - } - -} \ No newline at end of file diff --git a/src/org/activiti/explorer/GenericResponseWrapper.java b/src/org/activiti/explorer/GenericResponseWrapper.java deleted file mode 100644 index ab56d93d..00000000 --- a/src/org/activiti/explorer/GenericResponseWrapper.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.activiti.explorer; - -import java.io.ByteArrayOutputStream; -import java.io.PrintWriter; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; - -public class GenericResponseWrapper extends HttpServletResponseWrapper { - private ByteArrayOutputStream output; - private int contentLength; - private String contentType; - - public GenericResponseWrapper(HttpServletResponse response) { - super(response); - output = new ByteArrayOutputStream(); - } - - public byte[] getData() { - return output.toByteArray(); - } - - public ServletOutputStream getOutputStream() { - return new FilterServletOutputStream(output); - } - - public PrintWriter getWriter() { - return new PrintWriter(getOutputStream(), true); - } - - public void setContentLength(int length) { - this.contentLength = length; - super.setContentLength(length); - } - - public int getContentLength() { - return contentLength; - } - - public void setContentType(String type) { - this.contentType = type; - super.setContentType(type); - } - - public String getContentType() { - return contentType; - } -} diff --git a/src/org/activiti/explorer/JsonpCallbackFilter.java b/src/org/activiti/explorer/JsonpCallbackFilter.java deleted file mode 100644 index f55b85dc..00000000 --- a/src/org/activiti/explorer/JsonpCallbackFilter.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.activiti.explorer; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Map; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class JsonpCallbackFilter implements Filter { - - private static Logger log = LoggerFactory.getLogger(JsonpCallbackFilter.class); - - public void init(FilterConfig fConfig) throws ServletException { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - HttpServletRequest httpRequest = (HttpServletRequest) request; - HttpServletResponse httpResponse = (HttpServletResponse) response; - - Map parms = httpRequest.getParameterMap(); - - if (parms.containsKey("callback")) { - if (log.isDebugEnabled()) - log.debug("Wrapping response with JSONP callback '" + parms.get("callback")[0] + "'"); - - OutputStream out = httpResponse.getOutputStream(); - - GenericResponseWrapper wrapper = new GenericResponseWrapper(httpResponse); - - chain.doFilter(request, wrapper); - - //handles the content-size truncation - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(new String(parms.get("callback")[0] + "(").getBytes()); - outputStream.write(wrapper.getData()); - outputStream.write(new String(");").getBytes()); - byte jsonpResponse[] = outputStream.toByteArray(); - - wrapper.setContentType("text/javascript;charset=UTF-8"); - wrapper.setContentLength(jsonpResponse.length); - - out.write(jsonpResponse); - - out.close(); - - } else { - chain.doFilter(request, response); - } - } - - public void destroy() { - } -} diff --git a/src/org/activiti/image/impl/DefaultProcessDiagramCanvas.java b/src/org/activiti/image/impl/DefaultProcessDiagramCanvas.java deleted file mode 100644 index 0dfb731a..00000000 --- a/src/org/activiti/image/impl/DefaultProcessDiagramCanvas.java +++ /dev/null @@ -1,1335 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.activiti.image.impl; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Point; -import java.awt.Polygon; -import java.awt.Rectangle; -import java.awt.RenderingHints; -import java.awt.Shape; -import java.awt.Stroke; -import java.awt.font.FontRenderContext; -import java.awt.font.LineBreakMeasurer; -import java.awt.font.TextAttribute; -import java.awt.font.TextLayout; -import java.awt.geom.AffineTransform; -import java.awt.geom.Ellipse2D; -import java.awt.geom.Line2D; -import java.awt.geom.Path2D; -import java.awt.geom.PathIterator; -import java.awt.geom.Rectangle2D; -import java.awt.geom.RoundRectangle2D; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.util.ArrayList; -import java.util.List; - -import javax.imageio.ImageIO; - -import org.activiti.bpmn.model.AssociationDirection; -import org.activiti.bpmn.model.GraphicInfo; -import org.activiti.image.exception.ActivitiImageException; -import org.activiti.image.util.ReflectUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents a canvas on which BPMN 2.0 constructs can be drawn. - * - * Some of the icons used are licensed under a Creative Commons Attribution 2.5 - * License, see http://www.famfamfam.com/lab/icons/silk/ - * - * @see org.activiti.engine.impl.bpmn.diagram.DefaultProcessDiagramGenerator - * @author Joram Barrez - */ -public class DefaultProcessDiagramCanvas { - - protected static final Logger LOGGER = LoggerFactory.getLogger(DefaultProcessDiagramCanvas.class); - public enum SHAPE_TYPE {Rectangle, Rhombus, Ellipse} - - // Predefined sized - protected static final int ARROW_WIDTH = 5; - protected static final int CONDITIONAL_INDICATOR_WIDTH = 16; - protected static final int DEFAULT_INDICATOR_WIDTH = 10; - protected static final int MARKER_WIDTH = 12; - protected static final int FONT_SIZE = 11; - protected static final int FONT_SPACING = 2; - protected static final int TEXT_PADDING = 3; - protected static final int ANNOTATION_TEXT_PADDING = 7; - protected static final int LINE_HEIGHT = FONT_SIZE + FONT_SPACING; - - - // Colors - protected static Color TASK_BOX_COLOR = new Color(249, 249, 249); - protected static Color SUBPROCESS_BOX_COLOR = new Color(255, 255, 255); - protected static Color EVENT_COLOR = new Color(255, 255, 255); - protected static Color CONNECTION_COLOR = new Color(88, 88, 88); - protected static Color CONDITIONAL_INDICATOR_COLOR = new Color(255, 255, 255); - protected static Color HIGHLIGHT_COLOR = Color.RED; - protected static Color LABEL_COLOR = new Color(112, 146, 190); - protected static Color TASK_BORDER_COLOR = new Color(187, 187, 187); - protected static Color EVENT_BORDER_COLOR = new Color(88, 88, 88); - protected static Color SUBPROCESS_BORDER_COLOR = new Color(0, 0, 0); - - // Fonts - protected static Font LABEL_FONT = null; - protected static Font ANNOTATION_FONT = null; - - // Strokes - protected static Stroke THICK_TASK_BORDER_STROKE = new BasicStroke(3.0f); - protected static Stroke GATEWAY_TYPE_STROKE = new BasicStroke(3.0f); - protected static Stroke END_EVENT_STROKE = new BasicStroke(3.0f); - protected static Stroke MULTI_INSTANCE_STROKE = new BasicStroke(1.3f); - protected static Stroke EVENT_SUBPROCESS_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[] { 1.0f }, 0.0f); - protected static Stroke NON_INTERRUPTING_EVENT_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[] { 4.0f, 3.0f }, 0.0f); - protected static Stroke HIGHLIGHT_FLOW_STROKE = new BasicStroke(1.3f); - protected static Stroke ANNOTATION_STROKE = new BasicStroke(2.0f); - protected static Stroke ASSOCIATION_STROKE = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[] { 2.0f, 2.0f }, 0.0f); - - // icons - protected static int ICON_PADDING = 5; - protected static BufferedImage USERTASK_IMAGE; - protected static BufferedImage SCRIPTTASK_IMAGE; - protected static BufferedImage SERVICETASK_IMAGE; - protected static BufferedImage RECEIVETASK_IMAGE; - protected static BufferedImage SENDTASK_IMAGE; - protected static BufferedImage MANUALTASK_IMAGE; - protected static BufferedImage BUSINESS_RULE_TASK_IMAGE; - protected static BufferedImage SHELL_TASK_IMAGE; - protected static BufferedImage MULE_TASK_IMAGE; - protected static BufferedImage CAMEL_TASK_IMAGE; - - protected static BufferedImage TIMER_IMAGE; - protected static BufferedImage COMPENSATE_THROW_IMAGE; - protected static BufferedImage COMPENSATE_CATCH_IMAGE; - protected static BufferedImage ERROR_THROW_IMAGE; - protected static BufferedImage ERROR_CATCH_IMAGE; - protected static BufferedImage MESSAGE_THROW_IMAGE; - protected static BufferedImage MESSAGE_CATCH_IMAGE; - protected static BufferedImage SIGNAL_CATCH_IMAGE; - protected static BufferedImage SIGNAL_THROW_IMAGE; - - protected int canvasWidth = -1; - protected int canvasHeight = -1; - protected int minX = -1; - protected int minY = -1; - protected BufferedImage processDiagram; - protected Graphics2D g; - protected FontMetrics fontMetrics; - protected boolean closed; - protected ClassLoader customClassLoader; - protected String activityFontName = "Arial"; - protected String labelFontName = "Arial"; - protected String annotationFontName = "Arial"; - - /** - * Creates an empty canvas with given width and height. - * - * Allows to specify minimal boundaries on the left and upper side of the - * canvas. This is useful for diagrams that have white space there. - * Everything beneath these minimum values will be cropped. - * It's also possible to pass a specific font name and a class loader for the icon images. - * - */ - public DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, - String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) { - - this.canvasWidth = width; - this.canvasHeight = height; - this.minX = minX; - this.minY = minY; - if (activityFontName != null) { - this.activityFontName = activityFontName; - } - if (labelFontName != null) { - this.labelFontName = labelFontName; - } - if (annotationFontName != null) { - this.annotationFontName = annotationFontName; - } - this.customClassLoader = customClassLoader; - - initialize(imageType); - } - - /** - * Creates an empty canvas with given width and height. - * - * Allows to specify minimal boundaries on the left and upper side of the - * canvas. This is useful for diagrams that have white space there (eg - * Signavio). Everything beneath these minimum values will be cropped. - * - * @param minX - * Hint that will be used when generating the image. Parts that fall - * below minX on the horizontal scale will be cropped. - * @param minY - * Hint that will be used when generating the image. Parts that fall - * below minX on the horizontal scale will be cropped. - */ - public DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) { - this.canvasWidth = width; - this.canvasHeight = height; - this.minX = minX; - this.minY = minY; - - initialize(imageType); - } - - public void initialize(String imageType) { - if ("png".equalsIgnoreCase(imageType)) { - this.processDiagram = new BufferedImage(canvasWidth, canvasHeight, BufferedImage.TYPE_INT_ARGB); - } else { - this.processDiagram = new BufferedImage(canvasWidth, canvasHeight, BufferedImage.TYPE_INT_RGB); - } - - this.g = processDiagram.createGraphics(); - if ("png".equalsIgnoreCase(imageType) == false) { - this.g.setBackground(new Color(255, 255, 255, 0)); - this.g.clearRect(0, 0, canvasWidth, canvasHeight); - } - - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g.setPaint(Color.black); - - Font font = new Font(activityFontName, Font.BOLD, FONT_SIZE); - g.setFont(font); - this.fontMetrics = g.getFontMetrics(); - - //LABEL_FONT = new Font(labelFontName, Font.ITALIC, 10); - LABEL_FONT = new Font(labelFontName, Font.BOLD, 12);//改成粗体更明显 - LABEL_COLOR = new Color(0, 0, 0);//修改lable颜色 - ANNOTATION_FONT = new Font(annotationFontName, Font.PLAIN, FONT_SIZE); - - try { - USERTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/userTask.png", customClassLoader)); - SCRIPTTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/scriptTask.png", customClassLoader)); - SERVICETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/serviceTask.png", customClassLoader)); - RECEIVETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/receiveTask.png", customClassLoader)); - SENDTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/sendTask.png", customClassLoader)); - MANUALTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/manualTask.png", customClassLoader)); - BUSINESS_RULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/businessRuleTask.png", customClassLoader)); - SHELL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/shellTask.png", customClassLoader)); - CAMEL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/camelTask.png", customClassLoader)); - MULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/muleTask.png", customClassLoader)); - - TIMER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/timer.png", customClassLoader)); - COMPENSATE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/compensate-throw.png", customClassLoader)); - COMPENSATE_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/compensate.png", customClassLoader)); - ERROR_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/error-throw.png", customClassLoader)); - ERROR_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/error.png", customClassLoader)); - MESSAGE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/message-throw.png", customClassLoader)); - MESSAGE_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/message.png", customClassLoader)); - SIGNAL_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/signal-throw.png", customClassLoader)); - SIGNAL_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/signal.png", customClassLoader)); - } catch (IOException e) { - LOGGER.warn("Could not load image for process diagram creation: {}", e.getMessage()); - } - } - - /** - * Generates an image of what currently is drawn on the canvas. - * - * Throws an {@link ActivitiException} when {@link #close()} is already - * called. - */ - public InputStream generateImage(String imageType) { - if (closed) { - throw new ActivitiImageException("ProcessDiagramGenerator already closed"); - } - - ByteArrayOutputStream out = new ByteArrayOutputStream(); - try { - ImageIO.write(processDiagram, imageType, out); - - } catch (IOException e) { - throw new ActivitiImageException("Error while generating process image", e); - } finally { - try { - if (out != null) { - out.close(); - } - } catch(IOException ignore) { - // Exception is silently ignored - } - } - return new ByteArrayInputStream(out.toByteArray()); - } - - /** - * Generates an image of what currently is drawn on the canvas. - * - * Throws an {@link ActivitiException} when {@link #close()} is already - * called. - */ - public BufferedImage generateBufferedImage(String imageType) { - if (closed) { - throw new ActivitiImageException("ProcessDiagramGenerator already closed"); - } - - // Try to remove white space - minX = (minX <= 5) ? 5 : minX; - minY = (minY <= 5) ? 5 : minY; - BufferedImage imageToSerialize = processDiagram; - if (minX >= 0 && minY >= 0) { - imageToSerialize = processDiagram.getSubimage(minX - 5, minY - 5, canvasWidth - minX + 5, canvasHeight - minY + 5); - } - return imageToSerialize; - } - - /** - * Closes the canvas which dissallows further drawing and releases graphical - * resources. - */ - public void close() { - g.dispose(); - closed = true; - } - - public void drawNoneStartEvent(GraphicInfo graphicInfo) { - drawStartEvent(graphicInfo, null, 1.0); - } - - public void drawTimerStartEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawStartEvent(graphicInfo, TIMER_IMAGE, scaleFactor); - } - - public void drawSignalStartEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawStartEvent(graphicInfo, SIGNAL_CATCH_IMAGE, scaleFactor); - } - - public void drawMessageStartEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawStartEvent(graphicInfo, MESSAGE_CATCH_IMAGE, scaleFactor); - } - - public void drawStartEvent(GraphicInfo graphicInfo, BufferedImage image, double scaleFactor) { - Paint originalPaint = g.getPaint(); - g.setPaint(EVENT_COLOR); - Ellipse2D circle = new Ellipse2D.Double(graphicInfo.getX(), graphicInfo.getY(), - graphicInfo.getWidth(), graphicInfo.getHeight()); - g.fill(circle); - g.setPaint(EVENT_BORDER_COLOR); - g.draw(circle); - g.setPaint(originalPaint); - if (image != null) { - // calculate coordinates to center image - int imageX = (int) Math.round(graphicInfo.getX() + (graphicInfo.getWidth() / 2) - (image.getWidth() / 2 * scaleFactor)); - int imageY = (int) Math.round(graphicInfo.getY() + (graphicInfo.getHeight() / 2) - (image.getHeight() / 2 * scaleFactor)); - g.drawImage(image, imageX, imageY, - (int) (image.getWidth() / scaleFactor), (int) (image.getHeight() / scaleFactor), null); - } - - } - - public void drawNoneEndEvent(GraphicInfo graphicInfo, double scaleFactor) { - Paint originalPaint = g.getPaint(); - Stroke originalStroke = g.getStroke(); - g.setPaint(EVENT_COLOR); - Ellipse2D circle = new Ellipse2D.Double(graphicInfo.getX(), graphicInfo.getY(), - graphicInfo.getWidth(), graphicInfo.getHeight()); - g.fill(circle); - g.setPaint(EVENT_BORDER_COLOR); - if (scaleFactor == 1.0) { - g.setStroke(END_EVENT_STROKE); - } else { - g.setStroke(new BasicStroke(2.0f)); - } - g.draw(circle); - g.setStroke(originalStroke); - g.setPaint(originalPaint); - } - - public void drawErrorEndEvent(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawErrorEndEvent(graphicInfo, scaleFactor); - if (scaleFactor == 1.0) { - drawLabel(name, graphicInfo); - } - } - - public void drawErrorEndEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawNoneEndEvent(graphicInfo, scaleFactor); - g.drawImage(ERROR_THROW_IMAGE, (int) (graphicInfo.getX() + (graphicInfo.getWidth() / 4)), - (int) (graphicInfo.getY() + (graphicInfo.getHeight() / 4)), - (int) (ERROR_THROW_IMAGE.getWidth() / scaleFactor), - (int) (ERROR_THROW_IMAGE.getHeight() / scaleFactor), null); - } - - public void drawErrorStartEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawNoneStartEvent(graphicInfo); - g.drawImage(ERROR_CATCH_IMAGE, (int) (graphicInfo.getX() + (graphicInfo.getWidth() / 4)), - (int) (graphicInfo.getY() + (graphicInfo.getHeight() / 4)), - (int) (ERROR_CATCH_IMAGE.getWidth() / scaleFactor), - (int) (ERROR_CATCH_IMAGE.getHeight() / scaleFactor), null); - } - - public void drawCatchingEvent(GraphicInfo graphicInfo, boolean isInterrupting, - BufferedImage image, String eventType, double scaleFactor) { - - // event circles - Ellipse2D outerCircle = new Ellipse2D.Double(graphicInfo.getX(), graphicInfo.getY(), - graphicInfo.getWidth(), graphicInfo.getHeight()); - int innerCircleSize = (int) (4 / scaleFactor); - if (innerCircleSize == 0) { - innerCircleSize = 1; - } - int innerCircleX = (int) graphicInfo.getX() + innerCircleSize; - int innerCircleY = (int) graphicInfo.getY() + innerCircleSize; - int innerCircleWidth = (int) graphicInfo.getWidth() - (2 * innerCircleSize); - int innerCircleHeight = (int) graphicInfo.getHeight() - (2 * innerCircleSize); - Ellipse2D innerCircle = new Ellipse2D.Double(innerCircleX, innerCircleY, innerCircleWidth, innerCircleHeight); - - Paint originalPaint = g.getPaint(); - Stroke originalStroke = g.getStroke(); - g.setPaint(EVENT_COLOR); - g.fill(outerCircle); - - g.setPaint(EVENT_BORDER_COLOR); - if (isInterrupting == false) - g.setStroke(NON_INTERRUPTING_EVENT_STROKE); - g.draw(outerCircle); - g.setStroke(originalStroke); - g.setPaint(originalPaint); - g.draw(innerCircle); - - if (image != null) { - // calculate coordinates to center image - int imageX = (int) (graphicInfo.getX() + (graphicInfo.getWidth() / 2) - (image.getWidth() / 2 * scaleFactor)); - int imageY = (int) (graphicInfo.getY() + (graphicInfo.getHeight() / 2) - (image.getHeight() / 2 * scaleFactor)); - if (scaleFactor == 1.0 && "timer".equals(eventType)) { - // move image one pixel to center timer image - imageX++; - imageY++; - } - g.drawImage(image, imageX, imageY, (int) (image.getWidth() / scaleFactor), - (int) (image.getHeight() / scaleFactor), null); - } - } - - public void drawCatchingCompensateEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingCompensateEvent(graphicInfo, isInterrupting, scaleFactor); - drawLabel(name, graphicInfo); - } - - public void drawCatchingCompensateEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingEvent(graphicInfo, isInterrupting, COMPENSATE_CATCH_IMAGE, "compensate", scaleFactor); - } - - public void drawCatchingTimerEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingTimerEvent(graphicInfo, isInterrupting, scaleFactor); - drawLabel(name, graphicInfo); - } - - public void drawCatchingTimerEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingEvent(graphicInfo, isInterrupting, TIMER_IMAGE, "timer", scaleFactor); - } - - public void drawCatchingErrorEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingErrorEvent(graphicInfo, isInterrupting, scaleFactor); - drawLabel(name, graphicInfo); - } - - public void drawCatchingErrorEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingEvent(graphicInfo, isInterrupting, ERROR_CATCH_IMAGE, "error", scaleFactor); - } - - public void drawCatchingSignalEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingSignalEvent(graphicInfo, isInterrupting, scaleFactor); - drawLabel(name, graphicInfo); - } - - public void drawCatchingSignalEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingEvent(graphicInfo, isInterrupting, SIGNAL_CATCH_IMAGE, "signal", scaleFactor); - } - - public void drawCatchingMessageEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingEvent(graphicInfo, isInterrupting, MESSAGE_CATCH_IMAGE, "message", scaleFactor); - } - - public void drawCatchingMessageEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) { - drawCatchingEvent(graphicInfo, isInterrupting, MESSAGE_CATCH_IMAGE, "message", scaleFactor); - drawLabel(name, graphicInfo); - } - - public void drawThrowingCompensateEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawCatchingEvent(graphicInfo, true, COMPENSATE_THROW_IMAGE, "compensate", scaleFactor); - } - - public void drawThrowingSignalEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawCatchingEvent(graphicInfo, true, SIGNAL_THROW_IMAGE, "signal", scaleFactor); - } - - public void drawThrowingNoneEvent(GraphicInfo graphicInfo, double scaleFactor) { - drawCatchingEvent(graphicInfo, true, null, "none", scaleFactor); - } - - public void drawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, double scaleFactor) { - drawSequenceflow(srcX, srcY, targetX, targetY, conditional, false, scaleFactor); - } - - public void drawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted, double scaleFactor) { - Paint originalPaint = g.getPaint(); - if (highLighted) - g.setPaint(HIGHLIGHT_COLOR); - - Line2D.Double line = new Line2D.Double(srcX, srcY, targetX, targetY); - g.draw(line); - drawArrowHead(line, scaleFactor); - - if (conditional) { - drawConditionalSequenceFlowIndicator(line, scaleFactor); - } - - if (highLighted) - g.setPaint(originalPaint); - } - - public void drawAssociation(int[] xPoints, int[] yPoints, AssociationDirection associationDirection, boolean highLighted, double scaleFactor) { - boolean conditional = false, isDefault = false; - drawConnection(xPoints, yPoints, conditional, isDefault, "association", associationDirection, highLighted, scaleFactor); - } - - public void drawSequenceflow(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, boolean highLighted, double scaleFactor) { - drawConnection(xPoints, yPoints, conditional, isDefault, "sequenceFlow", AssociationDirection.ONE, highLighted, scaleFactor); - } - - public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, - AssociationDirection associationDirection, boolean highLighted, double scaleFactor) { - - Paint originalPaint = g.getPaint(); - Stroke originalStroke = g.getStroke(); - - g.setPaint(CONNECTION_COLOR); - if (connectionType.equals("association")) { - g.setStroke(ASSOCIATION_STROKE); - } else if (highLighted) { - g.setPaint(HIGHLIGHT_COLOR); - g.setStroke(HIGHLIGHT_FLOW_STROKE); - } - - for (int i=1; i 1.0) return; - int horizontal = (int) (CONDITIONAL_INDICATOR_WIDTH * 0.7); - int halfOfHorizontal = horizontal / 2; - int halfOfVertical = CONDITIONAL_INDICATOR_WIDTH / 2; - - Polygon conditionalIndicator = new Polygon(); - conditionalIndicator.addPoint(0, 0); - conditionalIndicator.addPoint(-halfOfHorizontal, halfOfVertical); - conditionalIndicator.addPoint(0, CONDITIONAL_INDICATOR_WIDTH); - conditionalIndicator.addPoint(halfOfHorizontal, halfOfVertical); - - AffineTransform transformation = new AffineTransform(); - transformation.setToIdentity(); - double angle = Math.atan2(line.y2 - line.y1, line.x2 - line.x1); - transformation.translate(line.x1, line.y1); - transformation.rotate((angle - Math.PI / 2d)); - - AffineTransform originalTransformation = g.getTransform(); - g.setTransform(transformation); - g.draw(conditionalIndicator); - - Paint originalPaint = g.getPaint(); - g.setPaint(CONDITIONAL_INDICATOR_COLOR); - g.fill(conditionalIndicator); - - g.setPaint(originalPaint); - g.setTransform(originalTransformation); - } - - public void drawTask(BufferedImage icon, String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(name, graphicInfo); - g.drawImage(icon, (int) (graphicInfo.getX() + ICON_PADDING / scaleFactor), - (int) (graphicInfo.getY() + ICON_PADDING / scaleFactor), - (int) (icon.getWidth() / scaleFactor), (int) (icon.getHeight() / scaleFactor), null); - } - - public void drawTask(String name, GraphicInfo graphicInfo) { - drawTask(name, graphicInfo, false); - } - - public void drawPoolOrLane(String name, GraphicInfo graphicInfo) { - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - g.drawRect(x, y, width, height); - - // Add the name as text, vertical - if(name != null && name.length() > 0) { - // Include some padding - int availableTextSpace = height - 6; - - // Create rotation for derived font - AffineTransform transformation = new AffineTransform(); - transformation.setToIdentity(); - transformation.rotate(270 * Math.PI/180); - - Font currentFont = g.getFont(); - Font theDerivedFont = currentFont.deriveFont(transformation); - g.setFont(theDerivedFont); - - String truncated = fitTextToWidth(name, availableTextSpace); - int realWidth = fontMetrics.stringWidth(truncated); - - g.drawString(truncated, x + 2 + fontMetrics.getHeight(), 3 + y + availableTextSpace - (availableTextSpace - realWidth) / 2); - g.setFont(currentFont); - } - } - - protected void drawTask(String name, GraphicInfo graphicInfo, boolean thickBorder) { - Paint originalPaint = g.getPaint(); - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - // Create a new gradient paint for every task box, gradient depends on x and y and is not relative - g.setPaint(TASK_BOX_COLOR); - - int arcR = 6; - if (thickBorder) - arcR = 3; - - // shape - RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcR, arcR); - g.fill(rect); - g.setPaint(TASK_BORDER_COLOR); - - if (thickBorder) { - Stroke originalStroke = g.getStroke(); - g.setStroke(THICK_TASK_BORDER_STROKE); - g.draw(rect); - g.setStroke(originalStroke); - } else { - g.draw(rect); - } - - g.setPaint(originalPaint); - // text - if (name != null && name.length() > 0) { - int boxWidth = width - (2 * TEXT_PADDING); - int boxHeight = height - 16 - ICON_PADDING - ICON_PADDING - MARKER_WIDTH - 2 - 2; - int boxX = x + width/2 - boxWidth/2; - int boxY = y + height/2 - boxHeight/2 + ICON_PADDING + ICON_PADDING - 2 - 2; - - drawMultilineCentredText(name, boxX, boxY, boxWidth, boxHeight); - } - } - - protected void drawMultilineCentredText(String text, int x, int y, int boxWidth, int boxHeight) { - drawMultilineText(text, x, y, boxWidth, boxHeight, true); - } - - protected void drawMultilineAnnotationText(String text, int x, int y, int boxWidth, int boxHeight) { - drawMultilineText(text, x, y, boxWidth, boxHeight, false); - } - - protected void drawMultilineText(String text, int x, int y, int boxWidth, int boxHeight, boolean centered) { - // Create an attributed string based in input text - AttributedString attributedString = new AttributedString(text); - attributedString.addAttribute(TextAttribute.FONT, g.getFont()); - attributedString.addAttribute(TextAttribute.FOREGROUND, Color.black); - - AttributedCharacterIterator characterIterator = attributedString.getIterator(); - - int currentHeight = 0; - // Prepare a list of lines of text we'll be drawing - List layouts = new ArrayList(); - String lastLine = null; - - LineBreakMeasurer measurer = new LineBreakMeasurer(characterIterator, g.getFontRenderContext()); - - TextLayout layout = null; - while (measurer.getPosition() < characterIterator.getEndIndex() && currentHeight <= boxHeight) { - - int previousPosition = measurer.getPosition(); - - // Request next layout - layout = measurer.nextLayout(boxWidth); - - int height = ((Float)(layout.getDescent() + layout.getAscent() + layout.getLeading())).intValue(); - - if(currentHeight + height > boxHeight) { - // The line we're about to add should NOT be added anymore, append three dots to previous one instead - // to indicate more text is truncated - if (!layouts.isEmpty()) { - layouts.remove(layouts.size() - 1); - - if(lastLine.length() >= 4) { - lastLine = lastLine.substring(0, lastLine.length() - 4) + "..."; - } - layouts.add(new TextLayout(lastLine, g.getFont(), g.getFontRenderContext())); - } - break; - } else { - layouts.add(layout); - lastLine = text.substring(previousPosition, measurer.getPosition()); - currentHeight += height; - } - } - - - int currentY = y + (centered ? ((boxHeight - currentHeight) /2) : 0); - int currentX = 0; - - // Actually draw the lines - for(TextLayout textLayout : layouts) { - - currentY += textLayout.getAscent(); - currentX = x + (centered ? ((boxWidth - ((Double)textLayout.getBounds().getWidth()).intValue()) /2) : 0); - - textLayout.draw(g, currentX, currentY); - currentY += textLayout.getDescent() + textLayout.getLeading(); - } - - } - - - protected String fitTextToWidth(String original, int width) { - String text = original; - - // remove length for "..." - int maxWidth = width - 10; - - while (fontMetrics.stringWidth(text + "...") > maxWidth && text.length() > 0) { - text = text.substring(0, text.length() - 1); - } - - if (!text.equals(original)) { - text = text + "..."; - } - - return text; - } - - public void drawUserTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(USERTASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawScriptTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(SCRIPTTASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawServiceTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(SERVICETASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawReceiveTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(RECEIVETASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawSendTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(SENDTASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawManualTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(MANUALTASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawBusinessRuleTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(BUSINESS_RULE_TASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawCamelTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(CAMEL_TASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawMuleTask(String name, GraphicInfo graphicInfo, double scaleFactor) { - drawTask(MULE_TASK_IMAGE, name, graphicInfo, scaleFactor); - } - - public void drawExpandedSubProcess(String name, GraphicInfo graphicInfo, Boolean isTriggeredByEvent, double scaleFactor) { - RoundRectangle2D rect = new RoundRectangle2D.Double(graphicInfo.getX(), graphicInfo.getY(), - graphicInfo.getWidth(), graphicInfo.getHeight(), 8, 8); - - // Use different stroke (dashed) - if (isTriggeredByEvent) { - Stroke originalStroke = g.getStroke(); - g.setStroke(EVENT_SUBPROCESS_STROKE); - g.draw(rect); - g.setStroke(originalStroke); - } else { - Paint originalPaint = g.getPaint(); - g.setPaint(SUBPROCESS_BOX_COLOR); - g.fill(rect); - g.setPaint(SUBPROCESS_BORDER_COLOR); - g.draw(rect); - g.setPaint(originalPaint); - } - - if (scaleFactor == 1.0 && name != null && !name.isEmpty()) { - String text = fitTextToWidth(name, (int) graphicInfo.getWidth()); - g.drawString(text, (int) graphicInfo.getX() + 10, (int) graphicInfo.getY() + 15); - } - } - - public void drawCollapsedSubProcess(String name, GraphicInfo graphicInfo, Boolean isTriggeredByEvent) { - drawCollapsedTask(name, graphicInfo, false); - } - - public void drawCollapsedCallActivity(String name, GraphicInfo graphicInfo) { - drawCollapsedTask(name, graphicInfo, true); - } - - protected void drawCollapsedTask(String name, GraphicInfo graphicInfo, boolean thickBorder) { - // The collapsed marker is now visualized separately - drawTask(name, graphicInfo, thickBorder); - } - - public void drawCollapsedMarker(int x, int y, int width, int height) { - // rectangle - int rectangleWidth = MARKER_WIDTH; - int rectangleHeight = MARKER_WIDTH; - Rectangle rect = new Rectangle(x + (width - rectangleWidth) / 2, y + height - rectangleHeight - 3, rectangleWidth, rectangleHeight); - g.draw(rect); - - // plus inside rectangle - Line2D.Double line = new Line2D.Double(rect.getCenterX(), rect.getY() + 2, rect.getCenterX(), rect.getMaxY() - 2); - g.draw(line); - line = new Line2D.Double(rect.getMinX() + 2, rect.getCenterY(), rect.getMaxX() - 2, rect.getCenterY()); - g.draw(line); - } - - public void drawActivityMarkers(int x, int y, int width, int height, boolean multiInstanceSequential, boolean multiInstanceParallel, boolean collapsed) { - if (collapsed) { - if (!multiInstanceSequential && !multiInstanceParallel) { - drawCollapsedMarker(x, y, width, height); - } else { - drawCollapsedMarker(x - MARKER_WIDTH / 2 - 2, y, width, height); - if (multiInstanceSequential) { - drawMultiInstanceMarker(true, x + MARKER_WIDTH / 2 + 2, y, width, height); - } else { - drawMultiInstanceMarker(false, x + MARKER_WIDTH / 2 + 2, y, width, height); - } - } - } else { - if (multiInstanceSequential) { - drawMultiInstanceMarker(true, x, y, width, height); - } else if (multiInstanceParallel) { - drawMultiInstanceMarker(false, x, y, width, height); - } - } - } - - public void drawGateway(GraphicInfo graphicInfo) { - Polygon rhombus = new Polygon(); - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - rhombus.addPoint(x, y + (height / 2)); - rhombus.addPoint(x + (width / 2), y + height); - rhombus.addPoint(x + width, y + (height / 2)); - rhombus.addPoint(x + (width / 2), y); - g.draw(rhombus); - } - - public void drawParallelGateway(GraphicInfo graphicInfo, double scaleFactor) { - // rhombus - drawGateway(graphicInfo); - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - if (scaleFactor == 1.0) { - // plus inside rhombus - Stroke orginalStroke = g.getStroke(); - g.setStroke(GATEWAY_TYPE_STROKE); - Line2D.Double line = new Line2D.Double(x + 10, y + height / 2, x + width - 10, y + height / 2); // horizontal - g.draw(line); - line = new Line2D.Double(x + width / 2, y + height - 10, x + width / 2, y + 10); // vertical - g.draw(line); - g.setStroke(orginalStroke); - } - } - - public void drawExclusiveGateway(GraphicInfo graphicInfo, double scaleFactor) { - // rhombus - drawGateway(graphicInfo); - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - int quarterWidth = width / 4; - int quarterHeight = height / 4; - - if (scaleFactor == 1.0) { - // X inside rhombus - Stroke orginalStroke = g.getStroke(); - g.setStroke(GATEWAY_TYPE_STROKE); - Line2D.Double line = new Line2D.Double(x + quarterWidth + 3, y + quarterHeight + 3, x + 3 * quarterWidth - 3, y + 3 * quarterHeight - 3); - g.draw(line); - line = new Line2D.Double(x + quarterWidth + 3, y + 3 * quarterHeight - 3, x + 3 * quarterWidth - 3, y + quarterHeight + 3); - g.draw(line); - g.setStroke(orginalStroke); - } - } - - public void drawInclusiveGateway(GraphicInfo graphicInfo, double scaleFactor) { - // rhombus - drawGateway(graphicInfo); - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - int diameter = width / 2; - - if (scaleFactor == 1.0) { - // circle inside rhombus - Stroke orginalStroke = g.getStroke(); - g.setStroke(GATEWAY_TYPE_STROKE); - Ellipse2D.Double circle = new Ellipse2D.Double(((width - diameter) / 2) + x, ((height - diameter) / 2) + y, diameter, diameter); - g.draw(circle); - g.setStroke(orginalStroke); - } - } - - public void drawEventBasedGateway(GraphicInfo graphicInfo, double scaleFactor) { - // rhombus - drawGateway(graphicInfo); - - if (scaleFactor == 1.0) { - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - double scale = .6; - - GraphicInfo eventInfo = new GraphicInfo(); - eventInfo.setX(x + width*(1-scale)/2); - eventInfo.setY(y + height*(1-scale)/2); - eventInfo.setWidth(width*scale); - eventInfo.setHeight(height*scale); - drawCatchingEvent(eventInfo, true, null, "eventGateway", scaleFactor); - - double r = width / 6.; - - // create pentagon (coords with respect to center) - int topX = (int)(.95 * r); // top right corner - int topY = (int)(-.31 * r); - int bottomX = (int)(.59 * r); // bottom right corner - int bottomY = (int)(.81 * r); - - int[] xPoints = new int[]{ 0, topX, bottomX, -bottomX, -topX }; - int[] yPoints = new int[]{ -(int)r, topY, bottomY, bottomY, topY }; - Polygon pentagon = new Polygon(xPoints, yPoints, 5); - pentagon.translate(x+width/2, y+width/2); - - // draw - g.drawPolygon(pentagon); - } - } - - public void drawMultiInstanceMarker(boolean sequential, int x, int y, int width, int height) { - int rectangleWidth = MARKER_WIDTH; - int rectangleHeight = MARKER_WIDTH; - int lineX = x + (width - rectangleWidth) / 2; - int lineY = y + height - rectangleHeight - 3; - - Stroke orginalStroke = g.getStroke(); - g.setStroke(MULTI_INSTANCE_STROKE); - - if (sequential) { - g.draw(new Line2D.Double(lineX, lineY, lineX + rectangleWidth, lineY)); - g.draw(new Line2D.Double(lineX, lineY + rectangleHeight / 2, lineX + rectangleWidth, lineY + rectangleHeight / 2)); - g.draw(new Line2D.Double(lineX, lineY + rectangleHeight, lineX + rectangleWidth, lineY + rectangleHeight)); - } else { - g.draw(new Line2D.Double(lineX, lineY, lineX, lineY + rectangleHeight)); - g.draw(new Line2D.Double(lineX + rectangleWidth / 2, lineY, lineX + rectangleWidth / 2, lineY + rectangleHeight)); - g.draw(new Line2D.Double(lineX + rectangleWidth, lineY, lineX + rectangleWidth, lineY + rectangleHeight)); - } - - g.setStroke(orginalStroke); - } - - public void drawHighLight(int x, int y, int width, int height) { - Paint originalPaint = g.getPaint(); - Stroke originalStroke = g.getStroke(); - - g.setPaint(HIGHLIGHT_COLOR); - g.setStroke(THICK_TASK_BORDER_STROKE); - - RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20); - g.draw(rect); - - g.setPaint(originalPaint); - g.setStroke(originalStroke); - } - - public void drawTextAnnotation(String text, GraphicInfo graphicInfo) { - int x = (int) graphicInfo.getX(); - int y = (int) graphicInfo.getY(); - int width = (int) graphicInfo.getWidth(); - int height = (int) graphicInfo.getHeight(); - - Font originalFont = g.getFont(); - Stroke originalStroke = g.getStroke(); - - g.setFont(ANNOTATION_FONT); - - Path2D path = new Path2D.Double(); - x += .5; - int lineLength = 18; - path.moveTo(x + lineLength, y); - path.lineTo(x, y); - path.lineTo(x, y + height); - path.lineTo(x + lineLength, y + height); - - path.lineTo(x + lineLength, y + height -1); - path.lineTo(x + 1, y + height -1); - path.lineTo(x + 1, y + 1); - path.lineTo(x + lineLength, y + 1); - path.closePath(); - - g.draw(path); - - int boxWidth = width - (2 * ANNOTATION_TEXT_PADDING); - int boxHeight = height - (2 * ANNOTATION_TEXT_PADDING); - int boxX = x + width/2 - boxWidth/2; - int boxY = y + height/2 - boxHeight/2; - - if (text != null && text.isEmpty() == false) { - drawMultilineAnnotationText(text, boxX, boxY, boxWidth, boxHeight); - } - - // restore originals - g.setFont(originalFont); - g.setStroke(originalStroke); - } - - public void drawLabel(String text, GraphicInfo graphicInfo){ - drawLabel(text, graphicInfo, true); - } - public void drawLabel(String text, GraphicInfo graphicInfo, boolean centered){ - float interline = 1.0f; - - // text - if (text != null && text.length()>0) { - Paint originalPaint = g.getPaint(); - Font originalFont = g.getFont(); - - g.setPaint(LABEL_COLOR); - g.setFont(LABEL_FONT); - - int wrapWidth = 100; - int textY = (int) graphicInfo.getY(); - - // TODO: use drawMultilineText() - AttributedString as = new AttributedString(text); - as.addAttribute(TextAttribute.FOREGROUND, g.getPaint()); - as.addAttribute(TextAttribute.FONT, g.getFont()); - AttributedCharacterIterator aci = as.getIterator(); - FontRenderContext frc = new FontRenderContext(null, true, false); - LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc); - - while (lbm.getPosition() < text.length()) { - TextLayout tl = lbm.nextLayout(wrapWidth); - textY += tl.getAscent(); - Rectangle2D bb = tl.getBounds(); - double tX = graphicInfo.getX(); - if (centered) { - tX += (int) (graphicInfo.getWidth() / 2 - bb.getWidth() / 2); - } - tl.draw(g, (float) tX, textY); - textY += tl.getDescent() + tl.getLeading() + (interline - 1.0f) * tl.getAscent(); - } - - // restore originals - g.setFont(originalFont); - g.setPaint(originalPaint); - } - } - - /** - * This method makes coordinates of connection flow better. - * @param sourceShapeType - * @param targetShapeType - * @param sourceGraphicInfo - * @param targetGraphicInfo - * @param graphicInfoList - * - */ - public List connectionPerfectionizer(SHAPE_TYPE sourceShapeType, SHAPE_TYPE targetShapeType, GraphicInfo sourceGraphicInfo, GraphicInfo targetGraphicInfo, List graphicInfoList) { - Shape shapeFirst = createShape(sourceShapeType, sourceGraphicInfo); - Shape shapeLast = createShape(targetShapeType, targetGraphicInfo); - - if (graphicInfoList != null && graphicInfoList.size() > 0) { - GraphicInfo graphicInfoFirst = graphicInfoList.get(0); - GraphicInfo graphicInfoLast = graphicInfoList.get(graphicInfoList.size()-1); - if (shapeFirst != null) { - graphicInfoFirst.setX(shapeFirst.getBounds2D().getCenterX()); - graphicInfoFirst.setY(shapeFirst.getBounds2D().getCenterY()); - } - if (shapeLast != null) { - graphicInfoLast.setX(shapeLast.getBounds2D().getCenterX()); - graphicInfoLast.setY(shapeLast.getBounds2D().getCenterY()); - } - - Point p = null; - - if (shapeFirst != null) { - Line2D.Double lineFirst = new Line2D.Double(graphicInfoFirst.getX(), graphicInfoFirst.getY(), graphicInfoList.get(1).getX(), graphicInfoList.get(1).getY()); - p = getIntersection(shapeFirst, lineFirst); - if (p != null) { - graphicInfoFirst.setX(p.getX()); - graphicInfoFirst.setY(p.getY()); - } - } - - if (shapeLast != null) { - Line2D.Double lineLast = new Line2D.Double(graphicInfoLast.getX(), graphicInfoLast.getY(), graphicInfoList.get(graphicInfoList.size()-2).getX(), graphicInfoList.get(graphicInfoList.size()-2).getY()); - p = getIntersection(shapeLast, lineLast); - if (p != null) { - graphicInfoLast.setX(p.getX()); - graphicInfoLast.setY(p.getY()); - } - } - } - - return graphicInfoList; - } - - /** - * This method creates shape by type and coordinates. - * @param shapeType - * @param graphicInfo - * @return Shape - */ - private static Shape createShape(SHAPE_TYPE shapeType, GraphicInfo graphicInfo) { - if (SHAPE_TYPE.Rectangle.equals(shapeType)) { - // source is rectangle - return new Rectangle2D.Double(graphicInfo.getX(), graphicInfo.getY(), graphicInfo.getWidth(), graphicInfo.getHeight()); - } else if (SHAPE_TYPE.Rhombus.equals(shapeType)) { - // source is rhombus - Path2D.Double rhombus = new Path2D.Double(); - rhombus.moveTo(graphicInfo.getX(), graphicInfo.getY() + graphicInfo.getHeight() / 2); - rhombus.lineTo(graphicInfo.getX() + graphicInfo.getWidth() / 2, graphicInfo.getY() + graphicInfo.getHeight()); - rhombus.lineTo(graphicInfo.getX() + graphicInfo.getWidth(), graphicInfo.getY() + graphicInfo.getHeight() / 2); - rhombus.lineTo(graphicInfo.getX() + graphicInfo.getWidth() / 2, graphicInfo.getY()); - rhombus.lineTo(graphicInfo.getX(), graphicInfo.getY() + graphicInfo.getHeight() / 2); - rhombus.closePath(); - return rhombus; - } else if (SHAPE_TYPE.Ellipse.equals(shapeType)) { - // source is ellipse - return new Ellipse2D.Double(graphicInfo.getX(), graphicInfo.getY(), graphicInfo.getWidth(), graphicInfo.getHeight()); - } else { - // unknown source element, just do not correct coordinates - } - return null; - } - - /** - * This method returns intersection point of shape border and line. - * - * @param shape - * @param line - * @return Point - */ - private static Point getIntersection(Shape shape, Line2D.Double line) { - if (shape instanceof Ellipse2D) { - return getEllipseIntersection(shape, line); - } else if (shape instanceof Rectangle2D || shape instanceof Path2D) { - return getShapeIntersection(shape, line); - } else { - // something strange - return null; - } - } - - /** - * This method calculates ellipse intersection with line - * @param shape - * Bounds of this shape used to calculate parameters of inscribed into this bounds ellipse. - * @param line - * @return Intersection point - */ - private static Point getEllipseIntersection(Shape shape, Line2D.Double line) { - double angle = Math.atan2(line.y2 - line.y1, line.x2 - line.x1); - double x = shape.getBounds2D().getWidth()/2 * Math.cos(angle) + shape.getBounds2D().getCenterX(); - double y = shape.getBounds2D().getHeight()/2 * Math.sin(angle) + shape.getBounds2D().getCenterY(); - Point p = new Point(); - p.setLocation(x, y); - return p; - } - - /** - * This method calculates shape intersection with line. - * - * @param shape - * @param line - * @return Intersection point - */ - private static Point getShapeIntersection(Shape shape, Line2D.Double line) { - PathIterator it = shape.getPathIterator(null); - double[] coords = new double[6]; - double[] pos = new double[2]; - Line2D.Double l = new Line2D.Double(); - while (!it.isDone()) { - int type = it.currentSegment(coords); - switch (type) { - case PathIterator.SEG_MOVETO: - pos[0] = coords[0]; - pos[1] = coords[1]; - break; - case PathIterator.SEG_LINETO: - l = new Line2D.Double(pos[0], pos[1], coords[0], coords[1]); - if (line.intersectsLine(l)) { - return getLinesIntersection(line, l); - } - pos[0] = coords[0]; - pos[1] = coords[1]; - break; - case PathIterator.SEG_CLOSE: - break; - default: - // whatever - } - it.next(); - } - return null; - } - - /** - * This method calculates intersections of two lines. - * @param a Line 1 - * @param b Line 2 - * @return Intersection point - */ - private static Point getLinesIntersection(Line2D a, Line2D b) { - double d = (a.getX1()-a.getX2())*(b.getY2()-b.getY1()) - (a.getY1()-a.getY2())*(b.getX2()-b.getX1()); - double da = (a.getX1()-b.getX1())*(b.getY2()-b.getY1()) - (a.getY1()-b.getY1())*(b.getX2()-b.getX1()); - // double db = (a.getX1()-a.getX2())*(a.getY1()-b.getY1()) - (a.getY1()-a.getY2())*(a.getX1()-b.getX1()); - double ta = da/d; - // double tb = db/d; - Point p = new Point(); - p.setLocation(a.getX1()+ta*(a.getX2()-a.getX1()), a.getY1()+ta*(a.getY2()-a.getY1())); - return p; - } -} diff --git a/src/org/activiti/image/impl/DefaultProcessDiagramGenerator.java b/src/org/activiti/image/impl/DefaultProcessDiagramGenerator.java deleted file mode 100644 index d5003ef1..00000000 --- a/src/org/activiti/image/impl/DefaultProcessDiagramGenerator.java +++ /dev/null @@ -1,984 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.activiti.image.impl; - -import java.awt.image.BufferedImage; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.activiti.bpmn.model.Activity; -import org.activiti.bpmn.model.Artifact; -import org.activiti.bpmn.model.Association; -import org.activiti.bpmn.model.AssociationDirection; -import org.activiti.bpmn.model.BaseElement; -import org.activiti.bpmn.model.BoundaryEvent; -import org.activiti.bpmn.model.BpmnModel; -import org.activiti.bpmn.model.BusinessRuleTask; -import org.activiti.bpmn.model.CallActivity; -import org.activiti.bpmn.model.CompensateEventDefinition; -import org.activiti.bpmn.model.EndEvent; -import org.activiti.bpmn.model.ErrorEventDefinition; -import org.activiti.bpmn.model.Event; -import org.activiti.bpmn.model.EventDefinition; -import org.activiti.bpmn.model.EventGateway; -import org.activiti.bpmn.model.EventSubProcess; -import org.activiti.bpmn.model.ExclusiveGateway; -import org.activiti.bpmn.model.FlowElement; -import org.activiti.bpmn.model.FlowElementsContainer; -import org.activiti.bpmn.model.FlowNode; -import org.activiti.bpmn.model.Gateway; -import org.activiti.bpmn.model.GraphicInfo; -import org.activiti.bpmn.model.InclusiveGateway; -import org.activiti.bpmn.model.IntermediateCatchEvent; -import org.activiti.bpmn.model.Lane; -import org.activiti.bpmn.model.ManualTask; -import org.activiti.bpmn.model.MessageEventDefinition; -import org.activiti.bpmn.model.MultiInstanceLoopCharacteristics; -import org.activiti.bpmn.model.ParallelGateway; -import org.activiti.bpmn.model.Pool; -import org.activiti.bpmn.model.Process; -import org.activiti.bpmn.model.ReceiveTask; -import org.activiti.bpmn.model.ScriptTask; -import org.activiti.bpmn.model.SendTask; -import org.activiti.bpmn.model.SequenceFlow; -import org.activiti.bpmn.model.ServiceTask; -import org.activiti.bpmn.model.SignalEventDefinition; -import org.activiti.bpmn.model.StartEvent; -import org.activiti.bpmn.model.SubProcess; -import org.activiti.bpmn.model.Task; -import org.activiti.bpmn.model.TextAnnotation; -import org.activiti.bpmn.model.ThrowEvent; -import org.activiti.bpmn.model.TimerEventDefinition; -import org.activiti.bpmn.model.UserTask; -import org.activiti.image.ProcessDiagramGenerator; - -/** - * Class to generate an image based the diagram interchange information in a - * BPMN 2.0 process. - * - * @author Joram Barrez - * @author Tijs Rademakers - */ -public class DefaultProcessDiagramGenerator implements ProcessDiagramGenerator { - - protected Map, ActivityDrawInstruction> activityDrawInstructions = new HashMap, ActivityDrawInstruction>(); - protected Map, ArtifactDrawInstruction> artifactDrawInstructions = new HashMap, ArtifactDrawInstruction>(); - - public DefaultProcessDiagramGenerator() { - this(1.0); - } - - // The instructions on how to draw a certain construct is - // created statically and stored in a map for performance. - public DefaultProcessDiagramGenerator(final double scaleFactor) { - // start event - activityDrawInstructions.put(StartEvent.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - StartEvent startEvent = (StartEvent) flowNode; - if (startEvent.getEventDefinitions() != null && !startEvent.getEventDefinitions().isEmpty()) { - EventDefinition eventDefinition = startEvent.getEventDefinitions().get(0); - if (eventDefinition instanceof TimerEventDefinition) { - processDiagramCanvas.drawTimerStartEvent(graphicInfo, scaleFactor); - } else if (eventDefinition instanceof ErrorEventDefinition) { - processDiagramCanvas.drawErrorStartEvent(graphicInfo, scaleFactor); - } else if (eventDefinition instanceof SignalEventDefinition) { - processDiagramCanvas.drawSignalStartEvent(graphicInfo, scaleFactor); - } else if (eventDefinition instanceof MessageEventDefinition) { - processDiagramCanvas.drawMessageStartEvent(graphicInfo, scaleFactor); - } else { - processDiagramCanvas.drawNoneStartEvent(graphicInfo); - } - } else { - processDiagramCanvas.drawNoneStartEvent(graphicInfo); - } - } - }); - - // signal catch - activityDrawInstructions.put(IntermediateCatchEvent.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - IntermediateCatchEvent intermediateCatchEvent = (IntermediateCatchEvent) flowNode; - if (intermediateCatchEvent.getEventDefinitions() != null && !intermediateCatchEvent.getEventDefinitions() - .isEmpty()) { - if (intermediateCatchEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition) { - processDiagramCanvas.drawCatchingSignalEvent(flowNode.getName(), graphicInfo, true, scaleFactor); - } else if (intermediateCatchEvent.getEventDefinitions().get(0) instanceof TimerEventDefinition) { - processDiagramCanvas.drawCatchingTimerEvent(flowNode.getName(), graphicInfo, true, scaleFactor); - } else if (intermediateCatchEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) { - processDiagramCanvas.drawCatchingMessageEvent(flowNode.getName(), graphicInfo, true, scaleFactor); - } - } - } - }); - - // signal throw - activityDrawInstructions.put(ThrowEvent.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - ThrowEvent throwEvent = (ThrowEvent) flowNode; - if (throwEvent.getEventDefinitions() != null && !throwEvent.getEventDefinitions().isEmpty()) { - if (throwEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition) { - processDiagramCanvas.drawThrowingSignalEvent(graphicInfo, scaleFactor); - } else if (throwEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) { - processDiagramCanvas.drawThrowingCompensateEvent(graphicInfo, scaleFactor); - } else { - processDiagramCanvas.drawThrowingNoneEvent(graphicInfo, scaleFactor); - } - } else { - processDiagramCanvas.drawThrowingNoneEvent(graphicInfo, scaleFactor); - } - } - }); - - // end event - activityDrawInstructions.put(EndEvent.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - EndEvent endEvent = (EndEvent) flowNode; - if (endEvent.getEventDefinitions() != null && !endEvent.getEventDefinitions().isEmpty()) { - if (endEvent.getEventDefinitions().get(0) instanceof ErrorEventDefinition) { - processDiagramCanvas.drawErrorEndEvent(flowNode.getName(), graphicInfo, scaleFactor); - } else { - processDiagramCanvas.drawNoneEndEvent(graphicInfo, scaleFactor); - } - } else { - processDiagramCanvas.drawNoneEndEvent(graphicInfo, scaleFactor); - } - } - }); - - // task - activityDrawInstructions.put(Task.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawTask(flowNode.getName(), graphicInfo); - } - }); - - // user task - activityDrawInstructions.put(UserTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawUserTask(flowNode.getName(), graphicInfo, scaleFactor); - } - }); - - // script task - activityDrawInstructions.put(ScriptTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawScriptTask(flowNode.getName(), graphicInfo, scaleFactor); - } - }); - - // service task - activityDrawInstructions.put(ServiceTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - ServiceTask serviceTask = (ServiceTask) flowNode; - if ("camel".equalsIgnoreCase(serviceTask.getType())) { - processDiagramCanvas.drawCamelTask(serviceTask.getName(), graphicInfo, scaleFactor); - } else if ("mule".equalsIgnoreCase(serviceTask.getType())) { - processDiagramCanvas.drawMuleTask(serviceTask.getName(), graphicInfo, scaleFactor); - } else { - processDiagramCanvas.drawServiceTask(serviceTask.getName(), graphicInfo, scaleFactor); - } - } - }); - - // receive task - activityDrawInstructions.put(ReceiveTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawReceiveTask(flowNode.getName(), graphicInfo, scaleFactor); - } - }); - - // send task - activityDrawInstructions.put(SendTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawSendTask(flowNode.getName(), graphicInfo, scaleFactor); - } - }); - - // manual task - activityDrawInstructions.put(ManualTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawManualTask(flowNode.getName(), graphicInfo, scaleFactor); - } - }); - - // businessRuleTask task - activityDrawInstructions.put(BusinessRuleTask.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawBusinessRuleTask(flowNode.getName(), graphicInfo, scaleFactor); - } - }); - - // exclusive gateway - activityDrawInstructions.put(ExclusiveGateway.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawExclusiveGateway(graphicInfo, scaleFactor); - } - }); - - // inclusive gateway - activityDrawInstructions.put(InclusiveGateway.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawInclusiveGateway(graphicInfo, scaleFactor); - } - }); - - // parallel gateway - activityDrawInstructions.put(ParallelGateway.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawParallelGateway(graphicInfo, scaleFactor); - } - }); - - // event based gateway - activityDrawInstructions.put(EventGateway.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawEventBasedGateway(graphicInfo, scaleFactor); - } - }); - - - // Boundary timer - activityDrawInstructions.put(BoundaryEvent.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - BoundaryEvent boundaryEvent = (BoundaryEvent) flowNode; - if (boundaryEvent.getEventDefinitions() != null && !boundaryEvent.getEventDefinitions().isEmpty()) { - if (boundaryEvent.getEventDefinitions().get(0) instanceof TimerEventDefinition) { - - processDiagramCanvas.drawCatchingTimerEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor); - - } else if (boundaryEvent.getEventDefinitions().get(0) instanceof ErrorEventDefinition) { - - processDiagramCanvas.drawCatchingErrorEvent(graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor); - - } else if (boundaryEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition) { - processDiagramCanvas.drawCatchingSignalEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor); - - } else if (boundaryEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) { - processDiagramCanvas.drawCatchingMessageEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor); - - } else if (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) { - processDiagramCanvas.drawCatchingCompensateEvent(graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor); - } - } - - } - }); - - // subprocess - activityDrawInstructions.put(SubProcess.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - if (graphicInfo.getExpanded() != null && !graphicInfo.getExpanded()) { - processDiagramCanvas.drawCollapsedSubProcess(flowNode.getName(), graphicInfo, false); - } else { - processDiagramCanvas.drawExpandedSubProcess(flowNode.getName(), graphicInfo, false, scaleFactor); - } - } - }); - - // Event subprocess - activityDrawInstructions.put(EventSubProcess.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - if (graphicInfo.getExpanded() != null && !graphicInfo.getExpanded()) { - processDiagramCanvas.drawCollapsedSubProcess(flowNode.getName(), graphicInfo, true); - } else { - processDiagramCanvas.drawExpandedSubProcess(flowNode.getName(), graphicInfo, true, scaleFactor); - } - } - }); - - // call activity - activityDrawInstructions.put(CallActivity.class, new ActivityDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - processDiagramCanvas.drawCollapsedCallActivity(flowNode.getName(), graphicInfo); - } - }); - - // text annotation - artifactDrawInstructions.put(TextAnnotation.class, new ArtifactDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, Artifact artifact) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(artifact.getId()); - TextAnnotation textAnnotation = (TextAnnotation) artifact; - processDiagramCanvas.drawTextAnnotation(textAnnotation.getText(), graphicInfo); - } - }); - - // association - artifactDrawInstructions.put(Association.class, new ArtifactDrawInstruction() { - - public void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, Artifact artifact) { - Association association = (Association) artifact; - String sourceRef = association.getSourceRef(); - String targetRef = association.getTargetRef(); - - // source and target can be instance of FlowElement or Artifact - BaseElement sourceElement = bpmnModel.getFlowElement(sourceRef); - BaseElement targetElement = bpmnModel.getFlowElement(targetRef); - if (sourceElement == null) { - sourceElement = bpmnModel.getArtifact(sourceRef); - } - if (targetElement == null) { - targetElement = bpmnModel.getArtifact(targetRef); - } - List graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(artifact.getId()); - graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList); - int xPoints[]= new int[graphicInfoList.size()]; - int yPoints[]= new int[graphicInfoList.size()]; - for (int i=1; i highLightedActivities, List highLightedFlows, - String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor) { - - return generateProcessDiagram(bpmnModel, imageType, highLightedActivities, highLightedFlows, - activityFontName, labelFontName, annotationFontName, customClassLoader, scaleFactor).generateImage(imageType); - } - - public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List highLightedActivities, List highLightedFlows) { - return generateDiagram(bpmnModel, imageType, highLightedActivities, highLightedFlows, null, null, null, null, 1.0); - } - - public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, - List highLightedActivities, List highLightedFlows, double scaleFactor) { - return generateDiagram(bpmnModel, imageType, highLightedActivities, highLightedFlows, null, null, null, null, scaleFactor); - } - - public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List highLightedActivities) { - return generateDiagram(bpmnModel, imageType, highLightedActivities, Collections.emptyList()); - } - - public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List highLightedActivities, double scaleFactor) { - return generateDiagram(bpmnModel, imageType, highLightedActivities, Collections.emptyList(), scaleFactor); - } - - public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) { - return generateDiagram(bpmnModel, imageType, Collections.emptyList(), Collections.emptyList(), - activityFontName, labelFontName, annotationFontName, customClassLoader, 1.0); - } - - public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, - String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor) { - - return generateDiagram(bpmnModel, imageType, Collections.emptyList(), Collections.emptyList(), - activityFontName, labelFontName, annotationFontName, customClassLoader, scaleFactor); - } - - public InputStream generatePngDiagram(BpmnModel bpmnModel) { - return generatePngDiagram(bpmnModel, 1.0); - } - - public InputStream generatePngDiagram(BpmnModel bpmnModel, double scaleFactor) { - return generateDiagram(bpmnModel, "png", Collections.emptyList(), Collections.emptyList(), scaleFactor); - } - - public InputStream generateJpgDiagram(BpmnModel bpmnModel) { - return generateJpgDiagram(bpmnModel, 1.0); - } - - public InputStream generateJpgDiagram(BpmnModel bpmnModel, double scaleFactor) { - return generateDiagram(bpmnModel, "jpg", Collections.emptyList(), Collections.emptyList()); - } - - public BufferedImage generateImage(BpmnModel bpmnModel, String imageType, List highLightedActivities, List highLightedFlows, - String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor) { - - return generateProcessDiagram(bpmnModel, imageType, highLightedActivities, highLightedFlows, - activityFontName, labelFontName, annotationFontName, customClassLoader, scaleFactor).generateBufferedImage(imageType); - } - - public BufferedImage generateImage(BpmnModel bpmnModel, String imageType, - List highLightedActivities, List highLightedFlows, double scaleFactor) { - - return generateImage(bpmnModel, imageType, highLightedActivities, highLightedFlows, null, null, null, null, scaleFactor); - } - - public BufferedImage generatePngImage(BpmnModel bpmnModel, double scaleFactor) { - return generateImage(bpmnModel, "png", Collections.emptyList(), Collections.emptyList(), scaleFactor); - } - - protected DefaultProcessDiagramCanvas generateProcessDiagram(BpmnModel bpmnModel, String imageType, - List highLightedActivities, List highLightedFlows, - String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor) { - - prepareBpmnModel(bpmnModel); - - DefaultProcessDiagramCanvas processDiagramCanvas = initProcessDiagramCanvas(bpmnModel, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader); - - // Draw pool shape, if process is participant in collaboration - for (Pool pool : bpmnModel.getPools()) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(pool.getId()); - processDiagramCanvas.drawPoolOrLane(pool.getName(), graphicInfo); - } - - // Draw lanes - for (Process process : bpmnModel.getProcesses()) { - for (Lane lane : process.getLanes()) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(lane.getId()); - processDiagramCanvas.drawPoolOrLane(lane.getName(), graphicInfo); - } - } - - // Draw activities and their sequence-flows - for (Process process: bpmnModel.getProcesses()) { - for (FlowNode flowNode : process.findFlowElementsOfType(FlowNode.class)) { - drawActivity(processDiagramCanvas, bpmnModel, flowNode, highLightedActivities, highLightedFlows, scaleFactor); - } - } - - // Draw artifacts - for (Process process : bpmnModel.getProcesses()) { - - for (Artifact artifact : process.getArtifacts()) { - drawArtifact(processDiagramCanvas, bpmnModel, artifact); - } - - List subProcesses = process.findFlowElementsOfType(SubProcess.class, true); - if (subProcesses != null) { - for (SubProcess subProcess : subProcesses) { - for (Artifact subProcessArtifact : subProcess.getArtifacts()) { - drawArtifact(processDiagramCanvas, bpmnModel, subProcessArtifact); - } - } - } - } - - return processDiagramCanvas; - } - - protected void prepareBpmnModel(BpmnModel bpmnModel) { - - // Need to make sure all elements have positive x and y. - // Check all graphicInfo and update the elements accordingly - - List allGraphicInfos = new ArrayList(); - if (bpmnModel.getLocationMap() != null) { - allGraphicInfos.addAll(bpmnModel.getLocationMap().values()); - } - if (bpmnModel.getLabelLocationMap() != null) { - allGraphicInfos.addAll(bpmnModel.getLabelLocationMap().values()); - } - if (bpmnModel.getFlowLocationMap() != null) { - for (List flowGraphicInfos : bpmnModel.getFlowLocationMap().values()) { - allGraphicInfos.addAll(flowGraphicInfos); - } - } - - if (allGraphicInfos.size() > 0) { - - boolean needsTranslationX = false; - boolean needsTranslationY = false; - - double lowestX = 0.0; - double lowestY = 0.0; - - // Collect lowest x and y - for (GraphicInfo graphicInfo : allGraphicInfos) { - - double x = graphicInfo.getX(); - double y = graphicInfo.getY(); - - if (x < lowestX) { - needsTranslationX = true; - lowestX = x; - } - if (y < lowestY) { - needsTranslationY = true; - lowestY = y; - } - - } - - // Update all graphicInfo objects - if (needsTranslationX || needsTranslationY) { - - double translationX = Math.abs(lowestX); - double translationY = Math.abs(lowestY); - - for (GraphicInfo graphicInfo : allGraphicInfos) { - if (needsTranslationX) { - graphicInfo.setX(graphicInfo.getX() + translationX); - } - if(needsTranslationY) { - graphicInfo.setY(graphicInfo.getY() + translationY); - } - } - } - - } - - } - - protected void drawActivity(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, - FlowNode flowNode, List highLightedActivities, List highLightedFlows, double scaleFactor) { - - ActivityDrawInstruction drawInstruction = activityDrawInstructions.get(flowNode.getClass()); - if (drawInstruction != null) { - - drawInstruction.draw(processDiagramCanvas, bpmnModel, flowNode); - - // Gather info on the multi instance marker - boolean multiInstanceSequential = false, multiInstanceParallel = false, collapsed = false; - if (flowNode instanceof Activity) { - Activity activity = (Activity) flowNode; - MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = activity.getLoopCharacteristics(); - if (multiInstanceLoopCharacteristics != null) { - multiInstanceSequential = multiInstanceLoopCharacteristics.isSequential(); - multiInstanceParallel = !multiInstanceSequential; - } - } - - // Gather info on the collapsed marker - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - if (flowNode instanceof SubProcess) { - collapsed = graphicInfo.getExpanded() != null && !graphicInfo.getExpanded(); - } else if (flowNode instanceof CallActivity) { - collapsed = true; - } - - if (scaleFactor == 1.0) { - // Actually draw the markers - processDiagramCanvas.drawActivityMarkers((int) graphicInfo.getX(), (int) graphicInfo.getY(),(int) graphicInfo.getWidth(), (int) graphicInfo.getHeight(), - multiInstanceSequential, multiInstanceParallel, collapsed); - } - - // Draw highlighted activities - if (highLightedActivities.contains(flowNode.getId())) { - drawHighLight(processDiagramCanvas, bpmnModel.getGraphicInfo(flowNode.getId())); - } - - } - - // Outgoing transitions of activity - for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) { - boolean highLighted = (highLightedFlows.contains(sequenceFlow.getId())); - String defaultFlow = null; - if (flowNode instanceof Activity) { - defaultFlow = ((Activity) flowNode).getDefaultFlow(); - } else if (flowNode instanceof Gateway) { - defaultFlow = ((Gateway) flowNode).getDefaultFlow(); - } - - boolean isDefault = false; - if (defaultFlow != null && defaultFlow.equalsIgnoreCase(sequenceFlow.getId())) { - isDefault = true; - } - boolean drawConditionalIndicator = sequenceFlow.getConditionExpression() != null && !(flowNode instanceof Gateway); - - String sourceRef = sequenceFlow.getSourceRef(); - String targetRef = sequenceFlow.getTargetRef(); - FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); - FlowElement targetElement = bpmnModel.getFlowElement(targetRef); - List graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId()); - if (graphicInfoList != null && graphicInfoList.size() > 0) { - graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList); - int xPoints[]= new int[graphicInfoList.size()]; - int yPoints[]= new int[graphicInfoList.size()]; - - for (int i=1; i connectionPerfectionizer(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, BaseElement sourceElement, BaseElement targetElement, List graphicInfoList) { - GraphicInfo sourceGraphicInfo = bpmnModel.getGraphicInfo(sourceElement.getId()); - GraphicInfo targetGraphicInfo = bpmnModel.getGraphicInfo(targetElement.getId()); - - DefaultProcessDiagramCanvas.SHAPE_TYPE sourceShapeType = getShapeType(sourceElement); - DefaultProcessDiagramCanvas.SHAPE_TYPE targetShapeType = getShapeType(targetElement); - - return processDiagramCanvas.connectionPerfectionizer(sourceShapeType, targetShapeType, sourceGraphicInfo, targetGraphicInfo, graphicInfoList); - } - - /** - * This method returns shape type of base element.
- * Each element can be presented as rectangle, rhombus, or ellipse. - * @param baseElement - * @return DefaultProcessDiagramCanvas.SHAPE_TYPE - */ - protected static DefaultProcessDiagramCanvas.SHAPE_TYPE getShapeType(BaseElement baseElement) { - if (baseElement instanceof Task || baseElement instanceof Activity || baseElement instanceof TextAnnotation) { - return DefaultProcessDiagramCanvas.SHAPE_TYPE.Rectangle; - } else if (baseElement instanceof Gateway) { - return DefaultProcessDiagramCanvas.SHAPE_TYPE.Rhombus; - } else if (baseElement instanceof Event) { - return DefaultProcessDiagramCanvas.SHAPE_TYPE.Ellipse; - } else { - // unknown source element, just do not correct coordinates - } - return null; - } - - protected static GraphicInfo getLineCenter(List graphicInfoList) { - GraphicInfo gi = new GraphicInfo(); - - int xPoints[]= new int[graphicInfoList.size()]; - int yPoints[]= new int[graphicInfoList.size()]; - - double length = 0; - double[] lengths = new double[graphicInfoList.size()]; - lengths[0] = 0; - double m; - for (int i=1; i m) { - break; - } - } - - GraphicInfo graphicInfo1 = graphicInfoList.get(p1); - GraphicInfo graphicInfo2 = graphicInfoList.get(p2); - - double AB = (int)graphicInfo2.getX() - (int)graphicInfo1.getX(); - double OA = (int)graphicInfo2.getY() - (int)graphicInfo1.getY(); - double OB = lengths[p2] - lengths[p1]; - double ob = m - lengths[p1]; - double ab = AB * ob / OB; - double oa = OA * ob / OB; - - double mx = graphicInfo1.getX() + ab; - double my = graphicInfo1.getY() + oa; - - gi.setX(mx); - gi.setY(my); - return gi; - } - - protected void drawArtifact(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, Artifact artifact) { - ArtifactDrawInstruction drawInstruction = artifactDrawInstructions.get(artifact.getClass()); - if (drawInstruction != null) { - drawInstruction.draw(processDiagramCanvas, bpmnModel, artifact); - } - } - - private static void drawHighLight(DefaultProcessDiagramCanvas processDiagramCanvas, GraphicInfo graphicInfo) { - processDiagramCanvas.drawHighLight((int) graphicInfo.getX(), (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight()); - - } - - protected static DefaultProcessDiagramCanvas initProcessDiagramCanvas(BpmnModel bpmnModel, String imageType, - String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) { - - // We need to calculate maximum values to know how big the image will be in its entirety - double minX = Double.MAX_VALUE; - double maxX = 0; - double minY = Double.MAX_VALUE; - double maxY = 0; - - for (Pool pool : bpmnModel.getPools()) { - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(pool.getId()); - minX = graphicInfo.getX(); - maxX = graphicInfo.getX() + graphicInfo.getWidth(); - minY = graphicInfo.getY(); - maxY = graphicInfo.getY() + graphicInfo.getHeight(); - } - - List flowNodes = gatherAllFlowNodes(bpmnModel); - for (FlowNode flowNode : flowNodes) { - - GraphicInfo flowNodeGraphicInfo = bpmnModel.getGraphicInfo(flowNode.getId()); - - // width - if (flowNodeGraphicInfo.getX() + flowNodeGraphicInfo.getWidth() > maxX) { - maxX = flowNodeGraphicInfo.getX() + flowNodeGraphicInfo.getWidth(); - } - if (flowNodeGraphicInfo.getX() < minX) { - minX = flowNodeGraphicInfo.getX(); - } - // height - if (flowNodeGraphicInfo.getY() + flowNodeGraphicInfo.getHeight() > maxY) { - maxY = flowNodeGraphicInfo.getY() + flowNodeGraphicInfo.getHeight(); - } - if (flowNodeGraphicInfo.getY() < minY) { - minY = flowNodeGraphicInfo.getY(); - } - - for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) { - List graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId()); - if (graphicInfoList != null) { - for (GraphicInfo graphicInfo : graphicInfoList) { - // width - if (graphicInfo.getX() > maxX) { - maxX = graphicInfo.getX(); - } - if (graphicInfo.getX() < minX) { - minX = graphicInfo.getX(); - } - // height - if (graphicInfo.getY() > maxY) { - maxY = graphicInfo.getY(); - } - if (graphicInfo.getY()< minY) { - minY = graphicInfo.getY(); - } - } - } - } - } - - List artifacts = gatherAllArtifacts(bpmnModel); - for (Artifact artifact : artifacts) { - - GraphicInfo artifactGraphicInfo = bpmnModel.getGraphicInfo(artifact.getId()); - - if (artifactGraphicInfo != null) { - // width - if (artifactGraphicInfo.getX() + artifactGraphicInfo.getWidth() > maxX) { - maxX = artifactGraphicInfo.getX() + artifactGraphicInfo.getWidth(); - } - if (artifactGraphicInfo.getX() < minX) { - minX = artifactGraphicInfo.getX(); - } - // height - if (artifactGraphicInfo.getY() + artifactGraphicInfo.getHeight() > maxY) { - maxY = artifactGraphicInfo.getY() + artifactGraphicInfo.getHeight(); - } - if (artifactGraphicInfo.getY() < minY) { - minY = artifactGraphicInfo.getY(); - } - } - - List graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(artifact.getId()); - if (graphicInfoList != null) { - for (GraphicInfo graphicInfo : graphicInfoList) { - // width - if (graphicInfo.getX() > maxX) { - maxX = graphicInfo.getX(); - } - if (graphicInfo.getX() < minX) { - minX = graphicInfo.getX(); - } - // height - if (graphicInfo.getY() > maxY) { - maxY = graphicInfo.getY(); - } - if (graphicInfo.getY()< minY) { - minY = graphicInfo.getY(); - } - } - } - } - - int nrOfLanes = 0; - for (Process process : bpmnModel.getProcesses()) { - for (Lane l : process.getLanes()) { - - nrOfLanes++; - - GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(l.getId()); - // // width - if (graphicInfo.getX() + graphicInfo.getWidth() > maxX) { - maxX = graphicInfo.getX() + graphicInfo.getWidth(); - } - if (graphicInfo.getX() < minX) { - minX = graphicInfo.getX(); - } - // height - if (graphicInfo.getY() + graphicInfo.getHeight() > maxY) { - maxY = graphicInfo.getY() + graphicInfo.getHeight(); - } - if (graphicInfo.getY() < minY) { - minY = graphicInfo.getY(); - } - } - } - - // Special case, see https://activiti.atlassian.net/browse/ACT-1431 - if (flowNodes.isEmpty() && bpmnModel.getPools().isEmpty() && nrOfLanes == 0) { - // Nothing to show - minX = 0; - minY = 0; - } - - return new DefaultProcessDiagramCanvas((int) maxX + 10,(int) maxY + 10, (int) minX, (int) minY, - imageType, activityFontName, labelFontName, annotationFontName, customClassLoader); - } - - protected static List gatherAllArtifacts(BpmnModel bpmnModel) { - List artifacts = new ArrayList(); - for (Process process : bpmnModel.getProcesses()) { - artifacts.addAll(process.getArtifacts()); - } - return artifacts; - } - - protected static List gatherAllFlowNodes(BpmnModel bpmnModel) { - List flowNodes = new ArrayList(); - for (Process process : bpmnModel.getProcesses()) { - flowNodes.addAll(gatherAllFlowNodes(process)); - } - return flowNodes; - } - - protected static List gatherAllFlowNodes(FlowElementsContainer flowElementsContainer) { - List flowNodes = new ArrayList(); - for (FlowElement flowElement : flowElementsContainer.getFlowElements()) { - if (flowElement instanceof FlowNode) { - flowNodes.add((FlowNode) flowElement); - } - if (flowElement instanceof FlowElementsContainer) { - flowNodes.addAll(gatherAllFlowNodes((FlowElementsContainer) flowElement)); - } - } - return flowNodes; - } - - public Map, ActivityDrawInstruction> getActivityDrawInstructions() { - return activityDrawInstructions; - } - - public void setActivityDrawInstructions( - Map, ActivityDrawInstruction> activityDrawInstructions) { - this.activityDrawInstructions = activityDrawInstructions; - } - - public Map, ArtifactDrawInstruction> getArtifactDrawInstructions() { - return artifactDrawInstructions; - } - - public void setArtifactDrawInstructions( - Map, ArtifactDrawInstruction> artifactDrawInstructions) { - this.artifactDrawInstructions = artifactDrawInstructions; - } - - - - protected interface ActivityDrawInstruction { - void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode); - } - - protected interface ArtifactDrawInstruction { - void draw(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, Artifact artifact); - } -}